diff --git a/3rdparty/nick/StopWatch.h b/3rdparty/nick/StopWatch.h new file mode 100644 index 0000000..afa4ee9 --- /dev/null +++ b/3rdparty/nick/StopWatch.h @@ -0,0 +1,34 @@ +#pragma once +#include + +class StopWatch +{ +public: + StopWatch() { + _start = std::chrono::steady_clock::now(); + } + + void reset() { + _start = std::chrono::steady_clock::now(); + } + + double elapsed_s() { + return std::chrono::duration(std::chrono::steady_clock::now() - _start).count(); + } + + double elapsed_ms() { + return std::chrono::duration(std::chrono::steady_clock::now() - _start).count(); + } + + double elapsed_us() { + return std::chrono::duration(std::chrono::steady_clock::now() - _start).count(); + } + + double elapsed_ns() { + return std::chrono::duration(std::chrono::steady_clock::now() - _start).count(); + } + +private: + std::chrono::steady_clock::time_point _start; +}; + diff --git a/3rdparty/nick/callbackdefines.h b/3rdparty/nick/callbackdefines.h new file mode 100644 index 0000000..dcccb53 --- /dev/null +++ b/3rdparty/nick/callbackdefines.h @@ -0,0 +1,12 @@ +#ifndef CALLBACKDEFINESH +#define CALLBACKDEFINESH +#include +typedef void(*usbreport_callback)(int conditioncode,void* usrdata); + +typedef void(*usbcallback)(int conditioncode,void* usrdata); + +//typedef void(*onimagecallback)(void* mat, int bpp, int statuscode); +typedef std::decay::type onimagecallback; +typedef std::decay::type usbcallback; + +#endif diff --git a/3rdparty/nick/common.h b/3rdparty/nick/common.h new file mode 100644 index 0000000..ff84135 --- /dev/null +++ b/3rdparty/nick/common.h @@ -0,0 +1,280 @@ +#ifndef COMMON_H +#define COMMON_H +#ifdef __cplusplus +extern "C"{ +#endif + +typedef struct hg_tag_SIZE +{ + long cx; + long cy; +}CSSIZE, *PCSSIZE, *LPCSSIZE; + +typedef CSSIZE CSSIZEL; +typedef CSSIZE *PCSSIZEL, *LPCSSIZEL; + +enum hg_tagUsbSupported +{ + /*停止扫描**/ + SCAN_STOP = -1, + /*异常******/ + HAVE_ERROR = -2, + /*正常状态****/ + NORMAL = 0, + /*开盖***/ + OPEN_COVER = 1, + /*无纸****/ + NO_FEED = 2, + /*搓纸失败****/ + FEED_IN_ERROR = 4, + /**卡纸*****/ + PAPER_JAM = 8, + /**检测到双张**/ + DETECT_DOUBLE_FEED = 16, + /**检测到订书钉**/ + DETECT_STAPLE = 32, + /*纸张倾斜******/ + PAPER_SKEW = 64, + /**自动模式****/ + AUTO_SCAN_MODE = 65, + /**手动模式****/ + MANAUL_SCAN_MODE = 66, + /**计数模式****/ + COUNT_MODE = 67, + /*硬件错误*****/ + HARDWARE_ERROR = 68, + /*FPGA崩溃***/ + FPGA_ERROR = 68, + /*开始******/ + START_SCAN = 69, + /**停止*****/ + STOP_SCAN = 70, + /**有图*****/ + HAVE_IMAGE = 71, + /*更新扫描参数***/ + UPDATE_SCAN_PARAMETER = 72, + /*PC繁忙或出错***/ + PC_SCAN_BUSY_or_ERROR = 73, + /*USB链接断开***/ + DEVICE_OFF_LINE = 74 +}; +typedef enum hg_tagUsbSupported tagUsbSupported; + + enum hg_twSS +{ + None = 0, + A4Letter = 1, + A4 = 1, + B5Letter = 2, + JISB5 = 2, + B5 = 2, + USLetter = 3, + USLegal = 4, + A5 = 5, + B4 = 6, + ISOB4 = 6, + B6 = 7, + ISOB6 = 7, + USLedger = 9, + USExecutive = 10, + A3 = 11, + B3 = 12, + ISOB3 = 12, + A6 = 13, + C4 = 14, + C5 = 15, + C6 = 16, + _4A0 = 17, + _2A0 = 18, + A0 = 19, + A1 = 20, + A2 = 21, + A7 = 22, + A8 = 23, + A9 = 24, + A10 = 25, + ISOB0 = 26, + ISOB1 = 27, + ISOB2 = 28, + ISOB5 = 29, + ISOB7 = 30, + ISOB8 = 31, + ISOB9 = 32, + ISOB10 = 33, + JISB0 = 34, + JISB1 = 35, + JISB2 = 36, + JISB3 = 37, + JISB4 = 38, + JISB6 = 39, + JISB7 = 40, + JISB8 = 41, + JISB9 = 42, + JISB10 = 43, + C0 = 44, + C1 = 45, + C2 = 46, + C3 = 47, + C7 = 48, + C8 = 49, + C9 = 50, + C10 = 51, + USStatement = 52, + BusinessCard = 53, + MaxSize = 54, +}; +typedef enum hg_twSS TwSS; + +enum hg_tagFrontBack +{ + FRONT_PAGE = 0, + BACK_PAGE +}; +typedef enum hg_tagFrontBack FRONTBACK; + +enum hg_tagFilter +{ + FILTER_RED, + FILTER_GREEN, + FILTER_BLUE, + FILTER_ALL, + FILTER_NONE, + ENHANCE_RED, + ENHANCE_GREEN, + ENHANCE_BLUE + + +}; +typedef enum hg_tagFilter Filter; + +enum hg_tagOrentations +{ + ROTATE_NONE = 0, + ROTATE_90, + ROTATE_180, + ROTATE_270, + AUTOTEXT_DETECT +}; +typedef enum hg_tagOrentations Orentations; + +struct hg_tagOutHoleParam +{ + int OutHole; + int OutHoleValue;/*1~50;*/ +}; +typedef struct hg_tagOutHoleParam OutHoleParams; + +struct hg_tagCropRect +{ + int enable; + int x; /*****自定义裁切区域左上角x坐标*/ + int y; /*****自定义裁切区域左上角y坐标*/ + int width; /*****自定义裁切区域宽度*******/ + int height; /*****自定义裁切区域高度*******/ +}; +typedef struct hg_tagCropRect CropRect; + +struct hg_tagCustomGamma +{ + int isDefined; + unsigned char* table; + int tableLength; +}; +typedef struct hg_tagCustomGamma CustomGamma; + +enum hg_PaperAlign { + Rot0 = 0, + Rot270 = 3, + AutoTextOrientation = 5 +}; +typedef enum hg_PaperAlign PaperAlign; + +enum hg_Multi_output { + Unused = -1, + All, + ColorGray, + ColorBw, + GrayBw +}; +typedef enum hg_Multi_output Multi_output; + +struct hg_tagImageProcessParams +{ + int PixType; /*same as color*/ + int DestResulution; /*same sa resulution*/ + int NativeResulution; /*fixed 200 for now*/ + int AutoDiscardBlank; /****跳过空白页通用****************/ + int AutoDiscardBlankVince; /****跳过空白页(发票)***********************/ + int IsDuplex; /*false:single*/ + int IsFold; /*对折*/ + int AutoDescrew; + int AutoCrop; + int FillBlackRect; + int Filter; /*decolor ,0:red 1:green 2:blue 3:none encolor 5:red 6:green 7:blue*/ + OutHoleParams OutHoleParam; + int Orentation; /*0:none 1:90 2:180 3:270 4:auto*/ + int BackRotate180; + int Brightness; /*1~255*/ + int Contrast; /*1~7*/ + float Gamma; /*0.1f~5.0f*/ + int MultiOutRed; + int MultiOutputType;/*-1:none 0:all 1:COLORGRAY 2:COLORBW 3:GRAYBW*/ + CropRect cropRect; + CustomGamma customGamma;/*****色调曲线**************/ + int RefuseInflow;/*防止渗透**************************/ + int ColorCorrection;/*色彩校正**/ + int RemoveMorr; /**去除摩尔纹********/ + int ErrorExtention; /**错误扩散*****************/ + int TextureRemove;/****除网纹*******************/ + int imageSharpen;/*0:none 1:sharpen 2:sharpen_more 3:blur 4:blur_more*/ + int SplitImage; + int AnswerSheetFilter; + int NosieDetach; + int AutoDetctOrentation; +}; +typedef struct hg_tagImageProcessParams ImageProcessParams; + + +enum hg_color_mode { + BW, + Gray, + Color +}; +typedef enum hg_color_mode ColorMode; +struct hg_tagScanParams +{ + int colorMode;/*2:color 1:gray 0:bw*/ + int papertype; + PaperAlign paperAlign; + int Resolution;/*fixed 200 for now*/ + int UltrasonicDetect;/*double check*/ + int BindingDetect;/*staple check*/ + int ScrewDetect; + int ScrewTopLevel;/*1-5,1 easiest*/ + int ScanCount;/*1-500*/ + ImageProcessParams ImageProcessParam; +}; +typedef struct hg_tagScanParams ScanParam; + +struct hg_tagImageInfo +{ + int Width; + int Height; + int bpp; +}; +typedef struct hg_tagImageInfo ImageInfo; + +enum hg_sharpenType +{ + SharpenNone, + Sharpen, /*********锐化**********************/ + SharpenMore, /*********进一步锐化*****************/ + Blur, /*********模糊*********************/ + BlurMore /*********进一步模糊***************/ +}; +typedef enum hg_sharpenType ImageSharpen; +#ifdef __cplusplus +} +#endif + +#endif diff --git a/3rdparty/nick/predefine.h b/3rdparty/nick/predefine.h new file mode 100644 index 0000000..d904b4d --- /dev/null +++ b/3rdparty/nick/predefine.h @@ -0,0 +1,155 @@ +#ifndef PRE_DEFINE_H +#define PRE_DEFINE_H + +#define G100SCANNER + +#define EN_LOG +#include +#ifndef _WIN32 +typedef bool BOOL; +typedef unsigned int UINT32; +#endif +typedef unsigned int u32; +typedef struct +{ + u32 gainF[6]; + u32 gainB[6]; + u32 offsetsF[6]; + u32 offsetsB[6]; + u32 expF[3]; + u32 expB[3]; + u32 sp; +}HGCISConfig; + + +typedef struct +{ + HGCISConfig colorCorrect; + HGCISConfig color; + HGCISConfig grayCorrect; + HGCISConfig gray; +}HGCorrectConfigs; + +struct SPSET +{ + unsigned int FSP; + unsigned int BSP; +}; + + +typedef struct CorrectParam { + unsigned int Exposures[6]; + unsigned int Gain[12]; + unsigned int Offset[12]; +}; + +typedef struct CaptureParams +{ + + int correctColorExposure[6]; + int correctColorGain[12]; + int correctColorOffset[12]; + + int correctGrayExposure[6]; + int correctGrayGain[12]; + int correctGrayOffset[12]; + + int colorExposure[6]; + int colorGain[12]; + int colorOffset[12]; + + int grayExposure[6]; + int grayGain[12]; + int grayOffset[12]; + + int uvCorrectColorExposure[2]; + int uvCorrectGrayExposure[2]; + int uvColorExposure[2]; + int uvGrayExposure[2]; +} CaptureParams; + + +typedef struct hgsize{ + hgsize(){} + template + hgsize(T1 x,T2 y) + { + cy = y; + cx = x; + } + bool operator == (hgsize s) + { + if(s.cx == this->cx && s.cy == this->cy) + return true; + return false; + } + bool isempty() + { + return (this->cy*this->cx)?0:1; + } + int cy; + int cx; +}HgSize,HGSIZE; + + +enum ScannerSerial: unsigned char +{ + G100Serial, + G200Serial, + G300Serial, + G400Serial, + G10039Serial, + G20039Serial, +}; + +struct Vid_pid +{ + Vid_pid(unsigned short set_vid, unsigned short set_pid) : + vid(set_vid), + pid(set_pid) {} + bool operator == (Vid_pid sre) + { + if (sre.pid == this->pid && sre.vid == this->vid) + return true; + return false; + } + unsigned short vid; + unsigned short pid; +}; + +///#define LANXUMVERSION +#define HGVERSION + + +#ifdef EN_LOG + #define LOG printf +#else + #define LOG +#endif + +#ifdef HGVERSION +#ifdef G100SCANNER +static std::vector DEVICE_ID={ + {0x3072,0x100}, + {0x3072,0x139} +}; +#elif defined(G200SCANNER) +static std::vector DEVICE_ID={ + {0x3072,0x200}, + {0x3072,0x239} +}; +#elif defined(G300SCANNER) +static std::vector DEVICE_ID={ + {0x3072,0x300}, +}; +#else +static std::vector DEVICE_ID={ + {0x3072,0x400}, +}; +#endif +#elif defined(LANXUMVERSION) +static std::vector DEVICE_ID={ + {0x31c9,0x8730}, +}; +#endif +#endif diff --git a/3rdparty/nick/sane_common.h b/3rdparty/nick/sane_common.h new file mode 100644 index 0000000..9e99bfd --- /dev/null +++ b/3rdparty/nick/sane_common.h @@ -0,0 +1,467 @@ +#ifndef COMMON_H +#define COMMON_H +#ifdef __cplusplus +#include + +#ifdef __linux__ +typedef unsigned char byte; +#endif // _WIN32 + + +extern "C"{ +#endif + +typedef struct hg_tag_SIZE +{ + long cx; + long cy; +}CSSIZE, *PCSSIZE, *LPCSSIZE; + +typedef CSSIZE CSSIZEL; +typedef CSSIZE *PCSSIZEL, *LPCSSIZEL; + +enum hg_tagUsbSupported +{ + /*ֹͣɨ**/ + SCAN_STOP = -1, + /*쳣******/ + HAVE_ERROR = -2, + /*״̬****/ + NORMAL = 0, + /****/ + OPEN_COVER = 1, + /*ֽ****/ + NO_FEED = 2, + /*ֽʧ****/ + FEED_IN_ERROR = 4, + /**ֽ*****/ + PAPER_JAM = 8, + /**⵽˫**/ + DETECT_DOUBLE_FEED = 16, + /**⵽鶤**/ + DETECT_STAPLE = 32, + /*ֽб******/ + PAPER_SKEW = 64, + /**Զģʽ****/ + AUTO_SCAN_MODE = 65, + /**ֶģʽ****/ + MANAUL_SCAN_MODE = 66, + /**ģʽ****/ + COUNT_MODE = 67, + /*Ӳ*****/ + HARDWARE_ERROR = 68, + /*FPGA***/ + FPGA_ERROR = 68, + /*ʼ******/ + START_SCAN = 69, + /**ֹͣ*****/ + STOP_SCAN = 70, + /**ͼ*****/ + HAVE_IMAGE = 71, + /*ɨ***/ + UPDATE_SCAN_PARAMETER = 72, + /*PCæ***/ + PC_SCAN_BUSY_or_ERROR = 73, + /*USBӶϿ***/ + DEVICE_OFF_LINE = 74, + /*ߴ*/ + SIZE_ERROR = 75, + //ȡͼʱ + AQUIRE_IMAGE_TIMEOUT = 76, + //ȡͼƬɨƥ + LOSE_IMAGE = 77, + //usbȡݴ + USB_BULK_ERROR = 78, + //v4l2ȡͼʧ + V4L2_AQULRE_ERROR = 79, + //ɨڲͼƬʧ + V4L2_IMAGE_EMPTY = 80, + // + SLEEPING = 81, + //⵽۽ + HAVE_DOGEAR = 82, + //ԶУ + AUTO_FLATTING = 198, + //USB δ + USB_DISCONNECTED = 200, + //ûֹͣ + USER_STOP = 201, + //ԶƽУ + AUTO_FLAT_FINISHED = 202 +}; + +typedef enum tagtwSS +{ + None = 0, + A4Letter = 1, + A4 = 1, + B5Letter = 2, + JISB5 = 2, + B5 = 2, + USLetter = 3, + USLegal = 4, + A5 = 5, + B4 = 6, + ISOB4 = 6, + B6 = 7, + ISOB6 = 7, + USLedger = 9, + USExecutive = 10, + A3 = 11, + B3 = 12, + ISOB3 = 12, + A6 = 13, + C4 = 14, + C5 = 15, + C6 = 16, + _4A0 = 17, + _2A0 = 18, + A0 = 19, + A1 = 20, + A2 = 21, + A7 = 22, + A8 = 23, + A9 = 24, + A10 = 25, + ISOB0 = 26, + ISOB1 = 27, + ISOB2 = 28, + ISOB5 = 29, + ISOB7 = 30, + ISOB8 = 31, + ISOB9 = 32, + ISOB10 = 33, + JISB0 = 34, + JISB1 = 35, + JISB2 = 36, + JISB3 = 37, + JISB4 = 38, + JISB6 = 39, + JISB7 = 40, + JISB8 = 41, + JISB9 = 42, + JISB10 = 43, + C0 = 44, + C1 = 45, + C2 = 46, + C3 = 47, + C7 = 48, + C8 = 49, + C9 = 50, + C10 = 51, + USStatement = 52, + BusinessCard = 53, + MaxSize = 54 +}TwSS; + +typedef enum hg_tagUsbSupported tagUsbSupported; + +#pragma pack(push) +#pragma pack(4) +typedef struct tagImageInfo +{ + int Width; + int Height; + int bpp; +} ImageInfo; + +typedef struct Scan_Rect { + int width; + int height; + int x; + int y; +}ScanRect; + +/*********************************************************************************/ +// +typedef enum tagColorMode { + BlackWhite, + Gray, + RGB +}ColorMode; + +typedef enum tagMulti_Output { + Unused = -1, + All, + ColorGray, + ColorBw, + GrayBw +}MultiOutput; + +typedef enum tagPaper_Align :unsigned char { + Rot0 = 0, + Rot270 = 3 +}PaperAlign; + +typedef struct tagCrop_Rect +{ + int enable; + int x; /*****ԶϽx*/ + int y; /*****ԶϽy*/ + int width; /*****Զ*******/ + int height; /*****Զ߶*******/ +}CropRect; + +typedef struct tagScan_Side { + int duplex; /*0: both ; 1: front*/ + int discardBlank; /*հҳͨ*/ + int discardBlankVince; /*հҳƱ*/ + int fold; /**/ + int switchFrontBack; /**/ +}ScanSide; + +typedef struct tagSkew_Detection { + int enable; + int level; +}SkewDetection; + +typedef struct tagHhardware_Params +{ + int capturepixtype; + int sizeDetection; + int doubleFeedDetection; + int bindingDetection; + SkewDetection skewDetection; +}HardwareCaps; + +//ͼ +typedef struct tagCcustom_Gamma +{ + int enable; + unsigned char table[768]; + int tableLength; +}CustomGamma; + +typedef struct tagFill_Hole +{ + uint8_t enable; + int ratio;/*1~50;*/ +}FillHole; + +typedef enum tagColor_Filter +{ + FILTER_RED, + FILTER_GREEN, + FILTER_BLUE, + FILTER_NONE, + FILTER_ALL, + ENHANCE_RED, + ENHANCE_GREEN, + ENHANCE_BLUE +}ColorFilter; + +typedef enum tagSharpen_Type +{ + STNone, + Sharpen, + SharpenMore, + Blur, + BlurMore +}SharpenType; + +typedef enum tagOrentation +{ + ROTATE_NONE = 0, + ROTATE_90, + ROTATE_180, + ROTATE_270, + AUTOTEXT_DETECT +}Orentation; + +typedef struct tagjpegCompress { + int enable; + int ratio; +}JpegCompress; + +typedef struct tagImage_Process +{ + int autoCrop; /*Զüߴ*/ + //ȶԱȶ٤ֵ + int brightness; /*1~255*/ + int contrast; /*1~7*/ + float gamma; /*0.1f~5.0f*/ + CustomGamma customGamma; + //ͼ + int fillBlackRect; + int autoDescrew; + int refuseInflow;/*ֹ͸*/ + FillHole fillHole; + ColorFilter filter; + int colorCorrection;/*ɫУ*/ + int removeMorr; /*ȥĦ*/ + int errorExtention; /*ɢ*/ + int nosieDetach;/*Ż*/ + int NosieDetachEnable; + int textureRemove;/**/ + int indent;/*Ե*/ + int noise;/*ص*/ + int AutoCrop_threshold;/*Զüֵֵ*/ + bool is_convex;/*ڿʽ*/ + SharpenType sharpenType; + int multiOutFilterRed;/**/ + int answerSheetFilterRed;/*⿨*/ + //ֽ + Orentation orentation; + int backRotate180; + // + JpegCompress jpegCompress; + int splitImage; + int discardblank_percent; +}ImageProcess; + + +/*********************************************************************************/ +typedef struct +{ + ColorMode pixelType; + MultiOutput multiOutput; + TwSS paperSize; + PaperAlign paperAlign; + CropRect cropRect; + int resolution; + int resolution_native; + ScanSide scanSide; + ImageProcess imageProcess; + int scanCount; /* -1: ɨ */ + HardwareCaps hardwareParam; + int previewScan; + int threshold; + bool is_correct; + /*Ϣ*/ + /*std::string Caption; + std::string SavePath;*/ +}GScanCap; + +/****************** +**ṹ** +*******************/ +typedef struct tagCONFIGPARAMS +{ + /*ѡ*/ + int Pixtype; + int PaperSize; + int EnAutoCrop; + int Resolution; + int EnDuplex; + int EnDiscardBlank; + int EnDiscardBlankVince; + int DBlank_AreaNum; + int DBlank_DevnMax; + int EnFold; + int EnExchangeFrontBack; + /*ȶԱȶѡ*/ + float Brightness; + int EnAutoContrast; + float Contrast; + float Gamma; + + /*ͼѡ*/ + int Filter; + int Sharpen; + int EnFillBlack; + int EnAutoDescrew; + int EnOutHole; + int OutHoleRatio; + int EnMultiOutPutR; + int EnAnswerSheetR; + + /*ֽѡ*/ + int EnUltrasonicDetect; + int EnBindingDetect; + int ScanCount; + int Orentation; + int EnBackRotate180; + int EnScrewDetect; + int ScrewDetectLevel; + + /*Ϣ*/ + /*std::string Caption; + std::string SavePath;*/ +}CONFIGPARAMS, * PCONFIGPARAMS; + +typedef struct tagDetachNoise +{ + int8_t is_detachnoise; + int detachnoise; +}DetachNoise; + +typedef struct tagHARDWAREPARAMS_39 +{ + int8_t capturepixtype; + int8_t en_doublefeed; + int8_t en_stapledetect; + int8_t en_skrewdetect; + int8_t skrewdetectlevel; + int lowpowermode; +#ifdef UV + byte en_uv; +#endif +}HardwareCaps_39; + +struct GScanCap_3399 +{ + uint8_t papertype; /**< the current paper source ADF or Flatbed*/ + PaperAlign paperAlign; + uint8_t en_sizecheck; /**< ߴ*/ + float imageRotateDegree; + uint8_t is_duplex; /**< True to use duplex false for simplex, ignored if flatbed*/ + uint8_t en_fold; /**<*/ + int pixtype; /**< type of pixels to transfer image as */ + int automaticcolor; /**<ɫԄRe*/ + int automaticcolortype; /**<ɫԄReDzɫς*/ + //ScanRect scanrect; + float resolution_dst; /**< horizontal resolution */ + float resolution_native; + float gamma; /**< Gamma */ + float contrast; /**< Contrast */ + float brightness; /**< Brightness */ + float threshold; /**< Threshold */ + uint8_t is_autocontrast; /**< ԶԱȶ*/ + uint8_t is_autocrop; /**< Զ*/ + uint8_t is_autodiscradblank_normal; /**< Զհҳͨ*/ + int discardblank_percent; /**<հҳֵ*/ + uint8_t is_autodiscradblank_vince;/**ԶհҳƱ*/ + uint8_t is_switchfrontback; /***/ + uint8_t autodescrew; /**< Զƫ*/ + uint8_t multi_output_red; /**/ + uint8_t hsvcorrect; /**<⿨*/ + uint8_t filter; /**< ɫ*/ + uint8_t sharpen; + uint8_t enhance_color; /**< ɫǿ*/ + uint8_t fillbackground; /**< ڿ*/ + bool is_convex; /**< ڿģʽtrueΪ͹䣬falseΪ䣬Ĭtrue*/ + int noise; /**< أܹnoiseȵıƸţĬ40*/ + int indent; /**< üƫߺڵʱֽ̽indentأĬ5*/ + int AutoCrop_threshold; /**< ԶüֵֵȡֵΧ(0, 255)Ĭ40*/ + unsigned short scannum; /**< ɨ*/ + uint8_t is_backrotate180; /**< ת180*/ + uint8_t is_dogeardetection; /**<۽Ǽ*/ + HardwareCaps_39 hardwarecaps; /**< Ӳɨ*/ + FillHole fillhole; + DetachNoise detachnoise; /**< ڰ׽*/ + uint8_t is_autotext; /**< Զıʶ*/ + bool isfillcolor; /**< Զɫ>*/ + int refuseInflow; /**< ֹ͸>*/ + int colorCorrection; /**< ɫУ>*/ + int removeMorr; /**< ȥĦ>*/ + int errorExtention; /** < ɢ>*/ + int textureRemove; /** < >*/ + int splitImage; /** < ͼ>*/ + CropRect cropRect; /**< Զ>*/ + MultiOutput multiOutput; /**< >*/ + bool normalCrop; /**< Զɫ>*/ + uint32_t reserve[1024]; /**< Ԥ4096ֽЭչ*/ +}; +#pragma pack(pop) + +/*typedef struct tagCONFIGINFO +{ + std::string Caption; + std::string SavePath; +}CONFIGINFO, * PCONFIGINFO;*/ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv/cv.h b/3rdparty/opencv/include/opencv/cv.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cv.h rename to 3rdparty/opencv/include/opencv/cv.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/cv.hpp b/3rdparty/opencv/include/opencv/cv.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cv.hpp rename to 3rdparty/opencv/include/opencv/cv.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv/cvaux.h b/3rdparty/opencv/include/opencv/cvaux.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cvaux.h rename to 3rdparty/opencv/include/opencv/cvaux.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/cvaux.hpp b/3rdparty/opencv/include/opencv/cvaux.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cvaux.hpp rename to 3rdparty/opencv/include/opencv/cvaux.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv/cvwimage.h b/3rdparty/opencv/include/opencv/cvwimage.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cvwimage.h rename to 3rdparty/opencv/include/opencv/cvwimage.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/cxcore.h b/3rdparty/opencv/include/opencv/cxcore.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cxcore.h rename to 3rdparty/opencv/include/opencv/cxcore.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/cxcore.hpp b/3rdparty/opencv/include/opencv/cxcore.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cxcore.hpp rename to 3rdparty/opencv/include/opencv/cxcore.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv/cxeigen.hpp b/3rdparty/opencv/include/opencv/cxeigen.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cxeigen.hpp rename to 3rdparty/opencv/include/opencv/cxeigen.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv/cxmisc.h b/3rdparty/opencv/include/opencv/cxmisc.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/cxmisc.h rename to 3rdparty/opencv/include/opencv/cxmisc.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/highgui.h b/3rdparty/opencv/include/opencv/highgui.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/highgui.h rename to 3rdparty/opencv/include/opencv/highgui.h diff --git a/qt-correction-tool/pub/opencv/include/opencv/ml.h b/3rdparty/opencv/include/opencv/ml.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv/ml.h rename to 3rdparty/opencv/include/opencv/ml.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core.hpp b/3rdparty/opencv/include/opencv2/core.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core.hpp rename to 3rdparty/opencv/include/opencv2/core.hpp index 089c0db..be0a3a0 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core.hpp +++ b/3rdparty/opencv/include/opencv2/core.hpp @@ -50,7 +50,6 @@ #endif #include "opencv2/core/cvdef.h" -#include "opencv2/core/version.hpp" #include "opencv2/core/base.hpp" #include "opencv2/core/cvstd.hpp" #include "opencv2/core/traits.hpp" @@ -68,12 +67,15 @@ @defgroup core_c_glue Connections with C++ @} @defgroup core_array Operations on arrays + @defgroup core_async Asynchronous API @defgroup core_xml XML/YAML Persistence @defgroup core_cluster Clustering @defgroup core_utils Utility and system functions and macros @{ + @defgroup core_logging Logging facilities @defgroup core_utils_sse SSE utilities @defgroup core_utils_neon NEON utilities + @defgroup core_utils_vsx VSX utilities @defgroup core_utils_softfloat Softfloat support @defgroup core_utils_samples Utility functions for OpenCV samples @} @@ -199,6 +201,9 @@ enum CovarFlags { COVAR_COLS = 16 }; +//! @addtogroup core_cluster +//! @{ + //! k-Means flags enum KmeansFlags { /** Select random initial centers in each attempt.*/ @@ -212,6 +217,8 @@ enum KmeansFlags { KMEANS_USE_INITIAL_LABELS = 1 }; +//! @} core_cluster + //! type of line enum LineTypes { FILLED = -1, @@ -233,12 +240,16 @@ enum HersheyFonts { FONT_ITALIC = 16 //!< flag for italic font }; +//! @addtogroup core_array +//! @{ + enum ReduceTypes { REDUCE_SUM = 0, //!< the output is the sum of all rows/columns of the matrix. REDUCE_AVG = 1, //!< the output is the mean vector of all rows/columns of the matrix. REDUCE_MAX = 2, //!< the output is the maximum (column/row-wise) of all rows/columns of the matrix. REDUCE_MIN = 3 //!< the output is the minimum (column/row-wise) of all rows/columns of the matrix. }; +//! @} core_array /** @brief Swaps two matrices */ @@ -311,9 +322,9 @@ if src was not a ROI, use borderType | #BORDER_ISOLATED. @param src Source image. @param dst Destination image of the same type as src and the size Size(src.cols+left+right, src.rows+top+bottom) . -@param top -@param bottom -@param left +@param top the top pixels +@param bottom the bottom pixels +@param left the left pixels @param right Parameter specifying how many pixels in each direction from the source image rectangle to extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs to be built. @@ -1612,7 +1623,9 @@ elements. CV_EXPORTS_W bool checkRange(InputArray a, bool quiet = true, CV_OUT Point* pos = 0, double minVal = -DBL_MAX, double maxVal = DBL_MAX); -/** @brief converts NaN's to the given number +/** @brief converts NaNs to the given number +@param a input/output matrix (CV_32F type). +@param val value to convert the NaNs */ CV_EXPORTS_W void patchNaNs(InputOutputArray a, double val = 0); diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/affine.hpp b/3rdparty/opencv/include/opencv2/core/affine.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/affine.hpp rename to 3rdparty/opencv/include/opencv2/core/affine.hpp diff --git a/3rdparty/opencv/include/opencv2/core/async.hpp b/3rdparty/opencv/include/opencv2/core/async.hpp new file mode 100644 index 0000000..54560c7 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/async.hpp @@ -0,0 +1,105 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_ASYNC_HPP +#define OPENCV_CORE_ASYNC_HPP + +#include + +#ifdef CV_CXX11 +//#include +#include +#endif + +namespace cv { + +/** @addtogroup core_async + +@{ +*/ + + +/** @brief Returns result of asynchronous operations + +Object has attached asynchronous state. +Assignment operator doesn't clone asynchronous state (it is shared between all instances). + +Result can be fetched via get() method only once. + +*/ +class CV_EXPORTS_W AsyncArray +{ +public: + ~AsyncArray() CV_NOEXCEPT; + CV_WRAP AsyncArray() CV_NOEXCEPT; + AsyncArray(const AsyncArray& o) CV_NOEXCEPT; + AsyncArray& operator=(const AsyncArray& o) CV_NOEXCEPT; + CV_WRAP void release() CV_NOEXCEPT; + + /** Fetch the result. + @param[out] dst destination array + + Waits for result until container has valid result. + Throws exception if exception was stored as a result. + + Throws exception on invalid container state. + + @note Result or stored exception can be fetched only once. + */ + CV_WRAP void get(OutputArray dst) const; + + /** Retrieving the result with timeout + @param[out] dst destination array + @param[in] timeoutNs timeout in nanoseconds, -1 for infinite wait + + @returns true if result is ready, false if the timeout has expired + + @note Result or stored exception can be fetched only once. + */ + bool get(OutputArray dst, int64 timeoutNs) const; + + CV_WRAP inline + bool get(OutputArray dst, double timeoutNs) const { return get(dst, (int64)timeoutNs); } + + bool wait_for(int64 timeoutNs) const; + + CV_WRAP inline + bool wait_for(double timeoutNs) const { return wait_for((int64)timeoutNs); } + + CV_WRAP bool valid() const CV_NOEXCEPT; + +#ifdef CV_CXX11 + inline AsyncArray(AsyncArray&& o) { p = o.p; o.p = NULL; } + inline AsyncArray& operator=(AsyncArray&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; } + + template + inline bool get(OutputArray dst, const std::chrono::duration<_Rep, _Period>& timeout) + { + return get(dst, (int64)(std::chrono::nanoseconds(timeout).count())); + } + + template + inline bool wait_for(const std::chrono::duration<_Rep, _Period>& timeout) + { + return wait_for((int64)(std::chrono::nanoseconds(timeout).count())); + } + +#if 0 + std::future getFutureMat() const; + std::future getFutureUMat() const; +#endif +#endif + + + // PImpl + struct Impl; friend struct Impl; + inline void* _getImpl() const CV_NOEXCEPT { return p; } +protected: + Impl* p; +}; + + +//! @} +} // namespace +#endif // OPENCV_CORE_ASYNC_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/base.hpp b/3rdparty/opencv/include/opencv2/core/base.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/core/base.hpp rename to 3rdparty/opencv/include/opencv2/core/base.hpp index 31cd7a8..1250497 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/base.hpp +++ b/3rdparty/opencv/include/opencv2/core/base.hpp @@ -188,7 +188,7 @@ enum NormTypes { norm = \forkthree { \| \texttt{src1} \| _{L_2} ^{2} = \sum_I \texttt{src1}(I)^2} {if \(\texttt{normType} = \texttt{NORM_L2SQR}\)} { \| \texttt{src1} - \texttt{src2} \| _{L_2} ^{2} = \sum_I (\texttt{src1}(I) - \texttt{src2}(I))^2 }{if \(\texttt{normType} = \texttt{NORM_L2SQR}\) } - { \left(\frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}}\right)^2 }{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2}\) } + { \left(\frac{\|\texttt{src1}-\texttt{src2}\|_{L_2} }{\|\texttt{src2}\|_{L_2}}\right)^2 }{if \(\texttt{normType} = \texttt{NORM_RELATIVE | NORM_L2SQR}\) } \f] */ NORM_L2SQR = 5, @@ -326,8 +326,8 @@ CV_INLINE CV_NORETURN void errorNoReturn(int _code, const String& _err, const ch // In practice, some macro are not processed correctly (noreturn is not detected). // We need to use simplified definition for them. -#define CV_Error(...) do { abort(); } while (0) -#define CV_Error_( code, args ) do { cv::format args; abort(); } while (0) +#define CV_Error(code, msg) do { (void)(code); (void)(msg); abort(); } while (0) +#define CV_Error_(code, args) do { (void)(code); (void)(cv::format args); abort(); } while (0) #define CV_Assert( expr ) do { if (!(expr)) abort(); } while (0) #define CV_ErrorNoReturn CV_Error #define CV_ErrorNoReturn_ CV_Error_ @@ -587,6 +587,21 @@ _AccTp normInf(const _Tp* a, const _Tp* b, int n) */ CV_EXPORTS_W float cubeRoot(float val); +/** @overload + +cubeRoot with argument of `double` type calls `std::cbrt(double)` (C++11) or falls back on `pow()` for C++98 compilation mode. +*/ +static inline +double cubeRoot(double val) +{ +#ifdef CV_CXX11 + return std::cbrt(val); +#else + double v = pow(abs(val), 1/3.); // pow doesn't support negative inputs with fractional exponents + return val >= 0 ? v : -v; +#endif +} + /** @brief Calculates the angle of a 2D vector in degrees. The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured diff --git a/3rdparty/opencv/include/opencv2/core/bindings_utils.hpp b/3rdparty/opencv/include/opencv2/core/bindings_utils.hpp new file mode 100644 index 0000000..98a4a2b --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/bindings_utils.hpp @@ -0,0 +1,170 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_BINDINGS_UTILS_HPP +#define OPENCV_CORE_BINDINGS_UTILS_HPP + +#include +#include +#include + +#include + +namespace cv { namespace utils { +//! @addtogroup core_utils +//! @{ + +CV_EXPORTS_W String dumpInputArray(InputArray argument); + +CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument); + +CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument); + +CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument); + +CV_WRAP static inline +String dumpBool(bool argument) +{ + return (argument) ? String("Bool: True") : String("Bool: False"); +} + +CV_WRAP static inline +String dumpInt(int argument) +{ + return cv::format("Int: %d", argument); +} + +CV_WRAP static inline +String dumpSizeT(size_t argument) +{ + std::ostringstream oss("size_t: ", std::ios::ate); + oss << argument; + return oss.str(); +} + +CV_WRAP static inline +String dumpFloat(float argument) +{ + return cv::format("Float: %.2f", argument); +} + +CV_WRAP static inline +String dumpDouble(double argument) +{ + return cv::format("Double: %.2f", argument); +} + +CV_WRAP static inline +String dumpCString(const char* argument) +{ + return cv::format("String: %s", argument); +} + +CV_WRAP static inline +String dumpString(const String& argument) +{ + return cv::format("String: %s", argument.c_str()); +} + +CV_WRAP static inline +String testOverloadResolution(int value, const Point& point = Point(42, 24)) +{ + return format("overload (int=%d, point=(x=%d, y=%d))", value, point.x, + point.y); +} + +CV_WRAP static inline +String testOverloadResolution(const Rect& rect) +{ + return format("overload (rect=(x=%d, y=%d, w=%d, h=%d))", rect.x, rect.y, + rect.width, rect.height); +} + +CV_WRAP static inline +String dumpRect(const Rect& argument) +{ + return format("rect: (x=%d, y=%d, w=%d, h=%d)", argument.x, argument.y, + argument.width, argument.height); +} + +CV_WRAP static inline +String dumpTermCriteria(const TermCriteria& argument) +{ + return format("term_criteria: (type=%d, max_count=%d, epsilon=%lf", + argument.type, argument.maxCount, argument.epsilon); +} + +CV_WRAP static inline +String dumpRotatedRect(const RotatedRect& argument) +{ + return format("rotated_rect: (c_x=%f, c_y=%f, w=%f, h=%f, a=%f)", + argument.center.x, argument.center.y, argument.size.width, + argument.size.height, argument.angle); +} + +CV_WRAP static inline +String dumpRange(const Range& argument) +{ + if (argument == Range::all()) + { + return "range: all"; + } + else + { + return format("range: (s=%d, e=%d)", argument.start, argument.end); + } +} + +CV_WRAP static inline +void testRaiseGeneralException() +{ + throw std::runtime_error("exception text"); +} + +CV_WRAP static inline +AsyncArray testAsyncArray(InputArray argument) +{ + AsyncPromise p; + p.setValue(argument); + return p.getArrayResult(); +} + +CV_WRAP static inline +AsyncArray testAsyncException() +{ + AsyncPromise p; + try + { + CV_Error(Error::StsOk, "Test: Generated async error"); + } + catch (const cv::Exception& e) + { + p.setException(e); + } + return p.getArrayResult(); +} + +//! @} // core_utils +} // namespace cv::utils + +//! @cond IGNORED + +CV_WRAP static inline +int setLogLevel(int level) +{ + // NB: Binding generators doesn't work with enums properly yet, so we define separate overload here + return cv::utils::logging::setLogLevel((cv::utils::logging::LogLevel)level); +} + +CV_WRAP static inline +int getLogLevel() +{ + return cv::utils::logging::getLogLevel(); +} + +//! @endcond IGNORED + +} // namespaces cv / utils + +#endif // OPENCV_CORE_BINDINGS_UTILS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/bufferpool.hpp b/3rdparty/opencv/include/opencv2/core/bufferpool.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/bufferpool.hpp rename to 3rdparty/opencv/include/opencv2/core/bufferpool.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/check.hpp b/3rdparty/opencv/include/opencv2/core/check.hpp similarity index 95% rename from qt-correction-tool/pub/opencv/include/opencv2/core/check.hpp rename to 3rdparty/opencv/include/opencv2/core/check.hpp index bf44138..d975223 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/check.hpp +++ b/3rdparty/opencv/include/opencv2/core/check.hpp @@ -63,12 +63,13 @@ struct CheckContext { #define CV__CHECK_LOCATION_VARNAME(id) CVAUX_CONCAT(CVAUX_CONCAT(__cv_check_, id), __LINE__) #define CV__DEFINE_CHECK_CONTEXT(id, message, testOp, p1_str, p2_str) \ static const cv::detail::CheckContext CV__CHECK_LOCATION_VARNAME(id) = \ - { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, message, p1_str, p2_str } + { CV__CHECK_FUNCTION, CV__CHECK_FILENAME, __LINE__, testOp, "" message, "" p1_str, "" p2_str } CV_EXPORTS void CV_NORETURN check_failed_auto(const int v1, const int v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v1, const size_t v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_auto(const float v1, const float v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_auto(const double v1, const double v2, const CheckContext& ctx); +CV_EXPORTS void CV_NORETURN check_failed_auto(const Size_ v1, const Size_ v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v1, const int v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatType(const int v1, const int v2, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v1, const int v2, const CheckContext& ctx); @@ -77,6 +78,8 @@ CV_EXPORTS void CV_NORETURN check_failed_auto(const int v, const CheckContext& c CV_EXPORTS void CV_NORETURN check_failed_auto(const size_t v, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_auto(const float v, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_auto(const double v, const CheckContext& ctx); +CV_EXPORTS void CV_NORETURN check_failed_auto(const Size_ v, const CheckContext& ctx); +CV_EXPORTS void CV_NORETURN check_failed_auto(const std::string& v1, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatDepth(const int v, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatType(const int v, const CheckContext& ctx); CV_EXPORTS void CV_NORETURN check_failed_MatChannels(const int v, const CheckContext& ctx); diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/core.hpp b/3rdparty/opencv/include/opencv2/core/core.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/core.hpp rename to 3rdparty/opencv/include/opencv2/core/core.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/core_c.h b/3rdparty/opencv/include/opencv2/core/core_c.h similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/core_c.h rename to 3rdparty/opencv/include/opencv2/core/core_c.h index e5fe516..95a98cf 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/core_c.h +++ b/3rdparty/opencv/include/opencv2/core/core_c.h @@ -53,7 +53,7 @@ which is incompatible with C It is OK to disable it because we only extend few plain structures with - C++ construrtors for simpler interoperability with C++ API of the library + C++ constructors for simpler interoperability with C++ API of the library */ # pragma warning(disable:4190) # elif defined __clang__ && __clang_major__ >= 3 @@ -579,7 +579,7 @@ CvNArrayIterator; #define CV_NO_CN_CHECK 2 #define CV_NO_SIZE_CHECK 4 -/** initializes iterator that traverses through several arrays simulteneously +/** initializes iterator that traverses through several arrays simultaneously (the function together with cvNextArraySlice is used for N-ari element-wise operations) */ CVAPI(int) cvInitNArrayIterator( int count, CvArr** arrs, @@ -1309,7 +1309,7 @@ CVAPI(void) cvMulTransposed( const CvArr* src, CvArr* dst, int order, const CvArr* delta CV_DEFAULT(NULL), double scale CV_DEFAULT(1.) ); -/** Tranposes matrix. Square matrices can be transposed in-place */ +/** Transposes matrix. Square matrices can be transposed in-place */ CVAPI(void) cvTranspose( const CvArr* src, CvArr* dst ); #define cvT cvTranspose diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda.hpp b/3rdparty/opencv/include/opencv2/core/cuda.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda.hpp index 820aba7..7d7bb62 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda.hpp +++ b/3rdparty/opencv/include/opencv2/core/cuda.hpp @@ -126,7 +126,7 @@ public: GpuMat(int rows, int cols, int type, Allocator* allocator = defaultAllocator()); GpuMat(Size size, int type, Allocator* allocator = defaultAllocator()); - //! constucts GpuMat and fills it with the specified value _s + //! constructs GpuMat and fills it with the specified value _s GpuMat(int rows, int cols, int type, Scalar s, Allocator* allocator = defaultAllocator()); GpuMat(Size size, int type, Scalar s, Allocator* allocator = defaultAllocator()); diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda.inl.hpp b/3rdparty/opencv/include/opencv2/core/cuda.inl.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda.inl.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda.inl.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/block.hpp b/3rdparty/opencv/include/opencv2/core/cuda/block.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/block.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/block.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/border_interpolate.hpp b/3rdparty/opencv/include/opencv2/core/cuda/border_interpolate.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/border_interpolate.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/border_interpolate.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/color.hpp b/3rdparty/opencv/include/opencv2/core/cuda/color.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/color.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/color.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/common.hpp b/3rdparty/opencv/include/opencv2/core/cuda/common.hpp similarity index 84% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/common.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/common.hpp index 14b1f3f..80b2ff0 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/common.hpp +++ b/3rdparty/opencv/include/opencv2/core/cuda/common.hpp @@ -101,6 +101,20 @@ namespace cv { namespace cuda cudaChannelFormatDesc desc = cudaCreateChannelDesc(); cudaSafeCall( cudaBindTexture2D(0, tex, img.ptr(), &desc, img.cols, img.rows, img.step) ); } + + template inline void createTextureObjectPitch2D(cudaTextureObject_t* tex, PtrStepSz& img, const cudaTextureDesc& texDesc) + { + cudaResourceDesc resDesc; + memset(&resDesc, 0, sizeof(resDesc)); + resDesc.resType = cudaResourceTypePitch2D; + resDesc.res.pitch2D.devPtr = static_cast(img.ptr()); + resDesc.res.pitch2D.height = img.rows; + resDesc.res.pitch2D.width = img.cols; + resDesc.res.pitch2D.pitchInBytes = img.step; + resDesc.res.pitch2D.desc = cudaCreateChannelDesc(); + + cudaSafeCall( cudaCreateTextureObject(tex, &resDesc, &texDesc, NULL) ); + } } }} diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/datamov_utils.hpp b/3rdparty/opencv/include/opencv2/core/cuda/datamov_utils.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/datamov_utils.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/datamov_utils.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/color_detail.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/color_detail.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/color_detail.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/color_detail.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/reduce.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/reduce.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/reduce.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/reduce.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/reduce_key_val.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/reduce_key_val.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/reduce_key_val.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/reduce_key_val.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/transform_detail.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/transform_detail.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/transform_detail.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/transform_detail.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/type_traits_detail.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/type_traits_detail.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/type_traits_detail.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/type_traits_detail.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/vec_distance_detail.hpp b/3rdparty/opencv/include/opencv2/core/cuda/detail/vec_distance_detail.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/detail/vec_distance_detail.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/detail/vec_distance_detail.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/dynamic_smem.hpp b/3rdparty/opencv/include/opencv2/core/cuda/dynamic_smem.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/dynamic_smem.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/dynamic_smem.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/emulation.hpp b/3rdparty/opencv/include/opencv2/core/cuda/emulation.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/emulation.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/emulation.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/filters.hpp b/3rdparty/opencv/include/opencv2/core/cuda/filters.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/filters.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/filters.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/funcattrib.hpp b/3rdparty/opencv/include/opencv2/core/cuda/funcattrib.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/funcattrib.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/funcattrib.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/functional.hpp b/3rdparty/opencv/include/opencv2/core/cuda/functional.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/functional.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/functional.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/limits.hpp b/3rdparty/opencv/include/opencv2/core/cuda/limits.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/limits.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/limits.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/reduce.hpp b/3rdparty/opencv/include/opencv2/core/cuda/reduce.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/reduce.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/reduce.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/saturate_cast.hpp b/3rdparty/opencv/include/opencv2/core/cuda/saturate_cast.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/saturate_cast.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/saturate_cast.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/scan.hpp b/3rdparty/opencv/include/opencv2/core/cuda/scan.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/scan.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/scan.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/simd_functions.hpp b/3rdparty/opencv/include/opencv2/core/cuda/simd_functions.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/simd_functions.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/simd_functions.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/transform.hpp b/3rdparty/opencv/include/opencv2/core/cuda/transform.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/transform.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/transform.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/type_traits.hpp b/3rdparty/opencv/include/opencv2/core/cuda/type_traits.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/type_traits.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/type_traits.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/utility.hpp b/3rdparty/opencv/include/opencv2/core/cuda/utility.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/utility.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/utility.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_distance.hpp b/3rdparty/opencv/include/opencv2/core/cuda/vec_distance.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_distance.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/vec_distance.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_math.hpp b/3rdparty/opencv/include/opencv2/core/cuda/vec_math.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_math.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/vec_math.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_traits.hpp b/3rdparty/opencv/include/opencv2/core/cuda/vec_traits.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/vec_traits.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/vec_traits.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp.hpp b/3rdparty/opencv/include/opencv2/core/cuda/warp.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/warp.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp_reduce.hpp b/3rdparty/opencv/include/opencv2/core/cuda/warp_reduce.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp_reduce.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/warp_reduce.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp_shuffle.hpp b/3rdparty/opencv/include/opencv2/core/cuda/warp_shuffle.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda/warp_shuffle.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda/warp_shuffle.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda_stream_accessor.hpp b/3rdparty/opencv/include/opencv2/core/cuda_stream_accessor.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda_stream_accessor.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda_stream_accessor.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda_types.hpp b/3rdparty/opencv/include/opencv2/core/cuda_types.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cuda_types.hpp rename to 3rdparty/opencv/include/opencv2/core/cuda_types.hpp index 45dc2ca..b33f061 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cuda_types.hpp +++ b/3rdparty/opencv/include/opencv2/core/cuda_types.hpp @@ -106,8 +106,8 @@ namespace cv size_t step; - __CV_CUDA_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)DevPtr::data + y * step); } - __CV_CUDA_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)DevPtr::data + y * step); } + __CV_CUDA_HOST_DEVICE__ T* ptr(int y = 0) { return ( T*)( ( char*)(((DevPtr*)this)->data) + y * step); } + __CV_CUDA_HOST_DEVICE__ const T* ptr(int y = 0) const { return (const T*)( (const char*)(((DevPtr*)this)->data) + y * step); } __CV_CUDA_HOST_DEVICE__ T& operator ()(int y, int x) { return ptr(y)[x]; } __CV_CUDA_HOST_DEVICE__ const T& operator ()(int y, int x) const { return ptr(y)[x]; } diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_dispatch.h b/3rdparty/opencv/include/opencv2/core/cv_cpu_dispatch.h similarity index 70% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_dispatch.h rename to 3rdparty/opencv/include/opencv2/core/cv_cpu_dispatch.h index 7f6d6b0..540fbb6 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_dispatch.h +++ b/3rdparty/opencv/include/opencv2/core/cv_cpu_dispatch.h @@ -72,7 +72,7 @@ # define CV_AVX 1 #endif #ifdef CV_CPU_COMPILE_FP16 -# if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) +# if defined(__arm__) || defined(__aarch64__) || defined(_M_ARM) || defined(_M_ARM64) # include # else # include @@ -87,15 +87,53 @@ # include # define CV_AVX_512F 1 #endif +#ifdef CV_CPU_COMPILE_AVX512_COMMON +# define CV_AVX512_COMMON 1 +# define CV_AVX_512CD 1 +#endif +#ifdef CV_CPU_COMPILE_AVX512_KNL +# define CV_AVX512_KNL 1 +# define CV_AVX_512ER 1 +# define CV_AVX_512PF 1 +#endif +#ifdef CV_CPU_COMPILE_AVX512_KNM +# define CV_AVX512_KNM 1 +# define CV_AVX_5124FMAPS 1 +# define CV_AVX_5124VNNIW 1 +# define CV_AVX_512VPOPCNTDQ 1 +#endif #ifdef CV_CPU_COMPILE_AVX512_SKX -# include # define CV_AVX512_SKX 1 +# define CV_AVX_512VL 1 +# define CV_AVX_512BW 1 +# define CV_AVX_512DQ 1 +#endif +#ifdef CV_CPU_COMPILE_AVX512_CNL +# define CV_AVX512_CNL 1 +# define CV_AVX_512IFMA 1 +# define CV_AVX_512VBMI 1 +#endif +#ifdef CV_CPU_COMPILE_AVX512_CLX +# define CV_AVX512_CLX 1 +# define CV_AVX_512VNNI 1 +#endif +#ifdef CV_CPU_COMPILE_AVX512_ICL +# define CV_AVX512_ICL 1 +# undef CV_AVX_512IFMA +# define CV_AVX_512IFMA 1 +# undef CV_AVX_512VBMI +# define CV_AVX_512VBMI 1 +# undef CV_AVX_512VNNI +# define CV_AVX_512VNNI 1 +# define CV_AVX_512VBMI2 1 +# define CV_AVX_512BITALG 1 +# define CV_AVX_512VPOPCNTDQ 1 #endif #ifdef CV_CPU_COMPILE_FMA3 # define CV_FMA3 1 #endif -#if defined _WIN32 && defined(_M_ARM) +#if defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) # include # include # define CV_NEON 1 @@ -120,6 +158,16 @@ # define CV_VSX3 1 #endif +#ifdef CV_CPU_COMPILE_MSA +# include "hal/msa_macros.h" +# define CV_MSA 1 +#endif + +#ifdef __EMSCRIPTEN__ +# define CV_WASM_SIMD 1 +# include +#endif + #endif // CV_ENABLE_INTRINSICS && !CV_DISABLE_OPTIMIZATION && !__CUDACC__ #if defined CV_CPU_COMPILE_AVX && !defined CV_CPU_BASELINE_COMPILE_AVX @@ -153,7 +201,7 @@ struct VZeroUpperGuard { # define CV_MMX 1 # define CV_SSE 1 # define CV_SSE2 1 -#elif defined _WIN32 && defined(_M_ARM) +#elif defined _WIN32 && (defined(_M_ARM) || defined(_M_ARM64)) && (defined(CV_CPU_COMPILE_NEON) || !defined(_MSC_VER)) # include # include # define CV_NEON 1 @@ -168,6 +216,11 @@ struct VZeroUpperGuard { # define CV_VSX 1 #endif +#ifdef __F16C__ +# include +# define CV_FP16 1 +#endif + #endif // !__OPENCV_BUILD && !__CUDACC (Compatibility code) @@ -223,9 +276,10 @@ struct VZeroUpperGuard { #ifndef CV_AVX_512ER # define CV_AVX_512ER 0 #endif -#ifndef CV_AVX_512IFMA512 -# define CV_AVX_512IFMA512 0 +#ifndef CV_AVX_512IFMA +# define CV_AVX_512IFMA 0 #endif +#define CV_AVX_512IFMA512 CV_AVX_512IFMA // deprecated #ifndef CV_AVX_512PF # define CV_AVX_512PF 0 #endif @@ -235,9 +289,45 @@ struct VZeroUpperGuard { #ifndef CV_AVX_512VL # define CV_AVX_512VL 0 #endif +#ifndef CV_AVX_5124FMAPS +# define CV_AVX_5124FMAPS 0 +#endif +#ifndef CV_AVX_5124VNNIW +# define CV_AVX_5124VNNIW 0 +#endif +#ifndef CV_AVX_512VPOPCNTDQ +# define CV_AVX_512VPOPCNTDQ 0 +#endif +#ifndef CV_AVX_512VNNI +# define CV_AVX_512VNNI 0 +#endif +#ifndef CV_AVX_512VBMI2 +# define CV_AVX_512VBMI2 0 +#endif +#ifndef CV_AVX_512BITALG +# define CV_AVX_512BITALG 0 +#endif +#ifndef CV_AVX512_COMMON +# define CV_AVX512_COMMON 0 +#endif +#ifndef CV_AVX512_KNL +# define CV_AVX512_KNL 0 +#endif +#ifndef CV_AVX512_KNM +# define CV_AVX512_KNM 0 +#endif #ifndef CV_AVX512_SKX # define CV_AVX512_SKX 0 #endif +#ifndef CV_AVX512_CNL +# define CV_AVX512_CNL 0 +#endif +#ifndef CV_AVX512_CLX +# define CV_AVX512_CLX 0 +#endif +#ifndef CV_AVX512_ICL +# define CV_AVX512_ICL 0 +#endif #ifndef CV_NEON # define CV_NEON 0 @@ -250,3 +340,11 @@ struct VZeroUpperGuard { #ifndef CV_VSX3 # define CV_VSX3 0 #endif + +#ifndef CV_MSA +# define CV_MSA 0 +#endif + +#ifndef CV_WASM_SIMD +# define CV_WASM_SIMD 0 +#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_helper.h b/3rdparty/opencv/include/opencv2/core/cv_cpu_helper.h similarity index 67% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_helper.h rename to 3rdparty/opencv/include/opencv2/core/cv_cpu_helper.h index ad13397..aaa89ed 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cv_cpu_helper.h +++ b/3rdparty/opencv/include/opencv2/core/cv_cpu_helper.h @@ -252,6 +252,69 @@ #endif #define __CV_CPU_DISPATCH_CHAIN_AVX_512F(fn, args, mode, ...) CV_CPU_CALL_AVX_512F(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_COMMON +# define CV_TRY_AVX512_COMMON 1 +# define CV_CPU_FORCE_AVX512_COMMON 1 +# define CV_CPU_HAS_SUPPORT_AVX512_COMMON 1 +# define CV_CPU_CALL_AVX512_COMMON(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_COMMON_(fn, args) return (opt_AVX512_COMMON::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_COMMON +# define CV_TRY_AVX512_COMMON 1 +# define CV_CPU_FORCE_AVX512_COMMON 0 +# define CV_CPU_HAS_SUPPORT_AVX512_COMMON (cv::checkHardwareSupport(CV_CPU_AVX512_COMMON)) +# define CV_CPU_CALL_AVX512_COMMON(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_COMMON) return (opt_AVX512_COMMON::fn args) +# define CV_CPU_CALL_AVX512_COMMON_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_COMMON) return (opt_AVX512_COMMON::fn args) +#else +# define CV_TRY_AVX512_COMMON 0 +# define CV_CPU_FORCE_AVX512_COMMON 0 +# define CV_CPU_HAS_SUPPORT_AVX512_COMMON 0 +# define CV_CPU_CALL_AVX512_COMMON(fn, args) +# define CV_CPU_CALL_AVX512_COMMON_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_COMMON(fn, args, mode, ...) CV_CPU_CALL_AVX512_COMMON(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_KNL +# define CV_TRY_AVX512_KNL 1 +# define CV_CPU_FORCE_AVX512_KNL 1 +# define CV_CPU_HAS_SUPPORT_AVX512_KNL 1 +# define CV_CPU_CALL_AVX512_KNL(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_KNL_(fn, args) return (opt_AVX512_KNL::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_KNL +# define CV_TRY_AVX512_KNL 1 +# define CV_CPU_FORCE_AVX512_KNL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_KNL (cv::checkHardwareSupport(CV_CPU_AVX512_KNL)) +# define CV_CPU_CALL_AVX512_KNL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNL) return (opt_AVX512_KNL::fn args) +# define CV_CPU_CALL_AVX512_KNL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNL) return (opt_AVX512_KNL::fn args) +#else +# define CV_TRY_AVX512_KNL 0 +# define CV_CPU_FORCE_AVX512_KNL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_KNL 0 +# define CV_CPU_CALL_AVX512_KNL(fn, args) +# define CV_CPU_CALL_AVX512_KNL_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_KNL(fn, args, mode, ...) CV_CPU_CALL_AVX512_KNL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_KNM +# define CV_TRY_AVX512_KNM 1 +# define CV_CPU_FORCE_AVX512_KNM 1 +# define CV_CPU_HAS_SUPPORT_AVX512_KNM 1 +# define CV_CPU_CALL_AVX512_KNM(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_KNM_(fn, args) return (opt_AVX512_KNM::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_KNM +# define CV_TRY_AVX512_KNM 1 +# define CV_CPU_FORCE_AVX512_KNM 0 +# define CV_CPU_HAS_SUPPORT_AVX512_KNM (cv::checkHardwareSupport(CV_CPU_AVX512_KNM)) +# define CV_CPU_CALL_AVX512_KNM(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNM) return (opt_AVX512_KNM::fn args) +# define CV_CPU_CALL_AVX512_KNM_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_KNM) return (opt_AVX512_KNM::fn args) +#else +# define CV_TRY_AVX512_KNM 0 +# define CV_CPU_FORCE_AVX512_KNM 0 +# define CV_CPU_HAS_SUPPORT_AVX512_KNM 0 +# define CV_CPU_CALL_AVX512_KNM(fn, args) +# define CV_CPU_CALL_AVX512_KNM_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_KNM(fn, args, mode, ...) CV_CPU_CALL_AVX512_KNM(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + #if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_SKX # define CV_TRY_AVX512_SKX 1 # define CV_CPU_FORCE_AVX512_SKX 1 @@ -273,6 +336,69 @@ #endif #define __CV_CPU_DISPATCH_CHAIN_AVX512_SKX(fn, args, mode, ...) CV_CPU_CALL_AVX512_SKX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_CNL +# define CV_TRY_AVX512_CNL 1 +# define CV_CPU_FORCE_AVX512_CNL 1 +# define CV_CPU_HAS_SUPPORT_AVX512_CNL 1 +# define CV_CPU_CALL_AVX512_CNL(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_CNL_(fn, args) return (opt_AVX512_CNL::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_CNL +# define CV_TRY_AVX512_CNL 1 +# define CV_CPU_FORCE_AVX512_CNL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_CNL (cv::checkHardwareSupport(CV_CPU_AVX512_CNL)) +# define CV_CPU_CALL_AVX512_CNL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CNL) return (opt_AVX512_CNL::fn args) +# define CV_CPU_CALL_AVX512_CNL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CNL) return (opt_AVX512_CNL::fn args) +#else +# define CV_TRY_AVX512_CNL 0 +# define CV_CPU_FORCE_AVX512_CNL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_CNL 0 +# define CV_CPU_CALL_AVX512_CNL(fn, args) +# define CV_CPU_CALL_AVX512_CNL_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_CNL(fn, args, mode, ...) CV_CPU_CALL_AVX512_CNL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_CLX +# define CV_TRY_AVX512_CLX 1 +# define CV_CPU_FORCE_AVX512_CLX 1 +# define CV_CPU_HAS_SUPPORT_AVX512_CLX 1 +# define CV_CPU_CALL_AVX512_CLX(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_CLX_(fn, args) return (opt_AVX512_CLX::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_CLX +# define CV_TRY_AVX512_CLX 1 +# define CV_CPU_FORCE_AVX512_CLX 0 +# define CV_CPU_HAS_SUPPORT_AVX512_CLX (cv::checkHardwareSupport(CV_CPU_AVX512_CLX)) +# define CV_CPU_CALL_AVX512_CLX(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CLX) return (opt_AVX512_CLX::fn args) +# define CV_CPU_CALL_AVX512_CLX_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_CLX) return (opt_AVX512_CLX::fn args) +#else +# define CV_TRY_AVX512_CLX 0 +# define CV_CPU_FORCE_AVX512_CLX 0 +# define CV_CPU_HAS_SUPPORT_AVX512_CLX 0 +# define CV_CPU_CALL_AVX512_CLX(fn, args) +# define CV_CPU_CALL_AVX512_CLX_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_CLX(fn, args, mode, ...) CV_CPU_CALL_AVX512_CLX(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_AVX512_ICL +# define CV_TRY_AVX512_ICL 1 +# define CV_CPU_FORCE_AVX512_ICL 1 +# define CV_CPU_HAS_SUPPORT_AVX512_ICL 1 +# define CV_CPU_CALL_AVX512_ICL(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_AVX512_ICL_(fn, args) return (opt_AVX512_ICL::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_AVX512_ICL +# define CV_TRY_AVX512_ICL 1 +# define CV_CPU_FORCE_AVX512_ICL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_ICL (cv::checkHardwareSupport(CV_CPU_AVX512_ICL)) +# define CV_CPU_CALL_AVX512_ICL(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_ICL) return (opt_AVX512_ICL::fn args) +# define CV_CPU_CALL_AVX512_ICL_(fn, args) if (CV_CPU_HAS_SUPPORT_AVX512_ICL) return (opt_AVX512_ICL::fn args) +#else +# define CV_TRY_AVX512_ICL 0 +# define CV_CPU_FORCE_AVX512_ICL 0 +# define CV_CPU_HAS_SUPPORT_AVX512_ICL 0 +# define CV_CPU_CALL_AVX512_ICL(fn, args) +# define CV_CPU_CALL_AVX512_ICL_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_AVX512_ICL(fn, args, mode, ...) CV_CPU_CALL_AVX512_ICL(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + #if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_NEON # define CV_TRY_NEON 1 # define CV_CPU_FORCE_NEON 1 @@ -294,6 +420,27 @@ #endif #define __CV_CPU_DISPATCH_CHAIN_NEON(fn, args, mode, ...) CV_CPU_CALL_NEON(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) +#if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_MSA +# define CV_TRY_MSA 1 +# define CV_CPU_FORCE_MSA 1 +# define CV_CPU_HAS_SUPPORT_MSA 1 +# define CV_CPU_CALL_MSA(fn, args) return (cpu_baseline::fn args) +# define CV_CPU_CALL_MSA_(fn, args) return (opt_MSA::fn args) +#elif !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_DISPATCH_COMPILE_MSA +# define CV_TRY_MSA 1 +# define CV_CPU_FORCE_MSA 0 +# define CV_CPU_HAS_SUPPORT_MSA (cv::checkHardwareSupport(CV_CPU_MSA)) +# define CV_CPU_CALL_MSA(fn, args) if (CV_CPU_HAS_SUPPORT_MSA) return (opt_MSA::fn args) +# define CV_CPU_CALL_MSA_(fn, args) if (CV_CPU_HAS_SUPPORT_MSA) return (opt_MSA::fn args) +#else +# define CV_TRY_MSA 0 +# define CV_CPU_FORCE_MSA 0 +# define CV_CPU_HAS_SUPPORT_MSA 0 +# define CV_CPU_CALL_MSA(fn, args) +# define CV_CPU_CALL_MSA_(fn, args) +#endif +#define __CV_CPU_DISPATCH_CHAIN_MSA(fn, args, mode, ...) CV_CPU_CALL_MSA(fn, args); __CV_EXPAND(__CV_CPU_DISPATCH_CHAIN_ ## mode(fn, args, __VA_ARGS__)) + #if !defined CV_DISABLE_OPTIMIZATION && defined CV_ENABLE_INTRINSICS && defined CV_CPU_COMPILE_VSX # define CV_TRY_VSX 1 # define CV_CPU_FORCE_VSX 1 diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cvdef.h b/3rdparty/opencv/include/opencv2/core/cvdef.h similarity index 86% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cvdef.h rename to 3rdparty/opencv/include/opencv2/core/cvdef.h index be7da7a..7d61e87 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cvdef.h +++ b/3rdparty/opencv/include/opencv2/core/cvdef.h @@ -45,9 +45,15 @@ #ifndef OPENCV_CORE_CVDEF_H #define OPENCV_CORE_CVDEF_H +#include "opencv2/core/version.hpp" + //! @addtogroup core_utils //! @{ +#ifdef OPENCV_INCLUDE_PORT_FILE // User-provided header file with custom platform configuration +#include OPENCV_INCLUDE_PORT_FILE +#endif + #if !defined CV_DOXYGEN && !defined CV_IGNORE_DEBUG_BUILD_GUARD #if (defined(_MSC_VER) && (defined(DEBUG) || defined(_DEBUG))) || \ (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_DEBUG_PEDANTIC)) @@ -82,12 +88,24 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard #define __CV_VA_NUM_ARGS_HELPER(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N #define __CV_VA_NUM_ARGS(...) __CV_VA_NUM_ARGS_HELPER(__VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) -#if defined __GNUC__ +#ifdef CV_Func +// keep current value (through OpenCV port file) +#elif defined __GNUC__ || (defined (__cpluscplus) && (__cpluscplus >= 201103)) +#define CV_Func __func__ +#elif defined __clang__ && (__clang_minor__ * 100 + __clang_major__ >= 305) +#define CV_Func __func__ +#elif defined(__STDC_VERSION__) && (__STDC_VERSION >= 199901) #define CV_Func __func__ #elif defined _MSC_VER #define CV_Func __FUNCTION__ +#elif defined(__INTEL_COMPILER) && (_INTEL_COMPILER >= 600) +#define CV_Func __FUNCTION__ +#elif defined __IBMCPP__ && __IBMCPP__ >=500 +#define CV_Func __FUNCTION__ +#elif defined __BORLAND__ && (__BORLANDC__ >= 0x550) +#define CV_Func __FUNC__ #else -#define CV_Func "" +#define CV_Func "" #endif //! @cond IGNORED @@ -118,9 +136,11 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard # if !defined(__clang__) && defined(__GNUC__) && (__GNUC__*100 + __GNUC_MINOR__ > 302) # define CV_StaticAssert(condition, reason) ({ extern int __attribute__((error("CV_StaticAssert: " reason " " #condition))) CV_StaticAssert(); ((condition) ? 0 : CV_StaticAssert()); }) # else +namespace cv { template struct CV_StaticAssert_failed; template <> struct CV_StaticAssert_failed { enum { val = 1 }; }; template struct CV_StaticAssert_test {}; +} # define CV_StaticAssert(condition, reason)\ typedef cv::CV_StaticAssert_test< sizeof(cv::CV_StaticAssert_failed< static_cast(condition) >) > CVAUX_CONCAT(CV_StaticAssert_failed_at_, __LINE__) # endif @@ -175,7 +195,12 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard #undef abs #undef Complex +#if defined __cplusplus +#include +#else #include +#endif + #include "opencv2/core/hal/interface.h" #if defined __ICL @@ -249,14 +274,28 @@ namespace cv { namespace debug_build_guard { } using namespace debug_build_guard #define CV_CPU_AVX_512PF 19 #define CV_CPU_AVX_512VBMI 20 #define CV_CPU_AVX_512VL 21 +#define CV_CPU_AVX_512VBMI2 22 +#define CV_CPU_AVX_512VNNI 23 +#define CV_CPU_AVX_512BITALG 24 +#define CV_CPU_AVX_512VPOPCNTDQ 25 +#define CV_CPU_AVX_5124VNNIW 26 +#define CV_CPU_AVX_5124FMAPS 27 #define CV_CPU_NEON 100 +#define CV_CPU_MSA 150 + #define CV_CPU_VSX 200 #define CV_CPU_VSX3 201 // CPU features groups #define CV_CPU_AVX512_SKX 256 +#define CV_CPU_AVX512_COMMON 257 +#define CV_CPU_AVX512_KNL 258 +#define CV_CPU_AVX512_KNM 259 +#define CV_CPU_AVX512_CNL 260 +#define CV_CPU_AVX512_CLX 261 +#define CV_CPU_AVX512_ICL 262 // when adding to this list remember to update the following enum #define CV_HARDWARE_MAX_FEATURE 512 @@ -287,13 +326,27 @@ enum CpuFeatures { CPU_AVX_512PF = 19, CPU_AVX_512VBMI = 20, CPU_AVX_512VL = 21, + CPU_AVX_512VBMI2 = 22, + CPU_AVX_512VNNI = 23, + CPU_AVX_512BITALG = 24, + CPU_AVX_512VPOPCNTDQ= 25, + CPU_AVX_5124VNNIW = 26, + CPU_AVX_5124FMAPS = 27, CPU_NEON = 100, + CPU_MSA = 150, + CPU_VSX = 200, CPU_VSX3 = 201, CPU_AVX512_SKX = 256, //!< Skylake-X with AVX-512F/CD/BW/DQ/VL + CPU_AVX512_COMMON = 257, //!< Common instructions AVX-512F/CD for all CPUs that support AVX-512 + CPU_AVX512_KNL = 258, //!< Knights Landing with AVX-512F/CD/ER/PF + CPU_AVX512_KNM = 259, //!< Knights Mill with AVX-512F/CD/ER/PF/4FMAPS/4VNNIW/VPOPCNTDQ + CPU_AVX512_CNL = 260, //!< Cannon Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI + CPU_AVX512_CLX = 261, //!< Cascade Lake with AVX-512F/CD/BW/DQ/VL/VNNI + CPU_AVX512_ICL = 262, //!< Ice Lake with AVX-512F/CD/BW/DQ/VL/IFMA/VBMI/VNNI/VBMI2/BITALG/VPOPCNTDQ CPU_MAX_FEATURE = 512 // see CV_HARDWARE_MAX_FEATURE }; @@ -301,6 +354,13 @@ enum CpuFeatures { #include "cv_cpu_dispatch.h" +#if !defined(CV_STRONG_ALIGNMENT) && defined(__arm__) && !(defined(__aarch64__) || defined(_M_ARM64)) +// int*, int64* should be propertly aligned pointers on ARMv7 +#define CV_STRONG_ALIGNMENT 1 +#endif +#if !defined(CV_STRONG_ALIGNMENT) +#define CV_STRONG_ALIGNMENT 0 +#endif /* fundamental constants */ #define CV_PI 3.1415926535897932384626433832795 @@ -340,17 +400,19 @@ typedef union Cv64suf } Cv64suf; +#ifndef OPENCV_ABI_COMPATIBILITY #define OPENCV_ABI_COMPATIBILITY 300 +#endif #ifdef __OPENCV_BUILD # define DISABLE_OPENCV_24_COMPATIBILITY # define OPENCV_DISABLE_DEPRECATED_COMPATIBILITY #endif -#ifdef CVAPI_EXPORTS -# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) +#ifndef CV_EXPORTS +# if (defined _WIN32 || defined WINCE || defined __CYGWIN__) && defined(CVAPI_EXPORTS) # define CV_EXPORTS __declspec(dllexport) -# elif defined __GNUC__ && __GNUC__ >= 4 +# elif defined __GNUC__ && __GNUC__ >= 4 && (defined(CVAPI_EXPORTS) || defined(__APPLE__)) # define CV_EXPORTS __attribute__ ((visibility ("default"))) # endif #endif @@ -491,7 +553,11 @@ Cv64suf; # include # define CV_XADD(addr, delta) (int)_InterlockedExchangeAdd((long volatile*)addr, delta) #else - CV_INLINE CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; } + #ifdef OPENCV_FORCE_UNSAFE_XADD + CV_INLINE CV_XADD(int* addr, int delta) { int tmp = *addr; *addr += delta; return tmp; } + #else + #error "OpenCV: can't define safe CV_XADD macro for current platform (unsupported). Define CV_XADD macro through custom port header (see OPENCV_INCLUDE_PORT_FILE)" + #endif #endif @@ -560,6 +626,13 @@ Cv64suf; # endif #endif +#ifdef CV_CXX_MOVE_SEMANTICS +#define CV_CXX_MOVE(x) std::move(x) +#else +#define CV_CXX_MOVE(x) (x) +#endif + + /****************************************************************************************\ * C++11 std::array * \****************************************************************************************/ @@ -598,6 +671,19 @@ Cv64suf; # define CV_FINAL #endif +/****************************************************************************************\ +* C++11 noexcept * +\****************************************************************************************/ + +#ifndef CV_NOEXCEPT +# if __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1900/*MSVS 2015*/) +# define CV_NOEXCEPT noexcept +# endif +#endif +#ifndef CV_NOEXCEPT +# define CV_NOEXCEPT +#endif + // Integer types portatibility @@ -683,7 +769,7 @@ protected: float16_t() {} explicit float16_t(float x) { - #if CV_AVX2 + #if CV_FP16 __m128 v = _mm_load_ss(&x); w = (ushort)_mm_cvtsi128_si32(_mm_cvtps_ph(v, 0)); #else @@ -714,7 +800,7 @@ protected: operator float() const { - #if CV_AVX2 + #if CV_FP16 float f; _mm_store_ss(&f, _mm_cvtph_ps(_mm_cvtsi32_si128(w))); return f; diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.hpp b/3rdparty/opencv/include/opencv2/core/cvstd.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.hpp rename to 3rdparty/opencv/include/opencv2/core/cvstd.hpp index 8af1162..fbf6d31 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.hpp +++ b/3rdparty/opencv/include/opencv2/core/cvstd.hpp @@ -1026,6 +1026,40 @@ static inline bool operator>= (const String& lhs, const String& rhs) { return lh static inline bool operator>= (const char* lhs, const String& rhs) { return rhs.compare(lhs) <= 0; } static inline bool operator>= (const String& lhs, const char* rhs) { return lhs.compare(rhs) >= 0; } + +#ifndef OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS + +//! @cond IGNORED +namespace details { +// std::tolower is int->int +static inline char char_tolower(char ch) +{ + return (char)std::tolower((int)ch); +} +// std::toupper is int->int +static inline char char_toupper(char ch) +{ + return (char)std::toupper((int)ch); +} +} // namespace details +//! @endcond + +static inline std::string toLowerCase(const std::string& str) +{ + std::string result(str); + std::transform(result.begin(), result.end(), result.begin(), details::char_tolower); + return result; +} + +static inline std::string toUpperCase(const std::string& str) +{ + std::string result(str); + std::transform(result.begin(), result.end(), result.begin(), details::char_toupper); + return result; +} + +#endif // OPENCV_DISABLE_STRING_LOWER_UPPER_CONVERSIONS + //! @} relates cv::String } // cv diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.inl.hpp b/3rdparty/opencv/include/opencv2/core/cvstd.inl.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.inl.hpp rename to 3rdparty/opencv/include/opencv2/core/cvstd.inl.hpp index ed37cac..36c83e2 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/cvstd.inl.hpp +++ b/3rdparty/opencv/include/opencv2/core/cvstd.inl.hpp @@ -46,6 +46,7 @@ #include #include +#include //! @cond IGNORED diff --git a/3rdparty/opencv/include/opencv2/core/detail/async_promise.hpp b/3rdparty/opencv/include/opencv2/core/detail/async_promise.hpp new file mode 100644 index 0000000..6eb3fb5 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/detail/async_promise.hpp @@ -0,0 +1,71 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_ASYNC_PROMISE_HPP +#define OPENCV_CORE_ASYNC_PROMISE_HPP + +#include "../async.hpp" + +#include "exception_ptr.hpp" + +namespace cv { + +/** @addtogroup core_async +@{ +*/ + + +/** @brief Provides result of asynchronous operations + +*/ +class CV_EXPORTS AsyncPromise +{ +public: + ~AsyncPromise() CV_NOEXCEPT; + AsyncPromise() CV_NOEXCEPT; + explicit AsyncPromise(const AsyncPromise& o) CV_NOEXCEPT; + AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT; + void release() CV_NOEXCEPT; + + /** Returns associated AsyncArray + @note Can be called once + */ + AsyncArray getArrayResult(); + + /** Stores asynchronous result. + @param[in] value result + */ + void setValue(InputArray value); + + // TODO "move" setters + +#if CV__EXCEPTION_PTR + /** Stores exception. + @param[in] exception exception to be raised in AsyncArray + */ + void setException(std::exception_ptr exception); +#endif + + /** Stores exception. + @param[in] exception exception to be raised in AsyncArray + */ + void setException(const cv::Exception& exception); + +#ifdef CV_CXX11 + explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; } + AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; } +#endif + + + // PImpl + typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl; + inline void* _getImpl() const CV_NOEXCEPT { return p; } +protected: + Impl* p; +}; + + +//! @} +} // namespace +#endif // OPENCV_CORE_ASYNC_PROMISE_HPP diff --git a/3rdparty/opencv/include/opencv2/core/detail/exception_ptr.hpp b/3rdparty/opencv/include/opencv2/core/detail/exception_ptr.hpp new file mode 100644 index 0000000..d98ffc4 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/detail/exception_ptr.hpp @@ -0,0 +1,27 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H +#define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H + +#ifndef CV__EXCEPTION_PTR +# if defined(__ANDROID__) && defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE < 2 +# define CV__EXCEPTION_PTR 0 // Not supported, details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938 +# elif defined(CV_CXX11) +# define CV__EXCEPTION_PTR 1 +# elif defined(_MSC_VER) +# define CV__EXCEPTION_PTR (_MSC_VER >= 1600) +# elif defined(__clang__) +# define CV__EXCEPTION_PTR 0 // C++11 only (see above) +# elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) +# define CV__EXCEPTION_PTR (__GXX_EXPERIMENTAL_CXX0X__ > 0) +# endif +#endif +#ifndef CV__EXCEPTION_PTR +# define CV__EXCEPTION_PTR 0 +#elif CV__EXCEPTION_PTR +# include // std::exception_ptr +#endif + +#endif // OPENCV_CORE_DETAILS_EXCEPTION_PTR_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/directx.hpp b/3rdparty/opencv/include/opencv2/core/directx.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/directx.hpp rename to 3rdparty/opencv/include/opencv2/core/directx.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/eigen.hpp b/3rdparty/opencv/include/opencv2/core/eigen.hpp similarity index 67% rename from qt-correction-tool/pub/opencv/include/opencv2/core/eigen.hpp rename to 3rdparty/opencv/include/opencv2/core/eigen.hpp index 741648e..51f4147 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/eigen.hpp +++ b/3rdparty/opencv/include/opencv2/core/eigen.hpp @@ -45,20 +45,142 @@ #ifndef OPENCV_CORE_EIGEN_HPP #define OPENCV_CORE_EIGEN_HPP +#ifndef EIGEN_WORLD_VERSION +#error "Wrong usage of OpenCV's Eigen utility header. Include Eigen's headers first. See https://github.com/opencv/opencv/issues/17366" +#endif + #include "opencv2/core.hpp" #if defined _MSC_VER && _MSC_VER >= 1200 +#define NOMINMAX // fix https://github.com/opencv/opencv/issues/17548 #pragma warning( disable: 4714 ) //__forceinline is not inlined #pragma warning( disable: 4127 ) //conditional expression is constant #pragma warning( disable: 4244 ) //conversion from '__int64' to 'int', possible loss of data #endif +#if !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT) +#if EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 \ + && defined(CV_CXX11) && defined(CV_CXX_STD_ARRAY) +#include +#define OPENCV_EIGEN_TENSOR_SUPPORT 1 +#endif // EIGEN_WORLD_VERSION == 3 && EIGEN_MAJOR_VERSION >= 3 +#endif // !defined(OPENCV_DISABLE_EIGEN_TENSOR_SUPPORT) + namespace cv { -//! @addtogroup core_eigen +/** @addtogroup core_eigen +These functions are provided for OpenCV-Eigen interoperability. They convert `Mat` +objects to corresponding `Eigen::Matrix` objects and vice-versa. Consult the [Eigen +documentation](https://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html) for +information about the `Matrix` template type. + +@note Using these functions requires the `Eigen/Dense` or similar header to be +included before this header. +*/ //! @{ +#if defined(OPENCV_EIGEN_TENSOR_SUPPORT) || defined(CV_DOXYGEN) +/** @brief Converts an Eigen::Tensor to a cv::Mat. + +The method converts an Eigen::Tensor with shape (H x W x C) to a cv::Mat where: + H = number of rows + W = number of columns + C = number of channels + +Usage: +\code +Eigen::Tensor a_tensor(...); +// populate tensor with values +Mat a_mat; +eigen2cv(a_tensor, a_mat); +\endcode +*/ +template static inline +void eigen2cv( const Eigen::Tensor<_Tp, 3, _layout> &src, OutputArray dst ) +{ + if( !(_layout & Eigen::RowMajorBit) ) + { + const std::array shuffle{2, 1, 0}; + Eigen::Tensor<_Tp, 3, !_layout> row_major_tensor = src.swap_layout().shuffle(shuffle); + Mat _src(src.dimension(0), src.dimension(1), CV_MAKETYPE(DataType<_Tp>::type, src.dimension(2)), row_major_tensor.data()); + _src.copyTo(dst); + } + else + { + Mat _src(src.dimension(0), src.dimension(1), CV_MAKETYPE(DataType<_Tp>::type, src.dimension(2)), (void *)src.data()); + _src.copyTo(dst); + } +} + +/** @brief Converts a cv::Mat to an Eigen::Tensor. + +The method converts a cv::Mat to an Eigen Tensor with shape (H x W x C) where: + H = number of rows + W = number of columns + C = number of channels + +Usage: +\code +Mat a_mat(...); +// populate Mat with values +Eigen::Tensor a_tensor(...); +cv2eigen(a_mat, a_tensor); +\endcode +*/ +template static inline +void cv2eigen( const Mat &src, Eigen::Tensor<_Tp, 3, _layout> &dst ) +{ + if( !(_layout & Eigen::RowMajorBit) ) + { + Eigen::Tensor<_Tp, 3, !_layout> row_major_tensor(src.rows, src.cols, src.channels()); + Mat _dst(src.rows, src.cols, CV_MAKETYPE(DataType<_Tp>::type, src.channels()), row_major_tensor.data()); + if (src.type() == _dst.type()) + src.copyTo(_dst); + else + src.convertTo(_dst, _dst.type()); + const std::array shuffle{2, 1, 0}; + dst = row_major_tensor.swap_layout().shuffle(shuffle); + } + else + { + dst.resize(src.rows, src.cols, src.channels()); + Mat _dst(src.rows, src.cols, CV_MAKETYPE(DataType<_Tp>::type, src.channels()), dst.data()); + if (src.type() == _dst.type()) + src.copyTo(_dst); + else + src.convertTo(_dst, _dst.type()); + } +} + +/** @brief Maps cv::Mat data to an Eigen::TensorMap. + +The method wraps an existing Mat data array with an Eigen TensorMap of shape (H x W x C) where: + H = number of rows + W = number of columns + C = number of channels + +Explicit instantiation of the return type is required. + +@note Caller should be aware of the lifetime of the cv::Mat instance and take appropriate safety measures. +The cv::Mat instance will retain ownership of the data and the Eigen::TensorMap will lose access when the cv::Mat data is deallocated. + +The example below initializes a cv::Mat and produces an Eigen::TensorMap: +\code +float arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; +Mat a_mat(2, 2, CV_32FC3, arr); +Eigen::TensorMap> a_tensormap = cv2eigen_tensormap(a_mat); +\endcode +*/ +template static inline +Eigen::TensorMap> cv2eigen_tensormap(InputArray src) +{ + Mat mat = src.getMat(); + CV_CheckTypeEQ(mat.type(), CV_MAKETYPE(traits::Type<_Tp>::value, mat.channels()), ""); + return Eigen::TensorMap>((_Tp *)mat.data, mat.rows, mat.cols, mat.channels()); +} +#endif // OPENCV_EIGEN_TENSOR_SUPPORT + template static inline void eigen2cv( const Eigen::Matrix<_Tp, _rows, _cols, _options, _maxRows, _maxCols>& src, OutputArray dst ) { diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/fast_math.hpp b/3rdparty/opencv/include/opencv2/core/fast_math.hpp similarity index 50% rename from qt-correction-tool/pub/opencv/include/opencv2/core/fast_math.hpp rename to 3rdparty/opencv/include/opencv2/core/fast_math.hpp index d9ea28e..eb4fbe2 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/fast_math.hpp +++ b/3rdparty/opencv/include/opencv2/core/fast_math.hpp @@ -47,12 +47,6 @@ #include "opencv2/core/cvdef.h" -#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ - && defined __SSE2__ && !defined __APPLE__)) && !defined(__CUDACC__) -#include -#endif - - //! @addtogroup core_utils //! @{ @@ -70,11 +64,27 @@ # endif #endif -#ifdef HAVE_TEGRA_OPTIMIZATION -# include "tegra_round.hpp" -#endif +#if defined(__CUDACC__) + // nothing, intrinsics/asm code is not supported +#else + #if ((defined _MSC_VER && defined _M_X64) \ + || (defined __GNUC__ && defined __x86_64__ && defined __SSE2__)) \ + && !defined(OPENCV_SKIP_INCLUDE_EMMINTRIN_H) + #include + #endif -#if defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__ && !defined(__CUDACC__) + #if defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8 \ + && !defined(OPENCV_SKIP_INCLUDE_ALTIVEC_H) + #include + #undef vector + #undef bool + #undef pixel + #endif + + #if defined(CV_INLINE_ROUND_FLT) + // user-specified version + // CV_INLINE_ROUND_DBL should be defined too + #elif defined __GNUC__ && defined __arm__ && (defined __ARM_PCS_VFP || defined __ARM_VFPV3__ || defined __ARM_NEON__) && !defined __SOFTFP__ // 1. general scheme #define ARM_ROUND(_value, _asm_string) \ int res; \ @@ -84,13 +94,102 @@ return res // 2. version for double #ifdef __clang__ - #define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %[value] \n vmov %[res], %[temp]") + #define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %[value] \n vmov %[res], %[temp]") #else - #define ARM_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %P[value] \n vmov %[res], %[temp]") + #define CV_INLINE_ROUND_DBL(value) ARM_ROUND(value, "vcvtr.s32.f64 %[temp], %P[value] \n vmov %[res], %[temp]") #endif // 3. version for float - #define ARM_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]") -#endif + #define CV_INLINE_ROUND_FLT(value) ARM_ROUND(value, "vcvtr.s32.f32 %[temp], %[value]\n vmov %[res], %[temp]") + #elif defined __PPC64__ && defined __GNUC__ && defined _ARCH_PWR8 + // P8 and newer machines can convert fp32/64 to int quickly. + #define CV_INLINE_ROUND_DBL(value) \ + int out; \ + double temp; \ + __asm__( "fctiw %[temp],%[in]\n\tmfvsrwz %[out],%[temp]\n\t" : [out] "=r" (out), [temp] "=d" (temp) : [in] "d" ((double)(value)) : ); \ + return out; + + // FP32 also works with FP64 routine above + #define CV_INLINE_ROUND_FLT(value) CV_INLINE_ROUND_DBL(value) + #endif + + #ifdef CV_INLINE_ISINF_FLT + // user-specified version + // CV_INLINE_ISINF_DBL should be defined too + #elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class) + #define CV_INLINE_ISINF_DBL(value) return scalar_test_data_class(value, 0x30); + #define CV_INLINE_ISINF_FLT(value) CV_INLINE_ISINF_DBL(value) + #endif + + #ifdef CV_INLINE_ISNAN_FLT + // user-specified version + // CV_INLINE_ISNAN_DBL should be defined too + #elif defined __PPC64__ && defined _ARCH_PWR9 && defined(scalar_test_data_class) + #define CV_INLINE_ISNAN_DBL(value) return scalar_test_data_class(value, 0x40); + #define CV_INLINE_ISNAN_FLT(value) CV_INLINE_ISNAN_DBL(value) + #endif + + #if !defined(OPENCV_USE_FASTMATH_BUILTINS) \ + && ( \ + defined(__x86_64__) || defined(__i686__) \ + || defined(__arm__) \ + || defined(__PPC64__) \ + ) + /* Let builtin C math functions when available. Dedicated hardware is available to + round and convert FP values. */ + #define OPENCV_USE_FASTMATH_BUILTINS 1 + #endif + + /* Enable builtin math functions if possible, desired, and available. + Note, not all math functions inline equally. E.g lrint will not inline + without the -fno-math-errno option. */ + #if defined(CV_ICC) + // nothing + #elif defined(OPENCV_USE_FASTMATH_BUILTINS) && OPENCV_USE_FASTMATH_BUILTINS + #if defined(__clang__) + #define CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS + #if !defined(CV_INLINE_ISNAN_DBL) && __has_builtin(__builtin_isnan) + #define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value); + #endif + #if !defined(CV_INLINE_ISNAN_FLT) && __has_builtin(__builtin_isnan) + #define CV_INLINE_ISNAN_FLT(value) return __builtin_isnan(value); + #endif + #if !defined(CV_INLINE_ISINF_DBL) && __has_builtin(__builtin_isinf) + #define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value); + #endif + #if !defined(CV_INLINE_ISINF_FLT) && __has_builtin(__builtin_isinf) + #define CV_INLINE_ISINF_FLT(value) return __builtin_isinf(value); + #endif + #elif defined(__GNUC__) + #define CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS + #if !defined(CV_INLINE_ISNAN_DBL) + #define CV_INLINE_ISNAN_DBL(value) return __builtin_isnan(value); + #endif + #if !defined(CV_INLINE_ISNAN_FLT) + #define CV_INLINE_ISNAN_FLT(value) return __builtin_isnanf(value); + #endif + #if !defined(CV_INLINE_ISINF_DBL) + #define CV_INLINE_ISINF_DBL(value) return __builtin_isinf(value); + #endif + #if !defined(CV_INLINE_ISINF_FLT) + #define CV_INLINE_ISINF_FLT(value) return __builtin_isinff(value); + #endif + #elif defined(_MSC_VER) + #if !defined(CV_INLINE_ISNAN_DBL) + #define CV_INLINE_ISNAN_DBL(value) return isnan(value); + #endif + #if !defined(CV_INLINE_ISNAN_FLT) + #define CV_INLINE_ISNAN_FLT(value) return isnan(value); + #endif + #if !defined(CV_INLINE_ISINF_DBL) + #define CV_INLINE_ISINF_DBL(value) return isinf(value); + #endif + #if !defined(CV_INLINE_ISINF_FLT) + #define CV_INLINE_ISINF_FLT(value) return isinf(value); + #endif + #endif + #endif + +#endif // defined(__CUDACC__) /** @brief Rounds floating-point number to the nearest integer @@ -100,8 +199,11 @@ CV_INLINE int cvRound( double value ) { -#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ - && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__) +#if defined CV_INLINE_ROUND_DBL + CV_INLINE_ROUND_DBL(value); +#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ + && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \ + && !defined(__CUDACC__) __m128d t = _mm_set_sd( value ); return _mm_cvtsd_si32(t); #elif defined _MSC_VER && defined _M_IX86 @@ -112,15 +214,8 @@ cvRound( double value ) fistp t; } return t; -#elif ((defined _MSC_VER && defined _M_ARM) || defined CV_ICC || \ - defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION - TEGRA_ROUND_DBL(value); #elif defined CV_ICC || defined __GNUC__ -# if defined ARM_ROUND_DBL - ARM_ROUND_DBL(value); -# else - return (int)lrint(value); -# endif + return (int)(lrint(value)); #else /* it's ok if round does not comply with IEEE754 standard; the tests should allow +/-1 difference when the tested functions use round */ @@ -138,8 +233,15 @@ cvRound( double value ) */ CV_INLINE int cvFloor( double value ) { +#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \ + && ( \ + defined(__PPC64__) \ + ) + return __builtin_floor(value); +#else int i = (int)value; return i - (i > value); +#endif } /** @brief Rounds floating-point number to the nearest integer not smaller than the original. @@ -151,8 +253,15 @@ CV_INLINE int cvFloor( double value ) */ CV_INLINE int cvCeil( double value ) { +#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \ + && ( \ + defined(__PPC64__) \ + ) + return __builtin_ceil(value); +#else int i = (int)value; return i + (i < value); +#endif } /** @brief Determines if the argument is Not A Number. @@ -163,10 +272,14 @@ CV_INLINE int cvCeil( double value ) otherwise. */ CV_INLINE int cvIsNaN( double value ) { +#if defined CV_INLINE_ISNAN_DBL + CV_INLINE_ISNAN_DBL(value); +#else Cv64suf ieee754; ieee754.f = value; return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) + ((unsigned)ieee754.u != 0) > 0x7ff00000; +#endif } /** @brief Determines if the argument is Infinity. @@ -177,10 +290,19 @@ CV_INLINE int cvIsNaN( double value ) and 0 otherwise. */ CV_INLINE int cvIsInf( double value ) { +#if defined CV_INLINE_ISINF_DBL + CV_INLINE_ISINF_DBL(value); +#elif defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64) || defined(__PPC64__) + Cv64suf ieee754; + ieee754.f = value; + return (ieee754.u & 0x7fffffff00000000) == + 0x7ff0000000000000; +#else Cv64suf ieee754; ieee754.f = value; return ((unsigned)(ieee754.u >> 32) & 0x7fffffff) == 0x7ff00000 && (unsigned)ieee754.u == 0; +#endif } #ifdef __cplusplus @@ -188,8 +310,11 @@ CV_INLINE int cvIsInf( double value ) /** @overload */ CV_INLINE int cvRound(float value) { -#if ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ - && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) && !defined(__CUDACC__) +#if defined CV_INLINE_ROUND_FLT + CV_INLINE_ROUND_FLT(value); +#elif ((defined _MSC_VER && defined _M_X64) || (defined __GNUC__ && defined __x86_64__ \ + && defined __SSE2__ && !defined __APPLE__) || CV_SSE2) \ + && !defined(__CUDACC__) __m128 t = _mm_set_ss( value ); return _mm_cvtss_si32(t); #elif defined _MSC_VER && defined _M_IX86 @@ -200,15 +325,8 @@ CV_INLINE int cvRound(float value) fistp t; } return t; -#elif ((defined _MSC_VER && defined _M_ARM) || defined CV_ICC || \ - defined __GNUC__) && defined HAVE_TEGRA_OPTIMIZATION - TEGRA_ROUND_FLT(value); #elif defined CV_ICC || defined __GNUC__ -# if defined ARM_ROUND_FLT - ARM_ROUND_FLT(value); -# else - return (int)lrintf(value); -# endif + return (int)(lrintf(value)); #else /* it's ok if round does not comply with IEEE754 standard; the tests should allow +/-1 difference when the tested functions use round */ @@ -225,8 +343,15 @@ CV_INLINE int cvRound( int value ) /** @overload */ CV_INLINE int cvFloor( float value ) { +#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \ + && ( \ + defined(__PPC64__) \ + ) + return __builtin_floorf(value); +#else int i = (int)value; return i - (i > value); +#endif } /** @overload */ @@ -238,8 +363,15 @@ CV_INLINE int cvFloor( int value ) /** @overload */ CV_INLINE int cvCeil( float value ) { +#if (defined CV__FASTMATH_ENABLE_GCC_MATH_BUILTINS || defined CV__FASTMATH_ENABLE_CLANG_MATH_BUILTINS) \ + && ( \ + defined(__PPC64__) \ + ) + return __builtin_ceilf(value); +#else int i = (int)value; return i + (i < value); +#endif } /** @overload */ @@ -251,17 +383,25 @@ CV_INLINE int cvCeil( int value ) /** @overload */ CV_INLINE int cvIsNaN( float value ) { +#if defined CV_INLINE_ISNAN_FLT + CV_INLINE_ISNAN_FLT(value); +#else Cv32suf ieee754; ieee754.f = value; return (ieee754.u & 0x7fffffff) > 0x7f800000; +#endif } /** @overload */ CV_INLINE int cvIsInf( float value ) { +#if defined CV_INLINE_ISINF_FLT + CV_INLINE_ISINF_FLT(value); +#else Cv32suf ieee754; ieee754.f = value; return (ieee754.u & 0x7fffffff) == 0x7f800000; +#endif } #endif // __cplusplus diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/hal.hpp b/3rdparty/opencv/include/opencv2/core/hal/hal.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/hal.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/hal.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/interface.h b/3rdparty/opencv/include/opencv2/core/hal/interface.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/interface.h rename to 3rdparty/opencv/include/opencv2/core/hal/interface.h diff --git a/3rdparty/opencv/include/opencv2/core/hal/intrin.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin.hpp new file mode 100644 index 0000000..16d5284 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin.hpp @@ -0,0 +1,698 @@ +/*M/////////////////////////////////////////////////////////////////////////////////////// +// +// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. +// +// By downloading, copying, installing or using the software you agree to this license. +// If you do not agree to this license, do not download, install, +// copy or use the software. +// +// +// License Agreement +// For Open Source Computer Vision Library +// +// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. +// Copyright (C) 2009, Willow Garage Inc., all rights reserved. +// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Copyright (C) 2015, Itseez Inc., all rights reserved. +// Third party copyrights are property of their respective owners. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// * Redistribution's of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// +// * Redistribution's in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// * The name of the copyright holders may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// This software is provided by the copyright holders and contributors "as is" and +// any express or implied warranties, including, but not limited to, the implied +// warranties of merchantability and fitness for a particular purpose are disclaimed. +// In no event shall the Intel Corporation or contributors be liable for any direct, +// indirect, incidental, special, exemplary, or consequential damages +// (including, but not limited to, procurement of substitute goods or services; +// loss of use, data, or profits; or business interruption) however caused +// and on any theory of liability, whether in contract, strict liability, +// or tort (including negligence or otherwise) arising in any way out of +// the use of this software, even if advised of the possibility of such damage. +// +//M*/ + +#ifndef OPENCV_HAL_INTRIN_HPP +#define OPENCV_HAL_INTRIN_HPP + +#include +#include +#include +#include "opencv2/core/cvdef.h" + +#define OPENCV_HAL_ADD(a, b) ((a) + (b)) +#define OPENCV_HAL_AND(a, b) ((a) & (b)) +#define OPENCV_HAL_NOP(a) (a) +#define OPENCV_HAL_1ST(a, b) (a) + +namespace { +inline unsigned int trailingZeros32(unsigned int value) { +#if defined(_MSC_VER) +#if (_MSC_VER < 1700) || defined(_M_ARM) || defined(_M_ARM64) + unsigned long index = 0; + _BitScanForward(&index, value); + return (unsigned int)index; +#elif defined(__clang__) + // clang-cl doesn't export _tzcnt_u32 for non BMI systems + return value ? __builtin_ctz(value) : 32; +#else + return _tzcnt_u32(value); +#endif +#elif defined(__GNUC__) || defined(__GNUG__) + return __builtin_ctz(value); +#elif defined(__ICC) || defined(__INTEL_COMPILER) + return _bit_scan_forward(value); +#elif defined(__clang__) + return llvm.cttz.i32(value, true); +#else + static const int MultiplyDeBruijnBitPosition[32] = { + 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, + 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; + return MultiplyDeBruijnBitPosition[((uint32_t)((value & -value) * 0x077CB531U)) >> 27]; +#endif +} +} + +// unlike HAL API, which is in cv::hal, +// we put intrinsics into cv namespace to make its +// access from within opencv code more accessible +namespace cv { + +namespace hal { + +enum StoreMode +{ + STORE_UNALIGNED = 0, + STORE_ALIGNED = 1, + STORE_ALIGNED_NOCACHE = 2 +}; + +} + +// TODO FIXIT: Don't use "God" traits. Split on separate cases. +template struct V_TypeTraits +{ +}; + +#define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_) \ + template<> struct V_TypeTraits \ + { \ + typedef type value_type; \ + typedef int_type_ int_type; \ + typedef abs_type_ abs_type; \ + typedef uint_type_ uint_type; \ + typedef w_type_ w_type; \ + typedef q_type_ q_type; \ + typedef sum_type_ sum_type; \ + \ + static inline int_type reinterpret_int(type x) \ + { \ + union { type l; int_type i; } v; \ + v.l = x; \ + return v.i; \ + } \ + \ + static inline type reinterpret_from_int(int_type x) \ + { \ + union { type l; int_type i; } v; \ + v.i = x; \ + return v.l; \ + } \ + } + +#define CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(type, int_type_, uint_type_, abs_type_, w_type_, sum_type_) \ + template<> struct V_TypeTraits \ + { \ + typedef type value_type; \ + typedef int_type_ int_type; \ + typedef abs_type_ abs_type; \ + typedef uint_type_ uint_type; \ + typedef w_type_ w_type; \ + typedef sum_type_ sum_type; \ + \ + static inline int_type reinterpret_int(type x) \ + { \ + union { type l; int_type i; } v; \ + v.l = x; \ + return v.i; \ + } \ + \ + static inline type reinterpret_from_int(int_type x) \ + { \ + union { type l; int_type i; } v; \ + v.i = x; \ + return v.l; \ + } \ + } + +CV_INTRIN_DEF_TYPE_TRAITS(uchar, schar, uchar, uchar, ushort, unsigned, unsigned); +CV_INTRIN_DEF_TYPE_TRAITS(schar, schar, uchar, uchar, short, int, int); +CV_INTRIN_DEF_TYPE_TRAITS(ushort, short, ushort, ushort, unsigned, uint64, unsigned); +CV_INTRIN_DEF_TYPE_TRAITS(short, short, ushort, ushort, int, int64, int); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(unsigned, int, unsigned, unsigned, uint64, unsigned); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int, int, unsigned, unsigned, int64, int); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(float, int, unsigned, float, double, float); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(uint64, int64, uint64, uint64, void, uint64); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(int64, int64, uint64, uint64, void, int64); +CV_INTRIN_DEF_TYPE_TRAITS_NO_Q_TYPE(double, int64, uint64, double, void, double); + +#ifndef CV_DOXYGEN + +#ifndef CV_CPU_OPTIMIZATION_HAL_NAMESPACE +#ifdef CV_FORCE_SIMD128_CPP + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_EMULATOR_CPP + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_EMULATOR_CPP { + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END } +#elif defined(CV_CPU_DISPATCH_MODE) + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) { + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END } +#else + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline { + #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END } +#endif +#endif // CV_CPU_OPTIMIZATION_HAL_NAMESPACE + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END +using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE; +#endif +} + +#ifdef CV_DOXYGEN +# undef CV_AVX2 +# undef CV_SSE2 +# undef CV_NEON +# undef CV_VSX +# undef CV_FP16 +# undef CV_MSA +#endif + +#if (CV_SSE2 || CV_NEON || CV_VSX || CV_MSA || CV_WASM_SIMD) && !defined(CV_FORCE_SIMD128_CPP) +#define CV__SIMD_FORWARD 128 +#include "opencv2/core/hal/intrin_forward.hpp" +#endif + +#if CV_SSE2 && !defined(CV_FORCE_SIMD128_CPP) + +#include "opencv2/core/hal/intrin_sse_em.hpp" +#include "opencv2/core/hal/intrin_sse.hpp" + +#elif CV_NEON && !defined(CV_FORCE_SIMD128_CPP) + +#include "opencv2/core/hal/intrin_neon.hpp" + +#elif CV_VSX && !defined(CV_FORCE_SIMD128_CPP) + +#include "opencv2/core/hal/intrin_vsx.hpp" + +#elif CV_MSA && !defined(CV_FORCE_SIMD128_CPP) + +#include "opencv2/core/hal/intrin_msa.hpp" + +#elif CV_WASM_SIMD && !defined(CV_FORCE_SIMD128_CPP) +#include "opencv2/core/hal/intrin_wasm.hpp" + +#else + +#include "opencv2/core/hal/intrin_cpp.hpp" + +#endif + +// AVX2 can be used together with SSE2, so +// we define those two sets of intrinsics at once. +// Most of the intrinsics do not conflict (the proper overloaded variant is +// resolved by the argument types, e.g. v_float32x4 ~ SSE2, v_float32x8 ~ AVX2), +// but some of AVX2 intrinsics get v256_ prefix instead of v_, e.g. v256_load() vs v_load(). +// Correspondingly, the wide intrinsics (which are mapped to the "widest" +// available instruction set) will get vx_ prefix +// (and will be mapped to v256_ counterparts) (e.g. vx_load() => v256_load()) +#if CV_AVX2 + +#define CV__SIMD_FORWARD 256 +#include "opencv2/core/hal/intrin_forward.hpp" +#include "opencv2/core/hal/intrin_avx.hpp" + +#endif + +// AVX512 can be used together with SSE2 and AVX2, so +// we define those sets of intrinsics at once. +// For some of AVX512 intrinsics get v512_ prefix instead of v_, e.g. v512_load() vs v_load(). +// Wide intrinsics will be mapped to v512_ counterparts in this case(e.g. vx_load() => v512_load()) +#if CV_AVX512_SKX + +#define CV__SIMD_FORWARD 512 +#include "opencv2/core/hal/intrin_forward.hpp" +#include "opencv2/core/hal/intrin_avx512.hpp" + +#endif + +//! @cond IGNORED + +namespace cv { + +#ifndef CV_DOXYGEN +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN +#endif + +#ifndef CV_SIMD128 +#define CV_SIMD128 0 +#endif + +#ifndef CV_SIMD128_CPP +#define CV_SIMD128_CPP 0 +#endif + +#ifndef CV_SIMD128_64F +#define CV_SIMD128_64F 0 +#endif + +#ifndef CV_SIMD256 +#define CV_SIMD256 0 +#endif + +#ifndef CV_SIMD256_64F +#define CV_SIMD256_64F 0 +#endif + +#ifndef CV_SIMD512 +#define CV_SIMD512 0 +#endif + +#ifndef CV_SIMD512_64F +#define CV_SIMD512_64F 0 +#endif + +#ifndef CV_SIMD128_FP16 +#define CV_SIMD128_FP16 0 +#endif + +#ifndef CV_SIMD256_FP16 +#define CV_SIMD256_FP16 0 +#endif + +#ifndef CV_SIMD512_FP16 +#define CV_SIMD512_FP16 0 +#endif + +//================================================================================================== + +template struct V_RegTraits +{ +}; + +#define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \ + template<> struct V_RegTraits<_reg> \ + { \ + typedef _reg reg; \ + typedef _u_reg u_reg; \ + typedef _w_reg w_reg; \ + typedef _q_reg q_reg; \ + typedef _int_reg int_reg; \ + typedef _round_reg round_reg; \ + } + +#if CV_SIMD128 || CV_SIMD128_CPP + CV_DEF_REG_TRAITS(v, v_uint8x16, uchar, u8, v_uint8x16, v_uint16x8, v_uint32x4, v_int8x16, void); + CV_DEF_REG_TRAITS(v, v_int8x16, schar, s8, v_uint8x16, v_int16x8, v_int32x4, v_int8x16, void); + CV_DEF_REG_TRAITS(v, v_uint16x8, ushort, u16, v_uint16x8, v_uint32x4, v_uint64x2, v_int16x8, void); + CV_DEF_REG_TRAITS(v, v_int16x8, short, s16, v_uint16x8, v_int32x4, v_int64x2, v_int16x8, void); + CV_DEF_REG_TRAITS(v, v_uint32x4, unsigned, u32, v_uint32x4, v_uint64x2, void, v_int32x4, void); + CV_DEF_REG_TRAITS(v, v_int32x4, int, s32, v_uint32x4, v_int64x2, void, v_int32x4, void); +#if CV_SIMD128_64F || CV_SIMD128_CPP + CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, v_float64x2, void, v_int32x4, v_int32x4); +#else + CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, void, void, v_int32x4, v_int32x4); +#endif + CV_DEF_REG_TRAITS(v, v_uint64x2, uint64, u64, v_uint64x2, void, void, v_int64x2, void); + CV_DEF_REG_TRAITS(v, v_int64x2, int64, s64, v_uint64x2, void, void, v_int64x2, void); +#if CV_SIMD128_64F + CV_DEF_REG_TRAITS(v, v_float64x2, double, f64, v_float64x2, void, void, v_int64x2, v_int32x4); +#endif +#endif + +#if CV_SIMD256 + CV_DEF_REG_TRAITS(v256, v_uint8x32, uchar, u8, v_uint8x32, v_uint16x16, v_uint32x8, v_int8x32, void); + CV_DEF_REG_TRAITS(v256, v_int8x32, schar, s8, v_uint8x32, v_int16x16, v_int32x8, v_int8x32, void); + CV_DEF_REG_TRAITS(v256, v_uint16x16, ushort, u16, v_uint16x16, v_uint32x8, v_uint64x4, v_int16x16, void); + CV_DEF_REG_TRAITS(v256, v_int16x16, short, s16, v_uint16x16, v_int32x8, v_int64x4, v_int16x16, void); + CV_DEF_REG_TRAITS(v256, v_uint32x8, unsigned, u32, v_uint32x8, v_uint64x4, void, v_int32x8, void); + CV_DEF_REG_TRAITS(v256, v_int32x8, int, s32, v_uint32x8, v_int64x4, void, v_int32x8, void); + CV_DEF_REG_TRAITS(v256, v_float32x8, float, f32, v_float32x8, v_float64x4, void, v_int32x8, v_int32x8); + CV_DEF_REG_TRAITS(v256, v_uint64x4, uint64, u64, v_uint64x4, void, void, v_int64x4, void); + CV_DEF_REG_TRAITS(v256, v_int64x4, int64, s64, v_uint64x4, void, void, v_int64x4, void); + CV_DEF_REG_TRAITS(v256, v_float64x4, double, f64, v_float64x4, void, void, v_int64x4, v_int32x8); +#endif + +#if CV_SIMD512 + CV_DEF_REG_TRAITS(v512, v_uint8x64, uchar, u8, v_uint8x64, v_uint16x32, v_uint32x16, v_int8x64, void); + CV_DEF_REG_TRAITS(v512, v_int8x64, schar, s8, v_uint8x64, v_int16x32, v_int32x16, v_int8x64, void); + CV_DEF_REG_TRAITS(v512, v_uint16x32, ushort, u16, v_uint16x32, v_uint32x16, v_uint64x8, v_int16x32, void); + CV_DEF_REG_TRAITS(v512, v_int16x32, short, s16, v_uint16x32, v_int32x16, v_int64x8, v_int16x32, void); + CV_DEF_REG_TRAITS(v512, v_uint32x16, unsigned, u32, v_uint32x16, v_uint64x8, void, v_int32x16, void); + CV_DEF_REG_TRAITS(v512, v_int32x16, int, s32, v_uint32x16, v_int64x8, void, v_int32x16, void); + CV_DEF_REG_TRAITS(v512, v_float32x16, float, f32, v_float32x16, v_float64x8, void, v_int32x16, v_int32x16); + CV_DEF_REG_TRAITS(v512, v_uint64x8, uint64, u64, v_uint64x8, void, void, v_int64x8, void); + CV_DEF_REG_TRAITS(v512, v_int64x8, int64, s64, v_uint64x8, void, void, v_int64x8, void); + CV_DEF_REG_TRAITS(v512, v_float64x8, double, f64, v_float64x8, void, void, v_int64x8, v_int32x16); +#endif +//! @endcond + +#if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512) +#define CV__SIMD_NAMESPACE simd512 +namespace CV__SIMD_NAMESPACE { + #define CV_SIMD 1 + #define CV_SIMD_64F CV_SIMD512_64F + #define CV_SIMD_FP16 CV_SIMD512_FP16 + #define CV_SIMD_WIDTH 64 +//! @addtogroup core_hal_intrin +//! @{ + //! @brief Maximum available vector register capacity 8-bit unsigned integer values + typedef v_uint8x64 v_uint8; + //! @brief Maximum available vector register capacity 8-bit signed integer values + typedef v_int8x64 v_int8; + //! @brief Maximum available vector register capacity 16-bit unsigned integer values + typedef v_uint16x32 v_uint16; + //! @brief Maximum available vector register capacity 16-bit signed integer values + typedef v_int16x32 v_int16; + //! @brief Maximum available vector register capacity 32-bit unsigned integer values + typedef v_uint32x16 v_uint32; + //! @brief Maximum available vector register capacity 32-bit signed integer values + typedef v_int32x16 v_int32; + //! @brief Maximum available vector register capacity 64-bit unsigned integer values + typedef v_uint64x8 v_uint64; + //! @brief Maximum available vector register capacity 64-bit signed integer values + typedef v_int64x8 v_int64; + //! @brief Maximum available vector register capacity 32-bit floating point values (single precision) + typedef v_float32x16 v_float32; + #if CV_SIMD512_64F + //! @brief Maximum available vector register capacity 64-bit floating point values (double precision) + typedef v_float64x8 v_float64; + #endif +//! @} + + #define VXPREFIX(func) v512##func +} // namespace +using namespace CV__SIMD_NAMESPACE; +#elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256) +#define CV__SIMD_NAMESPACE simd256 +namespace CV__SIMD_NAMESPACE { + #define CV_SIMD 1 + #define CV_SIMD_64F CV_SIMD256_64F + #define CV_SIMD_FP16 CV_SIMD256_FP16 + #define CV_SIMD_WIDTH 32 +//! @addtogroup core_hal_intrin +//! @{ + //! @brief Maximum available vector register capacity 8-bit unsigned integer values + typedef v_uint8x32 v_uint8; + //! @brief Maximum available vector register capacity 8-bit signed integer values + typedef v_int8x32 v_int8; + //! @brief Maximum available vector register capacity 16-bit unsigned integer values + typedef v_uint16x16 v_uint16; + //! @brief Maximum available vector register capacity 16-bit signed integer values + typedef v_int16x16 v_int16; + //! @brief Maximum available vector register capacity 32-bit unsigned integer values + typedef v_uint32x8 v_uint32; + //! @brief Maximum available vector register capacity 32-bit signed integer values + typedef v_int32x8 v_int32; + //! @brief Maximum available vector register capacity 64-bit unsigned integer values + typedef v_uint64x4 v_uint64; + //! @brief Maximum available vector register capacity 64-bit signed integer values + typedef v_int64x4 v_int64; + //! @brief Maximum available vector register capacity 32-bit floating point values (single precision) + typedef v_float32x8 v_float32; + #if CV_SIMD256_64F + //! @brief Maximum available vector register capacity 64-bit floating point values (double precision) + typedef v_float64x4 v_float64; + #endif +//! @} + + #define VXPREFIX(func) v256##func +} // namespace +using namespace CV__SIMD_NAMESPACE; +#elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128) +#if defined CV_SIMD128_CPP +#define CV__SIMD_NAMESPACE simd128_cpp +#else +#define CV__SIMD_NAMESPACE simd128 +#endif +namespace CV__SIMD_NAMESPACE { + #define CV_SIMD CV_SIMD128 + #define CV_SIMD_64F CV_SIMD128_64F + #define CV_SIMD_WIDTH 16 +//! @addtogroup core_hal_intrin +//! @{ + //! @brief Maximum available vector register capacity 8-bit unsigned integer values + typedef v_uint8x16 v_uint8; + //! @brief Maximum available vector register capacity 8-bit signed integer values + typedef v_int8x16 v_int8; + //! @brief Maximum available vector register capacity 16-bit unsigned integer values + typedef v_uint16x8 v_uint16; + //! @brief Maximum available vector register capacity 16-bit signed integer values + typedef v_int16x8 v_int16; + //! @brief Maximum available vector register capacity 32-bit unsigned integer values + typedef v_uint32x4 v_uint32; + //! @brief Maximum available vector register capacity 32-bit signed integer values + typedef v_int32x4 v_int32; + //! @brief Maximum available vector register capacity 64-bit unsigned integer values + typedef v_uint64x2 v_uint64; + //! @brief Maximum available vector register capacity 64-bit signed integer values + typedef v_int64x2 v_int64; + //! @brief Maximum available vector register capacity 32-bit floating point values (single precision) + typedef v_float32x4 v_float32; + #if CV_SIMD128_64F + //! @brief Maximum available vector register capacity 64-bit floating point values (double precision) + typedef v_float64x2 v_float64; + #endif +//! @} + + #define VXPREFIX(func) v##func +} // namespace +using namespace CV__SIMD_NAMESPACE; +#endif + +namespace CV__SIMD_NAMESPACE { +//! @addtogroup core_hal_intrin +//! @{ + //! @name Wide init with value + //! @{ + //! @brief Create maximum available capacity vector with elements set to a specific value + inline v_uint8 vx_setall_u8(uchar v) { return VXPREFIX(_setall_u8)(v); } + inline v_int8 vx_setall_s8(schar v) { return VXPREFIX(_setall_s8)(v); } + inline v_uint16 vx_setall_u16(ushort v) { return VXPREFIX(_setall_u16)(v); } + inline v_int16 vx_setall_s16(short v) { return VXPREFIX(_setall_s16)(v); } + inline v_int32 vx_setall_s32(int v) { return VXPREFIX(_setall_s32)(v); } + inline v_uint32 vx_setall_u32(unsigned v) { return VXPREFIX(_setall_u32)(v); } + inline v_float32 vx_setall_f32(float v) { return VXPREFIX(_setall_f32)(v); } + inline v_int64 vx_setall_s64(int64 v) { return VXPREFIX(_setall_s64)(v); } + inline v_uint64 vx_setall_u64(uint64 v) { return VXPREFIX(_setall_u64)(v); } +#if CV_SIMD_64F + inline v_float64 vx_setall_f64(double v) { return VXPREFIX(_setall_f64)(v); } +#endif + //! @} + + //! @name Wide init with zero + //! @{ + //! @brief Create maximum available capacity vector with elements set to zero + inline v_uint8 vx_setzero_u8() { return VXPREFIX(_setzero_u8)(); } + inline v_int8 vx_setzero_s8() { return VXPREFIX(_setzero_s8)(); } + inline v_uint16 vx_setzero_u16() { return VXPREFIX(_setzero_u16)(); } + inline v_int16 vx_setzero_s16() { return VXPREFIX(_setzero_s16)(); } + inline v_int32 vx_setzero_s32() { return VXPREFIX(_setzero_s32)(); } + inline v_uint32 vx_setzero_u32() { return VXPREFIX(_setzero_u32)(); } + inline v_float32 vx_setzero_f32() { return VXPREFIX(_setzero_f32)(); } + inline v_int64 vx_setzero_s64() { return VXPREFIX(_setzero_s64)(); } + inline v_uint64 vx_setzero_u64() { return VXPREFIX(_setzero_u64)(); } +#if CV_SIMD_64F + inline v_float64 vx_setzero_f64() { return VXPREFIX(_setzero_f64)(); } +#endif + //! @} + + //! @name Wide load from memory + //! @{ + //! @brief Load maximum available capacity register contents from memory + inline v_uint8 vx_load(const uchar * ptr) { return VXPREFIX(_load)(ptr); } + inline v_int8 vx_load(const schar * ptr) { return VXPREFIX(_load)(ptr); } + inline v_uint16 vx_load(const ushort * ptr) { return VXPREFIX(_load)(ptr); } + inline v_int16 vx_load(const short * ptr) { return VXPREFIX(_load)(ptr); } + inline v_int32 vx_load(const int * ptr) { return VXPREFIX(_load)(ptr); } + inline v_uint32 vx_load(const unsigned * ptr) { return VXPREFIX(_load)(ptr); } + inline v_float32 vx_load(const float * ptr) { return VXPREFIX(_load)(ptr); } + inline v_int64 vx_load(const int64 * ptr) { return VXPREFIX(_load)(ptr); } + inline v_uint64 vx_load(const uint64 * ptr) { return VXPREFIX(_load)(ptr); } +#if CV_SIMD_64F + inline v_float64 vx_load(const double * ptr) { return VXPREFIX(_load)(ptr); } +#endif + //! @} + + //! @name Wide load from memory(aligned) + //! @{ + //! @brief Load maximum available capacity register contents from memory(aligned) + inline v_uint8 vx_load_aligned(const uchar * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_int8 vx_load_aligned(const schar * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_uint16 vx_load_aligned(const ushort * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_int16 vx_load_aligned(const short * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_int32 vx_load_aligned(const int * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_uint32 vx_load_aligned(const unsigned * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_float32 vx_load_aligned(const float * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_int64 vx_load_aligned(const int64 * ptr) { return VXPREFIX(_load_aligned)(ptr); } + inline v_uint64 vx_load_aligned(const uint64 * ptr) { return VXPREFIX(_load_aligned)(ptr); } +#if CV_SIMD_64F + inline v_float64 vx_load_aligned(const double * ptr) { return VXPREFIX(_load_aligned)(ptr); } +#endif + //! @} + + //! @name Wide load lower half from memory + //! @{ + //! @brief Load lower half of maximum available capacity register from memory + inline v_uint8 vx_load_low(const uchar * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_int8 vx_load_low(const schar * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_uint16 vx_load_low(const ushort * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_int16 vx_load_low(const short * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_int32 vx_load_low(const int * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_uint32 vx_load_low(const unsigned * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_float32 vx_load_low(const float * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_int64 vx_load_low(const int64 * ptr) { return VXPREFIX(_load_low)(ptr); } + inline v_uint64 vx_load_low(const uint64 * ptr) { return VXPREFIX(_load_low)(ptr); } +#if CV_SIMD_64F + inline v_float64 vx_load_low(const double * ptr) { return VXPREFIX(_load_low)(ptr); } +#endif + //! @} + + //! @name Wide load halfs from memory + //! @{ + //! @brief Load maximum available capacity register contents from two memory blocks + inline v_uint8 vx_load_halves(const uchar * ptr0, const uchar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_int8 vx_load_halves(const schar * ptr0, const schar * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_uint16 vx_load_halves(const ushort * ptr0, const ushort * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_int16 vx_load_halves(const short * ptr0, const short * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_int32 vx_load_halves(const int * ptr0, const int * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_uint32 vx_load_halves(const unsigned * ptr0, const unsigned * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_float32 vx_load_halves(const float * ptr0, const float * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_int64 vx_load_halves(const int64 * ptr0, const int64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } + inline v_uint64 vx_load_halves(const uint64 * ptr0, const uint64 * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } +#if CV_SIMD_64F + inline v_float64 vx_load_halves(const double * ptr0, const double * ptr1) { return VXPREFIX(_load_halves)(ptr0, ptr1); } +#endif + //! @} + + //! @name Wide LUT of elements + //! @{ + //! @brief Load maximum available capacity register contents with array elements by provided indexes + inline v_uint8 vx_lut(const uchar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_int8 vx_lut(const schar * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_uint16 vx_lut(const ushort * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_int16 vx_lut(const short* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_int32 vx_lut(const int* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_uint32 vx_lut(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_float32 vx_lut(const float* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_int64 vx_lut(const int64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } + inline v_uint64 vx_lut(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } +#if CV_SIMD_64F + inline v_float64 vx_lut(const double* ptr, const int* idx) { return VXPREFIX(_lut)(ptr, idx); } +#endif + //! @} + + //! @name Wide LUT of element pairs + //! @{ + //! @brief Load maximum available capacity register contents with array element pairs by provided indexes + inline v_uint8 vx_lut_pairs(const uchar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_int8 vx_lut_pairs(const schar * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_uint16 vx_lut_pairs(const ushort * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_int16 vx_lut_pairs(const short* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_int32 vx_lut_pairs(const int* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_uint32 vx_lut_pairs(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_float32 vx_lut_pairs(const float* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_int64 vx_lut_pairs(const int64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } + inline v_uint64 vx_lut_pairs(const uint64 * ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } +#if CV_SIMD_64F + inline v_float64 vx_lut_pairs(const double* ptr, const int* idx) { return VXPREFIX(_lut_pairs)(ptr, idx); } +#endif + //! @} + + //! @name Wide LUT of element quads + //! @{ + //! @brief Load maximum available capacity register contents with array element quads by provided indexes + inline v_uint8 vx_lut_quads(const uchar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_int8 vx_lut_quads(const schar* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_uint16 vx_lut_quads(const ushort* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_int16 vx_lut_quads(const short* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_int32 vx_lut_quads(const int* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_uint32 vx_lut_quads(const unsigned* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + inline v_float32 vx_lut_quads(const float* ptr, const int* idx) { return VXPREFIX(_lut_quads)(ptr, idx); } + //! @} + + //! @name Wide load with double expansion + //! @{ + //! @brief Load maximum available capacity register contents from memory with double expand + inline v_uint16 vx_load_expand(const uchar * ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_int16 vx_load_expand(const schar * ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_uint32 vx_load_expand(const ushort * ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_int32 vx_load_expand(const short* ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_int64 vx_load_expand(const int* ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_uint64 vx_load_expand(const unsigned* ptr) { return VXPREFIX(_load_expand)(ptr); } + inline v_float32 vx_load_expand(const float16_t * ptr) { return VXPREFIX(_load_expand)(ptr); } + //! @} + + //! @name Wide load with quad expansion + //! @{ + //! @brief Load maximum available capacity register contents from memory with quad expand + inline v_uint32 vx_load_expand_q(const uchar * ptr) { return VXPREFIX(_load_expand_q)(ptr); } + inline v_int32 vx_load_expand_q(const schar * ptr) { return VXPREFIX(_load_expand_q)(ptr); } + //! @} + + /** @brief SIMD processing state cleanup call */ + inline void vx_cleanup() { VXPREFIX(_cleanup)(); } + + +//! @cond IGNORED + + // backward compatibility + template static inline + void vx_store(_Tp* dst, const _Tvec& v) { return v_store(dst, v); } + // backward compatibility + template static inline + void vx_store_aligned(_Tp* dst, const _Tvec& v) { return v_store_aligned(dst, v); } + +//! @endcond + + +//! @} + #undef VXPREFIX +} // namespace + +//! @cond IGNORED +#ifndef CV_SIMD_64F +#define CV_SIMD_64F 0 +#endif + +#ifndef CV_SIMD_FP16 +#define CV_SIMD_FP16 0 //!< Defined to 1 on native support of operations with float16x8_t / float16x16_t (SIMD256) types +#endif + +#ifndef CV_SIMD +#define CV_SIMD 0 +#endif + +#include "simd_utils.impl.hpp" + +#ifndef CV_DOXYGEN +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END +#endif + +} // cv:: + +//! @endcond + +#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_avx.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_avx.hpp similarity index 84% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_avx.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_avx.hpp index 58db714..54e8927 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_avx.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_avx.hpp @@ -90,6 +90,50 @@ inline __m256i _v256_packs_epu32(const __m256i& a, const __m256i& b) return _mm256_packus_epi32(am, bm); } +template +inline int _v256_extract_epi8(const __m256i& a) +{ +#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/)) + return _mm256_extract_epi8(a, i); +#else + __m128i b = _mm256_extractf128_si256(a, ((i) >> 4)); + return _mm_extract_epi8(b, i & 15); // SSE4.1 +#endif +} + +template +inline int _v256_extract_epi16(const __m256i& a) +{ +#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/)) + return _mm256_extract_epi16(a, i); +#else + __m128i b = _mm256_extractf128_si256(a, ((i) >> 3)); + return _mm_extract_epi16(b, i & 7); // SSE2 +#endif +} + +template +inline int _v256_extract_epi32(const __m256i& a) +{ +#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/)) + return _mm256_extract_epi32(a, i); +#else + __m128i b = _mm256_extractf128_si256(a, ((i) >> 2)); + return _mm_extract_epi32(b, i & 3); // SSE4.1 +#endif +} + +template +inline int64 _v256_extract_epi64(const __m256i& a) +{ +#if defined(CV__SIMD_HAVE_mm256_extract_epi8) || (CV_AVX2 && (!defined(_MSC_VER) || _MSC_VER >= 1910/*MSVS 2017*/)) + return _mm256_extract_epi64(a, i); +#else + __m128i b = _mm256_extractf128_si256(a, ((i) >> 1)); + return _mm_extract_epi64(b, i & 1); // SSE4.1 +#endif +} + ///////// Types //////////// struct v_uint8x32 @@ -115,7 +159,9 @@ struct v_uint8x32 (char)v22, (char)v23, (char)v24, (char)v25, (char)v26, (char)v27, (char)v28, (char)v29, (char)v30, (char)v31); } - v_uint8x32() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint8x32() {} + uchar get0() const { return (uchar)_v_cvtsi256_si32(val); } }; @@ -139,7 +185,9 @@ struct v_int8x32 v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v30, v31); } - v_int8x32() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int8x32() {} + schar get0() const { return (schar)_v_cvtsi256_si32(val); } }; @@ -159,7 +207,9 @@ struct v_uint16x16 (short)v4, (short)v5, (short)v6, (short)v7, (short)v8, (short)v9, (short)v10, (short)v11, (short)v12, (short)v13, (short)v14, (short)v15); } - v_uint16x16() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint16x16() {} + ushort get0() const { return (ushort)_v_cvtsi256_si32(val); } }; @@ -178,7 +228,9 @@ struct v_int16x16 val = _mm256_setr_epi16(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); } - v_int16x16() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int16x16() {} + short get0() const { return (short)_v_cvtsi256_si32(val); } }; @@ -195,7 +247,9 @@ struct v_uint32x8 val = _mm256_setr_epi32((unsigned)v0, (unsigned)v1, (unsigned)v2, (unsigned)v3, (unsigned)v4, (unsigned)v5, (unsigned)v6, (unsigned)v7); } - v_uint32x8() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint32x8() {} + unsigned get0() const { return (unsigned)_v_cvtsi256_si32(val); } }; @@ -211,7 +265,9 @@ struct v_int32x8 { val = _mm256_setr_epi32(v0, v1, v2, v3, v4, v5, v6, v7); } - v_int32x8() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int32x8() {} + int get0() const { return _v_cvtsi256_si32(val); } }; @@ -227,7 +283,9 @@ struct v_float32x8 { val = _mm256_setr_ps(v0, v1, v2, v3, v4, v5, v6, v7); } - v_float32x8() : val(_mm256_setzero_ps()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_float32x8() {} + float get0() const { return _mm_cvtss_f32(_mm256_castps256_ps128(val)); } }; @@ -240,7 +298,9 @@ struct v_uint64x4 explicit v_uint64x4(__m256i v) : val(v) {} v_uint64x4(uint64 v0, uint64 v1, uint64 v2, uint64 v3) { val = _mm256_setr_epi64x((int64)v0, (int64)v1, (int64)v2, (int64)v3); } - v_uint64x4() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint64x4() {} + uint64 get0() const { #if defined __x86_64__ || defined _M_X64 @@ -262,7 +322,8 @@ struct v_int64x4 explicit v_int64x4(__m256i v) : val(v) {} v_int64x4(int64 v0, int64 v1, int64 v2, int64 v3) { val = _mm256_setr_epi64x(v0, v1, v2, v3); } - v_int64x4() : val(_mm256_setzero_si256()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int64x4() {} int64 get0() const { @@ -285,7 +346,9 @@ struct v_float64x4 explicit v_float64x4(__m256d v) : val(v) {} v_float64x4(double v0, double v1, double v2, double v3) { val = _mm256_setr_pd(v0, v1, v2, v3); } - v_float64x4() : val(_mm256_setzero_pd()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_float64x4() {} + double get0() const { return _mm_cvtsd_f64(_mm256_castpd256_pd128(val)); } }; @@ -431,19 +494,6 @@ inline v_float64x4 v_reinterpret_as_f64(const v_float64x4& a) inline v_float64x4 v_reinterpret_as_f64(const v_float32x8& a) { return v_float64x4(_mm256_castps_pd(a.val)); } -#if CV_FP16 -inline v_float32x8 v256_load_fp16_f32(const short* ptr) -{ - return v_float32x8(_mm256_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr))); -} - -inline void v_store_fp16(short* ptr, const v_float32x8& a) -{ - __m128i fp16_value = _mm256_cvtps_ph(a.val, 0); - _mm_store_si128((__m128i*)ptr, fp16_value); -} -#endif - /* Recombine */ /*#define OPENCV_HAL_IMPL_AVX_COMBINE(_Tpvec, perm) \ inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \ @@ -538,7 +588,7 @@ inline v_int64x4 v256_blend(const v_int64x4& a, const v_int64x4& b) { return v_int64x4(v256_blend(v_uint64x4(a.val), v_uint64x4(b.val)).val); } // shuffle -// todo: emluate 64bit +// todo: emulate 64bit #define OPENCV_HAL_IMPL_AVX_SHUFFLE(_Tpvec, intrin) \ template \ inline _Tpvec v256_shuffle(const _Tpvec& a) \ @@ -1025,9 +1075,85 @@ OPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_right, v_float32x8, _mm256_castsi256_ps OPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_left, v_float64x4, _mm256_castsi256_pd) OPENCV_HAL_IMPL_AVX_ROTATE_CAST(v_rotate_right, v_float64x4, _mm256_castsi256_pd) +/** Reverse **/ +inline v_uint8x32 v_reverse(const v_uint8x32 &a) +{ + static const __m256i perm = _mm256_setr_epi8( + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + __m256i vec = _mm256_shuffle_epi8(a.val, perm); + return v_uint8x32(_mm256_permute2x128_si256(vec, vec, 1)); +} + +inline v_int8x32 v_reverse(const v_int8x32 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x16 v_reverse(const v_uint16x16 &a) +{ + static const __m256i perm = _mm256_setr_epi8( + 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1, + 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1); + __m256i vec = _mm256_shuffle_epi8(a.val, perm); + return v_uint16x16(_mm256_permute2x128_si256(vec, vec, 1)); +} + +inline v_int16x16 v_reverse(const v_int16x16 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x8 v_reverse(const v_uint32x8 &a) +{ + static const __m256i perm = _mm256_setr_epi32(7, 6, 5, 4, 3, 2, 1, 0); + return v_uint32x8(_mm256_permutevar8x32_epi32(a.val, perm)); +} + +inline v_int32x8 v_reverse(const v_int32x8 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x8 v_reverse(const v_float32x8 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x4 v_reverse(const v_uint64x4 &a) +{ + return v_uint64x4(_mm256_permute4x64_epi64(a.val, _MM_SHUFFLE(0, 1, 2, 3))); +} + +inline v_int64x4 v_reverse(const v_int64x4 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x4 v_reverse(const v_float64x4 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + ////////// Reduce and mask ///////// /** Reduce **/ +inline unsigned v_reduce_sum(const v_uint8x32& a) +{ + __m256i half = _mm256_sad_epu8(a.val, _mm256_setzero_si256()); + __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))); +} +inline int v_reduce_sum(const v_int8x32& a) +{ + __m256i half = _mm256_sad_epu8(_mm256_xor_si256(a.val, _mm256_set1_epi8((schar)-128)), _mm256_setzero_si256()); + __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))) - 4096; +} +#define OPENCV_HAL_IMPL_AVX_REDUCE_32(_Tpvec, sctype, func, intrin) \ + inline sctype v_reduce_##func(const _Tpvec& a) \ + { \ + __m128i val = intrin(_v256_extract_low(a.val), _v256_extract_high(a.val)); \ + val = intrin(val, _mm_srli_si128(val,8)); \ + val = intrin(val, _mm_srli_si128(val,4)); \ + val = intrin(val, _mm_srli_si128(val,2)); \ + val = intrin(val, _mm_srli_si128(val,1)); \ + return (sctype)_mm_cvtsi128_si32(val); \ + } + +OPENCV_HAL_IMPL_AVX_REDUCE_32(v_uint8x32, uchar, min, _mm_min_epu8) +OPENCV_HAL_IMPL_AVX_REDUCE_32(v_int8x32, schar, min, _mm_min_epi8) +OPENCV_HAL_IMPL_AVX_REDUCE_32(v_uint8x32, uchar, max, _mm_max_epu8) +OPENCV_HAL_IMPL_AVX_REDUCE_32(v_int8x32, schar, max, _mm_max_epi8) + #define OPENCV_HAL_IMPL_AVX_REDUCE_16(_Tpvec, sctype, func, intrin) \ inline sctype v_reduce_##func(const _Tpvec& a) \ { \ @@ -1068,38 +1194,13 @@ OPENCV_HAL_IMPL_AVX_REDUCE_8(v_int32x8, int, max, _mm_max_epi32) __m128 v1 = _v256_extract_high(a.val); \ v0 = intrin(v0, v1); \ v0 = intrin(v0, _mm_permute_ps(v0, _MM_SHUFFLE(0, 0, 3, 2))); \ - v0 = intrin(v0, _mm_permute_ps(v0, _MM_SHUFFLE(0, 0, 0, 3))); \ + v0 = intrin(v0, _mm_permute_ps(v0, _MM_SHUFFLE(0, 0, 0, 1))); \ return _mm_cvtss_f32(v0); \ } OPENCV_HAL_IMPL_AVX_REDUCE_FLT(min, _mm_min_ps) OPENCV_HAL_IMPL_AVX_REDUCE_FLT(max, _mm_max_ps) -inline ushort v_reduce_sum(const v_uint16x16& a) -{ - __m128i a0 = _v256_extract_low(a.val); - __m128i a1 = _v256_extract_high(a.val); - - __m128i s0 = _mm_adds_epu16(a0, a1); - s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 8)); - s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 4)); - s0 = _mm_adds_epu16(s0, _mm_srli_si128(s0, 2)); - - return (ushort)_mm_cvtsi128_si32(s0); -} - -inline short v_reduce_sum(const v_int16x16& a) -{ - __m256i s0 = _mm256_hadds_epi16(a.val, a.val); - s0 = _mm256_hadds_epi16(s0, s0); - s0 = _mm256_hadds_epi16(s0, s0); - - __m128i s1 = _v256_extract_high(s0); - s1 = _mm_adds_epi16(_v256_extract_low(s0), s1); - - return (short)_mm_cvtsi128_si32(s1); -} - inline int v_reduce_sum(const v_int32x8& a) { __m256i s0 = _mm256_hadd_epi32(a.val, a.val); @@ -1114,6 +1215,11 @@ inline int v_reduce_sum(const v_int32x8& a) inline unsigned v_reduce_sum(const v_uint32x8& a) { return v_reduce_sum(v_reinterpret_as_s32(a)); } +inline int v_reduce_sum(const v_int16x16& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } +inline unsigned v_reduce_sum(const v_uint16x16& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } + inline float v_reduce_sum(const v_float32x8& a) { __m256 s0 = _mm256_hadd_ps(a.val, a.val); @@ -1125,6 +1231,18 @@ inline float v_reduce_sum(const v_float32x8& a) return _mm_cvtss_f32(s1); } +inline uint64 v_reduce_sum(const v_uint64x4& a) +{ + uint64 CV_DECL_ALIGNED(32) idx[2]; + _mm_store_si128((__m128i*)idx, _mm_add_epi64(_v256_extract_low(a.val), _v256_extract_high(a.val))); + return idx[0] + idx[1]; +} +inline int64 v_reduce_sum(const v_int64x4& a) +{ + int64 CV_DECL_ALIGNED(32) idx[2]; + _mm_store_si128((__m128i*)idx, _mm_add_epi64(_v256_extract_low(a.val), _v256_extract_high(a.val))); + return idx[0] + idx[1]; +} inline double v_reduce_sum(const v_float64x4& a) { __m256d s0 = _mm256_hadd_pd(a.val, a.val); @@ -1141,12 +1259,16 @@ inline v_float32x8 v_reduce_sum4(const v_float32x8& a, const v_float32x8& b, inline unsigned v_reduce_sad(const v_uint8x32& a, const v_uint8x32& b) { - return (unsigned)_v_cvtsi256_si32(_mm256_sad_epu8(a.val, b.val)); + __m256i half = _mm256_sad_epu8(a.val, b.val); + __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))); } inline unsigned v_reduce_sad(const v_int8x32& a, const v_int8x32& b) { __m256i half = _mm256_set1_epi8(0x7f); - return (unsigned)_v_cvtsi256_si32(_mm256_sad_epu8(_mm256_add_epi8(a.val, half), _mm256_add_epi8(b.val, half))); + half = _mm256_sad_epu8(_mm256_add_epi8(a.val, half), _mm256_add_epi8(b.val, half)); + __m128i quarter = _mm_add_epi32(_v256_extract_low(half), _v256_extract_high(half)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))); } inline unsigned v_reduce_sad(const v_uint16x16& a, const v_uint16x16& b) { @@ -1175,26 +1297,39 @@ inline float v_reduce_sad(const v_float32x8& a, const v_float32x8& b) } /** Popcount **/ -#define OPENCV_HAL_IMPL_AVX_POPCOUNT(_Tpvec) \ - inline v_uint32x8 v_popcount(const _Tpvec& a) \ - { \ - const v_uint32x8 m1 = v256_setall_u32(0x55555555); \ - const v_uint32x8 m2 = v256_setall_u32(0x33333333); \ - const v_uint32x8 m4 = v256_setall_u32(0x0f0f0f0f); \ - v_uint32x8 p = v_reinterpret_as_u32(a); \ - p = ((p >> 1) & m1) + (p & m1); \ - p = ((p >> 2) & m2) + (p & m2); \ - p = ((p >> 4) & m4) + (p & m4); \ - p.val = _mm256_sad_epu8(p.val, _mm256_setzero_si256()); \ - return p; \ - } - -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_uint8x32) -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_int8x32) -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_uint16x16) -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_int16x16) -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_uint32x8) -OPENCV_HAL_IMPL_AVX_POPCOUNT(v_int32x8) +inline v_uint8x32 v_popcount(const v_uint8x32& a) +{ + __m256i _popcnt_table = _mm256_setr_epi8(0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4); + __m256i _popcnt_mask = _mm256_set1_epi8(0x0F); + return v_uint8x32(_mm256_add_epi8(_mm256_shuffle_epi8(_popcnt_table, _mm256_and_si256( a.val , _popcnt_mask)), + _mm256_shuffle_epi8(_popcnt_table, _mm256_and_si256(_mm256_srli_epi16(a.val, 4), _popcnt_mask)))); +} +inline v_uint16x16 v_popcount(const v_uint16x16& a) +{ + v_uint8x32 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + return v_reinterpret_as_u16(p) & v256_setall_u16(0x00ff); +} +inline v_uint32x8 v_popcount(const v_uint32x8& a) +{ + v_uint8x32 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + p += v_rotate_right<2>(p); + return v_reinterpret_as_u32(p) & v256_setall_u32(0x000000ff); +} +inline v_uint64x4 v_popcount(const v_uint64x4& a) +{ + return v_uint64x4(_mm256_sad_epu8(v_popcount(v_reinterpret_as_u8(a)).val, _mm256_setzero_si256())); +} +inline v_uint8x32 v_popcount(const v_int8x32& a) +{ return v_popcount(v_reinterpret_as_u8(a)); } +inline v_uint16x16 v_popcount(const v_int16x16& a) +{ return v_popcount(v_reinterpret_as_u16(a)); } +inline v_uint32x8 v_popcount(const v_int32x8& a) +{ return v_popcount(v_reinterpret_as_u32(a)); } +inline v_uint64x4 v_popcount(const v_int64x4& a) +{ return v_popcount(v_reinterpret_as_u64(a)); } /** Mask **/ inline int v_signmask(const v_int8x32& a) @@ -1203,62 +1338,54 @@ inline int v_signmask(const v_uint8x32& a) { return v_signmask(v_reinterpret_as_s8(a)); } inline int v_signmask(const v_int16x16& a) -{ - v_int8x32 v = v_int8x32(_mm256_packs_epi16(a.val, a.val)); - return v_signmask(v) & 255; -} +{ return v_signmask(v_pack(a, a)) & 0xFFFF; } inline int v_signmask(const v_uint16x16& a) { return v_signmask(v_reinterpret_as_s16(a)); } -inline int v_signmask(const v_int32x8& a) -{ - __m256i a16 = _mm256_packs_epi32(a.val, a.val); - v_int8x32 v = v_int8x32(_mm256_packs_epi16(a16, a16)); - return v_signmask(v) & 15; -} -inline int v_signmask(const v_uint32x8& a) -{ return v_signmask(v_reinterpret_as_s32(a)); } - inline int v_signmask(const v_float32x8& a) { return _mm256_movemask_ps(a.val); } inline int v_signmask(const v_float64x4& a) { return _mm256_movemask_pd(a.val); } +inline int v_signmask(const v_int32x8& a) +{ return v_signmask(v_reinterpret_as_f32(a)); } +inline int v_signmask(const v_uint32x8& a) +{ return v_signmask(v_reinterpret_as_f32(a)); } + +inline int v_signmask(const v_int64x4& a) +{ return v_signmask(v_reinterpret_as_f64(a)); } +inline int v_signmask(const v_uint64x4& a) +{ return v_signmask(v_reinterpret_as_f64(a)); } + +inline int v_scan_forward(const v_int8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_uint8x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_int16x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_uint16x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_int32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_uint32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_float32x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_int64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_uint64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_float64x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } + /** Checks **/ -#define OPENCV_HAL_IMPL_AVX_CHECK(_Tpvec, and_op, allmask) \ - inline bool v_check_all(const _Tpvec& a) \ - { \ - int mask = v_signmask(v_reinterpret_as_s8(a)); \ - return and_op(mask, allmask) == allmask; \ - } \ - inline bool v_check_any(const _Tpvec& a) \ - { \ - int mask = v_signmask(v_reinterpret_as_s8(a)); \ - return and_op(mask, allmask) != 0; \ - } - -OPENCV_HAL_IMPL_AVX_CHECK(v_uint8x32, OPENCV_HAL_1ST, -1) -OPENCV_HAL_IMPL_AVX_CHECK(v_int8x32, OPENCV_HAL_1ST, -1) -OPENCV_HAL_IMPL_AVX_CHECK(v_uint16x16, OPENCV_HAL_AND, (int)0xaaaa) -OPENCV_HAL_IMPL_AVX_CHECK(v_int16x16, OPENCV_HAL_AND, (int)0xaaaa) -OPENCV_HAL_IMPL_AVX_CHECK(v_uint32x8, OPENCV_HAL_AND, (int)0x8888) -OPENCV_HAL_IMPL_AVX_CHECK(v_int32x8, OPENCV_HAL_AND, (int)0x8888) - -#define OPENCV_HAL_IMPL_AVX_CHECK_FLT(_Tpvec, allmask) \ - inline bool v_check_all(const _Tpvec& a) \ - { \ - int mask = v_signmask(a); \ - return mask == allmask; \ - } \ - inline bool v_check_any(const _Tpvec& a) \ - { \ - int mask = v_signmask(a); \ - return mask != 0; \ - } - -OPENCV_HAL_IMPL_AVX_CHECK_FLT(v_float32x8, 255) -OPENCV_HAL_IMPL_AVX_CHECK_FLT(v_float64x4, 15) +#define OPENCV_HAL_IMPL_AVX_CHECK(_Tpvec, allmask) \ + inline bool v_check_all(const _Tpvec& a) { return v_signmask(a) == allmask; } \ + inline bool v_check_any(const _Tpvec& a) { return v_signmask(a) != 0; } +OPENCV_HAL_IMPL_AVX_CHECK(v_uint8x32, -1) +OPENCV_HAL_IMPL_AVX_CHECK(v_int8x32, -1) +OPENCV_HAL_IMPL_AVX_CHECK(v_uint32x8, 255) +OPENCV_HAL_IMPL_AVX_CHECK(v_int32x8, 255) +OPENCV_HAL_IMPL_AVX_CHECK(v_uint64x4, 15) +OPENCV_HAL_IMPL_AVX_CHECK(v_int64x4, 15) +OPENCV_HAL_IMPL_AVX_CHECK(v_float32x8, 255) +OPENCV_HAL_IMPL_AVX_CHECK(v_float64x4, 15) +#define OPENCV_HAL_IMPL_AVX_CHECK_SHORT(_Tpvec) \ + inline bool v_check_all(const _Tpvec& a) { return (v_signmask(v_reinterpret_as_s8(a)) & 0xaaaaaaaa) == 0xaaaaaaaa; } \ + inline bool v_check_any(const _Tpvec& a) { return (v_signmask(v_reinterpret_as_s8(a)) & 0xaaaaaaaa) != 0; } +OPENCV_HAL_IMPL_AVX_CHECK_SHORT(v_uint16x16) +OPENCV_HAL_IMPL_AVX_CHECK_SHORT(v_int16x16) ////////// Other math ///////// @@ -1400,7 +1527,7 @@ inline v_float32x8 v_cvt_f32(const v_float64x4& a) inline v_float32x8 v_cvt_f32(const v_float64x4& a, const v_float64x4& b) { __m128 af = _mm256_cvtpd_ps(a.val), bf = _mm256_cvtpd_ps(b.val); - return v_float32x8(_mm256_insertf128_ps(_mm256_castps128_ps256(af), bf, 1)); + return v_float32x8(_v256_combine(af, bf)); } inline v_float64x4 v_cvt_f64(const v_int32x8& a) @@ -1415,6 +1542,28 @@ inline v_float64x4 v_cvt_f64(const v_float32x8& a) inline v_float64x4 v_cvt_f64_high(const v_float32x8& a) { return v_float64x4(_mm256_cvtps_pd(_v256_extract_high(a.val))); } +// from (Mysticial and wim) https://stackoverflow.com/q/41144668 +inline v_float64x4 v_cvt_f64(const v_int64x4& v) +{ + // constants encoded as floating-point + __m256i magic_i_lo = _mm256_set1_epi64x(0x4330000000000000); // 2^52 + __m256i magic_i_hi32 = _mm256_set1_epi64x(0x4530000080000000); // 2^84 + 2^63 + __m256i magic_i_all = _mm256_set1_epi64x(0x4530000080100000); // 2^84 + 2^63 + 2^52 + __m256d magic_d_all = _mm256_castsi256_pd(magic_i_all); + + // Blend the 32 lowest significant bits of v with magic_int_lo + __m256i v_lo = _mm256_blend_epi32(magic_i_lo, v.val, 0x55); + // Extract the 32 most significant bits of v + __m256i v_hi = _mm256_srli_epi64(v.val, 32); + // Flip the msb of v_hi and blend with 0x45300000 + v_hi = _mm256_xor_si256(v_hi, magic_i_hi32); + // Compute in double precision + __m256d v_hi_dbl = _mm256_sub_pd(_mm256_castsi256_pd(v_hi), magic_d_all); + // (v_hi - magic_d_all) + v_lo Do not assume associativity of floating point addition + __m256d result = _mm256_add_pd(v_hi_dbl, _mm256_castsi256_pd(v_lo)); + return v_float64x4(result); +} + ////////////// Lookup table access //////////////////// inline v_int8x32 v256_lut(const schar* tab, const int* idx) @@ -1474,7 +1623,7 @@ inline v_int32x8 v256_lut_pairs(const int* tab, const int* idx) } inline v_int32x8 v256_lut_quads(const int* tab, const int* idx) { - return v_int32x8(_mm256_insertf128_si256(_mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(tab + idx[0]))), _mm_loadu_si128((const __m128i*)(tab + idx[1])), 0x1)); + return v_int32x8(_v256_combine(_mm_loadu_si128((const __m128i*)(tab + idx[0])), _mm_loadu_si128((const __m128i*)(tab + idx[1])))); } inline v_uint32x8 v256_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v256_lut((const int *)tab, idx)); } inline v_uint32x8 v256_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v256_lut_pairs((const int *)tab, idx)); } @@ -1490,7 +1639,7 @@ inline v_int64x4 v256_lut(const int64* tab, const int* idx) } inline v_int64x4 v256_lut_pairs(const int64* tab, const int* idx) { - return v_int64x4(_mm256_insertf128_si256(_mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(tab + idx[0]))), _mm_loadu_si128((const __m128i*)(tab + idx[1])), 0x1)); + return v_int64x4(_v256_combine(_mm_loadu_si128((const __m128i*)(tab + idx[0])), _mm_loadu_si128((const __m128i*)(tab + idx[1])))); } inline v_uint64x4 v256_lut(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v256_lut((const int64 *)tab, idx)); } inline v_uint64x4 v256_lut_pairs(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v256_lut_pairs((const int64 *)tab, idx)); } @@ -1506,7 +1655,7 @@ inline v_float64x4 v256_lut(const double* tab, const int* idx) { return v_float64x4(_mm256_i32gather_pd(tab, _mm_loadu_si128((const __m128i*)idx), 8)); } -inline v_float64x4 v256_lut_pairs(const double* tab, const int* idx) { return v_float64x4(_mm256_insertf128_pd(_mm256_castpd128_pd256(_mm_loadu_pd(tab + idx[0])), _mm_loadu_pd(tab + idx[1]), 0x1)); } +inline v_float64x4 v256_lut_pairs(const double* tab, const int* idx) { return v_float64x4(_v256_combine(_mm_loadu_pd(tab + idx[0]), _mm_loadu_pd(tab + idx[1]))); } inline v_int32x8 v_lut(const int* tab, const v_int32x8& idxvec) { @@ -1622,12 +1771,165 @@ inline v_float32x8 v_pack_triplets(const v_float32x8& vec) ////////// Matrix operations ///////// +//////// Dot Product //////// + +// 16 >> 32 inline v_int32x8 v_dotprod(const v_int16x16& a, const v_int16x16& b) { return v_int32x8(_mm256_madd_epi16(a.val, b.val)); } - inline v_int32x8 v_dotprod(const v_int16x16& a, const v_int16x16& b, const v_int32x8& c) { return v_dotprod(a, b) + c; } +// 32 >> 64 +inline v_int64x4 v_dotprod(const v_int32x8& a, const v_int32x8& b) +{ + __m256i even = _mm256_mul_epi32(a.val, b.val); + __m256i odd = _mm256_mul_epi32(_mm256_srli_epi64(a.val, 32), _mm256_srli_epi64(b.val, 32)); + return v_int64x4(_mm256_add_epi64(even, odd)); +} +inline v_int64x4 v_dotprod(const v_int32x8& a, const v_int32x8& b, const v_int64x4& c) +{ return v_dotprod(a, b) + c; } + +// 8 >> 32 +inline v_uint32x8 v_dotprod_expand(const v_uint8x32& a, const v_uint8x32& b) +{ + __m256i even_m = _mm256_set1_epi32(0xFF00FF00); + __m256i even_a = _mm256_blendv_epi8(a.val, _mm256_setzero_si256(), even_m); + __m256i odd_a = _mm256_srli_epi16(a.val, 8); + + __m256i even_b = _mm256_blendv_epi8(b.val, _mm256_setzero_si256(), even_m); + __m256i odd_b = _mm256_srli_epi16(b.val, 8); + + __m256i prod0 = _mm256_madd_epi16(even_a, even_b); + __m256i prod1 = _mm256_madd_epi16(odd_a, odd_b); + return v_uint32x8(_mm256_add_epi32(prod0, prod1)); +} +inline v_uint32x8 v_dotprod_expand(const v_uint8x32& a, const v_uint8x32& b, const v_uint32x8& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int32x8 v_dotprod_expand(const v_int8x32& a, const v_int8x32& b) +{ + __m256i even_a = _mm256_srai_epi16(_mm256_bslli_epi128(a.val, 1), 8); + __m256i odd_a = _mm256_srai_epi16(a.val, 8); + + __m256i even_b = _mm256_srai_epi16(_mm256_bslli_epi128(b.val, 1), 8); + __m256i odd_b = _mm256_srai_epi16(b.val, 8); + + __m256i prod0 = _mm256_madd_epi16(even_a, even_b); + __m256i prod1 = _mm256_madd_epi16(odd_a, odd_b); + return v_int32x8(_mm256_add_epi32(prod0, prod1)); +} +inline v_int32x8 v_dotprod_expand(const v_int8x32& a, const v_int8x32& b, const v_int32x8& c) +{ return v_dotprod_expand(a, b) + c; } + +// 16 >> 64 +inline v_uint64x4 v_dotprod_expand(const v_uint16x16& a, const v_uint16x16& b) +{ + __m256i mullo = _mm256_mullo_epi16(a.val, b.val); + __m256i mulhi = _mm256_mulhi_epu16(a.val, b.val); + __m256i mul0 = _mm256_unpacklo_epi16(mullo, mulhi); + __m256i mul1 = _mm256_unpackhi_epi16(mullo, mulhi); + + __m256i p02 = _mm256_blend_epi32(mul0, _mm256_setzero_si256(), 0xAA); + __m256i p13 = _mm256_srli_epi64(mul0, 32); + __m256i p46 = _mm256_blend_epi32(mul1, _mm256_setzero_si256(), 0xAA); + __m256i p57 = _mm256_srli_epi64(mul1, 32); + + __m256i p15_ = _mm256_add_epi64(p02, p13); + __m256i p9d_ = _mm256_add_epi64(p46, p57); + + return v_uint64x4(_mm256_add_epi64( + _mm256_unpacklo_epi64(p15_, p9d_), + _mm256_unpackhi_epi64(p15_, p9d_) + )); +} +inline v_uint64x4 v_dotprod_expand(const v_uint16x16& a, const v_uint16x16& b, const v_uint64x4& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x4 v_dotprod_expand(const v_int16x16& a, const v_int16x16& b) +{ + __m256i prod = _mm256_madd_epi16(a.val, b.val); + __m256i sign = _mm256_srai_epi32(prod, 31); + + __m256i lo = _mm256_unpacklo_epi32(prod, sign); + __m256i hi = _mm256_unpackhi_epi32(prod, sign); + + return v_int64x4(_mm256_add_epi64( + _mm256_unpacklo_epi64(lo, hi), + _mm256_unpackhi_epi64(lo, hi) + )); +} +inline v_int64x4 v_dotprod_expand(const v_int16x16& a, const v_int16x16& b, const v_int64x4& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x4 v_dotprod_expand(const v_int32x8& a, const v_int32x8& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x4 v_dotprod_expand(const v_int32x8& a, const v_int32x8& b, const v_float64x4& c) +{ return v_dotprod_expand(a, b) + c; } + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x8 v_dotprod_fast(const v_int16x16& a, const v_int16x16& b) +{ return v_dotprod(a, b); } +inline v_int32x8 v_dotprod_fast(const v_int16x16& a, const v_int16x16& b, const v_int32x8& c) +{ return v_dotprod(a, b, c); } + +// 32 >> 64 +inline v_int64x4 v_dotprod_fast(const v_int32x8& a, const v_int32x8& b) +{ return v_dotprod(a, b); } +inline v_int64x4 v_dotprod_fast(const v_int32x8& a, const v_int32x8& b, const v_int64x4& c) +{ return v_dotprod(a, b, c); } + +// 8 >> 32 +inline v_uint32x8 v_dotprod_expand_fast(const v_uint8x32& a, const v_uint8x32& b) +{ return v_dotprod_expand(a, b); } +inline v_uint32x8 v_dotprod_expand_fast(const v_uint8x32& a, const v_uint8x32& b, const v_uint32x8& c) +{ return v_dotprod_expand(a, b, c); } + +inline v_int32x8 v_dotprod_expand_fast(const v_int8x32& a, const v_int8x32& b) +{ return v_dotprod_expand(a, b); } +inline v_int32x8 v_dotprod_expand_fast(const v_int8x32& a, const v_int8x32& b, const v_int32x8& c) +{ return v_dotprod_expand(a, b, c); } + +// 16 >> 64 +inline v_uint64x4 v_dotprod_expand_fast(const v_uint16x16& a, const v_uint16x16& b) +{ + __m256i mullo = _mm256_mullo_epi16(a.val, b.val); + __m256i mulhi = _mm256_mulhi_epu16(a.val, b.val); + __m256i mul0 = _mm256_unpacklo_epi16(mullo, mulhi); + __m256i mul1 = _mm256_unpackhi_epi16(mullo, mulhi); + + __m256i p02 = _mm256_blend_epi32(mul0, _mm256_setzero_si256(), 0xAA); + __m256i p13 = _mm256_srli_epi64(mul0, 32); + __m256i p46 = _mm256_blend_epi32(mul1, _mm256_setzero_si256(), 0xAA); + __m256i p57 = _mm256_srli_epi64(mul1, 32); + + __m256i p15_ = _mm256_add_epi64(p02, p13); + __m256i p9d_ = _mm256_add_epi64(p46, p57); + + return v_uint64x4(_mm256_add_epi64(p15_, p9d_)); +} +inline v_uint64x4 v_dotprod_expand_fast(const v_uint16x16& a, const v_uint16x16& b, const v_uint64x4& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +inline v_int64x4 v_dotprod_expand_fast(const v_int16x16& a, const v_int16x16& b) +{ + __m256i prod = _mm256_madd_epi16(a.val, b.val); + __m256i sign = _mm256_srai_epi32(prod, 31); + __m256i lo = _mm256_unpacklo_epi32(prod, sign); + __m256i hi = _mm256_unpackhi_epi32(prod, sign); + return v_int64x4(_mm256_add_epi64(lo, hi)); +} +inline v_int64x4 v_dotprod_expand_fast(const v_int16x16& a, const v_int16x16& b, const v_int64x4& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 32 >> 64f +inline v_float64x4 v_dotprod_expand_fast(const v_int32x8& a, const v_int32x8& b) +{ return v_dotprod_expand(a, b); } +inline v_float64x4 v_dotprod_expand_fast(const v_int32x8& a, const v_int32x8& b, const v_float64x4& c) +{ return v_dotprod_expand(a, b, c); } + #define OPENCV_HAL_AVX_SPLAT2_PS(a, im) \ v_float32x8(_mm256_permute_ps(a.val, _MM_SHUFFLE(im, im, im, im))) @@ -1956,6 +2258,85 @@ OPENCV_HAL_IMPL_AVX_EXTRACT(v_int64x4) OPENCV_HAL_IMPL_AVX_EXTRACT(v_float32x8) OPENCV_HAL_IMPL_AVX_EXTRACT(v_float64x4) +template +inline uchar v_extract_n(v_uint8x32 a) +{ + return (uchar)_v256_extract_epi8(a.val); +} + +template +inline schar v_extract_n(v_int8x32 a) +{ + return (schar)v_extract_n(v_reinterpret_as_u8(a)); +} + +template +inline ushort v_extract_n(v_uint16x16 a) +{ + return (ushort)_v256_extract_epi16(a.val); +} + +template +inline short v_extract_n(v_int16x16 a) +{ + return (short)v_extract_n(v_reinterpret_as_u16(a)); +} + +template +inline uint v_extract_n(v_uint32x8 a) +{ + return (uint)_v256_extract_epi32(a.val); +} + +template +inline int v_extract_n(v_int32x8 a) +{ + return (int)v_extract_n(v_reinterpret_as_u32(a)); +} + +template +inline uint64 v_extract_n(v_uint64x4 a) +{ + return (uint64)_v256_extract_epi64(a.val); +} + +template +inline int64 v_extract_n(v_int64x4 v) +{ + return (int64)v_extract_n(v_reinterpret_as_u64(v)); +} + +template +inline float v_extract_n(v_float32x8 v) +{ + union { uint iv; float fv; } d; + d.iv = v_extract_n(v_reinterpret_as_u32(v)); + return d.fv; +} + +template +inline double v_extract_n(v_float64x4 v) +{ + union { uint64 iv; double dv; } d; + d.iv = v_extract_n(v_reinterpret_as_u64(v)); + return d.dv; +} + +template +inline v_uint32x8 v_broadcast_element(v_uint32x8 a) +{ + static const __m256i perm = _mm256_set1_epi32((char)i); + return v_uint32x8(_mm256_permutevar8x32_epi32(a.val, perm)); +} + +template +inline v_int32x8 v_broadcast_element(const v_int32x8 &a) +{ return v_reinterpret_as_s32(v_broadcast_element(v_reinterpret_as_u32(a))); } + +template +inline v_float32x8 v_broadcast_element(const v_float32x8 &a) +{ return v_reinterpret_as_f32(v_broadcast_element(v_reinterpret_as_u32(a))); } + ///////////////////// load deinterleave ///////////////////////////// @@ -2740,29 +3121,41 @@ OPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_float32x8, float, f32, v_uint32x8, un OPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_int64x4, int64, s64, v_uint64x4, uint64, u64) OPENCV_HAL_IMPL_AVX_LOADSTORE_INTERLEAVE(v_float64x4, double, f64, v_uint64x4, uint64, u64) +// // FP16 +// + inline v_float32x8 v256_load_expand(const float16_t* ptr) { +#if CV_FP16 return v_float32x8(_mm256_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr))); +#else + float CV_DECL_ALIGNED(32) buf[8]; + for (int i = 0; i < 8; i++) + buf[i] = (float)ptr[i]; + return v256_load_aligned(buf); +#endif } inline void v_pack_store(float16_t* ptr, const v_float32x8& a) { +#if CV_FP16 __m128i ah = _mm256_cvtps_ph(a.val, 0); _mm_storeu_si128((__m128i*)ptr, ah); +#else + float CV_DECL_ALIGNED(32) buf[8]; + v_store_aligned(buf, a); + for (int i = 0; i < 8; i++) + ptr[i] = float16_t(buf[i]); +#endif } +// +// end of FP16 +// + inline void v256_cleanup() { _mm256_zeroall(); } -//! @name Check SIMD256 support -//! @{ -//! @brief Check CPU capability of SIMD operation -static inline bool hasSIMD256() -{ - return (CV_CPU_HAS_SUPPORT_AVX2) ? true : false; -} -//! @} - CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END //! @endcond diff --git a/3rdparty/opencv/include/opencv2/core/hal/intrin_avx512.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_avx512.hpp new file mode 100644 index 0000000..75a3bd4 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_avx512.hpp @@ -0,0 +1,3078 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html + +#ifndef OPENCV_HAL_INTRIN_AVX512_HPP +#define OPENCV_HAL_INTRIN_AVX512_HPP + +#if defined(_MSC_VER) && (_MSC_VER < 1920/*MSVS2019*/) +# pragma warning(disable:4146) // unary minus operator applied to unsigned type, result still unsigned +# pragma warning(disable:4309) // 'argument': truncation of constant value +# pragma warning(disable:4310) // cast truncates constant value +#endif + +#define CVT_ROUND_MODES_IMPLEMENTED 0 + +#define CV_SIMD512 1 +#define CV_SIMD512_64F 1 +#define CV_SIMD512_FP16 0 // no native operations with FP16 type. Only load/store from float32x8 are available (if CV_FP16 == 1) + +#define _v512_set_epu64(a7, a6, a5, a4, a3, a2, a1, a0) _mm512_set_epi64((int64)(a7),(int64)(a6),(int64)(a5),(int64)(a4),(int64)(a3),(int64)(a2),(int64)(a1),(int64)(a0)) +#define _v512_set_epu32(a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0) \ + _mm512_set_epi64(((int64)(a15)<<32)|(int64)(a14), ((int64)(a13)<<32)|(int64)(a12), ((int64)(a11)<<32)|(int64)(a10), ((int64)( a9)<<32)|(int64)( a8), \ + ((int64)( a7)<<32)|(int64)( a6), ((int64)( a5)<<32)|(int64)( a4), ((int64)( a3)<<32)|(int64)( a2), ((int64)( a1)<<32)|(int64)( a0)) +#define _v512_set_epu16(a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \ + a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0) \ + _v512_set_epu32(((unsigned)(a31)<<16)|(unsigned)(a30), ((unsigned)(a29)<<16)|(unsigned)(a28), ((unsigned)(a27)<<16)|(unsigned)(a26), ((unsigned)(a25)<<16)|(unsigned)(a24), \ + ((unsigned)(a23)<<16)|(unsigned)(a22), ((unsigned)(a21)<<16)|(unsigned)(a20), ((unsigned)(a19)<<16)|(unsigned)(a18), ((unsigned)(a17)<<16)|(unsigned)(a16), \ + ((unsigned)(a15)<<16)|(unsigned)(a14), ((unsigned)(a13)<<16)|(unsigned)(a12), ((unsigned)(a11)<<16)|(unsigned)(a10), ((unsigned)( a9)<<16)|(unsigned)( a8), \ + ((unsigned)( a7)<<16)|(unsigned)( a6), ((unsigned)( a5)<<16)|(unsigned)( a4), ((unsigned)( a3)<<16)|(unsigned)( a2), ((unsigned)( a1)<<16)|(unsigned)( a0)) +#define _v512_set_epu8(a63, a62, a61, a60, a59, a58, a57, a56, a55, a54, a53, a52, a51, a50, a49, a48, \ + a47, a46, a45, a44, a43, a42, a41, a40, a39, a38, a37, a36, a35, a34, a33, a32, \ + a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \ + a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0) \ + _v512_set_epu32(((unsigned)(a63)<<24)|((unsigned)(a62)<<16)|((unsigned)(a61)<<8)|(unsigned)(a60),((unsigned)(a59)<<24)|((unsigned)(a58)<<16)|((unsigned)(a57)<<8)|(unsigned)(a56), \ + ((unsigned)(a55)<<24)|((unsigned)(a54)<<16)|((unsigned)(a53)<<8)|(unsigned)(a52),((unsigned)(a51)<<24)|((unsigned)(a50)<<16)|((unsigned)(a49)<<8)|(unsigned)(a48), \ + ((unsigned)(a47)<<24)|((unsigned)(a46)<<16)|((unsigned)(a45)<<8)|(unsigned)(a44),((unsigned)(a43)<<24)|((unsigned)(a42)<<16)|((unsigned)(a41)<<8)|(unsigned)(a40), \ + ((unsigned)(a39)<<24)|((unsigned)(a38)<<16)|((unsigned)(a37)<<8)|(unsigned)(a36),((unsigned)(a35)<<24)|((unsigned)(a34)<<16)|((unsigned)(a33)<<8)|(unsigned)(a32), \ + ((unsigned)(a31)<<24)|((unsigned)(a30)<<16)|((unsigned)(a29)<<8)|(unsigned)(a28),((unsigned)(a27)<<24)|((unsigned)(a26)<<16)|((unsigned)(a25)<<8)|(unsigned)(a24), \ + ((unsigned)(a23)<<24)|((unsigned)(a22)<<16)|((unsigned)(a21)<<8)|(unsigned)(a20),((unsigned)(a19)<<24)|((unsigned)(a18)<<16)|((unsigned)(a17)<<8)|(unsigned)(a16), \ + ((unsigned)(a15)<<24)|((unsigned)(a14)<<16)|((unsigned)(a13)<<8)|(unsigned)(a12),((unsigned)(a11)<<24)|((unsigned)(a10)<<16)|((unsigned)( a9)<<8)|(unsigned)( a8), \ + ((unsigned)( a7)<<24)|((unsigned)( a6)<<16)|((unsigned)( a5)<<8)|(unsigned)( a4),((unsigned)( a3)<<24)|((unsigned)( a2)<<16)|((unsigned)( a1)<<8)|(unsigned)( a0)) +#define _v512_set_epi8(a63, a62, a61, a60, a59, a58, a57, a56, a55, a54, a53, a52, a51, a50, a49, a48, \ + a47, a46, a45, a44, a43, a42, a41, a40, a39, a38, a37, a36, a35, a34, a33, a32, \ + a31, a30, a29, a28, a27, a26, a25, a24, a23, a22, a21, a20, a19, a18, a17, a16, \ + a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3, a2, a1, a0) \ + _v512_set_epu8((uchar)(a63), (uchar)(a62), (uchar)(a61), (uchar)(a60), (uchar)(a59), (uchar)(a58), (uchar)(a57), (uchar)(a56), \ + (uchar)(a55), (uchar)(a54), (uchar)(a53), (uchar)(a52), (uchar)(a51), (uchar)(a50), (uchar)(a49), (uchar)(a48), \ + (uchar)(a47), (uchar)(a46), (uchar)(a45), (uchar)(a44), (uchar)(a43), (uchar)(a42), (uchar)(a41), (uchar)(a40), \ + (uchar)(a39), (uchar)(a38), (uchar)(a37), (uchar)(a36), (uchar)(a35), (uchar)(a34), (uchar)(a33), (uchar)(a32), \ + (uchar)(a31), (uchar)(a30), (uchar)(a29), (uchar)(a28), (uchar)(a27), (uchar)(a26), (uchar)(a25), (uchar)(a24), \ + (uchar)(a23), (uchar)(a22), (uchar)(a21), (uchar)(a20), (uchar)(a19), (uchar)(a18), (uchar)(a17), (uchar)(a16), \ + (uchar)(a15), (uchar)(a14), (uchar)(a13), (uchar)(a12), (uchar)(a11), (uchar)(a10), (uchar)( a9), (uchar)( a8), \ + (uchar)( a7), (uchar)( a6), (uchar)( a5), (uchar)( a4), (uchar)( a3), (uchar)( a2), (uchar)( a1), (uchar)( a0)) + +#ifndef _mm512_cvtpd_pslo +#ifdef _mm512_zextsi256_si512 +#define _mm512_cvtpd_pslo(a) _mm512_zextps256_ps512(_mm512_cvtpd_ps(a)) +#else +//if preferred way to extend with zeros is unavailable +#define _mm512_cvtpd_pslo(a) _mm512_castps256_ps512(_mm512_cvtpd_ps(a)) +#endif +#endif +///////// Utils //////////// + +namespace +{ + +inline __m512i _v512_combine(const __m256i& lo, const __m256i& hi) +{ return _mm512_inserti32x8(_mm512_castsi256_si512(lo), hi, 1); } + +inline __m512 _v512_combine(const __m256& lo, const __m256& hi) +{ return _mm512_insertf32x8(_mm512_castps256_ps512(lo), hi, 1); } + +inline __m512d _v512_combine(const __m256d& lo, const __m256d& hi) +{ return _mm512_insertf64x4(_mm512_castpd256_pd512(lo), hi, 1); } + +inline int _v_cvtsi512_si32(const __m512i& a) +{ return _mm_cvtsi128_si32(_mm512_castsi512_si128(a)); } + +inline __m256i _v512_extract_high(const __m512i& v) +{ return _mm512_extracti32x8_epi32(v, 1); } + +inline __m256 _v512_extract_high(const __m512& v) +{ return _mm512_extractf32x8_ps(v, 1); } + +inline __m256d _v512_extract_high(const __m512d& v) +{ return _mm512_extractf64x4_pd(v, 1); } + +inline __m256i _v512_extract_low(const __m512i& v) +{ return _mm512_castsi512_si256(v); } + +inline __m256 _v512_extract_low(const __m512& v) +{ return _mm512_castps512_ps256(v); } + +inline __m256d _v512_extract_low(const __m512d& v) +{ return _mm512_castpd512_pd256(v); } + +inline __m512i _v512_insert(const __m512i& a, const __m256i& b) +{ return _mm512_inserti32x8(a, b, 0); } + +inline __m512 _v512_insert(const __m512& a, const __m256& b) +{ return _mm512_insertf32x8(a, b, 0); } + +inline __m512d _v512_insert(const __m512d& a, const __m256d& b) +{ return _mm512_insertf64x4(a, b, 0); } + +} + +namespace cv +{ + +//! @cond IGNORED + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN + +///////// Types //////////// + +struct v_uint8x64 +{ + typedef uchar lane_type; + enum { nlanes = 64 }; + __m512i val; + + explicit v_uint8x64(__m512i v) : val(v) {} + v_uint8x64(uchar v0, uchar v1, uchar v2, uchar v3, + uchar v4, uchar v5, uchar v6, uchar v7, + uchar v8, uchar v9, uchar v10, uchar v11, + uchar v12, uchar v13, uchar v14, uchar v15, + uchar v16, uchar v17, uchar v18, uchar v19, + uchar v20, uchar v21, uchar v22, uchar v23, + uchar v24, uchar v25, uchar v26, uchar v27, + uchar v28, uchar v29, uchar v30, uchar v31, + uchar v32, uchar v33, uchar v34, uchar v35, + uchar v36, uchar v37, uchar v38, uchar v39, + uchar v40, uchar v41, uchar v42, uchar v43, + uchar v44, uchar v45, uchar v46, uchar v47, + uchar v48, uchar v49, uchar v50, uchar v51, + uchar v52, uchar v53, uchar v54, uchar v55, + uchar v56, uchar v57, uchar v58, uchar v59, + uchar v60, uchar v61, uchar v62, uchar v63) + { + val = _v512_set_epu8(v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0); + } + v_uint8x64() {} + + static inline v_uint8x64 zero() { return v_uint8x64(_mm512_setzero_si512()); } + + uchar get0() const { return (uchar)_v_cvtsi512_si32(val); } +}; + +struct v_int8x64 +{ + typedef schar lane_type; + enum { nlanes = 64 }; + __m512i val; + + explicit v_int8x64(__m512i v) : val(v) {} + v_int8x64(schar v0, schar v1, schar v2, schar v3, + schar v4, schar v5, schar v6, schar v7, + schar v8, schar v9, schar v10, schar v11, + schar v12, schar v13, schar v14, schar v15, + schar v16, schar v17, schar v18, schar v19, + schar v20, schar v21, schar v22, schar v23, + schar v24, schar v25, schar v26, schar v27, + schar v28, schar v29, schar v30, schar v31, + schar v32, schar v33, schar v34, schar v35, + schar v36, schar v37, schar v38, schar v39, + schar v40, schar v41, schar v42, schar v43, + schar v44, schar v45, schar v46, schar v47, + schar v48, schar v49, schar v50, schar v51, + schar v52, schar v53, schar v54, schar v55, + schar v56, schar v57, schar v58, schar v59, + schar v60, schar v61, schar v62, schar v63) + { + val = _v512_set_epi8(v63, v62, v61, v60, v59, v58, v57, v56, v55, v54, v53, v52, v51, v50, v49, v48, + v47, v46, v45, v44, v43, v42, v41, v40, v39, v38, v37, v36, v35, v34, v33, v32, + v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0); + } + v_int8x64() {} + + static inline v_int8x64 zero() { return v_int8x64(_mm512_setzero_si512()); } + + schar get0() const { return (schar)_v_cvtsi512_si32(val); } +}; + +struct v_uint16x32 +{ + typedef ushort lane_type; + enum { nlanes = 32 }; + __m512i val; + + explicit v_uint16x32(__m512i v) : val(v) {} + v_uint16x32(ushort v0, ushort v1, ushort v2, ushort v3, + ushort v4, ushort v5, ushort v6, ushort v7, + ushort v8, ushort v9, ushort v10, ushort v11, + ushort v12, ushort v13, ushort v14, ushort v15, + ushort v16, ushort v17, ushort v18, ushort v19, + ushort v20, ushort v21, ushort v22, ushort v23, + ushort v24, ushort v25, ushort v26, ushort v27, + ushort v28, ushort v29, ushort v30, ushort v31) + { + val = _v512_set_epu16(v31, v30, v29, v28, v27, v26, v25, v24, v23, v22, v21, v20, v19, v18, v17, v16, + v15, v14, v13, v12, v11, v10, v9, v8, v7, v6, v5, v4, v3, v2, v1, v0); + } + v_uint16x32() {} + + static inline v_uint16x32 zero() { return v_uint16x32(_mm512_setzero_si512()); } + + ushort get0() const { return (ushort)_v_cvtsi512_si32(val); } +}; + +struct v_int16x32 +{ + typedef short lane_type; + enum { nlanes = 32 }; + __m512i val; + + explicit v_int16x32(__m512i v) : val(v) {} + v_int16x32(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7, + short v8, short v9, short v10, short v11, short v12, short v13, short v14, short v15, + short v16, short v17, short v18, short v19, short v20, short v21, short v22, short v23, + short v24, short v25, short v26, short v27, short v28, short v29, short v30, short v31) + { + val = _v512_set_epu16((ushort)v31, (ushort)v30, (ushort)v29, (ushort)v28, (ushort)v27, (ushort)v26, (ushort)v25, (ushort)v24, + (ushort)v23, (ushort)v22, (ushort)v21, (ushort)v20, (ushort)v19, (ushort)v18, (ushort)v17, (ushort)v16, + (ushort)v15, (ushort)v14, (ushort)v13, (ushort)v12, (ushort)v11, (ushort)v10, (ushort)v9 , (ushort)v8, + (ushort)v7 , (ushort)v6 , (ushort)v5 , (ushort)v4 , (ushort)v3 , (ushort)v2 , (ushort)v1 , (ushort)v0); + } + v_int16x32() {} + + static inline v_int16x32 zero() { return v_int16x32(_mm512_setzero_si512()); } + + short get0() const { return (short)_v_cvtsi512_si32(val); } +}; + +struct v_uint32x16 +{ + typedef unsigned lane_type; + enum { nlanes = 16 }; + __m512i val; + + explicit v_uint32x16(__m512i v) : val(v) {} + v_uint32x16(unsigned v0, unsigned v1, unsigned v2, unsigned v3, + unsigned v4, unsigned v5, unsigned v6, unsigned v7, + unsigned v8, unsigned v9, unsigned v10, unsigned v11, + unsigned v12, unsigned v13, unsigned v14, unsigned v15) + { + val = _mm512_setr_epi32((int)v0, (int)v1, (int)v2, (int)v3, (int)v4, (int)v5, (int)v6, (int)v7, + (int)v8, (int)v9, (int)v10, (int)v11, (int)v12, (int)v13, (int)v14, (int)v15); + } + v_uint32x16() {} + + static inline v_uint32x16 zero() { return v_uint32x16(_mm512_setzero_si512()); } + + unsigned get0() const { return (unsigned)_v_cvtsi512_si32(val); } +}; + +struct v_int32x16 +{ + typedef int lane_type; + enum { nlanes = 16 }; + __m512i val; + + explicit v_int32x16(__m512i v) : val(v) {} + v_int32x16(int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7, + int v8, int v9, int v10, int v11, int v12, int v13, int v14, int v15) + { + val = _mm512_setr_epi32(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); + } + v_int32x16() {} + + static inline v_int32x16 zero() { return v_int32x16(_mm512_setzero_si512()); } + + int get0() const { return _v_cvtsi512_si32(val); } +}; + +struct v_float32x16 +{ + typedef float lane_type; + enum { nlanes = 16 }; + __m512 val; + + explicit v_float32x16(__m512 v) : val(v) {} + v_float32x16(float v0, float v1, float v2, float v3, float v4, float v5, float v6, float v7, + float v8, float v9, float v10, float v11, float v12, float v13, float v14, float v15) + { + val = _mm512_setr_ps(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15); + } + v_float32x16() {} + + static inline v_float32x16 zero() { return v_float32x16(_mm512_setzero_ps()); } + + float get0() const { return _mm_cvtss_f32(_mm512_castps512_ps128(val)); } +}; + +struct v_uint64x8 +{ + typedef uint64 lane_type; + enum { nlanes = 8 }; + __m512i val; + + explicit v_uint64x8(__m512i v) : val(v) {} + v_uint64x8(uint64 v0, uint64 v1, uint64 v2, uint64 v3, uint64 v4, uint64 v5, uint64 v6, uint64 v7) + { val = _mm512_setr_epi64((int64)v0, (int64)v1, (int64)v2, (int64)v3, (int64)v4, (int64)v5, (int64)v6, (int64)v7); } + v_uint64x8() {} + + static inline v_uint64x8 zero() { return v_uint64x8(_mm512_setzero_si512()); } + + uint64 get0() const + { + #if defined __x86_64__ || defined _M_X64 + return (uint64)_mm_cvtsi128_si64(_mm512_castsi512_si128(val)); + #else + int a = _mm_cvtsi128_si32(_mm512_castsi512_si128(val)); + int b = _mm_cvtsi128_si32(_mm512_castsi512_si128(_mm512_srli_epi64(val, 32))); + return (unsigned)a | ((uint64)(unsigned)b << 32); + #endif + } +}; + +struct v_int64x8 +{ + typedef int64 lane_type; + enum { nlanes = 8 }; + __m512i val; + + explicit v_int64x8(__m512i v) : val(v) {} + v_int64x8(int64 v0, int64 v1, int64 v2, int64 v3, int64 v4, int64 v5, int64 v6, int64 v7) + { val = _mm512_setr_epi64(v0, v1, v2, v3, v4, v5, v6, v7); } + v_int64x8() {} + + static inline v_int64x8 zero() { return v_int64x8(_mm512_setzero_si512()); } + + int64 get0() const + { + #if defined __x86_64__ || defined _M_X64 + return (int64)_mm_cvtsi128_si64(_mm512_castsi512_si128(val)); + #else + int a = _mm_cvtsi128_si32(_mm512_castsi512_si128(val)); + int b = _mm_cvtsi128_si32(_mm512_castsi512_si128(_mm512_srli_epi64(val, 32))); + return (int64)((unsigned)a | ((uint64)(unsigned)b << 32)); + #endif + } +}; + +struct v_float64x8 +{ + typedef double lane_type; + enum { nlanes = 8 }; + __m512d val; + + explicit v_float64x8(__m512d v) : val(v) {} + v_float64x8(double v0, double v1, double v2, double v3, double v4, double v5, double v6, double v7) + { val = _mm512_setr_pd(v0, v1, v2, v3, v4, v5, v6, v7); } + v_float64x8() {} + + static inline v_float64x8 zero() { return v_float64x8(_mm512_setzero_pd()); } + + double get0() const { return _mm_cvtsd_f64(_mm512_castpd512_pd128(val)); } +}; + +//////////////// Load and store operations /////////////// + +#define OPENCV_HAL_IMPL_AVX512_LOADSTORE(_Tpvec, _Tp) \ + inline _Tpvec v512_load(const _Tp* ptr) \ + { return _Tpvec(_mm512_loadu_si512((const __m512i*)ptr)); } \ + inline _Tpvec v512_load_aligned(const _Tp* ptr) \ + { return _Tpvec(_mm512_load_si512((const __m512i*)ptr)); } \ + inline _Tpvec v512_load_low(const _Tp* ptr) \ + { \ + __m256i v256 = _mm256_loadu_si256((const __m256i*)ptr); \ + return _Tpvec(_mm512_castsi256_si512(v256)); \ + } \ + inline _Tpvec v512_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ + { \ + __m256i vlo = _mm256_loadu_si256((const __m256i*)ptr0); \ + __m256i vhi = _mm256_loadu_si256((const __m256i*)ptr1); \ + return _Tpvec(_v512_combine(vlo, vhi)); \ + } \ + inline void v_store(_Tp* ptr, const _Tpvec& a) \ + { _mm512_storeu_si512((__m512i*)ptr, a.val); } \ + inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ + { _mm512_store_si512((__m512i*)ptr, a.val); } \ + inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \ + { _mm512_stream_si512((__m512i*)ptr, a.val); } \ + inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \ + { \ + if( mode == hal::STORE_UNALIGNED ) \ + _mm512_storeu_si512((__m512i*)ptr, a.val); \ + else if( mode == hal::STORE_ALIGNED_NOCACHE ) \ + _mm512_stream_si512((__m512i*)ptr, a.val); \ + else \ + _mm512_store_si512((__m512i*)ptr, a.val); \ + } \ + inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ + { _mm256_storeu_si256((__m256i*)ptr, _v512_extract_low(a.val)); } \ + inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ + { _mm256_storeu_si256((__m256i*)ptr, _v512_extract_high(a.val)); } + +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint8x64, uchar) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int8x64, schar) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint16x32, ushort) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int16x32, short) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint32x16, unsigned) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int32x16, int) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_uint64x8, uint64) +OPENCV_HAL_IMPL_AVX512_LOADSTORE(v_int64x8, int64) + +#define OPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(_Tpvec, _Tp, suffix, halfreg) \ + inline _Tpvec v512_load(const _Tp* ptr) \ + { return _Tpvec(_mm512_loadu_##suffix(ptr)); } \ + inline _Tpvec v512_load_aligned(const _Tp* ptr) \ + { return _Tpvec(_mm512_load_##suffix(ptr)); } \ + inline _Tpvec v512_load_low(const _Tp* ptr) \ + { \ + return _Tpvec(_mm512_cast##suffix##256_##suffix##512 \ + (_mm256_loadu_##suffix(ptr))); \ + } \ + inline _Tpvec v512_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ + { \ + halfreg vlo = _mm256_loadu_##suffix(ptr0); \ + halfreg vhi = _mm256_loadu_##suffix(ptr1); \ + return _Tpvec(_v512_combine(vlo, vhi)); \ + } \ + inline void v_store(_Tp* ptr, const _Tpvec& a) \ + { _mm512_storeu_##suffix(ptr, a.val); } \ + inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ + { _mm512_store_##suffix(ptr, a.val); } \ + inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \ + { _mm512_stream_##suffix(ptr, a.val); } \ + inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode mode) \ + { \ + if( mode == hal::STORE_UNALIGNED ) \ + _mm512_storeu_##suffix(ptr, a.val); \ + else if( mode == hal::STORE_ALIGNED_NOCACHE ) \ + _mm512_stream_##suffix(ptr, a.val); \ + else \ + _mm512_store_##suffix(ptr, a.val); \ + } \ + inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ + { _mm256_storeu_##suffix(ptr, _v512_extract_low(a.val)); } \ + inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ + { _mm256_storeu_##suffix(ptr, _v512_extract_high(a.val)); } + +OPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(v_float32x16, float, ps, __m256) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_FLT(v_float64x8, double, pd, __m256d) + +#define OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, _Tpvecf, suffix, cast) \ + inline _Tpvec v_reinterpret_as_##suffix(const _Tpvecf& a) \ + { return _Tpvec(cast(a.val)); } + +#define OPENCV_HAL_IMPL_AVX512_INIT(_Tpvec, _Tp, suffix, ssuffix, ctype_s) \ + inline _Tpvec v512_setzero_##suffix() \ + { return _Tpvec(_mm512_setzero_si512()); } \ + inline _Tpvec v512_setall_##suffix(_Tp v) \ + { return _Tpvec(_mm512_set1_##ssuffix((ctype_s)v)); } \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint8x64, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int8x64, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint16x32, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int16x32, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint32x16, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int32x16, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint64x8, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int64x8, suffix, OPENCV_HAL_NOP) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_float32x16, suffix, _mm512_castps_si512) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_float64x8, suffix, _mm512_castpd_si512) + +OPENCV_HAL_IMPL_AVX512_INIT(v_uint8x64, uchar, u8, epi8, char) +OPENCV_HAL_IMPL_AVX512_INIT(v_int8x64, schar, s8, epi8, char) +OPENCV_HAL_IMPL_AVX512_INIT(v_uint16x32, ushort, u16, epi16, short) +OPENCV_HAL_IMPL_AVX512_INIT(v_int16x32, short, s16, epi16, short) +OPENCV_HAL_IMPL_AVX512_INIT(v_uint32x16, unsigned, u32, epi32, int) +OPENCV_HAL_IMPL_AVX512_INIT(v_int32x16, int, s32, epi32, int) +OPENCV_HAL_IMPL_AVX512_INIT(v_uint64x8, uint64, u64, epi64, int64) +OPENCV_HAL_IMPL_AVX512_INIT(v_int64x8, int64, s64, epi64, int64) + +#define OPENCV_HAL_IMPL_AVX512_INIT_FLT(_Tpvec, _Tp, suffix, zsuffix, cast) \ + inline _Tpvec v512_setzero_##suffix() \ + { return _Tpvec(_mm512_setzero_##zsuffix()); } \ + inline _Tpvec v512_setall_##suffix(_Tp v) \ + { return _Tpvec(_mm512_set1_##zsuffix(v)); } \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint8x64, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int8x64, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint16x32, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int16x32, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint32x16, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int32x16, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_uint64x8, suffix, cast) \ + OPENCV_HAL_IMPL_AVX512_CAST(_Tpvec, v_int64x8, suffix, cast) + +OPENCV_HAL_IMPL_AVX512_INIT_FLT(v_float32x16, float, f32, ps, _mm512_castsi512_ps) +OPENCV_HAL_IMPL_AVX512_INIT_FLT(v_float64x8, double, f64, pd, _mm512_castsi512_pd) + +inline v_float32x16 v_reinterpret_as_f32(const v_float32x16& a) +{ return a; } +inline v_float32x16 v_reinterpret_as_f32(const v_float64x8& a) +{ return v_float32x16(_mm512_castpd_ps(a.val)); } + +inline v_float64x8 v_reinterpret_as_f64(const v_float64x8& a) +{ return a; } +inline v_float64x8 v_reinterpret_as_f64(const v_float32x16& a) +{ return v_float64x8(_mm512_castps_pd(a.val)); } + +// FP16 +inline v_float32x16 v512_load_expand(const float16_t* ptr) +{ + return v_float32x16(_mm512_cvtph_ps(_mm256_loadu_si256((const __m256i*)ptr))); +} + +inline void v_pack_store(float16_t* ptr, const v_float32x16& a) +{ + __m256i ah = _mm512_cvtps_ph(a.val, 0); + _mm256_storeu_si256((__m256i*)ptr, ah); +} + +/* Recombine & ZIP */ +inline void v_zip(const v_int8x64& a, const v_int8x64& b, v_int8x64& ab0, v_int8x64& ab1) +{ +#if CV_AVX_512VBMI + __m512i mask0 = _v512_set_epu8( 95, 31, 94, 30, 93, 29, 92, 28, 91, 27, 90, 26, 89, 25, 88, 24, + 87, 23, 86, 22, 85, 21, 84, 20, 83, 19, 82, 18, 81, 17, 80, 16, + 79, 15, 78, 14, 77, 13, 76, 12, 75, 11, 74, 10, 73, 9, 72, 8, + 71, 7, 70, 6, 69, 5, 68, 4, 67, 3, 66, 2, 65, 1, 64, 0); + ab0 = v_int8x64(_mm512_permutex2var_epi8(a.val, mask0, b.val)); + __m512i mask1 = _v512_set_epu8(127, 63, 126, 62, 125, 61, 124, 60, 123, 59, 122, 58, 121, 57, 120, 56, + 119, 55, 118, 54, 117, 53, 116, 52, 115, 51, 114, 50, 113, 49, 112, 48, + 111, 47, 110, 46, 109, 45, 108, 44, 107, 43, 106, 42, 105, 41, 104, 40, + 103, 39, 102, 38, 101, 37, 100, 36, 99, 35, 98, 34, 97, 33, 96, 32); + ab1 = v_int8x64(_mm512_permutex2var_epi8(a.val, mask1, b.val)); +#else + __m512i low = _mm512_unpacklo_epi8(a.val, b.val); + __m512i high = _mm512_unpackhi_epi8(a.val, b.val); + ab0 = v_int8x64(_mm512_permutex2var_epi64(low, _v512_set_epu64(11, 10, 3, 2, 9, 8, 1, 0), high)); + ab1 = v_int8x64(_mm512_permutex2var_epi64(low, _v512_set_epu64(15, 14, 7, 6, 13, 12, 5, 4), high)); +#endif +} +inline void v_zip(const v_int16x32& a, const v_int16x32& b, v_int16x32& ab0, v_int16x32& ab1) +{ + __m512i mask0 = _v512_set_epu16(47, 15, 46, 14, 45, 13, 44, 12, 43, 11, 42, 10, 41, 9, 40, 8, + 39, 7, 38, 6, 37, 5, 36, 4, 35, 3, 34, 2, 33, 1, 32, 0); + ab0 = v_int16x32(_mm512_permutex2var_epi16(a.val, mask0, b.val)); + __m512i mask1 = _v512_set_epu16(63, 31, 62, 30, 61, 29, 60, 28, 59, 27, 58, 26, 57, 25, 56, 24, + 55, 23, 54, 22, 53, 21, 52, 20, 51, 19, 50, 18, 49, 17, 48, 16); + ab1 = v_int16x32(_mm512_permutex2var_epi16(a.val, mask1, b.val)); +} +inline void v_zip(const v_int32x16& a, const v_int32x16& b, v_int32x16& ab0, v_int32x16& ab1) +{ + __m512i mask0 = _v512_set_epu32(23, 7, 22, 6, 21, 5, 20, 4, 19, 3, 18, 2, 17, 1, 16, 0); + ab0 = v_int32x16(_mm512_permutex2var_epi32(a.val, mask0, b.val)); + __m512i mask1 = _v512_set_epu32(31, 15, 30, 14, 29, 13, 28, 12, 27, 11, 26, 10, 25, 9, 24, 8); + ab1 = v_int32x16(_mm512_permutex2var_epi32(a.val, mask1, b.val)); +} +inline void v_zip(const v_int64x8& a, const v_int64x8& b, v_int64x8& ab0, v_int64x8& ab1) +{ + __m512i mask0 = _v512_set_epu64(11, 3, 10, 2, 9, 1, 8, 0); + ab0 = v_int64x8(_mm512_permutex2var_epi64(a.val, mask0, b.val)); + __m512i mask1 = _v512_set_epu64(15, 7, 14, 6, 13, 5, 12, 4); + ab1 = v_int64x8(_mm512_permutex2var_epi64(a.val, mask1, b.val)); +} + +inline void v_zip(const v_uint8x64& a, const v_uint8x64& b, v_uint8x64& ab0, v_uint8x64& ab1) +{ + v_int8x64 i0, i1; + v_zip(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b), i0, i1); + ab0 = v_reinterpret_as_u8(i0); + ab1 = v_reinterpret_as_u8(i1); +} +inline void v_zip(const v_uint16x32& a, const v_uint16x32& b, v_uint16x32& ab0, v_uint16x32& ab1) +{ + v_int16x32 i0, i1; + v_zip(v_reinterpret_as_s16(a), v_reinterpret_as_s16(b), i0, i1); + ab0 = v_reinterpret_as_u16(i0); + ab1 = v_reinterpret_as_u16(i1); +} +inline void v_zip(const v_uint32x16& a, const v_uint32x16& b, v_uint32x16& ab0, v_uint32x16& ab1) +{ + v_int32x16 i0, i1; + v_zip(v_reinterpret_as_s32(a), v_reinterpret_as_s32(b), i0, i1); + ab0 = v_reinterpret_as_u32(i0); + ab1 = v_reinterpret_as_u32(i1); +} +inline void v_zip(const v_uint64x8& a, const v_uint64x8& b, v_uint64x8& ab0, v_uint64x8& ab1) +{ + v_int64x8 i0, i1; + v_zip(v_reinterpret_as_s64(a), v_reinterpret_as_s64(b), i0, i1); + ab0 = v_reinterpret_as_u64(i0); + ab1 = v_reinterpret_as_u64(i1); +} +inline void v_zip(const v_float32x16& a, const v_float32x16& b, v_float32x16& ab0, v_float32x16& ab1) +{ + v_int32x16 i0, i1; + v_zip(v_reinterpret_as_s32(a), v_reinterpret_as_s32(b), i0, i1); + ab0 = v_reinterpret_as_f32(i0); + ab1 = v_reinterpret_as_f32(i1); +} +inline void v_zip(const v_float64x8& a, const v_float64x8& b, v_float64x8& ab0, v_float64x8& ab1) +{ + v_int64x8 i0, i1; + v_zip(v_reinterpret_as_s64(a), v_reinterpret_as_s64(b), i0, i1); + ab0 = v_reinterpret_as_f64(i0); + ab1 = v_reinterpret_as_f64(i1); +} + +#define OPENCV_HAL_IMPL_AVX512_COMBINE(_Tpvec, suffix) \ + inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(_v512_combine(_v512_extract_low(a.val), _v512_extract_low(b.val))); } \ + inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(_v512_insert(b.val, _v512_extract_high(a.val))); } \ + inline void v_recombine(const _Tpvec& a, const _Tpvec& b, \ + _Tpvec& c, _Tpvec& d) \ + { \ + c.val = _v512_combine(_v512_extract_low(a.val),_v512_extract_low(b.val)); \ + d.val = _v512_insert(b.val,_v512_extract_high(a.val)); \ + } + + +OPENCV_HAL_IMPL_AVX512_COMBINE(v_uint8x64, epi8) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_int8x64, epi8) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_uint16x32, epi16) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_int16x32, epi16) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_uint32x16, epi32) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_int32x16, epi32) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_uint64x8, epi64) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_int64x8, epi64) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_float32x16, ps) +OPENCV_HAL_IMPL_AVX512_COMBINE(v_float64x8, pd) + +////////// Arithmetic, bitwise and comparison operations ///////// + +/* Element-wise binary and unary operations */ + +/** Non-saturating arithmetics **/ +#define OPENCV_HAL_IMPL_AVX512_BIN_FUNC(func, _Tpvec, intrin) \ + inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(intrin(a.val, b.val)); } + +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_uint8x64, _mm512_add_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_int8x64, _mm512_add_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_uint16x32, _mm512_add_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_add_wrap, v_int16x32, _mm512_add_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_uint8x64, _mm512_sub_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_int8x64, _mm512_sub_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_uint16x32, _mm512_sub_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_sub_wrap, v_int16x32, _mm512_sub_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_mul_wrap, v_uint16x32, _mm512_mullo_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_mul_wrap, v_int16x32, _mm512_mullo_epi16) + +inline v_uint8x64 v_mul_wrap(const v_uint8x64& a, const v_uint8x64& b) +{ + __m512i ad = _mm512_srai_epi16(a.val, 8); + __m512i bd = _mm512_srai_epi16(b.val, 8); + __m512i p0 = _mm512_mullo_epi16(a.val, b.val); // even + __m512i p1 = _mm512_slli_epi16(_mm512_mullo_epi16(ad, bd), 8); // odd + return v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, p0, p1)); +} +inline v_int8x64 v_mul_wrap(const v_int8x64& a, const v_int8x64& b) +{ + return v_reinterpret_as_s8(v_mul_wrap(v_reinterpret_as_u8(a), v_reinterpret_as_u8(b))); +} + +#define OPENCV_HAL_IMPL_AVX512_BIN_OP(bin_op, _Tpvec, intrin) \ + inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(intrin(a.val, b.val)); } \ + inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \ + { a.val = intrin(a.val, b.val); return a; } + +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint32x16, _mm512_add_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint32x16, _mm512_sub_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int32x16, _mm512_add_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int32x16, _mm512_sub_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint64x8, _mm512_add_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint64x8, _mm512_sub_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int64x8, _mm512_add_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int64x8, _mm512_sub_epi64) + +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_uint32x16, _mm512_mullo_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_int32x16, _mm512_mullo_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_uint64x8, _mm512_mullo_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_int64x8, _mm512_mullo_epi64) + +/** Saturating arithmetics **/ +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint8x64, _mm512_adds_epu8) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint8x64, _mm512_subs_epu8) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int8x64, _mm512_adds_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int8x64, _mm512_subs_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_uint16x32, _mm512_adds_epu16) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_uint16x32, _mm512_subs_epu16) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_int16x32, _mm512_adds_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_int16x32, _mm512_subs_epi16) + +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_float32x16, _mm512_add_ps) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_float32x16, _mm512_sub_ps) +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_float32x16, _mm512_mul_ps) +OPENCV_HAL_IMPL_AVX512_BIN_OP(/, v_float32x16, _mm512_div_ps) +OPENCV_HAL_IMPL_AVX512_BIN_OP(+, v_float64x8, _mm512_add_pd) +OPENCV_HAL_IMPL_AVX512_BIN_OP(-, v_float64x8, _mm512_sub_pd) +OPENCV_HAL_IMPL_AVX512_BIN_OP(*, v_float64x8, _mm512_mul_pd) +OPENCV_HAL_IMPL_AVX512_BIN_OP(/, v_float64x8, _mm512_div_pd) + +// saturating multiply +inline v_uint8x64 operator * (const v_uint8x64& a, const v_uint8x64& b) +{ + v_uint16x32 c, d; + v_mul_expand(a, b, c, d); + return v_pack(c, d); +} +inline v_int8x64 operator * (const v_int8x64& a, const v_int8x64& b) +{ + v_int16x32 c, d; + v_mul_expand(a, b, c, d); + return v_pack(c, d); +} +inline v_uint16x32 operator * (const v_uint16x32& a, const v_uint16x32& b) +{ + __m512i pl = _mm512_mullo_epi16(a.val, b.val); + __m512i ph = _mm512_mulhi_epu16(a.val, b.val); + __m512i p0 = _mm512_unpacklo_epi16(pl, ph); + __m512i p1 = _mm512_unpackhi_epi16(pl, ph); + + const __m512i m = _mm512_set1_epi32(65535); + return v_uint16x32(_mm512_packus_epi32(_mm512_min_epu32(p0, m), _mm512_min_epu32(p1, m))); +} +inline v_int16x32 operator * (const v_int16x32& a, const v_int16x32& b) +{ + __m512i pl = _mm512_mullo_epi16(a.val, b.val); + __m512i ph = _mm512_mulhi_epi16(a.val, b.val); + __m512i p0 = _mm512_unpacklo_epi16(pl, ph); + __m512i p1 = _mm512_unpackhi_epi16(pl, ph); + return v_int16x32(_mm512_packs_epi32(p0, p1)); +} + +inline v_uint8x64& operator *= (v_uint8x64& a, const v_uint8x64& b) +{ a = a * b; return a; } +inline v_int8x64& operator *= (v_int8x64& a, const v_int8x64& b) +{ a = a * b; return a; } +inline v_uint16x32& operator *= (v_uint16x32& a, const v_uint16x32& b) +{ a = a * b; return a; } +inline v_int16x32& operator *= (v_int16x32& a, const v_int16x32& b) +{ a = a * b; return a; } + +inline v_int16x32 v_mul_hi(const v_int16x32& a, const v_int16x32& b) { return v_int16x32(_mm512_mulhi_epi16(a.val, b.val)); } +inline v_uint16x32 v_mul_hi(const v_uint16x32& a, const v_uint16x32& b) { return v_uint16x32(_mm512_mulhi_epu16(a.val, b.val)); } + +// Multiply and expand +inline void v_mul_expand(const v_uint8x64& a, const v_uint8x64& b, + v_uint16x32& c, v_uint16x32& d) +{ + v_uint16x32 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c = v_mul_wrap(a0, b0); + d = v_mul_wrap(a1, b1); +} + +inline void v_mul_expand(const v_int8x64& a, const v_int8x64& b, + v_int16x32& c, v_int16x32& d) +{ + v_int16x32 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c = v_mul_wrap(a0, b0); + d = v_mul_wrap(a1, b1); +} + +inline void v_mul_expand(const v_int16x32& a, const v_int16x32& b, + v_int32x16& c, v_int32x16& d) +{ + v_int16x32 v0, v1; + v_zip(v_mul_wrap(a, b), v_mul_hi(a, b), v0, v1); + + c = v_reinterpret_as_s32(v0); + d = v_reinterpret_as_s32(v1); +} + +inline void v_mul_expand(const v_uint16x32& a, const v_uint16x32& b, + v_uint32x16& c, v_uint32x16& d) +{ + v_uint16x32 v0, v1; + v_zip(v_mul_wrap(a, b), v_mul_hi(a, b), v0, v1); + + c = v_reinterpret_as_u32(v0); + d = v_reinterpret_as_u32(v1); +} + +inline void v_mul_expand(const v_uint32x16& a, const v_uint32x16& b, + v_uint64x8& c, v_uint64x8& d) +{ + v_zip(v_uint64x8(_mm512_mul_epu32(a.val, b.val)), + v_uint64x8(_mm512_mul_epu32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32))), c, d); +} + +inline void v_mul_expand(const v_int32x16& a, const v_int32x16& b, + v_int64x8& c, v_int64x8& d) +{ + v_zip(v_int64x8(_mm512_mul_epi32(a.val, b.val)), + v_int64x8(_mm512_mul_epi32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32))), c, d); +} + +/** Bitwise shifts **/ +#define OPENCV_HAL_IMPL_AVX512_SHIFT_OP(_Tpuvec, _Tpsvec, suffix) \ + inline _Tpuvec operator << (const _Tpuvec& a, int imm) \ + { return _Tpuvec(_mm512_slli_##suffix(a.val, imm)); } \ + inline _Tpsvec operator << (const _Tpsvec& a, int imm) \ + { return _Tpsvec(_mm512_slli_##suffix(a.val, imm)); } \ + inline _Tpuvec operator >> (const _Tpuvec& a, int imm) \ + { return _Tpuvec(_mm512_srli_##suffix(a.val, imm)); } \ + inline _Tpsvec operator >> (const _Tpsvec& a, int imm) \ + { return _Tpsvec(_mm512_srai_##suffix(a.val, imm)); } \ + template \ + inline _Tpuvec v_shl(const _Tpuvec& a) \ + { return _Tpuvec(_mm512_slli_##suffix(a.val, imm)); } \ + template \ + inline _Tpsvec v_shl(const _Tpsvec& a) \ + { return _Tpsvec(_mm512_slli_##suffix(a.val, imm)); } \ + template \ + inline _Tpuvec v_shr(const _Tpuvec& a) \ + { return _Tpuvec(_mm512_srli_##suffix(a.val, imm)); } \ + template \ + inline _Tpsvec v_shr(const _Tpsvec& a) \ + { return _Tpsvec(_mm512_srai_##suffix(a.val, imm)); } + +OPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint16x32, v_int16x32, epi16) +OPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint32x16, v_int32x16, epi32) +OPENCV_HAL_IMPL_AVX512_SHIFT_OP(v_uint64x8, v_int64x8, epi64) + + +/** Bitwise logic **/ +#define OPENCV_HAL_IMPL_AVX512_LOGIC_OP(_Tpvec, suffix, not_const) \ + OPENCV_HAL_IMPL_AVX512_BIN_OP(&, _Tpvec, _mm512_and_##suffix) \ + OPENCV_HAL_IMPL_AVX512_BIN_OP(|, _Tpvec, _mm512_or_##suffix) \ + OPENCV_HAL_IMPL_AVX512_BIN_OP(^, _Tpvec, _mm512_xor_##suffix) \ + inline _Tpvec operator ~ (const _Tpvec& a) \ + { return _Tpvec(_mm512_xor_##suffix(a.val, not_const)); } + +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint8x64, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int8x64, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint16x32, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int16x32, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint32x16, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int32x16, si512, _mm512_set1_epi32(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_uint64x8, si512, _mm512_set1_epi64(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_int64x8, si512, _mm512_set1_epi64(-1)) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_float32x16, ps, _mm512_castsi512_ps(_mm512_set1_epi32(-1))) +OPENCV_HAL_IMPL_AVX512_LOGIC_OP(v_float64x8, pd, _mm512_castsi512_pd(_mm512_set1_epi32(-1))) + +/** Select **/ +#define OPENCV_HAL_IMPL_AVX512_SELECT(_Tpvec, suffix, zsuf) \ + inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(_mm512_mask_blend_##suffix(_mm512_cmp_##suffix##_mask(mask.val, _mm512_setzero_##zsuf(), _MM_CMPINT_EQ), a.val, b.val)); } + +OPENCV_HAL_IMPL_AVX512_SELECT(v_uint8x64, epi8, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_int8x64, epi8, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_uint16x32, epi16, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_int16x32, epi16, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_uint32x16, epi32, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_int32x16, epi32, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_uint64x8, epi64, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_int64x8, epi64, si512) +OPENCV_HAL_IMPL_AVX512_SELECT(v_float32x16, ps, ps) +OPENCV_HAL_IMPL_AVX512_SELECT(v_float64x8, pd, pd) + +/** Comparison **/ +#define OPENCV_HAL_IMPL_AVX512_CMP_INT(bin_op, imm8, _Tpvec, sufcmp, sufset, tval) \ + inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(_mm512_maskz_set1_##sufset(_mm512_cmp_##sufcmp##_mask(a.val, b.val, imm8), tval)); } + +#define OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(_Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(==, _MM_CMPINT_EQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(!=, _MM_CMPINT_NE, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(<, _MM_CMPINT_LT, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(>, _MM_CMPINT_NLE, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(<=, _MM_CMPINT_LE, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_INT(>=, _MM_CMPINT_NLT, _Tpvec, sufcmp, sufset, tval) + +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint8x64, epu8, epi8, (char)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int8x64, epi8, epi8, (char)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint16x32, epu16, epi16, (short)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int16x32, epi16, epi16, (short)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint32x16, epu32, epi32, (int)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int32x16, epi32, epi32, (int)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_uint64x8, epu64, epi64, (int64)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_INT(v_int64x8, epi64, epi64, (int64)-1) + +#define OPENCV_HAL_IMPL_AVX512_CMP_FLT(bin_op, imm8, _Tpvec, sufcmp, sufset, tval) \ + inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ + { return _Tpvec(_mm512_castsi512_##sufcmp(_mm512_maskz_set1_##sufset(_mm512_cmp_##sufcmp##_mask(a.val, b.val, imm8), tval))); } + +#define OPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(_Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(==, _CMP_EQ_OQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(!=, _CMP_NEQ_OQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(<, _CMP_LT_OQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(>, _CMP_GT_OQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(<=, _CMP_LE_OQ, _Tpvec, sufcmp, sufset, tval) \ + OPENCV_HAL_IMPL_AVX512_CMP_FLT(>=, _CMP_GE_OQ, _Tpvec, sufcmp, sufset, tval) + +OPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(v_float32x16, ps, epi32, (int)-1) +OPENCV_HAL_IMPL_AVX512_CMP_OP_FLT(v_float64x8, pd, epi64, (int64)-1) + +inline v_float32x16 v_not_nan(const v_float32x16& a) +{ return v_float32x16(_mm512_castsi512_ps(_mm512_maskz_set1_epi32(_mm512_cmp_ps_mask(a.val, a.val, _CMP_ORD_Q), (int)-1))); } +inline v_float64x8 v_not_nan(const v_float64x8& a) +{ return v_float64x8(_mm512_castsi512_pd(_mm512_maskz_set1_epi64(_mm512_cmp_pd_mask(a.val, a.val, _CMP_ORD_Q), (int64)-1))); } + +/** min/max **/ +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint8x64, _mm512_min_epu8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint8x64, _mm512_max_epu8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int8x64, _mm512_min_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int8x64, _mm512_max_epi8) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint16x32, _mm512_min_epu16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint16x32, _mm512_max_epu16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int16x32, _mm512_min_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int16x32, _mm512_max_epi16) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint32x16, _mm512_min_epu32) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint32x16, _mm512_max_epu32) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int32x16, _mm512_min_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int32x16, _mm512_max_epi32) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_uint64x8, _mm512_min_epu64) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_uint64x8, _mm512_max_epu64) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_int64x8, _mm512_min_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_int64x8, _mm512_max_epi64) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_float32x16, _mm512_min_ps) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_float32x16, _mm512_max_ps) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_min, v_float64x8, _mm512_min_pd) +OPENCV_HAL_IMPL_AVX512_BIN_FUNC(v_max, v_float64x8, _mm512_max_pd) + +/** Rotate **/ +namespace { + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64&) { return v_int8x64(); }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b) + { + return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(b.val, a.val, imm32 ), imm4 *8), + _mm512_slli_epi32(_mm512_alignr_epi32(b.val, a.val, imm32 + 1), (4-imm4)*8))); + }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b) + { + return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(b.val, a.val, 15), imm4 *8), + _mm512_slli_epi32( b.val, (4-imm4)*8))); + }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b) + { + return v_int8x64(_mm512_or_si512(_mm512_srli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 16), imm4 *8), + _mm512_slli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 15), (4-imm4)*8))); + }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b) + { return v_int8x64(_mm512_srli_epi32(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, 15), imm4*8)); }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64& b) + { return v_int8x64(_mm512_alignr_epi32(b.val, a.val, imm32)); }}; + template<> + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64& a, const v_int8x64&) { return a; }}; + template + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b) + { return v_int8x64(_mm512_alignr_epi32(_mm512_setzero_si512(), b.val, imm32 - 16)); }}; + template<> + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64& b) { return b; }}; + template<> + struct _v_rotate_right { static inline v_int8x64 eval(const v_int8x64&, const v_int8x64&) { return v_int8x64(); }}; +} +template inline v_int8x64 v_rotate_right(const v_int8x64& a, const v_int8x64& b) +{ + return imm >= 128 ? v_int8x64() : +#if CV_AVX_512VBMI + v_int8x64(_mm512_permutex2var_epi8(a.val, + _v512_set_epu8(0x3f + imm, 0x3e + imm, 0x3d + imm, 0x3c + imm, 0x3b + imm, 0x3a + imm, 0x39 + imm, 0x38 + imm, + 0x37 + imm, 0x36 + imm, 0x35 + imm, 0x34 + imm, 0x33 + imm, 0x32 + imm, 0x31 + imm, 0x30 + imm, + 0x2f + imm, 0x2e + imm, 0x2d + imm, 0x2c + imm, 0x2b + imm, 0x2a + imm, 0x29 + imm, 0x28 + imm, + 0x27 + imm, 0x26 + imm, 0x25 + imm, 0x24 + imm, 0x23 + imm, 0x22 + imm, 0x21 + imm, 0x20 + imm, + 0x1f + imm, 0x1e + imm, 0x1d + imm, 0x1c + imm, 0x1b + imm, 0x1a + imm, 0x19 + imm, 0x18 + imm, + 0x17 + imm, 0x16 + imm, 0x15 + imm, 0x14 + imm, 0x13 + imm, 0x12 + imm, 0x11 + imm, 0x10 + imm, + 0x0f + imm, 0x0e + imm, 0x0d + imm, 0x0c + imm, 0x0b + imm, 0x0a + imm, 0x09 + imm, 0x08 + imm, + 0x07 + imm, 0x06 + imm, 0x05 + imm, 0x04 + imm, 0x03 + imm, 0x02 + imm, 0x01 + imm, 0x00 + imm), b.val)); +#else + _v_rotate_right 15), imm/4>::eval(a, b); +#endif +} +template +inline v_int8x64 v_rotate_left(const v_int8x64& a, const v_int8x64& b) +{ + if (imm == 0) return a; + if (imm == 64) return b; + if (imm >= 128) return v_int8x64(); +#if CV_AVX_512VBMI + return v_int8x64(_mm512_permutex2var_epi8(b.val, + _v512_set_epi8(0x7f - imm,0x7e - imm,0x7d - imm,0x7c - imm,0x7b - imm,0x7a - imm,0x79 - imm,0x78 - imm, + 0x77 - imm,0x76 - imm,0x75 - imm,0x74 - imm,0x73 - imm,0x72 - imm,0x71 - imm,0x70 - imm, + 0x6f - imm,0x6e - imm,0x6d - imm,0x6c - imm,0x6b - imm,0x6a - imm,0x69 - imm,0x68 - imm, + 0x67 - imm,0x66 - imm,0x65 - imm,0x64 - imm,0x63 - imm,0x62 - imm,0x61 - imm,0x60 - imm, + 0x5f - imm,0x5e - imm,0x5d - imm,0x5c - imm,0x5b - imm,0x5a - imm,0x59 - imm,0x58 - imm, + 0x57 - imm,0x56 - imm,0x55 - imm,0x54 - imm,0x53 - imm,0x52 - imm,0x51 - imm,0x50 - imm, + 0x4f - imm,0x4e - imm,0x4d - imm,0x4c - imm,0x4b - imm,0x4a - imm,0x49 - imm,0x48 - imm, + 0x47 - imm,0x46 - imm,0x45 - imm,0x44 - imm,0x43 - imm,0x42 - imm,0x41 - imm,0x40 - imm), a.val)); +#else + return imm < 64 ? v_rotate_right<64 - imm>(b, a) : v_rotate_right<128 - imm>(v512_setzero_s8(), b); +#endif +} +template +inline v_int8x64 v_rotate_right(const v_int8x64& a) +{ + if (imm == 0) return a; + if (imm >= 64) return v_int8x64(); +#if CV_AVX_512VBMI + return v_int8x64(_mm512_maskz_permutexvar_epi8(0xFFFFFFFFFFFFFFFF >> imm, + _v512_set_epu8(0x3f + imm,0x3e + imm,0x3d + imm,0x3c + imm,0x3b + imm,0x3a + imm,0x39 + imm,0x38 + imm, + 0x37 + imm,0x36 + imm,0x35 + imm,0x34 + imm,0x33 + imm,0x32 + imm,0x31 + imm,0x30 + imm, + 0x2f + imm,0x2e + imm,0x2d + imm,0x2c + imm,0x2b + imm,0x2a + imm,0x29 + imm,0x28 + imm, + 0x27 + imm,0x26 + imm,0x25 + imm,0x24 + imm,0x23 + imm,0x22 + imm,0x21 + imm,0x20 + imm, + 0x1f + imm,0x1e + imm,0x1d + imm,0x1c + imm,0x1b + imm,0x1a + imm,0x19 + imm,0x18 + imm, + 0x17 + imm,0x16 + imm,0x15 + imm,0x14 + imm,0x13 + imm,0x12 + imm,0x11 + imm,0x10 + imm, + 0x0f + imm,0x0e + imm,0x0d + imm,0x0c + imm,0x0b + imm,0x0a + imm,0x09 + imm,0x08 + imm, + 0x07 + imm,0x06 + imm,0x05 + imm,0x04 + imm,0x03 + imm,0x02 + imm,0x01 + imm,0x00 + imm), a.val)); +#else + return v_rotate_right(a, v512_setzero_s8()); +#endif +} +template +inline v_int8x64 v_rotate_left(const v_int8x64& a) +{ + if (imm == 0) return a; + if (imm >= 64) return v_int8x64(); +#if CV_AVX_512VBMI + return v_int8x64(_mm512_maskz_permutexvar_epi8(0xFFFFFFFFFFFFFFFF << imm, + _v512_set_epi8(0x3f - imm,0x3e - imm,0x3d - imm,0x3c - imm,0x3b - imm,0x3a - imm,0x39 - imm,0x38 - imm, + 0x37 - imm,0x36 - imm,0x35 - imm,0x34 - imm,0x33 - imm,0x32 - imm,0x31 - imm,0x30 - imm, + 0x2f - imm,0x2e - imm,0x2d - imm,0x2c - imm,0x2b - imm,0x2a - imm,0x29 - imm,0x28 - imm, + 0x27 - imm,0x26 - imm,0x25 - imm,0x24 - imm,0x23 - imm,0x22 - imm,0x21 - imm,0x20 - imm, + 0x1f - imm,0x1e - imm,0x1d - imm,0x1c - imm,0x1b - imm,0x1a - imm,0x19 - imm,0x18 - imm, + 0x17 - imm,0x16 - imm,0x15 - imm,0x14 - imm,0x13 - imm,0x12 - imm,0x11 - imm,0x10 - imm, + 0x0f - imm,0x0e - imm,0x0d - imm,0x0c - imm,0x0b - imm,0x0a - imm,0x09 - imm,0x08 - imm, + 0x07 - imm,0x06 - imm,0x05 - imm,0x04 - imm,0x03 - imm,0x02 - imm,0x01 - imm,0x00 - imm), a.val)); +#else + return v_rotate_right<64 - imm>(v512_setzero_s8(), a); +#endif +} + +#define OPENCV_HAL_IMPL_AVX512_ROTATE_PM(_Tpvec, suffix) \ +template inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \ +{ return v_reinterpret_as_##suffix(v_rotate_left(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b))); } \ +template inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \ +{ return v_reinterpret_as_##suffix(v_rotate_right(v_reinterpret_as_s8(a), v_reinterpret_as_s8(b))); } \ +template inline _Tpvec v_rotate_left(const _Tpvec& a) \ +{ return v_reinterpret_as_##suffix(v_rotate_left(v_reinterpret_as_s8(a))); } \ +template inline _Tpvec v_rotate_right(const _Tpvec& a) \ +{ return v_reinterpret_as_##suffix(v_rotate_right(v_reinterpret_as_s8(a))); } + +#define OPENCV_HAL_IMPL_AVX512_ROTATE_EC(_Tpvec, suffix) \ +template \ +inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \ +{ \ + enum { SHIFT2 = (_Tpvec::nlanes - imm) }; \ + enum { MASK = ((1 << _Tpvec::nlanes) - 1) }; \ + if (imm == 0) return a; \ + if (imm == _Tpvec::nlanes) return b; \ + if (imm >= 2*_Tpvec::nlanes) return _Tpvec::zero(); \ + return _Tpvec(_mm512_mask_expand_##suffix(_mm512_maskz_compress_##suffix((MASK << SHIFT2)&MASK, b.val), (MASK << (imm))&MASK, a.val)); \ +} \ +template \ +inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \ +{ \ + enum { SHIFT2 = (_Tpvec::nlanes - imm) }; \ + enum { MASK = ((1 << _Tpvec::nlanes) - 1) }; \ + if (imm == 0) return a; \ + if (imm == _Tpvec::nlanes) return b; \ + if (imm >= 2*_Tpvec::nlanes) return _Tpvec::zero(); \ + return _Tpvec(_mm512_mask_expand_##suffix(_mm512_maskz_compress_##suffix((MASK << (imm))&MASK, a.val), (MASK << SHIFT2)&MASK, b.val)); \ +} \ +template \ +inline _Tpvec v_rotate_left(const _Tpvec& a) \ +{ \ + if (imm == 0) return a; \ + if (imm >= _Tpvec::nlanes) return _Tpvec::zero(); \ + return _Tpvec(_mm512_maskz_expand_##suffix((1 << _Tpvec::nlanes) - (1 << (imm)), a.val)); \ +} \ +template \ +inline _Tpvec v_rotate_right(const _Tpvec& a) \ +{ \ + if (imm == 0) return a; \ + if (imm >= _Tpvec::nlanes) return _Tpvec::zero(); \ + return _Tpvec(_mm512_maskz_compress_##suffix((1 << _Tpvec::nlanes) - (1 << (imm)), a.val)); \ +} + +OPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_uint8x64, u8) +OPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_uint16x32, u16) +OPENCV_HAL_IMPL_AVX512_ROTATE_PM(v_int16x32, s16) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_uint32x16, epi32) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_int32x16, epi32) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_uint64x8, epi64) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_int64x8, epi64) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_float32x16, ps) +OPENCV_HAL_IMPL_AVX512_ROTATE_EC(v_float64x8, pd) + +/** Reverse **/ +inline v_uint8x64 v_reverse(const v_uint8x64 &a) +{ +#if CV_AVX_512VBMI + static const __m512i perm = _mm512_set_epi32( + 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f, + 0x10111213, 0x14151617, 0x18191a1b, 0x1c1d1e1f, + 0x20212223, 0x24252627, 0x28292a2b, 0x2c2d2e2f, + 0x30313233, 0x34353637, 0x38393a3b, 0x3c3d3e3f); + return v_uint8x64(_mm512_permutexvar_epi8(perm, a.val)); +#else + static const __m512i shuf = _mm512_set_epi32( + 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f, + 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f, + 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f, + 0x00010203, 0x04050607, 0x08090a0b, 0x0c0d0e0f); + static const __m512i perm = _mm512_set_epi64(1, 0, 3, 2, 5, 4, 7, 6); + __m512i vec = _mm512_shuffle_epi8(a.val, shuf); + return v_uint8x64(_mm512_permutexvar_epi64(perm, vec)); +#endif +} + +inline v_int8x64 v_reverse(const v_int8x64 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x32 v_reverse(const v_uint16x32 &a) +{ +#if CV_AVX_512VBMI + static const __m512i perm = _mm512_set_epi32( + 0x00000001, 0x00020003, 0x00040005, 0x00060007, + 0x00080009, 0x000a000b, 0x000c000d, 0x000e000f, + 0x00100011, 0x00120013, 0x00140015, 0x00160017, + 0x00180019, 0x001a001b, 0x001c001d, 0x001e001f); + return v_uint16x32(_mm512_permutexvar_epi16(perm, a.val)); +#else + static const __m512i shuf = _mm512_set_epi32( + 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e, + 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e, + 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e, + 0x01000302, 0x05040706, 0x09080b0a, 0x0d0c0f0e); + static const __m512i perm = _mm512_set_epi64(1, 0, 3, 2, 5, 4, 7, 6); + __m512i vec = _mm512_shuffle_epi8(a.val, shuf); + return v_uint16x32(_mm512_permutexvar_epi64(perm, vec)); +#endif +} + +inline v_int16x32 v_reverse(const v_int16x32 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x16 v_reverse(const v_uint32x16 &a) +{ + static const __m512i perm = _mm512_set_epi32(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,14, 15); + return v_uint32x16(_mm512_permutexvar_epi32(perm, a.val)); +} + +inline v_int32x16 v_reverse(const v_int32x16 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x16 v_reverse(const v_float32x16 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x8 v_reverse(const v_uint64x8 &a) +{ + static const __m512i perm = _mm512_set_epi64(0, 1, 2, 3, 4, 5, 6, 7); + return v_uint64x8(_mm512_permutexvar_epi64(perm, a.val)); +} + +inline v_int64x8 v_reverse(const v_int64x8 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x8 v_reverse(const v_float64x8 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + +////////// Reduce ///////// + +/** Reduce **/ +#define OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64(a, b) a + b +#define OPENCV_HAL_IMPL_AVX512_REDUCE_8(sctype, func, _Tpvec, ifunc, scop) \ + inline sctype v_reduce_##func(const _Tpvec& a) \ + { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + sctype CV_DECL_ALIGNED(64) idx[2]; \ + _mm_store_si128((__m128i*)idx, _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1))); \ + return scop(idx[0], idx[1]); } +OPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, min, v_uint64x8, min_epu64, min) +OPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, max, v_uint64x8, max_epu64, max) +OPENCV_HAL_IMPL_AVX512_REDUCE_8(uint64, sum, v_uint64x8, add_epi64, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64) +OPENCV_HAL_IMPL_AVX512_REDUCE_8(int64, min, v_int64x8, min_epi64, min) +OPENCV_HAL_IMPL_AVX512_REDUCE_8(int64, max, v_int64x8, max_epi64, max) +OPENCV_HAL_IMPL_AVX512_REDUCE_8(int64, sum, v_int64x8, add_epi64, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64) + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_8F(func, ifunc, scop) \ + inline double v_reduce_##func(const v_float64x8& a) \ + { __m256d half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + double CV_DECL_ALIGNED(64) idx[2]; \ + _mm_store_pd(idx, _mm_##ifunc(_mm256_castpd256_pd128(half), _mm256_extractf128_pd(half, 1))); \ + return scop(idx[0], idx[1]); } +OPENCV_HAL_IMPL_AVX512_REDUCE_8F(min, min_pd, min) +OPENCV_HAL_IMPL_AVX512_REDUCE_8F(max, max_pd, max) +OPENCV_HAL_IMPL_AVX512_REDUCE_8F(sum, add_pd, OPENCV_HAL_IMPL_AVX512_REDUCE_ADD64) + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_16(sctype, func, _Tpvec, ifunc) \ + inline sctype v_reduce_##func(const _Tpvec& a) \ + { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4)); \ + return (sctype)_mm_cvtsi128_si32(quarter); } +OPENCV_HAL_IMPL_AVX512_REDUCE_16(uint, min, v_uint32x16, min_epu32) +OPENCV_HAL_IMPL_AVX512_REDUCE_16(uint, max, v_uint32x16, max_epu32) +OPENCV_HAL_IMPL_AVX512_REDUCE_16(int, min, v_int32x16, min_epi32) +OPENCV_HAL_IMPL_AVX512_REDUCE_16(int, max, v_int32x16, max_epi32) + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_16F(func, ifunc) \ + inline float v_reduce_##func(const v_float32x16& a) \ + { __m256 half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + __m128 quarter = _mm_##ifunc(_mm256_castps256_ps128(half), _mm256_extractf128_ps(half, 1)); \ + quarter = _mm_##ifunc(quarter, _mm_permute_ps(quarter, _MM_SHUFFLE(0, 0, 3, 2))); \ + quarter = _mm_##ifunc(quarter, _mm_permute_ps(quarter, _MM_SHUFFLE(0, 0, 0, 1))); \ + return _mm_cvtss_f32(quarter); } +OPENCV_HAL_IMPL_AVX512_REDUCE_16F(min, min_ps) +OPENCV_HAL_IMPL_AVX512_REDUCE_16F(max, max_ps) + +inline float v_reduce_sum(const v_float32x16& a) +{ + __m256 half = _mm256_add_ps(_v512_extract_low(a.val), _v512_extract_high(a.val)); + __m128 quarter = _mm_add_ps(_mm256_castps256_ps128(half), _mm256_extractf128_ps(half, 1)); + quarter = _mm_hadd_ps(quarter, quarter); + return _mm_cvtss_f32(_mm_hadd_ps(quarter, quarter)); +} +inline int v_reduce_sum(const v_int32x16& a) +{ + __m256i half = _mm256_add_epi32(_v512_extract_low(a.val), _v512_extract_high(a.val)); + __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); + quarter = _mm_hadd_epi32(quarter, quarter); + return _mm_cvtsi128_si32(_mm_hadd_epi32(quarter, quarter)); +} +inline uint v_reduce_sum(const v_uint32x16& a) +{ return (uint)v_reduce_sum(v_reinterpret_as_s32(a)); } + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_32(sctype, func, _Tpvec, ifunc) \ + inline sctype v_reduce_##func(const _Tpvec& a) \ + { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 2)); \ + return (sctype)_mm_cvtsi128_si32(quarter); } +OPENCV_HAL_IMPL_AVX512_REDUCE_32(ushort, min, v_uint16x32, min_epu16) +OPENCV_HAL_IMPL_AVX512_REDUCE_32(ushort, max, v_uint16x32, max_epu16) +OPENCV_HAL_IMPL_AVX512_REDUCE_32(short, min, v_int16x32, min_epi16) +OPENCV_HAL_IMPL_AVX512_REDUCE_32(short, max, v_int16x32, max_epi16) + +inline int v_reduce_sum(const v_int16x32& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } +inline uint v_reduce_sum(const v_uint16x32& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_64(sctype, func, _Tpvec, ifunc) \ + inline sctype v_reduce_##func(const _Tpvec& a) \ + { __m256i half = _mm256_##ifunc(_v512_extract_low(a.val), _v512_extract_high(a.val)); \ + __m128i quarter = _mm_##ifunc(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 8)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 4)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 2)); \ + quarter = _mm_##ifunc(quarter, _mm_srli_si128(quarter, 1)); \ + return (sctype)_mm_cvtsi128_si32(quarter); } +OPENCV_HAL_IMPL_AVX512_REDUCE_64(uchar, min, v_uint8x64, min_epu8) +OPENCV_HAL_IMPL_AVX512_REDUCE_64(uchar, max, v_uint8x64, max_epu8) +OPENCV_HAL_IMPL_AVX512_REDUCE_64(schar, min, v_int8x64, min_epi8) +OPENCV_HAL_IMPL_AVX512_REDUCE_64(schar, max, v_int8x64, max_epi8) + +#define OPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(sctype, _Tpvec, suffix) \ + inline sctype v_reduce_sum(const _Tpvec& a) \ + { __m512i a16 = _mm512_add_epi16(_mm512_cvt##suffix##_epi16(_v512_extract_low(a.val)), \ + _mm512_cvt##suffix##_epi16(_v512_extract_high(a.val))); \ + a16 = _mm512_cvtepi16_epi32(_mm256_add_epi16(_v512_extract_low(a16), _v512_extract_high(a16))); \ + __m256i a8 = _mm256_add_epi32(_v512_extract_low(a16), _v512_extract_high(a16)); \ + __m128i a4 = _mm_add_epi32(_mm256_castsi256_si128(a8), _mm256_extracti128_si256(a8, 1)); \ + a4 = _mm_hadd_epi32(a4, a4); \ + return (sctype)_mm_cvtsi128_si32(_mm_hadd_epi32(a4, a4)); } +OPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(uint, v_uint8x64, epu8) +OPENCV_HAL_IMPL_AVX512_REDUCE_64_SUM(int, v_int8x64, epi8) + +inline v_float32x16 v_reduce_sum4(const v_float32x16& a, const v_float32x16& b, + const v_float32x16& c, const v_float32x16& d) +{ + __m256 abl = _mm256_hadd_ps(_v512_extract_low(a.val), _v512_extract_low(b.val)); + __m256 abh = _mm256_hadd_ps(_v512_extract_high(a.val), _v512_extract_high(b.val)); + __m256 cdl = _mm256_hadd_ps(_v512_extract_low(c.val), _v512_extract_low(d.val)); + __m256 cdh = _mm256_hadd_ps(_v512_extract_high(c.val), _v512_extract_high(d.val)); + return v_float32x16(_v512_combine(_mm256_hadd_ps(abl, cdl), _mm256_hadd_ps(abh, cdh))); +} + +inline unsigned v_reduce_sad(const v_uint8x64& a, const v_uint8x64& b) +{ + __m512i val = _mm512_sad_epu8(a.val, b.val); + __m256i half = _mm256_add_epi32(_v512_extract_low(val), _v512_extract_high(val)); + __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))); +} +inline unsigned v_reduce_sad(const v_int8x64& a, const v_int8x64& b) +{ + __m512i val = _mm512_set1_epi8(-128); + val = _mm512_sad_epu8(_mm512_add_epi8(a.val, val), _mm512_add_epi8(b.val, val)); + __m256i half = _mm256_add_epi32(_v512_extract_low(val), _v512_extract_high(val)); + __m128i quarter = _mm_add_epi32(_mm256_castsi256_si128(half), _mm256_extracti128_si256(half, 1)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(quarter, _mm_unpackhi_epi64(quarter, quarter))); +} +inline unsigned v_reduce_sad(const v_uint16x32& a, const v_uint16x32& b) +{ return v_reduce_sum(v_add_wrap(a - b, b - a)); } +inline unsigned v_reduce_sad(const v_int16x32& a, const v_int16x32& b) +{ return v_reduce_sum(v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b)))); } +inline unsigned v_reduce_sad(const v_uint32x16& a, const v_uint32x16& b) +{ return v_reduce_sum(v_max(a, b) - v_min(a, b)); } +inline unsigned v_reduce_sad(const v_int32x16& a, const v_int32x16& b) +{ return v_reduce_sum(v_reinterpret_as_u32(v_max(a, b) - v_min(a, b))); } +inline float v_reduce_sad(const v_float32x16& a, const v_float32x16& b) +{ return v_reduce_sum((a - b) & v_float32x16(_mm512_castsi512_ps(_mm512_set1_epi32(0x7fffffff)))); } +inline double v_reduce_sad(const v_float64x8& a, const v_float64x8& b) +{ return v_reduce_sum((a - b) & v_float64x8(_mm512_castsi512_pd(_mm512_set1_epi64(0x7fffffffffffffff)))); } + +/** Popcount **/ +inline v_uint8x64 v_popcount(const v_int8x64& a) +{ +#if CV_AVX_512BITALG + return v_uint8x64(_mm512_popcnt_epi8(a.val)); +#elif CV_AVX_512VBMI + __m512i _popcnt_table0 = _v512_set_epu8(7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, + 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, + 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1, + 4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0); + __m512i _popcnt_table1 = _v512_set_epu8(7, 6, 6, 5, 6, 5, 5, 4, 6, 5, 5, 4, 5, 4, 4, 3, + 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, + 6, 5, 5, 4, 5, 4, 4, 3, 5, 4, 4, 3, 4, 3, 3, 2, + 5, 4, 4, 3, 4, 3, 3, 2, 4, 3, 3, 2, 3, 2, 2, 1); + return v_uint8x64(_mm512_sub_epi8(_mm512_permutex2var_epi8(_popcnt_table0, a.val, _popcnt_table1), _mm512_movm_epi8(_mm512_movepi8_mask(a.val)))); +#else + __m512i _popcnt_table = _mm512_set4_epi32(0x04030302, 0x03020201, 0x03020201, 0x02010100); + __m512i _popcnt_mask = _mm512_set1_epi8(0x0F); + + return v_uint8x64(_mm512_add_epi8(_mm512_shuffle_epi8(_popcnt_table, _mm512_and_si512( a.val, _popcnt_mask)), + _mm512_shuffle_epi8(_popcnt_table, _mm512_and_si512(_mm512_srli_epi16(a.val, 4), _popcnt_mask)))); +#endif +} +inline v_uint16x32 v_popcount(const v_int16x32& a) +{ +#if CV_AVX_512BITALG + return v_uint16x32(_mm512_popcnt_epi16(a.val)); +#elif CV_AVX_512VPOPCNTDQ + __m512i zero = _mm512_setzero_si512(); + return v_uint16x32(_mm512_packs_epi32(_mm512_popcnt_epi32(_mm512_unpacklo_epi16(a.val, zero)), + _mm512_popcnt_epi32(_mm512_unpackhi_epi16(a.val, zero)))); +#else + v_uint8x64 p = v_popcount(v_reinterpret_as_s8(a)); + p += v_rotate_right<1>(p); + return v_reinterpret_as_u16(p) & v512_setall_u16(0x00ff); +#endif +} +inline v_uint32x16 v_popcount(const v_int32x16& a) +{ +#if CV_AVX_512VPOPCNTDQ + return v_uint32x16(_mm512_popcnt_epi32(a.val)); +#else + v_uint8x64 p = v_popcount(v_reinterpret_as_s8(a)); + p += v_rotate_right<1>(p); + p += v_rotate_right<2>(p); + return v_reinterpret_as_u32(p) & v512_setall_u32(0x000000ff); +#endif +} +inline v_uint64x8 v_popcount(const v_int64x8& a) +{ +#if CV_AVX_512VPOPCNTDQ + return v_uint64x8(_mm512_popcnt_epi64(a.val)); +#else + return v_uint64x8(_mm512_sad_epu8(v_popcount(v_reinterpret_as_s8(a)).val, _mm512_setzero_si512())); +#endif +} + + +inline v_uint8x64 v_popcount(const v_uint8x64& a) { return v_popcount(v_reinterpret_as_s8 (a)); } +inline v_uint16x32 v_popcount(const v_uint16x32& a) { return v_popcount(v_reinterpret_as_s16(a)); } +inline v_uint32x16 v_popcount(const v_uint32x16& a) { return v_popcount(v_reinterpret_as_s32(a)); } +inline v_uint64x8 v_popcount(const v_uint64x8& a) { return v_popcount(v_reinterpret_as_s64(a)); } + + +////////// Other math ///////// + +/** Some frequent operations **/ +#define OPENCV_HAL_IMPL_AVX512_MULADD(_Tpvec, suffix) \ + inline _Tpvec v_fma(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \ + { return _Tpvec(_mm512_fmadd_##suffix(a.val, b.val, c.val)); } \ + inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \ + { return _Tpvec(_mm512_fmadd_##suffix(a.val, b.val, c.val)); } \ + inline _Tpvec v_sqrt(const _Tpvec& x) \ + { return _Tpvec(_mm512_sqrt_##suffix(x.val)); } \ + inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \ + { return v_fma(a, a, b * b); } \ + inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \ + { return v_sqrt(v_fma(a, a, b * b)); } + +OPENCV_HAL_IMPL_AVX512_MULADD(v_float32x16, ps) +OPENCV_HAL_IMPL_AVX512_MULADD(v_float64x8, pd) + +inline v_int32x16 v_fma(const v_int32x16& a, const v_int32x16& b, const v_int32x16& c) +{ return a * b + c; } +inline v_int32x16 v_muladd(const v_int32x16& a, const v_int32x16& b, const v_int32x16& c) +{ return v_fma(a, b, c); } + +inline v_float32x16 v_invsqrt(const v_float32x16& x) +{ +#if CV_AVX_512ER + return v_float32x16(_mm512_rsqrt28_ps(x.val)); +#else + v_float32x16 half = x * v512_setall_f32(0.5); + v_float32x16 t = v_float32x16(_mm512_rsqrt14_ps(x.val)); + t *= v512_setall_f32(1.5) - ((t * t) * half); + return t; +#endif +} + +inline v_float64x8 v_invsqrt(const v_float64x8& x) +{ +#if CV_AVX_512ER + return v_float64x8(_mm512_rsqrt28_pd(x.val)); +#else + return v512_setall_f64(1.) / v_sqrt(x); +// v_float64x8 half = x * v512_setall_f64(0.5); +// v_float64x8 t = v_float64x8(_mm512_rsqrt14_pd(x.val)); +// t *= v512_setall_f64(1.5) - ((t * t) * half); +// t *= v512_setall_f64(1.5) - ((t * t) * half); +// return t; +#endif +} + +/** Absolute values **/ +#define OPENCV_HAL_IMPL_AVX512_ABS(_Tpvec, _Tpuvec, suffix) \ + inline _Tpuvec v_abs(const _Tpvec& x) \ + { return _Tpuvec(_mm512_abs_##suffix(x.val)); } + +OPENCV_HAL_IMPL_AVX512_ABS(v_int8x64, v_uint8x64, epi8) +OPENCV_HAL_IMPL_AVX512_ABS(v_int16x32, v_uint16x32, epi16) +OPENCV_HAL_IMPL_AVX512_ABS(v_int32x16, v_uint32x16, epi32) +OPENCV_HAL_IMPL_AVX512_ABS(v_int64x8, v_uint64x8, epi64) + +inline v_float32x16 v_abs(const v_float32x16& x) +{ +#ifdef _mm512_abs_pd + return v_float32x16(_mm512_abs_ps(x.val)); +#else + return v_float32x16(_mm512_castsi512_ps(_mm512_and_si512(_mm512_castps_si512(x.val), + _v512_set_epu64(0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, + 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF, 0x7FFFFFFF7FFFFFFF)))); +#endif +} + +inline v_float64x8 v_abs(const v_float64x8& x) +{ +#ifdef _mm512_abs_pd + #if defined __GNUC__ && (__GNUC__ < 7 || (__GNUC__ == 7 && __GNUC_MINOR__ <= 3) || (__GNUC__ == 8 && __GNUC_MINOR__ <= 2)) + // Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87476 + return v_float64x8(_mm512_abs_pd(_mm512_castpd_ps(x.val))); + #else + return v_float64x8(_mm512_abs_pd(x.val)); + #endif +#else + return v_float64x8(_mm512_castsi512_pd(_mm512_and_si512(_mm512_castpd_si512(x.val), + _v512_set_epu64(0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, + 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF, 0x7FFFFFFFFFFFFFFF)))); +#endif +} + +/** Absolute difference **/ +inline v_uint8x64 v_absdiff(const v_uint8x64& a, const v_uint8x64& b) +{ return v_add_wrap(a - b, b - a); } +inline v_uint16x32 v_absdiff(const v_uint16x32& a, const v_uint16x32& b) +{ return v_add_wrap(a - b, b - a); } +inline v_uint32x16 v_absdiff(const v_uint32x16& a, const v_uint32x16& b) +{ return v_max(a, b) - v_min(a, b); } + +inline v_uint8x64 v_absdiff(const v_int8x64& a, const v_int8x64& b) +{ + v_int8x64 d = v_sub_wrap(a, b); + v_int8x64 m = a < b; + return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m)); +} + +inline v_uint16x32 v_absdiff(const v_int16x32& a, const v_int16x32& b) +{ return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))); } + +inline v_uint32x16 v_absdiff(const v_int32x16& a, const v_int32x16& b) +{ + v_int32x16 d = a - b; + v_int32x16 m = a < b; + return v_reinterpret_as_u32((d ^ m) - m); +} + +inline v_float32x16 v_absdiff(const v_float32x16& a, const v_float32x16& b) +{ return v_abs(a - b); } + +inline v_float64x8 v_absdiff(const v_float64x8& a, const v_float64x8& b) +{ return v_abs(a - b); } + +/** Saturating absolute difference **/ +inline v_int8x64 v_absdiffs(const v_int8x64& a, const v_int8x64& b) +{ + v_int8x64 d = a - b; + v_int8x64 m = a < b; + return (d ^ m) - m; +} +inline v_int16x32 v_absdiffs(const v_int16x32& a, const v_int16x32& b) +{ return v_max(a, b) - v_min(a, b); } + +////////// Conversions ///////// + +/** Rounding **/ +inline v_int32x16 v_round(const v_float32x16& a) +{ return v_int32x16(_mm512_cvtps_epi32(a.val)); } + +inline v_int32x16 v_round(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(a.val))); } + +inline v_int32x16 v_round(const v_float64x8& a, const v_float64x8& b) +{ return v_int32x16(_v512_combine(_mm512_cvtpd_epi32(a.val), _mm512_cvtpd_epi32(b.val))); } + +inline v_int32x16 v_trunc(const v_float32x16& a) +{ return v_int32x16(_mm512_cvttps_epi32(a.val)); } + +inline v_int32x16 v_trunc(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvttpd_epi32(a.val))); } + +#if CVT_ROUND_MODES_IMPLEMENTED +inline v_int32x16 v_floor(const v_float32x16& a) +{ return v_int32x16(_mm512_cvt_roundps_epi32(a.val, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC)); } + +inline v_int32x16 v_floor(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvt_roundpd_epi32(a.val, _MM_FROUND_TO_NEG_INF | _MM_FROUND_NO_EXC))); } + +inline v_int32x16 v_ceil(const v_float32x16& a) +{ return v_int32x16(_mm512_cvt_roundps_epi32(a.val, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC)); } + +inline v_int32x16 v_ceil(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvt_roundpd_epi32(a.val, _MM_FROUND_TO_POS_INF | _MM_FROUND_NO_EXC))); } +#else +inline v_int32x16 v_floor(const v_float32x16& a) +{ return v_int32x16(_mm512_cvtps_epi32(_mm512_roundscale_ps(a.val, 1))); } + +inline v_int32x16 v_floor(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(_mm512_roundscale_pd(a.val, 1)))); } + +inline v_int32x16 v_ceil(const v_float32x16& a) +{ return v_int32x16(_mm512_cvtps_epi32(_mm512_roundscale_ps(a.val, 2))); } + +inline v_int32x16 v_ceil(const v_float64x8& a) +{ return v_int32x16(_mm512_castsi256_si512(_mm512_cvtpd_epi32(_mm512_roundscale_pd(a.val, 2)))); } +#endif + +/** To float **/ +inline v_float32x16 v_cvt_f32(const v_int32x16& a) +{ return v_float32x16(_mm512_cvtepi32_ps(a.val)); } + +inline v_float32x16 v_cvt_f32(const v_float64x8& a) +{ return v_float32x16(_mm512_cvtpd_pslo(a.val)); } + +inline v_float32x16 v_cvt_f32(const v_float64x8& a, const v_float64x8& b) +{ return v_float32x16(_v512_combine(_mm512_cvtpd_ps(a.val), _mm512_cvtpd_ps(b.val))); } + +inline v_float64x8 v_cvt_f64(const v_int32x16& a) +{ return v_float64x8(_mm512_cvtepi32_pd(_v512_extract_low(a.val))); } + +inline v_float64x8 v_cvt_f64_high(const v_int32x16& a) +{ return v_float64x8(_mm512_cvtepi32_pd(_v512_extract_high(a.val))); } + +inline v_float64x8 v_cvt_f64(const v_float32x16& a) +{ return v_float64x8(_mm512_cvtps_pd(_v512_extract_low(a.val))); } + +inline v_float64x8 v_cvt_f64_high(const v_float32x16& a) +{ return v_float64x8(_mm512_cvtps_pd(_v512_extract_high(a.val))); } + +// from (Mysticial and wim) https://stackoverflow.com/q/41144668 +inline v_float64x8 v_cvt_f64(const v_int64x8& v) +{ +#if CV_AVX_512DQ + return v_float64x8(_mm512_cvtepi64_pd(v.val)); +#else + // constants encoded as floating-point + __m512i magic_i_lo = _mm512_set1_epi64(0x4330000000000000); // 2^52 + __m512i magic_i_hi32 = _mm512_set1_epi64(0x4530000080000000); // 2^84 + 2^63 + __m512i magic_i_all = _mm512_set1_epi64(0x4530000080100000); // 2^84 + 2^63 + 2^52 + __m512d magic_d_all = _mm512_castsi512_pd(magic_i_all); + + // Blend the 32 lowest significant bits of v with magic_int_lo + __m512i v_lo = _mm512_mask_blend_epi32(0x5555, magic_i_lo, v.val); + // Extract the 32 most significant bits of v + __m512i v_hi = _mm512_srli_epi64(v.val, 32); + // Flip the msb of v_hi and blend with 0x45300000 + v_hi = _mm512_xor_si512(v_hi, magic_i_hi32); + // Compute in double precision + __m512d v_hi_dbl = _mm512_sub_pd(_mm512_castsi512_pd(v_hi), magic_d_all); + // (v_hi - magic_d_all) + v_lo Do not assume associativity of floating point addition + __m512d result = _mm512_add_pd(v_hi_dbl, _mm512_castsi512_pd(v_lo)); + return v_float64x8(result); +#endif +} + +////////////// Lookup table access //////////////////// + +inline v_int8x64 v512_lut(const schar* tab, const int* idx) +{ + __m128i p0 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx ), (const int *)tab, 1)); + __m128i p1 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 1)); + __m128i p2 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 2), (const int *)tab, 1)); + __m128i p3 = _mm512_cvtepi32_epi8(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 3), (const int *)tab, 1)); + return v_int8x64(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512(p0), p1, 1), p2, 2), p3, 3)); +} +inline v_int8x64 v512_lut_pairs(const schar* tab, const int* idx) +{ + __m256i p0 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx ), (const int *)tab, 1)); + __m256i p1 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 1)); + return v_int8x64(_v512_combine(p0, p1)); +} +inline v_int8x64 v512_lut_quads(const schar* tab, const int* idx) +{ + return v_int8x64(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), (const int *)tab, 1)); +} +inline v_uint8x64 v512_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut((const schar *)tab, idx)); } +inline v_uint8x64 v512_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut_pairs((const schar *)tab, idx)); } +inline v_uint8x64 v512_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v512_lut_quads((const schar *)tab, idx)); } + +inline v_int16x32 v512_lut(const short* tab, const int* idx) +{ + __m256i p0 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx ), (const int *)tab, 2)); + __m256i p1 = _mm512_cvtepi32_epi16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx + 1), (const int *)tab, 2)); + return v_int16x32(_v512_combine(p0, p1)); +} +inline v_int16x32 v512_lut_pairs(const short* tab, const int* idx) +{ + return v_int16x32(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), (const int *)tab, 2)); +} +inline v_int16x32 v512_lut_quads(const short* tab, const int* idx) +{ +#if defined(__GNUC__) + return v_int16x32(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 2)); +#else + return v_int16x32(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const int64*)tab, 2)); +#endif +} +inline v_uint16x32 v512_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut((const short *)tab, idx)); } +inline v_uint16x32 v512_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut_pairs((const short *)tab, idx)); } +inline v_uint16x32 v512_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v512_lut_quads((const short *)tab, idx)); } + +inline v_int32x16 v512_lut(const int* tab, const int* idx) +{ + return v_int32x16(_mm512_i32gather_epi32(_mm512_loadu_si512((const __m512i*)idx), tab, 4)); +} +inline v_int32x16 v512_lut_pairs(const int* tab, const int* idx) +{ +#if defined(__GNUC__) + return v_int32x16(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 4)); +#else + return v_int32x16(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const int64*)tab, 4)); +#endif +} +inline v_int32x16 v512_lut_quads(const int* tab, const int* idx) +{ + return v_int32x16(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512( + _mm_loadu_si128((const __m128i*)(tab + idx[0]))), + _mm_loadu_si128((const __m128i*)(tab + idx[1])), 1), + _mm_loadu_si128((const __m128i*)(tab + idx[2])), 2), + _mm_loadu_si128((const __m128i*)(tab + idx[3])), 3)); +} +inline v_uint32x16 v512_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut((const int *)tab, idx)); } +inline v_uint32x16 v512_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut_pairs((const int *)tab, idx)); } +inline v_uint32x16 v512_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v512_lut_quads((const int *)tab, idx)); } + +inline v_int64x8 v512_lut(const int64* tab, const int* idx) +{ +#if defined(__GNUC__) + return v_int64x8(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), (const long long int*)tab, 8)); +#else + return v_int64x8(_mm512_i32gather_epi64(_mm256_loadu_si256((const __m256i*)idx), tab , 8)); +#endif +} +inline v_int64x8 v512_lut_pairs(const int64* tab, const int* idx) +{ + return v_int64x8(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_inserti32x4(_mm512_castsi128_si512( + _mm_loadu_si128((const __m128i*)(tab + idx[0]))), + _mm_loadu_si128((const __m128i*)(tab + idx[1])), 1), + _mm_loadu_si128((const __m128i*)(tab + idx[2])), 2), + _mm_loadu_si128((const __m128i*)(tab + idx[3])), 3)); +} +inline v_uint64x8 v512_lut(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v512_lut((const int64 *)tab, idx)); } +inline v_uint64x8 v512_lut_pairs(const uint64* tab, const int* idx) { return v_reinterpret_as_u64(v512_lut_pairs((const int64 *)tab, idx)); } + +inline v_float32x16 v512_lut(const float* tab, const int* idx) +{ + return v_float32x16(_mm512_i32gather_ps(_mm512_loadu_si512((const __m512i*)idx), tab, 4)); +} +inline v_float32x16 v512_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v512_lut_pairs((const int *)tab, idx)); } +inline v_float32x16 v512_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v512_lut_quads((const int *)tab, idx)); } + +inline v_float64x8 v512_lut(const double* tab, const int* idx) +{ + return v_float64x8(_mm512_i32gather_pd(_mm256_loadu_si256((const __m256i*)idx), tab, 8)); +} +inline v_float64x8 v512_lut_pairs(const double* tab, const int* idx) +{ + return v_float64x8(_mm512_insertf64x2(_mm512_insertf64x2(_mm512_insertf64x2(_mm512_castpd128_pd512( + _mm_loadu_pd(tab + idx[0])), + _mm_loadu_pd(tab + idx[1]), 1), + _mm_loadu_pd(tab + idx[2]), 2), + _mm_loadu_pd(tab + idx[3]), 3)); +} + +inline v_int32x16 v_lut(const int* tab, const v_int32x16& idxvec) +{ + return v_int32x16(_mm512_i32gather_epi32(idxvec.val, tab, 4)); +} + +inline v_uint32x16 v_lut(const unsigned* tab, const v_int32x16& idxvec) +{ + return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec)); +} + +inline v_float32x16 v_lut(const float* tab, const v_int32x16& idxvec) +{ + return v_float32x16(_mm512_i32gather_ps(idxvec.val, tab, 4)); +} + +inline v_float64x8 v_lut(const double* tab, const v_int32x16& idxvec) +{ + return v_float64x8(_mm512_i32gather_pd(_v512_extract_low(idxvec.val), tab, 8)); +} + +inline void v_lut_deinterleave(const float* tab, const v_int32x16& idxvec, v_float32x16& x, v_float32x16& y) +{ + x.val = _mm512_i32gather_ps(idxvec.val, tab, 4); + y.val = _mm512_i32gather_ps(idxvec.val, &tab[1], 4); +} + +inline void v_lut_deinterleave(const double* tab, const v_int32x16& idxvec, v_float64x8& x, v_float64x8& y) +{ + x.val = _mm512_i32gather_pd(_v512_extract_low(idxvec.val), tab, 8); + y.val = _mm512_i32gather_pd(_v512_extract_low(idxvec.val), &tab[1], 8); +} + +inline v_int8x64 v_interleave_pairs(const v_int8x64& vec) +{ + return v_int8x64(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0d0e0c, 0x0b090a08, 0x07050604, 0x03010200))); +} +inline v_uint8x64 v_interleave_pairs(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); } +inline v_int8x64 v_interleave_quads(const v_int8x64& vec) +{ + return v_int8x64(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0b0e0a, 0x0d090c08, 0x07030602, 0x05010400))); +} +inline v_uint8x64 v_interleave_quads(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); } + +inline v_int16x32 v_interleave_pairs(const v_int16x32& vec) +{ + return v_int16x32(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0e0b0a, 0x0d0c0908, 0x07060302, 0x05040100))); +} +inline v_uint16x32 v_interleave_pairs(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); } +inline v_int16x32 v_interleave_quads(const v_int16x32& vec) +{ + return v_int16x32(_mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0x0f0e0706, 0x0d0c0504, 0x0b0a0302, 0x09080100))); +} +inline v_uint16x32 v_interleave_quads(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); } + +inline v_int32x16 v_interleave_pairs(const v_int32x16& vec) +{ + return v_int32x16(_mm512_shuffle_epi32(vec.val, _MM_PERM_ACBD)); +} +inline v_uint32x16 v_interleave_pairs(const v_uint32x16& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); } +inline v_float32x16 v_interleave_pairs(const v_float32x16& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); } + +inline v_int8x64 v_pack_triplets(const v_int8x64& vec) +{ + return v_int8x64(_mm512_permutexvar_epi32(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a, + 0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000), + _mm512_shuffle_epi8(vec.val, _mm512_set4_epi32(0xffffff0f, 0x0e0d0c0a, 0x09080605, 0x04020100)))); +} +inline v_uint8x64 v_pack_triplets(const v_uint8x64& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); } + +inline v_int16x32 v_pack_triplets(const v_int16x32& vec) +{ + return v_int16x32(_mm512_permutexvar_epi16(_v512_set_epu64(0x001f001f001f001f, 0x001f001f001f001f, 0x001e001d001c001a, 0x0019001800160015, + 0x0014001200110010, 0x000e000d000c000a, 0x0009000800060005, 0x0004000200010000), vec.val)); +} +inline v_uint16x32 v_pack_triplets(const v_uint16x32& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); } + +inline v_int32x16 v_pack_triplets(const v_int32x16& vec) +{ + return v_int32x16(_mm512_permutexvar_epi32(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a, + 0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000), vec.val)); +} +inline v_uint32x16 v_pack_triplets(const v_uint32x16& vec) { return v_reinterpret_as_u32(v_pack_triplets(v_reinterpret_as_s32(vec))); } +inline v_float32x16 v_pack_triplets(const v_float32x16& vec) +{ + return v_float32x16(_mm512_permutexvar_ps(_v512_set_epu64(0x0000000f0000000f, 0x0000000f0000000f, 0x0000000e0000000d, 0x0000000c0000000a, + 0x0000000900000008, 0x0000000600000005, 0x0000000400000002, 0x0000000100000000), vec.val)); +} + +////////// Matrix operations ///////// + +//////// Dot Product //////// + +// 16 >> 32 +inline v_int32x16 v_dotprod(const v_int16x32& a, const v_int16x32& b) +{ return v_int32x16(_mm512_madd_epi16(a.val, b.val)); } +inline v_int32x16 v_dotprod(const v_int16x32& a, const v_int16x32& b, const v_int32x16& c) +{ return v_dotprod(a, b) + c; } + +// 32 >> 64 +inline v_int64x8 v_dotprod(const v_int32x16& a, const v_int32x16& b) +{ + __m512i even = _mm512_mul_epi32(a.val, b.val); + __m512i odd = _mm512_mul_epi32(_mm512_srli_epi64(a.val, 32), _mm512_srli_epi64(b.val, 32)); + return v_int64x8(_mm512_add_epi64(even, odd)); +} +inline v_int64x8 v_dotprod(const v_int32x16& a, const v_int32x16& b, const v_int64x8& c) +{ return v_dotprod(a, b) + c; } + +// 8 >> 32 +inline v_uint32x16 v_dotprod_expand(const v_uint8x64& a, const v_uint8x64& b) +{ + __m512i even_a = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, a.val, _mm512_setzero_si512()); + __m512i odd_a = _mm512_srli_epi16(a.val, 8); + + __m512i even_b = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, b.val, _mm512_setzero_si512()); + __m512i odd_b = _mm512_srli_epi16(b.val, 8); + + __m512i prod0 = _mm512_madd_epi16(even_a, even_b); + __m512i prod1 = _mm512_madd_epi16(odd_a, odd_b); + return v_uint32x16(_mm512_add_epi32(prod0, prod1)); +} +inline v_uint32x16 v_dotprod_expand(const v_uint8x64& a, const v_uint8x64& b, const v_uint32x16& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int32x16 v_dotprod_expand(const v_int8x64& a, const v_int8x64& b) +{ + __m512i even_a = _mm512_srai_epi16(_mm512_bslli_epi128(a.val, 1), 8); + __m512i odd_a = _mm512_srai_epi16(a.val, 8); + + __m512i even_b = _mm512_srai_epi16(_mm512_bslli_epi128(b.val, 1), 8); + __m512i odd_b = _mm512_srai_epi16(b.val, 8); + + __m512i prod0 = _mm512_madd_epi16(even_a, even_b); + __m512i prod1 = _mm512_madd_epi16(odd_a, odd_b); + return v_int32x16(_mm512_add_epi32(prod0, prod1)); +} +inline v_int32x16 v_dotprod_expand(const v_int8x64& a, const v_int8x64& b, const v_int32x16& c) +{ return v_dotprod_expand(a, b) + c; } + +// 16 >> 64 +inline v_uint64x8 v_dotprod_expand(const v_uint16x32& a, const v_uint16x32& b) +{ + __m512i mullo = _mm512_mullo_epi16(a.val, b.val); + __m512i mulhi = _mm512_mulhi_epu16(a.val, b.val); + __m512i mul0 = _mm512_unpacklo_epi16(mullo, mulhi); + __m512i mul1 = _mm512_unpackhi_epi16(mullo, mulhi); + + __m512i p02 = _mm512_mask_blend_epi32(0xAAAA, mul0, _mm512_setzero_si512()); + __m512i p13 = _mm512_srli_epi64(mul0, 32); + __m512i p46 = _mm512_mask_blend_epi32(0xAAAA, mul1, _mm512_setzero_si512()); + __m512i p57 = _mm512_srli_epi64(mul1, 32); + + __m512i p15_ = _mm512_add_epi64(p02, p13); + __m512i p9d_ = _mm512_add_epi64(p46, p57); + + return v_uint64x8(_mm512_add_epi64( + _mm512_unpacklo_epi64(p15_, p9d_), + _mm512_unpackhi_epi64(p15_, p9d_) + )); +} +inline v_uint64x8 v_dotprod_expand(const v_uint16x32& a, const v_uint16x32& b, const v_uint64x8& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x8 v_dotprod_expand(const v_int16x32& a, const v_int16x32& b) +{ + __m512i prod = _mm512_madd_epi16(a.val, b.val); + __m512i even = _mm512_srai_epi64(_mm512_bslli_epi128(prod, 4), 32); + __m512i odd = _mm512_srai_epi64(prod, 32); + return v_int64x8(_mm512_add_epi64(even, odd)); +} +inline v_int64x8 v_dotprod_expand(const v_int16x32& a, const v_int16x32& b, const v_int64x8& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x8 v_dotprod_expand(const v_int32x16& a, const v_int32x16& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x8 v_dotprod_expand(const v_int32x16& a, const v_int32x16& b, const v_float64x8& c) +{ return v_dotprod_expand(a, b) + c; } + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x16 v_dotprod_fast(const v_int16x32& a, const v_int16x32& b) +{ return v_dotprod(a, b); } +inline v_int32x16 v_dotprod_fast(const v_int16x32& a, const v_int16x32& b, const v_int32x16& c) +{ return v_dotprod(a, b, c); } + +// 32 >> 64 +inline v_int64x8 v_dotprod_fast(const v_int32x16& a, const v_int32x16& b) +{ return v_dotprod(a, b); } +inline v_int64x8 v_dotprod_fast(const v_int32x16& a, const v_int32x16& b, const v_int64x8& c) +{ return v_dotprod(a, b, c); } + +// 8 >> 32 +inline v_uint32x16 v_dotprod_expand_fast(const v_uint8x64& a, const v_uint8x64& b) +{ return v_dotprod_expand(a, b); } +inline v_uint32x16 v_dotprod_expand_fast(const v_uint8x64& a, const v_uint8x64& b, const v_uint32x16& c) +{ return v_dotprod_expand(a, b, c); } + +inline v_int32x16 v_dotprod_expand_fast(const v_int8x64& a, const v_int8x64& b) +{ return v_dotprod_expand(a, b); } +inline v_int32x16 v_dotprod_expand_fast(const v_int8x64& a, const v_int8x64& b, const v_int32x16& c) +{ return v_dotprod_expand(a, b, c); } + +// 16 >> 64 +inline v_uint64x8 v_dotprod_expand_fast(const v_uint16x32& a, const v_uint16x32& b) +{ + __m512i mullo = _mm512_mullo_epi16(a.val, b.val); + __m512i mulhi = _mm512_mulhi_epu16(a.val, b.val); + __m512i mul0 = _mm512_unpacklo_epi16(mullo, mulhi); + __m512i mul1 = _mm512_unpackhi_epi16(mullo, mulhi); + + __m512i p02 = _mm512_mask_blend_epi32(0xAAAA, mul0, _mm512_setzero_si512()); + __m512i p13 = _mm512_srli_epi64(mul0, 32); + __m512i p46 = _mm512_mask_blend_epi32(0xAAAA, mul1, _mm512_setzero_si512()); + __m512i p57 = _mm512_srli_epi64(mul1, 32); + + __m512i p15_ = _mm512_add_epi64(p02, p13); + __m512i p9d_ = _mm512_add_epi64(p46, p57); + return v_uint64x8(_mm512_add_epi64(p15_, p9d_)); +} +inline v_uint64x8 v_dotprod_expand_fast(const v_uint16x32& a, const v_uint16x32& b, const v_uint64x8& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +inline v_int64x8 v_dotprod_expand_fast(const v_int16x32& a, const v_int16x32& b) +{ return v_dotprod_expand(a, b); } +inline v_int64x8 v_dotprod_expand_fast(const v_int16x32& a, const v_int16x32& b, const v_int64x8& c) +{ return v_dotprod_expand(a, b, c); } + +// 32 >> 64f +inline v_float64x8 v_dotprod_expand_fast(const v_int32x16& a, const v_int32x16& b) +{ return v_dotprod_expand(a, b); } +inline v_float64x8 v_dotprod_expand_fast(const v_int32x16& a, const v_int32x16& b, const v_float64x8& c) +{ return v_dotprod_expand(a, b) + c; } + + +#define OPENCV_HAL_AVX512_SPLAT2_PS(a, im) \ + v_float32x16(_mm512_permute_ps(a.val, _MM_SHUFFLE(im, im, im, im))) + +inline v_float32x16 v_matmul(const v_float32x16& v, + const v_float32x16& m0, const v_float32x16& m1, + const v_float32x16& m2, const v_float32x16& m3) +{ + v_float32x16 v04 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 0); + v_float32x16 v15 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 1); + v_float32x16 v26 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 2); + v_float32x16 v37 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 3); + return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, v37 * m3))); +} + +inline v_float32x16 v_matmuladd(const v_float32x16& v, + const v_float32x16& m0, const v_float32x16& m1, + const v_float32x16& m2, const v_float32x16& a) +{ + v_float32x16 v04 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 0); + v_float32x16 v15 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 1); + v_float32x16 v26 = OPENCV_HAL_AVX512_SPLAT2_PS(v, 2); + return v_fma(v04, m0, v_fma(v15, m1, v_fma(v26, m2, a))); +} + +#define OPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(_Tpvec, suffix, cast_from, cast_to) \ + inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \ + const _Tpvec& a2, const _Tpvec& a3, \ + _Tpvec& b0, _Tpvec& b1, _Tpvec& b2, _Tpvec& b3) \ + { \ + __m512i t0 = cast_from(_mm512_unpacklo_##suffix(a0.val, a1.val)); \ + __m512i t1 = cast_from(_mm512_unpacklo_##suffix(a2.val, a3.val)); \ + __m512i t2 = cast_from(_mm512_unpackhi_##suffix(a0.val, a1.val)); \ + __m512i t3 = cast_from(_mm512_unpackhi_##suffix(a2.val, a3.val)); \ + b0.val = cast_to(_mm512_unpacklo_epi64(t0, t1)); \ + b1.val = cast_to(_mm512_unpackhi_epi64(t0, t1)); \ + b2.val = cast_to(_mm512_unpacklo_epi64(t2, t3)); \ + b3.val = cast_to(_mm512_unpackhi_epi64(t2, t3)); \ + } + +OPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_uint32x16, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_int32x16, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_AVX512_TRANSPOSE4x4(v_float32x16, ps, _mm512_castps_si512, _mm512_castsi512_ps) + +//////////////// Value reordering /////////////// + +/* Expand */ +#define OPENCV_HAL_IMPL_AVX512_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin) \ + inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ + { \ + b0.val = intrin(_v512_extract_low(a.val)); \ + b1.val = intrin(_v512_extract_high(a.val)); \ + } \ + inline _Tpwvec v_expand_low(const _Tpvec& a) \ + { return _Tpwvec(intrin(_v512_extract_low(a.val))); } \ + inline _Tpwvec v_expand_high(const _Tpvec& a) \ + { return _Tpwvec(intrin(_v512_extract_high(a.val))); } \ + inline _Tpwvec v512_load_expand(const _Tp* ptr) \ + { \ + __m256i a = _mm256_loadu_si256((const __m256i*)ptr); \ + return _Tpwvec(intrin(a)); \ + } + +OPENCV_HAL_IMPL_AVX512_EXPAND(v_uint8x64, v_uint16x32, uchar, _mm512_cvtepu8_epi16) +OPENCV_HAL_IMPL_AVX512_EXPAND(v_int8x64, v_int16x32, schar, _mm512_cvtepi8_epi16) +OPENCV_HAL_IMPL_AVX512_EXPAND(v_uint16x32, v_uint32x16, ushort, _mm512_cvtepu16_epi32) +OPENCV_HAL_IMPL_AVX512_EXPAND(v_int16x32, v_int32x16, short, _mm512_cvtepi16_epi32) +OPENCV_HAL_IMPL_AVX512_EXPAND(v_uint32x16, v_uint64x8, unsigned, _mm512_cvtepu32_epi64) +OPENCV_HAL_IMPL_AVX512_EXPAND(v_int32x16, v_int64x8, int, _mm512_cvtepi32_epi64) + +#define OPENCV_HAL_IMPL_AVX512_EXPAND_Q(_Tpvec, _Tp, intrin) \ + inline _Tpvec v512_load_expand_q(const _Tp* ptr) \ + { \ + __m128i a = _mm_loadu_si128((const __m128i*)ptr); \ + return _Tpvec(intrin(a)); \ + } + +OPENCV_HAL_IMPL_AVX512_EXPAND_Q(v_uint32x16, uchar, _mm512_cvtepu8_epi32) +OPENCV_HAL_IMPL_AVX512_EXPAND_Q(v_int32x16, schar, _mm512_cvtepi8_epi32) + +/* pack */ +// 16 +inline v_int8x64 v_pack(const v_int16x32& a, const v_int16x32& b) +{ return v_int8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi16(a.val, b.val))); } + +inline v_uint8x64 v_pack(const v_uint16x32& a, const v_uint16x32& b) +{ + const __m512i t = _mm512_set1_epi16(255); + return v_uint8x64(_v512_combine(_mm512_cvtepi16_epi8(_mm512_min_epu16(a.val, t)), _mm512_cvtepi16_epi8(_mm512_min_epu16(b.val, t)))); +} + +inline v_uint8x64 v_pack_u(const v_int16x32& a, const v_int16x32& b) +{ + return v_uint8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packus_epi16(a.val, b.val))); +} + +inline void v_pack_store(schar* ptr, const v_int16x32& a) +{ v_store_low(ptr, v_pack(a, a)); } + +inline void v_pack_store(uchar* ptr, const v_uint16x32& a) +{ + const __m512i m = _mm512_set1_epi16(255); + _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi16_epi8(_mm512_min_epu16(a.val, m))); +} + +inline void v_pack_u_store(uchar* ptr, const v_int16x32& a) +{ v_store_low(ptr, v_pack_u(a, a)); } + +template inline +v_uint8x64 v_rshr_pack(const v_uint16x32& a, const v_uint16x32& b) +{ + // we assume that n > 0, and so the shifted 16-bit values can be treated as signed numbers. + v_uint16x32 delta = v512_setall_u16((short)(1 << (n-1))); + return v_pack_u(v_reinterpret_as_s16((a + delta) >> n), + v_reinterpret_as_s16((b + delta) >> n)); +} + +template inline +void v_rshr_pack_store(uchar* ptr, const v_uint16x32& a) +{ + v_uint16x32 delta = v512_setall_u16((short)(1 << (n-1))); + v_pack_u_store(ptr, v_reinterpret_as_s16((a + delta) >> n)); +} + +template inline +v_uint8x64 v_rshr_pack_u(const v_int16x32& a, const v_int16x32& b) +{ + v_int16x32 delta = v512_setall_s16((short)(1 << (n-1))); + return v_pack_u((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_u_store(uchar* ptr, const v_int16x32& a) +{ + v_int16x32 delta = v512_setall_s16((short)(1 << (n-1))); + v_pack_u_store(ptr, (a + delta) >> n); +} + +template inline +v_int8x64 v_rshr_pack(const v_int16x32& a, const v_int16x32& b) +{ + v_int16x32 delta = v512_setall_s16((short)(1 << (n-1))); + return v_pack((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_store(schar* ptr, const v_int16x32& a) +{ + v_int16x32 delta = v512_setall_s16((short)(1 << (n-1))); + v_pack_store(ptr, (a + delta) >> n); +} + +// 32 +inline v_int16x32 v_pack(const v_int32x16& a, const v_int32x16& b) +{ return v_int16x32(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi32(a.val, b.val))); } + +inline v_uint16x32 v_pack(const v_uint32x16& a, const v_uint32x16& b) +{ + const __m512i m = _mm512_set1_epi32(65535); + return v_uint16x32(_v512_combine(_mm512_cvtepi32_epi16(_mm512_min_epu32(a.val, m)), _mm512_cvtepi32_epi16(_mm512_min_epu32(b.val, m)))); +} + +inline v_uint16x32 v_pack_u(const v_int32x16& a, const v_int32x16& b) +{ return v_uint16x32(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packus_epi32(a.val, b.val))); } + +inline void v_pack_store(short* ptr, const v_int32x16& a) +{ v_store_low(ptr, v_pack(a, a)); } + +inline void v_pack_store(ushort* ptr, const v_uint32x16& a) +{ + const __m512i m = _mm512_set1_epi32(65535); + _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi32_epi16(_mm512_min_epu32(a.val, m))); +} + +inline void v_pack_u_store(ushort* ptr, const v_int32x16& a) +{ v_store_low(ptr, v_pack_u(a, a)); } + + +template inline +v_uint16x32 v_rshr_pack(const v_uint32x16& a, const v_uint32x16& b) +{ + v_uint32x16 delta = v512_setall_u32(1 << (n-1)); + return v_pack_u(v_reinterpret_as_s32((a + delta) >> n), + v_reinterpret_as_s32((b + delta) >> n)); +} + +template inline +void v_rshr_pack_store(ushort* ptr, const v_uint32x16& a) +{ + v_uint32x16 delta = v512_setall_u32(1 << (n-1)); + v_pack_u_store(ptr, v_reinterpret_as_s32((a + delta) >> n)); +} + +template inline +v_uint16x32 v_rshr_pack_u(const v_int32x16& a, const v_int32x16& b) +{ + v_int32x16 delta = v512_setall_s32(1 << (n-1)); + return v_pack_u((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_u_store(ushort* ptr, const v_int32x16& a) +{ + v_int32x16 delta = v512_setall_s32(1 << (n-1)); + v_pack_u_store(ptr, (a + delta) >> n); +} + +template inline +v_int16x32 v_rshr_pack(const v_int32x16& a, const v_int32x16& b) +{ + v_int32x16 delta = v512_setall_s32(1 << (n-1)); + return v_pack((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_store(short* ptr, const v_int32x16& a) +{ + v_int32x16 delta = v512_setall_s32(1 << (n-1)); + v_pack_store(ptr, (a + delta) >> n); +} + +// 64 +// Non-saturating pack +inline v_uint32x16 v_pack(const v_uint64x8& a, const v_uint64x8& b) +{ return v_uint32x16(_v512_combine(_mm512_cvtepi64_epi32(a.val), _mm512_cvtepi64_epi32(b.val))); } + +inline v_int32x16 v_pack(const v_int64x8& a, const v_int64x8& b) +{ return v_reinterpret_as_s32(v_pack(v_reinterpret_as_u64(a), v_reinterpret_as_u64(b))); } + +inline void v_pack_store(unsigned* ptr, const v_uint64x8& a) +{ _mm256_storeu_si256((__m256i*)ptr, _mm512_cvtepi64_epi32(a.val)); } + +inline void v_pack_store(int* ptr, const v_int64x8& b) +{ v_pack_store((unsigned*)ptr, v_reinterpret_as_u64(b)); } + +template inline +v_uint32x16 v_rshr_pack(const v_uint64x8& a, const v_uint64x8& b) +{ + v_uint64x8 delta = v512_setall_u64((uint64)1 << (n-1)); + return v_pack((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_store(unsigned* ptr, const v_uint64x8& a) +{ + v_uint64x8 delta = v512_setall_u64((uint64)1 << (n-1)); + v_pack_store(ptr, (a + delta) >> n); +} + +template inline +v_int32x16 v_rshr_pack(const v_int64x8& a, const v_int64x8& b) +{ + v_int64x8 delta = v512_setall_s64((int64)1 << (n-1)); + return v_pack((a + delta) >> n, (b + delta) >> n); +} + +template inline +void v_rshr_pack_store(int* ptr, const v_int64x8& a) +{ + v_int64x8 delta = v512_setall_s64((int64)1 << (n-1)); + v_pack_store(ptr, (a + delta) >> n); +} + +// pack boolean +inline v_uint8x64 v_pack_b(const v_uint16x32& a, const v_uint16x32& b) +{ return v_uint8x64(_mm512_permutexvar_epi64(_v512_set_epu64(7, 5, 3, 1, 6, 4, 2, 0), _mm512_packs_epi16(a.val, b.val))); } + +inline v_uint8x64 v_pack_b(const v_uint32x16& a, const v_uint32x16& b, + const v_uint32x16& c, const v_uint32x16& d) +{ + __m512i ab = _mm512_packs_epi32(a.val, b.val); + __m512i cd = _mm512_packs_epi32(c.val, d.val); + + return v_uint8x64(_mm512_permutexvar_epi32(_v512_set_epu32(15, 11, 7, 3, 14, 10, 6, 2, 13, 9, 5, 1, 12, 8, 4, 0), _mm512_packs_epi16(ab, cd))); +} + +inline v_uint8x64 v_pack_b(const v_uint64x8& a, const v_uint64x8& b, const v_uint64x8& c, + const v_uint64x8& d, const v_uint64x8& e, const v_uint64x8& f, + const v_uint64x8& g, const v_uint64x8& h) +{ + __m512i ab = _mm512_packs_epi32(a.val, b.val); + __m512i cd = _mm512_packs_epi32(c.val, d.val); + __m512i ef = _mm512_packs_epi32(e.val, f.val); + __m512i gh = _mm512_packs_epi32(g.val, h.val); + + __m512i abcd = _mm512_packs_epi32(ab, cd); + __m512i efgh = _mm512_packs_epi32(ef, gh); + + return v_uint8x64(_mm512_permutexvar_epi16(_v512_set_epu16(31, 23, 15, 7, 30, 22, 14, 6, 29, 21, 13, 5, 28, 20, 12, 4, + 27, 19, 11, 3, 26, 18, 10, 2, 25, 17, 9, 1, 24, 16, 8, 0), _mm512_packs_epi16(abcd, efgh))); +} + +/* Recombine */ +// its up there with load and store operations + +/* Extract */ +#define OPENCV_HAL_IMPL_AVX512_EXTRACT(_Tpvec) \ + template \ + inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \ + { return v_rotate_right(a, b); } + +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint8x64) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_int8x64) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint16x32) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_int16x32) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint32x16) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_int32x16) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_uint64x8) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_int64x8) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_float32x16) +OPENCV_HAL_IMPL_AVX512_EXTRACT(v_float64x8) + +#define OPENCV_HAL_IMPL_AVX512_EXTRACT_N(_Tpvec, _Tp) \ +template inline _Tp v_extract_n(_Tpvec v) { return v_rotate_right(v).get0(); } + +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint8x64, uchar) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int8x64, schar) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint16x32, ushort) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int16x32, short) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint32x16, uint) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int32x16, int) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_uint64x8, uint64) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_int64x8, int64) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_float32x16, float) +OPENCV_HAL_IMPL_AVX512_EXTRACT_N(v_float64x8, double) + +template +inline v_uint32x16 v_broadcast_element(v_uint32x16 a) +{ + static const __m512i perm = _mm512_set1_epi32((char)i); + return v_uint32x16(_mm512_permutexvar_epi32(perm, a.val)); +} + +template +inline v_int32x16 v_broadcast_element(const v_int32x16 &a) +{ return v_reinterpret_as_s32(v_broadcast_element(v_reinterpret_as_u32(a))); } + +template +inline v_float32x16 v_broadcast_element(const v_float32x16 &a) +{ return v_reinterpret_as_f32(v_broadcast_element(v_reinterpret_as_u32(a))); } + + +///////////////////// load deinterleave ///////////////////////////// + +inline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b ) +{ + __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 64)); +#if CV_AVX_512VBMI + __m512i mask0 = _v512_set_epu8(126, 124, 122, 120, 118, 116, 114, 112, 110, 108, 106, 104, 102, 100, 98, 96, + 94, 92, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 68, 66, 64, + 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu8(127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, 105, 103, 101, 99, 97, + 95, 93, 91, 89, 87, 85, 83, 81, 79, 77, 75, 73, 71, 69, 67, 65, + 63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, + 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + a = v_uint8x64(_mm512_permutex2var_epi8(ab0, mask0, ab1)); + b = v_uint8x64(_mm512_permutex2var_epi8(ab0, mask1, ab1)); +#else + __m512i mask0 = _mm512_set4_epi32(0x0f0d0b09, 0x07050301, 0x0e0c0a08, 0x06040200); + __m512i a0b0 = _mm512_shuffle_epi8(ab0, mask0); + __m512i a1b1 = _mm512_shuffle_epi8(ab1, mask0); + __m512i mask1 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask2 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1); + a = v_uint8x64(_mm512_permutex2var_epi64(a0b0, mask1, a1b1)); + b = v_uint8x64(_mm512_permutex2var_epi64(a0b0, mask2, a1b1)); +#endif +} + +inline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b ) +{ + __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 32)); + __m512i mask0 = _v512_set_epu16(62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu16(63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, + 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + a = v_uint16x32(_mm512_permutex2var_epi16(ab0, mask0, ab1)); + b = v_uint16x32(_mm512_permutex2var_epi16(ab0, mask1, ab1)); +} + +inline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b ) +{ + __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 16)); + __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + a = v_uint32x16(_mm512_permutex2var_epi32(ab0, mask0, ab1)); + b = v_uint32x16(_mm512_permutex2var_epi32(ab0, mask1, ab1)); +} + +inline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b ) +{ + __m512i ab0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i ab1 = _mm512_loadu_si512((const __m512i*)(ptr + 8)); + __m512i mask0 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1); + a = v_uint64x8(_mm512_permutex2var_epi64(ab0, mask0, ab1)); + b = v_uint64x8(_mm512_permutex2var_epi64(ab0, mask1, ab1)); +} + +inline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b, v_uint8x64& c ) +{ + __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 64)); + __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 128)); + +#if CV_AVX_512VBMI2 + __m512i mask0 = _v512_set_epu8(126, 123, 120, 117, 114, 111, 108, 105, 102, 99, 96, 93, 90, 87, 84, 81, + 78, 75, 72, 69, 66, 63, 60, 57, 54, 51, 48, 45, 42, 39, 36, 33, + 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0, 62, 59, 56, 53, 50, + 47, 44, 41, 38, 35, 32, 29, 26, 23, 20, 17, 14, 11, 8, 5, 2); + __m512i r0b01 = _mm512_permutex2var_epi8(bgr0, mask0, bgr1); + __m512i b1g12 = _mm512_permutex2var_epi8(bgr1, mask0, bgr2); + __m512i r12b2 = _mm512_permutex2var_epi8(bgr1, + _v512_set_epu8(125, 122, 119, 116, 113, 110, 107, 104, 101, 98, 95, 92, 89, 86, 83, 80, + 77, 74, 71, 68, 65, 127, 124, 121, 118, 115, 112, 109, 106, 103, 100, 97, + 94, 91, 88, 85, 82, 79, 76, 73, 70, 67, 64, 61, 58, 55, 52, 49, + 46, 43, 40, 37, 34, 31, 28, 25, 22, 19, 16, 13, 10, 7, 4, 1), bgr2); + a = v_uint8x64(_mm512_mask_compress_epi8(r12b2, 0xffffffffffe00000, r0b01)); + b = v_uint8x64(_mm512_mask_compress_epi8(b1g12, 0x2492492492492492, bgr0)); + c = v_uint8x64(_mm512_mask_expand_epi8(r0b01, 0xffffffffffe00000, r12b2)); +#elif CV_AVX_512VBMI + __m512i b0g0b1 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr1, bgr0); + __m512i g1r1g2 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr2, bgr1); + __m512i r2b2r0 = _mm512_mask_blend_epi8(0xb6db6db6db6db6db, bgr0, bgr2); + a = v_uint8x64(_mm512_permutex2var_epi8(b0g0b1, _v512_set_epu8(125, 122, 119, 116, 113, 110, 107, 104, 101, 98, 95, 92, 89, 86, 83, 80, + 77, 74, 71, 68, 65, 63, 61, 60, 58, 57, 55, 54, 52, 51, 49, 48, + 46, 45, 43, 42, 40, 39, 37, 36, 34, 33, 31, 30, 28, 27, 25, 24, + 23, 21, 20, 18, 17, 15, 14, 12, 11, 9, 8, 6, 5, 3, 2, 0), bgr2)); + b = v_uint8x64(_mm512_permutex2var_epi8(g1r1g2, _v512_set_epu8( 63, 61, 60, 58, 57, 55, 54, 52, 51, 49, 48, 46, 45, 43, 42, 40, + 39, 37, 36, 34, 33, 31, 30, 28, 27, 25, 24, 23, 21, 20, 18, 17, + 15, 14, 12, 11, 9, 8, 6, 5, 3, 2, 0, 126, 123, 120, 117, 114, + 111, 108, 105, 102, 99, 96, 93, 90, 87, 84, 81, 78, 75, 72, 69, 66), bgr0)); + c = v_uint8x64(_mm512_permutex2var_epi8(r2b2r0, _v512_set_epu8( 63, 60, 57, 54, 51, 48, 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, + 15, 12, 9, 6, 3, 0, 125, 122, 119, 116, 113, 110, 107, 104, 101, 98, + 95, 92, 89, 86, 83, 80, 77, 74, 71, 68, 65, 62, 59, 56, 53, 50, + 47, 44, 41, 38, 35, 32, 29, 26, 23, 20, 17, 14, 11, 8, 5, 2), bgr1)); +#else + __m512i mask0 = _v512_set_epu16(61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 63, 60, 57, 54, 51, 48, + 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0); + __m512i b01g1 = _mm512_permutex2var_epi16(bgr0, mask0, bgr1); + __m512i r12b2 = _mm512_permutex2var_epi16(bgr1, mask0, bgr2); + __m512i g20r0 = _mm512_permutex2var_epi16(bgr2, mask0, bgr0); + + __m512i b0g0 = _mm512_mask_blend_epi32(0xf800, b01g1, r12b2); + __m512i r0b1 = _mm512_permutex2var_epi16(bgr1, _v512_set_epu16(42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 29, 26, 23, 20, 17, + 14, 11, 8, 5, 2, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43), g20r0); + __m512i g1r1 = _mm512_alignr_epi32(r12b2, g20r0, 11); + a = v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, b0g0, r0b1)); + c = v_uint8x64(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, r0b1, g1r1)); + b = v_uint8x64(_mm512_shuffle_epi8(_mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, g1r1, b0g0), _mm512_set4_epi32(0x0e0f0c0d, 0x0a0b0809, 0x06070405, 0x02030001))); +#endif +} + +inline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b, v_uint16x32& c ) +{ + __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 32)); + __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 64)); + + __m512i mask0 = _v512_set_epu16(61, 58, 55, 52, 49, 46, 43, 40, 37, 34, 63, 60, 57, 54, 51, 48, + 45, 42, 39, 36, 33, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0); + __m512i b01g1 = _mm512_permutex2var_epi16(bgr0, mask0, bgr1); + __m512i r12b2 = _mm512_permutex2var_epi16(bgr1, mask0, bgr2); + __m512i g20r0 = _mm512_permutex2var_epi16(bgr2, mask0, bgr0); + + a = v_uint16x32(_mm512_mask_blend_epi32(0xf800, b01g1, r12b2)); + b = v_uint16x32(_mm512_permutex2var_epi16(bgr1, _v512_set_epu16(42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 29, 26, 23, 20, 17, + 14, 11, 8, 5, 2, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43), g20r0)); + c = v_uint16x32(_mm512_alignr_epi32(r12b2, g20r0, 11)); +} + +inline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b, v_uint32x16& c ) +{ + __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 16)); + __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 32)); + + __m512i mask0 = _v512_set_epu32(29, 26, 23, 20, 17, 30, 27, 24, 21, 18, 15, 12, 9, 6, 3, 0); + __m512i b01r1 = _mm512_permutex2var_epi32(bgr0, mask0, bgr1); + __m512i g12b2 = _mm512_permutex2var_epi32(bgr1, mask0, bgr2); + __m512i r20g0 = _mm512_permutex2var_epi32(bgr2, mask0, bgr0); + + a = v_uint32x16(_mm512_mask_blend_epi32(0xf800, b01r1, g12b2)); + b = v_uint32x16(_mm512_alignr_epi32(g12b2, r20g0, 11)); + c = v_uint32x16(_mm512_permutex2var_epi32(bgr1, _v512_set_epu32(21, 20, 19, 18, 17, 16, 13, 10, 7, 4, 1, 26, 25, 24, 23, 22), r20g0)); +} + +inline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b, v_uint64x8& c ) +{ + __m512i bgr0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgr1 = _mm512_loadu_si512((const __m512i*)(ptr + 8)); + __m512i bgr2 = _mm512_loadu_si512((const __m512i*)(ptr + 16)); + + __m512i mask0 = _v512_set_epu64(13, 10, 15, 12, 9, 6, 3, 0); + __m512i b01g1 = _mm512_permutex2var_epi64(bgr0, mask0, bgr1); + __m512i r12b2 = _mm512_permutex2var_epi64(bgr1, mask0, bgr2); + __m512i g20r0 = _mm512_permutex2var_epi64(bgr2, mask0, bgr0); + + a = v_uint64x8(_mm512_mask_blend_epi64(0xc0, b01g1, r12b2)); + c = v_uint64x8(_mm512_alignr_epi64(r12b2, g20r0, 6)); + b = v_uint64x8(_mm512_permutex2var_epi64(bgr1, _v512_set_epu64(10, 9, 8, 5, 2, 13, 12, 11), g20r0)); +} + +inline void v_load_deinterleave( const uchar* ptr, v_uint8x64& a, v_uint8x64& b, v_uint8x64& c, v_uint8x64& d ) +{ + __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 64)); + __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 128)); + __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 192)); + +#if CV_AVX_512VBMI + __m512i mask0 = _v512_set_epu8(126, 124, 122, 120, 118, 116, 114, 112, 110, 108, 106, 104, 102, 100, 98, 96, + 94, 92, 90, 88, 86, 84, 82, 80, 78, 76, 74, 72, 70, 68, 66, 64, + 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu8(127, 125, 123, 121, 119, 117, 115, 113, 111, 109, 107, 105, 103, 101, 99, 97, + 95, 93, 91, 89, 87, 85, 83, 81, 79, 77, 75, 73, 71, 69, 67, 65, + 63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, + 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + + __m512i br01 = _mm512_permutex2var_epi8(bgra0, mask0, bgra1); + __m512i ga01 = _mm512_permutex2var_epi8(bgra0, mask1, bgra1); + __m512i br23 = _mm512_permutex2var_epi8(bgra2, mask0, bgra3); + __m512i ga23 = _mm512_permutex2var_epi8(bgra2, mask1, bgra3); + + a = v_uint8x64(_mm512_permutex2var_epi8(br01, mask0, br23)); + c = v_uint8x64(_mm512_permutex2var_epi8(br01, mask1, br23)); + b = v_uint8x64(_mm512_permutex2var_epi8(ga01, mask0, ga23)); + d = v_uint8x64(_mm512_permutex2var_epi8(ga01, mask1, ga23)); +#else + __m512i mask = _mm512_set4_epi32(0x0f0b0703, 0x0e0a0602, 0x0d090501, 0x0c080400); + __m512i b0g0r0a0 = _mm512_shuffle_epi8(bgra0, mask); + __m512i b1g1r1a1 = _mm512_shuffle_epi8(bgra1, mask); + __m512i b2g2r2a2 = _mm512_shuffle_epi8(bgra2, mask); + __m512i b3g3r3a3 = _mm512_shuffle_epi8(bgra3, mask); + + __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + + __m512i br01 = _mm512_permutex2var_epi32(b0g0r0a0, mask0, b1g1r1a1); + __m512i ga01 = _mm512_permutex2var_epi32(b0g0r0a0, mask1, b1g1r1a1); + __m512i br23 = _mm512_permutex2var_epi32(b2g2r2a2, mask0, b3g3r3a3); + __m512i ga23 = _mm512_permutex2var_epi32(b2g2r2a2, mask1, b3g3r3a3); + + a = v_uint8x64(_mm512_permutex2var_epi32(br01, mask0, br23)); + c = v_uint8x64(_mm512_permutex2var_epi32(br01, mask1, br23)); + b = v_uint8x64(_mm512_permutex2var_epi32(ga01, mask0, ga23)); + d = v_uint8x64(_mm512_permutex2var_epi32(ga01, mask1, ga23)); +#endif +} + +inline void v_load_deinterleave( const ushort* ptr, v_uint16x32& a, v_uint16x32& b, v_uint16x32& c, v_uint16x32& d ) +{ + __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 32)); + __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 64)); + __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 96)); + + __m512i mask0 = _v512_set_epu16(62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 36, 34, 32, + 30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu16(63, 61, 59, 57, 55, 53, 51, 49, 47, 45, 43, 41, 39, 37, 35, 33, + 31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + + __m512i br01 = _mm512_permutex2var_epi16(bgra0, mask0, bgra1); + __m512i ga01 = _mm512_permutex2var_epi16(bgra0, mask1, bgra1); + __m512i br23 = _mm512_permutex2var_epi16(bgra2, mask0, bgra3); + __m512i ga23 = _mm512_permutex2var_epi16(bgra2, mask1, bgra3); + + a = v_uint16x32(_mm512_permutex2var_epi16(br01, mask0, br23)); + c = v_uint16x32(_mm512_permutex2var_epi16(br01, mask1, br23)); + b = v_uint16x32(_mm512_permutex2var_epi16(ga01, mask0, ga23)); + d = v_uint16x32(_mm512_permutex2var_epi16(ga01, mask1, ga23)); +} + +inline void v_load_deinterleave( const unsigned* ptr, v_uint32x16& a, v_uint32x16& b, v_uint32x16& c, v_uint32x16& d ) +{ + __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 16)); + __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 32)); + __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 48)); + + __m512i mask0 = _v512_set_epu32(30, 28, 26, 24, 22, 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu32(31, 29, 27, 25, 23, 21, 19, 17, 15, 13, 11, 9, 7, 5, 3, 1); + + __m512i br01 = _mm512_permutex2var_epi32(bgra0, mask0, bgra1); + __m512i ga01 = _mm512_permutex2var_epi32(bgra0, mask1, bgra1); + __m512i br23 = _mm512_permutex2var_epi32(bgra2, mask0, bgra3); + __m512i ga23 = _mm512_permutex2var_epi32(bgra2, mask1, bgra3); + + a = v_uint32x16(_mm512_permutex2var_epi32(br01, mask0, br23)); + c = v_uint32x16(_mm512_permutex2var_epi32(br01, mask1, br23)); + b = v_uint32x16(_mm512_permutex2var_epi32(ga01, mask0, ga23)); + d = v_uint32x16(_mm512_permutex2var_epi32(ga01, mask1, ga23)); +} + +inline void v_load_deinterleave( const uint64* ptr, v_uint64x8& a, v_uint64x8& b, v_uint64x8& c, v_uint64x8& d ) +{ + __m512i bgra0 = _mm512_loadu_si512((const __m512i*)ptr); + __m512i bgra1 = _mm512_loadu_si512((const __m512i*)(ptr + 8)); + __m512i bgra2 = _mm512_loadu_si512((const __m512i*)(ptr + 16)); + __m512i bgra3 = _mm512_loadu_si512((const __m512i*)(ptr + 24)); + + __m512i mask0 = _v512_set_epu64(14, 12, 10, 8, 6, 4, 2, 0); + __m512i mask1 = _v512_set_epu64(15, 13, 11, 9, 7, 5, 3, 1); + + __m512i br01 = _mm512_permutex2var_epi64(bgra0, mask0, bgra1); + __m512i ga01 = _mm512_permutex2var_epi64(bgra0, mask1, bgra1); + __m512i br23 = _mm512_permutex2var_epi64(bgra2, mask0, bgra3); + __m512i ga23 = _mm512_permutex2var_epi64(bgra2, mask1, bgra3); + + a = v_uint64x8(_mm512_permutex2var_epi64(br01, mask0, br23)); + c = v_uint64x8(_mm512_permutex2var_epi64(br01, mask1, br23)); + b = v_uint64x8(_mm512_permutex2var_epi64(ga01, mask0, ga23)); + d = v_uint64x8(_mm512_permutex2var_epi64(ga01, mask1, ga23)); +} + +///////////////////////////// store interleave ///////////////////////////////////// + +inline void v_store_interleave( uchar* ptr, const v_uint8x64& x, const v_uint8x64& y, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint8x64 low, high; + v_zip(x, y, low, high); + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, low.val); + _mm512_stream_si512((__m512i*)(ptr + 64), high.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, low.val); + _mm512_store_si512((__m512i*)(ptr + 64), high.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, low.val); + _mm512_storeu_si512((__m512i*)(ptr + 64), high.val); + } +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x32& x, const v_uint16x32& y, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint16x32 low, high; + v_zip(x, y, low, high); + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, low.val); + _mm512_stream_si512((__m512i*)(ptr + 32), high.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, low.val); + _mm512_store_si512((__m512i*)(ptr + 32), high.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, low.val); + _mm512_storeu_si512((__m512i*)(ptr + 32), high.val); + } +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x16& x, const v_uint32x16& y, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint32x16 low, high; + v_zip(x, y, low, high); + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, low.val); + _mm512_stream_si512((__m512i*)(ptr + 16), high.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, low.val); + _mm512_store_si512((__m512i*)(ptr + 16), high.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, low.val); + _mm512_storeu_si512((__m512i*)(ptr + 16), high.val); + } +} + +inline void v_store_interleave( uint64* ptr, const v_uint64x8& x, const v_uint64x8& y, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint64x8 low, high; + v_zip(x, y, low, high); + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, low.val); + _mm512_stream_si512((__m512i*)(ptr + 8), high.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, low.val); + _mm512_store_si512((__m512i*)(ptr + 8), high.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, low.val); + _mm512_storeu_si512((__m512i*)(ptr + 8), high.val); + } +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x64& a, const v_uint8x64& b, const v_uint8x64& c, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ +#if CV_AVX_512VBMI + __m512i mask0 = _v512_set_epu8(127, 84, 20, 126, 83, 19, 125, 82, 18, 124, 81, 17, 123, 80, 16, 122, + 79, 15, 121, 78, 14, 120, 77, 13, 119, 76, 12, 118, 75, 11, 117, 74, + 10, 116, 73, 9, 115, 72, 8, 114, 71, 7, 113, 70, 6, 112, 69, 5, + 111, 68, 4, 110, 67, 3, 109, 66, 2, 108, 65, 1, 107, 64, 0, 106); + __m512i mask1 = _v512_set_epu8( 21, 42, 105, 20, 41, 104, 19, 40, 103, 18, 39, 102, 17, 38, 101, 16, + 37, 100, 15, 36, 99, 14, 35, 98, 13, 34, 97, 12, 33, 96, 11, 32, + 95, 10, 31, 94, 9, 30, 93, 8, 29, 92, 7, 28, 91, 6, 27, 90, + 5, 26, 89, 4, 25, 88, 3, 24, 87, 2, 23, 86, 1, 22, 85, 0); + __m512i mask2 = _v512_set_epu8(106, 127, 63, 105, 126, 62, 104, 125, 61, 103, 124, 60, 102, 123, 59, 101, + 122, 58, 100, 121, 57, 99, 120, 56, 98, 119, 55, 97, 118, 54, 96, 117, + 53, 95, 116, 52, 94, 115, 51, 93, 114, 50, 92, 113, 49, 91, 112, 48, + 90, 111, 47, 89, 110, 46, 88, 109, 45, 87, 108, 44, 86, 107, 43, 85); + __m512i r2g0r0 = _mm512_permutex2var_epi8(b.val, mask0, c.val); + __m512i b0r1b1 = _mm512_permutex2var_epi8(a.val, mask1, c.val); + __m512i g1b2g2 = _mm512_permutex2var_epi8(a.val, mask2, b.val); + + __m512i bgr0 = _mm512_mask_blend_epi8(0x9249249249249249, r2g0r0, b0r1b1); + __m512i bgr1 = _mm512_mask_blend_epi8(0x9249249249249249, b0r1b1, g1b2g2); + __m512i bgr2 = _mm512_mask_blend_epi8(0x9249249249249249, g1b2g2, r2g0r0); +#else + __m512i g1g0 = _mm512_shuffle_epi8(b.val, _mm512_set4_epi32(0x0e0f0c0d, 0x0a0b0809, 0x06070405, 0x02030001)); + __m512i b0g0 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, a.val, g1g0); + __m512i r0b1 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, c.val, a.val); + __m512i g1r1 = _mm512_mask_blend_epi8(0xAAAAAAAAAAAAAAAA, g1g0, c.val); + + __m512i mask0 = _v512_set_epu16(42, 10, 31, 41, 9, 30, 40, 8, 29, 39, 7, 28, 38, 6, 27, 37, + 5, 26, 36, 4, 25, 35, 3, 24, 34, 2, 23, 33, 1, 22, 32, 0); + __m512i mask1 = _v512_set_epu16(21, 52, 41, 20, 51, 40, 19, 50, 39, 18, 49, 38, 17, 48, 37, 16, + 47, 36, 15, 46, 35, 14, 45, 34, 13, 44, 33, 12, 43, 32, 11, 42); + __m512i mask2 = _v512_set_epu16(63, 31, 20, 62, 30, 19, 61, 29, 18, 60, 28, 17, 59, 27, 16, 58, + 26, 15, 57, 25, 14, 56, 24, 13, 55, 23, 12, 54, 22, 11, 53, 21); + __m512i b0g0b2 = _mm512_permutex2var_epi16(b0g0, mask0, r0b1); + __m512i r1b1r0 = _mm512_permutex2var_epi16(b0g0, mask1, g1r1); + __m512i g2r2g1 = _mm512_permutex2var_epi16(r0b1, mask2, g1r1); + + __m512i bgr0 = _mm512_mask_blend_epi16(0x24924924, b0g0b2, r1b1r0); + __m512i bgr1 = _mm512_mask_blend_epi16(0x24924924, r1b1r0, g2r2g1); + __m512i bgr2 = _mm512_mask_blend_epi16(0x24924924, g2r2g1, b0g0b2); +#endif + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgr0); + _mm512_stream_si512((__m512i*)(ptr + 64), bgr1); + _mm512_stream_si512((__m512i*)(ptr + 128), bgr2); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgr0); + _mm512_store_si512((__m512i*)(ptr + 64), bgr1); + _mm512_store_si512((__m512i*)(ptr + 128), bgr2); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgr0); + _mm512_storeu_si512((__m512i*)(ptr + 64), bgr1); + _mm512_storeu_si512((__m512i*)(ptr + 128), bgr2); + } +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x32& a, const v_uint16x32& b, const v_uint16x32& c, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + __m512i mask0 = _v512_set_epu16(42, 10, 31, 41, 9, 30, 40, 8, 29, 39, 7, 28, 38, 6, 27, 37, + 5, 26, 36, 4, 25, 35, 3, 24, 34, 2, 23, 33, 1, 22, 32, 0); + __m512i mask1 = _v512_set_epu16(21, 52, 41, 20, 51, 40, 19, 50, 39, 18, 49, 38, 17, 48, 37, 16, + 47, 36, 15, 46, 35, 14, 45, 34, 13, 44, 33, 12, 43, 32, 11, 42); + __m512i mask2 = _v512_set_epu16(63, 31, 20, 62, 30, 19, 61, 29, 18, 60, 28, 17, 59, 27, 16, 58, + 26, 15, 57, 25, 14, 56, 24, 13, 55, 23, 12, 54, 22, 11, 53, 21); + __m512i b0g0b2 = _mm512_permutex2var_epi16(a.val, mask0, b.val); + __m512i r1b1r0 = _mm512_permutex2var_epi16(a.val, mask1, c.val); + __m512i g2r2g1 = _mm512_permutex2var_epi16(b.val, mask2, c.val); + + __m512i bgr0 = _mm512_mask_blend_epi16(0x24924924, b0g0b2, r1b1r0); + __m512i bgr1 = _mm512_mask_blend_epi16(0x24924924, r1b1r0, g2r2g1); + __m512i bgr2 = _mm512_mask_blend_epi16(0x24924924, g2r2g1, b0g0b2); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgr0); + _mm512_stream_si512((__m512i*)(ptr + 32), bgr1); + _mm512_stream_si512((__m512i*)(ptr + 64), bgr2); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgr0); + _mm512_store_si512((__m512i*)(ptr + 32), bgr1); + _mm512_store_si512((__m512i*)(ptr + 64), bgr2); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgr0); + _mm512_storeu_si512((__m512i*)(ptr + 32), bgr1); + _mm512_storeu_si512((__m512i*)(ptr + 64), bgr2); + } +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x16& a, const v_uint32x16& b, const v_uint32x16& c, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + __m512i mask0 = _v512_set_epu32(26, 31, 15, 25, 30, 14, 24, 29, 13, 23, 28, 12, 22, 27, 11, 21); + __m512i mask1 = _v512_set_epu32(31, 10, 25, 30, 9, 24, 29, 8, 23, 28, 7, 22, 27, 6, 21, 26); + __m512i g1b2g2 = _mm512_permutex2var_epi32(a.val, mask0, b.val); + __m512i r2r1b1 = _mm512_permutex2var_epi32(a.val, mask1, c.val); + + __m512i bgr0 = _mm512_mask_expand_epi32(_mm512_mask_expand_epi32(_mm512_maskz_expand_epi32(0x9249, a.val), 0x2492, b.val), 0x4924, c.val); + __m512i bgr1 = _mm512_mask_blend_epi32(0x9249, r2r1b1, g1b2g2); + __m512i bgr2 = _mm512_mask_blend_epi32(0x9249, g1b2g2, r2r1b1); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgr0); + _mm512_stream_si512((__m512i*)(ptr + 16), bgr1); + _mm512_stream_si512((__m512i*)(ptr + 32), bgr2); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgr0); + _mm512_store_si512((__m512i*)(ptr + 16), bgr1); + _mm512_store_si512((__m512i*)(ptr + 32), bgr2); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgr0); + _mm512_storeu_si512((__m512i*)(ptr + 16), bgr1); + _mm512_storeu_si512((__m512i*)(ptr + 32), bgr2); + } +} + +inline void v_store_interleave( uint64* ptr, const v_uint64x8& a, const v_uint64x8& b, const v_uint64x8& c, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + __m512i mask0 = _v512_set_epu64( 5, 12, 7, 4, 11, 6, 3, 10); + __m512i mask1 = _v512_set_epu64(15, 7, 4, 14, 6, 3, 13, 5); + __m512i r1b1b2 = _mm512_permutex2var_epi64(a.val, mask0, c.val); + __m512i g2r2g1 = _mm512_permutex2var_epi64(b.val, mask1, c.val); + + __m512i bgr0 = _mm512_mask_expand_epi64(_mm512_mask_expand_epi64(_mm512_maskz_expand_epi64(0x49, a.val), 0x92, b.val), 0x24, c.val); + __m512i bgr1 = _mm512_mask_blend_epi64(0xdb, g2r2g1, r1b1b2); + __m512i bgr2 = _mm512_mask_blend_epi64(0xdb, r1b1b2, g2r2g1); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgr0); + _mm512_stream_si512((__m512i*)(ptr + 8), bgr1); + _mm512_stream_si512((__m512i*)(ptr + 16), bgr2); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgr0); + _mm512_store_si512((__m512i*)(ptr + 8), bgr1); + _mm512_store_si512((__m512i*)(ptr + 16), bgr2); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgr0); + _mm512_storeu_si512((__m512i*)(ptr + 8), bgr1); + _mm512_storeu_si512((__m512i*)(ptr + 16), bgr2); + } +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x64& a, const v_uint8x64& b, + const v_uint8x64& c, const v_uint8x64& d, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint8x64 br01, br23, ga01, ga23; + v_zip(a, c, br01, br23); + v_zip(b, d, ga01, ga23); + v_uint8x64 bgra0, bgra1, bgra2, bgra3; + v_zip(br01, ga01, bgra0, bgra1); + v_zip(br23, ga23, bgra2, bgra3); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgra0.val); + _mm512_stream_si512((__m512i*)(ptr + 64), bgra1.val); + _mm512_stream_si512((__m512i*)(ptr + 128), bgra2.val); + _mm512_stream_si512((__m512i*)(ptr + 192), bgra3.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgra0.val); + _mm512_store_si512((__m512i*)(ptr + 64), bgra1.val); + _mm512_store_si512((__m512i*)(ptr + 128), bgra2.val); + _mm512_store_si512((__m512i*)(ptr + 192), bgra3.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgra0.val); + _mm512_storeu_si512((__m512i*)(ptr + 64), bgra1.val); + _mm512_storeu_si512((__m512i*)(ptr + 128), bgra2.val); + _mm512_storeu_si512((__m512i*)(ptr + 192), bgra3.val); + } +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x32& a, const v_uint16x32& b, + const v_uint16x32& c, const v_uint16x32& d, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint16x32 br01, br23, ga01, ga23; + v_zip(a, c, br01, br23); + v_zip(b, d, ga01, ga23); + v_uint16x32 bgra0, bgra1, bgra2, bgra3; + v_zip(br01, ga01, bgra0, bgra1); + v_zip(br23, ga23, bgra2, bgra3); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgra0.val); + _mm512_stream_si512((__m512i*)(ptr + 32), bgra1.val); + _mm512_stream_si512((__m512i*)(ptr + 64), bgra2.val); + _mm512_stream_si512((__m512i*)(ptr + 96), bgra3.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgra0.val); + _mm512_store_si512((__m512i*)(ptr + 32), bgra1.val); + _mm512_store_si512((__m512i*)(ptr + 64), bgra2.val); + _mm512_store_si512((__m512i*)(ptr + 96), bgra3.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgra0.val); + _mm512_storeu_si512((__m512i*)(ptr + 32), bgra1.val); + _mm512_storeu_si512((__m512i*)(ptr + 64), bgra2.val); + _mm512_storeu_si512((__m512i*)(ptr + 96), bgra3.val); + } +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x16& a, const v_uint32x16& b, + const v_uint32x16& c, const v_uint32x16& d, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint32x16 br01, br23, ga01, ga23; + v_zip(a, c, br01, br23); + v_zip(b, d, ga01, ga23); + v_uint32x16 bgra0, bgra1, bgra2, bgra3; + v_zip(br01, ga01, bgra0, bgra1); + v_zip(br23, ga23, bgra2, bgra3); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgra0.val); + _mm512_stream_si512((__m512i*)(ptr + 16), bgra1.val); + _mm512_stream_si512((__m512i*)(ptr + 32), bgra2.val); + _mm512_stream_si512((__m512i*)(ptr + 48), bgra3.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgra0.val); + _mm512_store_si512((__m512i*)(ptr + 16), bgra1.val); + _mm512_store_si512((__m512i*)(ptr + 32), bgra2.val); + _mm512_store_si512((__m512i*)(ptr + 48), bgra3.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgra0.val); + _mm512_storeu_si512((__m512i*)(ptr + 16), bgra1.val); + _mm512_storeu_si512((__m512i*)(ptr + 32), bgra2.val); + _mm512_storeu_si512((__m512i*)(ptr + 48), bgra3.val); + } +} + +inline void v_store_interleave( uint64* ptr, const v_uint64x8& a, const v_uint64x8& b, + const v_uint64x8& c, const v_uint64x8& d, + hal::StoreMode mode=hal::STORE_UNALIGNED ) +{ + v_uint64x8 br01, br23, ga01, ga23; + v_zip(a, c, br01, br23); + v_zip(b, d, ga01, ga23); + v_uint64x8 bgra0, bgra1, bgra2, bgra3; + v_zip(br01, ga01, bgra0, bgra1); + v_zip(br23, ga23, bgra2, bgra3); + + if( mode == hal::STORE_ALIGNED_NOCACHE ) + { + _mm512_stream_si512((__m512i*)ptr, bgra0.val); + _mm512_stream_si512((__m512i*)(ptr + 8), bgra1.val); + _mm512_stream_si512((__m512i*)(ptr + 16), bgra2.val); + _mm512_stream_si512((__m512i*)(ptr + 24), bgra3.val); + } + else if( mode == hal::STORE_ALIGNED ) + { + _mm512_store_si512((__m512i*)ptr, bgra0.val); + _mm512_store_si512((__m512i*)(ptr + 8), bgra1.val); + _mm512_store_si512((__m512i*)(ptr + 16), bgra2.val); + _mm512_store_si512((__m512i*)(ptr + 24), bgra3.val); + } + else + { + _mm512_storeu_si512((__m512i*)ptr, bgra0.val); + _mm512_storeu_si512((__m512i*)(ptr + 8), bgra1.val); + _mm512_storeu_si512((__m512i*)(ptr + 16), bgra2.val); + _mm512_storeu_si512((__m512i*)(ptr + 24), bgra3.val); + } +} + +#define OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \ +{ \ + _Tpvec1 a1, b1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ +} \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \ +{ \ + _Tpvec1 a1, b1, c1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ + c0 = v_reinterpret_as_##suffix0(c1); \ +} \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \ +{ \ + _Tpvec1 a1, b1, c1, d1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ + c0 = v_reinterpret_as_##suffix0(c1); \ + d0 = v_reinterpret_as_##suffix0(d1); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \ + hal::StoreMode mode=hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, mode); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, const _Tpvec0& c0, \ + hal::StoreMode mode=hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \ + const _Tpvec0& c0, const _Tpvec0& d0, \ + hal::StoreMode mode=hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \ + _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \ +} + +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int8x64, schar, s8, v_uint8x64, uchar, u8) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int16x32, short, s16, v_uint16x32, ushort, u16) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int32x16, int, s32, v_uint32x16, unsigned, u32) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_float32x16, float, f32, v_uint32x16, unsigned, u32) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_int64x8, int64, s64, v_uint64x8, uint64, u64) +OPENCV_HAL_IMPL_AVX512_LOADSTORE_INTERLEAVE(v_float64x8, double, f64, v_uint64x8, uint64, u64) + +////////// Mask and checks ///////// + +/** Mask **/ +inline int64 v_signmask(const v_int8x64& a) { return (int64)_mm512_movepi8_mask(a.val); } +inline int v_signmask(const v_int16x32& a) { return (int)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } +inline int v_signmask(const v_int32x16& a) { return (int)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } +inline int v_signmask(const v_int64x8& a) { return (int)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } + +inline int64 v_signmask(const v_uint8x64& a) { return v_signmask(v_reinterpret_as_s8(a)); } +inline int v_signmask(const v_uint16x32& a) { return v_signmask(v_reinterpret_as_s16(a)); } +inline int v_signmask(const v_uint32x16& a) { return v_signmask(v_reinterpret_as_s32(a)); } +inline int v_signmask(const v_uint64x8& a) { return v_signmask(v_reinterpret_as_s64(a)); } +inline int v_signmask(const v_float32x16& a) { return v_signmask(v_reinterpret_as_s32(a)); } +inline int v_signmask(const v_float64x8& a) { return v_signmask(v_reinterpret_as_s64(a)); } + +/** Checks **/ +inline bool v_check_all(const v_int8x64& a) { return !(bool)_mm512_cmp_epi8_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); } +inline bool v_check_any(const v_int8x64& a) { return (bool)_mm512_movepi8_mask(a.val); } +inline bool v_check_all(const v_int16x32& a) { return !(bool)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); } +inline bool v_check_any(const v_int16x32& a) { return (bool)_mm512_cmp_epi16_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } +inline bool v_check_all(const v_int32x16& a) { return !(bool)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); } +inline bool v_check_any(const v_int32x16& a) { return (bool)_mm512_cmp_epi32_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } +inline bool v_check_all(const v_int64x8& a) { return !(bool)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_NLT); } +inline bool v_check_any(const v_int64x8& a) { return (bool)_mm512_cmp_epi64_mask(a.val, _mm512_setzero_si512(), _MM_CMPINT_LT); } + +inline bool v_check_all(const v_float32x16& a) { return v_check_all(v_reinterpret_as_s32(a)); } +inline bool v_check_any(const v_float32x16& a) { return v_check_any(v_reinterpret_as_s32(a)); } +inline bool v_check_all(const v_float64x8& a) { return v_check_all(v_reinterpret_as_s64(a)); } +inline bool v_check_any(const v_float64x8& a) { return v_check_any(v_reinterpret_as_s64(a)); } +inline bool v_check_all(const v_uint8x64& a) { return v_check_all(v_reinterpret_as_s8(a)); } +inline bool v_check_all(const v_uint16x32& a) { return v_check_all(v_reinterpret_as_s16(a)); } +inline bool v_check_all(const v_uint32x16& a) { return v_check_all(v_reinterpret_as_s32(a)); } +inline bool v_check_all(const v_uint64x8& a) { return v_check_all(v_reinterpret_as_s64(a)); } +inline bool v_check_any(const v_uint8x64& a) { return v_check_any(v_reinterpret_as_s8(a)); } +inline bool v_check_any(const v_uint16x32& a) { return v_check_any(v_reinterpret_as_s16(a)); } +inline bool v_check_any(const v_uint32x16& a) { return v_check_any(v_reinterpret_as_s32(a)); } +inline bool v_check_any(const v_uint64x8& a) { return v_check_any(v_reinterpret_as_s64(a)); } + +inline int v_scan_forward(const v_int8x64& a) +{ + int64 mask = _mm512_movepi8_mask(a.val); + int mask32 = (int)mask; + return mask != 0 ? mask32 != 0 ? trailingZeros32(mask32) : 32 + trailingZeros32((int)(mask >> 32)) : 0; +} +inline int v_scan_forward(const v_uint8x64& a) { return v_scan_forward(v_reinterpret_as_s8(a)); } +inline int v_scan_forward(const v_int16x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))); } +inline int v_scan_forward(const v_uint16x32& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))); } +inline int v_scan_forward(const v_int32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; } +inline int v_scan_forward(const v_uint32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; } +inline int v_scan_forward(const v_float32x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 2; } +inline int v_scan_forward(const v_int64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; } +inline int v_scan_forward(const v_uint64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; } +inline int v_scan_forward(const v_float64x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s16(a))) / 4; } + +inline void v512_cleanup() { _mm256_zeroall(); } + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END + +//! @endcond + +} // cv:: + +#endif // OPENCV_HAL_INTRIN_AVX_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_cpp.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_cpp.hpp similarity index 52% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_cpp.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_cpp.hpp index 757c67b..4622214 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_cpp.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_cpp.hpp @@ -50,6 +50,25 @@ #include #include "opencv2/core/saturate.hpp" +//! @cond IGNORED +#define CV_SIMD128_CPP 1 +#if defined(CV_FORCE_SIMD128_CPP) +#define CV_SIMD128 1 +#define CV_SIMD128_64F 1 +#endif +#if defined(CV_DOXYGEN) +#define CV_SIMD128 1 +#define CV_SIMD128_64F 1 +#define CV_SIMD256 1 +#define CV_SIMD256_64F 1 +#define CV_SIMD512 1 +#define CV_SIMD512_64F 1 +#else +#define CV_SIMD256 0 // Explicitly disable SIMD256 and SIMD512 support for scalar intrinsic implementation +#define CV_SIMD512 0 // to avoid warnings during compilation +#endif +//! @endcond + namespace cv { @@ -60,46 +79,130 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN /** @addtogroup core_hal_intrin "Universal intrinsics" is a types and functions set intended to simplify vectorization of code on -different platforms. Currently there are two supported SIMD extensions: __SSE/SSE2__ on x86 -architectures and __NEON__ on ARM architectures, both allow working with 128 bit registers -containing packed values of different types. In case when there is no SIMD extension available -during compilation, fallback C++ implementation of intrinsics will be chosen and code will work as -expected although it could be slower. +different platforms. Currently a few different SIMD extensions on different architectures are supported. +128 bit registers of various types support is implemented for a wide range of architectures +including x86(__SSE/SSE2/SSE4.2__), ARM(__NEON__), PowerPC(__VSX__), MIPS(__MSA__). +256 bit long registers are supported on x86(__AVX2__) and 512 bit long registers are supported on x86(__AVX512__). +In case when there is no SIMD extension available during compilation, fallback C++ implementation of intrinsics +will be chosen and code will work as expected although it could be slower. ### Types -There are several types representing 128-bit register as a vector of packed values, each type is +There are several types representing packed values vector registers, each type is implemented as a structure based on a one SIMD register. +- cv::v_uint8 and cv::v_int8: 8-bit integer values (unsigned/signed) - char +- cv::v_uint16 and cv::v_int16: 16-bit integer values (unsigned/signed) - short +- cv::v_uint32 and cv::v_int32: 32-bit integer values (unsigned/signed) - int +- cv::v_uint64 and cv::v_int64: 64-bit integer values (unsigned/signed) - int64 +- cv::v_float32: 32-bit floating point values (signed) - float +- cv::v_float64: 64-bit floating point values (signed) - double + +Exact bit length(and value quantity) of listed types is compile time deduced and depends on architecture SIMD +capabilities chosen as available during compilation of the library. All the types contains __nlanes__ enumeration +to check for exact value quantity of the type. + +In case the exact bit length of the type is important it is possible to use specific fixed length register types. + +There are several types representing 128-bit registers. + - cv::v_uint8x16 and cv::v_int8x16: sixteen 8-bit integer values (unsigned/signed) - char - cv::v_uint16x8 and cv::v_int16x8: eight 16-bit integer values (unsigned/signed) - short -- cv::v_uint32x4 and cv::v_int32x4: four 32-bit integer values (unsgined/signed) - int +- cv::v_uint32x4 and cv::v_int32x4: four 32-bit integer values (unsigned/signed) - int - cv::v_uint64x2 and cv::v_int64x2: two 64-bit integer values (unsigned/signed) - int64 - cv::v_float32x4: four 32-bit floating point values (signed) - float -- cv::v_float64x2: two 64-bit floating point valies (signed) - double +- cv::v_float64x2: two 64-bit floating point values (signed) - double + +There are several types representing 256-bit registers. + +- cv::v_uint8x32 and cv::v_int8x32: thirty two 8-bit integer values (unsigned/signed) - char +- cv::v_uint16x16 and cv::v_int16x16: sixteen 16-bit integer values (unsigned/signed) - short +- cv::v_uint32x8 and cv::v_int32x8: eight 32-bit integer values (unsigned/signed) - int +- cv::v_uint64x4 and cv::v_int64x4: four 64-bit integer values (unsigned/signed) - int64 +- cv::v_float32x8: eight 32-bit floating point values (signed) - float +- cv::v_float64x4: four 64-bit floating point values (signed) - double @note -cv::v_float64x2 is not implemented in NEON variant, if you want to use this type, don't forget to -check the CV_SIMD128_64F preprocessor definition: +256 bit registers at the moment implemented for AVX2 SIMD extension only, if you want to use this type directly, +don't forget to check the CV_SIMD256 preprocessor definition: @code -#if CV_SIMD128_64F +#if CV_SIMD256 //... #endif @endcode +There are several types representing 512-bit registers. + +- cv::v_uint8x64 and cv::v_int8x64: sixty four 8-bit integer values (unsigned/signed) - char +- cv::v_uint16x32 and cv::v_int16x32: thirty two 16-bit integer values (unsigned/signed) - short +- cv::v_uint32x16 and cv::v_int32x16: sixteen 32-bit integer values (unsigned/signed) - int +- cv::v_uint64x8 and cv::v_int64x8: eight 64-bit integer values (unsigned/signed) - int64 +- cv::v_float32x16: sixteen 32-bit floating point values (signed) - float +- cv::v_float64x8: eight 64-bit floating point values (signed) - double +@note +512 bit registers at the moment implemented for AVX512 SIMD extension only, if you want to use this type directly, +don't forget to check the CV_SIMD512 preprocessor definition. + +@note +cv::v_float64x2 is not implemented in NEON variant, if you want to use this type, don't forget to +check the CV_SIMD128_64F preprocessor definition. + ### Load and store operations These operations allow to set contents of the register explicitly or by loading it from some memory block and to save contents of the register to memory block. +There are variable size register load operations that provide result of maximum available size +depending on chosen platform capabilities. +- Constructors: +@ref v_reg::v_reg(const _Tp *ptr) "from memory", +- Other create methods: +vx_setall_s8, vx_setall_u8, ..., +vx_setzero_u8, vx_setzero_s8, ... +- Memory load operations: +vx_load, vx_load_aligned, vx_load_low, vx_load_halves, +- Memory operations with expansion of values: +vx_load_expand, vx_load_expand_q + +Also there are fixed size register load/store operations. + +For 128 bit registers - Constructors: @ref v_reg::v_reg(const _Tp *ptr) "from memory", @ref v_reg::v_reg(_Tp s0, _Tp s1) "from two values", ... - Other create methods: @ref v_setall_s8, @ref v_setall_u8, ..., @ref v_setzero_u8, @ref v_setzero_s8, ... -- Memory operations: +- Memory load operations: @ref v_load, @ref v_load_aligned, @ref v_load_low, @ref v_load_halves, +- Memory operations with expansion of values: +@ref v_load_expand, @ref v_load_expand_q + +For 256 bit registers(check CV_SIMD256 preprocessor definition) +- Constructors: +@ref v_reg::v_reg(const _Tp *ptr) "from memory", +@ref v_reg::v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3) "from four values", ... +- Other create methods: +@ref v256_setall_s8, @ref v256_setall_u8, ..., +@ref v256_setzero_u8, @ref v256_setzero_s8, ... +- Memory load operations: +@ref v256_load, @ref v256_load_aligned, @ref v256_load_low, @ref v256_load_halves, +- Memory operations with expansion of values: +@ref v256_load_expand, @ref v256_load_expand_q + +For 512 bit registers(check CV_SIMD512 preprocessor definition) +- Constructors: +@ref v_reg::v_reg(const _Tp *ptr) "from memory", +@ref v_reg::v_reg(_Tp s0, _Tp s1, _Tp s2, _Tp s3, _Tp s4, _Tp s5, _Tp s6, _Tp s7) "from eight values", ... +- Other create methods: +@ref v512_setall_s8, @ref v512_setall_u8, ..., +@ref v512_setzero_u8, @ref v512_setzero_s8, ... +- Memory load operations: +@ref v512_load, @ref v512_load_aligned, @ref v512_load_low, @ref v512_load_halves, +- Memory operations with expansion of values: +@ref v512_load_expand, @ref v512_load_expand_q + +Store to memory operations are similar across different platform capabilities: @ref v_store, @ref v_store_aligned, @ref v_store_high, @ref v_store_low @@ -108,10 +211,11 @@ block and to save contents of the register to memory block. These operations allow to reorder or recombine elements in one or multiple vectors. - Interleave, deinterleave (2, 3 and 4 channels): @ref v_load_deinterleave, @ref v_store_interleave -- Expand: @ref v_load_expand, @ref v_load_expand_q, @ref v_expand, @ref v_expand_low, @ref v_expand_high +- Expand: @ref v_expand, @ref v_expand_low, @ref v_expand_high - Pack: @ref v_pack, @ref v_pack_u, @ref v_pack_b, @ref v_rshr_pack, @ref v_rshr_pack_u, @ref v_pack_store, @ref v_pack_u_store, @ref v_rshr_pack_store, @ref v_rshr_pack_u_store - Recombine: @ref v_zip, @ref v_recombine, @ref v_combine_low, @ref v_combine_high +- Reverse: @ref v_reverse - Extract: @ref v_extract @@ -134,7 +238,7 @@ Element-wise binary and unary operations. @ref v_shl, @ref v_shr - Bitwise logic: -@ref operator&(const v_reg &a, const v_reg &b) "&", +@ref operator &(const v_reg &a, const v_reg &b) "&", @ref operator |(const v_reg &a, const v_reg &b) "|", @ref operator ^(const v_reg &a, const v_reg &b) "^", @ref operator ~(const v_reg &a) "~" @@ -144,7 +248,7 @@ Element-wise binary and unary operations. @ref operator >=(const v_reg &a, const v_reg &b) ">=", @ref operator <(const v_reg &a, const v_reg &b) "<", @ref operator <=(const v_reg &a, const v_reg &b) "<=", -@ref operator==(const v_reg &a, const v_reg &b) "==", +@ref operator ==(const v_reg &a, const v_reg &b) "==", @ref operator !=(const v_reg &a, const v_reg &b) "!=" - min/max: @ref v_min, @ref v_max @@ -171,7 +275,8 @@ Different type conversions and casts: ### Matrix operations -In these operations vectors represent matrix rows/columns: @ref v_dotprod, @ref v_matmul, @ref v_transpose4x4 +In these operations vectors represent matrix rows/columns: @ref v_dotprod, @ref v_dotprod_fast, +@ref v_dotprod_expand, @ref v_dotprod_expand_fast, @ref v_matmul, @ref v_transpose4x4 ### Usability @@ -180,7 +285,7 @@ shows the applicability of different operations to the types. Regular integers: -| Operations\\Types | uint 8x16 | int 8x16 | uint 16x8 | int 16x8 | uint 32x4 | int 32x4 | +| Operations\\Types | uint 8 | int 8 | uint 16 | int 16 | uint 32 | int 32 | |-------------------|:-:|:-:|:-:|:-:|:-:|:-:| |load, store | x | x | x | x | x | x | |interleave | x | x | x | x | x | x | @@ -195,12 +300,15 @@ Regular integers: |mul_expand | x | x | x | x | x | | |compare | x | x | x | x | x | x | |shift | | | x | x | x | x | -|dotprod | | | | x | | | +|dotprod | | | | x | | x | +|dotprod_fast | | | | x | | x | +|dotprod_expand | x | x | x | x | | x | +|dotprod_expand_fast| x | x | x | x | | x | |logical | x | x | x | x | x | x | |min, max | x | x | x | x | x | x | |absdiff | x | x | x | x | x | x | |absdiffs | | x | | x | | | -|reduce | | | | | x | x | +|reduce | x | x | x | x | x | x | |mask | x | x | x | x | x | x | |pack | x | x | x | x | x | x | |pack_u | x | | x | | | | @@ -211,21 +319,27 @@ Regular integers: |cvt_flt32 | | | | | | x | |cvt_flt64 | | | | | | x | |transpose4x4 | | | | | x | x | +|reverse | x | x | x | x | x | x | +|extract_n | x | x | x | x | x | x | +|broadcast_element | | | | | x | x | Big integers: -| Operations\\Types | uint 64x2 | int 64x2 | +| Operations\\Types | uint 64 | int 64 | |-------------------|:-:|:-:| |load, store | x | x | |add, sub | x | x | |shift | x | x | |logical | x | x | +|reverse | x | x | |extract | x | x | |rotate (lanes) | x | x | +|cvt_flt64 | | x | +|extract_n | x | x | Floating point: -| Operations\\Types | float 32x4 | float 64x2 | +| Operations\\Types | float 32 | float 64 | |-------------------|:-:|:-:| |load, store | x | x | |interleave | x | | @@ -245,6 +359,9 @@ Floating point: |transpose4x4 | x | | |extract | x | x | |rotate (lanes) | x | x | +|reverse | x | x | +|extract_n | x | x | +|broadcast_element | x | | @{ */ @@ -356,6 +473,13 @@ template struct v_reg return c; } + v_reg& operator=(const v_reg<_Tp, n> & r) + { + for( int i = 0; i < n; i++ ) + s[i] = r.s[i]; + return *this; + } + _Tp s[n]; //! @endcond }; @@ -381,50 +505,163 @@ typedef v_reg v_uint64x2; /** @brief Two 64-bit signed integer values */ typedef v_reg v_int64x2; -//! @brief Helper macro -//! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_BIN_OP(bin_op) \ -template inline v_reg<_Tp, n> \ - operator bin_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +#if CV_SIMD256 +/** @brief Thirty two 8-bit unsigned integer values */ +typedef v_reg v_uint8x32; +/** @brief Thirty two 8-bit signed integer values */ +typedef v_reg v_int8x32; +/** @brief Sixteen 16-bit unsigned integer values */ +typedef v_reg v_uint16x16; +/** @brief Sixteen 16-bit signed integer values */ +typedef v_reg v_int16x16; +/** @brief Eight 32-bit unsigned integer values */ +typedef v_reg v_uint32x8; +/** @brief Eight 32-bit signed integer values */ +typedef v_reg v_int32x8; +/** @brief Eight 32-bit floating point values (single precision) */ +typedef v_reg v_float32x8; +/** @brief Four 64-bit floating point values (double precision) */ +typedef v_reg v_float64x4; +/** @brief Four 64-bit unsigned integer values */ +typedef v_reg v_uint64x4; +/** @brief Four 64-bit signed integer values */ +typedef v_reg v_int64x4; +#endif + +#if CV_SIMD512 +/** @brief Sixty four 8-bit unsigned integer values */ +typedef v_reg v_uint8x64; +/** @brief Sixty four 8-bit signed integer values */ +typedef v_reg v_int8x64; +/** @brief Thirty two 16-bit unsigned integer values */ +typedef v_reg v_uint16x32; +/** @brief Thirty two 16-bit signed integer values */ +typedef v_reg v_int16x32; +/** @brief Sixteen 32-bit unsigned integer values */ +typedef v_reg v_uint32x16; +/** @brief Sixteen 32-bit signed integer values */ +typedef v_reg v_int32x16; +/** @brief Sixteen 32-bit floating point values (single precision) */ +typedef v_reg v_float32x16; +/** @brief Eight 64-bit floating point values (double precision) */ +typedef v_reg v_float64x8; +/** @brief Eight 64-bit unsigned integer values */ +typedef v_reg v_uint64x8; +/** @brief Eight 64-bit signed integer values */ +typedef v_reg v_int64x8; +#endif + +enum { + simd128_width = 16, +#if CV_SIMD256 + simd256_width = 32, +#endif +#if CV_SIMD512 + simd512_width = 64, + simdmax_width = simd512_width +#elif CV_SIMD256 + simdmax_width = simd256_width +#else + simdmax_width = simd128_width +#endif +}; + +/** @brief Add values + +For all types. */ +template CV_INLINE v_reg<_Tp, n> operator+(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator+=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Subtract values + +For all types. */ +template CV_INLINE v_reg<_Tp, n> operator-(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator-=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Multiply values + +For 16- and 32-bit integer types and floating types. */ +template CV_INLINE v_reg<_Tp, n> operator*(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator*=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Divide values + +For floating types only. */ +template CV_INLINE v_reg<_Tp, n> operator/(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator/=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + + +/** @brief Bitwise AND + +Only for integer types. */ +template CV_INLINE v_reg<_Tp, n> operator&(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator&=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Bitwise OR + +Only for integer types. */ +template CV_INLINE v_reg<_Tp, n> operator|(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator|=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Bitwise XOR + +Only for integer types.*/ +template CV_INLINE v_reg<_Tp, n> operator^(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); +template CV_INLINE v_reg<_Tp, n>& operator^=(v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b); + +/** @brief Bitwise NOT + +Only for integer types.*/ +template CV_INLINE v_reg<_Tp, n> operator~(const v_reg<_Tp, n>& a); + + +#ifndef CV_DOXYGEN + +#define CV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(macro_name, ...) \ +__CV_EXPAND(macro_name(uchar, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(schar, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(ushort, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(short, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(unsigned, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(int, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(uint64, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(int64, __VA_ARGS__)) \ + +#define CV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(macro_name, ...) \ +__CV_EXPAND(macro_name(float, __VA_ARGS__)) \ +__CV_EXPAND(macro_name(double, __VA_ARGS__)) \ + +#define CV__HAL_INTRIN_EXPAND_WITH_ALL_TYPES(macro_name, ...) \ +CV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(macro_name, __VA_ARGS__) \ +CV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(macro_name, __VA_ARGS__) \ + +#define CV__HAL_INTRIN_IMPL_BIN_OP_(_Tp, bin_op) \ +template inline \ +v_reg<_Tp, n> operator bin_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ v_reg<_Tp, n> c; \ for( int i = 0; i < n; i++ ) \ c.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \ return c; \ } \ -template inline v_reg<_Tp, n>& \ - operator bin_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +template inline \ +v_reg<_Tp, n>& operator bin_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ for( int i = 0; i < n; i++ ) \ a.s[i] = saturate_cast<_Tp>(a.s[i] bin_op b.s[i]); \ return a; \ } -/** @brief Add values +#define CV__HAL_INTRIN_IMPL_BIN_OP(bin_op) CV__HAL_INTRIN_EXPAND_WITH_ALL_TYPES(CV__HAL_INTRIN_IMPL_BIN_OP_, bin_op) -For all types. */ -OPENCV_HAL_IMPL_BIN_OP(+) +CV__HAL_INTRIN_IMPL_BIN_OP(+) +CV__HAL_INTRIN_IMPL_BIN_OP(-) +CV__HAL_INTRIN_IMPL_BIN_OP(*) +CV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(CV__HAL_INTRIN_IMPL_BIN_OP_, /) -/** @brief Subtract values - -For all types. */ -OPENCV_HAL_IMPL_BIN_OP(-) - -/** @brief Multiply values - -For 16- and 32-bit integer types and floating types. */ -OPENCV_HAL_IMPL_BIN_OP(*) - -/** @brief Divide values - -For floating types only. */ -OPENCV_HAL_IMPL_BIN_OP(/) - -//! @brief Helper macro -//! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_BIT_OP(bit_op) \ -template inline v_reg<_Tp, n> operator bit_op \ - (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +#define CV__HAL_INTRIN_IMPL_BIT_OP_(_Tp, bit_op) \ +template CV_INLINE \ +v_reg<_Tp, n> operator bit_op (const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ v_reg<_Tp, n> c; \ typedef typename V_TypeTraits<_Tp>::int_type itype; \ @@ -433,8 +670,8 @@ template inline v_reg<_Tp, n> operator bit_op \ V_TypeTraits<_Tp>::reinterpret_int(b.s[i]))); \ return c; \ } \ -template inline v_reg<_Tp, n>& operator \ - bit_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ +template CV_INLINE \ +v_reg<_Tp, n>& operator bit_op##= (v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ typedef typename V_TypeTraits<_Tp>::int_type itype; \ for( int i = 0; i < n; i++ ) \ @@ -443,33 +680,29 @@ template inline v_reg<_Tp, n>& operator \ return a; \ } -/** @brief Bitwise AND +#define CV__HAL_INTRIN_IMPL_BIT_OP(bit_op) \ +CV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(CV__HAL_INTRIN_IMPL_BIT_OP_, bit_op) \ +CV__HAL_INTRIN_EXPAND_WITH_FP_TYPES(CV__HAL_INTRIN_IMPL_BIT_OP_, bit_op) /* TODO: FIXIT remove this after masks refactoring */ -Only for integer types. */ -OPENCV_HAL_IMPL_BIT_OP(&) -/** @brief Bitwise OR +CV__HAL_INTRIN_IMPL_BIT_OP(&) +CV__HAL_INTRIN_IMPL_BIT_OP(|) +CV__HAL_INTRIN_IMPL_BIT_OP(^) -Only for integer types. */ -OPENCV_HAL_IMPL_BIT_OP(|) +#define CV__HAL_INTRIN_IMPL_BITWISE_NOT_(_Tp, dummy) \ +template CV_INLINE \ +v_reg<_Tp, n> operator ~ (const v_reg<_Tp, n>& a) \ +{ \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int(~V_TypeTraits<_Tp>::reinterpret_int(a.s[i])); \ + return c; \ +} \ -/** @brief Bitwise XOR +CV__HAL_INTRIN_EXPAND_WITH_INTEGER_TYPES(CV__HAL_INTRIN_IMPL_BITWISE_NOT_, ~) -Only for integer types.*/ -OPENCV_HAL_IMPL_BIT_OP(^) +#endif // !CV_DOXYGEN -/** @brief Bitwise NOT - -Only for integer types.*/ -template inline v_reg<_Tp, n> operator ~ (const v_reg<_Tp, n>& a) -{ - v_reg<_Tp, n> c; - for( int i = 0; i < n; i++ ) - { - c.s[i] = V_TypeTraits<_Tp>::reinterpret_from_int(~V_TypeTraits<_Tp>::reinterpret_int(a.s[i])); - } - return c; -} //! @brief Helper macro //! @ingroup core_hal_intrin_impl @@ -500,26 +733,6 @@ Only for floating point types.*/ OPENCV_HAL_IMPL_MATH_FUNC(v_abs, (typename V_TypeTraits<_Tp>::abs_type)std::abs, typename V_TypeTraits<_Tp>::abs_type) -/** @brief Round elements - -Only for floating point types.*/ -OPENCV_HAL_IMPL_MATH_FUNC(v_round, cvRound, int) - -/** @brief Floor elements - -Only for floating point types.*/ -OPENCV_HAL_IMPL_MATH_FUNC(v_floor, cvFloor, int) - -/** @brief Ceil elements - -Only for floating point types.*/ -OPENCV_HAL_IMPL_MATH_FUNC(v_ceil, cvCeil, int) - -/** @brief Truncate elements - -Only for floating point types.*/ -OPENCV_HAL_IMPL_MATH_FUNC(v_trunc, int, int) - //! @brief Helper macro //! @ingroup core_hal_intrin_impl #define OPENCV_HAL_IMPL_MINMAX_FUNC(func, cfunc) \ @@ -572,7 +785,7 @@ Scheme: @code {A1 A2 A3 ...} => min(A1,A2,A3,...) @endcode -For 32-bit integer and 32-bit floating point types. */ +For all types except 64-bit integer and 64-bit floating point types. */ OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_min, std::min) /** @brief Find one max value @@ -581,7 +794,7 @@ Scheme: @code {A1 A2 A3 ...} => max(A1,A2,A3,...) @endcode -For 32-bit integer and 32-bit floating point types. */ +For all types except 64-bit integer and 64-bit floating point types. */ OPENCV_HAL_IMPL_REDUCE_MINMAX_FUNC(v_reduce_max, std::max) static const unsigned char popCountTable[] = @@ -603,27 +816,20 @@ static const unsigned char popCountTable[] = 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, }; -/** @brief Count the 1 bits in the vector and return 4 values +/** @brief Count the 1 bits in the vector lanes and return result as corresponding unsigned type Scheme: @code -{A1 A2 A3 ...} => popcount(A1) +{A1 A2 A3 ...} => {popcount(A1), popcount(A2), popcount(A3), ...} @endcode -Any types but result will be in v_uint32x4*/ -template inline v_uint32x4 v_popcount(const v_reg<_Tp, n>& a) +For all integer types. */ +template +inline v_reg::abs_type, n> v_popcount(const v_reg<_Tp, n>& a) { - v_uint8x16 b; - b = v_reinterpret_as_u8(a); - for( int i = 0; i < v_uint8x16::nlanes; i++ ) - { - b.s[i] = popCountTable[b.s[i]]; - } - v_uint32x4 c; - for( int i = 0; i < v_uint32x4::nlanes; i++ ) - { - c.s[i] = b.s[i*4] + b.s[i*4+1] + b.s[i*4+2] + b.s[i*4+3]; - } - return c; + v_reg::abs_type, n> b = v_reg::abs_type, n>::zero(); + for (int i = 0; i < n*(int)sizeof(_Tp); i++) + b.s[i/sizeof(_Tp)] += popCountTable[v_reinterpret_as_u8(a).s[i]]; + return b; } @@ -764,9 +970,9 @@ inline v_reg::abs_type, n> v_absdiff(const v_reg<_Tp, /** @overload For 32-bit floating point values */ -inline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b) +template inline v_reg v_absdiff(const v_reg& a, const v_reg& b) { - v_float32x4 c; + v_reg c; for( int i = 0; i < c.nlanes; i++ ) c.s[i] = _absdiff(a.s[i], b.s[i]); return c; @@ -775,9 +981,9 @@ inline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b) /** @overload For 64-bit floating point values */ -inline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b) +template inline v_reg v_absdiff(const v_reg& a, const v_reg& b) { - v_float64x2 c; + v_reg c; for( int i = 0; i < c.nlanes; i++ ) c.s[i] = _absdiff(a.s[i], b.s[i]); return c; @@ -860,17 +1066,18 @@ inline v_reg<_Tp, n> v_muladd(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, /** @brief Dot product of elements Multiply values in two registers and sum adjacent result pairs. + Scheme: @code {A1 A2 ...} // 16-bit x {B1 B2 ...} // 16-bit ------------- {A1B1+A2B2 ...} // 32-bit + @endcode -Implemented only for 16-bit signed source type (v_int16x8). */ template inline v_reg::w_type, n/2> - v_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +v_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) { typedef typename V_TypeTraits<_Tp>::w_type w_type; v_reg c; @@ -888,12 +1095,11 @@ Scheme: x {B1 B2 ...} // 16-bit ------------- {A1B1+A2B2+C1 ...} // 32-bit - @endcode -Implemented only for 16-bit signed source type (v_int16x8). */ template inline v_reg::w_type, n/2> - v_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, const v_reg::w_type, n / 2>& c) +v_dotprod(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + const v_reg::w_type, n / 2>& c) { typedef typename V_TypeTraits<_Tp>::w_type w_type; v_reg s; @@ -902,6 +1108,95 @@ template inline v_reg::w_type, n return s; } +/** @brief Fast Dot product of elements + +Same as cv::v_dotprod, but it may perform unorder sum between result pairs in some platforms, +this intrinsic can be used if the sum among all lanes is only matters +and also it should be yielding better performance on the affected platforms. + +*/ +template inline v_reg::w_type, n/2> +v_dotprod_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ return v_dotprod(a, b); } + +/** @brief Fast Dot product of elements + +Same as cv::v_dotprod_fast, but add a third element to the sum of adjacent pairs. +*/ +template inline v_reg::w_type, n/2> +v_dotprod_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + const v_reg::w_type, n / 2>& c) +{ return v_dotprod(a, b, c); } + +/** @brief Dot product of elements and expand + +Multiply values in two registers and expand the sum of adjacent result pairs. + +Scheme: +@code + {A1 A2 A3 A4 ...} // 8-bit +x {B1 B2 B3 B4 ...} // 8-bit +------------- + {A1B1+A2B2+A3B3+A4B4 ...} // 32-bit + +@endcode +*/ +template inline v_reg::q_type, n/4> +v_dotprod_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ + typedef typename V_TypeTraits<_Tp>::q_type q_type; + v_reg s; + for( int i = 0; i < (n/4); i++ ) + s.s[i] = (q_type)a.s[i*4 ]*b.s[i*4 ] + (q_type)a.s[i*4 + 1]*b.s[i*4 + 1] + + (q_type)a.s[i*4 + 2]*b.s[i*4 + 2] + (q_type)a.s[i*4 + 3]*b.s[i*4 + 3]; + return s; +} + +/** @brief Dot product of elements + +Same as cv::v_dotprod_expand, but add a third element to the sum of adjacent pairs. +Scheme: +@code + {A1 A2 A3 A4 ...} // 8-bit +x {B1 B2 B3 B4 ...} // 8-bit +------------- + {A1B1+A2B2+A3B3+A4B4+C1 ...} // 32-bit +@endcode +*/ +template inline v_reg::q_type, n/4> +v_dotprod_expand(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + const v_reg::q_type, n / 4>& c) +{ + typedef typename V_TypeTraits<_Tp>::q_type q_type; + v_reg s; + for( int i = 0; i < (n/4); i++ ) + s.s[i] = (q_type)a.s[i*4 ]*b.s[i*4 ] + (q_type)a.s[i*4 + 1]*b.s[i*4 + 1] + + (q_type)a.s[i*4 + 2]*b.s[i*4 + 2] + (q_type)a.s[i*4 + 3]*b.s[i*4 + 3] + c.s[i]; + return s; +} + +/** @brief Fast Dot product of elements and expand + +Multiply values in two registers and expand the sum of adjacent result pairs. + +Same as cv::v_dotprod_expand, but it may perform unorder sum between result pairs in some platforms, +this intrinsic can be used if the sum among all lanes is only matters +and also it should be yielding better performance on the affected platforms. + +*/ +template inline v_reg::q_type, n/4> +v_dotprod_expand_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) +{ return v_dotprod_expand(a, b); } + +/** @brief Fast Dot product of elements + +Same as cv::v_dotprod_expand_fast, but add a third element to the sum of adjacent pairs. +*/ +template inline v_reg::q_type, n/4> +v_dotprod_expand_fast(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, + const v_reg::q_type, n / 4>& c) +{ return v_dotprod_expand(a, b, c); } + /** @brief Multiply and expand Multiply values two registers and store results in two registers with wider pack type. @@ -980,9 +1275,8 @@ OPENCV_HAL_IMPL_SHIFT_OP(<< ) For 16-, 32- and 64-bit integer values. */ OPENCV_HAL_IMPL_SHIFT_OP(>> ) -/** @brief Element shift left among vector - -For all type */ +//! @brief Helper macro +//! @ingroup core_hal_intrin_impl #define OPENCV_HAL_IMPL_ROTATE_SHIFT_OP(suffix,opA,opB) \ template inline v_reg<_Tp, n> v_rotate_##suffix(const v_reg<_Tp, n>& a) \ { \ @@ -1024,7 +1318,14 @@ template inline v_reg<_Tp, n> v_rotate_##suffix(co return c; \ } +/** @brief Element shift left among vector + +For all type */ OPENCV_HAL_IMPL_ROTATE_SHIFT_OP(left, -, +) + +/** @brief Element shift right among vector + +For all type */ OPENCV_HAL_IMPL_ROTATE_SHIFT_OP(right, +, -) /** @brief Sum packed values @@ -1033,7 +1334,7 @@ Scheme: @code {A1 A2 A3 ...} => sum{A1,A2,A3,...} @endcode -For 32-bit integer and 32-bit floating point types.*/ +*/ template inline typename V_TypeTraits<_Tp>::sum_type v_reduce_sum(const v_reg<_Tp, n>& a) { typename V_TypeTraits<_Tp>::sum_type c = a.s[0]; @@ -1052,14 +1353,17 @@ template inline typename V_TypeTraits<_Tp>::sum_type v_redu result[3] = d[0] + d[1] + d[2] + d[3] @endcode */ -inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b, - const v_float32x4& c, const v_float32x4& d) +template inline v_reg v_reduce_sum4(const v_reg& a, const v_reg& b, + const v_reg& c, const v_reg& d) { - v_float32x4 r; - r.s[0] = a.s[0] + a.s[1] + a.s[2] + a.s[3]; - r.s[1] = b.s[0] + b.s[1] + b.s[2] + b.s[3]; - r.s[2] = c.s[0] + c.s[1] + c.s[2] + c.s[3]; - r.s[3] = d.s[0] + d.s[1] + d.s[2] + d.s[3]; + v_reg r; + for(int i = 0; i < (n/4); i++) + { + r.s[i*4 + 0] = a.s[i*4 + 0] + a.s[i*4 + 1] + a.s[i*4 + 2] + a.s[i*4 + 3]; + r.s[i*4 + 1] = b.s[i*4 + 0] + b.s[i*4 + 1] + b.s[i*4 + 2] + b.s[i*4 + 3]; + r.s[i*4 + 2] = c.s[i*4 + 0] + c.s[i*4 + 1] + c.s[i*4 + 2] + c.s[i*4 + 3]; + r.s[i*4 + 3] = d.s[i*4 + 0] + d.s[i*4 + 1] + d.s[i*4 + 2] + d.s[i*4 + 3]; + } return r; } @@ -1079,6 +1383,7 @@ template inline typename V_TypeTraits< typename V_TypeTrait } /** @brief Get negative values mask +@deprecated v_signmask depends on a lane count heavily and therefore isn't universal enough Returned value is a bit mask with bits set to 1 on places corresponding to negative packed values indexes. Example: @@ -1086,7 +1391,7 @@ Example: v_int32x4 r; // set to {-1, -1, 1, 1} int mask = v_signmask(r); // mask = 3 <== 00000000 00000000 00000000 00000011 @endcode -For all types except 64-bit. */ +*/ template inline int v_signmask(const v_reg<_Tp, n>& a) { int mask = 0; @@ -1095,10 +1400,27 @@ template inline int v_signmask(const v_reg<_Tp, n>& a) return mask; } +/** @brief Get first negative lane index + +Returned value is an index of first negative lane (undefined for input of all positive values) +Example: +@code{.cpp} +v_int32x4 r; // set to {0, 0, -1, -1} +int idx = v_heading_zeros(r); // idx = 2 +@endcode +*/ +template inline int v_scan_forward(const v_reg<_Tp, n>& a) +{ + for (int i = 0; i < n; i++) + if(V_TypeTraits<_Tp>::reinterpret_int(a.s[i]) < 0) + return i; + return 0; +} + /** @brief Check if all packed values are less than zero Unsigned values will be casted to signed: `uchar 254 => char -2`. -For all types except 64-bit. */ +*/ template inline bool v_check_all(const v_reg<_Tp, n>& a) { for( int i = 0; i < n; i++ ) @@ -1110,7 +1432,7 @@ template inline bool v_check_all(const v_reg<_Tp, n>& a) /** @brief Check if any of packed values is less than zero Unsigned values will be casted to signed: `uchar 254 => char -2`. -For all types except 64-bit. */ +*/ template inline bool v_check_any(const v_reg<_Tp, n>& a) { for( int i = 0; i < n; i++ ) @@ -1254,23 +1576,117 @@ template inline void v_zip( const v_reg<_Tp, n>& a0, const @return register object @note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x16, int ==> cv::v_int32x4, etc. + +@note Use vx_load version to get maximum available register length result + +@note Alignment requirement: +if CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough). +Do not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`). */ template -inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load(const _Tp* ptr) +inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load(const _Tp* ptr) { - return v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128>(ptr); +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + return v_reg<_Tp, simd128_width / sizeof(_Tp)>(ptr); } +#if CV_SIMD256 +/** @brief Load 256-bit length register contents from memory + +@param ptr pointer to memory block with data +@return register object + +@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x32, int ==> cv::v_int32x8, etc. + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load version to get maximum available register length result + +@note Alignment requirement: +if CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough). +Do not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`). + */ +template +inline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + return v_reg<_Tp, simd256_width / sizeof(_Tp)>(ptr); +} +#endif + +#if CV_SIMD512 +/** @brief Load 512-bit length register contents from memory + +@param ptr pointer to memory block with data +@return register object + +@note Returned type will be detected from passed pointer type, for example uchar ==> cv::v_uint8x64, int ==> cv::v_int32x16, etc. + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load version to get maximum available register length result + +@note Alignment requirement: +if CV_STRONG_ALIGNMENT=1 then passed pointer must be aligned (`sizeof(lane type)` should be enough). +Do not cast pointer types without runtime check for pointer alignment (like `uchar*` => `int*`). + */ +template +inline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + return v_reg<_Tp, simd512_width / sizeof(_Tp)>(ptr); +} +#endif + /** @brief Load register contents from memory (aligned) -similar to cv::v_load, but source memory block should be aligned (to 16-byte boundary) - */ +similar to cv::v_load, but source memory block should be aligned (to 16-byte boundary in case of SIMD128, 32-byte - SIMD256, etc) + +@note Use vx_load_aligned version to get maximum available register length result +*/ template -inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_aligned(const _Tp* ptr) +inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_aligned(const _Tp* ptr) { - return v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128>(ptr); + CV_Assert(isAligned)>(ptr)); + return v_reg<_Tp, simd128_width / sizeof(_Tp)>(ptr); } +#if CV_SIMD256 +/** @brief Load register contents from memory (aligned) + +similar to cv::v256_load, but source memory block should be aligned (to 32-byte boundary in case of SIMD256, 64-byte - SIMD512, etc) + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load_aligned version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_aligned(const _Tp* ptr) +{ + CV_Assert(isAligned)>(ptr)); + return v_reg<_Tp, simd256_width / sizeof(_Tp)>(ptr); +} +#endif + +#if CV_SIMD512 +/** @brief Load register contents from memory (aligned) + +similar to cv::v512_load, but source memory block should be aligned (to 64-byte boundary in case of SIMD512, etc) + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load_aligned version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_aligned(const _Tp* ptr) +{ + CV_Assert(isAligned)>(ptr)); + return v_reg<_Tp, simd512_width / sizeof(_Tp)>(ptr); +} +#endif + /** @brief Load 64-bits of data to lower part (high part is undefined). @param ptr memory block containing data for first half (0..n/2) @@ -1279,11 +1695,16 @@ inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_aligned(const _Tp* ptr) int lo[2] = { 1, 2 }; v_int32x4 r = v_load_low(lo); @endcode - */ + +@note Use vx_load_low version to get maximum available register length result +*/ template -inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_low(const _Tp* ptr) +inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_low(const _Tp* ptr) { - v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> c; +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + v_reg<_Tp, simd128_width / sizeof(_Tp)> c; for( int i = 0; i < c.nlanes/2; i++ ) { c.s[i] = ptr[i]; @@ -1291,6 +1712,62 @@ inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_low(const _Tp* ptr) return c; } +#if CV_SIMD256 +/** @brief Load 128-bits of data to lower part (high part is undefined). + +@param ptr memory block containing data for first half (0..n/2) + +@code{.cpp} +int lo[4] = { 1, 2, 3, 4 }; +v_int32x8 r = v256_load_low(lo); +@endcode + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load_low version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_low(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + v_reg<_Tp, simd256_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes / 2; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + +#if CV_SIMD512 +/** @brief Load 256-bits of data to lower part (high part is undefined). + +@param ptr memory block containing data for first half (0..n/2) + +@code{.cpp} +int lo[8] = { 1, 2, 3, 4, 5, 6, 7, 8 }; +v_int32x16 r = v512_load_low(lo); +@endcode + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load_low version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_low(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + v_reg<_Tp, simd512_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes / 2; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + /** @brief Load register contents from two memory blocks @param loptr memory block containing data for first half (0..n/2) @@ -1300,11 +1777,17 @@ inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_low(const _Tp* ptr) int lo[2] = { 1, 2 }, hi[2] = { 3, 4 }; v_int32x4 r = v_load_halves(lo, hi); @endcode - */ + +@note Use vx_load_halves version to get maximum available register length result +*/ template -inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_halves(const _Tp* loptr, const _Tp* hiptr) +inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_load_halves(const _Tp* loptr, const _Tp* hiptr) { - v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> c; +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(loptr)); + CV_Assert(isAligned(hiptr)); +#endif + v_reg<_Tp, simd128_width / sizeof(_Tp)> c; for( int i = 0; i < c.nlanes/2; i++ ) { c.s[i] = loptr[i]; @@ -1313,6 +1796,68 @@ inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_load_halves(const _Tp* loptr, return c; } +#if CV_SIMD256 +/** @brief Load register contents from two memory blocks + +@param loptr memory block containing data for first half (0..n/2) +@param hiptr memory block containing data for second half (n/2..n) + +@code{.cpp} +int lo[4] = { 1, 2, 3, 4 }, hi[4] = { 5, 6, 7, 8 }; +v_int32x8 r = v256_load_halves(lo, hi); +@endcode + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load_halves version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd256_width / sizeof(_Tp)> v256_load_halves(const _Tp* loptr, const _Tp* hiptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(loptr)); + CV_Assert(isAligned(hiptr)); +#endif + v_reg<_Tp, simd256_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes / 2; i++) + { + c.s[i] = loptr[i]; + c.s[i + c.nlanes / 2] = hiptr[i]; + } + return c; +} +#endif + +#if CV_SIMD512 +/** @brief Load register contents from two memory blocks + +@param loptr memory block containing data for first half (0..n/2) +@param hiptr memory block containing data for second half (n/2..n) + +@code{.cpp} +int lo[4] = { 1, 2, 3, 4, 5, 6, 7, 8 }, hi[4] = { 9, 10, 11, 12, 13, 14, 15, 16 }; +v_int32x16 r = v512_load_halves(lo, hi); +@endcode + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load_halves version to get maximum available register length result +*/ +template +inline v_reg<_Tp, simd512_width / sizeof(_Tp)> v512_load_halves(const _Tp* loptr, const _Tp* hiptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(loptr)); + CV_Assert(isAligned(hiptr)); +#endif + v_reg<_Tp, simd512_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes / 2; i++) + { + c.s[i] = loptr[i]; + c.s[i + c.nlanes / 2] = hiptr[i]; + } + return c; +} +#endif + /** @brief Load register contents from memory with double expand Same as cv::v_load, but result pack type will be 2x wider than memory type. @@ -1321,13 +1866,19 @@ Same as cv::v_load, but result pack type will be 2x wider than memory type. short buf[4] = {1, 2, 3, 4}; // type is int16 v_int32x4 r = v_load_expand(buf); // r = {1, 2, 3, 4} - type is int32 @endcode -For 8-, 16-, 32-bit integer source types. */ +For 8-, 16-, 32-bit integer source types. + +@note Use vx_load_expand version to get maximum available register length result +*/ template -inline v_reg::w_type, V_TypeTraits<_Tp>::nlanes128 / 2> +inline v_reg::w_type, simd128_width / sizeof(typename V_TypeTraits<_Tp>::w_type)> v_load_expand(const _Tp* ptr) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif typedef typename V_TypeTraits<_Tp>::w_type w_type; - v_reg::nlanes128> c; + v_reg c; for( int i = 0; i < c.nlanes; i++ ) { c.s[i] = ptr[i]; @@ -1335,20 +1886,88 @@ v_load_expand(const _Tp* ptr) return c; } +#if CV_SIMD256 +/** @brief Load register contents from memory with double expand + +Same as cv::v256_load, but result pack type will be 2x wider than memory type. + +@code{.cpp} +short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int16 +v_int32x8 r = v256_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is int32 +@endcode +For 8-, 16-, 32-bit integer source types. + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load_expand version to get maximum available register length result +*/ +template +inline v_reg::w_type, simd256_width / sizeof(typename V_TypeTraits<_Tp>::w_type)> +v256_load_expand(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + typedef typename V_TypeTraits<_Tp>::w_type w_type; + v_reg c; + for (int i = 0; i < c.nlanes; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + +#if CV_SIMD512 +/** @brief Load register contents from memory with double expand + +Same as cv::v512_load, but result pack type will be 2x wider than memory type. + +@code{.cpp} +short buf[8] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is int16 +v_int32x16 r = v512_load_expand(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - type is int32 +@endcode +For 8-, 16-, 32-bit integer source types. + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load_expand version to get maximum available register length result +*/ +template +inline v_reg::w_type, simd512_width / sizeof(typename V_TypeTraits<_Tp>::w_type)> +v512_load_expand(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + typedef typename V_TypeTraits<_Tp>::w_type w_type; + v_reg c; + for (int i = 0; i < c.nlanes; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + /** @brief Load register contents from memory with quad expand Same as cv::v_load_expand, but result type is 4 times wider than source. @code{.cpp} char buf[4] = {1, 2, 3, 4}; // type is int8 -v_int32x4 r = v_load_q(buf); // r = {1, 2, 3, 4} - type is int32 +v_int32x4 r = v_load_expand_q(buf); // r = {1, 2, 3, 4} - type is int32 @endcode -For 8-bit integer source types. */ +For 8-bit integer source types. + +@note Use vx_load_expand_q version to get maximum available register length result +*/ template -inline v_reg::q_type, V_TypeTraits<_Tp>::nlanes128 / 4> +inline v_reg::q_type, simd128_width / sizeof(typename V_TypeTraits<_Tp>::q_type)> v_load_expand_q(const _Tp* ptr) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif typedef typename V_TypeTraits<_Tp>::q_type q_type; - v_reg::nlanes128> c; + v_reg c; for( int i = 0; i < c.nlanes; i++ ) { c.s[i] = ptr[i]; @@ -1356,6 +1975,66 @@ v_load_expand_q(const _Tp* ptr) return c; } +#if CV_SIMD256 +/** @brief Load register contents from memory with quad expand + +Same as cv::v256_load_expand, but result type is 4 times wider than source. +@code{.cpp} +char buf[8] = {1, 2, 3, 4, 5, 6, 7, 8}; // type is int8 +v_int32x8 r = v256_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8} - type is int32 +@endcode +For 8-bit integer source types. + +@note Check CV_SIMD256 preprocessor definition prior to use. +Use vx_load_expand_q version to get maximum available register length result +*/ +template +inline v_reg::q_type, simd256_width / sizeof(typename V_TypeTraits<_Tp>::q_type)> +v256_load_expand_q(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + typedef typename V_TypeTraits<_Tp>::q_type q_type; + v_reg c; + for (int i = 0; i < c.nlanes; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + +#if CV_SIMD512 +/** @brief Load register contents from memory with quad expand + +Same as cv::v512_load_expand, but result type is 4 times wider than source. +@code{.cpp} +char buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}; // type is int8 +v_int32x16 r = v512_load_expand_q(buf); // r = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16} - type is int32 +@endcode +For 8-bit integer source types. + +@note Check CV_SIMD512 preprocessor definition prior to use. +Use vx_load_expand_q version to get maximum available register length result +*/ +template +inline v_reg::q_type, simd512_width / sizeof(typename V_TypeTraits<_Tp>::q_type)> +v512_load_expand_q(const _Tp* ptr) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + typedef typename V_TypeTraits<_Tp>::q_type q_type; + v_reg c; + for (int i = 0; i < c.nlanes; i++) + { + c.s[i] = ptr[i]; + } + return c; +} +#endif + /** @brief Load and deinterleave (2 channels) Load data from memory deinterleave and store to 2 registers. @@ -1367,6 +2046,9 @@ For all types except 64-bit. */ template inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, v_reg<_Tp, n>& b) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i2; for( i = i2 = 0; i < n; i++, i2 += 2 ) { @@ -1386,6 +2068,9 @@ For all types except 64-bit. */ template inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, v_reg<_Tp, n>& b, v_reg<_Tp, n>& c) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i3; for( i = i3 = 0; i < n; i++, i3 += 3 ) { @@ -1408,6 +2093,9 @@ inline void v_load_deinterleave(const _Tp* ptr, v_reg<_Tp, n>& a, v_reg<_Tp, n>& b, v_reg<_Tp, n>& c, v_reg<_Tp, n>& d) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i4; for( i = i4 = 0; i < n; i++, i4 += 4 ) { @@ -1431,6 +2119,9 @@ inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i2; for( i = i2 = 0; i < n; i++, i2 += 2 ) { @@ -1452,6 +2143,9 @@ inline void v_store_interleave( _Tp* ptr, const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, const v_reg<_Tp, n>& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i3; for( i = i3 = 0; i < n; i++, i3 += 3 ) { @@ -1474,6 +2168,9 @@ template inline void v_store_interleave( _Tp* ptr, const v_ const v_reg<_Tp, n>& d, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif int i, i4; for( i = i4 = 0; i < n; i++, i4 += 4 ) { @@ -1495,10 +2192,22 @@ Pointer can be unaligned. */ template inline void v_store(_Tp* ptr, const v_reg<_Tp, n>& a) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif for( int i = 0; i < n; i++ ) ptr[i] = a.s[i]; } +template +inline void v_store(_Tp* ptr, const v_reg<_Tp, n>& a, hal::StoreMode /*mode*/) +{ +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif + v_store(ptr, a); +} + /** @brief Store data to memory (lower half) Store lower half of register contents to memory. @@ -1509,6 +2218,9 @@ Scheme: template inline void v_store_low(_Tp* ptr, const v_reg<_Tp, n>& a) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif for( int i = 0; i < (n/2); i++ ) ptr[i] = a.s[i]; } @@ -1523,6 +2235,9 @@ Scheme: template inline void v_store_high(_Tp* ptr, const v_reg<_Tp, n>& a) { +#if CV_STRONG_ALIGNMENT + CV_Assert(isAligned(ptr)); +#endif for( int i = 0; i < (n/2); i++ ) ptr[i] = a.s[i+(n/2)]; } @@ -1538,22 +2253,22 @@ Pointer __should__ be aligned by 16-byte boundary. */ template inline void v_store_aligned(_Tp* ptr, const v_reg<_Tp, n>& a) { - for( int i = 0; i < n; i++ ) - ptr[i] = a.s[i]; + CV_Assert(isAligned)>(ptr)); + v_store(ptr, a); } template inline void v_store_aligned_nocache(_Tp* ptr, const v_reg<_Tp, n>& a) { - for( int i = 0; i < n; i++ ) - ptr[i] = a.s[i]; + CV_Assert(isAligned)>(ptr)); + v_store(ptr, a); } template inline void v_store_aligned(_Tp* ptr, const v_reg<_Tp, n>& a, hal::StoreMode /*mode*/) { - for( int i = 0; i < n; i++ ) - ptr[i] = a.s[i]; + CV_Assert(isAligned)>(ptr)); + v_store(ptr, a); } /** @brief Combine vector from first elements of two vectors @@ -1619,6 +2334,23 @@ inline void v_recombine(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b, } } +/** @brief Vector reverse order + +Reverse the order of the vector +Scheme: +@code + REG {A1 ... An} ==> REG {An ... A1} +@endcode +For all types. */ +template +inline v_reg<_Tp, n> v_reverse(const v_reg<_Tp, n>& a) +{ + v_reg<_Tp, n> c; + for( int i = 0; i < n; i++ ) + c.s[i] = a.s[n-i-1]; + return c; +} + /** @brief Vector extract Scheme: @@ -1651,9 +2383,47 @@ inline v_reg<_Tp, n> v_extract(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) return r; } -/** @brief Round +/** @brief Vector extract -Rounds each value. Input type is float vector ==> output type is int vector.*/ +Scheme: +Return the s-th element of v. +Restriction: 0 <= s < nlanes + +Usage: +@code +v_int32x4 a; +int r; +r = v_extract_n<2>(a); +@endcode +For all types. */ +template +inline _Tp v_extract_n(const v_reg<_Tp, n>& v) +{ + CV_DbgAssert(s >= 0 && s < n); + return v.s[s]; +} + +/** @brief Broadcast i-th element of vector + +Scheme: +@code +{ v[0] v[1] v[2] ... v[SZ] } => { v[i], v[i], v[i] ... v[i] } +@endcode +Restriction: 0 <= i < nlanes +Supported types: 32-bit integers and floats (s32/u32/f32) + */ +template +inline v_reg<_Tp, n> v_broadcast_element(const v_reg<_Tp, n>& a) +{ + CV_DbgAssert(i >= 0 && i < n); + return v_reg<_Tp, n>::all(a.s[i]); +} + +/** @brief Round elements + +Rounds each value. Input type is float vector ==> output type is int vector. +@note Only for floating point types. +*/ template inline v_reg v_round(const v_reg& a) { v_reg c; @@ -1674,9 +2444,11 @@ template inline v_reg v_round(const v_reg& a, const return c; } -/** @brief Floor +/** @brief Floor elements -Floor each value. Input type is float vector ==> output type is int vector.*/ +Floor each value. Input type is float vector ==> output type is int vector. +@note Only for floating point types. +*/ template inline v_reg v_floor(const v_reg& a) { v_reg c; @@ -1685,9 +2457,11 @@ template inline v_reg v_floor(const v_reg& a) return c; } -/** @brief Ceil +/** @brief Ceil elements -Ceil each value. Input type is float vector ==> output type is int vector.*/ +Ceil each value. Input type is float vector ==> output type is int vector. +@note Only for floating point types. +*/ template inline v_reg v_ceil(const v_reg& a) { v_reg c; @@ -1696,9 +2470,11 @@ template inline v_reg v_ceil(const v_reg& a) return c; } -/** @brief Trunc +/** @brief Truncate elements -Truncate each value. Input type is float vector ==> output type is int vector.*/ +Truncate each value. Input type is float vector ==> output type is int vector. +@note Only for floating point types. +*/ template inline v_reg v_trunc(const v_reg& a) { v_reg c; @@ -1722,7 +2498,7 @@ template inline v_reg v_round(const v_reg& a) /** @overload */ template inline v_reg v_floor(const v_reg& a) { - v_reg c; + v_reg c; for( int i = 0; i < n; i++ ) { c.s[i] = cvFloor(a.s[i]); @@ -1734,7 +2510,7 @@ template inline v_reg v_floor(const v_reg& a) /** @overload */ template inline v_reg v_ceil(const v_reg& a) { - v_reg c; + v_reg c; for( int i = 0; i < n; i++ ) { c.s[i] = cvCeil(a.s[i]); @@ -1746,10 +2522,10 @@ template inline v_reg v_ceil(const v_reg& a) /** @overload */ template inline v_reg v_trunc(const v_reg& a) { - v_reg c; + v_reg c; for( int i = 0; i < n; i++ ) { - c.s[i] = cvCeil(a.s[i]); + c.s[i] = (int)(a.s[i]); c.s[i+n] = 0; } return c; @@ -1757,7 +2533,7 @@ template inline v_reg v_trunc(const v_reg& a) /** @brief Convert to float -Supported input type is cv::v_int32x4. */ +Supported input type is cv::v_int32. */ template inline v_reg v_cvt_f32(const v_reg& a) { v_reg c; @@ -1766,6 +2542,23 @@ template inline v_reg v_cvt_f32(const v_reg& a) return c; } +/** @brief Convert lower half to float + +Supported input type is cv::v_float64. */ +template inline v_reg v_cvt_f32(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < n; i++ ) + { + c.s[i] = (float)a.s[i]; + c.s[i+n] = 0; + } + return c; +} + +/** @brief Convert to float + +Supported input type is cv::v_float64. */ template inline v_reg v_cvt_f32(const v_reg& a, const v_reg& b) { v_reg c; @@ -1777,10 +2570,54 @@ template inline v_reg v_cvt_f32(const v_reg& a, co return c; } +/** @brief Convert lower half to double + +Supported input type is cv::v_int32. */ +template CV_INLINE v_reg v_cvt_f64(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < (n/2); i++ ) + c.s[i] = (double)a.s[i]; + return c; +} + +/** @brief Convert to double high part of vector + +Supported input type is cv::v_int32. */ +template CV_INLINE v_reg v_cvt_f64_high(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < (n/2); i++ ) + c.s[i] = (double)a.s[i + (n/2)]; + return c; +} + +/** @brief Convert lower half to double + +Supported input type is cv::v_float32. */ +template CV_INLINE v_reg v_cvt_f64(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < (n/2); i++ ) + c.s[i] = (double)a.s[i]; + return c; +} + +/** @brief Convert to double high part of vector + +Supported input type is cv::v_float32. */ +template CV_INLINE v_reg v_cvt_f64_high(const v_reg& a) +{ + v_reg c; + for( int i = 0; i < (n/2); i++ ) + c.s[i] = (double)a.s[i + (n/2)]; + return c; +} + /** @brief Convert to double -Supported input type is cv::v_int32x4. */ -template inline v_reg v_cvt_f64(const v_reg& a) +Supported input type is cv::v_int64. */ +template CV_INLINE v_reg v_cvt_f64(const v_reg& a) { v_reg c; for( int i = 0; i < n; i++ ) @@ -1788,35 +2625,25 @@ template inline v_reg v_cvt_f64(const v_reg& a) return c; } -/** @brief Convert to double -Supported input type is cv::v_float32x4. */ -template inline v_reg v_cvt_f64(const v_reg& a) +template inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut(const _Tp* tab, const int* idx) { - v_reg c; - for( int i = 0; i < n; i++ ) - c.s[i] = (double)a.s[i]; - return c; -} - -template inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_lut(const _Tp* tab, const int* idx) -{ - v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> c; - for (int i = 0; i < V_TypeTraits<_Tp>::nlanes128; i++) + v_reg<_Tp, simd128_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes; i++) c.s[i] = tab[idx[i]]; return c; } -template inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_lut_pairs(const _Tp* tab, const int* idx) +template inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut_pairs(const _Tp* tab, const int* idx) { - v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> c; - for (int i = 0; i < V_TypeTraits<_Tp>::nlanes128; i++) + v_reg<_Tp, simd128_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes; i++) c.s[i] = tab[idx[i / 2] + i % 2]; return c; } -template inline v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> v_lut_quads(const _Tp* tab, const int* idx) +template inline v_reg<_Tp, simd128_width / sizeof(_Tp)> v_lut_quads(const _Tp* tab, const int* idx) { - v_reg<_Tp, V_TypeTraits<_Tp>::nlanes128> c; - for (int i = 0; i < V_TypeTraits<_Tp>::nlanes128; i++) + v_reg<_Tp, simd128_width / sizeof(_Tp)> c; + for (int i = 0; i < c.nlanes; i++) c.s[i] = tab[idx[i / 4] + i % 4]; return c; } @@ -1845,14 +2672,15 @@ template inline v_reg v_lut(const float* tab, const v_reg inline v_reg v_lut(const double* tab, const v_reg& idx) +template inline v_reg v_lut(const double* tab, const v_reg& idx) { - v_reg c; - for( int i = 0; i < n; i++ ) + v_reg c; + for( int i = 0; i < n/2; i++ ) c.s[i] = tab[idx.s[i]]; return c; } + template inline void v_lut_deinterleave(const float* tab, const v_reg& idx, v_reg& x, v_reg& y) { @@ -1877,7 +2705,7 @@ template inline void v_lut_deinterleave(const double* tab, const v_reg inline v_reg<_Tp, n> v_interleave_pairs(const v_reg<_Tp, n>& vec) { - v_reg c; + v_reg<_Tp, n> c; for (int i = 0; i < n/4; i++) { c.s[4*i ] = vec.s[4*i ]; @@ -1890,7 +2718,7 @@ template inline v_reg<_Tp, n> v_interleave_pairs(const v_re template inline v_reg<_Tp, n> v_interleave_quads(const v_reg<_Tp, n>& vec) { - v_reg c; + v_reg<_Tp, n> c; for (int i = 0; i < n/8; i++) { c.s[8*i ] = vec.s[8*i ]; @@ -1907,7 +2735,7 @@ template inline v_reg<_Tp, n> v_interleave_quads(const v_re template inline v_reg<_Tp, n> v_pack_triplets(const v_reg<_Tp, n>& vec) { - v_reg c; + v_reg<_Tp, n> c; for (int i = 0; i < n/4; i++) { c.s[3*i ] = vec.s[4*i ]; @@ -1932,146 +2760,205 @@ b2 {A3 B3 C3 D3} b3 {A4 B4 C4 D4} @endcode */ -template -inline void v_transpose4x4( v_reg<_Tp, 4>& a0, const v_reg<_Tp, 4>& a1, - const v_reg<_Tp, 4>& a2, const v_reg<_Tp, 4>& a3, - v_reg<_Tp, 4>& b0, v_reg<_Tp, 4>& b1, - v_reg<_Tp, 4>& b2, v_reg<_Tp, 4>& b3 ) +template +inline void v_transpose4x4( v_reg<_Tp, n>& a0, const v_reg<_Tp, n>& a1, + const v_reg<_Tp, n>& a2, const v_reg<_Tp, n>& a3, + v_reg<_Tp, n>& b0, v_reg<_Tp, n>& b1, + v_reg<_Tp, n>& b2, v_reg<_Tp, n>& b3 ) { - b0 = v_reg<_Tp, 4>(a0.s[0], a1.s[0], a2.s[0], a3.s[0]); - b1 = v_reg<_Tp, 4>(a0.s[1], a1.s[1], a2.s[1], a3.s[1]); - b2 = v_reg<_Tp, 4>(a0.s[2], a1.s[2], a2.s[2], a3.s[2]); - b3 = v_reg<_Tp, 4>(a0.s[3], a1.s[3], a2.s[3], a3.s[3]); + for (int i = 0; i < n / 4; i++) + { + b0.s[0 + i*4] = a0.s[0 + i*4]; b0.s[1 + i*4] = a1.s[0 + i*4]; + b0.s[2 + i*4] = a2.s[0 + i*4]; b0.s[3 + i*4] = a3.s[0 + i*4]; + b1.s[0 + i*4] = a0.s[1 + i*4]; b1.s[1 + i*4] = a1.s[1 + i*4]; + b1.s[2 + i*4] = a2.s[1 + i*4]; b1.s[3 + i*4] = a3.s[1 + i*4]; + b2.s[0 + i*4] = a0.s[2 + i*4]; b2.s[1 + i*4] = a1.s[2 + i*4]; + b2.s[2 + i*4] = a2.s[2 + i*4]; b2.s[3 + i*4] = a3.s[2 + i*4]; + b3.s[0 + i*4] = a0.s[3 + i*4]; b3.s[1 + i*4] = a1.s[3 + i*4]; + b3.s[2 + i*4] = a2.s[3 + i*4]; b3.s[3 + i*4] = a3.s[3 + i*4]; + } } //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_INIT_ZERO(_Tpvec, _Tp, suffix) \ -inline _Tpvec v_setzero_##suffix() { return _Tpvec::zero(); } +#define OPENCV_HAL_IMPL_C_INIT_ZERO(_Tpvec, prefix, suffix) \ +inline _Tpvec prefix##_setzero_##suffix() { return _Tpvec::zero(); } //! @name Init with zero //! @{ //! @brief Create new vector with zero elements -OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x16, uchar, u8) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x16, schar, s8) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x8, ushort, u16) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x8, short, s16) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x4, unsigned, u32) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x4, int, s32) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x4, float, f32) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x2, double, f64) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x2, uint64, u64) -OPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x16, v, u8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x16, v, s8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x8, v, u16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x8, v, s16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x4, v, u32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x4, v, s32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x4, v, f32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x2, v, f64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x2, v, u64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x2, v, s64) + +#if CV_SIMD256 +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x32, v256, u8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x32, v256, s8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x16, v256, u16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x16, v256, s16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x8, v256, u32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x8, v256, s32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x8, v256, f32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x4, v256, f64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x4, v256, u64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x4, v256, s64) +#endif + +#if CV_SIMD512 +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint8x64, v512, u8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int8x64, v512, s8) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint16x32, v512, u16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int16x32, v512, s16) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint32x16, v512, u32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int32x16, v512, s32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float32x16, v512, f32) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_float64x8, v512, f64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_uint64x8, v512, u64) +OPENCV_HAL_IMPL_C_INIT_ZERO(v_int64x8, v512, s64) +#endif //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_INIT_VAL(_Tpvec, _Tp, suffix) \ -inline _Tpvec v_setall_##suffix(_Tp val) { return _Tpvec::all(val); } +#define OPENCV_HAL_IMPL_C_INIT_VAL(_Tpvec, _Tp, prefix, suffix) \ +inline _Tpvec prefix##_setall_##suffix(_Tp val) { return _Tpvec::all(val); } //! @name Init with value //! @{ //! @brief Create new vector with elements set to a specific value -OPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x16, uchar, u8) -OPENCV_HAL_IMPL_C_INIT_VAL(v_int8x16, schar, s8) -OPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x8, ushort, u16) -OPENCV_HAL_IMPL_C_INIT_VAL(v_int16x8, short, s16) -OPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x4, unsigned, u32) -OPENCV_HAL_IMPL_C_INIT_VAL(v_int32x4, int, s32) -OPENCV_HAL_IMPL_C_INIT_VAL(v_float32x4, float, f32) -OPENCV_HAL_IMPL_C_INIT_VAL(v_float64x2, double, f64) -OPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x2, uint64, u64) -OPENCV_HAL_IMPL_C_INIT_VAL(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x16, uchar, v, u8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int8x16, schar, v, s8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x8, ushort, v, u16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int16x8, short, v, s16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x4, unsigned, v, u32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int32x4, int, v, s32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float32x4, float, v, f32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float64x2, double, v, f64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x2, uint64, v, u64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int64x2, int64, v, s64) + +#if CV_SIMD256 +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x32, uchar, v256, u8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int8x32, schar, v256, s8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x16, ushort, v256, u16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int16x16, short, v256, s16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x8, unsigned, v256, u32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int32x8, int, v256, s32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float32x8, float, v256, f32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float64x4, double, v256, f64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x4, uint64, v256, u64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int64x4, int64, v256, s64) +#endif + +#if CV_SIMD512 +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint8x64, uchar, v512, u8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int8x64, schar, v512, s8) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint16x32, ushort, v512, u16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int16x32, short, v512, s16) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint32x16, unsigned, v512, u32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int32x16, int, v512, s32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float32x16, float, v512, f32) +OPENCV_HAL_IMPL_C_INIT_VAL(v_float64x8, double, v512, f64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_uint64x8, uint64, v512, u64) +OPENCV_HAL_IMPL_C_INIT_VAL(v_int64x8, int64, v512, s64) +#endif //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_REINTERPRET(_Tpvec, _Tp, suffix) \ -template inline _Tpvec \ +#define OPENCV_HAL_IMPL_C_REINTERPRET(_Tp, suffix) \ +template inline v_reg<_Tp, n0*sizeof(_Tp0)/sizeof(_Tp)> \ v_reinterpret_as_##suffix(const v_reg<_Tp0, n0>& a) \ -{ return a.template reinterpret_as<_Tp, _Tpvec::nlanes>(); } +{ return a.template reinterpret_as<_Tp, n0*sizeof(_Tp0)/sizeof(_Tp)>(); } //! @name Reinterpret //! @{ //! @brief Convert vector to different type without modifying underlying data. -OPENCV_HAL_IMPL_C_REINTERPRET(v_uint8x16, uchar, u8) -OPENCV_HAL_IMPL_C_REINTERPRET(v_int8x16, schar, s8) -OPENCV_HAL_IMPL_C_REINTERPRET(v_uint16x8, ushort, u16) -OPENCV_HAL_IMPL_C_REINTERPRET(v_int16x8, short, s16) -OPENCV_HAL_IMPL_C_REINTERPRET(v_uint32x4, unsigned, u32) -OPENCV_HAL_IMPL_C_REINTERPRET(v_int32x4, int, s32) -OPENCV_HAL_IMPL_C_REINTERPRET(v_float32x4, float, f32) -OPENCV_HAL_IMPL_C_REINTERPRET(v_float64x2, double, f64) -OPENCV_HAL_IMPL_C_REINTERPRET(v_uint64x2, uint64, u64) -OPENCV_HAL_IMPL_C_REINTERPRET(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_C_REINTERPRET(uchar, u8) +OPENCV_HAL_IMPL_C_REINTERPRET(schar, s8) +OPENCV_HAL_IMPL_C_REINTERPRET(ushort, u16) +OPENCV_HAL_IMPL_C_REINTERPRET(short, s16) +OPENCV_HAL_IMPL_C_REINTERPRET(unsigned, u32) +OPENCV_HAL_IMPL_C_REINTERPRET(int, s32) +OPENCV_HAL_IMPL_C_REINTERPRET(float, f32) +OPENCV_HAL_IMPL_C_REINTERPRET(double, f64) +OPENCV_HAL_IMPL_C_REINTERPRET(uint64, u64) +OPENCV_HAL_IMPL_C_REINTERPRET(int64, s64) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_SHIFTL(_Tpvec, _Tp) \ -template inline _Tpvec v_shl(const _Tpvec& a) \ -{ return a << n; } +#define OPENCV_HAL_IMPL_C_SHIFTL(_Tp) \ +template inline v_reg<_Tp, n> v_shl(const v_reg<_Tp, n>& a) \ +{ return a << shift; } //! @name Left shift //! @{ //! @brief Shift left -OPENCV_HAL_IMPL_C_SHIFTL(v_uint16x8, ushort) -OPENCV_HAL_IMPL_C_SHIFTL(v_int16x8, short) -OPENCV_HAL_IMPL_C_SHIFTL(v_uint32x4, unsigned) -OPENCV_HAL_IMPL_C_SHIFTL(v_int32x4, int) -OPENCV_HAL_IMPL_C_SHIFTL(v_uint64x2, uint64) -OPENCV_HAL_IMPL_C_SHIFTL(v_int64x2, int64) +OPENCV_HAL_IMPL_C_SHIFTL(ushort) +OPENCV_HAL_IMPL_C_SHIFTL(short) +OPENCV_HAL_IMPL_C_SHIFTL(unsigned) +OPENCV_HAL_IMPL_C_SHIFTL(int) +OPENCV_HAL_IMPL_C_SHIFTL(uint64) +OPENCV_HAL_IMPL_C_SHIFTL(int64) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_SHIFTR(_Tpvec, _Tp) \ -template inline _Tpvec v_shr(const _Tpvec& a) \ -{ return a >> n; } +#define OPENCV_HAL_IMPL_C_SHIFTR(_Tp) \ +template inline v_reg<_Tp, n> v_shr(const v_reg<_Tp, n>& a) \ +{ return a >> shift; } //! @name Right shift //! @{ //! @brief Shift right -OPENCV_HAL_IMPL_C_SHIFTR(v_uint16x8, ushort) -OPENCV_HAL_IMPL_C_SHIFTR(v_int16x8, short) -OPENCV_HAL_IMPL_C_SHIFTR(v_uint32x4, unsigned) -OPENCV_HAL_IMPL_C_SHIFTR(v_int32x4, int) -OPENCV_HAL_IMPL_C_SHIFTR(v_uint64x2, uint64) -OPENCV_HAL_IMPL_C_SHIFTR(v_int64x2, int64) +OPENCV_HAL_IMPL_C_SHIFTR(ushort) +OPENCV_HAL_IMPL_C_SHIFTR(short) +OPENCV_HAL_IMPL_C_SHIFTR(unsigned) +OPENCV_HAL_IMPL_C_SHIFTR(int) +OPENCV_HAL_IMPL_C_SHIFTR(uint64) +OPENCV_HAL_IMPL_C_SHIFTR(int64) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_RSHIFTR(_Tpvec, _Tp) \ -template inline _Tpvec v_rshr(const _Tpvec& a) \ +#define OPENCV_HAL_IMPL_C_RSHIFTR(_Tp) \ +template inline v_reg<_Tp, n> v_rshr(const v_reg<_Tp, n>& a) \ { \ - _Tpvec c; \ - for( int i = 0; i < _Tpvec::nlanes; i++ ) \ - c.s[i] = (_Tp)((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + v_reg<_Tp, n> c; \ + for( int i = 0; i < n; i++ ) \ + c.s[i] = (_Tp)((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \ return c; \ } //! @name Rounding shift //! @{ //! @brief Rounding shift right -OPENCV_HAL_IMPL_C_RSHIFTR(v_uint16x8, ushort) -OPENCV_HAL_IMPL_C_RSHIFTR(v_int16x8, short) -OPENCV_HAL_IMPL_C_RSHIFTR(v_uint32x4, unsigned) -OPENCV_HAL_IMPL_C_RSHIFTR(v_int32x4, int) -OPENCV_HAL_IMPL_C_RSHIFTR(v_uint64x2, uint64) -OPENCV_HAL_IMPL_C_RSHIFTR(v_int64x2, int64) +OPENCV_HAL_IMPL_C_RSHIFTR(ushort) +OPENCV_HAL_IMPL_C_RSHIFTR(short) +OPENCV_HAL_IMPL_C_RSHIFTR(unsigned) +OPENCV_HAL_IMPL_C_RSHIFTR(int) +OPENCV_HAL_IMPL_C_RSHIFTR(uint64) +OPENCV_HAL_IMPL_C_RSHIFTR(int64) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_PACK(_Tpvec, _Tpnvec, _Tpn, pack_suffix, cast) \ -inline _Tpnvec v_##pack_suffix(const _Tpvec& a, const _Tpvec& b) \ +#define OPENCV_HAL_IMPL_C_PACK(_Tp, _Tpn, pack_suffix, cast) \ +template inline v_reg<_Tpn, 2*n> v_##pack_suffix(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ - _Tpnvec c; \ - for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + v_reg<_Tpn, 2*n> c; \ + for( int i = 0; i < n; i++ ) \ { \ c.s[i] = cast<_Tpn>(a.s[i]); \ - c.s[i+_Tpvec::nlanes] = cast<_Tpn>(b.s[i]); \ + c.s[i+n] = cast<_Tpn>(b.s[i]); \ } \ return c; \ } @@ -2087,26 +2974,26 @@ inline _Tpnvec v_##pack_suffix(const _Tpvec& a, const _Tpvec& b) \ //! - pack_u: for 16- and 32-bit signed integer input types //! //! @note All variants except 64-bit use saturation. -OPENCV_HAL_IMPL_C_PACK(v_uint16x8, v_uint8x16, uchar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK(v_int16x8, v_int8x16, schar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK(v_uint32x4, v_uint16x8, ushort, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK(v_int32x4, v_int16x8, short, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK(v_uint64x2, v_uint32x4, unsigned, pack, static_cast) -OPENCV_HAL_IMPL_C_PACK(v_int64x2, v_int32x4, int, pack, static_cast) -OPENCV_HAL_IMPL_C_PACK(v_int16x8, v_uint8x16, uchar, pack_u, saturate_cast) -OPENCV_HAL_IMPL_C_PACK(v_int32x4, v_uint16x8, ushort, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(ushort, uchar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(short, schar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(unsigned, ushort, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(int, short, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(uint64, unsigned, pack, static_cast) +OPENCV_HAL_IMPL_C_PACK(int64, int, pack, static_cast) +OPENCV_HAL_IMPL_C_PACK(short, uchar, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_PACK(int, ushort, pack_u, saturate_cast) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_RSHR_PACK(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix, cast) \ -template inline _Tpnvec v_rshr_##pack_suffix(const _Tpvec& a, const _Tpvec& b) \ +#define OPENCV_HAL_IMPL_C_RSHR_PACK(_Tp, _Tpn, pack_suffix, cast) \ +template inline v_reg<_Tpn, 2*n> v_rshr_##pack_suffix(const v_reg<_Tp, n>& a, const v_reg<_Tp, n>& b) \ { \ - _Tpnvec c; \ - for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + v_reg<_Tpn, 2*n> c; \ + for( int i = 0; i < n; i++ ) \ { \ - c.s[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ - c.s[i+_Tpvec::nlanes] = cast<_Tpn>((b.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + c.s[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \ + c.s[i+n] = cast<_Tpn>((b.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \ } \ return c; \ } @@ -2122,22 +3009,22 @@ template inline _Tpnvec v_rshr_##pack_suffix(const _Tpvec& a, const _Tpve //! - pack_u: for 16- and 32-bit signed integer input types //! //! @note All variants except 64-bit use saturation. -OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint16x8, ushort, v_uint8x16, uchar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_int16x8, short, v_int8x16, schar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint32x4, unsigned, v_uint16x8, ushort, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_int32x4, int, v_int16x8, short, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_uint64x2, uint64, v_uint32x4, unsigned, pack, static_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_int64x2, int64, v_int32x4, int, pack, static_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_int16x8, short, v_uint8x16, uchar, pack_u, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK(v_int32x4, int, v_uint16x8, ushort, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(ushort, uchar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(short, schar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(unsigned, ushort, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(int, short, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(uint64, unsigned, pack, static_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(int64, int, pack, static_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(short, uchar, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK(int, ushort, pack_u, saturate_cast) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_PACK_STORE(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix, cast) \ -inline void v_##pack_suffix##_store(_Tpn* ptr, const _Tpvec& a) \ +#define OPENCV_HAL_IMPL_C_PACK_STORE(_Tp, _Tpn, pack_suffix, cast) \ +template inline void v_##pack_suffix##_store(_Tpn* ptr, const v_reg<_Tp, n>& a) \ { \ - for( int i = 0; i < _Tpvec::nlanes; i++ ) \ + for( int i = 0; i < n; i++ ) \ ptr[i] = cast<_Tpn>(a.s[i]); \ } @@ -2152,23 +3039,23 @@ inline void v_##pack_suffix##_store(_Tpn* ptr, const _Tpvec& a) \ //! - pack_u: for 16- and 32-bit signed integer input types //! //! @note All variants except 64-bit use saturation. -OPENCV_HAL_IMPL_C_PACK_STORE(v_uint16x8, ushort, v_uint8x16, uchar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_int16x8, short, v_int8x16, schar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_uint32x4, unsigned, v_uint16x8, ushort, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_int32x4, int, v_int16x8, short, pack, saturate_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_uint64x2, uint64, v_uint32x4, unsigned, pack, static_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_int64x2, int64, v_int32x4, int, pack, static_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_int16x8, short, v_uint8x16, uchar, pack_u, saturate_cast) -OPENCV_HAL_IMPL_C_PACK_STORE(v_int32x4, int, v_uint16x8, ushort, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(ushort, uchar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(short, schar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(unsigned, ushort, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(int, short, pack, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(uint64, unsigned, pack, static_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(int64, int, pack, static_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(short, uchar, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_PACK_STORE(int, ushort, pack_u, saturate_cast) //! @} //! @brief Helper macro //! @ingroup core_hal_intrin_impl -#define OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(_Tpvec, _Tp, _Tpnvec, _Tpn, pack_suffix, cast) \ -template inline void v_rshr_##pack_suffix##_store(_Tpn* ptr, const _Tpvec& a) \ +#define OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(_Tp, _Tpn, pack_suffix, cast) \ +template inline void v_rshr_##pack_suffix##_store(_Tpn* ptr, const v_reg<_Tp, n>& a) \ { \ - for( int i = 0; i < _Tpvec::nlanes; i++ ) \ - ptr[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (n - 1))) >> n); \ + for( int i = 0; i < n; i++ ) \ + ptr[i] = cast<_Tpn>((a.s[i] + ((_Tp)1 << (shift - 1))) >> shift); \ } //! @name Pack and store with rounding shift @@ -2182,14 +3069,14 @@ template inline void v_rshr_##pack_suffix##_store(_Tpn* ptr, const _Tpvec //! - pack_u: for 16- and 32-bit signed integer input types //! //! @note All variants except 64-bit use saturation. -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint16x8, ushort, v_uint8x16, uchar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int16x8, short, v_int8x16, schar, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint32x4, unsigned, v_uint16x8, ushort, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int32x4, int, v_int16x8, short, pack, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_uint64x2, uint64, v_uint32x4, unsigned, pack, static_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int64x2, int64, v_int32x4, int, pack, static_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int16x8, short, v_uint8x16, uchar, pack_u, saturate_cast) -OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(v_int32x4, int, v_uint16x8, ushort, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(ushort, uchar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(short, schar, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(unsigned, ushort, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int, short, pack, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(uint64, unsigned, pack, static_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int64, int, pack, static_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(short, uchar, pack_u, saturate_cast) +OPENCV_HAL_IMPL_C_RSHR_PACK_STORE(int, ushort, pack_u, saturate_cast) //! @} //! @cond IGNORED @@ -2224,9 +3111,9 @@ b {0xFFFF 0 0xFFFF 0 0 0xFFFF 0 0xFFFF} } @endcode */ -inline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b) +template inline v_reg v_pack_b(const v_reg& a, const v_reg& b) { - v_uint8x16 mask; + v_reg mask; _pack_b(mask.s, a, b); return mask; } @@ -2247,12 +3134,12 @@ d {0 0xFFFF.. 0 0xFFFF..} } @endcode */ -inline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b, - const v_uint32x4& c, const v_uint32x4& d) +template inline v_reg v_pack_b(const v_reg& a, const v_reg& b, + const v_reg& c, const v_reg& d) { - v_uint8x16 mask; + v_reg mask; _pack_b(mask.s, a, b); - _pack_b(mask.s + 8, c, d); + _pack_b(mask.s + 2*n, c, d); return mask; } @@ -2276,15 +3163,16 @@ h {0 0xFFFF..} 0xFF 0 0xFF 0 0 0xFF 0 0xFF } @endcode */ -inline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c, - const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f, - const v_uint64x2& g, const v_uint64x2& h) +template inline v_reg v_pack_b(const v_reg& a, const v_reg& b, + const v_reg& c, const v_reg& d, + const v_reg& e, const v_reg& f, + const v_reg& g, const v_reg& h) { - v_uint8x16 mask; + v_reg mask; _pack_b(mask.s, a, b); - _pack_b(mask.s + 4, c, d); - _pack_b(mask.s + 8, e, f); - _pack_b(mask.s + 12, g, h); + _pack_b(mask.s + 2*n, c, d); + _pack_b(mask.s + 4*n, e, f); + _pack_b(mask.s + 6*n, g, h); return mask; } //! @} @@ -2299,60 +3187,109 @@ Scheme: {D0 D1 D2 D3} x |V3| ==================== {R0 R1 R2 R3}, where: -R0 = A0V0 + A1V1 + A2V2 + A3V3, -R1 = B0V0 + B1V1 + B2V2 + B3V3 +R0 = A0V0 + B0V1 + C0V2 + D0V3, +R1 = A1V0 + B1V1 + C1V2 + D1V3 ... @endcode */ -inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, - const v_float32x4& m1, const v_float32x4& m2, - const v_float32x4& m3) +template +inline v_reg v_matmul(const v_reg& v, + const v_reg& a, const v_reg& b, + const v_reg& c, const v_reg& d) { - return v_float32x4(v.s[0]*m0.s[0] + v.s[1]*m1.s[0] + v.s[2]*m2.s[0] + v.s[3]*m3.s[0], - v.s[0]*m0.s[1] + v.s[1]*m1.s[1] + v.s[2]*m2.s[1] + v.s[3]*m3.s[1], - v.s[0]*m0.s[2] + v.s[1]*m1.s[2] + v.s[2]*m2.s[2] + v.s[3]*m3.s[2], - v.s[0]*m0.s[3] + v.s[1]*m1.s[3] + v.s[2]*m2.s[3] + v.s[3]*m3.s[3]); + v_reg res; + for (int i = 0; i < n / 4; i++) + { + res.s[0 + i*4] = v.s[0 + i*4] * a.s[0 + i*4] + v.s[1 + i*4] * b.s[0 + i*4] + v.s[2 + i*4] * c.s[0 + i*4] + v.s[3 + i*4] * d.s[0 + i*4]; + res.s[1 + i*4] = v.s[0 + i*4] * a.s[1 + i*4] + v.s[1 + i*4] * b.s[1 + i*4] + v.s[2 + i*4] * c.s[1 + i*4] + v.s[3 + i*4] * d.s[1 + i*4]; + res.s[2 + i*4] = v.s[0 + i*4] * a.s[2 + i*4] + v.s[1 + i*4] * b.s[2 + i*4] + v.s[2 + i*4] * c.s[2 + i*4] + v.s[3 + i*4] * d.s[2 + i*4]; + res.s[3 + i*4] = v.s[0 + i*4] * a.s[3 + i*4] + v.s[1 + i*4] * b.s[3 + i*4] + v.s[2 + i*4] * c.s[3 + i*4] + v.s[3 + i*4] * d.s[3 + i*4]; + } + return res; } /** @brief Matrix multiplication and add Scheme: @code -{A0 A1 A2 } |V0| |D0| -{B0 B1 B2 } |V1| |D1| -{C0 C1 C2 } x |V2| + |D2| -==================== +{A0 A1 A2 A3} |V0| |D0| +{B0 B1 B2 B3} |V1| |D1| +{C0 C1 C2 C3} x |V2| + |D2| +==================== |D3| {R0 R1 R2 R3}, where: -R0 = A0V0 + A1V1 + A2V2 + D0, -R1 = B0V0 + B1V1 + B2V2 + D1 +R0 = A0V0 + B0V1 + C0V2 + D0, +R1 = A1V0 + B1V1 + C1V2 + D1 ... @endcode */ -inline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0, - const v_float32x4& m1, const v_float32x4& m2, - const v_float32x4& m3) +template +inline v_reg v_matmuladd(const v_reg& v, + const v_reg& a, const v_reg& b, + const v_reg& c, const v_reg& d) { - return v_float32x4(v.s[0]*m0.s[0] + v.s[1]*m1.s[0] + v.s[2]*m2.s[0] + m3.s[0], - v.s[0]*m0.s[1] + v.s[1]*m1.s[1] + v.s[2]*m2.s[1] + m3.s[1], - v.s[0]*m0.s[2] + v.s[1]*m1.s[2] + v.s[2]*m2.s[2] + m3.s[2], - v.s[0]*m0.s[3] + v.s[1]*m1.s[3] + v.s[2]*m2.s[3] + m3.s[3]); + v_reg res; + for (int i = 0; i < n / 4; i++) + { + res.s[0 + i * 4] = v.s[0 + i * 4] * a.s[0 + i * 4] + v.s[1 + i * 4] * b.s[0 + i * 4] + v.s[2 + i * 4] * c.s[0 + i * 4] + d.s[0 + i * 4]; + res.s[1 + i * 4] = v.s[0 + i * 4] * a.s[1 + i * 4] + v.s[1 + i * 4] * b.s[1 + i * 4] + v.s[2 + i * 4] * c.s[1 + i * 4] + d.s[1 + i * 4]; + res.s[2 + i * 4] = v.s[0 + i * 4] * a.s[2 + i * 4] + v.s[1 + i * 4] * b.s[2 + i * 4] + v.s[2 + i * 4] * c.s[2 + i * 4] + d.s[2 + i * 4]; + res.s[3 + i * 4] = v.s[0 + i * 4] * a.s[3 + i * 4] + v.s[1 + i * 4] * b.s[3 + i * 4] + v.s[2 + i * 4] * c.s[3 + i * 4] + d.s[3 + i * 4]; + } + return res; } + +template inline v_reg v_dotprod_expand(const v_reg& a, const v_reg& b) +{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_cvt_f64_high(a) * v_cvt_f64_high(b)); } +template inline v_reg v_dotprod_expand(const v_reg& a, const v_reg& b, + const v_reg& c) +{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_fma(v_cvt_f64_high(a), v_cvt_f64_high(b), c)); } + +template inline v_reg v_dotprod_expand_fast(const v_reg& a, const v_reg& b) +{ return v_dotprod_expand(a, b); } +template inline v_reg v_dotprod_expand_fast(const v_reg& a, const v_reg& b, + const v_reg& c) +{ return v_dotprod_expand(a, b, c); } + ////// FP16 support /////// -inline v_reg::nlanes128> +inline v_reg v_load_expand(const float16_t* ptr) { - v_reg::nlanes128> v; + v_reg v; for( int i = 0; i < v.nlanes; i++ ) { v.s[i] = ptr[i]; } return v; } +#if CV_SIMD256 +inline v_reg +v256_load_expand(const float16_t* ptr) +{ + v_reg v; + for (int i = 0; i < v.nlanes; i++) + { + v.s[i] = ptr[i]; + } + return v; +} +#endif +#if CV_SIMD512 +inline v_reg +v512_load_expand(const float16_t* ptr) +{ + v_reg v; + for (int i = 0; i < v.nlanes; i++) + { + v.s[i] = ptr[i]; + } + return v; +} +#endif -inline void -v_pack_store(float16_t* ptr, v_reg::nlanes128>& v) +template inline void +v_pack_store(float16_t* ptr, const v_reg& v) { for( int i = 0; i < v.nlanes; i++ ) { @@ -2361,16 +3298,12 @@ v_pack_store(float16_t* ptr, v_reg::nlanes128>& v) } inline void v_cleanup() {} - -//! @} - -//! @name Check SIMD support -//! @{ -//! @brief Check CPU capability of SIMD operation -static inline bool hasSIMD128() -{ - return false; -} +#if CV_SIMD256 +inline void v256_cleanup() {} +#endif +#if CV_SIMD512 +inline void v512_cleanup() {} +#endif //! @} @@ -2379,4 +3312,9 @@ CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END #endif } +#if !defined(CV_DOXYGEN) +#undef CV_SIMD256 +#undef CV_SIMD512 +#endif + #endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_forward.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_forward.hpp similarity index 81% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_forward.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_forward.hpp index 4618552..979f15a 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_forward.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_forward.hpp @@ -14,9 +14,32 @@ namespace cv CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN /** Types **/ -#if CV__SIMD_FORWARD == 512 -// [todo] 512 -#error "AVX512 Not implemented yet" +#if CV__SIMD_FORWARD == 1024 +// [todo] 1024 +#error "1024-long ops not implemented yet" +#elif CV__SIMD_FORWARD == 512 +// 512 +#define __CV_VX(fun) v512_##fun +#define __CV_V_UINT8 v_uint8x64 +#define __CV_V_INT8 v_int8x64 +#define __CV_V_UINT16 v_uint16x32 +#define __CV_V_INT16 v_int16x32 +#define __CV_V_UINT32 v_uint32x16 +#define __CV_V_INT32 v_int32x16 +#define __CV_V_UINT64 v_uint64x8 +#define __CV_V_INT64 v_int64x8 +#define __CV_V_FLOAT32 v_float32x16 +#define __CV_V_FLOAT64 v_float64x8 +struct v_uint8x64; +struct v_int8x64; +struct v_uint16x32; +struct v_int16x32; +struct v_uint32x16; +struct v_int32x16; +struct v_uint64x8; +struct v_int64x8; +struct v_float32x16; +struct v_float64x8; #elif CV__SIMD_FORWARD == 256 // 256 #define __CV_VX(fun) v256_##fun @@ -137,6 +160,16 @@ void v_mul_expand(const __CV_V_UINT32&, const __CV_V_UINT32&, __CV_V_UINT64&, __ void v_mul_expand(const __CV_V_INT32&, const __CV_V_INT32&, __CV_V_INT64&, __CV_V_INT64&); #endif +// Conversions +__CV_V_FLOAT32 v_cvt_f32(const __CV_V_INT32& a); +__CV_V_FLOAT32 v_cvt_f32(const __CV_V_FLOAT64& a); +__CV_V_FLOAT32 v_cvt_f32(const __CV_V_FLOAT64& a, const __CV_V_FLOAT64& b); +__CV_V_FLOAT64 v_cvt_f64(const __CV_V_INT32& a); +__CV_V_FLOAT64 v_cvt_f64_high(const __CV_V_INT32& a); +__CV_V_FLOAT64 v_cvt_f64(const __CV_V_FLOAT32& a); +__CV_V_FLOAT64 v_cvt_f64_high(const __CV_V_FLOAT32& a); +__CV_V_FLOAT64 v_cvt_f64(const __CV_V_INT64& a); + /** Cleanup **/ #undef CV__SIMD_FORWARD #undef __CV_VX diff --git a/3rdparty/opencv/include/opencv2/core/hal/intrin_msa.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_msa.hpp new file mode 100644 index 0000000..a1fbb09 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_msa.hpp @@ -0,0 +1,1887 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_HAL_INTRIN_MSA_HPP +#define OPENCV_HAL_INTRIN_MSA_HPP + +#include +#include "opencv2/core/utility.hpp" + +namespace cv +{ + +//! @cond IGNORED +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN + +#define CV_SIMD128 1 + +//MSA implements 128-bit wide vector registers shared with the 64-bit wide floating-point unit registers. +//MSA and FPU can not be both present, unless the FPU has 64-bit floating-point registers. +#define CV_SIMD128_64F 1 + +struct v_uint8x16 +{ + typedef uchar lane_type; + enum { nlanes = 16 }; + + v_uint8x16() {} + explicit v_uint8x16(v16u8 v) : val(v) {} + v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, + uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) + { + uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = msa_ld1q_u8(v); + } + + uchar get0() const + { + return msa_getq_lane_u8(val, 0); + } + + v16u8 val; +}; + +struct v_int8x16 +{ + typedef schar lane_type; + enum { nlanes = 16 }; + + v_int8x16() {} + explicit v_int8x16(v16i8 v) : val(v) {} + v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7, + schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) + { + schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = msa_ld1q_s8(v); + } + + schar get0() const + { + return msa_getq_lane_s8(val, 0); + } + + v16i8 val; +}; + +struct v_uint16x8 +{ + typedef ushort lane_type; + enum { nlanes = 8 }; + + v_uint16x8() {} + explicit v_uint16x8(v8u16 v) : val(v) {} + v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) + { + ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = msa_ld1q_u16(v); + } + + ushort get0() const + { + return msa_getq_lane_u16(val, 0); + } + + v8u16 val; +}; + +struct v_int16x8 +{ + typedef short lane_type; + enum { nlanes = 8 }; + + v_int16x8() {} + explicit v_int16x8(v8i16 v) : val(v) {} + v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) + { + short v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = msa_ld1q_s16(v); + } + + short get0() const + { + return msa_getq_lane_s16(val, 0); + } + + v8i16 val; +}; + +struct v_uint32x4 +{ + typedef unsigned int lane_type; + enum { nlanes = 4 }; + + v_uint32x4() {} + explicit v_uint32x4(v4u32 v) : val(v) {} + v_uint32x4(unsigned int v0, unsigned int v1, unsigned int v2, unsigned int v3) + { + unsigned int v[] = {v0, v1, v2, v3}; + val = msa_ld1q_u32(v); + } + + unsigned int get0() const + { + return msa_getq_lane_u32(val, 0); + } + + v4u32 val; +}; + +struct v_int32x4 +{ + typedef int lane_type; + enum { nlanes = 4 }; + + v_int32x4() {} + explicit v_int32x4(v4i32 v) : val(v) {} + v_int32x4(int v0, int v1, int v2, int v3) + { + int v[] = {v0, v1, v2, v3}; + val = msa_ld1q_s32(v); + } + + int get0() const + { + return msa_getq_lane_s32(val, 0); + } + + v4i32 val; +}; + +struct v_float32x4 +{ + typedef float lane_type; + enum { nlanes = 4 }; + + v_float32x4() {} + explicit v_float32x4(v4f32 v) : val(v) {} + v_float32x4(float v0, float v1, float v2, float v3) + { + float v[] = {v0, v1, v2, v3}; + val = msa_ld1q_f32(v); + } + + float get0() const + { + return msa_getq_lane_f32(val, 0); + } + + v4f32 val; +}; + +struct v_uint64x2 +{ + typedef uint64 lane_type; + enum { nlanes = 2 }; + + v_uint64x2() {} + explicit v_uint64x2(v2u64 v) : val(v) {} + v_uint64x2(uint64 v0, uint64 v1) + { + uint64 v[] = {v0, v1}; + val = msa_ld1q_u64(v); + } + + uint64 get0() const + { + return msa_getq_lane_u64(val, 0); + } + + v2u64 val; +}; + +struct v_int64x2 +{ + typedef int64 lane_type; + enum { nlanes = 2 }; + + v_int64x2() {} + explicit v_int64x2(v2i64 v) : val(v) {} + v_int64x2(int64 v0, int64 v1) + { + int64 v[] = {v0, v1}; + val = msa_ld1q_s64(v); + } + + int64 get0() const + { + return msa_getq_lane_s64(val, 0); + } + + v2i64 val; +}; + +struct v_float64x2 +{ + typedef double lane_type; + enum { nlanes = 2 }; + + v_float64x2() {} + explicit v_float64x2(v2f64 v) : val(v) {} + v_float64x2(double v0, double v1) + { + double v[] = {v0, v1}; + val = msa_ld1q_f64(v); + } + + double get0() const + { + return msa_getq_lane_f64(val, 0); + } + + v2f64 val; +}; + +#define OPENCV_HAL_IMPL_MSA_INIT(_Tpv, _Tp, suffix) \ +inline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(msa_dupq_n_##suffix((_Tp)0)); } \ +inline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(msa_dupq_n_##suffix(v)); } \ +inline v_uint8x16 v_reinterpret_as_u8(const v_##_Tpv& v) { return v_uint8x16(MSA_TPV_REINTERPRET(v16u8, v.val)); } \ +inline v_int8x16 v_reinterpret_as_s8(const v_##_Tpv& v) { return v_int8x16(MSA_TPV_REINTERPRET(v16i8, v.val)); } \ +inline v_uint16x8 v_reinterpret_as_u16(const v_##_Tpv& v) { return v_uint16x8(MSA_TPV_REINTERPRET(v8u16, v.val)); } \ +inline v_int16x8 v_reinterpret_as_s16(const v_##_Tpv& v) { return v_int16x8(MSA_TPV_REINTERPRET(v8i16, v.val)); } \ +inline v_uint32x4 v_reinterpret_as_u32(const v_##_Tpv& v) { return v_uint32x4(MSA_TPV_REINTERPRET(v4u32, v.val)); } \ +inline v_int32x4 v_reinterpret_as_s32(const v_##_Tpv& v) { return v_int32x4(MSA_TPV_REINTERPRET(v4i32, v.val)); } \ +inline v_uint64x2 v_reinterpret_as_u64(const v_##_Tpv& v) { return v_uint64x2(MSA_TPV_REINTERPRET(v2u64, v.val)); } \ +inline v_int64x2 v_reinterpret_as_s64(const v_##_Tpv& v) { return v_int64x2(MSA_TPV_REINTERPRET(v2i64, v.val)); } \ +inline v_float32x4 v_reinterpret_as_f32(const v_##_Tpv& v) { return v_float32x4(MSA_TPV_REINTERPRET(v4f32, v.val)); } \ +inline v_float64x2 v_reinterpret_as_f64(const v_##_Tpv& v) { return v_float64x2(MSA_TPV_REINTERPRET(v2f64, v.val)); } + +OPENCV_HAL_IMPL_MSA_INIT(uint8x16, uchar, u8) +OPENCV_HAL_IMPL_MSA_INIT(int8x16, schar, s8) +OPENCV_HAL_IMPL_MSA_INIT(uint16x8, ushort, u16) +OPENCV_HAL_IMPL_MSA_INIT(int16x8, short, s16) +OPENCV_HAL_IMPL_MSA_INIT(uint32x4, unsigned int, u32) +OPENCV_HAL_IMPL_MSA_INIT(int32x4, int, s32) +OPENCV_HAL_IMPL_MSA_INIT(uint64x2, uint64, u64) +OPENCV_HAL_IMPL_MSA_INIT(int64x2, int64, s64) +OPENCV_HAL_IMPL_MSA_INIT(float32x4, float, f32) +OPENCV_HAL_IMPL_MSA_INIT(float64x2, double, f64) + +#define OPENCV_HAL_IMPL_MSA_PACK(_Tpvec, _Tpwvec, pack, mov, rshr) \ +inline _Tpvec v_##pack(const _Tpwvec& a, const _Tpwvec& b) \ +{ \ + return _Tpvec(mov(a.val, b.val)); \ +} \ +template inline \ +_Tpvec v_rshr_##pack(const _Tpwvec& a, const _Tpwvec& b) \ +{ \ + return _Tpvec(rshr(a.val, b.val, n)); \ +} + +OPENCV_HAL_IMPL_MSA_PACK(v_uint8x16, v_uint16x8, pack, msa_qpack_u16, msa_qrpackr_u16) +OPENCV_HAL_IMPL_MSA_PACK(v_int8x16, v_int16x8, pack, msa_qpack_s16, msa_qrpackr_s16) +OPENCV_HAL_IMPL_MSA_PACK(v_uint16x8, v_uint32x4, pack, msa_qpack_u32, msa_qrpackr_u32) +OPENCV_HAL_IMPL_MSA_PACK(v_int16x8, v_int32x4, pack, msa_qpack_s32, msa_qrpackr_s32) +OPENCV_HAL_IMPL_MSA_PACK(v_uint32x4, v_uint64x2, pack, msa_pack_u64, msa_rpackr_u64) +OPENCV_HAL_IMPL_MSA_PACK(v_int32x4, v_int64x2, pack, msa_pack_s64, msa_rpackr_s64) +OPENCV_HAL_IMPL_MSA_PACK(v_uint8x16, v_int16x8, pack_u, msa_qpacku_s16, msa_qrpackru_s16) +OPENCV_HAL_IMPL_MSA_PACK(v_uint16x8, v_int32x4, pack_u, msa_qpacku_s32, msa_qrpackru_s32) + +#define OPENCV_HAL_IMPL_MSA_PACK_STORE(_Tpvec, _Tp, hreg, suffix, _Tpwvec, pack, mov, rshr) \ +inline void v_##pack##_store(_Tp* ptr, const _Tpwvec& a) \ +{ \ + hreg a1 = mov(a.val); \ + msa_st1_##suffix(ptr, a1); \ +} \ +template inline \ +void v_rshr_##pack##_store(_Tp* ptr, const _Tpwvec& a) \ +{ \ + hreg a1 = rshr(a.val, n); \ + msa_st1_##suffix(ptr, a1); \ +} + +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint8x16, uchar, v8u8, u8, v_uint16x8, pack, msa_qmovn_u16, msa_qrshrn_n_u16) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_int8x16, schar, v8i8, s8, v_int16x8, pack, msa_qmovn_s16, msa_qrshrn_n_s16) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint16x8, ushort, v4u16, u16, v_uint32x4, pack, msa_qmovn_u32, msa_qrshrn_n_u32) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_int16x8, short, v4i16, s16, v_int32x4, pack, msa_qmovn_s32, msa_qrshrn_n_s32) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint32x4, unsigned, v2u32, u32, v_uint64x2, pack, msa_movn_u64, msa_rshrn_n_u64) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_int32x4, int, v2i32, s32, v_int64x2, pack, msa_movn_s64, msa_rshrn_n_s64) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint8x16, uchar, v8u8, u8, v_int16x8, pack_u, msa_qmovun_s16, msa_qrshrun_n_s16) +OPENCV_HAL_IMPL_MSA_PACK_STORE(v_uint16x8, ushort, v4u16, u16, v_int32x4, pack_u, msa_qmovun_s32, msa_qrshrun_n_s32) + +// pack boolean +inline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b) +{ + return v_uint8x16(msa_pack_u16(a.val, b.val)); +} + +inline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c, const v_uint32x4& d) +{ + return v_uint8x16(msa_pack_u16(msa_pack_u32(a.val, b.val), msa_pack_u32(c.val, d.val))); +} + +inline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c, + const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f, + const v_uint64x2& g, const v_uint64x2& h) +{ + v8u16 abcd = msa_pack_u32(msa_pack_u64(a.val, b.val), msa_pack_u64(c.val, d.val)); + v8u16 efgh = msa_pack_u32(msa_pack_u64(e.val, f.val), msa_pack_u64(g.val, h.val)); + return v_uint8x16(msa_pack_u16(abcd, efgh)); +} + +inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& m3) +{ + v4f32 v0 = v.val; + v4f32 res = msa_mulq_lane_f32(m0.val, v0, 0); + res = msa_mlaq_lane_f32(res, m1.val, v0, 1); + res = msa_mlaq_lane_f32(res, m2.val, v0, 2); + res = msa_mlaq_lane_f32(res, m3.val, v0, 3); + return v_float32x4(res); +} + +inline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& a) +{ + v4f32 v0 = v.val; + v4f32 res = msa_mulq_lane_f32(m0.val, v0, 0); + res = msa_mlaq_lane_f32(res, m1.val, v0, 1); + res = msa_mlaq_lane_f32(res, m2.val, v0, 2); + res = msa_addq_f32(res, a.val); + return v_float32x4(res); +} + +#define OPENCV_HAL_IMPL_MSA_BIN_OP(bin_op, _Tpvec, intrin) \ +inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} \ +inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \ +{ \ + a.val = intrin(a.val, b.val); \ + return a; \ +} + +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint8x16, msa_qaddq_u8) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint8x16, msa_qsubq_u8) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int8x16, msa_qaddq_s8) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int8x16, msa_qsubq_s8) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint16x8, msa_qaddq_u16) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint16x8, msa_qsubq_u16) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int16x8, msa_qaddq_s16) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int16x8, msa_qsubq_s16) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int32x4, msa_addq_s32) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int32x4, msa_subq_s32) +OPENCV_HAL_IMPL_MSA_BIN_OP(*, v_int32x4, msa_mulq_s32) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint32x4, msa_addq_u32) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint32x4, msa_subq_u32) +OPENCV_HAL_IMPL_MSA_BIN_OP(*, v_uint32x4, msa_mulq_u32) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_float32x4, msa_addq_f32) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_float32x4, msa_subq_f32) +OPENCV_HAL_IMPL_MSA_BIN_OP(*, v_float32x4, msa_mulq_f32) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_int64x2, msa_addq_s64) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_int64x2, msa_subq_s64) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_uint64x2, msa_addq_u64) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_uint64x2, msa_subq_u64) +OPENCV_HAL_IMPL_MSA_BIN_OP(/, v_float32x4, msa_divq_f32) +OPENCV_HAL_IMPL_MSA_BIN_OP(+, v_float64x2, msa_addq_f64) +OPENCV_HAL_IMPL_MSA_BIN_OP(-, v_float64x2, msa_subq_f64) +OPENCV_HAL_IMPL_MSA_BIN_OP(*, v_float64x2, msa_mulq_f64) +OPENCV_HAL_IMPL_MSA_BIN_OP(/, v_float64x2, msa_divq_f64) + +// saturating multiply 8-bit, 16-bit +#define OPENCV_HAL_IMPL_MSA_MUL_SAT(_Tpvec, _Tpwvec) \ +inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpwvec c, d; \ + v_mul_expand(a, b, c, d); \ + return v_pack(c, d); \ +} \ +inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b) \ +{a = a * b; return a; } + +OPENCV_HAL_IMPL_MSA_MUL_SAT(v_int8x16, v_int16x8) +OPENCV_HAL_IMPL_MSA_MUL_SAT(v_uint8x16, v_uint16x8) +OPENCV_HAL_IMPL_MSA_MUL_SAT(v_int16x8, v_int32x4) +OPENCV_HAL_IMPL_MSA_MUL_SAT(v_uint16x8, v_uint32x4) + +// Multiply and expand +inline void v_mul_expand(const v_int8x16& a, const v_int8x16& b, + v_int16x8& c, v_int16x8& d) +{ + v16i8 a_lo, a_hi, b_lo, b_hi; + + ILVRL_B2_SB(a.val, msa_dupq_n_s8(0), a_lo, a_hi); + ILVRL_B2_SB(b.val, msa_dupq_n_s8(0), b_lo, b_hi); + c.val = msa_mulq_s16(msa_paddlq_s8(a_lo), msa_paddlq_s8(b_lo)); + d.val = msa_mulq_s16(msa_paddlq_s8(a_hi), msa_paddlq_s8(b_hi)); +} + +inline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b, + v_uint16x8& c, v_uint16x8& d) +{ + v16u8 a_lo, a_hi, b_lo, b_hi; + + ILVRL_B2_UB(a.val, msa_dupq_n_u8(0), a_lo, a_hi); + ILVRL_B2_UB(b.val, msa_dupq_n_u8(0), b_lo, b_hi); + c.val = msa_mulq_u16(msa_paddlq_u8(a_lo), msa_paddlq_u8(b_lo)); + d.val = msa_mulq_u16(msa_paddlq_u8(a_hi), msa_paddlq_u8(b_hi)); +} + +inline void v_mul_expand(const v_int16x8& a, const v_int16x8& b, + v_int32x4& c, v_int32x4& d) +{ + v8i16 a_lo, a_hi, b_lo, b_hi; + + ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi); + ILVRL_H2_SH(b.val, msa_dupq_n_s16(0), b_lo, b_hi); + c.val = msa_mulq_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(b_lo)); + d.val = msa_mulq_s32(msa_paddlq_s16(a_hi), msa_paddlq_s16(b_hi)); +} + +inline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b, + v_uint32x4& c, v_uint32x4& d) +{ + v8u16 a_lo, a_hi, b_lo, b_hi; + + ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi); + ILVRL_H2_UH(b.val, msa_dupq_n_u16(0), b_lo, b_hi); + c.val = msa_mulq_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(b_lo)); + d.val = msa_mulq_u32(msa_paddlq_u16(a_hi), msa_paddlq_u16(b_hi)); +} + +inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, + v_uint64x2& c, v_uint64x2& d) +{ + v4u32 a_lo, a_hi, b_lo, b_hi; + + ILVRL_W2_UW(a.val, msa_dupq_n_u32(0), a_lo, a_hi); + ILVRL_W2_UW(b.val, msa_dupq_n_u32(0), b_lo, b_hi); + c.val = msa_mulq_u64(msa_paddlq_u32(a_lo), msa_paddlq_u32(b_lo)); + d.val = msa_mulq_u64(msa_paddlq_u32(a_hi), msa_paddlq_u32(b_hi)); +} + +inline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b) +{ + v8i16 a_lo, a_hi, b_lo, b_hi; + + ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi); + ILVRL_H2_SH(b.val, msa_dupq_n_s16(0), b_lo, b_hi); + + return v_int16x8(msa_packr_s32(msa_mulq_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(b_lo)), + msa_mulq_s32(msa_paddlq_s16(a_hi), msa_paddlq_s16(b_hi)), 16)); +} + +inline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b) +{ + v8u16 a_lo, a_hi, b_lo, b_hi; + + ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi); + ILVRL_H2_UH(b.val, msa_dupq_n_u16(0), b_lo, b_hi); + + return v_uint16x8(msa_packr_u32(msa_mulq_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(b_lo)), + msa_mulq_u32(msa_paddlq_u16(a_hi), msa_paddlq_u16(b_hi)), 16)); +} + +//////// Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) +{ return v_int32x4(msa_dotp_s_w(a.val, b.val)); } +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_int32x4(msa_dpadd_s_w(c.val , a.val, b.val)); } + +// 32 >> 64 +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b) +{ return v_int64x2(msa_dotp_s_d(a.val, b.val)); } +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_int64x2(msa_dpadd_s_d(c.val , a.val, b.val)); } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b) +{ + v8u16 even_a = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8), 8); + v8u16 odd_a = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8); + v8u16 even_b = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8), 8); + v8u16 odd_b = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8); + v4u32 prod = msa_dotp_u_w(even_a, even_b); + return v_uint32x4(msa_dpadd_u_w(prod, odd_a, odd_b)); +} +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ + v8u16 even_a = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8), 8); + v8u16 odd_a = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, a.val), 8); + v8u16 even_b = msa_shrq_n_u16(msa_shlq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8), 8); + v8u16 odd_b = msa_shrq_n_u16(MSA_TPV_REINTERPRET(v8u16, b.val), 8); + v4u32 prod = msa_dpadd_u_w(c.val, even_a, even_b); + return v_uint32x4(msa_dpadd_u_w(prod, odd_a, odd_b)); +} + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b) +{ + v8i16 prod = msa_dotp_s_h(a.val, b.val); + return v_int32x4(msa_hadd_s32(prod, prod)); +} +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, + const v_int32x4& c) +{ return v_dotprod_expand(a, b) + c; } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b) +{ + v4u32 even_a = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16), 16); + v4u32 odd_a = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16); + v4u32 even_b = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16), 16); + v4u32 odd_b = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16); + v2u64 prod = msa_dotp_u_d(even_a, even_b); + return v_uint64x2(msa_dpadd_u_d(prod, odd_a, odd_b)); +} +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, + const v_uint64x2& c) +{ + v4u32 even_a = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16), 16); + v4u32 odd_a = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, a.val), 16); + v4u32 even_b = msa_shrq_n_u32(msa_shlq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16), 16); + v4u32 odd_b = msa_shrq_n_u32(MSA_TPV_REINTERPRET(v4u32, b.val), 16); + v2u64 prod = msa_dpadd_u_d(c.val, even_a, even_b); + return v_uint64x2(msa_dpadd_u_d(prod, odd_a, odd_b)); +} + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b) +{ + v4i32 prod = msa_dotp_s_w(a.val, b.val); + return v_int64x2(msa_hadd_s64(prod, prod)); +} +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b) + c; } + + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod(a, b); } +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_dotprod(a, b, c); } + +// 32 >> 64 +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod(a, b); } +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod(a, b, c); } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) +{ return v_dotprod_expand(a, b); } +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_dotprod_expand(a, b, c); } +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) +{ return v_dotprod_expand(a, b); } +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand(a, b, c); } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b) +{ return v_dotprod_expand(a, b); } +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b, c); } +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod_expand(a, b); } +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b, c); } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod_expand(a, b); } +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b, c); } + +#define OPENCV_HAL_IMPL_MSA_LOGIC_OP(_Tpvec, _Tpv, suffix) \ +OPENCV_HAL_IMPL_MSA_BIN_OP(&, _Tpvec, msa_andq_##suffix) \ +OPENCV_HAL_IMPL_MSA_BIN_OP(|, _Tpvec, msa_orrq_##suffix) \ +OPENCV_HAL_IMPL_MSA_BIN_OP(^, _Tpvec, msa_eorq_##suffix) \ +inline _Tpvec operator ~ (const _Tpvec& a) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_mvnq_u8(MSA_TPV_REINTERPRET(v16u8, a.val)))); \ +} + +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint8x16, v16u8, u8) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int8x16, v16i8, s8) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint16x8, v8u16, u16) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int16x8, v8i16, s16) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint32x4, v4u32, u32) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int32x4, v4i32, s32) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_uint64x2, v2u64, u64) +OPENCV_HAL_IMPL_MSA_LOGIC_OP(v_int64x2, v2i64, s64) + +#define OPENCV_HAL_IMPL_MSA_FLT_BIT_OP(bin_op, intrin) \ +inline v_float32x4 operator bin_op (const v_float32x4& a, const v_float32x4& b) \ +{ \ + return v_float32x4(MSA_TPV_REINTERPRET(v4f32, intrin(MSA_TPV_REINTERPRET(v4i32, a.val), MSA_TPV_REINTERPRET(v4i32, b.val)))); \ +} \ +inline v_float32x4& operator bin_op##= (v_float32x4& a, const v_float32x4& b) \ +{ \ + a.val = MSA_TPV_REINTERPRET(v4f32, intrin(MSA_TPV_REINTERPRET(v4i32, a.val), MSA_TPV_REINTERPRET(v4i32, b.val))); \ + return a; \ +} + +OPENCV_HAL_IMPL_MSA_FLT_BIT_OP(&, msa_andq_s32) +OPENCV_HAL_IMPL_MSA_FLT_BIT_OP(|, msa_orrq_s32) +OPENCV_HAL_IMPL_MSA_FLT_BIT_OP(^, msa_eorq_s32) + +inline v_float32x4 operator ~ (const v_float32x4& a) +{ + return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_mvnq_s32(MSA_TPV_REINTERPRET(v4i32, a.val)))); +} + +/* v_abs */ +#define OPENCV_HAL_IMPL_MSA_ABS(_Tpuvec, _Tpsvec, usuffix, ssuffix) \ +inline _Tpuvec v_abs(const _Tpsvec& a) \ +{ \ + return v_reinterpret_as_##usuffix(_Tpsvec(msa_absq_##ssuffix(a.val))); \ +} + +OPENCV_HAL_IMPL_MSA_ABS(v_uint8x16, v_int8x16, u8, s8) +OPENCV_HAL_IMPL_MSA_ABS(v_uint16x8, v_int16x8, u16, s16) +OPENCV_HAL_IMPL_MSA_ABS(v_uint32x4, v_int32x4, u32, s32) + +/* v_abs(float), v_sqrt, v_invsqrt */ +#define OPENCV_HAL_IMPL_MSA_BASIC_FUNC(_Tpvec, func, intrin) \ +inline _Tpvec func(const _Tpvec& a) \ +{ \ + return _Tpvec(intrin(a.val)); \ +} + +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_abs, msa_absq_f32) +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_abs, msa_absq_f64) +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_sqrt, msa_sqrtq_f32) +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float32x4, v_invsqrt, msa_rsqrtq_f32) +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_sqrt, msa_sqrtq_f64) +OPENCV_HAL_IMPL_MSA_BASIC_FUNC(v_float64x2, v_invsqrt, msa_rsqrtq_f64) + +#define OPENCV_HAL_IMPL_MSA_DBL_BIT_OP(bin_op, intrin) \ +inline v_float64x2 operator bin_op (const v_float64x2& a, const v_float64x2& b) \ +{ \ + return v_float64x2(MSA_TPV_REINTERPRET(v2f64, intrin(MSA_TPV_REINTERPRET(v2i64, a.val), MSA_TPV_REINTERPRET(v2i64, b.val)))); \ +} \ +inline v_float64x2& operator bin_op##= (v_float64x2& a, const v_float64x2& b) \ +{ \ + a.val = MSA_TPV_REINTERPRET(v2f64, intrin(MSA_TPV_REINTERPRET(v2i64, a.val), MSA_TPV_REINTERPRET(v2i64, b.val))); \ + return a; \ +} + +OPENCV_HAL_IMPL_MSA_DBL_BIT_OP(&, msa_andq_s64) +OPENCV_HAL_IMPL_MSA_DBL_BIT_OP(|, msa_orrq_s64) +OPENCV_HAL_IMPL_MSA_DBL_BIT_OP(^, msa_eorq_s64) + +inline v_float64x2 operator ~ (const v_float64x2& a) +{ + return v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_mvnq_s32(MSA_TPV_REINTERPRET(v4i32, a.val)))); +} + +// TODO: exp, log, sin, cos + +#define OPENCV_HAL_IMPL_MSA_BIN_FUNC(_Tpvec, func, intrin) \ +inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} + +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_min, msa_minq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_max, msa_maxq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_min, msa_minq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_max, msa_maxq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_min, msa_minq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_max, msa_maxq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_min, msa_minq_s16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_max, msa_maxq_s16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_min, msa_minq_u32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_max, msa_maxq_u32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int32x4, v_min, msa_minq_s32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int32x4, v_max, msa_maxq_s32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_min, msa_minq_f32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_max, msa_maxq_f32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_min, msa_minq_f64) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_max, msa_maxq_f64) + +#define OPENCV_HAL_IMPL_MSA_INT_CMP_OP(_Tpvec, _Tpv, suffix, not_suffix) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ceqq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_mvnq_##not_suffix(msa_ceqq_##suffix(a.val, b.val)))); } \ +inline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cltq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cgtq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cleq_##suffix(a.val, b.val))); } \ +inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_cgeq_##suffix(a.val, b.val))); } + +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint8x16, v16u8, u8, u8) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int8x16, v16i8, s8, u8) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint16x8, v8u16, u16, u16) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int16x8, v8i16, s16, u16) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint32x4, v4u32, u32, u32) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int32x4, v4i32, s32, u32) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_float32x4, v4f32, f32, u32) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_uint64x2, v2u64, u64, u64) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_int64x2, v2i64, s64, u64) +OPENCV_HAL_IMPL_MSA_INT_CMP_OP(v_float64x2, v2f64, f64, u64) + +inline v_float32x4 v_not_nan(const v_float32x4& a) +{ return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ceqq_f32(a.val, a.val))); } +inline v_float64x2 v_not_nan(const v_float64x2& a) +{ return v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ceqq_f64(a.val, a.val))); } + +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_add_wrap, msa_addq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_add_wrap, msa_addq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_add_wrap, msa_addq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_add_wrap, msa_addq_s16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_sub_wrap, msa_subq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_sub_wrap, msa_subq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_sub_wrap, msa_subq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_sub_wrap, msa_subq_s16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_mul_wrap, msa_mulq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_mul_wrap, msa_mulq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_mul_wrap, msa_mulq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_mul_wrap, msa_mulq_s16) + +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint8x16, v_absdiff, msa_abdq_u8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint16x8, v_absdiff, msa_abdq_u16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_uint32x4, v_absdiff, msa_abdq_u32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float32x4, v_absdiff, msa_abdq_f32) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_float64x2, v_absdiff, msa_abdq_f64) + +/** Saturating absolute difference **/ +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int8x16, v_absdiffs, msa_qabdq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC(v_int16x8, v_absdiffs, msa_qabdq_s16) + +#define OPENCV_HAL_IMPL_MSA_BIN_FUNC2(_Tpvec, _Tpvec2, _Tpv, func, intrin) \ +inline _Tpvec2 func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec2(MSA_TPV_REINTERPRET(_Tpv, intrin(a.val, b.val))); \ +} + +OPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int8x16, v_uint8x16, v16u8, v_absdiff, msa_abdq_s8) +OPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int16x8, v_uint16x8, v8u16, v_absdiff, msa_abdq_s16) +OPENCV_HAL_IMPL_MSA_BIN_FUNC2(v_int32x4, v_uint32x4, v4u32, v_absdiff, msa_abdq_s32) + +/* v_magnitude, v_sqr_magnitude, v_fma, v_muladd */ +inline v_float32x4 v_magnitude(const v_float32x4& a, const v_float32x4& b) +{ + v_float32x4 x(msa_mlaq_f32(msa_mulq_f32(a.val, a.val), b.val, b.val)); + return v_sqrt(x); +} + +inline v_float32x4 v_sqr_magnitude(const v_float32x4& a, const v_float32x4& b) +{ + return v_float32x4(msa_mlaq_f32(msa_mulq_f32(a.val, a.val), b.val, b.val)); +} + +inline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c) +{ + return v_float32x4(msa_mlaq_f32(c.val, a.val, b.val)); +} + +inline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c) +{ + return v_int32x4(msa_mlaq_s32(c.val, a.val, b.val)); +} + +inline v_float32x4 v_muladd(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c) +{ + return v_fma(a, b, c); +} + +inline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c) +{ + return v_fma(a, b, c); +} + +inline v_float64x2 v_magnitude(const v_float64x2& a, const v_float64x2& b) +{ + v_float64x2 x(msa_mlaq_f64(msa_mulq_f64(a.val, a.val), b.val, b.val)); + return v_sqrt(x); +} + +inline v_float64x2 v_sqr_magnitude(const v_float64x2& a, const v_float64x2& b) +{ + return v_float64x2(msa_mlaq_f64(msa_mulq_f64(a.val, a.val), b.val, b.val)); +} + +inline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c) +{ + return v_float64x2(msa_mlaq_f64(c.val, a.val, b.val)); +} + +inline v_float64x2 v_muladd(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c) +{ + return v_fma(a, b, c); +} + +// trade efficiency for convenience +#define OPENCV_HAL_IMPL_MSA_SHIFT_OP(_Tpvec, suffix, _Tps, ssuffix) \ +inline _Tpvec operator << (const _Tpvec& a, int n) \ +{ return _Tpvec(msa_shlq_##suffix(a.val, msa_dupq_n_##ssuffix((_Tps)n))); } \ +inline _Tpvec operator >> (const _Tpvec& a, int n) \ +{ return _Tpvec(msa_shrq_##suffix(a.val, msa_dupq_n_##ssuffix((_Tps)n))); } \ +template inline _Tpvec v_shl(const _Tpvec& a) \ +{ return _Tpvec(msa_shlq_n_##suffix(a.val, n)); } \ +template inline _Tpvec v_shr(const _Tpvec& a) \ +{ return _Tpvec(msa_shrq_n_##suffix(a.val, n)); } \ +template inline _Tpvec v_rshr(const _Tpvec& a) \ +{ return _Tpvec(msa_rshrq_n_##suffix(a.val, n)); } + +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint8x16, u8, schar, s8) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int8x16, s8, schar, s8) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint16x8, u16, short, s16) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int16x8, s16, short, s16) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint32x4, u32, int, s32) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int32x4, s32, int, s32) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_uint64x2, u64, int64, s64) +OPENCV_HAL_IMPL_MSA_SHIFT_OP(v_int64x2, s64, int64, s64) + +/* v_rotate_right, v_rotate_left */ +#define OPENCV_HAL_IMPL_MSA_ROTATE_OP(_Tpvec, _Tpv, _Tpvs, suffix) \ +template inline _Tpvec v_rotate_right(const _Tpvec& a) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##suffix(0), n))); \ +} \ +template inline _Tpvec v_rotate_left(const _Tpvec& a) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(msa_dupq_n_##suffix(0), MSA_TPV_REINTERPRET(_Tpvs, a.val), _Tpvec::nlanes - n))); \ +} \ +template<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a) \ +{ \ + return a; \ +} \ +template inline _Tpvec v_rotate_right(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), MSA_TPV_REINTERPRET(_Tpvs, b.val), n))); \ +} \ +template inline _Tpvec v_rotate_left(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, b.val), MSA_TPV_REINTERPRET(_Tpvs, a.val), _Tpvec::nlanes - n))); \ +} \ +template<> inline _Tpvec v_rotate_left<0>(const _Tpvec& a, const _Tpvec& b) \ +{ \ + CV_UNUSED(b); \ + return a; \ +} + +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint8x16, v16u8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int8x16, v16i8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint16x8, v8u16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int16x8, v8i16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint32x4, v4u32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int32x4, v4i32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_float32x4, v4f32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_uint64x2, v2u64, v2i64, s64) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_int64x2, v2i64, v2i64, s64) +OPENCV_HAL_IMPL_MSA_ROTATE_OP(v_float64x2, v2f64, v2i64, s64) + +#define OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_load(const _Tp* ptr) \ +{ return _Tpvec(msa_ld1q_##suffix(ptr)); } \ +inline _Tpvec v_load_aligned(const _Tp* ptr) \ +{ return _Tpvec(msa_ld1q_##suffix(ptr)); } \ +inline _Tpvec v_load_low(const _Tp* ptr) \ +{ return _Tpvec(msa_combine_##suffix(msa_ld1_##suffix(ptr), msa_dup_n_##suffix((_Tp)0))); } \ +inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ +{ return _Tpvec(msa_combine_##suffix(msa_ld1_##suffix(ptr0), msa_ld1_##suffix(ptr1))); } \ +inline void v_store(_Tp* ptr, const _Tpvec& a) \ +{ msa_st1q_##suffix(ptr, a.val); } \ +inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ +{ msa_st1q_##suffix(ptr, a.val); } \ +inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \ +{ msa_st1q_##suffix(ptr, a.val); } \ +inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \ +{ msa_st1q_##suffix(ptr, a.val); } \ +inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ +{ \ + int n = _Tpvec::nlanes; \ + for( int i = 0; i < (n/2); i++ ) \ + ptr[i] = a.val[i]; \ +} \ +inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ +{ \ + int n = _Tpvec::nlanes; \ + for( int i = 0; i < (n/2); i++ ) \ + ptr[i] = a.val[i+(n/2)]; \ +} + +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int16x8, short, s16) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int32x4, int, s32) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_float32x4, float, f32) +OPENCV_HAL_IMPL_MSA_LOADSTORE_OP(v_float64x2, double, f64) + + +/** Reverse **/ +inline v_uint8x16 v_reverse(const v_uint8x16 &a) +{ + v_uint8x16 c = v_uint8x16((v16u8)__builtin_msa_vshf_b((v16i8)((v2i64){0x08090A0B0C0D0E0F, 0x0001020304050607}), msa_dupq_n_s8(0), (v16i8)a.val)); + return c; +} + +inline v_int8x16 v_reverse(const v_int8x16 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x8 v_reverse(const v_uint16x8 &a) +{ + v_uint16x8 c = v_uint16x8((v8u16)__builtin_msa_vshf_h((v8i16)((v2i64){0x0004000500060007, 0x0000000100020003}), msa_dupq_n_s16(0), (v8i16)a.val)); + return c; +} + +inline v_int16x8 v_reverse(const v_int16x8 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x4 v_reverse(const v_uint32x4 &a) +{ + v_uint32x4 c; + c.val[0] = a.val[3]; + c.val[1] = a.val[2]; + c.val[2] = a.val[1]; + c.val[3] = a.val[0]; + return c; +} + +inline v_int32x4 v_reverse(const v_int32x4 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x4 v_reverse(const v_float32x4 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x2 v_reverse(const v_uint64x2 &a) +{ + v_uint64x2 c; + c.val[0] = a.val[1]; + c.val[1] = a.val[0]; + return c; +} + +inline v_int64x2 v_reverse(const v_int64x2 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x2 v_reverse(const v_float64x2 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + + +#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(func, cfunc) \ +inline unsigned short v_reduce_##func(const v_uint16x8& a) \ +{ \ + v8u16 a_lo, a_hi; \ + ILVRL_H2_UH(a.val, msa_dupq_n_u16(0), a_lo, a_hi); \ + v4u32 b = msa_##func##q_u32(msa_paddlq_u16(a_lo), msa_paddlq_u16(a_hi)); \ + v4u32 b_lo, b_hi; \ + ILVRL_W2_UW(b, msa_dupq_n_u32(0), b_lo, b_hi); \ + v2u64 c = msa_##func##q_u64(msa_paddlq_u32(b_lo), msa_paddlq_u32(b_hi)); \ + return (unsigned short)cfunc(c[0], c[1]); \ +} + +OPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(max, std::max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_8U(min, std::min) + +#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(func, cfunc) \ +inline short v_reduce_##func(const v_int16x8& a) \ +{ \ + v8i16 a_lo, a_hi; \ + ILVRL_H2_SH(a.val, msa_dupq_n_s16(0), a_lo, a_hi); \ + v4i32 b = msa_##func##q_s32(msa_paddlq_s16(a_lo), msa_paddlq_s16(a_hi)); \ + v4i32 b_lo, b_hi; \ + ILVRL_W2_SW(b, msa_dupq_n_s32(0), b_lo, b_hi); \ + v2i64 c = msa_##func##q_s64(msa_paddlq_s32(b_lo), msa_paddlq_s32(b_hi)); \ + return (short)cfunc(c[0], c[1]); \ +} + +OPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(max, std::max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_8S(min, std::min) + +#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(_Tpvec, scalartype, func, cfunc) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + return (scalartype)cfunc(cfunc(a.val[0], a.val[1]), cfunc(a.val[2], a.val[3])); \ +} + +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_uint32x4, unsigned, max, std::max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_uint32x4, unsigned, min, std::min) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_int32x4, int, max, std::max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_int32x4, int, min, std::min) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_float32x4, float, max, std::max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_4(v_float32x4, float, min, std::min) + + +#define OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(_Tpvec, scalartype, _Tpvec2, func) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + _Tpvec2 a1, a2; \ + v_expand(a, a1, a2); \ + return (scalartype)v_reduce_##func(v_##func(a1, a2)); \ +} + +OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_uint8x16, uchar, v_uint16x8, min) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_uint8x16, uchar, v_uint16x8, max) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_int8x16, char, v_int16x8, min) +OPENCV_HAL_IMPL_MSA_REDUCE_OP_16(v_int8x16, char, v_int16x8, max) + + + +#define OPENCV_HAL_IMPL_MSA_REDUCE_SUM(_Tpvec, scalartype, suffix) \ +inline scalartype v_reduce_sum(const _Tpvec& a) \ +{ \ + return (scalartype)msa_sum_##suffix(a.val); \ +} + +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint8x16, unsigned char, u8) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int8x16, char, s8) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint16x8, unsigned short, u16) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int16x8, short, s16) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_int32x4, int, s32) +OPENCV_HAL_IMPL_MSA_REDUCE_SUM(v_float32x4, float, f32) + +inline uint64 v_reduce_sum(const v_uint64x2& a) +{ return (uint64)(msa_getq_lane_u64(a.val, 0) + msa_getq_lane_u64(a.val, 1)); } +inline int64 v_reduce_sum(const v_int64x2& a) +{ return (int64)(msa_getq_lane_s64(a.val, 0) + msa_getq_lane_s64(a.val, 1)); } +inline double v_reduce_sum(const v_float64x2& a) +{ + return msa_getq_lane_f64(a.val, 0) + msa_getq_lane_f64(a.val, 1); +} + +/* v_reduce_sum4, v_reduce_sad */ +inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b, + const v_float32x4& c, const v_float32x4& d) +{ + v4f32 u0 = msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, b.val), MSA_TPV_REINTERPRET(v4i32, a.val))), + MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, b.val), MSA_TPV_REINTERPRET(v4i32, a.val)))); // a0+a1 b0+b1 a2+a3 b2+b3 + v4f32 u1 = msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, d.val), MSA_TPV_REINTERPRET(v4i32, c.val))), + MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, d.val), MSA_TPV_REINTERPRET(v4i32, c.val)))); // c0+c1 d0+d1 c2+c3 d2+d3 + + return v_float32x4(msa_addq_f32(MSA_TPV_REINTERPRET(v4f32, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, u1), MSA_TPV_REINTERPRET(v2i64, u0))), + MSA_TPV_REINTERPRET(v4f32, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, u1), MSA_TPV_REINTERPRET(v2i64, u0))))); +} + +inline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b) +{ + v16u8 t0 = msa_abdq_u8(a.val, b.val); + v8u16 t1 = msa_paddlq_u8(t0); + v4u32 t2 = msa_paddlq_u16(t1); + return msa_sum_u32(t2); +} +inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) +{ + v16u8 t0 = MSA_TPV_REINTERPRET(v16u8, msa_abdq_s8(a.val, b.val)); + v8u16 t1 = msa_paddlq_u8(t0); + v4u32 t2 = msa_paddlq_u16(t1); + return msa_sum_u32(t2); +} +inline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b) +{ + v8u16 t0 = msa_abdq_u16(a.val, b.val); + v4u32 t1 = msa_paddlq_u16(t0); + return msa_sum_u32(t1); +} +inline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b) +{ + v8u16 t0 = MSA_TPV_REINTERPRET(v8u16, msa_abdq_s16(a.val, b.val)); + v4u32 t1 = msa_paddlq_u16(t0); + return msa_sum_u32(t1); +} +inline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b) +{ + v4u32 t0 = msa_abdq_u32(a.val, b.val); + return msa_sum_u32(t0); +} +inline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b) +{ + v4u32 t0 = MSA_TPV_REINTERPRET(v4u32, msa_abdq_s32(a.val, b.val)); + return msa_sum_u32(t0); +} +inline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b) +{ + v4f32 t0 = msa_abdq_f32(a.val, b.val); + return msa_sum_f32(t0); +} + +/* v_popcount */ +#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(_Tpvec) \ +inline v_uint8x16 v_popcount(const _Tpvec& a) \ +{ \ + v16u8 t = MSA_TPV_REINTERPRET(v16u8, msa_cntq_s8(MSA_TPV_REINTERPRET(v16i8, a.val))); \ + return v_uint8x16(t); \ +} +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(v_uint8x16) +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE8(v_int8x16) + +#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(_Tpvec) \ +inline v_uint16x8 v_popcount(const _Tpvec& a) \ +{ \ + v8u16 t = MSA_TPV_REINTERPRET(v8u16, msa_cntq_s16(MSA_TPV_REINTERPRET(v8i16, a.val))); \ + return v_uint16x8(t); \ +} +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(v_uint16x8) +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE16(v_int16x8) + +#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(_Tpvec) \ +inline v_uint32x4 v_popcount(const _Tpvec& a) \ +{ \ + v4u32 t = MSA_TPV_REINTERPRET(v4u32, msa_cntq_s32(MSA_TPV_REINTERPRET(v4i32, a.val))); \ + return v_uint32x4(t); \ +} +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(v_uint32x4) +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE32(v_int32x4) + +#define OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(_Tpvec) \ +inline v_uint64x2 v_popcount(const _Tpvec& a) \ +{ \ + v2u64 t = MSA_TPV_REINTERPRET(v2u64, msa_cntq_s64(MSA_TPV_REINTERPRET(v2i64, a.val))); \ + return v_uint64x2(t); \ +} +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(v_uint64x2) +OPENCV_HAL_IMPL_MSA_POPCOUNT_SIZE64(v_int64x2) + +inline int v_signmask(const v_uint8x16& a) +{ + v8i8 m0 = msa_create_s8(CV_BIG_UINT(0x0706050403020100)); + v16u8 v0 = msa_shlq_u8(msa_shrq_n_u8(a.val, 7), msa_combine_s8(m0, m0)); + v8u16 v1 = msa_paddlq_u8(v0); + v4u32 v2 = msa_paddlq_u16(v1); + v2u64 v3 = msa_paddlq_u32(v2); + return (int)msa_getq_lane_u64(v3, 0) + ((int)msa_getq_lane_u64(v3, 1) << 8); +} +inline int v_signmask(const v_int8x16& a) +{ return v_signmask(v_reinterpret_as_u8(a)); } + +inline int v_signmask(const v_uint16x8& a) +{ + v4i16 m0 = msa_create_s16(CV_BIG_UINT(0x0003000200010000)); + v8u16 v0 = msa_shlq_u16(msa_shrq_n_u16(a.val, 15), msa_combine_s16(m0, m0)); + v4u32 v1 = msa_paddlq_u16(v0); + v2u64 v2 = msa_paddlq_u32(v1); + return (int)msa_getq_lane_u64(v2, 0) + ((int)msa_getq_lane_u64(v2, 1) << 4); +} +inline int v_signmask(const v_int16x8& a) +{ return v_signmask(v_reinterpret_as_u16(a)); } + +inline int v_signmask(const v_uint32x4& a) +{ + v2i32 m0 = msa_create_s32(CV_BIG_UINT(0x0000000100000000)); + v4u32 v0 = msa_shlq_u32(msa_shrq_n_u32(a.val, 31), msa_combine_s32(m0, m0)); + v2u64 v1 = msa_paddlq_u32(v0); + return (int)msa_getq_lane_u64(v1, 0) + ((int)msa_getq_lane_u64(v1, 1) << 2); +} +inline int v_signmask(const v_int32x4& a) +{ return v_signmask(v_reinterpret_as_u32(a)); } +inline int v_signmask(const v_float32x4& a) +{ return v_signmask(v_reinterpret_as_u32(a)); } + +inline int v_signmask(const v_uint64x2& a) +{ + v2u64 v0 = msa_shrq_n_u64(a.val, 63); + return (int)msa_getq_lane_u64(v0, 0) + ((int)msa_getq_lane_u64(v0, 1) << 1); +} +inline int v_signmask(const v_int64x2& a) +{ return v_signmask(v_reinterpret_as_u64(a)); } +inline int v_signmask(const v_float64x2& a) +{ return v_signmask(v_reinterpret_as_u64(a)); } + +inline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); } + +#define OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(_Tpvec, _Tpvec2, suffix, shift) \ +inline bool v_check_all(const v_##_Tpvec& a) \ +{ \ + _Tpvec2 v0 = msa_shrq_n_##suffix(msa_mvnq_##suffix(a.val), shift); \ + v2u64 v1 = MSA_TPV_REINTERPRET(v2u64, v0); \ + return (msa_getq_lane_u64(v1, 0) | msa_getq_lane_u64(v1, 1)) == 0; \ +} \ +inline bool v_check_any(const v_##_Tpvec& a) \ +{ \ + _Tpvec2 v0 = msa_shrq_n_##suffix(a.val, shift); \ + v2u64 v1 = MSA_TPV_REINTERPRET(v2u64, v0); \ + return (msa_getq_lane_u64(v1, 0) | msa_getq_lane_u64(v1, 1)) != 0; \ +} + +OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint8x16, v16u8, u8, 7) +OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint16x8, v8u16, u16, 15) +OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint32x4, v4u32, u32, 31) +OPENCV_HAL_IMPL_MSA_CHECK_ALLANY(uint64x2, v2u64, u64, 63) + +inline bool v_check_all(const v_int8x16& a) +{ return v_check_all(v_reinterpret_as_u8(a)); } +inline bool v_check_all(const v_int16x8& a) +{ return v_check_all(v_reinterpret_as_u16(a)); } +inline bool v_check_all(const v_int32x4& a) +{ return v_check_all(v_reinterpret_as_u32(a)); } +inline bool v_check_all(const v_float32x4& a) +{ return v_check_all(v_reinterpret_as_u32(a)); } + +inline bool v_check_any(const v_int8x16& a) +{ return v_check_any(v_reinterpret_as_u8(a)); } +inline bool v_check_any(const v_int16x8& a) +{ return v_check_any(v_reinterpret_as_u16(a)); } +inline bool v_check_any(const v_int32x4& a) +{ return v_check_any(v_reinterpret_as_u32(a)); } +inline bool v_check_any(const v_float32x4& a) +{ return v_check_any(v_reinterpret_as_u32(a)); } + +inline bool v_check_all(const v_int64x2& a) +{ return v_check_all(v_reinterpret_as_u64(a)); } +inline bool v_check_all(const v_float64x2& a) +{ return v_check_all(v_reinterpret_as_u64(a)); } +inline bool v_check_any(const v_int64x2& a) +{ return v_check_any(v_reinterpret_as_u64(a)); } +inline bool v_check_any(const v_float64x2& a) +{ return v_check_any(v_reinterpret_as_u64(a)); } + +/* v_select */ +#define OPENCV_HAL_IMPL_MSA_SELECT(_Tpvec, _Tpv, _Tpvu) \ +inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_bslq_u8(MSA_TPV_REINTERPRET(_Tpvu, mask.val), \ + MSA_TPV_REINTERPRET(_Tpvu, b.val), MSA_TPV_REINTERPRET(_Tpvu, a.val)))); \ +} + +OPENCV_HAL_IMPL_MSA_SELECT(v_uint8x16, v16u8, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_int8x16, v16i8, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_uint16x8, v8u16, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_int16x8, v8i16, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_uint32x4, v4u32, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_int32x4, v4i32, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_float32x4, v4f32, v16u8) +OPENCV_HAL_IMPL_MSA_SELECT(v_float64x2, v2f64, v16u8) + +#define OPENCV_HAL_IMPL_MSA_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix, ssuffix, _Tpv, _Tpvs) \ +inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ +{ \ + _Tpv a_lo = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \ + _Tpv a_hi = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \ + b0.val = msa_paddlq_##suffix(a_lo); \ + b1.val = msa_paddlq_##suffix(a_hi); \ +} \ +inline _Tpwvec v_expand_low(const _Tpvec& a) \ +{ \ + _Tpv a_lo = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \ + return _Tpwvec(msa_paddlq_##suffix(a_lo)); \ +} \ +inline _Tpwvec v_expand_high(const _Tpvec& a) \ +{ \ + _Tpv a_hi = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), msa_dupq_n_##ssuffix(0))); \ + return _Tpwvec(msa_paddlq_##suffix(a_hi)); \ +} \ +inline _Tpwvec v_load_expand(const _Tp* ptr) \ +{ \ + return _Tpwvec(msa_movl_##suffix(msa_ld1_##suffix(ptr))); \ +} + +OPENCV_HAL_IMPL_MSA_EXPAND(v_uint8x16, v_uint16x8, uchar, u8, s8, v16u8, v16i8) +OPENCV_HAL_IMPL_MSA_EXPAND(v_int8x16, v_int16x8, schar, s8, s8, v16i8, v16i8) +OPENCV_HAL_IMPL_MSA_EXPAND(v_uint16x8, v_uint32x4, ushort, u16, s16, v8u16, v8i16) +OPENCV_HAL_IMPL_MSA_EXPAND(v_int16x8, v_int32x4, short, s16, s16, v8i16, v8i16) +OPENCV_HAL_IMPL_MSA_EXPAND(v_uint32x4, v_uint64x2, uint, u32, s32, v4u32, v4i32) +OPENCV_HAL_IMPL_MSA_EXPAND(v_int32x4, v_int64x2, int, s32, s32, v4i32, v4i32) + +inline v_uint32x4 v_load_expand_q(const uchar* ptr) +{ + return v_uint32x4((v4u32){ptr[0], ptr[1], ptr[2], ptr[3]}); +} + +inline v_int32x4 v_load_expand_q(const schar* ptr) +{ + return v_int32x4((v4i32){ptr[0], ptr[1], ptr[2], ptr[3]}); +} + +/* v_zip, v_combine_low, v_combine_high, v_recombine */ +#define OPENCV_HAL_IMPL_MSA_UNPACKS(_Tpvec, _Tpv, _Tpvs, ssuffix) \ +inline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \ +{ \ + b0.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \ + b1.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \ +} \ +inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val)))); \ +} \ +inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val)))); \ +} \ +inline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \ +{ \ + c.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val))); \ + d.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, b.val), MSA_TPV_REINTERPRET(v2i64, a.val))); \ +} + +OPENCV_HAL_IMPL_MSA_UNPACKS(v_uint8x16, v16u8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_int8x16, v16i8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_uint16x8, v8u16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_int16x8, v8i16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_uint32x4, v4u32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_int32x4, v4i32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_float32x4, v4f32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_UNPACKS(v_float64x2, v2f64, v2i64, s64) + +/* v_extract */ +#define OPENCV_HAL_IMPL_MSA_EXTRACT(_Tpvec, _Tpv, _Tpvs, suffix) \ +template \ +inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(MSA_TPV_REINTERPRET(_Tpv, msa_extq_##suffix(MSA_TPV_REINTERPRET(_Tpvs, a.val), MSA_TPV_REINTERPRET(_Tpvs, b.val), s))); \ +} + +OPENCV_HAL_IMPL_MSA_EXTRACT(v_uint8x16, v16u8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_int8x16, v16i8, v16i8, s8) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_uint16x8, v8u16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_int16x8, v8i16, v8i16, s16) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_uint32x4, v4u32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_int32x4, v4i32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_uint64x2, v2u64, v2i64, s64) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_int64x2, v2i64, v2i64, s64) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_float32x4, v4f32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_EXTRACT(v_float64x2, v2f64, v2i64, s64) + +/* v_round, v_floor, v_ceil, v_trunc */ +inline v_int32x4 v_round(const v_float32x4& a) +{ + return v_int32x4(msa_cvttintq_s32_f32(a.val)); +} + +inline v_int32x4 v_floor(const v_float32x4& a) +{ + v4i32 a1 = msa_cvttintq_s32_f32(a.val); + return v_int32x4(msa_addq_s32(a1, MSA_TPV_REINTERPRET(v4i32, msa_cgtq_f32(msa_cvtfintq_f32_s32(a1), a.val)))); +} + +inline v_int32x4 v_ceil(const v_float32x4& a) +{ + v4i32 a1 = msa_cvttintq_s32_f32(a.val); + return v_int32x4(msa_subq_s32(a1, MSA_TPV_REINTERPRET(v4i32, msa_cgtq_f32(a.val, msa_cvtfintq_f32_s32(a1))))); +} + +inline v_int32x4 v_trunc(const v_float32x4& a) +{ + return v_int32x4(msa_cvttruncq_s32_f32(a.val)); +} + +inline v_int32x4 v_round(const v_float64x2& a) +{ + return v_int32x4(msa_pack_s64(msa_cvttintq_s64_f64(a.val), msa_dupq_n_s64(0))); +} + +inline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b) +{ + return v_int32x4(msa_pack_s64(msa_cvttintq_s64_f64(a.val), msa_cvttintq_s64_f64(b.val))); +} + +inline v_int32x4 v_floor(const v_float64x2& a) +{ + v2f64 a1 = msa_cvtrintq_f64(a.val); + return v_int32x4(msa_pack_s64(msa_addq_s64(msa_cvttruncq_s64_f64(a1), MSA_TPV_REINTERPRET(v2i64, msa_cgtq_f64(a1, a.val))), msa_dupq_n_s64(0))); +} + +inline v_int32x4 v_ceil(const v_float64x2& a) +{ + v2f64 a1 = msa_cvtrintq_f64(a.val); + return v_int32x4(msa_pack_s64(msa_subq_s64(msa_cvttruncq_s64_f64(a1), MSA_TPV_REINTERPRET(v2i64, msa_cgtq_f64(a.val, a1))), msa_dupq_n_s64(0))); +} + +inline v_int32x4 v_trunc(const v_float64x2& a) +{ + return v_int32x4(msa_pack_s64(msa_cvttruncq_s64_f64(a.val), msa_dupq_n_s64(0))); +} + +#define OPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(_Tpvec, _Tpv, _Tpvs, ssuffix) \ +inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \ + const _Tpvec& a2, const _Tpvec& a3, \ + _Tpvec& b0, _Tpvec& b1, \ + _Tpvec& b2, _Tpvec& b3) \ +{ \ + _Tpv t00 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \ + _Tpv t01 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a1.val), MSA_TPV_REINTERPRET(_Tpvs, a0.val))); \ + _Tpv t10 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a3.val), MSA_TPV_REINTERPRET(_Tpvs, a2.val))); \ + _Tpv t11 = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_##ssuffix(MSA_TPV_REINTERPRET(_Tpvs, a3.val), MSA_TPV_REINTERPRET(_Tpvs, a2.val))); \ + b0.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, t10), MSA_TPV_REINTERPRET(v2i64, t00))); \ + b1.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, t10), MSA_TPV_REINTERPRET(v2i64, t00))); \ + b2.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvrq_s64(MSA_TPV_REINTERPRET(v2i64, t11), MSA_TPV_REINTERPRET(v2i64, t01))); \ + b3.val = MSA_TPV_REINTERPRET(_Tpv, msa_ilvlq_s64(MSA_TPV_REINTERPRET(v2i64, t11), MSA_TPV_REINTERPRET(v2i64, t01))); \ +} + +OPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_uint32x4, v4u32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_int32x4, v4i32, v4i32, s32) +OPENCV_HAL_IMPL_MSA_TRANSPOSE4x4(v_float32x4, v4f32, v4i32, s32) + +#define OPENCV_HAL_IMPL_MSA_INTERLEAVED(_Tpvec, _Tp, suffix) \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b) \ +{ \ + msa_ld2q_##suffix(ptr, &a.val, &b.val); \ +} \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, v_##_Tpvec& c) \ +{ \ + msa_ld3q_##suffix(ptr, &a.val, &b.val, &c.val); \ +} \ +inline void v_load_deinterleave(const _Tp* ptr, v_##_Tpvec& a, v_##_Tpvec& b, \ + v_##_Tpvec& c, v_##_Tpvec& d) \ +{ \ + msa_ld4q_##suffix(ptr, &a.val, &b.val, &c.val, &d.val); \ +} \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \ + hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \ +{ \ + msa_st2q_##suffix(ptr, a.val, b.val); \ +} \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \ + const v_##_Tpvec& c, hal::StoreMode /*mode*/=hal::STORE_UNALIGNED) \ +{ \ + msa_st3q_##suffix(ptr, a.val, b.val, c.val); \ +} \ +inline void v_store_interleave( _Tp* ptr, const v_##_Tpvec& a, const v_##_Tpvec& b, \ + const v_##_Tpvec& c, const v_##_Tpvec& d, \ + hal::StoreMode /*mode*/=hal::STORE_UNALIGNED ) \ +{ \ + msa_st4q_##suffix(ptr, a.val, b.val, c.val, d.val); \ +} + +OPENCV_HAL_IMPL_MSA_INTERLEAVED(uint8x16, uchar, u8) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(int8x16, schar, s8) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(uint16x8, ushort, u16) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(int16x8, short, s16) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(int32x4, int, s32) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(float32x4, float, f32) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(uint64x2, uint64, u64) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(int64x2, int64, s64) +OPENCV_HAL_IMPL_MSA_INTERLEAVED(float64x2, double, f64) + +/* v_cvt_f32, v_cvt_f64, v_cvt_f64_high */ +inline v_float32x4 v_cvt_f32(const v_int32x4& a) +{ + return v_float32x4(msa_cvtfintq_f32_s32(a.val)); +} + +inline v_float32x4 v_cvt_f32(const v_float64x2& a) +{ + return v_float32x4(msa_cvtfq_f32_f64(a.val, msa_dupq_n_f64(0.0f))); +} + +inline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b) +{ + return v_float32x4(msa_cvtfq_f32_f64(a.val, b.val)); +} + +inline v_float64x2 v_cvt_f64(const v_int32x4& a) +{ + return v_float64x2(msa_cvtflq_f64_f32(msa_cvtfintq_f32_s32(a.val))); +} + +inline v_float64x2 v_cvt_f64_high(const v_int32x4& a) +{ + return v_float64x2(msa_cvtfhq_f64_f32(msa_cvtfintq_f32_s32(a.val))); +} + +inline v_float64x2 v_cvt_f64(const v_float32x4& a) +{ + return v_float64x2(msa_cvtflq_f64_f32(a.val)); +} + +inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) +{ + return v_float64x2(msa_cvtfhq_f64_f32(a.val)); +} + +inline v_float64x2 v_cvt_f64(const v_int64x2& a) +{ + return v_float64x2(msa_cvtfintq_f64_s64(a.val)); +} + +////////////// Lookup table access //////////////////// +inline v_int8x16 v_lut(const schar* tab, const int* idx) +{ + schar CV_DECL_ALIGNED(32) elems[16] = + { + tab[idx[ 0]], + tab[idx[ 1]], + tab[idx[ 2]], + tab[idx[ 3]], + tab[idx[ 4]], + tab[idx[ 5]], + tab[idx[ 6]], + tab[idx[ 7]], + tab[idx[ 8]], + tab[idx[ 9]], + tab[idx[10]], + tab[idx[11]], + tab[idx[12]], + tab[idx[13]], + tab[idx[14]], + tab[idx[15]] + }; + return v_int8x16(msa_ld1q_s8(elems)); +} +inline v_int8x16 v_lut_pairs(const schar* tab, const int* idx) +{ + schar CV_DECL_ALIGNED(32) elems[16] = + { + tab[idx[0]], + tab[idx[0] + 1], + tab[idx[1]], + tab[idx[1] + 1], + tab[idx[2]], + tab[idx[2] + 1], + tab[idx[3]], + tab[idx[3] + 1], + tab[idx[4]], + tab[idx[4] + 1], + tab[idx[5]], + tab[idx[5] + 1], + tab[idx[6]], + tab[idx[6] + 1], + tab[idx[7]], + tab[idx[7] + 1] + }; + return v_int8x16(msa_ld1q_s8(elems)); +} +inline v_int8x16 v_lut_quads(const schar* tab, const int* idx) +{ + schar CV_DECL_ALIGNED(32) elems[16] = + { + tab[idx[0]], + tab[idx[0] + 1], + tab[idx[0] + 2], + tab[idx[0] + 3], + tab[idx[1]], + tab[idx[1] + 1], + tab[idx[1] + 2], + tab[idx[1] + 3], + tab[idx[2]], + tab[idx[2] + 1], + tab[idx[2] + 2], + tab[idx[2] + 3], + tab[idx[3]], + tab[idx[3] + 1], + tab[idx[3] + 2], + tab[idx[3] + 3] + }; + return v_int8x16(msa_ld1q_s8(elems)); +} +inline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((schar*)tab, idx)); } +inline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((schar*)tab, idx)); } +inline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((schar*)tab, idx)); } + + +inline v_int16x8 v_lut(const short* tab, const int* idx) +{ + short CV_DECL_ALIGNED(32) elems[8] = + { + tab[idx[0]], + tab[idx[1]], + tab[idx[2]], + tab[idx[3]], + tab[idx[4]], + tab[idx[5]], + tab[idx[6]], + tab[idx[7]] + }; + return v_int16x8(msa_ld1q_s16(elems)); +} +inline v_int16x8 v_lut_pairs(const short* tab, const int* idx) +{ + short CV_DECL_ALIGNED(32) elems[8] = + { + tab[idx[0]], + tab[idx[0] + 1], + tab[idx[1]], + tab[idx[1] + 1], + tab[idx[2]], + tab[idx[2] + 1], + tab[idx[3]], + tab[idx[3] + 1] + }; + return v_int16x8(msa_ld1q_s16(elems)); +} +inline v_int16x8 v_lut_quads(const short* tab, const int* idx) +{ + return v_int16x8(msa_combine_s16(msa_ld1_s16(tab + idx[0]), msa_ld1_s16(tab + idx[1]))); +} +inline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((short*)tab, idx)); } +inline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((short*)tab, idx)); } +inline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((short*)tab, idx)); } + +inline v_int32x4 v_lut(const int* tab, const int* idx) +{ + int CV_DECL_ALIGNED(32) elems[4] = + { + tab[idx[0]], + tab[idx[1]], + tab[idx[2]], + tab[idx[3]] + }; + return v_int32x4(msa_ld1q_s32(elems)); +} +inline v_int32x4 v_lut_pairs(const int* tab, const int* idx) +{ + return v_int32x4(msa_combine_s32(msa_ld1_s32(tab + idx[0]), msa_ld1_s32(tab + idx[1]))); +} +inline v_int32x4 v_lut_quads(const int* tab, const int* idx) +{ + return v_int32x4(msa_ld1q_s32(tab + idx[0])); +} +inline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((int*)tab, idx)); } +inline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((int*)tab, idx)); } +inline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((int*)tab, idx)); } + +inline v_int64x2 v_lut(const int64_t* tab, const int* idx) +{ + return v_int64x2(msa_combine_s64(msa_create_s64(tab[idx[0]]), msa_create_s64(tab[idx[1]]))); +} +inline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx) +{ + return v_int64x2(msa_ld1q_s64(tab + idx[0])); +} +inline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); } +inline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); } + +inline v_float32x4 v_lut(const float* tab, const int* idx) +{ + float CV_DECL_ALIGNED(32) elems[4] = + { + tab[idx[0]], + tab[idx[1]], + tab[idx[2]], + tab[idx[3]] + }; + return v_float32x4(msa_ld1q_f32(elems)); +} +inline v_float32x4 v_lut_pairs(const float* tab, const int* idx) +{ + uint64 CV_DECL_ALIGNED(32) elems[2] = + { + *(uint64*)(tab + idx[0]), + *(uint64*)(tab + idx[1]) + }; + return v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ld1q_u64(elems))); +} +inline v_float32x4 v_lut_quads(const float* tab, const int* idx) +{ + return v_float32x4(msa_ld1q_f32(tab + idx[0])); +} + +inline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec) +{ + int CV_DECL_ALIGNED(32) idx[4]; + v_store_aligned(idx, idxvec); + + return v_int32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]); +} + +inline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec) +{ + unsigned CV_DECL_ALIGNED(32) elems[4] = + { + tab[msa_getq_lane_s32(idxvec.val, 0)], + tab[msa_getq_lane_s32(idxvec.val, 1)], + tab[msa_getq_lane_s32(idxvec.val, 2)], + tab[msa_getq_lane_s32(idxvec.val, 3)] + }; + return v_uint32x4(msa_ld1q_u32(elems)); +} + +inline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec) +{ + int CV_DECL_ALIGNED(32) idx[4]; + v_store_aligned(idx, idxvec); + + return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]); +} + +inline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y) +{ + int CV_DECL_ALIGNED(32) idx[4]; + v_store_aligned(idx, idxvec); + + v4f32 xy02 = msa_combine_f32(msa_ld1_f32(tab + idx[0]), msa_ld1_f32(tab + idx[2])); + v4f32 xy13 = msa_combine_f32(msa_ld1_f32(tab + idx[1]), msa_ld1_f32(tab + idx[3])); + x = v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ilvevq_s32(MSA_TPV_REINTERPRET(v4i32, xy13), MSA_TPV_REINTERPRET(v4i32, xy02)))); + y = v_float32x4(MSA_TPV_REINTERPRET(v4f32, msa_ilvodq_s32(MSA_TPV_REINTERPRET(v4i32, xy13), MSA_TPV_REINTERPRET(v4i32, xy02)))); +} + +inline v_int8x16 v_interleave_pairs(const v_int8x16& vec) +{ + v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0705060403010200, 0x0F0D0E0C0B090A08}), msa_dupq_n_s8(0), vec.val)); + return c; +} +inline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec) +{ return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); } +inline v_int8x16 v_interleave_quads(const v_int8x16& vec) +{ + v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0703060205010400, 0x0F0B0E0A0D090C08}), msa_dupq_n_s8(0), vec.val)); + return c; +} +inline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); } + +inline v_int16x8 v_interleave_pairs(const v_int16x8& vec) +{ + v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0003000100020000, 0x0007000500060004}), msa_dupq_n_s16(0), vec.val)); + return c; +} + +inline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); } + +inline v_int16x8 v_interleave_quads(const v_int16x8& vec) +{ + v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0005000100040000, 0x0007000300060002}), msa_dupq_n_s16(0), vec.val)); + return c; +} + +inline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); } + +inline v_int32x4 v_interleave_pairs(const v_int32x4& vec) +{ + v_int32x4 c; + c.val[0] = vec.val[0]; + c.val[1] = vec.val[2]; + c.val[2] = vec.val[1]; + c.val[3] = vec.val[3]; + return c; +} + +inline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); } +inline v_float32x4 v_interleave_pairs(const v_float32x4& vec) { return v_reinterpret_as_f32(v_interleave_pairs(v_reinterpret_as_s32(vec))); } + +inline v_int8x16 v_pack_triplets(const v_int8x16& vec) +{ + v_int8x16 c = v_int8x16(__builtin_msa_vshf_b((v16i8)((v2i64){0x0908060504020100, 0x131211100E0D0C0A}), msa_dupq_n_s8(0), vec.val)); + return c; +} + +inline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); } + +inline v_int16x8 v_pack_triplets(const v_int16x8& vec) +{ + v_int16x8 c = v_int16x8(__builtin_msa_vshf_h((v8i16)((v2i64){0x0004000200010000, 0x0009000800060005}), msa_dupq_n_s16(0), vec.val)); + return c; +} + +inline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); } +inline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; } +inline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; } +inline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; } + +inline v_float64x2 v_lut(const double* tab, const int* idx) +{ + double CV_DECL_ALIGNED(32) elems[2] = + { + tab[idx[0]], + tab[idx[1]] + }; + return v_float64x2(msa_ld1q_f64(elems)); +} + +inline v_float64x2 v_lut_pairs(const double* tab, const int* idx) +{ + return v_float64x2(msa_ld1q_f64(tab + idx[0])); +} + +inline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec) +{ + int CV_DECL_ALIGNED(32) idx[4]; + v_store_aligned(idx, idxvec); + + return v_float64x2(tab[idx[0]], tab[idx[1]]); +} + +inline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y) +{ + int CV_DECL_ALIGNED(32) idx[4]; + v_store_aligned(idx, idxvec); + + v2f64 xy0 = msa_ld1q_f64(tab + idx[0]); + v2f64 xy1 = msa_ld1q_f64(tab + idx[1]); + x = v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ilvevq_s64(MSA_TPV_REINTERPRET(v2i64, xy1), MSA_TPV_REINTERPRET(v2i64, xy0)))); + y = v_float64x2(MSA_TPV_REINTERPRET(v2f64, msa_ilvodq_s64(MSA_TPV_REINTERPRET(v2i64, xy1), MSA_TPV_REINTERPRET(v2i64, xy0)))); +} + +template +inline typename _Tp::lane_type v_extract_n(const _Tp& a) +{ + return v_rotate_right(a).get0(); +} + +template +inline v_uint32x4 v_broadcast_element(const v_uint32x4& a) +{ + return v_setall_u32(v_extract_n(a)); +} +template +inline v_int32x4 v_broadcast_element(const v_int32x4& a) +{ + return v_setall_s32(v_extract_n(a)); +} +template +inline v_float32x4 v_broadcast_element(const v_float32x4& a) +{ + return v_setall_f32(v_extract_n(a)); +} + +////// FP16 support /////// +#if CV_FP16 +inline v_float32x4 v_load_expand(const float16_t* ptr) +{ +#ifndef msa_ld1_f16 + v4f16 v = (v4f16)msa_ld1_s16((const short*)ptr); +#else + v4f16 v = msa_ld1_f16((const __fp16*)ptr); +#endif + return v_float32x4(msa_cvt_f32_f16(v)); +} + +inline void v_pack_store(float16_t* ptr, const v_float32x4& v) +{ + v4f16 hv = msa_cvt_f16_f32(v.val); + +#ifndef msa_st1_f16 + msa_st1_s16((short*)ptr, (int16x4_t)hv); +#else + msa_st1_f16((__fp16*)ptr, hv); +#endif +} +#else +inline v_float32x4 v_load_expand(const float16_t* ptr) +{ + float buf[4]; + for( int i = 0; i < 4; i++ ) + buf[i] = (float)ptr[i]; + return v_load(buf); +} + +inline void v_pack_store(float16_t* ptr, const v_float32x4& v) +{ + float buf[4]; + v_store(buf, v); + for( int i = 0; i < 4; i++ ) + ptr[i] = (float16_t)buf[i]; +} +#endif + +inline void v_cleanup() {} + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END + +//! @endcond + +} + +#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_neon.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_neon.hpp similarity index 75% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_neon.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_neon.hpp index 3b946ff..7856485 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_neon.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_neon.hpp @@ -56,29 +56,85 @@ namespace cv CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN #define CV_SIMD128 1 -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(_M_ARM64) #define CV_SIMD128_64F 1 #else #define CV_SIMD128_64F 0 #endif +// The following macro checks if the code is being compiled for the +// AArch64 execution state of Armv8, to enable the 128-bit +// intrinsics. The macro `__ARM_64BIT_STATE` is the one recommended by +// the Arm C Language Extension (ACLE) specifications [1] to check the +// availability of 128-bit intrinsics, and it is supporrted by clang +// and gcc. The macro `_M_ARM64` is the equivalent one for Microsoft +// Visual Studio [2] . +// +// [1] https://developer.arm.com/documentation/101028/0012/13--Advanced-SIMD--Neon--intrinsics +// [2] https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros +#if defined(__ARM_64BIT_STATE) || defined(_M_ARM64) +#define CV_NEON_AARCH64 1 +#else +#define CV_NEON_AARCH64 0 +#endif + +// TODO +#define CV_NEON_DOT 0 + +//////////// Utils //////////// + +#if CV_SIMD128_64F +#define OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv, _Tpvx2, suffix) \ + inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \ + { c = vuzp1q_##suffix(a, b); d = vuzp2q_##suffix(a, b); } +#define OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpv, _Tpvx2, suffix) \ + inline void _v128_unzip(const _Tpv&a, const _Tpv&b, _Tpv& c, _Tpv& d) \ + { c = vuzp1_##suffix(a, b); d = vuzp2_##suffix(a, b); } +#else +#define OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv, _Tpvx2, suffix) \ + inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \ + { _Tpvx2 ab = vuzpq_##suffix(a, b); c = ab.val[0]; d = ab.val[1]; } +#define OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpv, _Tpvx2, suffix) \ + inline void _v128_unzip(const _Tpv& a, const _Tpv& b, _Tpv& c, _Tpv& d) \ + { _Tpvx2 ab = vuzp_##suffix(a, b); c = ab.val[0]; d = ab.val[1]; } +#endif + #if CV_SIMD128_64F #define OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv, suffix) \ -template static inline \ -_Tpv vreinterpretq_##suffix##_f64(T a) { return (_Tpv) a; } \ -template static inline \ -float64x2_t vreinterpretq_f64_##suffix(T a) { return (float64x2_t) a; } -OPENCV_HAL_IMPL_NEON_REINTERPRET(uint8x16_t, u8) -OPENCV_HAL_IMPL_NEON_REINTERPRET(int8x16_t, s8) -OPENCV_HAL_IMPL_NEON_REINTERPRET(uint16x8_t, u16) -OPENCV_HAL_IMPL_NEON_REINTERPRET(int16x8_t, s16) -OPENCV_HAL_IMPL_NEON_REINTERPRET(uint32x4_t, u32) -OPENCV_HAL_IMPL_NEON_REINTERPRET(int32x4_t, s32) -OPENCV_HAL_IMPL_NEON_REINTERPRET(uint64x2_t, u64) -OPENCV_HAL_IMPL_NEON_REINTERPRET(int64x2_t, s64) -OPENCV_HAL_IMPL_NEON_REINTERPRET(float32x4_t, f32) + template static inline \ + _Tpv vreinterpretq_##suffix##_f64(T a) { return (_Tpv) a; } \ + template static inline \ + float64x2_t vreinterpretq_f64_##suffix(T a) { return (float64x2_t) a; } +#else +#define OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv, suffix) #endif +#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(_Tpv, _Tpvl, suffix) \ + OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv##_t, _Tpv##x2_t, suffix) \ + OPENCV_HAL_IMPL_NEON_UNZIP_L(_Tpvl##_t, _Tpvl##x2_t, suffix) \ + OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv##_t, suffix) + +#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(_Tpv, _Tpvl, suffix) \ + OPENCV_HAL_IMPL_NEON_REINTERPRET(_Tpv##_t, suffix) + +#define OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_F64(_Tpv, _Tpvl, suffix) \ + OPENCV_HAL_IMPL_NEON_UNZIP(_Tpv##_t, _Tpv##x2_t, suffix) + +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint8x16, uint8x8, u8) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int8x16, int8x8, s8) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint16x8, uint16x4, u16) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int16x8, int16x4, s16) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(uint32x4, uint32x2, u32) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(int32x4, int32x2, s32) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX(float32x4, float32x2, f32) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(uint64x2, uint64x1, u64) +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_I64(int64x2, int64x1, s64) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_UTILS_SUFFIX_F64(float64x2, float64x1,f64) +#endif + +//////////// Types //////////// + struct v_uint8x16 { typedef uchar lane_type; @@ -278,48 +334,6 @@ struct v_float64x2 }; #endif -#if CV_FP16 -// Workaround for old compilers -static inline int16x4_t vreinterpret_s16_f16(float16x4_t a) { return (int16x4_t)a; } -static inline float16x4_t vreinterpret_f16_s16(int16x4_t a) { return (float16x4_t)a; } - -static inline float16x4_t cv_vld1_f16(const void* ptr) -{ -#ifndef vld1_f16 // APPLE compiler defines vld1_f16 as macro - return vreinterpret_f16_s16(vld1_s16((const short*)ptr)); -#else - return vld1_f16((const __fp16*)ptr); -#endif -} -static inline void cv_vst1_f16(void* ptr, float16x4_t a) -{ -#ifndef vst1_f16 // APPLE compiler defines vst1_f16 as macro - vst1_s16((short*)ptr, vreinterpret_s16_f16(a)); -#else - vst1_f16((__fp16*)ptr, a); -#endif -} - -#ifndef vdup_n_f16 - #define vdup_n_f16(v) (float16x4_t){v, v, v, v} -#endif - -#endif // CV_FP16 - -#if CV_FP16 -inline v_float32x4 v128_load_fp16_f32(const short* ptr) -{ - float16x4_t a = cv_vld1_f16((const __fp16*)ptr); - return v_float32x4(vcvt_f32_f16(a)); -} - -inline void v_store_fp16(short* ptr, const v_float32x4& a) -{ - float16x4_t fp16 = vcvt_f16_f32(a.val); - cv_vst1_f16((short*)ptr, fp16); -} -#endif - #define OPENCV_HAL_IMPL_NEON_INIT(_Tpv, _Tp, suffix) \ inline v_##_Tpv v_setzero_##suffix() { return v_##_Tpv(vdupq_n_##suffix((_Tp)0)); } \ inline v_##_Tpv v_setall_##suffix(_Tp v) { return v_##_Tpv(vdupq_n_##suffix(v)); } \ @@ -570,20 +584,292 @@ inline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b) )); } +//////// Dot Product //////// + +// 16 >> 32 inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) { - int32x4_t c = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); - int32x4_t d = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val)); - int32x4x2_t cd = vuzpq_s32(c, d); - return v_int32x4(vaddq_s32(cd.val[0], cd.val[1])); + int16x8_t uzp1, uzp2; + _v128_unzip(a.val, b.val, uzp1, uzp2); + int16x4_t a0 = vget_low_s16(uzp1); + int16x4_t b0 = vget_high_s16(uzp1); + int16x4_t a1 = vget_low_s16(uzp2); + int16x4_t b1 = vget_high_s16(uzp2); + int32x4_t p = vmull_s16(a0, b0); + return v_int32x4(vmlal_s16(p, a1, b1)); } - inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) { - v_int32x4 s = v_dotprod(a, b); - return v_int32x4(vaddq_s32(s.val , c.val)); + int16x8_t uzp1, uzp2; + _v128_unzip(a.val, b.val, uzp1, uzp2); + int16x4_t a0 = vget_low_s16(uzp1); + int16x4_t b0 = vget_high_s16(uzp1); + int16x4_t a1 = vget_low_s16(uzp2); + int16x4_t b1 = vget_high_s16(uzp2); + int32x4_t p = vmlal_s16(c.val, a0, b0); + return v_int32x4(vmlal_s16(p, a1, b1)); } +// 32 >> 64 +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b) +{ + int32x4_t uzp1, uzp2; + _v128_unzip(a.val, b.val, uzp1, uzp2); + int32x2_t a0 = vget_low_s32(uzp1); + int32x2_t b0 = vget_high_s32(uzp1); + int32x2_t a1 = vget_low_s32(uzp2); + int32x2_t b1 = vget_high_s32(uzp2); + int64x2_t p = vmull_s32(a0, b0); + return v_int64x2(vmlal_s32(p, a1, b1)); +} +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ + int32x4_t uzp1, uzp2; + _v128_unzip(a.val, b.val, uzp1, uzp2); + int32x2_t a0 = vget_low_s32(uzp1); + int32x2_t b0 = vget_high_s32(uzp1); + int32x2_t a1 = vget_low_s32(uzp2); + int32x2_t b1 = vget_high_s32(uzp2); + int64x2_t p = vmlal_s32(c.val, a0, b0); + return v_int64x2(vmlal_s32(p, a1, b1)); +} + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b) +{ +#if CV_NEON_DOT + return v_uint32x4(vdotq_u32(vdupq_n_u32(0), a.val, b.val)); +#else + const uint8x16_t zero = vreinterpretq_u8_u32(vdupq_n_u32(0)); + const uint8x16_t mask = vreinterpretq_u8_u32(vdupq_n_u32(0x00FF00FF)); + const uint16x8_t zero32 = vreinterpretq_u16_u32(vdupq_n_u32(0)); + const uint16x8_t mask32 = vreinterpretq_u16_u32(vdupq_n_u32(0x0000FFFF)); + + uint16x8_t even = vmulq_u16(vreinterpretq_u16_u8(vbslq_u8(mask, a.val, zero)), + vreinterpretq_u16_u8(vbslq_u8(mask, b.val, zero))); + uint16x8_t odd = vmulq_u16(vshrq_n_u16(vreinterpretq_u16_u8(a.val), 8), + vshrq_n_u16(vreinterpretq_u16_u8(b.val), 8)); + + uint32x4_t s0 = vaddq_u32(vreinterpretq_u32_u16(vbslq_u16(mask32, even, zero32)), + vreinterpretq_u32_u16(vbslq_u16(mask32, odd, zero32))); + uint32x4_t s1 = vaddq_u32(vshrq_n_u32(vreinterpretq_u32_u16(even), 16), + vshrq_n_u32(vreinterpretq_u32_u16(odd), 16)); + return v_uint32x4(vaddq_u32(s0, s1)); +#endif +} +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, + const v_uint32x4& c) +{ +#if CV_NEON_DOT + return v_uint32x4(vdotq_u32(c.val, a.val, b.val)); +#else + return v_dotprod_expand(a, b) + c; +#endif +} + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b) +{ +#if CV_NEON_DOT + return v_int32x4(vdotq_s32(vdupq_n_s32(0), a.val, b.val)); +#else + int16x8_t p0 = vmull_s8(vget_low_s8(a.val), vget_low_s8(b.val)); + int16x8_t p1 = vmull_s8(vget_high_s8(a.val), vget_high_s8(b.val)); + int16x8_t uzp1, uzp2; + _v128_unzip(p0, p1, uzp1, uzp2); + int16x8_t sum = vaddq_s16(uzp1, uzp2); + int16x4_t uzpl1, uzpl2; + _v128_unzip(vget_low_s16(sum), vget_high_s16(sum), uzpl1, uzpl2); + return v_int32x4(vaddl_s16(uzpl1, uzpl2)); +#endif +} +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, + const v_int32x4& c) +{ +#if CV_NEON_DOT + return v_int32x4(vdotq_s32(c.val, a.val, b.val)); +#else + return v_dotprod_expand(a, b) + c; +#endif +} + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b) +{ + const uint16x8_t zero = vreinterpretq_u16_u32(vdupq_n_u32(0)); + const uint16x8_t mask = vreinterpretq_u16_u32(vdupq_n_u32(0x0000FFFF)); + + uint32x4_t even = vmulq_u32(vreinterpretq_u32_u16(vbslq_u16(mask, a.val, zero)), + vreinterpretq_u32_u16(vbslq_u16(mask, b.val, zero))); + uint32x4_t odd = vmulq_u32(vshrq_n_u32(vreinterpretq_u32_u16(a.val), 16), + vshrq_n_u32(vreinterpretq_u32_u16(b.val), 16)); + uint32x4_t uzp1, uzp2; + _v128_unzip(even, odd, uzp1, uzp2); + uint64x2_t s0 = vaddl_u32(vget_low_u32(uzp1), vget_high_u32(uzp1)); + uint64x2_t s1 = vaddl_u32(vget_low_u32(uzp2), vget_high_u32(uzp2)); + return v_uint64x2(vaddq_u64(s0, s1)); +} +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b) +{ + int32x4_t p0 = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); + int32x4_t p1 = vmull_s16(vget_high_s16(a.val), vget_high_s16(b.val)); + + int32x4_t uzp1, uzp2; + _v128_unzip(p0, p1, uzp1, uzp2); + int32x4_t sum = vaddq_s32(uzp1, uzp2); + + int32x2_t uzpl1, uzpl2; + _v128_unzip(vget_low_s32(sum), vget_high_s32(sum), uzpl1, uzpl2); + return v_int64x2(vaddl_s32(uzpl1, uzpl2)); +} +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, + const v_int64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +#if CV_SIMD128_64F +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, + const v_float64x2& c) +{ return v_dotprod_expand(a, b) + c; } +#endif + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) +{ +#if CV_NEON_AARCH64 + int32x4_t p = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); + return v_int32x4(vmlal_high_s16(p, a.val, b.val)); +#else + int16x4_t a0 = vget_low_s16(a.val); + int16x4_t a1 = vget_high_s16(a.val); + int16x4_t b0 = vget_low_s16(b.val); + int16x4_t b1 = vget_high_s16(b.val); + int32x4_t p = vmull_s16(a0, b0); + return v_int32x4(vmlal_s16(p, a1, b1)); +#endif +} +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ +#if CV_NEON_AARCH64 + int32x4_t p = vmlal_s16(c.val, vget_low_s16(a.val), vget_low_s16(b.val)); + return v_int32x4(vmlal_high_s16(p, a.val, b.val)); +#else + int16x4_t a0 = vget_low_s16(a.val); + int16x4_t a1 = vget_high_s16(a.val); + int16x4_t b0 = vget_low_s16(b.val); + int16x4_t b1 = vget_high_s16(b.val); + int32x4_t p = vmlal_s16(c.val, a0, b0); + return v_int32x4(vmlal_s16(p, a1, b1)); +#endif +} + +// 32 >> 64 +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) +{ +#if CV_NEON_AARCH64 + int64x2_t p = vmull_s32(vget_low_s32(a.val), vget_low_s32(b.val)); + return v_int64x2(vmlal_high_s32(p, a.val, b.val)); +#else + int32x2_t a0 = vget_low_s32(a.val); + int32x2_t a1 = vget_high_s32(a.val); + int32x2_t b0 = vget_low_s32(b.val); + int32x2_t b1 = vget_high_s32(b.val); + int64x2_t p = vmull_s32(a0, b0); + return v_int64x2(vmlal_s32(p, a1, b1)); +#endif +} +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ +#if CV_NEON_AARCH64 + int64x2_t p = vmlal_s32(c.val, vget_low_s32(a.val), vget_low_s32(b.val)); + return v_int64x2(vmlal_high_s32(p, a.val, b.val)); +#else + int32x2_t a0 = vget_low_s32(a.val); + int32x2_t a1 = vget_high_s32(a.val); + int32x2_t b0 = vget_low_s32(b.val); + int32x2_t b1 = vget_high_s32(b.val); + int64x2_t p = vmlal_s32(c.val, a0, b0); + return v_int64x2(vmlal_s32(p, a1, b1)); +#endif +} + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) +{ +#if CV_NEON_DOT + return v_uint32x4(vdotq_u32(vdupq_n_u32(0), a.val, b.val)); +#else + uint16x8_t p0 = vmull_u8(vget_low_u8(a.val), vget_low_u8(b.val)); + uint16x8_t p1 = vmull_u8(vget_high_u8(a.val), vget_high_u8(b.val)); + uint32x4_t s0 = vaddl_u16(vget_low_u16(p0), vget_low_u16(p1)); + uint32x4_t s1 = vaddl_u16(vget_high_u16(p0), vget_high_u16(p1)); + return v_uint32x4(vaddq_u32(s0, s1)); +#endif +} +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ +#if CV_NEON_DOT + return v_uint32x4(vdotq_u32(c.val, a.val, b.val)); +#else + return v_dotprod_expand_fast(a, b) + c; +#endif +} + +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) +{ +#if CV_NEON_DOT + return v_int32x4(vdotq_s32(vdupq_n_s32(0), a.val, b.val)); +#else + int16x8_t prod = vmull_s8(vget_low_s8(a.val), vget_low_s8(b.val)); + prod = vmlal_s8(prod, vget_high_s8(a.val), vget_high_s8(b.val)); + return v_int32x4(vaddl_s16(vget_low_s16(prod), vget_high_s16(prod))); +#endif +} +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ +#if CV_NEON_DOT + return v_int32x4(vdotq_s32(c.val, a.val, b.val)); +#else + return v_dotprod_expand_fast(a, b) + c; +#endif +} + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b) +{ + uint32x4_t p0 = vmull_u16(vget_low_u16(a.val), vget_low_u16(b.val)); + uint32x4_t p1 = vmull_u16(vget_high_u16(a.val), vget_high_u16(b.val)); + uint64x2_t s0 = vaddl_u32(vget_low_u32(p0), vget_high_u32(p0)); + uint64x2_t s1 = vaddl_u32(vget_low_u32(p1), vget_high_u32(p1)); + return v_uint64x2(vaddq_u64(s0, s1)); +} +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b) +{ + int32x4_t prod = vmull_s16(vget_low_s16(a.val), vget_low_s16(b.val)); + prod = vmlal_s16(prod, vget_high_s16(a.val), vget_high_s16(b.val)); + return v_int64x2(vaddl_s32(vget_low_s32(prod), vget_high_s32(prod))); +} +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 32 >> 64f +#if CV_SIMD128_64F +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_cvt_f64(v_dotprod_fast(a, b)); } +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } +#endif + + #define OPENCV_HAL_IMPL_NEON_LOGIC_OP(_Tpvec, suffix) \ OPENCV_HAL_IMPL_NEON_BIN_OP(&, _Tpvec, vandq_##suffix) \ OPENCV_HAL_IMPL_NEON_BIN_OP(|, _Tpvec, vorrq_##suffix) \ @@ -917,13 +1203,27 @@ OPENCV_HAL_IMPL_NEON_ROTATE_OP(v_int64x2, s64) OPENCV_HAL_IMPL_NEON_ROTATE_OP(v_float64x2, f64) #endif +#if defined(__clang__) && defined(__aarch64__) +// avoid LD2 instruction. details: https://github.com/opencv/opencv/issues/14863 +#define OPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_load_low(const _Tp* ptr) \ +{ \ +typedef uint64 CV_DECL_ALIGNED(1) unaligned_uint64; \ +uint64 v = *(unaligned_uint64*)ptr; \ +return _Tpvec(v_reinterpret_as_##suffix(v_uint64x2(v, (uint64)123456))); \ +} +#else +#define OPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \ +inline _Tpvec v_load_low(const _Tp* ptr) \ +{ return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr), vdup_n_##suffix((_Tp)0))); } +#endif + #define OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(_Tpvec, _Tp, suffix) \ inline _Tpvec v_load(const _Tp* ptr) \ { return _Tpvec(vld1q_##suffix(ptr)); } \ inline _Tpvec v_load_aligned(const _Tp* ptr) \ { return _Tpvec(vld1q_##suffix(ptr)); } \ -inline _Tpvec v_load_low(const _Tp* ptr) \ -{ return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr), vdup_n_##suffix((_Tp)0))); } \ +OPENCV_HAL_IMPL_NEON_LOAD_LOW_OP(_Tpvec, _Tp, suffix) \ inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ { return _Tpvec(vcombine_##suffix(vld1_##suffix(ptr0), vld1_##suffix(ptr1))); } \ inline void v_store(_Tp* ptr, const _Tpvec& a) \ @@ -952,6 +1252,45 @@ OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float32x4, float, f32) OPENCV_HAL_IMPL_NEON_LOADSTORE_OP(v_float64x2, double, f64) #endif +inline unsigned v_reduce_sum(const v_uint8x16& a) +{ + uint32x4_t t0 = vpaddlq_u16(vpaddlq_u8(a.val)); + uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0)); + return vget_lane_u32(vpadd_u32(t1, t1), 0); +} +inline int v_reduce_sum(const v_int8x16& a) +{ + int32x4_t t0 = vpaddlq_s16(vpaddlq_s8(a.val)); + int32x2_t t1 = vpadd_s32(vget_low_s32(t0), vget_high_s32(t0)); + return vget_lane_s32(vpadd_s32(t1, t1), 0); +} +inline unsigned v_reduce_sum(const v_uint16x8& a) +{ + uint32x4_t t0 = vpaddlq_u16(a.val); + uint32x2_t t1 = vpadd_u32(vget_low_u32(t0), vget_high_u32(t0)); + return vget_lane_u32(vpadd_u32(t1, t1), 0); +} +inline int v_reduce_sum(const v_int16x8& a) +{ + int32x4_t t0 = vpaddlq_s16(a.val); + int32x2_t t1 = vpadd_s32(vget_low_s32(t0), vget_high_s32(t0)); + return vget_lane_s32(vpadd_s32(t1, t1), 0); +} + +#define OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + _Tpnvec##_t a0 = vp##vectorfunc##_##suffix(vget_low_##suffix(a.val), vget_high_##suffix(a.val)); \ + a0 = vp##vectorfunc##_##suffix(a0, a0); \ + a0 = vp##vectorfunc##_##suffix(a0, a0); \ + return (scalartype)vget_lane_##suffix(vp##vectorfunc##_##suffix(a0, a0),0); \ +} + +OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_uint8x16, uint8x8, uchar, max, max, u8) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_uint8x16, uint8x8, uchar, min, min, u8) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_int8x16, int8x8, schar, max, max, s8) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_16(v_int8x16, int8x8, schar, min, min, s8) + #define OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(_Tpvec, _Tpnvec, scalartype, func, vectorfunc, suffix) \ inline scalartype v_reduce_##func(const _Tpvec& a) \ { \ @@ -960,10 +1299,8 @@ inline scalartype v_reduce_##func(const _Tpvec& a) \ return (scalartype)vget_lane_##suffix(vp##vectorfunc##_##suffix(a0, a0),0); \ } -OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, unsigned short, sum, add, u16) -OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, unsigned short, max, max, u16) -OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, unsigned short, min, min, u16) -OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_int16x8, int16x4, short, sum, add, s16) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, ushort, max, max, u16) +OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_uint16x8, uint16x4, ushort, min, min, u16) OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_int16x8, int16x4, short, max, max, s16) OPENCV_HAL_IMPL_NEON_REDUCE_OP_8(v_int16x8, int16x4, short, min, min, s16) @@ -984,10 +1321,14 @@ OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, sum, add, f32) OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, max, max, f32) OPENCV_HAL_IMPL_NEON_REDUCE_OP_4(v_float32x4, float32x2, float, min, min, f32) +inline uint64 v_reduce_sum(const v_uint64x2& a) +{ return vget_lane_u64(vadd_u64(vget_low_u64(a.val), vget_high_u64(a.val)),0); } +inline int64 v_reduce_sum(const v_int64x2& a) +{ return vget_lane_s64(vadd_s64(vget_low_s64(a.val), vget_high_s64(a.val)),0); } #if CV_SIMD128_64F inline double v_reduce_sum(const v_float64x2& a) { - return vgetq_lane_f64(a.val, 0) + vgetq_lane_f64(a.val, 1); + return vaddvq_f64(a.val); } #endif @@ -1049,21 +1390,22 @@ inline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b) return vget_lane_f32(vpadd_f32(t1, t1), 0); } -#define OPENCV_HAL_IMPL_NEON_POPCOUNT(_Tpvec, cast) \ -inline v_uint32x4 v_popcount(const _Tpvec& a) \ -{ \ - uint8x16_t t = vcntq_u8(cast(a.val)); \ - uint16x8_t t0 = vpaddlq_u8(t); /* 16 -> 8 */ \ - uint32x4_t t1 = vpaddlq_u16(t0); /* 8 -> 4 */ \ - return v_uint32x4(t1); \ -} - -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_uint8x16, OPENCV_HAL_NOP) -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_uint16x8, vreinterpretq_u8_u16) -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_uint32x4, vreinterpretq_u8_u32) -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_int8x16, vreinterpretq_u8_s8) -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_int16x8, vreinterpretq_u8_s16) -OPENCV_HAL_IMPL_NEON_POPCOUNT(v_int32x4, vreinterpretq_u8_s32) +inline v_uint8x16 v_popcount(const v_uint8x16& a) +{ return v_uint8x16(vcntq_u8(a.val)); } +inline v_uint8x16 v_popcount(const v_int8x16& a) +{ return v_uint8x16(vcntq_u8(vreinterpretq_u8_s8(a.val))); } +inline v_uint16x8 v_popcount(const v_uint16x8& a) +{ return v_uint16x8(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u16(a.val)))); } +inline v_uint16x8 v_popcount(const v_int16x8& a) +{ return v_uint16x8(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s16(a.val)))); } +inline v_uint32x4 v_popcount(const v_uint32x4& a) +{ return v_uint32x4(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u32(a.val))))); } +inline v_uint32x4 v_popcount(const v_int32x4& a) +{ return v_uint32x4(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s32(a.val))))); } +inline v_uint64x2 v_popcount(const v_uint64x2& a) +{ return v_uint64x2(vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_u64(a.val)))))); } +inline v_uint64x2 v_popcount(const v_int64x2& a) +{ return v_uint64x2(vpaddlq_u32(vpaddlq_u16(vpaddlq_u8(vcntq_u8(vreinterpretq_u8_s64(a.val)))))); } inline int v_signmask(const v_uint8x16& a) { @@ -1096,17 +1438,32 @@ inline int v_signmask(const v_int32x4& a) { return v_signmask(v_reinterpret_as_u32(a)); } inline int v_signmask(const v_float32x4& a) { return v_signmask(v_reinterpret_as_u32(a)); } -#if CV_SIMD128_64F inline int v_signmask(const v_uint64x2& a) { int64x1_t m0 = vdup_n_s64(0); uint64x2_t v0 = vshlq_u64(vshrq_n_u64(a.val, 63), vcombine_s64(m0, m0)); return (int)vgetq_lane_u64(v0, 0) + ((int)vgetq_lane_u64(v0, 1) << 1); } +inline int v_signmask(const v_int64x2& a) +{ return v_signmask(v_reinterpret_as_u64(a)); } +#if CV_SIMD128_64F inline int v_signmask(const v_float64x2& a) { return v_signmask(v_reinterpret_as_u64(a)); } #endif +inline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); } +#if CV_SIMD128_64F +inline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); } +#endif + #define OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(_Tpvec, suffix, shift) \ inline bool v_check_all(const v_##_Tpvec& a) \ { \ @@ -1124,9 +1481,17 @@ inline bool v_check_any(const v_##_Tpvec& a) \ OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint8x16, u8, 7) OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint16x8, u16, 15) OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint32x4, u32, 31) -#if CV_SIMD128_64F -OPENCV_HAL_IMPL_NEON_CHECK_ALLANY(uint64x2, u64, 63) -#endif + +inline bool v_check_all(const v_uint64x2& a) +{ + uint64x2_t v0 = vshrq_n_u64(a.val, 63); + return (vgetq_lane_u64(v0, 0) & vgetq_lane_u64(v0, 1)) == 1; +} +inline bool v_check_any(const v_uint64x2& a) +{ + uint64x2_t v0 = vshrq_n_u64(a.val, 63); + return (vgetq_lane_u64(v0, 0) | vgetq_lane_u64(v0, 1)) != 0; +} inline bool v_check_all(const v_int8x16& a) { return v_check_all(v_reinterpret_as_u8(a)); } @@ -1146,13 +1511,13 @@ inline bool v_check_any(const v_int32x4& a) inline bool v_check_any(const v_float32x4& a) { return v_check_any(v_reinterpret_as_u32(a)); } -#if CV_SIMD128_64F inline bool v_check_all(const v_int64x2& a) { return v_check_all(v_reinterpret_as_u64(a)); } -inline bool v_check_all(const v_float64x2& a) -{ return v_check_all(v_reinterpret_as_u64(a)); } inline bool v_check_any(const v_int64x2& a) { return v_check_any(v_reinterpret_as_u64(a)); } +#if CV_SIMD128_64F +inline bool v_check_all(const v_float64x2& a) +{ return v_check_all(v_reinterpret_as_u64(a)); } inline bool v_check_any(const v_float64x2& a) { return v_check_any(v_reinterpret_as_u64(a)); } #endif @@ -1174,6 +1539,26 @@ OPENCV_HAL_IMPL_NEON_SELECT(v_float32x4, f32, u32) OPENCV_HAL_IMPL_NEON_SELECT(v_float64x2, f64, u64) #endif +#if CV_NEON_AARCH64 +#define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \ +inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ +{ \ + b0.val = vmovl_##suffix(vget_low_##suffix(a.val)); \ + b1.val = vmovl_high_##suffix(a.val); \ +} \ +inline _Tpwvec v_expand_low(const _Tpvec& a) \ +{ \ + return _Tpwvec(vmovl_##suffix(vget_low_##suffix(a.val))); \ +} \ +inline _Tpwvec v_expand_high(const _Tpvec& a) \ +{ \ + return _Tpwvec(vmovl_high_##suffix(a.val)); \ +} \ +inline _Tpwvec v_load_expand(const _Tp* ptr) \ +{ \ + return _Tpwvec(vmovl_##suffix(vld1_##suffix(ptr))); \ +} +#else #define OPENCV_HAL_IMPL_NEON_EXPAND(_Tpvec, _Tpwvec, _Tp, suffix) \ inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ { \ @@ -1192,6 +1577,7 @@ inline _Tpwvec v_load_expand(const _Tp* ptr) \ { \ return _Tpwvec(vmovl_##suffix(vld1_##suffix(ptr))); \ } +#endif OPENCV_HAL_IMPL_NEON_EXPAND(v_uint8x16, v_uint16x8, uchar, u8) OPENCV_HAL_IMPL_NEON_EXPAND(v_int8x16, v_int16x8, schar, s8) @@ -1216,7 +1602,7 @@ inline v_int32x4 v_load_expand_q(const schar* ptr) return v_int32x4(vmovl_s16(v1)); } -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(_M_ARM64) #define OPENCV_HAL_IMPL_NEON_UNPACKS(_Tpvec, suffix) \ inline void v_zip(const v_##_Tpvec& a0, const v_##_Tpvec& a1, v_##_Tpvec& b0, v_##_Tpvec& b1) \ { \ @@ -1270,6 +1656,52 @@ OPENCV_HAL_IMPL_NEON_UNPACKS(float32x4, f32) OPENCV_HAL_IMPL_NEON_UNPACKS(float64x2, f64) #endif +inline v_uint8x16 v_reverse(const v_uint8x16 &a) +{ + uint8x16_t vec = vrev64q_u8(a.val); + return v_uint8x16(vextq_u8(vec, vec, 8)); +} + +inline v_int8x16 v_reverse(const v_int8x16 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x8 v_reverse(const v_uint16x8 &a) +{ + uint16x8_t vec = vrev64q_u16(a.val); + return v_uint16x8(vextq_u16(vec, vec, 4)); +} + +inline v_int16x8 v_reverse(const v_int16x8 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x4 v_reverse(const v_uint32x4 &a) +{ + uint32x4_t vec = vrev64q_u32(a.val); + return v_uint32x4(vextq_u32(vec, vec, 2)); +} + +inline v_int32x4 v_reverse(const v_int32x4 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x4 v_reverse(const v_float32x4 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x2 v_reverse(const v_uint64x2 &a) +{ + uint64x2_t vec = a.val; + uint64x1_t vec_lo = vget_low_u64(vec); + uint64x1_t vec_hi = vget_high_u64(vec); + return v_uint64x2(vcombine_u64(vec_hi, vec_lo)); +} + +inline v_int64x2 v_reverse(const v_int64x2 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +#if CV_SIMD128_64F +inline v_float64x2 v_reverse(const v_float64x2 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } +#endif + #define OPENCV_HAL_IMPL_NEON_EXTRACT(_Tpvec, suffix) \ template \ inline v_##_Tpvec v_extract(const v_##_Tpvec& a, const v_##_Tpvec& b) \ @@ -1290,6 +1722,38 @@ OPENCV_HAL_IMPL_NEON_EXTRACT(float32x4, f32) OPENCV_HAL_IMPL_NEON_EXTRACT(float64x2, f64) #endif +#define OPENCV_HAL_IMPL_NEON_EXTRACT_N(_Tpvec, _Tp, suffix) \ +template inline _Tp v_extract_n(_Tpvec v) { return vgetq_lane_##suffix(v.val, i); } + +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int16x8, short, s16) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint32x4, uint, u32) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int32x4, int, s32) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_float32x4, float, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_EXTRACT_N(v_float64x2, double, f64) +#endif + +#define OPENCV_HAL_IMPL_NEON_BROADCAST(_Tpvec, _Tp, suffix) \ +template inline _Tpvec v_broadcast_element(_Tpvec v) { _Tp t = v_extract_n(v); return v_setall_##suffix(t); } + +OPENCV_HAL_IMPL_NEON_BROADCAST(v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_int8x16, schar, s8) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_int16x8, short, s16) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_uint32x4, uint, u32) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_int32x4, int, s32) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_int64x2, int64, s64) +OPENCV_HAL_IMPL_NEON_BROADCAST(v_float32x4, float, f32) +#if CV_SIMD128_64F +OPENCV_HAL_IMPL_NEON_BROADCAST(v_float64x2, double, f64) +#endif + #if CV_SIMD128_64F inline v_int32x4 v_round(const v_float32x4& a) { @@ -1570,6 +2034,10 @@ inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) { return v_float64x2(vcvt_f64_f32(vget_high_f32(a.val))); } + +inline v_float64x2 v_cvt_f64(const v_int64x2& a) +{ return v_float64x2(vcvtq_f64_s64(a.val)); } + #endif ////////////// Lookup table access //////////////////// @@ -1732,10 +2200,12 @@ inline v_float32x4 v_lut(const float* tab, const int* idx) } inline v_float32x4 v_lut_pairs(const float* tab, const int* idx) { + typedef uint64 CV_DECL_ALIGNED(1) unaligned_uint64; + uint64 CV_DECL_ALIGNED(32) elems[2] = { - *(uint64*)(tab + idx[0]), - *(uint64*)(tab + idx[1]) + *(unaligned_uint64*)(tab + idx[0]), + *(unaligned_uint64*)(tab + idx[1]) }; return v_float32x4(vreinterpretq_f32_u64(vld1q_u64(elems))); } @@ -1924,16 +2394,6 @@ inline void v_pack_store(float16_t* ptr, const v_float32x4& v) inline void v_cleanup() {} -//! @name Check SIMD support -//! @{ -//! @brief Check CPU capability of SIMD operation -static inline bool hasSIMD128() -{ - return (CV_CPU_HAS_SUPPORT_NEON) ? true : false; -} - -//! @} - CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END //! @endcond diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_sse.hpp similarity index 85% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_sse.hpp index a5adad0..f4b43a2 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_sse.hpp @@ -57,6 +57,14 @@ namespace cv //! @cond IGNORED +// +// Compilation troubleshooting: +// - MSVC: error C2719: 'a': formal parameter with requested alignment of 16 won't be aligned +// Replace parameter declaration to const reference: +// -v_int32x4 a +// +const v_int32x4& a +// + CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN ///////// Types //////////// @@ -67,7 +75,8 @@ struct v_uint8x16 typedef __m128i vector_type; enum { nlanes = 16 }; - v_uint8x16() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint8x16() {} explicit v_uint8x16(__m128i v) : val(v) {} v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) @@ -77,6 +86,7 @@ struct v_uint8x16 (char)v8, (char)v9, (char)v10, (char)v11, (char)v12, (char)v13, (char)v14, (char)v15); } + uchar get0() const { return (uchar)_mm_cvtsi128_si32(val); @@ -91,7 +101,8 @@ struct v_int8x16 typedef __m128i vector_type; enum { nlanes = 16 }; - v_int8x16() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int8x16() {} explicit v_int8x16(__m128i v) : val(v) {} v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7, schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) @@ -101,6 +112,7 @@ struct v_int8x16 (char)v8, (char)v9, (char)v10, (char)v11, (char)v12, (char)v13, (char)v14, (char)v15); } + schar get0() const { return (schar)_mm_cvtsi128_si32(val); @@ -115,13 +127,15 @@ struct v_uint16x8 typedef __m128i vector_type; enum { nlanes = 8 }; - v_uint16x8() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint16x8() {} explicit v_uint16x8(__m128i v) : val(v) {} v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) { val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3, (short)v4, (short)v5, (short)v6, (short)v7); } + ushort get0() const { return (ushort)_mm_cvtsi128_si32(val); @@ -136,13 +150,15 @@ struct v_int16x8 typedef __m128i vector_type; enum { nlanes = 8 }; - v_int16x8() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int16x8() {} explicit v_int16x8(__m128i v) : val(v) {} v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) { val = _mm_setr_epi16((short)v0, (short)v1, (short)v2, (short)v3, (short)v4, (short)v5, (short)v6, (short)v7); } + short get0() const { return (short)_mm_cvtsi128_si32(val); @@ -157,12 +173,14 @@ struct v_uint32x4 typedef __m128i vector_type; enum { nlanes = 4 }; - v_uint32x4() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint32x4() {} explicit v_uint32x4(__m128i v) : val(v) {} v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) { val = _mm_setr_epi32((int)v0, (int)v1, (int)v2, (int)v3); } + unsigned get0() const { return (unsigned)_mm_cvtsi128_si32(val); @@ -177,12 +195,14 @@ struct v_int32x4 typedef __m128i vector_type; enum { nlanes = 4 }; - v_int32x4() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int32x4() {} explicit v_int32x4(__m128i v) : val(v) {} v_int32x4(int v0, int v1, int v2, int v3) { val = _mm_setr_epi32(v0, v1, v2, v3); } + int get0() const { return _mm_cvtsi128_si32(val); @@ -197,12 +217,14 @@ struct v_float32x4 typedef __m128 vector_type; enum { nlanes = 4 }; - v_float32x4() : val(_mm_setzero_ps()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_float32x4() {} explicit v_float32x4(__m128 v) : val(v) {} v_float32x4(float v0, float v1, float v2, float v3) { val = _mm_setr_ps(v0, v1, v2, v3); } + float get0() const { return _mm_cvtss_f32(val); @@ -217,17 +239,23 @@ struct v_uint64x2 typedef __m128i vector_type; enum { nlanes = 2 }; - v_uint64x2() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_uint64x2() {} explicit v_uint64x2(__m128i v) : val(v) {} v_uint64x2(uint64 v0, uint64 v1) { val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32)); } + uint64 get0() const { + #if !defined(__x86_64__) && !defined(_M_X64) int a = _mm_cvtsi128_si32(val); int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32)); return (unsigned)a | ((uint64)(unsigned)b << 32); + #else + return (uint64)_mm_cvtsi128_si64(val); + #endif } __m128i val; @@ -239,17 +267,23 @@ struct v_int64x2 typedef __m128i vector_type; enum { nlanes = 2 }; - v_int64x2() : val(_mm_setzero_si128()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_int64x2() {} explicit v_int64x2(__m128i v) : val(v) {} v_int64x2(int64 v0, int64 v1) { val = _mm_setr_epi32((int)v0, (int)(v0 >> 32), (int)v1, (int)(v1 >> 32)); } + int64 get0() const { + #if !defined(__x86_64__) && !defined(_M_X64) int a = _mm_cvtsi128_si32(val); int b = _mm_cvtsi128_si32(_mm_srli_epi64(val, 32)); return (int64)((unsigned)a | ((uint64)(unsigned)b << 32)); + #else + return _mm_cvtsi128_si64(val); + #endif } __m128i val; @@ -261,12 +295,14 @@ struct v_float64x2 typedef __m128d vector_type; enum { nlanes = 2 }; - v_float64x2() : val(_mm_setzero_pd()) {} + /* coverity[uninit_ctor]: suppress warning */ + v_float64x2() {} explicit v_float64x2(__m128d v) : val(v) {} v_float64x2(double v0, double v1) { val = _mm_setr_pd(v0, v1); } + double get0() const { return _mm_cvtsd_f64(val); @@ -302,8 +338,8 @@ inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(_mm_set1_##ssuffix((_Tps) template inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \ { return _Tpvec(cast(a.val)); } -OPENCV_HAL_IMPL_SSE_INITVEC(v_uint8x16, uchar, u8, si128, epi8, char, OPENCV_HAL_NOP) -OPENCV_HAL_IMPL_SSE_INITVEC(v_int8x16, schar, s8, si128, epi8, char, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_uint8x16, uchar, u8, si128, epi8, schar, OPENCV_HAL_NOP) +OPENCV_HAL_IMPL_SSE_INITVEC(v_int8x16, schar, s8, si128, epi8, schar, OPENCV_HAL_NOP) OPENCV_HAL_IMPL_SSE_INITVEC(v_uint16x8, ushort, u16, si128, epi16, short, OPENCV_HAL_NOP) OPENCV_HAL_IMPL_SSE_INITVEC(v_int16x8, short, s16, si128, epi16, short, OPENCV_HAL_NOP) OPENCV_HAL_IMPL_SSE_INITVEC(v_uint32x4, unsigned, u32, si128, epi32, int, OPENCV_HAL_NOP) @@ -791,15 +827,195 @@ inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, inline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b) { return v_int16x8(_mm_mulhi_epi16(a.val, b.val)); } inline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b) { return v_uint16x8(_mm_mulhi_epu16(a.val, b.val)); } -inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) -{ - return v_int32x4(_mm_madd_epi16(a.val, b.val)); -} +//////// Dot Product //////// +// 16 >> 32 +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) +{ return v_int32x4(_mm_madd_epi16(a.val, b.val)); } inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_dotprod(a, b) + c; } + +// 32 >> 64 +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b) { - return v_int32x4(_mm_add_epi32(_mm_madd_epi16(a.val, b.val), c.val)); +#if CV_SSE4_1 + __m128i even = _mm_mul_epi32(a.val, b.val); + __m128i odd = _mm_mul_epi32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32)); + return v_int64x2(_mm_add_epi64(even, odd)); +#else + __m128i even_u = _mm_mul_epu32(a.val, b.val); + __m128i odd_u = _mm_mul_epu32(_mm_srli_epi64(a.val, 32), _mm_srli_epi64(b.val, 32)); + // convert unsigned to signed high multiplication (from: Agner Fog(veclib) and H S Warren: Hacker's delight, 2003, p. 132) + __m128i a_sign = _mm_srai_epi32(a.val, 31); + __m128i b_sign = _mm_srai_epi32(b.val, 31); + // |x * sign of x + __m128i axb = _mm_and_si128(a.val, b_sign); + __m128i bxa = _mm_and_si128(b.val, a_sign); + // sum of sign corrections + __m128i ssum = _mm_add_epi32(bxa, axb); + __m128i even_ssum = _mm_slli_epi64(ssum, 32); + __m128i odd_ssum = _mm_and_si128(ssum, _mm_set_epi32(-1, 0, -1, 0)); + // convert to signed and prod + return v_int64x2(_mm_add_epi64(_mm_sub_epi64(even_u, even_ssum), _mm_sub_epi64(odd_u, odd_ssum))); +#endif } +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod(a, b) + c; } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b) +{ + __m128i a0 = _mm_srli_epi16(_mm_slli_si128(a.val, 1), 8); // even + __m128i a1 = _mm_srli_epi16(a.val, 8); // odd + __m128i b0 = _mm_srli_epi16(_mm_slli_si128(b.val, 1), 8); + __m128i b1 = _mm_srli_epi16(b.val, 8); + __m128i p0 = _mm_madd_epi16(a0, b0); + __m128i p1 = _mm_madd_epi16(a1, b1); + return v_uint32x4(_mm_add_epi32(p0, p1)); +} +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b) +{ + __m128i a0 = _mm_srai_epi16(_mm_slli_si128(a.val, 1), 8); // even + __m128i a1 = _mm_srai_epi16(a.val, 8); // odd + __m128i b0 = _mm_srai_epi16(_mm_slli_si128(b.val, 1), 8); + __m128i b1 = _mm_srai_epi16(b.val, 8); + __m128i p0 = _mm_madd_epi16(a0, b0); + __m128i p1 = _mm_madd_epi16(a1, b1); + return v_int32x4(_mm_add_epi32(p0, p1)); +} +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand(a, b) + c; } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b) +{ + v_uint32x4 c, d; + v_mul_expand(a, b, c, d); + + v_uint64x2 c0, c1, d0, d1; + v_expand(c, c0, c1); + v_expand(d, d0, d1); + + c0 += c1; d0 += d1; + return v_uint64x2(_mm_add_epi64( + _mm_unpacklo_epi64(c0.val, d0.val), + _mm_unpackhi_epi64(c0.val, d0.val) + )); +} +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b) +{ + v_int32x4 prod = v_dotprod(a, b); + v_int64x2 c, d; + v_expand(prod, c, d); + return v_int64x2(_mm_add_epi64( + _mm_unpacklo_epi64(c.val, d.val), + _mm_unpackhi_epi64(c.val, d.val) + )); +} +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b) +{ +#if CV_SSE4_1 + return v_cvt_f64(v_dotprod(a, b)); +#else + v_float64x2 c = v_cvt_f64(a) * v_cvt_f64(b); + v_float64x2 d = v_cvt_f64_high(a) * v_cvt_f64_high(b); + + return v_float64x2(_mm_add_pd( + _mm_unpacklo_pd(c.val, d.val), + _mm_unpackhi_pd(c.val, d.val) + )); +#endif +} +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod(a, b); } +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_dotprod(a, b) + c; } + +// 32 >> 64 +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod(a, b); } +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod_fast(a, b) + c; } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) +{ + __m128i a0 = v_expand_low(a).val; + __m128i a1 = v_expand_high(a).val; + __m128i b0 = v_expand_low(b).val; + __m128i b1 = v_expand_high(b).val; + __m128i p0 = _mm_madd_epi16(a0, b0); + __m128i p1 = _mm_madd_epi16(a1, b1); + return v_uint32x4(_mm_add_epi32(p0, p1)); +} +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) +{ +#if CV_SSE4_1 + __m128i a0 = _mm_cvtepi8_epi16(a.val); + __m128i a1 = v_expand_high(a).val; + __m128i b0 = _mm_cvtepi8_epi16(b.val); + __m128i b1 = v_expand_high(b).val; + __m128i p0 = _mm_madd_epi16(a0, b0); + __m128i p1 = _mm_madd_epi16(a1, b1); + return v_int32x4(_mm_add_epi32(p0, p1)); +#else + return v_dotprod_expand(a, b); +#endif +} +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b) +{ + v_uint32x4 c, d; + v_mul_expand(a, b, c, d); + + v_uint64x2 c0, c1, d0, d1; + v_expand(c, c0, c1); + v_expand(d, d0, d1); + + c0 += c1; d0 += d1; + return c0 + d0; +} +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b) +{ + v_int32x4 prod = v_dotprod(a, b); + v_int64x2 c, d; + v_expand(prod, c, d); + return c + d; +} +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 32 >> 64f +v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c); +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_cvt_f64_high(a) * v_cvt_f64_high(b)); } +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_fma(v_cvt_f64(a), v_cvt_f64(b), v_fma(v_cvt_f64_high(a), v_cvt_f64_high(b), c)); } #define OPENCV_HAL_IMPL_SSE_LOGIC_OP(_Tpvec, suffix, not_const) \ OPENCV_HAL_IMPL_SSE_BIN_OP(&, _Tpvec, _mm_and_##suffix) \ @@ -1032,14 +1248,23 @@ inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \ OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float32x4, ps) OPENCV_HAL_IMPL_SSE_FLT_CMP_OP(v_float64x2, pd) -#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec, cast) \ +#if CV_SSE4_1 +#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec) \ inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ -{ return cast(v_reinterpret_as_f64(a) == v_reinterpret_as_f64(b)); } \ +{ return _Tpvec(_mm_cmpeq_epi64(a.val, b.val)); } \ inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ -{ return cast(v_reinterpret_as_f64(a) != v_reinterpret_as_f64(b)); } +{ return ~(a == b); } +#else +#define OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(_Tpvec) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ __m128i cmp = _mm_cmpeq_epi32(a.val, b.val); \ + return _Tpvec(_mm_and_si128(cmp, _mm_shuffle_epi32(cmp, _MM_SHUFFLE(2, 3, 0, 1)))); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return ~(a == b); } +#endif -OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_uint64x2, v_reinterpret_as_u64) -OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_int64x2, v_reinterpret_as_s64) +OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_uint64x2) +OPENCV_HAL_IMPL_SSE_64BIT_CMP_OP(v_int64x2) inline v_float32x4 v_not_nan(const v_float32x4& a) { return v_float32x4(_mm_cmpord_ps(a.val, a.val)); } @@ -1393,6 +1618,41 @@ inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float32x4, float, ps) OPENCV_HAL_IMPL_SSE_LOADSTORE_FLT_OP(v_float64x2, double, pd) +inline unsigned v_reduce_sum(const v_uint8x16& a) +{ + __m128i half = _mm_sad_epu8(a.val, _mm_setzero_si128()); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half))); +} +inline int v_reduce_sum(const v_int8x16& a) +{ + __m128i half = _mm_set1_epi8((schar)-128); + half = _mm_sad_epu8(_mm_xor_si128(a.val, half), _mm_setzero_si128()); + return _mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half))) - 2048; +} +#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_16(func) \ +inline schar v_reduce_##func(const v_int8x16& a) \ +{ \ + __m128i val = a.val; \ + __m128i smask = _mm_set1_epi8((schar)-128); \ + val = _mm_xor_si128(val, smask); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,8)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,4)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,2)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,1)); \ + return (schar)_mm_cvtsi128_si32(val) ^ (schar)-128; \ +} \ +inline uchar v_reduce_##func(const v_uint8x16& a) \ +{ \ + __m128i val = a.val; \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,8)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,4)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,2)); \ + val = _mm_##func##_epu8(val, _mm_srli_si128(val,1)); \ + return (uchar)_mm_cvtsi128_si32(val); \ +} +OPENCV_HAL_IMPL_SSE_REDUCE_OP_16(max) +OPENCV_HAL_IMPL_SSE_REDUCE_OP_16(min) + #define OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(_Tpvec, scalartype, func, suffix, sbit) \ inline scalartype v_reduce_##func(const v_##_Tpvec& a) \ { \ @@ -1412,26 +1672,8 @@ inline unsigned scalartype v_reduce_##func(const v_u##_Tpvec& a) \ val = _mm_##func##_##suffix(val, _mm_srli_si128(val,2)); \ return (unsigned scalartype)(_mm_cvtsi128_si32(val) ^ sbit); \ } -#define OPENCV_HAL_IMPL_SSE_REDUCE_OP_8_SUM(_Tpvec, scalartype, suffix) \ -inline scalartype v_reduce_sum(const v_##_Tpvec& a) \ -{ \ - __m128i val = a.val; \ - val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 8)); \ - val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 4)); \ - val = _mm_adds_epi##suffix(val, _mm_srli_si128(val, 2)); \ - return (scalartype)_mm_cvtsi128_si32(val); \ -} \ -inline unsigned scalartype v_reduce_sum(const v_u##_Tpvec& a) \ -{ \ - __m128i val = a.val; \ - val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 8)); \ - val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 4)); \ - val = _mm_adds_epu##suffix(val, _mm_srli_si128(val, 2)); \ - return (unsigned scalartype)_mm_cvtsi128_si32(val); \ -} OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, max, epi16, (short)-32768) OPENCV_HAL_IMPL_SSE_REDUCE_OP_8(int16x8, short, min, epi16, (short)-32768) -OPENCV_HAL_IMPL_SSE_REDUCE_OP_8_SUM(int16x8, short, 16) #define OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(_Tpvec, scalartype, regtype, suffix, cast_from, cast_to, extract) \ inline scalartype v_reduce_sum(const _Tpvec& a) \ @@ -1456,6 +1698,23 @@ OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_uint32x4, unsigned, __m128i, epi32, OPENCV OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_int32x4, int, __m128i, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP, si128_si32) OPENCV_HAL_IMPL_SSE_REDUCE_OP_4_SUM(v_float32x4, float, __m128, ps, _mm_castps_si128, _mm_castsi128_ps, ss_f32) +inline int v_reduce_sum(const v_int16x8& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } +inline unsigned v_reduce_sum(const v_uint16x8& a) +{ return v_reduce_sum(v_expand_low(a) + v_expand_high(a)); } + +inline uint64 v_reduce_sum(const v_uint64x2& a) +{ + uint64 CV_DECL_ALIGNED(32) idx[2]; + v_store_aligned(idx, a); + return idx[0] + idx[1]; +} +inline int64 v_reduce_sum(const v_int64x2& a) +{ + int64 CV_DECL_ALIGNED(32) idx[2]; + v_store_aligned(idx, a); + return idx[0] + idx[1]; +} inline double v_reduce_sum(const v_float64x2& a) { double CV_DECL_ALIGNED(32) idx[2]; @@ -1486,13 +1745,14 @@ OPENCV_HAL_IMPL_SSE_REDUCE_OP_4(v_float32x4, float, min, std::min) inline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b) { - return (unsigned)_mm_cvtsi128_si32(_mm_sad_epu8(a.val, b.val)); + __m128i half = _mm_sad_epu8(a.val, b.val); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half))); } inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) { __m128i half = _mm_set1_epi8(0x7f); - return (unsigned)_mm_cvtsi128_si32(_mm_sad_epu8(_mm_add_epi8(a.val, half), - _mm_add_epi8(b.val, half))); + half = _mm_sad_epu8(_mm_add_epi8(a.val, half), _mm_add_epi8(b.val, half)); + return (unsigned)_mm_cvtsi128_si32(_mm_add_epi32(half, _mm_unpackhi_epi64(half, half))); } inline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b) { @@ -1519,53 +1779,73 @@ inline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b) return v_reduce_sum(v_absdiff(a, b)); } -#define OPENCV_HAL_IMPL_SSE_POPCOUNT(_Tpvec) \ -inline v_uint32x4 v_popcount(const _Tpvec& a) \ -{ \ - __m128i m1 = _mm_set1_epi32(0x55555555); \ - __m128i m2 = _mm_set1_epi32(0x33333333); \ - __m128i m4 = _mm_set1_epi32(0x0f0f0f0f); \ - __m128i p = a.val; \ - p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 1), m1), _mm_and_si128(p, m1)); \ - p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 2), m2), _mm_and_si128(p, m2)); \ - p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 4), m4), _mm_and_si128(p, m4)); \ - p = _mm_adds_epi8(p, _mm_srli_si128(p, 1)); \ - p = _mm_adds_epi8(p, _mm_srli_si128(p, 2)); \ - return v_uint32x4(_mm_and_si128(p, _mm_set1_epi32(0x000000ff))); \ -} - -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint8x16) -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint16x8) -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_uint32x4) -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int8x16) -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int16x8) -OPENCV_HAL_IMPL_SSE_POPCOUNT(v_int32x4) - -#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(_Tpvec, suffix, pack_op, and_op, signmask, allmask) \ -inline int v_signmask(const _Tpvec& a) \ -{ \ - return and_op(_mm_movemask_##suffix(pack_op(a.val)), signmask); \ -} \ -inline bool v_check_all(const _Tpvec& a) \ -{ return and_op(_mm_movemask_##suffix(a.val), allmask) == allmask; } \ -inline bool v_check_any(const _Tpvec& a) \ -{ return and_op(_mm_movemask_##suffix(a.val), allmask) != 0; } - -#define OPENCV_HAL_PACKS(a) _mm_packs_epi16(a, a) -inline __m128i v_packq_epi32(__m128i a) +inline v_uint8x16 v_popcount(const v_uint8x16& a) { - __m128i b = _mm_packs_epi32(a, a); - return _mm_packs_epi16(b, b); + __m128i m1 = _mm_set1_epi32(0x55555555); + __m128i m2 = _mm_set1_epi32(0x33333333); + __m128i m4 = _mm_set1_epi32(0x0f0f0f0f); + __m128i p = a.val; + p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 1), m1), _mm_and_si128(p, m1)); + p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 2), m2), _mm_and_si128(p, m2)); + p = _mm_add_epi32(_mm_and_si128(_mm_srli_epi32(p, 4), m4), _mm_and_si128(p, m4)); + return v_uint8x16(p); } +inline v_uint16x8 v_popcount(const v_uint16x8& a) +{ + v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + return v_reinterpret_as_u16(p) & v_setall_u16(0x00ff); +} +inline v_uint32x4 v_popcount(const v_uint32x4& a) +{ + v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + p += v_rotate_right<2>(p); + return v_reinterpret_as_u32(p) & v_setall_u32(0x000000ff); +} +inline v_uint64x2 v_popcount(const v_uint64x2& a) +{ + return v_uint64x2(_mm_sad_epu8(v_popcount(v_reinterpret_as_u8(a)).val, _mm_setzero_si128())); +} +inline v_uint8x16 v_popcount(const v_int8x16& a) +{ return v_popcount(v_reinterpret_as_u8(a)); } +inline v_uint16x8 v_popcount(const v_int16x8& a) +{ return v_popcount(v_reinterpret_as_u16(a)); } +inline v_uint32x4 v_popcount(const v_int32x4& a) +{ return v_popcount(v_reinterpret_as_u32(a)); } +inline v_uint64x2 v_popcount(const v_int64x2& a) +{ return v_popcount(v_reinterpret_as_u64(a)); } -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int8x16, epi8, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 65535, 65535) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255, (int)0xaaaa) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int16x8, epi8, OPENCV_HAL_PACKS, OPENCV_HAL_AND, 255, (int)0xaaaa) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15, (int)0x8888) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int32x4, epi8, v_packq_epi32, OPENCV_HAL_AND, 15, (int)0x8888) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float32x4, ps, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 15, 15) -OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float64x2, pd, OPENCV_HAL_NOP, OPENCV_HAL_1ST, 3, 3) +#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(_Tpvec, suffix, cast_op, allmask) \ +inline int v_signmask(const _Tpvec& a) { return _mm_movemask_##suffix(cast_op(a.val)); } \ +inline bool v_check_all(const _Tpvec& a) { return _mm_movemask_##suffix(cast_op(a.val)) == allmask; } \ +inline bool v_check_any(const _Tpvec& a) { return _mm_movemask_##suffix(cast_op(a.val)) != 0; } +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint8x16, epi8, OPENCV_HAL_NOP, 65535) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int8x16, epi8, OPENCV_HAL_NOP, 65535) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint32x4, ps, _mm_castsi128_ps, 15) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int32x4, ps, _mm_castsi128_ps, 15) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_uint64x2, pd, _mm_castsi128_pd, 3) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_int64x2, pd, _mm_castsi128_pd, 3) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float32x4, ps, OPENCV_HAL_NOP, 15) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS(v_float64x2, pd, OPENCV_HAL_NOP, 3) + +#define OPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(_Tpvec) \ +inline int v_signmask(const _Tpvec& a) { return _mm_movemask_epi8(_mm_packs_epi16(a.val, a.val)) & 255; } \ +inline bool v_check_all(const _Tpvec& a) { return (_mm_movemask_epi8(a.val) & 0xaaaa) == 0xaaaa; } \ +inline bool v_check_any(const _Tpvec& a) { return (_mm_movemask_epi8(a.val) & 0xaaaa) != 0; } +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(v_uint16x8) +OPENCV_HAL_IMPL_SSE_CHECK_SIGNS_SHORT(v_int16x8) + +inline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } #if CV_SSE4_1 #define OPENCV_HAL_IMPL_SSE_SELECT(_Tpvec, cast_ret, cast, suffix) \ @@ -1671,6 +1951,59 @@ OPENCV_HAL_IMPL_SSE_UNPACKS(v_int32x4, epi32, OPENCV_HAL_NOP, OPENCV_HAL_NOP) OPENCV_HAL_IMPL_SSE_UNPACKS(v_float32x4, ps, _mm_castps_si128, _mm_castsi128_ps) OPENCV_HAL_IMPL_SSE_UNPACKS(v_float64x2, pd, _mm_castpd_si128, _mm_castsi128_pd) +inline v_uint8x16 v_reverse(const v_uint8x16 &a) +{ +#if CV_SSSE3 + static const __m128i perm = _mm_setr_epi8(15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); + return v_uint8x16(_mm_shuffle_epi8(a.val, perm)); +#else + uchar CV_DECL_ALIGNED(32) d[16]; + v_store_aligned(d, a); + return v_uint8x16(d[15], d[14], d[13], d[12], d[11], d[10], d[9], d[8], d[7], d[6], d[5], d[4], d[3], d[2], d[1], d[0]); +#endif +} + +inline v_int8x16 v_reverse(const v_int8x16 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x8 v_reverse(const v_uint16x8 &a) +{ +#if CV_SSSE3 + static const __m128i perm = _mm_setr_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1); + return v_uint16x8(_mm_shuffle_epi8(a.val, perm)); +#else + __m128i r = _mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 1, 2, 3)); + r = _mm_shufflelo_epi16(r, _MM_SHUFFLE(2, 3, 0, 1)); + r = _mm_shufflehi_epi16(r, _MM_SHUFFLE(2, 3, 0, 1)); + return v_uint16x8(r); +#endif +} + +inline v_int16x8 v_reverse(const v_int16x8 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x4 v_reverse(const v_uint32x4 &a) +{ + return v_uint32x4(_mm_shuffle_epi32(a.val, _MM_SHUFFLE(0, 1, 2, 3))); +} + +inline v_int32x4 v_reverse(const v_int32x4 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x4 v_reverse(const v_float32x4 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x2 v_reverse(const v_uint64x2 &a) +{ + return v_uint64x2(_mm_shuffle_epi32(a.val, _MM_SHUFFLE(1, 0, 3, 2))); +} + +inline v_int64x2 v_reverse(const v_int64x2 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x2 v_reverse(const v_float64x2 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + template inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) { @@ -2684,18 +3017,31 @@ inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) return v_float64x2(_mm_cvtps_pd(_mm_movehl_ps(a.val, a.val))); } -#if CV_FP16 -inline v_float32x4 v128_load_fp16_f32(const short* ptr) +// from (Mysticial and wim) https://stackoverflow.com/q/41144668 +inline v_float64x2 v_cvt_f64(const v_int64x2& v) { - return v_float32x4(_mm_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr))); -} - -inline void v_store_fp16(short* ptr, const v_float32x4& a) -{ - __m128i fp16_value = _mm_cvtps_ph(a.val, 0); - _mm_storel_epi64((__m128i*)ptr, fp16_value); -} + // constants encoded as floating-point + __m128i magic_i_hi32 = _mm_set1_epi64x(0x4530000080000000); // 2^84 + 2^63 + __m128i magic_i_all = _mm_set1_epi64x(0x4530000080100000); // 2^84 + 2^63 + 2^52 + __m128d magic_d_all = _mm_castsi128_pd(magic_i_all); + // Blend the 32 lowest significant bits of v with magic_int_lo +#if CV_SSE4_1 + __m128i magic_i_lo = _mm_set1_epi64x(0x4330000000000000); // 2^52 + __m128i v_lo = _mm_blend_epi16(v.val, magic_i_lo, 0xcc); +#else + __m128i magic_i_lo = _mm_set1_epi32(0x43300000); // 2^52 + __m128i v_lo = _mm_unpacklo_epi32(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(0, 0, 2, 0)), magic_i_lo); #endif + // Extract the 32 most significant bits of v + __m128i v_hi = _mm_srli_epi64(v.val, 32); + // Flip the msb of v_hi and blend with 0x45300000 + v_hi = _mm_xor_si128(v_hi, magic_i_hi32); + // Compute in double precision + __m128d v_hi_dbl = _mm_sub_pd(_mm_castsi128_pd(v_hi), magic_d_all); + // (v_hi - magic_d_all) + v_lo Do not assume associativity of floating point addition + __m128d result = _mm_add_pd(v_hi_dbl, _mm_castsi128_pd(v_lo)); + return v_float64x2(result); +} ////////////// Lookup table access //////////////////// @@ -2952,10 +3298,107 @@ inline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; } inline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; } inline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; } +template +inline uchar v_extract_n(const v_uint8x16& v) +{ +#if CV_SSE4_1 + return (uchar)_mm_extract_epi8(v.val, i); +#else + return v_rotate_right(v).get0(); +#endif +} + +template +inline schar v_extract_n(const v_int8x16& v) +{ + return (schar)v_extract_n(v_reinterpret_as_u8(v)); +} + +template +inline ushort v_extract_n(const v_uint16x8& v) +{ + return (ushort)_mm_extract_epi16(v.val, i); +} + +template +inline short v_extract_n(const v_int16x8& v) +{ + return (short)v_extract_n(v_reinterpret_as_u16(v)); +} + +template +inline uint v_extract_n(const v_uint32x4& v) +{ +#if CV_SSE4_1 + return (uint)_mm_extract_epi32(v.val, i); +#else + return v_rotate_right(v).get0(); +#endif +} + +template +inline int v_extract_n(const v_int32x4& v) +{ + return (int)v_extract_n(v_reinterpret_as_u32(v)); +} + +template +inline uint64 v_extract_n(const v_uint64x2& v) +{ +#ifdef CV__SIMD_NATIVE_mm_extract_epi64 + return (uint64)_v128_extract_epi64(v.val); +#else + return v_rotate_right(v).get0(); +#endif +} + +template +inline int64 v_extract_n(const v_int64x2& v) +{ + return (int64)v_extract_n(v_reinterpret_as_u64(v)); +} + +template +inline float v_extract_n(const v_float32x4& v) +{ + union { uint iv; float fv; } d; + d.iv = v_extract_n(v_reinterpret_as_u32(v)); + return d.fv; +} + +template +inline double v_extract_n(const v_float64x2& v) +{ + union { uint64 iv; double dv; } d; + d.iv = v_extract_n(v_reinterpret_as_u64(v)); + return d.dv; +} + +template +inline v_int32x4 v_broadcast_element(const v_int32x4& v) +{ + return v_int32x4(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(i,i,i,i))); +} + +template +inline v_uint32x4 v_broadcast_element(const v_uint32x4& v) +{ + return v_uint32x4(_mm_shuffle_epi32(v.val, _MM_SHUFFLE(i,i,i,i))); +} + +template +inline v_float32x4 v_broadcast_element(const v_float32x4& v) +{ + return v_float32x4(_mm_shuffle_ps(v.val, v.val, _MM_SHUFFLE((char)i,(char)i,(char)i,(char)i))); +} + ////////////// FP16 support /////////////////////////// inline v_float32x4 v_load_expand(const float16_t* ptr) { +#if CV_FP16 + return v_float32x4(_mm_cvtph_ps(_mm_loadu_si128((const __m128i*)ptr))); +#else const __m128i z = _mm_setzero_si128(), delta = _mm_set1_epi32(0x38000000); const __m128i signmask = _mm_set1_epi32(0x80000000), maxexp = _mm_set1_epi32(0x7c000000); const __m128 deltaf = _mm_castsi128_ps(_mm_set1_epi32(0x38800000)); @@ -2968,10 +3411,15 @@ inline v_float32x4 v_load_expand(const float16_t* ptr) __m128i zmask = _mm_cmpeq_epi32(e, z); __m128i ft = v_select_si128(zmask, zt, t); return v_float32x4(_mm_castsi128_ps(_mm_or_si128(ft, sign))); +#endif } inline void v_pack_store(float16_t* ptr, const v_float32x4& v) { +#if CV_FP16 + __m128i fp16_value = _mm_cvtps_ph(v.val, 0); + _mm_storel_epi64((__m128i*)ptr, fp16_value); +#else const __m128i signmask = _mm_set1_epi32(0x80000000); const __m128i rval = _mm_set1_epi32(0x3f000000); @@ -2993,20 +3441,11 @@ inline void v_pack_store(float16_t* ptr, const v_float32x4& v) t = _mm_or_si128(t, sign); t = _mm_packs_epi32(t, t); _mm_storel_epi64((__m128i*)ptr, t); +#endif } inline void v_cleanup() {} -//! @name Check SIMD support -//! @{ -//! @brief Check CPU capability of SIMD operation -static inline bool hasSIMD128() -{ - return (CV_CPU_HAS_SUPPORT_SSE2) ? true : false; -} - -//! @} - CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END //! @endcond diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse_em.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_sse_em.hpp similarity index 92% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse_em.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_sse_em.hpp index be27668..6fb0881 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_sse_em.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_sse_em.hpp @@ -158,10 +158,23 @@ inline __m128i _v128_packs_epu32(const __m128i& a, const __m128i& b) #endif } +template +inline int64 _v128_extract_epi64(const __m128i& a) +{ +#if defined(CV__SIMD_HAVE_mm_extract_epi64) || (CV_SSE4_1 && (defined(__x86_64__)/*GCC*/ || defined(_M_X64)/*MSVC*/)) +#define CV__SIMD_NATIVE_mm_extract_epi64 1 + return _mm_extract_epi64(a, i); +#else + CV_DECL_ALIGNED(16) int64 tmp[2]; + _mm_store_si128((__m128i*)tmp, a); + return tmp[i]; +#endif +} + CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END //! @endcond } // cv:: -#endif // OPENCV_HAL_INTRIN_SSE_EM_HPP \ No newline at end of file +#endif // OPENCV_HAL_INTRIN_SSE_EM_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_vsx.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_vsx.hpp similarity index 78% rename from qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_vsx.hpp rename to 3rdparty/opencv/include/opencv2/core/hal/intrin_vsx.hpp index c5ceb11..b198643 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin_vsx.hpp +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_vsx.hpp @@ -28,7 +28,7 @@ struct v_uint8x16 explicit v_uint8x16(const vec_uchar16& v) : val(v) {} - v_uint8x16() : val(vec_uchar16_z) + v_uint8x16() {} v_uint8x16(vec_bchar16 v) : val(vec_uchar16_c(v)) {} @@ -36,6 +36,9 @@ struct v_uint8x16 uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) : val(vec_uchar16_set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15)) {} + + static inline v_uint8x16 zero() { return v_uint8x16(vec_uchar16_z); } + uchar get0() const { return vec_extract(val, 0); } }; @@ -48,7 +51,7 @@ struct v_int8x16 explicit v_int8x16(const vec_char16& v) : val(v) {} - v_int8x16() : val(vec_char16_z) + v_int8x16() {} v_int8x16(vec_bchar16 v) : val(vec_char16_c(v)) {} @@ -56,6 +59,9 @@ struct v_int8x16 schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) : val(vec_char16_set(v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15)) {} + + static inline v_int8x16 zero() { return v_int8x16(vec_char16_z); } + schar get0() const { return vec_extract(val, 0); } }; @@ -68,13 +74,16 @@ struct v_uint16x8 explicit v_uint16x8(const vec_ushort8& v) : val(v) {} - v_uint16x8() : val(vec_ushort8_z) + v_uint16x8() {} v_uint16x8(vec_bshort8 v) : val(vec_ushort8_c(v)) {} v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) : val(vec_ushort8_set(v0, v1, v2, v3, v4, v5, v6, v7)) {} + + static inline v_uint16x8 zero() { return v_uint16x8(vec_ushort8_z); } + ushort get0() const { return vec_extract(val, 0); } }; @@ -87,13 +96,16 @@ struct v_int16x8 explicit v_int16x8(const vec_short8& v) : val(v) {} - v_int16x8() : val(vec_short8_z) + v_int16x8() {} v_int16x8(vec_bshort8 v) : val(vec_short8_c(v)) {} v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) : val(vec_short8_set(v0, v1, v2, v3, v4, v5, v6, v7)) {} + + static inline v_int16x8 zero() { return v_int16x8(vec_short8_z); } + short get0() const { return vec_extract(val, 0); } }; @@ -106,12 +118,15 @@ struct v_uint32x4 explicit v_uint32x4(const vec_uint4& v) : val(v) {} - v_uint32x4() : val(vec_uint4_z) + v_uint32x4() {} v_uint32x4(vec_bint4 v) : val(vec_uint4_c(v)) {} v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) : val(vec_uint4_set(v0, v1, v2, v3)) {} + + static inline v_uint32x4 zero() { return v_uint32x4(vec_uint4_z); } + uint get0() const { return vec_extract(val, 0); } }; @@ -124,12 +139,15 @@ struct v_int32x4 explicit v_int32x4(const vec_int4& v) : val(v) {} - v_int32x4() : val(vec_int4_z) + v_int32x4() {} v_int32x4(vec_bint4 v) : val(vec_int4_c(v)) {} v_int32x4(int v0, int v1, int v2, int v3) : val(vec_int4_set(v0, v1, v2, v3)) {} + + static inline v_int32x4 zero() { return v_int32x4(vec_int4_z); } + int get0() const { return vec_extract(val, 0); } }; @@ -142,12 +160,15 @@ struct v_float32x4 explicit v_float32x4(const vec_float4& v) : val(v) {} - v_float32x4() : val(vec_float4_z) + v_float32x4() {} v_float32x4(vec_bint4 v) : val(vec_float4_c(v)) {} v_float32x4(float v0, float v1, float v2, float v3) : val(vec_float4_set(v0, v1, v2, v3)) {} + + static inline v_float32x4 zero() { return v_float32x4(vec_float4_z); } + float get0() const { return vec_extract(val, 0); } }; @@ -160,12 +181,15 @@ struct v_uint64x2 explicit v_uint64x2(const vec_udword2& v) : val(v) {} - v_uint64x2() : val(vec_udword2_z) + v_uint64x2() {} v_uint64x2(vec_bdword2 v) : val(vec_udword2_c(v)) {} v_uint64x2(uint64 v0, uint64 v1) : val(vec_udword2_set(v0, v1)) {} + + static inline v_uint64x2 zero() { return v_uint64x2(vec_udword2_z); } + uint64 get0() const { return vec_extract(val, 0); } }; @@ -178,12 +202,15 @@ struct v_int64x2 explicit v_int64x2(const vec_dword2& v) : val(v) {} - v_int64x2() : val(vec_dword2_z) + v_int64x2() {} v_int64x2(vec_bdword2 v) : val(vec_dword2_c(v)) {} v_int64x2(int64 v0, int64 v1) : val(vec_dword2_set(v0, v1)) {} + + static inline v_int64x2 zero() { return v_int64x2(vec_dword2_z); } + int64 get0() const { return vec_extract(val, 0); } }; @@ -196,16 +223,33 @@ struct v_float64x2 explicit v_float64x2(const vec_double2& v) : val(v) {} - v_float64x2() : val(vec_double2_z) + v_float64x2() {} v_float64x2(vec_bdword2 v) : val(vec_double2_c(v)) {} v_float64x2(double v0, double v1) : val(vec_double2_set(v0, v1)) {} + + static inline v_float64x2 zero() { return v_float64x2(vec_double2_z); } + double get0() const { return vec_extract(val, 0); } }; +#define OPENCV_HAL_IMPL_VSX_EXTRACT_N(_Tpvec, _Tp) \ +template inline _Tp v_extract_n(VSX_UNUSED(_Tpvec v)) { return vec_extract(v.val, i); } + +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint8x16, uchar) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int8x16, schar) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint16x8, ushort) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int16x8, short) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint32x4, uint) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int32x4, int) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_uint64x2, uint64) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_int64x2, int64) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float32x4, float) +OPENCV_HAL_IMPL_VSX_EXTRACT_N(v_float64x2, double) + //////////////// Load and store operations /////////////// /* @@ -215,7 +259,7 @@ struct v_float64x2 * if vec_xxx_c defined as C++ cast, clang-5 will pass it */ #define OPENCV_HAL_IMPL_VSX_INITVEC(_Tpvec, _Tp, suffix, cast) \ -inline _Tpvec v_setzero_##suffix() { return _Tpvec(); } \ +inline _Tpvec v_setzero_##suffix() { return _Tpvec(vec_splats((_Tp)0)); } \ inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(vec_splats((_Tp)v));} \ template inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0 &a) \ { return _Tpvec((cast)a.val); } @@ -332,11 +376,37 @@ OPENCV_HAL_IMPL_VSX_EXPAND(v_int16x8, v_int32x4, short, vec_unpackl, vec_unpackh OPENCV_HAL_IMPL_VSX_EXPAND(v_uint32x4, v_uint64x2, uint, vec_unpacklu, vec_unpackhu) OPENCV_HAL_IMPL_VSX_EXPAND(v_int32x4, v_int64x2, int, vec_unpackl, vec_unpackh) +/* Load and zero expand a 4 byte value into the second dword, first is don't care. */ +#if !defined(CV_COMPILER_VSX_BROKEN_ASM) + #define _LXSIWZX(out, ptr, T) __asm__ ("lxsiwzx %x0, 0, %1\r\n" : "=wa"(out) : "r" (ptr) : "memory"); +#else + /* This is compiler-agnostic, but will introduce an unneeded splat on the critical path. */ + #define _LXSIWZX(out, ptr, T) out = (T)vec_udword2_sp(*(uint32_t*)(ptr)); +#endif + inline v_uint32x4 v_load_expand_q(const uchar* ptr) -{ return v_uint32x4(vec_uint4_set(ptr[0], ptr[1], ptr[2], ptr[3])); } +{ + // Zero-extend the extra 24B instead of unpacking. Usually faster in small kernel + // Likewise note, value is zero extended and upper 4 bytes are zero'ed. + vec_uchar16 pmu = {8, 12, 12, 12, 9, 12, 12, 12, 10, 12, 12, 12, 11, 12, 12, 12}; + vec_uchar16 out; + + _LXSIWZX(out, ptr, vec_uchar16); + out = vec_perm(out, out, pmu); + return v_uint32x4((vec_uint4)out); +} inline v_int32x4 v_load_expand_q(const schar* ptr) -{ return v_int32x4(vec_int4_set(ptr[0], ptr[1], ptr[2], ptr[3])); } +{ + vec_char16 out; + vec_short8 outs; + vec_int4 outw; + + _LXSIWZX(out, ptr, vec_char16); + outs = vec_unpackl(out); + outw = vec_unpackh(outs); + return v_int32x4(outw); +} /* pack */ #define OPENCV_HAL_IMPL_VSX_PACK(_Tpvec, _Tp, _Tpwvec, _Tpvn, _Tpdel, sfnc, pkfnc, addfnc, pack) \ @@ -499,12 +569,6 @@ inline void v_mul_expand(const Tvec& a, const Tvec& b, Twvec& c, Twvec& d) v_zip(p0, p1, c, d); } -inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, v_uint64x2& c, v_uint64x2& d) -{ - c.val = vec_mul(vec_unpackhu(a.val), vec_unpackhu(b.val)); - d.val = vec_mul(vec_unpacklu(a.val), vec_unpacklu(b.val)); -} - inline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b) { vec_int4 p0 = vec_mule(a.val, b.val); @@ -626,7 +690,7 @@ inline _Tpvec v_rotate_##suffix(const _Tpvec& a) { \ const int wd = imm * sizeof(typename _Tpvec::lane_type); \ if (wd > 15) \ - return _Tpvec(); \ + return _Tpvec::zero(); \ return _Tpvec((cast)shf(vec_uchar16_c(a.val), vec_uchar16_sp(wd << 3))); \ } @@ -684,6 +748,53 @@ OPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_float64x2) OPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_uint64x2) OPENCV_IMPL_VSX_ROTATE_64_2RG_LR(v_int64x2) +/* Reverse */ +inline v_uint8x16 v_reverse(const v_uint8x16 &a) +{ + static const vec_uchar16 perm = {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}; + vec_uchar16 vec = (vec_uchar16)a.val; + return v_uint8x16(vec_perm(vec, vec, perm)); +} + +inline v_int8x16 v_reverse(const v_int8x16 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x8 v_reverse(const v_uint16x8 &a) +{ + static const vec_uchar16 perm = {14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1}; + vec_uchar16 vec = (vec_uchar16)a.val; + return v_reinterpret_as_u16(v_uint8x16(vec_perm(vec, vec, perm))); +} + +inline v_int16x8 v_reverse(const v_int16x8 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x4 v_reverse(const v_uint32x4 &a) +{ + static const vec_uchar16 perm = {12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3}; + vec_uchar16 vec = (vec_uchar16)a.val; + return v_reinterpret_as_u32(v_uint8x16(vec_perm(vec, vec, perm))); +} + +inline v_int32x4 v_reverse(const v_int32x4 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x4 v_reverse(const v_float32x4 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x2 v_reverse(const v_uint64x2 &a) +{ + static const vec_uchar16 perm = {8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7}; + vec_uchar16 vec = (vec_uchar16)a.val; + return v_reinterpret_as_u64(v_uint8x16(vec_perm(vec, vec, perm))); +} + +inline v_int64x2 v_reverse(const v_int64x2 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x2 v_reverse(const v_float64x2 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + /* Extract */ template inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) @@ -692,15 +803,27 @@ inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) ////////// Reduce and mask ///////// /** Reduce **/ -inline short v_reduce_sum(const v_int16x8& a) +inline uint v_reduce_sum(const v_uint8x16& a) +{ + const vec_uint4 zero4 = vec_uint4_z; + vec_uint4 sum4 = vec_sum4s(a.val, zero4); + return (uint)vec_extract(vec_sums(vec_int4_c(sum4), vec_int4_c(zero4)), 3); +} +inline int v_reduce_sum(const v_int8x16& a) +{ + const vec_int4 zero4 = vec_int4_z; + vec_int4 sum4 = vec_sum4s(a.val, zero4); + return (int)vec_extract(vec_sums(sum4, zero4), 3); +} +inline int v_reduce_sum(const v_int16x8& a) { const vec_int4 zero = vec_int4_z; - return saturate_cast(vec_extract(vec_sums(vec_sum4s(a.val, zero), zero), 3)); + return saturate_cast(vec_extract(vec_sums(vec_sum4s(a.val, zero), zero), 3)); } -inline ushort v_reduce_sum(const v_uint16x8& a) +inline uint v_reduce_sum(const v_uint16x8& a) { const vec_int4 v4 = vec_int4_c(vec_unpackhu(vec_adds(a.val, vec_sld(a.val, a.val, 8)))); - return saturate_cast(vec_extract(vec_sums(v4, vec_int4_z), 3)); + return saturate_cast(vec_extract(vec_sums(v4, vec_int4_z), 3)); } #define OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(_Tpvec, _Tpvec2, scalartype, suffix, func) \ @@ -719,6 +842,14 @@ OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, sum, vec_add) OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, max, vec_max) OPENCV_HAL_IMPL_VSX_REDUCE_OP_4(v_float32x4, vec_float4, float, min, vec_min) +inline uint64 v_reduce_sum(const v_uint64x2& a) +{ + return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0); +} +inline int64 v_reduce_sum(const v_int64x2& a) +{ + return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0); +} inline double v_reduce_sum(const v_float64x2& a) { return vec_extract(vec_add(a.val, vec_permi(a.val, a.val, 3)), 0); @@ -736,6 +867,19 @@ OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_uint16x8, vec_ushort8, ushort, min, vec_min) OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int16x8, vec_short8, short, max, vec_max) OPENCV_HAL_IMPL_VSX_REDUCE_OP_8(v_int16x8, vec_short8, short, min, vec_min) +#define OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(_Tpvec, _Tpvec2, scalartype, suffix, func) \ +inline scalartype v_reduce_##suffix(const _Tpvec& a) \ +{ \ + _Tpvec2 rs = func(a.val, vec_sld(a.val, a.val, 8)); \ + rs = func(rs, vec_sld(rs, rs, 4)); \ + rs = func(rs, vec_sld(rs, rs, 2)); \ + return vec_extract(func(rs, vec_sld(rs, rs, 1)), 0); \ +} +OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, max, vec_max) +OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_uint8x16, vec_uchar16, uchar, min, vec_min) +OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, max, vec_max) +OPENCV_HAL_IMPL_VSX_REDUCE_OP_16(v_int8x16, vec_char16, schar, min, vec_min) + inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c, const v_float32x4& d) { @@ -763,7 +907,7 @@ inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) inline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b) { vec_ushort8 ad = vec_absd(a.val, b.val); - VSX_UNUSED(vec_int4) sum = vec_sums(vec_int4_c(vec_unpackhu(ad)), vec_int4_c(vec_unpacklu(ad))); + VSX_UNUSED(vec_int4) sum = vec_sums(vec_int4_c(vec_unpackhu(ad)) + vec_int4_c(vec_unpacklu(ad)), vec_int4_z); return (unsigned)vec_extract(sum, 3); } inline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b) @@ -792,43 +936,44 @@ inline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b) } /** Popcount **/ -template -inline v_uint32x4 v_popcount(const _Tpvec& a) -{ return v_uint32x4(vec_popcntu(vec_uint4_c(a.val))); } +inline v_uint8x16 v_popcount(const v_uint8x16& a) +{ return v_uint8x16(vec_popcntu(a.val)); } +inline v_uint8x16 v_popcount(const v_int8x16& a) +{ return v_uint8x16(vec_popcntu(a.val)); } +inline v_uint16x8 v_popcount(const v_uint16x8& a) +{ return v_uint16x8(vec_popcntu(a.val)); } +inline v_uint16x8 v_popcount(const v_int16x8& a) +{ return v_uint16x8(vec_popcntu(a.val)); } +inline v_uint32x4 v_popcount(const v_uint32x4& a) +{ return v_uint32x4(vec_popcntu(a.val)); } +inline v_uint32x4 v_popcount(const v_int32x4& a) +{ return v_uint32x4(vec_popcntu(a.val)); } +inline v_uint64x2 v_popcount(const v_uint64x2& a) +{ return v_uint64x2(vec_popcntu(a.val)); } +inline v_uint64x2 v_popcount(const v_int64x2& a) +{ return v_uint64x2(vec_popcntu(a.val)); } /** Mask **/ inline int v_signmask(const v_uint8x16& a) { - vec_uchar16 sv = vec_sr(a.val, vec_uchar16_sp(7)); - static const vec_uchar16 slm = {0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7}; - sv = vec_sl(sv, slm); - vec_uint4 sv4 = vec_sum4s(sv, vec_uint4_z); - static const vec_uint4 slm4 = {0, 0, 8, 8}; - sv4 = vec_sl(sv4, slm4); - return vec_extract(vec_sums((vec_int4) sv4, vec_int4_z), 3); + static const vec_uchar16 qperm = {120, 112, 104, 96, 88, 80, 72, 64, 56, 48, 40, 32, 24, 16, 8, 0}; + return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2); } inline int v_signmask(const v_int8x16& a) { return v_signmask(v_reinterpret_as_u8(a)); } inline int v_signmask(const v_int16x8& a) { - static const vec_ushort8 slm = {0, 1, 2, 3, 4, 5, 6, 7}; - vec_short8 sv = vec_sr(a.val, vec_ushort8_sp(15)); - sv = vec_sl(sv, slm); - vec_int4 svi = vec_int4_z; - svi = vec_sums(vec_sum4s(sv, svi), svi); - return vec_extract(svi, 3); + static const vec_uchar16 qperm = {112, 96, 80, 64, 48, 32, 16, 0, 128, 128, 128, 128, 128, 128, 128, 128}; + return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2); } inline int v_signmask(const v_uint16x8& a) { return v_signmask(v_reinterpret_as_s16(a)); } inline int v_signmask(const v_int32x4& a) { - static const vec_uint4 slm = {0, 1, 2, 3}; - vec_int4 sv = vec_sr(a.val, vec_uint4_sp(31)); - sv = vec_sl(sv, slm); - sv = vec_sums(sv, vec_int4_z); - return vec_extract(sv, 3); + static const vec_uchar16 qperm = {96, 64, 32, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128}; + return vec_extract((vec_int4)vec_vbpermq(v_reinterpret_as_u8(a).val, qperm), 2); } inline int v_signmask(const v_uint32x4& a) { return v_signmask(v_reinterpret_as_s32(a)); } @@ -845,15 +990,28 @@ inline int v_signmask(const v_uint64x2& a) inline int v_signmask(const v_float64x2& a) { return v_signmask(v_reinterpret_as_s64(a)); } +inline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(a)); } +inline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(a)); } + template inline bool v_check_all(const _Tpvec& a) -{ return vec_all_lt(a.val, _Tpvec().val); } +{ return vec_all_lt(a.val, _Tpvec::zero().val); } inline bool v_check_all(const v_uint8x16& a) { return v_check_all(v_reinterpret_as_s8(a)); } inline bool v_check_all(const v_uint16x8& a) { return v_check_all(v_reinterpret_as_s16(a)); } inline bool v_check_all(const v_uint32x4& a) { return v_check_all(v_reinterpret_as_s32(a)); } +inline bool v_check_all(const v_uint64x2& a) +{ return v_check_all(v_reinterpret_as_s64(a)); } inline bool v_check_all(const v_float32x4& a) { return v_check_all(v_reinterpret_as_s32(a)); } inline bool v_check_all(const v_float64x2& a) @@ -861,13 +1019,15 @@ inline bool v_check_all(const v_float64x2& a) template inline bool v_check_any(const _Tpvec& a) -{ return vec_any_lt(a.val, _Tpvec().val); } +{ return vec_any_lt(a.val, _Tpvec::zero().val); } inline bool v_check_any(const v_uint8x16& a) { return v_check_any(v_reinterpret_as_s8(a)); } inline bool v_check_any(const v_uint16x8& a) { return v_check_any(v_reinterpret_as_s16(a)); } inline bool v_check_any(const v_uint32x4& a) { return v_check_any(v_reinterpret_as_s32(a)); } +inline bool v_check_any(const v_uint64x2& a) +{ return v_check_any(v_reinterpret_as_s64(a)); } inline bool v_check_any(const v_float32x4& a) { return v_check_any(v_reinterpret_as_s32(a)); } inline bool v_check_any(const v_float64x2& a) @@ -994,6 +1154,9 @@ inline v_float64x2 v_cvt_f64(const v_float32x4& a) inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) { return v_float64x2(vec_cvfo(vec_mergel(a.val, a.val))); } +inline v_float64x2 v_cvt_f64(const v_int64x2& a) +{ return v_float64x2(vec_ctd(a.val)); } + ////////////// Lookup table access //////////////////// inline v_int8x16 v_lut(const schar* tab, const int* idx) @@ -1205,7 +1368,7 @@ inline v_float32x4 v_load_expand(const float16_t* ptr) return v_float32x4(vec_extract_fp_from_shorth(vf16)); #elif CV_VSX3 && !defined(CV_COMPILER_VSX_BROKEN_ASM) vec_float4 vf32; - __asm__ __volatile__ ("xvcvhpsp %x0,%x1" : "=wf" (vf32) : "wa" (vec_mergeh(vf16, vf16))); + __asm__ __volatile__ ("xvcvhpsp %x0,%x1" : "=wa" (vf32) : "wa" (vec_mergeh(vf16, vf16))); return v_float32x4(vf32); #else const vec_int4 z = vec_int4_z, delta = vec_int4_sp(0x38000000); @@ -1227,10 +1390,10 @@ inline v_float32x4 v_load_expand(const float16_t* ptr) inline void v_pack_store(float16_t* ptr, const v_float32x4& v) { -// fixme: Is there any buitin op or intrinsic that cover "xvcvsphp"? +// fixme: Is there any builtin op or intrinsic that cover "xvcvsphp"? #if CV_VSX3 && !defined(CV_COMPILER_VSX_BROKEN_ASM) vec_ushort8 vf16; - __asm__ __volatile__ ("xvcvsphp %x0,%x1" : "=wa" (vf16) : "wf" (v.val)); + __asm__ __volatile__ ("xvcvsphp %x0,%x1" : "=wa" (vf16) : "wa" (v.val)); vec_st_l8(vec_mergesqe(vf16, vf16), ptr); #else const vec_int4 signmask = vec_int4_sp(0x80000000); @@ -1264,12 +1427,134 @@ inline void v_cleanup() {} ////////// Matrix operations ///////// +//////// Dot Product //////// +// 16 >> 32 inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) { return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)); } - inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) { return v_int32x4(vec_msum(a.val, b.val, c.val)); } +// 32 >> 64 +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b) +{ + vec_dword2 even = vec_mule(a.val, b.val); + vec_dword2 odd = vec_mulo(a.val, b.val); + return v_int64x2(vec_add(even, odd)); +} +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod(a, b) + c; } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_uint32x4(vec_msum(a.val, b.val, c.val)); } +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b) +{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)); } + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b) +{ + const vec_ushort8 eight = vec_ushort8_sp(8); + vec_short8 a0 = vec_sra((vec_short8)vec_sld(a.val, a.val, 1), eight); // even + vec_short8 a1 = vec_sra((vec_short8)a.val, eight); // odd + vec_short8 b0 = vec_sra((vec_short8)vec_sld(b.val, b.val, 1), eight); + vec_short8 b1 = vec_sra((vec_short8)b.val, eight); + return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, vec_int4_z))); +} + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ + const vec_ushort8 eight = vec_ushort8_sp(8); + vec_short8 a0 = vec_sra((vec_short8)vec_sld(a.val, a.val, 1), eight); // even + vec_short8 a1 = vec_sra((vec_short8)a.val, eight); // odd + vec_short8 b0 = vec_sra((vec_short8)vec_sld(b.val, b.val, 1), eight); + vec_short8 b1 = vec_sra((vec_short8)b.val, eight); + return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, c.val))); +} + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b) +{ + const vec_uint4 zero = vec_uint4_z; + vec_uint4 even = vec_mule(a.val, b.val); + vec_uint4 odd = vec_mulo(a.val, b.val); + vec_udword2 e0 = (vec_udword2)vec_mergee(even, zero); + vec_udword2 e1 = (vec_udword2)vec_mergeo(even, zero); + vec_udword2 o0 = (vec_udword2)vec_mergee(odd, zero); + vec_udword2 o1 = (vec_udword2)vec_mergeo(odd, zero); + vec_udword2 s0 = vec_add(e0, o0); + vec_udword2 s1 = vec_add(e1, o1); + return v_uint64x2(vec_add(s0, s1)); +} +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b) +{ + v_int32x4 prod = v_dotprod(a, b); + v_int64x2 c, d; + v_expand(prod, c, d); + return v_int64x2(vec_add(vec_mergeh(c.val, d.val), vec_mergel(c.val, d.val))); +} +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod(a, b); } +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_int32x4(vec_msum(a.val, b.val, vec_int4_z)) + c; } +// 32 >> 64 +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod(a, b); } +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod(a, b, c); } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) +{ return v_dotprod_expand(a, b); } +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_uint32x4(vec_msum(a.val, b.val, vec_uint4_z)) + c; } + +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) +{ + vec_short8 a0 = vec_unpackh(a.val); + vec_short8 a1 = vec_unpackl(a.val); + vec_short8 b0 = vec_unpackh(b.val); + vec_short8 b1 = vec_unpackl(b.val); + return v_int32x4(vec_msum(a0, b0, vec_msum(a1, b1, vec_int4_z))); +} +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b) +{ return v_dotprod_expand(a, b); } +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b, c); } + +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b) +{ + v_int32x4 prod = v_dotprod(a, b); + v_int64x2 c, d; + v_expand(prod, c, d); + return c + d; +} +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand_fast(a, b) + c; } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod_expand(a, b); } +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b, c); } + inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, const v_float32x4& m1, const v_float32x4& m2, const v_float32x4& m3) @@ -1309,15 +1594,10 @@ OPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_uint32x4, vec_uint4) OPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_int32x4, vec_int4) OPENCV_HAL_IMPL_VSX_TRANSPOSE4x4(v_float32x4, vec_float4) -//! @name Check SIMD support -//! @{ -//! @brief Check CPU capability of SIMD operation -static inline bool hasSIMD128() -{ - return (CV_CPU_HAS_SUPPORT_VSX) ? true : false; -} +template +inline Tvec v_broadcast_element(const Tvec& v) +{ return Tvec(vec_splat(v.val, i)); } -//! @} CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END diff --git a/3rdparty/opencv/include/opencv2/core/hal/intrin_wasm.hpp b/3rdparty/opencv/include/opencv2/core/hal/intrin_wasm.hpp new file mode 100644 index 0000000..b4178af --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/intrin_wasm.hpp @@ -0,0 +1,2782 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_HAL_INTRIN_WASM_HPP +#define OPENCV_HAL_INTRIN_WASM_HPP + +#include +#include +#include +#include "opencv2/core/saturate.hpp" + +#define CV_SIMD128 1 +#define CV_SIMD128_64F 0 // Now all implementation of f64 use fallback, so disable it. +#define CV_SIMD128_FP16 0 + +namespace cv +{ + +//! @cond IGNORED + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN + +#if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) < (1038046) +// handle renames: https://github.com/emscripten-core/emscripten/pull/9440 (https://github.com/emscripten-core/emscripten/commit/755d5b46cb84d0aa120c10981b11d05646c29673) +#define wasm_i32x4_trunc_saturate_f32x4 wasm_trunc_saturate_i32x4_f32x4 +#define wasm_u32x4_trunc_saturate_f32x4 wasm_trunc_saturate_u32x4_f32x4 +#define wasm_i64x2_trunc_saturate_f64x2 wasm_trunc_saturate_i64x2_f64x2 +#define wasm_u64x2_trunc_saturate_f64x2 wasm_trunc_saturate_u64x2_f64x2 +#define wasm_f32x4_convert_i32x4 wasm_convert_f32x4_i32x4 +#define wasm_f32x4_convert_u32x4 wasm_convert_f32x4_u32x4 +#define wasm_f64x2_convert_i64x2 wasm_convert_f64x2_i64x2 +#define wasm_f64x2_convert_u64x2 wasm_convert_f64x2_u64x2 +#endif // COMPATIBILITY: <1.38.46 + +///////// Types /////////// + +struct v_uint8x16 +{ + typedef uchar lane_type; + typedef v128_t vector_type; + enum { nlanes = 16 }; + + v_uint8x16() {} + explicit v_uint8x16(v128_t v) : val(v) {} + v_uint8x16(uchar v0, uchar v1, uchar v2, uchar v3, uchar v4, uchar v5, uchar v6, uchar v7, + uchar v8, uchar v9, uchar v10, uchar v11, uchar v12, uchar v13, uchar v14, uchar v15) + { + uchar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = wasm_v128_load(v); + } + + uchar get0() const + { + return (uchar)wasm_i8x16_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_int8x16 +{ + typedef schar lane_type; + typedef v128_t vector_type; + enum { nlanes = 16 }; + + v_int8x16() {} + explicit v_int8x16(v128_t v) : val(v) {} + v_int8x16(schar v0, schar v1, schar v2, schar v3, schar v4, schar v5, schar v6, schar v7, + schar v8, schar v9, schar v10, schar v11, schar v12, schar v13, schar v14, schar v15) + { + schar v[] = {v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15}; + val = wasm_v128_load(v); + } + + schar get0() const + { + return wasm_i8x16_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_uint16x8 +{ + typedef ushort lane_type; + typedef v128_t vector_type; + enum { nlanes = 8 }; + + v_uint16x8() {} + explicit v_uint16x8(v128_t v) : val(v) {} + v_uint16x8(ushort v0, ushort v1, ushort v2, ushort v3, ushort v4, ushort v5, ushort v6, ushort v7) + { + ushort v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = wasm_v128_load(v); + } + + ushort get0() const + { + return (ushort)wasm_i16x8_extract_lane(val, 0); // wasm_u16x8_extract_lane() unimplemented yet + } + + v128_t val; +}; + +struct v_int16x8 +{ + typedef short lane_type; + typedef v128_t vector_type; + enum { nlanes = 8 }; + + v_int16x8() {} + explicit v_int16x8(v128_t v) : val(v) {} + v_int16x8(short v0, short v1, short v2, short v3, short v4, short v5, short v6, short v7) + { + short v[] = {v0, v1, v2, v3, v4, v5, v6, v7}; + val = wasm_v128_load(v); + } + + short get0() const + { + return wasm_i16x8_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_uint32x4 +{ + typedef unsigned lane_type; + typedef v128_t vector_type; + enum { nlanes = 4 }; + + v_uint32x4() {} + explicit v_uint32x4(v128_t v) : val(v) {} + v_uint32x4(unsigned v0, unsigned v1, unsigned v2, unsigned v3) + { + unsigned v[] = {v0, v1, v2, v3}; + val = wasm_v128_load(v); + } + + unsigned get0() const + { + return (unsigned)wasm_i32x4_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_int32x4 +{ + typedef int lane_type; + typedef v128_t vector_type; + enum { nlanes = 4 }; + + v_int32x4() {} + explicit v_int32x4(v128_t v) : val(v) {} + v_int32x4(int v0, int v1, int v2, int v3) + { + int v[] = {v0, v1, v2, v3}; + val = wasm_v128_load(v); + } + + int get0() const + { + return wasm_i32x4_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_float32x4 +{ + typedef float lane_type; + typedef v128_t vector_type; + enum { nlanes = 4 }; + + v_float32x4() {} + explicit v_float32x4(v128_t v) : val(v) {} + v_float32x4(float v0, float v1, float v2, float v3) + { + float v[] = {v0, v1, v2, v3}; + val = wasm_v128_load(v); + } + + float get0() const + { + return wasm_f32x4_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_uint64x2 +{ + typedef uint64 lane_type; + typedef v128_t vector_type; + enum { nlanes = 2 }; + + v_uint64x2() {} + explicit v_uint64x2(v128_t v) : val(v) {} + v_uint64x2(uint64 v0, uint64 v1) + { + uint64 v[] = {v0, v1}; + val = wasm_v128_load(v); + } + + uint64 get0() const + { + return (uint64)wasm_i64x2_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_int64x2 +{ + typedef int64 lane_type; + typedef v128_t vector_type; + enum { nlanes = 2 }; + + v_int64x2() {} + explicit v_int64x2(v128_t v) : val(v) {} + v_int64x2(int64 v0, int64 v1) + { + int64 v[] = {v0, v1}; + val = wasm_v128_load(v); + } + + int64 get0() const + { + return wasm_i64x2_extract_lane(val, 0); + } + + v128_t val; +}; + +struct v_float64x2 +{ + typedef double lane_type; + typedef v128_t vector_type; + enum { nlanes = 2 }; + + v_float64x2() {} + explicit v_float64x2(v128_t v) : val(v) {} + v_float64x2(double v0, double v1) + { + double v[] = {v0, v1}; + val = wasm_v128_load(v); + } + + double get0() const + { + return wasm_f64x2_extract_lane(val, 0); + } + + v128_t val; +}; + +namespace +{ +#define OPENCV_HAL_IMPL_REINTERPRET_INT(ft, tt) \ +inline tt reinterpret_int(ft x) { union { ft l; tt i; } v; v.l = x; return v.i; } +OPENCV_HAL_IMPL_REINTERPRET_INT(uchar, schar) +OPENCV_HAL_IMPL_REINTERPRET_INT(schar, schar) +OPENCV_HAL_IMPL_REINTERPRET_INT(ushort, short) +OPENCV_HAL_IMPL_REINTERPRET_INT(short, short) +OPENCV_HAL_IMPL_REINTERPRET_INT(unsigned, int) +OPENCV_HAL_IMPL_REINTERPRET_INT(int, int) +OPENCV_HAL_IMPL_REINTERPRET_INT(float, int) +OPENCV_HAL_IMPL_REINTERPRET_INT(uint64, int64) +OPENCV_HAL_IMPL_REINTERPRET_INT(int64, int64) +OPENCV_HAL_IMPL_REINTERPRET_INT(double, int64) + +static const unsigned char popCountTable[] = +{ + 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, + 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8, +}; +} // namespace + +static v128_t wasm_unpacklo_i8x16(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 0,16,1,17,2,18,3,19,4,20,5,21,6,22,7,23); +} + +static v128_t wasm_unpacklo_i16x8(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 0,1,16,17,2,3,18,19,4,5,20,21,6,7,22,23); +} + +static v128_t wasm_unpacklo_i32x4(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 0,1,2,3,16,17,18,19,4,5,6,7,20,21,22,23); +} + +static v128_t wasm_unpacklo_i64x2(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); +} + +static v128_t wasm_unpackhi_i8x16(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 8,24,9,25,10,26,11,27,12,28,13,29,14,30,15,31); +} + +static v128_t wasm_unpackhi_i16x8(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 8,9,24,25,10,11,26,27,12,13,28,29,14,15,30,31); +} + +static v128_t wasm_unpackhi_i32x4(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 8,9,10,11,24,25,26,27,12,13,14,15,28,29,30,31); +} + +static v128_t wasm_unpackhi_i64x2(v128_t a, v128_t b) { + return wasm_v8x16_shuffle(a, b, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); +} + +/** Convert **/ +// 8 >> 16 +inline v128_t v128_cvtu8x16_i16x8(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpacklo_i8x16(a, z); +} +inline v128_t v128_cvti8x16_i16x8(const v128_t& a) +{ return wasm_i16x8_shr(wasm_unpacklo_i8x16(a, a), 8); } +// 8 >> 32 +inline v128_t v128_cvtu8x16_i32x4(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpacklo_i16x8(wasm_unpacklo_i8x16(a, z), z); +} +inline v128_t v128_cvti8x16_i32x4(const v128_t& a) +{ + v128_t r = wasm_unpacklo_i8x16(a, a); + r = wasm_unpacklo_i8x16(r, r); + return wasm_i32x4_shr(r, 24); +} +// 16 >> 32 +inline v128_t v128_cvtu16x8_i32x4(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpacklo_i16x8(a, z); +} +inline v128_t v128_cvti16x8_i32x4(const v128_t& a) +{ return wasm_i32x4_shr(wasm_unpacklo_i16x8(a, a), 16); } +// 32 >> 64 +inline v128_t v128_cvtu32x4_i64x2(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpacklo_i32x4(a, z); +} +inline v128_t v128_cvti32x4_i64x2(const v128_t& a) +{ return wasm_unpacklo_i32x4(a, wasm_i32x4_shr(a, 31)); } + +// 16 << 8 +inline v128_t v128_cvtu8x16_i16x8_high(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpackhi_i8x16(a, z); +} +inline v128_t v128_cvti8x16_i16x8_high(const v128_t& a) +{ return wasm_i16x8_shr(wasm_unpackhi_i8x16(a, a), 8); } +// 32 << 16 +inline v128_t v128_cvtu16x8_i32x4_high(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpackhi_i16x8(a, z); +} +inline v128_t v128_cvti16x8_i32x4_high(const v128_t& a) +{ return wasm_i32x4_shr(wasm_unpackhi_i16x8(a, a), 16); } +// 64 << 32 +inline v128_t v128_cvtu32x4_i64x2_high(const v128_t& a) +{ + const v128_t z = wasm_i8x16_splat(0); + return wasm_unpackhi_i32x4(a, z); +} +inline v128_t v128_cvti32x4_i64x2_high(const v128_t& a) +{ return wasm_unpackhi_i32x4(a, wasm_i32x4_shr(a, 31)); } + +#define OPENCV_HAL_IMPL_WASM_INITVEC(_Tpvec, _Tp, suffix, zsuffix, _Tps) \ +inline _Tpvec v_setzero_##suffix() { return _Tpvec(wasm_##zsuffix##_splat((_Tps)0)); } \ +inline _Tpvec v_setall_##suffix(_Tp v) { return _Tpvec(wasm_##zsuffix##_splat((_Tps)v)); } \ +template inline _Tpvec v_reinterpret_as_##suffix(const _Tpvec0& a) \ +{ return _Tpvec(a.val); } + +OPENCV_HAL_IMPL_WASM_INITVEC(v_uint8x16, uchar, u8, i8x16, schar) +OPENCV_HAL_IMPL_WASM_INITVEC(v_int8x16, schar, s8, i8x16, schar) +OPENCV_HAL_IMPL_WASM_INITVEC(v_uint16x8, ushort, u16, i16x8, short) +OPENCV_HAL_IMPL_WASM_INITVEC(v_int16x8, short, s16, i16x8, short) +OPENCV_HAL_IMPL_WASM_INITVEC(v_uint32x4, unsigned, u32, i32x4, int) +OPENCV_HAL_IMPL_WASM_INITVEC(v_int32x4, int, s32, i32x4, int) +OPENCV_HAL_IMPL_WASM_INITVEC(v_float32x4, float, f32, f32x4, float) +OPENCV_HAL_IMPL_WASM_INITVEC(v_uint64x2, uint64, u64, i64x2, int64) +OPENCV_HAL_IMPL_WASM_INITVEC(v_int64x2, int64, s64, i64x2, int64) +OPENCV_HAL_IMPL_WASM_INITVEC(v_float64x2, double, f64, f64x2, double) + +//////////////// PACK /////////////// +inline v_uint8x16 v_pack(const v_uint16x8& a, const v_uint16x8& b) +{ + v128_t maxval = wasm_i16x8_splat(255); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u16x8_gt(b.val, maxval)); + return v_uint8x16(wasm_v8x16_shuffle(a1, b1, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +inline v_int8x16 v_pack(const v_int16x8& a, const v_int16x8& b) +{ + v128_t maxval = wasm_i16x8_splat(127); + v128_t minval = wasm_i16x8_splat(-128); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i16x8_gt(b.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval)); + v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i16x8_lt(b1, minval)); + return v_int8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +inline v_uint16x8 v_pack(const v_uint32x4& a, const v_uint32x4& b) +{ + v128_t maxval = wasm_i32x4_splat(65535); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u32x4_gt(b.val, maxval)); + return v_uint16x8(wasm_v8x16_shuffle(a1, b1, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} +inline v_int16x8 v_pack(const v_int32x4& a, const v_int32x4& b) +{ + v128_t maxval = wasm_i32x4_splat(32767); + v128_t minval = wasm_i32x4_splat(-32768); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i32x4_gt(b.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval)); + v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i32x4_lt(b1, minval)); + return v_int16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} +inline v_uint32x4 v_pack(const v_uint64x2& a, const v_uint64x2& b) +{ + return v_uint32x4(wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27)); +} +inline v_int32x4 v_pack(const v_int64x2& a, const v_int64x2& b) +{ + return v_int32x4(wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27)); +} +inline v_uint8x16 v_pack_u(const v_int16x8& a, const v_int16x8& b) +{ + v128_t maxval = wasm_i16x8_splat(255); + v128_t minval = wasm_i16x8_splat(0); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i16x8_gt(b.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval)); + v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i16x8_lt(b1, minval)); + return v_uint8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +inline v_uint16x8 v_pack_u(const v_int32x4& a, const v_int32x4& b) +{ + v128_t maxval = wasm_i32x4_splat(65535); + v128_t minval = wasm_i32x4_splat(0); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_i32x4_gt(b.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval)); + v128_t b2 = wasm_v128_bitselect(minval, b1, wasm_i32x4_lt(b1, minval)); + return v_uint16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} + +template +inline v_uint8x16 v_rshr_pack(const v_uint16x8& a, const v_uint16x8& b) +{ + v128_t delta = wasm_i16x8_splat(((short)1 << (n-1))); + v128_t a1 = wasm_u16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t b1 = wasm_u16x8_shr(wasm_i16x8_add(b.val, delta), n); + v128_t maxval = wasm_i16x8_splat(255); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u16x8_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_u16x8_gt(b1, maxval)); + return v_uint8x16(wasm_v8x16_shuffle(a2, b2, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +template +inline v_int8x16 v_rshr_pack(const v_int16x8& a, const v_int16x8& b) +{ + v128_t delta = wasm_i16x8_splat(((short)1 << (n-1))); + v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t b1 = wasm_i16x8_shr(wasm_i16x8_add(b.val, delta), n); + v128_t maxval = wasm_i16x8_splat(127); + v128_t minval = wasm_i16x8_splat(-128); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i16x8_gt(b1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval)); + v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i16x8_lt(b1, minval)); + return v_int8x16(wasm_v8x16_shuffle(a3, b3, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +template +inline v_uint16x8 v_rshr_pack(const v_uint32x4& a, const v_uint32x4& b) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_u32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t b1 = wasm_u32x4_shr(wasm_i32x4_add(b.val, delta), n); + v128_t maxval = wasm_i32x4_splat(65535); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u32x4_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_u32x4_gt(b1, maxval)); + return v_uint16x8(wasm_v8x16_shuffle(a2, b2, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} +template +inline v_int16x8 v_rshr_pack(const v_int32x4& a, const v_int32x4& b) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t b1 = wasm_i32x4_shr(wasm_i32x4_add(b.val, delta), n); + v128_t maxval = wasm_i32x4_splat(32767); + v128_t minval = wasm_i16x8_splat(-32768); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i32x4_gt(b1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval)); + v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i32x4_lt(b1, minval)); + return v_int16x8(wasm_v8x16_shuffle(a3, b3, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} +template +inline v_uint32x4 v_rshr_pack(const v_uint64x2& a, const v_uint64x2& b) +{ + v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1))); + v128_t a1 = wasm_u64x2_shr(wasm_i64x2_add(a.val, delta), n); + v128_t b1 = wasm_u64x2_shr(wasm_i64x2_add(b.val, delta), n); + return v_uint32x4(wasm_v8x16_shuffle(a1, b1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27)); +} +template +inline v_int32x4 v_rshr_pack(const v_int64x2& a, const v_int64x2& b) +{ + v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1))); + v128_t a1 = wasm_i64x2_shr(wasm_i64x2_add(a.val, delta), n); + v128_t b1 = wasm_i64x2_shr(wasm_i64x2_add(b.val, delta), n); + return v_int32x4(wasm_v8x16_shuffle(a1, b1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27)); +} +template +inline v_uint8x16 v_rshr_pack_u(const v_int16x8& a, const v_int16x8& b) +{ + v128_t delta = wasm_i16x8_splat(((short)1 << (n-1))); + v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t b1 = wasm_i16x8_shr(wasm_i16x8_add(b.val, delta), n); + v128_t maxval = wasm_i16x8_splat(255); + v128_t minval = wasm_i16x8_splat(0); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i16x8_gt(b1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval)); + v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i16x8_lt(b1, minval)); + return v_uint8x16(wasm_v8x16_shuffle(a3, b3, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} +template +inline v_uint16x8 v_rshr_pack_u(const v_int32x4& a, const v_int32x4& b) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t b1 = wasm_i32x4_shr(wasm_i32x4_add(b.val, delta), n); + v128_t maxval = wasm_i32x4_splat(65535); + v128_t minval = wasm_i16x8_splat(0); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval)); + v128_t b2 = wasm_v128_bitselect(maxval, b1, wasm_i32x4_gt(b1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval)); + v128_t b3 = wasm_v128_bitselect(minval, b2, wasm_i32x4_lt(b1, minval)); + return v_uint16x8(wasm_v8x16_shuffle(a3, b3, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29)); +} + +inline void v_pack_store(uchar* ptr, const v_uint16x8& a) +{ + v128_t maxval = wasm_i16x8_splat(255); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval)); + v128_t r = wasm_v8x16_shuffle(a1, a1, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + uchar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_store(schar* ptr, const v_int16x8& a) +{ + v128_t maxval = wasm_i16x8_splat(127); + v128_t minval = wasm_i16x8_splat(-128); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + schar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_store(ushort* ptr, const v_uint32x4& a) +{ + v128_t maxval = wasm_i32x4_splat(65535); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval)); + v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + ushort t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_store(short* ptr, const v_int32x4& a) +{ + v128_t maxval = wasm_i32x4_splat(32767); + v128_t minval = wasm_i32x4_splat(-32768); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + short t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_store(unsigned* ptr, const v_uint64x2& a) +{ + v128_t r = wasm_v8x16_shuffle(a.val, a.val, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11); + unsigned t_ptr[4]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<2; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_store(int* ptr, const v_int64x2& a) +{ + v128_t r = wasm_v8x16_shuffle(a.val, a.val, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11); + int t_ptr[4]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<2; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_u_store(uchar* ptr, const v_int16x8& a) +{ + v128_t maxval = wasm_i16x8_splat(255); + v128_t minval = wasm_i16x8_splat(0); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i16x8_gt(a.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i16x8_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + uchar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +inline void v_pack_u_store(ushort* ptr, const v_int32x4& a) +{ + v128_t maxval = wasm_i32x4_splat(65535); + v128_t minval = wasm_i32x4_splat(0); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_i32x4_gt(a.val, maxval)); + v128_t a2 = wasm_v128_bitselect(minval, a1, wasm_i32x4_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + ushort t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} + +template +inline void v_rshr_pack_store(uchar* ptr, const v_uint16x8& a) +{ + v128_t delta = wasm_i16x8_splat((short)(1 << (n-1))); + v128_t a1 = wasm_u16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t maxval = wasm_i16x8_splat(255); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u16x8_gt(a1, maxval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + uchar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_store(schar* ptr, const v_int16x8& a) +{ + v128_t delta = wasm_i16x8_splat(((short)1 << (n-1))); + v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t maxval = wasm_i16x8_splat(127); + v128_t minval = wasm_i16x8_splat(-128); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a3, a3, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + schar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_store(ushort* ptr, const v_uint32x4& a) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_u32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t maxval = wasm_i32x4_splat(65535); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_u32x4_gt(a1, maxval)); + v128_t r = wasm_v8x16_shuffle(a2, a2, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + ushort t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_store(short* ptr, const v_int32x4& a) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t maxval = wasm_i32x4_splat(32767); + v128_t minval = wasm_i32x4_splat(-32768); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a3, a3, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + short t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_store(unsigned* ptr, const v_uint64x2& a) +{ + v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1))); + v128_t a1 = wasm_u64x2_shr(wasm_i64x2_add(a.val, delta), n); + v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11); + unsigned t_ptr[4]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<2; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_store(int* ptr, const v_int64x2& a) +{ + v128_t delta = wasm_i64x2_splat(((int64)1 << (n-1))); + v128_t a1 = wasm_i64x2_shr(wasm_i64x2_add(a.val, delta), n); + v128_t r = wasm_v8x16_shuffle(a1, a1, 0,1,2,3,8,9,10,11,0,1,2,3,8,9,10,11); + int t_ptr[4]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<2; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_u_store(uchar* ptr, const v_int16x8& a) +{ + v128_t delta = wasm_i16x8_splat(((short)1 << (n-1))); + v128_t a1 = wasm_i16x8_shr(wasm_i16x8_add(a.val, delta), n); + v128_t maxval = wasm_i16x8_splat(255); + v128_t minval = wasm_i16x8_splat(0); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i16x8_gt(a1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i16x8_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a3, a3, 0,2,4,6,8,10,12,14,0,2,4,6,8,10,12,14); + uchar t_ptr[16]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<8; ++i) { + ptr[i] = t_ptr[i]; + } +} +template +inline void v_rshr_pack_u_store(ushort* ptr, const v_int32x4& a) +{ + v128_t delta = wasm_i32x4_splat(((int)1 << (n-1))); + v128_t a1 = wasm_i32x4_shr(wasm_i32x4_add(a.val, delta), n); + v128_t maxval = wasm_i32x4_splat(65535); + v128_t minval = wasm_i32x4_splat(0); + v128_t a2 = wasm_v128_bitselect(maxval, a1, wasm_i32x4_gt(a1, maxval)); + v128_t a3 = wasm_v128_bitselect(minval, a2, wasm_i32x4_lt(a1, minval)); + v128_t r = wasm_v8x16_shuffle(a3, a3, 0,1,4,5,8,9,12,13,0,1,4,5,8,9,12,13); + ushort t_ptr[8]; + wasm_v128_store(t_ptr, r); + for (int i=0; i<4; ++i) { + ptr[i] = t_ptr[i]; + } +} + +inline v_uint8x16 v_pack_b(const v_uint16x8& a, const v_uint16x8& b) +{ + v128_t maxval = wasm_i16x8_splat(255); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u16x8_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u16x8_gt(b.val, maxval)); + return v_uint8x16(wasm_v8x16_shuffle(a1, b1, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30)); +} + +inline v_uint8x16 v_pack_b(const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c, const v_uint32x4& d) +{ + v128_t maxval = wasm_i32x4_splat(255); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, wasm_u32x4_gt(a.val, maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, wasm_u32x4_gt(b.val, maxval)); + v128_t c1 = wasm_v128_bitselect(maxval, c.val, wasm_u32x4_gt(c.val, maxval)); + v128_t d1 = wasm_v128_bitselect(maxval, d.val, wasm_u32x4_gt(d.val, maxval)); + v128_t ab = wasm_v8x16_shuffle(a1, b1, 0,4,8,12,16,20,24,28,0,4,8,12,16,20,24,28); + v128_t cd = wasm_v8x16_shuffle(c1, d1, 0,4,8,12,16,20,24,28,0,4,8,12,16,20,24,28); + return v_uint8x16(wasm_v8x16_shuffle(ab, cd, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23)); +} + +inline v_uint8x16 v_pack_b(const v_uint64x2& a, const v_uint64x2& b, const v_uint64x2& c, + const v_uint64x2& d, const v_uint64x2& e, const v_uint64x2& f, + const v_uint64x2& g, const v_uint64x2& h) +{ + v128_t maxval = wasm_i32x4_splat(255); + v128_t a1 = wasm_v128_bitselect(maxval, a.val, ((__u64x2)(a.val) > (__u64x2)maxval)); + v128_t b1 = wasm_v128_bitselect(maxval, b.val, ((__u64x2)(b.val) > (__u64x2)maxval)); + v128_t c1 = wasm_v128_bitselect(maxval, c.val, ((__u64x2)(c.val) > (__u64x2)maxval)); + v128_t d1 = wasm_v128_bitselect(maxval, d.val, ((__u64x2)(d.val) > (__u64x2)maxval)); + v128_t e1 = wasm_v128_bitselect(maxval, e.val, ((__u64x2)(e.val) > (__u64x2)maxval)); + v128_t f1 = wasm_v128_bitselect(maxval, f.val, ((__u64x2)(f.val) > (__u64x2)maxval)); + v128_t g1 = wasm_v128_bitselect(maxval, g.val, ((__u64x2)(g.val) > (__u64x2)maxval)); + v128_t h1 = wasm_v128_bitselect(maxval, h.val, ((__u64x2)(h.val) > (__u64x2)maxval)); + v128_t ab = wasm_v8x16_shuffle(a1, b1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24); + v128_t cd = wasm_v8x16_shuffle(c1, d1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24); + v128_t ef = wasm_v8x16_shuffle(e1, f1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24); + v128_t gh = wasm_v8x16_shuffle(g1, h1, 0,8,16,24,0,8,16,24,0,8,16,24,0,8,16,24); + v128_t abcd = wasm_v8x16_shuffle(ab, cd, 0,1,2,3,16,17,18,19,0,1,2,3,16,17,18,19); + v128_t efgh = wasm_v8x16_shuffle(ef, gh, 0,1,2,3,16,17,18,19,0,1,2,3,16,17,18,19); + return v_uint8x16(wasm_v8x16_shuffle(abcd, efgh, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23)); +} + +inline v_float32x4 v_matmul(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& m3) +{ + v128_t v0 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 0)); + v128_t v1 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 1)); + v128_t v2 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 2)); + v128_t v3 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 3)); + v0 = wasm_f32x4_mul(v0, m0.val); + v1 = wasm_f32x4_mul(v1, m1.val); + v2 = wasm_f32x4_mul(v2, m2.val); + v3 = wasm_f32x4_mul(v3, m3.val); + + return v_float32x4(wasm_f32x4_add(wasm_f32x4_add(v0, v1), wasm_f32x4_add(v2, v3))); +} + +inline v_float32x4 v_matmuladd(const v_float32x4& v, const v_float32x4& m0, + const v_float32x4& m1, const v_float32x4& m2, + const v_float32x4& a) +{ + v128_t v0 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 0)); + v128_t v1 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 1)); + v128_t v2 = wasm_f32x4_splat(wasm_f32x4_extract_lane(v.val, 2)); + v0 = wasm_f32x4_mul(v0, m0.val); + v1 = wasm_f32x4_mul(v1, m1.val); + v2 = wasm_f32x4_mul(v2, m2.val); + + return v_float32x4(wasm_f32x4_add(wasm_f32x4_add(v0, v1), wasm_f32x4_add(v2, a.val))); +} + +#define OPENCV_HAL_IMPL_WASM_BIN_OP(bin_op, _Tpvec, intrin) \ +inline _Tpvec operator bin_op (const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} \ +inline _Tpvec& operator bin_op##= (_Tpvec& a, const _Tpvec& b) \ +{ \ + a.val = intrin(a.val, b.val); \ + return a; \ +} + +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint8x16, wasm_u8x16_add_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint8x16, wasm_u8x16_sub_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int8x16, wasm_i8x16_add_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int8x16, wasm_i8x16_sub_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint16x8, wasm_u16x8_add_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint16x8, wasm_u16x8_sub_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int16x8, wasm_i16x8_add_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int16x8, wasm_i16x8_sub_saturate) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint32x4, wasm_i32x4_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint32x4, wasm_i32x4_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(*, v_uint32x4, wasm_i32x4_mul) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int32x4, wasm_i32x4_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int32x4, wasm_i32x4_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(*, v_int32x4, wasm_i32x4_mul) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_float32x4, wasm_f32x4_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_float32x4, wasm_f32x4_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(*, v_float32x4, wasm_f32x4_mul) +OPENCV_HAL_IMPL_WASM_BIN_OP(/, v_float32x4, wasm_f32x4_div) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_uint64x2, wasm_i64x2_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_uint64x2, wasm_i64x2_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_int64x2, wasm_i64x2_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_int64x2, wasm_i64x2_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(+, v_float64x2, wasm_f64x2_add) +OPENCV_HAL_IMPL_WASM_BIN_OP(-, v_float64x2, wasm_f64x2_sub) +OPENCV_HAL_IMPL_WASM_BIN_OP(*, v_float64x2, wasm_f64x2_mul) +OPENCV_HAL_IMPL_WASM_BIN_OP(/, v_float64x2, wasm_f64x2_div) + +// saturating multiply 8-bit, 16-bit +#define OPENCV_HAL_IMPL_WASM_MUL_SAT(_Tpvec, _Tpwvec) \ +inline _Tpvec operator * (const _Tpvec& a, const _Tpvec& b) \ +{ \ + _Tpwvec c, d; \ + v_mul_expand(a, b, c, d); \ + return v_pack(c, d); \ +} \ +inline _Tpvec& operator *= (_Tpvec& a, const _Tpvec& b) \ +{ a = a * b; return a; } + +OPENCV_HAL_IMPL_WASM_MUL_SAT(v_uint8x16, v_uint16x8) +OPENCV_HAL_IMPL_WASM_MUL_SAT(v_int8x16, v_int16x8) +OPENCV_HAL_IMPL_WASM_MUL_SAT(v_uint16x8, v_uint32x4) +OPENCV_HAL_IMPL_WASM_MUL_SAT(v_int16x8, v_int32x4) + +// Multiply and expand +inline void v_mul_expand(const v_uint8x16& a, const v_uint8x16& b, + v_uint16x8& c, v_uint16x8& d) +{ + v_uint16x8 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c = v_mul_wrap(a0, b0); + d = v_mul_wrap(a1, b1); +} + +inline void v_mul_expand(const v_int8x16& a, const v_int8x16& b, + v_int16x8& c, v_int16x8& d) +{ + v_int16x8 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c = v_mul_wrap(a0, b0); + d = v_mul_wrap(a1, b1); +} + +inline void v_mul_expand(const v_int16x8& a, const v_int16x8& b, + v_int32x4& c, v_int32x4& d) +{ + v_int32x4 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c.val = wasm_i32x4_mul(a0.val, b0.val); + d.val = wasm_i32x4_mul(a1.val, b1.val); +} + +inline void v_mul_expand(const v_uint16x8& a, const v_uint16x8& b, + v_uint32x4& c, v_uint32x4& d) +{ + v_uint32x4 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c.val = wasm_i32x4_mul(a0.val, b0.val); + d.val = wasm_i32x4_mul(a1.val, b1.val); +} + +inline void v_mul_expand(const v_uint32x4& a, const v_uint32x4& b, + v_uint64x2& c, v_uint64x2& d) +{ + v_uint64x2 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + c.val = ((__u64x2)(a0.val) * (__u64x2)(b0.val)); + d.val = ((__u64x2)(a1.val) * (__u64x2)(b1.val)); +} + +inline v_int16x8 v_mul_hi(const v_int16x8& a, const v_int16x8& b) +{ + v_int32x4 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + v128_t c = wasm_i32x4_mul(a0.val, b0.val); + v128_t d = wasm_i32x4_mul(a1.val, b1.val); + return v_int16x8(wasm_v8x16_shuffle(c, d, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31)); +} +inline v_uint16x8 v_mul_hi(const v_uint16x8& a, const v_uint16x8& b) +{ + v_uint32x4 a0, a1, b0, b1; + v_expand(a, a0, a1); + v_expand(b, b0, b1); + v128_t c = wasm_i32x4_mul(a0.val, b0.val); + v128_t d = wasm_i32x4_mul(a1.val, b1.val); + return v_uint16x8(wasm_v8x16_shuffle(c, d, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31)); +} + +//////// Dot Product //////// + +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b) +{ + v128_t a0 = wasm_i32x4_shr(wasm_i32x4_shl(a.val, 16), 16); + v128_t a1 = wasm_i32x4_shr(a.val, 16); + v128_t b0 = wasm_i32x4_shr(wasm_i32x4_shl(b.val, 16), 16); + v128_t b1 = wasm_i32x4_shr(b.val, 16); + v128_t c = wasm_i32x4_mul(a0, b0); + v128_t d = wasm_i32x4_mul(a1, b1); + return v_int32x4(wasm_i32x4_add(c, d)); +} + +inline v_int32x4 v_dotprod(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_dotprod(a, b) + c; } + +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b) +{ + v128_t a0 = wasm_i64x2_shr(wasm_i64x2_shl(a.val, 32), 32); + v128_t a1 = wasm_i64x2_shr(a.val, 32); + v128_t b0 = wasm_i64x2_shr(wasm_i64x2_shl(b.val, 32), 32); + v128_t b1 = wasm_i64x2_shr(b.val, 32); + v128_t c = (v128_t)((__i64x2)a0 * (__i64x2)b0); + v128_t d = (v128_t)((__i64x2)a1 * (__i64x2)b1); + return v_int64x2(wasm_i64x2_add(c, d)); +} +inline v_int64x2 v_dotprod(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ + return v_dotprod(a, b) + c; +} + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b) +{ + v128_t a0 = wasm_u16x8_shr(wasm_i16x8_shl(a.val, 8), 8); + v128_t a1 = wasm_u16x8_shr(a.val, 8); + v128_t b0 = wasm_u16x8_shr(wasm_i16x8_shl(b.val, 8), 8); + v128_t b1 = wasm_u16x8_shr(b.val, 8); + return v_uint32x4(( + v_dotprod(v_int16x8(a0), v_int16x8(b0)) + + v_dotprod(v_int16x8(a1), v_int16x8(b1))).val + ); +} +inline v_uint32x4 v_dotprod_expand(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b) +{ + v128_t a0 = wasm_i16x8_shr(wasm_i16x8_shl(a.val, 8), 8); + v128_t a1 = wasm_i16x8_shr(a.val, 8); + v128_t b0 = wasm_i16x8_shr(wasm_i16x8_shl(b.val, 8), 8); + v128_t b1 = wasm_i16x8_shr(b.val, 8); + return v_int32x4( + v_dotprod(v_int16x8(a0), v_int16x8(b0)) + + v_dotprod(v_int16x8(a1), v_int16x8(b1)) + ); +} +inline v_int32x4 v_dotprod_expand(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand(a, b) + c; } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b) +{ + v128_t a0 = wasm_u32x4_shr(wasm_i32x4_shl(a.val, 16), 16); + v128_t a1 = wasm_u32x4_shr(a.val, 16); + v128_t b0 = wasm_u32x4_shr(wasm_i32x4_shl(b.val, 16), 16); + v128_t b1 = wasm_u32x4_shr(b.val, 16); + return v_uint64x2(( + v_dotprod(v_int32x4(a0), v_int32x4(b0)) + + v_dotprod(v_int32x4(a1), v_int32x4(b1))).val + ); +} +inline v_uint64x2 v_dotprod_expand(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b) +{ + v128_t a0 = wasm_i32x4_shr(wasm_i32x4_shl(a.val, 16), 16); + v128_t a1 = wasm_i32x4_shr(a.val, 16); + v128_t b0 = wasm_i32x4_shr(wasm_i32x4_shl(b.val, 16), 16); + v128_t b1 = wasm_i32x4_shr(b.val, 16); + return v_int64x2(( + v_dotprod(v_int32x4(a0), v_int32x4(b0)) + + v_dotprod(v_int32x4(a1), v_int32x4(b1))) + ); +} + +inline v_int64x2 v_dotprod_expand(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b) +{ return v_cvt_f64(v_dotprod(a, b)); } +inline v_float64x2 v_dotprod_expand(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b) + c; } + +//////// Fast Dot Product //////// + +// 16 >> 32 +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod(a, b); } +inline v_int32x4 v_dotprod_fast(const v_int16x8& a, const v_int16x8& b, const v_int32x4& c) +{ return v_dotprod(a, b, c); } + +// 32 >> 64 +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod(a, b); } +inline v_int64x2 v_dotprod_fast(const v_int32x4& a, const v_int32x4& b, const v_int64x2& c) +{ return v_dotprod(a, b, c); } + +// 8 >> 32 +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b) +{ return v_dotprod_expand(a, b); } +inline v_uint32x4 v_dotprod_expand_fast(const v_uint8x16& a, const v_uint8x16& b, const v_uint32x4& c) +{ return v_dotprod_expand(a, b, c); } +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b) +{ return v_dotprod_expand(a, b); } +inline v_int32x4 v_dotprod_expand_fast(const v_int8x16& a, const v_int8x16& b, const v_int32x4& c) +{ return v_dotprod_expand(a, b, c); } + +// 16 >> 64 +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b) +{ return v_dotprod_expand(a, b); } +inline v_uint64x2 v_dotprod_expand_fast(const v_uint16x8& a, const v_uint16x8& b, const v_uint64x2& c) +{ return v_dotprod_expand(a, b, c); } +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b) +{ return v_dotprod_expand(a, b); } +inline v_int64x2 v_dotprod_expand_fast(const v_int16x8& a, const v_int16x8& b, const v_int64x2& c) +{ return v_dotprod_expand(a, b, c); } + +// 32 >> 64f +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b) +{ return v_dotprod_expand(a, b); } +inline v_float64x2 v_dotprod_expand_fast(const v_int32x4& a, const v_int32x4& b, const v_float64x2& c) +{ return v_dotprod_expand(a, b, c); } + +#define OPENCV_HAL_IMPL_WASM_LOGIC_OP(_Tpvec) \ +OPENCV_HAL_IMPL_WASM_BIN_OP(&, _Tpvec, wasm_v128_and) \ +OPENCV_HAL_IMPL_WASM_BIN_OP(|, _Tpvec, wasm_v128_or) \ +OPENCV_HAL_IMPL_WASM_BIN_OP(^, _Tpvec, wasm_v128_xor) \ +inline _Tpvec operator ~ (const _Tpvec& a) \ +{ \ + return _Tpvec(wasm_v128_not(a.val)); \ +} + +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint8x16) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int8x16) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint16x8) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int16x8) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint32x4) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int32x4) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_uint64x2) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_int64x2) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_float32x4) +OPENCV_HAL_IMPL_WASM_LOGIC_OP(v_float64x2) + +inline v_float32x4 v_sqrt(const v_float32x4& x) +{ + return v_float32x4(wasm_f32x4_sqrt(x.val)); +} + +inline v_float32x4 v_invsqrt(const v_float32x4& x) +{ + const v128_t _1_0 = wasm_f32x4_splat(1.0); + return v_float32x4(wasm_f32x4_div(_1_0, wasm_f32x4_sqrt(x.val))); +} + +inline v_float64x2 v_sqrt(const v_float64x2& x) +{ + return v_float64x2(wasm_f64x2_sqrt(x.val)); +} + +inline v_float64x2 v_invsqrt(const v_float64x2& x) +{ + const v128_t _1_0 = wasm_f64x2_splat(1.0); + return v_float64x2(wasm_f64x2_div(_1_0, wasm_f64x2_sqrt(x.val))); +} + +#define OPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(_Tpuvec, _Tpsvec, suffix, zsuffix, shiftWidth) \ +inline _Tpuvec v_abs(const _Tpsvec& x) \ +{ \ + v128_t s = wasm_##suffix##_shr(x.val, shiftWidth); \ + v128_t f = wasm_##zsuffix##_shr(x.val, shiftWidth); \ + return _Tpuvec(wasm_##zsuffix##_add(wasm_v128_xor(x.val, f), s)); \ +} + +OPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint8x16, v_int8x16, u8x16, i8x16, 7) +OPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint16x8, v_int16x8, u16x8, i16x8, 15) +OPENCV_HAL_IMPL_WASM_ABS_INT_FUNC(v_uint32x4, v_int32x4, u32x4, i32x4, 31) + +inline v_float32x4 v_abs(const v_float32x4& x) +{ return v_float32x4(wasm_f32x4_abs(x.val)); } +inline v_float64x2 v_abs(const v_float64x2& x) +{ + return v_float64x2(wasm_f64x2_abs(x.val)); +} + +// TODO: exp, log, sin, cos + +#define OPENCV_HAL_IMPL_WASM_BIN_FUNC(_Tpvec, func, intrin) \ +inline _Tpvec func(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(intrin(a.val, b.val)); \ +} + +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float32x4, v_min, wasm_f32x4_min) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float32x4, v_max, wasm_f32x4_max) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float64x2, v_min, wasm_f64x2_min) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_float64x2, v_max, wasm_f64x2_max) + +#define OPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(_Tpvec, suffix) \ +inline _Tpvec v_min(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(wasm_v128_bitselect(b.val, a.val, wasm_##suffix##_gt(a.val, b.val))); \ +} \ +inline _Tpvec v_max(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(wasm_v128_bitselect(a.val, b.val, wasm_##suffix##_gt(a.val, b.val))); \ +} + +OPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int8x16, i8x16) +OPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int16x8, i16x8) +OPENCV_HAL_IMPL_WASM_MINMAX_S_INIT_FUNC(v_int32x4, i32x4) + +#define OPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(_Tpvec, suffix, deltaNum) \ +inline _Tpvec v_min(const _Tpvec& a, const _Tpvec& b) \ +{ \ + v128_t delta = wasm_##suffix##_splat(deltaNum); \ + v128_t mask = wasm_##suffix##_gt(wasm_v128_xor(a.val, delta), wasm_v128_xor(b.val, delta)); \ + return _Tpvec(wasm_v128_bitselect(b.val, a.val, mask)); \ +} \ +inline _Tpvec v_max(const _Tpvec& a, const _Tpvec& b) \ +{ \ + v128_t delta = wasm_##suffix##_splat(deltaNum); \ + v128_t mask = wasm_##suffix##_gt(wasm_v128_xor(a.val, delta), wasm_v128_xor(b.val, delta)); \ + return _Tpvec(wasm_v128_bitselect(a.val, b.val, mask)); \ +} + +OPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint8x16, i8x16, (schar)0x80) +OPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint16x8, i16x8, (short)0x8000) +OPENCV_HAL_IMPL_WASM_MINMAX_U_INIT_FUNC(v_uint32x4, i32x4, (int)0x80000000) + +#define OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(_Tpvec, suffix, esuffix) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##esuffix##_eq(a.val, b.val)); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##esuffix##_ne(a.val, b.val)); } \ +inline _Tpvec operator < (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##suffix##_lt(a.val, b.val)); } \ +inline _Tpvec operator > (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##suffix##_gt(a.val, b.val)); } \ +inline _Tpvec operator <= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##suffix##_le(a.val, b.val)); } \ +inline _Tpvec operator >= (const _Tpvec& a, const _Tpvec& b) \ +{ return _Tpvec(wasm_##suffix##_ge(a.val, b.val)); } + +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint8x16, u8x16, i8x16) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int8x16, i8x16, i8x16) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint16x8, u16x8, i16x8) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int16x8, i16x8, i16x8) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_uint32x4, u32x4, i32x4) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_int32x4, i32x4, i32x4) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_float32x4, f32x4, f32x4) +OPENCV_HAL_IMPL_WASM_INIT_CMP_OP(v_float64x2, f64x2, f64x2) + +#define OPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(_Tpvec, cast) \ +inline _Tpvec operator == (const _Tpvec& a, const _Tpvec& b) \ +{ return cast(v_reinterpret_as_f64(a) == v_reinterpret_as_f64(b)); } \ +inline _Tpvec operator != (const _Tpvec& a, const _Tpvec& b) \ +{ return cast(v_reinterpret_as_f64(a) != v_reinterpret_as_f64(b)); } + +OPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(v_uint64x2, v_reinterpret_as_u64) +OPENCV_HAL_IMPL_WASM_64BIT_CMP_OP(v_int64x2, v_reinterpret_as_s64) + +inline v_float32x4 v_not_nan(const v_float32x4& a) +{ + v128_t z = wasm_i32x4_splat(0x7fffffff); + v128_t t = wasm_i32x4_splat(0x7f800000); + return v_float32x4(wasm_u32x4_lt(wasm_v128_and(a.val, z), t)); +} +inline v_float64x2 v_not_nan(const v_float64x2& a) +{ + v128_t z = wasm_i64x2_splat(0x7fffffffffffffff); + v128_t t = wasm_i64x2_splat(0x7ff0000000000000); + return v_float64x2((__u64x2)(wasm_v128_and(a.val, z)) < (__u64x2)t); +} + +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_add_wrap, wasm_i8x16_add) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_add_wrap, wasm_i8x16_add) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_add_wrap, wasm_i16x8_add) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_add_wrap, wasm_i16x8_add) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_sub_wrap, wasm_i8x16_sub) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_sub_wrap, wasm_i8x16_sub) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_sub_wrap, wasm_i16x8_sub) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_sub_wrap, wasm_i16x8_sub) +#if (__EMSCRIPTEN_major__ * 1000000 + __EMSCRIPTEN_minor__ * 1000 + __EMSCRIPTEN_tiny__) >= (1039012) +// details: https://github.com/opencv/opencv/issues/18097 ( https://github.com/emscripten-core/emscripten/issues/12018 ) +// 1.39.12: https://github.com/emscripten-core/emscripten/commit/cd801d0f110facfd694212a3c8b2ed2ffcd630e2 +inline v_uint8x16 v_mul_wrap(const v_uint8x16& a, const v_uint8x16& b) +{ + uchar a_[16], b_[16]; + wasm_v128_store(a_, a.val); + wasm_v128_store(b_, b.val); + for (int i = 0; i < 16; i++) + a_[i] = (uchar)(a_[i] * b_[i]); + return v_uint8x16(wasm_v128_load(a_)); +} +inline v_int8x16 v_mul_wrap(const v_int8x16& a, const v_int8x16& b) +{ + schar a_[16], b_[16]; + wasm_v128_store(a_, a.val); + wasm_v128_store(b_, b.val); + for (int i = 0; i < 16; i++) + a_[i] = (schar)(a_[i] * b_[i]); + return v_int8x16(wasm_v128_load(a_)); +} +#else +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint8x16, v_mul_wrap, wasm_i8x16_mul) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int8x16, v_mul_wrap, wasm_i8x16_mul) +#endif +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_uint16x8, v_mul_wrap, wasm_i16x8_mul) +OPENCV_HAL_IMPL_WASM_BIN_FUNC(v_int16x8, v_mul_wrap, wasm_i16x8_mul) + + +/** Absolute difference **/ + +inline v_uint8x16 v_absdiff(const v_uint8x16& a, const v_uint8x16& b) +{ return v_add_wrap(a - b, b - a); } +inline v_uint16x8 v_absdiff(const v_uint16x8& a, const v_uint16x8& b) +{ return v_add_wrap(a - b, b - a); } +inline v_uint32x4 v_absdiff(const v_uint32x4& a, const v_uint32x4& b) +{ return v_max(a, b) - v_min(a, b); } + +inline v_uint8x16 v_absdiff(const v_int8x16& a, const v_int8x16& b) +{ + v_int8x16 d = v_sub_wrap(a, b); + v_int8x16 m = a < b; + return v_reinterpret_as_u8(v_sub_wrap(d ^ m, m)); +} +inline v_uint16x8 v_absdiff(const v_int16x8& a, const v_int16x8& b) +{ + return v_reinterpret_as_u16(v_sub_wrap(v_max(a, b), v_min(a, b))); +} +inline v_uint32x4 v_absdiff(const v_int32x4& a, const v_int32x4& b) +{ + v_int32x4 d = a - b; + v_int32x4 m = a < b; + return v_reinterpret_as_u32((d ^ m) - m); +} + +/** Saturating absolute difference **/ +inline v_int8x16 v_absdiffs(const v_int8x16& a, const v_int8x16& b) +{ + v_int8x16 d = a - b; + v_int8x16 m = a < b; + return (d ^ m) - m; + } +inline v_int16x8 v_absdiffs(const v_int16x8& a, const v_int16x8& b) +{ return v_max(a, b) - v_min(a, b); } + + +inline v_int32x4 v_fma(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c) +{ + return a * b + c; +} + +inline v_int32x4 v_muladd(const v_int32x4& a, const v_int32x4& b, const v_int32x4& c) +{ + return v_fma(a, b, c); +} + +inline v_float32x4 v_fma(const v_float32x4& a, const v_float32x4& b, const v_float32x4& c) +{ + return a * b + c; +} + +inline v_float64x2 v_fma(const v_float64x2& a, const v_float64x2& b, const v_float64x2& c) +{ + return a * b + c; +} + +inline v_float32x4 v_absdiff(const v_float32x4& a, const v_float32x4& b) +{ + v128_t absmask_vec = wasm_i32x4_splat(0x7fffffff); + return v_float32x4(wasm_v128_and(wasm_f32x4_sub(a.val, b.val), absmask_vec)); +} +inline v_float64x2 v_absdiff(const v_float64x2& a, const v_float64x2& b) +{ + v128_t absmask_vec = wasm_u64x2_shr(wasm_i32x4_splat(-1), 1); + return v_float64x2(wasm_v128_and(wasm_f64x2_sub(a.val, b.val), absmask_vec)); +} + +#define OPENCV_HAL_IMPL_WASM_MISC_FLT_OP(_Tpvec, suffix) \ +inline _Tpvec v_magnitude(const _Tpvec& a, const _Tpvec& b) \ +{ \ + v128_t a_Square = wasm_##suffix##_mul(a.val, a.val); \ + v128_t b_Square = wasm_##suffix##_mul(b.val, b.val); \ + return _Tpvec(wasm_##suffix##_sqrt(wasm_##suffix##_add(a_Square, b_Square))); \ +} \ +inline _Tpvec v_sqr_magnitude(const _Tpvec& a, const _Tpvec& b) \ +{ \ + v128_t a_Square = wasm_##suffix##_mul(a.val, a.val); \ + v128_t b_Square = wasm_##suffix##_mul(b.val, b.val); \ + return _Tpvec(wasm_##suffix##_add(a_Square, b_Square)); \ +} \ +inline _Tpvec v_muladd(const _Tpvec& a, const _Tpvec& b, const _Tpvec& c) \ +{ \ + return _Tpvec(wasm_##suffix##_add(wasm_##suffix##_mul(a.val, b.val), c.val)); \ +} + +OPENCV_HAL_IMPL_WASM_MISC_FLT_OP(v_float32x4, f32x4) +OPENCV_HAL_IMPL_WASM_MISC_FLT_OP(v_float64x2, f64x2) + +#define OPENCV_HAL_IMPL_WASM_SHIFT_OP(_Tpuvec, _Tpsvec, suffix, ssuffix) \ +inline _Tpuvec operator << (const _Tpuvec& a, int imm) \ +{ \ + return _Tpuvec(wasm_##suffix##_shl(a.val, imm)); \ +} \ +inline _Tpsvec operator << (const _Tpsvec& a, int imm) \ +{ \ + return _Tpsvec(wasm_##suffix##_shl(a.val, imm)); \ +} \ +inline _Tpuvec operator >> (const _Tpuvec& a, int imm) \ +{ \ + return _Tpuvec(wasm_##ssuffix##_shr(a.val, imm)); \ +} \ +inline _Tpsvec operator >> (const _Tpsvec& a, int imm) \ +{ \ + return _Tpsvec(wasm_##suffix##_shr(a.val, imm)); \ +} \ +template \ +inline _Tpuvec v_shl(const _Tpuvec& a) \ +{ \ + return _Tpuvec(wasm_##suffix##_shl(a.val, imm)); \ +} \ +template \ +inline _Tpsvec v_shl(const _Tpsvec& a) \ +{ \ + return _Tpsvec(wasm_##suffix##_shl(a.val, imm)); \ +} \ +template \ +inline _Tpuvec v_shr(const _Tpuvec& a) \ +{ \ + return _Tpuvec(wasm_##ssuffix##_shr(a.val, imm)); \ +} \ +template \ +inline _Tpsvec v_shr(const _Tpsvec& a) \ +{ \ + return _Tpsvec(wasm_##suffix##_shr(a.val, imm)); \ +} + +OPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint8x16, v_int8x16, i8x16, u8x16) +OPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint16x8, v_int16x8, i16x8, u16x8) +OPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint32x4, v_int32x4, i32x4, u32x4) +OPENCV_HAL_IMPL_WASM_SHIFT_OP(v_uint64x2, v_int64x2, i64x2, u64x2) + +namespace hal_wasm_internal +{ + template 16)), + bool is_first = (imm == 0), + bool is_second = (imm == 16), + bool is_other = (((imm > 0) && (imm < 16)))> + class v_wasm_palignr_u8_class; + + template + class v_wasm_palignr_u8_class; + + template + class v_wasm_palignr_u8_class + { + public: + inline v128_t operator()(const v128_t& a, const v128_t&) const + { + return a; + } + }; + + template + class v_wasm_palignr_u8_class + { + public: + inline v128_t operator()(const v128_t&, const v128_t& b) const + { + return b; + } + }; + + template + class v_wasm_palignr_u8_class + { + public: + inline v128_t operator()(const v128_t& a, const v128_t& b) const + { + enum { imm2 = (sizeof(v128_t) - imm) }; + return wasm_v8x16_shuffle(a, b, + imm, imm+1, imm+2, imm+3, + imm+4, imm+5, imm+6, imm+7, + imm+8, imm+9, imm+10, imm+11, + imm+12, imm+13, imm+14, imm+15); + } + }; + + template + inline v128_t v_wasm_palignr_u8(const v128_t& a, const v128_t& b) + { + CV_StaticAssert((imm >= 0) && (imm <= 16), "Invalid imm for v_wasm_palignr_u8."); + return v_wasm_palignr_u8_class()(a, b); + } +} + +template +inline _Tpvec v_rotate_right(const _Tpvec &a) +{ + using namespace hal_wasm_internal; + enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) }; + v128_t z = wasm_i8x16_splat(0); + return _Tpvec(v_wasm_palignr_u8(a.val, z)); +} + +template +inline _Tpvec v_rotate_left(const _Tpvec &a) +{ + using namespace hal_wasm_internal; + enum { imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type)) }; + v128_t z = wasm_i8x16_splat(0); + return _Tpvec(v_wasm_palignr_u8(z, a.val)); +} + +template +inline _Tpvec v_rotate_right(const _Tpvec &a, const _Tpvec &b) +{ + using namespace hal_wasm_internal; + enum { imm2 = (imm * sizeof(typename _Tpvec::lane_type)) }; + return _Tpvec(v_wasm_palignr_u8(a.val, b.val)); +} + +template +inline _Tpvec v_rotate_left(const _Tpvec &a, const _Tpvec &b) +{ + using namespace hal_wasm_internal; + enum { imm2 = ((_Tpvec::nlanes - imm) * sizeof(typename _Tpvec::lane_type)) }; + return _Tpvec(v_wasm_palignr_u8(b.val, a.val)); +} + +#define OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(_Tpvec, _Tp) \ +inline _Tpvec v_load(const _Tp* ptr) \ +{ return _Tpvec(wasm_v128_load(ptr)); } \ +inline _Tpvec v_load_aligned(const _Tp* ptr) \ +{ return _Tpvec(wasm_v128_load(ptr)); } \ +inline _Tpvec v_load_low(const _Tp* ptr) \ +{ \ + _Tp tmp[_Tpvec::nlanes] = {0}; \ + for (int i=0; i<_Tpvec::nlanes/2; ++i) { \ + tmp[i] = ptr[i]; \ + } \ + return _Tpvec(wasm_v128_load(tmp)); \ +} \ +inline _Tpvec v_load_halves(const _Tp* ptr0, const _Tp* ptr1) \ +{ \ + _Tp tmp[_Tpvec::nlanes]; \ + for (int i=0; i<_Tpvec::nlanes/2; ++i) { \ + tmp[i] = ptr0[i]; \ + tmp[i+_Tpvec::nlanes/2] = ptr1[i]; \ + } \ + return _Tpvec(wasm_v128_load(tmp)); \ +} \ +inline void v_store(_Tp* ptr, const _Tpvec& a) \ +{ wasm_v128_store(ptr, a.val); } \ +inline void v_store_aligned(_Tp* ptr, const _Tpvec& a) \ +{ wasm_v128_store(ptr, a.val); } \ +inline void v_store_aligned_nocache(_Tp* ptr, const _Tpvec& a) \ +{ wasm_v128_store(ptr, a.val); } \ +inline void v_store(_Tp* ptr, const _Tpvec& a, hal::StoreMode /*mode*/) \ +{ \ + wasm_v128_store(ptr, a.val); \ +} \ +inline void v_store_low(_Tp* ptr, const _Tpvec& a) \ +{ \ + _Tpvec::lane_type a_[_Tpvec::nlanes]; \ + wasm_v128_store(a_, a.val); \ + for (int i = 0; i < (_Tpvec::nlanes / 2); i++) \ + ptr[i] = a_[i]; \ +} \ +inline void v_store_high(_Tp* ptr, const _Tpvec& a) \ +{ \ + _Tpvec::lane_type a_[_Tpvec::nlanes]; \ + wasm_v128_store(a_, a.val); \ + for (int i = 0; i < (_Tpvec::nlanes / 2); i++) \ + ptr[i] = a_[i + (_Tpvec::nlanes / 2)]; \ +} + +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint8x16, uchar) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int8x16, schar) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint16x8, ushort) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int16x8, short) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint32x4, unsigned) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int32x4, int) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_uint64x2, uint64) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_int64x2, int64) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_float32x4, float) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INT_OP(v_float64x2, double) + + +/** Reverse **/ +inline v_uint8x16 v_reverse(const v_uint8x16 &a) +{ return v_uint8x16(wasm_v8x16_shuffle(a.val, a.val, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)); } + +inline v_int8x16 v_reverse(const v_int8x16 &a) +{ return v_reinterpret_as_s8(v_reverse(v_reinterpret_as_u8(a))); } + +inline v_uint16x8 v_reverse(const v_uint16x8 &a) +{ return v_uint16x8(wasm_v8x16_shuffle(a.val, a.val, 14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1)); } + +inline v_int16x8 v_reverse(const v_int16x8 &a) +{ return v_reinterpret_as_s16(v_reverse(v_reinterpret_as_u16(a))); } + +inline v_uint32x4 v_reverse(const v_uint32x4 &a) +{ return v_uint32x4(wasm_v8x16_shuffle(a.val, a.val, 12, 13, 14, 15, 8, 9, 10, 11, 4, 5, 6, 7, 0, 1, 2, 3)); } + +inline v_int32x4 v_reverse(const v_int32x4 &a) +{ return v_reinterpret_as_s32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_float32x4 v_reverse(const v_float32x4 &a) +{ return v_reinterpret_as_f32(v_reverse(v_reinterpret_as_u32(a))); } + +inline v_uint64x2 v_reverse(const v_uint64x2 &a) +{ return v_uint64x2(wasm_v8x16_shuffle(a.val, a.val, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7)); } + +inline v_int64x2 v_reverse(const v_int64x2 &a) +{ return v_reinterpret_as_s64(v_reverse(v_reinterpret_as_u64(a))); } + +inline v_float64x2 v_reverse(const v_float64x2 &a) +{ return v_reinterpret_as_f64(v_reverse(v_reinterpret_as_u64(a))); } + + +#define OPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(_Tpvec, scalartype, regtype, suffix, esuffix) \ +inline scalartype v_reduce_sum(const _Tpvec& a) \ +{ \ + regtype val = a.val; \ + val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)); \ + val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 4,5,6,7,8,9,10,11,12,13,14,15,0,1,2,3)); \ + return (scalartype)wasm_##esuffix##_extract_lane(val, 0); \ +} + +OPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_uint32x4, unsigned, v128_t, i32x4, i32x4) +OPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_int32x4, int, v128_t, i32x4, i32x4) +OPENCV_HAL_IMPL_WASM_REDUCE_OP_4_SUM(v_float32x4, float, v128_t, f32x4, f32x4) + +// To do: Optimize v_reduce_sum with wasm intrin. +// Now use fallback implementation as there is no widening op in wasm intrin. + +#define OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(_Tpvec, scalartype) \ +inline scalartype v_reduce_sum(const _Tpvec& a) \ +{ \ + _Tpvec::lane_type a_[_Tpvec::nlanes]; \ + wasm_v128_store(a_, a.val); \ + scalartype c = a_[0]; \ + for (int i = 1; i < _Tpvec::nlanes; i++) \ + c += a_[i]; \ + return c; \ +} + +OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_uint8x16, unsigned) +OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_int8x16, int) +OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_uint16x8, unsigned) +OPENCV_HAL_IMPL_FALLBACK_REDUCE_OP_SUM(v_int16x8, int) + + +#define OPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(_Tpvec, scalartype, regtype, suffix, esuffix) \ +inline scalartype v_reduce_sum(const _Tpvec& a) \ +{ \ + regtype val = a.val; \ + val = wasm_##suffix##_add(val, wasm_v8x16_shuffle(val, val, 8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7)); \ + return (scalartype)wasm_##esuffix##_extract_lane(val, 0); \ +} +OPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_uint64x2, uint64, v128_t, i64x2, i64x2) +OPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_int64x2, int64, v128_t, i64x2, i64x2) +OPENCV_HAL_IMPL_WASM_REDUCE_OP_2_SUM(v_float64x2, double, v128_t, f64x2,f64x2) + +inline v_float32x4 v_reduce_sum4(const v_float32x4& a, const v_float32x4& b, + const v_float32x4& c, const v_float32x4& d) +{ + v128_t ac = wasm_f32x4_add(wasm_unpacklo_i32x4(a.val, c.val), wasm_unpackhi_i32x4(a.val, c.val)); + v128_t bd = wasm_f32x4_add(wasm_unpacklo_i32x4(b.val, d.val), wasm_unpackhi_i32x4(b.val, d.val)); + return v_float32x4(wasm_f32x4_add(wasm_unpacklo_i32x4(ac, bd), wasm_unpackhi_i32x4(ac, bd))); +} + +#define OPENCV_HAL_IMPL_WASM_REDUCE_OP(_Tpvec, scalartype, func, scalar_func) \ +inline scalartype v_reduce_##func(const _Tpvec& a) \ +{ \ + scalartype buf[_Tpvec::nlanes]; \ + v_store(buf, a); \ + scalartype tmp = buf[0]; \ + for (int i=1; i<_Tpvec::nlanes; ++i) { \ + tmp = scalar_func(tmp, buf[i]); \ + } \ + return tmp; \ +} + +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint8x16, uchar, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint8x16, uchar, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int8x16, schar, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int8x16, schar, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint16x8, ushort, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint16x8, ushort, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int16x8, short, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int16x8, short, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint32x4, unsigned, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_uint32x4, unsigned, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int32x4, int, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_int32x4, int, min, std::min) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_float32x4, float, max, std::max) +OPENCV_HAL_IMPL_WASM_REDUCE_OP(v_float32x4, float, min, std::min) + +inline unsigned v_reduce_sad(const v_uint8x16& a, const v_uint8x16& b) +{ + v_uint16x8 l16, h16; + v_uint32x4 l16_l32, l16_h32, h16_l32, h16_h32; + v_expand(v_absdiff(a, b), l16, h16); + v_expand(l16, l16_l32, l16_h32); + v_expand(h16, h16_l32, h16_h32); + return v_reduce_sum(l16_l32+l16_h32+h16_l32+h16_h32); +} +inline unsigned v_reduce_sad(const v_int8x16& a, const v_int8x16& b) +{ + v_uint16x8 l16, h16; + v_uint32x4 l16_l32, l16_h32, h16_l32, h16_h32; + v_expand(v_absdiff(a, b), l16, h16); + v_expand(l16, l16_l32, l16_h32); + v_expand(h16, h16_l32, h16_h32); + return v_reduce_sum(l16_l32+l16_h32+h16_l32+h16_h32); +} +inline unsigned v_reduce_sad(const v_uint16x8& a, const v_uint16x8& b) +{ + v_uint32x4 l, h; + v_expand(v_absdiff(a, b), l, h); + return v_reduce_sum(l + h); +} +inline unsigned v_reduce_sad(const v_int16x8& a, const v_int16x8& b) +{ + v_uint32x4 l, h; + v_expand(v_absdiff(a, b), l, h); + return v_reduce_sum(l + h); +} +inline unsigned v_reduce_sad(const v_uint32x4& a, const v_uint32x4& b) +{ + return v_reduce_sum(v_absdiff(a, b)); +} +inline unsigned v_reduce_sad(const v_int32x4& a, const v_int32x4& b) +{ + return v_reduce_sum(v_absdiff(a, b)); +} +inline float v_reduce_sad(const v_float32x4& a, const v_float32x4& b) +{ + return v_reduce_sum(v_absdiff(a, b)); +} + +inline v_uint8x16 v_popcount(const v_uint8x16& a) +{ + v128_t m1 = wasm_i32x4_splat(0x55555555); + v128_t m2 = wasm_i32x4_splat(0x33333333); + v128_t m4 = wasm_i32x4_splat(0x0f0f0f0f); + v128_t p = a.val; + p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 1), m1), wasm_v128_and(p, m1)); + p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 2), m2), wasm_v128_and(p, m2)); + p = wasm_i32x4_add(wasm_v128_and(wasm_u32x4_shr(p, 4), m4), wasm_v128_and(p, m4)); + return v_uint8x16(p); +} +inline v_uint16x8 v_popcount(const v_uint16x8& a) +{ + v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + return v_reinterpret_as_u16(p) & v_setall_u16(0x00ff); +} +inline v_uint32x4 v_popcount(const v_uint32x4& a) +{ + v_uint8x16 p = v_popcount(v_reinterpret_as_u8(a)); + p += v_rotate_right<1>(p); + p += v_rotate_right<2>(p); + return v_reinterpret_as_u32(p) & v_setall_u32(0x000000ff); +} +inline v_uint64x2 v_popcount(const v_uint64x2& a) +{ + uint64 a_[2], b_[2] = { 0 }; + wasm_v128_store(a_, a.val); + for (int i = 0; i < 16; i++) + b_[i / 8] += popCountTable[((uint8_t*)a_)[i]]; + return v_uint64x2(wasm_v128_load(b_)); +} +inline v_uint8x16 v_popcount(const v_int8x16& a) +{ return v_popcount(v_reinterpret_as_u8(a)); } +inline v_uint16x8 v_popcount(const v_int16x8& a) +{ return v_popcount(v_reinterpret_as_u16(a)); } +inline v_uint32x4 v_popcount(const v_int32x4& a) +{ return v_popcount(v_reinterpret_as_u32(a)); } +inline v_uint64x2 v_popcount(const v_int64x2& a) +{ return v_popcount(v_reinterpret_as_u64(a)); } + +#define OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(_Tpvec, suffix, scalarType) \ +inline int v_signmask(const _Tpvec& a) \ +{ \ + _Tpvec::lane_type a_[_Tpvec::nlanes]; \ + wasm_v128_store(a_, a.val); \ + int mask = 0; \ + for (int i = 0; i < _Tpvec::nlanes; i++) \ + mask |= (reinterpret_int(a_[i]) < 0) << i; \ + return mask; \ +} \ +inline bool v_check_all(const _Tpvec& a) \ +{ return wasm_i8x16_all_true(wasm_##suffix##_lt(a.val, wasm_##suffix##_splat(0))); } \ +inline bool v_check_any(const _Tpvec& a) \ +{ return wasm_i8x16_any_true(wasm_##suffix##_lt(a.val, wasm_##suffix##_splat(0)));; } + +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint8x16, i8x16, schar) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int8x16, i8x16, schar) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint16x8, i16x8, short) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int16x8, i16x8, short) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_uint32x4, i32x4, int) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_int32x4, i32x4, int) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_float32x4, i32x4, float) +OPENCV_HAL_IMPL_WASM_CHECK_SIGNS(v_float64x2, f64x2, double) + +#define OPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(_Tpvec, suffix, esuffix) \ +inline bool v_check_all(const _Tpvec& a) \ +{ \ + v128_t masked = v_reinterpret_as_##esuffix(a).val; \ + masked = wasm_i32x4_replace_lane(masked, 0, 0xffffffff); \ + masked = wasm_i32x4_replace_lane(masked, 2, 0xffffffff); \ + return wasm_i8x16_all_true(wasm_##suffix##_lt(masked, wasm_##suffix##_splat(0))); \ +} \ +inline bool v_check_any(const _Tpvec& a) \ +{ \ + v128_t masked = v_reinterpret_as_##esuffix(a).val; \ + masked = wasm_i32x4_replace_lane(masked, 0, 0x0); \ + masked = wasm_i32x4_replace_lane(masked, 2, 0x0); \ + return wasm_i8x16_any_true(wasm_##suffix##_lt(masked, wasm_##suffix##_splat(0))); \ +} \ + +OPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(v_int64x2, i32x4, s32) +OPENCV_HAL_IMPL_WASM_CHECK_ALL_ANY(v_uint64x2, i32x4, u32) + + +inline int v_scan_forward(const v_int8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_uint8x16& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))); } +inline int v_scan_forward(const v_int16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_uint16x8& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 2; } +inline int v_scan_forward(const v_int32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_uint32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_float32x4& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 4; } +inline int v_scan_forward(const v_int64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_uint64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } +inline int v_scan_forward(const v_float64x2& a) { return trailingZeros32(v_signmask(v_reinterpret_as_s8(a))) / 8; } + +#define OPENCV_HAL_IMPL_WASM_SELECT(_Tpvec) \ +inline _Tpvec v_select(const _Tpvec& mask, const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(wasm_v128_bitselect(a.val, b.val, mask.val)); \ +} + +OPENCV_HAL_IMPL_WASM_SELECT(v_uint8x16) +OPENCV_HAL_IMPL_WASM_SELECT(v_int8x16) +OPENCV_HAL_IMPL_WASM_SELECT(v_uint16x8) +OPENCV_HAL_IMPL_WASM_SELECT(v_int16x8) +OPENCV_HAL_IMPL_WASM_SELECT(v_uint32x4) +OPENCV_HAL_IMPL_WASM_SELECT(v_int32x4) +OPENCV_HAL_IMPL_WASM_SELECT(v_uint64x2) +OPENCV_HAL_IMPL_WASM_SELECT(v_int64x2) +OPENCV_HAL_IMPL_WASM_SELECT(v_float32x4) +OPENCV_HAL_IMPL_WASM_SELECT(v_float64x2) + +#define OPENCV_HAL_IMPL_WASM_EXPAND(_Tpvec, _Tpwvec, _Tp, intrin) \ +inline void v_expand(const _Tpvec& a, _Tpwvec& b0, _Tpwvec& b1) \ +{ \ + b0.val = intrin(a.val); \ + b1.val = __CV_CAT(intrin, _high)(a.val); \ +} \ +inline _Tpwvec v_expand_low(const _Tpvec& a) \ +{ return _Tpwvec(intrin(a.val)); } \ +inline _Tpwvec v_expand_high(const _Tpvec& a) \ +{ return _Tpwvec(__CV_CAT(intrin, _high)(a.val)); } \ +inline _Tpwvec v_load_expand(const _Tp* ptr) \ +{ \ + v128_t a = wasm_v128_load(ptr); \ + return _Tpwvec(intrin(a)); \ +} + +OPENCV_HAL_IMPL_WASM_EXPAND(v_uint8x16, v_uint16x8, uchar, v128_cvtu8x16_i16x8) +OPENCV_HAL_IMPL_WASM_EXPAND(v_int8x16, v_int16x8, schar, v128_cvti8x16_i16x8) +OPENCV_HAL_IMPL_WASM_EXPAND(v_uint16x8, v_uint32x4, ushort, v128_cvtu16x8_i32x4) +OPENCV_HAL_IMPL_WASM_EXPAND(v_int16x8, v_int32x4, short, v128_cvti16x8_i32x4) +OPENCV_HAL_IMPL_WASM_EXPAND(v_uint32x4, v_uint64x2, unsigned, v128_cvtu32x4_i64x2) +OPENCV_HAL_IMPL_WASM_EXPAND(v_int32x4, v_int64x2, int, v128_cvti32x4_i64x2) + +#define OPENCV_HAL_IMPL_WASM_EXPAND_Q(_Tpvec, _Tp, intrin) \ +inline _Tpvec v_load_expand_q(const _Tp* ptr) \ +{ \ + v128_t a = wasm_v128_load(ptr); \ + return _Tpvec(intrin(a)); \ +} + +OPENCV_HAL_IMPL_WASM_EXPAND_Q(v_uint32x4, uchar, v128_cvtu8x16_i32x4) +OPENCV_HAL_IMPL_WASM_EXPAND_Q(v_int32x4, schar, v128_cvti8x16_i32x4) + +#define OPENCV_HAL_IMPL_WASM_UNPACKS(_Tpvec, suffix) \ +inline void v_zip(const _Tpvec& a0, const _Tpvec& a1, _Tpvec& b0, _Tpvec& b1) \ +{ \ + b0.val = wasm_unpacklo_##suffix(a0.val, a1.val); \ + b1.val = wasm_unpackhi_##suffix(a0.val, a1.val); \ +} \ +inline _Tpvec v_combine_low(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(wasm_unpacklo_i64x2(a.val, b.val)); \ +} \ +inline _Tpvec v_combine_high(const _Tpvec& a, const _Tpvec& b) \ +{ \ + return _Tpvec(wasm_unpackhi_i64x2(a.val, b.val)); \ +} \ +inline void v_recombine(const _Tpvec& a, const _Tpvec& b, _Tpvec& c, _Tpvec& d) \ +{ \ + c.val = wasm_unpacklo_i64x2(a.val, b.val); \ + d.val = wasm_unpackhi_i64x2(a.val, b.val); \ +} + +OPENCV_HAL_IMPL_WASM_UNPACKS(v_uint8x16, i8x16) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_int8x16, i8x16) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_uint16x8, i16x8) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_int16x8, i16x8) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_uint32x4, i32x4) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_int32x4, i32x4) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_float32x4, i32x4) +OPENCV_HAL_IMPL_WASM_UNPACKS(v_float64x2, i64x2) + +template +inline _Tpvec v_extract(const _Tpvec& a, const _Tpvec& b) +{ + return v_rotate_right(a, b); +} + +inline v_int32x4 v_round(const v_float32x4& a) +{ + v128_t h = wasm_f32x4_splat(0.5); + return v_int32x4(wasm_i32x4_trunc_saturate_f32x4(wasm_f32x4_add(a.val, h))); +} + +inline v_int32x4 v_floor(const v_float32x4& a) +{ + v128_t a1 = wasm_i32x4_trunc_saturate_f32x4(a.val); + v128_t mask = wasm_f32x4_lt(a.val, wasm_f32x4_convert_i32x4(a1)); + return v_int32x4(wasm_i32x4_add(a1, mask)); +} + +inline v_int32x4 v_ceil(const v_float32x4& a) +{ + v128_t a1 = wasm_i32x4_trunc_saturate_f32x4(a.val); + v128_t mask = wasm_f32x4_gt(a.val, wasm_f32x4_convert_i32x4(a1)); + return v_int32x4(wasm_i32x4_sub(a1, mask)); +} + +inline v_int32x4 v_trunc(const v_float32x4& a) +{ return v_int32x4(wasm_i32x4_trunc_saturate_f32x4(a.val)); } + +#define OPENCV_HAL_IMPL_WASM_MATH_FUNC(func, cfunc) \ +inline v_int32x4 func(const v_float64x2& a) \ +{ \ + double a_[2]; \ + wasm_v128_store(a_, a.val); \ + int c_[4]; \ + c_[0] = cfunc(a_[0]); \ + c_[1] = cfunc(a_[1]); \ + c_[2] = 0; \ + c_[3] = 0; \ + return v_int32x4(wasm_v128_load(c_)); \ +} + +OPENCV_HAL_IMPL_WASM_MATH_FUNC(v_round, cvRound) +OPENCV_HAL_IMPL_WASM_MATH_FUNC(v_floor, cvFloor) +OPENCV_HAL_IMPL_WASM_MATH_FUNC(v_ceil, cvCeil) +OPENCV_HAL_IMPL_WASM_MATH_FUNC(v_trunc, int) + +inline v_int32x4 v_round(const v_float64x2& a, const v_float64x2& b) +{ + double a_[2], b_[2]; + wasm_v128_store(a_, a.val); + wasm_v128_store(b_, b.val); + int c_[4]; + c_[0] = cvRound(a_[0]); + c_[1] = cvRound(a_[1]); + c_[2] = cvRound(b_[0]); + c_[3] = cvRound(b_[1]); + return v_int32x4(wasm_v128_load(c_)); +} + +#define OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(_Tpvec, suffix) \ +inline void v_transpose4x4(const _Tpvec& a0, const _Tpvec& a1, \ + const _Tpvec& a2, const _Tpvec& a3, \ + _Tpvec& b0, _Tpvec& b1, \ + _Tpvec& b2, _Tpvec& b3) \ +{ \ + v128_t t0 = wasm_unpacklo_##suffix(a0.val, a1.val); \ + v128_t t1 = wasm_unpacklo_##suffix(a2.val, a3.val); \ + v128_t t2 = wasm_unpackhi_##suffix(a0.val, a1.val); \ + v128_t t3 = wasm_unpackhi_##suffix(a2.val, a3.val); \ +\ + b0.val = wasm_unpacklo_i64x2(t0, t1); \ + b1.val = wasm_unpackhi_i64x2(t0, t1); \ + b2.val = wasm_unpacklo_i64x2(t2, t3); \ + b3.val = wasm_unpackhi_i64x2(t2, t3); \ +} + +OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_uint32x4, i32x4) +OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_int32x4, i32x4) +OPENCV_HAL_IMPL_WASM_TRANSPOSE4x4(v_float32x4, i32x4) + +// load deinterleave +inline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b) +{ + v128_t t00 = wasm_v128_load(ptr); + v128_t t01 = wasm_v128_load(ptr + 16); + + a.val = wasm_v8x16_shuffle(t00, t01, 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30); + b.val = wasm_v8x16_shuffle(t00, t01, 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31); +} + +inline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c) +{ + v128_t t00 = wasm_v128_load(ptr); + v128_t t01 = wasm_v128_load(ptr + 16); + v128_t t02 = wasm_v128_load(ptr + 32); + + v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,3,6,9,12,15,18,21,24,27,30,1,2,4,5,7); + v128_t t11 = wasm_v8x16_shuffle(t00, t01, 1,4,7,10,13,16,19,22,25,28,31,0,2,3,5,6); + v128_t t12 = wasm_v8x16_shuffle(t00, t01, 2,5,8,11,14,17,20,23,26,29,0,1,3,4,6,7); + + a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,17,20,23,26,29); + b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,18,21,24,27,30); + c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,8,9,16,19,22,25,28,31); +} + +inline void v_load_deinterleave(const uchar* ptr, v_uint8x16& a, v_uint8x16& b, v_uint8x16& c, v_uint8x16& d) +{ + v128_t u0 = wasm_v128_load(ptr); // a0 b0 c0 d0 a1 b1 c1 d1 ... + v128_t u1 = wasm_v128_load(ptr + 16); // a4 b4 c4 d4 ... + v128_t u2 = wasm_v128_load(ptr + 32); // a8 b8 c8 d8 ... + v128_t u3 = wasm_v128_load(ptr + 48); // a12 b12 c12 d12 ... + + v128_t v0 = wasm_v8x16_shuffle(u0, u1, 0,4,8,12,16,20,24,28,1,5,9,13,17,21,25,29); + v128_t v1 = wasm_v8x16_shuffle(u2, u3, 0,4,8,12,16,20,24,28,1,5,9,13,17,21,25,29); + v128_t v2 = wasm_v8x16_shuffle(u0, u1, 2,6,10,14,18,22,26,30,3,7,11,15,19,23,27,31); + v128_t v3 = wasm_v8x16_shuffle(u2, u3, 2,6,10,14,18,22,26,30,3,7,11,15,19,23,27,31); + + a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + b.val = wasm_v8x16_shuffle(v0, v1, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); + c.val = wasm_v8x16_shuffle(v2, v3, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + d.val = wasm_v8x16_shuffle(v2, v3, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); +} + +inline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b) +{ + v128_t v0 = wasm_v128_load(ptr); // a0 b0 a1 b1 a2 b2 a3 b3 + v128_t v1 = wasm_v128_load(ptr + 8); // a4 b4 a5 b5 a6 b6 a7 b7 + + a.val = wasm_v8x16_shuffle(v0, v1, 0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29); // a0 a1 a2 a3 a4 a5 a6 a7 + b.val = wasm_v8x16_shuffle(v0, v1, 2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31); // b0 b1 ab b3 b4 b5 b6 b7 +} + +inline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c) +{ + v128_t t00 = wasm_v128_load(ptr); // a0 b0 c0 a1 b1 c1 a2 b2 + v128_t t01 = wasm_v128_load(ptr + 8); // c2 a3 b3 c3 a4 b4 c4 a5 + v128_t t02 = wasm_v128_load(ptr + 16); // b5 c5 a6 b6 c6 a7 b7 c7 + + v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,6,7,12,13,18,19,24,25,30,31,2,3,4,5); + v128_t t11 = wasm_v8x16_shuffle(t00, t01, 2,3,8,9,14,15,20,21,26,27,0,1,4,5,6,7); + v128_t t12 = wasm_v8x16_shuffle(t00, t01, 4,5,10,11,16,17,22,23,28,29,0,1,2,3,6,7); + + a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,26,27); + b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,16,17,22,23,28,29); + c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,8,9,18,19,24,25,30,31); +} + +inline void v_load_deinterleave(const ushort* ptr, v_uint16x8& a, v_uint16x8& b, v_uint16x8& c, v_uint16x8& d) +{ + v128_t u0 = wasm_v128_load(ptr); // a0 b0 c0 d0 a1 b1 c1 d1 + v128_t u1 = wasm_v128_load(ptr + 8); // a2 b2 c2 d2 ... + v128_t u2 = wasm_v128_load(ptr + 16); // a4 b4 c4 d4 ... + v128_t u3 = wasm_v128_load(ptr + 24); // a6 b6 c6 d6 ... + + v128_t v0 = wasm_v8x16_shuffle(u0, u1, 0,1,8,9,16,17,24,25,2,3,10,11,18,19,26,27); // a0 a1 a2 a3 b0 b1 b2 b3 + v128_t v1 = wasm_v8x16_shuffle(u2, u3, 0,1,8,9,16,17,24,25,2,3,10,11,18,19,26,27); // a4 a5 a6 a7 b4 b5 b6 b7 + v128_t v2 = wasm_v8x16_shuffle(u0, u1, 4,5,12,13,20,21,28,29,6,7,14,15,22,23,30,31); // c0 c1 c2 c3 d0 d1 d2 d3 + v128_t v3 = wasm_v8x16_shuffle(u2, u3, 4,5,12,13,20,21,28,29,6,7,14,15,22,23,30,31); // c4 c5 c6 c7 d4 d5 d6 d7 + + a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + b.val = wasm_v8x16_shuffle(v0, v1, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); + c.val = wasm_v8x16_shuffle(v2, v3, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + d.val = wasm_v8x16_shuffle(v2, v3, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); +} + +inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b) +{ + v128_t v0 = wasm_v128_load(ptr); // a0 b0 a1 b1 + v128_t v1 = wasm_v128_load(ptr + 4); // a2 b2 a3 b3 + + a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); // a0 a1 a2 a3 + b.val = wasm_v8x16_shuffle(v0, v1, 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); // b0 b1 b2 b3 +} + +inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c) +{ + v128_t t00 = wasm_v128_load(ptr); // a0 b0 c0 a1 + v128_t t01 = wasm_v128_load(ptr + 4); // b2 c2 a3 b3 + v128_t t02 = wasm_v128_load(ptr + 8); // c3 a4 b4 c4 + + v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,2,3,12,13,14,15,24,25,26,27,4,5,6,7); + v128_t t11 = wasm_v8x16_shuffle(t00, t01, 4,5,6,7,16,17,18,19,28,29,30,31,0,1,2,3); + v128_t t12 = wasm_v8x16_shuffle(t00, t01, 8,9,10,11,20,21,22,23,0,1,2,3,4,5,6,7); + + a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,22,23); + b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,27); + c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,16,17,18,19,28,29,30,31); +} + +inline void v_load_deinterleave(const unsigned* ptr, v_uint32x4& a, v_uint32x4& b, v_uint32x4& c, v_uint32x4& d) +{ + v_uint32x4 s0(wasm_v128_load(ptr)); // a0 b0 c0 d0 + v_uint32x4 s1(wasm_v128_load(ptr + 4)); // a1 b1 c1 d1 + v_uint32x4 s2(wasm_v128_load(ptr + 8)); // a2 b2 c2 d2 + v_uint32x4 s3(wasm_v128_load(ptr + 12)); // a3 b3 c3 d3 + + v_transpose4x4(s0, s1, s2, s3, a, b, c, d); +} + +inline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b) +{ + v128_t v0 = wasm_v128_load(ptr); // a0 b0 a1 b1 + v128_t v1 = wasm_v128_load((ptr + 4)); // a2 b2 a3 b3 + + a.val = wasm_v8x16_shuffle(v0, v1, 0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27); // a0 a1 a2 a3 + b.val = wasm_v8x16_shuffle(v0, v1, 4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31); // b0 b1 b2 b3 +} + +inline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c) +{ + v128_t t00 = wasm_v128_load(ptr); // a0 b0 c0 a1 + v128_t t01 = wasm_v128_load(ptr + 4); // b2 c2 a3 b3 + v128_t t02 = wasm_v128_load(ptr + 8); // c3 a4 b4 c4 + + v128_t t10 = wasm_v8x16_shuffle(t00, t01, 0,1,2,3,12,13,14,15,24,25,26,27,4,5,6,7); + v128_t t11 = wasm_v8x16_shuffle(t00, t01, 4,5,6,7,16,17,18,19,28,29,30,31,0,1,2,3); + v128_t t12 = wasm_v8x16_shuffle(t00, t01, 8,9,10,11,20,21,22,23,0,1,2,3,4,5,6,7); + + a.val = wasm_v8x16_shuffle(t10, t02, 0,1,2,3,4,5,6,7,8,9,10,11,20,21,22,23); + b.val = wasm_v8x16_shuffle(t11, t02, 0,1,2,3,4,5,6,7,8,9,10,11,24,25,26,27); + c.val = wasm_v8x16_shuffle(t12, t02, 0,1,2,3,4,5,6,7,16,17,18,19,28,29,30,31); +} + +inline void v_load_deinterleave(const float* ptr, v_float32x4& a, v_float32x4& b, v_float32x4& c, v_float32x4& d) +{ + v_float32x4 s0(wasm_v128_load(ptr)); // a0 b0 c0 d0 + v_float32x4 s1(wasm_v128_load(ptr + 4)); // a1 b1 c1 d1 + v_float32x4 s2(wasm_v128_load(ptr + 8)); // a2 b2 c2 d2 + v_float32x4 s3(wasm_v128_load(ptr + 12)); // a3 b3 c3 d3 + + v_transpose4x4(s0, s1, s2, s3, a, b, c, d); +} + +inline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b) +{ + v128_t t0 = wasm_v128_load(ptr); // a0 b0 + v128_t t1 = wasm_v128_load(ptr + 2); // a1 b1 + + a.val = wasm_unpacklo_i64x2(t0, t1); + b.val = wasm_unpackhi_i64x2(t0, t1); +} + +inline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, v_uint64x2& b, v_uint64x2& c) +{ + v128_t t0 = wasm_v128_load(ptr); // a0, b0 + v128_t t1 = wasm_v128_load(ptr + 2); // c0, a1 + v128_t t2 = wasm_v128_load(ptr + 4); // b1, c1 + + a.val = wasm_v8x16_shuffle(t0, t1, 0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31); + b.val = wasm_v8x16_shuffle(t0, t2, 8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23); + c.val = wasm_v8x16_shuffle(t1, t2, 0,1,2,3,4,5,6,7,24,25,26,27,28,29,30,31); +} + +inline void v_load_deinterleave(const uint64 *ptr, v_uint64x2& a, + v_uint64x2& b, v_uint64x2& c, v_uint64x2& d) +{ + v128_t t0 = wasm_v128_load(ptr); // a0 b0 + v128_t t1 = wasm_v128_load(ptr + 2); // c0 d0 + v128_t t2 = wasm_v128_load(ptr + 4); // a1 b1 + v128_t t3 = wasm_v128_load(ptr + 6); // c1 d1 + + a.val = wasm_unpacklo_i64x2(t0, t2); + b.val = wasm_unpackhi_i64x2(t0, t2); + c.val = wasm_unpacklo_i64x2(t1, t3); + d.val = wasm_unpackhi_i64x2(t1, t3); +} + +// store interleave + +inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i8x16(a.val, b.val); + v128_t v1 = wasm_unpackhi_i8x16(a.val, b.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 16, v1); +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, + const v_uint8x16& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,16,0,1,17,0,2,18,0,3,19,0,4,20,0,5); + v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 21,0,6,22,0,7,23,0,8,24,0,9,25,0,10,26); + v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,11,27,0,12,28,0,13,29,0,14,30,0,15,31,0); + + v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,16,3,4,17,6,7,18,9,10,19,12,13,20,15); + v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,21,2,3,22,5,6,23,8,9,24,11,12,25,14,15); + v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 26,1,2,27,4,5,28,7,8,29,10,11,30,13,14,31); + + wasm_v128_store(ptr, t10); + wasm_v128_store(ptr + 16, t11); + wasm_v128_store(ptr + 32, t12); +} + +inline void v_store_interleave( uchar* ptr, const v_uint8x16& a, const v_uint8x16& b, + const v_uint8x16& c, const v_uint8x16& d, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + // a0 a1 a2 a3 .... + // b0 b1 b2 b3 .... + // c0 c1 c2 c3 .... + // d0 d1 d2 d3 .... + v128_t u0 = wasm_unpacklo_i8x16(a.val, c.val); // a0 c0 a1 c1 ... + v128_t u1 = wasm_unpackhi_i8x16(a.val, c.val); // a8 c8 a9 c9 ... + v128_t u2 = wasm_unpacklo_i8x16(b.val, d.val); // b0 d0 b1 d1 ... + v128_t u3 = wasm_unpackhi_i8x16(b.val, d.val); // b8 d8 b9 d9 ... + + v128_t v0 = wasm_unpacklo_i8x16(u0, u2); // a0 b0 c0 d0 ... + v128_t v1 = wasm_unpackhi_i8x16(u0, u2); // a4 b4 c4 d4 ... + v128_t v2 = wasm_unpacklo_i8x16(u1, u3); // a8 b8 c8 d8 ... + v128_t v3 = wasm_unpackhi_i8x16(u1, u3); // a12 b12 c12 d12 ... + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 16, v1); + wasm_v128_store(ptr + 32, v2); + wasm_v128_store(ptr + 48, v3); +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i16x8(a.val, b.val); + v128_t v1 = wasm_unpackhi_i16x8(a.val, b.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 8, v1); +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x8& a, + const v_uint16x8& b, const v_uint16x8& c, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,16,17,0,0,2,3,18,19,0,0,4,5,20,21); + v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 0,0,6,7,22,23,0,0,8,9,24,25,0,0,10,11); + v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 26,27,0,0,12,13,28,29,0,0,14,15,30,31,0,0); + + v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,16,17,6,7,8,9,18,19,12,13,14,15); + v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 20,21,2,3,4,5,22,23,8,9,10,11,24,25,14,15); + v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 0,1,26,27,4,5,6,7,28,29,10,11,12,13,30,31); + + wasm_v128_store(ptr, t10); + wasm_v128_store(ptr + 8, t11); + wasm_v128_store(ptr + 16, t12); +} + +inline void v_store_interleave( ushort* ptr, const v_uint16x8& a, const v_uint16x8& b, + const v_uint16x8& c, const v_uint16x8& d, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + // a0 a1 a2 a3 .... + // b0 b1 b2 b3 .... + // c0 c1 c2 c3 .... + // d0 d1 d2 d3 .... + v128_t u0 = wasm_unpacklo_i16x8(a.val, c.val); // a0 c0 a1 c1 ... + v128_t u1 = wasm_unpackhi_i16x8(a.val, c.val); // a4 c4 a5 c5 ... + v128_t u2 = wasm_unpacklo_i16x8(b.val, d.val); // b0 d0 b1 d1 ... + v128_t u3 = wasm_unpackhi_i16x8(b.val, d.val); // b4 d4 b5 d5 ... + + v128_t v0 = wasm_unpacklo_i16x8(u0, u2); // a0 b0 c0 d0 ... + v128_t v1 = wasm_unpackhi_i16x8(u0, u2); // a2 b2 c2 d2 ... + v128_t v2 = wasm_unpacklo_i16x8(u1, u3); // a4 b4 c4 d4 ... + v128_t v3 = wasm_unpackhi_i16x8(u1, u3); // a6 b6 c6 d6 ... + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 8, v1); + wasm_v128_store(ptr + 16, v2); + wasm_v128_store(ptr + 24, v3); +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i32x4(a.val, b.val); + v128_t v1 = wasm_unpackhi_i32x4(a.val, b.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 4, v1); +} + +inline void v_store_interleave( unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,16,17,18,19,0,0,0,0,4,5,6,7); + v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 20,21,22,23,0,0,0,0,8,9,10,11,24,25,26,27); + v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,0,0,0,12,13,14,15,28,29,30,31,0,0,0,0); + + v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,4,5,6,7,16,17,18,19,12,13,14,15); + v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,1,2,3,20,21,22,23,8,9,10,11,12,13,14,15); + v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 24,25,26,27,4,5,6,7,8,9,10,11,28,29,30,31); + + wasm_v128_store(ptr, t10); + wasm_v128_store(ptr + 4, t11); + wasm_v128_store(ptr + 8, t12); +} + +inline void v_store_interleave(unsigned* ptr, const v_uint32x4& a, const v_uint32x4& b, + const v_uint32x4& c, const v_uint32x4& d, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v_uint32x4 v0, v1, v2, v3; + v_transpose4x4(a, b, c, d, v0, v1, v2, v3); + + wasm_v128_store(ptr, v0.val); + wasm_v128_store(ptr + 4, v1.val); + wasm_v128_store(ptr + 8, v2.val); + wasm_v128_store(ptr + 12, v3.val); +} + +// 2-channel, float only +inline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i32x4(a.val, b.val); + v128_t v1 = wasm_unpackhi_i32x4(a.val, b.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 4, v1); +} + +inline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b, + const v_float32x4& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t t00 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,16,17,18,19,0,0,0,0,4,5,6,7); + v128_t t01 = wasm_v8x16_shuffle(a.val, b.val, 20,21,22,23,0,0,0,0,8,9,10,11,24,25,26,27); + v128_t t02 = wasm_v8x16_shuffle(a.val, b.val, 0,0,0,0,12,13,14,15,28,29,30,31,0,0,0,0); + + v128_t t10 = wasm_v8x16_shuffle(t00, c.val, 0,1,2,3,4,5,6,7,16,17,18,19,12,13,14,15); + v128_t t11 = wasm_v8x16_shuffle(t01, c.val, 0,1,2,3,20,21,22,23,8,9,10,11,12,13,14,15); + v128_t t12 = wasm_v8x16_shuffle(t02, c.val, 24,25,26,27,4,5,6,7,8,9,10,11,28,29,30,31); + + wasm_v128_store(ptr, t10); + wasm_v128_store(ptr + 4, t11); + wasm_v128_store(ptr + 8, t12); +} + +inline void v_store_interleave(float* ptr, const v_float32x4& a, const v_float32x4& b, + const v_float32x4& c, const v_float32x4& d, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v_float32x4 v0, v1, v2, v3; + v_transpose4x4(a, b, c, d, v0, v1, v2, v3); + + wasm_v128_store(ptr, v0.val); + wasm_v128_store(ptr + 4, v1.val); + wasm_v128_store(ptr + 8, v2.val); + wasm_v128_store(ptr + 12, v3.val); +} + +inline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i64x2(a.val, b.val); + v128_t v1 = wasm_unpackhi_i64x2(a.val, b.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 2, v1); +} + +inline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b, + const v_uint64x2& c, hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_v8x16_shuffle(a.val, b.val, 0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23); + v128_t v1 = wasm_v8x16_shuffle(a.val, c.val, 16,17,18,19,20,21,22,23,8,9,10,11,12,13,14,15); + v128_t v2 = wasm_v8x16_shuffle(b.val, c.val, 8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 2, v1); + wasm_v128_store(ptr + 4, v2); +} + +inline void v_store_interleave(uint64 *ptr, const v_uint64x2& a, const v_uint64x2& b, + const v_uint64x2& c, const v_uint64x2& d, + hal::StoreMode /*mode*/ = hal::STORE_UNALIGNED) +{ + v128_t v0 = wasm_unpacklo_i64x2(a.val, b.val); + v128_t v1 = wasm_unpacklo_i64x2(c.val, d.val); + v128_t v2 = wasm_unpackhi_i64x2(a.val, b.val); + v128_t v3 = wasm_unpackhi_i64x2(c.val, d.val); + + wasm_v128_store(ptr, v0); + wasm_v128_store(ptr + 2, v1); + wasm_v128_store(ptr + 4, v2); + wasm_v128_store(ptr + 6, v3); +} + +#define OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(_Tpvec0, _Tp0, suffix0, _Tpvec1, _Tp1, suffix1) \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0 ) \ +{ \ + _Tpvec1 a1, b1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ +} \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0 ) \ +{ \ + _Tpvec1 a1, b1, c1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ + c0 = v_reinterpret_as_##suffix0(c1); \ +} \ +inline void v_load_deinterleave( const _Tp0* ptr, _Tpvec0& a0, _Tpvec0& b0, _Tpvec0& c0, _Tpvec0& d0 ) \ +{ \ + _Tpvec1 a1, b1, c1, d1; \ + v_load_deinterleave((const _Tp1*)ptr, a1, b1, c1, d1); \ + a0 = v_reinterpret_as_##suffix0(a1); \ + b0 = v_reinterpret_as_##suffix0(b1); \ + c0 = v_reinterpret_as_##suffix0(c1); \ + d0 = v_reinterpret_as_##suffix0(d1); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \ + hal::StoreMode mode = hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, mode); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \ + const _Tpvec0& c0, hal::StoreMode mode = hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, c1, mode); \ +} \ +inline void v_store_interleave( _Tp0* ptr, const _Tpvec0& a0, const _Tpvec0& b0, \ + const _Tpvec0& c0, const _Tpvec0& d0, \ + hal::StoreMode mode = hal::STORE_UNALIGNED ) \ +{ \ + _Tpvec1 a1 = v_reinterpret_as_##suffix1(a0); \ + _Tpvec1 b1 = v_reinterpret_as_##suffix1(b0); \ + _Tpvec1 c1 = v_reinterpret_as_##suffix1(c0); \ + _Tpvec1 d1 = v_reinterpret_as_##suffix1(d0); \ + v_store_interleave((_Tp1*)ptr, a1, b1, c1, d1, mode); \ +} + +OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int8x16, schar, s8, v_uint8x16, uchar, u8) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int16x8, short, s16, v_uint16x8, ushort, u16) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int32x4, int, s32, v_uint32x4, unsigned, u32) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_int64x2, int64, s64, v_uint64x2, uint64, u64) +OPENCV_HAL_IMPL_WASM_LOADSTORE_INTERLEAVE(v_float64x2, double, f64, v_uint64x2, uint64, u64) + +inline v_float32x4 v_cvt_f32(const v_int32x4& a) +{ + return v_float32x4(wasm_f32x4_convert_i32x4(a.val)); +} + +inline v_float32x4 v_cvt_f32(const v_float64x2& a) +{ + double a_[2]; + wasm_v128_store(a_, a.val); + float c_[4]; + c_[0] = (float)(a_[0]); + c_[1] = (float)(a_[1]); + c_[2] = 0; + c_[3] = 0; + return v_float32x4(wasm_v128_load(c_)); +} + +inline v_float32x4 v_cvt_f32(const v_float64x2& a, const v_float64x2& b) +{ + double a_[2], b_[2]; + wasm_v128_store(a_, a.val); + wasm_v128_store(b_, b.val); + float c_[4]; + c_[0] = (float)(a_[0]); + c_[1] = (float)(a_[1]); + c_[2] = (float)(b_[0]); + c_[3] = (float)(b_[1]); + return v_float32x4(wasm_v128_load(c_)); +} + +inline v_float64x2 v_cvt_f64(const v_int32x4& a) +{ +#ifdef __wasm_unimplemented_simd128__ + v128_t p = v128_cvti32x4_i64x2(a.val); + return v_float64x2(wasm_f64x2_convert_i64x2(p)); +#else + int a_[4]; + wasm_v128_store(a_, a.val); + double c_[2]; + c_[0] = (double)(a_[0]); + c_[1] = (double)(a_[1]); + return v_float64x2(wasm_v128_load(c_)); +#endif +} + +inline v_float64x2 v_cvt_f64_high(const v_int32x4& a) +{ +#ifdef __wasm_unimplemented_simd128__ + v128_t p = v128_cvti32x4_i64x2_high(a.val); + return v_float64x2(wasm_f64x2_convert_i64x2(p)); +#else + int a_[4]; + wasm_v128_store(a_, a.val); + double c_[2]; + c_[0] = (double)(a_[2]); + c_[1] = (double)(a_[3]); + return v_float64x2(wasm_v128_load(c_)); +#endif +} + +inline v_float64x2 v_cvt_f64(const v_float32x4& a) +{ + float a_[4]; + wasm_v128_store(a_, a.val); + double c_[2]; + c_[0] = (double)(a_[0]); + c_[1] = (double)(a_[1]); + return v_float64x2(wasm_v128_load(c_)); +} + +inline v_float64x2 v_cvt_f64_high(const v_float32x4& a) +{ + float a_[4]; + wasm_v128_store(a_, a.val); + double c_[2]; + c_[0] = (double)(a_[2]); + c_[1] = (double)(a_[3]); + return v_float64x2(wasm_v128_load(c_)); +} + +inline v_float64x2 v_cvt_f64(const v_int64x2& a) +{ +#ifdef __wasm_unimplemented_simd128__ + return v_float64x2(wasm_f64x2_convert_i64x2(a.val)); +#else + int64 a_[2]; + wasm_v128_store(a_, a.val); + double c_[2]; + c_[0] = (double)(a_[0]); + c_[1] = (double)(a_[1]); + return v_float64x2(wasm_v128_load(c_)); +#endif +} + +////////////// Lookup table access //////////////////// + +inline v_int8x16 v_lut(const schar* tab, const int* idx) +{ + return v_int8x16(tab[idx[0]], tab[idx[1]], tab[idx[ 2]], tab[idx[ 3]], tab[idx[ 4]], tab[idx[ 5]], tab[idx[ 6]], tab[idx[ 7]], + tab[idx[8]], tab[idx[9]], tab[idx[10]], tab[idx[11]], tab[idx[12]], tab[idx[13]], tab[idx[14]], tab[idx[15]]); +} +inline v_int8x16 v_lut_pairs(const schar* tab, const int* idx) +{ + return v_int8x16(tab[idx[0]], tab[idx[0]+1], tab[idx[1]], tab[idx[1]+1], tab[idx[2]], tab[idx[2]+1], tab[idx[3]], tab[idx[3]+1], + tab[idx[4]], tab[idx[4]+1], tab[idx[5]], tab[idx[5]+1], tab[idx[6]], tab[idx[6]+1], tab[idx[7]], tab[idx[7]+1]); +} +inline v_int8x16 v_lut_quads(const schar* tab, const int* idx) +{ + return v_int8x16(tab[idx[0]], tab[idx[0]+1], tab[idx[0]+2], tab[idx[0]+3], tab[idx[1]], tab[idx[1]+1], tab[idx[1]+2], tab[idx[1]+3], + tab[idx[2]], tab[idx[2]+1], tab[idx[2]+2], tab[idx[2]+3], tab[idx[3]], tab[idx[3]+1], tab[idx[3]+2], tab[idx[3]+3]); +} +inline v_uint8x16 v_lut(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut((const schar *)tab, idx)); } +inline v_uint8x16 v_lut_pairs(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_pairs((const schar *)tab, idx)); } +inline v_uint8x16 v_lut_quads(const uchar* tab, const int* idx) { return v_reinterpret_as_u8(v_lut_quads((const schar *)tab, idx)); } + +inline v_int16x8 v_lut(const short* tab, const int* idx) +{ + return v_int16x8(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]], + tab[idx[4]], tab[idx[5]], tab[idx[6]], tab[idx[7]]); +} +inline v_int16x8 v_lut_pairs(const short* tab, const int* idx) +{ + return v_int16x8(tab[idx[0]], tab[idx[0]+1], tab[idx[1]], tab[idx[1]+1], + tab[idx[2]], tab[idx[2]+1], tab[idx[3]], tab[idx[3]+1]); +} +inline v_int16x8 v_lut_quads(const short* tab, const int* idx) +{ + return v_int16x8(tab[idx[0]], tab[idx[0]+1], tab[idx[0]+2], tab[idx[0]+3], + tab[idx[1]], tab[idx[1]+1], tab[idx[1]+2], tab[idx[1]+3]); +} +inline v_uint16x8 v_lut(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut((const short *)tab, idx)); } +inline v_uint16x8 v_lut_pairs(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_pairs((const short *)tab, idx)); } +inline v_uint16x8 v_lut_quads(const ushort* tab, const int* idx) { return v_reinterpret_as_u16(v_lut_quads((const short *)tab, idx)); } + +inline v_int32x4 v_lut(const int* tab, const int* idx) +{ + return v_int32x4(tab[idx[0]], tab[idx[1]], + tab[idx[2]], tab[idx[3]]); +} +inline v_int32x4 v_lut_pairs(const int* tab, const int* idx) +{ + return v_int32x4(tab[idx[0]], tab[idx[0]+1], + tab[idx[1]], tab[idx[1]+1]); +} +inline v_int32x4 v_lut_quads(const int* tab, const int* idx) +{ + return v_int32x4(wasm_v128_load(tab + idx[0])); +} +inline v_uint32x4 v_lut(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut((const int *)tab, idx)); } +inline v_uint32x4 v_lut_pairs(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_pairs((const int *)tab, idx)); } +inline v_uint32x4 v_lut_quads(const unsigned* tab, const int* idx) { return v_reinterpret_as_u32(v_lut_quads((const int *)tab, idx)); } + +inline v_int64x2 v_lut(const int64_t* tab, const int* idx) +{ + return v_int64x2(tab[idx[0]], tab[idx[1]]); +} +inline v_int64x2 v_lut_pairs(const int64_t* tab, const int* idx) +{ + return v_int64x2(wasm_v128_load(tab + idx[0])); +} +inline v_uint64x2 v_lut(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut((const int64_t *)tab, idx)); } +inline v_uint64x2 v_lut_pairs(const uint64_t* tab, const int* idx) { return v_reinterpret_as_u64(v_lut_pairs((const int64_t *)tab, idx)); } + +inline v_float32x4 v_lut(const float* tab, const int* idx) +{ + return v_float32x4(tab[idx[0]], tab[idx[1]], tab[idx[2]], tab[idx[3]]); +} +inline v_float32x4 v_lut_pairs(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_pairs((const int *)tab, idx)); } +inline v_float32x4 v_lut_quads(const float* tab, const int* idx) { return v_reinterpret_as_f32(v_lut_quads((const int *)tab, idx)); } + +inline v_float64x2 v_lut(const double* tab, const int* idx) +{ + return v_float64x2(tab[idx[0]], tab[idx[1]]); +} +inline v_float64x2 v_lut_pairs(const double* tab, const int* idx) +{ + return v_float64x2(wasm_v128_load(tab + idx[0])); +} + +inline v_int32x4 v_lut(const int* tab, const v_int32x4& idxvec) +{ + return v_int32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)], + tab[wasm_i32x4_extract_lane(idxvec.val, 1)], + tab[wasm_i32x4_extract_lane(idxvec.val, 2)], + tab[wasm_i32x4_extract_lane(idxvec.val, 3)]); +} + +inline v_uint32x4 v_lut(const unsigned* tab, const v_int32x4& idxvec) +{ + return v_reinterpret_as_u32(v_lut((const int *)tab, idxvec)); +} + +inline v_float32x4 v_lut(const float* tab, const v_int32x4& idxvec) +{ + return v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)], + tab[wasm_i32x4_extract_lane(idxvec.val, 1)], + tab[wasm_i32x4_extract_lane(idxvec.val, 2)], + tab[wasm_i32x4_extract_lane(idxvec.val, 3)]); +} + +inline v_float64x2 v_lut(const double* tab, const v_int32x4& idxvec) +{ + return v_float64x2(tab[wasm_i32x4_extract_lane(idxvec.val, 0)], + tab[wasm_i32x4_extract_lane(idxvec.val, 1)]); +} + +// loads pairs from the table and deinterleaves them, e.g. returns: +// x = (tab[idxvec[0], tab[idxvec[1]], tab[idxvec[2]], tab[idxvec[3]]), +// y = (tab[idxvec[0]+1], tab[idxvec[1]+1], tab[idxvec[2]+1], tab[idxvec[3]+1]) +// note that the indices are float's indices, not the float-pair indices. +// in theory, this function can be used to implement bilinear interpolation, +// when idxvec are the offsets within the image. +inline void v_lut_deinterleave(const float* tab, const v_int32x4& idxvec, v_float32x4& x, v_float32x4& y) +{ + x = v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)], + tab[wasm_i32x4_extract_lane(idxvec.val, 1)], + tab[wasm_i32x4_extract_lane(idxvec.val, 2)], + tab[wasm_i32x4_extract_lane(idxvec.val, 3)]); + y = v_float32x4(tab[wasm_i32x4_extract_lane(idxvec.val, 0)+1], + tab[wasm_i32x4_extract_lane(idxvec.val, 1)+1], + tab[wasm_i32x4_extract_lane(idxvec.val, 2)+1], + tab[wasm_i32x4_extract_lane(idxvec.val, 3)+1]); +} + +inline void v_lut_deinterleave(const double* tab, const v_int32x4& idxvec, v_float64x2& x, v_float64x2& y) +{ + v128_t xy0 = wasm_v128_load(tab + wasm_i32x4_extract_lane(idxvec.val, 0)); + v128_t xy1 = wasm_v128_load(tab + wasm_i32x4_extract_lane(idxvec.val, 1)); + x.val = wasm_unpacklo_i64x2(xy0, xy1); + y.val = wasm_unpacklo_i64x2(xy0, xy1); +} + +inline v_int8x16 v_interleave_pairs(const v_int8x16& vec) +{ + return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,2,1,3,4,6,5,7,8,10,9,11,12,14,13,15)); +} +inline v_uint8x16 v_interleave_pairs(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_pairs(v_reinterpret_as_s8(vec))); } +inline v_int8x16 v_interleave_quads(const v_int8x16& vec) +{ + return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,4,1,5,2,6,3,7,8,12,9,13,10,14,11,15)); +} +inline v_uint8x16 v_interleave_quads(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_interleave_quads(v_reinterpret_as_s8(vec))); } + +inline v_int16x8 v_interleave_pairs(const v_int16x8& vec) +{ + return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,4,5,2,3,6,7,8,9,12,13,10,11,14,15)); +} +inline v_uint16x8 v_interleave_pairs(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_pairs(v_reinterpret_as_s16(vec))); } +inline v_int16x8 v_interleave_quads(const v_int16x8& vec) +{ + return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,8,9,2,3,10,11,4,5,12,13,6,7,14,15)); +} +inline v_uint16x8 v_interleave_quads(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_interleave_quads(v_reinterpret_as_s16(vec))); } + +inline v_int32x4 v_interleave_pairs(const v_int32x4& vec) +{ + return v_int32x4(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,8,9,10,11,4,5,6,7,12,13,14,15)); +} +inline v_uint32x4 v_interleave_pairs(const v_uint32x4& vec) { return v_reinterpret_as_u32(v_interleave_pairs(v_reinterpret_as_s32(vec))); } +inline v_float32x4 v_interleave_pairs(const v_float32x4& vec) +{ + return v_float32x4(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,8,9,10,11,4,5,6,7,12,13,14,15)); +} + +inline v_int8x16 v_pack_triplets(const v_int8x16& vec) +{ + return v_int8x16(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,4,5,6,8,9,10,12,13,14,16,16,16,16)); +} +inline v_uint8x16 v_pack_triplets(const v_uint8x16& vec) { return v_reinterpret_as_u8(v_pack_triplets(v_reinterpret_as_s8(vec))); } + +inline v_int16x8 v_pack_triplets(const v_int16x8& vec) +{ + return v_int16x8(wasm_v8x16_shuffle(vec.val, vec.val, 0,1,2,3,4,5,8,9,10,11,12,13,14,15,6,7)); +} +inline v_uint16x8 v_pack_triplets(const v_uint16x8& vec) { return v_reinterpret_as_u16(v_pack_triplets(v_reinterpret_as_s16(vec))); } + +inline v_int32x4 v_pack_triplets(const v_int32x4& vec) { return vec; } +inline v_uint32x4 v_pack_triplets(const v_uint32x4& vec) { return vec; } +inline v_float32x4 v_pack_triplets(const v_float32x4& vec) { return vec; } + +template +inline typename _Tp::lane_type v_extract_n(const _Tp& a) +{ + return v_rotate_right(a).get0(); +} + +template +inline v_uint32x4 v_broadcast_element(const v_uint32x4& a) +{ + return v_setall_u32(v_extract_n(a)); +} +template +inline v_int32x4 v_broadcast_element(const v_int32x4& a) +{ + return v_setall_s32(v_extract_n(a)); +} +template +inline v_float32x4 v_broadcast_element(const v_float32x4& a) +{ + return v_setall_f32(v_extract_n(a)); +} + + +////////////// FP16 support /////////////////////////// + +inline v_float32x4 v_load_expand(const float16_t* ptr) +{ + float a[4]; + for (int i = 0; i < 4; i++) + a[i] = ptr[i]; + return v_float32x4(wasm_v128_load(a)); +} + +inline void v_pack_store(float16_t* ptr, const v_float32x4& v) +{ + double v_[4]; + wasm_v128_store(v_, v.val); + ptr[0] = float16_t(v_[0]); + ptr[1] = float16_t(v_[1]); + ptr[2] = float16_t(v_[2]); + ptr[3] = float16_t(v_[3]); +} + +inline void v_cleanup() {} + +CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END + +//! @endcond + +} + +#endif diff --git a/3rdparty/opencv/include/opencv2/core/hal/msa_macros.h b/3rdparty/opencv/include/opencv2/core/hal/msa_macros.h new file mode 100644 index 0000000..bd6ddb1 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/msa_macros.h @@ -0,0 +1,1558 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_HAL_MSA_MACROS_H +#define OPENCV_CORE_HAL_MSA_MACROS_H + +#ifdef __mips_msa +#include "msa.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Define 64 bits vector types */ +typedef signed char v8i8 __attribute__ ((vector_size(8), aligned(8))); +typedef unsigned char v8u8 __attribute__ ((vector_size(8), aligned(8))); +typedef short v4i16 __attribute__ ((vector_size(8), aligned(8))); +typedef unsigned short v4u16 __attribute__ ((vector_size(8), aligned(8))); +typedef int v2i32 __attribute__ ((vector_size(8), aligned(8))); +typedef unsigned int v2u32 __attribute__ ((vector_size(8), aligned(8))); +typedef long long v1i64 __attribute__ ((vector_size(8), aligned(8))); +typedef unsigned long long v1u64 __attribute__ ((vector_size(8), aligned(8))); +typedef float v2f32 __attribute__ ((vector_size(8), aligned(8))); +typedef double v1f64 __attribute__ ((vector_size(8), aligned(8))); + + +/* Load values from the given memory a 64-bit vector. */ +#define msa_ld1_s8(__a) (*((v8i8*)(__a))) +#define msa_ld1_s16(__a) (*((v4i16*)(__a))) +#define msa_ld1_s32(__a) (*((v2i32*)(__a))) +#define msa_ld1_s64(__a) (*((v1i64*)(__a))) +#define msa_ld1_u8(__a) (*((v8u8*)(__a))) +#define msa_ld1_u16(__a) (*((v4u16*)(__a))) +#define msa_ld1_u32(__a) (*((v2u32*)(__a))) +#define msa_ld1_u64(__a) (*((v1u64*)(__a))) +#define msa_ld1_f32(__a) (*((v2f32*)(__a))) +#define msa_ld1_f64(__a) (*((v1f64*)(__a))) + +/* Load values from the given memory address to a 128-bit vector */ +#define msa_ld1q_s8(__a) ((v16i8)__builtin_msa_ld_b(__a, 0)) +#define msa_ld1q_s16(__a) ((v8i16)__builtin_msa_ld_h(__a, 0)) +#define msa_ld1q_s32(__a) ((v4i32)__builtin_msa_ld_w(__a, 0)) +#define msa_ld1q_s64(__a) ((v2i64)__builtin_msa_ld_d(__a, 0)) +#define msa_ld1q_u8(__a) ((v16u8)__builtin_msa_ld_b(__a, 0)) +#define msa_ld1q_u16(__a) ((v8u16)__builtin_msa_ld_h(__a, 0)) +#define msa_ld1q_u32(__a) ((v4u32)__builtin_msa_ld_w(__a, 0)) +#define msa_ld1q_u64(__a) ((v2u64)__builtin_msa_ld_d(__a, 0)) +#define msa_ld1q_f32(__a) ((v4f32)__builtin_msa_ld_w(__a, 0)) +#define msa_ld1q_f64(__a) ((v2f64)__builtin_msa_ld_d(__a, 0)) + +/* Store 64bits vector elements values to the given memory address. */ +#define msa_st1_s8(__a, __b) (*((v8i8*)(__a)) = __b) +#define msa_st1_s16(__a, __b) (*((v4i16*)(__a)) = __b) +#define msa_st1_s32(__a, __b) (*((v2i32*)(__a)) = __b) +#define msa_st1_s64(__a, __b) (*((v1i64*)(__a)) = __b) +#define msa_st1_u8(__a, __b) (*((v8u8*)(__a)) = __b) +#define msa_st1_u16(__a, __b) (*((v4u16*)(__a)) = __b) +#define msa_st1_u32(__a, __b) (*((v2u32*)(__a)) = __b) +#define msa_st1_u64(__a, __b) (*((v1u64*)(__a)) = __b) +#define msa_st1_f32(__a, __b) (*((v2f32*)(__a)) = __b) +#define msa_st1_f64(__a, __b) (*((v1f64*)(__a)) = __b) + +/* Store the values of elements in the 128 bits vector __a to the given memory address __a. */ +#define msa_st1q_s8(__a, __b) (__builtin_msa_st_b((v16i8)(__b), __a, 0)) +#define msa_st1q_s16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0)) +#define msa_st1q_s32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0)) +#define msa_st1q_s64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0)) +#define msa_st1q_u8(__a, __b) (__builtin_msa_st_b((v16i8)(__b), __a, 0)) +#define msa_st1q_u16(__a, __b) (__builtin_msa_st_h((v8i16)(__b), __a, 0)) +#define msa_st1q_u32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0)) +#define msa_st1q_u64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0)) +#define msa_st1q_f32(__a, __b) (__builtin_msa_st_w((v4i32)(__b), __a, 0)) +#define msa_st1q_f64(__a, __b) (__builtin_msa_st_d((v2i64)(__b), __a, 0)) + +/* Store the value of the element with the index __c in vector __a to the given memory address __a. */ +#define msa_st1_lane_s8(__a, __b, __c) (*((int8_t*)(__a)) = __b[__c]) +#define msa_st1_lane_s16(__a, __b, __c) (*((int16_t*)(__a)) = __b[__c]) +#define msa_st1_lane_s32(__a, __b, __c) (*((int32_t*)(__a)) = __b[__c]) +#define msa_st1_lane_s64(__a, __b, __c) (*((int64_t*)(__a)) = __b[__c]) +#define msa_st1_lane_u8(__a, __b, __c) (*((uint8_t*)(__a)) = __b[__c]) +#define msa_st1_lane_u16(__a, __b, __c) (*((uint16_t*)(__a)) = __b[__c]) +#define msa_st1_lane_u32(__a, __b, __c) (*((uint32_t*)(__a)) = __b[__c]) +#define msa_st1_lane_u64(__a, __b, __c) (*((uint64_t*)(__a)) = __b[__c]) +#define msa_st1_lane_f32(__a, __b, __c) (*((float*)(__a)) = __b[__c]) +#define msa_st1_lane_f64(__a, __b, __c) (*((double*)(__a)) = __b[__c]) +#define msa_st1q_lane_s8(__a, __b, __c) (*((int8_t*)(__a)) = (int8_t)__builtin_msa_copy_s_b(__b, __c)) +#define msa_st1q_lane_s16(__a, __b, __c) (*((int16_t*)(__a)) = (int16_t)__builtin_msa_copy_s_h(__b, __c)) +#define msa_st1q_lane_s32(__a, __b, __c) (*((int32_t*)(__a)) = __builtin_msa_copy_s_w(__b, __c)) +#define msa_st1q_lane_s64(__a, __b, __c) (*((int64_t*)(__a)) = __builtin_msa_copy_s_d(__b, __c)) +#define msa_st1q_lane_u8(__a, __b, __c) (*((uint8_t*)(__a)) = (uint8_t)__builtin_msa_copy_u_b((v16i8)(__b), __c)) +#define msa_st1q_lane_u16(__a, __b, __c) (*((uint16_t*)(__a)) = (uint16_t)__builtin_msa_copy_u_h((v8i16)(__b), __c)) +#define msa_st1q_lane_u32(__a, __b, __c) (*((uint32_t*)(__a)) = __builtin_msa_copy_u_w((v4i32)(__b), __c)) +#define msa_st1q_lane_u64(__a, __b, __c) (*((uint64_t*)(__a)) = __builtin_msa_copy_u_d((v2i64)(__b), __c)) +#define msa_st1q_lane_f32(__a, __b, __c) (*((float*)(__a)) = __b[__c]) +#define msa_st1q_lane_f64(__a, __b, __c) (*((double*)(__a)) = __b[__c]) + +/* Duplicate elements for 64-bit doubleword vectors */ +#define msa_dup_n_s8(__a) ((v8i8)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0)) +#define msa_dup_n_s16(__a) ((v4i16)__builtin_msa_copy_s_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), 0)) +#define msa_dup_n_s32(__a) ((v2i32){__a, __a}) +#define msa_dup_n_s64(__a) ((v1i64){__a}) +#define msa_dup_n_u8(__a) ((v8u8)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_b((int32_t)(__a)), 0)) +#define msa_dup_n_u16(__a) ((v4u16)__builtin_msa_copy_u_d((v2i64)__builtin_msa_fill_h((int32_t)(__a)), 0)) +#define msa_dup_n_u32(__a) ((v2u32){__a, __a}) +#define msa_dup_n_u64(__a) ((v1u64){__a}) +#define msa_dup_n_f32(__a) ((v2f32){__a, __a}) +#define msa_dup_n_f64(__a) ((v1f64){__a}) + +/* Duplicate elements for 128-bit quadword vectors */ +#define msa_dupq_n_s8(__a) (__builtin_msa_fill_b((int32_t)(__a))) +#define msa_dupq_n_s16(__a) (__builtin_msa_fill_h((int32_t)(__a))) +#define msa_dupq_n_s32(__a) (__builtin_msa_fill_w((int32_t)(__a))) +#define msa_dupq_n_s64(__a) (__builtin_msa_fill_d((int64_t)(__a))) +#define msa_dupq_n_u8(__a) ((v16u8)__builtin_msa_fill_b((int32_t)(__a))) +#define msa_dupq_n_u16(__a) ((v8u16)__builtin_msa_fill_h((int32_t)(__a))) +#define msa_dupq_n_u32(__a) ((v4u32)__builtin_msa_fill_w((int32_t)(__a))) +#define msa_dupq_n_u64(__a) ((v2u64)__builtin_msa_fill_d((int64_t)(__a))) +#define msa_dupq_n_f32(__a) ((v4f32){__a, __a, __a, __a}) +#define msa_dupq_n_f64(__a) ((v2f64){__a, __a}) +#define msa_dupq_lane_s8(__a, __b) (__builtin_msa_splat_b(__a, __b)) +#define msa_dupq_lane_s16(__a, __b) (__builtin_msa_splat_h(__a, __b)) +#define msa_dupq_lane_s32(__a, __b) (__builtin_msa_splat_w(__a, __b)) +#define msa_dupq_lane_s64(__a, __b) (__builtin_msa_splat_d(__a, __b)) +#define msa_dupq_lane_u8(__a, __b) ((v16u8)__builtin_msa_splat_b((v16i8)(__a), __b)) +#define msa_dupq_lane_u16(__a, __b) ((v8u16)__builtin_msa_splat_h((v8i16)(__a), __b)) +#define msa_dupq_lane_u32(__a, __b) ((v4u32)__builtin_msa_splat_w((v4i32)(__a), __b)) +#define msa_dupq_lane_u64(__a, __b) ((v2u64)__builtin_msa_splat_d((v2i64)(__a), __b)) + +/* Create a 64 bits vector */ +#define msa_create_s8(__a) ((v8i8)((uint64_t)(__a))) +#define msa_create_s16(__a) ((v4i16)((uint64_t)(__a))) +#define msa_create_s32(__a) ((v2i32)((uint64_t)(__a))) +#define msa_create_s64(__a) ((v1i64)((uint64_t)(__a))) +#define msa_create_u8(__a) ((v8u8)((uint64_t)(__a))) +#define msa_create_u16(__a) ((v4u16)((uint64_t)(__a))) +#define msa_create_u32(__a) ((v2u32)((uint64_t)(__a))) +#define msa_create_u64(__a) ((v1u64)((uint64_t)(__a))) +#define msa_create_f32(__a) ((v2f32)((uint64_t)(__a))) +#define msa_create_f64(__a) ((v1f64)((uint64_t)(__a))) + +/* Sign extends or zero extends each element in a 64 bits vector to twice its original length, and places the results in a 128 bits vector. */ +/*Transform v8i8 to v8i16*/ +#define msa_movl_s8(__a) \ +((v8i16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], \ + (__a)[4], (__a)[5], (__a)[6], (__a)[7]}) + +/*Transform v8u8 to v8u16*/ +#define msa_movl_u8(__a) \ +((v8u16){(__a)[0], (__a)[1], (__a)[2], (__a)[3], \ + (__a)[4], (__a)[5], (__a)[6], (__a)[7]}) + +/*Transform v4i16 to v8i16*/ +#define msa_movl_s16(__a) ((v4i32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]}) + +/*Transform v2i32 to v4i32*/ +#define msa_movl_s32(__a) ((v2i64){(__a)[0], (__a)[1]}) + +/*Transform v4u16 to v8u16*/ +#define msa_movl_u16(__a) ((v4u32){(__a)[0], (__a)[1], (__a)[2], (__a)[3]}) + +/*Transform v2u32 to v4u32*/ +#define msa_movl_u32(__a) ((v2u64){(__a)[0], (__a)[1]}) + +/* Copies the least significant half of each element of a 128 bits vector into the corresponding elements of a 64 bits vector. */ +#define msa_movn_s16(__a) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \ + (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_movn_s32(__a) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \ + (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_movn_s64(__a) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \ + (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_movn_u16(__a) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)(__a)); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_movn_u32(__a) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_movn_u64(__a) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +/* qmovn */ +#define msa_qmovn_s16(__a) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7)); \ + (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_qmovn_s32(__a) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15)); \ + (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_qmovn_s64(__a) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31)); \ + (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_qmovn_u16(__a) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7)); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_qmovn_u32(__a) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15)); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_qmovn_u64(__a) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31)); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +/* qmovun */ +#define msa_qmovun_s16(__a) \ +({ \ + v8i16 __d = __builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)); \ + v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qmovun_s32(__a) \ +({ \ + v4i32 __d = __builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)); \ + v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qmovun_s64(__a) \ +({ \ + v2i64 __d = __builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)); \ + v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +/* Right shift elements in a 128 bits vector by an immediate value, and places the results in a 64 bits vector. */ +#define msa_shrn_n_s16(__a, __b) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__b))); \ + (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_shrn_n_s32(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__b))); \ + (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_shrn_n_s64(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__b))); \ + (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_shrn_n_u16(__a, __b) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__b))); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_shrn_n_u32(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__b))); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_shrn_n_u64(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__b))); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +/* Right shift elements in a 128 bits vector by an immediate value, and places the results in a 64 bits vector. */ +#define msa_rshrn_n_s16(__a, __b) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)__b)); \ + (v8i8)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_rshrn_n_s32(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)__b)); \ + (v4i16)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_rshrn_n_s64(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)__b)); \ + (v2i32)__builtin_msa_copy_s_d((v2i64)__d, 0); \ +}) + +#define msa_rshrn_n_u16(__a, __b) \ +({ \ + v16i8 __d = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)__b)); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_rshrn_n_u32(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)__b)); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +#define msa_rshrn_n_u64(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)__b)); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__d, 0); \ +}) + +/* Right shift elements in a 128 bits vector by an immediate value, saturate the results and them in a 64 bits vector. */ +#define msa_qrshrn_n_s16(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__a), (int)(__b)), 7); \ + v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \ + (v8i8)__builtin_msa_copy_s_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrn_n_s32(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__a), (int)(__b)), 15); \ + v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \ + (v4i16)__builtin_msa_copy_s_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrn_n_s64(__a, __b) \ +({ \ + v2i64 __d = __builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__a), (int)(__b)), 31); \ + v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \ + (v2i32)__builtin_msa_copy_s_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrn_n_u16(__a, __b) \ +({ \ + v8u16 __d = __builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__b)), 7); \ + v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__d); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrn_n_u32(__a, __b) \ +({ \ + v4u32 __d = __builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__b)), 15); \ + v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__d); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrn_n_u64(__a, __b) \ +({ \ + v2u64 __d = __builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__b)), 31); \ + v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__d); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +/* Right shift elements in a 128 bits vector by an immediate value, saturate the results and them in a 64 bits vector. + Input is signed and output is unsigned. */ +#define msa_qrshrun_n_s16(__a, __b) \ +({ \ + v8i16 __d = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), (int)(__b)); \ + v16i8 __e = __builtin_msa_pckev_b(__builtin_msa_fill_b(0), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \ + (v8u8)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrun_n_s32(__a, __b) \ +({ \ + v4i32 __d = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), (int)(__b)); \ + v8i16 __e = __builtin_msa_pckev_h(__builtin_msa_fill_h(0), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \ + (v4u16)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +#define msa_qrshrun_n_s64(__a, __b) \ +({ \ + v2i64 __d = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), (int)(__b)); \ + v4i32 __e = __builtin_msa_pckev_w(__builtin_msa_fill_w(0), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \ + (v2u32)__builtin_msa_copy_u_d((v2i64)__e, 0); \ +}) + +/* pack */ +#define msa_pack_s16(__a, __b) (__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a))) +#define msa_pack_s32(__a, __b) (__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a))) +#define msa_pack_s64(__a, __b) (__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a))) +#define msa_pack_u16(__a, __b) ((v16u8)__builtin_msa_pckev_b((v16i8)(__b), (v16i8)(__a))) +#define msa_pack_u32(__a, __b) ((v8u16)__builtin_msa_pckev_h((v8i16)(__b), (v8i16)(__a))) +#define msa_pack_u64(__a, __b) ((v4u32)__builtin_msa_pckev_w((v4i32)(__b), (v4i32)(__a))) + +/* qpack */ +#define msa_qpack_s16(__a, __b) \ +(__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_s_h((v8i16)(__b), 7), (v16i8)__builtin_msa_sat_s_h((v8i16)(__a), 7))) +#define msa_qpack_s32(__a, __b) \ +(__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_s_w((v4i32)(__b), 15), (v8i16)__builtin_msa_sat_s_w((v4i32)(__a), 15))) +#define msa_qpack_s64(__a, __b) \ +(__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_s_d((v2i64)(__b), 31), (v4i32)__builtin_msa_sat_s_d((v2i64)(__a), 31))) +#define msa_qpack_u16(__a, __b) \ +((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)(__b), 7), (v16i8)__builtin_msa_sat_u_h((v8u16)(__a), 7))) +#define msa_qpack_u32(__a, __b) \ +((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)(__b), 15), (v8i16)__builtin_msa_sat_u_w((v4u32)(__a), 15))) +#define msa_qpack_u64(__a, __b) \ +((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)(__b), 31), (v4i32)__builtin_msa_sat_u_d((v2u64)(__a), 31))) + +/* qpacku */ +#define msa_qpacku_s16(__a, __b) \ +((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__b))), 7), \ + (v16i8)__builtin_msa_sat_u_h((v8u16)(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a))), 7))) +#define msa_qpacku_s32(__a, __b) \ +((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__b))), 15), \ + (v8i16)__builtin_msa_sat_u_w((v4u32)(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a))), 15))) +#define msa_qpacku_s64(__a, __b) \ +((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__b))), 31), \ + (v4i32)__builtin_msa_sat_u_d((v2u64)(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a))), 31))) + +/* packr */ +#define msa_packr_s16(__a, __b, __c) \ +(__builtin_msa_pckev_b((v16i8)__builtin_msa_srai_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srai_h((v8i16)(__a), (int)(__c)))) +#define msa_packr_s32(__a, __b, __c) \ +(__builtin_msa_pckev_h((v8i16)__builtin_msa_srai_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srai_w((v4i32)(__a), (int)(__c)))) +#define msa_packr_s64(__a, __b, __c) \ +(__builtin_msa_pckev_w((v4i32)__builtin_msa_srai_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srai_d((v2i64)(__a), (int)(__c)))) +#define msa_packr_u16(__a, __b, __c) \ +((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_srli_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srli_h((v8i16)(__a), (int)(__c)))) +#define msa_packr_u32(__a, __b, __c) \ +((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_srli_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srli_w((v4i32)(__a), (int)(__c)))) +#define msa_packr_u64(__a, __b, __c) \ +((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_srli_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srli_d((v2i64)(__a), (int)(__c)))) + +/* rpackr */ +#define msa_rpackr_s16(__a, __b, __c) \ +(__builtin_msa_pckev_b((v16i8)__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srari_h((v8i16)(__a), (int)(__c)))) +#define msa_rpackr_s32(__a, __b, __c) \ +(__builtin_msa_pckev_h((v8i16)__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srari_w((v4i32)(__a), (int)(__c)))) +#define msa_rpackr_s64(__a, __b, __c) \ +(__builtin_msa_pckev_w((v4i32)__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srari_d((v2i64)(__a), (int)(__c)))) +#define msa_rpackr_u16(__a, __b, __c) \ +((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), (v16i8)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c)))) +#define msa_rpackr_u32(__a, __b, __c) \ +((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), (v8i16)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c)))) +#define msa_rpackr_u64(__a, __b, __c) \ +((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), (v4i32)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c)))) + +/* qrpackr */ +#define msa_qrpackr_s16(__a, __b, __c) \ +(__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__b), (int)(__c)), 7), \ + (v16i8)__builtin_msa_sat_s_h(__builtin_msa_srari_h((v8i16)(__a), (int)(__c)), 7))) +#define msa_qrpackr_s32(__a, __b, __c) \ +(__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__b), (int)(__c)), 15), \ + (v8i16)__builtin_msa_sat_s_w(__builtin_msa_srari_w((v4i32)(__a), (int)(__c)), 15))) +#define msa_qrpackr_s64(__a, __b, __c) \ +(__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__b), (int)(__c)), 31), \ + (v4i32)__builtin_msa_sat_s_d(__builtin_msa_srari_d((v2i64)(__a), (int)(__c)), 31))) +#define msa_qrpackr_u16(__a, __b, __c) \ +((v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__b), (int)(__c)), 7), \ + (v16i8)__builtin_msa_sat_u_h((v8u16)__builtin_msa_srlri_h((v8i16)(__a), (int)(__c)), 7))) +#define msa_qrpackr_u32(__a, __b, __c) \ +((v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__b), (int)(__c)), 15), \ + (v8i16)__builtin_msa_sat_u_w((v4u32)__builtin_msa_srlri_w((v4i32)(__a), (int)(__c)), 15))) +#define msa_qrpackr_u64(__a, __b, __c) \ +((v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__b), (int)(__c)), 31), \ + (v4i32)__builtin_msa_sat_u_d((v2u64)__builtin_msa_srlri_d((v2i64)(__a), (int)(__c)), 31))) + +/* qrpackru */ +#define msa_qrpackru_s16(__a, __b, __c) \ +({ \ + v8i16 __d = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__a)), (int)(__c)); \ + v8i16 __e = __builtin_msa_srlri_h(__builtin_msa_max_s_h(__builtin_msa_fill_h(0), (v8i16)(__b)), (int)(__c)); \ + (v16u8)__builtin_msa_pckev_b((v16i8)__builtin_msa_sat_u_h((v8u16)__e, 7), (v16i8)__builtin_msa_sat_u_h((v8u16)__d, 7)); \ +}) + +#define msa_qrpackru_s32(__a, __b, __c) \ +({ \ + v4i32 __d = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__a)), (int)(__c)); \ + v4i32 __e = __builtin_msa_srlri_w(__builtin_msa_max_s_w(__builtin_msa_fill_w(0), (v4i32)(__b)), (int)(__c)); \ + (v8u16)__builtin_msa_pckev_h((v8i16)__builtin_msa_sat_u_w((v4u32)__e, 15), (v8i16)__builtin_msa_sat_u_w((v4u32)__d, 15)); \ +}) + +#define msa_qrpackru_s64(__a, __b, __c) \ +({ \ + v2i64 __d = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__a)), (int)(__c)); \ + v2i64 __e = __builtin_msa_srlri_d(__builtin_msa_max_s_d(__builtin_msa_fill_d(0), (v2i64)(__b)), (int)(__c)); \ + (v4u32)__builtin_msa_pckev_w((v4i32)__builtin_msa_sat_u_d((v2u64)__e, 31), (v4i32)__builtin_msa_sat_u_d((v2u64)__d, 31)); \ +}) + +/* Minimum values between corresponding elements in the two vectors are written to the returned vector. */ +#define msa_minq_s8(__a, __b) (__builtin_msa_min_s_b(__a, __b)) +#define msa_minq_s16(__a, __b) (__builtin_msa_min_s_h(__a, __b)) +#define msa_minq_s32(__a, __b) (__builtin_msa_min_s_w(__a, __b)) +#define msa_minq_s64(__a, __b) (__builtin_msa_min_s_d(__a, __b)) +#define msa_minq_u8(__a, __b) ((v16u8)__builtin_msa_min_u_b(__a, __b)) +#define msa_minq_u16(__a, __b) ((v8u16)__builtin_msa_min_u_h(__a, __b)) +#define msa_minq_u32(__a, __b) ((v4u32)__builtin_msa_min_u_w(__a, __b)) +#define msa_minq_u64(__a, __b) ((v2u64)__builtin_msa_min_u_d(__a, __b)) +#define msa_minq_f32(__a, __b) (__builtin_msa_fmin_w(__a, __b)) +#define msa_minq_f64(__a, __b) (__builtin_msa_fmin_d(__a, __b)) + +/* Maximum values between corresponding elements in the two vectors are written to the returned vector. */ +#define msa_maxq_s8(__a, __b) (__builtin_msa_max_s_b(__a, __b)) +#define msa_maxq_s16(__a, __b) (__builtin_msa_max_s_h(__a, __b)) +#define msa_maxq_s32(__a, __b) (__builtin_msa_max_s_w(__a, __b)) +#define msa_maxq_s64(__a, __b) (__builtin_msa_max_s_d(__a, __b)) +#define msa_maxq_u8(__a, __b) ((v16u8)__builtin_msa_max_u_b(__a, __b)) +#define msa_maxq_u16(__a, __b) ((v8u16)__builtin_msa_max_u_h(__a, __b)) +#define msa_maxq_u32(__a, __b) ((v4u32)__builtin_msa_max_u_w(__a, __b)) +#define msa_maxq_u64(__a, __b) ((v2u64)__builtin_msa_max_u_d(__a, __b)) +#define msa_maxq_f32(__a, __b) (__builtin_msa_fmax_w(__a, __b)) +#define msa_maxq_f64(__a, __b) (__builtin_msa_fmax_d(__a, __b)) + +/* Vector type reinterpretion */ +#define MSA_TPV_REINTERPRET(_Tpv, Vec) ((_Tpv)(Vec)) + +/* Add the odd elements in vector __a with the even elements in vector __b to double width elements in the returned vector. */ +/* v8i16 msa_hadd_s16 ((v16i8)__a, (v16i8)__b) */ +#define msa_hadd_s16(__a, __b) (__builtin_msa_hadd_s_h((v16i8)(__a), (v16i8)(__b))) +/* v4i32 msa_hadd_s32 ((v8i16)__a, (v8i16)__b) */ +#define msa_hadd_s32(__a, __b) (__builtin_msa_hadd_s_w((v8i16)(__a), (v8i16)(__b))) +/* v2i64 msa_hadd_s64 ((v4i32)__a, (v4i32)__b) */ +#define msa_hadd_s64(__a, __b) (__builtin_msa_hadd_s_d((v4i32)(__a), (v4i32)(__b))) + +/* Copy even elements in __a to the left half and even elements in __b to the right half and return the result vector. */ +#define msa_pckev_s8(__a, __b) (__builtin_msa_pckev_b((v16i8)(__a), (v16i8)(__b))) +#define msa_pckev_s16(__a, __b) (__builtin_msa_pckev_h((v8i16)(__a), (v8i16)(__b))) +#define msa_pckev_s32(__a, __b) (__builtin_msa_pckev_w((v4i32)(__a), (v4i32)(__b))) +#define msa_pckev_s64(__a, __b) (__builtin_msa_pckev_d((v2i64)(__a), (v2i64)(__b))) + +/* Copy even elements in __a to the left half and even elements in __b to the right half and return the result vector. */ +#define msa_pckod_s8(__a, __b) (__builtin_msa_pckod_b((v16i8)(__a), (v16i8)(__b))) +#define msa_pckod_s16(__a, __b) (__builtin_msa_pckod_h((v8i16)(__a), (v8i16)(__b))) +#define msa_pckod_s32(__a, __b) (__builtin_msa_pckod_w((v4i32)(__a), (v4i32)(__b))) +#define msa_pckod_s64(__a, __b) (__builtin_msa_pckod_d((v2i64)(__a), (v2i64)(__b))) + +#ifdef _MIPSEB +#define LANE_IMM0_1(x) (0b1 - ((x) & 0b1)) +#define LANE_IMM0_3(x) (0b11 - ((x) & 0b11)) +#define LANE_IMM0_7(x) (0b111 - ((x) & 0b111)) +#define LANE_IMM0_15(x) (0b1111 - ((x) & 0b1111)) +#else +#define LANE_IMM0_1(x) ((x) & 0b1) +#define LANE_IMM0_3(x) ((x) & 0b11) +#define LANE_IMM0_7(x) ((x) & 0b111) +#define LANE_IMM0_15(x) ((x) & 0b1111) +#endif + +#define msa_get_lane_u8(__a, __b) ((uint8_t)(__a)[LANE_IMM0_7(__b)]) +#define msa_get_lane_s8(__a, __b) ((int8_t)(__a)[LANE_IMM0_7(__b)]) +#define msa_get_lane_u16(__a, __b) ((uint16_t)(__a)[LANE_IMM0_3(__b)]) +#define msa_get_lane_s16(__a, __b) ((int16_t)(__a)[LANE_IMM0_3(__b)]) +#define msa_get_lane_u32(__a, __b) ((uint32_t)(__a)[LANE_IMM0_1(__b)]) +#define msa_get_lane_s32(__a, __b) ((int32_t)(__a)[LANE_IMM0_1(__b)]) +#define msa_get_lane_f32(__a, __b) ((float)(__a)[LANE_IMM0_3(__b)]) +#define msa_get_lane_s64(__a, __b) ((int64_t)(__a)[LANE_IMM0_1(__b)]) +#define msa_get_lane_u64(__a, __b) ((uint64_t)(__a)[LANE_IMM0_1(__b)]) +#define msa_get_lane_f64(__a, __b) ((double)(__a)[LANE_IMM0_1(__b)]) +#define msa_getq_lane_u8(__a, imm0_15) ((uint8_t)__builtin_msa_copy_u_b((v16i8)(__a), imm0_15)) +#define msa_getq_lane_s8(__a, imm0_15) ((int8_t)__builtin_msa_copy_s_b(__a, imm0_15)) +#define msa_getq_lane_u16(__a, imm0_7) ((uint16_t)__builtin_msa_copy_u_h((v8i16)(__a), imm0_7)) +#define msa_getq_lane_s16(__a, imm0_7) ((int16_t)__builtin_msa_copy_s_h(__a, imm0_7)) +#define msa_getq_lane_u32(__a, imm0_3) __builtin_msa_copy_u_w((v4i32)(__a), imm0_3) +#define msa_getq_lane_s32 __builtin_msa_copy_s_w +#define msa_getq_lane_f32(__a, __b) ((float)(__a)[LANE_IMM0_3(__b)]) +#define msa_getq_lane_f64(__a, __b) ((double)(__a)[LANE_IMM0_1(__b)]) +#if (__mips == 64) +#define msa_getq_lane_u64(__a, imm0_1) __builtin_msa_copy_u_d((v2i64)(__a), imm0_1) +#define msa_getq_lane_s64 __builtin_msa_copy_s_d +#else +#define msa_getq_lane_u64(__a, imm0_1) ((uint64_t)(__a)[LANE_IMM0_1(imm0_1)]) +#define msa_getq_lane_s64(__a, imm0_1) ((int64_t)(__a)[LANE_IMM0_1(imm0_1)]) +#endif + +/* combine */ +#if (__mips == 64) +#define __COMBINE_64_64(__TYPE, a, b) ((__TYPE)((v2u64){((v1u64)(a))[0], ((v1u64)(b))[0]})) +#else +#define __COMBINE_64_64(__TYPE, a, b) ((__TYPE)((v4u32){((v2u32)(a))[0], ((v2u32)(a))[1], \ + ((v2u32)(b))[0], ((v2u32)(b))[1]})) +#endif + +/* v16i8 msa_combine_s8 (v8i8 __a, v8i8 __b) */ +#define msa_combine_s8(__a, __b) __COMBINE_64_64(v16i8, __a, __b) + +/* v8i16 msa_combine_s16(v4i16 __a, v4i16 __b) */ +#define msa_combine_s16(__a, __b) __COMBINE_64_64(v8i16, __a, __b) + +/* v4i32 msa_combine_s32(v2i32 __a, v2i32 __b) */ +#define msa_combine_s32(__a, __b) __COMBINE_64_64(v4i32, __a, __b) + +/* v2i64 msa_combine_s64(v1i64 __a, v1i64 __b) */ +#define msa_combine_s64(__a, __b) __COMBINE_64_64(v2i64, __a, __b) + +/* v4f32 msa_combine_f32(v2f32 __a, v2f32 __b) */ +#define msa_combine_f32(__a, __b) __COMBINE_64_64(v4f32, __a, __b) + +/* v16u8 msa_combine_u8(v8u8 __a, v8u8 __b) */ +#define msa_combine_u8(__a, __b) __COMBINE_64_64(v16u8, __a, __b) + +/* v8u16 msa_combine_u16(v4u16 __a, v4u16 __b) */ +#define msa_combine_u16(__a, __b) __COMBINE_64_64(v8u16, __a, __b) + +/* v4u32 msa_combine_u32(v2u32 __a, v2u32 __b) */ +#define msa_combine_u32(__a, __b) __COMBINE_64_64(v4u32, __a, __b) + +/* v2u64 msa_combine_u64(v1u64 __a, v1u64 __b) */ +#define msa_combine_u64(__a, __b) __COMBINE_64_64(v2u64, __a, __b) + +/* v2f64 msa_combine_f64(v1f64 __a, v1f64 __b) */ +#define msa_combine_f64(__a, __b) __COMBINE_64_64(v2f64, __a, __b) + +/* get_low, get_high */ +#if (__mips == 64) +#define __GET_LOW(__TYPE, a) ((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 0)))) +#define __GET_HIGH(__TYPE, a) ((__TYPE)((v1u64)(__builtin_msa_copy_u_d((v2i64)(a), 1)))) +#else +#define __GET_LOW(__TYPE, a) ((__TYPE)(((v2u64)(a))[0])) +#define __GET_HIGH(__TYPE, a) ((__TYPE)(((v2u64)(a))[1])) +#endif + +/* v8i8 msa_get_low_s8(v16i8 __a) */ +#define msa_get_low_s8(__a) __GET_LOW(v8i8, __a) + +/* v4i16 msa_get_low_s16(v8i16 __a) */ +#define msa_get_low_s16(__a) __GET_LOW(v4i16, __a) + +/* v2i32 msa_get_low_s32(v4i32 __a) */ +#define msa_get_low_s32(__a) __GET_LOW(v2i32, __a) + +/* v1i64 msa_get_low_s64(v2i64 __a) */ +#define msa_get_low_s64(__a) __GET_LOW(v1i64, __a) + +/* v8u8 msa_get_low_u8(v16u8 __a) */ +#define msa_get_low_u8(__a) __GET_LOW(v8u8, __a) + +/* v4u16 msa_get_low_u16(v8u16 __a) */ +#define msa_get_low_u16(__a) __GET_LOW(v4u16, __a) + +/* v2u32 msa_get_low_u32(v4u32 __a) */ +#define msa_get_low_u32(__a) __GET_LOW(v2u32, __a) + +/* v1u64 msa_get_low_u64(v2u64 __a) */ +#define msa_get_low_u64(__a) __GET_LOW(v1u64, __a) + +/* v2f32 msa_get_low_f32(v4f32 __a) */ +#define msa_get_low_f32(__a) __GET_LOW(v2f32, __a) + +/* v1f64 msa_get_low_f64(v2f64 __a) */ +#define msa_get_low_f64(__a) __GET_LOW(v1f64, __a) + +/* v8i8 msa_get_high_s8(v16i8 __a) */ +#define msa_get_high_s8(__a) __GET_HIGH(v8i8, __a) + +/* v4i16 msa_get_high_s16(v8i16 __a) */ +#define msa_get_high_s16(__a) __GET_HIGH(v4i16, __a) + +/* v2i32 msa_get_high_s32(v4i32 __a) */ +#define msa_get_high_s32(__a) __GET_HIGH(v2i32, __a) + +/* v1i64 msa_get_high_s64(v2i64 __a) */ +#define msa_get_high_s64(__a) __GET_HIGH(v1i64, __a) + +/* v8u8 msa_get_high_u8(v16u8 __a) */ +#define msa_get_high_u8(__a) __GET_HIGH(v8u8, __a) + +/* v4u16 msa_get_high_u16(v8u16 __a) */ +#define msa_get_high_u16(__a) __GET_HIGH(v4u16, __a) + +/* v2u32 msa_get_high_u32(v4u32 __a) */ +#define msa_get_high_u32(__a) __GET_HIGH(v2u32, __a) + +/* v1u64 msa_get_high_u64(v2u64 __a) */ +#define msa_get_high_u64(__a) __GET_HIGH(v1u64, __a) + +/* v2f32 msa_get_high_f32(v4f32 __a) */ +#define msa_get_high_f32(__a) __GET_HIGH(v2f32, __a) + +/* v1f64 msa_get_high_f64(v2f64 __a) */ +#define msa_get_high_f64(__a) __GET_HIGH(v1f64, __a) + +/* ri = ai * b[lane] */ +/* v4f32 msa_mulq_lane_f32(v4f32 __a, v4f32 __b, const int __lane) */ +#define msa_mulq_lane_f32(__a, __b, __lane) ((__a) * msa_getq_lane_f32(__b, __lane)) + +/* ri = ai + bi * c[lane] */ +/* v4f32 msa_mlaq_lane_f32(v4f32 __a, v4f32 __b, v4f32 __c, const int __lane) */ +#define msa_mlaq_lane_f32(__a, __b, __c, __lane) ((__a) + ((__b) * msa_getq_lane_f32(__c, __lane))) + +/* uint16_t msa_sum_u16(v8u16 __a)*/ +#define msa_sum_u16(__a) \ +({ \ + v4u32 _b; \ + v2u64 _c; \ + _b = __builtin_msa_hadd_u_w(__a, __a); \ + _c = __builtin_msa_hadd_u_d(_b, _b); \ + (uint16_t)(_c[0] + _c[1]); \ +}) + +/* int16_t msa_sum_s16(v8i16 __a) */ +#define msa_sum_s16(__a) \ +({ \ + v4i32 _b; \ + v2i64 _c; \ + _b = __builtin_msa_hadd_s_w(__a, __a); \ + _c = __builtin_msa_hadd_s_d(_b, _b); \ + (int16_t)(_c[0] + _c[1]); \ +}) + + +/* uint32_t msa_sum_u32(v4u32 __a)*/ +#define msa_sum_u32(__a) \ +({ \ + v2u64 _b; \ + _b = __builtin_msa_hadd_u_d(__a, __a); \ + (uint32_t)(_b[0] + _b[1]); \ +}) + +/* int32_t msa_sum_s32(v4i32 __a)*/ +#define msa_sum_s32(__a) \ +({ \ + v2i64 _b; \ + _b = __builtin_msa_hadd_s_d(__a, __a); \ + (int32_t)(_b[0] + _b[1]); \ +}) + +/* uint8_t msa_sum_u8(v16u8 __a)*/ +#define msa_sum_u8(__a) \ +({ \ + v8u16 _b16; \ + v4u32 _c32; \ + _b16 = __builtin_msa_hadd_u_h(__a, __a); \ + _c32 = __builtin_msa_hadd_u_w(_b16, _b16); \ + (uint8_t)msa_sum_u32(_c32); \ +}) + +/* int8_t msa_sum_s8(v16s8 __a)*/ +#define msa_sum_s8(__a) \ +({ \ + v8i16 _b16; \ + v4i32 _c32; \ + _b16 = __builtin_msa_hadd_s_h(__a, __a); \ + _c32 = __builtin_msa_hadd_s_w(_b16, _b16); \ + (int8_t)msa_sum_s32(_c32); \ +}) + +/* float msa_sum_f32(v4f32 __a)*/ +#define msa_sum_f32(__a) ((__a)[0] + (__a)[1] + (__a)[2] + (__a)[3]) + +/* v8u16 msa_paddlq_u8(v16u8 __a) */ +#define msa_paddlq_u8(__a) (__builtin_msa_hadd_u_h(__a, __a)) + +/* v8i16 msa_paddlq_s8(v16i8 __a) */ +#define msa_paddlq_s8(__a) (__builtin_msa_hadd_s_h(__a, __a)) + +/* v4u32 msa_paddlq_u16 (v8u16 __a)*/ +#define msa_paddlq_u16(__a) (__builtin_msa_hadd_u_w(__a, __a)) + +/* v4i32 msa_paddlq_s16 (v8i16 __a)*/ +#define msa_paddlq_s16(__a) (__builtin_msa_hadd_s_w(__a, __a)) + +/* v2u64 msa_paddlq_u32(v4u32 __a) */ +#define msa_paddlq_u32(__a) (__builtin_msa_hadd_u_d(__a, __a)) + +/* v2i64 msa_paddlq_s32(v4i32 __a) */ +#define msa_paddlq_s32(__a) (__builtin_msa_hadd_s_d(__a, __a)) + +#define V8U8_2_V8U16(x) {(uint16_t)x[0], (uint16_t)x[1], (uint16_t)x[2], (uint16_t)x[3], \ + (uint16_t)x[4], (uint16_t)x[5], (uint16_t)x[6], (uint16_t)x[7]} +#define V8U8_2_V8I16(x) {(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \ + (int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]} +#define V8I8_2_V8I16(x) {(int16_t)x[0], (int16_t)x[1], (int16_t)x[2], (int16_t)x[3], \ + (int16_t)x[4], (int16_t)x[5], (int16_t)x[6], (int16_t)x[7]} +#define V4U16_2_V4U32(x) {(uint32_t)x[0], (uint32_t)x[1], (uint32_t)x[2], (uint32_t)x[3]} +#define V4U16_2_V4I32(x) {(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]} +#define V4I16_2_V4I32(x) {(int32_t)x[0], (int32_t)x[1], (int32_t)x[2], (int32_t)x[3]} +#define V2U32_2_V2U64(x) {(uint64_t)x[0], (uint64_t)x[1]} +#define V2U32_2_V2I64(x) {(int64_t)x[0], (int64_t)x[1]} + +/* v8u16 msa_mull_u8(v8u8 __a, v8u8 __b) */ +#define msa_mull_u8(__a, __b) ((v8u16)__builtin_msa_mulv_h((v8i16)V8U8_2_V8I16(__a), (v8i16)V8U8_2_V8I16(__b))) + +/* v8i16 msa_mull_s8(v8i8 __a, v8i8 __b)*/ +#define msa_mull_s8(__a, __b) (__builtin_msa_mulv_h((v8i16)V8I8_2_V8I16(__a), (v8i16)V8I8_2_V8I16(__b))) + +/* v4u32 msa_mull_u16(v4u16 __a, v4u16 __b) */ +#define msa_mull_u16(__a, __b) ((v4u32)__builtin_msa_mulv_w((v4i32)V4U16_2_V4I32(__a), (v4i32)V4U16_2_V4I32(__b))) + +/* v4i32 msa_mull_s16(v4i16 __a, v4i16 __b) */ +#define msa_mull_s16(__a, __b) (__builtin_msa_mulv_w((v4i32)V4I16_2_V4I32(__a), (v4i32)V4I16_2_V4I32(__b))) + +/* v2u64 msa_mull_u32(v2u32 __a, v2u32 __b) */ +#define msa_mull_u32(__a, __b) ((v2u64)__builtin_msa_mulv_d((v2i64)V2U32_2_V2I64(__a), (v2i64)V2U32_2_V2I64(__b))) + +/* bitwise and: __builtin_msa_and_v */ +#define msa_andq_u8(__a, __b) ((v16u8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_s8(__a, __b) ((v16i8)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_u16(__a, __b) ((v8u16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_s16(__a, __b) ((v8i16)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_u32(__a, __b) ((v4u32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_s32(__a, __b) ((v4i32)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_u64(__a, __b) ((v2u64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) +#define msa_andq_s64(__a, __b) ((v2i64)__builtin_msa_and_v((v16u8)(__a), (v16u8)(__b))) + +/* bitwise or: __builtin_msa_or_v */ +#define msa_orrq_u8(__a, __b) ((v16u8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_s8(__a, __b) ((v16i8)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_u16(__a, __b) ((v8u16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_s16(__a, __b) ((v8i16)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_u32(__a, __b) ((v4u32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_s32(__a, __b) ((v4i32)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_u64(__a, __b) ((v2u64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) +#define msa_orrq_s64(__a, __b) ((v2i64)__builtin_msa_or_v((v16u8)(__a), (v16u8)(__b))) + +/* bitwise xor: __builtin_msa_xor_v */ +#define msa_eorq_u8(__a, __b) ((v16u8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_s8(__a, __b) ((v16i8)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_u16(__a, __b) ((v8u16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_s16(__a, __b) ((v8i16)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_u32(__a, __b) ((v4u32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_s32(__a, __b) ((v4i32)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_u64(__a, __b) ((v2u64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) +#define msa_eorq_s64(__a, __b) ((v2i64)__builtin_msa_xor_v((v16u8)(__a), (v16u8)(__b))) + +/* bitwise not: v16u8 __builtin_msa_xori_b (v16u8, 0xff) */ +#define msa_mvnq_u8(__a) ((v16u8)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_s8(__a) ((v16i8)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_u16(__a) ((v8u16)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_s16(__a) ((v8i16)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_u32(__a) ((v4u32)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_s32(__a) ((v4i32)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_u64(__a) ((v2u64)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) +#define msa_mvnq_s64(__a) ((v2i64)__builtin_msa_xori_b((v16u8)(__a), 0xFF)) + +/* compare equal: ceq -> ri = ai == bi ? 1...1:0...0 */ +#define msa_ceqq_u8(__a, __b) ((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b))) +#define msa_ceqq_s8(__a, __b) ((v16u8)__builtin_msa_ceq_b((v16i8)(__a), (v16i8)(__b))) +#define msa_ceqq_u16(__a, __b) ((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b))) +#define msa_ceqq_s16(__a, __b) ((v8u16)__builtin_msa_ceq_h((v8i16)(__a), (v8i16)(__b))) +#define msa_ceqq_u32(__a, __b) ((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b))) +#define msa_ceqq_s32(__a, __b) ((v4u32)__builtin_msa_ceq_w((v4i32)(__a), (v4i32)(__b))) +#define msa_ceqq_f32(__a, __b) ((v4u32)__builtin_msa_fceq_w((v4f32)(__a), (v4f32)(__b))) +#define msa_ceqq_u64(__a, __b) ((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b))) +#define msa_ceqq_s64(__a, __b) ((v2u64)__builtin_msa_ceq_d((v2i64)(__a), (v2i64)(__b))) +#define msa_ceqq_f64(__a, __b) ((v2u64)__builtin_msa_fceq_d((v2f64)(__a), (v2f64)(__b))) + +/* Compare less-than: clt -> ri = ai < bi ? 1...1:0...0 */ +#define msa_cltq_u8(__a, __b) ((v16u8)__builtin_msa_clt_u_b((v16u8)(__a), (v16u8)(__b))) +#define msa_cltq_s8(__a, __b) ((v16u8)__builtin_msa_clt_s_b((v16i8)(__a), (v16i8)(__b))) +#define msa_cltq_u16(__a, __b) ((v8u16)__builtin_msa_clt_u_h((v8u16)(__a), (v8u16)(__b))) +#define msa_cltq_s16(__a, __b) ((v8u16)__builtin_msa_clt_s_h((v8i16)(__a), (v8i16)(__b))) +#define msa_cltq_u32(__a, __b) ((v4u32)__builtin_msa_clt_u_w((v4u32)(__a), (v4u32)(__b))) +#define msa_cltq_s32(__a, __b) ((v4u32)__builtin_msa_clt_s_w((v4i32)(__a), (v4i32)(__b))) +#define msa_cltq_f32(__a, __b) ((v4u32)__builtin_msa_fclt_w((v4f32)(__a), (v4f32)(__b))) +#define msa_cltq_u64(__a, __b) ((v2u64)__builtin_msa_clt_u_d((v2u64)(__a), (v2u64)(__b))) +#define msa_cltq_s64(__a, __b) ((v2u64)__builtin_msa_clt_s_d((v2i64)(__a), (v2i64)(__b))) +#define msa_cltq_f64(__a, __b) ((v2u64)__builtin_msa_fclt_d((v2f64)(__a), (v2f64)(__b))) + +/* compare greater-than: cgt -> ri = ai > bi ? 1...1:0...0 */ +#define msa_cgtq_u8(__a, __b) ((v16u8)__builtin_msa_clt_u_b((v16u8)(__b), (v16u8)(__a))) +#define msa_cgtq_s8(__a, __b) ((v16u8)__builtin_msa_clt_s_b((v16i8)(__b), (v16i8)(__a))) +#define msa_cgtq_u16(__a, __b) ((v8u16)__builtin_msa_clt_u_h((v8u16)(__b), (v8u16)(__a))) +#define msa_cgtq_s16(__a, __b) ((v8u16)__builtin_msa_clt_s_h((v8i16)(__b), (v8i16)(__a))) +#define msa_cgtq_u32(__a, __b) ((v4u32)__builtin_msa_clt_u_w((v4u32)(__b), (v4u32)(__a))) +#define msa_cgtq_s32(__a, __b) ((v4u32)__builtin_msa_clt_s_w((v4i32)(__b), (v4i32)(__a))) +#define msa_cgtq_f32(__a, __b) ((v4u32)__builtin_msa_fclt_w((v4f32)(__b), (v4f32)(__a))) +#define msa_cgtq_u64(__a, __b) ((v2u64)__builtin_msa_clt_u_d((v2u64)(__b), (v2u64)(__a))) +#define msa_cgtq_s64(__a, __b) ((v2u64)__builtin_msa_clt_s_d((v2i64)(__b), (v2i64)(__a))) +#define msa_cgtq_f64(__a, __b) ((v2u64)__builtin_msa_fclt_d((v2f64)(__b), (v2f64)(__a))) + +/* compare less-equal: cle -> ri = ai <= bi ? 1...1:0...0 */ +#define msa_cleq_u8(__a, __b) ((v16u8)__builtin_msa_cle_u_b((v16u8)(__a), (v16u8)(__b))) +#define msa_cleq_s8(__a, __b) ((v16u8)__builtin_msa_cle_s_b((v16i8)(__a), (v16i8)(__b))) +#define msa_cleq_u16(__a, __b) ((v8u16)__builtin_msa_cle_u_h((v8u16)(__a), (v8u16)(__b))) +#define msa_cleq_s16(__a, __b) ((v8u16)__builtin_msa_cle_s_h((v8i16)(__a), (v8i16)(__b))) +#define msa_cleq_u32(__a, __b) ((v4u32)__builtin_msa_cle_u_w((v4u32)(__a), (v4u32)(__b))) +#define msa_cleq_s32(__a, __b) ((v4u32)__builtin_msa_cle_s_w((v4i32)(__a), (v4i32)(__b))) +#define msa_cleq_f32(__a, __b) ((v4u32)__builtin_msa_fcle_w((v4f32)(__a), (v4f32)(__b))) +#define msa_cleq_u64(__a, __b) ((v2u64)__builtin_msa_cle_u_d((v2u64)(__a), (v2u64)(__b))) +#define msa_cleq_s64(__a, __b) ((v2u64)__builtin_msa_cle_s_d((v2i64)(__a), (v2i64)(__b))) +#define msa_cleq_f64(__a, __b) ((v2u64)__builtin_msa_fcle_d((v2f64)(__a), (v2f64)(__b))) + +/* compare greater-equal: cge -> ri = ai >= bi ? 1...1:0...0 */ +#define msa_cgeq_u8(__a, __b) ((v16u8)__builtin_msa_cle_u_b((v16u8)(__b), (v16u8)(__a))) +#define msa_cgeq_s8(__a, __b) ((v16u8)__builtin_msa_cle_s_b((v16i8)(__b), (v16i8)(__a))) +#define msa_cgeq_u16(__a, __b) ((v8u16)__builtin_msa_cle_u_h((v8u16)(__b), (v8u16)(__a))) +#define msa_cgeq_s16(__a, __b) ((v8u16)__builtin_msa_cle_s_h((v8i16)(__b), (v8i16)(__a))) +#define msa_cgeq_u32(__a, __b) ((v4u32)__builtin_msa_cle_u_w((v4u32)(__b), (v4u32)(__a))) +#define msa_cgeq_s32(__a, __b) ((v4u32)__builtin_msa_cle_s_w((v4i32)(__b), (v4i32)(__a))) +#define msa_cgeq_f32(__a, __b) ((v4u32)__builtin_msa_fcle_w((v4f32)(__b), (v4f32)(__a))) +#define msa_cgeq_u64(__a, __b) ((v2u64)__builtin_msa_cle_u_d((v2u64)(__b), (v2u64)(__a))) +#define msa_cgeq_s64(__a, __b) ((v2u64)__builtin_msa_cle_s_d((v2i64)(__b), (v2i64)(__a))) +#define msa_cgeq_f64(__a, __b) ((v2u64)__builtin_msa_fcle_d((v2f64)(__b), (v2f64)(__a))) + +/* Shift Left Logical: shl -> ri = ai << bi; */ +#define msa_shlq_u8(__a, __b) ((v16u8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b))) +#define msa_shlq_s8(__a, __b) ((v16i8)__builtin_msa_sll_b((v16i8)(__a), (v16i8)(__b))) +#define msa_shlq_u16(__a, __b) ((v8u16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b))) +#define msa_shlq_s16(__a, __b) ((v8i16)__builtin_msa_sll_h((v8i16)(__a), (v8i16)(__b))) +#define msa_shlq_u32(__a, __b) ((v4u32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b))) +#define msa_shlq_s32(__a, __b) ((v4i32)__builtin_msa_sll_w((v4i32)(__a), (v4i32)(__b))) +#define msa_shlq_u64(__a, __b) ((v2u64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b))) +#define msa_shlq_s64(__a, __b) ((v2i64)__builtin_msa_sll_d((v2i64)(__a), (v2i64)(__b))) + +/* Immediate Shift Left Logical: shl -> ri = ai << imm; */ +#define msa_shlq_n_u8(__a, __imm) ((v16u8)__builtin_msa_slli_b((v16i8)(__a), __imm)) +#define msa_shlq_n_s8(__a, __imm) ((v16i8)__builtin_msa_slli_b((v16i8)(__a), __imm)) +#define msa_shlq_n_u16(__a, __imm) ((v8u16)__builtin_msa_slli_h((v8i16)(__a), __imm)) +#define msa_shlq_n_s16(__a, __imm) ((v8i16)__builtin_msa_slli_h((v8i16)(__a), __imm)) +#define msa_shlq_n_u32(__a, __imm) ((v4u32)__builtin_msa_slli_w((v4i32)(__a), __imm)) +#define msa_shlq_n_s32(__a, __imm) ((v4i32)__builtin_msa_slli_w((v4i32)(__a), __imm)) +#define msa_shlq_n_u64(__a, __imm) ((v2u64)__builtin_msa_slli_d((v2i64)(__a), __imm)) +#define msa_shlq_n_s64(__a, __imm) ((v2i64)__builtin_msa_slli_d((v2i64)(__a), __imm)) + +/* shift right: shrq -> ri = ai >> bi; */ +#define msa_shrq_u8(__a, __b) ((v16u8)__builtin_msa_srl_b((v16i8)(__a), (v16i8)(__b))) +#define msa_shrq_s8(__a, __b) ((v16i8)__builtin_msa_sra_b((v16i8)(__a), (v16i8)(__b))) +#define msa_shrq_u16(__a, __b) ((v8u16)__builtin_msa_srl_h((v8i16)(__a), (v8i16)(__b))) +#define msa_shrq_s16(__a, __b) ((v8i16)__builtin_msa_sra_h((v8i16)(__a), (v8i16)(__b))) +#define msa_shrq_u32(__a, __b) ((v4u32)__builtin_msa_srl_w((v4i32)(__a), (v4i32)(__b))) +#define msa_shrq_s32(__a, __b) ((v4i32)__builtin_msa_sra_w((v4i32)(__a), (v4i32)(__b))) +#define msa_shrq_u64(__a, __b) ((v2u64)__builtin_msa_srl_d((v2i64)(__a), (v2i64)(__b))) +#define msa_shrq_s64(__a, __b) ((v2i64)__builtin_msa_sra_d((v2i64)(__a), (v2i64)(__b))) + +/* Immediate Shift Right: shr -> ri = ai >> imm; */ +#define msa_shrq_n_u8(__a, __imm) ((v16u8)__builtin_msa_srli_b((v16i8)(__a), __imm)) +#define msa_shrq_n_s8(__a, __imm) ((v16i8)__builtin_msa_srai_b((v16i8)(__a), __imm)) +#define msa_shrq_n_u16(__a, __imm) ((v8u16)__builtin_msa_srli_h((v8i16)(__a), __imm)) +#define msa_shrq_n_s16(__a, __imm) ((v8i16)__builtin_msa_srai_h((v8i16)(__a), __imm)) +#define msa_shrq_n_u32(__a, __imm) ((v4u32)__builtin_msa_srli_w((v4i32)(__a), __imm)) +#define msa_shrq_n_s32(__a, __imm) ((v4i32)__builtin_msa_srai_w((v4i32)(__a), __imm)) +#define msa_shrq_n_u64(__a, __imm) ((v2u64)__builtin_msa_srli_d((v2i64)(__a), __imm)) +#define msa_shrq_n_s64(__a, __imm) ((v2i64)__builtin_msa_srai_d((v2i64)(__a), __imm)) + +/* Immediate Shift Right Rounded: shr -> ri = ai >> (rounded)imm; */ +#define msa_rshrq_n_u8(__a, __imm) ((v16u8)__builtin_msa_srlri_b((v16i8)(__a), __imm)) +#define msa_rshrq_n_s8(__a, __imm) ((v16i8)__builtin_msa_srari_b((v16i8)(__a), __imm)) +#define msa_rshrq_n_u16(__a, __imm) ((v8u16)__builtin_msa_srlri_h((v8i16)(__a), __imm)) +#define msa_rshrq_n_s16(__a, __imm) ((v8i16)__builtin_msa_srari_h((v8i16)(__a), __imm)) +#define msa_rshrq_n_u32(__a, __imm) ((v4u32)__builtin_msa_srlri_w((v4i32)(__a), __imm)) +#define msa_rshrq_n_s32(__a, __imm) ((v4i32)__builtin_msa_srari_w((v4i32)(__a), __imm)) +#define msa_rshrq_n_u64(__a, __imm) ((v2u64)__builtin_msa_srlri_d((v2i64)(__a), __imm)) +#define msa_rshrq_n_s64(__a, __imm) ((v2i64)__builtin_msa_srari_d((v2i64)(__a), __imm)) + +/* Vector saturating rounding shift left, qrshl -> ri = ai << bi; */ +#define msa_qrshrq_s32(a, b) ((v4i32)__msa_srar_w((v4i32)(a), (v4i32)(b))) + +/* Rename the msa builtin func to unify the name style for intrin_msa.hpp */ +#define msa_qaddq_u8 __builtin_msa_adds_u_b +#define msa_qaddq_s8 __builtin_msa_adds_s_b +#define msa_qaddq_u16 __builtin_msa_adds_u_h +#define msa_qaddq_s16 __builtin_msa_adds_s_h +#define msa_qaddq_u32 __builtin_msa_adds_u_w +#define msa_qaddq_s32 __builtin_msa_adds_s_w +#define msa_qaddq_u64 __builtin_msa_adds_u_d +#define msa_qaddq_s64 __builtin_msa_adds_s_d +#define msa_addq_u8(a, b) ((v16u8)__builtin_msa_addv_b((v16i8)(a), (v16i8)(b))) +#define msa_addq_s8 __builtin_msa_addv_b +#define msa_addq_u16(a, b) ((v8u16)__builtin_msa_addv_h((v8i16)(a), (v8i16)(b))) +#define msa_addq_s16 __builtin_msa_addv_h +#define msa_addq_u32(a, b) ((v4u32)__builtin_msa_addv_w((v4i32)(a), (v4i32)(b))) +#define msa_addq_s32 __builtin_msa_addv_w +#define msa_addq_f32 __builtin_msa_fadd_w +#define msa_addq_u64(a, b) ((v2u64)__builtin_msa_addv_d((v2i64)(a), (v2i64)(b))) +#define msa_addq_s64 __builtin_msa_addv_d +#define msa_addq_f64 __builtin_msa_fadd_d +#define msa_qsubq_u8 __builtin_msa_subs_u_b +#define msa_qsubq_s8 __builtin_msa_subs_s_b +#define msa_qsubq_u16 __builtin_msa_subs_u_h +#define msa_qsubq_s16 __builtin_msa_subs_s_h +#define msa_subq_u8(a, b) ((v16u8)__builtin_msa_subv_b((v16i8)(a), (v16i8)(b))) +#define msa_subq_s8 __builtin_msa_subv_b +#define msa_subq_u16(a, b) ((v8u16)__builtin_msa_subv_h((v8i16)(a), (v8i16)(b))) +#define msa_subq_s16 __builtin_msa_subv_h +#define msa_subq_u32(a, b) ((v4u32)__builtin_msa_subv_w((v4i32)(a), (v4i32)(b))) +#define msa_subq_s32 __builtin_msa_subv_w +#define msa_subq_f32 __builtin_msa_fsub_w +#define msa_subq_u64(a, b) ((v2u64)__builtin_msa_subv_d((v2i64)(a), (v2i64)(b))) +#define msa_subq_s64 __builtin_msa_subv_d +#define msa_subq_f64 __builtin_msa_fsub_d +#define msa_mulq_u8(a, b) ((v16u8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b))) +#define msa_mulq_s8(a, b) ((v16i8)__builtin_msa_mulv_b((v16i8)(a), (v16i8)(b))) +#define msa_mulq_u16(a, b) ((v8u16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b))) +#define msa_mulq_s16(a, b) ((v8i16)__builtin_msa_mulv_h((v8i16)(a), (v8i16)(b))) +#define msa_mulq_u32(a, b) ((v4u32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b))) +#define msa_mulq_s32(a, b) ((v4i32)__builtin_msa_mulv_w((v4i32)(a), (v4i32)(b))) +#define msa_mulq_u64(a, b) ((v2u64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b))) +#define msa_mulq_s64(a, b) ((v2i64)__builtin_msa_mulv_d((v2i64)(a), (v2i64)(b))) +#define msa_mulq_f32 __builtin_msa_fmul_w +#define msa_mulq_f64 __builtin_msa_fmul_d +#define msa_divq_f32 __builtin_msa_fdiv_w +#define msa_divq_f64 __builtin_msa_fdiv_d +#define msa_dotp_s_h __builtin_msa_dotp_s_h +#define msa_dotp_s_w __builtin_msa_dotp_s_w +#define msa_dotp_s_d __builtin_msa_dotp_s_d +#define msa_dotp_u_h __builtin_msa_dotp_u_h +#define msa_dotp_u_w __builtin_msa_dotp_u_w +#define msa_dotp_u_d __builtin_msa_dotp_u_d +#define msa_dpadd_s_h __builtin_msa_dpadd_s_h +#define msa_dpadd_s_w __builtin_msa_dpadd_s_w +#define msa_dpadd_s_d __builtin_msa_dpadd_s_d +#define msa_dpadd_u_h __builtin_msa_dpadd_u_h +#define msa_dpadd_u_w __builtin_msa_dpadd_u_w +#define msa_dpadd_u_d __builtin_msa_dpadd_u_d + +#define ILVRL_B2(RTYPE, in0, in1, low, hi) do { \ + low = (RTYPE)__builtin_msa_ilvr_b((v16i8)(in0), (v16i8)(in1)); \ + hi = (RTYPE)__builtin_msa_ilvl_b((v16i8)(in0), (v16i8)(in1)); \ + } while (0) +#define ILVRL_B2_UB(...) ILVRL_B2(v16u8, __VA_ARGS__) +#define ILVRL_B2_SB(...) ILVRL_B2(v16i8, __VA_ARGS__) +#define ILVRL_B2_UH(...) ILVRL_B2(v8u16, __VA_ARGS__) +#define ILVRL_B2_SH(...) ILVRL_B2(v8i16, __VA_ARGS__) +#define ILVRL_B2_SW(...) ILVRL_B2(v4i32, __VA_ARGS__) + +#define ILVRL_H2(RTYPE, in0, in1, low, hi) do { \ + low = (RTYPE)__builtin_msa_ilvr_h((v8i16)(in0), (v8i16)(in1)); \ + hi = (RTYPE)__builtin_msa_ilvl_h((v8i16)(in0), (v8i16)(in1)); \ + } while (0) +#define ILVRL_H2_UB(...) ILVRL_H2(v16u8, __VA_ARGS__) +#define ILVRL_H2_SB(...) ILVRL_H2(v16i8, __VA_ARGS__) +#define ILVRL_H2_UH(...) ILVRL_H2(v8u16, __VA_ARGS__) +#define ILVRL_H2_SH(...) ILVRL_H2(v8i16, __VA_ARGS__) +#define ILVRL_H2_SW(...) ILVRL_H2(v4i32, __VA_ARGS__) +#define ILVRL_H2_UW(...) ILVRL_H2(v4u32, __VA_ARGS__) + +#define ILVRL_W2(RTYPE, in0, in1, low, hi) do { \ + low = (RTYPE)__builtin_msa_ilvr_w((v4i32)(in0), (v4i32)(in1)); \ + hi = (RTYPE)__builtin_msa_ilvl_w((v4i32)(in0), (v4i32)(in1)); \ + } while (0) +#define ILVRL_W2_UB(...) ILVRL_W2(v16u8, __VA_ARGS__) +#define ILVRL_W2_SH(...) ILVRL_W2(v8i16, __VA_ARGS__) +#define ILVRL_W2_SW(...) ILVRL_W2(v4i32, __VA_ARGS__) +#define ILVRL_W2_UW(...) ILVRL_W2(v4u32, __VA_ARGS__) + +/* absq, qabsq (r = |a|;) */ +#define msa_absq_s8(a) __builtin_msa_add_a_b(a, __builtin_msa_fill_b(0)) +#define msa_absq_s16(a) __builtin_msa_add_a_h(a, __builtin_msa_fill_h(0)) +#define msa_absq_s32(a) __builtin_msa_add_a_w(a, __builtin_msa_fill_w(0)) +#define msa_absq_s64(a) __builtin_msa_add_a_d(a, __builtin_msa_fill_d(0)) +#define msa_absq_f32(a) ((v4f32)__builtin_msa_bclri_w((v4u32)(a), 31)) +#define msa_absq_f64(a) ((v2f64)__builtin_msa_bclri_d((v2u64)(a), 63)) +#define msa_qabsq_s8(a) __builtin_msa_adds_a_b(a, __builtin_msa_fill_b(0)) +#define msa_qabsq_s16(a) __builtin_msa_adds_a_h(a, __builtin_msa_fill_h(0)) +#define msa_qabsq_s32(a) __builtin_msa_adds_a_w(a, __builtin_msa_fill_w(0)) +#define msa_qabsq_s64(a) __builtin_msa_adds_a_d(a, __builtin_msa_fill_d(0)) + +/* abdq, qabdq (r = |a - b|;) */ +#define msa_abdq_u8 __builtin_msa_asub_u_b +#define msa_abdq_s8 __builtin_msa_asub_s_b +#define msa_abdq_u16 __builtin_msa_asub_u_h +#define msa_abdq_s16 __builtin_msa_asub_s_h +#define msa_abdq_u32 __builtin_msa_asub_u_w +#define msa_abdq_s32 __builtin_msa_asub_s_w +#define msa_abdq_u64 __builtin_msa_asub_u_d +#define msa_abdq_s64 __builtin_msa_asub_s_d +#define msa_abdq_f32(a, b) msa_absq_f32(__builtin_msa_fsub_w(a, b)) +#define msa_abdq_f64(a, b) msa_absq_f64(__builtin_msa_fsub_d(a, b)) +#define msa_qabdq_s8(a, b) msa_qabsq_s8(__builtin_msa_subs_s_b(a, b)) +#define msa_qabdq_s16(a, b) msa_qabsq_s16(__builtin_msa_subs_s_h(a, b)) +#define msa_qabdq_s32(a, b) msa_qabsq_s32(__builtin_msa_subs_s_w(a, b)) +#define msa_qabdq_s64(a, b) msa_qabsq_s64(__builtin_msa_subs_s_d(a, b)) + +/* sqrtq, rsqrtq */ +#define msa_sqrtq_f32 __builtin_msa_fsqrt_w +#define msa_sqrtq_f64 __builtin_msa_fsqrt_d +#define msa_rsqrtq_f32 __builtin_msa_frsqrt_w +#define msa_rsqrtq_f64 __builtin_msa_frsqrt_d + + +/* mlaq: r = a + b * c; */ +__extension__ extern __inline v4i32 +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +msa_mlaq_s32(v4i32 __a, v4i32 __b, v4i32 __c) +{ + __asm__ volatile("maddv.w %w[__a], %w[__b], %w[__c]\n" + // Outputs + : [__a] "+f"(__a) + // Inputs + : [__b] "f"(__b), [__c] "f"(__c)); + return __a; +} + +__extension__ extern __inline v2i64 +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +msa_mlaq_s64(v2i64 __a, v2i64 __b, v2i64 __c) +{ + __asm__ volatile("maddv.d %w[__a], %w[__b], %w[__c]\n" + // Outputs + : [__a] "+f"(__a) + // Inputs + : [__b] "f"(__b), [__c] "f"(__c)); + return __a; +} + +__extension__ extern __inline v4f32 +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +msa_mlaq_f32(v4f32 __a, v4f32 __b, v4f32 __c) +{ + __asm__ volatile("fmadd.w %w[__a], %w[__b], %w[__c]\n" + // Outputs + : [__a] "+f"(__a) + // Inputs + : [__b] "f"(__b), [__c] "f"(__c)); + return __a; +} + +__extension__ extern __inline v2f64 +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +msa_mlaq_f64(v2f64 __a, v2f64 __b, v2f64 __c) +{ + __asm__ volatile("fmadd.d %w[__a], %w[__b], %w[__c]\n" + // Outputs + : [__a] "+f"(__a) + // Inputs + : [__b] "f"(__b), [__c] "f"(__c)); + return __a; +} + +/* cntq */ +#define msa_cntq_s8 __builtin_msa_pcnt_b +#define msa_cntq_s16 __builtin_msa_pcnt_h +#define msa_cntq_s32 __builtin_msa_pcnt_w +#define msa_cntq_s64 __builtin_msa_pcnt_d + +/* bslq (a: mask; r = b(if a == 0); r = c(if a == 1);) */ +#define msa_bslq_u8 __builtin_msa_bsel_v + +/* ilvrq, ilvlq (For EL only, ilvrq: b0, a0, b1, a1; ilvlq: b2, a2, b3, a3;) */ +#define msa_ilvrq_s8 __builtin_msa_ilvr_b +#define msa_ilvrq_s16 __builtin_msa_ilvr_h +#define msa_ilvrq_s32 __builtin_msa_ilvr_w +#define msa_ilvrq_s64 __builtin_msa_ilvr_d +#define msa_ilvlq_s8 __builtin_msa_ilvl_b +#define msa_ilvlq_s16 __builtin_msa_ilvl_h +#define msa_ilvlq_s32 __builtin_msa_ilvl_w +#define msa_ilvlq_s64 __builtin_msa_ilvl_d + +/* ilvevq, ilvodq (ilvevq: b0, a0, b2, a2; ilvodq: b1, a1, b3, a3; ) */ +#define msa_ilvevq_s8 __builtin_msa_ilvev_b +#define msa_ilvevq_s16 __builtin_msa_ilvev_h +#define msa_ilvevq_s32 __builtin_msa_ilvev_w +#define msa_ilvevq_s64 __builtin_msa_ilvev_d +#define msa_ilvodq_s8 __builtin_msa_ilvod_b +#define msa_ilvodq_s16 __builtin_msa_ilvod_h +#define msa_ilvodq_s32 __builtin_msa_ilvod_w +#define msa_ilvodq_s64 __builtin_msa_ilvod_d + +/* extq (r = (a || b); a concatenation b and get elements from index c) */ +#ifdef _MIPSEB +#define msa_extq_s8(a, b, c) \ +(__builtin_msa_vshf_b(__builtin_msa_subv_b((v16i8)((v2i64){0x1716151413121110, 0x1F1E1D1C1B1A1918}), __builtin_msa_fill_b(c)), a, b)) +#define msa_extq_s16(a, b, c) \ +(__builtin_msa_vshf_h(__builtin_msa_subv_h((v8i16)((v2i64){0x000B000A00090008, 0x000F000E000D000C}), __builtin_msa_fill_h(c)), a, b)) +#define msa_extq_s32(a, b, c) \ +(__builtin_msa_vshf_w(__builtin_msa_subv_w((v4i32)((v2i64){0x0000000500000004, 0x0000000700000006}), __builtin_msa_fill_w(c)), a, b)) +#define msa_extq_s64(a, b, c) \ +(__builtin_msa_vshf_d(__builtin_msa_subv_d((v2i64){0x0000000000000002, 0x0000000000000003}, __builtin_msa_fill_d(c)), a, b)) +#else +#define msa_extq_s8(a, b, c) \ +(__builtin_msa_vshf_b(__builtin_msa_addv_b((v16i8)((v2i64){0x0706050403020100, 0x0F0E0D0C0B0A0908}), __builtin_msa_fill_b(c)), b, a)) +#define msa_extq_s16(a, b, c) \ +(__builtin_msa_vshf_h(__builtin_msa_addv_h((v8i16)((v2i64){0x0003000200010000, 0x0007000600050004}), __builtin_msa_fill_h(c)), b, a)) +#define msa_extq_s32(a, b, c) \ +(__builtin_msa_vshf_w(__builtin_msa_addv_w((v4i32)((v2i64){0x0000000100000000, 0x0000000300000002}), __builtin_msa_fill_w(c)), b, a)) +#define msa_extq_s64(a, b, c) \ +(__builtin_msa_vshf_d(__builtin_msa_addv_d((v2i64){0x0000000000000000, 0x0000000000000001}, __builtin_msa_fill_d(c)), b, a)) +#endif /* _MIPSEB */ + +/* cvttruncq, cvttintq, cvtrintq */ +#define msa_cvttruncq_u32_f32 __builtin_msa_ftrunc_u_w +#define msa_cvttruncq_s32_f32 __builtin_msa_ftrunc_s_w +#define msa_cvttruncq_u64_f64 __builtin_msa_ftrunc_u_d +#define msa_cvttruncq_s64_f64 __builtin_msa_ftrunc_s_d +#define msa_cvttintq_u32_f32 __builtin_msa_ftint_u_w +#define msa_cvttintq_s32_f32 __builtin_msa_ftint_s_w +#define msa_cvttintq_u64_f64 __builtin_msa_ftint_u_d +#define msa_cvttintq_s64_f64 __builtin_msa_ftint_s_d +#define msa_cvtrintq_f32 __builtin_msa_frint_w +#define msa_cvtrintq_f64 __builtin_msa_frint_d + +/* cvtfintq, cvtfq */ +#define msa_cvtfintq_f32_u32 __builtin_msa_ffint_u_w +#define msa_cvtfintq_f32_s32 __builtin_msa_ffint_s_w +#define msa_cvtfintq_f64_u64 __builtin_msa_ffint_u_d +#define msa_cvtfintq_f64_s64 __builtin_msa_ffint_s_d +#define msa_cvtfq_f32_f64 __builtin_msa_fexdo_w +#define msa_cvtflq_f64_f32 __builtin_msa_fexupr_d +#define msa_cvtfhq_f64_f32 __builtin_msa_fexupl_d + +#define msa_addl_u8(a, b) ((v8u16)__builtin_msa_addv_h((v8i16)V8U8_2_V8I16(a), (v8i16)V8U8_2_V8I16(b))) +#define msa_addl_s8(a, b) (__builtin_msa_addv_h((v8i16)V8I8_2_V8I16(a), (v8i16)V8I8_2_V8I16(b))) +#define msa_addl_u16(a, b) ((v4u32)__builtin_msa_addv_w((v4i32)V4U16_2_V4I32(a), (v4i32)V4U16_2_V4I32(b))) +#define msa_addl_s16(a, b) (__builtin_msa_addv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b))) +#define msa_subl_s16(a, b) (__builtin_msa_subv_w((v4i32)V4I16_2_V4I32(a), (v4i32)V4I16_2_V4I32(b))) +#define msa_recpeq_f32 __builtin_msa_frcp_w +#define msa_recpsq_f32(a, b) (__builtin_msa_fsub_w(msa_dupq_n_f32(2.0f), __builtin_msa_fmul_w(a, b))) + +#define MSA_INTERLEAVED_IMPL_LOAD2_STORE2(_Tp, _Tpv, _Tpvs, suffix, df, nlanes) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld2q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \ + *a = (_Tpv)__builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \ + *b = (_Tpv)__builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \ +} \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st2q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b) \ +{ \ + msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df((_Tpvs)b, (_Tpvs)a)); \ + msa_st1q_##suffix(ptr + nlanes, (_Tpv)__builtin_msa_ilvl_##df((_Tpvs)b, (_Tpvs)a)); \ +} + +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint8_t, v16u8, v16i8, u8, b, 16) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int8_t, v16i8, v16i8, s8, b, 16) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint16_t, v8u16, v8i16, u16, h, 8) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int16_t, v8i16, v8i16, s16, h, 8) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint32_t, v4u32, v4i32, u32, w, 4) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int32_t, v4i32, v4i32, s32, w, 4) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(float, v4f32, v4i32, f32, w, 4) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(uint64_t, v2u64, v2i64, u64, d, 2) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(int64_t, v2i64, v2i64, s64, d, 2) +MSA_INTERLEAVED_IMPL_LOAD2_STORE2(double, v2f64, v2i64, f64, d, 2) + +#ifdef _MIPSEB +#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + 16); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + 32); \ + _Tpvs v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0704011F1F1F1F1F, 0x1F1C191613100D0A}), (_Tpvs)v0, (_Tpvs)v1); \ + *a = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x1716150E0B080502, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \ + v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0603001F1F1F1F1F, 0x1E1B1815120F0C09}), (_Tpvs)v0, (_Tpvs)v1); \ + *b = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x1716150D0A070401, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \ + v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x05021F1F1F1F1F1F, 0x1D1A1714110E0B08}), (_Tpvs)v0, (_Tpvs)v1); \ + *c = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x17160F0C09060300, 0x1F1E1D1C1B1A1918}), v3, (_Tpvs)v2); \ +} +#else +#define MSA_INTERLEAVED_IMPL_LOAD3_8(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + 16); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + 32); \ + _Tpvs v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x15120F0C09060300, 0x00000000001E1B18}), (_Tpvs)v1, (_Tpvs)v0); \ + *a = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1D1A1714110A0908}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1613100D0A070401, 0x00000000001F1C19}), (_Tpvs)v1, (_Tpvs)v0); \ + *b = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1E1B1815120A0908}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1714110E0B080502, 0x0000000000001D1A}), (_Tpvs)v1, (_Tpvs)v0); \ + *c = (_Tpv)__builtin_msa_vshf_b((_Tpvs)((v2i64){0x0706050403020100, 0x1F1C191613100908}), (_Tpvs)v2, v3); \ +} +#endif + +MSA_INTERLEAVED_IMPL_LOAD3_8(uint8_t, v16u8, v16i8, u8) +MSA_INTERLEAVED_IMPL_LOAD3_8(int8_t, v16i8, v16i8, s8) + +#ifdef _MIPSEB +#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + 8); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + 16); \ + _Tpvs v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00030000000F000F, 0x000F000C00090006}), (_Tpvs)v1, (_Tpvs)v0); \ + *a = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000A00050002, 0x000F000E000D000C}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0002000F000F000F, 0x000E000B00080005}), (_Tpvs)v1, (_Tpvs)v0); \ + *b = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000700040001, 0x000F000E000D000C}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000F000F000F, 0x000D000A00070004}), (_Tpvs)v1, (_Tpvs)v0); \ + *c = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000600030000, 0x000F000E000D000C}), (_Tpvs)v2, v3); \ +} +#else +#define MSA_INTERLEAVED_IMPL_LOAD3_16(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + 8); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + 16); \ + _Tpvs v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0009000600030000, 0x00000000000F000C}), (_Tpvs)v1, (_Tpvs)v0); \ + *a = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000D000A00050004}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000A000700040001, 0x000000000000000D}), (_Tpvs)v1, (_Tpvs)v0); \ + *b = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000E000B00080004}), (_Tpvs)v2, v3); \ + v3 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B000800050002, 0x000000000000000E}), (_Tpvs)v1, (_Tpvs)v0); \ + *c = (_Tpv)__builtin_msa_vshf_h((_Tpvs)((v2i64){0x0003000200010000, 0x000F000C00090004}), (_Tpvs)v2, v3); \ +} +#endif + +MSA_INTERLEAVED_IMPL_LOAD3_16(uint16_t, v8u16, v8i16, u16) +MSA_INTERLEAVED_IMPL_LOAD3_16(int16_t, v8i16, v8i16, s16) + +#define MSA_INTERLEAVED_IMPL_LOAD3_32(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + _Tpv v00 = msa_ld1q_##suffix(ptr); \ + _Tpv v01 = msa_ld1q_##suffix(ptr + 4); \ + _Tpv v02 = msa_ld1q_##suffix(ptr + 8); \ + _Tpvs v10 = __builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v01, (v2i64)v01), (_Tpvs)v00); \ + _Tpvs v11 = __builtin_msa_ilvr_w((_Tpvs)v02, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v00, (v2i64)v00)); \ + _Tpvs v12 = __builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v02, (v2i64)v02), (_Tpvs)v01); \ + *a = (_Tpv)__builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v11, (v2i64)v11), v10); \ + *b = (_Tpv)__builtin_msa_ilvr_w(v12, (_Tpvs)__builtin_msa_ilvl_d((v2i64)v10, (v2i64)v10)); \ + *c = (_Tpv)__builtin_msa_ilvr_w((_Tpvs)__builtin_msa_ilvl_d((v2i64)v12, (v2i64)v12), v11); \ +} + +MSA_INTERLEAVED_IMPL_LOAD3_32(uint32_t, v4u32, v4i32, u32) +MSA_INTERLEAVED_IMPL_LOAD3_32(int32_t, v4i32, v4i32, s32) +MSA_INTERLEAVED_IMPL_LOAD3_32(float, v4f32, v4i32, f32) + +#define MSA_INTERLEAVED_IMPL_LOAD3_64(_Tp, _Tpv, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld3q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c) \ +{ \ + *((_Tp*)a) = *ptr; *((_Tp*)b) = *(ptr + 1); *((_Tp*)c) = *(ptr + 2); \ + *((_Tp*)a + 1) = *(ptr + 3); *((_Tp*)b + 1) = *(ptr + 4); *((_Tp*)c + 1) = *(ptr + 5); \ +} + +MSA_INTERLEAVED_IMPL_LOAD3_64(uint64_t, v2u64, u64) +MSA_INTERLEAVED_IMPL_LOAD3_64(int64_t, v2i64, s64) +MSA_INTERLEAVED_IMPL_LOAD3_64(double, v2f64, f64) + +#ifdef _MIPSEB +#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0F0E0D0C0B1F1F1F, 0x1F1E1D1C1B1A1F1F}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0D1C140C1B130B1A, 0x1F170F1E160E1D15}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0A09080706051F1F, 0x19181716151F1F1F}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x1D14071C13061B12, 0x170A1F16091E1508}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x04030201001F1F1F, 0x14131211101F1F1F}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x15021C14011B1300, 0x051F17041E16031D}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \ +} +#else +#define MSA_INTERLEAVED_IMPL_STORE3_8(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000050403020100, 0x0000001413121110}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0A02110901100800, 0x05140C04130B0312}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000000A09080706, 0x00001A1918171615}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x170A011609001508, 0x0D04190C03180B02}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x0000000F0E0D0C0B, 0x0000001F1E1D1C1B}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_b((_Tpvs)((v2i64){0x021C09011B08001A, 0x1F0C041E0B031D0A}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 32, (_Tpv)v1); \ +} +#endif + +MSA_INTERLEAVED_IMPL_STORE3_8(uint8_t, v16u8, v16i8, u8) +MSA_INTERLEAVED_IMPL_STORE3_8(int8_t, v16i8, v16i8, s8) + +#ifdef _MIPSEB +#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000700060005000F, 0x000F000E000D000F}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000A0006000D0009, 0x000F000B0007000E}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00040003000F000F, 0x000C000B000A000F}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000E000A0003000D, 0x0005000F000B0004}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000200010000000F, 0x00090008000F000F}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000E00090000, 0x000B0002000F000A}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \ +} +#else +#define MSA_INTERLEAVED_IMPL_STORE3_16(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000200010000, 0x0000000A00090008}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0001000800040000, 0x0006000200090005}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000500040003, 0x00000000000C000B}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x000B00040000000A, 0x0002000C00050001}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x0000000000070006, 0x0000000F000E000D}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_h((_Tpvs)((v2i64){0x00050000000D0004, 0x000F00060001000E}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 16, (_Tpv)v1); \ +} +#endif + +MSA_INTERLEAVED_IMPL_STORE3_16(uint16_t, v8u16, v8i16, u16) +MSA_INTERLEAVED_IMPL_STORE3_16(int16_t, v8i16, v8i16, s16) + +#ifdef _MIPSEB +#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000300000007, 0x0000000700000006}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000300000006, 0x0000000700000005}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000200000001, 0x0000000500000007}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000700000004, 0x0000000500000002}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000007, 0x0000000400000007}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000500000000, 0x0000000100000007}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \ +} +#else +#define MSA_INTERLEAVED_IMPL_STORE3_32(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + _Tpvs v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000100000000, 0x0000000000000004}), (_Tpvs)b, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000200000000, 0x0000000100000004}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000002, 0x0000000600000005}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000500000002, 0x0000000300000000}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 4, (_Tpv)v1); \ + v0 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000003, 0x0000000000000007}), (_Tpvs)b, (_Tpvs)a); \ + v1 = __builtin_msa_vshf_w((_Tpvs)((v2i64){0x0000000000000006, 0x0000000700000002}), (_Tpvs)c, (_Tpvs)v0); \ + msa_st1q_##suffix(ptr + 8, (_Tpv)v1); \ +} +#endif + +MSA_INTERLEAVED_IMPL_STORE3_32(uint32_t, v4u32, v4i32, u32) +MSA_INTERLEAVED_IMPL_STORE3_32(int32_t, v4i32, v4i32, s32) +MSA_INTERLEAVED_IMPL_STORE3_32(float, v4f32, v4i32, f32) + +#define MSA_INTERLEAVED_IMPL_STORE3_64(_Tp, _Tpv, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st3q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c) \ +{ \ + *ptr = a[0]; *(ptr + 1) = b[0]; *(ptr + 2) = c[0]; \ + *(ptr + 3) = a[1]; *(ptr + 4) = b[1]; *(ptr + 5) = c[1]; \ +} + +MSA_INTERLEAVED_IMPL_STORE3_64(uint64_t, v2u64, u64) +MSA_INTERLEAVED_IMPL_STORE3_64(int64_t, v2i64, s64) +MSA_INTERLEAVED_IMPL_STORE3_64(double, v2f64, f64) + +#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4(_Tp, _Tpv, _Tpvs, suffix, df, nlanes) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld4q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c, _Tpv* d) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + nlanes); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + nlanes * 2); \ + _Tpv v3 = msa_ld1q_##suffix(ptr + nlanes * 3); \ + _Tpvs t0 = __builtin_msa_pckev_##df((_Tpvs)v1, (_Tpvs)v0); \ + _Tpvs t1 = __builtin_msa_pckev_##df((_Tpvs)v3, (_Tpvs)v2); \ + _Tpvs t2 = __builtin_msa_pckod_##df((_Tpvs)v1, (_Tpvs)v0); \ + _Tpvs t3 = __builtin_msa_pckod_##df((_Tpvs)v3, (_Tpvs)v2); \ + *a = (_Tpv)__builtin_msa_pckev_##df(t1, t0); \ + *b = (_Tpv)__builtin_msa_pckev_##df(t3, t2); \ + *c = (_Tpv)__builtin_msa_pckod_##df(t1, t0); \ + *d = (_Tpv)__builtin_msa_pckod_##df(t3, t2); \ +} \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st4q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c, const _Tpv d) \ +{ \ + _Tpvs v0 = __builtin_msa_ilvr_##df((_Tpvs)c, (_Tpvs)a); \ + _Tpvs v1 = __builtin_msa_ilvr_##df((_Tpvs)d, (_Tpvs)b); \ + _Tpvs v2 = __builtin_msa_ilvl_##df((_Tpvs)c, (_Tpvs)a); \ + _Tpvs v3 = __builtin_msa_ilvl_##df((_Tpvs)d, (_Tpvs)b); \ + msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_##df(v1, v0)); \ + msa_st1q_##suffix(ptr + nlanes, (_Tpv)__builtin_msa_ilvl_##df(v1, v0)); \ + msa_st1q_##suffix(ptr + 2 * nlanes, (_Tpv)__builtin_msa_ilvr_##df(v3, v2)); \ + msa_st1q_##suffix(ptr + 3 * nlanes, (_Tpv)__builtin_msa_ilvl_##df(v3, v2)); \ +} + +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint8_t, v16u8, v16i8, u8, b, 16) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int8_t, v16i8, v16i8, s8, b, 16) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint16_t, v8u16, v8i16, u16, h, 8) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int16_t, v8i16, v8i16, s16, h, 8) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(uint32_t, v4u32, v4i32, u32, w, 4) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(int32_t, v4i32, v4i32, s32, w, 4) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4(float, v4f32, v4i32, f32, w, 4) + +#define MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(_Tp, _Tpv, _Tpvs, suffix) \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_ld4q_##suffix(const _Tp* ptr, _Tpv* a, _Tpv* b, _Tpv* c, _Tpv* d) \ +{ \ + _Tpv v0 = msa_ld1q_##suffix(ptr); \ + _Tpv v1 = msa_ld1q_##suffix(ptr + 2); \ + _Tpv v2 = msa_ld1q_##suffix(ptr + 4); \ + _Tpv v3 = msa_ld1q_##suffix(ptr + 6); \ + *a = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v2, (_Tpvs)v0); \ + *b = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v2, (_Tpvs)v0); \ + *c = (_Tpv)__builtin_msa_ilvr_d((_Tpvs)v3, (_Tpvs)v1); \ + *d = (_Tpv)__builtin_msa_ilvl_d((_Tpvs)v3, (_Tpvs)v1); \ +} \ +__extension__ extern __inline void \ +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) \ +msa_st4q_##suffix(_Tp* ptr, const _Tpv a, const _Tpv b, const _Tpv c, const _Tpv d) \ +{ \ + msa_st1q_##suffix(ptr, (_Tpv)__builtin_msa_ilvr_d((_Tpvs)b, (_Tpvs)a)); \ + msa_st1q_##suffix(ptr + 2, (_Tpv)__builtin_msa_ilvr_d((_Tpvs)d, (_Tpvs)c)); \ + msa_st1q_##suffix(ptr + 4, (_Tpv)__builtin_msa_ilvl_d((_Tpvs)b, (_Tpvs)a)); \ + msa_st1q_##suffix(ptr + 6, (_Tpv)__builtin_msa_ilvl_d((_Tpvs)d, (_Tpvs)c)); \ +} + +MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(uint64_t, v2u64, v2i64, u64) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(int64_t, v2i64, v2i64, s64) +MSA_INTERLEAVED_IMPL_LOAD4_STORE4_64(double, v2f64, v2i64, f64) + +__extension__ extern __inline v8i16 +__attribute__ ((__always_inline__, __gnu_inline__, __artificial__)) +msa_qdmulhq_n_s16(v8i16 a, int16_t b) +{ + v8i16 a_lo, a_hi; + ILVRL_H2_SH(a, msa_dupq_n_s16(0), a_lo, a_hi); + return msa_packr_s32(msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_lo), msa_dupq_n_s32(b)), 1), + msa_shlq_n_s32(msa_mulq_s32(msa_paddlq_s16(a_hi), msa_dupq_n_s32(b)), 1), 16); +} + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /*__mips_msa*/ +#endif /* OPENCV_CORE_MSA_MACROS_H */ diff --git a/3rdparty/opencv/include/opencv2/core/hal/simd_utils.impl.hpp b/3rdparty/opencv/include/opencv2/core/hal/simd_utils.impl.hpp new file mode 100644 index 0000000..fff8f94 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/hal/simd_utils.impl.hpp @@ -0,0 +1,146 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html + +// This header is not standalone. Don't include directly, use "intrin.hpp" instead. +#ifdef OPENCV_HAL_INTRIN_HPP // defined in intrin.hpp + + +#if CV_SIMD128 || CV_SIMD128_CPP + +template struct Type2Vec128_Traits; +#define CV_INTRIN_DEF_TYPE2VEC128_TRAITS(type_, vec_type_) \ + template<> struct Type2Vec128_Traits \ + { \ + typedef vec_type_ vec_type; \ + } + +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(uchar, v_uint8x16); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(schar, v_int8x16); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(ushort, v_uint16x8); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(short, v_int16x8); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(unsigned, v_uint32x4); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(int, v_int32x4); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(float, v_float32x4); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(uint64, v_uint64x2); +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(int64, v_int64x2); +#if CV_SIMD128_64F +CV_INTRIN_DEF_TYPE2VEC128_TRAITS(double, v_float64x2); +#endif + +template static inline +typename Type2Vec128_Traits<_T>::vec_type v_setall(const _T& a); + +template<> inline Type2Vec128_Traits< uchar>::vec_type v_setall< uchar>(const uchar& a) { return v_setall_u8(a); } +template<> inline Type2Vec128_Traits< schar>::vec_type v_setall< schar>(const schar& a) { return v_setall_s8(a); } +template<> inline Type2Vec128_Traits::vec_type v_setall(const ushort& a) { return v_setall_u16(a); } +template<> inline Type2Vec128_Traits< short>::vec_type v_setall< short>(const short& a) { return v_setall_s16(a); } +template<> inline Type2Vec128_Traits< uint>::vec_type v_setall< uint>(const uint& a) { return v_setall_u32(a); } +template<> inline Type2Vec128_Traits< int>::vec_type v_setall< int>(const int& a) { return v_setall_s32(a); } +template<> inline Type2Vec128_Traits::vec_type v_setall(const uint64& a) { return v_setall_u64(a); } +template<> inline Type2Vec128_Traits< int64>::vec_type v_setall< int64>(const int64& a) { return v_setall_s64(a); } +template<> inline Type2Vec128_Traits< float>::vec_type v_setall< float>(const float& a) { return v_setall_f32(a); } +#if CV_SIMD128_64F +template<> inline Type2Vec128_Traits::vec_type v_setall(const double& a) { return v_setall_f64(a); } +#endif + +#endif // SIMD128 + + +#if CV_SIMD256 + +template struct Type2Vec256_Traits; +#define CV_INTRIN_DEF_TYPE2VEC256_TRAITS(type_, vec_type_) \ + template<> struct Type2Vec256_Traits \ + { \ + typedef vec_type_ vec_type; \ + } + +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(uchar, v_uint8x32); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(schar, v_int8x32); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(ushort, v_uint16x16); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(short, v_int16x16); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(unsigned, v_uint32x8); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(int, v_int32x8); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(float, v_float32x8); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(uint64, v_uint64x4); +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(int64, v_int64x4); +#if CV_SIMD256_64F +CV_INTRIN_DEF_TYPE2VEC256_TRAITS(double, v_float64x4); +#endif + +template static inline +typename Type2Vec256_Traits<_T>::vec_type v256_setall(const _T& a); + +template<> inline Type2Vec256_Traits< uchar>::vec_type v256_setall< uchar>(const uchar& a) { return v256_setall_u8(a); } +template<> inline Type2Vec256_Traits< schar>::vec_type v256_setall< schar>(const schar& a) { return v256_setall_s8(a); } +template<> inline Type2Vec256_Traits::vec_type v256_setall(const ushort& a) { return v256_setall_u16(a); } +template<> inline Type2Vec256_Traits< short>::vec_type v256_setall< short>(const short& a) { return v256_setall_s16(a); } +template<> inline Type2Vec256_Traits< uint>::vec_type v256_setall< uint>(const uint& a) { return v256_setall_u32(a); } +template<> inline Type2Vec256_Traits< int>::vec_type v256_setall< int>(const int& a) { return v256_setall_s32(a); } +template<> inline Type2Vec256_Traits::vec_type v256_setall(const uint64& a) { return v256_setall_u64(a); } +template<> inline Type2Vec256_Traits< int64>::vec_type v256_setall< int64>(const int64& a) { return v256_setall_s64(a); } +template<> inline Type2Vec256_Traits< float>::vec_type v256_setall< float>(const float& a) { return v256_setall_f32(a); } +#if CV_SIMD256_64F +template<> inline Type2Vec256_Traits::vec_type v256_setall(const double& a) { return v256_setall_f64(a); } +#endif + +#endif // SIMD256 + + +#if CV_SIMD512 + +template struct Type2Vec512_Traits; +#define CV_INTRIN_DEF_TYPE2VEC512_TRAITS(type_, vec_type_) \ + template<> struct Type2Vec512_Traits \ + { \ + typedef vec_type_ vec_type; \ + } + +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(uchar, v_uint8x64); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(schar, v_int8x64); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(ushort, v_uint16x32); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(short, v_int16x32); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(unsigned, v_uint32x16); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(int, v_int32x16); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(float, v_float32x16); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(uint64, v_uint64x8); +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(int64, v_int64x8); +#if CV_SIMD512_64F +CV_INTRIN_DEF_TYPE2VEC512_TRAITS(double, v_float64x8); +#endif + +template static inline +typename Type2Vec512_Traits<_T>::vec_type v512_setall(const _T& a); + +template<> inline Type2Vec512_Traits< uchar>::vec_type v512_setall< uchar>(const uchar& a) { return v512_setall_u8(a); } +template<> inline Type2Vec512_Traits< schar>::vec_type v512_setall< schar>(const schar& a) { return v512_setall_s8(a); } +template<> inline Type2Vec512_Traits::vec_type v512_setall(const ushort& a) { return v512_setall_u16(a); } +template<> inline Type2Vec512_Traits< short>::vec_type v512_setall< short>(const short& a) { return v512_setall_s16(a); } +template<> inline Type2Vec512_Traits< uint>::vec_type v512_setall< uint>(const uint& a) { return v512_setall_u32(a); } +template<> inline Type2Vec512_Traits< int>::vec_type v512_setall< int>(const int& a) { return v512_setall_s32(a); } +template<> inline Type2Vec512_Traits::vec_type v512_setall(const uint64& a) { return v512_setall_u64(a); } +template<> inline Type2Vec512_Traits< int64>::vec_type v512_setall< int64>(const int64& a) { return v512_setall_s64(a); } +template<> inline Type2Vec512_Traits< float>::vec_type v512_setall< float>(const float& a) { return v512_setall_f32(a); } +#if CV_SIMD512_64F +template<> inline Type2Vec512_Traits::vec_type v512_setall(const double& a) { return v512_setall_f64(a); } +#endif + +#endif // SIMD512 + + +#if CV_SIMD_WIDTH == 16 +template static inline +typename Type2Vec128_Traits<_T>::vec_type vx_setall(const _T& a) { return v_setall(a); } +#elif CV_SIMD_WIDTH == 32 +template static inline +typename Type2Vec256_Traits<_T>::vec_type vx_setall(const _T& a) { return v256_setall(a); } +#elif CV_SIMD_WIDTH == 64 +template static inline +typename Type2Vec512_Traits<_T>::vec_type vx_setall(const _T& a) { return v512_setall(a); } +#else +#error "Build configuration error, unsupported CV_SIMD_WIDTH" +#endif + + +#endif // OPENCV_HAL_INTRIN_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/ippasync.hpp b/3rdparty/opencv/include/opencv2/core/ippasync.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/ippasync.hpp rename to 3rdparty/opencv/include/opencv2/core/ippasync.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/mat.hpp b/3rdparty/opencv/include/opencv2/core/mat.hpp similarity index 98% rename from qt-correction-tool/pub/opencv/include/opencv2/core/mat.hpp rename to 3rdparty/opencv/include/opencv2/core/mat.hpp index 2c23a2a..d0ce61e 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/mat.hpp +++ b/3rdparty/opencv/include/opencv2/core/mat.hpp @@ -151,7 +151,7 @@ number of components (vectors/matrices) of the outer vector. In general, type support is limited to cv::Mat types. Other types are forbidden. But in some cases we need to support passing of custom non-general Mat types, like arrays of cv::KeyPoint, cv::DMatch, etc. -This data is not intented to be interpreted as an image data, or processed somehow like regular cv::Mat. +This data is not intended to be interpreted as an image data, or processed somehow like regular cv::Mat. To pass such custom type use rawIn() / rawOut() / rawInOut() wrappers. Custom type is wrapped as Mat-compatible `CV_8UC` values (N = sizeof(T), N <= CV_CN_MAX). */ @@ -170,7 +170,9 @@ public: STD_VECTOR = 3 << KIND_SHIFT, STD_VECTOR_VECTOR = 4 << KIND_SHIFT, STD_VECTOR_MAT = 5 << KIND_SHIFT, - EXPR = 6 << KIND_SHIFT, +#if OPENCV_ABI_COMPATIBILITY < 500 + EXPR = 6 << KIND_SHIFT, //!< removed: https://github.com/opencv/opencv/pull/17046 +#endif OPENGL_BUFFER = 7 << KIND_SHIFT, CUDA_HOST_MEM = 8 << KIND_SHIFT, CUDA_GPU_MAT = 9 << KIND_SHIFT, @@ -178,7 +180,9 @@ public: STD_VECTOR_UMAT =11 << KIND_SHIFT, STD_BOOL_VECTOR =12 << KIND_SHIFT, STD_VECTOR_CUDA_GPU_MAT = 13 << KIND_SHIFT, - STD_ARRAY =14 << KIND_SHIFT, +#if OPENCV_ABI_COMPATIBILITY < 500 + STD_ARRAY =14 << KIND_SHIFT, //!< removed: https://github.com/opencv/opencv/issues/18897 +#endif STD_ARRAY_MAT =15 << KIND_SHIFT }; @@ -377,6 +381,9 @@ public: void assign(const std::vector& v) const; void assign(const std::vector& v) const; + + void move(UMat& u) const; + void move(Mat& m) const; }; @@ -576,24 +583,24 @@ struct CV_EXPORTS UMatData struct CV_EXPORTS MatSize { - explicit MatSize(int* _p); - int dims() const; + explicit MatSize(int* _p) CV_NOEXCEPT; + int dims() const CV_NOEXCEPT; Size operator()() const; const int& operator[](int i) const; int& operator[](int i); - operator const int*() const; // TODO OpenCV 4.0: drop this - bool operator == (const MatSize& sz) const; - bool operator != (const MatSize& sz) const; + operator const int*() const CV_NOEXCEPT; // TODO OpenCV 4.0: drop this + bool operator == (const MatSize& sz) const CV_NOEXCEPT; + bool operator != (const MatSize& sz) const CV_NOEXCEPT; int* p; }; struct CV_EXPORTS MatStep { - MatStep(); - explicit MatStep(size_t s); - const size_t& operator[](int i) const; - size_t& operator[](int i); + MatStep() CV_NOEXCEPT; + explicit MatStep(size_t s) CV_NOEXCEPT; + const size_t& operator[](int i) const CV_NOEXCEPT; + size_t& operator[](int i) CV_NOEXCEPT; operator size_t() const; MatStep& operator = (size_t s); @@ -699,11 +706,16 @@ sub-matrices. -# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or a processing module for gstreamer, and so on). For example: @code - void process_video_frame(const unsigned char* pixels, - int width, int height, int step) + Mat process_video_frame(const unsigned char* pixels, + int width, int height, int step) { - Mat img(height, width, CV_8UC3, pixels, step); - GaussianBlur(img, img, Size(7,7), 1.5, 1.5); + // wrap input buffer + Mat img(height, width, CV_8UC3, (unsigned char*)pixels, step); + + Mat result; + GaussianBlur(img, result, Size(7, 7), 1.5, 1.5); + + return result; } @endcode -# Quickly initialize small matrices and/or get a super-fast element access. @@ -807,7 +819,7 @@ public: The constructed matrix can further be assigned to another matrix or matrix expression or can be allocated with Mat::create . In the former case, the old content is de-referenced. */ - Mat(); + Mat() CV_NOEXCEPT; /** @overload @param rows Number of rows in a 2D array. @@ -2208,7 +2220,7 @@ public: typedef MatConstIterator_<_Tp> const_iterator; //! default constructor - Mat_(); + Mat_() CV_NOEXCEPT; //! equivalent to Mat(_rows, _cols, DataType<_Tp>::type) Mat_(int _rows, int _cols); //! constructor that sets each matrix element to specified value @@ -2408,12 +2420,12 @@ class CV_EXPORTS UMat { public: //! default constructor - UMat(UMatUsageFlags usageFlags = USAGE_DEFAULT); + UMat(UMatUsageFlags usageFlags = USAGE_DEFAULT) CV_NOEXCEPT; //! constructs 2D matrix of the specified size and type // (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.) UMat(int rows, int cols, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); UMat(Size size, int type, UMatUsageFlags usageFlags = USAGE_DEFAULT); - //! constucts 2D matrix and fills it with the specified value _s. + //! constructs 2D matrix and fills it with the specified value _s. UMat(int rows, int cols, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT); UMat(Size size, int type, const Scalar& s, UMatUsageFlags usageFlags = USAGE_DEFAULT); @@ -2429,20 +2441,11 @@ public: UMat(const UMat& m, const Rect& roi); UMat(const UMat& m, const Range* ranges); UMat(const UMat& m, const std::vector& ranges); + + // FIXIT copyData=false is not implemented, drop this in favor of cv::Mat (OpenCV 5.0) //! builds matrix from std::vector with or without copying the data template explicit UMat(const std::vector<_Tp>& vec, bool copyData=false); - //! builds matrix from cv::Vec; the data is copied by default - template explicit UMat(const Vec<_Tp, n>& vec, bool copyData=true); - //! builds matrix from cv::Matx; the data is copied by default - template explicit UMat(const Matx<_Tp, m, n>& mtx, bool copyData=true); - //! builds matrix from a 2D point - template explicit UMat(const Point_<_Tp>& pt, bool copyData=true); - //! builds matrix from a 3D point - template explicit UMat(const Point3_<_Tp>& pt, bool copyData=true); - //! builds matrix from comma initializer - template explicit UMat(const MatCommaInitializer_<_Tp>& commaInitializer); - //! destructor - calls release() ~UMat(); //! assignment operators @@ -2860,7 +2863,7 @@ public: `ref<_Tp>(i0,...[,hashval])` is equivalent to `*(_Tp*)ptr(i0,...,true[,hashval])`. The methods always return a valid reference. - If the element did not exist, it is created and initialiazed with 0. + If the element did not exist, it is created and initialized with 0. */ //! returns reference to the specified element (1D case) template _Tp& ref(int i0, size_t* hashval=0); @@ -3577,6 +3580,8 @@ public: Mat cross(const Mat& m) const; double dot(const Mat& m) const; + void swap(MatExpr& b); + const MatOp* op; int flags; diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/mat.inl.hpp b/3rdparty/opencv/include/opencv2/core/mat.inl.hpp similarity index 86% rename from qt-correction-tool/pub/opencv/include/opencv2/core/mat.inl.hpp rename to 3rdparty/opencv/include/opencv2/core/mat.inl.hpp index a2e7923..4935755 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/mat.inl.hpp +++ b/3rdparty/opencv/include/opencv2/core/mat.inl.hpp @@ -54,6 +54,21 @@ #pragma warning( disable: 4127 ) #endif +#if defined(CV_SKIP_DISABLE_CLANG_ENUM_WARNINGS) + // nothing +#elif defined(CV_FORCE_DISABLE_CLANG_ENUM_WARNINGS) + #define CV_DISABLE_CLANG_ENUM_WARNINGS +#elif defined(__clang__) && defined(__has_warning) + #if __has_warning("-Wdeprecated-enum-enum-conversion") && __has_warning("-Wdeprecated-anon-enum-enum-conversion") + #define CV_DISABLE_CLANG_ENUM_WARNINGS + #endif +#endif +#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-enum-enum-conversion" +#pragma clang diagnostic ignored "-Wdeprecated-anon-enum-enum-conversion" +#endif + namespace cv { CV__DEBUG_NS_BEGIN @@ -97,7 +112,7 @@ _InputArray::_InputArray(const std::vector<_Tp>& vec) #ifdef CV_CXX_STD_ARRAY template inline _InputArray::_InputArray(const std::array<_Tp, _Nm>& arr) -{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_READ, arr.data(), Size(1, _Nm)); } +{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ, arr.data(), Size(1, _Nm)); } template inline _InputArray::_InputArray(const std::array& arr) @@ -135,9 +150,6 @@ _InputArray::_InputArray(const Mat_<_Tp>& m) inline _InputArray::_InputArray(const double& val) { init(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F + ACCESS_READ, &val, Size(1,1)); } -inline _InputArray::_InputArray(const MatExpr& expr) -{ init(FIXED_TYPE + FIXED_SIZE + EXPR + ACCESS_READ, &expr); } - inline _InputArray::_InputArray(const cuda::GpuMat& d_mat) { init(CUDA_GPU_MAT + ACCESS_READ, &d_mat); } @@ -164,7 +176,7 @@ template inline _InputArray _InputArray::rawIn(const std::array<_Tp, _Nm>& arr) { _InputArray v; - v.flags = FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_READ; + v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_READ; v.obj = (void*)arr.data(); v.sz = Size(1, _Nm); return v; @@ -187,7 +199,7 @@ inline bool _InputArray::isUMatVector() const { return kind() == _InputArray::S inline bool _InputArray::isMatx() const { return kind() == _InputArray::MATX; } inline bool _InputArray::isVector() const { return kind() == _InputArray::STD_VECTOR || kind() == _InputArray::STD_BOOL_VECTOR || - kind() == _InputArray::STD_ARRAY; } + (kind() == _InputArray::MATX && (sz.width <= 1 || sz.height <= 1)); } inline bool _InputArray::isGpuMat() const { return kind() == _InputArray::CUDA_GPU_MAT; } inline bool _InputArray::isGpuMatVector() const { return kind() == _InputArray::STD_VECTOR_CUDA_GPU_MAT; } @@ -207,7 +219,7 @@ _OutputArray::_OutputArray(std::vector<_Tp>& vec) #ifdef CV_CXX_STD_ARRAY template inline _OutputArray::_OutputArray(std::array<_Tp, _Nm>& arr) -{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); } +{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); } template inline _OutputArray::_OutputArray(std::array& arr) @@ -249,7 +261,7 @@ _OutputArray::_OutputArray(const std::vector<_Tp>& vec) #ifdef CV_CXX_STD_ARRAY template inline _OutputArray::_OutputArray(const std::array<_Tp, _Nm>& arr) -{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); } +{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE, arr.data(), Size(1, _Nm)); } template inline _OutputArray::_OutputArray(const std::array& arr) @@ -324,7 +336,7 @@ template inline _OutputArray _OutputArray::rawOut(std::array<_Tp, _Nm>& arr) { _OutputArray v; - v.flags = FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_WRITE; + v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_WRITE; v.obj = (void*)arr.data(); v.sz = Size(1, _Nm); return v; @@ -347,7 +359,7 @@ _InputOutputArray::_InputOutputArray(std::vector<_Tp>& vec) #ifdef CV_CXX_STD_ARRAY template inline _InputOutputArray::_InputOutputArray(std::array<_Tp, _Nm>& arr) -{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); } +{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); } template inline _InputOutputArray::_InputOutputArray(std::array& arr) @@ -384,7 +396,7 @@ _InputOutputArray::_InputOutputArray(const std::vector<_Tp>& vec) #ifdef CV_CXX_STD_ARRAY template inline _InputOutputArray::_InputOutputArray(const std::array<_Tp, _Nm>& arr) -{ init(FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); } +{ init(FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW, arr.data(), Size(1, _Nm)); } template inline _InputOutputArray::_InputOutputArray(const std::array& arr) @@ -461,7 +473,7 @@ template inline _InputOutputArray _InputOutputArray::rawInOut(std::array<_Tp, _Nm>& arr) { _InputOutputArray v; - v.flags = FIXED_TYPE + FIXED_SIZE + STD_ARRAY + traits::Type<_Tp>::value + ACCESS_RW; + v.flags = FIXED_TYPE + FIXED_SIZE + MATX + traits::Type<_Tp>::value + ACCESS_RW; v.obj = (void*)arr.data(); v.sz = Size(1, _Nm); return v; @@ -477,158 +489,6 @@ CV__DEBUG_NS_END //////////////////////////////////////////// Mat ////////////////////////////////////////// -inline -Mat::Mat() - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{} - -inline -Mat::Mat(int _rows, int _cols, int _type) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_rows, _cols, _type); -} - -inline -Mat::Mat(int _rows, int _cols, int _type, const Scalar& _s) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_rows, _cols, _type); - *this = _s; -} - -inline -Mat::Mat(Size _sz, int _type) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create( _sz.height, _sz.width, _type ); -} - -inline -Mat::Mat(Size _sz, int _type, const Scalar& _s) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_sz.height, _sz.width, _type); - *this = _s; -} - -inline -Mat::Mat(int _dims, const int* _sz, int _type) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_dims, _sz, _type); -} - -inline -Mat::Mat(int _dims, const int* _sz, int _type, const Scalar& _s) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_dims, _sz, _type); - *this = _s; -} - -inline -Mat::Mat(const std::vector& _sz, int _type) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_sz, _type); -} - -inline -Mat::Mat(const std::vector& _sz, int _type, const Scalar& _s) - : flags(MAGIC_VAL), dims(0), rows(0), cols(0), data(0), datastart(0), dataend(0), - datalimit(0), allocator(0), u(0), size(&rows), step(0) -{ - create(_sz, _type); - *this = _s; -} - -inline -Mat::Mat(const Mat& m) - : flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), data(m.data), - datastart(m.datastart), dataend(m.dataend), datalimit(m.datalimit), allocator(m.allocator), - u(m.u), size(&rows), step(0) -{ - if( u ) - CV_XADD(&u->refcount, 1); - if( m.dims <= 2 ) - { - step[0] = m.step[0]; step[1] = m.step[1]; - } - else - { - dims = 0; - copySize(m); - } -} - -inline -Mat::Mat(int _rows, int _cols, int _type, void* _data, size_t _step) - : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_rows), cols(_cols), - data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0), - allocator(0), u(0), size(&rows) -{ - CV_Assert(total() == 0 || data != NULL); - - size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type); - size_t minstep = cols * esz; - if( _step == AUTO_STEP ) - { - _step = minstep; - } - else - { - CV_DbgAssert( _step >= minstep ); - if (_step % esz1 != 0) - { - CV_Error(Error::BadStep, "Step must be a multiple of esz1"); - } - } - step[0] = _step; - step[1] = esz; - datalimit = datastart + _step * rows; - dataend = datalimit - _step + minstep; - updateContinuityFlag(); -} - -inline -Mat::Mat(Size _sz, int _type, void* _data, size_t _step) - : flags(MAGIC_VAL + (_type & TYPE_MASK)), dims(2), rows(_sz.height), cols(_sz.width), - data((uchar*)_data), datastart((uchar*)_data), dataend(0), datalimit(0), - allocator(0), u(0), size(&rows) -{ - CV_Assert(total() == 0 || data != NULL); - - size_t esz = CV_ELEM_SIZE(_type), esz1 = CV_ELEM_SIZE1(_type); - size_t minstep = cols*esz; - if( _step == AUTO_STEP ) - { - _step = minstep; - } - else - { - CV_DbgAssert( _step >= minstep ); - - if (_step % esz1 != 0) - { - CV_Error(Error::BadStep, "Step must be a multiple of esz1"); - } - } - step[0] = _step; - step[1] = esz; - datalimit = datastart + _step*rows; - dataend = datalimit - _step + minstep; - updateContinuityFlag(); -} - template inline Mat::Mat(const std::vector<_Tp>& vec, bool copyData) : flags(MAGIC_VAL | traits::Type<_Tp>::value | CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), @@ -766,43 +626,6 @@ Mat::Mat(const MatCommaInitializer_<_Tp>& commaInitializer) *this = commaInitializer.operator Mat_<_Tp>(); } -inline -Mat::~Mat() -{ - release(); - if( step.p != step.buf ) - fastFree(step.p); -} - -inline -Mat& Mat::operator = (const Mat& m) -{ - if( this != &m ) - { - if( m.u ) - CV_XADD(&m.u->refcount, 1); - release(); - flags = m.flags; - if( dims <= 2 && m.dims <= 2 ) - { - dims = m.dims; - rows = m.rows; - cols = m.cols; - step[0] = m.step[0]; - step[1] = m.step[1]; - } - else - copySize(m); - data = m.data; - datastart = m.datastart; - dataend = m.dataend; - datalimit = m.datalimit; - allocator = m.allocator; - u = m.u; - } - return *this; -} - inline Mat Mat::row(int y) const { @@ -839,67 +662,6 @@ Mat Mat::colRange(const Range& r) const return Mat(*this, Range::all(), r); } -inline -Mat Mat::clone() const -{ - Mat m; - copyTo(m); - return m; -} - -inline -void Mat::assignTo( Mat& m, int _type ) const -{ - if( _type < 0 ) - m = *this; - else - convertTo(m, _type); -} - -inline -void Mat::create(int _rows, int _cols, int _type) -{ - _type &= TYPE_MASK; - if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && data ) - return; - int sz[] = {_rows, _cols}; - create(2, sz, _type); -} - -inline -void Mat::create(Size _sz, int _type) -{ - create(_sz.height, _sz.width, _type); -} - -inline -void Mat::addref() -{ - if( u ) - CV_XADD(&u->refcount, 1); -} - -inline -void Mat::release() -{ - if( u && CV_XADD(&u->refcount, -1) == 1 ) - deallocate(); - u = NULL; - datastart = dataend = datalimit = data = 0; - for(int i = 0; i < dims; i++) - size.p[i] = 0; -#ifdef _DEBUG - flags = MAGIC_VAL; - dims = rows = cols = 0; - if(step.p != step.buf) - { - fastFree(step.p); - step.p = step.buf; - size.p = &rows; - } -#endif -} - inline Mat Mat::operator()( Range _rowRange, Range _colRange ) const { @@ -968,40 +730,6 @@ int Mat::channels() const return CV_MAT_CN(flags); } -inline -size_t Mat::step1(int i) const -{ - return step.p[i] / elemSize1(); -} - -inline -bool Mat::empty() const -{ - return data == 0 || total() == 0 || dims == 0; -} - -inline -size_t Mat::total() const -{ - if( dims <= 2 ) - return (size_t)rows * cols; - size_t p = 1; - for( int i = 0; i < dims; i++ ) - p *= size[i]; - return p; -} - -inline -size_t Mat::total(int startDim, int endDim) const -{ - CV_Assert( 0 <= startDim && startDim <= endDim); - size_t p = 1; - int endDim_ = endDim <= dims ? endDim : dims; - for( int i = startDim; i < endDim_; i++ ) - p *= size[i]; - return p; -} - inline uchar* Mat::ptr(int y) { @@ -1289,6 +1017,8 @@ const _Tp& Mat::at(const Vec& idx) const template inline MatConstIterator_<_Tp> Mat::begin() const { + if (empty()) + return MatConstIterator_<_Tp>(); CV_DbgAssert( elemSize() == sizeof(_Tp) ); return MatConstIterator_<_Tp>((const Mat_<_Tp>*)this); } @@ -1296,6 +1026,8 @@ MatConstIterator_<_Tp> Mat::begin() const template inline MatConstIterator_<_Tp> Mat::end() const { + if (empty()) + return MatConstIterator_<_Tp>(); CV_DbgAssert( elemSize() == sizeof(_Tp) ); MatConstIterator_<_Tp> it((const Mat_<_Tp>*)this); it += total(); @@ -1305,6 +1037,8 @@ MatConstIterator_<_Tp> Mat::end() const template inline MatIterator_<_Tp> Mat::begin() { + if (empty()) + return MatIterator_<_Tp>(); CV_DbgAssert( elemSize() == sizeof(_Tp) ); return MatIterator_<_Tp>((Mat_<_Tp>*)this); } @@ -1312,6 +1046,8 @@ MatIterator_<_Tp> Mat::begin() template inline MatIterator_<_Tp> Mat::end() { + if (empty()) + return MatIterator_<_Tp>(); CV_DbgAssert( elemSize() == sizeof(_Tp) ); MatIterator_<_Tp> it((Mat_<_Tp>*)this); it += total(); @@ -1482,11 +1218,11 @@ Mat& Mat::operator = (Mat&& m) ///////////////////////////// MatSize //////////////////////////// inline -MatSize::MatSize(int* _p) +MatSize::MatSize(int* _p) CV_NOEXCEPT : p(_p) {} inline -int MatSize::dims() const +int MatSize::dims() const CV_NOEXCEPT { return (p - 1)[0]; } @@ -1519,29 +1255,13 @@ int& MatSize::operator[](int i) } inline -MatSize::operator const int*() const +MatSize::operator const int*() const CV_NOEXCEPT { return p; } inline -bool MatSize::operator == (const MatSize& sz) const -{ - int d = dims(); - int dsz = sz.dims(); - if( d != dsz ) - return false; - if( d == 2 ) - return p[0] == sz.p[0] && p[1] == sz.p[1]; - - for( int i = 0; i < d; i++ ) - if( p[i] != sz.p[i] ) - return false; - return true; -} - -inline -bool MatSize::operator != (const MatSize& sz) const +bool MatSize::operator != (const MatSize& sz) const CV_NOEXCEPT { return !(*this == sz); } @@ -1551,25 +1271,25 @@ bool MatSize::operator != (const MatSize& sz) const ///////////////////////////// MatStep //////////////////////////// inline -MatStep::MatStep() +MatStep::MatStep() CV_NOEXCEPT { p = buf; p[0] = p[1] = 0; } inline -MatStep::MatStep(size_t s) +MatStep::MatStep(size_t s) CV_NOEXCEPT { p = buf; p[0] = s; p[1] = 0; } inline -const size_t& MatStep::operator[](int i) const +const size_t& MatStep::operator[](int i) const CV_NOEXCEPT { return p[i]; } inline -size_t& MatStep::operator[](int i) +size_t& MatStep::operator[](int i) CV_NOEXCEPT { return p[i]; } @@ -1592,7 +1312,7 @@ inline MatStep& MatStep::operator = (size_t s) ////////////////////////////// Mat_<_Tp> //////////////////////////// template inline -Mat_<_Tp>::Mat_() +Mat_<_Tp>::Mat_() CV_NOEXCEPT : Mat() { flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<_Tp>::value; @@ -1744,6 +1464,11 @@ Mat_<_Tp>::Mat_(const std::array<_Tp, _Nm>& arr, bool copyData) template inline Mat_<_Tp>& Mat_<_Tp>::operator = (const Mat& m) { + if (m.empty()) + { + release(); + return *this; + } if( traits::Type<_Tp>::value == m.type() ) { Mat::operator = (m); @@ -1795,9 +1520,7 @@ template inline void Mat_<_Tp>::release() { Mat::release(); -#ifdef _DEBUG flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<_Tp>::value; -#endif } template inline @@ -1809,7 +1532,7 @@ Mat_<_Tp> Mat_<_Tp>::cross(const Mat_& m) const template template inline Mat_<_Tp>::operator Mat_() const { - return Mat_(*this); + return Mat_(static_cast(*this)); } template inline @@ -2103,7 +1826,7 @@ void Mat_<_Tp>::forEach(const Functor& operation) const { template inline Mat_<_Tp>::Mat_(Mat_&& m) - : Mat(m) + : Mat(std::move(m)) { } @@ -2119,12 +1842,17 @@ Mat_<_Tp>::Mat_(Mat&& m) : Mat() { flags = (flags & ~CV_MAT_TYPE_MASK) | traits::Type<_Tp>::value; - *this = m; + *this = std::move(m); } template inline Mat_<_Tp>& Mat_<_Tp>::operator = (Mat&& m) { + if (m.empty()) + { + release(); + return *this; + } if( traits::Type<_Tp>::value == m.type() ) { Mat::operator = ((Mat&&)m); @@ -2152,51 +1880,6 @@ Mat_<_Tp>::Mat_(MatExpr&& e) ///////////////////////////// SparseMat ///////////////////////////// -inline -SparseMat::SparseMat() - : flags(MAGIC_VAL), hdr(0) -{} - -inline -SparseMat::SparseMat(int _dims, const int* _sizes, int _type) - : flags(MAGIC_VAL), hdr(0) -{ - create(_dims, _sizes, _type); -} - -inline -SparseMat::SparseMat(const SparseMat& m) - : flags(m.flags), hdr(m.hdr) -{ - addref(); -} - -inline -SparseMat::~SparseMat() -{ - release(); -} - -inline -SparseMat& SparseMat::operator = (const SparseMat& m) -{ - if( this != &m ) - { - if( m.hdr ) - CV_XADD(&m.hdr->refcount, 1); - release(); - flags = m.flags; - hdr = m.hdr; - } - return *this; -} - -inline -SparseMat& SparseMat::operator = (const Mat& m) -{ - return (*this = SparseMat(m)); -} - inline SparseMat SparseMat::clone() const { @@ -2205,30 +1888,6 @@ SparseMat SparseMat::clone() const return temp; } -inline -void SparseMat::assignTo( SparseMat& m, int _type ) const -{ - if( _type < 0 ) - m = *this; - else - convertTo(m, _type); -} - -inline -void SparseMat::addref() -{ - if( hdr ) - CV_XADD(&hdr->refcount, 1); -} - -inline -void SparseMat::release() -{ - if( hdr && CV_XADD(&hdr->refcount, -1) == 1 ) - delete hdr; - hdr = 0; -} - inline size_t SparseMat::elemSize() const { @@ -2288,36 +1947,6 @@ size_t SparseMat::nzcount() const return hdr ? hdr->nodeCount : 0; } -inline -size_t SparseMat::hash(int i0) const -{ - return (size_t)i0; -} - -inline -size_t SparseMat::hash(int i0, int i1) const -{ - return (size_t)(unsigned)i0 * HASH_SCALE + (unsigned)i1; -} - -inline -size_t SparseMat::hash(int i0, int i1, int i2) const -{ - return ((size_t)(unsigned)i0 * HASH_SCALE + (unsigned)i1) * HASH_SCALE + (unsigned)i2; -} - -inline -size_t SparseMat::hash(const int* idx) const -{ - size_t h = (unsigned)idx[0]; - if( !hdr ) - return 0; - int d = hdr->dims; - for(int i = 1; i < d; i++ ) - h = h * HASH_SCALE + (unsigned)idx[i]; - return h; -} - template inline _Tp& SparseMat::ref(int i0, size_t* hashval) { @@ -2665,6 +2294,7 @@ MatConstIterator::MatConstIterator(const Mat* _m) { if( m && m->isContinuous() ) { + CV_Assert(!m->empty()); sliceStart = m->ptr(); sliceEnd = sliceStart + m->total()*elemSize; } @@ -2678,6 +2308,7 @@ MatConstIterator::MatConstIterator(const Mat* _m, int _row, int _col) CV_Assert(m && m->dims <= 2); if( m->isContinuous() ) { + CV_Assert(!m->empty()); sliceStart = m->ptr(); sliceEnd = sliceStart + m->total()*elemSize; } @@ -2692,6 +2323,7 @@ MatConstIterator::MatConstIterator(const Mat* _m, Point _pt) CV_Assert(m && m->dims <= 2); if( m->isContinuous() ) { + CV_Assert(!m->empty()); sliceStart = m->ptr(); sliceEnd = sliceStart + m->total()*elemSize; } @@ -3634,74 +3266,6 @@ const Mat_<_Tp>& operator /= (const Mat_<_Tp>& a, const MatExpr& b) //////////////////////////////// UMat //////////////////////////////// -inline -UMat::UMat(UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{} - -inline -UMat::UMat(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create(_rows, _cols, _type); -} - -inline -UMat::UMat(int _rows, int _cols, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create(_rows, _cols, _type); - *this = _s; -} - -inline -UMat::UMat(Size _sz, int _type, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create( _sz.height, _sz.width, _type ); -} - -inline -UMat::UMat(Size _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create(_sz.height, _sz.width, _type); - *this = _s; -} - -inline -UMat::UMat(int _dims, const int* _sz, int _type, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create(_dims, _sz, _type); -} - -inline -UMat::UMat(int _dims, const int* _sz, int _type, const Scalar& _s, UMatUsageFlags _usageFlags) -: flags(MAGIC_VAL), dims(0), rows(0), cols(0), allocator(0), usageFlags(_usageFlags), u(0), offset(0), size(&rows) -{ - create(_dims, _sz, _type); - *this = _s; -} - -inline -UMat::UMat(const UMat& m) -: flags(m.flags), dims(m.dims), rows(m.rows), cols(m.cols), allocator(m.allocator), - usageFlags(m.usageFlags), u(m.u), offset(m.offset), size(&rows) -{ - addref(); - if( m.dims <= 2 ) - { - step[0] = m.step[0]; step[1] = m.step[1]; - } - else - { - dims = 0; - copySize(m); - } -} - - template inline UMat::UMat(const std::vector<_Tp>& vec, bool copyData) : flags(MAGIC_VAL | traits::Type<_Tp>::value | CV_MAT_CONT_FLAG), dims(2), rows((int)vec.size()), @@ -3718,33 +3282,6 @@ cols(1), allocator(0), usageFlags(USAGE_DEFAULT), u(0), offset(0), size(&rows) Mat((int)vec.size(), 1, traits::Type<_Tp>::value, (uchar*)&vec[0]).copyTo(*this); } -inline -UMat& UMat::operator = (const UMat& m) -{ - if( this != &m ) - { - const_cast(m).addref(); - release(); - flags = m.flags; - if( dims <= 2 && m.dims <= 2 ) - { - dims = m.dims; - rows = m.rows; - cols = m.cols; - step[0] = m.step[0]; - step[1] = m.step[1]; - } - else - copySize(m); - allocator = m.allocator; - if (usageFlags == USAGE_DEFAULT) - usageFlags = m.usageFlags; - u = m.u; - offset = m.offset; - } - return *this; -} - inline UMat UMat::row(int y) const { @@ -3781,55 +3318,6 @@ UMat UMat::colRange(const Range& r) const return UMat(*this, Range::all(), r); } -inline -UMat UMat::clone() const -{ - UMat m; - copyTo(m); - return m; -} - -inline -void UMat::assignTo( UMat& m, int _type ) const -{ - if( _type < 0 ) - m = *this; - else - convertTo(m, _type); -} - -inline -void UMat::create(int _rows, int _cols, int _type, UMatUsageFlags _usageFlags) -{ - _type &= TYPE_MASK; - if( dims <= 2 && rows == _rows && cols == _cols && type() == _type && u ) - return; - int sz[] = {_rows, _cols}; - create(2, sz, _type, _usageFlags); -} - -inline -void UMat::create(Size _sz, int _type, UMatUsageFlags _usageFlags) -{ - create(_sz.height, _sz.width, _type, _usageFlags); -} - -inline -void UMat::addref() -{ - if( u ) - CV_XADD(&(u->urefcount), 1); -} - -inline void UMat::release() -{ - if( u && CV_XADD(&(u->urefcount), -1) == 1 ) - deallocate(); - for(int i = 0; i < dims; i++) - size.p[i] = 0; - u = 0; -} - inline UMat UMat::operator()( Range _rowRange, Range _colRange ) const { @@ -3904,23 +3392,6 @@ size_t UMat::step1(int i) const return step.p[i] / elemSize1(); } -inline -bool UMat::empty() const -{ - return u == 0 || total() == 0 || dims == 0; -} - -inline -size_t UMat::total() const -{ - if( dims <= 2 ) - return (size_t)rows * cols; - size_t p = 1; - for( int i = 0; i < dims; i++ ) - p *= size[i]; - return p; -} - #ifdef CV_CXX_MOVE_SEMANTICS inline @@ -4018,10 +3489,18 @@ inline void UMatData::markDeviceCopyObsolete(bool flag) //! @endcond +static inline +void swap(MatExpr& a, MatExpr& b) { a.swap(b); } + } //cv #ifdef _MSC_VER #pragma warning( pop ) #endif +#ifdef CV_DISABLE_CLANG_ENUM_WARNINGS +#undef CV_DISABLE_CLANG_ENUM_WARNINGS +#pragma clang diagnostic pop +#endif + #endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/matx.hpp b/3rdparty/opencv/include/opencv2/core/matx.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/core/matx.hpp rename to 3rdparty/opencv/include/opencv2/core/matx.hpp index d8e17e7..733f675 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/matx.hpp +++ b/3rdparty/opencv/include/opencv2/core/matx.hpp @@ -151,7 +151,16 @@ public: static Matx ones(); static Matx eye(); static Matx diag(const diag_type& d); + /** @brief Generates uniformly distributed random numbers + @param a Range boundary. + @param b The other range boundary (boundaries don't have to be ordered, the lower boundary is inclusive, + the upper one is exclusive). + */ static Matx randu(_Tp a, _Tp b); + /** @brief Generates normally distributed random numbers + @param a Mean value. + @param b Standard deviation. + */ static Matx randn(_Tp a, _Tp b); //! dot product computed with the default precision @@ -391,6 +400,10 @@ public: const _Tp& operator ()(int i) const; _Tp& operator ()(int i); +#ifdef CV_CXX11 + Vec<_Tp, cn>& operator=(const Vec<_Tp, cn>& rhs) = default; +#endif + Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_AddOp); Vec(const Matx<_Tp, cn, 1>& a, const Matx<_Tp, cn, 1>& b, Matx_SubOp); template Vec(const Matx<_Tp, cn, 1>& a, _T2 alpha, Matx_ScaleOp); @@ -1275,6 +1288,34 @@ Matx<_Tp, m, n> operator * (double alpha, const Matx<_Tp, m, n>& a) return Matx<_Tp, m, n>(a, alpha, Matx_ScaleOp()); } +template static inline +Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, float alpha) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = a.val[i] / alpha; + return a; +} + +template static inline +Matx<_Tp, m, n>& operator /= (Matx<_Tp, m, n>& a, double alpha) +{ + for( int i = 0; i < m*n; i++ ) + a.val[i] = a.val[i] / alpha; + return a; +} + +template static inline +Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, float alpha) +{ + return Matx<_Tp, m, n>(a, 1.f/alpha, Matx_ScaleOp()); +} + +template static inline +Matx<_Tp, m, n> operator / (const Matx<_Tp, m, n>& a, double alpha) +{ + return Matx<_Tp, m, n>(a, 1./alpha, Matx_ScaleOp()); +} + template static inline Matx<_Tp, m, n> operator - (const Matx<_Tp, m, n>& a) { diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/neon_utils.hpp b/3rdparty/opencv/include/opencv2/core/neon_utils.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/neon_utils.hpp rename to 3rdparty/opencv/include/opencv2/core/neon_utils.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/ocl.hpp b/3rdparty/opencv/include/opencv2/core/ocl.hpp similarity index 98% rename from qt-correction-tool/pub/opencv/include/opencv2/core/ocl.hpp rename to 3rdparty/opencv/include/opencv2/core/ocl.hpp index 95f0fcd..f03de18 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/ocl.hpp +++ b/3rdparty/opencv/include/opencv2/core/ocl.hpp @@ -70,7 +70,7 @@ class CV_EXPORTS Image2D; class CV_EXPORTS_W_SIMPLE Device { public: - CV_WRAP Device(); + CV_WRAP Device() CV_NOEXCEPT; explicit Device(void* d); Device(const Device& d); Device& operator = (const Device& d); @@ -238,7 +238,7 @@ protected: class CV_EXPORTS Context { public: - Context(); + Context() CV_NOEXCEPT; explicit Context(int dtype); ~Context(); Context(const Context& c); @@ -269,7 +269,7 @@ public: class CV_EXPORTS Platform { public: - Platform(); + Platform() CV_NOEXCEPT; ~Platform(); Platform(const Platform& p); Platform& operator = (const Platform& p); @@ -324,7 +324,7 @@ void initializeContextFromHandle(Context& ctx, void* platform, void* context, vo class CV_EXPORTS Queue { public: - Queue(); + Queue() CV_NOEXCEPT; explicit Queue(const Context& c, const Device& d=Device()); ~Queue(); Queue(const Queue& q); @@ -350,7 +350,7 @@ class CV_EXPORTS KernelArg public: enum { LOCAL=1, READ_ONLY=2, WRITE_ONLY=4, READ_WRITE=6, CONSTANT=8, PTR_ONLY = 16, NO_SIZE=256 }; KernelArg(int _flags, UMat* _m, int wscale=1, int iwscale=1, const void* _obj=0, size_t _sz=0); - KernelArg(); + KernelArg() CV_NOEXCEPT; static KernelArg Local(size_t localMemSize) { return KernelArg(LOCAL, 0, 1, 1, 0, localMemSize); } @@ -387,7 +387,7 @@ public: class CV_EXPORTS Kernel { public: - Kernel(); + Kernel() CV_NOEXCEPT; Kernel(const char* kname, const Program& prog); Kernel(const char* kname, const ProgramSource& prog, const String& buildopts = String(), String* errmsg=0); @@ -597,7 +597,7 @@ protected: class CV_EXPORTS Program { public: - Program(); + Program() CV_NOEXCEPT; Program(const ProgramSource& src, const String& buildflags, String& errmsg); Program(const Program& prog); @@ -642,7 +642,7 @@ class CV_EXPORTS ProgramSource public: typedef uint64 hash_t; // deprecated - ProgramSource(); + ProgramSource() CV_NOEXCEPT; explicit ProgramSource(const String& module, const String& name, const String& codeStr, const String& codeHash); explicit ProgramSource(const String& prog); // deprecated explicit ProgramSource(const char* prog); // deprecated @@ -711,7 +711,7 @@ protected: class CV_EXPORTS PlatformInfo { public: - PlatformInfo(); + PlatformInfo() CV_NOEXCEPT; explicit PlatformInfo(void* id); ~PlatformInfo(); @@ -720,7 +720,12 @@ public: String name() const; String vendor() const; + + /// See CL_PLATFORM_VERSION String version() const; + int versionMajor() const; + int versionMinor() const; + int deviceNumber() const; void getDevice(Device& device, int d) const; @@ -771,7 +776,7 @@ CV_EXPORTS void buildOptionsAddMatrixDescription(String& buildOptions, const Str class CV_EXPORTS Image2D { public: - Image2D(); + Image2D() CV_NOEXCEPT; /** @param src UMat object from which to get image properties and data diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/ocl_genbase.hpp b/3rdparty/opencv/include/opencv2/core/ocl_genbase.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/ocl_genbase.hpp rename to 3rdparty/opencv/include/opencv2/core/ocl_genbase.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/ocl_defs.hpp b/3rdparty/opencv/include/opencv2/core/opencl/ocl_defs.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/ocl_defs.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/ocl_defs.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/opencl_info.hpp b/3rdparty/opencv/include/opencv2/core/opencl/opencl_info.hpp similarity index 80% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/opencl_info.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/opencl_info.hpp index b5d3739..5e5c846 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/opencl_info.hpp +++ b/3rdparty/opencv/include/opencv2/core/opencl/opencl_info.hpp @@ -47,6 +47,23 @@ static std::string bytesToStringRepr(size_t value) s = s.substr(0, s.size() - 1); return s; } + +static String getDeviceTypeString(const cv::ocl::Device& device) +{ + if (device.type() == cv::ocl::Device::TYPE_CPU) { + return "CPU"; + } + + if (device.type() == cv::ocl::Device::TYPE_GPU) { + if (device.hostUnifiedMemory()) { + return "iGPU"; + } else { + return "dGPU"; + } + } + + return "unknown"; +} } // namespace static void dumpOpenCLInformation() @@ -64,46 +81,36 @@ static void dumpOpenCLInformation() std::vector platforms; cv::ocl::getPlatfomsInfo(platforms); - if (platforms.size() > 0) - { - DUMP_MESSAGE_STDOUT("OpenCL Platforms: "); - for (size_t i = 0; i < platforms.size(); i++) - { - const PlatformInfo* platform = &platforms[i]; - DUMP_MESSAGE_STDOUT(" " << platform->name().c_str()); - Device current_device; - for (int j = 0; j < platform->deviceNumber(); j++) - { - platform->getDevice(current_device, j); - const char* deviceTypeStr = current_device.type() == Device::TYPE_CPU - ? ("CPU") : (current_device.type() == Device::TYPE_GPU ? current_device.hostUnifiedMemory() ? "iGPU" : "dGPU" : "unknown"); - DUMP_MESSAGE_STDOUT( " " << deviceTypeStr << ": " << current_device.name().c_str() << " (" << current_device.version().c_str() << ")"); - DUMP_CONFIG_PROPERTY( cv::format("cv_ocl_platform_%d_device_%d", (int)i, (int)j ), - cv::format("(Platform=%s)(Type=%s)(Name=%s)(Version=%s)", - platform->name().c_str(), deviceTypeStr, current_device.name().c_str(), current_device.version().c_str()) ); - } - } - } - else + if (platforms.empty()) { DUMP_MESSAGE_STDOUT("OpenCL is not available"); DUMP_CONFIG_PROPERTY("cv_ocl", "not available"); return; } + DUMP_MESSAGE_STDOUT("OpenCL Platforms: "); + for (size_t i = 0; i < platforms.size(); i++) + { + const PlatformInfo* platform = &platforms[i]; + DUMP_MESSAGE_STDOUT(" " << platform->name()); + Device current_device; + for (int j = 0; j < platform->deviceNumber(); j++) + { + platform->getDevice(current_device, j); + String deviceTypeStr = getDeviceTypeString(current_device); + DUMP_MESSAGE_STDOUT( " " << deviceTypeStr << ": " << current_device.name() << " (" << current_device.version() << ")"); + DUMP_CONFIG_PROPERTY( cv::format("cv_ocl_platform_%d_device_%d", (int)i, j ), + cv::format("(Platform=%s)(Type=%s)(Name=%s)(Version=%s)", + platform->name().c_str(), deviceTypeStr.c_str(), current_device.name().c_str(), current_device.version().c_str()) ); + } + } const Device& device = Device::getDefault(); if (!device.available()) CV_Error(Error::OpenCLInitError, "OpenCL device is not available"); DUMP_MESSAGE_STDOUT("Current OpenCL device: "); -#if 0 - DUMP_MESSAGE_STDOUT(" Platform = " << device.getPlatform().name()); - DUMP_CONFIG_PROPERTY("cv_ocl_current_platformName", device.getPlatform().name()); -#endif - - const char* deviceTypeStr = device.type() == Device::TYPE_CPU - ? ("CPU") : (device.type() == Device::TYPE_GPU ? device.hostUnifiedMemory() ? "iGPU" : "dGPU" : "unknown"); + String deviceTypeStr = getDeviceTypeString(device); DUMP_MESSAGE_STDOUT(" Type = " << deviceTypeStr); DUMP_CONFIG_PROPERTY("cv_ocl_current_deviceType", deviceTypeStr); @@ -156,7 +163,7 @@ static void dumpOpenCLInformation() } pos = pos2 + 1; } - DUMP_CONFIG_PROPERTY("cv_ocl_current_extensions", extensionsStr.c_str()); + DUMP_CONFIG_PROPERTY("cv_ocl_current_extensions", extensionsStr); const char* haveAmdBlasStr = haveAmdBlas() ? "Yes" : "No"; DUMP_MESSAGE_STDOUT(" Has AMD Blas = " << haveAmdBlasStr); diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/opencl_svm.hpp b/3rdparty/opencv/include/opencv2/core/opencl/opencl_svm.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/opencl_svm.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/opencl_svm.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdblas.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdblas.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdblas.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdblas.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdfft.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdfft.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdfft.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_clamdfft.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_core_wrappers.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_clamdblas.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_clamdfft.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_core.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_core.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_core.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_core.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_gl.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_gl.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_gl.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_gl.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_20.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp b/3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp rename to 3rdparty/opencv/include/opencv2/core/opencl/runtime/opencl_svm_hsa_extension.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/opengl.hpp b/3rdparty/opencv/include/opencv2/core/opengl.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/opengl.hpp rename to 3rdparty/opencv/include/opencv2/core/opengl.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/operations.hpp b/3rdparty/opencv/include/opencv2/core/operations.hpp similarity index 85% rename from qt-correction-tool/pub/opencv/include/opencv2/core/operations.hpp rename to 3rdparty/opencv/include/opencv2/core/operations.hpp index 082fef4..ef1808a 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/operations.hpp +++ b/3rdparty/opencv/include/opencv2/core/operations.hpp @@ -256,21 +256,21 @@ Matx<_Tp, n, l> Matx<_Tp, m, n>::solve(const Matx<_Tp, m, l>& rhs, int method) c template static inline A& operator op (A& a, const Matx<_Tp,m,n>& b) { cvop; return a; } \ template static inline const A& operator op (const A& a, const Matx<_Tp,m,n>& b) { cvop; return a; } -CV_MAT_AUG_OPERATOR (+=, cv::add(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR (+=, cv::add(a,b,a), Mat, Scalar) -CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Scalar) -CV_MAT_AUG_OPERATOR_T(+=, cv::add(a,b,a), Mat_<_Tp>, Mat_<_Tp>) -CV_MAT_AUG_OPERATOR_TN(+=, cv::add(a,Mat(b),a), Mat) -CV_MAT_AUG_OPERATOR_TN(+=, cv::add(a,Mat(b),a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (+=, cv::add(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR (+=, cv::add(a, b, (const Mat&)a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(+=, cv::add(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(+=, cv::add(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(+=, cv::add(a, Mat(b), (const Mat&)a), Mat_<_Tp>) -CV_MAT_AUG_OPERATOR (-=, cv::subtract(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR (-=, cv::subtract(a,b,a), Mat, Scalar) -CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Scalar) -CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a,b,a), Mat_<_Tp>, Mat_<_Tp>) -CV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a,Mat(b),a), Mat) -CV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a,Mat(b),a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (-=, cv::subtract(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR (-=, cv::subtract(a, b, (const Mat&)a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(-=, cv::subtract(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(-=, cv::subtract(a, Mat(b), (const Mat&)a), Mat_<_Tp>) CV_MAT_AUG_OPERATOR (*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat, Mat) CV_MAT_AUG_OPERATOR_T(*=, cv::gemm(a, b, 1, Mat(), 0, a, 0), Mat_<_Tp>, Mat) @@ -280,37 +280,37 @@ CV_MAT_AUG_OPERATOR_T(*=, a.convertTo(a, -1, b), Mat_<_Tp>, double) CV_MAT_AUG_OPERATOR_TN(*=, cv::gemm(a, Mat(b), 1, Mat(), 0, a, 0), Mat) CV_MAT_AUG_OPERATOR_TN(*=, cv::gemm(a, Mat(b), 1, Mat(), 0, a, 0), Mat_<_Tp>) -CV_MAT_AUG_OPERATOR (/=, cv::divide(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a,b,a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (/=, cv::divide(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(/=, cv::divide(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) CV_MAT_AUG_OPERATOR (/=, a.convertTo((Mat&)a, -1, 1./b), Mat, double) CV_MAT_AUG_OPERATOR_T(/=, a.convertTo((Mat&)a, -1, 1./b), Mat_<_Tp>, double) -CV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), a), Mat) -CV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(/=, cv::divide(a, Mat(b), (const Mat&)a), Mat_<_Tp>) -CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a,b,a), Mat, Scalar) -CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Scalar) -CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a,b,a), Mat_<_Tp>, Mat_<_Tp>) -CV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), a), Mat) -CV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR (&=, cv::bitwise_and(a, b, (const Mat&)a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(&=, cv::bitwise_and(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(&=, cv::bitwise_and(a, Mat(b), (const Mat&)a), Mat_<_Tp>) -CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a,b,a), Mat, Scalar) -CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Scalar) -CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a,b,a), Mat_<_Tp>, Mat_<_Tp>) -CV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), a), Mat) -CV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR (|=, cv::bitwise_or(a, b, (const Mat&)a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(|=, cv::bitwise_or(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(|=, cv::bitwise_or(a, Mat(b), (const Mat&)a), Mat_<_Tp>) -CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a,b,a), Mat, Mat) -CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a,b,a), Mat, Scalar) -CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Mat) -CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Scalar) -CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a,b,a), Mat_<_Tp>, Mat_<_Tp>) -CV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), a), Mat) -CV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), a), Mat_<_Tp>) +CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat, Mat) +CV_MAT_AUG_OPERATOR (^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat, Scalar) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Mat) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Scalar) +CV_MAT_AUG_OPERATOR_T(^=, cv::bitwise_xor(a, b, (const Mat&)a), Mat_<_Tp>, Mat_<_Tp>) +CV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), (const Mat&)a), Mat) +CV_MAT_AUG_OPERATOR_TN(^=, cv::bitwise_xor(a, Mat(b), (const Mat&)a), Mat_<_Tp>) #undef CV_MAT_AUG_OPERATOR_TN #undef CV_MAT_AUG_OPERATOR_T @@ -392,7 +392,7 @@ inline unsigned RNG::next() return (unsigned)state; } -//! returns the next unifomly-distributed random number of the specified type +//! returns the next uniformly-distributed random number of the specified type template static inline _Tp randu() { return (_Tp)theRNG(); diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/optim.hpp b/3rdparty/opencv/include/opencv2/core/optim.hpp similarity index 98% rename from qt-correction-tool/pub/opencv/include/opencv2/core/optim.hpp rename to 3rdparty/opencv/include/opencv2/core/optim.hpp index c4729a9..5a09400 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/optim.hpp +++ b/3rdparty/opencv/include/opencv2/core/optim.hpp @@ -165,7 +165,7 @@ public: /** @brief Sets the initial step that will be used in downhill simplex algorithm. - Step, together with initial point (givin in DownhillSolver::minimize) are two `n`-dimensional + Step, together with initial point (given in DownhillSolver::minimize) are two `n`-dimensional vectors that are used to determine the shape of initial simplex. Roughly said, initial point determines the position of a simplex (it will become simplex's centroid), while step determines the spread (size in each dimension) of a simplex. To be more precise, if \f$s,x_0\in\mathbb{R}^n\f$ are @@ -219,10 +219,10 @@ converge to it. Another obvious restriction is that it should be possible to com a function at any point, thus it is preferable to have analytic expression for gradient and computational burden should be born by the user. -The latter responsibility is accompilished via the getGradient method of a +The latter responsibility is accomplished via the getGradient method of a MinProblemSolver::Function interface (which represents function being optimized). This method takes point a point in *n*-dimensional space (first argument represents the array of coordinates of that -point) and comput its gradient (it should be stored in the second argument as an array). +point) and compute its gradient (it should be stored in the second argument as an array). @note class ConjGradSolver thus does not add any new methods to the basic MinProblemSolver interface. diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/ovx.hpp b/3rdparty/opencv/include/opencv2/core/ovx.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/ovx.hpp rename to 3rdparty/opencv/include/opencv2/core/ovx.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/persistence.hpp b/3rdparty/opencv/include/opencv2/core/persistence.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/core/persistence.hpp rename to 3rdparty/opencv/include/opencv2/core/persistence.hpp index 126393f..e3026e3 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/persistence.hpp +++ b/3rdparty/opencv/include/opencv2/core/persistence.hpp @@ -429,7 +429,7 @@ public: /** @brief Writes the registered C structure (CvMat, CvMatND, CvSeq). @param name Name of the written object. @param obj Pointer to the object. - @see ocvWrite for details. + @see cvWrite for details. */ void writeObj( const String& name, const void* obj ); @@ -456,6 +456,17 @@ public: */ CV_WRAP void writeComment(const String& comment, bool append = false); + /** @brief Starts to write a nested structure (sequence or a mapping). + @param name name of the structure (if it's a member of parent mapping, otherwise it should be empty + @param flags type of the structure (FileNode::MAP or FileNode::SEQ (both with optional FileNode::FLOW)). + @param typeName usually an empty string + */ + CV_WRAP void startWriteStruct(const String& name, int flags, const String& typeName=String()); + + /** @brief Finishes writing nested structure (should pair startWriteStruct()) + */ + CV_WRAP void endWriteStruct(); + /** @brief Returns the normalized object name for the specified name of a file. @param filename Name of a file @returns The normalized object name. @@ -526,6 +537,8 @@ public: */ FileNode(const FileNode& node); + FileNode& operator=(const FileNode& node); + /** @brief Returns element of a mapping node or a sequence node. @param nodename Name of an element in the mapping node. @returns Returns the element with the given identifier. @@ -597,8 +610,8 @@ public: Usually it is more convenient to use operator `>>` instead of this method. @param fmt Specification of each array element. See @ref format_spec "format specification" @param vec Pointer to the destination array. - @param len Number of elements to read. If it is greater than number of remaining elements then all - of them will be read. + @param len Number of bytes to read (buffer size limit). If it is greater than number of + remaining elements then all of them will be read. */ void readRaw( const String& fmt, uchar* vec, size_t len ) const; @@ -645,6 +658,8 @@ public: */ FileNodeIterator(const FileNodeIterator& it); + FileNodeIterator& operator=(const FileNodeIterator& it); + //! returns the currently observed element FileNode operator *() const; //! accesses the currently observed element methods @@ -668,11 +683,12 @@ public: Usually it is more convenient to use operator `>>` instead of this method. @param fmt Specification of each array element. See @ref format_spec "format specification" @param vec Pointer to the destination array. - @param maxCount Number of elements to read. If it is greater than number of remaining elements then - all of them will be read. + @param len Number of bytes to read (buffer size limit). If it is greater than number of + remaining elements then all of them will be read. + */ FileNodeIterator& readRaw( const String& fmt, uchar* vec, - size_t maxCount=(size_t)INT_MAX ); + size_t len=(size_t)INT_MAX ); struct SeqReader { @@ -1325,6 +1341,7 @@ inline FileNode FileStorage::getFirstTopLevelNode() const { FileNode r = root(); inline FileNode::FileNode() : fs(0), node(0) {} inline FileNode::FileNode(const CvFileStorage* _fs, const CvFileNode* _node) : fs(_fs), node(_node) {} inline FileNode::FileNode(const FileNode& _node) : fs(_node.fs), node(_node.node) {} +inline FileNode& FileNode::operator=(const FileNode& _node) { fs = _node.fs; node = _node.node; return *this; } inline bool FileNode::empty() const { return node == 0; } inline bool FileNode::isNone() const { return type() == NONE; } inline bool FileNode::isSeq() const { return type() == SEQ; } diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/ptr.inl.hpp b/3rdparty/opencv/include/opencv2/core/ptr.inl.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/ptr.inl.hpp rename to 3rdparty/opencv/include/opencv2/core/ptr.inl.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/saturate.hpp b/3rdparty/opencv/include/opencv2/core/saturate.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/saturate.hpp rename to 3rdparty/opencv/include/opencv2/core/saturate.hpp index 118599f..36d3121 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/saturate.hpp +++ b/3rdparty/opencv/include/opencv2/core/saturate.hpp @@ -74,8 +74,6 @@ namespace cv the floating-point value is first rounded to the nearest integer and then clipped if needed (when the target type is 8- or 16-bit). - This operation is used in the simplest or most complex image processing functions in OpenCV. - @param v Function parameter. @sa add, subtract, multiply, divide, Mat::convertTo */ diff --git a/3rdparty/opencv/include/opencv2/core/simd_intrinsics.hpp b/3rdparty/opencv/include/opencv2/core/simd_intrinsics.hpp new file mode 100644 index 0000000..309202d --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/simd_intrinsics.hpp @@ -0,0 +1,87 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_SIMD_INTRINSICS_HPP +#define OPENCV_CORE_SIMD_INTRINSICS_HPP + +/** +Helper header to support SIMD intrinsics (universal intrinsics) in user code. +Intrinsics documentation: https://docs.opencv.org/3.4/df/d91/group__core__hal__intrin.html + + +Checks of target CPU instruction set based on compiler definitions don't work well enough. +More reliable solutions require utilization of configuration systems (like CMake). + +So, probably you need to specify your own configuration. + +You can do that via CMake in this way: + add_definitions(/DOPENCV_SIMD_CONFIG_HEADER=opencv_simd_config_custom.hpp) +or + add_definitions(/DOPENCV_SIMD_CONFIG_INCLUDE_DIR=1) + +Additionally you may need to add include directory to your files: + include_directories("${CMAKE_CURRENT_LIST_DIR}/opencv_config_${MYTARGET}") + +These files can be pre-generated for target configurations of your application +or generated by CMake on the fly (use CMAKE_BINARY_DIR for that). + +Notes: +- H/W capability checks are still responsibility of your application +- runtime dispatching is not covered by this helper header +*/ + +#ifdef __OPENCV_BUILD +#error "Use core/hal/intrin.hpp during OpenCV build" +#endif + +#ifdef OPENCV_HAL_INTRIN_HPP +#error "core/simd_intrinsics.hpp must be included before core/hal/intrin.hpp" +#endif + +#include "opencv2/core/cvdef.h" + +#ifdef OPENCV_SIMD_CONFIG_HEADER +#include CVAUX_STR(OPENCV_SIMD_CONFIG_HEADER) +#elif defined(OPENCV_SIMD_CONFIG_INCLUDE_DIR) +#include "opencv_simd_config.hpp" // corresponding directory should be added via -I compiler parameter +#else // custom config headers + +#if (!defined(CV_AVX_512F) || !CV_AVX_512F) && (defined(__AVX512__) || defined(__AVX512F__)) +# include +# undef CV_AVX_512F +# define CV_AVX_512F 1 +# ifndef OPENCV_SIMD_DONT_ASSUME_SKX // Skylake-X with AVX-512F/CD/BW/DQ/VL +# undef CV_AVX512_SKX +# define CV_AVX512_SKX 1 +# undef CV_AVX_512CD +# define CV_AVX_512CD 1 +# undef CV_AVX_512BW +# define CV_AVX_512BW 1 +# undef CV_AVX_512DQ +# define CV_AVX_512DQ 1 +# undef CV_AVX_512VL +# define CV_AVX_512VL 1 +# endif +#endif // AVX512 + +// GCC/Clang: -mavx2 +// MSVC: /arch:AVX2 +#if defined __AVX2__ +# include +# undef CV_AVX2 +# define CV_AVX2 1 +# if defined __F16C__ +# undef CV_FP16 +# define CV_FP16 1 +# endif +#endif + +#endif + +// SSE / NEON / VSX is handled by cv_cpu_dispatch.h compatibility block +#include "cv_cpu_dispatch.h" + +#include "hal/intrin.hpp" + +#endif // OPENCV_CORE_SIMD_INTRINSICS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/softfloat.hpp b/3rdparty/opencv/include/opencv2/core/softfloat.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/softfloat.hpp rename to 3rdparty/opencv/include/opencv2/core/softfloat.hpp index 5470980..485e15c 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/softfloat.hpp +++ b/3rdparty/opencv/include/opencv2/core/softfloat.hpp @@ -507,8 +507,8 @@ Special cases: */ CV_EXPORTS softdouble cos( const softdouble& a ); -} +//! @} core_utils_softfloat -//! @} +} // cv:: #endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/sse_utils.hpp b/3rdparty/opencv/include/opencv2/core/sse_utils.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/sse_utils.hpp rename to 3rdparty/opencv/include/opencv2/core/sse_utils.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/traits.hpp b/3rdparty/opencv/include/opencv2/core/traits.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/traits.hpp rename to 3rdparty/opencv/include/opencv2/core/traits.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/types.hpp b/3rdparty/opencv/include/opencv2/core/types.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/types.hpp rename to 3rdparty/opencv/include/opencv2/core/types.hpp index ef9ab59..4d04bef 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/types.hpp +++ b/3rdparty/opencv/include/opencv2/core/types.hpp @@ -1192,7 +1192,7 @@ _Tp Point_<_Tp>::dot(const Point_& pt) const template inline double Point_<_Tp>::ddot(const Point_& pt) const { - return (double)x*pt.x + (double)y*pt.y; + return (double)x*(double)(pt.x) + (double)y*(double)(pt.y); } template inline diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/types_c.h b/3rdparty/opencv/include/opencv2/core/types_c.h similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/types_c.h rename to 3rdparty/opencv/include/opencv2/core/types_c.h index 5f63eb8..eddbe7d 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/types_c.h +++ b/3rdparty/opencv/include/opencv2/core/types_c.h @@ -44,8 +44,10 @@ #ifndef OPENCV_CORE_TYPES_H #define OPENCV_CORE_TYPES_H -#if !defined(__OPENCV_BUILD) && !defined(CV__DISABLE_C_API_CTORS) -#define CV__ENABLE_C_API_CTORS // enable C API ctors (must be removed) +#ifdef CV__ENABLE_C_API_CTORS // invalid C API ctors (must be removed) +#if defined(_WIN32) && !defined(CV__SKIP_MESSAGE_MALFORMED_C_API_CTORS) +#error "C API ctors don't work on Win32: https://github.com/opencv/opencv/issues/15990" +#endif #endif //#define CV__VALIDATE_UNUNITIALIZED_VARS 1 // C++11 & GCC only diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/utility.hpp b/3rdparty/opencv/include/opencv2/core/utility.hpp similarity index 85% rename from qt-correction-tool/pub/opencv/include/opencv2/core/utility.hpp rename to 3rdparty/opencv/include/opencv2/core/utility.hpp index 7a7158f..b97458d 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/utility.hpp +++ b/3rdparty/opencv/include/opencv2/core/utility.hpp @@ -63,30 +63,6 @@ namespace cv { -#ifdef CV_COLLECT_IMPL_DATA -CV_EXPORTS void setImpl(int flags); // set implementation flags and reset storage arrays -CV_EXPORTS void addImpl(int flag, const char* func = 0); // add implementation and function name to storage arrays -// Get stored implementation flags and functions names arrays -// Each implementation entry correspond to function name entry, so you can find which implementation was executed in which function -CV_EXPORTS int getImpl(std::vector &impl, std::vector &funName); - -CV_EXPORTS bool useCollection(); // return implementation collection state -CV_EXPORTS void setUseCollection(bool flag); // set implementation collection state - -#define CV_IMPL_PLAIN 0x01 // native CPU OpenCV implementation -#define CV_IMPL_OCL 0x02 // OpenCL implementation -#define CV_IMPL_IPP 0x04 // IPP implementation -#define CV_IMPL_MT 0x10 // multithreaded implementation - -#define CV_IMPL_ADD(impl) \ - if(cv::useCollection()) \ - { \ - cv::addImpl(impl, CV_Func); \ - } -#else -#define CV_IMPL_ADD(impl) -#endif - //! @addtogroup core_utils //! @{ @@ -116,7 +92,11 @@ CV_EXPORTS void setUseCollection(bool flag); // set implementation collection st } \endcode */ +#ifdef OPENCV_ENABLE_MEMORY_SANITIZER +template class AutoBuffer +#else template class AutoBuffer +#endif { public: typedef _Tp value_type; @@ -302,107 +282,98 @@ CV_EXPORTS_W double getTickFrequency(); The class computes passing time by counting the number of ticks per second. That is, the following code computes the execution time in seconds: -@code -TickMeter tm; -tm.start(); -// do something ... -tm.stop(); -std::cout << tm.getTimeSec(); -@endcode +@snippet snippets/core_various.cpp TickMeter_total It is also possible to compute the average time over multiple runs: -@code -TickMeter tm; -for (int i = 0; i < 100; i++) -{ - tm.start(); - // do something ... - tm.stop(); -} -double average_time = tm.getTimeSec() / tm.getCounter(); -std::cout << "Average time in second per iteration is: " << average_time << std::endl; -@endcode +@snippet snippets/core_various.cpp TickMeter_average + @sa getTickCount, getTickFrequency */ - class CV_EXPORTS_W TickMeter { public: //! the default constructor CV_WRAP TickMeter() { - reset(); + reset(); } - /** - starts counting ticks. - */ + //! starts counting ticks. CV_WRAP void start() { - startTime = cv::getTickCount(); + startTime = cv::getTickCount(); } - /** - stops counting ticks. - */ + //! stops counting ticks. CV_WRAP void stop() { - int64 time = cv::getTickCount(); - if (startTime == 0) - return; - ++counter; - sumTime += (time - startTime); - startTime = 0; + int64 time = cv::getTickCount(); + if (startTime == 0) + return; + ++counter; + sumTime += (time - startTime); + startTime = 0; } - /** - returns counted ticks. - */ + //! returns counted ticks. CV_WRAP int64 getTimeTicks() const { - return sumTime; + return sumTime; } - /** - returns passed time in microseconds. - */ + //! returns passed time in microseconds. CV_WRAP double getTimeMicro() const { - return getTimeMilli()*1e3; + return getTimeMilli()*1e3; } - /** - returns passed time in milliseconds. - */ + //! returns passed time in milliseconds. CV_WRAP double getTimeMilli() const { - return getTimeSec()*1e3; + return getTimeSec()*1e3; } - /** - returns passed time in seconds. - */ + //! returns passed time in seconds. CV_WRAP double getTimeSec() const { - return (double)getTimeTicks() / getTickFrequency(); + return (double)getTimeTicks() / getTickFrequency(); } - /** - returns internal counter value. - */ + //! returns internal counter value. CV_WRAP int64 getCounter() const { - return counter; + return counter; } - /** - resets internal values. - */ + //! returns average FPS (frames per second) value. + CV_WRAP double getFPS() const + { + const double sec = getTimeSec(); + if (sec < DBL_EPSILON) + return 0.; + return counter / sec; + } + + //! returns average time in seconds + CV_WRAP double getAvgTimeSec() const + { + if (counter <= 0) + return 0.; + return getTimeSec() / counter; + } + + //! returns average time in milliseconds + CV_WRAP double getAvgTimeMilli() const + { + return getAvgTimeSec() * 1e3; + } + + //! resets internal values. CV_WRAP void reset() { - startTime = 0; - sumTime = 0; - counter = 0; + startTime = 0; + sumTime = 0; + counter = 0; } private: @@ -467,7 +438,7 @@ Returned value is a string containing space separated list of CPU features with Example: `SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?` */ -CV_EXPORTS std::string getCPUFeaturesLine(); +CV_EXPORTS_W std::string getCPUFeaturesLine(); /** @brief Returns the number of logical CPUs available for the process. */ @@ -534,6 +505,43 @@ static inline size_t roundUp(size_t a, unsigned int b) return a + b - 1 - (a + b - 1) % b; } +/** @brief Alignment check of passed values + +Usage: `isAligned(...)` + +@note Alignment(N) must be a power of 2 (2**k, 2^k) +*/ +template static inline +bool isAligned(const T& data) +{ + CV_StaticAssert((N & (N - 1)) == 0, ""); // power of 2 + return (((size_t)data) & (N - 1)) == 0; +} +/** @overload */ +template static inline +bool isAligned(const void* p1) +{ + return isAligned((size_t)p1); +} +/** @overload */ +template static inline +bool isAligned(const void* p1, const void* p2) +{ + return isAligned(((size_t)p1)|((size_t)p2)); +} +/** @overload */ +template static inline +bool isAligned(const void* p1, const void* p2, const void* p3) +{ + return isAligned(((size_t)p1)|((size_t)p2)|((size_t)p3)); +} +/** @overload */ +template static inline +bool isAligned(const void* p1, const void* p2, const void* p3, const void* p4) +{ + return isAligned(((size_t)p1)|((size_t)p2)|((size_t)p3)|((size_t)p4)); +} + /** @brief Enables or disables the optimized code. The function can be used to dynamically turn on and off optimized dispatched code (code that uses SSE4.2, AVX/AVX2, @@ -605,6 +613,7 @@ void Mat::forEach_impl(const Functor& operation) { // or (_Tp&, void*) <- in case you don't need current idx. } + CV_Assert(!empty()); CV_Assert(this->total() / this->size[this->dims - 1] <= INT_MAX); const int LINES = static_cast(this->total() / this->size[this->dims - 1]); @@ -722,61 +731,6 @@ private: AutoLock& operator = (const AutoLock&); }; -// TLS interface -class CV_EXPORTS TLSDataContainer -{ -protected: - TLSDataContainer(); - virtual ~TLSDataContainer(); - - void gatherData(std::vector &data) const; -#if OPENCV_ABI_COMPATIBILITY > 300 - void* getData() const; - void release(); - -private: -#else - void release(); - -public: - void* getData() const; -#endif - virtual void* createDataInstance() const = 0; - virtual void deleteDataInstance(void* pData) const = 0; - - int key_; - -public: - void cleanup(); //! Release created TLS data container objects. It is similar to release() call, but it keeps TLS container valid. -}; - -// Main TLS data class -template -class TLSData : protected TLSDataContainer -{ -public: - inline TLSData() {} - inline ~TLSData() { release(); } // Release key and delete associated data - inline T* get() const { return (T*)getData(); } // Get data associated with key - inline T& getRef() const { T* ptr = (T*)getData(); CV_Assert(ptr); return *ptr; } // Get data associated with key - - // Get data from all threads - inline void gather(std::vector &data) const - { - std::vector &dataVoid = reinterpret_cast&>(data); - gatherData(dataVoid); - } - - inline void cleanup() { TLSDataContainer::cleanup(); } - -private: - virtual void* createDataInstance() const CV_OVERRIDE {return new T;} // Wrapper to allocate data by template - virtual void deleteDataInstance(void* pData) const CV_OVERRIDE {delete (T*)pData;} // Wrapper to release data by template - - // Disable TLS copy operations - TLSData(TLSData &) {} - TLSData& operator =(const TLSData &) {return *this;} -}; /** @brief Designed for command line parsing @@ -1195,88 +1149,6 @@ public: std::vector*> m_childs; }; -// Instrumentation external interface -namespace instr -{ - -#if !defined OPENCV_ABI_CHECK - -enum TYPE -{ - TYPE_GENERAL = 0, // OpenCV API function, e.g. exported function - TYPE_MARKER, // Information marker - TYPE_WRAPPER, // Wrapper function for implementation - TYPE_FUN, // Simple function call -}; - -enum IMPL -{ - IMPL_PLAIN = 0, - IMPL_IPP, - IMPL_OPENCL, -}; - -struct NodeDataTls -{ - NodeDataTls() - { - m_ticksTotal = 0; - } - uint64 m_ticksTotal; -}; - -class CV_EXPORTS NodeData -{ -public: - NodeData(const char* funName = 0, const char* fileName = NULL, int lineNum = 0, void* retAddress = NULL, bool alwaysExpand = false, cv::instr::TYPE instrType = TYPE_GENERAL, cv::instr::IMPL implType = IMPL_PLAIN); - NodeData(NodeData &ref); - ~NodeData(); - NodeData& operator=(const NodeData&); - - cv::String m_funName; - cv::instr::TYPE m_instrType; - cv::instr::IMPL m_implType; - const char* m_fileName; - int m_lineNum; - void* m_retAddress; - bool m_alwaysExpand; - bool m_funError; - - volatile int m_counter; - volatile uint64 m_ticksTotal; - TLSData m_tls; - int m_threads; - - // No synchronization - double getTotalMs() const { return ((double)m_ticksTotal / cv::getTickFrequency()) * 1000; } - double getMeanMs() const { return (((double)m_ticksTotal/m_counter) / cv::getTickFrequency()) * 1000; } -}; -bool operator==(const NodeData& lhs, const NodeData& rhs); - -typedef Node InstrNode; - -CV_EXPORTS InstrNode* getTrace(); - -#endif // !defined OPENCV_ABI_CHECK - - -CV_EXPORTS bool useInstrumentation(); -CV_EXPORTS void setUseInstrumentation(bool flag); -CV_EXPORTS void resetTrace(); - -enum FLAGS -{ - FLAGS_NONE = 0, - FLAGS_MAPPING = 0x01, - FLAGS_EXPAND_SAME_NAMES = 0x02, -}; - -CV_EXPORTS void setFlags(FLAGS modeFlags); -static inline void setFlags(int modeFlags) { setFlags((FLAGS)modeFlags); } -CV_EXPORTS FLAGS getFlags(); - -} // namespace instr - namespace samples { @@ -1351,6 +1223,13 @@ CV_EXPORTS int getThreadID(); } //namespace cv +#ifdef CV_COLLECT_IMPL_DATA +#include "opencv2/core/utils/instrumentation.hpp" +#else +/// Collect implementation data on OpenCV function call. Requires ENABLE_IMPL_COLLECTION build option. +#define CV_IMPL_ADD(impl) +#endif + #ifndef DISABLE_OPENCV_24_COMPATIBILITY #include "opencv2/core/core_c.h" #endif diff --git a/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.hpp b/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.hpp new file mode 100644 index 0000000..79e9338 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.hpp @@ -0,0 +1,29 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP +#define OPENCV_CORE_ALLOCATOR_STATS_HPP + +#include "../cvdef.h" + +namespace cv { namespace utils { + +class AllocatorStatisticsInterface +{ +protected: + AllocatorStatisticsInterface() {} + virtual ~AllocatorStatisticsInterface() {} +public: + virtual uint64_t getCurrentUsage() const = 0; + virtual uint64_t getTotalUsage() const = 0; + virtual uint64_t getNumberOfAllocations() const = 0; + virtual uint64_t getPeakUsage() const = 0; + + /** set peak usage = current usage */ + virtual void resetPeakUsage() = 0; +}; + +}} // namespace + +#endif // OPENCV_CORE_ALLOCATOR_STATS_HPP diff --git a/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.impl.hpp b/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.impl.hpp new file mode 100644 index 0000000..eb5ecde --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/utils/allocator_stats.impl.hpp @@ -0,0 +1,158 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP +#define OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP + +#include "./allocator_stats.hpp" + +//#define OPENCV_DISABLE_ALLOCATOR_STATS + +#ifdef CV_CXX11 + +#include + +#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE +#if defined(__GNUC__) && (\ + (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 4) || \ + (defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8)) \ + ) +#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int +#endif +#endif + +#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE +#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE long long +#endif + +#else // CV_CXX11 + +#ifndef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE +#define OPENCV_ALLOCATOR_STATS_COUNTER_TYPE int // CV_XADD supports int only +#endif + +#endif // CV_CXX11 + +namespace cv { namespace utils { + +#ifdef CV__ALLOCATOR_STATS_LOG +namespace { +#endif + +class AllocatorStatistics : public AllocatorStatisticsInterface +{ +#ifdef OPENCV_DISABLE_ALLOCATOR_STATS + +public: + AllocatorStatistics() {} + ~AllocatorStatistics() CV_OVERRIDE {} + + uint64_t getCurrentUsage() const CV_OVERRIDE { return 0; } + uint64_t getTotalUsage() const CV_OVERRIDE { return 0; } + uint64_t getNumberOfAllocations() const CV_OVERRIDE { return 0; } + uint64_t getPeakUsage() const CV_OVERRIDE { return 0; } + + /** set peak usage = current usage */ + void resetPeakUsage() CV_OVERRIDE {}; + + void onAllocate(size_t /*sz*/) {} + void onFree(size_t /*sz*/) {} + +#elif defined(CV_CXX11) + +protected: + typedef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE counter_t; + std::atomic curr, total, total_allocs, peak; +public: + AllocatorStatistics() {} + ~AllocatorStatistics() CV_OVERRIDE {} + + uint64_t getCurrentUsage() const CV_OVERRIDE { return (uint64_t)curr.load(); } + uint64_t getTotalUsage() const CV_OVERRIDE { return (uint64_t)total.load(); } + uint64_t getNumberOfAllocations() const CV_OVERRIDE { return (uint64_t)total_allocs.load(); } + uint64_t getPeakUsage() const CV_OVERRIDE { return (uint64_t)peak.load(); } + + /** set peak usage = current usage */ + void resetPeakUsage() CV_OVERRIDE { peak.store(curr.load()); } + + // Controller interface + void onAllocate(size_t sz) + { +#ifdef CV__ALLOCATOR_STATS_LOG + CV__ALLOCATOR_STATS_LOG(cv::format("allocate: %lld (curr=%lld)", (long long int)sz, (long long int)curr.load())); +#endif + + counter_t new_curr = curr.fetch_add((counter_t)sz) + (counter_t)sz; + + // peak = std::max((uint64_t)peak, new_curr); + auto prev_peak = peak.load(); + while (prev_peak < new_curr) + { + if (peak.compare_exchange_weak(prev_peak, new_curr)) + break; + } + // end of peak = max(...) + + total += (counter_t)sz; + total_allocs++; + } + void onFree(size_t sz) + { +#ifdef CV__ALLOCATOR_STATS_LOG + CV__ALLOCATOR_STATS_LOG(cv::format("free: %lld (curr=%lld)", (long long int)sz, (long long int)curr.load())); +#endif + curr -= (counter_t)sz; + } + +#else // non C++11 + +protected: + typedef OPENCV_ALLOCATOR_STATS_COUNTER_TYPE counter_t; + volatile counter_t curr, total, total_allocs, peak; // overflow is possible, CV_XADD operates with 'int' only +public: + AllocatorStatistics() + : curr(0), total(0), total_allocs(0), peak(0) + {} + ~AllocatorStatistics() CV_OVERRIDE {} + + uint64_t getCurrentUsage() const CV_OVERRIDE { return (uint64_t)curr; } + uint64_t getTotalUsage() const CV_OVERRIDE { return (uint64_t)total; } + uint64_t getNumberOfAllocations() const CV_OVERRIDE { return (uint64_t)total_allocs; } + uint64_t getPeakUsage() const CV_OVERRIDE { return (uint64_t)peak; } + + void resetPeakUsage() CV_OVERRIDE { peak = curr; } + + // Controller interface + void onAllocate(size_t sz) + { +#ifdef CV__ALLOCATOR_STATS_LOG + CV__ALLOCATOR_STATS_LOG(cv::format("allocate: %lld (curr=%lld)", (long long int)sz, (long long int)curr)); +#endif + + counter_t new_curr = (counter_t)CV_XADD(&curr, (counter_t)sz) + (counter_t)sz; + + peak = std::max((counter_t)peak, new_curr); // non-thread safe + + //CV_XADD(&total, (uint64_t)sz); // overflow with int, non-reliable... + total += sz; + + CV_XADD(&total_allocs, (counter_t)1); + } + void onFree(size_t sz) + { +#ifdef CV__ALLOCATOR_STATS_LOG + CV__ALLOCATOR_STATS_LOG(cv::format("free: %lld (curr=%lld)", (long long int)sz, (long long int)curr)); +#endif + CV_XADD(&curr, (counter_t)-sz); + } +#endif +}; + +#ifdef CV__ALLOCATOR_STATS_LOG +} // namespace +#endif + +}} // namespace + +#endif // OPENCV_CORE_ALLOCATOR_STATS_IMPL_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/filesystem.hpp b/3rdparty/opencv/include/opencv2/core/utils/filesystem.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/utils/filesystem.hpp rename to 3rdparty/opencv/include/opencv2/core/utils/filesystem.hpp diff --git a/3rdparty/opencv/include/opencv2/core/utils/instrumentation.hpp b/3rdparty/opencv/include/opencv2/core/utils/instrumentation.hpp new file mode 100644 index 0000000..3639867 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/utils/instrumentation.hpp @@ -0,0 +1,125 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_UTILS_INSTR_HPP +#define OPENCV_UTILS_INSTR_HPP + +#include +#include + +namespace cv { + +//! @addtogroup core_utils +//! @{ + +#ifdef CV_COLLECT_IMPL_DATA +CV_EXPORTS void setImpl(int flags); // set implementation flags and reset storage arrays +CV_EXPORTS void addImpl(int flag, const char* func = 0); // add implementation and function name to storage arrays +// Get stored implementation flags and functions names arrays +// Each implementation entry correspond to function name entry, so you can find which implementation was executed in which function +CV_EXPORTS int getImpl(std::vector &impl, std::vector &funName); + +CV_EXPORTS bool useCollection(); // return implementation collection state +CV_EXPORTS void setUseCollection(bool flag); // set implementation collection state + +#define CV_IMPL_PLAIN 0x01 // native CPU OpenCV implementation +#define CV_IMPL_OCL 0x02 // OpenCL implementation +#define CV_IMPL_IPP 0x04 // IPP implementation +#define CV_IMPL_MT 0x10 // multithreaded implementation + +#undef CV_IMPL_ADD +#define CV_IMPL_ADD(impl) \ + if(cv::useCollection()) \ + { \ + cv::addImpl(impl, CV_Func); \ + } +#endif + +// Instrumentation external interface +namespace instr +{ + +#if !defined OPENCV_ABI_CHECK + +enum TYPE +{ + TYPE_GENERAL = 0, // OpenCV API function, e.g. exported function + TYPE_MARKER, // Information marker + TYPE_WRAPPER, // Wrapper function for implementation + TYPE_FUN, // Simple function call +}; + +enum IMPL +{ + IMPL_PLAIN = 0, + IMPL_IPP, + IMPL_OPENCL, +}; + +struct NodeDataTls +{ + NodeDataTls() + { + m_ticksTotal = 0; + } + uint64 m_ticksTotal; +}; + +class CV_EXPORTS NodeData +{ +public: + NodeData(const char* funName = 0, const char* fileName = NULL, int lineNum = 0, void* retAddress = NULL, bool alwaysExpand = false, cv::instr::TYPE instrType = TYPE_GENERAL, cv::instr::IMPL implType = IMPL_PLAIN); + NodeData(NodeData &ref); + ~NodeData(); + NodeData& operator=(const NodeData&); + + cv::String m_funName; + cv::instr::TYPE m_instrType; + cv::instr::IMPL m_implType; + const char* m_fileName; + int m_lineNum; + void* m_retAddress; + bool m_alwaysExpand; + bool m_funError; + + volatile int m_counter; + volatile uint64 m_ticksTotal; + TLSDataAccumulator m_tls; + int m_threads; + + // No synchronization + double getTotalMs() const { return ((double)m_ticksTotal / cv::getTickFrequency()) * 1000; } + double getMeanMs() const { return (((double)m_ticksTotal/m_counter) / cv::getTickFrequency()) * 1000; } +}; +bool operator==(const NodeData& lhs, const NodeData& rhs); + +typedef Node InstrNode; + +CV_EXPORTS InstrNode* getTrace(); + +#endif // !defined OPENCV_ABI_CHECK + + +CV_EXPORTS bool useInstrumentation(); +CV_EXPORTS void setUseInstrumentation(bool flag); +CV_EXPORTS void resetTrace(); + +enum FLAGS +{ + FLAGS_NONE = 0, + FLAGS_MAPPING = 0x01, + FLAGS_EXPAND_SAME_NAMES = 0x02, +}; + +CV_EXPORTS void setFlags(FLAGS modeFlags); +static inline void setFlags(int modeFlags) { setFlags((FLAGS)modeFlags); } +CV_EXPORTS FLAGS getFlags(); + +} // namespace instr + +//! @} + +} // namespace + +#endif // OPENCV_UTILS_TLS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/logger.defines.hpp b/3rdparty/opencv/include/opencv2/core/utils/logger.defines.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/utils/logger.defines.hpp rename to 3rdparty/opencv/include/opencv2/core/utils/logger.defines.hpp diff --git a/3rdparty/opencv/include/opencv2/core/utils/logger.hpp b/3rdparty/opencv/include/opencv2/core/utils/logger.hpp new file mode 100644 index 0000000..501d140 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/utils/logger.hpp @@ -0,0 +1,159 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_LOGGER_HPP +#define OPENCV_LOGGER_HPP + +#include +#include +#include // INT_MAX + +#include "logger.defines.hpp" + +namespace cv { +namespace utils { +namespace logging { + +//! @addtogroup core_logging +//! @{ + +//! Supported logging levels and their semantic +enum LogLevel { + LOG_LEVEL_SILENT = 0, //!< for using in setLogVevel() call + LOG_LEVEL_FATAL = 1, //!< Fatal (critical) error (unrecoverable internal error) + LOG_LEVEL_ERROR = 2, //!< Error message + LOG_LEVEL_WARNING = 3, //!< Warning message + LOG_LEVEL_INFO = 4, //!< Info message + LOG_LEVEL_DEBUG = 5, //!< Debug message. Disabled in the "Release" build. + LOG_LEVEL_VERBOSE = 6, //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. +#ifndef CV_DOXYGEN + ENUM_LOG_LEVEL_FORCE_INT = INT_MAX +#endif +}; + +/** Set global logging level +@return previous logging level +*/ +CV_EXPORTS LogLevel setLogLevel(LogLevel logLevel); +/** Get global logging level */ +CV_EXPORTS LogLevel getLogLevel(); + +namespace internal { +/** Write log message */ +CV_EXPORTS void writeLogMessage(LogLevel logLevel, const char* message); +} // namespace + +/** + * \def CV_LOG_STRIP_LEVEL + * + * Define CV_LOG_STRIP_LEVEL=CV_LOG_LEVEL_[DEBUG|INFO|WARN|ERROR|FATAL|DISABLED] to compile out anything at that and before that logging level + */ +#ifndef CV_LOG_STRIP_LEVEL +# if defined NDEBUG +# define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG +# else +# define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_VERBOSE +# endif +#endif + +#define CV_LOG_WITH_TAG(tag, msgLevel, extra_check0, extra_check1, msg_prefix, ...) \ + for(;;) { \ + extra_check0; \ + if (cv::utils::logging::getLogLevel() < msgLevel) break; \ + extra_check1; \ + std::stringstream ss; ss msg_prefix << __VA_ARGS__; \ + cv::utils::logging::internal::writeLogMessage(msgLevel, ss.str().c_str()); \ + break; \ + } + +#define CV_LOG_FATAL(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , , , __VA_ARGS__) +#define CV_LOG_ERROR(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , , , __VA_ARGS__) +#define CV_LOG_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , , , __VA_ARGS__) +#define CV_LOG_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , , , __VA_ARGS__) +#define CV_LOG_DEBUG(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , , , __VA_ARGS__) +#define CV_LOG_VERBOSE(tag, v, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, , , << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__) + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO +#undef CV_LOG_INFO +#define CV_LOG_INFO(tag, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG +#undef CV_LOG_DEBUG +#define CV_LOG_DEBUG(tag, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE +#undef CV_LOG_VERBOSE +#define CV_LOG_VERBOSE(tag, v, ...) +#endif + +//! @cond IGNORED +#define CV__LOG_ONCE_CHECK_PRE \ + static bool _cv_log_once_ ## __LINE__ = false; \ + if (_cv_log_once_ ## __LINE__) break; + +#define CV__LOG_ONCE_CHECK_POST \ + _cv_log_once_ ## __LINE__ = true; + +#define CV__LOG_IF_CHECK(logging_cond) \ + if (!(logging_cond)) break; + +//! @endcond + + +// CV_LOG_ONCE_XXX macros + +#define CV_LOG_ONCE_ERROR(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__) +#define CV_LOG_ONCE_WARNING(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__) +#define CV_LOG_ONCE_INFO(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__) +#define CV_LOG_ONCE_DEBUG(tag, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, , __VA_ARGS__) +#define CV_LOG_ONCE_VERBOSE(tag, v, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, CV__LOG_ONCE_CHECK_PRE, CV__LOG_ONCE_CHECK_POST, << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__) + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO +#undef CV_LOG_ONCE_INFO +#define CV_LOG_ONCE_INFO(tag, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG +#undef CV_LOG_ONCE_DEBUG +#define CV_LOG_ONCE_DEBUG(tag, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE +#undef CV_LOG_ONCE_VERBOSE +#define CV_LOG_ONCE_VERBOSE(tag, v, ...) +#endif + + +// CV_LOG_IF_XXX macros + +#define CV_LOG_IF_FATAL(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_FATAL, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__) +#define CV_LOG_IF_ERROR(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_ERROR, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__) +#define CV_LOG_IF_WARNING(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_WARNING, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__) +#define CV_LOG_IF_INFO(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_INFO, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__) +#define CV_LOG_IF_DEBUG(tag, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_DEBUG, , CV__LOG_IF_CHECK(logging_cond), , __VA_ARGS__) +#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...) CV_LOG_WITH_TAG(tag, cv::utils::logging::LOG_LEVEL_VERBOSE, , CV__LOG_IF_CHECK(logging_cond), << "[VERB" << v << ":" << cv::utils::getThreadID() << "] ", __VA_ARGS__) + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO +#undef CV_LOG_IF_INFO +#define CV_LOG_IF_INFO(tag, logging_cond, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG +#undef CV_LOG_IF_DEBUG +#define CV_LOG_IF_DEBUG(tag, logging_cond, ...) +#endif + +#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE +#undef CV_LOG_IF_VERBOSE +#define CV_LOG_IF_VERBOSE(tag, v, logging_cond, ...) +#endif + + +//! @} + +}}} // namespace + +#endif // OPENCV_LOGGER_HPP diff --git a/3rdparty/opencv/include/opencv2/core/utils/tls.hpp b/3rdparty/opencv/include/opencv2/core/utils/tls.hpp new file mode 100644 index 0000000..c0d2962 --- /dev/null +++ b/3rdparty/opencv/include/opencv2/core/utils/tls.hpp @@ -0,0 +1,239 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. + +#ifndef OPENCV_UTILS_TLS_HPP +#define OPENCV_UTILS_TLS_HPP + +#ifndef OPENCV_CORE_UTILITY_H +#error "tls.hpp must be included after opencv2/core/utility.hpp or opencv2/core.hpp" +#endif + +namespace cv { + +//! @addtogroup core_utils +//! @{ + +namespace details { class TlsStorage; } + +/** TLS container base implementation + * + * Don't use directly. + * + * @sa TLSData, TLSDataAccumulator templates + */ +class CV_EXPORTS TLSDataContainer +{ +protected: + TLSDataContainer(); + virtual ~TLSDataContainer(); + + /// @deprecated use detachData() instead + void gatherData(std::vector &data) const; + /// get TLS data and detach all data from threads (similar to cleanup() call) + void detachData(std::vector& data); + + void* getData() const; + void release(); + +protected: + virtual void* createDataInstance() const = 0; + virtual void deleteDataInstance(void* pData) const = 0; + +#if OPENCV_ABI_COMPATIBILITY > 300 +private: +#else +public: +#endif + int key_; + + friend class cv::details::TlsStorage; // core/src/system.cpp + +public: + void cleanup(); //!< Release created TLS data container objects. It is similar to release() call, but it keeps TLS container valid. + +private: + // Disable copy/assign (noncopyable pattern) + TLSDataContainer(TLSDataContainer &); + TLSDataContainer& operator =(const TLSDataContainer &); +}; + + +/** @brief Simple TLS data class + * + * @sa TLSDataAccumulator + */ +template +class TLSData : protected TLSDataContainer +{ +public: + inline TLSData() {} + inline ~TLSData() { release(); } + + inline T* get() const { return (T*)getData(); } //!< Get data associated with key + inline T& getRef() const { T* ptr = (T*)getData(); CV_DbgAssert(ptr); return *ptr; } //!< Get data associated with key + + /// Release associated thread data + inline void cleanup() + { + TLSDataContainer::cleanup(); + } + +protected: + /// Wrapper to allocate data by template + virtual void* createDataInstance() const CV_OVERRIDE { return new T; } + /// Wrapper to release data by template + virtual void deleteDataInstance(void* pData) const CV_OVERRIDE { delete (T*)pData; } +}; + + +/// TLS data accumulator with gathering methods +template +class TLSDataAccumulator : public TLSData +{ + mutable cv::Mutex mutex; + mutable std::vector dataFromTerminatedThreads; + std::vector detachedData; + bool cleanupMode; +public: + TLSDataAccumulator() : cleanupMode(false) {} + ~TLSDataAccumulator() + { + release(); + } + + /** @brief Get data from all threads + * @deprecated replaced by detachData() + * + * Lifetime of vector data is valid until next detachData()/cleanup()/release() calls + * + * @param[out] data result buffer (should be empty) + */ + void gather(std::vector &data) const + { + CV_Assert(cleanupMode == false); // state is not valid + CV_Assert(data.empty()); + { + std::vector &dataVoid = reinterpret_cast&>(data); + TLSDataContainer::gatherData(dataVoid); + } + { + AutoLock lock(mutex); + data.reserve(data.size() + dataFromTerminatedThreads.size()); + for (typename std::vector::const_iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i) + { + data.push_back((T*)*i); + } + } + } + + /** @brief Get and detach data from all threads + * + * Call cleanupDetachedData() when returned vector is not needed anymore. + * + * @return Vector with associated data. Content is preserved (including lifetime of attached data pointers) until next detachData()/cleanupDetachedData()/cleanup()/release() calls + */ + std::vector& detachData() + { + CV_Assert(cleanupMode == false); // state is not valid + std::vector dataVoid; + { + TLSDataContainer::detachData(dataVoid); + } + { + AutoLock lock(mutex); + detachedData.reserve(dataVoid.size() + dataFromTerminatedThreads.size()); + for (typename std::vector::const_iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i) + { + detachedData.push_back((T*)*i); + } + dataFromTerminatedThreads.clear(); + for (typename std::vector::const_iterator i = dataVoid.begin(); i != dataVoid.end(); ++i) + { + detachedData.push_back((T*)(void*)*i); + } + } + dataVoid.clear(); + return detachedData; + } + + /// Release associated thread data returned by detachData() call + void cleanupDetachedData() + { + AutoLock lock(mutex); + cleanupMode = true; + _cleanupDetachedData(); + cleanupMode = false; + } + + /// Release associated thread data + void cleanup() + { + cleanupMode = true; + TLSDataContainer::cleanup(); + + AutoLock lock(mutex); + _cleanupDetachedData(); + _cleanupTerminatedData(); + cleanupMode = false; + } + + /// Release associated thread data and free TLS key + void release() + { + cleanupMode = true; + TLSDataContainer::release(); + { + AutoLock lock(mutex); + _cleanupDetachedData(); + _cleanupTerminatedData(); + } + } + +protected: + // synchronized + void _cleanupDetachedData() + { + for (typename std::vector::iterator i = detachedData.begin(); i != detachedData.end(); ++i) + { + deleteDataInstance((T*)*i); + } + detachedData.clear(); + } + + // synchronized + void _cleanupTerminatedData() + { + for (typename std::vector::iterator i = dataFromTerminatedThreads.begin(); i != dataFromTerminatedThreads.end(); ++i) + { + deleteDataInstance((T*)*i); + } + dataFromTerminatedThreads.clear(); + } + +protected: + virtual void* createDataInstance() const CV_OVERRIDE + { + // Note: we can collect all allocated data here, but this would require raced mutex locks + return new T; + } + virtual void deleteDataInstance(void* pData) const CV_OVERRIDE + { + if (cleanupMode) + { + delete (T*)pData; + } + else + { + AutoLock lock(mutex); + dataFromTerminatedThreads.push_back((T*)pData); + } + } +}; + + +//! @} + +} // namespace + +#endif // OPENCV_UTILS_TLS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/trace.hpp b/3rdparty/opencv/include/opencv2/core/utils/trace.hpp similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/core/utils/trace.hpp rename to 3rdparty/opencv/include/opencv2/core/utils/trace.hpp index 858e973..ef5d35b 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/trace.hpp +++ b/3rdparty/opencv/include/opencv2/core/utils/trace.hpp @@ -7,15 +7,13 @@ #include -//! @addtogroup core_logging -// This section describes OpenCV tracing utilities. -// -//! @{ - namespace cv { namespace utils { namespace trace { +//! @addtogroup core_logging +//! @{ + //! Macro to trace function #define CV_TRACE_FUNCTION() @@ -247,8 +245,8 @@ CV_EXPORTS void traceArg(const TraceArg& arg, double value); //! @endcond -}}} // namespace - //! @} +}}} // namespace + #endif // OPENCV_TRACE_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/va_intel.hpp b/3rdparty/opencv/include/opencv2/core/va_intel.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/va_intel.hpp rename to 3rdparty/opencv/include/opencv2/core/va_intel.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/version.hpp b/3rdparty/opencv/include/opencv2/core/version.hpp similarity index 96% rename from qt-correction-tool/pub/opencv/include/opencv2/core/version.hpp rename to 3rdparty/opencv/include/opencv2/core/version.hpp index fe6df95..2d602d6 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/version.hpp +++ b/3rdparty/opencv/include/opencv2/core/version.hpp @@ -7,7 +7,7 @@ #define CV_VERSION_MAJOR 3 #define CV_VERSION_MINOR 4 -#define CV_VERSION_REVISION 6 +#define CV_VERSION_REVISION 14 #define CV_VERSION_STATUS "" #define CVAUX_STR_EXP(__A) #__A diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/vsx_utils.hpp b/3rdparty/opencv/include/opencv2/core/vsx_utils.hpp similarity index 94% rename from qt-correction-tool/pub/opencv/include/opencv2/core/vsx_utils.hpp rename to 3rdparty/opencv/include/opencv2/core/vsx_utils.hpp index 6e2baea..68863ff 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/vsx_utils.hpp +++ b/3rdparty/opencv/include/opencv2/core/vsx_utils.hpp @@ -110,9 +110,9 @@ VSX_FINLINE(rt) fnm(const rg& a, const rg& b) { return fn2(a, b); } #if defined(__GNUG__) && !defined(__clang__) // inline asm helper -#define VSX_IMPL_1RG(rt, rto, rg, rgo, opc, fnm) \ -VSX_FINLINE(rt) fnm(const rg& a) \ -{ rt rs; __asm__ __volatile__(#opc" %x0,%x1" : "="#rto (rs) : #rgo (a)); return rs; } +#define VSX_IMPL_1RG(rt, rg, opc, fnm) \ +VSX_FINLINE(rt) fnm(const rg& a) \ +{ rt rs; __asm__ __volatile__(#opc" %x0,%x1" : "=wa" (rs) : "wa" (a)); return rs; } #define VSX_IMPL_1VRG(rt, rg, opc, fnm) \ VSX_FINLINE(rt) fnm(const rg& a) \ @@ -124,6 +124,33 @@ VSX_FINLINE(rt) fnm(const rg& a, const rg& b) \ #define VSX_IMPL_2VRG(rt, rg, opc, fnm) VSX_IMPL_2VRG_F(rt, rg, #opc" %0,%1,%2", fnm) +#if __GNUG__ < 8 + + // Support for int4 -> dword2 expanding multiply was added in GCC 8. + #ifdef vec_mule + #undef vec_mule + #endif + #ifdef vec_mulo + #undef vec_mulo + #endif + + VSX_REDIRECT_2RG(vec_ushort8, vec_uchar16, vec_mule, __builtin_vec_mule) + VSX_REDIRECT_2RG(vec_short8, vec_char16, vec_mule, __builtin_vec_mule) + VSX_REDIRECT_2RG(vec_int4, vec_short8, vec_mule, __builtin_vec_mule) + VSX_REDIRECT_2RG(vec_uint4, vec_ushort8, vec_mule, __builtin_vec_mule) + VSX_REDIRECT_2RG(vec_ushort8, vec_uchar16, vec_mulo, __builtin_vec_mulo) + VSX_REDIRECT_2RG(vec_short8, vec_char16, vec_mulo, __builtin_vec_mulo) + VSX_REDIRECT_2RG(vec_int4, vec_short8, vec_mulo, __builtin_vec_mulo) + VSX_REDIRECT_2RG(vec_uint4, vec_ushort8, vec_mulo, __builtin_vec_mulo) + + // dword2 support arrived in ISA 2.07 and GCC 8+ + VSX_IMPL_2VRG(vec_dword2, vec_int4, vmulosw, vec_mule) + VSX_IMPL_2VRG(vec_udword2, vec_uint4, vmulouw, vec_mule) + VSX_IMPL_2VRG(vec_dword2, vec_int4, vmulesw, vec_mulo) + VSX_IMPL_2VRG(vec_udword2, vec_uint4, vmuleuw, vec_mulo) + +#endif + #if __GNUG__ < 7 // up to GCC 6 vec_mul only supports precisions and llong # ifdef vec_mul @@ -206,6 +233,10 @@ VSX_FINLINE(rt) fnm(const rg& a, const rg& b) \ #if __GNUG__ < 5 // vec_xxpermdi in gcc4 missing little-endian supports just like clang # define vec_permi(a, b, c) vec_xxpermdi(b, a, (3 ^ (((c) & 1) << 1 | (c) >> 1))) +// same as vec_xxpermdi +# undef vec_vbpermq + VSX_IMPL_2VRG(vec_udword2, vec_uchar16, vbpermq, vec_vbpermq) + VSX_IMPL_2VRG(vec_dword2, vec_char16, vbpermq, vec_vbpermq) #else # define vec_permi vec_xxpermdi #endif // __GNUG__ < 5 @@ -230,44 +261,38 @@ VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp) VSX_REDIRECT_1RG(vec_double2, vec_float4, vec_cvfo, __builtin_vsx_xvcvspdp) // converts word and doubleword to double-precision -#ifdef vec_ctd -# undef vec_ctd -#endif -VSX_IMPL_1RG(vec_double2, wd, vec_int4, wa, xvcvsxwdp, vec_ctdo) -VSX_IMPL_1RG(vec_double2, wd, vec_uint4, wa, xvcvuxwdp, vec_ctdo) -VSX_IMPL_1RG(vec_double2, wd, vec_dword2, wi, xvcvsxddp, vec_ctd) -VSX_IMPL_1RG(vec_double2, wd, vec_udword2, wi, xvcvuxddp, vec_ctd) +#undef vec_ctd +VSX_IMPL_1RG(vec_double2, vec_int4, xvcvsxwdp, vec_ctdo) +VSX_IMPL_1RG(vec_double2, vec_uint4, xvcvuxwdp, vec_ctdo) +VSX_IMPL_1RG(vec_double2, vec_dword2, xvcvsxddp, vec_ctd) +VSX_IMPL_1RG(vec_double2, vec_udword2, xvcvuxddp, vec_ctd) // converts word and doubleword to single-precision #undef vec_ctf -VSX_IMPL_1RG(vec_float4, wf, vec_int4, wa, xvcvsxwsp, vec_ctf) -VSX_IMPL_1RG(vec_float4, wf, vec_uint4, wa, xvcvuxwsp, vec_ctf) -VSX_IMPL_1RG(vec_float4, wf, vec_dword2, wi, xvcvsxdsp, vec_ctfo) -VSX_IMPL_1RG(vec_float4, wf, vec_udword2, wi, xvcvuxdsp, vec_ctfo) +VSX_IMPL_1RG(vec_float4, vec_int4, xvcvsxwsp, vec_ctf) +VSX_IMPL_1RG(vec_float4, vec_uint4, xvcvuxwsp, vec_ctf) +VSX_IMPL_1RG(vec_float4, vec_dword2, xvcvsxdsp, vec_ctfo) +VSX_IMPL_1RG(vec_float4, vec_udword2, xvcvuxdsp, vec_ctfo) // converts single and double precision to signed word #undef vec_cts -VSX_IMPL_1RG(vec_int4, wa, vec_double2, wd, xvcvdpsxws, vec_ctso) -VSX_IMPL_1RG(vec_int4, wa, vec_float4, wf, xvcvspsxws, vec_cts) +VSX_IMPL_1RG(vec_int4, vec_double2, xvcvdpsxws, vec_ctso) +VSX_IMPL_1RG(vec_int4, vec_float4, xvcvspsxws, vec_cts) // converts single and double precision to unsigned word #undef vec_ctu -VSX_IMPL_1RG(vec_uint4, wa, vec_double2, wd, xvcvdpuxws, vec_ctuo) -VSX_IMPL_1RG(vec_uint4, wa, vec_float4, wf, xvcvspuxws, vec_ctu) +VSX_IMPL_1RG(vec_uint4, vec_double2, xvcvdpuxws, vec_ctuo) +VSX_IMPL_1RG(vec_uint4, vec_float4, xvcvspuxws, vec_ctu) // converts single and double precision to signed doubleword -#ifdef vec_ctsl -# undef vec_ctsl -#endif -VSX_IMPL_1RG(vec_dword2, wi, vec_double2, wd, xvcvdpsxds, vec_ctsl) -VSX_IMPL_1RG(vec_dword2, wi, vec_float4, wf, xvcvspsxds, vec_ctslo) +#undef vec_ctsl +VSX_IMPL_1RG(vec_dword2, vec_double2, xvcvdpsxds, vec_ctsl) +VSX_IMPL_1RG(vec_dword2, vec_float4, xvcvspsxds, vec_ctslo) // converts single and double precision to unsigned doubleword -#ifdef vec_ctul -# undef vec_ctul -#endif -VSX_IMPL_1RG(vec_udword2, wi, vec_double2, wd, xvcvdpuxds, vec_ctul) -VSX_IMPL_1RG(vec_udword2, wi, vec_float4, wf, xvcvspuxds, vec_ctulo) +#undef vec_ctul +VSX_IMPL_1RG(vec_udword2, vec_double2, xvcvdpuxds, vec_ctul) +VSX_IMPL_1RG(vec_udword2, vec_float4, xvcvspuxds, vec_ctulo) // just in case if GCC doesn't define it #ifndef vec_xl @@ -290,7 +315,7 @@ VSX_IMPL_1RG(vec_udword2, wi, vec_float4, wf, xvcvspuxds, vec_ctulo) * Also there's already an open bug https://bugs.llvm.org/show_bug.cgi?id=31837 * * So we're not able to use inline asm and only use built-in functions that CLANG supports - * and use __builtin_convertvector if clang missng any of vector conversions built-in functions + * and use __builtin_convertvector if clang missing any of vector conversions built-in functions * * todo: clang asm template bug is fixed, need to reconsider the current workarounds. */ @@ -363,10 +388,12 @@ VSX_FINLINE(Tvec) vec_popcntu(const Tvec2& a) \ VSX_IMPL_POPCNTU(vec_uchar16, vec_char16, vec_uchar16_c); VSX_IMPL_POPCNTU(vec_ushort8, vec_short8, vec_ushort8_c); VSX_IMPL_POPCNTU(vec_uint4, vec_int4, vec_uint4_c); +VSX_IMPL_POPCNTU(vec_udword2, vec_dword2, vec_udword2_c); // redirect unsigned types VSX_REDIRECT_1RG(vec_uchar16, vec_uchar16, vec_popcntu, vec_popcnt) VSX_REDIRECT_1RG(vec_ushort8, vec_ushort8, vec_popcntu, vec_popcnt) VSX_REDIRECT_1RG(vec_uint4, vec_uint4, vec_popcntu, vec_popcnt) +VSX_REDIRECT_1RG(vec_udword2, vec_udword2, vec_popcntu, vec_popcnt) // converts between single and double precision VSX_REDIRECT_1RG(vec_float4, vec_double2, vec_cvfo, __builtin_vsx_xvcvdpsp) @@ -462,7 +489,7 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo) // Only for Eigen! /* * changing behavior of conversion intrinsics for gcc has effect on Eigen - * so we redfine old behavior again only on gcc, clang + * so we redefine old behavior again only on gcc, clang */ #if !defined(__clang__) || __clang_major__ > 4 // ignoring second arg since Eigen only truncates toward zero @@ -470,13 +497,15 @@ VSX_IMPL_CONV_EVEN_2_4(vec_uint4, vec_double2, vec_ctu, vec_ctuo) VSX_FINLINE(rt) fnm(const rg& a, int only_truncate) \ { \ assert(only_truncate == 0); \ - CV_UNUSED(only_truncate); \ + CV_UNUSED(only_truncate); \ return fn2(a); \ } VSX_IMPL_CONV_2VARIANT(vec_int4, vec_float4, vec_cts, vec_cts) + VSX_IMPL_CONV_2VARIANT(vec_uint4, vec_float4, vec_ctu, vec_ctu) VSX_IMPL_CONV_2VARIANT(vec_float4, vec_int4, vec_ctf, vec_ctf) + VSX_IMPL_CONV_2VARIANT(vec_float4, vec_uint4, vec_ctf, vec_ctf) // define vec_cts for converting double precision to signed doubleword - // which isn't combitable with xlc but its okay since Eigen only use it for gcc + // which isn't compatible with xlc but its okay since Eigen only uses it for gcc VSX_IMPL_CONV_2VARIANT(vec_dword2, vec_double2, vec_cts, vec_ctsl) #endif // Eigen diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/wimage.hpp b/3rdparty/opencv/include/opencv2/core/wimage.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/core/wimage.hpp rename to 3rdparty/opencv/include/opencv2/core/wimage.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/cvconfig.h b/3rdparty/opencv/include/opencv2/cvconfig.h similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/cvconfig.h rename to 3rdparty/opencv/include/opencv2/cvconfig.h index 1c91916..0fd8109 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/cvconfig.h +++ b/3rdparty/opencv/include/opencv2/cvconfig.h @@ -2,7 +2,7 @@ #define OPENCV_CVCONFIG_H_INCLUDED /* OpenCV compiled as static or dynamic libs */ -#define BUILD_SHARED_LIBS +/* #undef BUILD_SHARED_LIBS */ /* OpenCV intrinsics optimized code */ #define CV_ENABLE_INTRINSICS @@ -13,9 +13,6 @@ /* Compile for 'real' NVIDIA GPU architectures */ #define CUDA_ARCH_BIN "" -/* Create PTX or BIN for 1.0 compute capability */ -/* #undef CUDA_ARCH_BIN_OR_PTX_10 */ - /* NVIDIA GPU features are used */ #define CUDA_ARCH_FEATURES "" @@ -127,6 +124,8 @@ /* NVIDIA Video Decoding API*/ /* #undef HAVE_NVCUVID */ +/* #undef HAVE_NVCUVID_HEADER */ +/* #undef HAVE_DYNLINK_NVCUVID_HEADER */ /* NVIDIA Video Encoding API*/ /* #undef HAVE_NVCUVENC */ @@ -188,7 +187,7 @@ /* #undef HAVE_VIDEOIO */ /* Win32 UI */ -#define HAVE_WIN32UI +/* #undef HAVE_WIN32UI */ /* XIMEA camera support */ /* #undef HAVE_XIMEA */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/highgui.hpp b/3rdparty/opencv/include/opencv2/highgui.hpp similarity index 97% rename from qt-correction-tool/pub/opencv/include/opencv2/highgui.hpp rename to 3rdparty/opencv/include/opencv2/highgui.hpp index 994a1d1..6a8c598 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/highgui.hpp +++ b/3rdparty/opencv/include/opencv2/highgui.hpp @@ -66,6 +66,7 @@ It provides easy interface to: - Add trackbars to the windows, handle simple mouse events as well as keyboard commands. @{ + @defgroup highgui_window_flags Flags related creating and manipulating HighGUI windows and mouse events @defgroup highgui_opengl OpenGL support @defgroup highgui_qt Qt New Functions @@ -93,7 +94,7 @@ It provides easy interface to: namedWindow("main1",WINDOW_NORMAL); - namedWindow("main2",WINDOW_AUTOSIZE | CV_GUI_NORMAL); + namedWindow("main2",WINDOW_AUTOSIZE | WINDOW_GUI_NORMAL); createTrackbar( "track1", "main1", &value, 255, NULL); String nameb1 = "button1"; @@ -178,6 +179,9 @@ namespace cv //! @addtogroup highgui //! @{ +//! @addtogroup highgui_window_flags +//! @{ + //! Flags for cv::namedWindow enum WindowFlags { WINDOW_NORMAL = 0x00000000, //!< the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size. @@ -197,7 +201,8 @@ enum WindowPropertyFlags { WND_PROP_AUTOSIZE = 1, //!< autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE). WND_PROP_ASPECT_RATIO = 2, //!< window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO). WND_PROP_OPENGL = 3, //!< opengl support. - WND_PROP_VISIBLE = 4 //!< checks whether the window exists and is visible + WND_PROP_VISIBLE = 4, //!< checks whether the window exists and is visible + WND_PROP_TOPMOST = 5 //!< property to toggle normal window being topmost or not }; //! Mouse Events see cv::MouseCallback @@ -226,6 +231,11 @@ enum MouseEventFlags { EVENT_FLAG_ALTKEY = 32 //!< indicates that ALT Key is pressed. }; +//! @} highgui_window_flags + +//! @addtogroup highgui_qt +//! @{ + //! Qt font weight enum QtFontWeights { QT_FONT_LIGHT = 25, //!< Weight of 25 @@ -250,6 +260,8 @@ enum QtButtonTypes { QT_NEW_BUTTONBAR = 1024 //!< Button should create a new buttonbar }; +//! @} highgui_qt + /** @brief Callback function for mouse events. see cv::setMouseCallback @param event one of the cv::MouseEventTypes constants. @param x The x-coordinate of the mouse event. @@ -388,7 +400,7 @@ videos, it will display the video frame-by-frame) */ CV_EXPORTS_W void imshow(const String& winname, InputArray mat); -/** @brief Resizes window to the specified size +/** @brief Resizes the window to the specified size @note @@ -407,7 +419,7 @@ CV_EXPORTS_W void resizeWindow(const String& winname, int width, int height); */ CV_EXPORTS_W void resizeWindow(const String& winname, const cv::Size& size); -/** @brief Moves window to the specified position +/** @brief Moves the window to the specified position @param winname Name of the window. @param x The new x-coordinate of the window. @@ -475,8 +487,6 @@ For cv::EVENT_MOUSEWHEEL positive and negative values mean forward and backward respectively. For cv::EVENT_MOUSEHWHEEL, where available, positive and negative values mean right and left scrolling, respectively. -With the C API, the macro CV_GET_WHEEL_DELTA(flags) can be used alternatively. - @note Mouse-wheel events are currently supported only on Windows. @@ -485,8 +495,9 @@ Mouse-wheel events are currently supported only on Windows. */ CV_EXPORTS int getMouseWheelDelta(int flags); -/** @brief Selects ROI on the given image. -Function creates a window and allows user to select a ROI using mouse. +/** @brief Allows users to select a ROI on the given image. + +The function creates a window and allows users to select a ROI using the mouse. Controls: use `space` or `enter` to finish selection, use key `c` to cancel selection (function will return the zero cv::Rect). @param windowName name of the window where selection process will be shown. @@ -505,8 +516,9 @@ CV_EXPORTS_W Rect selectROI(const String& windowName, InputArray img, bool showC */ CV_EXPORTS_W Rect selectROI(InputArray img, bool showCrosshair = true, bool fromCenter = false); -/** @brief Selects ROIs on the given image. -Function creates a window and allows user to select a ROIs using mouse. +/** @brief Allows users to select multiple ROIs on the given image. + +The function creates a window and allows users to select multiple ROIs using the mouse. Controls: use `space` or `enter` to finish current selection and start a new one, use `esc` to terminate multiple ROI selection process. diff --git a/qt-correction-tool/pub/opencv/include/opencv2/highgui/highgui.hpp b/3rdparty/opencv/include/opencv2/highgui/highgui.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/highgui/highgui.hpp rename to 3rdparty/opencv/include/opencv2/highgui/highgui.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/highgui/highgui_c.h b/3rdparty/opencv/include/opencv2/highgui/highgui_c.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/highgui/highgui_c.h rename to 3rdparty/opencv/include/opencv2/highgui/highgui_c.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgcodecs.hpp b/3rdparty/opencv/include/opencv2/imgcodecs.hpp similarity index 94% rename from qt-correction-tool/pub/opencv/include/opencv2/imgcodecs.hpp rename to 3rdparty/opencv/include/opencv2/imgcodecs.hpp index ab75990..7f6b24f 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/imgcodecs.hpp +++ b/3rdparty/opencv/include/opencv2/imgcodecs.hpp @@ -49,6 +49,7 @@ @defgroup imgcodecs Image file reading and writing @{ @defgroup imgcodecs_c C API + @defgroup imgcodecs_flags Flags used for image file reading and writing @defgroup imgcodecs_ios iOS glue @} */ @@ -60,9 +61,12 @@ namespace cv //! @addtogroup imgcodecs //! @{ +//! @addtogroup imgcodecs_flags +//! @{ + //! Imread flags enum ImreadModes { - IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). + IMREAD_UNCHANGED = -1, //!< If set, return the loaded image as is (with alpha channel, otherwise it gets cropped). Ignore EXIF orientation. IMREAD_GRAYSCALE = 0, //!< If set, always convert image to the single channel grayscale image (codec internal conversion). IMREAD_COLOR = 1, //!< If set, always convert image to the 3 channel BGR color image. IMREAD_ANYDEPTH = 2, //!< If set, return 16-bit/32-bit image when the input has the corresponding depth, otherwise convert it to 8-bit. @@ -130,6 +134,8 @@ enum ImwritePAMFlags { IMWRITE_PAM_FORMAT_RGB_ALPHA = 5, }; +//! @} imgcodecs_flags + /** @brief Loads an image from a file. @anchor imread @@ -170,8 +176,9 @@ Currently, the following file formats are supported: then the [GDAL](http://www.gdal.org) driver will be used in order to decode the image, supporting the following formats: [Raster](http://www.gdal.org/formats_list.html), [Vector](http://www.gdal.org/ogr_formats.html). -- If EXIF information are embedded in the image file, the EXIF orientation will be taken into account - and thus the image will be rotated accordingly except if the flag @ref IMREAD_IGNORE_ORIENTATION is passed. +- If EXIF information is embedded in the image file, the EXIF orientation will be taken into account + and thus the image will be rotated accordingly except if the flags @ref IMREAD_IGNORE_ORIENTATION + or @ref IMREAD_UNCHANGED are passed. - By default number of pixels must be less than 2^30. Limit can be set using system variable OPENCV_IO_MAX_IMAGE_PIXELS @@ -203,21 +210,30 @@ can be saved using this function, with these exceptions: - PNG images with an alpha channel can be saved using this function. To do this, create 8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535 (see the code sample below). +- Multiple images (vector of Mat) can be saved in TIFF format (see the code sample below). If the format, depth or channel order is different, use Mat::convertTo and cv::cvtColor to convert it before saving. Or, use the universal FileStorage I/O functions to save the image to XML or YAML format. -The sample below shows how to create a BGRA image and save it to a PNG file. It also demonstrates how to set custom -compression parameters: +The sample below shows how to create a BGRA image, how to set custom compression parameters and save it to a PNG file. +It also demonstrates how to save multiple images in a TIFF file: @include snippets/imgcodecs_imwrite.cpp @param filename Name of the file. -@param img Image to be saved. +@param img (Mat or vector of Mat) Image or Images to be saved. @param params Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags */ CV_EXPORTS_W bool imwrite( const String& filename, InputArray img, const std::vector& params = std::vector()); +/// @overload multi-image overload for bindings +CV_WRAP static inline +bool imwritemulti(const String& filename, InputArrayOfArrays img, + const std::vector& params = std::vector()) +{ + return imwrite(filename, img, params); +} + /** @brief Reads an image from a buffer in memory. The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/imgcodecs.hpp b/3rdparty/opencv/include/opencv2/imgcodecs/imgcodecs.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/imgcodecs.hpp rename to 3rdparty/opencv/include/opencv2/imgcodecs/imgcodecs.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/imgcodecs_c.h b/3rdparty/opencv/include/opencv2/imgcodecs/imgcodecs_c.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/imgcodecs_c.h rename to 3rdparty/opencv/include/opencv2/imgcodecs/imgcodecs_c.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/ios.h b/3rdparty/opencv/include/opencv2/imgcodecs/ios.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgcodecs/ios.h rename to 3rdparty/opencv/include/opencv2/imgcodecs/ios.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc.hpp b/3rdparty/opencv/include/opencv2/imgproc.hpp similarity index 95% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc.hpp rename to 3rdparty/opencv/include/opencv2/imgproc.hpp index ab7d0e6..2ded15d 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/imgproc.hpp +++ b/3rdparty/opencv/include/opencv2/imgproc.hpp @@ -226,7 +226,7 @@ enum MorphTypes{ enum MorphShapes { MORPH_RECT = 0, //!< a rectangular structuring element: \f[E_{ij}=1\f] MORPH_CROSS = 1, //!< a cross-shaped structuring element: - //!< \f[E_{ij} = \fork{1}{if i=\texttt{anchor.y} or j=\texttt{anchor.x}}{0}{otherwise}\f] + //!< \f[E_{ij} = \begin{cases} 1 & \texttt{if } {i=\texttt{anchor.y } {or } {j=\texttt{anchor.x}}} \\0 & \texttt{otherwise} \end{cases}\f] MORPH_ELLIPSE = 2 //!< an elliptic structuring element, that is, a filled ellipse inscribed //!< into the rectangle Rect(0, 0, esize.width, 0.esize.height) }; @@ -252,6 +252,9 @@ enum InterpolationFlags{ INTER_LANCZOS4 = 4, /** Bit exact bilinear interpolation */ INTER_LINEAR_EXACT = 5, + /** Bit exact nearest neighbor interpolation. This will produce same results as + the nearest neighbor method in PIL, scikit-image or Matlab. */ + INTER_NEAREST_EXACT = 6, /** mask for interpolation codes */ INTER_MAX = 7, /** flag, fills all of the destination image pixels. If some of them correspond to outliers in the @@ -387,7 +390,7 @@ enum FloodFillFlags { //! @addtogroup imgproc_shape //! @{ -//! connected components algorithm output formats +//! connected components statistics enum ConnectedComponentsTypes { CC_STAT_LEFT = 0, //!< The leftmost (x) coordinate which is the inclusive start of the bounding //!< box in the horizontal direction. @@ -396,14 +399,20 @@ enum ConnectedComponentsTypes { CC_STAT_WIDTH = 2, //!< The horizontal size of the bounding box CC_STAT_HEIGHT = 3, //!< The vertical size of the bounding box CC_STAT_AREA = 4, //!< The total area (in pixels) of the connected component - CC_STAT_MAX = 5 +#ifndef CV_DOXYGEN + CC_STAT_MAX = 5 //!< Max enumeration value. Used internally only for memory allocation +#endif }; //! connected components algorithm enum ConnectedComponentsAlgorithmsTypes { - CCL_WU = 0, //!< SAUF algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity - CCL_DEFAULT = -1, //!< BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity - CCL_GRANA = 1 //!< BBDT algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity + CCL_DEFAULT = -1, //!< BBDT @cite Grana2010 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for both BBDT and SAUF. + CCL_WU = 0, //!< SAUF @cite Wu2009 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for SAUF. + CCL_GRANA = 1, //!< BBDT @cite Grana2010 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. The parallel implementation described in @cite Bolelli2017 is available for both BBDT and SAUF. + CCL_BOLELLI = 2, //!< Spaghetti @cite Bolelli2019 algorithm for 8-way connectivity, SAUF algorithm for 4-way connectivity. + CCL_SAUF = 3, //!< Same as CCL_WU. It is preferable to use the flag with the name of the algorithm (CCL_SAUF) rather than the one with the name of the first author (CCL_WU). + CCL_BBDT = 4, //!< Same as CCL_GRANA. It is preferable to use the flag with the name of the algorithm (CCL_BBDT) rather than the one with the name of the first author (CCL_GRANA). + CCL_SPAGHETTI = 5, //!< Same as CCL_BOLELLI. It is preferable to use the flag with the name of the algorithm (CCL_SPAGHETTI) rather than the one with the name of the first author (CCL_BOLELLI). }; //! mode of the contour retrieval algorithm @@ -582,7 +591,7 @@ enum ColorConversionCodes { COLOR_YCrCb2BGR = 38, COLOR_YCrCb2RGB = 39, - COLOR_BGR2HSV = 40, //!< convert RGB/BGR to HSV (hue saturation value), @ref color_convert_rgb_hsv "color conversions" + COLOR_BGR2HSV = 40, //!< convert RGB/BGR to HSV (hue saturation value) with H range 0..180 if 8 bit image, @ref color_convert_rgb_hsv "color conversions" COLOR_RGB2HSV = 41, COLOR_BGR2Lab = 44, //!< convert RGB/BGR to CIE Lab, @ref color_convert_rgb_lab "color conversions" @@ -590,27 +599,27 @@ enum ColorConversionCodes { COLOR_BGR2Luv = 50, //!< convert RGB/BGR to CIE Luv, @ref color_convert_rgb_luv "color conversions" COLOR_RGB2Luv = 51, - COLOR_BGR2HLS = 52, //!< convert RGB/BGR to HLS (hue lightness saturation), @ref color_convert_rgb_hls "color conversions" + COLOR_BGR2HLS = 52, //!< convert RGB/BGR to HLS (hue lightness saturation) with H range 0..180 if 8 bit image, @ref color_convert_rgb_hls "color conversions" COLOR_RGB2HLS = 53, - COLOR_HSV2BGR = 54, //!< backward conversions to RGB/BGR + COLOR_HSV2BGR = 54, //!< backward conversions HSV to RGB/BGR with H range 0..180 if 8 bit image COLOR_HSV2RGB = 55, COLOR_Lab2BGR = 56, COLOR_Lab2RGB = 57, COLOR_Luv2BGR = 58, COLOR_Luv2RGB = 59, - COLOR_HLS2BGR = 60, + COLOR_HLS2BGR = 60, //!< backward conversions HLS to RGB/BGR with H range 0..180 if 8 bit image COLOR_HLS2RGB = 61, - COLOR_BGR2HSV_FULL = 66, + COLOR_BGR2HSV_FULL = 66, //!< convert RGB/BGR to HSV (hue saturation value) with H range 0..255 if 8 bit image, @ref color_convert_rgb_hsv "color conversions" COLOR_RGB2HSV_FULL = 67, - COLOR_BGR2HLS_FULL = 68, + COLOR_BGR2HLS_FULL = 68, //!< convert RGB/BGR to HLS (hue lightness saturation) with H range 0..255 if 8 bit image, @ref color_convert_rgb_hls "color conversions" COLOR_RGB2HLS_FULL = 69, - COLOR_HSV2BGR_FULL = 70, + COLOR_HSV2BGR_FULL = 70, //!< backward conversions HSV to RGB/BGR with H range 0..255 if 8 bit image COLOR_HSV2RGB_FULL = 71, - COLOR_HLS2BGR_FULL = 72, + COLOR_HLS2BGR_FULL = 72, //!< backward conversions HLS to RGB/BGR with H range 0..255 if 8 bit image COLOR_HLS2RGB_FULL = 73, COLOR_LBGR2Lab = 74, @@ -799,108 +808,108 @@ enum RectanglesIntersectTypes { /** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform */ -class CV_EXPORTS GeneralizedHough : public Algorithm +class CV_EXPORTS_W GeneralizedHough : public Algorithm { public: //! set template to search - virtual void setTemplate(InputArray templ, Point templCenter = Point(-1, -1)) = 0; - virtual void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1)) = 0; + CV_WRAP virtual void setTemplate(InputArray templ, Point templCenter = Point(-1, -1)) = 0; + CV_WRAP virtual void setTemplate(InputArray edges, InputArray dx, InputArray dy, Point templCenter = Point(-1, -1)) = 0; //! find template on image - virtual void detect(InputArray image, OutputArray positions, OutputArray votes = noArray()) = 0; - virtual void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = noArray()) = 0; + CV_WRAP virtual void detect(InputArray image, OutputArray positions, OutputArray votes = noArray()) = 0; + CV_WRAP virtual void detect(InputArray edges, InputArray dx, InputArray dy, OutputArray positions, OutputArray votes = noArray()) = 0; //! Canny low threshold. - virtual void setCannyLowThresh(int cannyLowThresh) = 0; - virtual int getCannyLowThresh() const = 0; + CV_WRAP virtual void setCannyLowThresh(int cannyLowThresh) = 0; + CV_WRAP virtual int getCannyLowThresh() const = 0; //! Canny high threshold. - virtual void setCannyHighThresh(int cannyHighThresh) = 0; - virtual int getCannyHighThresh() const = 0; + CV_WRAP virtual void setCannyHighThresh(int cannyHighThresh) = 0; + CV_WRAP virtual int getCannyHighThresh() const = 0; //! Minimum distance between the centers of the detected objects. - virtual void setMinDist(double minDist) = 0; - virtual double getMinDist() const = 0; + CV_WRAP virtual void setMinDist(double minDist) = 0; + CV_WRAP virtual double getMinDist() const = 0; //! Inverse ratio of the accumulator resolution to the image resolution. - virtual void setDp(double dp) = 0; - virtual double getDp() const = 0; + CV_WRAP virtual void setDp(double dp) = 0; + CV_WRAP virtual double getDp() const = 0; //! Maximal size of inner buffers. - virtual void setMaxBufferSize(int maxBufferSize) = 0; - virtual int getMaxBufferSize() const = 0; + CV_WRAP virtual void setMaxBufferSize(int maxBufferSize) = 0; + CV_WRAP virtual int getMaxBufferSize() const = 0; }; /** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform Detects position only without translation and rotation @cite Ballard1981 . */ -class CV_EXPORTS GeneralizedHoughBallard : public GeneralizedHough +class CV_EXPORTS_W GeneralizedHoughBallard : public GeneralizedHough { public: //! R-Table levels. - virtual void setLevels(int levels) = 0; - virtual int getLevels() const = 0; + CV_WRAP virtual void setLevels(int levels) = 0; + CV_WRAP virtual int getLevels() const = 0; //! The accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected. - virtual void setVotesThreshold(int votesThreshold) = 0; - virtual int getVotesThreshold() const = 0; + CV_WRAP virtual void setVotesThreshold(int votesThreshold) = 0; + CV_WRAP virtual int getVotesThreshold() const = 0; }; /** @brief finds arbitrary template in the grayscale image using Generalized Hough Transform Detects position, translation and rotation @cite Guil1999 . */ -class CV_EXPORTS GeneralizedHoughGuil : public GeneralizedHough +class CV_EXPORTS_W GeneralizedHoughGuil : public GeneralizedHough { public: //! Angle difference in degrees between two points in feature. - virtual void setXi(double xi) = 0; - virtual double getXi() const = 0; + CV_WRAP virtual void setXi(double xi) = 0; + CV_WRAP virtual double getXi() const = 0; //! Feature table levels. - virtual void setLevels(int levels) = 0; - virtual int getLevels() const = 0; + CV_WRAP virtual void setLevels(int levels) = 0; + CV_WRAP virtual int getLevels() const = 0; //! Maximal difference between angles that treated as equal. - virtual void setAngleEpsilon(double angleEpsilon) = 0; - virtual double getAngleEpsilon() const = 0; + CV_WRAP virtual void setAngleEpsilon(double angleEpsilon) = 0; + CV_WRAP virtual double getAngleEpsilon() const = 0; //! Minimal rotation angle to detect in degrees. - virtual void setMinAngle(double minAngle) = 0; - virtual double getMinAngle() const = 0; + CV_WRAP virtual void setMinAngle(double minAngle) = 0; + CV_WRAP virtual double getMinAngle() const = 0; //! Maximal rotation angle to detect in degrees. - virtual void setMaxAngle(double maxAngle) = 0; - virtual double getMaxAngle() const = 0; + CV_WRAP virtual void setMaxAngle(double maxAngle) = 0; + CV_WRAP virtual double getMaxAngle() const = 0; //! Angle step in degrees. - virtual void setAngleStep(double angleStep) = 0; - virtual double getAngleStep() const = 0; + CV_WRAP virtual void setAngleStep(double angleStep) = 0; + CV_WRAP virtual double getAngleStep() const = 0; //! Angle votes threshold. - virtual void setAngleThresh(int angleThresh) = 0; - virtual int getAngleThresh() const = 0; + CV_WRAP virtual void setAngleThresh(int angleThresh) = 0; + CV_WRAP virtual int getAngleThresh() const = 0; //! Minimal scale to detect. - virtual void setMinScale(double minScale) = 0; - virtual double getMinScale() const = 0; + CV_WRAP virtual void setMinScale(double minScale) = 0; + CV_WRAP virtual double getMinScale() const = 0; //! Maximal scale to detect. - virtual void setMaxScale(double maxScale) = 0; - virtual double getMaxScale() const = 0; + CV_WRAP virtual void setMaxScale(double maxScale) = 0; + CV_WRAP virtual double getMaxScale() const = 0; //! Scale step. - virtual void setScaleStep(double scaleStep) = 0; - virtual double getScaleStep() const = 0; + CV_WRAP virtual void setScaleStep(double scaleStep) = 0; + CV_WRAP virtual double getScaleStep() const = 0; //! Scale votes threshold. - virtual void setScaleThresh(int scaleThresh) = 0; - virtual int getScaleThresh() const = 0; + CV_WRAP virtual void setScaleThresh(int scaleThresh) = 0; + CV_WRAP virtual int getScaleThresh() const = 0; //! Position votes threshold. - virtual void setPosThresh(int posThresh) = 0; - virtual int getPosThresh() const = 0; + CV_WRAP virtual void setPosThresh(int posThresh) = 0; + CV_WRAP virtual int getPosThresh() const = 0; }; //! @} imgproc_shape @@ -1074,11 +1083,11 @@ public: */ CV_WRAP void getTriangleList(CV_OUT std::vector& triangleList) const; - /** @brief Returns a list of all Voroni facets. + /** @brief Returns a list of all Voronoi facets. @param idx Vector of vertices IDs to consider. For all vertices you can pass empty vector. - @param facetList Output vector of the Voroni facets. - @param facetCenters Output vector of the Voroni facets center points. + @param facetList Output vector of the Voronoi facets. + @param facetCenters Output vector of the Voronoi facets center points. */ CV_WRAP void getVoronoiFacetList(const std::vector& idx, CV_OUT std::vector >& facetList, @@ -1407,7 +1416,7 @@ equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width an respectively (see #getGaussianKernel for details); to fully control the result regardless of possible future modifications of all this semantics, it is recommended to specify all of ksize, sigmaX, and sigmaY. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur */ @@ -1455,7 +1464,7 @@ The function smooths an image using the kernel: where -\f[\alpha = \fork{\frac{1}{\texttt{ksize.width*ksize.height}}}{when \texttt{normalize=true}}{1}{otherwise}\f] +\f[\alpha = \begin{cases} \frac{1}{\texttt{ksize.width*ksize.height}} & \texttt{when } \texttt{normalize=true} \\1 & \texttt{otherwise}\end{cases}\f] Unnormalized box filter is useful for computing various integral characteristics over each pixel neighborhood, such as covariance matrices of image derivatives (used in dense optical flow @@ -1468,7 +1477,7 @@ algorithms, and so on). If you need to compute pixel sums over variable-size win @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel center. @param normalize flag, specifying whether the kernel is normalized by its area or not. -@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes +@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported. @sa blur, bilateralFilter, GaussianBlur, medianBlur, integral */ CV_EXPORTS_W void boxFilter( InputArray src, OutputArray dst, int ddepth, @@ -1491,7 +1500,7 @@ variance and standard deviation around the neighborhood of a pixel. @param anchor kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel center. @param normalize flag, specifying whether the kernel is to be normalized by it's area or not. -@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes +@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported. @sa boxFilter */ CV_EXPORTS_W void sqrBoxFilter( InputArray src, OutputArray dst, int ddepth, @@ -1505,7 +1514,7 @@ The function smooths an image using the kernel: \f[\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}\f] -The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), +The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(), ksize, anchor, true, borderType)`. @param src input image; it can have any number of channels, which are processed independently, but @@ -1514,7 +1523,7 @@ the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. @param ksize blurring kernel size. @param anchor anchor point; default value Point(-1,-1) means that the anchor is at the kernel center. -@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes +@param borderType border mode used to extrapolate pixels outside of the image, see #BorderTypes. #BORDER_WRAP is not supported. @sa boxFilter, bilateralFilter, GaussianBlur, medianBlur */ CV_EXPORTS_W void blur( InputArray src, OutputArray dst, @@ -1529,7 +1538,7 @@ according to the specified border mode. The function does actually compute correlation, not the convolution: -\f[\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f] +\f[\texttt{dst} (x,y) = \sum _{ \substack{0\leq x' < \texttt{kernel.cols}\\{0\leq y' < \texttt{kernel.rows}}}} \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )\f] That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows - @@ -1548,7 +1557,7 @@ separate color planes using split and process them individually. the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor is at the kernel center. @param delta optional value added to the filtered pixels before storing them in dst. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa sepFilter2D, dft, matchTemplate */ CV_EXPORTS_W void filter2D( InputArray src, OutputArray dst, int ddepth, @@ -1569,7 +1578,7 @@ kernel kernelY. The final result shifted by delta is stored in dst . @param anchor Anchor position within the kernel. The default value \f$(-1,-1)\f$ means that the anchor is at the kernel center. @param delta Value added to the filtered results before storing them. -@param borderType Pixel extrapolation method, see #BorderTypes +@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa filter2D, Sobel, GaussianBlur, boxFilter, blur */ CV_EXPORTS_W void sepFilter2D( InputArray src, OutputArray dst, int ddepth, @@ -1622,7 +1631,7 @@ The second case corresponds to a kernel of: @param scale optional scale factor for the computed derivative values; by default, no scaling is applied (see #getDerivKernels for details). @param delta optional delta value that is added to the results prior to storing them in dst. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar */ CV_EXPORTS_W void Sobel( InputArray src, OutputArray dst, int ddepth, @@ -1643,7 +1652,8 @@ Sobel( src, dy, CV_16SC1, 0, 1, 3 ); @param dx output image with first-order derivative in x. @param dy output image with first-order derivative in y. @param ksize size of Sobel kernel. It must be 3. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. + Only #BORDER_DEFAULT=#BORDER_REFLECT_101 and #BORDER_REPLICATE are supported. @sa Sobel */ @@ -1671,7 +1681,7 @@ is equivalent to @param scale optional scale factor for the computed derivative values; by default, no scaling is applied (see #getDerivKernels for details). @param delta optional delta value that is added to the results prior to storing them in dst. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa cartToPolar */ CV_EXPORTS_W void Scharr( InputArray src, OutputArray dst, int ddepth, @@ -1702,7 +1712,7 @@ details. The size must be positive and odd. @param scale Optional scale factor for the computed Laplacian values. By default, no scaling is applied. See #getDerivKernels for details. @param delta Optional delta value that is added to the results prior to storing them in dst . -@param borderType Pixel extrapolation method, see #BorderTypes +@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @sa Sobel, Scharr */ CV_EXPORTS_W void Laplacian( InputArray src, OutputArray dst, int ddepth, @@ -1771,7 +1781,7 @@ of the formulae in the cornerEigenValsAndVecs description. src . @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ). @param ksize Aperture parameter for the Sobel operator. -@param borderType Pixel extrapolation method. See #BorderTypes. +@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported. */ CV_EXPORTS_W void cornerMinEigenVal( InputArray src, OutputArray dst, int blockSize, int ksize = 3, @@ -1794,7 +1804,7 @@ size as src . @param blockSize Neighborhood size (see the details on #cornerEigenValsAndVecs ). @param ksize Aperture parameter for the Sobel operator. @param k Harris detector free parameter. See the formula above. -@param borderType Pixel extrapolation method. See #BorderTypes. +@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported. */ CV_EXPORTS_W void cornerHarris( InputArray src, OutputArray dst, int blockSize, int ksize, double k, @@ -1822,7 +1832,7 @@ The output of the function can be used for robust edge or corner detection. @param dst Image to store the results. It has the same size as src and the type CV_32FC(6) . @param blockSize Neighborhood size (see details below). @param ksize Aperture parameter for the Sobel operator. -@param borderType Pixel extrapolation method. See #BorderTypes. +@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported. @sa cornerMinEigenVal, cornerHarris, preCornerDetect */ @@ -1851,15 +1861,15 @@ The corners can be found as local maximums of the functions, as shown below: @param src Source single-channel 8-bit of floating-point image. @param dst Output image that has the type CV_32F and the same size as src . @param ksize %Aperture size of the Sobel . -@param borderType Pixel extrapolation method. See #BorderTypes. +@param borderType Pixel extrapolation method. See #BorderTypes. #BORDER_WRAP is not supported. */ CV_EXPORTS_W void preCornerDetect( InputArray src, OutputArray dst, int ksize, int borderType = BORDER_DEFAULT ); /** @brief Refines the corner locations. -The function iterates to find the sub-pixel accurate location of corners or radial saddle points, as -shown on the figure below. +The function iterates to find the sub-pixel accurate location of corners or radial saddle +points as described in @cite forstner1987fast, and as shown on the figure below. ![image](pics/cornersubpix.png) @@ -2115,7 +2125,7 @@ structuring element is used. Kernel can be created using #getStructuringElement. @param anchor position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center. @param iterations number of times erosion is applied. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @param borderValue border value in case of a constant border @sa dilate, morphologyEx, getStructuringElement */ @@ -2147,7 +2157,7 @@ structuring element is used. Kernel can be created using #getStructuringElement @param anchor position of the anchor within the element; default value (-1, -1) means that the anchor is at the element center. @param iterations number of times dilation is applied. -@param borderType pixel extrapolation method, see #BorderTypes +@param borderType pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not suported. @param borderValue border value in case of a constant border @sa erode, morphologyEx, getStructuringElement */ @@ -2172,7 +2182,7 @@ CV_8U, CV_16U, CV_16S, CV_32F or CV_64F. @param anchor Anchor position with the kernel. Negative values mean that the anchor is at the kernel center. @param iterations Number of times erosion and dilation are applied. -@param borderType Pixel extrapolation method, see #BorderTypes +@param borderType Pixel extrapolation method, see #BorderTypes. #BORDER_WRAP is not supported. @param borderValue Border value in case of a constant border. The default value has a special meaning. @sa dilate, erode, getStructuringElement @@ -2260,7 +2270,7 @@ CV_EXPORTS_W void warpAffine( InputArray src, OutputArray dst, const Scalar& borderValue = Scalar()); /** @example samples/cpp/warpPerspective_demo.cpp -An example program shows using cv::findHomography and cv::warpPerspective for image warping +An example program shows using cv::getPerspectiveTransform and cv::warpPerspective for image warping */ /** @brief Applies a perspective transformation to an image. @@ -2314,8 +2324,8 @@ CV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating poin representation to fixed-point for speed. @param map2 The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map if map1 is (x,y) points), respectively. -@param interpolation Interpolation method (see #InterpolationFlags). The method #INTER_AREA is -not supported by this function. +@param interpolation Interpolation method (see #InterpolationFlags). The methods #INTER_AREA +and #INTER_LINEAR_EXACT are not supported by this function. @param borderMode Pixel extrapolation method (see #BorderTypes). When borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that corresponds to the "outliers" in the source image are not modified by the function. @@ -3116,9 +3126,9 @@ point coordinates out of the normalized distorted point coordinates ("normalized coordinates do not depend on the camera matrix). The function can be used for both a stereo camera head or a monocular camera (when R is empty). - -@param src Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2). -@param dst Output ideal point coordinates after undistortion and reverse perspective +@param src Observed point coordinates, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel (CV_32FC2 or CV_64FC2) (or +vector\ ). +@param dst Output ideal point coordinates (1xN/Nx1 2-channel or vector\ ) after undistortion and reverse perspective transformation. If matrix P is identity or omitted, dst will contain normalized point coordinates. @param cameraMatrix Camera matrix \f$\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . @param distCoeffs Input vector of distortion coefficients @@ -3131,14 +3141,14 @@ of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion */ CV_EXPORTS_W void undistortPoints( InputArray src, OutputArray dst, InputArray cameraMatrix, InputArray distCoeffs, - InputArray R = noArray(), InputArray P = noArray()); + InputArray R = noArray(), InputArray P = noArray() ); /** @overload @note Default version of #undistortPoints does 5 iterations to compute undistorted points. */ CV_EXPORTS_AS(undistortPointsIter) void undistortPoints( InputArray src, OutputArray dst, - InputArray cameraMatrix, InputArray distCoeffs, - InputArray R, InputArray P, TermCriteria criteria); + InputArray cameraMatrix, InputArray distCoeffs, + InputArray R, InputArray P, TermCriteria criteria ); //! @} imgproc_transform @@ -3494,7 +3504,7 @@ but also identifies the nearest connected component consisting of zero pixels (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the component/pixel is stored in `labels(x, y)`. When labelType==#DIST_LABEL_CCOMP, the function automatically finds connected components of zero pixels in the input image and marks them with -distinct labels. When labelType==#DIST_LABEL_CCOMP, the function scans through the input image and +distinct labels. When labelType==#DIST_LABEL_PIXEL, the function scans through the input image and marks all the zero pixels with distinct labels. In this mode, the complexity is still linear. That is, the function provides a very fast way to @@ -3628,7 +3638,7 @@ CV_EXPORTS_W int floodFill( InputOutputArray image, InputOutputArray mask, //! @param weights1 It has a type of CV_32FC1 and the same size with src1. //! @param weights2 It has a type of CV_32FC1 and the same size with src1. //! @param dst It is created if it does not have the same size and type with src1. -CV_EXPORTS void blendLinear(InputArray src1, InputArray src2, InputArray weights1, InputArray weights2, OutputArray dst); +CV_EXPORTS_W void blendLinear(InputArray src1, InputArray src2, InputArray weights1, InputArray weights2, OutputArray dst); //! @} imgproc_misc @@ -3839,7 +3849,7 @@ image with 4 or 8 way connectivity - returns N, the total number of labels [0, N represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently -Grana (BBDT) and Wu's (SAUF) algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes +Grana (BBDT) and Wu's (SAUF) @cite Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not. This function uses parallel version of both Grana and Wu's algorithms if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs. @@ -3871,16 +3881,16 @@ image with 4 or 8 way connectivity - returns N, the total number of labels [0, N represents the background label. ltype specifies the output label image type, an important consideration based on the total number of labels or alternatively the total number of pixels in the source image. ccltype specifies the connected components labeling algorithm to use, currently -Grana's (BBDT) and Wu's (SAUF) algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes +Grana's (BBDT) and Wu's (SAUF) @cite Wu2009 algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not. This function uses parallel version of both Grana and Wu's algorithms (statistics included) if at least one allowed parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs. @param image the 8-bit single-channel image to be labeled @param labels destination labeled image -@param stats statistics output for each label, including the background label, see below for -available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of -#ConnectedComponentsTypes. The data type is CV_32S. +@param stats statistics output for each label, including the background label. +Statistics are accessed via stats(label, COLUMN) where COLUMN is one of +#ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S. @param centroids centroid output for each label, including the background label. Centroids are accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F. @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively @@ -3894,9 +3904,9 @@ CV_EXPORTS_AS(connectedComponentsWithStatsWithAlgorithm) int connectedComponents /** @overload @param image the 8-bit single-channel image to be labeled @param labels destination labeled image -@param stats statistics output for each label, including the background label, see below for -available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of -#ConnectedComponentsTypes. The data type is CV_32S. +@param stats statistics output for each label, including the background label. +Statistics are accessed via stats(label, COLUMN) where COLUMN is one of +#ConnectedComponentsTypes, selecting the statistic. The data type is CV_32S. @param centroids centroid output for each label, including the background label. Centroids are accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F. @param connectivity 8 or 4 for 8-way or 4-way connectivity respectively @@ -4147,7 +4157,23 @@ without self-intersections. Otherwise, the function output is undefined. */ CV_EXPORTS_W bool isContourConvex( InputArray contour ); -//! finds intersection of two convex polygons +/** @example samples/cpp/intersectExample.cpp +Examples of how intersectConvexConvex works +*/ + +/** @brief Finds intersection of two convex polygons + +@param _p1 First polygon +@param _p2 Second polygon +@param _p12 Output polygon describing the intersecting area +@param handleNested When true, an intersection is found if one of the polygons is fully enclosed in the other. +When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge +of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested. + +@returns Absolute value of area of intersecting polygon + +@note intersectConvexConvex doesn't confirm that both polygons are convex and will return invalid results if they aren't. + */ CV_EXPORTS_W float intersectConvexConvex( InputArray _p1, InputArray _p2, OutputArray _p12, bool handleNested = true ); @@ -4323,11 +4349,11 @@ CV_EXPORTS_W int rotatedRectangleIntersection( const RotatedRect& rect1, const R /** @brief Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it. */ -CV_EXPORTS Ptr createGeneralizedHoughBallard(); +CV_EXPORTS_W Ptr createGeneralizedHoughBallard(); /** @brief Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it. */ -CV_EXPORTS Ptr createGeneralizedHoughGuil(); +CV_EXPORTS_W Ptr createGeneralizedHoughGuil(); //! @} imgproc_shape @@ -4356,7 +4382,9 @@ enum ColormapTypes COLORMAP_VIRIDIS = 16, //!< ![viridis](pics/colormaps/colorscale_viridis.jpg) COLORMAP_CIVIDIS = 17, //!< ![cividis](pics/colormaps/colorscale_cividis.jpg) COLORMAP_TWILIGHT = 18, //!< ![twilight](pics/colormaps/colorscale_twilight.jpg) - COLORMAP_TWILIGHT_SHIFTED = 19 //!< ![twilight shifted](pics/colormaps/colorscale_twilight_shifted.jpg) + COLORMAP_TWILIGHT_SHIFTED = 19, //!< ![twilight shifted](pics/colormaps/colorscale_twilight_shifted.jpg) + COLORMAP_TURBO = 20, //!< ![turbo](pics/colormaps/colorscale_turbo.jpg) + COLORMAP_DEEPGREEN = 21 //!< ![deepgreen](pics/colormaps/colorscale_deepgreen.jpg) }; /** @example samples/cpp/falsecolor.cpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/detail/distortion_model.hpp b/3rdparty/opencv/include/opencv2/imgproc/detail/distortion_model.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/detail/distortion_model.hpp rename to 3rdparty/opencv/include/opencv2/imgproc/detail/distortion_model.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/hal/hal.hpp b/3rdparty/opencv/include/opencv2/imgproc/hal/hal.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/hal/hal.hpp rename to 3rdparty/opencv/include/opencv2/imgproc/hal/hal.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/hal/interface.h b/3rdparty/opencv/include/opencv2/imgproc/hal/interface.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/hal/interface.h rename to 3rdparty/opencv/include/opencv2/imgproc/hal/interface.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/imgproc.hpp b/3rdparty/opencv/include/opencv2/imgproc/imgproc.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/imgproc.hpp rename to 3rdparty/opencv/include/opencv2/imgproc/imgproc.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/imgproc_c.h b/3rdparty/opencv/include/opencv2/imgproc/imgproc_c.h similarity index 99% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/imgproc_c.h rename to 3rdparty/opencv/include/opencv2/imgproc/imgproc_c.h index cec0f36..2fe85b6 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/imgproc_c.h +++ b/3rdparty/opencv/include/opencv2/imgproc/imgproc_c.h @@ -1184,7 +1184,7 @@ CVAPI(CvScalar) cvColorToScalar( double packed_color, int arrtype ); /** @brief Returns the polygon points which make up the given ellipse. The ellipse is define by the box of size 'axes' rotated 'angle' around the 'center'. A partial -sweep of the ellipse arc can be done by spcifying arc_start and arc_end to be something other than +sweep of the ellipse arc can be done by specifying arc_start and arc_end to be something other than 0 and 360, respectively. The input array 'pts' must be large enough to hold the result. The total number of points stored into 'pts' is returned by this function. @see cv::ellipse2Poly diff --git a/qt-correction-tool/pub/opencv/include/opencv2/imgproc/types_c.h b/3rdparty/opencv/include/opencv2/imgproc/types_c.h similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/imgproc/types_c.h rename to 3rdparty/opencv/include/opencv2/imgproc/types_c.h diff --git a/qt-correction-tool/pub/opencv/include/opencv2/opencv.hpp b/3rdparty/opencv/include/opencv2/opencv.hpp similarity index 100% rename from qt-correction-tool/pub/opencv/include/opencv2/opencv.hpp rename to 3rdparty/opencv/include/opencv2/opencv.hpp diff --git a/qt-correction-tool/pub/opencv/include/opencv2/opencv_modules.hpp b/3rdparty/opencv/include/opencv2/opencv_modules.hpp similarity index 56% rename from qt-correction-tool/pub/opencv/include/opencv2/opencv_modules.hpp rename to 3rdparty/opencv/include/opencv2/opencv_modules.hpp index e14f3ec..506f595 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/opencv_modules.hpp +++ b/3rdparty/opencv/include/opencv2/opencv_modules.hpp @@ -10,22 +10,10 @@ // For example, patented algorithms for non-profit/non-commercial use only. /* #undef OPENCV_ENABLE_NONFREE */ -#define HAVE_OPENCV_CALIB3D #define HAVE_OPENCV_CORE -#define HAVE_OPENCV_DNN -#define HAVE_OPENCV_FEATURES2D -#define HAVE_OPENCV_FLANN #define HAVE_OPENCV_HIGHGUI #define HAVE_OPENCV_IMGCODECS #define HAVE_OPENCV_IMGPROC -#define HAVE_OPENCV_ML -#define HAVE_OPENCV_OBJDETECT -#define HAVE_OPENCV_PHOTO -#define HAVE_OPENCV_SHAPE -#define HAVE_OPENCV_STITCHING -#define HAVE_OPENCV_SUPERRES -#define HAVE_OPENCV_VIDEO -#define HAVE_OPENCV_VIDEOIO -#define HAVE_OPENCV_VIDEOSTAB +#define HAVE_OPENCV_WORLD diff --git a/qt-correction-tool/pub/opencv/include/opencv2/ml/ml.hpp b/3rdparty/opencv/include/opencv2/world.hpp similarity index 86% rename from qt-correction-tool/pub/opencv/include/opencv2/ml/ml.hpp rename to 3rdparty/opencv/include/opencv2/world.hpp index f6f9cd8..4902c2f 100644 --- a/qt-correction-tool/pub/opencv/include/opencv2/ml/ml.hpp +++ b/3rdparty/opencv/include/opencv2/world.hpp @@ -7,12 +7,11 @@ // copy or use the software. // // -// License Agreement +// License Agreement // For Open Source Computer Vision Library // // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. +// Copyright (C) 2009-2010, Willow Garage Inc., all rights reserved. // Third party copyrights are property of their respective owners. // // Redistribution and use in source and binary forms, with or without modification, @@ -41,8 +40,19 @@ // //M*/ -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library +#ifndef OPENCV_WORLD_HPP +#define OPENCV_WORLD_HPP + +#include "opencv2/core.hpp" + +#ifdef __cplusplus +namespace cv +{ + +CV_EXPORTS_W bool initAll(); + +} + #endif -#include "opencv2/ml.hpp" +#endif diff --git a/Qt_Correction_tool.pro b/Qt_Correction_tool.pro new file mode 100644 index 0000000..21da3be --- /dev/null +++ b/Qt_Correction_tool.pro @@ -0,0 +1,6 @@ +TEMPLATE = subdirs + +SUBDIRS += \ + hgdev \ + imageprocess \ + tool_ui diff --git a/qt-correction-tool/BlockingQueue.h b/hgdev/BlockingQueue.h similarity index 64% rename from qt-correction-tool/BlockingQueue.h rename to hgdev/BlockingQueue.h index ff96f9d..0b4de85 100644 --- a/qt-correction-tool/BlockingQueue.h +++ b/hgdev/BlockingQueue.h @@ -1,25 +1,33 @@ -#pragma once +#ifndef BLOCKING_QUEUE_H +#define BLOCKING_QUEUE_H + +//#include +//#include #include #include #include #include #include +using namespace std; template class BlockingQueue { private: - BlockingQueue(const BlockingQueue &rhs); - BlockingQueue &operator=(const BlockingQueue &rhs); + BlockingQueue(const BlockingQueue& rhs); + BlockingQueue& operator =(const BlockingQueue& rhs); mutable std::mutex _mutex; std::condition_variable _condvar; - std::deque _queue; - bool isShutDown = false; + deque _queue; + bool isShutDown; T tRet; public: BlockingQueue() - : _mutex(), _condvar(), _queue() + : _mutex() + , _condvar() + , _queue() + , isShutDown(false) { } @@ -29,6 +37,13 @@ public: std::cout << "blocking queue release" << std::endl; } + void Clear() + { + lock_guard lock(_mutex); + _condvar.notify_all(); + _queue.clear(); + } + void ShutDown() { isShutDown = true; @@ -43,7 +58,7 @@ public: void Put(const T task) { - std::lock_guard lock(_mutex); + lock_guard lock(_mutex); if (!isShutDown) { { @@ -51,11 +66,12 @@ public: } _condvar.notify_all(); } + } T Take() { - std::unique_lock lock(_mutex); + unique_lock lock(_mutex); if (_queue.size() <= 0) _condvar.wait(lock); @@ -72,7 +88,7 @@ public: T Front() { - std::unique_lock lock(_mutex); + unique_lock lock(_mutex); if (_queue.size() <= 0) _condvar.wait(lock); @@ -87,18 +103,9 @@ public: size_t Size() const { - std::lock_guard lock(_mutex); + lock_guard lock(_mutex); return _queue.size(); } +}; - void Clear() - { - std::unique_lock lock(_mutex); - if (_queue.size() <= 0) - return; - if (_queue.size()>0) - { - _queue.clear(); - } - } -}; \ No newline at end of file +#endif diff --git a/hgdev/G400ScanConfig.cpp b/hgdev/G400ScanConfig.cpp new file mode 100644 index 0000000..6b55389 --- /dev/null +++ b/hgdev/G400ScanConfig.cpp @@ -0,0 +1,42 @@ +#pragma once +#include "G400ScanConfig.h" + +G400ScanConfig::G400ScanConfig(GScanCap& gcap,ScannerSerial serial) +{ + cfg.params.doubleFeeded = gcap.hardwareParam.doubleFeedDetection; + LOG("cfg.params.doubleFeeded = %s \n",cfg.params.doubleFeeded?"true":"false"); + cfg.params.dpi = 1;//gcap.resolution_dst <= 200.0f ? G400_DPI::G400_D200 : (gcap.resolution_dst <= 300.0f ? G400_DPI::G400_D300 : G400_DPI::G400_D600); + LOG("cfg.params.dpi = %s \n",cfg.params.dpi==1?"200":(cfg.params.dpi==0?"300":"600")); + cfg.params.enableLed = 1; + if (gcap.imageProcess.filter != 3) + cfg.params.isColor = 1; + else + cfg.params.isColor = SupPixelTypes[gcap.pixelType]; + cfg.params.enableStable = 0;//gcap.hardwarecaps.en_stapledetect==0?0:1; + cfg.params.isCorrect = 1;//1 ����У�� + hgsize size; + PaperStatus ps = { (uint32_t)gcap.paperSize,gcap.paperAlign }; + if(serial == ScannerSerial::G300Serial){ + cfg.params.pageSize = SupPaperTyps_G300[ps]; + size = PaperSize.GetPaperSize(TwSS::A4, 200.0f, gcap.paperAlign,serial);//G300 ���֧��A4���� + } + else + { + cfg.params.pageSize = SupPaperTyps_G400[ps]; + size = PaperSize.GetPaperSize(gcap.paperSize, 200.0f, gcap.paperAlign,serial); + } + + LOG("cfg.params.pageSize =%d \n",cfg.params.pageSize); + cfg.params.dstHeight = (int)((size.cy+200)/100); + cfg.params.reversed1 = cfg.params.reversed2 = 0; + cfg.params.isCorrect = gcap.is_correct; +} + +G400ScanConfig::~G400ScanConfig() +{ +} + +unsigned int G400ScanConfig::GetData() +{ + return cfg.value; +} diff --git a/hgdev/G400ScanConfig.h b/hgdev/G400ScanConfig.h new file mode 100644 index 0000000..2dfc36b --- /dev/null +++ b/hgdev/G400ScanConfig.h @@ -0,0 +1,37 @@ +#ifndef G400_SCAN_CONFIG_H +#define G400_SCAN_CONFIG_H + +#include "predefine.h" +#include "IConfig.h" +#include "PaperSize.h" + +class G400ScanConfig : + public IConfig +{ +public: + union Configuration + { + struct + { + unsigned int pageSize : 5; + unsigned int isColor : 1; + unsigned int dpi : 2; + unsigned int doubleFeeded : 1; + unsigned int enableStable : 1; + unsigned int enableLed : 1; + unsigned int reversed1 : 6; + unsigned int isCorrect : 1; + unsigned int dstHeight : 8; + unsigned int reversed2 : 6; + }params; + unsigned int value; + }; + G400ScanConfig(GScanCap& gcap,ScannerSerial serial); + virtual ~G400ScanConfig(); + virtual unsigned int GetData() override; +private: + Configuration cfg; + Device::PaperSize PaperSize; +}; + +#endif diff --git a/hgdev/GScan.cpp b/hgdev/GScan.cpp new file mode 100644 index 0000000..7a99a2e --- /dev/null +++ b/hgdev/GScan.cpp @@ -0,0 +1,32 @@ +#include "GScan.h" +#include +#include +//#include "jpeglib.h" +#include "ImageApplyHeaders.h" +#include "ImageMatQueue.h" + +using namespace std; + +IGScan::IGScan() + :pixType(0) + , m_pImages(new ImageMatQueue(m_serial)) +{ + devState = DEV_STOP; + Error_Code = 0; +} + + +void DoEvents() +{ + #ifdef WIN32 +// MSG msg; +// if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { +// DispatchMessage(&msg); +// TranslateMessage(&msg); +// } + #endif +} + + + + diff --git a/hgdev/GScan.h b/hgdev/GScan.h new file mode 100644 index 0000000..84a3969 --- /dev/null +++ b/hgdev/GScan.h @@ -0,0 +1,295 @@ +#ifndef G_SCAN_H +#define G_SCAN_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "opencv2/opencv.hpp" +#ifdef WIN32 +#include +#include +#endif +#include +#include +#include "callbackdefines.h" + +//add 2020.03.12---------------------------- +//#if !defined(GDEV_LIBRARY_BUILD) +// #if defined (_WIN32) +// #define GDEV_LIBRARY_API __declspec(dllexport) +// #else +// #define GDEV_LIBRARY_API +// #endif // _WIN32 +//#else +// #if defined (_WIN32) +// #define GDEV_LIBRARY_API __declspec(dllimport) +// #else + #define GDEV_LIBRARY_API +// #endif // _WIN32 +//#endif // GDEV_LIBRARY +//==================================================== +#ifndef unix +typedef int BOOL; +typedef unsigned short UINT16; +typedef unsigned int UINT32; +#endif + +typedef struct tag_USBCB { + unsigned int u32_CMD; + unsigned int u32_Data; + unsigned int u32_Count; +}USBCB, * PUSBCB; + +enum tagUsbKeyWords :unsigned int +{ + NO_COMMAND = 0, + //ȡdsp ״̬ + GET_DSP_STATUS = 1, + //ȡͼ + GET_IMAGE = 2, + //DSPפͼ + POP_IMAGE = 3, + //ʼɨ + START_COMMAND = 4, + //ֹͣɨ + STOP = 5, + //ȡɨɨģʽ + GET_SCAN_MODE = 6, + //ȡ̼汾 + GET_FW_VERSION = 7, + //PC˵״̬ + SEND_STATUS_PC = 8, + //·ɨò + CONFIGURED_DATA = 9, + //·̼Ϣ + SEND_FW = 10, + //ȡɨ + GET_CONFIG_DATA = 11, + //ȡɨ + GET_SCANN_NUM = 12, + //ȡֽ״̬ + GET_PAPERFEEDER_STATUS = 13, + //DSPʼ + INIT_HARDWARE_SYS = 14, + //·ԪòҶȣLED Rعʱ䣩 + SEND_COMPONENTS_GR = 15, + //·ԪòLED G/Bعʱ䣩 + SEND_COMPONENTS_GB = 16, + //·ɨģʽ + SEND_SCAN_MODE = 17, + //ʼƽ + START_FLAT = 18, + //ֹͣƽ + STOP_FLAT = 19, + //·200dpiɫƽ + SEND_200_COLOR_FLAT_DATA = 20, + //·300dpiɫƽ + SEND_300_COLOR_FLAT_DATA = 21, + //ȡ200dpiɫƽ + GET_200_COLOR_FLAT_DATA = 22, + //ȡ300dpiɫƽ + GET_300_COLOR_FLAT_DATA = 23, + //·200dpiҶƽУ + SEND_200_GRAY_FLAT_DATA = 24, + //·300dpiҶƽУ + SEND_300_GRAY_FLAT_DATA = 25, + //ȡ200DPIҶƽУ + GET_200_GRAY_FLAT_DATA = 26, + //ȡ300DPIҶƽУ + GET_300_GRAY_FLAT_DATA = 27, + //·к + SEND_SERIAL = 28, + //ȡк + GET_SERIAL = 29, + //ȡ + GET_ROLLER_NUM = 0x1e, + // + CLR_ROLLER_NUM = 0x1f, + //ɨ + CLR_SCAN_NUM = 0x20, + //׼¹̼ + PRE_UPGRADE = 0X21, + //ʼ¹̼ + START_UPGRADE = 0x22, + //ɫAD + RGB_ADI_PARA = 0x23, + //ҶȵAD + ADI_PARA = 0x24, + //ȡCISعʱ䣬ad) + GET_CIS_PARA = 0x25, + //ɨ + START_COMMAND_COUNT = 0x26, + //·ʱ + SET_SLEEP_TIME = 0x27, + //ȡʱ + GET_SLEEP_TIME = 0x28, + // + CLR_CACHE = 0x29, + //·ٶģʽ + SET_SPEED_MODE = 0x2a, + //ȡɨٶģʽ + GET_SPEED_MODE = 0X2b, + //ù̼汾һ8ֽ + SET_FW_VERSION = 0X2c, + //ȡDSP汾 + GET_DSP_VERSION = 0X2d, + //ɼFPGA̼汾 + GET_SCANFPGA_VERSION = 0x2e, + //FPGA̼汾 + GET_MOTORFPGA_VERSION = 0X2f, + //Ϣ + SET_USB_INFOR_MANUFACTURE = 0X30, + //ȡϢ + GET_USB_INFOR_MANUFACTURE = 0X31, + //òƷͺϢ + SET_USB_INFOR_MODEL_NAME = 0X32, + //ȡƷͺϢ + GET_USB_INFOR_MODEL_NAME = 0X33, + //USB PID / VIDϢ + SET_USB_INFOR_VIDPID = 0X34, + GET_USB_INFOR_VIDPID = 0X35, + //ÿֽͣ + SET_JAM_DETECT_SENSITIVE = 0X36, + //ȡֽͣ + GET_JAM_DETECT_SENSITIVE = 0X37, + //úϵ + SET_JUST_COF_H = 0x38, + //ȡϵ + GET_JUST_COF_H = 0x39, + //G400 Ӳ쳣 + CLEAR_HWERROR = 0x40, + //ϵ + SET_JUST_COF_V = 0x41, + //ȡϵ + GET_JUST_COF_V = 0x42, + //òɫУ + SEND_COLOR_FLAT = 0x43, + //òɫƽУ + SEND_COLORCORRECT_FLAT = 0x44, + //ûҶУ + SEND_GRAY_FLAT = 0x45, + //ûҶƽУ + SEND_GRAYCORRECT_FLAT = 0x46, + //ƽУ + GET_FLAT_DATA = 0x47, + // + UPDATE_FINISHED = 0x48, + // + REBOOT = 0x49, + GET_LOG_FILES_INFO = 0x50, + //logļ + GET_UPDATE_RESULT = 0x51, + //־ + CLEAR_LOG_FILES = 0x52, + //ȡֽʧ + GET_CUO_ERROR, + //ȡ˫ʧܴ + GET_DOU_ERROR, + //ȡֽ + GET_JAM_ERROR, + GET_UV_EXPOSA = 0x100, + GET_UV_EXPOSB = 0x101, + SET_UV_EXPOSA = 0x102, + SET_UV_EXPOSB = 0x103 +}; + +typedef enum tagUsbKeyWords UsbKeyWords, * PUsbKeyWords; +class CImageApply; +class IUsb; +class ImageMatQueue; + +class IGScan +{ +public: + IGScan(); + virtual ~IGScan(){} + //virtual std::vector findallusb() = 0; + virtual void open(int vid, int pid) = 0; + virtual bool close() = 0;//add 2020.3.11 + virtual bool is_open() = 0;//add 2020.3.11 + virtual void setusbreport_callback(usbreport_callback callback=0,void* usrdata=0)=0; + virtual void setonimage_callback(onimagecallback aqrcallback=0)=0; + virtual int get_image_front_info(ImageInfo* info) = 0; + virtual int aquire_image(cv::Mat& mat, int& bppinfo) = 0; + virtual int aquire_image(std::vector& imgdata,int & bppinfo,int & width,int & height)=0; + virtual BOOL IsConnected() = 0; + virtual std::string GetFWVersion() = 0; + virtual std::string GetSerialNum() = 0; + virtual void SetSerialNum(std::string serial) = 0; + virtual bool is_scan() = 0; + virtual BOOL Get_Scanner_PaperOn() = 0; + virtual void config_params(GScanCap& params) = 0; + virtual void Scanner_StartScan(int count) = 0; + virtual void Stop_scan() = 0; + virtual void ResetScanner() =0; + virtual bool Get_IsImageQueueEmpty() = 0; + virtual void reset() = 0; + + virtual void setdecodepixtype(int twpixtype)= 0; + virtual UINT32 get_ErrorCode() = 0; + virtual void Set_ErrorCode(UINT32 value) = 0; + virtual int get_scanned_num() = 0; + + virtual int get_roller_num() = 0; + virtual void clr_roller_num() = 0; + virtual int get_sleep_time() = 0; + virtual void set_sleep_time(int time) =0; + virtual BOOL clr_hardware_cache() = 0; + + virtual std::string GetMbVersion() = 0; + virtual std::string GetIpAddr() = 0; + virtual std::string GetKernelVersion() =0; + virtual void SetRatio(int tyepe, int ration) = 0; + virtual void GetRatio(int type, int& ratio) = 0; + virtual void Reboot() = 0; + virtual void PowerOff() = 0; + virtual void SendFlatData(CorrectParam param, int index) = 0; + virtual CaptureParams GetFlatData() = 0; + virtual void StartFlat(bool iscolor) = 0; + virtual void GetExpose(int& Aside, int& Bside) = 0; + virtual void SetExpose(int aside, int bside) = 0; + virtual void GetSptime(int type, int& time) = 0; + virtual void SetSptime(int type, int time) = 0; + virtual void GetSleepTime(int& sleeptime) = 0; + virtual void SetSleepTime(int sleeptime) = 0; + + virtual void GetFlatMaxBright(bool iscolor, unsigned int& val) = 0; + virtual void SetFlatMaxBright(bool iscolor, unsigned int val) = 0; + virtual bool Updata(std::string filename, std::function func) = 0; + virtual void SetFlatCallback(std::function func){m_flatcallback = func;} + virtual void GetSpeedMode(int& speedmode,bool get) = 0 ; + virtual void GetOrSetVIDPID(int& value, bool get) = 0; + virtual std::string GetSysInfo() = 0; + virtual void setserial(ScannerSerial serial)=0; + + + ScannerSerial getserial() { return m_serial;} +protected: + volatile UINT32 Error_Code; + volatile int devState; + std::shared_ptr m_pImages; + std::mutex m_Locker; + std::mutex m_imgLocker; + std::string fwVersion; + std::string SerialNum; + ScannerSerial m_serial; + std::function m_flatcallback; + int pixType; + volatile bool is_flat; +}; + +void DoEvents(); + +enum tagDevState +{ + DEV_STOP = -1, + DEV_RUNNING, + DEV_WRONG +}; + +#endif diff --git a/hgdev/GScanO1003399.cpp b/hgdev/GScanO1003399.cpp new file mode 100644 index 0000000..b8371cd --- /dev/null +++ b/hgdev/GScanO1003399.cpp @@ -0,0 +1,1295 @@ +#include "GScanO1003399.h" +#include "ImageMultiOutput.h" +#include "UsbScanEx.h" +#include "IMulti.h" +#ifdef __linux__ +#include +#include +#endif // __linux__ + + + +static std::mutex mx_ctrl; + +static int scanner_read_reg(std::shared_ptr& usb, int addr) +{ + std::lock_guard lck(mx_ctrl); + if (usb.get() && usb->is_connected()) { + int val = 0; + usb->control_msg(0xc0, USB_REQ_GET_DEV_REGS, addr, 0, 4, &val); + return val; + } + return 0; +} + +static void scanner_write_reg(std::shared_ptr& usb, int addr, int val) +{ + std::lock_guard lck(mx_ctrl); + if (usb.get() && usb->is_connected()) + { + usb->control_msg(0x40, USB_REQ_SET_DEV_REGS, addr, 0, 4, &val); + } +} + +static void scanner_cmd(std::shared_ptr& usb, int cmd) +{ + scanner_write_reg(usb, 0, cmd); +} + + + +GScanO1003399::GScanO1003399() :m_usbreport(0), m_usrdata(0) +{ + m_serial = ScannerSerial::G20039Serial; + im_data.reset(new std::vector()); + //open(0x3072, 0x139); + if (!m_usbthread.get()) { + b_usbthread = true; + m_usbthread.reset(new thread(&GScanO1003399::usb_run, this)); + } + devState = DEV_STOP; + +} + +GScanO1003399::~GScanO1003399() +{ + imagecount = 0; + if (m_usbthread.get() && m_usbthread->joinable()) + { + b_usbthread = false; + m_usbthread->join(); + m_usbthread.reset(); + } + + m_usb.reset(); + scanflag = false; + b_imgprothread = false; + imgs.ShutDown(); + + while (m_paths.Size() > 0) + { + remove(m_paths.Take().c_str()); + } + m_paths.ShutDown(); + + if (m_imgprocthread.get() && m_imgprocthread->joinable()) + { + m_imgprocthread->join(); + } +} + +void GScanO1003399::open(int vid, int pid) +{ +#ifdef WIN32 + auto usbold = UsbScan_List::find_vid_pid(0x064b, 0x7823); + + if (usbold.empty()) { + auto usbs = UsbScan_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + m_usb = *usbs.begin(); + m_usb->set_usbcallback(&GScanO1003399::on_usbcallback, this); + auto ret = m_usb->open(); + if ((pid & 0x39) && m_usb->is_open()) + { + set_sleep_time(-1); + } + } + } + else + { + m_usb = *usbold.begin(); + m_usb->set_usbcallback(&GScanO1003399::on_usbcallback, this); + auto ret = m_usb->open(); + } + +#else // WIN32 + auto usbs = Libusb_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + if (!m_usb.get()) + { + m_usb = *usbs.begin(); + auto ret = m_usb->open(); + if (!ret) + LOG("GScanO200 open usb failed\n"); + m_usb->set_usbcallback(&GScanO1003399::on_usbcallback, this); + } + } +#endif +} + +bool GScanO1003399::close() { + if (m_usb.get() && m_usb->is_open()) + m_usb->close(); + return true; +} + + +void GScanO1003399::on_usbcallback(int conditioncode, void* usrdata) +{ + GScanO1003399* This = (GScanO1003399*)usrdata; + This->onusbcallback(conditioncode); +} + +void GScanO1003399::setusbreport_callback(usbreport_callback callback, void* usrdata) +{ + m_usbreport = callback; + m_usrdata = usrdata; +} + +void GScanO1003399::setonimage_callback(onimagecallback aqrcallback) +{ + if (aqrcallback) + m_imagecallback = aqrcallback; + else + LOG("error on setonimage_callback ptr=%p \n", aqrcallback); +} + +void GScanO1003399::onusbcallback(int conditioncode) +{ + std::cout << "GScanO1003399::onusbcallback " << conditioncode << std::endl; + if (conditioncode != 0) + { + Error_Code = DEVICE_OFF_LINE; + devState = DEV_WRONG; + } + if (m_usbreport && m_usrdata) + { + m_usbreport(conditioncode, m_usrdata); + } +} + +void GScanO1003399::aquirethreadfunc() +{ + b_threadimg = true; + while (b_threadimg) + { + if (m_imagedata.Size() < 1) { + if ((imagecount == 0) && (!scanflag)) + { + this_thread::sleep_for(chrono::milliseconds(1)); + if (!scanflag) + { + if (devState == DEV_WRONG) { + if (m_imagecallback) + m_imagecallback(nullptr, 0, get_ErrorCode()); + } + else + { + if (m_imagecallback) + m_imagecallback(nullptr, 0, -1); + } + break; + } + } + } + else + { + if ((m_imagedata.Size() > 0)) + { + auto ret = m_imagedata.Take(); + cv::Mat mat = ret.mat.clone(); + imagecount--; + if (m_imagecallback) + m_imagecallback(&mat, ret.Bpp, 0); + } + this_thread::sleep_for(chrono::milliseconds(2)); + } + this_thread::sleep_for(chrono::milliseconds(10)); + } +} + +int GScanO1003399::get_image_front_info(ImageInfo* info) { + return -1; +} + +int GScanO1003399::aquire_image(std::vector &imgdata, int &bppinfo, int &width, int &height) +{ + cv::Mat tmp; + int ret= aquire_image(tmp,bppinfo); + if(tmp.empty()) + return ret; + width = tmp.cols; + height = tmp.rows; + if(tmp.channels()==3) + cv::cvtColor(tmp,tmp,cv::COLOR_BGR2RGB); + imgdata = tmp.reshape(1,tmp.cols*tmp.rows*tmp.channels()); + return ret; +} + +int GScanO1003399::aquire_image(cv::Mat& mat, int& bppinfo) +{ + StopWatch sw; + while (true) + { + if ((imagecount == 0) && (!scanflag) || (sw.elapsed_s() > 30)) + { + if (is_scan()) + { + sw.reset(); + continue; + } + DoEvents(); + this_thread::sleep_for(chrono::milliseconds(1)); + if (sw.elapsed_s() > 30.0) + { + devState = DEV_STOP; + Stop_scan(); + ResetScanner(); + return AQUIRE_IMAGE_TIMEOUT; + } + if (!scanflag) + { + if (devState == DEV_WRONG) + return get_ErrorCode(); + return -1; + } + } + else + { + if ((m_imagedata.Size() > 0)) + { + auto ret = m_imagedata.Take(); + mat = ret.mat.clone(); + bppinfo = ret.Bpp; + imagecount--; + sw.reset(); + return 0; + } + DoEvents(); + this_thread::sleep_for(chrono::milliseconds(2)); + } + + } + +} + +BOOL GScanO1003399::IsConnected() +{ + return m_usb.get() && m_usb->is_connected(); +} + +bool GScanO1003399::is_open() { + return m_usb.get() && m_usb->is_open(); +} + +std::string GScanO1003399::GetFWVersion() +{ + std::string fw; + if (m_usb.get() && m_usb->is_connected()) + { + scanner_write_reg(m_usb, SR_GET_FWVERSION, 0); + fw.resize(10); + read_data(&fw[0], fw.length(), 200); + } + return fw; +} + +std::string GScanO1003399::GetSerialNum() +{ + std::string sn; + if (m_usb.get() && m_usb->is_connected()) + { + scanner_write_reg(m_usb, SR_GET_SERIALNUM, 0); + sn.resize(14); + read_data(&sn[0], sn.length(), 200); + } + return sn; +} +int GScanO1003399::get_roller_num() { + return scanner_read_reg(m_usb, SR_GET_ROLLER_NUM); +} +void GScanO1003399::clr_roller_num() { + scanner_read_reg(m_usb, SR_CLR_ROLLER_NUM); +} + +int GScanO1003399::get_sleep_time() { + return scanner_read_reg(m_usb, SR_GET_SLEEPTIME); +} + +BOOL GScanO1003399::clr_hardware_cache() { + return true; +} +void GScanO1003399::setdecodepixtype(int twpixtype) { + +} + +int GScanO1003399::get_scanned_num() +{ + return scanner_read_reg(m_usb, SR_GET_SCANN_NUM); +} +bool GScanO1003399::is_scan() +{ + //return devState==DEV_ISRUNNING; + return is_runing() || (m_imagedata.Size() > 0); +} + +BOOL GScanO1003399::Get_Scanner_PaperOn() +{ + //return scanner_read_reg(m_usb, SR_GET_PAPERON); + return true; +} + +void GScanO1003399::config_params(GScanCap& param) +{ + m_param = param; + HGScanConfig cfg; + cfg = { 0 }; + + PaperStatus ps = { (uint)param.paperSize,param.paperAlign }; + cfg.g200params.paper = SupPaperTyps_G100.count(ps) > 0 ? SupPaperTyps_G100[ps] : 0; + //if (param.imageProcess.filter != 3 || param.imageProcess.answerSheetFilterRed) + cfg.g200params.color = 1;//color + // else + // { + // cfg.g200params.color = SupPixelTypes.count(param.pixelType) > 0 ? SupPixelTypes[param.pixelType] : 2; + + // } + cfg.g200params.dpi = SupResolutions.count(param.resolution_native) > 0 ? SupResolutions[param.resolution_native] : 1; + cfg.g200params.double_feed_enbale = (unsigned int)param.hardwareParam.doubleFeedDetection; + cfg.g200params.stable_enbale = (unsigned int)param.hardwareParam.bindingDetection; + //cfg.g200params.stable_enbale = (unsigned int)param.hardwareParam.bindingDetection; + cfg.g200params.screw_detect_enable = (unsigned int)param.hardwareParam.skewDetection.enable; + cfg.g200params.screw_detect_level = (unsigned int)cfg.g200params.screw_detect_enable ? secrewMaps[param.hardwareParam.skewDetection.level] : 0; + + cfg.g200params.enable_sizecheck = param.hardwareParam.sizeDetection == 1 ? 1 : 0; + cfg.g200params.unused_one = cfg.g200params.sizeerror_errorratio = 0; + cfg.g200params.pc_correct = param.is_correct; + config_scanparam(cfg); + config_imgprocparam({ sizeof(GScanCap_3399) }); + GScanCap_3399 param39{ 0 }; + param39.AutoCrop_threshold = param.imageProcess.AutoCrop_threshold; + param39.autodescrew = param.imageProcess.autoDescrew; + param39.automaticcolor = false; + param39.automaticcolortype = 1; + param39.brightness = 0;//param.imageProcess.brightness; + param39.contrast = 0;//param.imageProcess.contrast; + param39.detachnoise.is_detachnoise = param.imageProcess.NosieDetachEnable; + param39.detachnoise.detachnoise = param.imageProcess.nosieDetach; + param39.discardblank_percent = param.imageProcess.discardblank_percent; + param39.en_fold = param.scanSide.fold; + param39.en_sizecheck = false; + param39.fillbackground = param.imageProcess.fillBlackRect; + param39.fillhole = param.imageProcess.fillHole; + param39.filter = param.imageProcess.filter; + if(param.pixelType==0||param.pixelType == 1) + { + param39.enhance_color =1; + } + else + param39.enhance_color =0; + param39.gamma = 1.0;//param.imageProcess.gamma; + param39.hardwarecaps.en_skrewdetect = param.hardwareParam.skewDetection.enable; + param39.hardwarecaps.skrewdetectlevel = param.hardwareParam.skewDetection.level; + param39.hardwarecaps.capturepixtype = param.hardwareParam.capturepixtype; + param39.hardwarecaps.en_stapledetect=1; + //param39.hardwarecaps.en_stapledetect = param.hardwareParam.bindingDetection; + param39.hardwarecaps.en_doublefeed = param.hardwareParam.doubleFeedDetection; + param39.hsvcorrect = param.imageProcess.answerSheetFilterRed; + param39.imageRotateDegree = param.imageProcess.orentation * 90.0f; + param39.indent = 12; + param39.is_autocrop = param.imageProcess.autoCrop; + param39.is_autodiscradblank_normal = param.scanSide.discardBlank; + param39.is_autodiscradblank_vince = param.scanSide.discardBlankVince; + param39.is_autotext = 0; + param39.is_backrotate180 = param.imageProcess.backRotate180; + param39.is_convex = param.imageProcess.is_convex; + param39.is_dogeardetection = 0; + param39.is_duplex = param.scanSide.duplex; + param39.is_switchfrontback = param.scanSide.switchFrontBack; + param39.multi_output_red = param.imageProcess.multiOutFilterRed; + param39.noise = 8; + param39.paperAlign = param.paperAlign; + param39.papertype = param.paperSize; + param39.pixtype = param.pixelType; + param39.resolution_dst = param.resolution; + param39.resolution_native = param.resolution_native; + param39.scannum = (param.scanCount >= 65536 || param.scanCount < 0) ? -1 : (param.scanSide.duplex ? param.scanCount * 2 : param.scanCount); + param39.sharpen = (int)param.imageProcess.sharpenType; + param39.threshold = 40; + param39.isfillcolor = false; + param39.refuseInflow = false; + param39.colorCorrection = param.imageProcess.colorCorrection; + param39.removeMorr = 0; + param39.errorExtention = param.imageProcess.errorExtention; + param39.textureRemove =0; + param39.splitImage = param.imageProcess.splitImage; + param39.cropRect = param.cropRect; + param39.multiOutput = param.multiOutput; + param39.is_dogeardetection = false; + param39.normalCrop = false; + m_usb->write_bulk(¶m39, sizeof(param39)); + printf(" \nparam39.papertype=%d", param39.papertype); + printf(" \nparam39.AutoCrop_threshold=%d", param39.AutoCrop_threshold); + printf(" \nparam39.autodescrew=%d", param39.autodescrew); + printf(" \nparam39.automaticcolor=%d", param39.automaticcolor); + printf(" \nparam39.brightness=%f", param39.brightness); + printf(" \nparam39.contrast=%f", param39.contrast); + printf(" \nparam39.en_fold=%d", param39.en_fold); + printf(" \nparam39.en_sizecheck=%d", param39.en_sizecheck); + printf(" \nparam39.enhance_color=%d", param39.enhance_color); + printf(" \nparam39.fillbackground=%d", param39.fillbackground); + printf(" \nparam39.filter=%d", param39.filter); + printf(" \nparam39.gamma=%f", param39.gamma); + printf(" \nparam39.hardwarecaps.capturepixtype=%d", param39.hardwarecaps.capturepixtype); + printf(" \nparam39.hardwarecaps.en_doublefeed=%d", param39.hardwarecaps.en_doublefeed); + printf(" \nparam39.hsvcorrect=%d", param39.hsvcorrect); + printf(" \nparam39.imageRotateDegree=%f", param39.imageRotateDegree); + printf(" \nparam39.indent=%d",5); + printf(" \nparam39.is_autocontrast=%d", param39.is_autocontrast); + printf(" \nparam39.is_autocrop=%d", param39.is_autocrop); + printf(" \nparam39.is_autodiscradblank_normal=%d", param39.is_autodiscradblank_normal); + printf(" \nparam39.is_autodiscradblank_vince=%d", param39.is_autodiscradblank_vince); + printf(" \nparam39.is_autotext=%d", param39.is_autotext); + printf(" \nparam39.is_backrotate180=%d", param39.is_backrotate180); + printf(" \nparam39.is_convex=%d", param39.is_convex); + printf(" \nparam39.is_duplex=%d", param39.is_duplex); + printf(" \nparam39.is_switchfrontback=%d", param39.is_switchfrontback); + printf(" \nparam39.is_dogeardetection=%d", param39.is_dogeardetection); + printf(" \nparam39.fillhole.multi_output_red=%d", param39.multi_output_red); + printf(" \nparam39.noise=%d", 8); + printf(" \nparam39.hardwarecaps.pixtype=%d", param39.pixtype); + printf(" \nparam39.resolution_dst=%f", param39.resolution_dst); + printf(" \nparam39.resolution_native=%f", param39.resolution_native); + printf(" \nparam39.scannum=%d", param39.scannum); + printf(" \nparam39.sharpen=%d", param39.sharpen); + printf(" \nparam39.discardblank_percent=%d", param39.discardblank_percent); + printf(" \nparam39..detachnoise.is_detachnoise=%d", param39.detachnoise.is_detachnoise); + printf(" \nparam39..detachnoise.detachnoise=%d", param39.detachnoise.detachnoise); +} + +void GScanO1003399::Scanner_StartScan(int count) +{ + scanflag = true; + is_flat=false; + while (m_paths.Size() > 0) + { + remove(m_paths.Take().c_str()); + } + Set_ErrorCode(0); + imagecount = 0; + keeplastimg = true; + reset(); + devState = DEV_RUNNING; + if (scanner_read_reg(m_usb, SR_GET_SLEEP_STAUTUS) != 1) + { + devState = DEV_WRONG; + Set_ErrorCode(SLEEPING); + scanflag = false; + if (m_imagecallback) + m_imagecallback(nullptr, 0, get_ErrorCode()); + return; + } + if (scan_mode()) + { + devState = DEV_WRONG; + Set_ErrorCode(COUNT_MODE); + scanflag = false; + if (m_imagecallback) + { + m_imagecallback(nullptr, 0, get_ErrorCode()); + } + + return; + } + + start(); + bool procmode = (m_param.resolution > 200.0f || m_param.paperSize == 52 || m_param.paperSize == 54 || m_param.paperSize == 131); + if (m_imgprocthread.get() && m_imgprocthread->joinable()) + { + b_imgprothread = false; + m_imgprocthread->join(); + } + + m_imgprocthread.reset(new thread(&GScanO1003399::proc, this, procmode)); +// if (m_threadgetimg.get() && m_threadgetimg->joinable()) +// { +// b_threadimg = false; +// m_threadgetimg->join(); +// } +// m_threadgetimg.reset(new thread(&GScanO1003399::aquirethreadfunc, this)); +} + +void GScanO1003399::Stop_scan() +{ + stop(); + if ((devState == DEV_WRONG) || (devState == DEV_STOP)) + return; + devState = DEV_STOP; +} + +int GScanO1003399::notifyscan() +{ + return !scanner_read_reg(m_usb, SR_GET_SLEEP_STAUTUS); +} + +void GScanO1003399::ResetScanner() +{ + +} + +bool GScanO1003399::Get_IsImageQueueEmpty() +{ + return m_imagedata.Size() < 1; +} + +void GScanO1003399::reset() +{ + devState = DEV_STOP; + m_imagedata.Clear(); +} + +UINT32 GScanO1003399::get_ErrorCode() +{ + return Error_Code; +} + +void GScanO1003399::Set_ErrorCode(UINT32 value) +{ + Error_Code = value; +} + +void GScanO1003399::set_sleep_time(int mode) +{ + scanner_write_reg(m_usb, SR_SET_SLEEPTIME, mode); +} + +void GScanO1003399::usb_run() +{ + unsigned char buff[64]; + while (b_usbthread) + { + if (!m_usb.get() || !m_usb->is_connected()) + { + this_thread::sleep_for(chrono::milliseconds(20)); + continue; + } + memset(buff, 0, sizeof(buff)); + auto length = m_usb->read_int(buff, sizeof(buff)); + if (((length) == sizeof(buff)))//|| im_dev_count() + { + HGEIntInfo info = *(HGEIntInfo*)&buff; + switch (info.From) + { + case IMG: + if (is_runing()) + im_rx(); + break; + case AutoCorrect: + if (info.Img_Index != 0) + { + std::string s_info; + s_info.resize(info.Img_Index); + m_usb->read_bulk(&s_info[0], s_info.length()); + //FileTools::write_log("D:\\info.txt", s_info); + if (m_flatcallback) + m_flatcallback(s_info,false); + } + if (info.Code == 4)//flat done + { + if(m_flatcallback) + m_flatcallback("У",true); + } + break; + default: + break; + } + if (codeconvter(info) > 0) + { + Set_ErrorCode(codeconvter(info)); + } + if ((codeconvter(info) == -1)) + { + while (!scanner_read_reg(m_usb, SR_GET_IMAGEPROCESSDONE)) + this_thread::sleep_for(chrono::microseconds(30)); + if (scanner_read_reg(m_usb, SR_GET_KEEP_LAST_PAPER)) + { + this_thread::sleep_for(chrono::milliseconds(100)); + while (im_dev_count() > (m_param.scanSide.duplex ? 2 : 1)) + im_rx(); + if (m_param.scanSide.duplex) + pop_dev_im(); + pop_dev_im(); + } + else + { + keeplastimg = false; + while (im_dev_count()) + im_rx(); + } + scanflag = false; + + if ((devState != DEV_WRONG) && (get_ErrorCode() <= 0)) + devState = DEV_STOP; + else if ((devState != DEV_WRONG) && (get_ErrorCode() > 0)) + devState = DEV_WRONG; + } + + + this_thread::sleep_for(chrono::microseconds(10)); + } + + } +} + +void GScanO1003399::start() +{ + scanner_cmd(m_usb, SC_START); +} + +void GScanO1003399::stop() +{ + scanner_cmd(m_usb, SC_STOP); +} + +bool GScanO1003399::is_runing() +{ + int val = scanner_read_reg(m_usb, SR_STATUS) & 0x3; + return (val > 0) && (val < 4); +} + +int GScanO1003399::scan_mode() +{ + return scanner_read_reg(m_usb, SR_OS) & 0x01; +} + +int GScanO1003399::count() +{ + return scanner_read_reg(m_usb, SR_GET_ROLLER_NUM); +} + +void GScanO1003399::abort_dev_tx() +{ + scanner_write_reg(m_usb, SR_IM_ABORT, 1); //!< to-list +} + +void GScanO1003399::config_scanparam(const HG_ScanConfig& cfg) +{ + scanner_write_reg(m_usb, SR_CONFIG_SCAN_PARAM, cfg.value); +} + +void GScanO1003399::config_imgprocparam(const HGImgProcParms& imgprocparams) +{ + scanner_write_reg(m_usb, SR_CONFIF_IMGPROCPARAM, imgprocparams.value); +} + +bool GScanO1003399::is_rx() +{ + return false; +} + +bool GScanO1003399::rx_cmd() +{ + scanner_write_reg(m_usb, 8, 1); + return true; +} + +bool GScanO1003399::is_dev_tx() +{ + return scanner_read_reg(m_usb, SR_IM_TXING); +} + +void GScanO1003399::im_rx() +{ + if (is_dev_tx()) + return; + if (keeplastimg) + { + if (m_param.scanSide.duplex) { + if (im_dev_count() < 3) + return; + } + if (im_dev_count() < 2) + return; + } + std::shared_ptr> buffi(new std::vector); + //auto& buffi = im_data; + int count = front_datasize(); + buffi->resize(count); + rx_cmd(); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + count = read_data(buffi->data(), count, count / (0.005 * 1024 * 1024)); // + pop_dev_im(); + imagecount += (m_param.imageProcess.multiOutFilterRed ? 2 : 1) * (m_param.multiOutput == -1 ? 1 : m_param.multiOutput == 0 ? 3 : 2) * + (m_param.imageProcess.splitImage ? 2 : 1); + //m_param.imageProcess.multiOutFilterRed? imagecount += 2: imagecount++; + std::cout<<"im_rx ++"< 200.0f || m_param.paperSize == 52 || m_param.paperSize == 54 || m_param.paperSize == 131) + { + auto path = cv::tempfile(); + auto fd = fopen(path.c_str(), "wb+"); + if (fd) + { + fwrite(buffi->data(), buffi->size(), 1, fd); + fclose(fd); + m_paths.Put(path); + } + } + else { + imgs.Put(buffi); + } +} + +int GScanO1003399::read_data(void* data, int length, int timeout) +{ + if (!m_usb.get() && !m_usb->is_connected()) + { + return 0; + } + timeout = max(1000, timeout); + + int readed = 0; + int reading = 0; + const int buffer_size = 512 * 1024; + StopWatch sw; + while (readed < length) { + if (sw.elapsed_ms() < timeout) + { + reading = max(0, min(length - readed, buffer_size)); + reading = m_usb->read_bulk((unsigned char*)data + readed, reading); + if (reading > 0) { + readed += reading; + sw.reset(); + } + } + else + { + break; + } + } + return readed; +} + +void GScanO1003399::pop_dev_im() +{ + if (im_dev_count() > 0) + scanner_write_reg(m_usb, SR_IM_POP, 1); //!< to-list +} + +int GScanO1003399::front_datasize() +{ + return scanner_read_reg(m_usb, SR_IM_FRONT_SIZE); +} + +int GScanO1003399::im_dev_count() +{ + return scanner_read_reg(m_usb, SR_IM_COUNT); //!< to-list ; +} + +void GScanO1003399::SetSerialNum(std::string serial) +{ + if (m_usb.get() && m_usb->is_connected()) + { + scanner_write_reg(m_usb, SR_SET_SERIALNUM, serial.length()); + m_usb->write_bulk(&serial[0], serial.length()); + } +} + +static int num = 0; +void GScanO1003399::imgproce(std::shared_ptr>& buff) +{ + auto buffs = GRawDecode(buff).getImageBuffs(); + vector mats; + StopWatch sw; + bool isbwimg = false; + for (auto& buf : buffs) { + cv::ImreadModes rmc = m_param.pixelType == 2 ? cv::IMREAD_COLOR : cv::IMREAD_GRAYSCALE; + try + { + if (buf->at(0) == -119 && buf->at(1) == 0x50 && buf->at(2) == 0x4e && buf->at(3) == 0x47) + { + isbwimg = true; + rmc = cv::IMREAD_GRAYSCALE; + } + cv::Mat mat = cv::imdecode(*buf, rmc); + if (mat.empty()) { + continue; + } + buf.reset(); + mats.push_back(mat); + } + catch (const std::exception& e) + { + } + } + sw.reset(); + buffs.clear(); + for (int i = 0; i < mats.size(); i++) + { + bool multiout_red, multi_type; + int msplit=0; + multiout_red = m_param.imageProcess.multiOutFilterRed; + multi_type = m_param.multiOutput != -1; + msplit = m_param.imageProcess.splitImage; + if (multiout_red | multi_type | msplit) + { + vector retmats; + std::vector> m_multiprc_list; + if (m_param.imageProcess.multiOutFilterRed && m_param.pixelType == ColorMode::RGB) + { + m_multiprc_list.push_back(shared_ptr(new ImageMultiOutputRed(2))); + } + + if (m_param.multiOutput != -1) + { + m_multiprc_list.push_back(shared_ptr(new IMageMulti(m_param.multiOutput))); + } + for (int j = 0; j < m_multiprc_list.size(); j++) + { + if (!mats[i].empty()) + retmats = m_multiprc_list[j]->apply(mats[i]); + } + + int colormode = 1; + if (m_param.imageProcess.filter == ColorFilter::FILTER_NONE) + { + colormode = m_param.pixelType; + } + + CImageApplySplit isp(m_param.multiOutput, msplit, multiout_red, colormode); + + if (!retmats.size()) //����û�ж���,ֻ�в��� + { + auto matexs = isp.SplitMats(mats, m_param.scanSide.duplex); + for (auto& matex : matexs) + m_imagedata.Put(matex); + break; + } + else + { + auto matexs = isp.SplitMats(retmats, m_param.scanSide.duplex); + for (auto& matex : matexs) + m_imagedata.Put(matex); + } + } + else + { + if (!mats[i].empty()) + { + + int bpp = (ColorMode)m_param.pixelType == ColorMode::BlackWhite ? 1 : ((ColorMode)m_param.pixelType == ColorMode::Gray ? 8 : 24); + if (m_param.imageProcess.filter != ColorFilter::FILTER_NONE) + { + bpp = 8; + } + MatEx out(mats[i], bpp); + m_imagedata.Put(out); + + } + } + } + + mats.clear(); +} + +int GScanO1003399::codeconvter(HGEIntInfo code) +{ + if (code.From == HGType::FPGA) + { + switch (code.Code) + { + default: + break; + } + } + if (code.From == HGType::MtBoard) + { + switch (code.Code) + { + case 0x00002: + return NO_FEED; + case 0x00004: + return OPEN_COVER; + case 0x00008: + return FEED_IN_ERROR; + case 0x00010: + return PAPER_JAM; + case 0x00020: + return DETECT_DOUBLE_FEED; + case 0x00040: + return DETECT_STAPLE; + case 0x00080: + return PAPER_SKEW; + case 0x10000: + return AQUIRE_IMAGE_TIMEOUT; + case 0x20000: + return SIZE_ERROR; + default: + break; + } + } + if (code.From == HGType::V4L2) + { + switch (code.Code) + { + case 0: + return V4L2_AQULRE_ERROR; + case 1: + return V4L2_IMAGE_EMPTY; + default: + break; + } + } + if (code.From == HGType::IMG) + { + switch (code.Code) + { + case 1: + return HAVE_DOGEAR; + case 2: + return SIZE_ERROR; + default: + break; + } + } + if (code.From == HGType::STOPSCAN) + return -1; + return 0; +} + + + +void GScanO1003399::proc(bool bcachemode) +{ + b_imgprothread = true; + while (b_imgprothread) + { + if (m_imagedata.Size() > 0) + { + this_thread::sleep_for(chrono::milliseconds(10)); + continue; + } + std::shared_ptr> buffer; + if (bcachemode) { + if (m_paths.Size() < 1) + { + this_thread::sleep_for(chrono::milliseconds(10)); + continue; + } + auto path = m_paths.Take(); + if (!path.empty()) + { + auto fd = fopen(path.c_str(), "rb+"); + if (fd) + { + struct stat m_stat; + stat(path.c_str(), &m_stat); + auto lenght = m_stat.st_size; + buffer.reset(new std::vector); + buffer->resize(lenght); + fread(buffer->data(), lenght, 1, fd); + fclose(fd); + remove(path.c_str()); + } + else { + } + } + + } + else + { + if (imgs.Size() < 1) + { + std::this_thread::sleep_for(chrono::milliseconds(2)); + continue; + } + buffer = imgs.Take(); + } + + imgproce(buffer); + } +} + + + +std::string GScanO1003399::GetMbVersion() +{ + std::string version = "unkown"; + if (m_usb.get() && m_usb->is_connected()) + { + int length = scanner_read_reg(m_usb, SR_GET_MBVERSION_LENGHT); + version.resize(length); + if (length > 0) + { + scanner_write_reg(m_usb, SR_GET_MBVERSION, length); + read_data(&version[0], version.length(), 200); + } + } + return version; +} + +std::string GScanO1003399::GetIpAddr() +{ + std::string version = "unkown"; + if (m_usb.get() && m_usb->is_connected()) + { + int length = scanner_read_reg(m_usb, SR_GET_IPADDR_LENGHT); + version.resize(length); + if (length > 0) + { + scanner_write_reg(m_usb, SR_GET_IPADDR, length); + read_data(&version[0], version.length(), 200); + } + } + return version; +} + +std::string GScanO1003399::GetKernelVersion() +{ + std::string version = "unkown"; + if (m_usb.get() && m_usb->is_connected()) + { + int length = scanner_read_reg(m_usb, SR_KERNEL_VERSION_INFO_LENGTH); + version.resize(length); + if (length > 0) + { + scanner_write_reg(m_usb, SR_GET_KERNEL_VERSION, length); + read_data(&version[0], version.length(), 200); + } + } + return version; +} + +void GScanO1003399::SetRatio(int tyepe, int ration) +{ + scanner_write_reg(m_usb, tyepe == 0 ? SR_SET_H_RATIO : SR_SET_V_RATIO, ration); + +} +void GScanO1003399::GetRatio(int type, int& ratio) +{ + ratio = scanner_read_reg(m_usb, type == 0 ? SR_GET_H_RATIO : SR_GET_V_RATIO); +} + +void GScanO1003399::Reboot() +{ + scanner_write_reg(m_usb, SR_REBOOT, 0); +} + +void GScanO1003399::PowerOff() +{ + scanner_write_reg(m_usb, SR_POWEROFF, 0); +} + +void GScanO1003399::SendFlatData(CorrectParam param, int index) +{ + if (m_usb.get() && m_usb->is_connected()) + { + scanner_write_reg(m_usb, SC_SET_CORRECT_PARAM, index); + HGCISConfig cisconfig = { 0 }; + int t_index = index; + memcpy(cisconfig.expF, param.Exposures, sizeof(u32) * 3); + memcpy(cisconfig.expB, ¶m.Exposures[0] + 3, sizeof(u32) * 3); + memcpy(cisconfig.gainF, param.Gain, sizeof(u32) * 6); + memcpy(cisconfig.gainB, ¶m.Gain[0] + 6, sizeof(u32) * 6); + memcpy(cisconfig.offsetsF, param.Offset, sizeof(u32) * 6); + memcpy(cisconfig.offsetsB, ¶m.Offset[0] + 6, sizeof(u32) * 6); + m_usb->write_bulk(&cisconfig, sizeof(HGCISConfig)); + } +} + + +CaptureParams GScanO1003399::GetFlatData() +{ + CaptureParams param; + HGCorrectConfigs cisconfigs = { 0 }; + scanner_write_reg(m_usb, SC_GET_CORRECT_PARAM, 0); + m_usb->read_bulk(&cisconfigs, sizeof(HGCorrectConfigs)); + for (size_t i = 0; i < 2; i++) + { + memcpy(¶m.correctColorExposure[0] + i * 3, i == 0 ? &cisconfigs.colorCorrect.expF[0] : &cisconfigs.colorCorrect.expB[0], sizeof(u32) * 3); + memcpy(¶m.colorExposure[0] + i * 3, i == 0 ? &cisconfigs.color.expF[0] : &cisconfigs.color.expB[0], sizeof(u32) * 3); + memcpy(¶m.correctGrayExposure[0] + i * 3, i == 0 ? &cisconfigs.grayCorrect.expF[0] : &cisconfigs.grayCorrect.expB[0], sizeof(u32) * 3); + memcpy(¶m.grayExposure[0] + i * 3, i == 0 ? &cisconfigs.gray.expF[0] : &cisconfigs.gray.expB[0], sizeof(u32) * 3); + + memcpy(¶m.correctColorGain[0] + i * 6, i == 0 ? &cisconfigs.colorCorrect.gainF[0] : &cisconfigs.colorCorrect.gainB[0], sizeof(u32) * 6); + memcpy(¶m.colorGain[0] + i * 6, i == 0 ? &cisconfigs.color.gainF[0] : &cisconfigs.color.gainB[0], sizeof(u32) * 6); + memcpy(¶m.correctGrayGain[0] + i * 6, i == 0 ? &cisconfigs.grayCorrect.gainF[0] : &cisconfigs.grayCorrect.gainB[0], sizeof(u32) * 6); + memcpy(¶m.grayGain[0] + i * 6, i == 0 ? &cisconfigs.gray.gainF[0] : &cisconfigs.gray.gainB[0], sizeof(u32) * 6); + + memcpy(¶m.correctColorOffset[0] + i * 6, i == 0 ? &cisconfigs.colorCorrect.offsetsF[0] : &cisconfigs.colorCorrect.offsetsB[0], sizeof(u32) * 6); + memcpy(¶m.colorOffset[0] + i * 6, i == 0 ? &cisconfigs.color.offsetsF[0] : &cisconfigs.color.offsetsB[0], sizeof(u32) * 6); + memcpy(¶m.correctGrayOffset[0] + i * 6, i == 0 ? &cisconfigs.grayCorrect.offsetsF[0] : &cisconfigs.grayCorrect.offsetsB[0], sizeof(u32) * 6); + memcpy(¶m.grayOffset[0] + i * 6, i == 0 ? &cisconfigs.gray.offsetsF[0] : &cisconfigs.gray.offsetsB[0], sizeof(u32) * 6); + } + return param; +} + +void GScanO1003399::StartFlat(bool iscolor) +{ + int color = iscolor ? 1 : 0; + is_flat=true; + scanner_write_reg(m_usb, SC_AUTOCORRECT, color); +} + +void GScanO1003399::GetExpose(int& Aside, int& Bside) +{ + +} +void GScanO1003399::SetExpose(int aside, int bside) +{ + +} + +void GScanO1003399::GetSptime(int type, int& time) +{ + if (type == 0) + time = scanner_read_reg(m_usb, SR_GET_GRAY_SP); + if (type == 1) + time = scanner_read_reg(m_usb, SR_GET_COLOR_SP); +} +void GScanO1003399::SetSptime(int type, int time) +{ + if (type == 0) + scanner_write_reg(m_usb, SR_SET_GRAY_SP, time); + if (type == 1) + scanner_write_reg(m_usb, SR_SET_COLOR_SP, time); +} + +void GScanO1003399::GetSleepTime(int& sleeptime) +{ + sleeptime = scanner_read_reg(m_usb, SR_GET_SLEEPTIME); +} +void GScanO1003399::SetSleepTime(int sleeptime) +{ + scanner_write_reg(m_usb, SR_SET_SLEEPTIME, sleeptime); +} + + +void GScanO1003399::GetSpeedMode(int& speedmode, bool get) +{ + if (m_usb.get() && m_usb->is_connected()) + { + if (get) + { + speedmode= scanner_read_reg(m_usb, SR_GET_SPEEDMODE); + } + else + { + scanner_write_reg(m_usb, SR_SET_SPEEDMODE,speedmode); + } + } +} + +void GScanO1003399::GetOrSetVIDPID(int& value, bool get) +{ + if(m_usb.get() && m_usb->is_connected()) + { + if(get) + { + value = scanner_read_reg(m_usb,SR_GET_USBVIDPID); + } + else + { + scanner_write_reg(m_usb,SR_SET_USBVIDPID,value); + } + } +} + +std::string GScanO1003399::GetSysInfo() +{ + if (m_usb->is_open()) + { + std::string path = "/usr/local/huago/sysinfo.json"; + scanner_write_reg(m_usb, SR_SET_JSON_PATH, path.size()); + m_usb->write_bulk(&path[0], path.size()); + int size = 0; + if (size = scanner_read_reg(m_usb, SR_GET_JOSN_SIZE)) + { + std::string buff; + buff.resize(size); + scanner_write_reg(m_usb, SR_GET_JSON, size); + m_usb->read_bulk(&buff[0], size); + return buff; + } + return ""; + } + return ""; +} + +void GScanO1003399::GetFlatMaxBright(bool iscolor, unsigned int& val) +{ + if (m_usb.get() && m_usb->is_connected()) + { + val= scanner_read_reg(m_usb, iscolor?SR_FLAT_CLR_MAX_BRIGHT:SR_FLAT_GRAY_MAX_BRIGHT); + } +} + +void GScanO1003399::SetFlatMaxBright(bool iscolor, unsigned int val) +{ + if (m_usb.get() && m_usb->is_connected()) + { + scanner_write_reg(m_usb, iscolor ? SR_FLAT_CLR_MAX_BRIGHT : SR_FLAT_GRAY_MAX_BRIGHT,val); + } +} + + +bool GScanO1003399::Updata(std::string filename, std::function func) +{ + std::ifstream updatefile; + updatefile.open(filename, std::ios_base::in | std::ios_base::binary); + if (!updatefile.is_open()) + { + return false; + } + updatefile.seekg(0, std::ios::end); + size_t length = updatefile.tellg(); + func(0, length); + updatefile.seekg(0, std::ios::beg); + scanner_write_reg(m_usb, 0x100, length); + size_t nreaded = 0; + size_t nleft = length; + int buffersize = 512 * 1024; + if (length <= buffersize)//小于1MB + { + char* uotstream = new char[length]; + updatefile.read(uotstream, length); + m_usb->write_bulk(uotstream, length); + delete[] uotstream; + } + else + { + while (true) + { + int ntotransfer; + if (nleft < buffersize) + ntotransfer = nleft; + else + ntotransfer = buffersize; + std::vector data; + data.resize(ntotransfer); + updatefile.read(data.data(), ntotransfer); + m_usb->write_bulk(data.data(), ntotransfer); + nreaded += ntotransfer; + nleft -= ntotransfer; + func(nreaded, length); + if (nreaded >= length) + break; + this_thread::sleep_for(std::chrono::milliseconds(5)); + } + } + this_thread::sleep_for(std::chrono::milliseconds(200)); + if (!scanner_read_reg(m_usb, 0x101)) + return false; + auto now = std::chrono::steady_clock::now(); + while (std::chrono::duration(std::chrono::steady_clock::now() - now).count() < 60) + { + int status= scanner_read_reg(m_usb, 0x102); + if (status == 2) + { + scanner_read_reg(m_usb, 0x104); + return true; + } + if (status == 3) + { + scanner_read_reg(m_usb, 0x103); + return true; + } + if (status == 6) + { + return false; + } + this_thread::sleep_for(std::chrono::milliseconds(20)); + } + return false; +} diff --git a/hgdev/GScanO1003399.h b/hgdev/GScanO1003399.h new file mode 100644 index 0000000..6a61059 --- /dev/null +++ b/hgdev/GScanO1003399.h @@ -0,0 +1,290 @@ +#pragma once +#include "GScan.h" +#include "IConfig.h" +#include "predefine.h" +#include "G400ScanConfig.h" +#include +#include +#include +#include +#include "threadpool.h" +#include "StopWatch.h" +#include "ImageMatQueue.h" +#include "libusbex.h" +#include "IUsb.h" + +#define USB_REQ_GET_FPGA_REGS 0x40 +#define USB_REQ_SET_FPGA_REGS 0x41 +#define USB_REQ_GET_MOTOR_REGS 0x42 +#define USB_REQ_SET_MOTOR_REGS 0x43 + +#define USB_REQ_GET_DEV_STATUS 0x60 +#define USB_REQ_GET_DEV_CONFIGURATION 0x61 +#define USB_REQ_SET_DEV_CONFIGURATION 0x62 +#define USB_REQ_GET_DEV_REGS 0x63 +#define USB_REQ_SET_DEV_REGS 0x64 + + +enum HGType +{ + MtBoard = 1, + FPGA, + V4L2, + IMG, + AutoCorrect, + STOPSCAN, +}; + +enum Scanner_Cmd_Defs +{ + SC_START, + SC_STOP, + SC_CLEAR, + SC_COUNT +}; + +struct HGEIntInfo +{ + HGType From; + unsigned int Code; + unsigned int Img_Index; +}; + +typedef union HG_ScanConfig +{ + unsigned int value; + struct + { + unsigned int paper : 5; + unsigned int color : 1; + unsigned int dpi : 2; + unsigned int double_feed_enbale : 1; + unsigned int stable_enbale : 1; + unsigned int screw_detect_enable : 1; + unsigned int screw_detect_level : 3;//ʮλ + unsigned int iscorrect_mod : 1; + unsigned int unused_one : 5; + unsigned int pc_correct : 1; + unsigned int enable_sizecheck : 1; + unsigned int enabledsp_cache : 1; + unsigned int sizeerror_errorratio : 9; + }g200params; + struct + { + unsigned int pageSize : 5; + unsigned int isColor : 1; + unsigned int dpi : 2; + unsigned int doubleFeeded : 1; + unsigned int enableStable : 1; + unsigned int enableLed : 1; + unsigned int reversed1 : 6; + unsigned int isCorrect : 1; + unsigned int dstHeight : 8; + unsigned int reversed2 : 6; + }g400params; +}HGScanConfig; + +typedef union HG_ImgProcParms +{ + unsigned int value; + struct + { + unsigned int papertype : 5; + unsigned int scanside : 3; + unsigned int res : 10; + unsigned int rotate : 2; + unsigned int autodescrew : 1; + unsigned int fillbackground : 1; + unsigned int filter : 4; + unsigned int enhancecolor : 2; + unsigned int fillhole : 1; + unsigned int reversed : 3; + }imgprocparams; +}HGImgProcParms; + +enum Scanner_Reg_Defs +{ + SR_CMD, + SR_STATUS, + SR_SCAN_COUNT, + SR_OS, + SR_SENSORS, + SR_MOTOR, + SR_IM_TYPE, + SR_IM_COUNT, + SR_IM_TX, + SR_IM_FRONT_SIZE, + SR_IM_CLEAR, + SR_IM_TXING, + SR_IM_POP, + SR_IM_ABORT, + SR_COUNT, + SR_CONFIG_SCAN_PARAM, + SR_GET_FWVERSION, + SR_SET_FWERSION, + SR_GET_SERIALNUM, + SR_SET_SERIALNUM, + SR_CONFIF_IMGPROCPARAM, + SC_AUTOCORRECT, + SC_GET_CORRECT_PARAM, + SC_SET_CORRECT_PARAM, + SR_GET_H_RATIO, + SR_SET_H_RATIO, + SR_GET_V_RATIO, + SR_SET_V_RATIO, + SR_GET_SERIAL_LEN, + SR_GET_GRAY_SP, + SR_GET_COLOR_SP, + SR_SET_GRAY_SP, + SR_SET_COLOR_SP, + SR_SET_SLEEPTIME, + SR_GET_SLEEPTIME, + SR_GET_SLEEP_STAUTUS, + SR_GET_IMAGEPROCESSDONE, + SR_GET_KEEP_LAST_PAPER, + SR_GET_PAPERON, + SR_SET_SPEEDMODE, + SR_GET_SPEEDMODE, + SR_GET_JOSN_SIZE, + SR_GET_JSON, + SR_SET_JSON_PATH, + SR_SET_JSON, + SR_GET_CUO_ERROR = 0x50, + SR_GET_DOU_ERROR, + SR_GET_JAM_ERROR, + SR_GET_SCANN_NUM, + SR_CLR_ROLLER_NUM, + SR_GET_ROLLER_NUM, + SR_CLR_SCANN_NUM, + SR_UPDATA_START = 0x100, + SR_UPDATA_STAUTUS = 0x101, + SR_UPDATA_MD5_RELUST = 0x102, + SR_UPDATA_RECOVERY = 0x103, + SR_UPDATA_REBOOT = 0x104, + SR_POWEROFF = 0x105, + SR_REBOOT = 0x106, + SR_FLAT_CLR_MAX_BRIGHT, + SR_FLAT_GRAY_MAX_BRIGHT, + SR_KERNEL_VERSION_INFO_LENGTH, + SR_GET_KERNEL_VERSION, + SR_GET_IPADDR_LENGHT = 0x200, + SR_GET_MACADDR, + SR_GET_IPADDR, + SR_GET_MBVERSION_LENGHT, + SR_GET_MBVERSION, + SR_GET_USBVIDPID, + SR_SET_USBVIDPID, +}; +class GScanO1003399 :public IGScan +{ +public: + GScanO1003399(); + virtual ~GScanO1003399(); + virtual void open(int vid, int pid) override; + virtual bool close() override; + virtual bool is_open() override; + virtual void setusbreport_callback(usbreport_callback callback = 0, void* usrdata = 0) override; + virtual void setonimage_callback(onimagecallback aqrcallback) override; + virtual int get_image_front_info(ImageInfo* info) override; + virtual int aquire_image(cv::Mat& mat, int& bppinfo) override; + virtual int aquire_image(std::vector& imgdata,int & bppinfo,int & width,int & height) override; + virtual BOOL IsConnected() override; + virtual std::string GetFWVersion() override; + virtual std::string GetSerialNum() override; + virtual void SetSerialNum(std::string serial) override; + virtual bool is_scan() override; + virtual BOOL Get_Scanner_PaperOn() override; + virtual bool Get_IsImageQueueEmpty() override; + virtual void config_params(GScanCap& param) override; + virtual void Scanner_StartScan(int count) override; + virtual void Stop_scan() override; + virtual int notifyscan(); + virtual void ResetScanner() override; + virtual void reset() override; + virtual void setdecodepixtype(int twpixtype) override; + virtual int get_scanned_num() override; + virtual UINT32 get_ErrorCode() override; + virtual void Set_ErrorCode(UINT32 value) override; + virtual int get_roller_num() override; + virtual void clr_roller_num() override; + virtual int get_sleep_time() override; + virtual void set_sleep_time(int time) override; + virtual BOOL clr_hardware_cache() override; + + virtual std::string GetMbVersion() override; + virtual std::string GetIpAddr() override ; + virtual std::string GetKernelVersion() override ; + virtual void SetRatio(int tyepe, int ration) override; + virtual void GetRatio(int type, int& ratio) override; + virtual void Reboot() override; + virtual void PowerOff() override; + virtual void SendFlatData(CorrectParam param, int index) override; + virtual CaptureParams GetFlatData() override; + virtual void StartFlat(bool iscolor) override; + virtual void GetExpose(int& Aside, int& Bside) override; + virtual void SetExpose(int aside, int bside) override; + virtual void GetSptime(int type, int& time) override; + virtual void SetSptime(int type, int time) override; + virtual void GetSleepTime(int& sleeptime) override; + virtual void SetSleepTime(int sleeptime) override; + + virtual void GetFlatMaxBright(bool iscolor, unsigned int& val) override; + virtual void SetFlatMaxBright(bool iscolor, unsigned int val) override; + virtual bool Updata(std::string filename, std::function func)override; + virtual void GetSpeedMode(int& speedmode,bool get) override ; + virtual void GetOrSetVIDPID(int& value, bool get) override; + + virtual std::string GetSysInfo() override; + virtual void setserial(ScannerSerial serial) + { + m_serial = serial; + m_pImages->Setserial(serial); + } + +private: + void usb_run(); + void im_rx(); + void start(); + void stop(); + bool is_runing(); + int scan_mode(); + int count(); + void abort_dev_tx(); + void config_scanparam(const HG_ScanConfig& cfg); + void config_imgprocparam(const HGImgProcParms& imgprocparams); + bool is_rx(); + bool rx_cmd(); + bool is_dev_tx(); + int read_data(void* data, int length, int timeout); + void pop_dev_im(); + int front_datasize(); + int im_dev_count(); + void imgproce(std::shared_ptr>& buffs); + int codeconvter(HGEIntInfo code); + void proc(bool bcachemode); + static void on_usbcallback(int conditoncode, void* usrdata); + void onusbcallback(int conditoncode); + void aquirethreadfunc(); +private: + volatile int devState; + volatile int Error_Code; + volatile bool scanflag; + volatile bool keeplastimg; + GScanCap m_param; + std::shared_ptr m_usb; + volatile bool b_imgprothread; + volatile bool b_usbthread; + volatile bool b_threadimg; + BlockingQueue>> imgs; + BlockingQueue m_paths; + + std::shared_ptr m_imgprocthread; + std::shared_ptr m_usbthread; + std::shared_ptr m_threadgetimg; + std::shared_ptr> im_data; + BlockingQueue m_imagedata; + std::atomic_int imagecount; + usbreport_callback m_usbreport; + onimagecallback m_imagecallback; + void* m_usrdata; +}; diff --git a/hgdev/GScanO200.cpp b/hgdev/GScanO200.cpp new file mode 100644 index 0000000..2528e28 --- /dev/null +++ b/hgdev/GScanO200.cpp @@ -0,0 +1,969 @@ +#include "predefine.h" +#include "GScanO200.h" +#ifdef WIN32 +#include "UsbScanEx.h" +#else +#include "libusbex.h" +#endif +#include "StopWatch.h" +#include "ImageMatQueue.h" +#include "filetools.h" +#include "IConfig.h" +#include "scn_config.h" +#include +#include "sane_common.h" + +using namespace std; + +GScanO200::GScanO200() : m_usrdata(0), m_usbreport(0) +{ + m_serial = ScannerSerial::G200Serial; +} + +GScanO200::~GScanO200() +{ + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + + if(m_aquirethread.get()&&m_aquirethread->joinable()) + { + m_aquirethread->join(); + m_aquirethread.reset(); + } + + if(m_usb.get()) + m_usb.reset(); + std::cout<<"1"<Setserial(serial); +} + +void GScanO200::open(int vid, int pid) +{ +#ifdef WIN32 + auto usbold = UsbScan_List::find_vid_pid(0x064b, 0x7823); + + if (usbold.empty()) { + auto usbs = UsbScan_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + m_usb = *usbs.begin(); + m_usb->set_usbcallback(&GScanO200::on_usbcallback, this); + auto ret = m_usb->open(); + } + } + else + { + m_usb = *usbold.begin(); + m_usb->set_usbcallback(&GScanO200::on_usbcallback, this); + auto ret = m_usb->open(); + } + +#else // WIN32 + auto usbs = Libusb_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + if(!m_usb.get()) + { + m_usb = *usbs.begin(); + auto ret=m_usb->open(); + if(!ret) + LOG("GScanO200 open usb failed\n"); + m_usb->set_usbcallback(&GScanO200::on_usbcallback, this); + } + } +#endif +} + +bool GScanO200::close() +{ + if(m_usb.get()&&m_usb->is_open()) + return m_usb->close(); + return false; +} + +bool GScanO200::is_open() +{ + if(m_usb.get()) + return m_usb->is_open(); + return false; +} + +void GScanO200::setusbreport_callback(usbreport_callback callback, void *usrdata) +{ + m_usbreport = callback; + m_usrdata = usrdata; +} +void GScanO200::setonimage_callback(onimagecallback aqrcallback) +{ + if (aqrcallback) + m_imagecallback = aqrcallback; + else + LOG("error on setonimage_callback ptr=%p \n", aqrcallback); +} +#ifdef LOG_NORMAL +fstream fsaquire; +static int aquiretimes = 1; +#endif // LOG + +#ifdef TWAIN +int GScanO200::aquire_bmpdata(std::vector &bmpdata) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (sw.elapsed_s() > 20.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + bmpdata = m_pImages->popBmpdata(); +#ifdef LOG_NORMAL + static int aquireindex = 0; + FileTools::write_log("out.txt", "aquire image index " + std::to_string(++aquireindex)); +#endif // LOG + return 0; + } + DoEvents(); //��ֹUI���� + this_thread::sleep_for(chrono::milliseconds(1)); + } + } +} +#else // TWAIN + +int GScanO200::get_image_front_info(ImageInfo *info) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (sw.elapsed_s() > 20.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + + if (!is_scan()) + { + *info = {0}; + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + m_pImages->get_image_front_info(info); + cout << "get real image info" << endl; +#ifdef LOG_NORMAL + static int aquireindex = 0; + FileTools::write_log("out.txt", "aquire image index " + std::to_string(++aquireindex)); +#endif // LOG + return 0; + } +#ifdef WIN32 + DoEvents(); //��ֹUI���� +#endif // WIN32 + this_thread::sleep_for(chrono::milliseconds(1)); + } + } + //m_pImages->get_image_front_info(info); +} + +int GScanO200::aquire_image(std::vector &imgdata, int &bppinfo, int &width, int &height) +{ + cv::Mat tmp; + int ret= aquire_image(tmp,bppinfo); + if(tmp.empty()) + return ret; + width = tmp.cols; + height = tmp.rows; + if(tmp.channels()==3) + cv::cvtColor(tmp,tmp,cv::COLOR_BGR2RGB); + imgdata = tmp.reshape(1,tmp.cols*tmp.rows*tmp.channels()); + return ret; +} +int GScanO200::aquire_image(cv::Mat &mat, int &bppinfo) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + auto ret = m_pImages->popimage(); + mat = ret.mat.clone(); + bppinfo = ret.Bpp; + return 0; + } +#ifdef WIN32 + DoEvents(); //��ֹUI���� +#endif // WIN32 + this_thread::sleep_for(chrono::milliseconds(1)); + } + + if (sw.elapsed_s() > 25.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + } +} +#endif + +BOOL GScanO200::IsConnected() +{ + return m_usb && m_usb->is_connected(); +} + + std::string GScanO200::GetFWVersion() + { + if (m_usb.get()&& m_usb->is_connected()) + { + lock_guard lock(m_imgLocker); + if (fwVersion.empty()) + { + uint length=8; + fwVersion.resize(length); + USBCB cmd = { + GET_FW_VERSION, + length, + 0, + }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + m_usb->read_bulk(&fwVersion[0], length); + } + return fwVersion; + } + return ""; + } + + std::string GScanO200::GetSerialNum() + { + if (m_usb->is_connected()) + { + std::lock_guard lck(m_imgLocker); + if (SerialNum.empty()) + { + uint length=12; + SerialNum.resize(length); + USBCB usbcb = {GET_SERIAL, length, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&SerialNum[0], length); + } + return SerialNum; + } + return ""; + } + +bool GScanO200::is_scan() +{ + //std::lock_guard lck(m_imgLocker); + return devState == DEV_RUNNING; +} + +BOOL GScanO200::Get_Scanner_PaperOn() +{ + if (!m_usb.get()&&!m_usb->is_open()) + return false; + USBCB usbcb = {GET_PAPERFEEDER_STATUS, 0, 0}; + std::lock_guard lck(m_imgLocker); + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data != 0; +} + +void GScanO200::config_params(GScanCap& params) +{ + params.resolution_native = 200; + if (m_usb.get()&&m_usb->is_connected()) + { + cap=params; + hgConfigClass cfg = hgConfigClass(params); + UINT32 cfgdata = cfg.GetData(); + USBCB usbcb = {CONFIGURED_DATA, cfgdata, 0}; + m_usb->write_bulk(&usbcb, sizeof(USBCB)); + m_pImages->setparam(params); + std::cout << "Config Params" << std::endl; + } +} + +void GScanO200::SetSerialNum(std::string serial) +{ + if (m_usb.get()&&m_usb->is_connected()) + { + std::lock_guard lck(m_imgLocker); + USBCB sercmd = { SEND_SERIAL ,0,12}; + m_usb->write_bulk(&sercmd, sizeof(sercmd)); + m_usb->write_bulk(&serial, serial.length()); + } +} + + +bool GScanO200::Updata(std::string filename, std::function func) +{ + std::ifstream updatefile; + updatefile.open(filename, std::ios_base::in | std::ios_base::binary); + if (!updatefile.is_open()) + { + return false; + } + updatefile.seekg(0, std::ios::end); + size_t length = updatefile.tellg(); + func(0, length); + updatefile.seekg(0, std::ios::beg); + USBCB pre_update = { PRE_UPGRADE,0,(uint32_t)length }; + m_usb->write_bulk(&pre_update, sizeof(pre_update)); + this_thread::sleep_for(chrono::milliseconds(200)); + char* uotstream = new char[length]; + updatefile.read(uotstream, length); + m_usb->write_bulk(uotstream, length); + delete[] uotstream; + USBCB updatefinished = { START_UPGRADE,0,0 }; + m_usb->write_bulk(&updatefinished, sizeof(updatefinished)); + func(length,length); + this_thread::sleep_for(chrono::seconds(8)); + return true; +} + +std::string GScanO200::GetMbVersion() +{ + if (m_usb.get() && m_usb->is_connected()) + { + std::lock_guard lck(m_imgLocker); + USBCB usbcb = { GET_MOTORFPGA_VERSION,0,4 }; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return std::to_string(usbcb.u32_Data); + } + return ""; +} + +std::string GScanO200::GetIpAddr() +{ + return "no support"; +} +std::string GScanO200::GetKernelVersion() +{ + return "no support"; +} + +void GScanO200::SetRatio(int tyepe, int ration) +{ + UsbKeyWords keyword = tyepe == 0 ? SET_JUST_COF_H : SET_JUST_COF_V; + USBCB cmd = { keyword ,(uint)ration,0}; + m_usb->write_bulk(&cmd, sizeof(cmd)); +} + +void GScanO200::GetRatio(int type, int& ratio) +{ + UsbKeyWords keyword = type == 0 ? GET_JUST_COF_H : GET_JUST_COF_V; + USBCB cmd = { keyword ,0,0 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + m_usb->read_bulk(&cmd, sizeof(cmd)); + ratio = cmd.u32_Data; +} + +void GScanO200::Reboot(){} +void GScanO200::PowerOff(){} + +void GScanO200::SendFlatData(CorrectParam param, int index) +{ + auto capparams= GetFlatData(); + if(index>1) + { + USBCB cmd = { SEND_COMPONENTS_GR ,param.Exposures[0]+capparams.colorExposure[0]*65536,4 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + this_thread::sleep_for(chrono::milliseconds(1000)); + cmd = {ADI_PARA,param.Gain[0]+param.Gain[6]*256+param.Offset[0]*65536+param.Offset[6]*65536*256,4}; + m_usb->write_bulk(&cmd,sizeof(USBCB)); + } + else + { + USBCB cmd = { SEND_COMPONENTS_GR ,param.Exposures[0]*65536+capparams.grayExposure[0],4 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + this_thread::sleep_for(chrono::milliseconds(1000)); + cmd = { SEND_COMPONENTS_GB ,param.Exposures[2]*65536+param.Exposures[1],4 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + this_thread::sleep_for(chrono::milliseconds(1000)); + cmd = {RGB_ADI_PARA,param.Gain[0]+param.Gain[6]*256+param.Offset[0]*65536+param.Offset[6]*65536*256,4}; + m_usb->write_bulk(&cmd,sizeof(USBCB)); + } + +} + +CaptureParams GScanO200::GetFlatData() +{ + CaptureParams tmp{0}; + USBCB usbcb={GET_CIS_PARA,0,0x10}; + uchar data[16]{0}; + m_usb->write_bulk(&usbcb,sizeof(USBCB)); + this_thread::sleep_for(chrono::milliseconds(1000)); + m_usb->read_bulk(data,16); + for(int i=0;i<6;i++) + tmp.correctGrayExposure[i]=tmp.grayExposure[i] =data[0]+data[1]*256; + tmp.correctColorExposure[0]=tmp.correctColorExposure[3]=tmp.colorExposure[0]=tmp.colorExposure[3]=data[2]+data[3]*256; + tmp.correctColorExposure[1]=tmp.correctColorExposure[4]=tmp.colorExposure[1]=tmp.colorExposure[4]=data[4]+data[5]*256; + tmp.correctColorExposure[2]=tmp.correctColorExposure[5]=tmp.colorExposure[2]=tmp.colorExposure[5]=data[6]+data[7]*256; + for(int i=0;i<6;i++) + tmp.colorGain[i] =tmp.correctColorGain[i] =data[8]; + for(int i=0;i<6;i++) + tmp.colorGain[6+i] =tmp.correctColorGain[i+6] =data[9]; + for(int i=0;i<6;i++) + tmp.colorOffset[i] =tmp.correctColorOffset[i] =data[10]; + for(int i=0;i<6;i++) + tmp.colorOffset[6+i] =tmp.correctColorOffset[i+6] =data[11]; + for(int i=0;i<6;i++) + tmp.grayGain[i] =tmp.correctGrayGain[i] =data[12]; + for(int i=0;i<6;i++) + tmp.grayGain[6+i] =tmp.correctGrayGain[i+6] =data[13]; + for(int i=0;i<6;i++) + tmp.grayOffset[i] =tmp.correctGrayOffset[i] =data[14]; + for(int i=0;i<6;i++) + tmp.grayOffset[6+i] =tmp.correctGrayOffset[i+6] =data[15]; + return tmp; +} + +void GScanO200::Scanner_StartScan(int count) +{ + is_flat =false; + std::cout<<"Scanner_StartScan "<is_connected()) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + } + if (m_aquirethread.get() && m_aquirethread->joinable()) + { + m_aquirethread->join(); + } + std::lock_guard lck(m_imgLocker); + devState = DEV_RUNNING; + m_pImages->setscanflags(true); + USBCB usbcb = {START_COMMAND, (UINT32)count, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + std::cout << "usb send scanner start scan command\n" << std::endl; + m_threadUsb.reset(new std::thread(&GScanO200::usbmain, this)); + m_pImages->run(); + //m_aquirethread.reset(new std::thread(&GScanO200::aquirethreadfunc,this)); + + std::cout<<"scanner start"<is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {STOP, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +void GScanO200::ResetScanner() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {INIT_HARDWARE_SYS, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +bool GScanO200::Get_IsImageQueueEmpty() +{ + return m_pImages->empty(); +} + +void GScanO200::reset() +{ + while (!m_pImages->empty()) + m_pImages->clear(); +} + +void GScanO200::setdecodepixtype(int twpixtype) +{ +} + +UINT32 GScanO200::get_ErrorCode() +{ + return Error_Code; +} + +void GScanO200::Set_ErrorCode(UINT32 value) +{ + Error_Code = value; +} + +int GScanO200::get_scanned_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_SCANN_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +int GScanO200::get_roller_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_ROLLER_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +void GScanO200::clr_roller_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {CLR_ROLLER_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +int GScanO200::get_sleep_time() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_SLEEP_TIME, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +void GScanO200::set_sleep_time(int time) +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {SET_SLEEP_TIME, (unsigned int)time, 0}; +} + +BOOL GScanO200::clr_hardware_cache() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {0x40, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + uchar ret[4] = {0, 0, 0, 0}; + m_usb->read_bulk(ret, 4); + return ret[0]; +} + +void GScanO200::StartFlat(bool iscolor) +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return ; + is_flat=true; + std::lock_guard lck(m_imgLocker); + uint data =iscolor?0x60:0x40; + USBCB usbcb = {START_FLAT,data,0}; + m_usb->write_bulk(&usbcb,sizeof(USBCB)); + if (m_threadUsb&&m_threadUsb->joinable()) { + devState = DEV_STOP; + m_threadUsb->join(); + } + devState = DEV_RUNNING; + m_threadUsb.reset(new std::thread(&GScanO200::usbmain, this)); +} + +void GScanO200::on_usbcallback(int conditioncode, void *usrdata) +{ + GScanO200 *This = (GScanO200 *)usrdata; + This->onusbcallback(conditioncode); +} + +void GScanO200::onusbcallback(int conditioncode) +{ + std::cout<<"GScanO200::onusbcallback "<> imgData; + devState = DEV_RUNNING; + bool haveError = false; + StopWatch sw; + while (devState == DEV_RUNNING) + { + if (!m_usb->is_connected()) + { + this_thread::sleep_for(chrono::milliseconds(200)); + continue; + } + if (sw.elapsed_ms() > 30000) + { + m_pImages->setscanflags(false); + //devState = haveError ? DevState::DEV_WRONG : DevState::DEV_STOP; + devState = DEV_WRONG; + Set_ErrorCode(HARDWARE_ERROR); + std::cout << "usb commnication error\n" << std::endl; + return; + } + USBCB usbcb = Get_Scanner_Status(); + switch (usbcb.u32_Data) + { + case HAVE_IMAGE: + { + //while (m_pImages->orginimgcount()>4) { + // this_thread::sleep_for(chrono::milliseconds(20)); + //} + int totalNum = usbcb.u32_Count; + m_usb->set_timeout((cap.paperSize==TwSS::MaxSize||cap.paperSize==TwSS::USStatement)?3000:1500); + imgData = Get_Img_Data(totalNum); + m_usb->set_timeout(200); + if (!imgData->size()) + { + Stop_scan(); + } + + m_pImages->pushMat(std::shared_ptr(new G200Decode(imgData))); + static int rawdataindex = 0; + LOG("Enquque rawbuffer index =%d \n",++rawdataindex); + Pop_Image(); + if(is_flat) + { + USBCB cmd={STOP_FLAT,0,0}; + m_usb->write_bulk(&cmd,sizeof(USBCB)); + m_pImages->setscanflags(false); + devState =DEV_STOP; + this_thread::sleep_for(chrono::milliseconds(3000)); + m_flatcallback("У",true); + break; + } + if((cap.paperSize==TwSS::MaxSize||cap.paperSize==TwSS::USStatement)) + this_thread::sleep_for(std::chrono::milliseconds(1000)); + sw.reset(); + break; + } + case STOP_SCAN: + m_pImages->setscanflags(false); + LOG("Stop Scan\n"); + devState = DEV_STOP; + break; + case COUNT_MODE: + case NO_FEED: + case OPEN_COVER: + case FEED_IN_ERROR: + case PAPER_JAM: + case DETECT_DOUBLE_FEED: + case DETECT_STAPLE: + case PAPER_SKEW: + case HARDWARE_ERROR: + case PC_SCAN_BUSY_or_ERROR: + if(!haveError) + { + haveError=true; + Set_ErrorCode(usbcb.u32_Data); + m_pImages->setscanflags(false); + devState = DEV_WRONG; + LOG("have error\n"); + } + break; + case NORMAL: + break; + default: + break; + } + this_thread::sleep_for(chrono::milliseconds(10)); + } +} + +/////////////////////////////////////////////////////////////////////////// +USBCB GScanO200::Get_Scanner_Status() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + { + return {NO_COMMAND, PC_SCAN_BUSY_or_ERROR, 0}; + } + USBCB usbcb = {GET_DSP_STATUS, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb; +} + +void GScanO200::aquirethreadfunc() +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + if (m_imagecallback) + m_imagecallback(nullptr, 0, get_ErrorCode()); + } + else + { + if (m_imagecallback) + m_imagecallback(nullptr, 0, -1); + } + } + break; + } + else + { + if (m_pImages->valid()) + { + auto ret = m_pImages->popimage(); + cv::Mat mat = ret.mat.clone(); + int bppinfo = ret.Bpp; + sw.reset(); + if (m_imagecallback) + m_imagecallback(&mat, bppinfo, 0); + } + this_thread::sleep_for(chrono::milliseconds(1)); + continue; + } + +// if (sw.elapsed_s() > 25.00) +// { +// if (m_threadUsb && m_threadUsb->joinable()) +// { +// devState = DEV_STOP; +// m_threadUsb->join(); +// m_threadUsb.reset(); +// } +// Stop_scan(); //ֹͣɨ�� +// ResetScanner(); +// if (m_imagecallback) +// m_imagecallback(nullptr, 0, HARDWARE_ERROR); +// break; +// } + } +} + +std::shared_ptr> GScanO200::Get_Img_Data(int bufferSize) +{ + std::shared_ptr> imData(new std::vector(bufferSize)); + if (!m_usb.get()&&!m_usb->is_connected()) + return imData; + StopWatch sw; + int readed = 0; + while (readed < bufferSize && sw.elapsed_ms() < 3000) + { + USBCB usbcb = {GET_IMAGE, 0, (UINT32)bufferSize}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + readed = m_usb->read_bulk(imData->data(), bufferSize); + LOG("read_bulk nread data length = %d\n",readed); + } + + if (sw.elapsed_ms() > 3000) + { + LOG("read usb image data timeout\n"); + } + + return imData; +} + +/////////////////////////////////////////////////////////////////////////// +void GScanO200::Pop_Image() +{ + if (!m_usb.get()&&!m_usb->is_open()) + return; + + USBCB usbcb = {POP_IMAGE, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} +void GScanO200::GetExpose(int& Aside, int& Bside) +{ + +} +void GScanO200::SetExpose(int aside, int bside) +{ + +} + +void GScanO200::GetSptime(int type, int& time) +{ + +} +void GScanO200::SetSptime(int type, int time) +{ + +} + +void GScanO200::GetSleepTime(int& sleeptime) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB usb = { GET_SLEEP_TIME,0,0 }; + m_usb->write_bulk(&usb, sizeof(usb)); + m_usb->read_bulk(&usb, sizeof(usb)); + switch (usb.u32_Data) { + case 0: + sleeptime= -1; + break; + case 1: + sleeptime = 300; + break; + case 2: + sleeptime =600; + break; + case 3: + sleeptime=1200; + break; + case 4: + sleeptime = 1800; + break; + case 5: + sleeptime =3600; + break; + case 6: + sleeptime =7200; + break; + case 7: + sleeptime = 14400; + break; + default: + sleeptime=0; + break; + } + } +} +void GScanO200::SetSleepTime(int sleeptime) +{ + uint data; + if(sleeptime<0) + data=0; + else if(sleeptime>=0 && sleeptime <=300) + data=1; + else if(sleeptime >300 && sleeptime <=600) + data=2; + else if(sleeptime >600 && sleeptime <=1200) + data =3; + else if(sleeptime >1200 && sleeptime <=1800) + data=4; + else if(sleeptime >1800 && sleeptime <=3600) + data =5; + else if(sleeptime >3600 && sleeptime <=7200) + data=6; + else + data=7; + + if (m_usb.get() && m_usb->is_connected()) + { + USBCB usb = { SET_SLEEP_TIME,data,0 }; + m_usb->write_bulk(&usb, sizeof(usb)); + } +} + +void GScanO200::GetSpeedMode(int& speedmode, bool get) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB speed = { get ? GET_SPEED_MODE:SET_SPEED_MODE,(uint)speedmode,4 }; + m_usb->write_bulk(&speed, sizeof(speed)); + if (get) + { + m_usb->read_bulk(&speed, sizeof(speed)); + speedmode = speed.u32_Data; + } + } +} +void GScanO200::GetOrSetVIDPID(int& value, bool get) +{ + +} + +std::string GScanO200::GetSysInfo() +{ + return "no support"; +} + +void GScanO200::GetFlatMaxBright(bool iscolor, unsigned int& val) +{ +} + +void GScanO200::SetFlatMaxBright(bool iscolor, unsigned int val) +{ +} diff --git a/hgdev/GScanO200.h b/hgdev/GScanO200.h new file mode 100644 index 0000000..8f6ec2f --- /dev/null +++ b/hgdev/GScanO200.h @@ -0,0 +1,92 @@ +#ifndef G_SCAN_O_200_H +#define G_SCAN_O_200_H + +#include +#include "GScan.h" +#include +#include + + + +class GScanO200 : public IGScan +{ +public: + GScanO200(); + virtual ~GScanO200(); + //virtual std::vector findallusb() override; + + virtual void open(int vid = 0x3072, int pid = 0x0200) override; + virtual bool close() override; + virtual bool is_open() override; + virtual void setusbreport_callback(usbreport_callback callback,void* usrdata) override; + virtual void setonimage_callback(onimagecallback aqrcallback) override; + virtual int get_image_front_info(ImageInfo* info) override; + virtual int aquire_image(cv::Mat& mat, int& bppinfo) override; + virtual int aquire_image(std::vector& imgdata,int & bppinfo,int & width,int & height) override; + virtual void SetSerialNum(std::string serial) override; + virtual BOOL IsConnected() override; + virtual std::string GetFWVersion() override; + virtual std::string GetSerialNum() override; + virtual bool is_scan() override; + virtual BOOL Get_Scanner_PaperOn() override; + virtual void config_params(GScanCap& params) override; + virtual void Scanner_StartScan(int count) override; + virtual void Stop_scan() override; + virtual void ResetScanner() override; + virtual bool Get_IsImageQueueEmpty() override; + + virtual void reset() override; + virtual void setdecodepixtype(int twpixtype) override; + virtual UINT32 get_ErrorCode() override; + virtual void Set_ErrorCode(UINT32 value) override; + virtual int get_scanned_num() override; + + virtual int get_roller_num() override; + virtual void clr_roller_num() override; + virtual int get_sleep_time() override; + virtual void set_sleep_time(int time) override; + virtual BOOL clr_hardware_cache() override; + + virtual std::string GetMbVersion() override; + virtual std::string GetIpAddr() override ; + virtual std::string GetKernelVersion() override ; + virtual void SetRatio(int tyepe, int ration) override; + virtual void GetRatio(int type, int& ratio) override; + virtual void Reboot() override; + virtual void PowerOff() override; + virtual void SendFlatData(CorrectParam param, int index) override; + virtual CaptureParams GetFlatData() override; + virtual void StartFlat(bool iscolor) override; + virtual void GetExpose(int& Aside, int& Bside) override; + virtual void SetExpose(int aside, int bside) override; + virtual void GetSptime(int type, int& time) override; + virtual void SetSptime(int type, int time) override; + virtual void GetSleepTime(int& sleeptime) override; + virtual void SetSleepTime(int sleeptime) override; + + virtual void GetFlatMaxBright(bool iscolor, unsigned int& val) override; + virtual void SetFlatMaxBright(bool iscolor, unsigned int val) override; + virtual bool Updata(std::string filename, std::function func)override; + virtual void GetSpeedMode(int& speedmode,bool get) override ; + virtual void GetOrSetVIDPID(int& value, bool get) override; + virtual std::string GetSysInfo() override; + virtual void setserial(ScannerSerial serial) override; + +private: + static void on_usbcallback(int conditoncode, void* usrdata); + void onusbcallback(int conditoncode); + void usbmain(); + USBCB Get_Scanner_Status(); + void aquirethreadfunc(); + std::shared_ptr> Get_Img_Data(int buffersize); + void Pop_Image(); + std::shared_ptr m_usb; + std::unique_ptr m_threadUsb; + std::unique_ptr m_aquirethread; + usbreport_callback m_usbreport; + onimagecallback m_imagecallback; + void* m_usrdata; + GScanCap cap; + std::vector m_usbsname; +}; +#endif //!G_SCAN_O_200_H diff --git a/hgdev/GScanO400.cpp b/hgdev/GScanO400.cpp new file mode 100644 index 0000000..821726c --- /dev/null +++ b/hgdev/GScanO400.cpp @@ -0,0 +1,1020 @@ +#include "predefine.h" +#include "GScanO400.h" +#ifdef WIN32 +#include "UsbScanEx.h" +#else +#include "libusbex.h" +#endif +#include "StopWatch.h" +#include "ImageMatQueue.h" +#include "filetools.h" +#include "IConfig.h" +#include "G400ScanConfig.h" +#include +#include "sane_common.h" + +using namespace std; + +GScanO400::GScanO400() : m_usrdata(0), m_usbreport(0) +{ + m_serial = ScannerSerial::G400Serial; +} + +GScanO400::~GScanO400() +{ + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + + if(m_aquirethread.get()&&m_aquirethread->joinable()) + { + m_aquirethread->join(); + m_aquirethread.reset(); + } + + if(m_usb.get()) + m_usb.reset(); + std::cout<<"1"< GScanO400::findallusb() +//{ +// //auto usbs = Libusb_List::find_all(); +// //if(usbs.size()!=0) +// //{ +// +// //} +//} + +void GScanO400::open(int vid, int pid) +{ +#ifdef WIN32 + auto usbold = UsbScan_List::find_vid_pid(0x064b, 0x7823); + + if (usbold.empty()) { + auto usbs = UsbScan_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + m_usb = *usbs.begin(); + m_usb->set_usbcallback(&GScanO400::on_usbcallback, this); + auto ret = m_usb->open(); + } + } + else + { + m_usb = *usbold.begin(); + m_usb->set_usbcallback(&GScanO400::on_usbcallback, this); + auto ret = m_usb->open(); + } + +#else // WIN32 + auto usbs = Libusb_List::find_vid_pid(vid, pid); + if (!usbs.empty()) + { + if(!m_usb.get()) + { + m_usb = *usbs.begin(); + auto ret=m_usb->open(); + if(!ret) + LOG("GScanO400 open usb failed\n"); + m_usb->set_usbcallback(&GScanO400::on_usbcallback, this); + } + } +#endif +} + +void GScanO400::setserial(ScannerSerial serial) +{ + m_serial = serial; + m_pImages->Setserial(serial); +} + +bool GScanO400::close() +{ + if(m_usb.get()&&m_usb->is_open()) + return m_usb->close(); + return false; +} + +bool GScanO400::is_open() +{ + if(m_usb.get()) + return m_usb->is_open(); + return false; +} + +void GScanO400::SetSerialNum(std::string serial) +{ + if (m_usb.get()&&m_usb->is_connected()) + { + std::lock_guard lck(m_imgLocker); + USBCB sercmd = { SEND_SERIAL ,0,14}; + m_usb->write_bulk(&sercmd, sizeof(sercmd)); + m_usb->write_bulk(&serial, serial.length()); + } +} + +void GScanO400::setusbreport_callback(usbreport_callback callback, void *usrdata) +{ + m_usbreport = callback; + m_usrdata = usrdata; +} +void GScanO400::setonimage_callback(onimagecallback aqrcallback) +{ + if (aqrcallback) + m_imagecallback = aqrcallback; + else + LOG("error on setonimage_callback ptr=%p \n", aqrcallback); +} +#ifdef LOG_NORMAL +fstream fsaquire; +static int aquiretimes = 1; +#endif // LOG + +#ifdef TWAIN +int GScanO400::aquire_bmpdata(std::vector &bmpdata) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (sw.elapsed_s() > 20.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + bmpdata = m_pImages->popBmpdata(); +#ifdef LOG_NORMAL + static int aquireindex = 0; + FileTools::write_log("out.txt", "aquire image index " + std::to_string(++aquireindex)); +#endif // LOG + return 0; + } + DoEvents(); //��ֹUI���� + this_thread::sleep_for(chrono::milliseconds(1)); + } + } +} +#else // TWAIN + +int GScanO400::get_image_front_info(ImageInfo *info) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (sw.elapsed_s() > 20.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + + if (!is_scan()) + { + *info = {0}; + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + m_pImages->get_image_front_info(info); + cout << "get real image info" << endl; +#ifdef LOG_NORMAL + static int aquireindex = 0; + FileTools::write_log("out.txt", "aquire image index " + std::to_string(++aquireindex)); +#endif // LOG + return 0; + } +#ifdef WIN32 + DoEvents(); //��ֹUI���� +#endif // WIN32 + this_thread::sleep_for(chrono::milliseconds(1)); + } + } + //m_pImages->get_image_front_info(info); +} + +int GScanO400::aquire_image(std::vector &imgdata, int &bppinfo, int &width, int &height) +{ + cv::Mat tmp; + int ret= aquire_image(tmp,bppinfo); + if(tmp.empty()) + return ret; + width = tmp.cols; + height = tmp.rows; + if(tmp.channels()==3) + cv::cvtColor(tmp,tmp,cv::COLOR_BGR2RGB); + imgdata = tmp.reshape(1,tmp.cols*tmp.rows*tmp.channels()); + return ret; +} + +int GScanO400::aquire_image(cv::Mat &mat, int &bppinfo) +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + return get_ErrorCode(); + } + return -1; + } + } + else + { + if (m_pImages->valid()) + { + auto ret = m_pImages->popimage(); + mat = ret.mat.clone(); + bppinfo = ret.Bpp; +#ifdef LOG_NORMAL + static int aquireindex = 0; + FileTools::write_log("out.txt", "aquire image index " + std::to_string(++aquireindex)); +#endif // LOG + return 0; + } +#ifdef WIN32 + DoEvents(); //��ֹUI���� +#endif // WIN32 + this_thread::sleep_for(chrono::milliseconds(1)); + } + + if (sw.elapsed_s() > 25.00) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + m_threadUsb.reset(); + } + Stop_scan(); //ֹͣɨ�� + ResetScanner(); + return HARDWARE_ERROR; + } + } +} +#endif + +BOOL GScanO400::IsConnected() +{ + return m_usb && m_usb->is_connected(); +} + + std::string GScanO400::GetFWVersion() + { + if (m_usb.get()&& m_usb->is_connected()) + { + lock_guard lock(m_imgLocker); + uint length=10; + fwVersion.resize(length); + USBCB cmd = { + GET_FW_VERSION, + length, + 0, + }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + m_usb->read_bulk(&fwVersion[0], length); + return fwVersion; + } + return ""; + } + + std::string GScanO400::GetSerialNum() + { + if (m_usb->is_connected()) + { + std::lock_guard lck(m_imgLocker); + uint length =14; + SerialNum.resize(length); + USBCB usbcb = {GET_SERIAL, length, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&SerialNum[0], length); + return SerialNum; + } + return ""; + } + +bool GScanO400::is_scan() +{ + //std::lock_guard lck(m_imgLocker); + return devState == DEV_RUNNING; +} + +BOOL GScanO400::Get_Scanner_PaperOn() +{ + if (!m_usb.get()&&!m_usb->is_open()) + return false; + USBCB usbcb = {GET_PAPERFEEDER_STATUS, 0, 0}; + std::lock_guard lck(m_imgLocker); + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data != 0; +} + +void GScanO400::config_params(GScanCap& params) +{ + params.resolution_native = 200; + if (m_usb.get()&&m_usb->is_connected()) + { + cap=params; + G400ScanConfig cfg = G400ScanConfig(params,m_serial); + UINT32 cfgdata = cfg.GetData(); + USBCB usbcb = {CONFIGURED_DATA, cfgdata, 0}; + m_usb->write_bulk(&usbcb, sizeof(USBCB)); + m_pImages->setparam(params); + std::cout << "Config Params" << std::endl; + } +} + +void GScanO400::Scanner_StartScan(int count) +{ + is_flat=false; + std::cout<<"Scanner_StartScan "<is_connected()) + { + if (m_threadUsb && m_threadUsb->joinable()) + { + devState = DEV_STOP; + m_threadUsb->join(); + } + if (m_aquirethread.get() && m_aquirethread->joinable()) + { + m_aquirethread->join(); + } + std::lock_guard lck(m_imgLocker); + devState = DEV_RUNNING; + m_pImages->setscanflags(true); + USBCB usbcb = {START_COMMAND, (UINT32)count, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + std::this_thread::sleep_for(std::chrono::milliseconds(500)); + std::cout << "usb send scanner start scan command\n" << std::endl; + m_threadUsb.reset(new std::thread(&GScanO400::usbmain, this)); + m_pImages->run(); + //m_aquirethread.reset(new std::thread(&GScanO400::aquirethreadfunc,this)); + + std::cout<<"scanner start"<is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {STOP, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +void GScanO400::ResetScanner() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {INIT_HARDWARE_SYS, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +bool GScanO400::Get_IsImageQueueEmpty() +{ + return m_pImages->empty(); +} + +void GScanO400::reset() +{ + while (!m_pImages->empty()) + m_pImages->clear(); +} + +void GScanO400::setdecodepixtype(int twpixtype) +{ +} + +UINT32 GScanO400::get_ErrorCode() +{ + return Error_Code; +} + +void GScanO400::Set_ErrorCode(UINT32 value) +{ + Error_Code = value; +} + +int GScanO400::get_scanned_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_SCANN_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +int GScanO400::get_roller_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_ROLLER_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +void GScanO400::clr_roller_num() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {CLR_ROLLER_NUM, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +int GScanO400::get_sleep_time() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {GET_SLEEP_TIME, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb.u32_Data; +} + +void GScanO400::set_sleep_time(int time) +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {SET_SLEEP_TIME, (unsigned int)time, 0}; +} + +BOOL GScanO400::clr_hardware_cache() +{ + if (!m_usb.get()&&!m_usb->is_connected()) + return -1; + std::lock_guard lck(m_imgLocker); + USBCB usbcb = {0x40, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + uchar ret[4] = {0, 0, 0, 0}; + m_usb->read_bulk(ret, 4); + return ret[0]; +} + +void GScanO400::on_usbcallback(int conditioncode, void *usrdata) +{ + GScanO400 *This = (GScanO400 *)usrdata; + This->onusbcallback(conditioncode); +} + +void GScanO400::onusbcallback(int conditioncode) +{ + std::cout<<"GScanO400::onusbcallback "<> imgData; + devState = DEV_RUNNING; + bool haveError = false; + StopWatch sw; + while (devState == DEV_RUNNING) + { + if (!m_usb->is_connected()) + { + this_thread::sleep_for(chrono::milliseconds(200)); + continue; + } + if (sw.elapsed_ms() > 30000) + { + m_pImages->setscanflags(false); + //devState = haveError ? DevState::DEV_WRONG : DevState::DEV_STOP; + devState = DEV_WRONG; + Set_ErrorCode(HARDWARE_ERROR); + std::cout << "usb commnication error\n" << std::endl; + return; + } + USBCB usbcb = Get_Scanner_Status(); + switch (usbcb.u32_Data) + { + case HAVE_IMAGE: + { + //while (m_pImages->orginimgcount()>4) { + // this_thread::sleep_for(chrono::milliseconds(20)); + //} + int totalNum = usbcb.u32_Count; + m_usb->set_timeout((cap.paperSize==TwSS::MaxSize||cap.paperSize==TwSS::USStatement)?3000:1500); + imgData = Get_Img_Data(totalNum); + m_usb->set_timeout(200); + if (!imgData->size()) + { + Stop_scan(); + } + + m_pImages->pushMat(std::shared_ptr(new G400Decode(imgData))); + static int rawdataindex = 0; + LOG("Enquque rawbuffer index =%d \n",++rawdataindex); + Pop_Image(); + if((cap.paperSize==TwSS::MaxSize||cap.paperSize==TwSS::USStatement)) + this_thread::sleep_for(std::chrono::milliseconds(1000)); + sw.reset(); + break; + } + case STOP_SCAN: + m_pImages->setscanflags(false); + LOG("Stop Scan\n"); + devState = DEV_STOP; + break; + case AUTO_FLAT_FINISHED: + { + m_pImages->setscanflags(false); + devState = DEV_STOP; + if (usbcb.u32_Count != 0) + { + std::string msg; + msg.resize(usbcb.u32_Count); + m_usb->read_bulk(&msg[0], usbcb.u32_Count); + if (m_flatcallback) + m_flatcallback(msg,true); + } + break; + } + case AUTO_FLATTING: + { + if (usbcb.u32_Count != 0) + { + std::string msg; + msg.resize(usbcb.u32_Count); + m_usb->read_bulk(&msg[0], usbcb.u32_Count); + sw.reset(); + if (m_flatcallback) + m_flatcallback(msg,false); + } + break; + } + case COUNT_MODE: + case NO_FEED: + case OPEN_COVER: + case FEED_IN_ERROR: + case PAPER_JAM: + case DETECT_DOUBLE_FEED: + case DETECT_STAPLE: + case PAPER_SKEW: + case HARDWARE_ERROR: + case PC_SCAN_BUSY_or_ERROR: + if(!haveError) + { + haveError=true; + Set_ErrorCode(usbcb.u32_Data); + m_pImages->setscanflags(false); + devState = DEV_WRONG; + LOG("have error\n"); + } + break; + case NORMAL: + break; + default: + break; + } + this_thread::sleep_for(chrono::milliseconds(20)); + } + std::cout<<"exit"< lck(m_imgLocker); + if (!m_usb.get()&&!m_usb->is_connected()) + { + return {NO_COMMAND, PC_SCAN_BUSY_or_ERROR, 0}; + } + USBCB usbcb = {GET_DSP_STATUS, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(&usbcb, sizeof(usbcb)); + return usbcb; +} + +void GScanO400::aquirethreadfunc() +{ + StopWatch sw; + while (true) + { + if (m_pImages->empty()) + { + if (!is_scan()) + { + if (devState == DEV_WRONG) + { + if (m_imagecallback) + m_imagecallback(nullptr, 0, get_ErrorCode()); + } + else + { + if (m_imagecallback) + m_imagecallback(nullptr, 0, -1); + } + } + break; + } + else + { + if (m_pImages->valid()) + { + auto ret = m_pImages->popimage(); + cv::Mat mat = ret.mat.clone(); + int bppinfo = ret.Bpp; + sw.reset(); + if (m_imagecallback) + m_imagecallback(&mat, bppinfo, 0); + } + this_thread::sleep_for(chrono::milliseconds(1)); + continue; + } + +// if (sw.elapsed_s() > 25.00) +// { +// if (m_threadUsb && m_threadUsb->joinable()) +// { +// devState = DEV_STOP; +// m_threadUsb->join(); +// m_threadUsb.reset(); +// } +// Stop_scan(); //ֹͣɨ�� +// ResetScanner(); +// if (m_imagecallback) +// m_imagecallback(nullptr, 0, HARDWARE_ERROR); +// break; +// } + } +} + +std::shared_ptr> GScanO400::Get_Img_Data(int bufferSize) +{ + std::shared_ptr> imData(new std::vector(bufferSize)); + if (!m_usb.get()&&!m_usb->is_connected()) + return imData; + StopWatch sw; + int readed = 0; + while (readed < bufferSize && sw.elapsed_ms() < 3000) + { + USBCB usbcb = {GET_IMAGE, 0, (UINT32)bufferSize}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + readed = m_usb->read_bulk(imData->data(), bufferSize); + LOG("read_bulk nread data length = %d\n",readed); + } + + if (sw.elapsed_ms() > 3000) + { + LOG("read usb image data timeout\n"); + } + + return imData; +} + +/////////////////////////////////////////////////////////////////////////// +void GScanO400::Pop_Image() +{ + if (!m_usb.get()&&!m_usb->is_open()) + return; + + USBCB usbcb = {POP_IMAGE, 0, 0}; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); +} + +std::string GScanO400::GetMbVersion() +{ + return "no support"; +} + + +std::string GScanO400::GetKernelVersion() +{ + return "un support"; +} + +std::string GScanO400::GetIpAddr() +{ + return "no support"; +} +void GScanO400::SetRatio(int tyepe, int ration) +{ + tagUsbKeyWords keyword = tyepe == 0 ? SET_JUST_COF_H : SET_JUST_COF_V; + USBCB cmd = { keyword ,(uint)ration,0}; + m_usb->write_bulk(&cmd, sizeof(cmd)); +} + +void GScanO400::GetRatio(int type, int& ratio) +{ + tagUsbKeyWords keyword = type == 0 ? GET_JUST_COF_H : GET_JUST_COF_V; + USBCB cmd = { keyword ,0,0 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + m_usb->read_bulk(&cmd, sizeof(cmd)); + ratio = cmd.u32_Data; +} + +void GScanO400::Reboot() +{ + USBCB cmd = { REBOOT,0,0 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); +} + +void GScanO400::PowerOff(){} + + +void GScanO400::SendFlatData(CorrectParam param, int index) +{ + UsbKeyWords keyword; + switch (index) + { + case 0: + keyword = SEND_COLORCORRECT_FLAT; + break; + case 1: + keyword = SEND_COLOR_FLAT; + break; + case 2: + keyword = SEND_GRAYCORRECT_FLAT; + break; + case 3: + keyword = SEND_GRAY_FLAT; + break; + default: + break; + } + USBCB cmd = { keyword ,0,0 }; + m_usb->write_bulk(&cmd, sizeof(cmd)); + m_usb->write_bulk(¶m, sizeof(param)); +} + +CaptureParams GScanO400::GetFlatData() +{ + CaptureParams param = {0}; + USBCB usbcb = { GET_FLAT_DATA,0,0 }; + DWORD transfer; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + m_usb->read_bulk(¶m, sizeof(param)); + return param; +} + +void GScanO400::StartFlat(bool iscolor) +{ + if (!m_usb->is_connected()) + return; + is_flat=true; + USBCB usbcb = { START_FLAT,0,0 }; + DWORD transfer; + m_usb->write_bulk(&usbcb, sizeof(usbcb)); + if (m_threadUsb&&m_threadUsb->joinable()) { + devState = DEV_STOP; + m_threadUsb->join(); + } + devState = DEV_RUNNING; + m_threadUsb.reset(new std::thread(&GScanO400::usbmain, this)); +} + +void GScanO400::GetExpose(int& Aside, int& Bside) +{ + USBCB asideexp = { GET_UV_EXPOSA,0,0 }; + m_usb->write_bulk(&asideexp, sizeof(asideexp)); + m_usb->read_bulk(&asideexp, sizeof(asideexp)); + Aside = asideexp.u32_Data; + USBCB bsideexp = { GET_UV_EXPOSB,0,0 }; + m_usb->write_bulk(&bsideexp, sizeof(asideexp)); + m_usb->read_bulk(&bsideexp, sizeof(asideexp)); + Bside = bsideexp.u32_Data; + +} + +void GScanO400::SetExpose(int aside, int bside) +{ + USBCB asideexp = { SET_UV_EXPOSA,(uint)aside,0 }; + m_usb->write_bulk(&asideexp, sizeof(asideexp)); + USBCB bsideexp = { SET_UV_EXPOSB,(uint)bside,0 }; + m_usb->write_bulk(&bsideexp, sizeof(bsideexp)); + +} + +void GScanO400::GetSptime(int type, int& time) +{ + USBCB usb = {0,0,0}; + switch (type) + { + case 0: + usb.u32_CMD = 0x100;//GET_GRAY_SP + break; + case 1: + usb.u32_CMD = 0x102;//GET_COLOR_SP + break; + case 2: + usb.u32_CMD = 0x104;//GET_UV_SP + break; + default: + break; + } + m_usb->write_bulk(&usb, sizeof(usb)); + m_usb->read_bulk(&usb, sizeof(usb)); + time = usb.u32_Data; +} + +void GScanO400::SetSptime(int type, int time) +{ + USBCB usb = { 0,uint(time),0 }; + switch (type) + { + case 0: + usb.u32_CMD = 0x101;//GET_GRAY_SP + break; + case 1: + usb.u32_CMD = 0x103;//GET_COLOR_SP + break; + case 2: + usb.u32_CMD = 0x105;//GET_UV_SP + break; + default: + break; + } + m_usb->write_bulk(&usb, sizeof(usb)); +} +void GScanO400::GetSleepTime(int& sleeptime) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB usb = { GET_SLEEP_TIME,0,0 }; + m_usb->write_bulk(&usb, sizeof(usb)); + m_usb->read_bulk(&usb, sizeof(usb)); + sleeptime=usb.u32_Data; + } +} + +void GScanO400::SetSleepTime(int sleeptime) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB usb = { SET_SLEEP_TIME,(uint)sleeptime,0 }; + m_usb->write_bulk(&usb, sizeof(usb)); + } +} + + +void GScanO400::GetSpeedMode(int& speedmode, bool get) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB speed = { get ? GET_SPEED_MODE:SET_SPEED_MODE,(uint)speedmode,0 }; + m_usb->write_bulk(&speed, sizeof(speed)); + if (get) + { + m_usb->read_bulk(&speed, sizeof(speed)); + speedmode = speed.u32_Data; + } + } +} + +void GScanO400::GetOrSetVIDPID(int& value, bool get) +{ + if (m_usb.get() && m_usb->is_connected()) + { + USBCB u_cmd = { get ? GET_USB_INFOR_VIDPID : SET_USB_INFOR_VIDPID,(uint)value,0 }; + m_usb->write_bulk(&u_cmd, sizeof(u_cmd)); + if (get) + { + m_usb->read_bulk(&u_cmd, sizeof(u_cmd)); + value = u_cmd.u32_Data; + } + } +} + +std::string GScanO400::GetSysInfo() +{ + return "no support"; +} +void GScanO400::GetFlatMaxBright(bool iscolor, unsigned int& val) +{ +} + +void GScanO400::SetFlatMaxBright(bool iscolor, unsigned int val) +{ +} + +bool GScanO400::Updata(std::string filename, std::function func) +{ + std::ifstream updatefile; + updatefile.open(filename, std::ios_base::in | std::ios_base::binary); + if (!updatefile.is_open()) + { + return false; + } + updatefile.seekg(0, std::ios::end); + size_t length = updatefile.tellg(); + func(0, length); + updatefile.seekg(0, std::ios::beg); + USBCB pre_update = { PRE_UPGRADE,0,(uint32_t)length }; + m_usb->write_bulk(&pre_update, sizeof(pre_update)); + size_t nreaded = 0; + size_t nleft = length; + int buffersize = 1024 * 1024; + if (length <= buffersize)//С1MB + { + char* uotstream = new char[length]; + USBCB update = { START_UPGRADE,0,(uint32_t)length }; + m_usb->write_bulk(&update, sizeof(update)); + updatefile.read(uotstream, length); + m_usb->write_bulk(uotstream, length); + m_usb->read_bulk(&update, sizeof(update)); + delete[] uotstream; + if (update.u32_Count != length) + { + return false; + } + else + { + func(update.u32_Count, length); + } + } + else + { + while (true) + { + int ntotransfer; + if (nleft < buffersize) + ntotransfer = nleft; + else + ntotransfer = buffersize; + USBCB update = { START_UPGRADE,0,(uint)ntotransfer }; + m_usb->write_bulk(&update, sizeof(update)); + std::vector data; + data.resize(ntotransfer); + updatefile.read(data.data(), ntotransfer); + m_usb->write_bulk(data.data(), ntotransfer); + m_usb->read_bulk(&update, sizeof(update)); + nreaded += ntotransfer; + nleft -= ntotransfer; + func(nreaded, length); + if (nreaded >= length) + break; + this_thread::sleep_for(std::chrono::milliseconds(10)); + } + } + + USBCB updatefinished = { UPDATE_FINISHED,0,0 }; + m_usb->write_bulk(&updatefinished, sizeof(updatefinished)); + return true; +} diff --git a/hgdev/GScanO400.h b/hgdev/GScanO400.h new file mode 100644 index 0000000..bb5dbac --- /dev/null +++ b/hgdev/GScanO400.h @@ -0,0 +1,94 @@ +#ifndef G_SCAN_O_400_H +#define G_SCAN_O_400_H + +#include +#include "GScan.h" +#include +#include + + + +class GScanO400 : public IGScan +{ +public: + GScanO400(); + virtual ~GScanO400(); + //virtual std::vector findallusb() override; + + virtual void open(int vid = 0x3072, int pid = 0x0200) override; + virtual bool close() override; + virtual bool is_open() override; + virtual void setusbreport_callback(usbreport_callback callback,void* usrdata) override; + virtual void setonimage_callback(onimagecallback aqrcallback) override; + virtual int get_image_front_info(ImageInfo* info) override; + virtual int aquire_image(cv::Mat& mat, int& bppinfo) override; + virtual int aquire_image(std::vector& imgdata,int & bppinfo,int & width,int & height) override; + virtual BOOL IsConnected() override; + virtual std::string GetFWVersion() override; + virtual std::string GetSerialNum() override; + virtual void SetSerialNum(std::string serial) override; + virtual bool is_scan() override; + virtual BOOL Get_Scanner_PaperOn() override; + virtual void config_params(GScanCap& params) override; + virtual void Scanner_StartScan(int count) override; + virtual void Stop_scan() override; + virtual void ResetScanner() override; + virtual bool Get_IsImageQueueEmpty() override; + + virtual void reset() override; + virtual void setdecodepixtype(int twpixtype) override; + virtual UINT32 get_ErrorCode() override; + virtual void Set_ErrorCode(UINT32 value) override; + virtual int get_scanned_num() override; + + virtual int get_roller_num() override; + virtual void clr_roller_num() override; + virtual int get_sleep_time() override; + virtual void set_sleep_time(int time) override; + virtual BOOL clr_hardware_cache() override; + + virtual std::string GetMbVersion() override; + virtual std::string GetIpAddr() override ; + virtual std::string GetKernelVersion() override ; + virtual void SetRatio(int tyepe, int ration) override; + virtual void GetRatio(int type, int& ratio) override; + virtual void Reboot() override; + virtual void PowerOff() override; + virtual void SendFlatData(CorrectParam param, int index) override; + virtual CaptureParams GetFlatData() override; + virtual void StartFlat(bool iscolor) override; + + virtual void GetExpose(int& Aside, int& Bside) override; + virtual void SetExpose(int aside, int bside) override; + virtual void GetSptime(int type, int& time) override; + virtual void SetSptime(int type, int time) override; + virtual void GetSleepTime(int& sleeptime) override; + virtual void SetSleepTime(int sleeptime) override; + + virtual void GetFlatMaxBright(bool iscolor, unsigned int& val) override; + virtual void SetFlatMaxBright(bool iscolor, unsigned int val) override; + virtual bool Updata(std::string filename, std::function func)override; + virtual void GetSpeedMode(int& speedmode,bool get) override ; + virtual void GetOrSetVIDPID(int& value, bool get) override; + virtual std::string GetSysInfo() override; + virtual void setserial(ScannerSerial serial) override; + +private: + static void on_usbcallback(int conditoncode, void* usrdata); + void onusbcallback(int conditoncode); + void usbmain(); + USBCB Get_Scanner_Status(); + void aquirethreadfunc(); + std::shared_ptr> Get_Img_Data(int buffersize); + void Pop_Image(); + std::shared_ptr m_usb; + + std::unique_ptr m_threadUsb; + std::unique_ptr m_aquirethread; + usbreport_callback m_usbreport; + onimagecallback m_imagecallback; + void* m_usrdata; + GScanCap cap; + std::vector m_usbsname; +}; +#endif //!G_SCAN_O_200_H diff --git a/hgdev/IConfig.h b/hgdev/IConfig.h new file mode 100644 index 0000000..4dbd357 --- /dev/null +++ b/hgdev/IConfig.h @@ -0,0 +1,196 @@ +#ifndef ICONFIG_H +#define ICONFIG_H + // !ICONFIG_H +#include "predefine.h" +#include +#include "PaperSize.h" + +#ifndef unix + //typedef char byte; +#endif + +enum G400_PaperSize { + G400_A3 = 0, + G400_A4, + G400_A4R, + G400_A5, + G400_A5R, + G400_A6, + G400_A6R, + G400_B4, + G400_B5, + G400_B5R, + G400_B6, + G400_B6R, + G400_DOUBLELETTER, + G400_LEGAL, + G400_LETTER, + G400_LETTERR, + G400_LONGLETTER, + G400_MAXSIZE +}; + +enum G400_DPI { + G400_D300 = 0, + G400_D200, + G400_D600 +}; + +static std::map SupPixelTypes = { + {0, 0},//bw + {1, 0},//gray + {2, 1}//color +}; + +static std::map SupResolutions = { + {300.0f, 0}, + {200.0f, 1}, + {600.0f, 2} +}; + + +static std::map secrewMaps = { + {1,0}, + {2,1}, + {3,2}, + {4,3}, + {5,4} +}; +typedef union Config_Param { + unsigned int value; + struct { + unsigned int paper : 5; + unsigned int color : 1; + unsigned int dpi : 2; + unsigned int double_feed_enbale : 1; + unsigned int stable_enbale : 1; + unsigned int screw_detect_enable : 1; + unsigned int screw_detect_level : 3; + unsigned int unused_one : 6; + unsigned int pc_correct : 1; + unsigned int unused_two : 11; + }; +} ConfigParam; + +static std::map SupPaperTyps_G100 +{ + {{TwSS::A3,PaperAlign::Rot0},0}, + {{TwSS::A4,PaperAlign::Rot0},1}, + {{TwSS::A4,PaperAlign::Rot270},2}, + {{TwSS::A5,PaperAlign::Rot0 },2}, + {{TwSS::A5,PaperAlign::Rot270},2}, + {{TwSS::A6,PaperAlign::Rot0},2}, + {{TwSS::A6,PaperAlign::Rot270},2}, + {{TwSS::B4,PaperAlign::Rot0},0}, + {{TwSS::B5,PaperAlign::Rot0},0}, + {{TwSS::B5,PaperAlign::Rot270},1}, + {{TwSS::B6,PaperAlign::Rot0},2}, + {{TwSS::B6,PaperAlign::Rot270},2}, + {{TwSS::USLetter,PaperAlign::Rot0},1}, + {{TwSS::USLetter,PaperAlign::Rot270},2}, + {{TwSS::USLedger,PaperAlign::Rot0},0}, + {{TwSS::USLegal,PaperAlign::Rot0},0}, + {{TwSS::None,PaperAlign::Rot0},0}, + {{TwSS::USStatement,PaperAlign::Rot0},16}, + {{TwSS::MaxSize,PaperAlign::Rot0},16} +}; + +static std::map SupPaperTyps_G300 +{ + {{TwSS::A4,PaperAlign::Rot270},G400_A4R}, + {{TwSS::A5,PaperAlign::Rot0 },G400_A5}, + {{TwSS::A5,PaperAlign::Rot270},G400_A5R}, + {{TwSS::A6,PaperAlign::Rot0},G400_A6}, + {{TwSS::A6,PaperAlign::Rot270},G400_A6R}, + {{TwSS::B5,PaperAlign::Rot0},G400_B5}, + {{TwSS::B5,PaperAlign::Rot270},G400_B5R}, + {{TwSS::B6,PaperAlign::Rot0},G400_B6}, + {{TwSS::B6,PaperAlign::Rot270},G400_B6R}, + {{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER}, + {{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR}, + {{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL}, + {{TwSS::None,PaperAlign::Rot0},G400_A4}, +}; + +static std::map SupPaperTyps_G400 +{ + {{TwSS::A3,PaperAlign::Rot0},G400_A3}, + {{TwSS::A4,PaperAlign::Rot0},G400_A4}, + {{TwSS::A4,PaperAlign::Rot270},G400_A4R}, + {{TwSS::A5,PaperAlign::Rot0 },G400_A5}, + {{TwSS::A5,PaperAlign::Rot270},G400_A5R}, + {{TwSS::A6,PaperAlign::Rot0},G400_A6}, + {{TwSS::A6,PaperAlign::Rot270},G400_A6R}, + {{TwSS::B4,PaperAlign::Rot0},G400_B4}, + {{TwSS::B5,PaperAlign::Rot0},G400_B5}, + {{TwSS::B5,PaperAlign::Rot270},G400_B5R}, + {{TwSS::B6,PaperAlign::Rot0},G400_B6}, + {{TwSS::B6,PaperAlign::Rot270},G400_B6R}, + {{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER}, + {{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR}, + {{TwSS::USLedger,PaperAlign::Rot0},G400_DOUBLELETTER}, + {{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL}, + {{TwSS::None,PaperAlign::Rot0},G400_A3}, + {{TwSS::MaxSize,PaperAlign::Rot0},G400_MAXSIZE}, + {{TwSS::USStatement,PaperAlign::Rot0},G400_MAXSIZE} +}; + + +// static std::map SupPaperTyps = { +// #ifdef G200SCANNER +// {{TwSS::A3,PaperAlign::Rot0},0}, +// {{TwSS::A4,PaperAlign::Rot0},1}, +// {{TwSS::A4,PaperAlign::Rot270},2}, +// {{TwSS::A5,PaperAlign::Rot0 },2}, +// {{TwSS::A5,PaperAlign::Rot270},2}, +// {{TwSS::A6,PaperAlign::Rot0},2}, +// {{TwSS::A6,PaperAlign::Rot270},2}, +// {{TwSS::B4,PaperAlign::Rot0},0}, +// {{TwSS::B5,PaperAlign::Rot0},0}, +// {{TwSS::B5,PaperAlign::Rot270},1}, +// {{TwSS::B6,PaperAlign::Rot0},2}, +// {{TwSS::B6,PaperAlign::Rot270},2}, +// {{TwSS::USLetter,PaperAlign::Rot0},1}, +// {{TwSS::USLetter,PaperAlign::Rot270},2}, +// {{TwSS::USLedger,PaperAlign::Rot0},0}, +// {{TwSS::USLegal,PaperAlign::Rot0},0}, +// {{TwSS::None,PaperAlign::Rot0},0}, +// {{TwSS::USStatement,PaperAlign::Rot0},16}, +// {{TwSS::MaxSize,PaperAlign::Rot0},16} +// #else +// {{TwSS::A3,PaperAlign::Rot0},G400_A3}, +// {{TwSS::A4,PaperAlign::Rot0},G400_A4}, +// {{TwSS::A4,PaperAlign::Rot270},G400_A4R}, +// {{TwSS::A5,PaperAlign::Rot0 },G400_A5}, +// {{TwSS::A5,PaperAlign::Rot270},G400_A5R}, +// {{TwSS::A6,PaperAlign::Rot0},G400_A6}, +// {{TwSS::A6,PaperAlign::Rot270},G400_A6R}, +// {{TwSS::B4,PaperAlign::Rot0},G400_B4}, +// {{TwSS::B5,PaperAlign::Rot0},G400_B5}, +// {{TwSS::B5,PaperAlign::Rot270},G400_B5R}, +// {{TwSS::B6,PaperAlign::Rot0},G400_B6}, +// {{TwSS::B6,PaperAlign::Rot270},G400_B6R}, +// {{TwSS::USLetter,PaperAlign::Rot0},G400_LETTER}, +// {{TwSS::USLetter,PaperAlign::Rot270},G400_LETTERR}, +// {{TwSS::USLedger,PaperAlign::Rot0},G400_DOUBLELETTER}, +// {{TwSS::USLegal,PaperAlign::Rot0},G400_LEGAL}, +// #ifdef G300SCANNER +// {{TwSS::None,PaperAlign::Rot0},G400_A4}, +// #else // G300 +// {{TwSS::None,PaperAlign::Rot0},G400_A3}, +// #endif +// {{TwSS::MaxSize,PaperAlign::Rot0},G400_MAXSIZE}, +// {{TwSS::USStatement,PaperAlign::Rot0},G400_MAXSIZE} +// #endif +// }; + +class IConfig +{ +public: + IConfig(void) {}; + virtual ~IConfig(void) {}; + virtual unsigned int GetData() { return m_param.value; } +protected: + ConfigParam m_param; +}; +#endif diff --git a/hgdev/IGScanManager.cpp b/hgdev/IGScanManager.cpp new file mode 100644 index 0000000..46efece --- /dev/null +++ b/hgdev/IGScanManager.cpp @@ -0,0 +1,185 @@ +#include "IGScanManager.h" +#include +#include "libusbex.h" + + +IGScanManager::IGScanManager(): + brun(false) +{ +#ifndef _WIN32 + libusb_init(0); + //libusb_set_debug(nullptr,LIBUSB_LOG_LEVEL_DEBUG|LIBUSB_LOG_LEVEL_ERROR|LIBUSB_LOG_LEVEL_INFO); +#else + std::cout<joinable()) + { + brun=false; + m_usbnotifythread->join(); + m_usbnotifythread.reset(); + } + libusb_exit(0); +#endif +} + + +std::vector IGScanManager::getonlinedevices() +{ +#ifndef _WIN32 + return m_devices; +#else + m_devices.clear(); + auto usblist = UsbScan_List::find_all_usb(); + for(auto it =usblist.begin();it!=usblist.end();it++) + for(auto i = 0;iIsConnected()) + { + timeval tm={1,0}; + //auto ret =libusb_handle_events_completed(nullptr,nullptr); + auto ret=libusb_handle_events_timeout(0,&tm); + if(ret<0) + printf("libusb_handle_events_timeout error %s\n",libusb_error_name(ret)); + } + std::this_thread::sleep_for(chrono::milliseconds(10)); + } +} + + +int IGScanManager::OnUsbHotplugCallback(libusb_context *ctx, libusb_device *device, libusb_hotplug_event event, void *monitor) +{ + IGScanManager* This = (IGScanManager*)monitor; + return This->OnUsbHotplug(ctx, device, event); +} + +void IGScanManager::registehotplug() +{ + auto ret = libusb_hotplug_register_callback(0,(libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), + (libusb_hotplug_flag)LIBUSB_HOTPLUG_ENUMERATE, + LIBUSB_HOTPLUG_MATCH_ANY,//LIBUSB_HOTPLUG_MATCH_ANY + LIBUSB_HOTPLUG_MATCH_ANY,//LIBUSB_HOTPLUG_MATCH_ANY, + LIBUSB_HOTPLUG_MATCH_ANY, + OnUsbHotplugCallback, + this, + &handle); + if(ret!=LIBUSB_SUCCESS) + { + std::cout<<"WARRNNING register usb hotplug callback error"< +#include "IUsb.h" +#include +#include +#include "jsonconfig.h" + + +class IGScan; +using namespace std; +class IGScanManager +{ +public: + IGScanManager(); + ~IGScanManager(); + std::vector getonlinedevices(); +#ifndef _WIN32 + void registehotplug(); +private: + void initnotifythread(); + void usbnotifymain(); + static int OnUsbHotplugCallback(struct libusb_context* ctx,struct libusb_device* device, + libusb_hotplug_event event, + void* monitor); + int OnUsbHotplug(struct libusb_context* ctx, + struct libusb_device* device, + libusb_hotplug_event event); +#endif +private: + + volatile bool brun; + std::vector supportdevice; + std::vector m_devices; +#ifndef _WIN32 + shared_ptr m_usbnotifythread; + libusb_hotplug_callback_handle handle; +#endif +}; + +#endif // IGSCANMANAGER_H diff --git a/hgdev/IUsb.h b/hgdev/IUsb.h new file mode 100644 index 0000000..e72dffc --- /dev/null +++ b/hgdev/IUsb.h @@ -0,0 +1,36 @@ +#ifndef I_USB_H +#define I_USB_H +#include +#include "predefine.h" +#include "callbackdefines.h" + + +struct Usb_endpoint{ + std::uint8_t bulk_in; + std::uint8_t bulk_out; + std::uint8_t int_in; + Usb_endpoint(uint8_t b_in,uint8_t b_out,uint8_t i_in): + bulk_in(b_in),bulk_out(b_out),int_in(i_in){} + bool isnull() + { + return (bulk_in*bulk_out*int_in) == 0; + } +}; + +class IUsb +{ +public: + virtual ~IUsb() {} + virtual bool open() = 0; + virtual bool close() = 0; + virtual bool is_open() = 0; + virtual void set_timeout(int timeout) = 0; + virtual void set_usbcallback(usbcallback usbcall=0,void* usrdata=0)=0; + virtual bool is_connected()=0; + virtual int read_bulk(void* data, int len) = 0; + virtual int write_bulk(void* data, int len) = 0; + virtual int read_int(void* data, int len) = 0; + virtual int control_msg(int rtype, int req, int value, int index, int len, void* data) = 0; +}; + +#endif diff --git a/hgdev/ImageMatQueue.cpp b/hgdev/ImageMatQueue.cpp new file mode 100644 index 0000000..8c225ef --- /dev/null +++ b/hgdev/ImageMatQueue.cpp @@ -0,0 +1,619 @@ +#include +#include "ImageMatQueue.h" +#include "ImageApplyHeaders.h" +#include "ImageMultiOutput.h" +#include "GScan.h" +//#include "jpeglib.h" +#include "filetools.h" + +#include +#ifdef WIN32 +#pragma comment(lib, "shell32.lib") +#include +#include +#endif // WIN32 + + +using namespace cv; +using namespace std; + +#define DECODE_COLOR_BGR 1 +#define DECODE_GRAY 6 + +G200Decode::G200Decode(std::shared_ptr> buff) +{ + const int int_buffer_size = 1024; + int buffer_size = buff->size(); + int b_buffer_size = 0; + int f_buffer_size = 0; + std::shared_ptr> buffB(new std::vector(buff->size())); + std::shared_ptr> buffF(new std::vector(buff->size())); + unsigned char *bbuf = (unsigned char *)(buffB->data()); + unsigned char *fbuf = (unsigned char *)(buffF->data()); + unsigned char *buf = (unsigned char *)(buff->data()); + for (int i = 0; i < (buffer_size / int_buffer_size); i++) + { + if (buf[(i + 1) * int_buffer_size - 1] == 0) + { + memcpy(bbuf + b_buffer_size, buf + i * int_buffer_size, int_buffer_size - 1); + b_buffer_size += (int_buffer_size - 1); + } + else if (buf[(i + 1) * int_buffer_size - 1] == 255) + { + memcpy(fbuf + f_buffer_size, buf + i * int_buffer_size, int_buffer_size - 1); + f_buffer_size += (int_buffer_size - 1); + } + } + buffB->resize(b_buffer_size); + buffF->resize(f_buffer_size); + m_buffs.push_back(buffB); + m_buffs.push_back(buffF); +} + +G400Decode::G400Decode(std::shared_ptr> buff) +{ + m_buffs.push_back(buff); +} + + +ImageMatQueue::ImageMatQueue(ScannerSerial serial):m_serial(serial), + bRun(false), + is_scanning(false), + atm_orgin_image_remains(0) +{ +} + +void ImageMatQueue::run() +{ + if (!m_threadProc.get()) + { + bRun = true; + m_threadProc.reset(new thread(&ImageMatQueue::proc, this)); + std::cout << "ImageMat queue start running\n" << std::endl; + } +} + +ImageMatQueue::~ImageMatQueue(void) +{ + LOG("~ImageMatQueue enter\n"); + if (m_rawBuffs.Size() > 0) + { + m_rawBuffs.Clear(); + m_rawBuffs.ShutDown(); + } + + if (m_imagedata.Size() > 0) + { + m_imagedata.Clear(); + m_imagedata.ShutDown(); + } + + if (m_threadProc.get()) + { + bRun = false; + this_thread::sleep_for(chrono::milliseconds(200)); + if (m_threadProc->joinable()) + { + m_threadProc->join(); + m_threadProc.reset(); + } + } + LOG("~ImageMatQueue exit\n"); +} + +void ImageMatQueue::pushMat(std::shared_ptr data) +{ + m_rawBuffs.Put(data); + atm_orgin_image_remains++; +} + +#ifdef TWAIN +std::vector ImageMatQueue::popBmpdata() +{ + std::lock_guard lock(m_mtxJB); + std::vector retdata = m_imagedata.Take(); + return retdata; +} +#else // TWAIN + +MatEx ImageMatQueue::popimage() +{ + auto ret = m_imagedata.Take(); + return ret; +} + +void ImageMatQueue::get_image_front_info(ImageInfo *info) +{ + auto tempMat = m_imagedata.Front(); + info->Width = tempMat.mat.cols; + info->Height = tempMat.mat.rows; + info->bpp = tempMat.Bpp; +} +#endif + +bool ImageMatQueue::valid() +{ + return m_imagedata.Size(); +} + +void ImageMatQueue::clear() +{ + m_rawBuffs.Clear(); + m_imagedata.Clear(); + atm_orgin_image_remains = 0; +} + +void ImageMatQueue::setparam(const GScanCap ¶m) +{ + LOG( "---------------Set ScanParam Enter-----------\n"); + LOG( "colorMode = %d \n" , param.pixelType); + LOG( "papertype = %d \n" , param.paperSize); + LOG( "paperAlign = %d \n" , param.paperAlign); + LOG( "Resolution = %d \n" , param.resolution); + LOG( "UltrasonicDetect = %d \n" , param.hardwareParam.doubleFeedDetection); + LOG( "BindingDetect = %d \n" , param.hardwareParam.bindingDetection); + LOG( "ScrewDetect = %d \n" , param.hardwareParam.skewDetection.enable); + LOG( "ScrewTopLevel = %d \n" , param.hardwareParam.skewDetection.level); + LOG( "ScanCount = %d \n" , param.scanCount); + + LOG( "PixType = %d \n" , param.pixelType); + LOG( "IsDuplex = %d \n" , param.scanSide.duplex); + LOG( "DestResulution = %d \n" , param.resolution); + //LOG( "NativeResulution = %d \n" , param.ImageProcessParam.NativeResulution); + LOG( "AutoDiscardBlank = %d \n" , param.scanSide.discardBlank); + LOG( "AutoDiscardBlankVince = %d \n" , param.scanSide.discardBlankVince); + LOG( "IsFold = %d \n" , param.scanSide.fold); + LOG( "AutoCrop = %d \n" , param.imageProcess.autoCrop); + LOG( "AutoDescrew = %d \n" , param.imageProcess.autoDescrew); + LOG( "FillBlackRect = %d \n" , param.imageProcess.fillBlackRect); + LOG( "Filter = %d \n" , param.imageProcess.filter); + LOG( "OutHoleParam.OutHole = %d \n" , param.imageProcess.fillHole.enable); + LOG( "OutHoleParam.OutHoleValue = %d \n" , param.imageProcess.fillHole.ratio); + LOG( "Orentation = %d \n" , param.imageProcess.orentation); + LOG( "AutoDetctOrentation = %d \n" , param.imageProcess.orentation==Orentation::AUTOTEXT_DETECT); + LOG( "BackRotate180 = %d \n" , param.imageProcess.backRotate180); + LOG( "Brightness = %d \n" , param.imageProcess.brightness); + LOG( "Contrast = %d \n" , param.imageProcess.contrast); + //LOG( "Gamma = %d \n" , setiosflags(ios::fixed) , setprecision(2) , param.ImageProcessParam.Gamma); + LOG( "MultiOutRed = %d \n" , param.imageProcess.multiOutFilterRed); + LOG( "MultiOutputType = %d \n" , param.multiOutput); + LOG( "cropRect.enable = %d \n" , param.cropRect.enable); + LOG( "cropRect.x = %d \n" , param.cropRect.x); + LOG( "cropRect.y = %d \n" , param.cropRect.y); + LOG( "cropRect.width = %d \n" , param.cropRect.width); + LOG( "cropRect.height = %d \n" , param.cropRect.height); + LOG( "customGamma.isDefined = %d \n" , param.imageProcess.customGamma.enable); + //LOG( "imgparams.customGamma.table = " , imgparams.customGamma.table); + //LOG( "imgparams.customGamma.tableLength = " , imgparams.customGamma.tableLength); + LOG( "RefuseInflow = %d \n" , param.imageProcess.refuseInflow); + LOG( "ColorCorrection = %d \n" , param.imageProcess.colorCorrection); + LOG( "ErrorExtention = %d \n" , param.imageProcess.errorExtention); + LOG( "TextureRemove = %d \n" , param.imageProcess.textureRemove); + LOG( "imageSharpen = %d \n" , param.imageProcess.sharpenType); + LOG( "SplitImage = %d \n" , param.imageProcess.splitImage); + LOG( "AnswerSheetFilter = %d \n" , param.imageProcess.answerSheetFilterRed); + LOG( "NosieDetach = %d \n" , param.imageProcess.nosieDetach); + + scanParam = param; + ImageProcess imgparams = param.imageProcess; + m_iaList.clear(); + + if (imgparams.fillHole.enable) + { + LOG("Apply CImageApplyOutHole\n"); + float scale = imgparams.fillHole.ratio / 100.0; + m_iaList.push_back(shared_ptr(new CImageApplyOutHole(200, scale, 50.0))); + } + + bool autocrop;// = param.paperSize == TwSS::None||param.paperSize==TwSS::USStatement; + if(param.paperSize == TwSS::None||param.paperSize==TwSS::USStatement) + autocrop=true; + else { + autocrop=imgparams.autoCrop; + } + /*pixtype 0 colcor; 1 gray; 2 bw*/ + hgsize temp_Size = papersize.GetPaperSize((int)param.paperSize, 200, param.paperAlign,m_serial); + cv::Size cvSize(temp_Size.cx, temp_Size.cy); + m_iaList.push_back(shared_ptr(new CImageApplyAutoCrop(autocrop, + imgparams.autoDescrew, + imgparams.fillBlackRect, + cvSize))); + + if (param.scanSide.discardBlank== 1|| param.scanSide.discardBlankVince== 1) + { + m_iaList.push_back(shared_ptr(new CImageApplyDiscardBlank(param.scanSide.discardBlank==1 ? true : false))); + } + + if (param.resolution != param.resolution_native) + { + CImageApplyResize::ResizeType resizeType; + double ratio = 1.0; + hgsize reSize = papersize.GetPaperSize(param.paperSize, param.resolution, param.paperAlign,m_serial); + cv::Size cvSize(reSize.cx, reSize.cy); + if (imgparams.autoCrop || param.cropRect.enable) + { + resizeType = CImageApplyResize::ResizeType::RATIO; + ratio = param.resolution / (float)param.resolution_native; + } + else + { + resizeType = CImageApplyResize::ResizeType::DSIZE; + } + + m_iaList.push_back(shared_ptr(new CImageApplyResize(resizeType, + cvSize, + ratio, + ratio))); + } + + if (param.cropRect.enable && + !imgparams.autoCrop) + { + LOG("Apply CImageApplyCustomCrop\n"); + int width, height; + width = param.cropRect.width; + height = param.cropRect.height; + m_iaList.push_back(shared_ptr(new CImageApplyCustomCrop(cv::Rect(param.cropRect.x, param.cropRect.y, width, height)))); + } + + if (imgparams.filter != ColorFilter::FILTER_NONE && (param.pixelType == ColorMode::Gray||param.pixelType == ColorMode::BlackWhite)) + { + LOG("Apply CImageApplyChannel\n"); + m_iaList.push_back(shared_ptr(new CImageApplyChannel((CImageApplyChannel::channel)(imgparams.filter)))); + } + + if (imgparams.customGamma.enable) + { + LOG("Apply CImageApplyCustomGamma\n"); + m_iaList.push_back(shared_ptr(new CImageApplyCustomGamma(imgparams.customGamma.table, imgparams.customGamma.tableLength))); + } + else + { + if (imgparams.brightness != 128 || + imgparams.contrast != 4 || + ((imgparams.gamma < (1.0f - 1e-2)) || (imgparams.gamma > (1.0f + 1e-2)))) + { + LOG("Apply CImageApplyAdjustColors\n"); + int temp_contrast = (imgparams.contrast - 4) * 12; + m_iaList.push_back(shared_ptr(new CImageApplyAdjustColors(imgparams.brightness - 128, temp_contrast, imgparams.gamma))); + } + } + + if (param.pixelType == 2 && imgparams.answerSheetFilterRed) + { + LOG("Apply CImageApplyHSVCorrect\n"); + m_iaList.push_back(shared_ptr(new CImageApplyHSVCorrect(CImageApplyHSVCorrect::Red_Removal))); + } + + if (imgparams.refuseInflow) + { + LOG("Apply CImageApplyRefuseInflow\n"); + m_iaList.push_back(shared_ptr(new CImageApplyRefuseInflow())); + } + + if (imgparams.colorCorrection && param.pixelType != ColorMode::BlackWhite) + { + LOG("Apply CImageApplyAutoContrast\n"); + m_iaList.push_back(shared_ptr(new CImageApplyAutoContrast())); + } + + if (imgparams.orentation !=Orentation::ROTATE_NONE||imgparams.backRotate180) + { + CImageApplyRotation::RotationType rotatetype = CImageApplyRotation::RotationType::Invalid; + switch ((CImageApplyRotation::RotationType)imgparams.orentation) + { + case CImageApplyRotation::RotationType::Rotate_90_clockwise: + rotatetype = CImageApplyRotation::RotationType::Rotate_90_clockwise; + break; + case CImageApplyRotation::RotationType::Rotate_180: + rotatetype = CImageApplyRotation::RotationType::Rotate_180; + break; + case CImageApplyRotation::RotationType::Rotate_90_anti_clockwise: + rotatetype = CImageApplyRotation::RotationType::Rotate_90_anti_clockwise; + break; + default: + break; + } + if (imgparams.orentation==Orentation::AUTOTEXT_DETECT) + rotatetype = CImageApplyRotation::RotationType::AutoTextOrientation; +#ifdef WIN32 + TCHAR szIniFile[MAX_PATH] = {0}; + SHGetSpecialFolderPath(NULL, szIniFile, CSIDL_WINDOWS, TRUE); + _tcscat(szIniFile, _T("\\twain_32\\HuaGoScan\\tessdata")); + int iLen = WideCharToMultiByte(CP_ACP, 0, szIniFile, -1, NULL, 0, NULL, NULL); + char *chRtn = new char[iLen * sizeof(char)]; + WideCharToMultiByte(CP_ACP, 0, szIniFile, -1, chRtn, iLen, NULL, NULL); + m_iaList.push_back(shared_ptr(new CImageApplyRotation(rotatetype, imgparams.backRotate180, param.resolution, chRtn))); + delete[] chRtn; +#else // WIN32 + m_iaList.push_back(shared_ptr(new CImageApplyRotation(rotatetype, + imgparams.backRotate180, + param.resolution_native, + "./tessdata"))); +#endif + } + + if (imgparams.textureRemove) + { + LOG("Apply CImageApplyTextureRemoval\n"); + + m_iaList.push_back(shared_ptr(new CImageApplyTextureRemoval())); + } + + if (imgparams.sharpenType!=SharpenType::STNone) + { + LOG("Apply CImageApplyFilter\n"); + + CImageApplyFilter::FilterMode sharpenType = (CImageApplyFilter::FilterMode)imgparams.sharpenType; + m_iaList.push_back(shared_ptr(new CImageApplyFilter(sharpenType))); + } + + if (imgparams.nosieDetach) + { + LOG("Apply CImageApplyDetachNoise\n"); + m_iaList.push_back(shared_ptr(new CImageApplyDetachNoise())); + } + + if (param.pixelType == ColorMode::BlackWhite) //黑白图像 + { + CImageApplyBWBinaray::ThresholdType thrtype; + if (imgparams.errorExtention) + { + thrtype = CImageApplyBWBinaray::ThresholdType::ERROR_DIFFUSION; + } + else + { + thrtype = CImageApplyBWBinaray::ThresholdType::THRESH_BINARY; + } + m_iaList.push_back(shared_ptr(new CImageApplyBWBinaray(thrtype))); + + if (imgparams.nosieDetach) + { + m_iaList.push_back(shared_ptr(new CImageApplyDetachNoise())); + } + } + + m_multiprc_list.clear(); + if (param.imageProcess.multiOutFilterRed && param.pixelType == ColorMode::RGB) + { + LOG("Apply ImageMultiOutputRed\n"); + m_multiprc_list.push_back(shared_ptr(new ImageMultiOutputRed(2))); + } + + if (param.multiOutput != MultiOutput::Unused) + { + LOG("Apply IMageMulti\n"); + m_multiprc_list.push_back(shared_ptr(new IMageMulti(param.multiOutput))); + } + + //if (imgparams.SplitImage) { + // m_multiprc_list.push_back(shared_ptr(new CImageApplySplit())); + //} +} + +#ifdef TWAIN +void ImageMatQueue::EnqueueBmpBuffer(std::vector &bmpdata) +{ + //std::lock_guard lock(m_Locker); + m_imagedata.Put(bmpdata); +} +#else // TWAIN +void ImageMatQueue::EnqueueMat(cv::Mat &mat) +{ + //m_imagedata.Put(mat); +} +void ImageMatQueue::EnqueueMatOutPut(MatEx &matoutput) +{ + m_imagedata.Put(matoutput); +} +#endif + +void ImageMatQueue::PaniusCount() +{ + atm_orgin_image_remains--; +} + + +bool ImageMatQueue::empty() +{ + //LOG("atm_orgin_image_remains = %d m_imagedata size = %d is_scanning = %s \n", atm_orgin_image_remains,m_imagedata.Size(),is_scanning?"true":"false"); + return atm_orgin_image_remains == 0 && m_imagedata.Size() == 0 && !is_scanning; +} + +void ImageMatQueue::proc() +{ +// ThreadPool pool(4); +// std::vector< std::future > results; + while (bRun) + { + while (m_imagedata.Size() > 0) + { + this_thread::sleep_for(chrono::milliseconds(1)); + } + + if (m_rawBuffs.Size() == 0) + { + this_thread::sleep_for(chrono::milliseconds(1)); + continue; + } + + auto buffs = m_rawBuffs.Take()->getImageBuffs(); + if (!m_rawBuffs.IsShutDown() && !buffs.empty()) + { + vector mats; + for (auto &buf : buffs) + { + int rm; + if (scanParam.imageProcess.filter != ColorFilter::FILTER_NONE || scanParam.multiOutput != MultiOutput::Unused) + { + rm = 1; + + } + else + { + rm = scanParam.pixelType == 2 ? 1 : 0; + } + StopWatch sw; + cv::Mat mat = cv::imdecode(*buf, rm); + printf("imdecode time = %0.2f decode color =%s \n",sw.elapsed_ms(),rm==1?"Color":"Gray"); + buf.reset(); + if (mat.empty()) + { + LOG("imdecode failed\n"); + } + if(m_serial== ScannerSerial::G200Serial || m_serial == ScannerSerial::G100Serial) + { + mats.push_back(mat); + mat.release(); + } + else if(m_serial == ScannerSerial::G400Serial || m_serial == ScannerSerial::G300Serial) + { + cv::Mat front = mat(Rect(0, 0, mat.cols / 2, mat.rows)); + cv::Mat back = mat(Rect(mat.cols / 2, 0, mat.cols / 2, mat.rows)); + mats.push_back(back); + mats.push_back(front); + back.release(); + front.release(); + } + } + + printf("imageprocess image qqqqqqqqqqqqq \n"); + for (int j = 0; j < m_iaList.size(); j++) + { + StopWatch sw1; + m_iaList[j]->apply(mats, scanParam.scanSide.duplex); + printf("imageprocess time = %0.2f \n",sw1.elapsed_ms()); + + } + static int indexxx = 0; + + + printf("imageprocess image 222222222222 \n"); + + if (scanParam.scanSide.fold) + { + CImageApplyConcatenation fold(CImageApplyConcatenation::horizontal); + fold.apply(mats, scanParam.scanSide.duplex); + } + printf("imageprocess image 33333333 \n"); + + if (!scanParam.scanSide.duplex) + { + printf("imageprocess image 33333333aaaaaaaaaaaaaaa \n"); + mats.pop_back(); + } + printf("imageprocess image 4444444444 \n"); + + for (int i = 0; i < mats.size(); i++) + { +// if ((!scanParam.scanSide.duplex) && (i == 1)) +// break; + bool multiout_red, multi_type, msplit; + multiout_red = scanParam.imageProcess.multiOutFilterRed; + multi_type = scanParam.multiOutput != -1; + msplit = scanParam.imageProcess.splitImage; + if (multiout_red | multi_type | msplit) + { + vector retmats; + for (int j = 0; j < m_multiprc_list.size(); j++) + { + if (!mats[i].empty()) + retmats = m_multiprc_list[j]->apply(mats[i]); + } + + int colormode = 1; + if (scanParam.imageProcess.filter == ColorFilter::FILTER_NONE) + colormode = scanParam.pixelType; + printf("imageprocess image 555555555 colormode=%d\n",colormode); + + CImageApplySplit isp(scanParam.multiOutput, msplit, multiout_red, colormode); + printf("imageprocess image 66666666666 \n"); + + if (!retmats.size()) //如果没有多流,只有拆分 + { + auto matexs = isp.SplitMats(mats, scanParam.scanSide.duplex); + for (auto &matex : matexs) + EnqueueMatOutPut(matex); + break; + } + else + { + auto matexs = isp.SplitMats(retmats, scanParam.scanSide.duplex); + for (auto &matex : matexs) + EnqueueMatOutPut(matex); + } + } + else + { + if (!mats[i].empty()) + { + int bpp = (ColorMode)scanParam.pixelType == ColorMode::BlackWhite ? 1 : ((ColorMode)scanParam.pixelType == ColorMode::Gray ? 8 : 24); + if (scanParam.imageProcess.filter != ColorFilter::FILTER_NONE) + { + bpp = 8; + } + MatEx out(mats[i], bpp); + EnqueueMatOutPut(out); + } + } + } + PaniusCount(); + } + } +} + +void ImageMatQueue::EnqueueCheck(bool multiout_red, int s, std::vector &retmats) +{ + if (multiout_red) + { + int bpp = s == 0 ? 24 : 8; + MatEx out(retmats[s], bpp); //第一张一定是24位彩色图 + EnqueueMatOutPut(out); + } + else + { + int bpp = -1; + switch ((MultiOutput)scanParam.multiOutput) + { + case All: + if (s == 0) + bpp = 24; + else if (s == 1) + bpp = 8; + else + bpp = 1; + break; + case ColorGray: + if (s == 0) + bpp = 24; + else if (s == 1) + bpp = 8; + break; + case ColorBw: + if (s == 0) + bpp = 24; + else if (s == 1) + bpp = 1; + break; + case GrayBw: + if (s == 0) + bpp = 8; + else if (s == 1) + bpp = 1; + break; + default: + break; + } + + if (bpp != -1) + { + MatEx out(retmats[s], bpp); //第一张一定是24位彩色图 + EnqueueMatOutPut(out); + } + } +} + +GRawDecode::GRawDecode(std::shared_ptr> buff) +{ + m_buffs.push_back(buff); +} diff --git a/hgdev/ImageMatQueue.h b/hgdev/ImageMatQueue.h new file mode 100644 index 0000000..ad414cd --- /dev/null +++ b/hgdev/ImageMatQueue.h @@ -0,0 +1,200 @@ +#ifndef IMAGE_MAT_QUEUE_H +#define IMAGE_MAT_QUEUE_H + +#include +#include +//#include +//#include "JpegBuffer.h" +#include "ImageApplyHeaders.h" +#include "BlockingQueue.h" +#include +#include +#include "PaperSize.h" +#include "GScan.h" +#include "IMulti.h" +#include "MatEx.h" +#include "threadpool.h" + +#ifdef WIN32 + +class IMat2Bmp { +public: + virtual ~IMat2Bmp() {} + virtual std::vector getBmpDataBuffer() { + return m_data; + }; +protected: + std::vector m_data; +}; + +class Mat2Bmp:public IMat2Bmp { +public: + Mat2Bmp(const cv::Mat& mat,float res) { + int headersize = mat.channels() == 3 ? 54 : 1078; + int bmpdatasize = mat.step1() * mat.rows; + m_data.resize(headersize + bmpdatasize); + cv::imencode(".bmp", mat, m_data); + BITMAPINFOHEADER* infoheader =(BITMAPINFOHEADER*)(m_data.data()+sizeof(BITMAPFILEHEADER)); + infoheader->biXPelsPerMeter = infoheader->biYPelsPerMeter = static_cast(res * 39.37F + 0.5); + infoheader->biClrUsed = infoheader->biClrImportant=infoheader->biBitCount == 8 ? 256 : 0; + //short palettesize = sizeof(RGBQUAD) * infoheader->biClrUsed; + //int imagedatasize = BYTES_PERLINE_ALIGN4(mat.cols, infoheader->biBitCount) * mat.rows; + //int bitmapSize = sizeof(BITMAPINFOHEADER) + palettesize + imagedatasize; + //infoheader->biSizeImage = bitmapSize; + } +}; + +class Mat2BmpBw :public IMat2Bmp { +public: + Mat2BmpBw(const cv::Mat& mat,float res) { + //cv::imwrite("bw.bmp", mat); + int headsize = 62; + int width = mat.cols; + int height = mat.rows; + int bmpdatasize = (width + 31) / 32 * 4*height; + m_data.resize(headsize + bmpdatasize); + unsigned char* binary = m_data.data()+62;//file header(14)+info header(40)+RGBQUAD(8) + setBmpFileHeader(mat,bmpdatasize); + setBmpInfoHeader(mat, bmpdatasize, res); + memcpy(m_data.data(), &m_fileHeader, sizeof(BITMAPFILEHEADER)); + memcpy(m_data.data() + sizeof(BITMAPFILEHEADER), &m_infoHeader, sizeof(BITMAPINFOHEADER)); + RGBQUAD* quad = (RGBQUAD*)(m_data.data() + sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)); + quad->rgbBlue = quad->rgbGreen = quad->rgbRed = quad->rgbReserved = 0; + quad++; + quad->rgbBlue = quad->rgbGreen = quad->rgbRed = 255; + quad->rgbReserved = 0; + + unsigned char* imageData = mat.data; + unsigned char temp; + int n_lineByte = (width + 7) >> 3; + int m_lineByte = ((n_lineByte * 8 + 31) >> 5) << 2; + for (int row = height - 1; row >= 0; row--) + { + for (int col = 0; col < width; col++) + { + int pos = col % 8; + int pix = *(imageData + row * mat.step1() + col); + temp = 1 << (7 - pos); + if (pix == 255) + { + *(binary + (height - row - 1) * m_lineByte + col / 8) |= temp ; + } + else + { + *(binary + (height - row - 1) * m_lineByte + col / 8) &= (~temp); + } + } + } + } +private: + void setBmpFileHeader(const cv::Mat& mat,const int bmpDataLen) { + memset(&m_fileHeader, 0, sizeof(BITMAPFILEHEADER)); + m_fileHeader.bfType = ((unsigned short)('M' << 8) | 'B'); + m_fileHeader.bfOffBits = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (sizeof(RGBQUAD) * 1); + int nDIBSize = sizeof(BITMAPINFOHEADER) + (sizeof(RGBQUAD) * 2) + bmpDataLen; + m_fileHeader.bfSize = sizeof(BITMAPFILEHEADER) + nDIBSize; + } + + void setBmpInfoHeader(const cv::Mat& mat,const int bmpDataLen, const long res) { + memset(&m_infoHeader, 0, sizeof(BITMAPINFOHEADER)); + m_infoHeader.biSize = sizeof(BITMAPINFOHEADER); + m_infoHeader.biWidth = mat.cols; + m_infoHeader.biHeight = mat.rows; + m_infoHeader.biPlanes = 1; + m_infoHeader.biBitCount = 1; + m_infoHeader.biCompression = 0; + m_infoHeader.biSizeImage = bmpDataLen; + m_infoHeader.biXPelsPerMeter = m_infoHeader.biYPelsPerMeter = static_cast(res * 39.37F + 0.5);; + m_infoHeader.biClrUsed = 2; + m_infoHeader.biClrImportant = 2; + } + +private: + BITMAPFILEHEADER m_fileHeader; + BITMAPINFOHEADER m_infoHeader; +}; +#endif + +class IDecode { +public: + virtual ~IDecode() {} + virtual std::vector>> getImageBuffs() { + return m_buffs; + } +protected: + std::vector>> m_buffs; +}; + +class G200Decode : public IDecode{ +public: + G200Decode(std::shared_ptr> buff); +}; + +class G400Decode : public IDecode{ +public: + G400Decode(std::shared_ptr> buff); +}; + + +class GRawDecode : public IDecode { +public: + GRawDecode(std::shared_ptr> buff); +}; + +class ImageMatQueue +{ +public: + ImageMatQueue(ScannerSerial serial); + virtual ~ImageMatQueue(void); + bool Setserial(ScannerSerial serial){ + m_serial=serial; + return true; + } + bool empty(); + bool valid(); + void clear(); + void setparam(const GScanCap& param); + void run(); + void setscanflags(const bool flags) { + is_scanning = flags; + std::cout<<"is scannning"< buf); +#ifdef TWAIN + std::vector popBmpdata(); +#else // TWAIN + //cv::Mat popimage(); + MatEx popimage(); + void get_image_front_info(ImageInfo* info); +#endif + + + +private: + void proc(); + void EnqueueCheck(bool multiout_red, int s, std::vector& retmats); + void PaniusCount(); +#ifdef TWAIN + void EnqueueBmpBuffer(std::vector& bmpdata); + BlockingQueue> m_imagedata; + std::vector popBmpdata(); +#else // TWAIN + void EnqueueMat(cv::Mat& mat); + void EnqueueMatOutPut(MatEx& matoutput); + BlockingQueue m_imagedata; +#endif + ScannerSerial m_serial; + std::mutex m_Locker; + std::mutex m_mtxJB; + std::unique_ptr m_threadProc; + volatile bool bRun; + volatile int atm_orgin_image_remains; + volatile bool is_scanning; + GScanCap scanParam; + Device::PaperSize papersize; + std::vector> m_iaList; + std::vector> m_multiprc_list; + BlockingQueue> m_rawBuffs; +}; + +#endif diff --git a/hgdev/ImageMultiOutput.cpp b/hgdev/ImageMultiOutput.cpp new file mode 100644 index 0000000..bfc544b --- /dev/null +++ b/hgdev/ImageMultiOutput.cpp @@ -0,0 +1,59 @@ +#include "ImageMultiOutput.h" + + +ImageMultiOutput::ImageMultiOutput(void) +{ +} + + +ImageMultiOutput::~ImageMultiOutput(void) +{ +} + +//void ImageMultiOutput::apply(cv::Mat& pDib,int side) +//{ +// //throw std::logic_error("The method or operation is not implemented."); +//} + +cv::Mat ImageMultiOutput::GetMultiFilterMat(cv::Mat &src,int channel) +{ + return FilterColor(src,channel); +} + +cv::Mat ImageMultiOutput::FilterColor(cv::Mat image,short channel) +{ + cv::Mat dstImage(image.rows,image.cols,CV_8UC1); + + //int pixelSize = image.depth(); + int channels = image.channels(); + if(channel > channels -1){ + return dstImage; + } + if ( ( channel == 3 ) && ( channels != 4 ) && ( channels != 8 )) + { + return dstImage; + } + if ( channels <= 4 ) + { + int srcOffset = image.step - image.cols* channels ; + int dstOffset = dstImage.step - dstImage.cols; + unsigned char* src = image.data; + unsigned char* dst = dstImage.data; + src += channel; + + for ( int y = 0; y < image.rows; y++ ) + { + for ( int x = 0; x < image.cols; x++, src += channels , dst++ ) + { + unsigned short pix = *src; + if(pix >=130){ + pix = 255; + } + *dst = pix; + } + src += srcOffset; + dst += dstOffset; + } + } + return dstImage; +} diff --git a/hgdev/ImageMultiOutput.h b/hgdev/ImageMultiOutput.h new file mode 100644 index 0000000..2e89904 --- /dev/null +++ b/hgdev/ImageMultiOutput.h @@ -0,0 +1,18 @@ +#ifndef IMAGE_MULTI_OUTPUT +#define IMAGE_MULTI_OUTPUT + +#include "ImageApply.h" + +class ImageMultiOutput +{ +public: + ImageMultiOutput(void); + ~ImageMultiOutput(void); + + cv::Mat GetMultiFilterMat(cv::Mat &src,int channel); +private: + cv::Mat FilterColor(cv::Mat image,short channel); + +}; + +#endif diff --git a/hgdev/Makefile b/hgdev/Makefile new file mode 100644 index 0000000..6508434 --- /dev/null +++ b/hgdev/Makefile @@ -0,0 +1,478 @@ +############################################################################# +# Makefile for building: hgdev +# Generated by qmake (3.1) (Qt 5.13.1) +# Project: hgdev.pro +# Template: lib +# Command: C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -o Makefile hgdev.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" +############################################################################# + +MAKEFILE = Makefile + +EQ = = + +first: debug +install: debug-install +uninstall: debug-uninstall +QMAKE = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe +DEL_FILE = del +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +COPY = copy /y +COPY_FILE = copy /y +COPY_DIR = xcopy /s /q /y /i +INSTALL_FILE = copy /y +INSTALL_PROGRAM = copy /y +INSTALL_DIR = xcopy /s /q /y /i +QINSTALL = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall +QINSTALL_PROGRAM = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall -exe +DEL_FILE = del +SYMLINK = $(QMAKE) -install ln -f -s +DEL_DIR = rmdir +MOVE = move +SUBTARGETS = \ + debug \ + release + + +debug: $(MAKEFILE) FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug +debug-make_first: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug +debug-all: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug all +debug-clean: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug clean +debug-distclean: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug distclean +debug-install: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug install +debug-uninstall: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Debug uninstall +release: $(MAKEFILE) FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release +release-make_first: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release +release-all: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release all +release-clean: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release clean +release-distclean: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release distclean +release-install: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release install +release-uninstall: FORCE + @set MAKEFLAGS=$(MAKEFLAGS) + $(MAKE) -f $(MAKEFILE).Release uninstall + +Makefile: hgdev.pro C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc\qmake.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_pre.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\angle.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-desktop.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows_vulkan_sdk.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-vulkan.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-desktop.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\qconfig.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_accessibility_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bodymovin_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bootstrap_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designercomponents_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_devicediscovery_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_edid_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_egl_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_eventdispatcher_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fb_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fontdatabase_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_packetprotocol_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_platformcompositor_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldebug_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldevtools_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickparticles_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickshapes_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_theme_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uiplugin.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_vulkan_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecoreheaders_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_windowsuiautomation_support_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_zlib_private.pri \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_functions.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_config.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc\qmake.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_post.prf \ + ..\.qmake.stash \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-version.conf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\toolchain.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_pre.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\default_pre.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\resolve_config.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds_post.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_post.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qml_debug.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\precompile_header.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\warn_on.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qmake_use.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\file_copies.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\testcase_targets.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exceptions.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\yacc.prf \ + C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\lex.prf \ + hgdev.pro + $(QMAKE) -o Makefile hgdev.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_pre.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\angle.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-desktop.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows_vulkan_sdk.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-vulkan.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-desktop.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\qconfig.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_accessibility_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bodymovin_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bootstrap_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designercomponents_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_devicediscovery_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_edid_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_egl_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_eventdispatcher_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fb_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fontdatabase_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_packetprotocol_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_platformcompositor_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldebug_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldevtools_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickparticles_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickshapes_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_theme_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uiplugin.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_vulkan_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecoreheaders_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_windowsuiautomation_support_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_zlib_private.pri: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_functions.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_config.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc\qmake.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_post.prf: +..\.qmake.stash: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-version.conf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\toolchain.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_pre.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\default_pre.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\resolve_config.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds_post.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_post.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qml_debug.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\precompile_header.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\warn_on.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qmake_use.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\file_copies.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\testcase_targets.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exceptions.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\yacc.prf: +C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\lex.prf: +hgdev.pro: +qmake: FORCE + @$(QMAKE) -o Makefile hgdev.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" + +qmake_all: FORCE + +make_first: debug-make_first release-make_first FORCE +all: debug-all release-all FORCE +clean: debug-clean release-clean FORCE + -$(DEL_FILE) ..\bin\debug\hgdev.pdb + -$(DEL_FILE) ..\bin\debug\hgdev.ilk + -$(DEL_FILE) ..\bin\debug\hgdev.idb +distclean: debug-distclean release-distclean FORCE + -$(DEL_FILE) Makefile + -$(DEL_FILE) ..\bin\debug\hgdev.pdb + +check: first + +benchmark: first +FORCE: + +$(MAKEFILE).Debug: Makefile +$(MAKEFILE).Release: Makefile diff --git a/hgdev/Makefile.Debug b/hgdev/Makefile.Debug new file mode 100644 index 0000000..dfa20c4 --- /dev/null +++ b/hgdev/Makefile.Debug @@ -0,0 +1,690 @@ +############################################################################# +# Makefile for building: hgdev +# Generated by qmake (3.1) (Qt 5.13.1) +# Project: hgdev.pro +# Template: lib +############################################################################# + +MAKEFILE = Makefile.Debug + +EQ = = + +####### Compiler, tools and options + +CC = cl +CXX = cl +DEFINES = -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -D_WIN32 -DQT_QML_DEBUG +CFLAGS = -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zi -MDd -MTd -W3 -w44456 -w44457 -w44458 /Fd../bin/debug/hgdev.pdb $(DEFINES) +CXXFLAGS = -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -MTd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc /Fd../bin/debug/hgdev.pdb $(DEFINES) +INCPATH = -I. -I..\3rdparty\opencv\include -I..\3rdparty\nick -I..\imageprocess -IC:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc +LIBAPP = lib /NOLOGO +LIBFLAGS = +QMAKE = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe +IDC = idc +IDL = midl +ZIP = zip -r -9 +DEF_FILE = +RES_FILE = +COPY = copy /y +SED = $(QMAKE) -install sed +COPY_FILE = copy /y +COPY_DIR = xcopy /s /q /y /i +DEL_FILE = del +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +INSTALL_FILE = copy /y +INSTALL_PROGRAM = copy /y +INSTALL_DIR = xcopy /s /q /y /i +QINSTALL = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall +QINSTALL_PROGRAM = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall -exe + +####### Output directory + +OBJECTS_DIR = debug + +####### Files + +SOURCES = G400ScanConfig.cpp \ + GScan.cpp \ + GScanO1003399.cpp \ + GScanO200.cpp \ + GScanO400.cpp \ + IGScanManager.cpp \ + ImageMatQueue.cpp \ + ImageMultiOutput.cpp \ + PaperSize.cpp \ + UsbScanEx.cpp \ + jsonconfig.cpp \ + libusbex.cpp \ + scn_config.cpp +OBJECTS = debug\G400ScanConfig.obj \ + debug\GScan.obj \ + debug\GScanO1003399.obj \ + debug\GScanO200.obj \ + debug\GScanO400.obj \ + debug\IGScanManager.obj \ + debug\ImageMatQueue.obj \ + debug\ImageMultiOutput.obj \ + debug\PaperSize.obj \ + debug\UsbScanEx.obj \ + debug\jsonconfig.obj \ + debug\libusbex.obj \ + debug\scn_config.obj + +DIST = BlockingQueue.h \ + G400ScanConfig.h \ + GScan.h \ + GScanO1003399.h \ + GScanO200.h \ + GScanO400.h \ + IConfig.h \ + IGScanManager.h \ + IUsb.h \ + ImageMatQueue.h \ + ImageMultiOutput.h \ + PaperSize.h \ + UsbScanEx.h \ + device_common.h \ + filetools.h \ + json.hpp \ + jsonconfig.h \ + libusbex.h \ + scn_config.h \ + threadpool.h G400ScanConfig.cpp \ + GScan.cpp \ + GScanO1003399.cpp \ + GScanO200.cpp \ + GScanO400.cpp \ + IGScanManager.cpp \ + ImageMatQueue.cpp \ + ImageMultiOutput.cpp \ + PaperSize.cpp \ + UsbScanEx.cpp \ + jsonconfig.cpp \ + libusbex.cpp \ + scn_config.cpp +QMAKE_TARGET = hgdev +DESTDIR = ..\bin\debug\ #avoid trailing-slash linebreak +TARGET = hgdev.lib +DESTDIR_TARGET = ..\bin\debug\hgdev.lib + +####### Implicit rules + +.SUFFIXES: .c .cpp .cc .cxx + +{.}.cpp{debug\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<< + $< +<< + +{.}.cc{debug\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<< + $< +<< + +{.}.cxx{debug\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Fodebug\ @<< + $< +<< + +{.}.c{debug\}.obj:: + $(CC) -c $(CFLAGS) $(INCPATH) -Fodebug\ @<< + $< +<< + +####### Build rules + +first: all +all: Makefile.Debug ..\bin\debug\hgdev.lib + +..\bin\debug\hgdev.lib: $(OBJECTS) + $(LIBAPP) $(LIBFLAGS) /OUT:$(DESTDIR_TARGET) @<< + debug\G400ScanConfig.obj debug\GScan.obj debug\GScanO1003399.obj debug\GScanO200.obj debug\GScanO400.obj debug\IGScanManager.obj debug\ImageMatQueue.obj debug\ImageMultiOutput.obj debug\PaperSize.obj debug\UsbScanEx.obj debug\jsonconfig.obj debug\libusbex.obj debug\scn_config.obj +<< + +qmake: FORCE + @$(QMAKE) -o Makefile.Debug hgdev.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" + +qmake_all: FORCE + +dist: + $(ZIP) hgdev.zip $(SOURCES) $(DIST) hgdev.pro C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\angle.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-desktop.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows_vulkan_sdk.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-vulkan.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-desktop.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\qconfig.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_accessibility_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bodymovin_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bootstrap_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designercomponents_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_devicediscovery_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_edid_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_egl_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_eventdispatcher_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fb_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fontdatabase_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_packetprotocol_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_platformcompositor_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldebug_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldevtools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickparticles_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickshapes_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_theme_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uiplugin.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_vulkan_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecoreheaders_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_windowsuiautomation_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_zlib_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_functions.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_config.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc\qmake.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_post.prf ..\.qmake.stash C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-version.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\toolchain.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\default_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\resolve_config.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds_post.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_post.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\build_pass.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qml_debug.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\precompile_header.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\warn_on.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qmake_use.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\file_copies.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\testcase_targets.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exceptions.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\yacc.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\lex.prf hgdev.pro + +clean: compiler_clean + -$(DEL_FILE) debug\G400ScanConfig.obj debug\GScan.obj debug\GScanO1003399.obj debug\GScanO200.obj debug\GScanO400.obj debug\IGScanManager.obj debug\ImageMatQueue.obj debug\ImageMultiOutput.obj debug\PaperSize.obj debug\UsbScanEx.obj debug\jsonconfig.obj debug\libusbex.obj debug\scn_config.obj + -$(DEL_FILE) ..\bin\debug\hgdev.pdb ..\bin\debug\hgdev.ilk ..\bin\debug\hgdev.idb + +distclean: clean + -$(DEL_FILE) ..\bin\debug\hgdev.pdb + -$(DEL_FILE) $(DESTDIR_TARGET) + -$(DEL_FILE) Makefile.Debug + +check: first + +benchmark: first + +compiler_no_pch_compiler_make_all: +compiler_no_pch_compiler_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + + + +####### Compile + +debug\G400ScanConfig.obj: G400ScanConfig.cpp G400ScanConfig.h \ + ..\3rdparty\nick\predefine.h \ + IConfig.h \ + PaperSize.h \ + ..\3rdparty\nick\sane_common.h + +debug\GScan.obj: GScan.cpp GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + ImageMatQueue.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h + +debug\GScanO1003399.obj: GScanO1003399.cpp GScanO1003399.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + IConfig.h \ + PaperSize.h \ + G400ScanConfig.h \ + threadpool.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + libusbex.h \ + IUsb.h \ + ImageMultiOutput.h \ + UsbScanEx.h + +debug\GScanO200.obj: GScanO200.cpp ..\3rdparty\nick\predefine.h \ + GScanO200.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\callbackdefines.h \ + UsbScanEx.h \ + IUsb.h \ + libusbex.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h \ + filetools.h \ + IConfig.h \ + scn_config.h + +debug\GScanO400.obj: GScanO400.cpp ..\3rdparty\nick\predefine.h \ + GScanO400.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\callbackdefines.h \ + UsbScanEx.h \ + IUsb.h \ + libusbex.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h \ + filetools.h \ + IConfig.h \ + G400ScanConfig.h + +debug\IGScanManager.obj: IGScanManager.cpp IGScanManager.h \ + UsbScanEx.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + jsonconfig.h \ + json.hpp \ + ..\3rdparty\nick\sane_common.h \ + libusbex.h + +debug\ImageMatQueue.obj: ImageMatQueue.cpp ..\3rdparty\nick\predefine.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + ..\3rdparty\nick\sane_common.h \ + PaperSize.h \ + GScan.h \ + ..\3rdparty\nick\callbackdefines.h \ + threadpool.h \ + ImageMultiOutput.h \ + filetools.h \ + ..\3rdparty\nick\StopWatch.h + +debug\ImageMultiOutput.obj: ImageMultiOutput.cpp ImageMultiOutput.h \ + ..\imageprocess\ImageApply.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\imageprocess\imgprocdefs.h + +debug\PaperSize.obj: PaperSize.cpp PaperSize.h \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h + +debug\UsbScanEx.obj: UsbScanEx.cpp UsbScanEx.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h + +debug\jsonconfig.obj: jsonconfig.cpp jsonconfig.h \ + json.hpp \ + ..\3rdparty\nick\sane_common.h + +debug\libusbex.obj: libusbex.cpp libusbex.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h + +debug\scn_config.obj: scn_config.cpp scn_config.h \ + IConfig.h \ + ..\3rdparty\nick\predefine.h \ + PaperSize.h \ + ..\3rdparty\nick\sane_common.h + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/hgdev/Makefile.Release b/hgdev/Makefile.Release new file mode 100644 index 0000000..3a9d63e --- /dev/null +++ b/hgdev/Makefile.Release @@ -0,0 +1,688 @@ +############################################################################# +# Makefile for building: hgdev +# Generated by qmake (3.1) (Qt 5.13.1) +# Project: hgdev.pro +# Template: lib +############################################################################# + +MAKEFILE = Makefile.Release + +EQ = = + +####### Compiler, tools and options + +CC = cl +CXX = cl +DEFINES = -DUNICODE -D_UNICODE -DWIN32 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -DQT_DEPRECATED_WARNINGS -D_WIN32 -DQT_QML_DEBUG -DNDEBUG +CFLAGS = -nologo -Zc:wchar_t -FS -Zc:strictStrings -O2 -MD -MT -W3 -w44456 -w44457 -w44458 $(DEFINES) +CXXFLAGS = -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -MT -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc $(DEFINES) +INCPATH = -I. -I..\3rdparty\opencv\include -I..\3rdparty\nick -I..\imageprocess -IC:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc +LIBAPP = lib /NOLOGO +LIBFLAGS = +QMAKE = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe +IDC = idc +IDL = midl +ZIP = zip -r -9 +DEF_FILE = +RES_FILE = +COPY = copy /y +SED = $(QMAKE) -install sed +COPY_FILE = copy /y +COPY_DIR = xcopy /s /q /y /i +DEL_FILE = del +DEL_DIR = rmdir +MOVE = move +CHK_DIR_EXISTS= if not exist +MKDIR = mkdir +INSTALL_FILE = copy /y +INSTALL_PROGRAM = copy /y +INSTALL_DIR = xcopy /s /q /y /i +QINSTALL = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall +QINSTALL_PROGRAM = C:\Qt\Qt5.13.1\5.13.1\msvc2017\bin\qmake.exe -install qinstall -exe + +####### Output directory + +OBJECTS_DIR = release + +####### Files + +SOURCES = G400ScanConfig.cpp \ + GScan.cpp \ + GScanO1003399.cpp \ + GScanO200.cpp \ + GScanO400.cpp \ + IGScanManager.cpp \ + ImageMatQueue.cpp \ + ImageMultiOutput.cpp \ + PaperSize.cpp \ + UsbScanEx.cpp \ + jsonconfig.cpp \ + libusbex.cpp \ + scn_config.cpp +OBJECTS = release\G400ScanConfig.obj \ + release\GScan.obj \ + release\GScanO1003399.obj \ + release\GScanO200.obj \ + release\GScanO400.obj \ + release\IGScanManager.obj \ + release\ImageMatQueue.obj \ + release\ImageMultiOutput.obj \ + release\PaperSize.obj \ + release\UsbScanEx.obj \ + release\jsonconfig.obj \ + release\libusbex.obj \ + release\scn_config.obj + +DIST = BlockingQueue.h \ + G400ScanConfig.h \ + GScan.h \ + GScanO1003399.h \ + GScanO200.h \ + GScanO400.h \ + IConfig.h \ + IGScanManager.h \ + IUsb.h \ + ImageMatQueue.h \ + ImageMultiOutput.h \ + PaperSize.h \ + UsbScanEx.h \ + device_common.h \ + filetools.h \ + json.hpp \ + jsonconfig.h \ + libusbex.h \ + scn_config.h \ + threadpool.h G400ScanConfig.cpp \ + GScan.cpp \ + GScanO1003399.cpp \ + GScanO200.cpp \ + GScanO400.cpp \ + IGScanManager.cpp \ + ImageMatQueue.cpp \ + ImageMultiOutput.cpp \ + PaperSize.cpp \ + UsbScanEx.cpp \ + jsonconfig.cpp \ + libusbex.cpp \ + scn_config.cpp +QMAKE_TARGET = hgdev +DESTDIR = ..\bin\release\ #avoid trailing-slash linebreak +TARGET = hgdev.lib +DESTDIR_TARGET = ..\bin\release\hgdev.lib + +####### Implicit rules + +.SUFFIXES: .c .cpp .cc .cxx + +{.}.cpp{release\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease\ @<< + $< +<< + +{.}.cc{release\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease\ @<< + $< +<< + +{.}.cxx{release\}.obj:: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -Forelease\ @<< + $< +<< + +{.}.c{release\}.obj:: + $(CC) -c $(CFLAGS) $(INCPATH) -Forelease\ @<< + $< +<< + +####### Build rules + +first: all +all: Makefile.Release ..\bin\release\hgdev.lib + +..\bin\release\hgdev.lib: $(OBJECTS) + $(LIBAPP) $(LIBFLAGS) /OUT:$(DESTDIR_TARGET) @<< + release\G400ScanConfig.obj release\GScan.obj release\GScanO1003399.obj release\GScanO200.obj release\GScanO400.obj release\IGScanManager.obj release\ImageMatQueue.obj release\ImageMultiOutput.obj release\PaperSize.obj release\UsbScanEx.obj release\jsonconfig.obj release\libusbex.obj release\scn_config.obj +<< + +qmake: FORCE + @$(QMAKE) -o Makefile.Release hgdev.pro -spec win32-msvc "CONFIG+=debug" "CONFIG+=qml_debug" + +qmake_all: FORCE + +dist: + $(ZIP) hgdev.zip $(SOURCES) $(DIST) hgdev.pro C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\angle.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-desktop.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows_vulkan_sdk.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\windows-vulkan.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-desktop.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\qconfig.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3danimation_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dcore_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dinput_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dlogic_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickanimation_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickinput_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickrender_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3dquickscene2d_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_3drender_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_accessibility_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axbase_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axcontainer_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_axserver_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bluetooth_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bodymovin_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_bootstrap_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_charts_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_concurrent_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_core_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_datavisualization_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_dbus_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designer_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_designercomponents_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_devicediscovery_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_edid_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_egl_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_eventdispatcher_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fb_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_fontdatabase_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gamepad_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_gui_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_help_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_location_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimedia_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_multimediawidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_network_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_networkauth_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_nfc_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_opengl_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_openglextensions_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_packetprotocol_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_platformcompositor_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioning_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_positioningquick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_printsupport_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_purchasing_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldebug_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmldevtools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qmltest_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_qtmultimediaquicktools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quick_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickcontrols2_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickparticles_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickshapes_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quicktemplates2_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_quickwidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_remoteobjects_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_repparser_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_script_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scripttools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_scxml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sensors_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialbus_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_serialport_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_sql_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_svg_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_testlib_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_texttospeech_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_theme_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uiplugin.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_uitools_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_virtualkeyboard_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_vulkan_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webchannel_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webengine_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecore_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginecoreheaders_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webenginewidgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_websockets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_webview_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_widgets_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_windowsuiautomation_support_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_winextras_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xml_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_xmlpatterns_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\modules\qt_lib_zlib_private.pri C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_functions.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qt_config.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\win32-msvc\qmake.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\spec_post.prf ..\.qmake.stash C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\common\msvc-version.conf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\toolchain.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\default_pre.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\resolve_config.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exclusive_builds_post.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\default_post.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\build_pass.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qml_debug.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\precompile_header.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\warn_on.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\qmake_use.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\file_copies.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\win32\windows.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\testcase_targets.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\exceptions.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\yacc.prf C:\Qt\Qt5.13.1\5.13.1\msvc2017\mkspecs\features\lex.prf hgdev.pro + +clean: compiler_clean + -$(DEL_FILE) release\G400ScanConfig.obj release\GScan.obj release\GScanO1003399.obj release\GScanO200.obj release\GScanO400.obj release\IGScanManager.obj release\ImageMatQueue.obj release\ImageMultiOutput.obj release\PaperSize.obj release\UsbScanEx.obj release\jsonconfig.obj release\libusbex.obj release\scn_config.obj + +distclean: clean + -$(DEL_FILE) $(DESTDIR_TARGET) + -$(DEL_FILE) Makefile.Release + +check: first + +benchmark: first + +compiler_no_pch_compiler_make_all: +compiler_no_pch_compiler_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: + + + +####### Compile + +release\G400ScanConfig.obj: G400ScanConfig.cpp G400ScanConfig.h \ + ..\3rdparty\nick\predefine.h \ + IConfig.h \ + PaperSize.h \ + ..\3rdparty\nick\sane_common.h + +release\GScan.obj: GScan.cpp GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + ImageMatQueue.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h + +release\GScanO1003399.obj: GScanO1003399.cpp GScanO1003399.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + IConfig.h \ + PaperSize.h \ + G400ScanConfig.h \ + threadpool.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + libusbex.h \ + IUsb.h \ + ImageMultiOutput.h \ + UsbScanEx.h + +release\GScanO200.obj: GScanO200.cpp ..\3rdparty\nick\predefine.h \ + GScanO200.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\callbackdefines.h \ + UsbScanEx.h \ + IUsb.h \ + libusbex.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h \ + filetools.h \ + IConfig.h \ + scn_config.h + +release\GScanO400.obj: GScanO400.cpp ..\3rdparty\nick\predefine.h \ + GScanO400.h \ + GScan.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\callbackdefines.h \ + UsbScanEx.h \ + IUsb.h \ + libusbex.h \ + ..\3rdparty\nick\StopWatch.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + PaperSize.h \ + threadpool.h \ + filetools.h \ + IConfig.h \ + G400ScanConfig.h + +release\IGScanManager.obj: IGScanManager.cpp IGScanManager.h \ + UsbScanEx.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h \ + jsonconfig.h \ + json.hpp \ + ..\3rdparty\nick\sane_common.h \ + libusbex.h + +release\ImageMatQueue.obj: ImageMatQueue.cpp ..\3rdparty\nick\predefine.h \ + ImageMatQueue.h \ + ..\imageprocess\ImageApplyHeaders.h \ + ..\imageprocess\ImageApply.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\imageprocess\imgprocdefs.h \ + ..\imageprocess\ImageApplyAdjustColors.h \ + ..\imageprocess\ImageApplyAutoContrast.h \ + ..\imageprocess\ImageApplyAutoCrop.h \ + ..\imageprocess\ImageApplyBWBinaray.h \ + ..\imageprocess\ImageApplyChannel.h \ + ..\imageprocess\ImageApplyColorRecognition.h \ + ..\imageprocess\ImageApplyConcatenation.h \ + ..\imageprocess\ImageApplyCustomCrop.h \ + ..\imageprocess\ImageApplyCustomGamma.h \ + ..\imageprocess\ImageApplyCvtColor.h \ + ..\imageprocess\ImageApplyDetachNoise.h \ + ..\imageprocess\ImageApplyDiscardBlank.h \ + ..\imageprocess\ImageApplyDogEarDetection.h \ + ..\imageprocess\ImageApplyFadeBackGroundColor.h \ + ..\imageprocess\ImageApplyFilter.h \ + ..\imageprocess\ImageApplyHSVCorrect.h \ + ..\imageprocess\ImageApplyOutHole.h \ + ..\imageprocess\ImageApplyRefuseInflow.h \ + ..\imageprocess\ImageApplyResize.h \ + ..\imageprocess\ImageApplyRotation.h \ + ..\imageprocess\ImageApplySplit.h \ + ..\imageprocess\MatEx.h \ + ..\imageprocess\ImageApplyTextureRemoval.h \ + ..\imageprocess\ImageMulti.h \ + ..\imageprocess\IMulti.h \ + ..\imageprocess\ImageMultiOutputRed.h \ + BlockingQueue.h \ + ..\3rdparty\nick\sane_common.h \ + PaperSize.h \ + GScan.h \ + ..\3rdparty\nick\callbackdefines.h \ + threadpool.h \ + ImageMultiOutput.h \ + filetools.h \ + ..\3rdparty\nick\StopWatch.h + +release\ImageMultiOutput.obj: ImageMultiOutput.cpp ImageMultiOutput.h \ + ..\imageprocess\ImageApply.h \ + ..\3rdparty\opencv\include\opencv2\opencv.hpp \ + ..\3rdparty\opencv\include\opencv2\opencv_modules.hpp \ + ..\3rdparty\opencv\include\opencv2\core.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvdef.h \ + ..\3rdparty\opencv\include\opencv2\core\version.hpp \ + ..\3rdparty\opencv\include\opencv2\core\hal\interface.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_dispatch.h \ + ..\3rdparty\opencv\include\opencv2\core\cv_cpu_helper.h \ + ..\3rdparty\opencv\include\opencv2\core\hal\msa_macros.h \ + ..\3rdparty\opencv\include\opencv2\core\fast_math.hpp \ + ..\3rdparty\opencv\include\opencv2\core\base.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ptr.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\neon_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\vsx_utils.hpp \ + ..\3rdparty\opencv\include\opencv2\core\check.hpp \ + ..\3rdparty\opencv\include\opencv2\core\traits.hpp \ + ..\3rdparty\opencv\include\opencv2\core\matx.hpp \ + ..\3rdparty\opencv\include\opencv2\core\saturate.hpp \ + ..\3rdparty\opencv\include\opencv2\core\types.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.hpp \ + ..\3rdparty\opencv\include\opencv2\core\bufferpool.hpp \ + ..\3rdparty\opencv\include\opencv2\core\mat.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\persistence.hpp \ + ..\3rdparty\opencv\include\opencv2\core\operations.hpp \ + ..\3rdparty\opencv\include\opencv2\core\cvstd.inl.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utility.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\instrumentation.hpp \ + ..\3rdparty\opencv\include\opencv2\core\utils\tls.hpp \ + ..\3rdparty\opencv\include\opencv2\core\core_c.h \ + ..\3rdparty\opencv\include\opencv2\core\types_c.h \ + ..\3rdparty\opencv\include\opencv2\core\optim.hpp \ + ..\3rdparty\opencv\include\opencv2\core\ovx.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui.hpp \ + ..\3rdparty\opencv\include\opencv2\imgcodecs.hpp \ + ..\3rdparty\opencv\include\opencv2\highgui\highgui_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\imgproc_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc\types_c.h \ + ..\3rdparty\opencv\include\opencv2\imgcodecs\imgcodecs_c.h \ + ..\3rdparty\opencv\include\opencv2\imgproc.hpp \ + ..\imageprocess\imgprocdefs.h + +release\PaperSize.obj: PaperSize.cpp PaperSize.h \ + ..\3rdparty\nick\sane_common.h \ + ..\3rdparty\nick\predefine.h + +release\UsbScanEx.obj: UsbScanEx.cpp UsbScanEx.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h + +release\jsonconfig.obj: jsonconfig.cpp jsonconfig.h \ + json.hpp \ + ..\3rdparty\nick\sane_common.h + +release\libusbex.obj: libusbex.cpp libusbex.h \ + IUsb.h \ + ..\3rdparty\nick\predefine.h \ + ..\3rdparty\nick\callbackdefines.h + +release\scn_config.obj: scn_config.cpp scn_config.h \ + IConfig.h \ + ..\3rdparty\nick\predefine.h \ + PaperSize.h \ + ..\3rdparty\nick\sane_common.h + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/hgdev/PaperSize.cpp b/hgdev/PaperSize.cpp new file mode 100644 index 0000000..ee92569 --- /dev/null +++ b/hgdev/PaperSize.cpp @@ -0,0 +1,250 @@ +#include "PaperSize.h" + +using namespace std; + +namespace Device { + + PaperSize::PaperSize() + { + InitPaperMap(); + } + + + PaperSize::~PaperSize() + { + } + + void PaperSize::InitPaperMap() + { +// //!< ����Ӧ +// dpiDct[{None, 50.0f}] = { 594, 898 }; +// dpiDct[{None, 75.0f}] = { 892, 1347 }; +// dpiDct[{None, 100.0f}] = { 1189, 1795 }; +// dpiDct[{None, 150.0f}] = {1784, 2693}; +// dpiDct[{None, 200.0f}] = {2338, 3307}; +// dpiDct[{None, 240.0f}] = {2854, 4308}; +// dpiDct[{None, 300.0f}] = {3567, 5385}; +// dpiDct[{None, 400.0f}] = {4756, 7180}; +// dpiDct[{None, 600.0f}] = {7134, 10770}; + +// //A3 +// dpiDct[{A3, 50.0f}] = {585, 827}; +// dpiDct[{A3, 75.0f}] = {877, 1240}; +// dpiDct[{A3, 100.0f}] = {1169, 1653}; +// dpiDct[{A3, 150.0f}] = {1753, 2480}; +// dpiDct[{A3, 200.0f}] = {2338, 3307}; +// dpiDct[{A3, 240.0f}] = {2806, 3968}; +// dpiDct[{A3, 300.0f}] = {3507, 4960}; +// dpiDct[{A3, 400.0f}] = {4677, 6614}; +// dpiDct[{A3, 600.0f}] = {7015, 9921}; +// //add lyc 2019 12 18 +// //A4 +// dpiDct[{A4, 50.0f}] = {413, 585}; +// dpiDct[{A4, 75.0f}] = {620, 877}; +// dpiDct[{A4, 100.0f}] = {826, 1169}; +// dpiDct[{A4, 150.0f}] = {1240, 1753}; +// dpiDct[{A4, 200.0f}] = {1653, 2338}; +// dpiDct[{A4, 240.0f}] = {1984, 2806}; +// dpiDct[{A4, 300.0f}] = {2480, 3507}; +// dpiDct[{A4, 400.0f}] = {3307, 4677}; +// dpiDct[{A4, 600.0f}] = {4960, 7015}; +// //add lyc 2019 12 18 A5 +// dpiDct[{A5, 50.0f}] = {291, 413}; +// dpiDct[{A5, 75.0f}] = {437, 620}; +// dpiDct[{A5, 100.0f}] = {582, 826}; +// dpiDct[{A5, 150.0f}] = {874, 1240}; +// dpiDct[{A5, 200.0f}] = {1165, 1653}; +// dpiDct[{A5, 240.0f}] = {1398, 1984}; +// dpiDct[{A5, 300.0f}] = {1748, 2480}; +// dpiDct[{A5, 400.0f}] = {2330, 3307}; +// dpiDct[{A5, 600.0f}] = {3496, 4960}; + +// //add lyc 2019 12 18 A6 +// dpiDct[{A6, 50.0f}] = {207, 291}; +// dpiDct[{A6, 75.0f}] = {310, 437}; +// dpiDct[{A6, 100.0f}] = {413, 582}; +// dpiDct[{A6, 150.0f}] = {620, 874}; +// dpiDct[{A6, 200.0f}] = {826, 1165}; +// dpiDct[{A6, 240.0f}] = {992, 1398}; +// dpiDct[{A6, 300.0f}] = {1240, 1748}; +// dpiDct[{A6, 400.0f}] = {1653, 2330}; +// dpiDct[{A6, 600.0f}] = {2480, 3496}; + +// //1.5��A3 +// dpiDct[{USStatement, 50.0f}] = {585, (LONG)(827*1.5)}; +// dpiDct[{USStatement, 75.0f}] = {877, (LONG)(1240*1.5)}; +// dpiDct[{USStatement, 100.0f}] = {1169, (LONG)(1653*1.5)}; +// dpiDct[{USStatement, 150.0f}] = {1753, (LONG)(2480*1.5)}; +// dpiDct[{USStatement, 200.0f}] = {2338, (LONG)(3307*1.5)}; +// dpiDct[{USStatement, 240.0f}] = {2806, (LONG)(3968*1.5)}; +// dpiDct[{USStatement, 300.0f}] = {3507, (LONG)(4960*1.5)}; +// dpiDct[{USStatement, 400.0f}] = {4677, (LONG)(6614*1.5)}; +// dpiDct[{USStatement, 600.0f}] = {7015, (LONG)(9921*1.5)}; + +// //add lyc 2019 12 18 ���ĸ壬2��A3 +// #ifdef G300SCANNER +// dpiDct[{MaxSize, 50.0f}] = {413, 585); +// dpiDct[{MaxSize, 75.0f}] = {620, 877); +// dpiDct[{MaxSize, 100.0f}] = {826, 1169*2}; +// dpiDct[{MaxSize, 150.0f}] = {1240, 1753*2}; +// dpiDct[{MaxSize, 200.0f}] = {1653, 2338*2}; +// dpiDct[{MaxSize, 240.0f}] = {1984, 2806*2}; +// dpiDct[{MaxSize, 300.0f}] = {2480, 3507*2}; +// dpiDct[{MaxSize, 400.0f}] = {3307, 4677*2}; +// dpiDct[{MaxSize, 600.0f}] = {4960, 7015*2}; +// #elif defined(G400SCANNER)//G400 ֧��������Ϊ1.5��A3 +// dpiDct[{MaxSize, 50.0f}] = {585, 1653}; +// dpiDct[{MaxSize, 75.0f}] = {877, 2480}; +// dpiDct[{MaxSize, 100.0f}] = {1169, 1653 * 1.5}; +// dpiDct[{MaxSize, 150.0f}] = {1753, 2480 * 1.5}; +// dpiDct[{MaxSize, 200.0f}] = {2338, 3307 * 1.5}; +// dpiDct[{MaxSize, 240.0f}] = {2806, 3968 * 1.5}; +// dpiDct[{MaxSize, 300.0f}] = {3507, 4960 * 1.5}; +// dpiDct[{MaxSize, 400.0f}] = {4677, 6614 * 1.5}; +// dpiDct[{MaxSize, 600.0f}] = {7015, 9921 * 1.5}; +// #else +// dpiDct[{MaxSize, 50.0f}] = {585, 1653}; +// dpiDct[{MaxSize, 75.0f}] = {877, 2480}; +// dpiDct[{MaxSize, 100.0f}] = {1169, 1653 * 2}; +// dpiDct[{MaxSize, 150.0f}] = {1753, 2480 * 2}; +// dpiDct[{MaxSize, 200.0f}] = {2338, 3307 * 2}; +// dpiDct[{MaxSize, 240.0f}] = {2806, 3968 * 2}; +// dpiDct[{MaxSize, 300.0f}] = {3507, 4960 * 2}; +// dpiDct[{MaxSize, 400.0f}] = {4677, 6614 * 2}; +// dpiDct[{MaxSize, 600.0f}] = {7015, 9921 * 2}; +// #endif +// //add lyc 2019 12 18 B4 +// dpiDct[{B4, 50.0f}] = {506, 717}; +// dpiDct[{B4, 75.0f}] = {759, 1075}; +// dpiDct[{B4, 100.0f}] = {1011, 1433}; +// dpiDct[{B4, 150.0f}] = {1517, 2149}; +// dpiDct[{B4, 200.0f}] = {2023, 2866}; +// dpiDct[{B4, 240.0f}] = {2428, 3439}; +// dpiDct[{B4, 300.0f}] = {3035, 4299}; +// dpiDct[{B4, 400.0f}] = {4047, 5732}; +// dpiDct[{B4, 600.0f}] = {6070, 8598}; +// //add lyc 2019 12 18 B5 +// dpiDct[{B5, 50.0f}] = {358, 506}; +// dpiDct[{B5, 75.0f}] = {537, 759}; +// dpiDct[{B5, 100.0f}] = {716, 1011}; +// dpiDct[{B5, 150.0f}] = {1074, 1517}; +// dpiDct[{B5, 200.0f}] = {1433, 2023}; +// dpiDct[{B5, 240.0f}] = {1719, 2428}; +// dpiDct[{B5, 300.0f}] = {2149, 3035}; +// dpiDct[{B5, 400.0f}] = {2866, 4047}; +// dpiDct[{B5, 600.0f}] = {4299, 6070}; +// //add lyc 2019 12 18 B6 +// dpiDct[{B6, 50.0f}] = {252, 358}; +// dpiDct[{B6, 75.0f}] = {378, 537}; +// dpiDct[{B6, 100.0f}] = {503, 716}; +// dpiDct[{B6, 150.0f}] = {755, 1074}; +// dpiDct[{B6, 200.0f}] = {1007, 1433}; +// dpiDct[{B6, 240.0f}] = {1209, 1719}; +// dpiDct[{B6, 300.0f}] = {1511, 2149}; +// dpiDct[{B6, 400.0f}] = {2015, 2866}; +// dpiDct[{B6, 600.0f}] = {3023, 4299}; + +// //add lyc 2019 12 18 DOUBLE LETTER +// dpiDct[{USLedger, 50.0f}] = {550, 850}; +// dpiDct[{USLedger, 75.0f}] = {825, 1275}; +// dpiDct[{USLedger, 100.0f}] = {1100, 1700}; +// dpiDct[{USLedger, 150.0f}] = {1650, 2550}; +// dpiDct[{USLedger, 200.0f}] = {2200, 3400}; +// dpiDct[{USLedger, 240.0f}] = {2640, 4080}; +// dpiDct[{USLedger, 300.0f}] = {3300, 5100}; +// dpiDct[{USLedger, 400.0f}] = {4400, 6800}; +// dpiDct[{USLedger, 600.0f}] = {6600, 10200}; +// //add lyc 2019 12 18 LETTER +// dpiDct[{USLetter, 50.0f}] = {425, 550}; +// dpiDct[{USLetter, 75.0f}] = {638, 825}; +// dpiDct[{USLetter, 100.0f}] = {850, 1100}; +// dpiDct[{USLetter, 150.0f}] = {1275, 1650}; +// dpiDct[{USLetter, 200.0f}] = {1700, 2200}; +// dpiDct[{USLetter, 240.0f}] = {2040, 2640}; +// dpiDct[{USLetter, 300.0f}] = {2550, 3300}; +// dpiDct[{USLetter, 400.0f}] = {3400, 4400}; +// dpiDct[{USLetter, 600.0f}] = {5100, 6600}; + +// //add lyc 2019 12 18 LETTER +// dpiDct[{USLegal, 50.0f}] = {425, 700}; +// dpiDct[{USLegal, 75.0f}] = {638, 1050}; +// dpiDct[{USLegal, 100.0f}] = {850, 1400}; +// dpiDct[{USLegal, 150.0f}] = {1275, 2100}; +// dpiDct[{USLegal, 200.0f}] = {1700, 2800}; +// dpiDct[{USLegal, 240.0f}] = {2040, 3360}; +// dpiDct[{USLegal, 300.0f}] = {2550, 4200}; +// dpiDct[{USLegal, 400.0f}] = {3400, 5600}; +// dpiDct[{USLegal, 600.0f}] = {5100, 8400}; + dpiDct_100.insert({ A3,hgsize{297,420} }); + dpiDct_100.insert({ A4,hgsize{210,297} }); + dpiDct_100.insert({ A5,hgsize{148,210} }); + dpiDct_100.insert({ A6,hgsize{105,148} }); + dpiDct_100.insert({ B4,hgsize{250,353} }); + dpiDct_100.insert({ B5,hgsize{176,250} }); + dpiDct_100.insert({ B6,hgsize{125,176} }); + dpiDct_100.insert({ MaxSize,hgsize{297,420 * 2} }); + dpiDct_100.insert({ USStatement,hgsize{297,long(420 * 1.5)} }); + dpiDct_100.insert({ USLetter,hgsize{216,279} }); + dpiDct_100.insert({ USLegal,hgsize{216,356} }); + dpiDct_100.insert({ USLedger,hgsize{279,432} }); + dpiDct_100.insert({ None,hgsize{297,420} }); + + dpiDct_400.insert({ A3,hgsize{297,420} }); + dpiDct_400.insert({ A4,hgsize{210,297} }); + dpiDct_400.insert({ A5,hgsize{148,210} }); + dpiDct_400.insert({ A6,hgsize{105,148} }); + dpiDct_400.insert({ B4,hgsize{250,353} }); + dpiDct_400.insert({ B5,hgsize{176,250} }); + dpiDct_400.insert({ B6,hgsize{125,176} }); + dpiDct_400.insert({ MaxSize,hgsize{297,long(420 * 1.5)} }); + dpiDct_400.insert({ USStatement,hgsize{297,long(420 * 1.5)} }); + dpiDct_400.insert({ USLetter,hgsize{216,279} }); + dpiDct_400.insert({ USLegal,hgsize{216,356} }); + dpiDct_400.insert({ USLedger,hgsize{279,432} }); + dpiDct_400.insert({ None,hgsize{297,420} }); + + + dpiDct_300.insert({ A4,hgsize{210,297} }); + dpiDct_300.insert({ A5,hgsize{148,210} }); + dpiDct_300.insert({ A6,hgsize{105,148} }); + dpiDct_300.insert({ B5,hgsize{176,250} }); + dpiDct_300.insert({ B6,hgsize{125,176} }); + dpiDct_300.insert({ MaxSize,hgsize{210,long(297 * 2)} }); + dpiDct_300.insert({ USStatement,hgsize{210,long(297 * 1.5)} }); + dpiDct_300.insert({ USLetter,hgsize{216,279} }); + dpiDct_300.insert({ USLegal,hgsize{216,356} }); + dpiDct_300.insert({ None,hgsize{210,297} }); + + } + + hgsize PaperSize::GetPaperSize(DWORD paperType, float dpi,int orentation,ScannerSerial serial) + { + std::map papersize ; + if(serial == ScannerSerial::G10039Serial || serial == ScannerSerial::G20039Serial || serial == ScannerSerial::G100Serial || serial == ScannerSerial::G200Serial) + papersize = dpiDct_100; + else if(serial == ScannerSerial::G300Serial) + papersize = dpiDct_300; + else + papersize = dpiDct_400; + hgsize resize(0,0); + if(serial == ScannerSerial::G300Serial) + resize=hgsize{1654,2338}; + else + resize=hgsize{2338, 3307}; + if (papersize.find((TwSS)paperType) != papersize.end() && (dpi > 99 && dpi < 601)) { + + if (orentation == 0){ + resize.cx = papersize[(TwSS)paperType].cx * dpi / 25.4; + resize.cy = papersize[(TwSS)paperType].cy * dpi / 25.4; + return resize; + } + else{ + resize.cy = papersize[(TwSS)paperType].cx * dpi / 25.4; + resize.cx = papersize[(TwSS)paperType].cy * dpi / 25.4; + return resize; + } + } + return resize; + } + +} diff --git a/hgdev/PaperSize.h b/hgdev/PaperSize.h new file mode 100644 index 0000000..9d958e2 --- /dev/null +++ b/hgdev/PaperSize.h @@ -0,0 +1,45 @@ +#ifndef PAPER_SIZE_H +#define PAPER_SIZE_H + +#include + +#ifdef WIN32 +#include +#endif +#include "sane_common.h" +#include + +typedef unsigned long DWORD; +typedef long LONG; + + +typedef struct Paper_Status { + unsigned int Paper; + unsigned int Orentate; + friend bool operator<(const struct Paper_Status& a, const struct Paper_Status& b) { + if (a.Paper < b.Paper || + (a.Paper == b.Paper && a.Orentate < b.Orentate)) { + return true; + } + return false; + } +}PaperStatus; + +namespace Device { + class PaperSize + { + public: + PaperSize(); + ~PaperSize(); + private: + void InitPaperMap(); + std::map, hgsize> dpiDct; + std::map dpiDct_100; + std::map dpiDct_400; + std::map dpiDct_300; + public: + hgsize GetPaperSize(DWORD paperType, float dpi, int orentation,ScannerSerial serial); + }; +} + +#endif diff --git a/qt-correction-tool/scn_usb.cpp b/hgdev/UsbScanEx.cpp similarity index 83% rename from qt-correction-tool/scn_usb.cpp rename to hgdev/UsbScanEx.cpp index 34166de..394fcc9 100644 --- a/qt-correction-tool/scn_usb.cpp +++ b/hgdev/UsbScanEx.cpp @@ -1,6 +1,5 @@ #ifdef WIN32 -#include "stdafx.h" -#include "scn_usb.h" +#include "UsbScanEx.h" #include #include @@ -12,14 +11,14 @@ UsbScanEx::UsbScanEx(int index) memset(ov, 0, sizeof(ov)); CTRL_IN_OUT = 3; for (int i = 0; i < (sizeof(ov) / sizeof(ov[0])); i++) - ov[i].hEvent = CreateEvent(NULL, FALSE, FALSE, NULL); + ov[i].hEvent = CreateEvent(0, FALSE, FALSE, 0); } UsbScanEx::~UsbScanEx() { if (m_h_dev != INVALID_HANDLE_VALUE) close(); - + for (int i = 0; i < (sizeof(ov) / sizeof(ov[0])); i++) CloseHandle(ov[i].hEvent); } @@ -39,28 +38,27 @@ bool UsbScanEx::open() m_h_dev = CreateFile(szDevPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, + 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, - NULL); + 0); if (m_h_dev != INVALID_HANDLE_VALUE) { m_b_is_connected = TRUE; b_ret = DeviceIoControl(m_h_dev, (DWORD)IOCTL_GET_PIPE_CONFIGURATION, - NULL, 0, &m_usbscan_config, sizeof(USBSCAN_PIPE_CONFIGURATION), - &cbRet, NULL); + 0, 0, &m_usbscan_config, sizeof(USBSCAN_PIPE_CONFIGURATION), + &cbRet, 0); if (b_ret && m_usbscan_config.NumberOfPipes > 0) { for (int by_i = 0x00; (ULONG)by_i < m_usbscan_config.NumberOfPipes; by_i++) { - TCHAR szPipePath[MAX_PATH] = { 0 }; _stprintf(szPipePath, TEXT("\\\\.\\Usbscan%d\\%d"), m_h_index, by_i); m_usb_pipes[by_i].pipe_info = m_usbscan_config.PipeInfo[by_i]; m_usb_pipes[by_i].h_pipe = CreateFile(szPipePath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, + 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, - NULL); + 0); if (m_usbscan_config.PipeInfo[by_i].PipeType == USBSCAN_PIPE_INTERRUPT) { INT_IN = by_i; } @@ -69,10 +67,10 @@ bool UsbScanEx::open() BULK_IN = by_i; } else { - BULK_OUT = by_i; + BULK_OUT = by_i; } } - b_ret = DeviceIoControl(m_usb_pipes[by_i].h_pipe, IOCTL_SET_TIMEOUT, &ut, sizeof(ut), NULL, 0, &cbRet, NULL); + b_ret = DeviceIoControl(m_usb_pipes[by_i].h_pipe, IOCTL_SET_TIMEOUT, &ut, sizeof(ut), 0, 0, &cbRet, 0); } } } @@ -83,12 +81,6 @@ bool UsbScanEx::open() return m_h_dev; } -void UsbScanEx::set_usbhotplug_callback(usbhotplug_callback callback, void* userdata) -{ - hotplug_call = callback; - usrdata = userdata; -} - bool UsbScanEx::close() { BOOL b_ret = FALSE; @@ -102,16 +94,16 @@ bool UsbScanEx::close() memset(&overlapped, 0, sizeof(OVERLAPPED)); overlapped.hEvent = - CreateEvent(NULL, // pointer to security attributes + CreateEvent(0, // pointer to security attributes FALSE, // automatic reset FALSE, // initialize to nosignaled - NULL); // pointer to the event-object name + 0); // pointer to the event-object name bState = DeviceIoControl(m_h_dev, - (DWORD)IOCTL_CANCEL_IO, + (DWORD)IOCTL_CANCEL_IO, (LPVOID)&pipeType, sizeof(PIPE_TYPE), - NULL, + 0, 0, &cbRet, &overlapped); @@ -119,12 +111,12 @@ bool UsbScanEx::close() CloseHandle(overlapped.hEvent); for (by_i = 0x00; by_i < m_usbscan_config.NumberOfPipes; by_i++) { - CancelIo(m_usb_pipes[by_i].h_pipe); + CancelIo(m_usb_pipes[by_i].h_pipe); CloseHandle(m_usb_pipes[by_i].h_pipe); m_usb_pipes[by_i].h_pipe = INVALID_HANDLE_VALUE; } - CancelIo(m_h_dev); + CancelIo(m_h_dev); b_ret = CloseHandle(m_h_dev); if (b_ret) { m_h_dev = INVALID_HANDLE_VALUE; @@ -145,36 +137,34 @@ int UsbScanEx::read_bulk(void* data, int len) BOOL b_ret = FALSE; HANDLE h_pipe = m_usb_pipes[BULK_IN].h_pipe; unsigned long pdw_ret = len; - LPOVERLAPPED lp_overlap = ov + BULK_IN; + LPOVERLAPPED lp_overlap = ov+BULK_IN; lp_overlap->Internal = 0; lp_overlap->InternalHigh = 0; lp_overlap->Offset = 0; lp_overlap->OffsetHigh = 0; lp_overlap->Pointer = 0; - if (m_h_dev != NULL) { + if (m_h_dev != 0) { b_ret = ReadFile(h_pipe, data, len, &pdw_ret, lp_overlap); if (b_ret) { return pdw_ret; } else { - int error_code = GetLastError(); - switch (error_code) + switch (GetLastError()) { case ERROR_IO_PENDING: GetOverlappedResult(h_pipe, lp_overlap, &pdw_ret, TRUE); return pdw_ret; - case ERROR_FILE_NOT_FOUND: case ERROR_ACCESS_DENIED: m_b_is_connected = false; - if (hotplug_call) { - hotplug_call(true, usrdata); + if (m_callback&&m_usrdata) { + m_callback(true, m_usrdata); } break; default: - //writelog("Usb read_bulk error code ID: " + std::to_string(error_code)); + int a = 0; break; } } @@ -182,7 +172,6 @@ int UsbScanEx::read_bulk(void* data, int len) return 0; } - int UsbScanEx::write_bulk(void* data, int len) { BOOL b_ret = FALSE; @@ -200,28 +189,32 @@ int UsbScanEx::write_bulk(void* data, int len) return dw_size; } else { - int errorcode = GetLastError(); - switch (errorcode) + switch (GetLastError()) { case ERROR_IO_PENDING: GetOverlappedResult(h_pipe, lp_overlap, &dw_size, TRUE); return dw_size; - - case ERROR_FILE_NOT_FOUND: - case ERROR_ACCESS_DENIED: + case ERROR_FILE_NOT_FOUND: + case ERROR_ACCESS_DENIED: m_b_is_connected = false; - if (hotplug_call) { - hotplug_call(true, usrdata); + if (m_callback&&m_usrdata) { + m_callback(true, m_usrdata); } break; default: - //writelog("Usb write_bulk error code ID: " + std::to_string(errorcode)); + int a = 0; break; } } return 0; } +void UsbScanEx::set_usbcallback(usbcallback usbcall, void * usrdata) +{ + m_callback = usbcall; + m_usrdata = usrdata; +} + int UsbScanEx::control_msg(int rtype, int req, int value, int index, int len, void* data) { BOOL b_ret = FALSE; @@ -267,7 +260,7 @@ int UsbScanEx::read_int(void* data, int len) if (m_h_dev == INVALID_HANDLE_VALUE) return FALSE; - b_ret = DeviceIoControl(h_pipe, (DWORD)IOCTL_WAIT_ON_DEVICE_EVENT, NULL, 0, + b_ret = DeviceIoControl(h_pipe, (DWORD)IOCTL_WAIT_ON_DEVICE_EVENT, 0, 0, data, len, &dw_ret, lp_overlap); if (b_ret) { @@ -282,9 +275,6 @@ int UsbScanEx::read_int(void* data, int len) case ERROR_FILE_NOT_FOUND: m_b_is_connected = false; - if (hotplug_call) { - hotplug_call(true, usrdata); - } break; default: break; @@ -319,14 +309,14 @@ std::list> UsbScan_List::find_vid_pid(int vid, int pid) return usbs; } -std::list UsbScan_List::find_all_usb() +std::vector UsbScan_List::find_all_usb() { BOOL b_ret = FALSE; DWORD cbRet = 0; TCHAR szDevPath[MAX_PATH] = { 0 }; DEVICE_DESCRIPTOR dev_desc; HANDLE h_dev; - std::list usbs; + std::vector usbs; usb_scan_dev_info dev_info; for (int i = 0; i < 1024; i++) { @@ -335,14 +325,14 @@ std::list UsbScan_List::find_all_usb() h_dev = CreateFile(szDevPath, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, - NULL, + 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, - NULL); + 0); if (h_dev != INVALID_HANDLE_VALUE) { b_ret = DeviceIoControl(h_dev, (DWORD)IOCTL_GET_DEVICE_DESCRIPTOR, &dev_desc, sizeof(dev_desc), &dev_desc, sizeof(dev_desc), - &cbRet, NULL); + &cbRet, 0); if (b_ret != 0) { dev_info.index = i; dev_info.vid = dev_desc.usVendorId; diff --git a/hgdev/UsbScanEx.h b/hgdev/UsbScanEx.h new file mode 100644 index 0000000..a4b87ab --- /dev/null +++ b/hgdev/UsbScanEx.h @@ -0,0 +1,86 @@ +#ifndef USB_SCAN_EX_H +#define USB_SCAN_EX_H + +#ifdef WIN32 +#include +#include +#include +#include +#include "IUsb.h" + + +#pragma pack(1) +struct tag_usb_pipe +{ + HANDLE h_pipe; + USBSCAN_PIPE_INFORMATION pipe_info; + OVERLAPPED overlap; +}; +typedef struct tag_usb_pipe usb_pipe_t, * pusb_pipe_t; +#pragma pack() + +typedef struct tag_usb_scan_dev_info +{ + WORD vid; + WORD pid; + WORD index; +}usb_scan_dev_info, * pusb_scan_dev_info; + +typedef struct tag_usb_scan_dev +{ + USHORT _NumberOfDevs; + tag_usb_scan_dev_info dev_infos[1024]; +}usb_scan_dev, * pusb_scan_dev; + +class UsbScanEx : public IUsb +{ +public: + UsbScanEx(int index); + virtual ~UsbScanEx(); + // ͨ IUsb ̳ + virtual bool open() override; + virtual bool close() override; + virtual void set_timeout(int timeout) override; + virtual int read_bulk(void *data, int len) override; + virtual int write_bulk(void *data, int len) override; + virtual void set_usbcallback(usbcallback usbcall, void* usrdata) override; + virtual int control_msg(int rtype, int req, int value, int index, int len, void* data) override; + virtual bool is_open() override; + virtual bool is_connected() override; + virtual int read_int(void* data, int len) override; + +private: + + int BULK_OUT; + int BULK_IN; + int INT_IN; + int CTRL_IN_OUT; + USBSCAN_PIPE_CONFIGURATION m_usbscan_config; + usb_pipe_t m_usb_pipes[MAX_NUM_PIPES]; + HANDLE m_h_dev; + bool m_b_is_connected; + int m_h_index; + int timeout; + OVERLAPPED ov[4]; + void* m_usrdata; + usbcallback m_callback; +}; + + +class UsbScan_List +{ +public: + ~UsbScan_List(); + + static std::list> find_all(); + static std::list> find_vid_pid(int vid, int pid); + static std::vector find_all_usb(); +private: + + UsbScan_List(); + UsbScan_List(uint16_t vendor_id, uint16_t product_id); +}; + +#endif + +#endif diff --git a/hgdev/device_common.h b/hgdev/device_common.h new file mode 100644 index 0000000..8dc6c56 --- /dev/null +++ b/hgdev/device_common.h @@ -0,0 +1,171 @@ +#ifndef DEVICE_COMMON_H +#define DEVICE_COMMON_H + +#define FLASH_ADDR_START (0x300000) //! +#ifndef FILE_TOOLS_H +#define FILE_TOOLS_H #ifdef WIN32 -#include +#include #include -#endif - #include +#include class FileTools { public: - static std::vector getFiles(std::string path) { std::vector files; @@ -19,10 +17,18 @@ public: return files; } - static void write_log(std::string filepath, std::string log) + static void write_log(std::string filename, std::string log) { - std::ofstream ofs(filepath, std::ios::app); - ofs << log << std::endl; + std::string savepath; + std::string str = "D:"; + savepath = str+"\\"+filename; + std::ofstream ofs(savepath, std::ios::app); + + time_t timp; + struct tm* p; + time(&timp); + p=localtime(&timp); + ofs << p->tm_year << "/" << p->tm_mon << "/" << p->tm_mday << " " << p->tm_hour << ":" << p->tm_min << ":" << p->tm_sec << " "< + + + + Release + Win32 + + + Debug + Win32 + + + + {400925E2-0925-3F65-91C9-A899CB1720F0} + hgdev + QtVS_v302 + 10.0.19041.0 + 10.0.19041.0 + + + + v142 + ..\bin\release\ + false + NotSet + StaticLibrary + release\ + hgdev + + + v142 + ..\bin\debug\ + false + NotSet + StaticLibrary + debug\ + hgdev + + + + $(MSBuildProjectDirectory)\QtMsBuild + + + + + + + + + + + + + + + + + msvc2017 + + + + + msvc2017 + + + + + + + + ..\bin\release\ + $(Platform)\$(Configuration)\ + hgdev + true + ..\bin\debug\ + $(Platform)\$(Configuration)\ + hgdev + true + + + + .\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;..\3rdparty\opencv\include;..\3rdparty\nick;..\imageprocess;%(AdditionalIncludeDirectories) + -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) + release\ + false + None + 4577;4467;%(DisableSpecificWarnings) + Sync + $(IntDir) + MaxSpeed + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;_WIN32;NDEBUG;%(PreprocessorDefinitions) + false + $(IntDir)vc$(PlatformToolsetVersion).pdb + MultiThreaded + true + true + Level3 + true + + + $(OutDir)\hgdev.lib + true + + + Unsigned + None + 0 + + + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;_WIN32;NDEBUG;%(PreprocessorDefinitions) + + + + + .\GeneratedFiles\$(ConfigurationName);.\GeneratedFiles;.;..\3rdparty\opencv\include;..\3rdparty\nick;..\imageprocess;%(AdditionalIncludeDirectories) + -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) + debug\ + false + ProgramDatabase + 4577;4467;%(DisableSpecificWarnings) + Sync + $(IntDir) + Disabled + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;_WIN32;%(PreprocessorDefinitions) + false + MultiThreadedDebug + true + true + Level3 + true + $(IntDir)vc$(PlatformToolsetVersion).pdb + + + $(OutDir)\hgdev.lib + true + + + Unsigned + None + 0 + + + _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;_WIN32;_DEBUG;%(PreprocessorDefinitions) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/qt-correction-tool/test.vcxproj.filters b/hgdev/hgdev.vcxproj.filters similarity index 51% rename from qt-correction-tool/test.vcxproj.filters rename to hgdev/hgdev.vcxproj.filters index 3cc71d0..668222f 100644 --- a/qt-correction-tool/test.vcxproj.filters +++ b/hgdev/hgdev.vcxproj.filters @@ -1,24 +1,6 @@  - - {99349809-55BA-4b9d-BF79-8FDBB0286EB3} - ui - false - - - {99349809-55BA-4b9d-BF79-8FDBB0286EB3} - ui - false - - - {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} - cpp;c;cxx;moc;h;def;odl;idl;res; - - - {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} - cpp;c;cxx;moc;h;def;odl;idl;res; - {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd @@ -35,118 +17,108 @@ {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} - ts;xlf - false - - - {639EADAA-A684-42e4-A9AD-28FC9BCB8F7C} - ts;xlf - false - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - - Source Files - - + Source Files Source Files - - Source Files - - - Source Files - - - Source Files - - - Source Files - Header Files + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + Header Files Header Files - + Header Files - + + Header Files + + + Header Files + + Header Files Header Files - + Header Files - + Header Files - - Header Files - - + Header Files Header Files - + Header Files - - Header Files - - - Header Files - - - Header Files - - - - - Generated Files - - - Generated Files - - - - - Translation Files - - - - - Form Files - \ No newline at end of file diff --git a/qt-correction-tool/test.vcxproj.user b/hgdev/hgdev.vcxproj.user similarity index 100% rename from qt-correction-tool/test.vcxproj.user rename to hgdev/hgdev.vcxproj.user diff --git a/qt-correction-tool/json.hpp b/hgdev/json.hpp similarity index 100% rename from qt-correction-tool/json.hpp rename to hgdev/json.hpp diff --git a/hgdev/jsonconfig.cpp b/hgdev/jsonconfig.cpp new file mode 100644 index 0000000..d167a25 --- /dev/null +++ b/hgdev/jsonconfig.cpp @@ -0,0 +1,103 @@ +#pragma once +#include "jsonconfig.h" +#include + +json jsonconfig::loadjson(std::string path) +{ + json js=""; + if(path.empty()) + return js; + std::ifstream f; + f.open(path,std::ios::in | std::ios::binary); + if(f.is_open()){ + //std::string text = (std::stringstream() << f.rdbuf()).str(); + std::string text ((std::istreambuf_iterator(f)), + std::istreambuf_iterator()); + js = json::parse(text); + f.close(); + } + return js; +} + +bool jsonconfig::savejson(std::string path,json js) +{ + if(path.empty()) + return false; + std::ofstream of; + of.open(path); + if(of.is_open()) + { + of.write(js.dump().data(),js.dump().size()); + of.close(); + return true; + } + return false; +} + +json jsonconfig::defaultjson() +{ + std::string jsstr=R"({ + "info":[{ + "type":"GScanO200", + "name":"HUAGO G100 Scanner", + "vid":"3072", + "pid":"100" + }, + { + "type":"GScanO200", + "name":"HUAGO G200 Scanner", + "vid":"3072", + "pid":"200" + }, + { + "type":"GScanO400", + "name":"HUAGO G300 Scanner", + "vid":"3072", + "pid":"300" + }, + { + "type":"GScanO400", + "name":"HUAGO G400 Scanner", + "vid":"3072", + "pid":"400" + }, + { + "type":"GScanO1003399", + "name":"HUAGO G139 Scanner", + "vid":"3072", + "pid":"139" + }, + { + "type":"GScanO1003399", + "name":"HUAGO G239 Scanner", + "vid":"3072", + "pid":"239" + }] +})"; + return json::parse(jsstr); +} + +std::vector jsonconfig::getdevicelist(json js) +{ + std::vector devicelist; + std::cout< +#include +#include +#include +#include +#include +#include "json.hpp" +#include "sane_common.h" + +using json = nlohmann::json; +#ifdef WIN32 +const std::string JSONPATH ="hgscannersdk.json"; +#else +const std::string JSONPATH ="/opt/hgscannersdk.json"; +#endif +struct deviceinfo +{ + uint16_t vid; + uint16_t pid; + std::string name; + std::string type; +}; + + +class jsonconfig +{ +public: + static json loadjson(std::string path); + static bool savejson(std::string path,json js); + static json defaultjson(); + static std::vector getdevicelist(json js); +}; + diff --git a/hgdev/libusbex.cpp b/hgdev/libusbex.cpp new file mode 100644 index 0000000..0d0cf99 --- /dev/null +++ b/hgdev/libusbex.cpp @@ -0,0 +1,482 @@ +#pragma once +#include "libusbex.h" +#include +#include +using namespace std; + +#ifdef WIN32 +#ifdef __cplusplus +FILE iob[] = { *stdin, *stdout, *stderr }; +extern "C" { + FILE* __cdecl _iob(void) { return iob; } +} +#endif +#endif +#ifdef __linux__ +class LibusbContext +{ + +public: + LibusbContext() + :ctx(0) + { + libusb_init(&ctx); + //libusb_set_debug(ctx,LIBUSB_LOG_LEVEL_DEBUG); + } + + ~LibusbContext() + { + libusb_exit(ctx); + } + + libusb_context* ctx; +}; + +class Libusb_device_handle +{ +public: + Libusb_device_handle() + : ldh(0) + , start_callback(false) + , isconnected(false) + , m_usbcallback(0) + , usrdata(0) + { + if (!ctxa.get()) { + ctxa.reset(new LibusbContext); + } + } + + ~Libusb_device_handle() + { + std::cout<<"~Libusb_device_handle enter"<ctx, + (libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), + (libusb_hotplug_flag)LIBUSB_HOTPLUG_ENUMERATE, + product_id, // vid + product_id, // pid + LIBUSB_HOTPLUG_MATCH_ANY, // class + OnUsbHotplugCallback, + this, + &handle); + std::string errorinfo=ret==LIBUSB_SUCCESS?" success":"failed"; + std::cout<<"Libusb_device_handle at libusb_hotplug_register_callback regist "<joinable()) { + start_callback = false; + hotplug_thread->join(); + } + start_callback=true; + hotplug_thread = shared_ptr(new thread(&Libusb_device_handle::loop, this)); + std::cout<<"Libusb_device_handle at hotplug_thread "<<" start" <ctx, vendor_id, product_id); + if(ldh!=0) + { + libusb_claim_interface(ldh,0); + isconnected=true; + } + } + } + } + + int open(libusb_device* dev) { + if (ldh != 0) + close(); + + struct libusb_device_descriptor desc; + + int ret = libusb_get_device_descriptor(dev, &desc); + if (!start_callback) { + int ret = libusb_hotplug_register_callback(ctxa->ctx, + (libusb_hotplug_event)(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED | LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT), + (libusb_hotplug_flag)LIBUSB_HOTPLUG_ENUMERATE, + desc.idVendor, // vid + desc.idProduct, // pid + LIBUSB_HOTPLUG_MATCH_ANY, // class + OnUsbHotplugCallback, + this, + &handle); + std::string errorinfo=ret==LIBUSB_SUCCESS?" success":"failed"; + if(ret == LIBUSB_SUCCESS) + { + std::cout<<"Libusb_device_handle at libusb_hotplug_register_callback regist "<joinable()) { + start_callback = false; + hotplug_thread->join(); + } + start_callback=true; + hotplug_thread = shared_ptr(new thread(&Libusb_device_handle::loop, this)); + std::cout<<"Libusb_device_handle at hotplug_thread "<<" start" <ctx, desc.idVendor, desc.idProduct); + if(ldh!=0) + { + libusb_claim_interface(ldh,0); + isconnected=true; + } + } + } + return 0; + } + + bool is_open() { + return ldh&&isconnected; + } + + int bulk_transfer(unsigned char endpoint, unsigned char* data, int length, int* actual_length, unsigned int timeout) + { + int ret= libusb_bulk_transfer(ldh, endpoint, data, length, actual_length, timeout); + if (ret != LIBUSB_SUCCESS) { + cout << "libusb error info :" << libusb_error_name(ret) << endl; + if(m_usbcallback&&usrdata){ + m_usbcallback(3,usrdata); + } + } + return ret; + } + + int int_transfer(unsigned char endpoint, unsigned char* data, int length, int* actual_length, unsigned int timeout) + { + int ret =libusb_interrupt_transfer(ldh, endpoint, data, length, actual_length, timeout); + if (ret != LIBUSB_SUCCESS) { + //cout << "libusb error info :" << libusb_error_name(ret) << endl; + if(ret != LIBUSB_ERROR_TIMEOUT) + { + if(m_usbcallback&&usrdata){ + m_usbcallback(4,usrdata); + } + } + } + return ret; + } + + int control_transfer(uint8_t request_type, uint8_t bRequest, uint16_t wValue, uint16_t wIndex, + unsigned char* data, uint16_t wLength, unsigned int timeout) + { + int ret = libusb_control_transfer(ldh, request_type, bRequest, wValue, wIndex, data, wLength, timeout); + if (ret != LIBUSB_SUCCESS) { + cout << "libusb error info :" << libusb_error_name(ret) << endl; + if(m_usbcallback&&usrdata){ + //m_usbcallback(2,usrdata); + } + } + return ret; + } + + void close() + { + // if (start_callback) + // { + // std::cout << "Stop" << std::endl; + // libusb_hotplug_deregister_callback(ctxa->ctx, handle); + // start_callback = false; + // hotplug_thread->join(); + // hotplug_thread.reset(); + // hotplug_thread = 0; + // } + if (ldh != 0) + { + libusb_release_interface(ldh, 0); //release the claimed interface + libusb_close(ldh); + ldh = 0; + } + if (start_callback) + { + std::cout << "close Stop enter" << std::endl; + libusb_hotplug_deregister_callback(ctxa->ctx, handle); + std::cout << "close Stop enter 1" << std::endl; + start_callback = false; + hotplug_thread->join(); + std::cout << "close Stop enter 2" << std::endl; + //hotplug_thread->detach(); + hotplug_thread = 0; + std::cout << "close Stop exit" << std::endl; + } + } + + void set_report_callback(usbcallback usbcall, void *usrdata){ + m_usbcallback=usbcall; + this->usrdata =usrdata; + } + +private: + static int LIBUSB_CALL OnUsbHotplugCallback(struct libusb_context* ctx, + struct libusb_device* device, + libusb_hotplug_event event, + void* monitor) { + Libusb_device_handle* This = (Libusb_device_handle*)monitor; + return This->OnUsbHotplug(ctx, device, event); + } + + int OnUsbHotplug(struct libusb_context* ctx, + struct libusb_device* device, + libusb_hotplug_event event) + { + struct libusb_device_descriptor descriptor; + + int ret = libusb_get_device_descriptor(device, &descriptor); + if (LIBUSB_SUCCESS == ret) + { + std::cout << "Got a device: vid= " << std::hex << descriptor.idVendor << ",pid=" << descriptor.idProduct << std::endl; + } + switch (event) { + case LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED: + isconnected = true; + ldh = libusb_open_device_with_vid_pid(ctxa->ctx, descriptor.idVendor, descriptor.idProduct); + if (ldh != 0) { + ret= libusb_claim_interface(ldh, 0); + if(ret==LIBUSB_SUCCESS){ + if(m_usbcallback&&usrdata){ + m_usbcallback(0,usrdata); + } + std::cout << "USBScanner claim_interface success" << std::endl; + } + else{ + std::cout << "USBScanner arriverd and claim_interface failed" << std::endl; + } + }else{ + std::cout << "USBScanner libusb_open_device_with_vid_pid failed" << std::endl; + } + break; + case LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT: + isconnected = false; + std::cout << "USBScanner left" << std::endl; + if(m_usbcallback&&usrdata){ + m_usbcallback(1,usrdata); + } + if(ldh!=0){ + libusb_release_interface(ldh, 0); //release the claimed interface + libusb_close(ldh); + ldh = 0; + } + break; + default: + break; + } + return 0; + } + + void loop() { + while (start_callback) + { + //libusb_handle_events_completed(ctxa->ctx, 0); + timeval tm={1,0}; + auto ret=libusb_handle_events_timeout(ctxa->ctx,&tm); + if(ret<0) + printf("libusb_handle_events_timeout error %s\n",libusb_error_name(ret)); + } + } +private: + libusb_device_handle* ldh; + std::shared_ptr hotplug_thread; + libusb_hotplug_callback_handle handle; + bool start_callback; + bool isconnected; + static std::shared_ptr ctxa; + usbcallback m_usbcallback; + void* usrdata; +}; + +std::shared_ptr Libusb_device_handle::ctxa = std::shared_ptr(); + + +LibUsbEx::LibUsbEx(std::shared_ptr usblist, int index) + : m_usblist(usblist), + m_index(index) +{ +// #if defined(G100SCANNER)||defined(G200SCANNER) +// eps[EP_INT_IN] = LIBUSB_ENDPOINT_IN + 2; +// eps[EP_BULK_IN] = LIBUSB_ENDPOINT_IN + 1; +// eps[EP_BULK_OUT] = LIBUSB_ENDPOINT_OUT + 1; +// #else +// eps[EP_INT_IN] = LIBUSB_ENDPOINT_IN + 3; +// eps[EP_BULK_IN] = LIBUSB_ENDPOINT_IN + 1; +// eps[EP_BULK_OUT] = LIBUSB_ENDPOINT_OUT + 2; +// #endif + timeout = 100; +} + +bool LibUsbEx::open() +{ + m_usb = m_usblist->open(m_index); + Usb_endpoint info = m_usblist->GetendpointInfo(m_index); + eps[EP_INT_IN] = info.int_in; + eps[EP_BULK_IN] = info.bulk_in; + eps[EP_BULK_OUT] = info.bulk_out; + return is_open(); +} + +bool LibUsbEx::close() +{ + if (m_usb.get()) + m_usb->close(); + return true; +} + +bool LibUsbEx::is_open() +{ + return m_usb.get() && m_usb->is_open(); +} + +bool LibUsbEx::is_connected() +{ + return m_usb.get() && m_usb->is_open(); +} + +void LibUsbEx::set_timeout(int timeout) +{ + this->timeout = timeout; +} + +int LibUsbEx::read_bulk(void* data, int len) +{ + m_usb->bulk_transfer(eps[EP_BULK_IN], (unsigned char*)data, len, &len, timeout); + return len; +} + +int LibUsbEx::write_bulk(void* data, int len) +{ + m_usb->bulk_transfer(eps[EP_BULK_OUT], (unsigned char*)data, len, &len, timeout); + return len; +} + +int LibUsbEx::read_int(void* data, int len) +{ + m_usb->int_transfer(eps[EP_INT_IN], (unsigned char*)data, len, &len, timeout); + return len; +} + +int LibUsbEx::control_msg(int rtype, int req, int value, int index, int len, void* data) +{ + return m_usb->control_transfer(rtype, req, value, index, (unsigned char*)data, len, timeout); +} + +void LibUsbEx::set_usbcallback(usbcallback usbcall, void *usrdata) +{ + m_usb->set_report_callback(usbcall,usrdata); +} + +Libusb_List::Libusb_List() : + Libusb_List(0, 0) +{ +} + +Libusb_List::Libusb_List(uint16_t vendor_id, uint16_t product_id) +{ + std::cout<> Libusb_List::find_all() +{ + std::list> usblists; + std::shared_ptr libusblists(new Libusb_List()); + for (int i = 0; i < libusblists->device_count(); i++) + usblists.push_back(std::shared_ptr(new LibUsbEx(libusblists, i))); + return usblists; +} + +std::list> Libusb_List::find_vid_pid(int vid, int pid) +{ + std::cout<<"enter find_vid_pid"<> usblists; + std::shared_ptr libusblists(new Libusb_List(vid, pid)); + std::cout<<"vid "<interface->altsetting->bNumEndpoints;i++) + { + if(config->interface->altsetting->endpoint[i].bEndpointAddress & 0x80) + { + if((config->interface->altsetting->endpoint[i].bmAttributes&0x3) == 2) + m_info.bulk_in = config->interface->altsetting->endpoint[i].bEndpointAddress; + if((config->interface->altsetting->endpoint[i].bmAttributes&0x3) == 3) + m_info.int_in = config->interface->altsetting->endpoint[i].bEndpointAddress; + } + else { + if((config->interface->altsetting->endpoint[i].bmAttributes&0x3) == 2) + m_info.bulk_out = config->interface->altsetting->endpoint[i].bEndpointAddress; + } + } + libusb_free_config_descriptor(config); + return m_info; +} +#endif diff --git a/hgdev/libusbex.h b/hgdev/libusbex.h new file mode 100644 index 0000000..106d9a9 --- /dev/null +++ b/hgdev/libusbex.h @@ -0,0 +1,67 @@ +#ifdef __linux__ + + +#ifndef LIBUSBEX_H +#define LIBUSBEX_H +#include "IUsb.h" +#include +#include +#include +#include + +class Libusb_device_handle; + +class Libusb_List +{ +public: + ~Libusb_List(); + + static std::list> find_all(); + static std::list> find_vid_pid(int vid, int pid); + Usb_endpoint GetendpointInfo(int index); + Usb_endpoint GetendpointInfo(libusb_device * device); + std::shared_ptr open(int index); +private: + Libusb_List(); + Libusb_List(uint16_t vendor_id, uint16_t product_id); + + int device_count(); + void close(); + + libusb_device** devs; + std::vector v_dev; +}; + +class LibUsbEx : public IUsb +{ +public: + LibUsbEx(std::shared_ptr usblist, int index); + virtual bool open() override; + virtual bool close() override; + virtual bool is_open() override; + virtual bool is_connected() override; + virtual void set_timeout(int timeout) override; + virtual void set_usbcallback(usbcallback usbcall,void* usrdata) override; + virtual int read_bulk(void* data, int len) override; + virtual int write_bulk(void* data, int len) override; + virtual int read_int(void* data, int len) override; + virtual int control_msg(int rtype, int req, int value, int index, int len, void* data) override; +private: + const int epnum = 3; + enum EP_TYPE + { + EP_INT_IN, + EP_BULK_IN, + EP_BULK_OUT + }; + + int timeout; + int eps[3]; + + std::shared_ptr m_usb; + std::shared_ptr m_usblist; + int m_index; +}; + +#endif // LIBUSBEX_H +#endif // linux diff --git a/hgdev/scn_config.cpp b/hgdev/scn_config.cpp new file mode 100644 index 0000000..c099e70 --- /dev/null +++ b/hgdev/scn_config.cpp @@ -0,0 +1,44 @@ +//#include "stdafx.h" +#include "scn_config.h" +#include "math.h" + +hgConfigClass::hgConfigClass(GScanCap param) +{ + PaperStatus ps = { (unsigned int)param.paperSize,(unsigned int)param.paperAlign }; + m_param.paper = ContainspaperTypesKey(ps) ? SupPaperTyps_G100[ps] : 0; + m_param.color = ContainsPixTypeKey(param.pixelType) ? SupPixelTypes[param.pixelType] : 2; + m_param.dpi = 1;//Ĭ�� 200dpi ContainsResolutionKey(param.resolution_native) ? SupResolutions[param.resolution_native] : + m_param.double_feed_enbale = param.hardwareParam.doubleFeedDetection; + m_param.stable_enbale = param.hardwareParam.bindingDetection; + m_param.screw_detect_enable = param.hardwareParam.skewDetection.enable; + m_param.screw_detect_level = m_param.screw_detect_enable? secrewMaps[param.hardwareParam.skewDetection.level]:0; + m_param.pc_correct = param.is_correct; + m_param.unused_one = m_param.unused_two = 0; +} + +bool hgConfigClass::ContainspaperTypesKey(PaperStatus key) +{ + if (SupPaperTyps_G100.count(key) > 0) + { + return true; + } + return false; +} + +bool hgConfigClass::ContainsPixTypeKey(uint16_t key) +{ + if (SupPixelTypes.count(key)>0) + { + return true; + } + return false; +} + +bool hgConfigClass::ContainsResolutionKey(float key) +{ + if ( SupResolutions.count(key)>0) + { + return true; + } + return false; +} diff --git a/hgdev/scn_config.h b/hgdev/scn_config.h new file mode 100644 index 0000000..adbd9c7 --- /dev/null +++ b/hgdev/scn_config.h @@ -0,0 +1,32 @@ +#ifndef SCN_CONFIG_H +#define SCN_CONFIG_H + +#include +//#include +#include +#include +#include +#include "IConfig.h" +#include "sane_common.h" + +typedef unsigned short uint16_t; + +class hgConfigClass:public IConfig +{ +public: + hgConfigClass(GScanCap param); +private: + enum Config_Scanner + { + cfStaple, + cfSkewDelection, + SkewLevel0, + SkewLevel1, + SkewLevel2 + }; + bool ContainspaperTypesKey(PaperStatus key); + bool ContainsPixTypeKey(uint16_t key); + bool ContainsResolutionKey(float key); +}; + +#endif \ No newline at end of file diff --git a/hgdev/threadpool.h b/hgdev/threadpool.h new file mode 100644 index 0000000..906cabf --- /dev/null +++ b/hgdev/threadpool.h @@ -0,0 +1,99 @@ +#ifndef THREAD_POOL_H +#define THREAD_POOL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +class ThreadPool { +public: + ThreadPool(); + ThreadPool(size_t); + template + auto enqueue(F&& f, Args&&... args) + -> std::future::type>; + ~ThreadPool(); +private: + // need to keep track of threads so we can join them + std::vector< std::thread > workers; + // the task queue + std::queue< std::function > tasks; + + // synchronization + std::mutex queue_mutex; + std::condition_variable condition; + bool stop; +}; + +// the constructor just launches some amount of workers +inline ThreadPool::ThreadPool(size_t threads) + : stop(false) +{ + for(size_t i = 0;i task; + + { + std::unique_lock lock(this->queue_mutex); + this->condition.wait(lock, + [this]{ return this->stop || !this->tasks.empty(); }); + if(this->stop && this->tasks.empty()) + return; + task = std::move(this->tasks.front()); + this->tasks.pop(); + } + + task(); + } + } + ); +} + +// add new work item to the pool +template +auto ThreadPool::enqueue(F&& f, Args&&... args) + -> std::future::type> +{ + using return_type = typename std::result_of::type; + + auto task = std::make_shared< std::packaged_task >( + std::bind(std::forward(f), std::forward(args)...) + ); + + std::future res = task->get_future(); + { + std::unique_lock lock(queue_mutex); + + // don't allow enqueueing after stopping the pool + if(stop) + throw std::runtime_error("enqueue on stopped ThreadPool"); + + tasks.emplace([task](){ (*task)(); }); + } + condition.notify_one(); + return res; +} + +// the destructor joins all threads +inline ThreadPool::~ThreadPool() +{ + { + std::unique_lock lock(queue_mutex); + stop = true; + } + condition.notify_all(); + for(std::thread &worker: workers) + worker.join(); +} + +#endif diff --git a/imageprocess/IMulti.cpp b/imageprocess/IMulti.cpp new file mode 100644 index 0000000..442cf4c --- /dev/null +++ b/imageprocess/IMulti.cpp @@ -0,0 +1,10 @@ +#include "IMulti.h" + +IMulti::IMulti(void) +{ +} + +IMulti::~IMulti(void) +{ +} + diff --git a/imageprocess/IMulti.h b/imageprocess/IMulti.h new file mode 100644 index 0000000..df7ef35 --- /dev/null +++ b/imageprocess/IMulti.h @@ -0,0 +1,12 @@ +#pragma once +#include +#include +#include "imgprocdefs.h" + +class IMulti +{ +public: + IMulti(void); + virtual ~IMulti(void); + virtual std::vector apply(cv::Mat& pDib) = 0; +}; diff --git a/imageprocess/ImageApply.cpp b/imageprocess/ImageApply.cpp new file mode 100644 index 0000000..80f5fbf --- /dev/null +++ b/imageprocess/ImageApply.cpp @@ -0,0 +1,9 @@ +#include "ImageApply.h" + +CImageApply::CImageApply(void) +{ +} + +CImageApply::~CImageApply(void) +{ +} diff --git a/imageprocess/ImageApply.h b/imageprocess/ImageApply.h new file mode 100644 index 0000000..cb27842 --- /dev/null +++ b/imageprocess/ImageApply.h @@ -0,0 +1,34 @@ +/* + * ==================================================== + + * 功能:所有图像处理功能类的基类 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:2020/4/21 + * 版本号:v1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_H +#define IMAGE_APPLY_H + +#include +#include +#include +#include "imgprocdefs.h" + +class CImageApply +{ +public: + CImageApply(void); + virtual ~CImageApply(void); + + virtual void apply(cv::Mat& pDib,int side) = 0; + + virtual void apply(std::vector& mats, bool isTwoSide) = 0; +}; + +typedef std::shared_ptr ImageApplyPtr; + +#endif // !IMAGE_APPLY_H diff --git a/imageprocess/ImageApplyAdjustColors.cpp b/imageprocess/ImageApplyAdjustColors.cpp new file mode 100644 index 0000000..6b20a20 --- /dev/null +++ b/imageprocess/ImageApplyAdjustColors.cpp @@ -0,0 +1,91 @@ +#include "ImageApplyAdjustColors.h" + +CImageApplyAdjustColors::CImageApplyAdjustColors(void) + : m_brightness(0) + , m_contrast(0) + , m_gamma(1.0f) + , lut(1, 256, CV_8UC1) +{ + update_lutData(); +} + +CImageApplyAdjustColors::CImageApplyAdjustColors(int brightness, int contrast, float gamma) + : lut(1, 256, CV_8UC1) +{ + setAdjustColors(brightness, contrast, gamma); +} + +CImageApplyAdjustColors::~CImageApplyAdjustColors(void) +{ + +} + +void CImageApplyAdjustColors::apply(cv::Mat& pDib,int side) +{ + (void)side; + if (pDib.empty()) return; + + if (m_brightness != 0 || m_contrast != 0 || m_gamma < 0.999999f || m_gamma > 1.000001f) + cv::LUT(pDib, lut, pDib); +} + +void CImageApplyAdjustColors::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if(!var.empty()) + apply(var, 0); + i++; + } +} + +void CImageApplyAdjustColors::setAdjustColors(int brightness, int contrast, float gamma) +{ + m_brightness = cv::max(-255, cv::min(brightness, 255)); + m_contrast = cv::max(-127, cv::min(contrast, 127)); + m_gamma = cv::max(0.1f, cv::min(gamma, 5.0f)); + update_lutData(); +} + +void CImageApplyAdjustColors::setBrightness(int brightness) +{ + m_brightness = cv::max(-255, cv::min(brightness, 255)); + update_lutData(); +} + +void CImageApplyAdjustColors::setContrast(int contrast) +{ + m_contrast = cv::max(-127, cv::min(contrast, 127)); + update_lutData(); +} + +void CImageApplyAdjustColors::setGamma(float gamma) +{ + m_gamma = cv::max(0.1f, cv::min(gamma, 5.0f)); + update_lutData(); +} + +void CImageApplyAdjustColors::update_lutData() +{ + unsigned char* ptr = lut.data; + //update gamma + + uchar buffer[256]; + for (int i = 0; i < 256; i++) + { + //update brightness + ptr[i] = static_cast(cv::max(0, cv::min(i + m_brightness, 255))); + + //update contrast + if (ptr[i] < 128) + ptr[i] = static_cast(cv::max(0, cv::min(ptr[i] - m_contrast, 127))); + else + ptr[i] = static_cast(cv::max(127, cv::min(ptr[i] + m_contrast, 255))); + } + float g = 1.0f / m_gamma; + for (int i = 0; i < 256; i++) + ptr[i] = static_cast(cv::min(255, static_cast(pow(static_cast(ptr[i]) / 255.0f, g) * 255.0f + 0.5f))); +} diff --git a/imageprocess/ImageApplyAdjustColors.h b/imageprocess/ImageApplyAdjustColors.h new file mode 100644 index 0000000..3ad7541 --- /dev/null +++ b/imageprocess/ImageApplyAdjustColors.h @@ -0,0 +1,65 @@ +/* + * ==================================================== + + * 功能:色彩调整,可以调整伽马、亮度、对比度效果。叠加优先级:亮度 > 对比度 > 伽马 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:2020/4/21 + * 版本号:v1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_ADJUST_COLOR_H +#define IMAGE_APPLY_ADJUST_COLOR_H + +#include "ImageApply.h" + +class CImageApplyAdjustColors : public CImageApply +{ +public: + + CImageApplyAdjustColors(void); + + /* + * brightness [in]: 亮度调节,取值范围[-255, 255] + * constrast [in]: 对比度调节,取值范围[-128, 127] + * gamma [in]: 伽马调节,取值范围[0.1, 5.0] + */ + CImageApplyAdjustColors(int brightness, int contrast, float gamma); + + virtual ~CImageApplyAdjustColors(void); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + void setAdjustColors(int brightness, int contrast, float gamma); + + int getContrast() { return m_contrast; } + + int getBrightness() { return m_brightness; } + + double getGamma() { return m_gamma; } + + void setBrightness(int brightness); + + void setContrast(int contrast); + + void setGamma(float gamma); + +private: + + void update_lutData(); + +private: + + int m_brightness; + int m_contrast; + float m_gamma; + cv::Mat lut; +}; + +#endif // !IMAGE_APPLY_ADJUST_COLOR_H + + diff --git a/imageprocess/ImageApplyAutoContrast.cpp b/imageprocess/ImageApplyAutoContrast.cpp new file mode 100644 index 0000000..4cd0d5f --- /dev/null +++ b/imageprocess/ImageApplyAutoContrast.cpp @@ -0,0 +1,43 @@ +#include "ImageApplyAutoContrast.h" +#include +using namespace std; +using namespace cv; + +CImageApplyAutoContrast::CImageApplyAutoContrast() +{ +} + +CImageApplyAutoContrast::~CImageApplyAutoContrast() +{ +} + +void CImageApplyAutoContrast::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (pDib.empty()) return; + + if(pDib.channels() == 1) + cv::equalizeHist(pDib,pDib); + else + { + std::vector mats(3); + cv::split(pDib,mats); + for(size_t i = 0; i < mats.size(); i++) + if(!mats[i].empty()) + cv::equalizeHist(mats[i], mats[i]); + cv::merge(mats,pDib); + } +} + +void CImageApplyAutoContrast::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyAutoContrast.h b/imageprocess/ImageApplyAutoContrast.h new file mode 100644 index 0000000..d8abf05 --- /dev/null +++ b/imageprocess/ImageApplyAutoContrast.h @@ -0,0 +1,32 @@ +/* + * ==================================================== + + * ܣԶɫУʵԭΪֱͼ⻯ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_AUTO_CONTRAST_H +#define IMAGE_APPLY_AUTO_CONTRAST_H + +#include "ImageApply.h" + +class CImageApplyAutoContrast : public CImageApply +{ +public: + + CImageApplyAutoContrast(); + + virtual ~CImageApplyAutoContrast(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); +private: + +}; +#endif // !IMAGE_APPLY_AUTO_CONTRAST_H diff --git a/imageprocess/ImageApplyAutoCrop.cpp b/imageprocess/ImageApplyAutoCrop.cpp new file mode 100644 index 0000000..7e4f73f --- /dev/null +++ b/imageprocess/ImageApplyAutoCrop.cpp @@ -0,0 +1,232 @@ +#include "ImageApplyAutoCrop.h" +#include "ImageProcess_Public.h" + +CImageApplyAutoCrop::CImageApplyAutoCrop() + : m_isCrop(false) + , m_isDesaskew(false) + , m_isFillBlank(false) + , m_isConvexHull(true) + , m_isFillColor(false) + , m_threshold(40) + , m_noise(2) + , m_indent(5) +{ +} + +CImageApplyAutoCrop::CImageApplyAutoCrop(bool isCrop, bool isDesaskew, bool isFillBlank, const cv::Size& fixedSize, bool isConvex, bool isFillColor, double threshold, int noise, int indent) + : m_isCrop(isCrop) + , m_isDesaskew(isDesaskew) + , m_isFillBlank(isFillBlank) + , m_isConvexHull(isConvex) + , m_isFillColor(isFillColor) + , m_threshold(threshold) + , m_noise(noise) + , m_indent(indent) + , m_fixedSize(fixedSize) +{ +} + +CImageApplyAutoCrop::~CImageApplyAutoCrop() +{ +} + +void CImageApplyAutoCrop::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (pDib.empty()) return; +#if CV_VERSION_EPOCH >= 3 && CV_VERSION_MAJOR > 2 + if (!m_isCrop && !m_isDesaskew && !m_isFillBlank && m_fixedSize.empty()) return; +#else + if (!m_isCrop && !m_isDesaskew && !m_isFillBlank && m_fixedSize == cv::Size()) return; +#endif + + cv::Mat src = pDib; + cv::Mat thre; + cv::Mat dst; + hg::threshold_Mat(src, thre, m_threshold); + + if (m_noise > 0) + { + cv::Mat element = getStructuringElement(cv::MORPH_RECT, cv::Size(m_noise, m_noise)); + cv::morphologyEx(thre, thre, cv::MORPH_OPEN, element); + } + std::vector hierarchy; + std::vector> contours; + + hg::findContours(thre, contours, hierarchy, cv::RETR_EXTERNAL); + m_maxContour = hg::getMaxContour(contours, hierarchy); + + if (m_maxContour.size() == 0) + { + thre.release(); +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyAutoCrop apply"); +#endif // LOG + return; + } + thre.release(); + dst.release(); + + cv::RotatedRect rect = hg::getBoundingRect(m_maxContour); + cv::Rect boudingRect = cv::boundingRect(m_maxContour); + boudingRect.x -= 1; + boudingRect.y -= 1; + boudingRect.width += 2; + boudingRect.height += 2; + + if (m_isDesaskew && rect.angle != 0) + { + cv::Point2f srcTri[4]; + cv::Point2f dstTri[3]; + rect.points(srcTri); + + dstTri[0] = cv::Point2f(0, rect.size.height - 1); + dstTri[1] = cv::Point2f(0, 0); + dstTri[2] = cv::Point2f(rect.size.width - 1, 0); + cv::Mat warp_mat; + warp_mat = cv::getAffineTransform(srcTri, dstTri); + cv::warpAffine(src, dst, warp_mat, rect.size); + } + else + dst = src(boudingRect & cv::Rect(0, 0, src.cols, src.rows)); + + m_maxContour.clear(); + m_maxContour.push_back(cv::Point(-1, dst.rows)); + m_maxContour.push_back(cv::Point(-1, -1)); + m_maxContour.push_back(cv::Point(dst.cols, -1)); + m_maxContour.push_back(cv::Point(dst.cols, dst.rows)); + + if (m_isFillBlank) + { + cv::Mat thre_dst; + hg::threshold_Mat(dst, thre_dst, m_threshold); + + if (m_indent > 0) + { + std::vector rectEdge{ cv::Point(0, 0) ,cv::Point(thre_dst.cols - 1, 0), + cv::Point(thre_dst.cols - 1, thre_dst.rows - 1), cv::Point(0, thre_dst.rows - 1) }; + std::vector> rectEdges{ rectEdge }; + cv::drawContours(thre_dst, rectEdges, 0, cv::Scalar::all(0)); + cv::Mat element = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(m_indent, m_indent)); + cv::erode(thre_dst, thre_dst, element, cv::Point(-1, -1), 1); + } + hierarchy.clear(); + contours.clear(); + m_maxContour.clear(); + + hg::findContours(thre_dst, contours, hierarchy, cv::RETR_EXTERNAL); + if (m_isConvexHull) + { + m_maxContour = hg::getMaxContour(contours, hierarchy); + hg::convexHull(m_maxContour, m_maxContour); + contours.clear(); + contours.push_back(m_maxContour); + } + + contours.push_back(std::vector()); + contours[contours.size() - 1].push_back(cv::Point(-1, dst.rows - 1)); + contours[contours.size() - 1].push_back(cv::Point(-1, -1)); + contours[contours.size() - 1].push_back(cv::Point(dst.cols, -1)); + contours[contours.size() - 1].push_back(cv::Point(dst.cols, dst.rows)); + + hg::fillPolys(dst, contours, m_isFillColor ? getBackGroudColor(pDib, rect.size.area()) : cv::Scalar(255, 255, 255)); + } + + pDib.release(); + if (/*(m_isCrop && side == 0) || (side == 1 && m_fixedSize.width * m_fixedSize.height == 0)*/ m_isCrop) + pDib = dst.clone(); + else + { + pDib = cv::Mat(m_fixedSize, dst.type(), m_isFillBlank ? cv::Scalar(255, 255, 255) : cv::Scalar(0, 0, 0)); + + cv::Rect roi; + roi.x = dst.cols > pDib.cols ? (dst.cols - pDib.cols) / 2 : 0; + roi.width = cv::min(pDib.cols, dst.cols); + roi.y = dst.rows > pDib.rows ? (dst.rows - pDib.rows) / 2 : 0; + roi.height = cv::min(pDib.rows, dst.rows); + cv::Rect rect((pDib.cols - roi.width) / 2, (pDib.rows - roi.height) / 2, roi.width, roi.height); + + for (cv::Point& p : m_maxContour) + p += roi.tl(); + dst(roi).copyTo(pDib(rect)); + } +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyAutoCrop apply8"); +#endif // LOG +} + +void CImageApplyAutoCrop::apply(std::vector& mats, bool isTwoSide) +{ + if (mats.empty()) return; + if (!mats[0].empty()) { + apply(mats[0], 0); + } + + if (isTwoSide && mats.size() > 1) + { + cv::Size dSize = m_fixedSize; + if (!mats[0].empty()) + m_fixedSize = mats[0].size(); + if (!mats[1].empty()) { + apply(mats[1], 1); + } + + if (!mats[0].empty()) + m_fixedSize = dSize; + } +} + +cv::Scalar CImageApplyAutoCrop::getBackGroudColor(const cv::Mat& image, int total) +{ + if (image.channels() == 3) + { + cv::Mat image_bgr[3]; + cv::split(image, image_bgr); + + uchar bgr[3]; + for (size_t i = 0; i < 3; i++) + bgr[i] = getBackGroudChannelMean(image_bgr[i], total); + return cv::Scalar(bgr[0], bgr[1], bgr[2]); + } + else + return cv::Scalar::all(getBackGroudChannelMean(image, total)); +} + +uchar CImageApplyAutoCrop::getBackGroudChannelMean(const cv::Mat& gray, int total) +{ + cv::Mat image_clone; + cv::resize(gray, image_clone, cv::Size(), 0.25, 0.25); + + int threnshold = total / 32; + int channels[] = { 0 }; + int nHistSize[] = { 256 }; + float range[] = { 0, 256 }; + const float* fHistRanges[] = { range }; + cv::Mat hist; + cv::calcHist(&image_clone, 1, channels, cv::Mat(), hist, 1, nHistSize, fHistRanges, true, false); + + int hist_array[256]; + for (int i = 0; i < 256; i++) + hist_array[i] = hist.at(i, 0); + + int length = 1; + const int length_max = 255 - m_threshold; + while (length < length_max) + { + for (size_t i = m_threshold + 1; i < 256 - length; i++) + { + int count = 0; + uint pixSum = 0; + for (size_t j = 0; j < length; j++) + { + count += hist_array[j + i]; + pixSum += hist_array[j + i] * (i + j); + } + + if (count >= threnshold) + return pixSum / count; + } + length++; + } + return 255; +} diff --git a/imageprocess/ImageApplyAutoCrop.h b/imageprocess/ImageApplyAutoCrop.h new file mode 100644 index 0000000..52f0e6d --- /dev/null +++ b/imageprocess/ImageApplyAutoCrop.h @@ -0,0 +1,101 @@ +/* + * ==================================================== + + * 功能:自动裁剪、纠偏、除黑底 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:2020/4/21 v1.0 + 2020/7/22 v1.1 增加获取图像有效区域轮廓的接口maxContour(用于配合一体机的“跳过空白页”算法,PC端暂时无需使用) + 2020/10/16 v1.2 修复自动裁剪尺寸精度丢失的BUG;提高除黑底缩进精度。 + 2020/10/28 v1.2.1 修复凹凸多边形填充背景的逻辑BUG。 + 2020/10/28 v1.2.2 修复图像处理必定会缩小尺寸的BUG。 + 2020/10/29 v1.2.3 避免无谓的纠偏(0°纠偏) + 2020/11/30 v1.3.0 增加功能,可识别文稿颜色进行填充黑底。 + * 版本号:v1.3.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_AUTO_CROP_H +#define IMAGE_APPLY_AUTO_CROP_H + +#include "ImageApply.h" + +class CImageApplyAutoCrop : public CImageApply +{ +public: + CImageApplyAutoCrop(); + + /* + * isCrop [in]:自动幅面裁剪使能,true自动裁剪,false为固定裁剪 + * isDesaskew [in]:自动纠偏使能,true自动纠偏,false为不纠偏 + * isFillBlank [in]:黑底填充使能,true为填充,false为不填充 + * fixedSize [in]:固定幅面尺寸,当isCrop为false时生效,结果尺寸按fixedSize大小输出,单位像素 + * isConvex [in]:黑底填充时的填充方式,true为凸多边形填充,false为凹多边形填充,默认true + * isFillColor [in]:黑底填充时采用自适应色彩填充,false为白色填充,true为自适应文稿底色填充,默认false + * threshold [in]:二值化阈值,取值范围(0, 255),默认40 + * noise [in]:除噪像素,能够消除noise宽度的背景竖条纹干扰,默认40 + * indent [in]:轮廓缩进,裁剪、纠偏或者黑底填充时,对探索到的纸张轮廓进行缩进indent像素,默认5 + */ + CImageApplyAutoCrop(bool isCrop, bool isDesaskew, bool isFillBlank, const cv::Size& fixedSize, bool isConvex = true, bool isFillColor = false, double threshold = 40, int noise = 40, int indent = 5); + + virtual ~CImageApplyAutoCrop(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + bool isAutoCrop() { return m_isCrop; } + + bool isFillBlank() { return m_isFillBlank; } + + bool isDesaskew() { return m_isDesaskew; } + + bool isConvexHull() { return m_isConvexHull; } + + double threshold() { return m_threshold; } + + int noise() { return m_noise; } + + int indent() { return m_indent; } + + cv::Size fixedSize() { return m_fixedSize; } + + const std::vector& maxContour() { return m_maxContour; } + + void setAutoCrop(bool enabled) { m_isCrop = enabled; } + + void setFillBlank(bool enabled) { m_isFillBlank = enabled; } + + void setDesaskew(bool enabled) { m_isDesaskew = enabled; } + + void setConvexHull(bool convex) { m_isConvexHull = convex; } + + void setThreshold(double value) { m_threshold = value; } + + void setNoise(int value) { m_noise = value; } + + void setIndent(int value) { m_indent = value; } + + void setFixedSize(cv::Size size) { m_fixedSize = size; } + +private: + cv::Scalar getBackGroudColor(const cv::Mat& image, int total); + + uchar getBackGroudChannelMean(const cv::Mat& gray, int total); + +private: + bool m_isCrop; + bool m_isDesaskew; + bool m_isFillBlank; + bool m_isConvexHull; + bool m_isFillColor; + + double m_threshold; + int m_noise; + int m_indent; + cv::Size m_fixedSize; + std::vector m_maxContour; +}; + +#endif // !IMAGE_APPLY_AUTO_CROP_H diff --git a/imageprocess/ImageApplyBWBinaray.cpp b/imageprocess/ImageApplyBWBinaray.cpp new file mode 100644 index 0000000..45fe9d3 --- /dev/null +++ b/imageprocess/ImageApplyBWBinaray.cpp @@ -0,0 +1,165 @@ +#include "ImageApplyBWBinaray.h" + +CImageApplyBWBinaray::CImageApplyBWBinaray(ThresholdType type, int threshold, int blockSize, int constant) + : m_threshold(threshold) + , m_type(type) + , m_blockSize(blockSize) + , m_constant(constant) + , m_table(new uchar[256]) +{ + memset(m_table, 255, 256); + memset(m_table, 0, static_cast(m_threshold)); +} + +CImageApplyBWBinaray::CImageApplyBWBinaray() + : m_threshold(120) + , m_type(ThresholdType::THRESH_BINARY) + , m_blockSize(25) + , m_constant(5) + , m_table(new uchar[256]) +{ + memset(m_table, 255, 256); + memset(m_table, 0, static_cast(m_threshold)); +} + +CImageApplyBWBinaray::~CImageApplyBWBinaray(void) +{ + delete[] m_table; +} + +void CImageApplyBWBinaray::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (pDib.empty()) return; + + if (pDib.channels() == 3) + cv::cvtColor(pDib, pDib, cv::COLOR_BGR2GRAY); + + cv::Mat integ; + int blockSize = 25;//ߴ + int threshold = 1; + int low = 30; + int up = 235; + int halfSize = blockSize / 2; + int square_blockSize = blockSize * blockSize; + switch (m_type) + { + case ThresholdType::THRESH_BINARY: + cv::integral(pDib, integ, CV_32S); + + for (int j = halfSize; j < integ.rows - halfSize - 1; j++) + { + uchar* data = pDib.ptr(j); + int* idata1 = integ.ptr(j - halfSize); + int* idata2 = integ.ptr(j + halfSize + 1); + for (int i = halfSize; i < integ.cols - halfSize - 1; i++) + { + if (data[i] < low) + data[i] = 0; + else if (data[i] > up) + data[i] = 255; + else + data[i] = data[i] < ((idata2[i + halfSize + 1] - idata2[i - halfSize] - idata1[i + halfSize + 1] + idata1[i - halfSize]) / square_blockSize - threshold) ? 0 : 255; + } + } + + cv::threshold(pDib(cv::Rect(0, 0, halfSize, pDib.rows)), pDib(cv::Rect(0, 0, halfSize, pDib.rows)), m_threshold, 255, cv::THRESH_BINARY); + cv::threshold(pDib(cv::Rect(pDib.cols - halfSize, 0, halfSize, pDib.rows)), pDib(cv::Rect(pDib.cols - halfSize, 0, halfSize, pDib.rows)), m_threshold, 255, cv::THRESH_BINARY); + cv::threshold(pDib(cv::Rect(0, 0, pDib.cols, halfSize)), pDib(cv::Rect(0, 0, pDib.cols, halfSize)), m_threshold, 255, cv::THRESH_BINARY); + cv::threshold(pDib(cv::Rect(0, pDib.rows - halfSize, pDib.cols, halfSize)), pDib(cv::Rect(0, pDib.rows - halfSize, pDib.cols, halfSize)), m_threshold, 255, cv::THRESH_BINARY); + break; + case ThresholdType::THRESH_OTSU: + cv::threshold(pDib, pDib, m_threshold, 255, CV_THRESH_OTSU); + break; + case ThresholdType::ADAPTIVE_GAUSSIAN: + cv::adaptiveThreshold(pDib, pDib, 255, cv::ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, m_blockSize, m_constant); + break; + //case ThresholdType::ADAPTIVE_MEAN: + // cv::adaptiveThreshold(pDib, pDib, 255, cv::ADAPTIVE_THRESH_MEAN_C, CV_THRESH_BINARY, m_blockSize, m_constant); + // break; + case ThresholdType::ERROR_DIFFUSION: + errorDiffuse(pDib); + break; + default: + break; + } + +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyBWBinaray apply"); +#endif // LOG +} + +void CImageApplyBWBinaray::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} + +void CImageApplyBWBinaray::errorDiffuse(cv::Mat& image) +{ + if (image.rows < 3 || image.cols < 3) + { + cv::threshold(image, image, m_threshold, 255, CV_THRESH_BINARY); + return; + } + + cv::Mat dst; + image.convertTo(dst, CV_16S); + + size_t rows = static_cast(image.rows) - 1; + size_t cols = static_cast(image.cols) - 1; + + short** pixels_dst = new short* [static_cast(image.rows)]; + for (int i = 0; i < image.rows; i++) + pixels_dst[i] = reinterpret_cast(dst.data + i * static_cast(dst.step)); + + short error; + for (size_t y = 0; y < rows; y++) + for (size_t x = 1; x < cols; x++) + { + short dstPix = pixels_dst[y][x]; + if (dstPix >= m_threshold) + { + pixels_dst[y][x] = 255; + error = dstPix - 255; + } + else + { + pixels_dst[y][x] = 0; + error = dstPix; + } + + pixels_dst[y][x + 1] += error * 1 / 16; + pixels_dst[y + 1][x - 1] += error * 1 / 16; + pixels_dst[y + 1][x] += error * 1 / 16; + pixels_dst[y + 1][x + 1] += error * 1 / 16; + } + image.release(); + dst.convertTo(image, CV_8U); + + rows++; + uchar* ptr = image.data; + size_t step = image.step; + size_t offset; + for (size_t y = 0; y < rows; y++) + { + offset = y * step; + ptr[offset] = m_table[ptr[offset]]; + offset += cols; + ptr[offset] = m_table[ptr[offset]]; + } + + cols++; + ptr = image.data + step * (rows - 1); + for (size_t x = 0; x < cols; x++) + ptr[x] = m_table[ptr[x]]; + + delete[] pixels_dst; +} diff --git a/imageprocess/ImageApplyBWBinaray.h b/imageprocess/ImageApplyBWBinaray.h new file mode 100644 index 0000000..858a7ec --- /dev/null +++ b/imageprocess/ImageApplyBWBinaray.h @@ -0,0 +1,86 @@ +/* + * ==================================================== + + * 功能:二值化处理 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:2020/5/28 v1.1 修改传统二值化算法,改用自定义局部自适应阈值算法 + 2020/5/29 v1.2 在传统二值化之前添加增强锐化效果,二值化之后增加除噪效果 + 2020/6/19 v1.3 编写自定义自适应阈值二值化;取消锐化处理;保留除噪效果 + 2020/12/21 v1.3.1 调整自适应阈值上下限 + 2020/12/21 v1.3.2 调整blockSize,从原来的51调整到25 + * 版本号:v1.3.2 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_BW_BINARAY_H +#define IMAGE_APPLY_BW_BINARAY_H + +#include "ImageApply.h" + +class CImageApplyBWBinaray:public CImageApply +{ +public: + + enum class ThresholdType + { + THRESH_BINARY = 0, //传统二值化 + THRESH_OTSU, //大津阈值 + + ADAPTIVE_GAUSSIAN, //高斯局部自适应阈值 + ADAPTIVE_MEAN, //均值局部自适应阈值 + + ERROR_DIFFUSION //错误扩散 + }; + + /* + * type [in]:二值化模式 + * threshold [in]:阈值,当选择THRESH_OTSU时无效 + * blockSize [in]:ADAPTIVE_GAUSSIAN和ADAPTIVE_MEAN模式有效,表示局部观察块的宽度 + * constant [in]:ADAPTIVE_GAUSSIAN和ADAPTIVE_MEAN模式有效,与blockSize形成比例关系,作为局部筛选阈值 + */ + CImageApplyBWBinaray(ThresholdType type, int threshold = 120, int blockSize = 25, int constant = 5); + + CImageApplyBWBinaray(); + + virtual ~CImageApplyBWBinaray(void); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + double getThreshold() { return m_threshold; } + + ThresholdType getThresholdType() { return m_type; } + + int getBlockSize() { return m_blockSize; } + + double getConstant() { return m_constant; } + + void setThreshold(double value) { m_threshold = value; } + + void setThresholdType(ThresholdType type) { m_type = type; } + + void setBlockSize(int value) { m_blockSize = value; } + + void setConstant(double value) { m_constant = value; } + +private: + + void errorDiffuse(cv::Mat& image); + +private: + double m_threshold; + + ThresholdType m_type; + + int m_blockSize; + + double m_constant; + + uchar* m_table; +}; + +#endif //!IMAGE_APPLY_BW_BINARAY_H + diff --git a/imageprocess/ImageApplyChannel.cpp b/imageprocess/ImageApplyChannel.cpp new file mode 100644 index 0000000..912e816 --- /dev/null +++ b/imageprocess/ImageApplyChannel.cpp @@ -0,0 +1,129 @@ +#include "ImageApplyChannel.h" +#include "ImageApplyAdjustColors.h" + +CImageApplyChannel::CImageApplyChannel() + : m_channel(Invalid) + , colors(new CImageApplyAdjustColors(0, 30, 1.0)) +{ +} + +CImageApplyChannel::CImageApplyChannel(Channel channel) + : m_channel(channel) + , colors(new CImageApplyAdjustColors(0, 30, 1.0)) +{ +} + +CImageApplyChannel::~CImageApplyChannel() +{ + if (colors != nullptr) delete colors; +} + +void CImageApplyChannel::apply(cv::Mat& pDib,int side) +{ + (void)side; + if (pDib.empty()) return; + + cv::Mat dst(pDib.rows, pDib.cols, CV_8UC1); + switch (m_channel) + { + case Red: + cv::extractChannel(pDib, dst, 2); + colors->apply(pDib, side); + break; + case Green: + cv::extractChannel(pDib, dst, 1); + break; + case Blue: + cv::extractChannel(pDib, dst, 0); + cv::extractChannel(pDib, dst, 0); + break; + case All: + colourless(pDib, dst, 80); + break; + //case Except_Red: + // except_channel(pDib, dst, 2); + // break; + case Except_Green: + except_channel(pDib, dst, 1); + break; + case Except_Blue: + except_channel(pDib, dst, 0); + break; + default: + break; + } + pDib.release(); + pDib = dst; + +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyChannel apply"); +#endif // LOG +} + +void CImageApplyChannel::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} + +void CImageApplyChannel::except_channel(const cv::Mat & src, cv::Mat & dst, int channel) +{ + int rows = static_cast(src.total()); + cv::Mat src_temp(rows, 3, CV_8UC1, src.data); + cv::Mat dst_temp(rows, 1, CV_8UC1, dst.data); + + cv::Mat temp1, temp2; + switch (channel) + { + case 0: + temp1 = src_temp(cv::Rect(1, 0, 1, rows)); + temp2 = src_temp(cv::Rect(2, 0, 1, rows)); + cv::addWeighted(temp1, 0.587, temp2, 0.299, 0, dst_temp); + break; + case 1: + temp1 = src_temp(cv::Rect(0, 0, 1, rows)); + temp2 = src_temp(cv::Rect(2, 0, 1, rows)); + cv::addWeighted(temp1, 0.114, temp2, 0.299, 0, dst_temp); + break; + case 2: + temp1 = src_temp(cv::Rect(0, 0, 1, rows)); + temp2 = src_temp(cv::Rect(1, 0, 1, rows)); + cv::addWeighted(temp1, 0.114, temp2, 0.587, 0, dst_temp); + break; + default: + break; + } +} + +void CImageApplyChannel::colourless(const cv::Mat &src, cv::Mat &dst, uchar threshold) +{ + if (src.channels() != 3) + { + dst = src; + return; + } + + cv::Mat hsv; + cv::cvtColor(src, hsv, cv::COLOR_BGR2HSV_FULL); + cv::Mat mv_hsv[3]; + cv::split(hsv, mv_hsv); + size_t total = mv_hsv[1].total(); + uchar* ptr_s = mv_hsv[1].data; + uchar* ptr_v = mv_hsv[2].data; + for (size_t i = 0; i < total; i++) + if (ptr_s[i] > threshold) + { + ptr_s[i] = 0; + ptr_v[i] = 255; + } + cv::merge(mv_hsv, 3, hsv); + cv::cvtColor(hsv, hsv, cv::COLOR_HSV2BGR_FULL); + cv::cvtColor(hsv, dst, cv::COLOR_BGR2GRAY); +} diff --git a/imageprocess/ImageApplyChannel.h b/imageprocess/ImageApplyChannel.h new file mode 100644 index 0000000..fd71b85 --- /dev/null +++ b/imageprocess/ImageApplyChannel.h @@ -0,0 +1,64 @@ +/* + * ==================================================== + + * 功能:通道提取,又名除色。可提取BGR图像中的单个通道、两种通道的混合以及去除彩色像素的图像,目标图像均为灰度图 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:v1.0 2020/4/21 + v1.1 2020/6/11 在除红时,增加对比度,提高除色效果。 + v1.2 2020/7/21 修正之前增强红绿蓝效果的色彩配比。 + * 版本号:v1.2 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_CHANNEL_H +#define IMAGE_APPLY_CHANNEL_H + +#include "ImageApply.h" + +class CImageApplyAdjustColors; +class CImageApplyChannel : public CImageApply +{ +public: + + typedef enum channel + { + Red, //红色通道 + Green, //绿色通道 + Blue, //蓝色通道 + Invalid, //无效 + All, //去除所有HSV色彩结构中,S大于80的色彩 + Except_Red, //绿蓝色通道混合 + Except_Green, //红蓝色通道混合 + Except_Blue //红绿色通道混合 + }Channel; + +public: + + CImageApplyChannel(); + + /* + * channel [in]:通道模式 + * */ + CImageApplyChannel(Channel channel); + + virtual ~CImageApplyChannel(void); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + +private: + + void except_channel(const cv::Mat& src, cv::Mat& dst, int channel); + + void colourless(const cv::Mat& src, cv::Mat& dst, uchar threshold = 80); + +private: + + Channel m_channel; + CImageApplyAdjustColors* colors; +}; + +#endif // !IMAGE_APPLY_CHANNEL_H diff --git a/imageprocess/ImageApplyColorRecognition.cpp b/imageprocess/ImageApplyColorRecognition.cpp new file mode 100644 index 0000000..d85896b --- /dev/null +++ b/imageprocess/ImageApplyColorRecognition.cpp @@ -0,0 +1,126 @@ +#include "ImageApplyColorRecognition.h" +#include "ImageApplyHeaders.h" + +static CImageApplyBWBinaray m_bw; +static CImageApplyAdjustColors m_ac(0, 50, 1.0f); + +/// +/// ͼǷDzɫǰ߼ԺɫؽжϣںɫΪɫΪDzɫ +/// +/// ͼ +/// trueΪɫfalseΪDzɫ +bool isColor(const cv::Mat& image) +{ + if (image.channels() != 3) return false; + + cv::Mat pDib_resize; + cv::resize(image, pDib_resize, cv::Size(image.cols / 9, image.rows / 9), 0, 0, cv::INTER_AREA); + + cv::Mat hsv; + cv::cvtColor(pDib_resize, hsv, cv::COLOR_BGR2HSV_FULL); + std::vector hsv_channels; + cv::split(hsv, hsv_channels); + + cv::Mat range_h1, range_h2, range_s, range_v; + cv::inRange(hsv_channels[0], 0, 85, range_h1); + cv::inRange(hsv_channels[0], 170, 255, range_h2); + cv::inRange(hsv_channels[1], 60, 255, range_s); + cv::inRange(hsv_channels[2], 100, 255, range_v); + + cv::Mat thre = (range_h1 | range_h2) & range_s & range_v; + return (cv::sum(thre)[0] / 255)> 4; +} + +bool isGray(const cv::Mat& image) +{ + if (image.channels() == 3) return true; + + cv::Mat image_clone; + cv::resize(image, image_clone, cv::Size(), 0.25, 0.25); + int channels[] = { 0 }; + int histsize[] = { 256 }; + float range[] = { 0, 256 }; + const float* histRanges[] = { range }; + cv::Mat hist; + cv::calcHist(&image_clone, 1, channels, cv::Mat(), hist, 1, histsize, histRanges, true, false); + + float pixel_count0 = hist.at(0, 0); + float pixel_count255 = hist.at(255, 0); + float total = image_clone.total(); + + return ((pixel_count0 + pixel_count255) / total) > 0.95; +} + +CImageApplyColorRecognition::CImageApplyColorRecognition(ColorRecognitionMode mode) + : m_mode(mode) +{ +} + +CImageApplyColorRecognition::~CImageApplyColorRecognition(void) +{ +} + +void CImageApplyColorRecognition::apply(cv::Mat& pDib, int side) +{ + //жǷҪжDzɫ + if (m_mode == AllColor || m_mode == Color_Gray || m_mode == Color_Mono) + { + //Dzɫֱ˳ + if (isColor(pDib)) + { + m_result = Color; + return; + } + } + + if (pDib.channels() == 3) + cv::cvtColor(pDib, pDib, cv::COLOR_BGR2GRAY); + + if (m_mode == Color_Gray) + { + m_result = Gray; + return; + } + + if (m_mode == Color_Mono) + { + m_bw.apply(pDib, side); + m_result = Mono; + return; + } + + if (isGray(pDib)) + m_result = Gray; + else + { + m_bw.apply(pDib, side); + m_result = Mono; + } +} + +void CImageApplyColorRecognition::apply(std::vector& mats, bool isTwoSide) +{ + m_results.clear(); + if (mats.empty()) return; + + if (!mats[0].empty()) + apply(mats[0], 0); + + m_results.push_back(m_result); + + if (isTwoSide && mats.size() > 1) + if (!mats[1].empty()) + apply(mats[1], 1); + + m_results.push_back(m_result); +} + +CImageApplyColorRecognition::ColorType CImageApplyColorRecognition::getResult() +{ + return m_result; +} + +std::vector CImageApplyColorRecognition::getResults() +{ + return m_results; +} diff --git a/imageprocess/ImageApplyColorRecognition.h b/imageprocess/ImageApplyColorRecognition.h new file mode 100644 index 0000000..176d3ad --- /dev/null +++ b/imageprocess/ImageApplyColorRecognition.h @@ -0,0 +1,66 @@ +/* + * ==================================================== + + * ܣɫʶ𣬽ʶᡰҶȡ24λͼתΪ256ɫ8λͼ ʶΪڰסͼתΪֵ8λͼ + * ߣά + * ʱ䣺2020/7/17 + * ޸ʱ䣺2020/12/15 + * 汾ţv1.0 2020/7/17 + * v1.1 2020/12/15 ԣжϺɫأںɫΪɫΪҶȣɾֱתͼ + * v1.2 2020/12/16 ɫģʽֻ֣ӽʽӿ + * ==================================================== + */ + +#ifndef IMAGE_APPLY_COLOR_RECOGNITION_H +#define IMAGE_APPLY_COLOR_RECOGNITION_H + +#include "ImageApply.h" + +class CImageApplyColorRecognition : public CImageApply +{ +public : + + //ɫʶģʽ + enum ColorRecognitionMode + { + AllColor, //ȫɫģʽ ʶܻDzɫҶȡڰ + Color_Gray, //ɫҶģʽ ʶֻDzɫ߻Ҷ + Color_Mono, //ɫڰģʽ ʶֻDzɫߺڰ + Gray_Mono //ҶȺڰģʽ ʶֻǻҶȻߺڰ + }; + + //ɫ + enum ColorType + { + Color, //ɫ + Gray, //Ҷ + Mono //ڰ + }; +public: + CImageApplyColorRecognition(ColorRecognitionMode mode = AllColor); + + virtual ~CImageApplyColorRecognition(void); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + /// + /// ȡͼƬɫ͡void apply(cv::Mat&, int)ӿʹ + /// + /// ɫ + ColorType getResult(); + + /// + /// ȡͼƬɫ͡void apply(std::vector&, int)ӿʹ + /// + /// ɫ + std::vector getResults(); + +private: + ColorType m_result; + std::vector m_results; + ColorRecognitionMode m_mode; +}; + +#endif // !IMAGE_APPLY_CONCATENATION_H diff --git a/imageprocess/ImageApplyConcatenation.cpp b/imageprocess/ImageApplyConcatenation.cpp new file mode 100644 index 0000000..be8bd0a --- /dev/null +++ b/imageprocess/ImageApplyConcatenation.cpp @@ -0,0 +1,108 @@ +#include "ImageApplyConcatenation.h" + +CImageApplyConcatenation::CImageApplyConcatenation() + : m_direction(autoDirection) + , m_BG_color(0, 0, 0) +{ +} + +CImageApplyConcatenation::CImageApplyConcatenation(ConcatMode dir, const cv::Scalar& background) + : m_direction(dir) + , m_BG_color(background) +{ +} + +CImageApplyConcatenation::~CImageApplyConcatenation(void) +{ +} + +void CImageApplyConcatenation::apply(cv::Mat& pDib, int side) +{ + (void)pDib; + (void)side; +} + +void CImageApplyConcatenation::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + if (mats.size() < 2) + { + mats.clear(); + return; + } + + ConcatMode direction; + if (m_direction == ConcatMode::autoDirection) + direction = (mats[0].cols > mats[0].rows) ? ConcatMode::vertical : ConcatMode::horizontal; + else + direction = m_direction; + cv::Mat dst = concat(mats[0], mats[1], direction); + mats.clear(); + mats.push_back(dst); +} + +cv::Mat CImageApplyConcatenation::concat(cv::Mat &front, cv::Mat &back, ConcatMode direction) +{ + cv::Mat dst; + if (direction == horizontal) + { +#if 0 + int top, bottom; + if (front.rows > back.rows) + { + top = (front.rows - back.rows) / 2; + bottom = front.rows - back.rows - top; + cv::copyMakeBorder(back, back, top, bottom, 0, 0, cv::BORDER_CONSTANT); + } + else if (front.rows < back.rows) + { + top = (back.rows - front.rows) / 2; + bottom = back.rows - front.rows - top; + cv::copyMakeBorder(front, front, top, bottom, 0, 0, cv::BORDER_CONSTANT); + } + cv::hconcat(front, back, dst); +#else + int width = cv::max(front.cols, back.cols) * 2; + int height = cv::max(front.rows, back.rows); + + dst = cv::Mat(height, width, front.type(), m_BG_color); + front.copyTo(dst(cv::Rect(0, 0, front.cols, front.rows))); + int offset = front.cols; + front.release(); + back.copyTo(dst(cv::Rect(offset, 0, back.cols, back.rows))); + back.release(); +#endif + } + else if (direction == vertical) + { +#if 0 + int left, right; + if (front.cols > back.cols) + { + left = (front.cols - back.cols) / 2; + right = front.cols - back.cols - left; + cv::copyMakeBorder(back, back, 0, 0, left, right, cv::BORDER_CONSTANT); + } + else if (front.cols < back.cols) + { + left = (back.cols - front.cols) / 2; + right = back.cols - front.cols - left; + cv::copyMakeBorder(front, front, 0, 0, left, right, cv::BORDER_CONSTANT); + } + cv::vconcat(front, back, dst); +#else + int width = cv::max(front.cols, back.cols); + int height = cv::max(front.rows, back.rows) * 2; + + dst = cv::Mat(height, width, front.type(), m_BG_color); + front.copyTo(dst(cv::Rect(0, 0, front.cols, front.rows))); + int offset = front.rows; + front.release(); + back.copyTo(dst(cv::Rect(0, offset, back.cols, back.rows))); + back.release(); +#endif + } + //front.release(); + //back.release(); + return dst; +} diff --git a/imageprocess/ImageApplyConcatenation.h b/imageprocess/ImageApplyConcatenation.h new file mode 100644 index 0000000..747ef77 --- /dev/null +++ b/imageprocess/ImageApplyConcatenation.h @@ -0,0 +1,60 @@ +/* + * ==================================================== + + * ܣƴӣ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/29 + * 汾ţv1.0 2020/4/21 + * 汾ţv1.1 2020/4/29 : 1m_BG_colorӿڣͼƬ2Żڴ + * ==================================================== + */ + +#ifndef IMAGE_APPLY_CONCATENATION_H +#define IMAGE_APPLY_CONCATENATION_H + +#include "ImageApply.h" + + class CImageApplyConcatenation : public CImageApply +{ +public: + //۷ + enum ConcatMode + { + horizontal = 0, //ƴ + vertical, //ƴ + autoDirection + }; +public: + CImageApplyConcatenation(); //Ĭm_direction = autoDirection; + + /* + * dir [in]:ƴӷ + * backgroud [in]:ɫĬΪɫ + * */ + CImageApplyConcatenation(ConcatMode dir, const cv::Scalar& backgroud = cv::Scalar(0, 0, 0)); + + virtual ~CImageApplyConcatenation(void); + + virtual void apply(std::vector& mats, bool isTwoSide); + + inline ConcatMode getConcatDirection() { return m_direction; } + + inline void setFildDirection(ConcatMode dir) { m_direction = dir; } + + inline cv::Scalar getBackGroundColor() const { return m_BG_color; } + + inline void setBackGroundColor(const cv::Scalar& color) { m_BG_color = color; } + +private: + + virtual void apply(cv::Mat& pDib, int side); + + cv::Mat concat(cv::Mat& front, cv::Mat& back, ConcatMode direction = autoDirection); + +private: + ConcatMode m_direction; + cv::Scalar m_BG_color; +}; + +#endif // !IMAGE_APPLY_CONCATENATION_H diff --git a/imageprocess/ImageApplyCustomCrop.cpp b/imageprocess/ImageApplyCustomCrop.cpp new file mode 100644 index 0000000..9875e38 --- /dev/null +++ b/imageprocess/ImageApplyCustomCrop.cpp @@ -0,0 +1,32 @@ +#include "ImageApplyCustomCrop.h" + +CImageApplyCustomCrop::CImageApplyCustomCrop(const cv::Rect &rect) + : m_rect(rect) +{ + +} + +CImageApplyCustomCrop::~CImageApplyCustomCrop() +{ + +} + +void CImageApplyCustomCrop::apply(cv::Mat &pDib, int side) +{ + (void)side; + if(pDib.empty()) return; + pDib = pDib(cv::Rect(0, 0, pDib.cols, pDib.rows) & m_rect).clone(); +} + +void CImageApplyCustomCrop::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyCustomCrop.h b/imageprocess/ImageApplyCustomCrop.h new file mode 100644 index 0000000..3993a51 --- /dev/null +++ b/imageprocess/ImageApplyCustomCrop.h @@ -0,0 +1,40 @@ +/* + * ==================================================== + + * ܣԶü + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_CUSTOM_CROP_H +#define IMAGE_APPLY_CUSTOM_CROP_H + +#include "ImageApply.h" + +class CImageApplyCustomCrop : public CImageApply +{ +public: + + /* + * rect [in]:ü + * */ + CImageApplyCustomCrop(const cv::Rect& rect); + + virtual~ CImageApplyCustomCrop(void); + + inline cv::Rect getROI() const { return m_rect; } + + inline void setROI(const cv::Rect& roi) { m_rect = roi; } + + virtual void apply(cv::Mat &pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); +private: + cv::Rect m_rect; +}; + +#endif // IMAGE_APPLY_CUSTOM_CROP_H diff --git a/imageprocess/ImageApplyCustomGamma.cpp b/imageprocess/ImageApplyCustomGamma.cpp new file mode 100644 index 0000000..fad5722 --- /dev/null +++ b/imageprocess/ImageApplyCustomGamma.cpp @@ -0,0 +1,63 @@ +#include "ImageApplyCustomGamma.h" + +CImageApplyCustomGamma::CImageApplyCustomGamma(unsigned char* table,int length) + : emptyPtr(false) +{ + if(table==nullptr) + emptyPtr = true; + + init_gamma_table(); + setLUT(table,length == 256 ? 1 : 3); +} + +CImageApplyCustomGamma::~CImageApplyCustomGamma() +{ +} + +void CImageApplyCustomGamma::setLUT(const unsigned char* table, int uint8_tCount) +{ + if (emptyPtr) + return; + + if (uint8_tCount == 1) + memcpy(m_table_bit8, table, 256); + else if (uint8_tCount == 3) + memcpy(m_table_bit24, table, 768); +} + +void CImageApplyCustomGamma::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (emptyPtr) + return; + int numOfChannels = pDib.channels(); + cv::Mat mat_table(1, 256, CV_8UC(numOfChannels), (numOfChannels == 3) ? m_table_bit24 : m_table_bit8); + cv::LUT(pDib, mat_table, pDib); +} + +void CImageApplyCustomGamma::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} + +void CImageApplyCustomGamma::setTableData(const unsigned char* data, int length) +{ + setLUT(data, length == 256 ? 1 : 3); +} + +void CImageApplyCustomGamma::init_gamma_table() +{ + for (size_t i = 0; i < 256; ++i) + { + m_table_bit8[i] = static_cast(i); + m_table_bit24[i * 3] = m_table_bit24[i * 3 + 1] = m_table_bit24[i * 3 + 2] = static_cast(i); + } +} diff --git a/imageprocess/ImageApplyCustomGamma.h b/imageprocess/ImageApplyCustomGamma.h new file mode 100644 index 0000000..bb66197 --- /dev/null +++ b/imageprocess/ImageApplyCustomGamma.h @@ -0,0 +1,44 @@ +/* + * ==================================================== + + * ܣԶ٤УԭΪϣֵ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_CUSTOM_CAMMA_H +#define IMAGE_APPLY_CUSTOM_CAMMA_H + +#include "ImageApply.h" + +class CImageApplyCustomGamma : public CImageApply +{ +public: + /* + * table [in]:Զֵ + * length [in]:ijȣҶȱ256ɫ768 + * */ + CImageApplyCustomGamma(unsigned char* table,int length); + + virtual ~CImageApplyCustomGamma(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + void setTableData(const unsigned char* data, int length); +private: + void init_gamma_table(); + void setLUT(const unsigned char* table, int uint8_tCount); + bool emptyPtr; +private: + unsigned char m_table_bit8[256]; + + unsigned char m_table_bit24[768]; +}; + +#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H diff --git a/imageprocess/ImageApplyCvtColor.cpp b/imageprocess/ImageApplyCvtColor.cpp new file mode 100644 index 0000000..b088e97 --- /dev/null +++ b/imageprocess/ImageApplyCvtColor.cpp @@ -0,0 +1,57 @@ +#include "ImageApplyCvtColor.h" + +CImageApplyCvtColor::CImageApplyCvtColor(ConversionCodes type) + : m_code(type) +{ +} + +CImageApplyCvtColor::~CImageApplyCvtColor() +{ +} + +void CImageApplyCvtColor::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (pDib.channels() == 1) return; + if (m_code > 3) + cv::cvtColor(pDib, pDib, static_cast(m_code)); + else + { + cv::Mat gray(pDib.size(), CV_8UC1); + if (m_code == BGR_MAX) + { + for (size_t y = 0, rows = pDib.rows; y < rows; y++) + { + uchar* ptr_y = pDib.ptr(y); + uchar* gray_y = gray.ptr(y); + for (size_t x = 0, cols = pDib.cols; x < cols; x++) + gray_y[x] = cv::max(ptr_y[x * 3], cv::max(ptr_y[x * 3 + 1], ptr_y[x * 3 + 2])); + } + } + else if (m_code == BGR_MIN) + { + for (size_t y = 0, rows = pDib.rows; y < rows; y++) + { + uchar* ptr_y = pDib.ptr(y); + uchar* gray_y = gray.ptr(y); + for (size_t x = 0, cols = pDib.cols; x < cols; x++) + gray_y[x] = cv::min(ptr_y[x * 3], cv::min(ptr_y[x * 3 + 1], ptr_y[x * 3 + 2])); + } + } + pDib.release(); + pDib = gray; + } +} + +void CImageApplyCvtColor::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyCvtColor.h b/imageprocess/ImageApplyCvtColor.h new file mode 100644 index 0000000..2010430 --- /dev/null +++ b/imageprocess/ImageApplyCvtColor.h @@ -0,0 +1,52 @@ +/* + * ==================================================== + + * ܣɫʱ任 + * ߣά + * ʱ䣺2020/6/19 + * ޸ʱ䣺v1.0 2020/6/19 + v1.1 2020/6/20 BGRתHSV,BGR_MAXBGR_MIN + * 汾ţv1.1 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_CONVERT_COLOR_H +#define IMAGE_APPLY_CONVERT_COLOR_H + +#include "ImageApply.h" + +class CImageApplyCvtColor : public CImageApply +{ +public: + + //תģʽ + enum ConversionCodes + { + BGR_MAX = 1, //BGRȡֵתGRAY + BGR_MIN = 2, //BGRȡСֵתGRAY + BGR2GRAY = 6, //BGRתGRAY + BGR2HSV = 40 //BGRתHSV + }; + + /* + * type [in]:ɫתģʽĬBGRתGray + * */ + CImageApplyCvtColor(ConversionCodes type = BGR2GRAY); + + virtual ~CImageApplyCvtColor(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + inline ConversionCodes getConversionCode() { return m_code; } + + inline void setConversionCode(ConversionCodes code) { m_code = code; } + +private: + ConversionCodes m_code; + +}; + +#endif // !IMAGE_APPLY_CUSTOM_CAMMA_H diff --git a/imageprocess/ImageApplyDetachNoise.cpp b/imageprocess/ImageApplyDetachNoise.cpp new file mode 100644 index 0000000..d32951b --- /dev/null +++ b/imageprocess/ImageApplyDetachNoise.cpp @@ -0,0 +1,42 @@ +#include "ImageApplyDetachNoise.h" +#include "ImageProcess_Public.h" + +CImageApplyDetachNoise::CImageApplyDetachNoise(int noise) + : m_noise(noise) +{ +} + +CImageApplyDetachNoise::~CImageApplyDetachNoise(void) +{ +} + +void CImageApplyDetachNoise::apply(cv::Mat& pDib, int side) +{ + (void)side; + if (pDib.empty()||pDib.channels() != 1) + return; + + cv::Mat mask; + cv::threshold(pDib, mask, 127, 255, cv::THRESH_BINARY_INV); + + std::vector> contours; + std::vector h; + hg::findContours(mask, contours, h); + + for (const std::vector& contour : contours) + if (contourArea(contour) < m_noise) + fillConvexPoly(pDib, contour, cv::Scalar(255)); +} + +void CImageApplyDetachNoise::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyDetachNoise.h b/imageprocess/ImageApplyDetachNoise.h new file mode 100644 index 0000000..c795b8e --- /dev/null +++ b/imageprocess/ImageApplyDetachNoise.h @@ -0,0 +1,38 @@ +/* + * ==================================================== + + * ܣ룬3*3ڵص㣬ҪԺڰͼ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 v1.0 + 2020/5/29 v1.1 ӽӿڣʹСֵɵ + * 汾ţv1.1 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_DETACH_NOISE_H +#define IMAGE_APPLY_DETACH_NOISE_H + +#include "ImageApply.h" + +class CImageApplyDetachNoise : public CImageApply +{ +public: + CImageApplyDetachNoise(int noise = 1); + + inline int getNoise() { return m_noise; } + + inline void setNoise(int noise) { m_noise = noise; } + + virtual ~CImageApplyDetachNoise(void); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + +private: + int m_noise; +}; +#endif // !IMAGE_APPLY_DETACH_NOISE_H + diff --git a/imageprocess/ImageApplyDiscardBlank.cpp b/imageprocess/ImageApplyDiscardBlank.cpp new file mode 100644 index 0000000..6eee2d2 --- /dev/null +++ b/imageprocess/ImageApplyDiscardBlank.cpp @@ -0,0 +1,219 @@ +#include "ImageApplyDiscardBlank.h" +#include "ImageProcess_Public.h" + +CImageApplyDiscardBlank::CImageApplyDiscardBlank(int blockSize, int devTh) + : m_res(false) + , m_dSize(blockSize) + , m_devTh(devTh) +{ +} + +CImageApplyDiscardBlank::CImageApplyDiscardBlank() + : m_res(false) + , m_dSize(200) + , m_devTh(15, 15, 15, 15) +{ +} + +CImageApplyDiscardBlank::CImageApplyDiscardBlank(bool isnormaldiscard) + : m_res(false) + , m_dSize(200) + , m_devTh(15, 15, 15, 15) +{ + setIntensity(isnormaldiscard ? 8 : 20); + setMinArea(isnormaldiscard ? 200 : 300); +} + +CImageApplyDiscardBlank::~CImageApplyDiscardBlank(void) +{ +} + +int CImageApplyDiscardBlank::processRectR(const cv::Mat& image, cv::RotatedRect& rotatedRect, std::vector& maxContour, + double scale, double thresh, int blobAreaSize) +{ + cv::Mat gray; + int blockCount = 0; + if (image.channels() == 3) + if (scale != 1.0f) + { + cv::Size ResImgSiz = cv::Size(image.cols * scale, image.rows * scale); + resize(image, gray, cv::Size(), scale, scale, 0); + cvtColor(gray, gray, CV_BGR2GRAY); + } + else + cvtColor(image, gray, CV_BGR2GRAY); + else + if (scale != 1.0f) + resize(image, gray, cv::Size(), scale, scale, 0); + else + gray = image; + + cv::Mat threshold_img; + threshold(gray, threshold_img, thresh, 255.0, CV_THRESH_BINARY); + std::vector> contours; + std::vector h1; + hg::findContours(threshold_img, contours, h1, CV_CHAIN_APPROX_SIMPLE); + threshold_img.release(); + + if (contours.size() == 0) + return blockCount; + + std::vector list_com; + for (int i = 0; i < contours.size(); i++) + { + double area = cv::contourArea(contours[i]); + if (area > blobAreaSize) + { + blockCount++; + for (int j = 0; j < contours[i].size(); j++) + list_com.push_back(contours[i][j]); + } + } + + if (list_com.size() == 0) + return blockCount; + + rotatedRect = cv::minAreaRect(list_com); + rotatedRect.center.x /= (float)scale; + rotatedRect.center.y /= (float)scale; + rotatedRect.size.width /= (float)scale; + rotatedRect.size.height /= (float)scale; + + if (rotatedRect.angle < -45.0f) + { + rotatedRect.angle += 90.0f; + float l_temp = rotatedRect.size.width; + rotatedRect.size.width = rotatedRect.size.height; + rotatedRect.size.height = l_temp; + } + + std::vector hull(list_com.size()); + cv::convexHull(list_com, hull); + + for (int i = 0; i < hull.size(); i++) + { + cv::Point temp = list_com[hull[i]]; + int x = (int)(temp.x / scale); + int y = (int)(temp.y / scale); + maxContour.push_back(cv::Point(x, y)); + } + + return blockCount; +} + + bool CImageApplyDiscardBlank::scalar_LE(const cv::Scalar& val1, const cv::Scalar& val2) +{ + for (int i = 0; i < 3; i++) + if (val1[i] > val2[i]) + return false; + return true; +} + +void CImageApplyDiscardBlank::setIntensity(int val) +{ + val = cv::max(cv::min(100, val), 2); + m_devTh = cv::Scalar::all(val); +} + +cv::Mat CImageApplyDiscardBlank::getRoiMat(const cv::Mat& image) +{ + int gap = 100; + cv::RotatedRect rect; + std::vector contour; + double scale = 0.25; + double thresh = 50; + int blobSize = 200; + processRectR(image, rect, contour, scale, thresh, blobSize); + cv::Rect rect2 = rect.boundingRect(); + cv::Rect inRect = rect2 & cv::Rect(0, 0, image.cols, image.rows); + gap = cv::max(inRect.width - rect.size.width, inRect.height - rect.size.height) + 100; + inRect = cv::Rect(inRect.x + gap, inRect.y + gap, inRect.width - gap * 2, inRect.height - gap * 2); + + if (inRect.width <= 0 || inRect.height <= 0) + return cv::Mat(); + return image(inRect); +} + +void CImageApplyDiscardBlank::apply(cv::Mat& pDib, int side) +{ +#ifdef LOG + FileTools::write_log("imgprc.txt", "enter CImageApplyDiscardBlank apply"); +#endif // LOG + + if (pDib.empty()) + { +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyDiscardBlank apply"); +#endif // LOG + return; + } + + cv::Scalar mean; + cv::Scalar dev; + cv::Mat image = getRoiMat(pDib); + cv::Rect rect; + cv::Rect imRect(0, 0, image.cols, image.rows); + for(int i = 0; i < image.cols; i+= m_dSize) + for(int j = 0; j < image.rows; j+= m_dSize) + { + rect = cv::Rect(i, j, m_dSize, m_dSize) & imRect; + if(rect != cv::Rect()) + { + cv::meanStdDev (image(rect) , mean, dev); + if(!scalar_LE(dev, m_devTh)) + { + m_res = false; +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyDiscardBlank apply"); +#endif // LOG + return; + } + } + } + m_res = true; + if (m_res) + pDib.release(); +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyDiscardBlank apply"); +#endif // LOG +} + +void CImageApplyDiscardBlank::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} + +bool CImageApplyDiscardBlank::apply(const cv::Mat& pDib, int blockSize, int devTh) +{ + if (pDib.empty()) + return true; + + cv::Scalar mean; + cv::Scalar dev; + cv::Scalar s_devTh = cv::Scalar::all(devTh); + cv::Mat image = getRoiMat(pDib); + if (image.empty()) + return false; + cv::Rect rect; + cv::Rect imRect(0, 0, image.cols, image.rows); + for (int i = 0; i < image.cols; i += blockSize) + for (int j = 0; j < image.rows; j += blockSize) + { + rect = cv::Rect(i, j, blockSize, blockSize) & imRect; + if (rect != cv::Rect()) + { + cv::meanStdDev(image(rect), mean, dev); + if (!scalar_LE(dev, s_devTh)) + return false; + } + } + return true; +} diff --git a/imageprocess/ImageApplyDiscardBlank.h b/imageprocess/ImageApplyDiscardBlank.h new file mode 100644 index 0000000..0470baa --- /dev/null +++ b/imageprocess/ImageApplyDiscardBlank.h @@ -0,0 +1,60 @@ +/* + * ==================================================== + + * ܣհҳʶ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 v1.0 + 2020/8/12 v1.1 setIntensitysetMinAreaȡisNormalʶλsetIntensity÷Χ[2, 20][1, 100] + 2020/8/25 v1.1.1 ֽż100ص20 + 2020/10/16 v1.2 ½ӿڣܹЧжͼƬǷΪհҳ + 2020/10/19 v1.2.1 ޸̬հҳжʶеBUG + * 汾ţv1.2.1 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_DISCARD_BLANK_H +#define IMAGE_APPLY_DISCARD_BLANK_H + +#include "ImageApply.h" + +class CImageApplyDiscardBlank : public CImageApply +{ +public: + CImageApplyDiscardBlank(int blockSize, int devTh); + + /* + * isnormal [in]:true׼ģʽfalseΪƱݸдֽģʽ + * */ + CImageApplyDiscardBlank(bool isnormaldiscard); + + CImageApplyDiscardBlank(); + virtual ~CImageApplyDiscardBlank(void); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + void setIntensity(int val); + + void setMinArea(int val) { m_dSize = val; } + + static bool apply(const cv::Mat& pDib, int blockSize = 200, int devTh = 15); + +private: + + static int processRectR(const cv::Mat& image, cv::RotatedRect& rotatedRect, std::vector& maxContour, + double scale, double thresh, int blobAreaSize); + + static bool scalar_LE(const cv::Scalar& val1, const cv::Scalar& val2); + + static cv::Mat getRoiMat(const cv::Mat& pDib); +private: + bool m_res; + bool m_isNormalDiscard; + int m_dSize; + cv::Scalar m_devTh; +}; + +#endif // !IMAGE_APPLY_DISCARD_BLANK_H diff --git a/imageprocess/ImageApplyDogEarDetection.cpp b/imageprocess/ImageApplyDogEarDetection.cpp new file mode 100644 index 0000000..40ef3a7 --- /dev/null +++ b/imageprocess/ImageApplyDogEarDetection.cpp @@ -0,0 +1,67 @@ +#include "ImageApplyDogEarDetection.h" +#include "ImageProcess_Public.h" + +CImageApplyDogEarDetection::CImageApplyDogEarDetection() + : m_threshold(40) + , m_zoom(1.0) + , m_distance(50) + , m_result(false) +{ + +} + +CImageApplyDogEarDetection::CImageApplyDogEarDetection(double threshlod, double zoom, double distance) + : m_threshold(threshlod) + , m_zoom(zoom) + , m_distance(distance) + , m_result(false) +{ + +} + +CImageApplyDogEarDetection::~CImageApplyDogEarDetection() +{ + +} + +void CImageApplyDogEarDetection::apply(cv::Mat &pDib, int side) +{ + m_result = false; + (void)side; + if (pDib.empty()) return; + cv::Mat src; + if (m_zoom != 1.0) + cv::resize(pDib, src, cv::Size(), m_zoom, m_zoom, cv::INTER_NEAREST); + else + src = pDib; + + cv::Mat thre; + hg::threshold_Mat(src, thre, m_threshold); + std::vector hierarchy; + std::vector> contours; + hg::findContours(thre, contours, hierarchy, cv::RETR_EXTERNAL); + + std::vector maxContour = hg::getMaxContour(contours, hierarchy); + if (maxContour.size() == 0) + { + m_result = true; + return; + } + hg::convexHull(maxContour, maxContour); + cv::RotatedRect rect = hg::getBoundingRect(maxContour); + cv::Point2f vertexes[4]; + rect.points(vertexes); + + for (int i = 0; i < 4; i++) + if ((-cv::pointPolygonTest(maxContour, vertexes[i], true)) > (m_distance * m_zoom)) + { + m_result = true; + return; + } +} + +void CImageApplyDogEarDetection::apply(std::vector &mats, bool isTwoSide) +{ + (void)mats; + (void)isTwoSide; +} diff --git a/imageprocess/ImageApplyDogEarDetection.h b/imageprocess/ImageApplyDogEarDetection.h new file mode 100644 index 0000000..eab807f --- /dev/null +++ b/imageprocess/ImageApplyDogEarDetection.h @@ -0,0 +1,56 @@ +/* + * ==================================================== + + * 功能:折角检测。检测原理:计算纸张的理论四角顶点,到实际轮廓最小距离。当任意顶点到轮廓最小距离超过阈值,则判定为折角 + * 作者:刘丁维 + * 生成时间:2020/10/30 + * 最近修改时间:2020/10/30 + * 版本号:v1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_DOGEAR_DETECTION_H +#define IMAGE_APPLY_DOGEAR_DETECTION_H + +#include "ImageApply.h" + +class CImageApplyDogEarDetection : public CImageApply +{ +public: + + /// + /// 折角检测默认构造函数,threshold = 40, zoom = 1.0, distance = 50 + /// + CImageApplyDogEarDetection(); + + /// + /// 折角检测构造函数 + /// + /// 二值化阈值 + /// 原图缩放比例,对于大尺寸图像而言通过zoom缩小图像可减少计算量。默认值1.0(不缩放) + /// 理论顶点到实际轮廓最小距离的阈值,大于该阈值则判定为折角,默认值50(像素) + CImageApplyDogEarDetection(double threshlod, double zoom = 1.0, double distance = 50); + + virtual ~CImageApplyDogEarDetection(void); + + /// + /// 获取检测结果。该函数须在调用apply之后使用。 + /// + /// true为折角,false为不折角 + inline bool getResult() { return m_result; } + + virtual void apply(cv::Mat& pDib, int side); + +private: + virtual void apply(std::vector& mats, bool isTwoSide); + +private: + double m_threshold; + double m_zoom; + double m_distance; + + bool m_result; +}; + +#endif // IMAGE_APPLY_DOGEAR_DETECTION_H diff --git a/imageprocess/ImageApplyFadeBackGroundColor.cpp b/imageprocess/ImageApplyFadeBackGroundColor.cpp new file mode 100644 index 0000000..ab40d51 --- /dev/null +++ b/imageprocess/ImageApplyFadeBackGroundColor.cpp @@ -0,0 +1,34 @@ +#include "ImageApplyFadeBackGroundColor.h" +#include "ImageApplyAdjustColors.h" + +CImageApplyFadeBackGroudColor::CImageApplyFadeBackGroudColor() + : m_adjustColors(new CImageApplyAdjustColors(30, 30, 1.0)) +{ +} + +CImageApplyFadeBackGroudColor::CImageApplyFadeBackGroudColor(int brightness, int contrast) + : m_adjustColors(new CImageApplyAdjustColors(brightness, contrast, 1.0)) +{ +} + +CImageApplyFadeBackGroudColor::~CImageApplyFadeBackGroudColor() +{ + delete m_adjustColors; +} + +void CImageApplyFadeBackGroudColor::apply(cv::Mat& pDib, int side) +{ + m_adjustColors->apply(pDib, side); +} + +void CImageApplyFadeBackGroudColor::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (!var.empty()) { + apply(var, i); + i++; + } + } +} diff --git a/imageprocess/ImageApplyFadeBackGroundColor.h b/imageprocess/ImageApplyFadeBackGroundColor.h new file mode 100644 index 0000000..8113572 --- /dev/null +++ b/imageprocess/ImageApplyFadeBackGroundColor.h @@ -0,0 +1,38 @@ +/* + * ==================================================== + + * 功能:消除文稿纸张底色 + * 作者:刘丁维 + * 生成时间:2020/11/30 + * 最近修改时间:2020/11/30 v1.0 + * 版本号:v1.0 + + * ==================================================== + */ + + +#ifndef IMAGE_APPLY_FADE_BACKGROUND_COLOR_H +#define IMAGE_APPLY_FADE_BACKGROUND_COLOR_H + +#include "ImageApply.h" + +class CImageApplyAdjustColors; +class CImageApplyFadeBackGroudColor : public CImageApply +{ +public: + + CImageApplyFadeBackGroudColor(); + + CImageApplyFadeBackGroudColor(int brightness, int contrast); + + virtual ~CImageApplyFadeBackGroudColor(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + +private: + CImageApplyAdjustColors* m_adjustColors; +}; + +#endif // !IMAGE_APPLY_FADE_BACKGROUND_COLOR_H diff --git a/imageprocess/ImageApplyFilter.cpp b/imageprocess/ImageApplyFilter.cpp new file mode 100644 index 0000000..e41fca5 --- /dev/null +++ b/imageprocess/ImageApplyFilter.cpp @@ -0,0 +1,81 @@ +#include "ImageApplyFilter.h" + +CImageApplyFilter::CImageApplyFilter(FilterMode type, int kSize) + : m_type(type) + , m_kernel(kSize) +{ + m_kSize = (m_type == 1 || m_type == 3) ? 5 : 9; +} + +CImageApplyFilter::~CImageApplyFilter() +{ +} + +void CImageApplyFilter::apply(cv::Mat & pDib, int side) +{ +#ifdef LOG + FileTools::write_log("imgprc.txt", "enter CImageApplySharpen apply"); +#endif // LOG + + switch (m_type) + { + case 1: + case 2: + sharpen(pDib, m_kSize); + break; + case 3: + case 4: + averblur(pDib, static_cast(m_kSize)); + break; + case 5: + bilateralFilter(pDib, m_kernel); + break; + case 6: + gaussianBlur(pDib, m_kernel); + } + +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplySharpen apply"); +#endif // LOG +} + +void CImageApplyFilter::apply(std::vector& mats, bool isTwoSide) +{ + if (mats.empty()) return; + + if (!mats[0].empty()) + apply(mats[0], 0); + + if (isTwoSide && mats.size() > 1) + { + if (!mats[1].empty()) + apply(mats[1], 1); + } +} + +void CImageApplyFilter::averblur(cv::Mat& src, int kSize) +{ + cv::blur(src, src, cv::Size(kSize, kSize)); +} + +void CImageApplyFilter::sharpen(cv::Mat& src, float kSize) +{ + float other = (1.0f - kSize) / 4; + float kernel_data[] = { 0, other, 0, other, kSize, other, 0, other, 0 }; + cv::Mat kernel(3, 3, CV_32FC1, kernel_data); + + cv::filter2D(src, src, src.depth(), kernel); +} + +void CImageApplyFilter::bilateralFilter(cv::Mat& src, double kernel) +{ + cv::Mat dst; + cv::bilateralFilter(src, dst, static_cast(kernel), kernel * 2, kernel / 2); + src.release(); + src = dst; +} + +void CImageApplyFilter::gaussianBlur(cv::Mat src, int kSize) +{ + cv::GaussianBlur(src, src, cv::Size(kSize, kSize), 0); +} diff --git a/imageprocess/ImageApplyFilter.h b/imageprocess/ImageApplyFilter.h new file mode 100644 index 0000000..c5fdbb8 --- /dev/null +++ b/imageprocess/ImageApplyFilter.h @@ -0,0 +1,59 @@ +/* + * ==================================================== + + * 功能:滤镜。目前包括锐化、加强锐化、模糊和加强模糊 + * 作者:刘丁维 + * 生成时间:2020/4/21 + * 最近修改时间:2020/4/21 v1.0 + 2020/7/17 v1.1 增加双边滤波(BilateralFilter)效果,用于实现“背景平滑”功能; + 2020/11/30 v1.2 增加高斯模糊(GaussianBlur) + * 版本号:v1.1 + + * ==================================================== + */ + + +#ifndef IMAGE_APPLY_FILTER_H +#define IMAGE_APPLY_FILTER_H + +#include "ImageApply.h" + +class CImageApplyFilter : public CImageApply +{ +public: + enum FilterMode + { + None, + Sharpen, //锐化 + Sharpen_More, //进一步锐化 + AverBlur, //模糊 + AverBlur_More, //进一步模糊 + BilateralFilter, //双边滤波--背景平滑,减少复杂背景的色彩数量,利于jpg等压缩比例 + GaussianBlur + }; + + /* + * sharpentype [in]:滤镜模式 + */ + CImageApplyFilter(FilterMode type, int kSize = 30); + + virtual ~CImageApplyFilter(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); +private: + void averblur(cv::Mat& src, int kSize); + + void sharpen(cv::Mat& src, float kSize); + + void bilateralFilter(cv::Mat& src, double kernel); + + void gaussianBlur(cv::Mat src, int kSize); +private: + FilterMode m_type; + float m_kSize; + double m_kernel; +}; + +#endif // !IMAGE_APPLY_SHARPEN_H diff --git a/imageprocess/ImageApplyHSVCorrect.cpp b/imageprocess/ImageApplyHSVCorrect.cpp new file mode 100644 index 0000000..4b558a8 --- /dev/null +++ b/imageprocess/ImageApplyHSVCorrect.cpp @@ -0,0 +1,144 @@ +#include "ImageApplyHSVCorrect.h" +#include + +CImageApplyHSVCorrect::CImageApplyHSVCorrect() + : m_table(new uint[256 * 256 * 256]) +{ + initLUT(); +} + +CImageApplyHSVCorrect::CImageApplyHSVCorrect(CorrectOption mode) + : m_table(new uint[256 * 256 * 256]) +{ + initLUT(); + switch (mode) + { + case CImageApplyHSVCorrect::Red_Removal: + set_HSV_value(std::pair(0, 63), std::pair(20, 255), std::pair(160, 255), 0x00FFFFFF); + set_HSV_value(std::pair(191, 255), std::pair(20, 255), std::pair(160, 255), 0x00FFFFFF); + break; + default: + break; + } +} + +CImageApplyHSVCorrect::~CImageApplyHSVCorrect() +{ + delete [] m_table; +} + +void CImageApplyHSVCorrect::apply(cv::Mat &pDib, int side) +{ + (void)side; + if (pDib.empty() || pDib.channels() != 3) return; + + uchar* src = pDib.data; + cv::Mat z = cv::Mat::zeros(pDib.size(), CV_8UC3); + uchar* dst = z.data; + + int total = pDib.total(); +#pragma omp parallel for + for (int i = 0; i < total; i++) + { + int offset = i * 3; + int index = *reinterpret_cast(src + offset) & 0x00ffffff; + uint color = m_table[index]; + *reinterpret_cast(dst + offset) |= color; + } + pDib = z; +} + +void CImageApplyHSVCorrect::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} + +void CImageApplyHSVCorrect::initLUT() +{ +#if 0 + uchar h, s, v; +#endif + for (uint b = 0; b < 256; b++) + for (uint g = 0; g < 256; g++) + for (uint r = 0; r < 256; r++) + { +#if 0 + RGB_2_HSV_full(r, g, b, h, s, v); + + uint index = b | (g << 8) | (r << 16); + if (h < 12 || h > 245) + m_table[index] = index & 0x00ffffff; + else + m_table[index] = (v | (v << 8) | (v << 16)) & 0x00ffffff; +#else + m_table[b | (g << 8) | (r << 16)] = b | (g << 8) | (r << 16); +#endif + } +} + +void CImageApplyHSVCorrect::set_single(const uint src_b, const uint src_g, const uint src_r, + const uint dst_b, const uint dst_g, const uint dst_r) +{ + m_table[src_b | (src_g << 8) | (src_r << 16)] = dst_b | (dst_g << 8) | (dst_r << 16); +} + +void CImageApplyHSVCorrect::set_HSV_value(const std::pair& range_h, + const std::pair& range_s, + const std::pair& range_v, + uint bgr) +{ + uchar h, s, v; + for (int b = 0; b < 256; b++) + for (int g = 0; g < 256; g++) + for (int r = 0; r < 256; r++) + { + RGB_2_HSV_full(r, g, b, h, s, v); + if (contained(h, range_h) && contained(s, range_s) && contained(v, range_v)) + m_table[(b | (g << 8) | (r << 16)) & 0x00ffffff] = bgr & 0x00ffffff; + } +} + +void CImageApplyHSVCorrect::set_table(const uint* table) +{ + memcpy(m_table, table, 256 * 256 * 256); +} + +bool CImageApplyHSVCorrect::contained(uchar value, const std::pair &range) +{ + return value >= range.first && value <= range.second; +} + +void CImageApplyHSVCorrect::RGB_2_HSV_full(int r, int g, int b, uchar& h, uchar& s, uchar& v) +{ + int minn = cv::min(r, cv::min(g, b)); + int maxx = cv::max(r, cv::max(g, b)); + v = static_cast(maxx); //V + + int delta = maxx - minn; + float _h; + if (maxx == 0) + { + h = s = v = 0; + return; + } + else + s = static_cast(delta * 255 / maxx); + + if (r == maxx) + _h = static_cast(g - b) / static_cast(delta); + else if (g == maxx) + _h = 2 + static_cast(b - r) / static_cast(delta); + else + _h = 4 + static_cast(r - g) / static_cast(delta); + + float __h = _h * 42.6666666667f; + h = (__h >= 0) ? static_cast(__h) : static_cast(__h + 256); +} diff --git a/imageprocess/ImageApplyHSVCorrect.h b/imageprocess/ImageApplyHSVCorrect.h new file mode 100644 index 0000000..db64019 --- /dev/null +++ b/imageprocess/ImageApplyHSVCorrect.h @@ -0,0 +1,87 @@ +/* + * ==================================================== + + * 功能:彩色图像,色彩校正。基于LUT实现,预设BGR查值表(表达所有HVS),对BGR原图进行查值校正。 + * 作者:刘丁维 + * 生成时间:2020/3/21 + * 最近修改时间:v1.0 2020/3/21 + v1.1 2020/6/15 调整除红效果的HSV取值范围 + * 版本号:v1.1 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_COLOR_CORRECT_H +#define IMAGE_APPLY_COLOR_CORRECT_H + +#include "ImageApply.h" + +class CImageApplyHSVCorrect : public CImageApply +{ +public: + enum CorrectOption + { + Red_Removal //除掉红色。红色定义H:[0, 85]∪[170, 255],S:[10, 255],V:[120,255] + }; +public: + + CImageApplyHSVCorrect(); + + /* + * mode [in]:预设初色模式 + */ + CImageApplyHSVCorrect(CorrectOption mode); + + virtual ~CImageApplyHSVCorrect(); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + /* + * 函数功能:初始化查值表,按照RGB(R在高位,B在低位)的32位数据进行索引,值与索引一致。 + 表中索引范围[0,0x00FFFFFF]。在构造函数中会默认调用该函数。 + */ + void initLUT(); + + /* + * 函数功能:将查值表指定RGB索引值设置为目标值。 + 索引 = src_b | (src_g << 8) | (src_r << 16) + 值 = dst_b | (dst_g << 8) | (dst_r << 16) + * src_b:[in] 原查值表B通道索引 + * src_g:[in] 原查值表G通道索引 + * src_r:[in] 原查值表R通道索引 + * dst_b:[in] 目标查值表B通道值 + * dst_g:[in] 目标查值表G通道值 + * dst_r:[in] 目标查值表R通道值 + */ + void set_single(const uint src_b, const uint src_g, const uint src_r, + const uint dst_b, const uint dst_g, const uint dst_r); + /* + * 函数功能:按照HSV色彩空间描述色彩范围,将该范围对应的BGR索引设置为0x00FFFFFF(默认白色) + * range_h:[in] H分量范围,取值范围[0, 255] + * range_s:[in] S分量范围,取值范围[0, 255] + * range_v:[in] V分量范围,取值范围[0, 255] + * bgr:[in] 用uint表示BGR值,B在低位,R在高位 + */ + void set_HSV_value(const std::pair& range_h, + const std::pair& range_s, + const std::pair& range_v, + uint bgr = 0x00FFFFFF); + + /* + * 函数功能:设置外部查值表,表默认长度为 256 * 256 * 256 * sizeof(uint) + * table:[in] 数组指针 + */ + void set_table(const uint* table); + +private: + static bool contained(uchar value, const std::pair& range); + + static void RGB_2_HSV_full(int r, int g, int b, uchar& h, uchar& s, uchar& v); + +private: + uint* m_table; +}; + +#endif diff --git a/imageprocess/ImageApplyHeaders.h b/imageprocess/ImageApplyHeaders.h new file mode 100644 index 0000000..cd01a94 --- /dev/null +++ b/imageprocess/ImageApplyHeaders.h @@ -0,0 +1,31 @@ +#ifndef IMAGE_APPLY_HEADER_H +#define IMAGE_APPLY_HEADER_H + +#include "ImageApply.h" +#include "ImageApplyAdjustColors.h" +#include "ImageApplyAutoContrast.h" +#include "ImageApplyAutoCrop.h" +//#include "ImageApplyBarCodeRecognition.h" +#include "ImageApplyBWBinaray.h" +#include "ImageApplyChannel.h" +#include "ImageApplyColorRecognition.h" +#include "ImageApplyConcatenation.h" +#include "ImageApplyCustomCrop.h" +#include "ImageApplyCustomGamma.h" +#include "ImageApplyCvtColor.h" +#include "ImageApplyDetachNoise.h" +#include "ImageApplyDiscardBlank.h" +#include "ImageApplyDogEarDetection.h" +#include "ImageApplyFadeBackGroundColor.h" +#include "ImageApplyFilter.h" +#include "ImageApplyHSVCorrect.h" +#include "ImageApplyOutHole.h" +#include "ImageApplyRefuseInflow.h" +#include "ImageApplyResize.h" +#include "ImageApplyRotation.h" +#include "ImageApplySplit.h" +#include "ImageApplyTextureRemoval.h" +#include "ImageMulti.h" +#include "ImageMultiOutputRed.h" +#include "ImageApplySplit.h" +#endif \ No newline at end of file diff --git a/imageprocess/ImageApplyMarkCrop.cpp b/imageprocess/ImageApplyMarkCrop.cpp new file mode 100644 index 0000000..c3b4961 --- /dev/null +++ b/imageprocess/ImageApplyMarkCrop.cpp @@ -0,0 +1,339 @@ +#include "ImageApplyMarkCrop.h" +#include "ImageProcess_Public.h" + +#define RE 2 +//#define DRAW + +CImageApplyMarkCrop::CImageApplyMarkCrop(CImageApplyMarkCrop::DeviceModel device, bool isCropped, double threshold, int noise, CImageApplyMarkCrop::DPI dpi, DirectionMethod direction) + : m_device(device) + , m_b_isCropped(isCropped) + , m_threshold(120) + , m_noise(noise) + , m_dpi(dpi) + , m_range(30, 55) + , m_direction(direction) +{ + +} + +int CImageApplyMarkCrop::apply(const cv::Mat& src, cv::Mat& dst, Orientation markOri, bool barCode, int& angle) +{ + if (src.empty()) return -1; + + cv::Mat src_resize; + if (m_device == DeviceModel::G400) + cv::resize(src, src_resize, cv::Size(src.cols / RE, src.rows / RE)); + else + cv::resize(src, src_resize, cv::Size(src.cols / 3, src.rows / RE)); + cv::Mat scale_mat; + cv::Mat thre(src_resize.size(), CV_8UC1); + hg::threshold_Mat(src_resize, thre, m_threshold); + +#ifdef DRAW + cv::imwrite("thre.bmp", thre); +#endif + std::vector hierarchy; + std::vector> contours; + + hg::findContours(thre, contours, hierarchy, cv::RETR_EXTERNAL); + std::vector maxContour = hg::getMaxContour(contours, hierarchy); + + float scale = m_device == DeviceModel::G300 ? 3 : RE; + + if (maxContour.size() == 0) + { + thre.release(); + return -1; + } + + //thre.release(); + //dst.release(); + + cv::RotatedRect rect = hg::getBoundingRect(maxContour); + + cv::Point2f vertex[4]; + rect.points(vertex); + + std::vector> marks; + std::vector rrects; + + hg::threshold_Mat(src_resize, thre, m_threshold); + cv::bitwise_not(thre, thre); + contours.clear(); + hierarchy.clear(); + hg::findContours(thre, contours, hierarchy, cv::RETR_LIST); + findMarks(contours, rect, cv::Range(m_range.start / RE, m_range.end / RE), marks, rrects); + + if (marks.size() < 3) return -2; + +#ifdef DRAW + for (int i = 0; i < marks.size(); i++) + cv::circle(thre, marks[i][0], 30, cv::Scalar(255)); + cv::imwrite("contour.bmp", thre); +#endif + + maxContour.clear(); + for (const std::vector& mark : marks) + for (const cv::Point& p : mark) + maxContour.push_back(p); + + if (rrects.size() == 3) + { + double distance1 = hg::distanceP2P(rrects[0].center, rrects[1].center); + double distance2 = hg::distanceP2P(rrects[1].center, rrects[2].center); + double distance3 = hg::distanceP2P(rrects[2].center, rrects[0].center); + + cv::Point p_temp; + if (distance1 > distance2 && distance1 > distance3) + { + p_temp = rrects[0].center + rrects[1].center; + p_temp.x = p_temp.x / 2 * 3 - rrects[2].center.x; + p_temp.x = p_temp.x / 2; + + p_temp.y = p_temp.y / 2 * 3 - rrects[2].center.y; + p_temp.y = p_temp.y / 2; + //maxContour.push_back(((rrects[0].center + rrects[1].center) / 2.0f * 3.0f - rrects[2].center) / 2.0f); + } + else if (distance2 > distance1 && distance2 > distance3) + { + p_temp = rrects[1].center + rrects[2].center; + p_temp.x = p_temp.x / 2 * 3 - rrects[0].center.x; + p_temp.x = p_temp.x / 2; + + p_temp.y = p_temp.y / 2 * 3 - rrects[0].center.y; + p_temp.y = p_temp.y / 2; + //maxContour.push_back(((rrects[1].center + rrects[2].center) / 2.0f * 3.0f - rrects[0].center) / 2.0f); + } + else + { + p_temp = rrects[0].center + rrects[2].center; + p_temp.x = p_temp.x / 2 * 3 - rrects[1].center.x; + p_temp.x = p_temp.x / 2; + + p_temp.y = p_temp.y / 2 * 3 - rrects[1].center.y; + p_temp.y = p_temp.y / 2; + //maxContour.push_back(((rrects[2].center + rrects[0].center) / 2.0f * 3.0f - rrects[1].center) / 2.0f); + } + maxContour.push_back(p_temp); + } + + for (cv::Point& item : maxContour) + item *= scale; + + rect = hg::getBoundingRect(maxContour); + rect.points(vertex); + + cv::Point2f focus; + Orientation ori; + + for (size_t i = 0; i < rrects.size(); i++) + for (size_t j = i + 1; j < rrects.size(); j++) + if (rrects[i].size.area() < rrects[j].size.area()) + { + cv::RotatedRect rect_remp = rrects[j]; + rrects[j] = rrects[i]; + rrects[i] = rect_remp; + } + + for (cv::RotatedRect& item : rrects) + item.center *= scale; + + if (m_direction == DirectionMethod::Multilateral) + { + if (rrects.size() < 4) return -3; + + for (int i = 0; i < 5; i++) + focus += rrects[i].center; + //focus /= 5; + focus.x /= 5; + focus.y /= 5; + + float dis_top = hg::distanceP2L(focus, vertex[1], vertex[2]); + float dis_bottom = hg::distanceP2L(focus, vertex[0], vertex[3]); + float dis_left = hg::distanceP2L(focus, vertex[0], vertex[1]); + float dis_right = hg::distanceP2L(focus, vertex[2], vertex[3]); + + float dis_min = cv::min(dis_top, cv::min(dis_bottom, cv::min(dis_left, dis_right))); + if (dis_top == dis_min) + ori = Top_RB; + else if (dis_bottom == dis_min) + ori = Bottom_LT; + else if (dis_left == dis_min) + ori = Left_RT; + else + ori = Right_LB; + } + else if (m_direction == DirectionMethod::Trilateral_7Net) + { + for (int i = 0; i < 3; i++) + focus += rrects[i].center; + focus.x /= 3; + focus.y /= 3; + + float dis_top = hg::distanceP2L(focus, vertex[1], vertex[2]); + float dis_bottom = hg::distanceP2L(focus, vertex[0], vertex[3]); + float dis_left = hg::distanceP2L(focus, vertex[0], vertex[1]); + float dis_right = hg::distanceP2L(focus, vertex[2], vertex[3]); + + float dis_min_lr = cv::min(dis_left, dis_right); + float dis_min_tb = cv::min(dis_top, dis_bottom); + if (dis_min_lr == dis_right && dis_min_tb == dis_bottom) + ori = Bottom_LT; + else if (dis_min_lr == dis_left && dis_min_tb == dis_top) + ori = Top_RB; + else if (dis_min_lr == dis_right && dis_min_tb == dis_top) + ori = Right_LB; + else + ori = Left_RT; + } + + cv::Point2f srcTri[4]; + cv::Point2f dstTri[3]; + rect.points(srcTri); + + if (m_device == DeviceModel::G300) + for (cv::Point2f& p : srcTri) + p.y = p.y * RE / m_device; + + cv::Size temp_size; + float width = rect.size.width; + float height = hg::distanceP2P(srcTri[0], srcTri[1]); + if (markOri == Default || markOri == ori) + { + dstTri[0] = cv::Point2f(0, height - 1); + dstTri[1] = cv::Point2f(0, 0); + dstTri[2] = cv::Point2f(width - 1, 0); + temp_size.width = width; + temp_size.height = height; + angle = 0; + } + else if (markOri - ori == -3 || markOri - ori == 1) + { + dstTri[0] = cv::Point2f(0, 0); + dstTri[1] = cv::Point2f(height - 1, 0); + dstTri[2] = cv::Point2f(height - 1, width - 1); + temp_size.width = height; + temp_size.height = width; + angle = -90; + } + else if (markOri - ori == -2 || markOri - ori == 2) + { + dstTri[0] = cv::Point2f(width - 1, 0); + dstTri[1] = cv::Point2f(width - 1, height - 1); + dstTri[2] = cv::Point2f(0, height - 1); + temp_size.width = width; + temp_size.height = height; + angle = 180; + } + else if (markOri - ori == -1 || markOri - ori == 3) + { + dstTri[0] = cv::Point2f(height - 1, width - 1); + dstTri[1] = cv::Point2f(0, width - 1); + dstTri[2] = cv::Point2f(0, 0); + temp_size.width = height; + temp_size.height = width; + angle = 90; + } + + if (m_b_isCropped) + { + cv::Mat warp_mat; + warp_mat = cv::getAffineTransform(srcTri, dstTri); + cv::warpAffine(src, dst, warp_mat, temp_size); + } + else + { + if (angle == 0) + dst = src.clone(); + else if (angle == 90) + { + cv::transpose(src, dst); + cv::flip(dst, dst, 0); + } + else if (angle == -90) + { + cv::transpose(src, dst); + cv::flip(dst, dst, 1); + } + else + { + cv::flip(src, dst, 0); + cv::flip(dst, dst, 1); + } + } + + //Ҫж + if (barCode) + { + //cv::imwrite("dst.bmp", dst); + if (dst.cols < 600 || dst.rows < 400) + return -4; + if (!isContainBarCode(dst(cv::Rect(0, 0, 600, 400)))) + return -5; + } + + return 0; + +#ifdef DRAW + cv::imwrite("dst.bmp", dst); +#endif +} + +void CImageApplyMarkCrop::findMarks(const std::vector>& contours, const cv::RotatedRect& region, + const cv::Range& range, std::vector>& marks, std::vector& rrect) +{ + cv::RotatedRect region_outside = region; + cv::RotatedRect region_inside = region; + region_inside.size = cv::Size2f(region.size.width * 0.9, region.size.height * 0.9); + + cv::Point2f outside[4], inside[4]; + region_outside.points(outside); + region_inside.points(inside); + + std::vector v_outside, v_inside; + for (size_t i = 0; i < 4; i++) + { + v_outside.push_back(cv::Point(outside[i].x, outside[i].y)); + v_inside.push_back(cv::Point(inside[i].x, inside[i].y)); + } + for (size_t i = 0, length = contours.size(); i < length; i++) + { + std::vector contour = contours[i]; + cv::RotatedRect rect = cv::minAreaRect(contour); + double area = cv::contourArea(contour); + + if (rect.size.width < range.start || rect.size.height < range.start || rect.size.width > range.end || rect.size.height > range.end) + continue; + if (rect.size.width * rect.size.height < 40 / RE) + continue; + + if (cv::pointPolygonTest(v_outside, rect.center, true) > 0 && cv::pointPolygonTest(v_inside, rect.center, true) < 0) + { + marks.push_back(contour); + rrect.push_back(rect); + } + } +} + +bool CImageApplyMarkCrop::isContainBarCode(const cv::Mat& image) +{ + cv::Mat thre; + hg::threshold_Mat(image, thre, 127); + cv::bitwise_not(thre, thre); + + cv::Mat element = cv::getStructuringElement(cv::MORPH_RECT, cv::Size(20, 1)); + cv::morphologyEx(thre, thre, cv::MORPH_DILATE, element); + //cv::imwrite("barCode.bmp", thre); + + std::vector hierarchy; + std::vector> contours; + hg::findContours(thre, contours, hierarchy, cv::RETR_EXTERNAL); + + for (size_t i = 0; i < contours.size(); i++) + { + cv::Rect rect = cv::boundingRect(contours[i]); + if (rect.width > 250 && rect.height > 50) + return true; + } + return false; +} diff --git a/imageprocess/ImageApplyMarkCrop.h b/imageprocess/ImageApplyMarkCrop.h new file mode 100644 index 0000000..c8cf3a9 --- /dev/null +++ b/imageprocess/ImageApplyMarkCrop.h @@ -0,0 +1,116 @@ +/* + * ==================================================== + + * ܣMark㶨λüʶԾеmark㣬оƫüùܲȫʹãΪܻʶʧܣȻҪôͳüƫв䡣 + * ߣά + * ʱ䣺2020/5/22 + * ޸ʱ䣺2020/5/22 v1.0 + 2020/7/29 v1.1 ŻMarkʶԼĸ巽ж + 2020/7/30 v1.1.1 ŻMarkʶԼĸ巽ж + 2020/8/3 v1.2 죬Markʶĸ巽ԭķʽΪʶĸ巽 + 2020/8/12 v1.3 죬ж㷨жԾǷΪָԾֻǴʶǷ룬׼ȷʶ + applyӿbarCodeǷж빦 + 2020/8/12 v1.4 죬Ӳüӿڣɽвü벻üѡ + * 汾ţv1.4 + + * ==================================================== + */ + +#ifndef IMAGEMARKCROPAPPLY_H +#define IMAGEMARKCROPAPPLY_H + +#include "ImageApply.h" + +class CImageApplyMarkCrop +{ +public: + + //ʶĸ巽ʽ + enum DirectionMethod + { + Trilateral_7Net, //߶λĸ巽 + Multilateral //߶λĸ巽 + }; + + enum DPI : ushort + { + DPI_200 = 200, + DPI_300 = 300 + }; + + enum DeviceModel + { + G400 = 2, + G300 = 3 + }; + + enum Orientation + { + Default = 0, + Left_RT, //ĸ巽ʶʱΪ73markʶʱȱΪ + Top_RB, //ĸ巽ʶʱΪ73markʶʱȱΪ + Right_LB, //ĸ巽ʶʱΪ73markʶʱȱΪ + Bottom_LT //ĸ巽ʶʱΪ73markʶʱȱΪ + }; + +public: + CImageApplyMarkCrop(DeviceModel device, bool isCropped = true, double threshold = 20, int noise = 40, DPI dpi = DPI::DPI_200, DirectionMethod direction = DirectionMethod::Multilateral); + + /* + * src [in]: ԭͼ + * dst [out]:ɹʱصĽͼ + * markOri [in]: ĸ巽жʽ + * barCode [in]: Ƿж룬ùֻTrilateral_7Netģʽ + * angle [out]:ĸ巽ƫתǶȡ090180270 + * ֵ 0ɹ + -1ԭͼΪգ޷ҵͼƬͼᱨô󣩣 + -2markС3 + -3ѡMultilateralģʽʱmarkС4 + -4ʶʱĿͼС޷ + -5 + */ + int apply(const cv::Mat& src, cv::Mat& dst, Orientation markOri, bool barCode, int& angle); + + inline DeviceModel getDeviceModel() { return m_device; } + + inline void setDeviceModel(DeviceModel device) { m_device = device; } + + inline bool isCropped() { return m_b_isCropped; } + + inline void setCropped(bool cropped) { m_b_isCropped = cropped; } + + inline double getThreshold() { return m_threshold; } + + inline void setThreshold(double threshold) { m_threshold = threshold; } + + inline int getNoise() { return m_noise; } + + inline void setNoise(int noise) { m_noise = noise; } + + inline DPI getDPI() { return m_dpi; } + + inline void setDPI(DPI dpi) { m_dpi = dpi; } + + inline const cv::Range getSizeRange() { return m_range; } + + inline void setSizeRange(const cv::Range& range) { m_range = range; } + + inline void setSizeRange(int low, int up) { m_range = cv::Range(low, up); } + +private: + + void findMarks(const std::vector>& contours, const cv::RotatedRect& region, const cv::Range& range, + std::vector>& marks, std::vector& rrect); + + bool isContainBarCode(const cv::Mat& image); +private: + DeviceModel m_device; + bool m_b_isCropped; + double m_threshold; + int m_noise; + DPI m_dpi; + cv::Range m_range; + DirectionMethod m_direction; +}; + +#endif // IMAGEMARKCROPAPPLY_H \ No newline at end of file diff --git a/imageprocess/ImageApplyOutHole.cpp b/imageprocess/ImageApplyOutHole.cpp new file mode 100644 index 0000000..aaffc6a --- /dev/null +++ b/imageprocess/ImageApplyOutHole.cpp @@ -0,0 +1,257 @@ +#include "ImageApplyOutHole.h" +#include "ImageProcess_Public.h" + +#ifdef LOG +#include "Device/filetools.h" +#endif // LOG + +CImageApplyOutHole::CImageApplyOutHole(void) + : CImageApply() + , m_borderSize(200) + , m_edgeScale(0.1f) + , m_threshold(50) +{ +} + +CImageApplyOutHole::CImageApplyOutHole(float borderSize, float edgeScale, double threshold) + : CImageApply() + , m_borderSize(borderSize) + , m_edgeScale(edgeScale) + , m_threshold(threshold) +{ +} + +CImageApplyOutHole::~CImageApplyOutHole(void) +{ +} + +void CImageApplyOutHole::apply(cv::Mat& pDib, int side) +{ + (void)pDib; + (void)side; +} + +void CImageApplyOutHole::apply(std::vector& mats, bool isTwoSide) +{ +#ifdef LOG + FileTools::write_log("imgprc.txt", "enter ImageOutHole apply"); +#endif // LOG + + if (mats.size() < 2) + { +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit ImageOutHole apply"); +#endif // LOG + return; + } + + if (mats[0].empty() || mats[1].empty()) + { +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit ImageOutHole apply"); +#endif // LOG + return; + } + + //ֵͼ + cv::Mat front = mats[0]; + cv::Mat back = mats[1]; + cv::Mat front_thre, back_thre; + hg::threshold_Mat(front, front_thre, m_threshold); + hg::threshold_Mat(back, back_thre, m_threshold); + + //ֵͼˮƽת + cv::flip(back_thre, back_thre, 1); //1:Horizontal + + //ͼѰ + std::vector> contours_front, contours_back; + std::vector b1_front, b1_back; + hg::findContours(front_thre.clone(), contours_front, b1_front, cv::RETR_EXTERNAL); + hg::findContours(back_thre.clone(), contours_back, b1_back, cv::RETR_EXTERNAL); + + //ȡͼ + std::vector maxContour_front = hg::getMaxContour(contours_front, b1_front); + std::vector maxContour_back = hg::getMaxContour(contours_back, b1_back); + + cv::RotatedRect rrect_front = hg::getBoundingRect(maxContour_front); //ȡСӾ + cv::RotatedRect rrect_back = hg::getBoundingRect(maxContour_back); //ȡСӾ + + //ȡͼص + cv::Rect roi_front, roi_back; + cv::RotatedRect mask_rotatedRect; + getRoi(rrect_front, rrect_back, cv::Size(front.cols, front.rows), roi_front, roi_back, mask_rotatedRect); + + cv::Mat roiMat_front(front_thre, roi_front); //ֵͼнȡص + cv::Mat roiMat_back(back_thre, roi_back); //ڷֵͼнȡص + + //ֵͼ㣬ο0طΪ255 + cv::Mat mask; + bitwise_or(roiMat_front, roiMat_back, mask); //㣬ֵͼص + + //ֵͼصͼɫȡͣȡ + std::vector> contours_mask; + std::vector b1_mask; + bitwise_not(mask, mask); //ɫ + + cv::Mat element = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(15, 15)); + dilate(mask, mask, element, cv::Point(-1, -1), 1, cv::BORDER_CONSTANT, cv::Scalar(255)); //㷨׶ͨ + + //Ϊ˱׶׹ᴩֽߣΪֽȷп׶ΪͼΣ뱳ճ + polylines(mask, hg::getVertices(mask_rotatedRect), true, cv::Scalar(0), 15); //ֽžαԵ + + hg::findContours(mask.clone(), contours_mask, b1_mask, cv::RETR_TREE); //ȡصͼ + + //˷ǿ׶ͨ + std::vector> hole_contours = filterPoly(contours_mask, b1_mask, mask_rotatedRect, m_edgeScale, m_borderSize); + for (size_t i = 0; i < hole_contours.size(); i++) + cv::drawContours(mask, hole_contours, static_cast(i), cv::Scalar(127), 2); + + for (size_t i = 0; i < hole_contours.size(); i++) + { + cv::Scalar color = getBackGroudColor(front(roi_front), hole_contours[i]); + cv::Mat temp = front(roi_front); + std::vector> contourss_temp; + contourss_temp.push_back(hole_contours[i]); + hg::fillPolys(temp, contourss_temp, color); + } + + if (isTwoSide) + { + int width_ = roi_back.width; + roi_back.x = back.cols - roi_back.width - roi_back.x; //Ϊ֮ǰͼתROIҲҪӦת + for (size_t i = 0; i < hole_contours.size(); i++) + { + std::vector hole_contour; + for (size_t j = 0; j < hole_contours[i].size(); j++) + hole_contour.push_back(cv::Point(width_ - hole_contours[i][j].x - 1, hole_contours[i][j].y)); + + cv::Scalar color = getBackGroudColor(back(roi_back), hole_contour); + cv::Mat temp = back(roi_back); + + std::vector> contours_temp; + contours_temp.push_back(hole_contour); + hg::fillPolys(temp, contours_temp, color); + } + } +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit ImageOutHole apply"); +#endif // LOG +} + +void CImageApplyOutHole::getRoi(cv::RotatedRect rrect_front, cv::RotatedRect rrect_back, cv::Size srcSize, + cv::Rect& roi_front, cv::Rect& roi_back, cv::RotatedRect& mask_rotatedRect) +{ + cv::Size size(static_cast(rrect_front.size.width + rrect_back.size.width) / 2, static_cast(rrect_front.size.height + rrect_back.size.height) / 2); + float angle = (rrect_front.angle + rrect_back.angle) / 2; + + rrect_front.size = rrect_back.size = size; + rrect_front.angle = rrect_back.angle = angle; + + roi_front = rrect_front.boundingRect(); + roi_back = rrect_back.boundingRect(); + + if (roi_front.width != roi_back.width || roi_front.height != roi_back.height) + { + roi_front.height = roi_back.height; + roi_front.width = roi_back.width; + } + + cv::Point offset(0, 0); + int top = std::min(roi_front.y, roi_back.y); + if (top < 0) + { + roi_front.y -= top; + roi_back.y -= top; + roi_front.height += top; + roi_back.height += top; + offset.y += top; + } + + int left = std::min(roi_front.x, roi_back.x); + if (left < 0) + { + roi_front.x -= left; + roi_back.x -= left; + roi_front.width += left; + roi_back.width += left; + offset.x += left; + } + + int right = std::max(roi_front.x + roi_front.width, roi_back.x + roi_back.width); + if (right >= srcSize.width) + { + roi_front.width -= (right - srcSize.width + 1); + roi_back.width -= (right - srcSize.width + 1); + } + + int bottom = std::max(roi_front.y + roi_front.height, roi_back.y + roi_back.height); + if (bottom >= srcSize.height) + { + roi_front.height -= (bottom - srcSize.height + 1); + roi_back.height -= (bottom - srcSize.height + 1); + } + + mask_rotatedRect.center = cv::Point((roi_front.width + offset.x) / 2, (roi_front.height + offset.y) / 2); + mask_rotatedRect.size = size; + mask_rotatedRect.angle = angle; +} + +std::vector> CImageApplyOutHole::filterPoly(std::vector>& contours, const std::vector& m, + cv::RotatedRect roi, float edgeScale, float areaThreshold) +{ + edgeScale = std::min(0.49f, std::max(edgeScale, 0.0f)); + cv::RotatedRect roi2(roi.center, cv::Size(static_cast(roi.size.width * (1 - edgeScale * 2)), + static_cast(roi.size.height * (1 - edgeScale * 2))), roi.angle); + + std::vector vertices_roi1 = hg::getVertices(roi); + std::vector vertices_roi2 = hg::getVertices(roi2); + + std::vector> hole_contours; + for (size_t i = 0, length = contours.size(); i < length; i++) + { + if (m[i][2] != -1) continue; + + cv::RotatedRect rrect = hg::getBoundingRect(contours[i]); + if (rrect.size.width > areaThreshold || rrect.size.height > areaThreshold) continue; + + bool enabled = true; + for (size_t j = 0, count = contours[i].size(); j < count; j++) + { + cv::Point p(contours[i][j]); + double temp1 = pointPolygonTest(vertices_roi1, p, false); //жǷֽ 1ڣ0ϣ-1 + double temp2 = pointPolygonTest(vertices_roi2, p, false); //жǷڱԵ 1ڣ0ϣ-1 + //ֽ⣬߱ԵڣΪǿ׶ + if (temp1 < 0 || temp2 > 0) + { + enabled = false; + break; + } + } + + if (enabled) + hole_contours.push_back(contours[i]); + } + return hole_contours; +} + +cv::Scalar CImageApplyOutHole::getBackGroudColor(const cv::Mat &image, const std::vector pixelPoints) +{ + if (pixelPoints.empty()) return cv::Scalar(255, 255, 255); + + int channels = image.channels(); + + int temp[3] = { 0 }; + for (size_t i = 0, length = pixelPoints.size(); i < length; ++i) + { + int x = cv::min(cv::max(0, pixelPoints[i].x), image.cols - 1); + int y = cv::min(cv::max(0, pixelPoints[i].y), image.rows - 1); + + const unsigned char* ptr = image.ptr(y, x); + for (int j = 0; j < channels; ++j) + temp[j] += ptr[j]; + } + + return cv::Scalar(temp[0] / static_cast(pixelPoints.size()), + temp[1] / static_cast(pixelPoints.size()), + temp[2] / static_cast(pixelPoints.size())); +} diff --git a/imageprocess/ImageApplyOutHole.h b/imageprocess/ImageApplyOutHole.h new file mode 100644 index 0000000..83feb42 --- /dev/null +++ b/imageprocess/ImageApplyOutHole.h @@ -0,0 +1,67 @@ +/* + * ==================================================== + + * ܣװ + * ߣά + * ʱ䣺2020/11/21 + * ޸ʱ䣺2020/05/12 v1.0 + * 2020/11/17 v1.1 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_OUT_HOLE_H +#define IMAGE_APPLY_OUT_HOLE_H + +#include "ImageApply.h" + +class CImageApplyOutHole : public CImageApply +{ + +public: + + CImageApplyOutHole(); + + /* + * borderSize [in]:׶ֵ + * edgeScale [in]:ֽűԵȡֵΧ(0,0.5),Ĭֵ0.1 + * threshold [in]:ֵֵ + */ + CImageApplyOutHole(float borderSize, float edgeScale, double threshold); + + ~CImageApplyOutHole(void); + + virtual void apply(std::vector& mats, bool isTwoSide); + + float getBorderSize() { return m_borderSize; } + + float getEdgeScale() { return m_edgeScale; } + + double getThreshold() { return m_threshold; } + + void setBorderSize(float size) { m_borderSize = size; } + + void setEdgeScale(float scale) { m_edgeScale = scale; } + + void setThreshold(double threshold) { m_threshold = (std::min)((std::max)(threshold, 1.0), 254.0); } + +private: + + virtual void apply(cv::Mat& pDib, int side); + + void getRoi(cv::RotatedRect rrect_front, cv::RotatedRect rrect_back, cv::Size srcSize, cv::Rect& roi_front, + cv::Rect& roi_back, cv::RotatedRect& mask_rotatedRect); + + std::vector > filterPoly(std::vector>& contours, const std::vector &m, cv::RotatedRect roi, + float edgeScale, float areaThreshold); + + cv::Scalar getBackGroudColor(const cv::Mat& image, const std::vector pixelPoints); + +private: + float m_borderSize; + float m_edgeScale; + double m_threshold; +}; + +#endif // !IMAGE_APPLY_OUT_HOLE_H diff --git a/imageprocess/ImageApplyRefuseInflow.cpp b/imageprocess/ImageApplyRefuseInflow.cpp new file mode 100644 index 0000000..6b801c3 --- /dev/null +++ b/imageprocess/ImageApplyRefuseInflow.cpp @@ -0,0 +1,57 @@ +#include "ImageApplyRefuseInflow.h" + +CImageApplyRefuseInflow::CImageApplyRefuseInflow() +{ +} + +CImageApplyRefuseInflow::~CImageApplyRefuseInflow() +{ +} + +void CImageApplyRefuseInflow::apply(cv::Mat& pDib, int side) +{ + (void)side; + static unsigned char table_contrast[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 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, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, + 255, 255, 255, 255, 255, 255 }; + static cv::Mat mat_table(1, 256, CV_8UC1, table_contrast); + cv::LUT(pDib, mat_table, pDib); +} + +void CImageApplyRefuseInflow::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyRefuseInflow.h b/imageprocess/ImageApplyRefuseInflow.h new file mode 100644 index 0000000..0f58e54 --- /dev/null +++ b/imageprocess/ImageApplyRefuseInflow.h @@ -0,0 +1,29 @@ +/* + * ==================================================== + + * ܣ͸ԭΪ˲ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_REFUSE_INFLOW_H +#define IMAGE_APPLY_REFUSE_INFLOW_H + +#include "ImageApply.h" + +class CImageApplyRefuseInflow : public CImageApply +{ +public: + CImageApplyRefuseInflow(); + + virtual ~CImageApplyRefuseInflow(); + + virtual void apply(cv::Mat& pDib, int side); + + virtual void apply(std::vector& mats, bool isTwoSide); +}; +#endif // !IMAGE_APPLY_REFUSE_INFLOW_H diff --git a/imageprocess/ImageApplyResize.cpp b/imageprocess/ImageApplyResize.cpp new file mode 100644 index 0000000..3405eaa --- /dev/null +++ b/imageprocess/ImageApplyResize.cpp @@ -0,0 +1,47 @@ +#include "ImageApplyResize.h" + +CImageApplyResize::CImageApplyResize() + : m_fx(1.0) + , m_fy(1.0) + , m_type(ResizeType::RATIO) +{ +} + +CImageApplyResize::CImageApplyResize(ResizeType type, const cv::Size& size, double fx, double fy) + : m_type(type) + , m_dSize(size) + , m_fx(fx) + , m_fy(fy) +{ +} + + +CImageApplyResize::~CImageApplyResize(void) +{ +} + + +void CImageApplyResize::apply(cv::Mat& pDib,int side) +{ + (void)side; + if (pDib.empty()) return; + + if (m_type == ResizeType::RATIO) + cv::resize(pDib, pDib, cv::Size(0, 0), m_fx, m_fy); + else + cv::resize(pDib, pDib, m_dSize); +} + +void CImageApplyResize::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyResize.h b/imageprocess/ImageApplyResize.h new file mode 100644 index 0000000..e4ee507 --- /dev/null +++ b/imageprocess/ImageApplyResize.h @@ -0,0 +1,69 @@ +/* + * ==================================================== + + * ܣԶ٤УԭΪϣֵ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_RESIZE_H +#define IMAGE_APPLY_RESIZE_H + +#include "ImageApply.h" + +class CImageApplyResize : public CImageApply +{ +public: + + enum class ResizeType + { + RATIO, // + DSIZE //ߴ + }; + +public: + CImageApplyResize(); + + /* + * type [in]: + * size [in]:Ŀߴ磬typeΪDSIZEʱЧ + * fx [in]:ĿtypeΪRATIOʱЧ + * fy [in]:ĿtypeΪRATIOʱЧ + */ + CImageApplyResize(ResizeType type, const cv::Size& size, double fx, double fy); + + virtual ~CImageApplyResize(void); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + + double getFX() { return m_fx; } + + double getFY() { return m_fy; } + + cv::Size getDSize() { return m_dSize; } + + ResizeType getType() { return m_type; } + + void setFX(double value) { m_fx = value; } + + void setFY(double value) { m_fy = value; } + + void setDSize(const cv::Size& size) { m_dSize = size; } + + void setType(ResizeType type) { m_type = type; } + +private: + double m_fx; + double m_fy; + cv::Size m_dSize; + ResizeType m_type; +}; + +#endif // !IMAGE_APPLY_RESIZE_H diff --git a/imageprocess/ImageApplyRotation.cpp b/imageprocess/ImageApplyRotation.cpp new file mode 100644 index 0000000..f6f3368 --- /dev/null +++ b/imageprocess/ImageApplyRotation.cpp @@ -0,0 +1,135 @@ +#include "ImageApplyRotation.h" + +#ifndef _NOT_USE + +//#define USE_TESSERCAT + +#ifdef USE_TESSERCAT +#define HG_GPDF_API_BUILD +#include "hg_gpdf.h" +#endif + +CImageApplyRotation::CImageApplyRotation(RotationType rotation, bool isBackTransposed, int dpi, const char* tessdataPath) + : m_rotation(rotation) + , m_backTranspose(isBackTransposed) + , m_dpi(dpi) + , osd(nullptr) +{ + if (rotation == RotationType::AutoTextOrientation) + { +#ifdef USE_TESSERCAT + osd = new HG_OCR(); + reinterpret_cast(osd)->init(tessdataPath, HG_OCR::RECOGNITION_OSD); +#endif + } +} + +CImageApplyRotation::~CImageApplyRotation() +{ +#ifdef USE_TESSERCAT + if (osd) delete reinterpret_cast(osd); +#endif +} + +void CImageApplyRotation::apply(cv::Mat & pDib, int side) +{ +#ifdef LOG + FileTools::write_log("imgprc.txt", "enter CImageApplyRotation apply"); +#endif // LOG + if (pDib.empty()) + { +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyRotation apply"); +#endif // LOG + return; + } + + if (m_rotation == RotationType::AutoTextOrientation) //�Զ��ı�����ʶ�� + { +#ifdef USE_TESSERCAT + if (osd) + { + cv::Mat temp; + if (m_dpi != 200) + { + double scale = 200 / static_cast(m_dpi); + int new_w = static_cast(pDib.cols * scale) / 4 * 4; + int new_h = pDib.rows * scale; + cv::resize(pDib, temp, cv::Size(new_w, new_h)); + } + else + temp = pDib(cv::Rect(0, 0, pDib.cols / 4 * 4, pDib.rows)).clone(); + + if (temp.channels() == 3) + cv::cvtColor(temp, temp, cv::COLOR_BGR2GRAY); + cv::threshold(temp, temp, 180, 255, cv::THRESH_OTSU); + + HG_OCR* ptr_osd = reinterpret_cast(osd); + int orientation = ptr_osd->orientation(temp.data, temp.cols, temp.rows, temp.channels(), 200); + + switch (orientation) + { + case 90: + cv::transpose(pDib, pDib); + cv::flip(pDib, pDib, 0); + break; + case 180: + cv::flip(pDib, pDib, 0); + cv::flip(pDib, pDib, 1); + break; + case 270: + cv::transpose(pDib, pDib); + cv::flip(pDib, pDib, 1); + break; + default: + break; + } + } +#endif + } + else if (m_backTranspose && side == 1) //������ת180 + { + if (m_rotation != RotationType::Rotate_180) //��ת180�� + { + if (m_rotation == RotationType::Rotate_90_clockwise || m_rotation == RotationType::Rotate_90_anti_clockwise) //90�� -90�� + { + transpose(pDib, pDib); + flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 0 : 1); + } + else + { + flip(pDib, pDib, 0); + flip(pDib, pDib, 1); + } + } + } + else //zh + { + if (m_rotation == RotationType::Rotate_90_clockwise || m_rotation == RotationType::Rotate_90_anti_clockwise) //90�� -90�� + { + transpose(pDib, pDib); + flip(pDib, pDib, m_rotation == RotationType::Rotate_90_clockwise ? 1 : 0); + } + else if (m_rotation == RotationType::Rotate_180) + { + flip(pDib, pDib, 0); + flip(pDib, pDib, 1); + } + } +#ifdef LOG + FileTools::write_log("imgprc.txt", "exit CImageApplyRotation apply"); +#endif // LOG +} + +void CImageApplyRotation::apply(std::vector& mats, bool isTwoSide) +{ + (void)isTwoSide; + int i = 0; + for (cv::Mat& var : mats) { + if (!var.empty()) { + apply(var, i); + i++; + } + } +} +#endif //_NOT_USE diff --git a/imageprocess/ImageApplyRotation.h b/imageprocess/ImageApplyRotation.h new file mode 100644 index 0000000..7513b16 --- /dev/null +++ b/imageprocess/ImageApplyRotation.h @@ -0,0 +1,67 @@ +/* + * ==================================================== + + * ܣתͼ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺v1.0 2020/4/21 + v1.1 2020/8/12 ޸ĸ巽Զʶ±BUG + * 汾ţv1.1 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_ROTATION_H +#define IMAGE_APPLY_ROTATION_H + +#include "ImageApply.h" + +class CImageApplyRotation : public CImageApply +{ +public: + enum class RotationType + { + Invalid, //Ч + Rotate_90_clockwise, //˳ʱ90 + Rotate_180, //180 + Rotate_90_anti_clockwise, //ʱ90㣬270 + AutoTextOrientation //Զĸ巽ʶת + }; + +public: + + /* + * rotation [in]:ת + * isBackTransposed [in]:trueΪ180ת֮Ȼ + * dpi [in]:ǰͼDPIòrotationΪAutoTextOrientationʱЧʶĸ巽ʱĬϽͼ任Ϊ200DPIʶ + * tessadataPath [in]:ѵļ·òrotationΪAutoTextOrientationʱЧ + */ + CImageApplyRotation(RotationType rotation, bool isBackTransposed = false, int dpi = 200, const char* tessdataPath = nullptr); + + virtual ~CImageApplyRotation(); + + virtual void apply(cv::Mat & pDib, int side) override; + + virtual void apply(std::vector& mats, bool isTwoSide); + + bool isBackTransposed() { return m_backTranspose; } + + int getDPI() { return m_dpi; } + + RotationType getRotationType() { return m_rotation; } + + void setBackTransposed(bool enabled) { m_backTranspose = enabled; } + + void setDPI(int dpi) { m_dpi = dpi; } + + void setRotationType(RotationType type) { m_rotation = type; } + +private: + RotationType m_rotation; + bool m_backTranspose; + int m_dpi; + + void* osd; +}; + +#endif // !IMAGE_APPLY_ROTATION_H diff --git a/imageprocess/ImageApplySplit.cpp b/imageprocess/ImageApplySplit.cpp new file mode 100644 index 0000000..aee3053 --- /dev/null +++ b/imageprocess/ImageApplySplit.cpp @@ -0,0 +1,113 @@ +#include "ImageApplySplit.h" +#include + +#define BPP(type,index) +CImageApplySplit::CImageApplySplit(int multitype,int split, bool ismulti_filter_red,int colormode) : + m_bmulti_filter_red(ismulti_filter_red) + , m_split(split) + , m_multitype(multitype) + , m_colormode(colormode) +{ +} + +CImageApplySplit::~CImageApplySplit(void) +{ +} + +std::vector CImageApplySplit::SplitMats(std::vector& mats, bool isTwoSide) +{ + std::vector rets; + for (size_t i = 0; i < mats.size(); i++) + { + if (mats[i].empty()) + continue; +// if (i != 0)//if (i != 0 && isTwoSide == false) +// break; + + int bpp = getBpp(i); + if (m_split)// + { + std::vector retmats = apply(mats[i]); + if (bpp != -1) { + } + else {// + if (m_colormode == 0) bpp = 1;//bw + else if (m_colormode == 1) bpp = 8; + else bpp = 24; + } + + for (size_t j = 0; j < retmats.size(); j++) + { + if (!retmats[j].empty()) { + MatEx matex(retmats[j], bpp); + rets.push_back(matex); + } + } + } + else { + MatEx matex(mats[i], bpp); + rets.push_back(matex); + } + } + return rets; +} + +std::vector CImageApplySplit::apply(cv::Mat& pDib) +{ + if (pDib.empty()) + return std::vector(); + std::vector retMats; + int heigth = pDib.rows; + int width = pDib.cols; + if (m_split == 2)//ֱ + { + cv::Mat matF = pDib(cv::Rect(0, 0, width, (int)(0.5 * heigth))); + cv::Mat matB = pDib(cv::Rect(0, (int)(0.5 * heigth), width, (int)(0.5 * heigth))); + retMats.push_back(matF); + retMats.push_back(matB); + } + else//ˮƽ + { + cv::Mat matF = pDib(cv::Rect(0, 0, (int)(width*0.5), heigth)); + cv::Mat matB = pDib(cv::Rect((int)(width*0.5), 0, (int)(width * 0.5), heigth)); + retMats.push_back(matF); + retMats.push_back(matB); + } + return retMats; +} + +int CImageApplySplit::getBpp(int matIndex) +{ + int ret = -1; + if (m_bmulti_filter_red) { + ret = matIndex == 0 ? 24 : 8; + } + else + { + if (m_multitype == -1) + return ret; + switch (m_multitype) + { + case 0://all + if (matIndex == 0) ret = 24; + else if (matIndex == 1) ret = 8; + else ret = 1; + break; + case 1://clolr +gray + if (matIndex == 0) ret = 24; + else ret = 8; + break; + case 2://color+bw + if (matIndex == 0) ret = 24; + else ret = 1; + break; + case 3://gray+bw + if (matIndex == 0) ret = 8; + else ret = 1; + break; + default: + break; + } + } + return ret; +} diff --git a/imageprocess/ImageApplySplit.h b/imageprocess/ImageApplySplit.h new file mode 100644 index 0000000..63532ce --- /dev/null +++ b/imageprocess/ImageApplySplit.h @@ -0,0 +1,36 @@ +/* + * ==================================================== + + * ܣͼ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_SPLIT_H +#define IMAGE_APPLY_SPLIT_H +#include "MatEx.h" +#include +#include "imgprocdefs.h" + +class CImageApplySplit +{ +public: + CImageApplySplit(int multitype=-1,int split=0,bool ismulti_filter_red=false,int colormode=1);//Ĭϲ Ҷ + + ~CImageApplySplit(void); + std::vector SplitMats(std::vector& mats, bool isTwoSide); +private: + std::vector apply(cv::Mat& pDib); + int getBpp(int matIndex); +private://field + bool m_bmulti_filter_red; + int m_multitype; + int m_colormode; + int m_split; +}; + +#endif // !IMAGE_APPLY_SPLIT_H diff --git a/imageprocess/ImageApplyTextureRemoval.cpp b/imageprocess/ImageApplyTextureRemoval.cpp new file mode 100644 index 0000000..5c42622 --- /dev/null +++ b/imageprocess/ImageApplyTextureRemoval.cpp @@ -0,0 +1,172 @@ +#include "ImageApplyTextureRemoval.h" + +//Խ +void zero_to_center(cv::Mat& image, int colToCut, int rowToCut) +{ + cv::Mat q1(image, cv::Rect(0, 0, colToCut, rowToCut)); + cv::Mat q2(image, cv::Rect(colToCut, 0, colToCut, rowToCut)); + cv::Mat q3(image, cv::Rect(0, rowToCut, colToCut, rowToCut)); + cv::Mat q4(image, cv::Rect(colToCut, rowToCut, colToCut, rowToCut)); + + //ڶ޺͵޽н + cv::Mat tmpImg; + q1.copyTo(tmpImg); + q4.copyTo(q1); + tmpImg.copyTo(q4); + + //һ޺͵޽н + q2.copyTo(tmpImg); + q3.copyTo(q2); + tmpImg.copyTo(q3); +} + +// +cv::Mat create_spectrum(cv::Mat* matArray, double scale = 1.5) +{ + cv::Mat dst; + cv::magnitude(matArray[0], matArray[1], dst); +#if 1 + cv::divide(dst, dst.cols * dst.rows, dst, scale); + //imshow("Ƶ", dst); +#else + dst += Scalar::all(1); + log(dst, dst); + normalize(dst, dst, 1, 0, CV_MINMAX); +#endif + +#if 0 + imshow("Ƶ", dst); +#endif + return dst; +} + +//Ҷ任 +void inverseFourierTransform(const cv::Mat& src, cv::Mat& dst) +{ + cv::Mat complexIDFT; + cv::Mat matArray[2]; + cv::idft(src, complexIDFT); + cv::split(complexIDFT, matArray); + cv::magnitude(matArray[0], matArray[1], dst); + cv::normalize(dst, dst, 0, 1, CV_MINMAX); +} + +//ݲ˲ +cv::Mat createFilter(const cv::Mat& spectrum, int dilateSize, int erodeSize) +{ + cv::Mat temp; + spectrum.convertTo(temp, CV_8UC1, 255); + cv::threshold(temp, temp, 0, 255, CV_THRESH_OTSU); + //imshow("ֵ", temp); + + cv::Mat element1 = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(dilateSize, dilateSize)); + cv::Mat element2 = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(erodeSize, erodeSize)); + cv::dilate(temp, temp, element1); + cv::erode(temp, temp, element2); + cv::floodFill(temp, cv::Point(temp.cols / 2, temp.rows / 2), cv::Scalar(0)); //ˮ + cv::medianBlur(~temp, temp, 3); //ֵ˲ + //temp = ~temp; + //cv::imshow("ֵ", temp); + + //ݲ˲ + cv::Mat filter; + temp.convertTo(filter, CV_32FC1); + cv::normalize(filter, filter, 1, 0.01, CV_MINMAX); + std::vector mv; + mv.push_back(filter); + mv.push_back(filter); + cv::merge(mv, filter); + + return filter; +} + +void CImageApplyTextureRemoval::textureRemovalGray(cv::Mat& img) +{ + //õDFTѳߴ磨2ָԼټ + cv::Mat paddedImg; + int m = cv::getOptimalDFTSize(img.rows); + int n = cv::getOptimalDFTSize(img.cols); + + //ͼ¶˺Ҷ + cv::copyMakeBorder(img, paddedImg, 0, m - img.rows, 0, n - img.cols, + cv::BORDER_CONSTANT, cv::Scalar::all(0)); + + //ͼһĶά飨ͨMatDFT + cv::Mat matArray[] = { cv::Mat_(paddedImg), cv::Mat::zeros(paddedImg.size(), CV_32F) }; + cv::Mat complexInput, complexOutput; + cv::merge(matArray, 2, complexInput); + cv::dft(complexInput, complexOutput); + cv::split(complexOutput, matArray); //ףҶף + + //˲ + //ʵ鲿Ƶͼķʽλ + //Ƶͼģ˲ + zero_to_center(matArray[0], complexOutput.cols / 2, complexOutput.rows / 2); + zero_to_center(matArray[1], complexOutput.cols / 2, complexOutput.rows / 2); + cv::Mat spectrum = create_spectrum(matArray); + + //˲ + cv::Mat filter = createFilter(spectrum, m_dilateSize, m_erodeSize); + cv::merge(matArray, 2, complexOutput); + cv::multiply(complexOutput, filter, filter); + + //IDFTõ˲ + cv::Size imgSize = img.size(); + inverseFourierTransform(filter, img); + img = img(cv::Rect(cv::Point(0, 0), imgSize)); + img *= 255; + img.convertTo(img, CV_8UC1); +} + +CImageApplyTextureRemoval::CImageApplyTextureRemoval() + : CImageApply() + , m_dilateSize(5) + , m_erodeSize(3) +{ + +} + +CImageApplyTextureRemoval::CImageApplyTextureRemoval(int dilateSize, int erodeSize) + : CImageApply() + , m_dilateSize(dilateSize) + , m_erodeSize(erodeSize) +{ + +} + +CImageApplyTextureRemoval::~CImageApplyTextureRemoval() +{ + +} + +void CImageApplyTextureRemoval::apply(cv::Mat &pDib, int side) +{ + (void)side; + + if (pDib.channels() == 1) + textureRemovalGray(pDib); + else + { + std::vector rgb(3); + cv::split(pDib, rgb); + for (cv::Mat& var : rgb) + textureRemovalGray(var); + cv::merge(rgb, pDib); + } + + pDib *= 1.15; +} + +void CImageApplyTextureRemoval::apply(std::vector &mats, bool isTwoSide) +{ + (void)isTwoSide; + + int i = 0; + for (cv::Mat& var : mats) { + if (i != 0 && isTwoSide == false) + break; + if (!var.empty()) + apply(var, 0); + i++; + } +} diff --git a/imageprocess/ImageApplyTextureRemoval.h b/imageprocess/ImageApplyTextureRemoval.h new file mode 100644 index 0000000..30ceaa7 --- /dev/null +++ b/imageprocess/ImageApplyTextureRemoval.h @@ -0,0 +1,50 @@ +/* + * ==================================================== + + * ܣȥ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_APPLY_TEXTURE_REMOVAL_H +#define IMAGE_APPLY_TEXTURE_REMOVAL_H + +#include "ImageApply.h" + +class CImageApplyTextureRemoval : public CImageApply +{ +public: + CImageApplyTextureRemoval(void); + + /* + * dilateSize [in]: + * erodeSize [in]:ʴ + */ + CImageApplyTextureRemoval(int dilateSize, int erodeSize); + + virtual ~CImageApplyTextureRemoval(void); + + virtual void apply(cv::Mat& pDib,int side); + + virtual void apply(std::vector& mats, bool isTwoSide); + + int getDilateSize() {return m_dilateSize;} + + int getErodeSize() {return m_erodeSize;} + + void setDilateSize(int size) {m_dilateSize = size;} + + void setErodeSize(int size) {m_erodeSize = size;} +private: + void textureRemovalGray(cv::Mat& img); + +private: + int m_dilateSize; + int m_erodeSize; +}; + +#endif diff --git a/imageprocess/ImageMatQueue.cpp b/imageprocess/ImageMatQueue.cpp new file mode 100644 index 0000000..009892a --- /dev/null +++ b/imageprocess/ImageMatQueue.cpp @@ -0,0 +1,67 @@ +#include "ImageMatQueue.h" +#include "ImageApplyHeaders.h" +#include "stdarg.h" + +ImageMatQueue::ImageMatQueue() +{ + +} + +void ImageMatQueue::addProcess(ImageProcessMode option, ...) +{ + va_list arg_ptr; + + switch (option) + { + case AdjustColors: + va_start(arg_ptr, option); + m_list_proc.push_back(new CImageApplyOutHole(static_cast(va_arg(arg_ptr, double)), static_cast(va_arg(arg_ptr, double)), + va_arg(arg_ptr, int))); + break; + case AutoContrast: + break; + case AutoCrop: + break; + case BWBinaray: + break; + case Channel: + break; + case CustomCrop: + break; + case CustomGamma: + break; + case DetachNoise: + break; + case DiscardBlank: + break; + case OutHole: + break; + case RefuseInflow: + break; + case Resize: + break; + case Rotation: + break; + case Sharpen: + break; + case Split: + break; + case TextureRemoval: + break; + } + //va_arg(arg_ptr, int); + va_end(arg_ptr); +} + +void ImageMatQueue::applyProcess(std::vector& mats) +{ + for (size_t i = 0, length = m_list_proc.size(); i < length; i++) + m_list_proc[i]->apply(mats, true); +} + +void ImageMatQueue::clearProcess() +{ + for (CImageApply*& apply : m_list_proc) + delete apply; + m_list_proc.clear(); +} diff --git a/imageprocess/ImageMatQueue.h b/imageprocess/ImageMatQueue.h new file mode 100644 index 0000000..29fb242 --- /dev/null +++ b/imageprocess/ImageMatQueue.h @@ -0,0 +1,102 @@ +#ifndef IMAGEMATQUEUE_H +#define IMAGEMATQUEUE_H + +#include +#include + +enum ImageProcessMode +{ + AdjustColors, + AutoContrast, + AutoCrop, + BWBinaray, + Channel, + CustomCrop, + CustomGamma, + DetachNoise, + DiscardBlank, + OutHole, + RefuseInflow, + Resize, + Rotation, + Sharpen, + Split, + TextureRemoval +}; + +struct ImageProcessParms +{ + ImageProcessMode option; + + /*AdjustColors*/ + int brightness; + int constrast; + float gamma; + + /*AutoContrast*/ + bool isCrop; + bool isDesaskew; + bool isFillBlank; + cv::Size fixedSize; + bool isConvex; + double threshold; + int noise; + int indent; + + /*BWBinaray*/ + short type; + //int threshold; //与AutoCrop中的参数合并使用 + int blockSize; + int constant; + + /*Channel*/ + short channel; + + /*CustomCrop*/ + cv::Rect rect; + + /*CustomGamma*/ + unsigned char* table; + int length; + + /*DiscardBlank*/ + bool isNormal; + + /*OutHole*/ + float borderSize; + float edgeScale; + //double threshold; //与AutoCrop中的参数合并使用 + + /*Resize*/ + //short type; //与BWBinaray中的参数合并使用 + cv::Size size; + double fx; + double fy; + + /*Rotation*/ + //short type; //与BWBinaray中的参数合并使用 + bool isBackTransposed; + int dpi; + char* tessdataPath; + + /*TextureRemoval*/ + int dilateSize; + int erodeSize; +}; + +class CImageApply; +class ImageMatQueue +{ +public: + ImageMatQueue(); + + void addProcess(ImageProcessMode option, ...); + + void applyProcess(std::vector& mats); + + void clearProcess(); +private: + std::vector m_list_proc; +}; + +#endif // IMAGEMATQUEUE_H diff --git a/imageprocess/ImageMulti.cpp b/imageprocess/ImageMulti.cpp new file mode 100644 index 0000000..422f707 --- /dev/null +++ b/imageprocess/ImageMulti.cpp @@ -0,0 +1,72 @@ +#include "ImageMulti.h" + +IMageMulti::IMageMulti(int multiType,int thre) +{ + m_multiType = multiType; + m_thre = thre; +} + +IMageMulti::~IMageMulti(void) +{ +} + +std::vector IMageMulti::apply(cv::Mat& pDib) +{ + std::vector retMats; + if (pDib.empty()) + return retMats; + retMats.push_back(pDib); + switch (m_multiType) + { + case ALL: + { + if (pDib.channels() == 3){ + cv::Mat dst; + cv::cvtColor(pDib, dst,cv::COLOR_BGR2GRAY); + retMats.push_back(dst); + } + cv::Mat dstThre; + cv::cvtColor(pDib, dstThre,cv::COLOR_BGR2GRAY); + //cv::threshold(dstThre, dstThre, m_thre, 255, cv::THRESH_BINARY); + cv::adaptiveThreshold(dstThre,dstThre,255,cv::ADAPTIVE_THRESH_GAUSSIAN_C,cv::THRESH_BINARY,25,5); + if (!dstThre.empty()) + { + retMats.push_back(dstThre); + } + } + break; + case COLORGRAY: + { + if (pDib.channels() == 3) { + cv::Mat dstGray; + cv::cvtColor(pDib, dstGray, cv::COLOR_BGR2GRAY); + retMats.push_back(dstGray); + } + } + break; + case COLORBW: + { + if (pDib.channels() == 3) { + cv::Mat dstGray; + cv::cvtColor(pDib, dstGray, cv::COLOR_BGR2GRAY); + cv::Mat dstBW; + cv::adaptiveThreshold(dstGray,dstBW,255,cv::ADAPTIVE_THRESH_GAUSSIAN_C,cv::THRESH_BINARY,25,5); + retMats.push_back(dstBW); + } + } + break; + case GRAYBW://pDib should be GreyImage(channels() == 1) + { + cv::Mat dstBW; + cv::adaptiveThreshold(pDib,dstBW,255,cv::ADAPTIVE_THRESH_GAUSSIAN_C,cv::THRESH_BINARY,25,5); + if (!dstBW.empty()) + { + retMats.push_back(dstBW); + } + } + break; + default: + break; + } + return retMats; +} diff --git a/imageprocess/ImageMulti.h b/imageprocess/ImageMulti.h new file mode 100644 index 0000000..0a79195 --- /dev/null +++ b/imageprocess/ImageMulti.h @@ -0,0 +1,26 @@ +#ifndef IMAGE_MULTI_H +#define IMAGE_MULTI_H +#include "IMulti.h" + +class IMageMulti + :public IMulti +{ +public: + enum MultiOutput + { + NONE=-1, + ALL, + COLORGRAY, + COLORBW, + GRAYBW + }; +public: + IMageMulti(int multiType = 0,int thre = 128); + virtual ~IMageMulti(void); + virtual std::vector apply(cv::Mat& pDib); +private: + int m_multiType; + int m_thre; +}; + +#endif // !IMAGE_MULTI_H \ No newline at end of file diff --git a/imageprocess/ImageMultiOutputRed.cpp b/imageprocess/ImageMultiOutputRed.cpp new file mode 100644 index 0000000..5cc08d2 --- /dev/null +++ b/imageprocess/ImageMultiOutputRed.cpp @@ -0,0 +1,63 @@ +#include "ImageMultiOutputRed.h" +#include + +using namespace std; + +ImageMultiOutputRed::ImageMultiOutputRed(short channelIndex) +{ + m_channelIndex = channelIndex; +} + +ImageMultiOutputRed::~ImageMultiOutputRed(void) +{ +} + +std::vector ImageMultiOutputRed::apply(cv::Mat& pDib) +{ + std::vector retMats; + if (pDib.empty()) + return retMats; + retMats.push_back(pDib); + cv::Mat mat = FilterColor(pDib, m_channelIndex); + if (!mat.empty()) + retMats.push_back(mat); + return retMats; +} + +cv::Mat ImageMultiOutputRed::FilterColor(cv::Mat image, short channel) +{ + cv::Mat dstImage(image.rows, image.cols, CV_8UC1); + int channels = image.channels(); + if (channel > channels - 1) + { + return cv::Mat(); + } + if ((channel == 3) && (channels != 4) && (channels != 8)) + { + return cv::Mat(); + } + if (channels <= 4) + { + int srcOffset = image.step - image.cols * channels; + int dstOffset = dstImage.step - dstImage.cols; + unsigned char *src = image.data; + unsigned char *dst = dstImage.data; + src += channel; + + for (int y = 0; y < image.rows; y++) + { + for (int x = 0; x < image.cols; x++, src += channels, dst++) + { + unsigned short pix = *src; + if (pix >= 130) + { + pix = 255; + } + *dst = pix; + } + src += srcOffset; + dst += dstOffset; + } + } + return dstImage; +} diff --git a/imageprocess/ImageMultiOutputRed.h b/imageprocess/ImageMultiOutputRed.h new file mode 100644 index 0000000..a7ed28c --- /dev/null +++ b/imageprocess/ImageMultiOutputRed.h @@ -0,0 +1,17 @@ +#ifndef IMAGE_MULTI_OUTPUT_RED_H +#define IMAGE_MULTI_OUTPUT_RED_H +#include "IMulti.h" + +class ImageMultiOutputRed + :public IMulti +{ +public: + ImageMultiOutputRed(short channelIndex); + virtual ~ImageMultiOutputRed(void); + virtual std::vector apply(cv::Mat& pDib) override; + +private: + short m_channelIndex; + cv::Mat FilterColor(cv::Mat image, short channel); +}; +#endif //!IMAGE_MULTI_OUTPUT_RED_H diff --git a/imageprocess/ImageProcess_Public.cpp b/imageprocess/ImageProcess_Public.cpp new file mode 100644 index 0000000..84f51e9 --- /dev/null +++ b/imageprocess/ImageProcess_Public.cpp @@ -0,0 +1,337 @@ +#include "ImageProcess_Public.h" + +namespace hg +{ + void convexHull(const std::vector& src, std::vector& dst, bool clockwise) + { + CvMemStorage* storage = cvCreateMemStorage(); // + CvSeq* ptseq = cvCreateSeq(CV_SEQ_KIND_GENERIC | CV_32SC2, sizeof(CvContour), sizeof(CvPoint), storage); //ptseqstorage + + //srcĵ㼯ptseq + for (const cv::Point& item : src) + { + CvPoint p; + p.x = item.x; + p.y = item.y; + cvSeqPush(ptseq, &p); + } + + //ȡ + CvSeq* hull = cvConvexHull2(ptseq, nullptr, clockwise ? CV_CLOCKWISE : CV_COUNTER_CLOCKWISE, 0); + + //dst + dst.clear(); + for (int i = 0, hullCount = hull->total; i < hullCount; i++) + dst.push_back(**CV_GET_SEQ_ELEM(CvPoint*, hull, i)); + + //ͷstorage + cvReleaseMemStorage(&storage); + } + +#define R_COLOR 255 + void fillConvexHull(cv::Mat& image, const std::vector& points) + { + uint index_top = 0; + uint index_bottom = 0; + for (size_t i = 0, length = points.size(); i < length; i++) + { + if (points[i].y < points[index_top].y) + index_top = i; + if (points[i].y > points[index_bottom].y) + index_bottom = i; + } + + std::vector edge_left; + uint temp = index_top; + while (temp != index_bottom) + { + edge_left.push_back(points[temp]); + temp = (temp + points.size() - 1) % points.size(); + } + edge_left.push_back(points[index_bottom]); + + std::vector edge_right; + temp = index_top; + while (temp != index_bottom) + { + edge_right.push_back(points[temp]); + temp = (temp + points.size() + 1) % points.size(); + } + edge_right.push_back(points[index_bottom]); + + std::vector left_edge_x; + std::vector left_edge_y; + for (size_t i = 0, length = edge_left.size() - 1; i < length; i++) + { + int y_top = edge_left[i].y; + int x_top = edge_left[i].x; + int y_bottom = edge_left[i + 1].y; + int x_bottom = edge_left[i + 1].x; + for (int y = y_top; y < y_bottom; y++) + if (y >= 0 && y_top != y_bottom && y < image.rows) + { + left_edge_x.push_back(((x_bottom - x_top) * y + x_top * y_bottom - x_bottom * y_top) / (y_bottom - y_top)); + left_edge_y.push_back(y); + } + } + size_t step = image.step; + unsigned char* ptr; + ptr = image.data + static_cast(left_edge_y[0]) * step; + for (size_t i = 0, length = left_edge_x.size(); i < length; i++) + { + int pix = left_edge_x[i]; + if (pix < image.cols - 1 && pix > 0) + memset(ptr + i * step, R_COLOR, static_cast((pix + 1) * image.channels())); + } + + std::vector right_edge_x; + std::vector right_edge_y; + for (size_t i = 0, length = edge_right.size() - 1; i < length; i++) + { + int y_top = edge_right[i].y; + int x_top = edge_right[i].x; + int y_bottom = edge_right[i + 1].y; + int x_bottom = edge_right[i + 1].x; + for (int y = y_top; y < y_bottom; y++) + if (y_top != y_bottom && y < image.rows && y >= 0) + { + right_edge_x.push_back(((x_bottom - x_top) * y + x_top * y_bottom - x_bottom * y_top) / (y_bottom - y_top)); + right_edge_y.push_back(y); + } + } + + ptr = image.data + static_cast(right_edge_y[0]) * step; + for (size_t i = 0, length = right_edge_x.size(); i < length; i++) + { + int pix = right_edge_x[i]; + if (pix < image.cols - 1 && pix > 0) + memset(ptr + i * step + pix * image.channels(), R_COLOR, step - static_cast(pix * image.channels())); + } + + if (edge_left[0].y > 0) + memset(image.data, R_COLOR, static_cast(edge_left[0].y) * step); + + if (edge_left.back().y < image.rows - 1) + memset(image.data + static_cast(edge_left.back().y) * step, R_COLOR, + static_cast(image.rows - edge_left.back().y) * step); + } + + void fillPolys(cv::Mat& image, const std::vector>& contours, const cv::Scalar& color) + { + if (contours.empty()) return; + + size_t count = contours.size(); + cv::Point** pointss = new cv::Point*[count]; + int* npts = new int[count]; + + for (size_t i = 0; i < count; i++) + { + size_t length = contours[i].size(); + npts[i] = length; + pointss[i] = new cv::Point[length]; + for (size_t j = 0; j < length; j++) + pointss[i][j] = contours[i][j]; + } + cv::fillPoly(image, const_cast(pointss), npts, count, color); + + for (size_t i = 0; i < count; i++) + delete[] pointss[i]; + + delete[] pointss; + delete[] npts; + } + + void findContours(const cv::Mat& src, std::vector>& contours, std::vector& hierarchy, int retr, int method, cv::Point offset) + { +#if CV_VERSION_REVISION == 6 + CvMat c_image = src; +#else + CvMat c_image; + c_image = cvMat(src.rows, src.cols, src.type(), src.data); + c_image.step = src.step[0]; + c_image.type = (c_image.type & ~cv::Mat::CONTINUOUS_FLAG) | (src.flags & cv::Mat::CONTINUOUS_FLAG); +#endif + cv::MemStorage storage(cvCreateMemStorage()); + CvSeq* _ccontours = nullptr; + +#if CV_VERSION_REVISION == 6 + cvFindContours(&c_image, storage, &_ccontours, sizeof(CvContour), retr, method, CvPoint(offset)); +#else + cvFindContours(&c_image, storage, &_ccontours, sizeof(CvContour), retr, method, CvPoint{ offset.x, offset.y }); +#endif + if (!_ccontours) + { + contours.clear(); + return; + } + cv::Seq all_contours(cvTreeToNodeSeq(_ccontours, sizeof(CvSeq), storage)); + size_t total = all_contours.size(); + contours.resize(total); + + cv::SeqIterator it = all_contours.begin(); + for (size_t i = 0; i < total; i++, ++it) + { + CvSeq* c = *it; + reinterpret_cast(c)->color = static_cast(i); + int count = c->total; + int* data = new int[static_cast(count * 2)]; + cvCvtSeqToArray(c, data); + for (int j = 0; j < count; j++) + { + contours[i].push_back(cv::Point(data[j * 2], data[j * 2 + 1])); + } + delete[] data; + } + + hierarchy.resize(total); + it = all_contours.begin(); + for (size_t i = 0; i < total; i++, ++it) + { + CvSeq* c = *it; + int h_next = c->h_next ? reinterpret_cast(c->h_next)->color : -1; + int h_prev = c->h_prev ? reinterpret_cast(c->h_prev)->color : -1; + int v_next = c->v_next ? reinterpret_cast(c->v_next)->color : -1; + int v_prev = c->v_prev ? reinterpret_cast(c->v_prev)->color : -1; + hierarchy[i] = cv::Vec4i(h_next, h_prev, v_next, v_prev); + } + + storage.release(); + } + + cv::RotatedRect getBoundingRect(const std::vector& contour) + { + if (contour.empty()) return {}; + + cv::RotatedRect rect = minAreaRect(contour); + if (rect.angle < -45) + { + rect.angle += 90; + float temp = rect.size.width; + rect.size.width = rect.size.height; + rect.size.height = temp; + } + + return rect; + } + + std::vector getMaxContour(const std::vector>& contours, const std::vector& hierarchy) + { + std::vector maxContour; + if (contours.size() < 1) return {}; + + for (size_t i = 0, length = hierarchy.size(); i < length; i++) + if (hierarchy[i][3] == -1) + for (const auto &item : contours[i]) + maxContour.push_back(item); + + return maxContour; + } + + std::vector getVertices(const cv::RotatedRect& rect) + { + cv::Point2f box[4]; + rect.points(box); + std::vector points; + for (int i = 0; i < 4; i++) + points.push_back(cv::Point(box[i].x, box[i].y)); + + return points; + } + + void polyIndent(std::vector& points, const cv::Point& center, int indent) + { + static cv::Point zero(0, 0); + for (cv::Point& item : points) + { +#if 0 + cv::Point vec = item - center; + if (vec != zero) + { + int length = vec.x * vec.x + vec.y * vec.y; + float x = cv::sqrt(static_cast(vec.x * vec.x / length)) * indent; + float y = cv::sqrt(static_cast(vec.y * vec.y / length)) * indent; + + if (vec.x < 0) x *= -1.0f; + if (vec.y < 0) y *= -1.0f; + + item.x -= static_cast(x); + item.y -= static_cast(y); + } +#else + if (item.x > center.x) + item.x -= indent; + else + item.x += indent; + + if (item.y > center.y) + item.y -= indent; + else + item.y += indent; +#endif + } + } + + cv::Mat transforColor(const cv::Mat& src) + { + if (src.channels() == 1) return src.clone(); + + std::vector channels(3); + cv::split(src, channels); + + cv::Mat temp, dst; + bitwise_or(channels[0], channels[1], temp); + bitwise_or(channels[2], temp, dst); + temp.release(); + + for (cv::Mat& index : channels) + index.release(); + return dst; + } + + void threshold_Mat(const cv::Mat& src, cv::Mat& dst, double thre) + { + if (src.channels() == 3) + { +#ifdef USE_ONENCL + if (cl_res.context) + transforColor_threshold_opencl(src, dst, static_cast(thre)); + else +#endif + { + cv::Mat gray = transforColor(src); + cv::threshold(gray, dst, thre, 255, cv::THRESH_BINARY); + gray.release(); + } + } + else + cv::threshold(src, dst, thre, 255, cv::THRESH_BINARY); + } + + cv::Point warpPoint(const cv::Point& p, const cv::Mat& warp_mat) + { + double src_data[3] = { static_cast(p.x), static_cast(p.y), 1 }; + cv::Mat src(3, 1, warp_mat.type(), src_data); //warp_mat.type() == CV_64FC1 + + cv::Mat dst = warp_mat * src; + double* ptr = reinterpret_cast(dst.data); + return cv::Point(static_cast(ptr[0]), static_cast(ptr[1])); + } + + int distanceP2P(const cv::Point& p1, const cv::Point& p2) + { + return sqrt(pow(p1.x - p2.x, 2) + pow(p1.y - p2.y, 2)); + //return 0; + } + + float distanceP2L(const cv::Point& p, const cv::Point& l1, const cv::Point& l2) + { + //ֱ߷ + int A = 0, B = 0, C = 0; + A = l1.y - l2.y; + B = l2.x - l1.x; + C = l1.x * l2.y - l1.y * l2.x; + //㵽ֱ߾빫ʽ + return ((float)abs(A * p.x + B * p.y + C)) / ((float)sqrtf(A * A + B * B)); + //return 0; + } +} diff --git a/imageprocess/ImageProcess_Public.h b/imageprocess/ImageProcess_Public.h new file mode 100644 index 0000000..47db601 --- /dev/null +++ b/imageprocess/ImageProcess_Public.h @@ -0,0 +1,129 @@ +/* + * ==================================================== + + * ܣͼ㷨ֹܻܿImageProcess෴ʹ + * ߣά + * ʱ䣺2020/4/21 + * ޸ʱ䣺2020/4/21 + * 汾ţv1.0 + + * ==================================================== + */ + +#ifndef IMAGE_PROCESS_PUBLIC_H +#define IMAGE_PROCESS_PUBLIC_H + +#include "opencv2/opencv.hpp" +#include + +namespace hg +{ + /* + * ܣԴ㼯͹㼯 + * src: Դ㼯 + * dst: Ŀ㼯 + * clockwise: trueΪ˳ʱfalseΪʱ + */ + void convexHull(const std::vector& src, std::vector& dst, bool clockwise = false); + + /* + * ܣ͹ΣĬɫΪɫ + * image: ͼ + * points: ͹㼯ʱ + */ + void fillConvexHull(cv::Mat& image, const std::vector& points); + + /* + * ܣ䰼 + * image: ͼ + * contours: 㼯ʱ + * color: ɫ + */ + void fillPolys(cv::Mat& image, const std::vector>& contours, const cv::Scalar& color); + + /* + * ܣȡͨ + * src: Դͼ + * contours: + * hierarchy: ϵcontoursӦretrѡͬб仯 + * retr: ʽĬΪʽ + * method: 㷨ѡĬΪͨ + * offset: ʼ㣬ĬΪ0,0 + */ + void findContours(const cv::Mat& src, std::vector>& contours, std::vector& hierarchy, + int retr = cv::RETR_LIST, int method = cv::CHAIN_APPROX_SIMPLE, cv::Point offset = cv::Point(0, 0)); + + /* + * ܣȡǵ㼯СӾ + * contour: 㼯 + * ֵ: ת + */ + cv::RotatedRect getBoundingRect(const std::vector& contour); + + /* + * : ȡС͹ + * contours: ÿɵ㼯ɣ + * hierarchy: У֮ĹϵcontoursӦ + * ֵ: ͹㼯 + */ + std::vector getMaxContour(const std::vector>& contours, const std::vector& hierarchy); + + /* + * : ȡС͹ + * contours: ÿɵ㼯ɣ + * hierarchy: У֮ĹϵcontoursӦ + * ֵ: ͹㼯 + */ + std::vector getVertices(const cv::RotatedRect& rect); + + /* + * : + * points: 㼯 + * center: Χcenter + * indent: + */ + void polyIndent(std::vector& points, const cv::Point& center, int indent); + + /* + * : ֵܹɫͻҶͼsrcΪɫͼʱҶͼȡֵͨ + * src: Դͼ + * dst: Ŀͼ + * thre: ֵ + */ + void threshold_Mat(const cv::Mat& src, cv::Mat& dst, double thre); + + /* + * : ɫתҶȣҶͼȡֵͨ + * src: Դͼ + * ֵ: Ҷͼ + */ + cv::Mat transforColor(const cv::Mat& src); + + /* + * : ȡķ任 + * p: ԭ + * warp_mat: 任ϵ + * ֵ: 任ĵ + */ + cv::Point warpPoint(const cv::Point& p, const cv::Mat& warp_mat); + + /* + * : 㵽 + * p1: 1 + * p2: 2 + * ֵ: 㵽 + */ + int distanceP2P(const cv::Point& p1, const cv::Point& p2); + + /* + * : 㵽ֱ߾ + * p: + * l1: ֱ߶˵1 + * l2: ֱ߶˵2 + * ֵ: 㵽ֱ߾ + */ + float distanceP2L(const cv::Point& p, const cv::Point& l1, const cv::Point& l2); + +} + +#endif // !IMAGE_PROCESS_C_H diff --git a/imageprocess/MatEx.h b/imageprocess/MatEx.h new file mode 100644 index 0000000..ab0c469 --- /dev/null +++ b/imageprocess/MatEx.h @@ -0,0 +1,22 @@ +#pragma once +#include + +class MatEx { +public: + MatEx() : + mat(cv::Mat()) + , Bpp(-1) { + + }; + + MatEx(cv::Mat &mat, int bpp) : + mat(cv::Mat()) + , Bpp(bpp) + { + this->mat = mat; + this->Bpp = bpp; + } +public: + int Bpp; + cv::Mat mat; +}; \ No newline at end of file diff --git a/imageprocess/imageprocess.pro b/imageprocess/imageprocess.pro new file mode 100644 index 0000000..2427f39 --- /dev/null +++ b/imageprocess/imageprocess.pro @@ -0,0 +1,128 @@ +CONFIG -= qt + +TEMPLATE = lib +win32{ + CONFIG += staticlib +} +CONFIG += c++11 + +TARGET = hgimgproc + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + + +win32{ + DEFINES += _WIN32 + INCLUDEPATH += $$PWD/../3rdparty/opencv/include + QMAKE_CXXFLAGS += /MP6 + CONFIG(debug,debug|release){ + QMAKE_CXXFLAGS_DEBUG += -MTd + QMAKE_CFLAGS_DEBUG += -MTd + DESTDIR += $$PWD/../bin/debug + LIBS += -L$$PWD/../3rdparty/opencv/win/debug -lopencv_world3414d -lIlmImfd -littnotifyd -llibjasperd -llibjpeg-turbod -llibpngd -llibprotobufd \ + -llibtiffd -llibwebpd -lquircd -lzlibd + } + CONFIG(release,debug|release){ + QMAKE_CXXFLAGS_RELEASE += -MT + QMAKE_CFLAGS_RELEASE += -MT + DESTDIR += $$PWD/../bin/release + LIBS += -L$$PWD/../3rdparty/opencv/win/release -lopencv_world3414 -lIlmImf -littnotify -llibjasper -llibjpeg-turbo -llibpng -llibprotobuf \ + -llibtiff -llibwebp -lquirc -lzlib + } +} + +unix{ + INCLUDEPATH += $$PWD/../3rdparty/opencv/include + INCLUDEPATH += $$PWD/../3rdparty/nick + LIBS += -ldl + LIBS += -L$$PWD/../3rdparty/opencv/linux -lopencv_world -lIlmImf -littnotify -llibjasper -llibjpeg-turbo -llibpng \ + -llibtiff -llibwebp -lzlib + + CONFIG(debug,debug|release){ + DESTDIR += $$PWD/../bin/debug + } + CONFIG(release,debug|release){ + DESTDIR += $$PWD/../bin/release + } +} + +SOURCES += \ + IMulti.cpp \ + ImageApply.cpp \ + ImageApplyAdjustColors.cpp \ + ImageApplyAutoContrast.cpp \ + ImageApplyAutoCrop.cpp \ + ImageApplyBWBinaray.cpp \ + ImageApplyChannel.cpp \ + ImageApplyColorRecognition.cpp \ + ImageApplyConcatenation.cpp \ + ImageApplyCustomCrop.cpp \ + ImageApplyCustomGamma.cpp \ + ImageApplyCvtColor.cpp \ + ImageApplyDetachNoise.cpp \ + ImageApplyDiscardBlank.cpp \ + ImageApplyDogEarDetection.cpp \ + ImageApplyFadeBackGroundColor.cpp \ + ImageApplyFilter.cpp \ + ImageApplyHSVCorrect.cpp \ + ImageApplyMarkCrop.cpp \ + ImageApplyOutHole.cpp \ + ImageApplyRefuseInflow.cpp \ + ImageApplyResize.cpp \ + ImageApplyRotation.cpp \ + ImageApplySplit.cpp \ + ImageApplyTextureRemoval.cpp \ + ImageMatQueue.cpp \ + ImageMulti.cpp \ + ImageMultiOutputRed.cpp \ + ImageProcess_Public.cpp + +HEADERS += \ + IMulti.h \ + ImageApply.h \ + ImageApplyAdjustColors.h \ + ImageApplyAutoContrast.h \ + ImageApplyAutoCrop.h \ + ImageApplyBWBinaray.h \ + ImageApplyChannel.h \ + ImageApplyColorRecognition.h \ + ImageApplyConcatenation.h \ + ImageApplyCustomCrop.h \ + ImageApplyCustomGamma.h \ + ImageApplyCvtColor.h \ + ImageApplyDetachNoise.h \ + ImageApplyDiscardBlank.h \ + ImageApplyDogEarDetection.h \ + ImageApplyFadeBackGroundColor.h \ + ImageApplyFilter.h \ + ImageApplyHSVCorrect.h \ + ImageApplyHeaders.h \ + ImageApplyMarkCrop.h \ + ImageApplyOutHole.h \ + ImageApplyRefuseInflow.h \ + ImageApplyResize.h \ + ImageApplyRotation.h \ + ImageApplySplit.h \ + ImageApplyTextureRemoval.h \ + ImageMatQueue.h \ + ImageMulti.h \ + ImageMultiOutputRed.h \ + ImageProcess_Public.h \ + MatEx.h \ + imgprocdefs.h \ + resource.h + +# Default rules for deployment. +unix { + target.path = $$[QT_INSTALL_PLUGINS]/generic +} +!isEmpty(target.path): INSTALLS += target diff --git a/imageprocess/imgprocdefs.h b/imageprocess/imgprocdefs.h new file mode 100644 index 0000000..ba5fea9 --- /dev/null +++ b/imageprocess/imgprocdefs.h @@ -0,0 +1,22 @@ +#ifndef IMAGE_PROCESS_DEFINES_H +#define IMAGE_PROCESS_DEFINES_H + +//#if defined(_MSC_VER) +//# define HT_DECL_EXPORT __declspec(dllexport) +//# define HT_DECL_IMPORT __declspec(dllimport) +//#elif defined(__linux__) || defined(__linux) +//# define HT_DECL_EXPORT __attribute__((visibility("default"))) +//# define HT_DECL_IMPORT __attribute__((visibility("default"))) +//# define HT_DECL_HIDDEN __attribute__((visibility("hidden"))) +//#endif +// +//#if defined(GIMGPROC_LIBRARY_BUILD) +//#define HT_DECL_EXPORT +//#elif defined(_DIRECT_BUILD) +//#define +//#else +////#define HT_DECL_IMPORT +//#endif +#define IMAGE_PROCESS_DEFINES_H + +#endif // !IMAGE_PROCESS_DEFINES_H diff --git a/imageprocess/resource.h b/imageprocess/resource.h new file mode 100644 index 0000000..14f23c8 --- /dev/null +++ b/imageprocess/resource.h @@ -0,0 +1,14 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by hgimgproc.rc + +// ¶һĬֵ +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/qt-correction-tool/.qmake.stash b/qt-correction-tool/.qmake.stash deleted file mode 100644 index e629832..0000000 --- a/qt-correction-tool/.qmake.stash +++ /dev/null @@ -1,22 +0,0 @@ -QMAKE_CXX.QT_COMPILER_STDCXX = 199711L -QMAKE_CXX.QMAKE_MSC_VER = 1929 -QMAKE_CXX.QMAKE_MSC_FULL_VER = 192930038 -QMAKE_CXX.COMPILER_MACROS = \ - QT_COMPILER_STDCXX \ - QMAKE_MSC_VER \ - QMAKE_MSC_FULL_VER -QMAKE_CXX.INCDIRS = \ - "D:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\ATLMFC\\include" \ - "D:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\include" \ - "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\include\\um" \ - "D:\\Windows Kits\\10\\include\\10.0.19041.0\\ucrt" \ - "D:\\Windows Kits\\10\\include\\10.0.19041.0\\shared" \ - "D:\\Windows Kits\\10\\include\\10.0.19041.0\\um" \ - "D:\\Windows Kits\\10\\include\\10.0.19041.0\\winrt" \ - "D:\\Windows Kits\\10\\include\\10.0.19041.0\\cppwinrt" -QMAKE_CXX.LIBDIRS = \ - "D:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\ATLMFC\\lib\\x86" \ - "D:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Enterprise\\VC\\Tools\\MSVC\\14.29.30037\\lib\\x86" \ - "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x86" \ - "D:\\Windows Kits\\10\\lib\\10.0.19041.0\\ucrt\\x86" \ - "D:\\Windows Kits\\10\\lib\\10.0.19041.0\\um\\x86" diff --git a/qt-correction-tool/IUsb.h b/qt-correction-tool/IUsb.h deleted file mode 100644 index 2d3a17d..0000000 --- a/qt-correction-tool/IUsb.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once -typedef void(*usbhotplug_callback)(bool isleft, void* userdata); - -class IUsb -{ -public: - virtual ~IUsb() {} - virtual bool open() = 0; - virtual void set_usbhotplug_callback(usbhotplug_callback callback = nullptr, void* userdata = nullptr) = 0; - virtual bool close() = 0; - virtual bool is_open() = 0; - virtual bool is_connected() = 0; - virtual void set_timeout(int timeout) = 0; - virtual int read_bulk(void* data, int len) = 0; - virtual int write_bulk(void* data, int len) = 0; - virtual int read_int(void* data, int len) = 0; - virtual int control_msg(int rtype, int req, int value, int index, int len, void* data) = 0; -}; diff --git a/qt-correction-tool/ImageMatQueue.cpp b/qt-correction-tool/ImageMatQueue.cpp deleted file mode 100644 index 1e30515..0000000 --- a/qt-correction-tool/ImageMatQueue.cpp +++ /dev/null @@ -1,184 +0,0 @@ -#include "StdAfx.h" -#include "ImageMatQueue.h" -#include "filetools.h" -#include "imageprocess.h" -#include -static int imgindex = 0; -ImageMatQueue::ImageMatQueue(void) -{ - pixType = -1; - DevModel = -1; - bScanning = false; - imageremain = 0; - pic_suffix = "bmp"; -} - -void ImageMatQueue::run() -{ - if (m_threadProc.joinable()) - { - bRun = false; - m_threadProc.join(); - } - bRun = true; - imgindex = 0; - m_threadProc = std::thread(&ImageMatQueue::proc, this); -} - -void ImageMatQueue::setmultioutputR(bool canoutput/*=false*/) -{ - can_multi_outputR = canoutput; -} - -void ImageMatQueue::SetDevModel(int dev/*=-1*/) -{ - DevModel = dev; -} - -ImageMatQueue::~ImageMatQueue(void) -{ - if (m_images.Size() > 0) - { - m_images.Clear(); - m_images.ShutDown(); - } - if (m_pImages.Size() > 0) - { - m_pImages.Clear(); - m_pImages.ShutDown(); - } - if (m_threadProc.joinable()) - { - bRun = false; - m_threadProc.join(); - } -} - -void ImageMatQueue::pushMat(JpegBuffer& data) -{ - imageremain++; - m_pImages.Put(data); - int k = 0; -} - -QString ImageMatQueue::popMat(int num) -{ - return m_images.Take(); -} - -bool ImageMatQueue::valid() -{ - return m_images.Size(); -} - -void ImageMatQueue::clear() -{ - while (m_images.Size() > 0) - { - m_images.Take(); - } - while (m_pImages.Size() > 0) - { - m_pImages.Clear(); - } -} - - -int ImageMatQueue::getMatSum() -{ - int iSum = 0; - iSum = m_images.Size(); - return iSum; -} - -bool ImageMatQueue::isScanning() -{ - return (imageremain != 0) || (m_pImages.Size() != 0); -} - -bool ImageMatQueue::empty() -{ - return m_images.Size() == 0 && imageremain == 0 && !bScanning; -} - -void ImageMatQueue::proc() -{ - while (bRun) - { - this_thread::sleep_for(std::chrono::milliseconds(5)); - { - if (m_pImages.Size() > 0)//m_images.empty() && - { - if (pixType != -1) - { - QString csName; - SYSTEMTIME st = { 0 }; - GetLocalTime(&st); //ȡǰʱ ɾȷms - csName.sprintf("%02d%02d%02d-%d.", st.wHour, st.wMinute, st.wSecond, ++imgindex); - csName += pic_suffix; - cv::Mat matPicImage; - cv::Mat matFront, matBack; - vector mats; - switch (DevModel) - { - case 0://G100 - case 1://G200//ͼֿ - { - if (m_pImages.Size() >= 2) - { - matFront = m_pImages.Take().getMat(pixType); - matBack = m_pImages.Take().getMat(pixType); - mats.push_back(matFront); - mats.push_back(matBack); - for (int i = 0; i < mats.size(); ++i) - { - QString qsImage = csPath; - QString qsName = "/G200_" + QString::number(i) + "_" + csName; - qsImage += qsName; -#ifdef WIN32 - qsImage.replace("/", "\\"); -#endif // WIN32 - cv::imwrite(qsImage.toStdString(), mats[i]); - m_images.Put(qsImage); - size_t size = m_images.Size(); - ///qDebug(" m_images.Size() %d", size); - } - } - } - break; - case 2://G300 - case 3://G400 - case 4://G500 ͼһͼϣҪͼ - { - QString csImage; - csImage = csPath + "/G300" + csName; -#ifdef WIN32 - csImage.replace("/", "\\"); -#endif // WIN32 - - cv::Mat mat = m_pImages.Take().getMat(pixType);//1 color 6 gray - cv::imwrite(csImage.toStdString(), mat); - m_images.Put(csImage); - size_t size = m_images.Size(); - qDebug(" m_images.Size() %d", size); - - } - break; - default: - break; - } - - if (DevModel == 0 || DevModel == 1) - { - for (int i = 0; i < mats.size(); i++) - { - imageremain--; - } - } - else - imageremain--; - } - } - } - } -} diff --git a/qt-correction-tool/ImageMatQueue.h b/qt-correction-tool/ImageMatQueue.h deleted file mode 100644 index 8ad9135..0000000 --- a/qt-correction-tool/ImageMatQueue.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include -#include - -#include - - -#include "JpegBuffer.h" -#include -#include "BlockingQueue.h" -#include -class ImageMatQueue -{ -public: - ImageMatQueue(void); - virtual ~ImageMatQueue(void); - - void pushMat(JpegBuffer& data); - QString popMat(int num); - bool empty(); - bool valid(); - void clear(); - void run(); - int getMatSum(); - bool isScanning(); - void SetScanFlag(bool scannning) { bScanning = bScanning; } - void SetFilePath(QString csFilePath) - { - csPath = csFilePath; - } - void SetPicformat(QString picformat) - { - pic_suffix = picformat; - } - - QString GetFilePath() - { - return csPath; - } - - - -public: - int pixType; - void setmultioutputR(bool canoutput = false); - void SetDevModel(int dev = -1); - - QString csPath; - QString pic_suffix; -private: - void proc(); - - BlockingQueue m_images; //!< Ѵͼ - BlockingQueue m_pImages; - std::thread m_threadProc; - volatile bool bRun; - bool can_multi_outputR; - int DevModel; - volatile bool bScanning; - volatile int imageremain; -}; - diff --git a/qt-correction-tool/JpegBuffer.cpp b/qt-correction-tool/JpegBuffer.cpp deleted file mode 100644 index 5203b50..0000000 --- a/qt-correction-tool/JpegBuffer.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "StdAfx.h" -#include "JpegBuffer.h" -#include "jpeglib.h" -//#include "twain.h" -#include "filetools.h" - -using namespace std; - -JpegBuffer::JpegBuffer() -{ -} - -JpegBuffer::JpegBuffer(cv::Mat buffer, int color_type,int side,int mFilter) -{ - this->m_buffer = buffer; - this->m_color_type=color_type; - this->m_side=side; - this->m_mFilter=mFilter; -} - - -JpegBuffer::~JpegBuffer(void) -{ -} - - -unsigned char* JpegBuffer::getBuffer() -{ - return m_buffer.data; -} - -cv::Mat JpegBuffer::buffer() -{ - return m_buffer; -} - -int JpegBuffer::getSize() -{ - return m_buffer.cols; -} - - -cv::Mat JpegBuffer::getMat( int pixType) -{ - JpegLib jl; - //cv::Mat image = jl.decode(m_buffer, 6);//oixtype - StopWatch sw; - sw.start(); - //XdPrint("buffer size is :%d ==========================\n",getSize()); - cv::Mat image = jl.decode(m_buffer, pixType);//oixtype - sw.stop(); - //XdPrint("Decode Image time epleased :%lf ==========================\n",sw.time_run()); - - //XdPrint("==image col is :%d, image row is :%d, image size is :%d===\n",image.cols, image.rows, image.size); - //FileTools::write_log("D:/1.txt",) - - //cv::InputArray arr(m_buffer); - // - //cv::Mat image1=imdecode(arr,m_color_type==TWPT_RGB?CV_LOAD_IMAGE_COLOR:CV_LOAD_IMAGE_GRAYSCALE); - //cv::imwrite("0.bmp",image1); - - //char str[256]; - //sprintf(str, "%lf", sw.time_run()); - //string res=str; - //FileTools::write_log("D:/1.txt",res); - - - //0 1 - - - //if (!backRotate&&(m_side==0||m_side==1)) - //{ - // cv::Rect rect(0, m_side == 0 ? 0 : gap, image.cols,(image.rows-gap)); - // image = image(rect); - //} - return image.clone(); -} - -int JpegBuffer::getMFilter() -{ - return m_mFilter; -} - -int JpegBuffer::getSide() -{ - return m_side; -} diff --git a/qt-correction-tool/JpegBuffer.h b/qt-correction-tool/JpegBuffer.h deleted file mode 100644 index 9e3c496..0000000 --- a/qt-correction-tool/JpegBuffer.h +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once -#include -#include "jpeglib.h" - -class JpegBuffer -{ -public: - JpegBuffer(); - JpegBuffer(cv::Mat buffer,int color_type=2,int side=0,int mFilter=0); - virtual ~JpegBuffer(void); - - unsigned char* getBuffer(); - cv::Mat buffer(); - int getSize(); - cv::Mat getMat( int pixType); - int getMFilter(); - int getSide(); -private: - cv::Mat m_buffer; - int m_color_type; - int m_side; - int m_mFilter; -}; diff --git a/qt-correction-tool/MutexEx.h11 b/qt-correction-tool/MutexEx.h11 deleted file mode 100644 index 7bd9e27..0000000 --- a/qt-correction-tool/MutexEx.h11 +++ /dev/null @@ -1,53 +0,0 @@ -#pragma once - -#include -//ٽͬзװ -class CMyCriticalSection -{ -public: - - CMyCriticalSection() - { - InitializeCriticalSection(&m_cSection); - } - - void Lock() - { - EnterCriticalSection(&m_cSection); - } - - void UnLock() - { - LeaveCriticalSection(&m_cSection); - } - - - //ɾٽ - virtual ~CMyCriticalSection() - { - DeleteCriticalSection(&m_cSection); - } -private: - CRITICAL_SECTION m_cSection; -}; - -class CCriticalSectionAutoLock -{ -public: - //ù캯ȥٽ - - CCriticalSectionAutoLock(CMyCriticalSection *mySection):pCMySection(mySection) - { - pCMySection->Lock(); - } - - //뿪ٽ - virtual ~CCriticalSectionAutoLock() - { - pCMySection->UnLock(); - } -private: - CMyCriticalSection *pCMySection; -}; - - diff --git a/qt-correction-tool/PublicFunc.cpp b/qt-correction-tool/PublicFunc.cpp deleted file mode 100644 index 1f64fe4..0000000 --- a/qt-correction-tool/PublicFunc.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "stdafx.h" -#include "PublicFunc.h" - -#ifdef WIN32 -#include -#endif - -#include -using namespace std; - diff --git a/qt-correction-tool/PublicFunc.h b/qt-correction-tool/PublicFunc.h deleted file mode 100644 index 992738a..0000000 --- a/qt-correction-tool/PublicFunc.h +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef PUBLICFUNC_H_ -#define PUBLICFUNC_H_ - -#include "stdafx.h" -#include - - -using namespace std; -//yi zhi -#ifdef WIN32 - -#else - typedef unsigned int UINT32; - typedef unsigned int UINT; - typedef unsigned char byte; - typedef int BOOL; - typedef unsigned short UINT16; - typedef int INT; - typedef unsigned long DWORD; -#endif - - -struct tagCONFIGINFO -{ - std::string Caption; - std::string SavePath; -}; - -struct SPSET -{ - unsigned int FSP; - unsigned int BSP; -}; - -typedef struct tagCONFIGINFO CONFIGINFO,*PCONFIGINFO; - - -typedef struct CorrectParam { - unsigned int Exposures[6]; - unsigned int Gain[12]; - unsigned int Offset[12]; -}; - -typedef struct CaptureParams -{ - - int correctColorExposure[6]; - int correctColorGain[12]; - int correctColorOffset[12]; - - int correctGrayExposure[6]; - int correctGrayGain[12]; - int correctGrayOffset[12]; - - int colorExposure[6]; - int colorGain[12]; - int colorOffset[12]; - - int grayExposure[6]; - int grayGain[12]; - int grayOffset[12]; - - int uvCorrectColorExposure[2]; - int uvCorrectGrayExposure[2]; - int uvColorExposure[2]; - int uvGrayExposure[2]; -} CaptureParams; - - -#endif diff --git a/qt-correction-tool/config.json b/qt-correction-tool/config.json deleted file mode 100644 index 2b4fd5f..0000000 --- a/qt-correction-tool/config.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "Config": { - "ColorExposure": [ - 259, - 259, - 259, - 259, - 259, - 259 - ], - "ColorGain": [ - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30 - ], - "ColorOffset": [ - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119 - ], - "CorrectColorExposure": [ - 238, - 238, - 238, - 238, - 238, - 238 - ], - "CorrectColorGain": [ - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30, - 30 - ], - "CorrectColorOffset": [ - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119 - ], - "CorrectGrayExposure": [ - 259, - 259, - 259, - 259, - 259, - 259 - ], - "CorrectGrayGain": [ - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47 - ], - "CorrectGrayOffset": [ - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119 - ], - "GrayExposure": [ - 238, - 238, - 238, - 238, - 238, - 238 - ], - "GrayGain": [ - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47, - 47 - ], - "GrayOffset": [ - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119, - 119 - ] - } -} diff --git a/qt-correction-tool/gscn_drv.cpp b/qt-correction-tool/gscn_drv.cpp deleted file mode 100644 index 3035905..0000000 --- a/qt-correction-tool/gscn_drv.cpp +++ /dev/null @@ -1,885 +0,0 @@ -#include "stdafx.h" -#include "gscn_drv.h" -#include "stdio.h" -#include "turbojpeg.h" -#include -#include "jpeglib.h" - -#ifdef WIN32 -#include -#include "twain.h" -#endif - -#include "filetools.h" -#include "scn_usb.h" -//#define BYTE unsigned char - -GScn_Drv::GScn_Drv() - :selectDeviceIndex(-1), m_scannerType(-1), m_isScanning(false), flatMode(-1), usbcbDate(NULL) -{ - - //run(); - - ////XdPrint("Init GScn_Drv() \n"); - - m_bRun = false; - devState = DEV_STOP; - isDuplex = true; - InitMSGMap(); - InitScannerDiviceMap(); - usbcbDate = new char ; - - -} - -GScn_Drv::~GScn_Drv() -{ - if (m_threadUsb.joinable()) - { - m_bRun = false; - devState = DEV_STOP; - m_threadUsb.join(); - //XdPrint("m_threadUsb Released True 22222222222222222222222 \n"); - } - //XdPrint("~ GScn_Drv() \n"); -} - -void GScn_Drv::InitMSGMap() -{ - if (ntcMsg.size() > 0) - ntcMsg.clear(); - ntcMsg[COUNT_MODE] = "ģʽ˳ģʽ"; - ntcMsg[NO_FEED] = "ֽֽţ"; - ntcMsg[OPEN_COVER] = "ɨǿǣ"; - ntcMsg[FEED_IN_ERROR] = "ʰֽ"; - ntcMsg[PAPER_JAM] = "ֽ"; - ntcMsg[DETECT_DOUBLE_FEED] = "˫ţ"; - ntcMsg[DETECT_STAPLE] = "룡"; - ntcMsg[PAPER_SKEW] = "ֽб"; - ntcMsg[HARDWARE_ERROR] = "Ӳ"; - ntcMsg[PC_SCAN_BUSY_or_ERROR] = "PC"; -} - - -void GScn_Drv::InitScannerDiviceMap() -{ - if (devType.size() > 0) - { - devType.clear(); - } - devType["G100"] = G100; - devType["G200"] = G200; - devType["G300"] = G300; - devType["G400"] = G400; - devType["G500"] = G500; -} - -static int iNum = 0; - -void GScn_Drv::open(int vid, int pid, int index, int scannerType) -{ - auto devs = UsbScan_List::find_vid_pid(vid, pid); - - if (devs.size() != 0) - { - m_usb = *devs.begin(); - m_usb->open();//ͬʱڶͬɨ豸ʱĬѡȡһvid pidƥ豸 - selectDeviceIndex = index; - m_scannerType = scannerType; - } -} - -static void DoEvents() -{ - MSG msg; - if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - DispatchMessage(&msg); - - TranslateMessage(&msg); - } -} - -QString GScn_Drv::popMat(int num) -{ - auto image = m_pImages.popMat(num); - return image; -} - - -int GScn_Drv::aquire_image(QString& image, int num) -{ - while (true) - { - if (Get_IsImageQueueEmpty()) - { - DoEvents(); - if (!is_scan()) - break; - } - else - { - if (m_pImages.valid()) - { - image = popMat(num); - return 0; - } - } - } - return -1; -} - -int GScn_Drv::getMatSum() -{ - int iSum = 0; - iSum = m_pImages.getMatSum(); - return iSum; -} - -void GScn_Drv::close() -{ - m_usb->close(); -} - -void GScn_Drv::GetExpose(UINT32& Aside, UINT32& Bside) -{ - USBCB asideexp = { GET_UV_EXPOSA,0,0 }; - m_usb->write_bulk(&asideexp, sizeof(asideexp)); - m_usb->read_bulk(&asideexp, sizeof(asideexp)); - Aside = asideexp.u32_Data; - USBCB bsideexp = { GET_UV_EXPOSB,0,0 }; - m_usb->write_bulk(&bsideexp, sizeof(asideexp)); - m_usb->read_bulk(&bsideexp, sizeof(asideexp)); - Bside = bsideexp.u32_Data; - -} - -void GScn_Drv::SetExpose(UINT32 aside, UINT32 bside) -{ - USBCB asideexp = { SET_UV_EXPOSA,aside,0 }; - m_usb->write_bulk(&asideexp, sizeof(asideexp)); - USBCB bsideexp = { SET_UV_EXPOSB,bside,0 }; - m_usb->write_bulk(&bsideexp, sizeof(bsideexp)); - -} - -void GScn_Drv::GetSptime(UINT32 type, UINT32& time) -{ - USBCB usb = { 0,0,0 }; - switch (type) - { - case 0: - usb.u32_CMD = 0x100;//GET_GRAY_SP - break; - case 1: - usb.u32_CMD = 0x102;//GET_COLOR_SP - break; - case 2: - usb.u32_CMD = 0x104;//GET_UV_SP - break; - default: - break; - } - m_usb->write_bulk(&usb, sizeof(usb)); - m_usb->read_bulk(&usb, sizeof(usb)); - time = usb.u32_Data; -} - -void GScn_Drv::SetSptime(UINT32 type, UINT32 time) -{ - USBCB usb = { 0,time,0 }; - switch (type) - { - case 0: - usb.u32_CMD = 0x101;//GET_GRAY_SP - break; - case 1: - usb.u32_CMD = 0x103;//GET_COLOR_SP - break; - case 2: - usb.u32_CMD = 0x105;//GET_UV_SP - break; - default: - break; - } - m_usb->write_bulk(&usb, sizeof(usb)); -} - -void GScn_Drv::GetSleepTime(UINT32& sleeptime) -{ - if (m_usb.get() && m_usb->is_connected()) - { - USBCB usb = { GET_SLEEP_TIME,0,0 }; - m_usb->write_bulk(&usb, sizeof(usb)); - m_usb->read_bulk(&usb, sizeof(usb)); - sleeptime = usb.u32_Data; - } -} - -void GScn_Drv::SetSleepTime(UINT32 sleeptime) -{ - if (m_usb.get() && m_usb->is_connected()) - { - USBCB usb = { SET_SLEEP_TIME,sleeptime,0 }; - m_usb->write_bulk(&usb, sizeof(usb)); - } -} - -void GScn_Drv::SetSpeedMode(UINT32 speedmode) -{ - if (m_usb.get() && m_usb->is_connected()) - { - USBCB usb = { SET_SPEED_MODE,speedmode,0 }; - m_usb->write_bulk(&usb, sizeof(usb)); - } -} - -void GScn_Drv::SetG100G200CorrecPara(UINT32 Para, int a) -{ - if (!m_usb.get() && !m_usb->is_connected()) - return; - - USBCB usb = { 0,Para,4 }; - switch (a) - { - case 0: - usb.u32_CMD = SEND_COMPONENTS_GR; - break; - case 1: - usb.u32_CMD = SEND_COMPONENTS_GB; - break; - case 2: - usb.u32_CMD = RGB_ADI_PARA; - break; - case 3: - usb.u32_CMD = ADI_PARA; - break; - } - m_usb->write_bulk(&usb, sizeof(usb)); - -} -void GScn_Drv::GetG100G200CorrecPara(unsigned char *parm, int a) -{ - if (!m_usb.get() && !m_usb->is_connected()) - { - qDebug("δȡ豸\r\n"); - return; - } - USBCB usb = { GET_CIS_PARA,0 ,16 }; - m_usb->write_bulk(&usb, sizeof(usb)); - m_usb->read_bulk(parm, 16); -} - -void GScn_Drv::stopTime(std::function onStop) -{ - m_onStopQtime = onStop; -} - -void GScn_Drv::retdevMessges(std::functiondevMessges) -{ - callbackDevMessge = devMessges; -} - -int GScn_Drv::ModeSelection(list& dpi300GC_dpi200GC) -{ - if (dpi300GC_dpi200GC.empty()) - { - return -1; - } - iNum = 0; - m_pImages.pixType = pixType; - m_pImages.SetDevModel(m_scannerType); - m_pImages.SetFilePath(csPath); - m_pImages.SetPicformat(qsPic_format_name); - m_pImages.run(); - m_pImages.SetScanFlag(true); - - this->dpi300GC_dpi200GC = dpi300GC_dpi200GC; - Flat(); - return 0; -} - -void GScn_Drv::Flat() -{ - if (this->dpi300GC_dpi200GC.empty()) - { - return; - } - flatMode = this->dpi300GC_dpi200GC.front(); - this->dpi300GC_dpi200GC.pop_front(); - if (!m_usb->is_connected()) - return; - - USBCB usbcb = { START_FLAT,0,0 }; - usbcb.u32_Data = flatMode; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); -} - - -void GScn_Drv::GetSpeedMode(UINT32& speedmode) -{ - if (m_usb.get() && m_usb->is_connected()) - { - USBCB usb = { GET_SPEED_MODE ,speedmode,0 }; - m_usb->write_bulk(&usb, sizeof(usb)); - m_usb->read_bulk(&usb, sizeof(usb)); - speedmode = usb.u32_Data; - } -} - -void GScn_Drv::reset() -{ - while (!m_pImages.empty()) - { - m_pImages.clear(); - } -} - - - -void GScn_Drv::pushMat(JpegBuffer& data) -{ - std::lock_guard lck(m_imgLocker); - m_pImages.pushMat(data); -} - -BOOL GScn_Drv::IsConnected() -{ - if (m_usb.get()) - return m_usb->is_connected(); - else - return false; - -} - - -cv::Mat GScn_Drv::Get_Img_Data(UINT32 bufferSize) -{ - std::lock_guard lck(m_Locker); - cv::Mat iData(1, bufferSize, CV_8UC1); - USBCB usbcb = { GET_IMAGE,0,bufferSize }; - DWORD transfer; - qDebug("Get_Img_Data write_bulk GET_IMAGE CV_8UC1 \n....................."); - - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - StopWatch sw; - sw.start(); - - qDebug("Get_Img_Data Read_Data bufferSize begin \n....................."); - m_usb->read_bulk(iData.data, bufferSize); - sw.stop(); - qDebug("GetDate Consume time %lf \n.....................................", sw.time_run()); - return iData; -} - -void GScn_Drv::run() -{ - //m_isScanning=false; - if (m_threadUsb.joinable()) - { - m_bRun = false; - devState = DEV_STOP; - m_threadUsb.join(); - } - m_bRun = true; - devState = DEV_ISRUNNING; - m_threadUsb = std::thread(&GScn_Drv::usbmain, this); -} - -INT GScn_Drv::get_decompress_pix_type() -{ - return pixType; -} - -void GScn_Drv::set_decompress_pix_type(int pixtype) -{ - if (pixtype == TWPT_RGB)//TWPT_RGB=2 - { - pixType = TJPF_BGR; - qDebug("TurboJpeg TJPF_BGR\n"); - } - else - { - pixType = TJPF_GRAY; - qDebug("TurboJpeg TJPF_GRAY\n"); - } -} - -void GScn_Drv::SetIsDuplex(BOOL value) -{ - isDuplex = value; -} - -void GScn_Drv::ActiveteUSB() -{ - if (IsConnected()) - { - DWORD transfer; - USBCB usbcb = { 1024,0 ,0 }; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - } -} - - -DWORD GScn_Drv::usbmain() -{ - //try - { - while (m_bRun) - { - if (devState == DEV_ISRUNNING) - { - if (!IsConnected()) - { - Sleep(200); - continue; - } - USBCB usbcb = Get_Scanner_Status(); - switch (usbcb.u32_Data) - { - case HAVE_IMAGE: - { - int totalNum = usbcb.u32_Count; - DWORD transferCount = 0; - iNum++; - cv::Mat imgData = Get_Img_Data(totalNum); - switch (m_scannerType) - { - case G100: - case G200: - { - cv::Mat bufferF = imgData.clone(); - cv::Mat bufferB = imgData.clone(); - int j = 0; - int k = 0; - for (int i = 0; i < totalNum / 1024; i++) - { - if (imgData.data[1023 + i * 1024] == 0) - { - j++; - memcpy(&(bufferB.data[(j - 1) * 1023]), &(imgData.data[(j + k - 1) * 1024]), 1023); - } - else if (imgData.data[1023 + i * 1024] == 255) - { - k++; - memcpy(&(bufferF.data[(k - 1) * 1023]), &(imgData.data[(j + k - 1) * 1024]), 1023); - } - } - - auto bufB = JpegBuffer(bufferB, pixType, 0, 0); - auto bufF = JpegBuffer(bufferF, pixType, 1, 0); - pushMat(bufB); - pushMat(bufF); - //У һ̣ɼΣ棨 - static int flatindex = 0; - - if (flatMode != -1) - { - flatindex++; - if (flatindex == 2) - { - - StopFlat(); - if ((flatMode == 0x02) | (flatMode == 0x00))//ﲻ˯߻е - { - this_thread::sleep_for(std::chrono::milliseconds(2000)); - } - else - { - this_thread::sleep_for(std::chrono::milliseconds(3000)); - } - - if (!dpi300GC_dpi200GC.empty()) - { - flatindex = 0; - Flat(); - } - else - { - devState = DEV_STOP; - flatMode = -1; - m_pImages.SetScanFlag(false); - } - flatindex = 0; - } - } - - break; - } - case G300: - case G400: - case G500: - { - auto buf = JpegBuffer(imgData, pixType, 0, 0); - pushMat(buf); - break; - } - - default: - break; - } - Pop_Image(); - break; - } - case STOP_SCAN: - { - m_onStopQtime(); - m_isScanning = false; - devState = DEV_STOP; - m_pImages.SetScanFlag(false); - ntcMsg[usbcb.u32_Data] = "ɨ"; - callbackDevMessge(ntcMsg[usbcb.u32_Data].c_str()); - - - break; - } - case AUTO_FLAT_FINISHED: - { - m_isScanning = false; - devState = DEV_STOP; - callbackDevMessge(ntcMsg[usbcb.u32_Data].c_str()); - } - break; - case COUNT_MODE: - case NO_FEED: - case OPEN_COVER: - case FEED_IN_ERROR: - case DETECT_DOUBLE_FEED: - case DETECT_STAPLE: - case PAPER_SKEW: - case HARDWARE_ERROR: - case PC_SCAN_BUSY_or_ERROR: - m_onStopQtime(); - callbackDevMessge(ntcMsg[usbcb.u32_Data].c_str()); - devState = DEV_WRONG; - m_pImages.SetScanFlag(false); - break; - case NORMAL: - break; - default: - break; - } - this_thread::sleep_for(std::chrono::milliseconds(20)); - } - } - return 0; - } - - // catch (CMemoryException* e) - // { - // //XdPrint("CMemoryException"); - // } - // catch (CFileException* e) - // { - // //XdPrint("CFileException"); - // } - // catch (CException* e) - // { - // //XdPrint("CException"); - // } - -} - -/////////////////////////////////////////////////////////////////////////// -void GScn_Drv::Config_Scanner(PUSBCB pUSBCB) -{ - if (m_usb->is_connected()) - { - std::lock_guard lck(m_imgLocker); - DWORD transfer; - m_usb->write_bulk(pUSBCB, sizeof(USBCB)); - } -} - -/////////////////////////////////////////////////////////////////////////// -void GScn_Drv::Scanner_StartScan(UINT16 count) -{ - //count = 0; - qDebug("Scanner_StartScan.............\n"); - if (m_usb->is_connected()) - { - qDebug("Scanner Isconnected.............\n"); - std::lock_guard lck(m_imgLocker); - DWORD transfer; - USBCB usbcb = { START_COMMAND,count ,0 }; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - iNum = 0; - m_pImages.pixType = pixType; - m_pImages.SetDevModel(m_scannerType); - m_pImages.SetFilePath(csPath); - m_pImages.SetPicformat(qsPic_format_name); - m_pImages.run(); - m_pImages.SetScanFlag(true); - run(); - } -} - -/////////////////////////////////////////////////////////////////////////// -std::string GScn_Drv::GetFWVersion() -{ - if (m_usb->is_connected()) - { - std::lock_guard lck(m_imgLocker); - std::string pFWVersion = " "; - USBCB usbcb = { GET_FW_VERSION,0,0 }; - qDebug("Get GetFWVersion"); - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - - QString cslog; - cslog.sprintf("GetFWVersion Read_Data %d", usbcb.u32_Data); - - m_usb->read_bulk(&pFWVersion[0], 10); - return pFWVersion; - } - return ""; -} - -void GScn_Drv::SetFWVersion() -{ - if (m_usb->is_connected()) - { - std::lock_guard lck(m_imgLocker); - - } -} - -void GScn_Drv::SetSerialNum(std::string pvalue) -{ - if (m_usb->is_connected()) - { - std::lock_guard lck(m_imgLocker); - USBCB sercmd = { SEND_SERIAL ,0,14 }; - m_usb->write_bulk(&sercmd, sizeof(sercmd)); - m_usb->write_bulk(&pvalue, pvalue.length()); - } - return; -} - -int GScn_Drv::GetScanNum() -{ - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { GET_SCANN_NUM,0,4 }; - DWORD transfer; - qDebug("Get GetScanNum"); - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - - QString cslog; - //cslog.Format("GetScanNum Read_Data %d",usbcb.u32_Data); - //WriteLog(//cslog); - - m_usb->read_bulk(&usbcb, sizeof(usbcb)); - return usbcb.u32_Data; -} - -void GScn_Drv::ClrRollerNum() -{ - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { CLR_ROLLER_NUM,0,4 }; - DWORD transfer; - qDebug("Get ClrRollerNum"); - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - return; -} - -void GScn_Drv::ClrScanNum() -{ - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { CLR_SCAN_NUM,0,4 }; - DWORD transfer; - qDebug("Get ClrScanNum"); - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - return; -} - -void GScn_Drv::SendFlatData(CorrectParam param, int index) -{ - UsbKeyWords keyword; - switch (index) - { - case 0: - keyword = SEND_COLORCORRECT_FLAT; - break; - case 1: - keyword = SEND_COLOR_FLAT; - break; - case 2: - keyword = SEND_GRAYCORRECT_FLAT; - break; - case 3: - keyword = SEND_GRAY_FLAT; - break; - default: - break; - } - USBCB cmd = { keyword ,0,0 }; - m_usb->write_bulk(&cmd, sizeof(cmd)); - m_usb->write_bulk(¶m, sizeof(param)); -} - -CaptureParams GScn_Drv::GetFlatData() -{ - CaptureParams param = { 0 }; - USBCB usbcb = { GET_FLAT_DATA,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - m_usb->read_bulk(¶m, sizeof(param)); - return param; -} - -void GScn_Drv::StartFlat() -{ - if (!m_usb->is_connected()) - return; - - USBCB usbcb = { START_FLAT,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - if (m_threadUsb.joinable()) { - m_bRun = false; - devState = DEV_STOP; - m_threadUsb.join(); - } - m_bRun = true; - devState = DEV_ISRUNNING; - m_threadUsb = std::thread(&GScn_Drv::usbmain, this); -} - -void GScn_Drv::StopFlat() -{ - if (!m_usb->is_connected()) - return; - USBCB usbcb = { STOP_FLAT,0,0 }; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); -} - -void GScn_Drv::DevStateChange() { - devState = DEV_STOP; -} - -/////////////////////////////////////////////////////////////////////////// -std::string GScn_Drv::GetSerialNum() -{ - if (!m_usb.get() && !m_usb->is_connected()) - { - return ""; - } - - std::lock_guard lck(m_imgLocker); - std::string str; - str.resize(14); - USBCB usbcb = { GET_SERIAL,0,14 }; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - /// - m_usb->read_bulk(&str[0], 14); - return str; -} - -void GScn_Drv::SetRatio(UINT32 tyepe, UINT32 ration) -{ - UsbKeyWords keyword = tyepe == 0 ? SET_JUST_COF_H : SET_JUST_COF_V; - USBCB cmd = { keyword ,ration,0 }; - m_usb->write_bulk(&cmd, sizeof(cmd)); -} - -void GScn_Drv::GetRatio(UINT32 type, UINT32& ratio) -{ - UsbKeyWords keyword = type == 0 ? GET_JUST_COF_H : GET_JUST_COF_V; - USBCB cmd = { keyword ,0,0 }; - m_usb->write_bulk(&cmd, sizeof(cmd)); - m_usb->read_bulk(&cmd, sizeof(cmd)); - ratio = cmd.u32_Data; -} - -void GScn_Drv::Reboot() -{ - USBCB cmd = { REBOOT,0,0 }; - m_usb->write_bulk(&cmd, sizeof(cmd)); -} - -/////////////////////////////////////////////////////////////////////////// -USBCB GScn_Drv::Get_Scanner_Status() -{ - std::lock_guard lck(m_imgLocker); - if (!m_usb->is_connected()) - { - qDebug("Get_Scanner_Status Error\n"); - USBCB errorType = { NO_COMMAND ,PC_SCAN_BUSY_or_ERROR ,0 }; - return errorType; - } - - ////XdPrint("Get_Scanner_Status GET_DSP_STATUS write_bulk\n"); - USBCB usbcb = { GET_DSP_STATUS ,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - - qDebug("Get_Scanner_Status Read_Data %d \n", usbcb.u32_Data); - - m_usb->read_bulk(&usbcb, sizeof(usbcb)); - - qDebug("Get_Scanner_Status return usbcb \n", usbcb.u32_Data); - return usbcb; -} - -/////////////////////////////////////////////////////////////////////////// -bool GScn_Drv::is_scan() -{ - return devState == DEV_ISRUNNING; -} - -/////////////////////////////////////////////////////////////////////////// -BOOL GScn_Drv::Get_Scanner_PaperOn() -{ - if (!m_usb->is_connected()) - { - return FALSE; - } - USBCB usbcb = { GET_PAPERFEEDER_STATUS ,0,0 }; - DWORD transfer; - std::lock_guard lck(m_imgLocker); - m_usb->write_bulk(&usbcb, sizeof(usbcb)); - m_usb->read_bulk(&usbcb, sizeof(usbcb)); - return usbcb.u32_Data != 0; -} - -/////////////////////////////////////////////////////////////////////////// -void GScn_Drv::Pop_Image() -{ - if (!m_usb->is_connected()) - { - return; - } - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { POP_IMAGE ,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); -} - -/////////////////////////////////////////////////////////////////////////// -void GScn_Drv::Stop_scan() -{ - if (!m_usb->is_connected()) - { - return; - } - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { STOP ,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); -} - -void GScn_Drv::ResetScanner() -{ - if (!m_usb->is_connected()) - return; - - std::lock_guard lck(m_imgLocker); - USBCB usbcb = { INIT_HARDWARE_SYS ,0,0 }; - DWORD transfer; - m_usb->write_bulk(&usbcb, sizeof(usbcb)); -} - -/////////////////////////////////////////////////////////////////////////// -bool GScn_Drv::Get_IsImageQueueEmpty() -{ - return m_pImages.empty(); -} diff --git a/qt-correction-tool/gscn_drv.h b/qt-correction-tool/gscn_drv.h deleted file mode 100644 index a494ed2..0000000 --- a/qt-correction-tool/gscn_drv.h +++ /dev/null @@ -1,409 +0,0 @@ -#pragma once -#include "IUsb.h" -#include -#include -#include -#include -#ifdef WIN32 -#include -#endif -#include - -//#include "MutexEx.h" -#include "opencv2/core/core.hpp" - -#include "jpeglib.h" -#include -#include -#include -#include "ImageMatQueue.h" -#include -#include "PublicFunc.h" -#include - - -using namespace cv; - -typedef struct tag_USBCB { - UINT32 u32_CMD; - UINT32 u32_Data; - UINT32 u32_Count; -}USBCB, * PUSBCB; - - -typedef struct tag_USBCBA4 -{ - UINT u32_Command; /* command to execute */ - UINT u32_Data; /* generic data field */ - UINT u32_Count; /* number of bytes to transfer */ - byte buffer[512]; //=new byte[1024]; -}USBCBA4, * PUSBCBA4; - -//u32_CMD -enum tagUsbKeyWords :UINT32 -{ - NO_COMMAND = 0, - //ȡdsp ״̬ - GET_DSP_STATUS = 1, - //ȡͼ - GET_IMAGE = 2, - //DSPפͼ - POP_IMAGE = 3, - //ʼɨ - START_COMMAND = 4, - //ֹͣɨ - STOP = 5, - //ȡɨɨģʽ - GET_SCAN_MODE = 6, - //ȡ̼汾 - GET_FW_VERSION = 7, - //PC˵״̬ - SEND_STATUS_PC = 8, - //·ɨò - CONFIGURED_DATA = 9, - //·̼Ϣ - SEND_FW = 10, - //ȡɨ - GET_CONFIG_DATA = 11, - //ȡɨ - GET_SCANN_NUM = 12, - //ȡֽ״̬ - GET_PAPERFEEDER_STATUS = 13, - //DSPʼ - INIT_HARDWARE_SYS = 14, - //·ԪòҶȣLED Rعʱ䣩 - SEND_COMPONENTS_GR = 15, - //·ԪòLED G/Bعʱ䣩 - SEND_COMPONENTS_GB = 16, - //·ɨģʽ - SEND_SCAN_MODE = 17, - //ʼƽ - START_FLAT = 18, - //ֹͣƽ - STOP_FLAT = 19, - //·200dpiɫƽ - SEND_200_COLOR_FLAT_DATA = 20, - //·300dpiɫƽ - SEND_300_COLOR_FLAT_DATA = 21, - //ȡ200dpiɫƽ - GET_200_COLOR_FLAT_DATA = 22, - //ȡ300dpiɫƽ - GET_300_COLOR_FLAT_DATA = 23, - //·200dpiҶƽУ - SEND_200_GRAY_FLAT_DATA = 24, - //·300dpiҶƽУ - SEND_300_GRAY_FLAT_DATA = 25, - //ȡ200DPIҶƽУ - GET_200_GRAY_FLAT_DATA = 26, - //ȡ300DPIҶƽУ - GET_300_GRAY_FLAT_DATA = 27, - //·к - SEND_SERIAL = 28, - //ȡк - GET_SERIAL = 29, - //ȡ - GET_ROLLER_NUM = 0x1e, - // - CLR_ROLLER_NUM = 0x1f, - //ɨ - CLR_SCAN_NUM = 0x20, - //׼¹̼ - PRE_UPGRADE = 0X21, - //ʼ¹̼ - START_UPGRADE = 0x22, - //ɫAD - RGB_ADI_PARA = 0x23, - //ҶȵAD - ADI_PARA = 0x24, - //ȡCISعʱ䣬ad) - GET_CIS_PARA = 0x25, - //ɨ - START_COMMAND_COUNT = 0x26, - //·ʱ - SET_SLEEP_TIME = 0x27, - //ȡʱ - GET_SLEEP_TIME = 0x28, - // - CLR_CACHE = 0x29, - //·ٶģʽ - SET_SPEED_MODE = 0x2a, - //ȡɨٶģʽ - GET_SPEED_MODE = 0X2b, - //ù̼汾һ8ֽ - SET_FW_VERSION = 0X2c, - //ȡDSP汾 - GET_DSP_VERSION = 0X2d, - //ɼFPGA̼汾 - GET_SCANFPGA_VERSION = 0x2e, - //FPGA̼汾 - GET_MOTORFPGA_VERSION = 0X2f, - //Ϣ - SET_USB_INFOR_MANUFACTURE = 0X30, - //ȡϢ - GET_USB_INFOR_MANUFACTURE = 0X31, - //òƷͺϢ - SET_USB_INFOR_MODEL_NAME = 0X32, - //ȡƷͺϢ - GET_USB_INFOR_MODEL_NAME = 0X33, - //USB PID / VIDϢ - SET_USB_INFOR_VIDPID = 0X34, - GET_USB_INFOR_VIDPID = 0X35, - //ÿֽͣ - SET_JAM_DETECT_SENSITIVE = 0X36, - //ȡֽͣ - GET_JAM_DETECT_SENSITIVE = 0X37, - //úϵ - SET_JUST_COF_H = 0x38, - //ȡϵ - GET_JUST_COF_H = 0x39, - //G400 Ӳ쳣 - CLEAR_HWERROR = 0x40, - //ϵ - SET_JUST_COF_V = 0x41, - //ȡϵ - GET_JUST_COF_V = 0x42, - //òɫУ - SEND_COLOR_FLAT = 0x43, - //òɫƽУ - SEND_COLORCORRECT_FLAT = 0x44, - //ûҶУ - SEND_GRAY_FLAT = 0x45, - //ûҶƽУ - SEND_GRAYCORRECT_FLAT = 0x46, - //ƽУ - GET_FLAT_DATA = 0x47, - // - UPDATE_FINISHED = 0x48, - // - REBOOT = 0x49, - GET_LOG_FILES_INFO = 0x50, - //logļ - GET_UPDATE_RESULT = 0x51, - //־ - CLEAR_LOG_FILES = 0x52, - //ȡֽʧ - GET_CUO_ERROR, - //ȡ˫ʧܴ - GET_DOU_ERROR, - //ȡֽ - GET_JAM_ERROR, - GET_UV_EXPOSA = 0x100, - GET_UV_EXPOSB = 0x101, - SET_UV_EXPOSA = 0x102, - SET_UV_EXPOSB = 0x103 -}; - -typedef enum tagUsbKeyWords UsbKeyWords, * PUsbKeyWords; -//u32_Data -enum tagUsbSupported -{ - //ֹͣɨ - SCAN_STOP = -2, - //쳣 - HAVE_ERROR = -1, - //״̬ - NORMAL = 0, - // - OPEN_COVER = 1, - // ֽ - NO_FEED = 2, - // ֽʧ - FEED_IN_ERROR = 4, - // ֽ - PAPER_JAM = 8, - // ⵽˫ - DETECT_DOUBLE_FEED = 16, - // ⵽鶤 - DETECT_STAPLE = 32, - // ֽб - PAPER_SKEW = 64, - // Զģʽ - AUTO_SCAN_MODE = 65, - // ֶģʽ - MANAUL_SCAN_MODE = 66, - // ģʽ - COUNT_MODE = 67, - // Ӳ - HARDWARE_ERROR = 68, - // FPGA - FPGA_ERROR = 68, - // ʼ - START_SCAN = 69, - //ֹͣ - STOP_SCAN = 70, - //ͼ - HAVE_IMAGE = 71, - // ɨ - UPDATE_SCAN_PARAMETER = 72, - // PCæ - PC_SCAN_BUSY_or_ERROR = 73, - // - STS_UPDATE_FINISHED = 74, - //USB δ - USB_DISCONNECTED = 200, - //ûֹͣ - USER_STOP = 201, - //ԶƽУ - AUTO_FLAT_FINISHED = 202 -}; - -typedef enum tagUsbSupported UsbSupported, * PUsbSupported; - -enum tagDevState -{ - DEV_STOP = -1, - DEV_ISRUNNING, - DEV_WRONG -}; - -typedef enum tagDevState DevState, PDevState; - -enum tagEventIndex -{ - EVENT_IMAGE, - EVENT_NUM -}; - -enum tagDEVMODEL -{ - G100 = 0, - G200, - G300, - G400, - G500 -}; - -class GScn_Drv -{ -public: - GScn_Drv(); - - ~GScn_Drv(); - - void open(int vid, int pid, int index, int scannerType); - int aquire_image(QString& image, int num); - BOOL IsConnected(); - std::string GetFWVersion(); - void SetFWVersion(); - std::string GetSerialNum(); - void SetRatio(UINT32 tyepe, UINT32 ration); - void GetRatio(UINT32 type, UINT32& ratio); - void Reboot(); - bool is_scan(); - USBCB Get_Scanner_Status(); - BOOL Get_Scanner_PaperOn(); - void Config_Scanner(PUSBCB pUSBCB); - void Scanner_StartScan(UINT16 count); - void Stop_scan(); - void ResetScanner(); - bool Get_IsImageQueueEmpty(); - void reset(); - void run(); - INT get_decompress_pix_type(); - void set_decompress_pix_type(int pixtype); - - void SetIsDuplex(BOOL value); - - void ActiveteUSB(); - - void SetSerialNum(std::string pvalue); - - int GetScanNum(); - - void ClrRollerNum(); - - void ClrScanNum(); - - - void SendFlatData(CorrectParam param, int index); - - CaptureParams GetFlatData(); - - void StartFlat(); - - void StopFlat(); - - void DevStateChange(); - - int getMatSum(); - - void close(); - - void GetExpose(UINT32& Aside, UINT32& Bside); - void SetExpose(UINT32 aside, UINT32 bside); - - void GetSptime(UINT32 type, UINT32& time); - void SetSptime(UINT32 type, UINT32 time); - - void GetSleepTime(UINT32& sleeptime); - void SetSleepTime(UINT32 sleeptime); - - void GetSpeedMode(UINT32& speedmode); - - void SetSpeedMode(UINT32 speedmode); - - void SetG100G200CorrecPara(UINT32 Para,int); - - void GetG100G200CorrecPara(unsigned char* parm, int a); - - void SetPath(QString csFilePath) - { - csPath = csFilePath; - } - - void Setformat(QString formatName) - { - qsPic_format_name = formatName; - } - - QString GetPath() - { - return csPath; - } - - ImageMatQueue m_pImages; - std::shared_ptr m_usb; - void stopTime(std::function onStop); - - void retdevMessges(std::function devMessges); - - //ѡУģʽ dpi 200or300 Gray OR Color - int ModeSelection(list& dpi300GC_dpi200GC); - void Flat(); - std::list dpi300GC_dpi200GC; - - - string str1; -private: - volatile int devState; - volatile bool m_bRun; - volatile BOOL isDuplex; - - std::mutex m_Locker; - std::mutex m_imgLocker; - int pixType; - int flatMode; //Уѡ - std::thread m_threadUsb; - std::map ntcMsg; - std::map devType; - std::vector vcSerials; - int selectDeviceIndex; - int m_scannerType; - bool m_isScanning; - QString csPath; - QString qsPic_format_name; - std::function m_onStopQtime; - std::function callbackDevMessge; - char *usbcbDate; - - - -private: - QString popMat(int num); - void pushMat(JpegBuffer& data); - void InitMSGMap(); - void InitScannerDiviceMap(); - cv::Mat Get_Img_Data(UINT32 buffersize); - DWORD usbmain(); - void Pop_Image(); -}; diff --git a/qt-correction-tool/imageprocess.cpp b/qt-correction-tool/imageprocess.cpp deleted file mode 100644 index 37864df..0000000 --- a/qt-correction-tool/imageprocess.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "stdafx.h" -#include "imageprocess.h" - -vector histogram_bit8(uchar* data, int rows, int cols) -{ - vector hist_sum(static_cast(cols)); - vector hist(static_cast(cols)); - for (int x = 0; x < cols; ++x) - { - for (int y = 0; y < rows; ++y) - { - hist_sum[static_cast(x)] += data[static_cast(y * cols + x)]; - } - hist[static_cast(x)] = static_cast(hist_sum[static_cast(x)] / rows); - } - - return hist; -} - -void histogram_bit32(uchar* data, int rows, int cols, vector& r, vector& g, vector& b) -{ - uint total = static_cast(rows * cols); - uchar* buffer_r = new uchar[total]; - uchar* buffer_g = new uchar[total]; - uchar* buffer_b = new uchar[total]; - - for (uint i = 0; i < total; ++i) - { - buffer_r[i] = data[i * 3 + 0]; - buffer_g[i] = data[i * 3 + 1]; - buffer_b[i] = data[i * 3 + 2]; - } - - r = histogram_bit8(buffer_r, rows, cols); - g = histogram_bit8(buffer_g, rows, cols); - b = histogram_bit8(buffer_b, rows, cols); - - delete[] buffer_r; - delete[] buffer_g; - delete[] buffer_b; -} diff --git a/qt-correction-tool/imageprocess.h b/qt-correction-tool/imageprocess.h deleted file mode 100644 index e6f35d0..0000000 --- a/qt-correction-tool/imageprocess.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef IMAGEPROCESS_H -#define IMAGEPROCESS_H - -#include - -using namespace std; - -typedef unsigned char uchar; -typedef unsigned int uint; - -vector histogram_bit8(uchar* data, int rows, int cols = 3456); - -void histogram_bit32(uchar* data, int rows, int cols, vector& r, vector& g, vector& b); - -#endif // IMAGEPROCESS_H diff --git a/qt-correction-tool/jpeglib.cpp b/qt-correction-tool/jpeglib.cpp deleted file mode 100644 index 707a356..0000000 --- a/qt-correction-tool/jpeglib.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "stdafx.h" -#include "jpeglib.h" - -JpegLib::JpegLib() - :img_buffer(NULL), sizeBuffer(0) -{ - handle = std::shared_ptr (tjInitDecompress(),tjDestroy); -} - -JpegLib::~JpegLib() -{ - clear(); -} - -void JpegLib::clear() -{ - img_buffer.reset(); - sizeBuffer = 0; -} - -cv::Mat JpegLib::decode(cv::Mat& buf, int pixelFormat) -{ - if(buf.rows != 1) - return cv::Mat(); - - //XdPrint("==============decode cols is :%d ============\n",buf.cols); - decode(buf.data, buf.cols, pixelFormat); - - return cv::Mat(getHeight(), getWidth() , pixelFormat == TJPF_BGR ? CV_8UC3 : CV_8UC1, getData()); -} - -void JpegLib::decode(unsigned char* buff, unsigned long buff_size, int pixelFormat) -{ - tjDecompressHeader(handle.get(), buff, buff_size, &width, &height); - //XdPrint("==============tjDecompressHeader width is :%d height is : %d ============\n",width , height); - int size = width * height *tjPixelSize[pixelFormat]; - - if (sizeBuffer != size) - { - clear(); - img_buffer = std::shared_ptr(tjAlloc(size), tjFree); - sizeBuffer = size; - } - - if (img_buffer) - { - //XdPrint("==============img_buffer buff_size is :%d ============\n",buff_size); - tjDecompress2(handle.get(), buff, buff_size, img_buffer.get(), width, 0, height, pixelFormat, 0); - //XdPrint("============== tjDecompress2 finish ============\n",buff_size); - } -} - -int JpegLib::getWidth() -{ - return width; -} - -int JpegLib::getHeight() -{ - return height; -} - -int JpegLib::getBufferSize() -{ - return sizeBuffer; -} - -unsigned char* JpegLib::getData() -{ - return img_buffer.get(); -} diff --git a/qt-correction-tool/jpeglib.h b/qt-correction-tool/jpeglib.h deleted file mode 100644 index f01e998..0000000 --- a/qt-correction-tool/jpeglib.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include "turbojpeg.h" -#include -#include - -class JpegLib -{ -public: - JpegLib(); - ~JpegLib(); - - void clear(); - cv::Mat decode(cv::Mat& buf, int pixelFormat); - void decode(unsigned char* buff, unsigned long buff_size, int pixelFormat); - int getWidth(); - int getHeight(); - int getBufferSize(); - unsigned char* getData(); - -private: - std::shared_ptr handle; - std::shared_ptr img_buffer; - int sizeBuffer; - int width; - int height; -}; diff --git a/qt-correction-tool/main.cpp b/qt-correction-tool/main.cpp deleted file mode 100644 index d57774a..0000000 --- a/qt-correction-tool/main.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "widget.h" - -#include - -int main(int argc, char *argv[]) -{ - QApplication a(argc, argv); - Widget w; - w.show(); - return a.exec(); -} diff --git a/qt-correction-tool/msvc_make.bat b/qt-correction-tool/msvc_make.bat deleted file mode 100644 index de74e7a..0000000 --- a/qt-correction-tool/msvc_make.bat +++ /dev/null @@ -1,2 +0,0 @@ -chcp 65001 -"E:\Qt\Qt5.14.0\Tools\QtCreator\bin\jom.exe" %* \ No newline at end of file diff --git a/qt-correction-tool/pub/bin/TWAIN_logo.png b/qt-correction-tool/pub/bin/TWAIN_logo.png deleted file mode 100644 index bf2acd5..0000000 Binary files a/qt-correction-tool/pub/bin/TWAIN_logo.png and /dev/null differ diff --git a/qt-correction-tool/pub/ddk/1394.h b/qt-correction-tool/pub/ddk/1394.h deleted file mode 100644 index 4dce7ee..0000000 --- a/qt-correction-tool/pub/ddk/1394.h +++ /dev/null @@ -1,2229 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - 1394.h - -Abstract: - - Definitions for 1394 drivers. - -Environment: - - Kernel mode only - ---*/ - -#ifndef _1394_H_ -#define _1394_H_ - -#if (_MSC_VER >= 1020) -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if(NTDDI_VERSION >= NTDDI_WINXP) - -#define BUS1394_DDI_MAJOR_VERSION 3 -#define BUS1394_DDI_MINOR_VERSION 0 - -#define BUS1394_CURRENT_DDI_VERSION BUS1394_DDI_MAJOR_VERSION - -#endif - -// -// 1394 Additional NT DDK definitions. -// - -#define RCODE ULONG - -#define BASE_DEVICE_NAME L"\\Device\\1394BUS" -#define BASE_SYMBOLIC_LINK_NAME L"\\DosDevices\\1394BUS" - -// -// 1394 Node Address format. -// - -typedef struct _NODE_ADDRESS { - USHORT NA_Node_Number:6; // Bits 10-15 - USHORT NA_Bus_Number:10; // Bits 0-9 -} NODE_ADDRESS, *PNODE_ADDRESS; - -// -// 1394 Address Offset format (48 bit addressing). -// - -typedef struct _ADDRESS_OFFSET { - USHORT Off_High; - ULONG Off_Low; -} ADDRESS_OFFSET, *PADDRESS_OFFSET; - -// -// 1394 I/O Address format. -// - -typedef struct _IO_ADDRESS { - NODE_ADDRESS IA_Destination_ID; - ADDRESS_OFFSET IA_Destination_Offset; -} IO_ADDRESS, *PIO_ADDRESS; - -// -// 1394 Allocated Address Range format. -// - -typedef struct _ADDRESS_RANGE { - USHORT AR_Off_High; - USHORT AR_Length; - ULONG AR_Off_Low; -} ADDRESS_RANGE, *PADDRESS_RANGE; - -// -// 1394 Self ID packet format. -// - -typedef struct _SELF_ID { - ULONG SID_Phys_ID:6; // Byte 0 - Bits 0-5 - ULONG SID_Packet_ID:2; // Byte 0 - Bits 6-7 - ULONG SID_Gap_Count:6; // Byte 1 - Bits 0-5 - ULONG SID_Link_Active:1; // Byte 1 - Bit 6 - ULONG SID_Zero:1; // Byte 1 - Bit 7 - ULONG SID_Power_Class:3; // Byte 2 - Bits 0-2 - ULONG SID_Contender:1; // Byte 2 - Bit 3 - ULONG SID_Delay:2; // Byte 2 - Bits 4-5 - ULONG SID_Speed:2; // Byte 2 - Bits 6-7 - ULONG SID_More_Packets:1; // Byte 3 - Bit 0 - ULONG SID_Initiated_Rst:1; // Byte 3 - Bit 1 - ULONG SID_Port3:2; // Byte 3 - Bits 2-3 - ULONG SID_Port2:2; // Byte 3 - Bits 4-5 - ULONG SID_Port1:2; // Byte 3 - Bits 6-7 -} SELF_ID, *PSELF_ID; - -// -// Additional 1394 Self ID packet format (only used when More bit is on). -// - -typedef struct _SELF_ID_MORE { - ULONG SID_Phys_ID:6; // Byte 0 - Bits 0-5 - ULONG SID_Packet_ID:2; // Byte 0 - Bits 6-7 - ULONG SID_PortA:2; // Byte 1 - Bits 0-1 - ULONG SID_Reserved2:2; // Byte 1 - Bits 2-3 - ULONG SID_Sequence:3; // Byte 1 - Bits 4-6 - ULONG SID_One:1; // Byte 1 - Bit 7 - ULONG SID_PortE:2; // Byte 2 - Bits 0-1 - ULONG SID_PortD:2; // Byte 2 - Bits 2-3 - ULONG SID_PortC:2; // Byte 2 - Bits 4-5 - ULONG SID_PortB:2; // Byte 2 - Bits 6-7 - ULONG SID_More_Packets:1; // Byte 3 - Bit 0 - ULONG SID_Reserved3:1; // Byte 3 - Bit 1 - ULONG SID_PortH:2; // Byte 3 - Bits 2-3 - ULONG SID_PortG:2; // Byte 3 - Bits 4-5 - ULONG SID_PortF:2; // Byte 3 - Bits 6-7 -} SELF_ID_MORE, *PSELF_ID_MORE; - -// -// 1394 Phy Configuration packet format. -// - -typedef struct _PHY_CONFIGURATION_PACKET { - ULONG PCP_Phys_ID:6; // Byte 0 - Bits 0-5 - ULONG PCP_Packet_ID:2; // Byte 0 - Bits 6-7 - ULONG PCP_Gap_Count:6; // Byte 1 - Bits 0-5 - ULONG PCP_Set_Gap_Count:1; // Byte 1 - Bit 6 - ULONG PCP_Force_Root:1; // Byte 1 - Bit 7 - ULONG PCP_Reserved1:8; // Byte 2 - Bits 0-7 - ULONG PCP_Reserved2:8; // Byte 3 - Bits 0-7 - ULONG PCP_Inverse; // Inverse quadlet -} PHY_CONFIGURATION_PACKET, *PPHY_CONFIGURATION_PACKET; - -// -// 1394 Asynchronous packet format. -// - -typedef struct _ASYNC_PACKET { - USHORT AP_Priority:4; // Bits 0-3 1st quadlet - USHORT AP_tCode:4; // Bits 4-7 - USHORT AP_rt:2; // Bits 8-9 - USHORT AP_tLabel:6; // Bits 10-15 - NODE_ADDRESS AP_Destination_ID; // Bits 16-31 - union { // 2nd quadlet - struct { - USHORT AP_Reserved:12; // Bits 0-11 - USHORT AP_Rcode:4; // Bits 12-15 - } Response; - USHORT AP_Offset_High; // Bits 0-15 - } u; - NODE_ADDRESS AP_Source_ID; // Bits 16-31 - ULONG AP_Offset_Low; // Bits 0-31 3rd quadlet - union { // 4th quadlet - struct { - USHORT AP_Extended_tCode; // Bits 0-15 - USHORT AP_Data_Length; // Bits 16-31 - } Block; - ULONG AP_Quadlet_Data; // Bits 0-31 - } u1; - -} ASYNC_PACKET, *PASYNC_PACKET; - -// -// 1394 Isochronous packet header. -// - -typedef struct _ISOCH_HEADER { - ULONG IH_Sy:4; // Bits 0-3 - ULONG IH_tCode:4; // Bits 4-7 - ULONG IH_Channel:6; // Bits 8-13 - ULONG IH_Tag:2; // Bits 14-15 - ULONG IH_Data_Length:16; // Bits 16-31 -} ISOCH_HEADER, *PISOCH_HEADER; - -// -// 1394 Speed Map format. -// - -typedef struct _SPEED_MAP { - USHORT SPD_Length; // number of quadlets in map - USHORT SPD_CRC; // 16 bit CRC defined by 1212 - ULONG SPD_Generation; // Generation number - UCHAR SPD_Speed_Code[4032]; -} SPEED_MAP, *PSPEED_MAP; - -// -// 1394 Topology Map format. -// - -typedef struct _TOPOLOGY_MAP { - USHORT TOP_Length; // number of quadlets in map - USHORT TOP_CRC; // 16 bit CRC defined by 1212 - ULONG TOP_Generation; // Generation number - USHORT TOP_Node_Count; // Node count - USHORT TOP_Self_ID_Count; // Number of Self IDs - SELF_ID TOP_Self_ID_Array[1]; // Array of Self IDs -} TOPOLOGY_MAP, *PTOPOLOGY_MAP; - -// -// 1394 Config Rom Definitions. -// - -typedef struct _CONFIG_ROM { - - ULONG CR_Info; // 0x0 - ULONG CR_Signiture; // 0x4 // bus info block - ULONG CR_BusInfoBlockCaps; // 0x8 // " - ULONG CR_Node_UniqueID[2]; // 0xC // " - ULONG CR_Root_Info; // 0x14 - - // - // The rest is the root directory which has variable definition and length. - // - -} CONFIG_ROM, *PCONFIG_ROM; - -// -// 1394 Textual Leaf format. -// - -typedef struct _TEXTUAL_LEAF { - USHORT TL_CRC; // using 1994 CRC algorithm - USHORT TL_Length; // length of leaf in quads - ULONG TL_Spec_Id; // vendor defined - ULONG TL_Language_Id; // language Id - UCHAR TL_Data; // variable length data -} TEXTUAL_LEAF, *PTEXTUAL_LEAF; - -// -// 1394 Cycle Time format. -// - -typedef struct _CYCLE_TIME { - ULONG CL_CycleOffset:12; // Bits 0-11 - ULONG CL_CycleCount:13; // Bits 12-24 - ULONG CL_SecondCount:7; // Bits 25-31 -} CYCLE_TIME, *PCYCLE_TIME; - -// -// Definition of an Address Mapping FIFO element. -// - -typedef struct _ADDRESS_FIFO { - SLIST_ENTRY FifoList; // Singly linked list - PMDL FifoMdl; // Mdl for this FIFO element -} ADDRESS_FIFO, *PADDRESS_FIFO; - -// -// Information block the bus driver passes to the higher device drivers -// when the notification handler is called. -// - -typedef struct _NOTIFICATION_INFO_W2K { - PMDL Mdl; // Supplied by device driver - ULONG ulOffset; // Where in buffer - ULONG nLength; // How big is the operation - ULONG fulNotificationOptions; // Which option occurred - PVOID Context; // Device driver supplied - PADDRESS_FIFO Fifo; // FIFO that completed - PVOID RequestPacket; // Pointer to request packet - PMDL ResponseMdl; // Pointer to response MDL - PVOID * ResponsePacket; // Pointer to pointer to response packet - PULONG ResponseLength; // Pointer to length of response - PKEVENT * ResponseEvent; // Event to be signaled -} NOTIFICATION_INFO_W2K, *PNOTIFICATION_INFO_W2K; - -typedef struct _NOTIFICATION_INFO_WXP { - PMDL Mdl; // Supplied by device driver - ULONG ulOffset; // Where in buffer - ULONG nLength; // How big is the operation - ULONG fulNotificationOptions; // Which option occurred - PVOID Context; // Device driver supplied - PADDRESS_FIFO Fifo; // FIFO that completed - PVOID RequestPacket; // Pointer to request packet - PMDL ResponseMdl; // Pointer to response MDL - PVOID * ResponsePacket; // Pointer to pointer to response packet - PULONG ResponseLength; // Pointer to length of response - PKEVENT * ResponseEvent; // Event to be signaled - RCODE ResponseCode; // RCode to be returned for request -} NOTIFICATION_INFO_WXP, *PNOTIFICATION_INFO_WXP; - -#if(NTDDI_VERSION < NTDDI_WINXP) -typedef NOTIFICATION_INFO_W2K NOTIFICATION_INFO, *PNOTIFICATION_INFO; -#else -typedef NOTIFICATION_INFO_WXP NOTIFICATION_INFO, *PNOTIFICATION_INFO; -#endif - -#if(NTDDI_VERSION >= NTDDI_WIN7) - -// -// The size of the bus info block in bytes. -// - -#define BUS_INFO_BLOCK_SIZE 16 - -// -// Config Rom Header. -// - -typedef struct _CONFIG_ROM_HEADER { - ULONG Crc:16; - ULONG CrcLength:8; - ULONG InfoLength:8; -} CONFIG_ROM_HEADER, *PCONFIG_ROM_HEADER; - -// -// Config Rom Bus Information Capabilities. -// - -typedef struct _BUS_INFO_CAPABILITIES { - ULONG LinkSpeed:3; - ULONG Reserved0:1; - ULONG Generation:4; - ULONG MaxRom:2; - ULONG Reserved1:2; - ULONG MaxRec:4; - ULONG CycleClockAccuracy:8; - ULONG Reserved2:3; - ULONG PowerManagementCapable:1; - ULONG BusManagerCapable:1; - ULONG IsochCapable:1; - ULONG CycleMasterCapable:1; - ULONG IsochResourceManagerCapable:1; -} BUS_INFO_CAPABILITIES, *PBUS_INFO_CAPABILITIES; - -// -// Config Rom Bus Information Ids -// - -typedef struct _BUS_INFO_IDS { - ULONG ChipIdHigh:8; - ULONG NodeVendorId:24; -} BUS_INFO_IDS, *PBUS_INFO_IDS; - -// -// Directory Header. -// - -typedef struct _DIRECTORY_HEADER { - ULONG Crc:16; - ULONG Length:16; -} DIRECTORY_HEADER, *PDIRECTORY_HEADER; - -// -// Directory Entry. -// - -typedef struct _DIRECTORY_ENTRY { - ULONG Value:24; - ULONG KeyId:6; - ULONG KeyType:2; -} DIRECTORY_ENTRY, *PDIRECTORY_ENTRY; - -// -// Leaf Format. -// - -typedef struct _LEAF_FORMAT { - ULONG SpecifierId:24; - ULONG DescriptorType:8; -} LEAF_FORMAT, *PLEAF_FORMAT; - -// -// Textual Leaf Format. -// - -typedef struct _TEXTUAL_LEAF_FORMAT { - ULONG Language:16; - ULONG CharacterSet:12; - ULONG Width:4; -} TEXTUAL_LEAF_FORMAT, *PTEXTUAL_LEAF_FORMAT; - -// -// Directory Entries. -// - -typedef union _DIRECTORY_ENTRIES { - ULONG Quadlet; - DIRECTORY_HEADER Header; - DIRECTORY_ENTRY Entry; - LEAF_FORMAT LeafFormat; - TEXTUAL_LEAF_FORMAT TextualLeafFormat; -} DIRECTORY_ENTRIES, *PDIRECTORY_ENTRIES; - -// -// 1394 Config Rom. -// - -typedef struct _CROM { - - CONFIG_ROM_HEADER ConfigRomHeader; // @ 400 - - ULONG Signature; // @ 404 - - BUS_INFO_CAPABILITIES BusInfoCaps; // @ 408 - - BUS_INFO_IDS BusInfoIds; // @ 40C - - ULONG ChipIdLow; // @ 410 - - DIRECTORY_HEADER RootDirectoryHeader; // @ 414 - - DIRECTORY_ENTRIES Entries[250]; // @ 418 ... - -} CROM, *PCROM; - -#endif - -// -// Various definitions. -// - -#if(NTDDI_VERSION >= NTDDI_WINXP) -#include -DEFINE_GUID( BUS1394_CLASS_GUID, 0x6BDD1FC1, 0x810F, 0x11d0, 0xBE, 0xC7, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F); -#endif - -#define IOCTL_1394_CLASS CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x87, \ - METHOD_IN_DIRECT, \ - FILE_ANY_ACCESS \ - ) - -// -// 1394 Transaction codes. -// - -#define TCODE_WRITE_REQUEST_QUADLET 0 -#define TCODE_WRITE_REQUEST_BLOCK 1 -#define TCODE_WRITE_RESPONSE 2 -#define TCODE_RESERVED1 3 -#define TCODE_READ_REQUEST_QUADLET 4 -#define TCODE_READ_REQUEST_BLOCK 5 -#define TCODE_READ_RESPONSE_QUADLET 6 -#define TCODE_READ_RESPONSE_BLOCK 7 -#define TCODE_CYCLE_START 8 -#define TCODE_LOCK_REQUEST 9 -#define TCODE_ISOCH_DATA_BLOCK 10 -#define TCODE_LOCK_RESPONSE 11 -#define TCODE_RESERVED2 12 -#define TCODE_RESERVED3 13 -#define TCODE_PHY_PACKET 14 -#define TCODE_SELFID 14 -#define TCODE_RESERVED4 15 - -#define TCODE_REQUEST_BLOCK_MASK 1 -#define TCODE_RESPONSE_MASK 2 - -// -// 1394 Extended Transaction codes. -// - -#define EXT_TCODE_RESERVED0 0 -#define EXT_TCODE_MASK_SWAP 1 -#define EXT_TCODE_COMPARE_SWAP 2 -#define EXT_TCODE_FETCH_ADD 3 -#define EXT_TCODE_LITTLE_ADD 4 -#define EXT_TCODE_BOUNDED_ADD 5 -#define EXT_TCODE_WRAP_ADD 6 - -// -// 1394 Acknowledgement codes. -// - -#define ACODE_RESERVED_0 0 -#define ACODE_ACK_COMPLETE 1 -#define ACODE_ACK_PENDING 2 -#define ACODE_RESERVED_3 3 -#define ACODE_ACK_BUSY_X 4 -#define ACODE_ACK_BUSY_A 5 -#define ACODE_ACK_BUSY_B 6 -#define ACODE_RESERVED_7 7 -#define ACODE_RESERVED_8 8 -#define ACODE_RESERVED_9 9 -#define ACODE_RESERVED_10 10 -#define ACODE_ACK_TARDY 11 -#define ACODE_RESERVED_12 12 -#define ACODE_ACK_DATA_ERROR 13 -#define ACODE_ACK_TYPE_ERROR 14 -#define ACODE_RESERVED_15 15 - -// -// 1394 Ack code to NT status mask (to be OR'd in when completing IRPs). -// - -#define ACODE_STATUS_MASK ((NTSTATUS)0xC0120070L) - -// -// 1394 Response codes. -// - -#define RCODE_RESPONSE_COMPLETE 0 -#define RCODE_RESERVED1 1 -#define RCODE_RESERVED2 2 -#define RCODE_RESERVED3 3 -#define RCODE_CONFLICT_ERROR 4 -#define RCODE_DATA_ERROR 5 -#define RCODE_TYPE_ERROR 6 -#define RCODE_ADDRESS_ERROR 7 -#define RCODE_TIMED_OUT 15 - -// -// 1394 Response code to NT status mask (to be OR'd in when completing IRPs). -// - -#define RCODE_STATUS_MASK ((NTSTATUS)0xC0120080L) - -#if(NTDDI_VERSION < NTDDI_WINXP) -#define STATUS_INVALID_GENERATION ((NTSTATUS)0xC0128090L) -#else -#define STATUS_INVALID_GENERATION ((NTSTATUS)0xC0120090L) -#endif - -// -// 1394 Speed codes. -// - -#define SCODE_100_RATE 0 -#define SCODE_200_RATE 1 -#define SCODE_400_RATE 2 -#define SCODE_800_RATE 3 -#define SCODE_1600_RATE 4 -#define SCODE_3200_RATE 5 - -// -// 1394 Self ID definitions. -// - -#define SELF_ID_CONNECTED_TO_CHILD 3 -#define SELF_ID_CONNECTED_TO_PARENT 2 -#define SELF_ID_NOT_CONNECTED 1 -#define SELF_ID_NOT_PRESENT 0 - -// -// 1394 Self ID Power Class definitions. -// - -#define POWER_CLASS_NOT_NEED_NOT_REPEAT 0 -#define POWER_CLASS_SELF_POWER_PROVIDE_15W 1 -#define POWER_CLASS_SELF_POWER_PROVIDE_30W 2 -#define POWER_CLASS_SELF_POWER_PROVIDE_45W 3 -#define POWER_CLASS_MAYBE_POWERED_UPTO_1W 4 -#define POWER_CLASS_IS_POWERED_UPTO_1W_NEEDS_2W 5 -#define POWER_CLASS_IS_POWERED_UPTO_1W_NEEDS_5W 6 -#define POWER_CLASS_IS_POWERED_UPTO_1W_NEEDS_9W 7 - -// -// 1394 Phy Packet Ids. -// - -#define PHY_PACKET_ID_CONFIGURATION 0 -#define PHY_PACKET_ID_LINK_ON 1 -#define PHY_PACKET_ID_SELF_ID 2 - -// -// Various Interesting 1394 IEEE 1212 locations. -// - -#define INITIAL_REGISTER_SPACE_HI 0xffff -#define INITIAL_REGISTER_SPACE_LO 0xf0000000 -#define STATE_CLEAR_LOCATION 0x000 -#define STATE_SET_LOCATION 0x004 -#define NODE_IDS_LOCATION 0x008 -#define RESET_START_LOCATION 0x00C -#define SPLIT_TIMEOUT_HI_LOCATION 0x018 -#define SPLIT_TIMEOUT_LO_LOCATION 0x01C -#define INTERRUPT_TARGET_LOCATION 0x050 -#define INTERRUPT_MASK_LOCATION 0x054 -#define CYCLE_TIME_LOCATION 0x200 -#define BUS_TIME_LOCATION 0x204 -#define POWER_FAIL_IMMINENT_LOCATION 0x208 -#define POWER_SOURCE_LOCATION 0x20C -#define BUSY_TIMEOUT_LOCATION 0x210 -#define BUS_MANAGER_ID_LOCATION 0x21C -#define BANDWIDTH_AVAILABLE_LOCATION 0x220 -#define CHANNELS_AVAILABLE_LOCATION 0x224 -#define NETWORK_CHANNELS_LOCATION 0x234 -#define CONFIG_ROM_LOCATION 0x400 -#define TOPOLOGY_MAP_LOCATION 0x1000 -#define SPEED_MAP_LOCATION 0x2000 - -// -// 1394 Configuration key values and masks. -// - -#define CONFIG_ROM_KEY_MASK 0x000000ff -#define CONFIG_ROM_OFFSET_MASK 0xffffff00 -#define MODULE_VENDOR_ID_KEY_SIGNATURE 0x03 -#define NODE_CAPABILITIES_KEY_SIGNATURE 0x0c -#define SPEC_ID_KEY_SIGNATURE 0x12 -#define SOFTWARE_VERSION_KEY_SIGNATURE 0x13 -#define MODEL_ID_KEY_SIGNATURE 0x17 -#define EXTENDED_SPECIFIER_ID_KEY_SIGNATURE 0x1C -#define EXTENDED_KEY_SIGNATURE 0x1D -#define EXTENDED_DATA_KEY_SIGNATURE 0x1E - -#define COMMAND_BASE_KEY_SIGNATURE 0x40 -#define VENDOR_KEY_SIGNATURE 0x81 -#define TEXTUAL_LEAF_INDIRECT_KEY_SIGNATURE 0x81 - -#define MODEL_KEY_SIGNATURE 0x82 -#define UNIT_DIRECTORY_KEY_SIGNATURE 0xd1 -#define UNIT_DEP_DIR_KEY_SIGNATURE 0xd4 - -// -// IEEE 1212-2001 Key Type Definitions. -// - -#define IEEE1212_KEY_TYPE_IMMEDIATE 0 -#define IEEE1212_KEY_TYPE_OFFSET 1 -#define IEEE1212_KEY_TYPE_LEAF 2 -#define IEEE1212_KEY_TYPE_DIRECTORY 3 - -// -// IEEE 1212-2001 Key Id Definitions. -// - -#define IEEE1212_KEY_ID_DESCRIPTOR 0x01 -#define IEEE1212_KEY_ID_VENDOR 0x03 -#define IEEE1212_KEY_ID_UNIT 0x11 -#define IEEE1212_KEY_ID_SPECIFIER_ID 0x12 -#define IEEE1212_KEY_ID_VERSION 0x13 -#define IEEE1212_KEY_ID_DEPENDENT_INFO 0x14 -#define IEEE1212_KEY_ID_MODEL 0x17 -#define IEEE1212_KEY_ID_EXTENDED_KEY_SPEC_ID 0x1C -#define IEEE1212_KEY_ID_EXTENDED_KEY 0x1D -#define IEEE1212_KEY_ID_EXTENDED_DATA 0x1E - -// -// 1394 Async Data Payload Sizes. -// - -#define ASYNC_PAYLOAD_100_RATE 512 -#define ASYNC_PAYLOAD_200_RATE 1024 -#define ASYNC_PAYLOAD_400_RATE 2048 -#define ASYNC_PAYLOAD_800_RATE 4096 -#define ASYNC_PAYLOAD_1600_RATE 4096 -#define ASYNC_PAYLOAD_3200_RATE 4096 - - -// -// 1394 Isoch Data Payload Sizes. -// - -#define ISOCH_PAYLOAD_100_RATE 1024 -#define ISOCH_PAYLOAD_200_RATE 2048 -#define ISOCH_PAYLOAD_400_RATE 4096 -#define ISOCH_PAYLOAD_800_RATE 8192 -#define ISOCH_PAYLOAD_1600_RATE 16384 -#define ISOCH_PAYLOAD_3200_RATE 32768 - -// -// Various definitions. -// - -#define S100_BW_UNITS_PER_QUADLET 19 -#define S200_BW_UNITS_PER_QUADLET 9 -#define S400_BW_UNITS_PER_QUADLET 4 -#define S800_BW_UNITS_PER_QUADLET 2 -#define S1600_BW_UNITS_PER_QUADLET 1 - -#define INITIAL_BANDWIDTH_UNITS 4915 // Initial bandwidth units - -#define MAX_REC_100_RATE 0x08 -#define MAX_REC_200_RATE 0x09 -#define MAX_REC_400_RATE 0x0a - -#define LOCAL_BUS 0x3ff -#define MAX_LOCAL_NODES 64 -#define SELFID_PACKET_SIGNITURE 2 -#define NOMINAL_CYCLE_TIME 125 // Microseconds -#define NO_BUS_MANAGER 0x3f - -#define CONFIG_ROM_SIGNATURE 0x31333934 - -// -// IRB function number definitions. -// - -#define REQUEST_ASYNC_READ 0 -#define REQUEST_ASYNC_WRITE 1 -#define REQUEST_ASYNC_LOCK 2 -#define REQUEST_ISOCH_ALLOCATE_BANDWIDTH 3 -#define REQUEST_ISOCH_ALLOCATE_CHANNEL 4 -#define REQUEST_ISOCH_ALLOCATE_RESOURCES 5 -#define REQUEST_ISOCH_ATTACH_BUFFERS 6 -#define REQUEST_ISOCH_DETACH_BUFFERS 7 -#define REQUEST_ISOCH_FREE_BANDWIDTH 8 -#define REQUEST_ISOCH_FREE_CHANNEL 9 -#define REQUEST_ISOCH_FREE_RESOURCES 10 -#define REQUEST_ISOCH_LISTEN 11 -#define REQUEST_ISOCH_STOP 12 -#define REQUEST_ISOCH_TALK 13 -#define REQUEST_ISOCH_QUERY_CYCLE_TIME 14 -#define REQUEST_ISOCH_QUERY_RESOURCES 15 -#define REQUEST_ISOCH_SET_CHANNEL_BANDWIDTH 16 -#define REQUEST_ALLOCATE_ADDRESS_RANGE 17 -#define REQUEST_FREE_ADDRESS_RANGE 18 -#define REQUEST_GET_LOCAL_HOST_INFO 19 -#define REQUEST_GET_ADDR_FROM_DEVICE_OBJECT 20 -#define REQUEST_CONTROL 21 -#define REQUEST_GET_SPEED_BETWEEN_DEVICES 22 -#define REQUEST_SET_DEVICE_XMIT_PROPERTIES 23 -#define REQUEST_GET_CONFIGURATION_INFO 24 -#define REQUEST_BUS_RESET 25 -#define REQUEST_GET_GENERATION_COUNT 26 -#define REQUEST_SEND_PHY_CONFIG_PACKET 27 -#define REQUEST_GET_SPEED_TOPOLOGY_MAPS 28 -#define REQUEST_BUS_RESET_NOTIFICATION 29 -#define REQUEST_ASYNC_STREAM 30 -#define REQUEST_SET_LOCAL_HOST_PROPERTIES 31 - -#if(NTDDI_VERSION >= NTDDI_WINXP) -#define REQUEST_ISOCH_MODIFY_STREAM_PROPERTIES 32 -#endif - -#if(NTDDI_VERSION >= NTDDI_WIN7) -#define REQUEST_SEND_PHY_PACKET 33 -#define REQUEST_RECEIVE_PHY_PACKETS 34 -#define REQUEST_GET_CONFIG_ROM 35 -#endif - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PBUS_NOTIFICATION_ROUTINE) ( - __in PNOTIFICATION_INFO NotificationInfo - ); - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PBUS_ISOCH_DESCRIPTOR_ROUTINE) ( - __in PVOID Context1, - __in PVOID Context2 - ); - -#if(NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _BUS_RESET_DATA { - PVOID ResetContext; - ULONG GenerationCount; - NODE_ADDRESS DeviceNodeId; - NODE_ADDRESS LocalNodeId; - UCHAR SpeedToNode; -} BUS_RESET_DATA, *PBUS_RESET_DATA; - -#endif - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PBUS_BUS_RESET_NOTIFICATION)( - __in PVOID Context - ); - -// -// Definition of Isoch Descriptor. -// - -typedef struct _ISOCH_DESCRIPTOR { - - // - // Flags (used in synchronization). - // - - ULONG fulFlags; - - // - // Mdl pointing to buffer. - // - - PMDL Mdl; - - // - // Length of combined buffer(s) as represented by the Mdl. - // - - ULONG ulLength; - - // - // Payload size of each Isoch packet to be used in this descriptor. - // - - ULONG nMaxBytesPerFrame; - - // - // Synchronization field; equivalent to Sy in the Isoch packet. - // - - ULONG ulSynch; - - // - // Synchronization field; equivalent to Tag in the Isoch packet. - // - - ULONG ulTag; - - // - // Cycle time field; returns time to be sent/received or when finished. - // - - CYCLE_TIME CycleTime; - - // - // Callback routine (if any) to be called when this descriptor completes. - // - - PBUS_ISOCH_DESCRIPTOR_ROUTINE Callback; - - // - // First context (if any) parameter to be passed when doing callbacks. - // - - PVOID Context1; - - // - // Second context (if any) parameter to be passed when doing callbacks. - // - - PVOID Context2; - - // - // Holds the final status of this descriptor. - // - - NTSTATUS status; - - // - // Reserved for the device driver who submitted this descriptor to - // stomp in. - // - - ULONG_PTR DeviceReserved[8]; - - // - // Reserved for the bus driver to stomp in. - // - - ULONG_PTR BusReserved[8]; - - // - // Reserved for the port driver to stomp in. - // - - ULONG_PTR PortReserved[16]; - -} ISOCH_DESCRIPTOR, *PISOCH_DESCRIPTOR; - -// -// Definition of header element for scatter/gather support. -// - -typedef struct _IEEE1394_SCATTER_GATHER_HEADER{ - - USHORT HeaderLength; - USHORT DataLength; - UCHAR HeaderData; - -} IEEE1394_SCATTER_GATHER_HEADER, *PIEEE1394_SCATTER_GATHER_HEADER; - -// -// Fields necessary in order for the 1394 stack to carry out an -// AsyncRead request. -// - -typedef struct _IRB_REQ_ASYNC_READ { - IO_ADDRESS DestinationAddress; // Address to read from - ULONG nNumberOfBytesToRead; // Bytes to read - ULONG nBlockSize; // Block size of read - ULONG fulFlags; // Flags pertinent to read - PMDL Mdl; // Destination buffer - ULONG ulGeneration; // Generation as known by driver - UCHAR chPriority; // Priority to send - UCHAR nSpeed; // Speed at which to send - UCHAR tCode; // Type of Read to do - UCHAR Reserved; // Used to determine medium delay - ULONG ElapsedTime; // Only valid for flag ASYNC_FLAGS_PING - // units in nano secs.. -} IRB_REQ_ASYNC_READ; - -// -// Fields necessary in order for the 1394 stack to carry out an -// AsyncWrite request. -// - -typedef struct _IRB_REQ_ASYNC_WRITE { - IO_ADDRESS DestinationAddress; // Address to write to - ULONG nNumberOfBytesToWrite; // Bytes to write - ULONG nBlockSize; // Block size of write - ULONG fulFlags; // Flags pertinent to write - PMDL Mdl; // Destination buffer - ULONG ulGeneration; // Generation as known by driver - UCHAR chPriority; // Priority to send - UCHAR nSpeed; // Speed at which to send - UCHAR tCode; // Type of Write to do - UCHAR Reserved; // Reserved for future use - ULONG ElapsedTime; // Only valid for flag ASYNC_FLAGS_PING -} IRB_REQ_ASYNC_WRITE; - -// -// Fields necessary in order for the 1394 stack to carry out an -// AsyncLock request. -// - -typedef struct _IRB_REQ_ASYNC_LOCK { - IO_ADDRESS DestinationAddress; // Address to lock to - ULONG nNumberOfArgBytes; // Bytes in Arguments - ULONG nNumberOfDataBytes; // Bytes in DataValues - ULONG fulTransactionType; // Lock transaction type - ULONG fulFlags; // Flags pertinent to lock - ULONG Arguments[2]; // Arguments used in Lock - ULONG DataValues[2]; // Data values - PVOID pBuffer; // Destination buffer (virtual address) - ULONG ulGeneration; // Generation as known by driver - UCHAR chPriority; // Priority to send - UCHAR nSpeed; // Speed at which to send - UCHAR tCode; // Type of Lock to do - UCHAR Reserved; // Reserved for future use -} IRB_REQ_ASYNC_LOCK; - -// -// Fields necessary in order for the Bus driver to carry out an -// IsochAllocateBandwidth request. -// - -typedef struct _IRB_REQ_ISOCH_ALLOCATE_BANDWIDTH { - ULONG nMaxBytesPerFrameRequested; // Bytes per Isoch frame - ULONG fulSpeed; // Speed flags - HANDLE hBandwidth; // bandwidth handle returned - ULONG BytesPerFrameAvailable; // Available bytes per frame - ULONG SpeedSelected; // Speed to be used - ULONG nBandwidthUnitsRequired; // pre-calculated value -} IRB_REQ_ISOCH_ALLOCATE_BANDWIDTH; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochAllocateChannel request. -// - -typedef struct _IRB_REQ_ISOCH_ALLOCATE_CHANNEL { - ULONG nRequestedChannel; // Need a specific channel - ULONG Channel; // Returned channel - LARGE_INTEGER ChannelsAvailable; // Channels available -} IRB_REQ_ISOCH_ALLOCATE_CHANNEL; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochAllocateResources request -// Instructions: -// Receive alloc: -// fulSpeed - should be the max speed the tx side is expected to stream -// The payload size in nMaxBytesPerFram cannot exceed the max payload for -// for this speed. -// fulFlags - For receive, wtih the standard header stripped, the field should -// be = (RESOURCE_USED_IN_LISTEN | RESOURCES_STRIP_ADDITIONAL_QUADLETS) -// Also nQuadletsToStrip = 1 -// For no stripping set nQuadsTostrip to 0 and dont specify the stripping flag. -// nMaxBytesPerframe - If not stripping it should include the 8 bytes for header/trailer -// expected to be recieved for each packet. -// nNumberOfBuffer - see below -// nMaxBufferSize - This should be always such mode(nMaxBufferSize,nMaxBytesPerFrame) == 0 -// (integer product of number of bytes per packet). -// nQuadletsTostrip - If stripping only one quadlet (standrd iso header) this is set to 1 -// if zero, the isoch header will be included AND the trailer. So 8 bytes extra will be recieved -// hResource - see below -// - -typedef struct _IRB_REQ_ISOCH_ALLOCATE_RESOURCES_W2K { - ULONG fulSpeed; // Speed flags - ULONG fulFlags; // Flags - ULONG nChannel; // Channel to be used - ULONG nMaxBytesPerFrame; // Expected size of Isoch frame - ULONG nNumberOfBuffers; // Number of buffer(s) that will be attached - ULONG nMaxBufferSize; // Max size of buffer(s) - ULONG nQuadletsToStrip; // Number striped from start of every packet - HANDLE hResource; // handle to Resource -} IRB_REQ_ISOCH_ALLOCATE_RESOURCES_W2K; - -typedef struct _IRB_REQ_ISOCH_ALLOCATE_RESOURCES_WXP { - ULONG fulSpeed; // Speed flags - ULONG fulFlags; // Flags - ULONG nChannel; // Channel to be used - ULONG nMaxBytesPerFrame; // Expected size of Isoch frame - ULONG nNumberOfBuffers; // Number of buffer(s) that will be attached - ULONG nMaxBufferSize; // Max size of buffer(s) - ULONG nQuadletsToStrip; // Number striped from start of every packet - HANDLE hResource; // handle to Resource - ULARGE_INTEGER ChannelMask; // channel mask for multi-channel recv -} IRB_REQ_ISOCH_ALLOCATE_RESOURCES_WXP; - -#if(NTDDI_VERSION < NTDDI_WINXP) -typedef IRB_REQ_ISOCH_ALLOCATE_RESOURCES_W2K IRB_REQ_ISOCH_ALLOCATE_RESOURCES; -#else -typedef IRB_REQ_ISOCH_ALLOCATE_RESOURCES_WXP IRB_REQ_ISOCH_ALLOCATE_RESOURCES; -#endif - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochAttachBuffers request. -// Note that pIsochDescriptor->UlLength must be an integer product of -// pIsochDescriptor->nBytesMaxPerFrame. -// - -typedef struct _IRB_REQ_ISOCH_ATTACH_BUFFERS { - HANDLE hResource; // Resource handle - ULONG nNumberOfDescriptors; // Number to attach - PISOCH_DESCRIPTOR pIsochDescriptor; // Pointer to start of Isoch descriptors -} IRB_REQ_ISOCH_ATTACH_BUFFERS; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochDetachBuffers request. -// - -typedef struct _IRB_REQ_ISOCH_DETACH_BUFFERS { - HANDLE hResource; // Resource handle - ULONG nNumberOfDescriptors; // Number to detach - PISOCH_DESCRIPTOR pIsochDescriptor; // Pointer to Isoch descriptors -} IRB_REQ_ISOCH_DETACH_BUFFERS; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochFreeBandwidth request. -// - -typedef struct _IRB_REQ_ISOCH_FREE_BANDWIDTH { - HANDLE hBandwidth; // Bandwidth handle to release - ULONG nMaxBytesPerFrameRequested; // Bytes per Isoch frame - ULONG fulSpeed; // Speed flags - ULONG BytesPerFrameAvailable; // this is not used - ULONG SpeedSelected; // this is not used - ULONG nBandwidthUnitsRequired; // pre-calculated value -} IRB_REQ_ISOCH_FREE_BANDWIDTH; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochFreeChannel request. -// - -typedef struct _IRB_REQ_ISOCH_FREE_CHANNEL { - ULONG nChannel; // Channel to release -} IRB_REQ_ISOCH_FREE_CHANNEL; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochFreeResources request. -// - -typedef struct _IRB_REQ_ISOCH_FREE_RESOURCES { - HANDLE hResource; // Resource handle -} IRB_REQ_ISOCH_FREE_RESOURCES; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochListen request. -// - -typedef struct _IRB_REQ_ISOCH_LISTEN { - HANDLE hResource; // Resource handle to listen on - ULONG fulFlags; // Flags - CYCLE_TIME StartTime; // Cycle time to start -} IRB_REQ_ISOCH_LISTEN; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochQueryCurrentCycleTime request. -// - -typedef struct _IRB_REQ_ISOCH_QUERY_CURRENT_CYCLE_TIME { - CYCLE_TIME CycleTime; // Current cycle time returned -} IRB_REQ_ISOCH_QUERY_CURRENT_CYCLE_TIME; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochQueryResources request. -// - -typedef struct _IRB_REQ_ISOCH_QUERY_RESOURCES { - ULONG fulSpeed; // Speed flags - ULONG BytesPerFrameAvailable; // Per Isoch Frame - LARGE_INTEGER ChannelsAvailable; // Available channels -} IRB_REQ_ISOCH_QUERY_RESOURCES; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochSetChannelBandwidth request. -// - -typedef struct _IRB_REQ_ISOCH_SET_CHANNEL_BANDWIDTH { - HANDLE hBandwidth; // Bandwidth handle - ULONG nMaxBytesPerFrame; // bytes per Isoch frame - ULONG nBandwidthUnitsRequired; // pre-calculated value -} IRB_REQ_ISOCH_SET_CHANNEL_BANDWIDTH; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochStop request. -// - -typedef struct _IRB_REQ_ISOCH_STOP { - HANDLE hResource; // Resource handle to stop on - ULONG fulFlags; // Flags -} IRB_REQ_ISOCH_STOP; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochTalk request. -// - -typedef struct _IRB_REQ_ISOCH_TALK { - HANDLE hResource; // Resource handle to talk on - ULONG fulFlags; // Flags - CYCLE_TIME StartTime; // Cycle time to start -} IRB_REQ_ISOCH_TALK; - -// -// Fields necessary in order for the Bus driver to carry out a -// IsochModifyStreamProperties request. -// This request is used to dynamicaly change the properties of an allocated -// resource, without the need to free and re-allocate the resource. -// The resource must NOT be streaming when this is issued. The caller should -// issue an ISOCH_STOP first and then an isoch start. Also no buffer can be -// pending after the ISOCH_STOP and before this call is made. -// - -typedef struct _IRB_REQ_ISOCH_MODIFY_STREAM_PROPERTIES { - HANDLE hResource; // Resource handle - ULARGE_INTEGER ChannelMask; // New channels to tx/rx on - ULONG fulSpeed; // New speed -} IRB_REQ_ISOCH_MODIFY_STREAM_PROPERTIES; - -// -// Fields necessary in order for the 1394 stack to carry out an -// AllocateAddressRange request. -// Note: -// if the allocation is specified with no notification options and no RequiredOffset -// the returned address will ALWAYS be a physical address (on ohci). -// As a result these rules apply: -// Allocation - If Callback and Context is specified, since no notification is used -// the callback will be used to notify the caller that the allocation is complete. -// This way the issuer of the alloc doe snot have have to block but instead his callback -// routine will be called asynchronously when this is complete -// The caller must create this irb as usual but instead use the physical mapping routine -// provided by the por driver, in order to usee this request. If it uses IoCallDriver -// the caller cannot specif Context/Callback for a physical address, and he/she has to block. -// - -typedef struct _IRB_REQ_ALLOCATE_ADDRESS_RANGE { - PMDL Mdl; // Address to map to 1394 space - ULONG fulFlags; // Flags for this operation - ULONG nLength; // Length of 1394 space desired - ULONG MaxSegmentSize; // Maximum segment size for a single address element - ULONG fulAccessType; // Desired access: R, W, L - ULONG fulNotificationOptions; // Notify options on Async access - PVOID Callback; // Pointer to callback routine - PVOID Context; // Pointer to driver supplied data - ADDRESS_OFFSET Required1394Offset; // Offset that must be returned - PSLIST_HEADER FifoSListHead; // Pointer to SList FIFO head - PKSPIN_LOCK FifoSpinLock; // Pointer to SList Spin Lock - ULONG AddressesReturned; // Number of addresses returned - PADDRESS_RANGE p1394AddressRange; // Pointer to returned 1394 Address Ranges - HANDLE hAddressRange; // Handle to address range - PVOID DeviceExtension; // Device Extension who created this mapping -} IRB_REQ_ALLOCATE_ADDRESS_RANGE; - -// -// Fields necessary in order for the 1394 stack to carry out a -// FreeAddressRange request. -// - -typedef struct _IRB_REQ_FREE_ADDRESS_RANGE { - ULONG nAddressesToFree; // Number of Addresses to free - PADDRESS_RANGE p1394AddressRange; // Array of 1394 Address Ranges to Free - PHANDLE pAddressRange; // Array of Handles to address range - PVOID DeviceExtension; // Device Extension who created this mapping -} IRB_REQ_FREE_ADDRESS_RANGE; - -// -// Fields necessary in order for the Bus driver to carry out a -// GetLocalHostInformation request. -// All levels ans structures are descrived below. -// - -typedef struct _IRB_REQ_GET_LOCAL_HOST_INFORMATION { - ULONG nLevel; // level of info requested - PVOID Information; // returned information -} IRB_REQ_GET_LOCAL_HOST_INFORMATION; - -// -// Fields necessary in order for the Bus driver to carry out a -// Get1394AddressFromDeviceObject request. -// - -typedef struct _IRB_REQ_GET_1394_ADDRESS_FROM_DEVICE_OBJECT { - ULONG fulFlags; // Flags - NODE_ADDRESS NodeAddress; // Returned Node address -} IRB_REQ_GET_1394_ADDRESS_FROM_DEVICE_OBJECT; - -// -// Fields necessary in order for the Bus driver to carry out a -// Control request. -// - -typedef struct _IRB_REQ_CONTROL { - ULONG ulIoControlCode; // Control code - PMDL pInBuffer; // Input buffer - ULONG ulInBufferLength; // Input buffer length - PMDL pOutBuffer; // Output buffer - ULONG ulOutBufferLength; // Output buffer length - ULONG BytesReturned; // Bytes returned -} IRB_REQ_CONTROL; - -// -// Fields necessary in order for the Bus driver to carry out a -// GetMaxSpeedBetweenDevices request. -// - -typedef struct _IRB_REQ_GET_MAX_SPEED_BETWEEN_DEVICES { - ULONG fulFlags; // Flags - ULONG ulNumberOfDestinations; // Number of destinations - PDEVICE_OBJECT hDestinationDeviceObjects[64]; // Destinations - ULONG fulSpeed; // Max speed returned -} IRB_REQ_GET_MAX_SPEED_BETWEEN_DEVICES; - -// -// Fields necessary in order for the Bus driver to carry out a -// SetDeviceXmitProperties request. -// - -typedef struct _IRB_REQ_SET_DEVICE_XMIT_PROPERTIES { - ULONG fulSpeed; // Speed - ULONG fulPriority; // Priority -} IRB_REQ_SET_DEVICE_XMIT_PROPERTIES; - -// -// Fields necessary in order for the Bus driver to carry out a -// SetPortProperties request. -// - -typedef struct _IRB_REQ_SET_LOCAL_HOST_PROPERTIES { - ULONG nLevel; - PVOID Information; -} IRB_REQ_SET_LOCAL_HOST_PROPERTIES; - -// -// Fields necessary in order for the Bus driver to carry out a -// GetConfigurationInformation request. -// - -typedef struct _IRB_REQ_GET_CONFIGURATION_INFORMATION { - PCONFIG_ROM ConfigRom; // Pointer to config rom - ULONG UnitDirectoryBufferSize; - PVOID UnitDirectory; // Pointer to unit directory - IO_ADDRESS UnitDirectoryLocation; // Starting Location of Unit Directory - ULONG UnitDependentDirectoryBufferSize; - PVOID UnitDependentDirectory; - IO_ADDRESS UnitDependentDirectoryLocation; - ULONG VendorLeafBufferSize; // Size available to get vendor leafs - PTEXTUAL_LEAF VendorLeaf; // Pointer to vendor leafs - ULONG ModelLeafBufferSize; // Size available to get model leafs - PTEXTUAL_LEAF ModelLeaf; // Pointer to model leafs - -} IRB_REQ_GET_CONFIGURATION_INFORMATION; - -#if(NTDDI_VERSION >= NTDDI_WIN7) - -// -// Fields necessary in order for the Bus driver to carry out a -// GetConfigRom request. -// - -typedef struct _IRB_REQ_GET_CONFIG_ROM { - ULONG GenerationCount; - PCROM ConfigRom; - ULONG UnitDirectoryIndex; - ULONG UnitDependentDirectoryIndex; - ULONG VendorLeafIndex; - ULONG ModelLeafIndex; -} IRB_REQ_GET_CONFIG_ROM; - -#endif - -// -// Fields necessary in order for the Bus driver to carry out a -// BusReset request. -// - -typedef struct _IRB_REQ_BUS_RESET { - ULONG fulFlags; // Flags for Bus Reset -} IRB_REQ_BUS_RESET; - -// -// Fields necessary in order for the Bus driver to carry out a -// GetGenerationCount request. -// - -typedef struct _IRB_REQ_GET_GENERATION_COUNT { - ULONG GenerationCount; // generation count -} IRB_REQ_GET_GENERATION_COUNT; - -// -// Fields necessary in order for the Bus driver to carry out a -// SendPhyConfigurationPacket request. -// - -typedef struct _IRB_REQ_SEND_PHY_CONFIGURATION_PACKET { - PHY_CONFIGURATION_PACKET PhyConfigurationPacket; // Phy packet -} IRB_REQ_SEND_PHY_CONFIGURATION_PACKET; - -#if(NTDDI_VERSION >= NTDDI_WIN7) - -// -// Fields necessary in order to send a phy packet. -// - -typedef struct _IRB_REQ_SEND_PHY_PACKET { - ULONG Flags; - ULONG GenerationCount; - ULARGE_INTEGER PhyPacket; -} IRB_REQ_SEND_PHY_PACKET; - -// -// Parameters used for register phy packet notification. -// - -#define REGISTER_PHY_PACKET_NOTIFICATION 0x00000001 -#define DEREGISTER_PHY_PACKET_NOTIFICATION 0x00000002 - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PBUS_PHY_PACKET_NOTIFICATION)( - __in PVOID Context, - __in ULONG GenerationCount, - __in ULARGE_INTEGER PhyPacket - ); - -// -// Fields necessary in order to receive phy packets. -// - -typedef struct _IRB_RECEIVE_PHY_PACKETS { - ULONG Flags; - PBUS_PHY_PACKET_NOTIFICATION PhyPacketRoutine; - PVOID PhyPacketContext; -} IRB_REQ_RECEIVE_PHY_PACKETS; - -#endif - -// -// Fields necessary in order for the Bus driver to carry out a -// GetSpeedTopologyMaps request. -// The topology map and speed map are in big endian. -// - -typedef struct _IRB_REQ_GET_SPEED_TOPOLOGY_MAPS { - PSPEED_MAP SpeedMap; - PTOPOLOGY_MAP TopologyMap; -} IRB_REQ_GET_SPEED_TOPOLOGY_MAPS; - -// -// Fields necessary in order for the Bus driver to carry out a -// BusResetNotification request. -// This is the suggested method for a client driver on top of 1394bus, to get notified -// about 1394 bus resets. The client register by using this IRB, in its START_DEVICE -// routine and de-registers using the same IRB (but different flags) in its REMOVE routine -// This notification will ONLY be issued if after the bus reset, the target device is -// STILL present on the bus. This way the caller does not have to verify its existence. -// - -typedef struct _IRB_REQ_BUS_RESET_NOTIFICATION { - ULONG fulFlags; - PBUS_BUS_RESET_NOTIFICATION ResetRoutine; - PVOID ResetContext; -} IRB_REQ_BUS_RESET_NOTIFICATION; - -// -// Fields necessary in order for the Bus driver to carry out a -// AsyncStream request. -// - -typedef struct _IRB_REQ_ASYNC_STREAM { - ULONG nNumberOfBytesToStream; // Bytes to stream - ULONG fulFlags; // Flags pertinent to stream - PMDL Mdl; // Source buffer - ULONG ulTag; // Tag - ULONG nChannel; // Channel - ULONG ulSynch; // Sy - ULONG Reserved; // Reserved for future use - UCHAR nSpeed; -} IRB_REQ_ASYNC_STREAM; - -// -// IEEE 1394 Request Block definition (IRB). IRBs are the basis of how other -// device drivers communicate with the 1394 Bus driver. -// - -#define IRB_BUS_RESERVED_SZ 8 -#define IRB_PORT_RESERVED_SZ 8 - -typedef struct _IRB { - - // - // Holds the zero based Function number that corresponds to the request - // that device drivers are asking the 1394 Bus driver to carry out. - // - - ULONG FunctionNumber; - - // - // Holds Flags that may be unique to this particular operation. - // - - ULONG Flags; - - // - // Reserved for internal bus driver use and/or future expansion. - // - - ULONG_PTR BusReserved[IRB_BUS_RESERVED_SZ]; - - // - // Reserved for internal port driver usage. - // - - ULONG_PTR PortReserved[IRB_PORT_RESERVED_SZ]; - - // - // Holds the structures used in performing the various 1394 APIs. - // - - union { - - IRB_REQ_ASYNC_READ AsyncRead; - IRB_REQ_ASYNC_WRITE AsyncWrite; - IRB_REQ_ASYNC_LOCK AsyncLock; - IRB_REQ_ISOCH_ALLOCATE_BANDWIDTH IsochAllocateBandwidth; - IRB_REQ_ISOCH_ALLOCATE_CHANNEL IsochAllocateChannel; - IRB_REQ_ISOCH_ALLOCATE_RESOURCES IsochAllocateResources; - IRB_REQ_ISOCH_ATTACH_BUFFERS IsochAttachBuffers; - IRB_REQ_ISOCH_DETACH_BUFFERS IsochDetachBuffers; - IRB_REQ_ISOCH_FREE_BANDWIDTH IsochFreeBandwidth; - IRB_REQ_ISOCH_FREE_CHANNEL IsochFreeChannel; - IRB_REQ_ISOCH_FREE_RESOURCES IsochFreeResources; - IRB_REQ_ISOCH_LISTEN IsochListen; - IRB_REQ_ISOCH_QUERY_CURRENT_CYCLE_TIME IsochQueryCurrentCycleTime; - IRB_REQ_ISOCH_QUERY_RESOURCES IsochQueryResources; - IRB_REQ_ISOCH_SET_CHANNEL_BANDWIDTH IsochSetChannelBandwidth; - IRB_REQ_ISOCH_STOP IsochStop; - IRB_REQ_ISOCH_TALK IsochTalk; -#if(NTDDI_VERSION >= NTDDI_WINXP) - IRB_REQ_ISOCH_MODIFY_STREAM_PROPERTIES IsochModifyStreamProperties; -#endif - IRB_REQ_ALLOCATE_ADDRESS_RANGE AllocateAddressRange; - IRB_REQ_FREE_ADDRESS_RANGE FreeAddressRange; - IRB_REQ_GET_LOCAL_HOST_INFORMATION GetLocalHostInformation; - IRB_REQ_GET_1394_ADDRESS_FROM_DEVICE_OBJECT Get1394AddressFromDeviceObject; - IRB_REQ_CONTROL Control; - IRB_REQ_GET_MAX_SPEED_BETWEEN_DEVICES GetMaxSpeedBetweenDevices; - IRB_REQ_SET_DEVICE_XMIT_PROPERTIES SetDeviceXmitProperties; - IRB_REQ_SET_LOCAL_HOST_PROPERTIES SetLocalHostProperties; - IRB_REQ_GET_CONFIGURATION_INFORMATION GetConfigurationInformation; -#if(NTDDI_VERSION >= NTDDI_WIN7) - IRB_REQ_GET_CONFIG_ROM GetConfigRom; -#endif - IRB_REQ_BUS_RESET BusReset; - IRB_REQ_GET_GENERATION_COUNT GetGenerationCount; - IRB_REQ_SEND_PHY_CONFIGURATION_PACKET SendPhyConfigurationPacket; -#if(NTDDI_VERSION >= NTDDI_WIN7) - IRB_REQ_SEND_PHY_PACKET SendPhyPacket; - IRB_REQ_RECEIVE_PHY_PACKETS ReceivePhyPackets; -#endif - IRB_REQ_GET_SPEED_TOPOLOGY_MAPS GetSpeedTopologyMaps; - IRB_REQ_BUS_RESET_NOTIFICATION BusResetNotification; - IRB_REQ_ASYNC_STREAM AsyncStream; - - } u; - -} IRB, *PIRB; - -// -// Irb flags specified for isoch bandwidth allocations. -// - -#define IRB_FLAG_USE_PRE_CALCULATED_VALUE 1 -#define IRB_FLAG_ALLOW_REMOTE_FREE 2 - -// -// Flags for the SetPortProperties request. -// - -#define SET_LOCAL_HOST_PROPERTIES_NO_CYCLE_STARTS 0x00000001 -#if(NTDDI_VERSION >= NTDDI_WINXP) -#define SET_LOCAL_HOST_PROPERTIES_CYCLE_START_CONTROL 0x00000001 -#endif -#define SET_LOCAL_HOST_PROPERTIES_GAP_COUNT 0x00000002 -#define SET_LOCAL_HOST_PROPERTIES_MODIFY_CROM 0x00000003 -#if(NTDDI_VERSION >= NTDDI_WINXP) -#define SET_LOCAL_HOST_PROPERTIES_MAX_PAYLOAD 0x00000004 -#endif -#if(NTDDI_VERSION >= NTDDI_VISTA) -#define SET_LOCAL_HOST_PROPERTIES_DEBUG_ENTRY 0x00000005 -#endif - -// -// Definitions of the structures that correspond to the Host info levels. -// - -#if(NTDDI_VERSION >= NTDDI_WINXP) -typedef struct _SET_LOCAL_HOST_PROPS1 { - ULONG fulFlags; -} SET_LOCAL_HOST_PROPS1, *PSET_LOCAL_HOST_PROPS1; -#endif - -typedef struct _SET_LOCAL_HOST_PROPS2 { - ULONG GapCountLowerBound; -} SET_LOCAL_HOST_PROPS2, *PSET_LOCAL_HOST_PROPS2; - -// -// Definition for appending a properly formated Config Rom subsection, to -// the core config rom exposed by the PC. -// The first element of the submitted buffer must be a unit directory and any -// offset to other leafs/dir following it, must be indirect offsets from the -// beginning of the submitted buffer. -// The bus driver will then add a pointer to this unit dir, in our root directory. -// The entire supplied buffer must be in big endian with CRCs pre-calculated. -// If a driver fails to remove its added crom data, when it gets removed, the bus driver -// will do so automatically, restoring the crom image prior to this modification. -// - -typedef struct _SET_LOCAL_HOST_PROPS3 { - - ULONG fulFlags; - HANDLE hCromData; - ULONG nLength; - PMDL Mdl; - -} SET_LOCAL_HOST_PROPS3, *PSET_LOCAL_HOST_PROPS3; - -// -// Params for setting max payload size to less than the port driver -// default to assuage ill-behaved legacy devices. Valid values -// for the MaxAsyncPayloadRequested field are those corresponding -// to the ASYNC_PAYLOAD_###_RATE constants and zero (which will -// restore the port driver default values). On successful completion -// of this request the MaxAsyncPayloadResult will contain the -// updated max async payload value in use. -// -// On successful completion of this request it is the caller's -// responsibility to request a bus reset in order to propagate -// these new values to other device stacks. -// -// Failure to restore default port driver values as appropriate -// (e.g. on legacy device removal) may result in degraded bus -// performance. -// - -#if(NTDDI_VERSION >= NTDDI_WINXP) -typedef struct _SET_LOCAL_HOST_PROPS4 { - ULONG MaxAsyncPayloadRequested; - ULONG MaxAsyncPayloadResult; -} SET_LOCAL_HOST_PROPS4, *PSET_LOCAL_HOST_PROPS4; -#endif - -// -// This is used to set the extended key value that is -// used for 1394 debug. - -#if(NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _SET_LOCAL_HOST_PROPS5 { - ULONG DebugAddress; -} SET_LOCAL_HOST_PROPS5, *PSET_LOCAL_HOST_PROPS5; -#endif - -// -// Definition of Flags for SET_LOCAL_HOST_PROPERTIES_MODIFY_CROM. -// - -#define SLHP_FLAG_ADD_CROM_DATA 0x01 -#define SLHP_FLAG_REMOVE_CROM_DATA 0x02 - -// -// Definition of fulFlags in Async Read/Write/Lock requests. -// - -#define ASYNC_FLAGS_NONINCREMENTING 0x00000001 - -// -// Flag instucts the port driver to NOT take an int for checking the status -// of this transaction. Always return success. -// - -#define ASYNC_FLAGS_NO_STATUS 0x00000002 - -// -// If this flag is set the read packet is going to be used as a PING packet also. -// we are going to determine, in units of micro secs, the delay -// between Tx of the async packet and reception of ACK_PENDING or ACK_COMPLETE. -// - -#define ASYNC_FLAGS_PING 0x00000004 - -// -// When this flag is set, the bus driver will use 63 as the node id, so this message -// is broadcast to all nodes. -// - -#define ASYNC_FLAGS_BROADCAST 0x00000008 - -// -// Definition of fulAccessType for AllocateAddressRange. -// - -#define ACCESS_FLAGS_TYPE_READ 1 -#define ACCESS_FLAGS_TYPE_WRITE 2 -#define ACCESS_FLAGS_TYPE_LOCK 4 -#define ACCESS_FLAGS_TYPE_BROADCAST 8 - -// -// Definition of fulNotificationOptions for AllocateAddressRange. -// - -#define NOTIFY_FLAGS_NEVER 0 -#define NOTIFY_FLAGS_AFTER_READ 1 -#define NOTIFY_FLAGS_AFTER_WRITE 2 -#define NOTIFY_FLAGS_AFTER_LOCK 4 - -// -// Definitions of Speed flags used throughout 1394 Bus APIs. -// - -#define SPEED_FLAGS_100 0x01 -#define SPEED_FLAGS_200 0x02 -#define SPEED_FLAGS_400 0x04 -#define SPEED_FLAGS_800 0x08 -#define SPEED_FLAGS_1600 0x10 -#define SPEED_FLAGS_3200 0x20 -#define SPEED_FLAGS_FASTEST 0x80000000 - -// -// Definitions of Channel flags. -// - -#define ISOCH_ANY_CHANNEL 0xffffffff -#define ISOCH_MAX_CHANNEL 63 - -// -// Definitions of Bus Reset flags (used when Bus driver asks Port driver -// to perform a bus reset). -// - -#define BUS_RESET_FLAGS_PERFORM_RESET 1 -#define BUS_RESET_FLAGS_FORCE_ROOT 2 - -// -// Definitions of Lock transaction types. -// - -#define LOCK_TRANSACTION_MASK_SWAP 1 -#define LOCK_TRANSACTION_COMPARE_SWAP 2 -#define LOCK_TRANSACTION_FETCH_ADD 3 -#define LOCK_TRANSACTION_LITTLE_ADD 4 -#define LOCK_TRANSACTION_BOUNDED_ADD 5 -#define LOCK_TRANSACTION_WRAP_ADD 6 - - -// -// Definitions of Isoch Allocate Resources flags. -// - -#define RESOURCE_USED_IN_LISTENING 0x00000001 -#define RESOURCE_USED_IN_TALKING 0x00000002 -#define RESOURCE_BUFFERS_CIRCULAR 0x00000004 -#define RESOURCE_STRIP_ADDITIONAL_QUADLETS 0x00000008 -#define RESOURCE_TIME_STAMP_ON_COMPLETION 0x00000010 -#define RESOURCE_SYNCH_ON_TIME 0x00000020 -#define RESOURCE_USE_PACKET_BASED 0x00000040 -#define RESOURCE_VARIABLE_ISOCH_PAYLOAD 0x00000080 -#define RESOURCE_USE_MULTICHANNEL 0x00000100 - -// -// Definitions of Isoch Descriptor flags. -// - -#define DESCRIPTOR_SYNCH_ON_SY 0x00000001 -#define DESCRIPTOR_SYNCH_ON_TAG 0x00000002 -#define DESCRIPTOR_SYNCH_ON_TIME 0x00000004 -#define DESCRIPTOR_USE_SY_TAG_IN_FIRST 0x00000008 -#define DESCRIPTOR_TIME_STAMP_ON_COMPLETION 0x00000010 -#define DESCRIPTOR_PRIORITY_TIME_DELIVERY 0x00000020 -#define DESCRIPTOR_HEADER_SCATTER_GATHER 0x00000040 -#define DESCRIPTOR_SYNCH_ON_ALL_TAGS 0x00000080 - -// -// Definitions of Isoch synchronization flags. -// - -#define SYNCH_ON_SY DESCRIPTOR_SYNCH_ON_SY -#define SYNCH_ON_TAG DESCRIPTOR_SYNCH_ON_TAG -#define SYNCH_ON_TIME DESCRIPTOR_SYNCH_ON_TIME - -// -// Definitions of levels of Host controller information. -// - -#define GET_HOST_UNIQUE_ID 1 -#define GET_HOST_CAPABILITIES 2 -#define GET_POWER_SUPPLIED 3 -#define GET_PHYS_ADDR_ROUTINE 4 -#define GET_HOST_CONFIG_ROM 5 -#define GET_HOST_CSR_CONTENTS 6 -#define GET_HOST_DMA_CAPABILITIES 7 -#if(NTDDI_VERSION >= NTDDI_WIN7) -#define GET_HOST_DDI_VERSION 8 -#endif - -// -// Definitions of the structures that correspond to the Host info levels. -// - -typedef struct _GET_LOCAL_HOST_INFO1 { - LARGE_INTEGER UniqueId; -} GET_LOCAL_HOST_INFO1, *PGET_LOCAL_HOST_INFO1; - -typedef struct _GET_LOCAL_HOST_INFO2 { - ULONG HostCapabilities; - ULONG MaxAsyncReadRequest; - ULONG MaxAsyncWriteRequest; -} GET_LOCAL_HOST_INFO2, *PGET_LOCAL_HOST_INFO2; - -typedef struct _GET_LOCAL_HOST_INFO3 { - ULONG deciWattsSupplied; - ULONG Voltage; // x10 -> +3.3 == 33 - // +5.0 == 50,+12.0 == 120 - // etc. -} GET_LOCAL_HOST_INFO3, *PGET_LOCAL_HOST_INFO3; - -// l -// Physical mapping routine. -// - -typedef -__checkReturn -__drv_requiresIRQL(DISPATCH_LEVEL) -NTSTATUS -(*PPORT_PHYS_ADDR_ROUTINE) ( - __in PVOID Context, - __inout PIRB Irb - ); - -// -// Callback from Physical Mapping routine, indicating its done. -// - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PPORT_ALLOC_COMPLETE_NOTIFICATION) ( - __in PVOID Context - ); - -typedef struct _GET_LOCAL_HOST_INFO4 { - PPORT_PHYS_ADDR_ROUTINE PhysAddrMappingRoutine; - PVOID Context; -} GET_LOCAL_HOST_INFO4, *PGET_LOCAL_HOST_INFO4; - -// -// The caller can set ConfigRomLength to zero, issue the request, which will -// be failed with STATUS_INVALID_BUFFER_SIZE and the ConfigRomLength will be set -// by the port driver to the proper length. The caller can then re-issue the request -// after it has allocated a buffer for the configrom with the correct length. -// Same is true for the GET_LOCAL_HOST_INFO6 call. -// - -typedef struct _GET_LOCAL_HOST_INFO5 { - PVOID ConfigRom; - ULONG ConfigRomLength; -} GET_LOCAL_HOST_INFO5, *PGET_LOCAL_HOST_INFO5; - -typedef struct _GET_LOCAL_HOST_INFO6 { - ADDRESS_OFFSET CsrBaseAddress; - ULONG CsrDataLength; - PVOID CsrDataBuffer; -} GET_LOCAL_HOST_INFO6, *PGET_LOCAL_HOST_INFO6; - -typedef struct _GET_LOCAL_HOST_INFO7_W2K { - ULONG HostDmaCapabilities; - ULARGE_INTEGER MaxDmaBufferSize; - ULONG MaxOutstandingXmitRequests; - ULONG MaxOutstandingXmitResponses; -} GET_LOCAL_HOST_INFO7_W2K, *PGET_LOCAL_HOST_INFO7_W2K; - -typedef struct _GET_LOCAL_HOST_INFO7_WXP { - ULONG HostDmaCapabilities; - ULARGE_INTEGER MaxDmaBufferSize; -} GET_LOCAL_HOST_INFO7_WXP, *PGET_LOCAL_HOST_INFO7_WXP; - -#if(NTDDI_VERSION < NTDDI_WINXP) -typedef GET_LOCAL_HOST_INFO7_W2K GET_LOCAL_HOST_INFO7, *PGET_LOCAL_HOST_INFO7; -#else -typedef GET_LOCAL_HOST_INFO7_WXP GET_LOCAL_HOST_INFO7, *PGET_LOCAL_HOST_INFO7; -#endif - -#if(NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _GET_LOCAL_HOST_INFO8 { - USHORT MajorVersion; - USHORT MinorVersion; -} GET_LOCAL_HOST_INFO8, *PGET_LOCAL_HOST_INFO8; - -#endif - -// -// Definitions of capabilities in Host info level 2. -// - -#define HOST_INFO_PACKET_BASED 0x00000001 -#define HOST_INFO_STREAM_BASED 0x00000002 -#define HOST_INFO_SUPPORTS_ISOCH_STRIPPING 0x00000004 -#define HOST_INFO_SUPPORTS_START_ON_CYCLE 0x00000008 -#define HOST_INFO_SUPPORTS_RETURNING_ISO_HDR 0x00000010 -#define HOST_INFO_SUPPORTS_ISO_HDR_INSERTION 0x00000020 -#if(NTDDI_VERSION < NTDDI_WINXP) -#define HOST_INFO_SUPPORTS_DV_CIP_STRIPPING 0x00000040 -#else -#define HOST_INFO_SUPPORTS_ISO_DUAL_BUFFER_RX 0x00000040 -#define HOST_INFO_DMA_DOUBLE_BUFFERING_ENABLED 0x00000080 -#endif - -// -// Definitions of flags for GetMaxSpeedBetweenDevices and -// Get1394AddressFromDeviceObject. -// - -#define USE_LOCAL_NODE 1 -#define USE_SCODE_SPEED 0x00000002 - -// -// Definitions of flags for IndicationFlags in INDICATION_INFO struct. -// - -#define BUS_RESPONSE_IS_RAW 1 - -// -// Definition of flags for BusResetNotification Irb. -// - -#define REGISTER_NOTIFICATION_ROUTINE 1 -#define DEREGISTER_NOTIFICATION_ROUTINE 2 -#if(NTDDI_VERSION >= NTDDI_WIN7) -#define EXTENDED_NOTIFICATION_ROUTINE 0x00000004 -#endif - -// -// Definition of flags for AllocateAddressRange Irb. -// - -#if(NTDDI_VERSION < NTDDI_WINXP) -#define BIG_ENDIAN_ADDRESS_RANGE 1 -#else -#define ALLOCATE_ADDRESS_FLAGS_USE_BIG_ENDIAN 1 -#define ALLOCATE_ADDRESS_FLAGS_USE_COMMON_BUFFER 2 -#endif - -// -// Definitions below are included for legacy support. -// - -#define IRP_MN_BUS_RESET 0x87 - -#define DEVICE_EXTENSION_TAG 0xdeadbeef -#define VIRTUAL_DEVICE_EXTENSION_TAG 0xdeafbeef - -#define PORT_EXTENSION_TAG 0xdeafcafe -#define BUS_EXTENSION_TAG 0xabacadab -#define ISOCH_RESOURCE_TAG 0xbabeface -#define BANDWIDTH_ALLOCATE_TAG 0xfeedbead - -#define SPEED_MAP_LENGTH 0x3f1 - -// -// 1394A Network channels register format. -// - -typedef struct _NETWORK_CHANNELS { - ULONG NC_Channel:6; // bits 0-5 - ULONG NC_Reserved:18; // bits 6-23 - ULONG NC_Npm_ID:6; // bits 24-29 - ULONG NC_Valid:1; // bit 30 - ULONG NC_One:1; // bit 31 -} NETWORK_CHANNELSR, *PNETWORK_CHANNELS; - -// -// These guys are meant to be called from a ring 3 app. -// Call through the port device object. -// - -#define IOCTL_1394_TOGGLE_ENUM_TEST_ON CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x88, \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS \ - ) - -#define IOCTL_1394_TOGGLE_ENUM_TEST_OFF CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x89, \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS \ - ) - -// -// 1394 ByteSwap definitions. -// - -#if(NTDDI_VERSION < NTDDI_WINXP) -#if defined(_X86_) - -ULONG static __inline -bswap(ULONG value) -{ - __asm mov eax, value - __asm bswap eax -} -#else -#define bswap(value) RtlUlongByteSwap(value) -#endif - -#define bswapw(value) ( (((USHORT) (value)) & 0x00ff) << 8 | \ - (((USHORT) (value)) & 0xff00) >> 8) - -#else -#define bswap(value) RtlUlongByteSwap(value) -#define bswapw(value) RtlUshortByteSwap(value) -#endif - -// -// These are definitions that are only used internally to 1394. -// - -#define MAX_SUFFIX_SIZE 4*sizeof(WCHAR) - -// -// Definition of minidriver capability bits. -// - -// -// Specifies port driver has no special capabilities. -// - -#define PORT_SUPPORTS_NOTHING 0 - -// -// Specifies port driver implements the core 1394 CSRs internally. These -// may be implemented in software/hardware. When this bit is ON, all -// local read/write requests to the core CSRs are passed down to the -// port driver, and the 1394 Bus driver does not issue "listens" for -// the virtual CSR locations. If this bit is OFF, the 1394 Bus driver -// mimicks the core 1394 CSRs. The core CSRs are defined as -// Bandwidth Units, Channels Available and the entire 1k of ConfigROM. -// - -#define PORT_SUPPORTS_CSRS 1 - -// -// Specifies port driver implements large Async Read/Write requests. -// If this bit is ON, the 1394 Bus driver will NOT chop up Async requests -// based on speed constraints (i.e. 512 bytes at 100Mbps, 1024 bytes at -// 200Mbps, etc.). Otherwise the 1394 Bus driver WILL chop up large -// requests into speed constrained sizes before handing them to the port -// driver. -// - -#define PORT_SUPPORTS_LARGE_ASYNC 2 - -// -// Specifies port driver indicates packet headers to the bus driver in the -// native format of the bus driver (as defined by the structs in this file. -// If this capability bit is turned on, the bus driver will not need to byte -// swap headers to get the packet headers in the right format before acting -// on them. This bit is used on indication or reception of packets only, as -// the bus driver doesn't try to assemble packet headers on transmission. -// - -#define PORT_SUPPORTS_NATIVE_ENDIAN 4 - -#if(NTDDI_VERSION >= NTDDI_WINXP) -// -// if present port driver supports WMI. -// - -#define PORT_SUPPORTS_WMI 8 -#endif - -// -// Definitions of Bus Reset informative states. -// - -#define BUS_RESET_BEGINNING 0x00000001 -#define BUS_RESET_FINISHED 0x00000002 -#define BUS_RESET_LOCAL_NODE_IS_ROOT 0x00000004 -#define BUS_RESET_LOCAL_NODE_IS_ISOCH_MANAGER 0x00000008 -#define BUS_RESET_LOCAL_NODE_IS_BUS_MANAGER 0x00000010 -#define BUS_RESET_SELFID_ENUMERATION_ERROR 0x00000020 -#define BUS_RESET_STORM_ERROR 0x00000040 -#define BUS_RESET_ABSENT_ON_POWER_UP 0x00000080 -#define BUS_RESET_UNOPTIMIZED_TOPOLOGY 0x00000100 - - -// -// Device Extension common to all nodes that the 1394 Bus driver -// created when it enumerated the bus and found a new unique node. -// - -typedef struct _NODE_DEVICE_EXTENSION { - - // - // Holds Tag to determine if this is really a "Node" Device Extension. - // - - ULONG Tag; - - // - // Holds the flag as to whether or not we've read the configuration - // information out of this device. - // - - BOOLEAN bConfigurationInformationValid; - - // - // Holds the Configuration Rom for this device. Multi-functional - // devices (i.e. many units) will share this same Config Rom - // structure, but they are represented as a different Device Object. - // This is not the entire Config Rom, but does contain the root directory - // as well as everything in front of it. - // - - PCONFIG_ROM ConfigRom; - - // - // Holds the length of the UnitDirectory pointer. - // - - ULONG UnitDirectoryLength; - - // - // Holds the Unit Directory for this device. Even on multi-functional - // devices (i.e. many units) this should be unique to each Device Object. - // - - PVOID UnitDirectory; - - // - // Holds the Unit Directory location for this device. Only the lower 48 - // bits are valid in this IO_ADDRESS. Useful for computing offsets from - // within the UnitDirectory as all offsets are relative. - // - - IO_ADDRESS UnitDirectoryLocation; - - // - // Holds the length of the UnitDependentDirectory pointer. - // - - ULONG UnitDependentDirectoryLength; - - // - // Holds the Unit Dependent directory for this device. - // - - PVOID UnitDependentDirectory; - - // - // Holds the Unit Dependent Directory location for this device. Only the - // lower 48 bits are valid in this IO_ADDRESS. Useful for computing - // offsets from within the UnitDependentDirectory as offsets are relative. - // - - IO_ADDRESS UnitDependentDirectoryLocation; - - // - // Holds the length of the VendorLeaf pointer. - // - - ULONG VendorLeafLength; - - // - // Holds the pointer to the Vendor Leaf information - // - - PTEXTUAL_LEAF VendorLeaf; - - // - // Holds the length of the VendorLeaf pointer. - // - - ULONG ModelLeafLength; - - // - // Holds the pointer to the Model Leaf information. - // - - PTEXTUAL_LEAF ModelLeaf; - - // - // Holds the 1394 10 bit BusId / 6 bit NodeId structure. - // - - NODE_ADDRESS NodeAddress; - - // - // Holds the speed to be used in reaching this device. - // - - UCHAR Speed; - - // - // Holds the priority at which to send packets. - // - - UCHAR Priority; - - // - // Holds the Irp used to notify this device object about events. - // - - PIRP Irp; - - // - // Holds the Device Object that this Device Extension hangs off of. - // - - PDEVICE_OBJECT DeviceObject; - - // - // Holds the Port Device Object that this Device hangs off of. - // - - PDEVICE_OBJECT PortDeviceObject; - - // - // Holds the pointer to corresponding information about this deivce - // in the bus driver's head. - // - - PVOID DeviceInformation; - - // - // Holds the pointer to the bus reset notification routine (if any). - // - - PBUS_BUS_RESET_NOTIFICATION ResetRoutine; - - // - // Holds the pointer to the context the client wanted when bus reset occurs. - // - - PVOID ResetContext; - -} NODE_DEVICE_EXTENSION, *PNODE_DEVICE_EXTENSION; - -// -// Definition of Bandwidth allocation structure. -// - -typedef struct _BANDWIDTH_ALLOCATION { - - // - // Holds the list of allocation entries. - // - - LIST_ENTRY AllocationList; - - // - // Holds the tag of this structure. - // - - ULONG Tag; - - // - // Holds the Bandwidth units that this allocation owns. - // - - ULONG OwnedUnits; - - // - // Holds the speed at which this bandwidth was allocated. - // - - ULONG fulSpeed; - - // - // Holds whether or not this was a local or remote allocation. - // - - BOOLEAN bRemoteAllocation; - - // - // Holds the generation of the bus when this bandwidth was secured. - // - - ULONG Generation; - - // - // Holds the owner of this allocation. - // - - PNODE_DEVICE_EXTENSION DeviceExtension; - -} BANDWIDTH_ALLOCATION, *PBANDWIDTH_ALLOCATION; - - -#ifdef __cplusplus -} -#endif - -#endif // _1394_H_ - diff --git a/qt-correction-tool/pub/ddk/61883.h b/qt-correction-tool/pub/ddk/61883.h deleted file mode 100644 index e53eca3..0000000 --- a/qt-correction-tool/pub/ddk/61883.h +++ /dev/null @@ -1,1101 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - 61883.h - -Abstract: - - The public header for clients of the 61883 Class. - -Author: - - WGJ - PSB - ---*/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -// -// Class GUID -// -// {7EBEFBC0-3200-11d2-B4C2-00A0C9697D07} -DEFINE_GUID(GUID_61883_CLASS, 0x7ebefbc0, 0x3200, 0x11d2, 0xb4, 0xc2, 0x0, 0xa0, 0xc9, 0x69, 0x7d, 0x7); - -// -// IOCTL Definitions -// -#define IOCTL_61883_CLASS CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x91, \ - METHOD_IN_DIRECT, \ - FILE_ANY_ACCESS \ - ) - - -// -// Current 61883 DDI Version -// -#if (NTDDI_VERSION >= NTDDI_VISTA) - -#define CURRENT_61883_DDI_VERSION 0x4 - -#elif ((NTDDI_VERSION >= NTDDI_WINS03SP1) || \ - ((NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WINS03))) - -#define CURRENT_61883_DDI_VERSION 0x3 - -#elif (NTDDI_VERSION >= NTDDI_WINXP) - -#define CURRENT_61883_DDI_VERSION 0x2 - -#endif // NTDDI_VERSION - -// -// INIT_61883_HEADER Macro -// -#define INIT_61883_HEADER( Av61883, Request ) \ - (Av61883)->Function = Request; \ - (Av61883)->Version = CURRENT_61883_DDI_VERSION; - -// -// 61883 I/O Request Functions -// -enum { - - Av61883_GetUnitInfo, - Av61883_SetUnitInfo, - - Av61883_SetPlug, - Av61883_GetPlugHandle, - Av61883_GetPlugState, - Av61883_Connect, - Av61883_Disconnect, - - Av61883_AttachFrame, - Av61883_CancelFrame, - Av61883_Talk, - Av61883_Listen, - Av61883_Stop, - - Av61883_SendFcpRequest, - Av61883_GetFcpResponse, - - Av61883_GetFcpRequest, - Av61883_SendFcpResponse, - - Av61883_SetFcpNotify, - - Av61883_CreatePlug, - Av61883_DeletePlug, - - Av61883_BusResetNotify, - Av61883_BusReset, - - Av61883_SetUnitDirectory, - - Av61883_MonitorPlugs, - - Av61883_MAX -}; - -// -// Plug States -// -#define CMP_PLUG_STATE_IDLE 0 -#define CMP_PLUG_STATE_READY 1 -#define CMP_PLUG_STATE_SUSPENDED 2 -#define CMP_PLUG_STATE_ACTIVE 3 - -// -// Connect Speeds (not the same as 1394 speed flags!!) -// -#define CMP_SPEED_S100 0x00 -#define CMP_SPEED_S200 0x01 -#define CMP_SPEED_S400 0x02 - -// -// CIP Frame Flags -// -#define CIP_VALIDATE_FIRST_SOURCE 0x00000001 -#define CIP_VALIDATE_ALL_SOURCE 0x00000002 -#define CIP_STRIP_SOURCE_HEADER 0x00000004 -#define CIP_USE_SOURCE_HEADER_TIMESTAMP 0x00000008 -#define CIP_DV_STYLE_SYT 0x00000010 -#define CIP_AUDIO_STYLE_SYT 0x00000020 -#define CIP_RESET_FRAME_ON_DISCONTINUITY 0x00000040 -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define CIP_DTCP_ISOCH_HEADER 0x00000080 -#endif - -// -// CIP Status Codes -// -#define CIP_STATUS_SUCCESS 0x00000000 -#define CIP_STATUS_CORRUPT_FRAME 0x00000001 -#define CIP_STATUS_FIRST_FRAME 0x00000002 - -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define CIP_STATUS_EVEN_BIT 0x00000010 -#define CIP_STATUS_ODD_BIT 0x00000020 - -#define CIP_STATUS_EMI_COPY_FREE 0x00000100 -#define CIP_STATUS_EMI_NO_MORE_COPIES 0x00000200 -#define CIP_STATUS_EMI_COPY_ONE_GENERATION 0x00000400 -#define CIP_STATUS_EMI_COPY_NEVER 0x00000800 -#endif - -// -// CIP Talk Flags -// -#define CIP_TALK_USE_SPH_TIMESTAMP 0x00000001 -#define CIP_TALK_DOUBLE_BUFFER 0x00000002 -#if ((NTDDI_VERSION >= NTDDI_WINS03SP1) || \ - ((NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WINS03))) -#define CIP_TALK_BLOCKING_MODE 0x00000004 -#endif // NTDDI_VERSION - -// -// Plug Location -// -typedef enum { - CMP_PlugLocal = 0, - CMP_PlugRemote -} CMP_PLUG_LOCATION; - -// -// Plug Type -// -typedef enum { - CMP_PlugOut = 0, // oPCR - CMP_PlugIn // iPCR -} CMP_PLUG_TYPE; - -// -// Connect Type -// -typedef enum { - CMP_Broadcast = 0, - CMP_PointToPoint -} CMP_CONNECT_TYPE; - -typedef struct _OPCR { - ULONG Payload:10; - ULONG OverheadID:4; - ULONG DataRate:2; - ULONG Channel:6; - ULONG Reserved:2; - ULONG PPCCounter:6; - ULONG BCCCounter:1; - ULONG OnLine:1; -} OPCR, *POPCR; - -typedef struct _IPCR { - ULONG Reserved0:16; - ULONG Channel:6; - ULONG Reserved1:2; - ULONG PPCCounter:6; - ULONG BCCCounter:1; - ULONG OnLine:1; -} IPCR, *PIPCR; - -typedef struct _AV_PCR { - union { - OPCR oPCR; - IPCR iPCR; - ULONG ulongData; - }; -} AV_PCR, *PAV_PCR; - -// -// Client Request Structures -// - -// -// Local or Device Unit Info -// -#define RETRIEVE_DEVICE_UNIT_INFO 0x00000000 // Retrieve Info from Device -#define RETRIEVE_LOCAL_UNIT_INFO 0x00000001 // Retrieve Info from Local Node - -// -// DiagLevel's used for controlling various behavior -// -#define DIAGLEVEL_NONE 0x00000000 // Nothing. -#define DIAGLEVEL_IGNORE_OPLUG 0x00000001 // Will not program the oPCR -#define DIAGLEVEL_IGNORE_IPLUG 0x00000002 // Will not program the iPCR -#define DIAGLEVEL_SET_CHANNEL_63 0x00000004 // Resets channel to 63 when oPCR/iPCR is disconnected -#define DIAGLEVEL_IPCR_IGNORE_FREE 0x00000008 // Will not free isoch resources when iPCR is disconnected - // and local oPCR is not specified -#define DIAGLEVEL_HIDE_OPLUG 0x00000010 // Hides the oMPR & oPCR in an exclusive address range -#define DIAGLEVEL_IPCR_ALWAYS_ALLOC 0x00000020 // Will always allocate when connecting to iPCR with no - // oPCR specified, regardless if iPCR has existing connection -#define DIAGLEVEL_SPECIFY_BLOCKSIZE 0x00000040 // This flag is specified when we detect an invalid max_rec or - // want to specify the block size. If this flag is set, all async - // transactions will be transmitted upto 512 byte blocks (S100) - -// -// GetUnitInfo nLevel's -// -#define GET_UNIT_INFO_IDS 0x00000001 // Retrieves IDs of Unit -#define GET_UNIT_INFO_CAPABILITIES 0x00000002 // Retrieves Capabilities of Unit -#define GET_UNIT_INFO_ISOCH_PARAMS 0x00000003 // Retrieves parameters for isoch -#define GET_UNIT_BUS_GENERATION_NODE 0x00000004 // Retrieves current generation/node -#define GET_UNIT_DDI_VERSION 0x00000005 // Retrieves 61883 DDI Version -#define GET_UNIT_DIAG_LEVEL 0x00000006 // Retrieves the currently set DiagLevel flags - -// -// Hardware Flags -// -#define AV_HOST_DMA_DOUBLE_BUFFERING_ENABLED 0x00000001 - -typedef struct _GET_UNIT_IDS { - - // - // UniqueID - // - OUT LARGE_INTEGER UniqueID; - - // - // VendorID - // - OUT ULONG VendorID; - - // - // ModelID - // - OUT ULONG ModelID; - - // - // VendorText Length - // - OUT ULONG ulVendorLength; - - // - // VendorText String - // - OUT PWSTR VendorText; - - // - // ModelText Length - // - OUT ULONG ulModelLength; - - // - // ModelText String - // - OUT PWSTR ModelText; - - // - // UnitModelID - // - OUT ULONG UnitModelID; - - // - // UnitModelText Length - // - OUT ULONG ulUnitModelLength; - - // - // UnitModelText String - // - OUT PWSTR UnitModelText; - -} GET_UNIT_IDS, *PGET_UNIT_IDS; - -typedef struct _GET_UNIT_CAPABILITIES { - - // - // Number of Output Plugs supported by device - // - OUT ULONG NumOutputPlugs; - - // - // Number of Input Plugs supported by device - // - OUT ULONG NumInputPlugs; - - // - // MaxDataRate - // - OUT ULONG MaxDataRate; - - // - // CTS Flags - // - OUT ULONG CTSFlags; - - // - // Hardware Flags - // - OUT ULONG HardwareFlags; - -} GET_UNIT_CAPABILITIES, *PGET_UNIT_CAPABILITIES; - -// -// UnitIsochParams -// -typedef struct _UNIT_ISOCH_PARAMS { - - IN OUT ULONG RX_NumPackets; - - IN OUT ULONG RX_NumDescriptors; - - IN OUT ULONG TX_NumPackets; - - IN OUT ULONG TX_NumDescriptors; - -} UNIT_ISOCH_PARAMS, *PUNIT_ISOCH_PARAMS; - -// -// Unit Generation/Node Info -// -typedef struct _BUS_GENERATION_NODE { - - OUT ULONG GenerationCount; - - OUT NODE_ADDRESS LocalNodeAddress; - - OUT NODE_ADDRESS DeviceNodeAddress; - -} BUS_GENERATION_NODE, *PBUS_GENERATION_NODE; - -// -// Unit DDI Version -// -typedef struct _UNIT_DDI_VERSION { - - OUT ULONG Version; - -} UNIT_DDI_VERSION, *PUNIT_DDI_VERSION; - -// -// UnitDiagLevel -// -typedef struct _UNIT_DIAG_LEVEL { - - IN ULONG DiagLevel; - -} UNIT_DIAG_LEVEL, *PUNIT_DIAG_LEVEL; - -// -// GetUnitInfo -// -typedef struct _GET_UNIT_INFO { - - IN ULONG nLevel; - - IN OUT PVOID Information; - -} GET_UNIT_INFO, *PGET_UNIT_INFO; - -// -// SetUnitInfo nLevel's -// -#define SET_UNIT_INFO_DIAG_LEVEL 0x00000001 // Sets the diag level for 61883 -#define SET_UNIT_INFO_ISOCH_PARAMS 0x00000002 // Sets the parameters for isoch -#define SET_CMP_ADDRESS_RANGE_TYPE 0x00000003 // Sets the type of CMP address range - -// -// CMP Address Range Type -// -#define CMP_ADDRESS_TYPE_GLOBAL 0x00000001 // Global CMP for this instance - default -#define CMP_ADDRESS_TYPE_EXCLUSIVE 0x00000002 // Exclusive CMP for this instance - -// -// SetCmpAddressRange -// -typedef struct _SET_CMP_ADDRESS_TYPE { - - IN ULONG Type; - -} SET_CMP_ADDRESS_TYPE, *PSET_CMP_ADDRESS_TYPE; - -// -// SetUnitInfo -// -typedef struct _SET_UNIT_INFO { - - IN ULONG nLevel; - - IN OUT PVOID Information; - -} SET_UNIT_INFO, *PSET_UNIT_INFO; - -// -// GetPlugHandle -// -typedef struct _CMP_GET_PLUG_HANDLE { - - // - // Requested Plug Number - // - IN ULONG PlugNum; - - // - // Requested Plug Type - // - IN CMP_PLUG_TYPE Type; - - // - // Returned Plug Handle - // - OUT HANDLE hPlug; - -} CMP_GET_PLUG_HANDLE, *PCMP_GET_PLUG_HANDLE; - -// -// GetPlugState -// -typedef struct _CMP_GET_PLUG_STATE { - - // - // Plug Handle - // - IN HANDLE hPlug; - - // - // Current State - // - OUT ULONG State; - - // - // Current Data Rate - // - OUT ULONG DataRate; - - // - // Current Payload Size - // - OUT ULONG Payload; - - // - // Number of Broadcast Connections - // - OUT ULONG BC_Connections; - - // - // Number of Point to Point Connections - // - OUT ULONG PP_Connections; - -} CMP_GET_PLUG_STATE, *PCMP_GET_PLUG_STATE; - -#if ((NTDDI_VERSION >= NTDDI_WINS03SP1) || \ - ((NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WINS03))) -// -// CipDataFormat definitions for BlockPeriod/BlockPeriodRemainder -// - -// 61883-2,3,5 - DVCR - 525-60 system -#define CDF_DVCR_525_60_BLOCK_PERIOD 3280 -#define CDF_DVCR_525_60_BLOCK_PERIOD_REMAINDER 76800000 - -// 61883-2,3,5 - DVCR - 625-50 system -#define CDF_DVCR_625_50_BLOCK_PERIOD 3276 -#define CDF_DVCR_625_50_BLOCK_PERIOD_REMAINDER 800000000 -#endif // NTDDI_VERSION - -// -// CipDataFormat -// -typedef struct _CIP_DATA_FORMAT_VER3 { - - // - // FMT and FDF either known, or discovered - // via AV/C command - // - UCHAR FMT; - UCHAR FDF_hi; - UCHAR FDF_mid; - UCHAR FDF_lo; - - // - // SPH as defined by IEC-61883 - // - BOOLEAN bHeader; - - // - // QPC as defined by IEC-61883 - // - UCHAR Padding; - - // - // DBS as defined by IEC-61883 - // - UCHAR BlockSize; - - // - // FN as defined by IEC-61883 - // - UCHAR Fraction; - - // - // The number of 1394 ticks to send a data block - // - IN ULONG BlockPeriod; - - // - // The remainder of 1394 ticks to send a data block - // - IN ULONG BlockPeriodRemainder; - - // - // Number of BlocksPerPacket - used for blocking mode only - // - IN ULONG BlocksPerPacket; - -} CIP_DATA_FORMAT_VER3, *PCIP_DATA_FORMAT_VER3; - -// CIP Data Format - located in CMP_CONNECT_VER2 -typedef struct _CIP_DATA_FORMAT_VER2 { - UCHAR FMT; - UCHAR FDF_hi; - UCHAR FDF_mid; - UCHAR FDF_lo; - BOOLEAN bHeader; - UCHAR Padding; - UCHAR BlockSize; - UCHAR Fraction; - IN ULONG BlockPeriod; -} CIP_DATA_FORMAT_VER2, *PCIP_DATA_FORMAT_VER2; - -// -// Connect -// -typedef struct _CMP_CONNECT_VER3 { - - // - // Output Plug Handle - // - IN HANDLE hOutputPlug; - - // - // Input Plug Handle - // - IN HANDLE hInputPlug; - - // - // Requested Connect Type - // - IN CMP_CONNECT_TYPE Type; - - // - // Requested Data Format - TX Only - // - IN CIP_DATA_FORMAT_VER3 Format; - - // - // Returned Connect Handle - // - OUT HANDLE hConnect; - -} CMP_CONNECT_VER3, *PCMP_CONNECT_VER3; - -// CMP Connect Request Structure -typedef struct _CMP_CONNECT_VER2 { - IN HANDLE hOutputPlug; - IN HANDLE hInputPlug; - IN CMP_CONNECT_TYPE Type; - IN CIP_DATA_FORMAT_VER2 Format; - OUT HANDLE hConnect; -} CMP_CONNECT_VER2, *PCMP_CONNECT_VER2; - -#if ((NTDDI_VERSION >= NTDDI_WINS03SP1) || \ - ((NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WINS03))) - -typedef CIP_DATA_FORMAT_VER3 CIP_DATA_FORMAT, *PCIP_DATA_FORMAT; -typedef CMP_CONNECT_VER3 CMP_CONNECT, *PCMP_CONNECT; - -#elif - -typedef CIP_DATA_FORMAT_VER2 CIP_DATA_FORMAT, *PCIP_DATA_FORMAT; -typedef CMP_CONNECT_VER2 CMP_CONNECT, *PCMP_CONNECT; - -#endif // NTDDI_VERSION - -// -// Disconnect -// -typedef struct _CMP_DISCONNECT { - - // - // Connect Handle to Disconnect - // - IN HANDLE hConnect; - -} CMP_DISCONNECT, *PCMP_DISCONNECT; - -// -// CIP Frame typedef -// -typedef struct _CIP_FRAME CIP_FRAME, *PCIP_FRAME; - -// -// ValidateInfo Struct. returned on pfnValidate. -// -typedef struct _CIP_VALIDATE_INFO { - - // - // Connection Handle - // - HANDLE hConnect; - - // - // Validate Context - // - PVOID Context; - - // - // TimeStamp for current source packet - // - CYCLE_TIME TimeStamp; - - // - // Packet offset for current source packet - // - PUCHAR Packet; - -} CIP_VALIDATE_INFO, *PCIP_VALIDATE_INFO; - -// -// NotifyInfo Struct. returned on pfnNotify -// -typedef struct _CIP_NOTIFY_INFO { - - // - // Connection Handle - // - HANDLE hConnect; - - // - // Notify Context - // - PVOID Context; - - // - // Frame - // - PCIP_FRAME Frame; - -} CIP_NOTIFY_INFO, *PCIP_NOTIFY_INFO; - -// -// Validate & Notify Routines -// -typedef -__checkReturn -__drv_requiresIRQL(DISPATCH_LEVEL) -ULONG -(*PCIP_VALIDATE_ROUTINE) ( - __in PCIP_VALIDATE_INFO ValidateInfo - ); - -typedef -__checkReturn -__drv_requiresIRQL(DISPATCH_LEVEL) -ULONG -(*PCIP_NOTIFY_ROUTINE) ( - __in PCIP_NOTIFY_INFO NotifyInfo - ); - -// -// CIP Frame Struct -// -struct _CIP_FRAME { - - union { - IN PVOID Reserved; - IN PVOID pNext; - }; - - IN ULONG Flags; - - IN PCIP_VALIDATE_ROUTINE pfnValidate; - - IN PVOID ValidateContext; - - IN PCIP_NOTIFY_ROUTINE pfnNotify; - - IN PVOID NotifyContext; - - OUT CYCLE_TIME Timestamp; - - OUT ULONG Status; - - IN OUT PUCHAR Packet; - - OUT ULONG CompletedBytes; - -}; - -// -// CIP Attach Frame Structure -// -typedef struct _CIP_ATTACH_FRAME { - - HANDLE hConnect; - - ULONG FrameLength; - - ULONG SourceLength; - - PCIP_FRAME Frame; - -} CIP_ATTACH_FRAME, *PCIP_ATTACH_FRAME; - -// -// CIP Cancel Frame Structure -// -typedef struct _CIP_CANCEL_FRAME { - - IN HANDLE hConnect; - - IN PCIP_FRAME Frame; - -} CIP_CANCEL_FRAME, *PCIP_CANCEL_FRAME; - -// -// CIP Talk Structure -// -typedef struct _CIP_TALK { - - // - // Connect Handle - // - IN HANDLE hConnect; - -} CIP_TALK, *PCIP_TALK; - -// -// CIP Listen Structure -// -typedef struct _CIP_LISTEN { - - // - // Connect Handle - // - IN HANDLE hConnect; - -} CIP_LISTEN, *PCIP_LISTEN; - -// -// CIP Stop Structure -// -typedef struct _CIP_STOP { - - // - // Connect Handle - // - IN HANDLE hConnect; - -} CIP_STOP, *PCIP_STOP; - -// -// FCP Frame Format -// -typedef struct _FCP_FRAME { - UCHAR ctype:4; - UCHAR cts:4; - UCHAR payload[511]; -} FCP_FRAME, *PFCP_FRAME; - -// Legacy FCP structs -typedef struct _FCP_SEND_REQUEST FCP_REQUEST, *PFCP_REQUEST; -typedef struct _FCP_GET_RESPONSE FCP_RESPONSE, *PFCP_RESPONSE; - -// -// FCP Send Request Structure -// -typedef struct _FCP_SEND_REQUEST { - IN NODE_ADDRESS NodeAddress; - IN ULONG Length; - IN PFCP_FRAME Frame; -} FCP_SEND_REQUEST, *PFCP_SEND_REQUEST; - -// -// FCP Get Response Structure -// -typedef struct _FCP_GET_RESPONSE { - OUT NODE_ADDRESS NodeAddress; - IN OUT ULONG Length; - IN OUT PFCP_FRAME Frame; -} FCP_GET_RESPONSE, *PFCP_GET_RESPONSE; - -// -// FCP Get Request Structure -// -typedef struct _FCP_GET_REQUEST { - OUT NODE_ADDRESS NodeAddress; - IN OUT ULONG Length; - IN OUT PFCP_FRAME Frame; -} FCP_GET_REQUEST, *PFCP_GET_REQUEST; - -// -// FCP Send Response Structure -// -typedef struct _FCP_SEND_RESPONSE { - IN NODE_ADDRESS NodeAddress; - IN ULONG Length; - IN PFCP_FRAME Frame; -} FCP_SEND_RESPONSE, *PFCP_SEND_RESPONSE; - -// -// Set FCP Notify Flags -// -#define DEREGISTER_FCP_NOTIFY 0x00000000 - -#define REGISTER_FCP_RESPONSE_NOTIFY 0x00000001 -#define REGISTER_FCP_REQUEST_NOTIFY 0x00000002 - -// -// Set FCP Notify Structure -// -typedef struct _SET_FCP_NOTIFY { - - // - // Flags - // - IN ULONG Flags; - - // - // Node Address - // - IN NODE_ADDRESS NodeAddress; - -} SET_FCP_NOTIFY, *PSET_FCP_NOTIFY; - -// -// Plug Notify Routine -// -typedef struct _CMP_NOTIFY_INFO { - - HANDLE hPlug; - - AV_PCR Pcr; - - PVOID Context; - -} CMP_NOTIFY_INFO, *PCMP_NOTIFY_INFO; - -// -// Plug Notify Routine -// -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PCMP_NOTIFY_ROUTINE) ( - __in PCMP_NOTIFY_INFO NotifyInfo - ); - -// -// CreatePlug -// -typedef struct _CMP_CREATE_PLUG { - - // Type of plug to create - IN CMP_PLUG_TYPE PlugType; - - // PCR Settings - IN AV_PCR Pcr; - - // Notification Routine for Register - IN PCMP_NOTIFY_ROUTINE pfnNotify; - - // Notification Context - IN PVOID Context; - - // Plug Number - OUT ULONG PlugNum; - - // Plug Handle - OUT HANDLE hPlug; - -} CMP_CREATE_PLUG, *PCMP_CREATE_PLUG; - -// -// DeletePlug -// -typedef struct _CMP_DELETE_PLUG { - - // Plug Handle - IN HANDLE hPlug; - -} CMP_DELETE_PLUG, *PCMP_DELETE_PLUG; - -// -// SetPlug -// -typedef struct _CMP_SET_PLUG { - - // Plug Handle - IN HANDLE hPlug; - - // PCR Settings - IN AV_PCR Pcr; - -} CMP_SET_PLUG, *PCMP_SET_PLUG; - -// -// Bus Reset Notify Routine -// -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PBUS_RESET_ROUTINE) ( - __in PVOID Context, - __in PBUS_GENERATION_NODE BusResetInfo - ); - -#define REGISTER_BUS_RESET_NOTIFY 0x1 -#define DEREGISTER_BUS_RESET_NOTIFY 0x2 - -// -// BusResetNotify -// -typedef struct _BUS_RESET_NOTIFY { - - IN ULONG Flags; - - IN PBUS_RESET_ROUTINE pfnNotify; - - IN PVOID Context; - -} BUS_RESET_NOTIFY, *PBUS_RESET_NOTIFY; - -// -// Flags for Av61883_SetUnitDirectory -// -#define ADD_UNIT_DIRECTORY_ENTRY 0x1 -#define REMOVE_UNIT_DIRECTORY_ENTRY 0x2 -#define ISSUE_BUS_RESET_AFTER_MODIFY 0x4 - -// -// Set Unit Directory -// -typedef struct _SET_UNIT_DIRECTORY { - - IN ULONG Flags; - - IN ULONG UnitSpecId; - - IN ULONG UnitSwVersion; - - IN OUT HANDLE hCromEntry; - -} SET_UNIT_DIRECTORY, *PSET_UNIT_DIRECTORY; - -// -// States for Monitoring Plugs -// -#define MONITOR_STATE_CREATED 0x00000001 // Plug Created -#define MONITOR_STATE_REMOVED 0x00000002 // Plug Removed -#define MONITOR_STATE_UPDATED 0x00000004 // Plug Contents Updated - -// -// Monitor Plugs Notify Routine -// -typedef struct _CMP_MONITOR_INFO { - - ULONG State; - - ULONG PlugNum; - - ULONG PlugType; - - AV_PCR Pcr; - - PVOID Context; - -} CMP_MONITOR_INFO, *PCMP_MONITOR_INFO; - -typedef -__drv_requiresIRQL(DISPATCH_LEVEL) -void -(*PCMP_MONITOR_ROUTINE) ( - __in PCMP_MONITOR_INFO MonitorInfo - ); - -// -// Flags for Av61883_MonitorPlugs -// -#define REGISTER_MONITOR_PLUG_NOTIFY 0x1 -#define DEREGISTER_MONITOR_PLUG_NOTIFY 0x2 - -// -// MonitorPlugs (Local only) -// -typedef struct _CMP_MONITOR_PLUGS { - - IN ULONG Flags; - - IN PCMP_MONITOR_ROUTINE pfnNotify; - - IN PVOID Context; - -} CMP_MONITOR_PLUGS, *PCMP_MONITOR_PLUGS; - -// -// Av61883 Struct -// -typedef struct _AV_61883_REQUEST { - - // - // Requested Function - // - ULONG Function; - - // - // Selected DDI Version - // - ULONG Version; - - // - // Flags - // - ULONG Flags; - - union { - - GET_UNIT_INFO GetUnitInfo; - SET_UNIT_INFO SetUnitInfo; - - CMP_GET_PLUG_HANDLE GetPlugHandle; - CMP_GET_PLUG_STATE GetPlugState; - CMP_CONNECT Connect; - CMP_DISCONNECT Disconnect; - - CIP_ATTACH_FRAME AttachFrame; - CIP_CANCEL_FRAME CancelFrame; - CIP_TALK Talk; - CIP_LISTEN Listen; - CIP_STOP Stop; - - FCP_REQUEST Request; // Legacy - FCP_RESPONSE Response; // Legacy - - FCP_SEND_REQUEST SendRequest; - FCP_GET_RESPONSE GetResponse; - - FCP_GET_REQUEST GetRequest; - FCP_SEND_RESPONSE SendResponse; - - SET_FCP_NOTIFY SetFcpNotify; - - CMP_CREATE_PLUG CreatePlug; - CMP_DELETE_PLUG DeletePlug; - CMP_SET_PLUG SetPlug; - - BUS_RESET_NOTIFY BusResetNotify; - - SET_UNIT_DIRECTORY SetUnitDirectory; - - CMP_MONITOR_PLUGS MonitorPlugs; - }; -} AV_61883_REQUEST, *PAV_61883_REQUEST; - -#endif // NTDDI_VERSION >= NTDDI_WINXP - - diff --git a/qt-correction-tool/pub/ddk/ExDispid.h b/qt-correction-tool/pub/ddk/ExDispid.h deleted file mode 100644 index 5e850a0..0000000 --- a/qt-correction-tool/pub/ddk/ExDispid.h +++ /dev/null @@ -1,170 +0,0 @@ -#ifndef EXDISPID_H_ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: exdispid.h -// -//-------------------------------------------------------------------------- - - -// -// Dispatch IDS for IExplorer Dispatch Events. -// -#define DISPID_BEFORENAVIGATE 100 // this is sent before navigation to give a chance to abort -#define DISPID_NAVIGATECOMPLETE 101 // in async, this is sent when we have enough to show -#define DISPID_STATUSTEXTCHANGE 102 -#define DISPID_QUIT 103 -#define DISPID_DOWNLOADCOMPLETE 104 -#define DISPID_COMMANDSTATECHANGE 105 -#define DISPID_DOWNLOADBEGIN 106 -#define DISPID_NEWWINDOW 107 // sent when a new window should be created -#define DISPID_PROGRESSCHANGE 108 // sent when download progress is updated -#define DISPID_WINDOWMOVE 109 // sent when main window has been moved -#define DISPID_WINDOWRESIZE 110 // sent when main window has been sized -#define DISPID_WINDOWACTIVATE 111 // sent when main window has been activated -#define DISPID_PROPERTYCHANGE 112 // sent when the PutProperty method is called -#define DISPID_TITLECHANGE 113 // sent when the document title changes -#define DISPID_TITLEICONCHANGE 114 // sent when the top level window icon may have changed. - -#define DISPID_FRAMEBEFORENAVIGATE 200 -#define DISPID_FRAMENAVIGATECOMPLETE 201 -#define DISPID_FRAMENEWWINDOW 204 - -#define DISPID_BEFORENAVIGATE2 250 // hyperlink clicked on -#define DISPID_NEWWINDOW2 251 -#define DISPID_NAVIGATECOMPLETE2 252 // UIActivate new document -#define DISPID_ONQUIT 253 -#define DISPID_ONVISIBLE 254 // sent when the window goes visible/hidden -#define DISPID_ONTOOLBAR 255 // sent when the toolbar should be shown/hidden -#define DISPID_ONMENUBAR 256 // sent when the menubar should be shown/hidden -#define DISPID_ONSTATUSBAR 257 // sent when the statusbar should be shown/hidden -#define DISPID_ONFULLSCREEN 258 // sent when kiosk mode should be on/off -#define DISPID_DOCUMENTCOMPLETE 259 // new document goes ReadyState_Complete -#define DISPID_ONTHEATERMODE 260 // sent when theater mode should be on/off -#define DISPID_ONADDRESSBAR 261 // sent when the address bar should be shown/hidden -#define DISPID_WINDOWSETRESIZABLE 262 // sent to set the style of the host window frame -#define DISPID_WINDOWCLOSING 263 // sent before script window.close closes the window -#define DISPID_WINDOWSETLEFT 264 // sent when the put_left method is called on the WebOC -#define DISPID_WINDOWSETTOP 265 // sent when the put_top method is called on the WebOC -#define DISPID_WINDOWSETWIDTH 266 // sent when the put_width method is called on the WebOC -#define DISPID_WINDOWSETHEIGHT 267 // sent when the put_height method is called on the WebOC -#define DISPID_CLIENTTOHOSTWINDOW 268 // sent during window.open to request conversion of dimensions -#define DISPID_SETSECURELOCKICON 269 // sent to suggest the appropriate security icon to show -#define DISPID_FILEDOWNLOAD 270 // Fired to indicate the File Download dialog is opening -#define DISPID_NAVIGATEERROR 271 // Fired to indicate the a binding error has occured -#define DISPID_PRIVACYIMPACTEDSTATECHANGE 272 // Fired when the user's browsing experience is impacted -#define DISPID_NEWWINDOW3 273 -#define DISPID_VIEWUPDATE 281 // Fired when the contents of a shell browser window change -#define DISPID_SETPHISHINGFILTERSTATUS 282 // Fired by the Phishing Filter API to signal what state the analysis is in -#define DISPID_WINDOWSTATECHANGED 283 // Fired to indicate that the browser window's visibility or enabled state has changed -#define DISPID_NEWPROCESS 284 // Fired when a navigation must be redirected due to Protected Mode -#define DISPID_THIRDPARTYURLBLOCKED 285 // Fired when a third-party url is blocked due to Privacy Advisor -#define DISPID_REDIRECTXDOMAINBLOCKED 286 // Fired when a x-domain redirect is blocked due to browser nav constant - -// Printing events -#define DISPID_PRINTTEMPLATEINSTANTIATION 225 // Fired to indicate that a print template is instantiated -#define DISPID_PRINTTEMPLATETEARDOWN 226 // Fired to indicate that a print templete is completely gone -#define DISPID_UPDATEPAGESTATUS 227 // Fired to indicate that the spooling status has changed - -// define the events for the shell window list -#define DISPID_WINDOWREGISTERED 200 // Window registered -#define DISPID_WINDOWREVOKED 201 // Window Revoked - -#define DISPID_RESETFIRSTBOOTMODE 1 -#define DISPID_RESETSAFEMODE 2 -#define DISPID_REFRESHOFFLINEDESKTOP 3 -#define DISPID_ADDFAVORITE 4 -#define DISPID_ADDCHANNEL 5 -#define DISPID_ADDDESKTOPCOMPONENT 6 -#define DISPID_ISSUBSCRIBED 7 -#define DISPID_NAVIGATEANDFIND 8 -#define DISPID_IMPORTEXPORTFAVORITES 9 -#define DISPID_AUTOCOMPLETESAVEFORM 10 -#define DISPID_AUTOSCAN 11 -#define DISPID_AUTOCOMPLETEATTACH 12 -#define DISPID_SHOWBROWSERUI 13 -#define DISPID_ADDSEARCHPROVIDER 14 -#define DISPID_RUNONCESHOWN 15 -#define DISPID_SKIPRUNONCE 16 -#define DISPID_CUSTOMIZESETTINGS 17 -#define DISPID_SQMENABLED 18 -#define DISPID_PHISHINGENABLED 19 -#define DISPID_BRANDIMAGEURI 20 -#define DISPID_SKIPTABSWELCOME 21 -#define DISPID_DIAGNOSECONNECTION 22 -#define DISPID_CUSTOMIZECLEARTYPE 23 -#define DISPID_ISSEARCHPROVIDERINSTALLED 24 -#define DISPID_ISSEARCHMIGRATED 25 -#define DISPID_DEFAULTSEARCHPROVIDER 26 -#define DISPID_RUNONCEREQUIREDSETTINGSCOMPLETE 27 -#define DISPID_RUNONCEHASSHOWN 28 -#define DISPID_SEARCHGUIDEURL 29 -#define DISPID_ADDSERVICE 30 -#define DISPID_ISSERVICEINSTALLED 31 -#define DISPID_ADDTOFAVORITESBAR 32 -#define DISPID_BUILDNEWTABPAGE 33 -#define DISPID_SETRECENTLYCLOSEDVISIBLE 34 -#define DISPID_SETACTIVITIESVISIBLE 35 -#define DISPID_CONTENTDISCOVERYRESET 36 -#define DISPID_INPRIVATEFILTERINGENABLED 37 -#define DISPID_SUGGESTEDSITESENABLED 38 -#define DISPID_ENABLESUGGESTEDSITES 39 -#define DISPID_NAVIGATETOSUGGESTEDSITES 40 -#define DISPID_SHOWTABSHELP 41 -#define DISPID_SHOWINPRIVATEHELP 42 -#define DISPID_SHELLUIHELPERLAST 43 - -#define DISPID_ADVANCEERROR 10 -#define DISPID_RETREATERROR 11 -#define DISPID_CANADVANCEERROR 12 -#define DISPID_CANRETREATERROR 13 -#define DISPID_GETERRORLINE 14 -#define DISPID_GETERRORCHAR 15 -#define DISPID_GETERRORCODE 16 -#define DISPID_GETERRORMSG 17 -#define DISPID_GETERRORURL 18 -#define DISPID_GETDETAILSSTATE 19 -#define DISPID_SETDETAILSSTATE 20 -#define DISPID_GETPERERRSTATE 21 -#define DISPID_SETPERERRSTATE 22 -#define DISPID_GETALWAYSSHOWLOCKSTATE 23 - -// Dispatch IDS for ShellFavoritesNameSpace Dispatch Events. -// -#define DISPID_FAVSELECTIONCHANGE 1 -#define DISPID_SELECTIONCHANGE 2 -#define DISPID_DOUBLECLICK 3 -#define DISPID_INITIALIZED 4 - -#define DISPID_MOVESELECTIONUP 1 -#define DISPID_MOVESELECTIONDOWN 2 -#define DISPID_RESETSORT 3 -#define DISPID_NEWFOLDER 4 -#define DISPID_SYNCHRONIZE 5 -#define DISPID_IMPORT 6 -#define DISPID_EXPORT 7 -#define DISPID_INVOKECONTEXTMENU 8 -#define DISPID_MOVESELECTIONTO 9 -#define DISPID_SUBSCRIPTIONSENABLED 10 -#define DISPID_CREATESUBSCRIPTION 11 -#define DISPID_DELETESUBSCRIPTION 12 -#define DISPID_SETROOT 13 -#define DISPID_ENUMOPTIONS 14 -#define DISPID_SELECTEDITEM 15 -#define DISPID_ROOT 16 -#define DISPID_DEPTH 17 -#define DISPID_MODE 18 -#define DISPID_FLAGS 19 -#define DISPID_TVFLAGS 20 -#define DISPID_NSCOLUMNS 21 -#define DISPID_COUNTVIEWTYPES 22 -#define DISPID_SETVIEWTYPE 23 -#define DISPID_SELECTEDITEMS 24 -#define DISPID_EXPAND 25 -#define DISPID_UNSELECTALL 26 - -#define EXDISPID_H_ -#endif // EXDISPID_H_ - diff --git a/qt-correction-tool/pub/ddk/SCardErr.h b/qt-correction-tool/pub/ddk/SCardErr.h deleted file mode 100644 index e3a67f8..0000000 --- a/qt-correction-tool/pub/ddk/SCardErr.h +++ /dev/null @@ -1,655 +0,0 @@ -/* - scarderr.mc - - Error message codes from the Smart Card Resource Manager - These messages must be reconciled with winerror.w - They exist here to provide error messages on pre-Win2K systems. - -*/ -#ifndef SCARD_S_SUCCESS -// -// ============================= -// Facility SCARD Error Messages -// ============================= -// -#define SCARD_S_SUCCESS NO_ERROR -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// -#define FACILITY_SYSTEM 0x0 -#define FACILITY_SCARD 0x10 - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_ERROR 0x3 - - -// -// MessageId: SCARD_F_INTERNAL_ERROR -// -// MessageText: -// -// An internal consistency check failed. -// -#define SCARD_F_INTERNAL_ERROR ((DWORD)0x80100001L) - -// -// MessageId: SCARD_E_CANCELLED -// -// MessageText: -// -// The action was cancelled by an SCardCancel request. -// -#define SCARD_E_CANCELLED ((DWORD)0x80100002L) - -// -// MessageId: SCARD_E_INVALID_HANDLE -// -// MessageText: -// -// The supplied handle was invalid. -// -#define SCARD_E_INVALID_HANDLE ((DWORD)0x80100003L) - -// -// MessageId: SCARD_E_INVALID_PARAMETER -// -// MessageText: -// -// One or more of the supplied parameters could not be properly interpreted. -// -#define SCARD_E_INVALID_PARAMETER ((DWORD)0x80100004L) - -// -// MessageId: SCARD_E_INVALID_TARGET -// -// MessageText: -// -// Registry startup information is missing or invalid. -// -#define SCARD_E_INVALID_TARGET ((DWORD)0x80100005L) - -// -// MessageId: SCARD_E_NO_MEMORY -// -// MessageText: -// -// Not enough memory available to complete this command. -// -#define SCARD_E_NO_MEMORY ((DWORD)0x80100006L) - -// -// MessageId: SCARD_F_WAITED_TOO_LONG -// -// MessageText: -// -// An internal consistency timer has expired. -// -#define SCARD_F_WAITED_TOO_LONG ((DWORD)0x80100007L) - -// -// MessageId: SCARD_E_INSUFFICIENT_BUFFER -// -// MessageText: -// -// The data buffer to receive returned data is too small for the returned data. -// -#define SCARD_E_INSUFFICIENT_BUFFER ((DWORD)0x80100008L) - -// -// MessageId: SCARD_E_UNKNOWN_READER -// -// MessageText: -// -// The specified reader name is not recognized. -// -#define SCARD_E_UNKNOWN_READER ((DWORD)0x80100009L) - -// -// MessageId: SCARD_E_TIMEOUT -// -// MessageText: -// -// The user-specified timeout value has expired. -// -#define SCARD_E_TIMEOUT ((DWORD)0x8010000AL) - -// -// MessageId: SCARD_E_SHARING_VIOLATION -// -// MessageText: -// -// The smart card cannot be accessed because of other connections outstanding. -// -#define SCARD_E_SHARING_VIOLATION ((DWORD)0x8010000BL) - -// -// MessageId: SCARD_E_NO_SMARTCARD -// -// MessageText: -// -// The operation requires a Smart Card, but no Smart Card is currently in the device. -// -#define SCARD_E_NO_SMARTCARD ((DWORD)0x8010000CL) - -// -// MessageId: SCARD_E_UNKNOWN_CARD -// -// MessageText: -// -// The specified smart card name is not recognized. -// -#define SCARD_E_UNKNOWN_CARD ((DWORD)0x8010000DL) - -// -// MessageId: SCARD_E_CANT_DISPOSE -// -// MessageText: -// -// The system could not dispose of the media in the requested manner. -// -#define SCARD_E_CANT_DISPOSE ((DWORD)0x8010000EL) - -// -// MessageId: SCARD_E_PROTO_MISMATCH -// -// MessageText: -// -// The requested protocols are incompatible with the protocol currently in use with the smart card. -// -#define SCARD_E_PROTO_MISMATCH ((DWORD)0x8010000FL) - -// -// MessageId: SCARD_E_NOT_READY -// -// MessageText: -// -// The reader or smart card is not ready to accept commands. -// -#define SCARD_E_NOT_READY ((DWORD)0x80100010L) - -// -// MessageId: SCARD_E_INVALID_VALUE -// -// MessageText: -// -// One or more of the supplied parameters values could not be properly interpreted. -// -#define SCARD_E_INVALID_VALUE ((DWORD)0x80100011L) - -// -// MessageId: SCARD_E_SYSTEM_CANCELLED -// -// MessageText: -// -// The action was cancelled by the system, presumably to log off or shut down. -// -#define SCARD_E_SYSTEM_CANCELLED ((DWORD)0x80100012L) - -// -// MessageId: SCARD_F_COMM_ERROR -// -// MessageText: -// -// An internal communications error has been detected. -// -#define SCARD_F_COMM_ERROR ((DWORD)0x80100013L) - -// -// MessageId: SCARD_F_UNKNOWN_ERROR -// -// MessageText: -// -// An internal error has been detected, but the source is unknown. -// -#define SCARD_F_UNKNOWN_ERROR ((DWORD)0x80100014L) - -// -// MessageId: SCARD_E_INVALID_ATR -// -// MessageText: -// -// An ATR obtained from the registry is not a valid ATR string. -// -#define SCARD_E_INVALID_ATR ((DWORD)0x80100015L) - -// -// MessageId: SCARD_E_NOT_TRANSACTED -// -// MessageText: -// -// An attempt was made to end a non-existent transaction. -// -#define SCARD_E_NOT_TRANSACTED ((DWORD)0x80100016L) - -// -// MessageId: SCARD_E_READER_UNAVAILABLE -// -// MessageText: -// -// The specified reader is not currently available for use. -// -#define SCARD_E_READER_UNAVAILABLE ((DWORD)0x80100017L) - -// -// MessageId: SCARD_P_SHUTDOWN -// -// MessageText: -// -// The operation has been aborted to allow the server application to exit. -// -#define SCARD_P_SHUTDOWN ((DWORD)0x80100018L) - -// -// MessageId: SCARD_E_PCI_TOO_SMALL -// -// MessageText: -// -// The PCI Receive buffer was too small. -// -#define SCARD_E_PCI_TOO_SMALL ((DWORD)0x80100019L) - -// -// MessageId: SCARD_E_READER_UNSUPPORTED -// -// MessageText: -// -// The reader driver does not meet minimal requirements for support. -// -#define SCARD_E_READER_UNSUPPORTED ((DWORD)0x8010001AL) - -// -// MessageId: SCARD_E_DUPLICATE_READER -// -// MessageText: -// -// The reader driver did not produce a unique reader name. -// -#define SCARD_E_DUPLICATE_READER ((DWORD)0x8010001BL) - -// -// MessageId: SCARD_E_CARD_UNSUPPORTED -// -// MessageText: -// -// The smart card does not meet minimal requirements for support. -// -#define SCARD_E_CARD_UNSUPPORTED ((DWORD)0x8010001CL) - -// -// MessageId: SCARD_E_NO_SERVICE -// -// MessageText: -// -// The Smart card resource manager is not running. -// -#define SCARD_E_NO_SERVICE ((DWORD)0x8010001DL) - -// -// MessageId: SCARD_E_SERVICE_STOPPED -// -// MessageText: -// -// The Smart card resource manager has shut down. -// -#define SCARD_E_SERVICE_STOPPED ((DWORD)0x8010001EL) - -// -// MessageId: SCARD_E_UNEXPECTED -// -// MessageText: -// -// An unexpected card error has occurred. -// -#define SCARD_E_UNEXPECTED ((DWORD)0x8010001FL) - -// -// MessageId: SCARD_E_ICC_INSTALLATION -// -// MessageText: -// -// No Primary Provider can be found for the smart card. -// -#define SCARD_E_ICC_INSTALLATION ((DWORD)0x80100020L) - -// -// MessageId: SCARD_E_ICC_CREATEORDER -// -// MessageText: -// -// The requested order of object creation is not supported. -// -#define SCARD_E_ICC_CREATEORDER ((DWORD)0x80100021L) - -// -// MessageId: SCARD_E_UNSUPPORTED_FEATURE -// -// MessageText: -// -// This smart card does not support the requested feature. -// -#define SCARD_E_UNSUPPORTED_FEATURE ((DWORD)0x80100022L) - -// -// MessageId: SCARD_E_DIR_NOT_FOUND -// -// MessageText: -// -// The identified directory does not exist in the smart card. -// -#define SCARD_E_DIR_NOT_FOUND ((DWORD)0x80100023L) - -// -// MessageId: SCARD_E_FILE_NOT_FOUND -// -// MessageText: -// -// The identified file does not exist in the smart card. -// -#define SCARD_E_FILE_NOT_FOUND ((DWORD)0x80100024L) - -// -// MessageId: SCARD_E_NO_DIR -// -// MessageText: -// -// The supplied path does not represent a smart card directory. -// -#define SCARD_E_NO_DIR ((DWORD)0x80100025L) - -// -// MessageId: SCARD_E_NO_FILE -// -// MessageText: -// -// The supplied path does not represent a smart card file. -// -#define SCARD_E_NO_FILE ((DWORD)0x80100026L) - -// -// MessageId: SCARD_E_NO_ACCESS -// -// MessageText: -// -// Access is denied to this file. -// -#define SCARD_E_NO_ACCESS ((DWORD)0x80100027L) - -// -// MessageId: SCARD_E_WRITE_TOO_MANY -// -// MessageText: -// -// The smartcard does not have enough memory to store the information. -// -#define SCARD_E_WRITE_TOO_MANY ((DWORD)0x80100028L) - -// -// MessageId: SCARD_E_BAD_SEEK -// -// MessageText: -// -// There was an error trying to set the smart card file object pointer. -// -#define SCARD_E_BAD_SEEK ((DWORD)0x80100029L) - -// -// MessageId: SCARD_E_INVALID_CHV -// -// MessageText: -// -// The supplied PIN is incorrect. -// -#define SCARD_E_INVALID_CHV ((DWORD)0x8010002AL) - -// -// MessageId: SCARD_E_UNKNOWN_RES_MNG -// -// MessageText: -// -// An unrecognized error code was returned from a layered component. -// -#define SCARD_E_UNKNOWN_RES_MNG ((DWORD)0x8010002BL) - -// -// MessageId: SCARD_E_NO_SUCH_CERTIFICATE -// -// MessageText: -// -// The requested certificate does not exist. -// -#define SCARD_E_NO_SUCH_CERTIFICATE ((DWORD)0x8010002CL) - -// -// MessageId: SCARD_E_CERTIFICATE_UNAVAILABLE -// -// MessageText: -// -// The requested certificate could not be obtained. -// -#define SCARD_E_CERTIFICATE_UNAVAILABLE ((DWORD)0x8010002DL) - -// -// MessageId: SCARD_E_NO_READERS_AVAILABLE -// -// MessageText: -// -// Cannot find a smart card reader. -// -#define SCARD_E_NO_READERS_AVAILABLE ((DWORD)0x8010002EL) - -// -// MessageId: SCARD_E_COMM_DATA_LOST -// -// MessageText: -// -// A communications error with the smart card has been detected. Retry the operation. -// -#define SCARD_E_COMM_DATA_LOST ((DWORD)0x8010002FL) - -// -// MessageId: SCARD_E_NO_KEY_CONTAINER -// -// MessageText: -// -// The requested key container does not exist on the smart card. -// -#define SCARD_E_NO_KEY_CONTAINER ((DWORD)0x80100030L) - -// -// MessageId: SCARD_E_SERVER_TOO_BUSY -// -// MessageText: -// -// The Smart card resource manager is too busy to complete this operation. -// -#define SCARD_E_SERVER_TOO_BUSY ((DWORD)0x80100031L) - -// -// MessageId: SCARD_E_PIN_CACHE_EXPIRED -// -// MessageText: -// -// The smart card PIN cache has expired. -// -#define SCARD_E_PIN_CACHE_EXPIRED ((DWORD)0x80100032L) - -// -// MessageId: SCARD_E_NO_PIN_CACHE -// -// MessageText: -// -// The smart card PIN cannot be cached. -// -#define SCARD_E_NO_PIN_CACHE ((DWORD)0x80100033L) - -// -// MessageId: SCARD_E_READ_ONLY_CARD -// -// MessageText: -// -// The smart card is read only and cannot be written to. -// -#define SCARD_E_READ_ONLY_CARD ((DWORD)0x80100034L) - -// -// These are warning codes. -// -// -// MessageId: SCARD_W_UNSUPPORTED_CARD -// -// MessageText: -// -// The reader cannot communicate with the smart card, due to ATR configuration conflicts. -// -#define SCARD_W_UNSUPPORTED_CARD ((DWORD)0x80100065L) - -// -// MessageId: SCARD_W_UNRESPONSIVE_CARD -// -// MessageText: -// -// The smart card is not responding to a reset. -// -#define SCARD_W_UNRESPONSIVE_CARD ((DWORD)0x80100066L) - -// -// MessageId: SCARD_W_UNPOWERED_CARD -// -// MessageText: -// -// Power has been removed from the smart card, so that further communication is not possible. -// -#define SCARD_W_UNPOWERED_CARD ((DWORD)0x80100067L) - -// -// MessageId: SCARD_W_RESET_CARD -// -// MessageText: -// -// The smart card has been reset, so any shared state information is invalid. -// -#define SCARD_W_RESET_CARD ((DWORD)0x80100068L) - -// -// MessageId: SCARD_W_REMOVED_CARD -// -// MessageText: -// -// The smart card has been removed, so that further communication is not possible. -// -#define SCARD_W_REMOVED_CARD ((DWORD)0x80100069L) - -// -// MessageId: SCARD_W_SECURITY_VIOLATION -// -// MessageText: -// -// Access was denied because of a security violation. -// -#define SCARD_W_SECURITY_VIOLATION ((DWORD)0x8010006AL) - -// -// MessageId: SCARD_W_WRONG_CHV -// -// MessageText: -// -// The card cannot be accessed because the wrong PIN was presented. -// -#define SCARD_W_WRONG_CHV ((DWORD)0x8010006BL) - -// -// MessageId: SCARD_W_CHV_BLOCKED -// -// MessageText: -// -// The card cannot be accessed because the maximum number of PIN entry attempts has been reached. -// -#define SCARD_W_CHV_BLOCKED ((DWORD)0x8010006CL) - -// -// MessageId: SCARD_W_EOF -// -// MessageText: -// -// The end of the smart card file has been reached. -// -#define SCARD_W_EOF ((DWORD)0x8010006DL) - -// -// MessageId: SCARD_W_CANCELLED_BY_USER -// -// MessageText: -// -// The action was cancelled by the user. -// -#define SCARD_W_CANCELLED_BY_USER ((DWORD)0x8010006EL) - -// -// MessageId: SCARD_W_CARD_NOT_AUTHENTICATED -// -// MessageText: -// -// No PIN was presented to the smart card. -// -#define SCARD_W_CARD_NOT_AUTHENTICATED ((DWORD)0x8010006FL) - -// -// MessageId: SCARD_W_CACHE_ITEM_NOT_FOUND -// -// MessageText: -// -// The requested item could not be found in the cache. -// -#define SCARD_W_CACHE_ITEM_NOT_FOUND ((DWORD)0x80100070L) - -// -// MessageId: SCARD_W_CACHE_ITEM_STALE -// -// MessageText: -// -// The requested cache item is too old and was deleted from the cache. -// -#define SCARD_W_CACHE_ITEM_STALE ((DWORD)0x80100071L) - -// -// MessageId: SCARD_W_CACHE_ITEM_TOO_BIG -// -// MessageText: -// -// The new cache item exceeds the maximum per-item size defined for the cache. -// -#define SCARD_W_CACHE_ITEM_TOO_BIG ((DWORD)0x80100072L) - -#endif // SCARD_S_SUCCESS - diff --git a/qt-correction-tool/pub/ddk/USBProtocolDefs.h b/qt-correction-tool/pub/ddk/USBProtocolDefs.h deleted file mode 100644 index 7b3366c..0000000 --- a/qt-correction-tool/pub/ddk/USBProtocolDefs.h +++ /dev/null @@ -1,886 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -Module Name: - - USBProtocolDefs.h - -Abstract: - - USB protocol definitions - -Author: - ---*/ -#ifndef _USBPROTOCOLDEFS_H_ -#define _USBPROTOCOLDEFS_H_ - -#include - - -// Initial address for an unconnected wired device. -#define USB_UnConnected_Device_Address 0 - -#define USB_UNCONNECTED_ADDRESS(address) ( USB_UnConnected_Device_Address == (address)) - -#define USB_CONNECTED_ADDRESS(address) ( USB_UnConnected_Device_Address != (address) ) - -//PID definition taken from -//USB Spec 2.0 chapter 8.3.1 - -// Token -#define PID_OUT 1 -#define PID_IN 9 -#define PID_SOF 5 -#define PID_SETUP 13 - -// Data -#define PID_DATA0 3 -#define PID_DATA1 11 -#define PID_DATA2 7 -#define PID_MDATA 15 - -// Handshake -#define USB_ACK 2 -#define USB_NAK 10 -#define USB_STALL 14 -#define USB_NYET 6 - -// Special -#define USB_PRE 12 -#define USB_ERR 12 -#define USB_SPLIT 8 -#define USB_PING 4 - -#define USB_TIMEOUT 0 - - -///////////////////////////////////////////////////////////////////// -// Spec release -#define USB_SPEC 0x0200 -#define HID_SPEC 0x0101 - - -///////////////////////////////////////////////////////////////////// -// USB Device specification -#define USB_20_SPEC 0x0200 -#define USB_11_SPEC 0x0110 -#define USB_10_SPEC 0x0100 - -///////////////////////////////////////////////////////////////////// -// Default values: -// Device Descriptor -#define HID_MAX_PACKET_SIZE0 0x08 -#define MICROSOFT_VENDOR_ID 0x045E -#define HID_DEVICE_RELEASE 0x0100 -// Endpoint Descriptor -#define HID_MAX_PACKET_SIZE 0x0008 -#define HID_POLLING_INTERVAL 0x0A -#define MAX_POLLING_INTERVAL 0xFF - -// Product IDs -#define USB_DEFAULT_KEYBOARD_PRODUCT_ID 0x000B // Microsoft USB Natural Keyboard from keyboard.inf -#define USB_DEFAULT_MOUSE_PRODUCT_ID 0x0040 // Microsoft USB Wheel Mouse Optical from msmouse.inf - -///////////////////////////////////////////////////////////////////// -// Descriptor type Table 9.5 usb2.0 spec -#define DEVICE_DESCRIPTOR 0x01 -#define CONFIGURATION_DESCRIPTOR 0x02 -#define STRING_DESCRIPTOR 0x03 -#define INTERFACE_DESCRIPTOR 0x04 -#define ENDPOINT_DESCRIPTOR 0x05 -#define QUALIFIER_DESCRIPTOR 0x06 -#define OTHER_SPEED_DESCRIPTOR 0x07 -#define INTERFACE_POWER_DESCRIPTOR 0x08 -// Class-specific descriptor types -#define HID_DESCRIPTOR 0x21 -#define REPORT_DESCRIPTOR 0x22 -#define PHYSICAL_DESCRIPTOR 0x23 -#define HUB_DESCRIPTOR 0x29 - -// USBDESCRIPTORTYPE defines the high byte of wValue for a -// GET_DESCRIPTOR request - -typedef union _USBDESCRIPTORTYPE -{ - BYTE Byte; - -#if !defined(MIDL_PASS) - struct Bits - { - BYTE Descriptor:5; // bits 0-4 descriptor type as qualified by the Type field - BYTE Type:2; // bits 5-6 - BYTE Reserved:1; // bit 7 - } Bits; -#endif -} USBDESCRIPTORTYPE; - -// These are the possible values for USBDESCRIPTORTYPE.Bits.Type -#define USB_DESCRIPTOR_TYPE_STD 0 -#define USB_DESCRIPTOR_TYPE_CLASS 1 -#define USB_DESCRIPTOR_TYPE_VENDOR 2 -#define USB_DESCRIPTOR_TYPE_RESERVED 3 - - - - -///////////////////////////////////////////////////////////////////// -// REQUEST TYPES -// Taken from USB 2.0 spec. Table 9-2 - -// Data transfer direction. D7 -#define DIR_HOST_TO_DEVICE 0 -#define DIR_DEVICE_TO_HOST 1 - -// Type. D6..5 -#define TYPE_STANDARD 0 -#define TYPE_CLASS 1 -#define TYPE_VENDOR 2 -#define TYPE_RESERVED 3 - -// Recipient D4..0 -#define RCPT_DEVICE 0 -#define RCPT_INTERFACE 1 -#define RCPT_ENDPOINT 2 -#define RCPT_OTHER 3 -#define RCPT_PORT 4 -#define RCPT_RPIPE 5 - -#if !defined(MIDL_PASS) -#define USB_MAKE_REQUEST_TYPE(direction, type, recipient) (BYTE)( ((BYTE)direction << 7) | ((BYTE)type << 5) | ((BYTE)recipient & 0x07) ) -#endif - -///////////////////////////////////////////////////////////////////// -// STANDARD REQUESTS -#define GET_STATUS 0 -#define CLEAR_FEATURE 1 -#define SET_FEATURE 3 -#define SET_ADDRESS 5 -#define GET_DESCRIPTOR 6 -#define SET_DESCRIPTOR 7 -#define GET_CONFIGURATION 8 -#define SET_CONFIGURATION 9 -#define GET_INTERFACE 10 -#define SET_INTERFACE 11 -#define SYNCH_FRAME 12 - -///////////////////////////////////////////////////////////////////// -// BULK-ONLY MASS STORAGE CLASS REQUESTS -#define USB_BULK_ONLY_MASS_STG_RESET 0xFF -#define USB_BULK_ONLY_MASS_STG_GET_MAX_LUN 0xFE - -///////////////////////////////////////////////////////////////////// -// HID CLASS REQUESTS -#define GET_REPORT 0x01 -#define GET_IDLE 0x02 -#define GET_PROTOCOL 0x03 -#define SET_REPORT 0x09 -#define SET_IDLE 0x0A -#define SET_PROTOCOL 0x0B - -/////////////////////////////////////////////////////////////////// -// HWA Device class requests -#define ADD_MMC_IE 20 -#define REMOVE_MMC_IE 21 -#define SET_NUM_DNTS 22 -#define SET_CLUSTER_ID 23 -#define SET_DEVICE_INFO 24 -#define GET_TIME 25 -#define SET_STREAM_INDEX 26 -#define SET_WUSB_MAS 27 -#define WUSB_CH_STOP 28 - -//RC Class requests -#define EXEC_RC_CMD 40 - -//////////////////////////////////////////////////////////////////// -// WUSB Channel Time Type -#define TIME_ADJ 0x01 -#define TIME_BPST 0x02 -#define TIME_WUSB 0x03 - -///////////////////////////////////////////////////////////////////// -// HID REPORT TYPES -#define HID_REPORT_TYPE_INPUT 0x01 -#define HID_REPORT_TYPE_OUTPUT 0x02 -#define HID_REPORT_TYPE_FEATURE 0x03 - -///////////////////////////////////////////////////////////////////// -// HID protocol types for GET/SET_PROTOCOL requests -#define HID_PROTOCOL_TYPE_BOOT 0x00 -#define HID_PROTOCOL_TYPE_REPORT 0x01 - -/////////////////////////////////////////////////////////////////// -// HUB protocol definitions -#define HUB_DEVICE_PROTOCOL_1X 0 -#define HUB_DEVICE_PROTOCOL_SINGLE_TT 1 -#define HUB_DEVICE_PROTOCOL_MULTI_TT 2 - -#define HUB_INTERFACE_PROTOCOL_1X 0 -#define HUB_INTERFACE_PROTOCOL_SINGLE_TT 0 -#define HUB_INTERFACE_PROTOCOL_MULTI_TT_IN_SINGLE_TT_MODE 1 -#define HUB_INTERFACE_PROTOCOL_MULTI_TT_IN_MULTI_TT_MODE 2 - -/////////////////////////////////////////////////////////////////// -//HUB Class Request code -#define CLEAR_TT_BUFFER 8 -#define RESET_TT 9 -#define GET_TT_STATE 10 -#define STOP_TT 11 - -/////////////////////////////////////////////////////////////////// -//HUB And PORT Feature selector -#define C_HUB_LOCAL_POWER 0 -#define C_HUB_OVER_CURRENT 1 -#define PORT_CONNECTION 0 -#define PORT_ENABLE 1 -#define PORT_SUSPEND 2 -#define PORT_OVER_CURRENT 3 -#define PORT_RESET 4 -#define PORT_POWER 8 -#define PORT_LOW_SPEED 9 -#define C_PORT_CONNECTION 16 -#define C_PORT_ENABLE 17 -#define C_PORT_SUSPEND 18 -#define C_PORT_OVER_CURRENT 19 -#define C_PORT_RESET 20 -#define PORT_TEST 21 -#define PORT_INDICATOR 22 - - -///////////////////////////////////////////////////////////////////// -// SETUP Constants -#define USBSETUPSIZE 8 -#define USBINREQUEST 128 - -///////////////////////////////////////////////////////////////////// -// BM_REQUESTES -#define BM_GET_DEVICE 128 -#define BM_GET_INTERFACE 129 -#define BM_GET_ENDPOINT 130 - -#define BM_SET_DEVICE 0 -#define BM_SET_INTERFACE 1 -#define BM_SET_ENDPOINT 2 - - -#define HALT_ENDPOINT 0 -#define REMOTE_WAKEUP 1 -#define TEST_MODE 2 - -///////////////////////////////////////////////////////////////////// -// Descriptor requests -#define DEVICE_DESCRIPTION_TYPE 0x100 -#define QUALIFIER_DESCRIPTION_TYPE 0x600 -#define OTHER_SPEED_DESCRIPTION_TYPE 0x700 -#define CONFIG_DESCRIPTION_TYPE 0x200 -#define STRING_DESCRIPTION_TYPE 0x300 -#define MSOS_DESCRIPTION_TYPE 0x3EE - - -///////////////////////////////////////////////////////////////////// -// Configuration Descriptor values -// bmAttribute bits in Configuration Descriptor -// - USB 2.0 9.6.3 (bmAttributes in Table 9-10): Bit 7 is reserved, and always set to one -#define CONFIG_BUS_POWERED 0x80 -#define CONFIG_SELF_POWERED 0x40 -// Not to be confused with Device Remote Wakeup feature selector! -#define CONFIG_REMOTE_WAKEUP 0x20 - -//HWA definitions -#define USB_WA_MULTIFUNCTION 0x02 -#define USB_WA_PROTOCOL 0x01 -#define USB_RADIO_CONTROL 0x2 - -typedef union _USBCONFIGATTRIBS -{ - BYTE Byte; - -#if !defined(MIDL_PASS) - - struct Bits - { - BYTE bReserved0_4:5; // bits 0-4 - BYTE bRemoteWakeup:1; // bit 5 - BYTE bSelfPowered:1; // bit 6 - BYTE bReserved7:1; // bit 7 - } Bits; - -#endif - -} USBCONFIGATTRIBS; - - -///////////////////////////////////////////////////////////////////// -// Interface Descriptor values -// bInterfaceClass values -#define USB_HID_CLASS_CODE 0x03 -#define USB_MASS_STORAGE_CLASS_CODE 0x08 -#define USB_HUB_CLASS_CODE 0x09 -#define USB_MISCELLANEOUS 0xEF -#define USB_WIRELESS_WA 0xE0 - -// bInterfaceSubClass value -#define BOOT_INTERFACE_SUBCLASS 0x01 -#define COMMON_CLASS 0x02 -#define USB_RF_CONTROL 0x01 - -// bInterfaceProtocol values for HID -#define PROTOCOL_NONE 0x00 -#define PROTOCOL_KEYBOARD 0x01 -#define PROTOCOL_MOUSE 0x02 - -///////////////////////////////////////////////////////////////////// -// Endpoint Descriptor values -// Macros for generating bEndpointAddress value -// - USB HID 1.11 Appendix E.5 -#define EP_OUT 0 -#define EP_IN 1 -// Bit 0..3 The end point number -// Bit 4..6 Reserved, reset to zero -// Bit 7 Direction, ignored for control endpoints -#define MAKE_ENDPOINT_ADDRESS(num, dir) ( ((BYTE)(dir) << 7) | ((BYTE)(num) & 0x0F) ) - -// bmAttributes values -// ENDPOINT TYPES -#define ENDPOINT_TYPE 0x03 -#define CONTROL_ENDPOINT 0 -#define ISOCHRONOUS_ENDPOINT 1 -#define BULK_ENDPOINT 2 -#define INTERRUPT_ENDPOINT 3 - - - -//Define standard USB structures which are used to transfer data from the -//host to the endpoints - -typedef union _USBREQUESTTYPE -{ - BYTE Byte; - -#if !defined(MIDL_PASS) - struct Bits - { - BYTE Recipient:5; // bits 0-4 - BYTE Type:2; // bits 5-6 - BYTE Direction:1; // bit 7 - } Bits; -#endif -} USBREQUESTTYPE; - - -#if !defined(MIDL_PASS) -C_ASSERT((sizeof(USBREQUESTTYPE) == sizeof(BYTE))); -#endif - -typedef struct _USBSETUPREQUEST -{ - USBREQUESTTYPE bmRequestType; // Setup request type - BYTE bRequest; // Setup Request - SHORT sSetupValue; // Value for the setup request - SHORT sSetupIndex; // Index for the setup request - SHORT sSetupLength; // Data Length for the device -} USBSETUPREQUEST; - - -#if !defined(MIDL_PASS) - -typedef struct _USBDEVICEDESC -{ - BYTE bLength; - BYTE bDescriptorType; - USHORT usUSB; - BYTE bDeviceClass; - BYTE bDeviceSubClass; - BYTE bProtocol; - BYTE bMaxPacket0; - USHORT usVendor; - USHORT usProduct; - USHORT usDeviceNumber; - BYTE bManufacturer; - BYTE bProductDesc; - BYTE bSerialNumber; - BYTE bNumConfigs; - -} USBDEVICEDESC; - - -typedef struct _USBCONFIGDESC -{ - BYTE bLength; - BYTE bDescriptorType; - USHORT usTotalLength; - BYTE bNumInterfaces; - BYTE bConfigValue; - BYTE bConfig; - BYTE bAttributes; - BYTE bMaxPower; -} USBCONFIGDESC; - - -typedef struct _USBINTERFACEDESC -{ - BYTE bLength; - BYTE bDescriptorType; - BYTE bInterfaceNumber; - BYTE bAlternateSetting; - BYTE bNumEndpoints; - BYTE bClass; - BYTE bSubClass; - BYTE bProtocol; - BYTE bDescription; -} USBINTERFACEDESC; - - -#define ENDPOINT_DIRECTION_OUT 0 -#define ENDPOINT_DIRECTION_IN 1 - - -typedef union _USBENDPOINTADDRESS -{ - BYTE Byte; - - struct Bits - { - BYTE Number:4; // bits 0-3 - BYTE Reserved:3; // bits 4-6 - BYTE Direction:1; // bit 7 - } Bits; - -} USBENDPOINTADDRESS; - - -C_ASSERT((sizeof(USBENDPOINTADDRESS) == sizeof(BYTE))); - - -#define USB_TRANSFER_TYPE_CONTROL 0 -#define USB_TRANSFER_TYPE_ISOCH 1 -#define USB_TRANSFER_TYPE_BULK 2 -#define USB_TRANSFER_TYPE_INTERRUPT 3 - -#define USB_SYNC_TYPE_NONE 0 -#define USB_SYNC_TYPE_ASYNC 1 -#define USB_SYNC_TYPE_ADAPTIVE 2 -#define USB_SYNC_TYPE_SYNC 3 - -#define USB_USAGE_TYPE_DATA 0 -#define USB_USAGE_TYPE_FEEDBACK 1 -#define USB_USAGE_TYPE_IMPLICIT 2 -#define USB_USAGE_TYPE_RESERVED 3 - -typedef union _USBENDPOINTATTRIBS -{ - BYTE Byte; - - struct Bits - { - BYTE TransferType:2; // bits 0-1 - BYTE SyncType:2; // bits 3-4 - BYTE UsageType:2; // bits 5-6 - BYTE Reserved:2; // bits 7-8 - } Bits; - -} USBENDPOINTATTRIBS; - -C_ASSERT((sizeof(USBENDPOINTATTRIBS) == sizeof(BYTE))); - - -typedef union _USBMAXPACKET -{ - WORD Word; - - struct Bits - { - WORD Size:11; // bits 0-10 - WORD AdditionalXactions:2; // bits 11-12 - WORD Reserved:3; // bits 13-15 - } Bits; - -} USBMAXPACKET; - -C_ASSERT((sizeof(USBMAXPACKET) == sizeof(WORD))); - - -typedef struct _USBENDPOINTDESC -{ - BYTE bLength; - BYTE bDescriptorType; - USBENDPOINTADDRESS Address; - USBENDPOINTATTRIBS Attributes; - USBMAXPACKET MaxPacket; - BYTE bInterval; -} USBENDPOINTDESC; - - -typedef struct _USBQUALIFIERDESC -{ - BYTE bLength; - BYTE bDescriptorType; - USHORT usUSB; - BYTE bDeviceClass; - BYTE bDeviceSubClass; - BYTE bProtocol; - BYTE bMaxPacket; - BYTE bNumConfigs; - BYTE bReserved; -} USBQUALIFIERDESC; - - -typedef struct _USBSTRINGDESC -{ - BYTE bLength; - BYTE bDescriptorType; - WCHAR wchData[1]; -} USBSTRINGDESC; - - -typedef struct _USBSTRINGLANGIDS -{ - BYTE bLength; - BYTE bDescriptorType; - WORD wLANGIDs[1]; -} USBSTRINGLANGIDS; - - -typedef struct _USBHIDSTANDARDDESC -{ - BYTE bLength; - BYTE bDescriptorType; - USHORT bcdHID; - BYTE bCountryCode; - BYTE bNumDescriptors; -} USBHIDSTANDARDDESC; - - -typedef struct _USBHIDOPTIONALDESC -{ - BYTE bClassDescriptorType; - USHORT usDescriptorLength; -} USBHIDOPTIONALDESC; - - -typedef struct _USBPHYSICALDESCSET0 -{ - BYTE bNumber; - BYTE bLength; -} USBPHYSICALDESCSET0; - - -typedef union _USBPHYSICALDESCSET -{ - BYTE bPhysicalInfo; - - struct Bits - { - BYTE bPreference : 5; - BYTE bBias : 3; - } Bits; -} USBPHYSICALDESCSET; - - -typedef struct _USBPHYSICALDESCITEM -{ - BYTE bDesignator; - - union Flags - { - BYTE bFlags; - - struct Bits - { - BYTE bEffort : 5; - BYTE bQualifier : 3; - } Bits; - - } Flags; - -} USBPHYSICALDESCITEM; - - -typedef union _USBHUBCHARACTERISTICS -{ - WORD wHubCharacteristics; - - struct Bits - { - BYTE bLogicalPowerSwitchingMode : 2; - BYTE fCompoundDevice : 1; - BYTE bOverCurrentMode : 2; - BYTE bTTThinkTime : 2; - BYTE fPortIndicatorSupport : 1; - BYTE bReserved : 8; - } Bits; - -} USBHUBCHARACTERISTICS; - -#if !defined(MIDL_PASS) -C_ASSERT((sizeof(USBHUBCHARACTERISTICS) == sizeof(WORD))); -#endif - - -typedef struct _USBHUBDESC -{ - BYTE bLength; - BYTE bDescriptorType; - BYTE bNumberOfPorts; - USBHUBCHARACTERISTICS Characteristics; - BYTE bPwrOn2PwrGood; - BYTE bHubContrCurrent; - BYTE bDeviceRemovable[32]; // Defined as its maximum possible size for 255 ports - BYTE bPortPwrCtrlMask[32]; // Defined as its maximum possible size for 255 ports -} USBHUBDESC; - -#if !defined(MIDL_PASS) -C_ASSERT((sizeof(USBHUBDESC) == 71)); -#endif - - -typedef union _USBHUBPORTSTATUS -{ - WORD wPortStatus; - - struct Bits - { - BYTE fCurrentConnectionStatus : 1; - BYTE fEnabled : 1; - BYTE fSuspend : 1; - BYTE fOverCurrent : 1; - BYTE fReset : 1; - BYTE bReserved1 : 3; - BYTE fPortPower : 1; - BYTE fLowSpeedDevice : 1; - BYTE fHighSpeedDevice : 1; - BYTE fTestMode : 1; - BYTE fPortIndicatorControl : 1; - BYTE bReserved2 : 3; - } Bits; -} USBHUBPORTSTATUS; - -#if !defined(MIDL_PASS) -C_ASSERT((sizeof(USBHUBPORTSTATUS) == sizeof(WORD))); -#endif - - -typedef union _USBHUBPORTSTATUSCHANGE -{ - WORD wPortStatusChange; - - struct Bits - { - BYTE fConnectionStatusChange : 1; - BYTE fEnabledChange : 1; - BYTE fSuspendChange : 1; - BYTE fOverCurrentChange : 1; - BYTE fResetChange : 1; - BYTE bReserved1 : 3; - BYTE bReserved2 : 8; - } Bits; -} USBHUBPORTSTATUSCHANGE; - -#if !defined(MIDL_PASS) -C_ASSERT((sizeof(USBHUBPORTSTATUSCHANGE) == sizeof(WORD))); -#endif - - -typedef struct _USBHUBPORTDATA -{ - USBHUBPORTSTATUS PortStatus; - USBHUBPORTSTATUSCHANGE PortStatusChange; -} USBHUBPORTDATA; - - - -// USB Language Identifiers -// -// These are taken directly from http://www.usb.org/developers/docs/USB_LANGIDs.pdf - -// USB_MAKE_LANGID(lang, sublang) -// -// Use this macro to create a language ID. For example, for US English -// use: -// -// USB_MAKE_LANGID(USB_LANG_ENGLISH, USB_SUBLANG_ENGLISH_US) - -#define USB_MAKE_LANGID(lang, sublang) ((((USHORT)(sublang)) << 10) | (USHORT)(lang)) - - -#define USB_LANG_RESERVED 0x00 -#define USB_LANG_ARABIC 0x01 -#define USB_LANG_BULGARIAN 0x02 -#define USB_LANG_CATALAN 0x03 -#define USB_LANG_CHINESE 0x04 -#define USB_LANG_CZECH 0x05 -#define USB_LANG_DANISH 0x06 -#define USB_LANG_GERMAN 0x07 -#define USB_LANG_GREEK 0x08 -#define USB_LANG_ENGLISH 0x09 -#define USB_LANG_SPANISH 0x0a -#define USB_LANG_FINNISH 0x0b -#define USB_LANG_FRENCH 0x0c -#define USB_LANG_HEBREW 0x0d -#define USB_LANG_HUNGARIAN 0x0e -#define USB_LANG_ICELANDIC 0x0f -#define USB_LANG_ITALIAN 0x10 -#define USB_LANG_JAPANESE 0x11 -#define USB_LANG_KOREAN 0x12 -#define USB_LANG_DUTCH 0x13 -#define USB_LANG_NORWEGIAN 0x14 -#define USB_LANG_POLISH 0x15 -#define USB_LANG_PORTUGUESE 0x16 -#define USB_LANG_ROMANIAN 0x18 -#define USB_LANG_RUSSIAN 0x19 -#define USB_LANG_CROATIAN 0x1a -#define USB_LANG_SERBIAN 0x1a -#define USB_LANG_SLOVAK 0x1b -#define USB_LANG_ALBANIAN 0x1c -#define USB_LANG_SWEDISH 0x1d -#define USB_LANG_THAI 0x1e -#define USB_LANG_TURKISH 0x1f -#define USB_LANG_URDU 0x20 -#define USB_LANG_INDONESIAN 0x21 -#define USB_LANG_UKRANIAN 0x22 -#define USB_LANG_BELARUSIAN 0x23 -#define USB_LANG_SLOVENIAN 0x24 -#define USB_LANG_ESTONIAN 0x25 -#define USB_LANG_LATVIAN 0x26 -#define USB_LANG_LITHUANIAN 0x27 -#define USB_LANG_FARSI 0x29 -#define USB_LANG_VIETNAMESE 0x2a -#define USB_LANG_ARMENIAN 0x2b -#define USB_LANG_AZERI 0x2c -#define USB_LANG_BASQUE 0x2d -#define USB_LANG_MACEDONIAN 0x2f // This is actually Macedonian (FYROM) -#define USB_LANG_AFRIKAANS 0x36 -#define USB_LANG_GEORGIAN 0x37 -#define USB_LANG_FAEROESE 0x38 -#define USB_LANG_HINDI 0x39 -#define USB_LANG_MALAY 0x3e -#define USB_LANG_KAZAK 0x3f -#define USB_LANG_SWAHILI 0x41 -#define USB_LANG_UZBEK 0x43 -#define USB_LANG_TATAR 0x44 -#define USB_LANG_BENGALI 0x45 -#define USB_LANG_PUNJABI 0x46 -#define USB_LANG_GUJARATI 0x47 -#define USB_LANG_ORIYA 0x48 -#define USB_LANG_TAMIL 0x49 -#define USB_LANG_TELUGU 0x4a -#define USB_LANG_KANNADA 0x4b -#define USB_LANG_MALAYALAM 0x4c -#define USB_LANG_ASSAMESE 0x4d -#define USB_LANG_MARATHI 0x4e -#define USB_LANG_SANSKRIT 0x4f -#define USB_LANG_KONKANI 0x57 -#define USB_LANG_MANIPURI 0x58 -#define USB_LANG_SINDHI 0x59 -#define USB_LANG_KASHMIRI 0x60 -#define USB_LANG_NEPALI 0x61 -#define USB_LANG_HID 0xff - -#define USB_SUBLANG_ARABIC_SAUDI_ARABIA 0x01 -#define USB_SUBLANG_ARABIC_SAUDI_ARABIA 0x01 -#define USB_SUBLANG_ARABIC_IRAQ 0x02 -#define USB_SUBLANG_ARABIC_EGYPT 0x03 -#define USB_SUBLANG_ARABIC_LIBYA 0x04 -#define USB_SUBLANG_ARABIC_ALGERIA 0x05 -#define USB_SUBLANG_ARABIC_MOROCCO 0x06 -#define USB_SUBLANG_ARABIC_TUNISIA 0x07 -#define USB_SUBLANG_ARABIC_OMAN 0x08 -#define USB_SUBLANG_ARABIC_YEMEN 0x09 -#define USB_SUBLANG_ARABIC_SYRIA 0x10 -#define USB_SUBLANG_ARABIC_JORDAN 0x11 -#define USB_SUBLANG_ARABIC_LEBANON 0x12 -#define USB_SUBLANG_ARABIC_KUWAIT 0x13 -#define USB_SUBLANG_ARABIC_UAE 0x14 -#define USB_SUBLANG_ARABIC_BAHRAIN 0x15 -#define USB_SUBLANG_ARABIC_QATAR 0x16 -#define USB_SUBLANG_AZERI_CYRILLIC 0x01 -#define USB_SUBLANG_AZERI_LATIN 0x02 -#define USB_SUBLANG_CHINESE_TRADITIONAL 0x01 -#define USB_SUBLANG_CHINESE_SIMPLIFIED 0x02 -#define USB_SUBLANG_CHINESE_HONGKONG 0x03 -#define USB_SUBLANG_CHINESE_SINGAPORE 0x04 -#define USB_SUBLANG_CHINESE_MACAU 0x05 -#define USB_SUBLANG_DUTCH 0x01 -#define USB_SUBLANG_DUTCH_BELGIAN 0x02 -#define USB_SUBLANG_ENGLISH_US 0x01 -#define USB_SUBLANG_ENGLISH_UK 0x02 -#define USB_SUBLANG_ENGLISH_AUS 0x03 -#define USB_SUBLANG_ENGLISH_CAN 0x04 -#define USB_SUBLANG_ENGLISH_NZ 0x05 -#define USB_SUBLANG_ENGLISH_EIRE 0x06 -#define USB_SUBLANG_ENGLISH_SOUTH_AFRICA 0x07 -#define USB_SUBLANG_ENGLISH_JAMAICA 0x08 -#define USB_SUBLANG_ENGLISH_CARIBBEAN 0x09 -#define USB_SUBLANG_ENGLISH_BELIZE 0x0a -#define USB_SUBLANG_ENGLISH_TRINIDAD 0x0b -#define USB_SUBLANG_ENGLISH_PHILIPPINES 0x0c -#define USB_SUBLANG_ENGLISH_ZIMBABWE 0x0d -#define USB_SUBLANG_FRENCH 0x01 -#define USB_SUBLANG_FRENCH_BELGIAN 0x02 -#define USB_SUBLANG_FRENCH_CANADIAN 0x03 -#define USB_SUBLANG_FRENCH_SWISS 0x04 -#define USB_SUBLANG_FRENCH_LUXEMBOURG 0x05 -#define USB_SUBLANG_FRENCH_MONACO 0x06 -#define USB_SUBLANG_GERMAN 0x01 -#define USB_SUBLANG_GERMAN_SWISS 0x02 -#define USB_SUBLANG_GERMAN_AUSTRIAN 0x03 -#define USB_SUBLANG_GERMAN_LUXEMBOURG 0x04 -#define USB_SUBLANG_GERMAN_LIECHTENSTEIN 0x05 -#define USB_SUBLANG_ITALIAN 0x01 -#define USB_SUBLANG_ITALIAN_SWISS 0x02 -#define USB_SUBLANG_KASHMIRI_INDIA 0x02 -#define USB_SUBLANG_KOREAN 0x01 -#define USB_SUBLANG_LITHUANIAN 0x01 -#define USB_SUBLANG_MALAY_MALAYSIA 0x01 -#define USB_SUBLANG_MALAY_BRUNEI_DARUSSALAM 0x02 -#define USB_SUBLANG_NEPALI_INDIA 0x02 -#define USB_SUBLANG_NORWEGIAN_BOKMAL 0x01 -#define USB_SUBLANG_NORWEGIAN_NYNORSK 0x02 -#define USB_SUBLANG_PORTUGUESE 0x01 -#define USB_SUBLANG_PORTUGUESE_BRAZILIAN 0x02 -#define USB_SUBLANG_SERBIAN_LATIN 0x02 -#define USB_SUBLANG_SERBIAN_CYRILLIC 0x03 -#define USB_SUBLANG_SPANISH 0x01 -#define USB_SUBLANG_SPANISH_MEXICAN 0x02 -#define USB_SUBLANG_SPANISH_MODERN 0x03 -#define USB_SUBLANG_SPANISH_GUATEMALA 0x04 -#define USB_SUBLANG_SPANISH_COSTA_RICA 0x05 -#define USB_SUBLANG_SPANISH_PANAMA 0x06 -#define USB_SUBLANG_SPANISH_DOMINICAN_REPUBLIC 0x07 -#define USB_SUBLANG_SPANISH_VENEZUELA 0x08 -#define USB_SUBLANG_SPANISH_COLOMBIA 0x09 -#define USB_SUBLANG_SPANISH_PERU 0x0a -#define USB_SUBLANG_SPANISH_ARGENTINA 0x0b -#define USB_SUBLANG_SPANISH_ECUADOR 0x0c -#define USB_SUBLANG_SPANISH_CHILE 0x0d -#define USB_SUBLANG_SPANISH_URUGUAY 0x0e -#define USB_SUBLANG_SPANISH_PARAGUAY 0x0f -#define USB_SUBLANG_SPANISH_BOLIVIA 0x10 -#define USB_SUBLANG_SPANISH_EL_SALVADOR 0x11 -#define USB_SUBLANG_SPANISH_HONDURAS 0x12 -#define USB_SUBLANG_SPANISH_NICARAGUA 0x13 -#define USB_SUBLANG_SPANISH_PUERTO_RICO 0x14 -#define USB_SUBLANG_SWEDISH 0x01 -#define USB_SUBLANG_SWEDISH_FINLAND 0x02 -#define USB_SUBLANG_URDU_PAKISTAN 0x01 -#define USB_SUBLANG_URDU_INDIA 0x02 -#define USB_SUBLANG_UZBEK_LATIN 0x01 -#define USB_SUBLANG_UZBEK_CYRILLIC 0x02 -#define USB_SUBLANG_HID_USAGE_DATA_DESCRIPTOR 0x01 -#define USB_SUBLANG_HID_VENDOR_DEFINED_1 0x3c -#define USB_SUBLANG_HID_VENDOR_DEFINED_2 0x3d -#define USB_SUBLANG_HID_VENDOR_DEFINED_3 0x3e -#define USB_SUBLANG_HID_VENDOR_DEFINED_4 0x3f - -#endif // !defined(MIDL_PASS) - - - -#include - - - -#endif //_USBPROTOCOLDEFS_H_ - diff --git a/qt-correction-tool/pub/ddk/accctrl.h b/qt-correction-tool/pub/ddk/accctrl.h deleted file mode 100644 index e32d237..0000000 --- a/qt-correction-tool/pub/ddk/accctrl.h +++ /dev/null @@ -1,802 +0,0 @@ -/*+------------------------------------------------------------------- - - Microsoft Windows - Copyright (C) Microsoft Corporation, 1993-1998. - - File: accctrl.h - - Contents: common includes for new style Win32 Access Control - APIs - - ---------------------------------------------------------------------*/ -#ifndef __ACCESS_CONTROL__ -#define __ACCESS_CONTROL__ - -#ifndef __midl -#include -#endif - -#if (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#endif -#pragma warning(disable:4001) /* nonstandard extension : single line comment */ -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define AccFree LocalFree - -// -// Definition: -// This enumerated type defines the objects supported by the get/set API within -// this document. See section 3.1, Object Types for a detailed definition of the -// supported object types, and their name formats. -// -typedef enum _SE_OBJECT_TYPE -{ - SE_UNKNOWN_OBJECT_TYPE = 0, - SE_FILE_OBJECT, - SE_SERVICE, - SE_PRINTER, - SE_REGISTRY_KEY, - SE_LMSHARE, - SE_KERNEL_OBJECT, - SE_WINDOW_OBJECT, - SE_DS_OBJECT, - SE_DS_OBJECT_ALL, - SE_PROVIDER_DEFINED_OBJECT, - SE_WMIGUID_OBJECT, - SE_REGISTRY_WOW64_32KEY, -} SE_OBJECT_TYPE; - -// -// Definition: TRUSTEE_TYPE -// This enumerated type specifies the type of trustee account for the trustee -// returned by the API described in this document. -// TRUSTEE_IS_UNKNOWN - The trustee is an unknown, but not necessarily invalid -// type. This field is not validated on input to the APIs -// that take Trustees. -// TRUSTEE_IS_USER The trustee account is a user account. -// TRUSTEE_IS_GROUP The trustee account is a group account. -// - -typedef enum _TRUSTEE_TYPE -{ - TRUSTEE_IS_UNKNOWN, - TRUSTEE_IS_USER, - TRUSTEE_IS_GROUP, - TRUSTEE_IS_DOMAIN, - TRUSTEE_IS_ALIAS, - TRUSTEE_IS_WELL_KNOWN_GROUP, - TRUSTEE_IS_DELETED, - TRUSTEE_IS_INVALID, - TRUSTEE_IS_COMPUTER -} TRUSTEE_TYPE; - - -// -// Definition: TRUSTEE_FORM -// This enumerated type specifies the form the trustee identifier is in for a -// particular trustee. -// TRUSTEE_IS_SID The trustee is identified with a SID rather than with a name. -// TRUSTEE_IS_NAME The trustee is identified with a name. -// - -typedef enum _TRUSTEE_FORM -{ - TRUSTEE_IS_SID, - TRUSTEE_IS_NAME, - TRUSTEE_BAD_FORM, - TRUSTEE_IS_OBJECTS_AND_SID, - TRUSTEE_IS_OBJECTS_AND_NAME -} TRUSTEE_FORM; - - -// -// Definition: MULTIPLE_TRUSTEE_OPERATION -// If the trustee is a multiple trustee, this enumerated type specifies the type. -// TRUSTEE_IS_IMPERSONATE The trustee is an impersonate trustee and the multiple -// trustee field in the trustee points to another trustee -// that is a trustee for the server that will be doing the -// impersonation. -// - -typedef enum _MULTIPLE_TRUSTEE_OPERATION -{ - NO_MULTIPLE_TRUSTEE, - TRUSTEE_IS_IMPERSONATE, -} MULTIPLE_TRUSTEE_OPERATION; - - -typedef struct _OBJECTS_AND_SID -{ - DWORD ObjectsPresent; - GUID ObjectTypeGuid; - GUID InheritedObjectTypeGuid; - SID * pSid; -} OBJECTS_AND_SID, *POBJECTS_AND_SID; - -typedef struct _OBJECTS_AND_NAME_A -{ - DWORD ObjectsPresent; - SE_OBJECT_TYPE ObjectType; - LPSTR ObjectTypeName; - LPSTR InheritedObjectTypeName; - LPSTR ptstrName; -} OBJECTS_AND_NAME_A, *POBJECTS_AND_NAME_A; -typedef struct _OBJECTS_AND_NAME_W -{ - DWORD ObjectsPresent; - SE_OBJECT_TYPE ObjectType; - LPWSTR ObjectTypeName; - LPWSTR InheritedObjectTypeName; - LPWSTR ptstrName; -} OBJECTS_AND_NAME_W, *POBJECTS_AND_NAME_W; -#ifdef UNICODE -typedef OBJECTS_AND_NAME_W OBJECTS_AND_NAME_; -typedef POBJECTS_AND_NAME_W POBJECTS_AND_NAME_; -#else -typedef OBJECTS_AND_NAME_A OBJECTS_AND_NAME_; -typedef POBJECTS_AND_NAME_A POBJECTS_AND_NAME_; -#endif // UNICODE - -// -// Definition: TRUSTEE -// This structure is used to pass account information into and out of the system -// using the API defined in this document. -// PMultipleTrustee - if NON-NULL, points to another trustee structure, as -// defined by the multiple trustee operation field. -// MultipleTrusteeOperation - Defines the multiple trustee operation/type. -// TrusteeForm - defines if the trustee is defined by name or SID. -// TrusteeType - defines if the trustee type is unknown, a user or a group. -// PwcsName - points to the trustee name or the trustee SID. -// - -typedef struct _TRUSTEE_A -{ - struct _TRUSTEE_A *pMultipleTrustee; - MULTIPLE_TRUSTEE_OPERATION MultipleTrusteeOperation; - TRUSTEE_FORM TrusteeForm; - TRUSTEE_TYPE TrusteeType; -#ifdef __midl - [switch_is(TrusteeForm)] - union - { - [case(TRUSTEE_IS_NAME)] - LPSTR ptstrName; - [case(TRUSTEE_IS_SID)] - SID *pSid; - [case(TRUSTEE_IS_OBJECTS_AND_SID)] - OBJECTS_AND_SID *pObjectsAndSid; - [case(TRUSTEE_IS_OBJECTS_AND_NAME)] - OBJECTS_AND_NAME_A *pObjectsAndName; - }; -#else - LPSTR ptstrName; -#endif -} TRUSTEE_A, *PTRUSTEE_A, TRUSTEEA, *PTRUSTEEA; -typedef struct _TRUSTEE_W -{ - struct _TRUSTEE_W *pMultipleTrustee; - MULTIPLE_TRUSTEE_OPERATION MultipleTrusteeOperation; - TRUSTEE_FORM TrusteeForm; - TRUSTEE_TYPE TrusteeType; -#ifdef __midl - [switch_is(TrusteeForm)] - union - { - [case(TRUSTEE_IS_NAME)] - LPWSTR ptstrName; - [case(TRUSTEE_IS_SID)] - SID *pSid; - [case(TRUSTEE_IS_OBJECTS_AND_SID)] - OBJECTS_AND_SID *pObjectsAndSid; - [case(TRUSTEE_IS_OBJECTS_AND_NAME)] - OBJECTS_AND_NAME_W *pObjectsAndName; - }; -#else - LPWSTR ptstrName; -#endif -} TRUSTEE_W, *PTRUSTEE_W, TRUSTEEW, *PTRUSTEEW; -#ifdef UNICODE -typedef TRUSTEE_W TRUSTEE_; -typedef PTRUSTEE_W PTRUSTEE_; -typedef TRUSTEEW TRUSTEE; -typedef PTRUSTEEW PTRUSTEE; -#else -typedef TRUSTEE_A TRUSTEE_; -typedef PTRUSTEE_A PTRUSTEE_; -typedef TRUSTEEA TRUSTEE; -typedef PTRUSTEEA PTRUSTEE; -#endif // UNICODE - -// -// Definition: ACCESS_MODE -// This enumerated type specifies how permissions are (requested)/to be applied -// for the trustee by the access control entry. On input this field can by any -// of the values, although it is not meaningful to mix access control and audit -// control entries. On output this field will be either SET_ACCESS, DENY_ACCESS, -// SET_AUDIT_SUCCESS, SET_AUDIT_FAILURE. -// The following descriptions define how this type effects an explicit access -// request to apply access permissions to an object. -// GRANT_ACCESS - The trustee will have at least the requested permissions upon -// successful completion of the command. (If the trustee has -// additional permissions they will not be removed). -// SET_ACCESS - The trustee will have exactly the requested permissions upon -// successful completion of the command. -// DENY_ACCESS - The trustee will be denied the specified permissions. -// REVOKE_ACCESS - Any explicit access rights the trustee has will be revoked. -// SET_AUDIT_SUCCESS - The trustee will be audited for successful opens of the -// object using the requested permissions. -// SET_AUDIT_FAILURE - The trustee will be audited for failed opens of the object -// using the requested permissions. -// - -typedef enum _ACCESS_MODE -{ - NOT_USED_ACCESS = 0, - GRANT_ACCESS, - SET_ACCESS, - DENY_ACCESS, - REVOKE_ACCESS, - SET_AUDIT_SUCCESS, - SET_AUDIT_FAILURE -} ACCESS_MODE; - -// -// Definition: Inheritance flags -// These bit masks are provided to allow simple application of inheritance in -// explicit access requests on containers. -// NO_INHERITANCE The specific access permissions will only be applied to -// the container, and will not be inherited by objects created -// within the container. -// SUB_CONTAINERS_ONLY_INHERIT The specific access permissions will be inherited -// and applied to sub containers created within the -// container, and will be applied to the container -// itself. -// SUB_OBJECTS_ONLY_INHERIT The specific access permissions will only be inherited -// by objects created within the specific container. -// The access permissions will not be applied to the -// container itself. -// SUB_CONTAINERS_AND_OBJECTS_INHERIT The specific access permissions will be -// inherited by containers created within the -// specific container, will be applied to -// objects created within the container, but -// will not be applied to the container itself. -// -#define NO_INHERITANCE 0x0 -#define SUB_OBJECTS_ONLY_INHERIT 0x1 -#define SUB_CONTAINERS_ONLY_INHERIT 0x2 -#define SUB_CONTAINERS_AND_OBJECTS_INHERIT 0x3 -#define INHERIT_NO_PROPAGATE 0x4 -#define INHERIT_ONLY 0x8 - -// -// Informational bit that is returned -// -#define INHERITED_ACCESS_ENTRY 0x10 - -// -// Informational bit that tells where a node was inherited from. Valid only -// for NT 5 APIs -// -#define INHERITED_PARENT 0x10000000 -#define INHERITED_GRANDPARENT 0x20000000 - - -// -// Definition: EXPLICIT_ACCESS -// This structure is used to pass access control entry information into and out -// of the system using the API defined in this document. -// grfAccessPermissions - This contains the access permissions to assign for the -// trustee. It is in the form of an NT access mask. -// grfAccessMode - This field defines how the permissions are to be applied for -// the trustee. -// grfInheritance - For containers, this field defines how the access control -// entry is/(is requested) to be inherited on -// objects/sub-containers created within the container. -// Trustee - This field contains the definition of the trustee account the -// explicit access applies to. -// - -typedef struct _EXPLICIT_ACCESS_A -{ - DWORD grfAccessPermissions; - ACCESS_MODE grfAccessMode; - DWORD grfInheritance; - TRUSTEE_A Trustee; -} EXPLICIT_ACCESS_A, *PEXPLICIT_ACCESS_A, EXPLICIT_ACCESSA, *PEXPLICIT_ACCESSA; -typedef struct _EXPLICIT_ACCESS_W -{ - DWORD grfAccessPermissions; - ACCESS_MODE grfAccessMode; - DWORD grfInheritance; - TRUSTEE_W Trustee; -} EXPLICIT_ACCESS_W, *PEXPLICIT_ACCESS_W, EXPLICIT_ACCESSW, *PEXPLICIT_ACCESSW; -#ifdef UNICODE -typedef EXPLICIT_ACCESS_W EXPLICIT_ACCESS_; -typedef PEXPLICIT_ACCESS_W PEXPLICIT_ACCESS_; -typedef EXPLICIT_ACCESSW EXPLICIT_ACCESS; -typedef PEXPLICIT_ACCESSW PEXPLICIT_ACCESS; -#else -typedef EXPLICIT_ACCESS_A EXPLICIT_ACCESS_; -typedef PEXPLICIT_ACCESS_A PEXPLICIT_ACCESS_; -typedef EXPLICIT_ACCESSA EXPLICIT_ACCESS; -typedef PEXPLICIT_ACCESSA PEXPLICIT_ACCESS; -#endif // UNICODE - - - -//---------------------------------------------------------------------------- -// -// NT5 APIs -// -//---------------------------------------------------------------------------- - -// -// Default provider -// -#define ACCCTRL_DEFAULT_PROVIDERA "Windows NT Access Provider" -#define ACCCTRL_DEFAULT_PROVIDERW L"Windows NT Access Provider" - -#ifdef UNICODE -#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERW -#else -#define ACCCTRL_DEFAULT_PROVIDER ACCCTRL_DEFAULT_PROVIDERA -#endif - - - - -// -/// Access rights -// -typedef ULONG ACCESS_RIGHTS, *PACCESS_RIGHTS; - -// -// Inheritance flags -// -typedef ULONG INHERIT_FLAGS, *PINHERIT_FLAGS; - - -// -// Access / Audit structures -// -typedef struct _ACTRL_ACCESS_ENTRYA -{ - TRUSTEE_A Trustee; - ULONG fAccessFlags; - ACCESS_RIGHTS Access; - ACCESS_RIGHTS ProvSpecificAccess; - INHERIT_FLAGS Inheritance; - LPSTR lpInheritProperty; -} ACTRL_ACCESS_ENTRYA, *PACTRL_ACCESS_ENTRYA; -// -// Access / Audit structures -// -typedef struct _ACTRL_ACCESS_ENTRYW -{ - TRUSTEE_W Trustee; - ULONG fAccessFlags; - ACCESS_RIGHTS Access; - ACCESS_RIGHTS ProvSpecificAccess; - INHERIT_FLAGS Inheritance; - LPWSTR lpInheritProperty; -} ACTRL_ACCESS_ENTRYW, *PACTRL_ACCESS_ENTRYW; -#ifdef UNICODE -typedef ACTRL_ACCESS_ENTRYW ACTRL_ACCESS_ENTRY; -typedef PACTRL_ACCESS_ENTRYW PACTRL_ACCESS_ENTRY; -#else -typedef ACTRL_ACCESS_ENTRYA ACTRL_ACCESS_ENTRY; -typedef PACTRL_ACCESS_ENTRYA PACTRL_ACCESS_ENTRY; -#endif // UNICODE - - - -typedef struct _ACTRL_ACCESS_ENTRY_LISTA -{ - ULONG cEntries; -#ifdef __midl - [size_is(cEntries)] -#endif - ACTRL_ACCESS_ENTRYA *pAccessList; -} ACTRL_ACCESS_ENTRY_LISTA, *PACTRL_ACCESS_ENTRY_LISTA; -typedef struct _ACTRL_ACCESS_ENTRY_LISTW -{ - ULONG cEntries; -#ifdef __midl - [size_is(cEntries)] -#endif - ACTRL_ACCESS_ENTRYW *pAccessList; -} ACTRL_ACCESS_ENTRY_LISTW, *PACTRL_ACCESS_ENTRY_LISTW; -#ifdef UNICODE -typedef ACTRL_ACCESS_ENTRY_LISTW ACTRL_ACCESS_ENTRY_LIST; -typedef PACTRL_ACCESS_ENTRY_LISTW PACTRL_ACCESS_ENTRY_LIST; -#else -typedef ACTRL_ACCESS_ENTRY_LISTA ACTRL_ACCESS_ENTRY_LIST; -typedef PACTRL_ACCESS_ENTRY_LISTA PACTRL_ACCESS_ENTRY_LIST; -#endif // UNICODE - - - -typedef struct _ACTRL_PROPERTY_ENTRYA -{ - LPSTR lpProperty; - PACTRL_ACCESS_ENTRY_LISTA pAccessEntryList; - ULONG fListFlags; -} ACTRL_PROPERTY_ENTRYA, *PACTRL_PROPERTY_ENTRYA; -typedef struct _ACTRL_PROPERTY_ENTRYW -{ - LPWSTR lpProperty; - PACTRL_ACCESS_ENTRY_LISTW pAccessEntryList; - ULONG fListFlags; -} ACTRL_PROPERTY_ENTRYW, *PACTRL_PROPERTY_ENTRYW; -#ifdef UNICODE -typedef ACTRL_PROPERTY_ENTRYW ACTRL_PROPERTY_ENTRY; -typedef PACTRL_PROPERTY_ENTRYW PACTRL_PROPERTY_ENTRY; -#else -typedef ACTRL_PROPERTY_ENTRYA ACTRL_PROPERTY_ENTRY; -typedef PACTRL_PROPERTY_ENTRYA PACTRL_PROPERTY_ENTRY; -#endif // UNICODE - - - -typedef struct _ACTRL_ALISTA -{ - ULONG cEntries; -#ifdef __midl - [size_is(cEntries)] -#endif - PACTRL_PROPERTY_ENTRYA pPropertyAccessList; -} ACTRL_ACCESSA, *PACTRL_ACCESSA, ACTRL_AUDITA, *PACTRL_AUDITA; -typedef struct _ACTRL_ALISTW -{ - ULONG cEntries; -#ifdef __midl - [size_is(cEntries)] -#endif - PACTRL_PROPERTY_ENTRYW pPropertyAccessList; -} ACTRL_ACCESSW, *PACTRL_ACCESSW, ACTRL_AUDITW, *PACTRL_AUDITW; -#ifdef UNICODE -typedef ACTRL_ACCESSW ACTRL_ACCESS; -typedef PACTRL_ACCESSW PACTRL_ACCESS; -typedef ACTRL_AUDITW ACTRL_AUDIT; -typedef PACTRL_AUDITW PACTRL_AUDIT; -#else -typedef ACTRL_ACCESSA ACTRL_ACCESS; -typedef PACTRL_ACCESSA PACTRL_ACCESS; -typedef ACTRL_AUDITA ACTRL_AUDIT; -typedef PACTRL_AUDITA PACTRL_AUDIT; -#endif // UNICODE - - - -// -// TRUSTEE_ACCESS flags -// -#define TRUSTEE_ACCESS_ALLOWED 0x00000001L -#define TRUSTEE_ACCESS_READ 0x00000002L -#define TRUSTEE_ACCESS_WRITE 0x00000004L - -#define TRUSTEE_ACCESS_EXPLICIT 0x00000001L -#define TRUSTEE_ACCESS_READ_WRITE (TRUSTEE_ACCESS_READ | \ - TRUSTEE_ACCESS_WRITE) - - -#define TRUSTEE_ACCESS_ALL 0xFFFFFFFFL - -typedef struct _TRUSTEE_ACCESSA -{ - LPSTR lpProperty; - ACCESS_RIGHTS Access; - ULONG fAccessFlags; - ULONG fReturnedAccess; -} TRUSTEE_ACCESSA, *PTRUSTEE_ACCESSA; -typedef struct _TRUSTEE_ACCESSW -{ - LPWSTR lpProperty; - ACCESS_RIGHTS Access; - ULONG fAccessFlags; - ULONG fReturnedAccess; -} TRUSTEE_ACCESSW, *PTRUSTEE_ACCESSW; -#ifdef UNICODE -typedef TRUSTEE_ACCESSW TRUSTEE_ACCESS; -typedef PTRUSTEE_ACCESSW PTRUSTEE_ACCESS; -#else -typedef TRUSTEE_ACCESSA TRUSTEE_ACCESS; -typedef PTRUSTEE_ACCESSA PTRUSTEE_ACCESS; -#endif // UNICODE - - - -// -// Generic permission values -// -#define ACTRL_RESERVED 0x00000000 -#define ACTRL_PERM_1 0x00000001 -#define ACTRL_PERM_2 0x00000002 -#define ACTRL_PERM_3 0x00000004 -#define ACTRL_PERM_4 0x00000008 -#define ACTRL_PERM_5 0x00000010 -#define ACTRL_PERM_6 0x00000020 -#define ACTRL_PERM_7 0x00000040 -#define ACTRL_PERM_8 0x00000080 -#define ACTRL_PERM_9 0x00000100 -#define ACTRL_PERM_10 0x00000200 -#define ACTRL_PERM_11 0x00000400 -#define ACTRL_PERM_12 0x00000800 -#define ACTRL_PERM_13 0x00001000 -#define ACTRL_PERM_14 0x00002000 -#define ACTRL_PERM_15 0x00004000 -#define ACTRL_PERM_16 0x00008000 -#define ACTRL_PERM_17 0x00010000 -#define ACTRL_PERM_18 0x00020000 -#define ACTRL_PERM_19 0x00040000 -#define ACTRL_PERM_20 0x00080000 - -// -// Access permissions -// -#define ACTRL_ACCESS_ALLOWED 0x00000001 -#define ACTRL_ACCESS_DENIED 0x00000002 -#define ACTRL_AUDIT_SUCCESS 0x00000004 -#define ACTRL_AUDIT_FAILURE 0x00000008 - -// -// Property list flags -// -#define ACTRL_ACCESS_PROTECTED 0x00000001 - -// -// Standard and object rights -// -#define ACTRL_SYSTEM_ACCESS 0x04000000 -#define ACTRL_DELETE 0x08000000 -#define ACTRL_READ_CONTROL 0x10000000 -#define ACTRL_CHANGE_ACCESS 0x20000000 -#define ACTRL_CHANGE_OWNER 0x40000000 -#define ACTRL_SYNCHRONIZE 0x80000000 -#define ACTRL_STD_RIGHTS_ALL 0xf8000000 -#define ACTRL_STD_RIGHT_REQUIRED ( ACTRL_STD_RIGHTS_ALL & ~ACTRL_SYNCHRONIZE ) - -#ifndef _DS_CONTROL_BITS_DEFINED_ -#define _DS_CONTROL_BITS_DEFINED_ -#define ACTRL_DS_OPEN ACTRL_RESERVED -#define ACTRL_DS_CREATE_CHILD ACTRL_PERM_1 -#define ACTRL_DS_DELETE_CHILD ACTRL_PERM_2 -#define ACTRL_DS_LIST ACTRL_PERM_3 -#define ACTRL_DS_SELF ACTRL_PERM_4 -#define ACTRL_DS_READ_PROP ACTRL_PERM_5 -#define ACTRL_DS_WRITE_PROP ACTRL_PERM_6 -#define ACTRL_DS_DELETE_TREE ACTRL_PERM_7 -#define ACTRL_DS_LIST_OBJECT ACTRL_PERM_8 -#define ACTRL_DS_CONTROL_ACCESS ACTRL_PERM_9 -#endif - -#define ACTRL_FILE_READ ACTRL_PERM_1 -#define ACTRL_FILE_WRITE ACTRL_PERM_2 -#define ACTRL_FILE_APPEND ACTRL_PERM_3 -#define ACTRL_FILE_READ_PROP ACTRL_PERM_4 -#define ACTRL_FILE_WRITE_PROP ACTRL_PERM_5 -#define ACTRL_FILE_EXECUTE ACTRL_PERM_6 -#define ACTRL_FILE_READ_ATTRIB ACTRL_PERM_8 -#define ACTRL_FILE_WRITE_ATTRIB ACTRL_PERM_9 -#define ACTRL_FILE_CREATE_PIPE ACTRL_PERM_10 -#define ACTRL_DIR_LIST ACTRL_PERM_1 -#define ACTRL_DIR_CREATE_OBJECT ACTRL_PERM_2 -#define ACTRL_DIR_CREATE_CHILD ACTRL_PERM_3 -#define ACTRL_DIR_DELETE_CHILD ACTRL_PERM_7 -#define ACTRL_DIR_TRAVERSE ACTRL_PERM_6 -#define ACTRL_KERNEL_TERMINATE ACTRL_PERM_1 -#define ACTRL_KERNEL_THREAD ACTRL_PERM_2 -#define ACTRL_KERNEL_VM ACTRL_PERM_3 -#define ACTRL_KERNEL_VM_READ ACTRL_PERM_4 -#define ACTRL_KERNEL_VM_WRITE ACTRL_PERM_5 -#define ACTRL_KERNEL_DUP_HANDLE ACTRL_PERM_6 -#define ACTRL_KERNEL_PROCESS ACTRL_PERM_7 -#define ACTRL_KERNEL_SET_INFO ACTRL_PERM_8 -#define ACTRL_KERNEL_GET_INFO ACTRL_PERM_9 -#define ACTRL_KERNEL_CONTROL ACTRL_PERM_10 -#define ACTRL_KERNEL_ALERT ACTRL_PERM_11 -#define ACTRL_KERNEL_GET_CONTEXT ACTRL_PERM_12 -#define ACTRL_KERNEL_SET_CONTEXT ACTRL_PERM_13 -#define ACTRL_KERNEL_TOKEN ACTRL_PERM_14 -#define ACTRL_KERNEL_IMPERSONATE ACTRL_PERM_15 -#define ACTRL_KERNEL_DIMPERSONATE ACTRL_PERM_16 -#define ACTRL_PRINT_SADMIN ACTRL_PERM_1 -#define ACTRL_PRINT_SLIST ACTRL_PERM_2 -#define ACTRL_PRINT_PADMIN ACTRL_PERM_3 -#define ACTRL_PRINT_PUSE ACTRL_PERM_4 -#define ACTRL_PRINT_JADMIN ACTRL_PERM_5 -#define ACTRL_SVC_GET_INFO ACTRL_PERM_1 -#define ACTRL_SVC_SET_INFO ACTRL_PERM_2 -#define ACTRL_SVC_STATUS ACTRL_PERM_3 -#define ACTRL_SVC_LIST ACTRL_PERM_4 -#define ACTRL_SVC_START ACTRL_PERM_5 -#define ACTRL_SVC_STOP ACTRL_PERM_6 -#define ACTRL_SVC_PAUSE ACTRL_PERM_7 -#define ACTRL_SVC_INTERROGATE ACTRL_PERM_8 -#define ACTRL_SVC_UCONTROL ACTRL_PERM_9 -#define ACTRL_REG_QUERY ACTRL_PERM_1 -#define ACTRL_REG_SET ACTRL_PERM_2 -#define ACTRL_REG_CREATE_CHILD ACTRL_PERM_3 -#define ACTRL_REG_LIST ACTRL_PERM_4 -#define ACTRL_REG_NOTIFY ACTRL_PERM_5 -#define ACTRL_REG_LINK ACTRL_PERM_6 -#define ACTRL_WIN_CLIPBRD ACTRL_PERM_1 -#define ACTRL_WIN_GLOBAL_ATOMS ACTRL_PERM_2 -#define ACTRL_WIN_CREATE ACTRL_PERM_3 -#define ACTRL_WIN_LIST_DESK ACTRL_PERM_4 -#define ACTRL_WIN_LIST ACTRL_PERM_5 -#define ACTRL_WIN_READ_ATTRIBS ACTRL_PERM_6 -#define ACTRL_WIN_WRITE_ATTRIBS ACTRL_PERM_7 -#define ACTRL_WIN_SCREEN ACTRL_PERM_8 -#define ACTRL_WIN_EXIT ACTRL_PERM_9 - - -#pragma warning (push) -#pragma warning (disable: 4201) - -typedef struct _ACTRL_OVERLAPPED -{ - union { - PVOID Provider; - ULONG Reserved1; - } DUMMYUNIONNAME; - - ULONG Reserved2; - HANDLE hEvent; - -} ACTRL_OVERLAPPED, *PACTRL_OVERLAPPED; - -#pragma warning(pop) - -typedef struct _ACTRL_ACCESS_INFOA -{ - ULONG fAccessPermission; - LPSTR lpAccessPermissionName; -} ACTRL_ACCESS_INFOA, *PACTRL_ACCESS_INFOA; -typedef struct _ACTRL_ACCESS_INFOW -{ - ULONG fAccessPermission; - LPWSTR lpAccessPermissionName; -} ACTRL_ACCESS_INFOW, *PACTRL_ACCESS_INFOW; -#ifdef UNICODE -typedef ACTRL_ACCESS_INFOW ACTRL_ACCESS_INFO; -typedef PACTRL_ACCESS_INFOW PACTRL_ACCESS_INFO; -#else -typedef ACTRL_ACCESS_INFOA ACTRL_ACCESS_INFO; -typedef PACTRL_ACCESS_INFOA PACTRL_ACCESS_INFO; -#endif // UNICODE - -typedef struct _ACTRL_CONTROL_INFOA -{ - LPSTR lpControlId; - LPSTR lpControlName; -} ACTRL_CONTROL_INFOA, *PACTRL_CONTROL_INFOA; -typedef struct _ACTRL_CONTROL_INFOW -{ - LPWSTR lpControlId; - LPWSTR lpControlName; -} ACTRL_CONTROL_INFOW, *PACTRL_CONTROL_INFOW; -#ifdef UNICODE -typedef ACTRL_CONTROL_INFOW ACTRL_CONTROL_INFO; -typedef PACTRL_CONTROL_INFOW PACTRL_CONTROL_INFO; -#else -typedef ACTRL_CONTROL_INFOA ACTRL_CONTROL_INFO; -typedef PACTRL_CONTROL_INFOA PACTRL_CONTROL_INFO; -#endif // UNICODE - - -#define ACTRL_ACCESS_NO_OPTIONS 0x00000000 -#define ACTRL_ACCESS_SUPPORTS_OBJECT_ENTRIES 0x00000001 - -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define TREE_SEC_INFO_SET 0x00000001 -#define TREE_SEC_INFO_RESET 0x00000002 -#define TREE_SEC_INFO_RESET_KEEP_EXPLICIT 0x00000003 -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - - -typedef enum _PROGRESS_INVOKE_SETTING { - ProgressInvokeNever = 1, // Never invoke the progress function - ProgressInvokeEveryObject, // Invoke for each object - ProgressInvokeOnError, // Invoke only for each error case - ProgressCancelOperation, // Stop propagation and return - ProgressRetryOperation, // Retry operation on subtree -#if (NTDDI_VERSION >= NTDDI_VISTA) - ProgressInvokePrePostError, // Invoke Pre, Post, Error -#endif // (NTDDI_VERSION >= NTDDI_VISTA) -} PROG_INVOKE_SETTING, *PPROG_INVOKE_SETTING; - -// -// Progress Function: -// Caller of tree operation implements this Progress function, then -// passes its function pointer to tree operation. -// Tree operation invokes Progress function to provide progress and error -// information to the caller during the potentially long execution -// of the tree operation. Tree operation provides the name of the object -// last processed and the error status of the operation on that object. -// Tree operation also passes the current InvokeSetting value. -// Caller may change the InvokeSetting value, for example, from "Always" -// to "Only On Error." -// - -/* -typedef VOID (*FN_PROGRESS) ( - IN LPWSTR pObjectName, // name of object just processed - IN DWORD Status, // status of operation on object - IN OUT PPROG_INVOKE_SETTING pInvokeSetting, // Never, always, - IN PVOID Args, // Caller specific data - IN BOOL SecuritySet // Whether security was set - ); -*/ - -// -// New Object Type function pointers. TBD. -// To support additional object resource managers generically, the -// resource manager must provide it's own functions for operations -// like: -// GetAncestorAcl(IN ObjName, IN GenerationGap, IN DaclOrSacl?, ...) -// GetAncestorName(...) -// FreeNameStructure(...) -// - -typedef struct _FN_OBJECT_MGR_FUNCTIONS -{ - ULONG Placeholder; -} FN_OBJECT_MGR_FUNCTS, *PFN_OBJECT_MGR_FUNCTS; - -// -// Name of ancestor and number of generations between -// ancestor and inheriting object. -// -// GenerationGap: -// Name of ancestor from which ACE was inherited. -// NULL for explicit ACE. -// -// AncestorName: -// Number of levels (or generations) between the object and the ancestor. -// Parent, gap=1. -// Grandparent, gap=2. -// Set to 0 for explicit ACE on object. -// - -typedef struct _INHERITED_FROMA -{ - LONG GenerationGap; - LPSTR AncestorName; -} INHERITED_FROMA, *PINHERITED_FROMA; -typedef struct _INHERITED_FROMW -{ - LONG GenerationGap; - LPWSTR AncestorName; -} INHERITED_FROMW, *PINHERITED_FROMW; -#ifdef UNICODE -typedef INHERITED_FROMW INHERITED_FROM; -typedef PINHERITED_FROMW PINHERITED_FROM; -#else -typedef INHERITED_FROMA INHERITED_FROM; -typedef PINHERITED_FROMA PINHERITED_FROM; -#endif // UNICODE - - - -#ifdef __cplusplus -} -#endif - -#if (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#else -#pragma warning(default:4001) -#endif -#endif - -#endif /* __ACCESS_CONTROL__ */ - diff --git a/qt-correction-tool/pub/ddk/acpiioct.h b/qt-correction-tool/pub/ddk/acpiioct.h deleted file mode 100644 index ec84af8..0000000 --- a/qt-correction-tool/pub/ddk/acpiioct.h +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 1997 Microsoft Corporation - -Module Name: - - acpiioct.h - -Abstract: - - This module handles all of the INTERNAL_DEVICE_CONTROLS requested to - the ACPI driver - -Author: - -Environment: - - NT Kernel Model Driver only - ---*/ - -#ifndef _ACPIIOCT_H_ -#define _ACPIIOCT_H_ - -#if defined (_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#pragma warning(push) -#endif - -#pragma warning(disable:4201) // named type definition in parentheses - -// -// IRP_MJ_INTERNAL_DEVICE_CONTROL CODES -// -#define IOCTL_ACPI_ASYNC_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_ACPI_EVAL_METHOD CTL_CODE(FILE_DEVICE_ACPI, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_ACPI_RELEASE_GLOBAL_LOCK CTL_CODE(FILE_DEVICE_ACPI, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define IOCTL_ACPI_EVAL_METHOD_EX CTL_CODE(FILE_DEVICE_ACPI, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_ACPI_ASYNC_EVAL_METHOD_EX CTL_CODE(FILE_DEVICE_ACPI, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_ACPI_ENUM_CHILDREN CTL_CODE(FILE_DEVICE_ACPI, 8, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#endif - -// -// Data structures used for IOCTL_ACPI_ASYNC_EVAL_METHOD and -// IOCTL_ACPI_EVAL_METHOD -// - -// -// Possible Input buffer -// -typedef struct _ACPI_EVAL_INPUT_BUFFER { - ULONG Signature; - union { - UCHAR MethodName[4]; - ULONG MethodNameAsUlong; - } DUMMYUNIONNAME; -} ACPI_EVAL_INPUT_BUFFER, *PACPI_EVAL_INPUT_BUFFER; - -typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER { - ULONG Signature; - union { - UCHAR MethodName[4]; - ULONG MethodNameAsUlong; - } DUMMYUNIONNAME; - ULONG IntegerArgument; -} ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER; - -typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING { - ULONG Signature; - union { - UCHAR MethodName[4]; - ULONG MethodNameAsUlong; - } DUMMYUNIONNAME; - ULONG StringLength; - UCHAR String[ANYSIZE_ARRAY]; -} ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING; - -typedef struct _ACPI_METHOD_ARGUMENT { - USHORT Type; - USHORT DataLength; - union { - ULONG Argument; - UCHAR Data[ANYSIZE_ARRAY]; - } DUMMYUNIONNAME; -} ACPI_METHOD_ARGUMENT; - -typedef ACPI_METHOD_ARGUMENT UNALIGNED *PACPI_METHOD_ARGUMENT; - -#define ACPI_METHOD_ARGUMENT_LENGTH( DataLength ) \ - (FIELD_OFFSET(ACPI_METHOD_ARGUMENT, Data) + max(sizeof(ULONG), DataLength)) - -#define ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) \ - (ACPI_METHOD_ARGUMENT_LENGTH(((PACPI_METHOD_ARGUMENT)Argument)->DataLength)) - -#define ACPI_METHOD_NEXT_ARGUMENT( Argument ) \ - (PACPI_METHOD_ARGUMENT) ( (PUCHAR) Argument + \ - ACPI_METHOD_ARGUMENT_LENGTH_FROM_ARGUMENT( Argument ) ) - - -#define ACPI_METHOD_SET_ARGUMENT_INTEGER( MethodArgument, IntData ) \ - { MethodArgument->Type = ACPI_METHOD_ARGUMENT_INTEGER; \ - MethodArgument->DataLength = sizeof(ULONG); \ - MethodArgument->Argument = IntData; } - -#define ACPI_METHOD_SET_ARGUMENT_STRING( Argument, StrData ) \ - { Argument->Type = ACPI_METHOD_ARGUMENT_STRING; \ - Argument->DataLength = strlen((PUCHAR)StrData) + sizeof(UCHAR); \ - RtlCopyMemory(&Argument->Data[0],(PUCHAR)StrData,Argument->DataLength); } - -#define ACPI_METHOD_SET_ARGUMENT_BUFFER( Argument, BuffData, BuffLength ) \ - { Argument->Type = ACPI_METHOD_ARGUMENT_BUFFER; \ - Argument->DataLength = BuffLength; \ - RtlCopyMemory(&Argument->Data[0],(PUCHAR)BuffData,Argument->DataLength); } - -typedef struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX { - ULONG Signature; - union { - UCHAR MethodName[4]; - ULONG MethodNameAsUlong; - } DUMMYUNIONNAME; - ULONG Size; - ULONG ArgumentCount; - ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]; -} ACPI_EVAL_INPUT_BUFFER_COMPLEX, *PACPI_EVAL_INPUT_BUFFER_COMPLEX; - -typedef struct _ACPI_EVAL_OUTPUT_BUFFER { - ULONG Signature; - ULONG Length; - ULONG Count; - ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]; -} ACPI_EVAL_OUTPUT_BUFFER; - -typedef ACPI_EVAL_OUTPUT_BUFFER UNALIGNED *PACPI_EVAL_OUTPUT_BUFFER; - -#define ACPI_EVAL_INPUT_BUFFER_SIGNATURE 'BieA' -#define ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_SIGNATURE 'IieA' -#define ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_SIGNATURE 'SieA' -#define ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE 'CieA' -#define ACPI_EVAL_OUTPUT_BUFFER_SIGNATURE 'BoeA' -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define ACPI_EVAL_INPUT_BUFFER_SIGNATURE_EX 'AieA' -#define ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_SIGNATURE_EX 'DieA' -#define ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_SIGNATURE_EX 'EieA' -#define ACPI_EVAL_INPUT_BUFFER_COMPLEX_SIGNATURE_EX 'FieA' -#define ACPI_ENUM_CHILDREN_OUTPUT_BUFFER_SIGNATURE 'GieA' -#define ACPI_ENUM_CHILDREN_INPUT_BUFFER_SIGNATURE 'HieA' -#endif - - - -#define ACPI_METHOD_ARGUMENT_INTEGER 0x0 -#define ACPI_METHOD_ARGUMENT_STRING 0x1 -#define ACPI_METHOD_ARGUMENT_BUFFER 0x2 -#define ACPI_METHOD_ARGUMENT_PACKAGE 0x3 -#define ACPI_METHOD_ARGUMENT_PACKAGE_EX 0x4 - -// -// Data structures used for IOCTL_ACPI_ACQUIRE_GLOBAL_LOCK -// IOCTL_ACPI_RELEASE_GLOBAL_LOCK -// -typedef struct _ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER { - ULONG Signature; - PVOID LockObject; -} ACPI_MANIPULATE_GLOBAL_LOCK_BUFFER, *PACPI_MANIPULATE_GLOBAL_LOCK_BUFFER; - -#define ACPI_ACQUIRE_GLOBAL_LOCK_SIGNATURE 'LgaA' -#define ACPI_RELEASE_GLOBAL_LOCK_SIGNATURE 'LgrA' - -// -// Data structure used for IOCTL_ACPI_ASYNC_EVAL_METHOD_EX, -// IOCTL_ACPI_EVAL_METHOD_EX and -// IOCTL_ACPI_ENUM_CHILDREN -// - -typedef struct _ACPI_EVAL_INPUT_BUFFER_EX { - ULONG Signature; - CHAR MethodName[256]; //NULL terminated name string -} ACPI_EVAL_INPUT_BUFFER_EX, *PACPI_EVAL_INPUT_BUFFER_EX; - -typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX { - ULONG Signature; - CHAR MethodName[256];//NULL terminated name string - ULONG64 IntegerArgument; -} ACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_INTEGER_EX; - -typedef struct _ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX { - ULONG Signature; - CHAR MethodName[256];//NULL terminated name string - ULONG StringLength; - UCHAR String[ANYSIZE_ARRAY]; - -} ACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX, *PACPI_EVAL_INPUT_BUFFER_SIMPLE_STRING_EX; - -typedef struct _ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX { - ULONG Signature; - CHAR MethodName[256];//NULL terminated name string - ULONG Size; - ULONG ArgumentCount; - ACPI_METHOD_ARGUMENT Argument[ANYSIZE_ARRAY]; -} ACPI_EVAL_INPUT_BUFFER_COMPLEX_EX, *PACPI_EVAL_INPUT_BUFFER_COMPLEX_EX; - -typedef struct _ACPI_ENUM_CHILDREN_INPUT_BUFFER { - ULONG Signature; - ULONG Flags; - ULONG NameLength; - CHAR Name[ANYSIZE_ARRAY]; -} ACPI_ENUM_CHILDREN_INPUT_BUFFER, *PACPI_ENUM_CHILDREN_INPUT_BUFFER; - -typedef struct _ACPI_ENUM_CHILD { - ULONG Flags; - ULONG NameLength; // length including null terminator - CHAR Name[ANYSIZE_ARRAY]; -} ACPI_ENUM_CHILD; - -typedef ACPI_ENUM_CHILD UNALIGNED *PACPI_ENUM_CHILD; - -typedef struct _ACPI_ENUM_CHILDREN_OUTPUT_BUFFER { - ULONG Signature; - ULONG NumberOfChildren; - ACPI_ENUM_CHILD Children[ANYSIZE_ARRAY]; -} ACPI_ENUM_CHILDREN_OUTPUT_BUFFER; - -typedef ACPI_ENUM_CHILDREN_OUTPUT_BUFFER UNALIGNED *PACPI_ENUM_CHILDREN_OUTPUT_BUFFER; - -#define ACPI_ENUM_CHILD_LENGTH_FROM_CHILD( Child ) \ - ( (2* sizeof (ULONG)) + Child->NameLength ) - -#define ACPI_ENUM_CHILD_NEXT( Child ) \ - (PACPI_ENUM_CHILD) ( (PUCHAR) Child + \ - ACPI_ENUM_CHILD_LENGTH_FROM_CHILD( Child ) ) - - -// -// valid flags for ACPI_ENUM_CHILDREN_INPUT_BUFFER.Flags -// -#define ENUM_CHILDREN_IMMEDIATE_ONLY 0x1 -#define ENUM_CHILDREN_MULTILEVEL 0x2 -#define ENUM_CHILDREN_NAME_IS_FILTER 0x4 - -// -// valid flags for ACPI_ENUM_CHILD -// -#define ACPI_OBJECT_HAS_CHILDREN 0x1 - -#if defined (_MSC_VER) && (_MSC_VER >= 1020) -#pragma warning(pop) -#endif - -#endif - diff --git a/qt-correction-tool/pub/ddk/amtvuids.h b/qt-correction-tool/pub/ddk/amtvuids.h deleted file mode 100644 index ebcb62b..0000000 --- a/qt-correction-tool/pub/ddk/amtvuids.h +++ /dev/null @@ -1,68 +0,0 @@ -//==========================================================================; -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR -// PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//--------------------------------------------------------------------------; -// - -// -// We want to use this list for generating strings for debugging too -// so we redefine OUR_GUID_ENTRY depending on what we want to do -// -// It is imperative that all entries in this file are declared using -// OUR_GUID_ENTRY as that macro might have been defined in advance of -// including this file. See wxdebug.cpp in sdk\classes\base. -// - -#ifndef OUR_GUID_ENTRY - #define OUR_GUID_ENTRY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - DEFINE_GUID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8); -#endif - -// ------------------------------------------------------------------------- -// TVTuner GUIDS -// ------------------------------------------------------------------------- - -// {266EEE40-6C63-11cf-8A03-00AA006ECB65} -OUR_GUID_ENTRY(CLSID_CTVTunerFilter, -0x266eee40, 0x6c63, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65); - -// {266EEE41-6C63-11cf-8A03-00AA006ECB65} -OUR_GUID_ENTRY(CLSID_CTVTunerFilterPropertyPage, -0x266eee41, 0x6c63, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65); - -// {266EEE44-6C63-11cf-8A03-00AA006ECB65} -OUR_GUID_ENTRY(IID_AnalogVideoStandard, -0x266eee44, 0x6c63, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65); - -// {266EEE46-6C63-11cf-8A03-00AA006ECB65} -OUR_GUID_ENTRY(IID_TunerInputType, -0x266eee46, 0x6c63, 0x11cf, 0x8a, 0x3, 0x0, 0xaa, 0x0, 0x6e, 0xcb, 0x65); - - -// ------------------------------------------------------------------------- -// Crossbar (XBar) GUIDS -// ------------------------------------------------------------------------- - -// {71F96460-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_CrossbarFilter, -0x71f96460, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56); - -// {71F96461-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_CrossbarFilterPropertyPage, -0x71f96461, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56); - -// {71F96462-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_TVAudioFilter, -0x71f96462, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56); - -// {71F96463-78F3-11d0-A18C-00A0C9118956} -OUR_GUID_ENTRY(CLSID_TVAudioFilterPropertyPage, -0x71f96463, 0x78f3, 0x11d0, 0xa1, 0x8c, 0x0, 0xa0, 0xc9, 0x11, 0x89, 0x56); - - diff --git a/qt-correction-tool/pub/ddk/anchorsyncdeviceservice.h b/qt-correction-tool/pub/ddk/anchorsyncdeviceservice.h deleted file mode 100644 index 9547fd7..0000000 --- a/qt-correction-tool/pub/ddk/anchorsyncdeviceservice.h +++ /dev/null @@ -1,316 +0,0 @@ -/* - * AnchorSyncDeviceService.h - * - * Contains definitions for the Anchor Sync Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _ANCHORSYNCSERVICE_H_ -#define _ANCHORSYNCSERVICE_H_ - -#include -#include - -/*****************************************************************************/ -/* Anchor Sync Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_AnchorSync, - 0x056d8b9e, 0xad7a, 0x44fc, 0x94, 0x6f, 0x1d, 0x63, 0xa2, 0x5c, 0xda, 0x9a); - -#define NAME_AnchorSyncSvc L"AnchorSync" -#define TYPE_AnchorSyncSvc DEVSVCTYPE_ABSTRACT - -/*****************************************************************************/ -/* Anchor Sync Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_AnchorSyncSvc, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa); - -/* PKEY_AnchorSyncSvc_VersionProps - * - * Provides information about change units and version properties. The - * format for the dataset is - * - * UINT32 Number of change units - * UINT128 Namespace GUID for first change unit property key - * UINT32 Namespace ID for the first change unit property key - * UINT32 Number of properties associated with this change unit - * UINT128 Namespace GUID for first property key in change unit - * UINT32 Namespace ID for first property key in change unit - * ... Repeat for number of property keys - * ... Repeat for number of change units - * - * NOTE: If all change units use the same property key specify a namespace - * GUID of GUID_NULL (all 0's) and a namespace ID of 0. - * - * Type: AUInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_VersionProps, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 2); - -#define NAME_AnchorSyncSvc_VersionProps L"AnchorVersionProps" - - -/* PKEY_AnchorSyncSvc_ReplicaID - * - * Contains the GUID representing this replica in the sync community. - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_ReplicaID, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 3); - -#define NAME_AnchorSyncSvc_ReplicaID L"AnchorReplicaID" - - -/* PKEY_AnchorSyncSvc_KnowledgeObjectID - * - * Object ID to be used for the knowledge object - * - * Type: UInt32 - * Form: Object ID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_KnowledgeObjectID, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 4); - -#define NAME_AnchorSyncSvc_KnowledgeObjectID L"AnchorKnowledgeObjectID" - - -/* PKEY_AnchorSyncSvc_LastSyncProxyID - * - * Contains a GUID indicating the last sync proxy to perform a sync operation - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_LastSyncProxyID, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 5); - -#define NAME_AnchorSyncSvc_LastSyncProxyID L"AnchorLastSyncProxyID" - - -/* PKEY_AnchorSyncSvc_CurrentAnchor - * - * Contains a blob of data representing the current anchor for the device. - * As the anchor may be transient depending on the current state of the sync - * the value of PKEY_AnchorSyncSvc_CurrentAnchor may not reflect the current - * state of the database unless the current session holds a lock (via the - * BeginSync method) on the service. - * - * Type: AUInt8 - * Form: BinaryArray - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_CurrentAnchor, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 6); - -#define NAME_AnchorSyncSvc_CurrentAnchor L"AnchorCurrentAnchor" - - -/* PKEY_AnchorSyncSvc_ProviderVersion - * - * Contains a device defined value giving the version of the provider - * currently in use on the device. This version must be incremented whenever - * new properties are added to the device implementation so that they will - * be recognized and managed as part of synchronization. 0 is reserved. - * - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorSyncSvc_ProviderVersion, - 0xe65b8fb7, 0x8fc7, 0x4278, 0xb9, 0xa3, 0xba, 0x14, 0xc2, 0xdb, 0x40, 0xfa, - 7); - -#define NAME_AnchorSyncSvc_ProviderVersion L"AnchorProviderVersion" - - -/* PKEY_AnchorSyncSvc_SyncFormat - * - * Indicates the format GUID for the object format that is to be used in the - * sync operation. - * - * Type: UInt128 - * Form: None - */ - -#define PKEY_AnchorSyncSvc_SyncFormat PKEY_SyncSvc_SyncFormat -#define NAME_AnchorSyncSvc_SyncFormat NAME_SyncSvc_SyncFormat - - -/* PKEY_AnchorSyncSvc_LocalOnlyDelete - * - * Boolean flag indicating whether deletes of objects on the service host - * should be treated as "local only" and not propogated to other sync - * participants. The alternative is "true sync" in which deletes on the - * service host are propogated to all other sync participants. - * - * Type: UInt8 - * Form: None - */ - -#define PKEY_AnchorSyncSvc_LocalOnlyDelete PKEY_SyncSvc_LocalOnlyDelete -#define NAME_AnchorSyncSvc_LocalOnlyDelete NAME_SyncSvc_LocalOnlyDelete - - -/* PKEY_AnchorSyncSvc_FilterType - * - * Boolean flag indicating whether the default filter is being applied to - * this endpoint. Note that the meaning of the default filter is determined - * by the content type service. - * - * Type: UInt8 - * Form: None - */ - -#define PKEY_AnchorSyncSvc_FilterType PKEY_SyncSvc_FilterType -#define NAME_AnchorSyncSvc_FilterType NAME_SyncSvc_FilterType - - -/*****************************************************************************/ -/* Anchor Sync Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AnchorSyncKnowledge - */ - -DEFINE_DEVSVCGUID(FORMAT_AnchorSyncKnowledge, - 0x37c550bc, 0xf231, 0x4727, 0xbb, 0xbc, 0x4c, 0xb3, 0x3a, 0x3f, 0x3e, 0xcd); - -#define NAME_AnchorSyncKnowledge L"AnchorSyncKnowledge" - -/* FORMAT_AnchorSyncSvc_AnchorResults - * - * GetChangesSinceAnchor results format - */ - -DEFINE_DEVSVCGUID(FORMAT_AnchorSyncSvc_AnchorResults, - 0xf35527c1, 0xce4a, 0x487a, 0x9d, 0x29, 0x93, 0x83, 0x35, 0x69, 0x32, 0x1e); - -#define NAME_AnchorResults L"AnchorResults" - -/*****************************************************************************/ -/* Anchor Sync Service Object Property Keys */ -/*****************************************************************************/ - - -DEFINE_DEVSVCGUID(NAMESPACE_AnchorResults, - 0x516b5dce, 0x8d45, 0x430f, 0x80, 0x5c, 0x25, 0xe5, 0x10, 0x6d, 0x8b, 0x1f); - -/* PKEY_AnchorResults_AnchorState - * - * Output parameter from GetChangesSinceAnchor method. Contains the state - * of the current anchor result: - * - * Type: UInt32 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorResults_AnchorState, - 0x516b5dce, 0x8d45, 0x430f, 0x80, 0x5c, 0x25, 0xe5, 0x10, 0x6d, 0x8b, 0x1f, - 2); - -#define NAME_AnchorResults_AnchorState L"AnchorState" - -#define ENUM_AnchorResults_AnchorStateNormal 0x00000000 -#define ENUM_AnchorResults_AnchorStateInvalid 0x00000001 -#define ENUM_AnchorResults_AnchorStateOld 0x00000002 - - -/* PKEY_AnchorResults_Anchor - * - * Input parameter for GetChangesSinceAnchor method. Contains the anchor for - * which data is being requested. - * - * Type: AUInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorResults_Anchor, - 0x516b5dce, 0x8d45, 0x430f, 0x80, 0x5c, 0x25, 0xe5, 0x10, 0x6d, 0x8b, 0x1f, - 3); - -#define NAME_AnchorResults_Anchor L"Anchor" - - -/* PKEY_AnchorResults_ResultObjectID - * - * Output parameter from GetChangesSinceAnchor method. Contains the object - * ID of the AnchorResults object that has the results of the - * GetChangesSinceAnchor operation. - * - * Type: UInt32 - * Form: Object ID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AnchorResults_ResultObjectID, - 0x516b5dce, 0x8d45, 0x430f, 0x80, 0x5c, 0x25, 0xe5, 0x10, 0x6d, 0x8b, 0x1f, - 4); - -#define NAME_AnchorResults_ResultObjectID L"ResultObjectID" - - -/*****************************************************************************/ -/* Anchor Sync Service Methods */ -/*****************************************************************************/ - -/* METHOD_AnchorSyncSvc_GetChangesSinceAnchor - */ - -DEFINE_DEVSVCGUID(METHOD_AnchorSyncSvc_GetChangesSinceAnchor, - 0x37c550bc, 0xf231, 0x4727, 0xbb, 0xbc, 0x4c, 0xb3, 0x3a, 0x3f, 0x3e, 0xcd); - -#define NAME_AnchorSyncSvc_GetChangesSinceAnchor L"GetChangesSinceAnchor" - -/* Inherited methods - */ - -#define METHOD_AnchorSyncSvc_BeginSync METHOD_SyncSvc_BeginSync -#define NAME_AnchorSyncSvc_BeginSync NAME_SyncSvc_BeginSync - -#define METHOD_AnchorSyncSvc_EndSync METHOD_SyncSvc_EndSync -#define NAME_AnchorSyncSvc_EndSync NAME_SyncSvc_EndSync - - -/*****************************************************************************/ -/* Anchor Sync Service Additional Defines */ -/*****************************************************************************/ - -/* ENUM_AnchorResults_ItemState* - * - * This enum is used when encoding the Anchor results stream. It defines the - * current state of an object. If a device is capable of distinguishing - * between item update and create operations the *_ItemStateCreated and - * *_ItemStateUpdated enumerations should be used. If the device cannot - * distinuish between a create and an up updated the *_ItemStateChanged result - * should be used. - * - * Type: UInt32 - * Form: Enum - */ - -#define ENUM_AnchorResults_ItemStateInvalid 0x00000000 -#define ENUM_AnchorResults_ItemStateDeleted 0x00000001 -#define ENUM_AnchorResults_ItemStateCreated 0x00000002 -#define ENUM_AnchorResults_ItemStateUpdated 0x00000003 -#define ENUM_AnchorResults_ItemStateChanged 0x00000004 - -#endif /* _ANCHORSYNCSERVICE_H_ */ - - - diff --git a/qt-correction-tool/pub/ddk/ata.h b/qt-correction-tool/pub/ddk/ata.h deleted file mode 100644 index 30b5f62..0000000 --- a/qt-correction-tool/pub/ddk/ata.h +++ /dev/null @@ -1,695 +0,0 @@ - -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ata.h - -Abstract: - - Defines the structures used by ATA port and the miniport drivers. - -Authors: - -Revision History: - ---*/ - -#ifndef _NTATA_ -#define _NTATA_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning(disable:4214) // bit field types other than int - -// -// IDENTIFY device data (response to 0xEC) -// -#pragma pack(push, id_device_data, 1) -typedef struct _IDENTIFY_DEVICE_DATA { - - struct { - USHORT Reserved1 : 1; - USHORT Retired3 : 1; - USHORT ResponseIncomplete : 1; - USHORT Retired2 : 3; - USHORT FixedDevice : 1; - USHORT RemovableMedia : 1; - USHORT Retired1 : 7; - USHORT DeviceType : 1; - } GeneralConfiguration; // word 0 - - USHORT NumCylinders; // word 1 - USHORT ReservedWord2; - USHORT NumHeads; // word 3 - USHORT Retired1[2]; - USHORT NumSectorsPerTrack; // word 6 - USHORT VendorUnique1[3]; - UCHAR SerialNumber[20]; // word 10-19 - USHORT Retired2[2]; - USHORT Obsolete1; - UCHAR FirmwareRevision[8]; // word 23-26 - UCHAR ModelNumber[40]; // word 27-46 - UCHAR MaximumBlockTransfer; // word 47 - UCHAR VendorUnique2; - USHORT ReservedWord48; - - struct { - UCHAR ReservedByte49; - UCHAR DmaSupported : 1; - UCHAR LbaSupported : 1; - UCHAR IordyDisable : 1; - UCHAR IordySupported : 1; - UCHAR Reserved1 : 1; - UCHAR StandybyTimerSupport : 1; - UCHAR Reserved2 : 2; - USHORT ReservedWord50; - }Capabilities; // word 49-50 - - USHORT ObsoleteWords51[2]; - - USHORT TranslationFieldsValid:3; // word 53 - - USHORT Reserved3:13; - - USHORT NumberOfCurrentCylinders; // word 54 - USHORT NumberOfCurrentHeads; // word 55 - USHORT CurrentSectorsPerTrack; // word 56 - ULONG CurrentSectorCapacity; // word 57 - UCHAR CurrentMultiSectorSetting; // word 58 - UCHAR MultiSectorSettingValid : 1; - - UCHAR ReservedByte59 : 7; - - ULONG UserAddressableSectors; // word 60-61 - - USHORT ObsoleteWord62; - - USHORT MultiWordDMASupport : 8; // word 63 - USHORT MultiWordDMAActive : 8; - USHORT AdvancedPIOModes : 8; - USHORT ReservedByte64 : 8; - USHORT MinimumMWXferCycleTime; - USHORT RecommendedMWXferCycleTime; - USHORT MinimumPIOCycleTime; - USHORT MinimumPIOCycleTimeIORDY; - - USHORT ReservedWords69[6]; - - USHORT QueueDepth : 5; - - USHORT ReservedWord75 : 11; - USHORT ReservedWords76[4]; - USHORT MajorRevision; - USHORT MinorRevision; - - struct { - - // - // Word 82 - // - USHORT SmartCommands : 1; - USHORT SecurityMode : 1; - USHORT RemovableMediaFeature : 1; - USHORT PowerManagement : 1; - USHORT Reserved1 : 1; - USHORT WriteCache : 1; - USHORT LookAhead : 1; - USHORT ReleaseInterrupt : 1; - USHORT ServiceInterrupt : 1; - USHORT DeviceReset : 1; - USHORT HostProtectedArea : 1; - USHORT Obsolete1 : 1; - USHORT WriteBuffer : 1; - USHORT ReadBuffer : 1; - USHORT Nop : 1; - USHORT Obsolete2 : 1; - - // - // Word 83 - // - USHORT DownloadMicrocode : 1; - USHORT DmaQueued : 1; - USHORT Cfa : 1; - USHORT AdvancedPm : 1; - USHORT Msn : 1; - USHORT PowerUpInStandby : 1; - USHORT ManualPowerUp : 1; - USHORT Reserved2 : 1; - USHORT SetMax : 1; - USHORT Acoustics : 1; - USHORT BigLba : 1; - USHORT DeviceConfigOverlay : 1; - USHORT FlushCache : 1; - USHORT FlushCacheExt : 1; - USHORT Resrved3 : 2; - - // - // Word 84 - // - USHORT SmartErrorLog : 1; - USHORT SmartSelfTest : 1; - USHORT MediaSerialNumber : 1; - USHORT MediaCardPassThrough : 1; - USHORT StreamingFeature : 1; - USHORT GpLogging : 1; - USHORT WriteFua : 1; - USHORT WriteQueuedFua : 1; - USHORT WWN64Bit : 1; - USHORT URGReadStream : 1; - USHORT URGWriteStream : 1; - USHORT ReservedForTechReport : 2; - USHORT IdleWithUnloadFeature : 1; - USHORT Reserved4 : 2; - - }CommandSetSupport; - - struct { - - // - // Word 85 - // - USHORT SmartCommands : 1; - USHORT SecurityMode : 1; - USHORT RemovableMediaFeature : 1; - USHORT PowerManagement : 1; - USHORT Reserved1 : 1; - USHORT WriteCache : 1; - USHORT LookAhead : 1; - USHORT ReleaseInterrupt : 1; - USHORT ServiceInterrupt : 1; - USHORT DeviceReset : 1; - USHORT HostProtectedArea : 1; - USHORT Obsolete1 : 1; - USHORT WriteBuffer : 1; - USHORT ReadBuffer : 1; - USHORT Nop : 1; - USHORT Obsolete2 : 1; - - // - // Word 86 - // - USHORT DownloadMicrocode : 1; - USHORT DmaQueued : 1; - USHORT Cfa : 1; - USHORT AdvancedPm : 1; - USHORT Msn : 1; - USHORT PowerUpInStandby : 1; - USHORT ManualPowerUp : 1; - USHORT Reserved2 : 1; - USHORT SetMax : 1; - USHORT Acoustics : 1; - USHORT BigLba : 1; - USHORT DeviceConfigOverlay : 1; - USHORT FlushCache : 1; - USHORT FlushCacheExt : 1; - USHORT Resrved3 : 2; - - // - // Word 87 - // - USHORT SmartErrorLog : 1; - USHORT SmartSelfTest : 1; - USHORT MediaSerialNumber : 1; - USHORT MediaCardPassThrough : 1; - USHORT StreamingFeature : 1; - USHORT GpLogging : 1; - USHORT WriteFua : 1; - USHORT WriteQueuedFua : 1; - USHORT WWN64Bit : 1; - USHORT URGReadStream : 1; - USHORT URGWriteStream : 1; - USHORT ReservedForTechReport : 2; - USHORT IdleWithUnloadFeature : 1; - USHORT Reserved4 : 2; - - }CommandSetActive; - - USHORT UltraDMASupport : 8; // word 88 - USHORT UltraDMAActive : 8; - - USHORT ReservedWord89[4]; - USHORT HardwareResetResult; - USHORT CurrentAcousticValue : 8; - USHORT RecommendedAcousticValue : 8; - USHORT ReservedWord95[5]; - - ULONG Max48BitLBA[2]; // word 100-103 - - USHORT StreamingTransferTime; - USHORT ReservedWord105; - struct { - USHORT LogicalSectorsPerPhysicalSector : 4; - USHORT Reserved0 : 8; - USHORT LogicalSectorLongerThan256Words : 1; - USHORT MultipleLogicalSectorsPerPhysicalSector : 1; - USHORT Reserved1 : 2; - } PhysicalLogicalSectorSize; // word 106 - - USHORT InterSeekDelay; //word 107 - USHORT WorldWideName[4]; //words 108-111 - USHORT ReservedForWorldWideName128[4]; //words 112-115 - USHORT ReservedForTlcTechnicalReport; //word 116 - USHORT WordsPerLogicalSector[2]; //words 117-118 - - struct { - USHORT ReservedForDrqTechnicalReport : 1; - USHORT WriteReadVerifySupported : 1; - USHORT Reserved0 : 11; - USHORT Reserved1 : 2; - }CommandSetSupportExt; //word 119 - - struct { - USHORT ReservedForDrqTechnicalReport : 1; - USHORT WriteReadVerifyEnabled : 1; - USHORT Reserved0 : 11; - USHORT Reserved1 : 2; - }CommandSetActiveExt; //word 120 - - USHORT ReservedForExpandedSupportandActive[6]; - - USHORT MsnSupport : 2; //word 127 - USHORT ReservedWord127 : 14; - - struct { //word 128 - USHORT SecuritySupported : 1; - USHORT SecurityEnabled : 1; - USHORT SecurityLocked : 1; - USHORT SecurityFrozen : 1; - USHORT SecurityCountExpired : 1; - USHORT EnhancedSecurityEraseSupported : 1; - USHORT Reserved0 : 2; - USHORT SecurityLevel : 1; - USHORT Reserved1 : 7; - } SecurityStatus; - - USHORT ReservedWord129[31]; - - struct { //word 160 - USHORT MaximumCurrentInMA : 12; - USHORT CfaPowerMode1Disabled : 1; - USHORT CfaPowerMode1Required : 1; - USHORT Reserved0 : 1; - USHORT Word160Supported : 1; - } CfaPowerMode1; - - USHORT ReservedForCfaWord161[8]; //Words 161-168 - - struct { //Word 169 - USHORT SupportsTrim : 1; - USHORT Reserved0 : 15; - } DataSetManagementFeature; - - USHORT ReservedForCfaWord170[6]; //Words 170-175 - - USHORT CurrentMediaSerialNumber[30]; //Words 176-205 - - USHORT ReservedWord206; //Word 206 - USHORT ReservedWord207[2]; //Words 207-208 - - struct { //Word 209 - USHORT AlignmentOfLogicalWithinPhysical: 14; - USHORT Word209Supported: 1; - USHORT Reserved0: 1; - } BlockAlignment; - - - USHORT WriteReadVerifySectorCountMode3Only[2]; //Words 210-211 - USHORT WriteReadVerifySectorCountMode2Only[2]; //Words 212-213 - - struct { - USHORT NVCachePowerModeEnabled: 1; - USHORT Reserved0: 3; - USHORT NVCacheFeatureSetEnabled: 1; - USHORT Reserved1: 3; - USHORT NVCachePowerModeVersion: 4; - USHORT NVCacheFeatureSetVersion: 4; - } NVCacheCapabilities; //Word 214 - USHORT NVCacheSizeLSW; //Word 215 - USHORT NVCacheSizeMSW; //Word 216 - USHORT NominalMediaRotationRate; //Word 217; value 0001h means non-rotating media. - USHORT ReservedWord218; //Word 218 - struct { - UCHAR NVCacheEstimatedTimeToSpinUpInSeconds; - UCHAR Reserved; - } NVCacheOptions; //Word 219 - - USHORT ReservedWord220[35]; //Words 220-254 - - USHORT Signature : 8; //Word 255 - USHORT CheckSum : 8; - -} IDENTIFY_DEVICE_DATA, *PIDENTIFY_DEVICE_DATA; -#pragma pack (pop, id_device_data) - -// -// identify packet data (response to 0xA1) -// -#pragma pack (push, id_packet_data, 1) -typedef struct _IDENTIFY_PACKET_DATA { - - struct { - USHORT PacketType : 2; - USHORT Reserved1 : 3; - USHORT DrqDelay : 2; - USHORT RemovableMedia : 1; - USHORT CommandPacketType : 5; - USHORT Reserved2 : 1; - USHORT DeviceType : 2; - }GeneralConfiguration; - - USHORT ResevedWord1; - USHORT UniqueConfiguration; - USHORT ReservedWords3[7]; - USHORT SerialNumber[10]; - USHORT ReservedWords20[3]; - USHORT FirmwareRevision[4]; - USHORT ModelNumber[20]; - USHORT ReservedWords47[2]; - - struct { - USHORT VendorSpecific : 8; - USHORT DmaSupported : 1; - USHORT LbaSupported : 1; - USHORT IordyDisabled : 1; - USHORT IordySupported : 1; - USHORT Obsolete : 1; - USHORT OverlapSupported : 1; - USHORT QueuedCommandsSupported : 1; - USHORT InterleavedDmaSupported : 1; - } Capabilities; - - USHORT ReservedWord50; - USHORT ObsoleteWords51[2]; - - USHORT TranslationFieldsValid:3; - - USHORT Reserved3:13; - - USHORT ReservedWords54[9]; - - USHORT MultiWordDMASupport : 8; // word 63 - USHORT MultiWordDMAActive : 8; - USHORT AdvancedPIOModes : 8; - USHORT ReservedByte64 : 8; - USHORT MinimumMWXferCycleTime; - USHORT RecommendedMWXferCycleTime; - USHORT MinimumPIOCycleTime; - USHORT MinimumPIOCycleTimeIORDY; - - USHORT ReservedWords69[2]; - - USHORT BusReleaseDelay; - USHORT ServiceCommandDelay; - - USHORT ReservedWords73[2]; - - USHORT QueueDepth : 5; - - USHORT ReservedWord75 : 11; - USHORT ReservedWords76[4]; - USHORT MajorRevision; - USHORT MinorRevision; - - struct { - USHORT SmartCommands : 1; - USHORT SecurityMode : 1; - USHORT RemovableMedia : 1; - USHORT PowerManagement : 1; - USHORT PacketCommands : 1; - USHORT WriteCache : 1; - USHORT LookAhead : 1; - USHORT ReleaseInterrupt : 1; - USHORT ServiceInterrupt : 1; - USHORT DeviceReset : 1; - USHORT HostProtectedArea : 1; - USHORT Obsolete1 : 1; - USHORT WriteBuffer : 1; - USHORT ReadBuffer : 1; - USHORT Nop : 1; - USHORT Obsolete2 : 1; - USHORT DownloadMicrocode : 1; - USHORT Reserved1 : 3; - USHORT Msn : 1; - USHORT PowerUpInStandby : 1; - USHORT ManualPowerUp : 1; - USHORT Reserved2 : 1; - USHORT SetMax : 1; - USHORT Reserved3 : 7; - } CommandSetSupport; - - USHORT ReservedWord84; - - struct { - USHORT SmartCommands : 1; - USHORT SecurityMode : 1; - USHORT RemovableMedia : 1; - USHORT PowerManagement : 1; - USHORT PacketCommands : 1; - USHORT WriteCache : 1; - USHORT LookAhead : 1; - USHORT ReleaseInterrupt : 1; - USHORT ServiceInterrupt : 1; - USHORT DeviceReset : 1; - USHORT HostProtectedArea : 1; - USHORT Obsolete1 : 1; - USHORT WriteBuffer : 1; - USHORT ReadBuffer : 1; - USHORT Nop : 1; - USHORT Obsolete2 : 1; - USHORT DownloadMicrocode : 1; - USHORT Reserved1 : 3; - USHORT Msn : 1; - USHORT PowerUpInStandby : 1; - USHORT ManualPowerUp : 1; - USHORT Reserved2 : 1; - USHORT SetMax : 1; - USHORT Reserved : 7; - } CommandSetActive; - - USHORT ReservedWord87; - - USHORT UltraDMASupport : 8; // word 88 - USHORT UltraDMAActive : 8; - - USHORT ReservedWords89[4]; - USHORT HardwareResetResult; - USHORT ReservedWords94[32]; - - USHORT AtapiZeroByteCount; - - USHORT MsnSupport : 2; - - USHORT ReservedWord127 : 14; - USHORT SecurityStatus; - USHORT ReservedWord129[126]; - USHORT Signature : 8; - USHORT CheckSum : 8; - -} IDENTIFY_PACKET_DATA, *PIDENTIFY_PACKET_DATA; -#pragma pack (pop, id_packet_data) - -// -// Register FIS -// -#pragma pack (push, regfis, 1) -typedef struct _REGISTER_FIS { - - // - // dword 0 - // - UCHAR FisType; - UCHAR Reserved0 : 7; - UCHAR CmdReg : 1; - UCHAR Command; - UCHAR Features; - - // - // dword 1 - // - UCHAR SectorNumber; - UCHAR CylinderLow; - UCHAR CylinderHigh; - UCHAR DeviceHead; - - // - // dword 2 - // - UCHAR SectorNumberExp; - UCHAR CylinderLowExp; - UCHAR CylinderHighExp; - UCHAR FeaturesExp; - - // - // dword 3 - // - UCHAR SectorCount; - UCHAR SectorCountExp; - UCHAR Reserved2; - UCHAR Control; - - // - // dword 4 - // - ULONG Reserved3; - -}REGISTER_FIS, *PREGISTER_FIS; -#pragma pack (pop, regfis) - -// -// ATAPI specific scsiops -// -#define ATAPI_MODE_SENSE 0x5A -#define ATAPI_MODE_SELECT 0x55 -#define ATAPI_LS120_FORMAT_UNIT 0x24 - -// -// IDE driveSelect register bit for LBA mode -// -#define IDE_LBA_MODE (1 << 6) - -// -// IDE drive control definitions -// -#define IDE_DC_DISABLE_INTERRUPTS 0x02 -#define IDE_DC_RESET_CONTROLLER 0x04 -#define IDE_DC_REENABLE_CONTROLLER 0x00 - -// -// IDE status definitions -// -#define IDE_STATUS_ERROR 0x01 -#define IDE_STATUS_INDEX 0x02 -#define IDE_STATUS_CORRECTED_ERROR 0x04 -#define IDE_STATUS_DRQ 0x08 -#define IDE_STATUS_DSC 0x10 -#define IDE_STATUS_DRDY 0x40 -#define IDE_STATUS_IDLE 0x50 -#define IDE_STATUS_BUSY 0x80 - -// -// IDE error definitions -// -#define IDE_ERROR_BAD_BLOCK 0x80 -#define IDE_ERROR_CRC_ERROR IDE_ERROR_BAD_BLOCK -#define IDE_ERROR_DATA_ERROR 0x40 -#define IDE_ERROR_MEDIA_CHANGE 0x20 -#define IDE_ERROR_ID_NOT_FOUND 0x10 -#define IDE_ERROR_MEDIA_CHANGE_REQ 0x08 -#define IDE_ERROR_COMMAND_ABORTED 0x04 -#define IDE_ERROR_END_OF_MEDIA 0x02 -#define IDE_ERROR_ILLEGAL_LENGTH 0x01 -#define IDE_ERROR_ADDRESS_NOT_FOUND IDE_ERROR_ILLEGAL_LENGTH - - -// -// IDE command definitions -// -#define IDE_COMMAND_NOP 0x00 -#define IDE_COMMAND_DATA_SET_MANAGEMENT 0x06 -#define IDE_COMMAND_ATAPI_RESET 0x08 -#define IDE_COMMAND_READ 0x20 -#define IDE_COMMAND_READ_EXT 0x24 -#define IDE_COMMAND_READ_DMA_EXT 0x25 -#define IDE_COMMAND_READ_DMA_QUEUED_EXT 0x26 -#define IDE_COMMAND_READ_MULTIPLE_EXT 0x29 -#define IDE_COMMAND_WRITE 0x30 -#define IDE_COMMAND_WRITE_EXT 0x34 -#define IDE_COMMAND_WRITE_DMA_EXT 0x35 -#define IDE_COMMAND_WRITE_DMA_QUEUED_EXT 0x36 -#define IDE_COMMAND_WRITE_MULTIPLE_EXT 0x39 -#define IDE_COMMAND_WRITE_DMA_FUA_EXT 0x3D -#define IDE_COMMAND_WRITE_DMA_QUEUED_FUA_EXT 0x3E -#define IDE_COMMAND_VERIFY 0x40 -#define IDE_COMMAND_VERIFY_EXT 0x42 -#define IDE_COMMAND_EXECUTE_DEVICE_DIAGNOSTIC 0x90 -#define IDE_COMMAND_SET_DRIVE_PARAMETERS 0x91 -#define IDE_COMMAND_ATAPI_PACKET 0xA0 -#define IDE_COMMAND_ATAPI_IDENTIFY 0xA1 -#define IDE_COMMAND_SMART 0xB0 -#define IDE_COMMAND_READ_MULTIPLE 0xC4 -#define IDE_COMMAND_WRITE_MULTIPLE 0xC5 -#define IDE_COMMAND_SET_MULTIPLE 0xC6 -#define IDE_COMMAND_READ_DMA 0xC8 -#define IDE_COMMAND_WRITE_DMA 0xCA -#define IDE_COMMAND_WRITE_DMA_QUEUED 0xCC -#define IDE_COMMAND_WRITE_MULTIPLE_FUA_EXT 0xCE -#define IDE_COMMAND_GET_MEDIA_STATUS 0xDA -#define IDE_COMMAND_DOOR_LOCK 0xDE -#define IDE_COMMAND_DOOR_UNLOCK 0xDF -#define IDE_COMMAND_STANDBY_IMMEDIATE 0xE0 -#define IDE_COMMAND_IDLE_IMMEDIATE 0xE1 -#define IDE_COMMAND_CHECK_POWER 0xE5 -#define IDE_COMMAND_SLEEP 0xE6 -#define IDE_COMMAND_FLUSH_CACHE 0xE7 -#define IDE_COMMAND_FLUSH_CACHE_EXT 0xEA -#define IDE_COMMAND_IDENTIFY 0xEC -#define IDE_COMMAND_MEDIA_EJECT 0xED -#define IDE_COMMAND_SET_FEATURE 0xEF -#define IDE_COMMAND_SECURITY_FREEZE_LOCK 0xF5 -#define IDE_COMMAND_NOT_VALID 0xFF - -// -// IDE Set Transfer Mode -// -#define IDE_SET_DEFAULT_PIO_MODE(mode) ((UCHAR) 1) // disable I/O Ready -#define IDE_SET_ADVANCE_PIO_MODE(mode) ((UCHAR) ((1 << 3) | (mode))) -#define IDE_SET_SWDMA_MODE(mode) ((UCHAR) ((1 << 4) | (mode))) -#define IDE_SET_MWDMA_MODE(mode) ((UCHAR) ((1 << 5) | (mode))) -#define IDE_SET_UDMA_MODE(mode) ((UCHAR) ((1 << 6) | (mode))) - -// -// Set features parameter list -// -#define IDE_FEATURE_ENABLE_WRITE_CACHE 0x2 -#define IDE_FEATURE_SET_TRANSFER_MODE 0x3 -#define IDE_FEATURE_ENABLE_SATA_FEATURE 0x10 -#define IDE_FEATURE_DISABLE_MSN 0x31 -#define IDE_FEATURE_DISABLE_REVERT_TO_POWER_ON 0x66 -#define IDE_FEATURE_DISABLE_WRITE_CACHE 0x82 -#define IDE_FEATURE_DISABLE_SATA_FEATURE 0x90 -#define IDE_FEATURE_ENABLE_MSN 0x95 - -// -// SATA Features Sector Count parameter list -// - -#define IDE_SATA_FEATURE_NON_ZERO_DMA_BUFFER_OFFSET 0x1 -#define IDE_SATA_FEATURE_DMA_SETUP_FIS_AUTO_ACTIVATE 0x2 -#define IDE_SATA_FEATURE_DEVICE_INITIATED_POWER_MANAGEMENT 0x3 -#define IDE_SATA_FEATURE_GUARANTEED_IN_ORDER_DELIVERY 0x4 -#define IDE_SATA_FEATURE_ASYNCHRONOUS_NOTIFICATION 0x5 -#define IDE_SATA_FEATURE_SOFTWARE_SETTINGS_PRESERVATION 0x6 - -// -// SMART sub command list -// -#define IDE_SMART_READ_ATTRIBUTES 0xD0 -#define IDE_SMART_READ_THRESHOLDS 0xD1 -#define IDE_SMART_ENABLE_DISABLE_AUTOSAVE 0xD2 -#define IDE_SMART_SAVE_ATTRIBUTE_VALUES 0xD3 -#define IDE_SMART_EXECUTE_OFFLINE_DIAGS 0xD4 -#define IDE_SMART_READ_LOG 0xD5 -#define IDE_SMART_WRITE_LOG 0xD6 -#define IDE_SMART_ENABLE 0xD8 -#define IDE_SMART_DISABLE 0xD9 -#define IDE_SMART_RETURN_STATUS 0xDA -#define IDE_SMART_ENABLE_DISABLE_AUTO_OFFLINE 0xDB - -// -// Features for IDE_COMMAND_DATA_SET_MANAGEMENT -// -#define IDE_DSM_FEATURE_TRIM 0x0001 //bit 0 of WORD - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4214) -#endif - -#endif - diff --git a/qt-correction-tool/pub/ddk/atm.h b/qt-correction-tool/pub/ddk/atm.h deleted file mode 100644 index 22a7f14..0000000 --- a/qt-correction-tool/pub/ddk/atm.h +++ /dev/null @@ -1,785 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - atm.h - -Abstract: - - This module defines the structures, macros, and manifests available - to ATM aware components. - -Author: - - NDIS/ATM Development Team - - -Revision History: - - Initial Version - March 1996 - ---*/ - -#ifndef _ATM_H_ -#define _ATM_H_ - -#pragma once - -// -// Address type -// -typedef ULONG ATM_ADDRESSTYPE; - -#define ATM_NSAP 0 -#define ATM_E164 1 - -// -// ATM Address -// -#define ATM_MAC_ADDRESS_LENGTH 6 // Same as 802.x -#define ATM_ADDRESS_LENGTH 20 - -// -// Special characters in ATM address string used in textual representations -// -#define ATM_ADDR_BLANK_CHAR L' ' -#define ATM_ADDR_PUNCTUATION_CHAR L'.' -#define ATM_ADDR_E164_START_CHAR L'+' - -typedef struct _ATM_ADDRESS -{ - ATM_ADDRESSTYPE AddressType; - ULONG NumberOfDigits; - UCHAR Address[ATM_ADDRESS_LENGTH]; -} ATM_ADDRESS, *PATM_ADDRESS; - - - -// -// AAL types that the miniport supports -// -#define AAL_TYPE_AAL0 1 -#define AAL_TYPE_AAL1 2 -#define AAL_TYPE_AAL34 4 -#define AAL_TYPE_AAL5 8 - -typedef ULONG ATM_AAL_TYPE, *PATM_AAL_TYPE; - - -// -// Types of Information Elements -// -typedef enum -{ - IE_AALParameters, - IE_TrafficDescriptor, - IE_BroadbandBearerCapability, - IE_BHLI, - IE_BLLI, - IE_CalledPartyNumber, - IE_CalledPartySubaddress, - IE_CallingPartyNumber, - IE_CallingPartySubaddress, - IE_Cause, - IE_QOSClass, - IE_TransitNetworkSelection, - IE_BroadbandSendingComplete, - IE_LIJCallId, - IE_Raw -} Q2931_IE_TYPE; - - -// -// Common header for each Information Element -// -typedef struct _Q2931_IE -{ - Q2931_IE_TYPE IEType; - ULONG IELength; // Bytes, including IEType and IELength fields - UCHAR IE[1]; -} Q2931_IE, *PQ2931_IE; - - -// -// Definitions for SapType in CO_SAP -// -#define SAP_TYPE_NSAP 0x00000001 -#define SAP_TYPE_E164 0x00000002 - -// -// Values used for the Mode field in AAL5_PARAMETERS -// -#define AAL5_MODE_MESSAGE 0x01 -#define AAL5_MODE_STREAMING 0x02 - -// -// Values used for the SSCSType field in AAL5_PARAMETERS -// -#define AAL5_SSCS_NULL 0x00 -#define AAL5_SSCS_SSCOP_ASSURED 0x01 -#define AAL5_SSCS_SSCOP_NON_ASSURED 0x02 -#define AAL5_SSCS_FRAME_RELAY 0x04 - - -// -// AAL Parameters -// -typedef struct _AAL1_PARAMETERS -{ - UCHAR Subtype; - UCHAR CBRRate; - USHORT Multiplier; - UCHAR SourceClockRecoveryMethod; - UCHAR ErrorCorrectionMethod; - USHORT StructuredDataTransferBlocksize; - UCHAR PartiallyFilledCellsMethod; -} AAL1_PARAMETERS, *PAAL1_PARAMETERS; - -typedef struct _AAL34_PARAMETERS -{ - USHORT ForwardMaxCPCSSDUSize; - USHORT BackwardMaxCPCSSDUSize; - USHORT LowestMID; - USHORT HighestMID; - UCHAR SSCSType; -} AAL34_PARAMETERS, *PAAL34_PARAMETERS; - -typedef struct _AAL5_PARAMETERS -{ - ULONG ForwardMaxCPCSSDUSize; - ULONG BackwardMaxCPCSSDUSize; - UCHAR Mode; - UCHAR SSCSType; -} AAL5_PARAMETERS, *PAAL5_PARAMETERS; - -typedef struct _AALUSER_PARAMETERS -{ - ULONG UserDefined; -} AALUSER_PARAMETERS, *PAALUSER_PARAMETERS; - -typedef struct _AAL_PARAMETERS_IE -{ - ATM_AAL_TYPE AALType; - union - { - AAL1_PARAMETERS AAL1Parameters; - AAL34_PARAMETERS AAL34Parameters; - AAL5_PARAMETERS AAL5Parameters; - AALUSER_PARAMETERS AALUserParameters; - } AALSpecificParameters; - -} AAL_PARAMETERS_IE, *PAAL_PARAMETERS_IE; - -// -// ATM Traffic Descriptor -// -typedef struct _ATM_TRAFFIC_DESCRIPTOR // For one direction -{ - ULONG PeakCellRateCLP0; - ULONG PeakCellRateCLP01; - ULONG SustainableCellRateCLP0; - ULONG SustainableCellRateCLP01; - ULONG MaximumBurstSizeCLP0; - ULONG MaximumBurstSizeCLP01; - BOOLEAN Tagging; -} ATM_TRAFFIC_DESCRIPTOR, *PATM_TRAFFIC_DESCRIPTOR; - - -typedef struct _ATM_TRAFFIC_DESCRIPTOR_IE -{ - ATM_TRAFFIC_DESCRIPTOR ForwardTD; - ATM_TRAFFIC_DESCRIPTOR BackwardTD; - BOOLEAN BestEffort; -} ATM_TRAFFIC_DESCRIPTOR_IE, *PATM_TRAFFIC_DESCRIPTOR_IE; - - -// -// values used for the BearerClass field in the Broadband Bearer Capability IE -// - - -#define BCOB_A 0x00 // Bearer class A -#define BCOB_C 0x01 // Bearer class C -#define BCOB_X 0x02 // Bearer class X - -// -// values used for the TrafficType field in the Broadband Bearer Capability IE -// -#define TT_NOIND 0x00 // No indication of traffic type -#define TT_CBR 0x04 // Constant bit rate -#define TT_VBR 0x08 // Variable bit rate - -// -// values used for the TimingRequirements field in the Broadband Bearer Capability IE -// -#define TR_NOIND 0x00 // No timing requirement indication -#define TR_END_TO_END 0x01 // End-to-end timing required -#define TR_NO_END_TO_END 0x02 // End-to-end timing not required - -// -// values used for the ClippingSusceptability field in the Broadband Bearer Capability IE -// -#define CLIP_NOT 0x00 // Not susceptible to clipping -#define CLIP_SUS 0x20 // Susceptible to clipping - -// -// values used for the UserPlaneConnectionConfig field in -// the Broadband Bearer Capability IE -// -#define UP_P2P 0x00 // Point-to-point connection -#define UP_P2MP 0x01 // Point-to-multipoint connection - -// -// Broadband Bearer Capability -// -typedef struct _ATM_BROADBAND_BEARER_CAPABILITY_IE -{ - UCHAR BearerClass; - UCHAR TrafficType; - UCHAR TimingRequirements; - UCHAR ClippingSusceptability; - UCHAR UserPlaneConnectionConfig; -} ATM_BROADBAND_BEARER_CAPABILITY_IE, *PATM_BROADBAND_BEARER_CAPABILITY_IE; - -// -// values used for the HighLayerInfoType field in ATM_BHLI -// -#define BHLI_ISO 0x00 // ISO -#define BHLI_UserSpecific 0x01 // User Specific -#define BHLI_HighLayerProfile 0x02 // High layer profile (only in UNI3.0) -#define BHLI_VendorSpecificAppId 0x03 // Vendor-Specific Application ID - -// -// Broadband High layer Information -// -typedef struct _ATM_BHLI_IE -{ - ULONG HighLayerInfoType; // High Layer Information Type - ULONG HighLayerInfoLength; // number of bytes in HighLayerInfo - UCHAR HighLayerInfo[8]; // The value dependent on the - // HighLayerInfoType field -} ATM_BHLI_IE, *PATM_BHLI_IE; - -// -// values used for Layer2Protocol in B-LLI -// -#define BLLI_L2_ISO_1745 0x01 // Basic mode ISO 1745 -#define BLLI_L2_Q921 0x02 // CCITT Rec. Q.921 -#define BLLI_L2_X25L 0x06 // CCITT Rec. X.25, link layer -#define BLLI_L2_X25M 0x07 // CCITT Rec. X.25, multilink -#define BLLI_L2_ELAPB 0x08 // Extended LAPB; for half duplex operation -#define BLLI_L2_HDLC_ARM 0x09 // HDLC ARM (ISO 4335) -#define BLLI_L2_HDLC_NRM 0x0A // HDLC NRM (ISO 4335) -#define BLLI_L2_HDLC_ABM 0x0B // HDLC ABM (ISO 4335) -#define BLLI_L2_LLC 0x0C // LAN logical link control (ISO 8802/2) -#define BLLI_L2_X75 0x0D // CCITT Rec. X.75, single link procedure -#define BLLI_L2_Q922 0x0E // CCITT Rec. Q.922 -#define BLLI_L2_USER_SPECIFIED 0x10 // User Specified -#define BLLI_L2_ISO_7776 0x11 // ISO 7776 DTE-DTE operation - -// -// values used for Layer3Protocol in B-LLI -// -#define BLLI_L3_X25 0x06 // CCITT Rec. X.25, packet layer -#define BLLI_L3_ISO_8208 0x07 // ISO/IEC 8208 (X.25 packet layer for DTE -#define BLLI_L3_X223 0x08 // X.223/ISO 8878 -#define BLLI_L3_SIO_8473 0x09 // ISO/IEC 8473 (OSI connectionless) -#define BLLI_L3_T70 0x0A // CCITT Rec. T.70 min. network layer -#define BLLI_L3_ISO_TR9577 0x0B // ISO/IEC TR 9577 Network Layer Protocol ID -#define BLLI_L3_USER_SPECIFIED 0x10 // User Specified - -// -// values used for Layer3IPI in struct B-LLI -// -#define BLLI_L3_IPI_SNAP 0x80 // IEEE 802.1 SNAP identifier -#define BLLI_L3_IPI_IP 0xCC // Internet Protocol (IP) identifier - -// -// Broadband Lower Layer Information -// -typedef struct _ATM_BLLI_IE -{ - ULONG Layer2Protocol; - UCHAR Layer2Mode; - UCHAR Layer2WindowSize; - ULONG Layer2UserSpecifiedProtocol; - ULONG Layer3Protocol; - UCHAR Layer3Mode; - UCHAR Layer3DefaultPacketSize; - UCHAR Layer3PacketWindowSize; - ULONG Layer3UserSpecifiedProtocol; - ULONG Layer3IPI; - UCHAR SnapId[5]; -} ATM_BLLI_IE, *PATM_BLLI_IE; - - -// -// Called Party Number -// -// If present, this IE overrides the Called Address specified in -// the main parameter block. -// -typedef ATM_ADDRESS ATM_CALLED_PARTY_NUMBER_IE; - - -// -// Called Party Subaddress -// -typedef ATM_ADDRESS ATM_CALLED_PARTY_SUBADDRESS_IE; - - - -// -// Calling Party Number -// -typedef struct _ATM_CALLING_PARTY_NUMBER_IE -{ - ATM_ADDRESS Number; - UCHAR PresentationIndication; - UCHAR ScreeningIndicator; -} ATM_CALLING_PARTY_NUMBER_IE, *PATM_CALLING_PARTY_NUMBER_IE; - - -// -// Calling Party Subaddress -// -typedef ATM_ADDRESS ATM_CALLING_PARTY_SUBADDRESS_IE; - - -// -// Values used for the QOSClassForward and QOSClassBackward -// fields in ATM_QOS_CLASS_IE -// -#define QOS_CLASS0 0x00 -#define QOS_CLASS1 0x01 -#define QOS_CLASS2 0x02 -#define QOS_CLASS3 0x03 -#define QOS_CLASS4 0x04 - -// -// QOS Class -// -typedef struct _ATM_QOS_CLASS_IE -{ - UCHAR QOSClassForward; - UCHAR QOSClassBackward; -} ATM_QOS_CLASS_IE, *PATM_QOS_CLASS_IE; - -// -// Broadband Sending Complete -// -typedef struct _ATM_BROADBAND_SENDING_COMPLETE_IE -{ - UCHAR SendingComplete; -} ATM_BROADBAND_SENDING_COMPLETE_IE, *PATM_BROADBAND_SENDING_COMPLETE_IE; - - -// -// Values used for the TypeOfNetworkId field in ATM_TRANSIT_NETWORK_SELECTION_IE -// -#define TNS_TYPE_NATIONAL 0x40 - -// -// Values used for the NetworkIdPlan field in ATM_TRANSIT_NETWORK_SELECTION_IE -// -#define TNS_PLAN_CARRIER_ID_CODE 0x01 - -// -// Transit Network Selection -// -typedef struct _ATM_TRANSIT_NETWORK_SELECTION_IE -{ - UCHAR TypeOfNetworkId; - UCHAR NetworkIdPlan; - UCHAR NetworkIdLength; - UCHAR NetworkId[1]; -} ATM_TRANSIT_NETWORK_SELECTION_IE, *PATM_TRANSIT_NETWORK_SELECTION_IE; - - -// -// Values used for the Location field in struct ATM_CAUSE_IE -// -#define ATM_CAUSE_LOC_USER 0x00 -#define ATM_CAUSE_LOC_PRIVATE_LOCAL 0x01 -#define ATM_CAUSE_LOC_PUBLIC_LOCAL 0x02 -#define ATM_CAUSE_LOC_TRANSIT_NETWORK 0x03 -#define ATM_CAUSE_LOC_PUBLIC_REMOTE 0x04 -#define ATM_CAUSE_LOC_PRIVATE_REMOTE 0x05 -#define ATM_CAUSE_LOC_INTERNATIONAL_NETWORK 0x07 -#define ATM_CAUSE_LOC_BEYOND_INTERWORKING 0x0A - -// -// Values used for the Cause field in struct ATM_CAUSE_IE -// -#define ATM_CAUSE_UNALLOCATED_NUMBER 0x01 -#define ATM_CAUSE_NO_ROUTE_TO_TRANSIT_NETWORK 0x02 -#define ATM_CAUSE_NO_ROUTE_TO_DESTINATION 0x03 -#define ATM_CAUSE_VPI_VCI_UNACCEPTABLE 0x0A -#define ATM_CAUSE_NORMAL_CALL_CLEARING 0x10 -#define ATM_CAUSE_USER_BUSY 0x11 -#define ATM_CAUSE_NO_USER_RESPONDING 0x12 -#define ATM_CAUSE_CALL_REJECTED 0x15 -#define ATM_CAUSE_NUMBER_CHANGED 0x16 -#define ATM_CAUSE_USER_REJECTS_CLIR 0x17 -#define ATM_CAUSE_DESTINATION_OUT_OF_ORDER 0x1B -#define ATM_CAUSE_INVALID_NUMBER_FORMAT 0x1C -#define ATM_CAUSE_STATUS_ENQUIRY_RESPONSE 0x1E -#define ATM_CAUSE_NORMAL_UNSPECIFIED 0x1F -#define ATM_CAUSE_VPI_VCI_UNAVAILABLE 0x23 -#define ATM_CAUSE_NETWORK_OUT_OF_ORDER 0x26 -#define ATM_CAUSE_TEMPORARY_FAILURE 0x29 -#define ATM_CAUSE_ACCESS_INFORMAION_DISCARDED 0x2B -#define ATM_CAUSE_NO_VPI_VCI_AVAILABLE 0x2D -#define ATM_CAUSE_RESOURCE_UNAVAILABLE 0x2F -#define ATM_CAUSE_QOS_UNAVAILABLE 0x31 -#define ATM_CAUSE_USER_CELL_RATE_UNAVAILABLE 0x33 -#define ATM_CAUSE_BEARER_CAPABILITY_UNAUTHORIZED 0x39 -#define ATM_CAUSE_BEARER_CAPABILITY_UNAVAILABLE 0x3A -#define ATM_CAUSE_OPTION_UNAVAILABLE 0x3F -#define ATM_CAUSE_BEARER_CAPABILITY_UNIMPLEMENTED 0x41 -#define ATM_CAUSE_UNSUPPORTED_TRAFFIC_PARAMETERS 0x49 -#define ATM_CAUSE_INVALID_CALL_REFERENCE 0x51 -#define ATM_CAUSE_CHANNEL_NONEXISTENT 0x52 -#define ATM_CAUSE_INCOMPATIBLE_DESTINATION 0x58 -#define ATM_CAUSE_INVALID_ENDPOINT_REFERENCE 0x59 -#define ATM_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION 0x5B -#define ATM_CAUSE_TOO_MANY_PENDING_ADD_PARTY 0x5C -#define ATM_CAUSE_AAL_PARAMETERS_UNSUPPORTED 0x5D -#define ATM_CAUSE_MANDATORY_IE_MISSING 0x60 -#define ATM_CAUSE_UNIMPLEMENTED_MESSAGE_TYPE 0x61 -#define ATM_CAUSE_UNIMPLEMENTED_IE 0x63 -#define ATM_CAUSE_INVALID_IE_CONTENTS 0x64 -#define ATM_CAUSE_INVALID_STATE_FOR_MESSAGE 0x65 -#define ATM_CAUSE_RECOVERY_ON_TIMEOUT 0x66 -#define ATM_CAUSE_INCORRECT_MESSAGE_LENGTH 0x68 -#define ATM_CAUSE_PROTOCOL_ERROR 0x6F - -// -// Values used for the Condition portion of the Diagnostics field -// in struct ATM_CAUSE_IE, for certain Cause values -// -#define ATM_CAUSE_COND_UNKNOWN 0x00 -#define ATM_CAUSE_COND_PERMANENT 0x01 -#define ATM_CAUSE_COND_TRANSIENT 0x02 - -// -// Values used for the Rejection Reason portion of the Diagnostics field -// in struct ATM_CAUSE_IE, for certain Cause values -// -#define ATM_CAUSE_REASON_USER 0x00 -#define ATM_CAUSE_REASON_IE_MISSING 0x04 -#define ATM_CAUSE_REASON_IE_INSUFFICIENT 0x08 - -// -// Values used for the P-U flag of the Diagnostics field -// in struct ATM_CAUSE_IE, for certain Cause values -// -#define ATM_CAUSE_PU_PROVIDER 0x00 -#define ATM_CAUSE_PU_USER 0x08 - -// -// Values used for the N-A flag of the Diagnostics field -// in struct ATM_CAUSE_IE, for certain Cause values -// -#define ATM_CAUSE_NA_NORMAL 0x00 -#define ATM_CAUSE_NA_ABNORMAL 0x04 - -// -// Cause -// -typedef struct _ATM_CAUSE_IE -{ - UCHAR Location; - UCHAR Cause; - UCHAR DiagnosticsLength; - UCHAR Diagnostics[4]; -} ATM_CAUSE_IE, *PATM_CAUSE_IE; - - -// -// Leaf Initiated Join (LIJ) Identifier -// -typedef struct _ATM_LIJ_CALLID_IE -{ - ULONG Identifier; -} ATM_LIJ_CALLID_IE, *PATM_LIJ_CALLID_IE; - - -// -// Raw Information Element - the user can fill in whatever he wants -// -typedef struct _ATM_RAW_IE -{ - ULONG RawIELength; - ULONG RawIEType; - UCHAR RawIEValue[1]; -} ATM_RAW_IE, *PATM_RAW_IE; - - -// -// This is the value of the ParamType field in the CO_SPECIFIC_PARAMETERS structure -// when the Parameters[] field contains ATM media specific values in the structure -// ATM_MEDIA_PARAMETERS. -// -#define ATM_MEDIA_SPECIFIC 0x00000001 - -// -// The Q2931 Call Manager Specific parameters that goes into the -// CallMgrParameters->CallMgrSpecific.Parameters -// -typedef struct _Q2931_CALLMGR_PARAMETERS -{ - ATM_ADDRESS CalledParty; - ATM_ADDRESS CallingParty; - ULONG InfoElementCount; - UCHAR InfoElements[1]; // one or more info elements -} Q2931_CALLMGR_PARAMETERS, *PQ2931_CALLMGR_PARAMETERS; - - -// -// This is the specific portion of either the Media parameters or the CallMgr -// Parameters. The following two defines are used in the ParamType field -// depending on the signaling type. -// -#define CALLMGR_SPECIFIC_Q2931 0x00000001 - -typedef struct _ATM_VPIVCI -{ - ULONG Vpi; - ULONG Vci; -} ATM_VPIVCI, *PATM_VPIVCI; - -// -// ATM Service Category -// -#define ATM_SERVICE_CATEGORY_CBR 1 // Constant Bit Rate -#define ATM_SERVICE_CATEGORY_VBR 2 // Variable Bit Rate -#define ATM_SERVICE_CATEGORY_UBR 4 // Unspecified Bit Rate -#define ATM_SERVICE_CATEGORY_ABR 8 // Available Bit Rate - -typedef ULONG ATM_SERVICE_CATEGORY, *PATM_SERVICE_CATEGORY; - - -// -// ATM flow parameters for use in specifying Media parameters -// -typedef struct _ATM_FLOW_PARAMETERS -{ - ATM_SERVICE_CATEGORY ServiceCategory; - ULONG AverageCellRate; // in cells/sec - ULONG PeakCellRate; // in cells/sec - ULONG MinimumCellRate; // in cells/sec (ABR MCR) - ULONG InitialCellRate; // in cells/sec (ABR ICR) - ULONG BurstLengthCells; // in cells - ULONG MaxSduSize; // MTU in bytes - ULONG TransientBufferExposure; // in cells (ABR TBE) - ULONG CumulativeRMFixedRTT; // in microseconds (ABR FRTT) - UCHAR RateIncreaseFactor; // UNI 4.0 coding (ABR RIF) - UCHAR RateDecreaseFactor; // UNI 4.0 coding (ABR RDF) - USHORT ACRDecreaseTimeFactor; // UNI 4.0 coding (ABR ADTF) - UCHAR MaximumCellsPerForwardRMCell; // UNI 4.0 coding (ABR Nrm) - UCHAR MaximumForwardRMCellInterval; // UNI 4.0 coding (ABR Trm) - UCHAR CutoffDecreaseFactor; // UNI 4.0 coding (ABR CDF) - UCHAR Reserved1; // padding - ULONG MissingRMCellCount; // (ABR CRM) - ULONG Reserved2; - ULONG Reserved3; -} ATM_FLOW_PARAMETERS, *PATM_FLOW_PARAMETERS; - - - - -// -// ATM Specific Media parameters - this is the Media specific structure for ATM -// that goes into MediaParameters->MediaSpecific.Parameters. -// -typedef struct _ATM_MEDIA_PARAMETERS -{ - ATM_VPIVCI ConnectionId; - ATM_AAL_TYPE AALType; - ULONG CellDelayVariationCLP0; - ULONG CellDelayVariationCLP1; - ULONG CellLossRatioCLP0; - ULONG CellLossRatioCLP1; - ULONG CellTransferDelayCLP0; - ULONG CellTransferDelayCLP1; - ULONG DefaultCLP; - ATM_FLOW_PARAMETERS Transmit; - ATM_FLOW_PARAMETERS Receive; -} ATM_MEDIA_PARAMETERS, *PATM_MEDIA_PARAMETERS; - - -// Bit 0 in Reserved1 in ATM_FLOW_PARAMETERS is reserved. -#define ATM_FLOW_PARAMS_RSVD1_MPP 0x01 - -#ifndef SAP_FIELD_ABSENT -#define SAP_FIELD_ABSENT ((ULONG)0xfffffffe) -#endif - -#ifndef SAP_FIELD_ANY -#define SAP_FIELD_ANY ((ULONG)0xffffffff) -#endif - -#define SAP_FIELD_ANY_AESA_SEL ((ULONG)0xfffffffa) // SEL is wild-carded -#define SAP_FIELD_ANY_AESA_REST ((ULONG)0xfffffffb) // All of the address - // except SEL, is wild-carded - -// -// The ATM Specific SAP definition -// -typedef struct _ATM_SAP -{ - ATM_BLLI_IE Blli; - ATM_BHLI_IE Bhli; - ULONG NumberOfAddresses; - UCHAR Addresses[1]; // each of type ATM_ADDRESS -} ATM_SAP, *PATM_SAP; - -// -// The ATM Specific SAP definition when adding PVCs -// -typedef struct _ATM_PVC_SAP -{ - ATM_BLLI_IE Blli; - ATM_BHLI_IE Bhli; -} ATM_PVC_SAP, *PATM_PVC_SAP; - -// -// The structure passed in the Parameters field of the CO_SPECIFIC_PARAMETERS -// structure passed in an ADD PVC request for Q.2931 -// -typedef struct _Q2931_ADD_PVC -{ - ATM_ADDRESS CalledParty; - ATM_ADDRESS CallingParty; - ATM_VPIVCI ConnectionId; - ATM_AAL_TYPE AALType; - ATM_FLOW_PARAMETERS ForwardFP; - ATM_FLOW_PARAMETERS BackwardFP; - ULONG Flags; - ATM_PVC_SAP LocalSap; - ATM_PVC_SAP DestinationSap; - BOOLEAN LIJIdPresent; - ATM_LIJ_CALLID_IE LIJId; -} Q2931_ADD_PVC, *PQ2931_ADD_PVC; - -// -// These flags are defined to be used with Q2931_ADD_PVC above -// -// this VC should be used by the CallMgr as the signaling VC now -#define CO_FLAG_SIGNALING_VC 0x00000001 - -// -// Use this flag for a PVC that cannot be used for a MakeCall - incoming call only -// the call mgr can then be optimized not to search these PVCs during make call -// processing. -#define CO_FLAG_NO_DEST_SAP 0x00000002 - -// -// Use this flag for a PVC that cannot be used to indicate an incoming call. -// -#define CO_FLAG_NO_LOCAL_SAP 0x00000004 - -// -// the structure passed in the Parameters field of the CO_SPECIFIC_PARAMETERS -// structure passed in an NDIS_CO_PVC request for Q2931 -// -typedef struct _Q2931_DELETE_PVC -{ - ATM_VPIVCI ConnectionId; -} Q2931_DELETE_PVC, *PQ2931_DELETE_PVC; - -typedef struct _CO_GET_CALL_INFORMATION -{ - ULONG CallInfoType; - ULONG CallInfoLength; - PVOID CallInfoBuffer; -} CO_GET_CALL_INFORMATION, *PCO_GET_CALL_INFORMATION; - -// -// the structure for returning the supported VC rates from the miniport, -// returned in response to OID_ATM_SUPPORTED_VC_RATES -// -typedef struct _ATM_VC_RATES_SUPPORTED -{ - ULONG MinCellRate; - ULONG MaxCellRate; -} ATM_VC_RATES_SUPPORTED, *PATM_VC_RATES_SUPPORTED; - -// -// NDIS_PACKET out of band information for ATM. -// -typedef struct _ATM_AAL_OOB_INFO -{ - ATM_AAL_TYPE AalType; - union - { - struct _ATM_AAL5_INFO - { - BOOLEAN CellLossPriority; - UCHAR UserToUserIndication; - UCHAR CommonPartIndicator; - } ATM_AAL5_INFO; - - struct _ATM_AAL0_INFO - { - BOOLEAN CellLossPriority; - UCHAR PayLoadTypeIdentifier; - } ATM_AAL0_INFO; - }; -} ATM_AAL_OOB_INFO, *PATM_AAL_OOB_INFO; - - -// -// Physical Line Speeds in bits/sec. -// -#define ATM_PHYS_RATE_SONET_STS3C 155520000 -#define ATM_PHYS_RATE_IBM_25 25600000 - -// -// ATM cell layer transfer capacities in bits/sec. This is the throughput -// available for ATM cells, after allowing for physical framing overhead. -// -#define ATM_CELL_TRANSFER_CAPACITY_SONET_STS3C 149760000 -#define ATM_CELL_TRANSFER_CAPACITY_IBM_25 25125926 - - - -// -// User data rate in units of 100 bits/sec. This is returned in response to -// the OID_GEN_CO_LINK_SPEED query. This is the effective rate of -// transfer of data available to the ATM layer user, after allowing for -// the ATM cell header. -// -#define ATM_USER_DATA_RATE_SONET_155 1356317 -#define ATM_USER_DATA_RATE_IBM_25 227556 - - - -// -// The ATM Service Registry MIB Table is used to locate ATM network -// services. OID_ATM_GET_SERVICE_ADDRESS is used by clients to access -// this table. -// - -typedef ULONG ATM_SERVICE_REGISTRY_TYPE; - -#define ATM_SERVICE_REGISTRY_LECS 1 // LAN Emulation Configuration Server -#define ATM_SERVICE_REGISTRY_ANS 2 // ATM Name Server - -// -// Structure passed to OID_ATM_GET_SERVICE_ADDRESS. -// -typedef struct _ATM_SERVICE_ADDRESS_LIST -{ - ATM_SERVICE_REGISTRY_TYPE ServiceRegistryType; - ULONG NumberOfAddressesAvailable; - ULONG NumberOfAddressesReturned; - ATM_ADDRESS Address[1]; -} ATM_SERVICE_ADDRESS_LIST, *PATM_SERVICE_ADDRESS_LIST; - -#endif // _ATM_H_ - - diff --git a/qt-correction-tool/pub/ddk/aux_klib.h b/qt-correction-tool/pub/ddk/aux_klib.h deleted file mode 100644 index 144e861..0000000 --- a/qt-correction-tool/pub/ddk/aux_klib.h +++ /dev/null @@ -1,104 +0,0 @@ -/*++ - -Copyright (c) 2004 Microsoft Corporation - -Module Name: - - aux_klib.h - -Abstract: - - Kernel mode shim to access system functionality that is not properly exposed - to applications in currently shipping operating systems. - ---*/ - -#ifndef _AUX_KLIB_H -#define _AUX_KLIB_H - -#ifndef PIMAGE_EXPORT_DIRECTORY -#include -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define AUX_KLIB_MODULE_PATH_LEN 256 - -typedef struct _AUX_MODULE_BASIC_INFO { - PVOID ImageBase; -} AUX_MODULE_BASIC_INFO, *PAUX_MODULE_BASIC_INFO; - -typedef struct _AUX_MODULE_EXTENDED_INFO { - AUX_MODULE_BASIC_INFO BasicInfo; - ULONG ImageSize; - USHORT FileNameOffset; - UCHAR FullPathName [AUX_KLIB_MODULE_PATH_LEN]; -} AUX_MODULE_EXTENDED_INFO, *PAUX_MODULE_EXTENDED_INFO; - -typedef struct _KBUGCHECK_DATA { - ULONG BugCheckDataSize; - ULONG BugCheckCode; - ULONG_PTR Parameter1; - ULONG_PTR Parameter2; - ULONG_PTR Parameter3; - ULONG_PTR Parameter4; -} KBUGCHECK_DATA, *PKBUGCHECK_DATA; - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTSTATUS -__stdcall -AuxKlibInitialize ( - VOID - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTSTATUS -__stdcall -AuxKlibQueryModuleInformation ( - IN OUT PULONG BufferSize, - IN ULONG ElementSize, - OUT PVOID QueryInfo OPTIONAL - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTSTATUS -AuxKlibGetBugCheckData( - OUT PKBUGCHECK_DATA BugCheckData - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -PIMAGE_EXPORT_DIRECTORY -AuxKlibGetImageExportDirectory( - IN PVOID ImageBase - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - - -#ifdef __cplusplus -} -#endif - -#endif // _AUX_KLIB_H - diff --git a/qt-correction-tool/pub/ddk/avc.h b/qt-correction-tool/pub/ddk/avc.h deleted file mode 100644 index 186c8a5..0000000 --- a/qt-correction-tool/pub/ddk/avc.h +++ /dev/null @@ -1,397 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - avc.h - -Abstract - - MS AVC Driver - -Author: - - PB 9/24/99 - -Revision History: -Date Who What --------- --------- ------------------------------------------------------------ -9/24/99 PB created -10/13/99 DG added avc protocol support ---*/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#ifndef _AVC_H_ -#define _AVC_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef CTL_CODE -#pragma message ("CTL_CODE undefined. Include winioctl.h or wdm.h") -#endif - -// ctype values from AVC Digital Interface General Specification, Rev 3.0, Section 5.3.1 -typedef enum _tagAvcCommandType { - AVC_CTYPE_CONTROL = 0x00, - AVC_CTYPE_STATUS = 0x01, - AVC_CTYPE_SPEC_INQ = 0x02, - AVC_CTYPE_NOTIFY = 0x03, - AVC_CTYPE_GEN_INQ = 0x04 -} AvcCommandType; - -// response values from AVC Digital Interface General Specification, Rev 3.0, Section 5.3.2 -typedef enum _tagAvcResponseCode { - AVC_RESPONSE_NOTIMPL = 0x08, - AVC_RESPONSE_ACCEPTED = 0x09, - AVC_RESPONSE_REJECTED = 0x0a, - AVC_RESPONSE_IN_TRANSITION = 0x0b, - AVC_RESPONSE_STABLE = 0x0c, - AVC_RESPONSE_IMPLEMENTED = 0x0c, - AVC_RESPONSE_CHANGED = 0x0d, - AVC_RESPONSE_INTERIM = 0x0f -} AvcResponseCode; - -// subunit type values from Enhancements to AV/C General Specification 3.0, Version 1.1, Section 7. -typedef enum _tagAvcSubunitType { - AVC_SUBUNITTYPE_VIDEO_MONITOR = 0x00, - AVC_SUBUNITTYPE_AUDIO = 0x01, - AVC_SUBUNITTYPE_PRINTER = 0x02, - AVC_SUBUNITTYPE_DISC_PLAYER = 0x03, - AVC_SUBUNITTYPE_TAPE_PLAYER = 0x04, - AVC_SUBUNITTYPE_TUNER = 0x05, - AVC_SUBUNITTYPE_CA = 0x06, - AVC_SUBUNITTYPE_VIDEO_CAMERA = 0x07, - AVC_SUBUNITTYPE_PANEL = 0x09, - AVC_SUBUNITTYPE_BULLETINBOARD = 0x0A, - AVC_SUBUNITTYPE_CAMERASTORAGE = 0x0B, - AVC_SUBUNITTYPE_VENDOR_UNIQUE = 0x1c, - AVC_SUBUNITTYPE_EXTENDED = 0x1e, - AVC_SUBUNITTYPE_EXTENDED_FULL = 0xff, // This is used only in extension bytes - AVC_SUBUNITTYPE_UNIT = 0x1f -} AvcSubunitType; - -#ifdef _NTDDK_ - -#define STATIC_KSMEDIUMSETID_1394SerialBus\ - 0x9D46279FL, 0x3432, 0x48F3, 0x88, 0x8A, 0xEE, 0xFF, 0x1B, 0x7E, 0xEE, 0x71 -DEFINE_GUIDSTRUCT("9D46279F-3432-48F3-888A-EEFF1B7EEE71", KSMEDIUMSETID_1394SerialBus); -#define KSMEDIUMSETID_1394SerialBus DEFINE_GUIDNAMED(KSMEDIUMSETID_1394SerialBus) - -#define DEFAULT_AVC_TIMEOUT (1000000L) // 100ms in 100 nanosecond units -#define DEFAULT_AVC_RETRIES 9 // 10 tries altogether - -// Max pages available via the SUBUNIT INFO command -#define MAX_AVC_SUBUNITINFO_PAGES 8 - -// Max number of bytes of subunit address information per page -#define MAX_AVC_SUBUNITINFO_BYTES 4 - -// Combined subunit address byte count for all pages -#define AVC_SUBUNITINFO_BYTES (MAX_AVC_SUBUNITINFO_PAGES * MAX_AVC_SUBUNITINFO_BYTES) - -// -// IOCTL definitions -// -#define IOCTL_AVC_CLASS CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x92, \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS \ - ) - -typedef enum _tagAVC_FUNCTION { - AVC_FUNCTION_COMMAND = 0, // struct AVC_COMMAND_IRB - AVC_FUNCTION_GET_PIN_COUNT = 1, // struct AVC_PIN_COUNT - AVC_FUNCTION_GET_PIN_DESCRIPTOR = 2, // struct AVC_PIN_DESCRIPTOR - AVC_FUNCTION_GET_CONNECTINFO = 3, // struct AVC_PRECONNECT_INFO - AVC_FUNCTION_SET_CONNECTINFO = 4, // struct AVC_SETCONNECT_INFO - AVC_FUNCTION_ACQUIRE = 5, // struct AVC_PIN_ID - AVC_FUNCTION_RELEASE = 6, // struct AVC_PIN_ID - AVC_FUNCTION_CLR_CONNECTINFO = 7, // struct AVC_PIN_ID - AVC_FUNCTION_GET_EXT_PLUG_COUNTS = 8, // struct AVC_EXT_PLUG_COUNTS - AVC_FUNCTION_GET_UNIQUE_ID = 9, // struct AVC_UNIQUE_ID - AVC_FUNCTION_GET_REQUEST = 10, // struct AVC_COMMAND_IRB - AVC_FUNCTION_SEND_RESPONSE = 11, // struct AVC_COMMAND_IRB - AVC_FUNCTION_FIND_PEER_DO = 12, // struct AVC_PEER_DO_LOCATOR - AVC_FUNCTION_PEER_DO_LIST = 13, // struct AVC_PEER_DO_LIST - AVC_FUNCTION_GET_SUBUNIT_INFO = 14, // struct AVC_SUBUNIT_INFO_BLOCK -} AVC_FUNCTION; - -// Ensure that packing is consistent (/Zp8) -#include - -// This structure is to be included at the head of a more specific AVC function structure -typedef struct _AVC_IRB { - AVC_FUNCTION Function; -} AVC_IRB, *PAVC_IRB; - -// The maximum number of bytes available for an operand list -#define MAX_AVC_OPERAND_BYTES 509 - -// AVC_COMMAND_IRB -// -// This structure defines the common components of an AVC command request. It -// holds the opcode and operands of a request, and the opcode and operands -// of a response (upon completion). The size of the operand list is fixed at -// the maximum allowable number of operands given a one-byte Subunit Address. -// If the Subunit Address is extended in any way, the maximum permissible -// number of operand bytes will be reduced accordingly. -// (supported by peer and virtual instances) -typedef struct _AVC_COMMAND_IRB { - // AVC_FUNCTION_COMMAND -#ifdef __cplusplus - AVC_IRB Common; -#else - AVC_IRB; -#endif - - UCHAR SubunitAddrFlag : 1; // set to 1 if a SubunitAddr address is specified - UCHAR AlternateOpcodesFlag : 1; // set to 1 if the AlternateOpcodes address is specified - UCHAR TimeoutFlag : 1; // set to 1 if Timeout specified - UCHAR RetryFlag : 1; // set to 1 if Retries specified - - // On command request, this struct will use the CommandType - // On command response, this struct will use ResponseCode - union { - UCHAR CommandType; - UCHAR ResponseCode; - }; - - PUCHAR SubunitAddr; // set according to the target device object if not specified - PUCHAR AlternateOpcodes; // set to the address of an array of alternate opcodes (byte 0 - // is the count of alternate opcodes that follow) - - LARGE_INTEGER Timeout; // Defaults to DEFAULT_AVC_TIMEOUT if not specified - UCHAR Retries; // Defaults to DEFAULT_AVC_RETRIES if not specified - // The total amount of time a request will wait if the subunit is not responsive is: - // Timeout * (Retries+1) - - UCHAR Opcode; - ULONG OperandLength; // set to the actual length of the operand list - UCHAR Operands[MAX_AVC_OPERAND_BYTES]; - - NODE_ADDRESS NodeAddress; // Used by virtual devices, ignored otherwise - ULONG Generation; // Used by virtual devices, ignored otherwise -} AVC_COMMAND_IRB, *PAVC_COMMAND_IRB; - -// For AVC_FUNCTION_GET_PIN_COUNT (supported by peer instance only) -// -typedef struct _AVC_PIN_COUNT { - - ULONG PinCount; // The pin count -} AVC_PIN_COUNT, *PAVC_PIN_COUNT; - -// Dataformat Intersection handler used in struct AVC_PIN_DESCRIPTOR -typedef -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -(*PFNAVCINTERSECTHANDLER)( - __in PVOID Context, - __in ULONG PinId, - __in PKSDATARANGE DataRange, - __in PKSDATARANGE MatchingDataRange, - __in ULONG DataBufferSize, - __out_bcount_opt(DataBufferSize) PVOID Data, - __out PULONG DataSize - ); - -// For AVC_FUNCTION_GET_PIN_DESCRIPTOR (supported by peer instance only) -// -typedef struct _AVC_PIN_DESCRIPTOR { - - ULONG PinId; // The pin number - KSPIN_DESCRIPTOR PinDescriptor; - PFNAVCINTERSECTHANDLER IntersectHandler; - PVOID Context; -} AVC_PIN_DESCRIPTOR, *PAVC_PIN_DESCRIPTOR; - -#define AVCCONNECTINFO_MAX_SUBUNITADDR_LEN AVC_SUBUNITINFO_BYTES - -typedef enum _KSPIN_FLAG_AVC { - KSPIN_FLAG_AVCMASK = 0x03, // the mask to isolate the AV/C defined bit flags - KSPIN_FLAG_AVC_PERMANENT = 0x01, // part of the AV/C Connect Status bit flag - KSPIN_FLAG_AVC_CONNECTED = 0x02, // part of the AV/C Connect Status bit flag - KSPIN_FLAG_AVC_PCRONLY = 0x04, // no subunit plug control - KSPIN_FLAG_AVC_FIXEDPCR = 0x08, // implies KSPIN_FLAG_AVC_PERMANENT -} KSPIN_FLAG_AVC; - -typedef struct _AVCPRECONNECTINFO { - - // Unique ID of the target unit - GUID DeviceID; - - UCHAR SubunitAddress[AVCCONNECTINFO_MAX_SUBUNITADDR_LEN]; - ULONG SubunitPlugNumber; - KSPIN_DATAFLOW DataFlow; - - // KSPIN_FLAG_AVC_... - ULONG Flags; - - // Undefined if !(Flags & KSPIN_FLAG_AVC_FIXEDPCR) - ULONG UnitPlugNumber; - -} AVCPRECONNECTINFO, *PAVCPRECONNECTINFO; - -// For AVC_FUNCTION_GET_CONNECTINFO (supported by peer instance only) -// -typedef struct _AVC_PRECONNECT_INFO { - - ULONG PinId; // The pin number - AVCPRECONNECTINFO ConnectInfo; -} AVC_PRECONNECT_INFO, *PAVC_PRECONNECT_INFO; - -typedef struct _AVCCONNECTINFO { - - // Unique ID of the target unit - GUID DeviceID; - - UCHAR SubunitAddress[AVCCONNECTINFO_MAX_SUBUNITADDR_LEN]; - ULONG SubunitPlugNumber; - KSPIN_DATAFLOW DataFlow; - - // NULL if intra-unit connection - HANDLE hPlug; - - // Undefined if hPlug == NULL - ULONG UnitPlugNumber; - -} AVCCONNECTINFO, *PAVCCONNECTINFO; - -// For AVC_FUNCTION_SET_CONNECTINFO (supported by peer instance only) -// -typedef struct _AVC_SETCONNECT_INFO { - - ULONG PinId; // The pin number - AVCCONNECTINFO ConnectInfo; -} AVC_SETCONNECT_INFO, *PAVC_SETCONNECT_INFO; - -// For AVC_FUNCTION_ACQUIRE or AVC_FUNCTION_RELEASE or AVC_FUNCTION_CLR_CONNECTINFO (supported by peer instance only) -// -typedef struct _AVC_PIN_ID { - - ULONG PinId; // The pin ID - -} AVC_PIN_ID, *PAVC_PIN_ID; - -// For AVC_FUNCTION_GET_EXT_PLUG_COUNTS (supported by peer instance only) -// -typedef struct _AVC_EXT_PLUG_COUNTS { - - ULONG ExtInputs; - ULONG ExtOutputs; - -} AVC_EXT_PLUG_COUNTS, *PAVC_EXT_PLUG_COUNTS; - -// For AVC_FUNCTION_GET_UNIQUE_ID (supported by peer instance only) -// -typedef struct _AVC_UNIQUE_ID { - - // Unique ID of the target unit - GUID DeviceID; - -} AVC_UNIQUE_ID, *PAVC_UNIQUE_ID; - -// For AVC_FUNCTION_FIND_PEER_DO -// -typedef struct _AVC_PEER_DO_LOCATOR { - - // 1394 NodeAddress identifying target for query - NODE_ADDRESS NodeAddress; - ULONG Generation; - - PDEVICE_OBJECT DeviceObject; - -} AVC_PEER_DO_LOCATOR, *PAVC_PEER_DO_LOCATOR; - -// For AVC_FUNCTION_PEER_DO_LIST -// -typedef struct _AVC_PEER_DO_LIST { - - // Counted array of referenced device objects (allocated by target) - ULONG Count; - __field_ecount(Count) - PDEVICE_OBJECT *Objects; - -} AVC_PEER_DO_LIST, *PAVC_PEER_DO_LIST; - -// For AVC_FUNCTION_GET_SUBUNIT_INFO -// -typedef struct _AVC_SUBUNIT_INFO_BLOCK { - - // Array of bytes to hold subunit info (see AV/C SUBUNIT_INFO unit command for format) - UCHAR Info[AVC_SUBUNITINFO_BYTES]; - -} AVC_SUBUNIT_INFO_BLOCK, *PAVC_SUBUNIT_INFO_BLOCK; - -typedef struct _AVC_MULTIFUNC_IRB { -#ifdef __cplusplus - AVC_IRB Common; -#else - AVC_IRB; -#endif - - union { - AVC_PIN_COUNT PinCount; // AVC_FUNCTION_GET_PIN_COUNT - AVC_PIN_DESCRIPTOR PinDescriptor; // AVC_FUNCTION_GET_PIN_DESCRIPTOR - AVC_PRECONNECT_INFO PreConnectInfo; // AVC_FUNCTION_GET_CONNECTINFO - AVC_SETCONNECT_INFO SetConnectInfo; // AVC_FUNCTION_SET_CONNECTINFO - AVC_PIN_ID PinId; // AVC_FUNCTION_ACQUIRE or - // AVC_FUNCTION_RELEASE or - // AVC_FUNCTION_CLR_CONNECTINFO - AVC_EXT_PLUG_COUNTS ExtPlugCounts; // AVC_FUNCTION_GET_EXT_PLUG_COUNTS - AVC_UNIQUE_ID UniqueID; // AVC_FUNCTION_GET_UNIQUE_ID - AVC_PEER_DO_LOCATOR PeerLocator; // AVC_FUNCTION_FIND_PEER_DO - AVC_PEER_DO_LIST PeerList; // AVC_FUNCTION_PEER_DO_LIST - AVC_SUBUNIT_INFO_BLOCK Subunits; // AVC_FUNCTION_GET_SUBUNIT_INFO - }; - -} AVC_MULTIFUNC_IRB, *PAVC_MULTIFUNC_IRB; - -#include - -#endif // _NTDDK_ - -// -// IOCTL definitions for Virtual Unit control (from user mode) -// -#define IOCTL_AVC_UPDATE_VIRTUAL_SUBUNIT_INFO CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x000, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_AVC_REMOVE_VIRTUAL_SUBUNIT_INFO CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x001, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_AVC_BUS_RESET CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x002, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// Ensure that packing is consistent (/Zp8) -#include - -typedef struct _AVC_SUBUNIT_ADDR_SPEC { - ULONG Flags; - UCHAR SubunitAddress[1]; -} AVC_SUBUNIT_ADDR_SPEC, *PAVC_SUBUNIT_ADDR_SPEC; - -// Flags, when used with IOCTL_AVC_UPDATE_VIRTUAL_SUBUNIT_INFO -// and IOCTL_AVC_REMOVE_VIRTUAL_SUBUNIT_INFO -#define AVC_SUBUNIT_ADDR_PERSISTENT 0x00000001 -#define AVC_SUBUNIT_ADDR_TRIGGERBUSRESET 0x00000002 - -#include - -#ifdef __cplusplus -} -#endif - -#endif // _AVC_H_ - -#ifndef AVC_GUIDS_DEFINED -#define AVC_GUIDS_DEFINED -// {616EF4D0-23CE-446d-A568-C31EB01913D0} -DEFINE_GUID(GUID_VIRTUAL_AVC_CLASS, 0x616ef4d0, 0x23ce, 0x446d, 0xa5, 0x68, 0xc3, 0x1e, 0xb0, 0x19, 0x13, 0xd0); - -// {095780C3-48A1-4570-BD95-46707F78C2DC} -DEFINE_GUID(GUID_AVC_CLASS, 0x095780c3, 0x48a1, 0x4570, 0xbd, 0x95, 0x46, 0x70, 0x7f, 0x78, 0xc2, 0xdc); -#endif - -#endif - diff --git a/qt-correction-tool/pub/ddk/avcstrm.h b/qt-correction-tool/pub/ddk/avcstrm.h deleted file mode 100644 index f50b245..0000000 --- a/qt-correction-tool/pub/ddk/avcstrm.h +++ /dev/null @@ -1,551 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - avcstrm.h - -Abstract - - MS AVC Connection and Streaming - ---*/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#ifndef __AVCSTRM_H__ -#define __AVCSTRM_H__ - - -#define MASK_AUX_50_60_BIT 0x00200000 // the NTSC/PAL bit of DV{A|V}AuxSrc - -// DVINFO -typedef struct _DVINFO { - - //for 1st track - DWORD dwDVAAuxSrc; - DWORD dwDVAAuxCtl; - - // for 2nd track - DWORD dwDVAAuxSrc1; - DWORD dwDVAAuxCtl1; - - //for video information - DWORD dwDVVAuxSrc; - DWORD dwDVVAuxCtl; - DWORD dwDVReserved[2]; - -} DVINFO, *PDVINFO; - -// Static definitions for DVINFO initialization - -// MEDIATYPE_Interleaved equivalent -#define STATIC_KSDATAFORMAT_TYPE_INTERLEAVED\ - 0x73766169L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("73766169-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_INTERLEAVED); -#define KSDATAFORMAT_TYPE_INTERLEAVED DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_INTERLEAVED) - -// MEDIASUBTYPE_dvsd equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_DVSD\ - 0x64737664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("64737664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DVSD); -#define KSDATAFORMAT_SUBTYPE_DVSD DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVSD) - -// MEDIASUBTYPE_dvsl equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_DVSL\ - 0x6C737664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("6C737664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DVSL); -#define KSDATAFORMAT_SUBTYPE_DVSL DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVSL) - -// MEDIASUBTYPE_dvhd equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_DVHD\ - 0x64687664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("64687664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_DVHD); -#define KSDATAFORMAT_SUBTYPE_DVHD DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DVHD) - -#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1) - -// MEDIASUBTYPE_dv25 equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_dv25\ - 0x35327664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("35327664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_dv25); -#define KSDATAFORMAT_SUBTYPE_dv25 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_dv25) - -// MEDIASUBTYPE_dv50 equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_dv50\ - 0x30357664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("30357664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_dv50); -#define KSDATAFORMAT_SUBTYPE_dv50 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_dv50) - -// MEDIASUBTYPE_dvh1 equivalent -#define STATIC_KSDATAFORMAT_SUBTYPE_dvh1\ - 0x31687664L, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71 -DEFINE_GUIDSTRUCT("31687664-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_dvh1); -#define KSDATAFORMAT_SUBTYPE_dvh1 DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_dvh1) - -#endif - -// FORMAT_DvInfo equivalent -#define STATIC_KSDATAFORMAT_SPECIFIER_DVINFO\ - 0x05589f84L, 0xc356, 0x11ce, 0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a -DEFINE_GUIDSTRUCT("05589f84-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_DVINFO); -#define KSDATAFORMAT_SPECIFIER_DVINFO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DVINFO) - -#define STATIC_KSDATAFORMAT_SPECIFIER_DV_AVC\ - 0xddcff71aL, 0xfc9f, 0x4bd9, 0xb9, 0xb, 0x19, 0x7b, 0xd, 0x44, 0xad, 0x94 -DEFINE_GUIDSTRUCT("ddcff71a-fc9f-4bd9-b90b-197b0d44ad94", KSDATAFORMAT_SPECIFIER_DV_AVC); -#define KSDATAFORMAT_SPECIFIER_DV_AVC DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DV_AVC) - -#define STATIC_KSDATAFORMAT_SPECIFIER_AVC\ - 0xf09dc377L, 0x6e51, 0x4ec5, 0xa0, 0xc4, 0xcd, 0x7f, 0x39, 0x62, 0x98, 0x80 -DEFINE_GUIDSTRUCT("f09dc377-6e51-4ec5-a0c4-cd7f39629880", KSDATAFORMAT_SPECIFIER_AVC); -#define KSDATAFORMAT_SPECIFIER_AVC DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_AVC) - -// Media subtype for MPEG2TS with STRIDE -#define STATIC_KSDATAFORMAT_TYPE_MPEG2_TRANSPORT_STRIDE\ - 0x138aa9a4L, 0x1ee2, 0x4c5b, 0x98, 0x8e, 0x19, 0xab, 0xfd, 0xbc, 0x8a, 0x11 -DEFINE_GUIDSTRUCT("138aa9a4-1ee2-4c5b-988e-19abfdbc8a11", KSDATAFORMAT_TYPE_MPEG2_TRANSPORT_STRIDE); -#define KSDATAFORMAT_TYPE_MPEG2_TRANSPORT_STRIDE DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MPEG2_TRANSPORT_STRIDE) - -// Specifier for MPEG2TS with STRIDE -#define STATIC_KSDATAFORMAT_SPECIFIER_61883_4\ - 0x97e218b1L, 0x1e5a, 0x498e, 0xa9, 0x54, 0xf9, 0x62, 0xcf, 0xd9, 0x8c, 0xde -DEFINE_GUIDSTRUCT("97e218b1-1e5a-498e-a954-f962cfd98cde", KSDATAFORMAT_SPECIFIER_61883_4); -#define KSDATAFORMAT_SPECIFIER_61883_4 DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_61883_4) - - -// Associated with KSDATAFORMAT_SPECIFIER_DVINFO -typedef struct tagKS_DATARANGE_DVVIDEO { - KSDATARANGE DataRange; - DVINFO DVVideoInfo; -} KS_DATARANGE_DVVIDEO, *PKS_DATARANGE_DVVIDEO; - -// Associated with KSDATAFORMAT_SPECIFIER_DV_AVC -typedef struct tagKS_DATARANGE_DV_AVC { - KSDATARANGE DataRange; - DVINFO DVVideoInfo; - AVCPRECONNECTINFO ConnectInfo; -} KS_DATARANGE_DV_AVC, *PKS_DATARANGE_DV_AVC; - -typedef struct tagKS_DATAFORMAT_DV_AVC { - KSDATAFORMAT DataFormat; - DVINFO DVVideoInfo; - AVCCONNECTINFO ConnectInfo; -} KS_DATAFORMAT_DV_AVC, *PKS_DATAFORMAT_DV_AVC; - -// Associated with KSDATAFORMAT_SPECIFIER_AVC -typedef struct tagKS_DATARANGE_MPEG2TS_AVC { - KSDATARANGE DataRange; - AVCPRECONNECTINFO ConnectInfo; -} KS_DATARANGE_MPEG2TS_AVC, *PKS_DATARANGE_MPEG2TS_AVC; - -typedef struct tagKS_DATAFORMAT_MPEG2TS_AVC { - KSDATAFORMAT DataFormat; - AVCCONNECTINFO ConnectInfo; -} KS_DATAFORMAT_MPEG2TS_AVC, *PKS_DATAFORMAT_MPEG2TS_AVC; - - - -/********************** -// 1394 -***********************/ - -#define SPEED_100_INDEX 0 -#define SPEED_200_INDEX 1 -#define SPEED_400_INDEX 2 - - -/********************** -// 61883 -***********************/ - -#define BLOCK_PERIOD_2997 133466800 // nano-sec -#define BLOCK_PERIOD_25 133333333 // nano-sec - - -/************************ -// CIP header definition: -*************************/ - - -// FMT: "Blue book" Part 1, page 25, Table 3; DVCR:000000 -#define CIP_HDR_FMT_MASK 0x3f -#define CIP_HDR_FMT_DVCR 0x80 // 10:FMT(00:0000) -#define CIP_HDR_FMT_MPEG 0xa0 // 10:FMT(10:0000) - -// FDF -#define CIP_HDR_FDF0_50_60_MASK 0x80 -#define CIP_HDR_FDF0_50_60_PAL 0x80 -#define CIP_HDR_FDF0_50_60_NTSC 0x00 - -#define CIP_HDR_FDF0_STYPE_MASK 0x7c -#define CIP_HDR_FDF0_STYPE_SD_DVCR 0x00 // STYPE: 000:00 -#define CIP_HDR_FDF0_STYPE_SDL_DVCR 0x04 // STYPE: 000:01 -#define CIP_HDR_FDF0_STYPE_HD_DVCR 0x08 // STYPE: 000:10 -#define CIP_HDR_FDF0_STYPE_SD_DVCPRO 0x78 // STYPE: 111:10 - - -#define CIP_SPH_DV 0 // No source packet header -#define CIP_SPH_MPEG 1 // Has a source packet header - -#define CIP_FN_DV 0 // Data blocks in a source pacaket of SD DVCR; BlueBook Part 2 -#define CIP_FN_MPEG 0x3 // Data blocks in a source pacaket of SD DVCR; BlueBook Part 2 - -#define CIP_QPC_DV 0 // No padding -#define CIP_QPC_MPEG 0 // No padding - -#define CIP_SPH_DV 0 // No header -#define CIP_SPH_MPEG 1 // Has a header (time stamp) - -#define CIP_DBS_SDDV 120 // quadlets in a data block of the SD DVCR; BlueBook Part 2 -#define CIP_DBS_HDDV 240 // quadlets in a data block of the HD DVCR; BlueBook Part 3 -#define CIP_DBS_SDLDV 60 // quadlets in a data block of the SDL DVCR; BlueBook Part 5 -#define CIP_DBS_MPEG 6 // quadlets in a data block of the MPEG TS; BlueBook Part 4 - -#define CIP_FMT_DV 0x0 // 00 0000 -#define CIP_FMT_MPEG 0x20 // 10 0000 - -#define CIP_60_FIELDS 0 // 60 fields (NTSC) -#define CIP_50_FIELDS 1 // 50 fields (PAL) -#define CIP_TSF_ON 1 // TimeShift is ON -#define CIP_TSF_OFF 0 // TimeShift is OFF - -#define CIP_STYPE_DV 0x0 // 00000 -#define CIP_STYPE_DVCPRO 0x1e // 11100 - - -// -// Some derive values -// - -#define SRC_PACKETS_PER_NTSC_FRAME 250 // Fixed and same for SDDV, HDDV and SDLDV -#define SRC_PACKETS_PER_PAL_FRAME 300 // Fixed and same for SDDV, HDDV and SDLDV -// Note: Frame size of MPEG2 will depends on number of source packets per frame, and -// the is application dependent.. - -#define FRAME_TIME_NTSC 333667 // "about" 29.97 -#define FRAME_TIME_PAL 400000 // exactly 25 - -#define SRC_PACKET_SIZE_SDDV ((CIP_DBS_SDDV << 2) * (1 << CIP_FN_DV)) -#define SRC_PACKET_SIZE_HDDV ((CIP_DBS_HDDV << 2) * (1 << CIP_FN_DV)) -#define SRC_PACKET_SIZE_SDLDV ((CIP_DBS_SDLDV << 2) * (1 << CIP_FN_DV)) -#define SRC_PACKET_SIZE_MPEG2TS ((CIP_DBS_MPEG << 2) * (1 << CIP_FN_MPEG)) // Contain a sourcr packet header - - -#define FRAME_SIZE_SDDV_NTSC (SRC_PACKET_SIZE_SDDV * SRC_PACKETS_PER_NTSC_FRAME) -#define FRAME_SIZE_SDDV_PAL (SRC_PACKET_SIZE_SDDV * SRC_PACKETS_PER_PAL_FRAME) - -#define FRAME_SIZE_HDDV_NTSC (SRC_PACKET_SIZE_HDDV * SRC_PACKETS_PER_NTSC_FRAME) -#define FRAME_SIZE_HDDV_PAL (SRC_PACKET_SIZE_HDDV * SRC_PACKETS_PER_PAL_FRAME) - -#define FRAME_SIZE_SDLDV_NTSC (SRC_PACKET_SIZE_SDLDV * SRC_PACKETS_PER_NTSC_FRAME) -#define FRAME_SIZE_SDLDV_PAL (SRC_PACKET_SIZE_SDLDV * SRC_PACKETS_PER_PAL_FRAME) - - - - - -// Generic 1st quadlet of a CIP header -typedef struct _CIP_HDR1 { - - ULONG DBC: 8; // Continuity counter of data blocks - - ULONG Rsv00: 2; - ULONG SPH: 1; // Sourcre packet header; 1: source packet contain a source packet header - ULONG QPC: 3; // Quadlet padding count (0..7 quadlets) - ULONG FN: 2; // Fraction number - - ULONG DBS: 8; // Data block size in quadlets - - ULONG SID: 6; // Source node ID (ID of transmitter) - ULONG Bit00: 2; // Always 0:0 - -} CIP_HDR1, *PCIP_HDR1; - -// Generic 2nd quadlet of a CIP header with SYT field -typedef struct _CIP_HDR2_SYT { - - ULONG SYT: 16; // lower 16bits of IEEE CYCLE_TIME - - ULONG RSV: 2; // - ULONG STYPE: 5; // Signal type of video signal - ULONG F5060_OR_TSF: 1; // 0:(60 field system; NTSC); 1:(50 field system; PAL); or 1/0 for TimeShiftFlag - - // e.g. 000000:DV, 100000 :MPEGTS; - // if 111111 (no data), DBS, FN, QPC, SPH and DBC arfe ignored. - ULONG FMT: 6; // Format ID - ULONG Bit10: 2; // Always 1:0 - -} CIP_HDR2_SYT, *PCIP_HDR2_SYT; - - -// Generic 2nd quadlet of a CIP header with FDF field -typedef struct _CIP_HDR2_FDF { - - ULONG FDF: 24; - - ULONG FMT: 6; // e.g. 000000:DV, 100000 :MPEGTS - ULONG Bit10: 2; // Always 1:0 - -} CIP_HDR2_FDF, *PCIP_HDR2_FDF; - -// 2nd quadlet of a CIP header of a MPEGTS data -typedef struct _CIP_HDR2_MPEGTS { - - ULONG TSF: 1; - ULONG RSV23bit: 23; - - ULONG FMT: 6; // e.g. 000000:DV, 100000 :MPEGTS - ULONG Bit10: 2; // Always 1:0 - -} CIP_HDR2_MPEGTS, *PCIP_HDR2_MPEGTS; -// -// AV/C command response data definition -// - -#define AVC_DEVICE_TAPE_REC 0x20 // 00100:000 -#define AVC_DEVICE_CAMERA 0x38 // 00111:000 -#define AVC_DEVICE_TUNER 0x28 // 00101:000 - -// -// 61883 data format -// -typedef enum _AVCSTRM_FORMAT { - - AVCSTRM_FORMAT_SDDV_NTSC = 0, // 61883-2 - AVCSTRM_FORMAT_SDDV_PAL, // 61883-2 - AVCSTRM_FORMAT_MPEG2TS, // 61883-4 - AVCSTRM_FORMAT_HDDV_NTSC, // 61883-3 - AVCSTRM_FORMAT_HDDV_PAL, // 61883-3 - AVCSTRM_FORMAT_SDLDV_NTSC, // 61883-5 - AVCSTRM_FORMAT_SDLDV_PAL, // 61883-5 - // others.. -} AVCSTRM_FORMAT; - - -// -// This structure is create and initialize by the subunit.parameters -// The streaming DLL will streaming based on these parameters. -// Not all parameters apply to every format. -// - -#define AVCSTRM_FORMAT_OPTION_STRIP_SPH 0x00000001 - -typedef struct _AVCSTRM_FORMAT_INFO { - - ULONG SizeOfThisBlock; // sizeof of this structure - - /************************** - * 61883-x format defintion - **************************/ - AVCSTRM_FORMAT AVCStrmFormat; // Format, such as DV or MPEG2TS - - // - // Two quadlet of a CIP header - // - CIP_HDR1 cipHdr1; - CIP_HDR2_SYT cipHdr2; - - /***************** - * Buffers related - *****************/ - // - // Number of source packet per frame - // - ULONG SrcPacketsPerFrame; - - // - // Frame size - // - ULONG FrameSize; - - // - // Number of receiving buffers - // - ULONG NumOfRcvBuffers; - - // - // Number of transmitting buffers - // - ULONG NumOfXmtBuffers; - - // - // Optional flags - // - DWORD OptionFlags; - - /******************** - * Frame rate related - ********************/ - // - // Approximate time per frame - // - ULONG AvgTimePerFrame; - - // - // BlockPeriod - TX Only - // - ULONG BlockPeriod; - - // - // Reserved for future use - // - ULONG Reserved[4]; - -} AVCSTRM_FORMAT_INFO, * PAVCSTRM_FORMAT_INFO; - - - - - -// -// IOCTL Definitions -// -#define IOCTL_AVCSTRM_CLASS CTL_CODE( \ - FILE_DEVICE_UNKNOWN, \ - 0x93, \ - METHOD_IN_DIRECT, \ - FILE_ANY_ACCESS \ - ) - -// -// Current AVCSTRM DDI Version -// -#define CURRENT_AVCSTRM_DDI_VERSION '15TN' // 1.' 8XD' 2.'15TN' - -// -// INIT_AVCStrm_HEADER Macro -// -#define INIT_AVCSTRM_HEADER( AVCStrm, Request ) \ - (AVCStrm)->SizeOfThisBlock = sizeof(AVC_STREAM_REQUEST_BLOCK); \ - (AVCStrm)->Function = Request; \ - (AVCStrm)->Version = CURRENT_AVCSTRM_DDI_VERSION; - -typedef enum _AVCSTRM_FUNCTION { - // Stream funcrtions - AVCSTRM_READ = 0, - AVCSTRM_WRITE, - - AVCSTRM_ABORT_STREAMING, // Cancel all; to cancel each individual IRP, use IoCancelIrp() - - AVCSTRM_OPEN = 0x100, - AVCSTRM_CLOSE, - - AVCSTRM_GET_STATE, - AVCSTRM_SET_STATE, - - // Not enabled - AVCSTRM_GET_PROPERTY, - AVCSTRM_SET_PROPERTY, -} AVCSTRM_FUNCTION; - -// -// Structure used to open a stream; a stream extension is returned when success. -// -typedef struct _AVCSTRM_OPEN_STRUCT { - - KSPIN_DATAFLOW DataFlow; - - PAVCSTRM_FORMAT_INFO AVCFormatInfo; - - // return stream exension (a context) if a stream is open successfully - // This context is used for subsequent call after a stream is opened. - PVOID AVCStreamContext; - - // Local i/oPCR to be connected to the remote o/iPCR - HANDLE hPlugLocal; - -} AVCSTRM_OPEN_STRUCT, * PAVCSTRM_OPEN_STRUCT; - - -// -// Structure used to read or write a buffer -// -typedef struct _AVCSTRM_BUFFER_STRUCT { - - // - // Clock provider - // - BOOL ClockProvider; - HANDLE ClockHandle; // This is used only if !ClockProvider - - // - // KS stream header - // - PKSSTREAM_HEADER StreamHeader; - - // - // Frame buffer - // - PVOID FrameBuffer; - - // - // Notify Context - // - PVOID Context; - -} AVCSTRM_BUFFER_STRUCT, * PAVCSTRM_BUFFER_STRUCT; - - -typedef struct _AVC_STREAM_REQUEST_BLOCK { - - ULONG SizeOfThisBlock; // sizeof AVC_STREAM_REQUEST_BLOCK - - // - // Version - // - ULONG Version; - - // - // AVC Stream function - // - AVCSTRM_FUNCTION Function; - - // - // Flags - // - ULONG Flags; - - // - // Status of this final AVCStream request. - // - NTSTATUS Status; - - // - // This pointer contain the context of a stream and this structure is opaque to client. - // - PVOID AVCStreamContext; - - // - // Contexts that the requester needs when this request is completed asychronously - // - PVOID Context1; - PVOID Context2; - PVOID Context3; - PVOID Context4; - - ULONG Reserved[4]; - - // - // the following union passes in the information needed for the various ASRB functions. - // - union _tagCommandData { - - // Get or set a stream state - KSSTATE StreamState; - - // Struct used to open a stream - AVCSTRM_OPEN_STRUCT OpenStruct; - - // Stream buffer structure - AVCSTRM_BUFFER_STRUCT BufferStruct; - - } CommandData; // union for function data - -} AVC_STREAM_REQUEST_BLOCK, *PAVC_STREAM_REQUEST_BLOCK; - -#endif // ifndef __AVCSTRM_H__ - -#endif - diff --git a/qt-correction-tool/pub/ddk/backpack.h b/qt-correction-tool/pub/ddk/backpack.h deleted file mode 100644 index c06d3bf..0000000 --- a/qt-correction-tool/pub/ddk/backpack.h +++ /dev/null @@ -1,189 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - backpack.h - -Abstract: - - This module contains the package for pseudo polling. When a caller - requests the same operation and gets the same error return the rdr - must prevent flooding the network by backing off requests. Examples - of when this is desirable are receiving 0 bytes on consequtive reads - and consequtive fails on a file lock. - - If the caller is flooding the network, the rdr will return the 0 bytes - or lock fail to the user until NextTime. When NextTime is reached - the network will be used. - -Author: - - - -Revision History: - - - ---*/ - -#ifndef _BACKPACK_ -#define _BACKPACK_ - -typedef struct _THROTTLING_STATE { - LARGE_INTEGER NextTime; // Do not access the network until - // CurrentTime >= NextTime - __volatile ULONG CurrentIncrement; // Number of Increments applied to calculate NextTime - ULONG MaximumDelay; // Specifies slowest rate that we will back off to - // NextTime <= CurrentTime + (Interval * MaximumDelay) - LARGE_INTEGER Increment;// {0,10000000} == 1 second - __volatile ULONG NumberOfQueries; -} THROTTLING_STATE, *PTHROTTLING_STATE; - -//++ -// -// VOID -// RxInitializeThrottlingState( -// IN PTHROTTLING_STATE pBP, -// IN ULONG Increment, -// IN ULONG MaximumDelay -// ); -// -// Routine Description: -// -// This routine is called to initialize the back off structure (usually in -// an Icb). -// -// Arguments: -// -// pBP - Supplies back pack data for this request. -// Increment - Supplies the increase in delay in milliseconds, each time a request -// to the network fails. -// MaximumDelay- Supplies the longest delay the backoff package can introduce -// in milliseconds. -// -// Return Value: -// -// None. -// -//-- - -#define RxInitializeThrottlingState( _pBP, _Increment, _MaximumDelay ) { \ - if ((_Increment)>0) { \ - (_pBP)->Increment.QuadPart = (_Increment) * 10000; \ - (_pBP)->MaximumDelay = (_MaximumDelay) / (_Increment); \ - (_pBP)->CurrentIncrement = 0; \ - }} - -//++ -// -// VOID -// RxUninitializeBackPack( -// IN PTHROTTLING_STATE pBP -// ) -// -// Routine Description: -// -// Resets the Back Pack specified. Currently no work needed. -// -// Arguments: -// -// pBP - Supplies back pack address. -// -// Return Value: -// -// None. -// -//-- - -#define RxUninitializeBackPack( pBP ) () - -// RxShouldRequestBeThrottled indicates when the request should not go to the network. - -BOOLEAN -RxShouldRequestBeThrottled( - IN PTHROTTLING_STATE pBP - ); - -// Register the last request as failed. - -VOID -RxInitiateOrContinueThrottling ( - IN PTHROTTLING_STATE pBP - ); - -// Register the last request as worked. - -//++ -// -// VOID -// RxTerminateThrottling( -// IN PTHROTTLING_STATE pBP -// ) -// -// Routine Description: -// -// Sets the Delay to zero. This routine is called each time that -// a network request succeeds to avoid the next request backing off. -// -// Arguments: -// -// pBP - Supplies back pack address. -// -// Return Value: -// -// None. -// -//-- - -#define RxTerminateThrottling( pBP ) ( (pBP)->CurrentIncrement = 0 ) - -//++ -// -// VOID -// RxInitializeBackoffPackage ( -// VOID -// ) -// -// Routine Description: -// -// This routine initializes the redirector back off package. -// -// Arguments: -// -// None -// -// Return Value: -// -// None. -// -//-- - -#define RxInitializeBackoffPackage( ) - -//++ -// -// VOID -// RxUninitializeBackoffPackage ( -// VOID -// ) -// -// Routine Description: -// -// This routine uninitializes the redirector back off package. -// -// Arguments: -// -// None -// -// Return Value: -// -// None. -// -//-- - -#define RxUninitializeBackoffPackage( ) - -#endif /* _BACKPACK_ */ - diff --git a/qt-correction-tool/pub/ddk/bdasup.h b/qt-correction-tool/pub/ddk/bdasup.h deleted file mode 100644 index d32d075..0000000 --- a/qt-correction-tool/pub/ddk/bdasup.h +++ /dev/null @@ -1,696 +0,0 @@ -//==========================================================================; -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR -// PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//==========================================================================; - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#if !defined(_BDATYPES_) -#error BDATYPES.H must be included before BDATOPGY.H -#endif // !defined(_BDATYPES_) - -#if !defined(_BDATOPGY_) -#define _BDATOPGY_ - -#if defined(__cplusplus) -extern "C" { -#endif // defined(__cplusplus) - - -//--------------------------------------------------------------------------- -// Common typedefs -//--------------------------------------------------------------------------- - -#define STDMETHODCALLTYPE __stdcall - -typedef GUID * PGUID; - -//=========================================================================== -// -// BDA KS Topology Structures -// -//=========================================================================== - -typedef struct _KSM_PIN_PAIR -{ - KSMETHOD Method; - ULONG InputPinId; - ULONG OutputPinId; - ULONG Reserved; -} KSM_PIN_PAIR, * PKSM_PIN_PAIR; - -typedef struct _KSM_PIN -{ - KSMETHOD Method; - union - { - ULONG PinId; - ULONG PinType; - }; - ULONG Reserved; -} KSM_PIN, * PKSM_PIN; - -typedef ULONG BDA_TOPOLOGY_JOINT, * PBDA_TOPOLOGY_JOINT; - -typedef struct _BDA_PIN_PAIRING -{ - ULONG ulInputPin; - ULONG ulOutputPin; - ULONG ulcMaxInputsPerOutput; - ULONG ulcMinInputsPerOutput; - ULONG ulcMaxOutputsPerInput; - ULONG ulcMinOutputsPerInput; - ULONG ulcTopologyJoints; - const ULONG * pTopologyJoints; - -} BDA_PIN_PAIRING, * PBDA_PIN_PAIRING; - - -// BDA Topology Template Structures -// -typedef struct _BDA_FILTER_TEMPLATE -{ - const KSFILTER_DESCRIPTOR * pFilterDescriptor; - ULONG ulcPinPairs; - const BDA_PIN_PAIRING * pPinPairs; - -} BDA_FILTER_TEMPLATE, *PBDA_FILTER_TEMPLATE; - - -//=========================================================================== -// -// BDA Utility Functions -// -//=========================================================================== - - -/* -** BdaCreateFilterFactory() -** -** Creates a Filter Factory according to pFilterDescriptor. Keeps a -** reference to pBdaFilterTemplate so that Pin Factories can be dynamically -** created on a Filter created from this Filter Factory. -** -** Arguments: -** -** -** Returns: -** -** -** -** Side Effects: none -*/ - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCreateFilterFactory( - __in PKSDEVICE pKSDevice, - __in const KSFILTER_DESCRIPTOR * pFilterDescriptor, - __in const BDA_FILTER_TEMPLATE * pBdaFilterTemplate - ); - - -/* -** BdaCreateFilterFactoryEx() -** -** Creates a Filter Factory according to pFilterDescriptor. Keeps a -** reference to pBdaFilterTemplate so that Pin Factories can be dynamically -** created on a Filter created from this Filter Factory. -** -** Arguments: -** -** -** Returns: -** -** -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCreateFilterFactoryEx( - __in PKSDEVICE pKSDevice, - __in const KSFILTER_DESCRIPTOR * pFilterDescriptor, - __in const BDA_FILTER_TEMPLATE * pBdaFilterTemplate, - __out_opt PKSFILTERFACTORY * ppKSFilterFactory - ); - - -/* -** BdaInitFilter() -** -** Initializes a BDA filter context for this KS Filter instance. Creates -** a linkage to the BDA Filter Template associated with the factory from -** which this KS Filter instance was created. -** -** Arguments: -** -** -** Returns: -** -** -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaInitFilter( - __in PKSFILTER pKSFilter, - __in const BDA_FILTER_TEMPLATE * pBdaFilterTemplate - ); - - -/* -** BdaUninitFilter() -** -** Unitializes and frees resources from the BDA filter context associated -** with this KS filter instance. -** -** Arguments: -** -** -** Returns: -** -** -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaUninitFilter( - __in PKSFILTER pKSFilter - ); - - -/* -** BdaFilterFactoryUpdateCacheData() -** -** Updates the pin data cache for the given filter factory. -** The function will update the cached information for all pin factories -** exposed by the given filter factory. -** -** If the option filter descriptor is given, the function will update -** the pin data cache for all pins listed in the given filter descriptor -** instead of those in the filter factory. -** -** Drivers will call this to update the pin data cache for all -** pins that may be exposed by the filter factory. The driver will -** provide a filter descriptor listing pins that are not initially exposed -** by the filter factory (this is usually the same as the template filter -** descriptor). -** -** Arguments: -** -** -** Returns: -** -** -** -** Side Effects: none -*/ - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaFilterFactoryUpdateCacheData( - __in PKSFILTERFACTORY pFilterFactory, - __in const KSFILTER_DESCRIPTOR * pFilterDescriptor OPTIONAL - ); - - -/* -** BdaCreatePin() -** -** Utility function creates a new pin in the given filter instance. -** -** -** Arguments: -** -** -** Returns: -** -** -** Side Effects: none -*/ - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCreatePin( - __in PKSFILTER pKSFilter, - __in ULONG ulPinType, - __out_opt PULONG pulPinId - ); - - -/* -** BdaDeletePin() -** -** Utility function deletes a pin from the given filter instance. -** -** -** Arguments: -** -** -** Returns: -** -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaDeletePin( - __in PKSFILTER pKSFilter, - __out_opt PULONG pulPinId - ); - - -/* -** BdaCreateTopology() -** -** Utility function creates the topology between two pins. -** -** -** Arguments: -** -** -** Returns: -** -** NULL If no valid pin pairing exists with the -** given input and output pins. -** -** Side Effects: none -*/ - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCreateTopology( - __in PKSFILTER pKSFilter, - __in ULONG InputPinId, - __in ULONG OutputPinId - ); - - - -//=========================================================================== -// -// BDA Property and Method Functions -// -//=========================================================================== - - -/* -** BdaPropertyNodeTypes () -** -** Returns a list of ULONGs. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyNodeTypes( - __in PIRP pIrp, - __in PKSPROPERTY pKSProperty, - __out_bcount(OutputBufferLenFromIrp(Irp)) ULONG * pulProperty - ); - - -/* -** BdaPropertyPinTypes () -** -** Returns a list of GUIDS. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyPinTypes( - __in PIRP pIrp, - __in PKSPROPERTY pKSProperty, - __out_bcount(OutputBufferLenFromIrp(Irp)) ULONG * pulProperty - ); - - -/* -** BdaPropertyTemplateConnections () -** -** Returns a list of KSTOPOLOGY_CONNECTIONS. The list of connections -** describs how pin types and node types are connected in the template -** topology -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyTemplateConnections( - __in PIRP pIrp, - __in PKSPROPERTY pKSProperty, - __out_opt PKSTOPOLOGY_CONNECTION pConnectionProperty - ); - - -/* -** BdaPropertyNodeProperties () -** -** Returns a list of GUIDs. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyNodeProperties( - __in PIRP pIrp, - __in PKSP_NODE pKSProperty, - __out_opt GUID * pguidProperty - ); - - -/* -** BdaPropertyNodeMethods () -** -** Returns a list of GUIDs. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyNodeMethods( - __in PIRP pIrp, - __in PKSP_NODE pKSProperty, - __out_opt GUID * pguidProperty - ); - - -/* -** BdaPropertyNodeEvents () -** -** Returns a list of GUIDs. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyNodeEvents( - __in PIRP pIrp, - __in PKSP_NODE pKSProperty, - __out_opt GUID * pguidProperty - ); - - -/* -** BdaPropertyNodeDescriptors () -** -** Returns a list of BDA Node Descriptors. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyNodeDescriptors( - __in PIRP pIrp, - __in PKSPROPERTY pKSProperty, - __out_opt BDANODE_DESCRIPTOR * pNodeDescriptorProperty - ); - - -/* -** BdaPropertyGetControllingPinId () -** -** Gets the ID of the pin on which to submit node properties, methods -** and events. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyGetControllingPinId( - __in PIRP Irp, - __in PKSP_BDA_NODE_PIN Property, - __out_opt PULONG pulControllingPinId - ); - - -/* -** BdaStartChanges () -** -** Starts a new set of BDA topology changes. All changes to BDA topology -** that have not been committed are ignored. Changes after this will be -** in effect only after BdaCommitChanges. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaStartChanges( - __in PIRP pIrp - ); - - -/* -** BdaCheckChanges () -** -** Checks the changes to BDA topology that have occured since the -** last BdaStartChanges. Returns the result that would have occurred if -** CommitChanges had been called. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCheckChanges( - __in PIRP pIrp - ); - - -/* -** BdaCommitChanges () -** -** Commits the changes to BDA topology that have occured since the -** last BdaStartChanges. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaCommitChanges( - __in PIRP pIrp - ); - - -/* -** BdaGetChangeState () -** -** Returns the current change state of the BDA topology. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaGetChangeState( - __in PIRP pIrp, - __out_opt PBDA_CHANGE_STATE pChangeState - ); - - -/* -** BdaMethodCreatePin () -** -** Creates a new pin factory for the given pin type. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaMethodCreatePin( - __in PIRP pIrp, - __in PKSMETHOD pKSMethod, - __out_opt PULONG pulPinFactoryID - ); - - -/* -** BdaMethodDeletePin () -** -** Deletes the given pin factory -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaMethodDeletePin( - __in PIRP pIrp, - __in PKSMETHOD pKSMethod, - PVOID pvIgnored - ); - - -/* -** BdaMethodCreateTopology () -** -** Creates the topology between the two given pin factories. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaMethodCreateTopology( - __in PIRP pIrp, - __in PKSMETHOD pKSMethod, - OPTIONAL PVOID pvIgnored - ); - - -/* -** BdaPropertyGetPinControl () -** -** Returns a the BDA ID or BDA Template Type of the Pin. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaPropertyGetPinControl( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out_opt ULONG * pulProperty - ); - - -/* -** BdaValidateNodeProperty () -** -** Validates that the node property belongs to the current pin. -** -** Arguments: -** -** -** Returns: -** -** Side Effects: none -*/ -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -STDMETHODIMP_(NTSTATUS) -BdaValidateNodeProperty( - __in PIRP pIrp, - __in PKSPROPERTY pProperty - ); - - -#if defined(__cplusplus) -} -#endif // defined(__cplusplus) - -#endif // !defined(_BDATOPGY_) - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - - diff --git a/qt-correction-tool/pub/ddk/bridgedeviceservice.h b/qt-correction-tool/pub/ddk/bridgedeviceservice.h deleted file mode 100644 index 30c41ee..0000000 --- a/qt-correction-tool/pub/ddk/bridgedeviceservice.h +++ /dev/null @@ -1,1999 +0,0 @@ -/* - * BridgeDeviceService.h - * - * Contains declaration of Services PKEYs to support classic MTP-style - * formats and generic/media object properties. - * - * Copyright (c) Microsoft Corporation, All Rights Reserved - */ - -#ifndef _BRIDGEDEVICESERVICE_H_ -#define _BRIDGEDEVICESERVICE_H_ - -/*****************************************************************************/ -/* MTP Format Codes for Generic and Media Types */ -/*****************************************************************************/ - - -/* FORMAT_Undefined - * - * MTP Format: Undefined (0x3000) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_Undefined, - 0x30000000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_Undefined L"Undefined" - - -/* FORMAT_Association - * - * MTP Format: Association (0x3001) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_Association, - 0x30010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_Association L"Association" - - -/* FORMAT_DeviceScript - * - * MTP Format: Device model-specific script (0x3002) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_DeviceScript, - 0x30020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_DeviceScript L"DeviceScript" - - -/* FORMAT_DeviceExecutable - * - * MTP Format: Device model-specific executable (0x3003) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_DeviceExecutable, - 0x30030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_DeviceExecutable L"DeviceExecutable" - - -/* FORMAT_TextDocument - * - * MTP Format: Text file (0x3004) - * Suggested MIME Type: text/plain - */ - -DEFINE_DEVSVCGUID(FORMAT_TextDocument, - 0x30040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_TextDocument L"TextDocument" - - -/* FORMAT_HTMLDocument - * - * MTP Format: HTML file (0x3005) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_HTMLDocument, - 0x30050000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_HTMLDocument L"HTMLDocument" - - -/* FORMAT_DPOFDocument - * - * MTP Format: Digital Print Order Format file (0x3006) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_DPOFDocument, - 0x30060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_DPOFDocument L"DPOFDocument" - - -/* FORMAT_AIFFFile - * - * MTP Format: AIFF file (0x3007) - * Suggested MIME Type: audio/aiff - */ - -DEFINE_DEVSVCGUID(FORMAT_AIFFFile, - 0x30070000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AIFFFile L"AIFFFile" - - -/* FORMAT_WAVFile - * - * MTP Format: WAV file (0x3008) - * Suggested MIME Type: audio/wav - */ - -DEFINE_DEVSVCGUID(FORMAT_WAVFile, - 0x30080000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_WAVFile L"WAVFile" - - -/* FORMAT_MP3File - * - * MTP Format: MP3 file (0x3009) - * Suggested MIME Type: audio/mpeg - */ - -DEFINE_DEVSVCGUID(FORMAT_MP3File, - 0x30090000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MP3File L"MP3File" - - -/* FORMAT_AVIFile - * - * MTP Format: AVI file (0x300A) - * Suggested MIME Type: video/avi - */ - -DEFINE_DEVSVCGUID(FORMAT_AVIFile, - 0x300A0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AVIFile L"AVIFile" - - -/* FORMAT_MPEGFile - * - * MTP Format: MPEG file (0x300B) - * Suggested MIME Type: video/mpeg - */ - -DEFINE_DEVSVCGUID(FORMAT_MPEGFile, - 0x300B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MPEGFile L"MPEGFile" - - -/* FORMAT_ASFFile - * - * MTP Format: ASF File (0x300C) - * Suggested MIME Type: audio/asf - */ - -DEFINE_DEVSVCGUID(FORMAT_ASFFile, - 0x300C0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_ASFFile L"ASFFile" - - -/* FORMAT_UnknownImage - * - * MTP Format: Unknown Image (0x3800) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_UnknownImage, - 0x38000000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_UnknownImage L"UnknownImage" - - -/* FORMAT_EXIFImage - * - * MTP Format: EXIF/JPEG file (0x3801) - * Suggested MIME Type: image/jpeg - */ - -DEFINE_DEVSVCGUID(FORMAT_EXIFImage, - 0x38010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_EXIFImage L"EXIFImage" - - -/* FORMAT_TIFFEPImage - * - * MTP Format: TIFF/EP (Electronic Photography) file (0x3802) - * Suggested MIME Type: image/tif - */ - -DEFINE_DEVSVCGUID(FORMAT_TIFFEPImage, - 0x38020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_TIFFEPImage L"TIFFEPImage" - - -/* FORMAT_FlashPixImage - * - * MTP Format: Structured Storage Image Format (0x3803) - * Suggested MIME Type: image/fpx - */ - -DEFINE_DEVSVCGUID(FORMAT_FlashPixImage, - 0x38030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_FlashPixImage L"FlashPixImage" - - -/* FORMAT_BMPImage - * - * MTP Format: Microsoft Windows Bitmap file (0x3804) - * Suggested MIME Type: image/bmp - */ - -DEFINE_DEVSVCGUID(FORMAT_BMPImage, - 0x38040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_BMPImage L"BMPImage" - - -/* FORMAT_CIFFImage - * - * MTP Format: Canon Camera Image File format (0x3805) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_CIFFImage, - 0x38050000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_CIFFImage L"CIFFImage" - - -/* FORMAT_GIFImage - * - * MTP Format: Graphics Interchange Format (0x3807) - * Suggested MIME Type: image/gif - */ - -DEFINE_DEVSVCGUID(FORMAT_GIFImage, - 0x38070000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_GIFImage L"GIFImage" - - -/* FORMAT_JFIFImage - * - * MTP Format: JPEF File Interchange Format (0x3808) - * Suggested MIME Type: image/jfif - */ - -DEFINE_DEVSVCGUID(FORMAT_JFIFImage, - 0x38080000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_JFIFImage L"JFIFImage" - - -/* FORMAT_PCDImage - * - * MTP Format: PhotoCD Image Pac (0x3809) - * Suggested MIME Type: image/pcd - */ - -DEFINE_DEVSVCGUID(FORMAT_PCDImage, - 0x38090000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_PCDImage L"PCDImage" - - -/* FORMAT_PICTImage - * - * MTP Format: Quickdraw Image Format (0x380A) - * Suggested MIME Type: image/pict - */ - -DEFINE_DEVSVCGUID(FORMAT_PICTImage, - 0x380A0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_PICTImage L"PICTImage" - - -/* FORMAT_PNGImage - * - * MTP Format: Portable Network Graphics (0x380B) - * Suggested MIME Type: image/png - */ - -DEFINE_DEVSVCGUID(FORMAT_PNGImage, - 0x380B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_PNGImage L"PNGImage" - - -/* FORMAT_TIFFImage - * - * MTP Format: TIFF File (0x380D) - * Suggested MIME Type: image/tif - */ - -DEFINE_DEVSVCGUID(FORMAT_TIFFImage, - 0x380D0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_TIFFImage L"TIFFImage" - - -/* FORMAT_TIFFITImage - * - * MTP Format: TIFF/IT (Graphics Arts) file (0x380E) - * Suggested MIME Type: image/tif - */ - -DEFINE_DEVSVCGUID(FORMAT_TIFFITImage, - 0x380E0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_TIFFITImage L"TIFFITImage" - - -/* FORMAT_JP2Image - * - * MTP Format: JPEG2000 Baseline File Format (0x380F) - * Suggested MIME Type: image/jp2 - */ - -DEFINE_DEVSVCGUID(FORMAT_JP2Image, - 0x380F0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_JP2Image L"JP2Image" - - -/* FORMAT_JPXImage - * - * MTP Format: JPEG2000 Extended File Format (0x3810) - * Suggested MIME Type: image/jp2 - */ - -DEFINE_DEVSVCGUID(FORMAT_JPXImage, - 0x38100000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_JPXImage L"JPXImage" - - -/* FORMAT_FirmwareFile - * - * MTP Format: Firmware (0xB802) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_FirmwareFile, - 0xB8020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_FirmwareFile L"FirmwareFile" - - -/* FORMAT_HDPhotoImage - * - * MTP Format: HD Photo (Windows Media Photo) file (0xB881) - * Suggested MIME Type: image/vnd.ms-photo - */ - -DEFINE_DEVSVCGUID(FORMAT_HDPhotoImage, - 0xB8810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_HDPhotoImage L"HDPhotoImage" - - -/* FORMAT_UndefinedAudio - * - * MTP Format: Undefined Audio (0xB900) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_UndefinedAudio, - 0xB9000000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_UndefinedAudio L"UndefinedAudio" - - -/* FORMAT_WMAFile - * - * MTP Format: WMA file (0xB901) - * Suggested MIME Type: audio/x-ms-wma - */ - -DEFINE_DEVSVCGUID(FORMAT_WMAFile, - 0xB9010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_WMAFile L"WMAFile" - - -/* FORMAT_OGGFile - * - * MTP Format: OGG file (0xB902) - * Suggested MIME Type: audio/x-ogg - */ - -DEFINE_DEVSVCGUID(FORMAT_OGGFile, - 0xB9020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_OGGFile L"OGGFile" - - -/* FORMAT_AACFile - * - * MTP Format: AAC file (0xB903) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AACFile, - 0xB9030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AACFile L"AACFile" - - -/* FORMAT_AudibleFile - * - * MTP Format: Audible file (0xB904) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AudibleFile, - 0xB9040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AudibleFile L"AudibleFile" - - -/* FORMAT_FLACFile - * - * MTP Format: FLAC file (0xB906) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_FLACFile, - 0xB9060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_FLACFile L"FLACFile" - - -/* FORMAT_UndefinedVideo - * - * MTP Format: Undefined Video (0xB980) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_UndefinedVideo, - 0xB9890000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_UndefinedVideo L"UndefinedVideo" - - -/* FORMAT_WMVFile - * - * MTP Format: WMV file (0xB981) - * Suggested MIME Type: video/x-ms-wmv - */ - -DEFINE_DEVSVCGUID(FORMAT_WMVFile, - 0xB9810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_WMVFile L"WMVFile" - - -/* FORMAT_MPEG4File - * - * MTP Format: MPEG-4 Video file (0xB982) - * Suggested MIME Type: video/mp4v-es - */ - -DEFINE_DEVSVCGUID(FORMAT_MPEG4File, - 0xB9820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MPEG4File L"MPEG4File" - - -/* FORMAT_MPEG2File - * - * MTP Format: MPEG-2 Video file (0xB983) - * Suggested MIME Type: video/mpeg - */ - -DEFINE_DEVSVCGUID(FORMAT_MPEG2File, - 0xB9830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MPEG2File L"MPEG2File" - - -/* FORMAT_3GPPFile - * - * MTP Format: 3GPP Video file (0xB984) - * Suggested MIME Type: video/3gpp - */ - -DEFINE_DEVSVCGUID(FORMAT_3GPPFile, - 0xB9840000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_3GPPFile L"3GPPFile" - - -/* FORMAT_UndefinedCollection - * - * MTP Format: Undefined Collection (0xBA00) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_UndefinedCollection, - 0xBA060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_UndefinedCollection L"UndefinedCollection" - - -/* FORMAT_AbstractMultimediaAlbum - * - * MTP Format: Abstract Multimedia Album (0xBA01) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractMultimediaAlbum, - 0xBA010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractMultimediaAlbum L"AbstractMultimediaAlbum" - - -/* FORMAT_AbstractImageAlbum - * - * MTP Format: Abstract Image Album (0xBA02) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractImageAlbum, - 0xBA020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractImageAlbum L"AbstractImageAlbum" - - -/* FORMAT_AbstractAudioAlbum - * - * MTP Format: Abstract Audio Album (0xBA03) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractAudioAlbum, - 0xBA030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractAudioAlbum L"AbstractAudioAlbum" - - -/* FORMAT_AbstractVideoAlbum - * - * MTP Format: Abstract Video Album (0xBA04) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractVideoAlbum, - 0xBA040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractVideoAlbum L"AbstractVideoAlbum" - - -/* FORMAT_AbstractAudioVideoAlbum - * - * MTP Format: Abstract Audio & Video Playlist (0xBA05) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractAudioVideoAlbum, - 0xBA050000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractAudioVideoAlbum L"AbstractAudioVideoAlbum" - - -/* FORMAT_AbstractChapteredProduction - * - * MTP Format: Abstract Chaptered Production (0xBA08) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractChapteredProduction, - 0xBA080000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractChapteredProduction L"AbstractChapteredProduction" - - -/* FORMAT_AbstractAudioPlaylist - * - * MTP Format: Abstract Audio Playlist (0xBA09) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractAudioPlaylist, - 0xBA090000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractAudioPlaylist L"AbstractAudioPlaylist" - - -/* FORMAT_AbstractVideoPlaylist - * - * MTP Format: Abstract Video Playlist (0xBA0A) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractVideoPlaylist, - 0xBA0A0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractVideoPlaylist L"AbstractVideoPlaylist" - - -/* FORMAT_AbstractMediacast - * - * MTP Format: Abstract Mediacast (0xBA0B) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractMediacast, - 0xBA0B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractMediacast L"AbstractMediacast" - - -/* FORMAT_WPLPlaylist - * - * MTP Format: WPL Playlist (0xBA10) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_WPLPlaylist, - 0xBA100000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_WPLPlaylist L"WPLPlaylist" - - -/* FORMAT_M3UPlaylist - * - * MTP Format: M3U Playlist (0xBA11) - * Suggested MIME Type: audio/mpeg-url - */ - -DEFINE_DEVSVCGUID(FORMAT_M3UPlaylist, - 0xBA110000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_M3UPlaylist L"M3UPlaylist" - - -/* FORMAT_MPLPlaylist - * - * MTP Format: MPL Playlist (0xBA12) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_MPLPlaylist, - 0xBA120000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MPLPlaylist L"MPLPlaylist" - - -/* FORMAT_ASXPlaylist - * - * MTP Format: ASX Playlist (0xBA13) - * Suggested MIME Type: video/x-ms-asf - */ - -DEFINE_DEVSVCGUID(FORMAT_ASXPlaylist, - 0xBA130000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_ASXPlaylist L"ASXPlaylist" - - -/* FORMAT_PSLPlaylist - * - * MTP Format: PLS Playlist (0xBA14) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_PSLPlaylist, - 0xBA140000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_PSLPlaylist L"PSLPlaylist" - - -/* FORMAT_UndefinedDocument - * - * MTP Format: Undefined Document (0xBA80) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_UndefinedDocument, - 0xBA800000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_UndefinedDocument L"UndefinedDocument" - - -/* FORMAT_AbstractDocument - * - * MTP Format: Abstract Document (0xBA81) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractDocument, - 0xBA810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractDocument L"AbstractDocument" - - -/* FORMAT_XMLDocument - * - * MTP Format: XML Document (0xBA82) - * Suggested MIME Type: text/xml - */ - -DEFINE_DEVSVCGUID(FORMAT_XMLDocument, - 0xBA820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_XMLDocument L"XMLDocument" - - -/* FORMAT_WordDocument - * - * MTP Format: Microsoft Word Document (0xBA83) - * Suggested MIME Type: application/msword - */ - -DEFINE_DEVSVCGUID(FORMAT_WordDocument, - 0xBA830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_WordDocument L"WordDocument" - - -/* FORMAT_MHTDocument - * - * MTP Format: MHT Compiled HTML Document (0xBA84) - * Suggested MIME Type: message/rfc822 - */ - -DEFINE_DEVSVCGUID(FORMAT_MHTDocument, - 0xBA840000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_MHTDocument L"MHTDocument" - - -/* FORMAT_ExcelDocument - * - * MTP Format: Microsoft Excel Document (0xBA85) - * Suggested MIME Type: application/msexcel - */ - -DEFINE_DEVSVCGUID(FORMAT_ExcelDocument, - 0xBA850000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_ExcelDocument L"ExcelDocument" - - -/* FORMAT_PowerPointDocument - * - * MTP Format: Microsoft PowerPoint Document (0xBA86) - * Suggested MIME Type: application/mspowerpoint - */ - -DEFINE_DEVSVCGUID(FORMAT_PowerPointDocument, - 0xBA860000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_PowerPointDocument L"PowerPointDocument" - - -/*****************************************************************************/ -/* MTP Object Property Codes for Generic and Media Types */ -/*****************************************************************************/ - -/* GenericObj.ObjectID - * - * MTP Property: () - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ObjectID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 2); - -#define NAME_GenericObj_ObjectID L"ObjectID" - - -/* GenericObj.StorageID - * - * MTP Property: Storage ID (0xDC01) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_StorageID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 23); - -#define NAME_GenericObj_StorageID L"StorageID" - - -/* GenericObj.ObjectFormat - * - * MTP Property: Object Format (0xDC02) - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ObjectFormat, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 6); - -#define NAME_GenericObj_ObjectFormat L"ObjectFormat" - - -/* GenericObj.ProtectionStatus - * - * MTP Property: Protection Status (0xDC03) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ProtectionStatus, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 26); - -#define NAME_GenericObj_ProtectionStatus L"ProtectionStatus" - - -/* GenericObj.ObjectSize - * - * MTP Property: Object Size (0xDC04) - * Type: UInt64 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ObjectSize, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 11); - -#define NAME_GenericObj_ObjectSize L"ObjectSize" - - -/* GenericObj.AssociationType - * - * MTP Property: Association Type (0xDC05) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_AssociationType, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 32); - -#define NAME_GenericObj_AssociationType L"AssociationType" - - -/* GenericObj.AssociationDesc - * - * MTP Property: Association Desc (0xDC06) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_AssociationDesc, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 33); - -#define NAME_GenericObj_AssociationDesc L"AssociationDesc" - - -/* GenericObj.ObjectFileName - * - * MTP Property: Object File Name (0xDC07) - * Type: String - * Form: None/RegEx - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ObjectFileName, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 12); - -#define NAME_GenericObj_ObjectFileName L"ObjectFileName" - - -/* GenericObj.DateCreated - * - * MTP Property: Date Created (0xDC08) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateCreated, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 39); - -#define NAME_GenericObj_DateCreated L"DateCreated" - - -/* GenericObj.DateModified - * - * MTP Property: Date Modified (0xDC09) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateModified, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 40); - -#define NAME_GenericObj_DateModified L"DateModified" - - -/* GenericObj.Keywords - * - * MTP Property: Keywords (0xDC0A) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Keywords, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 15); - -#define NAME_GenericObj_Keywords L"Keywords" - - -/* GenericObj.ParentID - * - * MTP Property: Parent Object (0xDC0B) - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ParentID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 3); - -#define NAME_GenericObj_ParentID L"ParentID" - - -/* GenericObj.AllowedFolderContents - * - * MTP Property: Allowed Folder Contents (0xDC0C) - * Type: AUInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_AllowedFolderContents, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 34); - -#define NAME_GenericObj_AllowedFolderContents L"AllowedFolderContents" - - -/* GenericObj.Hidden - * - * MTP Property: Hidden (0xDC0D) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Hidden, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 28); - -#define NAME_GenericObj_Hidden L"Hidden" - - -/* GenericObj.SystemObject - * - * MTP Property: System Object (0xDC0E) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_SystemObject, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 29); - -#define NAME_GenericObj_SystemObject L"SystemObject" - - -/* GenericObj.PersistentUID - * - * MTP Property: Persistent Unique Object ID (0xDC41) - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_PersistentUID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 5); - -#define NAME_GenericObj_PersistentUID L"PersistentUID" - - -/* GenericObj.SyncID - * - * MTP Property: Sync ID (0xDC42) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_SyncID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 16); - -#define NAME_GenericObj_SyncID L"SyncID" - - -/* GenericObj.PropertyBag - * - * MTP Property: Property Bag (0xDC43) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_PropertyBag, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 35); - -#define NAME_GenericObj_PropertyBag L"PropertyBag" - - -/* GenericObj.Name - * - * MTP Property: Name (0xDC44) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Name, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 4); - -#define NAME_GenericObj_Name L"Name" - - -/* MediaObj.Artist - * - * MTP Property: Artist (0xDC46) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Artist, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 24); - -#define NAME_MediaObj_Artist L"Artist" - - -/* GenericObj.DateAuthored - * - * MTP Property: Date Authored (0xDC47) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateAuthored, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 41); - -#define NAME_GenericObj_DateAuthored L"DateAuthored" - - -/* GenericObj.Description - * - * MTP Property: Description (0xDC48) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Description, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 45); - -#define NAME_GenericObj_Description L"Description" - - -/* GenericObj.LanguageLocale - * - * MTP Property: Language Locale (0xDC4A) - * Type: String - * Form: RegEx - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_LanguageLocale, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 27); - -#define NAME_GenericObj_LanguageLocale L"LanguageLocale" - - -/* GenericObj.Copyright - * - * MTP Property: Copyright Information (0xDC4B) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Copyright, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 38); - -#define NAME_GenericObj_Copyright L"Copyright" - - -/* VideoObj.Source - * - * MTP Property: Source (0xDC4C) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_Source, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 4); - -#define NAME_VideoObj_Source L"Source" - - -/* MediaObj.GeographicOrigin - * - * MTP Property: Origin Location (0xDC4D) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_GeographicOrigin, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 40); - -#define NAME_MediaObj_GeographicOrigin L"GeographicOrigin" - - -/* GenericObj.DateAdded - * - * MTP Property: Date Added (0xDC4E) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateAdded, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 36); - -#define NAME_GenericObj_DateAdded L"DateAdded" - - -/* GenericObj.NonConsumable - * - * MTP Property: Non-Consumable (0xDC4F) - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_NonConsumable, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 30); - -#define NAME_GenericObj_NonConsumable L"NonConsumable" - - -/* GenericObj.Corrupt - * - * MTP Property: Corrupt (0xDC50) - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_Corrupt, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 37); - -#define NAME_GenericObj_Corrupt L"Corrupt" - - -/* MediaObj.Width - * - * MTP Property: Width (0xDC87) - * Type: UInt32 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Width, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 22); - -#define NAME_MediaObj_Width L"Width" - - -/* MediaObj.Height - * - * MTP Property: Height (0xDC88) - * Type: UInt32 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Height, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 23); - -#define NAME_MediaObj_Height L"Height" - - -/* MediaObj.Duration - * - * MTP Property: Duration (0xDC89) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Duration, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 19); - -#define NAME_MediaObj_Duration L"Duration" - - -/* MediaObj.UserRating - * - * MTP Property: Rating (0xDC8A) - * Type: UInt16 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_UserRating, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 17); - -#define NAME_MediaObj_UserRating L"UserRating" - - -/* MediaObj.Track - * - * MTP Property: Track (0xDC8B) - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Track, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 43); - -#define NAME_MediaObj_Track L"Track" - - -/* MediaObj.Genre - * - * MTP Property: Genre (0xDC8C) - * Type: String - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Genre, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 32); - -#define NAME_MediaObj_Genre L"Genre" - - -/* MediaObj.Credits - * - * MTP Property: Credits (0xDC8D) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Credits, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 47); - -#define NAME_MediaObj_Credits L"Credits" - - -/* AudioObj.Lyrics - * - * MTP Property: Lyrics (0xDC8E) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_Lyrics, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 6); - -#define NAME_AudioObj_Lyrics L"Lyrics" - - -/* MediaObj.SubscriptionContentID - * - * MTP Property: Subscription Content ID (0xDC8F) - * Type: String - * Form: RegEx - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_SubscriptionContentID, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 5); - -#define NAME_MediaObj_SubscriptionContentID L"SubscriptionContentID" - - -/* MediaObj.Producer - * - * MTP Property: Produced By (0xDC90) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Producer, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 45); - -#define NAME_MediaObj_Producer L"Producer" - - -/* MediaObj.UseCount - * - * MTP Property: Use Count (0xDC91) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_UseCount, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 6); - -#define NAME_MediaObj_UseCount L"UseCount" - - -/* MediaObj.SkipCount - * - * MTP Property: Skip Count (0xDC92) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_SkipCount, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 7); - -#define NAME_MediaObj_SkipCount L"SkipCount" - - -/* GenericObj.DateAccessed - * - * MTP Property: Last Accessed (0xDC93) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateAccessed, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 42); - -#define NAME_GenericObj_DateAccessed L"DateAccessed" - - -/* MediaObj.ParentalRating - * - * MTP Property: Parental Rating (0xDC94) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_ParentalRating, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 9); - -#define NAME_MediaObj_ParentalRating L"ParentalRating" - - -/* MediaObj.MediaType - * - * MTP Property: Meta Genre (0xDC95) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_MediaType, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 10); - -#define NAME_MediaObj_MediaType L"MediaType" - - -/* MediaObj.Composer - * - * MTP Property: Composer (0xDC96) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Composer, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 11); - -#define NAME_MediaObj_Composer L"Composer" - - -/* MediaObj.EffectiveRating - * - * MTP Property: Effective Rating (0xDC97) - * Type: UInt16 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_EffectiveRating, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 12); - -#define NAME_MediaObj_EffectiveRating L"EffectiveRating" - - -/* MediaObj.Subtitle - * - * MTP Property: Subtitle (0xDC98) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Subtitle, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 13); - -#define NAME_MediaObj_Subtitle L"Subtitle" - - -/* MediaObj.DateOriginalRelease - * - * MTP Property: Original Release Date (0xDC99) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_DateOriginalRelease, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 41); - -#define NAME_MediaObj_DateOriginalRelease L"DateOriginalRelease" - - -/* MediaObj.AlbumName - * - * MTP Property: Album Name (0xDC9A) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_AlbumName, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 42); - -#define NAME_MediaObj_AlbumName L"AlbumName" - - -/* MediaObj.AlbumArtist - * - * MTP Property: Album Artist (0xDC9B) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_AlbumArtist, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 25); - -#define NAME_MediaObj_AlbumArtist L"AlbumArtist" - - -/* MediaObj.Mood - * - * MTP Property: Mood (0xDC9C) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Mood, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 44); - -#define NAME_MediaObj_Mood L"Mood" - - -/* GenericObj.DRMStatus - * - * MTP Property: DRM Status (0xDC9D) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DRMStatus, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 31); - -#define NAME_GenericObj_DRMStatus L"DRMStatus" - - -/* GenericObj.SubDescription - * - * MTP Property: Sub Description (0xDC9E) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_SubDescription, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 46); - -#define NAME_GenericObj_SubDescription L"SubDescription" - - -/* ImageObj.IsCropped - * - * MTP Property: Is Cropped (0xDCD1) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_IsCropped, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 4); - -#define NAME_ImageObj_IsCropped L"IsCropped" - - -/* ImageObj.IsColorCorrected - * - * MTP Property: Is Colour Corrected (0xDCD2) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_IsColorCorrected, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 5); - -#define NAME_ImageObj_IsColorCorrected L"IsColorCorrected" - - -/* ImageObj.ImageBitDepth - * - * MTP Property: Image Bit Depth (0xDCD3) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_ImageBitDepth, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 3); - -#define NAME_ImageObj_ImageBitDepth L"ImageBitDepth" - - -/* ImageObj.Aperature - * - * MTP Property: Fnumber (0xDCD4) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_Aperature, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 6); - -#define NAME_ImageObj_Aperature L"Aperature" - - -/* ImageObj.Exposure - * - * MTP Property: Exposure Time (0xDCD5) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_Exposure, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 7); - -#define NAME_ImageObj_Exposure L"Exposure" - - -/* ImageObj.ISOSpeed - * - * MTP Property: Exposure Index (0xDCD6) - * Type: UInt16 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ImageObj_ISOSpeed, - 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB, - 8); - -#define NAME_ImageObj_ISOSpeed L"ISOSpeed" - - -/* MediaObj.Owner - * - * MTP Property: Owner (0xDD5D) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Owner, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 26); - -#define NAME_MediaObj_Owner L"Owner" - - -/* MediaObj.Editor - * - * MTP Property: Editor (0xDD5E) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_Editor, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 27); - -#define NAME_MediaObj_Editor L"Editor" - - -/* MediaObj.WebMaster - * - * MTP Property: WebMaster (0xDD5F) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_WebMaster, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 28); - -#define NAME_MediaObj_WebMaster L"WebMaster" - - -/* MediaObj.URLSource - * - * MTP Property: URL Source (0xDD60) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_URLSource, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 29); - -#define NAME_MediaObj_URLSource L"URLSource" - - -/* MediaObj.URLLink - * - * MTP Property: URL Destination (0xDD61) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_URLLink, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 30); - -#define NAME_MediaObj_URLLink L"URLLink" - - -/* MediaObj.BookmarkTime - * - * MTP Property: Time Bookmark (0xDD62) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_BookmarkTime, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 33); - -#define NAME_MediaObj_BookmarkTime L"BookmarkTime" - - -/* MediaObj.BookmarkObject - * - * MTP Property: Object Bookmark (0xDD63) - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_BookmarkObject, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 34); - -#define NAME_MediaObj_BookmarkObject L"BookmarkObject" - - -/* MediaObj.BookmarkByte - * - * MTP Property: Byte Bookmark (0xDD64) - * Type: UInt64 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_BookmarkByte, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 36); - -#define NAME_MediaObj_BookmarkByte L"BookmarkByte" - - -/* GenericObj.DateRevised - * - * MTP Property: Last Build Date (0xDD70) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_DateRevised, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 43); - -#define NAME_GenericObj_DateRevised L"DateRevised" - - -/* GenericObj.TimeToLive - * - * MTP Property: Time To Live (0xDD71) - * Type: UInt64 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_TimeToLive, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 44); - -#define NAME_GenericObj_TimeToLive L"TimeToLive" - - -/* MediaObj.MediaUID - * - * MTP Property: Media GUID (0xDD72) - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_MediaUID, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 38); - -#define NAME_MediaObj_MediaUID L"MediaUID" - - -/* MediaObj.TotalBitRate - * - * MTP Property: Total Bit Rate (0xDE91) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_TotalBitRate, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 2); - -#define NAME_MediaObj_TotalBitRate L"TotalBitRate" - - -/* MediaObj.BitRateType - * - * MTP Property: Bit Rate Type (0xDE92) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_BitRateType, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 3); - -#define NAME_MediaObj_BitRateType L"BitRateType" - - -/* MediaObj.SampleRate - * - * MTP Property: Sample Rate (0xDE93) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_SampleRate, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 15); - -#define NAME_MediaObj_SampleRate L"SampleRate" - - -/* AudioObj.Channels - * - * MTP Property: Number of Channels (0xDE94) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_Channels, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 10); - -#define NAME_AudioObj_Channels L"Channels" - - -/* AudioObj.AudioBitDepth - * - * MTP Property: Audio Bit Depth (0xDE95) - * Type: UInt32 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_AudioBitDepth, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 12); - -#define NAME_AudioObj_AudioBitDepth L"AudioBitDepth" - - -/* AudioObj.AudioBlockAlignment - * - * MTP Property: Audio Block Alignment (0xDE96) - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_AudioBlockAlignment, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 13); - -#define NAME_AudioObj_AudioBlockAlignment L"AudioBlockAlignment" - - -/* VideoObj.ScanType - * - * MTP Property: Video Scan Type (0xDE97) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_ScanType, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 12); - -#define NAME_VideoObj_ScanType L"ScanType" - - -/* AudioObj.AudioFormatCode - * - * MTP Property: Audio WAVE Codec (0xDE99) - * Type: UInt32 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_AudioFormatCode, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 11); - -#define NAME_AudioObj_AudioFormatCode L"AudioFormatCode" - - -/* AudioObj.AudioBitRate - * - * MTP Property: Audio Bit Rate (0xDE9A) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_AudioObj_AudioBitRate, - 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6, - 9); - -#define NAME_AudioObj_AudioBitRate L"AudioBitRate" - - -/* VideoObj.VideoFormatCode - * - * MTP Property: Video FourCC Codec (0xDE9B) - * Type: UInt32 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_VideoFormatCode, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 14); - -#define NAME_VideoObj_VideoFormatCode L"VideoFormatCode" - - -/* VideoObj.VideoBitRate - * - * MTP Property: Video Bit Rate (0xDE9C) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_VideoBitRate, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 13); - -#define NAME_VideoObj_VideoBitRate L"VideoBitRate" - - -/* VideoObj.VideoFrameRate - * - * MTP Property: Frames Per Thousand Seconds (0xDE9D) - * Type: UInt32 - * Form: Range/Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_VideoFrameRate, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 15); - -#define NAME_VideoObj_VideoFrameRate L"VideoFrameRate" - - -/* VideoObj.KeyFrameDistance - * - * MTP Property: Key Frame Distance (0xDE9E) - * Type: UInt32 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_VideoObj_KeyFrameDistance, - 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A, - 10); - -#define NAME_VideoObj_KeyFrameDistance L"KeyFrameDistance" - - -/* MediaObj.BufferSize - * - * MTP Property: Buffer Size (0xDE9F) - * Type: UInt32 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_BufferSize, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 46); - -#define NAME_MediaObj_BufferSize L"BufferSize" - - -/* MediaObj.EncodingQuality - * - * MTP Property: Encoding Quality (0xDEA0) - * Type: UInt32 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_EncodingQuality, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 48); - -#define NAME_MediaObj_EncodingQuality L"EncodingQuality" - - -/* MediaObj.EncodingProfile - * - * MTP Property: Encoding Profile (0xDEA1) - * Type: String - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MediaObj_EncodingProfile, - 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8, - 21); - -#define NAME_MediaObj_EncodingProfile L"EncodingProfile" - - -/* GenericObj.ReferenceParentID - * - * This write only property is used when creating object references to help - * hint the responder implementation to the parent item that this object will - * be associated with. - * - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_GenericObj_ReferenceParentID, - 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C, - 47); - -#define NAME_GenericObj_ReferenceParentID L"ReferenceParentID" - -#endif /* _BRIDGEDEVICESERVICE_H_ */ - diff --git a/qt-correction-tool/pub/ddk/bthddi.h b/qt-correction-tool/pub/ddk/bthddi.h deleted file mode 100644 index ee797a4..0000000 --- a/qt-correction-tool/pub/ddk/bthddi.h +++ /dev/null @@ -1,2025 +0,0 @@ -/*++ - -Copyright (c) 2000 Microsoft Corporation - -Module Name: - - BTHDDI.H - -Abstract: - - Public structures common to the BTHPORT and BTH client device drivers - -Environment: - - Kernel & user mode - -Revision History: - - --*/ - -#ifndef __BTHDDI_H__ -#define __BTHDDI_H__ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// DEFINES -// - -// BTHPORT BRB header context size. -#define BTHPORT_CONTEXT_SIZE (4) - -#define BTHPORT_RESERVED_FIELD_SIZE (2) - - -//////////////////////// NOTES /////////////////////////////////////////////// -// 1) BRB Clients need to send IRP_MJ_INTERNAL_DEVICE_CONTROL to -// the BTH Port driver with IOCTL_INTERNAL_BTH_SUBMIT_BRB Device I/O code. -// In addition, the client driver needs to pass a BRB pointer in Argument1 -// of IRP stack location. -// 2) Client drivers can submit data buffers of either type MDL, or PVOID -// buffer but not both. -// 3) Client drivers need to QI the bus driver before they can submit any BRB. -// This is necessary in order to provide the event callback entry points. -// Optional event handlers are designated as such with [O] in the -// BTHPORT_INTERFACE structure below. -///////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Possible error codes returned by the bus driver. -// -// STATUS_PENDING : Request is queued for execution. -// -// STATUS_SUCCESS: Request completed successfully. -// -// STATUS_INSUFFICIENT_RESOURCES: request failed due to lack of resources. -// -// STATUS_UNSUCCESSFUL: Request did not complte successfully. -// -// STATUS_CANCELLED: BRB/IRP was cancelled . -// -// STATUS_INVALID_PARAMETER: sumbitted BRB has invalid paramters. -// -// STATUS_INVALID_DEVICE_REQUEST: undefined request. -// -// STATUS_PROTOCOL_UNREACHBLE: remote device did not accept the -// l2cap connection with the specified PSM. -// -// STATUS_DEVICE_CONFIGURATION_ERROR: remote device did not -// agree to L2cap default configuration parameters and/or MTU size. -// -// STATUS_DEVICE_NOT_EXIST: Radio is not available. -// -// STATUS_BUFFER_TOO_SMALL: client submitted buffer is too small. -// -// The following Bluetooth error codes will be mapped to NTSTATUS code: - -/* -BTHSTATUS: NTSTATUS: - -BTH_ERROR_SUCCESS STATUS_SUCCESS -BTH_ERROR_NO_CONNECTION STATUS_INVALID_HANDLE -BTH_ERROR_HARDWARE_FAILURE STATUS_ADAPTER_HARDWARE_ERROR -BTH_ERROR_PAGE_TIMEOUT STATUS_TIMEOUT -BTH_ERROR_AUTHENTICATION_FAILURE STATUS_MUTUAL_AUTHENTICATION_FAILED -BTH_ERROR_KEY_MISSING STATUS_NO_USER_SESSION_KEY -BTH_ERROR_MEMORY_FULL STATUS_INSUFFICIENT_RESOURCES -BTH_ERROR_CONNECTION_TIMEOUT STATUS_LINK_TIMEOUT -BTH_ERROR_MAX_NUMBER_OF_CONNECTIONS STATUS_CONNECTION_COUNT_LIMIT -BTH_ERROR_MAX_NUMBER_OF_SCO_CONNECTIONS STATUS_CONNECTION_COUNT_LIMIT -BTH_ERROR_ACL_CONNECTION_ALREADY_EXISTS STATUS_CONNECTION_IN_USE -BTH_ERROR_COMMAND_DISALLOWED STATUS_INVALID_PARAMETER -BTH_ERROR_HOST_REJECTED_LIMITED_RESOURCES STATUS_INSUFFICIENT_RESOURCES -BTH_ERROR_HOST_REJECTED_SECURITY_REASONS STATUS_CONNECTION_REFUSED -BTH_ERROR_HOST_REJECTED_PERSONAL_DEVICE STATUS_CONNECTION_REFUSED -BTH_ERROR_HOST_TIMEOUT STATUS_TIMEOUT -BTH_ERROR_UNSUPPORTED_FEATURE_OR_PARAMETER STATUS_INVALID_PARAMETER -BTH_ERROR_INVALID_HCI_PARAMETER STATUS_INVALID_PARAMETER -BTH_ERROR_REMOTE_USER_ENDED_CONNECTION STATUS_REMOTE_DISCONNECT -BTH_ERROR_REMOTE_LOW_RESOURCES STATUS_REMOTE_RESOURCES -BTH_ERROR_REMOTE_POWERING_OFF STATUS_REMOTE_RESOURCES -BTH_ERROR_LOCAL_HOST_TERMINATED_CONNECTION STATUS_CONNECTION_DISCONNECTED -BTH_ERROR_PAIRING_NOT_ALLOWED STATUS_MUTUAL_AUTHENTICATION_FAILED -BTH_ERROR_UNSUPPORTED_REMOTE_FEATURE STATUS_ADAPTER_HARDWARE_ERROR -BTH_ERROR_UNSPECIFIED_ERROR STATUS_ADAPTER_HARDWARE_ERROR -BTH_ERROR_ROLE_CHANGE_NOT_ALLOWED STATUS_INVALID_PARAMETER - - */ - - - -// -// version for QI, encoded in binary encoded decimal, ie 1.0 -// -#define BTHDDI_ENUMERATOR_INTERFACE_VERSION_FOR_QI (0x0200) -#define BTHDDI_PROFILE_DRIVER_INTERFACE_VERSION_FOR_QI (0x0200) - -// -// Create - enumerate the PDO, the device is in range -// Remove - remove the PDO, the device is in range -// Destroy - force remove the PDO, the user no longer wants to use this -// protocol / service -// -typedef enum _ENUMERATOR_ACTION { - ENUMERATOR_ACTION_CREATE = 0, - ENUMERATOR_ACTION_REMOVE, - ENUMERATOR_ACTION_DESTROY, - ENUMERATOR_ACTION_MAX, -} ENUMERATOR_ACTION, *PENUMERATOR_ACTION; - -typedef enum _ENUMERATOR_TYPE { - ENUMERATOR_TYPE_PROTOCOL = 0, - ENUMERATOR_TYPE_SERVICE, - ENUMERATOR_TYPE_MAX, -} ENUMERATOR_TYPE, *PENUMERATOR_TYPE; - -// -// BTH_ENUMERATOR_INFO Flags -// - -#define BTH_ENUMERATORFL_INCOMING 0x00000001 -#define BTH_ENUMERATORFL_OUTGOING 0x00000002 -#define BTH_ENUMERATORFL_REENUM 0x00000004 - -typedef struct _BTH_ENUMERATOR_INFO { - // - // Type of connection being requested - // - ENUMERATOR_TYPE EnumeratorType; - - // - // Action to take - // - ENUMERATOR_ACTION Action; - - // - // Psm being connected to if this is an L2CAP connect request, RFCOMM - // DLCI if this is an RFCOMM connection request. - // - ULONG Port; - - // - // Flags - // - - ULONG Flags; - - // - // Protocol / Service UUID for the enumeration action - // - GUID Guid; - - // - // Instance ID of the Protocol / Service for BTH_ENUMERATORFL_INCOMING - // - ULONG InstanceId; - - // - // Instance ID str of the Protocol / Service for BTH_ENUMERATORFL_OUTGOING - // - - WCHAR InstanceIdStr[BTH_MAX_SERVICE_NAME_SIZE]; - - // - // Vendor ID, retrieved from DI SDP record - // - USHORT Vid; - - // - // Product ID, retrieved from DI SDP record - // - USHORT Pid; - - // - // Manufacturer, retrieved from DI SDP record - // - USHORT Mfg; - - // - // Local radio manufacturer, retreived via HCI Command - // - USHORT LocalMfg; - - - // - // Vendor ID type, retrieved from DI SDP record - // - USHORT VidType; - - // - // Service Name (Used for local services) - // - WCHAR ServiceName[BTH_MAX_SERVICE_NAME_SIZE]; - - // - // Identifier used for remote services. - // - CHAR SdpPriLangServiceName[BTH_MAX_SERVICE_NAME_SIZE]; - - // - // Device string passed down on BTH_UPDATE ADD - // - WCHAR DeviceString[BTH_MAX_SERVICE_NAME_SIZE]; - -} BTH_ENUMERATOR_INFO, *PBTH_ENUMERATOR_INFO; - - - -typedef PVOID L2CAP_CHANNEL_HANDLE; - -typedef PVOID L2CAP_SERVER_HANDLE; - -typedef PVOID SCO_SERVER_HANDLE; - -// -// BRB types.. -// - -/*++ -////////////////////////// HCI GENERAL COMMANDS //////////////////////////// - BRB_HCI_INQUIRY - trigger radio to issue an hci inquiry cmd. - BRB_HCI_CANCEL_INQUIRY - Cancel inquiry cmd. - BRB_HCI_GET_DEVICE_LIST - return a list of device info blkd entries. - BRB_HCI_GET_LOCAL_BD_ADDR - return BTH_ADDR of local radio. - BRB_HCI_GET_SIGNAL_PARAMETERS - return RSSI and transmit power level info - for local radio. - BRB_HCI_UNKNOWN_CMD - -////////////////////////////// HCI SCO COMMANDS //////////////////////////// - BRB_SCO_OPEN, - for isochronous requests - BRB_SCO_CLOSE, - close an isoch connection. - BRB_SCO_READ, - read data from Isoch channel - BRB_SCO_WRITE, - write data to isoch channel - -////////////////////////////// L2CAP COMMANDS ///////////////////////////// - BRB_L2CA_CONNECT_REQ, - used for L2cap connection request.. - BRB_L2CA_CONNECT_RSP, - L2cap server's response to connection request. - BRB_L2CA_DISCONNECT_REQ, - to disconnect an established l2cap connection. - BRB_L2CA_CONFIG_REQ, - Configure L2cap connection for QoS, etc.. - BRB_L2CA_ACL_TRANSFER, - read or write ACL data - -////////////////////////////// Register and Deregister PSM values ///////// - BRB_REGISTER_PSM, - Register a PSM value - BRB_UNREGISTER_PSM, - Unregister a PSM value - - --*/ - -#ifndef BRBTYPE -typedef enum _BRB_TYPE { - BRB_HCI_GET_LOCAL_BD_ADDR = 0x0001, - BRB_L2CA_REGISTER_SERVER = 0x0100, - BRB_L2CA_UNREGISTER_SERVER = 0x0101, - BRB_L2CA_OPEN_CHANNEL = 0x0102, - BRB_L2CA_OPEN_CHANNEL_RESPONSE = 0x0103, - BRB_L2CA_CLOSE_CHANNEL = 0x0104, - BRB_L2CA_ACL_TRANSFER = 0x0105, - BRB_L2CA_UPDATE_CHANNEL = 0x0106, - BRB_L2CA_PING = 0x0107, - BRB_L2CA_INFO_REQUEST = 0x0108, - BRB_REGISTER_PSM = 0x0109, - BRB_UNREGISTER_PSM = 0x010a, - BRB_SCO_REGISTER_SERVER = 0x0200, - BRB_SCO_UNREGISTER_SERVER = 0x0201, - BRB_SCO_OPEN_CHANNEL = 0x0202, - BRB_SCO_OPEN_CHANNEL_RESPONSE = 0x0203, - BRB_SCO_CLOSE_CHANNEL = 0x0204, - BRB_SCO_TRANSFER = 0x0205, - BRB_SCO_GET_CHANNEL_INFO = 0x0207, - BRB_SCO_GET_SYSTEM_INFO = 0x0209, - BRB_SCO_FLUSH_CHANNEL = 0x020a, - BRB_ACL_GET_MODE = 0x0300, - BRB_ACL_ENTER_ACTIVE_MODE = 0x0301, - BRB_STORED_LINK_KEY = 0x0310, - BRB_GET_DEVICE_INTERFACE_STRING = 0x0320, -} BRB_TYPE; -#endif - -typedef enum _BRB_VERSION { - // - BLUETOOTH_V1 = 0, // Brb was created by Version 1.x code - // (i.e. ExAllocatePool) - // - - // - BLUETOOTH_V2 // Brb was crated by Version 2.0 (or later) - // code by BthAllocateBrb. This implies Brb is - // referenced counted -} BRB_VERSION; - - -// -// BRB HEADER -// -typedef struct _BRB_HEADER { - // - // [IN] Used to enqueue BRBs. This field is to be used by the current owner - // of the BRB. For instance, once the BRB has been sent to BTHPORT, - // the client driver may not use this field since BTHPORT may use it - // to enqueue the BRB. - // - LIST_ENTRY ListEntry; - - // - // [IN] Size of the BRB including this header - // - ULONG Length; - - // - // [PRIVATE] BRB Version - // 0 ==> Bluetooth 1.x version - // >0 ==> Bluetooth 2.x version or later, filled in by - // BthCreateBrb - // - USHORT Version; // BRB_VERSION - - // - // [IN] BRB request type. - // - USHORT Type; // BRB_TYPE - - - // - // [PRIVATE] Internal flags for use by BTHPORT - // - ULONG BthportFlags; - - // - // [OUT] BRB completion status - // - NTSTATUS Status; - - // - // [OUT] BRB completion BtStatus - // - BTHSTATUS BtStatus; - - // - // [PRIVATE] for internal use by BTHPORT only. - // - PVOID Context[BTHPORT_CONTEXT_SIZE]; - - // - // for use by client drivers, BTHPORT will never touch these fields. - // - PVOID ClientContext[BTHPORT_CONTEXT_SIZE]; - - // - // opaque reserved fields - // - ULONG Reserved[BTHPORT_RESERVED_FIELD_SIZE]; - -} BRB_HEADER; - - - -typedef struct _L2CAP_CONFIG_RANGE { - USHORT Min; - USHORT Max; -} L2CAP_CONFIG_RANGE, *PL2CAP_CONFIG_RANGE; - -typedef struct _L2CAP_CONFIG_VALUE_RANGE { - USHORT Min; - USHORT Preferred; - USHORT Max; -} L2CAP_CONFIG_VALUE_RANGE, *PL2CAP_CONFIG_VALUE_RANGE; - -// -// Needs packing to match exact spec size -// -#include -typedef struct _L2CAP_FLOWSPEC { - // - // Reserved. Must be zero. - // - UCHAR Flags; - - // - // L2CAP_FLOW_SERVICE_TYPE_XXX value - // - UCHAR ServiceType; - - // - // Bytes/sec - // - ULONG TokenRate; - - // - // Bytes - // - ULONG TokenBucketSize; - - // - // Bytes/sec - // - ULONG PeakBandwidth; - - // - // Microsoeonds - // - ULONG Latency; - - // - // Microseconds - // - ULONG DelayVariation; - -} L2CAP_FLOWSPEC, *PL2CAP_FLOWSPEC; -#include - - -// -// Use the DynamicBuffer field -// -#define CO_DYNAMIC (0x0001) - -// -// Use the FixedBuffer field -// -#define CO_FIXED (0x0002) - -// -// The option is unknown. Used during config request validation callback, not -// a valid flag when submitting options to bthport. -// -#define CO_UNKNOWN (0x0004) - -#define VALID_CO_FLAGS (CO_DYNAMIC | CO_FIXED) - -#define IS_CO_TYPE_HINT(type) (((type) & 0x80) == 0x80) -#define IS_CO_TYPE_REQUIRED(type) (((type) & 0x80) == 0x00) - -typedef UCHAR CO_TYPE, *PCO_TYPE; -typedef UCHAR CO_LENGTH, *PCO_LENGTH; -typedef USHORT CO_MTU, *PCO_MTU; -typedef USHORT CO_FLUSHTO, *PCO_FLUSHTO; - -#include -// -// Config Option (CO) header -// -typedef struct _CO_HEADER { - // - // Type of vendor-specific option. can be either an option or a hint. - // - CO_TYPE Type; - - // - // Size of the vendor-specific option. - // - CO_LENGTH Length; - -} CO_HEADER; -#include - -// -// HCI connection handle. -// -typedef USHORT CONNECTION_HANDLE, *PCONNECTION_HANDLE; - -// -// HCI SCO Requests -// -typedef PVOID SCO_CHANNEL_HANDLE, *PSCO_CHANNEL_HANDLE; - -// -// SCO retransmission effort. -// -typedef enum _SCO_RETRANSMISSION_EFFORT { - SCO_RETRANSMISSION_NONE = 0x00, - SCO_RETRANSMISSION_MIN1_POWER = 0x01, - SCO_RETRANSMISSION_MIN1_QUALITY = 0x02, - SCO_RETRANSMISSION_DONT_CARE = 0xFF -} SCO_RETRANSMISSION_EFFORT, *PSCO_RETRANSMISSION_EFFORT; - -// -// SCO voice setting. -// -#define SCO_VS_IN_CODING_MASK (0x0300) -#define SCO_VS_IN_CODING_LINEAR (0x0000) -#define SCO_VS_IN_CODING_MULAW (0x0100) -#define SCO_VS_IN_CODING_ALAW (0x0200) - -#define SCO_VS_IN_DATA_FORMAT_MASK (0x00C0) -#define SCO_VS_IN_DATA_FORMAT_1C (0x0000) -#define SCO_VS_IN_DATA_FORMAT_2C (0x0040) -#define SCO_VS_IN_DATA_FORMAT_SM (0x0080) -#define SCO_VS_IN_DATA_FORMAT_US (0x00C0) - -#define SCO_VS_IN_SAMPLE_SIZE_MASK (0x0020) -#define SCO_VS_IN_SAMPLE_SIZE_8BIT (0x0000) -#define SCO_VS_IN_SAMPLE_SIZE_16BIT (0x0020) - -#define SCO_VS_PCM_BIT_POS_MASK (0x001C) - -#define SCO_VS_AIR_CODING_FORMAT_MASK (0x0003) -#define SCO_VS_AIR_CODING_FORMAT_CVSD (0x0000) -#define SCO_VS_AIR_CODING_FORMAT_MULAW (0x0001) -#define SCO_VS_AIR_CODING_FORMAT_ALAW (0x0002) -#define SCO_VS_AIR_CODING_DATA (0x0003) - -#define SCO_VS_SETTING_DEFAULT (0x0060) // bits 0,1 vendor specific. - -// -// SCO link types. -// -typedef enum _SCO_LINK_TYPE { - ScoLinkType = 0x00, - eScoLinkType = 0x02, -} SCO_LINK_TYPE, *PSCO_LINK_TYPE; - -// -// SCO packet types. -// -#define SCO_HV1 (0x0001) -#define SCO_HV2 (0x0002) -#define SCO_HV3 (0x0004) -#define SCO_EV3 (0x0008) -#define SCO_EV4 (0x0010) -#define SCO_EV5 (0x0020) -#define SCO_PKT_ALL (0x003F) - -// -// Valid SCO channel flags in OpenChannel/OpenChannel response. -// -#define SCO_CF_LINK_AUTHENTICATED (0x00020000) -#define SCO_CF_LINK_ENCRYPTED (0x00040000) -#define SCO_CF_LINK_SUPPRESS_PIN (0x00080000) - -// -// Notify the client when a remote disconnect occurs -// -#define SCO_CALLBACK_DISCONNECT (0x00000001) - -// -// Valid SCO connection indications in OpenChannel/OpenChannel response. -// -#define SCO_VALID_CALLBACK_FLAGS (SCO_CALLBACK_DISCONNECT) - -// -// SCO callback notification codes. -// -typedef enum _SCO_INDICATION_CODE { - ScoIndicationAddReference = 0, // Connection indication - ScoIndicationReleaseReference, // Connection indication - ScoIndicationRemoteConnect, // Connectionless indication - ScoIndicationRemoteDisconnect, // Connection indication -} SCO_INDICATION_CODE, *PSCO_INDICATION_CODE; - -// -// Reasons why a SCO channel has been disconnected -// -typedef enum _SCO_DISCONNECT_REASON { - ScoHciDisconnect = 0, - ScoDisconnectRequest, - ScoRadioPoweredDown, - ScoHardwareRemoval, -} SCO_DISCONNECT_REASON, *PSCO_DISCONNECT_REASON; - -// -// SCO callback parameters. -// -typedef struct _SCO_INDICATION_PARAMETERS { - - // [IN] SCO connection handle. - SCO_CHANNEL_HANDLE ConnectionHandle; - - // [IN] Bluetooth address of remote device. - BTH_ADDR BtAddress; - - union { - // - // ScoIndicationRemoteConnect - // - struct { - struct { - // [IN] Type of link (SCO or ESCO). - SCO_LINK_TYPE LinkType; - } Request; - } Connect; - - // - // ScoIndicationRemoteDisconnect - // - struct { - // [IN] Reason why the remote device disconnected. - SCO_DISCONNECT_REASON Reason; - - // [OUT] TRUE to let caller close the connection. - BOOLEAN CloseNow; - } Disconnect; - - } Parameters; - -} SCO_INDICATION_PARAMETERS, *PSCO_INDICATION_PARAMETERS; - -// -// SCO callback prototype. -// -typedef -void -(*PFNSCO_INDICATION_CALLBACK)( - IN PVOID Context, - IN SCO_INDICATION_CODE Indication, - IN PSCO_INDICATION_PARAMETERS Parameters - ); - -// -// Valid SCO 'connectionless indications' in service interface. -// -#define SCO_INDICATION_SCO_REQUEST (0x00000001) -#define SCO_INDICATION_ESCO_REQUEST (0x00000002) - -#define SCO_INDICATION_VALID_FLAGS (SCO_INDICATION_SCO_REQUEST | \ - SCO_INDICATION_ESCO_REQUEST) - -struct _BRB_SCO_REGISTER_SERVER { - // BRB header - BRB_HEADER Hdr; - - BTH_ADDR BtAddress; - - // - // Reserved for future use (set to 0). - // - ULONG Reserved; - - // - // [IN] Combination of SCO_INDICATION_Xxx flags. - // - ULONG IndicationFlags; - PFNSCO_INDICATION_CALLBACK IndicationCallback; - PVOID IndicationCallbackContext; - - // - // [IN] Object to be passed to ObReferenceObject, ObDereferenceObject. - // The client provides this ReferenceObject in such a way that the port - // driver can take a reference on the client driver for as long as - // it has the opportunity to call the IndicationCallback function pointer. The client - // driver can have its reference released by calling the RemoveIndicationCallback - // routine. - // - PVOID ReferenceObject; - - // - // [OUT] Set by BTHPORT upon a successful set of the server interface. The - // client should send a BRB_SCO_REGISTER_SERVER when it - // no longer wants to receive remote connect indications (ie, when it - // receives a PNP rmeove for instance). The client should pass back - // the ServerHandle as part of the BRB_SCO_REGISTER_SERVER - // structure. - // - OUT SCO_SERVER_HANDLE ServerHandle; - - -}; - -struct _BRB_SCO_UNREGISTER_SERVER { - // BRB header - BRB_HEADER Hdr; - - BTH_ADDR BtAddress; - PVOID ServerHandle; -}; - -// -//Connect response signal Result values -// -#define SCO_CONNECT_RSP_RESPONSE_SUCCESS (0x00) -#define SCO_CONNECT_RSP_RESPONSE_NO_RESOURCES (0x0D) -#define SCO_CONNECT_RSP_RESPONSE_SECURITY_BLOCK (0x0E) -#define SCO_CONNECT_RSP_RESPONSE_BAD_BD_ADDR (0x0F) - -// -// This request will open an SCO connection on a physical link. -// -struct _BRB_SCO_OPEN_CHANNEL { - // BRB header - BRB_HEADER Hdr; - - // [IN] Bluetooth address of target device - BTH_ADDR BtAddress; - - // [IN] Transmit bandwidth in (bytes/sec). - ULONG TransmitBandwidth; - - // [IN] Receive bandwidth in (bytes/sec). - ULONG ReceiveBandwidth; - - // [IN] Max in air delay before discarding the packet (msec). - USHORT MaxLatency; - - // [IN] HV1 | HV2 | HV3 | EV3 | EV4 | EV5 (See SCO_HV1 etc.) - USHORT PacketType; - - // [IN] Content format. (See SCO_VS_Xxx defines). - USHORT ContentFormat; - - // [IN] Set to zero. - USHORT Reserved; - - // [IN] Retransmission effort - SCO_RETRANSMISSION_EFFORT RetransmissionEffort; - - // [IN] Combination of SCO_CF_XXX flags - ULONG ChannelFlags; - - // [IN] Combo of SCO_CALLBACK_Xxx flags - ULONG CallbackFlags; - - // [IN] Callback supplied by client - PFNSCO_INDICATION_CALLBACK Callback; - - // [IN] Context passed to callback - PVOID CallbackContext; - - // [IN] Object to be passed to ObReferenceObject, ObDereferenceObject - PVOID ReferenceObject; - - // - // [IN/OUT] handle used to ID the connection upon a successful connect. - // When sending a BRB_SCO_OPEN_CHANNEL, this will be filled in when the BRB - // complets. When sending a BRB_SCO_OPEN_CHANNEL_RESPONSE, this must be - // filled in by the server before sending down the BRB. The value assigned - // should be SCO_INDICATION_PARAMETERS::ConnectionHandle which was passed - // in during ScoIndicationRemoteConnect. - // - SCO_CHANNEL_HANDLE ChannelHandle; - - // - // [IN] Used only with BRB_SCO_OPEN_CHANNEL_RESPONSE. One of the - // SCO_CONNECT_RSP_RESPONSE_Xxx values is used. - // - UCHAR Response; -}; - -// -// This request will close an SCO connection on a physical link. -// -struct _BRB_SCO_CLOSE_CHANNEL { - // BRB header - BRB_HEADER Hdr; - - // [IN] Address of the remote device - BTH_ADDR BtAddress; - - // [IN] SCO Connection handle to be provided to BTHPORT. - SCO_CHANNEL_HANDLE ChannelHandle; -}; - -// -// This request will flush the 'in' and/or 'out' channel's pipe. -// -struct _BRB_SCO_FLUSH_CHANNEL { - // BRB header - BRB_HEADER Hdr; - - // [IN] Address of the remote device - BTH_ADDR BtAddress; - - // [IN] SCO Connection handle to be provided to BTHPORT. - SCO_CHANNEL_HANDLE ChannelHandle; - - // [IN] Combination of SCO_FLUSH_XXX flags. - ULONG FlushFlags; -}; - -// SCO write pipe. -#define SCO_FLUSH_DIRECTION_OUT (0x00000001) - -// SCO read pipe. -#define SCO_FLUSH_DIRECTION_IN (0x00000002) - -// -// Baseband channel settings. -// -typedef struct _BASEBAND_CHANNEL_INFO { - // - // Time between two consecutive eSCO instants measured in slots. Must be - // 0 for SCO links. - // - UCHAR Transmission_Interval; - - // - // The size of the retransmission windows measured in slots. Must be 0 - // for SCO links. - // - UCHAR Retransmission_Window; - - // - // Air mode data format: - // 0x00 - MU-LAW LOG - // 0x01 - A-LAW LOG - // 0x02 - CVSD - // 0x03 - Transparent Data - // 0x04 - 0xFF - Reserved. - // - UCHAR AirMode; - - // - // Length in bytes of the eSCO payload in the receiver direction. Must be - // 0 for SCO links. - // - USHORT Rx_Packet_Length; - - // - // Length in bytes of the eSCO payload in the transmit direction. Must be - // 0 for SCO links. - // - USHORT Tx_Packet_Length; -}BASEBAND_CHANNEL_INFO, *PBASEBAND_CHANNEL_INFO; - -// -// This request will return the channel settings. -// -struct _BRB_SCO_GET_CHANNEL_INFO { - // BRB header - BRB_HEADER Hdr; - - // [IN] Bluetooth address of target device - BTH_ADDR BtAddress; - - // [IN] SCO Connection handle to be provided to BTHPORT. - SCO_CHANNEL_HANDLE ChannelHandle; - - // [OUT] Generic informational flags (See SCO_INFO_Xxx defines). - ULONG InfoFlags; - - // [OUT] Transmit bandwidth in (bytes/sec). - ULONG TransmitBandwidth; - - // [OUT] Receive bandwidth in (bytes/sec). - ULONG ReceiveBandwidth; - - // [OUT] Max in air delay before discarding the packet (msec). - USHORT MaxLatency; - - // [OUT] HV1 | HV2 | HV3 | EV3 | EV4 | EV5 (See SCO_HV1 etc.) - USHORT PacketType; - - // [OUT] Content format. (See SCO_VS_Xxx defines). - USHORT ContentFormat; - - // [OUT] Set to zero. - USHORT Reserved; - - // [OUT] Retransmission effort - SCO_RETRANSMISSION_EFFORT RetransmissionEffort; - - // [OUT] Combination of SCO_CF_XXX flags - ULONG ChannelFlags; - - // [OUT] HCI connection handle. - CONNECTION_HANDLE HciConnectionHandle; - - // [OUT] HCI link type. - SCO_LINK_TYPE LinkType; - - // [OUT] Baseband channel info. This info is only available for links - // established using the 1.2 Bluetooth Synchronous Commands (see InfoFlags - // for more info). - BASEBAND_CHANNEL_INFO BasebandInfo; -}; - -// -// Get channel informational flags. -// -#define SCO_INFO_BASEBAND_AVAILABLE (0x00000001) - -// -// This request will sumbit a data buffer by the client to be filled from the -// open SCO channel associated with the connection handle. The client driver -// can provide either an MDL ptr or PVOID ptr but not both. BufferSize -// parameter will be updated upon completion of this request to reflect the -// total bytes read. -// -struct _BRB_SCO_TRANSFER { - // BRB header - BRB_HEADER Hdr; - - // [IN] Address of the remote device - BTH_ADDR BtAddress; - - // [IN] SCO Connection handle to be provided to BTHPORT. - SCO_CHANNEL_HANDLE ChannelHandle; - - // [IN] Combination of SCO_TRANSFER_XXX flags. - ULONG TransferFlags; - - // [IN/OUT] Length of buffer in bytes. - ULONG BufferSize; - - // [IN] buffer ptr. should be NULL if BufferMDL is used. - PVOID Buffer; - - // [IN] MDL buffer ptr. should be NULL if Buffer id used. - PMDL BufferMDL; - - // [OUT] additional info about the data. - ULONGLONG DataTag; -}; - -// SCO write -#define SCO_TRANSFER_DIRECTION_OUT (0x00000000) - -// SCO read -#define SCO_TRANSFER_DIRECTION_IN (0x00000001) - -// -// This request will return system wide SCO information. -// -struct _BRB_SCO_GET_SYSTEM_INFO { - // BRB header - BRB_HEADER Hdr; - - // [OUT] SCO features. (See SCO_FEATURE_Xxx defines). - ULONG Features; - - // [OUT] Maximum number of active SCO connections. - // Set to -1 if no limit or unknown. - ULONG MaxChannels; - - // [OUT] Minimum transfer in msec x request. - // Set to -1 if variable or unknown. - ULONG TransferUnit; - - // [OUT] Supported (e)SCO packet types. (See SCO_HV1 etc.). - USHORT PacketTypes; - - // [OUT] Supported data formats. (See SCO_DATA_FORMAT_Xxx defines). - USHORT DataFormats; - - // [OUT] Reserved for future use. - ULONG Reserved; -}; - -// -// Supported SCO features. -// -#define SCO_FEATURE_SCO_LINKS (0x00000001) -#define SCO_FEATURE_ESCO_LINKS (0x00000002) -#define SCO_FEATURE_STREAM_OFFSET_DATA_TAG (0x00000010) - -// -// Supported data formats (voice encodings). -// -#define SCO_DATA_FORMAT_MU_LAW_LOG (0x0001) -#define SCO_DATA_FORMAT_A_LAW_LOG (0x0002) -#define SCO_DATA_FORMAT_CVSD (0x0004) -#define SCO_DATA_FORMAT_TRANSPARENT (0x0008) -#define SCO_DATA_FORMAT_ALL (0x000F) - -// -// L2CAP specific data types -// - -// -// FLOWSPEC related constants -// -// No traffic will be transmitted in the specified direction. -// -#define L2CAP_FLOW_SERVICE_TYPE_NOTRAFFIC (0) - -// -// Default value, and indicates reasonable efforts -// -#define L2CAP_FLOW_SERVICE_TYPE_BESTEFFORT (1) - -// -// Guarantees ability to transmit data at token rate. -// -#define L2CAP_FLOW_SERVICE_TYPE_GUARANTEED (2) - - - -// -// connect response signal Result & Status values -// -#define CONNECT_RSP_RESULT_SUCCESS (0x0) -#define CONNECT_RSP_RESULT_PENDING (0x1) -#define CONNECT_RSP_RESULT_PSM_NEG (0x2) -#define CONNECT_RSP_RESULT_SECURITY_BLOCK (0x3) -#define CONNECT_RSP_RESULT_NO_RESOURCES (0x4) - -// -// Only valid if CONNECT_RSP_RESULT_PENDING is specified -// -#define CONNECT_RSP_STATUS_NO_INFORMATION (0x00) -#define CONNECT_RSP_STATUS_AUTHENTICATION_PENDING (0x01) -#define CONNECT_RSP_STATUS_AUTHORIZATION_PENDING (0x02) - -// -// Config signal response codes -// -#define CONFIG_STATUS_SUCCESS (0) -#define CONFIG_STATUS_INVALID_PARAMETER (1) -#define CONFIG_STATUS_REJECT (2) -#define CONFIG_STATUS_UNKNOWN_OPTION (3) -#define CONFIG_STATUS_DISCONNECT (0xFFF) - -// -// Min, max, and default L2cap Signal MTU. -// - -// -// Min, max, default, no retransmit and infinite FlushTO values -// -#define L2CAP_MIN_FLUSHTO (1) -#define L2CAP_MAX_FLUSHTO (0xFFFF) -#define L2CAP_DEFAULT_FLUSHTO (L2CAP_MAX_FLUSHTO) - -#define L2CAP_NO_REXMIT_FLUSHTO (L2CAP_MIN_FLUSHTO) -#define L2CAP_INFINITE_FLUSHTO (L2CAP_MAX_FLUSHTO) - - -// -// Specify which fields contain data. -// -// In the case of OUT parameters where the flag is not set for a particular -// value, the default will be requested. If the default is rejected by the -// remote host, the suggested value (by the remote host) will be used. -// -// In the case of IN parameters where the flag is not set for a particular -// value, the remote's request value will be accepted. -// -// Link timeout is a local option and is not negotiated across the air. -// -// QOS is specified for the outbound config request -// -#define CFG_MTU (0x00000001) -#define CFG_FLUSHTO (0x00000002) -#define CFG_QOS (0x00000004) -#define CFG_EXTRA (0x00000008) - -#define CFG_LINKTO (0x00000010) -#define CFG_QOS_LOCAL (0x00000020) - -// -// Indicates the desired role in the connection -// -#define CF_ROLE_EITHER (0x00000000) -#define CF_ROLE_SLAVE (0x00000001) -#define CF_ROLE_MASTER (0x00000002) -#define CF_ROLE_MASK (CF_ROLE_EITHER | \ - CF_ROLE_SLAVE | \ - CF_ROLE_MASTER) - -// -// Indicates requirenments on the HCI channel. Encryption requires -// authentication. -// -#define CF_LINK_NOTHING (0x00010000) -#define CF_LINK_AUTHENTICATED (0x00020000) -#define CF_LINK_ENCRYPTED (0x00040000) -#define CF_LINK_SUPPRESS_PIN (0x00080000) - -#define CF_QUEUE_KEEP_OLD (0x00000020) -#define CF_QUEUE_KEEP_NEW (0x00000040) -#define CF_QUEUE_MASK (CF_QUEUE_KEEP_OLD | CF_QUEUE_KEEP_NEW) - -// -// Notify the client when a remote disconnect occurs -// -#define CALLBACK_DISCONNECT (0x00000001) - -// -// Involve the client when the remote host sends a config request with a QOS -// value. If this flag is not set and the remote host either specifies a QOS -// parameter in a config request or rejects the local host's request for QOS, -// then the channel is disconnected. -// -#define CALLBACK_CONFIG_QOS (0x00000002) - -// -// If specified, the callback will be called when remote host rejects an extra -// config option. -// -// If unspecified and the remote host rejects the config request due to an extra -// config option, the connection will be closed. -// -#define CALLBACK_CONFIG_EXTRA_OUT (0x00000004) - -// -// If specified, the callback will be called when the remote host's config -// request contains extra options. -// -// If unspecified, the extra config options will be rejected as unknown options. -// -#define CALLBACK_CONFIG_EXTRA_IN (0x00000008) - -// -// Client will allow reconfig of the channel. If this flag is not specified, -// any reconfig is rejected and the channel is torn down. -// -#define CALLBACK_RECONFIG (0x00000010) - -// -// Client wants to be involved in master / slave role switching -// -#define CALLBACK_ROLE_CHANGE (0x00000020) - -// -// Client wants to be notified when an incoming L2CAP packet has been received -// -#define CALLBACK_RECV_PACKET (0x00000040) - - -typedef struct _INDICATION_PARAMETERS *PINDICATION_PARAMETERS; -typedef enum _INDICATION_CODE INDICATION_CODE; - - -typedef -void -(*PFNBTHPORT_INDICATION_CALLBACK)( - IN PVOID Context, - IN INDICATION_CODE Indication, - IN PINDICATION_PARAMETERS Parameters - ); - - -// -// Full description of config option header and associated data -// -typedef struct _L2CAP_CONFIG_OPTION { - // - // Header - // - CO_HEADER Header; - - // - // Valid if Flags == CO_DYNAMIC - // - VOID UNALIGNED *DynamicBuffer; - - // - // Valid if Flags == CO_FIXED - // - UCHAR FixedBuffer[4]; - - // - // Combo of CO_XXX flags - // - USHORT Flags; - -} L2CAP_CONFIG_OPTION, *PL2CAP_CONFIG_OPTION; - - - -typedef struct _CHANNEL_CONFIG_PARAMETERS { - // - // Combination of CFG_XXX flags - // - ULONG Flags; - - // - // MTU for the direction - // - CO_MTU Mtu; - - // - // Flush timeout for the direction - // - CO_FLUSHTO FlushTO; - - // - // Number of elements in the ExtraOptions array - // - ULONG NumExtraOptions; - - // - // Array of extra options - // - PL2CAP_CONFIG_OPTION ExtraOptions; - - // - // QOS for the direction - // - L2CAP_FLOWSPEC Flow; - -} CHANNEL_CONFIG_PARAMETERS, *PCHANNEL_CONFIG_PARAMETERS; - -typedef struct _CHANNEL_CONFIG_RESULTS { - // - // Channel parameters for the given direction of the channel - // - CHANNEL_CONFIG_PARAMETERS Params; - - // - // Amout of buffer required to retrieve the current extra options - // for the given direction - // - ULONG ExtraOptionsBufferSize; - -} CHANNEL_CONFIG_RESULTS, *PCHANNEL_CONFIG_RESULTS; - -typedef enum _INDICATION_CODE { - IndicationAddReference = 0, - IndicationReleaseReference, - IndicationRemoteConnect, - IndicationRemoteDisconnect, - IndicationRemoteConfigRequest, - IndicationRemoteConfigResponse, - IndicationFreeExtraOptions, - IndicationRecvPacket, - IndicationPairDevice, - IndicationUnpairDevice, - IndicationUnpersonalizeDevice, -} INDICATION_CODE, *PINDICATION_CODE; - -// -// Reasons why a channel has been disconnected -// -typedef enum _L2CAP_DISCONNECT_REASON { - HciDisconnect = 0, - L2capDisconnectRequest, - RadioPoweredDown, - HardwareRemoval, -} L2CAP_DISCONNECT_REASON; - - -typedef struct _INDICATION_PARAMETERS { - - L2CAP_CHANNEL_HANDLE ConnectionHandle; - - IN BTH_ADDR BtAddress; - - union { - - // - // IndicationConnect - // - struct { - struct { - OUT USHORT PSM; - } Request; - } Connect; - - struct { - // - // The currently agreed upon parameters for the channel. Only valid - // if the channel was previously open and is now in config. - // - CHANNEL_CONFIG_PARAMETERS CurrentParams; - - // - // The parameters passed from the remote host for config request - // - CHANNEL_CONFIG_PARAMETERS RequestedParams; - - // - // In Response != CONFIG_STATUS_SUCCESS, then this parameter will - // contain the parameters that are appropriate for the response - // code. ResponseParams::Flags controls which parameters are sent - // across the wire. - // - // If CFG_EXTRA is set, the client will be called back with - // IndicationFreeExtraOptions after the options are no longer - // needed. - // - CHANNEL_CONFIG_PARAMETERS ResponseParams; - - // - // A CONFIG_STATUS_XXX value - // - USHORT Response; - - } ConfigRequest; - - struct { - // - // The currently agreed upon parameters for the channel. Only valid - // if the channel was previously open and is now in config. - // - CHANNEL_CONFIG_PARAMETERS CurrentParams; - - // - // The parameters that were sent across the wire previously - // - CHANNEL_CONFIG_PARAMETERS RequestedParams; - - // - // The parameters that were rejected by the remote host - // - CHANNEL_CONFIG_PARAMETERS RejectedParams; - - PCO_TYPE UnknownTypes; - - ULONG NumUnknownTypes; - - CHANNEL_CONFIG_PARAMETERS NewRequestParams; - - // - // Will be either CONFIG_STATUS_UNKNOWN_OPTION or - // CONFIG_STATUS_INVALID_PARAMETER. Upon return from the call, - // if the value is CONFIG_STATUS_SUCCESS, NewRequestParams are sent - // across the wire, otherwise the connection is torn down. - // - USHORT Response; - - } ConfigResponse; - - struct { - ULONG NumExtraOptions; - - // - // Array of extra options - // - PL2CAP_CONFIG_OPTION ExtraOptions; - } FreeExtraOptions; - - struct { - L2CAP_DISCONNECT_REASON Reason; - BOOLEAN CloseNow; - } Disconnect; - - struct { - ULONG PacketLength; - ULONG TotalQueueLength; - } RecvPacket; - - } Parameters; - -} INDICATION_PARAMETERS, *PINDICATION_PARAMETERS; - -// -// Caller wants to know about the device being unpaired -// -#define INDICATION_PAIR_DEVICE (0x00000001) -#define INDICATION_UNPAIR_DEVICE (0x00000002) -#define INDICATION_UNPERSONALIZE_DEVICE (0x00000004) - - -struct _BRB_L2CA_REGISTER_SERVER { - - // - // Common BRB header - // - BRB_HEADER Hdr; - - BTH_ADDR BtAddress; - USHORT PSM; - ULONG IndicationFlags; - PFNBTHPORT_INDICATION_CALLBACK IndicationCallback; - PVOID IndicationCallbackContext; - - // - // Object to be passed to ObReferenceObject, ObDereferenceObject. - // The client provides this ReferenceObject in such a way that the port - // driver can take a reference on the client driver for as long as - // it has the opportunity to call the IndicationCallback function pointer. The client - // driver can have its reference released by calling the RemoveIndicationCallback - // routine. - // - PVOID ReferenceObject; - - // - // [OUT] Set by BTHPORT upon a successful set of the server interface. The - // client should send a BRB_L2CA_UNREGISTER_SERVER when it - // no longer wants to receive remote connect indications (ie, when it - // receives a PNP rmeove for instance). The client should pass back - // the ServerHandle as part of the BRB_L2CA_UNREGISTER_SERVER - // structure. - // - OUT L2CAP_SERVER_HANDLE ServerHandle; -}; - -struct _BRB_L2CA_UNREGISTER_SERVER { - - // - // Common BRB header - // - BRB_HEADER Hdr; - - BTH_ADDR BtAddress; - PVOID ServerHandle; - USHORT Psm; -}; - -struct _BRB_L2CA_OPEN_CHANNEL { - // - // Common BRB header - // - BRB_HEADER Hdr; - - // - // [IN/OUT] handle used to ID the connection upon a successful connect. - // When sending a BRB_L2CA_OPEN_CHANNEL, this will be filled in when the BRB - // complets. When sending a BRB_L2CA_OPEN_CHANNEL_RESPONSE, this must be - // filled in by the server before sending down the BRB. The value assigned - // should be INDICATION_PARAMETERS::ConnectionHandle which was passed in - // during IndicationRemoteConnect. - // - L2CAP_CHANNEL_HANDLE ChannelHandle; - - union { - struct { - // - // [IN] Used only with BRB_L2CA_OPEN_CHANNEL_RESPONSE. One of the - // CONNECT_RSP_RESULT_Xxx values is used. - // - // [OUT] If the BRB returns with a status of - // STATUS_REQUEST_NOT_ACCEPTED, then Response will contain the - // negative response from the remote host. - // - USHORT Response; - - // - // [IN] if Response is equal to CONNECT_RSP_RESULT_PENDING, then - // this field is valid. One of the CONNECT_RSP_STATUS_XXX values - // is used. - // - USHORT ResponseStatus; - }; - - // - // [IN] Used only with BRB_L2CA_OPEN_CHANNEL. Channel the connection - // is intended for. - // - USHORT Psm; - }; - - // - // [IN] Combination of CF_XXX flags - // - ULONG ChannelFlags; - - // - // [IN] Address of the device the connection is intended for - // - BTH_ADDR BtAddress; - - // - // Parameters specifying outbound request to remote host - // - struct { - // - // Combination of CFG_XXX flags - // - ULONG Flags; - - // - // Range for MTU - // - L2CAP_CONFIG_VALUE_RANGE Mtu; - - // - // Range for Flush timeout - // - L2CAP_CONFIG_VALUE_RANGE FlushTO; - - // - // QOS data structure - // - L2CAP_FLOWSPEC Flow; - - // - // LM Link timeout - // - USHORT LinkTO; - - // - // How many elements are in the ExtraOptions array - // - ULONG NumExtraOptions; - - // - // Array of extra options - // - PL2CAP_CONFIG_OPTION ExtraOptions; - - struct { - // - // Must be L2CAP_FLOW_SERVICE_TYPE_GUARANTEED - // - UCHAR ServiceType; - - // - // Latency in microseconds - // - ULONG Latency; - } LocalQos; - } ConfigOut; - - // - // Parameters specifying how to validate inbound requests - // - struct { - // - // Combination of CFG_XXX flags - // - ULONG Flags; - - // - // Range for MTU - // - L2CAP_CONFIG_VALUE_RANGE Mtu; - - // - // Range for Flush timeout - // - L2CAP_CONFIG_RANGE FlushTO; - - } ConfigIn; - - // - // Combo of CALLBACK_Xxx flags - // - ULONG CallbackFlags; - - // - // Callback supplied by client - // - PFNBTHPORT_INDICATION_CALLBACK Callback; - - // - // Context passed to callback - // - PVOID CallbackContext; - - // - // Object to be passed to ObReferenceObject, ObDereferenceObject. - // If a callback is requested, this parameter is not optional. - // - PVOID ReferenceObject; - - // - // [OUT] Configuration parameters for the outbound direction. - // - CHANNEL_CONFIG_RESULTS OutResults; - - // - // [OUT] Configuration parametesr ofr the inbound direction - // - CHANNEL_CONFIG_RESULTS InResults; - - UCHAR IncomingQueueDepth; -}; - -// -// This request will close the L2cap connection specified by the connection -// handle. -// -struct _BRB_L2CA_CLOSE_CHANNEL { - // - // BRB header - // - BRB_HEADER Hdr; - - // - // [IN] Address of the remote device - // - BTH_ADDR BtAddress; - - // - // [IN] L2cap connection handle provided by port - // - L2CAP_CHANNEL_HANDLE ChannelHandle; -}; - -// -// This request will sumbit a data buffer by the client to be filled/transmitted -// from/to the open channel associated with the ChannelHandle. -// -// The client driver can provide either an MDL ptr or PVOID pointer. The -// BufferSize parameter will be updated upon completion of this request to -// reflect the total bytes read if BTHPORT_SHORT_TRANSFER_OK flag was set. -// Otherwise the port driver will return an error. -// - - -// -// ACL write -// -#define ACL_TRANSFER_DIRECTION_OUT (0x00000000) - -// -// ACl read -// -#define ACL_TRANSFER_DIRECTION_IN (0x00000001) - -// -// Set for L2cap read BRB if the received buffer from remote device is less -// than the submitted buffer size. -// -#define ACL_SHORT_TRANSFER_OK (0x00000002) - -// -// Set if the client desires to have the read timeout after a period of time. -// -#define ACL_TRANSFER_TIMEOUT (0x00000004) - - -struct _BRB_L2CA_ACL_TRANSFER { - // BRB header - BRB_HEADER Hdr; - - // - // [IN] Address of the remote device - // - BTH_ADDR BtAddress; - - // - // [IN] L2cap connection handle provided by port - // - L2CAP_CHANNEL_HANDLE ChannelHandle; - - // - // [IN] Combination of ACL_TRANSFER_XXX and ACL_SHORT_TRANSFER_OK flags. - // - ULONG TransferFlags; - - // - // [IN/OUT] Length of buffer in bytes. - // - ULONG BufferSize; - - // - // [IN] buffer ptr. should be NULL if BufferMDL is used. - // - PVOID Buffer; - - // - // [IN] MDL buffer ptr. should be NULL if Buffer id used. - // - PMDL BufferMDL; - - // - // [IN] time in milliseconds before read is cancelled with any data - // consumed so far - // - LONGLONG Timeout; - - // - // [OUT] how much buffer remains if there is buffer underrun - // - ULONG RemainingBufferSize; -}; - -// -// HCI GENERAL Requests -// - -// -// This request will return the address of the local radio -// -struct _BRB_GET_LOCAL_BD_ADDR { - // BRB header - BRB_HEADER Hdr; - - // - // Address of local radio. - // - BTH_ADDR BtAddress; -}; - -struct _BRB_GET_DEVICE_INTERFACE_STRING { - // - // BRB header - // - BRB_HEADER Hdr; - - // - // Pointer to the buffer that will contain the string - // - PWCHAR DeviceInterfaceString; - - // - // IN Length in *bytes* of the string - // - - // OUT if length is too small, STATUS_MORE_ENTRIES is returned and - // this field contains the required number of bytes - // - // upon success, the number of bytes copied. - // - ULONG DeviceInterfaceStringCbLength; -}; - -struct _BRB_L2CA_PING { - // - // BRB header - // - BRB_HEADER Hdr; - - // - // [IN] Device that the ping is sent to - // - BTH_ADDR BtAddress; - - // [IN] lenth and data to send in the PING signal - UCHAR PingRequestLength; - UCHAR PingRequestData[MAX_L2CAP_PING_DATA_LENGTH]; - - // [OUT] length and data that the remote device responded with - UCHAR PingResponseLength; - UCHAR PingResponseData[MAX_L2CAP_PING_DATA_LENGTH]; -}; - -struct _BRB_L2CA_UPDATE_CHANNEL { - // - // BRB header - // - BRB_HEADER Hdr; - - // - // [IN] Address of the remote device - // - BTH_ADDR BtAddress; - - // - // [IN] L2cap connection handle provided by port - // - L2CAP_CHANNEL_HANDLE ChannelHandle; - - // - // The new flags that are required for the channel - // - ULONG NewChannelFlags; - - // - // If the BRB fails, this will indicate which NewChannelFlags BTHPORT was - // not able to honor. - // - ULONG FailedChannelFlags; -}; - - -/*++ - -Description: - -Send this BRB to register or unregister dynamic PSM values. Clients can -indicate their preference for a PSM value by specifying the PSM value in -_BRB_PSM.Psm. If the client has no preference, set _BRB_PSM.Psm to 0, and then -bthport will assign next avaliable PSM. On successful completion of the BRB, -_BRB_PSM.Psm will contain the assigned PSM value. - -Return value: - -STATUS_SUCCESS -STATUS_INVALID_BUFFER_SIZE BrbSize is invalid -STATUS_INVALID_PARAMETER PSM not in dynamic range -STATUS_INSUFFICIENT_RESOURCES alloc failed -STATUS_INVALID_CID Client owns this PSM -STATUS_ALREADY_COMMITTED PSM not avaliable -STATUS_CONNECTION_IN_USE PSM in use, cannot unregister - - --*/ - -struct _BRB_PSM { - // - // BRB header - // - BRB_HEADER Hdr; - - // - // The PSM that the client wants to register for - // - USHORT Psm; -}; - -// -// List of possible states of the ACL. -// -typedef enum _ACL_MODE { - ACL_MODE_ACTIVE = 0x0, // Defined in Blutooth Specification - ACL_MODE_HOLD = 0x1, // Defined in Blutooth Specification - ACL_MODE_SNIFF = 0x2, // Defined in Blutooth Specification - ACL_MODE_PARK = 0x3, // Defined in Blutooth Specification - ACL_MODE_ENTER_ACTIVE = 0x4, // About to enter Active mode. - ACL_MODE_ENTER_HOLD = 0x5, // About to enter Hold mode. - ACL_MODE_ENTER_SNIFF = 0x6, // About to enter Sniff mode. - ACL_MODE_ENTER_PARK = 0x7, // About to enter Park mode. - ACL_DISCONNECTED = 0x8, // Disconnected or sent Disconnect. -} ACL_MODE; - -// -// BRB to get the ACL mode for the specified remote device. -// -struct _BRB_ACL_GET_MODE { - // - // BRB header. - // - BRB_HEADER Hdr; - - // - // [IN] Address of the remote device. - // - BTH_ADDR BtAddress; - - // - // [OUT] The ACL mode. - // - ACL_MODE AclMode; -}; - -// -// BRB to put the specified ACL into active mode. -// This BRB will fail if: -// (1) the connection is disconnected or is about to be disconnected. -// (2) the connection is in 'hold' mode. -// -struct _BRB_ACL_ENTER_ACTIVE_MODE { - // - // BRB header. - // - BRB_HEADER Hdr; - - // - // [IN] Address of the remote device. - // - BTH_ADDR BtAddress; -}; - -#ifndef BRBTYPE - -// -// Bluetooth Request Block -// -typedef struct _BRB { - union { - struct _BRB_HEADER BrbHeader; - struct _BRB_GET_DEVICE_INTERFACE_STRING BrbGetDeviceInterfaceString; - struct _BRB_L2CA_REGISTER_SERVER BrbL2caRegisterServer; - struct _BRB_L2CA_UNREGISTER_SERVER BrbL2caUnregisterServer; - struct _BRB_L2CA_OPEN_CHANNEL BrbL2caOpenChannel; - struct _BRB_L2CA_CLOSE_CHANNEL BrbL2caCloseChannel; - struct _BRB_L2CA_PING BrbL2caPing; - struct _BRB_L2CA_ACL_TRANSFER BrbL2caAclTransfer; - struct _BRB_GET_LOCAL_BD_ADDR BrbGetLocalBdAddress; - struct _BRB_PSM BrbPsm; - struct _BRB_L2CA_UPDATE_CHANNEL BrbL2caUpdateChannel; - struct _BRB_SCO_REGISTER_SERVER BrbScoRegisterServer; - struct _BRB_SCO_UNREGISTER_SERVER BrbScoUnregisterServer; - struct _BRB_SCO_OPEN_CHANNEL BrbScoOpenChannel; - struct _BRB_SCO_CLOSE_CHANNEL BrbScoCloseChannel; - struct _BRB_SCO_FLUSH_CHANNEL BrbScoFlushChannel; - struct _BRB_SCO_TRANSFER BrbScoTransfer; - struct _BRB_SCO_GET_CHANNEL_INFO BrbScoGetChannelInfo; - struct _BRB_SCO_GET_SYSTEM_INFO BrbScoGetSystemInfo; - struct _BRB_ACL_GET_MODE BrbAclGetMode; - struct _BRB_ACL_ENTER_ACTIVE_MODE BrbAclEnterActiveMode; - }; -} BRB, *PBRB; - -// -// BthAllocateBrb -// -// Purpose: -// Allocates a Brb of a given type -// -// Returns: -// Brb pointer or NULL if the system is out of memory -// -// Note this function is not exported on 1.x bluetooth versions -// -__drv_sameIRQL -__checkReturn -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef -PBRB -(*PFNBTH_ALLOCATE_BRB)( - __in BRB_TYPE brbType, - __in ULONG tag); - - -// -// BthFreeBrb -// -// Purpose: -// Free a Brb -// -// Returns: -// Nothing -// -// Note this function is not exported on 1.x bluetooth versions -// -__drv_sameIRQL -typedef -VOID -(*PFNBTH_FREE_BRB)( - __in __drv_freesMem(Mem) PBRB pBrb); - -// -// BthInitializeBrb -// -// Purpose: -// This is used to Initialize stack allocated Brbs. -// -// Returns: -// Nothing -// -// Note this function is not exported on 1.x bluetooth versions -// -__drv_sameIRQL -typedef -VOID -(*PFNBTH_INITIALIZE_BRB)( - __inout PBRB pBrb, - __in BRB_TYPE brbType); - -// -// BthReuseBrb -// -// Purpose: -// This function is use to reinitialize brb for -// reuse. -// -// Returns: -// Nothing -// -// Note this function is not exported on 1.x bluetooth versions -// -__drv_sameIRQL -typedef -VOID -(*PFNBTH_REUSE_BRB)( - __inout PBRB pBrb, - __in BRB_TYPE brbType); - -// -// IsBluetoothVersionAvailable -// -// Purpose: -// Indicate if the installed Bluetooth binary set supports -// the requested version -// -// Returns: -// TRUE if the installed bluetooth binaries support the given -// Major & Minor versions -// -// Note this function is not exported on 1.x bluetooth versions -// -__drv_sameIRQL -__checkReturn -typedef -BOOLEAN -(* PFNBTH_IS_BLUETOOTH_VERSION_AVAILABLE)(__in UCHAR MajorVersion, __in UCHAR MinorVersion); - -// -// Bluetooth QI Profile driver interface -// -// -// Profile drivers should register with this QI in order to get function pointers -// for allocating and freeing Brb. All Brb should be allocated or Initialized using -// these utilities. -// -// MajorFunction = IRP_MJ_PNP; -// MinorFunction = IRP_MN_QUERY_INTERFACE; -// -// {94A59AA8-4383-4286-AA4F-34A160F40004} -// DEFINE_GUID(GUID_BTHDDI_PROFILE_DRIVER_INTERFACE, -// 0x94a59aa8, 0x4383, 0x4286, 0xaa, 0x4f, 0x34, 0xa1, 0x60, -// 0xf4, 0x0, 0x4); -// -// -// The QUERY_INTERFACE Irp will provide the profile driver a set of function -// pointers for Brb allocation/frees and to verify if a Bluetooth version is available. -// -// Note this function is not exported on 1.x bluetooth versions -// -typedef struct _BTH_PROFILE_DRIVER_INTERFACE { - INTERFACE Interface; - // - // Use this function to allocate Brb - // - OUT PFNBTH_ALLOCATE_BRB BthAllocateBrb; - - // - // Use this function to free Brb allocated with BthAllocateBrb - // - OUT PFNBTH_FREE_BRB BthFreeBrb; - - // - // Use this function to initialize stack allocated Brbs - // - OUT PFNBTH_INITIALIZE_BRB BthInitializeBrb; - - // - // Use this function to reinitialize Brb for reuse - // - OUT PFNBTH_REUSE_BRB BthReuseBrb; - - // - // Indicates if the installed Bluetooth binary set supports the requested version - // - OUT PFNBTH_IS_BLUETOOTH_VERSION_AVAILABLE IsBluetoothVersionAvailable; -}BTH_PROFILE_DRIVER_INTERFACE, *PBTH_PROFILE_DRIVER_INTERFACE; - -#endif - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - -#endif // __BTHDDI_H__ - diff --git a/qt-correction-tool/pub/ddk/bthguid.h b/qt-correction-tool/pub/ddk/bthguid.h deleted file mode 100644 index afce682..0000000 --- a/qt-correction-tool/pub/ddk/bthguid.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef __BTHGUID_H__ -#define __BTHGUID_H__ - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// 81A7FDF3-86C1-4BE8-A8C8-2A6D188B4177 -DEFINE_GUID(GUID_BTHDDI_SDP_NODE_INTERFACE, 0x81a7fdf3, 0x86c1, 0x4be8, 0xa8, 0xc8, 0x2a, 0x6d, 0x18, 0x8b, 0x41, 0x77); - -// 4E719439-9CF1-4BAB-AC1D-3279865743D2 -DEFINE_GUID(GUID_BTHDDI_SDP_PARSE_INTERFACE, 0x4e719439, 0x9cf1, 0x4bab, 0xac, 0x1d, 0x32, 0x79, 0x86, 0x57, 0x43, 0xd2); - -// {94A59AA8-4383-4286-AA4F-34A160F40004} -DEFINE_GUID(GUID_BTHDDI_PROFILE_DRIVER_INTERFACE, 0x94a59aa8, 0x4383, 0x4286, 0xaa, 0x4f, 0x34, 0xa1, 0x60, 0xf4, 0x0, 0x4); - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#endif // __BTHGUID_H__ - diff --git a/qt-correction-tool/pub/ddk/bthioctl.h b/qt-correction-tool/pub/ddk/bthioctl.h deleted file mode 100644 index eafc212..0000000 --- a/qt-correction-tool/pub/ddk/bthioctl.h +++ /dev/null @@ -1,609 +0,0 @@ -/**************************************************************************** - -Copyright (c) 2000 Microsoft Corporation - -Module Name: - - bthioctl.h - -Abstract: - - defines the IOCTL codes for the kernel/user calls - -Environment: - - Kernel & user mode - -Revision History: - - 4-4-00 : created by Husni Roukbi - 2-4-05 : split into public and private header files by SandySp - -****************************************************************************/ -#ifndef __BTHIOCTL_H__ -#define __BTHIOCTL_H__ - - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - -#if (NTDDI_VERSION >= NTDDI_VISTA) - - -#ifndef CTL_CODE - #pragma message("CTL_CODE undefined. Include winioctl.h or wdm.h") -#endif - -// -// IOCTL defines. -// -#define BTH_IOCTL_BASE 0 - -#define BTH_CTL(id) CTL_CODE(FILE_DEVICE_BLUETOOTH, \ - (id), \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - -#define BTH_KERNEL_CTL(id) CTL_CODE(FILE_DEVICE_BLUETOOTH, \ - (id), \ - METHOD_NEITHER, \ - FILE_ANY_ACCESS) - -// -// kernel-level (internal) IOCTLs -// -#define IOCTL_INTERNAL_BTH_SUBMIT_BRB BTH_KERNEL_CTL(BTH_IOCTL_BASE+0x00) - -// -// Input: none -// Output: BTH_ENUMERATOR_INFO -// -#define IOCTL_INTERNAL_BTHENUM_GET_ENUMINFO BTH_KERNEL_CTL(BTH_IOCTL_BASE+0x01) - -// -// Input: none -// Output: BTH_DEVICE_INFO -// -#define IOCTL_INTERNAL_BTHENUM_GET_DEVINFO BTH_KERNEL_CTL(BTH_IOCTL_BASE+0x02) - -// -// IOCTLs -// -// -// Input: none -// Output: BTH_LOCAL_RADIO_INFO -// -#define IOCTL_BTH_GET_LOCAL_INFO BTH_CTL(BTH_IOCTL_BASE+0x00) - -// -// Input: BTH_ADDR -// Output: BTH_RADIO_INFO -// -#define IOCTL_BTH_GET_RADIO_INFO BTH_CTL(BTH_IOCTL_BASE+0x01) - -// -// use this ioctl to get a list of cached discovered devices in the port driver. -// -// Input: None -// Output: BTH_DEVICE_INFO_LIST -// -#define IOCTL_BTH_GET_DEVICE_INFO BTH_CTL(BTH_IOCTL_BASE+0x02) - -// -// Input: BTH_ADDR -// Output: none -// -#define IOCTL_BTH_DISCONNECT_DEVICE BTH_CTL(BTH_IOCTL_BASE+0x03) - -#if (NTDDI_VERSION > NTDDI_VISTASP1 || \ - (NTDDI_VERSION == NTDDI_VISTASP1 && defined(VISTA_KB942567))) - -#ifdef FULL_EIR_SUPPORT // in WUR this funcitonality is disabled -// -// Input: BTH_GET_DEVICE_RSSI -// Output: ULONG -// -#define IOCTL_BTH_GET_DEVICE_RSSI BTH_CTL(BTH_IOCTL_BASE+0x05) - -// -// Input: BTH_EIR_GET_RECORDS -// Output: UCHAR array, sequence of length + type + data fields triplets. -// -#define IOCTL_BTH_EIR_GET_RECORDS BTH_CTL(BTH_IOCTL_BASE+0x10) - -// -// Input: BTH_EIR_SUBMIT_RECORD -// Output HANDLE -// -#define IOCTL_BTH_EIR_SUBMIT_RECORD BTH_CTL(BTH_IOCTL_BASE+0x11) - -// -// Input: BTH_EIR_SUBMIT_RECORD -// Output None -// -#define IOCTL_BTH_EIR_UPDATE_RECORD BTH_CTL(BTH_IOCTL_BASE+0x12) - -// -// Input: HANDLE -// Output: None -// -#define IOCTL_BTH_EIR_REMOVE_RECORD BTH_CTL(BTH_IOCTL_BASE+0x13) - -#endif // FULL_EIR_SUPPORT - -// -// Input: BTH_VENDOR_SPECIFIC_COMMAND -// Output: PVOID -// -#define IOCTL_BTH_HCI_VENDOR_COMMAND BTH_CTL(BTH_IOCTL_BASE+0x14) - -#endif // >= SP1+KB942567 - -// -// Input: BTH_SDP_CONNECT -// Output: BTH_SDP_CONNECT -// -#define IOCTL_BTH_SDP_CONNECT BTH_CTL(BTH_IOCTL_BASE+0x80) - -// -// Input: HANDLE_SDP -// Output: none -// -#define IOCTL_BTH_SDP_DISCONNECT BTH_CTL(BTH_IOCTL_BASE+0x81) - -// -// Input: BTH_SDP_SERVICE_SEARCH_REQUEST -// Output: ULONG * number of handles wanted -// -#define IOCTL_BTH_SDP_SERVICE_SEARCH BTH_CTL(BTH_IOCTL_BASE+0x82) - -// -// Input: BTH_SDP_ATTRIBUTE_SEARCH_REQUEST -// Output: BTH_SDP_STREAM_RESPONSE or bigger -// -#define IOCTL_BTH_SDP_ATTRIBUTE_SEARCH BTH_CTL(BTH_IOCTL_BASE+0x83) - -// -// Input: BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST -// Output: BTH_SDP_STREAM_RESPONSE or bigger -// -#define IOCTL_BTH_SDP_SERVICE_ATTRIBUTE_SEARCH \ - BTH_CTL(BTH_IOCTL_BASE+0x84) - -// -// Input: raw SDP stream (at least 2 bytes) -// Ouptut: HANDLE_SDP -// -#define IOCTL_BTH_SDP_SUBMIT_RECORD BTH_CTL(BTH_IOCTL_BASE+0x85) - -// -// Input: HANDLE_SDP -// Output: none -// -#define IOCTL_BTH_SDP_REMOVE_RECORD BTH_CTL(BTH_IOCTL_BASE+0x86) - -// -// Input: BTH_SDP_RECORD + raw SDP record -// Output: HANDLE_SDP -// -#define IOCTL_BTH_SDP_SUBMIT_RECORD_WITH_INFO BTH_CTL(BTH_IOCTL_BASE+0x87) - -#include - -typedef struct _BTH_DEVICE_INFO_LIST { - // - // [IN/OUT] minimum of 1 device required - // - ULONG numOfDevices; - - // - // Open ended array of devices; - // - BTH_DEVICE_INFO deviceList[1]; - -} BTH_DEVICE_INFO_LIST, *PBTH_DEVICE_INFO_LIST; - -typedef struct _BTH_RADIO_INFO { - // - // Supported LMP features of the radio. Use LMP_XXX() to extract - // the desired bits. - // - ULONGLONG lmpSupportedFeatures; - - // - // Manufacturer ID (possibly BTH_MFG_XXX) - // - USHORT mfg; - - // - // LMP subversion - // - USHORT lmpSubversion; - - // - // LMP version - // - UCHAR lmpVersion; - -} BTH_RADIO_INFO, *PBTH_RADIO_INFO; - -typedef struct _BTH_LOCAL_RADIO_INFO { - // - // Local BTH_ADDR, class of defice, and radio name - // - BTH_DEVICE_INFO localInfo; - - // - // Combo of LOCAL_RADIO_XXX values - // - ULONG flags; - - // - // HCI revision, see core spec - // - USHORT hciRevision; - - // - // HCI version, see core spec - // - UCHAR hciVersion; - - // - // More information about the local radio (LMP, MFG) - // - BTH_RADIO_INFO radioInfo; - -} BTH_LOCAL_RADIO_INFO, *PBTH_LOCAL_RADIO_INFO; - - -#define SDP_CONNECT_CACHE (0x00000001) -#define SDP_CONNECT_ALLOW_PIN (0x00000002) - -#define SDP_REQUEST_TO_DEFAULT (0) -#define SDP_REQUEST_TO_MIN (10) -#define SDP_REQUEST_TO_MAX (45) - -#define SERVICE_OPTION_DO_NOT_PUBLISH (0x00000002) -#define SERVICE_OPTION_NO_PUBLIC_BROWSE (0x00000004) -#define SERVICE_OPTION_DO_NOT_PUBLISH_EIR (0x00000008) - -#define SERVICE_SECURITY_USE_DEFAULTS (0x00000000) -#define SERVICE_SECURITY_NONE (0x00000001) -#define SERVICE_SECURITY_AUTHORIZE (0x00000002) -#define SERVICE_SECURITY_AUTHENTICATE (0x00000004) -#define SERVICE_SECURITY_ENCRYPT_REQUIRED (0x00000010) -#define SERVICE_SECURITY_ENCRYPT_OPTIONAL (0x00000020) -#define SERVICE_SECURITY_DISABLED (0x10000000) -#define SERVICE_SECURITY_NO_ASK (0x20000000) - -// -// Do not attempt to validate that the stream can be parsed -// -#define SDP_SEARCH_NO_PARSE_CHECK (0x00000001) - -// -// Do not check the format of the results. This includes suppression of both -// the check for a record patten (SEQ of UINT16 + value) and the validation -// of each universal attribute's accordance to the spec. -// -#define SDP_SEARCH_NO_FORMAT_CHECK (0x00000002) - - -typedef ULONGLONG HANDLE_SDP, *PHANDLE_SDP; -#define HANDLE_SDP_NULL ((HANDLE_SDP) 0x0) -#define HANDLE_SDP_LOCAL ((HANDLE_SDP) -2) - -typedef struct _BTH_SDP_CONNECT { - // - // Address of the remote SDP server. Cannot be the local radio. - // - BTH_ADDR bthAddress; - - // - // Combination of SDP_CONNECT_XXX flags - // - ULONG fSdpConnect; - - // - // When the connect request returns, this will specify the handle to the - // SDP connection to the remote server - // - HANDLE_SDP hConnection; - - // - // Timeout, in seconds, for the requests on ths SDP channel. If the request - // times out, the SDP connection represented by the HANDLE_SDP must be - // closed. The values for this field are bound by SDP_REQUEST_TO_MIN and - // SDP_REQUEST_MAX. If SDP_REQUEST_TO_DEFAULT is specified, the timeout is - // 30 seconds. - // - UCHAR requestTimeout; - -} BTH_SDP_CONNECT, *PBTH_SDP_CONNECT; - -typedef struct _BTH_SDP_DISCONNECT { - // - // hConnection returned by BTH_SDP_CONNECT - // - HANDLE_SDP hConnection; - -} BTH_SDP_DISCONNECT, *PBTH_SDP_DISCONNECT; - - -typedef struct _BTH_SDP_RECORD { - // - // Combination of SERVICE_SECURITY_XXX flags - // - ULONG fSecurity; - - // - // Combination of SERVICE_OPTION_XXX flags - // - ULONG fOptions; - - // - // combo of COD_SERVICE_XXX flags - // - ULONG fCodService; - - // - // The length of the record array, in bytes. - // - ULONG recordLength; - - // - // The SDP record in its raw format - // - UCHAR record[1]; - -} BTH_SDP_RECORD, *PBTH_SDP_RECORD; - -typedef struct _BTH_SDP_SERVICE_SEARCH_REQUEST { - // - // Handle returned by the connect request or HANDLE_SDP_LOCAL - // - HANDLE_SDP hConnection; - - // - // Array of UUIDs. Each entry can be either a 2 byte, 4 byte or 16 byte - // UUID. SDP spec mandates that a request can have a maximum of 12 UUIDs. - // - SdpQueryUuid uuids[MAX_UUIDS_IN_QUERY]; - -} BTH_SDP_SERVICE_SEARCH_REQUEST, *PBTH_SDP_SERVICE_SEARCH_REQUEST; - -typedef struct _BTH_SDP_ATTRIBUTE_SEARCH_REQUEST { - // - // Handle returned by the connect request or HANDLE_SDP_LOCAL - // - HANDLE_SDP hConnection; - - // - // Combo of SDP_SEARCH_Xxx flags - // - ULONG searchFlags; - - // - // Record handle returned by the remote SDP server, most likely from a - // previous BTH_SDP_SERVICE_SEARCH_RESPONSE. - // - ULONG recordHandle; - - // - // Array of attributes to query for. Each SdpAttributeRange entry can - // specify either a single attribute or a range. To specify a single - // attribute, minAttribute should be equal to maxAttribute. The array must - // be in sorted order, starting with the smallest attribute. Furthermore, - // if a range is specified, the minAttribute must be <= maxAttribute. - // - SdpAttributeRange range[1]; - -} BTH_SDP_ATTRIBUTE_SEARCH_REQUEST, *PBTH_SDP_ATTRIBUTE_SEARCH_REQUEST; - -typedef struct _BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST { - // - // Handle returned by the connect request or HANDLE_SDP_LOCAL - // - HANDLE_SDP hConnection; - - // - // Combo of SDP_SEARCH_Xxx flags - // - ULONG searchFlags; - - // - // See comments in BTH_SDP_SERVICE_SEARCH_REQUEST - // - SdpQueryUuid uuids[MAX_UUIDS_IN_QUERY]; - - // - // See comments in BTH_SDP_ATTRIBUTE_SEARCH_REQUEST - // - SdpAttributeRange range[1]; - -} BTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST, - *PBTH_SDP_SERVICE_ATTRIBUTE_SEARCH_REQUEST; - -typedef struct _BTH_SDP_STREAM_RESPONSE { - // - // The required buffer size (not including the first 2 ULONG_PTRs of this - // data structure) needed to contain the response. - // - // If the buffer passed was large enough to contain the entire response, - // requiredSize will be equal to responseSize. Otherwise, the caller should - // resubmit the request with a buffer size equal to - // sizeof(BTH_SDP_STREAM_RESPONSE) + requiredSize - 1. (The -1 is because - // the size of this data structure already includes one byte of the - // response.) - // - // A response cannot exceed 4GB in size. - // - ULONG requiredSize; - - // - // The number of bytes copied into the response array of this data - // structure. If there is not enough room for the entire response, the - // response will be partially copied into the response array. - // - ULONG responseSize; - - // - // The raw SDP response from the serach. - // - UCHAR response[1]; - -} BTH_SDP_STREAM_RESPONSE, *PBTH_SDP_STREAM_RESPONSE; - -#if (NTDDI_VERSION > NTDDI_VISTASP1 || \ - (NTDDI_VERSION == NTDDI_VISTASP1 && defined(VISTA_KB942567))) - -// -// Vendor specific HCI command header -// -typedef struct _BTH_COMMAND_HEADER { - // - // Opcode for the command - // - USHORT OpCode; - - // - // Payload of the command excluding the header. - // TotalParameterLength = TotalCommandLength - sizeof(BTH_COMMAND_HEADER) - // - UCHAR TotalParameterLength; - -} BTH_COMMAND_HEADER, * PBTH_COMMAND_HEADER; - -// -// Vendor Specific Command structure -// -typedef struct _BTH_VENDOR_SPECIFIC_COMMAND { - // - // Manufacturer ID - // - ULONG ManufacturerId; - - // - // LMP version. Command is send to radio only if the radios - // LMP version is greater than this value. - // - UCHAR LmpVersion; - - // - // Should all the patterns match or just one. If MatchAnySinglePattern == TRUE - // then if a single pattern matches the command, we decide that we have a match. - // - BOOLEAN MatchAnySinglePattern; - - // - // HCI Command Header - // - BTH_COMMAND_HEADER HciHeader; - - // - // Data for the above command including patterns - // - UCHAR Data[1]; -} BTH_VENDOR_SPECIFIC_COMMAND, * PBTH_VENDOR_SPECIFIC_COMMAND; - -// -// Structure of patterns -// -typedef struct _BTH_VENDOR_PATTERN { - // - // Pattern Offset in the event structure excluding EVENT header - // - UCHAR Offset; - - // - // Size of the Pattern - // - UCHAR Size; - - // - // Pattern - // - UCHAR Pattern[1]; -} BTH_VENDOR_PATTERN, * PBTH_VENDOR_PATTERN; - - -// -//The buffer associated with GUID_BLUETOOTH_HCI_VENDOR_EVENT -// -typedef struct _BTH_VENDOR_EVENT_INFO { - // - //Local radio address with which the event is associated. - // - BTH_ADDR BthAddress; - - // - //Size of the event buffer including Event header - // - ULONG EventSize; - - // - //Information associated with the event - // - UCHAR EventInfo[1]; -} BTH_VENDOR_EVENT_INFO, * PBTH_VENDOR_EVENT_INFO; - - -// -// Extended Inquiry Response data defines. -// -typedef ULONGLONG HANDLE_EIR, *PHANDLE_EIR; -#define INVALID_HANDLE_EIR_VALUE ((HANDLE_EIR)((LONGLONG)-1)) - -typedef struct _BTH_EIR_GET_RECORDS { - // - // [IN] Device's Bluetooth address. For local device use BTH_ADDR_NULL. - // - BTH_ADDR BthAddress; - - // - // Reseved field (set to zero). - // - ULONG Reserved; - -} BTH_EIR_GET_RECORDS, *PBTH_EIR_GET_RECORDS; - -typedef struct _BTH_EIR_SUBMIT_RECORD { - // - // [IN/OUT] Record Handle. Set to INVALID_HANDLE_EIR_VALUE for submit. - // - HANDLE_EIR Handle; - - // - // Reserved field (set to zero). - // - ULONG Reserved; - - // - // [IN] Record size in bytes. - // - ULONG RecordSize; - - // - // [IN] The EIR record data array (data-type and data). - // - UCHAR Record[1]; - -} BTH_EIR_SUBMIT_RECORD, *PBTH_EIR_SUBMIT_RECORD; - -#endif // >= SP1+KB942567 - -#include - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - - -#endif // __BTHIOCTL_H__ - diff --git a/qt-correction-tool/pub/ddk/bthref.h b/qt-correction-tool/pub/ddk/bthref.h deleted file mode 100644 index b331f63..0000000 --- a/qt-correction-tool/pub/ddk/bthref.h +++ /dev/null @@ -1,49 +0,0 @@ -/*++ - -Copyright (c) 2005 Microsoft Corporation - -Module Name: - - BTHREF.H - -Abstract: - - Public structures used for object reference counting - -Environment: - - Kernel & user mode - -Revision History: - - --*/ - -#ifndef __BTHREF_H__ -#define __BTHREF_H__ - -// -// Added in Vista -// -#if (NTDDI_VERSION >= NTDDI_VISTA) - -typedef struct _REF_OBJ *PREF_OBJ; - -__drv_sameIRQL -typedef void (*PFNDESTROY)(__in PREF_OBJ); - -typedef struct _REF_OBJ_DEBUG_INFO *PREF_OBJ_DEBUG_INFO; - -typedef struct _REF_OBJ { - ULONG Count; - PFNDESTROY DestroyFunction; - PREF_OBJ_DEBUG_INFO DebugInfo; -#if DBG - ULONG Flags; -#endif -} REF_OBJ, *PREF_OBJ; - -#endif // >= VISTA - -#endif // __BTHREF_H__ - - diff --git a/qt-correction-tool/pub/ddk/bthsdpddi.h b/qt-correction-tool/pub/ddk/bthsdpddi.h deleted file mode 100644 index 2620921..0000000 --- a/qt-correction-tool/pub/ddk/bthsdpddi.h +++ /dev/null @@ -1,266 +0,0 @@ -#ifndef __BTHSDPDDI_H__ -#define __BTHSDPDDI_H__ - -#if (NTDDI_VERSION >= NTDDI_VISTA) - - -#ifdef __cplusplus -extern "C" { -#endif - -#define BTHDDI_SDP_PARSE_INTERFACE_VERSION_FOR_QI (0x0100) -#define BTHDDI_SDP_NODE_INTERFACE_VERSION_FOR_QI (0x0100) - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_TREE_ROOT_NODE (*PCREATENODETREEROOT)(__in ULONG tag); - -__drv_sameIRQL -typedef NTSTATUS (*PFREETREE)(__in __drv_freesMem(Mem) PSDP_TREE_ROOT_NODE Tree); - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PAPPENDNODETOCONTAINERNODE)(__in PSDP_NODE Container, - __in __drv_aliasesMem PSDP_NODE Node); - - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PADDATTRIBUTETOTREEE)(__in PSDP_TREE_ROOT_NODE Root, - __in USHORT AttribId, - __in __drv_aliasesMem PSDP_NODE AttribValueNode, - __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODENIL)(__in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEBOOLEAN)(__in UCHAR bVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUINT8)(__in UCHAR ucVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUINT16)(__in USHORT usVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUINT32)(__in ULONG ulVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUINT64)(__in ULONGLONG ullVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUINT128)(__in PSDP_ULARGE_INTEGER_16 puli16Val, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEINT8)(__in CHAR cVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEINT16)(__in SHORT sVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEINT32)(__in LONG lVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEINT64)(__in LONGLONG llVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEINT128)(__in PSDP_LARGE_INTEGER_16 pul16Val, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUUID16)(__in USHORT usVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUUID32)(__in ULONG ulVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEUUID128)(__in const GUID * pUuidVal, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODESTRING)(__in_bcount(stringLength) PCHAR string, __in ULONG stringLength, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEURL)(__in_bcount(urlLength) PCHAR url, __in ULONG urlLength, __in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODEALTERNATIVE)(__in ULONG tag); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -typedef PSDP_NODE (*PCREATENODESEQUENCE)(__in ULONG tag); - - -// -// GUID_BTHDDI_SDP_NODE_INTERFACE -// -typedef struct _BTHDDI_SDP_NODE_INTERFACE { - INTERFACE Interface; - - PCREATENODETREEROOT SdpCreateNodeTree; - PFREETREE SdpFreeTree; - - PCREATENODENIL SdpCreateNodeNil; - - PCREATENODEBOOLEAN SdpCreateNodeBoolean; - - PCREATENODEUINT8 SdpCreateNodeUint8; - PCREATENODEUINT16 SdpCreateNodeUint16; - PCREATENODEUINT32 SdpCreateNodeUint32; - PCREATENODEUINT64 SdpCreateNodeUint64; - PCREATENODEUINT128 SdpCreateNodeUint128; - - PCREATENODEINT8 SdpCreateNodeInt8; - PCREATENODEINT16 SdpCreateNodeInt16; - PCREATENODEINT32 SdpCreateNodeInt32; - PCREATENODEINT64 SdpCreateNodeInt64; - PCREATENODEINT128 SdpCreateNodeInt128; - - PCREATENODEUUID16 SdpCreateNodeUuid16; - PCREATENODEUUID32 SdpCreateNodeUuid32; - PCREATENODEUUID128 SdpCreateNodeUuid128; - - PCREATENODESTRING SdpCreateNodeString; - - PCREATENODEURL SdpCreateNodeUrl; - - PCREATENODEALTERNATIVE SdpCreateNodeAlternative; - PCREATENODESEQUENCE SdpCreateNodeSequence; - - PADDATTRIBUTETOTREEE SdpAddAttributeToTree; - PAPPENDNODETOCONTAINERNODE SdpAppendNodeToContainerNode; - -} BTHDDI_SDP_NODE_INTERFACE, *PBTHDDI_SDP_NODE_INTERFACE; - - - -__drv_sameIRQL -typedef void (*PBYTESWAPUUID128)(__in GUID *pUuidFrom, __out GUID *pUuiidTo); - -__drv_sameIRQL -typedef void (*PBYTESWAPUINT128)(__in PSDP_ULARGE_INTEGER_16 pInUint128, - __out PSDP_ULARGE_INTEGER_16 pOutUint128); - -__drv_sameIRQL -typedef ULONGLONG (*PBYTESWAPUINT64)(__in ULONGLONG uint64); - -__drv_sameIRQL -typedef void (*PRETRIEVEUUID128)(__in PUCHAR Stream, __out GUID *uuid128); - -__drv_sameIRQL -typedef void (*PRETRIEVEUINT128)(__in PUCHAR Stream, - __out PSDP_ULARGE_INTEGER_16 pUint128); - -__drv_sameIRQL -typedef void (*PRETRIEVEUINT64)(__in PUCHAR Stream, __out PULONGLONG pUint16); - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PVALIDATESTREAM)(__in_bcount(Size) PUCHAR Stream, - __in ULONG Size, - __out PULONG_PTR ErrorByte); - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PFINDATTRIBUTEINTREE)(__in PSDP_TREE_ROOT_NODE Tree, - __in USHORT AttribId, - __deref_out PSDP_NODE *AttribValue); - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PCONVERTTREETOSTREAM)(__in PSDP_TREE_ROOT_NODE Root, - __post __drv_when(return==0, __drv_allocatesMem(Mem)) PUCHAR *Stream, - __out PULONG Size, - __in ULONG tag); - -__checkReturn -__drv_sameIRQL -typedef NTSTATUS (*PCONVERTSTREAMTOTREE)(__in_bcount(Size) PUCHAR Stream, - __in ULONG Size, - __out PSDP_TREE_ROOT_NODE *Node, - __in ULONG tag); -__drv_sameIRQL -typedef VOID (*PGETNEXTELEMENT)(__in_bcount(StreamSize) PUCHAR Stream, - __in ULONG StreamSize, - __in PUCHAR CurrentElement, - __deref_out_bcount(*NextElementSize) PUCHAR* NextElement, - __out PULONG NextElementSize); - -typedef VOID (*pReservedFunction)(); - - -#ifndef __BTHSDPDDIP_H__ - -typedef struct _BTHDDI_SDP_PARSE_INTERFACE { - INTERFACE Interface; - - PVALIDATESTREAM SdpValidateStream; - - PCONVERTSTREAMTOTREE SdpConvertStreamToTree; - PCONVERTTREETOSTREAM SdpConvertTreeToStream; - PFREETREE SdpFreeTree; - PBYTESWAPUUID128 SdpByteSwapUuid128; - PBYTESWAPUINT128 SdpByteSwapUint128; - PBYTESWAPUINT64 SdpByteSwapUint64; - PRETRIEVEUUID128 SdpRetrieveUuid128; - PRETRIEVEUINT128 SdpRetrieveUint128; - PRETRIEVEUINT64 SdpRetrieveUint64; - PFINDATTRIBUTEINTREE SdpFindAttributeInTree; - PGETNEXTELEMENT SdpGetNextElement; - pReservedFunction Reserved1; - pReservedFunction Reserved2; - pReservedFunction Reserved3; - pReservedFunction Reserved4; -} BTHDDI_SDP_PARSE_INTERFACE, *PBTHDDI_SDP_PARSE_INTERFACE; - - - -#endif - - -#ifdef __cplusplus -} -#endif - - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#endif // __BTHSDPDDI_H__ - diff --git a/qt-correction-tool/pub/ddk/buffring.h b/qt-correction-tool/pub/ddk/buffring.h deleted file mode 100644 index 64e0f1b..0000000 --- a/qt-correction-tool/pub/ddk/buffring.h +++ /dev/null @@ -1,166 +0,0 @@ -/*++ BUILD Version: 0009 // Increment this if a change has global effects -Copyright (c) 1987-1993 Microsoft Corporation - -Module Name: - - buffring.h - -Abstract: - - This module defines the change buffering state requests related data structures in RDBSS. - -Author: -Notes: - - The buffering manager implementation consists of two primary data structures - (1) CHANGE_BUFFERING_STATE_REQUEST and (2) BUFFERING_MANAGER. - - The BUFFERING_MANAGER tracks and initiates actions on all change buffering state - requests generated by the various mini redirectors as well as the RDBSS. - - There are three lists associated with the buffering manager, i.e., the registration - list, the dispatcher list and the handler list. - - The registration list contains all the requests initiated for which no processing - has been done. All DPC level indications merely register the indication in this - list. The access to this list is protected by a spin lock(RxStrucsupSpinLock). - - The dispatcher list contains all the requests for which the lookup has not been - completed. This list is organized as a two tier list. The top level is based on - the NetRootKey. Each entry for a NetRootKey in this list has an associated cluster - of requests corresponding to the various SrvOpenKey's. This is the reason for - ghaving two LIST_ENTRY's in the request data structure as well. The - NetRootListEntry field is used for inter cluster threading and the listEntry - field is used for intra cluster threading. - - The handler list consists of all the requests for which the lookup has been completed - and are awaiting processing. - - The dispatcher list and the handler list access is protected by the buffering manager - mutex. - - The three routines of interest to mini rdr writers are ... - - 1) RxIndicateChangeOfBufferingState -- for registering the request. - - 2) RxAssociateSrvOpenKey -- for associating a SRV_OPEN instance with the key. - - - Note that the key associations are irreverisble and will last the lifetime of the - associated SRV_OPEN. - - Also note that 0 and 0xffffffff are not valid keys for SRV_OPEN. It has special - significance for the buffering manager. - ---*/ - -#ifndef __BUFFRING_H__ -#define __BUFFRING_H__ - -#define RX_REQUEST_PREPARED_FOR_HANDLING (0x10000000) - -typedef struct _CHANGE_BUFFERING_STATE_REQUEST_ { - - LIST_ENTRY ListEntry; - - ULONG Flags; - - PSRV_OPEN SrvOpen; - - PVOID SrvOpenKey; - PVOID MRxContext; - -} CHANGE_BUFFERING_STATE_REQUEST, *PCHANGE_BUFFERING_STATE_REQUEST; - -typedef struct _RX_BUFFERING_MANAGER_ { - - BOOLEAN DispatcherActive; - BOOLEAN HandlerInactive; - BOOLEAN LastChanceHandlerActive; - UCHAR Pad; - - KSPIN_LOCK SpinLock; - - // - // This count is always incremented and never reset. This provides us with - // a quick mechanism to establish if a buffering state change request has - // been received for a given srvcall since a point in time. - // - - __volatile LONG CumulativeNumberOfBufferingChangeRequests; - - LONG NumberOfUnhandledRequests; - LONG NumberOfUndispatchedRequests; - __volatile LONG NumberOfOutstandingOpens; - - LIST_ENTRY DispatcherList; - LIST_ENTRY HandlerList; - LIST_ENTRY LastChanceHandlerList; - - RX_WORK_QUEUE_ITEM DispatcherWorkItem; - RX_WORK_QUEUE_ITEM HandlerWorkItem; - RX_WORK_QUEUE_ITEM LastChanceHandlerWorkItem; - - FAST_MUTEX Mutex; - LIST_ENTRY SrvOpenLists[1]; - -} RX_BUFFERING_MANAGER, *PRX_BUFFERING_MANAGER; - -#define RxAcquireBufferingManagerMutex(BUFMAN) ExAcquireFastMutex( &(BUFMAN)->Mutex ) - -#define RxReleaseBufferingManagerMutex(BUFMAN) ExReleaseFastMutex( &(BUFMAN)->Mutex ) - -VOID -RxpProcessChangeBufferingStateRequests ( - PSRV_CALL SrvCall, - BOOLEAN UpdateHandlerState - ); -VOID -RxProcessChangeBufferingStateRequests ( - PSRV_CALL SrvCall - ); -VOID -RxProcessFcbChangeBufferingStateRequest ( - PFCB Fcb - ); -VOID -RxPurgeChangeBufferingStateRequestsForSrvOpen( - PSRV_OPEN SrvOpen - ); - -VOID -RxCompleteSrvOpenKeyAssociation ( - IN OUT PSRV_OPEN SrvOpen - ); - -VOID -RxInitiateSrvOpenKeyAssociation ( - IN OUT PSRV_OPEN SrvOpen - ); - -NTSTATUS -RxInitializeBufferingManager ( - PSRV_CALL SrvCall - ); -NTSTATUS -RxTearDownBufferingManager ( - PSRV_CALL SrvCall - ); - -NTSTATUS -RxFlushFcbInSystemCache ( - IN PFCB Fcb, - IN BOOLEAN SynchronizeWithLazyWriter - ); - -NTSTATUS -RxPurgeFcbInSystemCache ( - IN PFCB Fcb, - IN PLARGE_INTEGER FileOffset OPTIONAL, - IN ULONG Length, - IN BOOLEAN UninitializeCacheMaps, - IN BOOLEAN FlushFile - ); - -#endif __BUFFRING_H__ - diff --git a/qt-correction-tool/pub/ddk/calendardeviceservice.h b/qt-correction-tool/pub/ddk/calendardeviceservice.h deleted file mode 100644 index 1170537..0000000 --- a/qt-correction-tool/pub/ddk/calendardeviceservice.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * CalendarDeviceService.h - * - * Contains declarations for the Calendar Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _CALENDARDEVICESERVICE_H_ -#define _CALENDARDEVICESERVICE_H_ - -#include -#include -#include - - -/*****************************************************************************/ -/* Calendar Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Calendar, - 0xE4DFDBD3, 0x7F04, 0x45E9, 0x9F, 0xA1, 0x5C, 0xA0, 0xEA, 0xEB, 0x0A, 0xE3); - -#define NAME_CalendarSvc L"Calendar" -#define TYPE_CalendarSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Calendar Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_CalendarSvc, - 0x63816297, 0x61E5, 0x4306, 0xB1, 0xA3, 0xCE, 0xDF, 0x48, 0x1B, 0x86, 0x29); - -/* PKEY_CalendarSvc_SyncInWindowOnly - */ - -#define PKEY_CalendarSvc_SyncInWindowOnly PKEY_SyncSvc_FilterType -#define NAME_CalendarSvc_SyncInWindowOnly NAME_SyncSvc_FilterType - - -/* PKEY_CalendarSvc_SyncWindowStart - * - * Indicates the number of minutes before TODAY that the sync window starts - * - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarSvc_SyncWindowStart, - 0x63816297, 0x61E5, 0x4306, 0xB1, 0xA3, 0xCE, 0xDF, 0x48, 0x1B, 0x86, 0x29, - 2); - -#define NAME_CalendarSvc_SyncWindowStart L"SyncWindowStart" - - -/* PKEY_CalendarSvc_SyncWindowEnd - * - * Indicates the number of minutes after TODAY that the sync window ends - * - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarSvc_SyncWindowEnd, - 0x63816297, 0x61E5, 0x4306, 0xB1, 0xA3, 0xCE, 0xDF, 0x48, 0x1B, 0x86, 0x29, - 3); - -#define NAME_CalendarSvc_SyncWindowEnd L"SyncWindowEnd" - - -/*****************************************************************************/ -/* Calendar Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AbstractActivity - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractActivity, - 0xbf70e114, 0x3901, 0x4449, 0xbe, 0xe7, 0xd9, 0xea, 0x14, 0x93, 0xc3, 0x09); - -#define NAME_AbstractActivity L"AbstractActivity" - -/* FORMAT_AbstractActivityOccurrence - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractActivityOccurrence, - 0xE87A7008, 0x32D1, 0x42C5, 0x84, 0x88, 0x4C, 0x23, 0x58, 0x66, 0xAF, 0x32); - -#define NAME_AbstractActivityOccurrence L"AbstractActivityOccurrence" - -/* FORMAT_VCalendar1Activity - */ - -DEFINE_DEVSVCGUID(FORMAT_VCalendar1Activity, - 0x23F7A5A5, 0xF7D3, 0x4585, 0xA1, 0xFF, 0x76, 0xE2, 0xD4, 0x5C, 0x91, 0x21); - -#define NAME_VCalendar1Activity L"VCalendar1" - -/* FORMAT_ICalendarActivity - * - * iCalendar file format (vCalendar Version 2) - */ - -DEFINE_DEVSVCGUID(FORMAT_ICalendarActivity, - 0xCC4538CB, 0x7890, 0x41B7, 0xA3, 0xF1, 0xB6, 0xE6, 0x0B, 0xDD, 0x2A, 0x61); - -#define NAME_ICalendarActivity L"ICalendar" - -/*****************************************************************************/ -/* Calendar Service Object Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_CalendarObj, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3); - - -/* CalendarObj.Location - * - * MTP Property: Activity Location (0xDD52) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_Location, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 3); - -#define NAME_CalendarObj_Location L"Location" - - -/* CalendarObj.Accepted - * - * MTP Property: Activity Accepted (0xDD57) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_Accepted, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 10); - -#define NAME_CalendarObj_Accepted L"Accepted" - - -/* CalendarObj.Tentative - * - * MTP Property: Activity Tentative (0xDD58) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_Tentative, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 12); - -#define NAME_CalendarObj_Tentative L"Tentative" - - -/* CalendarObj.Declined - * - * MTP Property: Activity Declined (0xDD59) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_Declined, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 13); - -#define NAME_CalendarObj_Declined L"Declined" - - -/* CalendarObj.TimeZone - * - * Contains the TZ Database name for the time zone in which the appointment - * was created. - - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_TimeZone, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 14); - -#define NAME_CalendarObj_TimeZone L"TimeZone" - - -/* CalendarObj.ReminderOffset - * - * Contains the offset in minutes from the start of the appointment that - * a reminder is to be fired. - * - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_ReminderOffset, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 15); - -#define NAME_CalendarObj_ReminderOffset L"ReminderOffset" - - -/* CalendarObj.BusyStatus - * - * Contains the free/busy status for the specified appointment. - * - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_BusyStatus, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 16); - -#define NAME_CalendarObj_BusyStatus L"BusyStatus" - -#define ENUM_CalendarObj_BusyStatusFree 0x0000 -#define ENUM_CalendarObj_BusyStatusBusy 0x0001 -#define ENUM_CalendarObj_BusyStatusOutOfOffice 0x0002 -#define ENUM_CalendarObj_BusyStatusTentative 0x0003 - - -/* CalendarObj.PatternStartTime - * - * Contains the time of day at which a recurring item is to start. The - * format is the time portion of an ISO 8601 DateTime value- e.g. HHMMSS.S - * - * Type: String - * Form: ISO 8601 Time - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_PatternStartTime, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 17); - -#define NAME_CalendarObj_PatternStartTime L"PatternStartTime" - - -/* CalendarObj.PatternDuration - * - * Contains the duration of the recurring item in minutes. - * - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_PatternDuration, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 18); - -#define NAME_CalendarObj_PatternDuration L"PatternDuration" - - -/* CalendarObj.BeginDateTime - * - * Contains the UTC date and time that the calendar item begins - * - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_BeginDateTime, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 19); - -#define NAME_CalendarObj_BeginDateTime L"BeginDateTime" - - -/* CalendarObj.EndDateTime - * - * Contains the UTC date and time that the calendar item ends - * - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_CalendarObj_EndDateTime, - 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3, - 20); - -#define NAME_CalendarObj_EndDateTime L"EndDateTime" - - - -#endif /* _CALENDARDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/cifs.h b/qt-correction-tool/pub/ddk/cifs.h deleted file mode 100644 index e39567d..0000000 --- a/qt-correction-tool/pub/ddk/cifs.h +++ /dev/null @@ -1,6340 +0,0 @@ -/*++ - -Copyright (c) 1989 - 1999 Microsoft Corporation - -Module Name: - - cifs.h - -Abstract: - - This module defines structures and constants for the Common Internet File System - commands, request and response protocol. - - ---*/ - -#ifndef _CIFS_ -#define _CIFS_ - - -// -// The server has 16 bits available to it in each 32-bit status code. -// See \nt\sdk\inc\ntstatus.h for a description of the use of the -// high 16 bits of the status. -// -// The layout of the bits is: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-------------------------+-------+-----------------------+ -// |Sev|C| Facility--Server | Class | Code | -// +---+-+-------------------------+-------+-----------------------+ -// -// Class values: -// 0 - a server-specific error code, not put directly on the wire. -// 1 - SMB error class DOS. This includes those OS/2 errors -// that share code values and meanings with the SMB protocol. -// 2 - SMB error class SERVER. -// 3 - SMB error class HARDWARE. -// 4 - other SMB error classes -// 5-E - undefined -// F - an OS/2-specific error. If the client is OS/2, then the -// SMB error class is set to DOS and the code is set to -// the actual OS/2 error code contained in the Code field. -// -// The meaning of the Code field depends on the Class value. If the -// class is 00, then the code value is arbitrary. For other classes, -// the code is the actual code of the error in the SMB or OS/2 -// protocols. -// - -#define SRV_STATUS_FACILITY_CODE 0x00980000L -#define SRV_SRV_STATUS (0xC0000000L | SRV_STATUS_FACILITY_CODE) -#define SRV_DOS_STATUS (0xC0001000L | SRV_STATUS_FACILITY_CODE) -#define SRV_SERVER_STATUS (0xC0002000L | SRV_STATUS_FACILITY_CODE) -#define SRV_HARDWARE_STATUS (0xC0003000L | SRV_STATUS_FACILITY_CODE) -#define SRV_WIN32_STATUS (0xC000E000L | SRV_STATUS_FACILITY_CODE) -#define SRV_OS2_STATUS (0xC000F000L | SRV_STATUS_FACILITY_CODE) - -//++ -// -// BOOLEAN -// SmbIsSrvStatus ( -// IN NTSTATUS Status -// ) -// -// Routine Description: -// -// Macro to determine whether a status code is one defined by the -// server (has the server facility code). -// -// Arguments: -// -// Status - the status code to check. -// -// Return Value: -// -// BOOLEAN - TRUE if the facility code is the servers, FALSE -// otherwise. -// -//-- - -#define SrvIsSrvStatus(Status) \ - ( ((Status) & 0x1FFF0000) == SRV_STATUS_FACILITY_CODE ? TRUE : FALSE ) - -//++ -// -// UCHAR -// SmbErrorClass ( -// IN NTSTATUS Status -// ) -// -// Routine Description: -// -// This macro extracts the error class field from a server status -// code. -// -// Arguments: -// -// Status - the status code from which to get the error class. -// -// Return Value: -// -// UCHAR - the server error class of the status code. -// -//-- - -#define SrvErrorClass(Status) ((UCHAR)( ((Status) & 0x0000F000) >> 12 )) - -//++ -// -// UCHAR -// SmbErrorCode ( -// IN NTSTATUS Status -// ) -// -// Routine Description: -// -// This macro extracts the error code field from a server status -// code. -// -// Arguments: -// -// Status - the status code from which to get the error code. -// -// Return Value: -// -// UCHAR - the server error code of the status code. -// -//-- - -#define SrvErrorCode(Status) ((USHORT)( (Status) & 0xFFF) ) - -// -// Status codes unique to the server. These error codes are used -// internally only. -// - -#define STATUS_ENDPOINT_CLOSED (SRV_SRV_STATUS | 0x01) -#define STATUS_DISCONNECTED (SRV_SRV_STATUS | 0x02) -#define STATUS_SERVER_ALREADY_STARTED (SRV_SRV_STATUS | 0x04) -#define STATUS_SERVER_NOT_STARTED (SRV_SRV_STATUS | 0x05) -#define STATUS_OPLOCK_BREAK_UNDERWAY (SRV_SRV_STATUS | 0x06) -#define STATUS_NONEXISTENT_NET_NAME (SRV_SRV_STATUS | 0x08) - -// -// Error codes that exist in both the SMB protocol and OS/2 but not NT. -// Note that all SMB DOS-class error codes are defined in OS/2. -// - -#define STATUS_OS2_INVALID_FUNCTION (SRV_DOS_STATUS | ERROR_INVALID_FUNCTION) -#define STATUS_OS2_TOO_MANY_OPEN_FILES \ - (SRV_DOS_STATUS | ERROR_TOO_MANY_OPEN_FILES) -#define STATUS_OS2_INVALID_ACCESS (SRV_DOS_STATUS | ERROR_INVALID_ACCESS) - -// -// SMB SERVER-class error codes that lack an NT or OS/2 equivalent. -// - -#define STATUS_INVALID_SMB (SRV_SERVER_STATUS | SMB_ERR_ERROR) -#define STATUS_SMB_BAD_NET_NAME (SRV_SERVER_STATUS | SMB_ERR_BAD_NET_NAME) -#define STATUS_SMB_BAD_TID (SRV_SERVER_STATUS | SMB_ERR_BAD_TID) -#define STATUS_SMB_BAD_UID (SRV_SERVER_STATUS | SMB_ERR_BAD_UID) -#define STATUS_SMB_TOO_MANY_UIDS (SRV_SERVER_STATUS | SMB_ERR_TOO_MANY_UIDS) -#define STATUS_SMB_USE_MPX (SRV_SERVER_STATUS | SMB_ERR_USE_MPX) -#define STATUS_SMB_USE_STANDARD (SRV_SERVER_STATUS | SMB_ERR_USE_STANDARD) -#define STATUS_SMB_CONTINUE_MPX (SRV_SERVER_STATUS | SMB_ERR_CONTINUE_MPX) -#define STATUS_SMB_BAD_COMMAND (SRV_SERVER_STATUS | SMB_ERR_BAD_COMMAND) -#define STATUS_SMB_NO_SUPPORT (SRV_SERVER_STATUS | SMB_ERR_NO_SUPPORT_INTERNAL) - -// *** because SMB_ERR_NO_SUPPORT uses 16 bits, but we have only 12 bits -// available for error codes, it must be special-cased in the code. - -// -// SMB HARDWARE-class error codes that lack an NT or OS/2 equivalent. -// - -#define STATUS_SMB_DATA (SRV_HARDWARE_STATUS | SMB_ERR_DATA) - -// -// OS/2 error codes that lack an NT or SMB equivalent. -// - -#include - -#define STATUS_OS2_INVALID_LEVEL \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_INVALID_LEVEL) - -#define STATUS_OS2_EA_LIST_INCONSISTENT \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_EA_LIST_INCONSISTENT) - -#define STATUS_OS2_NEGATIVE_SEEK \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_NEGATIVE_SEEK) - -#define STATUS_OS2_NO_MORE_SIDS \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_NO_MORE_SEARCH_HANDLES) - -#define STATUS_OS2_EAS_DIDNT_FIT \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_EAS_DIDNT_FIT) - -#define STATUS_OS2_EA_ACCESS_DENIED \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_EA_ACCESS_DENIED) - -#define STATUS_OS2_CANCEL_VIOLATION \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_CANCEL_VIOLATION) - -#define STATUS_OS2_ATOMIC_LOCKS_NOT_SUPPORTED \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_ATOMIC_LOCKS_NOT_SUPPORTED) - -#define STATUS_OS2_CANNOT_COPY \ - (NTSTATUS)(SRV_OS2_STATUS | ERROR_CANNOT_COPY) - - -// -// SMBDBG determines whether the get/put macros are instead defined as -// function calls. (This is used to more reliablyfind char/short/long -// mismatches). -// - -#ifndef SMBDBG -#define SMBDBG 0 -#endif - -// -// SMBDBG1 determines whether the names of short and long fields in SMB -// structures have an extra character appended. This is used to ensure -// that these fields are only accessed via the get/put macros. SMBDBG1 -// must be disabled when SMBDBG is enabled. -// - -#ifndef SMBDBG1 -#define SMBDBG1 0 -#endif - -#if SMBDBG && SMBDBG1 -#undef SMBDBG1 -#define SMBDBG1 0 -#endif - -// -// If __unaligned support is available, or if we're compiling for a -// machine that handles unaligned accesses in hardware, then define -// SMB_USE_UNALIGNED as 1 (TRUE). Otherwise, define it as 0 (FALSE). -// If SMB_USE_UNALIGNED is FALSE, then the macros below use byte -// accesses to build up word and longword accesses to unaligned fields. -// -// Currently, the machines we build for all have SMB_USE_UNALIGNED as -// TRUE. x86 supports unaligned accesses in hardware, while the MIPS -// compiler supports the __unaligned keyword. -// -// Note that if SMB_USE_UNALIGNED is predefined, we use that definition. -// Also, if SMB_NO_UNALIGNED is defined as TRUE, it forces -// SMB_USE_ALIGNED off. This allows us to force, for testing purposes, -// use of byte accesses in the macros. -// - -#ifndef SMB_NO_UNALIGNED -#define SMB_NO_UNALIGNED 0 -#endif - -#ifndef SMB_USE_UNALIGNED -#if SMB_NO_UNALIGNED -#define SMB_USE_UNALIGNED 0 -#else -#define SMB_USE_UNALIGNED 1 -#endif -#endif - -// -// ntdef.h defines UNALIGNED as "__unaligned" or "", depending on -// whether we're building for MIPS or x86, respectively. Because we -// want to be able to disable use of __unaligned, we define -// SMB_UNALIGNED as "UNALIGNED" or "", depending on whether -// SMB_USE_UNALIGNED is TRUE or FALSE, respectively. -// - -#if SMB_USE_UNALIGNED -#define SMB_UNALIGNED UNALIGNED -#else -#define SMB_UNALIGNED -#endif - -// -// For ease of use, we define types for unaligned pointers to shorts -// and longs in SMBs. Note that "PUSHORT UNALIGNED" doesn't work. -// - -typedef unsigned short SMB_UNALIGNED *PSMB_USHORT; -typedef unsigned long SMB_UNALIGNED *PSMB_ULONG; - -// -// Macros for renaming short and long SMB fields. -// - -#if SMBDBG1 - -#define _USHORT( field ) USHORT field ## S -#define _ULONG( field ) ULONG field ## L - -#else - -#define _USHORT( field ) USHORT field -#define _ULONG( field ) ULONG field - -#endif - -// -// Force misalignment of the following structures -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - - -// -// The SMB_DIALECT type corresponds to the different SMB dialects -// that the server can speak. Associated with it is the DialectStrings[] -// array that holds information about the ASCIIZ strings that are passed -// in the Negotiate SMB.s -// -// These are listed in order from highest preference to lowest preference. -// The assigned numbers correspond to the array SrvClientTypes[] in the -// server module srvdata.c. -// - -typedef enum _SMB_DIALECT { - - - SmbDialectNtLanMan, // NT LAN Man - SmbDialectLanMan21, // OS/2 Lanman 2.1 - SmbDialectDosLanMan21, // DOS Lanman 2.1 - SmbDialectLanMan20, // OS/2 1.2 LanMan 2.0 - SmbDialectDosLanMan20, // DOS LanMan 2.0 - SmbDialectLanMan10, // 1st version of full LanMan extensions - SmbDialectMsNet30, // Larger subset of LanMan extensions - SmbDialectMsNet103, // Limited subset of LanMan extensions - SmbDialectPcLan10, // Alternate original protocol - SmbDialectPcNet10, // Original protocol - SmbDialectIllegal, - -} SMB_DIALECT, *PSMB_DIALECT; - -#define FIRST_DIALECT SmbDialectNtLanMan - -#define FIRST_DIALECT_EMULATED SmbDialectNtLanMan - -#define LAST_DIALECT SmbDialectIllegal -#define IS_DOS_DIALECT(dialect) \ - ( (BOOLEAN)( (dialect) == SmbDialectDosLanMan21 || \ - (dialect) == SmbDialectDosLanMan20 || \ - (dialect) > SmbDialectLanMan10 ) ) -#define IS_OS2_DIALECT(dialect) ( (BOOLEAN)!IS_DOS_DIALECT(dialect) ) - -#define IS_NT_DIALECT(dialect) (dialect) == SmbDialectNtLanMan - -#define DIALECT_HONORS_UID(dialect) \ - ( (BOOLEAN)(dialect <= SmbDialectDosLanMan20 ) ) - - -// -// Date and time structures that conform to MS-DOS standard used in -// some SMBs. -// -// !!! These structures are not portable--they depend on a little-endian -// machine (TwoSeconds in lowest bits, etc.) -// - -typedef union _SMB_DATE { - USHORT Ushort; - struct { - USHORT Day : 5; - USHORT Month : 4; - USHORT Year : 7; - } Struct; -} SMB_DATE; -typedef SMB_DATE SMB_UNALIGNED *PSMB_DATE; - -typedef union _SMB_TIME { - USHORT Ushort; - struct { - USHORT TwoSeconds : 5; - USHORT Minutes : 6; - USHORT Hours : 5; - } Struct; -} SMB_TIME; -typedef SMB_TIME SMB_UNALIGNED *PSMB_TIME; - - -// -// The SMB_FIND_BUFFER and SMB_FIND_BUFFER2 structures are used in the -// Transaction2 Find protocols to return files matching the requested -// specifications. They are identical except for the EaSize field -// in SMB_FIND_BUFFER2. -// - -typedef struct _SMB_FIND_BUFFER { - SMB_DATE CreationDate; - SMB_TIME CreationTime; - SMB_DATE LastAccessDate; - SMB_TIME LastAccessTime; - SMB_DATE LastWriteDate; - SMB_TIME LastWriteTime; - _ULONG( DataSize ); - _ULONG( AllocationSize ); - _USHORT( Attributes ); - UCHAR FileNameLength; - CHAR FileName[1]; -} SMB_FIND_BUFFER; -typedef SMB_FIND_BUFFER SMB_UNALIGNED *PSMB_FIND_BUFFER; - -typedef struct _SMB_FIND_BUFFER2 { - SMB_DATE CreationDate; - SMB_TIME CreationTime; - SMB_DATE LastAccessDate; - SMB_TIME LastAccessTime; - SMB_DATE LastWriteDate; - SMB_TIME LastWriteTime; - _ULONG( DataSize ); - _ULONG( AllocationSize ); - _USHORT( Attributes ); - _ULONG( EaSize ); // this field intentionally misaligned! - UCHAR FileNameLength; - CHAR FileName[1]; -} SMB_FIND_BUFFER2; -typedef SMB_FIND_BUFFER2 SMB_UNALIGNED *PSMB_FIND_BUFFER2; - - -// -// The following structures are used in OS/2 1.2 for extended attributes -// (EAs). OS/2 2.0 uses the same structures as NT. See the OS/2 -// Programmer's Reference, Volume 4, Chapter 4 for more information. -// -// The FEA structure holds a single EA's name and value and is the -// equivalent ofthe NT structure FILE_FULL_EA_INFORMATION. -// - -typedef struct _FEA { - UCHAR fEA; - UCHAR cbName; - _USHORT( cbValue ); -} FEA; -typedef FEA SMB_UNALIGNED *PFEA; - -// -// The only legal bit in fEA is FEA_NEEDEA. -// - -#define FEA_NEEDEA 0x80 - -// -// The FEALIST structure holds the names and values of multiple EAs -// NT has no direct equivalent but rather strings together -// FILE_FULL_EA_INFORMATION structures. -// - -typedef struct _FEALIST { - _ULONG( cbList ); - FEA list[1]; -} FEALIST; -typedef FEALIST SMB_UNALIGNED *PFEALIST; - -// -// The GEA structure holds the name of a single EA. It is used to -// request the value of that EA in OS/2 API functions. The NT -// equivalent is FILE_GET_EA_INFORMATION. -// - -typedef struct _GEA { - UCHAR cbName; - CHAR szName[1]; -} GEA; -typedef GEA SMB_UNALIGNED *PGEA; - -// -// The GEALIST structure holds the names of multiple EAs. NT has no -// direct equivalent but rather strings together FILE_GET_EA_INFORMATION -// structures. -// - -typedef struct _GEALIST { - _ULONG( cbList ); - GEA list[1]; -} GEALIST; -typedef GEALIST SMB_UNALIGNED *PGEALIST; - -// -// The EAOP structure holds EA information needed by API calls. It has -// no NT equivalent. -// - -typedef struct _EAOP { - PGEALIST fpGEAList; - PFEALIST fpFEAList; - ULONG oError; -} EAOP; -typedef EAOP SMB_UNALIGNED *PEAOP; - -// -// FSALLOCATE contains information about a disk returned by -// SrvSmbQueryFsInfo. -// - -typedef struct _FSALLOCATE { - _ULONG( idFileSystem ); - _ULONG( cSectorUnit ); - _ULONG( cUnit ); - _ULONG( cUnitAvail ); - _USHORT( cbSector ); -} FSALLOCATE, *PFSALLOCATE; // *** NOT SMB_UNALIGNED! - -// -// VOLUMELABEL contains information about a volume label returned by -// SrvSmbQueryFsInformation. -// - -typedef struct _VOLUMELABEL { - UCHAR cch; - CHAR szVolLabel[12]; -} VOLUMELABEL, *PVOLUMELABEL; // *** NOT SMB_UNALIGNED! - -// -// FSINFO holds information about a volume returned by -// SrvSmbQueryFsInformation. -// - -typedef struct _FSINFO { - _ULONG( ulVsn ); - VOLUMELABEL vol; -} FSINFO, *PFSINFO; // *** NOT SMB_UNALIGNED! - -// -// File types (returned by OpenAndX and Transact2_Open) -// FileTypeIPC is a private definition for the NT redirector and -// is not in the smb protocol. -// - -typedef enum _FILE_TYPE { - FileTypeDisk = 0, - FileTypeByteModePipe = 1, - FileTypeMessageModePipe = 2, - FileTypePrinter = 3, - FileTypeCommDevice = 4, - FileTypeIPC = 0xFFFE, - FileTypeUnknown = 0xFFFF -} FILE_TYPE; - -// -// Turn structure packing back off -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - - -// -// PVOID -// ALIGN_SMB_WSTR( -// IN PVOID Pointer -// ) -// -// Routine description: -// -// This macro aligns the input pointer to the next 2-byte boundary. -// Used to align Unicode strings in SMBs. -// -// Arguments: -// -// Pointer - A pointer -// -// Return Value: -// -// PVOID - Pointer aligned to next 2-byte boundary. -// - -#define ALIGN_SMB_WSTR( Pointer ) \ - (PVOID)( ((ULONG_PTR)(Pointer) + 1) & ~1 ) - -// -// Macro to find the size of an SMB parameter block. This macro takes -// as input the type of a parameter block and a byte count. It finds -// the offset of the Buffer field, which appears at the end of all -// parameter blocks, and adds the byte count to find the total size. -// The type of the returned offset is USHORT. -// -// Note that this macro does NOT pad to a word or longword boundary. -// - -#define SIZEOF_SMB_PARAMS(type,byteCount) \ - (USHORT)( (ULONG_PTR)&((type *)0)->Buffer[0] + (byteCount) ) - -// -// Macro to find the next location after an SMB parameter block. This -// macro takes as input the address of the current parameter block, its -// type, and a byte count. It finds the address of the Buffer field, -// which appears at the end of all parameter blocks, and adds the byte -// count to find the next available location. The type of the returned -// pointer is PVOID. -// -// The byte count is passed in even though it is available through -// base->ByteCount. The reason for this is that this number will be a -// compile-time constant in most cases, so the resulting code will be -// simpler and faster. -// -// !!! This macro does not round to a longword boundary when packing -// is turned off. Pre-LM 2.0 DOS redirectors cannot handle having -// too much data sent to them; the exact amount must be sent. -// We may want to make this macro such that the first location -// AFTER the returned value (WordCount field of the SMB) is aligned, -// since most of the fields are misaligned USHORTs. This would -// result in a minor performance win on the 386 and other CISC -// machines. -// - -#ifndef NO_PACKING - -#define NEXT_LOCATION(base,type,byteCount) \ - (PVOID)( (ULONG_PTR)( (PUCHAR)( &((type *)(base))->Buffer[0] ) ) + \ - (byteCount) ) - -#else - -#define NEXT_LOCATION(base,type,byteCount) \ - (PVOID)(( (ULONG_PTR)( (PUCHAR)( &((type *)(base))->Buffer[0] ) ) + \ - (byteCount) + 3) & ~3) - -#endif - -// -// Macro to find the offset of a followon command to an and X command. -// This offset is the number of bytes from the start of the SMB header -// to where the followon command's parameters should start. -// - -#define GET_ANDX_OFFSET(header,params,type,byteCount) \ - (USHORT)( (PCHAR)(params) - (PCHAR)(header) + \ - SIZEOF_SMB_PARAMS( type,(byteCount) ) ) - -// -// The following are macros to assist in converting OS/2 1.2 EAs to -// NT style and vice-versa. -// - -//++ -// -// ULONG -// SmbGetNtSizeOfFea ( -// IN PFEA Fea -// ) -// -// Routine Description: -// -// This macro gets the size that would be required to hold the FEA -// in NT format. The length is padded to account for the fact that -// each FILE_FULL_EA_INFORMATION structure must start on a -// longword boundary. -// -// Arguments: -// -// Fea - a pointer to the OS/2 1.2 FEA structure to evaluate. -// -// Return Value: -// -// ULONG - number of bytes the FEA would require in NT format. -// -//-- - -// -// The +1 is for the zero terminator on the name, the +3 is for padding. -// - -#define SmbGetNtSizeOfFea( Fea ) \ - (ULONG)(( FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName[0]) + \ - (Fea)->cbName + 1 + SmbGetUshort( &(Fea)->cbValue ) + \ - 3 ) & ~3 ) - -//++ -// -// ULONG -// SmbGetNtSizeOfGea ( -// IN PFEA Gea -// ) -// -// Routine Description: -// -// This macro gets the size that would be required to hold the GEA -// in NT format. The length is padded to account for the fact that -// each FILE_FULL_EA_INFORMATION structure must start on a -// longword boundary. -// -// Arguments: -// -// Gea - a pointer to the OS/2 1.2 GEA structure to evaluate. -// -// Return Value: -// -// ULONG - number of bytes the GEA would require in NT format. -// -//-- - -// -// The +1 is for the zero terminator on the name, the +3 is for padding. -// - -#define SmbGetNtSizeOfGea( Gea ) \ - (ULONG)(( FIELD_OFFSET(FILE_FULL_EA_INFORMATION, EaName[0]) + \ - (Gea)->cbName + 1 + 3 ) & ~3 ) - -//++ -// -// ULONG -// SmbGetOs2SizeOfNtFullEa ( -// IN PFILE_FULL_EA_INFORMATION NtFullEa; -// ) -// -// Routine Description: -// -// This macro gets the size a FILE_FULL_EA_INFORMATION structure would -// require to be represented in a OS/2 1.2 style FEA. -// -// Arguments: -// -// NtFullEa - a pointer to the NT FILE_FULL_EA_INFORMATION structure -// to evaluate. -// -// Return Value: -// -// ULONG - number of bytes requires for the FEA. -// -//-- - -#define SmbGetOs2SizeOfNtFullEa( NtFullEa ) \ - (ULONG)( sizeof(FEA) + (NtFullEa)->EaNameLength + 1 + \ - (NtFullEa)->EaValueLength ) - -//++ -// -// ULONG -// SmbGetOs2SizeOfNtGetEa ( -// IN PFILE_GET_EA_INFORMATION NtGetEa; -// ) -// -// Routine Description: -// -// This macro gets the size a FILE_GET_EA_INFORMATION structure would -// require to be represented in a OS/2 1.2 style GEA. -// -// Arguments: -// -// NtGetEa - a pointer to the NT FILE_GET_EA_INFORMATION structure -// to evaluate. -// -// Return Value: -// -// ULONG - number of bytes requires for the GEA. -// -//-- - -// -// The zero terminator on the name is accounted for by the szName[0] -// field in the GEA definition. -// - -#define SmbGetOs2SizeOfNtGetEa( NtGetEa ) \ - (ULONG)( sizeof(GEA) + (NtGetEa)->EaNameLength ) - - -/* - -Inclusion of SMB request/response structures in this file is -conditionalized in the following way: - - If INCLUDE_SMB_ALL is defined, all of the structures are defined. - - Otherwise, the following names, if defined, cause inclusion of the - corresponding SMB categories: - - INCLUDE_SMB_ADMIN Administrative requests: - PROCESS_EXIT - NEGOTIATE - SESSION_SETUP_ANDX - LOGOFF_ANDX - - INCLUDE_SMB_TREE Tree connect requests: - TREE_CONNECT - TREE_DISCONNECT - TREE_CONNECT_ANDX - - INCLUDE_SMB_DIRECTORY Directory-related requests: - CREATE_DIRECTORY - DELETE_DIRECTORY - CHECK_DIRECTORY - - INCLUDE_SMB_OPEN_CLOSE File open and close requests: - OPEN - CREATE - CLOSE - CREATE_TEMPORARY - CREATE_NEW - OPEN_ANDX - CLOSE_AND_TREE_DISC - - INCLUDE_SMB_READ_WRITE Read and write requests: - READ - WRITE - SEEK - LOCK_AND_READ - WRITE_AND_UNLOCK - WRITE_AND_CLOSE - READ_ANDX - WRITE_ANDX - - - INCLUDE_SMB_FILE_CONTROL File control requests: - FLUSH - DELETE - RENAME - COPY - MOVE - - INCLUDE_SMB_QUERY_SET File query/set requests: - QUERY_INFORMATION - SET_INFORMATION - QUERY_INFORMATION2 - SET_INFORMATION2 - QUERY_PATH_INFORMATION - SET_PATH_INFORMATION - QUERY_FILE_INFORMATION - SET_FILE_INFORMATION - - INCLUDE_SMB_LOCK Lock requests (not LOCK_AND_READ) - LOCK_BYTE_RANGE - UNLOCK_BYTE_RANGE - LOCKING_ANDX - - INCLUDE_SMB_RAW Raw read/write requests: - READ_RAW - WRITE_RAW - - INCLUDE_SMB_MPX Multiplexed requests: - READ_MPX - WRITE_MPX - - INCLUDE_SMB_SEARCH Search requests: - FIND_CLOSE2 - FIND_NOTIFY_CLOSE - SEARCH - FIND - FIND_UNIQUE - FIND_CLOSE - - INCLUDE_SMB_TRANSACTION Transaction and IOCTL requests: - TRANSACTION - IOCTL - TRANSACTION2 - NTTRANSACTION - - INCLUDE_SMB_PRINT Printer requests: - OPEN_PRINT_FILE - WRITE_PRINT_FILE - CLOSE_PRINT_FILE - GET_PRINT_QUEUE - - INCLUDE_SMB_MESSAGE Message requests: - SEND_MESSAGE - SEND_BROADCAST_MESSAGE - FORWARD_USER_NAME - CANCEL_FORWARD - GET_MACHINE_NAME - SEND_START_MB_MESSAGE - SEND_END_MB_MESSAGE - SEND_TEXT_MB_MESSAGE - - INCLUDE_SMB_MISC Miscellaneous requests: - QUERY_INFORMATION_SRV - ECHO - QUERY_INFORMATION_DISK -*/ - -#ifdef INCLUDE_SMB_ALL - -#define INCLUDE_SMB_ADMIN -#define INCLUDE_SMB_TREE -#define INCLUDE_SMB_DIRECTORY -#define INCLUDE_SMB_OPEN_CLOSE -#define INCLUDE_SMB_FILE_CONTROL -#define INCLUDE_SMB_READ_WRITE -#define INCLUDE_SMB_LOCK -#define INCLUDE_SMB_RAW -#define INCLUDE_SMB_MPX -#define INCLUDE_SMB_QUERY_SET -#define INCLUDE_SMB_SEARCH -#define INCLUDE_SMB_TRANSACTION -#define INCLUDE_SMB_PRINT -#define INCLUDE_SMB_MESSAGE -#define INCLUDE_SMB_MISC - -#endif // def INCLUDE_SMB_ALL - - -// -// Force misalignment of the following structures -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - -// -// SMB servers listen on two NETBIOS addresses to facilitate connections. The -// first one is a name formulated from the computer name by padding it with -// a number of blanks ( upto NETBIOS_NAME_LEN ). This name is registered and -// resolved using the NETBIOS name registration/resolution mechanism. They also -// register under a second name *SMBSERVER which is not a valuid netbios name -// but provides a name which can be used in NETBT session setup. This eliminates -// the need for querying the remote adapter status to obtain the name. -// - -#define SMBSERVER_LOCAL_ENDPOINT_NAME "*SMBSERVER " - -// -// SMB Command code definitions: -// - -// *** Start of SMB commands -#define SMB_COM_CREATE_DIRECTORY (UCHAR)0x00 -#define SMB_COM_DELETE_DIRECTORY (UCHAR)0x01 -#define SMB_COM_OPEN (UCHAR)0x02 -#define SMB_COM_CREATE (UCHAR)0x03 -#define SMB_COM_CLOSE (UCHAR)0x04 -#define SMB_COM_FLUSH (UCHAR)0x05 -#define SMB_COM_DELETE (UCHAR)0x06 -#define SMB_COM_RENAME (UCHAR)0x07 -#define SMB_COM_QUERY_INFORMATION (UCHAR)0x08 -#define SMB_COM_SET_INFORMATION (UCHAR)0x09 -#define SMB_COM_READ (UCHAR)0x0A -#define SMB_COM_WRITE (UCHAR)0x0B -#define SMB_COM_LOCK_BYTE_RANGE (UCHAR)0x0C -#define SMB_COM_UNLOCK_BYTE_RANGE (UCHAR)0x0D -#define SMB_COM_CREATE_TEMPORARY (UCHAR)0x0E -#define SMB_COM_CREATE_NEW (UCHAR)0x0F -#define SMB_COM_CHECK_DIRECTORY (UCHAR)0x10 -#define SMB_COM_PROCESS_EXIT (UCHAR)0x11 -#define SMB_COM_SEEK (UCHAR)0x12 -#define SMB_COM_LOCK_AND_READ (UCHAR)0x13 -#define SMB_COM_WRITE_AND_UNLOCK (UCHAR)0x14 -#define SMB_COM_READ_RAW (UCHAR)0x1A -#define SMB_COM_READ_MPX (UCHAR)0x1B -#define SMB_COM_READ_MPX_SECONDARY (UCHAR)0x1C // server to redir only -#define SMB_COM_WRITE_RAW (UCHAR)0x1D -#define SMB_COM_WRITE_MPX (UCHAR)0x1E -#define SMB_COM_WRITE_MPX_SECONDARY (UCHAR)0x1F -#define SMB_COM_WRITE_COMPLETE (UCHAR)0x20 // server to redir only -#define SMB_COM_QUERY_INFORMATION_SRV (UCHAR)0x21 -#define SMB_COM_SET_INFORMATION2 (UCHAR)0x22 -#define SMB_COM_QUERY_INFORMATION2 (UCHAR)0x23 -#define SMB_COM_LOCKING_ANDX (UCHAR)0x24 -#define SMB_COM_TRANSACTION (UCHAR)0x25 -#define SMB_COM_TRANSACTION_SECONDARY (UCHAR)0x26 -#define SMB_COM_IOCTL (UCHAR)0x27 -#define SMB_COM_IOCTL_SECONDARY (UCHAR)0x28 -#define SMB_COM_COPY (UCHAR)0x29 -#define SMB_COM_MOVE (UCHAR)0x2A -#define SMB_COM_ECHO (UCHAR)0x2B -#define SMB_COM_WRITE_AND_CLOSE (UCHAR)0x2C -#define SMB_COM_OPEN_ANDX (UCHAR)0x2D -#define SMB_COM_READ_ANDX (UCHAR)0x2E -#define SMB_COM_WRITE_ANDX (UCHAR)0x2F -#define SMB_COM_CLOSE_AND_TREE_DISC (UCHAR)0x31 -#define SMB_COM_TRANSACTION2 (UCHAR)0x32 -#define SMB_COM_TRANSACTION2_SECONDARY (UCHAR)0x33 -#define SMB_COM_FIND_CLOSE2 (UCHAR)0x34 -#define SMB_COM_FIND_NOTIFY_CLOSE (UCHAR)0x35 -#define SMB_COM_TREE_CONNECT (UCHAR)0x70 -#define SMB_COM_TREE_DISCONNECT (UCHAR)0x71 -#define SMB_COM_NEGOTIATE (UCHAR)0x72 -#define SMB_COM_SESSION_SETUP_ANDX (UCHAR)0x73 -#define SMB_COM_LOGOFF_ANDX (UCHAR)0x74 -#define SMB_COM_TREE_CONNECT_ANDX (UCHAR)0x75 -#define SMB_COM_QUERY_INFORMATION_DISK (UCHAR)0x80 -#define SMB_COM_SEARCH (UCHAR)0x81 -#define SMB_COM_FIND (UCHAR)0x82 -#define SMB_COM_FIND_UNIQUE (UCHAR)0x83 -#define SMB_COM_FIND_CLOSE (UCHAR)0x84 -#define SMB_COM_NT_TRANSACT (UCHAR)0xA0 -#define SMB_COM_NT_TRANSACT_SECONDARY (UCHAR)0xA1 -#define SMB_COM_NT_CREATE_ANDX (UCHAR)0xA2 -#define SMB_COM_NT_CANCEL (UCHAR)0xA4 -#define SMB_COM_NT_RENAME (UCHAR)0xA5 -#define SMB_COM_OPEN_PRINT_FILE (UCHAR)0xC0 -#define SMB_COM_WRITE_PRINT_FILE (UCHAR)0xC1 -#define SMB_COM_CLOSE_PRINT_FILE (UCHAR)0xC2 -#define SMB_COM_GET_PRINT_QUEUE (UCHAR)0xC3 -#define SMB_COM_SEND_MESSAGE (UCHAR)0xD0 -#define SMB_COM_SEND_BROADCAST_MESSAGE (UCHAR)0xD1 -#define SMB_COM_FORWARD_USER_NAME (UCHAR)0xD2 -#define SMB_COM_CANCEL_FORWARD (UCHAR)0xD3 -#define SMB_COM_GET_MACHINE_NAME (UCHAR)0xD4 -#define SMB_COM_SEND_START_MB_MESSAGE (UCHAR)0xD5 -#define SMB_COM_SEND_END_MB_MESSAGE (UCHAR)0xD6 -#define SMB_COM_SEND_TEXT_MB_MESSAGE (UCHAR)0xD7 -// *** End of SMB commands - -#define SMB_COM_NO_ANDX_COMMAND (UCHAR)0xFF - - -// -// Header for SMBs, see #4 page 10 -// -// *** Note that we do NOT define PSMB_HEADER as SMB_UNALIGNED! This is -// done on the assumption that the SMB header, at least, will always -// be properly aligned. If you need to access an unaligned header, -// declare the pointer as SMB_UNALIGNED *SMB_HEADER. -// - -#define SMB_SECURITY_SIGNATURE_LENGTH 8 - -typedef struct _SMB_HEADER { - UCHAR Protocol[4]; // Contains 0xFF,'SMB' - UCHAR Command; // Command code - UCHAR ErrorClass; // Error class - UCHAR Reserved; // Reserved for future use - _USHORT( Error ); // Error code - UCHAR Flags; // Flags - _USHORT( Flags2 ); // More flags - union { - _USHORT( Reserved2 )[6]; // Reserved for future use - struct { - _USHORT( PidHigh ); // High part of PID (NT Create And X) - union { - struct { - _ULONG( Key ); // Encryption key (IPX) - _USHORT( Sid ); // Session ID (IPX) - _USHORT( SequenceNumber ); // Sequence number (IPX) - _USHORT( Gid ); // Group ID (unused?) - }; - UCHAR SecuritySignature[SMB_SECURITY_SIGNATURE_LENGTH]; - // Client must send the correct Signature - // for this SMB to be accepted. - }; - }; - }; - _USHORT( Tid ); // Authenticated user/group - _USHORT( Pid ); // Caller's process id - _USHORT( Uid ); // Unauthenticated user id - _USHORT( Mid ); // multiplex id -#ifdef NO_PACKING // *** - _USHORT( Kludge ); // *** make sure parameter structs -#endif // *** are longword aligned -} SMB_HEADER; -typedef SMB_HEADER *PSMB_HEADER; - -typedef struct _NT_SMB_HEADER { - UCHAR Protocol[4]; // Contains 0xFF,'SMB' - UCHAR Command; // Command code - union { - struct { - UCHAR ErrorClass; // Error class - UCHAR Reserved; // Reserved for future use - _USHORT( Error ); // Error code - } DosError; - ULONG NtStatus; // NT-style 32-bit error code - } Status; - UCHAR Flags; // Flags - _USHORT( Flags2 ); // More flags - union { - _USHORT( Reserved2 )[6]; // Reserved for future use - struct { - _USHORT( PidHigh ); // High part of PID (NT Create And X) - union { - struct { - _ULONG( Key ); // Encryption key (IPX) - _USHORT( Sid ); // Session ID (IPX) - _USHORT( SequenceNumber ); // Sequence number (IPX) - _USHORT( Gid ); // Group ID (unused?) - }; - UCHAR SecuritySignature[SMB_SECURITY_SIGNATURE_LENGTH]; - // Client must send the correct Signature - // for this SMB to be accepted. - }; - }; - }; - _USHORT( Tid ); // Authenticated user/group - _USHORT( Pid ); // Caller's process id - _USHORT( Uid ); // Unauthenticated user id - _USHORT( Mid ); // multiplex id -#ifdef NO_PACKING // *** - _USHORT( Kludge ); // *** make sure parameter structs -#endif // *** are longword aligned -} NT_SMB_HEADER; -typedef NT_SMB_HEADER *PNT_SMB_HEADER; - -// -// The SMB header, protocol field, as a long. -// - -#define SMB_HEADER_PROTOCOL (0xFF + ('S' << 8) + ('M' << 16) + ('B' << 24)) - -// -// Minimum parameter structure that can be returned. Used in returning -// error SMBs. -// -// *** Note that this structure does NOT have a Buffer field! -// - -typedef struct _SMB_PARAMS { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of bytes that follow; min = 0 -} SMB_PARAMS; -typedef SMB_PARAMS SMB_UNALIGNED *PSMB_PARAMS; - -// -// Generic header for AndX commands. -// - -typedef struct _GENERIC_ANDX { - UCHAR WordCount; // Count of parameter words - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved - _USHORT( AndXOffset ); // Offset (from SMB header start) -} GENERIC_ANDX; -typedef GENERIC_ANDX SMB_UNALIGNED *PGENERIC_ANDX; - - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Cancel Forward SMB, see #1 page 35 -// Function is SrvSmbCancelForward() -// SMB_COM_CANCEL_FORWARD 0xD3 -// - -typedef struct _REQ_CANCEL_FORWARD { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR ForwardedName[]; // Forwarded name -} REQ_CANCEL_FORWARD; -typedef REQ_CANCEL_FORWARD SMB_UNALIGNED *PREQ_CANCEL_FORWARD; - -typedef struct _RESP_CANCEL_FORWARD { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CANCEL_FORWARD; -typedef RESP_CANCEL_FORWARD SMB_UNALIGNED *PRESP_CANCEL_FORWARD; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_DIRECTORY - -// -// Check Directory SMB, see #1 page 23 -// Function is SrvSmbCheckDirectory() -// SMB_COM_CHECK_DIRECTORY 0x10 -// - -typedef struct _REQ_CHECK_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR DirectoryPath[]; // Directory path -} REQ_CHECK_DIRECTORY; -typedef REQ_CHECK_DIRECTORY SMB_UNALIGNED *PREQ_CHECK_DIRECTORY; - -typedef struct _RESP_CHECK_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CHECK_DIRECTORY; -typedef RESP_CHECK_DIRECTORY SMB_UNALIGNED *PRESP_CHECK_DIRECTORY; - -#endif // def INCLUDE_SMB_DIRECTORY - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Close SMB, see #1 page 10 -// Function is SrvSmbClose() -// SMB_COM_CLOSE 0x04 -// - -typedef struct _REQ_CLOSE { - UCHAR WordCount; // Count of parameter words = 3 - _USHORT( Fid ); // File handle - _ULONG( LastWriteTimeInSeconds ); // Time of last write, low and high - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_CLOSE; -typedef REQ_CLOSE SMB_UNALIGNED *PREQ_CLOSE; - -typedef struct _RESP_CLOSE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CLOSE; -typedef RESP_CLOSE SMB_UNALIGNED *PRESP_CLOSE; - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Close and Tree Disconnect SMB, see #? page ?? -// Function is SrvSmbCloseAndTreeDisc -// SMB_COM_CLOSE_AND_TREE_DISC 0x31 -// - -typedef struct _REQ_CLOSE_AND_TREE_DISC { - UCHAR WordCount; // Count of parameter words - _USHORT( Fid ); // File handle - _ULONG( LastWriteTimeInSeconds ); - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_CLOSE_AND_TREE_DISC; -typedef REQ_CLOSE_AND_TREE_DISC SMB_UNALIGNED *PREQ_CLOSE_AND_TREE_DISC; - -typedef struct _RESP_CLOSE_AND_TREE_DISC { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CLOSE_AND_TREE_DISC; -typedef RESP_CLOSE_AND_TREE_DISC SMB_UNALIGNED *PRESP_CLOSE_AND_TREE_DISC; - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_PRINT - -// -// Close Print Spool File SMB, see #1 page 29 -// Function is SrvSmbClosePrintSpoolFile() -// SMB_COM_CLOSE_PRINT_FILE 0xC2 -// - -typedef struct _REQ_CLOSE_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_CLOSE_PRINT_FILE; -typedef REQ_CLOSE_PRINT_FILE SMB_UNALIGNED *PREQ_CLOSE_PRINT_FILE; - -typedef struct _RESP_CLOSE_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CLOSE_PRINT_FILE; -typedef RESP_CLOSE_PRINT_FILE SMB_UNALIGNED *PRESP_CLOSE_PRINT_FILE; - -#endif // def INCLUDE_SMB_PRINT - -#ifdef INCLUDE_SMB_FILE_CONTROL - -// -// Copy SMB, see #2 page 23 -// Function is SrvSmbCopy() -// SMB_COM_COPY 0x29 -// - -typedef struct _REQ_COPY { - UCHAR WordCount; // Count of parameter words = 3 - _USHORT( Tid2 ); // Second (target) path TID - _USHORT( OpenFunction ); // What to do if target file exists - _USHORT( Flags ); // Flags to control copy operation: - // bit 0 - target must be a file - // bit 1 - target must ba a dir. - // bit 2 - copy target mode: - // 0 = binary, 1 = ASCII - // bit 3 - copy source mode: - // 0 = binary, 1 = ASCII - // bit 4 - verify all writes - // bit 5 - tree copy - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR SourceFileName[]; // pathname of source file - //UCHAR TargetFileName[]; // pathname of target file -} REQ_COPY; -typedef REQ_COPY SMB_UNALIGNED *PREQ_COPY; - -typedef struct _RESP_COPY { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Number of files copied - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // ASCIIZ pathname of file with error -} RESP_COPY; -typedef RESP_COPY SMB_UNALIGNED *PRESP_COPY; - -#endif // def INCLUDE_SMB_FILE_CONTROL - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Create SMB, see #1 page 9 -// Create New SMB, see #1 page 23 -// Function is SrvSmbCreate() -// SMB_COM_CREATE 0x03 -// SMB_COM_CREATE_NEW 0x0F -// - -typedef struct _REQ_CREATE { - UCHAR WordCount; // Count of parameter words = 3 - _USHORT( FileAttributes ); // New file attributes - _ULONG( CreationTimeInSeconds ); // Creation time - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} REQ_CREATE; -typedef REQ_CREATE SMB_UNALIGNED *PREQ_CREATE; - -typedef struct _RESP_CREATE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CREATE; -typedef RESP_CREATE SMB_UNALIGNED *PRESP_CREATE; - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_DIRECTORY - -// -// Create Directory SMB, see #1 page 14 -// Function is SrvSmbCreateDirectory -// SMB_COM_CREATE_DIRECTORY 0x00 -// - -typedef struct _REQ_CREATE_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR DirectoryName[]; // Directory name -} REQ_CREATE_DIRECTORY; -typedef REQ_CREATE_DIRECTORY SMB_UNALIGNED *PREQ_CREATE_DIRECTORY; - -typedef struct _RESP_CREATE_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_CREATE_DIRECTORY; -typedef RESP_CREATE_DIRECTORY SMB_UNALIGNED *PRESP_CREATE_DIRECTORY; - -#endif // def INCLUDE_SMB_DIRECTORY - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Create Temporary SMB, see #1 page 21 -// Function is SrvSmbCreateTemporary() -// SMB_COM_CREATE_TEMPORARY 0x0E -// - -typedef struct _REQ_CREATE_TEMPORARY { - UCHAR WordCount; // Count of parameter words = 3 - _USHORT( FileAttributes ); - _ULONG( CreationTimeInSeconds ); - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR DirectoryName[]; // Directory name -} REQ_CREATE_TEMPORARY; -typedef REQ_CREATE_TEMPORARY SMB_UNALIGNED *PREQ_CREATE_TEMPORARY; - -typedef struct _RESP_CREATE_TEMPORARY { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} RESP_CREATE_TEMPORARY; -typedef RESP_CREATE_TEMPORARY SMB_UNALIGNED *PRESP_CREATE_TEMPORARY; - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_FILE_CONTROL - -// -// Delete SMB, see #1 page 16 -// Function is SrvSmbDelete() -// SMB_COM_DELETE 0x06 -// - -typedef struct _REQ_DELETE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( SearchAttributes ); - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} REQ_DELETE; -typedef REQ_DELETE SMB_UNALIGNED *PREQ_DELETE; - -typedef struct _RESP_DELETE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_DELETE; -typedef RESP_DELETE SMB_UNALIGNED *PRESP_DELETE; - -#endif // def INCLUDE_SMB_FILE_CONTROL - -#ifdef INCLUDE_SMB_DIRECTORY - -// -// Delete Directory SMB, see #1 page 15 -// Function is SrvSmbDeleteDirectory() -// SMB_COM_DELETE_DIRECTORY 0x01 -// - -typedef struct _REQ_DELETE_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR DirectoryName[]; // Directory name -} REQ_DELETE_DIRECTORY; -typedef REQ_DELETE_DIRECTORY SMB_UNALIGNED *PREQ_DELETE_DIRECTORY; - -typedef struct _RESP_DELETE_DIRECTORY { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_DELETE_DIRECTORY; -typedef RESP_DELETE_DIRECTORY SMB_UNALIGNED *PRESP_DELETE_DIRECTORY; - -#endif // def INCLUDE_SMB_DIRECTORY - -#ifdef INCLUDE_SMB_MISC - -// -// Echo SMB, see #2 page 25 -// Function is SrvSmbEcho() -// SMB_COM_ECHO 0x2B -// - -typedef struct _REQ_ECHO { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( EchoCount ); // Number of times to echo data back - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Data to echo -} REQ_ECHO; -typedef REQ_ECHO SMB_UNALIGNED *PREQ_ECHO; - -typedef struct _RESP_ECHO { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( SequenceNumber ); // Sequence number of this echo - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Echoed data -} RESP_ECHO; -typedef RESP_ECHO SMB_UNALIGNED *PRESP_ECHO; - -#endif // def INCLUDE_SMB_MISC - -#ifdef INCLUDE_SMB_SEARCH - -// -// Find Close2 SMB, see #3 page 54 -// Function is SrvFindClose2() -// SMB_COM_FIND_CLOSE2 0x34 -// - -typedef struct _REQ_FIND_CLOSE2 { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Sid ); // Find handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_FIND_CLOSE2; -typedef REQ_FIND_CLOSE2 SMB_UNALIGNED *PREQ_FIND_CLOSE2; - -typedef struct _RESP_FIND_CLOSE2 { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_FIND_CLOSE2; -typedef RESP_FIND_CLOSE2 SMB_UNALIGNED *PRESP_FIND_CLOSE2; - -#endif // def INCLUDE_SMB_SEARCH - -#ifdef INCLUDE_SMB_SEARCH - -// -// Find Notify Close SMB, see #3 page 53 -// Function is SrvSmbFindNotifyClose() -// SMB_COM_FIND_NOTIFY_CLOSE 0x35 -// - -typedef struct _REQ_FIND_NOTIFY_CLOSE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Handle ); // Find notify handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_FIND_NOTIFY_CLOSE; -typedef REQ_FIND_NOTIFY_CLOSE SMB_UNALIGNED *PREQ_FIND_NOTIFY_CLOSE; - -typedef struct _RESP_FIND_NOTIFY_CLOSE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_FIND_NOTIFY_CLOSE; -typedef RESP_FIND_NOTIFY_CLOSE SMB_UNALIGNED *PRESP_FIND_NOTIFY_CLOSE; - -#endif // def INCLUDE_SMB_SEARCH - -#ifdef INCLUDE_SMB_FILE_CONTROL - -// -// Flush SMB, see #1 page 11 -// Function is SrvSmbFlush() -// SMB_COM_FLUSH 0x05 -// - -typedef struct _REQ_FLUSH { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_FLUSH; -typedef REQ_FLUSH SMB_UNALIGNED *PREQ_FLUSH; - -typedef struct _RESP_FLUSH { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_FLUSH; -typedef RESP_FLUSH SMB_UNALIGNED *PRESP_FLUSH; - -#endif // def INCLUDE_SMB_FILE_CONTROL - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Forward User Name SMB, see #1 page 34 -// Function is SrvSmbForwardUserName() -// SMB_COM_FORWARD_USER_NAME 0xD2 -// - -typedef struct _REQ_FORWARD_USER_NAME { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR ForwardedName[]; // Forwarded name -} REQ_FORWARD_USER_NAME; -typedef REQ_FORWARD_USER_NAME SMB_UNALIGNED *PREQ_FORWARD_USER_NAME; - -typedef struct _RESP_FORWARD_USER_NAME { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_FORWARD_USER_NAME; -typedef RESP_FORWARD_USER_NAME SMB_UNALIGNED *PRESP_FORWARD_USER_NAME; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Get Machine Name SMB, see #1 page 35 -// Function is SrvSmbGetMachineName() -// SMB_COM_GET_MACHINE_NAME 0xD4 -// - -typedef struct _REQ_GET_MACHINE_NAME { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_GET_MACHINE_NAME; -typedef REQ_GET_MACHINE_NAME SMB_UNALIGNED *PREQ_GET_MACHINE_NAME; - -typedef struct _RESP_GET_MACHINE_NAME { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR MachineName[]; // Machine name -} RESP_GET_MACHINE_NAME; -typedef RESP_GET_MACHINE_NAME SMB_UNALIGNED *PRESP_GET_MACHINE_NAME; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_PRINT - -// -// Get Print Queue SMB, see #1 page 29 -// Function is SrvSmbGetPrintQueue() -// SMB_COM_GET_PRINT_QUEUE 0xC3 -// - -typedef struct _REQ_GET_PRINT_QUEUE { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( MaxCount ); // Max number of entries to return - _USHORT( StartIndex ); // First queue entry to return - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_GET_PRINT_QUEUE; -typedef REQ_GET_PRINT_QUEUE SMB_UNALIGNED *PREQ_GET_PRINT_QUEUE; - -typedef struct _RESP_GET_PRINT_QUEUE { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( Count ); // Number of entries returned - _USHORT( RestartIndex ); // Index of entry after last returned - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x01 -- Data block - //USHORT DataLength; // Length of data - //UCHAR Data[]; // Queue elements -} RESP_GET_PRINT_QUEUE; -typedef RESP_GET_PRINT_QUEUE SMB_UNALIGNED *PRESP_GET_PRINT_QUEUE; - -#endif // def INCLUDE_SMB_PRINT - -#ifdef INCLUDE_SMB_TRANSACTION - -// -// Ioctl SMB, see #2 page 39 -// Function is SrvSmbIoctl() -// SMB_COM_IOCTL 0x27 -// SMB_COM_IOCTL_SECONDARY 0x28 -// - -typedef struct _REQ_IOCTL { - UCHAR WordCount; // Count of parameter words = 14 - _USHORT( Fid ); // File handle - _USHORT( Category ); // Device category - _USHORT( Function ); // Device function - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( MaxParameterCount ); // Max parameter bytes to return - _USHORT( MaxDataCount ); // Max data bytes to return - _ULONG( Timeout ); - _USHORT( Reserved ); - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_IOCTL; -typedef REQ_IOCTL SMB_UNALIGNED *PREQ_IOCTL; - -typedef struct _RESP_IOCTL_INTERIM { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_IOCTL_INTERIM; -typedef RESP_IOCTL_INTERIM SMB_UNALIGNED *PRESP_IOCTL_INTERIM; - -typedef struct _REQ_IOCTL_SECONDARY { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( ParameterDisplacement ); // Displacement of these param bytes - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( DataDisplacement ); // Displacement of these data bytes - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_IOCTL_SECONDARY; -typedef REQ_IOCTL_SECONDARY SMB_UNALIGNED *PREQ_IOCTL_SECONDARY; - -typedef struct _RESP_IOCTL { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( ParameterDisplacement ); // Displacement of these param bytes - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( DataDisplacement ); // Displacement of these data bytes - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} RESP_IOCTL; -typedef RESP_IOCTL SMB_UNALIGNED *PRESP_IOCTL; - -#endif // def INCLUDE_SMB_TRANSACTION - -#ifdef INCLUDE_SMB_LOCK - -// -// Lock Byte Range SMB, see #1 page 20 -// Function is SrvSmbLockByteRange() -// SMB_COM_LOCK_BYTE_RANGE 0x0C -// - -typedef struct _REQ_LOCK_BYTE_RANGE { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( Fid ); // File handle - _ULONG( Count ); // Count of bytes to lock - _ULONG( Offset ); // Offset from start of file - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_LOCK_BYTE_RANGE; -typedef REQ_LOCK_BYTE_RANGE SMB_UNALIGNED *PREQ_LOCK_BYTE_RANGE; - -typedef struct _RESP_LOCK_BYTE_RANGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_LOCK_BYTE_RANGE; -typedef RESP_LOCK_BYTE_RANGE SMB_UNALIGNED *PRESP_LOCK_BYTE_RANGE; - -#endif // def INCLUDE_SMB_LOCK - -#ifdef INCLUDE_SMB_LOCK - -// -// Locking and X SMB, see #2 page 46 -// Function is SrvLockingAndX() -// SMB_COM_LOCKING_ANDX 0x24 -// - -typedef struct _REQ_LOCKING_ANDX { - UCHAR WordCount; // Count of parameter words = 8 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - - // - // When NT protocol is not negotiated the OplockLevel field is - // omitted, and LockType field is a full word. Since the upper - // bits of LockType are never used, this definition works for - // all protocols. - // - - UCHAR( LockType ); // Locking mode: - // bit 0: 0 = lock out all access - // 1 = read OK while locked - // bit 1: 1 = 1 user total file unlock - UCHAR( OplockLevel ); // The new oplock level - _ULONG( Timeout ); - _USHORT( NumberOfUnlocks ); // Num. unlock range structs following - _USHORT( NumberOfLocks ); // Num. lock range structs following - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //LOCKING_ANDX_RANGE Unlocks[]; // Unlock ranges - //LOCKING_ANDX_RANGE Locks[]; // Lock ranges -} REQ_LOCKING_ANDX; -typedef REQ_LOCKING_ANDX SMB_UNALIGNED *PREQ_LOCKING_ANDX; - -#define LOCKING_ANDX_SHARED_LOCK 0x01 -#define LOCKING_ANDX_OPLOCK_RELEASE 0x02 -#define LOCKING_ANDX_CHANGE_LOCKTYPE 0x04 -#define LOCKING_ANDX_CANCEL_LOCK 0x08 -#define LOCKING_ANDX_LARGE_FILES 0x10 - -#define OPLOCK_BROKEN_TO_NONE 0 -#define OPLOCK_BROKEN_TO_II 1 - -typedef struct _LOCKING_ANDX_RANGE { - _USHORT( Pid ); // PID of process "owning" lock - _ULONG( Offset ); // Ofset to bytes to [un]lock - _ULONG( Length ); // Number of bytes to [un]lock -} LOCKING_ANDX_RANGE; -typedef LOCKING_ANDX_RANGE SMB_UNALIGNED *PLOCKING_ANDX_RANGE; - -typedef struct _NT_LOCKING_ANDX_RANGE { - _USHORT( Pid ); // PID of process "owning" lock - _USHORT( Pad ); // Pad to DWORD align (mbz) - _ULONG( OffsetHigh ); // Ofset to bytes to [un]lock (high) - _ULONG( OffsetLow ); // Ofset to bytes to [un]lock (low) - _ULONG( LengthHigh ); // Number of bytes to [un]lock (high) - _ULONG( LengthLow ); // Number of bytes to [un]lock (low) -} NTLOCKING_ANDX_RANGE; -typedef NTLOCKING_ANDX_RANGE SMB_UNALIGNED *PNTLOCKING_ANDX_RANGE; - // -typedef struct _RESP_LOCKING_ANDX { - UCHAR WordCount; // Count of parameter words = 2 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_LOCKING_ANDX; -typedef RESP_LOCKING_ANDX SMB_UNALIGNED *PRESP_LOCKING_ANDX; - -#define LOCK_BROKEN_SIZE 51 // # of bytes in lock broken notify - -#endif // def INCLUDE_SMB_LOCK - -#ifdef INCLUDE_SMB_ADMIN - -// -// Logoff and X SMB, see #3, page 55 -// SMB_COM_LOGOFF_ANDX 0x74 -// - -typedef struct _REQ_LOGOFF_ANDX { - UCHAR WordCount; // Count of parameter words = 2 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_LOGOFF_ANDX; -typedef REQ_LOGOFF_ANDX SMB_UNALIGNED *PREQ_LOGOFF_ANDX; - -typedef struct _RESP_LOGOFF_ANDX { - UCHAR WordCount; // Count of parameter words = 2 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_LOGOFF_ANDX; -typedef RESP_LOGOFF_ANDX SMB_UNALIGNED *PRESP_LOGOFF_ANDX; - -#endif // def INCLUDE_SMB_ADMIN - -#ifdef INCLUDE_SMB_FILE_CONTROL - -// -// Move SMB, see #2 page 49 -// Funcion is SrvSmbMove() -// SMB_COM_MOVE 0x2A -// - -typedef struct _REQ_MOVE { - UCHAR WordCount; // Count of parameter words = 3 - _USHORT( Tid2 ); // Second (target) file id - _USHORT( OpenFunction ); // what to do if target file exists - _USHORT( Flags ); // Flags to control move operations: - // 0 - target must be a file - // 1 - target must be a directory - // 2 - reserved (must be 0) - // 3 - reserved (must be 0) - // 4 - verify all writes - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR OldFileName[]; // Old file name - //UCHAR NewFileName[]; // New file name -} REQ_MOVE; -typedef REQ_MOVE SMB_UNALIGNED *PREQ_MOVE; - -typedef struct _RESP_MOVE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Number of files moved - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Pathname of file where error occurred -} RESP_MOVE; -typedef RESP_MOVE SMB_UNALIGNED *PRESP_MOVE; - -#endif // def INCLUDE_SMB_FILE_CONTROL - -#ifdef INCLUDE_SMB_ADMIN - -// -// Negotiate SMB's for Net 1 and Net 3, see #1 page 25 and #2 page 20 -// Function is SrvSmbNegotiate() -// SMB_COM_NEGOTIATE 0x72 -// - -typedef struct _REQ_NEGOTIATE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //struct { - // UCHAR BufferFormat; // 0x02 -- Dialect - // UCHAR DialectName[]; // ASCIIZ - //} Dialects[]; -} REQ_NEGOTIATE; -typedef REQ_NEGOTIATE *PREQ_NEGOTIATE; // *** NOT SMB_UNALIGNED! - -typedef struct _RESP_NEGOTIATE { - UCHAR WordCount; // Count of parameter words = 13 - _USHORT( DialectIndex ); // Index of selected dialect - _USHORT( SecurityMode ); // Security mode: - // bit 0: 0 = share, 1 = user - // bit 1: 1 = encrypt passwords - // bit 2: 1 = SMB security signatures enabled - // bit 3: 1 = SMB security signatures required - _USHORT( MaxBufferSize ); // Max transmit buffer size - _USHORT( MaxMpxCount ); // Max pending multiplexed requests - _USHORT( MaxNumberVcs ); // Max VCs between client and server - _USHORT( RawMode ); // Raw modes supported: - // bit 0: 1 = Read Raw supported - // bit 1: 1 = Write Raw supported - _ULONG( SessionKey ); - SMB_TIME ServerTime; // Current time at server - SMB_DATE ServerDate; // Current date at server - _USHORT( ServerTimeZone ); // Current time zone at server - _USHORT( EncryptionKeyLength ); // MBZ if this is not LM2.1 - _USHORT( Reserved ); // MBZ - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Password encryption key - //UCHAR EncryptionKey[]; // The challenge encryption key - //UCHAR PrimaryDomain[]; // The server's primary domain (2.1 only) -} RESP_NEGOTIATE; -typedef RESP_NEGOTIATE *PRESP_NEGOTIATE; // *** NOT SMB_UNALIGNED! - -// Macros for SecurityMode field, above -#define NEGOTIATE_USER_SECURITY 0x01 -#define NEGOTIATE_ENCRYPT_PASSWORDS 0x02 -#define NEGOTIATE_SECURITY_SIGNATURES_ENABLED 0x04 -#define NEGOTIATE_SECURITY_SIGNATURES_REQUIRED 0x08 - -// Macros for RawMode field, above -#define NEGOTIATE_READ_RAW_SUPPORTED 1 -#define NEGOTIATE_WRITE_RAW_SUPPORTED 2 - -typedef struct _RESP_OLD_NEGOTIATE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( DialectIndex ); // Index of selected dialect - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_OLD_NEGOTIATE; -typedef RESP_OLD_NEGOTIATE *PRESP_OLD_NEGOTIATE; // *** NOT SMB_UNALIGNED! - -typedef struct _RESP_NT_NEGOTIATE { - UCHAR WordCount; // Count of parameter words = 17 - _USHORT( DialectIndex ); // Index of selected dialect - UCHAR( SecurityMode ); // Security mode: - // bit 0: 0 = share, 1 = user - // bit 1: 1 = encrypt passwords - // bit 2: 1 = SMB sequence numbers enabled - // bit 3: 1 = SMB sequence numbers required - _USHORT( MaxMpxCount ); // Max pending multiplexed requests - _USHORT( MaxNumberVcs ); // Max VCs between client and server - _ULONG( MaxBufferSize ); // Max transmit buffer size - _ULONG( MaxRawSize ); // Maximum raw buffer size - _ULONG( SessionKey ); - _ULONG( Capabilities ); // Server capabilities - _ULONG( SystemTimeLow ); // System (UTC) time of the server (low). - _ULONG( SystemTimeHigh ); // System (UTC) time of the server (high). - _USHORT( ServerTimeZone ); // Time zone of server (min from UTC) - UCHAR( EncryptionKeyLength ); // Length of encryption key. - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Password encryption key - //UCHAR EncryptionKey[]; // The challenge encryption key - //UCHAR OemDomainName[]; // The name of the domain (in OEM chars) -} RESP_NT_NEGOTIATE; -typedef RESP_NT_NEGOTIATE *PRESP_NT_NEGOTIATE; // *** NOT SMB_UNALIGNED! - -#endif // def INCLUDE_SMB_ADMIN - -// -// Server / workstation capabilities -// N.B. Most messages use a ULONG for this, so there are many more -// bits available. -// - -#define CAP_RAW_MODE 0x0001 -#define CAP_MPX_MODE 0x0002 -#define CAP_UNICODE 0x0004 -#define CAP_LARGE_FILES 0x0008 -#define CAP_NT_SMBS 0x0010 -#define CAP_RPC_REMOTE_APIS 0x0020 -#define CAP_NT_STATUS 0x0040 -#define CAP_LEVEL_II_OPLOCKS 0x0080 -#define CAP_LOCK_AND_READ 0x0100 -#define CAP_NT_FIND 0x0200 -#define CAP_DFS 0x1000 // This server is DFS aware -#define CAP_INFOLEVEL_PASSTHRU 0x2000 // NT information level requests can pass through -#define CAP_LARGE_READX 0x4000 // Server supports oversized READ&X on files -#define CAP_LARGE_WRITEX 0x8000 - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Open SMB, see #1, page 7 -// Function is SrvSmbOpen() -// SMB_COM_OPEN 0x02 -// - -typedef struct _REQ_OPEN { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( DesiredAccess ); // Mode - read/write/share - _USHORT( SearchAttributes ); - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} REQ_OPEN; -typedef REQ_OPEN SMB_UNALIGNED *PREQ_OPEN; - -typedef struct _RESP_OPEN { - UCHAR WordCount; // Count of parameter words = 7 - _USHORT( Fid ); // File handle - _USHORT( FileAttributes ); - _ULONG( LastWriteTimeInSeconds ); - _ULONG( DataSize ); // File size - _USHORT( GrantedAccess ); // Access allowed - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_OPEN; -typedef RESP_OPEN SMB_UNALIGNED *PRESP_OPEN; - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Open and X SMB, see #2 page 51 -// Function is SrvOpenAndX() -// SMB_COM_OPEN_ANDX 0x2D -// - -typedef struct _REQ_OPEN_ANDX { - UCHAR WordCount; // Count of parameter words = 15 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Flags ); // Additional information: bit set- - // 0 - return additional info - // 1 - set single user total file lock - // 2 - server notifies consumer of - // actions which may change file - // 4 - return extended response - _USHORT( DesiredAccess ); // File open mode - _USHORT( SearchAttributes ); - _USHORT( FileAttributes ); - _ULONG( CreationTimeInSeconds ); - _USHORT( OpenFunction ); - _ULONG( AllocationSize ); // Bytes to reserve on create or truncate - _ULONG( Timeout ); // Max milliseconds to wait for resource - _ULONG( Reserved ); // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes; min = 1 - UCHAR Buffer[1]; // File name -} REQ_OPEN_ANDX; -typedef REQ_OPEN_ANDX SMB_UNALIGNED *PREQ_OPEN_ANDX; - -typedef struct _RESP_OPEN_ANDX { - UCHAR WordCount; // Count of parameter words = 15 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - _USHORT( FileAttributes ); - _ULONG( LastWriteTimeInSeconds ); - _ULONG( DataSize ); // Current file size - _USHORT( GrantedAccess ); // Access permissions actually allowed - _USHORT( FileType ); - _USHORT( DeviceState ); // state of IPC device (e.g. pipe) - _USHORT( Action ); // Action taken - _ULONG( ServerFid ); // Server unique file id - _USHORT( Reserved ); // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_OPEN_ANDX; -typedef RESP_OPEN_ANDX SMB_UNALIGNED *PRESP_OPEN_ANDX; - -typedef struct _REQ_NT_CREATE_ANDX { - UCHAR WordCount; // Count of parameter words = 24 - UCHAR AndXCommand; // Secondary command; 0xFF = None - UCHAR AndXReserved; // MBZ - _USHORT( AndXOffset ); // Offset to next command wordcount - UCHAR Reserved; // MBZ - _USHORT( NameLength ); // Length of Name[] in bytes - _ULONG( Flags ); // Create flags - _ULONG( RootDirectoryFid ); // If non-zero, open is relative to this directory - ACCESS_MASK DesiredAccess; // NT access desired - LARGE_INTEGER AllocationSize; // Initial allocation size - _ULONG( FileAttributes ); // File attributes for creation - _ULONG( ShareAccess ); // Type of share access - _ULONG( CreateDisposition ); // Action to take if file exists or not - _ULONG( CreateOptions ); // Options to use if creating a file - _ULONG( ImpersonationLevel ); // Security QOS information - UCHAR SecurityFlags; // Security QOS information - _USHORT( ByteCount ); // Length of byte parameters - UCHAR Buffer[1]; - //UCHAR Name[]; // File to open or create -} REQ_NT_CREATE_ANDX; -typedef REQ_NT_CREATE_ANDX SMB_UNALIGNED *PREQ_NT_CREATE_ANDX; - -// Flag bit for Security flags - -#define SMB_SECURITY_DYNAMIC_TRACKING 0x01 -#define SMB_SECURITY_EFFECTIVE_ONLY 0x02 - -typedef struct _RESP_NT_CREATE_ANDX { - UCHAR WordCount; // Count of parameter words = 26 - UCHAR AndXCommand; // Secondary command; 0xFF = None - UCHAR AndXReserved; // MBZ - _USHORT( AndXOffset ); // Offset to next command wordcount - UCHAR OplockLevel; // The oplock level granted - _USHORT( Fid ); // The file ID - _ULONG( CreateAction ); // The action taken - TIME CreationTime; // The time the file was created - TIME LastAccessTime; // The time the file was accessed - TIME LastWriteTime; // The time the file was last written - TIME ChangeTime; // The time the file was last changed - _ULONG( FileAttributes ); // The file attributes - LARGE_INTEGER AllocationSize; // The number of byes allocated - LARGE_INTEGER EndOfFile; // The end of file offset - _USHORT( FileType ); - union { - _USHORT( DeviceState ); // state of IPC device (e.g. pipe) - _USHORT( FileStatusFlags ); // if a file or directory. See below. - }; - BOOLEAN Directory; // TRUE if this is a directory - _USHORT( ByteCount ); // = 0 - UCHAR Buffer[1]; -} RESP_NT_CREATE_ANDX; -typedef RESP_NT_CREATE_ANDX SMB_UNALIGNED *PRESP_NT_CREATE_ANDX; - -// -// Values for FileStatusFlags, if the opened resource is a file or directory -// -#define SMB_FSF_NO_EAS 0x0001 // file/dir has no extended attributes -#define SMB_FSF_NO_SUBSTREAMS 0x0002 // file/dir has no substreams -#define SMB_FSF_NO_REPARSETAG 0x0004 // file/dir is not a reparse point - - -#define SMB_OPLOCK_LEVEL_NONE 0 -#define SMB_OPLOCK_LEVEL_EXCLUSIVE 1 -#define SMB_OPLOCK_LEVEL_BATCH 2 -#define SMB_OPLOCK_LEVEL_II 3 - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_PRINT - -// -// Open Print File SMB, see #1 page 27 -// Function is SrvSmbOpenPrintFile() -// SMB_COM_OPEN_PRINT_FILE 0xC0 -// - -typedef struct _REQ_OPEN_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( SetupLength ); // Length of printer setup data - _USHORT( Mode ); // 0 = Text mode (DOS expands TABs) - // 1 = Graphics mode - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR IdentifierString[]; // Identifier string -} REQ_OPEN_PRINT_FILE; -typedef REQ_OPEN_PRINT_FILE SMB_UNALIGNED *PREQ_OPEN_PRINT_FILE; - -typedef struct _RESP_OPEN_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_OPEN_PRINT_FILE; -typedef RESP_OPEN_PRINT_FILE SMB_UNALIGNED *PRESP_OPEN_PRINT_FILE; - -#endif // def INCLUDE_SMB_PRINT - -#ifdef INCLUDE_SMB_ADMIN - -// -// Process Exit SMB, see #1 page 22 -// Function is SrvSmbProcessExit() -// SMB_COM_PROCESS_EXIT 0x11 -// - -typedef struct _REQ_PROCESS_EXIT { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_PROCESS_EXIT; -typedef REQ_PROCESS_EXIT SMB_UNALIGNED *PREQ_PROCESS_EXIT; - -typedef struct _RESP_PROCESS_EXIT { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_PROCESS_EXIT; -typedef RESP_PROCESS_EXIT SMB_UNALIGNED *PRESP_PROCESS_EXIT; - -#endif // def INCLUDE_SMB_ADMIN - -#ifdef INCLUDE_SMB_QUERY_SET - -// -// Query Information SMB, see #1 page 18 -// Function is SrvSmbQueryInformation() -// SMB_COM_QUERY_INFORMATION 0x08 -// - -typedef struct _REQ_QUERY_INFORMATION { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} REQ_QUERY_INFORMATION; -typedef REQ_QUERY_INFORMATION SMB_UNALIGNED *PREQ_QUERY_INFORMATION; - -typedef struct _RESP_QUERY_INFORMATION { - UCHAR WordCount; // Count of parameter words = 10 - _USHORT( FileAttributes ); - _ULONG( LastWriteTimeInSeconds ); - _ULONG( FileSize ); // File size - _USHORT( Reserved )[5]; // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_QUERY_INFORMATION; -typedef RESP_QUERY_INFORMATION SMB_UNALIGNED *PRESP_QUERY_INFORMATION; - -#endif // def INCLUDE_SMB_QUERY_SET - -#ifdef INCLUDE_SMB_QUERY_SET - -// -// Query Information2 SMB, see #2 page 37 -// Function is SrvSmbQueryInformation2() -// SMB_COM_QUERY_INFORMATION2 0x23 -// - -typedef struct _REQ_QUERY_INFORMATION2 { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_QUERY_INFORMATION2; -typedef REQ_QUERY_INFORMATION2 SMB_UNALIGNED *PREQ_QUERY_INFORMATION2; - -typedef struct _RESP_QUERY_INFORMATION2 { - UCHAR WordCount; // Count of parameter words = 11 - SMB_DATE CreationDate; - SMB_TIME CreationTime; - SMB_DATE LastAccessDate; - SMB_TIME LastAccessTime; - SMB_DATE LastWriteDate; - SMB_TIME LastWriteTime; - _ULONG( FileDataSize ); // File end of data - _ULONG( FileAllocationSize ); // File allocation size - _USHORT( FileAttributes ); - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Reserved buffer -} RESP_QUERY_INFORMATION2; -typedef RESP_QUERY_INFORMATION2 SMB_UNALIGNED *PRESP_QUERY_INFORMATION2; - -#endif // def INCLUDE_SMB_QUERY_SET - -#ifdef INCLUDE_SMB_MISC - -// -// Query Information Disk SMB, see #1 page 24 -// Function is SrvSmbQueryInformationDisk() -// SMB_COM_QUERY_INFORMATION_DISK 0x80 -// - -typedef struct _REQ_QUERY_INFORMATION_DISK { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_QUERY_INFORMATION_DISK; -typedef REQ_QUERY_INFORMATION_DISK SMB_UNALIGNED *PREQ_QUERY_INFORMATION_DISK; - -typedef struct _RESP_QUERY_INFORMATION_DISK { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( TotalUnits ); // Total allocation units per server - _USHORT( BlocksPerUnit ); // Blocks per allocation unit - _USHORT( BlockSize ); // Block size (in bytes) - _USHORT( FreeUnits ); // Number of free units - _USHORT( Reserved ); // Reserved (media identification code) - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_QUERY_INFORMATION_DISK; -typedef RESP_QUERY_INFORMATION_DISK SMB_UNALIGNED *PRESP_QUERY_INFORMATION_DISK; - -#endif // def INCLUDE_SMB_MISC - -#ifdef INCLUDE_SMB_MISC - -// -// Query Server Information SMB, see #? page ?? -// Function is SrvSmbQueryInformationServer -// SMB_COM_QUERY_INFORMATION_SRV 0x21 -// - -typedef struct _REQ_QUERY_INFORMATION_SRV { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Mode ); - _USHORT( ByteCount ); // Count of data bytes; min = - UCHAR Buffer[1]; // -} REQ_QUERY_INFORMATION_SRV; -typedef REQ_QUERY_INFORMATION_SRV SMB_UNALIGNED *PREQ_QUERY_INFORMATION_SRV; - -typedef struct _RESP_QUERY_INFORMATION_SRV { - UCHAR WordCount; // Count of parameter words = 20 - _ULONG( smb_fsid ); - _ULONG( BlocksPerUnit ); - _ULONG( smb_aunits ); - _ULONG( smb_fau ); - _USHORT( BlockSize ); - SMB_DATE smb_vldate; - SMB_TIME smb_vltime; - UCHAR smb_vllen; - UCHAR Reserved; // Reserved (must be 0) - _USHORT( SecurityMode ); - _USHORT( BlockMode ); - _ULONG( Services ); - _USHORT( MaxTransmitSize ); - _USHORT( MaxMpxCount ); - _USHORT( MaxNumberVcs ); - SMB_TIME ServerTime; - SMB_DATE ServerDate; - _USHORT( ServerTimeZone ); - _ULONG( Reserved2 ); - _USHORT( ByteCount ); // Count of data bytes; min = - UCHAR Buffer[1]; // -} RESP_QUERY_INFORMATION_SRV; -typedef RESP_QUERY_INFORMATION_SRV SMB_UNALIGNED *PRESP_QUERY_INFORMATION_SRV; - -#endif // def INCLUDE_SMB_MISC - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Read SMB, see #1 page 12 -// Lock and Read SMB, see #2 page 44 -// SMB_COM_READ 0x0A, Function is SrvSmbRead -// SMB_COM_LOCK_AND_READ 0x13, Function is SrvSmbLockAndRead -// - -typedef struct _REQ_READ { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Count of bytes being requested - _ULONG( Offset ); // Offset in file of first byte to read - _USHORT( Remaining ); // Estimate of bytes to read if nonzero - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_READ; -typedef REQ_READ SMB_UNALIGNED *PREQ_READ; - -// -// *** Warning: the following structure is defined the way it is to -// ensure longword alignment of the data buffer. (This only matters -// when packing is disabled; when packing is turned on, the right -// thing happens no matter what.) -// - -typedef struct _RESP_READ { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( Count ); // Count of bytes actually returned - _USHORT( Reserved )[4]; // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes - //UCHAR Buffer[1]; // Buffer containing: - UCHAR BufferFormat; // 0x01 -- Data block - _USHORT( DataLength ); // Length of data - ULONG Buffer[1]; // Data -} RESP_READ; -typedef RESP_READ SMB_UNALIGNED *PRESP_READ; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Read and X SMB, see #2 page 56 -// Function is SrvSmbReadAndX() -// SMB_COM_READ_ANDX 0x2E -// - -typedef struct _REQ_READ_ANDX { - UCHAR WordCount; // Count of parameter words = 10 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin read - _USHORT( MaxCount ); // Max number of bytes to return - _USHORT( MinCount ); // Min number of bytes to return - _ULONG( Timeout ); - _USHORT( Remaining ); // Bytes remaining to satisfy request - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_READ_ANDX; -typedef REQ_READ_ANDX SMB_UNALIGNED *PREQ_READ_ANDX; - -typedef struct _REQ_NT_READ_ANDX { - UCHAR WordCount; // Count of parameter words = 12 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin read - _USHORT( MaxCount ); // Max number of bytes to return - _USHORT( MinCount ); // Min number of bytes to return - union { - _ULONG( Timeout ); - _USHORT( MaxCountHigh ); // upper 16 bits of MaxCount if NT request - }; - _USHORT( Remaining ); // Bytes remaining to satisfy request - _ULONG( OffsetHigh ); // Used for NT Protocol only - // Upper 32 bits of offset - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_NT_READ_ANDX; -typedef REQ_NT_READ_ANDX SMB_UNALIGNED *PREQ_NT_READ_ANDX; - -typedef struct _RESP_READ_ANDX { - UCHAR WordCount; // Count of parameter words = 12 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Remaining ); // Bytes remaining to be read - _USHORT( DataCompactionMode ); - _USHORT( Reserved ); // Reserved (must be 0) - _USHORT( DataLength ); // Number of data bytes (min = 0) - _USHORT( DataOffset ); // Offset (from header start) to data - union { - _USHORT( Reserved2 ); // Reserved (must be 0) - _USHORT( DataLengthHigh ); // upper 16 bits of DataLength if NT request - }; - _ULONG( Reserved3 )[2]; // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes. Inaccurate if we - // are doing large Read&X's! - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (size = DataLength) -} RESP_READ_ANDX; -typedef RESP_READ_ANDX SMB_UNALIGNED *PRESP_READ_ANDX; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_MPX - -// -// Read Block Multiplexed SMB, see #2 page 58 -// Function is SrvSmbReadMpx() -// SMB_COM_READ_MPX 0x1B -// SMB_COM_READ_MPX_SECONDARY 0x1C -// - -typedef struct _REQ_READ_MPX { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin read - _USHORT( MaxCount ); // Max bytes to return (max 65535) - _USHORT( MinCount ); // Min bytes to return (normally 0) - _ULONG( Timeout ); - _USHORT( Reserved ); - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_READ_MPX; -typedef REQ_READ_MPX SMB_UNALIGNED *PREQ_READ_MPX; - -typedef struct _RESP_READ_MPX { - UCHAR WordCount; // Count of parameter words = 8 - _ULONG( Offset ); // Offset in file where data read - _USHORT( Count ); // Total bytes being returned - _USHORT( Remaining ); // Bytes remaining to be read (pipe/dev) - _USHORT( DataCompactionMode ); - _USHORT( Reserved ); - _USHORT( DataLength ); // Number of data bytes this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (size = DataLength) -} RESP_READ_MPX; -typedef RESP_READ_MPX SMB_UNALIGNED *PRESP_READ_MPX; - -#endif // def INCLUDE_SMB_MPX - -#ifdef INCLUDE_SMB_RAW - -// -// Read Block Raw SMB, see #2 page 61 -// Function is SrvSmbReadRaw() -// SMB_COM_READ_RAW 0x1A -// - -typedef struct _REQ_READ_RAW { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin read - _USHORT( MaxCount ); // Max bytes to return (max 65535) - _USHORT( MinCount ); // Min bytes to return (normally 0) - _ULONG( Timeout ); - _USHORT( Reserved ); - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_READ_RAW; -typedef REQ_READ_RAW SMB_UNALIGNED *PREQ_READ_RAW; - -typedef struct _REQ_NT_READ_RAW { - UCHAR WordCount; // Count of parameter words = 10 - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin read - _USHORT( MaxCount ); // Max bytes to return (max 65535) - _USHORT( MinCount ); // Min bytes to return (normally 0) - _ULONG( Timeout ); - _USHORT( Reserved ); - _ULONG( OffsetHigh ); // Used for NT Protocol only - // Upper 32 bits of offset - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_NT_READ_RAW; -typedef REQ_NT_READ_RAW SMB_UNALIGNED *PREQ_NT_READ_RAW; - -// No response params for raw read--the response is the raw data. - -#endif // def INCLUDE_SMB_RAW - -#ifdef INCLUDE_SMB_FILE_CONTROL - -// -// Rename SMB, see #1 page 17 -// Function is SrvSmbRename() -// SMB_COM_RENAME 0x07 -// - -typedef struct _REQ_RENAME { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( SearchAttributes ); - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR OldFileName[]; // Old file name - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR NewFileName[]; // New file name -} REQ_RENAME; -typedef REQ_RENAME SMB_UNALIGNED *PREQ_RENAME; - - -// -// Extended NT rename SMB -// Function is SrvSmbRename() -// SMB_COM_NT_RENAME 0xA5 -// - -typedef struct _REQ_NTRENAME { - UCHAR WordCount; // Count of parameter words = 4 - _USHORT( SearchAttributes ); - _USHORT( InformationLevel ); - _ULONG( ClusterCount ); - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR OldFileName[]; // Old file name - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR NewFileName[]; // New file name -} REQ_NTRENAME; -typedef REQ_NTRENAME SMB_UNALIGNED *PREQ_NTRENAME; - -typedef struct _RESP_RENAME { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_RENAME; -typedef RESP_RENAME SMB_UNALIGNED *PRESP_RENAME; - -#endif // def INCLUDE_SMB_FILE_CONTROL - -#ifdef INCLUDE_SMB_SEARCH - -// -// Search SMBs. One structure is common for both the core Search and the -// LAN Manager 1.0 Find First/Next/Close. -// -// Function is SrvSmbSearch() -// -// Search, see #1 page 26 -// SMB_COM_SEARCH 0x81 -// FindFirst and FindNext, see #2 page 27 -// SMB_COM_FIND 0x82 -// FindUnique, see #2 page 33 -// SMB_COM_FIND_UNIQUE 0x83 -// FindClose, see #2 page 31 -// SMB_COM_FIND_CLOSE 0x84 -// - -typedef struct _REQ_SEARCH { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( MaxCount ); // Number of dir. entries to return - _USHORT( SearchAttributes ); - _USHORT( ByteCount ); // Count of data bytes; min = 5 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR FileName[]; // File name, may be null - //UCHAR BufferFormat2; // 0x05 -- Variable block - //USHORT ResumeKeyLength; // Length of resume key, may be 0 - //UCHAR SearchStatus[]; // Resume key -} REQ_SEARCH; -typedef REQ_SEARCH SMB_UNALIGNED *PREQ_SEARCH; - -typedef struct _RESP_SEARCH { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Number of entries returned - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x05 -- Variable block - //USHORT DataLength; // Length of data - //UCHAR Data[]; // Data -} RESP_SEARCH; -typedef RESP_SEARCH SMB_UNALIGNED *PRESP_SEARCH; - -// -// These two structures are use to return information in the Search SMBs. -// SMB_DIRECTORY_INFORMATION is used to return information about a file -// that was found. In addition to the usual information about the file, -// each of these structures contains an SMB_RESUME_KEY, which is used to -// continue or rewind a search. -// -// These structures must be packed, so turn on packing if it isn't -// already on. -// - -#ifdef NO_PACKING -#include -#endif // def NO_PACKING - -typedef struct _SMB_RESUME_KEY { - UCHAR Reserved; // bit 7 - comsumer use - // bits 5,6 - system use (must preserve) - // bits 0-4 - server use (must preserve) - UCHAR FileName[11]; - UCHAR Sid; // Uniquely identifies Find through Close - _ULONG( FileIndex ); // Reserved for server use - UCHAR Consumer[4]; // Reserved for comsumer use -} SMB_RESUME_KEY; -typedef SMB_RESUME_KEY SMB_UNALIGNED *PSMB_RESUME_KEY; - -typedef struct _SMB_DIRECTORY_INFORMATION { - SMB_RESUME_KEY ResumeKey; - UCHAR FileAttributes; - SMB_TIME LastWriteTime; - SMB_DATE LastWriteDate; - _ULONG( FileSize ); - UCHAR FileName[13]; // ASCII, space-filled null terminated -} SMB_DIRECTORY_INFORMATION; -typedef SMB_DIRECTORY_INFORMATION SMB_UNALIGNED *PSMB_DIRECTORY_INFORMATION; - -#ifdef NO_PACKING -#include -#endif // def NO_PACKING - -#endif // def INCLUDE_SMB_SEARCH - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Seek SMB, see #1 page 14 -// Function is SrvSmbSeek -// SMB_COM_SEEK 0x12 -// - -typedef struct _REQ_SEEK { - UCHAR WordCount; // Count of parameter words = 4 - _USHORT( Fid ); // File handle - _USHORT( Mode ); // Seek mode: - // 0 = from start of file - // 1 = from current position - // 2 = from end of file - _ULONG( Offset ); // Relative offset - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_SEEK; -typedef REQ_SEEK SMB_UNALIGNED *PREQ_SEEK; - -typedef struct _RESP_SEEK { - UCHAR WordCount; // Count of parameter words = 2 - _ULONG( Offset ); // Offset from start of file - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SEEK; -typedef RESP_SEEK SMB_UNALIGNED *PRESP_SEEK; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Send Broadcast Message SMB, see #1 page 32 -// Function is SrvSmbSendBroadcastMessage() -// SMB_COM_SEND_BROADCAST_MESSAGE 0xD1 -// - -typedef struct _REQ_SEND_BROADCAST_MESSAGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 8 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR OriginatorName[]; // Originator name (max = 15) - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR DestinationName[]; // "*" - //UCHAR BufferFormat3; // 0x01 -- Data block - //USHORT DataLength; // Length of message; max = 128 - //UCHAR Data[]; // Message -} REQ_SEND_BROADCAST_MESSAGE; -typedef REQ_SEND_BROADCAST_MESSAGE SMB_UNALIGNED *PREQ_SEND_BROADCAST_MESSAGE; - -// No response for Send Broadcast Message - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Send End of Multi-block Message SMB, see #1 page 33 -// Function is SrvSmbSendEndMbMessage() -// SMB_COM_SEND_END_MB_MESSAGE 0xD6 -// - -typedef struct _REQ_SEND_END_MB_MESSAGE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( MessageGroupId ); - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_SEND_END_MB_MESSAGE; -typedef REQ_SEND_END_MB_MESSAGE SMB_UNALIGNED *PREQ_SEND_END_MB_MESSAGE; - -typedef struct _RESP_SEND_END_MB_MESSAGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SEND_END_MB_MESSAGE; -typedef RESP_SEND_END_MB_MESSAGE SMB_UNALIGNED *PRESP_SEND_END_MB_MESSAGE; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Send Single Block Message SMB, see #1 page 31 -// Function is SrvSmbSendMessage() -// SMB_COM_SEND_MESSAGE 0xD0 -// - -typedef struct _REQ_SEND_MESSAGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 7 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR OriginatorName[]; // Originator name (max = 15) - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR DestinationName[]; // Destination name (max = 15) - //UCHAR BufferFormat3; // 0x01 -- Data block - //USHORT DataLength; // Length of message; max = 128 - //UCHAR Data[]; // Message -} REQ_SEND_MESSAGE; -typedef REQ_SEND_MESSAGE SMB_UNALIGNED *PREQ_SEND_MESSAGE; - -typedef struct _RESP_SEND_MESSAGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SEND_MESSAGE; -typedef RESP_SEND_MESSAGE SMB_UNALIGNED *PRESP_SEND_MESSAGE; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Send Start of Multi-block Message SMB, see #1 page 32 -// Function is SrvSmbSendStartMbMessage() -// SMB_COM_SEND_START_MB_MESSAGE 0xD5 -// - -typedef struct _REQ_SEND_START_MB_MESSAGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR OriginatorName[]; // Originator name (max = 15) - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR DestinationName[]; // Destination name (max = 15) -} REQ_SEND_START_MB_MESSAGE; -typedef REQ_SEND_START_MB_MESSAGE SMB_UNALIGNED *PREQ_SEND_START_MB_MESSAGE; - -typedef struct _RESP_SEND_START_MB_MESSAGE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( MessageGroupId ); - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SEND_START_MB_MESSAGE; -typedef RESP_SEND_START_MB_MESSAGE SMB_UNALIGNED *PSEND_START_MB_MESSAGE; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_MESSAGE - -// -// Send Text of Multi-block Message SMB, see #1 page 33 -// Function is SrvSmbSendTextMbMessage() -// SMB_COM_SEND_TEXT_MB_MESSAGE 0xD7 -// - -typedef struct _REQ_SEND_TEXT_MB_MESSAGE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( MessageGroupId ); - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x01 -- Data block - //USHORT DataLength; // Length of message; max = 128 - //UCHAR Data[]; // Message -} REQ_SEND_TEXT_MB_MESSAGE; -typedef REQ_SEND_TEXT_MB_MESSAGE SMB_UNALIGNED *PREQ_SEND_TEXT_MB_MESSAGE; - -typedef struct _RESP_SEND_TEXT_MB_MESSAGE { - UCHAR WordCount; // Count of aprameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SEND_TEXT_MB_MESSAGE; -typedef RESP_SEND_TEXT_MB_MESSAGE SMB_UNALIGNED *PRESP_SEND_TEXT_MB_MESSAGE; - -#endif // def INCLUDE_SMB_MESSAGE - -#ifdef INCLUDE_SMB_ADMIN - -// -// Session Setup and X SMB, see #2 page 63 and #3 page 10 -// Function is SrvSmbSessionSetupAndX() -// SMB_COM_SESSION_SETUP_ANDX 0x73 -// - -typedef struct _REQ_SESSION_SETUP_ANDX { - UCHAR WordCount; // Count of parameter words = 10 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( MaxBufferSize ); // Consumer's maximum buffer size - _USHORT( MaxMpxCount ); // Actual maximum multiplexed pending requests - _USHORT( VcNumber ); // 0 = first (only), nonzero=additional VC number - _ULONG( SessionKey ); // Session key (valid iff VcNumber != 0) - _USHORT( PasswordLength ); // Account password size - _ULONG( Reserved ); - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR AccountPassword[]; // Account Password - //UCHAR AccountName[]; // Account Name - //UCHAR PrimaryDomain[]; // Client's primary domain - //UCHAR NativeOS[]; // Client's native operating system - //UCHAR NativeLanMan[]; // Client's native LAN Manager type -} REQ_SESSION_SETUP_ANDX; -typedef REQ_SESSION_SETUP_ANDX SMB_UNALIGNED *PREQ_SESSION_SETUP_ANDX; - -typedef struct _REQ_NT_SESSION_SETUP_ANDX { - UCHAR WordCount; // Count of parameter words = 13 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( MaxBufferSize ); // Consumer's maximum buffer size - _USHORT( MaxMpxCount ); // Actual maximum multiplexed pending requests - _USHORT( VcNumber ); // 0 = first (only), nonzero=additional VC number - _ULONG( SessionKey ); // Session key (valid iff VcNumber != 0) - _USHORT( CaseInsensitivePasswordLength ); // Account password size, ANSI - _USHORT( CaseSensitivePasswordLength ); // Account password size, Unicode - _ULONG( Reserved); - _ULONG( Capabilities ); // Client capabilities - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR CaseInsensitivePassword[]; // Account Password, ANSI - //UCHAR CaseSensitivePassword[]; // Account Password, Unicode - //UCHAR AccountName[]; // Account Name - //UCHAR PrimaryDomain[]; // Client's primary domain - //UCHAR NativeOS[]; // Client's native operating system - //UCHAR NativeLanMan[]; // Client's native LAN Manager type -} REQ_NT_SESSION_SETUP_ANDX; -typedef REQ_NT_SESSION_SETUP_ANDX SMB_UNALIGNED *PREQ_NT_SESSION_SETUP_ANDX; - -// -// Action flags in the response -// -#define SMB_SETUP_GUEST 0x0001 // Session setup as a guest -#define SMB_SETUP_USE_LANMAN_KEY 0x0002 // Use the Lan Manager setup key. - -typedef struct _RESP_SESSION_SETUP_ANDX { - UCHAR WordCount; // Count of parameter words = 3 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Action ); // Request mode: - // bit0 = logged in as GUEST - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR NativeOS[]; // Server's native operating system - //UCHAR NativeLanMan[]; // Server's native LAN Manager type - //UCHAR PrimaryDomain[]; // Server's primary domain -} RESP_SESSION_SETUP_ANDX; -typedef RESP_SESSION_SETUP_ANDX SMB_UNALIGNED *PRESP_SESSION_SETUP_ANDX; - -#endif // def INCLUDE_SMB_ADMIN - -#ifdef INCLUDE_SMB_QUERY_SET - -// -// Set Information SMB, see #1 page 19 -// Function is SrvSmbSetInformation() -// SMB_COM_SET_INFORMATION 0x09 -// - -typedef struct _REQ_SET_INFORMATION { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( FileAttributes ); - _ULONG( LastWriteTimeInSeconds ); - _USHORT( Reserved )[5]; // Reserved (must be 0) - _USHORT( ByteCount ); // Count of data bytes; min = 2 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x04 -- ASCII - //UCHAR FileName[]; // File name -} REQ_SET_INFORMATION; -typedef REQ_SET_INFORMATION SMB_UNALIGNED *PREQ_SET_INFORMATION; - -typedef struct _RESP_SET_INFORMATION { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SET_INFORMATION; -typedef RESP_SET_INFORMATION SMB_UNALIGNED *PRESP_SET_INFORMATION; - -#endif // def INCLUDE_SMB_QUERY_SET - -#ifdef INCLUDE_SMB_QUERY_SET - -// -// Set Information2 SMB, see #2 page 66 -// Function is SrvSmbSetInformation2 -// SMB_COM_SET_INFORMATION2 0x22 -// - -typedef struct _REQ_SET_INFORMATION2 { - UCHAR WordCount; // Count of parameter words = 7 - _USHORT( Fid ); // File handle - SMB_DATE CreationDate; - SMB_TIME CreationTime; - SMB_DATE LastAccessDate; - SMB_TIME LastAccessTime; - SMB_DATE LastWriteDate; - SMB_TIME LastWriteTime; - _USHORT( ByteCount ); // Count of data bytes; min = 0 - UCHAR Buffer[1]; // Reserved buffer -} REQ_SET_INFORMATION2; -typedef REQ_SET_INFORMATION2 SMB_UNALIGNED *PREQ_SET_INFORMATION2; - -typedef struct _RESP_SET_INFORMATION2 { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_SET_INFORMATION2; -typedef RESP_SET_INFORMATION2 SMB_UNALIGNED *PRESP_SET_INFORMATION2; - -#endif // def INCLUDE_SMB_QUERY_SET - -#ifdef INCLUDE_SMB_TRANSACTION - -// -// Transaction and Transaction2 SMBs, see #2 page 68 and #3 page 13 -// Function is SrvSmbTransaction() -// SMB_COM_TRANSACTION 0x25 -// SMB_COM_TRANSACTION_SECONDARY 0x26 -// SMB_COM_TRANSACTION2 0x32 -// SMB_COM_TRANSACTION2_SECONDARY 0x33 -// -// Structures for specific transaction types are defined in smbtrans.h. -// -// *** The Transaction2 secondary request format includes a USHORT Fid -// field that we ignore. We can do this because the Fid field -// occurs at the end of the word parameters part of the request, and -// because the rest of the request (parameter and data bytes) is -// pointed by offset fields occurring prior to the Fid field. (The -// Fid field was added to speed up dispatching in the OS/2 server, -// in which different worker processes handle each Fid. The NT -// server has only one process.) -// - -typedef struct _REQ_TRANSACTION { - UCHAR WordCount; // Count of parameter words; value = (14 + SetupCount) - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( MaxParameterCount ); // Max parameter bytes to return - _USHORT( MaxDataCount ); // Max data bytes to return - UCHAR MaxSetupCount; // Max setup words to return - UCHAR Reserved; - _USHORT( Flags ); // Additional information: - // bit 0 - also disconnect TID in Tid - // bit 1 - one-way transacion (no resp) - _ULONG( Timeout ); - _USHORT( Reserved2 ); - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - UCHAR SetupCount; // Count of setup words - UCHAR Reserved3; // Reserved (pad above to word) - UCHAR Buffer[1]; // Buffer containing: - //USHORT Setup[]; // Setup words (# = SetupWordCount) - //USHORT ByteCount; // Count of data bytes - //UCHAR Name[]; // Name of transaction (NULL if Transact2) - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_TRANSACTION; -typedef REQ_TRANSACTION SMB_UNALIGNED *PREQ_TRANSACTION; - -#define SMB_TRANSACTION_DISCONNECT 1 -#define SMB_TRANSACTION_NO_RESPONSE 2 -#define SMB_TRANSACTION_RECONNECTING 4 -#define SMB_TRANSACTION_DFSFILE 8 - -typedef struct _RESP_TRANSACTION_INTERIM { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_TRANSACTION_INTERIM; -typedef RESP_TRANSACTION_INTERIM SMB_UNALIGNED *PRESP_TRANSACTION_INTERIM; - -typedef struct _REQ_TRANSACTION_SECONDARY { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( ParameterDisplacement ); // Displacement of these param bytes - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( DataDisplacement ); // Displacement of these data bytes - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_TRANSACTION_SECONDARY; -typedef REQ_TRANSACTION_SECONDARY SMB_UNALIGNED *PREQ_TRANSACTION_SECONDARY; - -typedef struct _RESP_TRANSACTION { - UCHAR WordCount; // Count of data bytes; value = 10 + SetupCount - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( Reserved ); - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( ParameterDisplacement ); // Displacement of these param bytes - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( DataDisplacement ); // Displacement of these data bytes - UCHAR SetupCount; // Count of setup words - UCHAR Reserved2; // Reserved (pad above to word) - UCHAR Buffer[1]; // Buffer containing: - //USHORT Setup[]; // Setup words (# = SetupWordCount) - //USHORT ByteCount; // Count of data bytes - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} RESP_TRANSACTION; -typedef RESP_TRANSACTION SMB_UNALIGNED *PRESP_TRANSACTION; - -typedef struct _REQ_NT_TRANSACTION { - UCHAR WordCount; // Count of parameter words; value = (19 + SetupCount) - UCHAR MaxSetupCount; // Max setup words to return - _USHORT( Flags ); // Currently unused - _ULONG( TotalParameterCount ); // Total parameter bytes being sent - _ULONG( TotalDataCount ); // Total data bytes being sent - _ULONG( MaxParameterCount ); // Max parameter bytes to return - _ULONG( MaxDataCount ); // Max data bytes to return - _ULONG( ParameterCount ); // Parameter bytes sent this buffer - _ULONG( ParameterOffset ); // Offset (from header start) to params - _ULONG( DataCount ); // Data bytes sent this buffer - _ULONG( DataOffset ); // Offset (from header start) to data - UCHAR SetupCount; // Count of setup words - _USHORT( Function ); // The transaction function code - UCHAR Buffer[1]; - //USHORT Setup[]; // Setup words (# = SetupWordCount) - //USHORT ByteCount; // Count of data bytes - //UCHAR Pad1[]; // Pad to LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad2[]; // Pad to LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_NT_TRANSACTION; -typedef REQ_NT_TRANSACTION SMB_UNALIGNED *PREQ_NT_TRANSACTION; - -#define SMB_TRANSACTION_DISCONNECT 1 -#define SMB_TRANSACTION_NO_RESPONSE 2 - -typedef struct _RESP_NT_TRANSACTION_INTERIM { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; -} RESP_NT_TRANSACTION_INTERIM; -typedef RESP_NT_TRANSACTION_INTERIM SMB_UNALIGNED *PRESP_NT_TRANSACTION_INTERIM; - -typedef struct _REQ_NT_TRANSACTION_SECONDARY { - UCHAR WordCount; // Count of parameter words = 18 - UCHAR Reserved1; // MBZ - _USHORT( Reserved2 ); // MBZ - _ULONG( TotalParameterCount ); // Total parameter bytes being sent - _ULONG( TotalDataCount ); // Total data bytes being sent - _ULONG( ParameterCount ); // Parameter bytes sent this buffer - _ULONG( ParameterOffset ); // Offset (from header start) to params - _ULONG( ParameterDisplacement ); // Displacement of these param bytes - _ULONG( DataCount ); // Data bytes sent this buffer - _ULONG( DataOffset ); // Offset (from header start) to data - _ULONG( DataDisplacement ); // Displacement of these data bytes - UCHAR Reserved3; - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; - //UCHAR Pad1[]; // Pad to LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad2[]; // Pad to LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} REQ_NT_TRANSACTION_SECONDARY; -typedef REQ_NT_TRANSACTION_SECONDARY SMB_UNALIGNED *PREQ_NT_TRANSACTION_SECONDARY; - -typedef struct _RESP_NT_TRANSACTION { - UCHAR WordCount; // Count of data bytes; value = 18 + SetupCount - UCHAR Reserved1; - _USHORT( Reserved2 ); - _ULONG( TotalParameterCount ); // Total parameter bytes being sent - _ULONG( TotalDataCount ); // Total data bytes being sent - _ULONG( ParameterCount ); // Parameter bytes sent this buffer - _ULONG( ParameterOffset ); // Offset (from header start) to params - _ULONG( ParameterDisplacement ); // Displacement of these param bytes - _ULONG( DataCount ); // Data bytes sent this buffer - _ULONG( DataOffset ); // Offset (from header start) to data - _ULONG( DataDisplacement ); // Displacement of these data bytes - UCHAR SetupCount; // Count of setup words - UCHAR Buffer[1]; - //USHORT Setup[]; // Setup words (# = SetupWordCount) - //USHORT ByteCount; // Count of data bytes - //UCHAR Pad1[]; // Pad to LONG - //UCHAR Parameters[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad2[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} RESP_NT_TRANSACTION; -typedef RESP_NT_TRANSACTION SMB_UNALIGNED *PRESP_NT_TRANSACTION; - -#endif // def INCLUDE_SMB_TRANSACTION - -#ifdef INCLUDE_SMB_TREE - -// -// Tree Connect SMB, see #1, page 6 -// Function is SrvSmbTreeConnect() -// SMB_COM_TREE_CONNECT 0x70 -// - -typedef struct _REQ_TREE_CONNECT { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat1; // 0x04 -- ASCII - //UCHAR Path[]; // Server name and share name - //UCHAR BufferFormat2; // 0x04 -- ASCII - //UCHAR Password[]; // Password - //UCHAR BufferFormat3; // 0x04 -- ASCII - //UCHAR Service[]; // Service name -} REQ_TREE_CONNECT; -typedef REQ_TREE_CONNECT SMB_UNALIGNED *PREQ_TREE_CONNECT; - -typedef struct _RESP_TREE_CONNECT { - UCHAR WordCount; // Count of parameter words = 2 - _USHORT( MaxBufferSize ); // Max size message the server handles - _USHORT( Tid ); // Tree ID - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_TREE_CONNECT; -typedef RESP_TREE_CONNECT SMB_UNALIGNED *PRESP_TREE_CONNECT; - -#endif // def INCLUDE_SMB_TREE - -#ifdef INCLUDE_SMB_TREE - -// -// Tree Connect and X SMB, see #2, page 88 -// Function is SrvSmbTreeConnectAndX() -// SMB_COM_TREE_CONNECT_ANDX 0x75 -// -// TREE_CONNECT_ANDX flags - -#define TREE_CONNECT_ANDX_DISCONNECT_TID (0x1) -// #define TREE_CONNECT_ANDX_W95 (0x2) -- W95 sets this flag. Don't know why. - -typedef struct _REQ_TREE_CONNECT_ANDX { - UCHAR WordCount; // Count of parameter words = 4 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Flags ); // Additional information - // bit 0 set = disconnect Tid - // bit 7 set = extended response - _USHORT( PasswordLength ); // Length of Password[] - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Password[]; // Password - //UCHAR Path[]; // Server name and share name - //UCHAR Service[]; // Service name -} REQ_TREE_CONNECT_ANDX; -typedef REQ_TREE_CONNECT_ANDX SMB_UNALIGNED *PREQ_TREE_CONNECT_ANDX; - -typedef struct _RESP_TREE_CONNECT_ANDX { - UCHAR WordCount; // Count of parameter words = 2 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Service type connected to -} RESP_TREE_CONNECT_ANDX; -typedef RESP_TREE_CONNECT_ANDX SMB_UNALIGNED *PRESP_TREE_CONNECT_ANDX; - -// -// The response for clients that are LAN Manager 2.1 or better. -// - -typedef struct _RESP_21_TREE_CONNECT_ANDX { - UCHAR WordCount; // Count of parameter words = 3 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( OptionalSupport ); // Optional support bits - _USHORT( ByteCount ); // Count of data bytes; min = 3 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Service[]; // Service type connected to - //UCHAR NativeFileSystem[]; // Native file system for this tree -} RESP_21_TREE_CONNECT_ANDX; -typedef RESP_21_TREE_CONNECT_ANDX SMB_UNALIGNED *PRESP_21_TREE_CONNECT_ANDX; - -// -// Optional Support bit definitions -// -#define SMB_SUPPORT_SEARCH_BITS 0x0001 -#define SMB_SHARE_IS_IN_DFS 0x0002 - -#endif // def INCLUDE_SMB_TREE - -#ifdef INCLUDE_SMB_TREE - -// -// Tree Disconnect SMB, see #1 page 7 -// Function is SrvSmbTreeDisconnect() -// SMB_COM_TREE_DISCONNECT 0x71 -// - -typedef struct _REQ_TREE_DISCONNECT { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_TREE_DISCONNECT; -typedef REQ_TREE_DISCONNECT SMB_UNALIGNED *PREQ_TREE_DISCONNECT; - -typedef struct _RESP_TREE_DISCONNECT { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_TREE_DISCONNECT; -typedef RESP_TREE_DISCONNECT SMB_UNALIGNED *PRESP_TREE_DISCONNECT; - -#endif // def INCLUDE_SMB_TREE - -#ifdef INCLUDE_SMB_LOCK - -// -// Unlock Byte Range SMB, see #1 page 20 -// Function is SrvSmbUnlockByteRange() -// SMB_COM_UNLOCK_BYTE_RANGE 0x0D -// - -typedef struct _REQ_UNLOCK_BYTE_RANGE { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( Fid ); // File handle - _ULONG( Count ); // Count of bytes to unlock - _ULONG( Offset ); // Offset from start of file - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} REQ_UNLOCK_BYTE_RANGE; -typedef REQ_UNLOCK_BYTE_RANGE SMB_UNALIGNED *PREQ_UNLOCK_BYTE_RANGE; - -typedef struct _RESP_UNLOCK_BYTE_RANGE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_UNLOCK_BYTE_RANGE; -typedef RESP_UNLOCK_BYTE_RANGE SMB_UNALIGNED *PRESP_UNLOCK_BYTE_RANGE; - -#endif // def INCLUDE_SMB_LOCK - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Write SMB, see #1 page 12 -// Write and Unlock SMB, see #2 page 92 -// Function is SrvSmbWrite() -// SMB_COM_WRITE 0x0B -// SMB_COM_WRITE_AND_UNLOCK 0x14 -// - -// -// *** Warning: the following structure is defined the way it is to -// ensure longword alignment of the data buffer. (This only matters -// when packing is disabled; when packing is turned on, the right -// thing happens no matter what.) -// - -typedef struct _REQ_WRITE { - UCHAR WordCount; // Count of parameter words = 5 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Number of bytes to be written - _ULONG( Offset ); // Offset in file to begin write - _USHORT( Remaining ); // Bytes remaining to satisfy request - _USHORT( ByteCount ); // Count of data bytes - //UCHAR Buffer[1]; // Buffer containing: - UCHAR BufferFormat; // 0x01 -- Data block - _USHORT( DataLength ); // Length of data - ULONG Buffer[1]; // Data -} REQ_WRITE; -typedef REQ_WRITE SMB_UNALIGNED *PREQ_WRITE; - -typedef struct _RESP_WRITE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Count of bytes actually written - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE; -typedef RESP_WRITE SMB_UNALIGNED *PRESP_WRITE; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Write and Close SMB, see #2 page 90 -// Function is SrvSmbWriteAndClose() -// SMB_COM_WRITE_AND_CLOSE 0x2C -// - -// -// The Write and Close parameters can be 6 words long or 12 words long, -// depending on whether it's supposed to look like a Write SMB or a -// Write and X SMB. So we define two different structures here. -// -// *** Warning: the following structures are defined the way they are to -// ensure longword alignment of the data buffer. (This only matters -// when packing is disabled; when packing is turned on, the right -// thing happens no matter what.) -// - -typedef struct _REQ_WRITE_AND_CLOSE { - UCHAR WordCount; // Count of parameter words = 6 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Number of bytes to write - _ULONG( Offset ); // Offset in file of first byte to write - _ULONG( LastWriteTimeInSeconds ); // Time of last write - _USHORT( ByteCount ); // 1 (for pad) + value of Count - UCHAR Pad; // To force to doubleword boundary - ULONG Buffer[1]; // Data -} REQ_WRITE_AND_CLOSE; -typedef REQ_WRITE_AND_CLOSE SMB_UNALIGNED *PREQ_WRITE_AND_CLOSE; - -typedef struct _REQ_WRITE_AND_CLOSE_LONG { - UCHAR WordCount; // Count of parameter words = 12 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Number of bytes to write - _ULONG( Offset ); // Offset in file of first byte to write - _ULONG( LastWriteTimeInSeconds ); // Time of last write - _ULONG( Reserved )[3]; // Reserved, must be 0 - _USHORT( ByteCount ); // 1 (for pad) + value of Count - UCHAR Pad; // To force to doubleword boundary - ULONG Buffer[1]; // Data -} REQ_WRITE_AND_CLOSE_LONG; -typedef REQ_WRITE_AND_CLOSE_LONG SMB_UNALIGNED *PREQ_WRITE_AND_CLOSE_LONG; - -typedef struct _RESP_WRITE_AND_CLOSE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Count of bytes actually written - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_AND_CLOSE; -typedef RESP_WRITE_AND_CLOSE SMB_UNALIGNED *PRESP_WRITE_AND_CLOSE; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Write and X SMB, see #2 page 94 -// Function is SrvSmbWriteAndX() -// SMB_COM_WRITE_ANDX 0x2F -// - -typedef struct _REQ_WRITE_ANDX { - UCHAR WordCount; // Count of parameter words = 12 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Timeout ); - _USHORT( WriteMode ); // Write mode: - // 0 - write through - // 1 - return Remaining - // 2 - use WriteRawNamedPipe (n. pipes) - // 3 - "this is the start of the msg" - _USHORT( Remaining ); // Bytes remaining to satisfy request - _USHORT( Reserved ); - _USHORT( DataLength ); // Number of data bytes in buffer (>=0) - _USHORT( DataOffset ); // Offset to data bytes - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_WRITE_ANDX; -typedef REQ_WRITE_ANDX SMB_UNALIGNED *PREQ_WRITE_ANDX; - -typedef struct _REQ_NT_WRITE_ANDX { - UCHAR WordCount; // Count of parameter words = 14 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Fid ); // File handle - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Timeout ); - _USHORT( WriteMode ); // Write mode: - // 0 - write through - // 1 - return Remaining - // 2 - use WriteRawNamedPipe (n. pipes) - // 3 - "this is the start of the msg" - _USHORT( Remaining ); // Bytes remaining to satisfy request - _USHORT( DataLengthHigh ); - _USHORT( DataLength ); // Number of data bytes in buffer (>=0) - _USHORT( DataOffset ); // Offset to data bytes - _ULONG( OffsetHigh ); // Used for NT Protocol only - // Upper 32 bits of offset - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_NT_WRITE_ANDX; -typedef REQ_NT_WRITE_ANDX SMB_UNALIGNED *PREQ_NT_WRITE_ANDX; - -typedef struct _RESP_WRITE_ANDX { - UCHAR WordCount; // Count of parameter words = 6 - UCHAR AndXCommand; // Secondary (X) command; 0xFF = none - UCHAR AndXReserved; // Reserved (must be 0) - _USHORT( AndXOffset ); // Offset to next command WordCount - _USHORT( Count ); // Number of bytes written - _USHORT( Remaining ); // Bytes remaining to be read (pipe/dev) - union { - _ULONG( Reserved ); - _USHORT( CountHigh ); // if large write&x - }; - _USHORT( ByteCount ); // Count of data bytes. Inaccurate if - // large writes - UCHAR Buffer[1]; // empty -} RESP_WRITE_ANDX; -typedef RESP_WRITE_ANDX SMB_UNALIGNED *PRESP_WRITE_ANDX; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_MPX - -// -// Write Block Multiplexed SMB, see #2 page 97 -// Function is SrvSmbWriteMpx() -// SMB_COM_WRITE_MPX 0x1E -// SMB_COM_WRITE_MPX_SECONDARY 0x1F -// SMB_COM_WRITE_MPX_COMPLETE 0x20 -// - -typedef struct _REQ_WRITE_MPX { - UCHAR WordCount; // Count of parameter words = 12 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Total bytes, including this buffer - _USHORT( Reserved ); - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Timeout ); - _USHORT( WriteMode ); // Write mode: - // bit 0 - complete write to disk and - // send final result response - // bit 1 - return Remaining (pipe/dev) - // bit 7 - IPX datagram mode - union { - struct { - _USHORT( DataCompactionMode ); - _USHORT( Reserved2 ); - } ; - _ULONG( Mask ); // IPX datagram mode mask - } ; - _USHORT( DataLength ); // Number of data bytes this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_WRITE_MPX; -typedef REQ_WRITE_MPX SMB_UNALIGNED *PREQ_WRITE_MPX; - -typedef struct _RESP_WRITE_MPX_INTERIM { // First response - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Remaining ); // Bytes ramaining to be read (pipe/dev) - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_MPX_INTERIM; -typedef RESP_WRITE_MPX_INTERIM SMB_UNALIGNED *PRESP_WRITE_MPX_INTERIM; - -typedef struct _RESP_WRITE_MPX_DATAGRAM { // Response to sequenced request - UCHAR WordCount; // Count of parameter words = 2 - _ULONG( Mask ); // OR of all masks received - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_MPX_DATAGRAM; -typedef RESP_WRITE_MPX_DATAGRAM SMB_UNALIGNED *PRESP_WRITE_MPX_DATAGRAM; - -// Secondary request format, 0 to N of these. - -typedef struct _REQ_WRITE_MPX_SECONDARY { - UCHAR WordCount; // Count of parameter words = 8 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Total bytes to be sent - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Reserved ); - _USHORT( DataLength ); // Number of data bytes this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_WRITE_MPX_SECONDARY; -typedef REQ_WRITE_MPX_SECONDARY SMB_UNALIGNED *PREQ_WRITE_MPX_SECONDARY; - -#endif // def INCLUDE_SMB_MPX - -#ifndef INCLUDE_SMB_WRITE_COMPLETE -#ifdef INCLUDE_SMB_MPX -#define INCLUDE_SMB_WRITE_COMPLETE -#else -#ifdef INCLUDE_SMB_RAW -#define INCLUDE_SMB_WRITE_COMPLETE -#endif -#endif -#endif - -#ifdef INCLUDE_SMB_WRITE_COMPLETE - -// -// The following structure is used as the final response to both Write -// Block Multiplexed and Write Block Raw. -// - -typedef struct _RESP_WRITE_COMPLETE { // Final response; command is - // SMB_COM_WRITE_COMPLETE - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Total number of bytes written - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_COMPLETE; -typedef RESP_WRITE_COMPLETE SMB_UNALIGNED *PRESP_WRITE_COMPLETE; - -#endif // def INCLUDE_SMB_WRITE_COMPLETE - -#ifdef INCLUDE_SMB_READ_WRITE - -// -// Write Print File SMB, see #1 page 29 -// Function is SrvSmbWritePrintFile() -// SMB_COM_WRITE_PRINT_FILE 0xC1 -// - -typedef struct _REQ_WRITE_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Fid ); // File handle - _USHORT( ByteCount ); // Count of data bytes; min = 4 - UCHAR Buffer[1]; // Buffer containing: - //UCHAR BufferFormat; // 0x01 -- Data block - //USHORT DataLength; // Length of data - //UCHAR Data[]; // Data -} REQ_WRITE_PRINT_FILE; -typedef REQ_WRITE_PRINT_FILE SMB_UNALIGNED *PREQ_WRITE_PRINT_FILE; - -typedef struct _RESP_WRITE_PRINT_FILE { - UCHAR WordCount; // Count of parameter words = 0 - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_PRINT_FILE; -typedef RESP_WRITE_PRINT_FILE SMB_UNALIGNED *PRESP_WRITE_PRINT_FILE; - -#endif // def INCLUDE_SMB_READ_WRITE - -#ifdef INCLUDE_SMB_RAW - -// -// Write Block Raw SMB, see #2 page 100 -// Function is SrvSmbWriteRaw() -// SMB_COM_WRITE_RAW 0x1D -// - -typedef struct _REQ_WRITE_RAW { - UCHAR WordCount; // Count of parameter words = 12 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Total bytes, including this buffer - _USHORT( Reserved ); - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Timeout ); - _USHORT( WriteMode ); // Write mode: - // bit 0 - complete write to disk and - // send final result response - // bit 1 - return Remaining (pipe/dev) - // (see WriteAndX for #defines) - _ULONG( Reserved2 ); - _USHORT( DataLength ); // Number of data bytes this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_WRITE_RAW; -typedef REQ_WRITE_RAW SMB_UNALIGNED *PREQ_WRITE_RAW; - -typedef struct _REQ_NT_WRITE_RAW { - UCHAR WordCount; // Count of parameter words = 14 - _USHORT( Fid ); // File handle - _USHORT( Count ); // Total bytes, including this buffer - _USHORT( Reserved ); - _ULONG( Offset ); // Offset in file to begin write - _ULONG( Timeout ); - _USHORT( WriteMode ); // Write mode: - // bit 0 - complete write to disk and - // send final result response - // bit 1 - return Remaining (pipe/dev) - // (see WriteAndX for #defines) - _ULONG( Reserved2 ); - _USHORT( DataLength ); // Number of data bytes this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - _ULONG( OffsetHigh ); // Used for NT Protocol only - // Upper 32 bits of offset - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR Pad[]; // Pad to SHORT or LONG - //UCHAR Data[]; // Data (# = DataLength) -} REQ_NT_WRITE_RAW; -typedef REQ_NT_WRITE_RAW SMB_UNALIGNED *PREQ_NT_WRITE_RAW; - -typedef struct _RESP_WRITE_RAW_INTERIM { // First response - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Remaining ); // Bytes remaining to be read (pipe/dev) - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_RAW_INTERIM; -typedef RESP_WRITE_RAW_INTERIM SMB_UNALIGNED *PRESP_WRITE_RAW_INTERIM; - -typedef struct _RESP_WRITE_RAW_SECONDARY { // Second (final) response - UCHAR WordCount; // Count of parameter words = 1 - _USHORT( Count ); // Total number of bytes written - _USHORT( ByteCount ); // Count of data bytes = 0 - UCHAR Buffer[1]; // empty -} RESP_WRITE_RAW_SECONDARY; -typedef RESP_WRITE_RAW_SECONDARY SMB_UNALIGNED *PRESP_WRITE_RAW_SECONDARY; - -typedef struct _REQ_103_WRITE_RAW { - UCHAR WordCount; // Count of parameter words - _USHORT( Fid ); // File handle - _USHORT( Count ); - _USHORT( Reserved ); - _ULONG( Offset ); - _ULONG( Timeout ); - _USHORT( WriteMode ); - _ULONG( Reserved2 ); - _USHORT( ByteCount ); // Count of data bytes; min = - UCHAR Buffer[1]; // -} REQ_103_WRITE_RAW; -typedef REQ_103_WRITE_RAW SMB_UNALIGNED *PREQ_103_WRITE_RAW; - -typedef struct _RESP_103_WRITE_RAW { - UCHAR WordCount; // Count of parameter words - _USHORT( ByteCount ); // Count of data bytes; min = - UCHAR Buffer[1]; // -} RESP_103_WRITE_RAW; -typedef RESP_103_WRITE_RAW SMB_UNALIGNED *PRESP_103_WRITE_RAW; - -#endif // def INCLUDE_SMB_RAW - -typedef struct _REQ_NT_CANCEL { - UCHAR WordCount; // = 0 - _USHORT( ByteCount ); // = 0 - UCHAR Buffer[1]; -} REQ_NT_CANCEL; -typedef REQ_NT_CANCEL SMB_UNALIGNED *PREQ_NT_CANCEL; - -typedef struct _RESP_NT_CANCEL { - UCHAR WordCount; // = 0 - _USHORT( ByteCount ); // = 0 - UCHAR Buffer[1]; -} RESP_NT_CANCEL; -typedef RESP_NT_CANCEL SMB_UNALIGNED *PRESP_NT_CANCEL; - -// -// File open modes -// - -#define SMB_ACCESS_READ_ONLY 0 -#define SMB_ACCESS_WRITE_ONLY 1 -#define SMB_ACCESS_READ_WRITE 2 -#define SMB_ACCESS_EXECUTE 3 - -// -// Open flags -// - -#define SMB_OPEN_QUERY_INFORMATION 0x01 -#define SMB_OPEN_OPLOCK 0x02 -#define SMB_OPEN_OPBATCH 0x04 -#define SMB_OPEN_QUERY_EA_LENGTH 0x08 -#define SMB_OPEN_EXTENDED_RESPONSE 0x10 - -// -// NT open manifests -// - -#define NT_CREATE_REQUEST_OPLOCK 0x02 -#define NT_CREATE_REQUEST_OPBATCH 0x04 -#define NT_CREATE_OPEN_TARGET_DIR 0x08 - - -#define Added 0 -#define Removed 1 -#define Modified 2 -#define RenamedOldName 3 -#define RenamedNewName 4 - -// -// Lockrange for use with OS/2 DosFileLocks call -// - -// *** Where is this used? - -//typedef struct lockrange { -// ULONG offset; -// ULONG range; -// }; - -//#define LOCK 0x1 -//#define UNLOCK 0x2 - -// -// Data buffer format codes, from the core protocol. -// - -#define SMB_FORMAT_DATA 1 -#define SMB_FORMAT_DIALECT 2 -#define SMB_FORMAT_PATHNAME 3 -#define SMB_FORMAT_ASCII 4 -#define SMB_FORMAT_VARIABLE 5 - -// -// WriteMode flags -// - -#define SMB_WMODE_WRITE_THROUGH 0x0001 // complete write before responding -#define SMB_WMODE_SET_REMAINING 0x0002 // returning amt remaining in pipe -#define SMB_WMODE_WRITE_RAW_NAMED_PIPE 0x0004 // write named pipe in raw mode -#define SMB_WMODE_START_OF_MESSAGE 0x0008 // start of pipe message -#define SMB_WMODE_DATAGRAM 0x0080 // start of pipe message - -// -// Various SMB flags: -// - -// -// If the server supports LockAndRead and WriteAndUnlock, it sets this -// bit the Negotiate response. -// - -#define SMB_FLAGS_LOCK_AND_READ_OK 0x01 - -// -// When on, the consumer guarantees that there is a receive buffer posted -// such that a "Send.No.Ack" can be used by the server to respond to -// the consumer's request. -// - -#define SMB_FLAGS_SEND_NO_ACK 0x2 - -// -// This is part of the Flags field of every SMB header. If this bit -// is set, then all pathnames in the SMB should be treated as case- -// insensitive. -// - -#define SMB_FLAGS_CASE_INSENSITIVE 0x8 - -// -// When on in session setup, this bit indicates that all paths sent to -// the server are already in OS/2 canonicalized format. -// - -#define SMB_FLAGS_CANONICALIZED_PATHS 0x10 - -// -// When on in a open file request SMBs (open, create, openX, etc.) this -// bit indicates a request for an oplock on the file. When on in the -// response, this bit indicates that the oplock was granted. -// - -#define SMB_FLAGS_OPLOCK 0x20 - -// -// When on, this bit indicates that the server should notify the client -// on any request that could cause the file to be changed. If not set, -// the server only notifies the client on other open requests on the -// file. -// - -#define SMB_FLAGS_OPLOCK_NOTIFY_ANY 0x40 - -// -// This bit indicates that the SMB is being sent from server to redir. -// - -#define SMB_FLAGS_SERVER_TO_REDIR 0x80 - -// -// Valid bits for Flags on an incoming SMB -// - -#define INCOMING_SMB_FLAGS \ - (SMB_FLAGS_LOCK_AND_READ_OK | \ - SMB_FLAGS_SEND_NO_ACK | \ - SMB_FLAGS_CASE_INSENSITIVE | \ - SMB_FLAGS_CANONICALIZED_PATHS | \ - SMB_FLAGS_OPLOCK_NOTIFY_ANY | \ - SMB_FLAGS_OPLOCK) - -// -// Names for bits in Flags2 field of SMB header that indicate what the -// client app is aware of. -// - -#define SMB_FLAGS2_KNOWS_LONG_NAMES 0x0001 -#define SMB_FLAGS2_KNOWS_EAS 0x0002 -#define SMB_FLAGS2_SMB_SECURITY_SIGNATURE 0x0004 -#define SMB_FLAGS2_IS_LONG_NAME 0x0040 -#define SMB_FLAGS2_DFS 0x1000 -#define SMB_FLAGS2_PAGING_IO 0x2000 -#define SMB_FLAGS2_NT_STATUS 0x4000 -#define SMB_FLAGS2_UNICODE 0x8000 - -// -// Valid bits for Flags2 on an incoming SMB -// - -#define INCOMING_SMB_FLAGS2 \ - (SMB_FLAGS2_KNOWS_LONG_NAMES | \ - SMB_FLAGS2_KNOWS_EAS | \ - SMB_FLAGS2_DFS | \ - SMB_FLAGS2_PAGING_IO | \ - SMB_FLAGS2_IS_LONG_NAME | \ - SMB_FLAGS2_NT_STATUS | \ - SMB_FLAGS2_UNICODE ) - -// -// The SMB open function determines what action should be taken depending -// on the existence or lack thereof of files used in the operation. It -// has the following mapping: -// -// 1111 1 -// 5432 1098 7654 3210 -// rrrr rrrr rrrC rrOO -// -// where: -// -// O - Open (action to be taken if the target file exists) -// 0 - Fail -// 1 - Open or Append file -// 2 - Truncate file -// -// C - Create (action to be taken if the target file does not exist) -// 0 - Fail -// 1 - Create file -// - -#define SMB_OFUN_OPEN_MASK 0x3 -#define SMB_OFUN_CREATE_MASK 0x10 - -#define SMB_OFUN_OPEN_FAIL 0 -#define SMB_OFUN_OPEN_APPEND 1 -#define SMB_OFUN_OPEN_OPEN 1 -#define SMB_OFUN_OPEN_TRUNCATE 2 - -#define SMB_OFUN_CREATE_FAIL 0x00 -#define SMB_OFUN_CREATE_CREATE 0x10 - -//++ -// -// BOOLEAN -// SmbOfunCreate( -// IN USHORT SmbOpenFunction -// ) -// -//-- - -#define SmbOfunCreate(SmbOpenFunction) \ - (BOOLEAN)((SmbOpenFunction & SMB_OFUN_CREATE_MASK) == SMB_OFUN_CREATE_CREATE) - -//++ -// -// BOOLEAN -// SmbOfunAppend( -// IN USHORT SmbOpenFunction -// ) -// -//-- - -#define SmbOfunAppend(SmbOpenFunction) \ - (BOOLEAN)((SmbOpenFunction & SMB_OFUN_OPEN_MASK) == SMB_OFUN_OPEN_APPEND) - -//++ -// -// BOOLEAN -// SmbOfunTruncate( -// IN USHORT SmbOpenFunction -// ) -// -//-- - -#define SmbOfunTruncate(SmbOpenFunction) \ - (BOOLEAN)((SmbOpenFunction & SMB_OFUN_OPEN_MASK) == SMB_OFUN_OPEN_TRUNCATE) - -// -// The desired access mode passed in Open and Open and X has the following -// mapping: -// -// 1111 11 -// 5432 1098 7654 3210 -// rWrC rLLL rSSS rAAA -// -// where: -// -// W - Write through mode. No read ahead or write behind allowed on -// this file or device. When protocol is returned, data is expected -// to be on the disk or device. -// -// S - Sharing mode: -// 0 - Compatibility mode (as in core open) -// 1 - Deny read/write/execute (exclusive) -// 2 - Deny write -// 3 - Deny read/execute -// 4 - Deny none -// -// A - Access mode -// 0 - Open for reading -// 1 - Open for writing -// 2 - Open for reading and writing -// 3 - Open for execute -// -// rSSSrAAA = 11111111 (hex FF) indicates FCB open (as in core protocol) -// -// C - Cache mode -// 0 - Normal file -// 1 - Do not cache this file -// -// L - Locality of reference -// 0 - Locality of reference is unknown -// 1 - Mainly sequential access -// 2 - Mainly random access -// 3 - Random access with some locality -// 4 to 7 - Currently undefined -// - - -#define SMB_DA_SHARE_MASK 0x70 -#define SMB_DA_ACCESS_MASK 0x07 -#define SMB_DA_FCB_MASK (UCHAR)0xFF - -#define SMB_DA_ACCESS_READ 0x00 -#define SMB_DA_ACCESS_WRITE 0x01 -#define SMB_DA_ACCESS_READ_WRITE 0x02 -#define SMB_DA_ACCESS_EXECUTE 0x03 - -#define SMB_DA_SHARE_COMPATIBILITY 0x00 -#define SMB_DA_SHARE_EXCLUSIVE 0x10 -#define SMB_DA_SHARE_DENY_WRITE 0x20 -#define SMB_DA_SHARE_DENY_READ 0x30 -#define SMB_DA_SHARE_DENY_NONE 0x40 - -#define SMB_DA_FCB (UCHAR)0xFF - -#define SMB_CACHE_NORMAL 0x0000 -#define SMB_DO_NOT_CACHE 0x1000 - -#define SMB_LR_UNKNOWN 0x0000 -#define SMB_LR_SEQUENTIAL 0x0100 -#define SMB_LR_RANDOM 0x0200 -#define SMB_LR_RANDOM_WITH_LOCALITY 0x0300 -#define SMB_LR_MASK 0x0F00 - -#define SMB_DA_WRITE_THROUGH 0x4000 - -// -// The Action field of OpenAndX has the following format: -// -// 1111 11 -// 5432 1098 7654 3210 -// Lrrr rrrr rrrr rrOO -// -// where: -// -// L - Opportunistic lock. 1 if lock granted, else 0. -// -// O - Open action: -// 1 - The file existed and was opened -// 2 - The file did not exist but was created -// 3 - The file existed and was truncated -// - -#define SMB_OACT_OPENED 0x01 -#define SMB_OACT_CREATED 0x02 -#define SMB_OACT_TRUNCATED 0x03 - -#define SMB_OACT_OPLOCK 0x8000 - -// -// These flags are passed in the Flags field of the copy and extended rename -// SMBs. -// - -// -// If set, the target must be a file or directory. -// - -#define SMB_TARGET_IS_FILE 0x1 -#define SMB_TARGET_IS_DIRECTORY 0x2 - -// -// The copy mode--if set, ASCII copying should be done, otherwise binary. -// - -#define SMB_COPY_TARGET_ASCII 0x4 -#define SMB_COPY_SOURCE_ASCII 0x8 - -#define SMB_COPY_TREE 0x20 - -// -// If set, verify all writes. -// - -#define SMB_VERIFY_WRITES - -// -// Define file attribute bits as used in the SMB protocol. The specific -// bit positions are, for the most part, identical to those used in NT. -// However, NT does not define Volume and Directory bits. It also has -// an explicit Normal bit; this bit is implied in SMB attributes by -// Hidden, System, and Directory being off. -// - -#define SMB_FILE_ATTRIBUTE_READONLY 0x01 -#define SMB_FILE_ATTRIBUTE_HIDDEN 0x02 -#define SMB_FILE_ATTRIBUTE_SYSTEM 0x04 -#define SMB_FILE_ATTRIBUTE_VOLUME 0x08 -#define SMB_FILE_ATTRIBUTE_DIRECTORY 0x10 -#define SMB_FILE_ATTRIBUTE_ARCHIVE 0x20 - -// -// Share type strings are passed in SMBs to indicate what type of shared -// resource is being or has been connected to. -// - -#define SHARE_TYPE_NAME_DISK "A:" -#define SHARE_TYPE_NAME_PIPE "IPC" -#define SHARE_TYPE_NAME_COMM "COMM" -#define SHARE_TYPE_NAME_PRINT "LPT1:" -#define SHARE_TYPE_NAME_WILD "?????" - -// -// SMB Error codes: -// - -// -// Success Class: -// - -#define SMB_ERR_SUCCESS (UCHAR)0x00 - -// -// DOS Error Class: -// - -#define SMB_ERR_CLASS_DOS (UCHAR)0x01 - -#define SMB_ERR_BAD_FUNCTION 1 // Invalid function -#define SMB_ERR_BAD_FILE 2 // File not found -#define SMB_ERR_BAD_PATH 3 // Invalid directory -#define SMB_ERR_NO_FIDS 4 // Too many open files -#define SMB_ERR_ACCESS_DENIED 5 // Access not allowed for req. func. -#define SMB_ERR_BAD_FID 6 // Invalid file handle -#define SMB_ERR_BAD_MCB 7 // Memory control blocks destroyed -#define SMB_ERR_INSUFFICIENT_MEMORY 8 // For the desired function -#define SMB_ERR_BAD_MEMORY 9 // Invalid memory block address -#define SMB_ERR_BAD_ENVIRONMENT 10 // Invalid environment -#define SMB_ERR_BAD_FORMAT 11 // Invalid format -#define SMB_ERR_BAD_ACCESS 12 // Invalid open mode -#define SMB_ERR_BAD_DATA 13 // Invalid data (only from IOCTL) -#define SMB_ERR_RESERVED 14 -#define SMB_ERR_BAD_DRIVE 15 // Invalid drive specified -#define SMB_ERR_CURRENT_DIRECTORY 16 // Attempted to remove currect directory -#define SMB_ERR_DIFFERENT_DEVICE 17 // Not the same device -#define SMB_ERR_NO_FILES 18 // File search can't find more files -#define SMB_ERR_BAD_SHARE 32 // An open conflicts with FIDs on file -#define SMB_ERR_LOCK 33 // Conflict with existing lock -#define SMB_ERR_FILE_EXISTS 80 // Tried to overwrite existing file -#define SMB_ERR_BAD_PIPE 230 // Invalie pipe -#define SMB_ERR_PIPE_BUSY 231 // All instances of the pipe are busy -#define SMB_ERR_PIPE_CLOSING 232 // Pipe close in progress -#define SMB_ERR_PIPE_NOT_CONNECTED 233 // No process on other end of pipe -#define SMB_ERR_MORE_DATA 234 // There is more data to return - -// -// SERVER Error Class: -// - -#define SMB_ERR_CLASS_SERVER (UCHAR)0x02 - -#define SMB_ERR_ERROR 1 // Non-specific error code -#define SMB_ERR_BAD_PASSWORD 2 // Bad name/password pair -#define SMB_ERR_BAD_TYPE 3 // Reserved -#define SMB_ERR_ACCESS 4 // Requester lacks necessary access -#define SMB_ERR_BAD_TID 5 // Invalid TID -#define SMB_ERR_BAD_NET_NAME 6 // Invalid network name in tree connect -#define SMB_ERR_BAD_DEVICE 7 // Invalid device request -#define SMB_ERR_QUEUE_FULL 49 // Print queue full--returned print file -#define SMB_ERR_QUEUE_TOO_BIG 50 // Print queue full--no space -#define SMB_ERR_QUEUE_EOF 51 // EOF on print queue dump -#define SMB_ERR_BAD_PRINT_FID 52 // Invalid print file FID -#define SMB_ERR_BAD_SMB_COMMAND 64 // SMB command not recognized -#define SMB_ERR_SERVER_ERROR 65 // Internal server error -#define SMB_ERR_FILE_SPECS 67 // FID and pathname were incompatible -#define SMB_ERR_RESERVED2 68 -#define SMB_ERR_BAD_PERMITS 69 // Access permissions invalid -#define SMB_ERR_RESERVED3 70 -#define SMB_ERR_BAD_ATTRIBUTE_MODE 71 // Invalid attribute mode specified -#define SMB_ERR_SERVER_PAUSED 81 // Server is paused -#define SMB_ERR_MESSAGE_OFF 82 // Server not receiving messages -#define SMB_ERR_NO_ROOM 83 // No room for buffer message -#define SMB_ERR_TOO_MANY_NAMES 87 // Too many remote user names -#define SMB_ERR_TIMEOUT 88 // Operation was timed out -#define SMB_ERR_NO_RESOURCE 89 // No resources available for request -#define SMB_ERR_TOO_MANY_UIDS 90 // Too many UIDs active in session -#define SMB_ERR_BAD_UID 91 // UID not known as a valid UID -#define SMB_ERR_INVALID_NAME 123 // Invalid name returned from FAT. -#define SMB_ERR_INVALID_NAME_RANGE 206 // Non 8.3 name passed to FAT (or non 255 name to HPFS) -#define SMB_ERR_USE_MPX 250 // Can't support Raw; use MPX -#define SMB_ERR_USE_STANDARD 251 // Can't support Raw, use standard r/w -#define SMB_ERR_CONTINUE_MPX 252 // Reserved -#define SMB_ERR_RESERVED4 253 -#define SMB_ERR_RESERVED5 254 -#define SMB_ERR_NO_SUPPORT_INTERNAL 255 // Internal code for NO_SUPPORT-- - // allows codes to be stored in a byte -#define SMB_ERR_NO_SUPPORT (USHORT)0xFFFF // Function not supported - -// -// HARDWARE Error Class: -// - -#define SMB_ERR_CLASS_HARDWARE (UCHAR)0x03 - -#define SMB_ERR_NO_WRITE 19 // Write attempted to write-prot. disk -#define SMB_ERR_BAD_UNIT 20 // Unknown unit -#define SMB_ERR_DRIVE_NOT_READY 21 // Disk drive not ready -#define SMB_ERR_BAD_COMMAND 22 // Unknown command -#define SMB_ERR_DATA 23 // Data error (CRC) -#define SMB_ERR_BAD_REQUEST 24 // Bad request structure length -#define SMB_ERR_SEEK 25 // Seek error -#define SMB_ERR_BAD_MEDIA 26 // Unknown media type -#define SMB_ERR_BAD_SECTOR 27 // Sector not found -#define SMB_ERR_NO_PAPER 28 // Printer out of paper -#define SMB_ERR_WRITE_FAULT 29 // Write fault -#define SMB_ERR_READ_FAULT 30 // Read fault -#define SMB_ERR_GENERAL 31 // General failure -#define SMB_ERR_LOCK_CONFLICT 33 // Lock conflicts with existing lock -#define SMB_ERR_WRONG_DISK 34 // Wrong disk was found in a drive -#define SMB_ERR_FCB_UNAVAILABLE 35 // No FCBs available to process request -#define SMB_ERR_SHARE_BUFFER_EXCEEDED 36 -#define SMB_ERR_DISK_FULL 39 // !!! Undocumented, but in LM2.0 - -// -// Other Error Classes: -// - -#define SMB_ERR_CLASS_XOS (UCHAR)0x04 // Reserved for XENIX -#define SMB_ERR_CLASS_RMX1 (UCHAR)0xE1 // Reserved for iRMX -#define SMB_ERR_CLASS_RMX2 (UCHAR)0xE2 // Reserved for iRMX -#define SMB_ERR_CLASS_RMX3 (UCHAR)0xE3 // Reserved for iRMX -#define SMB_ERR_CLASS_COMMAND (UCHAR)0xFF // Command was not in the SMB format - - -// -// Turn structure packing back off -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - -// Old (LanMan 1.2) and new (NT) field names: -// (Undocumented fields have corresponding structure in parenthesis) -// smb_access Access -// smb_action Action -// smb_adate AccessDate -// smb_allocsize AllocationSize -// smb_aname AccountName -// smb_apasslen PasswordSize -// smb_apasswd AccountPassword -// smb_atime AccessTime -// smb_attr Attribute -// smb_attribute Attribute -// smb_aunits (RESP_QUERY_INFORMATION_SERVER) -// smb_bcc BufferSize -// smb_blkmode BlockMode -// smb_blksize BlockSize -// smb_blksperunit BlocksPerUnit -// smb_bpu BlocksPerUnit -// smb_bs BlockSize -// smb_bufsize MaxBufferSize -// smb_buf[1] Buffer[1] -// smb_bytes[*] Bytes[*] -// smb_cat Category -// smb_cct FilesCopied -// smb_cdate CreateDate -// smb_cert CertificateOffset -// smb_com Command -// smb_com2 AndXCommand -// smb_count Count -// smb_count_left Remaining -// smb_cryptkey[*] CryptKey -// smb_ctime CreateTime -// smb_datablock DataBlock -// smb_datalen DataSize -// smb_datasize DataSize -// smb_data[*] Data[*] -// smb_dcmode DataCompactMode -// smb_dev DeviceName -// smb_doff DataOffset -// smb_drcnt DataCount -// smb_drdisp DataDisplacement -// smb_droff DataOffset -// smb_dscnt DataCount -// smb_dsdisp DataDisplacement -// smb_dsize DataSize -// smb_dsoff DataOffset -// smb_encrypt EncryptKey -// smb_encryptlen EncryptKeySize -// smb_encryptoff EncryptKeyOffset -// smb_eos EndOfSearch -// smb_err Error -// smb_errmsg[1] ErrorMessage[1] -// smb_fau (RESP_QUERY_INFORMATION_SERVER) -// smb_fid Fid -// smb_fileid ServerFid -// smb_flag Flag -// smb_flag2 Flag2 -// smb_flags Flag -// smb_flg Flag -// smb_freeunits FreeUnits -// smb_fsid (RESP_QUERY_INFORMATION_SERVER) -// smb_fsize FileSize -// smb_fun Function -// smb_gid Gid -// smb_handle Handle -// smb_ident1 Identifier -// smb_idf[4] Protocol[4] -// smb_index Index -// smb_info Info -// smb_left Remaining -// smb_len SetupLength -// smb_locknum NumberOfLocks -// smb_lockrng[*] LockRange -// smb_locktype LockType -// smb_lpid OwnerPid -// smb_maxbytes MaxBytes -// smb_maxcnt MaxCount -// smb_maxcount MaxCount -// smb_maxmux (RESP_NEGOTIATE) -// smb_maxvcs MaxNumberVcs -// smb_maxxmitsz MaxTransmitSize -// smb_maxxmt MaxTransmitSize -// smb_mdate ModificationDate -// smb_mdrcnt MaxDataCount -// smb_mid Mid -// smb_mincnt MinCount -// smb_mode Mode -// smb_mprcnt MaxParameterCount -// smb_mpxmax MaxMpxCount -// smb_msrcnt MaxSetupCount -// smb_mtime ModificationTime -// smb_name[*] Name[*] -// smb_off2 AndXOffset -// smb_offset Offset -// smb_ofun OpenFunction -// smb_pad Pad -// smb_pad1[] Pad1 -// smb_pad[] Pad[] -// smb_param[*] Parameter[*] -// smb_path ServerName -// smb_pathname PathName -// smb_pid Pid -// smb_prcnt ParameterCount -// smb_prdisp ParameterDisplacement -// smb_proff ParameterCount -// smb_pscnt ParameterCount -// smb_psdisp ParameterDisplacement -// smb_psoff ParameterOffset -// smb_range LockLength or UnlockLength -// smb_rcls ErrorClass -// smb_reh ReservedH -// smb_reh2 ReservedH2 -// smb_remaining Remaining -// smb_remcnt Remaining -// smb_res1 Reserved -// smb_res2 Reserved2 -// smb_res3 Reserved3 -// smb_res4 Reserved4 -// smb_res5 Reserved5 -// smb_reserved Reserved -// smb_restart Restart -// smb_resumekey ResumeKey -// smb_res[5] Reserved[] -// smb_reverb ReverbCount -// smb_rsvd Reserved -// smb_rsvd1 Reserved -// smb_rsvd2 Reserved2 -// smb_rsvd3 Reserved3 -// smb_rsvd4 Reserved4 -// smb_sattr SearchAttribute -// smb_secmode SecurityMode -// smb_seq SequenceNumber -// smb_services Services -// smb_sesskey SessionKey -// smb_setup[*] Setup[*] -// smb_size Size -// smb_spasslen ServerPasswordSize -// smb_spasswd ServerPassword -// smb_srv_date ServerDate -// smb_srv_time ServerTime -// smb_srv_tzone ServerTimeZone -// smb_start StartIndex -// smb_state DeviceState -// smb_suwcnt SetupWordCount -// smb_su_class SetupClass -// smb_su_com SetupCommand -// smb_su_handle SetupFid -// smb_su_opcode SetupOpcode -// smb_su_priority SetupPriority -// smb_tcount Count -// smb_tdis TreeDisconnect -// smb_tdrcnt TotalDataCount -// smb_tdscnt TotalDataCount -// smb_tid Tid -// smb_tid2 Tid2 -// smb_time Time -// smb_timeout Timeout -// smb_totalunits TotalUnits -// smb_tprcnt TotalParameterCount -// smb_tpscnt TotalParameterCount -// smb_type FileType -// smb_uid Uid -// smb_unlkrng[*] UnlockRange -// smb_unlocknum NumberOfUnlocks -// smb_vblen DataLength -// smb_vcnum VcNumber -// smb_vldate (RESP_QUERY_INFORMATION_SERVER) -// smb_vllen (RESP_QUERY_INFORMATION_SERVER) -// smb_vltime (RESP_QUERY_INFORMATION_SERVER) -// smb_vwv[1] Param -// smb_wct WordCount -// smb_wmode WriteMode -// smb_xchain EncryptChainOffset - - -// -// Force misalignment of the following structures -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - - -// -// Named pipe function codes -// - -#define TRANS_SET_NMPIPE_STATE 0x01 -#define TRANS_RAW_READ_NMPIPE 0x11 -#define TRANS_QUERY_NMPIPE_STATE 0x21 -#define TRANS_QUERY_NMPIPE_INFO 0x22 -#define TRANS_PEEK_NMPIPE 0x23 -#define TRANS_TRANSACT_NMPIPE 0x26 -#define TRANS_RAW_WRITE_NMPIPE 0x31 -#define TRANS_READ_NMPIPE 0x36 -#define TRANS_WRITE_NMPIPE 0x37 -#define TRANS_WAIT_NMPIPE 0x53 -#define TRANS_CALL_NMPIPE 0x54 - -// -// Mailslot function code -// - -#define TRANS_MAILSLOT_WRITE 0x01 - -// -// Transaction2 function codes -// - -#define TRANS2_OPEN2 0x00 -#define TRANS2_FIND_FIRST2 0x01 -#define TRANS2_FIND_NEXT2 0x02 -#define TRANS2_QUERY_FS_INFORMATION 0x03 -#define TRANS2_SET_FS_INFORMATION 0x04 -#define TRANS2_QUERY_PATH_INFORMATION 0x05 -#define TRANS2_SET_PATH_INFORMATION 0x06 -#define TRANS2_QUERY_FILE_INFORMATION 0x07 -#define TRANS2_SET_FILE_INFORMATION 0x08 -#define TRANS2_FSCTL 0x09 -#define TRANS2_IOCTL2 0x0A -#define TRANS2_FIND_NOTIFY_FIRST 0x0B -#define TRANS2_FIND_NOTIFY_NEXT 0x0C -#define TRANS2_CREATE_DIRECTORY 0x0D -#define TRANS2_SESSION_SETUP 0x0E -#define TRANS2_QUERY_FS_INFORMATION_FID 0x0F -#define TRANS2_GET_DFS_REFERRAL 0x10 -#define TRANS2_REPORT_DFS_INCONSISTENCY 0x11 - -#define TRANS2_MAX_FUNCTION 0x11 - -// -// Nt Transaction function codes -// - -#define NT_TRANSACT_MIN_FUNCTION 1 - -#define NT_TRANSACT_CREATE 1 -#define NT_TRANSACT_IOCTL 2 -#define NT_TRANSACT_SET_SECURITY_DESC 3 -#define NT_TRANSACT_NOTIFY_CHANGE 4 -#define NT_TRANSACT_RENAME 5 -#define NT_TRANSACT_QUERY_SECURITY_DESC 6 -#define NT_TRANSACT_QUERY_QUOTA 7 -#define NT_TRANSACT_SET_QUOTA 8 - -#define NT_TRANSACT_MAX_FUNCTION 8 - -// -// File information levels -// - -#define SMB_INFO_STANDARD 1 -#define SMB_INFO_QUERY_EA_SIZE 2 -#define SMB_INFO_SET_EAS 2 -#define SMB_INFO_QUERY_EAS_FROM_LIST 3 -#define SMB_INFO_QUERY_ALL_EAS 4 // undocumented but supported -#define SMB_INFO_QUERY_FULL_NAME 5 // never sent by redir -#define SMB_INFO_IS_NAME_VALID 6 -#define SMB_INFO_PASSTHROUGH 1000 // any info above here is a simple pass-through - -// -// NT extension to file info levels -// - -#define SMB_QUERY_FILE_BASIC_INFO 0x101 -#define SMB_QUERY_FILE_STANDARD_INFO 0x102 -#define SMB_QUERY_FILE_EA_INFO 0x103 -#define SMB_QUERY_FILE_NAME_INFO 0x104 -#define SMB_QUERY_FILE_ALLOCATION_INFO 0x105 -#define SMB_QUERY_FILE_END_OF_FILEINFO 0x106 -#define SMB_QUERY_FILE_ALL_INFO 0x107 -#define SMB_QUERY_FILE_ALT_NAME_INFO 0x108 -#define SMB_QUERY_FILE_STREAM_INFO 0x109 -#define SMB_QUERY_FILE_COMPRESSION_INFO 0x10B - -#define SMB_SET_FILE_BASIC_INFO 0x101 -#define SMB_SET_FILE_DISPOSITION_INFO 0x102 -#define SMB_SET_FILE_ALLOCATION_INFO 0x103 -#define SMB_SET_FILE_END_OF_FILE_INFO 0x104 - -#define SMB_QUERY_FS_LABEL_INFO 0x101 -#define SMB_QUERY_FS_VOLUME_INFO 0x102 -#define SMB_QUERY_FS_SIZE_INFO 0x103 -#define SMB_QUERY_FS_DEVICE_INFO 0x104 -#define SMB_QUERY_FS_ATTRIBUTE_INFO 0x105 -#define SMB_QUERY_FS_QUOTA_INFO 0x106 // unused? -#define SMB_QUERY_FS_CONTROL_INFO 0x107 - -// -// Volume information levels. -// - -#define SMB_INFO_ALLOCATION 1 -#define SMB_INFO_VOLUME 2 - -// -// Rename2 information levels. -// - -#define SMB_NT_RENAME_MOVE_CLUSTER_INFO 0x102 -#define SMB_NT_RENAME_SET_LINK_INFO 0x103 -#define SMB_NT_RENAME_RENAME_FILE 0x104 // Server internal -#define SMB_NT_RENAME_MOVE_FILE 0x105 // Server internal - -// -// Protocol for NtQueryQuotaInformationFile -// -typedef struct { - _USHORT( Fid ); // FID of target - UCHAR ReturnSingleEntry; // Indicates that only a single entry should be returned - // rather than filling the buffer with as - // many entries as possible. - UCHAR RestartScan; // Indicates whether the scan of the quota information - // is to be restarted from the beginning. - _ULONG ( SidListLength ); // Supplies the length of the SID list if present - _ULONG ( StartSidLength ); // Supplies an optional SID that indicates that the returned - // information is to start with an entry other - // than the first. This parameter is ignored if a - // SidList is given - _ULONG( StartSidOffset); // Supplies the offset of Start Sid in the buffer -} REQ_NT_QUERY_FS_QUOTA_INFO, *PREQ_NT_QUERY_FS_QUOTA_INFO; -// -// Desciptor response -// -// Data Bytes: The Quota Information -// -typedef struct { - _ULONG ( Length ); -} RESP_NT_QUERY_FS_QUOTA_INFO, *PRESP_NT_QUERY_FS_QUOTA_INFO; - -// -// Protocol for NtSetQuotaInformationFile -// -typedef struct { - _USHORT( Fid ); // FID of target -} REQ_NT_SET_FS_QUOTA_INFO, *PREQ_NT_SET_FS_QUOTA_INFO; -// -// Response: -// -// Setup words: None. -// Parameter Bytes: None. -// Data Bytes: None. -// - - -// -// Dfs Transactions -// - -// -// Request for Referral. -// -typedef struct { - USHORT MaxReferralLevel; // Latest version of referral understood - UCHAR RequestFileName[1]; // Dfs name for which referral is sought -} REQ_GET_DFS_REFERRAL; -typedef REQ_GET_DFS_REFERRAL SMB_UNALIGNED *PREQ_GET_DFS_REFERRAL; - -// -// The format of an individual referral contains version and length information -// allowing the client to skip referrals it does not understand. -// -// !! All referral elements must have VersionNumber and Size as the first 2 elements !! -// - -typedef struct { - USHORT VersionNumber; // == 1 - USHORT Size; // Size of this whole element - USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware - struct { - USHORT StripPath : 1; // Strip off PathConsumed characters from front of - // DfsPathName prior to submitting name to UncShareName - }; - WCHAR ShareName[1]; // The server+share name go right here. NULL terminated. -} DFS_REFERRAL_V1; -typedef DFS_REFERRAL_V1 SMB_UNALIGNED *PDFS_REFERRAL_V1; - -typedef struct { - USHORT VersionNumber; // == 2 - USHORT Size; // Size of this whole element - USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware - struct { - USHORT StripPath : 1; // Strip off PathConsumed characters from front of - // DfsPathName prior to submitting name to UncShareName - }; - ULONG Proximity; // Hint of transport cost - ULONG TimeToLive; // In number of seconds - USHORT DfsPathOffset; // Offset from beginning of this element to Path to access - USHORT DfsAlternatePathOffset; // Offset from beginning of this element to 8.3 path - USHORT NetworkAddressOffset; // Offset from beginning of this element to Network path -} DFS_REFERRAL_V2; -typedef DFS_REFERRAL_V2 SMB_UNALIGNED *PDFS_REFERRAL_V2; - -typedef struct { - USHORT VersionNumber; // == 3 - USHORT Size; // Size of this whole element - USHORT ServerType; // Type of server: 0 == Don't know, 1 == SMB, 2 == Netware - struct { - USHORT StripPath : 1; // Strip off PathConsumed characters from front of - // DfsPathName prior to submitting name to UncShareName - USHORT NameListReferral : 1; // This referral contains an expanded name list - }; - ULONG TimeToLive; // In number of seconds - union { - struct { - USHORT DfsPathOffset; // Offset from beginning of this element to Path to access - USHORT DfsAlternatePathOffset; // Offset from beginning of this element to 8.3 path - USHORT NetworkAddressOffset; // Offset from beginning of this element to Network path - GUID ServiceSiteGuid; // The guid for the site - }; - struct { - USHORT SpecialNameOffset; // Offset from this element to the special name string - USHORT NumberOfExpandedNames; // Number of expanded names - USHORT ExpandedNameOffset; // Offset from this element to the expanded name list - }; - }; -} DFS_REFERRAL_V3; -typedef DFS_REFERRAL_V3 SMB_UNALIGNED *PDFS_REFERRAL_V3; - -typedef struct { - USHORT PathConsumed; // Number of WCHARs consumed in DfsPathName - USHORT NumberOfReferrals; // Number of referrals contained here - struct { - ULONG ReferralServers : 1; // Elements in Referrals[] are referral servers - ULONG StorageServers : 1; // Elements in Referrals[] are storage servers - }; - union { // The vector of referrals - DFS_REFERRAL_V1 v1; - DFS_REFERRAL_V2 v2; - DFS_REFERRAL_V3 v3; - } Referrals[1]; // [ NumberOfReferrals ] - - // - // WCHAR StringBuffer[]; // Used by DFS_REFERRAL_V2 - // - -} RESP_GET_DFS_REFERRAL; -typedef RESP_GET_DFS_REFERRAL SMB_UNALIGNED *PRESP_GET_DFS_REFERRAL; - -// -// During Dfs operations, a client may discover a knowledge inconsistency in the Dfs. -// The parameter portion of the TRANS2_REPORT_DFS_INCONSISTENCY SMB is -// encoded in this way -// - -typedef struct { - UCHAR RequestFileName[1]; // Dfs name for which inconsistency is being reported - union { - DFS_REFERRAL_V1 v1; // The single referral thought to be in error - } Referral; -} REQ_REPORT_DFS_INCONSISTENCY; -typedef REQ_REPORT_DFS_INCONSISTENCY SMB_UNALIGNED *PREQ_REPORT_DFS_INCONSISTENCY; - -typedef struct _REQ_QUERY_FS_INFORMATION_FID { - _USHORT( InformationLevel ); - _USHORT( Fid ); -} REQ_QUERY_FS_INFORMATION_FID; -typedef REQ_QUERY_FS_INFORMATION_FID SMB_UNALIGNED *PREQ_QUERY_FS_INFORMATION_FID; - -// -// The client also needs to send to this server the referral which it believes to be -// in error. The data part of this transaction contains the errant referral(s), encoded -// as above in the DFS_REFERRAL_* structures. -// - -// -// Find First, information levels -// - -#define SMB_FIND_FILE_DIRECTORY_INFO 0x101 -#define SMB_FIND_FILE_FULL_DIRECTORY_INFO 0x102 -#define SMB_FIND_FILE_NAMES_INFO 0x103 -#define SMB_FIND_FILE_BOTH_DIRECTORY_INFO 0x104 - -#ifdef INCLUDE_SMB_DIRECTORY - -// -// CreateDirectory2 function code os Transaction2 SMB, see #3 page 51 -// Function is SrvSmbCreateDirectory2() -// TRANS2_CREATE_DIRECTORY 0x0D -// - -typedef struct _REQ_CREATE_DIRECTORY2 { - _ULONG( Reserved ); // Reserved--must be zero - UCHAR Buffer[1]; // Directory name to create -} REQ_CREATE_DIRECTORY2; -typedef REQ_CREATE_DIRECTORY2 SMB_UNALIGNED *PREQ_CREATE_DIRECTORY2; - -// Data bytes for CreateDirectory2 request are the extended attributes for the -// created file. - -typedef struct _RESP_CREATE_DIRECTORY2 { - _USHORT( EaErrorOffset ); // Offset into FEAList of first error - // which occurred while setting EAs -} RESP_CREATE_DIRECTORY2; -typedef RESP_CREATE_DIRECTORY2 SMB_UNALIGNED *PRESP_CREATE_DIRECTORY2; - -#endif // def INCLUDE_SMB_DIRECTORY - -#ifdef INCLUDE_SMB_SEARCH - -// -// FindFirst2 function code of Transaction2 SMB, see #3 page 22 -// Function is SrvSmbFindFirst2() -// TRANS2_FIND_FIRST2 0x01 -// - -typedef struct _REQ_FIND_FIRST2 { - _USHORT( SearchAttributes ); - _USHORT( SearchCount ); // Maximum number of entries to return - _USHORT( Flags ); // Additional information: bit set- - // 0 - close search after this request - // 1 - close search if end reached - // 2 - return resume keys - _USHORT( InformationLevel ); - _ULONG(SearchStorageType); - UCHAR Buffer[1]; // File name -} REQ_FIND_FIRST2; -typedef REQ_FIND_FIRST2 SMB_UNALIGNED *PREQ_FIND_FIRST2; - -// Data bytes for Find First2 request are a list of extended attributes -// to retrieve (a GEAList), if InformationLevel is QUERY_EAS_FROM_LIST. - -typedef struct _RESP_FIND_FIRST2 { - _USHORT( Sid ); // Search handle - _USHORT( SearchCount ); // Number of entries returned - _USHORT( EndOfSearch ); // Was last entry returned? - _USHORT( EaErrorOffset ); // Offset into EA list if EA error - _USHORT( LastNameOffset ); // Offset into data to file name of - // last entry, if server needs it - // to resume search; else 0 -} RESP_FIND_FIRST2; -typedef RESP_FIND_FIRST2 SMB_UNALIGNED *PRESP_FIND_FIRST2; - -// Data bytes for Find First2 response are level-dependent information -// about the matching files. If bit 2 in the request parameters was -// set, each entry is preceded by a four-byte resume key. - -// -// FindNext2 function code of Transaction2 SMB, see #3 page 26 -// Function is SrvSmbFindNext2() -// TRANS2_FIND_NEXT2 0x02 -// - -typedef struct _REQ_FIND_NEXT2 { - _USHORT( Sid ); // Search handle - _USHORT( SearchCount ); // Maximum number of entries to return - _USHORT( InformationLevel ); - _ULONG( ResumeKey ); // Value returned by previous find - _USHORT( Flags ); // Additional information: bit set- - // 0 - close search after this request - // 1 - close search if end reached - // 2 - return resume keys - // 3 - resume/continue, NOT rewind - UCHAR Buffer[1]; // Resume file name -} REQ_FIND_NEXT2; -typedef REQ_FIND_NEXT2 SMB_UNALIGNED *PREQ_FIND_NEXT2; - -// Data bytes for Find Next2 request are a list of extended attributes -// to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST. - -typedef struct _RESP_FIND_NEXT2 { - _USHORT( SearchCount ); // Number of entries returned - _USHORT( EndOfSearch ); // Was last entry returned? - _USHORT( EaErrorOffset ); // Offset into EA list if EA error - _USHORT( LastNameOffset ); // Offset into data to file name of - // last entry, if server needs it - // to resume search; else 0 -} RESP_FIND_NEXT2; -typedef RESP_FIND_NEXT2 SMB_UNALIGNED *PRESP_FIND_NEXT2; - -// Data bytes for Find Next2 response are level-dependent information -// about the matching files. If bit 2 in the request parameters was -// set, each entry is preceded by a four-byte resume key. - -// -// Flags for REQ_FIND_FIRST2.Flags -// - -#define SMB_FIND_CLOSE_AFTER_REQUEST 0x01 -#define SMB_FIND_CLOSE_AT_EOS 0x02 -#define SMB_FIND_RETURN_RESUME_KEYS 0x04 -#define SMB_FIND_CONTINUE_FROM_LAST 0x08 -#define SMB_FIND_WITH_BACKUP_INTENT 0x10 - -#endif // def INCLUDE_SMB_SEARCH - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -// -// Open2 function code of Transaction2 SMB, see #3 page 19 -// Function is SrvSmbOpen2() -// TRANS2_OPEN2 0x00 -// -// *** Note that the REQ_OPEN2 and RESP_OPEN2 structures closely -// resemble the REQ_OPEN_ANDX and RESP_OPEN_ANDX structures. -// - -typedef struct _REQ_OPEN2 { - _USHORT( Flags ); // Additional information: bit set- - // 0 - return additional info - // 1 - set single user total file lock - // 2 - server notifies consumer of - // actions which may change file - // 3 - return total length of EAs - _USHORT( DesiredAccess ); // File open mode - _USHORT( SearchAttributes ); // *** ignored - _USHORT( FileAttributes ); - _ULONG( CreationTimeInSeconds ); - _USHORT( OpenFunction ); - _ULONG( AllocationSize ); // Bytes to reserve on create or truncate - _USHORT( Reserved )[5]; // Pad through OpenAndX's Timeout, - // Reserved, and ByteCount - UCHAR Buffer[1]; // File name -} REQ_OPEN2; -typedef REQ_OPEN2 SMB_UNALIGNED *PREQ_OPEN2; - -// Data bytes for Open2 request are the extended attributes for the -// created file. - -typedef struct _RESP_OPEN2 { - _USHORT( Fid ); // File handle - _USHORT( FileAttributes ); - _ULONG( CreationTimeInSeconds ); - _ULONG( DataSize ); // Current file size - _USHORT( GrantedAccess ); // Access permissions actually allowed - _USHORT( FileType ); - _USHORT( DeviceState ); // state of IPC device (e.g. pipe) - _USHORT( Action ); // Action taken - _ULONG( ServerFid ); // Server unique file id - _USHORT( EaErrorOffset ); // Offset into EA list if EA error - _ULONG( EaLength ); // Total EA length for opened file -} RESP_OPEN2; -typedef RESP_OPEN2 SMB_UNALIGNED *PRESP_OPEN2; - -// The Open2 response has no data bytes. - - -#endif // def INCLUDE_SMB_OPEN_CLOSE - -#ifdef INCLUDE_SMB_MISC - -// -// QueryFsInformation function code of Transaction2 SMB, see #3 page 30 -// Function is SrvSmbQueryFsInformation() -// TRANS2_QUERY_FS_INFORMATION 0x03 -// - -typedef struct _REQ_QUERY_FS_INFORMATION { - _USHORT( InformationLevel ); -} REQ_QUERY_FS_INFORMATION; -typedef REQ_QUERY_FS_INFORMATION SMB_UNALIGNED *PREQ_QUERY_FS_INFORMATION; - -// No data bytes for Query FS Information request. - -//typedef struct _RESP_QUERY_FS_INFORMATION { -//} RESP_QUERY_FS_INFORMATION; -//typedef RESP_QUERY_FS_INFORMATION SMB_UNALIGNED *PRESP_QUERY_FS_INFORMATION; - -// Data bytes for Query FS Information response are level-dependent -// information about the specified volume. - -// -// SetFSInformation function code of Transaction2 SMB, see #3 page 31 -// Function is SrvSmbSetFSInformation() -// TRANS2_SET_PATH_INFORMATION 0x04 -// - -typedef struct _REQ_SET_FS_INFORMATION { - _USHORT( Fid ); - _USHORT( InformationLevel ); -} REQ_SET_FS_INFORMATION; -typedef REQ_SET_FS_INFORMATION SMB_UNALIGNED *PREQ_SET_FS_INFORMATION; - -// Data bytes for Set FS Information request are level-dependant -// information about the specified volume. - -//typedef struct _RESP_SET_FS_INFORMATION { -//} RESP_SET_FS_INFORMATION; -//typedef RESP_SET_FS_INFORMATION SMB_UNALIGNED *PRESP_SET_FS_INFORMATION; - -// The Set FS Information response has no data bytes. - -#endif // def INCLUDE_SMB_MISC - -#ifdef INCLUDE_SMB_QUERY_SET - -// -// QueryPathInformation function code of Transaction2 SMB, see #3 page 33 -// Function is SrvSmbQueryPathInformation() -// TRANS2_QUERY_PATH_INFORMATION 0x05 -// - -typedef struct _REQ_QUERY_PATH_INFORMATION { - _USHORT( InformationLevel ); - _ULONG( Reserved ); // Must be zero - UCHAR Buffer[1]; // File name -} REQ_QUERY_PATH_INFORMATION; -typedef REQ_QUERY_PATH_INFORMATION SMB_UNALIGNED *PREQ_QUERY_PATH_INFORMATION; - -// Data bytes for Query Path Information request are a list of extended -// attributes to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST. - -typedef struct _RESP_QUERY_PATH_INFORMATION { - _USHORT( EaErrorOffset ); // Offset into EA list if EA error -} RESP_QUERY_PATH_INFORMATION; -typedef RESP_QUERY_PATH_INFORMATION SMB_UNALIGNED *PRESP_QUERY_PATH_INFORMATION; - -// Data bytes for Query Path Information response are level-dependent -// information about the specified path/file. - -// -// SetPathInformation function code of Transaction2 SMB, see #3 page 35 -// Function is SrvSmbSetPathInformation() -// TRANS2_SET_PATH_INFORMATION 0x06 -// - -typedef struct _REQ_SET_PATH_INFORMATION { - _USHORT( InformationLevel ); - _ULONG( Reserved ); // Must be zero - UCHAR Buffer[1]; // File name -} REQ_SET_PATH_INFORMATION; -typedef REQ_SET_PATH_INFORMATION SMB_UNALIGNED *PREQ_SET_PATH_INFORMATION; - -// Data bytes for Set Path Information request are either file information -// and attributes or a list of extended attributes for the file. - -typedef struct _RESP_SET_PATH_INFORMATION { - _USHORT( EaErrorOffset ); // Offset into EA list if EA error -} RESP_SET_PATH_INFORMATION; -typedef RESP_SET_PATH_INFORMATION SMB_UNALIGNED *PRESP_SET_PATH_INFORMATION; - -// The Set Path Information response has no data bytes. - -// -// QueryFileInformation function code of Transaction2 SMB, see #3 page 37 -// Function is SrvSmbQueryFileInformation() -// TRANS2_QUERY_FILE_INFORMATION 0x07 -// - -typedef struct _REQ_QUERY_FILE_INFORMATION { - _USHORT( Fid ); // File handle - _USHORT( InformationLevel ); -} REQ_QUERY_FILE_INFORMATION; -typedef REQ_QUERY_FILE_INFORMATION SMB_UNALIGNED *PREQ_QUERY_FILE_INFORMATION; - -// Data bytes for Query File Information request are a list of extended -// attributes to retrieve, if InformationLevel is QUERY_EAS_FROM_LIST. - -typedef struct _RESP_QUERY_FILE_INFORMATION { - _USHORT( EaErrorOffset ); // Offset into EA list if EA error -} RESP_QUERY_FILE_INFORMATION; -typedef RESP_QUERY_FILE_INFORMATION SMB_UNALIGNED *PRESP_QUERY_FILE_INFORMATION; - -// Data bytes for Query File Information response are level-dependent -// information about the specified path/file. - -// -// SetFileInformation function code of Transaction2 SMB, see #3 page 39 -// Function is SrvSmbSetFileInformation() -// TRANS2_SET_FILE_INFORMATION 0x08 -// - -typedef struct _REQ_SET_FILE_INFORMATION { - _USHORT( Fid ); // File handle - _USHORT( InformationLevel ); - _USHORT( Flags ); // File I/O control flags: bit set- - // 4 - write through - // 5 - no cache -} REQ_SET_FILE_INFORMATION; -typedef REQ_SET_FILE_INFORMATION SMB_UNALIGNED *PREQ_SET_FILE_INFORMATION; - -// Data bytes for Set File Information request are either file information -// and attributes or a list of extended attributes for the file. - -typedef struct _RESP_SET_FILE_INFORMATION { - _USHORT( EaErrorOffset ); // Offset into EA list if EA error -} RESP_SET_FILE_INFORMATION; -typedef RESP_SET_FILE_INFORMATION SMB_UNALIGNED *PRESP_SET_FILE_INFORMATION; - -// The Set File Information response has no data bytes. - -#endif // def INCLUDE_SMB_QUERY_SET - -// -// Opcodes for Mailslot transactions. Not all filled in at present. -// WARNING ... the info here on mailslots (opcode and smb struct) -// is duplicated in net/h/mslotsmb.h -// - -#define MS_WRITE_OPCODE 1 - -typedef struct _SMB_TRANSACT_MAILSLOT { - UCHAR WordCount; // Count of data bytes; value = 17 - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( MaxParameterCount ); // Max parameter bytes to return - _USHORT( MaxDataCount ); // Max data bytes to return - UCHAR MaxSetupCount; // Max setup words to return - UCHAR Reserved; - _USHORT( Flags ); // Additional information: - // bit 0 - unused - // bit 1 - one-way transacion (no resp) - _ULONG( Timeout ); - _USHORT( Reserved1 ); - _USHORT( ParameterCount ); // Parameter bytes sent this buffer - _USHORT( ParameterOffset ); // Offset (from header start) to params - _USHORT( DataCount ); // Data bytes sent this buffer - _USHORT( DataOffset ); // Offset (from header start) to data - UCHAR SetupWordCount; // = 3 - UCHAR Reserved2; // Reserved (pad above to word) - _USHORT( Opcode ); // 1 -- Write Mailslot - _USHORT( Priority ); // Priority of transaction - _USHORT( Class ); // Class: 1 = reliable, 2 = unreliable - _USHORT( ByteCount ); // Count of data bytes - UCHAR Buffer[1]; // Buffer containing: - //UCHAR MailslotName[]; // "\MAILSLOT\0" - //UCHAR Pad[] // Pad to SHORT or LONG - //UCHAR Data[]; // Data to write to mailslot -} SMB_TRANSACT_MAILSLOT; -typedef SMB_TRANSACT_MAILSLOT SMB_UNALIGNED *PSMB_TRANSACT_MAILSLOT; - -typedef struct _SMB_TRANSACT_NAMED_PIPE { - UCHAR WordCount; // Count of data bytes; value = 16 - _USHORT( TotalParameterCount ); // Total parameter bytes being sent - _USHORT( TotalDataCount ); // Total data bytes being sent - _USHORT( MaxParameterCount ); // Max parameter bytes to return - _USHORT( MaxDataCount ); // Max data bytes to return - UCHAR MaxSetupCount; // Max setup words to return - UCHAR Reserved; - _USHORT( Flags ); // Additional information: - // bit 0 - also disconnect TID in Tid - // bit 1 - one-way transacion (no resp) - _ULONG( Timeout ); - _USHORT( Reserved1 ); - _USHORT( ParameterCount ); - // Buffer containing: - //UCHAR PipeName[]; // "\PIPE\0" - //UCHAR Pad[] // Pad to SHORT or LONG - //UCHAR Param[]; // Parameter bytes (# = ParameterCount) - //UCHAR Pad1[] // Pad to SHORT or LONG - //UCHAR Data[]; // Data bytes (# = DataCount) -} SMB_TRANSACT_NAMED_PIPE; -typedef SMB_TRANSACT_NAMED_PIPE SMB_UNALIGNED *PSMB_TRANSACT_NAMED_PIPE; - - -// -// Transaction - QueryInformationNamedPipe, Level 1, output data format -// - -typedef struct _NAMED_PIPE_INFORMATION_1 { - _USHORT( OutputBufferSize ); - _USHORT( InputBufferSize ); - UCHAR MaximumInstances; - UCHAR CurrentInstances; - UCHAR PipeNameLength; - UCHAR PipeName[1]; -} NAMED_PIPE_INFORMATION_1; -typedef NAMED_PIPE_INFORMATION_1 SMB_UNALIGNED *PNAMED_PIPE_INFORMATION_1; - -// -// Transaction - PeekNamedPipe, output format -// - -typedef struct _RESP_PEEK_NMPIPE { - _USHORT( ReadDataAvailable ); - _USHORT( MessageLength ); - _USHORT( NamedPipeState ); - //UCHAR Pad[]; - //UCHAR Data[]; -} RESP_PEEK_NMPIPE; -typedef RESP_PEEK_NMPIPE SMB_UNALIGNED *PRESP_PEEK_NMPIPE; - -// -// Define SMB pipe handle state bits used by Query/SetNamedPipeHandleState -// -// These number are the bit location of the fields in the handle state. -// - -#define PIPE_COMPLETION_MODE_BITS 15 -#define PIPE_PIPE_END_BITS 14 -#define PIPE_PIPE_TYPE_BITS 10 -#define PIPE_READ_MODE_BITS 8 -#define PIPE_MAXIMUM_INSTANCES_BITS 0 - -/* DosPeekNmPipe() pipe states */ - -#define PIPE_STATE_DISCONNECTED 0x0001 -#define PIPE_STATE_LISTENING 0x0002 -#define PIPE_STATE_CONNECTED 0x0003 -#define PIPE_STATE_CLOSING 0x0004 - -/* DosCreateNPipe and DosQueryNPHState state */ - -#define SMB_PIPE_READMODE_BYTE 0x0000 -#define SMB_PIPE_READMODE_MESSAGE 0x0100 -#define SMB_PIPE_TYPE_BYTE 0x0000 -#define SMB_PIPE_TYPE_MESSAGE 0x0400 -#define SMB_PIPE_END_CLIENT 0x0000 -#define SMB_PIPE_END_SERVER 0x4000 -#define SMB_PIPE_WAIT 0x0000 -#define SMB_PIPE_NOWAIT 0x8000 -#define SMB_PIPE_UNLIMITED_INSTANCES 0x00FF - - -// -// Pipe name string for conversion between SMB and NT formats. -// - -#define SMB_PIPE_PREFIX "\\PIPE" -#define UNICODE_SMB_PIPE_PREFIX L"\\PIPE" -#define CANONICAL_PIPE_PREFIX "PIPE\\" -#define NT_PIPE_PREFIX L"\\Device\\NamedPipe" - -#define SMB_PIPE_PREFIX_LENGTH (sizeof(SMB_PIPE_PREFIX) - 1) -#define UNICODE_SMB_PIPE_PREFIX_LENGTH \ - (sizeof(UNICODE_SMB_PIPE_PREFIX) - sizeof(WCHAR)) -#define CANONICAL_PIPE_PREFIX_LENGTH (sizeof(CANONICAL_PIPE_PREFIX) - 1) -#define NT_PIPE_PREFIX_LENGTH (sizeof(NT_PIPE_PREFIX) - sizeof(WCHAR)) - -// -// Mailslot name strings. -// - -#define SMB_MAILSLOT_PREFIX "\\MAILSLOT" -#define UNICODE_SMB_MAILSLOT_PREFIX L"\\MAILSLOT" - -#define SMB_MAILSLOT_PREFIX_LENGTH (sizeof(SMB_MAILSLOT_PREFIX) - 1) -#define UNICODE_SMB_MAILSLOT_PREFIX_LENGTH \ - (sizeof(UNICODE_SMB_MAILSLOT_PREFIX) - sizeof(WCHAR)) - -// -// NT Transaction subfunctions -// - -#ifdef INCLUDE_SMB_OPEN_CLOSE - -typedef struct _REQ_CREATE_WITH_SD_OR_EA { - _ULONG( Flags ); // Creation flags - _ULONG( RootDirectoryFid ); // Optional directory for relative open - ACCESS_MASK DesiredAccess; // Desired access (NT format) - LARGE_INTEGER AllocationSize; // The initial allocation size in bytes - _ULONG( FileAttributes ); // The file attributes - _ULONG( ShareAccess ); // The share access - _ULONG( CreateDisposition ); // Action to take if file exists or not - _ULONG( CreateOptions ); // Options for creating a new file - _ULONG( SecurityDescriptorLength );// Length of SD in bytes - _ULONG( EaLength ); // Length of EA in bytes - _ULONG( NameLength ); // Length of name in characters - _ULONG( ImpersonationLevel ); // Security QOS information - UCHAR SecurityFlags; // Security QOS information - UCHAR Buffer[1]; - //UCHAR Name[]; // The name of the file (not NUL terminated) -} REQ_CREATE_WITH_SD_OR_EA; -typedef REQ_CREATE_WITH_SD_OR_EA SMB_UNALIGNED *PREQ_CREATE_WITH_SD_OR_EA; - -// -// Data format: -// UCHAR SecurityDesciptor[]; -// UCHAR Pad1[]; // Pad to LONG -// UCHAR EaList[]; -// - -typedef struct _RESP_CREATE_WITH_SD_OR_EA { - UCHAR OplockLevel; // The oplock level granted - UCHAR Reserved; - _USHORT( Fid ); // The file ID - _ULONG( CreateAction ); // The action taken - _ULONG( EaErrorOffset ); // Offset of the EA error - TIME CreationTime; // The time the file was created - TIME LastAccessTime; // The time the file was accessed - TIME LastWriteTime; // The time the file was last written - TIME ChangeTime; // The time the file was last changed - _ULONG( FileAttributes ); // The file attributes - LARGE_INTEGER AllocationSize; // The number of byes allocated - LARGE_INTEGER EndOfFile; // The end of file offset - _USHORT( FileType ); - _USHORT( DeviceState ); // state of IPC device (e.g. pipe) - BOOLEAN Directory; // TRUE if this is a directory -} RESP_CREATE_WITH_SD_OR_EA; -typedef RESP_CREATE_WITH_SD_OR_EA SMB_UNALIGNED *PRESP_CREATE_WITH_SD_OR_EA; - -// No data bytes for the response - - -#endif // INCLUDE_SMB_OPEN_CLOSE - -// -// Setup words for NT I/O control request -// - -typedef struct _REQ_NT_IO_CONTROL { - _ULONG( FunctionCode ); - _USHORT( Fid ); - BOOLEAN IsFsctl; - UCHAR IsFlags; -} REQ_NT_IO_CONTROL; -typedef REQ_NT_IO_CONTROL SMB_UNALIGNED *PREQ_NT_IO_CONTROL; - -// -// Request parameter bytes - The first buffer -// Request data bytes - The second buffer -// - -// -// NT I/O Control response: -// -// Setup Words: None. -// Parameter Bytes: First buffer. -// Data Bytes: Second buffer. -// - -// -// NT Notify directory change -// - -// Request Setup Words - -typedef struct _REQ_NOTIFY_CHANGE { - _ULONG( CompletionFilter ); // Specifies operation to monitor - _USHORT( Fid ); // Fid of directory to monitor - BOOLEAN WatchTree; // TRUE = watch all subdirectories too - UCHAR Reserved; // MBZ -} REQ_NOTIFY_CHANGE; -typedef REQ_NOTIFY_CHANGE SMB_UNALIGNED *PREQ_NOTIFY_CHANGE; - -// -// Request parameter bytes: None -// Request data bytes: None -// - -// -// NT Notify directory change response -// -// Setup words: None. -// Parameter bytes: The change data buffer. -// Data bytes: None. -// - -// -// NT Set Security Descriptor request -// -// Setup words: REQ_SET_SECURITY_DESCIPTOR. -// Parameter Bytes: None. -// Data Bytes: The Security Descriptor data. -// - -typedef struct _REQ_SET_SECURITY_DESCRIPTOR { - _USHORT( Fid ); // FID of target - _USHORT( Reserved ); // MBZ - _ULONG( SecurityInformation ); // Fields of SD that to set -} REQ_SET_SECURITY_DESCRIPTOR; -typedef REQ_SET_SECURITY_DESCRIPTOR SMB_UNALIGNED *PREQ_SET_SECURITY_DESCRIPTOR; - -// -// NT Set Security Desciptor response -// -// Setup words: None. -// Parameter Bytes: None. -// Data Bytes: None. -// - -// -// NT Query Security Descriptor request -// -// Setup words: None. -// Parameter Bytes: REQ_QUERY_SECURITY_DESCRIPTOR. -// Data Bytes: None. -// - -typedef struct _REQ_QUERY_SECURITY_DESCRIPTOR { - _USHORT( Fid ); // FID of target - _USHORT( Reserved ); // MBZ - _ULONG( SecurityInformation ); // Fields of SD that to query -} REQ_QUERY_SECURITY_DESCRIPTOR; -typedef REQ_QUERY_SECURITY_DESCRIPTOR SMB_UNALIGNED *PREQ_QUERY_SECURITY_DESCRIPTOR; - -// -// NT Query Security Desciptor response -// -// Parameter bytes: RESP_QUERY_SECURITY_DESCRIPTOR -// Data Bytes: The Security Descriptor data. -// - -typedef struct _RESP_QUERY_SECURITY_DESCRIPTOR { - _ULONG( LengthNeeded ); // Size of data buffer required for SD -} RESP_QUERY_SECURITY_DESCRIPTOR; -typedef RESP_QUERY_SECURITY_DESCRIPTOR SMB_UNALIGNED *PRESP_QUERY_SECURITY_DESCRIPTOR; - -// -// NT Rename file -// -// Setup words: None -// Parameters bytes: REQ_NT_RENAME -// Data bytes: None -// - -typedef struct _REQ_NT_RENAME { - _USHORT( Fid ); // FID of file to rename - _USHORT( RenameFlags ); // defined below - UCHAR NewName[]; // New file name. -} REQ_NT_RENAME; -typedef REQ_NT_RENAME SMB_UNALIGNED *PREQ_NT_RENAME; - -// -// Rename flags defined -// - -#define SMB_RENAME_REPLACE_IF_EXISTS 1 - -// -// Turn structure packing back off -// - -#ifndef NO_PACKING -#include -#endif // ndef NO_PACKING - -// -// The following macros store and retrieve USHORTS and ULONGS from -// potentially unaligned addresses, avoiding alignment faults. They -// would best be written as inline assembly code. -// -// The macros are designed to be used for accessing SMB fields. Such -// fields are always stored in little-endian byte order, so these macros -// do byte swapping when compiled for a big-endian machine. -// -// !!! Not yet. -// - -#if !SMBDBG - -#define BYTE_0_MASK 0xFF - -#define BYTE_0(Value) (UCHAR)( (Value) & BYTE_0_MASK) -#define BYTE_1(Value) (UCHAR)( ((Value) >> 8) & BYTE_0_MASK) -#define BYTE_2(Value) (UCHAR)( ((Value) >> 16) & BYTE_0_MASK) -#define BYTE_3(Value) (UCHAR)( ((Value) >> 24) & BYTE_0_MASK) - -#endif - -//++ -// -// USHORT -// SmbGetUshort ( -// IN PSMB_USHORT SrcAddress -// ) -// -// Routine Description: -// -// This macro retrieves a USHORT value from the possibly misaligned -// source address, avoiding alignment faults. -// -// Arguments: -// -// SrcAddress - where to retrieve USHORT value from -// -// Return Value: -// -// USHORT - the value retrieved. The target must be aligned. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbGetUshort(SrcAddress) *(PSMB_USHORT)(SrcAddress) -#else -#define SmbGetUshort(SrcAddress) (USHORT)( \ - ( ( (PUCHAR)(SrcAddress) )[0] ) | \ - ( ( (PUCHAR)(SrcAddress) )[1] << 8 ) \ - ) -#endif -#else -#define SmbGetUshort(SrcAddress) (USHORT)( \ - ( ( (PUCHAR)(SrcAddress ## S) )[0] ) | \ - ( ( (PUCHAR)(SrcAddress ## S) )[1] << 8 ) \ - ) -#endif - -#else - -USHORT -SmbGetUshort ( - IN PSMB_USHORT SrcAddress - ); - -#endif - -//++ -// -// USHORT -// SmbGetAlignedUshort ( -// IN PUSHORT SrcAddress -// ) -// -// Routine Description: -// -// This macro retrieves a USHORT value from the source address, -// correcting for the endian characteristics of the server if -// necessary. -// -// Arguments: -// -// SrcAddress - where to retrieve USHORT value from; must be aligned. -// -// Return Value: -// -// USHORT - the value retrieved. The target must be aligned. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#define SmbGetAlignedUshort(SrcAddress) *(SrcAddress) -#else -#define SmbGetAlignedUshort(SrcAddress) *(SrcAddress ## S) -#endif - -#else - -USHORT -SmbGetAlignedUshort ( - IN PUSHORT SrcAddress - ); - -#endif - -//++ -// -// VOID -// SmbPutUshort ( -// OUT PSMB_USHORT DestAddress, -// IN USHORT Value -// ) -// -// Routine Description: -// -// This macro stores a USHORT value at the possibly misaligned -// destination address, avoiding alignment faults. -// -// Arguments: -// -// DestAddress - where to store USHORT value. Address may be -// misaligned. -// -// Value - USHORT to store. Value must be a constant or an aligned -// field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbPutUshort(SrcAddress, Value) \ - *(PSMB_USHORT)(SrcAddress) = (Value) -#else -#define SmbPutUshort(DestAddress,Value) { \ - ( (PUCHAR)(DestAddress) )[0] = BYTE_0(Value); \ - ( (PUCHAR)(DestAddress) )[1] = BYTE_1(Value); \ - } -#endif -#else -#define SmbPutUshort(DestAddress,Value) { \ - ( (PUCHAR)(DestAddress ## S) )[0] = BYTE_0(Value); \ - ( (PUCHAR)(DestAddress ## S) )[1] = BYTE_1(Value); \ - } -#endif - -#else - -VOID -SmbPutUshort ( - OUT PSMB_USHORT DestAddress, - IN USHORT Value - ); - -#endif - -//++ -// -// VOID -// SmbPutAlignedUshort ( -// OUT PUSHORT DestAddres, -// IN USHORT Value -// ) -// -// Routine Description: -// -// This macro stores a USHORT value from the source address, -// correcting for the endian characteristics of the server if -// necessary. -// -// Arguments: -// -// DestAddress - where to store USHORT value. Address may not be -// misaligned. -// -// Value - USHORT to store. Value must be a constant or an aligned -// field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#define SmbPutAlignedUshort(DestAddress,Value) *(DestAddress) = (Value) -#else -#define SmbPutAlignedUshort(DestAddress,Value) *(DestAddress ## S) = (Value) -#endif - -#else - -VOID -SmbPutAlignedUshort ( - OUT PUSHORT DestAddress, - IN USHORT Value - ); - -#endif - -//++ -// -// VOID -// SmbMoveUshort ( -// OUT PSMB_USHORT DestAddress -// IN PSMB_USHORT SrcAddress -// ) -// -// Routine Description: -// -// This macro moves a USHORT value from the possibly misaligned -// source address to the possibly misaligned destination address, -// avoiding alignment faults. -// -// Arguments: -// -// DestAddress - where to store USHORT value -// -// SrcAddress - where to retrieve USHORT value from -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbMoveUshort(DestAddress, SrcAddress) \ - *(PSMB_USHORT)(DestAddress) = *(PSMB_USHORT)(SrcAddress) -#else -#define SmbMoveUshort(DestAddress,SrcAddress) { \ - ( (PUCHAR)(DestAddress) )[0] = ( (PUCHAR)(SrcAddress) )[0]; \ - ( (PUCHAR)(DestAddress) )[1] = ( (PUCHAR)(SrcAddress) )[1]; \ - } -#endif -#else -#define SmbMoveUshort(DestAddress,SrcAddress) { \ - ( (PUCHAR)(DestAddress ## S) )[0] = ( (PUCHAR)(SrcAddress ## S) )[0]; \ - ( (PUCHAR)(DestAddress ## S) )[1] = ( (PUCHAR)(SrcAddress ## S) )[1]; \ - } -#endif - -#else - -VOID -SmbMoveUshort ( - OUT PSMB_USHORT DestAddress, - IN PSMB_USHORT SrcAddress - ); - -#endif - -//++ -// -// ULONG -// SmbGetUlong ( -// IN PSMB_ULONG SrcAddress -// ) -// -// Routine Description: -// -// This macro retrieves a ULONG value from the possibly misaligned -// source address, avoiding alignment faults. -// -// Arguments: -// -// SrcAddress - where to retrieve ULONG value from -// -// Return Value: -// -// ULONG - the value retrieved. The target must be aligned. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbGetUlong(SrcAddress) *(PSMB_ULONG)(SrcAddress) -#else -#define SmbGetUlong(SrcAddress) (ULONG)( \ - ( ( (PUCHAR)(SrcAddress) )[0] ) | \ - ( ( (PUCHAR)(SrcAddress) )[1] << 8 ) | \ - ( ( (PUCHAR)(SrcAddress) )[2] << 16 ) | \ - ( ( (PUCHAR)(SrcAddress) )[3] << 24 ) \ - ) -#endif -#else -#define SmbGetUlong(SrcAddress) (ULONG)( \ - ( ( (PUCHAR)(SrcAddress ## L) )[0] ) | \ - ( ( (PUCHAR)(SrcAddress ## L) )[1] << 8 ) | \ - ( ( (PUCHAR)(SrcAddress ## L) )[2] << 16 ) | \ - ( ( (PUCHAR)(SrcAddress ## L) )[3] << 24 ) \ - ) -#endif - -#else - -ULONG -SmbGetUlong ( - IN PSMB_ULONG SrcAddress - ); - -#endif - -//++ -// -// USHORT -// SmbGetAlignedUlong ( -// IN PULONG SrcAddress -// ) -// -// Routine Description: -// -// This macro retrieves a ULONG value from the source address, -// correcting for the endian characteristics of the server if -// necessary. -// -// Arguments: -// -// SrcAddress - where to retrieve ULONG value from; must be aligned. -// -// Return Value: -// -// ULONG - the value retrieved. The target must be aligned. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#define SmbGetAlignedUlong(SrcAddress) *(SrcAddress) -#else -#define SmbGetAlignedUlong(SrcAddress) *(SrcAddress ## L) -#endif - -#else - -ULONG -SmbGetAlignedUlong ( - IN PULONG SrcAddress - ); - -#endif - -//++ -// -// VOID -// SmbPutUlong ( -// OUT PSMB_ULONG DestAddress, -// IN ULONG Value -// ) -// -// Routine Description: -// -// This macro stores a ULONG value at the possibly misaligned -// destination address, avoiding alignment faults. -// -// Arguments: -// -// DestAddress - where to store ULONG value -// -// Value - ULONG to store. Value must be a constant or an aligned -// field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbPutUlong(SrcAddress, Value) *(PSMB_ULONG)(SrcAddress) = Value -#else -#define SmbPutUlong(DestAddress,Value) { \ - ( (PUCHAR)(DestAddress) )[0] = BYTE_0(Value); \ - ( (PUCHAR)(DestAddress) )[1] = BYTE_1(Value); \ - ( (PUCHAR)(DestAddress) )[2] = BYTE_2(Value); \ - ( (PUCHAR)(DestAddress) )[3] = BYTE_3(Value); \ - } -#endif -#else -#define SmbPutUlong(DestAddress,Value) { \ - ( (PUCHAR)(DestAddress ## L) )[0] = BYTE_0(Value); \ - ( (PUCHAR)(DestAddress ## L) )[1] = BYTE_1(Value); \ - ( (PUCHAR)(DestAddress ## L) )[2] = BYTE_2(Value); \ - ( (PUCHAR)(DestAddress ## L) )[3] = BYTE_3(Value); \ - } -#endif - -#else - -VOID -SmbPutUlong ( - OUT PSMB_ULONG DestAddress, - IN ULONG Value - ); - -#endif - -//++ -// -// VOID -// SmbPutAlignedUlong ( -// OUT PULONG DestAddres, -// IN ULONG Value -// ) -// -// Routine Description: -// -// This macro stores a ULONG value from the source address, -// correcting for the endian characteristics of the server if -// necessary. -// -// Arguments: -// -// DestAddress - where to store ULONG value. Address may not be -// misaligned. -// -// Value - ULONG to store. Value must be a constant or an aligned -// field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#define SmbPutAlignedUlong(DestAddress,Value) *(DestAddress) = (Value) -#else -#define SmbPutAlignedUlong(DestAddress,Value) *(DestAddress ## L) = (Value) -#endif - -#else - -VOID -SmbPutAlignedUlong ( - OUT PULONG DestAddress, - IN ULONG Value - ); - -#endif - -//++ -// -// VOID -// SmbMoveUlong ( -// OUT PSMB_ULONG DestAddress, -// IN PSMB_ULONG SrcAddress -// ) -// -// Routine Description: -// -// This macro moves a ULONG value from the possibly misaligned -// source address to the possible misaligned destination address, -// avoiding alignment faults. -// -// Arguments: -// -// DestAddress - where to store ULONG value -// -// SrcAddress - where to retrieve ULONG value from -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if !SMBDBG1 -#if SMB_USE_UNALIGNED -#define SmbMoveUlong(DestAddress,SrcAddress) \ - *(PSMB_ULONG)(DestAddress) = *(PSMB_ULONG)(SrcAddress) -#else -#define SmbMoveUlong(DestAddress,SrcAddress) { \ - ( (PUCHAR)(DestAddress) )[0] = ( (PUCHAR)(SrcAddress) )[0]; \ - ( (PUCHAR)(DestAddress) )[1] = ( (PUCHAR)(SrcAddress) )[1]; \ - ( (PUCHAR)(DestAddress) )[2] = ( (PUCHAR)(SrcAddress) )[2]; \ - ( (PUCHAR)(DestAddress) )[3] = ( (PUCHAR)(SrcAddress) )[3]; \ - } -#endif -#else -#define SmbMoveUlong(DestAddress,SrcAddress) { \ - ( (PUCHAR)(DestAddress ## L) )[0] = ( (PUCHAR)(SrcAddress ## L) )[0]; \ - ( (PUCHAR)(DestAddress ## L) )[1] = ( (PUCHAR)(SrcAddress ## L) )[1]; \ - ( (PUCHAR)(DestAddress ## L) )[2] = ( (PUCHAR)(SrcAddress ## L) )[2]; \ - ( (PUCHAR)(DestAddress ## L) )[3] = ( (PUCHAR)(SrcAddress ## L) )[3]; \ - } -#endif - -#else - -VOID -SmbMoveUlong ( - OUT PSMB_ULONG DestAddress, - IN PSMB_ULONG SrcAddress - ); - -#endif - -//++ -// -// VOID -// SmbPutDate ( -// OUT PSMB_DATE DestAddress, -// IN SMB_DATE Value -// ) -// -// Routine Description: -// -// This macro stores an SMB_DATE value at the possibly misaligned -// destination address, avoiding alignment faults. This macro -// is different from SmbPutUshort in order to be able to handle -// funny bitfield / big-endian interactions. -// -// Arguments: -// -// DestAddress - where to store SMB_DATE value -// -// Value - SMB_DATE to store. Value must be a constant or an -// aligned field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbPutDate(DestAddress,Value) (DestAddress)->Ushort = (Value).Ushort -#else -#define SmbPutDate(DestAddress,Value) { \ - ( (PUCHAR)&(DestAddress)->Ushort )[0] = BYTE_0((Value).Ushort); \ - ( (PUCHAR)&(DestAddress)->Ushort )[1] = BYTE_1((Value).Ushort); \ - } -#endif - -#else - -VOID -SmbPutDate ( - OUT PSMB_DATE DestAddress, - IN SMB_DATE Value - ); - -#endif - -//++ -// -// VOID -// SmbMoveDate ( -// OUT PSMB_DATE DestAddress, -// IN PSMB_DATE SrcAddress -// ) -// -// Routine Description: -// -// This macro copies an SMB_DATE value from the possibly misaligned -// source address, avoiding alignment faults. This macro is -// different from SmbGetUshort in order to be able to handle funny -// bitfield / big-endian interactions. -// -// Note that there is no SmbGetDate because of the way SMB_DATE is -// defined. It is a union containing a USHORT and a bitfield -// struct. The caller of an SmbGetDate macro would have to -// explicitly use one part of the union. -// -// Arguments: -// -// DestAddress - where to store SMB_DATE value. MUST BE ALIGNED! -// -// SrcAddress - where to retrieve SMB_DATE value from -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbMoveDate(DestAddress,SrcAddress) \ - (DestAddress)->Ushort = (SrcAddress)->Ushort -#else -#define SmbMoveDate(DestAddress,SrcAddress) \ - (DestAddress)->Ushort = \ - ( ( (PUCHAR)&(SrcAddress)->Ushort )[0] ) | \ - ( ( (PUCHAR)&(SrcAddress)->Ushort )[1] << 8 ) -#endif - -#else - -VOID -SmbMoveDate ( - OUT PSMB_DATE DestAddress, - IN PSMB_DATE SrcAddress - ); - -#endif - -//++ -// -// VOID -// SmbZeroDate ( -// IN PSMB_DATE Date -// ) -// -// Routine Description: -// -// This macro zeroes a possibly misaligned SMB_DATE field. -// -// Arguments: -// -// Date - Pointer to SMB_DATE field to zero. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbZeroDate(Date) (Date)->Ushort = 0 -#else -#define SmbZeroDate(Date) { \ - ( (PUCHAR)&(Date)->Ushort )[0] = 0; \ - ( (PUCHAR)&(Date)->Ushort )[1] = 0; \ - } -#endif - -#else - -VOID -SmbZeroDate ( - IN PSMB_DATE Date - ); - -#endif - -//++ -// -// BOOLEAN -// SmbIsDateZero ( -// IN PSMB_DATE Date -// ) -// -// Routine Description: -// -// This macro returns TRUE if the supplied SMB_DATE value is zero. -// -// Arguments: -// -// Date - Pointer to SMB_DATE value to check. MUST BE ALIGNED! -// -// Return Value: -// -// BOOLEAN - TRUE if Date is zero, else FALSE. -// -//-- - -#if !SMBDBG - -#define SmbIsDateZero(Date) ( (Date)->Ushort == 0 ) - -#else - -BOOLEAN -SmbIsDateZero ( - IN PSMB_DATE Date - ); - -#endif - -//++ -// -// VOID -// SmbPutTime ( -// OUT PSMB_TIME DestAddress, -// IN SMB_TIME Value -// ) -// -// Routine Description: -// -// This macro stores an SMB_TIME value at the possibly misaligned -// destination address, avoiding alignment faults. This macro -// is different from SmbPutUshort in order to be able to handle -// funny bitfield / big-endian interactions. -// -// Arguments: -// -// DestAddress - where to store SMB_TIME value -// -// Value - SMB_TIME to store. Value must be a constant or an -// aligned field. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbPutTime(DestAddress,Value) (DestAddress)->Ushort = (Value).Ushort -#else -#define SmbPutTime(DestAddress,Value) { \ - ( (PUCHAR)&(DestAddress)->Ushort )[0] = BYTE_0((Value).Ushort); \ - ( (PUCHAR)&(DestAddress)->Ushort )[1] = BYTE_1((Value).Ushort); \ - } -#endif - -#else - -VOID -SmbPutTime ( - OUT PSMB_TIME DestAddress, - IN SMB_TIME Value - ); - -#endif - -//++ -// -// VOID -// SmbMoveTime ( -// OUT PSMB_TIME DestAddress, -// IN PSMB_TIME SrcAddress -// ) -// -// Routine Description: -// -// This macro copies an SMB_TIME value from the possibly -// misaligned source address, avoiding alignment faults. This macro -// is different from SmbGetUshort in order to be able to handle -// funny bitfield / big-endian interactions. -// -// Note that there is no SmbGetTime because of the way SMB_TIME is -// defined. It is a union containing a USHORT and a bitfield -// struct. The caller of an SmbGetTime macro would have to -// explicitly use one part of the union. -// -// Arguments: -// -// DestAddress - where to store SMB_TIME value. MUST BE ALIGNED! -// -// SrcAddress - where to retrieve SMB_TIME value from -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbMoveTime(DestAddress,SrcAddress) \ - (DestAddress)->Ushort = (SrcAddress)->Ushort -#else -#define SmbMoveTime(DestAddress,SrcAddress) \ - (DestAddress)->Ushort = \ - ( ( (PUCHAR)&(SrcAddress)->Ushort )[0] ) | \ - ( ( (PUCHAR)&(SrcAddress)->Ushort )[1] << 8 ) -#endif - -#else - -VOID -SmbMoveTime ( - OUT PSMB_TIME DestAddress, - IN PSMB_TIME SrcAddress - ); - -#endif - -//++ -// -// VOID -// SmbZeroTime ( -// IN PSMB_TIME Time -// ) -// -// Routine Description: -// -// This macro zeroes a possibly misaligned SMB_TIME field. -// -// Arguments: -// -// Time - Pointer to SMB_TIME field to zero. -// -// Return Value: -// -// None. -// -//-- - -#if !SMBDBG - -#if SMB_USE_UNALIGNED -#define SmbZeroTime(Time) (Time)->Ushort = 0 -#else -#define SmbZeroTime(Time) { \ - ( (PUCHAR)&(Time)->Ushort )[0] = 0; \ - ( (PUCHAR)&(Time)->Ushort )[1] = 0; \ - } -#endif - -#else - -VOID -SmbZeroTime ( - IN PSMB_TIME Time - ); - -#endif - -//++ -// -// BOOLEAN -// SmbIsTimeZero ( -// IN PSMB_TIME Time -// ) -// -// Routine Description: -// -// This macro returns TRUE if the supplied SMB_TIME value is zero. -// -// Arguments: -// -// Time - Pointer to SMB_TIME value to check. Must be aligned and -// in native format! -// -// Return Value: -// -// BOOLEAN - TRUE if Time is zero, else FALSE. -// -//-- - -#if !SMBDBG - -#define SmbIsTimeZero(Time) ( (Time)->Ushort == 0 ) - -#else - -BOOLEAN -SmbIsTimeZero ( - IN PSMB_TIME Time - ); - -#endif - - -// -// -// Define protocol names -// -// - - -// -// PCNET1 is the original SMB protocol (CORE). -// - -#define PCNET1 "PC NETWORK PROGRAM 1.0" - -// -// Some versions of the original MSNET defined this as an alternate -// to the core protocol name -// - -#define PCLAN1 "PCLAN1.0" - -// -// This is used for the MS-NET 1.03 product. It defines Lock&Read, -// Write&Unlock, and a special version of raw read and raw write. -// -#define MSNET103 "MICROSOFT NETWORKS 1.03" - -// -// This is the DOS Lanman 1.0 specific protocol. It is equivilant -// to the LANMAN 1.0 protocol, except the server is required to -// map errors from the OS/2 error to an appropriate DOS error. -// -#define MSNET30 "MICROSOFT NETWORKS 3.0" - -// -// This is the first version of the full LANMAN 1.0 protocol, defined in -// the SMB FILE SHARING PROTOCOL EXTENSIONS VERSION 2.0 document. -// - -#define LANMAN10 "LANMAN1.0" - -// -// This is the first version of the full LANMAN 2.0 protocol, defined in -// the SMB FILE SHARING PROTOCOL EXTENSIONS VERSION 3.0 document. Note -// that the name is an interim protocol definition. This is for -// interoperability with IBM LAN SERVER 1.2 -// - -#define LANMAN12 "LM1.2X002" - -// -// This is the dos equivilant of the LANMAN12 protocol. It is identical -// to the LANMAN12 protocol, but the server will perform error mapping -// to appropriate DOS errors. -// -#define DOSLANMAN12 "DOS LM1.2X002" /* DOS equivalant of above. Final - * string will be "DOS LANMAN2.0" */ - -// -// Strings for LANMAN 2.1. -// -#define LANMAN21 "LANMAN2.1" -#define DOSLANMAN21 "DOS LANMAN2.1" - -// -// !!! Do not set to final protcol string until the spec -// is cast in stone. -// -// The SMB protocol designed for NT. This has special SMBs -// which duplicate the NT semantics. -// -#define NTLANMAN "NT LM 0.12" - - -// -// The XENIXCORE dialect is a bit special. It is identical to core, -// except user passwords are not to be uppercased before being shipped -// to the server -// -#define XENIXCORE "XENIX CORE" - - -// -// Windows for Workgroups V1.0 -// -#define WFW10 "Windows for Workgroups 3.1a" - - -#define PCNET1_SZ 22 -#define PCLAN1_SZ 8 - -#define MSNET103_SZ 23 -#define MSNET30_SZ 22 - -#define LANMAN10_SZ 9 -#define LANMAN12_SZ 9 - -#define DOSLANMAN12_SZ 13 - - - -/* - * Defines and data for Negotiate Protocol - */ -#define PC1 0 -#define PC2 1 -#define LM1 2 -#define MS30 3 -#define MS103 4 -#define LM12 5 -#define DOSLM12 6 - - -/* Protocol indexes definition. */ -#define PCLAN 1 /* PC Lan 1.0 & MS Lan 1.03 */ -#define MSNT30 2 /* MS Net 3.0 redirector */ -#define DOSLM20 3 /* Dos LAN Manager 2.0 */ -#define LANMAN 4 /* Lanman redirector */ -#define LANMAN20 5 /* Lan Manager 2.0 */ - -// -// Protocol specific path constraints. -// - -#define MAXIMUM_PATHLEN_LANMAN12 260 -#define MAXIMUM_PATHLEN_CORE 128 - -#define MAXIMUM_COMPONENT_LANMAN12 254 -#define MAXIMUM_COMPONENT_CORE 8+1+3 // 8.3 filenames. - - - -#endif // _CIFS_ - - diff --git a/qt-correction-tool/pub/ddk/classpnp.h b/qt-correction-tool/pub/ddk/classpnp.h deleted file mode 100644 index 96e64dd..0000000 --- a/qt-correction-tool/pub/ddk/classpnp.h +++ /dev/null @@ -1,3306 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - classpnp.h - -Abstract: - - These are the structures and defines that are used in the - SCSI class drivers. - ---*/ - -#ifndef _CLASS_ -#define _CLASS_ - -#include -#include -#include -#include -#include "ntddstor.h" - -#include - -#include - -#if defined DebugPrint - #undef DebugPrint -#endif - -#ifdef TRY - #undef TRY -#endif -#ifdef LEAVE - #undef LEAVE -#endif -#ifdef FINALLY - #undef FINALLY -#endif - -#define TRY -#define LEAVE goto __tryLabel; -#define FINALLY __tryLabel: - -// #define ALLOCATE_SRB_FROM_POOL - -// -// describes the well-known bit masks for ClassDebug, and describes the bits -// to enable in the debugger to view just those messages. ClassDebugExternalX -// are reserved for third-party components' debugging use. Anything above -// 16 will only be printed if the lower two bytes of ClassDebug are higher -// than the given level (no masking will be available). -// - -typedef enum _CLASS_DEBUG_LEVEL { - ClassDebugError = 0, // always printed - ClassDebugWarning = 1, // set bit 0x00010000 in ClassDebug - ClassDebugTrace = 2, // set bit 0x00020000 in ClassDebug - ClassDebugInfo = 3, // set bit 0x00040000 in ClassDebug -#if 0 - ClassDebug Internal = 4, // set bit 0x00080000 in ClassDebug - - ClassDebug Internal = 5, // set bit 0x00100000 in ClassDebug - ClassDebug Internal = 6, // set bit 0x00200000 in ClassDebug - ClassDebug Internal = 7, // set bit 0x00400000 in ClassDebug -#endif // 0 - ClassDebugMediaLocks = 8, // set bit 0x00800000 in ClassDebug - - ClassDebugMCN = 9, // set bit 0x01000000 in ClassDebug - ClassDebugDelayedRetry = 10, // set bit 0x02000000 in ClassDebug - ClassDebugSenseInfo = 11, // set bit 0x04000000 in ClassDebug - ClassDebugRemoveLock = 12, // set bit 0x08000000 in ClassDebug - - ClassDebugExternal4 = 13, // set bit 0x10000000 in ClassDebug - ClassDebugExternal3 = 14, // set bit 0x20000000 in ClassDebug - ClassDebugExternal2 = 15, // set bit 0x40000000 in ClassDebug - ClassDebugExternal1 = 16 // set bit 0x80000000 in ClassDebug -} CLASS_DEBUG_LEVEL, *PCLASS_DEBUG_LEVEL; - -#if DBG - -#define DebugPrint(x) ClassDebugPrint x - -#else - -#define DebugPrint(x) - -#endif // DBG - -#define DEBUG_BUFFER_LENGTH 256 - -// -// Define our private SRB flags. The high nibble of the flag field is -// reserved for class drivers's private use. -// - -// -// Used to indicate that this request shouldn't invoke any power type operations -// like spinning up the drive. -// - -#define SRB_CLASS_FLAGS_LOW_PRIORITY 0x10000000 - -// -// Used to indicate that the completion routine should not free the srb. -// - -#define SRB_CLASS_FLAGS_PERSISTANT 0x20000000 - -// -// Used to indicate that an SRB is the result of a paging operation. -// - -#define SRB_CLASS_FLAGS_PAGING 0x40000000 - -// -// Used to indicate the completion routine should free the MDL. -// - -#define SRB_CLASS_FLAGS_FREE_MDL 0x80000000 - -// -// Random macros which should probably be in the system header files -// somewhere. -// - -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#define min(a,b) (((a) < (b)) ? (a) : (b)) - -// -// Bit Flag Macros -// - -#define SET_FLAG(Flags, Bit) ((Flags) |= (Bit)) -#define CLEAR_FLAG(Flags, Bit) ((Flags) &= ~(Bit)) -#define TEST_FLAG(Flags, Bit) (((Flags) & (Bit)) != 0) - -// -// neat little hacks to count number of bits set efficiently -// -__inline ULONG CountOfSetBitsUChar(UCHAR _X) -{ ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; } -__inline ULONG CountOfSetBitsULong(ULONG _X) -{ ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; } -__inline ULONG CountOfSetBitsULong32(ULONG32 _X) -{ ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; } -__inline ULONG CountOfSetBitsULong64(ULONG64 _X) -{ ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; } -__inline ULONG CountOfSetBitsUlongPtr(ULONG_PTR _X) -{ ULONG i = 0; while (_X) { _X &= _X - 1; i++; } return i; } - - -// -// Helper macros to verify data types and cleanup the code. -// - -#define ASSERT_FDO(x) \ - ASSERT(((PCOMMON_DEVICE_EXTENSION) (x)->DeviceExtension)->IsFdo) - -#define ASSERT_PDO(x) \ - ASSERT(!(((PCOMMON_DEVICE_EXTENSION) (x)->DeviceExtension)->IsFdo)) - -#define IS_CLEANUP_REQUEST(majorFunction) \ - ((majorFunction == IRP_MJ_CLOSE) || \ - (majorFunction == IRP_MJ_CLEANUP) || \ - (majorFunction == IRP_MJ_SHUTDOWN)) - -#define DO_MCD(fdoExtension) \ - (((fdoExtension)->MediaChangeDetectionInfo != NULL) && \ - ((fdoExtension)->MediaChangeDetectionInfo->MediaChangeDetectionDisableCount == 0)) - -#define IS_SCSIOP_READ(opCode) \ - ((opCode == SCSIOP_READ6) || \ - (opCode == SCSIOP_READ) || \ - (opCode == SCSIOP_READ12) || \ - (opCode == SCSIOP_READ16)) - -#define IS_SCSIOP_WRITE(opCode) \ - ((opCode == SCSIOP_WRITE6) || \ - (opCode == SCSIOP_WRITE) || \ - (opCode == SCSIOP_WRITE12) || \ - (opCode == SCSIOP_WRITE16)) - -#define IS_SCSIOP_READWRITE(opCode) (IS_SCSIOP_READ(opCode) || IS_SCSIOP_WRITE(opCode)) - -#define ADJUST_FUA_FLAG(fdoExt) { \ - if (TEST_FLAG(fdoExt->DeviceFlags, DEV_WRITE_CACHE) && \ - !TEST_FLAG(fdoExt->DeviceFlags, DEV_POWER_PROTECTED) && \ - !TEST_FLAG(fdoExt->ScanForSpecialFlags, CLASS_SPECIAL_FUA_NOT_SUPPORTED) ) { \ - fdoExt->CdbForceUnitAccess = TRUE; \ - } else { \ - fdoExt->CdbForceUnitAccess = FALSE; \ - } \ -} - -#define FREE_POOL(_PoolPtr) \ - if (_PoolPtr != NULL) { \ - ExFreePool(_PoolPtr); \ - _PoolPtr = NULL; \ - } - -#ifdef POOL_TAGGING -#undef ExAllocatePool -#undef ExAllocatePoolWithQuota -#define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,'nUcS') -//#define ExAllocatePool(a,b) #assert(0) -#define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,'nUcS') -#endif - -#define CLASS_TAG_AUTORUN_DISABLE 'ALcS' -#define CLASS_TAG_FILE_OBJECT_EXTENSION 'FLcS' -#define CLASS_TAG_MEDIA_CHANGE_DETECTION 'MLcS' -#define CLASS_TAG_MOUNT 'mLcS' -#define CLASS_TAG_RELEASE_QUEUE 'qLcS' -#define CLASS_TAG_POWER 'WLcS' -#define CLASS_TAG_WMI 'wLcS' -#define CLASS_TAG_FAILURE_PREDICT 'fLcS' -#define CLASS_TAG_DEVICE_CONTROL 'OIcS' -#define CLASS_TAG_MODE_DATA 'oLcS' -#define CLASS_TAG_MULTIPATH 'mPcS' - -#define MAXIMUM_RETRIES 4 - -#define CLASS_DRIVER_EXTENSION_KEY ((PVOID) ClassInitialize) - -struct _CLASS_INIT_DATA; -typedef struct _CLASS_INIT_DATA - CLASS_INIT_DATA, - *PCLASS_INIT_DATA; - -// -// our first attempt at keeping private data actually private.... -// - -struct _CLASS_PRIVATE_FDO_DATA; -typedef struct _CLASS_PRIVATE_FDO_DATA - CLASS_PRIVATE_FDO_DATA, - *PCLASS_PRIVATE_FDO_DATA; - -struct _CLASS_PRIVATE_PDO_DATA; -typedef struct _CLASS_PRIVATE_PDO_DATA - CLASS_PRIVATE_PDO_DATA, - *PCLASS_PRIVATE_PDO_DATA; - -struct _CLASS_PRIVATE_COMMON_DATA; -typedef struct _CLASS_PRIVATE_COMMON_DATA - CLASS_PRIVATE_COMMON_DATA, - *PCLASS_PRIVATE_COMMON_DATA; - -// -// Possible values for the IsRemoved flag -// - -#define NO_REMOVE 0 -#define REMOVE_PENDING 1 -#define REMOVE_COMPLETE 2 - - -#define ClassAcquireRemoveLock(devobj, tag) \ - ClassAcquireRemoveLockEx(devobj, tag, __FILE__, __LINE__) - -// -// Define start unit timeout to be 4 minutes. -// - -#define START_UNIT_TIMEOUT (60 * 4) - -// -// Define media change test time to be 1 second for quicker response - -#define MEDIA_CHANGE_DEFAULT_TIME 1 - -// -// Used to detect the loss of the autorun irp. -// - -#define MEDIA_CHANGE_TIMEOUT_TIME 300 - -// -// Define the various states that media can be in for autorun. -// -typedef enum _MEDIA_CHANGE_DETECTION_STATE { - MediaUnknown, - MediaPresent, - MediaNotPresent, - MediaUnavailable // e.g. cd-r media undergoing burn -} MEDIA_CHANGE_DETECTION_STATE, *PMEDIA_CHANGE_DETECTION_STATE; - - -struct _MEDIA_CHANGE_DETECTION_INFO; -typedef struct _MEDIA_CHANGE_DETECTION_INFO - MEDIA_CHANGE_DETECTION_INFO, *PMEDIA_CHANGE_DETECTION_INFO; - -// -// Structures for maintaining a dictionary list (list of objects -// referenced by a key value) -// - -struct _DICTIONARY_HEADER; -typedef struct _DICTIONARY_HEADER DICTIONARY_HEADER, *PDICTIONARY_HEADER; - -typedef struct _DICTIONARY { - ULONGLONG Signature; - PDICTIONARY_HEADER List; - KSPIN_LOCK SpinLock; -} DICTIONARY, *PDICTIONARY; - - -// -// structures to simplify matching devices, ids, and hacks required for -// these ids. -// - -typedef struct _CLASSPNP_SCAN_FOR_SPECIAL_INFO { - - // - // * NULL pointers indicates that no match is required. - // * empty string will only match an empty string. non-existant strings - // in the device descriptor are considered empty strings for this match. - // (ie. "" will only match "") - // * all other strings will do partial matches, based upon - // string provided (ie. "hi" will match "hitazen" and "higazui") - // * array must end with all three PCHARs being set to NULL. - // - - PCHAR VendorId; - PCHAR ProductId; - PCHAR ProductRevision; - - // - // marked as a ULONG_PTR to allow use as either a ptr to a data block - // or 32 bits worth of flags. (64 bits on 64 bit systems) no longer a - // const so that it may be dynamically built. - // - - ULONG_PTR Data; - -} CLASSPNP_SCAN_FOR_SPECIAL_INFO, *PCLASSPNP_SCAN_FOR_SPECIAL_INFO; - - - - -#ifdef ALLOCATE_SRB_FROM_POOL - -#define ClasspAllocateSrb(ext) - ExAllocatePoolWithTag(NonPagedPool, \ - sizeof(SCSI_REQUEST_BLOCK), \ - 'sBRS') - -#define ClasspFreeSrb(ext, srb) ExFreePool((srb)); - -#else - -#define ClasspAllocateSrb(ext) \ - ExAllocateFromNPagedLookasideList( \ - &((ext)->CommonExtension.SrbLookasideList)) - -#define ClasspFreeSrb(ext, srb) \ - ExFreeToNPagedLookasideList( \ - &((ext)->CommonExtension.SrbLookasideList), \ - (srb)) - -#endif - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_ERROR() - -Routine Description: - - This routine is a callback into the driver to handle errors. The queue - shall not be unfrozen when this error handler is called, even though the - SRB flags may mark the queue as having been frozen due to this SRB. - -Irql: - - This routine will be called at KIRQL <= DISPATCH_LEVEL - -Arguments: - - DeviceObject is the device object the error occurred on. - - Srb is the Srb that was being processed when the error occurred. - - Status may be overwritten by the routine if it decides that the error - was benign, or otherwise wishes to change the returned status code - for this command - - Retry may be overwritten to specify that this command should or should - not be retried (if the callee supports retrying commands) - -Return Value: - - status - ---*/ - -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -VOID -(*PCLASS_ERROR) ( - __in PDEVICE_OBJECT DeviceObject, - __in PSCSI_REQUEST_BLOCK Srb, - __out NTSTATUS *Status, - __inout BOOLEAN *Retry - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_ADD_DEVICE() - -Routine Description: - - This routine is a callback into the driver to create and initialize a new - FDO for the corresponding PDO. It may perform property queries on the PDO - but cannot do any media access operations. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DriverObject is the class driver object this callback is registered for. - - PDO is the physical device object being added to. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_ADD_DEVICE) ( - __in PDRIVER_OBJECT DriverObject, - __in PDEVICE_OBJECT Pdo - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -CLASS_POWER_DEVICE() - -Routine Description: - - This routine is a callback into the driver to handle power up and - power down requests. Most drivers can set this to ClassPowerHandler, - which will send a STOP_UNIT on powerdown, and a START_UNIT on powerup. - ClassMinimalPowerHandler() may also be used to do nothing for power - operations (except succeed them). Please see the DDK for proper handling - of IRP_MN_DEVICE_USAGE_NOTIFICATION for details regarding interaction - of paging device notifications and the IRQL at which this routine will - be called. - -Irql: - - This routine will be called at PASSIVE_LEVEL if DO_POWER_PAGABLE is set. - This code should NOT be pagable to prevent race conditions during the - setting and clearing of the DO_POWER_PAGABLE bit. - -Arguments: - - DeviceObject is the device that has the pending power request - - Irp is the power irp that needs to be handled - -Return Value: - - status - ---*/ -typedef -NTSTATUS -(*PCLASS_POWER_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -/*++//////////////////////////////////////////////////////////////////////////// - -CLASS_START_DEVICE() - -Routine Description: - - This routine is a callback into the driver to initialize the FDO or PDO for - all requests, typically due to a IRP_MN_START_DEVICE. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device object being started - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_START_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -CLASS_STOP_DEVICE() - -Routine Description: - - This routine is a callback into the driver to stop the device. - For the storage stack, unless there are known issues, this routine - need only return. All queueing shall be handled by the lower device - drivers. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device object being stopped/query stopped. - - Type is the IRP_MN_ type that must be handled. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_STOP_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject, - __in UCHAR Type - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -CLASS_INIT_DEVICE() - -Routine Description: - - This routine is a callback into the driver to do one-time initialization - of new device objects. It shall be called exactly once per device object, - and it shall be called prior to CLASS_START_DEVICE() routine. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device object to be initialized - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_INIT_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -CLASS_ENUM_DEVICE() - -Routine Description: - - This routine is a callback into the driver to update the list of PDOs for - a given FDO. See DISK.SYS's DiskEnumerateDevice for an example of use. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the FDO which is being enumerated. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_ENUM_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_READ_WRITE() - -Routine Description: - - This routine is a callback into the driver to verify READ and WRITE irps. - If the READ or WRITE request is failed, this routine shall set the Irp's - IoStatus.Status to the returned error code and the IoStatus.Information - field as appropriate for the given error. - -Irql: - - This routine will be called at KIRQL <= DISPATCH_LEVEL - -Arguments: - - DeviceObject is the device object being read from or written to - - Irp is the read or write request being processed - -Return Value: - - status - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -NTSTATUS -(*PCLASS_READ_WRITE) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_DEVICE_CONTROL() - -Routine Description: - - This routine is a callback into the driver to - -Irql: - - This routine will only be called at PASSIVE_LEVEL for storage IOCTLs. - The code must therefore not be paged, but may call paged code for those - ioctls which have been defined to be sent at PASSIVE_LEVEL, such as the - storage IOCTLS. Otherwise KIRQL <= DISPATCH_LEVEL. - -Arguments: - - DeviceObject is the device object the IOCTL may be for - - Irp is the IOCTL request currently being processed - -Return Value: - - status - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -NTSTATUS -(*PCLASS_DEVICE_CONTROL) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_SHUTDOWN_FLUSH() - -Routine Description: - - This routine is a callback into the driver to handle shutdown and flush - irps. These are sent by the system before it actually shuts down or when - the file system does a flush. - - This routine may synchronize the device's media / cache and ensure the - device is not locked if the system is in the process of shutting down. - -Irql: - - This routine will be called at KIRQL <= DISPATCH_LEVEL - -Arguments: - - DeviceObject is the device object that needs to be flushed - - Irp is the shutdown or flush request currently being processed - -Return Value: - - status - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -NTSTATUS -(*PCLASS_SHUTDOWN_FLUSH) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_CREATE_CLOSE() - -Routine Description: - - This routine is a callback into the driver when the device is opened or - closed. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject that is handling the request - - Irp is the create or close request currently being processed - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_CREATE_CLOSE) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_QUERY_ID() - -Routine Description: - - This routine generates the PNP id's for the device's enumerated PDOs. - If the specified ID is one that cannot be generated, then the return - status shall be STATUS_NOT_IMPLEMENTED so that classpnp shall not - handle the request. This routine shall allocate the buffer in the unicode - string "IdString" upon success; it is the caller's responsibility to free - this buffer when it is done. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the PDO to generate an ID for - - IdType is the type of ID to be generated - - UnicodeIdString is the string to place the results into - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_QUERY_ID) ( - __in PDEVICE_OBJECT DeviceObject, - __in BUS_QUERY_ID_TYPE IdType, - __in PUNICODE_STRING IdString - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_REMOVE_DEVICE() - -Routine Description: - - This routine is a callback into the driver to release any resources the - device may have allocated for the device object. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device object being removed/query removed/etc. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_REMOVE_DEVICE) ( - __in PDEVICE_OBJECT DeviceObject, - __in UCHAR Type - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_UNLOAD() - -Routine Description: - - This routine is a callback into the driver to unload itself. It must free - any resources allocated in the DriverEntry portion of the driver. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - X - - Irp is the IOCTL request currently being processed - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -VOID -(*PCLASS_UNLOAD) ( - __in PDRIVER_OBJECT DriverObject - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_QUERY_PNP_CAPABILITIES() - -Routine Description: - - ISSUE-2000/02/18-henrygab - description required - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - PhysicalDeviceObject is the PDO for which this query shall occur - - Capabilities is a structure that shall be modified by this routine - to report the device's capabilities. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_QUERY_PNP_CAPABILITIES) ( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in PDEVICE_CAPABILITIES Capabilities - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_TICK() - -Routine Description: - - This routine is a callback into the driver that is called once per second. - -Irql: - - This routine will be called at DISPATCH_LEVEL - -Arguments: - - DeviceObject is the device object for which the timer has fired - -Return Value: - - status - ---*/ -__drv_requiresIRQL(DISPATCH_LEVEL) -typedef -VOID -(*PCLASS_TICK) ( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_QUERY_WMI_REGINFO_EX() - -Routine Description: - - This routine is a callback into the driver to retrieve information about - the guids being registered. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose registration information is needed - - *RegFlags returns with a set of flags that describe the guids being - registered for this device. If the device wants enable and disable - collection callbacks before receiving queries for the registered - guids then it should return the WMIREG_FLAG_EXPENSIVE flag. Also the - returned flags may specify WMIREG_FLAG_INSTANCE_PDO in which case - the instance name is determined from the PDO associated with the - device object. Note that the PDO must have an associated devnode. If - WMIREG_FLAG_INSTANCE_PDO is not set then Name must return a unique - name for the device. - - Name returns with the instance name for the guids if - WMIREG_FLAG_INSTANCE_PDO is not set in the returned *RegFlags. The - caller will call ExFreePool with the buffer returned. - - MofResourceName returns filled with a static string that contains - the name of the MOF resource attached to the drivers image. The - caller does not free the buffer as it is expected that the - caller will use RtlInitializeUnicodeString to populate it. - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_QUERY_WMI_REGINFO_EX) ( - __in PDEVICE_OBJECT DeviceObject, - __out ULONG *RegFlags, - __out PUNICODE_STRING Name, - __out PUNICODE_STRING MofResouceName - ); - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_QUERY_WMI_REGINFO() - -Routine Description: - - This routine is a callback into the driver to retrieve information about - the guids being registered. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose registration information is needed - - *RegFlags returns with a set of flags that describe the guids being - registered for this device. If the device wants enable and disable - collection callbacks before receiving queries for the registered - guids then it should return the WMIREG_FLAG_EXPENSIVE flag. Also the - returned flags may specify WMIREG_FLAG_INSTANCE_PDO in which case - the instance name is determined from the PDO associated with the - device object. Note that the PDO must have an associated devnode. If - WMIREG_FLAG_INSTANCE_PDO is not set then Name must return a unique - name for the device. - - Name returns with the instance name for the guids if - WMIREG_FLAG_INSTANCE_PDO is not set in the returned *RegFlags. The - caller will call ExFreePool with the buffer returned. - - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_QUERY_WMI_REGINFO) ( - __in PDEVICE_OBJECT DeviceObject, - __out ULONG *RegFlags, - __out PUNICODE_STRING Name - ); - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_QUERY_WMI_DATABLOCK() - -Routine Description: - - This routine is a callback into the driver to query for the contents of - a data block. When the driver has finished filling the data block it - must call ClassWmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - BufferAvail on has the maximum size available to write the data - block. - - Buffer on return is filled with the returned data block - - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_QUERY_WMI_DATABLOCK) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG GuidIndex, - __in ULONG BufferAvail, - __out_bcount(BufferAvail) PUCHAR Buffer - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_SET_WMI_DATABLOCK() - -Routine Description: - - This routine is a callback into the driver to query for the contents of - a data block. When the driver has finished filling the data block it - must call ClassWmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - BufferSize has the size of the data block passed - - Buffer has the new values for the data block - - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_SET_WMI_DATABLOCK) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG GuidIndex, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_SET_WMI_DATAITEM() - -Routine Description: - - This routine is a callback into the driver to query for the contents of - a data block. When the driver has finished filling the data block it - must call ClassWmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - DataItemId has the id of the data item being set - - BufferSize has the size of the data item passed - - Buffer has the new values for the data item - - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_SET_WMI_DATAITEM) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG GuidIndex, - __in ULONG DataItemId, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_EXECUTE_WMI_METHOD() - -Routine Description: - - This routine is a callback into the driver to execute a method. When the - driver has finished filling the data block it must call - ClassWmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - MethodId has the id of the method being called - - InBufferSize has the size of the data block passed in as the input to - the method. - - OutBufferSize on entry has the maximum size available to write the - returned data block. - - Buffer is filled with the returned data block - - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_EXECUTE_WMI_METHOD) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG GuidIndex, - __in ULONG MethodId, - __in ULONG InBufferSize, - __in ULONG OutBufferSize, - __in_xcount(max(InBufferSize, OutBufferSize)) PUCHAR Buffer - ); - - - -// -// used by PCLASS_WMI_FUNCTION_CONTROL -// -typedef enum { - EventGeneration, - DataBlockCollection -} CLASSENABLEDISABLEFUNCTION; - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_WMI_FUNCTION_CONTROL() - -Routine Description: - - This routine is a callback into the driver to enabled or disable event - generation or data block collection. A device should only expect a - single enable when the first event or data consumer enables events or - data collection and a single disable when the last event or data - consumer disables events or data collection. Data blocks will only - receive collection enable/disable if they were registered as requiring - it. - -Irql: - - This routine will be called at PASSIVE_LEVEL. - Its code may be safely paged. - -Arguments: - - DeviceObject is the device whose data block is being queried - - GuidIndex is the index into the list of guids provided when the - device registered - - Function specifies which functionality is being enabled or disabled - - Enable is TRUE then the function is being enabled else disabled - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -NTSTATUS -(*PCLASS_WMI_FUNCTION_CONTROL) ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG GuidIndex, - __in CLASSENABLEDISABLEFUNCTION Function, - __in BOOLEAN Enable - ); - -/*++//////////////////////////////////////////////////////////////////////////// - - This structure defines the history kept for a given transfer packet. - It includes a srb status/sense data structure that is always either valid - or zero-filled for the full 18 bytes, time sent/completed, and how long - the retry delay was requested to be. - ---*/ -typedef struct _SRB_HISTORY_ITEM { - LARGE_INTEGER TickCountSent; // 0x00..0x07 - LARGE_INTEGER TickCountCompleted; // 0x08..0x0F - ULONG MillisecondsDelayOnRetry; // 0x10..0x13 - SENSE_DATA NormalizedSenseData; // 0x14..0x25 (0x12 bytes) - UCHAR SrbStatus; // 0x26 - UCHAR ClassDriverUse; // 0x27 -- one byte free (alignment) -} SRB_HISTORY_ITEM, *PSRB_HISTORY_ITEM; - -typedef struct _SRB_HISTORY { - ULONG_PTR ClassDriverUse[4]; // for the class driver to use as they please - __field_range(1,30000) - ULONG TotalHistoryCount; - __field_range(0,TotalHistoryCount) - ULONG UsedHistoryCount; - __field_ecount_part(TotalHistoryCount, UsedHistoryCount) - SRB_HISTORY_ITEM History[1]; -} SRB_HISTORY, *PSRB_HISTORY; - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_INTERPRET_SENSE_INFO() - -Routine Description: - - This routine is a callback into the driver to perform interpretation of the - errors that may have occurred during an SRB transfer. It closely matches the - API set of ClassInterpretSenseInfo, with modifications to allow for a history - of why the request was previously retried (and when), and changes the retry - interval from being in seconds to being in milliseconds. Finally, use of this - extended API removes all retry logic from classpnp for these requests. Thus, - the provided routine must return FALSE when it determines the number of times - the request should be retried has been exceeded. - -Irql: - - This routine will be called at KIRQL <= DISPATCH_LEVEL - -NOTE: - - Although it is not illegal to have both a PCLASS_INTERPRET_SENSE_INFO() and - a PCLASS_ERROR() routine, the PCLASS_ERROR() function will only be called - if the class driver (as part of its PCLASS_INTERPRET_SENSE_INFO() routine) - calls into the legacy ClassInterpretSenseInfo(). - -Arguments: - - -Return Value: - - TRUE if the request should be retried - FALSE if the request should be failed - ---*/ - -// NOTE: Start with a smaller 100 second maximum, due to current assert in CLASSPNP -// 0x0000 00C9'2A69 C000 (864,000,000,000) is 24 hours in 100ns units -// 0x0000 0000'3B9A CA00 ( 1,000,000,000) is 100 seconds in 100ns units -#define MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS (0x3B9ACA00) - -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -BOOLEAN -(*PCLASS_INTERPRET_SENSE_INFO) ( - __in PDEVICE_OBJECT Fdo, - __in_opt PIRP OriginalRequest, // not always the same as in SRB - __in PSCSI_REQUEST_BLOCK Srb, - __in UCHAR MajorFunctionCode, - __in ULONG IoDeviceCode, - __in ULONG PreviousRetryCount, - // const except for bits explicitly set aside for class driver to update - __in_opt SRB_HISTORY * RequestHistory, - __out NTSTATUS * Status, - __out __range(0,MAXIMUM_RETRY_FOR_SINGLE_IO_IN_100NS_UNITS) - LONGLONG * RetryIn100nsUnits - ); - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_COMPRESS_HISTORY_DATA() - -Routine Description: - - This routine is a callback into the driver to perform "compression" of the - history data that is saved during retry of SRBs. The function will only be - called when the history array is full (UsedHistoryCount == TotalHistoryCount). - This function must reduce the overall UsedHistoryCount by at least one - element (and update the UsedHistoryCount field appropriately). - . that may have occurred during an SRB transfer. It closely matches the - API set of ClassInterpretSenseInfo, with modifications to allow for a history - of why the request was previously retried (and when), and changes the retry - interval from being in seconds to being in milliseconds. Finally, use of this - extended API removes all retry logic from classpnp for these requests. Thus, - the provided routine must return FALSE when it determines the number of times - the request should be retried has been exceeded. - -Irql: - - This routine will be called at KIRQL <= DISPATCH_LEVEL - -NOTE: - - Although it is not illegal to have both a PCLASS_INTERPRET_SENSE_INFO() and - a PCLASS_ERROR() routine, the PCLASS_ERROR() function will only be called - if the class driver (as part of its PCLASS_INTERPRET_SENSE_INFO() routine) - calls into the legacy ClassInterpretSenseInfo(). - -Arguments: - - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -VOID -(*PCLASS_COMPRESS_RETRY_HISTORY_DATA) ( - __in PDEVICE_OBJECT DeviceObject, - __inout PSRB_HISTORY RequestHistory - ); - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct { - GUID Guid; // Guid to registered - ULONG InstanceCount; // Count of Instances of Datablock - ULONG Flags; // Additional flags (see WMIREGINFO in wmistr.h) -} GUIDREGINFO, *PGUIDREGINFO; - - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _CLASS_WMI_INFO { - ULONG GuidCount; - PGUIDREGINFO GuidRegInfo; - - PCLASS_QUERY_WMI_REGINFO ClassQueryWmiRegInfo; - PCLASS_QUERY_WMI_DATABLOCK ClassQueryWmiDataBlock; - PCLASS_SET_WMI_DATABLOCK ClassSetWmiDataBlock; - PCLASS_SET_WMI_DATAITEM ClassSetWmiDataItem; - PCLASS_EXECUTE_WMI_METHOD ClassExecuteWmiMethod; - PCLASS_WMI_FUNCTION_CONTROL ClassWmiFunctionControl; -} CLASS_WMI_INFO, *PCLASS_WMI_INFO; - - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _CLASS_DEV_INFO { - - // - // Bytes needed by the class driver - // for it's extension. - // If this is zero, the driver does not expect to have any PDO's - // - - ULONG DeviceExtensionSize; - - DEVICE_TYPE DeviceType; - - UCHAR StackSize; - - // - // Device Characteristics flags - // eg.: - // - // FILE_REMOVABLE_MEDIA - // FILE_READ_ONLY_DEVICE - // FILE_FLOPPY_DISKETTE - // FILE_WRITE_ONCE_MEDIA - // FILE_REMOTE_DEVICE - // FILE_DEVICE_IS_MOUNTED - // FILE_VIRTUAL_VOLUME - // - - ULONG DeviceCharacteristics; - - PCLASS_ERROR ClassError; - PCLASS_READ_WRITE ClassReadWriteVerification; - PCLASS_DEVICE_CONTROL ClassDeviceControl; - PCLASS_SHUTDOWN_FLUSH ClassShutdownFlush; - PCLASS_CREATE_CLOSE ClassCreateClose; - - PCLASS_INIT_DEVICE ClassInitDevice; - PCLASS_START_DEVICE ClassStartDevice; - PCLASS_POWER_DEVICE ClassPowerDevice; - PCLASS_STOP_DEVICE ClassStopDevice; - PCLASS_REMOVE_DEVICE ClassRemoveDevice; - - PCLASS_QUERY_PNP_CAPABILITIES ClassQueryPnpCapabilities; - - // - // Registered Data Block info for wmi - // - CLASS_WMI_INFO ClassWmiInfo; - -} CLASS_DEV_INFO, *PCLASS_DEV_INFO; - -// -// Restricted - May only append to this structure for backwards compatibility -// -struct _CLASS_INIT_DATA { - - // - // This structure size - version checking. - // - - ULONG InitializationDataSize; - - // - // Specific init data for functional and physical device objects. - // - - CLASS_DEV_INFO FdoData; - CLASS_DEV_INFO PdoData; - - // - // Device-specific driver routines - // - - PCLASS_ADD_DEVICE ClassAddDevice; - PCLASS_ENUM_DEVICE ClassEnumerateDevice; - - PCLASS_QUERY_ID ClassQueryId; - - PDRIVER_STARTIO ClassStartIo; - PCLASS_UNLOAD ClassUnload; - - PCLASS_TICK ClassTick; -}; - -// -// this is a private structure, but must be kept here -// to properly compile size of FUNCTIONAL_DEVICE_EXTENSION -// -typedef struct _FILE_OBJECT_EXTENSION { - PFILE_OBJECT FileObject; - PDEVICE_OBJECT DeviceObject; - ULONG LockCount; - ULONG McnDisableCount; -} FILE_OBJECT_EXTENSION, *PFILE_OBJECT_EXTENSION; - -typedef struct _CLASS_WORKING_SET -{ - __field_range(sizeof(CLASS_WORKING_SET),sizeof(CLASS_WORKING_SET)) - ULONG Size; // Must be sizeof(CLASS_WORKING_SET) - - __field_range(0,2048) // NOTE: This range can be made larger more easily than it can be reduced - ULONG XferPacketsWorkingSetMaximum; - __field_range(0,2048) - ULONG XferPacketsWorkingSetMinimum; -} CLASS_WORKING_SET, *PCLASS_WORKING_SET; -#define CLASS_WORKING_SET_MAXIMUM 2048 - -typedef struct _CLASS_INTERPRET_SENSE_INFO2 -{ - __field_range(sizeof(CLASS_INTERPRET_SENSE_INFO),sizeof(CLASS_INTERPRET_SENSE_INFO)) - ULONG Size; // Must be sizeof(CLASS_INTERPRET_SENSE_INFO) - - __field_range(1,30000) - ULONG HistoryCount; // The number of SRB_HISTORY units that will be used - - __callback PCLASS_COMPRESS_RETRY_HISTORY_DATA Compress; - __callback PCLASS_INTERPRET_SENSE_INFO Interpret; - -} CLASS_INTERPRET_SENSE_INFO2, *PCLASS_INTERPRET_SENSE_INFO2; -// A compile-time check of the 30,000 limit not overflowing ULONG size... -// Note that it is not expected that a release (FRE) driver will normally -// have such a large history, instead using the compression function. -#define CLASS_INTERPRET_SENSE_INFO2_MAXIMUM_HISTORY_COUNT 30000 -C_ASSERT( (MAXULONG - sizeof(SRB_HISTORY)) / 30000 >= sizeof(SRB_HISTORY_ITEM) ); - - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _CLASS_DRIVER_EXTENSION { - - UNICODE_STRING RegistryPath; - - CLASS_INIT_DATA InitData; - - ULONG DeviceCount; - -#if (NTDDI_VERSION >= NTDDI_WINXP) - PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx; - PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx; -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - REGHANDLE EtwHandle; - - PDRIVER_DISPATCH DeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1]; - PDRIVER_DISPATCH MpDeviceMajorFunctionTable[IRP_MJ_MAXIMUM_FUNCTION + 1]; - - // - // Support for cdrom class drivers to extend - // the interpret sense information routine - // and retry history per-packet. Need to - // setup during DriverEntry, so must be placed here. - // - PCLASS_INTERPRET_SENSE_INFO2 InterpretSenseInfo; - - // - // Support for overriding the min/max number - // of packets to keep allocated. Need to - // setup during DriverEntry, so must be placed here. - // - PCLASS_WORKING_SET WorkingSet; - -#endif - -} CLASS_DRIVER_EXTENSION, *PCLASS_DRIVER_EXTENSION; - -typedef struct _COMMON_DEVICE_EXTENSION COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; -typedef struct _FUNCTIONAL_DEVICE_EXTENSION FUNCTIONAL_DEVICE_EXTENSION, *PFUNCTIONAL_DEVICE_EXTENSION; -typedef struct _PHYSICAL_DEVICE_EXTENSION PHYSICAL_DEVICE_EXTENSION, *PPHYSICAL_DEVICE_EXTENSION; - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _COMMON_DEVICE_EXTENSION { - - // - // Version control field - // - // Note - this MUST be the first thing in the device extension - // for any class driver using classpnp or a later version. - // - - ULONG Version; - - // - // Back pointer to device object - // - // NOTE - this MUST be the second field in the common device extension. - // Users of this structure will include it in a union with the DeviceObject - // pointer so they can reference this with a bit of syntactic sugar. - // - - PDEVICE_OBJECT DeviceObject; - - // - // Pointer to lower device object - send all requests through this - // - - PDEVICE_OBJECT LowerDeviceObject; - - // - // Pointer to the partition zero device extension. - // There are several flags stored there that pdo - // routines need to access - // - - PFUNCTIONAL_DEVICE_EXTENSION PartitionZeroExtension; - - // - // Pointer to the initialization data for this driver. This is more - // efficient than constantly getting the driver extension. - // - - PCLASS_DRIVER_EXTENSION DriverExtension; - - // - // INTERLOCKED counter of the number of requests/function calls outstanding - // which will need to use this device object. When this count goes to - // zero the RemoveEvent will be set. - // - // This variable is only manipulated by ClassIncrementRemoveLock and - // ClassDecrementRemoveLock. - // - - LONG RemoveLock; - - // - // This event will be signalled when it is safe to remove the device object - // - - KEVENT RemoveEvent; - - // - // The spinlock and the list are only used in checked builds to track - // who has acquired the remove lock. Free systems will leave these - // initialized to ff - // - - KSPIN_LOCK RemoveTrackingSpinlock; - - PVOID RemoveTrackingList; - - LONG RemoveTrackingUntrackedCount; - - // - // Pointer to the driver specific data area - // - - PVOID DriverData; - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4214) // bit field types other than int -#pragma warning(disable:4201) // nameless struct/union - - // - // Flag indicates whether this device object is - // an FDO or a PDO - // - - struct { - BOOLEAN IsFdo : 1; - BOOLEAN IsInitialized : 1; - - // - // Flag indicating whether the lookaside listhead for srbs has been - // initialized. - // - - BOOLEAN IsSrbLookasideListInitialized : 1; - }; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - - // - // Contains the IRP_MN_CODE of the last state-changing pnp irps we - // recieved (XXX_STOP, XXX_REMOVE, START, etc...). Used in concert - // with IsRemoved. - // - - UCHAR PreviousState; - UCHAR CurrentState; - - // - // interlocked flag indicating that the device has been removed. - // - - ULONG IsRemoved; - - // - // The name of the object - // - UNICODE_STRING DeviceName; - - // - // The next child device (or if this is an FDO, the first child device). - // - - PPHYSICAL_DEVICE_EXTENSION ChildList; - - // - // Number of the partition or -1L if not partitionable. - // - - ULONG PartitionNumber; - - // - // Length of partition in bytes - // - - LARGE_INTEGER PartitionLength; - - // - // Number of bytes before start of partition - // - - LARGE_INTEGER StartingOffset; - - // - // Dev-Info structure for this type of device object - // Contains call-out routines for the class driver. - // - - PCLASS_DEV_INFO DevInfo; - - // - // Count of page files going through this device object - // and event to synchronize them with. - // - - ULONG PagingPathCount; - ULONG DumpPathCount; - ULONG HibernationPathCount; - KEVENT PathCountEvent; - -#ifndef ALLOCATE_SRB_FROM_POOL - // - // Lookaside listhead for srbs. - // - - NPAGED_LOOKASIDE_LIST SrbLookasideList; -#endif - - // - // Interface name string returned by IoRegisterDeviceInterface. - // - - UNICODE_STRING MountedDeviceInterfaceName; - - - // - // Registered Data Block info for wmi - // - ULONG GuidCount; - PGUIDREGINFO GuidRegInfo; - - // - // File object dictionary for this device object. Extensions are stored - // in here rather than off the actual file object. - // - - DICTIONARY FileObjectDictionary; - - // - // The following will be in the released product as reserved. - // Leave these at the end of the structure. - // - -#if (NTDDI_VERSION >= NTDDI_WINXP) - PCLASS_PRIVATE_COMMON_DATA PrivateCommonData; -#else - ULONG_PTR Reserved1; -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - // - // Pointer to the dispatch table for this object - // - - PDRIVER_DISPATCH *DispatchTable; -#else - ULONG_PTR Reserved2; -#endif - - ULONG_PTR Reserved3; - ULONG_PTR Reserved4; - -} COMMON_DEVICE_EXTENSION, *PCOMMON_DEVICE_EXTENSION; - -typedef enum { - FailurePredictionNone = 0, // No failure detection polling needed - FailurePredictionIoctl, // Do failure detection via IOCTL - FailurePredictionSmart, // Do failure detection via SMART - FailurePredictionSense // Do failure detection via sense data -} FAILURE_PREDICTION_METHOD, *PFAILURE_PREDICTION_METHOD; - -// -// Default failure prediction polling interval is every hour -// - -#define DEFAULT_FAILURE_PREDICTION_PERIOD 60 * 60 * 1 - -// -// The failure prediction structure is internal to classpnp - drivers do not -// need to know what it contains. -// - -struct _FAILURE_PREDICTION_INFO; -typedef struct _FAILURE_PREDICTION_INFO *PFAILURE_PREDICTION_INFO; - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4214) // bit field types other than int - -// -// this is to allow for common code to handle -// every option. -// - -typedef struct _CLASS_POWER_OPTIONS { - ULONG PowerDown : 1; - ULONG LockQueue : 1; - ULONG HandleSpinDown : 1; - ULONG HandleSpinUp : 1; - ULONG Reserved : 27; -} CLASS_POWER_OPTIONS, *PCLASS_POWER_OPTIONS; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -// -// this is a private structure, but must be kept here -// to properly compile size of FUNCTIONAL_DEVICE_EXTENSION -// -typedef enum { - PowerDownDeviceInitial, - PowerDownDeviceLocked, - PowerDownDeviceStopped, - PowerDownDeviceOff, - PowerDownDeviceUnlocked -} CLASS_POWER_DOWN_STATE; - -// -// same as above, but with an extra state for whistler -// should be ok to change the above structure, but that -// would break someone somewhere who ignore the PRIVATE -// nature of the structure. -// - -typedef enum { - PowerDownDeviceInitial2, - PowerDownDeviceLocked2, - PowerDownDeviceFlushed2, - PowerDownDeviceStopped2, - PowerDownDeviceOff2, - PowerDownDeviceUnlocked2 -} CLASS_POWER_DOWN_STATE2; - -// -// this is a private enum, but must be kept here -// to properly compile size of FUNCTIONAL_DEVICE_EXTENSION -// -typedef enum { - PowerUpDeviceInitial, - PowerUpDeviceLocked, - PowerUpDeviceOn, - PowerUpDeviceStarted, - PowerUpDeviceUnlocked -} CLASS_POWER_UP_STATE; - -// -// this is a private structure, but must be kept here -// to properly compile size of FUNCTIONAL_DEVICE_EXTENSION -// -typedef struct _CLASS_POWER_CONTEXT { - - union { - CLASS_POWER_DOWN_STATE PowerDown; - CLASS_POWER_DOWN_STATE2 PowerDown2; // whistler - CLASS_POWER_UP_STATE PowerUp; - } PowerChangeState; - - CLASS_POWER_OPTIONS Options; - - BOOLEAN InUse; - BOOLEAN QueueLocked; - - NTSTATUS FinalStatus; - - ULONG RetryCount; - ULONG RetryInterval; - - PIO_COMPLETION_ROUTINE CompletionRoutine; - PDEVICE_OBJECT DeviceObject; - PIRP Irp; - - SCSI_REQUEST_BLOCK Srb; - -} CLASS_POWER_CONTEXT, *PCLASS_POWER_CONTEXT; - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _FUNCTIONAL_DEVICE_EXTENSION { - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - - // - // Common device extension header - // - - union { - struct { - ULONG Version; - PDEVICE_OBJECT DeviceObject; - }; - COMMON_DEVICE_EXTENSION CommonExtension; - }; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - - // - // Pointer to the physical device object we attached to - use this - // for Pnp calls which need a PDO - // - - PDEVICE_OBJECT LowerPdo; - - // - // Device capabilities - // - - PSTORAGE_DEVICE_DESCRIPTOR DeviceDescriptor; - - // - // SCSI port driver capabilities - // - - PSTORAGE_ADAPTER_DESCRIPTOR AdapterDescriptor; - - // - // Current Power state of the device - // - - DEVICE_POWER_STATE DevicePowerState; - - // - // DM Driver for IDE drives hack (ie. OnTrack) - // Bytes to skew all requests - // - - ULONG DMByteSkew; - - // - // DM Driver for IDE drives hack (ie. OnTrack) - // Sectors to skew all requests. - // - - ULONG DMSkew; - - // - // DM Driver for IDE drives hack (ie. OnTrack) - // Flag to indicate whether DM driver has been located on an IDE drive. - // - - BOOLEAN DMActive; - - // - // Buffer for drive parameters returned in IO device control. - // - - DISK_GEOMETRY DiskGeometry; - - // - // Request Sense Buffer - // - - PSENSE_DATA SenseData; - - // - // Request timeout in seconds; - // - - ULONG TimeOutValue; - - // - // System device number - // - - ULONG DeviceNumber; - - // - // Add default Srb Flags. - // - - ULONG SrbFlags; - - // - // Total number of SCSI protocol errors on the device. - // - - ULONG ErrorCount; - - // - // Lock count for removable media. - // - - LONG LockCount; - LONG ProtectedLockCount; - LONG InternalLockCount; - - KEVENT EjectSynchronizationEvent; - - // - // Values for the flags are below. - // - - USHORT DeviceFlags; - - // - // Log2 of sector size - // - - UCHAR SectorShift; - - // - // Flags to optimize CDB handling. - // - -#if (NTDDI_VERSION >= NTDDI_VISTA) - UCHAR CdbForceUnitAccess; -#else - UCHAR ReservedByte; -#endif - - // - // Indicates that the necessary data structures for media change - // detection have been initialized. - // - - PMEDIA_CHANGE_DETECTION_INFO MediaChangeDetectionInfo; - - PKEVENT Unused1; - HANDLE Unused2; - - // - // File system context. Used for kernel-mode requests to disable autorun. - // - - FILE_OBJECT_EXTENSION KernelModeMcnContext; - - // - // Count of media changes. This field is only valid for the root partition - // (ie. if PhysicalDevice == NULL). - // - - ULONG MediaChangeCount; - - // - // Storage for a handle to the directory the PDO's are placed in - // - - HANDLE DeviceDirectory; - - // - // Storage for a release queue request. - // - - KSPIN_LOCK ReleaseQueueSpinLock; - - PIRP ReleaseQueueIrp; - - SCSI_REQUEST_BLOCK ReleaseQueueSrb; - - BOOLEAN ReleaseQueueNeeded; - - BOOLEAN ReleaseQueueInProgress; - - BOOLEAN ReleaseQueueIrpFromPool; - // - // Failure detection storage - // - - BOOLEAN FailurePredicted; - - ULONG FailureReason; - PFAILURE_PREDICTION_INFO FailurePredictionInfo; - - BOOLEAN PowerDownInProgress; - - // - // Interlock for ensuring we don't recurse during enumeration. - // - - ULONG EnumerationInterlock; - - // - // Synchronization object for manipulating the child list. - // - - KEVENT ChildLock; - - // - // The thread which currently owns the ChildLock. This is used to - // avoid recursive acquisition. - // - - PKTHREAD ChildLockOwner; - - // - // The number of times this event has been acquired. - // - - ULONG ChildLockAcquisitionCount; - - // - // Flags for special behaviour required by - // different hardware, such as never spinning down - // or disabling advanced features such as write cache - // - - ULONG ScanForSpecialFlags; - - // - // For delayed retry of power requests at DPC level - // - - KDPC PowerRetryDpc; - KTIMER PowerRetryTimer; - - // - // Context structure for power operations. Since we can only have - // one D irp at any time in the stack we don't need to worry about - // allocating multiple of these structures. - // - - CLASS_POWER_CONTEXT PowerContext; - -#if (NTDDI_VERSION <= NTDDI_WIN2K) - -#if (SPVER(NTDDI_VERSION) < 2)) - - ULONG_PTR Reserved1; - ULONG_PTR Reserved2; - ULONG_PTR Reserved3; - ULONG_PTR Reserved4; - -#else - - // - // Indicates the number of successfully completed - // requests, if error throttling has been applied. - // - ULONG CompletionSuccessCount; - - // - // When too many errors occur and features are turned off - // the old SrbFlags are saved here, so that if the condition - // is fixed, we can restore them to their proper state. - // - ULONG SavedSrbFlags; - - // - // Once recovery has been initiated, cache the old error count value. - // If new errors occur, go back to the feature set as was earlier used. - // - ULONG SavedErrorCount; - - // - // For future expandability - // leave these at the end of the structure. - // - - ULONG_PTR Reserved1; -#endif - -#else - - // - // Hold new private data that only classpnp should modify - // in this structure. - // - - PCLASS_PRIVATE_FDO_DATA PrivateFdoData; - - // - // For future expandability - // leave these at the end of the structure. - // - - ULONG_PTR Reserved2; - ULONG_PTR Reserved3; - ULONG_PTR Reserved4; -#endif - -} FUNCTIONAL_DEVICE_EXTENSION, *PFUNCTIONAL_DEVICE_EXTENSION; - -// -// The following CLASS_SPECIAL_ flags are set in ScanForSpecialFlags -// in the FdoExtension -// - -// Never Spin Up/Down the drive (may not handle properly) -#define CLASS_SPECIAL_DISABLE_SPIN_DOWN 0x00000001 -#define CLASS_SPECIAL_DISABLE_SPIN_UP 0x00000002 - -// Don't bother to lock the queue when powering down -// (used mostly to send a quick stop to a cdrom to abort audio playback) -#define CLASS_SPECIAL_NO_QUEUE_LOCK 0x00000008 - -// Disable write cache due to known bugs -#define CLASS_SPECIAL_DISABLE_WRITE_CACHE 0x00000010 - -// -// Special interpretation of "device not ready / cause not reportable" for -// devices which don't tell us they need to be spun up manually after they -// spin themselves down behind our back. -// -// The down side of this is that if the drive chooses to report -// "device not ready / cause not reportable" to mean "no media in device" -// or any other error which really does require user intervention NT will -// waste a large amount of time trying to spin up a disk which can't be spun -// up. -// - -#define CLASS_SPECIAL_CAUSE_NOT_REPORTABLE_HACK 0x00000020 - -#if ((NTDDI_VERSION == NTDDI_WIN2KSP3) || (OSVER(NTDDI_VERSION) == NTDDI_WINXP)) -// Disabling the write cache is not supported on this device -#define CLASS_SPECIAL_DISABLE_WRITE_CACHE_NOT_SUPPORTED 0x00000040 // Obsolete -#endif -#define CLASS_SPECIAL_MODIFY_CACHE_UNSUCCESSFUL 0x00000040 -#define CLASS_SPECIAL_FUA_NOT_SUPPORTED 0x00000080 - -#define CLASS_SPECIAL_VALID_MASK 0x000000FB -#define CLASS_SPECIAL_RESERVED (~CLASS_SPECIAL_VALID_MASK) - - -// -// Restricted - May only append to this structure for backwards compatibility -// -typedef struct _PHYSICAL_DEVICE_EXTENSION { - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - - // - // Common extension data - // - - union { - struct { - ULONG Version; - PDEVICE_OBJECT DeviceObject; - }; - COMMON_DEVICE_EXTENSION CommonExtension; - }; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - - // - // Indicates that the pdo no longer physically exits. - // - - BOOLEAN IsMissing; - - // - // Indicates that the PDO has been handed out to the PNP system. - // - - BOOLEAN IsEnumerated; - - // - // Hold new private data that only classpnp should modify - // in this structure. - // - -#if (NTDDI_VERSION >= NTDDI_WINXP) - PCLASS_PRIVATE_PDO_DATA PrivatePdoData; -#else - ULONG_PTR Reserved1; -#endif - - // - // for future expandability - // leave these at the end of the structure. - // - - ULONG_PTR Reserved2; - ULONG_PTR Reserved3; - ULONG_PTR Reserved4; - -} PHYSICAL_DEVICE_EXTENSION, *PPHYSICAL_DEVICE_EXTENSION; - -// -// Indicates that the device has write caching enabled. -// - -#define DEV_WRITE_CACHE 0x00000001 - -// -// Build SCSI 1 or SCSI 2 CDBs -// - -#define DEV_USE_SCSI1 0x00000002 - -// -// Indicates whether is is safe to send StartUnit commands -// to this device. It will only be off for some removeable devices. -// - -#define DEV_SAFE_START_UNIT 0x00000004 - -// -// Indicates whether it is unsafe to send SCSIOP_MECHANISM_STATUS commands to -// this device. Some devices don't like these 12 byte commands -// - -#define DEV_NO_12BYTE_CDB 0x00000008 - -// -// Indicates that the device is connected to a backup power supply -// and hence write-through and synch cache requests may be ignored -// - -#define DEV_POWER_PROTECTED 0x00000010 - -// -// Indicates that the device supports 16 byte CDBs -// - -#define DEV_USE_16BYTE_CDB 0x00000020 - - -// -// Define context structure for asynchronous completions. -// - -typedef struct _COMPLETION_CONTEXT { - PDEVICE_OBJECT DeviceObject; - SCSI_REQUEST_BLOCK Srb; -}COMPLETION_CONTEXT, *PCOMPLETION_CONTEXT; - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -SCSIPORT_API -ULONG -ClassInitialize( - __in PVOID Argument1, - __in PVOID Argument2, - __in PCLASS_INIT_DATA InitializationData - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ - -// -// List of the GUIDs supported by ClassInitializeEx() and the structure -// type used for the data parameter for that GUID. -// -// {00E34B11-2444-4745-A53D-620100CD82F7} == CLASS_QUERY_WMI_REGINFO_EX_LIST -// {509a8c5f-71d7-48f6-821e-173c49bf2f18} == CLASS_INTERPRET_SENSE_INFO2 - -#define GUID_CLASSPNP_QUERY_REGINFOEX { 0x00e34b11, 0x2444, 0x4745, { 0xa5, 0x3d, 0x62, 0x01, 0x00, 0xcd, 0x82, 0xf7 } } -#define GUID_CLASSPNP_SENSEINFO2 { 0x509a8c5f, 0x71d7, 0x48f6, { 0x82, 0x1e, 0x17, 0x3c, 0x49, 0xbf, 0x2f, 0x18 } } -#define GUID_CLASSPNP_WORKING_SET { 0x105701b0, 0x9e9b, 0x47cb, { 0x97, 0x80, 0x81, 0x19, 0x8a, 0xf7, 0xb5, 0x24 } } - -// -// The structure specifies callbacks that are used instead of the -// PCLASS_QUERY_WMI_REGINFO callbacks. -// -typedef struct _CLASS_QUERY_WMI_REGINFO_EX_LIST -{ - ULONG Size; // Should be sizeof(CLASS_QUERY_REGINFO_EX_LIST) - - __callback PCLASS_QUERY_WMI_REGINFO_EX ClassFdoQueryWmiRegInfoEx; - __callback PCLASS_QUERY_WMI_REGINFO_EX ClassPdoQueryWmiRegInfoEx; - -} CLASS_QUERY_WMI_REGINFO_EX_LIST, *PCLASS_QUERY_WMI_REGINFO_EX_LIST; - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -SCSIPORT_API -ULONG -ClassInitializeEx( - __in PDRIVER_OBJECT DriverObject, - __in LPGUID Guid, - __in PVOID Data - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -__drv_valueIs(<0;==0) -SCSIPORT_API -NTSTATUS -ClassCreateDeviceObject( - __in PDRIVER_OBJECT DriverObject, - __in_z PCCHAR ObjectNameBuffer, - __in PDEVICE_OBJECT LowerDeviceObject, - __in BOOLEAN IsFdo, - __out - __drv_out_deref( - __drv_allocatesMem(Mem) - __drv_aliasesMem - __on_failure(__null)) - PDEVICE_OBJECT *DeviceObject - ); - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__checkReturn -SCSIPORT_API -NTSTATUS -ClassReadDriveCapacity( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassReleaseQueue( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassSplitRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in ULONG MaximumBytes - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassDeviceControl( - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -IO_COMPLETION_ROUTINE ClassIoComplete; - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -IO_COMPLETION_ROUTINE ClassIoCompleteAssociated; - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -BOOLEAN -ClassInterpretSenseInfo( - __in PDEVICE_OBJECT DeviceObject, - __in PSCSI_REQUEST_BLOCK Srb, - __in UCHAR MajorFunctionCode, - __in ULONG IoDeviceCode, - __in ULONG RetryCount, - __out NTSTATUS *Status, - __out_opt __range(0,100) ULONG *RetryInterval - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -VOID -ClassSendDeviceIoControlSynchronous( - __in ULONG IoControlCode, - __in PDEVICE_OBJECT TargetDeviceObject, - __inout_xcount_opt(max(InputBufferLength, OutputBufferLength)) PVOID Buffer, - __in ULONG InputBufferLength, - __in ULONG OutputBufferLength, - __in BOOLEAN InternalDeviceIoControl, - __out PIO_STATUS_BLOCK IoStatus - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassSendIrpSynchronous( - __in PDEVICE_OBJECT TargetDeviceObject, - __in PIRP Irp - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassForwardIrpSynchronous( - __in PCOMMON_DEVICE_EXTENSION CommonExtension, - __in PIRP Irp - ); - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassSendSrbSynchronous( - __in PDEVICE_OBJECT DeviceObject, - __inout PSCSI_REQUEST_BLOCK Srb, - __in_bcount_opt(BufferLength) PVOID BufferAddress, - __in ULONG BufferLength, - __in BOOLEAN WriteToDevice - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassSendSrbAsynchronous( - __in PDEVICE_OBJECT DeviceObject, - __inout PSCSI_REQUEST_BLOCK Srb, - __in PIRP Irp, - __in_bcount_opt(BufferLength) __drv_aliasesMem PVOID BufferAddress, - __in ULONG BufferLength, - __in BOOLEAN WriteToDevice - ); - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassBuildRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -ULONG -ClassModeSense( - __in PDEVICE_OBJECT DeviceObject, - __in_bcount(Length) PCHAR ModeSenseBuffer, - __in ULONG Length, - __in UCHAR PageMode - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -PVOID -ClassFindModePage( - __in_bcount(Length) PCHAR ModeSenseBuffer, - __in ULONG Length, - __in UCHAR PageMode, - __in BOOLEAN Use6Byte - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -NTSTATUS -ClassClaimDevice( - __in PDEVICE_OBJECT LowerDeviceObject, - __in BOOLEAN Release - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -__drv_dispatchType(IRP_MJ_SCSI) -DRIVER_DISPATCH ClassInternalIoControl; - -/*++ - -Internal function - described in classpnp\utils.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassInitializeSrbLookasideList( - __inout PCOMMON_DEVICE_EXTENSION CommonExtension, - __in ULONG NumberElements - ); - -/*++ - -Internal function - described in classpnp\utils.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassDeleteSrbLookasideList( - __inout PCOMMON_DEVICE_EXTENSION CommonExtension - ); - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -ULONG -ClassQueryTimeOutRegistryValue( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -NTSTATUS -ClassGetDescriptor( - __in PDEVICE_OBJECT DeviceObject, - __in PSTORAGE_PROPERTY_ID PropertyId, - __deref_out PVOID *Descriptor - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassInvalidateBusRelations( - __in PDEVICE_OBJECT Fdo - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassMarkChildrenMissing( - __in PFUNCTIONAL_DEVICE_EXTENSION Fdo - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -BOOLEAN -ClassMarkChildMissing( - __in PPHYSICAL_DEVICE_EXTENSION PdoExtension, - __in BOOLEAN AcquireChildLock - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassDebugPrint( - __in CLASS_DEBUG_LEVEL DebugPrintLevel, - __in_z PCCHAR DebugMessage, - ... - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_aliasesMem -__drv_maxIRQL(DISPATCH_LEVEL) -SCSIPORT_API -PCLASS_DRIVER_EXTENSION -ClassGetDriverExtension( - __in PDRIVER_OBJECT DriverObject - ); - - -/*++ - -Internal function - described in classpnp\lock.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassCompleteRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in CCHAR PriorityBoost - ); - - -/*++ - -Internal function - described in classpnp\lock.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassReleaseRemoveLock( - __in PDEVICE_OBJECT DeviceObject, - PIRP Tag - ); - - -/*++ - -Internal function - described in classpnp\lock.c in ddk sources - ---*/ -SCSIPORT_API -ULONG -ClassAcquireRemoveLockEx( - __in PDEVICE_OBJECT DeviceObject, - PVOID Tag, - __in PCSTR File, - __in ULONG Line - ); - - - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassUpdateInformationInRegistry( - __in PDEVICE_OBJECT Fdo, - __in PCHAR DeviceName, - __in ULONG DeviceNumber, - __in_bcount_opt(InquiryDataLength) PINQUIRYDATA InquiryData, - __in ULONG InquiryDataLength - ); - - -/*++ - -Internal function - described in classpnp\classwmi.c in ddk sources - ---*/ -SCSIPORT_API -NTSTATUS -ClassWmiCompleteRequest( - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in NTSTATUS Status, - __in ULONG BufferUsed, - __in CCHAR PriorityBoost - ); - - -/*++ - -Internal function - described in classpnp\classwmi.c in ddk sources - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -SCSIPORT_API -NTSTATUS -ClassWmiFireEvent( - __in PDEVICE_OBJECT DeviceObject, - __in LPGUID Guid, - __in ULONG InstanceIndex, - __in ULONG EventDataSize, - __in_bcount(EventDataSize) PVOID EventData - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassResetMediaChangeTimer( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassInitializeMediaChangeDetection( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in PUCHAR EventPrefix - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -NTSTATUS -ClassInitializeTestUnitPolling( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in BOOLEAN AllowDriveToSleep - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -PVPB -ClassGetVpb( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++ - -Internal function - described in classpnp\power.c in ddk sources - ---*/ -__control_entrypoint(DeviceDriver) -SCSIPORT_API -NTSTATUS -ClassSpinDownPowerHandler( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++ - -Internal function - described in classpnp\power.c in ddk sources - ---*/ -NTSTATUS -ClassStopUnitPowerHandler( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ClassSetFailurePredictionPoll( - __inout PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in FAILURE_PREDICTION_METHOD FailurePredictionMethod, - __in ULONG PollingPeriod - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -ClassNotifyFailurePredicted( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in_bcount(BufferSize) PUCHAR Buffer, - __in ULONG BufferSize, - __in BOOLEAN LogError, - __in ULONG UniqueErrorValue, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassAcquireChildLock( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassReleaseChildLock( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -IO_COMPLETION_ROUTINE ClassSignalCompletion; - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -VOID -ClassSendStartUnit( - __in PDEVICE_OBJECT DeviceObject - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -NTSTATUS -ClassRemoveDevice( - __in PDEVICE_OBJECT DeviceObject, - __in UCHAR RemoveType - ); - - -/*++ - -Internal function - described in classpnp\class.c in ddk sources - ---*/ -SCSIPORT_API -IO_COMPLETION_ROUTINE ClassAsynchronousCompletion; - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -SCSIPORT_API -VOID -ClassCheckMediaState( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassSetMediaChangeState( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in MEDIA_CHANGE_DETECTION_STATE State, - __in BOOLEAN Wait - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassEnableMediaChangeDetection( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassDisableMediaChangeDetection( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -VOID -ClassCleanupMediaChangeDetection( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension - ); - - -/*++ - -Internal function - described in classpnp\utils.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -ClassGetDeviceParameter( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in_opt PWSTR SubkeyName, - __in PWSTR ParameterName, - __inout PULONG ParameterValue - ); - - -/*++ - -Internal function - described in classpnp\utils.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ClassSetDeviceParameter( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in_opt PWSTR SubkeyName, - __in PWSTR ParameterName, - __in ULONG ParameterValue - ); - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -/*++ - -Internal function - described in classpnp\create.c in ddk sources - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -PFILE_OBJECT_EXTENSION -ClassGetFsContext( - __in PCOMMON_DEVICE_EXTENSION CommonExtension, - __in PFILE_OBJECT FileObject - ); - -/*++ - -Internal function - described in classpnp\autorun.c in ddk sources - ---*/ -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -ClassSendNotification( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in const GUID * Guid, - __in ULONG ExtraDataSize, - __in_bcount_opt(ExtraDataSize) PVOID ExtraData - ); - -#endif - -// -// could be #define, but this allows typechecking -// - -__inline -BOOLEAN -PORT_ALLOCATED_SENSE( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in PSCSI_REQUEST_BLOCK Srb - ) -{ - return ((BOOLEAN)((TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE) && - TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)) && - (Srb->SenseInfoBuffer != FdoExtension->SenseData)) - ); -} - -__inline -VOID -FREE_PORT_ALLOCATED_SENSE_BUFFER( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in PSCSI_REQUEST_BLOCK Srb - ) -{ - ASSERT(TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_PORT_DRIVER_ALLOCSENSE)); - ASSERT(TEST_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER)); - ASSERT(Srb->SenseInfoBuffer != FdoExtension->SenseData); - - ExFreePool(Srb->SenseInfoBuffer); - Srb->SenseInfoBuffer = FdoExtension->SenseData; - Srb->SenseInfoBufferLength = SENSE_BUFFER_SIZE; // should be variable? - CLEAR_FLAG(Srb->SrbFlags, SRB_FLAGS_FREE_SENSE_BUFFER); - return; -} - - - -/*++//////////////////////////////////////////////////////////////////////////// - -PCLASS_SCAN_FOR_SPECIAL_HANDLER() - -Routine Description: - - This routine is a callback into the driver to set device-specific - flags based upon matches made to the device's inquiry data. Drivers - register for this callback using ClassRegisterScanForSpecial(). - -Irql: - - This routine will be called at KIRQL == PASSIVE_LEVEL - -Arguments: - - DeviceObject is the device object the error occurred on. - - Srb is the Srb that was being processed when the error occurred. - - Status may be overwritten by the routine if it decides that the error - was benign, or otherwise wishes to change the returned status code - for this command - - Retry may be overwritten to specify that this command should or should - not be retried (if the callee supports retrying commands) - -Return Value: - - status - ---*/ -__drv_maxIRQL(PASSIVE_LEVEL) -typedef -VOID -(*PCLASS_SCAN_FOR_SPECIAL_HANDLER) ( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in ULONG_PTR Data - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -ClassScanForSpecial( - __in PFUNCTIONAL_DEVICE_EXTENSION FdoExtension, - __in CLASSPNP_SCAN_FOR_SPECIAL_INFO DeviceList[], - __in PCLASS_SCAN_FOR_SPECIAL_HANDLER Function - ); - -#endif /* _CLASS_ */ - diff --git a/qt-correction-tool/pub/ddk/clfs.h b/qt-correction-tool/pub/ddk/clfs.h deleted file mode 100644 index eccabab..0000000 --- a/qt-correction-tool/pub/ddk/clfs.h +++ /dev/null @@ -1,1294 +0,0 @@ -/*============================================================================= - - Copyright (c) 1998 Microsoft Corporation - - Module Name: - - clfs.h - - Abstract: - - Header file containing all publicly defined data structures for the - common log file system. - - Author: - - Dexter Bradshaw [DexterB] 09-Dec-1998 - - - Revision History: - -=============================================================================*/ - -// begin_wdm -#ifndef _CLFS_PUBLIC_H_ -#define _CLFS_PUBLIC_H_ -// end_wdm - -#ifdef CLFS_KERNEL_MODE - -// begin_wdm -#define CLFSUSER_API -// end_wdm - -#else - -#include - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// PFILE -// -// Define PFILE to be a pointer to _iobuf * -// - -typedef FILE *PFILE, **PPFILE; -typedef DWORD CLFSSTATUS; - -# ifdef __CLFSUSER_EXPORTS__ -# define CLFSUSER_API -# else -# define CLFSUSER_API __declspec(dllimport) -# endif /* __CLFSUSER_EXPORTS__ */ - -# define ClfsLsnEqual LsnEqual -# define ClfsLsnLess LsnLess -# define ClfsLsnGreater LsnGreater -# define ClfsLsnNull LsnNull -# define ClfsLsnCreate LsnCreate -# define ClfsLsnContainer LsnContainer -# define ClfsLsnBlockOffset LsnBlockOffset -# define ClfsLsnRecordSequence LsnRecordSequence -# define ClfsLsnInvalid LsnInvalid -# define ClfsLsnIncrement LsnIncrement - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* CLFS_KERNEL_MODE */ - -// begin_wdm - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// FILE_ATTRIBUTE_DEDICATED is defined as FILE_ATTRIBUTE_TEMPORARY. -// - -#define FILE_ATTRIBUTE_DEDICATED FILE_ATTRIBUTE_TEMPORARY - -// -// Container name and container size extended attribute entry names. -// - -#define EA_CONTAINER_NAME "ContainerName" -#define EA_CONTAINER_SIZE "ContainerSize" - -// -// Base log file name 3-letter extension. -// - -#define CLFS_BASELOG_EXTENSION L".blf" - -// -// Common log file system public flags and constants. -// - -#define CLFS_FLAG_NO_FLAGS 0x00000000 // No flags. -#define CLFS_FLAG_FORCE_APPEND 0x00000001 // Flag to force an append to log queue -#define CLFS_FLAG_FORCE_FLUSH 0x00000002 // Flag to force a log flush -#define CLFS_FLAG_USE_RESERVATION 0x00000004 // Flag to charge a data append to reservation -#define CLFS_FLAG_REENTRANT_FILE_SYSTEM 0x00000008 // Kernel mode create flag indicating a re-entrant file system. -#define CLFS_FLAG_NON_REENTRANT_FILTER 0x00000010 // Kernel mode create flag indicating non-reentrant filter. -#define CLFS_FLAG_REENTRANT_FILTER 0x00000020 // Kernel mode create flag indicating reentrant filter. -#define CLFS_FLAG_IGNORE_SHARE_ACCESS 0x00000040 // Kernel mode create flag indicating IO_IGNORE_SHARE_ACCESS_CHECK semantics. -#define CLFS_FLAG_READ_IN_PROGRESS 0x00000080 // Flag indicating read in progress and not completed. -#define CLFS_FLAG_MINIFILTER_LEVEL 0x00000100 // Kernel mode create flag indicating mini-filter target. -#define CLFS_FLAG_HIDDEN_SYSTEM_LOG 0x00000200 // Kernel mode create flag indicating the log and containers should be marked hidden & system. - - -// -// Flag indicating all CLFS I/O will be targeted to an intermediate level of the I/O stack -// - -#define CLFS_FLAG_FILTER_INTERMEDIATE_LEVEL CLFS_FLAG_NON_REENTRANT_FILTER - -// -// Flag indicating all CLFS I/O will be targeted to the top level of the I/O stack -// - -#define CLFS_FLAG_FILTER_TOP_LEVEL CLFS_FLAG_REENTRANT_FILTER - -// -// CLFS_CONTAINER_INDEX -// -// Index into the container table. -// - -typedef ULONG CLFS_CONTAINER_ID; -typedef CLFS_CONTAINER_ID *PCLFS_CONTAINER_ID; -typedef CLFS_CONTAINER_ID **PPCLFS_CONTAINER_ID; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __CLFS_PRIVATE_LSN__ - -#include - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLS_LSN -// - -typedef struct _CLS_LSN -{ - - ULONGLONG Internal; - -} CLS_LSN, *PCLS_LSN, **PPCLS_LSN; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* __CLFS_PRIVATE_LSN__ */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// Alias CLS prefixed types with CLFS prefixes. -// - -typedef CLS_LSN CLFS_LSN; -typedef CLFS_LSN *PCLFS_LSN, **PPCLFS_LSN; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -// end_wdm - -// -// Definition of special LSN's: CLFS_LSN_INVALID and CLFS_LSN_NULL. Note that -// [CLFS_LSN_NULL, CLFS_LSN_INVALID) define the only valid LSN range. LSN values -// are strictly monotonic increasing. -// -#ifdef CLFS_KERNEL_MODE - -#if defined __CLFS_SUPPORT_LIBRARY__ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -extern const CLFS_LSN CLFS_LSN_INVALID; -extern const CLFS_LSN CLFS_LSN_NULL; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#elif defined __CLFSUSER_EXPORTS__ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -extern __declspec(dllexport) const CLFS_LSN CLFS_LSN_INVALID; -extern __declspec(dllexport) const CLFS_LSN CLFS_LSN_NULL; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -# else - -// begin_wdm -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -extern __declspec(dllimport) const CLFS_LSN CLFS_LSN_INVALID; -extern __declspec(dllimport) const CLFS_LSN CLFS_LSN_NULL; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ -// end_wdm - -# endif /* __CLFSUSER_EXPORTS__ */ - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -extern CLFSUSER_API const CLFS_LSN CLFS_LSN_INVALID; -extern CLFSUSER_API const CLFS_LSN CLFS_LSN_NULL; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* CLFS_KERNEL_MODE */ - -// begin_wdm - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLS_RECORD_TYPE -// -// Definition of record types. -// - -#ifdef __cplusplus - -const UCHAR ClfsNullRecord = 0x00; // Null record type. -const UCHAR ClfsDataRecord = 0x01; // Client data record. -const UCHAR ClfsRestartRecord = 0x02; // Restart record. - - -// Valid client records are restart and data records. - -const UCHAR ClfsClientRecord = 0x03; - -#else - -#define ClfsNullRecord 0x00 // Null record type. -#define ClfsDataRecord 0x01 // Client data record. -#define ClfsRestartRecord 0x02 // Restart record. - - -// Valid client records are restart and data records. - -#define ClfsClientRecord (ClfsDataRecord|ClfsRestartRecord) - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Log container path prefix indicating the log container's location is -// actually a stream inside of the BLF. -// - -#ifdef _cplusplus - -const LPCWSTR CLFS_CONTAINER_STREAM_PREFIX = L"%BLF%:" - -#else - -#define CLFS_CONTAINER_STREAM_PREFIX L"%BLF%:" - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Log container path prefix indicating the log container's location is -// relative to the base log file (BLF) and not an absolute path. -// Paths which do not being with said prefix are absolute paths. -// - -#ifdef _cplusplus - -const LPCWSTR CLFS_CONTAINER_RELATIVE_PREFIX = L"%BLF%\\" - -#else - -#define CLFS_CONTAINER_RELATIVE_PREFIX L"%BLF%\\" - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias CLS prefix with CLFS prefixes. -// - -typedef UCHAR CLS_RECORD_TYPE, *PCLS_RECORD_TYPE, **PPCLS_RECORD_TYPE; -typedef CLS_RECORD_TYPE CLFS_RECORD_TYPE, *PCLFS_RECORD_TYPE, **PPCLFS_RECORD_TYPE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTEXT_MODE -// -// The context mode specifies the dirction and access methods used to scan the -// log file. -// - -typedef enum _CLS_CONTEXT_MODE -{ - ClsContextNone = 0x00, - ClsContextUndoNext, - ClsContextPrevious, - ClsContextForward - -} CLS_CONTEXT_MODE, *PCLS_CONTEXT_MODE, **PPCLS_CONTEXT_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef enum _CLFS_CONTEXT_MODE -{ - ClfsContextNone = 0x00, - ClfsContextUndoNext, - ClfsContextPrevious, - ClfsContextForward - -} CLFS_CONTEXT_MODE, *PCLFS_CONTEXT_MODE, **PPCLFS_CONTEXT_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFSD_NODE_ID -// -// Common log file system node identifier. Every CLFS file system -// structure has a node identity and type. The node type is a signature -// field while the size is used in for consistency checking. -// - -typedef struct _CLFS_NODE_ID -{ - ULONG cType; // CLFS node type. - ULONG cbNode; // CLFS node size. - -} CLFS_NODE_ID, *PCLFS_NODE_ID; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_WRITE_ENTRY -// -// Write entry specifying the contents of a user buffer and length that are -// marshalled in the space reservation and append interface of the CLS API. -// - -typedef struct _CLS_WRITE_ENTRY -{ - PVOID Buffer; - ULONG ByteLength; -} CLS_WRITE_ENTRY, *PCLS_WRITE_ENTRY, **PPCLS_WRITE_ENTRY; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_WRITE_ENTRY CLFS_WRITE_ENTRY; -typedef CLFS_WRITE_ENTRY *PCLFS_WRITE_ENTRY, **PPCLFS_WRITE_ENTRY; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_ID -// -// A log identifier is a GUID that describes uniquely a physical log file. -// - -typedef GUID CLFS_LOG_ID; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_INFORMATION -// -// Logical log file information structure describing either virtual or physical log -// file data, depending on the type of information queried. -// - -typedef struct _CLS_INFORMATION -{ - LONGLONG TotalAvailable; // Total log data space available. - LONGLONG CurrentAvailable; // Useable space in the log file. - LONGLONG TotalReservation; // Space reserved for UNDO's (aggregate for physical log) - ULONGLONG BaseFileSize; // Size of the base log file. - ULONGLONG ContainerSize; // Uniform size of log containers. - ULONG TotalContainers; // Total number of containers. - ULONG FreeContainers; // Number of containers not in active log. - ULONG TotalClients; // Total number of clients. - ULONG Attributes; // Log file attributes. - ULONG FlushThreshold; // Log file flush threshold. - ULONG SectorSize; // Underlying container sector size. - CLS_LSN MinArchiveTailLsn; // Marks the global archive tail. - CLS_LSN BaseLsn; // Start of the active log region. - CLS_LSN LastFlushedLsn; // Last flushed LSN in active log. - CLS_LSN LastLsn; // End of active log region. - CLS_LSN RestartLsn; // Location of restart record. - GUID Identity; // Unique identifier for the log. -} CLS_INFORMATION, *PCLS_INFORMATION, *PPCLS_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias CLS prefixes with CLS prefixes. -// - -typedef CLS_INFORMATION CLFS_INFORMATION; -typedef CLFS_INFORMATION *PCLFS_INFORMATION, *PPCLFS_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ -/* -// -// CLFS_CLIENT_INFORMATION -// -// The client information structure maintains client-based log metadata. -// - -typedef struct _CLS_CLIENT_INFORMATION -{ - CLS_INFORMATION ClfsInfo; // Contains base log file information. - ULONG ClientAttributes; // Virtual log file attributes. - LONGLONG ClientUndoCommitment; // Max. undo commitment for client. - CLS_LSN ClientArchiveTailLsn; // Marks the client archive tail. - CLS_LSN ClientBaseLsn; // Min. client LSN in active log region. - CLS_LSN ClientLastLsn; // Max. client LSN in active log region. - CLS_LSN ClientRestartLsn; // Location of restart record. - -} CLS_CLIENT_INFORMATION, *PCLS_CLIENT_INFORMATION, **PPCLS_CLIENT_INFORMATION; - -// -// Alias CLS prefixes with CLS prefixes. -// - -typedef CLS_CLIENT_INFORMATION CLFS_CLIENT_INFORMATION; -typedef CLFS_CLIENT_INFORMATION *PCLFS_CLIENT_INFORMATION, *PPCLFS_CLIENT_INFORMATION; -*/ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_NAME_INFORMATION -// -// The client information structure stores the name of a log. It is used -// to communicate ClfsLogNameInformation and ClfsLogPhysicalNameInformation. -// - -typedef struct _CLFS_LOG_NAME_INFORMATION -{ - - USHORT NameLengthInBytes; - WCHAR Name[1]; - -} CLFS_LOG_NAME_INFORMATION, *PCLFS_LOG_NAME_INFORMATION, **PPCLFS_LOG_NAME_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_STREAM_ID_INFORMATION -// -// The client information structure provides a permanent identifier unique -// to the log for the stream in question. -// - -typedef struct _CLFS_STREAM_ID_INFORMATION -{ - - UCHAR StreamIdentifier; - -} CLFS_STREAM_ID_INFORMATION, *PCLFS_STREAM_ID_INFORMATION, **PPCLFS_STREAM_ID_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) -// -// CLFS_PHYSICAL_LSN_INFORMATION -// -// An information structure that describes a virtual:physical LSN pairing -// for the stream identified in the structure. -// -#pragma pack(push,8) -typedef struct _CLFS_PHYSICAL_LSN_INFORMATION -{ - UCHAR StreamIdentifier; - CLFS_LSN VirtualLsn; - CLFS_LSN PhysicalLsn; - -} CLFS_PHYSICAL_LSN_INFORMATION, *PCLFS_PHYSICAL_LSN_INFORMATION; -#pragma pack(pop) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTAINER_STATE -// -// At any point in time a container could be inactive or unitialized, active, -// pending deletion from the list of free containers, pending archival, or -// pending deletion while waiting to be archived. -// - -typedef UINT32 CLS_CONTAINER_STATE, *PCLS_CONTAINER_STATE, *PPCLS_CONTAINER_STATE; -typedef CLS_CONTAINER_STATE CLFS_CONTAINER_STATE, *PCLFS_CONTAINER_STATE, *PPCLFS_CONTAINER_STATE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __cplusplus - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -const CLFS_CONTAINER_STATE ClsContainerInitializing = 0x01; -const CLFS_CONTAINER_STATE ClsContainerInactive = 0x02; -const CLFS_CONTAINER_STATE ClsContainerActive = 0x04; -const CLFS_CONTAINER_STATE ClsContainerActivePendingDelete = 0x08; -const CLFS_CONTAINER_STATE ClsContainerPendingArchive = 0x10; -const CLFS_CONTAINER_STATE ClsContainerPendingArchiveAndDelete = 0x20; - -const CLFS_CONTAINER_STATE ClfsContainerInitializing = 0x01; -const CLFS_CONTAINER_STATE ClfsContainerInactive = 0x02; -const CLFS_CONTAINER_STATE ClfsContainerActive = 0x04; -const CLFS_CONTAINER_STATE ClfsContainerActivePendingDelete = 0x08; -const CLFS_CONTAINER_STATE ClfsContainerPendingArchive = 0x10; -const CLFS_CONTAINER_STATE ClfsContainerPendingArchiveAndDelete= 0x20; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -#define ClsContainerInitializing 0x01 -#define ClsContainerInactive 0x02 -#define ClsContainerActive 0x04 -#define ClsContainerActivePendingDelete 0x08 -#define ClsContainerPendingArchive 0x10 -#define ClsContainerPendingArchiveAndDelete 0x20 - -#define ClfsContainerInitializing 0x01 -#define ClfsContainerInactive 0x02 -#define ClfsContainerActive 0x04 -#define ClfsContainerActivePendingDelete 0x08 -#define ClfsContainerPendingArchive 0x10 -#define ClfsContainerPendingArchiveAndDelete 0x20 -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MAX_CONTAINER_INFO -// -// The maximum length, in bytes, of the FileName field in the CLFS -// container information structure. -// - -#ifdef __cplusplus - -const ULONG CLFS_MAX_CONTAINER_INFO = (256); - -#else - -#define CLFS_MAX_CONTAINER_INFO (256) - -#endif /* __cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTAINER_INFORMATION -// -// This structure defines a container descriptor. The descriptor specifies the -// container's creation and access times, size, file system name, file system -// attributes, state, minimum, and maximum LSNs. -// - -typedef struct _CLS_CONTAINER_INFORMATION -{ - ULONG FileAttributes; // File system attribute flag. - ULONGLONG CreationTime; // File creation time. - ULONGLONG LastAccessTime; // Last time container was read/written. - ULONGLONG LastWriteTime; // Last time container was written. - LONGLONG ContainerSize; // Size of container in bytes. - ULONG FileNameActualLength; // Length of the actual file name. - ULONG FileNameLength; // Length of file name in buffer - WCHAR FileName [CLFS_MAX_CONTAINER_INFO];// File system name for container. - CLFS_CONTAINER_STATE State; // Current state of the container. - CLFS_CONTAINER_ID PhysicalContainerId; // Physical container identifier. - CLFS_CONTAINER_ID LogicalContainerId; // Logical container identifier. - -} CLS_CONTAINER_INFORMATION, *PCLS_CONTAINER_INFORMATION, **PPCLS_CONTAINER_INFORMATION; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_CONTAINER_INFORMATION CLFS_CONTAINER_INFORMATION; -typedef CLFS_CONTAINER_INFORMATION *PCLFS_CONTAINER_INFORMATION, **PPCLFS_CONTAINER_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_INFORMATION_CLASS -// -// The information class specifies the kind of information a caller -// wishes to query or set on a log file. -// - -typedef enum _CLS_LOG_INFORMATION_CLASS -{ - - ClfsLogBasicInformation = 0x00, // For virtual or physical logs, indicates the respective basic information. - ClfsLogBasicInformationPhysical, // Always indicates physical log basic information. - ClfsLogPhysicalNameInformation, // Always indicates physical name information. - ClfsLogStreamIdentifierInformation, // Virtual/physical log agnostic. -#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) - ClfsLogSystemMarkingInformation, // Count of system marking references. - ClfsLogPhysicalLsnInformation // Maps virtual LSNs to physical LSNs; only valid for physical logs. -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -} CLS_LOG_INFORMATION_CLASS, *PCLS_LOG_INFORMATION_CLASS, **PPCLS_LOG_INFORMATION_CLASS; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_LOG_INFORMATION_CLASS CLFS_LOG_INFORMATION_CLASS; -typedef CLFS_LOG_INFORMATION_CLASS *PCLFS_LOG_INFORMATION_CLASS, **PPCLFS_LOG_INFORMATION_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_IOSTATS_CLASS -// -// Enumerated type defining the class of I/O statistics. -// - -typedef enum _CLS_IOSTATS_CLASS -{ - ClsIoStatsDefault = 0x0000, - ClsIoStatsMax = 0xFFFF - -} CLS_IOSTATS_CLASS, *PCLS_IOSTATS_CLASS, **PPCLS_IOSTATS_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_IOSTATS_CLASS -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef enum _CLFS_IOSTATS_CLASS -{ - ClfsIoStatsDefault = 0x0000, - ClfsIoStatsMax = 0xFFFF - -} CLFS_IOSTATS_CLASS, *PCLFS_IOSTATS_CLASS, **PPCLFS_IOSTATS_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_IO_STATISTICS -// -// This structure defines I/O performance counters particular to a log file. It consists -// of a header followed by the I/O statistics counters. The header is being ignored for -// now. -// - -typedef struct _CLS_IO_STATISTICS_HEADER -{ - UCHAR ubMajorVersion; // Major version of the statistics buffer. - UCHAR ubMinorVersion; // Minor version of the statistics buffer. - CLFS_IOSTATS_CLASS eStatsClass; // I/O statistics class. - USHORT cbLength; // Length of the statistics buffer. - ULONG coffData; // Offset of statistics counters. - -} CLS_IO_STATISTICS_HEADER, *PCLS_IO_STATISTICS_HEADER, **PPCLS_IO_STATISTICS_HEADER; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_IO_STATISTICS_HEADER CLFS_IO_STATISTICS_HEADER; -typedef CLFS_IO_STATISTICS_HEADER *PCLFS_IO_STATISTICS_HEADER, **PPCLFS_IO_STATISTICS_HEADER; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -typedef struct _CLS_IO_STATISTICS -{ - CLS_IO_STATISTICS_HEADER hdrIoStats; // Statistics buffer header. - ULONGLONG cFlush; // Flush count. - ULONGLONG cbFlush; // Cumulative number of bytes flushed. - ULONGLONG cMetaFlush; // Metadata flush count. - ULONGLONG cbMetaFlush; // Cumulative number of metadata bytes flushed. - -} CLS_IO_STATISTICS, *PCLS_IO_STATISTICS, **PPCLS_IO_STATISTICS; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_IO_STATISTICS CLFS_IO_STATISTICS; -typedef CLFS_IO_STATISTICS *PCLFS_IO_STATISTICS, **PPCLFS_IO_STATISTICS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_SCAN_MODE -// -// Container scan mode flags. -// - -#ifdef __cplusplus - -const UCHAR CLFS_SCAN_INIT = 0x01; -const UCHAR CLFS_SCAN_FORWARD = 0x02; -const UCHAR CLFS_SCAN_BACKWARD = 0x04; -const UCHAR CLFS_SCAN_CLOSE = 0x08; -const UCHAR CLFS_SCAN_INITIALIZED = 0x10; -const UCHAR CLFS_SCAN_BUFFERED = 0x20; - -#else - -#define CLFS_SCAN_INIT 0x01 -#define CLFS_SCAN_FORWARD 0x02 -#define CLFS_SCAN_BACKWARD 0x04 -#define CLFS_SCAN_CLOSE 0x08 -#define CLFS_SCAN_INITIALIZED 0x10 -#define CLFS_SCAN_BUFFERED 0x20 - -#endif - -typedef UCHAR CLFS_SCAN_MODE, *PCLFS_SCAN_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -// end_wdm - -#ifdef CLFS_KERNEL_MODE - -// begin_wdm -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLFS_SCAN_CONTEXT -// -// Container scan context for scanning all containers in a given physical log -// file. -// - -// -// The log file object wraps an NT file object and the size of the structure. -// The log file object may be modified in the near future and there should be no -// dependencies on the size of the structure itself. -// - -typedef FILE_OBJECT LOG_FILE_OBJECT, *PLOG_FILE_OBJECT, **PPLOG_FILE_OBJECT; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#pragma warning(disable:4324) // structure padded due to __declspec(align()) -#endif -#endif - -typedef struct _CLS_SCAN_CONTEXT -{ - CLFS_NODE_ID cidNode; - PLOG_FILE_OBJECT plfoLog; - __declspec(align(8)) ULONG cIndex; - __declspec(align(8)) ULONG cContainers; - __declspec(align(8)) ULONG cContainersReturned; - __declspec(align(8)) CLFS_SCAN_MODE eScanMode; - __declspec(align(8)) PCLS_CONTAINER_INFORMATION pinfoContainer; - -} CLS_SCAN_CONTEXT, *PCLS_SCAN_CONTEXT, **PPCLS_SCAN_CONTEXT; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#endif -#endif - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -// end_wdm - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -typedef struct _CLS_SCAN_CONTEXT -{ - CLFS_NODE_ID cidNode; - HANDLE hLog; - __declspec(align(8)) ULONG cIndex; - __declspec(align(8)) ULONG cContainers; - __declspec(align(8)) ULONG cContainersReturned; - __declspec(align(8)) CLFS_SCAN_MODE eScanMode; - __declspec(align(8)) PCLS_CONTAINER_INFORMATION pinfoContainer; - -} CLS_SCAN_CONTEXT, *PCLS_SCAN_CONTEXT, **PPCLS_SCAN_CONTEXT; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* CLFS_KERNEL_MODE */ - -// begin_wdm - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_SCAN_CONTEXT CLFS_SCAN_CONTEXT; -typedef CLFS_SCAN_CONTEXT *PCLFS_SCAN_CONTEXT, **PPCLFS_SCAN_CONTEXT; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_ARCHIVE_DESCRIPTOR -// -// Log archive descriptors describe the set of discrete but logically -// contiguous disk extents comprising a snapshot of the active log when -// preparing for archival. Log archive descriptors specify enough information -// for log archive clients directly access the relevant contents of containers -// for archiving and restoring a snapshot of the log. -// - -typedef struct _CLS_ARCHIVE_DESCRIPTOR -{ - ULONGLONG coffLow; - ULONGLONG coffHigh; - CLS_CONTAINER_INFORMATION infoContainer; - -} CLS_ARCHIVE_DESCRIPTOR, *PCLS_ARCHIVE_DESCRIPTOR, **PPCLS_ARCHIVE_DESCRIPTOR; - -// -// Alias CLS prefixes with CLFS prefixes. -// - -typedef CLS_ARCHIVE_DESCRIPTOR CLFS_ARCHIVE_DESCRIPTOR; -typedef CLFS_ARCHIVE_DESCRIPTOR *PCLFS_ARCHIVE_DESCRIPTOR, **PPCLFS_ARCHIVE_DESCRIPTOR; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_ALLOCATION_ROUTINE -// -// Allocate a blocks for marshalled reads or writes -// - -typedef PVOID (* CLFS_BLOCK_ALLOCATION) (ULONG cbBufferLength, PVOID pvUserContext); - -// -// CLFS_DEALLOCATION_ROUTINE -// -// Deallocate buffers allocated by the CLFS_ALLOCATION_ROUTINE. -// - -typedef void (* CLFS_BLOCK_DEALLOCATION) (PVOID pvBuffer, PVOID pvUserContext); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_ARCHIVE_MODE -// -// Describes the archive support behavior for the log. -// - -typedef enum _CLFS_LOG_ARCHIVE_MODE -{ - - ClfsLogArchiveEnabled = 0x01, - ClfsLogArchiveDisabled = 0x02 - -} CLFS_LOG_ARCHIVE_MODE, *PCLFS_LOG_ARCHIVE_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -//----------------------------------------------------------------------------- -// LSN OPERATORS -//----------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnEqual -// -// Method Description: -// -// Check for the equivalence of LSNs. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN values are equivalent and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnEqual -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnLess -// -// Method Description: -// -// Check if LSN1 is less than LSN2. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN1 is less than LSN2 and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnLess -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnGreater -// -// Method Description: -// -// Check if LSN1 is greater than LSN2. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN1 is greater than LSN2 and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnGreater -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnNull (Inline) -// -// Method Description: -// -// Check whether or not an LSN is CLFS_LSN_NULL. -// -// Arguments: -// -// plsn -- reference to LSN tested against the NULL value. -// -// -// Return Value: -// -// TRUE if and only if an LSN is equivalent to CLFS_LSN_NULL. -// LSNs with the value CLFS_LSN_INVALID will return FALSE. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnNull -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnContainer (Inline) -// -// Routine Description: -// -// Extract the container identifier from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the container identifier for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_CONTAINER_ID NTAPI -ClfsLsnContainer -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnCreate (Inline) -// -// Routine Description: -// -// Create an LSN given a log identifier, a container identifier, a block -// offset and a bucket identifier. Caller must test for invalid LSN after -// making this call. -// -// Arguments: -// -// cidContainer -- container identifier -// offBlock -- block offset -// cRecord -- ordinal number of the record in block -// -// Return Value: -// -// Returns a valid LSN if successful, otherwise it returns -// CLFS_LSN_INVALID -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_LSN NTAPI -ClfsLsnCreate -( - __in CLFS_CONTAINER_ID cidContainer, - __in ULONG offBlock, - __in ULONG cRecord -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnBlockOffset (Inline) -// -// Routine Description: -// -// Extract the block offset from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the block offset for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API ULONG NTAPI -ClfsLsnBlockOffset -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnRecordSequence (Inline) -// -// Routine Description: -// -// Extract the bucket identifier from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the bucket identifier for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API ULONG NTAPI -ClfsLsnRecordSequence -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnInvalid -// -// Method Description: -// -// Check whether or not an LSN is CLFS_LSN_INVALID. -// -// Arguments: -// -// plsn -- reference to LSN tested against CLFS_LSN_INVALID. -// -// -// Return Value: -// -// TRUE if and only if an LSN is equivalent to CLFS_LSN_INVALID. -// LSNs with the value CLFS_LSN_NULL will return FALSE. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnInvalid -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnIncrement -// -// Method Description: -// -// Increment and LSN by 1 -// -// Arguments: -// -// plsn -- LSN to be incremented. -// -// -// Return Value: -// -// A valid LSN next in sequence to the input LSN, if successful. -// Otherwise, this function returns CLFS_LSN_INVALID. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_LSN NTAPI -ClfsLsnIncrement (__in PCLFS_LSN plsn); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus - -#ifdef CLFS_OPERATORS - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// LSN arithmetic increment operator. -// - -inline CLFS_LSN -operator++ -( - __inout CLFS_LSN& refLsn -) -{ - // - // Prefix increment operator. - // - - refLsn = ClfsLsnIncrement (&refLsn); - return refLsn; -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// BOOLEAN LSN operators. -// - -inline BOOLEAN -operator< -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnLess ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator> -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnGreater ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator== -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnEqual ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator!= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnEqual ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator<= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnGreater ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator>= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnLess ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* CLFS_OPERATORS */ - -#endif /* __cplusplus */ - -#endif /* _CLFS_PUBLIC_H_ */ -// end_wdm - -//----------------------------------------------------------------------------- -// END OF FILE -//----------------------------------------------------------------------------- - diff --git a/qt-correction-tool/pub/ddk/clfslsn.h b/qt-correction-tool/pub/ddk/clfslsn.h deleted file mode 100644 index c6d6b63..0000000 --- a/qt-correction-tool/pub/ddk/clfslsn.h +++ /dev/null @@ -1,88 +0,0 @@ -/*============================================================================= - - Copyright (c) 1998 Microsoft Corporation - - Module Name: - - clfslsn.h - - Abstract: - - Header file containing the private definition for the common log - file system's log sequence number structure. - - Author: - - Dexter Bradshaw [DexterB] 09-Dec-1998 - - - Revision History: - -=============================================================================*/ - -#ifndef _CLFS_LSN_H_ -#define _CLFS_LSN_H_ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_RECORD_INDEX -// -// Log record offset on container file. The log record offset consists of a block -// offset in the container and a bucket identifier indexing the records in the block. -// Declared up here because including clfs_x.h will try to define the LSN, which needs -// this. -// - -typedef UINT32 CLFS_RECORD_INDEX; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_LSN -// -// The log sequence number (LSN) is a valid log file address. The LSN consists of -// three (3) parts: (a) a log identifier to identify which physical log the log record -// belongs to, (b) a container index identifying the log container where the log record -// lies, and (c) a record offset identified by the offset of the block in the container -// and an ordinal number for the record within the container. -// -// -// The structure of the LSN poses some inherent limitations of the number of logs, -// the number of containers, the size of a container, and the number of log records in -// a log block. -// -// Maximum number of physical log files is 64K. -// Maximum number of container identifiers is 4G. -// Maximum size of a container is 4G. -// Maximum number of sector-aligned log blocks is 8M -// Maximum number of record buckets in a log block is 512 -// - -typedef union _CLS_LSN -{ - // - // Container identifier - // - - struct - { - CLFS_RECORD_INDEX idxRecord; // Record offset on container. - CLFS_CONTAINER_ID cidContainer; // Container identifier. - } offset; - - __volatile ULONGLONG ullOffset; // Sequence number within physical log. - -} CLS_LSN, *PCLS_LSN, **PPCLS_LSN; - -// -// Alias CLS prefixed types with CLFS prefixes. -// - -typedef CLS_LSN CLFS_LSN; -typedef CLFS_LSN *PCLFS_LSN, **PPCLFS_LSN; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif - diff --git a/qt-correction-tool/pub/ddk/clfsmsg.h b/qt-correction-tool/pub/ddk/clfsmsg.h deleted file mode 100644 index a055fa7..0000000 --- a/qt-correction-tool/pub/ddk/clfsmsg.h +++ /dev/null @@ -1,164 +0,0 @@ - -/*============================================================================= - - Copyright (c) 1998 Microsoft Corporation - - Module Name: - - clfsmsg.mc - - Abstract: - - Common log file system (CLFS) driver message file. - - Author: - - Dexter Bradshaw [DexterB] 17-Dec-1998 - - Environment: - - Kernel mode - - Revision History: - - -=============================================================================*/ - -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// -#define FACILITY_RPC_STUBS 0x3 -#define FACILITY_RPC_RUNTIME 0x2 -#define FACILITY_IO_ERROR_CODE 0x4 -#define FACILITY_CLFS_ERROR_CODE 0x9 - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_ERROR 0x3 - - -// -// MessageId: CLFS_MSG_LOGGING_ENABLED -// -// MessageText: -// -// Event logging enabled for Common Log File System. -// -#define CLFS_MSG_LOGGING_ENABLED ((NTSTATUS)0x400919FAL) - -// -// MessageId: CLFS_MSG_DRIVER_STARTING -// -// MessageText: -// -// Common Log File System driver has successfully initialized. -// -#define CLFS_MSG_DRIVER_STARTING ((NTSTATUS)0x400919FBL) - -// -// MessageId: CLFS_MSG_DRIVER_STOPPING -// -// MessageText: -// -// Common Log File System driver has unloaded. -// -#define CLFS_MSG_DRIVER_STOPPING ((NTSTATUS)0x400919FCL) - -// -// MessageId: CLFS_MSG_OPENING_HANDLE -// -// MessageText: -// -// Opening handle to %1. -// -#define CLFS_MSG_OPENING_HANDLE ((NTSTATUS)0x400919FDL) - -// -// MessageId: CLFS_MSG_CLOSING_HANDLE -// -// MessageText: -// -// Closing handle to %1. -// -#define CLFS_MSG_CLOSING_HANDLE ((NTSTATUS)0x400919FEL) - -// -// MessageId: CLFS_MSG_FLUSH_FAILED -// -// MessageText: -// -// %1 log flush failed because of media write error. -// -#define CLFS_MSG_FLUSH_FAILED ((NTSTATUS)0x400919FFL) - -// -// MessageId: CLFS_MSG_METADATA_READ_FAILED -// -// MessageText: -// -// %1 log metadata read failed because of media write error. -// -#define CLFS_MSG_METADATA_READ_FAILED ((NTSTATUS)0x40091A00L) - -// -// MessageId: CLFS_MSG_METADATA_FLUSH_FAILED -// -// MessageText: -// -// %1 log metadata flush failed because of media write error. -// -#define CLFS_MSG_METADATA_FLUSH_FAILED ((NTSTATUS)0x40091A01L) - -// -// MessageId: CLFS_MSG_OWNERPAGE_READ_FAILED -// -// MessageText: -// -// %1 log owner page read failed because of media error. -// -#define CLFS_MSG_OWNERPAGE_READ_FAILED ((NTSTATUS)0x40091A02L) - -// -// MessageId: CLFS_MSG_OWNERPAGE_WRITE_FAILED -// -// MessageText: -// -// %1 log owner page write failed because of media error. -// -#define CLFS_MSG_OWNERPAGE_WRITE_FAILED ((NTSTATUS)0x40091A03L) - -//----------------------------------------------------------------------------- -// End of File -//----------------------------------------------------------------------------- - diff --git a/qt-correction-tool/pub/ddk/cloneviewhelper.h b/qt-correction-tool/pub/ddk/cloneviewhelper.h deleted file mode 100644 index a73c8b3..0000000 --- a/qt-correction-tool/pub/ddk/cloneviewhelper.h +++ /dev/null @@ -1,409 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for cloneviewhelper.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __cloneviewhelper_h__ -#define __cloneviewhelper_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ICloneViewHelper_FWD_DEFINED__ -#define __ICloneViewHelper_FWD_DEFINED__ -typedef interface ICloneViewHelper ICloneViewHelper; -#endif /* __ICloneViewHelper_FWD_DEFINED__ */ - - -#ifndef __IViewHelper_FWD_DEFINED__ -#define __IViewHelper_FWD_DEFINED__ -typedef interface IViewHelper IViewHelper; -#endif /* __IViewHelper_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_cloneviewhelper_0000_0000 */ -/* [local] */ - -#define GETCONNECTEDIDS_TARGET 0 -#define GETCONNECTEDIDS_SOURCE 1 -#define S_INIT 2 -// 0 == TMM's passed in configuration was applied -#define SETCONFIGURATION_STATUS_APPLIED 0 -// 1 == TMM's passed in configuration was applied, with additional proprietary IHV settings -#define SETCONFIGURATION_STATUS_ADDITIONAL 1 -// 2 == TMM's passed in configuration was overridden and IHV's own settings were applied -#define SETCONFIGURATION_STATUS_OVERRIDDEN 2 - -// Topology Data - -typedef struct tagSources -{ - ULONG sourceId; - int numTargets; - ULONG aTargets[1]; -} Sources; - -typedef struct tagAdapter -{ - WCHAR AdapterName[128]; - int numSources; - Sources sources[1]; -} Adapter; - -typedef struct tagAdapters -{ - int numAdapters; - Adapter adapter[1]; -} Adapters; - -// Display Mode Data - -typedef struct tagDisplayMode -{ - WCHAR DeviceName[32]; - DEVMODEW devMode; -} DisplayMode; - -typedef struct tagDisplayModes -{ - int numDisplayModes; - DisplayMode displayMode[1]; -} DisplayModes; - - - -extern RPC_IF_HANDLE __MIDL_itf_cloneviewhelper_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_cloneviewhelper_0000_0000_v0_0_s_ifspec; - -#ifndef __ICloneViewHelper_INTERFACE_DEFINED__ -#define __ICloneViewHelper_INTERFACE_DEFINED__ - -/* interface ICloneViewHelper */ -/* [unique][helpstring][nonextensible][uuid][object] */ - - -EXTERN_C const IID IID_ICloneViewHelper; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F6A3D4C4-5632-4D83-B0A1-FB88712B1EB7") - ICloneViewHelper : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetConnectedIDs( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulID, - /* [in] */ ULONG ulFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetActiveTopology( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulTargetID) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetActiveTopology( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [in] */ ULONG ulCount, - /* [in] */ __RPC__in ULONG *pulTargetID) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( - /* [in] */ BOOL fFinalCall) = 0; - - }; - -#else /* C style interface */ - - typedef struct ICloneViewHelperVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ICloneViewHelper * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ICloneViewHelper * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ICloneViewHelper * This); - - HRESULT ( STDMETHODCALLTYPE *GetConnectedIDs )( - __RPC__in ICloneViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulID, - /* [in] */ ULONG ulFlags); - - HRESULT ( STDMETHODCALLTYPE *GetActiveTopology )( - __RPC__in ICloneViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulTargetID); - - HRESULT ( STDMETHODCALLTYPE *SetActiveTopology )( - __RPC__in ICloneViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [in] */ ULONG ulCount, - /* [in] */ __RPC__in ULONG *pulTargetID); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - __RPC__in ICloneViewHelper * This, - /* [in] */ BOOL fFinalCall); - - END_INTERFACE - } ICloneViewHelperVtbl; - - interface ICloneViewHelper - { - CONST_VTBL struct ICloneViewHelperVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ICloneViewHelper_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ICloneViewHelper_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ICloneViewHelper_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ICloneViewHelper_GetConnectedIDs(This,wszAdaptorName,pulCount,pulID,ulFlags) \ - ( (This)->lpVtbl -> GetConnectedIDs(This,wszAdaptorName,pulCount,pulID,ulFlags) ) - -#define ICloneViewHelper_GetActiveTopology(This,wszAdaptorName,ulSourceID,pulCount,pulTargetID) \ - ( (This)->lpVtbl -> GetActiveTopology(This,wszAdaptorName,ulSourceID,pulCount,pulTargetID) ) - -#define ICloneViewHelper_SetActiveTopology(This,wszAdaptorName,ulSourceID,ulCount,pulTargetID) \ - ( (This)->lpVtbl -> SetActiveTopology(This,wszAdaptorName,ulSourceID,ulCount,pulTargetID) ) - -#define ICloneViewHelper_Commit(This,fFinalCall) \ - ( (This)->lpVtbl -> Commit(This,fFinalCall) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ICloneViewHelper_INTERFACE_DEFINED__ */ - - -#ifndef __IViewHelper_INTERFACE_DEFINED__ -#define __IViewHelper_INTERFACE_DEFINED__ - -/* interface IViewHelper */ -/* [unique][helpstring][nonextensible][uuid][object] */ - - -EXTERN_C const IID IID_IViewHelper; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E85CCEF5-AAAA-47f0-B5E3-61F7AECDC4C1") - IViewHelper : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetConnectedIDs( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulID, - /* [in] */ ULONG ulFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetActiveTopology( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulTargetID) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetActiveTopology( - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [in] */ ULONG ulCount, - /* [in] */ __RPC__in ULONG *pulTargetID) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetConfiguration( - /* [in] */ __RPC__in_opt IStream *pIStream, - /* [out] */ __RPC__out ULONG *pulStatus) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProceedOnNewConfiguration( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IViewHelperVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IViewHelper * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IViewHelper * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IViewHelper * This); - - HRESULT ( STDMETHODCALLTYPE *GetConnectedIDs )( - __RPC__in IViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulID, - /* [in] */ ULONG ulFlags); - - HRESULT ( STDMETHODCALLTYPE *GetActiveTopology )( - __RPC__in IViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [out][in] */ __RPC__inout ULONG *pulCount, - /* [out][in] */ __RPC__inout ULONG *pulTargetID); - - HRESULT ( STDMETHODCALLTYPE *SetActiveTopology )( - __RPC__in IViewHelper * This, - /* [in] */ __RPC__in LPCWSTR wszAdaptorName, - /* [in] */ ULONG ulSourceID, - /* [in] */ ULONG ulCount, - /* [in] */ __RPC__in ULONG *pulTargetID); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - __RPC__in IViewHelper * This); - - HRESULT ( STDMETHODCALLTYPE *SetConfiguration )( - __RPC__in IViewHelper * This, - /* [in] */ __RPC__in_opt IStream *pIStream, - /* [out] */ __RPC__out ULONG *pulStatus); - - HRESULT ( STDMETHODCALLTYPE *GetProceedOnNewConfiguration )( - __RPC__in IViewHelper * This); - - END_INTERFACE - } IViewHelperVtbl; - - interface IViewHelper - { - CONST_VTBL struct IViewHelperVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IViewHelper_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IViewHelper_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IViewHelper_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IViewHelper_GetConnectedIDs(This,wszAdaptorName,pulCount,pulID,ulFlags) \ - ( (This)->lpVtbl -> GetConnectedIDs(This,wszAdaptorName,pulCount,pulID,ulFlags) ) - -#define IViewHelper_GetActiveTopology(This,wszAdaptorName,ulSourceID,pulCount,pulTargetID) \ - ( (This)->lpVtbl -> GetActiveTopology(This,wszAdaptorName,ulSourceID,pulCount,pulTargetID) ) - -#define IViewHelper_SetActiveTopology(This,wszAdaptorName,ulSourceID,ulCount,pulTargetID) \ - ( (This)->lpVtbl -> SetActiveTopology(This,wszAdaptorName,ulSourceID,ulCount,pulTargetID) ) - -#define IViewHelper_Commit(This) \ - ( (This)->lpVtbl -> Commit(This) ) - -#define IViewHelper_SetConfiguration(This,pIStream,pulStatus) \ - ( (This)->lpVtbl -> SetConfiguration(This,pIStream,pulStatus) ) - -#define IViewHelper_GetProceedOnNewConfiguration(This) \ - ( (This)->lpVtbl -> GetProceedOnNewConfiguration(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IViewHelper_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/cloneviewhelper.idl b/qt-correction-tool/pub/ddk/cloneviewhelper.idl deleted file mode 100644 index ae4d6c4..0000000 --- a/qt-correction-tool/pub/ddk/cloneviewhelper.idl +++ /dev/null @@ -1,103 +0,0 @@ -// CloneViewHelper.idl : IDL source for ICloneViewHelper -// -import "oaidl.idl"; -import "ocidl.idl"; - -cpp_quote("#define GETCONNECTEDIDS_TARGET 0") -cpp_quote("#define GETCONNECTEDIDS_SOURCE 1") -cpp_quote("#define S_INIT 2") -cpp_quote("// 0 == TMM's passed in configuration was applied") -cpp_quote("#define SETCONFIGURATION_STATUS_APPLIED 0") -cpp_quote("// 1 == TMM's passed in configuration was applied, with additional proprietary IHV settings") -cpp_quote("#define SETCONFIGURATION_STATUS_ADDITIONAL 1") -cpp_quote("// 2 == TMM's passed in configuration was overridden and IHV's own settings were applied") -cpp_quote("#define SETCONFIGURATION_STATUS_OVERRIDDEN 2") -cpp_quote("") -cpp_quote("// Topology Data") -cpp_quote("") -cpp_quote("typedef struct tagSources") -cpp_quote("{") -cpp_quote(" ULONG sourceId;") -cpp_quote(" int numTargets;") -cpp_quote(" ULONG aTargets[1];") -cpp_quote("} Sources;") -cpp_quote("") -cpp_quote("typedef struct tagAdapter") -cpp_quote("{") -cpp_quote(" WCHAR AdapterName[128];") -cpp_quote(" int numSources;") -cpp_quote(" Sources sources[1];") -cpp_quote("} Adapter;") -cpp_quote("") -cpp_quote("typedef struct tagAdapters") -cpp_quote("{") -cpp_quote(" int numAdapters;") -cpp_quote(" Adapter adapter[1];") -cpp_quote("} Adapters;") -cpp_quote("") -cpp_quote("// Display Mode Data") -cpp_quote("") -cpp_quote("typedef struct tagDisplayMode") -cpp_quote("{") -cpp_quote(" WCHAR DeviceName[32];") -cpp_quote(" DEVMODEW devMode;") -cpp_quote("} DisplayMode;") -cpp_quote("") -cpp_quote("typedef struct tagDisplayModes") -cpp_quote("{") -cpp_quote(" int numDisplayModes;") -cpp_quote(" DisplayMode displayMode[1];") -cpp_quote("} DisplayModes;") -cpp_quote("") - -[ - object, - uuid(F6A3D4C4-5632-4D83-B0A1-FB88712B1EB7), - nonextensible, - helpstring("ICloneViewHelper Interface"), - pointer_default(unique) -] -interface ICloneViewHelper : IUnknown -{ - HRESULT GetConnectedIDs( [in] LPCWSTR wszAdaptorName, - [in,out] ULONG * pulCount, - [in,out] ULONG * pulID, - [in] ULONG ulFlags); - HRESULT GetActiveTopology([in] LPCWSTR wszAdaptorName, - [in] ULONG ulSourceID, - [in,out] ULONG * pulCount, - [in,out] ULONG * pulTargetID); - HRESULT SetActiveTopology([in] LPCWSTR wszAdaptorName, - [in] ULONG ulSourceID, - [in] ULONG ulCount, - [in] ULONG * pulTargetID); - HRESULT Commit( [in] BOOL fFinalCall); -}; - -[ - object, - uuid(E85CCEF5-AAAA-47f0-B5E3-61F7AECDC4C1), - nonextensible, - helpstring("IViewHelper Interface"), - pointer_default(unique) -] -interface IViewHelper : IUnknown -{ - HRESULT GetConnectedIDs( [in] LPCWSTR wszAdaptorName, - [in,out] ULONG * pulCount, - [in,out] ULONG * pulID, - [in] ULONG ulFlags); - HRESULT GetActiveTopology([in] LPCWSTR wszAdaptorName, - [in] ULONG ulSourceID, - [in,out] ULONG * pulCount, - [in,out] ULONG * pulTargetID); - HRESULT SetActiveTopology([in] LPCWSTR wszAdaptorName, - [in] ULONG ulSourceID, - [in] ULONG ulCount, - [in] ULONG * pulTargetID); - HRESULT Commit(); - HRESULT SetConfiguration( [in] IStream * pIStream, - [out] ULONG * pulStatus); - HRESULT GetProceedOnNewConfiguration(); -}; - diff --git a/qt-correction-tool/pub/ddk/codecapi.h b/qt-correction-tool/pub/ddk/codecapi.h deleted file mode 100644 index ca70835..0000000 --- a/qt-correction-tool/pub/ddk/codecapi.h +++ /dev/null @@ -1,1940 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - codecapi.h - -Abstract: - - CodecAPI Definitions. - ---*/ - -#ifndef __CODECAPI_H -#define __CODECAPI_H - -#ifdef UUID_GEN - #define DEFINE_CODECAPI_GUID( name, guidstr, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11 ) \ - OUR_GUID_ENTRY( CODECAPI_##name, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11 ) -#else - #if !defined(_KS_) - #error KS.H must be included before codecapi.H - #endif // !defined(_KS_) - -/* Ideally we would like: - #define DEFINE_CODECAPI_GUID( name, guidstr, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11 ) \ - #define STATIC_CODECAPI_##name 0x##g1, 0x##g2, 0x##g3, 0x##g4, 0x##g5, 0x##g6, 0x##g7, 0x##g8, 0x##g9, 0x##g10, 0x##g11 - DEFINE_GUIDSTRUCT( guidstr, CODECAPI_##name ) - #define CODECAPI_##name DEFINE_GUIDNAMED( CODECAPI_##name ) - Unfortunately you can't invoke multiple defines from a single statement -*/ - #define DEFINE_CODECAPI_GUID( name, guidstr, g1, g2, g3, g4, g5, g6, g7, g8, g9, g10, g11 ) DEFINE_GUIDSTRUCT( guidstr, CODECAPI_##name ); - #define DEFINE_CODECAPI_GUIDNAMED( name ) DEFINE_GUIDNAMED( CODECAPI_##name ) -#endif - -// Windows CodecAPI Properties - -// Legend for the -// Reference VariantType VariantField -// UINT8 VT_UI1 bVal -// UINT16 VT_UI2 uiVal -// UINT32 VT_UI4 ulVal -// UINT64 VT_UI8 ullVal -// INT8 VT_I1 eVal -// INT16 VT_I2 iVal -// INT32 VT_I4 lVal -// INT64 VT_I8 llVal -// BOOL VT_BOOL boolVal -// GUID VT_BSTR bstrVal (guid string) -// UINT32/UNINT32 VT_UI8 ullVal (ratio) - -// { Static definitions - #define STATIC_CODECAPI_AVEncCommonFormatConstraint 0x57cbb9b8, 0x116f, 0x4951, 0xb4, 0x0c, 0xc2, 0xa0, 0x35, 0xed, 0x8f, 0x17 - #define STATIC_CODECAPI_GUID_AVEncCommonFormatUnSpecified 0xaf46a35a, 0x6024, 0x4525, 0xa4, 0x8a, 0x09, 0x4b, 0x97, 0xf5, 0xb3, 0xc2 - #define STATIC_CODECAPI_GUID_AVEncCommonFormatDVD_V 0xcc9598c4, 0xe7fe, 0x451d, 0xb1, 0xca, 0x76, 0x1b, 0xc8, 0x40, 0xb7, 0xf3 - #define STATIC_CODECAPI_GUID_AVEncCommonFormatDVD_DashVR 0xe55199d6, 0x044c, 0x4dae, 0xa4, 0x88, 0x53, 0x1e, 0xd3, 0x06, 0x23, 0x5b - #define STATIC_CODECAPI_GUID_AVEncCommonFormatDVD_PlusVR 0xe74c6f2e, 0xec37, 0x478d, 0x9a, 0xf4, 0xa5, 0xe1, 0x35, 0xb6, 0x27, 0x1c - #define STATIC_CODECAPI_GUID_AVEncCommonFormatVCD 0x95035bf7, 0x9d90, 0x40ff, 0xad, 0x5c, 0x5c, 0xf8, 0xcf, 0x71, 0xca, 0x1d - #define STATIC_CODECAPI_GUID_AVEncCommonFormatSVCD 0x51d85818, 0x8220, 0x448c, 0x80, 0x66, 0xd6, 0x9b, 0xed, 0x16, 0xc9, 0xad - #define STATIC_CODECAPI_GUID_AVEncCommonFormatATSC 0x8d7b897c, 0xa019, 0x4670, 0xaa, 0x76, 0x2e, 0xdc, 0xac, 0x7a, 0xc2, 0x96 - #define STATIC_CODECAPI_GUID_AVEncCommonFormatDVB 0x71830d8f, 0x6c33, 0x430d, 0x84, 0x4b, 0xc2, 0x70, 0x5b, 0xaa, 0xe6, 0xdb - #define STATIC_CODECAPI_GUID_AVEncCommonFormatMP3 0x349733cd, 0xeb08, 0x4dc2, 0x81, 0x97, 0xe4, 0x98, 0x35, 0xef, 0x82, 0x8b - #define STATIC_CODECAPI_GUID_AVEncCommonFormatHighMAT 0x1eabe760, 0xfb2b, 0x4928, 0x90, 0xd1, 0x78, 0xdb, 0x88, 0xee, 0xe8, 0x89 - #define STATIC_CODECAPI_GUID_AVEncCommonFormatHighMPV 0xa2d25db8, 0xb8f9, 0x42c2, 0x8b, 0xc7, 0x0b, 0x93, 0xcf, 0x60, 0x47, 0x88 - #define STATIC_CODECAPI_AVEncCodecType 0x08af4ac1, 0xf3f2, 0x4c74, 0x9d, 0xcf, 0x37, 0xf2, 0xec, 0x79, 0xf8, 0x26 - #define STATIC_CODECAPI_GUID_AVEncMPEG1Video 0xc8dafefe, 0xda1e, 0x4774, 0xb2, 0x7d, 0x11, 0x83, 0x0c, 0x16, 0xb1, 0xfe - #define STATIC_CODECAPI_GUID_AVEncMPEG2Video 0x046dc19a, 0x6677, 0x4aaa, 0xa3, 0x1d, 0xc1, 0xab, 0x71, 0x6f, 0x45, 0x60 - #define STATIC_CODECAPI_GUID_AVEncMPEG1Audio 0xd4dd1362, 0xcd4a, 0x4cd6, 0x81, 0x38, 0xb9, 0x4d, 0xb4, 0x54, 0x2b, 0x04 - #define STATIC_CODECAPI_GUID_AVEncMPEG2Audio 0xee4cbb1f, 0x9c3f, 0x4770, 0x92, 0xb5, 0xfc, 0xb7, 0xc2, 0xa8, 0xd3, 0x81 - #define STATIC_CODECAPI_GUID_AVEncWMV 0x4e0fef9b, 0x1d43, 0x41bd, 0xb8, 0xbd, 0x4d, 0x7b, 0xf7, 0x45, 0x7a, 0x2a - #define STATIC_CODECAPI_GUID_AVEndMPEG4Video 0xdd37b12a, 0x9503, 0x4f8b, 0xb8, 0xd0, 0x32, 0x4a, 0x00, 0xc0, 0xa1, 0xcf - #define STATIC_CODECAPI_GUID_AVEncH264Video 0x95044eab, 0x31b3, 0x47de, 0x8e, 0x75, 0x38, 0xa4, 0x2b, 0xb0, 0x3e, 0x28 - #define STATIC_CODECAPI_GUID_AVEncDV 0x09b769c7, 0x3329, 0x44fb, 0x89, 0x54, 0xfa, 0x30, 0x93, 0x7d, 0x3d, 0x5a - #define STATIC_CODECAPI_GUID_AVEncWMAPro 0x1955f90c, 0x33f7, 0x4a68, 0xab, 0x81, 0x53, 0xf5, 0x65, 0x71, 0x25, 0xc4 - #define STATIC_CODECAPI_GUID_AVEncWMALossless 0x55ca7265, 0x23d8, 0x4761, 0x90, 0x31, 0xb7, 0x4f, 0xbe, 0x12, 0xf4, 0xc1 - #define STATIC_CODECAPI_GUID_AVEncWMAVoice 0x13ed18cb, 0x50e8, 0x4276, 0xa2, 0x88, 0xa6, 0xaa, 0x22, 0x83, 0x82, 0xd9 - #define STATIC_CODECAPI_GUID_AVEncDolbyDigitalPro 0xf5be76cc, 0x0ff8, 0x40eb, 0x9c, 0xb1, 0xbb, 0xa9, 0x40, 0x04, 0xd4, 0x4f - #define STATIC_CODECAPI_GUID_AVEncDolbyDigitalConsumer 0xc1a7bf6c, 0x0059, 0x4bfa, 0x94, 0xef, 0xef, 0x74, 0x7a, 0x76, 0x8d, 0x52 - #define STATIC_CODECAPI_GUID_AVEncDolbyDigitalPlus 0x698d1b80, 0xf7dd, 0x415c, 0x97, 0x1c, 0x42, 0x49, 0x2a, 0x20, 0x56, 0xc6 - #define STATIC_CODECAPI_GUID_AVEncDTSHD 0x2052e630, 0x469d, 0x4bfb, 0x80, 0xca, 0x1d, 0x65, 0x6e, 0x7e, 0x91, 0x8f - #define STATIC_CODECAPI_GUID_AVEncDTS 0x45fbcaa2, 0x5e6e, 0x4ab0, 0x88, 0x93, 0x59, 0x03, 0xbe, 0xe9, 0x3a, 0xcf - #define STATIC_CODECAPI_GUID_AVEncMLP 0x05f73e29, 0xf0d1, 0x431e, 0xa4, 0x1c, 0xa4, 0x74, 0x32, 0xec, 0x5a, 0x66 - #define STATIC_CODECAPI_GUID_AVEncPCM 0x844be7f4, 0x26cf, 0x4779, 0xb3, 0x86, 0xcc, 0x05, 0xd1, 0x87, 0x99, 0x0c - #define STATIC_CODECAPI_GUID_AVEncSDDS 0x1dc1b82f, 0x11c8, 0x4c71, 0xb7, 0xb6, 0xee, 0x3e, 0xb9, 0xbc, 0x2b, 0x94 - #define STATIC_CODECAPI_AVEncCommonRateControlMode 0x1c0608e9, 0x370c, 0x4710, 0x8a, 0x58, 0xcb, 0x61, 0x81, 0xc4, 0x24, 0x23 - #define STATIC_CODECAPI_AVEncCommonLowLatency 0x9d3ecd55, 0x89e8, 0x490a, 0x97, 0x0a, 0x0c, 0x95, 0x48, 0xd5, 0xa5, 0x6e - #define STATIC_CODECAPI_AVEncCommonMultipassMode 0x22533d4c, 0x47e1, 0x41b5, 0x93, 0x52, 0xa2, 0xb7, 0x78, 0x0e, 0x7a, 0xc4 - #define STATIC_CODECAPI_AVEncCommonPassStart 0x6a67739f, 0x4eb5, 0x4385, 0x99, 0x28, 0xf2, 0x76, 0xa9, 0x39, 0xef, 0x95 - #define STATIC_CODECAPI_AVEncCommonPassEnd 0x0e3d01bc, 0xc85c, 0x467d, 0x8b, 0x60, 0xc4, 0x10, 0x12, 0xee, 0x3b, 0xf6 - #define STATIC_CODECAPI_AVEncCommonRealTime 0x143a0ff6, 0xa131, 0x43da, 0xb8, 0x1e, 0x98, 0xfb, 0xb8, 0xec, 0x37, 0x8e - #define STATIC_CODECAPI_AVEncCommonQuality 0xfcbf57a3, 0x7ea5, 0x4b0c, 0x96, 0x44, 0x69, 0xb4, 0x0c, 0x39, 0xc3, 0x91 - #define STATIC_CODECAPI_AVEncCommonQualityVsSpeed 0x98332df8, 0x03cd, 0x476b, 0x89, 0xfa, 0x3f, 0x9e, 0x44, 0x2d, 0xec, 0x9f - #define STATIC_CODECAPI_AVEncCommonMeanBitRate 0xf7222374, 0x2144, 0x4815, 0xb5, 0x50, 0xa3, 0x7f, 0x8e, 0x12, 0xee, 0x52 - #define STATIC_CODECAPI_AVEncCommonMeanBitRateInterval 0xbfaa2f0c, 0xcb82, 0x4bc0, 0x84, 0x74, 0xf0, 0x6a, 0x8a, 0x0d, 0x02, 0x58 - #define STATIC_CODECAPI_AVEncCommonMaxBitRate 0x9651eae4, 0x39b9, 0x4ebf, 0x85, 0xef, 0xd7, 0xf4, 0x44, 0xec, 0x74, 0x65 - #define STATIC_CODECAPI_AVEncCommonMinBitRate 0x101405b2, 0x2083, 0x4034, 0xa8, 0x06, 0xef, 0xbe, 0xdd, 0xd7, 0xc9, 0xff - #define STATIC_CODECAPI_AVEncCommonBufferSize 0x0db96574, 0xb6a4, 0x4c8b, 0x81, 0x06, 0x37, 0x73, 0xde, 0x03, 0x10, 0xcd - #define STATIC_CODECAPI_AVEncCommonBufferInLevel 0xd9c5c8db, 0xfc74, 0x4064, 0x94, 0xe9, 0xcd, 0x19, 0xf9, 0x47, 0xed, 0x45 - #define STATIC_CODECAPI_AVEncCommonBufferOutLevel 0xccae7f49, 0xd0bc, 0x4e3d, 0xa5, 0x7e, 0xfb, 0x57, 0x40, 0x14, 0x00, 0x69 - #define STATIC_CODECAPI_AVEncCommonStreamEndHandling 0x6aad30af, 0x6ba8, 0x4ccc, 0x8f, 0xca, 0x18, 0xd1, 0x9b, 0xea, 0xeb, 0x1c - #define STATIC_CODECAPI_AVEncStatCommonCompletedPasses 0x3e5de533, 0x9df7, 0x438c, 0x85, 0x4f, 0x9f, 0x7d, 0xd3, 0x68, 0x3d, 0x34 - #define STATIC_CODECAPI_AVEncVideoOutputFrameRate 0xea85e7c3, 0x9567, 0x4d99, 0x87, 0xc4, 0x02, 0xc1, 0xc2, 0x78, 0xca, 0x7c - #define STATIC_CODECAPI_AVEncVideoOutputFrameRateConversion 0x8c068bf4, 0x369a, 0x4ba3, 0x82, 0xfd, 0xb2, 0x51, 0x8f, 0xb3, 0x39, 0x6e - #define STATIC_CODECAPI_AVEncVideoPixelAspectRatio 0x3cdc718f, 0xb3e9, 0x4eb6, 0xa5, 0x7f, 0xcf, 0x1f, 0x1b, 0x32, 0x1b, 0x87 - #define STATIC_CODECAPI_AVEncVideoForceSourceScanType 0x1ef2065f, 0x058a, 0x4765, 0xa4, 0xfc, 0x8a, 0x86, 0x4c, 0x10, 0x30, 0x12 - #define STATIC_CODECAPI_AVEncVideoNoOfFieldsToEncode 0x61e4bbe2, 0x4ee0, 0x40e7, 0x80, 0xab, 0x51, 0xdd, 0xee, 0xbe, 0x62, 0x91 - #define STATIC_CODECAPI_AVEncVideoNoOfFieldsToSkip 0xa97e1240, 0x1427, 0x4c16, 0xa7, 0xf7, 0x3d, 0xcf, 0xd8, 0xba, 0x4c, 0xc5 - #define STATIC_CODECAPI_AVEncVideoEncodeDimension 0x1074df28, 0x7e0f, 0x47a4, 0xa4, 0x53, 0xcd, 0xd7, 0x38, 0x70, 0xf5, 0xce - #define STATIC_CODECAPI_AVEncVideoEncodeOffsetOrigin 0x6bc098fe, 0xa71a, 0x4454, 0x85, 0x2e, 0x4d, 0x2d, 0xde, 0xb2, 0xcd, 0x24 - #define STATIC_CODECAPI_AVEncVideoDisplayDimension 0xde053668, 0xf4ec, 0x47a9, 0x86, 0xd0, 0x83, 0x67, 0x70, 0xf0, 0xc1, 0xd5 - #define STATIC_CODECAPI_AVEncVideoOutputScanType 0x460b5576, 0x842e, 0x49ab, 0xa6, 0x2d, 0xb3, 0x6f, 0x73, 0x12, 0xc9, 0xdb - #define STATIC_CODECAPI_AVEncVideoInverseTelecineEnable 0x2ea9098b, 0xe76d, 0x4ccd, 0xa0, 0x30, 0xd3, 0xb8, 0x89, 0xc1, 0xb6, 0x4c - #define STATIC_CODECAPI_AVEncVideoInverseTelecineThreshold 0x40247d84, 0xe895, 0x497f, 0xb4, 0x4c, 0xb7, 0x45, 0x60, 0xac, 0xfe, 0x27 - #define STATIC_CODECAPI_AVEncVideoSourceFilmContent 0x1791c64b, 0xccfc, 0x4827, 0xa0, 0xed, 0x25, 0x57, 0x79, 0x3b, 0x2b, 0x1c - #define STATIC_CODECAPI_AVEncVideoSourceIsBW 0x42ffc49b, 0x1812, 0x4fdc, 0x8d, 0x24, 0x70, 0x54, 0xc5, 0x21, 0xe6, 0xeb - #define STATIC_CODECAPI_AVEncVideoFieldSwap 0xfefd7569, 0x4e0a, 0x49f2, 0x9f, 0x2b, 0x36, 0x0e, 0xa4, 0x8c, 0x19, 0xa2 - #define STATIC_CODECAPI_AVEncVideoInputChromaResolution 0xbb0cec33, 0x16f1, 0x47b0, 0x8a, 0x88, 0x37, 0x81, 0x5b, 0xee, 0x17, 0x39 - #define STATIC_CODECAPI_AVEncVideoOutputChromaResolution 0x6097b4c9, 0x7c1d, 0x4e64, 0xbf, 0xcc, 0x9e, 0x97, 0x65, 0x31, 0x8a, 0xe7 - #define STATIC_CODECAPI_AVEncVideoInputChromaSubsampling 0xa8e73a39, 0x4435, 0x4ec3, 0xa6, 0xea, 0x98, 0x30, 0x0f, 0x4b, 0x36, 0xf7 - #define STATIC_CODECAPI_AVEncVideoOutputChromaSubsampling 0xfa561c6c, 0x7d17, 0x44f0, 0x83, 0xc9, 0x32, 0xed, 0x12, 0xe9, 0x63, 0x43 - #define STATIC_CODECAPI_AVEncVideoInputColorPrimaries 0xc24d783f, 0x7ce6, 0x4278, 0x90, 0xab, 0x28, 0xa4, 0xf1, 0xe5, 0xf8, 0x6c - #define STATIC_CODECAPI_AVEncVideoOutputColorPrimaries 0xbe95907c, 0x9d04, 0x4921, 0x89, 0x85, 0xa6, 0xd6, 0xd8, 0x7d, 0x1a, 0x6c - #define STATIC_CODECAPI_AVEncVideoInputColorTransferFunction 0x8c056111, 0xa9c3, 0x4b08, 0xa0, 0xa0, 0xce, 0x13, 0xf8, 0xa2, 0x7c, 0x75 - #define STATIC_CODECAPI_AVEncVideoOutputColorTransferFunction 0x4a7f884a, 0xea11, 0x460d, 0xbf, 0x57, 0xb8, 0x8b, 0xc7, 0x59, 0x00, 0xde - #define STATIC_CODECAPI_AVEncVideoInputColorTransferMatrix 0x52ed68b9, 0x72d5, 0x4089, 0x95, 0x8d, 0xf5, 0x40, 0x5d, 0x55, 0x08, 0x1c - #define STATIC_CODECAPI_AVEncVideoOutputColorTransferMatrix 0xa9b90444, 0xaf40, 0x4310, 0x8f, 0xbe, 0xed, 0x6d, 0x93, 0x3f, 0x89, 0x2b - #define STATIC_CODECAPI_AVEncVideoInputColorLighting 0x46a99549, 0x0015, 0x4a45, 0x9c, 0x30, 0x1d, 0x5c, 0xfa, 0x25, 0x83, 0x16 - #define STATIC_CODECAPI_AVEncVideoOutputColorLighting 0x0e5aaac6, 0xace6, 0x4c5c, 0x99, 0x8e, 0x1a, 0x8c, 0x9c, 0x6c, 0x0f, 0x89 - #define STATIC_CODECAPI_AVEncVideoInputColorNominalRange 0x16cf25c6, 0xa2a6, 0x48e9, 0xae, 0x80, 0x21, 0xae, 0xc4, 0x1d, 0x42, 0x7e - #define STATIC_CODECAPI_AVEncVideoOutputColorNominalRange 0x972835ed, 0x87b5, 0x4e95, 0x95, 0x00, 0xc7, 0x39, 0x58, 0x56, 0x6e, 0x54 - #define STATIC_CODECAPI_AVEncInputVideoSystem 0xbede146d, 0xb616, 0x4dc7, 0x92, 0xb2, 0xf5, 0xd9, 0xfa, 0x92, 0x98, 0xf7 - #define STATIC_CODECAPI_AVEncVideoHeaderDropFrame 0x6ed9e124, 0x7925, 0x43fe, 0x97, 0x1b, 0xe0, 0x19, 0xf6, 0x22, 0x22, 0xb4 - #define STATIC_CODECAPI_AVEncVideoHeaderHours 0x2acc7702, 0xe2da, 0x4158, 0xbf, 0x9b, 0x88, 0x88, 0x01, 0x29, 0xd7, 0x40 - #define STATIC_CODECAPI_AVEncVideoHeaderMinutes 0xdc1a99ce, 0x0307, 0x408b, 0x88, 0x0b, 0xb8, 0x34, 0x8e, 0xe8, 0xca, 0x7f - #define STATIC_CODECAPI_AVEncVideoHeaderSeconds 0x4a2e1a05, 0xa780, 0x4f58, 0x81, 0x20, 0x9a, 0x44, 0x9d, 0x69, 0x65, 0x6b - #define STATIC_CODECAPI_AVEncVideoHeaderFrames 0xafd5f567, 0x5c1b, 0x4adc, 0xbd, 0xaf, 0x73, 0x56, 0x10, 0x38, 0x14, 0x36 - #define STATIC_CODECAPI_AVEncVideoDefaultUpperFieldDominant 0x810167c4, 0x0bc1, 0x47ca, 0x8f, 0xc2, 0x57, 0x05, 0x5a, 0x14, 0x74, 0xa5 - #define STATIC_CODECAPI_AVEncVideoCBRMotionTradeoff 0x0d49451e, 0x18d5, 0x4367, 0xa4, 0xef, 0x32, 0x40, 0xdf, 0x16, 0x93, 0xc4 - #define STATIC_CODECAPI_AVEncVideoCodedVideoAccessUnitSize 0xb4b10c15, 0x14a7, 0x4ce8, 0xb1, 0x73, 0xdc, 0x90, 0xa0, 0xb4, 0xfc, 0xdb - #define STATIC_CODECAPI_AVEncVideoMaxKeyframeDistance 0x2987123a, 0xba93, 0x4704, 0xb4, 0x89, 0xec, 0x1e, 0x5f, 0x25, 0x29, 0x2c - - #define STATIC_CODECAPI_AVEncMuxOutputStreamType 0xcedd9e8f, 0x34d3, 0x44db, 0xa1, 0xd8, 0xf8, 0x15, 0x20, 0x25, 0x4f, 0x3e - - #define STATIC_CODECAPI_AVEncStatVideoOutputFrameRate 0xbe747849, 0x9ab4, 0x4a63, 0x98, 0xfe, 0xf1, 0x43, 0xf0, 0x4f, 0x8e, 0xe9 - #define STATIC_CODECAPI_AVEncStatVideoCodedFrames 0xd47f8d61, 0x6f5a, 0x4a26, 0xbb, 0x9f, 0xcd, 0x95, 0x18, 0x46, 0x2b, 0xcd - #define STATIC_CODECAPI_AVEncStatVideoTotalFrames 0xfdaa9916, 0x119a, 0x4222, 0x9a, 0xd6, 0x3f, 0x7c, 0xab, 0x99, 0xcc, 0x8b - #define STATIC_CODECAPI_AVEncAudioIntervalToEncode 0x866e4b4d, 0x725a, 0x467c, 0xbb, 0x01, 0xb4, 0x96, 0xb2, 0x3b, 0x25, 0xf9 - #define STATIC_CODECAPI_AVEncAudioIntervalToSkip 0x88c15f94, 0xc38c, 0x4796, 0xa9, 0xe8, 0x96, 0xe9, 0x67, 0x98, 0x3f, 0x26 - #define STATIC_CODECAPI_AVEncAudioDualMono 0x3648126b, 0xa3e8, 0x4329, 0x9b, 0x3a, 0x5c, 0xe5, 0x66, 0xa4, 0x3b, 0xd3 - #define STATIC_CODECAPI_AVEncAudioMeanBitRate 0x921295bb, 0x4fca, 0x4679, 0xaa, 0xb8, 0x9e, 0x2a, 0x1d, 0x75, 0x33, 0x84 - - #define STATIC_CODECAPI_AVEncAudioMapDestChannel0 0xbc5d0b60, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel1 0xbc5d0b61, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel2 0xbc5d0b62, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel3 0xbc5d0b63, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel4 0xbc5d0b64, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel5 0xbc5d0b65, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel6 0xbc5d0b66, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel7 0xbc5d0b67, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel8 0xbc5d0b68, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel9 0xbc5d0b69, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel10 0xbc5d0b6a, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel11 0xbc5d0b6b, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel12 0xbc5d0b6c, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel13 0xbc5d0b6d, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel14 0xbc5d0b6e, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - #define STATIC_CODECAPI_AVEncAudioMapDestChannel15 0xbc5d0b6f, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d - - #define STATIC_CODECAPI_AVEncAudioInputContent 0x3e226c2b, 0x60b9, 0x4a39, 0xb0, 0x0b, 0xa7, 0xb4, 0x0f, 0x70, 0xd5, 0x66 - #define STATIC_CODECAPI_AVEncStatAudioPeakPCMValue 0xdce7fd34, 0xdc00, 0x4c16, 0x82, 0x1b, 0x35, 0xd9, 0xeb, 0x00, 0xfb, 0x1a - #define STATIC_CODECAPI_AVEncStatAudioAveragePCMValue 0x979272f8, 0xd17f, 0x4e32, 0xbb, 0x73, 0x4e, 0x73, 0x1c, 0x68, 0xba, 0x2d - #define STATIC_CODECAPI_AVEncStatAudioAverageBPS 0xca6724db, 0x7059, 0x4351, 0x8b, 0x43, 0xf8, 0x21, 0x98, 0x82, 0x6a, 0x14 - #define STATIC_CODECAPI_AVEncStatAverageBPS 0xca6724db, 0x7059, 0x4351, 0x8b, 0x43, 0xf8, 0x21, 0x98, 0x82, 0x6a, 0x14 - #define STATIC_CODECAPI_AVEncStatHardwareProcessorUtilitization 0x995dc027, 0xcb95, 0x49e6, 0xb9, 0x1b, 0x59, 0x67, 0x75, 0x3c, 0xdc, 0xb8 - #define STATIC_CODECAPI_AVEncStatHardwareBandwidthUtilitization 0x0124ba9b, 0xdc41, 0x4826, 0xb4, 0x5f, 0x18, 0xac, 0x01, 0xb3, 0xd5, 0xa8 - #define STATIC_CODECAPI_AVEncMPVGOPSize 0x95f31b26, 0x95a4, 0x41aa, 0x93, 0x03, 0x24, 0x6a, 0x7f, 0xc6, 0xee, 0xf1 - #define STATIC_CODECAPI_AVEncMPVGOPOpen 0xb1d5d4a6, 0x3300, 0x49b1, 0xae, 0x61, 0xa0, 0x99, 0x37, 0xab, 0x0e, 0x49 - #define STATIC_CODECAPI_AVEncMPVDefaultBPictureCount 0x8d390aac, 0xdc5c, 0x4200, 0xb5, 0x7f, 0x81, 0x4d, 0x04, 0xba, 0xba, 0xb2 - #define STATIC_CODECAPI_AVEncMPVProfile 0xdabb534a, 0x1d99, 0x4284, 0x97, 0x5a, 0xd9, 0x0e, 0x22, 0x39, 0xba, 0xa1 - #define STATIC_CODECAPI_AVEncMPVLevel 0x6ee40c40, 0xa60c, 0x41ef, 0x8f, 0x50, 0x37, 0xc2, 0x24, 0x9e, 0x2c, 0xb3 - #define STATIC_CODECAPI_AVEncMPVFrameFieldMode 0xacb5de96, 0x7b93, 0x4c2f, 0x88, 0x25, 0xb0, 0x29, 0x5f, 0xa9, 0x3b, 0xf4 - #define STATIC_CODECAPI_AVEncMPVAddSeqEndCode 0xa823178f, 0x57df, 0x4c7a, 0xb8, 0xfd, 0xe5, 0xec, 0x88, 0x87, 0x70, 0x8d - #define STATIC_CODECAPI_AVEncMPVGOPSInSeq 0x993410d4, 0x2691, 0x4192, 0x99, 0x78, 0x98, 0xdc, 0x26, 0x03, 0x66, 0x9f - #define STATIC_CODECAPI_AVEncMPVUseConcealmentMotionVectors 0xec770cf3, 0x6908, 0x4b4b, 0xaa, 0x30, 0x7f, 0xb9, 0x86, 0x21, 0x4f, 0xea - #define STATIC_CODECAPI_AVEncMPVSceneDetection 0x552799f1, 0xdb4c, 0x405b, 0x8a, 0x3a, 0xc9, 0x3f, 0x2d, 0x06, 0x74, 0xdc - #define STATIC_CODECAPI_AVEncMPVGenerateHeaderSeqExt 0xd5e78611, 0x082d, 0x4e6b, 0x98, 0xaf, 0x0f, 0x51, 0xab, 0x13, 0x92, 0x22 - #define STATIC_CODECAPI_AVEncMPVGenerateHeaderSeqDispExt 0x6437aa6f, 0x5a3c, 0x4de9, 0x8a, 0x16, 0x53, 0xd9, 0xc4, 0xad, 0x32, 0x6f - #define STATIC_CODECAPI_AVEncMPVGenerateHeaderPicExt 0x1b8464ab, 0x944f, 0x45f0, 0xb7, 0x4e, 0x3a, 0x58, 0xda, 0xd1, 0x1f, 0x37 - #define STATIC_CODECAPI_AVEncMPVGenerateHeaderPicDispExt 0xc6412f84, 0xc03f, 0x4f40, 0xa0, 0x0c, 0x42, 0x93, 0xdf, 0x83, 0x95, 0xbb - #define STATIC_CODECAPI_AVEncMPVGenerateHeaderSeqScaleExt 0x0722d62f, 0xdd59, 0x4a86, 0x9c, 0xd5, 0x64, 0x4f, 0x8e, 0x26, 0x53, 0xd8 - #define STATIC_CODECAPI_AVEncMPVScanPattern 0x7f8a478e, 0x7bbb, 0x4ae2, 0xb2, 0xfc, 0x96, 0xd1, 0x7f, 0xc4, 0xa2, 0xd6 - #define STATIC_CODECAPI_AVEncMPVIntraDCPrecision 0xa0116151, 0xcbc8, 0x4af3, 0x97, 0xdc, 0xd0, 0x0c, 0xce, 0xb8, 0x2d, 0x79 - #define STATIC_CODECAPI_AVEncMPVQScaleType 0x2b79ebb7, 0xf484, 0x4af7, 0xbb, 0x58, 0xa2, 0xa1, 0x88, 0xc5, 0xcb, 0xbe - #define STATIC_CODECAPI_AVEncMPVIntraVLCTable 0xa2b83ff5, 0x1a99, 0x405a, 0xaf, 0x95, 0xc5, 0x99, 0x7d, 0x55, 0x8d, 0x3a - #define STATIC_CODECAPI_AVEncMPVQuantMatrixIntra 0x9bea04f3, 0x6621, 0x442c, 0x8b, 0xa1, 0x3a, 0xc3, 0x78, 0x97, 0x96, 0x98 - #define STATIC_CODECAPI_AVEncMPVQuantMatrixNonIntra 0x87f441d8, 0x0997, 0x4beb, 0xa0, 0x8e, 0x85, 0x73, 0xd4, 0x09, 0xcf, 0x75 - #define STATIC_CODECAPI_AVEncMPVQuantMatrixChromaIntra 0x9eb9ecd4, 0x018d, 0x4ffd, 0x8f, 0x2d, 0x39, 0xe4, 0x9f, 0x07, 0xb1, 0x7a - #define STATIC_CODECAPI_AVEncMPVQuantMatrixChromaNonIntra 0x1415b6b1, 0x362a, 0x4338, 0xba, 0x9a, 0x1e, 0xf5, 0x87, 0x03, 0xc0, 0x5b - #define STATIC_CODECAPI_AVEncMPALayer 0x9d377230, 0xf91b, 0x453d, 0x9c, 0xe0, 0x78, 0x44, 0x54, 0x14, 0xc2, 0x2d - #define STATIC_CODECAPI_AVEncMPACodingMode 0xb16ade03, 0x4b93, 0x43d7, 0xa5, 0x50, 0x90, 0xb4, 0xfe, 0x22, 0x45, 0x37 - #define STATIC_CODECAPI_AVEncDDService 0xd2e1bec7, 0x5172, 0x4d2a, 0xa5, 0x0e, 0x2f, 0x3b, 0x82, 0xb1, 0xdd, 0xf8 - #define STATIC_CODECAPI_AVEncDDDialogNormalization 0xd7055acf, 0xf125, 0x437d, 0xa7, 0x04, 0x79, 0xc7, 0x9f, 0x04, 0x04, 0xa8 - #define STATIC_CODECAPI_AVEncDDCentreDownMixLevel 0xe285072c, 0xc958, 0x4a81, 0xaf, 0xd2, 0xe5, 0xe0, 0xda, 0xf1, 0xb1, 0x48 - #define STATIC_CODECAPI_AVEncDDSurroundDownMixLevel 0x7b20d6e5, 0x0bcf, 0x4273, 0xa4, 0x87, 0x50, 0x6b, 0x04, 0x79, 0x97, 0xe9 - #define STATIC_CODECAPI_AVEncDDProductionInfoExists 0xb0b7fe5f, 0xb6ab, 0x4f40, 0x96, 0x4d, 0x8d, 0x91, 0xf1, 0x7c, 0x19, 0xe8 - #define STATIC_CODECAPI_AVEncDDProductionRoomType 0xdad7ad60, 0x23d8, 0x4ab7, 0xa2, 0x84, 0x55, 0x69, 0x86, 0xd8, 0xa6, 0xfe - #define STATIC_CODECAPI_AVEncDDProductionMixLevel 0x301d103a, 0xcbf9, 0x4776, 0x88, 0x99, 0x7c, 0x15, 0xb4, 0x61, 0xab, 0x26 - #define STATIC_CODECAPI_AVEncDDCopyright 0x8694f076, 0xcd75, 0x481d, 0xa5, 0xc6, 0xa9, 0x04, 0xdc, 0xc8, 0x28, 0xf0 - #define STATIC_CODECAPI_AVEncDDOriginalBitstream 0x966ae800, 0x5bd3, 0x4ff9, 0x95, 0xb9, 0xd3, 0x05, 0x66, 0x27, 0x38, 0x56 - #define STATIC_CODECAPI_AVEncDDDigitalDeemphasis 0xe024a2c2, 0x947c, 0x45ac, 0x87, 0xd8, 0xf1, 0x03, 0x0c, 0x5c, 0x00, 0x82 - #define STATIC_CODECAPI_AVEncDDDCHighPassFilter 0x9565239f, 0x861c, 0x4ac8, 0xbf, 0xda, 0xe0, 0x0c, 0xb4, 0xdb, 0x85, 0x48 - #define STATIC_CODECAPI_AVEncDDChannelBWLowPassFilter 0xe197821d, 0xd2e7, 0x43e2, 0xad, 0x2c, 0x00, 0x58, 0x2f, 0x51, 0x85, 0x45 - #define STATIC_CODECAPI_AVEncDDLFELowPassFilter 0xd3b80f6f, 0x9d15, 0x45e5, 0x91, 0xbe, 0x01, 0x9c, 0x3f, 0xab, 0x1f, 0x01 - #define STATIC_CODECAPI_AVEncDDSurround90DegreeePhaseShift 0x25ecec9d, 0x3553, 0x42c0, 0xbb, 0x56, 0xd2, 0x57, 0x92, 0x10, 0x4f, 0x80 - #define STATIC_CODECAPI_AVEncDDSurround3dBAttenuation 0x4d43b99d, 0x31e2, 0x48b9, 0xbf, 0x2e, 0x5c, 0xbf, 0x1a, 0x57, 0x27, 0x84 - #define STATIC_CODECAPI_AVEncDDDynamicRangeCompressionControl 0xcfc2ff6d, 0x79b8, 0x4b8d, 0xa8, 0xaa, 0xa0, 0xc9, 0xbd, 0x1c, 0x29, 0x40 - #define STATIC_CODECAPI_AVEncDDRFPreEmphasisFilter 0x21af44c0, 0x244e, 0x4f3d, 0xa2, 0xcc, 0x3d, 0x30, 0x68, 0xb2, 0xe7, 0x3f - #define STATIC_CODECAPI_AVEncDDSurroundExMode 0x91607cee, 0xdbdd, 0x4eb6, 0xbc, 0xa2, 0xaa, 0xdf, 0xaf, 0xa3, 0xdd, 0x68 - #define STATIC_CODECAPI_AVEncDDPreferredStereoDownMixMode 0x7f4e6b31, 0x9185, 0x403d, 0xb0, 0xa2, 0x76, 0x37, 0x43, 0xe6, 0xf0, 0x63 - #define STATIC_CODECAPI_AVEncDDLtRtCenterMixLvl_x10 0xdca128a2, 0x491f, 0x4600, 0xb2, 0xda, 0x76, 0xe3, 0x34, 0x4b, 0x41, 0x97 - #define STATIC_CODECAPI_AVEncDDLtRtSurroundMixLvl_x10 0x212246c7, 0x3d2c, 0x4dfa, 0xbc, 0x21, 0x65, 0x2a, 0x90, 0x98, 0x69, 0x0d - #define STATIC_CODECAPI_AVEncDDLoRoCenterMixLvl_x10 0x1cfba222, 0x25b3, 0x4bf4, 0x9b, 0xfd, 0xe7, 0x11, 0x12, 0x67, 0x85, 0x8c - #define STATIC_CODECAPI_AVEncDDLoRoSurroundMixLvl_x10 0xe725cff6, 0xeb56, 0x40c7, 0x84, 0x50, 0x2b, 0x93, 0x67, 0xe9, 0x15, 0x55 - #define STATIC_CODECAPI_AVEncDDAtoDConverterType 0x719f9612, 0x81a1, 0x47e0, 0x9a, 0x05, 0xd9, 0x4a, 0xd5, 0xfc, 0xa9, 0x48 - #define STATIC_CODECAPI_AVEncDDHeadphoneMode 0x4052dbec, 0x52f5, 0x42f5, 0x9b, 0x00, 0xd1, 0x34, 0xb1, 0x34, 0x1b, 0x9d - #define STATIC_CODECAPI_AVEncWMVKeyFrameDistance 0x5569055e, 0xe268, 0x4771, 0xb8, 0x3e, 0x95, 0x55, 0xea, 0x28, 0xae, 0xd3 - #define STATIC_CODECAPI_AVEncWMVInterlacedEncoding 0xe3d00f8a, 0xc6f5, 0x4e14, 0xa5, 0x88, 0x0e, 0xc8, 0x7a, 0x72, 0x6f, 0x9b - #define STATIC_CODECAPI_AVEncWMVDecoderComplexity 0xf32c0dab, 0xf3cb, 0x4217, 0xb7, 0x9f, 0x87, 0x62, 0x76, 0x8b, 0x5f, 0x67 - #define STATIC_CODECAPI_AVEncWMVKeyFrameBufferLevelMarker 0x51ff1115, 0x33ac, 0x426c, 0xa1, 0xb1, 0x09, 0x32, 0x1b, 0xdf, 0x96, 0xb4 - #define STATIC_CODECAPI_AVEncWMVProduceDummyFrames 0xd669d001, 0x183c, 0x42e3, 0xa3, 0xca, 0x2f, 0x45, 0x86, 0xd2, 0x39, 0x6c - #define STATIC_CODECAPI_AVEncStatWMVCBAvg 0x6aa6229f, 0xd602, 0x4b9d, 0xb6, 0x8c, 0xc1, 0xad, 0x78, 0x88, 0x4b, 0xef - #define STATIC_CODECAPI_AVEncStatWMVCBMax 0xe976bef8, 0x00fe, 0x44b4, 0xb6, 0x25, 0x8f, 0x23, 0x8b, 0xc0, 0x34, 0x99 - #define STATIC_CODECAPI_AVEncStatWMVDecoderComplexityProfile 0x89e69fc3, 0x0f9b, 0x436c, 0x97, 0x4a, 0xdf, 0x82, 0x12, 0x27, 0xc9, 0x0d - #define STATIC_CODECAPI_AVEncStatMPVSkippedEmptyFrames 0x32195fd3, 0x590d, 0x4812, 0xa7, 0xed, 0x6d, 0x63, 0x9a, 0x1f, 0x97, 0x11 - #define STATIC_CODECAPI_AVEncMP12PktzSTDBuffer 0x0b751bd0, 0x819e, 0x478c, 0x94, 0x35, 0x75, 0x20, 0x89, 0x26, 0xb3, 0x77 - #define STATIC_CODECAPI_AVEncMP12PktzStreamID 0xc834d038, 0xf5e8, 0x4408, 0x9b, 0x60, 0x88, 0xf3, 0x64, 0x93, 0xfe, 0xdf - #define STATIC_CODECAPI_AVEncMP12PktzInitialPTS 0x2a4f2065, 0x9a63, 0x4d20, 0xae, 0x22, 0x0a, 0x1b, 0xc8, 0x96, 0xa3, 0x15 - #define STATIC_CODECAPI_AVEncMP12PktzPacketSize 0xab71347a, 0x1332, 0x4dde, 0xa0, 0xe5, 0xcc, 0xf7, 0xda, 0x8a, 0x0f, 0x22 - #define STATIC_CODECAPI_AVEncMP12PktzCopyright 0xc8f4b0c1, 0x094c, 0x43c7, 0x8e, 0x68, 0xa5, 0x95, 0x40, 0x5a, 0x6e, 0xf8 - #define STATIC_CODECAPI_AVEncMP12PktzOriginal 0x6b178416, 0x31b9, 0x4964, 0x94, 0xcb, 0x6b, 0xff, 0x86, 0x6c, 0xdf, 0x83 - #define STATIC_CODECAPI_AVEncMP12MuxPacketOverhead 0xe40bd720, 0x3955, 0x4453, 0xac, 0xf9, 0xb7, 0x91, 0x32, 0xa3, 0x8f, 0xa0 - #define STATIC_CODECAPI_AVEncMP12MuxNumStreams 0xf7164a41, 0xdced, 0x4659, 0xa8, 0xf2, 0xfb, 0x69, 0x3f, 0x2a, 0x4c, 0xd0 - #define STATIC_CODECAPI_AVEncMP12MuxEarliestPTS 0x157232b6, 0xf809, 0x474e, 0x94, 0x64, 0xa7, 0xf9, 0x30, 0x14, 0xa8, 0x17 - #define STATIC_CODECAPI_AVEncMP12MuxLargestPacketSize 0x35ceb711, 0xf461, 0x4b92, 0xa4, 0xef, 0x17, 0xb6, 0x84, 0x1e, 0xd2, 0x54 - #define STATIC_CODECAPI_AVEncMP12MuxInitialSCR 0x3433ad21, 0x1b91, 0x4a0b, 0xb1, 0x90, 0x2b, 0x77, 0x06, 0x3b, 0x63, 0xa4 - #define STATIC_CODECAPI_AVEncMP12MuxMuxRate 0xee047c72, 0x4bdb, 0x4a9d, 0x8e, 0x21, 0x41, 0x92, 0x6c, 0x82, 0x3d, 0xa7 - #define STATIC_CODECAPI_AVEncMP12MuxPackSize 0xf916053a, 0x1ce8, 0x4faf, 0xaa, 0x0b, 0xba, 0x31, 0xc8, 0x00, 0x34, 0xb8 - #define STATIC_CODECAPI_AVEncMP12MuxSysSTDBufferBound 0x35746903, 0xb545, 0x43e7, 0xbb, 0x35, 0xc5, 0xe0, 0xa7, 0xd5, 0x09, 0x3c - #define STATIC_CODECAPI_AVEncMP12MuxSysRateBound 0x05f0428a, 0xee30, 0x489d, 0xae, 0x28, 0x20, 0x5c, 0x72, 0x44, 0x67, 0x10 - #define STATIC_CODECAPI_AVEncMP12MuxTargetPacketizer 0xd862212a, 0x2015, 0x45dd, 0x9a, 0x32, 0x1b, 0x3a, 0xa8, 0x82, 0x05, 0xa0 - #define STATIC_CODECAPI_AVEncMP12MuxSysFixed 0xcefb987e, 0x894f, 0x452e, 0x8f, 0x89, 0xa4, 0xef, 0x8c, 0xec, 0x06, 0x3a - #define STATIC_CODECAPI_AVEncMP12MuxSysCSPS 0x7952ff45, 0x9c0d, 0x4822, 0xbc, 0x82, 0x8a, 0xd7, 0x72, 0xe0, 0x29, 0x93 - #define STATIC_CODECAPI_AVEncMP12MuxSysVideoLock 0xb8296408, 0x2430, 0x4d37, 0xa2, 0xa1, 0x95, 0xb3, 0xe4, 0x35, 0xa9, 0x1d - #define STATIC_CODECAPI_AVEncMP12MuxSysAudioLock 0x0fbb5752, 0x1d43, 0x47bf, 0xbd, 0x79, 0xf2, 0x29, 0x3d, 0x8c, 0xe3, 0x37 - #define STATIC_CODECAPI_AVEncMP12MuxDVDNavPacks 0xc7607ced, 0x8cf1, 0x4a99, 0x83, 0xa1, 0xee, 0x54, 0x61, 0xbe, 0x35, 0x74 - - #define STATIC_CODECAPI_AVEncMPACopyright 0xa6ae762a, 0xd0a9, 0x4454, 0xb8, 0xef, 0xf2, 0xdb, 0xee, 0xfd, 0xd3, 0xbd - #define STATIC_CODECAPI_AVEncMPAOriginalBitstream 0x3cfb7855, 0x9cc9, 0x47ff, 0xb8, 0x29, 0xb3, 0x67, 0x86, 0xc9, 0x23, 0x46 - #define STATIC_CODECAPI_AVEncMPAEnableRedundancyProtection 0x5e54b09e, 0xb2e7, 0x4973, 0xa8, 0x9b, 0x0b, 0x36, 0x50, 0xa3, 0xbe, 0xda - #define STATIC_CODECAPI_AVEncMPAPrivateUserBit 0xafa505ce, 0xc1e3, 0x4e3d, 0x85, 0x1b, 0x61, 0xb7, 0x00, 0xe5, 0xe6, 0xcc - #define STATIC_CODECAPI_AVEncMPAEmphasisType 0x2d59fcda, 0xbf4e, 0x4ed6, 0xb5, 0xdf, 0x5b, 0x03, 0xb3, 0x6b, 0x0a, 0x1f - - - #define STATIC_CODECAPI_AVDecCommonMeanBitRate 0x59488217, 0x007a, 0x4f7a, 0x8e, 0x41, 0x5c, 0x48, 0xb1, 0xea, 0xc5, 0xc6 - #define STATIC_CODECAPI_AVDecCommonMeanBitRateInterval 0x0ee437c6, 0x38a7, 0x4c5c, 0x94, 0x4c, 0x68, 0xab, 0x42, 0x11, 0x6b, 0x85 - #define STATIC_CODECAPI_AVDecCommonInputFormat 0xe5005239, 0xbd89, 0x4be3, 0x9c, 0x0f, 0x5d, 0xde, 0x31, 0x79, 0x88, 0xcc - #define STATIC_CODECAPI_AVDecCommonOutputFormat 0x3c790028, 0xc0ce, 0x4256, 0xb1, 0xa2, 0x1b, 0x0f, 0xc8, 0xb1, 0xdc, 0xdc - - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Stereo_MatrixEncoded 0x696e1d30, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_PCM 0x696e1d31, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_SPDIF_PCM 0x696e1d32, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_SPDIF_Bitstream 0x696e1d33, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Headphones 0x696e1d34, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - #define STATIC_CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Stereo_Auto 0x696e1d35, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd - - #define STATIC_CODECAPI_AVDecVideoImageSize 0x5ee5747c, 0x6801, 0x4cab, 0xaa, 0xf1, 0x62, 0x48, 0xfa, 0x84, 0x1b, 0xa4 - #define STATIC_CODECAPI_AVDecVideoInputScanType 0x38477e1f, 0x0ea7, 0x42cd, 0x8c, 0xd1, 0x13, 0x0c, 0xed, 0x57, 0xc5, 0x80 - #define STATIC_CODECAPI_AVDecVideoPixelAspectRatio 0xb0cf8245, 0xf32d, 0x41df, 0xb0, 0x2c, 0x87, 0xbd, 0x30, 0x4d, 0x12, 0xab - #define STATIC_CODECAPI_AVDecVideoAcceleration_MPEG2 0xf7db8a2e, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 - #define STATIC_CODECAPI_AVDecVideoAcceleration_H264 0xf7db8a2f, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 - #define STATIC_CODECAPI_AVDecVideoAcceleration_VC1 0xf7db8a30, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 - #define STATIC_CODECAPI_AVDecVideoProcDeinterlaceCSC 0xf7db8a31, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 - - #define STATIC_CODECAPI_AVDecVideoThumbnailGenerationMode 0x2efd8eee, 0x1150, 0x4328, 0x9c, 0xf5, 0x66, 0xdc, 0xe9, 0x33, 0xfc, 0xf4 - #define STATIC_CODECAPI_AVDecVideoDropPicWithMissingRef 0xf8226383, 0x14c2, 0x4567, 0x97, 0x34, 0x50, 0x4, 0xe9, 0x6f, 0xf8, 0x87 - #define STATIC_CODECAPI_AVDecVideoSoftwareDeinterlaceMode 0x0c08d1ce, 0x9ced, 0x4540, 0xba, 0xe3, 0xce, 0xb3, 0x80, 0x14, 0x11, 0x09 - #define STATIC_CODECAPI_AVDecVideoFastDecodeMode 0x6b529f7d, 0xd3b1, 0x49c6, 0xa9, 0x99, 0x9e, 0xc6, 0x91, 0x1b, 0xed, 0xbf - #define STATIC_CODECAPI_AVDecVideoH264ErrorConcealment 0xececace8, 0x3436, 0x462c, 0x92, 0x94, 0xcd, 0x7b, 0xac, 0xd7, 0x58, 0xa9 - #define STATIC_CODECAPI_AVDecVideoMPEG2ErrorConcealment 0x9d2bfe18, 0x728d, 0x48d2, 0xb3, 0x58, 0xbc, 0x7e, 0x43, 0x6c, 0x66, 0x74 - #define STATIC_CODECAPI_AVDecVideoCodecType 0x434528e5, 0x21f0, 0x46b6, 0xb6, 0x2c, 0x9b, 0x1b, 0x6b, 0x65, 0x8c, 0xd1 - #define STATIC_CODECAPI_AVDecVideoDXVAMode 0xf758f09e, 0x7337, 0x4ae7, 0x83, 0x87, 0x73, 0xdc, 0x2d, 0x54, 0xe6, 0x7d - #define STATIC_CODECAPI_AVDecVideoDXVABusEncryption 0x42153c8b, 0xfd0b, 0x4765, 0xa4, 0x62, 0xdd, 0xd9, 0xe8, 0xbc, 0xc3, 0x88 - #define STATIC_CODECAPI_AVDecVideoSWPowerLevel 0xfb5d2347, 0x4dd8, 0x4509, 0xae, 0xd0, 0xdb, 0x5f, 0xa9, 0xaa, 0x93, 0xf4 - - #define STATIC_CODECAPI_GUID_AVDecAudioInputWMA 0xc95e8dcf, 0x4058, 0x4204, 0x8c, 0x42, 0xcb, 0x24, 0xd9, 0x1e, 0x4b, 0x9b - #define STATIC_CODECAPI_GUID_AVDecAudioInputWMAPro 0x0128b7c7, 0xda72, 0x4fe3, 0xbe, 0xf8, 0x5c, 0x52, 0xe3, 0x55, 0x77, 0x04 - #define STATIC_CODECAPI_GUID_AVDecAudioInputDolby 0x8e4228a0, 0xf000, 0x4e0b, 0x8f, 0x54, 0xab, 0x8d, 0x24, 0xad, 0x61, 0xa2 - #define STATIC_CODECAPI_GUID_AVDecAudioInputDTS 0x600bc0ca, 0x6a1f, 0x4e91, 0xb2, 0x41, 0x1b, 0xbe, 0xb1, 0xcb, 0x19, 0xe0 - #define STATIC_CODECAPI_GUID_AVDecAudioInputPCM 0xf2421da5, 0xbbb4, 0x4cd5, 0xa9, 0x96, 0x93, 0x3c, 0x6b, 0x5d, 0x13, 0x47 - #define STATIC_CODECAPI_GUID_AVDecAudioInputMPEG 0x91106f36, 0x02c5, 0x4f75, 0x97, 0x19, 0x3b, 0x7a, 0xbf, 0x75, 0xe1, 0xf6 - #define STATIC_CODECAPI_GUID_AVDecAudioInputAAC 0x97df7828, 0xb94a, 0x47e2, 0xa4, 0xbc, 0x51, 0x19, 0x4d, 0xb2, 0x2a, 0x4d - #define STATIC_CODECAPI_GUID_AVDecAudioInputHEAAC 0x16efb4aa, 0x330e, 0x4f5c, 0x98, 0xa8, 0xcf, 0x6a, 0xc5, 0x5c, 0xbe, 0x60 - #define STATIC_CODECAPI_GUID_AVDecAudioInputDolbyDigitalPlus 0x0803e185, 0x8f5d, 0x47f5, 0x99, 0x08, 0x19, 0xa5, 0xbb, 0xc9, 0xfe, 0x34 - - #define STATIC_CODECAPI_AVDecAACDownmixMode 0x01274475, 0xf6bb, 0x4017, 0xb0, 0x84, 0x81, 0xa7, 0x63, 0xc9, 0x42, 0xd4 - #define STATIC_CODECAPI_AVDecHEAACDynamicRangeControl 0x287c8abe, 0x69a4, 0x4d39, 0x80, 0x80, 0xd3, 0xd9, 0x71, 0x21, 0x78, 0xa0 - - #define STATIC_CODECAPI_AVDecAudioDualMono 0x4a52cda8, 0x30f8, 0x4216, 0xbe, 0x0f, 0xba, 0x0b, 0x20, 0x25, 0x92, 0x1d - #define STATIC_CODECAPI_AVDecAudioDualMonoReproMode 0xa5106186, 0xcc94, 0x4bc9, 0x8c, 0xd9, 0xaa, 0x2f, 0x61, 0xf6, 0x80, 0x7e - - #define STATIC_CODECAPI_AVAudioChannelCount 0x1d3583c4, 0x1583, 0x474e, 0xb7, 0x1a, 0x5e, 0xe4, 0x63, 0xc1, 0x98, 0xe4 - #define STATIC_CODECAPI_AVAudioChannelConfig 0x17f89cb3, 0xc38d, 0x4368, 0x9e, 0xde, 0x63, 0xb9, 0x4d, 0x17, 0x7f, 0x9f - #define STATIC_CODECAPI_AVAudioSampleRate 0x971d2723, 0x1acb, 0x42e7, 0x85, 0x5c, 0x52, 0x0a, 0x4b, 0x70, 0xa5, 0xf2 - - #define STATIC_CODECAPI_AVDDSurroundMode 0x99f2f386, 0x98d1, 0x4452, 0xa1, 0x63, 0xab, 0xc7, 0x8a, 0x6e, 0xb7, 0x70 - #define STATIC_CODECAPI_AVDecDDOperationalMode 0xd6d6c6d1, 0x064e, 0x4fdd, 0xa4, 0x0e, 0x3e, 0xcb, 0xfc, 0xb7, 0xeb, 0xd0 - #define STATIC_CODECAPI_AVDecDDMatrixDecodingMode 0xddc811a5, 0x04ed, 0x4bf3, 0xa0, 0xca, 0xd0, 0x04, 0x49, 0xf9, 0x35, 0x5f - #define STATIC_CODECAPI_AVDecDDDynamicRangeScaleHigh 0x50196c21, 0x1f33, 0x4af5, 0xb2, 0x96, 0x11, 0x42, 0x6d, 0x6c, 0x87, 0x89 - #define STATIC_CODECAPI_AVDecDDDynamicRangeScaleLow 0x044e62e4, 0x11a5, 0x42d5, 0xa3, 0xb2, 0x3b, 0xb2, 0xc7, 0xc2, 0xd7, 0xcf - - #define STATIC_CODECAPI_AVDSPLoudnessEqualization 0x8afd1a15, 0x1812, 0x4cbf, 0x93, 0x19, 0x43, 0x3a, 0x5b, 0x2a, 0x3b, 0x27 - #define STATIC_CODECAPI_AVDSPSpeakerFill 0x5612bca1, 0x56da, 0x4582, 0x8d, 0xa1, 0xca, 0x80, 0x90, 0xf9, 0x27, 0x68 - - #define STATIC_CODECAPI_AVPriorityControl 0x54ba3dc8, 0xbdde, 0x4329, 0xb1, 0x87, 0x20, 0x18, 0xbc, 0x5c, 0x2b, 0xa1 - #define STATIC_CODECAPI_AVRealtimeControl 0x6f440632, 0xc4ad, 0x4bf7, 0x9e, 0x52, 0x45, 0x69, 0x42, 0xb4, 0x54, 0xb0 - -// end of static definitions } - -// -// Common Parameters -// - -// AVEncCommonFormatConstraint (GUID) - -DEFINE_CODECAPI_GUID( AVEncCommonFormatConstraint, "57cbb9b8-116f-4951-b40c-c2a035ed8f17", 0x57cbb9b8, 0x116f, 0x4951, 0xb4, 0x0c, 0xc2, 0xa0, 0x35, 0xed, 0x8f, 0x17 ) - -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatUnSpecified, "af46a35a-6024-4525-a48a-094b97f5b3c2", 0xaf46a35a, 0x6024, 0x4525, 0xa4, 0x8a, 0x09, 0x4b, 0x97, 0xf5, 0xb3, 0xc2 ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatDVD_V, "cc9598c4-e7fe-451d-b1ca-761bc840b7f3", 0xcc9598c4, 0xe7fe, 0x451d, 0xb1, 0xca, 0x76, 0x1b, 0xc8, 0x40, 0xb7, 0xf3 ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatDVD_DashVR, "e55199d6-044c-4dae-a488-531ed306235b", 0xe55199d6, 0x044c, 0x4dae, 0xa4, 0x88, 0x53, 0x1e, 0xd3, 0x06, 0x23, 0x5b ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatDVD_PlusVR, "e74c6f2e-ec37-478d-9af4-a5e135b6271c", 0xe74c6f2e, 0xec37, 0x478d, 0x9a, 0xf4, 0xa5, 0xe1, 0x35, 0xb6, 0x27, 0x1c ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatVCD, "95035bf7-9d90-40ff-ad5c-5cf8cf71ca1d", 0x95035bf7, 0x9d90, 0x40ff, 0xad, 0x5c, 0x5c, 0xf8, 0xcf, 0x71, 0xca, 0x1d ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatSVCD, "51d85818-8220-448c-8066-d69bed16c9ad", 0x51d85818, 0x8220, 0x448c, 0x80, 0x66, 0xd6, 0x9b, 0xed, 0x16, 0xc9, 0xad ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatATSC, "8d7b897c-a019-4670-aa76-2edcac7ac296", 0x8d7b897c, 0xa019, 0x4670, 0xaa, 0x76, 0x2e, 0xdc, 0xac, 0x7a, 0xc2, 0x96 ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatDVB, "71830d8f-6c33-430d-844b-c2705baae6db", 0x71830d8f, 0x6c33, 0x430d, 0x84, 0x4b, 0xc2, 0x70, 0x5b, 0xaa, 0xe6, 0xdb ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatMP3, "349733cd-eb08-4dc2-8197-e49835ef828b", 0x349733cd, 0xeb08, 0x4dc2, 0x81, 0x97, 0xe4, 0x98, 0x35, 0xef, 0x82, 0x8b ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatHighMAT, "1eabe760-fb2b-4928-90d1-78db88eee889", 0x1eabe760, 0xfb2b, 0x4928, 0x90, 0xd1, 0x78, 0xdb, 0x88, 0xee, 0xe8, 0x89 ) -DEFINE_CODECAPI_GUID( GUID_AVEncCommonFormatHighMPV, "a2d25db8-b8f9-42c2-8bc7-0b93cf604788", 0xa2d25db8, 0xb8f9, 0x42c2, 0x8b, 0xc7, 0x0b, 0x93, 0xcf, 0x60, 0x47, 0x88 ) - -// AVEncCodecType (GUID) -DEFINE_CODECAPI_GUID( AVEncCodecType, "08af4ac1-f3f2-4c74-9dcf-37f2ec79f826", 0x08af4ac1, 0xf3f2, 0x4c74, 0x9d, 0xcf, 0x37, 0xf2, 0xec, 0x79, 0xf8, 0x26 ) - -DEFINE_CODECAPI_GUID( GUID_AVEncMPEG1Video, "c8dafefe-da1e-4774-b27d-11830c16b1fe", 0xc8dafefe, 0xda1e, 0x4774, 0xb2, 0x7d, 0x11, 0x83, 0x0c, 0x16, 0xb1, 0xfe ) -DEFINE_CODECAPI_GUID( GUID_AVEncMPEG2Video, "046dc19a-6677-4aaa-a31d-c1ab716f4560", 0x046dc19a, 0x6677, 0x4aaa, 0xa3, 0x1d, 0xc1, 0xab, 0x71, 0x6f, 0x45, 0x60 ) -DEFINE_CODECAPI_GUID( GUID_AVEncMPEG1Audio, "d4dd1362-cd4a-4cd6-8138-b94db4542b04", 0xd4dd1362, 0xcd4a, 0x4cd6, 0x81, 0x38, 0xb9, 0x4d, 0xb4, 0x54, 0x2b, 0x04 ) -DEFINE_CODECAPI_GUID( GUID_AVEncMPEG2Audio, "ee4cbb1f-9c3f-4770-92b5-fcb7c2a8d381", 0xee4cbb1f, 0x9c3f, 0x4770, 0x92, 0xb5, 0xfc, 0xb7, 0xc2, 0xa8, 0xd3, 0x81 ) -DEFINE_CODECAPI_GUID( GUID_AVEncWMV, "4e0fef9b-1d43-41bd-b8bd-4d7bf7457a2a", 0x4e0fef9b, 0x1d43, 0x41bd, 0xb8, 0xbd, 0x4d, 0x7b, 0xf7, 0x45, 0x7a, 0x2a ) -DEFINE_CODECAPI_GUID( GUID_AVEndMPEG4Video, "dd37b12a-9503-4f8b-b8d0-324a00c0a1cf", 0xdd37b12a, 0x9503, 0x4f8b, 0xb8, 0xd0, 0x32, 0x4a, 0x00, 0xc0, 0xa1, 0xcf ) -DEFINE_CODECAPI_GUID( GUID_AVEncH264Video, "95044eab-31b3-47de-8e75-38a42bb03e28", 0x95044eab, 0x31b3, 0x47de, 0x8e, 0x75, 0x38, 0xa4, 0x2b, 0xb0, 0x3e, 0x28 ) -DEFINE_CODECAPI_GUID( GUID_AVEncDV, "09b769c7-3329-44fb-8954-fa30937d3d5a", 0x09b769c7, 0x3329, 0x44fb, 0x89, 0x54, 0xfa, 0x30, 0x93, 0x7d, 0x3d, 0x5a ) -DEFINE_CODECAPI_GUID( GUID_AVEncWMAPro, "1955f90c-33f7-4a68-ab81-53f5657125c4", 0x1955f90c, 0x33f7, 0x4a68, 0xab, 0x81, 0x53, 0xf5, 0x65, 0x71, 0x25, 0xc4 ) -DEFINE_CODECAPI_GUID( GUID_AVEncWMALossless, "55ca7265-23d8-4761-9031-b74fbe12f4c1", 0x55ca7265, 0x23d8, 0x4761, 0x90, 0x31, 0xb7, 0x4f, 0xbe, 0x12, 0xf4, 0xc1 ) -DEFINE_CODECAPI_GUID( GUID_AVEncWMAVoice, "13ed18cb-50e8-4276-a288-a6aa228382d9", 0x13ed18cb, 0x50e8, 0x4276, 0xa2, 0x88, 0xa6, 0xaa, 0x22, 0x83, 0x82, 0xd9 ) -DEFINE_CODECAPI_GUID( GUID_AVEncDolbyDigitalPro, "f5be76cc-0ff8-40eb-9cb1-bba94004d44f", 0xf5be76cc, 0x0ff8, 0x40eb, 0x9c, 0xb1, 0xbb, 0xa9, 0x40, 0x04, 0xd4, 0x4f ) -DEFINE_CODECAPI_GUID( GUID_AVEncDolbyDigitalConsumer, "c1a7bf6c-0059-4bfa-94ef-ef747a768d52", 0xc1a7bf6c, 0x0059, 0x4bfa, 0x94, 0xef, 0xef, 0x74, 0x7a, 0x76, 0x8d, 0x52 ) -DEFINE_CODECAPI_GUID( GUID_AVEncDolbyDigitalPlus, "698d1b80-f7dd-415c-971c-42492a2056c6", 0x698d1b80, 0xf7dd, 0x415c, 0x97, 0x1c, 0x42, 0x49, 0x2a, 0x20, 0x56, 0xc6 ) -DEFINE_CODECAPI_GUID( GUID_AVEncDTSHD, "2052e630-469d-4bfb-80ca-1d656e7e918f", 0x2052e630, 0x469d, 0x4bfb, 0x80, 0xca, 0x1d, 0x65, 0x6e, 0x7e, 0x91, 0x8f ) -DEFINE_CODECAPI_GUID( GUID_AVEncDTS, "45fbcaa2-5e6e-4ab0-8893-5903bee93acf", 0x45fbcaa2, 0x5e6e, 0x4ab0, 0x88, 0x93, 0x59, 0x03, 0xbe, 0xe9, 0x3a, 0xcf ) -DEFINE_CODECAPI_GUID( GUID_AVEncMLP, "05f73e29-f0d1-431e-a41c-a47432ec5a66", 0x05f73e29, 0xf0d1, 0x431e, 0xa4, 0x1c, 0xa4, 0x74, 0x32, 0xec, 0x5a, 0x66 ) -DEFINE_CODECAPI_GUID( GUID_AVEncPCM, "844be7f4-26cf-4779-b386-cc05d187990c", 0x844be7f4, 0x26cf, 0x4779, 0xb3, 0x86, 0xcc, 0x05, 0xd1, 0x87, 0x99, 0x0c ) -DEFINE_CODECAPI_GUID( GUID_AVEncSDDS, "1dc1b82f-11c8-4c71-b7b6-ee3eb9bc2b94", 0x1dc1b82f, 0x11c8, 0x4c71, 0xb7, 0xb6, 0xee, 0x3e, 0xb9, 0xbc, 0x2b, 0x94 ) - - - - -// AVEncCommonRateControlMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonRateControlMode, "1c0608e9-370c-4710-8a58-cb6181c42423", 0x1c0608e9, 0x370c, 0x4710, 0x8a, 0x58, 0xcb, 0x61, 0x81, 0xc4, 0x24, 0x23 ) - -enum eAVEncCommonRateControlMode -{ - eAVEncCommonRateControlMode_CBR = 0, - eAVEncCommonRateControlMode_PeakConstrainedVBR = 1, - eAVEncCommonRateControlMode_UnconstrainedVBR = 2, - eAVEncCommonRateControlMode_Quality = 3 -}; - -// AVEncCommonLowLatency (BOOL) -DEFINE_CODECAPI_GUID( AVEncCommonLowLatency, "9d3ecd55-89e8-490a-970a-0c9548d5a56e", 0x9d3ecd55, 0x89e8, 0x490a, 0x97, 0x0a, 0x0c, 0x95, 0x48, 0xd5, 0xa5, 0x6e ) - -// AVEncCommonMultipassMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonMultipassMode, "22533d4c-47e1-41b5-9352-a2b7780e7ac4", 0x22533d4c, 0x47e1, 0x41b5, 0x93, 0x52, 0xa2, 0xb7, 0x78, 0x0e, 0x7a, 0xc4 ) - -// AVEncCommonPassStart (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonPassStart, "6a67739f-4eb5-4385-9928-f276a939ef95", 0x6a67739f, 0x4eb5, 0x4385, 0x99, 0x28, 0xf2, 0x76, 0xa9, 0x39, 0xef, 0x95 ) - -// AVEncCommonPassEnd (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonPassEnd, "0e3d01bc-c85c-467d-8b60-c41012ee3bf6", 0x0e3d01bc, 0xc85c, 0x467d, 0x8b, 0x60, 0xc4, 0x10, 0x12, 0xee, 0x3b, 0xf6 ) - -// AVEncCommonRealTime (BOOL) -DEFINE_CODECAPI_GUID( AVEncCommonRealTime, "143a0ff6-a131-43da-b81e-98fbb8ec378e", 0x143a0ff6, 0xa131, 0x43da, 0xb8, 0x1e, 0x98, 0xfb, 0xb8, 0xec, 0x37, 0x8e ) - -// AVEncCommonQuality (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonQuality, "fcbf57a3-7ea5-4b0c-9644-69b40c39c391", 0xfcbf57a3, 0x7ea5, 0x4b0c, 0x96, 0x44, 0x69, 0xb4, 0x0c, 0x39, 0xc3, 0x91 ) - -// AVEncCommonQualityVsSpeed (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonQualityVsSpeed, "98332df8-03cd-476b-89fa-3f9e442dec9f", 0x98332df8, 0x03cd, 0x476b, 0x89, 0xfa, 0x3f, 0x9e, 0x44, 0x2d, 0xec, 0x9f ) - -// AVEncCommonMeanBitRate (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonMeanBitRate, "f7222374-2144-4815-b550-a37f8e12ee52", 0xf7222374, 0x2144, 0x4815, 0xb5, 0x50, 0xa3, 0x7f, 0x8e, 0x12, 0xee, 0x52 ) - -// AVEncCommonMeanBitRateInterval (UINT64) -DEFINE_CODECAPI_GUID( AVEncCommonMeanBitRateInterval, "bfaa2f0c-cb82-4bc0-8474-f06a8a0d0258", 0xbfaa2f0c, 0xcb82, 0x4bc0, 0x84, 0x74, 0xf0, 0x6a, 0x8a, 0x0d, 0x02, 0x58 ) - -// AVEncCommonMaxBitRate (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonMaxBitRate, "9651eae4-39b9-4ebf-85ef-d7f444ec7465", 0x9651eae4, 0x39b9, 0x4ebf, 0x85, 0xef, 0xd7, 0xf4, 0x44, 0xec, 0x74, 0x65 ) - -// AVEncCommonMinBitRate (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonMinBitRate, "101405b2-2083-4034-a806-efbeddd7c9ff", 0x101405b2, 0x2083, 0x4034, 0xa8, 0x06, 0xef, 0xbe, 0xdd, 0xd7, 0xc9, 0xff ) - -// AVEncCommonBufferSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonBufferSize, "0db96574-b6a4-4c8b-8106-3773de0310cd", 0x0db96574, 0xb6a4, 0x4c8b, 0x81, 0x06, 0x37, 0x73, 0xde, 0x03, 0x10, 0xcd ) - -// AVEncCommonBufferInLevel (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonBufferInLevel, "d9c5c8db-fc74-4064-94e9-cd19f947ed45", 0xd9c5c8db, 0xfc74, 0x4064, 0x94, 0xe9, 0xcd, 0x19, 0xf9, 0x47, 0xed, 0x45 ) - -// AVEncCommonBufferOutLevel (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonBufferOutLevel, "ccae7f49-d0bc-4e3d-a57e-fb5740140069", 0xccae7f49, 0xd0bc, 0x4e3d, 0xa5, 0x7e, 0xfb, 0x57, 0x40, 0x14, 0x00, 0x69 ) - -// AVEncCommonStreamEndHandling (UINT32) -DEFINE_CODECAPI_GUID( AVEncCommonStreamEndHandling, "6aad30af-6ba8-4ccc-8fca-18d19beaeb1c", 0x6aad30af, 0x6ba8, 0x4ccc, 0x8f, 0xca, 0x18, 0xd1, 0x9b, 0xea, 0xeb, 0x1c ) - -enum eAVEncCommonStreamEndHandling -{ - eAVEncCommonStreamEndHandling_DiscardPartial = 0, - eAVEncCommonStreamEndHandling_EnsureComplete = 1 -}; - -// -// Common Post Encode Statistical Parameters -// - -// AVEncStatCommonCompletedPasses (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatCommonCompletedPasses, "3e5de533-9df7-438c-854f-9f7dd3683d34", 0x3e5de533, 0x9df7, 0x438c, 0x85, 0x4f, 0x9f, 0x7d, 0xd3, 0x68, 0x3d, 0x34 ) - -// -// Common Video Parameters -// - -// AVEncVideoOutputFrameRate (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoOutputFrameRate, "ea85e7c3-9567-4d99-87c4-02c1c278ca7c", 0xea85e7c3, 0x9567, 0x4d99, 0x87, 0xc4, 0x02, 0xc1, 0xc2, 0x78, 0xca, 0x7c ) - -// AVEncVideoOutputFrameRateConversion (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoOutputFrameRateConversion, "8c068bf4-369a-4ba3-82fd-b2518fb3396e", 0x8c068bf4, 0x369a, 0x4ba3, 0x82, 0xfd, 0xb2, 0x51, 0x8f, 0xb3, 0x39, 0x6e ) - -enum eAVEncVideoOutputFrameRateConversion -{ - eAVEncVideoOutputFrameRateConversion_Disable = 0, - eAVEncVideoOutputFrameRateConversion_Enable = 1, - eAVEncVideoOutputFrameRateConversion_Alias = 2 -}; - -// AVEncVideoPixelAspectRatio (UINT32 as UINT16/UNIT16) <---- You have WORD in the doc -DEFINE_CODECAPI_GUID( AVEncVideoPixelAspectRatio, "3cdc718f-b3e9-4eb6-a57f-cf1f1b321b87", 0x3cdc718f, 0xb3e9, 0x4eb6, 0xa5, 0x7f, 0xcf, 0x1f, 0x1b, 0x32, 0x1b, 0x87 ) - -// AVDecVideoAcceleration_MPEG2 (UINT32) -DEFINE_CODECAPI_GUID( AVDecVideoAcceleration_MPEG2, "f7db8a2e-4f48-4ee8-ae31-8b6ebe558ae2", 0xf7db8a2e, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 ) -DEFINE_CODECAPI_GUID( AVDecVideoAcceleration_H264, "f7db8a2f-4f48-4ee8-ae31-8b6ebe558ae2", 0xf7db8a2f, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 ) -DEFINE_CODECAPI_GUID( AVDecVideoAcceleration_VC1, "f7db8a30-4f48-4ee8-ae31-8b6ebe558ae2", 0xf7db8a30, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 ) - -// AVDecVideoProcDeinterlaceCSC (UINT32) -DEFINE_CODECAPI_GUID( AVDecVideoProcDeinterlaceCSC, "f7db8a31-4f48-4ee8-ae31-8b6ebe558ae2", 0xf7db8a31, 0x4f48, 0x4ee8, 0xae, 0x31, 0x8b, 0x6e, 0xbe, 0x55, 0x8a, 0xe2 ) - - -// AVDecVideoThumbnailGenerationMode (BOOL) -// Related to video thumbnail generation. -// Video decoders can have special configurations for fast thumbnail generation. -// For example: -// - They can use only one decoding thread so that multiple instances can be used at the same time. -// - They can also decode I frames only. -DEFINE_CODECAPI_GUID( AVDecVideoThumbnailGenerationMode, "2EFD8EEE-1150-4328-9CF5-66DCE933FCF4", 0x2efd8eee, 0x1150, 0x4328, 0x9c, 0xf5, 0x66, 0xdc, 0xe9, 0x33, 0xfc, 0xf4) - -// AVDecVideoDropPicWithMissingRef (BOOL) -// Related to Video decoding mode of whether to drop pictures with missing references. -// For DVD playback, we may want to do so to avoid bad blocking. For Digital TV, we may -// want to decode all pictures no matter what. -DEFINE_CODECAPI_GUID( AVDecVideoDropPicWithMissingRef, "F8226383-14C2-4567-9734-5004E96FF887", 0xf8226383, 0x14c2, 0x4567, 0x97, 0x34, 0x50, 0x4, 0xe9, 0x6f, 0xf8, 0x87) - - -// AVDecSoftwareVideoDeinterlaceMode (UINT32) -DEFINE_CODECAPI_GUID( AVDecVideoSoftwareDeinterlaceMode, "0c08d1ce-9ced-4540-bae3-ceb380141109", 0x0c08d1ce, 0x9ced, 0x4540, 0xba, 0xe3, 0xce, 0xb3, 0x80, 0x14, 0x11, 0x09); - -enum eAVDecVideoSoftwareDeinterlaceMode -{ - eAVDecVideoSoftwareDeinterlaceMode_NoDeinterlacing = 0, // do not use software deinterlace - eAVDecVideoSoftwareDeinterlaceMode_ProgressiveDeinterlacing = 1, // Use progressive deinterlace - eAVDecVideoSoftwareDeinterlaceMode_BOBDeinterlacing = 2, // BOB deinterlacing - eAVDecVideoSoftwareDeinterlaceMode_SmartBOBDeinterlacing = 3 // Smart BOB deinterlacing -}; - -// AVDecVideoFastDecodeMode (UINT32) -// 0: normal decoding -// 1-32 : Where 32 is fastest decoding. Any value between (and including) 1 to 32 is valid -DEFINE_CODECAPI_GUID( AVDecVideoFastDecodeMode, "6B529F7D-D3B1-49c6-A999-9EC6911BEDBF", 0x6b529f7d, 0xd3b1, 0x49c6, 0xa9, 0x99, 0x9e, 0xc6, 0x91, 0x1b, 0xed, 0xbf); - -enum eAVFastDecodeMode -{ - eVideoDecodeCompliant = 0, - eVideoDecodeOptimalLF = 1, // Optimal Loop Filter - eVideoDecodeDisableLF = 2, // Disable Loop Filter - eVideoDecodeFastest = 32, -}; - -// AVDecVideoH264ErrorConcealment (UINT32) -// Related to Video decoding mode of whether to conceal pictures with corruptions. -// For DVD playback, we may not want to do so to avoid unnecessary computation. For Digital TV, we may -// want to perform error concealment. -DEFINE_CODECAPI_GUID( AVDecVideoH264ErrorConcealment, "ECECACE8-3436-462c-9294-CD7BACD758A9", 0xececace8, 0x3436, 0x462c, 0x92, 0x94, 0xcd, 0x7b, 0xac, 0xd7, 0x58, 0xa9) - -enum eAVDecVideoH264ErrorConcealment -{ - eErrorConcealmentTypeDrop = 0, // ERR_CONCEALMENT_TYPE_DROP - eErrorConcealmentTypeBasic = 1, // ERR_CONCEALMENT_TYPE_BASIC (the default, and good mode used most of the time) - eErrorConcealmentTypeAdvanced = 2, // ERR_CONCEALMENT_TYPE_ADVANCED - eErrorConcealmentTypeDXVASetBlack = 3, // ERR_CONCEALMENT_TYPE_DXVA_SET_BLACK -}; - - -// AVDecVideoMPEG2ErrorConcealment (UINT32) -// Related to Video decoding mode of whether to conceal pictures with corruptions. -// For DVD playback, we may not want to do so to avoid unnecessary computation. For Digital TV, we may -// want to perform error concealment. -DEFINE_CODECAPI_GUID( AVDecVideoMPEG2ErrorConcealment, "9D2BFE18-728D-48d2-B358-BC7E436C6674", 0x9d2bfe18, 0x728d, 0x48d2, 0xb3, 0x58, 0xbc, 0x7e, 0x43, 0x6c, 0x66, 0x74) - -enum eAVDecVideoMPEG2ErrorConcealment -{ - eErrorConcealmentOff = 0, // - eErrorConcealmentOn = 1, // the default and good mode used most of the time -}; - - -// CODECAPI_AVDecVideoCodecType (UINT32) -DEFINE_CODECAPI_GUID(AVDecVideoCodecType, "434528E5-21F0-46b6-B62C-9B1B6B658CD1", 0x434528e5, 0x21f0, 0x46b6, 0xb6, 0x2c, 0x9b, 0x1b, 0x6b, 0x65, 0x8c, 0xd1); - -enum eAVDecVideoCodecType -{ - eAVDecVideoCodecType_NOTPLAYING = 0, - eAVDecVideoCodecType_MPEG2 = 1, - eAVDecVideoCodecType_H264 = 2 -}; - -// CODECAPI_AVDecVideoDXVAMode (UINT32) -DEFINE_CODECAPI_GUID(AVDecVideoDXVAMode, "F758F09E-7337-4ae7-8387-73DC2D54E67D", 0xf758f09e, 0x7337, 0x4ae7, 0x83, 0x87, 0x73, 0xdc, 0x2d, 0x54, 0xe6, 0x7d); - -enum eAVDecVideoDXVAMode -{ - eAVDecVideoDXVAMode_NOTPLAYING = 0, - eAVDecVideoDXVAMode_SW = 1, - eAVDecVideoDXVAMode_MC = 2, - eAVDecVideoDXVAMode_IDCT = 3, - eAVDecVideoDXVAMode_VLD = 4 -}; - - - -// CODECAPI_AVDecVideoDXVABusEncryption (UINT32) -DEFINE_CODECAPI_GUID(AVDecVideoDXVABusEncryption, "42153C8B-FD0B-4765-A462-DDD9E8BCC388", 0x42153c8b, 0xfd0b, 0x4765, 0xa4, 0x62, 0xdd, 0xd9, 0xe8, 0xbc, 0xc3, 0x88); - -enum eAVDecVideoDXVABusEncryption -{ - eAVDecVideoDXVABusEncryption_NONE = 0, - eAVDecVideoDXVABusEncryption_PRIVATE = 1, - eAVDecVideoDXVABusEncryption_AES = 2 -}; - - -// AVEncVideoForceSourceScanType (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoForceSourceScanType, "1ef2065f-058a-4765-a4fc-8a864c103012", 0x1ef2065f, 0x058a, 0x4765, 0xa4, 0xfc, 0x8a, 0x86, 0x4c, 0x10, 0x30, 0x12 ) -enum eAVEncVideoSourceScanType -{ - eAVEncVideoSourceScan_Automatic = 0, - eAVEncVideoSourceScan_Interlaced = 1, - eAVEncVideoSourceScan_Progressive = 2 -}; - -// AVEncVideoNoOfFieldsToEncode (UINT64) -DEFINE_CODECAPI_GUID( AVEncVideoNoOfFieldsToEncode, "61e4bbe2-4ee0-40e7-80ab-51ddeebe6291", 0x61e4bbe2, 0x4ee0, 0x40e7, 0x80, 0xab, 0x51, 0xdd, 0xee, 0xbe, 0x62, 0x91 ) - -// AVEncVideoNoOfFieldsToSkip (UINT64) -DEFINE_CODECAPI_GUID( AVEncVideoNoOfFieldsToSkip, "a97e1240-1427-4c16-a7f7-3dcfd8ba4cc5", 0xa97e1240, 0x1427, 0x4c16, 0xa7, 0xf7, 0x3d, 0xcf, 0xd8, 0xba, 0x4c, 0xc5 ) - -// AVEncVideoEncodeDimension (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoEncodeDimension, "1074df28-7e0f-47a4-a453-cdd73870f5ce", 0x1074df28, 0x7e0f, 0x47a4, 0xa4, 0x53, 0xcd, 0xd7, 0x38, 0x70, 0xf5, 0xce ) - -// AVEncVideoEncodeOffsetOrigin (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoEncodeOffsetOrigin, "6bc098fe-a71a-4454-852e-4d2ddeb2cd24", 0x6bc098fe, 0xa71a, 0x4454, 0x85, 0x2e, 0x4d, 0x2d, 0xde, 0xb2, 0xcd, 0x24 ) - -// AVEncVideoDisplayDimension (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoDisplayDimension, "de053668-f4ec-47a9-86d0-836770f0c1d5", 0xde053668, 0xf4ec, 0x47a9, 0x86, 0xd0, 0x83, 0x67, 0x70, 0xf0, 0xc1, 0xd5 ) - -// AVEncVideoOutputScanType (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoOutputScanType, "460b5576-842e-49ab-a62d-b36f7312c9db", 0x460b5576, 0x842e, 0x49ab, 0xa6, 0x2d, 0xb3, 0x6f, 0x73, 0x12, 0xc9, 0xdb ) -enum eAVEncVideoOutputScanType -{ - eAVEncVideoOutputScan_Progressive = 0, - eAVEncVideoOutputScan_Interlaced = 1, - eAVEncVideoOutputScan_SameAsInput = 2, - eAVEncVideoOutputScan_Automatic = 3 -}; - -// AVEncVideoInverseTelecineEnable (BOOL) -DEFINE_CODECAPI_GUID( AVEncVideoInverseTelecineEnable, "2ea9098b-e76d-4ccd-a030-d3b889c1b64c", 0x2ea9098b, 0xe76d, 0x4ccd, 0xa0, 0x30, 0xd3, 0xb8, 0x89, 0xc1, 0xb6, 0x4c ) - -// AVEncVideoInverseTelecineThreshold (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInverseTelecineThreshold, "40247d84-e895-497f-b44c-b74560acfe27", 0x40247d84, 0xe895, 0x497f, 0xb4, 0x4c, 0xb7, 0x45, 0x60, 0xac, 0xfe, 0x27 ) - -// AVEncVideoSourceFilmContent (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoSourceFilmContent, "1791c64b-ccfc-4827-a0ed-2557793b2b1c", 0x1791c64b, 0xccfc, 0x4827, 0xa0, 0xed, 0x25, 0x57, 0x79, 0x3b, 0x2b, 0x1c ) - -enum eAVEncVideoFilmContent -{ - eAVEncVideoFilmContent_VideoOnly = 0, - eAVEncVideoFilmContent_FilmOnly = 1, - eAVEncVideoFilmContent_Mixed = 2 -}; - -// AVEncVideoSourceIsBW (BOOL) -DEFINE_CODECAPI_GUID( AVEncVideoSourceIsBW, "42ffc49b-1812-4fdc-8d24-7054c521e6eb", 0x42ffc49b, 0x1812, 0x4fdc, 0x8d, 0x24, 0x70, 0x54, 0xc5, 0x21, 0xe6, 0xeb ) - -// AVEncVideoFieldSwap (BOOL) -DEFINE_CODECAPI_GUID( AVEncVideoFieldSwap, "fefd7569-4e0a-49f2-9f2b-360ea48c19a2", 0xfefd7569, 0x4e0a, 0x49f2, 0x9f, 0x2b, 0x36, 0x0e, 0xa4, 0x8c, 0x19, 0xa2 ) - -// AVEncVideoInputChromaResolution (UINT32) -// AVEncVideoOutputChromaSubsamplingFormat (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputChromaResolution, "bb0cec33-16f1-47b0-8a88-37815bee1739", 0xbb0cec33, 0x16f1, 0x47b0, 0x8a, 0x88, 0x37, 0x81, 0x5b, 0xee, 0x17, 0x39 ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputChromaResolution, "6097b4c9-7c1d-4e64-bfcc-9e9765318ae7", 0x6097b4c9, 0x7c1d, 0x4e64, 0xbf, 0xcc, 0x9e, 0x97, 0x65, 0x31, 0x8a, 0xe7 ) - -enum eAVEncVideoChromaResolution -{ - eAVEncVideoChromaResolution_SameAsSource =0 , - eAVEncVideoChromaResolution_444 = 1, - eAVEncVideoChromaResolution_422 = 2, - eAVEncVideoChromaResolution_420 = 3, - eAVEncVideoChromaResolution_411 = 4 -}; - -// AVEncVideoInputChromaSubsampling (UINT32) -// AVEncVideoOutputChromaSubsampling (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputChromaSubsampling, "a8e73a39-4435-4ec3-a6ea-98300f4b36f7", 0xa8e73a39, 0x4435, 0x4ec3, 0xa6, 0xea, 0x98, 0x30, 0x0f, 0x4b, 0x36, 0xf7 ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputChromaSubsampling, "fa561c6c-7d17-44f0-83c9-32ed12e96343", 0xfa561c6c, 0x7d17, 0x44f0, 0x83, 0xc9, 0x32, 0xed, 0x12, 0xe9, 0x63, 0x43 ) - -enum eAVEncVideoChromaSubsampling -{ - eAVEncVideoChromaSubsamplingFormat_SameAsSource = 0, - eAVEncVideoChromaSubsamplingFormat_ProgressiveChroma = 0x8, - eAVEncVideoChromaSubsamplingFormat_Horizontally_Cosited = 0x4, - eAVEncVideoChromaSubsamplingFormat_Vertically_Cosited = 0x2, - eAVEncVideoChromaSubsamplingFormat_Vertically_AlignedChromaPlanes = 0x1, -}; - -// AVEncVideoInputColorPrimaries (UINT32) -// AVEncVideoOutputColorPrimaries (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputColorPrimaries, "c24d783f-7ce6-4278-90ab-28a4f1e5f86c", 0xc24d783f, 0x7ce6, 0x4278, 0x90, 0xab, 0x28, 0xa4, 0xf1, 0xe5, 0xf8, 0x6c ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputColorPrimaries, "be95907c-9d04-4921-8985-a6d6d87d1a6c", 0xbe95907c, 0x9d04, 0x4921, 0x89, 0x85, 0xa6, 0xd6, 0xd8, 0x7d, 0x1a, 0x6c ) - -enum eAVEncVideoColorPrimaries -{ - eAVEncVideoColorPrimaries_SameAsSource = 0, - eAVEncVideoColorPrimaries_Reserved = 1, - eAVEncVideoColorPrimaries_BT709 = 2, - eAVEncVideoColorPrimaries_BT470_2_SysM = 3, - eAVEncVideoColorPrimaries_BT470_2_SysBG = 4, - eAVEncVideoColorPrimaries_SMPTE170M = 5, - eAVEncVideoColorPrimaries_SMPTE240M = 6, - eAVEncVideoColorPrimaries_EBU3231 = 7, - eAVEncVideoColorPrimaries_SMPTE_C = 8 -}; - -// AVEncVideoInputColorTransferFunction (UINT32) -// AVEncVideoOutputColorTransferFunction (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputColorTransferFunction, "8c056111-a9c3-4b08-a0a0-ce13f8a27c75", 0x8c056111, 0xa9c3, 0x4b08, 0xa0, 0xa0, 0xce, 0x13, 0xf8, 0xa2, 0x7c, 0x75 ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputColorTransferFunction, "4a7f884a-ea11-460d-bf57-b88bc75900de", 0x4a7f884a, 0xea11, 0x460d, 0xbf, 0x57, 0xb8, 0x8b, 0xc7, 0x59, 0x00, 0xde ) - -enum eAVEncVideoColorTransferFunction -{ - eAVEncVideoColorTransferFunction_SameAsSource = 0, - eAVEncVideoColorTransferFunction_10 = 1, // (Linear, scRGB) - eAVEncVideoColorTransferFunction_18 = 2, - eAVEncVideoColorTransferFunction_20 = 3, - eAVEncVideoColorTransferFunction_22 = 4, // (BT470-2 SysM) - eAVEncVideoColorTransferFunction_22_709 = 5, // (BT709, SMPTE296M, SMPTE170M, BT470, SMPTE274M, BT.1361) - eAVEncVideoColorTransferFunction_22_240M = 6, // (SMPTE240M, interim 274M) - eAVEncVideoColorTransferFunction_22_8bit_sRGB = 7, // (sRGB) - eAVEncVideoColorTransferFunction_28 = 8 -}; - -// AVEncVideoInputColorTransferMatrix (UINT32) -// AVEncVideoOutputColorTransferMatrix (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputColorTransferMatrix, "52ed68b9-72d5-4089-958d-f5405d55081c", 0x52ed68b9, 0x72d5, 0x4089, 0x95, 0x8d, 0xf5, 0x40, 0x5d, 0x55, 0x08, 0x1c ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputColorTransferMatrix , "a9b90444-af40-4310-8fbe-ed6d933f892b", 0xa9b90444, 0xaf40, 0x4310, 0x8f, 0xbe, 0xed, 0x6d, 0x93, 0x3f, 0x89, 0x2b ) - - -enum eAVEncVideoColorTransferMatrix -{ - eAVEncVideoColorTransferMatrix_SameAsSource = 0, - eAVEncVideoColorTransferMatrix_BT709 = 1, - eAVEncVideoColorTransferMatrix_BT601 = 2, // (601, BT470-2 B,B, 170M) - eAVEncVideoColorTransferMatrix_SMPTE240M = 3 -}; - -// AVEncVideoInputColorLighting (UINT32) -// AVEncVideoOutputColorLighting (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputColorLighting, "46a99549-0015-4a45-9c30-1d5cfa258316", 0x46a99549, 0x0015, 0x4a45, 0x9c, 0x30, 0x1d, 0x5c, 0xfa, 0x25, 0x83, 0x16 ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputColorLighting , "0e5aaac6-ace6-4c5c-998e-1a8c9c6c0f89", 0x0e5aaac6, 0xace6, 0x4c5c, 0x99, 0x8e, 0x1a, 0x8c, 0x9c, 0x6c, 0x0f, 0x89 ) - -enum eAVEncVideoColorLighting -{ - eAVEncVideoColorLighting_SameAsSource = 0, - eAVEncVideoColorLighting_Unknown = 1, - eAVEncVideoColorLighting_Bright = 2, - eAVEncVideoColorLighting_Office = 3, - eAVEncVideoColorLighting_Dim = 4, - eAVEncVideoColorLighting_Dark = 5 -}; - -// AVEncVideoInputColorNominalRange (UINT32) -// AVEncVideoOutputColorNominalRange (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoInputColorNominalRange, "16cf25c6-a2a6-48e9-ae80-21aec41d427e", 0x16cf25c6, 0xa2a6, 0x48e9, 0xae, 0x80, 0x21, 0xae, 0xc4, 0x1d, 0x42, 0x7e ) -DEFINE_CODECAPI_GUID( AVEncVideoOutputColorNominalRange , "972835ed-87b5-4e95-9500-c73958566e54", 0x972835ed, 0x87b5, 0x4e95, 0x95, 0x00, 0xc7, 0x39, 0x58, 0x56, 0x6e, 0x54 ) - -enum eAVEncVideoColorNominalRange -{ - eAVEncVideoColorNominalRange_SameAsSource = 0, - eAVEncVideoColorNominalRange_0_255 = 1, // (8 bit: 0..255, 10 bit: 0..1023) - eAVEncVideoColorNominalRange_16_235 = 2, // (16..235, 64..940 (16*4...235*4) - eAVEncVideoColorNominalRange_48_208 = 3 // (48..208) -}; - -// AVEncInputVideoSystem (UINT32) -DEFINE_CODECAPI_GUID( AVEncInputVideoSystem, "bede146d-b616-4dc7-92b2-f5d9fa9298f7", 0xbede146d, 0xb616, 0x4dc7, 0x92, 0xb2, 0xf5, 0xd9, 0xfa, 0x92, 0x98, 0xf7 ) - -enum eAVEncInputVideoSystem -{ - eAVEncInputVideoSystem_Unspecified = 0, - eAVEncInputVideoSystem_PAL = 1, - eAVEncInputVideoSystem_NTSC = 2, - eAVEncInputVideoSystem_SECAM = 3, - eAVEncInputVideoSystem_MAC = 4, - eAVEncInputVideoSystem_HDV = 5, - eAVEncInputVideoSystem_Component = 6 -}; - -// AVEncVideoHeaderDropFrame (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoHeaderDropFrame, "6ed9e124-7925-43fe-971b-e019f62222b4", 0x6ed9e124, 0x7925, 0x43fe, 0x97, 0x1b, 0xe0, 0x19, 0xf6, 0x22, 0x22, 0xb4 ) - -// AVEncVideoHeaderHours (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoHeaderHours, "2acc7702-e2da-4158-bf9b-88880129d740", 0x2acc7702, 0xe2da, 0x4158, 0xbf, 0x9b, 0x88, 0x88, 0x01, 0x29, 0xd7, 0x40 ) - -// AVEncVideoHeaderMinutes (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoHeaderMinutes, "dc1a99ce-0307-408b-880b-b8348ee8ca7f", 0xdc1a99ce, 0x0307, 0x408b, 0x88, 0x0b, 0xb8, 0x34, 0x8e, 0xe8, 0xca, 0x7f ) - -// AVEncVideoHeaderSeconds (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoHeaderSeconds, "4a2e1a05-a780-4f58-8120-9a449d69656b", 0x4a2e1a05, 0xa780, 0x4f58, 0x81, 0x20, 0x9a, 0x44, 0x9d, 0x69, 0x65, 0x6b ) - -// AVEncVideoHeaderFrames (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoHeaderFrames, "afd5f567-5c1b-4adc-bdaf-735610381436", 0xafd5f567, 0x5c1b, 0x4adc, 0xbd, 0xaf, 0x73, 0x56, 0x10, 0x38, 0x14, 0x36 ) - -// AVEncVideoDefaultUpperFieldDominant (BOOL) -DEFINE_CODECAPI_GUID( AVEncVideoDefaultUpperFieldDominant, "810167c4-0bc1-47ca-8fc2-57055a1474a5", 0x810167c4, 0x0bc1, 0x47ca, 0x8f, 0xc2, 0x57, 0x05, 0x5a, 0x14, 0x74, 0xa5 ) - -// AVEncVideoCBRMotionTradeoff (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoCBRMotionTradeoff, "0d49451e-18d5-4367-a4ef-3240df1693c4", 0x0d49451e, 0x18d5, 0x4367, 0xa4, 0xef, 0x32, 0x40, 0xdf, 0x16, 0x93, 0xc4 ) - -// AVEncVideoCodedVideoAccessUnitSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoCodedVideoAccessUnitSize, "b4b10c15-14a7-4ce8-b173-dc90a0b4fcdb", 0xb4b10c15, 0x14a7, 0x4ce8, 0xb1, 0x73, 0xdc, 0x90, 0xa0, 0xb4, 0xfc, 0xdb ) - -// AVEncVideoMaxKeyframeDistance (UINT32) -DEFINE_CODECAPI_GUID( AVEncVideoMaxKeyframeDistance, "2987123a-ba93-4704-b489-ec1e5f25292c", 0x2987123a, 0xba93, 0x4704, 0xb4, 0x89, 0xec, 0x1e, 0x5f, 0x25, 0x29, 0x2c ) - - -// -// Audio/Video Mux -// - -// AVEncMuxOutputStreamType (UINT32) -DEFINE_CODECAPI_GUID( AVEncMuxOutputStreamType, "CEDD9E8F-34D3-44db-A1D8-F81520254F3E", 0xcedd9e8f, 0x34d3, 0x44db, 0xa1, 0xd8, 0xf8, 0x15, 0x20, 0x25, 0x4f, 0x3e) - -enum eAVEncMuxOutput -{ - eAVEncMuxOutputAuto = 0, // Decision is made automatically be the mux (elementary stream, program stream or transport stream) - eAVEncMuxOutputPS = 1, // Program stream - eAVEncMuxOutputTS = 2 // Transport stream -}; - - -// -// Common Post-Encode Video Statistical Parameters -// - -// AVEncStatVideoOutputFrameRate (UINT32/UINT32) -DEFINE_CODECAPI_GUID( AVEncStatVideoOutputFrameRate, "be747849-9ab4-4a63-98fe-f143f04f8ee9", 0xbe747849, 0x9ab4, 0x4a63, 0x98, 0xfe, 0xf1, 0x43, 0xf0, 0x4f, 0x8e, 0xe9 ) - -// AVEncStatVideoCodedFrames (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatVideoCodedFrames, "d47f8d61-6f5a-4a26-bb9f-cd9518462bcd", 0xd47f8d61, 0x6f5a, 0x4a26, 0xbb, 0x9f, 0xcd, 0x95, 0x18, 0x46, 0x2b, 0xcd ) - -// AVEncStatVideoTotalFrames (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatVideoTotalFrames, "fdaa9916-119a-4222-9ad6-3f7cab99cc8b", 0xfdaa9916, 0x119a, 0x4222, 0x9a, 0xd6, 0x3f, 0x7c, 0xab, 0x99, 0xcc, 0x8b ) - -// -// Common Audio Parameters -// - -// AVEncAudioIntervalToEncode (UINT64) -DEFINE_CODECAPI_GUID( AVEncAudioIntervalToEncode, "866e4b4d-725a-467c-bb01-b496b23b25f9", 0x866e4b4d, 0x725a, 0x467c, 0xbb, 0x01, 0xb4, 0x96, 0xb2, 0x3b, 0x25, 0xf9 ) - -// AVEncAudioIntervalToSkip (UINT64) -DEFINE_CODECAPI_GUID( AVEncAudioIntervalToSkip, "88c15f94-c38c-4796-a9e8-96e967983f26", 0x88c15f94, 0xc38c, 0x4796, 0xa9, 0xe8, 0x96, 0xe9, 0x67, 0x98, 0x3f, 0x26 ) - -// AVEncAudioDualMono (UINT32) - Read/Write -// Some audio encoders can encode 2 channel input as "dual mono". Use this -// property to set the appropriate field in the bitstream header to indicate that the -// 2 channel bitstream is or isn't dual mono. -// For encoding MPEG audio, use the DualChannel option in AVEncMPACodingMode instead -DEFINE_CODECAPI_GUID( AVEncAudioDualMono, "3648126b-a3e8-4329-9b3a-5ce566a43bd3", 0x3648126b, 0xa3e8, 0x4329, 0x9b, 0x3a, 0x5c, 0xe5, 0x66, 0xa4, 0x3b, 0xd3 ) - -enum eAVEncAudioDualMono -{ - eAVEncAudioDualMono_SameAsInput = 0, // As indicated by input media type - eAVEncAudioDualMono_Off = 1, // 2-ch output bitstream should not be dual mono - eAVEncAudioDualMono_On = 2 // 2-ch output bitstream should be dual mono -}; - -// AVEncAudioMeanBitRate (UINT32) - Read/Write - Used to specify audio bitrate (in bits per second) when the encoder is instantiated as an audio+video encoder. -DEFINE_CODECAPI_GUID( AVEncAudioMeanBitRate, "921295bb-4fca-4679-aab8-9e2a1d753384", 0x921295bb, 0x4fca, 0x4679, 0xaa, 0xb8, 0x9e, 0x2a, 0x1d, 0x75, 0x33, 0x84 ) - -// AVEncAudioMapDestChannel0..15 (UINT32) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel0, "bc5d0b60-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b60, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel1, "bc5d0b61-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b61, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel2, "bc5d0b62-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b62, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel3, "bc5d0b63-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b63, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel4, "bc5d0b64-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b64, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel5, "bc5d0b65-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b65, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel6, "bc5d0b66-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b66, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel7, "bc5d0b67-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b67, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel8, "bc5d0b68-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b68, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel9, "bc5d0b69-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b69, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel10, "bc5d0b6a-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6a, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel11, "bc5d0b6b-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6b, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel12, "bc5d0b6c-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6c, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel13, "bc5d0b6d-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6d, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel14, "bc5d0b6e-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6e, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) -DEFINE_CODECAPI_GUID( AVEncAudioMapDestChannel15, "bc5d0b6f-df6a-4e16-9803-b82007a30c8d", 0xbc5d0b6f, 0xdf6a, 0x4e16, 0x98, 0x03, 0xb8, 0x20, 0x07, 0xa3, 0x0c, 0x8d ) - -// AVEncAudioInputContent (UINT32) <---- You have ENUM in the doc -DEFINE_CODECAPI_GUID( AVEncAudioInputContent, "3e226c2b-60b9-4a39-b00b-a7b40f70d566", 0x3e226c2b, 0x60b9, 0x4a39, 0xb0, 0x0b, 0xa7, 0xb4, 0x0f, 0x70, 0xd5, 0x66 ) - -enum eAVEncAudioInputContent -{ - AVEncAudioInputContent_Unknown =0, - AVEncAudioInputContent_Voice = 1, - AVEncAudioInputContent_Music = 2 -}; - -// -// Common Post-Encode Audio Statistical Parameters -// - -// AVEncStatAudioPeakPCMValue (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatAudioPeakPCMValue, "dce7fd34-dc00-4c16-821b-35d9eb00fb1a", 0xdce7fd34, 0xdc00, 0x4c16, 0x82, 0x1b, 0x35, 0xd9, 0xeb, 0x00, 0xfb, 0x1a ) - -// AVEncStatAudioAveragePCMValue (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatAudioAveragePCMValue, "979272f8-d17f-4e32-bb73-4e731c68ba2d", 0x979272f8, 0xd17f, 0x4e32, 0xbb, 0x73, 0x4e, 0x73, 0x1c, 0x68, 0xba, 0x2d ) - -// AVEncStatAverageBPS (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatAudioAverageBPS, "ca6724db-7059-4351-8b43-f82198826a14", 0xca6724db, 0x7059, 0x4351, 0x8b, 0x43, 0xf8, 0x21, 0x98, 0x82, 0x6a, 0x14 ) -DEFINE_CODECAPI_GUID( AVEncStatAverageBPS, "ca6724db-7059-4351-8b43-f82198826a14", 0xca6724db, 0x7059, 0x4351, 0x8b, 0x43, 0xf8, 0x21, 0x98, 0x82, 0x6a, 0x14 ) - -// AVEncStatHardwareProcessorUtilitization (UINT32) -// HW usage % x 1000 -DEFINE_CODECAPI_GUID( AVEncStatHardwareProcessorUtilitization, "995dc027-cb95-49e6-b91b-5967753cdcb8", 0x995dc027, 0xcb95, 0x49e6, 0xb9, 0x1b, 0x59, 0x67, 0x75, 0x3c, 0xdc, 0xb8 ) - -// AVEncStatHardwareBandwidthUtilitization (UINT32) -// HW usage % x 1000 -DEFINE_CODECAPI_GUID( AVEncStatHardwareBandwidthUtilitization, "0124ba9b-dc41-4826-b45f-18ac01b3d5a8", 0x0124ba9b, 0xdc41, 0x4826, 0xb4, 0x5f, 0x18, 0xac, 0x01, 0xb3, 0xd5, 0xa8 ) - -// -// MPEG Video Encoding Interface -// - -// -// MPV Encoder Specific Parameters -// - -// AVEncMPVGOPSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVGOPSize, "95f31b26-95a4-41aa-9303-246a7fc6eef1", 0x95f31b26, 0x95a4, 0x41aa, 0x93, 0x03, 0x24, 0x6a, 0x7f, 0xc6, 0xee, 0xf1 ) - -// AVEncMPVGOPOpen (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGOPOpen, "b1d5d4a6-3300-49b1-ae61-a09937ab0e49", 0xb1d5d4a6, 0x3300, 0x49b1, 0xae, 0x61, 0xa0, 0x99, 0x37, 0xab, 0x0e, 0x49 ) - -// AVEncMPVDefaultBPictureCount (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVDefaultBPictureCount, "8d390aac-dc5c-4200-b57f-814d04babab2", 0x8d390aac, 0xdc5c, 0x4200, 0xb5, 0x7f, 0x81, 0x4d, 0x04, 0xba, 0xba, 0xb2 ) - -// AVEncMPVProfile (UINT32) <---- You have GUID in the doc -DEFINE_CODECAPI_GUID( AVEncMPVProfile, "dabb534a-1d99-4284-975a-d90e2239baa1", 0xdabb534a, 0x1d99, 0x4284, 0x97, 0x5a, 0xd9, 0x0e, 0x22, 0x39, 0xba, 0xa1 ) - -enum eAVEncMPVProfile -{ - eAVEncMPVProfile_unknown = 0, - eAVEncMPVProfile_Simple = 1, - eAVEncMPVProfile_Main = 2, - eAVEncMPVProfile_High = 3, - eAVEncMPVProfile_422 = 4, -}; - -// AVEncMPVLevel (UINT32) <---- You have GUID in the doc -DEFINE_CODECAPI_GUID( AVEncMPVLevel, "6ee40c40-a60c-41ef-8f50-37c2249e2cb3", 0x6ee40c40, 0xa60c, 0x41ef, 0x8f, 0x50, 0x37, 0xc2, 0x24, 0x9e, 0x2c, 0xb3 ) - -enum eAVEncMPVLevel -{ - eAVEncMPVLevel_Low = 1, - eAVEncMPVLevel_Main = 2, - eAVEncMPVLevel_High1440 = 3, - eAVEncMPVLevel_High = 4, -}; - - -enum eAVEncH264VProfile -{ - eAVEncH264VProfile_unknown = 0, - eAVEncH264VProfile_Simple = 66, - eAVEncH264VProfile_Base = 66, - eAVEncH264VProfile_Main = 77, - eAVEncH264VProfile_High = 100, - eAVEncH264VProfile_422 = 122, - eAVEncH264VProfile_High10 = 110, - eAVEncH264VProfile_444 = 144, - eAVEncH264VProfile_Extended = 88 -}; - -#define AVENC_H264V_LEVELCOUNT 16 -#define AVENC_H264V_MAX_MBBITS 3200 //Only applies to Baseline, Main, Extended profiles - -enum eAVEncH264VLevel -{ - eAVEncH264VLevel1 = 10, - eAVEncH264VLevel1_b = 11, - eAVEncH264VLevel1_1 = 11, - eAVEncH264VLevel1_2 = 12, - eAVEncH264VLevel1_3 = 13, - eAVEncH264VLevel2 = 20, - eAVEncH264VLevel2_1 = 21, - eAVEncH264VLevel2_2 = 22, - eAVEncH264VLevel3 = 30, - eAVEncH264VLevel3_1 = 31, - eAVEncH264VLevel3_2 = 32, - eAVEncH264VLevel4 = 40, - eAVEncH264VLevel4_1 = 41, - eAVEncH264VLevel4_2 = 42, - eAVEncH264VLevel5 = 50, - eAVEncH264VLevel5_1 = 51 -}; - -// AVEncMPVFrameFieldMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVFrameFieldMode, "acb5de96-7b93-4c2f-8825-b0295fa93bf4", 0xacb5de96, 0x7b93, 0x4c2f, 0x88, 0x25, 0xb0, 0x29, 0x5f, 0xa9, 0x3b, 0xf4 ) - -enum eAVEncMPVFrameFieldMode -{ - eAVEncMPVFrameFieldMode_FieldMode = 0, - eAVEncMPVFrameFieldMode_FrameMode = 1 -}; - -// -// Advanced MPV Encoder Specific Parameters -// - -// AVEncMPVAddSeqEndCode (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVAddSeqEndCode, "a823178f-57df-4c7a-b8fd-e5ec8887708d", 0xa823178f, 0x57df, 0x4c7a, 0xb8, 0xfd, 0xe5, 0xec, 0x88, 0x87, 0x70, 0x8d ) - -// AVEncMPVGOPSInSeq (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVGOPSInSeq, "993410d4-2691-4192-9978-98dc2603669f", 0x993410d4, 0x2691, 0x4192, 0x99, 0x78, 0x98, 0xdc, 0x26, 0x03, 0x66, 0x9f ) - -// AVEncMPVUseConcealmentMotionVectors (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVUseConcealmentMotionVectors, "ec770cf3-6908-4b4b-aa30-7fb986214fea", 0xec770cf3, 0x6908, 0x4b4b, 0xaa, 0x30, 0x7f, 0xb9, 0x86, 0x21, 0x4f, 0xea ) - -// AVEncMPVSceneDetection (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVSceneDetection, "552799f1-db4c-405b-8a3a-c93f2d0674dc", 0x552799f1, 0xdb4c, 0x405b, 0x8a, 0x3a, 0xc9, 0x3f, 0x2d, 0x06, 0x74, 0xdc ) - -enum eAVEncMPVSceneDetection -{ - eAVEncMPVSceneDetection_None = 0, - eAVEncMPVSceneDetection_InsertIPicture = 1, - eAVEncMPVSceneDetection_StartNewGOP = 2, - eAVEncMPVSceneDetection_StartNewLocatableGOP = 3 -}; - -// AVEncMPVGenerateHeaderSeqExt (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGenerateHeaderSeqExt, "d5e78611-082d-4e6b-98af-0f51ab139222", 0xd5e78611, 0x082d, 0x4e6b, 0x98, 0xaf, 0x0f, 0x51, 0xab, 0x13, 0x92, 0x22 ) - -// AVEncMPVGenerateHeaderSeqDispExt (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGenerateHeaderSeqDispExt, "6437aa6f-5a3c-4de9-8a16-53d9c4ad326f", 0x6437aa6f, 0x5a3c, 0x4de9, 0x8a, 0x16, 0x53, 0xd9, 0xc4, 0xad, 0x32, 0x6f ) - -// AVEncMPVGenerateHeaderPicExt (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGenerateHeaderPicExt, "1b8464ab-944f-45f0-b74e-3a58dad11f37", 0x1b8464ab, 0x944f, 0x45f0, 0xb7, 0x4e, 0x3a, 0x58, 0xda, 0xd1, 0x1f, 0x37 ) - -// AVEncMPVGenerateHeaderPicDispExt (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGenerateHeaderPicDispExt, "c6412f84-c03f-4f40-a00c-4293df8395bb", 0xc6412f84, 0xc03f, 0x4f40, 0xa0, 0x0c, 0x42, 0x93, 0xdf, 0x83, 0x95, 0xbb ) - -// AVEncMPVGenerateHeaderSeqScaleExt (BOOL) -DEFINE_CODECAPI_GUID( AVEncMPVGenerateHeaderSeqScaleExt, "0722d62f-dd59-4a86-9cd5-644f8e2653d8", 0x0722d62f, 0xdd59, 0x4a86, 0x9c, 0xd5, 0x64, 0x4f, 0x8e, 0x26, 0x53, 0xd8 ) - -// AVEncMPVScanPattern (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVScanPattern, "7f8a478e-7bbb-4ae2-b2fc-96d17fc4a2d6", 0x7f8a478e, 0x7bbb, 0x4ae2, 0xb2, 0xfc, 0x96, 0xd1, 0x7f, 0xc4, 0xa2, 0xd6 ) - -enum eAVEncMPVScanPattern -{ - eAVEncMPVScanPattern_Auto = 0, - eAVEncMPVScanPattern_ZigZagScan = 1, - eAVEncMPVScanPattern_AlternateScan = 2 -}; - -// AVEncMPVIntraDCPrecision (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVIntraDCPrecision, "a0116151-cbc8-4af3-97dc-d00cceb82d79", 0xa0116151, 0xcbc8, 0x4af3, 0x97, 0xdc, 0xd0, 0x0c, 0xce, 0xb8, 0x2d, 0x79 ) - -// AVEncMPVQScaleType (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVQScaleType, "2b79ebb7-f484-4af7-bb58-a2a188c5cbbe", 0x2b79ebb7, 0xf484, 0x4af7, 0xbb, 0x58, 0xa2, 0xa1, 0x88, 0xc5, 0xcb, 0xbe ) - -enum eAVEncMPVQScaleType -{ - eAVEncMPVQScaleType_Auto = 0, - eAVEncMPVQScaleType_Linear = 1, - eAVEncMPVQScaleType_NonLinear = 2 -}; - -// AVEncMPVIntraVLCTable (UINT32) -DEFINE_CODECAPI_GUID( AVEncMPVIntraVLCTable, "a2b83ff5-1a99-405a-af95-c5997d558d3a", 0xa2b83ff5, 0x1a99, 0x405a, 0xaf, 0x95, 0xc5, 0x99, 0x7d, 0x55, 0x8d, 0x3a ) - -enum eAVEncMPVIntraVLCTable -{ - eAVEncMPVIntraVLCTable_Auto = 0, - eAVEncMPVIntraVLCTable_MPEG1 = 1, - eAVEncMPVIntraVLCTable_Alternate = 2 -}; - -// AVEncMPVQuantMatrixIntra (BYTE[64] encoded as a string of 128 hex digits) -DEFINE_CODECAPI_GUID( AVEncMPVQuantMatrixIntra, "9bea04f3-6621-442c-8ba1-3ac378979698", 0x9bea04f3, 0x6621, 0x442c, 0x8b, 0xa1, 0x3a, 0xc3, 0x78, 0x97, 0x96, 0x98 ) - -// AVEncMPVQuantMatrixNonIntra (BYTE[64] encoded as a string of 128 hex digits) -DEFINE_CODECAPI_GUID( AVEncMPVQuantMatrixNonIntra, "87f441d8-0997-4beb-a08e-8573d409cf75", 0x87f441d8, 0x0997, 0x4beb, 0xa0, 0x8e, 0x85, 0x73, 0xd4, 0x09, 0xcf, 0x75 ) - -// AVEncMPVQuantMatrixChromaIntra (BYTE[64] encoded as a string of 128 hex digits) -DEFINE_CODECAPI_GUID( AVEncMPVQuantMatrixChromaIntra, "9eb9ecd4-018d-4ffd-8f2d-39e49f07b17a", 0x9eb9ecd4, 0x018d, 0x4ffd, 0x8f, 0x2d, 0x39, 0xe4, 0x9f, 0x07, 0xb1, 0x7a ) - -// AVEncMPVQuantMatrixChromaNonIntra (BYTE[64] encoded as a string of 128 hex digits) -DEFINE_CODECAPI_GUID( AVEncMPVQuantMatrixChromaNonIntra, "1415b6b1-362a-4338-ba9a-1ef58703c05b", 0x1415b6b1, 0x362a, 0x4338, 0xba, 0x9a, 0x1e, 0xf5, 0x87, 0x03, 0xc0, 0x5b ) - -// -// MPEG1 Audio Encoding Interface -// - -// -// MPEG1 Audio Specific Parameters -// - -// AVEncMPALayer (UINT) -DEFINE_CODECAPI_GUID( AVEncMPALayer, "9d377230-f91b-453d-9ce0-78445414c22d", 0x9d377230, 0xf91b, 0x453d, 0x9c, 0xe0, 0x78, 0x44, 0x54, 0x14, 0xc2, 0x2d ) - -enum eAVEncMPALayer -{ - eAVEncMPALayer_1 = 1, - eAVEncMPALayer_2 = 2, - eAVEncMPALayer_3 = 3 -}; - -// AVEncMPACodingMode (UINT) -DEFINE_CODECAPI_GUID( AVEncMPACodingMode, "b16ade03-4b93-43d7-a550-90b4fe224537", 0xb16ade03, 0x4b93, 0x43d7, 0xa5, 0x50, 0x90, 0xb4, 0xfe, 0x22, 0x45, 0x37 ) - -enum eAVEncMPACodingMode -{ - eAVEncMPACodingMode_Mono = 0, - eAVEncMPACodingMode_Stereo = 1, - eAVEncMPACodingMode_DualChannel = 2, - eAVEncMPACodingMode_JointStereo = 3, - eAVEncMPACodingMode_Surround = 4 -}; - -// AVEncMPACopyright (BOOL) - default state to encode into the stream (may be overridden by input) -// 1 (true) - copyright protected -// 0 (false) - not copyright protected -DEFINE_CODECAPI_GUID( AVEncMPACopyright, "a6ae762a-d0a9-4454-b8ef-f2dbeefdd3bd", 0xa6ae762a, 0xd0a9, 0x4454, 0xb8, 0xef, 0xf2, 0xdb, 0xee, 0xfd, 0xd3, 0xbd ) - -// AVEncMPAOriginalBitstream (BOOL) - default value to encode into the stream (may be overridden by input) -// 1 (true) - for original bitstream -// 0 (false) - for copy bitstream -DEFINE_CODECAPI_GUID( AVEncMPAOriginalBitstream, "3cfb7855-9cc9-47ff-b829-b36786c92346", 0x3cfb7855, 0x9cc9, 0x47ff, 0xb8, 0x29, 0xb3, 0x67, 0x86, 0xc9, 0x23, 0x46 ) - -// AVEncMPAEnableRedundancyProtection (BOOL) -// 1 (true) - Redundancy should be added to facilitate error detection and concealment (CRC) -// 0 (false) - No redundancy should be added -DEFINE_CODECAPI_GUID( AVEncMPAEnableRedundancyProtection, "5e54b09e-b2e7-4973-a89b-0b3650a3beda", 0x5e54b09e, 0xb2e7, 0x4973, 0xa8, 0x9b, 0x0b, 0x36, 0x50, 0xa3, 0xbe, 0xda ) - -// AVEncMPAPrivateUserBit (UINT) - User data bit value to encode in the stream -DEFINE_CODECAPI_GUID( AVEncMPAPrivateUserBit, "afa505ce-c1e3-4e3d-851b-61b700e5e6cc", 0xafa505ce, 0xc1e3, 0x4e3d, 0x85, 0x1b, 0x61, 0xb7, 0x00, 0xe5, 0xe6, 0xcc ) - -// AVEncMPAEmphasisType (UINT) -// Indicates type of de-emphasis filter to be used -DEFINE_CODECAPI_GUID( AVEncMPAEmphasisType, "2d59fcda-bf4e-4ed6-b5df-5b03b36b0a1f", 0x2d59fcda, 0xbf4e, 0x4ed6, 0xb5, 0xdf, 0x5b, 0x03, 0xb3, 0x6b, 0x0a, 0x1f ) - -enum eAVEncMPAEmphasisType -{ - eAVEncMPAEmphasisType_None = 0, - eAVEncMPAEmphasisType_50_15 = 1, - eAVEncMPAEmphasisType_Reserved = 2, - eAVEncMPAEmphasisType_CCITT_J17 = 3, -}; - -// -// Dolby Digital(TM) Audio Encoding Interface -// - -// -// Dolby Digital(TM) Audio Specific Parameters -// - -// AVEncDDService (UINT) -DEFINE_CODECAPI_GUID( AVEncDDService, "d2e1bec7-5172-4d2a-a50e-2f3b82b1ddf8", 0xd2e1bec7, 0x5172, 0x4d2a, 0xa5, 0x0e, 0x2f, 0x3b, 0x82, 0xb1, 0xdd, 0xf8 ) - -enum eAVEncDDService -{ - eAVEncDDService_CM = 0, // (Main Service: Complete Main) - eAVEncDDService_ME = 1, // (Main Service: Music and Effects (ME)) - eAVEncDDService_VI = 2, // (Associated Service: Visually-Impaired (VI) - eAVEncDDService_HI = 3, // (Associated Service: Hearing-Impaired (HI)) - eAVEncDDService_D = 4, // (Associated Service: Dialog (D)) - eAVEncDDService_C = 5, // (Associated Service: Commentary (C)) - eAVEncDDService_E = 6, // (Associated Service: Emergency (E)) - eAVEncDDService_VO = 7 // (Associated Service: Voice Over (VO) / Karaoke) -}; - -// AVEncDDDialogNormalization (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDDialogNormalization, "d7055acf-f125-437d-a704-79c79f0404a8", 0xd7055acf, 0xf125, 0x437d, 0xa7, 0x04, 0x79, 0xc7, 0x9f, 0x04, 0x04, 0xa8 ) - -// AVEncDDCentreDownMixLevel (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDCentreDownMixLevel, "e285072c-c958-4a81-afd2-e5e0daf1b148", 0xe285072c, 0xc958, 0x4a81, 0xaf, 0xd2, 0xe5, 0xe0, 0xda, 0xf1, 0xb1, 0x48 ) - -// AVEncDDSurroundDownMixLevel (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDSurroundDownMixLevel, "7b20d6e5-0bcf-4273-a487-506b047997e9", 0x7b20d6e5, 0x0bcf, 0x4273, 0xa4, 0x87, 0x50, 0x6b, 0x04, 0x79, 0x97, 0xe9 ) - -// AVEncDDProductionInfoExists (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDProductionInfoExists, "b0b7fe5f-b6ab-4f40-964d-8d91f17c19e8", 0xb0b7fe5f, 0xb6ab, 0x4f40, 0x96, 0x4d, 0x8d, 0x91, 0xf1, 0x7c, 0x19, 0xe8 ) - -// AVEncDDProductionRoomType (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDProductionRoomType, "dad7ad60-23d8-4ab7-a284-556986d8a6fe", 0xdad7ad60, 0x23d8, 0x4ab7, 0xa2, 0x84, 0x55, 0x69, 0x86, 0xd8, 0xa6, 0xfe ) - -enum eAVEncDDProductionRoomType -{ - eAVEncDDProductionRoomType_NotIndicated = 0, - eAVEncDDProductionRoomType_Large = 1, - eAVEncDDProductionRoomType_Small = 2 -}; - -// AVEncDDProductionMixLevel (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDProductionMixLevel, "301d103a-cbf9-4776-8899-7c15b461ab26", 0x301d103a, 0xcbf9, 0x4776, 0x88, 0x99, 0x7c, 0x15, 0xb4, 0x61, 0xab, 0x26 ) - -// AVEncDDCopyright (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDCopyright, "8694f076-cd75-481d-a5c6-a904dcc828f0", 0x8694f076, 0xcd75, 0x481d, 0xa5, 0xc6, 0xa9, 0x04, 0xdc, 0xc8, 0x28, 0xf0 ) - -// AVEncDDOriginalBitstream (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDOriginalBitstream, "966ae800-5bd3-4ff9-95b9-d30566273856", 0x966ae800, 0x5bd3, 0x4ff9, 0x95, 0xb9, 0xd3, 0x05, 0x66, 0x27, 0x38, 0x56 ) - -// AVEncDDDigitalDeemphasis (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDDigitalDeemphasis, "e024a2c2-947c-45ac-87d8-f1030c5c0082", 0xe024a2c2, 0x947c, 0x45ac, 0x87, 0xd8, 0xf1, 0x03, 0x0c, 0x5c, 0x00, 0x82 ) - -// AVEncDDDCHighPassFilter (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDDCHighPassFilter, "9565239f-861c-4ac8-bfda-e00cb4db8548", 0x9565239f, 0x861c, 0x4ac8, 0xbf, 0xda, 0xe0, 0x0c, 0xb4, 0xdb, 0x85, 0x48 ) - -// AVEncDDChannelBWLowPassFilter (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDChannelBWLowPassFilter, "e197821d-d2e7-43e2-ad2c-00582f518545", 0xe197821d, 0xd2e7, 0x43e2, 0xad, 0x2c, 0x00, 0x58, 0x2f, 0x51, 0x85, 0x45 ) - -// AVEncDDLFELowPassFilter (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDLFELowPassFilter, "d3b80f6f-9d15-45e5-91be-019c3fab1f01", 0xd3b80f6f, 0x9d15, 0x45e5, 0x91, 0xbe, 0x01, 0x9c, 0x3f, 0xab, 0x1f, 0x01 ) - -// AVEncDDSurround90DegreeePhaseShift (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDSurround90DegreeePhaseShift, "25ecec9d-3553-42c0-bb56-d25792104f80", 0x25ecec9d, 0x3553, 0x42c0, 0xbb, 0x56, 0xd2, 0x57, 0x92, 0x10, 0x4f, 0x80 ) - -// AVEncDDSurround3dBAttenuation (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDSurround3dBAttenuation, "4d43b99d-31e2-48b9-bf2e-5cbf1a572784", 0x4d43b99d, 0x31e2, 0x48b9, 0xbf, 0x2e, 0x5c, 0xbf, 0x1a, 0x57, 0x27, 0x84 ) - -// AVEncDDDynamicRangeCompressionControl (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDDynamicRangeCompressionControl, "cfc2ff6d-79b8-4b8d-a8aa-a0c9bd1c2940", 0xcfc2ff6d, 0x79b8, 0x4b8d, 0xa8, 0xaa, 0xa0, 0xc9, 0xbd, 0x1c, 0x29, 0x40 ) - -enum eAVEncDDDynamicRangeCompressionControl -{ - eAVEncDDDynamicRangeCompressionControl_None = 0, - eAVEncDDDynamicRangeCompressionControl_FilmStandard = 1, - eAVEncDDDynamicRangeCompressionControl_FilmLight = 2, - eAVEncDDDynamicRangeCompressionControl_MusicStandard = 3, - eAVEncDDDynamicRangeCompressionControl_MusicLight = 4, - eAVEncDDDynamicRangeCompressionControl_Speech = 5 -}; - -// AVEncDDRFPreEmphasisFilter (BOOL) -DEFINE_CODECAPI_GUID( AVEncDDRFPreEmphasisFilter, "21af44c0-244e-4f3d-a2cc-3d3068b2e73f", 0x21af44c0, 0x244e, 0x4f3d, 0xa2, 0xcc, 0x3d, 0x30, 0x68, 0xb2, 0xe7, 0x3f ) - -// AVEncDDSurroundExMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDSurroundExMode, "91607cee-dbdd-4eb6-bca2-aadfafa3dd68", 0x91607cee, 0xdbdd, 0x4eb6, 0xbc, 0xa2, 0xaa, 0xdf, 0xaf, 0xa3, 0xdd, 0x68 ) - -enum eAVEncDDSurroundExMode -{ - eAVEncDDSurroundExMode_NotIndicated = 0, - eAVEncDDSurroundExMode_No = 1, - eAVEncDDSurroundExMode_Yes = 2 -}; - -// AVEncDDPreferredStereoDownMixMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDPreferredStereoDownMixMode, "7f4e6b31-9185-403d-b0a2-763743e6f063", 0x7f4e6b31, 0x9185, 0x403d, 0xb0, 0xa2, 0x76, 0x37, 0x43, 0xe6, 0xf0, 0x63 ) - -enum eAVEncDDPreferredStereoDownMixMode -{ - eAVEncDDPreferredStereoDownMixMode_LtRt = 0, - eAVEncDDPreferredStereoDownMixMode_LoRo = 1 -}; - -// AVEncDDLtRtCenterMixLvl_x10 (INT32) -DEFINE_CODECAPI_GUID( AVEncDDLtRtCenterMixLvl_x10, "dca128a2-491f-4600-b2da-76e3344b4197", 0xdca128a2, 0x491f, 0x4600, 0xb2, 0xda, 0x76, 0xe3, 0x34, 0x4b, 0x41, 0x97 ) - -// AVEncDDLtRtSurroundMixLvl_x10 (INT32) -DEFINE_CODECAPI_GUID( AVEncDDLtRtSurroundMixLvl_x10, "212246c7-3d2c-4dfa-bc21-652a9098690d", 0x212246c7, 0x3d2c, 0x4dfa, 0xbc, 0x21, 0x65, 0x2a, 0x90, 0x98, 0x69, 0x0d ) - -// AVEncDDLoRoCenterMixLvl (INT32) -DEFINE_CODECAPI_GUID( AVEncDDLoRoCenterMixLvl_x10, "1cfba222-25b3-4bf4-9bfd-e7111267858c", 0x1cfba222, 0x25b3, 0x4bf4, 0x9b, 0xfd, 0xe7, 0x11, 0x12, 0x67, 0x85, 0x8c ) - -// AVEncDDLoRoSurroundMixLvl_x10 (INT32) -DEFINE_CODECAPI_GUID( AVEncDDLoRoSurroundMixLvl_x10, "e725cff6-eb56-40c7-8450-2b9367e91555", 0xe725cff6, 0xeb56, 0x40c7, 0x84, 0x50, 0x2b, 0x93, 0x67, 0xe9, 0x15, 0x55 ) - -// AVEncDDAtoDConverterType (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDAtoDConverterType, "719f9612-81a1-47e0-9a05-d94ad5fca948", 0x719f9612, 0x81a1, 0x47e0, 0x9a, 0x05, 0xd9, 0x4a, 0xd5, 0xfc, 0xa9, 0x48 ) - -enum eAVEncDDAtoDConverterType -{ - eAVEncDDAtoDConverterType_Standard = 0, - eAVEncDDAtoDConverterType_HDCD = 1 -}; - -// AVEncDDHeadphoneMode (UINT32) -DEFINE_CODECAPI_GUID( AVEncDDHeadphoneMode, "4052dbec-52f5-42f5-9b00-d134b1341b9d", 0x4052dbec, 0x52f5, 0x42f5, 0x9b, 0x00, 0xd1, 0x34, 0xb1, 0x34, 0x1b, 0x9d ) - -enum eAVEncDDHeadphoneMode -{ - eAVEncDDHeadphoneMode_NotIndicated = 0, - eAVEncDDHeadphoneMode_NotEncoded = 1, - eAVEncDDHeadphoneMode_Encoded = 2 -}; - -// -// WMV Video Encoding Interface -// - -// -// WMV Video Specific Parameters -// - -// AVEncWMVKeyFrameDistance (UINT32) -DEFINE_CODECAPI_GUID( AVEncWMVKeyFrameDistance, "5569055e-e268-4771-b83e-9555ea28aed3", 0x5569055e, 0xe268, 0x4771, 0xb8, 0x3e, 0x95, 0x55, 0xea, 0x28, 0xae, 0xd3 ) - -// AVEncWMVInterlacedEncoding (UINT32) -DEFINE_CODECAPI_GUID( AVEncWMVInterlacedEncoding, "e3d00f8a-c6f5-4e14-a588-0ec87a726f9b", 0xe3d00f8a, 0xc6f5, 0x4e14, 0xa5, 0x88, 0x0e, 0xc8, 0x7a, 0x72, 0x6f, 0x9b ) - -// AVEncWMVDecoderComplexity (UINT32) -DEFINE_CODECAPI_GUID( AVEncWMVDecoderComplexity, "f32c0dab-f3cb-4217-b79f-8762768b5f67", 0xf32c0dab, 0xf3cb, 0x4217, 0xb7, 0x9f, 0x87, 0x62, 0x76, 0x8b, 0x5f, 0x67 ) - -// AVEncWMVHasKeyFrameBufferLevelMarker (BOOL) -DEFINE_CODECAPI_GUID( AVEncWMVKeyFrameBufferLevelMarker, "51ff1115-33ac-426c-a1b1-09321bdf96b4", 0x51ff1115, 0x33ac, 0x426c, 0xa1, 0xb1, 0x09, 0x32, 0x1b, 0xdf, 0x96, 0xb4 ) - -// AVEncWMVProduceDummyFrames (UINT32) -DEFINE_CODECAPI_GUID( AVEncWMVProduceDummyFrames, "d669d001-183c-42e3-a3ca-2f4586d2396c", 0xd669d001, 0x183c, 0x42e3, 0xa3, 0xca, 0x2f, 0x45, 0x86, 0xd2, 0x39, 0x6c ) - -// -// WMV Post-Encode Statistical Parameters -// - -// AVEncStatWMVCBAvg (UINT32/UINT32) -DEFINE_CODECAPI_GUID( AVEncStatWMVCBAvg, "6aa6229f-d602-4b9d-b68c-c1ad78884bef", 0x6aa6229f, 0xd602, 0x4b9d, 0xb6, 0x8c, 0xc1, 0xad, 0x78, 0x88, 0x4b, 0xef ) - -// AVEncStatWMVCBMax (UINT32/UINT32) -DEFINE_CODECAPI_GUID( AVEncStatWMVCBMax, "e976bef8-00fe-44b4-b625-8f238bc03499", 0xe976bef8, 0x00fe, 0x44b4, 0xb6, 0x25, 0x8f, 0x23, 0x8b, 0xc0, 0x34, 0x99 ) - -// AVEncStatWMVDecoderComplexityProfile (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatWMVDecoderComplexityProfile, "89e69fc3-0f9b-436c-974a-df821227c90d", 0x89e69fc3, 0x0f9b, 0x436c, 0x97, 0x4a, 0xdf, 0x82, 0x12, 0x27, 0xc9, 0x0d ) - -// AVEncStatMPVSkippedEmptyFrames (UINT32) -DEFINE_CODECAPI_GUID( AVEncStatMPVSkippedEmptyFrames, "32195fd3-590d-4812-a7ed-6d639a1f9711", 0x32195fd3, 0x590d, 0x4812, 0xa7, 0xed, 0x6d, 0x63, 0x9a, 0x1f, 0x97, 0x11 ) - -// -// MPEG1/2 Multiplexer Interfaces -// - -// -// MPEG1/2 Packetizer Interface -// - -// Shared with Mux: -// AVEncMP12MuxEarliestPTS (UINT32) -// AVEncMP12MuxLargestPacketSize (UINT32) -// AVEncMP12MuxSysSTDBufferBound (UINT32) - -// AVEncMP12PktzSTDBuffer (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12PktzSTDBuffer, "0b751bd0-819e-478c-9435-75208926b377", 0x0b751bd0, 0x819e, 0x478c, 0x94, 0x35, 0x75, 0x20, 0x89, 0x26, 0xb3, 0x77 ) - -// AVEncMP12PktzStreamID (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12PktzStreamID, "c834d038-f5e8-4408-9b60-88f36493fedf", 0xc834d038, 0xf5e8, 0x4408, 0x9b, 0x60, 0x88, 0xf3, 0x64, 0x93, 0xfe, 0xdf ) - -// AVEncMP12PktzInitialPTS (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12PktzInitialPTS, "2a4f2065-9a63-4d20-ae22-0a1bc896a315", 0x2a4f2065, 0x9a63, 0x4d20, 0xae, 0x22, 0x0a, 0x1b, 0xc8, 0x96, 0xa3, 0x15 ) - -// AVEncMP12PktzPacketSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12PktzPacketSize, "ab71347a-1332-4dde-a0e5-ccf7da8a0f22", 0xab71347a, 0x1332, 0x4dde, 0xa0, 0xe5, 0xcc, 0xf7, 0xda, 0x8a, 0x0f, 0x22 ) - -// AVEncMP12PktzCopyright (BOOL) -DEFINE_CODECAPI_GUID( AVEncMP12PktzCopyright, "c8f4b0c1-094c-43c7-8e68-a595405a6ef8", 0xc8f4b0c1, 0x094c, 0x43c7, 0x8e, 0x68, 0xa5, 0x95, 0x40, 0x5a, 0x6e, 0xf8 ) - -// AVEncMP12PktzOriginal (BOOL) -DEFINE_CODECAPI_GUID( AVEncMP12PktzOriginal, "6b178416-31b9-4964-94cb-6bff866cdf83", 0x6b178416, 0x31b9, 0x4964, 0x94, 0xcb, 0x6b, 0xff, 0x86, 0x6c, 0xdf, 0x83 ) - -// -// MPEG1/2 Multiplexer Interface -// - -// AVEncMP12MuxPacketOverhead (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxPacketOverhead, "e40bd720-3955-4453-acf9-b79132a38fa0", 0xe40bd720, 0x3955, 0x4453, 0xac, 0xf9, 0xb7, 0x91, 0x32, 0xa3, 0x8f, 0xa0 ) - -// AVEncMP12MuxNumStreams (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxNumStreams, "f7164a41-dced-4659-a8f2-fb693f2a4cd0", 0xf7164a41, 0xdced, 0x4659, 0xa8, 0xf2, 0xfb, 0x69, 0x3f, 0x2a, 0x4c, 0xd0 ) - -// AVEncMP12MuxEarliestPTS (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxEarliestPTS, "157232b6-f809-474e-9464-a7f93014a817", 0x157232b6, 0xf809, 0x474e, 0x94, 0x64, 0xa7, 0xf9, 0x30, 0x14, 0xa8, 0x17 ) - -// AVEncMP12MuxLargestPacketSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxLargestPacketSize, "35ceb711-f461-4b92-a4ef-17b6841ed254", 0x35ceb711, 0xf461, 0x4b92, 0xa4, 0xef, 0x17, 0xb6, 0x84, 0x1e, 0xd2, 0x54 ) - -// AVEncMP12MuxInitialSCR (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxInitialSCR, "3433ad21-1b91-4a0b-b190-2b77063b63a4", 0x3433ad21, 0x1b91, 0x4a0b, 0xb1, 0x90, 0x2b, 0x77, 0x06, 0x3b, 0x63, 0xa4 ) - -// AVEncMP12MuxMuxRate (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxMuxRate, "ee047c72-4bdb-4a9d-8e21-41926c823da7", 0xee047c72, 0x4bdb, 0x4a9d, 0x8e, 0x21, 0x41, 0x92, 0x6c, 0x82, 0x3d, 0xa7 ) - -// AVEncMP12MuxPackSize (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxPackSize, "f916053a-1ce8-4faf-aa0b-ba31c80034b8", 0xf916053a, 0x1ce8, 0x4faf, 0xaa, 0x0b, 0xba, 0x31, 0xc8, 0x00, 0x34, 0xb8 ) - -// AVEncMP12MuxSysSTDBufferBound (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysSTDBufferBound, "35746903-b545-43e7-bb35-c5e0a7d5093c", 0x35746903, 0xb545, 0x43e7, 0xbb, 0x35, 0xc5, 0xe0, 0xa7, 0xd5, 0x09, 0x3c ) - -// AVEncMP12MuxSysRateBound (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysRateBound, "05f0428a-ee30-489d-ae28-205c72446710", 0x05f0428a, 0xee30, 0x489d, 0xae, 0x28, 0x20, 0x5c, 0x72, 0x44, 0x67, 0x10 ) - -// AVEncMP12MuxTargetPacketizer (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxTargetPacketizer, "d862212a-2015-45dd-9a32-1b3aa88205a0", 0xd862212a, 0x2015, 0x45dd, 0x9a, 0x32, 0x1b, 0x3a, 0xa8, 0x82, 0x05, 0xa0 ) - -// AVEncMP12MuxSysFixed (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysFixed, "cefb987e-894f-452e-8f89-a4ef8cec063a", 0xcefb987e, 0x894f, 0x452e, 0x8f, 0x89, 0xa4, 0xef, 0x8c, 0xec, 0x06, 0x3a ) - -// AVEncMP12MuxSysCSPS (UINT32) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysCSPS, "7952ff45-9c0d-4822-bc82-8ad772e02993", 0x7952ff45, 0x9c0d, 0x4822, 0xbc, 0x82, 0x8a, 0xd7, 0x72, 0xe0, 0x29, 0x93 ) - -// AVEncMP12MuxSysVideoLock (BOOL) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysVideoLock, "b8296408-2430-4d37-a2a1-95b3e435a91d", 0xb8296408, 0x2430, 0x4d37, 0xa2, 0xa1, 0x95, 0xb3, 0xe4, 0x35, 0xa9, 0x1d ) - -// AVEncMP12MuxSysAudioLock (BOOL) -DEFINE_CODECAPI_GUID( AVEncMP12MuxSysAudioLock, "0fbb5752-1d43-47bf-bd79-f2293d8ce337", 0x0fbb5752, 0x1d43, 0x47bf, 0xbd, 0x79, 0xf2, 0x29, 0x3d, 0x8c, 0xe3, 0x37 ) - -// AVEncMP12MuxDVDNavPacks (BOOL) -DEFINE_CODECAPI_GUID( AVEncMP12MuxDVDNavPacks, "c7607ced-8cf1-4a99-83a1-ee5461be3574", 0xc7607ced, 0x8cf1, 0x4a99, 0x83, 0xa1, 0xee, 0x54, 0x61, 0xbe, 0x35, 0x74 ) - -// -// Decoding Interface -// - - -// format values are GUIDs as VARIANT BSTRs -DEFINE_CODECAPI_GUID( AVDecCommonInputFormat, "E5005239-BD89-4be3-9C0F-5DDE317988CC", 0xe5005239, 0xbd89, 0x4be3, 0x9c, 0x0f, 0x5d, 0xde, 0x31, 0x79, 0x88, 0xcc) -DEFINE_CODECAPI_GUID( AVDecCommonOutputFormat, "3c790028-c0ce-4256-b1a2-1b0fc8b1dcdc", 0x3c790028, 0xc0ce, 0x4256, 0xb1, 0xa2, 0x1b, 0x0f, 0xc8, 0xb1, 0xdc, 0xdc) - -// AVDecCommonMeanBitRate - Mean bitrate in mbits/sec (UINT32) -DEFINE_CODECAPI_GUID( AVDecCommonMeanBitRate, "59488217-007A-4f7a-8E41-5C48B1EAC5C6", 0x59488217, 0x007a, 0x4f7a, 0x8e, 0x41, 0x5c, 0x48, 0xb1, 0xea, 0xc5, 0xc6) -// AVDecCommonMeanBitRateInterval - Mean bitrate interval (in 100ns) (UINT64) -DEFINE_CODECAPI_GUID( AVDecCommonMeanBitRateInterval, "0EE437C6-38A7-4c5c-944C-68AB42116B85", 0x0ee437c6, 0x38a7, 0x4c5c, 0x94, 0x4c, 0x68, 0xab, 0x42, 0x11, 0x6b, 0x85) - -// -// Audio Decoding Interface -// - -// Value GUIDS -// The following 6 GUIDs are values of the AVDecCommonOutputFormat property -// -// Stereo PCM output using matrix-encoded stereo down mix (aka Lt/Rt) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_PCM_Stereo_MatrixEncoded, "696E1D30-548F-4036-825F-7026C60011BD", 0x696e1d30, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) -// -// Regular PCM output (any number of channels) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_PCM, "696E1D31-548F-4036-825F-7026C60011BD", 0x696e1d31, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) -// -// SPDIF PCM (IEC 60958) stereo output. Type of stereo down mix should -// be specified by the application. -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_SPDIF_PCM, "696E1D32-548F-4036-825F-7026C60011BD", 0x696e1d32, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) -// -// SPDIF bitstream (IEC 61937) output, such as AC3, MPEG or DTS. -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_SPDIF_Bitstream, "696E1D33-548F-4036-825F-7026C60011BD", 0x696e1d33, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) -// -// Stereo PCM output using regular stereo down mix (aka Lo/Ro) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_PCM_Headphones, "696E1D34-548F-4036-825F-7026C60011BD", 0x696e1d34, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) - -// Stereo PCM output using automatic selection of stereo down mix -// mode (Lo/Ro or Lt/Rt). Use this when the input stream includes -// information about the preferred downmix mode (such as Annex D of AC3). -// Default down mix mode should be specified by the application. -DEFINE_CODECAPI_GUID( GUID_AVDecAudioOutputFormat_PCM_Stereo_Auto, "696E1D35-548F-4036-825F-7026C60011BD", 0x696e1d35, 0x548f, 0x4036, 0x82, 0x5f, 0x70, 0x26, 0xc6, 0x00, 0x11, 0xbd) - -// -// Video Decoder properties -// - -// AVDecVideoImageSize (UINT32) - High UINT16 width, low UINT16 height -DEFINE_CODECAPI_GUID( AVDecVideoImageSize, "5EE5747C-6801-4cab-AAF1-6248FA841BA4", 0x5ee5747c, 0x6801, 0x4cab, 0xaa, 0xf1, 0x62, 0x48, 0xfa, 0x84, 0x1b, 0xa4) - -// AVDecVideoPixelAspectRatio (UINT32 as UINT16/UNIT16) - High UINT16 width, low UINT16 height -DEFINE_CODECAPI_GUID( AVDecVideoPixelAspectRatio, "B0CF8245-F32D-41df-B02C-87BD304D12AB", 0xb0cf8245, 0xf32d, 0x41df, 0xb0, 0x2c, 0x87, 0xbd, 0x30, 0x4d, 0x12, 0xab) - -// AVDecVideoInputScanType (UINT32) -DEFINE_CODECAPI_GUID( AVDecVideoInputScanType, "38477E1F-0EA7-42cd-8CD1-130CED57C580", 0x38477e1f, 0x0ea7, 0x42cd, 0x8c, 0xd1, 0x13, 0x0c, 0xed, 0x57, 0xc5, 0x80) -enum eAVDecVideoInputScanType -{ - eAVDecVideoInputScan_Unknown = 0, - eAVDecVideoInputScan_Progressive = 1, - eAVDecVideoInputScan_Interlaced_UpperFieldFirst = 2, - eAVDecVideoInputScan_Interlaced_LowerFieldFirst = 3 -}; - - -// AVDecVideoSWPowerLevel (UINT32) -// Related to video decoder software power saving level in MPEG4 Part 2, VC1 and H264. -// "SW Power Level" will take a range from 0 to 100 to indicate the current power saving level. 0 - Optimize for battery life, 50 - balanced, 100 - Optimize for video quality. -DEFINE_CODECAPI_GUID( AVDecVideoSWPowerLevel, "FB5D2347-4DD8-4509-AED0-DB5FA9AA93F4", 0xfb5d2347, 0x4dd8, 0x4509, 0xae, 0xd0, 0xdb, 0x5f, 0xa9, 0xaa, 0x93, 0xf4) - -enum eAVDecVideoSWPowerLevel -{ - eAVDecVideoSWPowerLevel_BatteryLife = 0, - eAVDecVideoSWPowerLevel_Balanced = 50, - eAVDecVideoSWPowerLevel_VideoQuality = 100 -}; - -// -// Audio Decoder properties -// - - -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputWMA, "C95E8DCF-4058-4204-8C42-CB24D91E4B9B", 0xc95e8dcf, 0x4058, 0x4204, 0x8c, 0x42, 0xcb, 0x24, 0xd9, 0x1e, 0x4b, 0x9b) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputWMAPro, "0128B7C7-DA72-4fe3-BEF8-5C52E3557704", 0x0128b7c7, 0xda72, 0x4fe3, 0xbe, 0xf8, 0x5c, 0x52, 0xe3, 0x55, 0x77, 0x04) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputDolby, "8E4228A0-F000-4e0b-8F54-AB8D24AD61A2", 0x8e4228a0, 0xf000, 0x4e0b, 0x8f, 0x54, 0xab, 0x8d, 0x24, 0xad, 0x61, 0xa2) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputDTS, "600BC0CA-6A1F-4e91-B241-1BBEB1CB19E0", 0x600bc0ca, 0x6a1f, 0x4e91, 0xb2, 0x41, 0x1b, 0xbe, 0xb1, 0xcb, 0x19, 0xe0) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputPCM, "F2421DA5-BBB4-4cd5-A996-933C6B5D1347", 0xf2421da5, 0xbbb4, 0x4cd5, 0xa9, 0x96, 0x93, 0x3c, 0x6b, 0x5d, 0x13, 0x47) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputMPEG, "91106F36-02C5-4f75-9719-3B7ABF75E1F6", 0x91106f36, 0x02c5, 0x4f75, 0x97, 0x19, 0x3b, 0x7a, 0xbf, 0x75, 0xe1, 0xf6) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputAAC, "97DF7828-B94A-47e2-A4BC-51194DB22A4D", 0x97df7828, 0xb94a, 0x47e2, 0xa4, 0xbc, 0x51, 0x19, 0x4d, 0xb2, 0x2a, 0x4d) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputHEAAC, "16EFB4AA-330E-4f5c-98A8-CF6AC55CBE60", 0x16efb4aa, 0x330e, 0x4f5c, 0x98, 0xa8, 0xcf, 0x6a, 0xc5, 0x5c, 0xbe, 0x60) -DEFINE_CODECAPI_GUID( GUID_AVDecAudioInputDolbyDigitalPlus, "0803E185-8F5D-47f5-9908-19A5BBC9FE34", 0x0803e185, 0x8f5d, 0x47f5, 0x99, 0x08, 0x19, 0xa5, 0xbb, 0xc9, 0xfe, 0x34) - -// AVDecAACDownmixMode (UINT32) -// AAC/HE-AAC Decoder uses standard ISO/IEC MPEG-2/MPEG-4 stereo downmix equations or uses -// non-standard downmix. An example of a non standard downmix would be the one defined by ARIB document STD-B21 version 4.4. -DEFINE_CODECAPI_GUID( AVDecAACDownmixMode,"01274475-F6BB-4017-B084-81A763C942D4", 0x1274475, 0xf6bb, 0x4017, 0xb0, 0x84, 0x81, 0xa7, 0x63, 0xc9, 0x42, 0xd4) - -enum eAVDecAACDownmixMode -{ - eAVDecAACUseISODownmix = 0, - eAVDecAACUseARIBDownmix = 1 -}; - -// AVDecHEAACDynamicRangeControl (UINT32) -// Set this property on an AAC/HE-AAC decoder to select whether Dynamic Range Control (DRC) should be applied or not. -// If DRC is ON and the AAC/HE-AAC stream includes extension payload of type EXT_DYNAMIC_RANGE, DRC will be applied. -DEFINE_CODECAPI_GUID( AVDecHEAACDynamicRangeControl, "287C8ABE-69A4-4d39-8080-D3D9712178A0", 0x287c8abe, 0x69a4, 0x4d39, 0x80, 0x80, 0xd3, 0xd9, 0x71, 0x21, 0x78, 0xa0); - -enum eAVDecHEAACDynamicRangeControl -{ - eAVDecHEAACDynamicRangeControl_OFF = 0, - eAVDecHEAACDynamicRangeControl_ON = 1 -}; - - -// AVDecAudioDualMono (UINT32) - Read only -// The input bitstream header might have a field indicating whether the 2-ch bitstream -// is dual mono or not. Use this property to read this field. -// If it's dual mono, the application can set AVDecAudioDualMonoReproMode to determine -// one of 4 reproduction modes -DEFINE_CODECAPI_GUID( AVDecAudioDualMono,"4a52cda8-30f8-4216-be0f-ba0b2025921d", 0x4a52cda8, 0x30f8, 0x4216, 0xbe, 0x0f, 0xba, 0x0b, 0x20, 0x25, 0x92, 0x1d ) - -enum eAVDecAudioDualMono -{ - eAVDecAudioDualMono_IsNotDualMono = 0, // 2-ch bitstream input is not dual mono - eAVDecAudioDualMono_IsDualMono = 1, // 2-ch bitstream input is dual mono - eAVDecAudioDualMono_UnSpecified = 2 // There is no indication in the bitstream -}; - -// AVDecAudioDualMonoReproMode (UINT32) -// Reproduction modes for programs containing two independent mono channels (Ch1 & Ch2). -// In case of 2-ch input, the decoder should get AVDecAudioDualMono to check if the input -// is regular stereo or dual mono. If dual mono, the application can ask the user to set the playback -// mode by setting AVDecAudioDualReproMonoMode. If output is not stereo, use AVDecDDMatrixDecodingMode or -// equivalent. -DEFINE_CODECAPI_GUID( AVDecAudioDualMonoReproMode,"a5106186-cc94-4bc9-8cd9-aa2f61f6807e", 0xa5106186, 0xcc94, 0x4bc9, 0x8c, 0xd9, 0xaa, 0x2f, 0x61, 0xf6, 0x80, 0x7e ) - -enum eAVDecAudioDualMonoReproMode -{ - eAVDecAudioDualMonoReproMode_STEREO = 0, // Ch1+Ch2 for mono output, (Ch1 left, Ch2 right) for stereo output - eAVDecAudioDualMonoReproMode_LEFT_MONO = 1, // Ch1 for mono output, (Ch1 left, Ch1 right) for stereo output - eAVDecAudioDualMonoReproMode_RIGHT_MONO = 2, // Ch2 for mono output, (Ch2 left, Ch2 right) for stereo output - eAVDecAudioDualMonoReproMode_MIX_MONO = 3, // Ch1+Ch2 for mono output, (Ch1+Ch2 left, Ch1+Ch2 right) for stereo output -}; - -// -// Audio Common Properties -// - -// AVAudioChannelCount (UINT32) -// Total number of audio channels, including LFE if it exists. -DEFINE_CODECAPI_GUID( AVAudioChannelCount, "1d3583c4-1583-474e-b71a-5ee463c198e4", 0x1d3583c4, 0x1583, 0x474e, 0xb7, 0x1a, 0x5e, 0xe4, 0x63, 0xc1, 0x98, 0xe4 ) - -// AVAudioChannelConfig (UINT32) -// A bit-wise OR of any number of enum values specified by eAVAudioChannelConfig -DEFINE_CODECAPI_GUID( AVAudioChannelConfig, "17f89cb3-c38d-4368-9ede-63b94d177f9f", 0x17f89cb3, 0xc38d, 0x4368, 0x9e, 0xde, 0x63, 0xb9, 0x4d, 0x17, 0x7f, 0x9f ) - -// Enumerated values for AVAudioChannelConfig are identical -// to the speaker positions defined in ksmedia.h and used -// in WAVE_FORMAT_EXTENSIBLE. Configurations for 5.1 and -// 7.1 channels should be identical to KSAUDIO_SPEAKER_5POINT1_SURROUND -// and KSAUDIO_SPEAKER_7POINT1_SURROUND in ksmedia.h. This means: -// 5.1 ch -> LOW_FREQUENCY | FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT -// 7.1 ch -> LOW_FREQUENCY | FRONT_LEFT | FRONT_RIGHT | FRONT_CENTER | SIDE_LEFT | SIDE_RIGHT | BACK_LEFT | BACK_RIGHT -// -enum eAVAudioChannelConfig -{ - eAVAudioChannelConfig_FRONT_LEFT = 0x1, - eAVAudioChannelConfig_FRONT_RIGHT = 0x2, - eAVAudioChannelConfig_FRONT_CENTER = 0x4, - eAVAudioChannelConfig_LOW_FREQUENCY = 0x8, // aka LFE - eAVAudioChannelConfig_BACK_LEFT = 0x10, - eAVAudioChannelConfig_BACK_RIGHT = 0x20, - eAVAudioChannelConfig_FRONT_LEFT_OF_CENTER = 0x40, - eAVAudioChannelConfig_FRONT_RIGHT_OF_CENTER = 0x80, - eAVAudioChannelConfig_BACK_CENTER = 0x100, // aka Mono Surround - eAVAudioChannelConfig_SIDE_LEFT = 0x200, // aka Left Surround - eAVAudioChannelConfig_SIDE_RIGHT = 0x400, // aka Right Surround - eAVAudioChannelConfig_TOP_CENTER = 0x800, - eAVAudioChannelConfig_TOP_FRONT_LEFT = 0x1000, - eAVAudioChannelConfig_TOP_FRONT_CENTER = 0x2000, - eAVAudioChannelConfig_TOP_FRONT_RIGHT = 0x4000, - eAVAudioChannelConfig_TOP_BACK_LEFT = 0x8000, - eAVAudioChannelConfig_TOP_BACK_CENTER = 0x10000, - eAVAudioChannelConfig_TOP_BACK_RIGHT = 0x20000 -}; - -// AVAudioSampleRate (UINT32) -// In samples per second (Hz) -DEFINE_CODECAPI_GUID( AVAudioSampleRate, "971d2723-1acb-42e7-855c-520a4b70a5f2", 0x971d2723, 0x1acb, 0x42e7, 0x85, 0x5c, 0x52, 0x0a, 0x4b, 0x70, 0xa5, 0xf2 ) - -// -// Dolby Digital(TM) Audio Specific Parameters -// - -// AVDDSurroundMode (UINT32) common to encoder/decoder -DEFINE_CODECAPI_GUID( AVDDSurroundMode, "99f2f386-98d1-4452-a163-abc78a6eb770", 0x99f2f386, 0x98d1, 0x4452, 0xa1, 0x63, 0xab, 0xc7, 0x8a, 0x6e, 0xb7, 0x70 ) - -enum eAVDDSurroundMode -{ - eAVDDSurroundMode_NotIndicated = 0, - eAVDDSurroundMode_No = 1, - eAVDDSurroundMode_Yes = 2 -}; - -// AVDecDDOperationalMode (UINT32) -DEFINE_CODECAPI_GUID( AVDecDDOperationalMode,"d6d6c6d1-064e-4fdd-a40e-3ecbfcb7ebd0", 0xd6d6c6d1, 0x064e, 0x4fdd, 0xa4, 0x0e, 0x3e, 0xcb, 0xfc, 0xb7, 0xeb, 0xd0 ) - -enum eAVDecDDOperationalMode -{ - eAVDecDDOperationalMode_NONE = 0, - eAVDecDDOperationalMode_LINE = 1,// Dialnorm enabled, dialogue at -31dBFS, dynrng used, high/low scaling allowed - eAVDecDDOperationalMode_RF = 2,// Dialnorm enabled, dialogue at -20dBFS, dynrng & compr used, high/low scaling NOT allowed (always fully compressed) - eAVDecDDOperationalMode_CUSTOM0 = 3,// Analog dialnorm (dialogue normalization not part of the decoder) - eAVDecDDOperationalMode_CUSTOM1 = 4 // Digital dialnorm (dialogue normalization is part of the decoder) -}; - -// AVDecDDMatrixDecodingMode(UINT32) -// A ProLogic decoder has a built-in auto-detection feature. When the Dolby Digital decoder -// is set to the 6-channel output configuration and it is fed a 2/0 bit stream to decode, it can -// do one of the following: -// a) decode the bit stream and output it on the two front channels (eAVDecDDMatrixDecodingMode_OFF), -// b) decode the bit stream followed by ProLogic decoding to create 6-channels (eAVDecDDMatrixDecodingMode_ON). -// c) the decoder will look at the Surround bit ("dsurmod") in the bit stream to determine whether -// apply ProLogic decoding or not (eAVDecDDMatrixDecodingMode_AUTO). -DEFINE_CODECAPI_GUID( AVDecDDMatrixDecodingMode,"ddc811a5-04ed-4bf3-a0ca-d00449f9355f", 0xddc811a5, 0x04ed, 0x4bf3, 0xa0, 0xca, 0xd0, 0x04, 0x49, 0xf9, 0x35, 0x5f ) - -enum eAVDecDDMatrixDecodingMode -{ - eAVDecDDMatrixDecodingMode_OFF = 0, - eAVDecDDMatrixDecodingMode_ON = 1, - eAVDecDDMatrixDecodingMode_AUTO = 2 -}; - -// AVDecDDDynamicRangeScaleHigh (UINT32) -// Indicates what fraction of the dynamic range compression -// to apply. Relevant for negative values of dynrng only. -// Linear range 0-100, where: -// 0 - No dynamic range compression (preserve full dynamic range) -// 100 - Apply full dynamic range compression -DEFINE_CODECAPI_GUID( AVDecDDDynamicRangeScaleHigh,"50196c21-1f33-4af5-b296-11426d6c8789", 0x50196c21, 0x1f33, 0x4af5, 0xb2, 0x96, 0x11, 0x42, 0x6d, 0x6c, 0x87, 0x89 ) - - -// AVDecDDDynamicRangeScaleLow (UINT32) -// Indicates what fraction of the dynamic range compression -// to apply. Relevant for positive values of dynrng only. -// Linear range 0-100, where: -// 0 - No dynamic range compression (preserve full dynamic range) -// 100 - Apply full dynamic range compression -DEFINE_CODECAPI_GUID( AVDecDDDynamicRangeScaleLow,"044e62e4-11a5-42d5-a3b2-3bb2c7c2d7cf", 0x044e62e4, 0x11a5, 0x42d5, 0xa3, 0xb2, 0x3b, 0xb2, 0xc7, 0xc2, 0xd7, 0xcf ) - -// AVDSPLoudnessEqualization (UINT32) -// Related to audio digital signal processing (DSP). -// Apply "Loudness Equalization" to the audio stream, so users will not have to adjust volume control when audio stream changes. -DEFINE_CODECAPI_GUID( AVDSPLoudnessEqualization,"8AFD1A15-1812-4cbf-9319-433A5B2A3B27", 0x8afd1a15, 0x1812, 0x4cbf, 0x93, 0x19, 0x43, 0x3a, 0x5b, 0x2a, 0x3b, 0x27) - -enum eAVDSPLoudnessEqualization -{ - eAVDSPLoudnessEqualization_OFF = 0, - eAVDSPLoudnessEqualization_ON = 1, - eAVDSPLoudnessEqualization_AUTO = 2 -}; - -// AVDSPSpeakerFill (UINT32) -// Related to audio digital signal processing (DSP). -// "Speaker Fill" will take a mono or stereo audio stream and convert it to a multi channel (e.g. 5.1) audio stream. -DEFINE_CODECAPI_GUID( AVDSPSpeakerFill, "5612BCA1-56DA-4582-8DA1-CA8090F92768", 0x5612bca1, 0x56da, 0x4582, 0x8d, 0xa1, 0xca, 0x80, 0x90, 0xf9, 0x27, 0x68) - -enum eAVDSPSpeakerFill -{ - eAVDSPSpeakerFill_OFF = 0, - eAVDSPSpeakerFill_ON = 1, - eAVDSPSpeakerFill_AUTO = 2 -}; - -// AVPriorityControl (UINT32) -// Indicates the task priority when not realtime (0..15) -// Linear range 0-15, where: -// 0 - idle -// 15 - Highest -DEFINE_CODECAPI_GUID( AVPriorityControl,"54ba3dc8-bdde-4329-b187-2018bc5c2ba1", 0x54ba3dc8, 0xbdde, 0x4329, 0xb1, 0x87, 0x20, 0x18, 0xbc, 0x5c, 0x2b, 0xa1 ) - -// AVRealtimeControl (UINT32) -// Indicates the task is realtime or not -// Linear range 0-1, where: -// 0 - no realtime -// 1 - realtime -DEFINE_CODECAPI_GUID( AVRealtimeControl,"6f440632-c4ad-4bf7-9e52-456942b454b0", 0x6f440632, 0xc4ad, 0x4bf7, 0x9e, 0x52, 0x45, 0x69, 0x42, 0xb4, 0x54, 0xb0 ) - -#ifndef UUID_GEN -// { GUID refs - #define CODECAPI_AVEncCommonFormatConstraint DEFINE_CODECAPI_GUIDNAMED( AVEncCommonFormatConstraint ) - #define CODECAPI_GUID_AVEncCommonFormatUnSpecified DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatUnSpecified ) - #define CODECAPI_GUID_AVEncCommonFormatDVD_V DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatDVD_V ) - #define CODECAPI_GUID_AVEncCommonFormatDVD_DashVR DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatDVD_DashVR ) - #define CODECAPI_GUID_AVEncCommonFormatDVD_PlusVR DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatDVD_PlusVR ) - #define CODECAPI_GUID_AVEncCommonFormatVCD DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatVCD ) - #define CODECAPI_GUID_AVEncCommonFormatSVCD DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatSVCD ) - #define CODECAPI_GUID_AVEncCommonFormatATSC DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatATSC ) - #define CODECAPI_GUID_AVEncCommonFormatDVB DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatDVB ) - #define CODECAPI_GUID_AVEncCommonFormatMP3 DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatMP3 ) - #define CODECAPI_GUID_AVEncCommonFormatHighMAT DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatHighMAT ) - #define CODECAPI_GUID_AVEncCommonFormatHighMPV DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncCommonFormatHighMPV ) - #define CODECAPI_AVEncCodecType DEFINE_CODECAPI_GUIDNAMED( AVEncCodecType ) - #define CODECAPI_GUID_AVEncMPEG1Video DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncMPEG1Video ) - #define CODECAPI_GUID_AVEncMPEG2Video DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncMPEG2Video ) - #define CODECAPI_GUID_AVEncMPEG1Audio DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncMPEG1Audio ) - #define CODECAPI_GUID_AVEncMPEG2Audio DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncMPEG2Audio ) - #define CODECAPI_GUID_AVEncWMV DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncWMV ) - #define CODECAPI_GUID_AVEndMPEG4Video DEFINE_CODECAPI_GUIDNAMED( GUID_AVEndMPEG4Video ) - #define CODECAPI_GUID_AVEncH264Video DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncH264Video ) - #define CODECAPI_GUID_AVEncDV DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDV ) - #define CODECAPI_GUID_AVEncWMAPro DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncWMAPro ) - #define CODECAPI_GUID_AVEncWMALossless DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncWMALossless ) - #define CODECAPI_GUID_AVEncWMAVoice DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncWMAVoice ) - #define CODECAPI_GUID_AVEncDolbyDigitalPro DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDolbyDigitalPro ) - #define CODECAPI_GUID_AVEncDolbyDigitalConsumer DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDolbyDigitalConsumer ) - #define CODECAPI_GUID_AVEncDolbyDigitalPlus DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDolbyDigitalPlus ) - #define CODECAPI_GUID_AVEncDTSHD DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDTSHD ) - #define CODECAPI_GUID_AVEncDTS DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncDTS ) - #define CODECAPI_GUID_AVEncMLP DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncMLP ) - #define CODECAPI_GUID_AVEncPCM DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncPCM ) - #define CODECAPI_GUID_AVEncSDDS DEFINE_CODECAPI_GUIDNAMED( GUID_AVEncSDDS ) - #define CODECAPI_AVEncCommonRateControlMode DEFINE_CODECAPI_GUIDNAMED( AVEncCommonRateControlMode ) - #define CODECAPI_AVEncCommonLowLatency DEFINE_CODECAPI_GUIDNAMED( AVEncCommonLowLatency ) - #define CODECAPI_AVEncCommonMultipassMode DEFINE_CODECAPI_GUIDNAMED( AVEncCommonMultipassMode ) - #define CODECAPI_AVEncCommonPassStart DEFINE_CODECAPI_GUIDNAMED( AVEncCommonPassStart ) - #define CODECAPI_AVEncCommonPassEnd DEFINE_CODECAPI_GUIDNAMED( AVEncCommonPassEnd ) - #define CODECAPI_AVEncCommonRealTime DEFINE_CODECAPI_GUIDNAMED( AVEncCommonRealTime ) - #define CODECAPI_AVEncCommonQuality DEFINE_CODECAPI_GUIDNAMED( AVEncCommonQuality ) - #define CODECAPI_AVEncCommonQualityVsSpeed DEFINE_CODECAPI_GUIDNAMED( AVEncCommonQualityVsSpeed ) - #define CODECAPI_AVEncCommonMeanBitRate DEFINE_CODECAPI_GUIDNAMED( AVEncCommonMeanBitRate ) - #define CODECAPI_AVEncCommonMeanBitRateInterval DEFINE_CODECAPI_GUIDNAMED( AVEncCommonMeanBitRateInterval ) - #define CODECAPI_AVEncCommonMaxBitRate DEFINE_CODECAPI_GUIDNAMED( AVEncCommonMaxBitRate ) - #define CODECAPI_AVEncCommonMinBitRate DEFINE_CODECAPI_GUIDNAMED( AVEncCommonMinBitRate ) - #define CODECAPI_AVEncCommonBufferSize DEFINE_CODECAPI_GUIDNAMED( AVEncCommonBufferSize ) - #define CODECAPI_AVEncCommonBufferInLevel DEFINE_CODECAPI_GUIDNAMED( AVEncCommonBufferInLevel ) - #define CODECAPI_AVEncCommonBufferOutLevel DEFINE_CODECAPI_GUIDNAMED( AVEncCommonBufferOutLevel ) - #define CODECAPI_AVEncCommonStreamEndHandling DEFINE_CODECAPI_GUIDNAMED( AVEncCommonStreamEndHandling ) - #define CODECAPI_AVEncStatCommonCompletedPasses DEFINE_CODECAPI_GUIDNAMED( AVEncStatCommonCompletedPasses ) - #define CODECAPI_AVEncVideoOutputFrameRate DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputFrameRate ) - #define CODECAPI_AVEncVideoOutputFrameRateConversion DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputFrameRateConversion ) - #define CODECAPI_AVEncVideoPixelAspectRatio DEFINE_CODECAPI_GUIDNAMED( AVEncVideoPixelAspectRatio ) - #define CODECAPI_AVDecVideoAcceleration_MPEG2 DEFINE_CODECAPI_GUIDNAMED( AVDecVideoAcceleration_MPEG2 ) - #define CODECAPI_AVDecVideoAcceleration_H264 DEFINE_CODECAPI_GUIDNAMED( AVDecVideoAcceleration_H264 ) - #define CODECAPI_AVDecVideoAcceleration_VC1 DEFINE_CODECAPI_GUIDNAMED( AVDecVideoAcceleration_VC1 ) - #define CODECAPI_AVDecVideoProcDeinterlaceCSC DEFINE_CODECAPI_GUIDNAMED( AVDecVideoProcDeinterlaceCSC ) - #define CODECAPI_AVEncVideoForceSourceScanType DEFINE_CODECAPI_GUIDNAMED( AVEncVideoForceSourceScanType ) - #define CODECAPI_AVEncVideoNoOfFieldsToEncode DEFINE_CODECAPI_GUIDNAMED( AVEncVideoNoOfFieldsToEncode ) - #define CODECAPI_AVEncVideoNoOfFieldsToSkip DEFINE_CODECAPI_GUIDNAMED( AVEncVideoNoOfFieldsToSkip ) - #define CODECAPI_AVEncVideoEncodeDimension DEFINE_CODECAPI_GUIDNAMED( AVEncVideoEncodeDimension ) - #define CODECAPI_AVEncVideoEncodeOffsetOrigin DEFINE_CODECAPI_GUIDNAMED( AVEncVideoEncodeOffsetOrigin ) - #define CODECAPI_AVEncVideoDisplayDimension DEFINE_CODECAPI_GUIDNAMED( AVEncVideoDisplayDimension ) - #define CODECAPI_AVEncVideoOutputScanType DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputScanType ) - #define CODECAPI_AVEncVideoInverseTelecineEnable DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInverseTelecineEnable ) - #define CODECAPI_AVEncVideoInverseTelecineThreshold DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInverseTelecineThreshold ) - #define CODECAPI_AVEncVideoSourceFilmContent DEFINE_CODECAPI_GUIDNAMED( AVEncVideoSourceFilmContent ) - #define CODECAPI_AVEncVideoSourceIsBW DEFINE_CODECAPI_GUIDNAMED( AVEncVideoSourceIsBW ) - #define CODECAPI_AVEncVideoFieldSwap DEFINE_CODECAPI_GUIDNAMED( AVEncVideoFieldSwap ) - #define CODECAPI_AVEncVideoInputChromaResolution DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputChromaResolution ) - #define CODECAPI_AVEncVideoOutputChromaResolution DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputChromaResolution ) - #define CODECAPI_AVEncVideoInputChromaSubsampling DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputChromaSubsampling ) - #define CODECAPI_AVEncVideoOutputChromaSubsampling DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputChromaSubsampling ) - #define CODECAPI_AVEncVideoInputColorPrimaries DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputColorPrimaries ) - #define CODECAPI_AVEncVideoOutputColorPrimaries DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputColorPrimaries ) - #define CODECAPI_AVEncVideoInputColorTransferFunction DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputColorTransferFunction ) - #define CODECAPI_AVEncVideoOutputColorTransferFunction DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputColorTransferFunction ) - #define CODECAPI_AVEncVideoInputColorTransferMatrix DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputColorTransferMatrix ) - #define CODECAPI_AVEncVideoOutputColorTransferMatrix DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputColorTransferMatrix ) - #define CODECAPI_AVEncVideoInputColorLighting DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputColorLighting ) - #define CODECAPI_AVEncVideoOutputColorLighting DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputColorLighting ) - #define CODECAPI_AVEncVideoInputColorNominalRange DEFINE_CODECAPI_GUIDNAMED( AVEncVideoInputColorNominalRange ) - #define CODECAPI_AVEncVideoOutputColorNominalRange DEFINE_CODECAPI_GUIDNAMED( AVEncVideoOutputColorNominalRange ) - #define CODECAPI_AVEncInputVideoSystem DEFINE_CODECAPI_GUIDNAMED( AVEncInputVideoSystem ) - #define CODECAPI_AVEncVideoHeaderDropFrame DEFINE_CODECAPI_GUIDNAMED( AVEncVideoHeaderDropFrame ) - #define CODECAPI_AVEncVideoHeaderHours DEFINE_CODECAPI_GUIDNAMED( AVEncVideoHeaderHours ) - #define CODECAPI_AVEncVideoHeaderMinutes DEFINE_CODECAPI_GUIDNAMED( AVEncVideoHeaderMinutes ) - #define CODECAPI_AVEncVideoHeaderSeconds DEFINE_CODECAPI_GUIDNAMED( AVEncVideoHeaderSeconds ) - #define CODECAPI_AVEncVideoHeaderFrames DEFINE_CODECAPI_GUIDNAMED( AVEncVideoHeaderFrames ) - #define CODECAPI_AVEncVideoDefaultUpperFieldDominant DEFINE_CODECAPI_GUIDNAMED( AVEncVideoDefaultUpperFieldDominant ) - #define CODECAPI_AVEncVideoCBRMotionTradeoff DEFINE_CODECAPI_GUIDNAMED( AVEncVideoCBRMotionTradeoff ) - #define CODECAPI_AVEncVideoCodedVideoAccessUnitSize DEFINE_CODECAPI_GUIDNAMED( AVEncVideoCodedVideoAccessUnitSize ) - #define CODECAPI_AVEncVideoMaxKeyframeDistance DEFINE_CODECAPI_GUIDNAMED( AVEncVideoMaxKeyframeDistance ) - - #define CODECAPI_AVEncMuxOutputStreamType DEFINE_CODECAPI_GUIDNAMED( AVEncMuxOutputStreamType ) - - #define CODECAPI_AVEncStatVideoOutputFrameRate DEFINE_CODECAPI_GUIDNAMED( AVEncStatVideoOutputFrameRate ) - #define CODECAPI_AVEncStatVideoCodedFrames DEFINE_CODECAPI_GUIDNAMED( AVEncStatVideoCodedFrames ) - #define CODECAPI_AVEncStatVideoTotalFrames DEFINE_CODECAPI_GUIDNAMED( AVEncStatVideoTotalFrames ) - #define CODECAPI_AVEncAudioIntervalToEncode DEFINE_CODECAPI_GUIDNAMED( AVEncAudioIntervalToEncode ) - #define CODECAPI_AVEncAudioIntervalToSkip DEFINE_CODECAPI_GUIDNAMED( AVEncAudioIntervalToSkip ) - #define CODECAPI_AVEncAudioDualMono DEFINE_CODECAPI_GUIDNAMED( AVEncAudioDualMono ) - #define CODECAPI_AVEncAudioMeanBitRate DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMeanBitRate ) - - #define CODECAPI_AVEncAudioMapDestChannel0 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel0 ) - #define CODECAPI_AVEncAudioMapDestChannel1 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel1 ) - #define CODECAPI_AVEncAudioMapDestChannel2 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel2 ) - #define CODECAPI_AVEncAudioMapDestChannel3 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel3 ) - #define CODECAPI_AVEncAudioMapDestChannel4 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel4 ) - #define CODECAPI_AVEncAudioMapDestChannel5 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel5 ) - #define CODECAPI_AVEncAudioMapDestChannel6 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel6 ) - #define CODECAPI_AVEncAudioMapDestChannel7 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel7 ) - #define CODECAPI_AVEncAudioMapDestChannel8 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel8 ) - #define CODECAPI_AVEncAudioMapDestChannel9 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel9 ) - #define CODECAPI_AVEncAudioMapDestChannel10 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel10 ) - #define CODECAPI_AVEncAudioMapDestChannel11 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel11 ) - #define CODECAPI_AVEncAudioMapDestChannel12 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel12 ) - #define CODECAPI_AVEncAudioMapDestChannel13 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel13 ) - #define CODECAPI_AVEncAudioMapDestChannel14 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel14 ) - #define CODECAPI_AVEncAudioMapDestChannel15 DEFINE_CODECAPI_GUIDNAMED( AVEncAudioMapDestChannel15 ) - - #define CODECAPI_AVEncAudioInputContent DEFINE_CODECAPI_GUIDNAMED( AVEncAudioInputContent ) - #define CODECAPI_AVEncStatAudioPeakPCMValue DEFINE_CODECAPI_GUIDNAMED( AVEncStatAudioPeakPCMValue ) - #define CODECAPI_AVEncStatAudioAveragePCMValue DEFINE_CODECAPI_GUIDNAMED( AVEncStatAudioAveragePCMValue ) - #define CODECAPI_AVEncStatAudioAverageBPS DEFINE_CODECAPI_GUIDNAMED( AVEncStatAudioAverageBPS ) - #define CODECAPI_AVEncStatAverageBPS DEFINE_CODECAPI_GUIDNAMED( AVEncStatAverageBPS ) - #define CODECAPI_AVEncStatHardwareProcessorUtilitization DEFINE_CODECAPI_GUIDNAMED( AVEncStatHardwareProcessorUtilitization ) - #define CODECAPI_AVEncStatBandwidthProcessorUtilitization DEFINE_CODECAPI_GUIDNAMED( AVEncStatHardwareBandwidthUtilitization ) - #define CODECAPI_AVEncMPVGOPSize DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGOPSize ) - #define CODECAPI_AVEncMPVGOPOpen DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGOPOpen ) - #define CODECAPI_AVEncMPVDefaultBPictureCount DEFINE_CODECAPI_GUIDNAMED( AVEncMPVDefaultBPictureCount ) - #define CODECAPI_AVEncMPVProfile DEFINE_CODECAPI_GUIDNAMED( AVEncMPVProfile ) - #define CODECAPI_AVEncMPVLevel DEFINE_CODECAPI_GUIDNAMED( AVEncMPVLevel ) - #define CODECAPI_AVEncMPVFrameFieldMode DEFINE_CODECAPI_GUIDNAMED( AVEncMPVFrameFieldMode ) - #define CODECAPI_AVEncMPVAddSeqEndCode DEFINE_CODECAPI_GUIDNAMED( AVEncMPVAddSeqEndCode ) - #define CODECAPI_AVEncMPVGOPSInSeq DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGOPSInSeq ) - #define CODECAPI_AVEncMPVUseConcealmentMotionVectors DEFINE_CODECAPI_GUIDNAMED( AVEncMPVUseConcealmentMotionVectors ) - #define CODECAPI_AVEncMPVSceneDetection DEFINE_CODECAPI_GUIDNAMED( AVEncMPVSceneDetection ) - #define CODECAPI_AVEncMPVGenerateHeaderSeqExt DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGenerateHeaderSeqExt ) - #define CODECAPI_AVEncMPVGenerateHeaderSeqDispExt DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGenerateHeaderSeqDispExt ) - #define CODECAPI_AVEncMPVGenerateHeaderPicExt DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGenerateHeaderPicExt ) - #define CODECAPI_AVEncMPVGenerateHeaderPicDispExt DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGenerateHeaderPicDispExt ) - #define CODECAPI_AVEncMPVGenerateHeaderSeqScaleExt DEFINE_CODECAPI_GUIDNAMED( AVEncMPVGenerateHeaderSeqScaleExt ) - #define CODECAPI_AVEncMPVScanPattern DEFINE_CODECAPI_GUIDNAMED( AVEncMPVScanPattern ) - #define CODECAPI_AVEncMPVIntraDCPrecision DEFINE_CODECAPI_GUIDNAMED( AVEncMPVIntraDCPrecision ) - #define CODECAPI_AVEncMPVQScaleType DEFINE_CODECAPI_GUIDNAMED( AVEncMPVQScaleType ) - #define CODECAPI_AVEncMPVIntraVLCTable DEFINE_CODECAPI_GUIDNAMED( AVEncMPVIntraVLCTable ) - #define CODECAPI_AVEncMPVQuantMatrixIntra DEFINE_CODECAPI_GUIDNAMED( AVEncMPVQuantMatrixIntra ) - #define CODECAPI_AVEncMPVQuantMatrixNonIntra DEFINE_CODECAPI_GUIDNAMED( AVEncMPVQuantMatrixNonIntra ) - #define CODECAPI_AVEncMPVQuantMatrixChromaIntra DEFINE_CODECAPI_GUIDNAMED( AVEncMPVQuantMatrixChromaIntra ) - #define CODECAPI_AVEncMPVQuantMatrixChromaNonIntra DEFINE_CODECAPI_GUIDNAMED( AVEncMPVQuantMatrixChromaNonIntra ) - #define CODECAPI_AVEncMPALayer DEFINE_CODECAPI_GUIDNAMED( AVEncMPALayer ) - #define CODECAPI_AVEncMPACodingMode DEFINE_CODECAPI_GUIDNAMED( AVEncMPACodingMode ) - #define CODECAPI_AVEncDDService DEFINE_CODECAPI_GUIDNAMED( AVEncDDService ) - #define CODECAPI_AVEncDDDialogNormalization DEFINE_CODECAPI_GUIDNAMED( AVEncDDDialogNormalization ) - #define CODECAPI_AVEncDDCentreDownMixLevel DEFINE_CODECAPI_GUIDNAMED( AVEncDDCentreDownMixLevel ) - #define CODECAPI_AVEncDDSurroundDownMixLevel DEFINE_CODECAPI_GUIDNAMED( AVEncDDSurroundDownMixLevel ) - #define CODECAPI_AVEncDDProductionInfoExists DEFINE_CODECAPI_GUIDNAMED( AVEncDDProductionInfoExists ) - #define CODECAPI_AVEncDDProductionRoomType DEFINE_CODECAPI_GUIDNAMED( AVEncDDProductionRoomType ) - #define CODECAPI_AVEncDDProductionMixLevel DEFINE_CODECAPI_GUIDNAMED( AVEncDDProductionMixLevel ) - #define CODECAPI_AVEncDDCopyright DEFINE_CODECAPI_GUIDNAMED( AVEncDDCopyright ) - #define CODECAPI_AVEncDDOriginalBitstream DEFINE_CODECAPI_GUIDNAMED( AVEncDDOriginalBitstream ) - #define CODECAPI_AVEncDDDigitalDeemphasis DEFINE_CODECAPI_GUIDNAMED( AVEncDDDigitalDeemphasis ) - #define CODECAPI_AVEncDDDCHighPassFilter DEFINE_CODECAPI_GUIDNAMED( AVEncDDDCHighPassFilter ) - #define CODECAPI_AVEncDDChannelBWLowPassFilter DEFINE_CODECAPI_GUIDNAMED( AVEncDDChannelBWLowPassFilter ) - #define CODECAPI_AVEncDDLFELowPassFilter DEFINE_CODECAPI_GUIDNAMED( AVEncDDLFELowPassFilter ) - #define CODECAPI_AVEncDDSurround90DegreeePhaseShift DEFINE_CODECAPI_GUIDNAMED( AVEncDDSurround90DegreeePhaseShift ) - #define CODECAPI_AVEncDDSurround3dBAttenuation DEFINE_CODECAPI_GUIDNAMED( AVEncDDSurround3dBAttenuation ) - #define CODECAPI_AVEncDDDynamicRangeCompressionControl DEFINE_CODECAPI_GUIDNAMED( AVEncDDDynamicRangeCompressionControl ) - #define CODECAPI_AVEncDDRFPreEmphasisFilter DEFINE_CODECAPI_GUIDNAMED( AVEncDDRFPreEmphasisFilter ) - #define CODECAPI_AVEncDDSurroundExMode DEFINE_CODECAPI_GUIDNAMED( AVEncDDSurroundExMode ) - #define CODECAPI_AVEncDDPreferredStereoDownMixMode DEFINE_CODECAPI_GUIDNAMED( AVEncDDPreferredStereoDownMixMode ) - #define CODECAPI_AVEncDDLtRtCenterMixLvl_x10 DEFINE_CODECAPI_GUIDNAMED( AVEncDDLtRtCenterMixLvl_x10 ) - #define CODECAPI_AVEncDDLtRtSurroundMixLvl_x10 DEFINE_CODECAPI_GUIDNAMED( AVEncDDLtRtSurroundMixLvl_x10 ) - #define CODECAPI_AVEncDDLoRoCenterMixLvl_x10 DEFINE_CODECAPI_GUIDNAMED( AVEncDDLoRoCenterMixLvl_x10 ) - #define CODECAPI_AVEncDDLoRoSurroundMixLvl_x10 DEFINE_CODECAPI_GUIDNAMED( AVEncDDLoRoSurroundMixLvl_x10 ) - #define CODECAPI_AVEncDDAtoDConverterType DEFINE_CODECAPI_GUIDNAMED( AVEncDDAtoDConverterType ) - #define CODECAPI_AVEncDDHeadphoneMode DEFINE_CODECAPI_GUIDNAMED( AVEncDDHeadphoneMode ) - #define CODECAPI_AVEncWMVKeyFrameDistance DEFINE_CODECAPI_GUIDNAMED( AVEncWMVKeyFrameDistance ) - #define CODECAPI_AVEncWMVInterlacedEncoding DEFINE_CODECAPI_GUIDNAMED( AVEncWMVInterlacedEncoding ) - #define CODECAPI_AVEncWMVDecoderComplexity DEFINE_CODECAPI_GUIDNAMED( AVEncWMVDecoderComplexity ) - #define CODECAPI_AVEncWMVKeyFrameBufferLevelMarker DEFINE_CODECAPI_GUIDNAMED( AVEncWMVKeyFrameBufferLevelMarker ) - #define CODECAPI_AVEncWMVProduceDummyFrames DEFINE_CODECAPI_GUIDNAMED( AVEncWMVProduceDummyFrames ) - #define CODECAPI_AVEncStatWMVCBAvg DEFINE_CODECAPI_GUIDNAMED( AVEncStatWMVCBAvg ) - #define CODECAPI_AVEncStatWMVCBMax DEFINE_CODECAPI_GUIDNAMED( AVEncStatWMVCBMax ) - #define CODECAPI_AVEncStatWMVDecoderComplexityProfile DEFINE_CODECAPI_GUIDNAMED( AVEncStatWMVDecoderComplexityProfile ) - #define CODECAPI_AVEncStatMPVSkippedEmptyFrames DEFINE_CODECAPI_GUIDNAMED( AVEncStatMPVSkippedEmptyFrames ) - #define CODECAPI_AVEncMP12PktzSTDBuffer DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzSTDBuffer ) - #define CODECAPI_AVEncMP12PktzStreamID DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzStreamID ) - #define CODECAPI_AVEncMP12PktzInitialPTS DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzInitialPTS ) - #define CODECAPI_AVEncMP12PktzPacketSize DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzPacketSize ) - #define CODECAPI_AVEncMP12PktzCopyright DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzCopyright ) - #define CODECAPI_AVEncMP12PktzOriginal DEFINE_CODECAPI_GUIDNAMED( AVEncMP12PktzOriginal ) - #define CODECAPI_AVEncMP12MuxPacketOverhead DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxPacketOverhead ) - #define CODECAPI_AVEncMP12MuxNumStreams DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxNumStreams ) - #define CODECAPI_AVEncMP12MuxEarliestPTS DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxEarliestPTS ) - #define CODECAPI_AVEncMP12MuxLargestPacketSize DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxLargestPacketSize ) - #define CODECAPI_AVEncMP12MuxInitialSCR DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxInitialSCR ) - #define CODECAPI_AVEncMP12MuxMuxRate DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxMuxRate ) - #define CODECAPI_AVEncMP12MuxPackSize DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxPackSize ) - #define CODECAPI_AVEncMP12MuxSysSTDBufferBound DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysSTDBufferBound ) - #define CODECAPI_AVEncMP12MuxSysRateBound DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysRateBound ) - #define CODECAPI_AVEncMP12MuxTargetPacketizer DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxTargetPacketizer ) - #define CODECAPI_AVEncMP12MuxSysFixed DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysFixed ) - #define CODECAPI_AVEncMP12MuxSysCSPS DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysCSPS ) - #define CODECAPI_AVEncMP12MuxSysVideoLock DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysVideoLock ) - #define CODECAPI_AVEncMP12MuxSysAudioLock DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxSysAudioLock ) - #define CODECAPI_AVEncMP12MuxDVDNavPacks DEFINE_CODECAPI_GUIDNAMED( AVEncMP12MuxDVDNavPacks ) - - #define CODECAPI_AVEncMPACopyright DEFINE_CODECAPI_GUIDNAMED( AVEncMPACopyright ) - #define CODECAPI_AVEncMPAOriginalBitstream DEFINE_CODECAPI_GUIDNAMED( AVEncMPAOriginalBitstream ) - #define CODECAPI_AVEncMPAEnableRedundancyProtection DEFINE_CODECAPI_GUIDNAMED( AVEncMPAEnableRedundancyProtection ) - #define CODECAPI_AVEncMPAPrivateUserBit DEFINE_CODECAPI_GUIDNAMED( AVEncMPAPrivateUserBit ) - #define CODECAPI_AVEncMPAEmphasisType DEFINE_CODECAPI_GUIDNAMED( AVEncMPAEmphasisType ) - - #define CODECAPI_AVDecCommonOutputFormat DEFINE_CODECAPI_GUIDNAMED( AVDecCommonOutputFormat ) - #define CODECAPI_AVDecCommonInputFormat DEFINE_CODECAPI_GUIDNAMED( AVDecCommonInputFormat ) - #define CODECAPI_AVDecCommonMeanBitRate DEFINE_CODECAPI_GUIDNAMED( AVDecCommonMeanBitRate ) - #define CODECAPI_AVDecCommonMeanBitRateInterval DEFINE_CODECAPI_GUIDNAMED( AVDecCommonMeanBitRateInterval ) - - #define CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Stereo_MatrixEncoded DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_PCM_Stereo_MatrixEncoded ) - #define CODECAPI_GUID_AVDecAudioOutputFormat_PCM DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_PCM ) - #define CODECAPI_GUID_AVDecAudioOutputFormat_SPDIF_PCM DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_SPDIF_PCM ) - #define CODECAPI_GUID_AVDecAudioOutputFormat_SPDIF_Bitstream DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_SPDIF_Bitstream ) - #define CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Headphones DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_PCM_Headphones ) - #define CODECAPI_GUID_AVDecAudioOutputFormat_PCM_Stereo_Auto DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioOutputFormat_PCM_Stereo_Auto ) - - #define CODECAPI_AVDecVideoImageSize DEFINE_CODECAPI_GUIDNAMED( AVDecVideoImageSize ) - #define CODECAPI_AVDecVideoInputScanType DEFINE_CODECAPI_GUIDNAMED( AVDecVideoInputScanType ) - #define CODECAPI_AVDecVideoPixelAspectRatio DEFINE_CODECAPI_GUIDNAMED( AVDecVideoPixelAspectRatio ) - - #define CODECAPI_AVDecVideoThumbnailGenerationMode DEFINE_CODECAPI_GUIDNAMED( AVDecVideoThumbnailGenerationMode ) - #define CODECAPI_AVDecVideoDropPicWithMissingRef DEFINE_CODECAPI_GUIDNAMED( AVDecVideoDropPicWithMissingRef ) - #define CODECAPI_AVDecVideoSoftwareDeinterlaceMode DEFINE_CODECAPI_GUIDNAMED( AVDecVideoSoftwareDeinterlaceMode ) - #define CODECAPI_AVDecVideoFastDecodeMode DEFINE_CODECAPI_GUIDNAMED( AVDecVideoFastDecodeMode ) - #define CODECAPI_AVDecVideoH264ErrorConcealment DEFINE_CODECAPI_GUIDNAMED( AVDecVideoH264ErrorConcealment ) - #define CODECAPI_AVDecVideoMPEG2ErrorConcealment DEFINE_CODECAPI_GUIDNAMED( AVDecVideoMPEG2ErrorConcealment ) - #define CODECAPI_AVDecVideoCodecType DEFINE_CODECAPI_GUIDNAMED( AVDecVideoCodecType ) - #define CODECAPI_AVDecVideoDXVAMode DEFINE_CODECAPI_GUIDNAMED( AVDecVideoDXVAMode ) - #define CODECAPI_AVDecVideoDXVABusEncryption DEFINE_CODECAPI_GUIDNAMED( AVDecVideoDXVABusEncryption ) - #define CODECAPI_AVDecVideoSWPowerLevel DEFINE_CODECAPI_GUIDNAMED( AVDecVideoSWPowerLevel ) - - #define CODECAPI_GUID_AVDecAudioInputWMA DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputWMA ) - #define CODECAPI_GUID_AVDecAudioInputWMAPro DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputWMAPro ) - #define CODECAPI_GUID_AVDecAudioInputDolby DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputDolby ) - #define CODECAPI_GUID_AVDecAudioInputDTS DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputDTS ) - #define CODECAPI_GUID_AVDecAudioInputPCM DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputPCM ) - #define CODECAPI_GUID_AVDecAudioInputMPEG DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputMPEG ) - #define CODECAPI_GUID_AVDecAudioInputAAC DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputAAC ) - #define CODECAPI_GUID_AVDecAudioInputHEAAC DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputHEAAC ) - #define CODECAPI_GUID_AVDecAudioInputDolbyDigitalPlus DEFINE_CODECAPI_GUIDNAMED( GUID_AVDecAudioInputDolbyDigitalPlus ) - - #define CODECAPI_AVDecAACDownmixMode DEFINE_CODECAPI_GUIDNAMED( AVDecAACDownmixMode ) - #define CODECAPI_AVDecHEAACDynamicRangeControl DEFINE_CODECAPI_GUIDNAMED( AVDecHEAACDynamicRangeControl ) - - #define CODECAPI_AVDecAudioDualMono DEFINE_CODECAPI_GUIDNAMED( AVDecAudioDualMono) - #define CODECAPI_AVDecAudioDualMonoReproMode DEFINE_CODECAPI_GUIDNAMED( AVDecAudioDualMonoReproMode ) - - #define CODECAPI_AVAudioChannelCount DEFINE_CODECAPI_GUIDNAMED( AVAudioChannelCount ) - #define CODECAPI_AVAudioChannelConfig DEFINE_CODECAPI_GUIDNAMED( AVAudioChannelConfig ) - #define CODECAPI_AVAudioSampleRate DEFINE_CODECAPI_GUIDNAMED( AVAudioSampleRate ) - - #define CODECAPI_AVDDSurroundMode DEFINE_CODECAPI_GUIDNAMED( AVDDSurroundMode ) - #define CODECAPI_AVDecDDOperationalMode DEFINE_CODECAPI_GUIDNAMED( AVDecDDOperationalMode ) - #define CODECAPI_AVDecDDMatrixDecodingMode DEFINE_CODECAPI_GUIDNAMED( AVDecDDMatrixDecodingMode ) - #define CODECAPI_AVDecDDDynamicRangeScaleHigh DEFINE_CODECAPI_GUIDNAMED( AVDecDDDynamicRangeScaleHigh ) - #define CODECAPI_AVDecDDDynamicRangeScaleLow DEFINE_CODECAPI_GUIDNAMED( AVDecDDDynamicRangeScaleLow ) - - #define CODECAPI_AVDSPLoudnessEqualization DEFINE_CODECAPI_GUIDNAMED( AVDSPLoudnessEqualization ) - #define CODECAPI_AVDSPSpeakerFill DEFINE_CODECAPI_GUIDNAMED( AVDSPSpeakerFill ) - - #define CODECAPI_AVPriorityControl DEFINE_CODECAPI_GUIDNAMED( AVPriorityControl ) - #define CODECAPI_AVRealtimeControl DEFINE_CODECAPI_GUIDNAMED( AVRealtimeControl ) -#endif - - -#endif // !defined(_CODECAPI_) - - - diff --git a/qt-correction-tool/pub/ddk/contactdeviceservice.h b/qt-correction-tool/pub/ddk/contactdeviceservice.h deleted file mode 100644 index e79650d..0000000 --- a/qt-correction-tool/pub/ddk/contactdeviceservice.h +++ /dev/null @@ -1,937 +0,0 @@ -/* - * ContactDeviceService.h - * - * Contains declarations for the Contact Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _CONTACTDEVICESERVICE_H_ -#define _CONTACTDEVICESERVICE_H_ - -#include -#include - -/*****************************************************************************/ -/* Contact Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Contacts, - 0xDD04D5FC, 0x9D6E, 0x4F76, 0x9D, 0xCF, 0xEC, 0xA6, 0x33, 0x9B, 0x73, 0x89); - -#define NAME_ContactsSvc L"Contacts" -#define TYPE_ContactsSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Contact Service Property / -/*****************************************************************************/ - -#define PKEY_ContactSvc_SyncWithPhoneOnly PKEY_SyncSvc_FilterType -#define NAME_ContactSvc_SyncWithPhoneOnly NAME_SyncSvc_FilterType - - -/*****************************************************************************/ -/* Contact Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AbstractContact - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractContact, - 0xBB810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractContact L"AbstractContact" - -/* FORMAT_VCard2Contact - */ - -DEFINE_DEVSVCGUID(FORMAT_VCard2Contact, - 0xBB820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_VCard2Contact L"VCard2Contact" - -/* FORMAT_VCard3Contact - */ - -DEFINE_DEVSVCGUID(FORMAT_VCard3Contact, - 0xBB830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_VCard3Contact L"VCard3Contact" - - -/* FORMAT_AbstractContactGroup - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractContactGroup, - 0xBA060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractContactGroup L"AbstractContactGroup" - - -/*****************************************************************************/ -/* Contact Service Object Property Keys */ -/*****************************************************************************/ - - -DEFINE_DEVSVCGUID(NAMESPACE_ContactObj, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B); - - -/* ContactObj.GivenName - * - * MTP Property: Given Name (0xDD00) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_GivenName, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 3); - -#define NAME_ContactObj_GivenName L"GivenName" - - -/* ContactObj.MiddleNames - * - * MTP Property: Middle Names (0xDD01) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_MiddleNames, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 4); - -#define NAME_ContactObj_MiddleNames L"MiddleNames" - - -/* ContactObj.FamilyName - * - * MTP Property: Family Name (0xDD02) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_FamilyName, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 5); - -#define NAME_ContactObj_FamilyName L"FamilyName" - - -/* ContactObj.Title - * - * MTP Property: Prefix (0xDD03) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Title, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 6); - -#define NAME_ContactObj_Title L"Title" - - -/* ContactObj.Suffix - * - * MTP Property: Suffix (0xDD04) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Suffix, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 7); - -#define NAME_ContactObj_Suffix L"Suffix" - - -/* ContactObj.PhoneticGivenName - * - * MTP Property: Phonetic Given Name (0xDD05) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PhoneticGivenName, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 8); - -#define NAME_ContactObj_PhoneticGivenName L"PhoneticGivenName" - - -/* ContactObj.PhoneticFamilyName - * - * MTP Property: Phonetic Family Name (0xDD06) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PhoneticFamilyName, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 9); - -#define NAME_ContactObj_PhoneticFamilyName L"PhoneticFamilyName" - - -/* ContactObj.PersonalAddressFull - * - * MTP Property: Postal Address Personal Full (0xDD1F) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressFull, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 10); - -#define NAME_ContactObj_PersonalAddressFull L"PersonalAddressFull" - - -/* ContactObj.PersonalAddressStreet - * - * MTP Property: Postal Address Line 1 (0xDD20) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressStreet, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 11); - -#define NAME_ContactObj_PersonalAddressStreet L"PersonalAddressStreet" - - -/* ContactObj.PersonalAddressLine2 - * - * MTP Property: Postal Address Line 2 (0xDD21) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressLine2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 12); - -#define NAME_ContactObj_PersonalAddressLine2 L"PersonalAddressLine2" - - -/* ContactObj.PersonalAddressCity - * - * MTP Property: Postal Address Personal City (0xDD22) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressCity, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 13); - -#define NAME_ContactObj_PersonalAddressCity L"PersonalAddressCity" - - -/* ContactObj.PersonalAddressRegion - * - * MTP Property: Postal Address Personal Region (0xDD23) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressRegion, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 14); - -#define NAME_ContactObj_PersonalAddressRegion L"PersonalAddressRegion" - - -/* ContactObj.PersonalAddressPostalCode - * - * MTP Property: Postal Address Personal Postal Code (0xDD24) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressPostalCode, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 15); - -#define NAME_ContactObj_PersonalAddressPostalCode L"PersonalAddressPostalCode" - - -/* ContactObj.PersonalAddressCountry - * - * MTP Property: Postal Address Personal Country (0xDD25) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalAddressCountry, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 16); - -#define NAME_ContactObj_PersonalAddressCountry L"PersonalAddressCountry" - - -/* ContactObj.BusinessAddressFull - * - * MTP Property: Postal Address Business Full (0xDD26) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressFull, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 17); - -#define NAME_ContactObj_BusinessAddressFull L"BusinessAddressFull" - - -/* ContactObj.BusinessAddressStreet - * - * MTP Property: Postal Address Line 1 (0xDD27) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressStreet, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 18); - -#define NAME_ContactObj_BusinessAddressStreet L"BusinessAddressStreet" - - -/* ContactObj.BusinessAddressLine2 - * - * MTP Property: Postal Address Line 2 (0xDD28) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressLine2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 19); - -#define NAME_ContactObj_BusinessAddressLine2 L"BusinessAddressLine2" - - -/* ContactObj.BusinessAddressCity - * - * MTP Property: Postal Address Business City (0xDD29) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressCity, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 20); - -#define NAME_ContactObj_BusinessAddressCity L"BusinessAddressCity" - - -/* ContactObj.BusinessAddressRegion - * - * MTP Property: Postal Address Business Region (0xDD2A) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressRegion, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 21); - -#define NAME_ContactObj_BusinessAddressRegion L"BusinessAddressRegion" - - -/* ContactObj.BusinessAddressPostalCode - * - * MTP Property: Postal Address Business Postal Code (0xDD2B) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressPostalCode, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 22); - -#define NAME_ContactObj_BusinessAddressPostalCode L"BusinessAddressPostalCode" - - -/* ContactObj.BusinessAddressCountry - * - * MTP Property: Postal Address Business Country (0xDD2C) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessAddressCountry, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 23); - -#define NAME_ContactObj_BusinessAddressCountry L"BusinessAddressCountry" - - -/* ContactObj.OtherAddressFull - * - * MTP Property: Postal Address Other Full (0xDD2D) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressFull, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 24); - -#define NAME_ContactObj_OtherAddressFull L"OtherAddressFull" - - -/* ContactObj.OtherAddressStreet - * - * MTP Property: Postal Address Line 1 (0xDD2E) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressStreet, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 25); - -#define NAME_ContactObj_OtherAddressStreet L"OtherAddressStreet" - - -/* ContactObj.OtherAddressLine2 - * - * MTP Property: Postal Address Line 2 (0xDD2F) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressLine2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 26); - -#define NAME_ContactObj_OtherAddressLine2 L"OtherAddressLine2" - - -/* ContactObj.OtherAddressCity - * - * MTP Property: Postal Address Other City (0xDD30) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressCity, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 27); - -#define NAME_ContactObj_OtherAddressCity L"OtherAddressCity" - - -/* ContactObj.OtherAddressRegion - * - * MTP Property: Postal Address Other Region (0xDD31) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressRegion, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 28); - -#define NAME_ContactObj_OtherAddressRegion L"OtherAddressRegion" - - -/* ContactObj.OtherAddressPostalCode - * - * MTP Property: Postal Address Other Postal Code (0xDD32) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressPostalCode, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 29); - -#define NAME_ContactObj_OtherAddressPostalCode L"OtherAddressPostalCode" - - -/* ContactObj.OtherAddressCountry - * - * MTP Property: Postal Address Other Country (0xDD33) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherAddressCountry, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 30); - -#define NAME_ContactObj_OtherAddressCountry L"OtherAddressCountry" - - -/* ContactObj.Email - * - * MTP Property: Email Primary (0xDD07) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Email, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 31); - -#define NAME_ContactObj_Email L"Email" - - -/* ContactObj.PersonalEmail - * - * MTP Property: Email Personal 1 (0xDD08) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalEmail, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 32); - -#define NAME_ContactObj_PersonalEmail L"PersonalEmail" - - -/* ContactObj.PersonalEmail2 - * - * MTP Property: Email Personal 2 (0xDD09) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalEmail2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 33); - -#define NAME_ContactObj_PersonalEmail2 L"PersonalEmail2" - - -/* ContactObj.BusinessEmail - * - * MTP Property: Email Business 1 (0xDD0A) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessEmail, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 34); - -#define NAME_ContactObj_BusinessEmail L"BusinessEmail" - - -/* ContactObj.BuisnessEmail2 - * - * MTP Property: Email Business 2 (0xDD0B) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessEmail2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 35); - -#define NAME_ContactObj_BusinessEmail2 L"BusinessEmail2" - - -/* ContactObj.OtherEmail - * - * MTP Property: Email Others (0xDD0C) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherEmail, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 36); - -#define NAME_ContactObj_OtherEmail L"OtherEmail" - - -/* ContactObj.Phone - * - * MTP Property: Phone Primary (0xDD0D) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Phone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 37); - -#define NAME_ContactObj_Phone L"Phone" - - -/* ContactObj.PersonalPhone - * - * MTP Property: Phone Number Personal 1 (0xDD0E) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalPhone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 38); - -#define NAME_ContactObj_PersonalPhone L"PersonalPhone" - - -/* ContactObj.PersonalPhone2 - * - * MTP Property: Phone Number Personal 2 (0xDD0F) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalPhone2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 39); - -#define NAME_ContactObj_PersonalPhone2 L"PersonalPhone2" - - -/* ContactObj.BusinessPhone - * - * MTP Property: Phone Number Business 1 (0xDD10) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessPhone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 40); - -#define NAME_ContactObj_BusinessPhone L"BusinessPhone" - - -/* ContactObj.BusinessPhone2 - * - * MTP Property: Phone Number Business 2 (0xDD11) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessPhone2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 41); - -#define NAME_ContactObj_BusinessPhone2 L"BusinessPhone2" - - -/* ContactObj.MobilePhone - * - * MTP Property: Phone Number Mobile 1 (0xDD12) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_MobilePhone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 42); - -#define NAME_ContactObj_MobilePhone L"MobilePhone" - - -/* ContactObj.MobilePhone2 - * - * MTP Property: Phone Number Mobile 2 (0xDD13) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_MobilePhone2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 43); - -#define NAME_ContactObj_MobilePhone2 L"MobilePhone2" - - -/* ContactObj.PersonalFax - * - * MTP Property: Fax Number Personal (0xDD15) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalFax, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 44); - -#define NAME_ContactObj_PersonalFax L"PersonalFax" - - -/* ContactObj.BusinessFax - * - * MTP Property: Fax Number Business (0xDD16) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessFax, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 45); - -#define NAME_ContactObj_BusinessFax L"BusinessFax" - - -/* ContactObj.Pager - * - * MTP Property: Pager Number (0xDD17) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Pager, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 46); - -#define NAME_ContactObj_Pager L"Pager" - - -/* ContactObj.OtherPhone - * - * MTP Property: Phone Number Others (0xDD18) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_OtherPhone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 47); - -#define NAME_ContactObj_OtherPhone L"OtherPhone" - - -/* ContactObj.WebAddress - * - * MTP Property: Primary Web Address (0xDD19) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_WebAddress, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 48); - -#define NAME_ContactObj_WebAddress L"WebAddress" - - -/* ContactObj.PersonalWebAddress - * - * MTP Property: Personal Web Address (0xDD1A) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PersonalWebAddress, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 49); - -#define NAME_ContactObj_PersonalWebAddress L"PersonalWebAddress" - - -/* ContactObj.BusinessWebAddress - * - * MTP Property: Business Web Address (0xDD1B) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_BusinessWebAddress, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 50); - -#define NAME_ContactObj_BusinessWebAddress L"BusinessWebAddress" - - -/* ContactObj.IMAddress - * - * MTP Property: Instant Messanger Address (0xDD1C) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_IMAddress, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 51); - -#define NAME_ContactObj_IMAddress L"IMAddress" - - -/* ContactObj.IMAddress2 - * - * MTP Property: Instant Messanger Address 2 (0xDD1D) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_IMAddress2, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 52); - -#define NAME_ContactObj_IMAddress2 L"IMAddress2" - - -/* ContactObj.IMAddress3 - * - * MTP Property: Instant Messanger Address 3 (0xDD1E) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_IMAddress3, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 53); - -#define NAME_ContactObj_IMAddress3 L"IMAddress3" - - -/* ContactObj.Organization - * - * MTP Property: Organization Name (0xDD34) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Organization, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 54); - -#define NAME_ContactObj_Organization L"Organization" - - -/* ContactObj.PhoneticOrganization - * - * MTP Property: Phonetic Organization Name (0xDD35) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_PhoneticOrganization, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 55); - -#define NAME_ContactObj_PhoneticOrganization L"PhoneticOrganization" - - -/* ContactObj.Role - * - * MTP Property: Role (0xDD36) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Role, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 56); - -#define NAME_ContactObj_Role L"Role" - - -/* ContactObj.Fax - * - * MTP Property: Fax Number Primary (0xDD14) - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Fax, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 58); - -#define NAME_ContactObj_Fax L"Fax" - - -/* ContactObj.Spouse - * - * MTP Property: () - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Spouse, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 59); - -#define NAME_ContactObj_Spouse L"Spouse" - - -/* ContactObj.Children - * - * MTP Property: () - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Children, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 60); - -#define NAME_ContactObj_Children L"Children" - - -/* ContactObj.Assistant - * - * MTP Property: () - * Type: String/AUInt16 - * Form: None/RegEx/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Assistant, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 61); - -#define NAME_ContactObj_Assistant L"Assistant" - - -/* ContactObj.Ringtone - * - * MTP Property: () - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Ringtone, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 63); - -#define NAME_ContactObj_Ringtone L"Ringtone" - - -/* ContactObj.Birthdate - * - * MTP Property: (0xDD37) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_Birthdate, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 65); - -#define NAME_ContactObj_Birthdate L"Birthdate" - - -/* ContactObj.AnniversaryDate - * - * MTP Property: () - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_ContactObj_AnniversaryDate, - 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B, - 66); - -#define NAME_ContactObj_AnniversaryDate L"AnniversaryDate" - -#endif /* _CONTACTDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/csq.h b/qt-correction-tool/pub/ddk/csq.h deleted file mode 100644 index 846bc80..0000000 --- a/qt-correction-tool/pub/ddk/csq.h +++ /dev/null @@ -1,310 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - csq.h - -Abstract: - - This header exposes the cancel safe queue DDIs for use on Win2K at later. - Drivers that use this header should link to csq.lib. If a driver only needs - to work on XP or later, neither this header or the lib are required (the - XP kernel supports the cancel safe queue DDIs natively.) - -Revision History: - ---*/ - -// Cancel SAFE DDI set start -// -// The following DDIs are to help ease the pain of writing queue packages that -// handle the cancellation race well. The idea of this set of DDIs is to not -// force a single queue data structure but allow the cancel logic to be hidden -// from the drivers. A driver implements a queue and as part of its header -// includes the IO_CSQ structure. In its initialization routine it calls -// IoInitializeCsq. Then in the dispatch routine when the driver wants to -// insert an IRP into the queue it calls IoCsqInsertIrp. When the driver wants -// to remove something from the queue it calls IoCsqRemoveIrp. Note that Insert -// can fail if the IRP was cancelled in the meantime. Remove can also fail if -// the IRP was already cancelled. -// -// There are typically two modes where drivers queue IRPs. These two modes are -// covered by the cancel safe queue DDI set. -// -// Mode 1: -// One is where the driver queues the IRP and at some later -// point in time dequeues an IRP and issues the IO request. -// For this mode the driver should use IoCsqInsertIrp and IoCsqRemoveNextIrp. -// The driver in this case is expected to pass NULL to the irp context -// parameter in IoInsertIrp. -// -// Mode 2: -// In this the driver queues theIRP, issues the IO request (like issuing a DMA -// request or writing to a register) and when the IO request completes (either -// using a DPC or timer) the driver dequeues the IRP and completes it. For this -// mode the driver should use IoCsqInsertIrp and IoCsqRemoveIrp. In this case -// the driver should allocate an IRP context and pass it in to IoCsqInsertIrp. -// The cancel DDI code creates an association between the IRP and the context -// and thus ensures that when the time comes to remove the IRP it can ascertain -// correctly. -// -// Note that the cancel DDI set assumes that the field DriverContext[3] is -// always available for use and that the driver does not use it. -// - -#ifndef _CSQ_H_ -#define _CSQ_H_ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -// -// If the wdm.h/ntddk.h we're including already defines cancel safe DDIs, we -// can skip the structure definitions. Otherwise, we do the rest here: -// -#ifndef IO_TYPE_CSQ_IRP_CONTEXT - -// -// Bookkeeping structure. This should be opaque to drivers. -// Drivers typically include this as part of their queue headers. -// Given a CSQ pointer the driver should be able to get its -// queue header using CONTAINING_RECORD macro -// - -typedef struct _IO_CSQ IO_CSQ, *PIO_CSQ; - -#define IO_TYPE_CSQ_IRP_CONTEXT 1 -#define IO_TYPE_CSQ 2 - -// -// IRP context structure. This structure is necessary if the driver is using -// the second mode. -// - - -typedef struct _IO_CSQ_IRP_CONTEXT { - ULONG Type; - PIRP Irp; - PIO_CSQ Csq; -} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; - -// -// Routines that insert/remove IRP -// - -typedef VOID -IO_CSQ_INSERT_IRP ( - __in struct _IO_CSQ *Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_INSERT_IRP *PIO_CSQ_INSERT_IRP; - -typedef VOID -IO_CSQ_REMOVE_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_REMOVE_IRP *PIO_CSQ_REMOVE_IRP; - -// -// Retrieves next entry after Irp from the queue. -// Returns NULL if there are no entries in the queue. -// If Irp is NUL, returns the entry in the head of the queue. -// This routine does not remove the IRP from the queue. -// - - -typedef PIRP -IO_CSQ_PEEK_NEXT_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in PVOID PeekContext - ); - -typedef IO_CSQ_PEEK_NEXT_IRP *PIO_CSQ_PEEK_NEXT_IRP; - -// -// Lock routine that protects the cancel safe queue. -// - -typedef VOID -IO_CSQ_ACQUIRE_LOCK ( - __in PIO_CSQ Csq, - __out PKIRQL Irql - ); - -typedef IO_CSQ_ACQUIRE_LOCK *PIO_CSQ_ACQUIRE_LOCK; - -typedef VOID -IO_CSQ_RELEASE_LOCK ( - __in PIO_CSQ Csq, - __in KIRQL Irql - ); - -typedef IO_CSQ_RELEASE_LOCK *PIO_CSQ_RELEASE_LOCK; - -// -// Completes the IRP with STATUS_CANCELLED. IRP is guaranteed to be valid -// In most cases this routine just calls IoCompleteRequest(Irp, STATUS_CANCELLED); -// - -typedef VOID -IO_CSQ_COMPLETE_CANCELED_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_COMPLETE_CANCELED_IRP *PIO_CSQ_COMPLETE_CANCELED_IRP; - -// -// Bookkeeping structure. This should be opaque to drivers. -// Drivers typically include this as part of their queue headers. -// Given a CSQ pointer the driver should be able to get its -// queue header using CONTAINING_RECORD macro -// - -typedef struct _IO_CSQ { - ULONG Type; - PIO_CSQ_INSERT_IRP CsqInsertIrp; - PIO_CSQ_REMOVE_IRP CsqRemoveIrp; - PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; - PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; - PIO_CSQ_RELEASE_LOCK CsqReleaseLock; - PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; - PVOID ReservePointer; // Future expansion -} IO_CSQ, *PIO_CSQ; - -#endif // IO_TYPE_CSQ_IRP_CONTEXT - - -// -// Add in new extensions to the csq.h library. -// - -#ifndef IO_TYPE_CSQ_EX - -#define IO_TYPE_CSQ_EX 3 - -typedef NTSTATUS -IO_CSQ_INSERT_IRP_EX ( - __in struct _IO_CSQ *Csq, - __in PIRP Irp, - __in PVOID InsertContext - ); - -typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; - -#endif // IO_TYPE_CSQ_EX - - -// -// These defines ensure the backward compatible CSQ library can be used within -// the XP build environment in which the kernel supports the functions natively. -// - -#define CSQLIB_DDI(x) Wdmlib##x - -// -// Initializes the cancel queue structure. -// - -#undef IoCsqInitialize -#define IoCsqInitialize WdmlibIoCsqInitialize - -NTSTATUS -CSQLIB_DDI(IoCsqInitialize)( - __in PIO_CSQ Csq, - __in PIO_CSQ_INSERT_IRP CsqInsertIrp, - __in PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - __in PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - __in PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - __in PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - __in PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp - ); - - -#undef IoCsqInitializeEx -#define IoCsqInitializeEx WdmlibIoCsqInitializeEx - -NTSTATUS -CSQLIB_DDI(IoCsqInitializeEx)( - __in PIO_CSQ Csq, - __in PIO_CSQ_INSERT_IRP_EX CsqInsertIrp, - __in PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - __in PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - __in PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - __in PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - __in PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp - ); - - -// -// The caller calls this routine to insert the IRP and return STATUS_PENDING. -// - -#undef IoCsqInsertIrp -#define IoCsqInsertIrp WdmlibIoCsqInsertIrp - -VOID -CSQLIB_DDI(IoCsqInsertIrp)( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in_opt PIO_CSQ_IRP_CONTEXT Context - ); - - -#undef IoCsqInsertIrpEx -#define IoCsqInsertIrpEx WdmlibIoCsqInsertIrpEx - -NTSTATUS -CSQLIB_DDI(IoCsqInsertIrpEx)( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in_opt PIO_CSQ_IRP_CONTEXT Context, - __in_opt PVOID InsertContext - ); - -// -// Returns an IRP if one can be found. NULL otherwise. -// - -#undef IoCsqRemoveNextIrp -#define IoCsqRemoveNextIrp WdmlibIoCsqRemoveNextIrp - -PIRP -CSQLIB_DDI(IoCsqRemoveNextIrp)( - __in PIO_CSQ Csq, - __in_opt PVOID PeekContext - ); - -// -// This routine is called from timeout or DPCs. -// The context is presumably part of the DPC or timer context. -// If succesfull returns the IRP associated with context. -// - -#undef IoCsqRemoveIrp -#define IoCsqRemoveIrp WdmlibIoCsqRemoveIrp - -PIRP -CSQLIB_DDI(IoCsqRemoveIrp)( - __in PIO_CSQ Csq, - __in PIO_CSQ_IRP_CONTEXT Context - ); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _CSQ_H_ - -// Cancel SAFE DDI set end - - - diff --git a/qt-correction-tool/pub/ddk/d3dhal.h b/qt-correction-tool/pub/ddk/d3dhal.h deleted file mode 100644 index 26b3aec..0000000 --- a/qt-correction-tool/pub/ddk/d3dhal.h +++ /dev/null @@ -1,2763 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: d3dhal.h - * Content: Direct3D HAL include file - * - ***************************************************************************/ - -#ifndef _D3DHAL_H_ -#define _D3DHAL_H_ -#include "ddraw.h" -#include "d3dtypes.h" -#include "d3dcaps.h" -#include "d3d.h" -#if(DIRECT3D_VERSION >= 0x0900 ) -#include "d3d9.h" -#include "dxva9typ.h" -#else -#include "d3d8.h" -#endif - -struct _D3DHAL_CALLBACKS; -typedef struct _D3DHAL_CALLBACKS D3DHAL_CALLBACKS, *LPD3DHAL_CALLBACKS; - -struct _D3DHAL_CALLBACKS2; -typedef struct _D3DHAL_CALLBACKS2 D3DHAL_CALLBACKS2, *LPD3DHAL_CALLBACKS2; - -struct _D3DHAL_CALLBACKS3; -typedef struct _D3DHAL_CALLBACKS3 D3DHAL_CALLBACKS3, *LPD3DHAL_CALLBACKS3; - -typedef struct _DDRAWI_DIRECTDRAW_GBL FAR *LPDDRAWI_DIRECTDRAW_GBL; -typedef struct _DDRAWI_DIRECTDRAW_LCL FAR *LPDDRAWI_DIRECTDRAW_LCL; -struct _DDRAWI_DDRAWSURFACE_LCL; -typedef struct _DDRAWI_DDRAWSURFACE_LCL FAR *LPDDRAWI_DDRAWSURFACE_LCL; - -/* - * If the HAL driver does not implement clipping, it must reserve at least - * this much space at the end of the LocalVertexBuffer for use by the HEL - * clipping. I.e. the vertex buffer contain dwNumVertices+dwNumClipVertices - * vertices. No extra space is needed by the HEL clipping in the - * LocalHVertexBuffer. - */ -#define D3DHAL_NUMCLIPVERTICES 20 - -/* - * These are a few special internal renderstates etc. that would - * logically be in d3dtypes.h, but that file is external, so they are - * here. - */ -#define D3DTSS_MAX_DX6 ((D3DTEXTURESTAGESTATETYPE)24) -#define D3DTSS_MAX_DX7 ((D3DTEXTURESTAGESTATETYPE)29) -#define D3DTSS_MAX_DX8 ((D3DTEXTURESTAGESTATETYPE)29) -#define D3DTSS_MAX_DX9 ((D3DTEXTURESTAGESTATETYPE)33) - -#if( DIRECT3D_VERSION >= 0x0900 ) -#define D3DTSS_MAX D3DTSS_MAX_DX9 -#elif( DIRECT3D_VERSION >= 0x0800 ) -#define D3DTSS_MAX D3DTSS_MAX_DX8 -#elif( DIRECT3D_VERSION >= 0x0700 ) -#define D3DTSS_MAX D3DTSS_MAX_DX7 -#else -#define D3DTSS_MAX D3DTSS_MAX_DX6 -#endif - -/* - * If DX8 driver wants to support pre-DX8 applications, it should use these - * definitions for pre-DX8 world matrices -*/ -#define D3DTRANSFORMSTATE_WORLD_DX7 1 -#define D3DTRANSFORMSTATE_WORLD1_DX7 4 -#define D3DTRANSFORMSTATE_WORLD2_DX7 5 -#define D3DTRANSFORMSTATE_WORLD3_DX7 6 - -/* - * Generally needed maximum state structure sizes. Note that the copy of - * these in refrasti.hpp must be kept in sync with these. - */ -#define D3DHAL_MAX_RSTATES_DX6 (256) -#define D3DHAL_MAX_RSTATES_DX7 (256) -#define D3DHAL_MAX_RSTATES_DX8 (256) -#define D3DHAL_MAX_RSTATES_DX9 (256) - -#if( DIRECT3D_VERSION >= 0x0900 ) -#define D3DHAL_MAX_RSTATES D3DHAL_MAX_RSTATES_DX9 -#elif( DIRECT3D_VERSION >= 0x0800 ) -#define D3DHAL_MAX_RSTATES D3DHAL_MAX_RSTATES_DX8 -#elif( DIRECT3D_VERSION >= 0x0700 ) -#define D3DHAL_MAX_RSTATES D3DHAL_MAX_RSTATES_DX7 -#else -#define D3DHAL_MAX_RSTATES D3DHAL_MAX_RSTATES_DX6 -#endif - -#define D3D_MAXRENDERSTATES ((D3DRENDERSTATETYPE)D3DHAL_MAX_RSTATES) - -/* Last state offset for combined render state and texture stage array + 1 */ -#define D3DHAL_MAX_RSTATES_AND_STAGES \ - (D3DHAL_TSS_RENDERSTATEBASE + \ - D3DHAL_TSS_MAXSTAGES * D3DHAL_TSS_STATESPERSTAGE) -/* Last texture state ID */ -#define D3DHAL_MAX_TEXTURESTATES (13) -/* Last texture state ID + 1 */ -#define D3DHAL_TEXTURESTATEBUF_SIZE (D3DHAL_MAX_TEXTURESTATES+1) - -/* - * If no dwNumVertices is given, this is what will be used. - */ -#define D3DHAL_DEFAULT_TL_NUM ((32 * 1024) / sizeof (D3DTLVERTEX)) -#define D3DHAL_DEFAULT_H_NUM ((32 * 1024) / sizeof (D3DHVERTEX)) - -/* - * Description for a device. - * This is used to describe a device that is to be created or to query - * the current device. - * - * For DX5 and subsequent runtimes, D3DDEVICEDESC is a user-visible - * structure that is not seen by the device drivers. The runtime - * stitches a D3DDEVICEDESC together using the D3DDEVICEDESC_V1 - * embedded in the GLOBALDRIVERDATA and the extended caps queried - * from the driver using GetDriverInfo. - */ - -typedef struct _D3DDeviceDesc_V1 { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBD_16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ -} D3DDEVICEDESC_V1, *LPD3DDEVICEDESC_V1; - -#define D3DDEVICEDESCSIZE_V1 (sizeof(D3DDEVICEDESC_V1)) - -/* - * This is equivalent to the D3DDEVICEDESC understood by DX5, available only - * from DX6. It is the same as D3DDEVICEDESC structure in DX5. - * D3DDEVICEDESC is still the user-visible structure that is not seen by the - * device drivers. The runtime stitches a D3DDEVICEDESC together using the - * D3DDEVICEDESC_V1 embedded in the GLOBALDRIVERDATA and the extended caps - * queried from the driver using GetDriverInfo. - */ - -typedef struct _D3DDeviceDesc_V2 { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBD_16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ - - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; - -} D3DDEVICEDESC_V2, *LPD3DDEVICEDESC_V2; - -#define D3DDEVICEDESCSIZE_V2 (sizeof(D3DDEVICEDESC_V2)) - -#if(DIRECT3D_VERSION >= 0x0700) -/* - * This is equivalent to the D3DDEVICEDESC understood by DX6, available only - * from DX6. It is the same as D3DDEVICEDESC structure in DX6. - * D3DDEVICEDESC is still the user-visible structure that is not seen by the - * device drivers. The runtime stitches a D3DDEVICEDESC together using the - * D3DDEVICEDESC_V1 embedded in the GLOBALDRIVERDATA and the extended caps - * queried from the driver using GetDriverInfo. - */ - -typedef struct _D3DDeviceDesc_V3 { - DWORD dwSize; /* Size of D3DDEVICEDESC structure */ - DWORD dwFlags; /* Indicates which fields have valid data */ - D3DCOLORMODEL dcmColorModel; /* Color model of device */ - DWORD dwDevCaps; /* Capabilities of device */ - D3DTRANSFORMCAPS dtcTransformCaps; /* Capabilities of transform */ - BOOL bClipping; /* Device can do 3D clipping */ - D3DLIGHTINGCAPS dlcLightingCaps; /* Capabilities of lighting */ - D3DPRIMCAPS dpcLineCaps; - D3DPRIMCAPS dpcTriCaps; - DWORD dwDeviceRenderBitDepth; /* One of DDBD_16, etc.. */ - DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ - DWORD dwMaxBufferSize; /* Maximum execute buffer size */ - DWORD dwMaxVertexCount; /* Maximum vertex count */ - - DWORD dwMinTextureWidth, dwMinTextureHeight; - DWORD dwMaxTextureWidth, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; - - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - DWORD dwFVFCaps; /* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware */ - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; -} D3DDEVICEDESC_V3, *LPD3DDEVICEDESC_V3; - -#define D3DDEVICEDESCSIZE_V3 (sizeof(D3DDEVICEDESC_V3)) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* -------------------------------------------------------------- - * Instantiated by the HAL driver on driver connection. - */ -typedef struct _D3DHAL_GLOBALDRIVERDATA { - DWORD dwSize; // Size of this structure - D3DDEVICEDESC_V1 hwCaps; // Capabilities of the hardware - DWORD dwNumVertices; // see following comment - DWORD dwNumClipVertices; // see following comment - DWORD dwNumTextureFormats; // Number of texture formats - LPDDSURFACEDESC lpTextureFormats; // Pointer to texture formats -} D3DHAL_GLOBALDRIVERDATA; - -typedef D3DHAL_GLOBALDRIVERDATA *LPD3DHAL_GLOBALDRIVERDATA; - -#define D3DHAL_GLOBALDRIVERDATASIZE (sizeof(D3DHAL_GLOBALDRIVERDATA)) - -#if(DIRECT3D_VERSION >= 0x0700) -/* -------------------------------------------------------------- - * Extended caps introduced with DX5 and queried with - * GetDriverInfo (GUID_D3DExtendedCaps). - */ -typedef struct _D3DHAL_D3DDX6EXTENDEDCAPS { - DWORD dwSize; // Size of this structure - - DWORD dwMinTextureWidth, dwMaxTextureWidth; - DWORD dwMinTextureHeight, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; - - /* fields added for DX6 */ - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - DWORD dwFVFCaps; /* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware */ - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; - -} D3DHAL_D3DDX6EXTENDEDCAPS; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -/* -------------------------------------------------------------- - * Extended caps introduced with DX5 and queried with - * GetDriverInfo (GUID_D3DExtendedCaps). - */ -typedef struct _D3DHAL_D3DEXTENDEDCAPS { - DWORD dwSize; // Size of this structure - - DWORD dwMinTextureWidth, dwMaxTextureWidth; - DWORD dwMinTextureHeight, dwMaxTextureHeight; - DWORD dwMinStippleWidth, dwMaxStippleWidth; - DWORD dwMinStippleHeight, dwMaxStippleHeight; - - /* fields added for DX6 */ - DWORD dwMaxTextureRepeat; - DWORD dwMaxTextureAspectRatio; - DWORD dwMaxAnisotropy; - D3DVALUE dvGuardBandLeft; - D3DVALUE dvGuardBandTop; - D3DVALUE dvGuardBandRight; - D3DVALUE dvGuardBandBottom; - D3DVALUE dvExtentsAdjust; - DWORD dwStencilCaps; - DWORD dwFVFCaps; /* low 4 bits: 0 implies TLVERTEX only, 1..8 imply FVF aware */ - DWORD dwTextureOpCaps; - WORD wMaxTextureBlendStages; - WORD wMaxSimultaneousTextures; - -#if(DIRECT3D_VERSION >= 0x0700) - /* fields added for DX7 */ - DWORD dwMaxActiveLights; - D3DVALUE dvMaxVertexW; - - WORD wMaxUserClipPlanes; - WORD wMaxVertexBlendMatrices; - - DWORD dwVertexProcessingCaps; - - DWORD dwReserved1; - DWORD dwReserved2; - DWORD dwReserved3; - DWORD dwReserved4; -#endif /* DIRECT3D_VERSION >= 0x0700 */ -} D3DHAL_D3DEXTENDEDCAPS; - -typedef D3DHAL_D3DEXTENDEDCAPS *LPD3DHAL_D3DEXTENDEDCAPS; -#define D3DHAL_D3DEXTENDEDCAPSSIZE (sizeof(D3DHAL_D3DEXTENDEDCAPS)) - -#if(DIRECT3D_VERSION >= 0x0700) -typedef D3DHAL_D3DDX6EXTENDEDCAPS *LPD3DHAL_D3DDX6EXTENDEDCAPS; -#define D3DHAL_D3DDX6EXTENDEDCAPSSIZE (sizeof(D3DHAL_D3DDX6EXTENDEDCAPS)) -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0900) -typedef struct _D3DCAPS8 -{ - /* Device Info */ - D3DDEVTYPE DeviceType; - UINT AdapterOrdinal; - - /* Caps from DX7 Draw */ - DWORD Caps; - DWORD Caps2; - DWORD Caps3; - DWORD PresentationIntervals; - - /* Cursor Caps */ - DWORD CursorCaps; - - /* 3D Device Caps */ - DWORD DevCaps; - - DWORD PrimitiveMiscCaps; - DWORD RasterCaps; - DWORD ZCmpCaps; - DWORD SrcBlendCaps; - DWORD DestBlendCaps; - DWORD AlphaCmpCaps; - DWORD ShadeCaps; - DWORD TextureCaps; - DWORD TextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DTexture8's - DWORD CubeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DCubeTexture8's - DWORD VolumeTextureFilterCaps; // D3DPTFILTERCAPS for IDirect3DVolumeTexture8's - DWORD TextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DTexture8's - DWORD VolumeTextureAddressCaps; // D3DPTADDRESSCAPS for IDirect3DVolumeTexture8's - - DWORD LineCaps; // D3DLINECAPS - - DWORD MaxTextureWidth, MaxTextureHeight; - DWORD MaxVolumeExtent; - - DWORD MaxTextureRepeat; - DWORD MaxTextureAspectRatio; - DWORD MaxAnisotropy; - float MaxVertexW; - - float GuardBandLeft; - float GuardBandTop; - float GuardBandRight; - float GuardBandBottom; - - float ExtentsAdjust; - DWORD StencilCaps; - - DWORD FVFCaps; - DWORD TextureOpCaps; - DWORD MaxTextureBlendStages; - DWORD MaxSimultaneousTextures; - - DWORD VertexProcessingCaps; - DWORD MaxActiveLights; - DWORD MaxUserClipPlanes; - DWORD MaxVertexBlendMatrices; - DWORD MaxVertexBlendMatrixIndex; - - float MaxPointSize; - - DWORD MaxPrimitiveCount; // max number of primitives per DrawPrimitive call - DWORD MaxVertexIndex; - DWORD MaxStreams; - DWORD MaxStreamStride; // max stride for SetStreamSource - - DWORD VertexShaderVersion; - DWORD MaxVertexShaderConst; // number of vertex shader constant registers - - DWORD PixelShaderVersion; - float MaxPixelShaderValue; // max value of pixel shader arithmetic component -} D3DCAPS8; - -typedef D3DLIGHT9 D3DLIGHT8; -typedef D3DMATERIAL9 D3DMATERIAL8; -typedef D3DVIEWPORT9 D3DVIEWPORT8; -#define D3DRS_EDGEANTIALIAS D3DRS_RESERVED0 -#ifndef D3DPRASTERCAPS_ANTIALIASEDGES -#define D3DPRASTERCAPS_ANTIALIASEDGES D3DPRASTERCAPS_RESERVED0 -#endif /* D3DPRASTERCAPS_ANTIALIASEDGES */ -#ifndef D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE -#define D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE 0x00800000L -#endif /* D3DPRASTERCAPS_STRETCHBLTMULTISAMPLE */ -#ifndef D3DPRASTERCAPS_PAT -#define D3DPRASTERCAPS_PAT 0x00000008L // equal to D3DPRASTERCAPS_RESERVED2 -#endif - - -// This cap should not be used in DX9+ drivers -// -#ifndef D3DVTXPCAPS_NO_VSDT_UBYTE4 -#define D3DVTXPCAPS_NO_VSDT_UBYTE4 0x00000080L /* device does not support D3DVSDT_UBYTE4 */ -#endif - -// These are old filter caps that have been retired. -#define D3DTEXF_FLATCUBIC 4 -#define D3DTEXF_GAUSSIANCUBIC 5 - -// These are line related states and caps that have been retired -typedef struct _D3DLINEPATTERN { - WORD wRepeatFactor; - WORD wLinePattern; -} D3DLINEPATTERN; - -#define D3DPMISCCAPS_LINEPATTERNREP 0x00000004L - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -/* -------------------------------------------------------------- - * Argument to the HAL functions. - * - * !!! When this structure is changed, D3DHAL_CONTEXTCREATEDATA in - * windows\published\ntgdistr.h also must be changed to be the same size !!! - * - */ - -typedef struct _D3DHAL_CONTEXTCREATEDATA -{ - union - { - LPDDRAWI_DIRECTDRAW_GBL lpDDGbl; // in: Driver struct (legacy) - LPDDRAWI_DIRECTDRAW_LCL lpDDLcl; // in: For DX7 driver onwards - }; - - union - { - LPDIRECTDRAWSURFACE lpDDS; // in: Surface to be used as target - LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; // For DX7 onwards - }; - - union - { - LPDIRECTDRAWSURFACE lpDDSZ; // in: Surface to be used as Z - LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl; // For DX7 onwards - }; - - union - { - DWORD dwPID; // in: Current process id - ULONG_PTR dwrstates; // Must be larger enough to hold a pointer as - // we can return a pointer in this field - }; - ULONG_PTR dwhContext; // out: Context handle - HRESULT ddrval; // out: Return value -} D3DHAL_CONTEXTCREATEDATA; -typedef D3DHAL_CONTEXTCREATEDATA *LPD3DHAL_CONTEXTCREATEDATA; - -typedef struct _D3DHAL_CONTEXTDESTROYDATA -{ - ULONG_PTR dwhContext; // in: Context handle - HRESULT ddrval; // out: Return value -} D3DHAL_CONTEXTDESTROYDATA; -typedef D3DHAL_CONTEXTDESTROYDATA *LPD3DHAL_CONTEXTDESTROYDATA; - -typedef struct _D3DHAL_CONTEXTDESTROYALLDATA -{ - DWORD dwPID; // in: Process id to destroy contexts for - HRESULT ddrval; // out: Return value -} D3DHAL_CONTEXTDESTROYALLDATA; -typedef D3DHAL_CONTEXTDESTROYALLDATA *LPD3DHAL_CONTEXTDESTROYALLDATA; - -typedef struct _D3DHAL_SCENECAPTUREDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwFlag; // in: Indicates beginning or end - HRESULT ddrval; // out: Return value -} D3DHAL_SCENECAPTUREDATA; -typedef D3DHAL_SCENECAPTUREDATA *LPD3DHAL_SCENECAPTUREDATA; - -typedef struct _D3DHAL_RENDERSTATEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwOffset; // in: Where to find states in buffer - DWORD dwCount; // in: How many states to process - LPDIRECTDRAWSURFACE lpExeBuf; // in: Execute buffer containing data - HRESULT ddrval; // out: Return value -} D3DHAL_RENDERSTATEDATA; -typedef D3DHAL_RENDERSTATEDATA *LPD3DHAL_RENDERSTATEDATA; - -typedef struct _D3DHAL_RENDERPRIMITIVEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwOffset; // in: Where to find primitive data in buffer - DWORD dwStatus; // in/out: Condition branch status - LPDIRECTDRAWSURFACE lpExeBuf; // in: Execute buffer containing data - DWORD dwTLOffset; // in: Byte offset in lpTLBuf for start of vertex data - LPDIRECTDRAWSURFACE lpTLBuf; // in: Execute buffer containing TLVertex data - D3DINSTRUCTION diInstruction; // in: Primitive instruction - HRESULT ddrval; // out: Return value -} D3DHAL_RENDERPRIMITIVEDATA; -typedef D3DHAL_RENDERPRIMITIVEDATA *LPD3DHAL_RENDERPRIMITIVEDATA; - -typedef struct _D3DHAL_TEXTURECREATEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - LPDIRECTDRAWSURFACE lpDDS; // in: Pointer to surface object - DWORD dwHandle; // out: Handle to texture - HRESULT ddrval; // out: Return value -} D3DHAL_TEXTURECREATEDATA; -typedef D3DHAL_TEXTURECREATEDATA *LPD3DHAL_TEXTURECREATEDATA; - -typedef struct _D3DHAL_TEXTUREDESTROYDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwHandle; // in: Handle to texture - HRESULT ddrval; // out: Return value -} D3DHAL_TEXTUREDESTROYDATA; -typedef D3DHAL_TEXTUREDESTROYDATA *LPD3DHAL_TEXTUREDESTROYDATA; - -typedef struct _D3DHAL_TEXTURESWAPDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwHandle1; // in: Handle to texture 1 - DWORD dwHandle2; // in: Handle to texture 2 - HRESULT ddrval; // out: Return value -} D3DHAL_TEXTURESWAPDATA; -typedef D3DHAL_TEXTURESWAPDATA *LPD3DHAL_TEXTURESWAPDATA; - -typedef struct _D3DHAL_TEXTUREGETSURFDATA -{ - ULONG_PTR dwhContext; // in: Context handle - ULONG_PTR lpDDS; // out: Pointer to surface object - DWORD dwHandle; // in: Handle to texture - HRESULT ddrval; // out: Return value -} D3DHAL_TEXTUREGETSURFDATA; -typedef D3DHAL_TEXTUREGETSURFDATA *LPD3DHAL_TEXTUREGETSURFDATA; - -typedef struct _D3DHAL_GETSTATEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwWhich; // in: Transform, lighting or render? - D3DSTATE ddState; // in/out: State. - HRESULT ddrval; // out: Return value -} D3DHAL_GETSTATEDATA; -typedef D3DHAL_GETSTATEDATA *LPD3DHAL_GETSTATEDATA; - - -/* -------------------------------------------------------------- - * Direct3D HAL Table. - * Instantiated by the HAL driver on connection. - * - * Calls take the form of: - * retcode = HalCall(HalCallData* lpData); - */ - -typedef DWORD (__stdcall *LPD3DHAL_CONTEXTCREATECB) (LPD3DHAL_CONTEXTCREATEDATA); -typedef DWORD (__stdcall *LPD3DHAL_CONTEXTDESTROYCB) (LPD3DHAL_CONTEXTDESTROYDATA); -typedef DWORD (__stdcall *LPD3DHAL_CONTEXTDESTROYALLCB) (LPD3DHAL_CONTEXTDESTROYALLDATA); -typedef DWORD (__stdcall *LPD3DHAL_SCENECAPTURECB) (LPD3DHAL_SCENECAPTUREDATA); -typedef DWORD (__stdcall *LPD3DHAL_RENDERSTATECB) (LPD3DHAL_RENDERSTATEDATA); -typedef DWORD (__stdcall *LPD3DHAL_RENDERPRIMITIVECB) (LPD3DHAL_RENDERPRIMITIVEDATA); -typedef DWORD (__stdcall *LPD3DHAL_TEXTURECREATECB) (LPD3DHAL_TEXTURECREATEDATA); -typedef DWORD (__stdcall *LPD3DHAL_TEXTUREDESTROYCB) (LPD3DHAL_TEXTUREDESTROYDATA); -typedef DWORD (__stdcall *LPD3DHAL_TEXTURESWAPCB) (LPD3DHAL_TEXTURESWAPDATA); -typedef DWORD (__stdcall *LPD3DHAL_TEXTUREGETSURFCB) (LPD3DHAL_TEXTUREGETSURFDATA); -typedef DWORD (__stdcall *LPD3DHAL_GETSTATECB) (LPD3DHAL_GETSTATEDATA); - - -/* - * Regarding dwNumVertices, specify 0 if you are relying on the HEL to do - * everything and you do not need the resultant TLVertex buffer to reside - * in device memory. - * The HAL driver will be asked to allocate dwNumVertices + dwNumClipVertices - * in the case described above. - */ - -typedef struct _D3DHAL_CALLBACKS -{ - DWORD dwSize; - - // Device context - LPD3DHAL_CONTEXTCREATECB ContextCreate; - LPD3DHAL_CONTEXTDESTROYCB ContextDestroy; - LPD3DHAL_CONTEXTDESTROYALLCB ContextDestroyAll; - - // Scene Capture - LPD3DHAL_SCENECAPTURECB SceneCapture; - - LPVOID lpReserved10; // Must be zero - LPVOID lpReserved11; // Must be zero - - // Execution - LPD3DHAL_RENDERSTATECB RenderState; - LPD3DHAL_RENDERPRIMITIVECB RenderPrimitive; - - DWORD dwReserved; // Must be zero - - // Textures - LPD3DHAL_TEXTURECREATECB TextureCreate; - LPD3DHAL_TEXTUREDESTROYCB TextureDestroy; - LPD3DHAL_TEXTURESWAPCB TextureSwap; - LPD3DHAL_TEXTUREGETSURFCB TextureGetSurf; - - LPVOID lpReserved12; // Must be zero - LPVOID lpReserved13; // Must be zero - LPVOID lpReserved14; // Must be zero - LPVOID lpReserved15; // Must be zero - LPVOID lpReserved16; // Must be zero - LPVOID lpReserved17; // Must be zero - LPVOID lpReserved18; // Must be zero - LPVOID lpReserved19; // Must be zero - LPVOID lpReserved20; // Must be zero - LPVOID lpReserved21; // Must be zero - - // Pipeline state - LPD3DHAL_GETSTATECB GetState; - - DWORD dwReserved0; // Must be zero - DWORD dwReserved1; // Must be zero - DWORD dwReserved2; // Must be zero - DWORD dwReserved3; // Must be zero - DWORD dwReserved4; // Must be zero - DWORD dwReserved5; // Must be zero - DWORD dwReserved6; // Must be zero - DWORD dwReserved7; // Must be zero - DWORD dwReserved8; // Must be zero - DWORD dwReserved9; // Must be zero - -} D3DHAL_CALLBACKS; -typedef D3DHAL_CALLBACKS *LPD3DHAL_CALLBACKS; - -#define D3DHAL_SIZE_V1 sizeof( D3DHAL_CALLBACKS ) - - -typedef struct _D3DHAL_SETRENDERTARGETDATA -{ - ULONG_PTR dwhContext; // in: Context handle - union - { - LPDIRECTDRAWSURFACE lpDDS; // in: new render target - LPDDRAWI_DDRAWSURFACE_LCL lpDDSLcl; - }; - - union - { - LPDIRECTDRAWSURFACE lpDDSZ; // in: new Z buffer - LPDDRAWI_DDRAWSURFACE_LCL lpDDSZLcl; - }; - - HRESULT ddrval; // out: Return value -} D3DHAL_SETRENDERTARGETDATA; -typedef D3DHAL_SETRENDERTARGETDATA FAR *LPD3DHAL_SETRENDERTARGETDATA; - -// This bit is the same as D3DCLEAR_RESERVED0 in d3d8types.h -// When set it means that driver has to cull rects against current viewport. -// The bit is set only for pure devices -// -#define D3DCLEAR_COMPUTERECTS 0x00000008l - -typedef struct _D3DHAL_CLEARDATA -{ - ULONG_PTR dwhContext; // in: Context handle - - // dwFlags can contain D3DCLEAR_TARGET or D3DCLEAR_ZBUFFER - DWORD dwFlags; // in: surfaces to clear - - DWORD dwFillColor; // in: Color value for rtarget - DWORD dwFillDepth; // in: Depth value for Z buffer - - LPD3DRECT lpRects; // in: Rectangles to clear - DWORD dwNumRects; // in: Number of rectangles - - HRESULT ddrval; // out: Return value -} D3DHAL_CLEARDATA; -typedef D3DHAL_CLEARDATA FAR *LPD3DHAL_CLEARDATA; - -typedef struct _D3DHAL_DRAWONEPRIMITIVEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - - DWORD dwFlags; // in: flags - - D3DPRIMITIVETYPE PrimitiveType; // in: type of primitive to draw - union{ - D3DVERTEXTYPE VertexType; // in: type of vertices - DWORD dwFVFControl; // in: FVF control DWORD - }; - LPVOID lpvVertices; // in: pointer to vertices - DWORD dwNumVertices; // in: number of vertices - - DWORD dwReserved; // in: reserved - - HRESULT ddrval; // out: Return value - -} D3DHAL_DRAWONEPRIMITIVEDATA; -typedef D3DHAL_DRAWONEPRIMITIVEDATA *LPD3DHAL_DRAWONEPRIMITIVEDATA; - - -typedef struct _D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - - DWORD dwFlags; // in: flags word - - // Primitive and vertex type - D3DPRIMITIVETYPE PrimitiveType; // in: primitive type - union{ - D3DVERTEXTYPE VertexType; // in: vertex type - DWORD dwFVFControl; // in: FVF control DWORD - }; - - // Vertices - LPVOID lpvVertices; // in: vertex data - DWORD dwNumVertices; // in: vertex count - - // Indices - LPWORD lpwIndices; // in: index data - DWORD dwNumIndices; // in: index count - - HRESULT ddrval; // out: Return value -} D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA; -typedef D3DHAL_DRAWONEINDEXEDPRIMITIVEDATA *LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA; - - -typedef struct _D3DHAL_DRAWPRIMCOUNTS -{ - WORD wNumStateChanges; - WORD wPrimitiveType; - WORD wVertexType; - WORD wNumVertices; -} D3DHAL_DRAWPRIMCOUNTS, *LPD3DHAL_DRAWPRIMCOUNTS; - -typedef struct _D3DHAL_DRAWPRIMITIVESDATA -{ - ULONG_PTR dwhContext; // in: Context handle - - DWORD dwFlags; - - // - // Data block: - // - // Consists of interleaved D3DHAL_DRAWPRIMCOUNTS, state change pairs, - // and primitive drawing commands. - // - // D3DHAL_DRAWPRIMCOUNTS: gives number of state change pairs and - // the information on the primitive to draw. - // wPrimitiveType is of type D3DPRIMITIVETYPE. Drivers - // must support all 7 of the primitive types specified - // in the DrawPrimitive API. - // Currently, wVertexType will always be D3DVT_TLVERTEX. - // If the wNumVertices member is 0, then the driver should - // return after doing the state changing. This is the - // terminator for the command stream. - // state change pairs: DWORD pairs specify the state changes that - // the driver should effect before drawing the primitive. - // wNumStateChanges can be 0, in which case the next primitive - // should be drawn without any state changes in between. - // If present, the state change pairs are NOT aligned, they - // immediately follow the PRIMCOUNTS structure. - // vertex data (if any): is 32-byte aligned. - // - // If a primcounts structure follows (i.e. if wNumVertices was nonzero - // in the previous one), then it will immediately follow the state - // changes or vertex data with no alignment padding. - // - - LPVOID lpvData; - - DWORD dwFVFControl; // in: FVF control DWORD - - HRESULT ddrval; // out: Return value -} D3DHAL_DRAWPRIMITIVESDATA; -typedef D3DHAL_DRAWPRIMITIVESDATA *LPD3DHAL_DRAWPRIMITIVESDATA; - -typedef DWORD (CALLBACK *LPD3DHAL_SETRENDERTARGETCB) (LPD3DHAL_SETRENDERTARGETDATA); -typedef DWORD (CALLBACK *LPD3DHAL_CLEARCB) (LPD3DHAL_CLEARDATA); -typedef DWORD (CALLBACK *LPD3DHAL_DRAWONEPRIMITIVECB) (LPD3DHAL_DRAWONEPRIMITIVEDATA); -typedef DWORD (CALLBACK *LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB) (LPD3DHAL_DRAWONEINDEXEDPRIMITIVEDATA); -typedef DWORD (CALLBACK *LPD3DHAL_DRAWPRIMITIVESCB) (LPD3DHAL_DRAWPRIMITIVESDATA); - -typedef struct _D3DHAL_CALLBACKS2 -{ - DWORD dwSize; // size of struct - DWORD dwFlags; // flags for callbacks - LPD3DHAL_SETRENDERTARGETCB SetRenderTarget; - LPD3DHAL_CLEARCB Clear; - LPD3DHAL_DRAWONEPRIMITIVECB DrawOnePrimitive; - LPD3DHAL_DRAWONEINDEXEDPRIMITIVECB DrawOneIndexedPrimitive; - LPD3DHAL_DRAWPRIMITIVESCB DrawPrimitives; -} D3DHAL_CALLBACKS2; -typedef D3DHAL_CALLBACKS2 *LPD3DHAL_CALLBACKS2; - -#define D3DHAL_CALLBACKS2SIZE sizeof(D3DHAL_CALLBACKS2) - -#define D3DHAL2_CB32_SETRENDERTARGET 0x00000001L -#define D3DHAL2_CB32_CLEAR 0x00000002L -#define D3DHAL2_CB32_DRAWONEPRIMITIVE 0x00000004L -#define D3DHAL2_CB32_DRAWONEINDEXEDPRIMITIVE 0x00000008L -#define D3DHAL2_CB32_DRAWPRIMITIVES 0x00000010L - -/* -------------------------------------------------------------- - * D3DCallbacks3 - queried with GetDriverInfo (GUID_D3DCallbacks3). - * - * Clear2 - enables stencil clears (exposed to the API in - * IDirect3DViewport3::Clear2 - * ValidateTextureStageState - evaluates the context's current state (including - * multitexture) and returns an error if the hardware cannot - * accelerate the current state vector. - * DrawPrimitives2 - Renders primitives, and changes device state specified - * in the command buffer. - * - * Multitexture-aware drivers must implement both ValidateTextureStageState. - */ - -typedef struct _D3DHAL_CLEAR2DATA -{ - ULONG_PTR dwhContext; // in: Context handle - - // dwFlags can contain D3DCLEAR_TARGET, D3DCLEAR_ZBUFFER, and/or D3DCLEAR_STENCIL - DWORD dwFlags; // in: surfaces to clear - - DWORD dwFillColor; // in: Color value for rtarget - D3DVALUE dvFillDepth; // in: Depth value for Z buffer (0.0-1.0) - DWORD dwFillStencil; // in: value used to clear stencil buffer - - LPD3DRECT lpRects; // in: Rectangles to clear - DWORD dwNumRects; // in: Number of rectangles - - HRESULT ddrval; // out: Return value -} D3DHAL_CLEAR2DATA; -typedef D3DHAL_CLEAR2DATA FAR *LPD3DHAL_CLEAR2DATA; - -typedef struct _D3DHAL_VALIDATETEXTURESTAGESTATEDATA -{ - ULONG_PTR dwhContext; // in: Context handle - DWORD dwFlags; // in: Flags, currently set to 0 - ULONG_PTR dwReserved; // - DWORD dwNumPasses; // out: Number of passes the hardware - // can perform the operation in - HRESULT ddrval; // out: return value -} D3DHAL_VALIDATETEXTURESTAGESTATEDATA; -typedef D3DHAL_VALIDATETEXTURESTAGESTATEDATA *LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA; - -//----------------------------------------------------------------------------- -// DrawPrimitives2 DDI -//----------------------------------------------------------------------------- - -// -// Command structure for vertex buffer rendering -// - -typedef struct _D3DHAL_DP2COMMAND -{ - BYTE bCommand; // vertex command - BYTE bReserved; - union - { - WORD wPrimitiveCount; // primitive count for unconnected primitives - WORD wStateCount; // count of render states to follow - }; -} D3DHAL_DP2COMMAND, *LPD3DHAL_DP2COMMAND; - -// -// DrawPrimitives2 commands: -// - -typedef enum _D3DHAL_DP2OPERATION -{ - D3DDP2OP_POINTS = 1, - D3DDP2OP_INDEXEDLINELIST = 2, - D3DDP2OP_INDEXEDTRIANGLELIST = 3, - D3DDP2OP_RENDERSTATE = 8, - D3DDP2OP_LINELIST = 15, - D3DDP2OP_LINESTRIP = 16, - D3DDP2OP_INDEXEDLINESTRIP = 17, - D3DDP2OP_TRIANGLELIST = 18, - D3DDP2OP_TRIANGLESTRIP = 19, - D3DDP2OP_INDEXEDTRIANGLESTRIP = 20, - D3DDP2OP_TRIANGLEFAN = 21, - D3DDP2OP_INDEXEDTRIANGLEFAN = 22, - D3DDP2OP_TRIANGLEFAN_IMM = 23, - D3DDP2OP_LINELIST_IMM = 24, - D3DDP2OP_TEXTURESTAGESTATE = 25, // Has edge flags and called from Execute - D3DDP2OP_INDEXEDTRIANGLELIST2 = 26, - D3DDP2OP_INDEXEDLINELIST2 = 27, - D3DDP2OP_VIEWPORTINFO = 28, - D3DDP2OP_WINFO = 29, -// two below are for pre-DX7 interface apps running DX7 driver - D3DDP2OP_SETPALETTE = 30, - D3DDP2OP_UPDATEPALETTE = 31, -#if(DIRECT3D_VERSION >= 0x0700) - // New for DX7 - D3DDP2OP_ZRANGE = 32, - D3DDP2OP_SETMATERIAL = 33, - D3DDP2OP_SETLIGHT = 34, - D3DDP2OP_CREATELIGHT = 35, - D3DDP2OP_SETTRANSFORM = 36, - D3DDP2OP_TEXBLT = 38, - D3DDP2OP_STATESET = 39, - D3DDP2OP_SETPRIORITY = 40, -#endif /* DIRECT3D_VERSION >= 0x0700 */ - D3DDP2OP_SETRENDERTARGET = 41, - D3DDP2OP_CLEAR = 42, -#if(DIRECT3D_VERSION >= 0x0700) - D3DDP2OP_SETTEXLOD = 43, - D3DDP2OP_SETCLIPPLANE = 44, -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0800) - D3DDP2OP_CREATEVERTEXSHADER = 45, - D3DDP2OP_DELETEVERTEXSHADER = 46, - D3DDP2OP_SETVERTEXSHADER = 47, - D3DDP2OP_SETVERTEXSHADERCONST = 48, - D3DDP2OP_SETSTREAMSOURCE = 49, - D3DDP2OP_SETSTREAMSOURCEUM = 50, - D3DDP2OP_SETINDICES = 51, - D3DDP2OP_DRAWPRIMITIVE = 52, - D3DDP2OP_DRAWINDEXEDPRIMITIVE = 53, - D3DDP2OP_CREATEPIXELSHADER = 54, - D3DDP2OP_DELETEPIXELSHADER = 55, - D3DDP2OP_SETPIXELSHADER = 56, - D3DDP2OP_SETPIXELSHADERCONST = 57, - D3DDP2OP_CLIPPEDTRIANGLEFAN = 58, - D3DDP2OP_DRAWPRIMITIVE2 = 59, - D3DDP2OP_DRAWINDEXEDPRIMITIVE2= 60, - D3DDP2OP_DRAWRECTPATCH = 61, - D3DDP2OP_DRAWTRIPATCH = 62, - D3DDP2OP_VOLUMEBLT = 63, - D3DDP2OP_BUFFERBLT = 64, - D3DDP2OP_MULTIPLYTRANSFORM = 65, - D3DDP2OP_ADDDIRTYRECT = 66, - D3DDP2OP_ADDDIRTYBOX = 67, -#endif /* DIRECT3D_VERSION >= 0x0800 */ -#if(DIRECT3D_VERSION >= 0x0900) - D3DDP2OP_CREATEVERTEXSHADERDECL = 71, - D3DDP2OP_DELETEVERTEXSHADERDECL = 72, - D3DDP2OP_SETVERTEXSHADERDECL = 73, - D3DDP2OP_CREATEVERTEXSHADERFUNC = 74, - D3DDP2OP_DELETEVERTEXSHADERFUNC = 75, - D3DDP2OP_SETVERTEXSHADERFUNC = 76, - D3DDP2OP_SETVERTEXSHADERCONSTI = 77, - D3DDP2OP_SETSCISSORRECT = 79, - D3DDP2OP_SETSTREAMSOURCE2 = 80, - D3DDP2OP_BLT = 81, - D3DDP2OP_COLORFILL = 82, - D3DDP2OP_SETVERTEXSHADERCONSTB = 83, - D3DDP2OP_CREATEQUERY = 84, - D3DDP2OP_SETRENDERTARGET2 = 85, - D3DDP2OP_SETDEPTHSTENCIL = 86, - D3DDP2OP_RESPONSECONTINUE = 87, /* Can come only from driver */ - D3DDP2OP_RESPONSEQUERY = 88, /* Can come only from driver */ - D3DDP2OP_GENERATEMIPSUBLEVELS = 89, - D3DDP2OP_DELETEQUERY = 90, - D3DDP2OP_ISSUEQUERY = 91, - D3DDP2OP_SETPIXELSHADERCONSTI = 93, - D3DDP2OP_SETPIXELSHADERCONSTB = 94, - D3DDP2OP_SETSTREAMSOURCEFREQ = 95, - D3DDP2OP_SURFACEBLT = 96, - D3DDP2OP_SETCONVOLUTIONKERNELMONO = 97, - D3DDP2OP_COMPOSERECTS = 98, -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -} D3DHAL_DP2OPERATION; - -// -// DrawPrimitives2 point primitives -// - -typedef struct _D3DHAL_DP2POINTS -{ - WORD wCount; - WORD wVStart; -} D3DHAL_DP2POINTS, *LPD3DHAL_DP2POINTS; - -// -// DrawPrimitives2 line primitives -// - -typedef struct _D3DHAL_DP2STARTVERTEX -{ - WORD wVStart; -} D3DHAL_DP2STARTVERTEX, *LPD3DHAL_DP2STARTVERTEX; - -typedef struct _D3DHAL_DP2LINELIST -{ - WORD wVStart; -} D3DHAL_DP2LINELIST, *LPD3DHAL_DP2LINELIST; - -typedef struct _D3DHAL_DP2INDEXEDLINELIST -{ - WORD wV1; - WORD wV2; -} D3DHAL_DP2INDEXEDLINELIST, *LPD3DHAL_DP2INDEXEDLINELIST; - -typedef struct _D3DHAL_DP2LINESTRIP -{ - WORD wVStart; -} D3DHAL_DP2LINESTRIP, *LPD3DHAL_DP2LINESTRIP; - -typedef struct _D3DHAL_DP2INDEXEDLINESTRIP -{ - WORD wV[2]; -} D3DHAL_DP2INDEXEDLINESTRIP, *LPD3DHAL_DP2INDEXEDLINESTRIP; - -// -// DrawPrimitives2 triangle primitives -// - -typedef struct _D3DHAL_DP2TRIANGLELIST -{ - WORD wVStart; -} D3DHAL_DP2TRIANGLELIST, *LPD3DHAL_DP2TRIANGLELIST; - -typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST -{ - WORD wV1; - WORD wV2; - WORD wV3; - WORD wFlags; -} D3DHAL_DP2INDEXEDTRIANGLELIST, *LPD3DHAL_DP2INDEXEDTRIANGLELIST; - -typedef struct _D3DHAL_DP2INDEXEDTRIANGLELIST2 -{ - WORD wV1; - WORD wV2; - WORD wV3; -} D3DHAL_DP2INDEXEDTRIANGLELIST2, *LPD3DHAL_DP2INDEXEDTRIANGLELIST2; - -typedef struct _D3DHAL_DP2TRIANGLESTRIP -{ - WORD wVStart; -} D3DHAL_DP2TRIANGLESTRIP, *LPD3DHAL_DP2TRIANGLESTRIP; - -typedef struct _D3DHAL_DP2INDEXEDTRIANGLESTRIP -{ - WORD wV[3]; -} D3DHAL_DP2INDEXEDTRIANGLESTRIP, *LPD3DHAL_DP2INDEXEDTRIANGLESTRIP; - -typedef struct _D3DHAL_DP2TRIANGLEFAN -{ - WORD wVStart; -} D3DHAL_DP2TRIANGLEFAN, *LPD3DHAL_DP2TRIANGLEFAN; - -typedef struct _D3DHAL_DP2INDEXEDTRIANGLEFAN -{ - WORD wV[3]; -} D3DHAL_DP2INDEXEDTRIANGLEFAN, *LPD3DHAL_DP2INDEXEDTRIANGLEFAN; - -typedef struct _D3DHAL_DP2TRIANGLEFAN_IMM -{ - DWORD dwEdgeFlags; -} D3DHAL_DP2TRIANGLEFAN_IMM; - -typedef D3DHAL_DP2TRIANGLEFAN_IMM *LPD3DHAL_DP2TRIANGLEFAN_IMM; - -// -// DrawPrimitives2 Renderstate changes -// - -typedef struct _D3DHAL_DP2RENDERSTATE -{ - D3DRENDERSTATETYPE RenderState; - union - { - D3DVALUE dvState; - DWORD dwState; - }; -} D3DHAL_DP2RENDERSTATE; -typedef D3DHAL_DP2RENDERSTATE * LPD3DHAL_DP2RENDERSTATE; - -typedef struct _D3DHAL_DP2TEXTURESTAGESTATE -{ - WORD wStage; - WORD TSState; - DWORD dwValue; -} D3DHAL_DP2TEXTURESTAGESTATE; -typedef D3DHAL_DP2TEXTURESTAGESTATE *LPD3DHAL_DP2TEXTURESTAGESTATE; - -typedef struct _D3DHAL_DP2VIEWPORTINFO -{ - DWORD dwX; - DWORD dwY; - DWORD dwWidth; - DWORD dwHeight; -} D3DHAL_DP2VIEWPORTINFO; -typedef D3DHAL_DP2VIEWPORTINFO *LPD3DHAL_DP2VIEWPORTINFO; - -typedef struct _D3DHAL_DP2WINFO -{ - D3DVALUE dvWNear; - D3DVALUE dvWFar; -} D3DHAL_DP2WINFO; -typedef D3DHAL_DP2WINFO *LPD3DHAL_DP2WINFO; - -typedef struct _D3DHAL_DP2SETPALETTE -{ - DWORD dwPaletteHandle; - DWORD dwPaletteFlags; - DWORD dwSurfaceHandle; -} D3DHAL_DP2SETPALETTE; -typedef D3DHAL_DP2SETPALETTE *LPD3DHAL_DP2SETPALETTE; - -typedef struct _D3DHAL_DP2UPDATEPALETTE -{ - DWORD dwPaletteHandle; - WORD wStartIndex; - WORD wNumEntries; -} D3DHAL_DP2UPDATEPALETTE; -typedef D3DHAL_DP2UPDATEPALETTE *LPD3DHAL_DP2UPDATEPALETTE; - -typedef struct _D3DHAL_DP2SETRENDERTARGET -{ - DWORD hRenderTarget; - DWORD hZBuffer; -} D3DHAL_DP2SETRENDERTARGET; -typedef D3DHAL_DP2SETRENDERTARGET *LPD3DHAL_DP2SETRENDERTARGET; - -#if(DIRECT3D_VERSION >= 0x0700) -// Values for dwOperations in the D3DHAL_DP2STATESET -#define D3DHAL_STATESETBEGIN 0 -#define D3DHAL_STATESETEND 1 -#define D3DHAL_STATESETDELETE 2 -#define D3DHAL_STATESETEXECUTE 3 -#define D3DHAL_STATESETCAPTURE 4 -#endif /* DIRECT3D_VERSION >= 0x0700 */ -#if(DIRECT3D_VERSION >= 0x0800) -#define D3DHAL_STATESETCREATE 5 -#endif /* DIRECT3D_VERSION >= 0x0800 */ -#if(DIRECT3D_VERSION >= 0x0700) - -typedef struct _D3DHAL_DP2STATESET -{ - DWORD dwOperation; - DWORD dwParam; // State set handle passed with D3DHAL_STATESETBEGIN, - // D3DHAL_STATESETEXECUTE, D3DHAL_STATESETDELETE - // D3DHAL_STATESETCAPTURE - D3DSTATEBLOCKTYPE sbType; // Type use with D3DHAL_STATESETBEGIN/END -} D3DHAL_DP2STATESET; -typedef D3DHAL_DP2STATESET *LPD3DHAL_DP2STATESET; -// -// T&L Hal specific stuff -// -typedef struct _D3DHAL_DP2ZRANGE -{ - D3DVALUE dvMinZ; - D3DVALUE dvMaxZ; -} D3DHAL_DP2ZRANGE; -typedef D3DHAL_DP2ZRANGE *LPD3DHAL_DP2ZRANGE; - -typedef D3DMATERIAL7 D3DHAL_DP2SETMATERIAL, *LPD3DHAL_DP2SETMATERIAL; - -// Values for dwDataType in D3DHAL_DP2SETLIGHT -#define D3DHAL_SETLIGHT_ENABLE 0 -#define D3DHAL_SETLIGHT_DISABLE 1 -// If this is set, light data will be passed in after the -// D3DLIGHT7 structure -#define D3DHAL_SETLIGHT_DATA 2 - -typedef struct _D3DHAL_DP2SETLIGHT -{ - DWORD dwIndex; - DWORD dwDataType; -} D3DHAL_DP2SETLIGHT; -typedef D3DHAL_DP2SETLIGHT *LPD3DHAL_DP2SETLIGHT; - -typedef struct _D3DHAL_DP2SETCLIPPLANE -{ - DWORD dwIndex; - D3DVALUE plane[4]; -} D3DHAL_DP2SETCLIPPLANE; -typedef D3DHAL_DP2SETCLIPPLANE *LPD3DHAL_DP2SETCLIPPLANE; - -typedef struct _D3DHAL_DP2CREATELIGHT -{ - DWORD dwIndex; -} D3DHAL_DP2CREATELIGHT; -typedef D3DHAL_DP2CREATELIGHT *LPD3DHAL_DP2CREATELIGHT; - -typedef struct _D3DHAL_DP2SETTRANSFORM -{ - D3DTRANSFORMSTATETYPE xfrmType; - D3DMATRIX matrix; -} D3DHAL_DP2SETTRANSFORM; -typedef D3DHAL_DP2SETTRANSFORM *LPD3DHAL_DP2SETTRANSFORM; - -typedef struct _D3DHAL_DP2MULTIPLYTRANSFORM -{ - D3DTRANSFORMSTATETYPE xfrmType; - D3DMATRIX matrix; -} D3DHAL_DP2MULTIPLYTRANSFORM; -typedef D3DHAL_DP2MULTIPLYTRANSFORM *LPD3DHAL_DP2MULTIPLYTRANSFORM; - -typedef struct _D3DHAL_DP2EXT -{ - DWORD dwExtToken; - DWORD dwSize; -} D3DHAL_DP2EXT; -typedef D3DHAL_DP2EXT *LPD3DHAL_DP2EXT; - -typedef struct _D3DHAL_DP2TEXBLT -{ - DWORD dwDDDestSurface;// dest surface - DWORD dwDDSrcSurface; // src surface - POINT pDest; - RECTL rSrc; // src rect - DWORD dwFlags; // blt flags -} D3DHAL_DP2TEXBLT; -typedef D3DHAL_DP2TEXBLT *LPD3DHAL_DP2TEXBLT; - -typedef struct _D3DHAL_DP2SETPRIORITY -{ - DWORD dwDDSurface; - DWORD dwPriority; -} D3DHAL_DP2SETPRIORITY; -typedef D3DHAL_DP2SETPRIORITY *LPD3DHAL_DP2SETPRIORITY; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -typedef struct _D3DHAL_DP2CLEAR -{ - // dwFlags can contain D3DCLEAR_TARGET, D3DCLEAR_ZBUFFER, and/or D3DCLEAR_STENCIL - DWORD dwFlags; // in: surfaces to clear - DWORD dwFillColor; // in: Color value for rtarget - D3DVALUE dvFillDepth; // in: Depth value for Z buffer (0.0-1.0) - DWORD dwFillStencil; // in: value used to clear stencil buffer - RECT Rects[1]; // in: Rectangles to clear -} D3DHAL_DP2CLEAR; -typedef D3DHAL_DP2CLEAR *LPD3DHAL_DP2CLEAR; - - -#if(DIRECT3D_VERSION >= 0x0700) -typedef struct _D3DHAL_DP2SETTEXLOD -{ - DWORD dwDDSurface; - DWORD dwLOD; -} D3DHAL_DP2SETTEXLOD; -typedef D3DHAL_DP2SETTEXLOD *LPD3DHAL_DP2SETTEXLOD; -#endif /* DIRECT3D_VERSION >= 0x0700 */ - -#if(DIRECT3D_VERSION >= 0x0800) - -// Used by SetVertexShader, DeleteVertexShader -// SetVertexShaderDecl, DeleteVertexShaderDecl, -// SetVertexShaderFunc, DeleteVertexShaderFunc -typedef struct _D3DHAL_DP2VERTEXSHADER -{ - // Vertex shader handle. - // The handle could be 0, meaning that the current vertex shader is invalid - // (not set). When driver recieves handle 0, it should invalidate all - // streams pointer -#endif /* DIRECT3D_VERSION >= 0x0800 */ -#if(DIRECT3D_VERSION >= 0x0900) - // When SetVertexShaderDecl is used, the dwHandle could be a legacy FVF - // handle or a DX9 declaration handle. Bit 0 is set for DX9 declaration. - // - // When SetVertexShaderFunc is used and dwHandle is zero, this means fixed - // function pipeline -#endif /* DIRECT3D_VERSION >= 0x0900 */ -#if(DIRECT3D_VERSION >= 0x0800) - DWORD dwHandle; -} D3DHAL_DP2VERTEXSHADER; -typedef D3DHAL_DP2VERTEXSHADER *LPD3DHAL_DP2VERTEXSHADER; - -typedef struct _D3DHAL_DP2CREATEVERTEXSHADER -{ - DWORD dwHandle; // Shader handle - DWORD dwDeclSize; // Shader declaration size in bytes - DWORD dwCodeSize; // Shader code size in bytes - // Declaration follows - // Shader code follows -} D3DHAL_DP2CREATEVERTEXSHADER; -typedef D3DHAL_DP2CREATEVERTEXSHADER *LPD3DHAL_DP2CREATEVERTEXSHADER; - -// Used with all types of vertex shader constants -typedef struct _D3DHAL_DP2SETVERTEXSHADERCONST -{ - DWORD dwRegister; // Const register to start copying - DWORD dwCount; // Number of 4-float vectors to copy for D3DDP2OP_SETVERTEXSHADERCONST - // Number of 4-integer vectors to copy for D3DDP2OP_SETVERTEXSHADERCONSTI - // Number of BOOL values to copy for D3DDP2OP_SETVERTEXSHADERCONSTB - // Data follows -} D3DHAL_DP2SETVERTEXSHADERCONST; -typedef D3DHAL_DP2SETVERTEXSHADERCONST *LPD3DHAL_DP2SETVERTEXSHADERCONST; - -typedef struct _D3DHAL_DP2SETSTREAMSOURCE -{ - DWORD dwStream; // Stream index, starting from zero - DWORD dwVBHandle; // Vertex buffer handle - DWORD dwStride; // Vertex size in bytes -} D3DHAL_DP2SETSTREAMSOURCE; -typedef D3DHAL_DP2SETSTREAMSOURCE *LPD3DHAL_DP2SETSTREAMSOURCE; - -typedef struct _D3DHAL_DP2SETSTREAMSOURCEUM -{ - DWORD dwStream; // Stream index, starting from zero - DWORD dwStride; // Vertex size in bytes -} D3DHAL_DP2SETSTREAMSOURCEUM; -typedef D3DHAL_DP2SETSTREAMSOURCEUM *LPD3DHAL_DP2SETSTREAMSOURCEUM; - -typedef struct _D3DHAL_DP2SETINDICES -{ - DWORD dwVBHandle; // Index buffer handle - DWORD dwStride; // Index size in bytes (2 or 4) -} D3DHAL_DP2SETINDICES; -typedef D3DHAL_DP2SETINDICES *LPD3DHAL_DP2SETINDICES; - -typedef struct _D3DHAL_DP2DRAWPRIMITIVE -{ - D3DPRIMITIVETYPE primType; - DWORD VStart; - DWORD PrimitiveCount; -} D3DHAL_DP2DRAWPRIMITIVE; -typedef D3DHAL_DP2DRAWPRIMITIVE *LPD3DHAL_DP2DRAWPRIMITIVE; - -typedef struct _D3DHAL_DP2DRAWINDEXEDPRIMITIVE -{ - D3DPRIMITIVETYPE primType; - INT BaseVertexIndex; // Vertex which corresponds to index 0 - DWORD MinIndex; // Min vertex index in the vertex buffer - DWORD NumVertices; // Number of vertices starting from MinIndex - DWORD StartIndex; // Start index in the index buffer - DWORD PrimitiveCount; -} D3DHAL_DP2DRAWINDEXEDPRIMITIVE; -typedef D3DHAL_DP2DRAWINDEXEDPRIMITIVE *LPD3DHAL_DP2DRAWINDEXEDPRIMITIVE; - -typedef struct _D3DHAL_CLIPPEDTRIANGLEFAN -{ - DWORD FirstVertexOffset; // Offset in bytes in the current stream 0 - DWORD dwEdgeFlags; - DWORD PrimitiveCount; -} D3DHAL_CLIPPEDTRIANGLEFAN; -typedef D3DHAL_CLIPPEDTRIANGLEFAN *LPD3DHAL_CLIPPEDTRIANGLEFAN; - -typedef struct _D3DHAL_DP2DRAWPRIMITIVE2 -{ - D3DPRIMITIVETYPE primType; - DWORD FirstVertexOffset; // Offset in bytes in the stream 0 - DWORD PrimitiveCount; -} D3DHAL_DP2DRAWPRIMITIVE2; -typedef D3DHAL_DP2DRAWPRIMITIVE2 *LPD3DHAL_DP2DRAWPRIMITIVE2; - -typedef struct _D3DHAL_DP2DRAWINDEXEDPRIMITIVE2 -{ - D3DPRIMITIVETYPE primType; - INT BaseVertexOffset; // Stream 0 offset of the vertex which - // corresponds to index 0. This offset could be - // negative, but when an index is added to the - // offset the result is positive - DWORD MinIndex; // Min vertex index in the vertex buffer - DWORD NumVertices; // Number of vertices starting from MinIndex - DWORD StartIndexOffset; // Offset of the start index in the index buffer - DWORD PrimitiveCount; // Number of triangles (points, lines) -} D3DHAL_DP2DRAWINDEXEDPRIMITIVE2; -typedef D3DHAL_DP2DRAWINDEXEDPRIMITIVE2 *LPD3DHAL_DP2DRAWINDEXEDPRIMITIVE2; - -// Used by SetPixelShader and DeletePixelShader -typedef struct _D3DHAL_DP2PIXELSHADER -{ - // Pixel shader handle. - // The handle could be 0, meaning that the current pixel shader is invalid - // (not set). - DWORD dwHandle; -} D3DHAL_DP2PIXELSHADER; -typedef D3DHAL_DP2PIXELSHADER *LPD3DHAL_DP2PIXELSHADER; - -typedef struct _D3DHAL_DP2CREATEPIXELSHADER -{ - DWORD dwHandle; // Shader handle - DWORD dwCodeSize; // Shader code size in bytes - // Shader code follows -} D3DHAL_DP2CREATEPIXELSHADER; -typedef D3DHAL_DP2CREATEPIXELSHADER *LPD3DHAL_DP2CREATEPIXELSHADER; - -typedef struct _D3DHAL_DP2SETPIXELSHADERCONST -{ - DWORD dwRegister; // Const register to start copying - DWORD dwCount; // Number of 4-float vectors to copy for D3DDP2OP_SETPIXELSHADERCONST - // Number of 4-integer vectors to copy for D3DDP2OP_SETPIXELSHADERCONSTI - // Number of BOOL values to copy for D3DDP2OP_SETPIXELSHADERCONSTB - // Data follows -} D3DHAL_DP2SETPIXELSHADERCONST; -typedef D3DHAL_DP2SETPIXELSHADERCONST *LPD3DHAL_DP2SETPIXELSHADERCONST; - -// Flags that can be supplied to DRAWRECTPATCH and DRAWTRIPATCH -#define RTPATCHFLAG_HASSEGS 0x00000001L -#define RTPATCHFLAG_HASINFO 0x00000002L - -typedef struct _D3DHAL_DP2DRAWRECTPATCH -{ - DWORD Handle; - DWORD Flags; - // Optionally followed by D3DFLOAT[4] NumSegments and/or D3DRECTPATCH_INFO -} D3DHAL_DP2DRAWRECTPATCH; -typedef D3DHAL_DP2DRAWRECTPATCH *LPD3DHAL_DP2DRAWRECTPATCH; - -typedef struct _D3DHAL_DP2DRAWTRIPATCH -{ - DWORD Handle; - DWORD Flags; - // Optionally followed by D3DFLOAT[3] NumSegments and/or D3DTRIPATCH_INFO -} D3DHAL_DP2DRAWTRIPATCH; -typedef D3DHAL_DP2DRAWTRIPATCH *LPD3DHAL_DP2DRAWTRIPATCH; - -typedef struct _D3DHAL_DP2VOLUMEBLT -{ - DWORD dwDDDestSurface;// dest surface - DWORD dwDDSrcSurface; // src surface - DWORD dwDestX; // dest X (width) - DWORD dwDestY; // dest Y (height) - DWORD dwDestZ; // dest Z (depth) - D3DBOX srcBox; // src box - DWORD dwFlags; // blt flags -} D3DHAL_DP2VOLUMEBLT; -typedef D3DHAL_DP2VOLUMEBLT *LPD3DHAL_DP2VOLUMEBLT; - -typedef struct _D3DHAL_DP2BUFFERBLT -{ - DWORD dwDDDestSurface; // dest surface - DWORD dwDDSrcSurface; // src surface - DWORD dwOffset; // Offset in the dest surface (in BYTES) - D3DRANGE rSrc; // src range - DWORD dwFlags; // blt flags -} D3DHAL_DP2BUFFERBLT; -typedef D3DHAL_DP2BUFFERBLT *LPD3DHAL_DP2BUFFERBLT; - -typedef struct _D3DHAL_DP2ADDDIRTYRECT -{ - DWORD dwSurface; // Driver managed surface - RECTL rDirtyArea; // Area marked dirty -} D3DHAL_DP2ADDDIRTYRECT; -typedef D3DHAL_DP2ADDDIRTYRECT *LPD3DHAL_DP2ADDDIRTYRECT; - -typedef struct _D3DHAL_DP2ADDDIRTYBOX -{ - DWORD dwSurface; // Driver managed volume - D3DBOX DirtyBox; // Box marked dirty -} D3DHAL_DP2ADDDIRTYBOX; -typedef D3DHAL_DP2ADDDIRTYBOX *LPD3DHAL_DP2ADDDIRTYBOX; - -#endif /* DIRECT3D_VERSION >= 0x0800 */ - -#if(DIRECT3D_VERSION >= 0x0900) - -typedef struct _D3DHAL_DP2CREATEVERTEXSHADERDECL -{ - DWORD dwHandle; // Shader function handle - DWORD dwNumVertexElements; // Number of vertex elements - // D3DVERTEXELEMENT9 VertexElements[]; Vertex elements follow -} D3DHAL_DP2CREATEVERTEXSHADERDECL ; -typedef D3DHAL_DP2CREATEVERTEXSHADERDECL *LPD3DHAL_DP2CREATEVERTEXSHADERDECL; - -typedef struct _D3DHAL_DP2CREATEVERTEXSHADERFUNC -{ - DWORD dwHandle; // Shader function handle - DWORD dwSize; // Shader function size in bytes - // Shader declaration follows -} D3DHAL_DP2CREATEVERTEXSHADERFUNC ; -typedef D3DHAL_DP2CREATEVERTEXSHADERFUNC *LPD3DHAL_DP2CREATEVERTEXSHADERFUNC; - -typedef struct _D3DHAL_DP2SETSTREAMSOURCE2 -{ - DWORD dwStream; // Stream index, starting from zero - DWORD dwVBHandle; // Vertex buffer handle - DWORD dwOffset; // Offset of the first vertex size in bytes - DWORD dwStride; // Vertex size in bytes -} D3DHAL_DP2SETSTREAMSOURCE2; -typedef D3DHAL_DP2SETSTREAMSOURCE2 *LPD3DHAL_DP2SETSTREAMSOURCE2; - -typedef struct _D3DHAL_DP2SETSTREAMSOURCEFREQ -{ - DWORD dwStream; // Stream index, starting from zero - DWORD dwDivider; // Stream source divider -} D3DHAL_DP2SETSTREAMSOURCEFREQ; -typedef D3DHAL_DP2SETSTREAMSOURCEFREQ *LPD3DHAL_DP2SETSTREAMSOURCEFREQ; - -#define D3DHAL_ROW_WEIGHTS 1 -#define D3DHAL_COL_WEIGHTS 2 -typedef struct _D3DHAL_DP2SETCONVOLUTIONKERNELMONO -{ - DWORD dwWidth; // Kernel width - DWORD dwHeight; // Kernel height - DWORD dwFlags; - // If dwFlags & D3DHAL_ROW_WEIGHTS, then width floats follow. Otherwise row weights are 1.0. - // If dwFlags & D3DHAL_COL_WEIGHTS, then height floats follow. Otherwise column weights are 1.0. -} D3DHAL_DP2SETCONVOLUTIONKERNELMONO; -typedef D3DHAL_DP2SETCONVOLUTIONKERNELMONO *LPD3DHAL_DP2SETCONVOLUTIONKERNELMONO; - -typedef struct _D3DHAL_DP2COMPOSERECTS -{ - DWORD SrcSurfaceHandle; - DWORD DstSurfaceHandle; - DWORD SrcRectDescsVBHandle; - UINT NumRects; - DWORD DstRectDescsVBHandle; - D3DCOMPOSERECTSOP Operation; - INT XOffset; - INT YOffset; -} D3DHAL_DP2COMPOSERECTS; -typedef D3DHAL_DP2COMPOSERECTS *LPD3DHAL_DP2COMPOSERECTS; - -typedef RECT D3DHAL_DP2SETSCISSORRECT; -typedef D3DHAL_DP2SETSCISSORRECT *LPD3DHAL_DP2SETSCISSORRECT; - -typedef struct _D3DHAL_DP2BLT -{ - DWORD dwSource; // Source surface - RECTL rSource; // Source rectangle - DWORD dwSourceMipLevel; // Miplevel of lightweight surface - DWORD dwDest; // Dest surface - RECTL rDest; // Dest rectangle - DWORD dwDestMipLevel; // Miplevel of lightweight surface - DWORD Flags; // Can be DP2BLT_POINT, DP2BLT_LINEAR -} D3DHAL_DP2BLT; -typedef D3DHAL_DP2BLT *LPD3DHAL_DP2BLT; - -#define DP2BLT_POINT 0x00000001L -#define DP2BLT_LINEAR 0x00000002L - -typedef struct _D3DHAL_DP2COLORFILL -{ - DWORD dwSurface; // Surface getting filled - RECTL rRect; // Surface dimensions to fill - D3DCOLOR Color; // A8R8G8B8 fill color -} D3DHAL_DP2COLORFILL; -typedef D3DHAL_DP2COLORFILL *LPD3DHAL_DP2COLORFILL; - -typedef struct _D3DHAL_DP2SURFACEBLT -{ - DWORD dwSource; // Source surface - RECTL rSource; // Source rectangle - DWORD dwSourceMipLevel; // Miplevel of lightweight surface - DWORD dwDest; // Dest surface - RECTL rDest; // Dest rectangle - DWORD dwDestMipLevel; // Miplevel of lightweight surface - DWORD Flags; // No flags currently defined -} D3DHAL_DP2SURFACEBLT; -typedef D3DHAL_DP2SURFACEBLT *LPD3DHAL_DP2SURFACEBLT; - -typedef D3DHAL_DP2SETVERTEXSHADERCONST D3DHAL_DP2SETVERTEXSHADERCONSTI; -typedef D3DHAL_DP2SETVERTEXSHADERCONST *LPD3DHAL_DP2SETVERTEXSHADERCONSTI; -typedef D3DHAL_DP2SETVERTEXSHADERCONST D3DHAL_DP2SETVERTEXSHADERCONSTB; -typedef D3DHAL_DP2SETVERTEXSHADERCONSTB *LPD3DHAL_DP2SETVERTEXSHADERCONSTB; - -typedef D3DHAL_DP2SETPIXELSHADERCONST D3DHAL_DP2SETPIXELSHADERCONSTI; -typedef D3DHAL_DP2SETPIXELSHADERCONST *LPD3DHAL_DP2SETPIXELSHADERCONSTI; -typedef D3DHAL_DP2SETPIXELSHADERCONST D3DHAL_DP2SETPIXELSHADERCONSTB; -typedef D3DHAL_DP2SETPIXELSHADERCONSTB *LPD3DHAL_DP2SETPIXELSHADERCONSTB; - -typedef struct _D3DHAL_DP2CREATEQUERY -{ - DWORD dwQueryID; - D3DQUERYTYPE QueryType; -} D3DHAL_DP2CREATEQUERY; -typedef D3DHAL_DP2CREATEQUERY *LPD3DHAL_DP2CREATEQUERY; - -typedef struct _D3DHAL_DP2DELETEQUERY -{ - DWORD dwQueryID; -} D3DHAL_DP2DELETEQUERY; -typedef D3DHAL_DP2DELETEQUERY *LPD3DHAL_DP2DELETEQUERY; - -typedef struct _D3DHAL_DP2ISSUEQUERY -{ - DWORD dwQueryID; - DWORD dwFlags; -} D3DHAL_DP2ISSUEQUERY; -typedef D3DHAL_DP2ISSUEQUERY *LPD3DHAL_DP2ISSUEQUERY; - -typedef struct _D3DHAL_DP2SETRENDERTARGET2 -{ - DWORD RTIndex; - DWORD hRenderTarget; -} D3DHAL_DP2SETRENDERTARGET2; -typedef D3DHAL_DP2SETRENDERTARGET2 *LPD3DHAL_DP2SETRENDERTARGET2; - -typedef struct _D3DHAL_DP2SETDEPTHSTENCIL -{ - DWORD hZBuffer; -} D3DHAL_DP2SETDEPTHSTENCIL; -typedef D3DHAL_DP2SETDEPTHSTENCIL *LPD3DHAL_DP2SETDEPTHSTENCIL; - -typedef struct _D3DHAL_DP2GENERATEMIPSUBLEVELS -{ - DWORD hSurface; - D3DTEXTUREFILTERTYPE Filter; -} D3DHAL_DP2GENERATEMIPSUBLEVELS; -typedef D3DHAL_DP2GENERATEMIPSUBLEVELS *LPD3DHAL_DP2GENERATEMIPSUBLEVELS; - -// -// Command structure for driver responses: -// - -typedef struct _D3DHAL_DP2RESPONSE -{ - BYTE bCommand; /* response/ command id */ - BYTE bReserved; - WORD wStateCount; /* count of responses to follow */ - DWORD dwTotalSize; /* total size of response (including the DP2REPONSE struct) to enable skipping over. */ -} D3DHAL_DP2RESPONSE, *LPD3DHAL_DP2RESPONSE; - -/* Begin Responses */ -typedef struct _D3DHAL_DP2RESPONSEQUERY -{ - DWORD dwQueryID; - DWORD dwSize; -} D3DHAL_DP2RESPONSEQUERY; -typedef D3DHAL_DP2RESPONSEQUERY *LPD3DHAL_DP2RESPONSEQUERY; -/* End Responses */ - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -typedef struct _D3DHAL_DRAWPRIMITIVES2DATA { - ULONG_PTR dwhContext; // in: Context handle - DWORD dwFlags; // in: flags - DWORD dwVertexType; // in: vertex type - LPDDRAWI_DDRAWSURFACE_LCL lpDDCommands; // in: vertex buffer command data - DWORD dwCommandOffset; // in: offset to start of vertex buffer commands - DWORD dwCommandLength; // in: number of bytes of command data - union - { // based on D3DHALDP2_USERMEMVERTICES flag - LPDDRAWI_DDRAWSURFACE_LCL lpDDVertex;// in: surface containing vertex data - LPVOID lpVertices; // in: User mode pointer to vertices - }; - DWORD dwVertexOffset; // in: offset to start of vertex data - DWORD dwVertexLength; // in: number of vertices of vertex data - DWORD dwReqVertexBufSize; // in: number of bytes required for the next vertex buffer - DWORD dwReqCommandBufSize; // in: number of bytes required for the next commnand buffer - LPDWORD lpdwRStates; // in: Pointer to the array where render states are updated - union - { - DWORD dwVertexSize; // in: Size of each vertex in bytes - HRESULT ddrval; // out: return value - }; - DWORD dwErrorOffset; // out: offset in lpDDCommands to - // first D3DHAL_COMMAND not handled -} D3DHAL_DRAWPRIMITIVES2DATA; -typedef D3DHAL_DRAWPRIMITIVES2DATA *LPD3DHAL_DRAWPRIMITIVES2DATA; - -// Macros to access shader binary code -#define D3DSI_GETREGNUM(token) (token & D3DSP_REGNUM_MASK) -#define D3DSI_GETOPCODE(command) (command & D3DSI_OPCODE_MASK) -#define D3DSI_GETWRITEMASK(token) (token & D3DSP_WRITEMASK_ALL) -#define D3DVS_GETSWIZZLECOMP(source, component) (source >> ((component << 1) + 16) & 0x3) -#define D3DVS_GETSWIZZLE(token) (token & D3DVS_SWIZZLE_MASK) -#define D3DVS_GETSRCMODIFIER(token) (token & D3DSP_SRCMOD_MASK) -#define D3DVS_GETADDRESSMODE(token) (token & D3DVS_ADDRESSMODE_MASK) - -#if(DIRECT3D_VERSION < 0x0900) - -#define D3DSI_GETREGTYPE(token) ((D3DSHADER_PARAM_REGISTER_TYPE)(token & D3DSP_REGTYPE_MASK)) - -#else - -#define D3DSI_GETREGTYPE(token) ((D3DSHADER_PARAM_REGISTER_TYPE)(((token & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT) | \ - ((token & D3DSP_REGTYPE_MASK2) >> D3DSP_REGTYPE_SHIFT2))) -#define D3DSI_GETUSAGE(token) ((token & D3DSP_DCL_USAGE_MASK) >> D3DSP_DCL_USAGE_SHIFT) -#define D3DSI_GETUSAGEINDEX(token) ((token & D3DSP_DCL_USAGEINDEX_MASK) >> D3DSP_DCL_USAGEINDEX_SHIFT) -#define D3DSI_GETINSTLENGTH(token) ((token & D3DSI_INSTLENGTH_MASK) >> D3DSI_INSTLENGTH_SHIFT) -#define D3DSI_GETCOMPARISON(token) ((D3DSHADER_COMPARISON)((token & D3DSHADER_COMPARISON_MASK) >> D3DSHADER_COMPARISON_SHIFT)) -#define D3DSI_GETREGISTERPROPERTIES(token) (token & D3DSP_REGISTERPROPERTIES_MASK) -#define D3DSI_GETTEXTURETYPE(token) (token & D3DSP_TEXTURETYPE_MASK) -#define D3DSI_GETDSTMODIFIER(token) (token & D3DSP_DSTMOD_MASK) -#define D3DSI_GETSWIZZLECOMP(source, component) (source >> ((component << 1) + 16) & 0x3) -#define D3DSI_GETSWIZZLE(token) (token & D3DVS_SWIZZLE_MASK) -#define D3DSI_GETSRCMODIFIER(token) (token & D3DSP_SRCMOD_MASK) -#define D3DSI_GETADDRESSMODE(token) (token & D3DVS_ADDRESSMODE_MASK) - -#ifdef __cplusplus -// This gets regtype, and also maps D3DSPR_CONSTn to D3DSPR_CONST (for easier parsing) -inline D3DSHADER_PARAM_REGISTER_TYPE D3DSI_GETREGTYPE_RESOLVING_CONSTANTS(DWORD token) -{ - D3DSHADER_PARAM_REGISTER_TYPE RegType = D3DSI_GETREGTYPE(token); - switch(RegType) - { - case D3DSPR_CONST4: - case D3DSPR_CONST3: - case D3DSPR_CONST2: - return D3DSPR_CONST; - default: - return RegType; - } -} - -// The inline function below retrieves register number for an opcode, -// taking into account that: if the type is a -// D3DSPR_CONSTn, the register number needs to be remapped. -// -// D3DSPR_CONST is for c0-c2047 -// D3DSPR_CONST2 is for c2048-c4095 -// D3DSPR_CONST3 is for c4096-c6143 -// D3DSPR_CONST4 is for c6144-c8191 -// -// For example if the instruction token specifies type D3DSPR_CONST4, reg# 3, -// the register number retrieved is 6147. -// For other register types, the register number is just returned unchanged. -inline UINT D3DSI_GETREGNUM_RESOLVING_CONSTANTS(DWORD token) -{ - D3DSHADER_PARAM_REGISTER_TYPE RegType = D3DSI_GETREGTYPE(token); - UINT RegNum = D3DSI_GETREGNUM(token); - switch(RegType) - { - case D3DSPR_CONST4: - return RegNum + 6144; - case D3DSPR_CONST3: - return RegNum + 4096; - case D3DSPR_CONST2: - return RegNum + 2048; - default: - return RegNum; - } -} -#endif // __cplusplus - -#endif - -// Indicates that the lpVertices field in the DrawPrimitives2 data is -// valid, i.e. user allocated memory. -#define D3DHALDP2_USERMEMVERTICES 0x00000001L -// Indicates that the command buffer and vertex buffer are a system memory execute buffer -// resulting from the use of the Execute buffer API. -#define D3DHALDP2_EXECUTEBUFFER 0x00000002L -// The swap flags indicate if it is OK for the driver to swap the submitted buffers with new -// buffers and asyncronously work on the submitted buffers. -#define D3DHALDP2_SWAPVERTEXBUFFER 0x00000004L -#define D3DHALDP2_SWAPCOMMANDBUFFER 0x00000008L -// The requested flags are present if the new buffers which the driver can allocate need to be -// of atleast a given size. If any of these flags are set, the corresponding dwReq* field in -// D3DHAL_DRAWPRIMITIVES2DATA will also be set with the requested size in bytes. -#define D3DHALDP2_REQVERTEXBUFSIZE 0x00000010L -#define D3DHALDP2_REQCOMMANDBUFSIZE 0x00000020L -// These flags are set by the driver upon return from DrawPrimitives2 indicating if the new -// buffers are not in system memory. -#define D3DHALDP2_VIDMEMVERTEXBUF 0x00000040L -#define D3DHALDP2_VIDMEMCOMMANDBUF 0x00000080L - -// Used by the driver to ask runtime to parse the execute buffer -#define D3DERR_COMMAND_UNPARSED MAKE_DDHRESULT(3000) - -typedef DWORD (CALLBACK *LPD3DHAL_CLEAR2CB) (LPD3DHAL_CLEAR2DATA); -typedef DWORD (CALLBACK *LPD3DHAL_VALIDATETEXTURESTAGESTATECB)(LPD3DHAL_VALIDATETEXTURESTAGESTATEDATA); -typedef DWORD (CALLBACK *LPD3DHAL_DRAWPRIMITIVES2CB) (LPD3DHAL_DRAWPRIMITIVES2DATA); - -typedef struct _D3DHAL_CALLBACKS3 -{ - DWORD dwSize; // size of struct - DWORD dwFlags; // flags for callbacks - LPD3DHAL_CLEAR2CB Clear2; - LPVOID lpvReserved; - LPD3DHAL_VALIDATETEXTURESTAGESTATECB ValidateTextureStageState; - LPD3DHAL_DRAWPRIMITIVES2CB DrawPrimitives2; -} D3DHAL_CALLBACKS3; -typedef D3DHAL_CALLBACKS3 *LPD3DHAL_CALLBACKS3; -#define D3DHAL_CALLBACKS3SIZE sizeof(D3DHAL_CALLBACKS3) - -// bit definitions for D3DHAL -#define D3DHAL3_CB32_CLEAR2 0x00000001L -#define D3DHAL3_CB32_RESERVED 0x00000002L -#define D3DHAL3_CB32_VALIDATETEXTURESTAGESTATE 0x00000004L -#define D3DHAL3_CB32_DRAWPRIMITIVES2 0x00000008L - -/* -------------------------------------------------------------- - * Texture stage renderstate mapping definitions. - * - * 256 renderstate slots [256, 511] are reserved for texture processing - * stage controls, which provides for 8 texture processing stages each - * with 32 DWORD controls. - * - * The renderstates within each stage are indexed by the - * D3DTEXTURESTAGESTATETYPE enumerants by adding the appropriate - * enumerant to the base for a given texture stage. - * - * Note, "state overrides" bias the renderstate by 256, so the two - * ranges overlap. Overrides are enabled for exebufs only, so all - * this means is that Texture3 cannot be used with exebufs. - */ - -/* - * Base of all texture stage state values in renderstate array. - */ -#define D3DHAL_TSS_RENDERSTATEBASE 256UL - -/* - * Maximum number of stages allowed. - */ -#define D3DHAL_TSS_MAXSTAGES 8 - -/* - * Number of state DWORDS per stage. - */ -#define D3DHAL_TSS_STATESPERSTAGE 64 - -/* - * Texture handle's offset into the 32-DWORD cascade state vector - */ -#define D3DTSS_TEXTUREMAP 0 - - -#if(DIRECT3D_VERSION >= 0x0900) -/* -------------------------------------------------------------- - * Texture sampler renderstate. - * - * D3DSAMPLERSTATETYPE (D3DSAMP_*) sampler states exist to - * separate sampler state from the rest of the D3DTSS_* states. - * D3DSAMP_* states are only visible at the API level; - * the runtime simply maps these to D3DTSS_* for drivers. - * - */ - -/* - * Maximum number of texture samplers allowed. - * - * If this number gets bigger than 32, some retooling - * will be needed, as DWORD bitfields are used all over the place. - */ -#define D3DHAL_SAMPLER_MAXSAMP 16 - -/* - * Maximum number of samplers in vertex shaders (must be power of 2) - */ -#define D3DHAL_SAMPLER_MAXVERTEXSAMP 4 - -/* - * Number of state DWORDS per sampler. - */ -#define D3DHAL_SAMPLER_STATESPERSAMP D3DSAMP_MAX - - -/* - * D3DTSS_* states that have been removed from the D3DTEXTURESTAGESTATETYPE - * and turned into the D3DSAMP_* enum D3DTEXTURESAMPLERTYPE. - * These defines allow D3DSAMP_* to be mapped to D3DTSS_* through the DDI - * so that drivers can simply understand D3DTSS_* and do not have to know - * about D3DSAMP_* at all. - * These defines are now labelled as D3DTSS_RESERVEDn in the public - * header definition of D3DTEXTURESTAGESTATETYPE. - */ -#define D3DTSS_ADDRESSU ((D3DTEXTURESTAGESTATETYPE)13) -#define D3DTSS_ADDRESSV ((D3DTEXTURESTAGESTATETYPE)14) -#define D3DTSS_BORDERCOLOR ((D3DTEXTURESTAGESTATETYPE)15) -#define D3DTSS_MAGFILTER ((D3DTEXTURESTAGESTATETYPE)16) -#define D3DTSS_MINFILTER ((D3DTEXTURESTAGESTATETYPE)17) -#define D3DTSS_MIPFILTER ((D3DTEXTURESTAGESTATETYPE)18) -#define D3DTSS_MIPMAPLODBIAS ((D3DTEXTURESTAGESTATETYPE)19) -#define D3DTSS_MAXMIPLEVEL ((D3DTEXTURESTAGESTATETYPE)20) -#define D3DTSS_MAXANISOTROPY ((D3DTEXTURESTAGESTATETYPE)21) -#define D3DTSS_ADDRESSW ((D3DTEXTURESTAGESTATETYPE)25) -#define D3DTSS_SRGBTEXTURE ((D3DTEXTURESTAGESTATETYPE)29) -#define D3DTSS_ELEMENTINDEX ((D3DTEXTURESTAGESTATETYPE)30) -#define D3DTSS_DMAPOFFSET ((D3DTEXTURESTAGESTATETYPE)31) - -// These renderstates were retired in DX8: -#ifndef D3DRS_SOFTWAREVERTEXPROCESSING -#define D3DRS_SOFTWAREVERTEXPROCESSING ((D3DRENDERSTATETYPE)153) -#endif - -// These renderstates were retired in DX9: -#ifndef D3DRS_PATCHSEGMENTS -#define D3DRS_LINEPATTERN ((D3DRENDERSTATETYPE)10) -#define D3DRS_ZVISIBLE ((D3DRENDERSTATETYPE)30) -#define D3DRS_PATCHSEGMENTS ((D3DRENDERSTATETYPE)164) -#endif - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -/* -------------------------------------------------------------- - * Flags for the data parameters. - */ - -/* - * SceneCapture() - * This is used as an indication to the driver that a scene is about to - * start or end, and that it should capture data if required. - */ -#define D3DHAL_SCENE_CAPTURE_START 0x00000000L -#define D3DHAL_SCENE_CAPTURE_END 0x00000001L - -/* - * Execute() - */ - -/* - * Use the instruction stream starting at dwOffset. - */ -#define D3DHAL_EXECUTE_NORMAL 0x00000000L - -/* - * Use the optional instruction override (diInstruction) and return - * after completion. dwOffset is the offset to the first primitive. - */ -#define D3DHAL_EXECUTE_OVERRIDE 0x00000001L - -/* - * GetState() - * The driver will get passed a flag in dwWhich specifying which module - * the state must come from. The driver then fills in ulArg[1] with the - * appropriate value depending on the state type given in ddState. - */ - -/* - * The following are used to get the state of a particular stage of the - * pipeline. - */ -#define D3DHALSTATE_GET_TRANSFORM 0x00000001L -#define D3DHALSTATE_GET_LIGHT 0x00000002L -#define D3DHALSTATE_GET_RENDER 0x00000004L - - -/* -------------------------------------------------------------- - * Return values from HAL functions. - */ - -/* - * The context passed in was bad. - */ -#define D3DHAL_CONTEXT_BAD 0x000000200L - -/* - * No more contexts left. - */ -#define D3DHAL_OUTOFCONTEXTS 0x000000201L - -/* - * Execute() and ExecuteClipped() - */ - -/* - * Executed to completion via early out. - * (e.g. totally clipped) - */ -#define D3DHAL_EXECUTE_ABORT 0x00000210L - -/* - * An unhandled instruction code was found (e.g. D3DOP_TRANSFORM). - * The dwOffset parameter must be set to the offset of the unhandled - * instruction. - * - * Only valid from Execute() - */ -#define D3DHAL_EXECUTE_UNHANDLED 0x00000211L - -// typedef for the Callback that the drivers can use to parse unknown commands -// passed to them via the DrawPrimitives2 callback. The driver obtains this -// callback thru a GetDriverInfo call with GUID_D3DParseUnknownCommandCallback -// made by ddraw somewhere around the initialization time. -typedef HRESULT (CALLBACK *PFND3DPARSEUNKNOWNCOMMAND) (LPVOID lpvCommands, - LPVOID *lplpvReturnedCommand); - - -/* - * DDI only renderstates. - */ -#define D3DRENDERSTATE_EVICTMANAGEDTEXTURES 61 // DDI render state only to Evict textures -#define D3DRENDERSTATE_SCENECAPTURE 62 // DDI only to replace SceneCapture -#define D3DRS_DELETERTPATCH 169 // DDI only to delete high order patch -#define D3DRS_MAXVERTEXSHADERINST ((D3DRENDERSTATETYPE)196) // DDI only: vs_3_0+ num instructions to execute. -#define D3DRS_MAXPIXELSHADERINST ((D3DRENDERSTATETYPE)197) // DDI only: ps_3_0+ num instructions to execute. -#define D3DRS_ZBIAS ((D3DRENDERSTATETYPE)47) // replaced by depthbias - -// Default values for D3DRS_MAXVERTEXSHADERINST and D3DRS_MAXPIXELSHADERINST -#define D3DINFINITEINSTRUCTIONS 0xffffffff - -//----------------------------------------------------------------------------- -// -// DirectX 8.0's new driver info querying mechanism. -// -// How to handle the new driver info query mechanism. -// -// DirectX 8.0 utilizes an extension to GetDriverInfo() to query for -// additional information from the driver. Currently this mechanism is only -// used for querying for DX8 style D3D caps but it may be used for other -// information over time. -// -// This extension to GetDriverInfo takes the form of a GetDriverInfo call -// with the GUID GUID_GetDriverInfo2. When a GetDriverInfo call with this -// GUID is received by the driver the driver must check the data passed -// in the lpvData field of the DD_GETDRIVERINFODATA data structure to see -// what information is being requested. -// -// It is important to note that the GUID GUID_GetDriverInfo2 is, in fact, -// the same as the GUID_DDStereoMode. If you driver doesn't handle -// GUID_DDStereoMode this is not an issue. However, if you wish your driver -// to handle GUID_DDStereoMode as well as GUID_GetDriverInfo2 special action -// must be taken. When a call tp GetDriverInfo with the GUID -// GUID_GetDriverInfo2/GUID_DDStereoMode is made the runtime sets the -// dwHeight field of the DD_STEREOMODE structure to the special value -// D3DGDI2_MAGIC. In this way you can determine when the request is a -// stereo mode call or a GetDriverInfo2 call. The dwHeight field of -// DD_STEREOMODE corresponds to the dwMagic field of the -// DD_GETDRIVERINFO2DATA structure. -// -// The dwExpectedSize field of the DD_GETDRIVERINFODATA structure is not -// used by when a GetDriverInfo2 request is being made and should be -// ignored. The actual expected size of the data is found in the -// dwExpectedSize of the DD_GETDRIVERINFO2DATA structure. -// -// Once the driver has determined that this is a call to -// GetDriverInfo2 it must then determine the type of information being -// requested by the runtime. This type is contained in the dwType field -// of the DD_GETDRIVERINFO2DATA data structure. -// -// Finally, once the driver knows this is a GetDriverInfo2 request of a -// particular type it can copy the requested data into the data buffer. -// It is important to note that the lpvData field of the DD_GETDRIVERINFODATA -// data structure points to data buffer in which to copy your data. lpvData -// also points to the DD_GETDRIVERINFO2DATA structure. This means that the -// data returned by the driver will overwrite the DD_GETDRIVERINFO2DATA -// structure and, hence, the DD_GETDRIVERINFO2DATA structure occupies the -// first few DWORDs of the buffer. -// -// The following code fragment demonstrates how to handle GetDriverInfo2. -// -// D3DCAPS8 myD3DCaps8; -// -// DWORD CALLBACK -// DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA lpData) -// { -// if (MATCH_GUID((lpData->guidInfo), GUID_GetDriverInfo2) ) -// { -// ASSERT(NULL != lpData); -// ASSERT(NULL != lpData->lpvData); -// -// // Is this a call to GetDriverInfo2 or DDStereoMode? -// if (((DD_GETDRIVERINFO2DATA*)(lpData->lpvData))->dwMagic == D3DGDI2_MAGIC) -// { -// // Yes, its a call to GetDriverInfo2, fetch the -// // DD_GETDRIVERINFO2DATA data structure. -// DD_GETDRIVERINFO2DATA* pgdi2 = lpData->lpvData; -// ASSERT(NULL != pgdi2); -// -// // What type of request is this? -// switch (pgdi2->dwType) -// { -// case D3DGDI2_TYPE_GETD3DCAPS8: -// { -// // The runtime is requesting the DX8 D3D caps so -// // copy them over now. -// -// // It should be noted that the dwExpectedSize field -// // of DD_GETDRIVERINFODATA is not used for -// // GetDriverInfo2 calls and should be ignored. -// size_t copySize = min(sizeof(myD3DCaps8), pgdi2->dwExpectedSize); -// memcpy(lpData->lpvData, &myD3DCaps8, copySize); -// lpData->dwActualSize = copySize; -// lpData->ddRVal = DD_OK; -// return DDHAL_DRIVER_HANDLED; -// } -// default: -// // For any other GetDriverInfo2 types not handled -// // or understood by the driver set an ddRVal of -// // DDERR_CURRENTLYNOTAVAIL and return -// // DDHAL_DRIVER_HANDLED. -// lpData->dwActualSize = 0; -// lpData->ddRVal = DDERR_CURRENTLYNOTAVAIL; -// return DDHAL_DRIVER_HANDLED; -// } -// } -// else -// { -// // It must be a call a request for stereo mode support. -// // Fetch the stereo mode data -// DD_STEREOMODE* pStereoMode = lpData->lpvData; -// ASSERT(NULL != pStereoMode); -// -// // Process the stereo mode request... -// lpData->dwActualSize = sizeof(DD_STEREOMODE); -// lpData->ddRVal = DD_OK; -// return DDHAL_DRIVER_HANDLED; -// } -// } -// -// // Handle any other device GUIDs... -// -// } // DdGetDriverInfo -// -//----------------------------------------------------------------------------- - -// -// The data structure which is passed to the driver when GetDriverInfo is -// called with a GUID of GUID_GetDriverInfo2. -// -// NOTE: Although the fields listed below are all read only this data -// structure is actually the first four DWORDs of the data buffer into -// which the driver writes the requested infomation. As such, these fields -// (and the entire data structure) are overwritten by the data returned by -// the driver. -// -typedef struct _DD_GETDRIVERINFO2DATA -{ - DWORD dwReserved; // Reserved Field. - // Driver should not read or write this field. - - DWORD dwMagic; // Magic Number. Has the value D3DGDI2_MAGIC if - // this is a GetDriverInfo2 call. Otherwise - // this structure is, in fact, a DD_STEREOMODE - // call. - // Driver should only read this field. - - DWORD dwType; // Type of information requested. This field - // contains one of the DDGDI2_TYPE_ #defines - // listed below. - // Driver should only read (not write) this - // field. - - DWORD dwExpectedSize; // Expected size of the information requested. - // Driver should only read (not write) this - // field. - - // The remainder of the data buffer (beyond the first four DWORDs) - // follows here. -} DD_GETDRIVERINFO2DATA; - -// -// IMPORTANT NOTE: This GUID has exactly the same value as GUID_DDStereoMode -// and as such you must be very careful when using it. If your driver needs -// to handle both GetDriverInfo2 and DDStereoMode it must have a single -// check for the shared GUID and then distinguish between which use of that -// GUID is being requested. -// -#define GUID_GetDriverInfo2 (GUID_DDStereoMode) - -// -// Magic value used to determine whether a GetDriverInfo call with the -// GUID GUID_GetDriverInfo2/GUID_DDStereoMode is a GetDriverInfo2 request -// or a query about stereo capabilities. This magic number is stored in -// the dwHeight field of the DD_STEREOMODE data structure. -// -#define D3DGDI2_MAGIC (0xFFFFFFFFul) - -// -// The types of information which can be requested from the driver via -// GetDriverInfo2. -// - -#define D3DGDI2_TYPE_GETD3DCAPS8 (0x00000001ul) // Return the D3DCAPS8 data -#define D3DGDI2_TYPE_GETFORMATCOUNT (0x00000002ul) // Return the number of supported formats -#define D3DGDI2_TYPE_GETFORMAT (0x00000003ul) // Return a particular format -#define D3DGDI2_TYPE_DXVERSION (0x00000004ul) // Notify driver of current DX Version -#define D3DGDI2_TYPE_GETD3DCAPS9 (0x00000010ul) // Return the D3DCAPS9 data -#define D3DGDI2_TYPE_GETEXTENDEDMODECOUNT (0x00000011ul) // Return the number of supported extended mode -#define D3DGDI2_TYPE_GETEXTENDEDMODE (0x00000012ul) // Return a particular extended mode -#define D3DGDI2_TYPE_GETADAPTERGROUP (0x00000013ul) // Return a adapter group information -#define D3DGDI2_TYPE_GETMULTISAMPLEQUALITYLEVELS (0x00000016ul) // Return the number of multisample quality levels -#define D3DGDI2_TYPE_DEFERRED_AGP_AWARE (0x00000018ul) // Runtime is aware of deferred AGP frees, and will send following (NT only) -#define D3DGDI2_TYPE_FREE_DEFERRED_AGP (0x00000019ul) // Free any deferred-freed AGP allocations for this process (NT only) -#define D3DGDI2_TYPE_DEFER_AGP_FREES (0x00000020ul) // Start defering AGP frees for this process -#define D3DGDI2_TYPE_GETD3DQUERYCOUNT (0x00000021ul) // Return the number of supported queries -#define D3DGDI2_TYPE_GETD3DQUERY (0x00000022ul) // Return supported query -#define D3DGDI2_TYPE_GETDDIVERSION (0x00000023ul) // Return DX9_DDI_VERSION - -// -// This data structure is returned by the driver in response to a -// GetDriverInfo2 query with the type D3DGDI2_TYPE_GETFORMATCOUNT. It simply -// gives the number of surface formats supported by the driver. Currently this -// structure consists of a single member giving the number of supported -// surface formats. -// -typedef struct _DD_GETFORMATCOUNTDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwFormatCount; // [out] Number of supported surface formats - DWORD dwReserved; // Reserved -} DD_GETFORMATCOUNTDATA; - -// -// This data structure is used to request a specific surface format from the -// driver. It is guaranteed that the requested format will be greater than or -// equal to zero and less that the format count reported by the driver from -// the preceeding D3DGDI2_TYPE_GETFORMATCOUNT request. -// -typedef struct _DD_GETFORMATDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwFormatIndex; // [in] The format to return - DDPIXELFORMAT format; // [out] The actual format -} DD_GETFORMATDATA; - -// -// This data structure is used to notify drivers about the DirectX version -// number. This is the value that is denoted as DD_RUNTIME_VERSION in the -// DDK headers. -// -typedef struct _DD_DXVERSION -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwDXVersion; // [in] The Version of DX - DWORD dwReserved; // Reserved -} DD_DXVERSION; - -// Informs driver that runtime will send a notification after last outstanding AGP -// lock has been released. -typedef struct _DD_DEFERRED_AGP_AWARE_DATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data -} DD_DEFERRED_AGP_AWARE_DATA; - -// Notification that the last AGP lock has been released. Driver can free all deferred AGP -// allocations for this process. -typedef struct _DD_FREE_DEFERRED_AGP_DATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwProcessId; // [in] Process ID for whom to free deferred AGP -} DD_FREE_DEFERRED_AGP_DATA; - -#if(DIRECT3D_VERSION >= 0x0900) -// -// This data structure is returned by the driver in response to a -// GetDriverInfo2 query with the type D3DGDI2_TYPE_GETEXTENDEDMODECOUNT. It simply -// gives the number of extended video modes supported by the driver. Currently this -// structure consists of a single member giving the number of supported extended -// video modes. -// -typedef struct _DD_GETEXTENDEDMODECOUNTDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwModeCount; // [out] Number of supported extended video modes - DWORD dwReserved; // Reserved -} DD_GETEXTENDEDMODECOUNTDATA; - -// -// This data structure is used to request a specific extended video mode from the -// driver. It is guaranteed that the requested format will be greater than or -// equal to zero and less that the format count reported by the driver from -// the preceeding D3DGDI2_TYPE_GETEXTENDEDMODECOUNT request. -// -typedef struct _DD_GETEXTENDEDMODEDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwModeIndex; // [in] The format to return - D3DDISPLAYMODE mode; // [out] The actual format -} DD_GETEXTENDEDMODEDATA; - -// -// This data structure is used to request a adapter group information from the driver. -// A adapter group is a set of adapters which share video hardware (like video memory, -// 3D accelerator). Thus it is mainly for DualView video adapter. Direct3D runtime -// will share surface resources (like texture, vertex buffers) across adapters within -// a adapter group upon application's request. -// -typedef struct _DD_GETADAPTERGROUPDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - ULONG_PTR ulUniqueAdapterGroupId; // [out] The unique id of adapter group that this adapter belonging to - DWORD dwReserved1; // Reserved, must be 0 - DWORD dwReserved2; // Reserved, must be 0 -} DD_GETADAPTERGROUPDATA; - -typedef struct _DD_MULTISAMPLEQUALITYLEVELSDATA -{ - DD_GETDRIVERINFO2DATA gdi2; //[in/out] GetDriverInfo2 data - D3DFORMAT Format; //[in] Format of multi-sampled render-target - BOOL bFlip : 1; //[in] FALSE means blt-style resolution - D3DMULTISAMPLE_TYPE MSType : 31; //[in] - DWORD QualityLevels; //[out] -} DD_MULTISAMPLEQUALITYLEVELSDATA; - -typedef struct _DD_GETD3DQUERYCOUNTDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwNumQueries; // [out] Number of queries -} DD_GETD3DQUERYCOUNTDATA; - -typedef struct _DD_GETD3DQUERYDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - union - { - DWORD dwQueryIndex; // [in] Index of cap - D3DQUERYTYPE QueryType; // [out] Query cap - }; -} DD_GETD3DQUERYDATA; - -typedef struct _DD_GETDDIVERSIONDATA -{ - DD_GETDRIVERINFO2DATA gdi2; // [in/out] GetDriverInfo2 data - DWORD dwDXVersion; // [in] DX version (9 for DX9, etc.) - DWORD dwDDIVersion; // [out] DX9_DDI_VERSION -} DD_GETDDIVERSIONDATA; - -#define DX9_DDI_VERSION 4 - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -#if(DIRECT3D_VERSION >= 0x0900) - -// GetDriverState IDs - D3DDEVINFO structures used for query mechanism in public headers - -#define D3DDEVINFOID_VCACHE 4 /* Used with D3DDEVINFOID_VCACHE */ - -// This was eliminated in DX9 but was exposed in DX8.1 so the drivers still need it -#define D3DFMT_W11V11U10 (D3DFORMAT)65 - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -// New Caps that are not API visible that the driver exposes. -#define D3DDEVCAPS_HWVERTEXBUFFER 0x02000000L /* Device supports Driver Allocated Vertex Buffers*/ -#define D3DDEVCAPS_HWINDEXBUFFER 0x04000000L /* Device supports Driver Allocated Index Buffers*/ -#define D3DDEVCAPS_SUBVOLUMELOCK 0x08000000L /* Device supports locking a part of volume texture*/ -#ifndef D3DPMISCCAPS_FOGINFVF -#define D3DPMISCCAPS_FOGINFVF 0x00002000L /* Device supports separate fog value in the FVF */ -#endif -#ifndef D3DFVF_FOG -#define D3DFVF_FOG 0x00002000L /* There is a separate fog value in the FVF vertex */ -#endif - -// -// This stuff is not API visible but should be DDI visible. -// Should be in Sync with d3d8types.h -// -#define D3DFMT_D32 (D3DFORMAT)71 -#define D3DFMT_S1D15 (D3DFORMAT)72 -#define D3DFMT_D15S1 (D3DFORMAT)73 -#define D3DFMT_S8D24 (D3DFORMAT)74 -#define D3DFMT_D24S8 (D3DFORMAT)75 -#define D3DFMT_X8D24 (D3DFORMAT)76 -#define D3DFMT_D24X8 (D3DFORMAT)77 -#define D3DFMT_X4S4D24 (D3DFORMAT)78 -#define D3DFMT_D24X4S4 (D3DFORMAT)79 - - -//-------------- Vertex shader defines -------------------------------- -// Vertex Shader register limits. D3D device must provide at least -// specified number of registers - -// This one was used by DX8 only. -#define D3DVS_MAXINSTRUCTIONCOUNT_V1_1 128 - -// Max number of labels in a shader -#define D3DVS_LABEL_MAX_V3_0 2048 - -// Max number of output texture coordinates -#define D3DVS_TCRDOUTREG_MAX_V1_1 8 -#define D3DVS_TCRDOUTREG_MAX_V2_0 8 -#define D3DVS_TCRDOUTREG_MAX_V2_1 8 -#define D3DVS_OUTPUTREG_MAX_V3_0 12 -#define D3DVS_OUTPUTREG_MAX_SW_DX9 16 - -// Max number of output registers -#define D3DVS_OUTPUTREG_MAX_V3_0 12 - -// Max number of output attributes (colors) -#define D3DVS_ATTROUTREG_MAX_V1_1 2 -#define D3DVS_ATTROUTREG_MAX_V2_0 2 -#define D3DVS_ATTROUTREG_MAX_V2_1 2 - -// Max number of input registers -#define D3DVS_INPUTREG_MAX_V1_1 16 -#define D3DVS_INPUTREG_MAX_V2_0 16 -#define D3DVS_INPUTREG_MAX_V2_1 16 -#define D3DVS_INPUTREG_MAX_V3_0 16 - -// Max number of temp registers -#define D3DVS_TEMPREG_MAX_V1_1 12 -#define D3DVS_TEMPREG_MAX_V2_0 12 -#define D3DVS_TEMPREG_MAX_V2_1 32 -#define D3DVS_TEMPREG_MAX_V3_0 32 - -// Max number of constant float vector registers -#define D3DVS_CONSTREG_MAX_V1_1 96 -#define D3DVS_CONSTREG_MAX_V2_0 8192 -#define D3DVS_CONSTREG_MAX_V2_1 8192 -#define D3DVS_CONSTREG_MAX_V3_0 8192 - -#define D3DVS_CONSTINTREG_MAX_SW_DX9 2048 - -// Max number of integer constant registers -#define D3DVS_CONSTINTREG_MAX_V2_0 16 -#define D3DVS_CONSTINTREG_MAX_V2_1 16 -#define D3DVS_CONSTINTREG_MAX_V3_0 16 - -#define D3DVS_CONSTBOOLREG_MAX_SW_DX9 2048 - -// Max number of BOOL constant registers -#define D3DVS_CONSTBOOLREG_MAX_V2_0 16 -#define D3DVS_CONSTBOOLREG_MAX_V2_1 16 -#define D3DVS_CONSTBOOLREG_MAX_V3_0 16 - -// Max number of vector address registers -#define D3DVS_ADDRREG_MAX_V1_1 1 -#define D3DVS_ADDRREG_MAX_V2_0 1 -#define D3DVS_ADDRREG_MAX_V2_1 1 -#define D3DVS_ADDRREG_MAX_V3_0 1 - -// Max absolute value of the loop step -#define D3DVS_MAXLOOPSTEP_V2_0 128 -#define D3DVS_MAXLOOPSTEP_V2_1 128 -#define D3DVS_MAXLOOPSTEP_V3_0 128 - -// Max absolute value of the loop initial valuep -#define D3DVS_MAXLOOPINITVALUE_V2_0 255 -#define D3DVS_MAXLOOPINITVALUE_V2_1 255 -#define D3DVS_MAXLOOPINITVALUE_V3_0 255 - -// Max loop interation count -#define D3DVS_MAXLOOPITERATIONCOUNT_V2_0 255 -#define D3DVS_MAXLOOPITERATIONCOUNT_V2_1 255 -#define D3DVS_MAXLOOPITERATIONCOUNT_V3_0 255 - -// Number of PREDICATE registers -#define D3DVS_PREDICATE_MAX_V2_1 1 -#define D3DVS_PREDICATE_MAX_V3_0 1 - -//---------------- End vertex shader defines ------------------------------- - - -//---------------- Pixel shader defines ------------------------------------ -// Pixel Shader register limits. D3D device must provide at least -// specified number of registers - -// Number of INPUT registers based on shader version -#define D3DPS_INPUTREG_MAX_V1_1 2 -#define D3DPS_INPUTREG_MAX_V1_2 2 -#define D3DPS_INPUTREG_MAX_V1_3 2 -#define D3DPS_INPUTREG_MAX_V1_4 2 -#define D3DPS_INPUTREG_MAX_V2_0 2 -#define D3DPS_INPUTREG_MAX_V2_1 2 -#define D3DPS_INPUTREG_MAX_V3_0 10 -#define D3DPS_INPUTREG_MAX_SW_DX9 14 - -// Number of TEMP registers based on shader version -#define D3DPS_TEMPREG_MAX_V1_1 2 -#define D3DPS_TEMPREG_MAX_V1_2 2 -#define D3DPS_TEMPREG_MAX_V1_3 2 -#define D3DPS_TEMPREG_MAX_V1_4 6 -#define D3DPS_TEMPREG_MAX_V2_0 12 -#define D3DPS_TEMPREG_MAX_V2_1 32 -#define D3DPS_TEMPREG_MAX_V3_0 32 - -// Number of TEXTURE registers based on shader version -#define D3DPS_TEXTUREREG_MAX_V1_1 4 -#define D3DPS_TEXTUREREG_MAX_V1_2 4 -#define D3DPS_TEXTUREREG_MAX_V1_3 4 -#define D3DPS_TEXTUREREG_MAX_V1_4 6 -#define D3DPS_TEXTUREREG_MAX_V2_0 8 -#define D3DPS_TEXTUREREG_MAX_V2_1 8 -#define D3DPS_TEXTUREREG_MAX_V3_0 0 - -// Number of COLOROUT registers based on shader version -#define D3DPS_COLOROUT_MAX_V2_0 4 -#define D3DPS_COLOROUT_MAX_V2_1 4 -#define D3DPS_COLOROUT_MAX_V3_0 4 - -// Number of PREDICATE registers based on shader version -#define D3DPS_PREDICATE_MAX_V2_1 1 -#define D3DPS_PREDICATE_MAX_V3_0 1 - -// Number of FLOAT constants based on shader version -#define D3DPS_CONSTREG_MAX_V1_1 8 -#define D3DPS_CONSTREG_MAX_V1_2 8 -#define D3DPS_CONSTREG_MAX_V1_3 8 -#define D3DPS_CONSTREG_MAX_V1_4 8 -#define D3DPS_CONSTREG_MAX_V2_0 32 -#define D3DPS_CONSTREG_MAX_V2_1 32 -#define D3DPS_CONSTREG_MAX_V3_0 224 -#define D3DPS_CONSTREG_MAX_SW_DX9 8192 - -// Max number of pixel shader hardware BOOL constant registers -#define D3DPS_CONSTBOOLREG_MAX_V2_1 16 -#define D3DPS_CONSTBOOLREG_MAX_V3_0 16 -#define D3DPS_CONSTBOOLREG_MAX_SW_DX9 2048 - -// Max number of pixel shader hardware INTEGER constant registers -#define D3DPS_CONSTINTREG_MAX_V2_1 16 -#define D3DPS_CONSTINTREG_MAX_V3_0 16 -#define D3DPS_CONSTINTREG_MAX_SW_DX9 2048 - -// Max absolute value for loop step -#define D3DPS_MAXLOOPSTEP_V2_1 128 -#define D3DPS_MAXLOOPSTEP_V3_0 128 - -// Max absolute value for loop initial value -#define D3DPS_MAXLOOPINITVALUE_V2_1 255 -#define D3DPS_MAXLOOPINITVALUE_V3_0 255 - -// Max loop interation count -#define D3DPS_MAXLOOPITERATIONCOUNT_V2_1 255 -#define D3DPS_MAXLOOPITERATIONCOUNT_V3_0 255 - -//---------------- End pixel shader defines ------------------------------- - -// Pixel Shader DX8 register limits. D3D device will have at most these -// specified number of registers -// -#define D3DPS_INPUTREG_MAX_DX8 8 -#define D3DPS_TEMPREG_MAX_DX8 8 -#define D3DPS_CONSTREG_MAX_DX8 8 -#define D3DPS_TEXTUREREG_MAX_DX8 8 - -#if(DIRECT3D_VERSION >= 0x0900) - -// bit declarations for _Type fields -#define D3DVSDT_FLOAT1 0x00 // 1D float expanded to (value, 0., 0., 1.) -#define D3DVSDT_FLOAT2 0x01 // 2D float expanded to (value, value, 0., 1.) -#define D3DVSDT_FLOAT3 0x02 // 3D float expanded to (value, value, value, 1.) -#define D3DVSDT_FLOAT4 0x03 // 4D float -#define D3DVSDT_D3DCOLOR 0x04 // 4D packed unsigned bytes mapped to 0. to 1. range - // Input is in D3DCOLOR format (ARGB) expanded to (R, G, B, A) -#define D3DVSDT_UBYTE4 0x05 // 4D unsigned byte -#define D3DVSDT_SHORT2 0x06 // 2D signed short expanded to (value, value, 0., 1.) -#define D3DVSDT_SHORT4 0x07 // 4D signed short - -#define D3DVSDE_POSITION 0 -#define D3DVSDE_BLENDWEIGHT 1 -#define D3DVSDE_BLENDINDICES 2 -#define D3DVSDE_NORMAL 3 -#define D3DVSDE_PSIZE 4 -#define D3DVSDE_DIFFUSE 5 -#define D3DVSDE_SPECULAR 6 -#define D3DVSDE_TEXCOORD0 7 -#define D3DVSDE_TEXCOORD1 8 -#define D3DVSDE_TEXCOORD2 9 -#define D3DVSDE_TEXCOORD3 10 -#define D3DVSDE_TEXCOORD4 11 -#define D3DVSDE_TEXCOORD5 12 -#define D3DVSDE_TEXCOORD6 13 -#define D3DVSDE_TEXCOORD7 14 -#define D3DVSDE_POSITION2 15 -#define D3DVSDE_NORMAL2 16 - -/* DX8 style vertex declaration - -Vertex Shader Declaration - -The declaration portion of a vertex shader defines the static external -interface of the shader. The information in the declaration includes: - -- Assignments of vertex shader input registers to data streams. These -assignments bind a specific vertex register to a single component within a -vertex stream. A vertex stream element is identified by a byte offset -within the stream and a type. The type specifies the arithmetic data type -plus the dimensionality (1, 2, 3, or 4 values). Stream data which is -less than 4 values are always expanded out to 4 values with zero or more -0.F values and one 1.F value. - -- Assignment of vertex shader input registers to implicit data from the -primitive tessellator. This controls the loading of vertex data which is -not loaded from a stream, but rather is generated during primitive -tessellation prior to the vertex shader. - -- Loading data into the constant memory at the time a shader is set as the -current shader. Each token specifies values for one or more contiguous 4 -DWORD constant registers. This allows the shader to update an arbitrary -subset of the constant memory, overwriting the device state (which -contains the current values of the constant memory). Note that these -values can be subsequently overwritten (between DrawPrimitive calls) -during the time a shader is bound to a device via the -SetVertexShaderConstant method. - - -Declaration arrays are single-dimensional arrays of DWORDs composed of -multiple tokens each of which is one or more DWORDs. The single-DWORD -token value 0xFFFFFFFF is a special token used to indicate the end of the -declaration array. The single DWORD token value 0x00000000 is a NOP token -with is ignored during the declaration parsing. Note that 0x00000000 is a -valid value for DWORDs following the first DWORD for multiple word tokens. - -[31:29] TokenType - 0x0 - NOP (requires all DWORD bits to be zero) - 0x1 - stream selector - 0x2 - stream data definition (map to vertex input memory) - 0x3 - vertex input memory from tessellator - 0x4 - constant memory from shader - 0x5 - extension - 0x6 - reserved - 0x7 - end-of-array (requires all DWORD bits to be 1) - -NOP Token (single DWORD token) - [31:29] 0x0 - [28:00] 0x0 - -Stream Selector (single DWORD token) - [31:29] 0x1 - [28] indicates whether this is a tessellator stream - [27:04] 0x0 - [03:00] stream selector (0..15) - -Stream Data Definition (single DWORD token) - Vertex Input Register Load - [31:29] 0x2 - [28] 0x0 - [27:20] 0x0 - [19:16] type (dimensionality and data type) - [15:04] 0x0 - [03:00] vertex register address (0..15) - Data Skip (no register load) - [31:29] 0x2 - [28] 0x1 - [27:20] 0x0 - [19:16] count of DWORDS to skip over (0..15) - [15:00] 0x0 - Vertex Input Memory from Tessellator Data (single DWORD token) - [31:29] 0x3 - [28] indicates whether data is normals or u/v - [27:24] 0x0 - [23:20] vertex register address (0..15) - [19:16] type (dimensionality) - [15:04] 0x0 - [03:00] vertex register address (0..15) - -Constant Memory from Shader (multiple DWORD token) - [31:29] 0x4 - [28:25] count of 4*DWORD constants to load (0..15) - [24:07] 0x0 - [06:00] constant memory address (0..95) - -Extension Token (single or multiple DWORD token) - [31:29] 0x5 - [28:24] count of additional DWORDs in token (0..31) - [23:00] extension-specific information - -End-of-array token (single DWORD token) - [31:29] 0x7 - [28:00] 0x1fffffff - -The stream selector token must be immediately followed by a contiguous set of stream data definition tokens. This token sequence fully defines that stream, including the set of elements within the stream, the order in which the elements appear, the type of each element, and the vertex register into which to load an element. -Streams are allowed to include data which is not loaded into a vertex register, thus allowing data which is not used for this shader to exist in the vertex stream. This skipped data is defined only by a count of DWORDs to skip over, since the type information is irrelevant. -The token sequence: -Stream Select: stream=0 -Stream Data Definition (Load): type=FLOAT3; register=3 -Stream Data Definition (Load): type=FLOAT3; register=4 -Stream Data Definition (Skip): count=2 -Stream Data Definition (Load): type=FLOAT2; register=7 - -defines stream zero to consist of 4 elements, 3 of which are loaded into registers and the fourth skipped over. Register 3 is loaded with the first three DWORDs in each vertex interpreted as FLOAT data. Register 4 is loaded with the 4th, 5th, and 6th DWORDs interpreted as FLOAT data. The next two DWORDs (7th and 8th) are skipped over and not loaded into any vertex input register. Register 7 is loaded with the 9th and 10th DWORDS interpreted as FLOAT data. -Placing of tokens other than NOPs between the Stream Selector and Stream Data Definition tokens is disallowed. - -*/ - -#ifndef __COMMONHALDEFINES -#define __COMMONHALDEFINES - -typedef enum _D3DVSD_TOKENTYPE -{ - D3DVSD_TOKEN_NOP = 0, // NOP or extension - D3DVSD_TOKEN_STREAM, // stream selector - D3DVSD_TOKEN_STREAMDATA, // stream data definition (map to vertex input memory) - D3DVSD_TOKEN_TESSELLATOR, // vertex input memory from tessellator - D3DVSD_TOKEN_CONSTMEM, // constant memory from shader - D3DVSD_TOKEN_EXT, // extension - D3DVSD_TOKEN_END = 7, // end-of-array (requires all DWORD bits to be 1) - D3DVSD_FORCE_DWORD = 0x7fffffff,// force 32-bit size enum -} D3DVSD_TOKENTYPE; -#endif __COMMONHALDEFINES - -#define D3DVSD_TOKENTYPESHIFT 29 -#define D3DVSD_TOKENTYPEMASK (7 << D3DVSD_TOKENTYPESHIFT) - -#define D3DVSD_STREAMNUMBERSHIFT 0 -#define D3DVSD_STREAMNUMBERMASK (0xF << D3DVSD_STREAMNUMBERSHIFT) - -#define D3DVSD_DATALOADTYPESHIFT 28 -#define D3DVSD_DATALOADTYPEMASK (0x1 << D3DVSD_DATALOADTYPESHIFT) - -#define D3DVSD_DATATYPESHIFT 16 -#define D3DVSD_DATATYPEMASK (0xF << D3DVSD_DATATYPESHIFT) - -#define D3DVSD_SKIPCOUNTSHIFT 16 -#define D3DVSD_SKIPCOUNTMASK (0xF << D3DVSD_SKIPCOUNTSHIFT) - -#define D3DVSD_VERTEXREGSHIFT 0 -#define D3DVSD_VERTEXREGMASK (0x1F << D3DVSD_VERTEXREGSHIFT) - -#define D3DVSD_VERTEXREGINSHIFT 20 -#define D3DVSD_VERTEXREGINMASK (0xF << D3DVSD_VERTEXREGINSHIFT) - -#define D3DVSD_CONSTCOUNTSHIFT 25 -#define D3DVSD_CONSTCOUNTMASK (0xF << D3DVSD_CONSTCOUNTSHIFT) - -#define D3DVSD_CONSTADDRESSSHIFT 0 -#define D3DVSD_CONSTADDRESSMASK (0x7F << D3DVSD_CONSTADDRESSSHIFT) - -#define D3DVSD_CONSTRSSHIFT 16 -#define D3DVSD_CONSTRSMASK (0x1FFF << D3DVSD_CONSTRSSHIFT) - -#define D3DVSD_EXTCOUNTSHIFT 24 -#define D3DVSD_EXTCOUNTMASK (0x1F << D3DVSD_EXTCOUNTSHIFT) - -#define D3DVSD_EXTINFOSHIFT 0 -#define D3DVSD_EXTINFOMASK (0xFFFFFF << D3DVSD_EXTINFOSHIFT) - -#define D3DVSD_MAKETOKENTYPE(tokenType) ((tokenType << D3DVSD_TOKENTYPESHIFT) & D3DVSD_TOKENTYPEMASK) - -// macros for generation of CreateVertexShader Declaration token array - -// Set current stream -// _StreamNumber [0..(MaxStreams-1)] stream to get data from -// -#define D3DVSD_STREAM( _StreamNumber ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (_StreamNumber)) - -// Set tessellator stream -// -#define D3DVSD_STREAMTESSSHIFT 28 -#define D3DVSD_STREAMTESSMASK (1 << D3DVSD_STREAMTESSSHIFT) -#define D3DVSD_STREAM_TESS( ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAM) | (D3DVSD_STREAMTESSMASK)) - -// bind single vertex register to vertex element from vertex stream -// -// _VertexRegister [0..15] address of the vertex register -// _Type [D3DVSDT_*] dimensionality and arithmetic data type - -#define D3DVSD_REG( _VertexRegister, _Type ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | \ - ((_Type) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Skip _DWORDCount DWORDs in vertex -// -#define D3DVSD_SKIP( _DWORDCount ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_STREAMDATA) | 0x10000000 | \ - ((_DWORDCount) << D3DVSD_SKIPCOUNTSHIFT)) - -// load data into vertex shader constant memory -// -// _ConstantAddress [0..95] - address of constant array to begin filling data -// _Count [0..15] - number of constant vectors to load (4 DWORDs each) -// followed by 4*_Count DWORDS of data -// -#define D3DVSD_CONST( _ConstantAddress, _Count ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_CONSTMEM) | \ - ((_Count) << D3DVSD_CONSTCOUNTSHIFT) | (_ConstantAddress)) - -// enable tessellator generated normals -// -// _VertexRegisterIn [0..15] address of vertex register whose input stream -// will be used in normal computation -// _VertexRegisterOut [0..15] address of vertex register to output the normal to -// -#define D3DVSD_TESSNORMAL( _VertexRegisterIn, _VertexRegisterOut ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | \ - ((_VertexRegisterIn) << D3DVSD_VERTEXREGINSHIFT) | \ - ((0x02) << D3DVSD_DATATYPESHIFT) | (_VertexRegisterOut)) - -// enable tessellator generated surface parameters -// -// _VertexRegister [0..15] address of vertex register to output parameters -// -#define D3DVSD_TESSUV( _VertexRegister ) \ - (D3DVSD_MAKETOKENTYPE(D3DVSD_TOKEN_TESSELLATOR) | 0x10000000 | \ - ((0x01) << D3DVSD_DATATYPESHIFT) | (_VertexRegister)) - -// Generates END token -// -#define D3DVSD_END() 0xFFFFFFFF - -// Generates NOP token -#define D3DVSD_NOP() 0x00000000 - -#endif /* DIRECT3D_VERSION >= 0x0900 */ - -#endif /* _D3DHAL_H */ - - diff --git a/qt-correction-tool/pub/ddk/d3dhalex.h b/qt-correction-tool/pub/ddk/d3dhalex.h deleted file mode 100644 index 17c9cc0..0000000 --- a/qt-correction-tool/pub/ddk/d3dhalex.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef _D3DHALEX_H -#define _D3DHALEX_H - -//----------------------------------------------------------------------------- -// -// Copyright (C) Microsoft Corporation. All Rights Reserved. -// -// File: d3dhalex.h -// Content: Direct3D HAL Extensions and Helpers include file -// This file contains definitions and macros which although not -// essential for building a driver are useful helpers and -// utilities. -// -//----------------------------------------------------------------------------- - -//----------------------------------------------------------------------------- -// -// Macros to help with handling the new GetDriverInfo2 mechanism. The following -// macros assist with handling the GetDriverInfo2 sub-call of GetDriverInfo. -// Two of the macros are simplified ways of differentiating between -// GetDriverInfo2 calls and DDStereoMode calls. The others are simplified ways -// of getting the data structures associated with those two calls. -// -// The following code fragment demonstrates how to handle GetDriverInfo2 using -// these macros. Compare this with the code fragment in d3dhal.h -// -// D3DCAPS8 myD3DCaps8; -// -// DWORD CALLBACK -// DdGetDriverInfo(LPDDHAL_GETDRIVERINFODATA lpData) -// { -// if (MATCH_GUID((lpData->guidInfo), GUID_GetDriverInfo2) ) -// { -// ASSERT(NULL != lpData); -// ASSERT(NULL != lpData->lpvData); -// -// // Is this a call to GetDriverInfo2 or DDStereoMode? -// if (D3DGDI_IS_GDI2(lpData)) -// { -// // Yes, its a call to GetDriverInfo2, fetch the -// // DD_GETDRIVERINFO2DATA data structure. -// DD_GETDRIVERINFO2DATA* pgdi2 = D3DGDI_GET_GDI2_DATA(lpData); -// ASSERT(NULL != pgdi2); -// -// // What type of request is this? -// switch (pgdi2->dwType) -// { -// case D3DGDI2_TYPE_GETD3DCAPS8: -// { -// // The runtime is requesting the DX8 D3D caps so -// // copy them over now. -// -// // It should be noted that the dwExpectedSize field -// // of DD_GETDRIVERINFODATA is not used for -// // GetDriverInfo2 calls and should be ignored. -// size_t copySize = min(sizeof(myD3DCaps8), pgdi2->dwExpectedSize); -// memcpy(lpData->lpvData, &myD3DCaps8, copySize); -// lpData->dwActualSize = copySize; -// lpData->ddRVal = DD_OK; -// return DDHAL_DRIVER_HANDLED; -// } -// default: -// // For any other GetDriverInfo2 types not handled -// // or understood by the driver set an ddRVal of -// // DDERR_CURRENTLYNOTAVAIL and return -// // DDHAL_DRIVER_HANDLED. -// return DDHAL_DRIVER_HANDLED; -// } -// } -// else -// { -// // It must be a call a request for stereo mode support. -// // Fetch the stereo mode data -// DD_STEREOMODE* pStereoMode = D3DGDI_GET_STEREOMODE_DATA(pData); -// ASSERT(NULL != pStereoMode); -// -// // Process the stereo mode request... -// lpData->dwActualSize = sizeof(DD_STEREOMODE); -// lpData->ddRVal = DD_OK; -// return DDHAL_DRIVER_HANDLED; -// } -// } -// -// // Handle any other device GUIDs... -// -// } // DdGetDriverInfo -// -//----------------------------------------------------------------------------- - -// -// Macros to determine what type of call a call to GetDriverInfo with the -// GUID GUID_GetDriverInfo2/GUID_DDStereoMode. A GetDriverInfo2 call or -// a DDStereoMode call. -// -#define D3DGDI_IS_GDI2(pData) \ - ((((DD_GETDRIVERINFO2DATA*)(pData->lpvData))->dwMagic) == D3DGDI2_MAGIC) - -#define D3DGDI_IS_STEREOMODE(pData) \ - ((((DD_STEREOMODE*) (pData->lpvData))->dwHeight) != D3DGDI2_MAGIC) - -// -// Macros to return the appropriate GetDriverInfo data structure for a -// call to GetDriverInfo with the GUID GUID_GetDriverInfo2/GUID_DDStereoMode. -// -#define D3DGDI_GET_GDI2_DATA(pData) \ - (D3DGDI_IS_GDI2(pData) ? (((DD_GETDRIVERINFO2DATA*)(pData->lpvData))) : NULL) - -#define D3DGDI_GET_STEREOMODE_DATA(pData) \ - (D3DGDI_IS_STEREOMODE(pData) ? (((DD_STEREOMODE*)(pData->lpvData))) : NULL) - -#endif /* _D3DHALEX_H */ - - diff --git a/qt-correction-tool/pub/ddk/d3dkmdt.h b/qt-correction-tool/pub/ddk/d3dkmdt.h deleted file mode 100644 index 15fa8f5..0000000 --- a/qt-correction-tool/pub/ddk/d3dkmdt.h +++ /dev/null @@ -1,1524 +0,0 @@ -/******************************Module*Header**********************************\ -* -* Module Name: d3dkmdt.h -* -* Content: Longhorn Display Driver Model (LDDM) kernel mode -* data type definitions -* -* Copyright (c) 2004 Microsoft Corporation. All rights reserved. -\*****************************************************************************/ -#ifndef _D3DKMDT_H -#define _D3DKMDT_H - -#if !defined(_D3DKMDDI_H_) && \ - !defined(_DXGDMM_H_) && \ - !defined(_VIDPRIV_H_) && \ - !defined(_DISPMPRT_H_) && \ - !defined(_DMM_DIAG_H_) && \ - !defined(_D3DKMTHK_H_) - #error This header should not be included directly! -#endif - -#include -#include - -#pragma warning(push) -#pragma warning(disable:4201) // anonymous unions warning - -// -// Available only for Vista (LONGHORN) and later and for -// multiplatform tools such as debugger extensions -// -#if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) - -// -// Hardcoded overlay count -// -#define D3DKMDT_MAX_OVERLAYS_BITCOUNT 2 -#define D3DKMDT_MAX_OVERLAYS (1 << D3DKMDT_MAX_OVERLAYS_BITCOUNT) - - -//////////////////// VidPN management DDI handles ///////////////////////////////////////////////////////// -DECLARE_HANDLE(D3DKMDT_HVIDPN); -DECLARE_HANDLE(D3DKMDT_HVIDEOPRESENTSOURCESET); -DECLARE_HANDLE(D3DKMDT_HVIDEOPRESENTTARGETSET); -DECLARE_HANDLE(D3DKMDT_HVIDPNTOPOLOGY); -DECLARE_HANDLE(D3DKMDT_HVIDPNSOURCEMODESET); -DECLARE_HANDLE(D3DKMDT_HVIDPNTARGETMODESET); -DECLARE_HANDLE(D3DKMDT_HMONITORSOURCEMODESET); -DECLARE_HANDLE(D3DKMDT_HMONITORFREQUENCYRANGESET); -DECLARE_HANDLE(D3DKMDT_HMONITORDESCRIPTORSET); - -// Alias VOID* to make LDDM kernel mode interface prototypes using adapter handles self-explanatory. -typedef VOID* D3DKMDT_ADAPTER; - - - -//////////////////// VidPN management DDI constants ///////////////////////////////////////////////////////// - -// Special values representing that given variable has not been initialized to a valid value intended -// to catch development time errors. A valid parameter should never have this value. -#define D3DKMDT_DIMENSION_UNINITIALIZED (UINT)(~0) -#define D3DKMDT_FREQUENCY_UNINITIALIZED (UINT)(~0) - -// Special values representing that given parameter is not-specified. -// A parameter having this value should be ignored. -#define D3DKMDT_DIMENSION_NOTSPECIFIED (UINT)(~1) -#define D3DKMDT_FREQUENCY_NOTSPECIFIED (UINT)(~1) - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video mode standard descriptor type, listing standards that are explicitly supported by Windows. -// -// Remarks: This enum specifies based on which standard the video signal timing parameters should be computed. -// Note that NTSC, PAL, and SECAM mode variants are treated as individual groups to avoid complicating -// the DDI with the notion of "sub-standard" (because they don't differ from each other in the parameters -// used to describe the video signal in the DDI and the parameters that they do differ in are of no -// interest to us in DMM). -// -typedef enum _D3DKMDT_VIDEO_SIGNAL_STANDARD -{ - D3DKMDT_VSS_UNINITIALIZED = 0, - - // VESA standards - D3DKMDT_VSS_VESA_DMT = 1, // See VESA Display Monitor Timings specification - D3DKMDT_VSS_VESA_GTF = 2, // See VESA Generalized Timing Formula standard - D3DKMDT_VSS_VESA_CVT = 3, // See VESA Coordinated Video Timings standard - - // De-facto standards - D3DKMDT_VSS_IBM = 4, - D3DKMDT_VSS_APPLE = 5, - - // Legacy STV standards W x H{i|p} @ ( VR / HR ) - D3DKMDT_VSS_NTSC_M = 6, // 720 x 525i @ (59.94 [Hz] / 15,734.27[Hz]) - D3DKMDT_VSS_NTSC_J = 7, // 720 x 525i @ (59.94 [Hz] / 15,734.27[Hz]) - D3DKMDT_VSS_NTSC_443 = 8, // 720 x 525i @ (59.94 [Hz] / 15,734.27[Hz]) - D3DKMDT_VSS_PAL_B = 9, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_B1 = 10, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_G = 11, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_H = 12, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_I = 13, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_D = 14, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_N = 15, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_NC = 16, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_B = 17, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_D = 18, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_G = 19, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_H = 20, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_K = 21, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_K1 = 22, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_L = 23, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_SECAM_L1 = 24, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - - // CEA/EIA standards - D3DKMDT_VSS_EIA_861 = 25, - D3DKMDT_VSS_EIA_861A = 26, - D3DKMDT_VSS_EIA_861B = 27, - - // More legacy STV standards - D3DKMDT_VSS_PAL_K = 28, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_K1 = 29, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_L = 30, // 720 x 625i @ (50 [Hz] / 15,625 [Hz]) - D3DKMDT_VSS_PAL_M = 31, // 720 x 525i @ (59.94 [Hz] / 15,734 [Hz]) - - D3DKMDT_VSS_OTHER = 255 -} -D3DKMDT_VIDEO_SIGNAL_STANDARD; - - - -//////////////////// Video present sources ////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present source descriptor type. -// -typedef struct _D3DKMDT_VIDEO_PRESENT_SOURCE -{ - // Unique ID used to reference the respective video present source by the miniport and the OS. - D3DDDI_VIDEO_PRESENT_SOURCE_ID Id; - - // Other video present source descriptor properties go here. - DWORD dwReserved; -} -D3DKMDT_VIDEO_PRESENT_SOURCE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN source mode enumeration type descriptor type. -// -// Remarks: This type is used to specify whether a VidPN source mode is a graphics or a text mode -// (see VIDEO_PRESENT_SOURCE_MODE for more details). -// -typedef enum _D3DKMDT_VIDPN_SOURCE_MODE_TYPE -{ - D3DKMDT_RMT_UNINITIALIZED = 0, - D3DKMDT_RMT_GRAPHICS = 1, - D3DKMDT_RMT_TEXT = 2 -} -D3DKMDT_VIDPN_SOURCE_MODE_TYPE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Pixel value access mode descriptor type. -// -// Remarks: Use Direct to represent VidPN source modes with colors stored directly in the primary surface. -// Use PresetPalette to represent VidPN source modes with colors' indices stored in the primary -// surface and actual color values stored in a palette specific to the video card, that must -// be queried from the video miniport. -// Use SettablePalette to represent VidPN source modes with colors' indices stored in the primary -// surface and actual color values stored in a settable palette that can be dynamically set on -// the video card, by specifying it to the video miniport. -// -typedef enum _D3DKMDT_PIXEL_VALUE_ACCESS_MODE -{ - D3DKMDT_PVAM_UNINITIALIZED = 0, - D3DKMDT_PVAM_DIRECT = 1, - D3DKMDT_PVAM_PRESETPALETTE = 2, - D3DKMDT_PVAM_SETTABLEPALETTE = 3, -} -D3DKMDT_PIXEL_VALUE_ACCESS_MODE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Descriptor type of the color basis with respect to which the pixels' colors are expanded, -// or conversely, based on which the color values are synthesized. -// -// Remarks: The commonly used color bases in graphics industry are RGB, which has the basis (red, green, blue), -// as well as YPbPr and YCbCr, which have scaled variants of basis: -// (1, blue-1, red-1)*intensity(red,green,blue). -// Tri-stimulus linear RGB is well suited for real-time rendering, since most filtering algorithms -// use tri-stimulus values to approximate light's spectral transformations caused by its interaction -// with the environment, primarily due to the fact that there is a linear relationship between the -// perceived light level and the light's spectral intensity. Ideally, all processing of video content -// (i.e. scaling, filtering, etc) should be performed in a linear RGB space. -// Y'PbPr spaces store data using a nonlinear curve which is approximately the inverse of a gamma -// 2.2 curve (i.e. x^0.45). This allows more precision to be stored in darker intensities where the -// human eye is more sensitive. -// sRGB (more accurately, sR'G'B') stores light intensities relative to a gamma curve. -// scRGB stores linear values and requires much higher precision to represent the same perceptually -// similar signal. -// The light-intensity based YPbPr and YCbCr is better suited for persistence of pre-rendered content, -// such as video streaming. This is due to the fact that a human visual system is more responsive to -// small differences in photons' intensity rather than frequency (i.e. perceived color), and, hence, -// a light-intensity based color expansion over a finite dynamic range, yields a better perceptual -// image quality for the human eye than a tri-stimulus based color expansion in that same range -// (e.g non-linear Y8Cb8Cr8 appears slightly better than R8G8B8 and is comparable to R9G9B9). -// To represent monochrome modes, use Intensity. Grayscale imaging is heavily used in medical imaging. -// Note: the apostrophe notation Y'PbPr is used to remind you that you are working with non-linear data. -// -typedef enum _D3DKMDT_COLOR_BASIS -{ - D3DKMDT_CB_UNINITIALIZED = 0, - D3DKMDT_CB_INTENSITY = 1, - D3DKMDT_CB_SRGB = 2, - D3DKMDT_CB_SCRGB = 3, - D3DKMDT_CB_YCBCR = 4, - D3DKMDT_CB_YPBPR = 5, -} -D3DKMDT_COLOR_BASIS; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Descriptor type of the color coefficients dynamic range, whose linear combination with the -// respective color basis produces final pixel values. -// -// Remarks: Examples include (5,6,5,0) for R5G6B5, (8,8,8,8) for R8G8B8A8, and (24, 0, 0, 0) for 24-bit -// grayscale pixel encoding format. -// NOTE: Currently this is only used for target modes, none of which has the 4th channel (e.g. alpha). -// We are keeping the 4th field for extensibility purpose to avoid miniport interface revision -// if 4-channel video interfaces became available between display adapter and monitor. -// -typedef struct _D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES -{ - UINT FirstChannel; - UINT SecondChannel; - UINT ThirdChannel; - UINT FourthChannel; -} -D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: 2D region descriptor type. -// -// Remarks: We define our own rather than reusing SIZE type to avoid dependency on SDK headers. -// -typedef struct _D3DKMDT_2DREGION -{ - UINT cx; - UINT cy; -} -D3DKMDT_2DREGION; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: 2D offset descriptor type. -// -// Remarks: We define our own rather than reusing SIZE type to avoid dependency on SDK headers. -// -typedef D3DKMDT_2DREGION D3DKMDT_2DOFFSET; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Graphics video present source mode descriptor type. -// -// Remarks: Graphics video present source mode is the dominantly used subtype of the video present source -// modes (other being the text video present source mode). -// Note that whenever video present source mode's visible size, -// VIDEO_PRESENT_SOURCE_MODE.GRAPHICS_RENDERING_FORMAT.sizeVisible is not equal to the respective -// video mode's visible size, VIDEO_PRESENT_TARGET_MODE.sizeVisible, h/w scaling is undertaken by -// the video output codec. -// -// Miniport is free to support any D3D pixel format for its graphics modes that is meaningful -// as a primary surface pixel format. No validation for an appropriately used pixel format shall be -// done in kernel-mode. If this turns out to be a problem, WHQL can enforce a certain list of pixel -// formats from user-mode. -// -// This descriptor does NOT include pixel value sub-channel bit masks since: -// 1. Primary goal of such descriptors is to allow application developers to write extensible code -// that can leverage future pixel formats. -// 2. As it stands, however, historically numerous application developers have failed to properly -// implement generic pixel value decoding algorithms and pixel value sub-channel bit masks were -// dropped in DX8. -// 3. Main idea: it's best to force application developers to test every scenario they claim to -// support by making them use look-up tables that map D3D pixel format enums into pixel value -// sub-channel bit masks. -// 4. To facilitate application development, it would make sense to ship a helper user-mode library -// that does the enum-to-bitmask mapping for the application developers. They would still need -// to code their application against existing pixel value formats but not maintain look-up tables, -// for every application. -// 5. Need for pixel value sub-channel bitmasks exposure is further reduced by the fact that they are -// only truly useful for linear surface formats with well defined integer RGB encoded pixel values. -// i. When surface format has a non-linear pixel layout -// (i.e. VIDEO_PRESENT_SOURCE.VidPSContentLayout = VPSCL_Linear), -// knowledge of pixel value sub-channel bitmasks will not help the developer to know how to -// access each pixel in the surface. -// ii. Most four-CC formats (e.g. NVT4/NVT5) fall into this category and one should test against -// every format to be supported by the application, because most of them imply texture layouts -// that aren't easily described. -// iii. Also the bitmasks won't work for floating point pixel formats. -// -typedef struct _D3DKMDT_GRAPHICS_RENDERING_FORMAT -{ - // Size of the primary surface required for this VidPN source mode. - D3DKMDT_2DREGION PrimSurfSize; - - // Size of the visible part of the primary surface, used for panned modes including zoom modes. - D3DKMDT_2DREGION VisibleRegionSize; - - // Number of bytes between the start of one scan line and the next. - DWORD Stride; - - // Pixel format type - D3DDDIFORMAT PixelFormat; - - // Color basis with respect to which rendering client encodes pixel values. - D3DKMDT_COLOR_BASIS ColorBasis; - - // Access mode for the pixel value information. - D3DKMDT_PIXEL_VALUE_ACCESS_MODE PixelValueAccessMode; -} -D3DKMDT_GRAPHICS_RENDERING_FORMAT; - - -typedef enum _D3DKMDT_TEXT_RENDERING_FORMAT -{ - D3DKMDT_TRF_UNINITIALIZED = 0 -} -D3DKMDT_TEXT_RENDERING_FORMAT; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present source mode ID type. -typedef UINT D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN source mode descriptor type. -// -// Remarks: VidPN source (rendering) mode is the mode of operation of a given video present source and determines -// the format of this source's primary surface to which the graphics subsystem is rendering -// the visual image to be presented to the user, and from which the video output codec is reading -// the visual image content to be converted into a respective video mode signal. -// -typedef struct _D3DKMDT_VIDPN_SOURCE_MODE -{ - D3DKMDT_VIDEO_PRESENT_SOURCE_MODE_ID Id; - - // Specifies whether the mode is a graphics or a text rendering mode. - D3DKMDT_VIDPN_SOURCE_MODE_TYPE Type; - - union - { - // Descriptor of the graphics rendering mode (valid only if Type==D3DKMDT_RMT_GRAPHICS). - D3DKMDT_GRAPHICS_RENDERING_FORMAT Graphics; - - // Descriptor of the text rendering mode (valid only if Type==D3DKMDT_RMT_TEXT). - D3DKMDT_TEXT_RENDERING_FORMAT Text; - } - Format; -} -D3DKMDT_VIDPN_SOURCE_MODE; - - - -//////////////////////// Video present targets/////////////////////////////////////////////////////////////// - - -// NOTE: Child device (e.g. video output) HPD awareness is used to represent the level of external -// device (e.g. monitor) connectivity sensed by a display adapter. Child device can either be -// always connected to an external device (e.g. integrated LCD in a mobile system) or have: -// 1. No HPD-awareness iff miniport is *not* aware of external device arrivals/departures -// whether through interrupts or polling, -// 2. Polled HPD-awareness iff miniport can not asynchronously notify the OS about external -// device arrivals/departures, but OS can sporadically poll for its presence, and of a -// monitor, causing visual artifacts on each poll. -// 3. Interruptible HPD-awareness iff miniport can asynchronously notify the OS about -// external device arrivals/departures. -typedef enum _DXGK_CHILD_DEVICE_HPD_AWARENESS { - HpdAwarenessUninitialized = 0, - HpdAwarenessAlwaysConnected = 1, - HpdAwarenessNone = 2, - HpdAwarenessPolled = 3, - HpdAwarenessInterruptible = 4 -} DXGK_CHILD_DEVICE_HPD_AWARENESS, *PDXGK_CHILD_DEVICE_HPD_AWARENESS; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor orientation descriptor type. -// -typedef enum _D3DKMDT_MONITOR_ORIENTATION -{ - D3DKMDT_MO_UNINITIALIZED = 0, - D3DKMDT_MO_0DEG = 1, - D3DKMDT_MO_90DEG = 2, - D3DKMDT_MO_180DEG = 3, - D3DKMDT_MO_270DEG = 4 -} -D3DKMDT_MONITOR_ORIENTATION; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video output technology descriptor type. -// -// Remarks: Video output technology is used to determine the hard-coded list of video modes supported -// by the monitor, when monitor descriptor is not available. -// -typedef enum _D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY -{ - D3DKMDT_VOT_UNINITIALIZED = -2, - D3DKMDT_VOT_OTHER = -1, - D3DKMDT_VOT_HD15 = 0, - D3DKMDT_VOT_SVIDEO = 1, - D3DKMDT_VOT_COMPOSITE_VIDEO = 2, - D3DKMDT_VOT_COMPONENT_VIDEO = 3, - D3DKMDT_VOT_DVI = 4, - D3DKMDT_VOT_HDMI = 5, - D3DKMDT_VOT_LVDS = 6, - D3DKMDT_VOT_D_JPN = 8, - D3DKMDT_VOT_SDI = 9, - D3DKMDT_VOT_DISPLAYPORT_EXTERNAL = 10, - D3DKMDT_VOT_DISPLAYPORT_EMBEDDED = 11, - D3DKMDT_VOT_UDI_EXTERNAL = 12, - D3DKMDT_VOT_UDI_EMBEDDED = 13, - D3DKMDT_VOT_SDTVDONGLE = 14, - D3DKMDT_VOT_INTERNAL = 0x80000000, - - // Remove when DDI is unlocked. - D3DKMDT_VOT_SVIDEO_4PIN = D3DKMDT_VOT_SVIDEO, - D3DKMDT_VOT_SVIDEO_7PIN = D3DKMDT_VOT_SVIDEO, - D3DKMDT_VOT_RF = D3DKMDT_VOT_COMPOSITE_VIDEO, - D3DKMDT_VOT_RCA_3COMPONENT = D3DKMDT_VOT_COMPONENT_VIDEO, - D3DKMDT_VOT_BNC = D3DKMDT_VOT_COMPONENT_VIDEO, -} -D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor orientation awareness descriptor type. -// -typedef enum _D3DKMDT_MONITOR_ORIENTATION_AWARENESS -{ - D3DKMDT_MOA_UNINITIALIZED = 0, - D3DKMDT_MOA_NONE = 1, - D3DKMDT_MOA_POLLED = 2, - D3DKMDT_MOA_INTERRUPTIBLE = 3 -} -D3DKMDT_MONITOR_ORIENTATION_AWARENESS; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target descriptor type. -// -typedef struct _D3DKMDT_VIDEO_PRESENT_TARGET -{ - // Unique ID used to reference the respective video present target by the miniport and the OS. - D3DDDI_VIDEO_PRESENT_TARGET_ID Id; - - // Type of the video output technology (see D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY for more details). - D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY VideoOutputTechnology; - - // Type of the video output's HPD awareness (see D3DKMDT_VIDEO_OUTPUT_HPD_AWARENESS for more details). - DXGK_CHILD_DEVICE_HPD_AWARENESS VideoOutputHpdAwareness; - - D3DKMDT_MONITOR_ORIENTATION_AWARENESS MonitorOrientationAwareness; - - // NOTE: On monitor arrival, OS will leave monitor mode set empty for monitors connected to video outputs - // supporting SDTV modes, expecting miniport to populate modes it wants to expose for that monitor. - // - // NOTE: This predicate is also used when selecting video output for presentation on a TV via - // APIs that don't support explicit specification of monitors/video outputs (e.g. VIDEOPARAMETERS). - // - // Predicate specifying whether corresponding video output supports SDTV modes. - BOOLEAN SupportsSdtvModes; -} -D3DKMDT_VIDEO_PRESENT_TARGET; - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode GTF compliance descriptor type. -typedef enum _D3DKMDT_GTFCOMPLIANCE -{ - D3DKMDT_GTF_UNINITIALIZED = 0, - D3DKMDT_GTF_COMPLIANT = 1, - D3DKMDT_GTF_NOTCOMPLIANT = 2 -} -D3DKMDT_GTFCOMPLIANCE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN target mode preference descriptor type. -typedef enum _D3DKMDT_MODE_PREFERENCE -{ - D3DKMDT_MP_UNINITIALIZED = 0, - D3DKMDT_MP_PREFERRED = 1, - D3DKMDT_MP_NOTPREFERRED = 2, -} -D3DKMDT_MODE_PREFERENCE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video signal info descriptor type. -// -// Remarks: Video signal info is the mode of operation of a given video output that's driving a connected -// moitor and is driven by an internal video output codec. -// Note that this descriptor supersedes subset of the XDDM's VIDEO_MODE_INFORMATION structure -// related to video mode. In XDDM, both video and rendering modes were described in this struct. -// LDDM separates these two notions, and hence their descriptors. -// The video standard field, vidStandard, should be used for video mode comparisons, when it's -// set to a well-defined video standard. Note that most of the standard modes do not comply with -// the VESA GTF frequency constraints. -// -// If color basis of the target mode does not correspond to that of the source mode, appropriate -// color conversion is performed by the respective video output codec. -// -typedef struct _D3DKMDT_VIDEO_SIGNAL_INFO -{ - // Video mode standard this mode is defined by (if any). - D3DKMDT_VIDEO_SIGNAL_STANDARD VideoStandard; - - // Video signal's size in pixels (i.e. HTotal & VTotal). - D3DKMDT_2DREGION TotalSize; - - // Presented image's size in active pixels (i.e. HActive & VActive). - D3DKMDT_2DREGION ActiveSize; - - // Vertical refresh frequency (in Hz). - D3DDDI_RATIONAL VSyncFreq; - - // Horizontal refresh frequency (in Hz). - D3DDDI_RATIONAL HSyncFreq; - - // Pixel clock rate (in Hz). - SIZE_T PixelRate; - - // Scan line ordering (e.g. progressive, interlaced). - D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING ScanLineOrdering; -} -D3DKMDT_VIDEO_SIGNAL_INFO; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode ID type. -typedef UINT D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode descriptor type. -typedef struct _D3DKMDT_VIDPN_TARGET_MODE -{ - // Identifier unique within the set this mode is part of. - D3DKMDT_VIDEO_PRESENT_TARGET_MODE_ID Id; - - // Video signal parameters. - D3DKMDT_VIDEO_SIGNAL_INFO VideoSignalInfo; - - // Predicate specifying whether this mode is preferred by the adapter given the mode pinned on - // the source of the respective present path. - D3DKMDT_MODE_PREFERENCE Preference; -} -D3DKMDT_VIDPN_TARGET_MODE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VESA Display ID detailed timing type I. - -#pragma pack(push, 1) -#define DISPLAYID_DETAILED_TIMING_TYPE_I_SIZE 20 - -// Enum specifying monitor's aspect ratio (see DISPLAYID_DETAILED_TIMING_TYPE_I.AspectRatio) -enum _DISPLAYID_DETAILED_TIMING_TYPE_I_ASPECT_RATIO -{ - DIDDT1_AspectRatio_1x1 = 0, // 000 = 1:1 - DIDDT1_AspectRatio_5x4 = 1, // 001 = 5:4 - DIDDT1_AspectRatio_4x3 = 2, // 010 = 4:3 - DIDDT1_AspectRatio_15x9 = 3, // 011 = 15:9 - DIDDT1_AspectRatio_16x9 = 4, // 100 = 16:9 - DIDDT1_AspectRatio_16x10 = 5, // 101 = 16:10 -}; - -enum _DISPLAYID_DETAILED_TIMING_TYPE_I_SCANNING_MODE -{ - DIDDT1_Progressive = 0, // 0 = Progressive mode - DIDDT1_Interlaced = 1, // 1 = Interlaced mode -}; - -enum _DISPLAYID_DETAILED_TIMING_TYPE_I_STEREO_MODE -{ - DIDDT1_Monoscopic = 0, // 00 = Monoscopic (no stereo) mode - DIDDT1_Stereo = 1, // 01 = Stereo mode - DIDDT1_Dependent = 2, // 10 = Stereo mode despends on user action -}; - -enum _DISPLAYID_DETAILED_TIMING_TYPE_I_SYNC_POLARITY -{ - DIDDT1_Sync_Positive = 0, - DIDDT1_Sync_Negative = 1, -}; - -typedef struct _DISPLAYID_DETAILED_TIMING_TYPE_I -{ - struct - { - ULONG PixelClock : 24; // Pixel clock / 10000 - ULONG AspectRatio : 3; // Aspect ratio - ULONG Reserved : 1; - ULONG ScanningType : 1; // Frame scanning type - ULONG StereoMode : 2; // 3D stereo mode - ULONG PreferredTiming : 1; // preferred timing - }; - - USHORT HorizontalActivePixels; // Horizontal active image pixel number - USHORT HorizontalBlankPixels; // Horizontal blank pixel number - struct - { - USHORT HorizontalFrontPorch : 15; // Horizontal offset (front porch) pixel number - USHORT HorizontalSyncPolarity : 1; // Horizontal sync polarity - }; - USHORT HorizontalSyncWidth; // Horizontal sync pixel number - - USHORT VerticalActiveLines; // Number of lines of vertical active image - USHORT VerticalBlankLines; // Number of lines of vertical blank - struct - { - USHORT VerticalFrontPorch : 15; // Number of lines of vertical offset (front porch) - USHORT VerticalSyncPolarity : 1; // Vertical sync polarity - }; - USHORT VerticalSyncWidth; // Number of lines of vertical sync -}DISPLAYID_DETAILED_TIMING_TYPE_I; - -C_ASSERT(sizeof(DISPLAYID_DETAILED_TIMING_TYPE_I) == DISPLAYID_DETAILED_TIMING_TYPE_I_SIZE); - -#pragma pack(pop) - -typedef struct _DXGK_TARGETMODE_DETAIL_TIMING -{ - // Video standard this detail timing comes from. - D3DKMDT_VIDEO_SIGNAL_STANDARD VideoStandard; - - // ID of this detail timing in VideoStandard. - UINT TimingId; - - // Detail timing. - DISPLAYID_DETAILED_TIMING_TYPE_I DetailTiming; -}DXGK_TARGETMODE_DETAIL_TIMING; - - -// Structure of hardware capability -typedef struct _D3DKMDT_VIDPN_HW_CAPABILITY -{ - UINT DriverRotation : 1; - UINT DriverScaling : 1; - UINT DriverCloning : 1; - UINT DriverColorConvert : 1; - UINT DriverLinkedAdapaterOutput : 1; - UINT DriverRemoteDisplay : 1; - UINT Reserved : 26; -} -D3DKMDT_VIDPN_HW_CAPABILITY; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode ID type. -typedef UINT D3DKMDT_MONITOR_SOURCE_MODE_ID; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor capability origin type. -typedef enum _D3DKMDT_MONITOR_CAPABILITIES_ORIGIN -{ - D3DKMDT_MCO_UNINITIALIZED = 0, // mode information is coming from the: - D3DKMDT_MCO_DEFAULTMONITORPROFILE = 1, // + default monitor profile. - D3DKMDT_MCO_MONITORDESCRIPTOR = 2, // + monitor's descriptor. - D3DKMDT_MCO_MONITORDESCRIPTOR_REGISTRYOVERRIDE = 3, // + registry override of the monitor descriptor. - D3DKMDT_MCO_SPECIFICCAP_REGISTRYOVERRIDE = 4, // + registry override of a specific capability. - D3DKMDT_MCO_DRIVER = 5, // + display adapter driver. -} -D3DKMDT_MONITOR_CAPABILITIES_ORIGIN; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor timing type. -typedef enum _D3DKMDT_MONITOR_TIMING_TYPE -{ - D3DKMDT_MTT_UNINITIALIZED = 0, // mode timing information is coming from: - D3DKMDT_MTT_ESTABLISHED = 1, // + established timings block. - D3DKMDT_MTT_STANDARD = 2, // + standard timings block. - D3DKMDT_MTT_EXTRASTANDARD = 3, // + extra standard timings block. - D3DKMDT_MTT_DETAILED = 4, // + detailed timings block. - D3DKMDT_MTT_DEFAULTMONITORPROFILE = 5, // + default monitor profile. - D3DKMDT_MTT_DRIVER = 6, // + display adapter driver. -} -D3DKMDT_MONITOR_TIMING_TYPE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode descriptor type. -typedef struct _D3DKMDT_MONITOR_SOURCE_MODE -{ - // Identifier unique within the set this mode is part of. - D3DKMDT_MONITOR_SOURCE_MODE_ID Id; - - // Video signal parameters. - D3DKMDT_VIDEO_SIGNAL_INFO VideoSignalInfo; - - // Color basis with respect to which monitor is presenting the pixels sampled from the video signal. - D3DKMDT_COLOR_BASIS ColorBasis; - - // Supported dynamic range of each of the pixel color bases' coefficients by the monitor's - // presentational technology - e.g. for a DFP LCD with 12-bit bit-depth, this might be (4, 4, 4, 0). - D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES ColorCoeffDynamicRanges; - - // Origins of the monitor source mode information. - D3DKMDT_MONITOR_CAPABILITIES_ORIGIN Origin; - - // Predicate specifying whether this mode is preferred by the monitor connected to the respective video output. - D3DKMDT_MODE_PREFERENCE Preference; -} -D3DKMDT_MONITOR_SOURCE_MODE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Frequency range type. -typedef struct _D3DKMDT_FREQUENCY_RANGE -{ - // Minimum vertical refresh frequency (in Hz) supported by the monitor. - D3DDDI_RATIONAL MinVSyncFreq; - - // Maximum vertical refresh frequency (in Hz) supported by the monitor. - D3DDDI_RATIONAL MaxVSyncFreq; - - // Minimum horizontal refresh frequency (in Hz) supported by the monitor. - D3DDDI_RATIONAL MinHSyncFreq; - - // Maximum horizontal refresh frequency (in Hz) supported by the monitor. - D3DDDI_RATIONAL MaxHSyncFreq; -} -D3DKMDT_FREQUENCY_RANGE; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor frequency range constraint type. -typedef enum _D3DKMDT_MONITOR_FREQUENCY_RANGE_CONSTRAINT -{ - D3DKMDT_MFRC_UNINITIALIZED = 0, - D3DKMDT_MFRC_ACTIVESIZE = 1, - D3DKMDT_MFRC_MAXPIXELRATE = 2 -} -D3DKMDT_MONITOR_FREQUENCY_RANGE_CONSTRAINT; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Monitor frequency range type. -typedef struct _D3DKMDT_MONITOR_FREQUENCY_RANGE -{ - // Origins of the monitor frequency range information. - D3DKMDT_MONITOR_CAPABILITIES_ORIGIN Origin; - - // Frequency range limits. - D3DKMDT_FREQUENCY_RANGE RangeLimits; - - // Type of the frequency range constraint. - D3DKMDT_MONITOR_FREQUENCY_RANGE_CONSTRAINT ConstraintType; - - // Constraint under which this frequency range is supported. - union - { - // Active region size this frequency range applies to. - D3DKMDT_2DREGION ActiveSize; - - // Maximum pixel clock rate (in Hz) to which this pixel rate applies. - SIZE_T MaxPixelRate; - - } Constraint; -} -D3DKMDT_MONITOR_FREQUENCY_RANGE; - - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// VidPN present paths - -// VidPN present path index used during enumeration of paths satisfying certain criteria -// (e.g. originating from the same source). -typedef SIZE_T D3DKMDT_VIDPN_PRESENT_PATH_INDEX; - -// Purpose: VidPN present path scaling type. -typedef enum _D3DKMDT_VIDPN_PRESENT_PATH_SCALING -{ - D3DKMDT_VPPS_UNINITIALIZED = 0, - - // For the following transformation, spatial resolutions must be equal on both the source and the target. - - // Source content is not modified in any way. - D3DKMDT_VPPS_IDENTITY = 1, - - // For the following three transformations, spatial resolution of the source differs from that of the target. - - // Source content is centered on the target. - D3DKMDT_VPPS_CENTERED = 2, - - // Source content is scaled to fit the target, no aspect ratio preserving. - D3DKMDT_VPPS_STRETCHED = 3, - - // Source content is scaled to fit the target. Aspect ratio preserving. - D3DKMDT_VPPS_ASPECTRATIOCENTEREDMAX = 4, - - // Scaling that cannot be described by any other D3DKMDT_VPPS_XXX value - D3DKMDT_VPPS_CUSTOM = 5, - - - // Reserved for internal OS use - D3DKMDT_VPPS_RESERVED1 = 253, - - // Source content scaling mode is not pinned. - D3DKMDT_VPPS_UNPINNED = 254, - - // OS does not specify the scaling mode, and miniport should decide based on its own settings. - D3DKMDT_VPPS_NOTSPECIFIED = 255 -} -D3DKMDT_VIDPN_PRESENT_PATH_SCALING; - - -// Purpose: VidPN present path rotation type. -typedef enum _D3DKMDT_VIDPN_PRESENT_PATH_ROTATION -{ - D3DKMDT_VPPR_UNINITIALIZED = 0, - - // Source content is not modified in any way. - D3DKMDT_VPPR_IDENTITY = 1, - - // Source content is rotated 90 degrees. - D3DKMDT_VPPR_ROTATE90 = 2, - - // Source content is rotated 180 degrees. - D3DKMDT_VPPR_ROTATE180 = 3, - - // Source content is rotated 270 degrees. - D3DKMDT_VPPR_ROTATE270 = 4, - - // Source content rotation setting is not pinned. - D3DKMDT_VPPR_UNPINNED = 254, - - // OS does not specify the rotation mode, and miniport should decide based on its own settings. - D3DKMDT_VPPR_NOTSPECIFIED = 255 -} -D3DKMDT_VIDPN_PRESENT_PATH_ROTATION; - -#define D3DKMDT_SCALING_SUPPORT_MASK 0x1f; - -// Purpose: Specifies what scaling modes are supported given current path configuration. -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH_SCALING_SUPPORT -{ - UINT Identity : 1; - UINT Centered : 1; - UINT Stretched : 1; - UINT AspectRatioCenteredMax : 1; - UINT Custom : 1; -} D3DKMDT_VIDPN_PRESENT_PATH_SCALING_SUPPORT; - -#define D3DKMDT_ROTATION_SUPPORT_MASK 0xf; - -// Purpose: Specifies what rotation modes are supported given current path configuration. -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT -{ - UINT Identity : 1; - UINT Rotate90 : 1; - UINT Rotate180 : 1; - UINT Rotate270 : 1; -} D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT; - -// Purpose: Combines all the transformation related fields into one structure. -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH_TRANSFORMATION -{ - // Scaling applied to the content presented on this video present path. - D3DKMDT_VIDPN_PRESENT_PATH_SCALING Scaling; - - // Scaling support given the currently pinned modes. - D3DKMDT_VIDPN_PRESENT_PATH_SCALING_SUPPORT ScalingSupport; - - // Rotation applied to the content presented on this video present path. - D3DKMDT_VIDPN_PRESENT_PATH_ROTATION Rotation; - - // Rotation support given the currently pinned modes. - D3DKMDT_VIDPN_PRESENT_PATH_ROTATION_SUPPORT RotationSupport; -} D3DKMDT_VIDPN_PRESENT_PATH_TRANSFORMATION; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN present path importance ordinal type. -// -// Note: Higher order importance ordinals can be used (upto 255), but only the first 10 have been explicitly named. -// -typedef enum _D3DKMDT_VIDPN_PRESENT_PATH_IMPORTANCE -{ - D3DKMDT_VPPI_UNINITIALIZED = 0, - D3DKMDT_VPPI_PRIMARY = 1, - D3DKMDT_VPPI_SECONDARY = 2, - D3DKMDT_VPPI_TERTIARY = 3, - D3DKMDT_VPPI_QUATERNARY = 4, - D3DKMDT_VPPI_QUINARY = 5, - D3DKMDT_VPPI_SENARY = 6, - D3DKMDT_VPPI_SEPTENARY = 7, - D3DKMDT_VPPI_OCTONARY = 8, - D3DKMDT_VPPI_NONARY = 9, - D3DKMDT_VPPI_DENARY = 10, -} -D3DKMDT_VIDPN_PRESENT_PATH_IMPORTANCE; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN present path content ordinal type. -// -// Indicates whether the content being displayed is video or graphics. -// -typedef enum _D3DKMDT_VIDPN_PRESENT_PATH_CONTENT -{ - D3DKMDT_VPPC_UNINITIALIZED = 0, - - // Miniport should optimize presentation of the present path for graphics content. - D3DKMDT_VPPC_GRAPHICS = 1, - - // Miniport should optimize presentation of the present path for video content. - D3DKMDT_VPPC_VIDEO = 2, - - // OS does not specify the content type, and miniport should decide based on its own settings. - D3DKMDT_VPPC_NOTSPECIFIED = 255 -} -D3DKMDT_VIDPN_PRESENT_PATH_CONTENT; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN present path macrovision information. -// -// Contains macrovision caps and controls. -// -typedef enum _D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_TYPE -{ - D3DKMDT_VPPMT_UNINITIALIZED = 0, - - D3DKMDT_VPPMT_NOPROTECTION = 1, - - D3DKMDT_VPPMT_MACROVISION_APSTRIGGER = 2, - - D3DKMDT_VPPMT_MACROVISION_FULLSUPPORT = 3, - -} -D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_TYPE; - -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT -{ - UINT NoProtection : 1; - UINT MacroVisionApsTrigger : 1; - UINT MacroVisionFull : 1; - UINT Reserved : 29; -} -D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT; - -#define D3DKMDT_MACROVISION_OEMCOPYPROTECTION_SIZE 256 - -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION -{ - // Macrovision controls. - D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_TYPE CopyProtectionType; - UINT APSTriggerBits; - BYTE OEMCopyProtection[D3DKMDT_MACROVISION_OEMCOPYPROTECTION_SIZE]; - - // Level of available copy protection support. - D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION_SUPPORT CopyProtectionSupport; -} D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: VidPN present path gamma ramp descriptor type. -// -typedef struct _D3DKMDT_GAMMA_RAMP -{ - D3DDDI_GAMMARAMP_TYPE Type; - SIZE_T DataSize; - - // If (Type == D3DDDI_GAMMARAMP_DEFAULT), (DataSize == 0) and (Data.pFormatOther == NULL ) - union - { - D3DDDI_GAMMA_RAMP_RGB256x3x16* pRgb256x3x16; // Type == D3DDDI_GAMMARAMP_RGB256x3x16. - D3DDDI_GAMMA_RAMP_DXGI_1* pDxgi1; // Type == D3DDDI_GAMMARAMP_DXGI_1. - VOID* pRaw; - } - Data; -} -D3DKMDT_GAMMA_RAMP; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target to source mapping. -// -// Remarks: This type is used to describe a mapping from a single video present target to a single -// video present source in a VidPN topology. -// -typedef struct _D3DKMDT_VIDPN_PRESENT_PATH -{ - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; - - D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId; - - // Video present path importance ordinal (e.g. path presenting the primary view may have higher - // importance set on it in order to guarantee that it gets the best source/target mode sets). - D3DKMDT_VIDPN_PRESENT_PATH_IMPORTANCE ImportanceOrdinal; - - // Contains all the transformation related fields. - D3DKMDT_VIDPN_PRESENT_PATH_TRANSFORMATION ContentTransformation; - - // Storing deltas for visible/active pixels mapping rather than visible pixels' - // size & offset has the added benefit of ideal/default state being zeros. - - // Monitor screen's offset of visible pixels' top-left corner from - // video signal's active pixels top-left corner. - // Note: Default = (0,0). - D3DKMDT_2DOFFSET VisibleFromActiveTLOffset; - - // Monitor screen's offset of visible pixels' bottom-right corner from - // video signal's active pixels bottom-right corner. - // Note: Default = (0,0). - D3DKMDT_2DOFFSET VisibleFromActiveBROffset; - - // Video signal color basis with respect to which video output codec encodes the pixels from the respective - // source's primary surface (e.g. on HDMI this can be either RGB or YCbCr). - D3DKMDT_COLOR_BASIS VidPnTargetColorBasis; - - // Supported dynamic range of each of the color bases' coefficients by the video output codec's output - // E.g. With a DAC scaning out A2R10G10B10 primary surface at R8G8B8 color resolution, this would be (8,8,8,0), - D3DKMDT_COLOR_COEFF_DYNAMIC_RANGES VidPnTargetColorCoeffDynamicRanges; - - // Indicates the content being diplayed. The driver can use this to determine whether the flicker filter - // and overscan should be enabled or disabled. - D3DKMDT_VIDPN_PRESENT_PATH_CONTENT Content; - - // Contains all the copy protection related fields. - D3DKMDT_VIDPN_PRESENT_PATH_COPYPROTECTION CopyProtection; - - // A lookup table (LUT) used to compensate intensity of presented content for the color response of the monitor - // connected to present path's target. - D3DKMDT_GAMMA_RAMP GammaRamp; -} -D3DKMDT_VIDPN_PRESENT_PATH; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Specifies whether to ignore monitor connectivity checks or enforce them. -// -typedef enum _D3DKMDT_MONITOR_CONNECTIVITY_CHECKS -{ - D3DKMDT_MCC_UNINITIALIZED = 0, - D3DKMDT_MCC_IGNORE = 1, - D3DKMDT_MCC_ENFORCE = 2 -} -D3DKMDT_MONITOR_CONNECTIVITY_CHECKS; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Type of the owner whose mode set does not change during an enumeration. -// -// Remarks: When OS pins/unpins a mode in one of VidPN's mode sets, the only mode set that is guaranteed to -// stay the same is the mode set whose mode was pinned/unpinned. Enumeration pivot lets the OS -// specify to the miniport which mode set it should not update (because this mode set could not have -// been invalidated as a result of the change the OS made to the VidPN. -// -typedef enum _D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE -{ - D3DKMDT_EPT_UNINITIALIZED, - D3DKMDT_EPT_VIDPNSOURCE, - D3DKMDT_EPT_VIDPNTARGET, - D3DKMDT_EPT_SCALING, - D3DKMDT_EPT_ROTATION, - D3DKMDT_EPT_NOPIVOT -} -D3DKMDT_ENUMCOFUNCMODALITY_PIVOT_TYPE; - -// -// Monitor descriptor related types. -// - -typedef UINT D3DKMDT_MONITOR_DESCRIPTOR_ID; - -typedef enum _D3DKMDT_MONITOR_DESCRIPTOR_TYPE -{ - D3DKMDT_MDT_UNINITIALIZED = 0, - D3DKMDT_MDT_VESA_EDID_V1_BASEBLOCK = 1, - D3DKMDT_MDT_VESA_EDID_V1_BLOCKMAP = 2, - D3DKMDT_MDT_OTHER = 255 -} -D3DKMDT_MONITOR_DESCRIPTOR_TYPE; - -typedef struct _D3DKMDT_MONITOR_DESCRIPTOR -{ - D3DKMDT_MONITOR_DESCRIPTOR_ID Id; - D3DKMDT_MONITOR_DESCRIPTOR_TYPE Type; - SIZE_T DataSize; - VOID* pData; - D3DKMDT_MONITOR_CAPABILITIES_ORIGIN Origin; -} -D3DKMDT_MONITOR_DESCRIPTOR; - - -typedef enum _D3DKMDT_STANDARDALLOCATION_TYPE -{ - D3DKMDT_STANDARDALLOCATION_SHAREDPRIMARYSURFACE = 1, - D3DKMDT_STANDARDALLOCATION_SHADOWSURFACE = 2, - D3DKMDT_STANDARDALLOCATION_STAGINGSURFACE = 3, - D3DKMDT_STANDARDALLOCATION_GDISURFACE = 4, -} D3DKMDT_STANDARDALLOCATION_TYPE; - -typedef struct _D3DKMDT_SHAREDPRIMARYSURFACEDATA -{ - UINT Width; - UINT Height; - D3DDDIFORMAT Format; - D3DDDI_RATIONAL RefreshRate; - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; -} D3DKMDT_SHAREDPRIMARYSURFACEDATA; - -typedef struct _D3DKMDT_SHADOWSURFACEDATA -{ - UINT Width; - UINT Height; - D3DDDIFORMAT Format; - UINT Pitch; //out: Driver must return Pitch as this allocation will be lockabale -} D3DKMDT_SHADOWSURFACEDATA; - -//Staging Surface is a surface created potentially -//during present when a direct Blt to primary is -//not possible in cases like multimon or sprites. -//This surface is always in the format of D3DDDIFMT_X8R8G8B8 - -typedef struct _D3DKMDT_STAGINGSURFACEDATA -{ - UINT Width; //in: Width of the staging buffer - UINT Height; //in: Height of the staging buffer - UINT Pitch; //out: Driver must return Pitch as this allocation will be lockabale -} D3DKMDT_STAGINGSURFACEDATA; - -typedef struct _D3DKMDT_GDISURFACEFLAGS -{ - UINT Value; -} D3DKMDT_GDISURFACEFLAGS; - -typedef enum _D3DKMDT_GDISURFACETYPE -{ - D3DKMDT_GDISURFACE_INVALID = 0, - D3DKMDT_GDISURFACE_TEXTURE = 1, - D3DKMDT_GDISURFACE_STAGING_CPUVISIBLE = 2, - D3DKMDT_GDISURFACE_STAGING = 3, - D3DKMDT_GDISURFACE_LOOKUPTABLE = 4, - D3DKMDT_GDISURFACE_EXISTINGSYSMEM = 5, -} D3DKMDT_GDISURFACETYPE; - -typedef struct _D3DKMDT_GDISURFACEDATA -{ - UINT Width; - UINT Height; - D3DDDIFORMAT Format; - D3DKMDT_GDISURFACETYPE Type; - D3DKMDT_GDISURFACEFLAGS Flags; - UINT Pitch; // out: The driver must return pitch if allocation is CPU visible -} D3DKMDT_GDISURFACEDATA; - -typedef struct _D3DKMDT_PALETTEDATA -{ - BYTE Red; - BYTE Green; - BYTE Blue; - BYTE Unused; -} D3DKMDT_PALETTEDATA; - -// -//Red - Bits to be put in the Red portion of the color registers. -// -//Green - Bits to be put in the Green portion of the color registers. -// -//Blue - Bits to be put in the Blue portion of the color registers. -// - -typedef struct _DXGKARG_SETPALETTE -{ - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; - UINT FirstEntry; - UINT NumEntries; - D3DKMDT_PALETTEDATA* pLookupTable; -} DXGKARG_SETPALETTE; - -// -//NumEntries - Number of entries in the LookupTable of color values. -// -//FirstEntry - Location in the device palette to which the first entry in the -// LookupTable of colors should be copied to. The other entries in the -// LookupTable should be copied sequentially, from this starting point into -// the device's palette. -// -//pLookupTable - Array of color entries to copy into the device's color -// registers/palette. The color entries can be accessed as a genric 32 bit -// value or as Red/Green/Blue/Unused fields. -// - - -//////////////////// I2C //////////////////////////////////////////////////////////////////////////////////// - -#define DXGKMDT_I2C_NO_FLAGS 0 -#define DXGKMDT_I2C_DEVICE_TRANSMITS_DATA_LENGTH 1 - -//////////////////// OPM (Output Protection Manager) //////////////////////////////////////////////////////// - -#pragma pack( push, 1 ) - -#define DXGKMDT_OPM_OMAC_SIZE 16 -#define DXGKMDT_OPM_128_BIT_RANDOM_NUMBER_SIZE 16 -#define DXGKMDT_OPM_ENCRYPTED_PARAMETERS_SIZE 256 -#define DXGKMDT_OPM_CONFIGURE_SETTING_DATA_SIZE 4056 -#define DXGKMDT_OPM_GET_INFORMATION_PARAMETERS_SIZE 4056 -#define DXGKMDT_OPM_REQUESTED_INFORMATION_SIZE 4076 -#define DXGKMDT_OPM_HDCP_KEY_SELECTION_VECTOR_SIZE 5 -#define DXGKMDT_OPM_PROTECTION_TYPE_SIZE 4 - -DEFINE_GUID(DXGKMDT_OPM_GET_CURRENT_HDCP_SRM_VERSION, 0x99c5ceff, 0x5f1d, 0x4879, 0x81, 0xc1, 0xc5, 0x24, 0x43, 0xc9, 0x48, 0x2b); -DEFINE_GUID(DXGKMDT_OPM_GET_CONNECTED_HDCP_DEVICE_INFORMATION, 0x0db59d74, 0xa992, 0x492e, 0xa0, 0xbd, 0xc2, 0x3f, 0xda, 0x56, 0x4e, 0x00); -DEFINE_GUID(DXGKMDT_OPM_GET_CONNECTOR_TYPE, 0x81d0bfd5, 0x6afe, 0x48c2, 0x99, 0xc0, 0x95, 0xa0, 0x8f, 0x97, 0xc5, 0xda); -DEFINE_GUID(DXGKMDT_OPM_GET_SUPPORTED_PROTECTION_TYPES, 0x38f2a801, 0x9a6c, 0x48bb, 0x91, 0x07, 0xb6, 0x69, 0x6e, 0x6f, 0x17, 0x97); -DEFINE_GUID(DXGKMDT_OPM_GET_VIRTUAL_PROTECTION_LEVEL, 0xb2075857, 0x3eda, 0x4d5d, 0x88, 0xdb, 0x74, 0x8f, 0x8c, 0x1a, 0x05, 0x49); -DEFINE_GUID(DXGKMDT_OPM_GET_ACTUAL_PROTECTION_LEVEL, 0x1957210a, 0x7766, 0x452a, 0xb9, 0x9a, 0xd2, 0x7a, 0xed, 0x54, 0xf0, 0x3a); -DEFINE_GUID(DXGKMDT_OPM_GET_ACTUAL_OUTPUT_FORMAT, 0xd7bf1ba3, 0xad13, 0x4f8e, 0xaf, 0x98, 0x0d, 0xcb, 0x3c, 0xa2, 0x04, 0xcc); -DEFINE_GUID(DXGKMDT_OPM_GET_ADAPTER_BUS_TYPE, 0xc6f4d673, 0x6174, 0x4184, 0x8e, 0x35, 0xf6, 0xdb, 0x52, 0x0, 0xbc, 0xba); -DEFINE_GUID(DXGKMDT_OPM_GET_ACP_AND_CGMSA_SIGNALING, 0x6629a591, 0x3b79, 0x4cf3, 0x92, 0x4a, 0x11, 0xe8, 0xe7, 0x81, 0x16, 0x71); -DEFINE_GUID(DXGKMDT_OPM_GET_OUTPUT_ID, 0x72cb6df3, 0x244f, 0x40ce, 0xb0, 0x9e, 0x20, 0x50, 0x6a, 0xf6, 0x30, 0x2f); -DEFINE_GUID(DXGKMDT_OPM_GET_DVI_CHARACTERISTICS, 0xa470b3bb, 0x5dd7, 0x4172, 0x83, 0x9c, 0x3d, 0x37, 0x76, 0xe0, 0xeb, 0xf5); -DEFINE_GUID(DXGKMDT_OPM_SET_PROTECTION_LEVEL, 0x9bb9327c, 0x4eb5, 0x4727, 0x9f, 0x00, 0xb4, 0x2b, 0x09, 0x19, 0xc0, 0xda); -DEFINE_GUID(DXGKMDT_OPM_SET_ACP_AND_CGMSA_SIGNALING, 0x09a631a5, 0xd684, 0x4c60, 0x8e, 0x4d, 0xd3, 0xbb, 0x0f, 0x0b, 0xe3, 0xee); -DEFINE_GUID(DXGKMDT_OPM_SET_HDCP_SRM, 0x8b5ef5d1, 0xc30d, 0x44ff, 0x84, 0xa5, 0xea, 0x71, 0xdc, 0xe7, 0x8f, 0x13); -DEFINE_GUID(DXGKMDT_OPM_SET_PROTECTION_LEVEL_ACCORDING_TO_CSS_DVD, 0x39ce333e, 0x4cc0, 0x44ae, 0xbf, 0xcc, 0xda, 0x50, 0xb5, 0xf8, 0x2e, 0x72); - -typedef enum _DXGKMDT_CERTIFICATE_TYPE -{ - DXGKMDT_OPM_CERTIFICATE = 0, - DXGKMDT_COPP_CERTIFICATE = 1, - DXGKMDT_UAB_CERTIFICATE = 2, - DXGKMDT_FORCE_ULONG = 0xFFFFFFFF -} DXGKMDT_CERTIFICATE_TYPE; - -typedef enum _DXGKMDT_OPM_VIDEO_OUTPUT_SEMANTICS -{ - DXGKMDT_OPM_VOS_COPP_SEMANTICS = 0, - DXGKMDT_OPM_VOS_OPM_SEMANTICS = 1 -} DXGKMDT_OPM_VIDEO_OUTPUT_SEMANTICS; - -typedef enum _DXGKMDT_DPCP_PROTECTION_LEVEL -{ - DXGKMDT_OPM_DPCP_OFF = 0, - DXGKMDT_OPM_DPCP_ON = 1, - DXGKMDT_OPM_DPCP_FORCE_ULONG = 0x7fffffff - -} DXGKMDT_OPM_DPCP_PROTECTION_LEVEL; - -typedef enum _DXGKMDT_OPM_HDCP_FLAG -{ - DXGKMDT_OPM_HDCP_FLAG_NONE = 0x00, - DXGKMDT_OPM_HDCP_FLAG_REPEATER = 0x01 -} DXGKMDT_OPM_HDCP_FLAG; - -typedef enum _DXGKMDT_OPM_STATUS -{ - DXGKMDT_OPM_STATUS_NORMAL = 0x00, - DXGKMDT_OPM_STATUS_LINK_LOST = 0x01, - DXGKMDT_OPM_STATUS_RENEGOTIATION_REQUIRED = 0x02, - DXGKMDT_OPM_STATUS_TAMPERING_DETECTED = 0x04, - DXGKMDT_OPM_STATUS_REVOKED_HDCP_DEVICE_ATTACHED = 0x08 -} DXGKMDT_OPM_STATUS; - -// NUAE stands for Non-User Accessible Enclosure -typedef enum _DXGKMDT_OPM_BUS_TYPE_AND_IMPLEMENTATION -{ - DXGKMDT_OPM_BUS_TYPE_OTHER = 0x00000000, - DXGKMDT_OPM_BUS_TYPE_PCI = 0x00000001, - DXGKMDT_OPM_BUS_TYPE_PCIX = 0x00000002, - DXGKMDT_OPM_BUS_TYPE_PCIEXPRESS = 0x00000003, - DXGKMDT_OPM_BUS_TYPE_AGP = 0x00000004, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_INSIDE_OF_CHIPSET = 0x00010000, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP = 0x00020000, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET = 0x00030000, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR = 0x00040000, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE = 0x00050000, - DXGKMDT_OPM_BUS_IMPLEMENTATION_MODIFIER_NON_STANDARD = 0x80000000, - DXGKMDT_OPM_COPP_COMPATIBLE_BUS_TYPE_INTEGRATED = 0x80000000 -} DXGKMDT_OPM_BUS_TYPE_AND_IMPLEMENTATION; - -typedef enum _DXGKMDT_OPM_HDCP_PROTECTION_LEVEL -{ - DXGKMDT_OPM_HDCP_OFF = 0, - DXGKMDT_OPM_HDCP_ON = 1, - DXGKMDT_OPM_HDCP_FORCE_ULONG = 0x7fffffff -} DXGKMDT_OPM_HDCP_PROTECTION_LEVEL; - -typedef enum _DXGKMDT_OPM_CGMSA -{ - DXGKMDT_OPM_CGMSA_OFF = 0, - DXGKMDT_OPM_CGMSA_COPY_FREELY = 1, - DXGKMDT_OPM_CGMSA_COPY_NO_MORE = 2, - DXGKMDT_OPM_CGMSA_COPY_ONE_GENERATION = 3, - DXGKMDT_OPM_CGMSA_COPY_NEVER = 4, - DXGKMDT_OPM_REDISTRIBUTION_CONTROL_REQUIRED = 0x08, -} DXGKMDT_OPM_CGMSA; - -typedef enum _DXGKMDT_OPM_ACP_PROTECTION_LEVEL -{ - DXGKMDT_OPM_ACP_OFF = 0, - DXGKMDT_OPM_ACP_LEVEL_ONE = 1, - DXGKMDT_OPM_ACP_LEVEL_TWO = 2, - DXGKMDT_OPM_ACP_LEVEL_THREE = 3, - DXGKMDT_OPM_ACP_FORCE_ULONG = 0x7fffffff -} DXGKMDT_OPM_ACP_PROTECTION_LEVEL; - -typedef enum _DXGKMDT_OPM_PROTECTION_TYPE -{ - DXGKMDT_OPM_PROTECTION_TYPE_OTHER = 0x80000000, - DXGKMDT_OPM_PROTECTION_TYPE_NONE = 0x00000000, - DXGKMDT_OPM_PROTECTION_TYPE_COPP_COMPATIBLE_HDCP = 0x00000001, - DXGKMDT_OPM_PROTECTION_TYPE_ACP = 0x00000002, - DXGKMDT_OPM_PROTECTION_TYPE_CGMSA = 0x00000004, - DXGKMDT_OPM_PROTECTION_TYPE_HDCP = 0x00000008, - DXGKMDT_OPM_PROTECTION_TYPE_DPCP = 0x00000010, - DXGKMDT_OPM_PROTECTION_TYPE_MASK = 0x8000001F -} DXGKMDT_OPM_PROTECTION_TYPE; - -typedef enum _DXGKMDT_OPM_PROTECTION_STANDARD -{ - DXGKMDT_OPM_PROTECTION_STANDARD_OTHER = 0x80000000, - DXGKMDT_OPM_PROTECTION_STANDARD_NONE = 0x00000000, - DXGKMDT_OPM_PROTECTION_STANDARD_IEC61880_525I = 0x00000001, - DXGKMDT_OPM_PROTECTION_STANDARD_IEC61880_2_525I = 0x00000002, - DXGKMDT_OPM_PROTECTION_STANDARD_IEC62375_625P = 0x00000004, - DXGKMDT_OPM_PROTECTION_STANDARD_EIA608B_525 = 0x00000008, - DXGKMDT_OPM_PROTECTION_STANDARD_EN300294_625I = 0x00000010, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEA_525P = 0x00000020, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEA_750P = 0x00000040, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEA_1125I = 0x00000080, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEB_525P = 0x00000100, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEB_750P = 0x00000200, - DXGKMDT_OPM_PROTECTION_STANDARD_CEA805A_TYPEB_1125I = 0x00000400, - DXGKMDT_OPM_PROTECTION_STANDARD_ARIBTRB15_525I = 0x00000800, - DXGKMDT_OPM_PROTECTION_STANDARD_ARIBTRB15_525P = 0x00001000, - DXGKMDT_OPM_PROTECTION_STANDARD_ARIBTRB15_750P = 0x00002000, - DXGKMDT_OPM_PROTECTION_STANDARD_ARIBTRB15_1125I = 0x00004000, -} DXGKMDT_OPM_PROTECTION_STANDARD; - -typedef enum _DXGKMDT_OPM_IMAGE_ASPECT_RATIO_EN300294 -{ - DXGKMDT_OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3 = 0, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_CENTER = 1, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_BOX_14_BY_9_TOP = 2, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_CENTER = 3, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_BOX_16_BY_9_TOP = 4, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_BOX_GT_16_BY_9_CENTER = 5, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_4_BY_3_PROTECTED_CENTER = 6, - DXGKMDT_OPM_ASPECT_RATIO_EN300294_FULL_FORMAT_16_BY_9_ANAMORPHIC = 7, - DXGKMDT_OPM_ASPECT_RATIO_FORCE_ULONG = 0x7FFFFFFF -} DXGKMDT_OPM_IMAGE_ASPECT_RATIO_EN300294; - -typedef enum _DXGKMDT_OPM_INTERLEAVE_FORMAT -{ - DXGKMDT_OPM_INTERLEAVE_FORMAT_OTHER = 0, - DXGKMDT_OPM_INTERLEAVE_FORMAT_PROGRESSIVE = 2, - DXGKMDT_OPM_INTERLEAVE_FORMAT_INTERLEAVED_EVEN_FIRST = 3, - DXGKMDT_OPM_INTERLEAVE_FORMAT_INTERLEAVED_ODD_FIRST = 4, - DXGKMDT_OPM_INTERLEAVE_FORMAT_FORCE_ULONG = 0xFFFFFFFF - -} DXGKMDT_OPM_INTERLEAVE_FORMAT; - -typedef enum _DXGKDT_OPM_DVI_CHARACTERISTICS -{ - DXGKMDT_OPM_DVI_CHARACTERISTIC_1_0 = 1, - DXGKMDT_OPM_DVI_CHARACTERISTIC_1_1_OR_ABOVE = 2, - DXGKMDT_OPM_DVI_CHARACTERISTICS_FORCE_ULONG = 0xFFFFFFFF -} DXGKDT_OPM_DVI_CHARACTERISTICS; - -typedef struct _DXGKMDT_OPM_RANDOM_NUMBER -{ - BYTE abRandomNumber[DXGKMDT_OPM_128_BIT_RANDOM_NUMBER_SIZE]; -} DXGKMDT_OPM_RANDOM_NUMBER, *PDXGKMDT_OPM_RANDOM_NUMBER; - -typedef struct _DXGKMDT_OPM_OMAC -{ - BYTE abOMAC[DXGKMDT_OPM_OMAC_SIZE]; -} DXGKMDT_OPM_OMAC, *PDXGKMDT_OPM_OMAC; - -typedef struct _DXGKMDT_OPM_ENCRYPTED_PARAMETERS -{ - BYTE abEncryptedParameters[DXGKMDT_OPM_ENCRYPTED_PARAMETERS_SIZE]; -} DXGKMDT_OPM_ENCRYPTED_PARAMETERS, *PDXGKMDT_OPM_ENCRYPTED_PARAMETERS; - -typedef struct _DXGKMDT_OPM_GET_INFO_PARAMETERS -{ - DXGKMDT_OPM_OMAC omac; - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - GUID guidInformation; - ULONG ulSequenceNumber; - ULONG cbParametersSize; - BYTE abParameters[DXGKMDT_OPM_GET_INFORMATION_PARAMETERS_SIZE]; -} DXGKMDT_OPM_GET_INFO_PARAMETERS, *PDXGKMDT_OPM_GET_INFO_PARAMETERS; - -typedef struct _DXGKMDT_OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - GUID guidInformation; - ULONG ulSequenceNumber; - ULONG cbParametersSize; - BYTE abParameters[DXGKMDT_OPM_GET_INFORMATION_PARAMETERS_SIZE]; -} DXGKMDT_OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS, *PDXGKMDT_OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS; - -typedef struct _DXGKMDT_OPM_HDCP_KEY_SELECTION_VECTOR -{ - BYTE abKeySelectionVector[DXGKMDT_OPM_HDCP_KEY_SELECTION_VECTOR_SIZE]; -} DXGKMDT_OPM_HDCP_KEY_SELECTION_VECTOR; - -typedef struct _DXGKMDT_OPM_CONNECTED_HDCP_DEVICE_INFORMATION -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - ULONG ulStatusFlags; - ULONG ulHDCPFlags; - DXGKMDT_OPM_HDCP_KEY_SELECTION_VECTOR ksvB; - BYTE Reserved[11]; - BYTE Reserved2[16]; - BYTE Reserved3[16]; -} DXGKMDT_OPM_CONNECTED_HDCP_DEVICE_INFORMATION; - -typedef struct _DXGKMDT_OPM_REQUESTED_INFORMATION -{ - DXGKMDT_OPM_OMAC omac; - ULONG cbRequestedInformationSize; - BYTE abRequestedInformation[DXGKMDT_OPM_REQUESTED_INFORMATION_SIZE]; -} DXGKMDT_OPM_REQUESTED_INFORMATION, *PDXGKMDT_OPM_REQUESTED_INFORMATION; - -typedef struct _DXGKMDT_OPM_STANDARD_INFORMATION -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - ULONG ulStatusFlags; - ULONG ulInformation; - ULONG ulReserved; - ULONG ulReserved2; -} DXGKMDT_OPM_STANDARD_INFORMATION; - -typedef struct _DXGKMDT_OPM_ACTUAL_OUTPUT_FORMAT -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - ULONG ulStatusFlags; - ULONG ulDisplayWidth; - ULONG ulDisplayHeight; - DXGKMDT_OPM_INTERLEAVE_FORMAT ifInterleaveFormat; - ULONG d3dFormat; - ULONG ulFrequencyNumerator; - ULONG ulFrequencyDenominator; -} DXGKMDT_OPM_ACTUAL_OUTPUT_FORMAT; - -typedef struct _DXGKMDT_OPM_ACP_AND_CGMSA_SIGNALING -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - ULONG ulStatusFlags; - ULONG ulAvailableTVProtectionStandards; - ULONG ulActiveTVProtectionStandard; - ULONG ulReserved; - ULONG ulAspectRatioValidMask1; - ULONG ulAspectRatioData1; - ULONG ulAspectRatioValidMask2; - ULONG ulAspectRatioData2; - ULONG ulAspectRatioValidMask3; - ULONG ulAspectRatioData3; - ULONG ulReserved2[4]; - ULONG ulReserved3[4]; -} DXGKMDT_OPM_ACP_AND_CGMSA_SIGNALING; - -typedef struct _DXGKMDT_OPM_OUTPUT_ID -{ - DXGKMDT_OPM_RANDOM_NUMBER rnRandomNumber; - ULONG ulStatusFlags; - UINT64 OutputId; -} DXGKMDT_OPM_OUTPUT_ID; - -typedef struct _DXGKMDT_OPM_CONFIGURE_PARAMETERS -{ - DXGKMDT_OPM_OMAC omac; - GUID guidSetting; - ULONG ulSequenceNumber; - ULONG cbParametersSize; - BYTE abParameters[DXGKMDT_OPM_CONFIGURE_SETTING_DATA_SIZE]; -} DXGKMDT_OPM_CONFIGURE_PARAMETERS, *PDXGKMDT_OPM_CONFIGURE_PARAMETERS; - -typedef struct _DXGKMDT_OPM_SET_PROTECTION_LEVEL_PARAMETERS -{ - ULONG ulProtectionType; - ULONG ulProtectionLevel; - ULONG Reserved; - ULONG Reserved2; -} DXGKMDT_OPM_SET_PROTECTION_LEVEL_PARAMETERS; - -typedef struct _DXGKMDT_OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS -{ - ULONG ulNewTVProtectionStandard; - ULONG ulAspectRatioChangeMask1; - ULONG ulAspectRatioData1; - ULONG ulAspectRatioChangeMask2; - ULONG ulAspectRatioData2; - ULONG ulAspectRatioChangeMask3; - ULONG ulAspectRatioData3; - ULONG ulReserved[4]; - ULONG ulReserved2[4]; - ULONG ulReserved3; -} DXGKMDT_OPM_SET_ACP_AND_CGMSA_SIGNALING_PARAMETERS; - -typedef struct _DXGKMDT_OPM_SET_HDCP_SRM_PARAMETERS -{ - ULONG ulSRMVersion; -} DXGKMDT_OPM_SET_HDCP_SRM_PARAMETERS; - -#pragma pack( pop ) - -#endif // (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) - -#pragma warning(pop) - -#endif /* _D3DKMDT_H */ - - diff --git a/qt-correction-tool/pub/ddk/d3dukmdt.h b/qt-correction-tool/pub/ddk/d3dukmdt.h deleted file mode 100644 index 45dac92..0000000 --- a/qt-correction-tool/pub/ddk/d3dukmdt.h +++ /dev/null @@ -1,758 +0,0 @@ -/******************************Module*Header************************************\ -* -* Module Name: d3dukmdt.h -* -* Content: Longhorn Display Driver Model (LDDM) user/kernel mode -* shared data type definitions. -* -* Copyright (c) 2003 Microsoft Corporation. All rights reserved. -\*******************************************************************************/ -#ifndef _D3DUKMDT_H_ -#define _D3DUKMDT_H_ - -#if !defined(_D3DKMDT_H) && \ - !defined(_D3DKMTHK_H_) && \ - !defined(_D3DUMDDI_H_) && \ - !defined(__DXGKRNLETW_H__) - #error This header should not be included directly! -#endif - -#pragma warning(push) -#pragma warning(disable:4201) // anonymous unions warning - - -// -// WDDM DDI Interface Version -// - -#define DXGKDDI_INTERFACE_VERSION_VISTA 0x1052 -#define DXGKDDI_INTERFACE_VERSION_VISTA_SP1 0x1053 -#define DXGKDDI_INTERFACE_VERSION_WIN7 0x2005 - -#if !defined(DXGKDDI_INTERFACE_VERSION) -#define DXGKDDI_INTERFACE_VERSION DXGKDDI_INTERFACE_VERSION_WIN7 -#endif // !defined(DXGKDDI_INTERFACE_VERSION) - -#define D3D_UMD_INTERFACE_VERSION_VISTA 0x000C -#define D3D_UMD_INTERFACE_VERSION_WIN7 0x2003 - -#if !defined(D3D_UMD_INTERFACE_VERSION) -#define D3D_UMD_INTERFACE_VERSION D3D_UMD_INTERFACE_VERSION_WIN7 -#endif // !defined(D3D_UMD_INTERFACE_VERSION) - -// -// Available only for Vista (LONGHORN) and later and for -// multiplatform tools such as debugger extensions -// -#if (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) - -typedef ULONGLONG D3DGPU_VIRTUAL_ADDRESS; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present source unique identification number descriptor type -// - -typedef UINT D3DDDI_VIDEO_PRESENT_SOURCE_ID; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present source unique identification number descriptor type. -// -typedef UINT D3DDDI_VIDEO_PRESENT_TARGET_ID; - -// -// DDI level handle that represents a kernel mode object (allocation, device, etc) -// -typedef UINT D3DKMT_HANDLE; - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video present target mode fractional frequency descriptor type. -// -// Remarks: Fractional value used to represent vertical and horizontal frequencies of a video mode -// (i.e. VSync and HSync). Vertical frequencies are stored in Hz. Horizontal frequencies -// are stored in Hz. -// The dynamic range of this encoding format, given 10^-7 resolution is {0..(2^32 - 1) / 10^7}, -// which translates to {0..428.4967296} [Hz] for vertical frequencies and {0..428.4967296} [Hz] -// for horizontal frequencies. This sub-microseconds precision range should be acceptable even -// for a pro-video application (error in one microsecond for video signal synchronization would -// imply a time drift with a cycle of 10^7/(60*60*24) = 115.741 days. -// -// If rational number with a finite fractional sequence, use denominator of form 10^(length of fractional sequence). -// If rational number without a finite fractional sequence, or a sequence exceeding the precision allowed by the -// dynamic range of the denominator, or an irrational number, use an appropriate ratio of integers which best -// represents the value. -// -typedef struct _D3DDDI_RATIONAL -{ - UINT Numerator; - UINT Denominator; -} D3DDDI_RATIONAL; - -typedef struct _D3DDDI_ALLOCATIONINFO -{ - D3DKMT_HANDLE hAllocation; // out: Private driver data for allocation - CONST VOID* pSystemMem; // in: Pointer to pre-allocated sysmem - VOID* pPrivateDriverData; // in(out optional): Private data for each allocation - UINT PrivateDriverDataSize; // in: Size of the private data - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; // in: VidPN source ID if this is a primary - union - { - struct - { - UINT Primary : 1; // 0x00000001 - UINT Reserved :31; // 0xFFFFFFFE - }; - UINT Value; - } Flags; -} D3DDDI_ALLOCATIONINFO; - -#if ((DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7) || \ - (D3D_UMD_INTERFACE_VERSION >= D3D_UMD_INTERFACE_VERSION_WIN7)) - -typedef struct _D3DDDI_ALLOCATIONINFO2 -{ - D3DKMT_HANDLE hAllocation; // out: Private driver data for allocation - CONST VOID* pSystemMem; // in: Pointer to pre-allocated sysmem - VOID* pPrivateDriverData; // in(out optional): Private data for each allocation - UINT PrivateDriverDataSize; // in: Size of the private data - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; // in: VidPN source ID if this is a primary - union - { - struct - { - UINT Primary : 1; // 0x00000001 - UINT Reserved :31; // 0xFFFFFFFE - }; - UINT Value; - } Flags; - D3DGPU_VIRTUAL_ADDRESS GpuVirtualAddress; // out: GPU Virtual address of the allocation created. - ULONG_PTR Reserved[6]; // Reserved -} D3DDDI_ALLOCATIONINFO2; - -#endif - -typedef struct _D3DDDI_OPENALLOCATIONINFO -{ - D3DKMT_HANDLE hAllocation; // in: Handle for this allocation in this process - CONST VOID* pPrivateDriverData; // in: Ptr to driver private buffer for this allocations - UINT PrivateDriverDataSize; // in: Size in bytes of driver private buffer for this allocations -} D3DDDI_OPENALLOCATIONINFO; - -#if ((DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7) || \ - (D3D_UMD_INTERFACE_VERSION >= D3D_UMD_INTERFACE_VERSION_WIN7)) - -typedef struct _D3DDDI_OPENALLOCATIONINFO2 -{ - D3DKMT_HANDLE hAllocation; // in: Handle for this allocation in this process - CONST VOID* pPrivateDriverData; // in: Ptr to driver private buffer for this allocations - UINT PrivateDriverDataSize; // in: Size in bytes of driver private buffer for this allocations - D3DGPU_VIRTUAL_ADDRESS GpuVirtualAddress; // out: GPU Virtual address of the allocation opened. - ULONG_PTR Reserved[6]; // Reserved -} D3DDDI_OPENALLOCATIONINFO2; - -#endif - -typedef struct _D3DDDI_ALLOCATIONLIST -{ - D3DKMT_HANDLE hAllocation; - union - { - struct - { - UINT WriteOperation : 1; // 0x00000001 - UINT DoNotRetireInstance : 1; // 0x00000002 - UINT Reserved :30; // 0xFFFFFFFC - }; - UINT Value; - }; -} D3DDDI_ALLOCATIONLIST; - -typedef struct _D3DDDI_PATCHLOCATIONLIST -{ - UINT AllocationIndex; - union - { - struct - { - UINT SlotId : 24; // 0x00FFFFFF - UINT Reserved : 8; // 0xFF000000 - }; - UINT Value; - }; - UINT DriverId; - UINT AllocationOffset; - UINT PatchOffset; - UINT SplitOffset; -} D3DDDI_PATCHLOCATIONLIST; - -typedef struct _D3DDDICB_LOCKFLAGS -{ - union - { - struct - { - UINT ReadOnly : 1; // 0x00000001 - UINT WriteOnly : 1; // 0x00000002 - UINT DonotWait : 1; // 0x00000004 - UINT IgnoreSync : 1; // 0x00000008 - UINT LockEntire : 1; // 0x00000010 - UINT DonotEvict : 1; // 0x00000020 - UINT AcquireAperture : 1; // 0x00000040 - UINT Discard : 1; // 0x00000080 - UINT NoExistingReference : 1; // 0x00000100 - UINT UseAlternateVA : 1; // 0x00000200 - UINT IgnoreReadSync : 1; // 0x00000400 - UINT Reserved :21; // 0xFFFFF800 - }; - UINT Value; - }; -} D3DDDICB_LOCKFLAGS; - -typedef struct _D3DDDI_ESCAPEFLAGS -{ - union - { - struct - { - UINT HardwareAccess : 1; // 0x00000001 - UINT Reserved :31; // 0xFFFFFFFE - }; - UINT Value; - }; -} D3DDDI_ESCAPEFLAGS; - -typedef struct _D3DDDI_CREATECONTEXTFLAGS -{ - union - { - struct - { - UINT NullRendering : 1; // 0x00000001 - UINT Reserved : 31; // 0xFFFFFFFE - }; - UINT Value; - }; -} D3DDDI_CREATECONTEXTFLAGS; - -/* Formats - * Most of these names have the following convention: - * A = Alpha - * R = Red - * G = Green - * B = Blue - * X = Unused Bits - * P = Palette - * L = Luminance - * U = dU coordinate for BumpMap - * V = dV coordinate for BumpMap - * S = Stencil - * D = Depth (e.g. Z or W buffer) - * C = Computed from other channels (typically on certain read operations) - * - * Further, the order of the pieces are from MSB first; hence - * D3DFMT_A8L8 indicates that the high byte of this two byte - * format is alpha. - * - * D16 indicates: - * - An integer 16-bit value. - * - An app-lockable surface. - * - * All Depth/Stencil formats except D3DFMT_D16_LOCKABLE indicate: - * - no particular bit ordering per pixel, and - * - are not app lockable, and - * - the driver is allowed to consume more than the indicated - * number of bits per Depth channel (but not Stencil channel). - */ -#ifndef MAKEFOURCC - #define MAKEFOURCC(ch0, ch1, ch2, ch3) \ - ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \ - ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 )) -#endif /* defined(MAKEFOURCC) */ - - -typedef enum _D3DDDIFORMAT -{ - - D3DDDIFMT_UNKNOWN = 0, - - D3DDDIFMT_R8G8B8 = 20, - D3DDDIFMT_A8R8G8B8 = 21, - D3DDDIFMT_X8R8G8B8 = 22, - D3DDDIFMT_R5G6B5 = 23, - D3DDDIFMT_X1R5G5B5 = 24, - D3DDDIFMT_A1R5G5B5 = 25, - D3DDDIFMT_A4R4G4B4 = 26, - D3DDDIFMT_R3G3B2 = 27, - D3DDDIFMT_A8 = 28, - D3DDDIFMT_A8R3G3B2 = 29, - D3DDDIFMT_X4R4G4B4 = 30, - D3DDDIFMT_A2B10G10R10 = 31, - D3DDDIFMT_A8B8G8R8 = 32, - D3DDDIFMT_X8B8G8R8 = 33, - D3DDDIFMT_G16R16 = 34, - D3DDDIFMT_A2R10G10B10 = 35, - D3DDDIFMT_A16B16G16R16 = 36, - - D3DDDIFMT_A8P8 = 40, - D3DDDIFMT_P8 = 41, - - D3DDDIFMT_L8 = 50, - D3DDDIFMT_A8L8 = 51, - D3DDDIFMT_A4L4 = 52, - - D3DDDIFMT_V8U8 = 60, - D3DDDIFMT_L6V5U5 = 61, - D3DDDIFMT_X8L8V8U8 = 62, - D3DDDIFMT_Q8W8V8U8 = 63, - D3DDDIFMT_V16U16 = 64, - D3DDDIFMT_W11V11U10 = 65, - D3DDDIFMT_A2W10V10U10 = 67, - - D3DDDIFMT_UYVY = MAKEFOURCC('U', 'Y', 'V', 'Y'), - D3DDDIFMT_R8G8_B8G8 = MAKEFOURCC('R', 'G', 'B', 'G'), - D3DDDIFMT_YUY2 = MAKEFOURCC('Y', 'U', 'Y', '2'), - D3DDDIFMT_G8R8_G8B8 = MAKEFOURCC('G', 'R', 'G', 'B'), - D3DDDIFMT_DXT1 = MAKEFOURCC('D', 'X', 'T', '1'), - D3DDDIFMT_DXT2 = MAKEFOURCC('D', 'X', 'T', '2'), - D3DDDIFMT_DXT3 = MAKEFOURCC('D', 'X', 'T', '3'), - D3DDDIFMT_DXT4 = MAKEFOURCC('D', 'X', 'T', '4'), - D3DDDIFMT_DXT5 = MAKEFOURCC('D', 'X', 'T', '5'), - - D3DDDIFMT_D16_LOCKABLE = 70, - D3DDDIFMT_D32 = 71, - D3DDDIFMT_D15S1 = 73, - D3DDDIFMT_D24S8 = 75, - D3DDDIFMT_D24X8 = 77, - D3DDDIFMT_D24X4S4 = 79, - D3DDDIFMT_D16 = 80, - - D3DDDIFMT_D32F_LOCKABLE = 82, - D3DDDIFMT_D24FS8 = 83, - - D3DDDIFMT_D32_LOCKABLE = 84, - D3DDDIFMT_S8_LOCKABLE = 85, - - D3DDDIFMT_S1D15 = 72, - D3DDDIFMT_S8D24 = 74, - D3DDDIFMT_X8D24 = 76, - D3DDDIFMT_X4S4D24 = 78, - - D3DDDIFMT_L16 = 81, - - D3DDDIFMT_VERTEXDATA =100, - D3DDDIFMT_INDEX16 =101, - D3DDDIFMT_INDEX32 =102, - - D3DDDIFMT_Q16W16V16U16 =110, - - D3DDDIFMT_MULTI2_ARGB8 = MAKEFOURCC('M','E','T','1'), - - // Floating point surface formats - - // s10e5 formats (16-bits per channel) - D3DDDIFMT_R16F = 111, - D3DDDIFMT_G16R16F = 112, - D3DDDIFMT_A16B16G16R16F = 113, - - // IEEE s23e8 formats (32-bits per channel) - D3DDDIFMT_R32F = 114, - D3DDDIFMT_G32R32F = 115, - D3DDDIFMT_A32B32G32R32F = 116, - - D3DDDIFMT_CxV8U8 = 117, - - // Monochrome 1 bit per pixel format - D3DDDIFMT_A1 = 118, - - // 2.8 biased fixed point - D3DDDIFMT_A2B10G10R10_XR_BIAS = 119, - - // Decode compressed buffer formats - D3DDDIFMT_DXVACOMPBUFFER_BASE = 150, - D3DDDIFMT_PICTUREPARAMSDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+0, // 150 - D3DDDIFMT_MACROBLOCKDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+1, // 151 - D3DDDIFMT_RESIDUALDIFFERENCEDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+2, // 152 - D3DDDIFMT_DEBLOCKINGDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+3, // 153 - D3DDDIFMT_INVERSEQUANTIZATIONDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+4, // 154 - D3DDDIFMT_SLICECONTROLDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+5, // 155 - D3DDDIFMT_BITSTREAMDATA = D3DDDIFMT_DXVACOMPBUFFER_BASE+6, // 156 - D3DDDIFMT_MOTIONVECTORBUFFER = D3DDDIFMT_DXVACOMPBUFFER_BASE+7, // 157 - D3DDDIFMT_FILMGRAINBUFFER = D3DDDIFMT_DXVACOMPBUFFER_BASE+8, // 158 - D3DDDIFMT_DXVA_RESERVED9 = D3DDDIFMT_DXVACOMPBUFFER_BASE+9, // 159 - D3DDDIFMT_DXVA_RESERVED10 = D3DDDIFMT_DXVACOMPBUFFER_BASE+10, // 160 - D3DDDIFMT_DXVA_RESERVED11 = D3DDDIFMT_DXVACOMPBUFFER_BASE+11, // 161 - D3DDDIFMT_DXVA_RESERVED12 = D3DDDIFMT_DXVACOMPBUFFER_BASE+12, // 162 - D3DDDIFMT_DXVA_RESERVED13 = D3DDDIFMT_DXVACOMPBUFFER_BASE+13, // 163 - D3DDDIFMT_DXVA_RESERVED14 = D3DDDIFMT_DXVACOMPBUFFER_BASE+14, // 164 - D3DDDIFMT_DXVA_RESERVED15 = D3DDDIFMT_DXVACOMPBUFFER_BASE+15, // 165 - D3DDDIFMT_DXVA_RESERVED16 = D3DDDIFMT_DXVACOMPBUFFER_BASE+16, // 166 - D3DDDIFMT_DXVA_RESERVED17 = D3DDDIFMT_DXVACOMPBUFFER_BASE+17, // 167 - D3DDDIFMT_DXVA_RESERVED18 = D3DDDIFMT_DXVACOMPBUFFER_BASE+18, // 168 - D3DDDIFMT_DXVA_RESERVED19 = D3DDDIFMT_DXVACOMPBUFFER_BASE+19, // 169 - D3DDDIFMT_DXVA_RESERVED20 = D3DDDIFMT_DXVACOMPBUFFER_BASE+20, // 170 - D3DDDIFMT_DXVA_RESERVED21 = D3DDDIFMT_DXVACOMPBUFFER_BASE+21, // 171 - D3DDDIFMT_DXVA_RESERVED22 = D3DDDIFMT_DXVACOMPBUFFER_BASE+22, // 172 - D3DDDIFMT_DXVA_RESERVED23 = D3DDDIFMT_DXVACOMPBUFFER_BASE+23, // 173 - D3DDDIFMT_DXVA_RESERVED24 = D3DDDIFMT_DXVACOMPBUFFER_BASE+24, // 174 - D3DDDIFMT_DXVA_RESERVED25 = D3DDDIFMT_DXVACOMPBUFFER_BASE+25, // 175 - D3DDDIFMT_DXVA_RESERVED26 = D3DDDIFMT_DXVACOMPBUFFER_BASE+26, // 176 - D3DDDIFMT_DXVA_RESERVED27 = D3DDDIFMT_DXVACOMPBUFFER_BASE+27, // 177 - D3DDDIFMT_DXVA_RESERVED28 = D3DDDIFMT_DXVACOMPBUFFER_BASE+28, // 178 - D3DDDIFMT_DXVA_RESERVED29 = D3DDDIFMT_DXVACOMPBUFFER_BASE+29, // 179 - D3DDDIFMT_DXVA_RESERVED30 = D3DDDIFMT_DXVACOMPBUFFER_BASE+30, // 180 - D3DDDIFMT_DXVA_RESERVED31 = D3DDDIFMT_DXVACOMPBUFFER_BASE+31, // 181 - D3DDDIFMT_DXVACOMPBUFFER_MAX = D3DDDIFMT_DXVA_RESERVED31, - - D3DDDIFMT_BINARYBUFFER = 199, - - D3DDDIFMT_FORCE_UINT =0x7fffffff -} D3DDDIFORMAT; - -typedef struct _D3DDDIRECT -{ - LONG left; - LONG top; - LONG right; - LONG bottom; -} D3DDDIRECT; - -typedef struct _D3DDDI_KERNELOVERLAYINFO -{ - D3DKMT_HANDLE hAllocation; // in: Allocation to be displayed - D3DDDIRECT DstRect; // in: Dest rect - D3DDDIRECT SrcRect; // in: Source rect - VOID* pPrivateDriverData; // in: Private driver data - UINT PrivateDriverDataSize; // in: Size of private driver data -} D3DDDI_KERNELOVERLAYINFO; - -typedef enum _D3DDDI_GAMMARAMP_TYPE -{ - D3DDDI_GAMMARAMP_UNINITIALIZED = 0, - D3DDDI_GAMMARAMP_DEFAULT = 1, - D3DDDI_GAMMARAMP_RGB256x3x16 = 2, - D3DDDI_GAMMARAMP_DXGI_1 = 3, -} D3DDDI_GAMMARAMP_TYPE; - -typedef struct _D3DDDI_GAMMA_RAMP_RGB256x3x16 -{ - USHORT Red[256]; - USHORT Green[256]; - USHORT Blue[256]; -} D3DDDI_GAMMA_RAMP_RGB256x3x16; - -typedef struct D3DDDI_DXGI_RGB -{ - float Red; - float Green; - float Blue; -} D3DDDI_DXGI_RGB; - -typedef struct _D3DDDI_GAMMA_RAMP_DXGI_1 -{ - D3DDDI_DXGI_RGB Scale; - D3DDDI_DXGI_RGB Offset; - D3DDDI_DXGI_RGB GammaCurve[1025]; -} D3DDDI_GAMMA_RAMP_DXGI_1; - - -// Used as a value for D3DDDI_VIDEO_PRESENT_SOURCE_ID and D3DDDI_VIDEO_PRESENT_TARGET_ID types to specify -// that the respective video present source/target ID hasn't been initialized. -#define D3DDDI_ID_UNINITIALIZED (UINT)(~0) - -// TODO:[mmilirud] Define this as (UINT)(~1) to avoid collision with valid source ID equal to 0. -// -// Used as a value for D3DDDI_VIDEO_PRESENT_SOURCE_ID and D3DDDI_VIDEO_PRESENT_TARGET_ID types to specify -// that the respective video present source/target ID isn't applicable for the given execution context. -#define D3DDDI_ID_NOTAPPLICABLE (UINT)(0) - -// Used as a value for D3DDDI_VIDEO_PRESENT_SOURCE_ID and D3DDDI_VIDEO_PRESENT_TARGET_ID types to specify -// that the respective video present source/target ID describes every VidPN source/target in question. -#define D3DDDI_ID_ALL (UINT)(~2) - -// -// Hardcoded VidPnSource count -// -#define D3DKMDT_MAX_VIDPN_SOURCES_BITCOUNT 4 -#define D3DKMDT_MAX_VIDPN_SOURCES (1 << D3DKMDT_MAX_VIDPN_SOURCES_BITCOUNT) - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Multi-sampling method descriptor type. -// -// Remarks: Driver is free to partition its quality levels for a given multi-sampling method into as many -// increments as it likes, with the condition that each incremental step does noticably improve -// quality of the presented image. -// -typedef struct _D3DDDI_MULTISAMPLINGMETHOD -{ - // Number of sub-pixels employed in this multi-sampling method (e.g. 2 for 2x and 8 for 8x multi-sampling) - UINT NumSamples; - - // Upper bound on the quality range supported for this multi-sampling method. The range starts from 0 - // and goes upto and including the reported maximum quality setting. - UINT NumQualityLevels; -} -D3DDDI_MULTISAMPLINGMETHOD; - - -///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Purpose: Video signal scan line ordering descriptor type. -// -// Remarks: Scan-line ordering of the video mode, specifies whether each field contains the entire -// content of a frame, or only half of it (i.e. even/odd lines interchangeably). -// Note that while for standard interlaced modes, what field comes first can be inferred -// from the mode, specifying this characteristic explicitly with an enum both frees up the -// client from having to maintain mode-based look-up tables and is extensible for future -// standard modes not listed in the D3DKMDT_VIDEO_SIGNAL_STANDARD enum. -// -typedef enum _D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING -{ - D3DDDI_VSSLO_UNINITIALIZED = 0, - D3DDDI_VSSLO_PROGRESSIVE = 1, - D3DDDI_VSSLO_INTERLACED_UPPERFIELDFIRST = 2, - D3DDDI_VSSLO_INTERLACED_LOWERFIELDFIRST = 3, - D3DDDI_VSSLO_OTHER = 255 -} -D3DDDI_VIDEO_SIGNAL_SCANLINE_ORDERING; - - -typedef enum D3DDDI_FLIPINTERVAL_TYPE -{ - D3DDDI_FLIPINTERVAL_IMMEDIATE = 0, - D3DDDI_FLIPINTERVAL_ONE = 1, - D3DDDI_FLIPINTERVAL_TWO = 2, - D3DDDI_FLIPINTERVAL_THREE = 3, - D3DDDI_FLIPINTERVAL_FOUR = 4, -} D3DDDI_FLIPINTERVAL_TYPE; - - -typedef enum _D3DDDI_POOL -{ - D3DDDIPOOL_SYSTEMMEM = 1, - D3DDDIPOOL_VIDEOMEMORY = 2, - D3DDDIPOOL_LOCALVIDMEM = 3, - D3DDDIPOOL_NONLOCALVIDMEM = 4, -} D3DDDI_POOL; - - -typedef enum _D3DDDIMULTISAMPLE_TYPE -{ - D3DDDIMULTISAMPLE_NONE = 0, - D3DDDIMULTISAMPLE_NONMASKABLE = 1, - D3DDDIMULTISAMPLE_2_SAMPLES = 2, - D3DDDIMULTISAMPLE_3_SAMPLES = 3, - D3DDDIMULTISAMPLE_4_SAMPLES = 4, - D3DDDIMULTISAMPLE_5_SAMPLES = 5, - D3DDDIMULTISAMPLE_6_SAMPLES = 6, - D3DDDIMULTISAMPLE_7_SAMPLES = 7, - D3DDDIMULTISAMPLE_8_SAMPLES = 8, - D3DDDIMULTISAMPLE_9_SAMPLES = 9, - D3DDDIMULTISAMPLE_10_SAMPLES = 10, - D3DDDIMULTISAMPLE_11_SAMPLES = 11, - D3DDDIMULTISAMPLE_12_SAMPLES = 12, - D3DDDIMULTISAMPLE_13_SAMPLES = 13, - D3DDDIMULTISAMPLE_14_SAMPLES = 14, - D3DDDIMULTISAMPLE_15_SAMPLES = 15, - D3DDDIMULTISAMPLE_16_SAMPLES = 16, - - D3DDDIMULTISAMPLE_FORCE_UINT = 0x7fffffff -} D3DDDIMULTISAMPLE_TYPE; - -typedef struct _D3DDDI_RESOURCEFLAGS -{ - union - { - struct - { - UINT RenderTarget : 1; // 0x00000001 - UINT ZBuffer : 1; // 0x00000002 - UINT Dynamic : 1; // 0x00000004 - UINT HintStatic : 1; // 0x00000008 - UINT AutogenMipmap : 1; // 0x00000010 - UINT DMap : 1; // 0x00000020 - UINT WriteOnly : 1; // 0x00000040 - UINT NotLockable : 1; // 0x00000080 - UINT Points : 1; // 0x00000100 - UINT RtPatches : 1; // 0x00000200 - UINT NPatches : 1; // 0x00000400 - UINT SharedResource : 1; // 0x00000800 - UINT DiscardRenderTarget : 1; // 0x00001000 - UINT Video : 1; // 0x00002000 - UINT CaptureBuffer : 1; // 0x00004000 - UINT Primary : 1; // 0x00008000 - UINT Texture : 1; // 0x00010000 - UINT CubeMap : 1; // 0x00020000 - UINT Volume : 1; // 0x00040000 - UINT VertexBuffer : 1; // 0x00080000 - UINT IndexBuffer : 1; // 0x00100000 - UINT DecodeRenderTarget : 1; // 0x00200000 - UINT DecodeCompressedBuffer : 1; // 0x00400000 - UINT VideoProcessRenderTarget: 1; // 0x00800000 - UINT CpuOptimized : 1; // 0x01000000 - UINT MightDrawFromLocked : 1; // 0x02000000 - UINT Overlay : 1; // 0x04000000 - UINT MatchGdiPrimary : 1; // 0x08000000 - UINT InterlacedRefresh : 1; // 0x10000000 - UINT TextApi : 1; // 0x20000000 - UINT RestrictedContent : 1; // 0x40000000 - UINT RestrictSharedAccess : 1; // 0x80000000 - }; - UINT Value; - }; -} D3DDDI_RESOURCEFLAGS; - -typedef struct _D3DDDI_SURFACEINFO -{ - UINT Width; // in: For linear, surface and volume - UINT Height; // in: For surface and volume - UINT Depth; // in: For volume - CONST VOID* pSysMem; - UINT SysMemPitch; - UINT SysMemSlicePitch; -} D3DDDI_SURFACEINFO; - -typedef enum _D3DDDI_ROTATION -{ - D3DDDI_ROTATION_IDENTITY = 1, // No rotation. - D3DDDI_ROTATION_90 = 2, // Rotated 90 degrees. - D3DDDI_ROTATION_180 = 3, // Rotated 180 degrees. - D3DDDI_ROTATION_270 = 4 // Rotated 270 degrees. -} D3DDDI_ROTATION; - -typedef enum D3DDDI_SCANLINEORDERING -{ - D3DDDI_SCANLINEORDERING_UNKNOWN = 0, - D3DDDI_SCANLINEORDERING_PROGRESSIVE = 1, - D3DDDI_SCANLINEORDERING_INTERLACED = 2, -} D3DDDI_SCANLINEORDERING; - -typedef struct _D3DDDIARG_CREATERESOURCE -{ - D3DDDIFORMAT Format; - D3DDDI_POOL Pool; - D3DDDIMULTISAMPLE_TYPE MultisampleType; - UINT MultisampleQuality; - CONST D3DDDI_SURFACEINFO* pSurfList; // in: List of sub resource objects to create - UINT SurfCount; // in: Number of sub resource objects - UINT MipLevels; - UINT Fvf; // in: FVF format for vertex buffers - D3DDDI_VIDEO_PRESENT_SOURCE_ID VidPnSourceId; // in: VidPnSourceId on which the primary surface is created - D3DDDI_RATIONAL RefreshRate; // in: RefreshRate that this primary surface is to be used with - HANDLE hResource; // in/out: D3D runtime handle/UM driver handle - D3DDDI_RESOURCEFLAGS Flags; - D3DDDI_ROTATION Rotation; // in: The orientation of the resource. (0, 90, 180, 270) -} D3DDDIARG_CREATERESOURCE; - -typedef struct _D3DDDICB_SIGNALFLAGS -{ - union - { - struct - { - UINT SignalAtSubmission : 1; - UINT Reserved : 31; - }; - UINT Value; - }; -} D3DDDICB_SIGNALFLAGS; - -#define D3DDDI_MAX_OBJECT_WAITED_ON 32 -#define D3DDDI_MAX_OBJECT_SIGNALED 32 - -typedef enum _D3DDDI_SYNCHRONIZATIONOBJECT_TYPE -{ - D3DDDI_SYNCHRONIZATION_MUTEX = 1, - D3DDDI_SEMAPHORE = 2, - D3DDDI_FENCE = 3, - D3DDDI_CPU_NOTIFICATION = 4, -} D3DDDI_SYNCHRONIZATIONOBJECT_TYPE; - -typedef struct _D3DDDI_SYNCHRONIZATIONOBJECTINFO -{ - D3DDDI_SYNCHRONIZATIONOBJECT_TYPE Type; // in: Type of synchronization object to create. - union - { - struct - { - BOOL InitialState; // in: Initial state of a synchronization mutex. - } SynchronizationMutex; - - struct - { - UINT MaxCount; // in: Max count of the semaphore. - UINT InitialCount; // in: Initial count of the semaphore. - } Semaphore; - - - struct - { - UINT Reserved[16]; // Reserved for future use. - } Reserved; - }; -} D3DDDI_SYNCHRONIZATIONOBJECTINFO; - -typedef struct _D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS -{ - UINT Shared : 1; - UINT Reserved : 31; -} D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS; - -typedef struct _D3DDDI_SYNCHRONIZATIONOBJECTINFO2 -{ - D3DDDI_SYNCHRONIZATIONOBJECT_TYPE Type; // in: Type of synchronization object to create. - D3DDDI_SYNCHRONIZATIONOBJECT_FLAGS Flags; // in: flags. - union - { - struct - { - BOOL InitialState; // in: Initial state of a synchronization mutex. - } SynchronizationMutex; - - struct - { - UINT MaxCount; // in: Max count of the semaphore. - UINT InitialCount; // in: Initial count of the semaphore. - } Semaphore; - - struct - { - UINT64 FenceValue; // in: inital fence value. - } Fence; - - struct - { - HANDLE Event; // in: Handle to the event - } CPUNotification; - - - struct - { - UINT64 Reserved[8]; // Reserved for future use. - } Reserved; - }; - - D3DKMT_HANDLE SharedHandle; // out: global shared handle (when requested to be shared) - -} D3DDDI_SYNCHRONIZATIONOBJECTINFO2; - -// -// Defines the maximum number of context a particular command buffer can -// be broadcast to. -// -#define D3DDDI_MAX_BROADCAST_CONTEXT 64 - -// -// Allocation priorities. -// -#define D3DDDI_ALLOCATIONPRIORITY_MINIMUM 0x28000000 -#define D3DDDI_ALLOCATIONPRIORITY_LOW 0x50000000 -#define D3DDDI_ALLOCATIONPRIORITY_NORMAL 0x78000000 -#define D3DDDI_ALLOCATIONPRIORITY_HIGH 0xa0000000 -#define D3DDDI_ALLOCATIONPRIORITY_MAXIMUM 0xc8000000 - -#endif // (NTDDI_VERSION >= NTDDI_LONGHORN) || defined(D3DKMDT_SPECIAL_MULTIPLATFORM_TOOL) - -#pragma warning(pop) - -#endif /* _D3DUKMDT_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/d3dvec.inl b/qt-correction-tool/pub/ddk/d3dvec.inl deleted file mode 100644 index 332e435..0000000 --- a/qt-correction-tool/pub/ddk/d3dvec.inl +++ /dev/null @@ -1,256 +0,0 @@ - -/****************************************************************** - * * - * D3DVec.inl * - * * - * Float-valued 3D vector class for Direct3D. * - * * - * Copyright (c) Microsoft Corp. All rights reserved. * - * * - ******************************************************************/ - -#include - -// ===================================== -// Constructors -// ===================================== - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE f) -{ - x = y = z = f; -} - -inline -_D3DVECTOR::_D3DVECTOR(D3DVALUE _x, D3DVALUE _y, D3DVALUE _z) -{ - x = _x; y = _y; z = _z; -} - -inline -_D3DVECTOR::_D3DVECTOR(const D3DVALUE f[3]) -{ - x = f[0]; y = f[1]; z = f[2]; -} - -// ===================================== -// Access grants -// ===================================== - -inline const D3DVALUE& -_D3DVECTOR::operator[](int i) const -{ - return (&x)[i]; -} - -inline D3DVALUE& -_D3DVECTOR::operator[](int i) -{ - return (&x)[i]; -} - - -// ===================================== -// Assignment operators -// ===================================== - -inline _D3DVECTOR& -_D3DVECTOR::operator += (const _D3DVECTOR& v) -{ - x += v.x; y += v.y; z += v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator -= (const _D3DVECTOR& v) -{ - x -= v.x; y -= v.y; z -= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (const _D3DVECTOR& v) -{ - x *= v.x; y *= v.y; z *= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (const _D3DVECTOR& v) -{ - x /= v.x; y /= v.y; z /= v.z; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator *= (D3DVALUE s) -{ - x *= s; y *= s; z *= s; - return *this; -} - -inline _D3DVECTOR& -_D3DVECTOR::operator /= (D3DVALUE s) -{ - x /= s; y /= s; z /= s; - return *this; -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v) -{ - return v; -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v) -{ - return _D3DVECTOR(-v.x, -v.y, -v.z); -} - -inline _D3DVECTOR -operator + (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x+v2.x, v1.y+v2.y, v1.z+v2.z); -} - -inline _D3DVECTOR -operator - (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x-v2.x, v1.y-v2.y, v1.z-v2.z); -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x*v2.x, v1.y*v2.y, v1.z*v2.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR(v1.x/v2.x, v1.y/v2.y, v1.z/v2.z); -} - -inline int -operator < (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] < v2[0] && v1[1] < v2[1] && v1[2] < v2[2]; -} - -inline int -operator <= (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1[0] <= v2[0] && v1[1] <= v2[1] && v1[2] <= v2[2]; -} - -inline _D3DVECTOR -operator * (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator * (D3DVALUE s, const _D3DVECTOR& v) -{ - return _D3DVECTOR(s*v.x, s*v.y, s*v.z); -} - -inline _D3DVECTOR -operator / (const _D3DVECTOR& v, D3DVALUE s) -{ - return _D3DVECTOR(v.x/s, v.y/s, v.z/s); -} - -inline int -operator == (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x==v2.x && v1.y==v2.y && v1.z == v2.z; -} - -inline D3DVALUE -Magnitude (const _D3DVECTOR& v) -{ - return (D3DVALUE) sqrt(SquareMagnitude(v)); -} - -inline D3DVALUE -SquareMagnitude (const _D3DVECTOR& v) -{ - return v.x*v.x + v.y*v.y + v.z*v.z; -} - -inline _D3DVECTOR -Normalize (const _D3DVECTOR& v) -{ - return v / Magnitude(v); -} - -inline D3DVALUE -Min (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (v.y < ret) ret = v.y; - if (v.z < ret) ret = v.z; - return ret; -} - -inline D3DVALUE -Max (const _D3DVECTOR& v) -{ - D3DVALUE ret = v.x; - if (ret < v.y) ret = v.y; - if (ret < v.z) ret = v.z; - return ret; -} - -inline _D3DVECTOR -Minimize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] < v2[0] ? v1[0] : v2[0], - v1[1] < v2[1] ? v1[1] : v2[1], - v1[2] < v2[2] ? v1[2] : v2[2]); -} - -inline _D3DVECTOR -Maximize (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return _D3DVECTOR( v1[0] > v2[0] ? v1[0] : v2[0], - v1[1] > v2[1] ? v1[1] : v2[1], - v1[2] > v2[2] ? v1[2] : v2[2]); -} - -inline D3DVALUE -DotProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - return v1.x*v2.x + v1.y * v2.y + v1.z*v2.z; -} - -inline _D3DVECTOR -CrossProduct (const _D3DVECTOR& v1, const _D3DVECTOR& v2) -{ - _D3DVECTOR result; - - result[0] = v1[1] * v2[2] - v1[2] * v2[1]; - result[1] = v1[2] * v2[0] - v1[0] * v2[2]; - result[2] = v1[0] * v2[1] - v1[1] * v2[0]; - - return result; -} - -inline _D3DMATRIX -operator* (const _D3DMATRIX& a, const _D3DMATRIX& b) -{ - _D3DMATRIX ret; - for (int i=0; i<4; i++) { - for (int j=0; j<4; j++) { - ret(i, j) = 0.0f; - for (int k=0; k<4; k++) { - ret(i, j) += a(i, k) * b(k, j); - } - } - } - return ret; -} - - diff --git a/qt-correction-tool/pub/ddk/d4drvif.h b/qt-correction-tool/pub/ddk/d4drvif.h deleted file mode 100644 index b07e3a3..0000000 --- a/qt-correction-tool/pub/ddk/d4drvif.h +++ /dev/null @@ -1,155 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - D4drvif.h - -Abstract: - - DOT4 Driver Interface - - ---*/ - -#ifndef _DOT4DRVIF_H -#define _DOT4DRVIF_H - -////////////////////////////////////////////////////////////////////////////// -// Includes -////////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////////// -// Defines -////////////////////////////////////////////////////////////////////////////// -#define MAX_SERVICE_LENGTH 40 - - -#ifndef CTL_CODE - - // -// Macro definition for defining IOCTL and FSCTL function control codes. Note -// that function codes 0-2047 are reserved for Microsoft Corporation, and -// 2048-4095 are reserved for customers. -// - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -// -// Define the method codes for how buffers are passed for I/O and FS controls -// - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -// -// Define the access check value for any access -// -// -// The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in -// ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these -// constants *MUST* always be in sync. -// - - -#define FILE_ANY_ACCESS 0 -#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe -#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe - -#endif - -#define FILE_DEVICE_DOT4 0x3a -#define IOCTL_DOT4_USER_BASE 2049 -#define IOCTL_DOT4_LAST IOCTL_DOT4_USER_BASE + 9 - -#define IOCTL_DOT4_CREATE_SOCKET CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 7, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_DESTROY_SOCKET CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 9, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_WAIT_FOR_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 8, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_OPEN_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 0, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_CLOSE_CHANNEL CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 1, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_DOT4_READ CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 2, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_WRITE CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 3, METHOD_IN_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_DOT4_ADD_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 4, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_DOT4_REMOVE_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 5, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_DOT4_WAIT_ACTIVITY_BROADCAST CTL_CODE(FILE_DEVICE_DOT4, IOCTL_DOT4_USER_BASE + 6, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - - -////////////////////////////////////////////////////////////////////////////// -// Types -////////////////////////////////////////////////////////////////////////////// - -typedef struct _DOT4_DRIVER_CMD -{ - // Handle to channel - CHANNEL_HANDLE hChannelHandle; - - // Length of request - ULONG ulSize; - - // Offset into buffer - ULONG ulOffset; - - // Timeout of operation. Can be INFINITE. - ULONG ulTimeout; - -} DOT4_DRIVER_CMD, *PDOT4_DRIVER_CMD; - - -typedef struct _DOT4_DC_OPEN_DATA -{ - // Host socket created by CREATE_SOCKET - unsigned char bHsid; - - // TRUE to immediately add activity broadcast upon creation - unsigned char fAddActivity; - - // Handle to channel returned - CHANNEL_HANDLE hChannelHandle; - -} DOT4_DC_OPEN_DATA, *PDOT4_DC_OPEN_DATA; - - -typedef struct _DOT4_DC_CREATE_DATA -{ - // This or service name sent - unsigned char bPsid; - - CHAR pServiceName[MAX_SERVICE_LENGTH + 1]; - - // Type (stream or packet) of channels on socket - unsigned char bType; - - // Size of read buffer for channels on socket - ULONG ulBufferSize; - - USHORT usMaxHtoPPacketSize; - - USHORT usMaxPtoHPacketSize; - - // Host socket id returned - unsigned char bHsid; - -} DOT4_DC_CREATE_DATA, *PDOT4_DC_CREATE_DATA; - - -typedef struct _DOT4_DC_DESTROY_DATA -{ - // Host socket created by CREATE_SOCKET - unsigned char bHsid; - -} DOT4_DC_DESTROY_DATA, *PDOT4_DC_DESTROY_DATA; - - -////////////////////////////////////////////////////////////////////////////// -// Prototypes -////////////////////////////////////////////////////////////////////////////// - - -#endif - diff --git a/qt-correction-tool/pub/ddk/d4iface.h b/qt-correction-tool/pub/ddk/d4iface.h deleted file mode 100644 index 26fbb8d..0000000 --- a/qt-correction-tool/pub/ddk/d4iface.h +++ /dev/null @@ -1,101 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - D4iface.h - -Abstract: - - DOT4 Interface - - ---*/ - -#ifndef _DOT4_IFACE_H -#define _DOT4_IFACE_H - -#ifdef __cplusplus -extern "C" { -#endif -////////////////////////////////////////////////////////////////////////////// -// Includes -////////////////////////////////////////////////////////////////////////////// - - -////////////////////////////////////////////////////////////////////////////// -// Defines -////////////////////////////////////////////////////////////////////////////// -#define DOT4_MAX_CHANNELS 128 - -#define NO_TIMEOUT 0 - - -// -// DOT4 Channel types -// -#define STREAM_TYPE_CHANNEL 1 -#define PACKET_TYPE_CHANNEL 2 - - -// -// DOT4 broadcast Activity messages -// -#define DOT4_STREAM_RECEIVED 0x100 -#define DOT4_STREAM_CREDITS 0x101 -#define DOT4_MESSAGE_RECEIVED 0x102 // Message is received -#define DOT4_DISCONNECT 0x103 // The link was disconnected -#define DOT4_CHANNEL_CLOSED 0x105 // A channel was closed - -// -// DOT4 Channels -// -#define DOT4_CHANNEL 0 -#define HP_MESSAGE_PROCESSOR 1 -#define PRINTER_CHANNEL 2 -// As of revision 3.7 of the DOT4 specification, socket 3 had no assignment -#define SCANNER_CHANNEL 4 -#define MIO_COMMAND_PROCESSOR 5 -#define ECHO_CHANNEL 6 -#define FAX_SEND_CHANNEL 7 -#define FAX_RECV_CHANNEL 8 -#define DIAGNOSTIC_CHANNEL 9 -#define HP_RESERVED 10 -#define IMAGE_DOWNLOAD 11 -#define HOST_DATASTORE_UPLOAD 12 -#define HOST_DATASTORE_DOWNLOAD 13 -#define CONFIG_UPLOAD 14 -#define CONFIG_DOWNLOAD 15 - - -////////////////////////////////////////////////////////////////////////////// -// Types -////////////////////////////////////////////////////////////////////////////// -typedef unsigned long CHANNEL_HANDLE; - -typedef CHANNEL_HANDLE *PCHANNEL_HANDLE; - - -typedef struct _DOT4_ACTIVITY -{ - ULONG ulMessage; - - ULONG ulByteCount; - - CHANNEL_HANDLE hChannel; - -} DOT4_ACTIVITY, *PDOT4_ACTIVITY; - - -////////////////////////////////////////////////////////////////////////////// -// Prototypes -////////////////////////////////////////////////////////////////////////////// - -#ifdef __cplusplus -// end of extern "C" -} -#endif - -#endif // _DOT4_IFACE_H - diff --git a/qt-correction-tool/pub/ddk/dciddi.h b/qt-correction-tool/pub/ddk/dciddi.h deleted file mode 100644 index b597f6f..0000000 --- a/qt-correction-tool/pub/ddk/dciddi.h +++ /dev/null @@ -1,288 +0,0 @@ -/******************************************************************* - * - * FILE: dciddi.h - * - * DESCRIPTION: definitions for MS/Intel-defined DCI interface - * - * Copyright (C) 1994-1999 Intel/Microsoft Corporation. All Rights Reserved. - * - *******************************************************************/ - -#ifndef _INC_DCIDDI -#define _INC_DCIDDI - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* DCI Command Escapes */ -#define DCICOMMAND 3075 -#define DCI_VERSION 0x0100 - -#define DCICREATEPRIMARYSURFACE 1 -#define DCICREATEOFFSCREENSURFACE 2 -#define DCICREATEOVERLAYSURFACE 3 -#define DCIENUMSURFACE 4 -#define DCIESCAPE 5 - -/* DCI-Defined error codes */ -#define DCI_OK 0 /* success */ - -/* Hard errors -- DCI will be unavailable */ -#define DCI_FAIL_GENERIC -1 -#define DCI_FAIL_UNSUPPORTEDVERSION -2 -#define DCI_FAIL_INVALIDSURFACE -3 -#define DCI_FAIL_UNSUPPORTED -4 - -/* Soft errors -- DCI may be available later */ -#define DCI_ERR_CURRENTLYNOTAVAIL -5 -#define DCI_ERR_INVALIDRECT -6 -#define DCI_ERR_UNSUPPORTEDFORMAT -7 -#define DCI_ERR_UNSUPPORTEDMASK -8 -#define DCI_ERR_TOOBIGHEIGHT -9 -#define DCI_ERR_TOOBIGWIDTH -10 -#define DCI_ERR_TOOBIGSIZE -11 -#define DCI_ERR_OUTOFMEMORY -12 -#define DCI_ERR_INVALIDPOSITION -13 -#define DCI_ERR_INVALIDSTRETCH -14 -#define DCI_ERR_INVALIDCLIPLIST -15 -#define DCI_ERR_SURFACEISOBSCURED -16 -#define DCI_ERR_XALIGN -17 -#define DCI_ERR_YALIGN -18 -#define DCI_ERR_XYALIGN -19 -#define DCI_ERR_WIDTHALIGN -20 -#define DCI_ERR_HEIGHTALIGN -21 - -/* success messages -- DCI call succeeded, but specified item changed */ -#define DCI_STATUS_POINTERCHANGED 1 -#define DCI_STATUS_STRIDECHANGED 2 -#define DCI_STATUS_FORMATCHANGED 4 -#define DCI_STATUS_SURFACEINFOCHANGED 8 -#define DCI_STATUS_CHROMAKEYCHANGED 16 -#define DCI_STATUS_WASSTILLDRAWING 32 - -#define DCI_SUCCESS(error) (((DCIRVAL)error) >= 0) - -/* DCI Capability Flags */ -#define DCI_SURFACE_TYPE 0x0000000F -#define DCI_PRIMARY 0x00000000 -#define DCI_OFFSCREEN 0x00000001 -#define DCI_OVERLAY 0x00000002 - -#define DCI_VISIBLE 0x00000010 -#define DCI_CHROMAKEY 0x00000020 -#define DCI_1632_ACCESS 0x00000040 -#define DCI_DWORDSIZE 0x00000080 -#define DCI_DWORDALIGN 0x00000100 -#define DCI_WRITEONLY 0x00000200 -#define DCI_ASYNC 0x00000400 - -#define DCI_CAN_STRETCHX 0x00001000 -#define DCI_CAN_STRETCHY 0x00002000 -#define DCI_CAN_STRETCHXY (DCI_CAN_STRETCHX | DCI_CAN_STRETCHY) - -#define DCI_CAN_STRETCHXN 0x00004000 -#define DCI_CAN_STRETCHYN 0x00008000 -#define DCI_CAN_STRETCHXYN (DCI_CAN_STRETCHXN | DCI_CAN_STRETCHYN) - - -#define DCI_CANOVERLAY 0x00010000 - -/* - * Win32 RGNDATA structure. This will be used for cliplist info. passing. - */ -#if (WINVER < 0x0400) - -#ifndef RDH_RECTANGLES - -typedef struct tagRECTL -{ - LONG left; - LONG top; - LONG right; - LONG bottom; -} RECTL; -typedef RECTL* PRECTL; -typedef RECTL NEAR* NPRECTL; -typedef RECTL FAR* LPRECTL; -typedef const RECTL FAR* LPCRECTL; - -#define RDH_RECTANGLES 0 - -typedef struct tagRGNDATAHEADER { - DWORD dwSize; /* size of structure */ - DWORD iType; /* Will be RDH_RECTANGLES */ - DWORD nCount; /* # of clipping rectangles */ - DWORD nRgnSize; /* size of buffer -- can be zero */ - RECTL rcBound; /* bounding rectangle for region*/ -} RGNDATAHEADER; -typedef RGNDATAHEADER* PRGNDATAHEADER; -typedef RGNDATAHEADER NEAR* NPRGNDATAHEADER; -typedef RGNDATAHEADER FAR* LPRGNDATAHEADER; -typedef const RGNDATAHEADER FAR* LPCRGNDATAHEADER; - -typedef struct tagRGNDATA { - RGNDATAHEADER rdh; - char Buffer[1]; -} RGNDATA; -typedef RGNDATA* PRGNDATA; -typedef RGNDATA NEAR* NPRGNDATA; -typedef RGNDATA FAR* LPRGNDATA; -typedef const RGNDATA FAR* LPCRGNDATA; - -#endif -#endif - -typedef int DCIRVAL; /* return for callbacks */ - -/************************************************************************** - * input structures - **************************************************************************/ - -/* - * Used by a DCI client to provide input parameters for the - * DCICREATEPRIMARYSURFACE escape. - */ -typedef struct _DCICMD { - DWORD dwCommand; - DWORD dwParam1; - DWORD dwParam2; - DWORD dwVersion; - DWORD dwReserved; -} DCICMD; - -/* - * This structure is used by a DCI client to provide input parameters for - * the DCICREATE... calls. The fields that are actually relevant differ for - * each of the three calls. Details are in the DCI Spec chapter providing - * the function specifications. - */ -typedef struct _DCICREATEINPUT { - DCICMD cmd; /* common header structure */ - DWORD dwCompression; /* format of surface to be created */ - DWORD dwMask[3]; /* for nonstandard RGB (e.g. 5-6-5, RGB32) */ - DWORD dwWidth; /* height of the surface to be created */ - DWORD dwHeight; /* width of input surfaces */ - DWORD dwDCICaps; /* capabilities of surface wanted */ - DWORD dwBitCount; /* bit depth of format to be created */ - LPVOID lpSurface; /* pointer to an associated surface */ -} DCICREATEINPUT, FAR *LPDCICREATEINPUT; - - -/************************************************************************** - * surface info. structures - **************************************************************************/ - -/* - * This structure is used to return information about available support - * during a DCIEnumSurface call. It is also used to create a primary - * surface, and as a member of the larger structures returned by the - * offscreen and overlay calls. - */ - typedef struct _DCISURFACEINFO { - DWORD dwSize; /* size of structure */ - DWORD dwDCICaps; /* capability flags (stretch, etc.) */ - DWORD dwCompression; /* format of surface to be created */ - DWORD dwMask[3]; /* for BI_BITMASK surfaces */ - - DWORD dwWidth; /* width of surface */ - DWORD dwHeight; /* height of surface */ - LONG lStride; /* distance in bytes betw. one pixel */ - /* and the pixel directly below it */ - DWORD dwBitCount; /* Bits per pixel for this dwCompression */ - ULONG_PTR dwOffSurface; /* offset of surface pointer */ - WORD wSelSurface; /* selector of surface pointer */ - WORD wReserved; - - DWORD dwReserved1; /* reserved for provider */ - DWORD dwReserved2; /* reserved for DCIMAN */ - DWORD dwReserved3; /* reserved for future */ - DCIRVAL (CALLBACK *BeginAccess) (LPVOID, LPRECT); /* BeginAccess callback */ - void (CALLBACK *EndAccess) (LPVOID); /* EndAcess callback */ - void (CALLBACK *DestroySurface) (LPVOID); /* Destroy surface callback */ -} DCISURFACEINFO, FAR *LPDCISURFACEINFO; - - -/* - * This structure is used by a DCI client to provide input parameters for the - * DCIEnumSurface call. - */ - -typedef -void -(*ENUM_CALLBACK) ( - LPDCISURFACEINFO lpSurfaceInfo, - LPVOID lpContext - ); - -typedef struct _DCIENUMINPUT { - DCICMD cmd; /* common header structure */ - RECT rSrc; /* source rect. for stretch */ - RECT rDst; /* dest. rect. for stretch */ - void (CALLBACK *EnumCallback)(LPDCISURFACEINFO, LPVOID); /* callback for supported formats */ - LPVOID lpContext; -} DCIENUMINPUT, FAR *LPDCIENUMINPUT; - - -/* - * This structure must be allocated and returned by the DCI provider in - * response to a DCICREATEPRIMARYSURFACE call. - */ - typedef DCISURFACEINFO DCIPRIMARY, FAR *LPDCIPRIMARY; - -/* - * This structure must be allocated and returned by the DCI provider in - * response to a DCICREATEOFFSCREENSURFACE call. - */ - typedef struct _DCIOFFSCREEN { - - DCISURFACEINFO dciInfo; /* surface info */ - DCIRVAL (CALLBACK *Draw) (LPVOID); /* copy to onscreen buffer */ - DCIRVAL (CALLBACK *SetClipList) (LPVOID, LPRGNDATA); /* SetCliplist callback */ - DCIRVAL (CALLBACK *SetDestination) (LPVOID, LPRECT, LPRECT); /* SetDestination callback */ -} DCIOFFSCREEN, FAR *LPDCIOFFSCREEN; - - -/* - * This structure must be allocated and returned by the DCI provider in response - * to a DCICREATEOVERLAYSURFACE call. - */ - typedef struct _DCIOVERLAY{ - - DCISURFACEINFO dciInfo; /* surface info */ - DWORD dwChromakeyValue; /* chromakey color value */ - DWORD dwChromakeyMask; /* specifies valid bits of value */ -} DCIOVERLAY, FAR *LPDCIOVERLAY; - - -/* DCI FOURCC def.s for extended DIB formats */ - -#ifndef YVU9 -#define YVU9 mmioFOURCC('Y','V','U','9') -#endif -#ifndef Y411 -#define Y411 mmioFOURCC('Y','4','1','1') -#endif -#ifndef YUY2 -#define YUY2 mmioFOURCC('Y','U','Y','2') -#endif -#ifndef YVYU -#define YVYU mmioFOURCC('Y','V','Y','U') -#endif -#ifndef UYVY -#define UYVY mmioFOURCC('U','Y','V','Y') -#endif -#ifndef Y211 -#define Y211 mmioFOURCC('Y','2','1','1') -#endif - -#ifdef __cplusplus -} -#endif - -#endif // _INC_DCIDDI - diff --git a/qt-correction-tool/pub/ddk/dciman.h b/qt-correction-tool/pub/ddk/dciman.h deleted file mode 100644 index 0313d6a..0000000 --- a/qt-correction-tool/pub/ddk/dciman.h +++ /dev/null @@ -1,156 +0,0 @@ -/**************************************************************************** - - DCIMAN.H - - Copyright (C) 1993-1999 Microsoft Corporation. All Rights Reserved. - - DCIMAN 1.0 client interface definitions - - ***************************************************************************/ - -#ifndef _INC_DCIMAN -#define _INC_DCIMAN - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus - #define __inline inline - extern "C" { -#endif - -/**************************************************************************** - ***************************************************************************/ - -#include "dciddi.h" // interface to the DCI provider - -/**************************************************************************** - ***************************************************************************/ - -DECLARE_HANDLE(HWINWATCH); // context handle for WinWatch instance - -/**************************************************************************** - ***************************************************************************/ - -extern HDC WINAPI DCIOpenProvider(void); -extern void WINAPI DCICloseProvider(HDC hdc); - -extern int WINAPI DCICreatePrimary(HDC hdc, LPDCISURFACEINFO FAR *lplpSurface); -extern int WINAPI DCICreateOffscreen(HDC hdc, DWORD dwCompression, DWORD dwRedMask, - DWORD dwGreenMask, DWORD dwBlueMask, DWORD dwWidth, DWORD dwHeight, - DWORD dwDCICaps, DWORD dwBitCount, LPDCIOFFSCREEN FAR *lplpSurface); -extern int WINAPI DCICreateOverlay(HDC hdc, LPVOID lpOffscreenSurf, - LPDCIOVERLAY FAR *lplpSurface); -extern int WINAPI DCIEnum(HDC hdc, LPRECT lprDst, LPRECT lprSrc, LPVOID lpFnCallback, - LPVOID lpContext); -extern DCIRVAL WINAPI DCISetSrcDestClip(LPDCIOFFSCREEN pdci, LPRECT srcrc, - LPRECT destrc, LPRGNDATA prd ); - -extern HWINWATCH WINAPI WinWatchOpen(HWND hwnd); -extern void WINAPI WinWatchClose(HWINWATCH hWW); - -// API changed to copy region data instead of return pointer to it -extern UINT WINAPI WinWatchGetClipList(HWINWATCH hWW, LPRECT prc, - UINT size, LPRGNDATA prd); -extern BOOL WINAPI WinWatchDidStatusChange(HWINWATCH hWW); - -extern DWORD WINAPI GetWindowRegionData(HWND hwnd, DWORD size, LPRGNDATA prd); -extern DWORD WINAPI GetDCRegionData(HDC hdc, DWORD size, LPRGNDATA prd); - - -#define WINWATCHNOTIFY_START 0 -#define WINWATCHNOTIFY_STOP 1 -#define WINWATCHNOTIFY_DESTROY 2 -#define WINWATCHNOTIFY_CHANGING 3 -#define WINWATCHNOTIFY_CHANGED 4 -typedef void (CALLBACK *WINWATCHNOTIFYPROC)(HWINWATCH hww, HWND hwnd, DWORD code, LPARAM lParam); - -extern BOOL WINAPI WinWatchNotify(HWINWATCH hWW, WINWATCHNOTIFYPROC NotifyCallback, - LPARAM NotifyParam ); - -#ifdef WIN32 -/**************************************************************************** - helper functions to call DCIMAN16.DLL - ***************************************************************************/ -extern void WINAPI DCIEndAccess(LPDCISURFACEINFO pdci); -extern DCIRVAL WINAPI DCIBeginAccess(LPDCISURFACEINFO pdci, int x, int y, int dx, int dy); -extern void WINAPI DCIDestroy(LPDCISURFACEINFO pdci); -extern DCIRVAL WINAPI DCIDraw(LPDCIOFFSCREEN pdci); -extern DCIRVAL WINAPI DCISetClipList(LPDCIOFFSCREEN pdci, LPRGNDATA prd); -extern DCIRVAL WINAPI DCISetDestination(LPDCIOFFSCREEN pdci, LPRECT dst, LPRECT src); - - -#else - -extern int WINAPI DCISendCommand(HDC hdc, VOID FAR *pcmd, int nSize, VOID FAR * FAR * lplpOut); - -/**************************************************************************** - helper macros to call DCI callbacks - ***************************************************************************/ -__inline void DCIDestroy(LPDCISURFACEINFO pdci) -{ - if( pdci->DestroySurface != NULL ) { - pdci->DestroySurface(pdci); - } -} - -__inline void DCIEndAccess(LPDCISURFACEINFO pdci) -{ - if( pdci->EndAccess != NULL ) { - pdci->EndAccess(pdci); - } -} - -__inline DCIRVAL DCIBeginAccess(LPDCISURFACEINFO pdci, int x, int y, int dx, int dy) -{ - RECT rc; - - if( pdci->BeginAccess != NULL ) { - rc.left=x; - rc.top=y; - rc.right = rc.left+dx; - rc.bottom = rc.top+dy; - return pdci->BeginAccess(pdci, &rc); - } else { - return DCI_OK; - } -} - -__inline DCIRVAL DCIDraw(LPDCIOFFSCREEN pdci) -{ - if( pdci->Draw != NULL ) { - return pdci->Draw(pdci); - } else { - return DCI_OK; - } -} - -__inline DCIRVAL DCISetClipList(LPDCIOFFSCREEN pdci, LPRGNDATA prd) -{ - if( pdci->SetClipList != NULL ) { - return pdci->SetClipList(pdci, prd); - } else { - return DCI_OK; - } -} - -__inline DCIRVAL DCISetDestination(LPDCIOFFSCREEN pdci, LPRECT dst, LPRECT src) -{ - if( pdci->SetDestination != NULL ) { - return pdci->SetDestination(pdci, dst, src); - } else { - return DCI_OK; - } -} -#endif - -/**************************************************************************** - ***************************************************************************/ - -#ifdef __cplusplus - } -#endif - -#endif // _INC_DCIMAN - diff --git a/qt-correction-tool/pub/ddk/dderror.h b/qt-correction-tool/pub/ddk/dderror.h deleted file mode 100644 index 737ebc9..0000000 --- a/qt-correction-tool/pub/ddk/dderror.h +++ /dev/null @@ -1,47 +0,0 @@ - -/*++ BUILD Version: ???? Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - dderror.h - -Abstract: - - This module defines the 32-Bit Windows error codes that are useable by - portable kernel drivers. - -Revision History: - ---*/ - -#ifndef _DDERROR_ -#define _DDERROR_ - -/* - * This file is a subset of Win32 error codes. Other win32 error codes - * are not supported by portable drivers and should not beused. - * This #define removes the definitions of all other error codes. - */ - -#define _WINERROR_ - -#define NO_ERROR 0L -#define ERROR_INVALID_FUNCTION 1L -#define ERROR_NOT_ENOUGH_MEMORY 8L -#define ERROR_DEV_NOT_EXIST 55L -#define ERROR_INVALID_PARAMETER 87L -#define ERROR_INSUFFICIENT_BUFFER 122L -#define ERROR_INVALID_NAME 123L -#define ERROR_BUSY 170L -#define ERROR_MORE_DATA 234L -#define WAIT_TIMEOUT 258L -#define ERROR_IO_PENDING 997L -#define ERROR_DEVICE_REINITIALIZATION_NEEDED 1164L -#define ERROR_CONTINUE 1246L -#define ERROR_NO_MORE_DEVICES 1248L - -#endif /* _DDERROR_ */ - - diff --git a/qt-correction-tool/pub/ddk/deviceservices.h b/qt-correction-tool/pub/ddk/deviceservices.h deleted file mode 100644 index 8ee05bd..0000000 --- a/qt-correction-tool/pub/ddk/deviceservices.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * DeviceServices.h - * - * Contains definitions for the core Device Services platform - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _DEVICESERVICES_H_ -#define _DEVICESERVICES_H_ - -#include "BridgeDeviceService.h" - -/*****************************************************************************/ -/* Service Info */ -/*****************************************************************************/ - -/* Service Info Version - */ - -#define DEVSVC_SERVICEINFO_VERSION 0x00000064 - -/* Service Flags - */ - -#define DEVSVCTYPE_DEFAULT 0x00000000 -#define DEVSVCTYPE_ABSTRACT 0x00000001 - -/*****************************************************************************/ -/* Common Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_Services, - 0x14fa7268, 0x0b6c, 0x4214, 0x94, 0x87, 0x43, 0x5b, 0x48, 0x0a, 0x8c, 0x4f); - - -/* PKEY_Services_ServiceDisplayName - * - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_Services_ServiceDisplayName, - 0x14fa7268, 0x0b6c, 0x4214, 0x94, 0x87, 0x43, 0x5b, 0x48, 0x0a, 0x8c, 0x4f, - 2); - -#define NAME_Services_ServiceDisplayName L"ServiceDisplayName" - - -/* PKEY_Services_ServiceIcon - * - * Type: AUInt8 - * Form: ByteArray - */ - -DEFINE_DEVSVCPROPKEY(PKEY_Services_ServiceIcon, - 0x14fa7268, 0x0b6c, 0x4214, 0x94, 0x87, 0x43, 0x5b, 0x48, 0x0a, 0x8c, 0x4f, - 3); - -#define NAME_Services_ServiceIcon L"ServiceIcon" - - -/* PKEY_Services_ServiceLocale - * - * Contains the RFC4646 compliant language string for data in this service - * - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_Services_ServiceLocale, - 0x14fa7268, 0x0b6c, 0x4214, 0x94, 0x87, 0x43, 0x5b, 0x48, 0x0a, 0x8c, 0x4f, - 4); - -#define NAME_Services_ServiceLocale L"ServiceLocale" - -#endif /* _DEVICESERVICES_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/dispmprt.h b/qt-correction-tool/pub/ddk/dispmprt.h deleted file mode 100644 index b1b1859..0000000 --- a/qt-correction-tool/pub/ddk/dispmprt.h +++ /dev/null @@ -1,1480 +0,0 @@ -/*++ - -Copyright (c) 2004 Microsoft Corporation - -Module Name: - - dispmprt.h - -Abstract: - - This header contain the new Display Loader APIs. - - ---*/ - -#ifndef _DISPMPRT_H_ -#define _DISPMPRT_H_ - -#pragma warning(push) -#pragma warning(disable:4115) // named type definition in parentheses -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - -#ifndef _ACPIIOCT_H_ -#include -#endif - -// -// Old includes which are only kept for now for compatibility -// - -#ifndef _NTOSP_ -#define _NTOSP_ - -// -// Structures used by the kernel drivers to describe which ports must be -// hooked out directly from the V86 emulator to the driver. -// - -typedef enum _EMULATOR_PORT_ACCESS_TYPE { - Uchar, - Ushort, - Ulong -} EMULATOR_PORT_ACCESS_TYPE, *PEMULATOR_PORT_ACCESS_TYPE; - -typedef struct _EMULATOR_ACCESS_ENTRY { - ULONG BasePort; - ULONG NumConsecutivePorts; - EMULATOR_PORT_ACCESS_TYPE AccessType; - UCHAR AccessMode; - UCHAR StringSupport; - PVOID Routine; -} EMULATOR_ACCESS_ENTRY, *PEMULATOR_ACCESS_ENTRY; - -#endif - -// -// Graphics support routines. -// - -typedef -VOID -(*PBANKED_SECTION_ROUTINE) ( - IN ULONG ReadBank, - IN ULONG WriteBank, - IN PVOID Context - ); - -// -// Exclude some items from video.h -// - -#define _NTOSDEF_ - -#include -#include - -// -// Define types used in d3dukmdt.h, included via d3dkmdt.h that are not defined in this scope. -// - -typedef unsigned int UINT; -typedef unsigned long DWORD; -typedef unsigned char BYTE; - -#include -#include -#include - -#define DlDebugPrintEx(arg) DlDebugPrint arg - -// -// ** New definitions ********************************************************* -// - -// -// Available only for Vista (LONGHORN) and later -// -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - -// -// Define ACPI event IDs -// - -#define ACPI_NOTIFY_DOCK_EVENT 0x77 -#define ACPI_NOTIFY_PANEL_SWITCH 0x80 -#define ACPI_NOTIFY_DEVICE_HOTPLUG 0x81 -#define ACPI_NOTIFY_CYCLE_DISPLAY_HOTKEY 0x82 -#define ACPI_NOTIFY_NEXT_DISPLAY_HOTKEY 0x83 -#define ACPI_NOTIFY_PREV_DISPLAY_HOTKEY 0x84 -#define ACPI_NOTIFY_CYCLE_BRIGHTNESS_HOTKEY 0x85 -#define ACPI_NOTIFY_INC_BRIGHTNESS_HOTKEY 0x86 -#define ACPI_NOTIFY_DEC_BRIGHTNESS_HOTKEY 0x87 -#define ACPI_NOTIFY_ZERO_BRIGHTNESS_HOTKEY 0x88 -#define ACPI_NOTIFY_VIDEO_WAKEUP 0x90 - -// -// ACPI argument definitions -// - -#define ACPI_ARG_ENABLE_SWITCH_EVENT 0x0 -#define ACPI_ARG_ENABLE_AUTO_SWITCH 0x1 -#define ACPI_ARG_DISABLE_SWITCH_EVENT 0x2 -#define ACPI_ARG_ENABLE_AUTO_LCD_BRIGHTNESS 0x0 -#define ACPI_ARG_DISABLE_AUTO_LCD_BRIGHTNESS 0x4 - -// -// ACPI methods for the adapter -// - -#define ACPI_METHOD_DISPLAY_DOS (ULONG)('SOD_') -#define ACPI_METHOD_DISPLAY_DOD (ULONG)('DOD_') -#define ACPI_METHOD_DISPLAY_ROM (ULONG)('MOR_') -#define ACPI_METHOD_DISPLAY_GPD (ULONG)('DPG_') -#define ACPI_METHOD_DISPLAY_SPD (ULONG)('DPS_') -#define ACPI_METHOD_DISPLAY_VPO (ULONG)('OPV_') - -// -// ACPI methods for children -// - -#define ACPI_METHOD_OUTPUT_ADR (ULONG)('RDA_') -#define ACPI_METHOD_OUTPUT_BCL (ULONG)('LCB_') -#define ACPI_METHOD_OUTPUT_BCM (ULONG)('MCB_') -#define ACPI_METHOD_OUTPUT_DDC (ULONG)('CDD_') -#define ACPI_METHOD_OUTPUT_DCS (ULONG)('SCD_') -#define ACPI_METHOD_OUTPUT_DGS (ULONG)('SGD_') -#define ACPI_METHOD_OUTPUT_DSS (ULONG)('SSD_') - -// -// ACPI Flags -// - -#define DXGK_ACPI_POLL_DISPLAY_CHILDREN 0x00000001 -#define DXGK_ACPI_CHANGE_DISPLAY_MODE 0x00000002 -#define DXGK_ACPI_CHANGE_DISPLAY_TOPOLOGY 0x00000004 - -// -// Exclude adapter access flags. -// - -#define DXGK_EXCLUDE_EVICT_ALL 0x00000001 -#define DXGK_EXCLUDE_CALL_SYNCHRONOUS 0x00000002 -#define DXGK_EXCLUDE_BRIDGE_ACCESS 0x00000004 - -// -// Max of 50 characters per string. -// - -#define DXGK_MAX_STRING_LEN 50 -#define DXGK_MAX_REG_SZ_LEN DXGK_MAX_STRING_LEN + 1 - -// -// Supported device space types. -// - -#define DXGK_WHICHSPACE_CONFIG PCI_WHICHSPACE_CONFIG -#define DXGK_WHICHSPACE_ROM PCI_WHICHSPACE_ROM -#define DXGK_WHICHSPACE_MCH 0x80000000 -#define DXGK_WHICHSPACE_BRIDGE 0x80000001 - -// -// Linked display adapter support. -// - -typedef struct _LINKED_DEVICE { - ULONG ChainUid; - ULONG NumberOfLinksInChain; - BOOLEAN LeadLink; -} LINKED_DEVICE, *PLINKED_DEVICE; - -// -// Type of ACPI notification event. -// - -typedef enum _DXGK_EVENT_TYPE { - DxgkUndefinedEvent, - DxgkAcpiEvent, - DxgkPowerStateEvent, - DxgkDockingEvent -} DXGK_EVENT_TYPE, *PDXGK_EVENT_TYPE; - -typedef struct _DXGK_VIDEO_OUTPUT_CAPABILITIES { - D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY InterfaceTechnology; - D3DKMDT_MONITOR_ORIENTATION_AWARENESS MonitorOrientationAwareness; - BOOLEAN SupportsSdtvModes; -} DXGK_VIDEO_OUTPUT_CAPABILITIES, *PDXGK_VIDEO_OUTPUT_CAPABILITIES; - - -typedef struct _DXGK_CHILD_CAPABILITIES { - - union - { - // - // If (CHILD_DESCRIPTOR::ChildDeviceType == TypeVideoOutput) - // - - DXGK_VIDEO_OUTPUT_CAPABILITIES VideoOutput; - - // - // If (CHILD_DESCRIPTOR::ChildDeviceType == TypeOther) - // - - struct - { - UINT MustBeZero; - } - Other; - } Type; - - DXGK_CHILD_DEVICE_HPD_AWARENESS HpdAwareness; -} DXGK_CHILD_CAPABILITIES, *PDXGK_CHILD_CAPABILITIES; - -typedef enum _DXGK_CHILD_DEVICE_TYPE { - TypeUninitialized, - TypeVideoOutput, - TypeOther -} DXGK_CHILD_DEVICE_TYPE, *PDXGK_CHILD_DEVICE_TYPE; - -// -// Child descriptor structure returned to us from the miniport -// -// NOTE: If (ChildDeviceType==TypeVideoOutput) then (ChildUid == video present target ID) -// - -typedef struct _DXGK_CHILD_DESCRIPTOR { - DXGK_CHILD_DEVICE_TYPE ChildDeviceType; - DXGK_CHILD_CAPABILITIES ChildCapabilities; - ULONG AcpiUid; - ULONG ChildUid; -} DXGK_CHILD_DESCRIPTOR, *PDXGK_CHILD_DESCRIPTOR; - -typedef struct _DXGK_DEVICE_DESCRIPTOR { - ULONG DescriptorOffset; - ULONG DescriptorLength; - PVOID DescriptorBuffer; -} DXGK_DEVICE_DESCRIPTOR, *PDXGK_DEVICE_DESCRIPTOR; - -typedef struct _DXGK_GENERIC_DESCRIPTOR { - WCHAR HardwareId[DXGK_MAX_REG_SZ_LEN]; - WCHAR InstanceId[DXGK_MAX_REG_SZ_LEN]; - WCHAR CompatibleId[DXGK_MAX_REG_SZ_LEN]; - WCHAR DeviceText[DXGK_MAX_REG_SZ_LEN]; -} DXGK_GENERIC_DESCRIPTOR, *PDXGK_GENERIC_DESCRIPTOR; - -// -// Types of status that the miniport can report back to us -// - -typedef enum _DXGK_CHILD_STATUS_TYPE{ - StatusUninitialized, - StatusConnection, - StatusRotation -} DXGK_CHILD_STATUS_TYPE, *PDXGK_CHILD_STATUS_TYPE; - -// -// Child Status structure which can be queried directly or -// indicated up by the miniport -// - -typedef struct _DXGK_CHILD_STATUS { - DXGK_CHILD_STATUS_TYPE Type; - ULONG ChildUid; - union { - struct { - BOOLEAN Connected; - } HotPlug; - struct { - UCHAR Angle; - } Rotation; - }; -} DXGK_CHILD_STATUS, *PDXGK_CHILD_STATUS; - -// -// DxgkCbExcludeAdapterAccess callback. -// - -typedef -VOID -(*DXGKDDI_PROTECTED_CALLBACK)( - IN CONST PVOID MiniportDeviceContext, - IN PVOID ProtectedCallbackContext, - IN NTSTATUS ProtectionStatus - ); - -// -// GUID_DEVINTERFACE_I2C {2564AA4F-DDDB-4495-B497-6AD4A84163D7} -// - -DEFINE_GUID(GUID_DEVINTERFACE_I2C, 0x2564AA4F, 0xDDDB, 0x4495, 0xB4, 0x97, 0x6A, 0xD4, 0xA8, 0x41, 0x63, 0xD7); - -// -// GUID_DEVINTERFACE_OPM {BF4672DE-6B4E-4BE4-A325-68A91EA49C09} -// - -DEFINE_GUID(GUID_DEVINTERFACE_OPM, 0xBF4672DE, 0x6B4E, 0x4BE4, 0xA3, 0x25, 0x68, 0xA9, 0x1E, 0xA4, 0x9C, 0x09); - -// -// GUID_DEVINTERFACE_BRIGHTNESS {FDE5BBA4-B3F9-46FB-BDAA-0728CE3100B4} -// - -DEFINE_GUID( GUID_DEVINTERFACE_BRIGHTNESS, 0xFDE5BBA4, 0xB3F9, 0x46FB, 0xBD, 0xAA, 0x07, 0x28, 0xCE, 0x31, 0x00, 0xB4); - -// -// I2C Interface queried from the miniport. -// - -#define DXGK_I2C_INTERFACE_VERSION_1 0x01 - -typedef -NTSTATUS -(*DXGKDDI_I2C_TRANSMIT_DATA_TO_DISPLAY)( - IN PVOID MiniportDeviceContext, - IN D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, - IN ULONG SevenBitI2CAddress, - IN ULONG DataLength, - IN CONST PVOID Data - ); - -typedef -NTSTATUS -(*DXGKDDI_I2C_RECEIVE_DATA_FROM_DISPLAY)( - IN PVOID MiniportDeviceContext, - IN D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, - IN ULONG SevenBitI2CAddress, - IN ULONG Flags, - IN ULONG DataLength, - OUT PVOID Data - ); - -typedef struct _DXGK_I2C_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - DXGKDDI_I2C_TRANSMIT_DATA_TO_DISPLAY DxgkDdiI2CTransmitDataToDisplay; - DXGKDDI_I2C_RECEIVE_DATA_FROM_DISPLAY DxgkDdiI2CReceiveDataFromDisplay; -} DXGK_I2C_INTERFACE, *PDXGK_I2C_INTERFACE; - -// -// OPM Interface from the miniport. -// - -#define DXGK_OPM_INTERFACE_VERSION_1 0x01 - -typedef -NTSTATUS -(*DXGKDDI_OPM_GET_CERTIFICATE_SIZE)( - IN PVOID MiniportDeviceContext, - IN DXGKMDT_CERTIFICATE_TYPE CertificateType, - OUT PULONG CertificateSize - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_GET_CERTIFICATE)( - IN PVOID MiniportDeviceContext, - IN DXGKMDT_CERTIFICATE_TYPE CertificateType, - IN ULONG CertificateSize, - OUT PVOID CertificateBuffer - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_CREATE_PROTECTED_OUTPUT)( - IN PVOID MiniportDeviceContext, - IN D3DDDI_VIDEO_PRESENT_TARGET_ID VidPnTargetId, - IN DXGKMDT_OPM_VIDEO_OUTPUT_SEMANTICS NewVideoOutputSemantics, - OUT PHANDLE NewProtectedOutputHandle - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_GET_RANDOM_NUMBER)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle, - OUT PDXGKMDT_OPM_RANDOM_NUMBER RandomNumber - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle, - IN CONST PDXGKMDT_OPM_ENCRYPTED_PARAMETERS EncryptedParameters - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_GET_INFORMATION)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle, - IN CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters, - OUT PDXGKMDT_OPM_REQUESTED_INFORMATION RequestedInformation - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_GET_COPP_COMPATIBLE_INFORMATION)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle, - IN CONST PDXGKMDT_OPM_COPP_COMPATIBLE_GET_INFO_PARAMETERS Parameters, - OUT PDXGKMDT_OPM_REQUESTED_INFORMATION RequestedInformation - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_CONFIGURE_PROTECTED_OUTPUT)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle, - IN CONST PDXGKMDT_OPM_CONFIGURE_PARAMETERS Parameters, - IN ULONG AdditionalParametersSize, - IN CONST PVOID AdditionalParameters - ); - -typedef -NTSTATUS -(*DXGKDDI_OPM_DESTROY_PROTECTED_OUTPUT)( - IN PVOID MiniportDeviceContext, - IN HANDLE ProtectedOutputHandle - ); - -typedef struct _DXGK_OPM_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - DXGKDDI_OPM_GET_CERTIFICATE_SIZE DxgkDdiOPMGetCertificateSize; - DXGKDDI_OPM_GET_CERTIFICATE DxgkDdiOPMGetCertificate; - DXGKDDI_OPM_CREATE_PROTECTED_OUTPUT DxgkDdiOPMCreateProtectedOutput; - DXGKDDI_OPM_GET_RANDOM_NUMBER DxgkDdiOPMGetRandomNumber; - DXGKDDI_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS DxgkDdiOPMSetSigningKeyAndSequenceNumbers; - DXGKDDI_OPM_GET_INFORMATION DxgkDdiOPMGetInformation; - DXGKDDI_OPM_GET_COPP_COMPATIBLE_INFORMATION DxgkDdiOPMGetCOPPCompatibleInformation; - DXGKDDI_OPM_CONFIGURE_PROTECTED_OUTPUT DxgkDdiOPMConfigureProtectedOutput; - DXGKDDI_OPM_DESTROY_PROTECTED_OUTPUT DxgkDdiOPMDestroyProtectedOutput; -} DXGK_OPM_INTERFACE, *PDXGK_OPM_INTERFACE; - - -#define DXGK_BRIGHTNESS_INTERFACE_VERSION_1 0x01 - -typedef -NTSTATUS -(*DXGK_BRIGHTNESS_GET_POSSIBLE)( - IN PVOID Context, - IN ULONG BufferSize, - OUT PUCHAR LevelCount, - OUT PUCHAR BrightnessLevels - ); - -typedef -NTSTATUS -(*DXGK_BRIGHTNESS_SET)( - IN PVOID Context, - IN UCHAR Brightness - ); - -typedef -NTSTATUS -(*DXGK_BRIGHTNESS_GET)( - IN PVOID Context, - IN PUCHAR Brightness - ); - -typedef struct -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT DXGK_BRIGHTNESS_GET_POSSIBLE GetPossibleBrightness; - OUT DXGK_BRIGHTNESS_SET SetBrightness; - OUT DXGK_BRIGHTNESS_GET GetBrightness; -} DXGK_BRIGHTNESS_INTERFACE, *PDXGK_BRIGHTNESS_INTERFACE; - -// -// Services exported by DxgkCbQueryServices() -// - -typedef enum -{ - DxgkServicesAgp, - DxgkServicesDebugReport, - DxgkServicesTimedOperation -} DXGK_SERVICES; - -// -// AGP Services -// - -#define DXGK_AGP_INTERFACE_VERSION_1 0x01 - -#define DXGK_AGPCOMMAND_AGP1X 0x00001 -#define DXGK_AGPCOMMAND_AGP2X 0x00002 -#define DXGK_AGPCOMMAND_AGP4X 0x00004 -#define DXGK_AGPCOMMAND_AGP8X 0x00008 -#define DXGK_AGPCOMMAND_DISABLE_SBA 0x10000 -#define DXGK_AGPCOMMAND_DISABLE_FW 0x20000 - -typedef -NTSTATUS -(APIENTRY *DXGKCB_AGP_ALLOCATE_POOL)( - IN HANDLE Context, - IN ULONG AllocationSize, - IN MEMORY_CACHING_TYPE CacheType, - OUT PPHYSICAL_ADDRESS PhysicalAddress, - OUT PVOID *VirtualAddress - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_AGP_FREE_POOL)( - IN HANDLE Context, - IN PVOID VirtualAddress - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_AGP_SET_COMMAND)( - IN HANDLE Context, - IN ULONG Command - ); - -typedef struct _DXGK_AGP_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - DXGKCB_AGP_ALLOCATE_POOL AgpAllocatePool; - DXGKCB_AGP_FREE_POOL AgpFreePool; - DXGKCB_AGP_SET_COMMAND AgpSetCommand; -} DXGK_AGP_INTERFACE, *PDXGK_AGP_INTERFACE; - -// -// Debug Report API -// - -DECLARE_HANDLE(DXGK_DEBUG_REPORT_HANDLE); -#define DXGK_DEBUG_REPORT_INTERFACE_VERSION_1 0x01 -#define DXGK_DEBUG_REPORT_MAX_SIZE 0xF800 - -typedef struct _DXGK_DEBUG_REPORT_INTERFACE -{ - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - DXGK_DEBUG_REPORT_HANDLE - (*DbgReportCreate)( - IN HANDLE DeviceHandle, - IN ULONG ulCode, - IN ULONG_PTR ulpArg1, - IN ULONG_PTR ulpArg2, - IN ULONG_PTR ulpArg3, - IN ULONG_PTR ulpArg4 - ); - - BOOLEAN - (*DbgReportSecondaryData)( - IN OUT DXGK_DEBUG_REPORT_HANDLE hReport, - IN __in_bcount(ulDataSize) PVOID pvData, - IN ULONG ulDataSize - ); - - VOID - (*DbgReportComplete)( - IN OUT DXGK_DEBUG_REPORT_HANDLE hReport - ); -} DXGK_DEBUG_REPORT_INTERFACE, *PDXGK_DEBUG_REPORT_INTERFACE; - -// -// Timed Operation API -// - -#define DXGK_TIMED_OPERATION_INTERFACE_VERSION_1 0x01 -#define DXGK_TIMED_OPERATION_TIMEOUT_MAX_SECONDS 5 - -typedef struct _DXGK_TIMED_OPERATION -{ - USHORT Size; - ULONG_PTR OwnerTag; - BOOLEAN OsHandled; - BOOLEAN TimeoutTriggered; - LARGE_INTEGER Timeout; - LARGE_INTEGER StartTick; -} DXGK_TIMED_OPERATION, *PDXGK_TIMED_OPERATION; - -typedef struct _DXGK_TIMED_OPERATION_INTERFACE -{ - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - NTSTATUS - (*TimedOperationStart)( - OUT DXGK_TIMED_OPERATION* Op, - IN const LARGE_INTEGER* Timeout, - IN BOOLEAN OsHandled - ); - - NTSTATUS - (*TimedOperationDelay)( - IN OUT DXGK_TIMED_OPERATION* Op, - IN KPROCESSOR_MODE WaitMode, - IN BOOLEAN Alertable, - IN const LARGE_INTEGER* Interval OPTIONAL - ); - - NTSTATUS - (*TimedOperationWaitForSingleObject)( - IN OUT DXGK_TIMED_OPERATION* Op, - IN PVOID Object, - IN KWAIT_REASON WaitReason, - IN KPROCESSOR_MODE WaitMode, - IN BOOLEAN Alertable, - IN const LARGE_INTEGER* Timeout OPTIONAL - ); -} DXGK_TIMED_OPERATION_INTERFACE, *PDXGK_TIMED_OPERATION_INTERFACE; - -typedef enum { - DockStateUnsupported = 0, - DockStateUnDocked = 1, - DockStateDocked = 2, - DockStateUnknown = 3, -} DOCKING_STATE; - -// -// Device Information Structure to provide OS provided data -// structures to the miniport -// - -typedef struct _DXGK_DEVICE_INFO { - PVOID MiniportDeviceContext; - PDEVICE_OBJECT PhysicalDeviceObject; - UNICODE_STRING DeviceRegistryPath; - PCM_RESOURCE_LIST TranslatedResourceList; - LARGE_INTEGER SystemMemorySize; - PHYSICAL_ADDRESS HighestPhysicalAddress; - PHYSICAL_ADDRESS AgpApertureBase; - SIZE_T AgpApertureSize; - DOCKING_STATE DockingState; -} DXGK_DEVICE_INFO, *PDXGK_DEVICE_INFO; - -// -// DxgKrnl interface -// - -#define DXGK_ACPI_PASS_ARGS_TO_CHILDREN 'araP' - - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_EVAL_ACPI_METHOD)( - IN HANDLE DeviceHandle, - IN ULONG DeviceUid, - IN PACPI_EVAL_INPUT_BUFFER_COMPLEX AcpiInputBuffer, - IN ULONG AcpiInputSize, - IN OUT PACPI_EVAL_OUTPUT_BUFFER AcpiOutputBuffer, - IN ULONG AcpiOutputSize - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_GET_DEVICE_INFORMATION)( - IN HANDLE DeviceHandle, - OUT PDXGK_DEVICE_INFO DeviceInfo - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_INDICATE_CHILD_STATUS)( - IN HANDLE DeviceHandle, - IN PDXGK_CHILD_STATUS ChildStatus - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_MAP_MEMORY)( - IN HANDLE DeviceHandle, - IN PHYSICAL_ADDRESS TranslatedAddress, - IN ULONG Length, - IN BOOLEAN InIoSpace, - IN BOOLEAN MapToUserMode, - IN MEMORY_CACHING_TYPE CacheType, - OUT PVOID *VirtualAddress - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_QUERY_SERVICES)( - IN HANDLE DeviceHandle, - IN DXGK_SERVICES ServicesType, - IN OUT PINTERFACE Interface - ); - -typedef -BOOLEAN -(APIENTRY *DXGKCB_QUEUE_DPC)( - IN HANDLE DeviceHandle - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_READ_DEVICE_SPACE)( - IN HANDLE DeviceHandle, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length, - OUT PULONG BytesRead - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_SYNCHRONIZE_EXECUTION)( - IN HANDLE DeviceHandle, - IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, - IN PVOID Context, - IN ULONG MessageNumber, - OUT PBOOLEAN ReturnValue - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_UNMAP_MEMORY)( - IN HANDLE DeviceHandle, - IN PVOID VirtualAddress - ); - -typedef -NTSTATUS -(APIENTRY *DXGKCB_WRITE_DEVICE_SPACE)( - IN HANDLE DeviceHandle, - IN ULONG DataType, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length, - OUT PULONG BytesWritten - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_IS_DEVICE_PRESENT)( - IN HANDLE DeviceHandle, - IN PPCI_DEVICE_PRESENCE_PARAMETERS DevicePresenceParameters, - OUT PBOOLEAN DevicePresent - ); - -typedef -VOID -(APIENTRY *DXGKCB_LOG_ETW_EVENT)( - IN CONST LPCGUID EventGuid, - IN UCHAR Type, - IN USHORT EventBufferSize, - IN PVOID EventBuffer - ); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -(APIENTRY *DXGKCB_EXCLUDE_ADAPTER_ACCESS)( - IN HANDLE DeviceHandle, - IN ULONG Attributes, - IN DXGKDDI_PROTECTED_CALLBACK DxgkProtectedCallback, - IN PVOID ProtectedCallbackContext - ); - -typedef struct _DXGK_START_INFO { - ULONG RequiredDmaQueueEntry; - GUID AdapterGuid; -} DXGK_START_INFO, *PDXGK_START_INFO; - - -typedef struct _DXGKRNL_INTERFACE { - ULONG Size; - ULONG Version; - HANDLE DeviceHandle; - - DXGKCB_EVAL_ACPI_METHOD DxgkCbEvalAcpiMethod; - DXGKCB_GET_DEVICE_INFORMATION DxgkCbGetDeviceInformation; - DXGKCB_INDICATE_CHILD_STATUS DxgkCbIndicateChildStatus; - DXGKCB_MAP_MEMORY DxgkCbMapMemory; - DXGKCB_QUEUE_DPC DxgkCbQueueDpc; - DXGKCB_QUERY_SERVICES DxgkCbQueryServices; - DXGKCB_READ_DEVICE_SPACE DxgkCbReadDeviceSpace; - DXGKCB_SYNCHRONIZE_EXECUTION DxgkCbSynchronizeExecution; - DXGKCB_UNMAP_MEMORY DxgkCbUnmapMemory; - DXGKCB_WRITE_DEVICE_SPACE DxgkCbWriteDeviceSpace; - DXGKCB_IS_DEVICE_PRESENT DxgkCbIsDevicePresent; - - DXGKCB_GETHANDLEDATA DxgkCbGetHandleData; - DXGKCB_GETHANDLEPARENT DxgkCbGetHandleParent; - DXGKCB_ENUMHANDLECHILDREN DxgkCbEnumHandleChildren; - DXGKCB_NOTIFY_INTERRUPT DxgkCbNotifyInterrupt; - DXGKCB_NOTIFY_DPC DxgkCbNotifyDpc; - DXGKCB_QUERYVIDPNINTERFACE DxgkCbQueryVidPnInterface; - DXGKCB_QUERYMONITORINTERFACE DxgkCbQueryMonitorInterface; - DXGKCB_GETCAPTUREADDRESS DxgkCbGetCaptureAddress; - - DXGKCB_LOG_ETW_EVENT DxgkCbLogEtwEvent; - - DXGKCB_EXCLUDE_ADAPTER_ACCESS DxgkCbExcludeAdapterAccess; -} DXGKRNL_INTERFACE, *PDXGKRNL_INTERFACE; - -// -// Kernel Mode Driver Interface -// - -// -// Define parameter types for SAL-annotated DDI parameters. These are used by -// the DDI function name typedefs. They are not needed in a driver's DDI function -// definitions, and should not be used in driver code. -// -// Naming convention: Concatenate all SAL annotations, an underscore, other modifiers -// such as CONST, and the type of the parameter, and use uppercase -// only. -// -typedef __in CONST PDEVICE_OBJECT IN_CONST_PDEVICE_OBJECT; -typedef __inout PLINKED_DEVICE INOUT_PLINKED_DEVICE; -typedef __inout PDXGK_CHILD_DESCRIPTOR INOUT_PDXGK_CHILD_DESCRIPTOR; -typedef __in PDXGK_CHILD_STATUS IN_PDXGK_CHILD_STATUS; -typedef __inout PDXGK_DEVICE_DESCRIPTOR INOUT_PDXGK_DEVICE_DESCRIPTOR; -typedef __in DXGK_EVENT_TYPE IN_DXGK_EVENT_TYPE; -typedef __in PDXGK_START_INFO IN_PDXGK_START_INFO; -typedef __in PDXGKRNL_INTERFACE IN_PDXGKRNL_INTERFACE; -typedef __in PQUERY_INTERFACE IN_PQUERY_INTERFACE; -typedef __in PVIDEO_REQUEST_PACKET IN_PVIDEO_REQUEST_PACKET; - -// -// Function name typedefs -// - -typedef - __checkReturn -NTSTATUS -DXGKDDI_ADD_DEVICE( - IN_CONST_PDEVICE_OBJECT PhysicalDeviceObject, - OUT_PPVOID MiniportDeviceContext - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_START_DEVICE( - IN_CONST_PVOID MiniportDeviceContext, - IN_PDXGK_START_INFO DxgkStartInfo, - IN_PDXGKRNL_INTERFACE DxgkInterface, - OUT_PULONG NumberOfVideoPresentSources, - OUT_PULONG NumberOfChildren - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_STOP_DEVICE( - IN_CONST_PVOID MiniportDeviceContext - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_REMOVE_DEVICE( - IN_CONST_PVOID MiniportDeviceContext - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_DISPATCH_IO_REQUEST( - IN_CONST_PVOID MiniportDeviceContext, - IN_ULONG VidPnSourceId, - IN_PVIDEO_REQUEST_PACKET VideoRequestPacket - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_QUERY_CHILD_RELATIONS( - IN_CONST_PVOID MiniportDeviceContext, - INOUT_PDXGK_CHILD_DESCRIPTOR ChildRelations, - IN_ULONG ChildRelationsSize - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_QUERY_CHILD_STATUS( - IN_CONST_PVOID MiniportDeviceContext, - IN_PDXGK_CHILD_STATUS ChildStatus, - IN_BOOLEAN NonDestructiveOnly - ); - -typedef - __checkReturn -BOOLEAN -DXGKDDI_INTERRUPT_ROUTINE( - IN_CONST_PVOID MiniportDeviceContext, - IN_ULONG MessageNumber - ); - -typedef -VOID -DXGKDDI_DPC_ROUTINE( - IN_CONST_PVOID MiniportDeviceContext - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_QUERY_DEVICE_DESCRIPTOR( - IN_CONST_PVOID MiniportDeviceContext, - IN_ULONG ChildUid, - INOUT_PDXGK_DEVICE_DESCRIPTOR DeviceDescriptor - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_SET_POWER_STATE( - IN_CONST_PVOID MiniportDeviceContext, - IN_ULONG DeviceUid, - IN_DEVICE_POWER_STATE DevicePowerState, - IN_POWER_ACTION ActionType - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_NOTIFY_ACPI_EVENT( - IN_CONST_PVOID MiniportDeviceContext, - IN_DXGK_EVENT_TYPE EventType, - IN_ULONG Event, - IN_PVOID Argument, - OUT_PULONG AcpiFlags - ); - -typedef -VOID -DXGKDDI_RESET_DEVICE( - IN_CONST_PVOID MiniportDeviceContext - ); - -typedef -VOID -DXGKDDI_UNLOAD( - VOID - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_QUERY_INTERFACE( - IN_CONST_PVOID MiniportDeviceContext, - IN_PQUERY_INTERFACE QueryInterface - ); - -typedef -VOID -DXGKDDI_CONTROL_ETW_LOGGING( - IN_BOOLEAN Enable, - IN_ULONG Flags, - IN_UCHAR Level - ); - -typedef - __checkReturn -NTSTATUS -DXGKDDI_LINK_DEVICE( - IN_CONST_PDEVICE_OBJECT PhysicalDeviceObject, - IN_CONST_PVOID MiniportDeviceContext, - INOUT_PLINKED_DEVICE LinkedDevice - ); - -// -// Function pointer typedefs -// - -typedef DXGKDDI_ADD_DEVICE *PDXGKDDI_ADD_DEVICE; -typedef DXGKDDI_START_DEVICE *PDXGKDDI_START_DEVICE; -typedef DXGKDDI_STOP_DEVICE *PDXGKDDI_STOP_DEVICE; -typedef DXGKDDI_REMOVE_DEVICE *PDXGKDDI_REMOVE_DEVICE; -typedef DXGKDDI_DISPATCH_IO_REQUEST *PDXGKDDI_DISPATCH_IO_REQUEST; -typedef DXGKDDI_QUERY_CHILD_RELATIONS *PDXGKDDI_QUERY_CHILD_RELATIONS; -typedef DXGKDDI_QUERY_CHILD_STATUS *PDXGKDDI_QUERY_CHILD_STATUS; -typedef DXGKDDI_INTERRUPT_ROUTINE *PDXGKDDI_INTERRUPT_ROUTINE; -typedef DXGKDDI_DPC_ROUTINE *PDXGKDDI_DPC_ROUTINE; -typedef DXGKDDI_QUERY_DEVICE_DESCRIPTOR *PDXGKDDI_QUERY_DEVICE_DESCRIPTOR; -typedef DXGKDDI_SET_POWER_STATE *PDXGKDDI_SET_POWER_STATE; -typedef DXGKDDI_NOTIFY_ACPI_EVENT *PDXGKDDI_NOTIFY_ACPI_EVENT; -typedef DXGKDDI_RESET_DEVICE *PDXGKDDI_RESET_DEVICE; -typedef DXGKDDI_UNLOAD *PDXGKDDI_UNLOAD; -typedef DXGKDDI_QUERY_INTERFACE *PDXGKDDI_QUERY_INTERFACE; -typedef DXGKDDI_CONTROL_ETW_LOGGING *PDXGKDDI_CONTROL_ETW_LOGGING; -typedef DXGKDDI_LINK_DEVICE *PDXGKDDI_LINK_DEVICE; - -// -// Driver initialization data structure -// - -typedef struct _DRIVER_INITIALIZATION_DATA { - ULONG Version; - PDXGKDDI_ADD_DEVICE DxgkDdiAddDevice; - PDXGKDDI_START_DEVICE DxgkDdiStartDevice; - PDXGKDDI_STOP_DEVICE DxgkDdiStopDevice; - PDXGKDDI_REMOVE_DEVICE DxgkDdiRemoveDevice; - PDXGKDDI_DISPATCH_IO_REQUEST DxgkDdiDispatchIoRequest; - PDXGKDDI_INTERRUPT_ROUTINE DxgkDdiInterruptRoutine; - PDXGKDDI_DPC_ROUTINE DxgkDdiDpcRoutine; - PDXGKDDI_QUERY_CHILD_RELATIONS DxgkDdiQueryChildRelations; - PDXGKDDI_QUERY_CHILD_STATUS DxgkDdiQueryChildStatus; - PDXGKDDI_QUERY_DEVICE_DESCRIPTOR DxgkDdiQueryDeviceDescriptor; - PDXGKDDI_SET_POWER_STATE DxgkDdiSetPowerState; - PDXGKDDI_NOTIFY_ACPI_EVENT DxgkDdiNotifyAcpiEvent; - PDXGKDDI_RESET_DEVICE DxgkDdiResetDevice; - PDXGKDDI_UNLOAD DxgkDdiUnload; - PDXGKDDI_QUERY_INTERFACE DxgkDdiQueryInterface; - PDXGKDDI_CONTROL_ETW_LOGGING DxgkDdiControlEtwLogging; - - PDXGKDDI_QUERYADAPTERINFO DxgkDdiQueryAdapterInfo; - PDXGKDDI_CREATEDEVICE DxgkDdiCreateDevice; - PDXGKDDI_CREATEALLOCATION DxgkDdiCreateAllocation; - PDXGKDDI_DESTROYALLOCATION DxgkDdiDestroyAllocation; - PDXGKDDI_DESCRIBEALLOCATION DxgkDdiDescribeAllocation; - PDXGKDDI_GETSTANDARDALLOCATIONDRIVERDATA DxgkDdiGetStandardAllocationDriverData; - PDXGKDDI_ACQUIRESWIZZLINGRANGE DxgkDdiAcquireSwizzlingRange; - PDXGKDDI_RELEASESWIZZLINGRANGE DxgkDdiReleaseSwizzlingRange; - PDXGKDDI_PATCH DxgkDdiPatch; - PDXGKDDI_SUBMITCOMMAND DxgkDdiSubmitCommand; - PDXGKDDI_PREEMPTCOMMAND DxgkDdiPreemptCommand; - PDXGKDDI_BUILDPAGINGBUFFER DxgkDdiBuildPagingBuffer; - PDXGKDDI_SETPALETTE DxgkDdiSetPalette; - PDXGKDDI_SETPOINTERPOSITION DxgkDdiSetPointerPosition; - PDXGKDDI_SETPOINTERSHAPE DxgkDdiSetPointerShape; - PDXGKDDI_RESETFROMTIMEOUT DxgkDdiResetFromTimeout; - PDXGKDDI_RESTARTFROMTIMEOUT DxgkDdiRestartFromTimeout; - PDXGKDDI_ESCAPE DxgkDdiEscape; - PDXGKDDI_COLLECTDBGINFO DxgkDdiCollectDbgInfo; - PDXGKDDI_QUERYCURRENTFENCE DxgkDdiQueryCurrentFence; - PDXGKDDI_ISSUPPORTEDVIDPN DxgkDdiIsSupportedVidPn; - PDXGKDDI_RECOMMENDFUNCTIONALVIDPN DxgkDdiRecommendFunctionalVidPn; - PDXGKDDI_ENUMVIDPNCOFUNCMODALITY DxgkDdiEnumVidPnCofuncModality; - PDXGKDDI_SETVIDPNSOURCEADDRESS DxgkDdiSetVidPnSourceAddress; - PDXGKDDI_SETVIDPNSOURCEVISIBILITY DxgkDdiSetVidPnSourceVisibility; - PDXGKDDI_COMMITVIDPN DxgkDdiCommitVidPn; - PDXGKDDI_UPDATEACTIVEVIDPNPRESENTPATH DxgkDdiUpdateActiveVidPnPresentPath; - PDXGKDDI_RECOMMENDMONITORMODES DxgkDdiRecommendMonitorModes; - PDXGKDDI_RECOMMENDVIDPNTOPOLOGY DxgkDdiRecommendVidPnTopology; - PDXGKDDI_GETSCANLINE DxgkDdiGetScanLine; - PDXGKDDI_STOPCAPTURE DxgkDdiStopCapture; - PDXGKDDI_CONTROLINTERRUPT DxgkDdiControlInterrupt; - PDXGKDDI_CREATEOVERLAY DxgkDdiCreateOverlay; - - // - // Device functions - // - - PDXGKDDI_DESTROYDEVICE DxgkDdiDestroyDevice; - PDXGKDDI_OPENALLOCATIONINFO DxgkDdiOpenAllocation; - PDXGKDDI_CLOSEALLOCATION DxgkDdiCloseAllocation; - PDXGKDDI_RENDER DxgkDdiRender; - PDXGKDDI_PRESENT DxgkDdiPresent; - - // - // Overlay functions - // - - PDXGKDDI_UPDATEOVERLAY DxgkDdiUpdateOverlay; - PDXGKDDI_FLIPOVERLAY DxgkDdiFlipOverlay; - PDXGKDDI_DESTROYOVERLAY DxgkDdiDestroyOverlay; - - // - // Context supports. - // - - PDXGKDDI_CREATECONTEXT DxgkDdiCreateContext; - PDXGKDDI_DESTROYCONTEXT DxgkDdiDestroyContext; - - // - // Linked Display Adapter support. - // - - PDXGKDDI_LINK_DEVICE DxgkDdiLinkDevice; - PDXGKDDI_SETDISPLAYPRIVATEDRIVERFORMAT DxgkDdiSetDisplayPrivateDriverFormat; - -#if (DXGKDDI_INTERFACE_VERSION >= DXGKDDI_INTERFACE_VERSION_WIN7) - // - // Extended for WDDM 2.0 - // - PDXGKDDI_DESCRIBEPAGETABLE DxgkDdiDescribePageTable; - PDXGKDDI_UPDATEPAGETABLE DxgkDdiUpdatePageTable; - PDXGKDDI_UPDATEPAGEDIRECTORY DxgkDdiUpdatePageDirectory; - PDXGKDDI_MOVEPAGEDIRECTORY DxgkDdiMovePageDirectory; - - PDXGKDDI_SUBMITRENDER DxgkDdiSubmitRender; - PDXGKDDI_CREATEALLOCATION2 DxgkDdiCreateAllocation2; - - // - // GDI acceleration. Extended for WDDM 1.0 - // - PDXGKDDI_RENDER DxgkDdiRenderKm; - - // - // New DMM DDIs for CCD support - // - VOID* Reserved; - PDXGKDDI_QUERYVIDPNHWCAPABILITY DxgkDdiQueryVidPnHWCapability; - -#endif // DXGKDDI_INTERFACE_VERSION - -} DRIVER_INITIALIZATION_DATA, *PDRIVER_INITIALIZATION_DATA; - -// -// *** Displib definitions **************************************************** -// - -typedef enum _DEBUG_LEVEL { - DlDebugError, - DlDebugWarning, - DlDebugTrace, - DlDebugInfo -} DEBUG_LEVEL; - -// -// Functions exported by DispLib -// - -NTSTATUS -DxgkInitialize( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath, - IN PDRIVER_INITIALIZATION_DATA DriverInitializationData - ); - -PVOID -DlAllocateCommonBuffer( - IN PVOID DeviceHandle, - IN PVP_DMA_ADAPTER DlpDmaAdapter, - IN ULONG DesiredLength, - OUT PPHYSICAL_ADDRESS LogicalAddress, - IN BOOLEAN CacheEnabled, - OUT PVOID Reserved - ); - -PVOID -DlAllocatePool( - IN PVOID DeviceHandle, - IN VP_POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag - ); - -VOID -DlClearEvent( - IN PVOID DeviceHandle, - IN PEVENT pEvent - ); - -VP_STATUS -DlCreateEvent( - IN PVOID DeviceHandle, - IN ULONG EventFlag, - PVOID Unused, - OUT PEVENT *ppEvent - ); - -VOID -DlDebugPrint( - IN DEBUG_LEVEL DebugPrintLevel, - IN __in PCHAR DebugMessage, - ... - ); - -VP_STATUS -DlDeleteEvent( - IN PVOID DeviceHandle, - IN PEVENT pEvent - ); - -VP_STATUS -DlEnumerateChildren( - IN PVOID DeviceHandle, - IN PVOID Reserved - ); - -VOID -DlFreeDeviceBase( - IN PVOID DeviceHandle, - IN PVOID MappedAddress - ); - -VOID -DlFreePool( - IN PVOID DeviceHandle, - IN PVOID Ptr - ); - -NTSTATUS -DlGetAccessRanges( - PVOID DeviceHandle, - ULONG NumRequestedResources, - PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL, - ULONG NumAccessRanges, - PVIDEO_ACCESS_RANGE AccessRanges, - PVOID VendorId, - PVOID DeviceId, - PULONG Slot - ); - -PVOID -DlGetAssociatedDeviceExtension( - IN PVOID DeviceObject - ); - -PVOID -DlGetDeviceBase( - IN PVOID DeviceHandle, - IN PHYSICAL_ADDRESS IoAddress, - IN ULONG NumberOfUchars, - IN UCHAR InIoSpace - ); - -PVP_DMA_ADAPTER -DlGetDmaAdapter( - IN PVOID DeviceHandle, - IN PVP_DEVICE_DESCRIPTION DlpDeviceDescription - ); - -VP_STATUS -DlGetRegistryParameters( - IN PVOID DeviceHandle, - IN __in PWSTR ParameterName, - IN UCHAR IsParameterFileName, - IN PMINIPORT_GET_REGISTRY_ROUTINE CallbackRoutine, - IN PVOID Context - ); - -__allocator -PVOID -DlGetRomImage( - IN PVOID DeviceHandle, - IN PVOID Unused1, - IN ULONG Unused2, - IN ULONG Length - ); - -VP_STATUS -DlGetVersion( - IN PVOID DeviceHandle, - OUT PVPOSVERSIONINFO pDlpOsVersionInfo - ); - -PVOID -DlLockBuffer( - IN PVOID DeviceHandle, - IN PVOID BaseAddress, - IN ULONG Length, - IN VP_LOCK_OPERATION Operation - ); - -VOID -DlLogError( - IN PVOID DeviceHandle, - IN PVIDEO_REQUEST_PACKET Vrp OPTIONAL, - IN VP_STATUS ErrorCode, - IN ULONG UniqueId - ); - -VP_STATUS -DlMapMemory( - IN PVOID DeviceHandle, - IN PHYSICAL_ADDRESS TranslatedAddress, - IN OUT PULONG Length, - IN PULONG InIoSpace, - IN OUT PVOID *VirtualAddress - ); - -LONGLONG -DlQueryPerformanceCounter( - IN PVOID pDeviceHandle, - OUT PLONGLONG pllPerformanceFrequency OPTIONAL - ); - -VOID -DlReleaseCommonBuffer( - IN PVOID DeviceHandle, - IN PVP_DMA_ADAPTER DlpDmaAdapter, - IN ULONG Length, - IN PHYSICAL_ADDRESS LogicalAddress, - IN PVOID VirtualAddress, - IN BOOLEAN CacheEnabled - ); - -BOOLEAN -DlScanRom( - IN PVOID DeviceHandle, - IN PUCHAR RomBase, - IN ULONG RomLength, - IN PUCHAR String - ); - -LONG -DlSetEvent( - IN PVOID DeviceHandle, - IN PEVENT pEvent - ); - -VP_STATUS -DlSetRegistryParameters( - IN PVOID DeviceHandle, - IN __in PWSTR ValueName, - IN __in_bcount(ValueLength) PVOID ValueData, - IN ULONG ValueLength - ); - -VP_STATUS -DlSetTrappedEmulatorPorts( - IN PVOID DeviceHandle, - IN ULONG NumAccessRanges, - IN PVIDEO_ACCESS_RANGE AccessRange - ); - -VOID -DlStopTimer( - PVOID DeviceHandle - ); - -VOID -DlUnlockBuffer( - IN PVOID DeviceHandle, - IN PVOID Mdl - ); - -VP_STATUS -DlVerifyAccessRanges( - PVOID DeviceHandle, - ULONG NumAccessRanges, - PVIDEO_ACCESS_RANGE AccessRanges - ); - -VP_STATUS -DlWaitForSingleObject( - IN PVOID DeviceHandle, - IN PVOID pEvent, - IN PLARGE_INTEGER Timeout - ); - -VP_STATUS -DlDisableInterrupt( - IN PVOID DeviceHandle - ); - -VP_STATUS -DlEnableInterrupt( - IN PVOID DeviceHandle - ); - -NTSTATUS -DlEvalAcpiMethod( - IN HANDLE DeviceHandle, - IN ULONG DeviceUid, - IN PACPI_EVAL_INPUT_BUFFER_COMPLEX AcpiInputBuffer, - IN ULONG AcpiInputSize, - IN OUT PACPI_EVAL_OUTPUT_BUFFER AcpiOutputBuffer, - IN ULONG AcpiOutputSize - ); - -NTSTATUS -DlGetDeviceInformation( - IN PVOID DeviceHandle, - OUT PDXGK_DEVICE_INFO DeviceInfo - ); - -NTSTATUS -DlIndicateChildStatus( - IN PVOID DeviceHandle, - IN PDXGK_CHILD_STATUS ChildStatus - ); - -NTSTATUS -DlMapMemoryEx( - IN PVOID DeviceHandle, - IN PHYSICAL_ADDRESS TranslatedAddress, - IN OUT PULONG Length, - IN PULONG InIoSpace, - IN HANDLE ProcessHandle, - IN OUT PVOID *VirtualAddress, - IN BOOLEAN MapToUserMode - ); - -NTSTATUS -DlQueryServices( - IN PVOID DeviceHandle, - IN VIDEO_PORT_SERVICES ServicesType, - IN OUT PINTERFACE Interface - ); - -BOOLEAN -DlQueueDpc( - IN PVOID DeviceHandle - ); - -ULONG -DlReadDeviceSpace( - IN PVOID DeviceHandle, - IN ULONG DataType, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - -ULONG -DlSetBusData( - IN PVOID DeviceHandle, - IN ULONG BusDataType, - IN ULONG SlotNumber, - IN PVOID Buffer, - IN ULONG Offset, - IN ULONG Length - ); - -BOOLEAN -DlSynchronizeExecution( - PVOID DeviceHandle, - VIDEO_SYNCHRONIZE_PRIORITY Priority, - PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine, - PVOID Context, - ULONG MessageNumber - ); - -NTSTATUS -DlUnmapMemory( - PVOID DeviceHandle, - PVOID VirtualAddress, - HANDLE ProcessHandle - ); - -#endif // (NTDDI_VERSION >= NTDDI_LONGHORN) - -#pragma warning(pop) - -#endif // _DISPMPRT_H_ - diff --git a/qt-correction-tool/pub/ddk/dmusicks.h b/qt-correction-tool/pub/ddk/dmusicks.h deleted file mode 100644 index b30a3c3..0000000 --- a/qt-correction-tool/pub/ddk/dmusicks.h +++ /dev/null @@ -1,449 +0,0 @@ -/*************************************************************************** -* * -* DMusicKS.h -- This module defines the the DirectMusic WDM interface. * -* * -* Copyright (c) Microsoft Corp. All rights reserved. * -* * -***************************************************************************/ - -#ifndef _DMUSICKS_ -#define _DMUSICKS_ - -#include - -#define DONT_HOLD_FOR_SEQUENCING 0x8000000000000000 - -typedef struct _DMUS_KERNEL_EVENT -{ // this offset - BYTE bReserved; // 1 0 - BYTE cbStruct; // 1 1 - USHORT cbEvent; // 2 2 - USHORT usChannelGroup; // 2 4 - USHORT usFlags; // 2 6 - REFERENCE_TIME ullPresTime100ns; // 8 8 - ULONGLONG ullBytePosition; // 8 16 - _DMUS_KERNEL_EVENT *pNextEvt; // 4 (8) 24 - union - { - BYTE abData[sizeof(PBYTE)]; // 4 (8) 28 (32) - PBYTE pbData; - _DMUS_KERNEL_EVENT *pPackageEvt; - } uData; -} DMUS_KERNEL_EVENT, *PDMUS_KERNEL_EVENT; // 32 (40) - -#define DMUS_KEF_EVENT_COMPLETE 0x0000 -#define DMUS_KEF_EVENT_INCOMPLETE 0x0001 // This event is an incomplete package or sysex. - // Do not use this data. - -#define DMUS_KEF_PACKAGE_EVENT 0x0002 // This event is a package. The uData.pPackageEvt - // field contains a pointer to a chain of events. - -#define kBytePositionNone (~(ULONGLONG)0) // This message has no meaningful byte position - -#define SHORT_EVT(evt) ((evt)->cbEvent <= sizeof(PBYTE)) -#define PACKAGE_EVT(evt) ((evt)->usFlags & DMUS_KEF_PACKAGE_EVENT) -#define INCOMPLETE_EVT(evt) ((evt)->usFlags & DMUS_KEF_EVENT_INCOMPLETE) -#define COMPLETE_EVT(evt) (((evt)->usFlags & DMUS_KEF_EVENT_INCOMPLETE) == 0) - -#define SET_INCOMPLETE_EVT(evt) ((evt)->usFlags |= DMUS_KEF_EVENT_INCOMPLETE) -#define SET_COMPLETE_EVT(evt) ((evt)->usFlags &= (~DMUS_KEF_EVENT_INCOMPLETE)) -#define SET_PACKAGE_EVT(evt) ((evt)->usFlags |= DMUS_KEF_PACKAGE_EVENT) -#define CLEAR_PACKAGE_EVT(evt) ((evt)->usFlags &= (~DMUS_KEF_PACKAGE_EVENT)) - - -#define STATIC_CLSID_PortDMus\ - 0xb7902fe9, 0xfb0a, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("b7902fe9-fb0a-11d1-81b0-0060083316c1", CLSID_PortDMus); -#define CLSID_PortDMus DEFINE_GUIDNAMED(CLSID_PortDMus) - -#define STATIC_CLSID_MiniportDriverDMusUART\ - 0xd3f0ce1c, 0xfffc, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("d3f0ce1c-fffc-11d1-81b0-0060083316c1", CLSID_MiniportDriverDMusUART); -#define CLSID_MiniportDriverDMusUART DEFINE_GUIDNAMED(CLSID_MiniportDriverDMusUART) - -#define STATIC_CLSID_MiniportDriverDMusUARTCapture\ - 0xd3f0ce1d, 0xfffc, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("d3f0ce1d-fffc-11d1-81b0-0060083316c1", CLSID_MiniportDriverDMusUARTCapture); -#define CLSID_MiniportDriverDMusUARTCapture DEFINE_GUIDNAMED(CLSID_MiniportDriverDMusUARTCapture) - -#define STATIC_IID_IPortDMus\ - 0xc096df9c, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("c096df9c-fb09-11d1-81b0-0060083316c1", IID_IPortDMus); -#define IID_IPortDMus DEFINE_GUIDNAMED(IID_IPortDMus) - -#define STATIC_IID_IMiniportDMus\ - 0xc096df9d, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("c096df9d-fb09-11d1-81b0-0060083316c1", IID_IMiniportDMus); -#define IID_IMiniportDMus DEFINE_GUIDNAMED(IID_IMiniportDMus) - -#define STATIC_IID_IMXF\ - 0xc096df9e, 0xfb09, 0x11d1, 0x81, 0xb0, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("c096df9e-fb09-11d1-81b0-0060083316c1", IID_IMXF); -#define IID_IMXF DEFINE_GUIDNAMED(IID_IMXF) - -#define STATIC_IID_IAllocatorMXF\ - 0xa5f0d62c, 0xb30f, 0x11d2, 0xb7, 0xa3, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("a5f0d62c-b30f-11d2-b7a3-0060083316c1", IID_IAllocatorMXF); -#define IID_IAllocatorMXF DEFINE_GUIDNAMED(IID_IAllocatorMXF) - -#define STATIC_IID_ISynthSinkDMus\ - 0x1f476974, 0x679b, 0x11d2, 0x8f, 0x7d, 0x00, 0xc0, 0x4f, 0xbf, 0x8f, 0xef -DEFINE_GUIDSTRUCT("1f476974-679b-11d2-8f7d-00c04fbf8fef", IID_ISynthSinkDMus); -#define IID_ISynthSinkDMus DEFINE_GUIDNAMED(IID_ISynthSinkDMus) - -#define STATIC_KSAUDFNAME_DMUSIC_MPU_OUT\ - 0xA4DF0EB5, 0xBAC9, 0x11d2, 0xB7, 0xA8, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1 -DEFINE_GUIDSTRUCT("A4DF0EB5-BAC9-11d2-B7A8-0060083316C1", KSAUDFNAME_DMUSIC_MPU_OUT); -#define KSAUDFNAME_DMUSIC_MPU_OUT DEFINE_GUIDNAMED(KSAUDFNAME_DMUSIC_MPU_OUT) - -#define STATIC_KSAUDFNAME_DMUSIC_MPU_IN\ - 0xB2EC0A7D, 0xBAC9, 0x11d2, 0xB7, 0xA8, 0x00, 0x60, 0x08, 0x33, 0x16, 0xC1 -DEFINE_GUIDSTRUCT("B2EC0A7D-BAC9-11d2-B7A8-0060083316C1", KSAUDFNAME_DMUSIC_MPU_IN); -#define KSAUDFNAME_DMUSIC_MPU_IN DEFINE_GUIDNAMED(KSAUDFNAME_DMUSIC_MPU_IN) - - -/***************************************************************************** - * IPortDMus - ***************************************************************************** - * Interface for DMusic port lower edge. - */ -DECLARE_INTERFACE_(IPortDMus,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort - - // For IPortDMus - STDMETHOD_(void,Notify) - ( THIS_ - __in_opt PSERVICEGROUP ServiceGroup - ) PURE; - - STDMETHOD_(void,RegisterServiceGroup) - ( THIS_ - __in PSERVICEGROUP ServiceGroup - ) PURE; -}; - -typedef IPortDMus *PPORTDMUS; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortDMus\ - IMP_IPort;\ - STDMETHODIMP_(void) Notify\ - ( __in_opt PSERVICEGROUP ServiceGroup\ - );\ - STDMETHODIMP_(void) RegisterServiceGroup\ - ( __in PSERVICEGROUP ServiceGroup\ - ) -#endif /* PC_IMPLEMENTATION */ - - -/***************************************************************************** - * IMXF - ***************************************************************************** - * Interface for DMusic miniport streams. - */ -struct IMXF; -typedef IMXF *PMXF; - -#if !defined(DEFINE_ABSTRACT_MXF) - -#define DEFINE_ABSTRACT_MXF() \ - STDMETHOD_(NTSTATUS,SetState) \ - ( THIS_ \ - __in KSSTATE State \ - ) PURE; \ - STDMETHOD_(NTSTATUS,PutMessage) \ - ( THIS_ \ - __in PDMUS_KERNEL_EVENT pDMKEvt \ - ) PURE; \ - STDMETHOD_(NTSTATUS,ConnectOutput) \ - ( THIS_ \ - __in PMXF sinkMXF \ - ) PURE; \ - STDMETHOD_(NTSTATUS,DisconnectOutput) \ - ( THIS_ \ - __in PMXF sinkMXF \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_MXF) - -DECLARE_INTERFACE_(IMXF,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MXF() // For IMXF -}; - -#define IMP_IMXF\ - STDMETHODIMP_(NTSTATUS) SetState\ - ( __in KSSTATE State\ - );\ - STDMETHODIMP_(NTSTATUS) PutMessage\ - ( __in PDMUS_KERNEL_EVENT pDMKEvt\ - );\ - STDMETHODIMP_(NTSTATUS) ConnectOutput\ - ( __in PMXF sinkMXF\ - );\ - STDMETHODIMP_(NTSTATUS) DisconnectOutput\ - ( __in PMXF sinkMXF\ - );\ - -/***************************************************************************** - * IAllocatorMXF - ***************************************************************************** - * Interface for DMusic miniport streams. - */ -struct IAllocatorMXF; -typedef IAllocatorMXF *PAllocatorMXF; - -DECLARE_INTERFACE_(IAllocatorMXF,IMXF) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MXF() // For IMXF - - // For IAllocatorMXF - STDMETHOD_(NTSTATUS,GetMessage) - ( THIS_ - __out PDMUS_KERNEL_EVENT * ppDMKEvt - ) PURE; - - STDMETHOD_(USHORT,GetBufferSize) - ( THIS - ) PURE; - - STDMETHOD_(NTSTATUS,GetBuffer) - ( THIS_ - __out PBYTE * ppBuffer - ) PURE; - - STDMETHOD_(NTSTATUS,PutBuffer) - ( THIS_ - __in PBYTE pBuffer - ) PURE; -}; - -#define IMP_IAllocatorMXF\ - IMP_IMXF;\ - STDMETHODIMP_(NTSTATUS) GetMessage\ - ( __out PDMUS_KERNEL_EVENT * ppDMKEvt\ - );\ - STDMETHODIMP_(USHORT) GetBufferSize\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) GetBuffer\ - ( __out PBYTE * ppBuffer\ - );\ - STDMETHODIMP_(NTSTATUS) PutBuffer\ - ( __in PBYTE pBuffer\ - );\ - - -typedef enum -{ - DMUS_STREAM_MIDI_INVALID = -1, - DMUS_STREAM_MIDI_RENDER = 0, - DMUS_STREAM_MIDI_CAPTURE, - DMUS_STREAM_WAVE_SINK -} DMUS_STREAM_TYPE; - -/***************************************************************************** - * ISynthSinkDMus - ***************************************************************************** - * Interface for synth wave out. - */ -DECLARE_INTERFACE_(ISynthSinkDMus,IMXF) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MXF() // For IMXF - - // For ISynthSinkDMus - STDMETHOD_(void,Render) - ( THIS_ - __in PBYTE pBuffer, - __in DWORD dwLength, - __in LONGLONG llPosition - ) PURE; - - STDMETHOD_(NTSTATUS,SyncToMaster) - ( THIS_ - __in REFERENCE_TIME rfTime, - __in BOOL fStart - ) PURE; - - STDMETHOD_(NTSTATUS,SampleToRefTime) - ( THIS_ - __in LONGLONG llSampleTime, - __out REFERENCE_TIME * prfTime - ) PURE; - - STDMETHOD_(NTSTATUS,RefTimeToSample) - ( THIS_ - __in REFERENCE_TIME rfTime, - __out LONGLONG * pllSampleTime - ) PURE; -}; - -typedef ISynthSinkDMus * PSYNTHSINKDMUS; - -#define IMP_ISynthSinkDMus\ - IMP_IMXF;\ - STDMETHODIMP_(void) Render\ - ( __in PBYTE pBuffer,\ - __in DWORD dwLength,\ - __in LONGLONG llPosition\ - );\ - STDMETHODIMP_(NTSTATUS) SyncToMaster\ - ( __in REFERENCE_TIME rfTime,\ - __in BOOL fStart\ - );\ - STDMETHODIMP_(NTSTATUS) SampleToRefTime\ - ( __in LONGLONG llSampleTime,\ - __out REFERENCE_TIME * prfTime\ - );\ - STDMETHODIMP_(NTSTATUS) RefTimeToSample\ - ( __in REFERENCE_TIME rfTime,\ - __out LONGLONG * pllSampleTime\ - ) - - -/***************************************************************************** - * IMasterClock - ***************************************************************************** - * Master clock for MXF graph - */ -DECLARE_INTERFACE_(IMasterClock,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,GetTime) - ( THIS_ - __out REFERENCE_TIME * pTime - ) PURE; -}; - -typedef IMasterClock *PMASTERCLOCK; - -#define IMP_IMasterClock \ - STDMETHODIMP_(NTSTATUS) GetTime \ - ( THIS_ \ - __out REFERENCE_TIME * pTime \ - ); \ - - -#if (NTDDI_VERSION < NTDDI_WINXP) -/***************************************************************************** - * IPositionNotify - ***************************************************************************** - * Byte position notify for MXF graph - */ -DECLARE_INTERFACE_(IPositionNotify,IUnknown) -{ - STDMETHOD_(void,PositionNotify) - ( THIS_ - __in ULONGLONG bytePosition - ) PURE; -}; - -typedef IPositionNotify *PPOSITIONNOTIFY; - -#define IMP_IPositionNotify \ - STDMETHODIMP_(void) PositionNotify \ - ( THIS_ \ - __in ULONGLONG bytePosition \ - ); \ - -#endif - -/***************************************************************************** - * IMiniportDMus - ***************************************************************************** - * Interface for DMusic miniports. - */ -DECLARE_INTERFACE_(IMiniportDMus,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportDMus - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in_opt PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTDMUS Port, - __out PSERVICEGROUP * ServiceGroup - ) PURE; - - STDMETHOD_(void,Service) - ( THIS - ) PURE; - - STDMETHOD_(NTSTATUS,NewStream) - ( THIS_ - __out PMXF * MXF, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in ULONG PinID, - __in DMUS_STREAM_TYPE StreamType, - __in PKSDATAFORMAT DataFormat, - __out PSERVICEGROUP * ServiceGroup, - __in PAllocatorMXF AllocatorMXF, - __in PMASTERCLOCK MasterClock, - __out PULONGLONG SchedulePreFetch - ) PURE; -}; - -typedef IMiniportDMus *PMINIPORTDMUS; - -#define IMP_IMiniportDMus\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in_opt PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTDMUS Port,\ - __out PSERVICEGROUP * ServiceGroup\ - );\ - STDMETHODIMP_(void) Service\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) NewStream\ - ( __out PMXF * MXF, \ - __in_opt PUNKNOWN OuterUnknown OPTIONAL, \ - __in POOL_TYPE PoolType, \ - __in ULONG PinID, \ - __in DMUS_STREAM_TYPE StreamType, \ - __in PKSDATAFORMAT DataFormat, \ - __out PSERVICEGROUP * ServiceGroup, \ - __in PAllocatorMXF AllocatorMXF, \ - __in PMASTERCLOCK MasterClock, \ - __out PULONGLONG SchedulePreFetch \ - ); - -DEFINE_GUID(GUID_DMUS_PROP_GM_Hardware, 0x178f2f24, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_GS_Hardware, 0x178f2f25, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Hardware, 0x178f2f26, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_XG_Capable, 0x6496aba1, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_GS_Capable, 0x6496aba2, 0x61b0, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_DLS1, 0x178f2f27, 0xc364, 0x11d1, 0xa7, 0x60, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); -DEFINE_GUID(GUID_DMUS_PROP_WavesReverb, 0x04cb5622, 0x32e5, 0x11d2, 0xaf, 0xa6, 0x00, 0xaa, 0x00, 0x24, 0xd8, 0xb6); -DEFINE_GUID(GUID_DMUS_PROP_Effects, 0xcda8d611, 0x684a, 0x11d2, 0x87, 0x1e, 0x00, 0x60, 0x08, 0x93, 0xb1, 0xbd); - -#ifndef DMUS_EFFECT_NONE -#define DMUS_EFFECT_NONE 0x00000000 -#endif - -#ifndef DMUS_EFFECT_REVERB -#define DMUS_EFFECT_REVERB 0x00000001 -#endif - -#ifndef DMUS_EFFECT_CHORUS -#define DMUS_EFFECT_CHORUS 0x00000002 -#endif - - -#endif /* _DMUSICKS_ */ - diff --git a/qt-correction-tool/pub/ddk/dmusics.h b/qt-correction-tool/pub/ddk/dmusics.h deleted file mode 100644 index e9fafe6..0000000 --- a/qt-correction-tool/pub/ddk/dmusics.h +++ /dev/null @@ -1,207 +0,0 @@ -/************************************************************************ -* * -* dmusics.h -- Definitions for created a DirectMusic software synth * -* * -* Copyright (c) Microsoft Corporation. All rights reserved. * -* * -************************************************************************/ - -#ifndef _DMUSICS_ -#define _DMUSICS_ - -#include "dmusicc.h" - -/* Software synths are enumerated from under this registry key. - */ -#define REGSTR_PATH_SOFTWARESYNTHS "Software\\Microsoft\\DirectMusic\\SoftwareSynths" - -interface IDirectMusicSynth; -interface IDirectMusicSynthSink; - -#ifndef __cplusplus -typedef interface IDirectMusicSynth IDirectMusicSynth; -typedef interface IDirectMusicSynthSink IDirectMusicSynthSink; -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) /* Windows XP or greater */ - -#ifndef _DMUS_VOICE_STATE_DEFINED -#define _DMUS_VOICE_STATE_DEFINED - -typedef struct _DMUS_VOICE_STATE -{ - BOOL bExists; - SAMPLE_POSITION spPosition; -} DMUS_VOICE_STATE; - -#endif /* _DMUS_VOICE_STATE_DEFINED */ - -/* IDirectMusicSynth::Refresh - * - * This is the last buffer of the stream. It may be a partial block. - */ -#define REFRESH_F_LASTBUFFER 0x00000001 - -#endif /* NTDDI_VERSION >= NTDDI_WINXP */ - -#undef INTERFACE -#define INTERFACE IDirectMusicSynth -DECLARE_INTERFACE_(IDirectMusicSynth, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynth */ - STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; - STDMETHOD(Download) (THIS_ LPHANDLE phDownload, - LPVOID pvData, - LPBOOL pbFree ) PURE; - STDMETHOD(Unload) (THIS_ HANDLE hDownload, - HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), - HANDLE hUserData ) PURE; - STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, - LPBYTE pbBuffer, - DWORD cbBuffer) PURE; - STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; - STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; - STDMETHOD(Render) (THIS_ short *pBuffer, - DWORD dwLength, - LONGLONG llPosition) PURE; - STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwPriority) PURE; - STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwPriority) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, - LPDWORD pdwWaveFormatExSize) PURE; - STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; -}; - -#if (NTDDI_VERSION >= NTDDI_WINXP) /* Windows XP or greater */ - -#undef INTERFACE -#define INTERFACE IDirectMusicSynth8 -DECLARE_INTERFACE_(IDirectMusicSynth8, IDirectMusicSynth) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynth */ - STDMETHOD(Open) (THIS_ LPDMUS_PORTPARAMS pPortParams) PURE; - STDMETHOD(Close) (THIS) PURE; - STDMETHOD(SetNumChannelGroups) (THIS_ DWORD dwGroups) PURE; - STDMETHOD(Download) (THIS_ LPHANDLE phDownload, - LPVOID pvData, - LPBOOL pbFree ) PURE; - STDMETHOD(Unload) (THIS_ HANDLE hDownload, - HRESULT ( CALLBACK *lpFreeHandle)(HANDLE,HANDLE), - HANDLE hUserData ) PURE; - STDMETHOD(PlayBuffer) (THIS_ REFERENCE_TIME rt, - LPBYTE pbBuffer, - DWORD cbBuffer) PURE; - STDMETHOD(GetRunningStats) (THIS_ LPDMUS_SYNTHSTATS pStats) PURE; - STDMETHOD(GetPortCaps) (THIS_ LPDMUS_PORTCAPS pCaps) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SetSynthSink) (THIS_ IDirectMusicSynthSink *pSynthSink) PURE; - STDMETHOD(Render) (THIS_ short *pBuffer, - DWORD dwLength, - LONGLONG llPosition) PURE; - STDMETHOD(SetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwPriority) PURE; - STDMETHOD(GetChannelPriority) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwPriority) PURE; - STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pWaveFormatEx, - LPDWORD pdwWaveFormatExSize) PURE; - STDMETHOD(GetAppend) (THIS_ DWORD* pdwAppend) PURE; - - /* IDirectMusicSynth8 */ - STDMETHOD(PlayVoice) (THIS_ REFERENCE_TIME rt, - DWORD dwVoiceId, - DWORD dwChannelGroup, - DWORD dwChannel, - DWORD dwDLId, - long prPitch, /* PREL not defined here */ - long vrVolume, /* VREL not defined here */ - SAMPLE_TIME stVoiceStart, - SAMPLE_TIME stLoopStart, - SAMPLE_TIME stLoopEnd) PURE; - - STDMETHOD(StopVoice) (THIS_ REFERENCE_TIME rt, - DWORD dwVoiceId ) PURE; - - STDMETHOD(GetVoiceState) (THIS_ DWORD dwVoice[], - DWORD cbVoice, - DMUS_VOICE_STATE dwVoiceState[] ) PURE; - STDMETHOD(Refresh) (THIS_ DWORD dwDownloadID, - DWORD dwFlags) PURE; - STDMETHOD(AssignChannelToBuses) (THIS_ DWORD dwChannelGroup, - DWORD dwChannel, - LPDWORD pdwBuses, - DWORD cBuses) PURE; -}; - -#endif /* NTDDI_VERSION >= NTDDI_WINXP */ - -#undef INTERFACE -#define INTERFACE IDirectMusicSynthSink -DECLARE_INTERFACE_(IDirectMusicSynthSink, IUnknown) -{ - /* IUnknown */ - STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - /* IDirectMusicSynthSink */ - STDMETHOD(Init) (THIS_ IDirectMusicSynth *pSynth) PURE; - STDMETHOD(SetMasterClock) (THIS_ IReferenceClock *pClock) PURE; - STDMETHOD(GetLatencyClock) (THIS_ IReferenceClock **ppClock) PURE; - STDMETHOD(Activate) (THIS_ BOOL fEnable) PURE; - STDMETHOD(SampleToRefTime) (THIS_ LONGLONG llSampleTime, - REFERENCE_TIME *prfTime) PURE; - STDMETHOD(RefTimeToSample) (THIS_ REFERENCE_TIME rfTime, - LONGLONG *pllSampleTime) PURE; - STDMETHOD(SetDirectSound) (THIS_ LPDIRECTSOUND pDirectSound, - LPDIRECTSOUNDBUFFER pDirectSoundBuffer) PURE; - STDMETHOD(GetDesiredBufferSize) (THIS_ LPDWORD pdwBufferSizeInSamples) PURE; -}; - - -DEFINE_GUID(IID_IDirectMusicSynth, 0x9823661, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -DEFINE_GUID(IID_IDirectMusicSynthSink,0x9823663, 0x5c85, 0x11d2, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); - -#if (NTDDI_VERSION >= NTDDI_WINXP) /* Windows XP or greater */ -DEFINE_GUID(IID_IDirectMusicSynth8,0x53cab625, 0x2711, 0x4c9f, 0x9d, 0xe7, 0x1b, 0x7f, 0x92, 0x5f, 0x6f, 0xc8); -#else -DEFINE_GUID(CLSID_DirectMusicSynthSink,0xaec17ce3, 0xa514, 0x11d1, 0xaf, 0xa6, 0x0, 0xaa, 0x0, 0x24, 0xd8, 0xb6); -#endif - -/* Property Set GUID_DMUS_PROP_SetSynthSink - * - * Item 0: An IUnknown on which the port can QueryInterface for a user-mode synth sink. - */ -DEFINE_GUID(GUID_DMUS_PROP_SetSynthSink,0x0a3a5ba5, 0x37b6, 0x11d2, 0xb9, 0xf9, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -/* Property Set GUID_DMUS_PROP_SinkUsesDSound - * - * Item 0: A DWORD boolean indicating whether or not the sink requires an IDirectSound interface. The - * default is FALSE if this property item is not implemented by the sink. - */ -DEFINE_GUID(GUID_DMUS_PROP_SinkUsesDSound, 0xbe208857, 0x8952, 0x11d2, 0xba, 0x1c, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12); - -#endif - diff --git a/qt-correction-tool/pub/ddk/dmusprop.h b/qt-correction-tool/pub/ddk/dmusprop.h deleted file mode 100644 index 47ddd9d..0000000 --- a/qt-correction-tool/pub/ddk/dmusprop.h +++ /dev/null @@ -1,263 +0,0 @@ -/*************************************************************************** -* * -* DMusProp.h -- This module defines property items for DirectMusic WDM * -* * -* Copyright (c) 1998, Microsoft Corp. All rights reserved. * -* * -***************************************************************************/ - -#ifndef _DMusProp_ -#define _DMusProp_ - -#include "dmusbuff.h" - -/* - Formats -*/ -#define STATIC_KSDATAFORMAT_SUBTYPE_DIRECTMUSIC\ - 0x1a82f8bc, 0x3f8b, 0x11d2, 0xb7, 0x74, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1 -DEFINE_GUIDSTRUCT("1a82f8bc-3f8b-11d2-b774-0060083316c1", KSDATAFORMAT_SUBTYPE_DIRECTMUSIC); -#define KSDATAFORMAT_SUBTYPE_DIRECTMUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_DIRECTMUSIC) - - -/* - Topology -*/ -#define STATIC_KSNODETYPE_DMSYNTH\ - 0x94824f88, 0x6183, 0x11d2, 0x8f, 0x7a, 0x0, 0xc0, 0x4f, 0xbf, 0x8f, 0xef -DEFINE_GUIDSTRUCT("94824F88-6183-11d2-8F7A-00C04FBF8FEF", KSNODETYPE_DMSYNTH); -#define KSNODETYPE_DMSYNTH DEFINE_GUIDNAMED(KSNODETYPE_DMSYNTH) - -/* - Caps node (per pin) -*/ -#define STATIC_KSNODETYPE_DMSYNTH_CAPS\ - 0xbca2a2f1, 0x93c6, 0x11d2, 0xba, 0x1d, 0x0, 0x0, 0xf8, 0x75, 0xac, 0x12 -DEFINE_GUIDSTRUCT("bca2a2f1-93c6-11d2-ba1d-0000f875ac12", KSNODETYPE_DMSYNTH_CAPS); -#define KSNODETYPE_DMSYNTH_CAPS DEFINE_GUIDNAMED(KSNODETYPE_DMSYNTH_CAPS) - -/* - DDK Property sets and items -*/ -#define STATIC_KSPROPSETID_Synth_Dls\ - 0xd523fa2c, 0xdee3, 0x11d1, 0xa7, 0x89, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 -DEFINE_GUIDSTRUCT("d523fa2c-dee3-11d1-a789-0000f875ac12", KSPROPSETID_Synth_Dls); -#define KSPROPSETID_Synth_Dls DEFINE_GUIDNAMED(KSPROPSETID_Synth_Dls) - -typedef enum -{ - KSPROPERTY_SYNTH_DLS_DOWNLOAD = 0, - KSPROPERTY_SYNTH_DLS_UNLOAD, - KSPROPERTY_SYNTH_DLS_COMPACT, - KSPROPERTY_SYNTH_DLS_APPEND, - KSPROPERTY_SYNTH_DLS_WAVEFORMAT -} KSPROPERTY_SYNTH_DLS; - -typedef struct _SYNTH_BUFFER -{ - ULONG BufferSize; - PVOID BufferAddress; -} SYNTH_BUFFER, *PSYNTH_BUFFER; - -typedef struct _SYNTHDOWNLOAD -{ - HANDLE DownloadHandle; - BOOL Free; /* the client buffer can be freed */ -} SYNTHDOWNLOAD, *PSYNTHDOWNLOAD; - - -#define STATIC_KSPROPSETID_Synth\ - 0xfedfae25L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 -DEFINE_GUIDSTRUCT("fedfae25-e46e-11d1-aace-0000f875ac12", KSPROPSETID_Synth); -#define KSPROPSETID_Synth DEFINE_GUIDNAMED(KSPROPSETID_Synth) - -typedef enum -{ - KSPROPERTY_SYNTH_VOLUME = 0, /* must be first */ - KSPROPERTY_SYNTH_VOLUMEBOOST, - KSPROPERTY_SYNTH_CAPS, - KSPROPERTY_SYNTH_PORTPARAMETERS, - KSPROPERTY_SYNTH_CHANNELGROUPS, - KSPROPERTY_SYNTH_VOICEPRIORITY, - KSPROPERTY_SYNTH_LATENCYCLOCK, - KSPROPERTY_SYNTH_RUNNINGSTATS -} KSPROPERTY_SYNTH; - -#define SYNTH_PC_DLS (0x00000001) -#define SYNTH_PC_EXTERNAL (0x00000002) -#define SYNTH_PC_SOFTWARESYNTH (0x00000004) -#define SYNTH_PC_MEMORYSIZEFIXED (0x00000008) -#define SYNTH_PC_GMINHARDWARE (0x00000010) -#define SYNTH_PC_GSINHARDWARE (0x00000020) -#if (NTDDI_VERSION < NTDDI_WINXP) -#define SYNTH_PC_REVERB (0x00000040) -#elif (NTDDI_VERSION >= NTDDI_WINXP) -#define SYNTH_PC_XGINHARDWARE (0x00000040) -// 0x80 used in user mode -// 0x100 used in user mode -#define SYNTH_PC_DLS2 (0x00000200) -// 0x400 used in user mode -// 0x800 used in user mode -#define SYNTH_PC_REVERB (0x40000000) -#endif - -#define SYNTH_PC_SYSTEMMEMORY (0x7fffffff) - -typedef struct _SYNTHCAPS -{ - GUID Guid; - DWORD Flags; - DWORD MemorySize; - DWORD MaxChannelGroups; - DWORD MaxVoices; - DWORD MaxAudioChannels; - DWORD EffectFlags; - WCHAR Description[128]; -} SYNTHCAPS, *PSYNTHCAPS; - - -typedef struct _SYNTH_PORTPARAMS -{ - DWORD ValidParams; - DWORD Voices; - DWORD ChannelGroups; - DWORD AudioChannels; - DWORD SampleRate; - DWORD EffectsFlags; - DWORD Share; -} SYNTH_PORTPARAMS, *PSYNTH_PORTPARAMS; - -/* These flags (set in ValidParams) indicate which - * other members of the SYNTH_PORTPARAMS are valid - */ -#define SYNTH_PORTPARAMS_VOICES 0x00000001 -#define SYNTH_PORTPARAMS_CHANNELGROUPS 0x00000002 -#define SYNTH_PORTPARAMS_AUDIOCHANNELS 0x00000004 -#define SYNTH_PORTPARAMS_SAMPLERATE 0x00000008 -#define SYNTH_PORTPARAMS_EFFECTS 0x00000020 -#define SYNTH_PORTPARAMS_SHARE 0x00000040 - -/* SYNTH_EFFECT_ flags are used in the - * EffectFlags fields of SYNTH_PORTPARAMS. - */ - -#define SYNTH_EFFECT_NONE 0x00000000 -#define SYNTH_EFFECT_REVERB 0x00000001 -#define SYNTH_EFFECT_CHORUS 0x00000002 -#define SYNTH_EFFECT_DELAY 0x00000004 - -/* - * Instance data for KSPROPERTY_ITEM_SynthVoicePriority - */ -typedef struct _SYNTHVOICEPRIORITY_INSTANCE -{ - DWORD ChannelGroup; - DWORD Channel; -} SYNTHVOICEPRIORITY_INSTANCE, *PSYNTHVOICEPRIORITY_INSTANCE; - -/* - * Data returned by KSPROPERTY_SYNTH_RUNNINGSTATS - */ -typedef struct _SYNTH_STATS -{ - DWORD ValidStats; /* Flags indicating which fields below are valid. */ - DWORD Voices; /* Average number of voices playing. */ - DWORD TotalCPU; /* Total CPU usage as percent * 100. */ - DWORD CPUPerVoice; /* CPU per voice as percent * 100. */ - DWORD LostNotes; /* Number of notes lost in 1 second. */ - DWORD FreeMemory; /* Free memory in bytes */ - LONG PeakVolume; /* Decibel level * 100. */ -} SYNTH_STATS, *PSYNTH_STATS; - - -#define SYNTH_STATS_VOICES (1 << 0) -#define SYNTH_STATS_TOTAL_CPU (1 << 1) -#define SYNTH_STATS_CPU_PER_VOICE (1 << 2) -#define SYNTH_STATS_LOST_NOTES (1 << 3) -#define SYNTH_STATS_PEAK_VOLUME (1 << 4) -#define SYNTH_STATS_FREE_MEMORY (1 << 5) - -#ifndef _DIRECTAUDIO_PRIORITIES_DEFINED_ -#define _DIRECTAUDIO_PRIORITIES_DEFINED_ - -#define DAUD_CRITICAL_VOICE_PRIORITY (0xF0000000) -#define DAUD_HIGH_VOICE_PRIORITY (0xC0000000) -#define DAUD_STANDARD_VOICE_PRIORITY (0x80000000) -#define DAUD_LOW_VOICE_PRIORITY (0x40000000) -#define DAUD_PERSIST_VOICE_PRIORITY (0x10000000) - -/* These are the default priorities assigned if not overridden. By default priorities are - * equal across channel groups (e.g. channel 5 on channel group 1 has the same priority as - * channel 5 on channel group 2). - * - * In accordance with DLS level 1, channel 10 has the highest priority, followed by 1 through 16 - * except for 10. - */ -#define DAUD_CHAN1_VOICE_PRIORITY_OFFSET (0x0000000E) -#define DAUD_CHAN2_VOICE_PRIORITY_OFFSET (0x0000000D) -#define DAUD_CHAN3_VOICE_PRIORITY_OFFSET (0x0000000C) -#define DAUD_CHAN4_VOICE_PRIORITY_OFFSET (0x0000000B) -#define DAUD_CHAN5_VOICE_PRIORITY_OFFSET (0x0000000A) -#define DAUD_CHAN6_VOICE_PRIORITY_OFFSET (0x00000009) -#define DAUD_CHAN7_VOICE_PRIORITY_OFFSET (0x00000008) -#define DAUD_CHAN8_VOICE_PRIORITY_OFFSET (0x00000007) -#define DAUD_CHAN9_VOICE_PRIORITY_OFFSET (0x00000006) -#define DAUD_CHAN10_VOICE_PRIORITY_OFFSET (0x0000000F) -#define DAUD_CHAN11_VOICE_PRIORITY_OFFSET (0x00000005) -#define DAUD_CHAN12_VOICE_PRIORITY_OFFSET (0x00000004) -#define DAUD_CHAN13_VOICE_PRIORITY_OFFSET (0x00000003) -#define DAUD_CHAN14_VOICE_PRIORITY_OFFSET (0x00000002) -#define DAUD_CHAN15_VOICE_PRIORITY_OFFSET (0x00000001) -#define DAUD_CHAN16_VOICE_PRIORITY_OFFSET (0x00000000) - - -#define DAUD_CHAN1_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN1_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN2_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN2_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN3_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN3_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN4_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN4_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN5_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN5_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN6_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN6_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN7_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN7_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN8_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN8_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN9_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN9_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN10_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN10_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN11_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN11_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN12_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN12_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN13_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN13_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN14_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN14_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN15_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN15_VOICE_PRIORITY_OFFSET) -#define DAUD_CHAN16_DEF_VOICE_PRIORITY (DAUD_STANDARD_VOICE_PRIORITY | DAUD_CHAN16_VOICE_PRIORITY_OFFSET) - -#endif /* _DIRECTAUDIO_PRIORITIES_DEFINED_ */ - -/* - SDK Property sets and items -*/ -typedef struct _SYNTH_REVERB_PARAMS -{ - float fInGain; /* Input gain in dB (to avoid output overflows) */ - float fReverbMix; /* Reverb mix in dB. 0dB means 100% wet reverb (no direct signal). - Negative values gives less wet signal. The coeficients are - calculated so that the overall output level stays (approximately) - constant regardless of the ammount of reverb mix. */ - float fReverbTime; /* The reverb decay time, in milliseconds. */ - float fHighFreqRTRatio; /* The ratio of the high frequencies to the global reverb time. - Unless very 'splashy-bright' reverbs are wanted, this should be set to - a value < 1.0. For example if dRevTime==1000ms and dHighFreqRTRatio=0.1 - than the decay time for high frequencies will be 100ms.*/ -} SYNTH_REVERB_PARAMS, *PSYNTH_REVERB_PARAMS; - - -#define STATIC_KSPROPSETID_SynthClock \ - 0xfedfae26L, 0xe46e, 0x11d1, 0xaa, 0xce, 0x00, 0x00, 0xf8, 0x75, 0xac, 0x12 -DEFINE_GUIDSTRUCT("fedfae26-e46e-11d1-aace-0000f875ac12", KSPROPSETID_SynthClock); -#define KSPROPSETID_SynthClock DEFINE_GUIDNAMED(KSPROPSETID_SynthClock) - -typedef enum -{ - KSPROPERTY_SYNTH_MASTERCLOCK -} KSPROPERTY_SYNTHCLOCK; -#endif /* _DMusProp_ */ - - - diff --git a/qt-correction-tool/pub/ddk/driverspecs.h b/qt-correction-tool/pub/ddk/driverspecs.h deleted file mode 100644 index 4df36d9..0000000 --- a/qt-correction-tool/pub/ddk/driverspecs.h +++ /dev/null @@ -1,847 +0,0 @@ -/*****************************************************************************\ -* * -* DriverSpecs.h - markers for documenting the semantics of driver APIs * -* See also * -* * -* Version 1.2.10 * -* * -* Copyright (c) Microsoft Corporation. All rights reserved. * -* * -\*****************************************************************************/ - -/*****************************************************************************\ -* NOTE * -* NOTE * -* NOTE * -* The macro bodies in this file are subject to change without notice. * -* Attempting to use the annotations in the macro bodies directly is not * -* supported. * -* NOTE * -* NOTE * -* NOTE * -\*****************************************************************************/ - -/*****************************************************************************\ -* The annotations described by KernelSpecs.h and DriverSpecs.h, taken together, -* are used to annotate drivers. Many of the annotations are applicable to -* user space code (including subsystems) as well as to drivers. -* -* DriverSpecs.h contains those annotations which are appropriate to userspace -* code, or which might appear in headers that are shared between user space -* and kernel space. In the case of annotations which might appear in such a -* shared header, but which are meaningless in user space, the annotations are -* #defined to nothing in DriverSpecs.h. -* -* KernelSpecs.h contains those annotations which either will only appear in -* kernel code or headers; or which might appear in shared headers. In the -* latter case, it is assumed that DriverSpecs.h has been #included, and -* the anntoations are re-defined (using #undef) to give them a meaningful -* value. In general, documentation for the shared-header annotations appears -* in DriverSpecs.h. -* -* Many annotations are context dependent. They only apply to certain versions -* of Windows, or only to certain classes of driver. These rules can be written -* using something like __drv_when(NTDDI_VERSION >= NTDDI_WINXP, ...) -* which causes the rule only to apply to Windows XP and later. Many of these -* symbols are already defined in various Windows headers. -* -* To facilitate using this sort of conditional rule, we collect here the -* various known symbols that are (or reasonably might) be used in such -* a conditional annotation. Some are speculative in that the symbol has -* not yet been defined because there are no known uses of it yet. -* -* Where the symbol already exists its relevant header is -* noted below (excluding the "really well known" ones). -* -* Each symbol is listed with the currently known possible values. -* -* Some symbols are marked as #define symbols -- they are used with #ifdef -* operators only. To use them in __drv_when, use something like -* __drv_when(__drv_defined(NT), ...). -* -* WDK Version (copied for convenience from sdkddkver.h) -* NTDDI_VERSION: NTDDI_WIN2K NTDDI_WIN2KSP1 NTDDI_WIN2KSP2 NTDDI_WIN2KSP3 -* NTDDI_WIN2KSP4 NTDDI_WINXP NTDDI_WINXPSP1 NTDDI_WINXPSP2 -* NTDDI_WS03 NTDDI_WS03SP1 NTDDI_VISTA -* The WDK version is taken as the WDM version as well. -* -* OS Version: (copied for convenience from sdkddkver.h) -* _WIN32_WINNT: _WIN32_WINNT_NT4 _WIN32_WINNT_WIN2K _WIN32_WINNT_WINXP -* _WIN32_WINNT_WS03 _WIN32_WINNT_LONGHORN -* WINVER: 0x030B 0x0400 0x0500 0x0600 -* NT (#define symbol) -* (sdkddkver.h also defines symbols for IE versions should they be needed.) -* -* Compiler Version: -* _MSC_VER: too many to list. -* _MSC_FULL_VER: too many to list. -* -* KMDF Version: (Currently defined/used only in makefiles.) -* KMDF_VERSION_MAJOR: 1 -* -* UMDF Version: (Currently defined/used only in makefiles.) -* UMDF_VERSION_MAJOR: 1 -* -* Architecture kinds: -* __WIN64 (#define symbols) -* _X86_ -* _AMD64_ -* _IA64_ -* -* Machine Architectures: -* _M_IX86 -* _M_AMD64 -* _M_IA64 -* -* Driver Kind (NYI: "not yet implemented") -* Typically these will be defined in the most-common header for a -* particular driver (or in individual source files if appropriate). -* These are not intended to necessarily be orthogonal: more than one might -* apply to a particular driver. -* _DRIVER_TYPE_BUS: 1 // NYI -* _DRIVER_TYPE_FUNCTIONAL: 1 // NYI -* _DRIVER_TYPE_MINIPORT: 1 // NYI -* _DRIVER_TYPE_STORAGE: 1 // NYI -* _DRIVER_TYPE_DISPLAY: 1 // NYI -* _DRIVER_TYPE_FILESYSTEM: 1 -* _DRIVER_TYPE_FILESYSTEM_FILTER: 1 -* -* NDIS driver version: (see ndis.h for much more detail.) -* These can be used to both identify an NDIS driver and to check the version. -* NDIS40 NDIS50 NDIS51 NDIS60 (#defined symbols) -* NDIS_PROTOCOL_MAJOR_VERSION.NDIS_PROTOCOL_MINOR_VERSION: 4.0 5.0 5.1 6.0 -* And many others in ndis.h (including MINIPORT) -* -\*****************************************************************************/ - -#ifndef DRIVERSPECS_H -#define DRIVERSPECS_H - -// In case driverspecs.h is included directly (and w/o specstrings.h) -#ifndef SPECSTRINGS_H -#include -#endif - -#include "sdv_driverspecs.h" - -#if _MSC_VER > 1000 // [ -#pragma once -#endif // ] - -#ifdef __cplusplus // [ -extern "C" { -#endif // ] - -#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) // [ -#define __drv_declspec(x) __declspec(x) -#define __$drv_group(annotes) \ - __drv_declspec("SAL_begin") annotes __drv_declspec("SAL_end") -#define __drv_nop(x) x -#else // ][ -#define __drv_declspec(x) -#define __$drv_group(x) -#endif // ] - -#if (_MSC_VER >= 1000) && !defined(__midl) && defined(_PREFAST_) && defined(_MSC_EXTENSIONS)// [ - - - // Synthesize a unique symbol. - #define $$MKID(x, y) x ## y - #define $MKID(x, y) $$MKID(x, y) - #define $GENSYM(x) $MKID(x, __COUNTER__) - - - // --------------------------------------------------------------------- - // Processing mode selection: - // - // __internal_kernel_driver - // - // Flag for headers that indicates a probable driver. - // This should only be coded in headers that are normally used - // as the "primary" header for a class of drivers. It sets the - // default to kernel mode driver. - // - // ';' inside the parens to keep MIDL happy - __ANNOTATION(SAL_internal_kernel_driver();) - #define __internal_kernel_driver \ - typedef int __drv_declspec("SAL_internal_kernel_driver") \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // - // __kernel_code - // __kernel_driver - // __user_driver - // __user_code - // - // Flags for compilation units that indicated specifically what kind of - // code it is. - // These should be coded as early as possible in any compilation unit - // (.c/.cpp file) that doesn't get the correct default. Whether before - // or after __internal_kernel_driver - // - // Indicate that the code is kernel, but not driver, code. - - __ANNOTATION(SAL_kernel();) - __ANNOTATION(SAL_nokernel();) - __ANNOTATION(SAL_driver();) - __ANNOTATION(SAL_nodriver();) - - #define __kernel_code \ - typedef int __drv_declspec("SAL_kernel") \ - __drv_declspec("SAL_nodriver") \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // Indicate that the code is kernel, driver, code. - #define __kernel_driver \ - typedef int __drv_declspec("SAL_kernel") \ - __drv_declspec("SAL_driver") \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // Indicate that the code is a user mode driver. - #define __user_driver \ - typedef int __drv_declspec("SAL_nokernel") \ - __drv_declspec("SAL_driver") \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // Indicate that the code is ordinary user mode code. - #define __user_code \ - typedef int __drv_declspec("SAL_nokernel") \ - __drv_declspec("SAL_nodriver") \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // "landmark" function definition to pass information to the - // analysis tools, as needed. - - __ANNOTATION(SAL_landmark(__in char *);) - - #define __drv_Mode_impl(x) \ - __declspec("SAL_landmark(\"" #x "\")") \ - __inline void $GENSYM(__SAL_dummy_)(void){} - - // Macros to declare a function to be a particular class - // of driver. - - #define __drv_WDM __drv_Mode_impl(WDM) - #define __drv_KMDF __drv_Mode_impl(KMDF) - #define __drv_NDIS __drv_Mode_impl(NDIS) - - // Inform PREfast that operator new does [not] throw. - // Be sure you really know which is actually in use before using one of - // these. The default is throwing (and cannot return NULL) which is - // standard conformant, but much kernel code links with a non-throwing - // operator new. - // - // Header will set the default to throwing, so be sure to place - // this after that header is included. - // - // Be sure to use these macros for this purpose as the implementation - // could change. - - #define __prefast_operator_new_throws \ - void* __cdecl operator new(size_t size) throw(std::bad_alloc); \ - void* __cdecl operator new[](size_t size) throw(std::bad_alloc); - - #define __prefast_operator_new_null \ - void* __cdecl operator new(size_t size) throw(); \ - void* __cdecl operator new[](size_t size) throw(); - - -#else // ][ - - #define __internal_kernel_driver - #define __kernel_code - #define __kernel_driver - #define __user_driver - #define __user_code - #define __drv_Mode_impl(x) - #define __drv_WDM - #define __drv_KMDF - #define __drv_NDIS - #define __prefast_operator_new_throws - #define __prefast_operator_new_null - - -#endif // ] - - // core macros: these provide syntatic wrappers to make other uses - // simpler. - // (Note: right now we can't safely use the ellipsis (...) macro - // syntax. If we could then '##__drv_nop(annotes)' below could be - // simply 'annotes', and we could code __$drv_group as __$drv_group(...) - // in the "expands to nothing" case.) - // - // For example: - // __drv_in(__drv_nonconstant __setsIRQL) - - #define __drv_deref(annotes) __deref __$drv_group(##__drv_nop(annotes)) - #define __drv_in(annotes) __pre __$drv_group(##__drv_nop(annotes)) - #define __drv_in_deref(annotes) __pre __deref __$drv_group(##__drv_nop(annotes)) - #define __drv_out(annotes) __post __$drv_group(##__drv_nop(annotes)) - #define __drv_out_deref(annotes) __post __deref __$drv_group(##__drv_nop(annotes)) - #define __drv_when(cond, annotes) \ - __drv_declspec("SAL_when(" SPECSTRINGIZE(cond) ")") __$drv_group(##__drv_nop(annotes)) - #define __drv_at(expr,annotes)\ - __drv_declspec("SAL_at(" SPECSTRINGIZE(expr) ")") __$drv_group(##__drv_nop(annotes)) - - #define __drv_fun(annotes) __drv_at(return,##__drv_nop(annotes)) - #define __drv_ret(annotes) __drv_at(return,##__drv_nop(annotes)) - #define __drv_arg(expr,annotes) __drv_at(expr,##__drv_nop(annotes)) - #define __drv_unit(p) \ - typedef int __$drv_unit_##p \ - $GENSYM(__prefast_flag_kernel_driver_mode); - - // Internal macros for convenience - #define __$drv_unit_internal_kernel_driver \ - __drv_declspec("SAL_internal_kernel_driver") - - // - // __drv_unit - // - // Flags for compilation units that indicated specifically what kind of - // code it is. - // These should be coded as early as possible in any compilation unit - // (.c/.cpp file) that doesn't get the correct default. Whether before - // or after __internal_kernel_driver is immaterial as long as it will - // successfully parse. - // - // Indicate that the code is kernel, but not driver, code. - #define __$drv_unit_kernel_code \ - __drv_declspec("SAL_kernel") __drv_declspec("SAL_nodriver") - - // Indicate that the code is kernel, driver, code. - #define __$drv_unit_kernel_driver \ - __drv_declspec("SAL_kernel") __drv_declspec("SAL_driver") - - // Indicate that the code is a user mode driver. - #define __$drv_unit_user_driver \ - __drv_declspec("SAL_nokernel") __drv_declspec("SAL_driver") - - // Indicate that the code is ordinary user mode code. - #define __$drv_unit_user_code \ - __drv_declspec("SAL_nokernel") __drv_declspec("SAL_nodriver") - - - // These are needed for backwards compatability. - #ifndef __internal_kernel_driver - - #define __internal_kernel_driver __drv_unit(internal_kernel_driver) - #define __kernel_code __drv_unit(kernel_code) - #define __kernel_driver __drv_unit(kernel_driver) - #define __user_driver __drv_unit(user_driver) - #define __user_code __drv_unit(user_code) - - #endif - - // --------------------------------------------------------------------- - // Syntatic utilities: - // - // Needed to make the annotations convenient to use. - // - // So we can use a macro name that might be used in #ifdef context, - // where it's defined with no value. - // This should only be used inside a __drv_when condition. - // - #define __drv_defined(x) macroDefined$( #x ) - - // --------------------------------------------------------------------- - // Callback properties: - // - // __drv_functionClass(x) - // - // Flag that the the annotated function - // is a member of that function class. Some class names are recognized - // by PREfast itself for special treatment. - // This can be tested by the condition function inFunctionClass$() - // - __ANNOTATION(SAL_functionClass(__in char *);) - #define __drv_functionClass(x) \ - __drv_out(__drv_declspec("SAL_functionClass(\""#x"\")")) - - // --------------------------------------------------------------------- - // Resources: - // - // __drv_acquiresResource(kind) - // __drv_releasesResource(kind) - // __drv_acquiresResourceGlobal(kind,param) - // __drv_releasesResourceGlobal(kind,param) - // __drv_mustHold(kind) - // __drv_neverHold(kind) - // __drv_mustHoldGlobal(kind,param) - // __drv_neverHoldGlobal(kind,param) - // - // Flag that the annotated parameter acquires a resource of type kind. - // - __ANNOTATION(SAL_acquire(__in char *);) - #define __drv_acquiresResource(kind) \ - __post __drv_declspec("SAL_acquire(\"" #kind "\")") - - // - // Flag that the annotated parameter releases a resource of type kind. - // - __ANNOTATION(SAL_release(__in char *);) - #define __drv_releasesResource(kind) \ - __post __drv_declspec("SAL_release(\"" #kind "\")") - - // - // Flag that the annotated object acquires a global (otherwise anonymous) - // resource of type kind named by param. - // - __ANNOTATION(SAL_acquireGlobal(__in char *, ...);) - #define __drv_innerAcquiresGlobal(kind, param) \ - __post __drv_declspec("SAL_acquireGlobal(\"" #kind "\"," \ - SPECSTRINGIZE(param\t)")") - #define __drv_acquiresResourceGlobal(kind,param) \ - __drv_innerAcquiresGlobal(kind, param) - // - // Flag that the annotated object acquires a global (otherwise anonymous) - // resource of type kind named by param. - // - __ANNOTATION(SAL_releaseGlobal(__in char *, ...);) - #define __drv_innerReleasesGlobal(kind, param) \ - __post __drv_declspec("SAL_releaseGlobal(\"" #kind "\"," \ - SPECSTRINGIZE(param\t)")") - #define __drv_releasesResourceGlobal(kind, param) \ - __drv_innerReleasesGlobal(kind, param) - - // - // Flag that the annotated parameter must hold a resource of type kind - // - __ANNOTATION(SAL_mustHold(__in char *);) - #define __drv_mustHold(kind) \ - __pre __drv_declspec("SAL_mustHold(\""#kind"\")") - - // - // Flag that the annotated object must hold a global resource - // of type kind named by param. - // - __ANNOTATION(SAL_mustHoldGlobal(__in char *, ...);) - #define __drv_innerMustHoldGlobal(kind, param) \ - __pre __drv_declspec("SAL_mustHoldGlobal(\"" #kind "\"," \ - SPECSTRINGIZE(param\t)")") - #define __drv_mustHoldGlobal(kind,param) \ - __drv_innerMustHoldGlobal(kind, param) - - // - // Flag that the annotated parameter must never hold a resource of type kind - // - __ANNOTATION(SAL_neverHold(__in char *);) - #define __drv_neverHold(kind) \ - __pre __drv_declspec("SAL_neverHold(\"" #kind "\")") - - // - // Flag that the annotated object must never hold a global resource - // of type kind named by param. - // - __ANNOTATION(SAL_neverHoldGlobal(__in char *, ...);) - #define __drv_innerNeverHoldGlobal(kind, param) \ - __pre __drv_declspec("SAL_neverHoldGlobal(\"" #kind "\"," \ - SPECSTRINGIZE(param\t)")") - #define __drv_neverHoldGlobal(kind,param) \ - __drv_innerNeverHoldGlobal(kind, param) - - // Predicates to determine if a resource is held - __PRIMOP(int, holdsResource$(__in __deferTypecheck char *,__in char *);) - __PRIMOP(int, holdsResourceGlobal$(__in char *, ...);) - - // --------------------------------------------------------------------- - // Maintenance of IRQL values - // - // __drv_setsIRQL(irql) - // __drv_raisesIRQL(irql) - // __drv_requiresIRQL(irql) - // __drv_maxIRQL(irql) - // __drv_minIRQL(irql) - // __drv_savesIRQL - // __drv_restoresIRQL - // __drv_savesIRQLGlobal(kind,param) - // __drv_restoresIRQLGlobal(kind,param) - // __drv_minFunctionIRQL(irql) - // __drv_maxFunctionIRQL(irql) - // __drv_useCancelIRQL - // __drv_sameIRQL - - // - // The funciton exits at IRQL irql - // - #define __drv_setsIRQL(irql) /* see kernelspecs.h */ - - // - // The funciton exits at IRQL irql, but this may only raise the irql. - // - #define __drv_raisesIRQL(irql) /* see kernelspecs.h */ - - // - // The called function must be entered at IRQL level - // - #define __drv_requiresIRQL(irql) /* see kernelspecs.h */ - - - // - // The maximum IRQL at which the function may be called. - // - #define __drv_maxIRQL(irql) /* see kernelspecs.h */ - - // - // The minimum IRQL at which the function may be called. - // - #define __drv_minIRQL(irql) /* see kernelspecs.h */ - - // - // The current IRQL is saved in the annotated parameter - // - #define __drv_savesIRQL /* see kernelspecs.h */ - - // - // The current IRQL is saved in the (otherwise anonymous) global object - // identified by kind and further refined by param. - // - #define __drv_savesIRQLGlobal(kind,param) /* see kernelspecs.h */ - - // - // The current IRQL is restored from the annotated parameter - // - #define __drv_restoresIRQL /* see kernelspecs.h */ - - // - // The current IRQL is restored from the (otherwise anonymous) global object - // identified by kind and further refined by param. - // - #define __drv_restoresIRQLGlobal(kind,param) /* see kernelspecs.h */ - - // The minimum IRQL to which the function can lower itself. The IRQL - // at entry is assumed to be that value unless overridden. - #define __drv_minFunctionIRQL(irql) /* see kernelspecs.h */ - - // The maximum IRQL to which the function can raise itself. - #define __drv_maxFunctionIRQL(irql) /* see kernelspecs.h */ - - // The function must exit with the same IRQL it was entered with. - // (It may change it but it must restore it.) - #define __drv_sameIRQL /* see kernelspecs.h */ - - // The annotated parameter contains the cancelIRQL, which will be restored - // by the called function. - - #define __drv_useCancelIRQL /* see kernelspecs.h */ - - // --------------------------------------------------------------------- - // Specific function behaviors - - // The annotated function clears the requirement that DoInitializeing - // is cleared (or not). - __ANNOTATION(SAL_clearDoInit(enum __SAL_YesNo);) - #define __drv_clearDoInit(yesNo) \ - __post __drv_declspec("SAL_clearDoInit(" SPECSTRINGIZE(yesNo) ")") - - // This is (or is like) IoGetDmaAdapter: look for misuse of DMA pointers - __ANNOTATION(SAL_IoGetDmaAdapter(void);) - #define __drv_IoGetDmaAdapter \ - __post __drv_declspec("SAL_IoGetDmaAdapter") - - // --------------------------------------------------------------------- - // Function and out parameter return values. - // - // __drv_valueIs() - // - // The function being annotated will return each of the specified values - // during simulation. The items in the list are , - // e.g. ==0 or <0. - // This is a ; separated list of values. The internal parser will accept - // a comma-separated list. In the future __VA_ARGS__ could be used. - // See the documentation for use of this. - // - - __ANNOTATION(SAL_return(__in __AuToQuOtE char *);) - #define __drv_valueIs(arglist) \ - __post __drv_declspec("SAL_return("SPECSTRINGIZE(arglist)")") - - // --------------------------------------------------------------------- - // Additional parameter checking. - // - // __drv_constant - // __drv_nonConstant - // __drv_strictTypeMatch(mode) - // __drv_strictType(type,mode) - // - // The actual parameter must evaluate to a constant (not a const). - // - __ANNOTATION(SAL_constant(enum __SAL_YesNo);) - #define __drv_constant __pre __drv_declspec("SAL_constant(__yes)") - - // - // The actual parameter may never evaluate to a numeric constant - // (exclusive of a const symbol). - // - #define __drv_nonConstant __pre __drv_declspec("SAL_constant(__no)") - - // - // The actual parameter must match the type of the annotated formal - // within the specifications set by mode. - // - __ANNOTATION(SAL_strictTypeMatch(__int64);) - #define __drv_strictTypeMatch(mode) \ - __pre __drv_declspec("SAL_strictTypeMatch("SPECSTRINGIZE(mode)")") - - // - // The actual parameter must match the type of typename (below) - // within the specifications set by mode. - // - __ANNOTATION(SAL_strictType(__in __AuToQuOtE char *);) // currently 1/2 args - #define __drv_strictType(typename,mode) \ - __pre __drv_declspec("SAL_strictType("SPECSTRINGIZE(typename)","\ - SPECSTRINGIZE(mode)")") - // - // The following modes are defined: - #define __drv_typeConst 0 // constants of that type - #define __drv_typeCond 1 // plus ?: - #define __drv_typeBitset 2 // plus all operators - #define __drv_typeExpr 3 // plus literal constants - // - // The actual parameter must be data (not a pointer). Used to - // prevent passing pointers to pointers when pointers to structures - // are needed (because &pXXX is a common error when pXXX is - // intended). - __ANNOTATION(SAL_mayBePointer(enum __SAL_YesNo);) - #define __drv_notPointer __pre __drv_declspec("SAL_mayBePointer(__no)") - // - // Convenience for the most common form of the above. - #define __drv_isObjectPointer __drv_deref(__drv_notPointer) - - // --------------------------------------------------------------------- - // Memory management - // - // __drv_aliasesMem - // __drv_allocatesMem - // __drv_freesMem - // - // The annotated parameter is "kept" by the function, creating an - // alias, and relieving any obligation to free the object. - // - __ANNOTATION(SAL_IsAliased(void);) - #define __drv_aliasesMem __post __drv_declspec("SAL_IsAliased") - - // - // Allocate/release memory-like objects. - // Kind is unused, but should be "mem" for malloc/free - // and "object" for new/delete. - __ANNOTATION(SAL_NeedsRelease(enum __SAL_YesNo);) - #define __drv_allocatesMem(kind) __post __drv_declspec("SAL_NeedsRelease(__yes)") - - #define __drv_freesMem(kind) __post __drv_declspec("SAL_NeedsRelease(__no)") - - // --------------------------------------------------------------------- - // Additional diagnostics - // - // __drv_preferredFunction - // __drv_reportError - // - // - // Function 'func' should be used for reason 'why'. Often used - // conditionally. - // - __ANNOTATION(SAL_preferredFunction(__in __AuToQuOtE char *, __in __AuToQuOtE char *);) - #define __drv_preferredFunction(func,why) \ - __pre __drv_declspec( \ - "SAL_preferredFunction(" SPECSTRINGIZE(func) "," \ - SPECSTRINGIZE(why) ")") - - // - // The error given by 'why' was detected. Used conditionally. - // - __ANNOTATION(SAL_error(__in __AuToQuOtE char *);) - #define __drv_reportError(why) \ - __pre __drv_declspec("SAL_error(" SPECSTRINGIZE(why) ")") - - // --------------------------------------------------------------------- - // Floating point save/restore: - // - // __drv_floatSaved - // __drv_floatRestored - // __drv_floatUsed - // - // The floating point hardware was saved (available to kernel) - __ANNOTATION(SAL_floatSaved(void);) - #define __drv_floatSaved __post __drv_declspec("SAL_floatSaved") - - // - // The floating point hardware was restored (no longer available) - __ANNOTATION(SAL_floatRestored(void);) - #define __drv_floatRestored __post __drv_declspec("SAL_floatRestored") - - // - // The function uses floating point. Functions with floating point - // in their type signature get this automatically. - __ANNOTATION(SAL_floatUsed(void);) - #define __drv_floatUsed __post __drv_declspec("SAL_floatUsed") - - // --------------------------------------------------------------------- - // Usage: - // - // __drv_interlocked - // __drv_inTry - // __drv_notInTry - // - // The parameter is used for interlocked instructions. - __ANNOTATION(SAL_interlocked(void);) - #define __drv_interlocked __pre __drv_declspec("SAL_interlocked") - - // The function must be called inside a try block - __ANNOTATION(SAL_inTry(enum __SAL_YesNo);) - #define __drv_inTry __pre __drv_declspec("SAL_inTry(__yes)") - - // The function must not be called inside a try block - #define __drv_notInTry __pre __drv_declspec("SAL_inTry(__no)") - - // --------------------------------------------------------------------- - // FormatString: - // - // kind can be "printf", "scanf", "strftime" or "FormatMessage". - __ANNOTATION(SAL_IsFormatString(__in char *);) - #define __drv_formatString(kind)\ - __drv_declspec("SAL_IsFormatString(\"" #kind "\")") - - // --------------------------------------------------------------------- - // SDV support: see the SDV documentation for details - - // Identify dispatch callback types - __ANNOTATION(SAL_dispatchType(__in __int64);) - #define __drv_dispatchType(kindlist)\ - __pre __drv_declspec("SAL_dispatchType("\ - SPECSTRINGIZE(kindlist) ")" ) - - // Identify dispatch callback types - special case - #define __drv_dispatchType_other\ - __drv_dispatchType(-1) - - // Identify completion callback types - __ANNOTATION(SAL_completionType(__in __AuToQuOtE char *);) - #define __drv_completionType(kindlist)\ - __drv_declspec("SAL_completionType("\ - #kindlist ")" ) - - __ANNOTATION(SAL_callbackType(__in __AuToQuOtE char *);) - // Identify callback types (FDO or PDO) - #define __drv_callbackType(kind)\ - __drv_declspec("SAL_callbackType("\ - #kind ")" ) - // --------------------------------------------------------------------- - // Composite: - -#ifdef _PREFAST_ // [ expand to nothing immediately to avoid RC problem - // - // Exclusive Resources - #define __drv_acquiresExclusiveResource(kind) \ - __$drv_group( \ - __drv_neverHold(kind) \ - __drv_acquiresResource(kind)) - - #define __drv_releasesExclusiveResource(kind) \ - __$drv_group( \ - __drv_mustHold(kind) \ - __drv_releasesResource(kind)) - - #define __drv_acquiresExclusiveResourceGlobal(kind, param) \ - __drv_neverHoldGlobal(kind, param) \ - __drv_acquiresResourceGlobal(kind, param) - - #define __drv_releasesExclusiveResourceGlobal(kind, param) \ - __drv_mustHoldGlobal(kind, param) \ - __drv_releasesResourceGlobal(kind, param) - - // - // CancelSpinLock - #define __drv_acquiresCancelSpinLock \ - __drv_innerNeverHoldGlobal(CancelSpinLock,) \ - __drv_innerAcquiresGlobal(CancelSpinLock,) - - #define __drv_releasesCancelSpinLock \ - __drv_innerMustHoldGlobal(CancelSpinLock,) \ - __drv_innerReleasesGlobal(CancelSpinLock,) - - #define __drv_mustHoldCancelSpinLock \ - __drv_innerMustHoldGlobal(CancelSpinLock,) - - #define __drv_neverHoldCancelSpinLock \ - __drv_innerNeverHoldGlobal(CancelSpinLock,) - - #define __drv_holdsCancelSpinLock() \ - holdsResourceGlobal$("CancelSpinLock",) - - // - // CriticalRegion - #define __drv_acquiresCriticalRegion \ - __drv_innerNeverHoldGlobal(CriticalRegion,) \ - __drv_innerAcquiresGlobal(CriticalRegion,) - - #define __drv_releasesCriticalRegion \ - __drv_innerMustHoldGlobal(CriticalRegion,) \ - __drv_innerReleasesGlobal(CriticalRegion,) - - #define __drv_mustHoldCriticalRegion \ - __drv_innerMustHoldGlobal(CriticalRegion,) - - #define __drv_neverHoldCriticalRegion \ - __drv_innerNeverHoldGlobal(CriticalRegion,) - - #define __drv_holdsCriticalRegion() \ - holdsResourceGlobal$("CriticalRegion",) - - - // - // PriorityRegion - #define __drv_acquiresPriorityRegion \ - __drv_innerNeverHoldGlobal(PriorityRegion,) \ - __drv_innerAcquiresGlobal(PriorityRegion,) - - #define __drv_releasesPriorityRegion \ - __drv_innerMustHoldGlobal(PriorityRegion,) \ - __drv_innerReleasesGlobal(PriorityRegion,) - - #define __drv_mustHoldPriorityRegion \ - __drv_innerMustHoldGlobal(PriorityRegion,) - - #define __drv_neverHoldPriorityRegion \ - __drv_innerNeverHoldGlobal(PriorityRegion,) - - #define __drv_holdsPriorityRegion() \ - holdsResourceGlobal$("PriorityRegion",) - -#else // ][ - - #define __drv_acquiresExclusiveResource(kind) - #define __drv_releasesExclusiveResource(kind) - #define __drv_acquiresExclusiveResourceGlobal(kind, param) - #define __drv_releasesExclusiveResourceGlobal(kind, param) - #define __drv_acquiresCancelSpinLock - #define __drv_releasesCancelSpinLock - #define __drv_mustHoldCancelSpinLock - #define __drv_holdsCancelSpinLock() - #define __drv_neverHoldCancelSpinLock - #define __drv_acquiresCriticalRegion - #define __drv_releasesCriticalRegion - #define __drv_mustHoldCriticalRegion - #define __drv_neverHoldCriticalRegion - #define __drv_holdsCriticalRegion() - #define __drv_acquiresPriorityRegion - #define __drv_releasesPriorityRegion - #define __drv_mustHoldPriorityRegion - #define __drv_neverHoldPriorityRegion - #define __drv_holdsPriorityRegion() - -#endif // ] - - // Passing the cancel Irql to a utility function - #define __drv_isCancelIRQL /* see kernelspecs.h */ - - __PRIMOP(int, inFunctionClass$(__in char *);) - - // Check if this is kernel or driver code - __PRIMOP(int, isKernel$(void);) - __PRIMOP(int, isDriver$(void);) - -#ifdef __cplusplus -} -#endif - -#endif // DRIVERSPECS_H - diff --git a/qt-correction-tool/pub/ddk/drivinit.h b/qt-correction-tool/pub/ddk/drivinit.h deleted file mode 100644 index aea12c0..0000000 --- a/qt-correction-tool/pub/ddk/drivinit.h +++ /dev/null @@ -1,12 +0,0 @@ -//+--------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1992-1999. -// -// File: drivinit.h -// -//---------------------------------------------------------------------------- - -// All items moved to wingdi.h - - diff --git a/qt-correction-tool/pub/ddk/drmk.h b/qt-correction-tool/pub/ddk/drmk.h deleted file mode 100644 index 9c88ef3..0000000 --- a/qt-correction-tool/pub/ddk/drmk.h +++ /dev/null @@ -1,199 +0,0 @@ -#ifndef _DRMK_H_ -#define _DRMK_H_ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -typedef struct tagDRMRIGHTS { - BOOL CopyProtect; - ULONG Reserved; - BOOL DigitalOutputDisable; -} DRMRIGHTS , *PDRMRIGHTS; -typedef const DRMRIGHTS *PCDRMRIGHTS; - -#define DEFINE_DRMRIGHTS_DEFAULT(DrmRights) const DRMRIGHTS DrmRights = {FALSE, 0, FALSE} - - -// {1915C967-3299-48cb-A3E4-69FD1D1B306E} -DEFINE_GUID(IID_IDrmAudioStream, - 0x1915c967, 0x3299, 0x48cb, 0xa3, 0xe4, 0x69, 0xfd, 0x1d, 0x1b, 0x30, 0x6e); - -DECLARE_INTERFACE_(IDrmAudioStream, IUnknown) -{ - // IUnknown methods - STDMETHOD_(NTSTATUS, QueryInterface)(THIS_ - __in REFIID InterfaceId, - __out PVOID* Interface - ) PURE; - - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - - STDMETHOD_(ULONG,Release)(THIS) PURE; - - // IDrmAudioStream methods - STDMETHOD_(NTSTATUS,SetContentId)(THIS_ - __in ULONG ContentId, - __in PCDRMRIGHTS DrmRights - ) PURE; -}; - -typedef IDrmAudioStream *PDRMAUDIOSTREAM; - -#define IMP_IDrmAudioStream\ - STDMETHODIMP_(NTSTATUS) SetContentId\ - ( __in ULONG ContentId,\ - __in PCDRMRIGHTS DrmRights\ - ); - -typedef struct tagDRMFORWARD { - DWORD Flags; - PDEVICE_OBJECT DeviceObject; - PFILE_OBJECT FileObject; - PVOID Context; -} DRMFORWARD, *PDRMFORWARD; -typedef const DRMFORWARD *PCDRMFORWARD; - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -DrmAddContentHandlers( - __in ULONG ContentId, - __in_ecount(NumHandlers) PVOID* paHandlers, - __in ULONG NumHandlers - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMADDCONTENTHANDLERS)( - __in ULONG ContentId, - __in PVOID* paHandlers, - __in ULONG NumHandlers - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -DrmCreateContentMixed( - __in PULONG paContentId, - __in ULONG cContentId, - __out PULONG pMixedContentId - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMCREATECONTENTMIXED)( - __in PULONG paContentId, - __in ULONG cContentId, - __out PULONG pMixedContentId - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -DrmDestroyContent( - __in ULONG ContentId - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMDESTROYCONTENT)( - __in ULONG ContentId - ); - -NTSTATUS -NTAPI -DrmForwardContentToDeviceObject( - __in ULONG ContentId, - __in_opt PVOID Reserved, - __in PCDRMFORWARD DrmForward - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMFORWARDCONTENTTODEVICEOBJECT)( - __in ULONG ContentId, - __in PVOID Reserved, - __in PCDRMFORWARD DrmForward - ); - - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("DrmForwardContentToDeviceObject", "Obsolete") -NTSTATUS -NTAPI -DrmForwardContentToFileObject( - __in ULONG ContentId, - __in PFILE_OBJECT FileObject - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMFORWARDCONTENTTOFILEOBJECT)( - __in ULONG ContentId, - __in PFILE_OBJECT FileObject - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -DrmForwardContentToInterface( - __in ULONG ContentId, - __in PUNKNOWN pUnknown, - __in ULONG NumMethods); - -typedef -NTSTATUS -(NTAPI *PFNDRMFORWARDCONTENTTOINTERFACE)( - __in ULONG ContentId, - __in PUNKNOWN pUnknown, - __in ULONG NumMethods); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -DrmGetContentRights( - __in ULONG ContentId, - __out PDRMRIGHTS DrmRights - ); - -typedef -NTSTATUS -(NTAPI *PFNDRMGETCONTENTRIGHTS)( - __in ULONG ContentId, - __out PDRMRIGHTS DrmRights - ); - - -// -// Structures for use with KSPROPERY_DRMAUDIOSTREAM_CONTENTID -// - -typedef struct { - ULONG ContentId; - DRMRIGHTS DrmRights; -} KSDRMAUDIOSTREAM_CONTENTID, *PKSDRMAUDIOSTREAM_CONTENTID; - -typedef struct { - KSPROPERTY Property; - PVOID Context; - // DRM API callback functions - PFNDRMADDCONTENTHANDLERS DrmAddContentHandlers; - PFNDRMCREATECONTENTMIXED DrmCreateContentMixed; - PFNDRMDESTROYCONTENT DrmDestroyContent; - PFNDRMFORWARDCONTENTTODEVICEOBJECT DrmForwardContentToDeviceObject; - PFNDRMFORWARDCONTENTTOFILEOBJECT DrmForwardContentToFileObject; - PFNDRMFORWARDCONTENTTOINTERFACE DrmForwardContentToInterface; - PFNDRMGETCONTENTRIGHTS DrmGetContentRights; -} KSP_DRMAUDIOSTREAM_CONTENTID, *PKSP_DRMAUDIOSTREAM_CONTENTID; - - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/qt-correction-tool/pub/ddk/dsfhrmports.h b/qt-correction-tool/pub/ddk/dsfhrmports.h deleted file mode 100644 index 8b13789..0000000 --- a/qt-correction-tool/pub/ddk/dsfhrmports.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/qt-correction-tool/pub/ddk/dsfif.h b/qt-correction-tool/pub/ddk/dsfif.h deleted file mode 100644 index 3805e0f..0000000 --- a/qt-correction-tool/pub/ddk/dsfif.h +++ /dev/null @@ -1,5513 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for dsfif.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __dsfif_h__ -#define __dsfif_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDSFResourceList_FWD_DEFINED__ -#define __IDSFResourceList_FWD_DEFINED__ -typedef interface IDSFResourceList IDSFResourceList; -#endif /* __IDSFResourceList_FWD_DEFINED__ */ - - -#ifndef __IDSFFullResourceDescriptor_FWD_DEFINED__ -#define __IDSFFullResourceDescriptor_FWD_DEFINED__ -typedef interface IDSFFullResourceDescriptor IDSFFullResourceDescriptor; -#endif /* __IDSFFullResourceDescriptor_FWD_DEFINED__ */ - - -#ifndef __IDSFDevice_FWD_DEFINED__ -#define __IDSFDevice_FWD_DEFINED__ -typedef interface IDSFDevice IDSFDevice; -#endif /* __IDSFDevice_FWD_DEFINED__ */ - - -#ifndef __IDSFDeviceCaps_FWD_DEFINED__ -#define __IDSFDeviceCaps_FWD_DEFINED__ -typedef interface IDSFDeviceCaps IDSFDeviceCaps; -#endif /* __IDSFDeviceCaps_FWD_DEFINED__ */ - - -#ifndef __IDSFDeviceEvents_FWD_DEFINED__ -#define __IDSFDeviceEvents_FWD_DEFINED__ -typedef interface IDSFDeviceEvents IDSFDeviceEvents; -#endif /* __IDSFDeviceEvents_FWD_DEFINED__ */ - - -#ifndef __IDSF_FWD_DEFINED__ -#define __IDSF_FWD_DEFINED__ -typedef interface IDSF IDSF; -#endif /* __IDSF_FWD_DEFINED__ */ - - -#ifndef __IDSFDevices_FWD_DEFINED__ -#define __IDSFDevices_FWD_DEFINED__ -typedef interface IDSFDevices IDSFDevices; -#endif /* __IDSFDevices_FWD_DEFINED__ */ - - -#ifndef __IDSFLog_FWD_DEFINED__ -#define __IDSFLog_FWD_DEFINED__ -typedef interface IDSFLog IDSFLog; -#endif /* __IDSFLog_FWD_DEFINED__ */ - - -#ifndef __IDSFVersion_FWD_DEFINED__ -#define __IDSFVersion_FWD_DEFINED__ -typedef interface IDSFVersion IDSFVersion; -#endif /* __IDSFVersion_FWD_DEFINED__ */ - - -#ifndef __IDSFPropertyBag_FWD_DEFINED__ -#define __IDSFPropertyBag_FWD_DEFINED__ -typedef interface IDSFPropertyBag IDSFPropertyBag; -#endif /* __IDSFPropertyBag_FWD_DEFINED__ */ - - -#ifndef __IDSFBus_FWD_DEFINED__ -#define __IDSFBus_FWD_DEFINED__ -typedef interface IDSFBus IDSFBus; -#endif /* __IDSFBus_FWD_DEFINED__ */ - - -#ifndef __IDSFPartialResourceDescriptor_FWD_DEFINED__ -#define __IDSFPartialResourceDescriptor_FWD_DEFINED__ -typedef interface IDSFPartialResourceDescriptor IDSFPartialResourceDescriptor; -#endif /* __IDSFPartialResourceDescriptor_FWD_DEFINED__ */ - - -#ifndef __DSFPartialResourceDescriptor_FWD_DEFINED__ -#define __DSFPartialResourceDescriptor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFPartialResourceDescriptor DSFPartialResourceDescriptor; -#else -typedef struct DSFPartialResourceDescriptor DSFPartialResourceDescriptor; -#endif /* __cplusplus */ - -#endif /* __DSFPartialResourceDescriptor_FWD_DEFINED__ */ - - -#ifndef __IDSFPartialResourceList_FWD_DEFINED__ -#define __IDSFPartialResourceList_FWD_DEFINED__ -typedef interface IDSFPartialResourceList IDSFPartialResourceList; -#endif /* __IDSFPartialResourceList_FWD_DEFINED__ */ - - -#ifndef __DSFPartialResourceList_FWD_DEFINED__ -#define __DSFPartialResourceList_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFPartialResourceList DSFPartialResourceList; -#else -typedef struct DSFPartialResourceList DSFPartialResourceList; -#endif /* __cplusplus */ - -#endif /* __DSFPartialResourceList_FWD_DEFINED__ */ - - -#ifndef __DSFFullResourceDescriptor_FWD_DEFINED__ -#define __DSFFullResourceDescriptor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFFullResourceDescriptor DSFFullResourceDescriptor; -#else -typedef struct DSFFullResourceDescriptor DSFFullResourceDescriptor; -#endif /* __cplusplus */ - -#endif /* __DSFFullResourceDescriptor_FWD_DEFINED__ */ - - -#ifndef __DSFResourceList_FWD_DEFINED__ -#define __DSFResourceList_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResourceList DSFResourceList; -#else -typedef struct DSFResourceList DSFResourceList; -#endif /* __cplusplus */ - -#endif /* __DSFResourceList_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescPort_FWD_DEFINED__ -#define __IDSFResDescPort_FWD_DEFINED__ -typedef interface IDSFResDescPort IDSFResDescPort; -#endif /* __IDSFResDescPort_FWD_DEFINED__ */ - - -#ifndef __DSFResDescPort_FWD_DEFINED__ -#define __DSFResDescPort_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescPort DSFResDescPort; -#else -typedef struct DSFResDescPort DSFResDescPort; -#endif /* __cplusplus */ - -#endif /* __DSFResDescPort_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescDevSpecific_FWD_DEFINED__ -#define __IDSFResDescDevSpecific_FWD_DEFINED__ -typedef interface IDSFResDescDevSpecific IDSFResDescDevSpecific; -#endif /* __IDSFResDescDevSpecific_FWD_DEFINED__ */ - - -#ifndef __DSFResDescDevSpecific_FWD_DEFINED__ -#define __DSFResDescDevSpecific_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescDevSpecific DSFResDescDevSpecific; -#else -typedef struct DSFResDescDevSpecific DSFResDescDevSpecific; -#endif /* __cplusplus */ - -#endif /* __DSFResDescDevSpecific_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescDevPrivate_FWD_DEFINED__ -#define __IDSFResDescDevPrivate_FWD_DEFINED__ -typedef interface IDSFResDescDevPrivate IDSFResDescDevPrivate; -#endif /* __IDSFResDescDevPrivate_FWD_DEFINED__ */ - - -#ifndef __DSFResDescDevPrivate_FWD_DEFINED__ -#define __DSFResDescDevPrivate_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescDevPrivate DSFResDescDevPrivate; -#else -typedef struct DSFResDescDevPrivate DSFResDescDevPrivate; -#endif /* __cplusplus */ - -#endif /* __DSFResDescDevPrivate_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescInterrupt_FWD_DEFINED__ -#define __IDSFResDescInterrupt_FWD_DEFINED__ -typedef interface IDSFResDescInterrupt IDSFResDescInterrupt; -#endif /* __IDSFResDescInterrupt_FWD_DEFINED__ */ - - -#ifndef __DSFResDescInterrupt_FWD_DEFINED__ -#define __DSFResDescInterrupt_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescInterrupt DSFResDescInterrupt; -#else -typedef struct DSFResDescInterrupt DSFResDescInterrupt; -#endif /* __cplusplus */ - -#endif /* __DSFResDescInterrupt_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescMemory_FWD_DEFINED__ -#define __IDSFResDescMemory_FWD_DEFINED__ -typedef interface IDSFResDescMemory IDSFResDescMemory; -#endif /* __IDSFResDescMemory_FWD_DEFINED__ */ - - -#ifndef __DSFResDescMemory_FWD_DEFINED__ -#define __DSFResDescMemory_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescMemory DSFResDescMemory; -#else -typedef struct DSFResDescMemory DSFResDescMemory; -#endif /* __cplusplus */ - -#endif /* __DSFResDescMemory_FWD_DEFINED__ */ - - -#ifndef __IDSFResDescDMA_FWD_DEFINED__ -#define __IDSFResDescDMA_FWD_DEFINED__ -typedef interface IDSFResDescDMA IDSFResDescDMA; -#endif /* __IDSFResDescDMA_FWD_DEFINED__ */ - - -#ifndef __DSFResDescDMA_FWD_DEFINED__ -#define __DSFResDescDMA_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFResDescDMA DSFResDescDMA; -#else -typedef struct DSFResDescDMA DSFResDescDMA; -#endif /* __cplusplus */ - -#endif /* __DSFResDescDMA_FWD_DEFINED__ */ - - -#ifndef __IDSFSystemDevice_FWD_DEFINED__ -#define __IDSFSystemDevice_FWD_DEFINED__ -typedef interface IDSFSystemDevice IDSFSystemDevice; -#endif /* __IDSFSystemDevice_FWD_DEFINED__ */ - - -#ifndef __DSFSystemDevice_FWD_DEFINED__ -#define __DSFSystemDevice_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFSystemDevice DSFSystemDevice; -#else -typedef struct DSFSystemDevice DSFSystemDevice; -#endif /* __cplusplus */ - -#endif /* __DSFSystemDevice_FWD_DEFINED__ */ - - -#ifndef __DSFDevice_FWD_DEFINED__ -#define __DSFDevice_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFDevice DSFDevice; -#else -typedef struct DSFDevice DSFDevice; -#endif /* __cplusplus */ - -#endif /* __DSFDevice_FWD_DEFINED__ */ - - -#ifndef __DSF_FWD_DEFINED__ -#define __DSF_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSF DSF; -#else -typedef struct DSF DSF; -#endif /* __cplusplus */ - -#endif /* __DSF_FWD_DEFINED__ */ - - -#ifndef __DSFDevices_FWD_DEFINED__ -#define __DSFDevices_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFDevices DSFDevices; -#else -typedef struct DSFDevices DSFDevices; -#endif /* __cplusplus */ - -#endif /* __DSFDevices_FWD_DEFINED__ */ - - -#ifndef __DSFDeviceCaps_FWD_DEFINED__ -#define __DSFDeviceCaps_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFDeviceCaps DSFDeviceCaps; -#else -typedef struct DSFDeviceCaps DSFDeviceCaps; -#endif /* __cplusplus */ - -#endif /* __DSFDeviceCaps_FWD_DEFINED__ */ - - -#ifndef __DSFLog_FWD_DEFINED__ -#define __DSFLog_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFLog DSFLog; -#else -typedef struct DSFLog DSFLog; -#endif /* __cplusplus */ - -#endif /* __DSFLog_FWD_DEFINED__ */ - - -#ifndef __DSFVersion_FWD_DEFINED__ -#define __DSFVersion_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFVersion DSFVersion; -#else -typedef struct DSFVersion DSFVersion; -#endif /* __cplusplus */ - -#endif /* __DSFVersion_FWD_DEFINED__ */ - - -#ifndef __DSFPropertyBag_FWD_DEFINED__ -#define __DSFPropertyBag_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFPropertyBag DSFPropertyBag; -#else -typedef struct DSFPropertyBag DSFPropertyBag; -#endif /* __cplusplus */ - -#endif /* __DSFPropertyBag_FWD_DEFINED__ */ - - -#ifndef __IDSFDebug_FWD_DEFINED__ -#define __IDSFDebug_FWD_DEFINED__ -typedef interface IDSFDebug IDSFDebug; -#endif /* __IDSFDebug_FWD_DEFINED__ */ - - -#ifndef __DSFDebug_FWD_DEFINED__ -#define __DSFDebug_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFDebug DSFDebug; -#else -typedef struct DSFDebug DSFDebug; -#endif /* __cplusplus */ - -#endif /* __DSFDebug_FWD_DEFINED__ */ - - -#ifndef __DSFBus_FWD_DEFINED__ -#define __DSFBus_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DSFBus DSFBus; -#else -typedef struct DSFBus DSFBus; -#endif /* __cplusplus */ - -#endif /* __DSFBus_FWD_DEFINED__ */ - - -#ifndef __IDSFPersist_FWD_DEFINED__ -#define __IDSFPersist_FWD_DEFINED__ -typedef interface IDSFPersist IDSFPersist; -#endif /* __IDSFPersist_FWD_DEFINED__ */ - - -#ifdef __cplusplus -extern "C"{ -#endif - - - -#ifndef __DSF_LIBRARY_DEFINED__ -#define __DSF_LIBRARY_DEFINED__ - -/* library DSF */ -/* [helpstringcontext][helpcontext][helpstring][helpstringdll][helpfile][version][lcid][uuid] */ - - - - - - - - - - - - - - - - - - - - - - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("993417C7-E892-4F80-9295-1321623DD50D") -enum DSFSystemPowerState - { DSFPowerSystemUnspecified = 0, - DSFPowerSystemWorking = 1, - DSFPowerSystemSleeping1 = 2, - DSFPowerSystemSleeping2 = 3, - DSFPowerSystemSleeping3 = 4, - DSFPowerSystemHibernate = 5, - DSFPowerSystemShutdown = 6 - } DSFSystemPowerState; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("7B8AD659-B4EF-48C4-A189-9637BD56F086") -enum DSFDevicePowerState - { DSFPowerDeviceUnspecified = 0, - DSFPowerDeviceD0 = 1, - DSFPowerDeviceD1 = 2, - DSFPowerDeviceD2 = 3, - DSFPowerDeviceD3 = 4 - } DSFDevicePowerState; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("C936205A-C69B-45E4-8D19-6BE3CAC15E11") -enum DSFBitOp - { DSFBitOff = 0, - DSFBitOn = 1, - DSFBitToggle = 2 - } DSFBitOp; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("52CAB7A6-B8AC-474D-AB38-05A4AAF21FE7") -enum DSFOpMode - { DSFCapture = 0, - DSFSimulate = 1, - DSFCaptureAndSimulate = 2 - } DSFOpMode; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("7D4BA3AD-960C-4A3B-A6CC-3677AD9E0EDE") -enum DSFResourceType - { DSFResourceTypeNull = 0, - DSFResourceTypePort = 1, - DSFResourceTypeInterrupt = 2, - DSFResourceTypeMemory = 3, - DSFResourceTypeDma = 4, - DSFResourceTypeDeviceSpecific = 5, - DSFResourceTypeBusNumber = 6, - DSFResourceTypeNonArbitrated = 128, - DSFResourceTypeConfigData = 128, - DSFResourceTypeDevicePrivate = 129, - DSFResourceTypePcCardConfig = 130, - DSFResourceTypeMfCardConfig = 131, - DSFResourceTypeConfigurationSpace = 132, - DSFResourceTypeAcpi = 133, - DSFResourceTypePci = 134 - } DSFResourceType; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("D503F600-4EDD-4B7C-A676-0B50BDAED69E") -enum DSFShareDisposition - { DSFShareDispositionUndetermined = 0, - DSFShareDispositionDeviceExclusive = 1, - DSFShareDispositionDriverExclusive = 2, - DSFShareDispositionShared = 3 - } DSFShareDisposition; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("6FA31433-AA14-4EF7-8FBA-A91F326BA32B") -enum DSFInterfaceType - { DSFInterfaceTypeUndefined = -1, - DSFInterfaceTypeInternal = 0, - DSFInterfaceTypeIsa = 1, - DSFInterfaceTypeEisa = 2, - DSFInterfaceTypeMicroChannel = 3, - DSFInterfaceTypeTurboChannel = 4, - DSFInterfaceTypePCIBus = 5, - DSFInterfaceTypeVMEBus = 6, - DSFInterfaceTypeNuBus = 7, - DSFInterfaceTypePCMCIABus = 8, - DSFInterfaceTypeCBus = 9, - DSFInterfaceTypeMPIBus = 10, - DSFInterfaceTypeMPSABus = 11, - DSFInterfaceTypeProcessorInternal = 12, - DSFInterfaceTypeInternalPowerBus = 13, - DSFInterfaceTypePNPISABus = 14, - DSFInterfaceTypePNPBus = 15 - } DSFInterfaceType; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("78201517-0b6c-4208-b003-2f396640e5bc") -enum DSFStateType - { DSFDefaultStateType = 0 - } DSFStateType; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("86b50daf-5bb2-43f3-a9ca-e5bf444d9523") -enum DSFFlagType - { DSFDebugFlags = 0, - DSFLogFlags = 1, - DSFStdOutFlags = 2 - } DSFFlagType; - -#define DSFVersionMajor ( 1 ) - -#define DSFVersionMinor ( 0 ) - - -EXTERN_C const IID LIBID_DSF; - -#ifndef __IDSFResourceList_INTERFACE_DEFINED__ -#define __IDSFResourceList_INTERFACE_DEFINED__ - -/* interface IDSFResourceList */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResourceList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("418E0FF4-25F9-459A-B92B-6B3294E7135C") - IDSFResourceList : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFFullResourceDescriptor **ppDSFFullResourceDescriptor) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in DSFFullResourceDescriptor *pDSFFullResourceDescriptor, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResourceListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResourceList * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResourceList * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResourceList * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResourceList * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResourceList * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResourceList * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResourceList * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in IDSFResourceList * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in IDSFResourceList * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFFullResourceDescriptor **ppDSFFullResourceDescriptor); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in IDSFResourceList * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in IDSFResourceList * This, - /* [in] */ __RPC__in DSFFullResourceDescriptor *pDSFFullResourceDescriptor, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in IDSFResourceList * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in IDSFResourceList * This); - - END_INTERFACE - } IDSFResourceListVtbl; - - interface IDSFResourceList - { - CONST_VTBL struct IDSFResourceListVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResourceList_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResourceList_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResourceList_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResourceList_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResourceList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResourceList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResourceList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResourceList_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define IDSFResourceList_get_Item(This,Index,ppDSFFullResourceDescriptor) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppDSFFullResourceDescriptor) ) - -#define IDSFResourceList_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define IDSFResourceList_Add(This,pDSFFullResourceDescriptor,Index) \ - ( (This)->lpVtbl -> Add(This,pDSFFullResourceDescriptor,Index) ) - -#define IDSFResourceList_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define IDSFResourceList_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResourceList_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFFullResourceDescriptor_INTERFACE_DEFINED__ -#define __IDSFFullResourceDescriptor_INTERFACE_DEFINED__ - -/* interface IDSFFullResourceDescriptor */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFFullResourceDescriptor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E466F6A1-269F-4E18-94E6-7D2F02779417") - IDSFFullResourceDescriptor : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InterfaceType( - /* [retval][out] */ __RPC__out DSFInterfaceType *pType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InterfaceType( - /* [in] */ DSFInterfaceType Type) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_BusNumber( - /* [retval][out] */ __RPC__out long *plBusNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_BusNumber( - /* [in] */ long lBusNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PartialResourceList( - /* [retval][out] */ __RPC__deref_out_opt DSFPartialResourceList **ppDSFPartialResourceList) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFFullResourceDescriptorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFFullResourceDescriptor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFFullResourceDescriptor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFFullResourceDescriptor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InterfaceType )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [retval][out] */ __RPC__out DSFInterfaceType *pType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InterfaceType )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [in] */ DSFInterfaceType Type); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_BusNumber )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [retval][out] */ __RPC__out long *plBusNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_BusNumber )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [in] */ long lBusNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PartialResourceList )( - __RPC__in IDSFFullResourceDescriptor * This, - /* [retval][out] */ __RPC__deref_out_opt DSFPartialResourceList **ppDSFPartialResourceList); - - END_INTERFACE - } IDSFFullResourceDescriptorVtbl; - - interface IDSFFullResourceDescriptor - { - CONST_VTBL struct IDSFFullResourceDescriptorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFFullResourceDescriptor_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFFullResourceDescriptor_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFFullResourceDescriptor_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFFullResourceDescriptor_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFFullResourceDescriptor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFFullResourceDescriptor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFFullResourceDescriptor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFFullResourceDescriptor_get_InterfaceType(This,pType) \ - ( (This)->lpVtbl -> get_InterfaceType(This,pType) ) - -#define IDSFFullResourceDescriptor_put_InterfaceType(This,Type) \ - ( (This)->lpVtbl -> put_InterfaceType(This,Type) ) - -#define IDSFFullResourceDescriptor_get_BusNumber(This,plBusNumber) \ - ( (This)->lpVtbl -> get_BusNumber(This,plBusNumber) ) - -#define IDSFFullResourceDescriptor_put_BusNumber(This,lBusNumber) \ - ( (This)->lpVtbl -> put_BusNumber(This,lBusNumber) ) - -#define IDSFFullResourceDescriptor_get_PartialResourceList(This,ppDSFPartialResourceList) \ - ( (This)->lpVtbl -> get_PartialResourceList(This,ppDSFPartialResourceList) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFFullResourceDescriptor_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFDevice_INTERFACE_DEFINED__ -#define __IDSFDevice_INTERFACE_DEFINED__ - -/* interface IDSFDevice */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFDevice; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E3B2A057-2A23-4ABE-8188-9FB655131823") - IDSFDevice : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Children( - /* [retval][out] */ __RPC__deref_out_opt DSFDevices **ppDSFDevices) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Enabled( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Enabled( - /* [in] */ VARIANT_BOOL fvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Guid( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGuid) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Guid( - /* [in] */ __RPC__in BSTR bstrGuid) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall HasObject( - /* [in] */ __RPC__in BSTR CLSID, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pvBool) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Hrm( - /* [in] */ DSFResourceType ResType, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkHrm) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Inserted( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarInserted) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Inserted( - /* [in] */ VARIANT_BOOL fvarInserted) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Name( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Name( - /* [in] */ __RPC__in BSTR bstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Next( - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Next( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_Next( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Object( - /* [in] */ __RPC__in BSTR GUID, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkObject) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Object( - /* [in] */ __RPC__in BSTR GUID, - /* [in] */ __RPC__in_opt IUnknown *punkObject) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_Object( - /* [in] */ __RPC__in BSTR GUID, - /* [in] */ __RPC__in_opt IUnknown *punkObject) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OpMode( - /* [retval][out] */ __RPC__out DSFOpMode *pMode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OpMode( - /* [in] */ DSFOpMode Mode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Parent( - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Parent( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_Parent( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Persistent( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPersistent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Persistent( - /* [in] */ VARIANT_BOOL fvarPersistent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_State( - /* [retval][out] */ __RPC__out long *plState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SystemDevice( - /* [retval][out] */ __RPC__deref_out_opt IDSFSystemDevice **ppSystemDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall SetStateBit( - /* [in] */ long Bit, - /* [in] */ DSFBitOp BitOp) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall StartFaultInjection( - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Params, - /* [retval][out] */ __RPC__out VARIANT *pvarContext) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall StopFaultInjection( - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Context) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFDeviceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFDevice * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFDevice * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFDevice * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFDevice * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFDevice * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Children )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFDevices **ppDSFDevices); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Enabled )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Enabled )( - __RPC__in IDSFDevice * This, - /* [in] */ VARIANT_BOOL fvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Guid )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGuid); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Guid )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR bstrGuid); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *HasObject )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR CLSID, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pvBool); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Hrm )( - __RPC__in IDSFDevice * This, - /* [in] */ DSFResourceType ResType, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkHrm); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Inserted )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarInserted); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Inserted )( - __RPC__in IDSFDevice * This, - /* [in] */ VARIANT_BOOL fvarInserted); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Name )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Name )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR bstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Next )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Next )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_Next )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Object )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR GUID, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkObject); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Object )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR GUID, - /* [in] */ __RPC__in_opt IUnknown *punkObject); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_Object )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in BSTR GUID, - /* [in] */ __RPC__in_opt IUnknown *punkObject); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OpMode )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__out DSFOpMode *pMode); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OpMode )( - __RPC__in IDSFDevice * This, - /* [in] */ DSFOpMode Mode); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Parent )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Parent )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_Parent )( - __RPC__in IDSFDevice * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Persistent )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPersistent); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Persistent )( - __RPC__in IDSFDevice * This, - /* [in] */ VARIANT_BOOL fvarPersistent); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_State )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__out long *plState); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SystemDevice )( - __RPC__in IDSFDevice * This, - /* [retval][out] */ __RPC__deref_out_opt IDSFSystemDevice **ppSystemDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *SetStateBit )( - __RPC__in IDSFDevice * This, - /* [in] */ long Bit, - /* [in] */ DSFBitOp BitOp); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *StartFaultInjection )( - __RPC__in IDSFDevice * This, - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Params, - /* [retval][out] */ __RPC__out VARIANT *pvarContext); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *StopFaultInjection )( - __RPC__in IDSFDevice * This, - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Context); - - END_INTERFACE - } IDSFDeviceVtbl; - - interface IDSFDevice - { - CONST_VTBL struct IDSFDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFDevice_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFDevice_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFDevice_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFDevice_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFDevice_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFDevice_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFDevice_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFDevice_get_Children(This,ppDSFDevices) \ - ( (This)->lpVtbl -> get_Children(This,ppDSFDevices) ) - -#define IDSFDevice_get_Enabled(This,pfvarEnabled) \ - ( (This)->lpVtbl -> get_Enabled(This,pfvarEnabled) ) - -#define IDSFDevice_put_Enabled(This,fvarEnabled) \ - ( (This)->lpVtbl -> put_Enabled(This,fvarEnabled) ) - -#define IDSFDevice_get_Guid(This,pbstrGuid) \ - ( (This)->lpVtbl -> get_Guid(This,pbstrGuid) ) - -#define IDSFDevice_put_Guid(This,bstrGuid) \ - ( (This)->lpVtbl -> put_Guid(This,bstrGuid) ) - -#define IDSFDevice_HasObject(This,CLSID,pvBool) \ - ( (This)->lpVtbl -> HasObject(This,CLSID,pvBool) ) - -#define IDSFDevice_get_Hrm(This,ResType,ppunkHrm) \ - ( (This)->lpVtbl -> get_Hrm(This,ResType,ppunkHrm) ) - -#define IDSFDevice_get_Inserted(This,pfvarInserted) \ - ( (This)->lpVtbl -> get_Inserted(This,pfvarInserted) ) - -#define IDSFDevice_put_Inserted(This,fvarInserted) \ - ( (This)->lpVtbl -> put_Inserted(This,fvarInserted) ) - -#define IDSFDevice_get_Name(This,pbstrName) \ - ( (This)->lpVtbl -> get_Name(This,pbstrName) ) - -#define IDSFDevice_put_Name(This,bstrName) \ - ( (This)->lpVtbl -> put_Name(This,bstrName) ) - -#define IDSFDevice_get_Next(This,ppDSFDevice) \ - ( (This)->lpVtbl -> get_Next(This,ppDSFDevice) ) - -#define IDSFDevice_put_Next(This,pDSFDevice) \ - ( (This)->lpVtbl -> put_Next(This,pDSFDevice) ) - -#define IDSFDevice_putref_Next(This,pDSFDevice) \ - ( (This)->lpVtbl -> putref_Next(This,pDSFDevice) ) - -#define IDSFDevice_get_Object(This,GUID,ppunkObject) \ - ( (This)->lpVtbl -> get_Object(This,GUID,ppunkObject) ) - -#define IDSFDevice_put_Object(This,GUID,punkObject) \ - ( (This)->lpVtbl -> put_Object(This,GUID,punkObject) ) - -#define IDSFDevice_putref_Object(This,GUID,punkObject) \ - ( (This)->lpVtbl -> putref_Object(This,GUID,punkObject) ) - -#define IDSFDevice_get_OpMode(This,pMode) \ - ( (This)->lpVtbl -> get_OpMode(This,pMode) ) - -#define IDSFDevice_put_OpMode(This,Mode) \ - ( (This)->lpVtbl -> put_OpMode(This,Mode) ) - -#define IDSFDevice_get_Parent(This,ppDSFDevice) \ - ( (This)->lpVtbl -> get_Parent(This,ppDSFDevice) ) - -#define IDSFDevice_put_Parent(This,pDSFDevice) \ - ( (This)->lpVtbl -> put_Parent(This,pDSFDevice) ) - -#define IDSFDevice_putref_Parent(This,pDSFDevice) \ - ( (This)->lpVtbl -> putref_Parent(This,pDSFDevice) ) - -#define IDSFDevice_get_Persistent(This,pfvarPersistent) \ - ( (This)->lpVtbl -> get_Persistent(This,pfvarPersistent) ) - -#define IDSFDevice_put_Persistent(This,fvarPersistent) \ - ( (This)->lpVtbl -> put_Persistent(This,fvarPersistent) ) - -#define IDSFDevice_get_State(This,plState) \ - ( (This)->lpVtbl -> get_State(This,plState) ) - -#define IDSFDevice_get_SystemDevice(This,ppSystemDevice) \ - ( (This)->lpVtbl -> get_SystemDevice(This,ppSystemDevice) ) - -#define IDSFDevice_SetStateBit(This,Bit,BitOp) \ - ( (This)->lpVtbl -> SetStateBit(This,Bit,BitOp) ) - -#define IDSFDevice_StartFaultInjection(This,ResType,Params,pvarContext) \ - ( (This)->lpVtbl -> StartFaultInjection(This,ResType,Params,pvarContext) ) - -#define IDSFDevice_StopFaultInjection(This,ResType,Context) \ - ( (This)->lpVtbl -> StopFaultInjection(This,ResType,Context) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFDevice_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFDeviceCaps_INTERFACE_DEFINED__ -#define __IDSFDeviceCaps_INTERFACE_DEFINED__ - -/* interface IDSFDeviceCaps */ -/* [object][helpstringcontext][helpcontext][helpstring][nonextensible][uuid] */ - - -EXTERN_C const IID IID_IDSFDeviceCaps; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("766705D3-5109-460D-80B5-30D97B17D867") - IDSFDeviceCaps : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Version( - /* [retval][out] */ __RPC__out short *psVersion) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Version( - /* [in] */ short sVersion) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceD1( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDeviceD1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceD1( - /* [in] */ VARIANT_BOOL fvarDeviceD1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceD2( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDeviceD2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceD2( - /* [in] */ VARIANT_BOOL fvarDeviceD2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LockSupported( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarLockSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LockSupported( - /* [in] */ VARIANT_BOOL fvarLockSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_EjectSupported( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEjectSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_EjectSupported( - /* [in] */ VARIANT_BOOL fvarEjectSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Removable( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRemovable) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Removable( - /* [in] */ VARIANT_BOOL fvarRemovable) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DockDevice( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDockDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DockDevice( - /* [in] */ VARIANT_BOOL fvarDockDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_UniqueID( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarUniqueID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_UniqueID( - /* [in] */ VARIANT_BOOL fvarUniqueID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SilentInstall( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSilentInstall) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_SilentInstall( - /* [in] */ VARIANT_BOOL fvarSilentInstall) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_RawDeviceOK( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRawDeviceOK) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_RawDeviceOK( - /* [in] */ VARIANT_BOOL fvarRawDeviceOK) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SurpriseRemovalOK( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSurpriseRemovalOK) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_SurpriseRemovalOK( - /* [in] */ VARIANT_BOOL fvarSurpriseRemovalOK) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeFromD0( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_WakeFromD0( - /* [in] */ VARIANT_BOOL fvarWakeFromD0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeFromD1( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_WakeFromD1( - /* [in] */ VARIANT_BOOL fvarWakeFromD1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeFromD2( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_WakeFromD2( - /* [in] */ VARIANT_BOOL fvarWakeFromD2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeFromD3( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD3) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_WakeFromD3( - /* [in] */ VARIANT_BOOL fvarWakeFromD3) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HardwareDisabled( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarHardwareDisabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HardwareDisabled( - /* [in] */ VARIANT_BOOL fvarHardwareDisabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NonDynamic( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarNonDynamic) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_NonDynamic( - /* [in] */ VARIANT_BOOL fvarNonDynamic) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WarmEjectSupported( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWarmEjectSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_WarmEjectSupported( - /* [in] */ VARIANT_BOOL fvarWarmEjectSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NoDisplayInUI( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarNoDisplayInUI) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_NoDisplayInUI( - /* [in] */ VARIANT_BOOL fvarNoDisplayInUI) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reserved( - /* [retval][out] */ __RPC__out short *psReserved) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Reserved( - /* [in] */ short sReserved) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Address( - /* [retval][out] */ __RPC__out long *plAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Address( - /* [in] */ long lAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_UINumber( - /* [retval][out] */ __RPC__out long *plUINumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_UINumber( - /* [in] */ long lUINumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceState( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDeviceState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceState( - /* [in] */ __RPC__in SAFEARRAY * psaDeviceState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SystemWake( - /* [retval][out] */ __RPC__out DSFSystemPowerState *pPowerState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_SystemWake( - /* [in] */ DSFSystemPowerState PowerState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceWake( - /* [retval][out] */ __RPC__out DSFDevicePowerState *pPowerState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceWake( - /* [in] */ DSFDevicePowerState PowerState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_D1Latency( - /* [retval][out] */ __RPC__out long *plD1Latency) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_D1Latency( - /* [in] */ long lD1Latency) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_D2Latency( - /* [retval][out] */ __RPC__out long *plD2Latency) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_D2Latency( - /* [in] */ long lD2Latency) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_D3Latency( - /* [retval][out] */ __RPC__out long *plD3Latency) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_D3Latency( - /* [in] */ long lD3Latency) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFDeviceCapsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFDeviceCaps * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFDeviceCaps * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFDeviceCaps * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFDeviceCaps * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Version )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out short *psVersion); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Version )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ short sVersion); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceD1 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDeviceD1); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceD1 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarDeviceD1); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceD2 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDeviceD2); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceD2 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarDeviceD2); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LockSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarLockSupported); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LockSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarLockSupported); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_EjectSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEjectSupported); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_EjectSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarEjectSupported); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Removable )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRemovable); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Removable )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarRemovable); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DockDevice )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarDockDevice); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DockDevice )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarDockDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_UniqueID )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarUniqueID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_UniqueID )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarUniqueID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SilentInstall )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSilentInstall); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_SilentInstall )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarSilentInstall); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_RawDeviceOK )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRawDeviceOK); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_RawDeviceOK )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarRawDeviceOK); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SurpriseRemovalOK )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSurpriseRemovalOK); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_SurpriseRemovalOK )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarSurpriseRemovalOK); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeFromD0 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD0); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_WakeFromD0 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarWakeFromD0); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeFromD1 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD1); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_WakeFromD1 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarWakeFromD1); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeFromD2 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD2); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_WakeFromD2 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarWakeFromD2); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeFromD3 )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWakeFromD3); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_WakeFromD3 )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarWakeFromD3); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HardwareDisabled )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarHardwareDisabled); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HardwareDisabled )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarHardwareDisabled); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NonDynamic )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarNonDynamic); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_NonDynamic )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarNonDynamic); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WarmEjectSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWarmEjectSupported); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_WarmEjectSupported )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarWarmEjectSupported); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NoDisplayInUI )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarNoDisplayInUI); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_NoDisplayInUI )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ VARIANT_BOOL fvarNoDisplayInUI); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reserved )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out short *psReserved); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Reserved )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ short sReserved); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Address )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out long *plAddress); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Address )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ long lAddress); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_UINumber )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out long *plUINumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_UINumber )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ long lUINumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceState )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDeviceState); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceState )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ __RPC__in SAFEARRAY * psaDeviceState); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SystemWake )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out DSFSystemPowerState *pPowerState); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_SystemWake )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ DSFSystemPowerState PowerState); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceWake )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out DSFDevicePowerState *pPowerState); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceWake )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ DSFDevicePowerState PowerState); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_D1Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out long *plD1Latency); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_D1Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ long lD1Latency); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_D2Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out long *plD2Latency); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_D2Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ long lD2Latency); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_D3Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [retval][out] */ __RPC__out long *plD3Latency); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_D3Latency )( - __RPC__in IDSFDeviceCaps * This, - /* [in] */ long lD3Latency); - - END_INTERFACE - } IDSFDeviceCapsVtbl; - - interface IDSFDeviceCaps - { - CONST_VTBL struct IDSFDeviceCapsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFDeviceCaps_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFDeviceCaps_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFDeviceCaps_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFDeviceCaps_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFDeviceCaps_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFDeviceCaps_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFDeviceCaps_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFDeviceCaps_get_Version(This,psVersion) \ - ( (This)->lpVtbl -> get_Version(This,psVersion) ) - -#define IDSFDeviceCaps_put_Version(This,sVersion) \ - ( (This)->lpVtbl -> put_Version(This,sVersion) ) - -#define IDSFDeviceCaps_get_DeviceD1(This,pfvarDeviceD1) \ - ( (This)->lpVtbl -> get_DeviceD1(This,pfvarDeviceD1) ) - -#define IDSFDeviceCaps_put_DeviceD1(This,fvarDeviceD1) \ - ( (This)->lpVtbl -> put_DeviceD1(This,fvarDeviceD1) ) - -#define IDSFDeviceCaps_get_DeviceD2(This,pfvarDeviceD2) \ - ( (This)->lpVtbl -> get_DeviceD2(This,pfvarDeviceD2) ) - -#define IDSFDeviceCaps_put_DeviceD2(This,fvarDeviceD2) \ - ( (This)->lpVtbl -> put_DeviceD2(This,fvarDeviceD2) ) - -#define IDSFDeviceCaps_get_LockSupported(This,pfvarLockSupported) \ - ( (This)->lpVtbl -> get_LockSupported(This,pfvarLockSupported) ) - -#define IDSFDeviceCaps_put_LockSupported(This,fvarLockSupported) \ - ( (This)->lpVtbl -> put_LockSupported(This,fvarLockSupported) ) - -#define IDSFDeviceCaps_get_EjectSupported(This,pfvarEjectSupported) \ - ( (This)->lpVtbl -> get_EjectSupported(This,pfvarEjectSupported) ) - -#define IDSFDeviceCaps_put_EjectSupported(This,fvarEjectSupported) \ - ( (This)->lpVtbl -> put_EjectSupported(This,fvarEjectSupported) ) - -#define IDSFDeviceCaps_get_Removable(This,pfvarRemovable) \ - ( (This)->lpVtbl -> get_Removable(This,pfvarRemovable) ) - -#define IDSFDeviceCaps_put_Removable(This,fvarRemovable) \ - ( (This)->lpVtbl -> put_Removable(This,fvarRemovable) ) - -#define IDSFDeviceCaps_get_DockDevice(This,pfvarDockDevice) \ - ( (This)->lpVtbl -> get_DockDevice(This,pfvarDockDevice) ) - -#define IDSFDeviceCaps_put_DockDevice(This,fvarDockDevice) \ - ( (This)->lpVtbl -> put_DockDevice(This,fvarDockDevice) ) - -#define IDSFDeviceCaps_get_UniqueID(This,pfvarUniqueID) \ - ( (This)->lpVtbl -> get_UniqueID(This,pfvarUniqueID) ) - -#define IDSFDeviceCaps_put_UniqueID(This,fvarUniqueID) \ - ( (This)->lpVtbl -> put_UniqueID(This,fvarUniqueID) ) - -#define IDSFDeviceCaps_get_SilentInstall(This,pfvarSilentInstall) \ - ( (This)->lpVtbl -> get_SilentInstall(This,pfvarSilentInstall) ) - -#define IDSFDeviceCaps_put_SilentInstall(This,fvarSilentInstall) \ - ( (This)->lpVtbl -> put_SilentInstall(This,fvarSilentInstall) ) - -#define IDSFDeviceCaps_get_RawDeviceOK(This,pfvarRawDeviceOK) \ - ( (This)->lpVtbl -> get_RawDeviceOK(This,pfvarRawDeviceOK) ) - -#define IDSFDeviceCaps_put_RawDeviceOK(This,fvarRawDeviceOK) \ - ( (This)->lpVtbl -> put_RawDeviceOK(This,fvarRawDeviceOK) ) - -#define IDSFDeviceCaps_get_SurpriseRemovalOK(This,pfvarSurpriseRemovalOK) \ - ( (This)->lpVtbl -> get_SurpriseRemovalOK(This,pfvarSurpriseRemovalOK) ) - -#define IDSFDeviceCaps_put_SurpriseRemovalOK(This,fvarSurpriseRemovalOK) \ - ( (This)->lpVtbl -> put_SurpriseRemovalOK(This,fvarSurpriseRemovalOK) ) - -#define IDSFDeviceCaps_get_WakeFromD0(This,pfvarWakeFromD0) \ - ( (This)->lpVtbl -> get_WakeFromD0(This,pfvarWakeFromD0) ) - -#define IDSFDeviceCaps_put_WakeFromD0(This,fvarWakeFromD0) \ - ( (This)->lpVtbl -> put_WakeFromD0(This,fvarWakeFromD0) ) - -#define IDSFDeviceCaps_get_WakeFromD1(This,pfvarWakeFromD1) \ - ( (This)->lpVtbl -> get_WakeFromD1(This,pfvarWakeFromD1) ) - -#define IDSFDeviceCaps_put_WakeFromD1(This,fvarWakeFromD1) \ - ( (This)->lpVtbl -> put_WakeFromD1(This,fvarWakeFromD1) ) - -#define IDSFDeviceCaps_get_WakeFromD2(This,pfvarWakeFromD2) \ - ( (This)->lpVtbl -> get_WakeFromD2(This,pfvarWakeFromD2) ) - -#define IDSFDeviceCaps_put_WakeFromD2(This,fvarWakeFromD2) \ - ( (This)->lpVtbl -> put_WakeFromD2(This,fvarWakeFromD2) ) - -#define IDSFDeviceCaps_get_WakeFromD3(This,pfvarWakeFromD3) \ - ( (This)->lpVtbl -> get_WakeFromD3(This,pfvarWakeFromD3) ) - -#define IDSFDeviceCaps_put_WakeFromD3(This,fvarWakeFromD3) \ - ( (This)->lpVtbl -> put_WakeFromD3(This,fvarWakeFromD3) ) - -#define IDSFDeviceCaps_get_HardwareDisabled(This,pfvarHardwareDisabled) \ - ( (This)->lpVtbl -> get_HardwareDisabled(This,pfvarHardwareDisabled) ) - -#define IDSFDeviceCaps_put_HardwareDisabled(This,fvarHardwareDisabled) \ - ( (This)->lpVtbl -> put_HardwareDisabled(This,fvarHardwareDisabled) ) - -#define IDSFDeviceCaps_get_NonDynamic(This,pfvarNonDynamic) \ - ( (This)->lpVtbl -> get_NonDynamic(This,pfvarNonDynamic) ) - -#define IDSFDeviceCaps_put_NonDynamic(This,fvarNonDynamic) \ - ( (This)->lpVtbl -> put_NonDynamic(This,fvarNonDynamic) ) - -#define IDSFDeviceCaps_get_WarmEjectSupported(This,pfvarWarmEjectSupported) \ - ( (This)->lpVtbl -> get_WarmEjectSupported(This,pfvarWarmEjectSupported) ) - -#define IDSFDeviceCaps_put_WarmEjectSupported(This,fvarWarmEjectSupported) \ - ( (This)->lpVtbl -> put_WarmEjectSupported(This,fvarWarmEjectSupported) ) - -#define IDSFDeviceCaps_get_NoDisplayInUI(This,pfvarNoDisplayInUI) \ - ( (This)->lpVtbl -> get_NoDisplayInUI(This,pfvarNoDisplayInUI) ) - -#define IDSFDeviceCaps_put_NoDisplayInUI(This,fvarNoDisplayInUI) \ - ( (This)->lpVtbl -> put_NoDisplayInUI(This,fvarNoDisplayInUI) ) - -#define IDSFDeviceCaps_get_Reserved(This,psReserved) \ - ( (This)->lpVtbl -> get_Reserved(This,psReserved) ) - -#define IDSFDeviceCaps_put_Reserved(This,sReserved) \ - ( (This)->lpVtbl -> put_Reserved(This,sReserved) ) - -#define IDSFDeviceCaps_get_Address(This,plAddress) \ - ( (This)->lpVtbl -> get_Address(This,plAddress) ) - -#define IDSFDeviceCaps_put_Address(This,lAddress) \ - ( (This)->lpVtbl -> put_Address(This,lAddress) ) - -#define IDSFDeviceCaps_get_UINumber(This,plUINumber) \ - ( (This)->lpVtbl -> get_UINumber(This,plUINumber) ) - -#define IDSFDeviceCaps_put_UINumber(This,lUINumber) \ - ( (This)->lpVtbl -> put_UINumber(This,lUINumber) ) - -#define IDSFDeviceCaps_get_DeviceState(This,ppsaDeviceState) \ - ( (This)->lpVtbl -> get_DeviceState(This,ppsaDeviceState) ) - -#define IDSFDeviceCaps_put_DeviceState(This,psaDeviceState) \ - ( (This)->lpVtbl -> put_DeviceState(This,psaDeviceState) ) - -#define IDSFDeviceCaps_get_SystemWake(This,pPowerState) \ - ( (This)->lpVtbl -> get_SystemWake(This,pPowerState) ) - -#define IDSFDeviceCaps_put_SystemWake(This,PowerState) \ - ( (This)->lpVtbl -> put_SystemWake(This,PowerState) ) - -#define IDSFDeviceCaps_get_DeviceWake(This,pPowerState) \ - ( (This)->lpVtbl -> get_DeviceWake(This,pPowerState) ) - -#define IDSFDeviceCaps_put_DeviceWake(This,PowerState) \ - ( (This)->lpVtbl -> put_DeviceWake(This,PowerState) ) - -#define IDSFDeviceCaps_get_D1Latency(This,plD1Latency) \ - ( (This)->lpVtbl -> get_D1Latency(This,plD1Latency) ) - -#define IDSFDeviceCaps_put_D1Latency(This,lD1Latency) \ - ( (This)->lpVtbl -> put_D1Latency(This,lD1Latency) ) - -#define IDSFDeviceCaps_get_D2Latency(This,plD2Latency) \ - ( (This)->lpVtbl -> get_D2Latency(This,plD2Latency) ) - -#define IDSFDeviceCaps_put_D2Latency(This,lD2Latency) \ - ( (This)->lpVtbl -> put_D2Latency(This,lD2Latency) ) - -#define IDSFDeviceCaps_get_D3Latency(This,plD3Latency) \ - ( (This)->lpVtbl -> get_D3Latency(This,plD3Latency) ) - -#define IDSFDeviceCaps_put_D3Latency(This,lD3Latency) \ - ( (This)->lpVtbl -> put_D3Latency(This,lD3Latency) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFDeviceCaps_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFDeviceEvents_INTERFACE_DEFINED__ -#define __IDSFDeviceEvents_INTERFACE_DEFINED__ - -/* interface IDSFDeviceEvents */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFDeviceEvents; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3E706BA6-2C8F-4441-8931-1ACEB318112F") - IDSFDeviceEvents : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Disabled( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Enabled( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Inserted( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OpModeChange( - /* [in] */ DSFOpMode NewOpMode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Removed( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall ResourcesSet( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall StartFaultInjection( - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Params, - /* [retval][out] */ __RPC__out VARIANT *pvarContext) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall StopFaultInjection( - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Context) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall StateChange( - /* [in] */ long Bit, - /* [in] */ short Value, - /* [in] */ long NewState) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFDeviceEventsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFDeviceEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFDeviceEvents * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFDeviceEvents * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFDeviceEvents * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Disabled )( - __RPC__in IDSFDeviceEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Enabled )( - __RPC__in IDSFDeviceEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Inserted )( - __RPC__in IDSFDeviceEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OpModeChange )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ DSFOpMode NewOpMode); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Removed )( - __RPC__in IDSFDeviceEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *ResourcesSet )( - __RPC__in IDSFDeviceEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *StartFaultInjection )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Params, - /* [retval][out] */ __RPC__out VARIANT *pvarContext); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *StopFaultInjection )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ DSFResourceType ResType, - /* [in] */ VARIANT Context); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *StateChange )( - __RPC__in IDSFDeviceEvents * This, - /* [in] */ long Bit, - /* [in] */ short Value, - /* [in] */ long NewState); - - END_INTERFACE - } IDSFDeviceEventsVtbl; - - interface IDSFDeviceEvents - { - CONST_VTBL struct IDSFDeviceEventsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFDeviceEvents_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFDeviceEvents_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFDeviceEvents_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFDeviceEvents_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFDeviceEvents_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFDeviceEvents_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFDeviceEvents_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFDeviceEvents_Disabled(This) \ - ( (This)->lpVtbl -> Disabled(This) ) - -#define IDSFDeviceEvents_Enabled(This) \ - ( (This)->lpVtbl -> Enabled(This) ) - -#define IDSFDeviceEvents_Inserted(This) \ - ( (This)->lpVtbl -> Inserted(This) ) - -#define IDSFDeviceEvents_OpModeChange(This,NewOpMode) \ - ( (This)->lpVtbl -> OpModeChange(This,NewOpMode) ) - -#define IDSFDeviceEvents_Removed(This) \ - ( (This)->lpVtbl -> Removed(This) ) - -#define IDSFDeviceEvents_ResourcesSet(This) \ - ( (This)->lpVtbl -> ResourcesSet(This) ) - -#define IDSFDeviceEvents_StartFaultInjection(This,ResType,Params,pvarContext) \ - ( (This)->lpVtbl -> StartFaultInjection(This,ResType,Params,pvarContext) ) - -#define IDSFDeviceEvents_StopFaultInjection(This,ResType,Context) \ - ( (This)->lpVtbl -> StopFaultInjection(This,ResType,Context) ) - -#define IDSFDeviceEvents_StateChange(This,Bit,Value,NewState) \ - ( (This)->lpVtbl -> StateChange(This,Bit,Value,NewState) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFDeviceEvents_INTERFACE_DEFINED__ */ - - -#ifndef __IDSF_INTERFACE_DEFINED__ -#define __IDSF_INTERFACE_DEFINED__ - -/* interface IDSF */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSF; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("959B9C1D-5644-4835-8297-F435B3FA80DD") - IDSF : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Devices( - /* [retval][out] */ __RPC__deref_out_opt DSFDevices **ppDSFDevices) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Log( - /* [retval][out] */ __RPC__deref_out_opt DSFLog **ppDSFLog) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Version( - /* [retval][out] */ __RPC__deref_out_opt DSFVersion **ppDSFVersion) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall CreateDevice( - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrInstanceID, - /* [in] */ VARIANT HardwareIDs, - /* [in] */ VARIANT CompatibleIDs, - /* [in] */ __RPC__in DSFResourceList *RawResources, - /* [in] */ __RPC__in DSFResourceList *XlatedResources, - /* [in] */ __RPC__in DSFDeviceCaps *DeviceCapabilities, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall WriteState( - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid, - /* [in] */ __RPC__in DSFPropertyBag *pDSFPropertyBag) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall ReadState( - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid, - /* [retval][out] */ __RPC__deref_out_opt DSFPropertyBag **ppDSFPropertyBag) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall DeleteState( - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall SetDriverFlags( - /* [in] */ __RPC__in BSTR DriverGuid, - /* [in] */ DSFFlagType FlagType, - /* [in] */ unsigned long Flags) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall EnableDriverLogging( - /* [in] */ __RPC__in BSTR DriverGuid, - /* [in] */ VARIANT_BOOL Enable) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall HotPlug( - /* [in] */ __RPC__in DSFDevice *pDSFDevice, - /* [in] */ __RPC__in BSTR bstrBus, - /* [retval][out] */ __RPC__deref_out_opt IDSFBus **ppiDSFBus) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSF * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSF * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSF * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSF * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSF * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Devices )( - __RPC__in IDSF * This, - /* [retval][out] */ __RPC__deref_out_opt DSFDevices **ppDSFDevices); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Log )( - __RPC__in IDSF * This, - /* [retval][out] */ __RPC__deref_out_opt DSFLog **ppDSFLog); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Version )( - __RPC__in IDSF * This, - /* [retval][out] */ __RPC__deref_out_opt DSFVersion **ppDSFVersion); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *CreateDevice )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrInstanceID, - /* [in] */ VARIANT HardwareIDs, - /* [in] */ VARIANT CompatibleIDs, - /* [in] */ __RPC__in DSFResourceList *RawResources, - /* [in] */ __RPC__in DSFResourceList *XlatedResources, - /* [in] */ __RPC__in DSFDeviceCaps *DeviceCapabilities, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *WriteState )( - __RPC__in IDSF * This, - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid, - /* [in] */ __RPC__in DSFPropertyBag *pDSFPropertyBag); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *ReadState )( - __RPC__in IDSF * This, - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid, - /* [retval][out] */ __RPC__deref_out_opt DSFPropertyBag **ppDSFPropertyBag); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *DeleteState )( - __RPC__in IDSF * This, - /* [in] */ DSFStateType Type, - /* [in] */ __RPC__in BSTR Guid); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *SetDriverFlags )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in BSTR DriverGuid, - /* [in] */ DSFFlagType FlagType, - /* [in] */ unsigned long Flags); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *EnableDriverLogging )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in BSTR DriverGuid, - /* [in] */ VARIANT_BOOL Enable); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *HotPlug )( - __RPC__in IDSF * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice, - /* [in] */ __RPC__in BSTR bstrBus, - /* [retval][out] */ __RPC__deref_out_opt IDSFBus **ppiDSFBus); - - END_INTERFACE - } IDSFVtbl; - - interface IDSF - { - CONST_VTBL struct IDSFVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSF_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSF_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSF_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSF_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSF_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSF_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSF_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSF_get_Devices(This,ppDSFDevices) \ - ( (This)->lpVtbl -> get_Devices(This,ppDSFDevices) ) - -#define IDSF_get_Log(This,ppDSFLog) \ - ( (This)->lpVtbl -> get_Log(This,ppDSFLog) ) - -#define IDSF_get_Version(This,ppDSFVersion) \ - ( (This)->lpVtbl -> get_Version(This,ppDSFVersion) ) - -#define IDSF_CreateDevice(This,bstrDeviceID,bstrInstanceID,HardwareIDs,CompatibleIDs,RawResources,XlatedResources,DeviceCapabilities,ppDSFDevice) \ - ( (This)->lpVtbl -> CreateDevice(This,bstrDeviceID,bstrInstanceID,HardwareIDs,CompatibleIDs,RawResources,XlatedResources,DeviceCapabilities,ppDSFDevice) ) - -#define IDSF_WriteState(This,Type,Guid,pDSFPropertyBag) \ - ( (This)->lpVtbl -> WriteState(This,Type,Guid,pDSFPropertyBag) ) - -#define IDSF_ReadState(This,Type,Guid,ppDSFPropertyBag) \ - ( (This)->lpVtbl -> ReadState(This,Type,Guid,ppDSFPropertyBag) ) - -#define IDSF_DeleteState(This,Type,Guid) \ - ( (This)->lpVtbl -> DeleteState(This,Type,Guid) ) - -#define IDSF_SetDriverFlags(This,DriverGuid,FlagType,Flags) \ - ( (This)->lpVtbl -> SetDriverFlags(This,DriverGuid,FlagType,Flags) ) - -#define IDSF_EnableDriverLogging(This,DriverGuid,Enable) \ - ( (This)->lpVtbl -> EnableDriverLogging(This,DriverGuid,Enable) ) - -#define IDSF_HotPlug(This,pDSFDevice,bstrBus,ppiDSFBus) \ - ( (This)->lpVtbl -> HotPlug(This,pDSFDevice,bstrBus,ppiDSFBus) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSF_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFDevices_INTERFACE_DEFINED__ -#define __IDSFDevices_INTERFACE_DEFINED__ - -/* interface IDSFDevices */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFDevices; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E75FB264-EA8A-4167-892B-F6F315249518") - IDSFDevices : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Refresh( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFDevicesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFDevices * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFDevices * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFDevices * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFDevices * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFDevices * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFDevices * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFDevices * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in IDSFDevices * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in IDSFDevices * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFDevice **ppDSFDevice); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in IDSFDevices * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Refresh )( - __RPC__in IDSFDevices * This); - - END_INTERFACE - } IDSFDevicesVtbl; - - interface IDSFDevices - { - CONST_VTBL struct IDSFDevicesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFDevices_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFDevices_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFDevices_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFDevices_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFDevices_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFDevices_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFDevices_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFDevices_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define IDSFDevices_get_Item(This,Index,ppDSFDevice) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppDSFDevice) ) - -#define IDSFDevices_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define IDSFDevices_Refresh(This) \ - ( (This)->lpVtbl -> Refresh(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFDevices_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFLog_INTERFACE_DEFINED__ -#define __IDSFLog_INTERFACE_DEFINED__ - -/* interface IDSFLog */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B7902A6F-4CC1-4ABE-8E7A-6EFF79BBBACA") - IDSFLog : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Write( - /* [in] */ __RPC__in BSTR Text) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Enabled( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Enabled( - /* [in] */ VARIANT_BOOL fvarEnabled) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFLog * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFLog * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFLog * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFLog * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Write )( - __RPC__in IDSFLog * This, - /* [in] */ __RPC__in BSTR Text); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Enabled )( - __RPC__in IDSFLog * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Enabled )( - __RPC__in IDSFLog * This, - /* [in] */ VARIANT_BOOL fvarEnabled); - - END_INTERFACE - } IDSFLogVtbl; - - interface IDSFLog - { - CONST_VTBL struct IDSFLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFLog_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFLog_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFLog_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFLog_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFLog_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFLog_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFLog_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFLog_Write(This,Text) \ - ( (This)->lpVtbl -> Write(This,Text) ) - -#define IDSFLog_get_Enabled(This,pfvarEnabled) \ - ( (This)->lpVtbl -> get_Enabled(This,pfvarEnabled) ) - -#define IDSFLog_put_Enabled(This,fvarEnabled) \ - ( (This)->lpVtbl -> put_Enabled(This,fvarEnabled) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFLog_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFVersion_INTERFACE_DEFINED__ -#define __IDSFVersion_INTERFACE_DEFINED__ - -/* interface IDSFVersion */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFVersion; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F65DF1DA-32B4-411A-B989-1B43B5C428F2") - IDSFVersion : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Major( - /* [retval][out] */ __RPC__out long *plMajor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Minor( - /* [retval][out] */ __RPC__out long *plMinor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OSMajor( - /* [retval][out] */ __RPC__out long *plOSMajor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OSMinor( - /* [retval][out] */ __RPC__out long *plOSMinor) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFVersionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFVersion * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFVersion * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFVersion * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFVersion * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFVersion * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFVersion * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFVersion * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Major )( - __RPC__in IDSFVersion * This, - /* [retval][out] */ __RPC__out long *plMajor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Minor )( - __RPC__in IDSFVersion * This, - /* [retval][out] */ __RPC__out long *plMinor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OSMajor )( - __RPC__in IDSFVersion * This, - /* [retval][out] */ __RPC__out long *plOSMajor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OSMinor )( - __RPC__in IDSFVersion * This, - /* [retval][out] */ __RPC__out long *plOSMinor); - - END_INTERFACE - } IDSFVersionVtbl; - - interface IDSFVersion - { - CONST_VTBL struct IDSFVersionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFVersion_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFVersion_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFVersion_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFVersion_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFVersion_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFVersion_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFVersion_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFVersion_get_Major(This,plMajor) \ - ( (This)->lpVtbl -> get_Major(This,plMajor) ) - -#define IDSFVersion_get_Minor(This,plMinor) \ - ( (This)->lpVtbl -> get_Minor(This,plMinor) ) - -#define IDSFVersion_get_OSMajor(This,plOSMajor) \ - ( (This)->lpVtbl -> get_OSMajor(This,plOSMajor) ) - -#define IDSFVersion_get_OSMinor(This,plOSMinor) \ - ( (This)->lpVtbl -> get_OSMinor(This,plOSMinor) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFVersion_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFPropertyBag_INTERFACE_DEFINED__ -#define __IDSFPropertyBag_INTERFACE_DEFINED__ - -/* interface IDSFPropertyBag */ -/* [object][helpstringcontext][helpcontext][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFPropertyBag; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ac2ed126-da20-48db-817c-61689122d1e0") - IDSFPropertyBag : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Write( - /* [in] */ __RPC__in BSTR Name, - /* [in] */ VARIANT Value) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Read( - /* [in] */ __RPC__in BSTR Name, - /* [retval][out] */ __RPC__out VARIANT *Value) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ __RPC__in BSTR Name) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFPropertyBagVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFPropertyBag * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFPropertyBag * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFPropertyBag * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFPropertyBag * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Write )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ __RPC__in BSTR Name, - /* [in] */ VARIANT Value); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Read )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ __RPC__in BSTR Name, - /* [retval][out] */ __RPC__out VARIANT *Value); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in IDSFPropertyBag * This, - /* [in] */ __RPC__in BSTR Name); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in IDSFPropertyBag * This); - - END_INTERFACE - } IDSFPropertyBagVtbl; - - interface IDSFPropertyBag - { - CONST_VTBL struct IDSFPropertyBagVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFPropertyBag_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFPropertyBag_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFPropertyBag_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFPropertyBag_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFPropertyBag_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFPropertyBag_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFPropertyBag_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFPropertyBag_Write(This,Name,Value) \ - ( (This)->lpVtbl -> Write(This,Name,Value) ) - -#define IDSFPropertyBag_Read(This,Name,Value) \ - ( (This)->lpVtbl -> Read(This,Name,Value) ) - -#define IDSFPropertyBag_Remove(This,Name) \ - ( (This)->lpVtbl -> Remove(This,Name) ) - -#define IDSFPropertyBag_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFPropertyBag_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFBus_INTERFACE_DEFINED__ -#define __IDSFBus_INTERFACE_DEFINED__ - -/* interface IDSFBus */ -/* [object][helpstringcontext][helpcontext][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFBus; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E927C266-5364-449E-AE52-D6A782AFDA9C") - IDSFBus : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Name( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_GUID( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGuid) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall HotPlug( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Unplug( - /* [in] */ __RPC__in DSFDevice *pDSFDevice) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFBusVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFBus * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFBus * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFBus * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFBus * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFBus * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFBus * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFBus * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Name )( - __RPC__in IDSFBus * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_GUID )( - __RPC__in IDSFBus * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGuid); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *HotPlug )( - __RPC__in IDSFBus * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Unplug )( - __RPC__in IDSFBus * This, - /* [in] */ __RPC__in DSFDevice *pDSFDevice); - - END_INTERFACE - } IDSFBusVtbl; - - interface IDSFBus - { - CONST_VTBL struct IDSFBusVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFBus_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFBus_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFBus_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFBus_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFBus_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFBus_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFBus_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFBus_get_Name(This,pbstrName) \ - ( (This)->lpVtbl -> get_Name(This,pbstrName) ) - -#define IDSFBus_get_GUID(This,pbstrGuid) \ - ( (This)->lpVtbl -> get_GUID(This,pbstrGuid) ) - -#define IDSFBus_HotPlug(This,pDSFDevice) \ - ( (This)->lpVtbl -> HotPlug(This,pDSFDevice) ) - -#define IDSFBus_Unplug(This,pDSFDevice) \ - ( (This)->lpVtbl -> Unplug(This,pDSFDevice) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFBus_INTERFACE_DEFINED__ */ - - -#ifndef __IDSFPartialResourceDescriptor_INTERFACE_DEFINED__ -#define __IDSFPartialResourceDescriptor_INTERFACE_DEFINED__ - -/* interface IDSFPartialResourceDescriptor */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFPartialResourceDescriptor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("227948DE-4F1F-4689-8D9F-ED044417C5A9") - IDSFPartialResourceDescriptor : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Type( - /* [retval][out] */ __RPC__out DSFResourceType *pType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Type( - /* [in] */ DSFResourceType ResType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ShareDisposition( - /* [retval][out] */ __RPC__out DSFShareDisposition *pShareType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ShareDisposition( - /* [in] */ DSFShareDisposition ShareType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Flags( - /* [retval][out] */ __RPC__out short *psFlags) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Flags( - /* [in] */ short sFlags) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Descriptor( - /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Descriptor( - /* [in] */ __RPC__in_opt IDispatch *pdispDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HRM( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkHRM) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HRM( - /* [in] */ __RPC__in_opt IUnknown *punkHRM) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFPartialResourceDescriptorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFPartialResourceDescriptor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFPartialResourceDescriptor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFPartialResourceDescriptor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Type )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [retval][out] */ __RPC__out DSFResourceType *pType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Type )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ DSFResourceType ResType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ShareDisposition )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [retval][out] */ __RPC__out DSFShareDisposition *pShareType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ShareDisposition )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ DSFShareDisposition ShareType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Flags )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [retval][out] */ __RPC__out short *psFlags); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Flags )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ short sFlags); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Descriptor )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppdispDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Descriptor )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ __RPC__in_opt IDispatch *pdispDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HRM )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkHRM); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HRM )( - __RPC__in IDSFPartialResourceDescriptor * This, - /* [in] */ __RPC__in_opt IUnknown *punkHRM); - - END_INTERFACE - } IDSFPartialResourceDescriptorVtbl; - - interface IDSFPartialResourceDescriptor - { - CONST_VTBL struct IDSFPartialResourceDescriptorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFPartialResourceDescriptor_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFPartialResourceDescriptor_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFPartialResourceDescriptor_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFPartialResourceDescriptor_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFPartialResourceDescriptor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFPartialResourceDescriptor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFPartialResourceDescriptor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFPartialResourceDescriptor_get_Type(This,pType) \ - ( (This)->lpVtbl -> get_Type(This,pType) ) - -#define IDSFPartialResourceDescriptor_put_Type(This,ResType) \ - ( (This)->lpVtbl -> put_Type(This,ResType) ) - -#define IDSFPartialResourceDescriptor_get_ShareDisposition(This,pShareType) \ - ( (This)->lpVtbl -> get_ShareDisposition(This,pShareType) ) - -#define IDSFPartialResourceDescriptor_put_ShareDisposition(This,ShareType) \ - ( (This)->lpVtbl -> put_ShareDisposition(This,ShareType) ) - -#define IDSFPartialResourceDescriptor_get_Flags(This,psFlags) \ - ( (This)->lpVtbl -> get_Flags(This,psFlags) ) - -#define IDSFPartialResourceDescriptor_put_Flags(This,sFlags) \ - ( (This)->lpVtbl -> put_Flags(This,sFlags) ) - -#define IDSFPartialResourceDescriptor_get_Descriptor(This,ppdispDescriptor) \ - ( (This)->lpVtbl -> get_Descriptor(This,ppdispDescriptor) ) - -#define IDSFPartialResourceDescriptor_put_Descriptor(This,pdispDescriptor) \ - ( (This)->lpVtbl -> put_Descriptor(This,pdispDescriptor) ) - -#define IDSFPartialResourceDescriptor_get_HRM(This,ppunkHRM) \ - ( (This)->lpVtbl -> get_HRM(This,ppunkHRM) ) - -#define IDSFPartialResourceDescriptor_put_HRM(This,punkHRM) \ - ( (This)->lpVtbl -> put_HRM(This,punkHRM) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFPartialResourceDescriptor_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFPartialResourceDescriptor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("7E3FC012-1DB1-4135-AAAA-7FA6ED1CF620") -DSFPartialResourceDescriptor; -#endif - -#ifndef __IDSFPartialResourceList_INTERFACE_DEFINED__ -#define __IDSFPartialResourceList_INTERFACE_DEFINED__ - -/* interface IDSFPartialResourceList */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFPartialResourceList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C388EB82-EA52-4459-84D9-69B7E9846EC0") - IDSFPartialResourceList : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Version( - /* [retval][out] */ __RPC__out short *psVersion) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Version( - /* [in] */ short sVersion) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Revision( - /* [retval][out] */ __RPC__out short *psRevision) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Revision( - /* [in] */ short sRevision) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFPartialResourceDescriptor **ppDSFPartialResourceDescriptor) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in DSFPartialResourceDescriptor *pDSFPartialResourceDescriptor, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFPartialResourceListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFPartialResourceList * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFPartialResourceList * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFPartialResourceList * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFPartialResourceList * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Version )( - __RPC__in IDSFPartialResourceList * This, - /* [retval][out] */ __RPC__out short *psVersion); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Version )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ short sVersion); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Revision )( - __RPC__in IDSFPartialResourceList * This, - /* [retval][out] */ __RPC__out short *psRevision); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Revision )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ short sRevision); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in IDSFPartialResourceList * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt DSFPartialResourceDescriptor **ppDSFPartialResourceDescriptor); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in IDSFPartialResourceList * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ __RPC__in DSFPartialResourceDescriptor *pDSFPartialResourceDescriptor, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in IDSFPartialResourceList * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in IDSFPartialResourceList * This); - - END_INTERFACE - } IDSFPartialResourceListVtbl; - - interface IDSFPartialResourceList - { - CONST_VTBL struct IDSFPartialResourceListVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFPartialResourceList_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFPartialResourceList_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFPartialResourceList_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFPartialResourceList_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFPartialResourceList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFPartialResourceList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFPartialResourceList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFPartialResourceList_get_Version(This,psVersion) \ - ( (This)->lpVtbl -> get_Version(This,psVersion) ) - -#define IDSFPartialResourceList_put_Version(This,sVersion) \ - ( (This)->lpVtbl -> put_Version(This,sVersion) ) - -#define IDSFPartialResourceList_get_Revision(This,psRevision) \ - ( (This)->lpVtbl -> get_Revision(This,psRevision) ) - -#define IDSFPartialResourceList_put_Revision(This,sRevision) \ - ( (This)->lpVtbl -> put_Revision(This,sRevision) ) - -#define IDSFPartialResourceList_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define IDSFPartialResourceList_get_Item(This,Index,ppDSFPartialResourceDescriptor) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppDSFPartialResourceDescriptor) ) - -#define IDSFPartialResourceList_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define IDSFPartialResourceList_Add(This,pDSFPartialResourceDescriptor,Index) \ - ( (This)->lpVtbl -> Add(This,pDSFPartialResourceDescriptor,Index) ) - -#define IDSFPartialResourceList_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define IDSFPartialResourceList_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFPartialResourceList_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFPartialResourceList; - -#ifdef __cplusplus - -class DECLSPEC_UUID("DC1C8B82-254C-4AD9-8CE0-CA477FC56DB1") -DSFPartialResourceList; -#endif - -EXTERN_C const CLSID CLSID_DSFFullResourceDescriptor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("CECFEC54-035C-4103-B64F-A200AB9F32C2") -DSFFullResourceDescriptor; -#endif - -EXTERN_C const CLSID CLSID_DSFResourceList; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3596C463-2D1E-40B7-8DC7-7BB32F9E2DC4") -DSFResourceList; -#endif - -#ifndef __IDSFResDescPort_INTERFACE_DEFINED__ -#define __IDSFResDescPort_INTERFACE_DEFINED__ - -/* interface IDSFResDescPort */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescPort; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("82850DB2-0F99-4529-9F6E-6C1273C6027C") - IDSFResDescPort : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_StartLow( - /* [retval][out] */ __RPC__out long *plStartLow) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_StartLow( - /* [in] */ long lStartLow) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_StartHigh( - /* [retval][out] */ __RPC__out long *plStartHigh) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_StartHigh( - /* [in] */ long lStartHigh) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out long *plLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ long lLength) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescPortVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescPort * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescPort * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescPort * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescPort * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescPort * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_StartLow )( - __RPC__in IDSFResDescPort * This, - /* [retval][out] */ __RPC__out long *plStartLow); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_StartLow )( - __RPC__in IDSFResDescPort * This, - /* [in] */ long lStartLow); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_StartHigh )( - __RPC__in IDSFResDescPort * This, - /* [retval][out] */ __RPC__out long *plStartHigh); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_StartHigh )( - __RPC__in IDSFResDescPort * This, - /* [in] */ long lStartHigh); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in IDSFResDescPort * This, - /* [retval][out] */ __RPC__out long *plLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in IDSFResDescPort * This, - /* [in] */ long lLength); - - END_INTERFACE - } IDSFResDescPortVtbl; - - interface IDSFResDescPort - { - CONST_VTBL struct IDSFResDescPortVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescPort_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescPort_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescPort_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescPort_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescPort_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescPort_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescPort_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescPort_get_StartLow(This,plStartLow) \ - ( (This)->lpVtbl -> get_StartLow(This,plStartLow) ) - -#define IDSFResDescPort_put_StartLow(This,lStartLow) \ - ( (This)->lpVtbl -> put_StartLow(This,lStartLow) ) - -#define IDSFResDescPort_get_StartHigh(This,plStartHigh) \ - ( (This)->lpVtbl -> get_StartHigh(This,plStartHigh) ) - -#define IDSFResDescPort_put_StartHigh(This,lStartHigh) \ - ( (This)->lpVtbl -> put_StartHigh(This,lStartHigh) ) - -#define IDSFResDescPort_get_Length(This,plLength) \ - ( (This)->lpVtbl -> get_Length(This,plLength) ) - -#define IDSFResDescPort_put_Length(This,lLength) \ - ( (This)->lpVtbl -> put_Length(This,lLength) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescPort_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescPort; - -#ifdef __cplusplus - -class DECLSPEC_UUID("680D2930-B314-4B4F-87F0-14E8ECB1982F") -DSFResDescPort; -#endif - -#ifndef __IDSFResDescDevSpecific_INTERFACE_DEFINED__ -#define __IDSFResDescDevSpecific_INTERFACE_DEFINED__ - -/* interface IDSFResDescDevSpecific */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescDevSpecific; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("914D27BF-0AB4-44c2-873D-84D163B39DD5") - IDSFResDescDevSpecific : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DataSize( - /* [retval][out] */ __RPC__out long *plDataSize) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DataSize( - /* [in] */ long lDataSize) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reserved1( - /* [retval][out] */ __RPC__out long *plReserved1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Reserved1( - /* [in] */ long lReserved1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reserved2( - /* [retval][out] */ __RPC__out long *plReserved2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Reserved2( - /* [in] */ long lReserved2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescDevSpecificVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescDevSpecific * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescDevSpecific * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescDevSpecific * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescDevSpecific * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DataSize )( - __RPC__in IDSFResDescDevSpecific * This, - /* [retval][out] */ __RPC__out long *plDataSize); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DataSize )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ long lDataSize); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reserved1 )( - __RPC__in IDSFResDescDevSpecific * This, - /* [retval][out] */ __RPC__out long *plReserved1); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Reserved1 )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ long lReserved1); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reserved2 )( - __RPC__in IDSFResDescDevSpecific * This, - /* [retval][out] */ __RPC__out long *plReserved2); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Reserved2 )( - __RPC__in IDSFResDescDevSpecific * This, - /* [in] */ long lReserved2); - - END_INTERFACE - } IDSFResDescDevSpecificVtbl; - - interface IDSFResDescDevSpecific - { - CONST_VTBL struct IDSFResDescDevSpecificVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescDevSpecific_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescDevSpecific_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescDevSpecific_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescDevSpecific_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescDevSpecific_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescDevSpecific_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescDevSpecific_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescDevSpecific_get_DataSize(This,plDataSize) \ - ( (This)->lpVtbl -> get_DataSize(This,plDataSize) ) - -#define IDSFResDescDevSpecific_put_DataSize(This,lDataSize) \ - ( (This)->lpVtbl -> put_DataSize(This,lDataSize) ) - -#define IDSFResDescDevSpecific_get_Reserved1(This,plReserved1) \ - ( (This)->lpVtbl -> get_Reserved1(This,plReserved1) ) - -#define IDSFResDescDevSpecific_put_Reserved1(This,lReserved1) \ - ( (This)->lpVtbl -> put_Reserved1(This,lReserved1) ) - -#define IDSFResDescDevSpecific_get_Reserved2(This,plReserved2) \ - ( (This)->lpVtbl -> get_Reserved2(This,plReserved2) ) - -#define IDSFResDescDevSpecific_put_Reserved2(This,lReserved2) \ - ( (This)->lpVtbl -> put_Reserved2(This,lReserved2) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescDevSpecific_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescDevSpecific; - -#ifdef __cplusplus - -class DECLSPEC_UUID("75679715-3926-4211-A5A6-6A333023D5BA") -DSFResDescDevSpecific; -#endif - -#ifndef __IDSFResDescDevPrivate_INTERFACE_DEFINED__ -#define __IDSFResDescDevPrivate_INTERFACE_DEFINED__ - -/* interface IDSFResDescDevPrivate */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescDevPrivate; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("C455E6E1-F93D-47bd-9042-95B7AB0A7D2B") - IDSFResDescDevPrivate : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Data0( - /* [retval][out] */ __RPC__out long *plData0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Data0( - /* [in] */ long lData0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Data1( - /* [retval][out] */ __RPC__out long *plData1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Data1( - /* [in] */ long lData1) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Data2( - /* [retval][out] */ __RPC__out long *plData2) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Data2( - /* [in] */ long lData2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescDevPrivateVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescDevPrivate * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescDevPrivate * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescDevPrivate * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescDevPrivate * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Data0 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [retval][out] */ __RPC__out long *plData0); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Data0 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ long lData0); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Data1 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [retval][out] */ __RPC__out long *plData1); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Data1 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ long lData1); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Data2 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [retval][out] */ __RPC__out long *plData2); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Data2 )( - __RPC__in IDSFResDescDevPrivate * This, - /* [in] */ long lData2); - - END_INTERFACE - } IDSFResDescDevPrivateVtbl; - - interface IDSFResDescDevPrivate - { - CONST_VTBL struct IDSFResDescDevPrivateVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescDevPrivate_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescDevPrivate_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescDevPrivate_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescDevPrivate_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescDevPrivate_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescDevPrivate_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescDevPrivate_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescDevPrivate_get_Data0(This,plData0) \ - ( (This)->lpVtbl -> get_Data0(This,plData0) ) - -#define IDSFResDescDevPrivate_put_Data0(This,lData0) \ - ( (This)->lpVtbl -> put_Data0(This,lData0) ) - -#define IDSFResDescDevPrivate_get_Data1(This,plData1) \ - ( (This)->lpVtbl -> get_Data1(This,plData1) ) - -#define IDSFResDescDevPrivate_put_Data1(This,lData1) \ - ( (This)->lpVtbl -> put_Data1(This,lData1) ) - -#define IDSFResDescDevPrivate_get_Data2(This,plData2) \ - ( (This)->lpVtbl -> get_Data2(This,plData2) ) - -#define IDSFResDescDevPrivate_put_Data2(This,lData2) \ - ( (This)->lpVtbl -> put_Data2(This,lData2) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescDevPrivate_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescDevPrivate; - -#ifdef __cplusplus - -class DECLSPEC_UUID("F03EAE50-D772-4125-82E7-087B91ADF213") -DSFResDescDevPrivate; -#endif - -#ifndef __IDSFResDescInterrupt_INTERFACE_DEFINED__ -#define __IDSFResDescInterrupt_INTERFACE_DEFINED__ - -/* interface IDSFResDescInterrupt */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescInterrupt; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("20F6EF07-E851-464A-B1BC-549B941682B0") - IDSFResDescInterrupt : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Level( - /* [retval][out] */ __RPC__out long *plLevel) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Level( - /* [in] */ long lLevel) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Vector( - /* [retval][out] */ __RPC__out long *plVector) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Vector( - /* [in] */ long lVector) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Affinity( - /* [retval][out] */ __RPC__out long *plAffinity) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Affinity( - /* [in] */ long lAffinity) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescInterruptVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescInterrupt * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescInterrupt * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescInterrupt * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescInterrupt * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Level )( - __RPC__in IDSFResDescInterrupt * This, - /* [retval][out] */ __RPC__out long *plLevel); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Level )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ long lLevel); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Vector )( - __RPC__in IDSFResDescInterrupt * This, - /* [retval][out] */ __RPC__out long *plVector); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Vector )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ long lVector); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Affinity )( - __RPC__in IDSFResDescInterrupt * This, - /* [retval][out] */ __RPC__out long *plAffinity); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Affinity )( - __RPC__in IDSFResDescInterrupt * This, - /* [in] */ long lAffinity); - - END_INTERFACE - } IDSFResDescInterruptVtbl; - - interface IDSFResDescInterrupt - { - CONST_VTBL struct IDSFResDescInterruptVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescInterrupt_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescInterrupt_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescInterrupt_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescInterrupt_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescInterrupt_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescInterrupt_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescInterrupt_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescInterrupt_get_Level(This,plLevel) \ - ( (This)->lpVtbl -> get_Level(This,plLevel) ) - -#define IDSFResDescInterrupt_put_Level(This,lLevel) \ - ( (This)->lpVtbl -> put_Level(This,lLevel) ) - -#define IDSFResDescInterrupt_get_Vector(This,plVector) \ - ( (This)->lpVtbl -> get_Vector(This,plVector) ) - -#define IDSFResDescInterrupt_put_Vector(This,lVector) \ - ( (This)->lpVtbl -> put_Vector(This,lVector) ) - -#define IDSFResDescInterrupt_get_Affinity(This,plAffinity) \ - ( (This)->lpVtbl -> get_Affinity(This,plAffinity) ) - -#define IDSFResDescInterrupt_put_Affinity(This,lAffinity) \ - ( (This)->lpVtbl -> put_Affinity(This,lAffinity) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescInterrupt_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescInterrupt; - -#ifdef __cplusplus - -class DECLSPEC_UUID("B68DF23C-9DB6-4C0A-B927-94F0AFE080C4") -DSFResDescInterrupt; -#endif - -#ifndef __IDSFResDescMemory_INTERFACE_DEFINED__ -#define __IDSFResDescMemory_INTERFACE_DEFINED__ - -/* interface IDSFResDescMemory */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescMemory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("48ADC411-19EE-4E06-9772-882B487BB8C0") - IDSFResDescMemory : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_StartLow( - /* [retval][out] */ __RPC__out long *plStartLow) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_StartLow( - /* [in] */ long lStartLow) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_StartHigh( - /* [retval][out] */ __RPC__out long *plStartHigh) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_StartHigh( - /* [in] */ long lStartHigh) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out long *plLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ long lLength) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescMemoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescMemory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescMemory * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescMemory * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescMemory * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_StartLow )( - __RPC__in IDSFResDescMemory * This, - /* [retval][out] */ __RPC__out long *plStartLow); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_StartLow )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ long lStartLow); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_StartHigh )( - __RPC__in IDSFResDescMemory * This, - /* [retval][out] */ __RPC__out long *plStartHigh); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_StartHigh )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ long lStartHigh); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in IDSFResDescMemory * This, - /* [retval][out] */ __RPC__out long *plLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in IDSFResDescMemory * This, - /* [in] */ long lLength); - - END_INTERFACE - } IDSFResDescMemoryVtbl; - - interface IDSFResDescMemory - { - CONST_VTBL struct IDSFResDescMemoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescMemory_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescMemory_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescMemory_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescMemory_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescMemory_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescMemory_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescMemory_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescMemory_get_StartLow(This,plStartLow) \ - ( (This)->lpVtbl -> get_StartLow(This,plStartLow) ) - -#define IDSFResDescMemory_put_StartLow(This,lStartLow) \ - ( (This)->lpVtbl -> put_StartLow(This,lStartLow) ) - -#define IDSFResDescMemory_get_StartHigh(This,plStartHigh) \ - ( (This)->lpVtbl -> get_StartHigh(This,plStartHigh) ) - -#define IDSFResDescMemory_put_StartHigh(This,lStartHigh) \ - ( (This)->lpVtbl -> put_StartHigh(This,lStartHigh) ) - -#define IDSFResDescMemory_get_Length(This,plLength) \ - ( (This)->lpVtbl -> get_Length(This,plLength) ) - -#define IDSFResDescMemory_put_Length(This,lLength) \ - ( (This)->lpVtbl -> put_Length(This,lLength) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescMemory_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescMemory; - -#ifdef __cplusplus - -class DECLSPEC_UUID("FDB94131-E0D2-41E7-A43F-72258F098281") -DSFResDescMemory; -#endif - -#ifndef __IDSFResDescDMA_INTERFACE_DEFINED__ -#define __IDSFResDescDMA_INTERFACE_DEFINED__ - -/* interface IDSFResDescDMA */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFResDescDMA; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9DA9B4D3-C73F-42B8-8CA2-0E5E3FF7198E") - IDSFResDescDMA : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Channel( - /* [retval][out] */ __RPC__out long *plChannel) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Channel( - /* [in] */ long lChannel) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Port( - /* [retval][out] */ __RPC__out long *plPort) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Port( - /* [in] */ long lPort) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reserved( - /* [retval][out] */ __RPC__out long *plReserved) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Reserved( - /* [in] */ long lReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFResDescDMAVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFResDescDMA * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFResDescDMA * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFResDescDMA * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFResDescDMA * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Channel )( - __RPC__in IDSFResDescDMA * This, - /* [retval][out] */ __RPC__out long *plChannel); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Channel )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ long lChannel); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Port )( - __RPC__in IDSFResDescDMA * This, - /* [retval][out] */ __RPC__out long *plPort); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Port )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ long lPort); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reserved )( - __RPC__in IDSFResDescDMA * This, - /* [retval][out] */ __RPC__out long *plReserved); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Reserved )( - __RPC__in IDSFResDescDMA * This, - /* [in] */ long lReserved); - - END_INTERFACE - } IDSFResDescDMAVtbl; - - interface IDSFResDescDMA - { - CONST_VTBL struct IDSFResDescDMAVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFResDescDMA_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFResDescDMA_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFResDescDMA_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFResDescDMA_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFResDescDMA_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFResDescDMA_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFResDescDMA_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFResDescDMA_get_Channel(This,plChannel) \ - ( (This)->lpVtbl -> get_Channel(This,plChannel) ) - -#define IDSFResDescDMA_put_Channel(This,lChannel) \ - ( (This)->lpVtbl -> put_Channel(This,lChannel) ) - -#define IDSFResDescDMA_get_Port(This,plPort) \ - ( (This)->lpVtbl -> get_Port(This,plPort) ) - -#define IDSFResDescDMA_put_Port(This,lPort) \ - ( (This)->lpVtbl -> put_Port(This,lPort) ) - -#define IDSFResDescDMA_get_Reserved(This,plReserved) \ - ( (This)->lpVtbl -> get_Reserved(This,plReserved) ) - -#define IDSFResDescDMA_put_Reserved(This,lReserved) \ - ( (This)->lpVtbl -> put_Reserved(This,lReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFResDescDMA_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFResDescDMA; - -#ifdef __cplusplus - -class DECLSPEC_UUID("449D593F-EFE0-414E-A5D8-2333B223090E") -DSFResDescDMA; -#endif - -#ifndef __IDSFSystemDevice_INTERFACE_DEFINED__ -#define __IDSFSystemDevice_INTERFACE_DEFINED__ - -/* interface IDSFSystemDevice */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_IDSFSystemDevice; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8041F860-55E4-4709-A96C-FA51EBC8F895") - IDSFSystemDevice : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Address( - /* [retval][out] */ __RPC__out long *plAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Address( - /* [in] */ long lAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_BusNumber( - /* [retval][out] */ __RPC__out long *plBusNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_BusNumber( - /* [in] */ long lBusNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_BusTypeGUID( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGUID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_BusTypeGUID( - /* [in] */ __RPC__in BSTR bstrGUID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Capabilities( - /* [retval][out] */ __RPC__deref_out_opt DSFDeviceCaps **ppDSFDeviceCaps) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Capabilities( - /* [in] */ __RPC__in DSFDeviceCaps *pDSFDeviceCaps) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_Capabilities( - /* [in] */ __RPC__in DSFDeviceCaps *pDSFDeviceCaps) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ClassGUID( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGUID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ClassGUID( - /* [in] */ __RPC__in BSTR bstrGUID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ClassName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ClassName( - /* [in] */ __RPC__in BSTR bstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_CompatibleIDs( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaIDs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_CompatibleIDs( - /* [in] */ __RPC__in SAFEARRAY * psaIDs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceDescription( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDescription) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceDescription( - /* [in] */ __RPC__in BSTR bstrDescription) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceID( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceID( - /* [in] */ __RPC__in BSTR bstrID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DriverKeyName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrKeyName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DriverKeyName( - /* [in] */ __RPC__in BSTR bstrKeyName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_EnumeratorName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_EnumeratorName( - /* [in] */ __RPC__in BSTR bstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_FriendlyName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_FriendlyName( - /* [in] */ __RPC__in BSTR bstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HardwareIDs( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaIDs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HardwareIDs( - /* [in] */ __RPC__in SAFEARRAY * psaIDs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InstanceID( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InstanceID( - /* [in] */ __RPC__in BSTR bstrID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LegacyBusType( - /* [retval][out] */ __RPC__out DSFInterfaceType *pBusType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LegacyBusType( - /* [in] */ DSFInterfaceType BusType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LocationInfo( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrInfo) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LocationInfo( - /* [in] */ __RPC__in BSTR bstrInfo) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Manufacturer( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Manufacturer( - /* [in] */ __RPC__in BSTR bstrName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PDOName( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrPDOName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_PDOName( - /* [in] */ __RPC__in BSTR bstrPDOName) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_RawResources( - /* [retval][out] */ __RPC__deref_out_opt DSFResourceList **ppDSFResourceList) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_RawResources( - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_RawResources( - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_UINumber( - /* [retval][out] */ __RPC__out long *plNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_UINumber( - /* [in] */ long lNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_XlatedResources( - /* [retval][out] */ __RPC__deref_out_opt DSFResourceList **ppDSFResourceList) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_XlatedResources( - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_XlatedResources( - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFSystemDeviceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFSystemDevice * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFSystemDevice * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDSFSystemDevice * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDSFSystemDevice * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Address )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__out long *plAddress); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Address )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ long lAddress); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_BusNumber )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__out long *plBusNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_BusNumber )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ long lBusNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_BusTypeGUID )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGUID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_BusTypeGUID )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrGUID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Capabilities )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFDeviceCaps **ppDSFDeviceCaps); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Capabilities )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFDeviceCaps *pDSFDeviceCaps); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_Capabilities )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFDeviceCaps *pDSFDeviceCaps); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ClassGUID )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrGUID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ClassGUID )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrGUID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ClassName )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ClassName )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_CompatibleIDs )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaIDs); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_CompatibleIDs )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in SAFEARRAY * psaIDs); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceDescription )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDescription); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceDescription )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrDescription); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceID )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceID )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DriverKeyName )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrKeyName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DriverKeyName )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrKeyName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_EnumeratorName )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_EnumeratorName )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_FriendlyName )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_FriendlyName )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HardwareIDs )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaIDs); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HardwareIDs )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in SAFEARRAY * psaIDs); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InstanceID )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InstanceID )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LegacyBusType )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__out DSFInterfaceType *pBusType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LegacyBusType )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ DSFInterfaceType BusType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LocationInfo )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrInfo); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LocationInfo )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrInfo); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Manufacturer )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Manufacturer )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PDOName )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrPDOName); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_PDOName )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in BSTR bstrPDOName); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_RawResources )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFResourceList **ppDSFResourceList); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_RawResources )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_RawResources )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_UINumber )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__out long *plNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_UINumber )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ long lNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_XlatedResources )( - __RPC__in IDSFSystemDevice * This, - /* [retval][out] */ __RPC__deref_out_opt DSFResourceList **ppDSFResourceList); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_XlatedResources )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_XlatedResources )( - __RPC__in IDSFSystemDevice * This, - /* [in] */ __RPC__in DSFResourceList *pDSFResourceList); - - END_INTERFACE - } IDSFSystemDeviceVtbl; - - interface IDSFSystemDevice - { - CONST_VTBL struct IDSFSystemDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFSystemDevice_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFSystemDevice_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFSystemDevice_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFSystemDevice_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDSFSystemDevice_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDSFSystemDevice_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDSFSystemDevice_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDSFSystemDevice_get_Address(This,plAddress) \ - ( (This)->lpVtbl -> get_Address(This,plAddress) ) - -#define IDSFSystemDevice_put_Address(This,lAddress) \ - ( (This)->lpVtbl -> put_Address(This,lAddress) ) - -#define IDSFSystemDevice_get_BusNumber(This,plBusNumber) \ - ( (This)->lpVtbl -> get_BusNumber(This,plBusNumber) ) - -#define IDSFSystemDevice_put_BusNumber(This,lBusNumber) \ - ( (This)->lpVtbl -> put_BusNumber(This,lBusNumber) ) - -#define IDSFSystemDevice_get_BusTypeGUID(This,pbstrGUID) \ - ( (This)->lpVtbl -> get_BusTypeGUID(This,pbstrGUID) ) - -#define IDSFSystemDevice_put_BusTypeGUID(This,bstrGUID) \ - ( (This)->lpVtbl -> put_BusTypeGUID(This,bstrGUID) ) - -#define IDSFSystemDevice_get_Capabilities(This,ppDSFDeviceCaps) \ - ( (This)->lpVtbl -> get_Capabilities(This,ppDSFDeviceCaps) ) - -#define IDSFSystemDevice_put_Capabilities(This,pDSFDeviceCaps) \ - ( (This)->lpVtbl -> put_Capabilities(This,pDSFDeviceCaps) ) - -#define IDSFSystemDevice_putref_Capabilities(This,pDSFDeviceCaps) \ - ( (This)->lpVtbl -> putref_Capabilities(This,pDSFDeviceCaps) ) - -#define IDSFSystemDevice_get_ClassGUID(This,pbstrGUID) \ - ( (This)->lpVtbl -> get_ClassGUID(This,pbstrGUID) ) - -#define IDSFSystemDevice_put_ClassGUID(This,bstrGUID) \ - ( (This)->lpVtbl -> put_ClassGUID(This,bstrGUID) ) - -#define IDSFSystemDevice_get_ClassName(This,pbstrName) \ - ( (This)->lpVtbl -> get_ClassName(This,pbstrName) ) - -#define IDSFSystemDevice_put_ClassName(This,bstrName) \ - ( (This)->lpVtbl -> put_ClassName(This,bstrName) ) - -#define IDSFSystemDevice_get_CompatibleIDs(This,ppsaIDs) \ - ( (This)->lpVtbl -> get_CompatibleIDs(This,ppsaIDs) ) - -#define IDSFSystemDevice_put_CompatibleIDs(This,psaIDs) \ - ( (This)->lpVtbl -> put_CompatibleIDs(This,psaIDs) ) - -#define IDSFSystemDevice_get_DeviceDescription(This,pbstrDescription) \ - ( (This)->lpVtbl -> get_DeviceDescription(This,pbstrDescription) ) - -#define IDSFSystemDevice_put_DeviceDescription(This,bstrDescription) \ - ( (This)->lpVtbl -> put_DeviceDescription(This,bstrDescription) ) - -#define IDSFSystemDevice_get_DeviceID(This,pbstrID) \ - ( (This)->lpVtbl -> get_DeviceID(This,pbstrID) ) - -#define IDSFSystemDevice_put_DeviceID(This,bstrID) \ - ( (This)->lpVtbl -> put_DeviceID(This,bstrID) ) - -#define IDSFSystemDevice_get_DriverKeyName(This,pbstrKeyName) \ - ( (This)->lpVtbl -> get_DriverKeyName(This,pbstrKeyName) ) - -#define IDSFSystemDevice_put_DriverKeyName(This,bstrKeyName) \ - ( (This)->lpVtbl -> put_DriverKeyName(This,bstrKeyName) ) - -#define IDSFSystemDevice_get_EnumeratorName(This,pbstrName) \ - ( (This)->lpVtbl -> get_EnumeratorName(This,pbstrName) ) - -#define IDSFSystemDevice_put_EnumeratorName(This,bstrName) \ - ( (This)->lpVtbl -> put_EnumeratorName(This,bstrName) ) - -#define IDSFSystemDevice_get_FriendlyName(This,pbstrName) \ - ( (This)->lpVtbl -> get_FriendlyName(This,pbstrName) ) - -#define IDSFSystemDevice_put_FriendlyName(This,bstrName) \ - ( (This)->lpVtbl -> put_FriendlyName(This,bstrName) ) - -#define IDSFSystemDevice_get_HardwareIDs(This,ppsaIDs) \ - ( (This)->lpVtbl -> get_HardwareIDs(This,ppsaIDs) ) - -#define IDSFSystemDevice_put_HardwareIDs(This,psaIDs) \ - ( (This)->lpVtbl -> put_HardwareIDs(This,psaIDs) ) - -#define IDSFSystemDevice_get_InstanceID(This,pbstrID) \ - ( (This)->lpVtbl -> get_InstanceID(This,pbstrID) ) - -#define IDSFSystemDevice_put_InstanceID(This,bstrID) \ - ( (This)->lpVtbl -> put_InstanceID(This,bstrID) ) - -#define IDSFSystemDevice_get_LegacyBusType(This,pBusType) \ - ( (This)->lpVtbl -> get_LegacyBusType(This,pBusType) ) - -#define IDSFSystemDevice_put_LegacyBusType(This,BusType) \ - ( (This)->lpVtbl -> put_LegacyBusType(This,BusType) ) - -#define IDSFSystemDevice_get_LocationInfo(This,pbstrInfo) \ - ( (This)->lpVtbl -> get_LocationInfo(This,pbstrInfo) ) - -#define IDSFSystemDevice_put_LocationInfo(This,bstrInfo) \ - ( (This)->lpVtbl -> put_LocationInfo(This,bstrInfo) ) - -#define IDSFSystemDevice_get_Manufacturer(This,pbstrName) \ - ( (This)->lpVtbl -> get_Manufacturer(This,pbstrName) ) - -#define IDSFSystemDevice_put_Manufacturer(This,bstrName) \ - ( (This)->lpVtbl -> put_Manufacturer(This,bstrName) ) - -#define IDSFSystemDevice_get_PDOName(This,pbstrPDOName) \ - ( (This)->lpVtbl -> get_PDOName(This,pbstrPDOName) ) - -#define IDSFSystemDevice_put_PDOName(This,bstrPDOName) \ - ( (This)->lpVtbl -> put_PDOName(This,bstrPDOName) ) - -#define IDSFSystemDevice_get_RawResources(This,ppDSFResourceList) \ - ( (This)->lpVtbl -> get_RawResources(This,ppDSFResourceList) ) - -#define IDSFSystemDevice_put_RawResources(This,pDSFResourceList) \ - ( (This)->lpVtbl -> put_RawResources(This,pDSFResourceList) ) - -#define IDSFSystemDevice_putref_RawResources(This,pDSFResourceList) \ - ( (This)->lpVtbl -> putref_RawResources(This,pDSFResourceList) ) - -#define IDSFSystemDevice_get_UINumber(This,plNumber) \ - ( (This)->lpVtbl -> get_UINumber(This,plNumber) ) - -#define IDSFSystemDevice_put_UINumber(This,lNumber) \ - ( (This)->lpVtbl -> put_UINumber(This,lNumber) ) - -#define IDSFSystemDevice_get_XlatedResources(This,ppDSFResourceList) \ - ( (This)->lpVtbl -> get_XlatedResources(This,ppDSFResourceList) ) - -#define IDSFSystemDevice_put_XlatedResources(This,pDSFResourceList) \ - ( (This)->lpVtbl -> put_XlatedResources(This,pDSFResourceList) ) - -#define IDSFSystemDevice_putref_XlatedResources(This,pDSFResourceList) \ - ( (This)->lpVtbl -> putref_XlatedResources(This,pDSFResourceList) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFSystemDevice_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFSystemDevice; - -#ifdef __cplusplus - -class DECLSPEC_UUID("1AE675C7-9C3D-429c-94C9-137A00246470") -DSFSystemDevice; -#endif - -EXTERN_C const CLSID CLSID_DSFDevice; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8B6626F7-F57B-4C47-AE2F-4813FB4D40D6") -DSFDevice; -#endif - -EXTERN_C const CLSID CLSID_DSF; - -#ifdef __cplusplus - -class DECLSPEC_UUID("44DD6DC0-6427-4C02-8D5C-1179C50C65D7") -DSF; -#endif - -EXTERN_C const CLSID CLSID_DSFDevices; - -#ifdef __cplusplus - -class DECLSPEC_UUID("60FA4E76-ED77-4458-ABCF-56E23113FE61") -DSFDevices; -#endif - -EXTERN_C const CLSID CLSID_DSFDeviceCaps; - -#ifdef __cplusplus - -class DECLSPEC_UUID("26FF1048-7125-45F8-ACA8-F13C5E883ED1") -DSFDeviceCaps; -#endif - -EXTERN_C const CLSID CLSID_DSFLog; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A880A214-56A0-426A-844A-7AACCF7C3641") -DSFLog; -#endif - -EXTERN_C const CLSID CLSID_DSFVersion; - -#ifdef __cplusplus - -class DECLSPEC_UUID("9B89C450-8E7C-4B02-B4A0-B581A9999B47") -DSFVersion; -#endif - -EXTERN_C const CLSID CLSID_DSFPropertyBag; - -#ifdef __cplusplus - -class DECLSPEC_UUID("c283c5ec-4ba5-46ec-9efc-e9f1bffe7c70") -DSFPropertyBag; -#endif - -#ifndef __IDSFDebug_INTERFACE_DEFINED__ -#define __IDSFDebug_INTERFACE_DEFINED__ - -/* interface IDSFDebug */ -/* [object][helpstringcontext][helpcontext][helpstring][uuid] */ - - -EXTERN_C const IID IID_IDSFDebug; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("69b999b5-1f70-418b-83ac-900a289a07f9") - IDSFDebug : public IUnknown - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall SetObjectFlags( - /* [in] */ DSFFlagType FlagType, - /* [in] */ unsigned long Flags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFDebugVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFDebug * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFDebug * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFDebug * This); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *SetObjectFlags )( - __RPC__in IDSFDebug * This, - /* [in] */ DSFFlagType FlagType, - /* [in] */ unsigned long Flags); - - END_INTERFACE - } IDSFDebugVtbl; - - interface IDSFDebug - { - CONST_VTBL struct IDSFDebugVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFDebug_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFDebug_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFDebug_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFDebug_SetObjectFlags(This,FlagType,Flags) \ - ( (This)->lpVtbl -> SetObjectFlags(This,FlagType,Flags) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFDebug_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DSFDebug; - -#ifdef __cplusplus - -class DECLSPEC_UUID("f6d08a7f-ef55-406b-be39-2fe6f613ef3d") -DSFDebug; -#endif - -EXTERN_C const CLSID CLSID_DSFBus; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0DEF0513-18CE-4AA4-8C7C-70D37206B4F7") -DSFBus; -#endif - -#ifndef __IDSFPersist_INTERFACE_DEFINED__ -#define __IDSFPersist_INTERFACE_DEFINED__ - -/* interface IDSFPersist */ -/* [object][helpstringcontext][helpcontext][helpstring][uuid] */ - - -EXTERN_C const IID IID_IDSFPersist; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("66CBAEEA-2F16-4685-AC93-71CC713E6A6A") - IDSFPersist : public IUnknown - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall get_DSFDevice( - /* [retval][out] */ __RPC__deref_out_opt IDSFDevice **ppiDSFDevice) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDSFPersistVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDSFPersist * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDSFPersist * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDSFPersist * This); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *get_DSFDevice )( - __RPC__in IDSFPersist * This, - /* [retval][out] */ __RPC__deref_out_opt IDSFDevice **ppiDSFDevice); - - END_INTERFACE - } IDSFPersistVtbl; - - interface IDSFPersist - { - CONST_VTBL struct IDSFPersistVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDSFPersist_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDSFPersist_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDSFPersist_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDSFPersist_get_DSFDevice(This,ppiDSFDevice) \ - ( (This)->lpVtbl -> get_DSFDevice(This,ppiDSFDevice) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDSFPersist_INTERFACE_DEFINED__ */ - -#endif /* __DSF_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/dsm.h b/qt-correction-tool/pub/ddk/dsm.h deleted file mode 100644 index 29ee8e2..0000000 --- a/qt-correction-tool/pub/ddk/dsm.h +++ /dev/null @@ -1,1612 +0,0 @@ -/*++ - -Copyright (c) 1999 - 2001 Microsoft Corporation - -Module Name: - - dsm.h - -Abstract: - - This file defines the interface between Multipath Device-Specific drivers and the - Main Multipath driver. - -Author: - -Notes: - -Revision History: - ---*/ - -#ifndef _DSM_H_ -#define _DSM_H_ - -#include -#include -#include -#include -#include -#include -#include - -#pragma warning(disable:4201) // bit field types - -// -// List of DSM Identifiers passed to several -// of the dsm entry-points. -// -typedef struct _DSM_IDS { - - // - // Number of ID's in the List. - // - ULONG Count; - - // - // Array of DsmIdentiifiers - // - PVOID IdList[1]; -} DSM_IDS, *PDSM_IDS; - -#if (NTDDI_VERSION >= NTDDI_WS08) // For Server 2008 and later. -// -// Structures for SCSI pass through and SCSI pass through direct. -// -// IA64 requires 8-byte alignment for pointers, -// but the IA64 NT kernel expects 16-byte alignment -// -#ifdef _WIN64 - #define PTRALIGN DECLSPEC_ALIGN(16) -#else - #define PTRALIGN DECLSPEC_ALIGN(4) -#endif - -#define SPTWB_SENSE_LENGTH 32 -#define SPTWB_DATA_LENGTH 512 - -typedef struct _SCSI_PASS_THROUGH_WITH_BUFFERS { - SCSI_PASS_THROUGH ScsiPassThrough; - PTRALIGN UCHAR SenseInfoBuffer[SPTWB_SENSE_LENGTH]; - PTRALIGN UCHAR DataBuffer[SPTWB_DATA_LENGTH]; -} SCSI_PASS_THROUGH_WITH_BUFFERS, *PSCSI_PASS_THROUGH_WITH_BUFFERS; - -typedef struct _SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER { - SCSI_PASS_THROUGH_DIRECT ScsiPassThroughDirect; - PTRALIGN UCHAR SenseInfoBuffer[SPTWB_SENSE_LENGTH]; -} SCSI_PASS_THROUGH_DIRECT_WITH_BUFFER, *PSCSI_PASS_THROUGH_DIRECT_WITH_BUFFER; - -#endif // (NTDDI_VERSION >= NTDDI_WS08) - -// -// Identification and initialization routines (other than DSM registration with MPCTL.sys) -// -typedef -NTSTATUS -(*DSM_INQUIRE_DRIVER) ( - __in IN PVOID DsmContext, - __in IN PDEVICE_OBJECT TargetDevice, - __in IN PDEVICE_OBJECT PortFdo, - __in IN PSTORAGE_DEVICE_DESCRIPTOR Descriptor, - __in IN PSTORAGE_DEVICE_ID_DESCRIPTOR DeviceIdList, - __out OUT PVOID *DsmIdentifier - ); -/*++ - -Routine Description: - - This routine is used to determine if TargetDevice belongs to the DSM. - If the device is owned by the driver, then DsmIdentifier will be updated with a - DSM-derived value. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - TargetDevice - DeviceObject for the child device. - PortFdo - The Port driver FDO on which TargetDevice resides. - Descriptor - Pointer the device descriptor corresponding to TargetDevice. Rehash of inquiry - data, plus serial number information (if applicable). - DeviceIdList - VPD Page 0x83 information. - DsmIdentifier - Pointer to be filled in by the DSM on success. - -Return Value: - - STATUS_SUCCESS and a DsmIdentifier if the DSM supports this device. - Otherwise a NULL Identifier and the appropriate NTSTATUS value (SUCCESS or other). - ---*/ - -typedef -BOOLEAN -(*DSM_COMPARE_DEVICES) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId1, - __in IN PVOID DsmId2 - ); -/*++ - -Routine Description: - - This routine is called to determine if the device ids represent the same underlying - physical device. - Additional ids (more than 2) can be tested by repeatedly calling this function. - It is the DSM responsibility to keep the necessary information to identify the device(s). - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId1/2 - Identifers returned from DMS_INQUIRE_DRIVER. - -Return Value: - - TRUE if DsmIds correspond to the same underlying device. - ---*/ - -// -// This controller is active. -// -#define DSM_CONTROLLER_ACTIVE 0x00000001 -// -// This controller is a stand-by controller. -// -#define DSM_CONTROLLER_STANDBY 0x00000002 -// -// This controller has failed. -// -#define DSM_CONTROLLER_FAILED 0x00000003 -// -// There are no controllers (JBOD, for example) -// -#define DSM_CONTROLLER_NO_CNTRL 0x00000004 - -typedef struct _CONTROLLER_IDS { - - // - // Defined in ntddstor.h - // - STORAGE_IDENTIFIER_CODE_SET Type; - - // - // Length, in bytes, or the 'Serial Number'. - // - ULONG Length; - UCHAR SerialNumber[32]; -} CONTROLLER_IDS, *PCONTROLLER_IDS; - -typedef struct _CONTROLLER_INFO { - // - // The device object of the controller. - // Retrieved by DsmGetAssociatedDevices. - // - PDEVICE_OBJECT DeviceObject; - - // - // Ascii/Binary identifier. WWN, for example. - // - CONTROLLER_IDS Identifier; - - // - // Controller state. See above. - // - ULONG State; -} CONTROLLER_INFO, *PCONTROLLER_INFO; - -// -// Informs the DSM that ControllerInfo must be allocated. -// -#define DSM_CNTRL_FLAGS_ALLOCATE 0x00000001 - -// -// ControllerInfo is valid. The DSM should update 'State'. -// -#define DSM_CNTRL_FLAGS_CHECK_STATE 0x00000002 - -// -// Possible future expansion. -// -#define DSM_CNTRL_FLAGS_RESERVED 0xFFFFFFFC - -typedef -NTSTATUS -(*DSM_GET_CONTROLLER_INFO) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN ULONG Flags, - __inout IN OUT PCONTROLLER_INFO *ControllerInfo - ); -/*++ - -Routine Description: - - This routine is used to get information about the controller that the device - corresponding to DsmId in on. - The Dsm shall allocate the necessary memory for the buffer (mpio has the responsibility - to free it) and fill in the information. - If the DSM controls hardware that uses no controllers, set State to NO_CNTRL. - This information is used mainly by whatever WMI admin. utilities want if. - - This routine will be called initially after SetDeviceInfo, but also to retrieve - the controller's state when an WMI request is received, after a fail-over/fail-back, etc. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId - Identifer returned from DMS_INQUIRE_DRIVER. - Flags - Bitfield of modifiers. If ALLOCATE is not set, ControllerInfo will have - a valid buffer for the DSM to operate on. - ControllerInfo - Pointer for the DSM to place the allocated controller info - pertaining to DsmId - - -Return Value: - - NTSTATUS - ---*/ - - -typedef -PUCHAR -(*DSM_DEVICE_SERIAL_NUMBER) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId - ); -/*++ - -Routine Description: - - This OPTIONAL routine is used to retrieve a serial number for the device represented - by DsmId. It is only called when the device doesn't support VPD pages 0x80 or 0x83. - The buffer returned should be a null-terminated ascii string. MPIO is responsible for - freeing this buffer and the DSM should not assume it's valid anytime after returning. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId - Value returned from DMSInquireDriver. - -Return Value: - - Serial number string. - ---*/ - -typedef -NTSTATUS -(*DSM_SET_DEVICE_INFO) ( - __in IN PVOID DsmContext, - __in IN PDEVICE_OBJECT TargetObject, - __in IN PVOID DsmId, - __inout IN OUT PVOID *PathId - ); -/*++ - -Routine Description: - - This routine associates a returned DsmId to the controlling MPDisk PDO - the targetObject for DSM-initiated requests, and to a Path (given by PathId). - The Path ID is a unique per-path value and will be the same value for ALL devices that - are on the same physical path. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - TargetObject - The D.O. to which DSM-initiated requests should be sent. - This is the Filter D.O. over the port PDO. - DsmId - Value returned from DMSInquireDriver. - PathId - Id that represents the path. The value passed in may be used as is, or the DSM - optionally can update it if it requires additional state info to be kept. - - -Return Value: - - DSM should return SUCCESS. Other errors may be returned in event of failed - allocations, etc. These other errors are fatal. - ---*/ - -typedef -BOOLEAN -(*DSM_IS_PATH_ACTIVE) ( - __in IN PVOID DsmContext, - __in IN PVOID PathId, - __in IN PVOID DsmId - ); -/*++ - -Routine Description: - - This routine is used to determine whether the path to DsmId is active - (ie. able to handle requests without a failover). - NOTE: This is used by the main module to determine load balance groups. If multiple - paths are active to the same device then it is considered that requests can be - submitted freely to ALL active paths, though the DSM is the determinator for path - selection. - - In addition, after a failover, the path validity will be queried. If the path error - was transitory and the DSM feels that the path is good, then this request will be - re-issued to determine it's ACTIVE/PASSIVE state. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - PathId - Value set in SetDeviceInfo - DsmId - Device Identifier returned from DsmInquire. - -Return Value: - - TRUE - if path is active. Otherwise, FALSE. - ---*/ - - - -// -// Error Handling, Failover and recovery routines. -// -// When a fatal error occurs, the Path is invalidated and a new one -// selected. -// After the fail-over is complete, mpctl will invoke the DSM's Recovery routine -// (if one is specified). Once the error has been dealt with, the DSM should notify -// mpctl of the success of the operation. -// PathVerify will be called with each DsmId that was on the path. -// If this is successful, ReenablePath is invoked to allow the DSM any final preperations -// before considering the path normal. -// IsActive is called to build the load-balance associations. -// -#define DSM_FATAL_ERROR 0x80000000 -#define DSM_RETRY_DONT_DECREMENT 0x00008000 -#define DSM_ADMIN_FO 0x40000000 -#define DSM_FATAL_ERROR_OEM_MASK 0x0000FFFF -#define DSM_FATAL_ERROR_RESERVED 0x3FFF0000 - -typedef -ULONG -(*DSM_INTERPRET_ERROR) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN PSCSI_REQUEST_BLOCK Srb, - __inout IN OUT PNTSTATUS Status, - __out OUT PBOOLEAN Retry - ); -/*++ - -Routine Description: - - This routine informs the DSM that Srb has an error indicated with Srb->SrbStatus and/or Status. - IF Srb->SrbFlags & SRB_FLAGS_AUTOSENSE_VALID is set, sense data will be available. - - The DSM should examine these, carry out any vendor-unique activities and update Retry and Status - (if applicable). A determination should be made whether these errors constitute a fail over. - Setting the high-bit of the return value indicates a fatal error. The DSM may additionally - set any of the bits in the lower USHORT to facilitate information passing between this and - the InvalidatePath routine. - The Multipath driver (mpctl) will not override these return values. - -Arguments: - - DsmId - Identifers returned from DMS_INQUIRE_DRIVER. - Srb - The Srb with an error. - Status - NTSTATUS of the operation. Can be updated. - Retry - Allows the DSM to indicate whether to retry the IO. - -Return Value: - - Setting DSM_FATAL_ERROR indicates a fatal error. DSM-specific info. can be kept in - the lower WORD, which will be passed to InvalidatePath. - ---*/ - -typedef -ULONG -(*DSM_INTERPRET_ERROR_EX) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN PSCSI_REQUEST_BLOCK Srb, - __inout IN OUT PNTSTATUS Status, - __out OUT PBOOLEAN Retry, - __out OUT PLONG RetryInterval, - ... - ); -/*++ - -Routine Description: - - This routine informs the DSM that Srb has an error indicated with Srb->SrbStatus and/or Status. - IF Srb->SrbFlags & SRB_FLAGS_AUTOSENSE_VALID is set, sense data will be available. - - The DSM should examine these, carry out any vendor-unique activities and update Retry and Status - (if applicable). A determination should be made whether these errors constitute a fail over. - Setting the high-bit of the return value indicates a fatal error. The DSM may additionally - set any of the bits in the lower USHORT to facilitate information passing between this and - the InvalidatePath routine. - The Multipath driver (mpctl) will not override these return values. - -Arguments: - - DsmId - Identifers returned from DMS_INQUIRE_DRIVER. - Srb - The Srb with an error. - Status - NTSTATUS of the operation. Can be updated. - Retry - Allows the DSM to indicate whether to retry the IO. - RetryInterval - Lets DSM specify (in seconds) when this specific I/O should be - retried. Use MAXLONG to use the default retry interval. - Use zero to retry immediately. MPIO will set to MAXLONG - before calling the DSM. - -Return Value: - - Setting DSM_FATAL_ERROR indicates a fatal error. DSM-specific info. can be kept in - the lower WORD, which will be passed to InvalidatePath. - ---*/ - - -typedef -NTSTATUS -(*DSM_INVALIDATE_PATH) ( - __in IN PVOID DsmContext, - __in IN ULONG ErrorMask, - __in IN PVOID PathId, - __inout IN OUT PVOID *NewPathId - ); -/*++ - -Routine Description: - - This routine invalidates the given path and assigns the devices to the new path. - NewPath is set to either an existing path or if all paths are dead, NULL. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - ErrorMask - Value returned from InterpretError. - PathId - The failing path. - NewPathId - Pointer to the new path. - -Return Value: - - NTSTATUS of the operation. - ---*/ - -typedef -NTSTATUS -(*DSM_PATH_VERIFY) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN PVOID PathId - ); -/*++ - -Routine Description: - - This routine is polled at a configurable interval and is used to determine the - health of the device indicated by DsmId on PathId. The DSM makes the determination of - validity using supplied library functions, or by issuing vendor-unique commands. - - After a fail-over condition has been dealt with, this is used as part of the fail-back - mechanism. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId - Value returned from DMSInquireDriver. - PathId - Value set in SetPathId. - -Return Value: - - NTSTATUS ---*/ - - -// -// PERMANENT indicates that SuggestedPath should be the device's preferred path. -// PENDING_REMOVAL indicates that the path is about to go away. -// OEM_MASK values specific to the DSM -// RESERVED future expansion -// ADMIN_REQUEST indicates that the request originated from some user-mode utility. -// -#define DSM_MOVE_PERMANENT 0x00000001 -#define DSM_MOVE_PENDING_REMOVAL 0x00000002 -#define DSM_MOVE_OEM_MASK 0x0000FF00 -#define DSM_MOVE_RESERVED 0x7FFF0000 -#define DSM_MOVE_ADMIN_REQUEST 0x80000000 - -typedef -NTSTATUS -(*DSM_MOVE_DEVICE) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PVOID MPIOPath, - __in IN PVOID SuggestedPath, - __in IN ULONG Flags - ); -/*++ - -Routine Description: - - This routine is invoked (usually) in response to an administrative request. - The DSM will associate the Device described by DsmId to the SuggestedPath, or may - select another available. As this request will usually be followed by an adapter - removal, or can be used to set-up static load-balancing. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmIds - The collection of DSM IDs that pertain to the MPDisk. - MPIOPath - The original path value passed to SetDeviceInfo. - SuggestedPath - The path which should become the active path. - Flags - Bitmask indicating the intent of the move. - -Return Value: - - NTSTATUS - STATUS_SUCCESS, some error status if there are no good alternate paths. - ---*/ - -typedef -NTSTATUS -(*DSM_REMOVE_PENDING) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId - ); -/*++ - -Routine Description: - - This routine indicates that the device represented by DsmId will be removed, though - due to outstanding I/Os or other conditions, it can't be removed immediately. - The DSM_ID list passed to other functions will no longer contain DsmId, so internal - structures should be updated accordingly. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId - Value referring to the failed device. - -Return Value: - - NTSTATUS of the operation. - ---*/ - - -typedef -NTSTATUS -(*DSM_REMOVE_DEVICE) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN PVOID PathId - ); -/*++ - -Routine Description: - - This routine indicates that the main path has determined or been notified that thedevice - has failed and should be removed from PathId. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - DsmId - Value referring to the failed device. - PathId - The path on which the Device lives. - -Return Value: - - NTSTATUS of the operation. - ---*/ - -typedef -NTSTATUS -(*DSM_REMOVE_PATH) ( - __in IN PVOID DsmContext, - __in IN PVOID PathId - ); -/*++ - -Routine Description: - - This routine indicates that the path is no longer valid, and that the DSM should update - it's internal state appropriately (tear down the structure, free allocations, ...). - It is the responsibility of mpctl.sys to have already removed the devices (via RemoveDevice) - that are attached to this path. - -Arguments: - - DsmContext - Context value given to the multipath driver during registration. - PathId - The path to remove. - -Return Value: - - NTSTATUS of the operation. - ---*/ - -#define DSM_BROADCAST 0x00000001 -#define DSM_WILL_HANDLE 0x00000002 -#define DSM_PATH_SET 0x00000003 -#define DSM_ERROR 0x00000004 - -// -// IOCTL handling routines. -// -typedef -ULONG -(*DSM_CATEGORIZE_REQUEST) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN PSCSI_REQUEST_BLOCK Srb, - __in IN PVOID CurrentPath, - __deref_out_opt OUT PVOID *PathId, - __out OUT NTSTATUS *Status - ); -/*++ - -Routine Description: - - The routine is called when a request other than R/W is being handled. - The DSM indicates whether the request should be handled by it's DsmBroadcastRequest, - DsmSrbDeviceControl, or that the PathID indicated should be used. - -Arguments: - - DsmIds - The collection of DSM IDs that pertain to the MPDisk. - Irp - The Irp containing Srb. - Srb - Scsi request block - CurrentPath - Path to which last request was sent - PathId - Updated to the PathId where the request should be sent if return value - is DSM_PATH_SET. - Status - Storage for status in the event that DSM_ERROR is returned. - -Return Value: - - DSM_BROADCAST - If BroadcastRequest should be used. - DSM_WILL_HANDLE - If SrbDeviceControl should be used. - DSM_PATH_SET - If the Srb should just be sent to PathId - DSM_ERROR - Indicates that an error occurred where by the request can't be handled. - Status is updated, along with Srb->SrbStatus. - ---*/ - -typedef -NTSTATUS -(*DSM_BROADCAST_SRB) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN PSCSI_REQUEST_BLOCK Srb, - __in IN PKEVENT Event - ); -/*++ - -Routine Description: - - This routine is called when the DSM has indicated that Srb should be sent to the device - down all paths. The DSM will update IoStatus information and status, but not complete the - request. - -Arguments: - - DsmIds - The collection of DSM IDs that pertain to the MPDisk. - Irp - Irp containing SRB. - Srb - Scsi request block - Event - DSM sets this once all sub-requests have completed and the original request's - IoStatus has been setup. - -Return Value: - - NTSTATUS of the operation. - ---*/ - - -typedef -NTSTATUS -(*DSM_SRB_DEVICE_CONTROL) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN PSCSI_REQUEST_BLOCK Srb, - __in IN PKEVENT Event - ); -/*++ - -Routine Description: - - This routine is called when the DSM has indicated that it wants to handle it internally - (via CATEGORIZE_REQUEST). - It should set IoStatus (Status and Information) and the Event, but not complete the request. - -Arguments: - - DsmIds - The collection of DSM IDs that pertain to the MPDISK. - Irp - Irp containing SRB. - Srb - Scsi request block - Event - Event to be set when the DSM is finished if DsmHandled is TRUE - -Return Value: - - NTSTATUS of the request. - ---*/ - -typedef -VOID -(*DSM_COMPLETION_ROUTINE) ( - __in IN PVOID DsmId, - __in IN PIRP Irp, - __in IN PSCSI_REQUEST_BLOCK Srb, - __in IN PVOID DsmContext - ); -/*++ - -Routine Description: - - This routine is called from mpio's completion routine for those requests that - the DSM has indicated that it wants a completion routine (set via SET_COMPLETION). - -Arguments: - - DsmIds - The collection of DSM IDs that pertain to the MPDISK. - Irp - Irp containing SRB. - Srb - Scsi request block - DsmContext - DSM supplied value. - -Return Value: - - NONE - ---*/ - - -typedef struct _DSM_COMPLETION_INFO { - - // - // Routine to be invoked on request completion. - // - DSM_COMPLETION_ROUTINE DsmCompletionRoutine; - - // - // Context to be supplied. - // - PVOID DsmContext; - -} DSM_COMPLETION_INFO, *PDSM_COMPLETION_INFO; - -typedef -VOID -(*DSM_SET_COMPLETION) ( - __in IN PVOID DsmContext, - __in IN PVOID DsmId, - __in IN PIRP Irp, - __in IN PSCSI_REQUEST_BLOCK Srb, - __inout IN OUT PDSM_COMPLETION_INFO DsmCompletion - ); -/*++ - -Routine Description: - - This routine is called before the actual submission of a request, but after the categorisation - of the I/O. This will be called only for those requests not handled by the DSM directly: - Read/Write - Other requests not handled by SrbControl or Broadcast - The DSM can supply a completion routine and context which will be invoked when the - request completion is being handled. It is not necessary to set completions on any or all - requests. - -Arguments: - DsmId - Identifer that was indicated when the request was categorized (or be LBGetPath) - Irp - Irp containing Srb. - Srb - The request - DsmCompletion - Completion info structure to be filled out by DSM. - - -Return Value: - - None - ---*/ - -#define NUMA_MAX_WEIGHT 10 - -typedef -PVOID -(*DSM_LB_GET_PATH) ( - __in IN PVOID DsmContext, - __in IN PSCSI_REQUEST_BLOCK Srb, - __in IN PDSM_IDS DsmList, - __in IN PVOID CurrentPath, - __out OUT NTSTATUS *Status - ); -/*++ - -Routine Description: - - This routine is called once per I/O and gives the DSM the ability to indicate - to which path the request should be submitted. If the DSM returns a Path that was - not active, this constitutes a Fail-over condition. - -Arguments: - - Srb - The request that needs to be submitted - DsmList - Ids of the devices that make up the multipath group. - CurrentPath - Path to which last request was sent - Status - Storage for an error status, if returning NULL path. - -Return Value: - - PathId to where the request should be sent. NULL if all current paths are failed. - ---*/ - -// -// WMI structs, defines, routines. -// - -// DSM Type 1 - -typedef -NTSTATUS -(*DSM_QUERY_DATABLOCK) ( - __in IN PVOID DsmContext, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG InstanceCount, - __inout IN OUT PULONG InstanceLengthArray, - __in IN ULONG BufferAvail, - __out OUT PUCHAR Buffer, - __out OUT PULONG DsmDataLength - ); - -typedef -NTSTATUS -(*DSM_SET_DATABLOCK) ( - __in IN PVOID DsmContext, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG BufferSize, - __in IN PUCHAR Buffer - ); - -typedef -NTSTATUS -(*DSM_EXECUTE_METHOD) ( - __in IN PVOID DsmContext, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG MethodId, - __in IN ULONG InBufferSize, - __in IN PULONG OutBufferSize, - __inout IN OUT PUCHAR Buffer - ); - -typedef -NTSTATUS -(*DSM_FUNCTION_CONTROL) ( - __in IN PVOID DsmContext, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN WMIENABLEDISABLECONTROL Function, - __in IN BOOLEAN Enable - ); - -// DSM Type 2 and newer. - -typedef -NTSTATUS -(*DSM_QUERY_DATABLOCK_EX) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG InstanceCount, - __inout IN OUT PULONG InstanceLengthArray, - __in IN ULONG BufferAvail, - __out OUT PUCHAR Buffer, - __out OUT PULONG DsmDataLength, - ... - ); - -typedef -NTSTATUS -(*DSM_SET_DATABLOCK_EX) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG BufferSize, - __in IN PUCHAR Buffer, - ... - ); - -typedef -NTSTATUS -(*DSM_EXECUTE_METHOD_EX) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN ULONG InstanceIndex, - __in IN ULONG MethodId, - __in IN ULONG InBufferSize, - __in IN PULONG OutBufferSize, - __inout IN OUT PUCHAR Buffer, - ... - ); - -typedef -NTSTATUS -(*DSM_FUNCTION_CONTROL_EX) ( - __in IN PVOID DsmContext, - __in IN PDSM_IDS DsmIds, - __in IN PIRP Irp, - __in IN ULONG GuidIndex, - __in IN WMIENABLEDISABLECONTROL Function, - __in IN BOOLEAN Enable, - ... - ); - -typedef struct _DSM_WMILIB_CONTEXT { - ULONG GuidCount; - PWMIGUIDREGINFO GuidList; - UNICODE_STRING RegistryPath; - UNICODE_STRING MofResourceName; - union { - DSM_QUERY_DATABLOCK QueryWmiDataBlock; - DSM_QUERY_DATABLOCK_EX QueryWmiDataBlockEx; - }; - union { - DSM_SET_DATABLOCK SetWmiDataBlock; - DSM_SET_DATABLOCK_EX SetWmiDataBlockEx; - }; - union { - DSM_EXECUTE_METHOD ExecuteWmiMethod; - DSM_EXECUTE_METHOD_EX ExecuteWmiMethodEx; - }; - union { - DSM_FUNCTION_CONTROL WmiFunctionControl; - DSM_FUNCTION_CONTROL_EX WmiFunctionControlEx; - }; -} DSM_WMILIB_CONTEXT, *PDSM_WMILIB_CONTEXT; - - -// -// Unload routine. -// -typedef -NTSTATUS -(*DSM_UNLOAD) ( - __in IN PVOID DsmContext - ); -/*++ - -Routine Description: - - This routine is called when the main module requires the DSM to be unloaded - (ie. prior to the main module unload). - -Arguments: - - DsmContext - Context value passed to DsmInitialize() - -Return Value: - - NTSTATUS - Had best be STATUS_SUCCESS; - ---*/ - - - -// -// Registration routines. -// -// Called in the DSM's DriverEntry. -// The DSM will register with the main module by filling in the following structure -// and sending the REGISTER IOCTL -// - -// -// DsmTypeUnknown == mustn't be used. -// DsmType1 == first version -// DsmType2 == indicates that DSM uses InterpretErrorEx() and handles WMI calls with -// DSM_IDS passed in as extra parameter -// DsmType3 == indicates that DSM handles the case where its completion routine can be called with NULL DsmId -// DsmType4 == indicates that DSM provides version info -// DsmType5 == indicates that DSM provides additional DSM-centric (global) WMI classes (not used if Server 2008 or earlier) -// DsmType6 == not used -// - -#if (NTDDI_VERSION >= NTDDI_WIN7) // For Server 2008 R2 and later. - -typedef enum _DSM_TYPE { - DsmTypeUnknown = 0, - DsmType1, - DsmType2, - DsmType3, - DsmType4, - DsmType5, - DsmType6 -} DSM_TYPE, *PDSM_TYPE; - -#else // For Server 2008 and earlier. - -typedef enum _DSM_TYPE { - DsmTypeUnknown = 0, - DsmType1, - DsmType2, - DsmType3, - DsmType4, - DsmType5 -} DSM_TYPE, *PDSM_TYPE; - -#endif - -typedef struct _DSM_VERSION_INFO { - ULONG MajorVersion; - ULONG MinorVersion; - ULONG ProductBuild; - ULONG QfeNumber; -} DSM_VERSION_INFO, *PDSM_VERSION_INFO; - -typedef struct _DSM_INIT_DATA { - - // - // Size, in bytes. - // - ULONG InitDataSize; - - // - // DSM entry points. - // - DSM_INQUIRE_DRIVER DsmInquireDriver; - DSM_COMPARE_DEVICES DsmCompareDevices; - DSM_DEVICE_SERIAL_NUMBER DsmDeviceSerialNumber; - DSM_GET_CONTROLLER_INFO DsmGetControllerInfo; - DSM_SET_DEVICE_INFO DsmSetDeviceInfo; - DSM_IS_PATH_ACTIVE DsmIsPathActive; - DSM_PATH_VERIFY DsmPathVerify; - DSM_INVALIDATE_PATH DsmInvalidatePath; - DSM_MOVE_DEVICE DsmMoveDevice; - DSM_REMOVE_PENDING DsmRemovePending; - DSM_REMOVE_DEVICE DsmRemoveDevice; - DSM_REMOVE_PATH DsmRemovePath; - DSM_SRB_DEVICE_CONTROL DsmSrbDeviceControl; - DSM_LB_GET_PATH DsmLBGetPath; - union { - DSM_INTERPRET_ERROR DsmInterpretError; - DSM_INTERPRET_ERROR_EX DsmInterpretErrorEx; - }; - DSM_UNLOAD DsmUnload; - DSM_SET_COMPLETION DsmSetCompletion; - DSM_CATEGORIZE_REQUEST DsmCategorizeRequest; - DSM_BROADCAST_SRB DsmBroadcastSrb; - - // - // Wmi entry point and guid information. - // - DSM_WMILIB_CONTEXT DsmWmiInfo; - - // - // Context value. - // - PVOID DsmContext; - - // - // DriverObject for the DSM. - // - PDRIVER_OBJECT DriverObject; - - // - // Friendly name for the DSM. - // - UNICODE_STRING DisplayName; - - // - // Reserved. - // - ULONG Reserved; - - // - // Version 2 starts here... - // - - DSM_TYPE DsmType; - - // - // Version 4 starts here... - // - - DSM_VERSION_INFO DsmVersion; - -#if (NTDDI_VERSION >= NTDDI_WIN7) // For Server 2008 R2 and later. - // - // Version 5 starts here... - // - - // - // Wmi entry point and guid information for DSM-centric classes. - // - DSM_WMILIB_CONTEXT DsmWmiGlobalInfo; -#endif - -} DSM_INIT_DATA, *PDSM_INIT_DATA; - - -#define DSM_INIT_DATA_TYPE_1_SIZE (RTL_SIZEOF_THROUGH_FIELD(DSM_INIT_DATA, Reserved)) -#define DSM_INIT_DATA_TYPE_2_SIZE (RTL_SIZEOF_THROUGH_FIELD(DSM_INIT_DATA, DsmType)) -#define DSM_INIT_DATA_TYPE_3_SIZE DSM_INIT_DATA_TYPE_2_SIZE - -#if (NTDDI_VERSION >= NTDDI_WIN7) // For Server 2008 R2 and later. - -#define DSM_INIT_DATA_TYPE_4_SIZE (RTL_SIZEOF_THROUGH_FIELD(DSM_INIT_DATA, DsmVersion)) -#define DSM_INIT_DATA_TYPE_5_SIZE (sizeof(DSM_INIT_DATA)) - -#else // For Server 2008 and earlier. - -#define DSM_INIT_DATA_TYPE_4_SIZE (sizeof(DSM_INIT_DATA)) - -#endif - - -typedef struct _MPIO_VERSION_INFO { - ULONG MajorVersion; - ULONG MinorVersion; - ULONG ProductBuild; - ULONG QfeNumber; -} MPIO_VERSION_INFO, *PMPIO_VERSION_INFO; - - -// -// Output structure for the registration. The DSM needs to keep this value for certain -// routines such as DsmNotification and DsmGetTargetObject. -// -typedef struct _DSM_MPIO_CONTEXT { - PVOID MPIOContext; -} DSM_MPIO_CONTEXT, *PDSM_MPIO_CONTEXT; - - -// -// Input structure for deregistration. -// -typedef struct _DSM_DEREGISTER_DATA { - - // - // Size in bytes - // - ULONG DeregisterDataSize; - - // - // Context value. - // - PVOID DsmContext; - - // - // DriverObject for the DSM. - // - PDRIVER_OBJECT DriverObject; - - // - // MPIO context that was passed back to DSM at registration time - // - PDSM_MPIO_CONTEXT MpioContext; - -} DSM_DEREGISTER_DATA, *PDSM_DEREGISTER_DATA; - - -#define MPIO_DSM ((ULONG) 'dsm') - -// -// IOCTL sent by the DSM to pass entry point info to the MultiPath Control driver. -// Passed in structure defined above (DSM_INIT_DATA). -// -#define IOCTL_MPDSM_REGISTER CTL_CODE (MPIO_DSM, 0x01, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - -// -// IOCTL sent by the DSM to deregister from the MultiPath Control driver. -// Passed in structure defined above (DSM_DEREGISTER_DATA). -// -#define IOCTL_MPDSM_DEREGISTER CTL_CODE (MPIO_DSM, 0x02, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - - -// -// DSM library routines. -// -VOID -DsmSendDeviceIoControlSynchronous( - __in IN ULONG IoControlCode, - __in IN PDEVICE_OBJECT TargetDeviceObject, - __in_opt IN PVOID InputBuffer OPTIONAL, - __inout_opt IN OUT PVOID OutputBuffer OPTIONAL, - __in IN ULONG InputBufferLength, - __in IN ULONG OutputBufferLength, - __in IN BOOLEAN InternalDeviceIoControl, - __out OUT PIO_STATUS_BLOCK IoStatus - ); - -/*++ - -Routine Description: - - This routine is used by the DSM to send IoDeviceControls. - Buffer must be of the appropriate size to encapsulate both input and output. - This routine handles errors/retries. - -Arguments: - - IoControlCode - The DeviceIoControl code. - TargetDevice - DeviceObject to which the request should be sent. - Buffer - The input/output buffer for the request. - InputBufferLength - Length of the input parameters buffer. - OutputBufferLength - Length of the output buffer - InternalDeviceIoControl - Indicates whether the IOCTL is marked as Internal or public. - IoStatus - IO STATUS BLOCK to receive the final status/information fields. - -Return Value: - - NONE - ---*/ - - -NTSTATUS -DsmSendPassThroughDirect( - __in IN PDEVICE_OBJECT DeviceObject, - __in IN PSCSI_PASS_THROUGH_DIRECT ScsiPassThrough, - __in IN ULONG InputBufferLength, - __in IN ULONG OutputBufferLength - ); -/*++ - -Routine Description: - - This routine will send the requested ScsiPassThrough as 'Direct'. - -Arguments: - - DeviceObject - Target of the request. - ScsiPassThrough - A fully initialised ScsiPassThrough struct. - InputBufferLength - Length, in bytes, of the Input buffer. - OutputBufferLength - Length, in bytes, of the output buffer. - -Return Value: - - The interpreted status of the request or SUCCESS. - ---*/ - - -NTSTATUS -DsmGetScsiAddress( - __in IN PDEVICE_OBJECT DeviceObject, - __deref_out OUT PSCSI_ADDRESS *ScsiAddress - ); -/*++ - -Routine Description: - - This routine will return the scsi_address (Port, Path, TargetId, LUN) of DeviceObject. - The buffer for the Address will be allocated and it is the responsibility of the caller - to free it. - -Arguments: - - DeviceObject - The DO of which the address is needed. - ScsiAddress - Location where the address struct. will be placed. - -Return Value: - - SUCCESS, INSUFFICIENT_RESOURCES, NO_SUCH_DEVICE - ---*/ - - -PDSM_IDS -DsmGetAssociatedDevice( - __in IN PVOID MPIOContext, - __in IN PDEVICE_OBJECT PortFdo, - __in IN UCHAR DeviceType - ); -/*++ - -Routine Description: - - If the DSM needs to acquire information from other devices (such as a controller), this - routine can be used to get a list of the PDO's associated with PortFdo. - -Arguments: - - PortFdo - Port driver FDO passed to InquireDriver. - DeviceType - Indicates the SCSI DeviceType to return. - -Return Value: - - Pointer to a DSM_ID structure, where IdList entries are PDEVICE_OBJECT. It is the - reponsibility of the DSM to free the buffer. - ---*/ - - -NTSTATUS -DsmReleaseQueue( - __in IN PDEVICE_OBJECT TargetDevice - ); -/*++ - -Routine Description: - - In the event that a DSM-originated request freezes the queue (SRB_STATUS_QUEUE_FROZEN), this - must be used to un-freeze the queue. - DSM's must check the SRB_STATUS_XXX values upon request completion for those requests that - they sent. - -Arguments: - - TargetDevice - DeviceObject to which the release queue should be sent. - -Return Value: - - Status of of the ReleaseQueue IOCTL. - ---*/ - - -NTSTATUS -DsmSendTUR( - __in IN PDEVICE_OBJECT TargetDevice - ); -/*++ - -Routine Description: - - Sends a Test Unit Ready to TargetDevice. - -Arguments: - - TargetDevice - DeviceObject to which the TUR should be sent. - -Return Value: - - Status of of the TUR. - ---*/ - -NTSTATUS -DsmSendRequest( - __in IN PVOID MPIOContext, - __in IN PDEVICE_OBJECT TargetDevice, - __in IN PIRP Irp, - __in IN PVOID DsmId - ); -/*++ - -Routine Description: - - This routine is used by the DSM to send it's OOB, Broadcast, or any other DSM built requests - to TargetDevice. Not to be used for Irps sent to the DSM by the MPIO driver. Using this - routine allows MPIO to maintain the necessary state info so that Power and PnP requests - can be handled correctly. - -Arguments: - - MPIOContext - Value given to dsm during init. - TargetDevice - DeviceObject to which Irp should be sent. - Irp - The request to send. - DsmId - DSM value referring to the port PDO. - -Return Value: - - Status of IoCallDriver or an error status if one is detected. - ---*/ - -VOID -DsmCompleteRequest( - __in IN PVOID MPIOContext, - __in IN PVOID DsmId - ); -/*++ - -Routine Description: - - This routine is used by the DSM on completion of a request sent via DsmSendRequest. This - notifies MPIO that the request is no longer outstanding and to release any references that - were being held. - - NOTE: This should NOT be called if DsmSendRequest returned any error status values. If an - error was returned, SendRequest did any clean-up necessary. - -Arguments: - - MPIOContext - The Context value (FDO) given to the DSM during init. - DsmId - The DSM ID associated with DeviceObject. - -Return Value: - - NONE - ---*/ - -ULONG -DsmGetSystemWeight( - __in IN PVOID MPIOContext, - __in IN PIRP Irp, - __in IN PVOID PathId - ); -/*++ - -Routine Description: - - This routine is used by the DSM to determine the cost associated with issuing the - request to PathId for the system. For example, cross node accesses on a NUMA system. - -Arguments: - - MPIOContext - Value given to the DSM during initialization. - Irp - The request to send. - PathId - One of the PathId values for the MPDisk. (SetDeviceInfo). - -Return Value: - - Relative system cost of issuing Irp to PathId. (ULONG)-1 indicates this Path is - unreachable. - ---*/ - - -PDEVICE_OBJECT -DsmGetPDO( - __in IN PVOID MPIOContext, - __in IN PDEVICE_OBJECT DeviceObject - ); -/*++ - -Routine Description: - - This routine is used by the DSM to retrieve the PDO for an adapter FDO. - The DeviceObject passed in must be the PortFdo supplied to InquireDriver. - -Arguments: - - MPIOContext - Value given to the DSM during initialization. - DeviceObject - The PortFDO that the PDO is needed. - -Return Value: - - The PDO or NULL. ---*/ - - -typedef enum _DSM_NOTIFICATION_TYPE { - DeviceFailure, - PathFailure, - PathOnLine, - ThrottleIO, - ResumeIO, - SetCurrentPath, - ThrottleIO_V2, - ResumeIO_V2, - SetCurrentPath_V2, - MaxDsmNotificationType -} DSM_NOTIFICATION_TYPE, *PDSM_NOTIFICATION_TYPE; - - -VOID -DsmNotification( - __in IN PVOID MPIOContext, - __in IN DSM_NOTIFICATION_TYPE NotificationType, - ... - ); -/*++ - -Routine Description: - - This routine is called by the DSM to inform mpctl of certain events such as - Device/Path failure, Device/Path coming back online after a failure, WMI Events, or TBD.... - -Arguments: - - MPIOContext - Value given to the DSM during initialization. - NotificationType - Specifies the type of notification. - Additional Parameters depend on NotificationType - DeviceFailure - DsmId (PVOID) - PathFailure - PathId (PVOID) - PathOnLine - PathId (PVOID) - ThrottleIO - DsmId (PVOID) - ResumeIO - DsmId (PVOID) - SetCurrentPath - PathId (PVOID), DsmId (PVOID) - ThrottleIO_V2 - DsmId (PVOID), Reserved1 (BOOLEAN), Status (PNTSTATUS), Reserved (LONG) - ResumeIO_V2 - DsmId (PVOID), Categorize (BOOLEAN), Status (PNTSTATUS), Reserved (LONG) - If Categorize is TRUE, then throttled requests will be presented - to DSM's LBGetPath or CategorizeRequest (as appropriate) - Reserved must be passed in as 0 - SetCurrentPath_V2 - PathId (PVOID), DsmId (PVOID), Status (PNTSTATUS), Reserved (LONG) - -Return Value: - - None - ---*/ - - -NTSTATUS -DsmWriteEvent( - __in IN PVOID MPIOContext, - __in IN PWSTR ComponentName, - __in IN PWSTR EventDescription, - __in IN ULONG Severity - ); -/*++ - -Routine Description: - - The will cause a WMI Event to be fired, containing the Paramter information as - the event data. - -Arguments: - - MpctlContext - Value given to the DSM during initialization. - ComponentName - Name of the object effected. - EventDescription - Description of the event. - Severity - Lower is worse. - -Return Value: - - None - ---*/ - -NTSTATUS -DsmGetVersion( - __inout IN OUT PMPIO_VERSION_INFO MpioVersion, - __in IN ULONG MpioVersionSize - ); -/*++ - -Routine Description: - - This routine will return the version of multipath drivers installed. - -Arguments: - - MpioVersion - pointer to version structure. - MpioVersionSize - byte size of input structure. - -Return Value: - - NTSTATUS - ---*/ - -PVOID -DsmGetContextFromSrb( - __in IN PSCSI_REQUEST_BLOCK Srb - ); -/*++ - -Routine Description: - - This routine will return the DSM-supplied per-request context associated with - Srb. This routine can only be called after DsmSetCompletion and must be in the context - of one of the DSM's exported functions. - -Arguments: - - Srb - The SCSI_REQUEST_BLOCK to which the DSM-supplied context is associated. - -Return Value: - - The context or NULL. - ---*/ - - -#endif // _DSM_H_ - diff --git a/qt-correction-tool/pub/ddk/dxapi.h b/qt-correction-tool/pub/ddk/dxapi.h deleted file mode 100644 index a2d8a2b..0000000 --- a/qt-correction-tool/pub/ddk/dxapi.h +++ /dev/null @@ -1,37 +0,0 @@ -/*++ - -Copyright (c) 1996 Microsoft Corporation - -Module Name: - - dxapi.h - -Abstract: - - This file defines the necessary structures, defines, and functions for - the DXAPI class driver. - -Author: - Bill Parry (billpa) - -Environment: - - Kernel mode only - -Revision History: - ---*/ - -ULONG -DxApi( - IN ULONG dwFunctionNum, - IN PVOID lpvInBuffer, - IN ULONG cbInBuffer, - IN PVOID lpvOutBuffer, - IN ULONG cbOutBuffer -); - -ULONG -DxApiGetVersion( -); - diff --git a/qt-correction-tool/pub/ddk/dxva9typ.h b/qt-correction-tool/pub/ddk/dxva9typ.h deleted file mode 100644 index 26fe5ec..0000000 --- a/qt-correction-tool/pub/ddk/dxva9typ.h +++ /dev/null @@ -1,1001 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: dxva9typ.h - * Content: Direct3D include file - * - ****************************************************************************/ - -#ifndef _DXVA9TYP_H_ -#define _DXVA9TYP_H_ - -#ifndef DIRECT3D_VERSION -#define DIRECT3D_VERSION 0x0900 -#endif //DIRECT3D_VERSION - -// include this file content only if compiling for DX9 interfaces -#if(DIRECT3D_VERSION >= 0x0900) - - -#include - -#define COM_NO_WINDOWS_H -#include - -#include - -#ifdef __DIRECTX_VA_COPP_ONLY -#define __DIRECTX_VA_DECODER__ -#define __DIRECTX_VA_PROCAMPCONTROL__ -#define __DIRECTX_VA_DEINTERLACE__ -#endif - -#ifndef DXVABit -#define DXVABit(__x) (1 << __x) -#endif - - -// ------------------------------------------------------------------------- -// -// The definitions that follow describe the DirectX Video Acceleration -// decoding interface. -// This interface is accessable via the IAMVideoAccelerator interface. -// -// ------------------------------------------------------------------------- -// -#ifndef __DIRECTX_VA_DECODER__ -#define __DIRECTX_VA_DECODER__ - -/* AYUV sample for 16-entry YUV palette or graphic surface */ - -typedef struct _DXVA_AYUVsample2 { - BYTE bCrValue; - BYTE bCbValue; - BYTE bY_Value; - BYTE bSampleAlpha8; -} DXVA_AYUVsample2, *LPDXVA_AYUVsample2; - -DEFINE_GUID(DXVAp_ModeMPEG2_A, 0x1b81be0A, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVAp_ModeMPEG2_C, 0x1b81be0C, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); -DEFINE_GUID(DXVAp_NoEncrypt, 0x1b81beD0, 0xa0c7,0x11d3,0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5); - -#pragma pack(push, BeforeDXVApacking, 1) - -typedef struct _DXVA_BufferDescription { - DWORD dwTypeIndex; - DWORD dwBufferIndex; - DWORD dwDataOffset; - DWORD dwDataSize; - DWORD dwFirstMBaddress; - DWORD dwNumMBsInBuffer; - DWORD dwWidth; - DWORD dwHeight; - DWORD dwStride; - DWORD dwReservedBits; -} DXVA_BufferDescription, *LPDXVA_BufferDescription; - -typedef DWORD DXVA_ConfigQueryOrReplyFunc, *LPDXVA_ConfigQueryOrReplyFunc; - -#define DXVA_QUERYORREPLYFUNCFLAG_DECODER_PROBE_QUERY 0xFFFFF1 -#define DXVA_QUERYORREPLYFUNCFLAG_DECODER_LOCK_QUERY 0xFFFFF5 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_COPY 0xFFFFF8 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_OK_PLUS 0xFFFFF9 -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_OK_COPY 0xFFFFFC -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_PROBE_FALSE_PLUS 0xFFFFFB -#define DXVA_QUERYORREPLYFUNCFLAG_ACCEL_LOCK_FALSE_PLUS 0xFFFFFF - -#define DXVA_PICTURE_DECODE_BUFFER 1 -#define DXVA_MACROBLOCK_CONTROL_BUFFER 2 -#define DXVA_RESIDUAL_DIFFERENCE_BUFFER 3 -#define DXVA_DEBLOCKING_CONTROL_BUFFER 4 -#define DXVA_INVERSE_QUANTIZATION_MATRIX_BUFFER 5 -#define DXVA_SLICE_CONTROL_BUFFER 6 -#define DXVA_BITSTREAM_DATA_BUFFER 7 -#define DXVA_AYUV_BUFFER 8 -#define DXVA_IA44_SURFACE_BUFFER 9 -#define DXVA_DPXD_SURFACE_BUFFER 10 -#define DXVA_HIGHLIGHT_BUFFER 11 -#define DXVA_DCCMD_SURFACE_BUFFER 12 -#define DXVA_ALPHA_BLEND_COMBINATION_BUFFER 13 -#define DXVA_PICTURE_RESAMPLE_BUFFER 14 -#define DXVA_READ_BACK_BUFFER 15 - -typedef struct _DXVA_ConfigPictureDecode { - - // Operation Indicated - DXVA_ConfigQueryOrReplyFunc dwFunction; - - // Alignment - DWORD dwReservedBits[3]; - - // Encryption GUIDs - GUID guidConfigBitstreamEncryption; - GUID guidConfigMBcontrolEncryption; - GUID guidConfigResidDiffEncryption; - - // Bitstream Processing Indicator - BYTE bConfigBitstreamRaw; - - // Macroblock Control Config - BYTE bConfigMBcontrolRasterOrder; - - // Host Resid Diff Config - BYTE bConfigResidDiffHost; - BYTE bConfigSpatialResid8; - BYTE bConfigResid8Subtraction; - BYTE bConfigSpatialHost8or9Clipping; - BYTE bConfigSpatialResidInterleaved; - BYTE bConfigIntraResidUnsigned; - - // Accelerator Resid Diff Config - BYTE bConfigResidDiffAccelerator; - BYTE bConfigHostInverseScan; - BYTE bConfigSpecificIDCT; - BYTE bConfig4GroupedCoefs; -} DXVA_ConfigPictureDecode, *LPDXVA_ConfigPictureDecode; - -typedef struct _DXVA_PictureParameters { - - WORD wDecodedPictureIndex; - WORD wDeblockedPictureIndex; - - WORD wForwardRefPictureIndex; - WORD wBackwardRefPictureIndex; - - WORD wPicWidthInMBminus1; - WORD wPicHeightInMBminus1; - - BYTE bMacroblockWidthMinus1; - BYTE bMacroblockHeightMinus1; - - BYTE bBlockWidthMinus1; - BYTE bBlockHeightMinus1; - - BYTE bBPPminus1; - - BYTE bPicStructure; - BYTE bSecondField; - BYTE bPicIntra; - BYTE bPicBackwardPrediction; - - BYTE bBidirectionalAveragingMode; - BYTE bMVprecisionAndChromaRelation; - BYTE bChromaFormat; - - BYTE bPicScanFixed; - BYTE bPicScanMethod; - BYTE bPicReadbackRequests; - - BYTE bRcontrol; - BYTE bPicSpatialResid8; - BYTE bPicOverflowBlocks; - BYTE bPicExtrapolation; - - BYTE bPicDeblocked; - BYTE bPicDeblockConfined; - BYTE bPic4MVallowed; - BYTE bPicOBMC; - BYTE bPicBinPB; - BYTE bMV_RPS; - - BYTE bReservedBits; - - WORD wBitstreamFcodes; - WORD wBitstreamPCEelements; - BYTE bBitstreamConcealmentNeed; - BYTE bBitstreamConcealmentMethod; - -} DXVA_PictureParameters, *LPDXVA_PictureParameters; - -#pragma pack(pop, BeforeDXVApacking) - -#endif /* __DIRECTX_VA_DECODER__ */ - - -#ifndef __DIRECTX_VA_DECODER9__ -#define __DIRECTX_VA_DECODER9__ -// ------------------------------------------------------------------------- -// Decoding data types used with RenderMoComp -// ------------------------------------------------------------------------- -// - -typedef struct _DXVAUncompDataInfo -{ - DWORD UncompWidth; /* Width of uncompressed data */ - DWORD UncompHeight; /* Height of uncompressed data */ - D3DFORMAT UncompFormat; /* Format of uncompressed data */ -} DXVAUncompDataInfo; - -typedef struct _DXVACompBufferInfo -{ - DWORD NumCompBuffers; /* Number of buffers reqd for compressed data */ - DWORD WidthToCreate; /* Width of surface to create */ - DWORD HeightToCreate; /* Height of surface to create */ - DWORD BytesToAllocate; /* Total number of bytes used by each surface */ - DWORD Usage; /* Usage used to create the compressed buffer */ - D3DPOOL Pool; /* Pool where the compressed buffer belongs */ - D3DFORMAT Format; /* Format used to create the compressed buffer */ -} DXVACompBufferInfo; - -typedef struct _DXVABufferInfo -{ - VOID* pCompSurface; /* Pointer to buffer containing compressed data */ - DWORD DataOffset; /* Offset of relevant data from the beginning of buffer */ - DWORD DataSize; /* Size of relevant data */ -} DXVABufferInfo; - -#endif /* __DIRECTX_VA_DECODER9__ */ - - -// ------------------------------------------------------------------------- -// -// D3DFORMAT describes a pixel memory layout, DXVA sample format contains -// additional information that describes how the pixels should be interpreted. -// -// DXVA Extended color data - occupies the SampleFormat DWORD -// data fields. -// ------------------------------------------------------------------------- -#ifndef __DIRECTX_VA_SAMPLEFORMAT__ -#define __DIRECTX_VA_SAMPLEFORMAT__ - -typedef enum _DXVA_SampleFormat { - DXVA_SampleFormatMask = 0xFF, // 8 bits used for DXVA Sample format - DXVA_SampleUnknown = 0, - DXVA_SamplePreviousFrame = 1, - DXVA_SampleProgressiveFrame = 2, - DXVA_SampleFieldInterleavedEvenFirst = 3, - DXVA_SampleFieldInterleavedOddFirst = 4, - DXVA_SampleFieldSingleEven = 5, - DXVA_SampleFieldSingleOdd = 6, - DXVA_SampleSubStream = 7 -} DXVA_SampleFormat; - -#define DXVA_ExtractSampleFormat(_sf) ((_sf) & (DXVA_SampleFormatMask)) - -#define DXVA_ExtractExtColorData(_sf, _Mask, _Shift) \ - (((_sf) & (_Mask)) >> (_Shift)) - -#define DXVABitMask(__n) (~((~0) << __n)) -#define DXVA_ExtColorData_ShiftBase 8 -#define DXVAColorMask(__bits,__base) (DXVABitMask(__bits) << (__base)) - -typedef enum _DXVA_VideoTransferFunction -{ - DXVA_VideoTransFuncShift = (DXVA_ExtColorData_ShiftBase + 19), - DXVA_VideoTransFuncMask = DXVAColorMask(5, DXVA_VideoTransFuncShift), - - DXVA_VideoTransFunc_Unknown = 0, - DXVA_VideoTransFunc_10 = 1, - DXVA_VideoTransFunc_18 = 2, - DXVA_VideoTransFunc_20 = 3, - DXVA_VideoTransFunc_22 = 4, - DXVA_VideoTransFunc_22_709 = 5, - DXVA_VideoTransFunc_22_240M = 6, - DXVA_VideoTransFunc_22_8bit_sRGB = 7, - DXVA_VideoTransFunc_28 = 8 -} DXVA_VideoTransferFunction; - -typedef enum _DXVA_VideoPrimaries -{ - DXVA_VideoPrimariesShift = (DXVA_ExtColorData_ShiftBase + 14), - DXVA_VideoPrimariesMask = DXVAColorMask(5, DXVA_VideoPrimariesShift), - - DXVA_VideoPrimaries_Unknown = 0, - DXVA_VideoPrimaries_reserved = 1, - DXVA_VideoPrimaries_BT709 = 2, - DXVA_VideoPrimaries_BT470_2_SysM = 3, - DXVA_VideoPrimaries_BT470_2_SysBG = 4, - DXVA_VideoPrimaries_SMPTE170M = 5, - DXVA_VideoPrimaries_SMPTE240M = 6, - DXVA_VideoPrimaries_EBU3213 = 7, - DXVA_VideoPrimaries_SMPTE_C = 8 -} DXVA_VideoPrimaries; - -typedef enum _DXVA_VideoLighting -{ - DXVA_VideoLightingShift = (DXVA_ExtColorData_ShiftBase + 10), - DXVA_VideoLightingMask = DXVAColorMask(4, DXVA_VideoLightingShift), - - DXVA_VideoLighting_Unknown = 0, - DXVA_VideoLighting_bright = 1, - DXVA_VideoLighting_office = 2, - DXVA_VideoLighting_dim = 3, - DXVA_VideoLighting_dark = 4 -} DXVA_VideoLighting; - -typedef enum _DXVA_VideoTransferMatrix -{ - DXVA_VideoTransferMatrixShift = (DXVA_ExtColorData_ShiftBase + 7), - DXVA_VideoTransferMatrixMask = DXVAColorMask(3, DXVA_VideoTransferMatrixShift), - - DXVA_VideoTransferMatrix_Unknown = 0, - DXVA_VideoTransferMatrix_BT709 = 1, - DXVA_VideoTransferMatrix_BT601 = 2, - DXVA_VideoTransferMatrix_SMPTE240M = 3 -} DXVA_VideoTransferMatrix; - -typedef enum _DXVA_NominalRange -{ - DXVA_NominalRangeShift = (DXVA_ExtColorData_ShiftBase + 4), - DXVA_NominalRangeMask = DXVAColorMask(3, DXVA_NominalRangeShift), - - DXVA_NominalRange_Unknown = 0, - DXVA_NominalRange_Normal = 1, - DXVA_NominalRange_Wide = 2, - - DXVA_NominalRange_0_255 = 1, - DXVA_NominalRange_16_235 = 2, - DXVA_NominalRange_48_208 = 3 -} DXVA_NominalRange; - -typedef enum _DXVA_VideoChromaSubsampling -{ - DXVA_VideoChromaSubsamplingShift = (DXVA_ExtColorData_ShiftBase + 0), - DXVA_VideoChromaSubsamplingMask = DXVAColorMask(4, DXVA_VideoChromaSubsamplingShift), - - DXVA_VideoChromaSubsampling_Unknown = 0, - DXVA_VideoChromaSubsampling_ProgressiveChroma = 0x8, - DXVA_VideoChromaSubsampling_Horizontally_Cosited = 0x4, - DXVA_VideoChromaSubsampling_Vertically_Cosited = 0x2, - DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1, - // 4:2:0 variations - DXVA_VideoChromaSubsampling_MPEG2 = DXVA_VideoChromaSubsampling_Horizontally_Cosited | - DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, - - DXVA_VideoChromaSubsampling_MPEG1 = DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, - - DXVA_VideoChromaSubsampling_DV_PAL = DXVA_VideoChromaSubsampling_Horizontally_Cosited | - DXVA_VideoChromaSubsampling_Vertically_Cosited, - // 4:4:4, 4:2:2, 4:1:1 - DXVA_VideoChromaSubsampling_Cosited = DXVA_VideoChromaSubsampling_Horizontally_Cosited | - DXVA_VideoChromaSubsampling_Vertically_Cosited | - DXVA_VideoChromaSubsampling_Vertically_AlignedChromaPlanes, - -} DXVA_VideoChromaSubsampling; - -typedef struct _DXVA_ExtendedFormat -{ - UINT SampleFormat : 8; // See DXVA_SampleFormat - UINT VideoChromaSubsampling : 4; // See DXVA_VideoChromaSubSampling - DXVA_NominalRange NominalRange : 3; // See DXVA_NominalRange - DXVA_VideoTransferMatrix VideoTransferMatrix : 3; // See DXVA_VideoTransferMatrix - DXVA_VideoLighting VideoLighting : 4; // See DXVA_VideoLighting - DXVA_VideoPrimaries VideoPrimaries : 5; // See DXVA_VideoPrimaries - DXVA_VideoTransferFunction VideoTransferFunction : 5; // See DXVA_VideoTransferFunction -} DXVA_ExtendedFormat; - -#endif /* __DIRECTX_VA_SAMPLEFORMAT__ */ - - -// ------------------------------------------------------------------------- -// -// The definitions that follow describe the video de-interlace interface -// between the VMR and the graphics device driver. This interface is not -// accessable via the IAMVideoAccelerator interface. -// -// ------------------------------------------------------------------------- -// -#ifndef __DIRECTX_VA_DEINTERLACE__ -#define __DIRECTX_VA_DEINTERLACE__ - -#ifndef REFERENCE_TME - typedef LONGLONG REFERENCE_TIME; -#endif - -DEFINE_GUID(DXVAp_DeinterlaceBobDevice, 0x335aa36e,0x7884,0x43a4,0x9c,0x91,0x7f,0x87,0xfa,0xf3,0xe3,0x7e); -DEFINE_GUID(DXVAp_DeinterlaceContainerDevice, 0x0e85cb93,0x3046,0x4ff0,0xae,0xcc,0xd5,0x8c,0xb5,0xf0,0x35,0xfd); - -#define DXVA_DeinterlaceBobDevice DXVAp_DeinterlaceBobDevice -#define DXVA_DeinterlaceContainerDevice DXVAp_DeinterlaceContainerDevice - -#if (DIRECT3D_VERSION < 0x0800) || !defined(DIRECT3D_VERSION) -typedef DWORD D3DFORMAT; -enum { - D3DPOOL_DEFAULT = 0, - D3DPOOL_MANAGED = 1, - D3DPOOL_SYSTEMMEM = 2, - D3DPOOL_SCRATCH = 3, - D3DPOOL_LOCALVIDMEM = 4, - D3DPOOL_NONLOCALVIDMEM = 5, - D3DPOOL_FORCE_DWORD = 0x7fffffff -}; -#endif - -// ------------------------------------------------------------------------- -// data structures shared by User mode and Kernel mode. -// ------------------------------------------------------------------------- -// - -typedef struct _DXVA_Frequency { - DWORD Numerator; - DWORD Denominator; -} DXVA_Frequency; - -typedef struct _DXVA_VideoDesc { - DWORD Size; - DWORD SampleWidth; - DWORD SampleHeight; - DWORD SampleFormat; // also contains extend color data - D3DFORMAT d3dFormat; - DXVA_Frequency InputSampleFreq; - DXVA_Frequency OutputFrameFreq; -} DXVA_VideoDesc, *LPDXVA_VideoDesc; - -typedef enum _DXVA_VideoProcessCaps { - DXVA_VideoProcess_None = 0x0000, - DXVA_VideoProcess_YUV2RGB = 0x0001, - DXVA_VideoProcess_StretchX = 0x0002, - DXVA_VideoProcess_StretchY = 0x0004, - DXVA_VideoProcess_AlphaBlend = 0x0008, - DXVA_VideoProcess_SubRects = 0x0010, - DXVA_VideoProcess_SubStreams = 0x0020, - DXVA_VideoProcess_SubStreamsExtended = 0x0040, - DXVA_VideoProcess_YUV2RGBExtended = 0x0080, - DXVA_VideoProcess_AlphaBlendExtended = 0x0100 -} DXVA_VideoProcessCaps; - -typedef enum _DXVA_DeinterlaceTech { - - // the algorithm is unknown or proprietary - DXVA_DeinterlaceTech_Unknown = 0x0000, - - // the algorithm creates the missing lines by repeating - // the line either above or below it - this method will look very jaggy and - // isn't recommended - DXVA_DeinterlaceTech_BOBLineReplicate = 0x0001, - - // The algorithm creates the missing lines by vertically stretching each - // video field by a factor of two by averaging two lines - DXVA_DeinterlaceTech_BOBVerticalStretch = 0x0002, - - // or using a [-1, 9, 9, -1]/16 filter across four lines. - DXVA_DeinterlaceTech_BOBVerticalStretch4Tap = 0x0100, - - // the pixels in the missing line are recreated by a median filtering operation - DXVA_DeinterlaceTech_MedianFiltering = 0x0004, - - // the pixels in the missing line are recreated by an edge filter. - // In this process, spatial directional filters are applied to determine - // the orientation of edges in the picture content, and missing - // pixels are created by filtering along (rather than across) the - // detected edges. - DXVA_DeinterlaceTech_EdgeFiltering = 0x0010, - - // the pixels in the missing line are recreated by switching on a field by - // field basis between using either spatial or temporal interpolation - // depending on the amount of motion. - DXVA_DeinterlaceTech_FieldAdaptive = 0x0020, - - // the pixels in the missing line are recreated by switching on a pixel by pixel - // basis between using either spatial or temporal interpolation depending on - // the amount of motion.. - DXVA_DeinterlaceTech_PixelAdaptive = 0x0040, - - // Motion Vector Steering identifies objects within a sequence of video - // fields. The missing pixels are recreated after first aligning the - // movement axes of the individual objects in the scene to make them - // parallel with the time axis. - DXVA_DeinterlaceTech_MotionVectorSteered = 0x0080 - -} DXVA_DeinterlaceTech; - -typedef struct _DXVA_VideoSample { - REFERENCE_TIME rtStart; - REFERENCE_TIME rtEnd; - DXVA_SampleFormat SampleFormat; // only lower 8 bits used - VOID* lpDDSSrcSurface; -} DXVA_VideoSample, *LPDXVA_VideoSample; - -// ------------------------------------------------------------------------- -// DeinterlaceBltEx declarations -// ------------------------------------------------------------------------- -// - -typedef enum _DXVA_SampleFlags { - DXVA_SampleFlagsMask = DXVABit(3)|DXVABit(2)|DXVABit(1)|DXVABit(0), - - DXVA_SampleFlag_Palette_Changed = 0x0001, - DXVA_SampleFlag_SrcRect_Changed = 0x0002, - DXVA_SampleFlag_DstRect_Changed = 0x0004, - DXVA_SampleFlag_ColorData_Changed = 0x0008, -} DXVA_SampleFlags; - -typedef enum _DXVA_DestinationFlags { - DXVA_DestinationFlagMask = DXVABit(3)|DXVABit(2)|DXVABit(1)|DXVABit(0), - - DXVA_DestinationFlag_Background_Changed = 0x0001, - DXVA_DestinationFlag_TargetRect_Changed = 0x0002, - DXVA_DestinationFlag_ColorData_Changed = 0x0004, - DXVA_DestinationFlag_Alpha_Changed = 0x0008 -} DXVA_DestinationFlags; - -typedef struct _DXVA_VideoSample2 { -#ifdef _WIN64 - DWORD Size; - DWORD Reserved; -#endif - REFERENCE_TIME rtStart; - REFERENCE_TIME rtEnd; - DWORD SampleFormat; // cast to DXVA_ExtendedFormat, or use Extract macros - DWORD SampleFlags; - VOID* lpDDSSrcSurface; - RECT rcSrc; - RECT rcDst; - DXVA_AYUVsample2 Palette[16]; -} DXVA_VideoSample2, *LPDXVA_VideoSample2; - -typedef struct _DXVA_DeinterlaceCaps { - DWORD Size; - DWORD NumPreviousOutputFrames; - DWORD InputPool; - DWORD NumForwardRefSamples; - DWORD NumBackwardRefSamples; - D3DFORMAT d3dOutputFormat; - DXVA_VideoProcessCaps VideoProcessingCaps; - DXVA_DeinterlaceTech DeinterlaceTechnology; -} DXVA_DeinterlaceCaps, *LPDXVA_DeinterlaceCaps; - -// ------------------------------------------------------------------------- -// Data types used with RenderMoComp in kernel mode -// ------------------------------------------------------------------------- -// - -// Function codes for RenderMoComp - -#define MAX_DEINTERLACE_SURFACES 32 - -#ifdef _WIN64 -// -// These structures are used for thunking 32 bit DeinterlaceBltEx calls on -// 64 bit drivers. -// -typedef struct _DXVA_VideoSample32 { - REFERENCE_TIME rtStart; - REFERENCE_TIME rtEnd; - DWORD SampleFormat; - DWORD SampleFlags; - DWORD lpDDSSrcSurface; // 32 bit pointer size - RECT rcSrc; - RECT rcDst; - DXVA_AYUVsample2 Palette[16]; - // DWORD Pad; - // 4 bytes of padding added by the compiler to align the struct to 8 bytes. -} DXVA_VideoSample32; - -typedef struct _DXVA_DeinterlaceBltEx32 { - DWORD Size; - DXVA_AYUVsample2 BackgroundColor; - RECT rcTarget; - REFERENCE_TIME rtTarget; - DWORD NumSourceSurfaces; - FLOAT Alpha; - DXVA_VideoSample32 Source[MAX_DEINTERLACE_SURFACES]; - DWORD DestinationFormat; - DWORD DestinationFlags; -} DXVA_DeinterlaceBltEx32; -#endif - -typedef struct _DXVA_DeinterlaceBlt { - DWORD Size; - DWORD Reserved; - REFERENCE_TIME rtTarget; - RECT DstRect; - RECT SrcRect; - DWORD NumSourceSurfaces; - FLOAT Alpha; - DXVA_VideoSample Source[MAX_DEINTERLACE_SURFACES]; -} DXVA_DeinterlaceBlt; - -#define DXVA_DeinterlaceBltFnCode 0x01 -// lpInput => DXVA_DeinterlaceBlt* -// lpOuput => NULL /* not currently used */ - -typedef struct _DXVA_DeinterlaceBltEx { - DWORD Size; - DXVA_AYUVsample2 BackgroundColor; - RECT rcTarget; - REFERENCE_TIME rtTarget; - DWORD NumSourceSurfaces; - FLOAT Alpha; - DXVA_VideoSample2 Source[MAX_DEINTERLACE_SURFACES]; - DWORD DestinationFormat; - DWORD DestinationFlags; -} DXVA_DeinterlaceBltEx; - -#define DXVA_DeinterlaceBltExFnCode 0x02 -// lpInput => DXVA_DeinterlaceBltEx* -// lpOuput => NULL /* not currently used */ - -#define MAX_DEINTERLACE_DEVICE_GUIDS 32 -typedef struct _DXVA_DeinterlaceQueryAvailableModes { - DWORD Size; - DWORD NumGuids; - GUID Guids[MAX_DEINTERLACE_DEVICE_GUIDS]; -} DXVA_DeinterlaceQueryAvailableModes; - -#define DXVA_DeinterlaceQueryAvailableModesFnCode 0x01 -// lpInput => DXVA_VideoDesc* -// lpOuput => DXVA_DeinterlaceQueryAvailableModes* - -typedef struct _DXVA_DeinterlaceQueryModeCaps { - DWORD Size; - GUID Guid; - DXVA_VideoDesc VideoDesc; -} DXVA_DeinterlaceQueryModeCaps; - -#define DXVA_DeinterlaceQueryModeCapsFnCode 0x02 -// lpInput => DXVA_DeinterlaceQueryModeCaps* -// lpOuput => DXVA_DeinterlaceCaps* - -#endif /* __DIRECTX_VA_DEINTERLACE__ */ - -// ------------------------------------------------------------------------- -// -// The definitions that follow describe the video ProcAmp interface -// between the VMR and the graphics device driver. This interface is not -// accessable via the IAMVideoAccelerator interface. -// -// ------------------------------------------------------------------------- -// -#ifndef __DIRECTX_VA_PROCAMPCONTROL__ -#define __DIRECTX_VA_PROCAMPCONTROL__ - -DEFINE_GUID(DXVA_ProcAmpControlDevice, - 0x9f200913,0x2ffd,0x4056,0x9f,0x1e,0xe1,0xb5,0x08,0xf2,0x2d,0xcf); - -typedef enum _DXVA_ProcAmpControlProp { - DXVA_ProcAmp_None = 0x0000, - DXVA_ProcAmp_Brightness = 0x0001, - DXVA_ProcAmp_Contrast = 0x0002, - DXVA_ProcAmp_Hue = 0x0004, - DXVA_ProcAmp_Saturation = 0x0008 -} DXVA_ProcAmpControlProp; - -typedef struct _DXVA_ProcAmpControlCaps { - DWORD Size; - DWORD InputPool; - D3DFORMAT d3dOutputFormat; - DWORD ProcAmpControlProps;// see DXVA_ProcAmpControlProp - DWORD VideoProcessingCaps;// see DXVA_VideoProcessCaps -} DXVA_ProcAmpControlCaps, *LPDXVA_ProcAmpControlCaps; - -#define DXVA_ProcAmpControlQueryCapsFnCode 0x03 -// lpInput => DXVA_VideoDesc* -// lpOuput => DXVA_ProcAmpControlCaps* - -typedef struct _DXVA_ProcAmpControlQueryRange { - DWORD Size; - DXVA_ProcAmpControlProp ProcAmpControlProp; - DXVA_VideoDesc VideoDesc; -} DXVA_ProcAmpControlQueryRange, *LPDXVA_ProcAmpControlQueryRange; - -typedef struct _DXVA_VideoPropertyRange { - FLOAT MinValue; - FLOAT MaxValue; - FLOAT DefaultValue; - FLOAT StepSize; -} DXVA_VideoPropertyRange, *LPDXVA_VideoPropertyRange; - -#define DXVA_ProcAmpControlQueryRangeFnCode 0x04 -// lpInput => DXVA_ProcAmpControlQueryRange* -// lpOuput => DXVA_VideoPropertyRange* - -typedef struct _DXVA_ProcAmpControlBlt { - DWORD Size; - RECT DstRect; - RECT SrcRect; - FLOAT Alpha; - FLOAT Brightness; - FLOAT Contrast; - FLOAT Hue; - FLOAT Saturation; -} DXVA_ProcAmpControlBlt; - -#define DXVA_ProcAmpControlBltFnCode 0x01 -// lpInput => DXVA_ProcAmpControlBlt* -// lpOuput => NULL /* not currently used */ - -#endif /* __DIRECTX_VA_PROCAMPCONTROL__ */ - -// ------------------------------------------------------------------------- -// -// The definitions that follow describe the Certified Output Protection -// Protocol between the VMR and the graphics device driver. This interface -// is not accessable via the IAMVideoAccelerator interface. -// -// ------------------------------------------------------------------------- -// -#ifndef __DIRECTX_VA_CERTOUTPUTPROTECT__ -#define __DIRECTX_VA_CERTOUTPUTPROTECT__ - -DEFINE_GUID(DXVA_COPPDevice, - 0xd2457add,0x8999,0x45ed,0x8a,0x8a,0xd1,0xaa,0x04,0x7b,0xa4,0xd5); - -// ------------------------------------------------------------------------- -// COPPGetCertificateLength -// ------------------------------------------------------------------------- -#define DXVA_COPPGetCertificateLengthFnCode 0x01 -// lpInput => NULL -// lpOuput => DWORD* - -// ------------------------------------------------------------------------- -// COPPKeyExchange -// ------------------------------------------------------------------------- -#define DXVA_COPPKeyExchangeFnCode 0x02 -// lpInputData => NULL -// lpOuputData => GUID* - -// ------------------------------------------------------------------------- -// COPPSequenceStart -// ------------------------------------------------------------------------- -typedef struct _DXVA_COPPSignature { - UCHAR Signature[256]; -} DXVA_COPPSignature, *LPDXVA_COPPSignature; - -#define DXVA_COPPSequenceStartFnCode 0x03 -// lpInputData => DXVA_COPPSignature* -// lpOuputData => NULL - -// ------------------------------------------------------------------------- -// COPPCommand -// ------------------------------------------------------------------------- -typedef struct _DXVA_COPPCommand { - GUID macKDI; // 16 bytes - GUID guidCommandID; // 16 bytes - ULONG dwSequence; // 4 bytes - ULONG cbSizeData; // 4 bytes - UCHAR CommandData[4056]; // 4056 bytes (4056+4+4+16+16 = 4096) -} DXVA_COPPCommand, *LPDXVA_COPPCommand; - -#define DXVA_COPPCommandFnCode 0x04 -// lpInputData => DXVA_COPPCommand* -// lpOuputData => NULL - -DEFINE_GUID(DXVA_COPPSetProtectionLevel, - 0x9bb9327c,0x4eb5,0x4727,0x9f,0x00,0xb4,0x2b,0x09,0x19,0xc0,0xda); - -typedef struct _DXVA_COPPSetProtectionLevelCmdData { - ULONG ProtType; - ULONG ProtLevel; - ULONG ExtendedInfoChangeMask; - ULONG ExtendedInfoData; -} DXVA_COPPSetProtectionLevelCmdData; - -// Set the HDCP protection level - (0 - 1 DWORD, 4 bytes) - -typedef enum _COPP_HDCP_Protection_Level { - COPP_HDCP_Level0 = 0, - COPP_HDCP_LevelMin = COPP_HDCP_Level0, - COPP_HDCP_Level1 = 1, - COPP_HDCP_LevelMax = COPP_HDCP_Level1, - COPP_HDCP_ForceDWORD = 0x7fffffff -} COPP_HDCP_Protection_Level; - -typedef enum _COPP_CGMSA_Protection_Level { - COPP_CGMSA_Disabled = 0, - COPP_CGMSA_LevelMin = COPP_CGMSA_Disabled, - COPP_CGMSA_CopyFreely = 1, - COPP_CGMSA_CopyNoMore = 2, - COPP_CGMSA_CopyOneGeneration = 3, - COPP_CGMSA_CopyNever = 4, - COPP_CGMSA_RedistributionControlRequired = 0x08, - COPP_CGMSA_LevelMax = (COPP_CGMSA_RedistributionControlRequired + COPP_CGMSA_CopyNever), - COPP_CGMSA_ForceDWORD = 0x7fffffff -} COPP_CGMSA_Protection_Level; - -typedef enum _COPP_ACP_Protection_Level { - COPP_ACP_Level0 = 0, - COPP_ACP_LevelMin = COPP_ACP_Level0, - COPP_ACP_Level1 = 1, - COPP_ACP_Level2 = 2, - COPP_ACP_Level3 = 3, - COPP_ACP_LevelMax = COPP_ACP_Level3, - COPP_ACP_ForceDWORD = 0x7fffffff -} COPP_ACP_Protection_Level; - -#define COPP_NoProtectionLevelAvailable -1 -#define COPP_DefaultProtectionLevel 0 - -// -// Bit flags of possible protection types. Note that it is possible to apply -// different protection settings to a single connector. -// -enum { - COPP_ProtectionType_Unknown = 0x80000000, - COPP_ProtectionType_None = 0x00000000, - COPP_ProtectionType_HDCP = 0x00000001, - COPP_ProtectionType_ACP = 0x00000002, - COPP_ProtectionType_CGMSA = 0x00000004, - COPP_ProtectionType_Mask = 0x80000007, - COPP_ProtectionType_Reserved = 0x7FFFFFF8 -}; - -DEFINE_GUID(DXVA_COPPSetSignaling, - 0x9a631a5, 0xd684, 0x4c60, 0x8e, 0x4d, 0xd3, 0xbb, 0xf, 0xb, 0xe3, 0xee); - -typedef struct _DXVA_COPPSetSignalingCmdData { - ULONG ActiveTVProtectionStandard; // See COPP_TVProtectionStandard - ULONG AspectRatioChangeMask1; - ULONG AspectRatioData1; // See COPP_ImageAspectRatio_EN300294 for ETSI EN 300 294 values - ULONG AspectRatioChangeMask2; - ULONG AspectRatioData2; - ULONG AspectRatioChangeMask3; - ULONG AspectRatioData3; - ULONG ExtendedInfoChangeMask[4]; - ULONG ExtendedInfoData[4]; - ULONG Reserved; -} DXVA_COPPSetSignalingCmdData; - -// Add format enum and data enum -typedef enum _COPP_TVProtectionStandard { - COPP_ProtectionStandard_Unknown = 0x80000000, - COPP_ProtectionStandard_None = 0x00000000, - COPP_ProtectionStandard_IEC61880_525i = 0x00000001, - COPP_ProtectionStandard_IEC61880_2_525i = 0x00000002, - COPP_ProtectionStandard_IEC62375_625p = 0x00000004, - COPP_ProtectionStandard_EIA608B_525 = 0x00000008, - COPP_ProtectionStandard_EN300294_625i = 0x00000010, - COPP_ProtectionStandard_CEA805A_TypeA_525p = 0x00000020, - COPP_ProtectionStandard_CEA805A_TypeA_750p = 0x00000040, - COPP_ProtectionStandard_CEA805A_TypeA_1125i = 0x00000080, - COPP_ProtectionStandard_CEA805A_TypeB_525p = 0x00000100, - COPP_ProtectionStandard_CEA805A_TypeB_750p = 0x00000200, - COPP_ProtectionStandard_CEA805A_TypeB_1125i = 0x00000400, - COPP_ProtectionStandard_ARIBTRB15_525i = 0x00000800, - COPP_ProtectionStandard_ARIBTRB15_525p = 0x00001000, - COPP_ProtectionStandard_ARIBTRB15_750p = 0x00002000, - COPP_ProtectionStandard_ARIBTRB15_1125i = 0x00004000, - COPP_ProtectionStandard_Mask = 0x80007FFF, - COPP_ProtectionStandard_Reserved = 0x7FFF8000 -} COPP_TVProtectionStandard; - -#define COPP_ImageAspectRatio_EN300294_Mask 0x00000007 - -typedef enum _COPP_ImageAspectRatio_EN300294 { - COPP_AspectRatio_EN300294_FullFormat4by3 = 0, - COPP_AspectRatio_EN300294_Box14by9Center = 1, - COPP_AspectRatio_EN300294_Box14by9Top = 2, - COPP_AspectRatio_EN300294_Box16by9Center = 3, - COPP_AspectRatio_EN300294_Box16by9Top = 4, - COPP_AspectRatio_EN300294_BoxGT16by9Center = 5, - COPP_AspectRatio_EN300294_FullFormat4by3ProtectedCenter = 6, - COPP_AspectRatio_EN300294_FullFormat16by9Anamorphic = 7, - COPP_AspectRatio_ForceDWORD = 0x7fffffff -} COPP_ImageAspectRatio_EN300294; - -// ------------------------------------------------------------------------- -// COPPQueryStatus -// ------------------------------------------------------------------------- -typedef struct _DXVA_COPPStatusInput { - GUID rApp; // 16 bytes - GUID guidStatusRequestID;// 16 bytes - ULONG dwSequence; // 4 bytes - ULONG cbSizeData; // 4 bytes - UCHAR StatusData[4056]; // 4056 bytes (4056+4+4+16+16 = 4096) -} DXVA_COPPStatusInput, *LPDXVA_COPPStatusInput; - -typedef struct _DXVA_COPPStatusOutput { - GUID macKDI; // 16 bytes - ULONG cbSizeData; // 4 bytes - UCHAR COPPStatus[4076]; // 4076 bytes (4076+16+4 = 4096) -} DXVA_COPPStatusOutput, *LPDXVA_COPPStatusOutput; - -typedef enum _COPP_StatusFlags { - COPP_StatusNormal = 0x00, - COPP_LinkLost = 0x01, - COPP_RenegotiationRequired = 0x02, - COPP_StatusFlagsReserved = 0xFFFFFFFC -} COPP_StatusFlags; - -typedef struct _DXVA_COPPStatusData { - GUID rApp; - ULONG dwFlags; // See COPP_StatusFlags above - ULONG dwData; - ULONG ExtendedInfoValidMask; - ULONG ExtendedInfoData; -} DXVA_COPPStatusData; - -typedef struct _DXVA_COPPStatusDisplayData { - GUID rApp; - ULONG dwFlags; // See COPP_StatusFlags above - ULONG DisplayWidth; - ULONG DisplayHeight; - ULONG Format; // also contains extended color data - ULONG d3dFormat; - ULONG FreqNumerator; - ULONG FreqDenominator; -} DXVA_COPPStatusDisplayData; - -typedef enum _COPP_StatusHDCPFlags { - COPP_HDCPRepeater = 0x01, - COPP_HDCPFlagsReserved = 0xFFFFFFFE -} COPP_StatusHDCPFlags; - -typedef struct _DXVA_COPPStatusHDCPKeyData { - GUID rApp; - ULONG dwFlags; // See COPP_StatusFlags above - ULONG dwHDCPFlags; // See COPP_StatusHDCPFlags above - GUID BKey; // Lower 40 bits - GUID Reserved1; - GUID Reserved2; -} DXVA_COPPStatusHDCPKeyData; - -#define DXVA_COPPQueryStatusFnCode 0x05 -// lpInputData => DXVA_COPPStatusInput* -// lpOuputData => DXVA_COPPStatusOutput* - -// -// Status GUID and enumerations -// -DEFINE_GUID(DXVA_COPPQueryConnectorType, - 0x81d0bfd5,0x6afe,0x48c2,0x99,0xc0,0x95,0xa0,0x8f,0x97,0xc5,0xda); - -typedef enum _COPP_ConnectorType { - COPP_ConnectorType_Unknown = -1, - COPP_ConnectorType_VGA = 0, - COPP_ConnectorType_SVideo = 1, - COPP_ConnectorType_CompositeVideo = 2, - COPP_ConnectorType_ComponentVideo = 3, - COPP_ConnectorType_DVI = 4, - COPP_ConnectorType_HDMI = 5, - COPP_ConnectorType_LVDS = 6, - COPP_ConnectorType_TMDS = 7, - COPP_ConnectorType_D_JPN = 8, - COPP_ConnectorType_Internal = 0x80000000, // can be combined with the other connector types - COPP_ConnectorType_ForceDWORD = 0x7fffffff /* force 32-bit size enum */ -} COPP_ConnectorType; - -DEFINE_GUID(DXVA_COPPQueryProtectionType, - 0x38f2a801,0x9a6c,0x48bb,0x91,0x07,0xb6,0x69,0x6e,0x6f,0x17,0x97); - -DEFINE_GUID(DXVA_COPPQueryLocalProtectionLevel, - 0xb2075857,0x3eda,0x4d5d,0x88,0xdb,0x74,0x8f,0x8c,0x1a,0x05,0x49); - -DEFINE_GUID(DXVA_COPPQueryGlobalProtectionLevel, - 0x1957210a,0x7766,0x452a,0xb9,0x9a,0xd2,0x7a,0xed,0x54,0xf0,0x3a); - -DEFINE_GUID(DXVA_COPPQueryDisplayData, - 0xd7bf1ba3,0xad13,0x4f8e,0xaf,0x98,0x0d,0xcb,0x3c,0xa2,0x04,0xcc); - -DEFINE_GUID(DXVA_COPPQueryHDCPKeyData, - 0xdb59d74, 0xa992, 0x492e, 0xa0, 0xbd, 0xc2, 0x3f, 0xda, 0x56, 0x4e, 0x0); - -DEFINE_GUID(DXVA_COPPQueryBusData, - 0xc6f4d673, 0x6174, 0x4184, 0x8e, 0x35, 0xf6, 0xdb, 0x52, 0x0, 0xbc, 0xba); - -typedef enum _COPP_BusType { - COPP_BusType_Unknown = 0, - COPP_BusType_PCI = 1, - COPP_BusType_PCIX = 2, - COPP_BusType_PCIExpress = 3, - COPP_BusType_AGP = 4, - COPP_BusType_Integrated = 0x80000000, // can be combined with the other bus types - COPP_BusType_ForceDWORD = 0x7fffffff /* force 32-bit size enum */ -} COPP_BusType; - -DEFINE_GUID(DXVA_COPPQuerySignaling, - 0x6629a591, 0x3b79, 0x4cf3, 0x92, 0x4a, 0x11, 0xe8, 0xe7, 0x81, 0x16, 0x71); - -typedef struct _DXVA_COPPStatusSignalingCmdData { - GUID rApp; - ULONG dwFlags; // See COPP_StatusFlags above - ULONG AvailableTVProtectionStandards; // See COPP_TVProtectionStandard - ULONG ActiveTVProtectionStandard; // See COPP_TVProtectionStandard - ULONG TVType; - ULONG AspectRatioValidMask1; - ULONG AspectRatioData1; // See COPP_AspectRatio_EN300294 for ETSI EN 300 294 values - ULONG AspectRatioValidMask2; - ULONG AspectRatioData2; - ULONG AspectRatioValidMask3; - ULONG AspectRatioData3; - ULONG ExtendedInfoValidMask[4]; - ULONG ExtendedInfoData[4]; -} DXVA_COPPStatusSignalingCmdData; - -#endif /* __DIRECTX_VA_CERTOUTPUTPROTECT__ */ - -#endif /* (DIRECT3D_VERSION >= 0x0900) */ -#endif /* _DXVA9TYP_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/fcb.h b/qt-correction-tool/pub/ddk/fcb.h deleted file mode 100644 index defb0c5..0000000 --- a/qt-correction-tool/pub/ddk/fcb.h +++ /dev/null @@ -1,1599 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - Fcb.h - -Abstract: - - This module defines File Control Block data structures, by which we mean: - - 1) File Control Blocks (FCB) - 2) File Object Extensions (FOXB) - 3) Net Roots (NET_ROOT) - 4) ServerSide Open Context (SRV_OPEN) - 5) Server Call Context (SRV_CALL) - 6) View of Net Roots (V_NET_ROOT) - - The more complete description follows the prototypes. - -Author: ---*/ - -#ifndef _FCB_STRUCTS_DEFINED_ -#define _FCB_STRUCTS_DEFINED_ - -#include "fcbtable.h" -#include "buffring.h" - -typedef NODE_TYPE_CODE TYPE_OF_OPEN; - -struct _FCB_INIT_PACKET; -typedef struct _FCB_INIT_PACKET *PFCB_INIT_PACKET; - - -/* ----------------------------------------------------------- - There are six important data structures in the wrapper that are shared with the - various mini redirectors. These data structures come in two flavours -- the - mini redirector flavour which contains only those fields that can be manipulated - by the mini redirector and the RDBSS flavour defined here. The mini redirector - flavour carries the prefix MRX_. - - The six data structures are SRV_CALL,NET_ROOT,V_NET_ROOT,FCB,SRV_OPEN and FOBX - respectively. - - The global view of these structures is the following (information on each of the - data structures follows the locking description ) - - L O C K I N G <------- - - There are two levels of lookup tables used: a global table for srvcalls - and netroots and a table-per-netroot for fcbs. This allows directory - operations on different netroots to be almost completely noninterfering - (once the connections are established). Directory operations on the - same netroot do intefere slightly. The following table describes what - locks you need: - - OPERATION DATATYPE LOCK REQUIRED - - create/finalize srvcall/(v)netroot exclusive on netnametablelock - ref/deref/lookup srvcall/(v)netroot shared on netnametablelock (at least) - - create/finalize fcb/srvopen/fobx exclusive on netroot->fcbtablelock - ref/deref/lookup fcb/srvopen/fobx shared on netroot->fcbtablelock - - Note that manipulations on srvopens and fobxs require the same lock as - fcbs....this is simply a memory saving idea. It would be - straightforward to add another resource at the fcb level to remove this; - a set of sharted resources could be used to decrease the probability of - collision to an acceptably low level. - - R E F C O U N T S <--------------- - - Each of the structures is reference counted. The counts are the - following: - - refcount(srvcall) = number of netroots pointing to srvcall + DYNAMIC - refcount(netroot) = number of fcbs pointing to netroot + DYNAMIC - refcount(fcb) = number of fcbs pointing to netroot + DYNAMIC - refcount(srvopen) = number of fcbs pointing to netroot + DYNAMIC - refcount(fobx) = DYNAMIC - - In each case, dynamic refers to the number of callers that have - referenced the structure without dereferencing it. The static part of - the refcount is maintained by the routines themselves; for example, - CreateNetRoot increments the refcount for the associated srvcall. - Reference and Successful Lookups increment the reference counts; - dereference decrements the count. Creates set the reference counts to 1, - - If you require both locks (like FinalizeNetFcb), you take the fcblock - first AND THEN the global table lock. obviously, you release in the - opposite order. - -----------------------------------*/ - -// -// SRV_CALL -// -// A global list of the SRV_CALL structures is maintained in the global -// data. Each SrvCall structure has stuff that is unique to a srv_call. -// Now, the rx doesn't know what this stuff is except for -// -// 0) signature and refcount -// a) a name and associated table stuff -// b) a list of associated NET_ROOTs -// c) a set of timing parameters that control how often the subrx wants -// to be called by the rx in different circumstances (i.e. idle timouts) -// d) the minirdr id -// . -// . -// z) whatever additional storage is request by the minirdr (or creator of the block). -// -// In fact, the Unicode name of the structure is carried in the structure itself -// at the end. The extra space begins at the end of the known stuff so that a -// mini redirector can just refer to his extra space using the context fields - -// These flags are not visible to the mini redirectors. - -#define SRVCALL_FLAG_NO_CONNECTION_ALLOWED (0x10000) -#define SRVCALL_FLAG_NO_WRITES_ALLOWED (0x20000) -#define SRVCALL_FLAG_NO_DELETES_ALLOWED (0x40000) - -#ifdef __cplusplus -typedef struct _SRV_CALL : public MRX_SRV_CALL { -#else // !__cplusplus -typedef struct _SRV_CALL { - - // - // The portion of SRV_CALL visible to mini redirectors. - // - - union { - MRX_SRV_CALL; - struct { - MRX_NORMAL_NODE_HEADER spacer; - }; - }; -#endif // __cplusplus - - // - // The finalization of a SRV_CALL instance consists of two parts, - // destroying the association with all NET_ROOTS etc and freeing the - // memory. There can be a delay between these two and this field - // prevents thefirst step from being duplicated. - // - - BOOLEAN UpperFinalizationDone; - - // - // Name and Prefixtable entry for name lookups - // - - RX_PREFIX_ENTRY PrefixEntry; - - // - // Current condition of the SRV_CALL, i.e., good/bad/in transition - // - - RX_BLOCK_CONDITION Condition; - - ULONG SerialNumberForEnum; - - // - // Number of delayed close files - // - - __volatile LONG NumberOfCloseDelayedFiles; - - // - // List of Contexts which are waiting for the SRV_CALL transitioning - // to be completed before resumption of processing. This typically - // happens when concurrent requests are directed at a server. One of - // these requests initiates the construction while the other requests - // are queued. - // - - LIST_ENTRY TransitionWaitList; - - // - // List Entry to thread together all the SRV_CALL instances marked - // for garbage collection/scavenging. - // - - LIST_ENTRY ScavengerFinalizationList; - - // - // Synchronization context for coordinating the purge operations on the - // files opened at this server. - // - - PURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext; - - // - // The Buffering manager for coordinating/processing the buffering state - // change requests of the files opened at the server. - // - - RX_BUFFERING_MANAGER BufferingManager; -} SRV_CALL, *PSRV_CALL; - -// -// A NET_ROOT contains -// 0) signature and refcount -// a) a name and associated table stuff -// b) backpointer to the SRV_CALL structure -// c) size information for the various substructures -// d) a lookuptable of FCB structures -// . -// . -// z) whatever additional storage is request by the minirdr (or creator of the block). -// -// A NET_ROOT is what the rx wants to deal with.....not a server. -// Accordingly, the rx calls down to open a netroot and the subrx is -// responsible for opening a server and calling up to put the right -// structures. -// - -#define NETROOT_FLAG_ENCLOSED_ALLOCATED ( 0x00010000 ) -#define NETROOT_FLAG_DEVICE_NETROOT ( 0x00020000 ) -#define NETROOT_FLAG_FINALIZATION_IN_PROGRESS ( 0x00040000 ) -#define NETROOT_FLAG_NAME_ALREADY_REMOVED ( 0x00080000 ) - -#define NETROOT_INIT_KEY (0) - -#ifdef __cplusplus -typedef struct _NET_ROOT : public MRX_NET_ROOT { -#else // !__cplusplus -typedef struct _NET_ROOT { - - // - // The porion of NET_ROOT instance visible to mini redirectors. - // - - union { - MRX_NET_ROOT; - struct { - MRX_NORMAL_NODE_HEADER spacer; - PSRV_CALL SrvCall; - }; - }; -#endif // __cplusplus - - // - // The finalization of a NET_ROOT instance consists of two parts, - // destroying the association with all V_NET_ROOTS etc and freeing the - // memory. There can be a delay between these two and this field - // prevents thefirst step from being duplicated. - // - - BOOLEAN UpperFinalizationDone; - - // - // Current condition of the NET_ROOT, i.e., good/bad/in transition - // - - RX_BLOCK_CONDITION Condition; - - // - // List of Contexts which are waiting for the NET_ROOT transitioning - // to be completed before resumption of processing. This typically - // happens when concurrent requests are directed at a server. One of - // these requests initiates the construction while the other requests - // are queued. - // - - LIST_ENTRY TransitionWaitList; - - // - // List Entry to thread together all the NET_ROOT instances marked - // for garbage collection/scavenging. - // - - LIST_ENTRY ScavengerFinalizationList; - - // - // Synchronization context for coordinating the purge operations on the - // files opened for this NET_ROOt - // - - PURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext; - - // - // The default V_NET_ROOT instance to be used on this NET_ROOT - // - - PV_NET_ROOT DefaultVNetRoot; - - // - // list of V_NET_ROOTs associated with the NET_ROOT - // - - LIST_ENTRY VirtualNetRoots; - - // - // the count of V_NET_ROOT instances associated with the NET_ROOT - // - - ULONG NumberOfVirtualNetRoots; - - ULONG SerialNumberForEnum; - - // - // NET_ROOT name and prefix table entry - // - - RX_PREFIX_ENTRY PrefixEntry; - - // - // the FCB's associated with this NET_ROOT - // - - RX_FCB_TABLE FcbTable; -} NET_ROOT, *PNET_ROOT; - -// -// A V_NETROOT contains -// 0) signature and refcount -// a) ptr to netroot and links. -// b) name info for table lookup (prefix) -// c) name for a prefix to be added to whatever name you see. this is for simulating a netroot -// mapped not at the root of the actual netroot. -// - -#ifdef __cplusplus -typedef struct _V_NET_ROOT : public MRX_V_NET_ROOT { -#else // !__cplusplus -typedef struct _V_NET_ROOT { - - // - // the portion of V_NET_ROOT visible to mini redirectors - // - - union { - MRX_V_NET_ROOT; - struct { - MRX_NORMAL_NODE_HEADER spacer; - PNET_ROOT NetRoot; - }; - }; -#endif // __cplusplus - - // - // The finalization of a V_NET_ROOT instance consists of two parts, - // destroying the association with all FCBs etc and freeing the - // memory. There can be a delay between these two and this field - // prevents thefirst step from being duplicated. - // - - BOOLEAN UpperFinalizationDone; - - BOOLEAN ConnectionFinalizationDone; - - // - // Current condition of the V_NET_ROOT, i.e., good/bad/in transition - // - - RX_BLOCK_CONDITION Condition; - - // - // Additional reference for the Delete FSCTL. This field is long as - // opposed to a BOOLEAN eventhough it can have only one of two values - // 0 or 1. This enables the usage of interlocked instructions - // - - __volatile LONG AdditionalReferenceForDeleteFsctlTaken; - - // - // Prefix table entry and V_NET_ROOT name ( prefix table entry is inserted - // in the RxNetNameTable) - // - - RX_PREFIX_ENTRY PrefixEntry; - - // - // this name is prepended to all fcbs (not currently used) - // - - UNICODE_STRING NamePrefix; - - // - // amount of bytes required to get past the netroot - // - - ULONG PrefixOffsetInBytes; - - // - // List entry to wire the V_NET_ROOT instance into a list of V_NET_ROOTS - // maintained in the NET_ROOT - // - - LIST_ENTRY NetRootListEntry; - - ULONG SerialNumberForEnum; - - // - // List of Contexts which are waiting for the NET_ROOT transitioning - // to be completed before resumption of processing. This typically - // happens when concurrent requests are directed at a server. One of - // these requests initiates the construction while the other requests - // are queued. - // - - LIST_ENTRY TransitionWaitList; - - // - // List Entry to thread together all the V_NET_ROOT instances marked - // for garbage collection/scavenging. - // - - LIST_ENTRY ScavengerFinalizationList; -} V_NET_ROOT, *PV_NET_ROOT; - -#define FILESIZE_LOCK_DISABLED(x) - -// -// An FCB contains -// 0) FSRTL_COMMON_HEADER -// 1) a reference count -// a) a name and associated table stuff -// b) backpointer to the NET_ROOT structure -// c) a list of SRV_OPEN structures -// d) device object -// e) dispatch table (not yet) -// . -// . -// z) whatever additional storage is request by the minirdr (or creator of the block). -// -// The FCB is pointed to by the FsContext Field in the file object. The -// rule is that all the guys sharing an FCB are talking about the same -// file. (unfortuantely, SMB servers are implemented today in such a way -// that names are aliased so that two different names could be the same -// actual file.....sigh!) The Fcb is the focal point of file -// operations...since operations on the same FCB are actually on the same -// file, synchronization is based on the Fcb rather than some higher level -// (the levels described so far are lower, i.e. farther from the user). -// Again, we will provide for colocation of FCB/SRV_OPEN/FOBX to improve -// paging behaviour. We don't colocate the FCB and NET_ROOT because the -// NET_ROOTs are not paged but FCBs usually are (i.e. unless they are -// paging files). -// -// The Fcb record corresponds to every open file and directory and is is split up into -// two portions a non paged part, i.e., an instance allocated in non paged pool and -// a paged part. The former is the NON_PAGED_FCB and the later is referred to as FCB. -// The FCB conatins a pointer to the corresponding NON_PAGED_FCB part. A backpointer -// is maintained from the NON_PAGED_FCB to the FCB for debugging purposes in debug builds -// - -typedef struct _NON_PAGED_FCB { - - // - // Struct type and size for debugging/tracking - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // The following field contains a record of special pointers used by - // MM and Cache to manipluate section objects. Note that the values - // are set outside of the file system. However the file system on an - // open/create will set the file object's SectionObject field to point - // to this field - // - - SECTION_OBJECT_POINTERS SectionObjectPointers; - - // - // This resource is used in the common fsrtl routines....allocated here for - // space locality. - // - - ERESOURCE HeaderResource; - - // - // This resource is also used in the common fsrtl routines....allocated here for - // space locality. - // - - ERESOURCE PagingIoResource; - -#ifdef USE_FILESIZE_LOCK - - // - // This mutex protect the filesize during read/write - // - - FAST_MUTEX FileSizeLock; - -#endif - - // - // The list of contexts whose processing has been suspended pending the state - // transition of the FCB. - // - - LIST_ENTRY TransitionWaitList; - - // - // This context is non-zero only if the file currently has asynchronous - // non-cached valid data length extending writes. It allows - // synchronization between pending writes and other operations. - // - - ULONG OutstandingAsyncWrites; - - // - // This event is set when OutstandingAsyncWrites transitions to zero. - // - - PKEVENT OutstandingAsyncEvent; - - KEVENT TheActualEvent; - - // - // The mechanism for the mini redirectors to store additional information - // - - PVOID MiniRdrContext[2]; - - // - // This is the mutex that is inserted into the FCB_ADVANCED_HEADER - // FastMutex field - // - - FAST_MUTEX AdvancedFcbHeaderMutex; - - // - // This resource is used to protect the buffered locks list - // - ERESOURCE BufferedLocksResource; - -#if DBG - PFCB FcbBackPointer; -#endif - -} NON_PAGED_FCB, *PNON_PAGED_FCB; - -typedef enum _FCB_CONDITION { - FcbGood = 1, - FcbBad, - FcbNeedsToBeVerified -} FCB_CONDITION; - -// -// A enumerated type distinguishing the varios contexts under which the FCB resource -// is accquired. -// - -typedef enum _RX_FCBTRACKER_CASES { - - RX_FCBTRACKER_CASE_NORMAL, - RX_FCBTRACKER_CASE_NULLCONTEXT, - RX_FCBTRACKER_CASE_CBS_CONTEXT, - RX_FCBTRACKER_CASE_CBS_WAIT_CONTEXT, - RX_FCBTRACKER_CASE_MAXIMUM - -} RX_FCBTRACKER_CASES; - -typedef struct _FCB_LOCK { - - struct _FCB_LOCK *Next; - LARGE_INTEGER Length; - LARGE_INTEGER BytesOffset; - ULONG Key; - BOOLEAN ExclusiveLock; - -} FCB_LOCK, *PFCB_LOCK; - -typedef struct _FCB_BUFFERED_LOCKS { - - struct _FCB_LOCK *List; - __volatile ULONG PendingLockOps; - PERESOURCE Resource; - -} FCB_BUFFERED_LOCKS, *PFCB_BUFFERED_LOCKS; - - -#ifdef __cplusplus -typedef struct _FCB : public MRX_FCB { -#else // !__cplusplus -typedef struct _FCB { - - // - // Entries are reference counted. ordinarily this would be at the beginning but - // in the case of FCB's it will follows the common header and fixed part - // - - union { - MRX_FCB; - struct { - FSRTL_ADVANCED_FCB_HEADER spacer; - PNET_ROOT NetRoot; - }; - }; -#endif // !__cplusplus - - // - // VNetroot for this FCB, if any - // - - PV_NET_ROOT VNetRoot; - - // - // Structure for fields that must be in non-paged pool. - // - - PNON_PAGED_FCB NonPaged; - - // - // List Entry to thread together all the FCB instances marked - // for garbage collection/scavenging. - // - - LIST_ENTRY ScavengerFinalizationList; - - // - // The resource accquisition mechanism gives preference to buffering state change - // processing over other requests. Therefor when a buffering state change is - // indicated all subsequent requests are shunted off to wait on a buffering state - // change completion event. This enables the actual buffering state change processing - // to complete in a timely fashion. - // - - PKEVENT pBufferingStateChangeCompletedEvent; - - // - // Number of contexts awaiting buffering state change processing completion - // - - LONG NumberOfBufferingStateChangeWaiters; - - // - // the name in the table is always a suffix of the name as viewed by the mini - // redirector. the string in the prefix entry is the name in the table.... - // the "alreadyprefixedname: points to the whole name. - // - - RX_FCB_TABLE_ENTRY FcbTableEntry; - - // - // the name alongwith the MRX_NET_ROOT prefix, i.e. fully qualified name - // - - UNICODE_STRING PrivateAlreadyPrefixedName; - - // - // Indicates that the V_NET_ROOT related processing on finalization is complete - // - - BOOLEAN UpperFinalizationDone; - - // - // the present state of the FCB, good/bad/in transition - // - - RX_BLOCK_CONDITION Condition; - - // - // Pointer to the private dispatch table, if any. - // - - PRX_FSD_DISPATCH_VECTOR PrivateDispatchVector; - - // - // the device object that owns this fcb - // - - PRDBSS_DEVICE_OBJECT RxDeviceObject; - - PMINIRDR_DISPATCH MRxDispatch; - - // - // private fast dispatch table, if any. This allows lwio to add it's own hooks - // - - PFAST_IO_DISPATCH MRxFastIoDispatch; - - // - // Whenever a FCB instance is created a correpsonding SRV_OPEN and FOBX instance - // is also created. More than one SRV_OPEN can be associated with a given FCB and - // more than one FOBX is associated with a given SRV_OPEN. In a majority of the - // cases the number of SRV_OPENs associated with an FCB is one and the number of - // FOBX associated with a given SRV_OPEN is 1. In order to improve the spatial - // locality and the paging behaviour in such cases the allocation for the - // FCB also involves an allocation for the SRV_OPEN and FOBX. - // - - // - // set initially to the internally allocated srv_open - // - - PSRV_OPEN InternalSrvOpen; - - // - // set to internal fobx until allocated - // - - PFOBX InternalFobx; - - // - // the shared access for each time this file/directory is opened. - // - - SHARE_ACCESS ShareAccess; - SHARE_ACCESS ShareAccessPerSrvOpens; - - // - // this information is returned when the file is opened. ..might as well - // cache it so that so that tandard info query can be handled on the client - // side - // - - ULONG NumberOfLinks; - - // - // Cache these entries..... speeds up RxFastQueryBasicInfo(). - // - - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER LastChangeTime; - - // - // used to check by mini redirs in order to decide whether to update the FCB - // - - ULONG ulFileSizeVersion; - - // - // The following field is used by the filelock module - // to maintain current byte range locking information. - // - - FILE_LOCK FileLock; - - // - // do this wierdly so that I can call stuff be the inner or outer names - // - - union { -#ifndef __cplusplus - LOWIO_PER_FCB_INFO; -#endif // __cplusplus - LOWIO_PER_FCB_INFO LowIoPerFcbInfo; - }; - -#ifdef USE_FILESIZE_LOCK - PFAST_MUTEX FileSizeLock; -#endif - - // - // The following field is used to verify that the Ea's for a file - // have not changed between calls to query for Ea's. It is compared - // with a similar field in a Fobx. - // - // IMPORTANT!! **** DO NOT MOVE THIS FIELD **** - // - // The slack space in the union above is computed from - // the field offset of the EaModificationCount. - // - - ULONG EaModificationCount; - - FCB_BUFFERED_LOCKS BufferedLocks; - -#if DBG - PNON_PAGED_FCB CopyOfNonPaged; // copy of NonPaged so we can zap the real pointer and still find it -#endif -#ifdef RDBSS_TRACKER - ULONG FcbAcquires[RX_FCBTRACKER_CASE_MAXIMUM]; // there are four types - ULONG FcbReleases[RX_FCBTRACKER_CASE_MAXIMUM]; -#else -#error tracker must be defined -#endif - - PCHAR PagingIoResourceFile; - ULONG PagingIoResourceLine; - -} FCB, *PFCB; - -// -// Here are the Fcb state fields. -// - -#define FCB_STATE_SRVOPEN_USED ( 0x80000000 ) -#define FCB_STATE_FOBX_USED ( 0x40000000 ) -#define FCB_STATE_ADDEDBACKSLASH ( 0x20000000 ) -#define FCB_STATE_NAME_ALREADY_REMOVED ( 0x10000000 ) -#define FCB_STATE_WRITECACHING_ENABLED ( 0x08000000 ) -#define FCB_STATE_WRITEBUFFERING_ENABLED ( 0x04000000 ) -#define FCB_STATE_READCACHING_ENABLED ( 0x02000000 ) -#define FCB_STATE_READBUFFERING_ENABLED ( 0x01000000 ) -#define FCB_STATE_OPENSHARING_ENABLED ( 0x00800000 ) -#define FCB_STATE_COLLAPSING_ENABLED ( 0x00400000 ) -#define FCB_STATE_LOCK_BUFFERING_ENABLED ( 0x00200000 ) -#define FCB_STATE_FILESIZECACHEING_ENABLED ( 0x00100000 ) -#define FCB_STATE_FILETIMECACHEING_ENABLED ( 0x00080000 ) -#define FCB_STATE_TIME_AND_SIZE_ALREADY_SET ( 0x00040000 ) -#define FCB_STATE_SPECIAL_PATH ( 0x00020000 ) -#define FCB_STATE_FILE_IS_SHADOWED ( 0x00010000 ) -#define FCB_STATE_FILE_IS_DISK_COMPRESSED ( 0x00008000 ) -#define FCB_STATE_FILE_IS_BUF_COMPRESSED ( 0x00004000 ) -#define FCB_STATE_BUFFERSTATE_CHANGING ( 0x00002000 ) -#define FCB_STATE_FAKEFCB ( 0x00001000 ) -#define FCB_STATE_DELAY_CLOSE ( 0x00000800 ) -#define FCB_STATE_READAHEAD_DEFERRED ( 0x00000100 ) -#define FCB_STATE_ORPHANED ( 0x00000080 ) -#define FCB_STATE_BUFFERING_STATE_CHANGE_PENDING ( 0x00000040 ) -#define FCB_STATE_TEMPORARY ( 0x00000020 ) -#define FCB_STATE_DISABLE_LOCAL_BUFFERING ( 0x00000010 ) -#define FCB_STATE_LWIO_ENABLED ( 0x00000008 ) -#define FCB_STATE_PAGING_FILE ( 0x00000004 ) -#define FCB_STATE_TRUNCATE_ON_CLOSE ( 0x00000002 ) -#define FCB_STATE_DELETE_ON_CLOSE ( 0x00000001 ) - -#define FCB_STATE_BUFFERING_STATE_MASK \ - (( FCB_STATE_WRITECACHING_ENABLED \ - | FCB_STATE_WRITEBUFFERING_ENABLED \ - | FCB_STATE_READCACHING_ENABLED \ - | FCB_STATE_READBUFFERING_ENABLED \ - | FCB_STATE_OPENSHARING_ENABLED \ - | FCB_STATE_COLLAPSING_ENABLED \ - | FCB_STATE_LOCK_BUFFERING_ENABLED \ - | FCB_STATE_FILESIZECACHEING_ENABLED \ - | FCB_STATE_FILETIMECACHEING_ENABLED )) -// -// This is the MAX recursive resource limit. -// - -#define MAX_FCB_ASYNC_ACQUIRE (0xf000) - -typedef struct _FCB_INIT_PACKET { - PULONG pAttributes; // in the fcb this is DirentRxFlags; - PULONG pNumLinks; // in the fcb this is NumberOfLinks; - PLARGE_INTEGER pCreationTime; // these fields are the same as for the Fcb - PLARGE_INTEGER pLastAccessTime; - PLARGE_INTEGER pLastWriteTime; - PLARGE_INTEGER pLastChangeTime; - PLARGE_INTEGER pAllocationSize; // common header fields - PLARGE_INTEGER pFileSize; - PLARGE_INTEGER pValidDataLength; -} FCB_INIT_PACKET; - -// -// A SRV_OPEN contains -// 0) signature and refcount -// a) backpointer to the FCB -// b) backpointer to the NET_ROOT //maybe -// c) a list of FOXB structures -// d) access rights and collapsability status -// . -// . -// z) whatever additional storage is request by the minirdr (or creator of the block). -// -// The SRV_OPEN points to a structure describing a spevific open on the -// server; multiple file objects and fileobject extensions (FOBXs) can -// share the same srvopen if the access rights are correct. For example, -// this would be where the FID is stored for SMBs. A list of these hangs -// from the FCB. Similarly, all fileobject extensionss that share the same -// serverside open are listed together here. Also here is information -// about whether a new open of this FCB can share this serverside open -// context; obviously the guys that pass the test on the list. -// - -// -// The SRVOPEN flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs. -// The visible ones are defined above and the definitions for the invisible ones can be found -// in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible -// to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be -// enforced in defining new flags. -// - -#define SRVOPEN_FLAG_ENCLOSED_ALLOCATED (0x10000) -#define SRVOPEN_FLAG_FOBX_USED (0x20000) -#define SRVOPEN_FLAG_SHAREACCESS_UPDATED (0x40000) - -#ifdef __cplusplus -typedef struct _SRV_OPEN : public MRX_SRV_OPEN { -#else // !__cplusplus -typedef struct _SRV_OPEN { - - // - // the portion of SRV_OPEN visible to all the mini redirectors. - // - - union { - MRX_SRV_OPEN; - struct { - MRX_NORMAL_NODE_HEADER spacer; - - // - // the Fcb and VNetRoot for this srv_open - // - - PFCB Fcb; - PV_NET_ROOT VNetRoot; - }; - }; -#endif // !__cplusplus - - BOOLEAN UpperFinalizationDone; - - // - // the current condition of the SRV_OPEN, good/bad/in transition - // - - RX_BLOCK_CONDITION Condition; - - // - // Buffering state manager token - // - - __volatile LONG BufferingToken; - - // - // List Entry to thread together all the FCB instances marked - // for garbage collection/scavenging. - // - - LIST_ENTRY ScavengerFinalizationList; - - // - // The list of contexts whose processing has been suspended pending the state - // transition of the SRV_OPEN. - // - - LIST_ENTRY TransitionWaitList; - - // - // List Head for the list of FOBXs associated with this SRV_OPEN - // - - LIST_ENTRY FobxList; - - // - // The colocated instance of FOBX that is allocated whenever a SRV_OPEN - // instance is allocated. - // - - PFOBX InternalFobx; - - // - // the data structure for maintaining the mapping between the key - // associated with the SRV_OPEN instance by the mini redirector and - // the SRV_OPEN instance - // - - union { - LIST_ENTRY SrvOpenKeyList; - ULONG SequenceNumber; - }; - NTSTATUS OpenStatus; -} SRV_OPEN, *PSRV_OPEN; - -#define RxWriteCachingAllowed(FCB,SRVOPEN) \ - (FlagOn( (FCB)->FcbState, FCB_STATE_WRITECACHING_ENABLED ) && \ - !FlagOn( (SRVOPEN)->Flags, SRVOPEN_FLAG_DONTUSE_WRITE_CACHING )) - -#define SRVOPEN_INIT_KEY (0) - -// -// A FOBX contains -// 0) signature and refcount -// a) backpointer to the FCB -// b) backpointer to the SRV_OPEN -// c) context information about this open -// ... -// z) whatever additional storage is request by the minirdr (or creator of the block). -// -// The FOBX points to the "fileobject extension", i.e. all the stuff that -// is per fileobject is not stored there because the IO system provides -// fixed size filesystem objects (not a dig BTW, that's just the decision). -// The FOBX for any file object is referenced by the FsContext2 field in -// the fileobject. Even tho the FOBX is ordinarily a terminus in the -// structure, it is currently refcounted anyway. - -// The FOBX flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs. -// The visible ones are defined above and the definitions for the invisible ones can be found -// in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible -// to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be -// enforced in defining new flags. -// - -#define FOBX_FLAG_MATCH_ALL (0x10000) - -// -// This tells us whether we allocated buffers to hold search templates. -// - -#define FOBX_FLAG_FREE_UNICODE (0x20000) - -// -// These flags prevents cleanup from updating the modify time, etc. -// - -#define FOBX_FLAG_USER_SET_LAST_WRITE (0x40000) -#define FOBX_FLAG_USER_SET_LAST_ACCESS (0x80000) -#define FOBX_FLAG_USER_SET_CREATION (0x100000) -#define FOBX_FLAG_USER_SET_LAST_CHANGE (0x200000) - -// -// This bit says the file object associated with this Fobx was opened for -// read only access. -// - -#define FOBX_FLAG_READ_ONLY (0x400000) - -// -// the delete on close flag is used to track a file object that was opened with delete-on-close; -// when this object is closed, we copy the bit to the fcb and make it global -// - -#define FOBX_FLAG_DELETE_ON_CLOSE (0x800000) - -// -// this bits is used by minirdrs that do not have NT semantics. for example, the smbmini has -// to close a file before it can try a rename or delete. after the operation, we prevent people from -// getting back in. -// - -#define FOBX_FLAG_SRVOPEN_CLOSED (0x1000000) - -// -// this bit is used to tell whether the original name was a UNC name so that -// we can return the name the same way -// - -#define FOBX_FLAG_UNC_NAME (0x2000000) - -// -// this flag tells if this fobx is allocated as part of a larger structure -// - -#define FOBX_FLAG_ENCLOSED_ALLOCATED (0x4000000) - -// -// this flag specfies if the FOBX was included in the count of dormant -// files against the server. -// - -#define FOBX_FLAG_MARKED_AS_DORMANT (0x8000000) - -// -// this flag notes down the fact that some writes have been issued on this FOBX -// this is used to issue flushes on close -// - -#define FOBX_FLAG_WRITES_ISSUED (0x10000000) - -#ifdef __cplusplus -typedef struct _FOBX : public MRX_FOBX { -#else // !__cplusplus -typedef struct _FOBX { - // - // the portion of FOBX visible to the mini redirectors - // - - union { - MRX_FOBX; - struct { - MRX_NORMAL_NODE_HEADER spacer; - PSRV_OPEN SrvOpen; - }; - }; -#endif // __cplusplus - - // - // a serial number....it wraps but not often - // - - __volatile ULONG FobxSerialNumber; - - // - // list entry to wire the FOBX to the list of FOBXs maintained in - // the associated SRV_OPEN - // - - LIST_ENTRY FobxQLinks; - - // - // list entry to gather all the FOBX instance marked for garbage collection - // scavenging - // - - LIST_ENTRY ScavengerFinalizationList; - - // - // list entry to thread together all the FOBXs which have a pending close - // operation. - // - - LIST_ENTRY ClosePendingList; - - LARGE_INTEGER CloseTime; - - BOOLEAN UpperFinalizationDone; - BOOLEAN ContainsWildCards; - BOOLEAN fOpenCountDecremented; - - // - // Parameters depending on the type of file opened, pipe/file etc. - // - - union { - - struct { - - union { -#ifndef __cplusplus - MRX_PIPE_HANDLE_INFORMATION; -#endif // __cplusplus - MRX_PIPE_HANDLE_INFORMATION PipeHandleInformation; - }; - - LARGE_INTEGER CollectDataTime; - ULONG CollectDataSize; - THROTTLING_STATE ThrottlingState; // for peek and read om msgmodepipes - - // - // these serialization Qs must be together - // and read must be the first - // - - LIST_ENTRY ReadSerializationQueue; - LIST_ENTRY WriteSerializationQueue; - } NamedPipe; - - struct { - RXVBO PredictedReadOffset; - RXVBO PredictedWriteOffset; - THROTTLING_STATE LockThrottlingState; // for locks - LARGE_INTEGER LastLockOffset; - LARGE_INTEGER LastLockRange; - } DiskFile; - } Specific; - - // - // Only required for finalization. - // We do not take a reference on the RxDeviceObject when copied from the FCB, - // as the FCB holds a reference, and FCB finalization will happen only after - // FOBX finalization. - // - - PRDBSS_DEVICE_OBJECT RxDeviceObject; - -} FOBX, *PFOBX; - - -#define FOBX_NUMBER_OF_SERIALIZATION_QUEUES 2 - -// -// The RDBSS wrapper relies upon ref. counting to mark the instances of -// various data structures. The following macros implement a debugging -// mechanism to track/log the reference counts associated with various -// data structures. A fine grained control to monitor each data structure -// separately is provided. Each of these can be further controlled to either -// print the tracking info or log it. -// - -#define RDBSS_REF_TRACK_SRVCALL (0x00000001) -#define RDBSS_REF_TRACK_NETROOT (0x00000002) -#define RDBSS_REF_TRACK_VNETROOT (0x00000004) -#define RDBSS_REF_TRACK_NETFOBX (0x00000008) -#define RDBSS_REF_TRACK_NETFCB (0x00000010) -#define RDBSS_REF_TRACK_SRVOPEN (0x00000020) - -#define RX_LOG_REF_TRACKING (0x80000000) -#define RX_PRINT_REF_TRACKING (0x40000000) - -// -// The reference count tracking mechanism is activated by setting the following -// variable to the appropriate value defined above. -// - -extern ULONG RdbssReferenceTracingValue; - -// -// Macros for tracking the line number and the file of each reference and -// derefernce on the data structure. on Non DBG builds they are defined as -// NOTHING. For each data structure the appropriate reference/dereference -// macro is defined, These should be used instead of raw manipulation of -// the reference counts. -// - -VOID -RxpTrackReference ( - __in ULONG TraceType, - __in PCSTR FileName, - __in ULONG Line, - __in PVOID Instance - ); - -BOOLEAN -RxpTrackDereference ( - __in ULONG TraceType, - __in PCSTR FileName, - __in ULONG Line, - __in PVOID Instance - ); - -#define REF_TRACING_ON(TraceMask) (TraceMask & RdbssReferenceTracingValue) -#define PRINT_REF_COUNT(TYPE,Count) \ - if (REF_TRACING_ON( RDBSS_REF_TRACK_ ## TYPE ) && \ - (RdbssReferenceTracingValue & RX_PRINT_REF_TRACKING)) { \ - DbgPrint("%ld\n",Count); \ - } - -#define RxReferenceSrvCallAtDpc(SrvCall) \ - RxpTrackReference( RDBSS_REF_TRACK_SRVCALL, __FILE__, __LINE__, SrvCall ); \ - ASSERT( SrvCall->NodeReferenceCount > 1 ); \ - InterlockedIncrement( &SrvCall->NodeReferenceCount ) - -#define RxReferenceSrvCall(SrvCall) \ - RxpTrackReference( RDBSS_REF_TRACK_SRVCALL, __FILE__, __LINE__, SrvCall ); \ - RxReference( SrvCall ) - -#define RxDereferenceSrvCall(SrvCall,LockHoldingState) \ - RxpTrackDereference( RDBSS_REF_TRACK_SRVCALL, __FILE__, __LINE__, SrvCall ); \ - RxDereference(SrvCall, LockHoldingState ) - -#define RxReferenceNetRoot(NetRoot) \ - RxpTrackReference( RDBSS_REF_TRACK_NETROOT, __FILE__, __LINE__, NetRoot ); \ - RxReference( NetRoot ) - -#define RxDereferenceNetRoot( NetRoot, LockHoldingState ) \ - RxpTrackDereference( RDBSS_REF_TRACK_NETROOT, __FILE__, __LINE__, NetRoot );\ - RxDereference( NetRoot, LockHoldingState ) - -#define RxReferenceVNetRoot(VNetRoot) \ - RxpTrackReference( RDBSS_REF_TRACK_VNETROOT, __FILE__, __LINE__, VNetRoot );\ - RxReference( VNetRoot ) - -#define RxDereferenceVNetRoot( VNetRoot, LockHoldingState ) \ - RxpTrackDereference( RDBSS_REF_TRACK_VNETROOT, __FILE__, __LINE__, VNetRoot ); \ - RxDereference( VNetRoot, LockHoldingState ) - -#define RxReferenceNetFobx(Fobx) \ - RxpTrackReference( RDBSS_REF_TRACK_NETFOBX, __FILE__, __LINE__, Fobx ); \ - RxReference( Fobx ) - -#define RxDereferenceNetFobx(Fobx,LockHoldingState) \ - RxpTrackDereference( RDBSS_REF_TRACK_NETFOBX, __FILE__, __LINE__, Fobx ); \ - RxDereference( Fobx, LockHoldingState ) - -#define RxReferenceSrvOpen(SrvOpen) \ - RxpTrackReference( RDBSS_REF_TRACK_SRVOPEN, __FILE__, __LINE__, SrvOpen ); \ - RxReference( SrvOpen ) - -#define RxDereferenceSrvOpen( SrvOpen, LockHoldingState ) \ - RxpTrackDereference( RDBSS_REF_TRACK_SRVOPEN, __FILE__, __LINE__, SrvOpen); \ - RxDereference( SrvOpen, LockHoldingState ) - -#define RxReferenceNetFcb(Fcb) \ - (RxpTrackReference( RDBSS_REF_TRACK_NETFCB, __FILE__, __LINE__, Fcb ), \ - RxpReferenceNetFcb( Fcb )) - -// -// the following macros manipulate the reference count and also return the -// status of the final derefence or finalize call. This results in the usage -// of the , operator. -// - -#define RxDereferenceNetFcb(Fcb) ( \ - ((LONG)RxpTrackDereference( RDBSS_REF_TRACK_NETFCB, __FILE__, __LINE__, Fcb )), \ - RxpDereferenceNetFcb( Fcb )) - -#define RxDereferenceAndFinalizeNetFcb(Fcb,RxContext,RecursiveFinalize,ForceFinalize) ( \ - RxpTrackDereference( RDBSS_REF_TRACK_NETFCB, __FILE__, __LINE__, Fcb ), \ - RxpDereferenceAndFinalizeNetFcb( Fcb, RxContext, RecursiveFinalize, ForceFinalize )) \ - -// -// Check for structure alignment errors -// - -VOID -RxCheckFcbStructuresForAlignment( - VOID - ); - - -// -// SRV_CALL related routines. -// - -PSRV_CALL -RxCreateSrvCall ( - IN PRX_CONTEXT RxContext, - IN PUNICODE_STRING Name, - IN PUNICODE_STRING InnerNamePrefix OPTIONAL, - IN PRX_CONNECTION_ID RxConnectionId - ); - - -#define RxWaitForStableSrvCall(SRVCALL,RXCONTEXT) { \ - RxDbgTrace( 0, Dbg, ("RxWaitForStableSrvCall -- %lx\n",(SRVCALL)) ); \ - RxWaitForStableCondition( &(SRVCALL)->Condition, &(SRVCALL)->TransitionWaitList, (RXCONTEXT), NULL); \ - } - -#define RxWaitForStableSrvCall_Async(SRVCALL,RXCONTEXT,PNTSTATUS) { \ - RxDbgTrace( 0, Dbg, ("RxWaitForStableSrvCall -- %lx\n",(SRVCALL)) ); \ - RxWaitForStableCondition( &(SRVCALL)->Condition, &(SRVCALL)->TransitionWaitList, (RXCONTEXT), (PNTSTATUS) ); \ - } - -#define RxTransitionSrvCall(SRVCALL,CONDITION) \ - RxDbgTrace( 0, Dbg, ("RxTransitionSrvCall -- %lx Condition -- %ld\n",(SRVCALL),(CONDITION)) ); \ - RxUpdateCondition( (CONDITION), &(SRVCALL)->Condition, &(SRVCALL)->TransitionWaitList ) - -BOOLEAN -RxFinalizeSrvCall ( - OUT PSRV_CALL ThisSrvCall, - IN BOOLEAN ForceFinalize - ); - -// -// NET_ROOT related routines. -// - -PNET_ROOT -RxCreateNetRoot ( - IN PSRV_CALL SrvCall, - IN PUNICODE_STRING Name, - IN ULONG NetRootFlags, - IN PRX_CONNECTION_ID OPTIONAL RxConnectionId - ); - -VOID -RxFinishNetRootInitialization ( - IN OUT PNET_ROOT ThisNetRoot, - IN PMINIRDR_DISPATCH Dispatch, - IN PUNICODE_STRING InnerNamePrefix, - IN ULONG FcbSize, - IN ULONG SrvOpenSize, - IN ULONG FobxSize, - IN ULONG NetRootFlags - ); - - -#define RxWaitForStableNetRoot(NETROOT,RXCONTEXT) \ - RxDbgTrace(0, Dbg, ("RxWaitForStableNetRoot -- %lx\n",(NETROOT))); \ - RxWaitForStableCondition(&(NETROOT)->Condition,&(NETROOT)->TransitionWaitList,(RXCONTEXT),NULL) - -#define RxTransitionNetRoot(NETROOT,CONDITION) \ - RxDbgTrace(0, Dbg, ("RxTransitionNetRoot -- %lx Condition -- %ld\n",(NETROOT),(CONDITION))); \ - RxUpdateCondition((CONDITION),&(NETROOT)->Condition,&(NETROOT)->TransitionWaitList) - -BOOLEAN -RxFinalizeNetRoot ( - OUT PNET_ROOT ThisNetRoot, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize - ); - -// -// V_NET_ROOT related routines -// - -NTSTATUS -RxInitializeVNetRootParameters ( - PRX_CONTEXT RxContext, - OUT LUID *LogonId, - OUT PULONG SessionId, - OUT PUNICODE_STRING *UserNamePtr, - OUT PUNICODE_STRING *UserDomainNamePtr, - OUT PUNICODE_STRING *PasswordPtr, - OUT PULONG Flags - ); - -VOID -RxUninitializeVNetRootParameters ( - IN PUNICODE_STRING UserName, - IN PUNICODE_STRING UserDomainName, - IN PUNICODE_STRING Password, - OUT PULONG Flags - ); - -PV_NET_ROOT -RxCreateVNetRoot ( - IN PRX_CONTEXT RxContext, - IN PNET_ROOT NetRoot, - IN PUNICODE_STRING CanonicalName, - IN PUNICODE_STRING LocalNetRootName, - IN PUNICODE_STRING FilePath, - IN PRX_CONNECTION_ID RxConnectionId - ); - -BOOLEAN -RxFinalizeVNetRoot ( - OUT PV_NET_ROOT ThisVNetRoot, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize - ); - -#define RxWaitForStableVNetRoot(VNETROOT,RXCONTEXT) \ - RxDbgTrace( 0, Dbg, ("RxWaitForStableVNetRoot -- %lx\n",(VNETROOT)) ); \ - RxWaitForStableCondition( &(VNETROOT)->Condition, &(VNETROOT)->TransitionWaitList, (RXCONTEXT), NULL ) - -#define RxTransitionVNetRoot(VNETROOT,CONDITION) \ - RxDbgTrace( 0, Dbg, ("RxTransitionVNetRoot -- %lx Condition -- %ld\n", (VNETROOT), (CONDITION)) ); \ - RxUpdateCondition( (CONDITION), &(VNETROOT)->Condition, &(VNETROOT)->TransitionWaitList ) - -#ifdef USE_FILESIZE_LOCK - -// -// FCB related routines. -// - -#define RxAcquireFileSizeLock(PFCB) { \ - ExAcquireFastMutex( (PFCB)->Specific.Fcb.FileSizeLock ); \ -} -#define RxReleaseFileSizeLock(PFCB) { \ - ExReleaseFastMutex((PFCB)->Specific.Fcb.FileSizeLock); \ -} - -#endif - -VOID -RxSetFileSizeWithLock ( - IN OUT PFCB Fcb, - IN PLONGLONG FileSize - ); - -VOID -RxGetFileSizeWithLock ( - IN PFCB Fcb, - OUT PLONGLONG FileSize - ); - -PFCB -RxCreateNetFcb ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PV_NET_ROOT VNetRoot, - IN PUNICODE_STRING Name - ); - -#define RxWaitForStableNetFcb(FCB,RXCONTEXT) \ - RxDbgTrace( 0, Dbg, ("RxWaitForStableNetFcb -- %lx\n",(FCB))); \ - RxWaitForStableCondition( &(FCB)->Condition, &(FCB)->NonPaged->TransitionWaitList, (RXCONTEXT), NULL ) - -#define RxTransitionNetFcb(FCB,CONDITION) \ - RxDbgTrace( 0, Dbg, ("RxTransitionNetFcb -- %lx Condition -- %ld\n",(FCB),(CONDITION))); \ - RxUpdateCondition( (CONDITION), &(FCB)->Condition, &(FCB)->NonPaged->TransitionWaitList ) - - -#define RxFormInitPacket(IP,I1,I1a,I2,I3,I4a,I4b,I5,I6,I7) (\ - IP.pAttributes = I1, \ - IP.pNumLinks = I1a, \ - IP.pCreationTime = I2, \ - IP.pLastAccessTime = I3, \ - IP.pLastWriteTime = I4a, \ - IP.pLastChangeTime = I4b, \ - IP.pAllocationSize = I5, \ - IP.pFileSize = I6, \ - IP.pValidDataLength = I7, \ - &IP) - -#if DBG -#define ASSERT_CORRECT_FCB_STRUCTURE_DBG_ONLY(___thisfcb) {\ - ASSERT( ___thisfcb->NonPaged == ___thisfcb->CopyOfNonPaged ); \ - ASSERT( ___thisfcb->NonPaged->FcbBackPointer == ___thisfcb ); \ - } -#else -#define ASSERT_CORRECT_FCB_STRUCTURE_DBG_ONLY(___thisfcb) -#endif - -#define ASSERT_CORRECT_FCB_STRUCTURE(THIS_FCB__) { \ - ASSERT( NodeTypeIsFcb(THIS_FCB__)); \ - ASSERT( THIS_FCB__->NonPaged != NULL ); \ - ASSERT( NodeType(THIS_FCB__->NonPaged) == RDBSS_NTC_NONPAGED_FCB); \ - ASSERT_CORRECT_FCB_STRUCTURE_DBG_ONLY(THIS_FCB__) \ - } - -RX_FILE_TYPE -RxInferFileType ( - IN PRX_CONTEXT RxContext - ); - -VOID -RxFinishFcbInitialization ( - IN OUT PMRX_FCB Fcb, - IN RX_FILE_TYPE FileType, - IN PFCB_INIT_PACKET InitPacket OPTIONAL - ); - -#define RxWaitForStableSrvOpen(SRVOPEN,RXCONTEXT) \ - RxDbgTrace( 0, Dbg, ("RxWaitForStableFcb -- %lx\n",(SRVOPEN)) ); \ - RxWaitForStableCondition( &(SRVOPEN)->Condition, &(SRVOPEN)->TransitionWaitList, (RXCONTEXT), NULL ) - -#define RxTransitionSrvOpen(SRVOPEN,CONDITION) \ - RxDbgTrace( 0, Dbg, ("RxTransitionSrvOpen -- %lx Condition -- %ld\n",(SRVOPEN),(CONDITION)) ); \ - RxUpdateCondition( (CONDITION), &(SRVOPEN)->Condition, &(SRVOPEN)->TransitionWaitList ) - -VOID -RxRemoveNameNetFcb ( - OUT PFCB ThisFcb - ); - -LONG -RxpReferenceNetFcb ( - PFCB Fcb - ); - -LONG -RxpDereferenceNetFcb ( - PFCB Fcb - ); - -BOOLEAN -RxpDereferenceAndFinalizeNetFcb ( - OUT PFCB ThisFcb, - IN PRX_CONTEXT RxContext, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize - ); - -#if DBG -extern BOOLEAN RxLoudFcbOpsOnExes; -BOOLEAN -RxLoudFcbMsg( - PUCHAR msg, - PUNICODE_STRING Name - ); -#else -#define RxLoudFcbMsg(a,b) (FALSE) -#endif - - -// -// SRV_OPEN related methods -// - -PSRV_OPEN -RxCreateSrvOpen ( - IN PV_NET_ROOT VNetRoot, - IN OUT PFCB Fcb - ); - -VOID -RxTransitionSrvOpenState ( - OUT PSRV_OPEN ThisSrvOpen, - IN RX_BLOCK_CONDITION Condition - ); - -BOOLEAN -RxFinalizeSrvOpen ( - OUT PSRV_OPEN ThisSrvOpen, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize - ); - -#if 0 -#else -INLINE -PUNICODE_STRING -GET_ALREADY_PREFIXED_NAME ( - PMRX_SRV_OPEN SrvOpen, - PMRX_FCB Fcb) -{ - PFCB ThisFcb = (PFCB)Fcb; - -#if DBG - if (SrvOpen != NULL ) { - ASSERT( NodeType( SrvOpen ) == RDBSS_NTC_SRVOPEN ); - ASSERT( ThisFcb != NULL ); - ASSERT( NodeTypeIsFcb( Fcb) ); - ASSERT( SrvOpen->pFcb == Fcb ); - ASSERT( SrvOpen->pAlreadyPrefixedName == &ThisFcb->PrivateAlreadyPrefixedName ); - } -#endif - - return( &ThisFcb->PrivateAlreadyPrefixedName); -} -#endif - -#define GET_ALREADY_PREFIXED_NAME_FROM_CONTEXT(Rxcontext) \ - (GET_ALREADY_PREFIXED_NAME( (Rxcontext)->pRelevantSrvOpen, (Rxcontext)->pFcb )) - -// -// FOBX related routines -// - -PMRX_FOBX -RxCreateNetFobx ( - OUT PRX_CONTEXT RxContext, - IN PMRX_SRV_OPEN MrxSrvOpen - ); - -BOOLEAN -RxFinalizeNetFobx ( - OUT PFOBX ThisFobx, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize - ); - -#endif // _FCB_STRUCTS_DEFINED_ - - diff --git a/qt-correction-tool/pub/ddk/fcbtable.h b/qt-correction-tool/pub/ddk/fcbtable.h deleted file mode 100644 index 084f418..0000000 --- a/qt-correction-tool/pub/ddk/fcbtable.h +++ /dev/null @@ -1,153 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - fcbtable.h - -Abstract: - - This module defines the data structures that facilitate management of the - collection of FCB's associated with a NET_ROOT - -Author: ---*/ - - -#ifndef _RXFCBTABLE_ -#define _RXFCBTABLE_ - -typedef struct _RX_FCB_TABLE_ENTRY { - - // - // Normal Header for Refcounted Structure - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // the computed hash value - // - - ULONG HashValue; - - // - // the path associated with the FCB - // - - UNICODE_STRING Path; - - // - // the threaded list of all entries in a bucket. - // - - LIST_ENTRY HashLinks; - - // - // Statistics for amortising lookup costs - // - - LONG Lookups; -} RX_FCB_TABLE_ENTRY, *PRX_FCB_TABLE_ENTRY; - - -#define RX_FCB_TABLE_NUMBER_OF_HASH_BUCKETS 32 - -typedef struct _RX_FCB_TABLE { - - // - // Normal Header for refcounted data structures - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // version stamp changes on each insertion/removal - // - - __volatile ULONG Version; - - BOOLEAN CaseInsensitiveMatch; - USHORT NumberOfBuckets; - - // - // Statistics for table maintenance - // - - __volatile LONG Lookups; - __volatile LONG FailedLookups; - __volatile LONG Compares; - - // - // Resource used to control table access - // - - ERESOURCE TableLock; - - // - // TableEntry for the Null string - // - - PRX_FCB_TABLE_ENTRY TableEntryForNull; - - // - // the hash buckets - // - - LIST_ENTRY HashBuckets[RX_FCB_TABLE_NUMBER_OF_HASH_BUCKETS]; -} RX_FCB_TABLE, *PRX_FCB_TABLE; - -extern -VOID -RxInitializeFcbTable ( - IN OUT PRX_FCB_TABLE FcbTable, - IN BOOLEAN CaseInsensitiveMatch - ); - -extern -VOID -RxFinalizeFcbTable ( - IN OUT PRX_FCB_TABLE FcbTable - ); - -extern -PFCB -RxFcbTableLookupFcb ( - IN PRX_FCB_TABLE FcbTable, - IN PUNICODE_STRING Path - ); - -extern -NTSTATUS -RxFcbTableInsertFcb ( - IN OUT PRX_FCB_TABLE FcbTable, - IN OUT PFCB Fcb - ); - -extern -NTSTATUS -RxFcbTableRemoveFcb ( - IN OUT PRX_FCB_TABLE FcbTable, - IN OUT PFCB Fcb - ); - -#define RxAcquireFcbTableLockShared(TABLE,WAIT) \ - ExAcquireResourceSharedLite( &(TABLE)->TableLock, WAIT ) - -#define RxAcquireFcbTableLockExclusive(TABLE,WAIT) \ - ExAcquireResourceExclusiveLite( &(TABLE)->TableLock, WAIT ) - -#define RxReleaseFcbTableLock(TABLE) \ - ExReleaseResourceLite( &(TABLE)->TableLock ) - -#define RxIsFcbTableLockExclusive(TABLE) ExIsResourceAcquiredExclusiveLite( &(TABLE)->TableLock ) - -#define RxIsFcbTableLockAcquired(TABLE) ( ExIsResourceAcquiredSharedLite( &(TABLE)->TableLock ) || \ - ExIsResourceAcquiredExclusiveLite( &(TABLE)->TableLock ) ) - - -#endif - diff --git a/qt-correction-tool/pub/ddk/filterpipeline.h b/qt-correction-tool/pub/ddk/filterpipeline.h deleted file mode 100644 index 12341ec..0000000 --- a/qt-correction-tool/pub/ddk/filterpipeline.h +++ /dev/null @@ -1,3130 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for filterpipeline.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __filterpipeline_h__ -#define __filterpipeline_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IPrintReadStream_FWD_DEFINED__ -#define __IPrintReadStream_FWD_DEFINED__ -typedef interface IPrintReadStream IPrintReadStream; -#endif /* __IPrintReadStream_FWD_DEFINED__ */ - - -#ifndef __IPrintWriteStream_FWD_DEFINED__ -#define __IPrintWriteStream_FWD_DEFINED__ -typedef interface IPrintWriteStream IPrintWriteStream; -#endif /* __IPrintWriteStream_FWD_DEFINED__ */ - - -#ifndef __IPrintWriteStreamFlush_FWD_DEFINED__ -#define __IPrintWriteStreamFlush_FWD_DEFINED__ -typedef interface IPrintWriteStreamFlush IPrintWriteStreamFlush; -#endif /* __IPrintWriteStreamFlush_FWD_DEFINED__ */ - - -#ifndef __IInterFilterCommunicator_FWD_DEFINED__ -#define __IInterFilterCommunicator_FWD_DEFINED__ -typedef interface IInterFilterCommunicator IInterFilterCommunicator; -#endif /* __IInterFilterCommunicator_FWD_DEFINED__ */ - - -#ifndef __IPrintPipelineManagerControl_FWD_DEFINED__ -#define __IPrintPipelineManagerControl_FWD_DEFINED__ -typedef interface IPrintPipelineManagerControl IPrintPipelineManagerControl; -#endif /* __IPrintPipelineManagerControl_FWD_DEFINED__ */ - - -#ifndef __IPrintPipelinePropertyBag_FWD_DEFINED__ -#define __IPrintPipelinePropertyBag_FWD_DEFINED__ -typedef interface IPrintPipelinePropertyBag IPrintPipelinePropertyBag; -#endif /* __IPrintPipelinePropertyBag_FWD_DEFINED__ */ - - -#ifndef __IPrintPipelineProgressReport_FWD_DEFINED__ -#define __IPrintPipelineProgressReport_FWD_DEFINED__ -typedef interface IPrintPipelineProgressReport IPrintPipelineProgressReport; -#endif /* __IPrintPipelineProgressReport_FWD_DEFINED__ */ - - -#ifndef __IPrintClassObjectFactory_FWD_DEFINED__ -#define __IPrintClassObjectFactory_FWD_DEFINED__ -typedef interface IPrintClassObjectFactory IPrintClassObjectFactory; -#endif /* __IPrintClassObjectFactory_FWD_DEFINED__ */ - - -#ifndef __IPrintPipelineFilter_FWD_DEFINED__ -#define __IPrintPipelineFilter_FWD_DEFINED__ -typedef interface IPrintPipelineFilter IPrintPipelineFilter; -#endif /* __IPrintPipelineFilter_FWD_DEFINED__ */ - - -#ifndef __IXpsDocumentProvider_FWD_DEFINED__ -#define __IXpsDocumentProvider_FWD_DEFINED__ -typedef interface IXpsDocumentProvider IXpsDocumentProvider; -#endif /* __IXpsDocumentProvider_FWD_DEFINED__ */ - - -#ifndef __IXpsDocumentConsumer_FWD_DEFINED__ -#define __IXpsDocumentConsumer_FWD_DEFINED__ -typedef interface IXpsDocumentConsumer IXpsDocumentConsumer; -#endif /* __IXpsDocumentConsumer_FWD_DEFINED__ */ - - -#ifndef __IXpsDocument_FWD_DEFINED__ -#define __IXpsDocument_FWD_DEFINED__ -typedef interface IXpsDocument IXpsDocument; -#endif /* __IXpsDocument_FWD_DEFINED__ */ - - -#ifndef __IFixedDocumentSequence_FWD_DEFINED__ -#define __IFixedDocumentSequence_FWD_DEFINED__ -typedef interface IFixedDocumentSequence IFixedDocumentSequence; -#endif /* __IFixedDocumentSequence_FWD_DEFINED__ */ - - -#ifndef __IFixedDocument_FWD_DEFINED__ -#define __IFixedDocument_FWD_DEFINED__ -typedef interface IFixedDocument IFixedDocument; -#endif /* __IFixedDocument_FWD_DEFINED__ */ - - -#ifndef __IPartBase_FWD_DEFINED__ -#define __IPartBase_FWD_DEFINED__ -typedef interface IPartBase IPartBase; -#endif /* __IPartBase_FWD_DEFINED__ */ - - -#ifndef __IFixedPage_FWD_DEFINED__ -#define __IFixedPage_FWD_DEFINED__ -typedef interface IFixedPage IFixedPage; -#endif /* __IFixedPage_FWD_DEFINED__ */ - - -#ifndef __IPartImage_FWD_DEFINED__ -#define __IPartImage_FWD_DEFINED__ -typedef interface IPartImage IPartImage; -#endif /* __IPartImage_FWD_DEFINED__ */ - - -#ifndef __IPartFont_FWD_DEFINED__ -#define __IPartFont_FWD_DEFINED__ -typedef interface IPartFont IPartFont; -#endif /* __IPartFont_FWD_DEFINED__ */ - - -#ifndef __IPartFont2_FWD_DEFINED__ -#define __IPartFont2_FWD_DEFINED__ -typedef interface IPartFont2 IPartFont2; -#endif /* __IPartFont2_FWD_DEFINED__ */ - - -#ifndef __IPartThumbnail_FWD_DEFINED__ -#define __IPartThumbnail_FWD_DEFINED__ -typedef interface IPartThumbnail IPartThumbnail; -#endif /* __IPartThumbnail_FWD_DEFINED__ */ - - -#ifndef __IPartPrintTicket_FWD_DEFINED__ -#define __IPartPrintTicket_FWD_DEFINED__ -typedef interface IPartPrintTicket IPartPrintTicket; -#endif /* __IPartPrintTicket_FWD_DEFINED__ */ - - -#ifndef __IPartColorProfile_FWD_DEFINED__ -#define __IPartColorProfile_FWD_DEFINED__ -typedef interface IPartColorProfile IPartColorProfile; -#endif /* __IPartColorProfile_FWD_DEFINED__ */ - - -#ifndef __IPartResourceDictionary_FWD_DEFINED__ -#define __IPartResourceDictionary_FWD_DEFINED__ -typedef interface IPartResourceDictionary IPartResourceDictionary; -#endif /* __IPartResourceDictionary_FWD_DEFINED__ */ - - -#ifndef __IXpsPartIterator_FWD_DEFINED__ -#define __IXpsPartIterator_FWD_DEFINED__ -typedef interface IXpsPartIterator IXpsPartIterator; -#endif /* __IXpsPartIterator_FWD_DEFINED__ */ - - -#ifndef __IPrintReadStreamFactory_FWD_DEFINED__ -#define __IPrintReadStreamFactory_FWD_DEFINED__ -typedef interface IPrintReadStreamFactory IPrintReadStreamFactory; -#endif /* __IPrintReadStreamFactory_FWD_DEFINED__ */ - - -#ifndef __IPartDiscardControl_FWD_DEFINED__ -#define __IPartDiscardControl_FWD_DEFINED__ -typedef interface IPartDiscardControl IPartDiscardControl; -#endif /* __IPartDiscardControl_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "imgerror.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_filterpipeline_0000_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//-------------------------------------------------------------------------- -#define E_ELEMENT_NOT_FOUND HRESULT_FROM_WIN32(ERROR_NOT_FOUND) -#define XPS_FP_PRINTER_NAME L"PrinterName" -#define XPS_FP_PROGRESS_REPORT L"ProgressReport" -#define XPS_FP_PRINTER_HANDLE L"PrinterHandle" -#define XPS_FP_USER_PRINT_TICKET L"PerUserPrintTicket" -#define XPS_FP_USER_TOKEN L"UserSecurityToken" -#define XPS_FP_JOB_ID L"PrintJobId" -#define XPS_FP_PRINT_CLASS_FACTORY L"PrintClassFactory" -#define XPS_FP_OUTPUT_FILE L"PrintOutputFileName" - - - - - - - - - - - - - - - - - - - - - - -typedef /* [public][public][public] */ -enum __MIDL___MIDL_itf_filterpipeline_0000_0000_0001 - { Compression_NotCompressed = 0, - Compression_Normal = ( Compression_NotCompressed + 1 ) , - Compression_Small = ( Compression_Normal + 1 ) , - Compression_Fast = ( Compression_Small + 1 ) - } EXpsCompressionOptions; - -typedef /* [public][public][public] */ -enum __MIDL___MIDL_itf_filterpipeline_0000_0000_0002 - { Font_Normal = 0, - Font_Obfusticate = ( Font_Normal + 1 ) - } EXpsFontOptions; - -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_filterpipeline_0000_0000_0003 - { XpsJob_DocumentSequenceAdded = 0, - XpsJob_FixedDocumentAdded = ( XpsJob_DocumentSequenceAdded + 1 ) , - XpsJob_FixedPageAdded = ( XpsJob_FixedDocumentAdded + 1 ) - } EXpsJobConsumption; - -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_filterpipeline_0000_0000_0004 - { Xps_Restricted_Font_Installable = 0, - Xps_Restricted_Font_NoEmbedding = 0x2, - Xps_Restricted_Font_PreviewPrint = 0x4, - Xps_Restricted_Font_Editable = 0x8 - } EXpsFontRestriction; - - - -extern RPC_IF_HANDLE __MIDL_itf_filterpipeline_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_filterpipeline_0000_0000_v0_0_s_ifspec; - -#ifndef __IPrintReadStream_INTERFACE_DEFINED__ -#define __IPrintReadStream_INTERFACE_DEFINED__ - -/* interface IPrintReadStream */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintReadStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4d47a67c-66cc-4430-850e-daf466fe5bc4") - IPrintReadStream : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Seek( - /* [annotation][in] */ - __in LONGLONG dlibMove, - /* [annotation][in] */ - __in DWORD dwOrigin, - /* [annotation][out] */ - __out ULONGLONG *plibNewPosition) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReadBytes( - /* [annotation][length_is][size_is][out] */ - __out_bcount_part(cbRequested, *pcbRead) void *pvBuffer, - /* [annotation][in] */ - __in ULONG cbRequested, - /* [annotation][out] */ - __out ULONG *pcbRead, - /* [annotation][out] */ - __out BOOL *pbEndOfFile) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintReadStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintReadStream * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintReadStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintReadStream * This); - - HRESULT ( STDMETHODCALLTYPE *Seek )( - IPrintReadStream * This, - /* [annotation][in] */ - __in LONGLONG dlibMove, - /* [annotation][in] */ - __in DWORD dwOrigin, - /* [annotation][out] */ - __out ULONGLONG *plibNewPosition); - - HRESULT ( STDMETHODCALLTYPE *ReadBytes )( - IPrintReadStream * This, - /* [annotation][length_is][size_is][out] */ - __out_bcount_part(cbRequested, *pcbRead) void *pvBuffer, - /* [annotation][in] */ - __in ULONG cbRequested, - /* [annotation][out] */ - __out ULONG *pcbRead, - /* [annotation][out] */ - __out BOOL *pbEndOfFile); - - END_INTERFACE - } IPrintReadStreamVtbl; - - interface IPrintReadStream - { - CONST_VTBL struct IPrintReadStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintReadStream_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintReadStream_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintReadStream_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintReadStream_Seek(This,dlibMove,dwOrigin,plibNewPosition) \ - ( (This)->lpVtbl -> Seek(This,dlibMove,dwOrigin,plibNewPosition) ) - -#define IPrintReadStream_ReadBytes(This,pvBuffer,cbRequested,pcbRead,pbEndOfFile) \ - ( (This)->lpVtbl -> ReadBytes(This,pvBuffer,cbRequested,pcbRead,pbEndOfFile) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintReadStream_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintWriteStream_INTERFACE_DEFINED__ -#define __IPrintWriteStream_INTERFACE_DEFINED__ - -/* interface IPrintWriteStream */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintWriteStream; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("65bb7f1b-371e-4571-8ac7-912f510c1a38") - IPrintWriteStream : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE WriteBytes( - /* [annotation][size_is][in] */ - __in_bcount(cbBuffer) const void *pvBuffer, - /* [annotation][in] */ - __in ULONG cbBuffer, - /* [annotation][out] */ - __out ULONG *pcbWritten) = 0; - - virtual void STDMETHODCALLTYPE Close( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintWriteStreamVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintWriteStream * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintWriteStream * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintWriteStream * This); - - HRESULT ( STDMETHODCALLTYPE *WriteBytes )( - IPrintWriteStream * This, - /* [annotation][size_is][in] */ - __in_bcount(cbBuffer) const void *pvBuffer, - /* [annotation][in] */ - __in ULONG cbBuffer, - /* [annotation][out] */ - __out ULONG *pcbWritten); - - void ( STDMETHODCALLTYPE *Close )( - IPrintWriteStream * This); - - END_INTERFACE - } IPrintWriteStreamVtbl; - - interface IPrintWriteStream - { - CONST_VTBL struct IPrintWriteStreamVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintWriteStream_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintWriteStream_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintWriteStream_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintWriteStream_WriteBytes(This,pvBuffer,cbBuffer,pcbWritten) \ - ( (This)->lpVtbl -> WriteBytes(This,pvBuffer,cbBuffer,pcbWritten) ) - -#define IPrintWriteStream_Close(This) \ - ( (This)->lpVtbl -> Close(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintWriteStream_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintWriteStreamFlush_INTERFACE_DEFINED__ -#define __IPrintWriteStreamFlush_INTERFACE_DEFINED__ - -/* interface IPrintWriteStreamFlush */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintWriteStreamFlush; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("07d11ff8-1753-4873-b749-6cdaf068e4c3") - IPrintWriteStreamFlush : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE FlushData( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintWriteStreamFlushVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintWriteStreamFlush * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintWriteStreamFlush * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintWriteStreamFlush * This); - - HRESULT ( STDMETHODCALLTYPE *FlushData )( - IPrintWriteStreamFlush * This); - - END_INTERFACE - } IPrintWriteStreamFlushVtbl; - - interface IPrintWriteStreamFlush - { - CONST_VTBL struct IPrintWriteStreamFlushVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintWriteStreamFlush_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintWriteStreamFlush_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintWriteStreamFlush_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintWriteStreamFlush_FlushData(This) \ - ( (This)->lpVtbl -> FlushData(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintWriteStreamFlush_INTERFACE_DEFINED__ */ - - -#ifndef __IInterFilterCommunicator_INTERFACE_DEFINED__ -#define __IInterFilterCommunicator_INTERFACE_DEFINED__ - -/* interface IInterFilterCommunicator */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IInterFilterCommunicator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4daf1e69-81fd-462d-940f-8cd3ddf56fca") - IInterFilterCommunicator : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RequestReader( - /* [annotation][out] */ - __out void **ppIReader) = 0; - - virtual HRESULT STDMETHODCALLTYPE RequestWriter( - /* [annotation][out] */ - __out void **ppIWriter) = 0; - - }; - -#else /* C style interface */ - - typedef struct IInterFilterCommunicatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IInterFilterCommunicator * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IInterFilterCommunicator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IInterFilterCommunicator * This); - - HRESULT ( STDMETHODCALLTYPE *RequestReader )( - IInterFilterCommunicator * This, - /* [annotation][out] */ - __out void **ppIReader); - - HRESULT ( STDMETHODCALLTYPE *RequestWriter )( - IInterFilterCommunicator * This, - /* [annotation][out] */ - __out void **ppIWriter); - - END_INTERFACE - } IInterFilterCommunicatorVtbl; - - interface IInterFilterCommunicator - { - CONST_VTBL struct IInterFilterCommunicatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IInterFilterCommunicator_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IInterFilterCommunicator_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IInterFilterCommunicator_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IInterFilterCommunicator_RequestReader(This,ppIReader) \ - ( (This)->lpVtbl -> RequestReader(This,ppIReader) ) - -#define IInterFilterCommunicator_RequestWriter(This,ppIWriter) \ - ( (This)->lpVtbl -> RequestWriter(This,ppIWriter) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IInterFilterCommunicator_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintPipelineManagerControl_INTERFACE_DEFINED__ -#define __IPrintPipelineManagerControl_INTERFACE_DEFINED__ - -/* interface IPrintPipelineManagerControl */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintPipelineManagerControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("aa3e4910-5889-4681-91ef-823ad4ed4e44") - IPrintPipelineManagerControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE RequestShutdown( - /* [annotation][in] */ - __in HRESULT hrReason, - /* [annotation][in] */ - __in IImgErrorInfo *pReason) = 0; - - virtual HRESULT STDMETHODCALLTYPE FilterFinished( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintPipelineManagerControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintPipelineManagerControl * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintPipelineManagerControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintPipelineManagerControl * This); - - HRESULT ( STDMETHODCALLTYPE *RequestShutdown )( - IPrintPipelineManagerControl * This, - /* [annotation][in] */ - __in HRESULT hrReason, - /* [annotation][in] */ - __in IImgErrorInfo *pReason); - - HRESULT ( STDMETHODCALLTYPE *FilterFinished )( - IPrintPipelineManagerControl * This); - - END_INTERFACE - } IPrintPipelineManagerControlVtbl; - - interface IPrintPipelineManagerControl - { - CONST_VTBL struct IPrintPipelineManagerControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintPipelineManagerControl_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintPipelineManagerControl_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintPipelineManagerControl_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintPipelineManagerControl_RequestShutdown(This,hrReason,pReason) \ - ( (This)->lpVtbl -> RequestShutdown(This,hrReason,pReason) ) - -#define IPrintPipelineManagerControl_FilterFinished(This) \ - ( (This)->lpVtbl -> FilterFinished(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintPipelineManagerControl_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintPipelinePropertyBag_INTERFACE_DEFINED__ -#define __IPrintPipelinePropertyBag_INTERFACE_DEFINED__ - -/* interface IPrintPipelinePropertyBag */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintPipelinePropertyBag; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8b8c99dc-7892-4a95-8a04-57422e9fbb47") - IPrintPipelinePropertyBag : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE AddProperty( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName, - /* [annotation][in] */ - __in const VARIANT *pVar) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetProperty( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName, - /* [annotation][out] */ - __out VARIANT *pVar) = 0; - - virtual BOOL STDMETHODCALLTYPE DeleteProperty( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintPipelinePropertyBagVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintPipelinePropertyBag * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintPipelinePropertyBag * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintPipelinePropertyBag * This); - - HRESULT ( STDMETHODCALLTYPE *AddProperty )( - IPrintPipelinePropertyBag * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName, - /* [annotation][in] */ - __in const VARIANT *pVar); - - HRESULT ( STDMETHODCALLTYPE *GetProperty )( - IPrintPipelinePropertyBag * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName, - /* [annotation][out] */ - __out VARIANT *pVar); - - BOOL ( STDMETHODCALLTYPE *DeleteProperty )( - IPrintPipelinePropertyBag * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszName); - - END_INTERFACE - } IPrintPipelinePropertyBagVtbl; - - interface IPrintPipelinePropertyBag - { - CONST_VTBL struct IPrintPipelinePropertyBagVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintPipelinePropertyBag_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintPipelinePropertyBag_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintPipelinePropertyBag_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintPipelinePropertyBag_AddProperty(This,pszName,pVar) \ - ( (This)->lpVtbl -> AddProperty(This,pszName,pVar) ) - -#define IPrintPipelinePropertyBag_GetProperty(This,pszName,pVar) \ - ( (This)->lpVtbl -> GetProperty(This,pszName,pVar) ) - -#define IPrintPipelinePropertyBag_DeleteProperty(This,pszName) \ - ( (This)->lpVtbl -> DeleteProperty(This,pszName) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintPipelinePropertyBag_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintPipelineProgressReport_INTERFACE_DEFINED__ -#define __IPrintPipelineProgressReport_INTERFACE_DEFINED__ - -/* interface IPrintPipelineProgressReport */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintPipelineProgressReport; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("edc12c7c-ed40-4ea5-96a6-5e4397497a61") - IPrintPipelineProgressReport : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ReportProgress( - /* [annotation][in] */ - __in EXpsJobConsumption update) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintPipelineProgressReportVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintPipelineProgressReport * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintPipelineProgressReport * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintPipelineProgressReport * This); - - HRESULT ( STDMETHODCALLTYPE *ReportProgress )( - IPrintPipelineProgressReport * This, - /* [annotation][in] */ - __in EXpsJobConsumption update); - - END_INTERFACE - } IPrintPipelineProgressReportVtbl; - - interface IPrintPipelineProgressReport - { - CONST_VTBL struct IPrintPipelineProgressReportVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintPipelineProgressReport_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintPipelineProgressReport_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintPipelineProgressReport_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintPipelineProgressReport_ReportProgress(This,update) \ - ( (This)->lpVtbl -> ReportProgress(This,update) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintPipelineProgressReport_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintClassObjectFactory_INTERFACE_DEFINED__ -#define __IPrintClassObjectFactory_INTERFACE_DEFINED__ - -/* interface IPrintClassObjectFactory */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintClassObjectFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9af593dd-9b02-48a8-9bad-69ace423f88b") - IPrintClassObjectFactory : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPrintClassObject( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszPrinterName, - /* [annotation][in] */ - __in REFIID riid, - /* [annotation][iid_is][out] */ - __deref_out void **ppNewObject) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintClassObjectFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintClassObjectFactory * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintClassObjectFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintClassObjectFactory * This); - - HRESULT ( STDMETHODCALLTYPE *GetPrintClassObject )( - IPrintClassObjectFactory * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pszPrinterName, - /* [annotation][in] */ - __in REFIID riid, - /* [annotation][iid_is][out] */ - __deref_out void **ppNewObject); - - END_INTERFACE - } IPrintClassObjectFactoryVtbl; - - interface IPrintClassObjectFactory - { - CONST_VTBL struct IPrintClassObjectFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintClassObjectFactory_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintClassObjectFactory_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintClassObjectFactory_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintClassObjectFactory_GetPrintClassObject(This,pszPrinterName,riid,ppNewObject) \ - ( (This)->lpVtbl -> GetPrintClassObject(This,pszPrinterName,riid,ppNewObject) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintClassObjectFactory_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintPipelineFilter_INTERFACE_DEFINED__ -#define __IPrintPipelineFilter_INTERFACE_DEFINED__ - -/* interface IPrintPipelineFilter */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintPipelineFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("cdb62fc0-8bed-434e-86fb-a2cae55f19ea") - IPrintPipelineFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InitializeFilter( - /* [annotation][in] */ - __in IInterFilterCommunicator *pINegotiation, - /* [annotation][in] */ - __in IPrintPipelinePropertyBag *pIPropertyBag, - /* [annotation][in] */ - __in IPrintPipelineManagerControl *pIPipelineControl) = 0; - - virtual HRESULT STDMETHODCALLTYPE ShutdownOperation( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE StartOperation( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintPipelineFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintPipelineFilter * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintPipelineFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintPipelineFilter * This); - - HRESULT ( STDMETHODCALLTYPE *InitializeFilter )( - IPrintPipelineFilter * This, - /* [annotation][in] */ - __in IInterFilterCommunicator *pINegotiation, - /* [annotation][in] */ - __in IPrintPipelinePropertyBag *pIPropertyBag, - /* [annotation][in] */ - __in IPrintPipelineManagerControl *pIPipelineControl); - - HRESULT ( STDMETHODCALLTYPE *ShutdownOperation )( - IPrintPipelineFilter * This); - - HRESULT ( STDMETHODCALLTYPE *StartOperation )( - IPrintPipelineFilter * This); - - END_INTERFACE - } IPrintPipelineFilterVtbl; - - interface IPrintPipelineFilter - { - CONST_VTBL struct IPrintPipelineFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintPipelineFilter_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintPipelineFilter_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintPipelineFilter_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintPipelineFilter_InitializeFilter(This,pINegotiation,pIPropertyBag,pIPipelineControl) \ - ( (This)->lpVtbl -> InitializeFilter(This,pINegotiation,pIPropertyBag,pIPipelineControl) ) - -#define IPrintPipelineFilter_ShutdownOperation(This) \ - ( (This)->lpVtbl -> ShutdownOperation(This) ) - -#define IPrintPipelineFilter_StartOperation(This) \ - ( (This)->lpVtbl -> StartOperation(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintPipelineFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IXpsDocumentProvider_INTERFACE_DEFINED__ -#define __IXpsDocumentProvider_INTERFACE_DEFINED__ - -/* interface IXpsDocumentProvider */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IXpsDocumentProvider; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("b8cf8530-5562-47c4-ab67-b1f69ecf961e") - IXpsDocumentProvider : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetXpsPart( - /* [annotation][out] */ - __deref_out IUnknown **ppIXpsPart) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsDocumentProviderVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXpsDocumentProvider * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXpsDocumentProvider * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXpsDocumentProvider * This); - - HRESULT ( STDMETHODCALLTYPE *GetXpsPart )( - IXpsDocumentProvider * This, - /* [annotation][out] */ - __deref_out IUnknown **ppIXpsPart); - - END_INTERFACE - } IXpsDocumentProviderVtbl; - - interface IXpsDocumentProvider - { - CONST_VTBL struct IXpsDocumentProviderVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsDocumentProvider_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsDocumentProvider_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsDocumentProvider_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsDocumentProvider_GetXpsPart(This,ppIXpsPart) \ - ( (This)->lpVtbl -> GetXpsPart(This,ppIXpsPart) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsDocumentProvider_INTERFACE_DEFINED__ */ - - -#ifndef __IXpsDocumentConsumer_INTERFACE_DEFINED__ -#define __IXpsDocumentConsumer_INTERFACE_DEFINED__ - -/* interface IXpsDocumentConsumer */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IXpsDocumentConsumer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4368d8a2-4181-4a9f-b295-3d9a38bb9ba0") - IXpsDocumentConsumer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE SendXpsUnknown( - /* [annotation][in] */ - __in IUnknown *pUnknown) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendXpsDocument( - /* [annotation][in] */ - __in IXpsDocument *pIXpsDocument) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendFixedDocumentSequence( - /* [annotation][in] */ - __in IFixedDocumentSequence *pIFixedDocumentSequence) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendFixedDocument( - /* [annotation][in] */ - __in IFixedDocument *pIFixedDocument) = 0; - - virtual HRESULT STDMETHODCALLTYPE SendFixedPage( - /* [annotation][in] */ - __in IFixedPage *pIFixedPage) = 0; - - virtual HRESULT STDMETHODCALLTYPE CloseSender( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNewEmptyPart( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri, - /* [annotation][in] */ - __in REFIID riid, - /* [annotation][iid_is][out] */ - __deref_out void **ppNewObject, - /* [annotation][out] */ - __deref_out IPrintWriteStream **ppWriteStream) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsDocumentConsumerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXpsDocumentConsumer * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXpsDocumentConsumer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXpsDocumentConsumer * This); - - HRESULT ( STDMETHODCALLTYPE *SendXpsUnknown )( - IXpsDocumentConsumer * This, - /* [annotation][in] */ - __in IUnknown *pUnknown); - - HRESULT ( STDMETHODCALLTYPE *SendXpsDocument )( - IXpsDocumentConsumer * This, - /* [annotation][in] */ - __in IXpsDocument *pIXpsDocument); - - HRESULT ( STDMETHODCALLTYPE *SendFixedDocumentSequence )( - IXpsDocumentConsumer * This, - /* [annotation][in] */ - __in IFixedDocumentSequence *pIFixedDocumentSequence); - - HRESULT ( STDMETHODCALLTYPE *SendFixedDocument )( - IXpsDocumentConsumer * This, - /* [annotation][in] */ - __in IFixedDocument *pIFixedDocument); - - HRESULT ( STDMETHODCALLTYPE *SendFixedPage )( - IXpsDocumentConsumer * This, - /* [annotation][in] */ - __in IFixedPage *pIFixedPage); - - HRESULT ( STDMETHODCALLTYPE *CloseSender )( - IXpsDocumentConsumer * This); - - HRESULT ( STDMETHODCALLTYPE *GetNewEmptyPart )( - IXpsDocumentConsumer * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri, - /* [annotation][in] */ - __in REFIID riid, - /* [annotation][iid_is][out] */ - __deref_out void **ppNewObject, - /* [annotation][out] */ - __deref_out IPrintWriteStream **ppWriteStream); - - END_INTERFACE - } IXpsDocumentConsumerVtbl; - - interface IXpsDocumentConsumer - { - CONST_VTBL struct IXpsDocumentConsumerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsDocumentConsumer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsDocumentConsumer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsDocumentConsumer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsDocumentConsumer_SendXpsUnknown(This,pUnknown) \ - ( (This)->lpVtbl -> SendXpsUnknown(This,pUnknown) ) - -#define IXpsDocumentConsumer_SendXpsDocument(This,pIXpsDocument) \ - ( (This)->lpVtbl -> SendXpsDocument(This,pIXpsDocument) ) - -#define IXpsDocumentConsumer_SendFixedDocumentSequence(This,pIFixedDocumentSequence) \ - ( (This)->lpVtbl -> SendFixedDocumentSequence(This,pIFixedDocumentSequence) ) - -#define IXpsDocumentConsumer_SendFixedDocument(This,pIFixedDocument) \ - ( (This)->lpVtbl -> SendFixedDocument(This,pIFixedDocument) ) - -#define IXpsDocumentConsumer_SendFixedPage(This,pIFixedPage) \ - ( (This)->lpVtbl -> SendFixedPage(This,pIFixedPage) ) - -#define IXpsDocumentConsumer_CloseSender(This) \ - ( (This)->lpVtbl -> CloseSender(This) ) - -#define IXpsDocumentConsumer_GetNewEmptyPart(This,uri,riid,ppNewObject,ppWriteStream) \ - ( (This)->lpVtbl -> GetNewEmptyPart(This,uri,riid,ppNewObject,ppWriteStream) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsDocumentConsumer_INTERFACE_DEFINED__ */ - - -#ifndef __IXpsDocument_INTERFACE_DEFINED__ -#define __IXpsDocument_INTERFACE_DEFINED__ - -/* interface IXpsDocument */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IXpsDocument; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e8d907db-62a9-4a95-abe7-e01763dd30f8") - IXpsDocument : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetThumbnail( - /* [annotation][out] */ - __deref_out IPartThumbnail **ppThumbnail) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetThumbnail( - /* [annotation][in] */ - __in IPartThumbnail *pThumbnail) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsDocumentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXpsDocument * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXpsDocument * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXpsDocument * This); - - HRESULT ( STDMETHODCALLTYPE *GetThumbnail )( - IXpsDocument * This, - /* [annotation][out] */ - __deref_out IPartThumbnail **ppThumbnail); - - HRESULT ( STDMETHODCALLTYPE *SetThumbnail )( - IXpsDocument * This, - /* [annotation][in] */ - __in IPartThumbnail *pThumbnail); - - END_INTERFACE - } IXpsDocumentVtbl; - - interface IXpsDocument - { - CONST_VTBL struct IXpsDocumentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsDocument_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsDocument_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsDocument_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsDocument_GetThumbnail(This,ppThumbnail) \ - ( (This)->lpVtbl -> GetThumbnail(This,ppThumbnail) ) - -#define IXpsDocument_SetThumbnail(This,pThumbnail) \ - ( (This)->lpVtbl -> SetThumbnail(This,pThumbnail) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsDocument_INTERFACE_DEFINED__ */ - - -#ifndef __IFixedDocumentSequence_INTERFACE_DEFINED__ -#define __IFixedDocumentSequence_INTERFACE_DEFINED__ - -/* interface IFixedDocumentSequence */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IFixedDocumentSequence; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8028d181-2c32-4249-8493-1bfb22045574") - IFixedDocumentSequence : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetUri( - /* [annotation][out] */ - __out BSTR *uri) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPrintTicket( - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPrintTicket( - /* [annotation][in] */ - __in IPartPrintTicket *pPrintTicket) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFixedDocumentSequenceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFixedDocumentSequence * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFixedDocumentSequence * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFixedDocumentSequence * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IFixedDocumentSequence * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetPrintTicket )( - IFixedDocumentSequence * This, - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket); - - HRESULT ( STDMETHODCALLTYPE *SetPrintTicket )( - IFixedDocumentSequence * This, - /* [annotation][in] */ - __in IPartPrintTicket *pPrintTicket); - - END_INTERFACE - } IFixedDocumentSequenceVtbl; - - interface IFixedDocumentSequence - { - CONST_VTBL struct IFixedDocumentSequenceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFixedDocumentSequence_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IFixedDocumentSequence_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IFixedDocumentSequence_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IFixedDocumentSequence_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IFixedDocumentSequence_GetPrintTicket(This,ppPrintTicket) \ - ( (This)->lpVtbl -> GetPrintTicket(This,ppPrintTicket) ) - -#define IFixedDocumentSequence_SetPrintTicket(This,pPrintTicket) \ - ( (This)->lpVtbl -> SetPrintTicket(This,pPrintTicket) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IFixedDocumentSequence_INTERFACE_DEFINED__ */ - - -#ifndef __IFixedDocument_INTERFACE_DEFINED__ -#define __IFixedDocument_INTERFACE_DEFINED__ - -/* interface IFixedDocument */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IFixedDocument; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("f222ca9f-9968-4db9-81bd-abaebf15f93f") - IFixedDocument : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetUri( - /* [annotation][out] */ - __out BSTR *uri) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPrintTicket( - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPrintTicket( - /* [annotation][in] */ - __in IPartPrintTicket *pPrintTicket) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFixedDocumentVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFixedDocument * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFixedDocument * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFixedDocument * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IFixedDocument * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetPrintTicket )( - IFixedDocument * This, - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket); - - HRESULT ( STDMETHODCALLTYPE *SetPrintTicket )( - IFixedDocument * This, - /* [annotation][in] */ - __in IPartPrintTicket *pPrintTicket); - - END_INTERFACE - } IFixedDocumentVtbl; - - interface IFixedDocument - { - CONST_VTBL struct IFixedDocumentVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFixedDocument_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IFixedDocument_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IFixedDocument_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IFixedDocument_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IFixedDocument_GetPrintTicket(This,ppPrintTicket) \ - ( (This)->lpVtbl -> GetPrintTicket(This,ppPrintTicket) ) - -#define IFixedDocument_SetPrintTicket(This,pPrintTicket) \ - ( (This)->lpVtbl -> SetPrintTicket(This,pPrintTicket) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IFixedDocument_INTERFACE_DEFINED__ */ - - -#ifndef __IPartBase_INTERFACE_DEFINED__ -#define __IPartBase_INTERFACE_DEFINED__ - -/* interface IPartBase */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartBase; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36d51e28-369e-43ba-a666-9540c62c3f58") - IPartBase : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetUri( - /* [annotation][out] */ - __out BSTR *uri) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStream( - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPartCompression( - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPartCompression( - /* [annotation][in] */ - __in EXpsCompressionOptions compression) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartBaseVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartBase * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartBase * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartBase * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartBase * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartBase * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartBase * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartBase * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - END_INTERFACE - } IPartBaseVtbl; - - interface IPartBase - { - CONST_VTBL struct IPartBaseVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartBase_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartBase_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartBase_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartBase_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartBase_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartBase_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartBase_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartBase_INTERFACE_DEFINED__ */ - - -#ifndef __IFixedPage_INTERFACE_DEFINED__ -#define __IFixedPage_INTERFACE_DEFINED__ - -/* interface IFixedPage */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IFixedPage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3d9f6448-7e95-4cb5-94fb-0180c2883a57") - IFixedPage : public IPartBase - { - public: - virtual HRESULT STDMETHODCALLTYPE GetPrintTicket( - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetPagePart( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri, - /* [annotation][out] */ - __deref_out IUnknown **ppUnk) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetWriteStream( - /* [annotation][out] */ - __deref_out IPrintWriteStream **ppWriteStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPrintTicket( - /* [annotation][in] */ - __in IPartPrintTicket *ppPrintTicket) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetPagePart( - /* [annotation][in] */ - __in IUnknown *pUnk) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeleteResource( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetXpsPartIterator( - /* [annotation][out] */ - __deref_out IXpsPartIterator **pXpsPartIt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IFixedPageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IFixedPage * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IFixedPage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IFixedPage * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IFixedPage * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IFixedPage * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IFixedPage * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IFixedPage * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - HRESULT ( STDMETHODCALLTYPE *GetPrintTicket )( - IFixedPage * This, - /* [annotation][out] */ - __deref_out IPartPrintTicket **ppPrintTicket); - - HRESULT ( STDMETHODCALLTYPE *GetPagePart )( - IFixedPage * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri, - /* [annotation][out] */ - __deref_out IUnknown **ppUnk); - - HRESULT ( STDMETHODCALLTYPE *GetWriteStream )( - IFixedPage * This, - /* [annotation][out] */ - __deref_out IPrintWriteStream **ppWriteStream); - - HRESULT ( STDMETHODCALLTYPE *SetPrintTicket )( - IFixedPage * This, - /* [annotation][in] */ - __in IPartPrintTicket *ppPrintTicket); - - HRESULT ( STDMETHODCALLTYPE *SetPagePart )( - IFixedPage * This, - /* [annotation][in] */ - __in IUnknown *pUnk); - - HRESULT ( STDMETHODCALLTYPE *DeleteResource )( - IFixedPage * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *uri); - - HRESULT ( STDMETHODCALLTYPE *GetXpsPartIterator )( - IFixedPage * This, - /* [annotation][out] */ - __deref_out IXpsPartIterator **pXpsPartIt); - - END_INTERFACE - } IFixedPageVtbl; - - interface IFixedPage - { - CONST_VTBL struct IFixedPageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IFixedPage_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IFixedPage_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IFixedPage_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IFixedPage_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IFixedPage_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IFixedPage_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IFixedPage_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#define IFixedPage_GetPrintTicket(This,ppPrintTicket) \ - ( (This)->lpVtbl -> GetPrintTicket(This,ppPrintTicket) ) - -#define IFixedPage_GetPagePart(This,uri,ppUnk) \ - ( (This)->lpVtbl -> GetPagePart(This,uri,ppUnk) ) - -#define IFixedPage_GetWriteStream(This,ppWriteStream) \ - ( (This)->lpVtbl -> GetWriteStream(This,ppWriteStream) ) - -#define IFixedPage_SetPrintTicket(This,ppPrintTicket) \ - ( (This)->lpVtbl -> SetPrintTicket(This,ppPrintTicket) ) - -#define IFixedPage_SetPagePart(This,pUnk) \ - ( (This)->lpVtbl -> SetPagePart(This,pUnk) ) - -#define IFixedPage_DeleteResource(This,uri) \ - ( (This)->lpVtbl -> DeleteResource(This,uri) ) - -#define IFixedPage_GetXpsPartIterator(This,pXpsPartIt) \ - ( (This)->lpVtbl -> GetXpsPartIterator(This,pXpsPartIt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IFixedPage_INTERFACE_DEFINED__ */ - - -#ifndef __IPartImage_INTERFACE_DEFINED__ -#define __IPartImage_INTERFACE_DEFINED__ - -/* interface IPartImage */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartImage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("725f2e3c-401a-4705-9de0-fe6f1353b87f") - IPartImage : public IPartBase - { - public: - virtual HRESULT STDMETHODCALLTYPE GetImageProperties( - /* [annotation][out] */ - __out BSTR *pContentType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetImageContent( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartImageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartImage * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartImage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartImage * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartImage * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartImage * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartImage * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartImage * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - HRESULT ( STDMETHODCALLTYPE *GetImageProperties )( - IPartImage * This, - /* [annotation][out] */ - __out BSTR *pContentType); - - HRESULT ( STDMETHODCALLTYPE *SetImageContent )( - IPartImage * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType); - - END_INTERFACE - } IPartImageVtbl; - - interface IPartImage - { - CONST_VTBL struct IPartImageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartImage_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartImage_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartImage_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartImage_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartImage_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartImage_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartImage_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#define IPartImage_GetImageProperties(This,pContentType) \ - ( (This)->lpVtbl -> GetImageProperties(This,pContentType) ) - -#define IPartImage_SetImageContent(This,pContentType) \ - ( (This)->lpVtbl -> SetImageContent(This,pContentType) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartImage_INTERFACE_DEFINED__ */ - - -#ifndef __IPartFont_INTERFACE_DEFINED__ -#define __IPartFont_INTERFACE_DEFINED__ - -/* interface IPartFont */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartFont; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("e07fe0ab-1124-43d0-a865-e8ffb6a3ea82") - IPartFont : public IPartBase - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFontProperties( - /* [annotation][out] */ - __out BSTR *pContentType, - /* [annotation][out] */ - __out EXpsFontOptions *pFontOptions) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFontContent( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFontOptions( - /* [annotation][in] */ - __in EXpsFontOptions options) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartFontVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartFont * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartFont * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartFont * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartFont * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartFont * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartFont * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartFont * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - HRESULT ( STDMETHODCALLTYPE *GetFontProperties )( - IPartFont * This, - /* [annotation][out] */ - __out BSTR *pContentType, - /* [annotation][out] */ - __out EXpsFontOptions *pFontOptions); - - HRESULT ( STDMETHODCALLTYPE *SetFontContent )( - IPartFont * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType); - - HRESULT ( STDMETHODCALLTYPE *SetFontOptions )( - IPartFont * This, - /* [annotation][in] */ - __in EXpsFontOptions options); - - END_INTERFACE - } IPartFontVtbl; - - interface IPartFont - { - CONST_VTBL struct IPartFontVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartFont_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartFont_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartFont_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartFont_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartFont_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartFont_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartFont_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#define IPartFont_GetFontProperties(This,pContentType,pFontOptions) \ - ( (This)->lpVtbl -> GetFontProperties(This,pContentType,pFontOptions) ) - -#define IPartFont_SetFontContent(This,pContentType) \ - ( (This)->lpVtbl -> SetFontContent(This,pContentType) ) - -#define IPartFont_SetFontOptions(This,options) \ - ( (This)->lpVtbl -> SetFontOptions(This,options) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartFont_INTERFACE_DEFINED__ */ - - -#ifndef __IPartFont2_INTERFACE_DEFINED__ -#define __IPartFont2_INTERFACE_DEFINED__ - -/* interface IPartFont2 */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartFont2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("511e025f-d6cb-43be-bf65-63fe88515a39") - IPartFont2 : public IPartFont - { - public: - virtual HRESULT STDMETHODCALLTYPE GetFontRestriction( - /* [annotation][out] */ - __out EXpsFontRestriction *pRestriction) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartFont2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartFont2 * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartFont2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartFont2 * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartFont2 * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartFont2 * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartFont2 * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartFont2 * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - HRESULT ( STDMETHODCALLTYPE *GetFontProperties )( - IPartFont2 * This, - /* [annotation][out] */ - __out BSTR *pContentType, - /* [annotation][out] */ - __out EXpsFontOptions *pFontOptions); - - HRESULT ( STDMETHODCALLTYPE *SetFontContent )( - IPartFont2 * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType); - - HRESULT ( STDMETHODCALLTYPE *SetFontOptions )( - IPartFont2 * This, - /* [annotation][in] */ - __in EXpsFontOptions options); - - HRESULT ( STDMETHODCALLTYPE *GetFontRestriction )( - IPartFont2 * This, - /* [annotation][out] */ - __out EXpsFontRestriction *pRestriction); - - END_INTERFACE - } IPartFont2Vtbl; - - interface IPartFont2 - { - CONST_VTBL struct IPartFont2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartFont2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartFont2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartFont2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartFont2_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartFont2_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartFont2_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartFont2_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#define IPartFont2_GetFontProperties(This,pContentType,pFontOptions) \ - ( (This)->lpVtbl -> GetFontProperties(This,pContentType,pFontOptions) ) - -#define IPartFont2_SetFontContent(This,pContentType) \ - ( (This)->lpVtbl -> SetFontContent(This,pContentType) ) - -#define IPartFont2_SetFontOptions(This,options) \ - ( (This)->lpVtbl -> SetFontOptions(This,options) ) - - -#define IPartFont2_GetFontRestriction(This,pRestriction) \ - ( (This)->lpVtbl -> GetFontRestriction(This,pRestriction) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartFont2_INTERFACE_DEFINED__ */ - - -#ifndef __IPartThumbnail_INTERFACE_DEFINED__ -#define __IPartThumbnail_INTERFACE_DEFINED__ - -/* interface IPartThumbnail */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartThumbnail; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("027ed1c9-ba39-4cc5-aa55-7ec3a0de171a") - IPartThumbnail : public IPartBase - { - public: - virtual HRESULT STDMETHODCALLTYPE GetThumbnailProperties( - /* [annotation][out] */ - __out BSTR *pContentType) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetThumbnailContent( - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartThumbnailVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartThumbnail * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartThumbnail * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartThumbnail * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartThumbnail * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartThumbnail * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartThumbnail * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartThumbnail * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - HRESULT ( STDMETHODCALLTYPE *GetThumbnailProperties )( - IPartThumbnail * This, - /* [annotation][out] */ - __out BSTR *pContentType); - - HRESULT ( STDMETHODCALLTYPE *SetThumbnailContent )( - IPartThumbnail * This, - /* [annotation][string][in] */ - __in __nullterminated const wchar_t *pContentType); - - END_INTERFACE - } IPartThumbnailVtbl; - - interface IPartThumbnail - { - CONST_VTBL struct IPartThumbnailVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartThumbnail_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartThumbnail_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartThumbnail_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartThumbnail_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartThumbnail_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartThumbnail_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartThumbnail_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#define IPartThumbnail_GetThumbnailProperties(This,pContentType) \ - ( (This)->lpVtbl -> GetThumbnailProperties(This,pContentType) ) - -#define IPartThumbnail_SetThumbnailContent(This,pContentType) \ - ( (This)->lpVtbl -> SetThumbnailContent(This,pContentType) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartThumbnail_INTERFACE_DEFINED__ */ - - -#ifndef __IPartPrintTicket_INTERFACE_DEFINED__ -#define __IPartPrintTicket_INTERFACE_DEFINED__ - -/* interface IPartPrintTicket */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartPrintTicket; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4a0f50f6-f9a2-41f0-99e7-5ae955be8e9e") - IPartPrintTicket : public IPartBase - { - public: - }; - -#else /* C style interface */ - - typedef struct IPartPrintTicketVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartPrintTicket * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartPrintTicket * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartPrintTicket * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartPrintTicket * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartPrintTicket * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartPrintTicket * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartPrintTicket * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - END_INTERFACE - } IPartPrintTicketVtbl; - - interface IPartPrintTicket - { - CONST_VTBL struct IPartPrintTicketVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartPrintTicket_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartPrintTicket_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartPrintTicket_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartPrintTicket_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartPrintTicket_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartPrintTicket_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartPrintTicket_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartPrintTicket_INTERFACE_DEFINED__ */ - - -#ifndef __IPartColorProfile_INTERFACE_DEFINED__ -#define __IPartColorProfile_INTERFACE_DEFINED__ - -/* interface IPartColorProfile */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartColorProfile; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("63cca95b-7d18-4762-b15e-98658693d24a") - IPartColorProfile : public IPartBase - { - public: - }; - -#else /* C style interface */ - - typedef struct IPartColorProfileVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartColorProfile * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartColorProfile * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartColorProfile * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartColorProfile * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartColorProfile * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartColorProfile * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartColorProfile * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - END_INTERFACE - } IPartColorProfileVtbl; - - interface IPartColorProfile - { - CONST_VTBL struct IPartColorProfileVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartColorProfile_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartColorProfile_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartColorProfile_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartColorProfile_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartColorProfile_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartColorProfile_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartColorProfile_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartColorProfile_INTERFACE_DEFINED__ */ - - -#ifndef __IPartResourceDictionary_INTERFACE_DEFINED__ -#define __IPartResourceDictionary_INTERFACE_DEFINED__ - -/* interface IPartResourceDictionary */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartResourceDictionary; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("16cfce6d-e744-4fb3-b474-f1d54f024a01") - IPartResourceDictionary : public IPartBase - { - public: - }; - -#else /* C style interface */ - - typedef struct IPartResourceDictionaryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartResourceDictionary * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartResourceDictionary * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartResourceDictionary * This); - - HRESULT ( STDMETHODCALLTYPE *GetUri )( - IPartResourceDictionary * This, - /* [annotation][out] */ - __out BSTR *uri); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPartResourceDictionary * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - HRESULT ( STDMETHODCALLTYPE *GetPartCompression )( - IPartResourceDictionary * This, - /* [annotation][out] */ - __out EXpsCompressionOptions *pCompression); - - HRESULT ( STDMETHODCALLTYPE *SetPartCompression )( - IPartResourceDictionary * This, - /* [annotation][in] */ - __in EXpsCompressionOptions compression); - - END_INTERFACE - } IPartResourceDictionaryVtbl; - - interface IPartResourceDictionary - { - CONST_VTBL struct IPartResourceDictionaryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartResourceDictionary_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartResourceDictionary_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartResourceDictionary_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartResourceDictionary_GetUri(This,uri) \ - ( (This)->lpVtbl -> GetUri(This,uri) ) - -#define IPartResourceDictionary_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#define IPartResourceDictionary_GetPartCompression(This,pCompression) \ - ( (This)->lpVtbl -> GetPartCompression(This,pCompression) ) - -#define IPartResourceDictionary_SetPartCompression(This,compression) \ - ( (This)->lpVtbl -> SetPartCompression(This,compression) ) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartResourceDictionary_INTERFACE_DEFINED__ */ - - -#ifndef __IXpsPartIterator_INTERFACE_DEFINED__ -#define __IXpsPartIterator_INTERFACE_DEFINED__ - -/* interface IXpsPartIterator */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IXpsPartIterator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0021d3cd-af6f-42ab-9999-14bc82a62d2e") - IXpsPartIterator : public IUnknown - { - public: - virtual void STDMETHODCALLTYPE Reset( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Current( - /* [annotation][out] */ - __out BSTR *pUri, - /* [annotation][out] */ - __deref_out IUnknown **ppXpsPart) = 0; - - virtual BOOL STDMETHODCALLTYPE IsDone( void) = 0; - - virtual void STDMETHODCALLTYPE Next( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsPartIteratorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IXpsPartIterator * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IXpsPartIterator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IXpsPartIterator * This); - - void ( STDMETHODCALLTYPE *Reset )( - IXpsPartIterator * This); - - HRESULT ( STDMETHODCALLTYPE *Current )( - IXpsPartIterator * This, - /* [annotation][out] */ - __out BSTR *pUri, - /* [annotation][out] */ - __deref_out IUnknown **ppXpsPart); - - BOOL ( STDMETHODCALLTYPE *IsDone )( - IXpsPartIterator * This); - - void ( STDMETHODCALLTYPE *Next )( - IXpsPartIterator * This); - - END_INTERFACE - } IXpsPartIteratorVtbl; - - interface IXpsPartIterator - { - CONST_VTBL struct IXpsPartIteratorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsPartIterator_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsPartIterator_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsPartIterator_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsPartIterator_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IXpsPartIterator_Current(This,pUri,ppXpsPart) \ - ( (This)->lpVtbl -> Current(This,pUri,ppXpsPart) ) - -#define IXpsPartIterator_IsDone(This) \ - ( (This)->lpVtbl -> IsDone(This) ) - -#define IXpsPartIterator_Next(This) \ - ( (This)->lpVtbl -> Next(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsPartIterator_INTERFACE_DEFINED__ */ - - -#ifndef __IPrintReadStreamFactory_INTERFACE_DEFINED__ -#define __IPrintReadStreamFactory_INTERFACE_DEFINED__ - -/* interface IPrintReadStreamFactory */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPrintReadStreamFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("acb971e3-df8d-4fc2-bee6-0609d15f3cf9") - IPrintReadStreamFactory : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetStream( - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPrintReadStreamFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPrintReadStreamFactory * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPrintReadStreamFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPrintReadStreamFactory * This); - - HRESULT ( STDMETHODCALLTYPE *GetStream )( - IPrintReadStreamFactory * This, - /* [annotation][out] */ - __deref_out IPrintReadStream **ppStream); - - END_INTERFACE - } IPrintReadStreamFactoryVtbl; - - interface IPrintReadStreamFactory - { - CONST_VTBL struct IPrintReadStreamFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPrintReadStreamFactory_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPrintReadStreamFactory_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPrintReadStreamFactory_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPrintReadStreamFactory_GetStream(This,ppStream) \ - ( (This)->lpVtbl -> GetStream(This,ppStream) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPrintReadStreamFactory_INTERFACE_DEFINED__ */ - - -#ifndef __IPartDiscardControl_INTERFACE_DEFINED__ -#define __IPartDiscardControl_INTERFACE_DEFINED__ - -/* interface IPartDiscardControl */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IPartDiscardControl; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("cc350c00-095b-42a5-bf0f-c8780edadb3c") - IPartDiscardControl : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDiscardProperties( - /* [annotation][out] */ - __out BSTR *uriSentinelPage, - /* [annotation][out] */ - __out BSTR *uriPartToDiscard) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPartDiscardControlVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IPartDiscardControl * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IPartDiscardControl * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IPartDiscardControl * This); - - HRESULT ( STDMETHODCALLTYPE *GetDiscardProperties )( - IPartDiscardControl * This, - /* [annotation][out] */ - __out BSTR *uriSentinelPage, - /* [annotation][out] */ - __out BSTR *uriPartToDiscard); - - END_INTERFACE - } IPartDiscardControlVtbl; - - interface IPartDiscardControl - { - CONST_VTBL struct IPartDiscardControlVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPartDiscardControl_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPartDiscardControl_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPartDiscardControl_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPartDiscardControl_GetDiscardProperties(This,uriSentinelPage,uriPartToDiscard) \ - ( (This)->lpVtbl -> GetDiscardProperties(This,uriSentinelPage,uriPartToDiscard) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPartDiscardControl_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/filterpipelineutil.h b/qt-correction-tool/pub/ddk/filterpipelineutil.h deleted file mode 100644 index 5cbd568..0000000 --- a/qt-correction-tool/pub/ddk/filterpipelineutil.h +++ /dev/null @@ -1,246 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//-------------------------------------------------------------------------- - -#ifndef _PRINT_FILTER_UTIL_813b22ee_62f7_4200_ -#define _PRINT_FILTER_UTIL_813b22ee_62f7_4200_ - -#if defined(__cplusplus) - -// -// print filter pipeline -// -namespace pfp -{ - -// -// Helpful when you want to use a print read interface with XML SAX -// which needs an ISequentialStream -// -class PrintReadStreamToSeqStream : public ISequentialStream -{ -public: - - PrintReadStreamToSeqStream( - __in IPrintReadStream *pReadStream - ) : m_cRef(1), - m_pStream(pReadStream) - { - m_pStream->AddRef(); - } - - ~PrintReadStreamToSeqStream() - { - m_pStream->Release(); - } - - STDMETHODIMP_(ULONG) - AddRef( - VOID - ) - { - return InterlockedIncrement(&m_cRef); - } - - STDMETHODIMP_(ULONG) - Release( - VOID - ) - { - ULONG cRefCount = InterlockedDecrement(&m_cRef); - - if (cRefCount) - { - return cRefCount; - } - - delete this; - - return 0; - } - - STDMETHODIMP - QueryInterface( - __in REFIID riid, - __out VOID **ppv - ) - { - HRESULT hRes = E_POINTER; - - if (ppv) - { - hRes = E_NOINTERFACE; - - *ppv = NULL; - - if (riid == IID_ISequentialStream) - { - *ppv = static_cast(this); - } - else if (riid == IID_IUnknown) - { - *ppv = static_cast(this); - } - - if (*ppv) - { - AddRef(); - - hRes = S_OK; - } - } - - return hRes; - } - - STDMETHODIMP - Read( - __out_bcount(cb) void* pv, - __in ULONG cb, - __out ULONG *pcbRead - ) - { - BOOL bEof; - - return m_pStream->ReadBytes(pv, cb, pcbRead, &bEof); - } - - STDMETHODIMP - Write( - __in_bcount(cb) void const* pv, - __in ULONG cb, - __out ULONG *pcbWritten - ) - { - UNREFERENCED_PARAMETER(pv); - UNREFERENCED_PARAMETER(cb); - UNREFERENCED_PARAMETER(pcbWritten); - return E_NOTIMPL; - } - -private: - - LONG m_cRef; - IPrintReadStream *m_pStream; -}; - -// -// Helpful when you want to use a print write interface with XML SAX -// which needs an ISequentialStream -// -class PrintWriteStreamToSeqStream : public ISequentialStream -{ -public: - - PrintWriteStreamToSeqStream( - __in IPrintWriteStream *pWriteStream - ) : m_cRef(1), - m_pStream(pWriteStream) - { - m_pStream->AddRef(); - } - - ~PrintWriteStreamToSeqStream() - { - m_pStream->Close(); - - m_pStream->Release(); - } - - STDMETHODIMP_(ULONG) - AddRef( - VOID - ) - { - return InterlockedIncrement(&m_cRef); - } - - STDMETHODIMP_(ULONG) - Release( - VOID - ) - { - ULONG cRefCount = InterlockedDecrement(&m_cRef); - - if (cRefCount) - { - return cRefCount; - } - - delete this; - - return 0; - } - - STDMETHODIMP - QueryInterface( - __in REFIID riid, - __out VOID **ppv - ) - { - HRESULT hRes = E_POINTER; - - if (ppv) - { - hRes = E_NOINTERFACE; - - *ppv = NULL; - - if (riid == IID_ISequentialStream) - { - *ppv = static_cast(this); - } - else if (riid == IID_IUnknown) - { - *ppv = static_cast(this); - } - - if (*ppv) - { - AddRef(); - - hRes = S_OK; - } - } - - return hRes; - } - - STDMETHODIMP - Read( - __out_bcount(cb) void* pv, - __in ULONG cb, - __out ULONG *pcbRead - ) - { - UNREFERENCED_PARAMETER(pv); - UNREFERENCED_PARAMETER(cb); - UNREFERENCED_PARAMETER(pcbRead); - return E_NOTIMPL; - } - - STDMETHODIMP - Write( - __in_bcount(cb) void const* pv, - __in ULONG cb, - __out ULONG *pcbWritten - ) - { - return m_pStream->WriteBytes(pv, cb, pcbWritten); - } - -private: - - LONG m_cRef; - IPrintWriteStream *m_pStream; -}; - -}; // namespace pfp - -#endif // if defined(__cplusplus) - -#endif // #ifndef _PRINT_FILTER_UTIL_813b22ee-62f7-4200-9c85-73d139eaa579_ - diff --git a/qt-correction-tool/pub/ddk/fltKernel.h b/qt-correction-tool/pub/ddk/fltKernel.h deleted file mode 100644 index 3e494be..0000000 --- a/qt-correction-tool/pub/ddk/fltKernel.h +++ /dev/null @@ -1,5212 +0,0 @@ -/*++ - -Copyright (c) 1989-2002 Microsoft Corporation - -Module Name: - - fltKernel.h - -Abstract: - - This contains all of the global definitions for mini-filters. - -Environment: - - Kernel mode - ---*/ - -#ifndef __FLTKERNEL__ -#define __FLTKERNEL__ - -#ifdef __cplusplus -extern "C" { -#endif - -// -// IMPORTANT!!!!! -// -// This is how FltMgr was released (from oldest to newest) -// xpsp2, srv03 SP1, w2k sp4+URP, LH, Win7 -// - -// -// The defines items that are part of the filter manager baseline -// - -#define FLT_MGR_BASELINE (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WINXPSP2))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WS03) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) || \ - (NTDDI_VERSION >= NTDDI_VISTA)) - -// -// This defines items that were added after XPSP2 was released. This means -// they are in Srv03 SP1, W2K SP4+URP, and Longhorn and above. -// - -#define FLT_MGR_AFTER_XPSP2 (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) > SPVER(NTDDI_WINXPSP2))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WS03) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) || \ - (NTDDI_VERSION >= NTDDI_VISTA)) - -// -// This defines items that only exist in longhorn or later -// - -#define FLT_MGR_LONGHORN (NTDDI_VERSION >= NTDDI_VISTA) - -// -// This defines items that only exist in Windows 7 or later -// - -#define FLT_MGR_WIN7 (NTDDI_VERSION >= NTDDI_WIN7) - - -/////////////////////////////////////////////////////////////////////////////// -// -// Standard includes -// -/////////////////////////////////////////////////////////////////////////////// - -#include -#include -#include - -#if FLT_MGR_BASELINE - -/////////////////////////////////////////////////////////////////////////////// -// -// Miscellaneous macros useful for Filter Manager & mini-filters -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Handy macros for doing pointer arithmetic -// - -#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I))) -#define PtrOffset(B,O) ((ULONG)((ULONG_PTR)(O) - (ULONG_PTR)(B))) - -// -// This macro takes a length & rounds it up to a multiple of the alignment -// Alignment is given as a power of 2 -// - -#define ROUND_TO_SIZE(_length, _alignment) \ - ((((ULONG_PTR)(_length)) + ((_alignment)-1)) & ~(ULONG_PTR) ((_alignment) - 1)) - -// -// Checks if 1st argument is aligned on given power of 2 boundary specified -// by 2nd argument -// - -#define IS_ALIGNED(_pointer, _alignment) \ - ((((ULONG_PTR) (_pointer)) & ((_alignment) - 1)) == 0) - -/////////////////////////////////////////////////////////////////////////////// -// -// FltMgr Operation Definitions -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Along with the existing IRP_MJ_xxxx definitions (0 - 0x1b) in NTIFS.H, -// this defines all of the operation IDs that can be sent to a mini-filter. -// - -#define IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION ((UCHAR)-1) -#define IRP_MJ_RELEASE_FOR_SECTION_SYNCHRONIZATION ((UCHAR)-2) -#define IRP_MJ_ACQUIRE_FOR_MOD_WRITE ((UCHAR)-3) -#define IRP_MJ_RELEASE_FOR_MOD_WRITE ((UCHAR)-4) -#define IRP_MJ_ACQUIRE_FOR_CC_FLUSH ((UCHAR)-5) -#define IRP_MJ_RELEASE_FOR_CC_FLUSH ((UCHAR)-6) - - -// -// Leave space for additional FS_FILTER codes here -// - -#define IRP_MJ_FAST_IO_CHECK_IF_POSSIBLE ((UCHAR)-13) -#define IRP_MJ_NETWORK_QUERY_OPEN ((UCHAR)-14) -#define IRP_MJ_MDL_READ ((UCHAR)-15) -#define IRP_MJ_MDL_READ_COMPLETE ((UCHAR)-16) -#define IRP_MJ_PREPARE_MDL_WRITE ((UCHAR)-17) -#define IRP_MJ_MDL_WRITE_COMPLETE ((UCHAR)-18) -#define IRP_MJ_VOLUME_MOUNT ((UCHAR)-19) -#define IRP_MJ_VOLUME_DISMOUNT ((UCHAR)-20) - - -#define FLT_INTERNAL_OPERATION_COUNT 22 - -// -// Not currently implemented -// - -/* -#define IRP_MJ_READ_COMPRESSED ((UCHAR)-xx) -#define IRP_MJ_WRITE_COMPRESSED ((UCHAR)-xx) -#define IRP_MJ_MDL_READ_COMPLETE_REQUEST ((UCHAR)-xx) -#define IRP_MJ_MDL_WRITE_COMPLETE_COMPRESSED ((UCHAR)-xx) -*/ - -// -// Marks the end of the operation list for registration -// - -#define IRP_MJ_OPERATION_END ((UCHAR)0x80) - - -/////////////////////////////////////////////////////////////////////////////// -// -// Basic Filter data types -// -/////////////////////////////////////////////////////////////////////////////// - -typedef struct _FLT_FILTER *PFLT_FILTER; -typedef struct _FLT_VOLUME *PFLT_VOLUME; -typedef struct _FLT_INSTANCE *PFLT_INSTANCE; -typedef struct _FLT_PORT *PFLT_PORT; - -typedef PVOID PFLT_CONTEXT; -#define NULL_CONTEXT ((PFLT_CONTEXT)NULL) //EMPTY context - -#if !FLT_MGR_LONGHORN -// -// For non-longhorn environments we need to define this structure since -// it is used elsewhere. In longhorn and later it is part of ntifs.h -// - -typedef struct _KTRANSACTION *PKTRANSACTION; - -#endif // !FLT_MGR_LONGHORN - - - -/////////////////////////////////////////////////////////////////////////////// -// -// This defines the standard parameter block that is passed to every -// callback. -// -/////////////////////////////////////////////////////////////////////////////// - -#if !defined(_AMD64_) && !defined(_IA64_) -#include "pshpack4.h" -#endif - -#if _MSC_VER >= 1200 -#pragma warning(push) -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#endif - -typedef union _FLT_PARAMETERS { - - // - // IRP_MJ_CREATE - // - - struct { - PIO_SECURITY_CONTEXT SecurityContext; - - // - // The low 24 bits contains CreateOptions flag values. - // The high 8 bits contains the CreateDisposition values. - // - - ULONG Options; - - USHORT POINTER_ALIGNMENT FileAttributes; - USHORT ShareAccess; - ULONG POINTER_ALIGNMENT EaLength; - - PVOID EaBuffer; //Not in IO_STACK_LOCATION parameters list - LARGE_INTEGER AllocationSize; //Not in IO_STACK_LOCATION parameters list - } Create; - - // - // IRP_MJ_CREATE_NAMED_PIPE - // - // Notice that the fields in the following parameter structure must - // match those for the create structure other than the last longword. - // This is so that no distinctions need be made by the I/O system's - // parse routine other than for the last longword. - // - - struct { - PIO_SECURITY_CONTEXT SecurityContext; - ULONG Options; - USHORT POINTER_ALIGNMENT Reserved; - USHORT ShareAccess; - PVOID Parameters; // PNAMED_PIPE_CREATE_PARAMETERS - } CreatePipe; - - // - // IRP_MJ_CREATE_MAILSLOT - // - // Notice that the fields in the following parameter structure must - // match those for the create structure other than the last longword. - // This is so that no distinctions need be made by the I/O system's - // parse routine other than for the last longword. - // - - struct { - PIO_SECURITY_CONTEXT SecurityContext; - ULONG Options; - USHORT POINTER_ALIGNMENT Reserved; - USHORT ShareAccess; - PVOID Parameters; // PMAILSLOT_CREATE_PARAMETERS - } CreateMailslot; - - // - // IRP_MJ_READ - // - - struct { - ULONG Length; //Length of transfer - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; //Offset to read from - - PVOID ReadBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } Read; - - // - // IRP_MJ_WRITE - // - - struct { - ULONG Length; //Length of transfer - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; //Offset to write to - - PVOID WriteBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } Write; - - // - // IRP_MJ_QUERY_INFORMATION - // - - struct { - ULONG Length; //Length of buffer - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; //Class of information to query - - PVOID InfoBuffer; //Not in IO_STACK_LOCATION parameters list - } QueryFileInformation; - - // - // IRP_MJ_SET_INFORMATION - // - - struct { - ULONG Length; - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; - PFILE_OBJECT ParentOfTarget; - union { - struct { - BOOLEAN ReplaceIfExists; - BOOLEAN AdvanceOnly; - }; - ULONG ClusterCount; - HANDLE DeleteHandle; - }; - - PVOID InfoBuffer; //Not in IO_STACK_LOCATION parameters list - } SetFileInformation; - - // - // IRP_MJ_QUERY_EA - // - - struct { - ULONG Length; - PVOID EaList; - ULONG EaListLength; - ULONG POINTER_ALIGNMENT EaIndex; - - PVOID EaBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } QueryEa; - - // - // IRP_MJ_SET_EA - // - - struct { - ULONG Length; - - PVOID EaBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } SetEa; - - // - // IRP_MJ_QUERY_VOLUME_INFORMATION - // - - struct { - ULONG Length; - FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; - - PVOID VolumeBuffer; //Not in IO_STACK_LOCATION parameters list - } QueryVolumeInformation; - - // - // IRP_MJ_SET_VOLUME_INFORMATION - // - - struct { - ULONG Length; - FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; - - PVOID VolumeBuffer; //Not in IO_STACK_LOCATION parameters list - } SetVolumeInformation; - - // - // IRP_MJ_DIRECTORY_CONTROL - // - - union { - - // - // IRP_MN_QUERY_DIRECTORY or IRP_MN_QUERY_OLE_DIRECTORY - // - - struct { - ULONG Length; - PUNICODE_STRING FileName; - FILE_INFORMATION_CLASS FileInformationClass; - ULONG POINTER_ALIGNMENT FileIndex; - - PVOID DirectoryBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } QueryDirectory; - - // - // IRP_MN_NOTIFY_CHANGE_DIRECTORY - // - - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT CompletionFilter; - - // - // These spares ensure that the offset of DirectoryBuffer is - // exactly the same as that for QueryDirectory minor code. This - // needs to be the same because filter manager code makes the assumption - // they are the same - // - - ULONG POINTER_ALIGNMENT Spare1; - ULONG POINTER_ALIGNMENT Spare2; - - PVOID DirectoryBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } NotifyDirectory; - - } DirectoryControl; - - // - // IRP_MJ_FILE_SYSTEM_CONTROL - // - // Note that the user's output buffer is stored in the UserBuffer field - // and the user's input buffer is stored in the SystemBuffer field. - // - - union { - - // - // IRP_MN_VERIFY_VOLUME - // - - struct { - PVPB Vpb; - PDEVICE_OBJECT DeviceObject; - } VerifyVolume; - - // - // IRP_MN_KERNEL_CALL and IRP_MN_USER_FS_REQUEST - // The parameters are broken out into 3 separate unions based on the - // method of the FSCTL Drivers should use the method-appropriate - // union for accessing parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT FsControlCode; - } Common; - - // - // METHOD_NEITHER Fsctl parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT FsControlCode; - - // - // Type3InputBuffer: name changed from IO_STACK_LOCATION parameters - // Note for this mothod, both input & output buffers are 'raw', - // i.e. unbuffered, and should be treated with caution ( either - // probed & captured before access, or use try-except to enclose - // access to the buffer) - // - - PVOID InputBuffer; - PVOID OutputBuffer; - - // - // Mdl address for the output buffer (maybe NULL) - // - - PMDL OutputMdlAddress; - } Neither; - - // - // METHOD_BUFFERED Fsctl parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT FsControlCode; - - // - // For method buffered, this buffer is used both for input and - // output - // - - PVOID SystemBuffer; - - } Buffered; - - // - // METHOD_IN_DIRECT/METHOD_OUT_DIRECT Fsctl parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT FsControlCode; - - // - // Note the input buffer is already captured & buffered here - so - // can be safely accessed from kernel mode. The output buffer is - // locked down - so also safe to access, however the OutputBuffer - // pointer is the user virtual address, so if the driver wishes to - // access the buffer in a different process context than that of - // the original i/o - it will have to obtain the system address - // from the MDL - // - - PVOID InputSystemBuffer; - - // - // User virtual address of output buffer - // - - PVOID OutputBuffer; - - // - // Mdl address for the locked down output buffer (should be - // non-NULL) - // - - PMDL OutputMdlAddress; - } Direct; - - } FileSystemControl; - - // - // IRP_MJ_DEVICE_CONTROL or IRP_MJ_INTERNAL_DEVICE_CONTROL - // - - union { - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - } Common; - - // - // The parameters are broken out into 3 separate unions based on the - // method of the IOCTL. Drivers should use the method-appropriate - // union for accessing parameters. - // - - // - // METHOD_NEITHER Ioctl parameters for IRP path - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - - // - // Type3InputBuffer: name changed from IO_STACK_LOCATION parameters - // Note for this mothod, both input & output buffers are 'raw', - // i.e. unbuffered, and should be treated with caution ( either - // probed & captured before access, or use try-except to enclose - // access to the buffer) - // - - PVOID InputBuffer; - PVOID OutputBuffer; - - // - // Mdl address for the output buffer (maybe NULL) - // - - PMDL OutputMdlAddress; - } Neither; - - // - // METHOD_BUFFERED Ioctl parameters for IRP path - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - - // - // For method buffered, this buffer is used both for input and - // output - // - - PVOID SystemBuffer; - - } Buffered; - - // - // METHOD_IN_DIRECT/METHOD_OUT_DIRECT Ioctl parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - - // - // Note the input buffer is already captured & buffered here - so - // can be safely accessed from kernel mode. The output buffer is - // locked down - so also safe to access, however the OutputBuffer - // pointer is the user virtual address, so if the driver wishes to - // access the buffer in a different process context than that of - // the original i/o - it will have to obtain the system address - // from the MDL - // - - PVOID InputSystemBuffer; - - // - // User virtual address of output buffer - // - - PVOID OutputBuffer; - - // - // Mdl address for the locked down output buffer (should be non-NULL) - // - - PMDL OutputMdlAddress; - } Direct; - - // - // Regardless of method, if the CALLBACK_DATA represents a fast i/o - // device IOCTL, this structure must be used to access the parameters - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - - // - // Both buffers are 'raw', i.e. unbuffered - // - - PVOID InputBuffer; - PVOID OutputBuffer; - - } FastIo; - - } DeviceIoControl; - - // - // IRP_MJ_LOCK_CONTROL - // - - struct { - PLARGE_INTEGER Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - - PEPROCESS ProcessId; // Only meaningful for FastIo locking operations. - BOOLEAN FailImmediately; // Only meaningful for FastIo locking operations. - BOOLEAN ExclusiveLock; // Only meaningful for FastIo locking operations. - } LockControl; - - // - // IRP_MJ_QUERY_SECURITY - // - - struct { - SECURITY_INFORMATION SecurityInformation; - ULONG POINTER_ALIGNMENT Length; - - PVOID SecurityBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } QuerySecurity; - - // - // IRP_MJ_SET_SECURITY - // - - struct { - SECURITY_INFORMATION SecurityInformation; - PSECURITY_DESCRIPTOR SecurityDescriptor; - } SetSecurity; - - // - // IRP_MJ_SYSTEM_CONTROL - // - - struct { - ULONG_PTR ProviderId; - PVOID DataPath; - ULONG BufferSize; - PVOID Buffer; - } WMI; - - // - // IRP_MJ_QUERY_QUOTA - // - - struct { - ULONG Length; - PSID StartSid; - PFILE_GET_QUOTA_INFORMATION SidList; - ULONG SidListLength; - - PVOID QuotaBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } QueryQuota; - - // - // IRP_MJ_SET_QUOTA - // - - struct { - ULONG Length; - - PVOID QuotaBuffer; //Not in IO_STACK_LOCATION parameters list - PMDL MdlAddress; //Mdl address for the buffer (maybe NULL) - } SetQuota; - - // - // IRP_MJ_PNP - // - - union { - - // - // IRP_MN_START_DEVICE - // - - struct { - PCM_RESOURCE_LIST AllocatedResources; - PCM_RESOURCE_LIST AllocatedResourcesTranslated; - } StartDevice; - - // - // IRP_MN_QUERY_DEVICE_RELATIONS - // - - struct { - DEVICE_RELATION_TYPE Type; - } QueryDeviceRelations; - - // - // IRP_MN_QUERY_INTERFACE - // - - struct { - CONST GUID *InterfaceType; - USHORT Size; - USHORT Version; - PINTERFACE Interface; - PVOID InterfaceSpecificData; - } QueryInterface; - - // - // IRP_MN_QUERY_CAPABILITIES - // - - struct { - PDEVICE_CAPABILITIES Capabilities; - } DeviceCapabilities; - - // - // IRP_MN_FILTER_RESOURCE_REQUIREMENTS - // - - struct { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; - } FilterResourceRequirements; - - // - // IRP_MN_READ_CONFIG and IRP_MN_WRITE_CONFIG - // - - struct { - ULONG WhichSpace; - PVOID Buffer; - ULONG Offset; - ULONG POINTER_ALIGNMENT Length; - } ReadWriteConfig; - - // - // IRP_MN_SET_LOCK - // - - struct { - BOOLEAN Lock; - } SetLock; - - // - // IRP_MN_QUERY_ID - // - - struct { - BUS_QUERY_ID_TYPE IdType; - } QueryId; - - // - // IRP_MN_QUERY_DEVICE_TEXT - // - - struct { - DEVICE_TEXT_TYPE DeviceTextType; - LCID POINTER_ALIGNMENT LocaleId; - } QueryDeviceText; - - // - // IRP_MN_DEVICE_USAGE_NOTIFICATION - // - - struct { - BOOLEAN InPath; - BOOLEAN Reserved[3]; - DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; - } UsageNotification; - - } Pnp; - - // - // ***** Start of Emulated IRP definitions - // - - // - // IRP_MJ_ACQUIRE_FOR_SECTION_SYNCHRONIZATION - // - - struct { - FS_FILTER_SECTION_SYNC_TYPE SyncType; - ULONG PageProtection; - } AcquireForSectionSynchronization; - - // - // IRP_MJ_ACQUIRE_FOR_MOD_WRITE - // - - struct { - PLARGE_INTEGER EndingOffset; - PERESOURCE *ResourceToRelease; - } AcquireForModifiedPageWriter; - - // - // IRP_MJ_RELEASE_FOR_MOD_WRITE - // - - struct { - PERESOURCE ResourceToRelease; - } ReleaseForModifiedPageWriter; - - - // - // FAST_IO_CHECK_IF_POSSIBLE - // - - struct { - LARGE_INTEGER FileOffset; - ULONG Length; - ULONG POINTER_ALIGNMENT LockKey; - BOOLEAN POINTER_ALIGNMENT CheckForReadOperation; - } FastIoCheckIfPossible; - - // - // IRP_MJ_NETWORK_QUERY_OPEN - // - - struct { - PIRP Irp; - PFILE_NETWORK_OPEN_INFORMATION NetworkInformation; - } NetworkQueryOpen; - - // - // IRP_MJ_MDL_READ - // - - struct { - LARGE_INTEGER FileOffset; - ULONG POINTER_ALIGNMENT Length; - ULONG POINTER_ALIGNMENT Key; - PMDL *MdlChain; - } MdlRead; - - // - // IRP_MJ_MDL_READ_COMPLETE - // - - struct { - PMDL MdlChain; - } MdlReadComplete; - - // - // IRP_MJ_PREPARE_MDL_WRITE - // - - struct { - LARGE_INTEGER FileOffset; - ULONG POINTER_ALIGNMENT Length; - ULONG POINTER_ALIGNMENT Key; - PMDL *MdlChain; - } PrepareMdlWrite; - - // - // IRP_MJ_MDL_WRITE_COMPLETE - // - - struct { - LARGE_INTEGER FileOffset; - PMDL MdlChain; - } MdlWriteComplete; - - // - // IRP_MJ_VOLUME_MOUNT - // - - struct { - ULONG DeviceType; - } MountVolume; - - - // - // Others - driver-specific - // - - struct { - PVOID Argument1; - PVOID Argument2; - PVOID Argument3; - PVOID Argument4; - PVOID Argument5; - LARGE_INTEGER Argument6; - } Others; - -} FLT_PARAMETERS, *PFLT_PARAMETERS; - -#if !defined(_AMD64_) && !defined(_IA64_) -#include "poppack.h" -#endif - - -/////////////////////////////////////////////////////////////////////////////// -// -// CALLBACK DATA definition -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Changeable portion of the callback data. Any of the parameters in this -// structure that are passed in via CallbackData->Px, can be changed by -// a mini-filter. However if filter changes ANY of the parameters in this -// structure, it needs to issue FltSetCallbackDataDirty() on the -// callback-data or the changes will not be honored & unpredictable failures -// may occur. -// - -typedef struct _FLT_IO_PARAMETER_BLOCK { - - - // - // Fields from IRP - // Flags - - ULONG IrpFlags; - - // - // Major/minor functions from IRP - // - - UCHAR MajorFunction; - UCHAR MinorFunction; - - // - // The flags associated with operations. - // The IO_STACK_LOCATION.Flags field in the old model (SL_* flags) - // - - UCHAR OperationFlags; - - // - // For alignment - // - - UCHAR Reserved; - - - // - // The FileObject that is the target for this - // IO operation. - // - - PFILE_OBJECT TargetFileObject; - - // - // Instance that i/o is directed to - // - - PFLT_INSTANCE TargetInstance; - - // - // Normalized parameters for the operation - // - - FLT_PARAMETERS Parameters; - -} FLT_IO_PARAMETER_BLOCK, *PFLT_IO_PARAMETER_BLOCK; - - -// -// Flag Bit definitions for the Flags variable of FLT_CALLBACK_DATA -// - -typedef ULONG FLT_CALLBACK_DATA_FLAGS; - - // - // Flags passed to mini-filters - // - - // - // This mask designates the flags that describe the the type of i/o - // and parameters - // - #define FLTFL_CALLBACK_DATA_REISSUE_MASK 0x0000FFFF - - // - // The below 3 flags are mutually exclusive. - // i.e. only ONE and exacly one hould be set for the callback data. - // Once set they should never change - // - #define FLTFL_CALLBACK_DATA_IRP_OPERATION 0x00000001 // Set for Irp operations - #define FLTFL_CALLBACK_DATA_FAST_IO_OPERATION 0x00000002 // Set for Fast Io operations - #define FLTFL_CALLBACK_DATA_FS_FILTER_OPERATION 0x00000004 // Set for Fs Filter operations - // - // In principle this flag can be set for any operation. Once set it shouldn't change - // - #define FLTFL_CALLBACK_DATA_SYSTEM_BUFFER 0x00000008 // Set if the buffer passed in for the i/o was a system buffer - - - - // - // Below flags are relevant only for IRP-based i/o - i.e. only - // if FLTFL_CALLBACK_DATA_IRP_OPERATION was set. If the i/o was reissued - // both flags will necessarily be set - // - #define FLTFL_CALLBACK_DATA_GENERATED_IO 0x00010000 // Set if this is I/O generated by a mini-filter - #define FLTFL_CALLBACK_DATA_REISSUED_IO 0x00020000 // Set if this I/O was reissued - - // - // Below 2 flags are set only for post-callbacks. - // - #define FLTFL_CALLBACK_DATA_DRAINING_IO 0x00040000 // set if this operation is being drained. If set, - #define FLTFL_CALLBACK_DATA_POST_OPERATION 0x00080000 // Set if this is a POST operation - - // - // This flag can only be set by Filter Manager, only for an IRP based operation - // and only for a post callback. When set, it specifies that a lower level driver - // allocated a buffer for AssociatedIrp.SystemBuffer in which the data for - // the operation will be returned to the IO manager. Filters need to know this - // because when they were called in the PRE operation AssociatedIrp.SystemBuffer - // was null and as such their buffer is set to UserBuffer and they have no way of - // getting the real data from SystemBuffer. Check the IRP_DEALLOCATE_BUFFER flag for - // more details on how this is used by file systems. - // - - #define FLTFL_CALLBACK_DATA_NEW_SYSTEM_BUFFER 0x00100000 - - // - // Flags set by mini-filters: these are set by the minifilters and may be reset - // by filter manager. - // - #define FLTFL_CALLBACK_DATA_DIRTY 0x80000000 // Set by caller if parameters were changed - - - -#if FLT_MGR_WIN7 - -// -// CallbackData allocation flags. -// - -typedef ULONG FLT_ALLOCATE_CALLBACK_DATA_FLAGS; - - // - // Normaly only the IrpCtrl is allocated and the other members - // that might be needed are allocated at the time when they are needed. - // This flag allows the user to preallocate all other structures that - // are needed thus avoiding a potential allocation failure at a later - // time. Useful when a filter wants to save a callbackdata to use in - // case it needs to perform IO under low memory conditions. - // - - #define FLT_ALLOCATE_CALLBACK_DATA_PREALLOCATE_ALL_MEMORY 0x00000001 - -#endif //FLT_MGR_WIN7 - -// -// This defines the standard information passed to a mini-filter for -// every operation callback. -// - -typedef struct _FLT_CALLBACK_DATA { - - // - // Flags - // - - FLT_CALLBACK_DATA_FLAGS Flags; - - // - // Thread that initiated this operation. - // - - PETHREAD CONST Thread; - - // - // Pointer to the changeable i/o parameters - // - - PFLT_IO_PARAMETER_BLOCK CONST Iopb; - - // - // For pre-op calls: if filter returns STATUS_IO_COMPLETE, then it should - // set the return i/o status here. For post-operation calls, this is set - // by filter-manager indicating the completed i/o status. - // - - IO_STATUS_BLOCK IoStatus; - - - struct _FLT_TAG_DATA_BUFFER *TagData; - - union { - struct { - - // - // Queue links if the FltMgr queue is used to - // pend the callback - // - - LIST_ENTRY QueueLinks; - - // - // Additional context - // - - PVOID QueueContext[2]; - }; - - // - // The following are available to filters to use - // in whatever manner desired if not using the filter manager - // queues. - // NOTE: These fields are only valid while the filter is - // processing this operation which is inside the operation - // callback or while the operation is pended. - // - - PVOID FilterContext[4]; - }; - - // - // Original requester mode of caller - // - - KPROCESSOR_MODE RequestorMode; - -} FLT_CALLBACK_DATA, *PFLT_CALLBACK_DATA; - - -// -// Routines to manipulate callback data dirty state -// - -VOID -FLTAPI -FltSetCallbackDataDirty( - __inout PFLT_CALLBACK_DATA Data - ); - -VOID -FLTAPI -FltClearCallbackDataDirty( - __inout PFLT_CALLBACK_DATA Data - ); - -BOOLEAN -FLTAPI -FltIsCallbackDataDirty( - __in PFLT_CALLBACK_DATA Data - ); - - -// -// These used to be macros and our now routines. This was done for greater -// flexibility in the future. I have kept the macros around for compatibility -// with existing filters. -// - -#define FLT_SET_CALLBACK_DATA_DIRTY(Data) FltSetCallbackDataDirty(Data) -#define FLT_CLEAR_CALLBACK_DATA_DIRTY(Data) FltClearCallbackDataDirty(Data) -#define FLT_IS_CALLBACK_DATA_DIRTY(Data) FltIsCallbackDataDirty(Data) - -// -// These just check the kind of operation for the CallbackData -// All of them take callback data as the parameter -// - -#define FLT_IS_IRP_OPERATION(Data) (FlagOn( (Data)->Flags, FLTFL_CALLBACK_DATA_IRP_OPERATION )) -#define FLT_IS_FASTIO_OPERATION(Data) (FlagOn( (Data)->Flags, FLTFL_CALLBACK_DATA_FAST_IO_OPERATION )) -#define FLT_IS_FS_FILTER_OPERATION(Data) (FlagOn( (Data)->Flags, FLTFL_CALLBACK_DATA_FS_FILTER_OPERATION )) - -// -// Bunch of other miscellaneous i/o characteristics -// - -#define FLT_IS_REISSUED_IO(Data) (FlagOn( (Data)->Flags, FLTFL_CALLBACK_DATA_REISSUED_IO )) - -// -// This test only is useful for IRP operations to check if the passed in buffer is a system buffer -// - -#define FLT_IS_SYSTEM_BUFFER(Data) (FlagOn( (Data)->Flags, FLTFL_CALLBACK_DATA_SYSTEM_BUFFER )) - - -/////////////////////////////////////////////////////////////////////////////// -// -// Context Definitions -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Definitions for the types of contexts that are available. -// - -typedef USHORT FLT_CONTEXT_TYPE; - - #define FLT_VOLUME_CONTEXT 0x0001 - #define FLT_INSTANCE_CONTEXT 0x0002 - #define FLT_FILE_CONTEXT 0x0004 - #define FLT_STREAM_CONTEXT 0x0008 - #define FLT_STREAMHANDLE_CONTEXT 0x0010 - #define FLT_TRANSACTION_CONTEXT 0x0020 - - #define FLT_CONTEXT_END 0xffff - -// -// Definition for ALL contexts -// - -#define FLT_ALL_CONTEXTS (FLT_VOLUME_CONTEXT | \ - FLT_INSTANCE_CONTEXT | \ - FLT_FILE_CONTEXT | \ - FLT_STREAM_CONTEXT | \ - FLT_STREAMHANDLE_CONTEXT |\ - FLT_TRANSACTION_CONTEXT) - -// -// This structure is passed to a filter's pre/post operation callback -// routines and defines all of the handles associated with the given -// operation. -// - -typedef struct _FLT_RELATED_OBJECTS { - - USHORT CONST Size; - USHORT CONST TransactionContext; //TxF mini-version - PFLT_FILTER CONST Filter; - PFLT_VOLUME CONST Volume; - PFLT_INSTANCE CONST Instance; - PFILE_OBJECT CONST FileObject; - PKTRANSACTION CONST Transaction; - -} FLT_RELATED_OBJECTS, *PFLT_RELATED_OBJECTS; - -typedef CONST struct _FLT_RELATED_OBJECTS *PCFLT_RELATED_OBJECTS; - -// -// Structure used by a filter to get/release multiple contexts at once. -// - -typedef struct _FLT_RELATED_CONTEXTS { - - PFLT_CONTEXT VolumeContext; - PFLT_CONTEXT InstanceContext; - PFLT_CONTEXT FileContext; - PFLT_CONTEXT StreamContext; - PFLT_CONTEXT StreamHandleContext; - PFLT_CONTEXT TransactionContext; - -} FLT_RELATED_CONTEXTS, *PFLT_RELATED_CONTEXTS; - -// -// Prototype for Context Cleanup routine. This routine is called by the -// filterManager when it has determined it is time to free a context. -// The called filter should cleanup any allocated memory they have inside -// this context structure. FLTMGR will free the context upon return. -// - -typedef VOID -(FLTAPI *PFLT_CONTEXT_CLEANUP_CALLBACK) ( - __in PFLT_CONTEXT Context, - __in FLT_CONTEXT_TYPE ContextType - ); - -// -// Function prototypes for Allocation and Free callbacks that may be used by -// advanced filters that want to manage context allocation directly. -// -// NOTE: Most filters do not need to use this feature since the default -// mechanism built into FltMgr does this efficiently. -// - -typedef PVOID -(FLTAPI *PFLT_CONTEXT_ALLOCATE_CALLBACK)( - __in POOL_TYPE PoolType, - __in SIZE_T Size, - __in FLT_CONTEXT_TYPE ContextType - ); - -typedef VOID -(FLTAPI *PFLT_CONTEXT_FREE_CALLBACK)( - __in PVOID Pool, - __in FLT_CONTEXT_TYPE ContextType - ); - -// -// Defines context registration flags -// - -typedef USHORT FLT_CONTEXT_REGISTRATION_FLAGS; - - // - // By default, the FltMgr matches exactly a given context allocation - // request with a size specified at context registration time. If - // this flag is specified, then the FltMgr will use a given registered - // size definition if the requested size is <= to it. Note that the - // FltMgr sorts multiple size definions into ascending order. - // - // This flag is ignored on entries with FLT_VARIABLE_SIZED_CONTEXTS - // specified or Alloc/Free routines specified - // - - #define FLTFL_CONTEXT_REGISTRATION_NO_EXACT_SIZE_MATCH 0x0001 - - -// -// When this value is used in the "Size" field of the FLT_CONTEXT_REGISTRATION -// structure, then this registered context entry has no explicit size. -// When allocation requests are made, FltMgr directly allocates and frees -// the memory from pool. -// -// For a given context and pool type, only one entry may have this value. -// This may be included with multiple explicitly sized entries. This will -// always be sorted to the end of the list. -// - -#define FLT_VARIABLE_SIZED_CONTEXTS ((SIZE_T)-1) - -// -// An array of this structure is used for registering the different kinds of -// contexts used by this mini-filter. -// -// At least one of these records must be speicifed to allocate a context of a -// given type. -// - -typedef struct _FLT_CONTEXT_REGISTRATION { - - // - // Identifies the type of this context - // - - FLT_CONTEXT_TYPE ContextType; - - // - // Local flags - // - - FLT_CONTEXT_REGISTRATION_FLAGS Flags; - - // - // Routine to call to cleanup the context before it is deleted. - // This may be NULL if not cleanup is needed. - // - - PFLT_CONTEXT_CLEANUP_CALLBACK ContextCleanupCallback; - - // - // Defines the size & pool tag the mini-filter wants for the given context. - // FLT_VARIABLE_SIZED_CONTEXTS may be specified for the size if variable - // sized contexts are used. A size of zero is valid. If an empty pooltag - // value is specified, the FLTMGR will use a context type specific tag. - // - // If an explicit size is specified, the FLTMGR internally optimizes the - // allocation of that entry. - // - // NOTE: These fields are ignored if Allocate & Free routines are - // specifed. - // - - SIZE_T Size; - ULONG PoolTag; - - // - // Specifies the ALLOCATE and FREE routines that should be used - // when allocating a context for this mini-filter. - // - // NOTE: The above size & PoolTag fields are ignored when these routines - // are defined. - // - - PFLT_CONTEXT_ALLOCATE_CALLBACK ContextAllocateCallback; - PFLT_CONTEXT_FREE_CALLBACK ContextFreeCallback; - - // - // Reserved for future expansion - // - - PVOID Reserved1; - -} FLT_CONTEXT_REGISTRATION, *PFLT_CONTEXT_REGISTRATION; - -typedef const FLT_CONTEXT_REGISTRATION *PCFLT_CONTEXT_REGISTRATION; - - -/////////////////////////////////////////////////////////////////////////////// -// -// Known File System Types -// -/////////////////////////////////////////////////////////////////////////////// - -// -// The enum FLT_FILESYSTEM_TYPE has been moved to FltUserStructures.h -// so it can be referenced by both user mode and kernel mode components -// - - -/////////////////////////////////////////////////////////////////////////////// -// -// Instance attach/detach callback definitions -// -/////////////////////////////////////////////////////////////////////////////// - -// -// ******** Instance setup ******** -// - -// -// Flags identifying why the given instance attach callback routine was -// called. More then one bit may be set. -// - -typedef ULONG FLT_INSTANCE_SETUP_FLAGS; - - // - // If set, this is an automatic instance attachment notification. These - // occur when the filter is first loaded for all existing volumes, and - // when a new volume is mounted. - // - - #define FLTFL_INSTANCE_SETUP_AUTOMATIC_ATTACHMENT 0x00000001 - - // - // If set, this is a manual instance attachment request via FilterAttach - // (user mode) or FltAttachVolume. - // - - #define FLTFL_INSTANCE_SETUP_MANUAL_ATTACHMENT 0x00000002 - - // - // If set, this is an automatic instance notification for a volume that - // has just been mounted in the system. - // - - #define FLTFL_INSTANCE_SETUP_NEWLY_MOUNTED_VOLUME 0x00000004 - -#if FLT_MGR_LONGHORN - // - // If set, this volume is not currently attached to a storage stack. - // This usually means the volume is dismounted but it does not always - // mean that. There are scnearios with certain file systems (fat & cdfs - // being some) where a volume can become reattached after it has detached. - // This flag is only set in Longhorn or later. - // - - #define FLTFL_INSTANCE_SETUP_DETACHED_VOLUME 0x00000008 - -#endif // FLT_MGR_LONGHORN - - -// -// This is called whenever a new instance is being created. This gives the -// filter the opportunity to decide if they want to attach to the given -// volume or not. -// -// A SUCCESS return value will cause the instance to be attached to the given -// volume. A WARNING or ERROR return value will cause the instance to NOT be -// attached to the given volume. Following are reasonable sample return -// values: -// STATUS_SUCCESS -// STATUS_FLT_DO_NOT_ATTACH -// -// If no callback is defined the given instance will be attached. -// - -typedef NTSTATUS -(FLTAPI *PFLT_INSTANCE_SETUP_CALLBACK) ( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in FLT_INSTANCE_SETUP_FLAGS Flags, - __in DEVICE_TYPE VolumeDeviceType, - __in FLT_FILESYSTEM_TYPE VolumeFilesystemType - ); - - -// -// ******** Instance Query Detach ******** -// - -// -// Flags identifying why the given instance query detach callback routine was -// called. More then one bit may be set. -// - -typedef ULONG FLT_INSTANCE_QUERY_TEARDOWN_FLAGS; - - // - // No flags currently defined - // - -// -// This is called whenever a manual detachment request is made for the given -// instance. This is not called for mandatory detachment requests (like -// filter unload or volume dismount). This gives the filter the opportunity -// to decide if they want to detach from the given volume or not. -// -// A SUCCESS return value will cause the instance to be detached from the -// given volume. A WARNING or ERROR return value will cause the instance to -// NOT be detached from the given volume. Following are reasonable sample -// return values: -// STATUS_SUCCESS -// STATUS_FLT_DO_NOT_DETACH -// -// If no callback is defined the given instance will NOT be detached. -// - -typedef NTSTATUS -(FLTAPI *PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK) ( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in FLT_INSTANCE_QUERY_TEARDOWN_FLAGS Flags - ); - - -// -// ******** Instance teardown ******** -// - -// -// Flag identifying why the given instance detach callback routine was called. -// More then one bit may be set. -// - -typedef ULONG FLT_INSTANCE_TEARDOWN_FLAGS; - - // - // If set, this is a manual instance detach request via FilterDetach - // (user mode) or FltDetachVolume (kernel mode). - // - - #define FLTFL_INSTANCE_TEARDOWN_MANUAL 0x00000001 - - // - // If set, the filter is being unloaded. - // - - #define FLTFL_INSTANCE_TEARDOWN_FILTER_UNLOAD 0x00000002 - - // - // If set, the filter is being unloaded. - // - - #define FLTFL_INSTANCE_TEARDOWN_MANDATORY_FILTER_UNLOAD 0x00000004 - - // - // If set, the volume is being dismounted. - // - - #define FLTFL_INSTANCE_TEARDOWN_VOLUME_DISMOUNT 0x00000008 - - // - // If set, an error occurred while doing instance setup (like running - // out of memory). - // - - #define FLTFL_INSTANCE_TEARDOWN_INTERNAL_ERROR 0x00000010 - - -// -// This is the prototype for two different teardown callback routines. -// -// The TEARDOWN_START routine is called at the beginning of teardown process. -// There may still be operation callbacks in progress. This is called to give -// the filter the oppertunity to do the following things: -// - Restart any pended operations -// - Set state so that minimual processing will be performed on future -// operation callbacks. -// - Unregister from other OS callback APIs -// - -// -// The TEARDOWN_COMPLETE routine is called after teardown has been finished. -// The system guarentees that all existing callbacks have been completed -// before this routine is called. This is called to give the filter the -// oppertunity to: -// - Close any open files. -// - do other instance state cleanup. -// - -typedef VOID -(FLTAPI *PFLT_INSTANCE_TEARDOWN_CALLBACK) ( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in FLT_INSTANCE_TEARDOWN_FLAGS Reason - ); - -////////////////////////////////////////////////////////////////////////////// -// -// Pre/Post Operation Callback definitions -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Values returned from the pre-operation callback routine defining what -// to do next. -// - -typedef enum _FLT_PREOP_CALLBACK_STATUS { - - FLT_PREOP_SUCCESS_WITH_CALLBACK, - FLT_PREOP_SUCCESS_NO_CALLBACK, - FLT_PREOP_PENDING, - FLT_PREOP_DISALLOW_FASTIO, - FLT_PREOP_COMPLETE, - FLT_PREOP_SYNCHRONIZE - - -} FLT_PREOP_CALLBACK_STATUS, *PFLT_PREOP_CALLBACK_STATUS; - -// -// Pre-operation callback prototype. -// - -typedef FLT_PREOP_CALLBACK_STATUS -(FLTAPI *PFLT_PRE_OPERATION_CALLBACK) ( - __inout PFLT_CALLBACK_DATA Data, - __in PCFLT_RELATED_OBJECTS FltObjects, - __deref_out_opt PVOID *CompletionContext - ); - - -// -// Values returned from the post-operation callback routine defining what -// to od next. -// - -typedef enum _FLT_POSTOP_CALLBACK_STATUS { - - FLT_POSTOP_FINISHED_PROCESSING, - FLT_POSTOP_MORE_PROCESSING_REQUIRED - -} FLT_POSTOP_CALLBACK_STATUS, *PFLT_POSTOP_CALLBACK_STATUS; - -// -// Flag BITS sent to the post-operation callback routine -// - -typedef ULONG FLT_POST_OPERATION_FLAGS; - - // - // If set, this instance is being detached and this post-operation - // routine has been called for cleanup processing (drained). Since this - // instance is going away, you should perform a minimum of operations - // while processing this completion. - // - - #define FLTFL_POST_OPERATION_DRAINING 0x00000001 - -// -// Post-operation callback prototype -// - -typedef FLT_POSTOP_CALLBACK_STATUS -(FLTAPI *PFLT_POST_OPERATION_CALLBACK) ( - __inout PFLT_CALLBACK_DATA Data, - __in PCFLT_RELATED_OBJECTS FltObjects, - __in_opt PVOID CompletionContext, - __in FLT_POST_OPERATION_FLAGS Flags - ); - -// -// Post operation callbacks may be called at DPC level. This routine may be -// used to transfer completion processing to a "safe" IRQL level. This -// routine will determine if it is safe to call the "SafePostCallback" now -// or if it must post the request to a worker thread. If posting to a worker -// thread is needed it determines it is safe to do so (some operations can -// not be posted like paging IO). -// - -__checkReturn -BOOLEAN -FLTAPI -FltDoCompletionProcessingWhenSafe( - __in PFLT_CALLBACK_DATA Data, - __in PCFLT_RELATED_OBJECTS FltObjects, - __in_opt PVOID CompletionContext, - __in FLT_POST_OPERATION_FLAGS Flags, - __in PFLT_POST_OPERATION_CALLBACK SafePostCallback, - __out PFLT_POSTOP_CALLBACK_STATUS RetPostOperationStatus - ); - -// -// Defines current operation callback flags. -// - -typedef ULONG FLT_OPERATION_REGISTRATION_FLAGS; - - // - // If set, the filter's callbacks for this operation will not be called, - // if it's a paging i/o operation. This flag is relevant only for IRP-based - // operations & ignored for non-IRP operations - // - - #define FLTFL_OPERATION_REGISTRATION_SKIP_PAGING_IO 0x00000001 - - // - // If set read/write operations that are not non-cached will be skipped: - // i.e. the mini-filters callback for this operation will be bypassed. - // This flag is relevant only for IRP_MJ_READ & IRP_MJ_WRITE - // This of course implies that fast i/o reads and writes will be skipped, - // since those imply cached i/o by default - // - - #define FLTFL_OPERATION_REGISTRATION_SKIP_CACHED_IO 0x00000002 - - // - // If set all operations that are not issued on a DASD (volume) handle will be skipped: - // i.e. the mini-filters callback for this operation will be bypassed. - // This flag is relevant for all operations - // - - #define FLTFL_OPERATION_REGISTRATION_SKIP_NON_DASD_IO 0x00000004 - - -// -// Structure used for registering operation callback routines -// - -typedef struct _FLT_OPERATION_REGISTRATION { - - UCHAR MajorFunction; - FLT_OPERATION_REGISTRATION_FLAGS Flags; - PFLT_PRE_OPERATION_CALLBACK PreOperation; - PFLT_POST_OPERATION_CALLBACK PostOperation; - - PVOID Reserved1; - -} FLT_OPERATION_REGISTRATION, *PFLT_OPERATION_REGISTRATION; - - -/////////////////////////////////////////////////////////////////////////////// -// -// This defines structures and flags for reparse point tag notifications -// that a filter uses to register. -// -/////////////////////////////////////////////////////////////////////////////// - -typedef struct _FLT_TAG_DATA_BUFFER { - ULONG FileTag; - USHORT TagDataLength; - USHORT UnparsedNameLength; - union { - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - ULONG Flags; - WCHAR PathBuffer[1]; - } SymbolicLinkReparseBuffer; - - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - WCHAR PathBuffer[1]; - } MountPointReparseBuffer; - - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; - - // - // Used for non-Microsoft reparse points - // - - struct { - GUID TagGuid; - UCHAR DataBuffer[1]; - } GenericGUIDReparseBuffer; - }; -} FLT_TAG_DATA_BUFFER, *PFLT_TAG_DATA_BUFFER; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#define FLT_TAG_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(FLT_TAG_DATA_BUFFER, GenericReparseBuffer) - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Filter Unload Definitions -// -/////////////////////////////////////////////////////////////////////////////// - -typedef ULONG FLT_FILTER_UNLOAD_FLAGS; - - // - // If set, the OS has requested to unload this filter and the operation - // can not be failed. - // - - #define FLTFL_FILTER_UNLOAD_MANDATORY 0x00000001 - - -// -// Callback to notify a filter it is being unloaded. If the filter returns -// a SUCCESS code, then the filter is unloaded. If a WARNING or ERROR -// code is returned then the filter is not unloaded. If not callback is -// defined the filter will not be unloaded. -// - -typedef NTSTATUS -(FLTAPI *PFLT_FILTER_UNLOAD_CALLBACK) ( - FLT_FILTER_UNLOAD_FLAGS Flags - ); - -///////////////////////////////////////////////////////////////////////// -// -// Routines and structures for Name Providing Filter (filters that modify -// names in the namespace). -// -//////////////////////////////////////////////////////////////////////// - -// -// The FLT_NAME_CONTROL structure is used to efficiently manage a name buffer -// as a name is generated by a filter that modifies the namespace. -// -// The filter should never free or try to replace the buffer in the Name -// UNICODE_STRING directly. It should call FltNameControlCheckAndGrow to -// varify that the buffer is large enough for more data to be added and grow -// the buffer as needed. -// - -typedef struct _FLT_NAME_CONTROL { - - // - // The unicode string where the name should be set. - // - - UNICODE_STRING Name; - -} FLT_NAME_CONTROL, *PFLT_NAME_CONTROL; - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltCheckAndGrowNameControl ( - __inout PFLT_NAME_CONTROL NameCtrl, - __in USHORT NewSize - ); - -// -// Define this hear for the PFLT_GENERATE_FILE_NAME signature. This is defined -// again later at the point where the flags are defined. -// - -typedef ULONG FLT_FILE_NAME_OPTIONS; - -typedef NTSTATUS -(FLTAPI *PFLT_GENERATE_FILE_NAME) ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in_opt PFLT_CALLBACK_DATA CallbackData, - __in FLT_FILE_NAME_OPTIONS NameOptions, - __out PBOOLEAN CacheFileNameInformation, - __out PFLT_NAME_CONTROL FileName - ); - -typedef ULONG FLT_NORMALIZE_NAME_FLAGS; - -// -// Normalize name flags -// - - #define FLTFL_NORMALIZE_NAME_CASE_SENSITIVE 0x01 - #define FLTFL_NORMALIZE_NAME_DESTINATION_FILE_NAME 0x02 - -typedef NTSTATUS -(FLTAPI *PFLT_NORMALIZE_NAME_COMPONENT) ( - __in PFLT_INSTANCE Instance, - __in PCUNICODE_STRING ParentDirectory, - __in USHORT VolumeNameLength, - __in PCUNICODE_STRING Component, - __out_bcount(ExpandComponentNameLength) PFILE_NAMES_INFORMATION ExpandComponentName, - __in ULONG ExpandComponentNameLength, - __in FLT_NORMALIZE_NAME_FLAGS Flags, - __deref_inout_opt PVOID *NormalizationContext - ); - -typedef NTSTATUS -(FLTAPI *PFLT_NORMALIZE_NAME_COMPONENT_EX) ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in PCUNICODE_STRING ParentDirectory, - __in USHORT VolumeNameLength, - __in PCUNICODE_STRING Component, - __out_bcount(ExpandComponentNameLength) PFILE_NAMES_INFORMATION ExpandComponentName, - __in ULONG ExpandComponentNameLength, - __in FLT_NORMALIZE_NAME_FLAGS Flags, - __deref_inout_opt PVOID *NormalizationContext - ); - -typedef VOID -(FLTAPI *PFLT_NORMALIZE_CONTEXT_CLEANUP) ( - __in_opt PVOID *NormalizationContext - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltPurgeFileNameInformationCache ( - __in PFLT_INSTANCE Instance, - __in_opt PFILE_OBJECT FileObject - ); - -/////////////////////////////////////////////////////////////////////////////// -// -// Transaction callback definitions -// -/////////////////////////////////////////////////////////////////////////////// - -#if FLT_MGR_LONGHORN - -typedef NTSTATUS -(FLTAPI *PFLT_TRANSACTION_NOTIFICATION_CALLBACK) ( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in PFLT_CONTEXT TransactionContext, - __in ULONG NotificationMask - ); - -#endif // FLT_MGR_LONGHORN - - -////////////////////////////////////////////////////////////////////////////// -// -// This structure is used at registration time to define what callbacks -// this driver wishes to receive. -// -/////////////////////////////////////////////////////////////////////////////// - -// -// This defines the MAJOR/MINOR version number to be passed in at registration -// time. The filter manager uses this number to validate / process the -// parameters passed in. Note that the minor version number can change and -// you will still be able to register. If the major version number changes -// then the filter will no longer load. -// - -// -// Registration version for XP SP2 and W2K3 SP1 -// - -#define FLT_REGISTRATION_VERSION_0200 0x0200 - -// -// Registration version for Vista Beta 2 -// (adds PFLT_TRANSACTION_NOTIFICATION_CALLBACK) -// - -#define FLT_REGISTRATION_VERSION_0201 0x0201 - -// -// Registration version for Vista RTM -// (adds PFLT_NORMALIZE_NAME_COMPONENT_EX) -// - -#define FLT_REGISTRATION_VERSION_0202 0x0202 - -// -// NOTE: You should always pass in this defined value (do not explicitly -// specify older values) - -#if FLT_MGR_LONGHORN - #define FLT_REGISTRATION_VERSION FLT_REGISTRATION_VERSION_0202 // Current version is 2.02 -#else - #define FLT_REGISTRATION_VERSION FLT_REGISTRATION_VERSION_0200 // Current version is 2.00 -#endif - -// -// Defines current registration flags -// - -typedef ULONG FLT_REGISTRATION_FLAGS; - - // - // If set, this filter does not support a service stop request. This is - // is how the OS unloads drivers. - // - - #define FLTFL_REGISTRATION_DO_NOT_SUPPORT_SERVICE_STOP 0x00000001 - -// -// Registration structure -// - -typedef struct _FLT_REGISTRATION { - - // - // The size, in bytes, of this registration structure. - // - - USHORT Size; - USHORT Version; - - // - // Flag values - // - - FLT_REGISTRATION_FLAGS Flags; - - // - // Variable length array of routines that are used to manage contexts in - // the system. - // - - CONST FLT_CONTEXT_REGISTRATION *ContextRegistration; - - // - // Variable length array of routines used for processing pre- and post- - // file system operations. - // - - CONST FLT_OPERATION_REGISTRATION *OperationRegistration; - - // - // This is called before a filter is unloaded. If an ERROR or WARNING - // status is returned then the filter is NOT unloaded. A mandatory unload - // can not be failed. - // - // If a NULL is specified for this routine, then the filter can never be - // unloaded. - // - - PFLT_FILTER_UNLOAD_CALLBACK FilterUnloadCallback; - - // - // This is called to see if a filter would like to attach an instance - // to the given volume. If an ERROR or WARNING status is returned, an - // attachment is not made. - // - // If a NULL is specified for this routine, the attachment is always made. - // - - PFLT_INSTANCE_SETUP_CALLBACK InstanceSetupCallback; - - // - // This is called to see if the filter wants to detach from the given - // volume. This is only called for manual detach requests. If an - // ERROR or WARNING status is returned, the filter is not detached. - // - // If a NULL is specified for this routine, then instances can never be - // manually detached. - // - - PFLT_INSTANCE_QUERY_TEARDOWN_CALLBACK InstanceQueryTeardownCallback; - - // - // This is called at the start of a filter detaching from a volume. - // - // It is OK for this field to be NULL. - // - - PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownStartCallback; - - // - // This is called at the end of a filter detaching from a volume. All - // outstanding operations have been completed by the time this routine - // is called. - // - // It is OK for this field to be NULL. - // - - PFLT_INSTANCE_TEARDOWN_CALLBACK InstanceTeardownCompleteCallback; - - // - // The following callbacks are provided by a filter only if it is - // interested in modifying the name space. - // - // If NULL is specified for these callbacks, it is assumed that the - // filter would not affect the name being requested. - // - - PFLT_GENERATE_FILE_NAME GenerateFileNameCallback; - - PFLT_NORMALIZE_NAME_COMPONENT NormalizeNameComponentCallback; - - PFLT_NORMALIZE_CONTEXT_CLEANUP NormalizeContextCleanupCallback; - - // - // The PFLT_NORMALIZE_NAME_COMPONENT_EX callback is also a name - // provider callback. It is not included here along with the - // other name provider callbacks to take care of the registration - // structure versioning issues. - // - -#if FLT_MGR_LONGHORN - - // - // This is called for transaction notifications received from the KTM - // when a filter has enlisted on that transaction. - // - - PFLT_TRANSACTION_NOTIFICATION_CALLBACK TransactionNotificationCallback; - - // - // This is the extended normalize name component callback - // If a mini-filter provides this callback, then this callback - // will be used as opposed to using PFLT_NORMALIZE_NAME_COMPONENT - // - // The PFLT_NORMALIZE_NAME_COMPONENT_EX provides an extra parameter - // (PFILE_OBJECT) in addition to the parameters provided to - // PFLT_NORMALIZE_NAME_COMPONENT. A mini-filter may use this parameter - // to get to additional information like the TXN_PARAMETER_BLOCK. - // - // A mini-filter that has no use for the additional parameter may - // only provide a PFLT_NORMALIZE_NAME_COMPONENT callback. - // - // A mini-filter may provide both a PFLT_NORMALIZE_NAME_COMPONENT - // callback and a PFLT_NORMALIZE_NAME_COMPONENT_EX callback. The - // PFLT_NORMALIZE_NAME_COMPONENT_EX callback will be used by fltmgr - // versions that understand this callback (Vista RTM and beyond) - // and PFLT_NORMALIZE_NAME_COMPONENT callback will be used by fltmgr - // versions that do not understand the PFLT_NORMALIZE_NAME_COMPONENT_EX - // callback (prior to Vista RTM). This allows the same mini-filter - // binary to run with all versions of fltmgr. - // - - PFLT_NORMALIZE_NAME_COMPONENT_EX NormalizeNameComponentExCallback; - -#endif // FLT_MGR_LONGHORN - -} FLT_REGISTRATION, *PFLT_REGISTRATION; - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Callback routine for async i/o operations -// -/////////////////////////////////////////////////////////////////////////////// - -typedef VOID -(FLTAPI *PFLT_COMPLETED_ASYNC_IO_CALLBACK)( - __in PFLT_CALLBACK_DATA CallbackData, - __in PFLT_CONTEXT Context - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Flags that can be specified in Flt* APIs to indicate the nature of the -// i/o operation -// -// FltReadFile/FltWriteFile will accept these flags for example -// -/////////////////////////////////////////////////////////////////////////////// - -typedef ULONG FLT_IO_OPERATION_FLAGS; - - // - // If set, the given read/write request will be non-cached. - // - - #define FLTFL_IO_OPERATION_NON_CACHED 0x00000001 - - // - // If set, the given read/write request will have the - // IRP_PAGING_IO flag set - // - - #define FLTFL_IO_OPERATION_PAGING 0x00000002 - - // - // If set, the given read/write request will not update the - // file object's current byte offset. - // - - #define FLTFL_IO_OPERATION_DO_NOT_UPDATE_BYTE_OFFSET 0x00000004 - -#if FLT_MGR_LONGHORN - // - // If set, the given read/write request will have the - // IRP_SYNCHRONOUS_PAGING_IO flag set - // - - #define FLTFL_IO_OPERATION_SYNCHRONOUS_PAGING 0x00000008 - -#endif // FLT_MGR_LONGHORN - - -/////////////////////////////////////////////////////////////////////////////// -// -// These routines are used to register/unregister all callback routines for a -// give file system mini-filter driver. -// -/////////////////////////////////////////////////////////////////////////////// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltRegisterFilter ( - __in PDRIVER_OBJECT Driver, - __in CONST FLT_REGISTRATION *Registration, - __deref_out PFLT_FILTER *RetFilter - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltUnregisterFilter ( - __in PFLT_FILTER Filter - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltStartFiltering ( - __in PFLT_FILTER Filter - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -PVOID -FLTAPI -FltGetRoutineAddress ( - __in PCSTR FltMgrRoutineName - ); - -/////////////////////////////////////////////////////////////////////////////// -// -// Pending support routines -// -/////////////////////////////////////////////////////////////////////////////// - - -__drv_when(CallbackStatus==FLT_PREOP_COMPLETE, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(CallbackStatus!=FLT_PREOP_COMPLETE, __drv_maxIRQL(APC_LEVEL)) -VOID -FLTAPI -FltCompletePendedPreOperation ( - __in PFLT_CALLBACK_DATA CallbackData, - __in FLT_PREOP_CALLBACK_STATUS CallbackStatus, - __in_opt PVOID Context - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltCompletePendedPostOperation ( - __in PFLT_CALLBACK_DATA CallbackData - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for requesting operation status. This is used to get the result -// returned by IoCallDriver for operations where STATUS_PENDING is treated -// as a success code. This occurs with oplocks and directory change -// notifications -// -/////////////////////////////////////////////////////////////////////////////// - -typedef VOID -(FLTAPI *PFLT_GET_OPERATION_STATUS_CALLBACK)( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in PFLT_IO_PARAMETER_BLOCK IopbSnapshot, - __in NTSTATUS OperationStatus, - __in_opt PVOID RequesterContext - ); - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltRequestOperationStatusCallback( - __in PFLT_CALLBACK_DATA Data, - __in PFLT_GET_OPERATION_STATUS_CALLBACK CallbackRoutine, - __in_opt PVOID RequesterContext - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Memory support routines -// -/////////////////////////////////////////////////////////////////////////////// - - -__drv_when((PoolType==NonPagedPool), __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when((PoolType!=NonPagedPool), __drv_maxIRQL(APC_LEVEL)) -PVOID -FLTAPI -FltAllocatePoolAlignedWithTag ( - __in PFLT_INSTANCE Instance, - __in POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltFreePoolAlignedWithTag ( - __in PFLT_INSTANCE Instance, - __in PVOID Buffer, - __in ULONG Tag - ); - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for getting file, directory and volume names. -// -/////////////////////////////////////////////////////////////////////////////// - -// -// The FLT_FILE_NAME_OPTIONS is a ULONG that gets broken down into three -// sections: -// bits 0-7: enumeration representing the file name formats available -// bits 8-15: enumeration representing the querying methods available -// bits 16-23: Currently unused -// bits 24-31: Flags -// - -typedef ULONG FLT_FILE_NAME_OPTIONS; - -// -// Name format options -// - -#define FLT_VALID_FILE_NAME_FORMATS 0x000000ff - - #define FLT_FILE_NAME_NORMALIZED 0x01 - #define FLT_FILE_NAME_OPENED 0x02 - #define FLT_FILE_NAME_SHORT 0x03 - -#define FltGetFileNameFormat( _NameOptions ) \ - ((_NameOptions) & FLT_VALID_FILE_NAME_FORMATS) - -// -// Name query methods. -// - -#define FLT_VALID_FILE_NAME_QUERY_METHODS 0x0000ff00 - - // - // In the default mode, if it is safe to query the file system, - // the Filter Manager try to retrieve the name from the cache first, and, - // if a name is not found, the name will be generated by querying the file - // system. - // - #define FLT_FILE_NAME_QUERY_DEFAULT 0x0100 - - // - // Query the Filter Manager's name cache for the name, but don't try - // to query the file system if the name is not in the cache. - // - #define FLT_FILE_NAME_QUERY_CACHE_ONLY 0x0200 - - // - // Only query the file system for the name, bypassing the Filter Manager's - // name cache completely. Any name retrieved will not be cached. - // - #define FLT_FILE_NAME_QUERY_FILESYSTEM_ONLY 0x0300 - - // - // Query the Filter Manager's name cache, but if the name is not - // found try to query the file system if it is safe to do so. - // - #define FLT_FILE_NAME_QUERY_ALWAYS_ALLOW_CACHE_LOOKUP 0x0400 - -#define FltGetFileNameQueryMethod( _NameOptions ) \ - ((_NameOptions) & FLT_VALID_FILE_NAME_QUERY_METHODS) - -// -// File name option flags -// - -#define FLT_VALID_FILE_NAME_FLAGS 0xff000000 - - // - // This flag is to be used by name provider filters to specify that a name - // query request they are making should be redirected to their filter rather - // than being satified by the name providers lower in the stack. - // - #define FLT_FILE_NAME_REQUEST_FROM_CURRENT_PROVIDER 0x01000000 - - // - // This flag denotes that the name retrieved from this query should not - // be cached. This is used by name providers as they perform intermediate - // queries to generate a name. - // - #define FLT_FILE_NAME_DO_NOT_CACHE 0x02000000 - -#if FLT_MGR_AFTER_XPSP2 - - // - // This flag denotes that it is safe to query the name in post-CREATE if - // STATUS_REPARSE was returned. To ensure the name returned is valid, - // the call must know that the FileObject->FileName was not changed before - // STATUS_REPARSE was returned. - // - #define FLT_FILE_NAME_ALLOW_QUERY_ON_REPARSE 0x04000000 - -#endif - -// -// The flags are used to tell the file name routines which types of names -// you would like parsed from the full name. They are also used to specify -// which names have been filled in for a given FLT_FILE_NAME_INFORMATION -// structure. -// - -typedef USHORT FLT_FILE_NAME_PARSED_FLAGS; - - #define FLTFL_FILE_NAME_PARSED_FINAL_COMPONENT 0x0001 - #define FLTFL_FILE_NAME_PARSED_EXTENSION 0x0002 - #define FLTFL_FILE_NAME_PARSED_STREAM 0x0004 - #define FLTFL_FILE_NAME_PARSED_PARENT_DIR 0x0008 - -// -// This structure holds the different types of name information that -// can be given for a file. The NamesParsed field will have the -// appropriate flags set to denote which names are filled in inside -// the structure. -// - -typedef struct _FLT_FILE_NAME_INFORMATION { - - USHORT Size; - - // - // For each bit that is set in the NamesParsed flags field, the - // corresponding substring from Name has been appropriately - // parsed into one of the unicode strings below. - // - - FLT_FILE_NAME_PARSED_FLAGS NamesParsed; - - // - // The name format that this FLT_FILE_NAME_INFORMATION structure - // represents. - // - - FLT_FILE_NAME_OPTIONS Format; - - // - // For normalized and opened names, this name contains the version of - // name in the following format: - // - // [Volume name][Full path to file][File name][Stream Name] - // - // For example, the above components would map to this example name as - // follows: - // - // \Device\HarddiskVolume1\Documents and Settings\MyUser\My Documents\Test Results.txt:stream1 - // - // [Volume name] = "\Device\HarddiskVolume1" - // [Full path to file] = "\Documents and Settings\MyUser\My Documents\" - // [File name] = "Test Results.txt" - // [Stream name] = ":stream1" - // - // For short names, only the short name for the final name component is - // returned in the Name unicode string. Therefore, if you requested - // the short name of the file object representing an open on the file: - // - // \Device\HarddiskVolume1\Documents and Settings\MyUser\My Documents\Test Results.txt - // - // The name returned in Name will be at most 8 characters followed by a '.' - // then at most 3 more characters, like: - // - // testre~1.txt - // - - UNICODE_STRING Name; - - // - // The Volume is only filled in for name requested in normalized and opened - // formats. - // - - UNICODE_STRING Volume; - - // - // The share component of the file name requested. This will only be - // set for normalized and opened name formats on files that opened across - // redirectors. For local files, this string will always be 0 length. - // - - UNICODE_STRING Share; - - // - // To exemplify what each of the following substrings refer to, let's - // look again at the first example string from above: - // - // \Device\HarddiskVolume1\Documents and Settings\MyUser\My Documents\Test Results.txt:stream1 - // - // Extension = "txt" - // Stream = ":stream1" - // FinalComponent = "Test Results.txt:stream1" - // ParentDir = "\Documents and Settings\MyUser\My Documents\" - // - - // - // This can be parsed from a normalized, opened, or short name. - // - - UNICODE_STRING Extension; - - // - // The following parse formats are only available for normalized and - // opened name formats, but not short names. - // - - UNICODE_STRING Stream; - UNICODE_STRING FinalComponent; - UNICODE_STRING ParentDir; - -} FLT_FILE_NAME_INFORMATION, *PFLT_FILE_NAME_INFORMATION; - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFileNameInformation ( - __in PFLT_CALLBACK_DATA CallbackData, - __in FLT_FILE_NAME_OPTIONS NameOptions, - __deref_out PFLT_FILE_NAME_INFORMATION *FileNameInformation - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFileNameInformationUnsafe ( - __in PFILE_OBJECT FileObject, - __in_opt PFLT_INSTANCE Instance, - __in FLT_FILE_NAME_OPTIONS NameOptions, - __deref_out PFLT_FILE_NAME_INFORMATION *FileNameInformation - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltReleaseFileNameInformation ( - __in PFLT_FILE_NAME_INFORMATION FileNameInformation - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltReferenceFileNameInformation ( - __in PFLT_FILE_NAME_INFORMATION FileNameInformation - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltParseFileName ( - __in PCUNICODE_STRING FileName, - __inout_opt PUNICODE_STRING Extension, - __inout_opt PUNICODE_STRING Stream, - __inout_opt PUNICODE_STRING FinalComponent - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltParseFileNameInformation ( - __inout PFLT_FILE_NAME_INFORMATION FileNameInformation - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetTunneledName ( - __in PFLT_CALLBACK_DATA CallbackData, - __in PFLT_FILE_NAME_INFORMATION FileNameInformation, - __deref_out_opt PFLT_FILE_NAME_INFORMATION *RetTunneledFileNameInformation - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeName ( - __in PFLT_VOLUME Volume, - __inout_opt PUNICODE_STRING VolumeName, - __out_opt PULONG BufferSizeNeeded - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetDestinationFileNameInformation ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in_opt HANDLE RootDirectory, - __in_bcount(FileNameLength) PWSTR FileName, - __in ULONG FileNameLength, - __in FLT_FILE_NAME_OPTIONS NameOptions, - __deref_out PFLT_FILE_NAME_INFORMATION *RetFileNameInformation - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltIsDirectory ( - __in PFILE_OBJECT FileObject, - __in PFLT_INSTANCE Instance, - __out PBOOLEAN IsDirectory - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for loading and unloading Filters -// -/////////////////////////////////////////////////////////////////////////////// - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltLoadFilter ( - __in PCUNICODE_STRING FilterName - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltUnloadFilter ( - __in PCUNICODE_STRING FilterName - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAttachVolume ( - __inout PFLT_FILTER Filter, - __inout PFLT_VOLUME Volume, - __in_opt PCUNICODE_STRING InstanceName, - __deref_opt_out_opt PFLT_INSTANCE *RetInstance - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAttachVolumeAtAltitude ( - __inout PFLT_FILTER Filter, - __inout PFLT_VOLUME Volume, - __in PCUNICODE_STRING Altitude, - __in_opt PCUNICODE_STRING InstanceName, - __deref_opt_out_opt PFLT_INSTANCE *RetInstance - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDetachVolume ( - __inout PFLT_FILTER Filter, - __inout PFLT_VOLUME Volume, - __in_opt PCUNICODE_STRING InstanceName - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for initiating I/O from within a filter. -// -/////////////////////////////////////////////////////////////////////////////// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateCallbackData ( - __in PFLT_INSTANCE Instance, - __in_opt PFILE_OBJECT FileObject, - __deref_out PFLT_CALLBACK_DATA *RetNewCallbackData - ); - -#if FLT_MGR_WIN7 - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateCallbackDataEx ( - __in PFLT_INSTANCE Instance, - __in_opt PFILE_OBJECT FileObject, - __in FLT_ALLOCATE_CALLBACK_DATA_FLAGS Flags, - __deref_out PFLT_CALLBACK_DATA *RetNewCallbackData - ); - -#endif //FLT_MGR_WIN7 - - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltFreeCallbackData( - __in PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltReuseCallbackData ( - __inout PFLT_CALLBACK_DATA CallbackData - ); - -__drv_when(FlagOn(CallbackData->Iopb.IrpFlags, IRP_PAGING_IO), __drv_maxIRQL(APC_LEVEL)) -__drv_when(!FlagOn(CallbackData->Iopb.IrpFlags, IRP_PAGING_IO), __drv_maxIRQL(PASSIVE_LEVEL)) -VOID -FLTAPI -FltPerformSynchronousIo ( - __inout PFLT_CALLBACK_DATA CallbackData - ); - - -__checkReturn -__drv_when( FlagOn(CallbackData->Iopb.IrpFlags, IRP_PAGING_IO), __drv_maxIRQL(APC_LEVEL)) -__drv_when( !FlagOn(CallbackData->Iopb.IrpFlags, IRP_PAGING_IO), __drv_maxIRQL(PASSIVE_LEVEL)) -NTSTATUS -FLTAPI -FltPerformAsynchronousIo ( - __inout PFLT_CALLBACK_DATA CallbackData, - __in PFLT_COMPLETED_ASYNC_IO_CALLBACK CallbackRoutine, - __in PVOID CallbackContext - ); - - -#if FLT_MGR_LONGHORN - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCreateFileEx2 ( - __in PFLT_FILTER Filter, - __in_opt PFLT_INSTANCE Instance, - __out PHANDLE FileHandle, - __deref_opt_out PFILE_OBJECT *FileObject, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG CreateDisposition, - __in ULONG CreateOptions, - __in_bcount_opt(EaLength) PVOID EaBuffer, - __in ULONG EaLength, - __in ULONG Flags, - __in_opt PIO_DRIVER_CREATE_CONTEXT DriverContext - ); - -#endif - -#if FLT_MGR_AFTER_XPSP2 - -// -// Old version, please use the Ex2 version of this API when possible -// - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCreateFileEx ( - __in PFLT_FILTER Filter, - __in_opt PFLT_INSTANCE Instance, - __out PHANDLE FileHandle, - __deref_opt_out PFILE_OBJECT *FileObject, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG CreateDisposition, - __in ULONG CreateOptions, - __in_bcount_opt(EaLength) PVOID EaBuffer, - __in ULONG EaLength, - __in ULONG Flags - ); - -#endif - -// -// Old version, please use the Ex2 version of this API when possible -// - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCreateFile ( - __in PFLT_FILTER Filter, - __in_opt PFLT_INSTANCE Instance, - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG CreateDisposition, - __in ULONG CreateOptions, - __in_bcount_opt(EaLength)PVOID EaBuffer, - __in ULONG EaLength, - __in ULONG Flags - ); - -#if FLT_MGR_AFTER_XPSP2 - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltOpenVolume ( - __in PFLT_INSTANCE Instance, - __out PHANDLE VolumeHandle, - __deref_opt_out PFILE_OBJECT *VolumeFileObject - ); - -#endif - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when((Flags|FLTFL_IO_OPERATION_PAGING|FLTFL_IO_OPERATION_SYNCHRONOUS_PAGING),__drv_maxIRQL(APC_LEVEL)) -NTSTATUS -FLTAPI -FltReadFile ( - __in PFLT_INSTANCE InitiatingInstance, - __in PFILE_OBJECT FileObject, - __in_opt PLARGE_INTEGER ByteOffset, - __in ULONG Length, - __out_bcount_part(Length,*BytesRead) PVOID Buffer, - __in FLT_IO_OPERATION_FLAGS Flags, - __out_opt PULONG BytesRead, - __in_opt PFLT_COMPLETED_ASYNC_IO_CALLBACK CallbackRoutine, - __in_opt PVOID CallbackContext - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltTagFile ( - __in PFLT_INSTANCE InitiatingInstance, - __in PFILE_OBJECT FileObject, - __in ULONG FileTag, - __in_opt GUID *Guid, - __in_bcount(DataBufferLength) PVOID DataBuffer, - __in USHORT DataBufferLength - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltUntagFile( - __in PFLT_INSTANCE InitiatingInstance, - __in PFILE_OBJECT FileObject, - __in ULONG FileTag, - __in_opt GUID *Guid - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when((Flags|FLTFL_IO_OPERATION_PAGING|FLTFL_IO_OPERATION_SYNCHRONOUS_PAGING),__drv_maxIRQL(APC_LEVEL)) -NTSTATUS -FLTAPI -FltWriteFile ( - __in PFLT_INSTANCE InitiatingInstance, - __in PFILE_OBJECT FileObject, - __in_opt PLARGE_INTEGER ByteOffset, - __in ULONG Length, - __in_bcount(Length) PVOID Buffer, - __in FLT_IO_OPERATION_FLAGS Flags, - __out_opt PULONG BytesWritten, - __in_opt PFLT_COMPLETED_ASYNC_IO_CALLBACK CallbackRoutine, - __in_opt PVOID CallbackContext - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQueryInformationFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __out_bcount_part(Length,*LengthReturned) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass, - __out_opt PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltSetInformationFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass - ); - -#if FLT_MGR_LONGHORN - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQueryDirectoryFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __out_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass, - __in BOOLEAN ReturnSingleEntry, - __in_opt PUNICODE_STRING FileName, - __in BOOLEAN RestartScan, - __out_opt PULONG LengthReturned - ); - -#endif - -#if FLT_MGR_AFTER_XPSP2 - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQueryEaFile( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __out_bcount_part(Length,*LengthReturned) PVOID ReturnedEaData, - __in ULONG Length, - __in BOOLEAN ReturnSingleEntry, - __in_bcount_opt(EaListLength) PVOID EaList, - __in ULONG EaListLength, - __in_opt PULONG EaIndex, - __in BOOLEAN RestartScan, - __out_opt PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltSetEaFile( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in_bcount(Length) PVOID EaBuffer, - __in ULONG Length - ); - -#endif - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQueryVolumeInformationFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __out_bcount_part(Length,*LengthReturned) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass, - __out_opt PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQuerySecurityObject ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in SECURITY_INFORMATION SecurityInformation, - __inout_bcount_opt(Length) PSECURITY_DESCRIPTOR SecurityDescriptor, - __in ULONG Length, - __out_opt PULONG LengthNeeded - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltSetSecurityObject ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in SECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltFlushBuffers ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltFsControlFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in ULONG FsControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_part_opt(OutputBufferLength,*LengthReturned) PVOID OutputBuffer, - __in ULONG OutputBufferLength, - __out_opt PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltDeviceIoControlFile ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in ULONG IoControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_part_opt(OutputBufferLength,*LengthReturned) PVOID OutputBuffer, - __in ULONG OutputBufferLength, - __out_opt PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when((Flags|FLTFL_IO_OPERATION_PAGING|FLTFL_IO_OPERATION_SYNCHRONOUS_PAGING),__drv_maxIRQL(APC_LEVEL)) -VOID -FLTAPI -FltReissueSynchronousIo ( - __in PFLT_INSTANCE InitiatingInstance, - __in PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltClose( - __in HANDLE FileHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -FLTAPI -FltCancelFileOpen ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCreateSystemVolumeInformationFolder ( - __in PFLT_INSTANCE Instance - ); - -/////////////////////////////////////////////////////////////////////////////// -// -// CONTEXT routines -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Returns TRUE if the given file object supports the given type of context. -// FALSE otherwise. -// - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltSupportsFileContextsEx ( - __in PFILE_OBJECT FileObject, - __in_opt PFLT_INSTANCE Instance - ); - -#endif - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltSupportsFileContexts ( - __in PFILE_OBJECT FileObject - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltSupportsStreamContexts ( - __in PFILE_OBJECT FileObject - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltSupportsStreamHandleContexts ( - __in PFILE_OBJECT FileObject - ); - - -// -// Called to allocate a context. All context must be allocated via -// this routine. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateContext ( - __in PFLT_FILTER Filter, - __in FLT_CONTEXT_TYPE ContextType, - __in SIZE_T ContextSize, - __in POOL_TYPE PoolType, - __deref_out_bcount(ContextSize) PFLT_CONTEXT *ReturnedContext - ); - -// -// Get and release multiple contexts -// - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltGetContexts ( - __in PCFLT_RELATED_OBJECTS FltObjects, - __in FLT_CONTEXT_TYPE DesiredContexts, - __out PFLT_RELATED_CONTEXTS Contexts - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltReleaseContexts ( - __in PFLT_RELATED_CONTEXTS Contexts - ); - - -// -// State values for the SetContext routines -// - -typedef enum _FLT_SET_CONTEXT_OPERATION { - - // - // If a context already exists, replace with the given context. - // Return the old context. - // - - FLT_SET_CONTEXT_REPLACE_IF_EXISTS, - - // - // If a context already exists, keep the old context and return an - // error status. Return the old context (yes, we really do want to - // return the old context, the caller already has the new context). - // The context returned must later be released. - // - - FLT_SET_CONTEXT_KEEP_IF_EXISTS - -} FLT_SET_CONTEXT_OPERATION, *PFLT_SET_CONTEXT_OPERATION; - -// -// Routines for setting a context on a given object. Once a context has -// been set, it can not be freed except in the free context callback -// routine. -// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetVolumeContext ( - __in PFLT_VOLUME Volume, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetInstanceContext ( - __in PFLT_INSTANCE Instance, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetFileContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetStreamContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetStreamHandleContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetTransactionContext ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in FLT_SET_CONTEXT_OPERATION Operation, - __in PFLT_CONTEXT NewContext, - __deref_opt_out PFLT_CONTEXT *OldContext - ); - -#endif // FLT_MGR_LONGHORN - -// -// Routines for deleting a context on a given object. -// - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltDeleteContext ( - __in PFLT_CONTEXT Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteVolumeContext ( - __in PFLT_FILTER Filter, - __in PFLT_VOLUME Volume, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteInstanceContext ( - __in PFLT_INSTANCE Instance, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteFileContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteStreamContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteStreamHandleContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_opt_out_opt PFLT_CONTEXT *OldContext - ); - - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltDeleteTransactionContext ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __deref_opt_out PFLT_CONTEXT *OldContext - ); - -#endif // FLT_MGR_LONGHORN - -// -// Routines for getting/releasing contexts. Any time a filter gets a context, -// a corresponding release must be called. -// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeContext ( - __in PFLT_FILTER Filter, - __in PFLT_VOLUME Volume, - __deref_out PFLT_CONTEXT *Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetInstanceContext ( - __in PFLT_INSTANCE Instance, - __deref_out PFLT_CONTEXT *Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFileContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_out PFLT_CONTEXT *Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetStreamContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_out PFLT_CONTEXT *Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetStreamHandleContext ( - __in PFLT_INSTANCE Instance, - __in PFILE_OBJECT FileObject, - __deref_out PFLT_CONTEXT *Context - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetTransactionContext ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __deref_out PFLT_CONTEXT *Context - ); - -#endif // FLT_MGR_LONGHORN - -// -// This adds a reference to the given context structure. The added reference -// must be explicitly removed by a call to FltReleaseContext. -// - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltReferenceContext ( - __in PFLT_CONTEXT Context - ); - -// -// Routine to release contexts -// - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltReleaseContext ( - __in PFLT_CONTEXT Context - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for getting handles to Filters, Instances, -// and Volumes. -// -/////////////////////////////////////////////////////////////////////////////// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFilterFromName ( - __in PCUNICODE_STRING FilterName, - __deref_out PFLT_FILTER *RetFilter - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeFromName ( - __in PFLT_FILTER Filter, - __in PCUNICODE_STRING VolumeName, - __deref_out PFLT_VOLUME *RetVolume - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeInstanceFromName ( - __in_opt PFLT_FILTER Filter, - __in PFLT_VOLUME Volume, - __in_opt PCUNICODE_STRING InstanceName, - __deref_out PFLT_INSTANCE *RetInstance - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeFromInstance ( - __in PFLT_INSTANCE Instance, - __deref_out PFLT_VOLUME *RetVolume - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFilterFromInstance ( - __in PFLT_INSTANCE Instance, - __deref_out PFLT_FILTER *RetFilter - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeFromFileObject ( - __in PFLT_FILTER Filter, - __in PFILE_OBJECT FileObject, - __deref_out PFLT_VOLUME *RetVolume - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeFromDeviceObject ( - __in PFLT_FILTER Filter, - __in PDEVICE_OBJECT DeviceObject, - __deref_out PFLT_VOLUME *RetVolume - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltIsFltMgrVolumeDeviceObject( - __in PDEVICE_OBJECT DeviceObject - ); - -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltGetDeviceObject ( - __in PFLT_VOLUME Volume, - __deref_out PDEVICE_OBJECT *DeviceObject - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltGetDiskDeviceObject( - __in PFLT_VOLUME Volume, - __deref_out PDEVICE_OBJECT *DiskDeviceObject - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetLowerInstance ( - __in PFLT_INSTANCE CurrentInstance, - __deref_out PFLT_INSTANCE *LowerInstance - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetUpperInstance ( - __in PFLT_INSTANCE CurrentInstance, - __deref_out PFLT_INSTANCE *UpperInstance - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetTopInstance ( - __in PFLT_VOLUME Volume, - __deref_out PFLT_INSTANCE *Instance - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetBottomInstance ( - __in PFLT_VOLUME Volume, - __deref_out PFLT_INSTANCE *Instance - ); - -LONG -FLTAPI -FltCompareInstanceAltitudes ( - __in PFLT_INSTANCE Instance1, - __in PFLT_INSTANCE Instance2 - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for getting information on Filters and Filter Instances. -// -/////////////////////////////////////////////////////////////////////////////// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFilterInformation ( - __in PFLT_FILTER Filter, - __in FILTER_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize, *BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetInstanceInformation ( - __in PFLT_INSTANCE Instance, - __in INSTANCE_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeInformation ( - __in PFLT_VOLUME Volume, - __in FILTER_VOLUME_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -#endif // FLT_MGR_LONGHORN - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for getting information about Volumes. -// -/////////////////////////////////////////////////////////////////////////////// - -typedef struct _FLT_VOLUME_PROPERTIES { - - // - // The possible DeviceTypes are defined in NTIFS.H and begin with - // FILE_DEVICE_ - // - - DEVICE_TYPE DeviceType; - - // - // The possible DeviceCharacteristics flags are defined in NTIFS.H. - // Potential values are: - // FILE_REMOVABLE_MEDIA - // FILE_READ_ONLY_DEVICE - // FILE_FLOPPY_DISKETTE - // FILE_WRITE_ONCE_MEDIA - // FILE_REMOTE_DEVICE - // FILE_DEVICE_IS_MOUNTED - // FILE_VIRTUAL_VOLUME - // FILE_AUTOGENERATED_DEVICE_NAME - // FILE_DEVICE_SECURE_OPEN - // - - ULONG DeviceCharacteristics; - - // - // The possible DeviceObjectFlags are define in NTIFS.H. All potential - // values begin with DO_. - // - - ULONG DeviceObjectFlags; - - ULONG AlignmentRequirement; - - USHORT SectorSize; - - USHORT Reserved0; - - // - // The name of the file system driver associated with this device. - // - // The buffer for this unicode string is contiguous with this structure and - // does not need to be initialized before calling FltGetVolumeProperties. - // - - UNICODE_STRING FileSystemDriverName; - - // - // The name of the file system device associated with this device. - // - // The buffer for this unicode string is contiguous with this structure and - // does not need to be initialized before calling FltGetVolumeProperties. - // - - UNICODE_STRING FileSystemDeviceName; - - // - // The name of the real device object associated with this device. This - // is empty for network file systems. - // - // The buffer for this unicode string is contiguous with this structure and - // does not need to be initialized before calling FltGetVolumeProperties. - // - - UNICODE_STRING RealDeviceName; - -} FLT_VOLUME_PROPERTIES, *PFLT_VOLUME_PROPERTIES; - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeProperties ( - __in PFLT_VOLUME Volume, - __out_bcount_part_opt(VolumePropertiesLength,*LengthReturned) PFLT_VOLUME_PROPERTIES VolumeProperties, - __in ULONG VolumePropertiesLength, - __out PULONG LengthReturned - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltIsVolumeWritable ( - __in PVOID FltObject, - __out PBOOLEAN IsWritable - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetFileSystemType ( - __in PVOID FltObject, - __out PFLT_FILESYSTEM_TYPE FileSystemType - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltIsVolumeSnapshot ( - __in PVOID FltObject, - __out PBOOLEAN IsSnapshotVolume - ); - -#endif // FLT_MGR_LONGHORN - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltGetVolumeGuidName ( - __in PFLT_VOLUME Volume, - __out PUNICODE_STRING VolumeGuidName, - __out_opt PULONG BufferSizeNeeded - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltQueryVolumeInformation( - __in PFLT_INSTANCE Instance, - __out PIO_STATUS_BLOCK Iosb, - __out_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltSetVolumeInformation( - __in PFLT_INSTANCE Instance, - __out PIO_STATUS_BLOCK Iosb, - __out_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for enumerating Filter information, Instance informations and -// Filter Instances in the system. -// -/////////////////////////////////////////////////////////////////////////////// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateFilters ( - __out_ecount_part_opt(FilterListSize,*NumberFiltersReturned) PFLT_FILTER *FilterList, - __in ULONG FilterListSize, - __out PULONG NumberFiltersReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateVolumes ( - __in PFLT_FILTER Filter, - __out_ecount_part_opt(VolumeListSize,*NumberVolumesReturned) PFLT_VOLUME *VolumeList, - __in ULONG VolumeListSize, - __out PULONG NumberVolumesReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateInstances ( - __in_opt PFLT_VOLUME Volume, - __in_opt PFLT_FILTER Filter, - __out_ecount_part_opt(InstanceListSize,*NumberInstancesReturned) PFLT_INSTANCE *InstanceList, - __in ULONG InstanceListSize, - __out PULONG NumberInstancesReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateFilterInformation ( - __in ULONG Index, - __in FILTER_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateInstanceInformationByFilter ( - __in PFLT_FILTER Filter, - __in ULONG Index, - __in INSTANCE_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateInstanceInformationByVolume ( - __in PFLT_VOLUME Volume, - __in ULONG Index, - __in INSTANCE_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnumerateVolumeInformation ( - __in PFLT_FILTER Filter, - __in ULONG Index, - __in FILTER_VOLUME_INFORMATION_CLASS InformationClass, - __out_bcount_part_opt(BufferSize,*BytesReturned) PVOID Buffer, - __in ULONG BufferSize, - __out PULONG BytesReturned - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for referencing and closing FLT_VOLUMEs, FLT_INSTANCEs, and -// FLT_FILTERs. -// -/////////////////////////////////////////////////////////////////////////////// - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltObjectReference ( - __inout PVOID FltObject - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltObjectDereference ( - __inout PVOID FltObject - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines & defs for sending messages from a filter to a user-mode component. -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Access masks for filter communication ports -// - -#define FLT_PORT_CONNECT 0x0001 -#define FLT_PORT_ALL_ACCESS (FLT_PORT_CONNECT | STANDARD_RIGHTS_ALL) - -// -// Callback to notify a filter it has received a message from a user App -// - -typedef NTSTATUS -(FLTAPI *PFLT_MESSAGE_NOTIFY) ( - __in_opt PVOID PortCookie, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_part_opt(OutputBufferLength,*ReturnOutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength, - __out PULONG ReturnOutputBufferLength - ); - -// -// Callback to notify a filter when a new connection to a port is established -// - -typedef NTSTATUS -(FLTAPI *PFLT_CONNECT_NOTIFY) ( - __in PFLT_PORT ClientPort, - __in_opt PVOID ServerPortCookie, - __in_bcount_opt(SizeOfContext) PVOID ConnectionContext, - __in ULONG SizeOfContext, - __deref_out_opt PVOID *ConnectionPortCookie - ); - -// -// Callback to notify a filter when a connection to a port is being torn down -// - -typedef VOID -(FLTAPI *PFLT_DISCONNECT_NOTIFY) ( - __in_opt PVOID ConnectionCookie - ); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCreateCommunicationPort ( - __in PFLT_FILTER Filter, - __deref_out PFLT_PORT *ServerPort, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PVOID ServerPortCookie, - __in PFLT_CONNECT_NOTIFY ConnectNotifyCallback, - __in PFLT_DISCONNECT_NOTIFY DisconnectNotifyCallback, - __in_opt PFLT_MESSAGE_NOTIFY MessageNotifyCallback, - __in LONG MaxConnections - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -FLTAPI -FltCloseCommunicationPort ( - __in PFLT_PORT ServerPort - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -FLTAPI -FltCloseClientPort ( - __in PFLT_FILTER Filter, - __deref_out PFLT_PORT *ClientPort - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSendMessage ( - __in PFLT_FILTER Filter, - __deref_in PFLT_PORT *ClientPort, - __in_bcount(SenderBufferLength) PVOID SenderBuffer, - __in ULONG SenderBufferLength, - __out_bcount_opt(*ReplyLength) PVOID ReplyBuffer, - __inout_opt PULONG ReplyLength, - __in_opt PLARGE_INTEGER Timeout - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltBuildDefaultSecurityDescriptor( - __deref_out PSECURITY_DESCRIPTOR *SecurityDescriptor, - __in ACCESS_MASK DesiredAccess - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltFreeSecurityDescriptor( - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -/////////////////////////////////////////////////////////////////////////////// -// -// Plain cancel support. Note that using callback data queues and -// setting the cancel routine manually is not supported -// -/////////////////////////////////////////////////////////////////////////////// - -typedef VOID -(FLTAPI *PFLT_COMPLETE_CANCELED_CALLBACK) ( - __in PFLT_CALLBACK_DATA CallbackData -); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -BOOLEAN -FLTAPI -FltCancelIo( - __in PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltSetCancelCompletion ( - __in PFLT_CALLBACK_DATA CallbackData, - __in PFLT_COMPLETE_CANCELED_CALLBACK CanceledCallback - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltClearCancelCompletion( - __in PFLT_CALLBACK_DATA CallbackData - ); - -BOOLEAN -FLTAPI -FltIsIoCanceled( - __in PFLT_CALLBACK_DATA CallbackData - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Workqueue wrappers -// -/////////////////////////////////////////////////////////////////////////////// - -typedef struct _FLT_DEFERRED_IO_WORKITEM *PFLT_DEFERRED_IO_WORKITEM; -typedef struct _FLT_GENERIC_WORKITEM *PFLT_GENERIC_WORKITEM; - -typedef VOID -(FLTAPI *PFLT_DEFERRED_IO_WORKITEM_ROUTINE) ( - __in PFLT_DEFERRED_IO_WORKITEM FltWorkItem, - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context - ); - -typedef VOID -(FLTAPI *PFLT_GENERIC_WORKITEM_ROUTINE) ( - __in PFLT_GENERIC_WORKITEM FltWorkItem, - __in PVOID FltObject, - __in_opt PVOID Context - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -PFLT_DEFERRED_IO_WORKITEM -FLTAPI -FltAllocateDeferredIoWorkItem( - VOID - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltFreeDeferredIoWorkItem ( - __in PFLT_DEFERRED_IO_WORKITEM FltWorkItem - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -PFLT_GENERIC_WORKITEM -FLTAPI -FltAllocateGenericWorkItem( - VOID - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltFreeGenericWorkItem ( - __in PFLT_GENERIC_WORKITEM FltWorkItem - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltQueueDeferredIoWorkItem ( - __in PFLT_DEFERRED_IO_WORKITEM FltWorkItem, - __in PFLT_CALLBACK_DATA Data, - __in PFLT_DEFERRED_IO_WORKITEM_ROUTINE WorkerRoutine, - __in WORK_QUEUE_TYPE QueueType, - __in PVOID Context - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltQueueGenericWorkItem ( - __in PFLT_GENERIC_WORKITEM FltWorkItem, - __in PVOID FltObject, - __in PFLT_GENERIC_WORKITEM_ROUTINE WorkerRoutine, - __in WORK_QUEUE_TYPE QueueType, - __in_opt PVOID Context - ); - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for decoding params, locking data buffers etc. -// -/////////////////////////////////////////////////////////////////////////////// - - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltLockUserBuffer( - __in PFLT_CALLBACK_DATA CallbackData - ); - -NTSTATUS -FLTAPI -FltDecodeParameters( - __in PFLT_CALLBACK_DATA CallbackData, - __deref_opt_out PMDL **MdlAddressPointer, - __deref_opt_out_bcount(**Length) PVOID **Buffer, - __deref_opt_out PULONG *Length, - __out_opt LOCK_OPERATION *DesiredAccess - ); - -PMDL -FASTCALL -FltGetSwappedBufferMdlAddress( - __in PFLT_CALLBACK_DATA CallbackData - ); - -VOID -FASTCALL -FltRetainSwappedBufferMdlAddress( - __in PFLT_CALLBACK_DATA CallbackData - ); - -#if FLT_MGR_WIN7 - -__checkReturn -__drv_maxIRQL(DPC_LEVEL) -PVOID -FLTAPI -FltGetNewSystemBufferAddress( - __in PFLT_CALLBACK_DATA CallbackData - ); - -#endif // FLT_MGR_WIN7 - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines for accessing cancel-safe queue abstraction provided by -// filter manager -// -/////////////////////////////////////////////////////////////////////////////// - -// -// The cancel safe queue is not exposed in the w2k DDK headers, so we -// define what is neccesary here. -// - -typedef IO_CSQ_IRP_CONTEXT FLT_CALLBACK_DATA_QUEUE_IO_CONTEXT, *PFLT_CALLBACK_DATA_QUEUE_IO_CONTEXT; - -// -// Forward define callback data queue -// - -typedef struct _FLT_CALLBACK_DATA_QUEUE FLT_CALLBACK_DATA_QUEUE, *PFLT_CALLBACK_DATA_QUEUE; - -// -// Routines that insert/remove callback data's -// - -typedef NTSTATUS -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_INSERT_IO)( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in PFLT_CALLBACK_DATA Cbd, - __in_opt PVOID InsertContext - ); - -typedef VOID -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_REMOVE_IO)( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in PFLT_CALLBACK_DATA Cbd - ); - -// -// Retrieves the next callback data from the queue. NULL if none are left. -// If Cbd is NULL, returns the entry at the head of the queue. Does not remove -// Cbd from queue. -// - -typedef PFLT_CALLBACK_DATA -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_PEEK_NEXT_IO)( - __in PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in_opt PFLT_CALLBACK_DATA Cbd, - __in_opt PVOID PeekContext - ); - -// -// Lock routine that protects the cancel safe queue -// - -typedef VOID -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_ACQUIRE)( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __out PKIRQL Irql - ); - -typedef VOID -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_RELEASE)( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in KIRQL Irql - ); - -// -// Cancel routine callback for queued callback data's -// - -typedef VOID -(FLTAPI *PFLT_CALLBACK_DATA_QUEUE_COMPLETE_CANCELED_IO)( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __inout PFLT_CALLBACK_DATA Cbd - ); - - -typedef enum _FLT_CALLBACK_DATA_QUEUE_FLAGS FLT_CALLBACK_DATA_QUEUE_FLAGS; -// -// Following structure is opaque to filters, but allocated by them. -// - -typedef struct _FLT_CALLBACK_DATA_QUEUE { - - // - // Embedded IRP cancel queue: this is opaque to minifilters - // - - IO_CSQ Csq; - - // - // Flags .. These are private to filter manager - // - - FLT_CALLBACK_DATA_QUEUE_FLAGS Flags; - - // - // Instance that is using this queue - // - - PFLT_INSTANCE Instance; - - // - // Cancel-safe queue callbacks - // - - PFLT_CALLBACK_DATA_QUEUE_INSERT_IO InsertIo; - PFLT_CALLBACK_DATA_QUEUE_REMOVE_IO RemoveIo; - PFLT_CALLBACK_DATA_QUEUE_PEEK_NEXT_IO PeekNextIo; - PFLT_CALLBACK_DATA_QUEUE_ACQUIRE Acquire; - PFLT_CALLBACK_DATA_QUEUE_RELEASE Release; - PFLT_CALLBACK_DATA_QUEUE_COMPLETE_CANCELED_IO CompleteCanceledIo; - - -} FLT_CALLBACK_DATA_QUEUE, *PFLT_CALLBACK_DATA_QUEUE; - - -NTSTATUS -FLTAPI -FltCbdqInitialize( - __in PFLT_INSTANCE Instance, - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in PFLT_CALLBACK_DATA_QUEUE_INSERT_IO CbdqInsertIo, - __in PFLT_CALLBACK_DATA_QUEUE_REMOVE_IO CbdqRemoveIo, - __in PFLT_CALLBACK_DATA_QUEUE_PEEK_NEXT_IO CbdqPeekNextIo, - __in PFLT_CALLBACK_DATA_QUEUE_ACQUIRE CbdqAcquire, - __in PFLT_CALLBACK_DATA_QUEUE_RELEASE CbdqRelease, - __in PFLT_CALLBACK_DATA_QUEUE_COMPLETE_CANCELED_IO CbdqCompleteCanceledIo - ); - -VOID -FLTAPI -FltCbdqEnable( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq - ); - -VOID -FLTAPI -FltCbdqDisable( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq - ); - -__checkReturn -NTSTATUS -FLTAPI -FltCbdqInsertIo( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in PFLT_CALLBACK_DATA Cbd, - __in_opt PFLT_CALLBACK_DATA_QUEUE_IO_CONTEXT Context, - __in_opt PVOID InsertContext - ); - -__checkReturn -PFLT_CALLBACK_DATA -FLTAPI -FltCbdqRemoveIo( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in PFLT_CALLBACK_DATA_QUEUE_IO_CONTEXT Context - ); - -__checkReturn -PFLT_CALLBACK_DATA -FLTAPI -FltCbdqRemoveNextIo( - __inout PFLT_CALLBACK_DATA_QUEUE Cbdq, - __in_opt PVOID PeekContext - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines and callbacks for handling oplocks provided by filter manager -// -/////////////////////////////////////////////////////////////////////////////// - -typedef -VOID -(FLTAPI *PFLTOPLOCK_WAIT_COMPLETE_ROUTINE) ( - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context - ); - -typedef -VOID -(FLTAPI *PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE) ( - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context - ); - -// -// Oplock support routines. -// - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltInitializeOplock ( - __out POPLOCK Oplock - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltUninitializeOplock ( - __in POPLOCK Oplock - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltOplockFsctrl ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in ULONG OpenCount - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltCheckOplock ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context, - __in_opt PFLTOPLOCK_WAIT_COMPLETE_ROUTINE WaitCompletionRoutine, - __in_opt PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE PrePostCallbackDataRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltOplockIsFastIoPossible ( - __in POPLOCK Oplock - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltCurrentBatchOplock ( - __in POPLOCK Oplock - ); - -#if FLT_MGR_WIN7 - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltCheckOplockEx ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt PFLTOPLOCK_WAIT_COMPLETE_ROUTINE WaitCompletionRoutine, - __in_opt PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE PrePostCallbackDataRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltCurrentOplock ( - __in POPLOCK Oplock - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltCurrentOplockH ( - __in POPLOCK Oplock - ); - -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltOplockBreakH ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt PFLTOPLOCK_WAIT_COMPLETE_ROUTINE WaitCompletionRoutine, - __in_opt PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE PrePostCallbackDataRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltOplockBreakToNone ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context, - __in_opt PFLTOPLOCK_WAIT_COMPLETE_ROUTINE WaitCompletionRoutine, - __in_opt PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE PrePostCallbackDataRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltOplockBreakToNoneEx ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt PFLTOPLOCK_WAIT_COMPLETE_ROUTINE WaitCompletionRoutine, - __in_opt PFLTOPLOCK_PREPOST_CALLBACKDATA_ROUTINE PrePostCallbackDataRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltOplockIsSharedRequest ( - __in PFLT_CALLBACK_DATA CallbackData - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltOplockFsctrlEx ( - __in POPLOCK Oplock, - __in PFLT_CALLBACK_DATA CallbackData, - __in ULONG OpenCount, - __in ULONG Flags - ); - -BOOLEAN -FLTAPI -FltOplockKeysEqual ( - __in_opt PFILE_OBJECT Fo1, - __in_opt PFILE_OBJECT Fo2 - ); - -#endif // FLT_MGR_WIN7 - -/////////////////////////////////////////////////////////////////////////////// -// -// Routines and callbacks for handling file lock support provided by filter manager -// -/////////////////////////////////////////////////////////////////////////////// - -typedef -NTSTATUS -(*PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE) ( - __in_opt PVOID Context, - __in PFLT_CALLBACK_DATA CallbackData - ); - -VOID -FLTAPI -FltInitializeFileLock ( - __out PFILE_LOCK FileLock - ); - -VOID -FLTAPI -FltUninitializeFileLock ( - __in PFILE_LOCK FileLock - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -PFILE_LOCK -FLTAPI -FltAllocateFileLock ( - __in_opt PFLT_COMPLETE_LOCK_CALLBACK_DATA_ROUTINE CompleteLockCallbackDataRoutine, - __in_opt PUNLOCK_ROUTINE UnlockRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltFreeFileLock ( - __in PFILE_LOCK FileLock - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -FLT_PREOP_CALLBACK_STATUS -FLTAPI -FltProcessFileLock ( - __in PFILE_LOCK FileLock, - __in PFLT_CALLBACK_DATA CallbackData, - __in_opt PVOID Context - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltCheckLockForReadAccess ( - __in PFILE_LOCK FileLock, - __in PFLT_CALLBACK_DATA CallbackData - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltCheckLockForWriteAccess ( - __in PFILE_LOCK FileLock, - __in PFLT_CALLBACK_DATA CallbackData - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Locking Primitives -// -/////////////////////////////////////////////////////////////////////////////// - -// -// EResource APIs which do proper wrapping of KeEnterCriticalRegion and -// KeExitCriticalRegion to disable APCs (except Special Kernel APCs) while -// the lock is held -// -// Use ExInitializeResourceLite() to init the resource -// Use ExDeleteResourceLite() to delete the resource -// - -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltAcquireResourceExclusive( - __inout __deref __drv_neverHold(ResourceLite) - __deref __drv_acquiresResource(ResourceLite) - PERESOURCE Resource - ); - -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltAcquireResourceShared( - __inout __deref __drv_neverHold(ResourceLite) - __deref __drv_acquiresResource(ResourceLite) - PERESOURCE Resource - ); - -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -FLTAPI -FltReleaseResource( - __inout __deref __drv_releasesExclusiveResource(ResourceLite) PERESOURCE Resource - ); - - -// -// PUSHLOCK APIs which do proper wrapping of KeEnterCriticalRegion and -// KeExitCriticalRegion to disable APCs (except Special Kernel APCs) while -// the lock is held -// - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltInitializePushLock( - __out PEX_PUSH_LOCK PushLock - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltDeletePushLock( - __in PEX_PUSH_LOCK PushLock - ); - -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltAcquirePushLockExclusive( - __inout __deref __drv_acquiresExclusiveResource(ExPushLockType) - PEX_PUSH_LOCK PushLock - ); - -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltAcquirePushLockShared( - __inout __deref __drv_acquiresExclusiveResource(ExPushLockType) - PEX_PUSH_LOCK PushLock - ); - -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltReleasePushLock( - __inout __deref __drv_releasesExclusiveResource(ExPushLockType) - PEX_PUSH_LOCK PushLock - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// Synchronization support routines -// -/////////////////////////////////////////////////////////////////////////////// - -#if FLT_MGR_LONGHORN - -__checkReturn -__drv_when(((CallbackData!=NULL) && FLT_IS_IRP_OPERATION(CallbackData)), __drv_maxIRQL(PASSIVE_LEVEL)) -__drv_when((!((CallbackData!=NULL) && FLT_IS_IRP_OPERATION(CallbackData))), __drv_maxIRQL(APC_LEVEL)) -NTSTATUS -FLTAPI -FltCancellableWaitForSingleObject( - __in PVOID Object, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PFLT_CALLBACK_DATA CallbackData - ); - -__checkReturn -__drv_when(((CallbackData!=NULL) && FLT_IS_IRP_OPERATION(CallbackData)), __drv_maxIRQL(PASSIVE_LEVEL)) -__drv_when((!((CallbackData!=NULL) && FLT_IS_IRP_OPERATION(CallbackData))), __drv_maxIRQL(APC_LEVEL)) -NTSTATUS -FLTAPI -FltCancellableWaitForMultipleObjects( - __in ULONG Count, - __in_ecount(Count) PVOID ObjectArray[], - __in WAIT_TYPE WaitType, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PKWAIT_BLOCK WaitBlockArray, - __in PFLT_CALLBACK_DATA CallbackData - ); - -#endif // FLT_MGR_LONGHORN - - -/////////////////////////////////////////////////////////////////////////////// -// -// General support routines -// -/////////////////////////////////////////////////////////////////////////////// - - -BOOLEAN -FLTAPI -FltIsOperationSynchronous ( - __in PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -BOOLEAN -FLTAPI -FltIs32bitProcess ( - __in_opt PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -PEPROCESS -FLTAPI -FltGetRequestorProcess ( - __in PFLT_CALLBACK_DATA CallbackData - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -ULONG -FLTAPI -FltGetRequestorProcessId ( - __in PFLT_CALLBACK_DATA CallbackData - ); - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(DISPATCH_LEVEL) -HANDLE -FLTAPI -FltGetRequestorProcessIdEx ( - __in PFLT_CALLBACK_DATA CallbackData - ); - -#endif // FLT_MGR_LONGHORN - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltNotifyFilterChangeDirectory ( - __inout PNOTIFY_SYNC NotifySync, - __inout PLIST_ENTRY NotifyList, - __in PVOID FsContext, - __in PSTRING FullDirectoryName, - __in BOOLEAN WatchTree, - __in BOOLEAN IgnoreBuffer, - __in ULONG CompletionFilter, - __in PFLT_CALLBACK_DATA NotifyCallbackData, - __in_opt PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectContext, - __in_opt PFILTER_REPORT_CHANGE FilterCallback - ); - -#if FLT_MGR_WIN7 - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetRequestorSessionId( - __in PFLT_CALLBACK_DATA CallbackData, - __out PULONG SessionId - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltAdjustDeviceStackSizeForIoRedirection( - __in PFLT_INSTANCE SourceInstance, - __in PFLT_INSTANCE TargetInstance, - __out_opt PBOOLEAN SourceDeviceStackSizeModified - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltIsIoRedirectionAllowed( - __in PFLT_INSTANCE SourceInstance, - __in PFLT_INSTANCE TargetInstance, - __out PBOOLEAN RedirectionAllowed - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltIsIoRedirectionAllowedForOperation( - __in PFLT_CALLBACK_DATA Data, - __in PFLT_INSTANCE TargetInstance, - __out PBOOLEAN RedirectionAllowedThisIo, - __out_opt PBOOLEAN RedirectionAllowedAllIo - ); - - -#endif // FLT_MGR_WIN7 - - -/////////////////////////////////////////////////////////////////////////////// -// -// Transaction (TxF) support routines -// -/////////////////////////////////////////////////////////////////////////////// - -#if FLT_MGR_LONGHORN - -// -// Select ALL transaction notification values -// - -#define FLT_MAX_TRANSACTION_NOTIFICATIONS \ - (TRANSACTION_NOTIFY_PREPREPARE | \ - TRANSACTION_NOTIFY_PREPARE | \ - TRANSACTION_NOTIFY_COMMIT | \ - TRANSACTION_NOTIFY_ROLLBACK | \ - TRANSACTION_NOTIFY_COMMIT_FINALIZE) - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltEnlistInTransaction ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in PFLT_CONTEXT TransactionContext, - __in NOTIFICATION_MASK NotificationMask - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltRollbackEnlistment ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltPrePrepareComplete ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltPrepareComplete ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltCommitComplete ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltCommitFinalizeComplete ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FLTAPI -FltRollbackComplete ( - __in PFLT_INSTANCE Instance, - __in PKTRANSACTION Transaction, - __in_opt PFLT_CONTEXT TransactionContext - ); - -// -// Some Kernel routines related to ECP manipulation -// ZwCreateTransactionManager -// ZwCreateResourceManager -// TmEnableCallbacks -// IoGetTransactionParameterBlock -// TmCreateEnlistment -// TmPrePrepareComplete -// TmPrepareComplete -// TmCommitComplete -// TmRollbackComplete -// TmRollbackEnlistment -// - -#endif // FLT_MGR_LONGHORN - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Extra Create Parameter (ECP) support routines -// -/////////////////////////////////////////////////////////////////////////////// - -#if FLT_MGR_LONGHORN - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateExtraCreateParameterList ( - __in PFLT_FILTER Filter, - __in FSRTL_ALLOCATE_ECPLIST_FLAGS Flags, - __deref_out PECP_LIST *EcpList - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateExtraCreateParameter ( - __in PFLT_FILTER Filter, - __in LPCGUID EcpType, - __in_bound ULONG SizeOfContext, - __in FSRTL_ALLOCATE_ECP_FLAGS Flags, - __in_opt PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback, - __in ULONG PoolTag, - __deref_out PVOID *EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltInitExtraCreateParameterLookasideList ( - __in PFLT_FILTER Filter, - __inout PVOID Lookaside, - __in FSRTL_ECP_LOOKASIDE_FLAGS Flags, - __in SIZE_T Size, - __in ULONG Tag - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltDeleteExtraCreateParameterLookasideList ( - __in PFLT_FILTER Filter, - __inout PVOID Lookaside, - __in FSRTL_ECP_LOOKASIDE_FLAGS Flags - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltAllocateExtraCreateParameterFromLookasideList ( - __in PFLT_FILTER Filter, - __in LPCGUID EcpType, - __in ULONG SizeOfContext, - __in FSRTL_ALLOCATE_ECP_FLAGS Flags, - __in_opt PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback, - __inout PVOID LookasideList, - __deref_out PVOID *EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltInsertExtraCreateParameter ( - __in PFLT_FILTER Filter, - __inout PECP_LIST EcpList, - __inout PVOID EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltFindExtraCreateParameter ( - __in PFLT_FILTER Filter, - __in PECP_LIST EcpList, - __in LPCGUID EcpType, - __deref_opt_out PVOID *EcpContext, - __out_opt ULONG *EcpContextSize - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltRemoveExtraCreateParameter ( - __in PFLT_FILTER Filter, - __inout PECP_LIST EcpList, - __in LPCGUID EcpType, - __deref_out PVOID *EcpContext, - __out_opt ULONG *EcpContextSize - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltFreeExtraCreateParameterList ( - __in PFLT_FILTER Filter, - __in PECP_LIST EcpList - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltFreeExtraCreateParameter ( - __in PFLT_FILTER Filter, - __in PVOID EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetEcpListFromCallbackData ( - __in PFLT_FILTER Filter, - __in PFLT_CALLBACK_DATA CallbackData, - __deref_out_opt PECP_LIST *EcpList - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltSetEcpListIntoCallbackData ( - __in PFLT_FILTER Filter, - __in PFLT_CALLBACK_DATA CallbackData, - __in PECP_LIST EcpList - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FLTAPI -FltGetNextExtraCreateParameter ( - __in PFLT_FILTER Filter, - __in PECP_LIST EcpList, - __in_opt PVOID CurrentEcpContext, - __out_opt LPGUID NextEcpType, - __deref_opt_out PVOID *NextEcpContext, - __out_opt ULONG *NextEcpContextSize - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -FLTAPI -FltAcknowledgeEcp ( - __in PFLT_FILTER Filter, - __in PVOID EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltIsEcpAcknowledged ( - __in PFLT_FILTER Filter, - __in PVOID EcpContext - ); - -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FLTAPI -FltIsEcpFromUserMode ( - __in PFLT_FILTER Filter, - __in PVOID EcpContext - ); - -// -// Some Kernel routines related to ECP manipulation -// -// FsRtlAllocateExtraCreateParameterList -// FsRtlFreeExtraCreateParameterList -// FsRtlAllocateExtraCreateParameter -// FsRtlFreeExtraCreateParameter -// FsRtlInitExtraCreateParameterLookasideList -// FsRtlDeleteExtraCreateParameterLookasideList -// FsRtlAllocateExtraCreateParameterFromLookasideList -// FsRtlInsertExtraCreateParameter -// FsRtlRemoveExtraCreateParameter -// FsRtlGetEcpListFromIrp -// FsRtlSetEcpListIntoIrp -// FsRtlGetNextExtraCreateParameter -// FsRtlAcknowledgeEcp -// FsRtlIsEcpAcknowledged -// FsRtlIsEcpFromUserMode -// - -#endif // FLT_MGR_LONGHORN - - -/////////////////////////////////////////////////////////////////////////////// -// -// IoPriorityHint support routines -// -/////////////////////////////////////////////////////////////////////////////// - -#if FLT_MGR_LONGHORN - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltRetrieveIoPriorityInfo ( - __in_opt PFLT_CALLBACK_DATA Data, - __in_opt PFILE_OBJECT FileObject, - __in_opt PETHREAD Thread, - __inout PIO_PRIORITY_INFO PriorityInfo - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltApplyPriorityInfoThread( - __in PIO_PRIORITY_INFO InputPriorityInfo, - __out_opt PIO_PRIORITY_INFO OutputPriorityInfo, - __in PETHREAD Thread - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -IO_PRIORITY_HINT -FLTAPI -FltGetIoPriorityHint ( - __in PFLT_CALLBACK_DATA Data - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -IO_PRIORITY_HINT -FLTAPI -FltGetIoPriorityHintFromCallbackData ( - __in PFLT_CALLBACK_DATA Data - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltSetIoPriorityHintIntoCallbackData ( - __in PFLT_CALLBACK_DATA Data, - __in IO_PRIORITY_HINT PriorityHint - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -IO_PRIORITY_HINT -FLTAPI -FltGetIoPriorityHintFromFileObject ( - __in PFILE_OBJECT FileObject - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltSetIoPriorityHintIntoFileObject ( - __in PFILE_OBJECT FileObject, - __in IO_PRIORITY_HINT PriorityHint - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -IO_PRIORITY_HINT -FLTAPI -FltGetIoPriorityHintFromThread ( - __in PETHREAD Thread - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -FLTAPI -FltSetIoPriorityHintIntoThread ( - __in PETHREAD Thread, - __in IO_PRIORITY_HINT PriorityHint - ); - -// -// Some Kernel routines related to IoPriorityHint manipulation -// -// IoInitializePriorityInfo -// IoSetIoPriorityHint -// IoGetIoPriorityHint -// ZwSetInformationFile (FileIoPriorityHintInformation class) -// ZwQueryInformationFile (FileIoPriorityHintInformation class) -// - -#endif // FLT_MGR_LONGHORN - - -/////////////////////////////////////////////////////////////////////////////// -// -// Debug support routines -// -/////////////////////////////////////////////////////////////////////////////// - -PCHAR -FLTAPI -FltGetIrpName ( - __in UCHAR IrpMajorCode - ); - - -/////////////////////////////////////////////////////////////////////////////// -// -// End of MAIN conditional compilation variables -// -/////////////////////////////////////////////////////////////////////////////// - -#else -# pragma message("You are building for a target that does not have FilterManager Support!") -#endif // FLT_MGR_BASELINE - -#ifdef __cplusplus -} // Balance extern "C" above -#endif - -#endif //__FLTKERNEL__ - diff --git a/qt-correction-tool/pub/ddk/fltUser.h b/qt-correction-tool/pub/ddk/fltUser.h deleted file mode 100644 index dd30c38..0000000 --- a/qt-correction-tool/pub/ddk/fltUser.h +++ /dev/null @@ -1,420 +0,0 @@ -/*++ - -Copyright (c) 1989-2002 Microsoft Corporation - -Module Name: - - fltUser.h - -Abstract: - Header file which contains the structures, type definitions, - constants, global variables and function prototypes that are - visible to user mode applications that interact with filters. - -Environment: - - User mode - ---*/ -#ifndef __FLTUSER_H__ -#define __FLTUSER_H__ - -// -// IMPORTANT!!!!! -// -// This is how FltMgr was released (from oldest to newest) -// xpsp2, (srv03, w2ksp5), LH, Win7 -// - -// -// The defines items that are part of the filter manager baseline -// - -#define FLT_MGR_BASELINE (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WINXPSP2))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WS03) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) || \ - (NTDDI_VERSION >= NTDDI_VISTA)) - -// -// This defines items that were added after XPSP2 was released. This means -// they are in Srv03 SP1, W2K SP4+URP, and Longhorn and above. -// - -#define FLT_MGR_AFTER_XPSP2 (((OSVER(NTDDI_VERSION) == NTDDI_WIN2K) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WIN2KSP4))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WINXP) && (SPVER(NTDDI_VERSION) > SPVER(NTDDI_WINXPSP2))) || \ - ((OSVER(NTDDI_VERSION) == NTDDI_WS03) && (SPVER(NTDDI_VERSION) >= SPVER(NTDDI_WS03SP1))) || \ - (NTDDI_VERSION >= NTDDI_VISTA)) - -// -// This defines items that only exist in longhorn or later -// - -#define FLT_MGR_LONGHORN (NTDDI_VERSION >= NTDDI_VISTA) - -// -// This defines items that only exist in Windows 7 or later -// - -#define FLT_MGR_WIN7 (NTDDI_VERSION >= NTDDI_WIN7) - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Standard includes -// -/////////////////////////////////////////////////////////////////////////////// - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// -// These are all of the baseline set of user-mode functions in FltMgr. -// - -#if FLT_MGR_BASELINE - -// -// Functions for loading, unloading and monitoring Filters -// - -__checkReturn -HRESULT -WINAPI -FilterLoad ( - __in LPCWSTR lpFilterName - ); - -__checkReturn -HRESULT -WINAPI -FilterUnload ( - __in LPCWSTR lpFilterName - ); - - -//**************************************************************************** -// -// Functions for creating and closing handles -// -//**************************************************************************** - -// -// Filter -// - -__checkReturn -HRESULT -WINAPI -FilterCreate ( - __in LPCWSTR lpFilterName, - __deref_out HFILTER *hFilter - ); - -HRESULT -WINAPI -FilterClose( - __in HFILTER hFilter - ); - -// -// FilterInstance -// - -__checkReturn -HRESULT -WINAPI -FilterInstanceCreate ( - __in LPCWSTR lpFilterName, - __in LPCWSTR lpVolumeName, - __in_opt LPCWSTR lpInstanceName, - __deref_out HFILTER_INSTANCE *hInstance - ); - -HRESULT -WINAPI -FilterInstanceClose( - __in HFILTER_INSTANCE hInstance - ); - - -//**************************************************************************** -// -// Functions for creating and deleting FilterInstances in the -// device stack. -// -//**************************************************************************** - -__checkReturn -HRESULT -WINAPI -FilterAttach ( - __in LPCWSTR lpFilterName, - __in LPCWSTR lpVolumeName, - __in_opt LPCWSTR lpInstanceName , - __in_opt DWORD dwCreatedInstanceNameLength , - __out_bcount_opt(dwCreatedInstanceNameLength) LPWSTR lpCreatedInstanceName - ); - -__checkReturn -HRESULT -WINAPI -FilterAttachAtAltitude ( - __in LPCWSTR lpFilterName, - __in LPCWSTR lpVolumeName, - __in LPCWSTR lpAltitude, - __in_opt LPCWSTR lpInstanceName , - __in_opt DWORD dwCreatedInstanceNameLength , - __out_bcount_opt(dwCreatedInstanceNameLength) LPWSTR lpCreatedInstanceName - ); - -__checkReturn -HRESULT -WINAPI -FilterDetach ( - __in LPCWSTR lpFilterName, - __in LPCWSTR lpVolumeName, - __in_opt LPCWSTR lpInstanceName - ); - - -//**************************************************************************** -// -// Functions for iterating through Filters and FilterInstances and -// getting information on a Filter or FilterInstance. -// -//**************************************************************************** - -// -// Functions for iterating through Filters -// - -__checkReturn -HRESULT -WINAPI -FilterFindFirst ( - __in FILTER_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned, - __out LPHANDLE lpFilterFind - ); - -__checkReturn -HRESULT -WINAPI -FilterFindNext ( - __in HANDLE hFilterFind, - __in FILTER_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - -__checkReturn -HRESULT -WINAPI -FilterFindClose( - __in HANDLE hFilterFind - ); - - -__checkReturn -HRESULT -WINAPI -FilterVolumeFindFirst ( - __in FILTER_VOLUME_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned, - __out PHANDLE lpVolumeFind - ); - -__checkReturn -HRESULT -WINAPI -FilterVolumeFindNext ( - __in HANDLE hVolumeFind, - __in FILTER_VOLUME_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - -HRESULT -WINAPI -FilterVolumeFindClose( - __in HANDLE hVolumeFind - ); - -// -// Functions for iterating through FilterInstances -// - -__checkReturn -HRESULT -WINAPI -FilterInstanceFindFirst ( - __in LPCWSTR lpFilterName, - __in INSTANCE_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned, - __out LPHANDLE lpFilterInstanceFind - ); - -__checkReturn -HRESULT -WINAPI -FilterInstanceFindNext ( - __in HANDLE hFilterInstanceFind, - __in INSTANCE_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - -__checkReturn -HRESULT -WINAPI -FilterInstanceFindClose( - __in HANDLE hFilterInstanceFind - ); - - -// -// Functions for iterating through VolumeInstances -// - -__checkReturn -HRESULT -WINAPI -FilterVolumeInstanceFindFirst ( - __in LPCWSTR lpVolumeName, - __in INSTANCE_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned, - __out LPHANDLE lpVolumeInstanceFind - ); - -__checkReturn -HRESULT -WINAPI -FilterVolumeInstanceFindNext ( - __in HANDLE hVolumeInstanceFind, - __in INSTANCE_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - -HRESULT -WINAPI -FilterVolumeInstanceFindClose( - __in HANDLE hVolumeInstanceFind - ); - - -// -// Functions for getting information on Filters and FilterInstances -// - -__checkReturn -HRESULT -WINAPI -FilterGetInformation ( - __in HFILTER hFilter, - __in FILTER_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - -__checkReturn -HRESULT -WINAPI -FilterInstanceGetInformation ( - __in HFILTER_INSTANCE hInstance, - __in INSTANCE_INFORMATION_CLASS dwInformationClass, - __out_bcount_part(dwBufferSize,*lpBytesReturned) LPVOID lpBuffer, - __in DWORD dwBufferSize, - __out LPDWORD lpBytesReturned - ); - - -//**************************************************************************** -// -// Functions for communicating with Filters and FilterInstances -// -//**************************************************************************** - -__checkReturn -HRESULT -WINAPI -FilterConnectCommunicationPort( - __in LPCWSTR lpPortName, - __in DWORD dwOptions, - __in_bcount_opt(wSizeOfContext) LPCVOID lpContext, - __in WORD wSizeOfContext, - __in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes , - __deref_out HANDLE *hPort - ); - -__checkReturn -HRESULT -WINAPI -FilterSendMessage ( - __in HANDLE hPort, - __in_bcount_opt(dwInBufferSize) LPVOID lpInBuffer, - __in DWORD dwInBufferSize, - __out_bcount_part_opt(dwOutBufferSize,*lpBytesReturned) LPVOID lpOutBuffer, - __in DWORD dwOutBufferSize, - __out LPDWORD lpBytesReturned - ); - -__checkReturn -HRESULT -WINAPI -FilterGetMessage ( - __in HANDLE hPort, - __out_bcount(dwMessageBufferSize) PFILTER_MESSAGE_HEADER lpMessageBuffer, - __in DWORD dwMessageBufferSize, - __inout LPOVERLAPPED lpOverlapped - ); - -__checkReturn -HRESULT -WINAPI -FilterReplyMessage ( - __in HANDLE hPort, - __in_bcount(dwReplyBufferSize) PFILTER_REPLY_HEADER lpReplyBuffer, - __in DWORD dwReplyBufferSize - ); - -//**************************************************************************** -// -// Other support functions -// -//**************************************************************************** - -__checkReturn -HRESULT -WINAPI -FilterGetDosName ( - __in LPCWSTR lpVolumeName, - __out_ecount(dwDosNameBufferSize) LPWSTR lpDosName, - __in DWORD dwDosNameBufferSize - ); - -#endif // end the FLT_MGR_BASELINE - -#ifdef __cplusplus -} // Balance extern "C" above -#endif - -#endif /* __FLTUSER_H__ */ - diff --git a/qt-correction-tool/pub/ddk/fltUserStructures.h b/qt-correction-tool/pub/ddk/fltUserStructures.h deleted file mode 100644 index c7874f0..0000000 --- a/qt-correction-tool/pub/ddk/fltUserStructures.h +++ /dev/null @@ -1,601 +0,0 @@ -/*++ - -Copyright (c) 1989-2002 Microsoft Corporation - -Module Name: - - fltUserStructures.h - -Abstract: - - This contains structures, types, and defintiions that are common to both - USER mode and KERNEL mode environments. - -Environment: - - User mode - ---*/ -#ifndef __FLT_USER_STRUCTURES_H__ -#define __FLT_USER_STRUCTURES_H__ - -#if FLT_MGR_BASELINE - -// -// Disable warning for this file -// - -#define FLTAPI NTAPI - -#define FILTER_NAME_MAX_CHARS 255 -#define FILTER_NAME_MAX_BYTES (FILTER_NAME_MAX_CHARS * sizeof( WCHAR )) - -#define VOLUME_NAME_MAX_CHARS 1024 -#define VOLUME_NAME_MAX_BYTES (VOLUME_NAME_MAX_CHARS * sizeof( WCHAR )) - -#define INSTANCE_NAME_MAX_CHARS 255 -#define INSTANCE_NAME_MAX_BYTES (INSTANCE_NAME_MAX_CHARS * sizeof( WCHAR )) - -typedef HANDLE HFILTER; -typedef HANDLE HFILTER_INSTANCE; -typedef HANDLE HFILTER_VOLUME; - - -// -// Note: this may be removed in future when all translations from NTSTATUS to -// Win32 error codes are checked in. This is interim - since there the -// translation is not in for all filter manager error codes, -// apps will have to access NTSTATUS codes directly -// - -typedef __success(return >= 0) LONG NTSTATUS; -typedef NTSTATUS *PNTSTATUS; - -/////////////////////////////////////////////////////////////////////////////// -// -// Known File System Types -// -/////////////////////////////////////////////////////////////////////////////// - -typedef enum _FLT_FILESYSTEM_TYPE { - - FLT_FSTYPE_UNKNOWN, //an UNKNOWN file system type - FLT_FSTYPE_RAW, //Microsoft's RAW file system (\FileSystem\RAW) - FLT_FSTYPE_NTFS, //Microsoft's NTFS file system (\FileSystem\Ntfs) - FLT_FSTYPE_FAT, //Microsoft's FAT file system (\FileSystem\Fastfat) - FLT_FSTYPE_CDFS, //Microsoft's CDFS file system (\FileSystem\Cdfs) - FLT_FSTYPE_UDFS, //Microsoft's UDFS file system (\FileSystem\Udfs) - FLT_FSTYPE_LANMAN, //Microsoft's LanMan Redirector (\FileSystem\MRxSmb) - FLT_FSTYPE_WEBDAV, //Microsoft's WebDav redirector (\FileSystem\MRxDav) - FLT_FSTYPE_RDPDR, //Microsoft's Terminal Server redirector (\Driver\rdpdr) - FLT_FSTYPE_NFS, //Microsoft's NFS file system (\FileSystem\NfsRdr) - FLT_FSTYPE_MS_NETWARE, //Microsoft's NetWare redirector (\FileSystem\nwrdr) - FLT_FSTYPE_NETWARE, //Novell's NetWare redirector - FLT_FSTYPE_BSUDF, //The BsUDF CD-ROM driver (\FileSystem\BsUDF) - FLT_FSTYPE_MUP, //Microsoft's Mup redirector (\FileSystem\Mup) - FLT_FSTYPE_RSFX, //Microsoft's WinFS redirector (\FileSystem\RsFxDrv) - FLT_FSTYPE_ROXIO_UDF1, //Roxio's UDF writeable file system (\FileSystem\cdudf_xp) - FLT_FSTYPE_ROXIO_UDF2, //Roxio's UDF readable file system (\FileSystem\UdfReadr_xp) - FLT_FSTYPE_ROXIO_UDF3, //Roxio's DVD file system (\FileSystem\DVDVRRdr_xp) - FLT_FSTYPE_TACIT, //Tacit FileSystem (\Device\TCFSPSE) - FLT_FSTYPE_FS_REC, //Microsoft's File system recognizer (\FileSystem\Fs_rec) - FLT_FSTYPE_INCD, //Nero's InCD file system (\FileSystem\InCDfs) - FLT_FSTYPE_INCD_FAT, //Nero's InCD FAT file system (\FileSystem\InCDFat) - FLT_FSTYPE_EXFAT, //Microsoft's EXFat FILE SYSTEM (\FileSystem\exfat) - FLT_FSTYPE_PSFS, //PolyServ's file system (\FileSystem\psfs) - FLT_FSTYPE_GPFS //IBM General Parallel File System (\FileSystem\gpfs) - -} FLT_FILESYSTEM_TYPE, *PFLT_FILESYSTEM_TYPE; - - -///////////////////////////////////////////////////////////////////////////// -// -// The different types information that can be return on an Filter. -// -// Note: Entries with "Aggregate" in the name return information for -// both LEGACY and MINI filters. -// -///////////////////////////////////////////////////////////////////////////// - - -// -// In xpsp2 we do not have the concept of enumerating legacy filters -// For this reason there is no FilterAggregateBasicInfo in the V1 version -// of the enum -// - -typedef enum _FILTER_INFORMATION_CLASS { - - FilterFullInformation, - FilterAggregateBasicInformation, //Added to XP SP2 via QFE - FilterAggregateStandardInformation //Longhorn and later - -} FILTER_INFORMATION_CLASS, *PFILTER_INFORMATION_CLASS; - -// -// The structures for the information returned from the query of -// information on a Filter. -// - -typedef struct _FILTER_FULL_INFORMATION { - - ULONG NextEntryOffset; - - ULONG FrameID; - - ULONG NumberOfInstances; - - USHORT FilterNameLength; - WCHAR FilterNameBuffer[1]; - -} FILTER_FULL_INFORMATION, *PFILTER_FULL_INFORMATION; - - -// -// This structure returns information for both legacy filters and mini -// filters. -// -// NOTE: Support for this structures exists in all OS's that support -// filter manager except XP SP2. It was added later to XP SP2 -// via a QFE. -// - -typedef struct _FILTER_AGGREGATE_BASIC_INFORMATION { - - ULONG NextEntryOffset; - - // - // ABI - Aggregate Basic Information flags - // - - ULONG Flags; - #define FLTFL_AGGREGATE_INFO_IS_MINIFILTER 0x00000001 - #define FLTFL_AGGREGATE_INFO_IS_LEGACYFILTER 0x00000002 - - union { - - // - // Minifilter FULL information - // - - struct { - - ULONG FrameID; - - ULONG NumberOfInstances; - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - USHORT FilterAltitudeLength; - USHORT FilterAltitudeBufferOffset; - - } MiniFilter; - - // - // Legacyfilter information - // - - struct { - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - } LegacyFilter; - - } Type; - -} FILTER_AGGREGATE_BASIC_INFORMATION, *PFILTER_AGGREGATE_BASIC_INFORMATION; - - -// -// This structure returns information for both legacy filters and mini -// filters. -// -// NOTE: Support for this structures exists in Vista and Later -// - -#if FLT_MGR_LONGHORN -typedef struct _FILTER_AGGREGATE_STANDARD_INFORMATION { - - ULONG NextEntryOffset; - - // - // ASI - Aggregate Standard Information flags - // - - ULONG Flags; - #define FLTFL_ASI_IS_MINIFILTER 0x00000001 - #define FLTFL_ASI_IS_LEGACYFILTER 0x00000002 - - union { - - // - // Minifilter FULL information - // - - struct { - - // - // ASIM - Aggregate Standard Information Minifilter flags - // - - ULONG Flags; - - - ULONG FrameID; - - ULONG NumberOfInstances; - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - USHORT FilterAltitudeLength; - USHORT FilterAltitudeBufferOffset; - - } MiniFilter; - - // - // Legacyfilter information - // - - struct { - - // - // ASIL - Aggregate Standard Information LegacyFilter flags - // - - ULONG Flags; - - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - USHORT FilterAltitudeLength; - USHORT FilterAltitudeBufferOffset; - - } LegacyFilter; - - } Type; - -} FILTER_AGGREGATE_STANDARD_INFORMATION, *PFILTER_AGGREGATE_STANDARD_INFORMATION; -#endif // FLT_MGR_LONGHORN - - -///////////////////////////////////////////////////////////////////////////// -// -// The different types information that can be return for a Volume -// -///////////////////////////////////////////////////////////////////////////// - -typedef enum _FILTER_VOLUME_INFORMATION_CLASS { - - FilterVolumeBasicInformation, - FilterVolumeStandardInformation //Longhorn and later - -} FILTER_VOLUME_INFORMATION_CLASS, *PFILTER_VOLUME_INFORMATION_CLASS; - - -// -// Basic information about a volume (its name) -// - -typedef struct _FILTER_VOLUME_BASIC_INFORMATION { - - // - // Length of name - // - - USHORT FilterVolumeNameLength; - - // - // Buffer containing name (it's NOT NULL-terminated) - // - - WCHAR FilterVolumeName[1]; - -} FILTER_VOLUME_BASIC_INFORMATION, *PFILTER_VOLUME_BASIC_INFORMATION; - -// -// Additional volume information. -// -// NOTE: Only available in LONGHORN and later OS's -// - -#if FLT_MGR_LONGHORN -typedef struct _FILTER_VOLUME_STANDARD_INFORMATION { - - ULONG NextEntryOffset; - - // - // VSI - VOlume Standard Information flags - // - - ULONG Flags; - - // - // If set this volume is not current attached to a storage stack - // - - #define FLTFL_VSI_DETACHED_VOLUME 0x00000001 - - // - // Identifies which frame this volume structure is in - // - - ULONG FrameID; - - // - // Identifies the type of file system being used on the volume - // - - FLT_FILESYSTEM_TYPE FileSystemType; - - // - // Length of name - // - - USHORT FilterVolumeNameLength; - - // - // Buffer containing name (it's NOT NULL-terminated) - // - - WCHAR FilterVolumeName[1]; - -} FILTER_VOLUME_STANDARD_INFORMATION, *PFILTER_VOLUME_STANDARD_INFORMATION; -#endif // FLT_MGR_LONGHORN - - - -///////////////////////////////////////////////////////////////////////////// -// -// The different types information that can be return on an Instance. -// -///////////////////////////////////////////////////////////////////////////// - -typedef enum _INSTANCE_INFORMATION_CLASS { - - InstanceBasicInformation, - InstancePartialInformation, - InstanceFullInformation, - InstanceAggregateStandardInformation //LONGHORN and later - -} INSTANCE_INFORMATION_CLASS, *PINSTANCE_INFORMATION_CLASS; - - -// -// The structures for the information returned from the query of the information -// on the Instance. -// - -typedef __struct_bcount(sizeof(INSTANCE_BASIC_INFORMATION) * InstanceNameLength) struct _INSTANCE_BASIC_INFORMATION { - - ULONG NextEntryOffset; - - USHORT InstanceNameLength; - USHORT InstanceNameBufferOffset; - -} INSTANCE_BASIC_INFORMATION, *PINSTANCE_BASIC_INFORMATION; - -typedef __struct_bcount(sizeof(INSTANCE_PARTIAL_INFORMATION) + InstanceNameLength + AltitudeLength) struct _INSTANCE_PARTIAL_INFORMATION { - - ULONG NextEntryOffset; - - USHORT InstanceNameLength; - USHORT InstanceNameBufferOffset; - - USHORT AltitudeLength; - USHORT AltitudeBufferOffset; - -} INSTANCE_PARTIAL_INFORMATION, *PINSTANCE_PARTIAL_INFORMATION; - -typedef __struct_bcount(sizeof(INSTANCE_FULL_INFORMATION) + InstanceNameLength + AltitudeLength + VolumeNameLength + FilterNameLength) struct _INSTANCE_FULL_INFORMATION { - - ULONG NextEntryOffset; - - USHORT InstanceNameLength; - USHORT InstanceNameBufferOffset; - - USHORT AltitudeLength; - USHORT AltitudeBufferOffset; - - USHORT VolumeNameLength; - USHORT VolumeNameBufferOffset; - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - -} INSTANCE_FULL_INFORMATION, *PINSTANCE_FULL_INFORMATION; - - -// -// This information class is used to return instance information about both -// legacy filters and minifilters. -// - -#if FLT_MGR_LONGHORN -typedef struct _INSTANCE_AGGREGATE_STANDARD_INFORMATION { - - ULONG NextEntryOffset; - - // - // IASI - Instance Aggregate Standard Information flags - // - - ULONG Flags; - #define FLTFL_IASI_IS_MINIFILTER 0x00000001 - #define FLTFL_IASI_IS_LEGACYFILTER 0x00000002 - - union { - - // - // MiniFilter information - // - - struct { - - // - // IASIM - Instance Aggregate Standard Information Minifilter flags - // - - ULONG Flags; - - // - // If set this volume is not current attached to a storage stack - // - - #define FLTFL_IASIM_DETACHED_VOLUME 0x00000001 - - // - // Identifies which frame this volume structure is in - // - - ULONG FrameID; - - // - // The type of file system this instance is attached to - // - - FLT_FILESYSTEM_TYPE VolumeFileSystemType; - - // - // The name of this instance - // - - USHORT InstanceNameLength; - USHORT InstanceNameBufferOffset; - - // - // The altitude of this instance - // - - USHORT AltitudeLength; - USHORT AltitudeBufferOffset; - - // - // The volume name this instance is attached to - // - - USHORT VolumeNameLength; - USHORT VolumeNameBufferOffset; - - // - // The name of the minifilter associated with this instace - // - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - } MiniFilter; - - // - // Legacyfilter information - // - - struct { - - // - // IASIL - Instance Aggregate Standard Information LegacyFilter flags - // - - ULONG Flags; - - // - // If set this volume is not current attached to a storage stack - // - - #define FLTFL_IASIL_DETACHED_VOLUME 0x00000001 - - // - // The altitude of this attachment - // - - USHORT AltitudeLength; - USHORT AltitudeBufferOffset; - - // - // The volume name this filter is attached to - // - - USHORT VolumeNameLength; - USHORT VolumeNameBufferOffset; - - // - // The name of the filter associated with this attachment - // - - USHORT FilterNameLength; - USHORT FilterNameBufferOffset; - - } LegacyFilter; - - } Type; - -} INSTANCE_AGGREGATE_STANDARD_INFORMATION, *PINSTANCE_AGGREGATE_STANDARD_INFORMATION; -#endif // FLT_MGR_LONGHORN - - -///////////////////////////////////////////////////////////////////////////// -// -// Message defintitions -// -///////////////////////////////////////////////////////////////////////////// - -typedef struct _FILTER_MESSAGE_HEADER { - - // - // OUT - // - // Total buffer length in bytes, including the FILTER_REPLY_HEADER, of - // the expected reply. If no reply is expected, 0 is returned. - // - - ULONG ReplyLength; - - // - // OUT - // - // Unique Id for this message. This will be set when the kernel message - // satifies this FilterGetMessage or FilterInstanceGetMessage request. - // If replying to this message, this is the MessageId that should be used. - // - - ULONGLONG MessageId; - - // - // General filter-specific buffer data follows... - // - -} FILTER_MESSAGE_HEADER, *PFILTER_MESSAGE_HEADER; - -typedef struct _FILTER_REPLY_HEADER { - - // - // IN. - // - // Status of this reply. This status will be returned back to the filter - // driver who is waiting for a reply. - // - - NTSTATUS Status; - - // - // IN - // - // Unique Id for this message. This id was returned in the - // FILTER_MESSAGE_HEADER from the kernel message to which we are replying. - // - - ULONGLONG MessageId; - - // - // General filter-specific buffer data follows... - // - -} FILTER_REPLY_HEADER, *PFILTER_REPLY_HEADER; - -#endif //FLT_MGR_BASELINE - -#endif /* __FLT_USER_STRUCTURES_H__ */ - diff --git a/qt-correction-tool/pub/ddk/fltWinError.h b/qt-correction-tool/pub/ddk/fltWinError.h deleted file mode 100644 index acda2e8..0000000 --- a/qt-correction-tool/pub/ddk/fltWinError.h +++ /dev/null @@ -1,383 +0,0 @@ -/*++ BUILD Version: 0005 // Increment this if a change has global effects - -Copyright (c) 1989-2002 Microsoft Corporation. All rights reserved. - -Module Name: - - fltWinError.h - -Abstract: - - Constant definitions for the HRESULTS values defined by the Filter Manager. - -Environment: - - User mode - ---*/ - -#ifndef _FLT_WINERROR_ -#define _FLT_WINERROR_ - -// -// For Windows version 6.00 and later, these error codes are defined in -// winerror.h. Only use these definitions if not already defined -// -#if NTDDI_VERSION < NTDDI_VISTA -#ifndef FACILITY_USERMODE_FILTER_MANAGER - -// -// HRESULT -// FILTER_HRESULT_FROM_FLT_NTSTATUS ( -// IN NTSTATUS FltNtStatus -// ) -// -// Macro Description: -// -// This macro does the translation from a Filter Manager defined NTSTATUS -// code to a Filter Manager Library HRESULT. The Filter Manager Library -// error code is built as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-+-+-+-+-----------------------+-------------------------------+ -// |S|R|C|R| FltMgr Facility |(Code part of FltNtStatus) | -// | | | | | | bit-wise or'd with 0x0000 | -// +-+-+-+-+-----------------------+-------------------------------+ -// -// where -// -// S - Severity - 1 to indicate FAILURE -// -// R - reserved portion of the facility code, corresponds to NT's -// second severity bit. -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - FACILITY_USERMODE_FILTER_MANAGER -// -// Code - Code portion of the NTSTATUS -// -// Arguments: -// -// FltNtStatus - The NTSTATUS error code with the Filter Manager facility -// code to translate to an Filter Manager Library HRESULT. -// -// Return Value: -// -// The appropriate HRESULT. -// - -#define FILTER_HRESULT_FROM_FLT_NTSTATUS(x) (ASSERT((x & 0xfff0000) == 0x001c0000),(HRESULT) (((x) & 0x8000FFFF) | (FACILITY_USERMODE_FILTER_MANAGER << 16))) - - -////////////////////////////////////////////////////////////////////// -// -// HRESULTs for Filter Manager defined NTSTATUS codes -// -////////////////////////////////////////////////////////////////////// - -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// -#define FACILITY_USERMODE_FILTER_MANAGER 0x1F - - -// -// Define the severity codes -// - - -// -// MessageId: ERROR_FLT_IO_COMPLETE -// -// MessageText: -// -// The IO was completed by a filter. -// -#define ERROR_FLT_IO_COMPLETE ((HRESULT)0x001F0001L) - -// -// MessageId: ERROR_FLT_NO_HANDLER_DEFINED -// -// MessageText: -// -// A handler was not defined by the filter for this operation. -// -#define ERROR_FLT_NO_HANDLER_DEFINED ((HRESULT)0x801F0001L) - -// -// MessageId: ERROR_FLT_CONTEXT_ALREADY_DEFINED -// -// MessageText: -// -// A context is already defined for this object. -// -#define ERROR_FLT_CONTEXT_ALREADY_DEFINED ((HRESULT)0x801F0002L) - -// -// MessageId: ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST -// -// MessageText: -// -// Asynchronous requests are not valid for this operation. -// -#define ERROR_FLT_INVALID_ASYNCHRONOUS_REQUEST ((HRESULT)0x801F0003L) - -// -// MessageId: ERROR_FLT_DISALLOW_FAST_IO -// -// MessageText: -// -// Disallow the Fast IO path for this operation. -// -#define ERROR_FLT_DISALLOW_FAST_IO ((HRESULT)0x801F0004L) - -// -// MessageId: ERROR_FLT_INVALID_NAME_REQUEST -// -// MessageText: -// -// An invalid name request was made. The name requested cannot be retrieved at this time. -// -#define ERROR_FLT_INVALID_NAME_REQUEST ((HRESULT)0x801F0005L) - -// -// MessageId: ERROR_FLT_NOT_SAFE_TO_POST_OPERATION -// -// MessageText: -// -// Posting this operation to a worker thread for further processing is not safe -// at this time because it could lead to a system deadlock. -// -#define ERROR_FLT_NOT_SAFE_TO_POST_OPERATION ((HRESULT)0x801F0006L) - -// -// MessageId: ERROR_FLT_NOT_INITIALIZED -// -// MessageText: -// -// The Filter Manager was not initialized when a filter tried to register. Make -// sure that the Filter Manager is getting loaded as a driver. -// -#define ERROR_FLT_NOT_INITIALIZED ((HRESULT)0x801F0007L) - -// -// MessageId: ERROR_FLT_FILTER_NOT_READY -// -// MessageText: -// -// The filter is not ready for attachment to volumes because it has not finished -// initializing (FltStartFiltering has not been called). -// -#define ERROR_FLT_FILTER_NOT_READY ((HRESULT)0x801F0008L) - -// -// MessageId: ERROR_FLT_POST_OPERATION_CLEANUP -// -// MessageText: -// -// The filter must cleanup any operation specific context at this time because -// it is being removed from the system before the operation is completed by -// the lower drivers. -// -#define ERROR_FLT_POST_OPERATION_CLEANUP ((HRESULT)0x801F0009L) - -// -// MessageId: ERROR_FLT_INTERNAL_ERROR -// -// MessageText: -// -// The Filter Manager had an internal error from which it cannot recover, -// therefore the operation has been failed. This is usually the result -// of a filter returning an invalid value from a pre-operation callback. -// -#define ERROR_FLT_INTERNAL_ERROR ((HRESULT)0x801F000AL) - -// -// MessageId: ERROR_FLT_DELETING_OBJECT -// -// MessageText: -// -// The object specified for this action is in the process of being -// deleted, therefore the action requested cannot be completed at -// this time. -// -#define ERROR_FLT_DELETING_OBJECT ((HRESULT)0x801F000BL) - -// -// MessageId: ERROR_FLT_MUST_BE_NONPAGED_POOL -// -// MessageText: -// -// Non-paged pool must be used for this type of context. -// -#define ERROR_FLT_MUST_BE_NONPAGED_POOL ((HRESULT)0x801F000CL) - -// -// MessageId: ERROR_FLT_DUPLICATE_ENTRY -// -// MessageText: -// -// A duplicate handler definition has been provided for an operation. -// -#define ERROR_FLT_DUPLICATE_ENTRY ((HRESULT)0x801F000DL) - -// -// MessageId: ERROR_FLT_CBDQ_DISABLED -// -// MessageText: -// -// The callback data queue has been disabled. -// -#define ERROR_FLT_CBDQ_DISABLED ((HRESULT)0x801F000EL) - -// -// MessageId: ERROR_FLT_DO_NOT_ATTACH -// -// MessageText: -// -// Do not attach the filter to the volume at this time. -// -#define ERROR_FLT_DO_NOT_ATTACH ((HRESULT)0x801F000FL) - -// -// MessageId: ERROR_FLT_DO_NOT_DETACH -// -// MessageText: -// -// Do not detach the filter from the volume at this time. -// -#define ERROR_FLT_DO_NOT_DETACH ((HRESULT)0x801F0010L) - -// -// MessageId: ERROR_FLT_INSTANCE_ALTITUDE_COLLISION -// -// MessageText: -// -// An instance already exists at this altitude on the volume specified. -// -#define ERROR_FLT_INSTANCE_ALTITUDE_COLLISION ((HRESULT)0x801F0011L) - -// -// MessageId: ERROR_FLT_INSTANCE_NAME_COLLISION -// -// MessageText: -// -// An instance already exists with this name on the volume specified. -// -#define ERROR_FLT_INSTANCE_NAME_COLLISION ((HRESULT)0x801F0012L) - -// -// MessageId: ERROR_FLT_FILTER_NOT_FOUND -// -// MessageText: -// -// The system could not find the filter specified. -// -#define ERROR_FLT_FILTER_NOT_FOUND ((HRESULT)0x801F0013L) - -// -// MessageId: ERROR_FLT_VOLUME_NOT_FOUND -// -// MessageText: -// -// The system could not find the volume specified. -// -#define ERROR_FLT_VOLUME_NOT_FOUND ((HRESULT)0x801F0014L) - -// -// MessageId: ERROR_FLT_INSTANCE_NOT_FOUND -// -// MessageText: -// -// The system could not find the instance specified. -// -#define ERROR_FLT_INSTANCE_NOT_FOUND ((HRESULT)0x801F0015L) - -// -// MessageId: ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND -// -// MessageText: -// -// No registered context allocation definition was found for the given request. -// -#define ERROR_FLT_CONTEXT_ALLOCATION_NOT_FOUND ((HRESULT)0x801F0016L) - -// -// MessageId: ERROR_FLT_INVALID_CONTEXT_REGISTRATION -// -// MessageText: -// -// An invalid parameter was specified during context registration. -// -#define ERROR_FLT_INVALID_CONTEXT_REGISTRATION ((HRESULT)0x801F0017L) - -// -// MessageId: ERROR_FLT_NAME_CACHE_MISS -// -// MessageText: -// -// The name requested was not found in Filter Manager's name cache and could not be retrieved from the file system. -// -#define ERROR_FLT_NAME_CACHE_MISS ((HRESULT)0x801F0018L) - -// -// MessageId: ERROR_FLT_NO_DEVICE_OBJECT -// -// MessageText: -// -// The requested device object does not exist for the given volume. -// -#define ERROR_FLT_NO_DEVICE_OBJECT ((HRESULT)0x801F0019L) - -// -// MessageId: ERROR_FLT_VOLUME_ALREADY_MOUNTED -// -// MessageText: -// -// The specified volume is already mounted. -// -#define ERROR_FLT_VOLUME_ALREADY_MOUNTED ((HRESULT)0x801F001AL) - -// -// MessageId: ERROR_FLT_NO_WAITER_FOR_REPLY -// -// MessageText: -// -// No waiter is present for the filter's reply to this message. -// -#define ERROR_FLT_NO_WAITER_FOR_REPLY ((HRESULT)0x801F0020L) - -#endif // !FACILITY_USERMODE_FILTER_MANAGER -#endif //NTDDIVER < WIN_LH -#endif //_FLT_WINERROR_ - diff --git a/qt-correction-tool/pub/ddk/fltsafe.h b/qt-correction-tool/pub/ddk/fltsafe.h deleted file mode 100644 index d12be90..0000000 --- a/qt-correction-tool/pub/ddk/fltsafe.h +++ /dev/null @@ -1,30 +0,0 @@ -#if (NTDDI_VERSION >= NTDDI_WINXP) -// fltsafe.h -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// - -// FLOATSAFE -// -// Saves floating point state on construction and restores on destruction. -// -struct FLOATSAFE -{ - KFLOATING_SAVE FloatSave; - NTSTATUS ntStatus; - - FLOATSAFE::FLOATSAFE(void) - { - ntStatus = KeSaveFloatingPointState(&FloatSave); - } - - FLOATSAFE::~FLOATSAFE(void) - { - if (NT_SUCCESS(ntStatus)) - { - KeRestoreFloatingPointState(&FloatSave); - } - } -}; -#endif - diff --git a/qt-correction-tool/pub/ddk/fullenumsyncdeviceservice.h b/qt-correction-tool/pub/ddk/fullenumsyncdeviceservice.h deleted file mode 100644 index ff14721..0000000 --- a/qt-correction-tool/pub/ddk/fullenumsyncdeviceservice.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * FullEnumSyncDeviceService.h - * - * Contains definitions for the Full Enumeration Sync Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _FULLENUMSYNCSERVICE_H_ -#define _FULLENUMSYNCSERVICE_H_ - -#include -#include - -/*****************************************************************************/ -/* Full Enumeration Sync Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_FullEnumSync, - 0x28d3aac9, 0xc075, 0x44be, 0x88, 0x81, 0x65, 0xf3, 0x8d, 0x30, 0x59, 0x09); - -#define NAME_FullEnumSyncSvc L"FullEnumSync" -#define TYPE_FullEnumSyncSvc DEVSVCTYPE_ABSTRACT - -/*****************************************************************************/ -/* Full Enumeration Sync Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_FullEnumSyncSvc, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5); - -/* PKEY_FullEnumSyncSvc_VersionProps - * - * Provides information about change units and version properties. The - * format for the dataset is - * - * UINT32 Number of change units - * UINT128 Namespace GUID for first change unit property key - * UINT32 Namespace ID for the first change unit property key - * UINT32 Number of properties associated with this change unit - * UINT128 Namespace GUID for first property key in change unit - * UINT32 Namespace ID for first property key in change unit - * ... Repeat for number of property keys - * ... Repeat for number of change units - * - * NOTE: If all change units use the same property key specify a namespace - * GUID of GUID_NULL (all 0's) and a namespace ID of 0. - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_FullEnumSyncSvc_VersionProps, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5, - 3); - -#define NAME_FullEnumSyncSvc_VersionProps L"FullEnumVersionProps" - - -/* PKEY_FullEnumSyncSvc_ReplicaID - * - * Contains the GUID representing this replica in the sync community. - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_FullEnumSyncSvc_ReplicaID, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5, - 4); - -#define NAME_FullEnumSyncSvc_ReplicaID L"FullEnumReplicaID" - - -/* PKEY_FullEnumSyncSvc_KnowledgeObjectID - * - * Object ID to be used for the knowledge object - * - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_FullEnumSyncSvc_KnowledgeObjectID, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5, - 7); - -#define NAME_FullEnumSyncSvc_KnowledgeObjectID L"FullEnumKnowledgeObjectID" - - -/* PKEY_FullEnumSyncSvc_LastSyncProxyID - * - * Contains a GUID indicating the last sync proxy to perform a sync operation - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_FullEnumSyncSvc_LastSyncProxyID, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5, - 8); - -#define NAME_FullEnumSyncSvc_LastSyncProxyID L"FullEnumLastSyncProxyID" - - -/* PKEY_FullEnumSyncSvc_ProviderVersion - * - * Contains a device defined value giving the version of the provider - * currently in use on the device. This version must be incremented whenever - * new properties are added to the device implementation so that they will - * be recognized and managed as part of synchronization. 0 is reserved. - * - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_FullEnumSyncSvc_ProviderVersion, - 0x63b10e6c, 0x4f3a, 0x456d, 0x95, 0xcb, 0x98, 0x94, 0xed, 0xec, 0x9f, 0xa5, - 9); - -#define NAME_FullEnumSyncSvc_ProviderVersion L"FullEnumProviderVersion" - - -/* PKEY_FullEnumSyncSvc_SyncFormat - * - * Indicates the format GUID for the object format that is to be used in the - * sync operation. - * - * Type: UInt128 - * Form: None - */ - -#define PKEY_FullEnumSyncSvc_SyncFormat PKEY_SyncSvc_SyncFormat -#define NAME_FullEnumSyncSvc_SyncFormat NAME_SyncSvc_SyncFormat - -/* PKEY_FullEnumSyncSvc_LocalOnlyDelete - * - * Boolean flag indicating whether deletes of objects on the service host - * should be treated as "local only" and not propogated to other sync - * participants. The alternative is "true sync" in which deletes on the - * service host are propogated to all other sync participants. - * - * Type: UInt8 - * Form: None - */ - -#define PKEY_FullEnumSyncSvc_LocalOnlyDelete PKEY_SyncSvc_LocalOnlyDelete -#define NAME_FullEnumSyncSvc_LocalOnlyDelete NAME_SyncSvc_LocalOnlyDelete - - -/* PKEY_FullEnumSyncSvc_FilterType - * - * Type: UInt8 - * Form: None - */ - -#define PKEY_FullEnumSyncSvc_FilterType PKEY_SyncSvc_FilterType -#define NAME_FullEnumSyncSvc_FilterType NAME_SyncSvc_FilterType - - -/*****************************************************************************/ -/* Full Enumeration Sync Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_FullEnumSyncKnowledge - * - * Knowledge object format - */ - -DEFINE_DEVSVCGUID(FORMAT_FullEnumSyncKnowledge, - 0x221bce32, 0x221b, 0x4f45, 0xb4, 0x8b, 0x80, 0xde, 0x9a, 0x93, 0xa4, 0x4a); - -#define NAME_FullEnumSyncKnowledge L"FullEnumSyncKnowledge" - - -/*****************************************************************************/ -/* Full Enumeration Sync Service Methods */ -/*****************************************************************************/ - -/* Inherited methods - */ - -#define METHOD_FullEnumSyncSvc_BeginSync METHOD_SyncSvc_BeginSync -#define NAME_FullEnumSyncSvc_BeginSync NAME_SyncSvc_BeginSync - -#define METHOD_FullEnumSyncSvc_EndSync METHOD_SyncSvc_EndSync -#define NAME_FullEnumSyncSvc_EndSync NAME_SyncSvc_EndSync - -#endif /* _FULLENUMSYNCSERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/hbaapi.h b/qt-correction-tool/pub/ddk/hbaapi.h deleted file mode 100644 index f9b5a4b..0000000 --- a/qt-correction-tool/pub/ddk/hbaapi.h +++ /dev/null @@ -1,1561 +0,0 @@ -//*************************************************************************** -// -// hbaapi.h -// -// Module: Windows HBA API implmentation -// -// This header is consistent with www.t11.org SM-HBA Draft July 2006 -// -// Purpose: Contains HBA api header -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -#ifndef HBAAPI_H -#define HBAAPI_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define SM_HBA_API // include SM-HBA specific functions - -#include - -#ifdef _HBAAPIP_ -#define HBA_API __cdecl -#else -#define HBA_API DECLSPEC_IMPORT __cdecl -#endif - -#define HBA_VERSION 2 - -typedef ULONGLONG HBA_UINT64; -typedef LONGLONG HBA_INT64; -typedef ULONG HBA_UINT32; -typedef USHORT HBA_UINT16; -typedef UCHAR HBA_UINT8; -typedef signed char HBA_INT8; - -typedef HBA_UINT32 HBA_HANDLE; - -typedef HBA_UINT32 HBA_STATUS; - -#define HBA_STATUS_OK 0 - -#define HBA_STATUS_ERROR 1 /* Error */ -#define HBA_STATUS_ERROR_NOT_SUPPORTED 2 /* Function not supported.*/ -#define HBA_STATUS_ERROR_INVALID_HANDLE 3 /* invalid handle */ -#define HBA_STATUS_ERROR_ARG 4 /* Bad argument */ -#define HBA_STATUS_ERROR_ILLEGAL_WWN 5 /* WWN not recognized */ -#define HBA_STATUS_ERROR_ILLEGAL_INDEX 6 /* Index not recognized */ -#define HBA_STATUS_ERROR_MORE_DATA 7 /* Larger buffer required */ - -/* Information has changed since the last call to HBA_RefreshInformation */ -#define HBA_STATUS_ERROR_STALE_DATA 8 - -/* SCSI Check Condition reported*/ -#define HBA_STATUS_SCSI_CHECK_CONDITION 9 - -/* Adapter busy or reserved, retry may be effective*/ -#define HBA_STATUS_ERROR_BUSY 10 - -/* Request timed out, retry may be effective */ -#define HBA_STATUS_ERROR_TRY_AGAIN 11 - -/* Referenced HBA has been removed or deactivated */ -#define HBA_STATUS_ERROR_UNAVAILABLE 12 - -/* The requested ELS was rejected by the local adapter */ -#define HBA_STATUS_ERROR_ELS_REJECT 13 - -/* The specified LUN is not provided by the specified adapter */ -#define HBA_STATUS_ERROR_INVALID_LUN 14 - -/* An incompatibility has been detected among the library and driver modules */ -/* invoked which will cause one or more functions in the highest version */ -/* that all support to operate incorrectly. */ -/* The differing function sets of software modules implementing different */ -/* versions of the HBA API specification does not in itself constitute an */ -/* incompatibility. */ -/* Known interoperability bugs among supposedly compatible versions */ -/* should be reported as incompatibilities, */ -/* but not all such interoperability bugs may be known. */ -/* This value may be returned by any function which calls a */ -/* Vendor Specific Library, and by HBA_LoadLibrary and HBA_GetAdapterName. */ - -#define HBA_STATUS_ERROR_INCOMPATIBLE 15 - - -/* Multiple adapters have a matching WWN. */ -/* This could occur if the NodeWWN of multiple adapters is identical. */ -#define HBA_STATUS_ERROR_AMBIGUOUS_WWN 16 - -/* A persistent binding request included a bad local SCSI bus number */ -#define HBA_STATUS_ERROR_LOCAL_BUS 17 - -/* A persistent binding request included a bad local SCSI target number */ -#define HBA_STATUS_ERROR_LOCAL_TARGET 18 - -/* A persistent binding request included a bad local SCSI logical unit number */ -#define HBA_STATUS_ERROR_LOCAL_LUN 19 - -/* A persistent binding set request included */ -/* a local SCSI ID that was already bound */ -#define HBA_STATUS_ERROR_LOCAL_SCSIID_BOUND 20 - -/* A persistent binding request included a bad or unlocatable FCP Target FCID */ -#define HBA_STATUS_ERROR_TARGET_FCID 21 - -/* A persistent binding request included a bad FCP Target Node WWN */ -#define HBA_STATUS_ERROR_TARGET_NODE_WWN 22 - -/* A persistent binding request included a bad FCP Target Port WWN */ -#define HBA_STATUS_ERROR_TARGET_PORT_WWN 23 - -/* A persistent binding request included */ -/* an FCP Logical Unit Number not defined by the identified Target*/ -#define HBA_STATUS_ERROR_TARGET_LUN 24 - -/* A persistent binding request included */ -/* an undefined or otherwise inaccessible Logical Unit Unique Identifier */ -#define HBA_STATUS_ERROR_TARGET_LUID 25 - -/* A persistent binding remove request included */ -/* a binding which did not match a binding established by the specified port */ -#define HBA_STATUS_ERROR_NO_SUCH_BINDING 26 - -/* A SCSI command was requested to an Nx_Port that was not a SCSI Target Port */ -#define HBA_STATUS_ERROR_NOT_A_TARGET 27 - -/* A request was made concerning an unsupported FC-4 protocol */ -#define HBA_STATUS_ERROR_UNSUPPORTED_FC4 28 - -/* A request was made to enable unimplemented capabilities for a port */ -#define HBA_STATUS_ERROR_INCAPABLE 29 - -/* A SCSI function was rejected to prevent causing */ -/* a SCSI overlapped command condition (see SAM-3) */ -#define HBA_STATUS_ERROR_TARGET_BUSY 30 - -/* A call was made to HBA_FreeLibrary when no library was loaded */ -#define HBA_STATUS_ERROR_NOT_LOADED 31 - -/* A call was made to HBA_LoadLibrary when a library was already loaded */ -#define HBA_STATUS_ERROR_ALREADY_LOADED 32 - -/* The Address Identifier specified in a call to HBA_SendRNIDV2 */ -/* violates access control rules for that call */ -#define HBA_STATUS_ERROR_ILLEGAL_FCID 33 - -#define HBA_STATUS_ERROR_NOT_ASCSIDEVICE 34 - -#define HBA_STATUS_ERROR_INVALID_PROTOCOL_TYPE 35 - -#define HBA_STATUS_ERROR_BAD_EVENT_TYPE 36 - - -typedef HBA_UINT8 HBA_BOOLEAN; /* Use this for a single true/false flag */ - -typedef HBA_UINT32 HBA_PORTTYPE; - -#define HBA_PORTTYPE_UNKNOWN 1 /* Unknown */ -#define HBA_PORTTYPE_OTHER 2 /* Other */ -#define HBA_PORTTYPE_NOTPRESENT 3 /* Not present */ -#define HBA_PORTTYPE_NPORT 5 /* Fabric */ -#define HBA_PORTTYPE_NLPORT 6 /* Public Loop */ -#define HBA_PORTTYPE_FLPORT 7 /* Fabric on a Loop */ -#define HBA_PORTTYPE_FPORT 8 /* Fabric Port */ -#define HBA_PORTTYPE_EPORT 9 /* Fabric expansion port */ // obsolete? -#define HBA_PORTTYPE_GPORT 10 /* Generic Fabric Port */ // obsolete? -#define HBA_PORTTYPE_LPORT 20 /* Private Loop */ -#define HBA_PORTTYPE_PTP 21 /* Point to Point */ -#define HBA_PORTTYPE_SASDEVICE 30 /* SAS (SSP or STP) */ -#define HBA_PORTTYPE_SATADEVICE 31 /* SATA Device, i.e. Direct Attach SATA */ -#define HBA_PORTTYPE_SASEXPANDER 32 /* SAS Expander */ - -typedef HBA_UINT32 HBA_PORTSTATE; -#define HBA_PORTSTATE_UNKNOWN 1 /* Unknown */ -#define HBA_PORTSTATE_ONLINE 2 /* Operational */ -#define HBA_PORTSTATE_OFFLINE 3 /* User Offline */ -#define HBA_PORTSTATE_BYPASSED 4 /* Bypassed */ -#define HBA_PORTSTATE_DIAGNOSTICS 5 /* In diagnostics mode */ -#define HBA_PORTSTATE_LINKDOWN 6 /* Link Down */ -#define HBA_PORTSTATE_ERROR 7 /* Port Error */ -#define HBA_PORTSTATE_LOOPBACK 8 /* Loopback */ -#define HBA_PORTSTATE_DEGRADED 9 /* Degraded, but Operational mode */ - -typedef HBA_UINT32 HBA_PORTSPEED; -typedef HBA_UINT32 HBA_FCPHYSPEED, HBA_SASPHYSPEED, HBA_PHYSPEED; - -#define HBA_PORTSPEED_UNKNOWN 0 /* Unknown - transceiver incapable */ - /* of reporting */ -#define HBA_PORTSPEED_1GBIT 1 /* 1 GBit/sec */ -#define HBA_PORTSPEED_2GBIT 2 /* 2 GBit/sec */ -#define HBA_PORTSPEED_10GBIT 4 /* 10 GBit/sec */ -#define HBA_PORTSPEED_4GBIT 8 /* 4 GBit/sec */ - - -#define HBA_FCSPEED_UNKNOWN 0 /* Unknown - transceiver incapable */ - /* of reporting */ -#define HBA_FCPHYSPEED_8GBIT 16 /* 8 GBit/sec */ -#define HBA_FCPHYSPEED_16GBIT 32 /* 16 GBit/sec */ - -#define HBA_PORTSPEED_NOT_NEGOTIATED (1 << 15) /* Speed not established */ - - -typedef HBA_UINT8 HBA_FCPHYTYPE; - -#define HBA_FCPHYTYPE_UNKNOWN 1 /* Unknown Phy type */ -#define HBA_FCPHYTYPE_OPTICAL 2 /* Optical Phy */ -#define HBA_FCPHYTYPE_COPPER 4 /* Copper Phy */ - - -#define HBA_SASSTATE_UNKNOWN 0x00 /* Phy is enabled. Speed is unknown */ -#define HBA_SASSTATE_DISABLED 0x01 /* Phy is disabled. */ - -#define HBA_SASSTATE_FAILED 0x02 /* Phy is enabled. But failed speed */ - /* negotiation. */ - -#define HBA_SASSTATE_SATASPINUP 0x03 /* Phy is enabled. Detected a SATA */ - /* device and entered the SATA Spinup */ - /* hold state */ - -#define HBA_SASSTATE_SATAPORTSEL 0x04 /* The phy is attached to a */ - /* Port Selector (see SATA-2.5). */ - -#define HBA_SASSPEED_1_5GBIT 0x08 /* 1.5 GBit/sec */ -#define HBA_SASSPEED_3GBIT 0x09 /* 3 GBit/sec */ - - -typedef struct HBA_wwn { - HBA_UINT8 wwn[8]; -} HBA_WWN, *PHBA_WWN; - - -typedef struct SMHBA_FC_Phy { - HBA_FCPHYSPEED PhySupportSpeed; /* PhySupportedSpeed */ - HBA_FCPHYSPEED PhySpeed; /* PhySpeed */ - HBA_FCPHYTYPE PhyType; - HBA_UINT32 MaxFrameSize; /* MaxFrameSize */ -} SMHBA_FC_PHY, *PSMHBA_FC_PHY; - -typedef struct SMHBA_SAS_Phy { - HBA_UINT8 PhyIdentifier; - HBA_SASPHYSPEED NegotiatedLinkRate; - HBA_SASPHYSPEED ProgrammedMinLinkRate; - HBA_SASPHYSPEED HardwareMinLinkRate; - HBA_SASPHYSPEED ProgrammedMaxLinkRate; - HBA_SASPHYSPEED HardwareMaxLinkRate; - HBA_WWN domainPortWWN; -} SMHBA_SAS_PHY, *PSMHBA_SAS_PHY; - - - -typedef HBA_UINT32 HBA_COS; - -typedef struct HBA_fc4types { - HBA_UINT8 bits[32]; /* See FC-4 TYPEs - Format in FC-GS-4 */ -} HBA_FC4TYPES, *PHBA_FC4TYPES; - -typedef struct HBA_ipaddress { - int ipversion; // see enumerations in RNID - union - { - unsigned char ipv4address[4]; - unsigned char ipv6address[16]; - } ipaddress; -} HBA_IPADDRESS, *PHBA_IPADDRESS; - -typedef struct HBA_AdapterAttributes { - char Manufacturer[64]; - char SerialNumber[64]; - char Model[256]; - char ModelDescription[256]; - HBA_WWN NodeWWN; - char NodeSymbolicName[256]; /* From GS-2 */ - char HardwareVersion[256]; /* Vendor use */ - char DriverVersion[256]; /* Vendor use */ - char OptionROMVersion[256]; /* Vendor use - i.e. hardware boot ROM*/ - char FirmwareVersion[256]; /* Vendor use */ - HBA_UINT32 VendorSpecificID; /* Vendor specific */ - HBA_UINT32 NumberOfPorts; - char DriverName[256]; /* Binary path and/or name of driver file. */ -} HBA_ADAPTERATTRIBUTES, *PHBA_ADAPTERATTRIBUTES; - - -typedef struct SMHBA_AdapterAttributes { - char Manufacturer[64]; - char SerialNumber[64]; - char Model[256]; - char ModelDescription[256]; - char HardwareVersion[256]; - char DriverVersion[256]; - char OptionROMVersion[256]; - char FirmwareVersion[256]; - HBA_UINT32 VendorSpecificID; - char DriverName[256]; - char HBASymbolicName[256]; - char RedundantOptionROMVersion[256]; - char RedundantFirmwareVersion[256]; -} SMHBA_ADAPTERATTRIBUTES, *PSMHBA_ADAPTERATTRIBUTES; - - -typedef struct HBA_PortAttributes { - HBA_WWN NodeWWN; - HBA_WWN PortWWN; - HBA_UINT32 PortFcId; - HBA_PORTTYPE PortType; /*PTP, Fabric, etc. */ - HBA_PORTSTATE PortState; - HBA_COS PortSupportedClassofService; - HBA_FC4TYPES PortSupportedFc4Types; - HBA_FC4TYPES PortActiveFc4Types; - char PortSymbolicName[256]; - char OSDeviceName[256]; - HBA_PORTSPEED PortSupportedSpeed; - HBA_PORTSPEED PortSpeed; - HBA_UINT32 PortMaxFrameSize; - HBA_WWN FabricName; - HBA_UINT32 NumberofDiscoveredPorts; -} HBA_PORTATTRIBUTES, *PHBA_PORTATTRIBUTES; - - -typedef HBA_UINT32 HBA_SASPORTPROTOCOL; - -#define HBA_SASPORTPROTOCOL_SSP 1 /* Serial Attached SCSI Port */ -#define HBA_SASPORTPROTOCOL_STP 2 /* Serial ATA Tunneling Protocol Port */ -#define HBA_SASPORTPROTOCOL_SMP 4 /* Serial Management Protocol Port */ -#define HBA_SASPORTPROTOCOL_SATA 8 /* SATA Device, Direct Attached or */ - /* anywhere in the domain */ - - -typedef struct SMHBA_FC_Port { - HBA_WWN NodeWWN; - HBA_WWN PortWWN; - HBA_UINT32 FcId; - HBA_COS PortSupportedClassofService; - HBA_FC4TYPES PortSupportedFc4Types; - HBA_FC4TYPES PortActiveFc4Types; - HBA_WWN FabricName; - char PortSymbolicName[256]; - HBA_UINT32 NumberofDiscoveredPorts; - HBA_UINT8 NumberofPhys; -} SMHBA_FC_PORT, *PSMHBA_FC_PORT; - -typedef struct SMHBA_SAS_Port { - HBA_SASPORTPROTOCOL PortProtocol; - HBA_WWN LocalSASAddress; - HBA_WWN AttachedSASAddress; - HBA_UINT32 NumberofDiscoveredPorts; - HBA_UINT32 NumberofPhys; -} SMHBA_SAS_PORT, *PSMHBA_SAS_PORT; - -typedef union SMHBA_Port { - SMHBA_FC_PORT *FCPort; - SMHBA_SAS_PORT *SASPort; -} SMHBA_PORT, *PSMHBA_PORT; - -typedef struct SMHBA_PortAttributes { - HBA_PORTTYPE PortType; - HBA_PORTSTATE PortState; - char OSDeviceName[256]; - SMHBA_PORT PortSpecificAttribute; -} SMHBA_PORTATTRIBUTES, *PSMHBA_PORTATTRIBUTES; - - -/* Statistical counters for FC-0, FC-1 and FC-2 */ - -typedef struct HBA_PortStatistics { - HBA_INT64 SecondsSinceLastReset; - HBA_INT64 TxFrames; - HBA_INT64 TxWords; - HBA_INT64 RxFrames; - HBA_INT64 RxWords; - HBA_INT64 LIPCount; - HBA_INT64 NOSCount; - HBA_INT64 ErrorFrames; - HBA_INT64 DumpedFrames; - HBA_INT64 LinkFailureCount; - HBA_INT64 LossOfSyncCount; - HBA_INT64 LossOfSignalCount; - HBA_INT64 PrimitiveSeqProtocolErrCount; - HBA_INT64 InvalidTxWordCount; - HBA_INT64 InvalidCRCCount; -} HBA_PORTSTATISTICS, *PHBA_PORTSTATISTICS; - - -/* Statistical counters for FC-4 protocols */ - -typedef struct HBA_FC4Statistics { - HBA_INT64 InputRequests; - HBA_INT64 OutputRequests; - HBA_INT64 ControlRequests; - HBA_INT64 InputMegabytes; - HBA_INT64 OutputMegabytes; -} HBA_FC4STATISTICS, *PHBA_FC4STATISTICS; - - -/* Statistical counters for FC-4, SSP, STP, SMP protocols */ - -typedef struct SMHBA_ProtocolStatistics { - HBA_INT64 SecondsSinceLastReset; - HBA_INT64 InputRequests; - HBA_INT64 OutputRequests; - HBA_INT64 ControlRequests; - HBA_INT64 InputMegabytes; - HBA_INT64 OutputMegabytes; -} SMHBA_PROTOCOLSTATISTICS, *PSMHBA_PROTOCOLSTATISTICS; - - -typedef struct SMHBA_SASPhyStatistics { - HBA_INT64 SecondsSinceLastReset; - HBA_INT64 TxFrames; - HBA_INT64 TxWords; - HBA_INT64 RxFrames; - HBA_INT64 RxWords; - HBA_INT64 InvalidDwordCount; - HBA_INT64 RunningDisparityErrorCount; - HBA_INT64 LossofDwordSyncCount; - HBA_INT64 PhyResetProblemCount; -} SMHBA_SASPHYSTATISTICS, *PSMHBA_SASPHYSTATISTICS; - - -/* Statistical counters for FC-0, FC-1, and FC-2 */ - -typedef HBA_PORTSTATISTICS SMHBA_FCPHYSTATISTICS, *PSMHBA_FCPHYSTATISTICS; - -typedef union SMHBA_PhyStatistics { - SMHBA_SASPHYSTATISTICS *SASPhyStatistics; - SMHBA_FCPHYSTATISTICS *FCPhyStatistics; -} SMHBA_PHYSTATISTICS, *PSMHBA_PHYSTATISTICS; - - - -/* HBA_FCPBINDINGTYPE was used in Rev 1.0. Add TO_OTHER for older calls to - indicate other binding types for HBA_GetPersistentBinding. To support - multiple types a new flag has been created to allow for multiple bindings - supported */ - -typedef enum HBA_fcpbindingtype { TO_D_ID, TO_WWN, TO_OTHER } HBA_FCPBINDINGTYPE; - - -/* A bit mask of Rev 2.0 persistent binding capabilities */ - -typedef HBA_UINT32 HBA_BIND_CAPABILITY; - -/* The following are bit flags indicating persistent binding capabilities */ - -#define HBA_CAN_BIND_TO_D_ID 0x0001 -#define HBA_CAN_BIND_TO_WWPN 0x0002 -#define HBA_CAN_BIND_TO_WWNN 0x0004 -#define HBA_CAN_BIND_TO_LUID 0x0008 -#define HBA_CAN_BIND_ANY_LUNS 0x0400 -#define HBA_CAN_BIND_TARGETS 0x0800 -#define HBA_CAN_BIND_AUTOMAP 0x1000 -#define HBA_CAN_BIND_CONFIGURED 0x2000 - -/* A bit mask of Rev 2.0 persistent binding setting types */ - -typedef HBA_UINT32 HBA_BIND_TYPE; - -/* The following are bit flags indicating persistent binding setting types */ - -#define HBA_BIND_TO_D_ID 0x0001 -#define HBA_BIND_TO_WWPN 0x0002 -#define HBA_BIND_TO_WWNN 0x0004 -#define HBA_BIND_TO_LUID 0x0008 -#define HBA_BIND_TARGETS 0x0800 - -typedef struct HBA_LUID { - char buffer[256]; -} HBA_LUID, *PHBA_LUID; - -typedef struct HBA_ScsiId { - char OSDeviceName[256]; /* \device\ScsiPort3 */ - HBA_UINT32 ScsiBusNumber; /* Bus on the HBA */ - HBA_UINT32 ScsiTargetNumber; /* SCSI Target ID to OS */ - HBA_UINT32 ScsiOSLun; -} HBA_SCSIID, *PHBA_SCSIID; - -typedef struct HBA_FcpId { - HBA_UINT32 FcId; - HBA_WWN NodeWWN; - HBA_WWN PortWWN; - HBA_UINT64 FcpLun; -} HBA_FCPID, *PHBA_FCPID; - -typedef struct HBA_FcpScsiEntry { - HBA_SCSIID ScsiId; - HBA_FCPID FcpId; -} HBA_FCPSCSIENTRY, *PHBA_FCPSCSIENTRY; - -typedef struct HBA_FcpScsiEntryV2 { - HBA_SCSIID ScsiId; - HBA_FCPID FcpId; - HBA_LUID LUID; -} HBA_FCPSCSIENTRYV2, *PHBA_FCPSCSIENTRYV2; - -typedef struct HBA_FCPTargetMapping { - HBA_UINT32 NumberOfEntries; - HBA_FCPSCSIENTRY entry[1]; /* Variable length array containing mappings*/ -} HBA_FCPTARGETMAPPING, *PHBA_FCPTARGETMAPPING; - -typedef struct HBA_FCPTargetMappingV2 { - HBA_UINT32 NumberOfEntries; - HBA_FCPSCSIENTRYV2 entry[1]; /* Variable length array containing mappings*/ -} HBA_FCPTARGETMAPPINGV2, *PHBA_FCPTARGETMAPPINGV2; - - -typedef struct HBA_FCPBindingEntry { - HBA_FCPBINDINGTYPE type; - HBA_SCSIID ScsiId; - HBA_FCPID FcpId; - HBA_UINT32 FcId; -} HBA_FCPBINDINGENTRY, *PHBA_FCPBINDINGENTRY; - -typedef struct HBA_FCPBinding { - HBA_UINT32 NumberOfEntries; - HBA_FCPBINDINGENTRY entry[1]; /* Variable length array */ -} HBA_FCPBINDING, *PHBA_FCPBINDING; - -typedef struct HBA_FCPBindingEntry2 { - HBA_BIND_TYPE type; - HBA_SCSIID ScsiId; - HBA_FCPID FcpId; - HBA_LUID LUID; - HBA_STATUS Status; -} HBA_FCPBINDINGENTRY2, *PHBA_FCPBINDINGENTRY2; - -typedef struct HBA_FCPBinding2 { - HBA_UINT32 NumberOfEntries; - HBA_FCPBINDINGENTRY2 entry[1]; /* Variable length array */ -} HBA_FCPBINDING2, *PHBA_FCPBINDING2; - - -typedef HBA_UINT32 SMHBA_BIND_CAPABILITY; - -#define SMHBA_CAN_BIND_TO_WWPN 0x0001 -#define SMHBA_CAN_BIND_TO_LUID 0x0002 -#define SMHBA_CAN_BIND_ANY_LUNS 0x0400 -#define SMHBA_CAN_BIND_AUTOMAP 0x0800 - -typedef HBA_UINT32 SMHBA_BIND_TYPE; - -#define SMHBA_BIND_TO_WWPN 0x0001 -#define SMHBA_BIND_TO_LUID 0x0002 - -typedef struct SMHBA_ScsiId { - char OSDeviceName[256]; - HBA_UINT32 ScsiBusNumber; - HBA_UINT32 ScsiTargetNumber; - HBA_UINT32 ScsiOSLun; -} SMHBA_SCSIID, *PSMHBA_SCSIID; - -typedef struct SMHBA_LUID { - char buffer[256]; -} SMHBA_LUID, *PSMHBA_LUID; - -typedef HBA_UINT64 HBA_SCSILUN; - -typedef struct SMHBA_SCSILUN { - HBA_UINT8 lun[8]; -} SMHBA_SCSILUN; - -typedef struct SMHBA_PORTLUN { - HBA_WWN PortWWN; - HBA_WWN domainPortWWN; - HBA_SCSILUN TargetLun; -} SMHBA_PORTLUN, *PSMHBA_PORTLUN; - -typedef struct SMHBA_ScsiEntry { - SMHBA_SCSIID ScsiId; - SMHBA_PORTLUN PortLun; - SMHBA_LUID LUID; -} SMHBA_SCSIENTRY, *PSMHBA_SCSIENTRY; - -typedef struct SMHBA_TargetMapping { - HBA_UINT32 NumberOfEntries; - SMHBA_SCSIENTRY entry[1]; /* Variable length array containing mappings*/ -} SMHBA_TARGETMAPPING, *PSMHBA_TARGETMAPPING; - -typedef struct SMHBA_BindingEntry { - SMHBA_BIND_TYPE type; - SMHBA_SCSIID ScsiId; - SMHBA_PORTLUN PortLun; - SMHBA_LUID LUID; - HBA_STATUS Status; -} SMHBA_BINDINGENTRY, *PSMHBA_BINDINGENTRY; - -typedef struct SMHBA_Binding { - HBA_UINT32 NumberOfEntries; - SMHBA_BINDINGENTRY entry[1]; /* Variable length array */ -} SMHBA_BINDING, *PSMHBA_BINDING; - - -typedef enum HBA_wwntype { NODE_WWN, PORT_WWN } HBA_WWNTYPE; - -typedef struct HBA_MgmtInfo { - HBA_WWN wwn; - HBA_UINT32 unittype; - HBA_UINT32 PortId; - HBA_UINT32 NumberOfAttachedNodes; - HBA_UINT16 IPVersion; - HBA_UINT16 UDPPort; - HBA_UINT8 IPAddress[16]; - HBA_UINT16 reserved; - HBA_UINT16 TopologyDiscoveryFlags; -} HBA_MGMTINFO, *PHBA_MGMTINFO; - -#define HBA_EVENT_LIP_OCCURRED 1 -#define HBA_EVENT_LINK_UP 2 -#define HBA_EVENT_LINK_DOWN 3 -#define HBA_EVENT_LIP_RESET_OCCURRED 4 -#define HBA_EVENT_RSCN 5 -#define HBA_EVENT_PROPRIETARY 0xFFFF - -typedef struct HBA_Link_EventInfo { - HBA_UINT32 PortFcId; /* Port which this event occurred */ - HBA_UINT32 Reserved[3]; -} HBA_LINK_EVENTINFO, *PHBA_LINK_EVENTINFO; - -typedef struct HBA_RSCN_EventInfo { - HBA_UINT32 PortFcId; /* Port which this event occurred */ - HBA_UINT32 NPortPage; /* Reference FC-FS for RSCN ELS "Affected N-Port Pages"*/ - HBA_UINT32 Reserved[2]; -} HBA_RSCN_EVENTINFO, *PHBA_RSCN_EVENTINFO; - -typedef struct HBA_Pty_EventInfo { - HBA_UINT32 PtyData[4]; /* Proprietary data */ -} HBA_PTY_EVENTINFO, *PHBA_PTY_EVENTINFO; - -typedef struct HBA_EventInfo { - HBA_UINT32 EventCode; - union { - HBA_LINK_EVENTINFO Link_EventInfo; - HBA_RSCN_EVENTINFO RSCN_EventInfo; - HBA_PTY_EVENTINFO Pty_EventInfo; - } Event; -} HBA_EVENTINFO, *PHBA_EVENTINFO; - -typedef PVOID PHBA_ENTRYPOINTS; -typedef PVOID PHBA_ENTRYPOINTSV2; -typedef PVOID PSMHBA_ENTRYPOINTS; - -HBA_STATUS HBA_API HBA_RegisterLibrary(PHBA_ENTRYPOINTS entrypoints); -HBA_STATUS HBA_API HBA_RegisterLibraryV2(PHBA_ENTRYPOINTSV2 entrypoints); - - -HBA_UINT32 HBA_API HBA_GetVersion(); -HBA_STATUS HBA_API HBA_LoadLibrary(); -HBA_STATUS HBA_API HBA_FreeLibrary(); - - -HBA_UINT32 HBA_API HBA_GetNumberOfAdapters(); - -HBA_STATUS HBA_API -HBA_GetAdapterName( - __in HBA_UINT32 AdapterIndex, - __inout_ecount(MAX_NAME) PCHAR AdapterName - ); - -HBA_HANDLE HBA_API -HBA_OpenAdapter( - __in PSTR AdapterName - ); - -void HBA_API -HBA_CloseAdapter( - IN HBA_HANDLE handle - ); - -HBA_STATUS HBA_API -HBA_GetAdapterAttributes( - IN HBA_HANDLE Handle, - OUT HBA_ADAPTERATTRIBUTES *HbaAttributes - ); - -HBA_STATUS HBA_API -HBA_GetAdapterPortAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - OUT HBA_PORTATTRIBUTES *PortAttributes - ); - - -HBA_STATUS HBA_API -HBA_GetPortStatistics( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - OUT HBA_PORTSTATISTICS *PortStatistics - ); - -HBA_STATUS HBA_API -HBA_GetDiscoveredPortAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 DiscoveredPortIndex, - OUT HBA_PORTATTRIBUTES *PortAttributes - ); - -HBA_STATUS HBA_API -HBA_GetPortAttributesByWWN( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - OUT HBA_PORTATTRIBUTES *PortAttributes - ); - - -HBA_STATUS HBA_API -HBA_SendCTPassThru( - IN HBA_HANDLE Handle, - IN void *pReqBuffer, - IN HBA_UINT32 ReqBufferSize, - OUT void *pRspBuffer, - IN HBA_UINT32 RspBufferSize - ); - -HBA_STATUS HBA_API -HBA_GetEventBuffer( - IN HBA_HANDLE Handle, - OUT PHBA_EVENTINFO EventBuffer, - IN OUT HBA_UINT32 *EventCount - ); - -HBA_STATUS HBA_API -HBA_SetRNIDMgmtInfo( - IN HBA_HANDLE Handle, - IN HBA_MGMTINFO *pInfo - ); - -HBA_STATUS HBA_API -HBA_GetRNIDMgmtInfo( - IN HBA_HANDLE Handle, - OUT HBA_MGMTINFO *pInfo - ); - -HBA_STATUS HBA_API -HBA_SendRNID( - IN HBA_HANDLE Handle, - IN HBA_WWN Wwn, - IN HBA_WWNTYPE WnnType, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *RspBufferSize - ); - -HBA_STATUS HBA_API -HBA_GetFcpTargetMapping( - IN HBA_HANDLE Handle, - IN OUT PHBA_FCPTARGETMAPPING Mapping - ); - -HBA_STATUS HBA_API -HBA_GetFcpPersistentBinding( - IN HBA_HANDLE Handle, - IN OUT PHBA_FCPBINDING Binding - ); - -HBA_STATUS HBA_API -HBA_SendScsiInquiry( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT64 FcLUN, - IN HBA_UINT8 EVPD, - IN HBA_UINT32 PageCode, - OUT void *pRspBuffer, - IN HBA_UINT32 RspBufferSize, - OUT void *pSenseBuffer, - IN HBA_UINT32 SenseBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendReportLUNs( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - OUT void *pRspBuffer, - IN HBA_UINT32 RspBufferSize, - OUT void *pSenseBuffer, - IN HBA_UINT32 SenseBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendReadCapacity( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT64 FcLUN, - OUT void *pRspBuffer, - IN HBA_UINT32 RspBufferSize, - OUT void *pSenseBuffer, - IN HBA_UINT32 SenseBufferSize - ); - -void HBA_API -HBA_RefreshInformation( - IN HBA_HANDLE Handle - ); - -void HBA_API -HBA_ResetStatistics( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex - ); - - -typedef void *HBA_CALLBACKHANDLE; - -typedef HBA_CALLBACKHANDLE *PHBA_CALLBACKHANDLE; - -/* Adapter Level Events */ -#define HBA_EVENT_ADAPTER_UNKNOWN 0x100 -#define HBA_EVENT_ADAPTER_ADD 0x101 -#define HBA_EVENT_ADAPTER_REMOVE 0x102 -#define HBA_EVENT_ADAPTER_CHANGE 0x103 - -/* Port Level Events */ -#define HBA_EVENT_PORT_UNKNOWN 0x200 -#define HBA_EVENT_PORT_OFFLINE 0x201 -#define HBA_EVENT_PORT_ONLINE 0x202 -#define HBA_EVENT_PORT_NEW_TARGETS 0x203 -#define HBA_EVENT_PORT_FABRIC 0x204 -#define HBA_EVENT_PORT_BROADCAST_CHANGE 0x205 -#define HBA_EVENT_PORT_BROADCAST_D24_0 0x206 -#define HBA_EVENT_PORT_BROADCAST_D27_4 0x207 -#define HBA_EVENT_PORT_BROADCAST_SES 0x208 -#define HBA_EVENT_PORT_BROADCAST_D01_4 0x209 -#define HBA_EVENT_PORT_BROADCAST_D04_7 0x20a -#define HBA_EVENT_PORT_BROADCAST_D16_7 0x20b -#define HBA_EVENT_PORT_BROADCAST_D29_7 0x20c -#define HBA_EVENT_PORT_ALL 0x2ff - -/* Port Statistics Events */ -#define HBA_EVENT_PORT_STAT_THRESHOLD 0x301 -#define HBA_EVENT_PORT_STAT_GROWTH 0x302 - -/* Phy Statistics Events */ -#define HBA_EVENT_PHY_STAT_THRESHOLD 0x351 -#define HBA_EVENT_PHY_STAT_GROWTH 0x352 - -/* Target Level Events */ -#define HBA_EVENT_TARGET_UNKNOWN 0x400 -#define HBA_EVENT_TARGET_OFFLINE 0x401 -#define HBA_EVENT_TARGET_ONLINE 0x402 -#define HBA_EVENT_TARGET_REMOVED 0x403 - -/* Fabric Link Events */ -#define HBA_EVENT_LINK_UNKNOWN 0x500 -#define HBA_EVENT_LINK_INCIDENT 0x501 - -HBA_STATUS HBA_API -HBA_RemoveCallback( - IN HBA_CALLBACKHANDLE callbackHandle - ); - -HBA_STATUS HBA_API -HBA_RegisterForAdapterAddEvents( - IN void (*callback) (void *pData, HBA_WWN PortWWN, HBA_UINT32 eventType), - IN void *pUserData, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -HBA_RegisterForAdapterEvents( - IN void (*callback) (void *pData, HBA_WWN PortWWN, HBA_UINT32 eventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -HBA_RegisterForAdapterPortEvents( - IN void (*callback) (void *pData, - HBA_WWN PortWWN, - HBA_UINT32 eventType, - HBA_UINT32 fabricPortID), - IN void *UserData, - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -HBA_RegisterForAdapterPortStatEvents( - IN void (*callback)(void *pData, - HBA_WWN PortWWN, - HBA_UINT32 eventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_PORTSTATISTICS stats, - IN HBA_UINT32 statType, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -HBA_RegisterForTargetEvents( - IN void (*callback)(void *pData, - HBA_WWN hbaPortWWN, - HBA_WWN discoveredPortWWN, - HBA_UINT32 eventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - OUT HBA_CALLBACKHANDLE *pCallbackHandle, - IN HBA_UINT32 AllTargets - ); - -HBA_STATUS HBA_API -HBA_RegisterForLinkEvents( - IN void (*callback)(void *data, HBA_WWN adapterWWN, HBA_UINT32 eventType, - void *pRLIRBuffer, HBA_UINT32 RLIRBufferSize), - IN void *userData, - IN void *pRLIRBuffer, - IN HBA_UINT32 RLIRBufferSize, - IN HBA_HANDLE Handle, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - - -HBA_STATUS HBA_API -HBA_OpenAdapterByWWN( - OUT HBA_HANDLE *HbaHandle, - IN HBA_WWN Wwn - ); - -void HBA_API -HBA_RefreshAdapterConfiguration( - ); - -HBA_STATUS HBA_API -HBA_SendCTPassThruV2( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN void *pReqBuffer, - IN HBA_UINT32 ReqBufferSize, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendRNIDV2( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DestWWN, - IN HBA_UINT32 DestFCID, - IN HBA_UINT32 NodeIdDataFormat, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendRPL( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN Agent_wwn, - IN HBA_UINT32 Agent_domain, - IN HBA_UINT32 PortIndex, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendRPS( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN Agent_wwn, - IN HBA_UINT32 Agent_domain, - IN HBA_WWN Object_wwn, - IN HBA_UINT32 Object_port_number, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendSRL( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN Wwn, - IN HBA_UINT32 Domain, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendLIRR( - IN HBA_HANDLE Handle, - IN HBA_WWN SourceWWN, - IN HBA_WWN DestWWN, - IN HBA_UINT8 Function, - IN HBA_UINT8 Type, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - -HBA_STATUS HBA_API -HBA_SendRLS( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DestWWN, - OUT void *pRspBuffer, - IN OUT HBA_UINT32 *pRspBufferSize - ); - - -HBA_STATUS HBA_API -HBA_GetFC4Statistics( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT8 FC4type, - OUT HBA_FC4STATISTICS *Statistics - ); - -HBA_STATUS HBA_API -HBA_GetFCPStatistics( - IN HBA_HANDLE Handle, - IN const HBA_SCSIID *Lunit, - OUT HBA_FC4STATISTICS *Statistics - ); - - - -typedef struct HBA_LibraryAttributes { - HBA_BOOLEAN final; - char LibPath[256]; - char VName[256]; - char VVersion[256]; - struct tm build_date; -} HBA_LIBRARYATTRIBUTES, *PHBA_LIBRARYATTRIBUTES; - -typedef struct SMHBA_LibraryAttributes { - char LibPath[256]; - char VName[256]; - char VVersion[256]; - struct { - int tm_mday; /* day of the month - [1,31] */ - int tm_mon; /* months since January - [0,11] */ - int tm_year; /* years since 1900 */ - } build_date; -} SMHBA_LIBRARYATTRIBUTES, *PSMHBA_LIBRARYATTRIBUTES; - - -HBA_UINT32 HBA_API -HBA_GetWrapperLibraryAttributes( - OUT HBA_LIBRARYATTRIBUTES *Attributes - ); - -HBA_UINT32 HBA_API -HBA_GetVendorLibraryAttributes( - IN HBA_UINT32 AdapterIndex, - OUT HBA_LIBRARYATTRIBUTES *Attributes - ); - - -HBA_STATUS HBA_API -HBA_ScsiReadCapacityV2( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_UINT64 FcLUN, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - -HBA_STATUS HBA_API -HBA_ScsiReportLUNsV2( - IN HBA_HANDLE Hbahandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - -HBA_STATUS HBA_API -HBA_ScsiInquiryV2 ( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_UINT64 FcLUN, - IN HBA_UINT8 CDB_Byte1, - IN HBA_UINT8 CDB_Byte2, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - - -HBA_STATUS HBA_API -HBA_GetFcpTargetMappingV2( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN OUT HBA_FCPTARGETMAPPINGV2 *Mapping - ); - -HBA_STATUS HBA_API -HBA_GetBindingCapability( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - OUT HBA_BIND_CAPABILITY *Flags - ); - -HBA_STATUS HBA_API -HBA_GetBindingSupport( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - OUT HBA_BIND_CAPABILITY *Flags - ); - -HBA_STATUS HBA_API -HBA_SetBindingSupport( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_BIND_CAPABILITY Flags - ); - - -HBA_STATUS HBA_API -HBA_GetPersistentBindingV2( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN OUT PHBA_FCPBINDING2 Binding - ); - -HBA_STATUS HBA_API -HBA_SetPersistentBindingV2( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN PHBA_FCPBINDING2 Binding - ); - -HBA_STATUS HBA_API -HBA_RemovePersistentBinding( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN PHBA_FCPBINDING2 Binding - ); - -HBA_STATUS HBA_API -HBA_RemoveAllPersistentBindings( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN - ); - - -#if 0 - -// -// stubs for unsupported SB functions -// - -typedef PVOID PHBA_SBTARGETMAPPING; - -typedef struct HBA_SBDevId { - char OSDeviceName[256]; -} HBA_SBDEVID, *PHBA_SBDEVID; - - -typedef struct HBA_Ned { - HBA_UINT32 NEDWord0; - HBA_UINT32 NelId[7]; -} HBA_NED, *PHBA_NED; - -typedef struct HBA_DeviceSelfDesc { - HBA_NED TokenNED; - HBA_NED DeviceNED; -} HBA_DEVICESELFDESC, *PHBA_DEVICESELFDESC; - -typedef PVOID PHBA_SBSTATISTICS; - -typedef struct HBA_SBDskCapacity { - HBA_INT32 SCSIFormatLBA; /* SCSI Read Capacity Format */ - HBA_INT32 SCSIFormatBlkLen; /* SCSI Read Capacity Format */ - HBA_INT32 SBDskNumberOfCylinders; /* cyls */ - HBA_INT32 SBDskTracksPerCylinder; /* tracks per cyl */ - HBA_INT32 SBDskMaxUsableTrackLen; /* usable track capcacity */ -} HBA_SBDSKCAPACITY, *PHBA_SBDSKCAPACITY; - - -HBA_STATUS HBA_API -HBA_GetSBTargetMapping( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - OUT PHBA_SBTARGETMAPPING Mapping - ); - -HBA_STATUS HBA_API -HBA_GetSBStatistics( - IN HBA_HANDLE HbaHandle, - IN const HBA_SBDEVID *Device, - OUT PHBA_SBSTATISTICS Statistics - ); - -HBA_STATUS HBA_API -HBA_SBDskGetCapacity( - IN HBA_DEVICESELFDESC DeviceSelfDesc, - OUT PHBA_SBDSKCAPACITY PSbDskCapacity - ); - -#endif - -#ifdef SM_HBA_API - -// -// SM-HBA Library Control Functions -// - -#define SMHBA_VERSION 1 - -HBA_UINT32 HBA_API SMHBA_GetVersion(); -HBA_STATUS HBA_API SMHBA_RegisterLibrary(PSMHBA_ENTRYPOINTS entrypoints); - -HBA_UINT32 HBA_API -SMHBA_GetWrapperLibraryAttributes( - OUT SMHBA_LIBRARYATTRIBUTES *Attributes - ); - -HBA_UINT32 HBA_API -SMHBA_GetVendorLibraryAttributes( - IN HBA_UINT32 AdapterIndex, - OUT SMHBA_LIBRARYATTRIBUTES *Attributes - ); - - -// -// SM-HBA Adapter, FC_Port and SAS_Port Information Functions -// - -HBA_STATUS HBA_API -SMHBA_GetProtocolStatistics( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 ProtocolType, - OUT SMHBA_PROTOCOLSTATISTICS *ProtocolStatistics - ); - -HBA_STATUS HBA_API -SMHBA_GetNumberOfPorts( - IN HBA_HANDLE Handle, - OUT HBA_UINT32 *NumberOfPorts - ); - -HBA_STATUS HBA_API -SMHBA_GetAdapterAttributes( - IN HBA_HANDLE Handle, - OUT SMHBA_ADAPTERATTRIBUTES *AdapterAttributes - ); - -HBA_STATUS HBA_API -SMHBA_GetPhyStatistics( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 PhyIndex, - OUT SMHBA_PHYSTATISTICS *PhyStatistics - ); - -HBA_STATUS HBA_API -SMHBA_GetDiscoveredPortAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 DiscoveredPortIndex, - OUT SMHBA_PORTATTRIBUTES *PortAttributes - ); - -HBA_STATUS HBA_API -SMHBA_GetPortAttributesByWWN( - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_WWN DomainPortWWN, - OUT SMHBA_PORTATTRIBUTES *PortAttributes - ); - -HBA_STATUS HBA_API -SMHBA_GetPortType( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - OUT HBA_PORTTYPE *PortType - ); - -HBA_STATUS HBA_API -SMHBA_GetAdapterPortAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - OUT SMHBA_PORTATTRIBUTES *PortAttributes - ); - -HBA_STATUS HBA_API -SMHBA_GetFCPhyAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 PhyIndex, - OUT SMHBA_FC_PHY *PhyType - ); - -HBA_STATUS HBA_API -SMHBA_GetSASPhyAttributes( - IN HBA_HANDLE Handle, - IN HBA_UINT32 PortIndex, - IN HBA_UINT32 PhyIndex, - OUT SMHBA_SAS_PHY *PhyType - ); - -// -// SM-HBA Target Information Functions -// - -HBA_STATUS HBA_API -SMHBA_GetLUNStatistics( - IN HBA_HANDLE Handle, - IN const HBA_SCSIID *Lunit, - OUT SMHBA_PROTOCOLSTATISTICS *ProtocolStatistics - ); - -HBA_STATUS HBA_API -SMHBA_GetTargetMapping( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - IN OUT SMHBA_TARGETMAPPING *Mapping - ); - -HBA_STATUS HBA_API -SMHBA_GetBindingCapability( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - OUT SMHBA_BIND_CAPABILITY *Flags - ); - -HBA_STATUS HBA_API -SMHBA_GetBindingSupport( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - OUT SMHBA_BIND_CAPABILITY *Flags - ); - -HBA_STATUS HBA_API -SMHBA_SetBindingSupport( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - IN SMHBA_BIND_CAPABILITY Flags - ); - -HBA_STATUS HBA_API -SMHBA_GetPersistentBinding( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - IN OUT SMHBA_BINDING *Binding - ); - -HBA_STATUS HBA_API -SMHBA_SetPersistentBinding( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - IN OUT SMHBA_BINDING *Binding - ); - -HBA_STATUS HBA_API -SMHBA_RemovePersistentBinding( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN, - IN const SMHBA_BINDING *Binding - ); - -HBA_STATUS HBA_API -SMHBA_RemoveAllPersistentBindings( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DomainPortWWN - ); - -// -// SCSI Information Functions -// - -HBA_STATUS HBA_API -SMHBA_ScsiInquiry( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_WWN DomainPortWWN, - IN HBA_SCSILUN SmhbaLUN, - IN HBA_UINT8 CDB_Byte1, - IN HBA_UINT8 CDB_Byte2, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - -HBA_STATUS HBA_API -SMHBA_ScsiReportLuns( - IN HBA_HANDLE Hbahandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_WWN DomainPortWWN, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - -HBA_STATUS HBA_API -SMHBA_ScsiReadCapacity( - IN HBA_HANDLE HbaHandle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_WWN DomainPortWWN, - IN HBA_SCSILUN SmhbaLUN, - OUT void *pRespBuffer, - IN OUT HBA_UINT32 *pRespBufferSize, - OUT HBA_UINT8 *pScsiStatus, - OUT void *pSenseBuffer, - IN OUT HBA_UINT32 *pSenseBufferSize - ); - -// -// Fabric and Domain Management Functions -// - -// new FC specific - -HBA_STATUS HBA_API -SMHBA_SendTEST( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DestWWN, - IN HBA_UINT32 DestFCID, - IN void *ReqBuffer, - IN HBA_UINT32 ReqBufferSize - ); - -// new FC specific - -HBA_STATUS HBA_API -SMHBA_SendECHO( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DestWWN, - IN HBA_UINT32 DestFCID, - IN void *ReqBuffer, - IN HBA_UINT32 ReqBufferSize, - OUT void *RspBuffer, - IN OUT HBA_UINT32 *RspBufferSize - ); - -// new SAS specific - -HBA_STATUS HBA_API -SMHBA_SendSMPPassThru( - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DestPortWWN, - IN HBA_WWN DomainPortWWN, - IN void *ReqBuffer, - IN HBA_UINT32 ReqBufferSize, - OUT void *RspBuffer, - IN OUT HBA_UINT32 *RspBufferSize - ); - - -// -// Event Handling Functions -// - - -HBA_STATUS HBA_API -SMHBA_RegisterForAdapterAddEvents( - IN void (*callback)(void *pData, HBA_WWN PortWWN, HBA_UINT32 eventType), - IN void *pUserData, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -SMHBA_RegisterForAdapterEvents( - IN void (*callback)(void *pData, HBA_WWN PortWWN, HBA_UINT32 eventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -SMHBA_RegisterForAdapterPortEvents( - IN void (*callback)(void *pData, - HBA_WWN PortWWN, - HBA_UINT32 eventType, - HBA_UINT32 fabricPortID), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT32 SpecificEventType, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -SMHBA_RegisterForAdapterPortStatEvents( - IN void (*callback)(void *pData, - HBA_WWN PortWWN, - HBA_UINT32 ProtocolType, - HBA_UINT32 EventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT32 ProtocolType, - IN SMHBA_PROTOCOLSTATISTICS Stats, - IN HBA_UINT32 StatType, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -SMHBA_RegisterForAdapterPhyStatEvents( - IN void (*callback)(void *pData, - HBA_WWN PortWWN, - HBA_UINT32 PhyIndex, - HBA_UINT32 EventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN PortWWN, - IN HBA_UINT32 PhyIndex, - IN SMHBA_PHYSTATISTICS Stats, - IN HBA_UINT32 StatType, - OUT HBA_CALLBACKHANDLE *pCallbackHandle - ); - -HBA_STATUS HBA_API -SMHBA_RegisterForTargetEvents( - IN void (*callback)(void *pData, - HBA_WWN HbaPortWWN, - HBA_WWN DiscoveredPortWWN, - HBA_WWN DomainPortWWN, - HBA_UINT32 EventType), - IN void *pUserData, - IN HBA_HANDLE Handle, - IN HBA_WWN HbaPortWWN, - IN HBA_WWN DiscoveredPortWWN, - IN HBA_WWN DomainPortWWN, - OUT HBA_CALLBACKHANDLE *pCallbackHandle, - IN HBA_UINT32 AllTargets - ); - -#endif // _SM_HBA_API_ - -#ifdef __cplusplus -}; -#endif - -#endif // HBAAPI_H - - diff --git a/qt-correction-tool/pub/ddk/hbapiwmi.h b/qt-correction-tool/pub/ddk/hbapiwmi.h deleted file mode 100644 index d5a2a06..0000000 --- a/qt-correction-tool/pub/ddk/hbapiwmi.h +++ /dev/null @@ -1,4369 +0,0 @@ -#ifndef _hbapiwmi_h_ -#define _hbapiwmi_h_ - -// MSFC_HBAPortStatistics - MSFC_HBAPortStatistics - - -//*************************************************************************** -// -// hbapiwmi.h -// -// Module: WDM classes to expose HBA api data from drivers -// -// Purpose: Contains WDM classes that specify the HBA data to be exposed -// via the HBA api set. -// -// NOTE: This file contains information that is based upon: -// SM-HBA Version 1.0 and FC-HBA 2.18 specification. -// -// Please specify which WMI interfaces the provider will implement by -// defining MS_SM_HBA_API or MSFC_HBA_API before including this file. -// That is: -// -// #define MS_SM_HBA_API -// #include -// -// - or - -// -// #define MSFC_HBA_API -// #include -// -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - - -#define MSFC_HBAPortStatisticsGuid \ - { 0x3ce7904f,0x459f,0x480d, { 0x9a,0x3c,0x01,0x3e,0xde,0x3b,0xdd,0xe8 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_HBAPortStatistics_GUID, \ - 0x3ce7904f,0x459f,0x480d,0x9a,0x3c,0x01,0x3e,0xde,0x3b,0xdd,0xe8); -#endif - - -typedef struct _MSFC_HBAPortStatistics -{ - // - LONGLONG SecondsSinceLastReset; - #define MSFC_HBAPortStatistics_SecondsSinceLastReset_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_SecondsSinceLastReset_ID 1 - - // - LONGLONG TxFrames; - #define MSFC_HBAPortStatistics_TxFrames_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_TxFrames_ID 2 - - // - LONGLONG TxWords; - #define MSFC_HBAPortStatistics_TxWords_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_TxWords_ID 3 - - // - LONGLONG RxFrames; - #define MSFC_HBAPortStatistics_RxFrames_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_RxFrames_ID 4 - - // - LONGLONG RxWords; - #define MSFC_HBAPortStatistics_RxWords_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_RxWords_ID 5 - - // - LONGLONG LIPCount; - #define MSFC_HBAPortStatistics_LIPCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_LIPCount_ID 6 - - // - LONGLONG NOSCount; - #define MSFC_HBAPortStatistics_NOSCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_NOSCount_ID 7 - - // - LONGLONG ErrorFrames; - #define MSFC_HBAPortStatistics_ErrorFrames_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_ErrorFrames_ID 8 - - // - LONGLONG DumpedFrames; - #define MSFC_HBAPortStatistics_DumpedFrames_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_DumpedFrames_ID 9 - - // - LONGLONG LinkFailureCount; - #define MSFC_HBAPortStatistics_LinkFailureCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_LinkFailureCount_ID 10 - - // - LONGLONG LossOfSyncCount; - #define MSFC_HBAPortStatistics_LossOfSyncCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_LossOfSyncCount_ID 11 - - // - LONGLONG LossOfSignalCount; - #define MSFC_HBAPortStatistics_LossOfSignalCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_LossOfSignalCount_ID 12 - - // - LONGLONG PrimitiveSeqProtocolErrCount; - #define MSFC_HBAPortStatistics_PrimitiveSeqProtocolErrCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_PrimitiveSeqProtocolErrCount_ID 13 - - // - LONGLONG InvalidTxWordCount; - #define MSFC_HBAPortStatistics_InvalidTxWordCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_InvalidTxWordCount_ID 14 - - // - LONGLONG InvalidCRCCount; - #define MSFC_HBAPortStatistics_InvalidCRCCount_SIZE sizeof(LONGLONG) - #define MSFC_HBAPortStatistics_InvalidCRCCount_ID 15 - -} MSFC_HBAPortStatistics, *PMSFC_HBAPortStatistics; - -#define MSFC_HBAPortStatistics_SIZE (FIELD_OFFSET(MSFC_HBAPortStatistics, InvalidCRCCount) + MSFC_HBAPortStatistics_InvalidCRCCount_SIZE) - -// HBAFC3MgmtInfo - HBAFC3MgmtInfo -#define HBAFC3MgmtInfoGuid \ - { 0x5966a24f,0x6aa5,0x418e, { 0xb7,0x5c,0x2f,0x21,0x4d,0xfb,0x4b,0x18 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAFC3MgmtInfo_GUID, \ - 0x5966a24f,0x6aa5,0x418e,0xb7,0x5c,0x2f,0x21,0x4d,0xfb,0x4b,0x18); -#endif - - -typedef struct _HBAFC3MgmtInfo -{ - // - ULONGLONG UniqueAdapterId; - #define HBAFC3MgmtInfo_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define HBAFC3MgmtInfo_UniqueAdapterId_ID 1 - - // - UCHAR wwn[8]; - #define HBAFC3MgmtInfo_wwn_SIZE sizeof(UCHAR[8]) - #define HBAFC3MgmtInfo_wwn_ID 2 - - // - ULONG unittype; - #define HBAFC3MgmtInfo_unittype_SIZE sizeof(ULONG) - #define HBAFC3MgmtInfo_unittype_ID 3 - - // - ULONG PortId; - #define HBAFC3MgmtInfo_PortId_SIZE sizeof(ULONG) - #define HBAFC3MgmtInfo_PortId_ID 4 - - // - ULONG NumberOfAttachedNodes; - #define HBAFC3MgmtInfo_NumberOfAttachedNodes_SIZE sizeof(ULONG) - #define HBAFC3MgmtInfo_NumberOfAttachedNodes_ID 5 - - // - USHORT IPVersion; - #define HBAFC3MgmtInfo_IPVersion_SIZE sizeof(USHORT) - #define HBAFC3MgmtInfo_IPVersion_ID 6 - - // - USHORT UDPPort; - #define HBAFC3MgmtInfo_UDPPort_SIZE sizeof(USHORT) - #define HBAFC3MgmtInfo_UDPPort_ID 7 - - // - UCHAR IPAddress[16]; - #define HBAFC3MgmtInfo_IPAddress_SIZE sizeof(UCHAR[16]) - #define HBAFC3MgmtInfo_IPAddress_ID 8 - - // - USHORT reserved; - #define HBAFC3MgmtInfo_reserved_SIZE sizeof(USHORT) - #define HBAFC3MgmtInfo_reserved_ID 9 - - // - USHORT TopologyDiscoveryFlags; - #define HBAFC3MgmtInfo_TopologyDiscoveryFlags_SIZE sizeof(USHORT) - #define HBAFC3MgmtInfo_TopologyDiscoveryFlags_ID 10 - - // - ULONG reserved1; - #define HBAFC3MgmtInfo_reserved1_SIZE sizeof(ULONG) - #define HBAFC3MgmtInfo_reserved1_ID 11 - -} HBAFC3MgmtInfo, *PHBAFC3MgmtInfo; - -#define HBAFC3MgmtInfo_SIZE (FIELD_OFFSET(HBAFC3MgmtInfo, reserved1) + HBAFC3MgmtInfo_reserved1_SIZE) - -// HBAScsiID - HBAScsiID -#define HBAScsiIDGuid \ - { 0xa76f5058,0xb1f0,0x4622, { 0x9e,0x88,0x5c,0xc4,0x1e,0x34,0x45,0x4a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAScsiID_GUID, \ - 0xa76f5058,0xb1f0,0x4622,0x9e,0x88,0x5c,0xc4,0x1e,0x34,0x45,0x4a); -#endif - - -typedef struct _HBAScsiID -{ - // - ULONG ScsiBusNumber; - #define HBAScsiID_ScsiBusNumber_SIZE sizeof(ULONG) - #define HBAScsiID_ScsiBusNumber_ID 1 - - // - ULONG ScsiTargetNumber; - #define HBAScsiID_ScsiTargetNumber_SIZE sizeof(ULONG) - #define HBAScsiID_ScsiTargetNumber_ID 2 - - // - ULONG ScsiOSLun; - #define HBAScsiID_ScsiOSLun_SIZE sizeof(ULONG) - #define HBAScsiID_ScsiOSLun_ID 3 - - - - //****************************************************************** - // - // This used to be a string type, but we made this a fixed length - // array so the WmiSizeIs() will work correctly for structs that - // contain this type. - // Please note that this should still be treated as a string. - // The first uint16 must hold the length of string (in bytes). - // - //****************************************************************** - - - // - USHORT OSDeviceName[257]; - #define HBAScsiID_OSDeviceName_SIZE sizeof(USHORT[257]) - #define HBAScsiID_OSDeviceName_ID 4 - -} HBAScsiID, *PHBAScsiID; - -#define HBAScsiID_SIZE (FIELD_OFFSET(HBAScsiID, OSDeviceName) + HBAScsiID_OSDeviceName_SIZE) - -// MSFC_LinkEvent - MSFC_LinkEvent - - - - -// -// Event types. -// -// These match the definitions in hbaapi.h and must be kept in sync. -// - /* Adapter Level Events */ -#define HBA_EVENT_ADAPTER_UNKNOWN 0x100 -#define HBA_EVENT_ADAPTER_ADD 0x101 -#define HBA_EVENT_ADAPTER_REMOVE 0x102 -#define HBA_EVENT_ADAPTER_CHANGE 0x103 - - /* Port Level Events */ -#define HBA_EVENT_PORT_UNKNOWN 0x200 -#define HBA_EVENT_PORT_OFFLINE 0x201 -#define HBA_EVENT_PORT_ONLINE 0x202 -#define HBA_EVENT_PORT_NEW_TARGETS 0x203 -#define HBA_EVENT_PORT_FABRIC 0x204 -#define HBA_EVENT_PORT_BROADCAST_CHANGE 0x205 -#define HBA_EVENT_PORT_BROADCAST_D24_0 0x206 -#define HBA_EVENT_PORT_BROADCAST_D27_4 0x207 -#define HBA_EVENT_PORT_BROADCAST_SES 0x208 -#define HBA_EVENT_PORT_BROADCAST_D01_4 0x209 -#define HBA_EVENT_PORT_BROADCAST_D04_7 0x20a -#define HBA_EVENT_PORT_BROADCAST_D16_7 0x20b -#define HBA_EVENT_PORT_BROADCAST_D29_7 0x20c -#define HBA_EVENT_PORT_ALL 0x2ff - - /* Port Statistics Events */ -#define HBA_EVENT_PORT_STAT_THRESHOLD 0x301 -#define HBA_EVENT_PORT_STAT_GROWTH 0x302 - -/* Phy Statistics Events */ -#define HBA_EVENT_PHY_STAT_THRESHOLD 0x351 -#define HBA_EVENT_PHY_STAT_GROWTH 0x352 - - /* Target Level Events */ -#define HBA_EVENT_TARGET_UNKNOWN 0x400 -#define HBA_EVENT_TARGET_OFFLINE 0x401 -#define HBA_EVENT_TARGET_ONLINE 0x402 -#define HBA_EVENT_TARGET_REMOVED 0x403 - - /* Fabric Link Events */ -#define HBA_EVENT_LINK_UNKNOWN 0x500 -#define HBA_EVENT_LINK_INCIDENT 0x501 - -#define MSFC_LinkEventGuid \ - { 0xc66015ee,0x014b,0x498a, { 0x94,0x51,0x99,0xfe,0xad,0x0a,0xb4,0x51 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_LinkEvent_GUID, \ - 0xc66015ee,0x014b,0x498a,0x94,0x51,0x99,0xfe,0xad,0x0a,0xb4,0x51); -#endif - - -typedef struct _MSFC_LinkEvent -{ - // - ULONG EventType; - #define MSFC_LinkEvent_EventType_SIZE sizeof(ULONG) - #define MSFC_LinkEvent_EventType_ID 1 - - // - UCHAR AdapterWWN[8]; - #define MSFC_LinkEvent_AdapterWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_LinkEvent_AdapterWWN_ID 2 - - // - ULONG RLIRBufferSize; - #define MSFC_LinkEvent_RLIRBufferSize_SIZE sizeof(ULONG) - #define MSFC_LinkEvent_RLIRBufferSize_ID 3 - - // - UCHAR RLIRBuffer[1]; - #define MSFC_LinkEvent_RLIRBuffer_ID 4 - -} MSFC_LinkEvent, *PMSFC_LinkEvent; - -// MSFC_FCAdapterHBAAttributes - MSFC_FCAdapterHBAAttributes - - -#ifndef MS_SM_HBA_API -#ifndef MSFC_HBA_API -// -// if neither defined then default to MSFC -// -#define MSFC_HBA_API -#endif -#endif - - -#ifdef MSFC_HBA_API - -#define MSFC_FCAdapterHBAAttributesGuid \ - { 0xf8f3ea26,0xab2c,0x4593, { 0x8b,0x84,0xc5,0x64,0x28,0xe6,0xbe,0xdb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FCAdapterHBAAttributes_GUID, \ - 0xf8f3ea26,0xab2c,0x4593,0x8b,0x84,0xc5,0x64,0x28,0xe6,0xbe,0xdb); -#endif - - -typedef struct _MSFC_FCAdapterHBAAttributes -{ - // - ULONGLONG UniqueAdapterId; - #define MSFC_FCAdapterHBAAttributes_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSFC_FCAdapterHBAAttributes_UniqueAdapterId_ID 1 - - // - ULONG HBAStatus; - #define MSFC_FCAdapterHBAAttributes_HBAStatus_SIZE sizeof(ULONG) - #define MSFC_FCAdapterHBAAttributes_HBAStatus_ID 2 - - // - UCHAR NodeWWN[8]; - #define MSFC_FCAdapterHBAAttributes_NodeWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_FCAdapterHBAAttributes_NodeWWN_ID 3 - - // - ULONG VendorSpecificID; - #define MSFC_FCAdapterHBAAttributes_VendorSpecificID_SIZE sizeof(ULONG) - #define MSFC_FCAdapterHBAAttributes_VendorSpecificID_ID 4 - - // - ULONG NumberOfPorts; - #define MSFC_FCAdapterHBAAttributes_NumberOfPorts_SIZE sizeof(ULONG) - #define MSFC_FCAdapterHBAAttributes_NumberOfPorts_ID 5 - - - - //****************************************************************** - // - // The string type is variable length (up to MaxLen). - // Each string starts with a ushort that holds the strings length - // (in bytes) followed by the WCHARs that make up the string. - // - //****************************************************************** - - - // - WCHAR Manufacturer[64 + 1]; - #define MSFC_FCAdapterHBAAttributes_Manufacturer_ID 6 - - // - WCHAR SerialNumber[64 + 1]; - #define MSFC_FCAdapterHBAAttributes_SerialNumber_ID 7 - - // - WCHAR Model[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_Model_ID 8 - - // - WCHAR ModelDescription[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_ModelDescription_ID 9 - - // - WCHAR NodeSymbolicName[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_NodeSymbolicName_ID 10 - - // - WCHAR HardwareVersion[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_HardwareVersion_ID 11 - - // - WCHAR DriverVersion[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_DriverVersion_ID 12 - - // - WCHAR OptionROMVersion[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_OptionROMVersion_ID 13 - - // - WCHAR FirmwareVersion[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_FirmwareVersion_ID 14 - - // - WCHAR DriverName[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_DriverName_ID 15 - - // - WCHAR MfgDomain[256 + 1]; - #define MSFC_FCAdapterHBAAttributes_MfgDomain_ID 16 - -} MSFC_FCAdapterHBAAttributes, *PMSFC_FCAdapterHBAAttributes; - -// MSFC_HBAPortAttributesResults - MSFC_HBAPortAttributesResults -#define MSFC_HBAPortAttributesResultsGuid \ - { 0xa76bd4e3,0x9961,0x4d9b, { 0xb6,0xbe,0x86,0xe6,0x98,0x26,0x0f,0x68 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_HBAPortAttributesResults_GUID, \ - 0xa76bd4e3,0x9961,0x4d9b,0xb6,0xbe,0x86,0xe6,0x98,0x26,0x0f,0x68); -#endif - - -typedef struct _MSFC_HBAPortAttributesResults -{ - // - UCHAR NodeWWN[8]; - #define MSFC_HBAPortAttributesResults_NodeWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_HBAPortAttributesResults_NodeWWN_ID 1 - - // - UCHAR PortWWN[8]; - #define MSFC_HBAPortAttributesResults_PortWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_HBAPortAttributesResults_PortWWN_ID 2 - - // - ULONG PortFcId; - #define MSFC_HBAPortAttributesResults_PortFcId_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortFcId_ID 3 - - // - ULONG PortType; - #define MSFC_HBAPortAttributesResults_PortType_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortType_ID 4 - - // - ULONG PortState; - #define MSFC_HBAPortAttributesResults_PortState_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortState_ID 5 - - // - ULONG PortSupportedClassofService; - #define MSFC_HBAPortAttributesResults_PortSupportedClassofService_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortSupportedClassofService_ID 6 - - // - UCHAR PortSupportedFc4Types[32]; - #define MSFC_HBAPortAttributesResults_PortSupportedFc4Types_SIZE sizeof(UCHAR[32]) - #define MSFC_HBAPortAttributesResults_PortSupportedFc4Types_ID 7 - - // - UCHAR PortActiveFc4Types[32]; - #define MSFC_HBAPortAttributesResults_PortActiveFc4Types_SIZE sizeof(UCHAR[32]) - #define MSFC_HBAPortAttributesResults_PortActiveFc4Types_ID 8 - - // - ULONG PortSupportedSpeed; - #define MSFC_HBAPortAttributesResults_PortSupportedSpeed_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortSupportedSpeed_ID 9 - - // - ULONG PortSpeed; - #define MSFC_HBAPortAttributesResults_PortSpeed_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortSpeed_ID 10 - - // - ULONG PortMaxFrameSize; - #define MSFC_HBAPortAttributesResults_PortMaxFrameSize_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_PortMaxFrameSize_ID 11 - - // - UCHAR FabricName[8]; - #define MSFC_HBAPortAttributesResults_FabricName_SIZE sizeof(UCHAR[8]) - #define MSFC_HBAPortAttributesResults_FabricName_ID 12 - - // - ULONG NumberofDiscoveredPorts; - #define MSFC_HBAPortAttributesResults_NumberofDiscoveredPorts_SIZE sizeof(ULONG) - #define MSFC_HBAPortAttributesResults_NumberofDiscoveredPorts_ID 13 - -} MSFC_HBAPortAttributesResults, *PMSFC_HBAPortAttributesResults; - -#define MSFC_HBAPortAttributesResults_SIZE (FIELD_OFFSET(MSFC_HBAPortAttributesResults, NumberofDiscoveredPorts) + MSFC_HBAPortAttributesResults_NumberofDiscoveredPorts_SIZE) - -// MSFC_FibrePortHBAAttributes - MSFC_FibrePortHBAAttributes -#define MSFC_FibrePortHBAAttributesGuid \ - { 0x61b397fd,0xf5ae,0x4950, { 0x97,0x58,0x0e,0xe5,0x98,0xe3,0xc6,0xe6 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FibrePortHBAAttributes_GUID, \ - 0x61b397fd,0xf5ae,0x4950,0x97,0x58,0x0e,0xe5,0x98,0xe3,0xc6,0xe6); -#endif - - -typedef struct _MSFC_FibrePortHBAAttributes -{ - // - ULONGLONG UniquePortId; - #define MSFC_FibrePortHBAAttributes_UniquePortId_SIZE sizeof(ULONGLONG) - #define MSFC_FibrePortHBAAttributes_UniquePortId_ID 1 - - // - ULONG HBAStatus; - #define MSFC_FibrePortHBAAttributes_HBAStatus_SIZE sizeof(ULONG) - #define MSFC_FibrePortHBAAttributes_HBAStatus_ID 2 - - // - MSFC_HBAPortAttributesResults Attributes; - #define MSFC_FibrePortHBAAttributes_Attributes_SIZE sizeof(MSFC_HBAPortAttributesResults) - #define MSFC_FibrePortHBAAttributes_Attributes_ID 3 - -} MSFC_FibrePortHBAAttributes, *PMSFC_FibrePortHBAAttributes; - -#define MSFC_FibrePortHBAAttributes_SIZE (FIELD_OFFSET(MSFC_FibrePortHBAAttributes, Attributes) + MSFC_FibrePortHBAAttributes_Attributes_SIZE) - -// MSFC_FibrePortHBAStatistics - MSFC_FibrePortHBAStatistics -#define MSFC_FibrePortHBAStatisticsGuid \ - { 0x27efaba4,0x362a,0x4f20, { 0x92,0x0b,0xed,0x66,0xe2,0x80,0xfc,0xf5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FibrePortHBAStatistics_GUID, \ - 0x27efaba4,0x362a,0x4f20,0x92,0x0b,0xed,0x66,0xe2,0x80,0xfc,0xf5); -#endif - - -typedef struct _MSFC_FibrePortHBAStatistics -{ - // - ULONGLONG UniquePortId; - #define MSFC_FibrePortHBAStatistics_UniquePortId_SIZE sizeof(ULONGLONG) - #define MSFC_FibrePortHBAStatistics_UniquePortId_ID 1 - - // - ULONG HBAStatus; - #define MSFC_FibrePortHBAStatistics_HBAStatus_SIZE sizeof(ULONG) - #define MSFC_FibrePortHBAStatistics_HBAStatus_ID 2 - - // - MSFC_HBAPortStatistics Statistics; - #define MSFC_FibrePortHBAStatistics_Statistics_SIZE sizeof(MSFC_HBAPortStatistics) - #define MSFC_FibrePortHBAStatistics_Statistics_ID 3 - -} MSFC_FibrePortHBAStatistics, *PMSFC_FibrePortHBAStatistics; - -#define MSFC_FibrePortHBAStatistics_SIZE (FIELD_OFFSET(MSFC_FibrePortHBAStatistics, Statistics) + MSFC_FibrePortHBAStatistics_Statistics_SIZE) - -// MSFC_FibrePortHBAMethods - MSFC_FibrePortHBAMethods -#define MSFC_FibrePortHBAMethodsGuid \ - { 0xe693553e,0xedf6,0x4d57, { 0xbf,0x08,0xef,0xca,0xae,0x1a,0x2e,0x1c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FibrePortHBAMethods_GUID, \ - 0xe693553e,0xedf6,0x4d57,0xbf,0x08,0xef,0xca,0xae,0x1a,0x2e,0x1c); -#endif - -// -// Method id definitions for MSFC_FibrePortHBAMethods -#define ResetStatistics 1 - -// MSFC_FC4STATISTICS - MSFC_FC4STATISTICS -#define MSFC_FC4STATISTICSGuid \ - { 0xca8e7fe6,0xb85e,0x497f, { 0x88,0x58,0x9b,0x5d,0x93,0xa6,0x6f,0xe1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FC4STATISTICS_GUID, \ - 0xca8e7fe6,0xb85e,0x497f,0x88,0x58,0x9b,0x5d,0x93,0xa6,0x6f,0xe1); -#endif - - -typedef struct _MSFC_FC4STATISTICS -{ - // - ULONGLONG InputRequests; - #define MSFC_FC4STATISTICS_InputRequests_SIZE sizeof(ULONGLONG) - #define MSFC_FC4STATISTICS_InputRequests_ID 1 - - // - ULONGLONG OutputRequests; - #define MSFC_FC4STATISTICS_OutputRequests_SIZE sizeof(ULONGLONG) - #define MSFC_FC4STATISTICS_OutputRequests_ID 2 - - // - ULONGLONG ControlRequests; - #define MSFC_FC4STATISTICS_ControlRequests_SIZE sizeof(ULONGLONG) - #define MSFC_FC4STATISTICS_ControlRequests_ID 3 - - // - ULONGLONG InputMegabytes; - #define MSFC_FC4STATISTICS_InputMegabytes_SIZE sizeof(ULONGLONG) - #define MSFC_FC4STATISTICS_InputMegabytes_ID 4 - - // - ULONGLONG OutputMegabytes; - #define MSFC_FC4STATISTICS_OutputMegabytes_SIZE sizeof(ULONGLONG) - #define MSFC_FC4STATISTICS_OutputMegabytes_ID 5 - -} MSFC_FC4STATISTICS, *PMSFC_FC4STATISTICS; - -#define MSFC_FC4STATISTICS_SIZE (FIELD_OFFSET(MSFC_FC4STATISTICS, OutputMegabytes) + MSFC_FC4STATISTICS_OutputMegabytes_SIZE) - -// MSFC_EventBuffer - MSFC_EventBuffer -#define MSFC_EventBufferGuid \ - { 0x623f4588,0xcf01,0x4f0e, { 0xb1,0x97,0xab,0xbe,0xe5,0xe0,0xcf,0xf3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_EventBuffer_GUID, \ - 0x623f4588,0xcf01,0x4f0e,0xb1,0x97,0xab,0xbe,0xe5,0xe0,0xcf,0xf3); -#endif - - -typedef struct _MSFC_EventBuffer -{ - // - ULONG EventType; - #define MSFC_EventBuffer_EventType_SIZE sizeof(ULONG) - #define MSFC_EventBuffer_EventType_ID 1 - - // - ULONG EventInfo[4]; - #define MSFC_EventBuffer_EventInfo_SIZE sizeof(ULONG[4]) - #define MSFC_EventBuffer_EventInfo_ID 2 - -} MSFC_EventBuffer, *PMSFC_EventBuffer; - -#define MSFC_EventBuffer_SIZE (FIELD_OFFSET(MSFC_EventBuffer, EventInfo) + MSFC_EventBuffer_EventInfo_SIZE) - -// MSFC_HBAAdapterMethods - MSFC_HBAAdapterMethods -#define MSFC_HBAAdapterMethodsGuid \ - { 0xdf87d4ed,0x4612,0x4d12, { 0x85,0xfb,0x83,0x57,0x4e,0xc3,0x4b,0x7c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_HBAAdapterMethods_GUID, \ - 0xdf87d4ed,0x4612,0x4d12,0x85,0xfb,0x83,0x57,0x4e,0xc3,0x4b,0x7c); -#endif - -// -// Method id definitions for MSFC_HBAAdapterMethods -#define GetDiscoveredPortAttributes 1 -typedef struct _GetDiscoveredPortAttributes_IN -{ - // - ULONG PortIndex; - #define GetDiscoveredPortAttributes_IN_PortIndex_SIZE sizeof(ULONG) - #define GetDiscoveredPortAttributes_IN_PortIndex_ID 1 - - // - ULONG DiscoveredPortIndex; - #define GetDiscoveredPortAttributes_IN_DiscoveredPortIndex_SIZE sizeof(ULONG) - #define GetDiscoveredPortAttributes_IN_DiscoveredPortIndex_ID 2 - -} GetDiscoveredPortAttributes_IN, *PGetDiscoveredPortAttributes_IN; - -#define GetDiscoveredPortAttributes_IN_SIZE (FIELD_OFFSET(GetDiscoveredPortAttributes_IN, DiscoveredPortIndex) + GetDiscoveredPortAttributes_IN_DiscoveredPortIndex_SIZE) - -typedef struct _GetDiscoveredPortAttributes_OUT -{ - // - ULONG HBAStatus; - #define GetDiscoveredPortAttributes_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetDiscoveredPortAttributes_OUT_HBAStatus_ID 3 - - // - MSFC_HBAPortAttributesResults PortAttributes; - #define GetDiscoveredPortAttributes_OUT_PortAttributes_SIZE sizeof(MSFC_HBAPortAttributesResults) - #define GetDiscoveredPortAttributes_OUT_PortAttributes_ID 4 - -} GetDiscoveredPortAttributes_OUT, *PGetDiscoveredPortAttributes_OUT; - -#define GetDiscoveredPortAttributes_OUT_SIZE (FIELD_OFFSET(GetDiscoveredPortAttributes_OUT, PortAttributes) + GetDiscoveredPortAttributes_OUT_PortAttributes_SIZE) - -#define GetPortAttributesByWWN 2 -typedef struct _GetPortAttributesByWWN_IN -{ - // - UCHAR wwn[8]; - #define GetPortAttributesByWWN_IN_wwn_SIZE sizeof(UCHAR[8]) - #define GetPortAttributesByWWN_IN_wwn_ID 1 - -} GetPortAttributesByWWN_IN, *PGetPortAttributesByWWN_IN; - -#define GetPortAttributesByWWN_IN_SIZE (FIELD_OFFSET(GetPortAttributesByWWN_IN, wwn) + GetPortAttributesByWWN_IN_wwn_SIZE) - -typedef struct _GetPortAttributesByWWN_OUT -{ - // - ULONG HBAStatus; - #define GetPortAttributesByWWN_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetPortAttributesByWWN_OUT_HBAStatus_ID 2 - - // - MSFC_HBAPortAttributesResults PortAttributes; - #define GetPortAttributesByWWN_OUT_PortAttributes_SIZE sizeof(MSFC_HBAPortAttributesResults) - #define GetPortAttributesByWWN_OUT_PortAttributes_ID 3 - -} GetPortAttributesByWWN_OUT, *PGetPortAttributesByWWN_OUT; - -#define GetPortAttributesByWWN_OUT_SIZE (FIELD_OFFSET(GetPortAttributesByWWN_OUT, PortAttributes) + GetPortAttributesByWWN_OUT_PortAttributes_SIZE) - -#define RefreshInformation 3 -#define SendCTPassThru 4 -typedef struct _SendCTPassThru_IN -{ - // - UCHAR PortWWN[8]; - #define SendCTPassThru_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendCTPassThru_IN_PortWWN_ID 1 - - // - ULONG RequestBufferCount; - #define SendCTPassThru_IN_RequestBufferCount_SIZE sizeof(ULONG) - #define SendCTPassThru_IN_RequestBufferCount_ID 2 - - // - UCHAR RequestBuffer[1]; - #define SendCTPassThru_IN_RequestBuffer_ID 3 - -} SendCTPassThru_IN, *PSendCTPassThru_IN; - -typedef struct _SendCTPassThru_OUT -{ - // - ULONG HBAStatus; - #define SendCTPassThru_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendCTPassThru_OUT_HBAStatus_ID 4 - - // - ULONG TotalResponseBufferCount; - #define SendCTPassThru_OUT_TotalResponseBufferCount_SIZE sizeof(ULONG) - #define SendCTPassThru_OUT_TotalResponseBufferCount_ID 5 - - // - ULONG ActualResponseBufferCount; - #define SendCTPassThru_OUT_ActualResponseBufferCount_SIZE sizeof(ULONG) - #define SendCTPassThru_OUT_ActualResponseBufferCount_ID 6 - - -#define SendCTPassThru_OUT_ResponseBuffer_SIZE_HINT 768 - - // - UCHAR ResponseBuffer[1]; - #define SendCTPassThru_OUT_ResponseBuffer_ID 7 - -} SendCTPassThru_OUT, *PSendCTPassThru_OUT; - -#define SendRNID 5 -typedef struct _SendRNID_IN -{ - // - UCHAR wwn[8]; - #define SendRNID_IN_wwn_SIZE sizeof(UCHAR[8]) - #define SendRNID_IN_wwn_ID 1 - - // - ULONG wwntype; - #define SendRNID_IN_wwntype_SIZE sizeof(ULONG) - #define SendRNID_IN_wwntype_ID 2 - -} SendRNID_IN, *PSendRNID_IN; - -#define SendRNID_IN_SIZE (FIELD_OFFSET(SendRNID_IN, wwntype) + SendRNID_IN_wwntype_SIZE) - -typedef struct _SendRNID_OUT -{ - // - ULONG HBAStatus; - #define SendRNID_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendRNID_OUT_HBAStatus_ID 3 - - // - ULONG ResponseBufferCount; - #define SendRNID_OUT_ResponseBufferCount_SIZE sizeof(ULONG) - #define SendRNID_OUT_ResponseBufferCount_ID 4 - - -#define SendRNID_OUT_ResponseBuffer_SIZE_HINT 76 - - // - UCHAR ResponseBuffer[1]; - #define SendRNID_OUT_ResponseBuffer_ID 5 - -} SendRNID_OUT, *PSendRNID_OUT; - -#define SendRNIDV2 6 -typedef struct _SendRNIDV2_IN -{ - // - UCHAR PortWWN[8]; - #define SendRNIDV2_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendRNIDV2_IN_PortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SendRNIDV2_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SendRNIDV2_IN_DestWWN_ID 2 - - // - ULONG DestFCID; - #define SendRNIDV2_IN_DestFCID_SIZE sizeof(ULONG) - #define SendRNIDV2_IN_DestFCID_ID 3 - - // - ULONG NodeIdDataFormat; - #define SendRNIDV2_IN_NodeIdDataFormat_SIZE sizeof(ULONG) - #define SendRNIDV2_IN_NodeIdDataFormat_ID 4 - -} SendRNIDV2_IN, *PSendRNIDV2_IN; - -#define SendRNIDV2_IN_SIZE (FIELD_OFFSET(SendRNIDV2_IN, NodeIdDataFormat) + SendRNIDV2_IN_NodeIdDataFormat_SIZE) - -typedef struct _SendRNIDV2_OUT -{ - // - ULONG HBAStatus; - #define SendRNIDV2_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendRNIDV2_OUT_HBAStatus_ID 5 - - // - ULONG TotalRspBufferSize; - #define SendRNIDV2_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendRNIDV2_OUT_TotalRspBufferSize_ID 6 - - // - ULONG ActualRspBufferSize; - #define SendRNIDV2_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendRNIDV2_OUT_ActualRspBufferSize_ID 7 - - -#define SendRNIDV2_OUT_RspBuffer_SIZE_HINT 76 - - // - UCHAR RspBuffer[1]; - #define SendRNIDV2_OUT_RspBuffer_ID 8 - -} SendRNIDV2_OUT, *PSendRNIDV2_OUT; - -#define GetFC3MgmtInfo 7 -typedef struct _GetFC3MgmtInfo_OUT -{ - // - ULONG HBAStatus; - #define GetFC3MgmtInfo_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetFC3MgmtInfo_OUT_HBAStatus_ID 1 - - // - HBAFC3MgmtInfo MgmtInfo; - #define GetFC3MgmtInfo_OUT_MgmtInfo_SIZE sizeof(HBAFC3MgmtInfo) - #define GetFC3MgmtInfo_OUT_MgmtInfo_ID 2 - -} GetFC3MgmtInfo_OUT, *PGetFC3MgmtInfo_OUT; - -#define GetFC3MgmtInfo_OUT_SIZE (FIELD_OFFSET(GetFC3MgmtInfo_OUT, MgmtInfo) + GetFC3MgmtInfo_OUT_MgmtInfo_SIZE) - -#define SetFC3MgmtInfo 8 -typedef struct _SetFC3MgmtInfo_IN -{ - // - HBAFC3MgmtInfo MgmtInfo; - #define SetFC3MgmtInfo_IN_MgmtInfo_SIZE sizeof(HBAFC3MgmtInfo) - #define SetFC3MgmtInfo_IN_MgmtInfo_ID 1 - -} SetFC3MgmtInfo_IN, *PSetFC3MgmtInfo_IN; - -#define SetFC3MgmtInfo_IN_SIZE (FIELD_OFFSET(SetFC3MgmtInfo_IN, MgmtInfo) + SetFC3MgmtInfo_IN_MgmtInfo_SIZE) - -typedef struct _SetFC3MgmtInfo_OUT -{ - // - ULONG HBAStatus; - #define SetFC3MgmtInfo_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SetFC3MgmtInfo_OUT_HBAStatus_ID 2 - -} SetFC3MgmtInfo_OUT, *PSetFC3MgmtInfo_OUT; - -#define SetFC3MgmtInfo_OUT_SIZE (FIELD_OFFSET(SetFC3MgmtInfo_OUT, HBAStatus) + SetFC3MgmtInfo_OUT_HBAStatus_SIZE) - -#define SendRPL 9 -typedef struct _SendRPL_IN -{ - // - UCHAR PortWWN[8]; - #define SendRPL_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendRPL_IN_PortWWN_ID 1 - - // - UCHAR AgentWWN[8]; - #define SendRPL_IN_AgentWWN_SIZE sizeof(UCHAR[8]) - #define SendRPL_IN_AgentWWN_ID 2 - - // - ULONG agent_domain; - #define SendRPL_IN_agent_domain_SIZE sizeof(ULONG) - #define SendRPL_IN_agent_domain_ID 3 - - // - ULONG portIndex; - #define SendRPL_IN_portIndex_SIZE sizeof(ULONG) - #define SendRPL_IN_portIndex_ID 4 - -} SendRPL_IN, *PSendRPL_IN; - -#define SendRPL_IN_SIZE (FIELD_OFFSET(SendRPL_IN, portIndex) + SendRPL_IN_portIndex_SIZE) - -typedef struct _SendRPL_OUT -{ - // - ULONG HBAStatus; - #define SendRPL_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendRPL_OUT_HBAStatus_ID 5 - - // - ULONG TotalRspBufferSize; - #define SendRPL_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendRPL_OUT_TotalRspBufferSize_ID 6 - - // - ULONG ActualRspBufferSize; - #define SendRPL_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendRPL_OUT_ActualRspBufferSize_ID 7 - - -#define SendRPL_OUT_RspBuffer_SIZE_HINT 28 // 12+16*n - - // - UCHAR RspBuffer[1]; - #define SendRPL_OUT_RspBuffer_ID 8 - -} SendRPL_OUT, *PSendRPL_OUT; - -#define SendRPS 10 -typedef struct _SendRPS_IN -{ - // - UCHAR PortWWN[8]; - #define SendRPS_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendRPS_IN_PortWWN_ID 1 - - // - UCHAR AgentWWN[8]; - #define SendRPS_IN_AgentWWN_SIZE sizeof(UCHAR[8]) - #define SendRPS_IN_AgentWWN_ID 2 - - // - UCHAR ObjectWWN[8]; - #define SendRPS_IN_ObjectWWN_SIZE sizeof(UCHAR[8]) - #define SendRPS_IN_ObjectWWN_ID 3 - - // - ULONG AgentDomain; - #define SendRPS_IN_AgentDomain_SIZE sizeof(ULONG) - #define SendRPS_IN_AgentDomain_ID 4 - - // - ULONG ObjectPortNumber; - #define SendRPS_IN_ObjectPortNumber_SIZE sizeof(ULONG) - #define SendRPS_IN_ObjectPortNumber_ID 5 - -} SendRPS_IN, *PSendRPS_IN; - -#define SendRPS_IN_SIZE (FIELD_OFFSET(SendRPS_IN, ObjectPortNumber) + SendRPS_IN_ObjectPortNumber_SIZE) - -typedef struct _SendRPS_OUT -{ - // - ULONG HBAStatus; - #define SendRPS_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendRPS_OUT_HBAStatus_ID 6 - - // - ULONG TotalRspBufferSize; - #define SendRPS_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendRPS_OUT_TotalRspBufferSize_ID 7 - - // - ULONG ActualRspBufferSize; - #define SendRPS_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendRPS_OUT_ActualRspBufferSize_ID 8 - - -#define SendRPS_OUT_RspBuffer_SIZE_HINT 64 - - // - UCHAR RspBuffer[1]; - #define SendRPS_OUT_RspBuffer_ID 9 - -} SendRPS_OUT, *PSendRPS_OUT; - -#define SendSRL 11 -typedef struct _SendSRL_IN -{ - // - UCHAR PortWWN[8]; - #define SendSRL_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendSRL_IN_PortWWN_ID 1 - - // - UCHAR WWN[8]; - #define SendSRL_IN_WWN_SIZE sizeof(UCHAR[8]) - #define SendSRL_IN_WWN_ID 2 - - // - ULONG Domain; - #define SendSRL_IN_Domain_SIZE sizeof(ULONG) - #define SendSRL_IN_Domain_ID 3 - -} SendSRL_IN, *PSendSRL_IN; - -#define SendSRL_IN_SIZE (FIELD_OFFSET(SendSRL_IN, Domain) + SendSRL_IN_Domain_SIZE) - -typedef struct _SendSRL_OUT -{ - // - ULONG HBAStatus; - #define SendSRL_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendSRL_OUT_HBAStatus_ID 4 - - // - ULONG TotalRspBufferSize; - #define SendSRL_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendSRL_OUT_TotalRspBufferSize_ID 5 - - // - ULONG ActualRspBufferSize; - #define SendSRL_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendSRL_OUT_ActualRspBufferSize_ID 6 - - -#define SendSRL_OUT_RspBuffer_SIZE_HINT 8 - - // - UCHAR RspBuffer[1]; - #define SendSRL_OUT_RspBuffer_ID 7 - -} SendSRL_OUT, *PSendSRL_OUT; - -#define SendLIRR 12 -typedef struct _SendLIRR_IN -{ - // - UCHAR SourceWWN[8]; - #define SendLIRR_IN_SourceWWN_SIZE sizeof(UCHAR[8]) - #define SendLIRR_IN_SourceWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SendLIRR_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SendLIRR_IN_DestWWN_ID 2 - - // - UCHAR Function; - #define SendLIRR_IN_Function_SIZE sizeof(UCHAR) - #define SendLIRR_IN_Function_ID 3 - - // - UCHAR Type; - #define SendLIRR_IN_Type_SIZE sizeof(UCHAR) - #define SendLIRR_IN_Type_ID 4 - -} SendLIRR_IN, *PSendLIRR_IN; - -#define SendLIRR_IN_SIZE (FIELD_OFFSET(SendLIRR_IN, Type) + SendLIRR_IN_Type_SIZE) - -typedef struct _SendLIRR_OUT -{ - // - ULONG HBAStatus; - #define SendLIRR_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendLIRR_OUT_HBAStatus_ID 5 - - // - ULONG TotalRspBufferSize; - #define SendLIRR_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendLIRR_OUT_TotalRspBufferSize_ID 6 - - // - ULONG ActualRspBufferSize; - #define SendLIRR_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendLIRR_OUT_ActualRspBufferSize_ID 7 - - -#define SendLIRR_OUT_RspBuffer_SIZE_HINT 8 - - // - UCHAR RspBuffer[1]; - #define SendLIRR_OUT_RspBuffer_ID 8 - -} SendLIRR_OUT, *PSendLIRR_OUT; - -#define GetFC4Statistics 13 -typedef struct _GetFC4Statistics_IN -{ - // - UCHAR PortWWN[8]; - #define GetFC4Statistics_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define GetFC4Statistics_IN_PortWWN_ID 1 - - // - UCHAR FC4Type; - #define GetFC4Statistics_IN_FC4Type_SIZE sizeof(UCHAR) - #define GetFC4Statistics_IN_FC4Type_ID 2 - -} GetFC4Statistics_IN, *PGetFC4Statistics_IN; - -#define GetFC4Statistics_IN_SIZE (FIELD_OFFSET(GetFC4Statistics_IN, FC4Type) + GetFC4Statistics_IN_FC4Type_SIZE) - -typedef struct _GetFC4Statistics_OUT -{ - // - ULONG HBAStatus; - #define GetFC4Statistics_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetFC4Statistics_OUT_HBAStatus_ID 3 - - // - MSFC_FC4STATISTICS FC4Statistics; - #define GetFC4Statistics_OUT_FC4Statistics_SIZE sizeof(MSFC_FC4STATISTICS) - #define GetFC4Statistics_OUT_FC4Statistics_ID 4 - -} GetFC4Statistics_OUT, *PGetFC4Statistics_OUT; - -#define GetFC4Statistics_OUT_SIZE (FIELD_OFFSET(GetFC4Statistics_OUT, FC4Statistics) + GetFC4Statistics_OUT_FC4Statistics_SIZE) - -#define GetFCPStatistics 14 -typedef struct _GetFCPStatistics_IN -{ - // - HBAScsiID ScsiId; - #define GetFCPStatistics_IN_ScsiId_SIZE sizeof(HBAScsiID) - #define GetFCPStatistics_IN_ScsiId_ID 1 - -} GetFCPStatistics_IN, *PGetFCPStatistics_IN; - -#define GetFCPStatistics_IN_SIZE (FIELD_OFFSET(GetFCPStatistics_IN, ScsiId) + GetFCPStatistics_IN_ScsiId_SIZE) - -typedef struct _GetFCPStatistics_OUT -{ - // - ULONG HBAStatus; - #define GetFCPStatistics_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetFCPStatistics_OUT_HBAStatus_ID 2 - - // - MSFC_FC4STATISTICS FC4Statistics; - #define GetFCPStatistics_OUT_FC4Statistics_SIZE sizeof(MSFC_FC4STATISTICS) - #define GetFCPStatistics_OUT_FC4Statistics_ID 3 - -} GetFCPStatistics_OUT, *PGetFCPStatistics_OUT; - -#define GetFCPStatistics_OUT_SIZE (FIELD_OFFSET(GetFCPStatistics_OUT, FC4Statistics) + GetFCPStatistics_OUT_FC4Statistics_SIZE) - -#define ScsiInquiry 15 -typedef struct _ScsiInquiry_IN -{ - // - UCHAR Cdb[6]; - #define ScsiInquiry_IN_Cdb_SIZE sizeof(UCHAR[6]) - #define ScsiInquiry_IN_Cdb_ID 1 - - // - UCHAR HbaPortWWN[8]; - #define ScsiInquiry_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiInquiry_IN_HbaPortWWN_ID 2 - - // - UCHAR DiscoveredPortWWN[8]; - #define ScsiInquiry_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiInquiry_IN_DiscoveredPortWWN_ID 3 - - // - ULONGLONG FcLun; - #define ScsiInquiry_IN_FcLun_SIZE sizeof(ULONGLONG) - #define ScsiInquiry_IN_FcLun_ID 4 - -} ScsiInquiry_IN, *PScsiInquiry_IN; - -#define ScsiInquiry_IN_SIZE (FIELD_OFFSET(ScsiInquiry_IN, FcLun) + ScsiInquiry_IN_FcLun_SIZE) - -typedef struct _ScsiInquiry_OUT -{ - // - ULONG HBAStatus; - #define ScsiInquiry_OUT_HBAStatus_SIZE sizeof(ULONG) - #define ScsiInquiry_OUT_HBAStatus_ID 5 - - // - ULONG ResponseBufferSize; - #define ScsiInquiry_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiInquiry_OUT_ResponseBufferSize_ID 6 - - // - ULONG SenseBufferSize; - #define ScsiInquiry_OUT_SenseBufferSize_SIZE sizeof(ULONG) - #define ScsiInquiry_OUT_SenseBufferSize_ID 7 - - // - UCHAR ScsiStatus; - #define ScsiInquiry_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiInquiry_OUT_ScsiStatus_ID 8 - - -#define ScsiInquiry_OUT_ResponseBuffer_SIZE_HINT 96 - - // - UCHAR ResponseBuffer[1]; - #define ScsiInquiry_OUT_ResponseBuffer_ID 9 - - // -// UCHAR SenseBuffer[1]; - #define ScsiInquiry_OUT_SenseBuffer_ID 10 - -} ScsiInquiry_OUT, *PScsiInquiry_OUT; - -#define ScsiReadCapacity 16 -typedef struct _ScsiReadCapacity_IN -{ - // - UCHAR Cdb[10]; - #define ScsiReadCapacity_IN_Cdb_SIZE sizeof(UCHAR[10]) - #define ScsiReadCapacity_IN_Cdb_ID 1 - - // - UCHAR HbaPortWWN[8]; - #define ScsiReadCapacity_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiReadCapacity_IN_HbaPortWWN_ID 2 - - // - UCHAR DiscoveredPortWWN[8]; - #define ScsiReadCapacity_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiReadCapacity_IN_DiscoveredPortWWN_ID 3 - - // - ULONGLONG FcLun; - #define ScsiReadCapacity_IN_FcLun_SIZE sizeof(ULONGLONG) - #define ScsiReadCapacity_IN_FcLun_ID 4 - -} ScsiReadCapacity_IN, *PScsiReadCapacity_IN; - -#define ScsiReadCapacity_IN_SIZE (FIELD_OFFSET(ScsiReadCapacity_IN, FcLun) + ScsiReadCapacity_IN_FcLun_SIZE) - -typedef struct _ScsiReadCapacity_OUT -{ - // - ULONG HBAStatus; - #define ScsiReadCapacity_OUT_HBAStatus_SIZE sizeof(ULONG) - #define ScsiReadCapacity_OUT_HBAStatus_ID 5 - - // - ULONG ResponseBufferSize; - #define ScsiReadCapacity_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiReadCapacity_OUT_ResponseBufferSize_ID 6 - - // - ULONG SenseBufferSize; - #define ScsiReadCapacity_OUT_SenseBufferSize_SIZE sizeof(ULONG) - #define ScsiReadCapacity_OUT_SenseBufferSize_ID 7 - - // - UCHAR ScsiStatus; - #define ScsiReadCapacity_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiReadCapacity_OUT_ScsiStatus_ID 8 - - -#define ScsiReadCapacity_OUT_ResponseBuffer_SIZE_HINT 16 - - // - UCHAR ResponseBuffer[1]; - #define ScsiReadCapacity_OUT_ResponseBuffer_ID 9 - - // -// UCHAR SenseBuffer[1]; - #define ScsiReadCapacity_OUT_SenseBuffer_ID 10 - -} ScsiReadCapacity_OUT, *PScsiReadCapacity_OUT; - -#define ScsiReportLuns 17 -typedef struct _ScsiReportLuns_IN -{ - // - UCHAR Cdb[12]; - #define ScsiReportLuns_IN_Cdb_SIZE sizeof(UCHAR[12]) - #define ScsiReportLuns_IN_Cdb_ID 1 - - // - UCHAR HbaPortWWN[8]; - #define ScsiReportLuns_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiReportLuns_IN_HbaPortWWN_ID 2 - - // - UCHAR DiscoveredPortWWN[8]; - #define ScsiReportLuns_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define ScsiReportLuns_IN_DiscoveredPortWWN_ID 3 - -} ScsiReportLuns_IN, *PScsiReportLuns_IN; - -#define ScsiReportLuns_IN_SIZE (FIELD_OFFSET(ScsiReportLuns_IN, DiscoveredPortWWN) + ScsiReportLuns_IN_DiscoveredPortWWN_SIZE) - -typedef struct _ScsiReportLuns_OUT -{ - // - ULONG HBAStatus; - #define ScsiReportLuns_OUT_HBAStatus_SIZE sizeof(ULONG) - #define ScsiReportLuns_OUT_HBAStatus_ID 4 - - // - ULONG ResponseBufferSize; - #define ScsiReportLuns_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiReportLuns_OUT_ResponseBufferSize_ID 5 - - // - ULONG SenseBufferSize; - #define ScsiReportLuns_OUT_SenseBufferSize_SIZE sizeof(ULONG) - #define ScsiReportLuns_OUT_SenseBufferSize_ID 6 - - // - UCHAR ScsiStatus; - #define ScsiReportLuns_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiReportLuns_OUT_ScsiStatus_ID 7 - - -#define ScsiReportLuns_OUT_ResponseBuffer_SIZE_HINT 16 // 8+8*number_of_luns - - // - UCHAR ResponseBuffer[1]; - #define ScsiReportLuns_OUT_ResponseBuffer_ID 8 - - // -// UCHAR SenseBuffer[1]; - #define ScsiReportLuns_OUT_SenseBuffer_ID 9 - -} ScsiReportLuns_OUT, *PScsiReportLuns_OUT; - -#define GetEventBuffer 18 -typedef struct _GetEventBuffer_OUT -{ - // - ULONG HBAStatus; - #define GetEventBuffer_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetEventBuffer_OUT_HBAStatus_ID 1 - - // - ULONG EventCount; - #define GetEventBuffer_OUT_EventCount_SIZE sizeof(ULONG) - #define GetEventBuffer_OUT_EventCount_ID 2 - - // - MSFC_EventBuffer Events[1]; - #define GetEventBuffer_OUT_Events_ID 3 - -} GetEventBuffer_OUT, *PGetEventBuffer_OUT; - -#define SendRLS 19 -typedef struct _SendRLS_IN -{ - // - UCHAR PortWWN[8]; - #define SendRLS_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SendRLS_IN_PortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SendRLS_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SendRLS_IN_DestWWN_ID 2 - -} SendRLS_IN, *PSendRLS_IN; - -#define SendRLS_IN_SIZE (FIELD_OFFSET(SendRLS_IN, DestWWN) + SendRLS_IN_DestWWN_SIZE) - -typedef struct _SendRLS_OUT -{ - // - ULONG HBAStatus; - #define SendRLS_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SendRLS_OUT_HBAStatus_ID 3 - - // - ULONG TotalRspBufferSize; - #define SendRLS_OUT_TotalRspBufferSize_SIZE sizeof(ULONG) - #define SendRLS_OUT_TotalRspBufferSize_ID 4 - - // - ULONG ActualRspBufferSize; - #define SendRLS_OUT_ActualRspBufferSize_SIZE sizeof(ULONG) - #define SendRLS_OUT_ActualRspBufferSize_ID 5 - - -#define SendRLS_OUT_RspBuffer_SIZE_HINT 28 - - // - UCHAR RspBuffer[1]; - #define SendRLS_OUT_RspBuffer_ID 6 - -} SendRLS_OUT, *PSendRLS_OUT; - - -// HBAFCPID - HBAFCPID -#define HBAFCPIDGuid \ - { 0xff02bc96,0x7fb0,0x4bac, { 0x8f,0x97,0xc7,0x1e,0x49,0x5f,0xa6,0x98 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAFCPID_GUID, \ - 0xff02bc96,0x7fb0,0x4bac,0x8f,0x97,0xc7,0x1e,0x49,0x5f,0xa6,0x98); -#endif - - -typedef struct _HBAFCPID -{ - // - ULONG Fcid; - #define HBAFCPID_Fcid_SIZE sizeof(ULONG) - #define HBAFCPID_Fcid_ID 1 - - // - UCHAR NodeWWN[8]; - #define HBAFCPID_NodeWWN_SIZE sizeof(UCHAR[8]) - #define HBAFCPID_NodeWWN_ID 2 - - // - UCHAR PortWWN[8]; - #define HBAFCPID_PortWWN_SIZE sizeof(UCHAR[8]) - #define HBAFCPID_PortWWN_ID 3 - - // - ULONGLONG FcpLun; - #define HBAFCPID_FcpLun_SIZE sizeof(ULONGLONG) - #define HBAFCPID_FcpLun_ID 4 - -} HBAFCPID, *PHBAFCPID; - -#define HBAFCPID_SIZE (FIELD_OFFSET(HBAFCPID, FcpLun) + HBAFCPID_FcpLun_SIZE) - -// HBAFCPScsiEntry - HBAFCPScsiEntry -#define HBAFCPScsiEntryGuid \ - { 0x77ca1248,0x1505,0x4221, { 0x8e,0xb6,0xbb,0xb6,0xec,0x77,0x1a,0x87 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAFCPScsiEntry_GUID, \ - 0x77ca1248,0x1505,0x4221,0x8e,0xb6,0xbb,0xb6,0xec,0x77,0x1a,0x87); -#endif - - -typedef struct _HBAFCPScsiEntry -{ - // - HBAFCPID FCPId; - #define HBAFCPScsiEntry_FCPId_SIZE sizeof(HBAFCPID) - #define HBAFCPScsiEntry_FCPId_ID 1 - - // - UCHAR Luid[256]; - #define HBAFCPScsiEntry_Luid_SIZE sizeof(UCHAR[256]) - #define HBAFCPScsiEntry_Luid_ID 2 - - // - HBAScsiID ScsiId; - #define HBAFCPScsiEntry_ScsiId_SIZE sizeof(HBAScsiID) - #define HBAFCPScsiEntry_ScsiId_ID 3 - -} HBAFCPScsiEntry, *PHBAFCPScsiEntry; - -#define HBAFCPScsiEntry_SIZE (FIELD_OFFSET(HBAFCPScsiEntry, ScsiId) + HBAFCPScsiEntry_ScsiId_SIZE) - -// HBAFCPBindingEntry - HBAFCPBindingEntry -#define HBAFCPBindingEntryGuid \ - { 0xfceff8b7,0x9d6b,0x4115, { 0x84,0x22,0x05,0x99,0x24,0x51,0xa6,0x29 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAFCPBindingEntry_GUID, \ - 0xfceff8b7,0x9d6b,0x4115,0x84,0x22,0x05,0x99,0x24,0x51,0xa6,0x29); -#endif - - -typedef struct _HBAFCPBindingEntry -{ - // - ULONG Type; - #define HBAFCPBindingEntry_Type_SIZE sizeof(ULONG) - #define HBAFCPBindingEntry_Type_ID 1 - - // - HBAFCPID FCPId; - #define HBAFCPBindingEntry_FCPId_SIZE sizeof(HBAFCPID) - #define HBAFCPBindingEntry_FCPId_ID 2 - - // - HBAScsiID ScsiId; - #define HBAFCPBindingEntry_ScsiId_SIZE sizeof(HBAScsiID) - #define HBAFCPBindingEntry_ScsiId_ID 3 - -} HBAFCPBindingEntry, *PHBAFCPBindingEntry; - -#define HBAFCPBindingEntry_SIZE (FIELD_OFFSET(HBAFCPBindingEntry, ScsiId) + HBAFCPBindingEntry_ScsiId_SIZE) - -// HBAFCPBindingEntry2 - HBAFCPBindingEntry2 -#define HBAFCPBindingEntry2Guid \ - { 0x3a1e7679,0x4b1f,0x4f31, { 0xa8,0xae,0xfe,0x92,0x78,0x73,0x09,0x24 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(HBAFCPBindingEntry2_GUID, \ - 0x3a1e7679,0x4b1f,0x4f31,0xa8,0xae,0xfe,0x92,0x78,0x73,0x09,0x24); -#endif - - -typedef struct _HBAFCPBindingEntry2 -{ - // - ULONG Type; - #define HBAFCPBindingEntry2_Type_SIZE sizeof(ULONG) - #define HBAFCPBindingEntry2_Type_ID 1 - - // - HBAFCPID FCPId; - #define HBAFCPBindingEntry2_FCPId_SIZE sizeof(HBAFCPID) - #define HBAFCPBindingEntry2_FCPId_ID 2 - - // - UCHAR Luid[256]; - #define HBAFCPBindingEntry2_Luid_SIZE sizeof(UCHAR[256]) - #define HBAFCPBindingEntry2_Luid_ID 3 - - // - HBAScsiID ScsiId; - #define HBAFCPBindingEntry2_ScsiId_SIZE sizeof(HBAScsiID) - #define HBAFCPBindingEntry2_ScsiId_ID 4 - -} HBAFCPBindingEntry2, *PHBAFCPBindingEntry2; - -#define HBAFCPBindingEntry2_SIZE (FIELD_OFFSET(HBAFCPBindingEntry2, ScsiId) + HBAFCPBindingEntry2_ScsiId_SIZE) - -// MSFC_HBAFCPInfo - MSFC_HBAFCPInfo -#define MSFC_HBAFCPInfoGuid \ - { 0x7a1fc391,0x5b23,0x4c19, { 0xb0,0xeb,0xb1,0xae,0xf5,0x90,0x50,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_HBAFCPInfo_GUID, \ - 0x7a1fc391,0x5b23,0x4c19,0xb0,0xeb,0xb1,0xae,0xf5,0x90,0x50,0xc3); -#endif - -// -// Method id definitions for MSFC_HBAFCPInfo -#define GetFcpTargetMapping 1 -typedef struct _GetFcpTargetMapping_IN -{ - // - UCHAR HbaPortWWN[8]; - #define GetFcpTargetMapping_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define GetFcpTargetMapping_IN_HbaPortWWN_ID 1 - - // - ULONG InEntryCount; - #define GetFcpTargetMapping_IN_InEntryCount_SIZE sizeof(ULONG) - #define GetFcpTargetMapping_IN_InEntryCount_ID 2 - -} GetFcpTargetMapping_IN, *PGetFcpTargetMapping_IN; - -#define GetFcpTargetMapping_IN_SIZE (FIELD_OFFSET(GetFcpTargetMapping_IN, InEntryCount) + GetFcpTargetMapping_IN_InEntryCount_SIZE) - -typedef struct _GetFcpTargetMapping_OUT -{ - // - ULONG HBAStatus; - #define GetFcpTargetMapping_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetFcpTargetMapping_OUT_HBAStatus_ID 3 - - // - ULONG TotalEntryCount; - #define GetFcpTargetMapping_OUT_TotalEntryCount_SIZE sizeof(ULONG) - #define GetFcpTargetMapping_OUT_TotalEntryCount_ID 4 - - // - ULONG OutEntryCount; - #define GetFcpTargetMapping_OUT_OutEntryCount_SIZE sizeof(ULONG) - #define GetFcpTargetMapping_OUT_OutEntryCount_ID 5 - - // - HBAFCPScsiEntry Entry[1]; - #define GetFcpTargetMapping_OUT_Entry_ID 6 - -} GetFcpTargetMapping_OUT, *PGetFcpTargetMapping_OUT; - -#define GetFcpPersistentBinding 2 -typedef struct _GetFcpPersistentBinding_IN -{ - // - ULONG InEntryCount; - #define GetFcpPersistentBinding_IN_InEntryCount_SIZE sizeof(ULONG) - #define GetFcpPersistentBinding_IN_InEntryCount_ID 1 - -} GetFcpPersistentBinding_IN, *PGetFcpPersistentBinding_IN; - -#define GetFcpPersistentBinding_IN_SIZE (FIELD_OFFSET(GetFcpPersistentBinding_IN, InEntryCount) + GetFcpPersistentBinding_IN_InEntryCount_SIZE) - -typedef struct _GetFcpPersistentBinding_OUT -{ - // - ULONG HBAStatus; - #define GetFcpPersistentBinding_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetFcpPersistentBinding_OUT_HBAStatus_ID 2 - - // - ULONG TotalEntryCount; - #define GetFcpPersistentBinding_OUT_TotalEntryCount_SIZE sizeof(ULONG) - #define GetFcpPersistentBinding_OUT_TotalEntryCount_ID 3 - - // - ULONG OutEntryCount; - #define GetFcpPersistentBinding_OUT_OutEntryCount_SIZE sizeof(ULONG) - #define GetFcpPersistentBinding_OUT_OutEntryCount_ID 4 - - // - HBAFCPBindingEntry Entry[1]; - #define GetFcpPersistentBinding_OUT_Entry_ID 5 - -} GetFcpPersistentBinding_OUT, *PGetFcpPersistentBinding_OUT; - -#define GetBindingCapability 3 -typedef struct _GetBindingCapability_IN -{ - // - UCHAR PortWWN[8]; - #define GetBindingCapability_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define GetBindingCapability_IN_PortWWN_ID 1 - -} GetBindingCapability_IN, *PGetBindingCapability_IN; - -#define GetBindingCapability_IN_SIZE (FIELD_OFFSET(GetBindingCapability_IN, PortWWN) + GetBindingCapability_IN_PortWWN_SIZE) - -typedef struct _GetBindingCapability_OUT -{ - // - ULONG HBAStatus; - #define GetBindingCapability_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetBindingCapability_OUT_HBAStatus_ID 2 - - // - ULONG BindType; - #define GetBindingCapability_OUT_BindType_SIZE sizeof(ULONG) - #define GetBindingCapability_OUT_BindType_ID 3 - -} GetBindingCapability_OUT, *PGetBindingCapability_OUT; - -#define GetBindingCapability_OUT_SIZE (FIELD_OFFSET(GetBindingCapability_OUT, BindType) + GetBindingCapability_OUT_BindType_SIZE) - -#define GetBindingSupport 4 -typedef struct _GetBindingSupport_IN -{ - // - UCHAR PortWWN[8]; - #define GetBindingSupport_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define GetBindingSupport_IN_PortWWN_ID 1 - -} GetBindingSupport_IN, *PGetBindingSupport_IN; - -#define GetBindingSupport_IN_SIZE (FIELD_OFFSET(GetBindingSupport_IN, PortWWN) + GetBindingSupport_IN_PortWWN_SIZE) - -typedef struct _GetBindingSupport_OUT -{ - // - ULONG HBAStatus; - #define GetBindingSupport_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetBindingSupport_OUT_HBAStatus_ID 2 - - // - ULONG BindType; - #define GetBindingSupport_OUT_BindType_SIZE sizeof(ULONG) - #define GetBindingSupport_OUT_BindType_ID 3 - -} GetBindingSupport_OUT, *PGetBindingSupport_OUT; - -#define GetBindingSupport_OUT_SIZE (FIELD_OFFSET(GetBindingSupport_OUT, BindType) + GetBindingSupport_OUT_BindType_SIZE) - -#define SetBindingSupport 5 -typedef struct _SetBindingSupport_IN -{ - // - UCHAR PortWWN[8]; - #define SetBindingSupport_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SetBindingSupport_IN_PortWWN_ID 1 - - // - ULONG BindType; - #define SetBindingSupport_IN_BindType_SIZE sizeof(ULONG) - #define SetBindingSupport_IN_BindType_ID 2 - -} SetBindingSupport_IN, *PSetBindingSupport_IN; - -#define SetBindingSupport_IN_SIZE (FIELD_OFFSET(SetBindingSupport_IN, BindType) + SetBindingSupport_IN_BindType_SIZE) - -typedef struct _SetBindingSupport_OUT -{ - // - ULONG HBAStatus; - #define SetBindingSupport_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SetBindingSupport_OUT_HBAStatus_ID 3 - -} SetBindingSupport_OUT, *PSetBindingSupport_OUT; - -#define SetBindingSupport_OUT_SIZE (FIELD_OFFSET(SetBindingSupport_OUT, HBAStatus) + SetBindingSupport_OUT_HBAStatus_SIZE) - -#define GetPersistentBinding2 6 -typedef struct _GetPersistentBinding2_IN -{ - // - UCHAR PortWWN[8]; - #define GetPersistentBinding2_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define GetPersistentBinding2_IN_PortWWN_ID 1 - - // - ULONG InEntryCount; - #define GetPersistentBinding2_IN_InEntryCount_SIZE sizeof(ULONG) - #define GetPersistentBinding2_IN_InEntryCount_ID 2 - -} GetPersistentBinding2_IN, *PGetPersistentBinding2_IN; - -#define GetPersistentBinding2_IN_SIZE (FIELD_OFFSET(GetPersistentBinding2_IN, InEntryCount) + GetPersistentBinding2_IN_InEntryCount_SIZE) - -typedef struct _GetPersistentBinding2_OUT -{ - // - ULONG HBAStatus; - #define GetPersistentBinding2_OUT_HBAStatus_SIZE sizeof(ULONG) - #define GetPersistentBinding2_OUT_HBAStatus_ID 3 - - // - ULONG TotalEntryCount; - #define GetPersistentBinding2_OUT_TotalEntryCount_SIZE sizeof(ULONG) - #define GetPersistentBinding2_OUT_TotalEntryCount_ID 4 - - // - ULONG OutEntryCount; - #define GetPersistentBinding2_OUT_OutEntryCount_SIZE sizeof(ULONG) - #define GetPersistentBinding2_OUT_OutEntryCount_ID 5 - - // - HBAFCPBindingEntry2 Bindings[1]; - #define GetPersistentBinding2_OUT_Bindings_ID 6 - -} GetPersistentBinding2_OUT, *PGetPersistentBinding2_OUT; - - - -//********************************************************************* -// -// A call to HBA_SetPersistentBindingV2 will call SetPersistentEntry -// once for each binding entry. -// Each binding entry that SetPersistentEntry accepts will be stored -// in the registry. -// -// Persistent bindings are stored in the registry under: -// -// System\CurrentControlSet\Control\Storage\FC\ -// -// under the REG_BINARY key Bindings is the struct: -// -// typedef struct { -// ULONG Version; -// HBA_FCPBINDING2 Bindings; -// } HBAP_PERSISTENT_BINDINGS, *PHBAP_PERSISTENT_BINDINGS; -// -// This is done so that storport capable drivers may have access to -// this information during boot -// -//******************************************************************** - -#define HBA_REGISTRY_BINDING_VERSION (1) -#define HBA_REGISTRY_BINDING_RELATIVE_PATH L"System\\CurrentControlSet\\Control\\Storage\\FC" -#define HBA_REGISTRY_BINDING_KEY L"Bindings" - - -#define SetPersistentEntry 7 -typedef struct _SetPersistentEntry_IN -{ - // - UCHAR PortWWN[8]; - #define SetPersistentEntry_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SetPersistentEntry_IN_PortWWN_ID 1 - - // - HBAFCPBindingEntry2 Binding; - #define SetPersistentEntry_IN_Binding_SIZE sizeof(HBAFCPBindingEntry2) - #define SetPersistentEntry_IN_Binding_ID 2 - -} SetPersistentEntry_IN, *PSetPersistentEntry_IN; - -#define SetPersistentEntry_IN_SIZE (FIELD_OFFSET(SetPersistentEntry_IN, Binding) + SetPersistentEntry_IN_Binding_SIZE) - -typedef struct _SetPersistentEntry_OUT -{ - // - ULONG HBAStatus; - #define SetPersistentEntry_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SetPersistentEntry_OUT_HBAStatus_ID 3 - -} SetPersistentEntry_OUT, *PSetPersistentEntry_OUT; - -#define SetPersistentEntry_OUT_SIZE (FIELD_OFFSET(SetPersistentEntry_OUT, HBAStatus) + SetPersistentEntry_OUT_HBAStatus_SIZE) - -#define RemovePersistentEntry 8 -typedef struct _RemovePersistentEntry_IN -{ - // - UCHAR PortWWN[8]; - #define RemovePersistentEntry_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define RemovePersistentEntry_IN_PortWWN_ID 1 - - // - HBAFCPBindingEntry2 Binding; - #define RemovePersistentEntry_IN_Binding_SIZE sizeof(HBAFCPBindingEntry2) - #define RemovePersistentEntry_IN_Binding_ID 2 - -} RemovePersistentEntry_IN, *PRemovePersistentEntry_IN; - -#define RemovePersistentEntry_IN_SIZE (FIELD_OFFSET(RemovePersistentEntry_IN, Binding) + RemovePersistentEntry_IN_Binding_SIZE) - -typedef struct _RemovePersistentEntry_OUT -{ - // - ULONG HBAStatus; - #define RemovePersistentEntry_OUT_HBAStatus_SIZE sizeof(ULONG) - #define RemovePersistentEntry_OUT_HBAStatus_ID 3 - -} RemovePersistentEntry_OUT, *PRemovePersistentEntry_OUT; - -#define RemovePersistentEntry_OUT_SIZE (FIELD_OFFSET(RemovePersistentEntry_OUT, HBAStatus) + RemovePersistentEntry_OUT_HBAStatus_SIZE) - - -// MSFC_AdapterEvent - MSFC_AdapterEvent -#define MSFC_AdapterEventGuid \ - { 0xe9e47403,0xd1d7,0x43f8, { 0x8e,0xe3,0x53,0xcd,0xbf,0xff,0x56,0x46 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_AdapterEvent_GUID, \ - 0xe9e47403,0xd1d7,0x43f8,0x8e,0xe3,0x53,0xcd,0xbf,0xff,0x56,0x46); -#endif - - -typedef struct _MSFC_AdapterEvent -{ - // - ULONG EventType; - #define MSFC_AdapterEvent_EventType_SIZE sizeof(ULONG) - #define MSFC_AdapterEvent_EventType_ID 1 - - // - UCHAR PortWWN[8]; - #define MSFC_AdapterEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_AdapterEvent_PortWWN_ID 2 - -} MSFC_AdapterEvent, *PMSFC_AdapterEvent; - -#define MSFC_AdapterEvent_SIZE (FIELD_OFFSET(MSFC_AdapterEvent, PortWWN) + MSFC_AdapterEvent_PortWWN_SIZE) - -// MSFC_PortEvent - MSFC_PortEvent -#define MSFC_PortEventGuid \ - { 0x095fbe97,0x3876,0x48ef, { 0x8a,0x04,0x1c,0x55,0x93,0x5d,0x0d,0xf5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_PortEvent_GUID, \ - 0x095fbe97,0x3876,0x48ef,0x8a,0x04,0x1c,0x55,0x93,0x5d,0x0d,0xf5); -#endif - - -typedef struct _MSFC_PortEvent -{ - // - ULONG EventType; - #define MSFC_PortEvent_EventType_SIZE sizeof(ULONG) - #define MSFC_PortEvent_EventType_ID 1 - - // - ULONG FabricPortId; - #define MSFC_PortEvent_FabricPortId_SIZE sizeof(ULONG) - #define MSFC_PortEvent_FabricPortId_ID 2 - - // - UCHAR PortWWN[8]; - #define MSFC_PortEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_PortEvent_PortWWN_ID 3 - -} MSFC_PortEvent, *PMSFC_PortEvent; - -#define MSFC_PortEvent_SIZE (FIELD_OFFSET(MSFC_PortEvent, PortWWN) + MSFC_PortEvent_PortWWN_SIZE) - -// MSFC_TargetEvent - MSFC_TargetEvent -#define MSFC_TargetEventGuid \ - { 0xcfa6ef26,0x8675,0x4e27, { 0x9a,0x0b,0xb4,0xa8,0x60,0xdd,0xd0,0xf3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_TargetEvent_GUID, \ - 0xcfa6ef26,0x8675,0x4e27,0x9a,0x0b,0xb4,0xa8,0x60,0xdd,0xd0,0xf3); -#endif - - -typedef struct _MSFC_TargetEvent -{ - // - ULONG EventType; - #define MSFC_TargetEvent_EventType_SIZE sizeof(ULONG) - #define MSFC_TargetEvent_EventType_ID 1 - - // - UCHAR PortWWN[8]; - #define MSFC_TargetEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_TargetEvent_PortWWN_ID 2 - - // - UCHAR DiscoveredPortWWN[8]; - #define MSFC_TargetEvent_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_TargetEvent_DiscoveredPortWWN_ID 3 - -} MSFC_TargetEvent, *PMSFC_TargetEvent; - -#define MSFC_TargetEvent_SIZE (FIELD_OFFSET(MSFC_TargetEvent, DiscoveredPortWWN) + MSFC_TargetEvent_DiscoveredPortWWN_SIZE) - -// MSFC_EventControl - MSFC_EventControl -#define MSFC_EventControlGuid \ - { 0xa251ccb3,0x5ab0,0x411b, { 0x87,0x71,0x54,0x30,0xef,0x53,0xa2,0x6c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_EventControl_GUID, \ - 0xa251ccb3,0x5ab0,0x411b,0x87,0x71,0x54,0x30,0xef,0x53,0xa2,0x6c); -#endif - -// -// Method id definitions for MSFC_EventControl -#define AddTarget 10 -typedef struct _AddTarget_IN -{ - // - UCHAR HbaPortWWN[8]; - #define AddTarget_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define AddTarget_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define AddTarget_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define AddTarget_IN_DiscoveredPortWWN_ID 2 - - // - ULONG AllTargets; - #define AddTarget_IN_AllTargets_SIZE sizeof(ULONG) - #define AddTarget_IN_AllTargets_ID 3 - -} AddTarget_IN, *PAddTarget_IN; - -#define AddTarget_IN_SIZE (FIELD_OFFSET(AddTarget_IN, AllTargets) + AddTarget_IN_AllTargets_SIZE) - -typedef struct _AddTarget_OUT -{ - // - ULONG HBAStatus; - #define AddTarget_OUT_HBAStatus_SIZE sizeof(ULONG) - #define AddTarget_OUT_HBAStatus_ID 4 - -} AddTarget_OUT, *PAddTarget_OUT; - -#define AddTarget_OUT_SIZE (FIELD_OFFSET(AddTarget_OUT, HBAStatus) + AddTarget_OUT_HBAStatus_SIZE) - -#define RemoveTarget 11 -typedef struct _RemoveTarget_IN -{ - // - UCHAR HbaPortWWN[8]; - #define RemoveTarget_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define RemoveTarget_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define RemoveTarget_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define RemoveTarget_IN_DiscoveredPortWWN_ID 2 - - // - ULONG AllTargets; - #define RemoveTarget_IN_AllTargets_SIZE sizeof(ULONG) - #define RemoveTarget_IN_AllTargets_ID 3 - -} RemoveTarget_IN, *PRemoveTarget_IN; - -#define RemoveTarget_IN_SIZE (FIELD_OFFSET(RemoveTarget_IN, AllTargets) + RemoveTarget_IN_AllTargets_SIZE) - -typedef struct _RemoveTarget_OUT -{ - // - ULONG HBAStatus; - #define RemoveTarget_OUT_HBAStatus_SIZE sizeof(ULONG) - #define RemoveTarget_OUT_HBAStatus_ID 4 - -} RemoveTarget_OUT, *PRemoveTarget_OUT; - -#define RemoveTarget_OUT_SIZE (FIELD_OFFSET(RemoveTarget_OUT, HBAStatus) + RemoveTarget_OUT_HBAStatus_SIZE) - -#define AddPort 20 -typedef struct _AddPort_IN -{ - // - UCHAR PortWWN[8]; - #define AddPort_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define AddPort_IN_PortWWN_ID 1 - -} AddPort_IN, *PAddPort_IN; - -#define AddPort_IN_SIZE (FIELD_OFFSET(AddPort_IN, PortWWN) + AddPort_IN_PortWWN_SIZE) - -typedef struct _AddPort_OUT -{ - // - ULONG HBAStatus; - #define AddPort_OUT_HBAStatus_SIZE sizeof(ULONG) - #define AddPort_OUT_HBAStatus_ID 2 - -} AddPort_OUT, *PAddPort_OUT; - -#define AddPort_OUT_SIZE (FIELD_OFFSET(AddPort_OUT, HBAStatus) + AddPort_OUT_HBAStatus_SIZE) - -#define RemovePort 21 -typedef struct _RemovePort_IN -{ - // - UCHAR PortWWN[8]; - #define RemovePort_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define RemovePort_IN_PortWWN_ID 1 - -} RemovePort_IN, *PRemovePort_IN; - -#define RemovePort_IN_SIZE (FIELD_OFFSET(RemovePort_IN, PortWWN) + RemovePort_IN_PortWWN_SIZE) - -typedef struct _RemovePort_OUT -{ - // - ULONG HBAStatus; - #define RemovePort_OUT_HBAStatus_SIZE sizeof(ULONG) - #define RemovePort_OUT_HBAStatus_ID 2 - -} RemovePort_OUT, *PRemovePort_OUT; - -#define RemovePort_OUT_SIZE (FIELD_OFFSET(RemovePort_OUT, HBAStatus) + RemovePort_OUT_HBAStatus_SIZE) - -#define AddLink 30 -typedef struct _AddLink_OUT -{ - // - ULONG HBAStatus; - #define AddLink_OUT_HBAStatus_SIZE sizeof(ULONG) - #define AddLink_OUT_HBAStatus_ID 1 - -} AddLink_OUT, *PAddLink_OUT; - -#define AddLink_OUT_SIZE (FIELD_OFFSET(AddLink_OUT, HBAStatus) + AddLink_OUT_HBAStatus_SIZE) - -#define RemoveLink 31 -typedef struct _RemoveLink_OUT -{ - // - ULONG HBAStatus; - #define RemoveLink_OUT_HBAStatus_SIZE sizeof(ULONG) - #define RemoveLink_OUT_HBAStatus_ID 1 - -} RemoveLink_OUT, *PRemoveLink_OUT; - -#define RemoveLink_OUT_SIZE (FIELD_OFFSET(RemoveLink_OUT, HBAStatus) + RemoveLink_OUT_HBAStatus_SIZE) - - -// MS_SM_AdapterInformationQuery - MS_SM_AdapterInformationQuery - - -#endif // MSFC_HBA_API - -#ifdef MS_SM_HBA_API - -#define MS_SM_AdapterInformationQueryGuid \ - { 0xbdc67efa,0xe5e7,0x4777, { 0xb1,0x3c,0x62,0x14,0x59,0x65,0x70,0x99 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_AdapterInformationQuery_GUID, \ - 0xbdc67efa,0xe5e7,0x4777,0xb1,0x3c,0x62,0x14,0x59,0x65,0x70,0x99); -#endif - - -typedef struct _MS_SM_AdapterInformationQuery -{ - // - ULONGLONG UniqueAdapterId; - #define MS_SM_AdapterInformationQuery_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MS_SM_AdapterInformationQuery_UniqueAdapterId_ID 1 - - // - ULONG HBAStatus; - #define MS_SM_AdapterInformationQuery_HBAStatus_SIZE sizeof(ULONG) - #define MS_SM_AdapterInformationQuery_HBAStatus_ID 2 - - // - ULONG NumberOfPorts; - #define MS_SM_AdapterInformationQuery_NumberOfPorts_SIZE sizeof(ULONG) - #define MS_SM_AdapterInformationQuery_NumberOfPorts_ID 3 - - // - ULONG VendorSpecificID; - #define MS_SM_AdapterInformationQuery_VendorSpecificID_SIZE sizeof(ULONG) - #define MS_SM_AdapterInformationQuery_VendorSpecificID_ID 4 - - - - //****************************************************************** - // - // The string type is variable length (up to MaxLen). - // Each string starts with a ushort that holds the strings length - // (in bytes) followed by the WCHARs that make up the string. - // - //****************************************************************** - - - // - WCHAR Manufacturer[64 + 1]; - #define MS_SM_AdapterInformationQuery_Manufacturer_ID 5 - - // - WCHAR SerialNumber[64 + 1]; - #define MS_SM_AdapterInformationQuery_SerialNumber_ID 6 - - // - WCHAR Model[256 + 1]; - #define MS_SM_AdapterInformationQuery_Model_ID 7 - - // - WCHAR ModelDescription[256 + 1]; - #define MS_SM_AdapterInformationQuery_ModelDescription_ID 8 - - // - WCHAR HardwareVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_HardwareVersion_ID 9 - - // - WCHAR DriverVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_DriverVersion_ID 10 - - // - WCHAR OptionROMVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_OptionROMVersion_ID 11 - - // - WCHAR FirmwareVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_FirmwareVersion_ID 12 - - // - WCHAR DriverName[256 + 1]; - #define MS_SM_AdapterInformationQuery_DriverName_ID 13 - - // - WCHAR HBASymbolicName[256 + 1]; - #define MS_SM_AdapterInformationQuery_HBASymbolicName_ID 14 - - // - WCHAR RedundantOptionROMVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_RedundantOptionROMVersion_ID 15 - - // - WCHAR RedundantFirmwareVersion[256 + 1]; - #define MS_SM_AdapterInformationQuery_RedundantFirmwareVersion_ID 16 - - // - WCHAR MfgDomain[256 + 1]; - #define MS_SM_AdapterInformationQuery_MfgDomain_ID 17 - -} MS_SM_AdapterInformationQuery, *PMS_SM_AdapterInformationQuery; - -// MS_SMHBA_FC_Port - MS_SMHBA_FC_Port -#define MS_SMHBA_FC_PortGuid \ - { 0x96b827a7,0x2b4a,0x49c8, { 0x90,0x97,0x07,0x82,0x00,0xc5,0xa5,0xcd } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_FC_Port_GUID, \ - 0x96b827a7,0x2b4a,0x49c8,0x90,0x97,0x07,0x82,0x00,0xc5,0xa5,0xcd); -#endif - - -typedef struct _MS_SMHBA_FC_Port -{ - // - UCHAR NodeWWN[8]; - #define MS_SMHBA_FC_Port_NodeWWN_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_FC_Port_NodeWWN_ID 1 - - // - UCHAR PortWWN[8]; - #define MS_SMHBA_FC_Port_PortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_FC_Port_PortWWN_ID 2 - - // - ULONG FcId; - #define MS_SMHBA_FC_Port_FcId_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_Port_FcId_ID 3 - - // - ULONG PortSupportedClassofService; - #define MS_SMHBA_FC_Port_PortSupportedClassofService_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_Port_PortSupportedClassofService_ID 4 - - // - UCHAR PortSupportedFc4Types[32]; - #define MS_SMHBA_FC_Port_PortSupportedFc4Types_SIZE sizeof(UCHAR[32]) - #define MS_SMHBA_FC_Port_PortSupportedFc4Types_ID 5 - - // - UCHAR PortActiveFc4Types[32]; - #define MS_SMHBA_FC_Port_PortActiveFc4Types_SIZE sizeof(UCHAR[32]) - #define MS_SMHBA_FC_Port_PortActiveFc4Types_ID 6 - - // - UCHAR FabricName[8]; - #define MS_SMHBA_FC_Port_FabricName_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_FC_Port_FabricName_ID 7 - - // - ULONG NumberofDiscoveredPorts; - #define MS_SMHBA_FC_Port_NumberofDiscoveredPorts_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_Port_NumberofDiscoveredPorts_ID 8 - - // - UCHAR NumberofPhys; - #define MS_SMHBA_FC_Port_NumberofPhys_SIZE sizeof(UCHAR) - #define MS_SMHBA_FC_Port_NumberofPhys_ID 9 - - // - WCHAR PortSymbolicName[256 + 1]; - #define MS_SMHBA_FC_Port_PortSymbolicName_ID 10 - -} MS_SMHBA_FC_Port, *PMS_SMHBA_FC_Port; - -// MS_SMHBA_SAS_Port - MS_SMHBA_SAS_Port -#define MS_SMHBA_SAS_PortGuid \ - { 0xb914e34f,0x7b80,0x46b0, { 0x80,0x34,0x6d,0x9b,0x68,0x9e,0x1d,0xdd } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_SAS_Port_GUID, \ - 0xb914e34f,0x7b80,0x46b0,0x80,0x34,0x6d,0x9b,0x68,0x9e,0x1d,0xdd); -#endif - - -typedef struct _MS_SMHBA_SAS_Port -{ - // - ULONG PortProtocol; - #define MS_SMHBA_SAS_Port_PortProtocol_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_Port_PortProtocol_ID 1 - - // - UCHAR LocalSASAddress[8]; - #define MS_SMHBA_SAS_Port_LocalSASAddress_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_SAS_Port_LocalSASAddress_ID 2 - - // - UCHAR AttachedSASAddress[8]; - #define MS_SMHBA_SAS_Port_AttachedSASAddress_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_SAS_Port_AttachedSASAddress_ID 3 - - // - ULONG NumberofDiscoveredPorts; - #define MS_SMHBA_SAS_Port_NumberofDiscoveredPorts_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_Port_NumberofDiscoveredPorts_ID 4 - - // - ULONG NumberofPhys; - #define MS_SMHBA_SAS_Port_NumberofPhys_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_Port_NumberofPhys_ID 5 - -} MS_SMHBA_SAS_Port, *PMS_SMHBA_SAS_Port; - -#define MS_SMHBA_SAS_Port_SIZE (FIELD_OFFSET(MS_SMHBA_SAS_Port, NumberofPhys) + MS_SMHBA_SAS_Port_NumberofPhys_SIZE) - -// MS_SMHBA_PORTATTRIBUTES - MS_SMHBA_PORTATTRIBUTES -#define MS_SMHBA_PORTATTRIBUTESGuid \ - { 0x50a97b2d,0x99ad,0x4cf9, { 0x84,0x37,0xb4,0xea,0x0c,0x07,0xbe,0x4c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_PORTATTRIBUTES_GUID, \ - 0x50a97b2d,0x99ad,0x4cf9,0x84,0x37,0xb4,0xea,0x0c,0x07,0xbe,0x4c); -#endif - - -typedef struct _MS_SMHBA_PORTATTRIBUTES -{ - // - ULONG PortType; - #define MS_SMHBA_PORTATTRIBUTES_PortType_SIZE sizeof(ULONG) - #define MS_SMHBA_PORTATTRIBUTES_PortType_ID 1 - - // - ULONG PortState; - #define MS_SMHBA_PORTATTRIBUTES_PortState_SIZE sizeof(ULONG) - #define MS_SMHBA_PORTATTRIBUTES_PortState_ID 2 - - // - ULONG PortSpecificAttributesSize; - #define MS_SMHBA_PORTATTRIBUTES_PortSpecificAttributesSize_SIZE sizeof(ULONG) - #define MS_SMHBA_PORTATTRIBUTES_PortSpecificAttributesSize_ID 3 - - // - WCHAR OSDeviceName[256 + 1]; - #define MS_SMHBA_PORTATTRIBUTES_OSDeviceName_ID 4 - - // - ULONGLONG Reserved; - #define MS_SMHBA_PORTATTRIBUTES_Reserved_SIZE sizeof(ULONGLONG) - #define MS_SMHBA_PORTATTRIBUTES_Reserved_ID 5 - - // - UCHAR PortSpecificAttributes[1]; - #define MS_SMHBA_PORTATTRIBUTES_PortSpecificAttributes_ID 6 - -} MS_SMHBA_PORTATTRIBUTES, *PMS_SMHBA_PORTATTRIBUTES; - -// MS_SMHBA_PROTOCOLSTATISTICS - MS_SMHBA_PROTOCOLSTATISTICS -#define MS_SMHBA_PROTOCOLSTATISTICSGuid \ - { 0xb557bd86,0x4128,0x4d5c, { 0xb6,0xe6,0xb6,0x5f,0x9b,0xd6,0x87,0x22 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_PROTOCOLSTATISTICS_GUID, \ - 0xb557bd86,0x4128,0x4d5c,0xb6,0xe6,0xb6,0x5f,0x9b,0xd6,0x87,0x22); -#endif - - -typedef struct _MS_SMHBA_PROTOCOLSTATISTICS -{ - // - LONGLONG SecondsSinceLastReset; - #define MS_SMHBA_PROTOCOLSTATISTICS_SecondsSinceLastReset_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_SecondsSinceLastReset_ID 1 - - // - LONGLONG InputRequests; - #define MS_SMHBA_PROTOCOLSTATISTICS_InputRequests_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_InputRequests_ID 2 - - // - LONGLONG OutputRequests; - #define MS_SMHBA_PROTOCOLSTATISTICS_OutputRequests_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_OutputRequests_ID 3 - - // - LONGLONG ControlRequests; - #define MS_SMHBA_PROTOCOLSTATISTICS_ControlRequests_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_ControlRequests_ID 4 - - // - LONGLONG InputMegabytes; - #define MS_SMHBA_PROTOCOLSTATISTICS_InputMegabytes_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_InputMegabytes_ID 5 - - // - LONGLONG OutputMegabytes; - #define MS_SMHBA_PROTOCOLSTATISTICS_OutputMegabytes_SIZE sizeof(LONGLONG) - #define MS_SMHBA_PROTOCOLSTATISTICS_OutputMegabytes_ID 6 - -} MS_SMHBA_PROTOCOLSTATISTICS, *PMS_SMHBA_PROTOCOLSTATISTICS; - -#define MS_SMHBA_PROTOCOLSTATISTICS_SIZE (FIELD_OFFSET(MS_SMHBA_PROTOCOLSTATISTICS, OutputMegabytes) + MS_SMHBA_PROTOCOLSTATISTICS_OutputMegabytes_SIZE) - -// MS_SMHBA_SASPHYSTATISTICS - MS_SMHBA_SASPHYSTATISTICS -#define MS_SMHBA_SASPHYSTATISTICSGuid \ - { 0xbd458e7d,0xc40a,0x4401, { 0xa1,0x79,0x11,0x91,0x9c,0xbc,0xc5,0xc6 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_SASPHYSTATISTICS_GUID, \ - 0xbd458e7d,0xc40a,0x4401,0xa1,0x79,0x11,0x91,0x9c,0xbc,0xc5,0xc6); -#endif - - -typedef struct _MS_SMHBA_SASPHYSTATISTICS -{ - // - LONGLONG SecondsSinceLastReset; - #define MS_SMHBA_SASPHYSTATISTICS_SecondsSinceLastReset_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_SecondsSinceLastReset_ID 1 - - // - LONGLONG TxFrames; - #define MS_SMHBA_SASPHYSTATISTICS_TxFrames_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_TxFrames_ID 2 - - // - LONGLONG TxWords; - #define MS_SMHBA_SASPHYSTATISTICS_TxWords_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_TxWords_ID 3 - - // - LONGLONG RxFrames; - #define MS_SMHBA_SASPHYSTATISTICS_RxFrames_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_RxFrames_ID 4 - - // - LONGLONG RxWords; - #define MS_SMHBA_SASPHYSTATISTICS_RxWords_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_RxWords_ID 5 - - // - LONGLONG InvalidDwordCount; - #define MS_SMHBA_SASPHYSTATISTICS_InvalidDwordCount_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_InvalidDwordCount_ID 6 - - // - LONGLONG RunningDisparityErrorCount; - #define MS_SMHBA_SASPHYSTATISTICS_RunningDisparityErrorCount_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_RunningDisparityErrorCount_ID 7 - - // - LONGLONG LossofDwordSyncCount; - #define MS_SMHBA_SASPHYSTATISTICS_LossofDwordSyncCount_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_LossofDwordSyncCount_ID 8 - - // - LONGLONG PhyResetProblemCount; - #define MS_SMHBA_SASPHYSTATISTICS_PhyResetProblemCount_SIZE sizeof(LONGLONG) - #define MS_SMHBA_SASPHYSTATISTICS_PhyResetProblemCount_ID 9 - -} MS_SMHBA_SASPHYSTATISTICS, *PMS_SMHBA_SASPHYSTATISTICS; - -#define MS_SMHBA_SASPHYSTATISTICS_SIZE (FIELD_OFFSET(MS_SMHBA_SASPHYSTATISTICS, PhyResetProblemCount) + MS_SMHBA_SASPHYSTATISTICS_PhyResetProblemCount_SIZE) - -// MS_SMHBA_FC_PHY - MS_SMHBA_FC_PHY -#define MS_SMHBA_FC_PHYGuid \ - { 0xfb66c8fe,0x1da0,0x48a2, { 0x92,0xdb,0x02,0xc3,0x41,0x14,0x3c,0x46 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_FC_PHY_GUID, \ - 0xfb66c8fe,0x1da0,0x48a2,0x92,0xdb,0x02,0xc3,0x41,0x14,0x3c,0x46); -#endif - - -typedef struct _MS_SMHBA_FC_PHY -{ - // - ULONG PhySupportSpeed; - #define MS_SMHBA_FC_PHY_PhySupportSpeed_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_PHY_PhySupportSpeed_ID 1 - - // - ULONG PhySpeed; - #define MS_SMHBA_FC_PHY_PhySpeed_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_PHY_PhySpeed_ID 2 - - // - UCHAR PhyType; - #define MS_SMHBA_FC_PHY_PhyType_SIZE sizeof(UCHAR) - #define MS_SMHBA_FC_PHY_PhyType_ID 3 - - // - ULONG MaxFrameSize; - #define MS_SMHBA_FC_PHY_MaxFrameSize_SIZE sizeof(ULONG) - #define MS_SMHBA_FC_PHY_MaxFrameSize_ID 4 - -} MS_SMHBA_FC_PHY, *PMS_SMHBA_FC_PHY; - -#define MS_SMHBA_FC_PHY_SIZE (FIELD_OFFSET(MS_SMHBA_FC_PHY, MaxFrameSize) + MS_SMHBA_FC_PHY_MaxFrameSize_SIZE) - -// MS_SMHBA_SAS_PHY - MS_SMHBA_SAS_PHY -#define MS_SMHBA_SAS_PHYGuid \ - { 0xdde0a090,0x96bc,0x452b, { 0x9a,0x64,0x6f,0xbb,0x6a,0x19,0xc4,0x7d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_SAS_PHY_GUID, \ - 0xdde0a090,0x96bc,0x452b,0x9a,0x64,0x6f,0xbb,0x6a,0x19,0xc4,0x7d); -#endif - - -typedef struct _MS_SMHBA_SAS_PHY -{ - // - UCHAR PhyIdentifier; - #define MS_SMHBA_SAS_PHY_PhyIdentifier_SIZE sizeof(UCHAR) - #define MS_SMHBA_SAS_PHY_PhyIdentifier_ID 1 - - // - ULONG NegotiatedLinkRate; - #define MS_SMHBA_SAS_PHY_NegotiatedLinkRate_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_PHY_NegotiatedLinkRate_ID 2 - - // - ULONG ProgrammedMinLinkRate; - #define MS_SMHBA_SAS_PHY_ProgrammedMinLinkRate_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_PHY_ProgrammedMinLinkRate_ID 3 - - // - ULONG HardwareMinLinkRate; - #define MS_SMHBA_SAS_PHY_HardwareMinLinkRate_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_PHY_HardwareMinLinkRate_ID 4 - - // - ULONG ProgrammedMaxLinkRate; - #define MS_SMHBA_SAS_PHY_ProgrammedMaxLinkRate_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_PHY_ProgrammedMaxLinkRate_ID 5 - - // - ULONG HardwareMaxLinkRate; - #define MS_SMHBA_SAS_PHY_HardwareMaxLinkRate_SIZE sizeof(ULONG) - #define MS_SMHBA_SAS_PHY_HardwareMaxLinkRate_ID 6 - - // - UCHAR domainPortWWN[8]; - #define MS_SMHBA_SAS_PHY_domainPortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_SAS_PHY_domainPortWWN_ID 7 - -} MS_SMHBA_SAS_PHY, *PMS_SMHBA_SAS_PHY; - -#define MS_SMHBA_SAS_PHY_SIZE (FIELD_OFFSET(MS_SMHBA_SAS_PHY, domainPortWWN) + MS_SMHBA_SAS_PHY_domainPortWWN_SIZE) - -// MS_SM_PortInformationMethods - MS_SM_PortInformationMethods -#define MS_SM_PortInformationMethodsGuid \ - { 0x5b6a8b86,0x708d,0x4ec6, { 0x82,0xa6,0x39,0xad,0xcf,0x6f,0x64,0x33 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_PortInformationMethods_GUID, \ - 0x5b6a8b86,0x708d,0x4ec6,0x82,0xa6,0x39,0xad,0xcf,0x6f,0x64,0x33); -#endif - -// -// Method id definitions for MS_SM_PortInformationMethods -#define SM_GetPortType 1 -typedef struct _SM_GetPortType_IN -{ - // - ULONG PortIndex; - #define SM_GetPortType_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetPortType_IN_PortIndex_ID 1 - -} SM_GetPortType_IN, *PSM_GetPortType_IN; - -#define SM_GetPortType_IN_SIZE (FIELD_OFFSET(SM_GetPortType_IN, PortIndex) + SM_GetPortType_IN_PortIndex_SIZE) - -typedef struct _SM_GetPortType_OUT -{ - // - ULONG HBAStatus; - #define SM_GetPortType_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetPortType_OUT_HBAStatus_ID 2 - - // - ULONG PortType; - #define SM_GetPortType_OUT_PortType_SIZE sizeof(ULONG) - #define SM_GetPortType_OUT_PortType_ID 3 - -} SM_GetPortType_OUT, *PSM_GetPortType_OUT; - -#define SM_GetPortType_OUT_SIZE (FIELD_OFFSET(SM_GetPortType_OUT, PortType) + SM_GetPortType_OUT_PortType_SIZE) - -#define SM_GetAdapterPortAttributes 2 -typedef struct _SM_GetAdapterPortAttributes_IN -{ - // - ULONG PortIndex; - #define SM_GetAdapterPortAttributes_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetAdapterPortAttributes_IN_PortIndex_ID 1 - - -#define SM_PORT_SPECIFIC_ATTRIBUTES_MAXSIZE max(sizeof(MS_SMHBA_FC_Port), sizeof(MS_SMHBA_SAS_Port)) - // - ULONG PortSpecificAttributesMaxSize; - #define SM_GetAdapterPortAttributes_IN_PortSpecificAttributesMaxSize_SIZE sizeof(ULONG) - #define SM_GetAdapterPortAttributes_IN_PortSpecificAttributesMaxSize_ID 2 - -} SM_GetAdapterPortAttributes_IN, *PSM_GetAdapterPortAttributes_IN; - -#define SM_GetAdapterPortAttributes_IN_SIZE (FIELD_OFFSET(SM_GetAdapterPortAttributes_IN, PortSpecificAttributesMaxSize) + SM_GetAdapterPortAttributes_IN_PortSpecificAttributesMaxSize_SIZE) - -typedef struct _SM_GetAdapterPortAttributes_OUT -{ - // - ULONG HBAStatus; - #define SM_GetAdapterPortAttributes_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetAdapterPortAttributes_OUT_HBAStatus_ID 3 - - // - MS_SMHBA_PORTATTRIBUTES PortAttributes; - #define SM_GetAdapterPortAttributes_OUT_PortAttributes_SIZE sizeof(MS_SMHBA_PORTATTRIBUTES) - #define SM_GetAdapterPortAttributes_OUT_PortAttributes_ID 4 - -} SM_GetAdapterPortAttributes_OUT, *PSM_GetAdapterPortAttributes_OUT; - -#define SM_GetAdapterPortAttributes_OUT_SIZE (FIELD_OFFSET(SM_GetAdapterPortAttributes_OUT, PortAttributes) + SM_GetAdapterPortAttributes_OUT_PortAttributes_SIZE) - -#define SM_GetDiscoveredPortAttributes 3 -typedef struct _SM_GetDiscoveredPortAttributes_IN -{ - // - ULONG PortIndex; - #define SM_GetDiscoveredPortAttributes_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetDiscoveredPortAttributes_IN_PortIndex_ID 1 - - // - ULONG DiscoveredPortIndex; - #define SM_GetDiscoveredPortAttributes_IN_DiscoveredPortIndex_SIZE sizeof(ULONG) - #define SM_GetDiscoveredPortAttributes_IN_DiscoveredPortIndex_ID 2 - - // - ULONG PortSpecificAttributesMaxSize; - #define SM_GetDiscoveredPortAttributes_IN_PortSpecificAttributesMaxSize_SIZE sizeof(ULONG) - #define SM_GetDiscoveredPortAttributes_IN_PortSpecificAttributesMaxSize_ID 3 - -} SM_GetDiscoveredPortAttributes_IN, *PSM_GetDiscoveredPortAttributes_IN; - -#define SM_GetDiscoveredPortAttributes_IN_SIZE (FIELD_OFFSET(SM_GetDiscoveredPortAttributes_IN, PortSpecificAttributesMaxSize) + SM_GetDiscoveredPortAttributes_IN_PortSpecificAttributesMaxSize_SIZE) - -typedef struct _SM_GetDiscoveredPortAttributes_OUT -{ - // - ULONG HBAStatus; - #define SM_GetDiscoveredPortAttributes_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetDiscoveredPortAttributes_OUT_HBAStatus_ID 4 - - // - MS_SMHBA_PORTATTRIBUTES PortAttributes; - #define SM_GetDiscoveredPortAttributes_OUT_PortAttributes_SIZE sizeof(MS_SMHBA_PORTATTRIBUTES) - #define SM_GetDiscoveredPortAttributes_OUT_PortAttributes_ID 5 - -} SM_GetDiscoveredPortAttributes_OUT, *PSM_GetDiscoveredPortAttributes_OUT; - -#define SM_GetDiscoveredPortAttributes_OUT_SIZE (FIELD_OFFSET(SM_GetDiscoveredPortAttributes_OUT, PortAttributes) + SM_GetDiscoveredPortAttributes_OUT_PortAttributes_SIZE) - -#define SM_GetPortAttributesByWWN 4 -typedef struct _SM_GetPortAttributesByWWN_IN -{ - // - UCHAR PortWWN[8]; - #define SM_GetPortAttributesByWWN_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetPortAttributesByWWN_IN_PortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_GetPortAttributesByWWN_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetPortAttributesByWWN_IN_DomainPortWWN_ID 2 - - // - ULONG PortSpecificAttributesMaxSize; - #define SM_GetPortAttributesByWWN_IN_PortSpecificAttributesMaxSize_SIZE sizeof(ULONG) - #define SM_GetPortAttributesByWWN_IN_PortSpecificAttributesMaxSize_ID 3 - -} SM_GetPortAttributesByWWN_IN, *PSM_GetPortAttributesByWWN_IN; - -#define SM_GetPortAttributesByWWN_IN_SIZE (FIELD_OFFSET(SM_GetPortAttributesByWWN_IN, PortSpecificAttributesMaxSize) + SM_GetPortAttributesByWWN_IN_PortSpecificAttributesMaxSize_SIZE) - -typedef struct _SM_GetPortAttributesByWWN_OUT -{ - // - ULONG HBAStatus; - #define SM_GetPortAttributesByWWN_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetPortAttributesByWWN_OUT_HBAStatus_ID 4 - - // - MS_SMHBA_PORTATTRIBUTES PortAttributes; - #define SM_GetPortAttributesByWWN_OUT_PortAttributes_SIZE sizeof(MS_SMHBA_PORTATTRIBUTES) - #define SM_GetPortAttributesByWWN_OUT_PortAttributes_ID 5 - -} SM_GetPortAttributesByWWN_OUT, *PSM_GetPortAttributesByWWN_OUT; - -#define SM_GetPortAttributesByWWN_OUT_SIZE (FIELD_OFFSET(SM_GetPortAttributesByWWN_OUT, PortAttributes) + SM_GetPortAttributesByWWN_OUT_PortAttributes_SIZE) - -#define SM_GetProtocolStatistics 5 -typedef struct _SM_GetProtocolStatistics_IN -{ - // - ULONG PortIndex; - #define SM_GetProtocolStatistics_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetProtocolStatistics_IN_PortIndex_ID 1 - - // - ULONG ProtocolType; - #define SM_GetProtocolStatistics_IN_ProtocolType_SIZE sizeof(ULONG) - #define SM_GetProtocolStatistics_IN_ProtocolType_ID 2 - -} SM_GetProtocolStatistics_IN, *PSM_GetProtocolStatistics_IN; - -#define SM_GetProtocolStatistics_IN_SIZE (FIELD_OFFSET(SM_GetProtocolStatistics_IN, ProtocolType) + SM_GetProtocolStatistics_IN_ProtocolType_SIZE) - -typedef struct _SM_GetProtocolStatistics_OUT -{ - // - ULONG HBAStatus; - #define SM_GetProtocolStatistics_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetProtocolStatistics_OUT_HBAStatus_ID 3 - - // - MS_SMHBA_PROTOCOLSTATISTICS ProtocolStatistics; - #define SM_GetProtocolStatistics_OUT_ProtocolStatistics_SIZE sizeof(MS_SMHBA_PROTOCOLSTATISTICS) - #define SM_GetProtocolStatistics_OUT_ProtocolStatistics_ID 4 - -} SM_GetProtocolStatistics_OUT, *PSM_GetProtocolStatistics_OUT; - -#define SM_GetProtocolStatistics_OUT_SIZE (FIELD_OFFSET(SM_GetProtocolStatistics_OUT, ProtocolStatistics) + SM_GetProtocolStatistics_OUT_ProtocolStatistics_SIZE) - -#define SM_GetPhyStatistics 6 -typedef struct _SM_GetPhyStatistics_IN -{ - // - ULONG PortIndex; - #define SM_GetPhyStatistics_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_IN_PortIndex_ID 1 - - // - ULONG PhyIndex; - #define SM_GetPhyStatistics_IN_PhyIndex_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_IN_PhyIndex_ID 2 - - // - ULONG InNumOfPhyCounters; - #define SM_GetPhyStatistics_IN_InNumOfPhyCounters_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_IN_InNumOfPhyCounters_ID 3 - -} SM_GetPhyStatistics_IN, *PSM_GetPhyStatistics_IN; - -#define SM_GetPhyStatistics_IN_SIZE (FIELD_OFFSET(SM_GetPhyStatistics_IN, InNumOfPhyCounters) + SM_GetPhyStatistics_IN_InNumOfPhyCounters_SIZE) - -typedef struct _SM_GetPhyStatistics_OUT -{ - // - ULONG HBAStatus; - #define SM_GetPhyStatistics_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_OUT_HBAStatus_ID 4 - - // - ULONG TotalNumOfPhyCounters; - #define SM_GetPhyStatistics_OUT_TotalNumOfPhyCounters_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_OUT_TotalNumOfPhyCounters_ID 5 - - // - ULONG OutNumOfPhyCounters; - #define SM_GetPhyStatistics_OUT_OutNumOfPhyCounters_SIZE sizeof(ULONG) - #define SM_GetPhyStatistics_OUT_OutNumOfPhyCounters_ID 6 - - // - LONGLONG PhyCounter[1]; - #define SM_GetPhyStatistics_OUT_PhyCounter_ID 7 - -} SM_GetPhyStatistics_OUT, *PSM_GetPhyStatistics_OUT; - -#define SM_GetFCPhyAttributes 7 -typedef struct _SM_GetFCPhyAttributes_IN -{ - // - ULONG PortIndex; - #define SM_GetFCPhyAttributes_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetFCPhyAttributes_IN_PortIndex_ID 1 - - // - ULONG PhyIndex; - #define SM_GetFCPhyAttributes_IN_PhyIndex_SIZE sizeof(ULONG) - #define SM_GetFCPhyAttributes_IN_PhyIndex_ID 2 - -} SM_GetFCPhyAttributes_IN, *PSM_GetFCPhyAttributes_IN; - -#define SM_GetFCPhyAttributes_IN_SIZE (FIELD_OFFSET(SM_GetFCPhyAttributes_IN, PhyIndex) + SM_GetFCPhyAttributes_IN_PhyIndex_SIZE) - -typedef struct _SM_GetFCPhyAttributes_OUT -{ - // - ULONG HBAStatus; - #define SM_GetFCPhyAttributes_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetFCPhyAttributes_OUT_HBAStatus_ID 3 - - // - MS_SMHBA_FC_PHY PhyType; - #define SM_GetFCPhyAttributes_OUT_PhyType_SIZE sizeof(MS_SMHBA_FC_PHY) - #define SM_GetFCPhyAttributes_OUT_PhyType_ID 4 - -} SM_GetFCPhyAttributes_OUT, *PSM_GetFCPhyAttributes_OUT; - -#define SM_GetFCPhyAttributes_OUT_SIZE (FIELD_OFFSET(SM_GetFCPhyAttributes_OUT, PhyType) + SM_GetFCPhyAttributes_OUT_PhyType_SIZE) - -#define SM_GetSASPhyAttributes 8 -typedef struct _SM_GetSASPhyAttributes_IN -{ - // - ULONG PortIndex; - #define SM_GetSASPhyAttributes_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_GetSASPhyAttributes_IN_PortIndex_ID 1 - - // - ULONG PhyIndex; - #define SM_GetSASPhyAttributes_IN_PhyIndex_SIZE sizeof(ULONG) - #define SM_GetSASPhyAttributes_IN_PhyIndex_ID 2 - -} SM_GetSASPhyAttributes_IN, *PSM_GetSASPhyAttributes_IN; - -#define SM_GetSASPhyAttributes_IN_SIZE (FIELD_OFFSET(SM_GetSASPhyAttributes_IN, PhyIndex) + SM_GetSASPhyAttributes_IN_PhyIndex_SIZE) - -typedef struct _SM_GetSASPhyAttributes_OUT -{ - // - ULONG HBAStatus; - #define SM_GetSASPhyAttributes_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetSASPhyAttributes_OUT_HBAStatus_ID 3 - - // - MS_SMHBA_SAS_PHY PhyType; - #define SM_GetSASPhyAttributes_OUT_PhyType_SIZE sizeof(MS_SMHBA_SAS_PHY) - #define SM_GetSASPhyAttributes_OUT_PhyType_ID 4 - -} SM_GetSASPhyAttributes_OUT, *PSM_GetSASPhyAttributes_OUT; - -#define SM_GetSASPhyAttributes_OUT_SIZE (FIELD_OFFSET(SM_GetSASPhyAttributes_OUT, PhyType) + SM_GetSASPhyAttributes_OUT_PhyType_SIZE) - -#define SM_RefreshInformation 10 - -// MS_SMHBA_PORTLUN - MS_SMHBA_PORTLUN -#define MS_SMHBA_PORTLUNGuid \ - { 0x0669d100,0x066e,0x4e49, { 0xa6,0x8c,0xe0,0x51,0x99,0x59,0x61,0x32 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_PORTLUN_GUID, \ - 0x0669d100,0x066e,0x4e49,0xa6,0x8c,0xe0,0x51,0x99,0x59,0x61,0x32); -#endif - - -typedef struct _MS_SMHBA_PORTLUN -{ - // - UCHAR PortWWN[8]; - #define MS_SMHBA_PORTLUN_PortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_PORTLUN_PortWWN_ID 1 - - // - UCHAR domainPortWWN[8]; - #define MS_SMHBA_PORTLUN_domainPortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SMHBA_PORTLUN_domainPortWWN_ID 2 - - // - ULONGLONG TargetLun; - #define MS_SMHBA_PORTLUN_TargetLun_SIZE sizeof(ULONGLONG) - #define MS_SMHBA_PORTLUN_TargetLun_ID 3 - -} MS_SMHBA_PORTLUN, *PMS_SMHBA_PORTLUN; - -#define MS_SMHBA_PORTLUN_SIZE (FIELD_OFFSET(MS_SMHBA_PORTLUN, TargetLun) + MS_SMHBA_PORTLUN_TargetLun_SIZE) - -// MS_SMHBA_SCSIENTRY - MS_SMHBA_SCSIENTRY -#define MS_SMHBA_SCSIENTRYGuid \ - { 0x125d41bc,0x7643,0x4155, { 0xb8,0x1c,0xe2,0xf1,0x28,0xad,0x1f,0xb4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_SCSIENTRY_GUID, \ - 0x125d41bc,0x7643,0x4155,0xb8,0x1c,0xe2,0xf1,0x28,0xad,0x1f,0xb4); -#endif - - -typedef struct _MS_SMHBA_SCSIENTRY -{ - // - MS_SMHBA_PORTLUN PortLun; - #define MS_SMHBA_SCSIENTRY_PortLun_SIZE sizeof(MS_SMHBA_PORTLUN) - #define MS_SMHBA_SCSIENTRY_PortLun_ID 1 - - // - UCHAR LUID[256]; - #define MS_SMHBA_SCSIENTRY_LUID_SIZE sizeof(UCHAR[256]) - #define MS_SMHBA_SCSIENTRY_LUID_ID 2 - - // - HBAScsiID ScsiId; - #define MS_SMHBA_SCSIENTRY_ScsiId_SIZE sizeof(HBAScsiID) - #define MS_SMHBA_SCSIENTRY_ScsiId_ID 3 - -} MS_SMHBA_SCSIENTRY, *PMS_SMHBA_SCSIENTRY; - -#define MS_SMHBA_SCSIENTRY_SIZE (FIELD_OFFSET(MS_SMHBA_SCSIENTRY, ScsiId) + MS_SMHBA_SCSIENTRY_ScsiId_SIZE) - -// MS_SMHBA_BINDINGENTRY - MS_SMHBA_BINDINGENTRY -#define MS_SMHBA_BINDINGENTRYGuid \ - { 0x65bfb548,0xd00a,0x4d4c, { 0xa3,0x57,0x7d,0xaa,0x23,0xbc,0x2e,0x3d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SMHBA_BINDINGENTRY_GUID, \ - 0x65bfb548,0xd00a,0x4d4c,0xa3,0x57,0x7d,0xaa,0x23,0xbc,0x2e,0x3d); -#endif - - -typedef struct _MS_SMHBA_BINDINGENTRY -{ - // - ULONG type; - #define MS_SMHBA_BINDINGENTRY_type_SIZE sizeof(ULONG) - #define MS_SMHBA_BINDINGENTRY_type_ID 1 - - // - MS_SMHBA_PORTLUN PortLun; - #define MS_SMHBA_BINDINGENTRY_PortLun_SIZE sizeof(MS_SMHBA_PORTLUN) - #define MS_SMHBA_BINDINGENTRY_PortLun_ID 2 - - // - UCHAR LUID[256]; - #define MS_SMHBA_BINDINGENTRY_LUID_SIZE sizeof(UCHAR[256]) - #define MS_SMHBA_BINDINGENTRY_LUID_ID 3 - - // - ULONG Status; - #define MS_SMHBA_BINDINGENTRY_Status_SIZE sizeof(ULONG) - #define MS_SMHBA_BINDINGENTRY_Status_ID 4 - - // - HBAScsiID ScsiId; - #define MS_SMHBA_BINDINGENTRY_ScsiId_SIZE sizeof(HBAScsiID) - #define MS_SMHBA_BINDINGENTRY_ScsiId_ID 5 - -} MS_SMHBA_BINDINGENTRY, *PMS_SMHBA_BINDINGENTRY; - -#define MS_SMHBA_BINDINGENTRY_SIZE (FIELD_OFFSET(MS_SMHBA_BINDINGENTRY, ScsiId) + MS_SMHBA_BINDINGENTRY_ScsiId_SIZE) - -// MS_SM_TargetInformationMethods - MS_SM_TargetInformationMethods -#define MS_SM_TargetInformationMethodsGuid \ - { 0x93545055,0xab4c,0x4e80, { 0x84,0xae,0x6a,0x86,0xa2,0xdc,0x4b,0x84 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_TargetInformationMethods_GUID, \ - 0x93545055,0xab4c,0x4e80,0x84,0xae,0x6a,0x86,0xa2,0xdc,0x4b,0x84); -#endif - -// -// Method id definitions for MS_SM_TargetInformationMethods -#define SM_GetTargetMapping 1 -typedef struct _SM_GetTargetMapping_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_GetTargetMapping_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetTargetMapping_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_GetTargetMapping_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetTargetMapping_IN_DomainPortWWN_ID 2 - - // - ULONG InEntryCount; - #define SM_GetTargetMapping_IN_InEntryCount_SIZE sizeof(ULONG) - #define SM_GetTargetMapping_IN_InEntryCount_ID 3 - -} SM_GetTargetMapping_IN, *PSM_GetTargetMapping_IN; - -#define SM_GetTargetMapping_IN_SIZE (FIELD_OFFSET(SM_GetTargetMapping_IN, InEntryCount) + SM_GetTargetMapping_IN_InEntryCount_SIZE) - -typedef struct _SM_GetTargetMapping_OUT -{ - // - ULONG HBAStatus; - #define SM_GetTargetMapping_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetTargetMapping_OUT_HBAStatus_ID 4 - - // - ULONG TotalEntryCount; - #define SM_GetTargetMapping_OUT_TotalEntryCount_SIZE sizeof(ULONG) - #define SM_GetTargetMapping_OUT_TotalEntryCount_ID 5 - - // - ULONG OutEntryCount; - #define SM_GetTargetMapping_OUT_OutEntryCount_SIZE sizeof(ULONG) - #define SM_GetTargetMapping_OUT_OutEntryCount_ID 6 - - // - MS_SMHBA_SCSIENTRY Entry[1]; - #define SM_GetTargetMapping_OUT_Entry_ID 7 - -} SM_GetTargetMapping_OUT, *PSM_GetTargetMapping_OUT; - -#define SM_GetBindingCapability 2 -typedef struct _SM_GetBindingCapability_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_GetBindingCapability_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetBindingCapability_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_GetBindingCapability_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetBindingCapability_IN_DomainPortWWN_ID 2 - -} SM_GetBindingCapability_IN, *PSM_GetBindingCapability_IN; - -#define SM_GetBindingCapability_IN_SIZE (FIELD_OFFSET(SM_GetBindingCapability_IN, DomainPortWWN) + SM_GetBindingCapability_IN_DomainPortWWN_SIZE) - -typedef struct _SM_GetBindingCapability_OUT -{ - // - ULONG HBAStatus; - #define SM_GetBindingCapability_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetBindingCapability_OUT_HBAStatus_ID 3 - - // - ULONG Flags; - #define SM_GetBindingCapability_OUT_Flags_SIZE sizeof(ULONG) - #define SM_GetBindingCapability_OUT_Flags_ID 4 - -} SM_GetBindingCapability_OUT, *PSM_GetBindingCapability_OUT; - -#define SM_GetBindingCapability_OUT_SIZE (FIELD_OFFSET(SM_GetBindingCapability_OUT, Flags) + SM_GetBindingCapability_OUT_Flags_SIZE) - -#define SM_GetBindingSupport 3 -typedef struct _SM_GetBindingSupport_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_GetBindingSupport_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetBindingSupport_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_GetBindingSupport_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetBindingSupport_IN_DomainPortWWN_ID 2 - -} SM_GetBindingSupport_IN, *PSM_GetBindingSupport_IN; - -#define SM_GetBindingSupport_IN_SIZE (FIELD_OFFSET(SM_GetBindingSupport_IN, DomainPortWWN) + SM_GetBindingSupport_IN_DomainPortWWN_SIZE) - -typedef struct _SM_GetBindingSupport_OUT -{ - // - ULONG HBAStatus; - #define SM_GetBindingSupport_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetBindingSupport_OUT_HBAStatus_ID 3 - - // - ULONG Flags; - #define SM_GetBindingSupport_OUT_Flags_SIZE sizeof(ULONG) - #define SM_GetBindingSupport_OUT_Flags_ID 4 - -} SM_GetBindingSupport_OUT, *PSM_GetBindingSupport_OUT; - -#define SM_GetBindingSupport_OUT_SIZE (FIELD_OFFSET(SM_GetBindingSupport_OUT, Flags) + SM_GetBindingSupport_OUT_Flags_SIZE) - -#define SM_SetBindingSupport 4 -typedef struct _SM_SetBindingSupport_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SetBindingSupport_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SetBindingSupport_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_SetBindingSupport_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SetBindingSupport_IN_DomainPortWWN_ID 2 - - // - ULONG Flags; - #define SM_SetBindingSupport_IN_Flags_SIZE sizeof(ULONG) - #define SM_SetBindingSupport_IN_Flags_ID 3 - -} SM_SetBindingSupport_IN, *PSM_SetBindingSupport_IN; - -#define SM_SetBindingSupport_IN_SIZE (FIELD_OFFSET(SM_SetBindingSupport_IN, Flags) + SM_SetBindingSupport_IN_Flags_SIZE) - -typedef struct _SM_SetBindingSupport_OUT -{ - // - ULONG HBAStatus; - #define SM_SetBindingSupport_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SetBindingSupport_OUT_HBAStatus_ID 4 - -} SM_SetBindingSupport_OUT, *PSM_SetBindingSupport_OUT; - -#define SM_SetBindingSupport_OUT_SIZE (FIELD_OFFSET(SM_SetBindingSupport_OUT, HBAStatus) + SM_SetBindingSupport_OUT_HBAStatus_SIZE) - -#define SM_GetPersistentBinding 5 -typedef struct _SM_GetPersistentBinding_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_GetPersistentBinding_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetPersistentBinding_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_GetPersistentBinding_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_GetPersistentBinding_IN_DomainPortWWN_ID 2 - - // - ULONG InEntryCount; - #define SM_GetPersistentBinding_IN_InEntryCount_SIZE sizeof(ULONG) - #define SM_GetPersistentBinding_IN_InEntryCount_ID 3 - -} SM_GetPersistentBinding_IN, *PSM_GetPersistentBinding_IN; - -#define SM_GetPersistentBinding_IN_SIZE (FIELD_OFFSET(SM_GetPersistentBinding_IN, InEntryCount) + SM_GetPersistentBinding_IN_InEntryCount_SIZE) - -typedef struct _SM_GetPersistentBinding_OUT -{ - // - ULONG HBAStatus; - #define SM_GetPersistentBinding_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetPersistentBinding_OUT_HBAStatus_ID 4 - - // - ULONG TotalEntryCount; - #define SM_GetPersistentBinding_OUT_TotalEntryCount_SIZE sizeof(ULONG) - #define SM_GetPersistentBinding_OUT_TotalEntryCount_ID 5 - - // - ULONG OutEntryCount; - #define SM_GetPersistentBinding_OUT_OutEntryCount_SIZE sizeof(ULONG) - #define SM_GetPersistentBinding_OUT_OutEntryCount_ID 6 - - // - MS_SMHBA_BINDINGENTRY Entry[1]; - #define SM_GetPersistentBinding_OUT_Entry_ID 7 - -} SM_GetPersistentBinding_OUT, *PSM_GetPersistentBinding_OUT; - -#define SM_SetPersistentBinding 6 -typedef struct _SM_SetPersistentBinding_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SetPersistentBinding_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SetPersistentBinding_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_SetPersistentBinding_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SetPersistentBinding_IN_DomainPortWWN_ID 2 - - // - ULONG InEntryCount; - #define SM_SetPersistentBinding_IN_InEntryCount_SIZE sizeof(ULONG) - #define SM_SetPersistentBinding_IN_InEntryCount_ID 3 - - // - MS_SMHBA_BINDINGENTRY Entry[1]; - #define SM_SetPersistentBinding_IN_Entry_ID 4 - -} SM_SetPersistentBinding_IN, *PSM_SetPersistentBinding_IN; - -typedef struct _SM_SetPersistentBinding_OUT -{ - // - ULONG HBAStatus; - #define SM_SetPersistentBinding_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SetPersistentBinding_OUT_HBAStatus_ID 5 - - // - ULONG OutStatusCount; - #define SM_SetPersistentBinding_OUT_OutStatusCount_SIZE sizeof(ULONG) - #define SM_SetPersistentBinding_OUT_OutStatusCount_ID 6 - - // - ULONG EntryStatus[1]; - #define SM_SetPersistentBinding_OUT_EntryStatus_ID 7 - -} SM_SetPersistentBinding_OUT, *PSM_SetPersistentBinding_OUT; - -#define SM_RemovePersistentBinding 7 -typedef struct _SM_RemovePersistentBinding_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_RemovePersistentBinding_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemovePersistentBinding_IN_HbaPortWWN_ID 1 - - // - UCHAR DomainPortWWN[8]; - #define SM_RemovePersistentBinding_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemovePersistentBinding_IN_DomainPortWWN_ID 2 - - // - ULONG EntryCount; - #define SM_RemovePersistentBinding_IN_EntryCount_SIZE sizeof(ULONG) - #define SM_RemovePersistentBinding_IN_EntryCount_ID 3 - - // - MS_SMHBA_BINDINGENTRY Entry[1]; - #define SM_RemovePersistentBinding_IN_Entry_ID 4 - -} SM_RemovePersistentBinding_IN, *PSM_RemovePersistentBinding_IN; - -typedef struct _SM_RemovePersistentBinding_OUT -{ - // - ULONG HBAStatus; - #define SM_RemovePersistentBinding_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_RemovePersistentBinding_OUT_HBAStatus_ID 5 - -} SM_RemovePersistentBinding_OUT, *PSM_RemovePersistentBinding_OUT; - -#define SM_RemovePersistentBinding_OUT_SIZE (FIELD_OFFSET(SM_RemovePersistentBinding_OUT, HBAStatus) + SM_RemovePersistentBinding_OUT_HBAStatus_SIZE) - -#define SM_GetLUNStatistics 8 -typedef struct _SM_GetLUNStatistics_IN -{ - // - HBAScsiID Lunit; - #define SM_GetLUNStatistics_IN_Lunit_SIZE sizeof(HBAScsiID) - #define SM_GetLUNStatistics_IN_Lunit_ID 1 - -} SM_GetLUNStatistics_IN, *PSM_GetLUNStatistics_IN; - -#define SM_GetLUNStatistics_IN_SIZE (FIELD_OFFSET(SM_GetLUNStatistics_IN, Lunit) + SM_GetLUNStatistics_IN_Lunit_SIZE) - -typedef struct _SM_GetLUNStatistics_OUT -{ - // - ULONG HBAStatus; - #define SM_GetLUNStatistics_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetLUNStatistics_OUT_HBAStatus_ID 2 - - // - MS_SMHBA_PROTOCOLSTATISTICS ProtocolStatistics; - #define SM_GetLUNStatistics_OUT_ProtocolStatistics_SIZE sizeof(MS_SMHBA_PROTOCOLSTATISTICS) - #define SM_GetLUNStatistics_OUT_ProtocolStatistics_ID 3 - -} SM_GetLUNStatistics_OUT, *PSM_GetLUNStatistics_OUT; - -#define SM_GetLUNStatistics_OUT_SIZE (FIELD_OFFSET(SM_GetLUNStatistics_OUT, ProtocolStatistics) + SM_GetLUNStatistics_OUT_ProtocolStatistics_SIZE) - - -// MS_SM_ScsiInformationMethods - MS_SM_ScsiInformationMethods -#define MS_SM_ScsiInformationMethodsGuid \ - { 0xb6661e6f,0x075e,0x4209, { 0xae,0x20,0xfe,0x81,0xdb,0x03,0xd9,0x79 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_ScsiInformationMethods_GUID, \ - 0xb6661e6f,0x075e,0x4209,0xae,0x20,0xfe,0x81,0xdb,0x03,0xd9,0x79); -#endif - -// -// Method id definitions for MS_SM_ScsiInformationMethods -#define SM_ScsiInquiry 1 -typedef struct _SM_ScsiInquiry_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_ScsiInquiry_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiInquiry_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define SM_ScsiInquiry_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiInquiry_IN_DiscoveredPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_ScsiInquiry_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiInquiry_IN_DomainPortWWN_ID 3 - - // - ULONGLONG SmhbaLUN; - #define SM_ScsiInquiry_IN_SmhbaLUN_SIZE sizeof(ULONGLONG) - #define SM_ScsiInquiry_IN_SmhbaLUN_ID 4 - - // - UCHAR Cdb[6]; - #define SM_ScsiInquiry_IN_Cdb_SIZE sizeof(UCHAR[6]) - #define SM_ScsiInquiry_IN_Cdb_ID 5 - - // - ULONG InRespBufferMaxSize; - #define SM_ScsiInquiry_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiInquiry_IN_InRespBufferMaxSize_ID 6 - - // - ULONG InSenseBufferMaxSize; - #define SM_ScsiInquiry_IN_InSenseBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiInquiry_IN_InSenseBufferMaxSize_ID 7 - -} SM_ScsiInquiry_IN, *PSM_ScsiInquiry_IN; - -#define SM_ScsiInquiry_IN_SIZE (FIELD_OFFSET(SM_ScsiInquiry_IN, InSenseBufferMaxSize) + SM_ScsiInquiry_IN_InSenseBufferMaxSize_SIZE) - -typedef struct _SM_ScsiInquiry_OUT -{ - // - ULONG HBAStatus; - #define SM_ScsiInquiry_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_ScsiInquiry_OUT_HBAStatus_ID 8 - - // - UCHAR ScsiStatus; - #define SM_ScsiInquiry_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define SM_ScsiInquiry_OUT_ScsiStatus_ID 9 - - // - ULONG OutRespBufferSize; - #define SM_ScsiInquiry_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiInquiry_OUT_OutRespBufferSize_ID 10 - - // - ULONG OutSenseBufferSize; - #define SM_ScsiInquiry_OUT_OutSenseBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiInquiry_OUT_OutSenseBufferSize_ID 11 - - // - UCHAR RespBuffer[1]; - #define SM_ScsiInquiry_OUT_RespBuffer_ID 12 - - // -// UCHAR SenseBuffer[1]; - #define SM_ScsiInquiry_OUT_SenseBuffer_ID 13 - -} SM_ScsiInquiry_OUT, *PSM_ScsiInquiry_OUT; - -#define SM_ScsiReportLuns 2 -typedef struct _SM_ScsiReportLuns_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_ScsiReportLuns_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReportLuns_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define SM_ScsiReportLuns_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReportLuns_IN_DiscoveredPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_ScsiReportLuns_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReportLuns_IN_DomainPortWWN_ID 3 - - // - UCHAR Cdb[12]; - #define SM_ScsiReportLuns_IN_Cdb_SIZE sizeof(UCHAR[12]) - #define SM_ScsiReportLuns_IN_Cdb_ID 4 - - // - ULONG InRespBufferMaxSize; - #define SM_ScsiReportLuns_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_IN_InRespBufferMaxSize_ID 5 - - // - ULONG InSenseBufferMaxSize; - #define SM_ScsiReportLuns_IN_InSenseBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_IN_InSenseBufferMaxSize_ID 6 - -} SM_ScsiReportLuns_IN, *PSM_ScsiReportLuns_IN; - -#define SM_ScsiReportLuns_IN_SIZE (FIELD_OFFSET(SM_ScsiReportLuns_IN, InSenseBufferMaxSize) + SM_ScsiReportLuns_IN_InSenseBufferMaxSize_SIZE) - -typedef struct _SM_ScsiReportLuns_OUT -{ - // - ULONG HBAStatus; - #define SM_ScsiReportLuns_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_OUT_HBAStatus_ID 7 - - // - UCHAR ScsiStatus; - #define SM_ScsiReportLuns_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define SM_ScsiReportLuns_OUT_ScsiStatus_ID 8 - - // - ULONG TotalRespBufferSize; - #define SM_ScsiReportLuns_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_OUT_TotalRespBufferSize_ID 9 - - // - ULONG OutRespBufferSize; - #define SM_ScsiReportLuns_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_OUT_OutRespBufferSize_ID 10 - - // - ULONG OutSenseBufferSize; - #define SM_ScsiReportLuns_OUT_OutSenseBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiReportLuns_OUT_OutSenseBufferSize_ID 11 - - // - UCHAR RespBuffer[1]; - #define SM_ScsiReportLuns_OUT_RespBuffer_ID 12 - - // -// UCHAR SenseBuffer[1]; - #define SM_ScsiReportLuns_OUT_SenseBuffer_ID 13 - -} SM_ScsiReportLuns_OUT, *PSM_ScsiReportLuns_OUT; - -#define SM_ScsiReadCapacity 3 -typedef struct _SM_ScsiReadCapacity_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_ScsiReadCapacity_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReadCapacity_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define SM_ScsiReadCapacity_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReadCapacity_IN_DiscoveredPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_ScsiReadCapacity_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_ScsiReadCapacity_IN_DomainPortWWN_ID 3 - - // - ULONGLONG SmhbaLUN; - #define SM_ScsiReadCapacity_IN_SmhbaLUN_SIZE sizeof(ULONGLONG) - #define SM_ScsiReadCapacity_IN_SmhbaLUN_ID 4 - - // - UCHAR Cdb[16]; - #define SM_ScsiReadCapacity_IN_Cdb_SIZE sizeof(UCHAR[16]) - #define SM_ScsiReadCapacity_IN_Cdb_ID 5 - - // - ULONG InRespBufferMaxSize; - #define SM_ScsiReadCapacity_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiReadCapacity_IN_InRespBufferMaxSize_ID 6 - - // - ULONG InSenseBufferMaxSize; - #define SM_ScsiReadCapacity_IN_InSenseBufferMaxSize_SIZE sizeof(ULONG) - #define SM_ScsiReadCapacity_IN_InSenseBufferMaxSize_ID 7 - -} SM_ScsiReadCapacity_IN, *PSM_ScsiReadCapacity_IN; - -#define SM_ScsiReadCapacity_IN_SIZE (FIELD_OFFSET(SM_ScsiReadCapacity_IN, InSenseBufferMaxSize) + SM_ScsiReadCapacity_IN_InSenseBufferMaxSize_SIZE) - -typedef struct _SM_ScsiReadCapacity_OUT -{ - // - ULONG HBAStatus; - #define SM_ScsiReadCapacity_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_ScsiReadCapacity_OUT_HBAStatus_ID 8 - - // - UCHAR ScsiStatus; - #define SM_ScsiReadCapacity_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define SM_ScsiReadCapacity_OUT_ScsiStatus_ID 9 - - // - ULONG OutRespBufferSize; - #define SM_ScsiReadCapacity_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiReadCapacity_OUT_OutRespBufferSize_ID 10 - - // - ULONG OutSenseBufferSize; - #define SM_ScsiReadCapacity_OUT_OutSenseBufferSize_SIZE sizeof(ULONG) - #define SM_ScsiReadCapacity_OUT_OutSenseBufferSize_ID 11 - - // - UCHAR RespBuffer[1]; - #define SM_ScsiReadCapacity_OUT_RespBuffer_ID 12 - - // -// UCHAR SenseBuffer[1]; - #define SM_ScsiReadCapacity_OUT_SenseBuffer_ID 13 - -} SM_ScsiReadCapacity_OUT, *PSM_ScsiReadCapacity_OUT; - - -// MS_SM_FabricAndDomainManagementMethods - MS_SM_FabricAndDomainManagementMethods -#define MS_SM_FabricAndDomainManagementMethodsGuid \ - { 0x467fea10,0x701b,0x4388, { 0x91,0x7f,0x73,0x06,0x20,0xce,0xa3,0x28 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_FabricAndDomainManagementMethods_GUID, \ - 0x467fea10,0x701b,0x4388,0x91,0x7f,0x73,0x06,0x20,0xce,0xa3,0x28); -#endif - -// -// Method id definitions for MS_SM_FabricAndDomainManagementMethods -#define SM_SendTEST 1 -typedef struct _SM_SendTEST_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendTEST_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendTEST_IN_HbaPortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SM_SendTEST_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendTEST_IN_DestWWN_ID 2 - - // - ULONG DestFCID; - #define SM_SendTEST_IN_DestFCID_SIZE sizeof(ULONG) - #define SM_SendTEST_IN_DestFCID_ID 3 - - // - ULONG ReqBufferSize; - #define SM_SendTEST_IN_ReqBufferSize_SIZE sizeof(ULONG) - #define SM_SendTEST_IN_ReqBufferSize_ID 4 - - // - UCHAR ReqBuffer[1]; - #define SM_SendTEST_IN_ReqBuffer_ID 5 - -} SM_SendTEST_IN, *PSM_SendTEST_IN; - -typedef struct _SM_SendTEST_OUT -{ - // - ULONG HBAStatus; - #define SM_SendTEST_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendTEST_OUT_HBAStatus_ID 6 - -} SM_SendTEST_OUT, *PSM_SendTEST_OUT; - -#define SM_SendTEST_OUT_SIZE (FIELD_OFFSET(SM_SendTEST_OUT, HBAStatus) + SM_SendTEST_OUT_HBAStatus_SIZE) - -#define SM_SendECHO 2 -typedef struct _SM_SendECHO_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendECHO_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendECHO_IN_HbaPortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SM_SendECHO_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendECHO_IN_DestWWN_ID 2 - - // - ULONG DestFCID; - #define SM_SendECHO_IN_DestFCID_SIZE sizeof(ULONG) - #define SM_SendECHO_IN_DestFCID_ID 3 - - // - ULONG InRespBufferMaxSize; - #define SM_SendECHO_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendECHO_IN_InRespBufferMaxSize_ID 4 - - // - ULONG ReqBufferSize; - #define SM_SendECHO_IN_ReqBufferSize_SIZE sizeof(ULONG) - #define SM_SendECHO_IN_ReqBufferSize_ID 5 - - // - UCHAR ReqBuffer[1]; - #define SM_SendECHO_IN_ReqBuffer_ID 6 - -} SM_SendECHO_IN, *PSM_SendECHO_IN; - -typedef struct _SM_SendECHO_OUT -{ - // - ULONG HBAStatus; - #define SM_SendECHO_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendECHO_OUT_HBAStatus_ID 7 - - // - ULONG OutRespBufferSize; - #define SM_SendECHO_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendECHO_OUT_OutRespBufferSize_ID 8 - - // - UCHAR RespBuffer[1]; - #define SM_SendECHO_OUT_RespBuffer_ID 9 - -} SM_SendECHO_OUT, *PSM_SendECHO_OUT; - -#define SM_SendSMPPassThru 3 -typedef struct _SM_SendSMPPassThru_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendSMPPassThru_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendSMPPassThru_IN_HbaPortWWN_ID 1 - - // - UCHAR DestPortWWN[8]; - #define SM_SendSMPPassThru_IN_DestPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendSMPPassThru_IN_DestPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_SendSMPPassThru_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendSMPPassThru_IN_DomainPortWWN_ID 3 - - // - ULONG InRespBufferMaxSize; - #define SM_SendSMPPassThru_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendSMPPassThru_IN_InRespBufferMaxSize_ID 4 - - // - ULONG ReqBufferSize; - #define SM_SendSMPPassThru_IN_ReqBufferSize_SIZE sizeof(ULONG) - #define SM_SendSMPPassThru_IN_ReqBufferSize_ID 5 - - // - UCHAR ReqBuffer[1]; - #define SM_SendSMPPassThru_IN_ReqBuffer_ID 6 - -} SM_SendSMPPassThru_IN, *PSM_SendSMPPassThru_IN; - -typedef struct _SM_SendSMPPassThru_OUT -{ - // - ULONG HBAStatus; - #define SM_SendSMPPassThru_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendSMPPassThru_OUT_HBAStatus_ID 7 - - // - ULONG TotalRespBufferSize; - #define SM_SendSMPPassThru_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendSMPPassThru_OUT_TotalRespBufferSize_ID 8 - - // - ULONG OutRespBufferSize; - #define SM_SendSMPPassThru_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendSMPPassThru_OUT_OutRespBufferSize_ID 9 - - // - UCHAR RespBuffer[1]; - #define SM_SendSMPPassThru_OUT_RespBuffer_ID 10 - -} SM_SendSMPPassThru_OUT, *PSM_SendSMPPassThru_OUT; - -#define SM_SendCTPassThru 10 -typedef struct _SM_SendCTPassThru_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendCTPassThru_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendCTPassThru_IN_HbaPortWWN_ID 1 - - // - ULONG InRespBufferMaxSize; - #define SM_SendCTPassThru_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendCTPassThru_IN_InRespBufferMaxSize_ID 2 - - // - ULONG ReqBufferSize; - #define SM_SendCTPassThru_IN_ReqBufferSize_SIZE sizeof(ULONG) - #define SM_SendCTPassThru_IN_ReqBufferSize_ID 3 - - // - UCHAR ReqBuffer[1]; - #define SM_SendCTPassThru_IN_ReqBuffer_ID 4 - -} SM_SendCTPassThru_IN, *PSM_SendCTPassThru_IN; - -typedef struct _SM_SendCTPassThru_OUT -{ - // - ULONG HBAStatus; - #define SM_SendCTPassThru_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendCTPassThru_OUT_HBAStatus_ID 5 - - // - ULONG TotalRespBufferSize; - #define SM_SendCTPassThru_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendCTPassThru_OUT_TotalRespBufferSize_ID 6 - - // - ULONG OutRespBufferSize; - #define SM_SendCTPassThru_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendCTPassThru_OUT_OutRespBufferSize_ID 7 - - // - UCHAR RespBuffer[1]; - #define SM_SendCTPassThru_OUT_RespBuffer_ID 8 - -} SM_SendCTPassThru_OUT, *PSM_SendCTPassThru_OUT; - -#define SM_GetRNIDMgmtInfo 11 -typedef struct _SM_GetRNIDMgmtInfo_OUT -{ - // - ULONG HBAStatus; - #define SM_GetRNIDMgmtInfo_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_GetRNIDMgmtInfo_OUT_HBAStatus_ID 1 - - // - HBAFC3MgmtInfo MgmtInfo; - #define SM_GetRNIDMgmtInfo_OUT_MgmtInfo_SIZE sizeof(HBAFC3MgmtInfo) - #define SM_GetRNIDMgmtInfo_OUT_MgmtInfo_ID 2 - -} SM_GetRNIDMgmtInfo_OUT, *PSM_GetRNIDMgmtInfo_OUT; - -#define SM_GetRNIDMgmtInfo_OUT_SIZE (FIELD_OFFSET(SM_GetRNIDMgmtInfo_OUT, MgmtInfo) + SM_GetRNIDMgmtInfo_OUT_MgmtInfo_SIZE) - -#define SM_SetRNIDMgmtInfo 12 -typedef struct _SM_SetRNIDMgmtInfo_IN -{ - // - HBAFC3MgmtInfo MgmtInfo; - #define SM_SetRNIDMgmtInfo_IN_MgmtInfo_SIZE sizeof(HBAFC3MgmtInfo) - #define SM_SetRNIDMgmtInfo_IN_MgmtInfo_ID 1 - -} SM_SetRNIDMgmtInfo_IN, *PSM_SetRNIDMgmtInfo_IN; - -#define SM_SetRNIDMgmtInfo_IN_SIZE (FIELD_OFFSET(SM_SetRNIDMgmtInfo_IN, MgmtInfo) + SM_SetRNIDMgmtInfo_IN_MgmtInfo_SIZE) - -typedef struct _SM_SetRNIDMgmtInfo_OUT -{ - // - ULONG HBAStatus; - #define SM_SetRNIDMgmtInfo_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SetRNIDMgmtInfo_OUT_HBAStatus_ID 2 - -} SM_SetRNIDMgmtInfo_OUT, *PSM_SetRNIDMgmtInfo_OUT; - -#define SM_SetRNIDMgmtInfo_OUT_SIZE (FIELD_OFFSET(SM_SetRNIDMgmtInfo_OUT, HBAStatus) + SM_SetRNIDMgmtInfo_OUT_HBAStatus_SIZE) - -#define SM_SendRNID 13 -typedef struct _SM_SendRNID_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendRNID_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRNID_IN_HbaPortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SM_SendRNID_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRNID_IN_DestWWN_ID 2 - - // - ULONG DestFCID; - #define SM_SendRNID_IN_DestFCID_SIZE sizeof(ULONG) - #define SM_SendRNID_IN_DestFCID_ID 3 - - // - ULONG NodeIdDataFormat; - #define SM_SendRNID_IN_NodeIdDataFormat_SIZE sizeof(ULONG) - #define SM_SendRNID_IN_NodeIdDataFormat_ID 4 - - // - ULONG InRespBufferMaxSize; - #define SM_SendRNID_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendRNID_IN_InRespBufferMaxSize_ID 5 - -} SM_SendRNID_IN, *PSM_SendRNID_IN; - -#define SM_SendRNID_IN_SIZE (FIELD_OFFSET(SM_SendRNID_IN, InRespBufferMaxSize) + SM_SendRNID_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendRNID_OUT -{ - // - ULONG HBAStatus; - #define SM_SendRNID_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendRNID_OUT_HBAStatus_ID 6 - - // - ULONG TotalRespBufferSize; - #define SM_SendRNID_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRNID_OUT_TotalRespBufferSize_ID 7 - - // - ULONG OutRespBufferSize; - #define SM_SendRNID_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRNID_OUT_OutRespBufferSize_ID 8 - - // - UCHAR RespBuffer[1]; - #define SM_SendRNID_OUT_RespBuffer_ID 9 - -} SM_SendRNID_OUT, *PSM_SendRNID_OUT; - -#define SM_SendRPL 14 -typedef struct _SM_SendRPL_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendRPL_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRPL_IN_HbaPortWWN_ID 1 - - // - UCHAR AgentWWN[8]; - #define SM_SendRPL_IN_AgentWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRPL_IN_AgentWWN_ID 2 - - // - ULONG AgentDomain; - #define SM_SendRPL_IN_AgentDomain_SIZE sizeof(ULONG) - #define SM_SendRPL_IN_AgentDomain_ID 3 - - // - ULONG PortIndex; - #define SM_SendRPL_IN_PortIndex_SIZE sizeof(ULONG) - #define SM_SendRPL_IN_PortIndex_ID 4 - - // - ULONG InRespBufferMaxSize; - #define SM_SendRPL_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendRPL_IN_InRespBufferMaxSize_ID 5 - -} SM_SendRPL_IN, *PSM_SendRPL_IN; - -#define SM_SendRPL_IN_SIZE (FIELD_OFFSET(SM_SendRPL_IN, InRespBufferMaxSize) + SM_SendRPL_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendRPL_OUT -{ - // - ULONG HBAStatus; - #define SM_SendRPL_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendRPL_OUT_HBAStatus_ID 6 - - // - ULONG TotalRespBufferSize; - #define SM_SendRPL_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRPL_OUT_TotalRespBufferSize_ID 7 - - // - ULONG OutRespBufferSize; - #define SM_SendRPL_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRPL_OUT_OutRespBufferSize_ID 8 - - // - UCHAR RespBuffer[1]; - #define SM_SendRPL_OUT_RespBuffer_ID 9 - -} SM_SendRPL_OUT, *PSM_SendRPL_OUT; - -#define SM_SendRPS 15 -typedef struct _SM_SendRPS_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendRPS_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRPS_IN_HbaPortWWN_ID 1 - - // - UCHAR AgentWWN[8]; - #define SM_SendRPS_IN_AgentWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRPS_IN_AgentWWN_ID 2 - - // - UCHAR ObjectWWN[8]; - #define SM_SendRPS_IN_ObjectWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRPS_IN_ObjectWWN_ID 3 - - // - ULONG AgentDomain; - #define SM_SendRPS_IN_AgentDomain_SIZE sizeof(ULONG) - #define SM_SendRPS_IN_AgentDomain_ID 4 - - // - ULONG ObjectPortNumber; - #define SM_SendRPS_IN_ObjectPortNumber_SIZE sizeof(ULONG) - #define SM_SendRPS_IN_ObjectPortNumber_ID 5 - - // - ULONG InRespBufferMaxSize; - #define SM_SendRPS_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendRPS_IN_InRespBufferMaxSize_ID 6 - -} SM_SendRPS_IN, *PSM_SendRPS_IN; - -#define SM_SendRPS_IN_SIZE (FIELD_OFFSET(SM_SendRPS_IN, InRespBufferMaxSize) + SM_SendRPS_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendRPS_OUT -{ - // - ULONG HBAStatus; - #define SM_SendRPS_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendRPS_OUT_HBAStatus_ID 7 - - // - ULONG TotalRespBufferSize; - #define SM_SendRPS_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRPS_OUT_TotalRespBufferSize_ID 8 - - // - ULONG OutRespBufferSize; - #define SM_SendRPS_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRPS_OUT_OutRespBufferSize_ID 9 - - // - UCHAR RespBuffer[1]; - #define SM_SendRPS_OUT_RespBuffer_ID 10 - -} SM_SendRPS_OUT, *PSM_SendRPS_OUT; - -#define SM_SendSRL 16 -typedef struct _SM_SendSRL_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendSRL_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendSRL_IN_HbaPortWWN_ID 1 - - // - UCHAR WWN[8]; - #define SM_SendSRL_IN_WWN_SIZE sizeof(UCHAR[8]) - #define SM_SendSRL_IN_WWN_ID 2 - - // - ULONG Domain; - #define SM_SendSRL_IN_Domain_SIZE sizeof(ULONG) - #define SM_SendSRL_IN_Domain_ID 3 - - // - ULONG InRespBufferMaxSize; - #define SM_SendSRL_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendSRL_IN_InRespBufferMaxSize_ID 4 - -} SM_SendSRL_IN, *PSM_SendSRL_IN; - -#define SM_SendSRL_IN_SIZE (FIELD_OFFSET(SM_SendSRL_IN, InRespBufferMaxSize) + SM_SendSRL_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendSRL_OUT -{ - // - ULONG HBAStatus; - #define SM_SendSRL_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendSRL_OUT_HBAStatus_ID 5 - - // - ULONG TotalRespBufferSize; - #define SM_SendSRL_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendSRL_OUT_TotalRespBufferSize_ID 6 - - // - ULONG OutRespBufferSize; - #define SM_SendSRL_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendSRL_OUT_OutRespBufferSize_ID 7 - - // - UCHAR RespBuffer[1]; - #define SM_SendSRL_OUT_RespBuffer_ID 8 - -} SM_SendSRL_OUT, *PSM_SendSRL_OUT; - -#define SM_SendLIRR 17 -typedef struct _SM_SendLIRR_IN -{ - // - UCHAR SourceWWN[8]; - #define SM_SendLIRR_IN_SourceWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendLIRR_IN_SourceWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SM_SendLIRR_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendLIRR_IN_DestWWN_ID 2 - - // - UCHAR Function; - #define SM_SendLIRR_IN_Function_SIZE sizeof(UCHAR) - #define SM_SendLIRR_IN_Function_ID 3 - - // - UCHAR Type; - #define SM_SendLIRR_IN_Type_SIZE sizeof(UCHAR) - #define SM_SendLIRR_IN_Type_ID 4 - - // - ULONG InRespBufferMaxSize; - #define SM_SendLIRR_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendLIRR_IN_InRespBufferMaxSize_ID 5 - -} SM_SendLIRR_IN, *PSM_SendLIRR_IN; - -#define SM_SendLIRR_IN_SIZE (FIELD_OFFSET(SM_SendLIRR_IN, InRespBufferMaxSize) + SM_SendLIRR_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendLIRR_OUT -{ - // - ULONG HBAStatus; - #define SM_SendLIRR_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendLIRR_OUT_HBAStatus_ID 6 - - // - ULONG TotalRespBufferSize; - #define SM_SendLIRR_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendLIRR_OUT_TotalRespBufferSize_ID 7 - - // - ULONG OutRespBufferSize; - #define SM_SendLIRR_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendLIRR_OUT_OutRespBufferSize_ID 8 - - // - UCHAR RespBuffer[1]; - #define SM_SendLIRR_OUT_RespBuffer_ID 9 - -} SM_SendLIRR_OUT, *PSM_SendLIRR_OUT; - -#define SM_SendRLS 18 -typedef struct _SM_SendRLS_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_SendRLS_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRLS_IN_HbaPortWWN_ID 1 - - // - UCHAR DestWWN[8]; - #define SM_SendRLS_IN_DestWWN_SIZE sizeof(UCHAR[8]) - #define SM_SendRLS_IN_DestWWN_ID 2 - - // - ULONG InRespBufferMaxSize; - #define SM_SendRLS_IN_InRespBufferMaxSize_SIZE sizeof(ULONG) - #define SM_SendRLS_IN_InRespBufferMaxSize_ID 3 - -} SM_SendRLS_IN, *PSM_SendRLS_IN; - -#define SM_SendRLS_IN_SIZE (FIELD_OFFSET(SM_SendRLS_IN, InRespBufferMaxSize) + SM_SendRLS_IN_InRespBufferMaxSize_SIZE) - -typedef struct _SM_SendRLS_OUT -{ - // - ULONG HBAStatus; - #define SM_SendRLS_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_SendRLS_OUT_HBAStatus_ID 4 - - // - ULONG TotalRespBufferSize; - #define SM_SendRLS_OUT_TotalRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRLS_OUT_TotalRespBufferSize_ID 5 - - // - ULONG OutRespBufferSize; - #define SM_SendRLS_OUT_OutRespBufferSize_SIZE sizeof(ULONG) - #define SM_SendRLS_OUT_OutRespBufferSize_ID 6 - - // - UCHAR RespBuffer[1]; - #define SM_SendRLS_OUT_RespBuffer_ID 7 - -} SM_SendRLS_OUT, *PSM_SendRLS_OUT; - - -// MS_SM_AdapterEvent - MS_SM_AdapterEvent -#define MS_SM_AdapterEventGuid \ - { 0x7944cf67,0x697b,0x4432, { 0x95,0x3e,0x1f,0xda,0xda,0x88,0x43,0x61 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_AdapterEvent_GUID, \ - 0x7944cf67,0x697b,0x4432,0x95,0x3e,0x1f,0xda,0xda,0x88,0x43,0x61); -#endif - - -typedef struct _MS_SM_AdapterEvent -{ - // - ULONG EventType; - #define MS_SM_AdapterEvent_EventType_SIZE sizeof(ULONG) - #define MS_SM_AdapterEvent_EventType_ID 1 - - // - UCHAR PortWWN[8]; - #define MS_SM_AdapterEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SM_AdapterEvent_PortWWN_ID 2 - -} MS_SM_AdapterEvent, *PMS_SM_AdapterEvent; - -#define MS_SM_AdapterEvent_SIZE (FIELD_OFFSET(MS_SM_AdapterEvent, PortWWN) + MS_SM_AdapterEvent_PortWWN_SIZE) - -// MS_SM_PortEvent - MS_SM_PortEvent -#define MS_SM_PortEventGuid \ - { 0x0f760256,0x8fc6,0x47ad, { 0x9d,0x2e,0xf0,0xd6,0x98,0x01,0xde,0x7c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_PortEvent_GUID, \ - 0x0f760256,0x8fc6,0x47ad,0x9d,0x2e,0xf0,0xd6,0x98,0x01,0xde,0x7c); -#endif - - -typedef struct _MS_SM_PortEvent -{ - // - ULONG EventType; - #define MS_SM_PortEvent_EventType_SIZE sizeof(ULONG) - #define MS_SM_PortEvent_EventType_ID 1 - - // - ULONG FabricPortId; - #define MS_SM_PortEvent_FabricPortId_SIZE sizeof(ULONG) - #define MS_SM_PortEvent_FabricPortId_ID 2 - - // - UCHAR PortWWN[8]; - #define MS_SM_PortEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SM_PortEvent_PortWWN_ID 3 - -} MS_SM_PortEvent, *PMS_SM_PortEvent; - -#define MS_SM_PortEvent_SIZE (FIELD_OFFSET(MS_SM_PortEvent, PortWWN) + MS_SM_PortEvent_PortWWN_SIZE) - -// MS_SM_TargetEvent - MS_SM_TargetEvent -#define MS_SM_TargetEventGuid \ - { 0x6e2d8b73,0xf928,0x4da9, { 0xbd,0xa1,0xae,0x54,0x18,0x9a,0x38,0x25 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_TargetEvent_GUID, \ - 0x6e2d8b73,0xf928,0x4da9,0xbd,0xa1,0xae,0x54,0x18,0x9a,0x38,0x25); -#endif - - -typedef struct _MS_SM_TargetEvent -{ - // - ULONG EventType; - #define MS_SM_TargetEvent_EventType_SIZE sizeof(ULONG) - #define MS_SM_TargetEvent_EventType_ID 1 - - // - UCHAR PortWWN[8]; - #define MS_SM_TargetEvent_PortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SM_TargetEvent_PortWWN_ID 2 - - // - UCHAR DiscoveredPortWWN[8]; - #define MS_SM_TargetEvent_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SM_TargetEvent_DiscoveredPortWWN_ID 3 - - // - UCHAR DomainPortWWN[8]; - #define MS_SM_TargetEvent_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define MS_SM_TargetEvent_DomainPortWWN_ID 4 - -} MS_SM_TargetEvent, *PMS_SM_TargetEvent; - -#define MS_SM_TargetEvent_SIZE (FIELD_OFFSET(MS_SM_TargetEvent, DomainPortWWN) + MS_SM_TargetEvent_DomainPortWWN_SIZE) - -// MS_SM_EventControl - MS_SM_EventControl -#define MS_SM_EventControlGuid \ - { 0xd6145693,0x5988,0x457f, { 0x85,0x81,0x9a,0x01,0x57,0xb5,0x86,0x90 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MS_SM_EventControl_GUID, \ - 0xd6145693,0x5988,0x457f,0x85,0x81,0x9a,0x01,0x57,0xb5,0x86,0x90); -#endif - -// -// Method id definitions for MS_SM_EventControl -#define SM_AddTarget 1 -typedef struct _SM_AddTarget_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_AddTarget_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_AddTarget_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define SM_AddTarget_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_AddTarget_IN_DiscoveredPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_AddTarget_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_AddTarget_IN_DomainPortWWN_ID 3 - - // - ULONG AllTargets; - #define SM_AddTarget_IN_AllTargets_SIZE sizeof(ULONG) - #define SM_AddTarget_IN_AllTargets_ID 4 - -} SM_AddTarget_IN, *PSM_AddTarget_IN; - -#define SM_AddTarget_IN_SIZE (FIELD_OFFSET(SM_AddTarget_IN, AllTargets) + SM_AddTarget_IN_AllTargets_SIZE) - -typedef struct _SM_AddTarget_OUT -{ - // - ULONG HBAStatus; - #define SM_AddTarget_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_AddTarget_OUT_HBAStatus_ID 5 - -} SM_AddTarget_OUT, *PSM_AddTarget_OUT; - -#define SM_AddTarget_OUT_SIZE (FIELD_OFFSET(SM_AddTarget_OUT, HBAStatus) + SM_AddTarget_OUT_HBAStatus_SIZE) - -#define SM_RemoveTarget 2 -typedef struct _SM_RemoveTarget_IN -{ - // - UCHAR HbaPortWWN[8]; - #define SM_RemoveTarget_IN_HbaPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemoveTarget_IN_HbaPortWWN_ID 1 - - // - UCHAR DiscoveredPortWWN[8]; - #define SM_RemoveTarget_IN_DiscoveredPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemoveTarget_IN_DiscoveredPortWWN_ID 2 - - // - UCHAR DomainPortWWN[8]; - #define SM_RemoveTarget_IN_DomainPortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemoveTarget_IN_DomainPortWWN_ID 3 - - // - ULONG AllTargets; - #define SM_RemoveTarget_IN_AllTargets_SIZE sizeof(ULONG) - #define SM_RemoveTarget_IN_AllTargets_ID 4 - -} SM_RemoveTarget_IN, *PSM_RemoveTarget_IN; - -#define SM_RemoveTarget_IN_SIZE (FIELD_OFFSET(SM_RemoveTarget_IN, AllTargets) + SM_RemoveTarget_IN_AllTargets_SIZE) - -typedef struct _SM_RemoveTarget_OUT -{ - // - ULONG HBAStatus; - #define SM_RemoveTarget_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_RemoveTarget_OUT_HBAStatus_ID 5 - -} SM_RemoveTarget_OUT, *PSM_RemoveTarget_OUT; - -#define SM_RemoveTarget_OUT_SIZE (FIELD_OFFSET(SM_RemoveTarget_OUT, HBAStatus) + SM_RemoveTarget_OUT_HBAStatus_SIZE) - -#define SM_AddPort 3 -typedef struct _SM_AddPort_IN -{ - // - UCHAR PortWWN[8]; - #define SM_AddPort_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SM_AddPort_IN_PortWWN_ID 1 - - // - ULONG EventType; - #define SM_AddPort_IN_EventType_SIZE sizeof(ULONG) - #define SM_AddPort_IN_EventType_ID 2 - -} SM_AddPort_IN, *PSM_AddPort_IN; - -#define SM_AddPort_IN_SIZE (FIELD_OFFSET(SM_AddPort_IN, EventType) + SM_AddPort_IN_EventType_SIZE) - -typedef struct _SM_AddPort_OUT -{ - // - ULONG HBAStatus; - #define SM_AddPort_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_AddPort_OUT_HBAStatus_ID 3 - -} SM_AddPort_OUT, *PSM_AddPort_OUT; - -#define SM_AddPort_OUT_SIZE (FIELD_OFFSET(SM_AddPort_OUT, HBAStatus) + SM_AddPort_OUT_HBAStatus_SIZE) - -#define SM_RemovePort 4 -typedef struct _SM_RemovePort_IN -{ - // - UCHAR PortWWN[8]; - #define SM_RemovePort_IN_PortWWN_SIZE sizeof(UCHAR[8]) - #define SM_RemovePort_IN_PortWWN_ID 1 - - // - ULONG EventType; - #define SM_RemovePort_IN_EventType_SIZE sizeof(ULONG) - #define SM_RemovePort_IN_EventType_ID 2 - -} SM_RemovePort_IN, *PSM_RemovePort_IN; - -#define SM_RemovePort_IN_SIZE (FIELD_OFFSET(SM_RemovePort_IN, EventType) + SM_RemovePort_IN_EventType_SIZE) - -typedef struct _SM_RemovePort_OUT -{ - // - ULONG HBAStatus; - #define SM_RemovePort_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_RemovePort_OUT_HBAStatus_ID 3 - -} SM_RemovePort_OUT, *PSM_RemovePort_OUT; - -#define SM_RemovePort_OUT_SIZE (FIELD_OFFSET(SM_RemovePort_OUT, HBAStatus) + SM_RemovePort_OUT_HBAStatus_SIZE) - -#define SM_AddLink 10 -typedef struct _SM_AddLink_OUT -{ - // - ULONG HBAStatus; - #define SM_AddLink_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_AddLink_OUT_HBAStatus_ID 1 - -} SM_AddLink_OUT, *PSM_AddLink_OUT; - -#define SM_AddLink_OUT_SIZE (FIELD_OFFSET(SM_AddLink_OUT, HBAStatus) + SM_AddLink_OUT_HBAStatus_SIZE) - -#define SM_RemoveLink 11 -typedef struct _SM_RemoveLink_OUT -{ - // - ULONG HBAStatus; - #define SM_RemoveLink_OUT_HBAStatus_SIZE sizeof(ULONG) - #define SM_RemoveLink_OUT_HBAStatus_ID 1 - -} SM_RemoveLink_OUT, *PSM_RemoveLink_OUT; - -#define SM_RemoveLink_OUT_SIZE (FIELD_OFFSET(SM_RemoveLink_OUT, HBAStatus) + SM_RemoveLink_OUT_HBAStatus_SIZE) - - -// MSFC_TM - MSFC_TM - -#endif // MS_SM_HBA_API - -#define MSFC_TMGuid \ - { 0x8cf4c7eb,0xa286,0x409d, { 0x9e,0xb9,0x29,0xd7,0xe0,0xe9,0xf4,0xfa } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_TM_GUID, \ - 0x8cf4c7eb,0xa286,0x409d,0x9e,0xb9,0x29,0xd7,0xe0,0xe9,0xf4,0xfa); -#endif - - -typedef struct _MSFC_TM -{ - // - ULONG tm_sec; - #define MSFC_TM_tm_sec_SIZE sizeof(ULONG) - #define MSFC_TM_tm_sec_ID 1 - - // - ULONG tm_min; - #define MSFC_TM_tm_min_SIZE sizeof(ULONG) - #define MSFC_TM_tm_min_ID 2 - - // - ULONG tm_hour; - #define MSFC_TM_tm_hour_SIZE sizeof(ULONG) - #define MSFC_TM_tm_hour_ID 3 - - // - ULONG tm_mday; - #define MSFC_TM_tm_mday_SIZE sizeof(ULONG) - #define MSFC_TM_tm_mday_ID 4 - - // - ULONG tm_mon; - #define MSFC_TM_tm_mon_SIZE sizeof(ULONG) - #define MSFC_TM_tm_mon_ID 5 - - // - ULONG tm_year; - #define MSFC_TM_tm_year_SIZE sizeof(ULONG) - #define MSFC_TM_tm_year_ID 6 - - // - ULONG tm_wday; - #define MSFC_TM_tm_wday_SIZE sizeof(ULONG) - #define MSFC_TM_tm_wday_ID 7 - - // - ULONG tm_yday; - #define MSFC_TM_tm_yday_SIZE sizeof(ULONG) - #define MSFC_TM_tm_yday_ID 8 - - // - ULONG tm_isdst; - #define MSFC_TM_tm_isdst_SIZE sizeof(ULONG) - #define MSFC_TM_tm_isdst_ID 9 - -} MSFC_TM, *PMSFC_TM; - -#define MSFC_TM_SIZE (FIELD_OFFSET(MSFC_TM, tm_isdst) + MSFC_TM_tm_isdst_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/hdaudio.h b/qt-correction-tool/pub/ddk/hdaudio.h deleted file mode 100644 index 70b90af..0000000 --- a/qt-correction-tool/pub/ddk/hdaudio.h +++ /dev/null @@ -1,361 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Assumptions for the type definitions: -// ULONGLONG = 64bit unsigned integer -// ULONG = 32bit unsigned integer -// USHORT = 16bit unsigned integer -// UCHAR = 8bit unsigned integer -// -#ifndef _HDAUDIO_H_ -#define _HDAUDIO_H_ - -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - -// -// The HDAUDIO_BUS_INTERFACE interface GUID -// -// {D2EAF88B-AB18-41a8-B664-8D592167671B} -DEFINE_GUID (GUID_HDAUDIO_BUS_INTERFACE, -0xd2eaf88b, 0xab18, 0x41a8, 0xb6, 0x64, 0x8d, 0x59, 0x21, 0x67, 0x67, 0x1b); - -// -// The HDAUDIO_BUS_INTERFACE_BDL interface GUID -// -// {B4D65397-5634-40b0-B068-F5B9F8B967A5} -DEFINE_GUID(GUID_HDAUDIO_BUS_INTERFACE_BDL, -0xb4d65397, 0x5634, 0x40b0, 0xb0, 0x68, 0xf5, 0xb9, 0xf8, 0xb9, 0x67, 0xa5); - -// -// The HDAUDIO_BUS_INTERFACE_V2 interface GUID -// -// {B52AF5FB-424B-4BB9-A160-5B38BE94E568} -DEFINE_GUID (GUID_HDAUDIO_BUS_INTERFACE_V2, -0xb52af5fb, 0x424b, 0x4bb9, 0xa1, 0x60, 0x5b, 0x38, 0xbe, 0x94, 0xe5, 0x68); - -// -// The HDAudio bus class GUID -// -// {BBD1A745-ADD6-4575-9C2E-9B428D1C3266} -DEFINE_GUID (GUID_HDAUDIO_BUS_CLASS, - 0xbbd1a745, 0xadd6, 0x4575, 0x9c, 0x2e, 0x9b, 0x42, 0x8d, 0x1c, 0x32, 0x66); - -#ifndef _HDAUDIO_CODEC_TRANSFER_ -#define _HDAUDIO_CODEC_TRANSFER_ -// -// Structure for a codec command. -// -typedef struct _HDAUDIO_CODEC_COMMAND -{ - union - { - struct - { - ULONG Data : 8; - ULONG VerbId : 12; - ULONG Node : 8; - ULONG CodecAddress : 4; - } Verb8; - struct - { - ULONG Data : 16; - ULONG VerbId : 4; - ULONG Node : 8; - ULONG CodecAddress : 4; - } Verb16; - ULONG Command; - }; -} HDAUDIO_CODEC_COMMAND, *PHDAUDIO_CODEC_COMMAND; - -// -// Structure to access a codec response. -// -typedef struct _HDAUDIO_CODEC_RESPONSE -{ - union - { - struct - { - union - { - struct - { - ULONG Response:21; - ULONG SubTag : 5; - ULONG Tag : 6; - } Unsolicited; - ULONG Response; - }; - ULONG SDataIn : 4; - ULONG IsUnsolicitedResponse : 1; - ULONG :25; - ULONG HasFifoOverrun : 1; - ULONG IsValid : 1; - }; - ULONGLONG CompleteResponse; // Mostly used for debug print messages. - }; -} HDAUDIO_CODEC_RESPONSE, *PHDAUDIO_CODEC_RESPONSE; - -// -// The structure passed in for sending CODEC verbs. -// -typedef struct _HDAUDIO_CODEC_TRANSFER -{ - HDAUDIO_CODEC_COMMAND Output; - HDAUDIO_CODEC_RESPONSE Input; -} HDAUDIO_CODEC_TRANSFER, *PHDAUDIO_CODEC_TRANSFER; -#endif - -// -// Replacement for WAVEFORMATEXTENSIBLE which has fields that are not used. -// -typedef struct _HDAUDIO_STREAM_FORMAT -{ - ULONG SampleRate; - USHORT ValidBitsPerSample; - USHORT ContainerSize; - USHORT NumberOfChannels; -} HDAUDIO_STREAM_FORMAT, *PHDAUDIO_STREAM_FORMAT; - -// -// The stream descriptor format used to program the input/output converters. -// -typedef struct _HDAUDIO_CONVERTER_FORMAT -{ - union - { - struct - { - USHORT NumberOfChannels : 4; - USHORT BitsPerSample : 3; - USHORT : 1; - USHORT SampleRate : 7; - USHORT StreamType : 1; // Is always set to 0 by bus driver DDI - }; - USHORT ConverterFormat; - }; -} HDAUDIO_CONVERTER_FORMAT, *PHDAUDIO_CONVERTER_FORMAT; - -// -// The different stream states supported by HDAudio -> STOP (reset), PAUSE or RUN -// -typedef enum _HDAUDIO_STREAM_STATE -{ - ResetState = 0, - StopState = 1, - PauseState = 1, - RunState = 2 -} HDAUDIO_STREAM_STATE, *PHDAUDIO_STREAM_STATE; - -// -// The different power states that HD Audio codecs can support. All states -// are from DEVICE_POWER_STATE except PowerCodecD3Cold. -// -typedef enum _HDAUDIO_CODEC_POWER_STATE { - PowerCodecUnspecified = 0, - PowerCodecD0, - PowerCodecD1, - PowerCodecD2, - PowerCodecD3, - PowerCodecD3Cold, - PowerCodecMaximum -} HDAUDIO_CODEC_POWER_STATE, *PHDAUDIO_CODEC_POWER_STATE; - -// -// HDAudio codec transfer complete callback function -// -typedef VOID (*PHDAUDIO_TRANSFER_COMPLETE_CALLBACK)(HDAUDIO_CODEC_TRANSFER *, PVOID); - -// -// HDAudio unsolicited response callback function -// -typedef VOID (*PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK)(HDAUDIO_CODEC_RESPONSE, PVOID); - -// -// HDAudio device information structure -// -typedef struct _HDAUDIO_DEVICE_INFORMATION -{ - USHORT Size; // size of this structure - USHORT DeviceVersion; // maj.min (maj is high byte, min is low byte) - USHORT DriverVersion; // maj.min (maj is high byte, min is low byte) - USHORT CodecsDetected; // mask of codecs present. Bit number == SDI line number - BOOLEAN IsStripingSupported; // TRUE if striping (2 SDO lines) is supported -} HDAUDIO_DEVICE_INFORMATION, *PHDAUDIO_DEVICE_INFORMATION; - -// -// HDAudio Buffer Descriptor list entry -// -typedef struct _HDAUDIO_BUFFER_DESCRIPTOR -{ - PHYSICAL_ADDRESS Address; - ULONG Length; - ULONG InterruptOnCompletion; -} HDAUDIO_BUFFER_DESCRIPTOR, *PHDAUDIO_BUFFER_DESCRIPTOR; - - - -typedef __checkReturn NTSTATUS (*PTRANSFER_CODEC_VERBS) (__in PVOID _context, __in ULONG Count, __inout_ecount(Count) PHDAUDIO_CODEC_TRANSFER CodecTransfer, __in PHDAUDIO_TRANSFER_COMPLETE_CALLBACK Callback, __in PVOID Context); -typedef __checkReturn NTSTATUS (*PALLOCATE_CAPTURE_DMA_ENGINE) (__in PVOID _context, __in UCHAR CodecAddress, __in PHDAUDIO_STREAM_FORMAT StreamFormat, OUT PHANDLE Handle, __out PHDAUDIO_CONVERTER_FORMAT ConverterFormat); -typedef __checkReturn NTSTATUS (*PALLOCATE_RENDER_DMA_ENGINE) (__in PVOID _context, __in PHDAUDIO_STREAM_FORMAT StreamFormat, __in BOOLEAN Stripe, __out PHANDLE Handle, __out PHDAUDIO_CONVERTER_FORMAT ConverterFormat); -typedef __checkReturn NTSTATUS (*PCHANGE_BANDWIDTH_ALLOCATION) (__in PVOID _context, __in HANDLE Handle, __in PHDAUDIO_STREAM_FORMAT StreamFormat, __out PHDAUDIO_CONVERTER_FORMAT ConverterFormat); -typedef __checkReturn NTSTATUS (*PALLOCATE_DMA_BUFFER) (__in PVOID _context, __in HANDLE Handle, __in SIZE_T RequestedBufferSize, __out PMDL *BufferMdl, __out PSIZE_T AllocatedBufferSize, OUT PUCHAR StreamId, __out PULONG FifoSize); -typedef __checkReturn NTSTATUS (*PFREE_DMA_BUFFER) (__in PVOID _context, __in HANDLE Handle); -typedef __checkReturn NTSTATUS (*PFREE_DMA_ENGINE) (__in PVOID _context, __in HANDLE Handle); -typedef __checkReturn NTSTATUS (*PSET_DMA_ENGINE_STATE) (__in PVOID _context, __in HDAUDIO_STREAM_STATE StreamState, __in ULONG NumberOfHandles, __in PHANDLE Handles); -typedef VOID (*PGET_WALL_CLOCK_REGISTER) (__in PVOID _context, __out PULONG *Wallclock); -typedef __checkReturn NTSTATUS (*PGET_LINK_POSITION_REGISTER) (__in PVOID _context, __in HANDLE Handle, __out PULONG *Position); -typedef __checkReturn NTSTATUS (*PREGISTER_EVENT_CALLBACK) (__in PVOID _context, __in PHDAUDIO_UNSOLICITED_RESPONSE_CALLBACK Routine, __in PVOID Context, __out PUCHAR Tag); -typedef __checkReturn NTSTATUS (*PUNREGISTER_EVENT_CALLBACK) (__in PVOID _context, __in UCHAR Tag); -typedef __checkReturn NTSTATUS (*PGET_DEVICE_INFORMATION) (__in PVOID _context, __in __out PHDAUDIO_DEVICE_INFORMATION DeviceInformation); -typedef VOID (*PGET_RESOURCE_INFORMATION) (__in PVOID _context, __out PUCHAR CodecAddress, __out PUCHAR FunctionGroupStartNode); - -typedef struct _HDAUDIO_BUS_INTERFACE -{ - // - // First we define the standard INTERFACE structure ... - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // Then we expand the structure with our interface specific data - // - PTRANSFER_CODEC_VERBS TransferCodecVerbs; - PALLOCATE_CAPTURE_DMA_ENGINE AllocateCaptureDmaEngine; - PALLOCATE_RENDER_DMA_ENGINE AllocateRenderDmaEngine; - PCHANGE_BANDWIDTH_ALLOCATION ChangeBandwidthAllocation; - PALLOCATE_DMA_BUFFER AllocateDmaBuffer; - PFREE_DMA_BUFFER FreeDmaBuffer; - PFREE_DMA_ENGINE FreeDmaEngine; - PSET_DMA_ENGINE_STATE SetDmaEngineState; - PGET_WALL_CLOCK_REGISTER GetWallClockRegister; - PGET_LINK_POSITION_REGISTER GetLinkPositionRegister; - PREGISTER_EVENT_CALLBACK RegisterEventCallback; - PUNREGISTER_EVENT_CALLBACK UnregisterEventCallback; - PGET_DEVICE_INFORMATION GetDeviceInformation; - PGET_RESOURCE_INFORMATION GetResourceInformation; -} HDAUDIO_BUS_INTERFACE, *PHDAUDIO_BUS_INTERFACE; - -// -// To support the Bdl interface... -// -// -// ISR Callback definition for Bdl interface -// -typedef void (*PHDAUDIO_BDL_ISR) (__in VOID *Context, __in ULONG InterruptBitMask); - -// -// Additional BDL interface functions. -// -typedef __checkReturn NTSTATUS (*PALLOCATE_CONTIGUOUS_DMA_BUFFER) (__in PVOID _context, __in HANDLE Handle, - ULONG RequestedBufferSize, __out PVOID *DataBuffer, __out PHDAUDIO_BUFFER_DESCRIPTOR *BdlBuffer); -typedef __checkReturn NTSTATUS (*PFREE_CONTIGUOUS_DMA_BUFFER) (__in PVOID _context, __in HANDLE Handle); -typedef __checkReturn NTSTATUS (*PSETUP_DMA_ENGINE_WITH_BDL) (__in_bcount(BufferLength) PVOID _context, __in HANDLE Handle, __in ULONG BufferLength, - __in ULONG Lvi, __in PHDAUDIO_BDL_ISR Isr, __in PVOID Context, __out PUCHAR StreamId, __out PULONG FifoSize); - -typedef struct _HDAUDIO_BUS_INTERFACE_BDL -{ - // - // First we define the standard INTERFACE structure ... - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // Then we expand the structure with the HDAUDIO_BUS_INTERFACE_BDL stuff. - // Many functions are identical (and derived) from the HDAUDIO_BUS_INTERFACE - // interface. PrepareDmaEngineWithBdl was added instead of PrepareDmaEngine - // and GetDeviceInformationBdl instead of GetDeviceInformation. - // - PTRANSFER_CODEC_VERBS TransferCodecVerbs; - PALLOCATE_CAPTURE_DMA_ENGINE AllocateCaptureDmaEngine; - PALLOCATE_RENDER_DMA_ENGINE AllocateRenderDmaEngine; - PCHANGE_BANDWIDTH_ALLOCATION ChangeBandwidthAllocation; - PALLOCATE_CONTIGUOUS_DMA_BUFFER AllocateContiguousDmaBuffer; - PSETUP_DMA_ENGINE_WITH_BDL SetupDmaEngineWithBdl; - PFREE_CONTIGUOUS_DMA_BUFFER FreeContiguousDmaBuffer; - PFREE_DMA_ENGINE FreeDmaEngine; - PSET_DMA_ENGINE_STATE SetDmaEngineState; - PGET_WALL_CLOCK_REGISTER GetWallClockRegister; - PGET_LINK_POSITION_REGISTER GetLinkPositionRegister; - PREGISTER_EVENT_CALLBACK RegisterEventCallback; - PUNREGISTER_EVENT_CALLBACK UnregisterEventCallback; - PGET_DEVICE_INFORMATION GetDeviceInformation; - PGET_RESOURCE_INFORMATION GetResourceInformation; -} HDAUDIO_BUS_INTERFACE_BDL, *PHDAUDIO_BUS_INTERFACE_BDL; - -// -// Additional interface functions for DMA notification support -// -typedef __checkReturn NTSTATUS (*PALLOCATE_DMA_BUFFER_WITH_NOTIFICATION) (__in PVOID _context, - __in HANDLE Handle, - __in ULONG NotificationCount, - __in SIZE_T RequestedBufferSize, - __out PMDL *BufferMdl, - __out PSIZE_T AllocatedBufferSize, - __out PSIZE_T OffsetFromFirstPage, - __out PUCHAR StreamId, - __out PULONG FifoSize); - -typedef __checkReturn NTSTATUS (*PFREE_DMA_BUFFER_WITH_NOTIFICATION) ( __in PVOID _context, - __in HANDLE Handle, - __in PMDL BufferMdl, - __in SIZE_T BufferSize); - -typedef __checkReturn NTSTATUS (*PREGISTER_NOTIFICATION_EVENT) (__in PVOID _context, - __in HANDLE Handle, - __in PKEVENT NotificationEvent); - -typedef __checkReturn NTSTATUS (*PUNREGISTER_NOTIFICATION_EVENT) (__in PVOID _context, - __in HANDLE Handle, - __in PKEVENT NotificationEvent); - -typedef struct _HDAUDIO_BUS_INTERFACE_V2 -{ - // - // First we define the standard INTERFACE structure ... - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // Then we expand the structure with the HDAUDIO_BUS_INTERFACE_PING_PONG stuff. - // Many functions are identical (and derived) from the HDAUDIO_BUS_INTERFACE - // interface. - - PTRANSFER_CODEC_VERBS TransferCodecVerbs; - PALLOCATE_CAPTURE_DMA_ENGINE AllocateCaptureDmaEngine; - PALLOCATE_RENDER_DMA_ENGINE AllocateRenderDmaEngine; - PCHANGE_BANDWIDTH_ALLOCATION ChangeBandwidthAllocation; - PALLOCATE_DMA_BUFFER AllocateDmaBuffer; - PFREE_DMA_BUFFER FreeDmaBuffer; - PFREE_DMA_ENGINE FreeDmaEngine; - PSET_DMA_ENGINE_STATE SetDmaEngineState; - PGET_WALL_CLOCK_REGISTER GetWallClockRegister; - PGET_LINK_POSITION_REGISTER GetLinkPositionRegister; - PREGISTER_EVENT_CALLBACK RegisterEventCallback; - PUNREGISTER_EVENT_CALLBACK UnregisterEventCallback; - PGET_DEVICE_INFORMATION GetDeviceInformation; - PGET_RESOURCE_INFORMATION GetResourceInformation; - PALLOCATE_DMA_BUFFER_WITH_NOTIFICATION AllocateDmaBufferWithNotification; - PFREE_DMA_BUFFER_WITH_NOTIFICATION FreeDmaBufferWithNotification; - PREGISTER_NOTIFICATION_EVENT RegisterNotificationEvent; - PUNREGISTER_NOTIFICATION_EVENT UnregisterNotificationEvent; -} HDAUDIO_BUS_INTERFACE_V2, *PHDAUDIO_BUS_INTERFACE_V2; - -#pragma warning(default:4201) -#pragma warning(default:4214) - -#endif // _HDAUDIO_H_ - diff --git a/qt-correction-tool/pub/ddk/hidclass.h b/qt-correction-tool/pub/ddk/hidclass.h deleted file mode 100644 index 2e20afd..0000000 --- a/qt-correction-tool/pub/ddk/hidclass.h +++ /dev/null @@ -1,245 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - hidclass.h - -Abstract - - Definitions that are common to clients of the HID class driver. - -Environment: - - Kernel mode only - -Revision History: - - ---*/ - - -#include - -// -// Define the HID class guid *OUTSIDE* the #ifndef/#endif to allow -// multiple includes with precompiled headers. -// -DEFINE_GUID( GUID_DEVINTERFACE_HID, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, \ - 0x11, 0x11, 0x00, 0x00, 0x30); -// Obsolete GUID naming convention. -#define GUID_CLASS_INPUT GUID_DEVINTERFACE_HID - -// -// 2c4e2e88-25e6-4c33-882f-3d82e6073681 -// -DEFINE_GUID( GUID_HID_INTERFACE_NOTIFY, 0x2c4e2e88L, 0x25e6, 0x4c33, 0x88, 0x2f, 0x3d, 0x82, 0xe6, 0x07, 0x36, 0x81 ); - -// {F5C315A5-69AC-4bc2-9279-D0B64576F44B} -DEFINE_GUID( GUID_HID_INTERFACE_HIDPARSE, 0xf5c315a5, 0x69ac, 0x4bc2, 0x92, 0x79, 0xd0, 0xb6, 0x45, 0x76, 0xf4, 0x4b ); - - -#ifndef __HIDCLASS_H__ -#define __HIDCLASS_H__ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - - -#define GUID_CLASS_INPUT_STR "4D1E55B2-F16F-11CF-88CB-001111000030" - -// -// HID_REVISION specifies the minimum revision of HIDCLASS.SYS -// required to support minidrivers compiled with this header file. -// -#define HID_REVISION 0x00000001 - -// -// Macro for defining HID ioctls -// -#define HID_CTL_CODE(id) \ - CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_NEITHER, FILE_ANY_ACCESS) -#define HID_BUFFER_CTL_CODE(id) \ - CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_BUFFERED, FILE_ANY_ACCESS) -#define HID_IN_CTL_CODE(id) \ - CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_IN_DIRECT, FILE_ANY_ACCESS) -#define HID_OUT_CTL_CODE(id) \ - CTL_CODE(FILE_DEVICE_KEYBOARD, (id), METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - -// -// IOCTLs supported by the upper edge of the HID class driver -// - -#define IOCTL_HID_GET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(100) -#define IOCTL_HID_SET_DRIVER_CONFIG HID_BUFFER_CTL_CODE(101) -#define IOCTL_HID_GET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(102) -#define IOCTL_HID_SET_POLL_FREQUENCY_MSEC HID_BUFFER_CTL_CODE(103) -#define IOCTL_GET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(104) -#define IOCTL_SET_NUM_DEVICE_INPUT_BUFFERS HID_BUFFER_CTL_CODE(105) -#define IOCTL_HID_GET_COLLECTION_INFORMATION HID_BUFFER_CTL_CODE(106) - -#define IOCTL_HID_GET_COLLECTION_DESCRIPTOR HID_CTL_CODE(100) -#define IOCTL_HID_FLUSH_QUEUE HID_CTL_CODE(101) - -#define IOCTL_HID_SET_FEATURE HID_IN_CTL_CODE(100) -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define IOCTL_HID_SET_OUTPUT_REPORT HID_IN_CTL_CODE(101) -#endif - -#define IOCTL_HID_GET_FEATURE HID_OUT_CTL_CODE(100) -#define IOCTL_GET_PHYSICAL_DESCRIPTOR HID_OUT_CTL_CODE(102) -#define IOCTL_HID_GET_HARDWARE_ID HID_OUT_CTL_CODE(103) -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define IOCTL_HID_GET_INPUT_REPORT HID_OUT_CTL_CODE(104) -#endif - -/* - * No more IOCTL_HID_GET_FRIENDLY_NAME - use one of the following: - */ -#define IOCTL_HID_GET_MANUFACTURER_STRING HID_OUT_CTL_CODE(110) -#define IOCTL_HID_GET_PRODUCT_STRING HID_OUT_CTL_CODE(111) -#define IOCTL_HID_GET_SERIALNUMBER_STRING HID_OUT_CTL_CODE(112) - -#define IOCTL_HID_GET_INDEXED_STRING HID_OUT_CTL_CODE(120) -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define IOCTL_HID_GET_MS_GENRE_DESCRIPTOR HID_OUT_CTL_CODE(121) - -#define IOCTL_HID_ENABLE_SECURE_READ HID_CTL_CODE(130) -#define IOCTL_HID_DISABLE_SECURE_READ HID_CTL_CODE(131) -#endif - -/* - * This is used to pass write-report and feature-report information - * from HIDCLASS to a minidriver. - */ -typedef struct _HID_XFER_PACKET { - PUCHAR reportBuffer; - ULONG reportBufferLen; - UCHAR reportId; -} HID_XFER_PACKET, *PHID_XFER_PACKET; - -#ifdef NT_INCLUDED - -enum DeviceObjectState { - DeviceObjectStarted, - DeviceObjectStopped, - DeviceObjectRemoved -}; - -typedef -VOID -(*PHID_STATUS_CHANGE)( - __in PVOID Context, - __in enum DeviceObjectState State - ); - -typedef struct _HID_INTERFACE_NOTIFY_PNP -{ -#ifndef __cplusplus - INTERFACE; -#else - INTERFACE i; -#endif - PHID_STATUS_CHANGE StatusChangeFn; - PVOID CallbackContext; -} HID_INTERFACE_NOTIFY_PNP, *PHID_INTERFACE_NOTIFY_PNP; - - -#ifdef __HIDPI_H__ - -__checkReturn -typedef -NTSTATUS -(__stdcall *PHIDP_GETCAPS) ( - __in PHIDP_PREPARSED_DATA PreparsedData, - __out PHIDP_CAPS Capabilities - ); - -typedef struct _HID_INTERFACE_HIDPARSE -{ -#ifndef __cplusplus - INTERFACE; -#else - INTERFACE i; -#endif - PHIDP_GETCAPS HidpGetCaps; -} HID_INTERFACE_HIDPARSE, *PHID_INTERFACE_HIDPARSE; - -#endif // __HIDPI_H__ - -#endif // NT_INCLUDED - -// -// Structure passed by IOCTL_HID_GET_COLLECTION_INFORMATION -// - -typedef struct _HID_COLLECTION_INFORMATION { - - // - // DescriptorSize is the size of the input buffer required to accept - // the collection descriptor returned by - // IOCTL_HID_GET_COLLECTION_DESCRIPTOR. - // - - ULONG DescriptorSize; - - // - // Polled is TRUE if this collection is a polled collection. - // - - BOOLEAN Polled; - - // - // Reserved1 must be set to zero. - // - - UCHAR Reserved1[ 1 ]; - - // - // Vendor ids of this hid device - // - USHORT VendorID; - USHORT ProductID; - USHORT VersionNumber; - - // - // Additional fields, if any, will be added at the end of this structure. - // - -} HID_COLLECTION_INFORMATION, *PHID_COLLECTION_INFORMATION; - -// -// Structure passed by IOCTL_HID_GET_DRIVER_CONFIG and -// IOCTL_HID_SET_DRIVER_CONFIG -// - -typedef struct _HID_DRIVER_CONFIG { - - // - // Size must be set to the size of this structure. - // - - ULONG Size; - - // - // Size of the input report queue (in reports). This value can be set. - // - - ULONG RingBufferSize; - -} HID_DRIVER_CONFIG, *PHID_DRIVER_CONFIG; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - - -#endif // __HIDCLASS_H__ - - - diff --git a/qt-correction-tool/pub/ddk/hidpddi.h b/qt-correction-tool/pub/ddk/hidpddi.h deleted file mode 100644 index cf312b4..0000000 --- a/qt-correction-tool/pub/ddk/hidpddi.h +++ /dev/null @@ -1,256 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - HIDPDDI.H - -Abstract: - - This module contains the PUBLIC definitions for the - code that implements the driver side of the parsing library. - -Environment: - - Kernel mode - ---*/ - -#ifndef _HIDPDDI_H -#define _HIDPDDI_H - -#include "hidusage.h" -#include "hidpi.h" - - -typedef struct _HIDP_COLLECTION_DESC -{ - USAGE UsagePage; - USAGE Usage; - - UCHAR CollectionNumber; - UCHAR Reserved [15]; // Must be zero - - USHORT InputLength; - USHORT OutputLength; - USHORT FeatureLength; - USHORT PreparsedDataLength; - - PHIDP_PREPARSED_DATA PreparsedData; -} HIDP_COLLECTION_DESC, *PHIDP_COLLECTION_DESC; - -typedef struct _HIDP_REPORT_IDS -{ - UCHAR ReportID; - UCHAR CollectionNumber; - USHORT InputLength; - USHORT OutputLength; - USHORT FeatureLength; -} HIDP_REPORT_IDS, *PHIDP_REPORT_IDS; - -typedef struct _HIDP_GETCOLDESC_DBG -{ - ULONG BreakOffset; - ULONG ErrorCode; - ULONG Args[6]; -} HIDP_GETCOLDESC_DBG, *PHIDP_GETCOLDESC_DBG; - -typedef struct _HIDP_DEVICE_DESC -{ - PHIDP_COLLECTION_DESC CollectionDesc; // Array allocated By Parser - ULONG CollectionDescLength; - PHIDP_REPORT_IDS ReportIDs; // Array allocated By Parsre - ULONG ReportIDsLength; - HIDP_GETCOLDESC_DBG Dbg; -} HIDP_DEVICE_DESC, *PHIDP_DEVICE_DESC; - -__checkReturn -__drv_at(DeviceDescription->CollectionDes, __drv_when(return==0, __drv_allocatesMem(Mem))) -__drv_at(DeviceDescription->ReportIDs, __drv_when(return==0, __drv_allocatesMem(Mem))) -NTSTATUS -HidP_GetCollectionDescription ( - __in_bcount(DescLength) PHIDP_REPORT_DESCRIPTOR ReportDesc, - __in ULONG DescLength, - __in POOL_TYPE PoolType, - __out PHIDP_DEVICE_DESC DeviceDescription - ); -/*++ -Routine Description: - Given a RAW report descriptor, this function fills in the DeviceDescription - block with a linked list of collection descriptors and the corresponding - report ID information that is described by the given report descriptor. - The memory for the collection information and the ReportID information is - allocated from PoolType. - -Arguments: - ReportDesc the raw report descriptor. - DescLength the length of the report descriptor. - PoolType pool type from which to allocate the linked lists - DeviceDescription device description block that will be filled in - with the above lists - -Return Value: - STATUS_SUCCESS -- if there were no errors which parsing - the report descriptor and allocating the - memory blocks necessary to describe the - device. - STATUS_NO_DATA_DETECTED -- if there were no top-level collections - in the report descriptor - STATUS_COULD_NOT_INTERPRET -- if an error was detected in the report - descriptor. see the error code as set in - Dbg field of the device description block - for more information on the parsing error - STATUS_BUFFER_TOO_SMALL -- if while parsing an item, the function - hits the end of the report descriptor - when it expects more data to exist - STATUS_INSUFFICIENT_RESOURCES -- if a memory allocation failed - STATUS_ILLEGAL_INSTRUCTION -- if there is an item in the report - descriptor that is not recognized - by the parser - HIDP_STATUS_INVALID_REPORT_TYPE -- if a report ID of zero was found in the - descriptor ---*/ -__drv_at(DeviceDescription->CollectionDesc, __drv_freesMem(Mem)) -__drv_at(DeviceDescription->ReportIDs, __drv_freesMem(Mem)) -VOID -HidP_FreeCollectionDescription ( - __in PHIDP_DEVICE_DESC DeviceDescription - ); -/*++ -Routine Description: - This function frees the resources in DeviceDescription that were - allocated by HidP_GetCollectionDescription. It does not, however, - free the the DeviceDescription block itself. - -Arguments: - DeviceDescription HIDP_DEVICE_DESC block that was previously filled - in by a call to HidP_GetCollectionDescription ---*/ - -// -// HIDP_POWER_EVENT is an entry point into hidparse.sys that will answer the -// Power iocontrol "IOCTL_GET_SYS_BUTTON_EVENT". -// -// HidPacket is the from the device AFTER modifying to add the -// obligatory report ID. Remember that in order to use this parser the data -// from the device must be formated such that if the device does not return a -// report ID as the first byte that the report is appended to a report id byte -// of zero. -// -__checkReturn -NTSTATUS -HidP_SysPowerEvent ( - __in_bcount(HidPacketLength) PCHAR HidPacket, - __in USHORT HidPacketLength, - __in PHIDP_PREPARSED_DATA Ppd, - __out PULONG OutputBuffer - ); - -// -// HIDP_POWER_CAPS answers IOCTL_GET_SYS_POWER_BUTTON_CAPS -// -__checkReturn -NTSTATUS -HidP_SysPowerCaps ( - __in PHIDP_PREPARSED_DATA Ppd, - __out PULONG OutputBuffer - ); - - -#define HIDP_GETCOLDESC_SUCCESS 0x00 -#define HIDP_GETCOLDESC_RESOURCES 0x01 -// Insufficient resources to allocate needed memory. - -#define HIDP_GETCOLDESC_BUFFER 0x02 -#define HIDP_GETCOLDESC_LINK_RESOURCES 0x03 -#define HIDP_GETCOLDESC_UNEXP_END_COL 0x04 -// An extra end collection token was found. - -#define HIDP_GETCOLDESC_PREPARSE_RESOURCES 0x05 -// Insufficient resources to allocate memory for preparsing. - -#define HIDP_GETCOLDESC_ONE_BYTE 0x06 -#define HIDP_GETCOLDESC_TWO_BYTE 0x07 -#define HIDP_GETCOLDESC_FOUR_BYTE 0x08 -// One two and four more byte were expected but not found. - -#define HIDP_GETCOLDESC_BYTE_ALLIGN 0x09 -// A given report was not byte aligned -// Args[0] -- Collection number of the offending collection -// Args[1] -- Report ID of offending report -// Args[2] -- Length (in bits) of the Input report for this ID -// Args[3] -- Length (in bits) of the Output report for this ID -// Args[4] -- Length (in bits) of the Feature report for this ID - -#define HIDP_GETCOLDESC_MAIN_ITEM_NO_USAGE 0x0A -// A non constant main item was declaired without a corresponding usage. -// Only constant main items (used as padding) are allowed with no usage - -#define HIDP_GETCOLDESC_TOP_COLLECTION_USAGE 0x0B -// A top level collection (Arg[0]) was declared without a usage or with -// more than one usage -// Args[0] -- Collection number of the offending collection - -#define HIDP_GETCOLDESC_PUSH_RESOURCES 0x10 -// Insufficient resources required to push more items to either the global -// items stack or the usage stack - -#define HIDP_GETCOLDESC_ITEM_UNKNOWN 0x12 -// An unknown item was found in the report descriptor -// Args[0] -- The item value of the unknown item - -#define HIDP_GETCOLDESC_REPORT_ID 0x13 -// Report ID declaration found outside of top level collection. Report ID's -// must be defined within the context of a top level collection -// Args[0] -- Report ID of the offending report - -#define HIDP_GETCOLDESC_BAD_REPORT_ID 0x14 -// A bad report ID value was found...Report IDs must be within the range -// of 1-255 - -#define HIDP_GETCOLDESC_NO_REPORT_ID 0x15 -// The parser discovered a top level collection in a complex device (more -// than one top level collection) that had no declared report ID or a -// report ID spanned multiple collections -// Args[0] -- Collection number of the offending collection - -#define HIDP_GETCOLDESC_DEFAULT_ID_ERROR 0x16 -// The parser detected a condition where a main item was declared without -// a global report ID so the default report ID was used. After this main -// item declaration, the parser detected either another main item that had -// an explicitly defined report ID or it detected a second top-level collection -// The default report ID is only allowed for devices with one top-level -// collection and don't have any report IDs explicitly declared. -// -// The parser detects this error upon finding the second collection or upon -// finding the main item declaration with the explicit report ID. -// -// Args[0] -- Contains the collection number being processed when the -// error was detected. - -#define HIDP_GETCOLDESC_NO_DATA 0x1A -// No top level collections were found in this device. - -#define HIDP_GETCOLDESC_INVALID_MAIN_ITEM 0x1B -// A main item was detected outside of a top level collection. - -#define HIDP_GETCOLDESC_NO_CLOSE_DELIMITER 0x20 -// A start delimiter token was found with no corresponding end delimiter - -#define HIDP_GETCOLDESC_NOT_VALID_DELIMITER 0x21 -// The parser detected a non-usage item with a delimiter declaration -// Args[0] -- item code for the offending item - -#define HIDP_GETCOLDESC_MISMATCH_OC_DELIMITER 0x22 -// The parser detected either a close delimiter without a corresponding open -// delimiter or detected a nested open delimiter - -#define HIDP_GETCOLDESC_UNSUPPORTED 0x40 -// The given report descriptor was found to have a valid report descriptor -// containing a scenario that this parser does not support. -// For instance, declaring an ARRAY style main item with delimiters. - -#endif - - diff --git a/qt-correction-tool/pub/ddk/hidport.h b/qt-correction-tool/pub/ddk/hidport.h deleted file mode 100644 index 31bb0d5..0000000 --- a/qt-correction-tool/pub/ddk/hidport.h +++ /dev/null @@ -1,222 +0,0 @@ -/*++ - -Copyright (c) 1996 Microsoft Corporation - -Module Name: - - hidmini.h - -Abstract - - Definitions that are common to all HID minidrivers. - -Authors: - - Forrest Foltz - Ervin Peretz - -Environment: - - Kernel mode only - -Revision History: - - ---*/ - -#ifndef __HIDPORT_H__ -#define __HIDPORT_H__ - -#include - -// -// HID_MINIDRIVER_REGISTRATION is a packet of information describing the -// HID minidriver to the class driver. It must be filled in by the minidriver -// and passed to the class driver via HidRegisterMinidriver() from the -// minidriver's DriverEntry() routine. -// - -typedef struct _HID_MINIDRIVER_REGISTRATION { - - // - // Revision must be set to HID_REVISION by the minidriver - // - - ULONG Revision; - - // - // DriverObject is a pointer to the minidriver's DriverObject that it - // received as a DriverEntry() parameter. - // - - PDRIVER_OBJECT DriverObject; - - // - // RegistryPath is a pointer to the minidriver's RegistryPath that it - // received as a DriverEntry() parameter. - // - - PUNICODE_STRING RegistryPath; - - // - // DeviceExtensionSize is the size of the minidriver's per-device - // extension. - // - - ULONG DeviceExtensionSize; - - // - // Either all or none of the devices driven by a given minidriver are polled. - // - BOOLEAN DevicesArePolled; - UCHAR Reserved[3]; - -} HID_MINIDRIVER_REGISTRATION, *PHID_MINIDRIVER_REGISTRATION; - -// -// HID_DEVICE_EXTENSION is the public part of the device extension of a HID -// functional device object. -// - -typedef struct _HID_DEVICE_EXTENSION { - - // - // PhysicalDeviceObject... normally IRPs are not passed to this. - // - - PDEVICE_OBJECT PhysicalDeviceObject; - - // - // NextDeviceObject... IRPs are sent here by the minidriver. Note that - // NextDeviceObject and PhysicalDeviceObject are the same unless someone - // has inserted a 'filter' device object, in which case they are not the - // same. Sending IRPs to NextDeviceObject will hit the filter device - // objects on the way down. - // - - PDEVICE_OBJECT NextDeviceObject; - - // - // MiniDeviceExtension is the per-device extension area for use by - // the minidriver. It's size is determined by the DeviceExtensionSize - // parameter passed in to HidAddDevice(). - // - // So, given a Functional Device Object, a mininidriver finds this - // structure by: - // - // HidDeviceExtension = (PHID_DEVICE_EXTENSION)(Fdo->DeviceExtension); - // - // And of course it's per-device extension is found by: - // - // MiniDeviceExtension = HidDeviceExtension->MiniDeviceExtension; - // - - PVOID MiniDeviceExtension; - -} HID_DEVICE_EXTENSION, *PHID_DEVICE_EXTENSION; - -typedef struct _HID_DEVICE_ATTRIBUTES { - - ULONG Size; - // - // sizeof (struct _HID_DEVICE_ATTRIBUTES) - // - - // - // Vendor ids of this hid device - // - USHORT VendorID; - USHORT ProductID; - USHORT VersionNumber; - USHORT Reserved[11]; - -} HID_DEVICE_ATTRIBUTES, * PHID_DEVICE_ATTRIBUTES; - - -#include -typedef struct _HID_DESCRIPTOR -{ - UCHAR bLength; - UCHAR bDescriptorType; - USHORT bcdHID; - UCHAR bCountry; - UCHAR bNumDescriptors; - - /* - * This is an array of one OR MORE descriptors. - */ - struct _HID_DESCRIPTOR_DESC_LIST { - UCHAR bReportType; - USHORT wReportLength; - } DescriptorList [1]; - -} HID_DESCRIPTOR, * PHID_DESCRIPTOR; -#include - - -typedef -VOID -(*HID_SEND_IDLE_CALLBACK)( - __in PVOID Context - ); - -typedef struct _HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO { - HID_SEND_IDLE_CALLBACK IdleCallback; - PVOID IdleContext; -} HID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO, *PHID_SUBMIT_IDLE_NOTIFICATION_CALLBACK_INFO; - -// -// Function prototypes for the HID services exported by the hid class driver -// follow. -// - -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSTATUS -HidRegisterMinidriver( - __in PHID_MINIDRIVER_REGISTRATION MinidriverRegistration - ); - -#if(NTDDI_VERSION>=NTDDI_WINXPSP1) // Available on XP XP1 and above -NTSTATUS -HidNotifyPresence( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN IsPresent - ); -#endif - -// -// Internal IOCTLs for the class/mini driver interface. -// - -#define IOCTL_HID_GET_DEVICE_DESCRIPTOR HID_CTL_CODE(0) -#define IOCTL_HID_GET_REPORT_DESCRIPTOR HID_CTL_CODE(1) -#define IOCTL_HID_READ_REPORT HID_CTL_CODE(2) -#define IOCTL_HID_WRITE_REPORT HID_CTL_CODE(3) -#define IOCTL_HID_GET_STRING HID_CTL_CODE(4) -#define IOCTL_HID_ACTIVATE_DEVICE HID_CTL_CODE(7) -#define IOCTL_HID_DEACTIVATE_DEVICE HID_CTL_CODE(8) -#define IOCTL_HID_GET_DEVICE_ATTRIBUTES HID_CTL_CODE(9) -#define IOCTL_HID_SEND_IDLE_NOTIFICATION_REQUEST HID_CTL_CODE(10) - -/* - * Codes for HID-specific descriptor types, from HID USB spec. - */ -#define HID_HID_DESCRIPTOR_TYPE 0x21 -#define HID_REPORT_DESCRIPTOR_TYPE 0x22 -#define HID_PHYSICAL_DESCRIPTOR_TYPE 0x23 // for body part associations - - - -/* - * These are string IDs for use with IOCTL_HID_GET_STRING - * They match the string field offsets in Chapter 9 of the USB Spec. - */ -#define HID_STRING_ID_IMANUFACTURER 14 -#define HID_STRING_ID_IPRODUCT 15 -#define HID_STRING_ID_ISERIALNUMBER 16 - - - -#endif // __HIDPORT_H__ - diff --git a/qt-correction-tool/pub/ddk/hintsdeviceservice.h b/qt-correction-tool/pub/ddk/hintsdeviceservice.h deleted file mode 100644 index d988ffa..0000000 --- a/qt-correction-tool/pub/ddk/hintsdeviceservice.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * HintsDeviceService.h - * - * Contains definitions of the Hints Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _HINTSDEVICESERVICE_H_ -#define _HINTSDEVICESERVICE_H_ - -#include - -/*****************************************************************************/ -/* Hints Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Hints, - 0xc8a98b1f, 0x6b19, 0x4e79, 0xa4, 0x14, 0x67, 0xea, 0x4c, 0x39, 0xee, 0xc2); - -#define NAME_HintsSvc L"Hints" -#define TYPE_HintsSvc DEVSVCTYPE_DEFAULT - -/*****************************************************************************/ -/* WPD Content Types */ -/*****************************************************************************/ - - -/* WPDCONTENTTYPE_Folder - * - * Indicates this object is a folder. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Folder, - 0x27E2E392, 0xA111, 0x48E0, 0xAB, 0x0C, 0xE1, 0x77, 0x05, 0xA0, 0x5F, 0x85); - - -/* WPDCONTENTTYPE_Image - * - * Indicates this object represents image data (e.g. a JPEG file) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Image, - 0xef2107d5, 0xa52a, 0x4243, 0xa2, 0x6b, 0x62, 0xd4, 0x17, 0x6d, 0x76, 0x03); - - -/* WPDCONTENTTYPE_Document - * - * Indicates this object represents document data (e.g. a MS WORD file, - * TEXT file, etc.) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Document, - 0x680ADF52, 0x950A, 0x4041, 0x9B, 0x41, 0x65, 0xE3, 0x93, 0x64, 0x81, 0x55); - - -/* WPDCONTENTTYPE_Contact - * - * Indicates this object represents contact data (e.g. name/number, or a - * VCARD file) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Contact, - 0xEABA8313, 0x4525, 0x4707, 0x9F, 0x0E, 0x87, 0xC6, 0x80, 0x8E, 0x94, 0x35); - - -/* WPDCONTENTTYPE_ContactGroup - * - * Indicates this object represents a group of contacts. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_ContactGroup, - 0x346B8932, 0x4C36, 0x40D8, 0x94, 0x15, 0x18, 0x28, 0x29, 0x1F, 0x9D, 0xE9); - - -/* WPDCONTENTTYPE_Audio - * - * Indicates this object represents audio data (e.g. a WMA or MP3 file) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Audio, - 0x4AD2C85E, 0x5E2D, 0x45E5, 0x88, 0x64, 0x4F, 0x22, 0x9E, 0x3C, 0x6C, 0xF0); - - -/* WPDCONTENTTYPE_Video - * - * Indicates this object represents video data (e.g. a WMV or AVI file) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Video, - 0x9261B03C, 0x3D78, 0x4519, 0x85, 0xE3, 0x02, 0xC5, 0xE1, 0xF5, 0x0B, 0xB9); - - -/* WPDCONTENTTYPE_Television - * - * Indicates this object represents a television recording. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Television, - 0x60A169CF, 0xF2AE, 0x4E21, 0x93, 0x75, 0x96, 0x77, 0xF1, 0x1C, 0x1C, 0x6E); - - -/* WPDCONTENTTYPE_Playlist - * - * Indicates this object represents a playlist. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Playlist, - 0x1A33F7E4, 0xAF13, 0x48F5, 0x99, 0x4E, 0x77, 0x36, 0x9D, 0xFE, 0x04, 0xA3); - - -/* WPDCONTENTTYPE_MixedContentAlbum - * - * Indicates this object represents an album, which may contain objects of - * different content types (typically, MUSIC, IMAGE and VIDEO). - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_MixedContentAlbum, - 0x00F0C3AC, 0xA593, 0x49AC, 0x92, 0x19, 0x24, 0xAB, 0xCA, 0x5A, 0x25, 0x63); - - -/* WPDCONTENTTYPE_AudioAlbum - * - * Indicates this object represents an audio album. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_AudioAlbum, - 0xAA18737E, 0x5009, 0x48FA, 0xAE, 0x21, 0x85, 0xF2, 0x43, 0x83, 0xB4, 0xE6); - - -/* WPDCONTENTTYPE_ImageAlbum - * - * Indicates this object represents an image album. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_ImageAlbum, - 0x75793148, 0x15F5, 0x4A30, 0xA8, 0x13, 0x54, 0xED, 0x8A, 0x37, 0xE2, 0x26); - - -/* WPDCONTENTTYPE_VideoAlbum - * - * Indicates this object represents a video album. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_VideoAlbum, - 0x012B0DB7, 0xD4C1, 0x45D6, 0xB0, 0x81, 0x94, 0xB8, 0x77, 0x79, 0x61, 0x4F); - - -/* WPDCONTENTTYPE_Memo - * - * Indicates this object represents memo data - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Memo, - 0x9CD20ECF, 0x3B50, 0x414F, 0xA6, 0x41, 0xE4, 0x73, 0xFF, 0xE4, 0x57, 0x51); - - -/* WPDCONTENTTYPE_Email - * - * Indicates this object represents e-mail data - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Email, - 0x8038044A, 0x7E51, 0x4F8F, 0x88, 0x3D, 0x1D, 0x06, 0x23, 0xD1, 0x45, 0x33); - - -/* WPDCONTENTTYPE_Appointment - * - * Indicates this object represents an appointment in a calendar - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Appointment, - 0x0FED060E, 0x8793, 0x4B1E, 0x90, 0xC9, 0x48, 0xAC, 0x38, 0x9A, 0xC6, 0x31); - - -/* WPDCONTENTTYPE_Task - * - * Indicates this object represents a task for tracking (e.g. a TODO list) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Task, - 0x63252F2C, 0x887F, 0x4CB6, 0xB1, 0xAC, 0xD2, 0x98, 0x55, 0xDC, 0xEF, 0x6C); - - -/* WPDCONTENTTYPE_Program - * - * Indicates this object represents a file that can be run. This could be a - * script, executable and so on. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Program, - 0xD269F96A, 0x247C, 0x4BFF, 0x98, 0xFB, 0x97, 0xF3, 0xC4, 0x92, 0x20, 0xE6); - - -/* WPDCONTENTTYPE_GenericFile - * - * Indicates this object represents a file that does not fall into any of the - * other predefined WPD types for files. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_GenericFile, - 0x0085E0A6, 0x8D34, 0x45D7, 0xBC, 0x5C, 0x44, 0x7E, 0x59, 0xC7, 0x3D, 0x48); - - -/* WPDCONTENTTYPE_Calendar - * - * Indicates this object represents a calender - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Calendar, - 0xA1FD5967, 0x6023, 0x49A0, 0x9D, 0xF1, 0xF8, 0x06, 0x0B, 0xE7, 0x51, 0xB0); - - -/* WPDCONTENTTYPE_GenericMessage - * - * Indicates this object represents a message (e.g. SMS message, - * E-Mail message, etc.) - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_GenericMessage, - 0xE80EAAF8, 0xB2DB, 0x4133, 0xB6, 0x7E, 0x1B, 0xEF, 0x4B, 0x4A, 0x6E, 0x5F); - - -/* WPDCONTENTTYPE_NetworkAssociation - * - * Indicates this object represents an association between a host and a device. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_NetworkAssociation, - 0x031DA7EE, 0x18C8, 0x4205, 0x84, 0x7E, 0x89, 0xA1, 0x12, 0x61, 0xD0, 0xF3); - - -/* WPDCONTENTTYPE_Certificate - * - * Indicates this object represents certificate used for authentication. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Certificate, - 0xDC3876E8, 0xA948, 0x4060, 0x90, 0x50, 0xCB, 0xD7, 0x7E, 0x8A, 0x3D, 0x87); - - -/* WPDCONTENTTYPE_WirelessProfile - * - * Indicates this object represents wireless network access information. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_WirelessProfile, - 0x0BAC070A, 0x9F5F, 0x4DA4, 0xA8, 0xF6, 0x3D, 0xE4, 0x4D, 0x68, 0xFD, 0x6C); - - -/* WPDCONTENTTYPE_MediaCast - * - * Indicates this object represents a media cast. A media cast object can be - * thought of as a container object that groups related content, similar to - * how a playlist groups songs to play. Often, a media cast object is used - * to group media content originally published online. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_MediaCast, - 0x5E88B3CC, 0x3E65, 0x4E62, 0xBF, 0xFF, 0x22, 0x94, 0x95, 0x25, 0x3A, 0xB0); - - -/* WPDCONTENTTYPE_Section - * - * Indicates this object describes a section of data contained in another - * object. The WPD_OBJECT_REFERENCES property indicates which object contains - * the actual data. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Section, - 0x821089F5, 0x1D91, 0x4DC9, 0xBE, 0x3C, 0xBB, 0xB1, 0xB3, 0x5B, 0x18, 0xCE); - - -/* WPDCONTENTTYPE_Unspecified - * - * Indicates this object doesn't fall into the predefined WPD content types - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_Unspecified, - 0x28D8D31E, 0x249C, 0x454E, 0xAA, 0xBC, 0x34, 0x88, 0x31, 0x68, 0xE6, 0x34); - - -/* WPDCONTENTTYPE_All - * - * This content type is only valid as a parameter to API functions and driver - * commands. It should not be reported as a supported content type by the driver. - */ - -DEFINE_DEVSVCGUID(WPDCONTENTTYPE_All, - 0x80E170D2, 0x1055, 0x4A3E, 0xB9, 0x52, 0x82, 0xCC, 0x4F, 0x8A, 0x86, 0x89); - -#endif /* _HINTSDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/hubbusif.h b/qt-correction-tool/pub/ddk/hubbusif.h deleted file mode 100644 index 9a23cc7..0000000 --- a/qt-correction-tool/pub/ddk/hubbusif.h +++ /dev/null @@ -1,1232 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - hubbusif.h - -Abstract: - - Services exported by the Port driver for use by the hub driver. - -Environment: - - Kernel mode - ---*/ - -#ifndef __HUBBUSIF_H__ -#define __HUBBUSIF_H__ - -/* - Bus interfaces are supported for Windows XP and later only -*/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -typedef PVOID PUSB_DEVICE_HANDLE; - -typedef struct _ROOTHUB_PDO_EXTENSION { - - ULONG Signature; - -} ROOTHUB_PDO_EXTENSION, *PROOTHUB_PDO_EXTENSION; - -// legacy flags -#define USBD_DEVHACK_SLOW_ENUMERATION 0x00000001 -#define USBD_DEVHACK_DISABLE_SN 0x00000002 -#define USBD_DEVHACK_SET_DIAG_ID 0x00000004 - - - -#ifndef USB_BUSIFFN -#define USB_BUSIFFN __stdcall -#endif - -/**************************************************************************************************** - -Module: hubbusif.h - -name: Bus interface for USB Hub -Copyright (c) Microsoft Corporation. All rights reserved - -Revision History: - - 6-20-99 : created - 1-5-03 : revised - - -*******************************************************************************************************/ - - -__drv_functionClass(USB_BUSIFFN_CREATE_USB_DEVICE) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_CREATE_USB_DEVICE ( - __in PVOID BusContext, - __deref_out PUSB_DEVICE_HANDLE *NewDeviceHandle, - __in PUSB_DEVICE_HANDLE HubDeviceHandle, - __in USHORT PortStatus, - __in USHORT PortNumber - ); - -typedef USB_BUSIFFN_CREATE_USB_DEVICE *PUSB_BUSIFFN_CREATE_USB_DEVICE; - -#define CD_ERR_V1 0x00000001 - -typedef enum _USBPORT_CREATEDEV_ERROR { - CreateDevErrNotSet = 0, - CreateDevBadHubDevHandle, - CreateDevFailedAllocDevHandle, - CreateDevFailedOpenEndpoint, - CreateDevFailedAllocDsBuff, - CreateDevFailedGetDs, - CreateDevTtNotFound, - CreateDevBadDevHandlePtr -} USBPORT_CREATEDEV_ERROR; - -typedef struct _USB_CD_ERROR_INFORMATION { - - ULONG Version; - USBPORT_CREATEDEV_ERROR PathError; - ULONG UlongArg1; - ULONG UlongArg2; - NTSTATUS NtStatus; - UCHAR XtraInfo[64]; - -} USB_CD_ERROR_INFORMATION, *PUSB_CD_ERROR_INFORMATION; - - -__drv_functionClass(USB_BUSIFFN_CREATE_USB_DEVICE_EX) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_CREATE_USB_DEVICE_EX ( - __in PVOID BusContext, - __deref_out PUSB_DEVICE_HANDLE *NewDeviceHandle, - __in PUSB_DEVICE_HANDLE HsHubDeviceHandle, - __in USHORT PortStatus, - __in USHORT PortNumber, - __out PUSB_CD_ERROR_INFORMATION CdErrorInfo, - __in USHORT TtPortNumber - ); - -typedef USB_BUSIFFN_CREATE_USB_DEVICE_EX *PUSB_BUSIFFN_CREATE_USB_DEVICE_EX; - -/* - PortPathDepth - - Depth of hubs through which a device is attached to a host - controller. - 0: Root hub device embedded in host controller. - 1: Devices attached directly to a root hub port. - 2 - 6: Devices attached through a chain of a hubs at most 5 deep, - not including root hub. (See section 4.1.1 Bus Topology in the USB - Specification Revision 2.0) - - PortPath - - List of 1-based port numbers on the chain of hubs through which a - device is attached. PortPath list has PortPathDepth valid entries. -*/ - -typedef struct _USB_PORT_PATH { - - ULONG PortPathDepth; - ULONG PortPath[6]; - -} USB_PORT_PATH, *PUSB_PORT_PATH; - - -__drv_functionClass(USB_BUSIFFN_CREATE_USB_DEVICE_V7) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_CREATE_USB_DEVICE_V7 ( - __in PVOID BusContext, - __deref_out PUSB_DEVICE_HANDLE *NewDeviceHandle, - __in PUSB_DEVICE_HANDLE HsHubDeviceHandle, - __in USHORT PortStatus, - __in PUSB_PORT_PATH PortPath, - __out PUSB_CD_ERROR_INFORMATION CdErrorInfo, - __in USHORT TtPortNumber, - __in PDEVICE_OBJECT PdoDeviceObject, - __in PUNICODE_STRING PhysicalDeviceObjectName - ); - -typedef USB_BUSIFFN_CREATE_USB_DEVICE_V7 *PUSB_BUSIFFN_CREATE_USB_DEVICE_V7; -#define ID_ERR_V1 0x00000001 - -typedef enum _USBPORT_INITDEV_ERROR { - InitDevErrNotSet = 0, - InitDevFailedSetAddress, - InitDevFailedPokeEndpoint, - InitDevBadDeviceDescriptor, -} USBPORT_INITDEV_ERROR; - -typedef struct _USB_ID_ERROR_INFORMATION { - - ULONG Version; - USBPORT_INITDEV_ERROR PathError; - ULONG Arg1; - ULONG UsbAddress; - NTSTATUS NtStatus; - USBD_STATUS UsbdStatus; - UCHAR XtraInfo[64]; - -} USB_ID_ERROR_INFORMATION, *PUSB_ID_ERROR_INFORMATION; - - -__drv_functionClass(USB_BUSIFFN_INITIALIZE_USB_DEVICE) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_INITIALIZE_USB_DEVICE ( - __in PVOID BusContext, - __inout PUSB_DEVICE_HANDLE DeviceHandle - ); - -typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE; - -__drv_functionClass(USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX ( - __in PVOID BusContext, - __inout PUSB_DEVICE_HANDLE DeviceHandle, - __out PUSB_ID_ERROR_INFORMATION IdErrInfo - ); - -typedef USB_BUSIFFN_INITIALIZE_USB_DEVICE_EX *PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX; - -/* -flags passed to remove device -*/ - -#define USBD_KEEP_DEVICE_DATA 0x00000001 -#define USBD_MARK_DEVICE_BUSY 0x00000002 - - -__drv_functionClass(USB_BUSIFFN_REMOVE_USB_DEVICE) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_REMOVE_USB_DEVICE ( - __in PVOID BusContext, - __inout PUSB_DEVICE_HANDLE DeviceHandle, - __in ULONG Flags - ); - -typedef USB_BUSIFFN_REMOVE_USB_DEVICE *PUSB_BUSIFFN_REMOVE_USB_DEVICE; - -__drv_functionClass(USB_BUSIFFN_GET_USB_DESCRIPTORS) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_USB_DESCRIPTORS ( - __in PVOID BusContext, - __inout PUSB_DEVICE_HANDLE DeviceHandle, - __out_bcount_part(*DeviceDescriptorBufferLength,*DeviceDescriptorBufferLength) PUCHAR DeviceDescriptorBuffer, - __inout PULONG DeviceDescriptorBufferLength, - __out_bcount_part(*ConfigDescriptorBufferLength, *ConfigDescriptorBufferLength) PUCHAR ConfigDescriptorBuffer, - __inout PULONG ConfigDescriptorBufferLength - ); - -typedef USB_BUSIFFN_GET_USB_DESCRIPTORS *PUSB_BUSIFFN_GET_USB_DESCRIPTORS; - -__drv_functionClass(USB_BUSIFFN_RESTORE_DEVICE) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_RESTORE_DEVICE ( - __in PVOID BusContext, - __inout PUSB_DEVICE_HANDLE OldDeviceHandle, - __inout PUSB_DEVICE_HANDLE NewDeviceHandle - ); - -typedef USB_BUSIFFN_RESTORE_DEVICE *PUSB_BUSIFFN_RESTORE_DEVICE; - -__drv_functionClass(USB_BUSIFFN_GET_POTRTHACK_FLAGS) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_POTRTHACK_FLAGS ( - __in PVOID BusContext, - __inout PULONG Flags - ); - -typedef USB_BUSIFFN_GET_POTRTHACK_FLAGS *PUSB_BUSIFFN_GET_POTRTHACK_FLAGS; - -__drv_functionClass(USB_BUSIFFN_GET_DEVICE_INFORMATION) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_DEVICE_INFORMATION ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __out_bcount_part(DeviceInformationBufferLength,*LengthOfDataCopied) PVOID DeviceInformationBuffer, - __in ULONG DeviceInformationBufferLength, - __inout PULONG LengthOfDataCopied - ); - -typedef USB_BUSIFFN_GET_DEVICE_INFORMATION *PUSB_BUSIFFN_GET_DEVICE_INFORMATION; - -__drv_functionClass(USB_BUSIFFN_GET_CONTROLLER_INFORMATION) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_CONTROLLER_INFORMATION ( - __in PVOID BusContext, - __inout_bcount_part(ControllerInformationBufferLength, *LengthOfDataCopied) PVOID ControllerInformationBuffer, - __in ULONG ControllerInformationBufferLength, - __inout PULONG LengthOfDataCopied - ); - -typedef USB_BUSIFFN_GET_CONTROLLER_INFORMATION *PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION; - -__drv_functionClass(USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ( - __in PVOID BusContext, - __in BOOLEAN Enable - ); - -typedef USB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND *PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND; - -/* - Not supported in LH -*/ -__drv_functionClass(USB_BUSIFFN_GET_EXTENDED_HUB_INFO) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_EXTENDED_HUB_INFO ( - __in PVOID BusContext, - __in PDEVICE_OBJECT HubPhysicalDeviceObject, - __inout_bcount_part(HubInformationBufferLength, *LengthOfDataCopied) PVOID HubInformationBuffer, - __in ULONG HubInformationBufferLength, - __out PULONG LengthOfDataCopied - ); - -typedef USB_BUSIFFN_GET_EXTENDED_HUB_INFO *PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO; -/* - Not supported in LH -*/ -__drv_functionClass(USB_BUSIFFN_GET_ROOTHUB_SYM_NAME) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_ROOTHUB_SYM_NAME ( - __in PVOID BusContext, - __inout_bcount_part(HubSymNameBufferLength, *HubSymNameActualLength) PVOID HubSymNameBuffer, - __in ULONG HubSymNameBufferLength, - __out PULONG HubSymNameActualLength - ); - -typedef USB_BUSIFFN_GET_ROOTHUB_SYM_NAME *PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME; - -__drv_functionClass(USB_BUSIFFN_GET_DEVICE_BUSCONTEXT) -typedef -PVOID -USB_BUSIFFN -USB_BUSIFFN_GET_DEVICE_BUSCONTEXT ( - __in PVOID HubBusContext, - __in PVOID DeviceHandle - ); - -typedef USB_BUSIFFN_GET_DEVICE_BUSCONTEXT *PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT; - -__drv_functionClass(USB_BUSIFFN_INITIALIZE_20HUB) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_INITIALIZE_20HUB ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE HubDeviceHandle, - __in ULONG TtCount - ); - -typedef USB_BUSIFFN_INITIALIZE_20HUB *PUSB_BUSIFFN_INITIALIZE_20HUB; - -__drv_functionClass(USB_BUSIFFN_IS_ROOT) -typedef -BOOLEAN -USB_BUSIFFN -USB_BUSIFFN_IS_ROOT ( - __in PVOID BusContext, - __in PVOID DeviceObject - ); - -typedef USB_BUSIFFN_IS_ROOT *PUSB_BUSIFFN_IS_ROOT; - -__drv_functionClass(USB_BUSIFFN_ACQUIRE_SEMAPHORE) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_ACQUIRE_SEMAPHORE ( - __in PVOID BusContext - ); - -typedef USB_BUSIFFN_ACQUIRE_SEMAPHORE *PUSB_BUSIFFN_ACQUIRE_SEMAPHORE; - -__drv_functionClass(USB_BUSIFFN_RELEASE_SEMAPHORE) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_RELEASE_SEMAPHORE ( - __in PVOID BusContext - ); - -typedef USB_BUSIFFN_RELEASE_SEMAPHORE *PUSB_BUSIFFN_RELEASE_SEMAPHORE; - -__drv_functionClass(RH_INIT_CALLBACK) -typedef -VOID -__stdcall -RH_INIT_CALLBACK ( - __in PVOID CallBackContext - ); - -typedef RH_INIT_CALLBACK *PRH_INIT_CALLBACK; - -__drv_functionClass(USB_BUSIFFN_ROOTHUB_INIT_NOTIFY) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_ROOTHUB_INIT_NOTIFY ( - __in PVOID BusContext, - __in PVOID CallbackContext, - __in PRH_INIT_CALLBACK CallbackRoutine - ); - -typedef USB_BUSIFFN_ROOTHUB_INIT_NOTIFY *PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY; - -__drv_functionClass(USB_BUSIFFN_FLUSH_TRANSFERS) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_FLUSH_TRANSFERS ( - __in PVOID BusContext, - __in PVOID DeviceHandle - ); - -typedef USB_BUSIFFN_FLUSH_TRANSFERS *PUSB_BUSIFFN_FLUSH_TRANSFERS; - -__drv_functionClass(USB_BUSIFFN_CALC_PIPE_BANDWIDTH) -typedef -ULONG -USB_BUSIFFN -USB_BUSIFFN_CALC_PIPE_BANDWIDTH ( - __in PVOID BusContext, - __in PUSBD_PIPE_INFORMATION PipeInfo, - __in USB_DEVICE_SPEED DeviceSpeed - ); - -typedef USB_BUSIFFN_CALC_PIPE_BANDWIDTH *PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH; - -__drv_functionClass(USB_BUSIFFN_SET_BUS_WAKE_MODE) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_SET_BUS_WAKE_MODE ( - __in PVOID BusContext, - __in ULONG Mode - ); - -typedef USB_BUSIFFN_SET_BUS_WAKE_MODE *PUSB_BUSIFFN_SET_BUS_WAKE_MODE; - -__drv_functionClass(USB_BUSIFFN_SET_DEVICE_FLAG) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_SET_DEVICE_FLAG ( - __in PVOID BusContext, - __in GUID *DeviceFlagGuid, - __in PVOID ValueData, - __in ULONG ValueLength - ); - -typedef USB_BUSIFFN_SET_DEVICE_FLAG *PUSB_BUSIFFN_SET_DEVICE_FLAG; - -__drv_functionClass(USB_BUSIFFN_SET_DEVHANDLE_DATA) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_SET_DEVHANDLE_DATA ( - __in PVOID BusContext, - __in PVOID DeviceHandle, - __in PDEVICE_OBJECT UsbDevicePdo - ); - -typedef USB_BUSIFFN_SET_DEVHANDLE_DATA *PUSB_BUSIFFN_SET_DEVHANDLE_DATA; - -__drv_functionClass(USB_BUSIFFN_TEST_POINT) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_TEST_POINT ( - __in PVOID BusContext, - __in PVOID DeviceHandle, - __in ULONG Opcode, - __in PVOID TestData - ); - -typedef USB_BUSIFFN_TEST_POINT *PUSB_BUSIFFN_TEST_POINT; - -__drv_functionClass(USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __out_bcount_part(DeviceInformationBufferLength,*LengthOfDataCopied) PVOID DeviceInformationBuffer, - __in ULONG DeviceInformationBufferLength, - __inout PULONG LengthOfDataCopied - ); - -typedef USB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO *PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO; - -__drv_functionClass(USB_BUSIFFN_WAIT_ASYNC_POWERUP) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_WAIT_ASYNC_POWERUP ( - __in PVOID BusContext - ); - -typedef USB_BUSIFFN_WAIT_ASYNC_POWERUP *PUSB_BUSIFFN_WAIT_ASYNC_POWERUP; - -__drv_functionClass(USB_BUSIFFN_GET_DEVICE_ADDRESS) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_DEVICE_ADDRESS ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __out PUSHORT DeviceAddress - ); - -typedef USB_BUSIFFN_GET_DEVICE_ADDRESS *PUSB_BUSIFFN_GET_DEVICE_ADDRESS; - -__drv_functionClass(USB_BUSIFFN_DEREF_DEVICE_HANDLE) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_DEREF_DEVICE_HANDLE ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __in PVOID Object, - __in ULONG Tag - ); - -typedef USB_BUSIFFN_DEREF_DEVICE_HANDLE *PUSB_BUSIFFN_DEREF_DEVICE_HANDLE; - -__drv_functionClass(USB_BUSIFFN_REF_DEVICE_HANDLE) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_REF_DEVICE_HANDLE ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __in PVOID Object, - __in ULONG Tag - ); - -typedef USB_BUSIFFN_REF_DEVICE_HANDLE *PUSB_BUSIFFN_REF_DEVICE_HANDLE; - -#define USB_IDLE_NOT_READY 0 -#define USB_IDLE_READY 1 - -__drv_functionClass(USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE) -typedef -ULONG -USB_BUSIFFN -USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __in ULONG NewIdleReadyState - ); - -typedef USB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE *PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE; - -__drv_functionClass(USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT ( - __in PVOID BusContext, - __in USHORT PortNumber, - __out LPGUID ContainerId - ); - -typedef USB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT; - -__drv_functionClass(USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT ( - __in PVOID BusContext, - __in USHORT PortNumber, - __in LPGUID ContainerId - ); - -typedef USB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT *PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT; - -__drv_functionClass(USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES) -typedef -NTSTATUS -USB_BUSIFFN -USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle - ); - -typedef USB_BUSIFFN_ABORT_ALL_DEVICE_PIPES *PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES; - -#define ERRATA_FLAG_RESET_TT_ON_CANCEL 1 -#define ERRATA_FLAG_NO_CLEAR_TT_BUFFER_ON_CANCEL 2 - -__drv_functionClass(USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG) -typedef -VOID -USB_BUSIFFN -USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG ( - __in PVOID BusContext, - __in PUSB_DEVICE_HANDLE DeviceHandle, - __in ULONG DeviceErrataFlag - ); - -typedef USB_BUSIFFN_SET_DEVICE_ERRATA_FLAG *PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG; - - -#define USB_BUSIF_HUB_VERSION_0 0x0000 -#define USB_BUSIF_HUB_VERSION_1 0x0001 -#define USB_BUSIF_HUB_VERSION_2 0x0002 -#define USB_BUSIF_HUB_VERSION_3 0x0003 -#define USB_BUSIF_HUB_VERSION_4 0x0004 -#define USB_BUSIF_HUB_VERSION_5 0x0005 -#define USB_BUSIF_HUB_VERSION_6 0x0006 -#define USB_BUSIF_HUB_VERSION_7 0x0007 - -/* {B2BB8C0A-5AB4-11d3-A8CD-00C04F68747A}*/ -DEFINE_GUID(USB_BUS_INTERFACE_HUB_GUID, -0xb2bb8c0a, 0x5ab4, 0x11d3, 0xa8, 0xcd, 0x0, 0xc0, 0x4f, 0x68, 0x74, 0x7a); - -typedef struct _USB_BUS_INTERFACE_HUB_V0 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - -} USB_BUS_INTERFACE_HUB_V0, *PUSB_BUS_INTERFACE_HUB_V0; - - -typedef struct _USB_BUS_INTERFACE_HUB_V1 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - -} USB_BUS_INTERFACE_HUB_V1, *PUSB_BUS_INTERFACE_HUB_V1; - -/* -*/ - -typedef struct _USB_BUS_INTERFACE_HUB_V2 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - -} USB_BUS_INTERFACE_HUB_V2, *PUSB_BUS_INTERFACE_HUB_V2; - - -typedef struct _USB_BUS_INTERFACE_HUB_V3 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - - // - // new for version 3 - // - - PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; - -} USB_BUS_INTERFACE_HUB_V3, *PUSB_BUS_INTERFACE_HUB_V3; - - -typedef struct _USB_BUS_INTERFACE_HUB_V4 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - - // - // new for version 3 - // - - PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; - - // - // new for version 4 - // - - PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; - -} USB_BUS_INTERFACE_HUB_V4, *PUSB_BUS_INTERFACE_HUB_V4; - - -typedef struct _USB_BUS_INTERFACE_HUB_V5 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - - // - // new for version 3 - // - - PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; - - // - // new for version 4 - // - - PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; - - // new for version 5 - - PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; - -} USB_BUS_INTERFACE_HUB_V5, *PUSB_BUS_INTERFACE_HUB_V5; - - -typedef struct _USB_BUS_INTERFACE_HUB_V6 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - - // - // new for version 3 - // - - PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; - - // - // new for version 4 - // - - PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; - - // new for version 5 - - PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; - - // new for version 6 - Longhorn - - PUSB_BUSIFFN_IS_ROOT HubIsRoot; - PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore; - PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore; - PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth; - PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode; - PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag; - PUSB_BUSIFFN_TEST_POINT HubTestPoint; - PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo; - PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp; - PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress; - PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle; - PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle; - PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState; - -} USB_BUS_INTERFACE_HUB_V6, *PUSB_BUS_INTERFACE_HUB_V6; - - -typedef struct _USB_BUS_INTERFACE_HUB_V7 { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // - // functions for the hub driver - // - PUSB_BUSIFFN_CREATE_USB_DEVICE_EX CreateUsbDevice; - PUSB_BUSIFFN_INITIALIZE_USB_DEVICE_EX InitializeUsbDevice; - PUSB_BUSIFFN_GET_USB_DESCRIPTORS GetUsbDescriptors; - PUSB_BUSIFFN_REMOVE_USB_DEVICE RemoveUsbDevice; - PUSB_BUSIFFN_RESTORE_DEVICE RestoreUsbDevice; - - PUSB_BUSIFFN_GET_POTRTHACK_FLAGS GetPortHackFlags; - PUSB_BUSIFFN_GET_DEVICE_INFORMATION QueryDeviceInformation; - - // - // new functions for version 2 - // - PUSB_BUSIFFN_GET_CONTROLLER_INFORMATION GetControllerInformation; - PUSB_BUSIFFN_CONTROLLER_SELECTIVE_SUSPEND ControllerSelectiveSuspend; - PUSB_BUSIFFN_GET_EXTENDED_HUB_INFO GetExtendedHubInformation; - PUSB_BUSIFFN_GET_ROOTHUB_SYM_NAME GetRootHubSymbolicName; - PUSB_BUSIFFN_GET_DEVICE_BUSCONTEXT GetDeviceBusContext; - PUSB_BUSIFFN_INITIALIZE_20HUB Initialize20Hub; - - // - // new for version 3 - // - - PUSB_BUSIFFN_ROOTHUB_INIT_NOTIFY RootHubInitNotification; - - // - // new for version 4 - // - - PUSB_BUSIFFN_FLUSH_TRANSFERS FlushTransfers; - - // new for version 5 - - PUSB_BUSIFFN_SET_DEVHANDLE_DATA SetDeviceHandleData; - - // new for version 6 - Longhorn - - PUSB_BUSIFFN_IS_ROOT HubIsRoot; - PUSB_BUSIFFN_ACQUIRE_SEMAPHORE AcquireBusSemaphore; - PUSB_BUSIFFN_RELEASE_SEMAPHORE ReleaseBusSemaphore; - PUSB_BUSIFFN_CALC_PIPE_BANDWIDTH CaculatePipeBandwidth; - PUSB_BUSIFFN_SET_BUS_WAKE_MODE SetBusSystemWakeMode; - PUSB_BUSIFFN_SET_DEVICE_FLAG SetDeviceFlag; - PUSB_BUSIFFN_TEST_POINT HubTestPoint; - PUSB_BUSIFFN_GET_DEVICE_PERFORMANCE_INFO GetDevicePerformanceInfo; - PUSB_BUSIFFN_WAIT_ASYNC_POWERUP WaitAsyncPowerUp; - PUSB_BUSIFFN_GET_DEVICE_ADDRESS GetDeviceAddress; - PUSB_BUSIFFN_REF_DEVICE_HANDLE RefDeviceHandle; - PUSB_BUSIFFN_DEREF_DEVICE_HANDLE DerefDeviceHandle; - PUSB_BUSIFFN_SET_DEVICE_HANDLE_IDLE_READY_STATE SetDeviceHandleIdleReadyState; - - // - // new functions for version 7 - // - PUSB_BUSIFFN_CREATE_USB_DEVICE_V7 CreateUsbDeviceV7; - PUSB_BUSIFFN_GET_CONTAINER_ID_FOR_PORT GetContainerIdForPort; - PUSB_BUSIFFN_SET_CONTAINER_ID_FOR_PORT SetContainerIdForPort; - PUSB_BUSIFFN_ABORT_ALL_DEVICE_PIPES AbortAllDevicePipes; - PUSB_BUSIFFN_SET_DEVICE_ERRATA_FLAG SetDeviceErrataFlag; - -} USB_BUS_INTERFACE_HUB_V7, *PUSB_BUS_INTERFACE_HUB_V7; - - - - -#define USB_BUSIF_HUB_MIDUMP_VERSION_0 0x0000 - -/* {c5485f21-4e81-4a23-a8f9-d8518af45c3d} */ -DEFINE_GUID(USB_BUS_INTERFACE_HUB_MINIDUMP_GUID, -0xc5485f21, 0x4e81, 0x4a23, 0xa8, 0xf9, 0xd8, 0x51, 0x8a, 0xf4, 0x5c, 0x38); - - - -typedef VOID - (USB_BUSIFFN *PUSB_BUSIFFN_SET_MINIDUMP_FLAGS) ( - IN PVOID - ); - - - -/* -*/ - -typedef struct _USB_BUS_INTERFACE_HUB_MINIDUMP { - - USHORT Size; - USHORT Version; - // returns - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // functions for the hub driver - // - - PUSB_BUSIFFN_SET_MINIDUMP_FLAGS SetUsbPortMiniDumpFlags; - -} USB_BUS_INTERFACE_HUB_MINIDUMP, *PUSB_BUS_INTERFACE_HUB_MINIDUMP; - - -#define USB_BUSIF_HUB_SS_VERSION_0 0x0000 - -// {BFC3F363-8BA1-4c7b-97BA-9B12B1CA132F} -DEFINE_GUID(USB_BUS_INTERFACE_HUB_SS_GUID, -0xbfc3f363, 0x8ba1, 0x4c7b, 0x97, 0xba, 0x9b, 0x12, 0xb1, 0xca, 0x13, 0x2f); - -typedef NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_SUSPEND_HUB) ( - PDEVICE_OBJECT Pdo - ); - -typedef NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_RESUME_HUB) ( - PDEVICE_OBJECT Pdo - ); - - -typedef struct _USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND { - - USHORT Size; - USHORT Version; - - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - PUSB_BUSIFFN_SUSPEND_HUB SuspendHub; - PUSB_BUSIFFN_RESUME_HUB ResumeHub; -} USB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND, *PUSB_BUS_INTERFACE_HUB_SELECTIVE_SUSPEND; - - - - -/* - The following structures are used by the GetDeviceInformation APIs -*/ - -#include - -typedef struct _USB_PIPE_INFORMATION_0 { - - /* pad descriptors to maintain DWORD alignment */ - USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; - UCHAR ED_Pad[1]; - - ULONG ScheduleOffset; -} USB_PIPE_INFORMATION_0, *PUSB_PIPE_INFORMATION_0; - -typedef struct _USB_LEVEL_INFORMATION { - - /* inputs: information level requested */ - ULONG InformationLevel; - - /* outputs: */ - ULONG ActualLength; - -} USB_LEVEL_INFORMATION, *PUSB_LEVEL_INFORMATION; - -typedef struct _USB_DEVICE_INFORMATION_0 { - - /* inputs: information level requested */ - ULONG InformationLevel; - - /* outputs: */ - ULONG ActualLength; - - /* begin level_0 information */ - ULONG PortNumber; - - /* pad descriptors to maintain DWORD alignment */ - USB_DEVICE_DESCRIPTOR DeviceDescriptor; - UCHAR DD_pad[2]; - - UCHAR CurrentConfigurationValue; - UCHAR ReservedMBZ; - USHORT DeviceAddress; - - ULONG HubAddress; - - USB_DEVICE_SPEED DeviceSpeed; - USB_DEVICE_TYPE DeviceType; - - ULONG NumberOfOpenPipes; - - USB_PIPE_INFORMATION_0 PipeList[1]; - -} USB_DEVICE_INFORMATION_0, *PUSB_DEVICE_INFORMATION_0; - - - -typedef struct _USB_CONTROLLER_INFORMATION_0 { - - ULONG InformationLevel; - ULONG ActualLength; - BOOLEAN SelectiveSuspendEnabled; - BOOLEAN IsHighSpeedController; - -} USB_CONTROLLER_INFORMATION_0, *PUSB_CONTROLLER_INFORMATION_0; - - -typedef struct _USB_CONTROLLER_INFORMATION_1 { - - ULONG InformationLevel; - ULONG ActualLength; - BOOLEAN SelectiveSuspendEnabled; - BOOLEAN IsHighSpeedController; - ULONG HcBusNumber; - ULONG HcBusDevice; - ULONG HcBusFunction; - -} USB_CONTROLLER_INFORMATION_1, *PUSB_CONTROLLER_INFORMATION_1; - - - -/* - Structures that define extended hub port characteristics -*/ - -typedef struct _USB_EXTPORT_INFORMATION_0 { - /* - physical port ie number passed in control commands 1, 2, 3..255 - */ - ULONG PhysicalPortNumber; - /* - label on port may not natch the physical number - */ - ULONG PortLabelNumber; - - USHORT VidOverride; - USHORT PidOverride; - /* - extended port attributes as defined in usb.h - */ - ULONG PortAttributes; -} USB_EXTPORT_INFORMATION_0, *PUSB_EXTPORT_INFORMATION; - - -typedef struct _USB_EXTHUB_INFORMATION_0 { - - /* inputs: information level requested */ - ULONG InformationLevel; - - /* begin level_0 information */ - ULONG NumberOfPorts; - - /* hubs don't have > 255 ports */ - USB_EXTPORT_INFORMATION_0 Port[255]; - -} USB_EXTHUB_INFORMATION_0, *PUSB_EXTHUB_INFORMATION_0; - -/* -* Structures used by the GetPerformanceInfo APIs -*/ - -typedef struct _USB_DEVICE_PERFORMANCE_INFO_0 { - - /* inputs: information level requested */ - ULONG InformationLevel; - - /* outputs: */ - ULONG ActualLength; - - // total BulkBytes transfered for this device - ULONG BulkBytes; - ULONG BulkUrbCount; - - // total control bytes transfered for this device - ULONG ControlDataBytes; - ULONG ControlUrbCount; - - // total iso bytes transfered for this device - ULONG IsoBytes; - ULONG IsoUrbCount; - - // total interrupt bytes transfered for this device - ULONG InterruptBytes; - ULONG InterruptUrbCount; - - // BW in bytes alloced in bits/32ms - ULONG AllocedInterrupt[6]; - ULONG AllocedIso; - - // Total BW available on the bus in bits/32ms - ULONG Total32secBandwidth; - - // Total BW available on the device's TT in bits/32ms - ULONG TotalTtBandwidth; - - // Count of the total time left between scheduling iso transfers and their start frame - ULONG TotalIsoLatency; - - // ISO packet errors, etc, that are NOT late - ULONG DroppedIsoPackets; - - // Number of transfer URBs completing with errors - ULONG TransferErrors; - -} USB_DEVICE_PERFORMANCE_INFO_0, *PUSB_DEVICE_PERFORMANCE_INFO_0; - -#include - -#endif - -#endif /* __HUBBUSIF_H */ - - - diff --git a/qt-correction-tool/pub/ddk/i2cgpio.h b/qt-correction-tool/pub/ddk/i2cgpio.h deleted file mode 100644 index 6c81714..0000000 --- a/qt-correction-tool/pub/ddk/i2cgpio.h +++ /dev/null @@ -1,162 +0,0 @@ -//==========================================================================; -// -// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY -// KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR -// PURPOSE. -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//==========================================================================; - -#if 0 -To access the IO functionality in a WDM driver or the VDD, WDM driver sends -the following IRP to its parent. - -MajorFunction = IRP_MJ_PNP; -MinorFunction = IRP_MN_QUERY_INTERFACE; - -Guid = DEFINE_GUID( GUID_GPIO_INTERFACE, - 0x02295e87L, 0xbb3f, 0x11d0, 0x80, 0xce, 0x0, 0x20, 0xaf, 0xf7, 0x49, 0x1e); - -The QUERY_INTERFACE Irp will return an interface (set of function pointers) -of the type xxxxINTERFACE, defined below. This is essentially a table of -function pointers. - -#endif - -#ifndef __I2CGPIO_H__ -#define __I2CGPIO_H__ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// Guids -// -// DEFINE_GUID requires that you include wdm.h before this file. -// #define INITGUID to actually initialize the guid in memory. -// -DEFINE_GUID( GUID_I2C_INTERFACE, 0x02295e86L, 0xbb3f, 0x11d0, 0x80, 0xce, 0x0, 0x20, 0xaf, 0xf7, 0x49, 0x1e); -DEFINE_GUID( GUID_GPIO_INTERFACE,0x02295e87L, 0xbb3f, 0x11d0, 0x80, 0xce, 0x0, 0x20, 0xaf, 0xf7, 0x49, 0x1e); -DEFINE_GUID( GUID_COPYPROTECTION_INTERFACE, 0x02295e88L, 0xbb3f, 0x11d0, 0x80, 0xce, 0x0, 0x20, 0xaf, 0xf7, 0x49, 0x1e); - -//==========================================================================; -// used below if neccessary -#ifndef BYTE -#define BYTE UCHAR -#endif -#ifndef DWORD -#define DWORD ULONG -#endif -//==========================================================================; -// -// I2C section -// -// I2C Commands -#define I2C_COMMAND_NULL 0X0000 -#define I2C_COMMAND_READ 0X0001 -#define I2C_COMMAND_WRITE 0X0002 -#define I2C_COMMAND_STATUS 0X0004 -#define I2C_COMMAND_RESET 0X0008 - -// The following flags are provided on a READ or WRITE command -#define I2C_FLAGS_START 0X0001 // START + addx -#define I2C_FLAGS_STOP 0X0002 // STOP -#define I2C_FLAGS_DATACHAINING 0X0004 // STOP, START + addx -#define I2C_FLAGS_ACK 0X0010 // ACKNOWLEDGE (normally set) - -// The following status flags are returned on completion of the operation -#define I2C_STATUS_NOERROR 0X0000 -#define I2C_STATUS_BUSY 0X0001 -#define I2C_STATUS_ERROR 0X0002 - -typedef struct _I2CControl { - ULONG Command; // I2C_COMMAND_* - DWORD dwCookie; // Context identifier returned on Open - BYTE Data; // Data to write, or returned byte - BYTE Reserved[3]; // Filler - ULONG Flags; // I2C_FLAGS_* - ULONG Status; // I2C_STATUS_* - ULONG ClockRate; // Bus clockrate in Hz. -} I2CControl, *PI2CControl; - -// this is the Interface definition for I2C -// -typedef NTSTATUS (STDMETHODCALLTYPE *I2COPEN)(PDEVICE_OBJECT, ULONG, PI2CControl); -typedef NTSTATUS (STDMETHODCALLTYPE *I2CACCESS)(PDEVICE_OBJECT, PI2CControl); - -typedef struct { - INTERFACE _vddInterface; - I2COPEN i2cOpen; - I2CACCESS i2cAccess; -} I2CINTERFACE; - -//==========================================================================; -// -// GPIO section -// -// GPIO Commands - -#define GPIO_COMMAND_QUERY 0X0001 // get #pins and nBufferSize -#define GPIO_COMMAND_OPEN 0X0001 // old open -#define GPIO_COMMAND_OPEN_PINS 0X0002 // get dwCookie -#define GPIO_COMMAND_CLOSE_PINS 0X0004 // invalidate cookie -#define GPIO_COMMAND_READ_BUFFER 0X0008 -#define GPIO_COMMAND_WRITE_BUFFER 0X0010 - -// The following flags are provided on a READ_BUFFER or WRITE_BUFFER command -// lpPins bits set MUST have contiguous bits set for a read/write command. -// -// On a READ, if the number of pins set in the bitmask does not fill a -// byte/word/dword, then zeros are returned for those positions. -// on a WRITE, if the number of pins set in the bitmask does not fill a -// byte/word/dword, a read/modify/write is done on the port/mmio position -// that represents those bits. - -#define GPIO_FLAGS_BYTE 0x0001 // do byte read/write -#define GPIO_FLAGS_WORD 0x0002 // do word read/write -#define GPIO_FLAGS_DWORD 0x0004 // do dword read/write - -// The following status flags are returned on completion of the operation -#define GPIO_STATUS_NOERROR 0X0000 -#define GPIO_STATUS_BUSY 0X0001 -#define GPIO_STATUS_ERROR 0X0002 -#define GPIO_STATUS_NO_ASYNCH 0X0004 // gpio provider does not do asynch xfer - -typedef struct _GPIOControl { - ULONG Command; // GPIO_COMMAND_* - ULONG Flags; // GPIO_FLAGS_* - DWORD dwCookie; // Context identifier returned on Open - ULONG Status; // GPIO_STATUS_* - ULONG nBytes; // # of bytes to send or recieved - ULONG nBufferSize; // max size of buffer - ULONG nPins; // number of GPIO pins returned by Open - UCHAR *Pins; // pointer to bitmask of pins to read/write - UCHAR *Buffer; // pointer to GPIO data to send/recieve - void (*AsynchCompleteCallback)(UCHAR *Buffer); - // NULL if synchronous xfer, valid ptr if asynch. - GUID PrivateInterfaceType; - void (*PrivateInterface)(); - -} GPIOControl, *PGPIOControl; - -// This is the GPIO interface -// -typedef NTSTATUS (STDMETHODCALLTYPE *GPIOOPEN)(PDEVICE_OBJECT, ULONG, PGPIOControl); -typedef NTSTATUS (STDMETHODCALLTYPE *GPIOACCESS)(PDEVICE_OBJECT, PGPIOControl); - -typedef struct { - INTERFACE _vddInterface; - GPIOOPEN gpioOpen; - GPIOACCESS gpioAccess; -} GPIOINTERFACE; - -//==========================================================================; -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif //__I2CGPIO_H__ - - diff --git a/qt-correction-tool/pub/ddk/imgerror.h b/qt-correction-tool/pub/ddk/imgerror.h deleted file mode 100644 index 1172b38..0000000 --- a/qt-correction-tool/pub/ddk/imgerror.h +++ /dev/null @@ -1,423 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for imgerror.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __imgerror_h__ -#define __imgerror_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IImgErrorInfo_FWD_DEFINED__ -#define __IImgErrorInfo_FWD_DEFINED__ -typedef interface IImgErrorInfo IImgErrorInfo; -#endif /* __IImgErrorInfo_FWD_DEFINED__ */ - - -#ifndef __IImgCreateErrorInfo_FWD_DEFINED__ -#define __IImgCreateErrorInfo_FWD_DEFINED__ -typedef interface IImgCreateErrorInfo IImgCreateErrorInfo; -#endif /* __IImgCreateErrorInfo_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_imgerror_0000_0000 */ -/* [local] */ - -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//-------------------------------------------------------------------------- - - -typedef /* [public][public][public] */ struct __MIDL___MIDL_itf_imgerror_0000_0000_0001 - { - BSTR description; - GUID guid; - DWORD helpContext; - BSTR helpFile; - BSTR source; - BSTR devDescription; - GUID errorID; - ULONG cUserParameters; - BSTR *aUserParameters; - BSTR userFallback; - DWORD exceptionID; - } ImgErrorInfo; - - - -extern RPC_IF_HANDLE __MIDL_itf_imgerror_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_imgerror_0000_0000_v0_0_s_ifspec; - -#ifndef __IImgErrorInfo_INTERFACE_DEFINED__ -#define __IImgErrorInfo_INTERFACE_DEFINED__ - -/* interface IImgErrorInfo */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IImgErrorInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2bce4ece-d30e-445a-9423-6829be945ad8") - IImgErrorInfo : public IErrorInfo - { - public: - virtual HRESULT STDMETHODCALLTYPE GetDeveloperDescription( - /* [annotation][out] */ - __out BSTR *pbstrDevDescription) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUserErrorId( - /* [annotation][out] */ - __out GUID *pErrorId) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUserParameterCount( - /* [annotation][out] */ - __out ULONG *pcUserParams) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUserParameter( - /* [annotation][in] */ - __in ULONG cParam, - /* [annotation][out] */ - __out BSTR *pbstrParam) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUserFallback( - /* [annotation][out] */ - __out BSTR *pbstrFallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetExceptionId( - /* [annotation][out] */ - __out DWORD *pExceptionId) = 0; - - virtual HRESULT STDMETHODCALLTYPE DetachErrorInfo( - /* [annotation][out] */ - __out ImgErrorInfo *pErrorInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IImgErrorInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IImgErrorInfo * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IImgErrorInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IImgErrorInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetGUID )( - IImgErrorInfo * This, - /* [out] */ GUID *pGUID); - - HRESULT ( STDMETHODCALLTYPE *GetSource )( - IImgErrorInfo * This, - /* [out] */ BSTR *pBstrSource); - - HRESULT ( STDMETHODCALLTYPE *GetDescription )( - IImgErrorInfo * This, - /* [out] */ BSTR *pBstrDescription); - - HRESULT ( STDMETHODCALLTYPE *GetHelpFile )( - IImgErrorInfo * This, - /* [out] */ BSTR *pBstrHelpFile); - - HRESULT ( STDMETHODCALLTYPE *GetHelpContext )( - IImgErrorInfo * This, - /* [out] */ DWORD *pdwHelpContext); - - HRESULT ( STDMETHODCALLTYPE *GetDeveloperDescription )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out BSTR *pbstrDevDescription); - - HRESULT ( STDMETHODCALLTYPE *GetUserErrorId )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out GUID *pErrorId); - - HRESULT ( STDMETHODCALLTYPE *GetUserParameterCount )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out ULONG *pcUserParams); - - HRESULT ( STDMETHODCALLTYPE *GetUserParameter )( - IImgErrorInfo * This, - /* [annotation][in] */ - __in ULONG cParam, - /* [annotation][out] */ - __out BSTR *pbstrParam); - - HRESULT ( STDMETHODCALLTYPE *GetUserFallback )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out BSTR *pbstrFallback); - - HRESULT ( STDMETHODCALLTYPE *GetExceptionId )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out DWORD *pExceptionId); - - HRESULT ( STDMETHODCALLTYPE *DetachErrorInfo )( - IImgErrorInfo * This, - /* [annotation][out] */ - __out ImgErrorInfo *pErrorInfo); - - END_INTERFACE - } IImgErrorInfoVtbl; - - interface IImgErrorInfo - { - CONST_VTBL struct IImgErrorInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IImgErrorInfo_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IImgErrorInfo_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IImgErrorInfo_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IImgErrorInfo_GetGUID(This,pGUID) \ - ( (This)->lpVtbl -> GetGUID(This,pGUID) ) - -#define IImgErrorInfo_GetSource(This,pBstrSource) \ - ( (This)->lpVtbl -> GetSource(This,pBstrSource) ) - -#define IImgErrorInfo_GetDescription(This,pBstrDescription) \ - ( (This)->lpVtbl -> GetDescription(This,pBstrDescription) ) - -#define IImgErrorInfo_GetHelpFile(This,pBstrHelpFile) \ - ( (This)->lpVtbl -> GetHelpFile(This,pBstrHelpFile) ) - -#define IImgErrorInfo_GetHelpContext(This,pdwHelpContext) \ - ( (This)->lpVtbl -> GetHelpContext(This,pdwHelpContext) ) - - -#define IImgErrorInfo_GetDeveloperDescription(This,pbstrDevDescription) \ - ( (This)->lpVtbl -> GetDeveloperDescription(This,pbstrDevDescription) ) - -#define IImgErrorInfo_GetUserErrorId(This,pErrorId) \ - ( (This)->lpVtbl -> GetUserErrorId(This,pErrorId) ) - -#define IImgErrorInfo_GetUserParameterCount(This,pcUserParams) \ - ( (This)->lpVtbl -> GetUserParameterCount(This,pcUserParams) ) - -#define IImgErrorInfo_GetUserParameter(This,cParam,pbstrParam) \ - ( (This)->lpVtbl -> GetUserParameter(This,cParam,pbstrParam) ) - -#define IImgErrorInfo_GetUserFallback(This,pbstrFallback) \ - ( (This)->lpVtbl -> GetUserFallback(This,pbstrFallback) ) - -#define IImgErrorInfo_GetExceptionId(This,pExceptionId) \ - ( (This)->lpVtbl -> GetExceptionId(This,pExceptionId) ) - -#define IImgErrorInfo_DetachErrorInfo(This,pErrorInfo) \ - ( (This)->lpVtbl -> DetachErrorInfo(This,pErrorInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IImgErrorInfo_INTERFACE_DEFINED__ */ - - -#ifndef __IImgCreateErrorInfo_INTERFACE_DEFINED__ -#define __IImgCreateErrorInfo_INTERFACE_DEFINED__ - -/* interface IImgCreateErrorInfo */ -/* [ref][helpstring][local][uuid][object] */ - - -EXTERN_C const IID IID_IImgCreateErrorInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1c55a64c-07cd-4fb5-90f7-b753d91f0c9e") - IImgCreateErrorInfo : public ICreateErrorInfo - { - public: - virtual HRESULT STDMETHODCALLTYPE AttachToErrorInfo( - /* [annotation][out][in] */ - __inout ImgErrorInfo *pErrorInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IImgCreateErrorInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IImgCreateErrorInfo * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IImgCreateErrorInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IImgCreateErrorInfo * This); - - HRESULT ( STDMETHODCALLTYPE *SetGUID )( - IImgCreateErrorInfo * This, - /* [in] */ REFGUID rguid); - - HRESULT ( STDMETHODCALLTYPE *SetSource )( - IImgCreateErrorInfo * This, - /* [in] */ LPOLESTR szSource); - - HRESULT ( STDMETHODCALLTYPE *SetDescription )( - IImgCreateErrorInfo * This, - /* [in] */ LPOLESTR szDescription); - - HRESULT ( STDMETHODCALLTYPE *SetHelpFile )( - IImgCreateErrorInfo * This, - /* [in] */ LPOLESTR szHelpFile); - - HRESULT ( STDMETHODCALLTYPE *SetHelpContext )( - IImgCreateErrorInfo * This, - /* [in] */ DWORD dwHelpContext); - - HRESULT ( STDMETHODCALLTYPE *AttachToErrorInfo )( - IImgCreateErrorInfo * This, - /* [annotation][out][in] */ - __inout ImgErrorInfo *pErrorInfo); - - END_INTERFACE - } IImgCreateErrorInfoVtbl; - - interface IImgCreateErrorInfo - { - CONST_VTBL struct IImgCreateErrorInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IImgCreateErrorInfo_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IImgCreateErrorInfo_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IImgCreateErrorInfo_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IImgCreateErrorInfo_SetGUID(This,rguid) \ - ( (This)->lpVtbl -> SetGUID(This,rguid) ) - -#define IImgCreateErrorInfo_SetSource(This,szSource) \ - ( (This)->lpVtbl -> SetSource(This,szSource) ) - -#define IImgCreateErrorInfo_SetDescription(This,szDescription) \ - ( (This)->lpVtbl -> SetDescription(This,szDescription) ) - -#define IImgCreateErrorInfo_SetHelpFile(This,szHelpFile) \ - ( (This)->lpVtbl -> SetHelpFile(This,szHelpFile) ) - -#define IImgCreateErrorInfo_SetHelpContext(This,dwHelpContext) \ - ( (This)->lpVtbl -> SetHelpContext(This,dwHelpContext) ) - - -#define IImgCreateErrorInfo_AttachToErrorInfo(This,pErrorInfo) \ - ( (This)->lpVtbl -> AttachToErrorInfo(This,pErrorInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IImgCreateErrorInfo_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/imgerror.idl b/qt-correction-tool/pub/ddk/imgerror.idl deleted file mode 100644 index 270d1f5..0000000 --- a/qt-correction-tool/pub/ddk/imgerror.idl +++ /dev/null @@ -1,124 +0,0 @@ -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -// Abstract: -// Contains the definition of the IImgErrorInfo interface used to describe -// extra error state. This inherits from the COM IErrorInfo interface. -// -// Notes: -// IImgErrorInfo stores its state in an ImgErrorInfo structure that can -// be detached from the class implementation. IImgErrorInfo is NOT thread -// safe. -// -// History: -// 2003/10/20-mlawrenc -// Created - removed from imgdata.idl to provide better sanitization -// from the rest of the imgdata interface, also in prepartaion -// of moving to Musl. -// -//---------------------------------------------------------------------------- -cpp_quote("//+-------------------------------------------------------------------------") -cpp_quote("//") -cpp_quote("// Microsoft Windows") -cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.") -cpp_quote("//") -cpp_quote("//--------------------------------------------------------------------------") - -import "oaidl.idl"; - -// -// Interfaces used for extended error information. -// -interface IImgErrorInfo; -interface IImgCreateErrorInfo; - -typedef struct -{ - // - // IErrorInfo fields - // - BSTR description; - GUID guid; - DWORD helpContext; - BSTR helpFile; - BSTR source; - - // - // IImgErrorInfo fields - // - BSTR devDescription; - GUID errorID; - ULONG cUserParameters; - [size_is(cUserParameters)] BSTR *aUserParameters; - BSTR userFallback; - DWORD exceptionID; - -} ImgErrorInfo; - -[ - object, - uuid(2bce4ece-d30e-445a-9423-6829be945ad8), - local, - helpstring("Extended error information class, this is used to allow our exceptions to chain correctly across DLL/Machine boundaries."), - pointer_default(ref) -] -interface IImgErrorInfo : IErrorInfo -{ - HRESULT - GetDeveloperDescription( - [out, annotation("__out")] BSTR *pbstrDevDescription - ); - - HRESULT - GetUserErrorId( - [out, annotation("__out")] GUID *pErrorId - ); - - HRESULT - GetUserParameterCount( - [out, annotation("__out")] ULONG *pcUserParams - ); - - HRESULT - GetUserParameter( - [in, annotation("__in")] ULONG cParam, - [out, annotation("__out")] BSTR *pbstrParam - ); - - HRESULT - GetUserFallback( - [out, annotation("__out")] BSTR *pbstrFallback - ); - - HRESULT - GetExceptionId( - [out, annotation("__out")] DWORD *pExceptionId - ); - - HRESULT - DetachErrorInfo( - [out, annotation("__out")] ImgErrorInfo *pErrorInfo - ); -} - -[ - object, - uuid(1c55a64c-07cd-4fb5-90f7-b753d91f0c9e), - local, - helpstring("Class that can be used to create extended error information."), - pointer_default(ref) -] -interface IImgCreateErrorInfo : ICreateErrorInfo -{ - HRESULT - AttachToErrorInfo( - [in, out, annotation("__inout")] ImgErrorInfo *pErrorInfo - ); -} - - - - - - diff --git a/qt-correction-tool/pub/ddk/ioaccess.h b/qt-correction-tool/pub/ddk/ioaccess.h deleted file mode 100644 index 6204130..0000000 --- a/qt-correction-tool/pub/ddk/ioaccess.h +++ /dev/null @@ -1,468 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ioaccess.h - -Abstract: - - Definitions of function prototypes for accessing I/O ports and - memory on I/O adapters from display drivers. - - Cloned from parts of nti386.h. - -Author: - - ---*/ - -// -// Note: IA64 is for 64 bits Merced. Under Merced compiler option, we don't have -// _X86_, instead, we use _IA64_. Same thing, _AXP64_ is for 64 bits compiler -// option for ALPHA -// -#if defined(_MIPS_) || defined(_X86_) || defined(_AMD64_) - -// -// Memory barriers on X86 and MIPS are not required since the Io -// Operations are always garanteed to be executed in order -// - -#define MEMORY_BARRIER() 0 - - -#elif defined(_IA64_) - -// -// Itanium requires memory barriers -// - -void __mf(); - -#define MEMORY_BARRIER() __mf() - -#elif defined(_PPC_) - -// -// A memory barrier function is provided by the PowerPC Enforce -// In-order Execution of I/O instruction (eieio). -// - -#if defined(_M_PPC) && defined(_MSC_VER) && (_MSC_VER>=1000) -void __emit( unsigned const __int32 ); -#define __builtin_eieio() __emit( 0x7C0006AC ) -#else -void __builtin_eieio(void); -#endif - -#define MEMORY_BARRIER() __builtin_eieio() - - -#elif defined(_ALPHA_) || (_AXP64_) - -// -// ALPHA requires memory barriers -// - -#define MEMORY_BARRIER() __MB() - - - -#endif - -#ifndef NO_PORT_MACROS - - - -// -// I/O space read and write macros. -// -// The READ/WRITE_REGISTER_* calls manipulate MEMORY registers. -// (Use x86 move instructions, with LOCK prefix to force correct behavior -// w.r.t. caches and write buffers.) -// -// The READ/WRITE_PORT_* calls manipulate I/O ports. -// (Use x86 in/out instructions.) -// - - -// -// inp(),inpw(), inpd(), outp(), outpw(), outpd() are X86 specific intrinsic -// inline functions. So for IA64, we have to put READ_PORT_USHORT() etc. back -// to it's supposed to be, defined in sdk\inc\wdm.h -// -#if defined(_IA64_) -#define READ_REGISTER_UCHAR(Register) (*(volatile UCHAR *)(Register)) -#define READ_REGISTER_USHORT(Register) (*(volatile USHORT *)(Register)) -#define READ_REGISTER_ULONG(Register) (*(volatile ULONG *)(Register)) -#define WRITE_REGISTER_UCHAR(Register, Value) (*(volatile UCHAR *)(Register) = (Value)) -#define WRITE_REGISTER_USHORT(Register, Value) (*(volatile USHORT *)(Register) = (Value)) -#define WRITE_REGISTER_ULONG(Register, Value) (*(volatile ULONG *)(Register) = (Value)) - -__declspec(dllimport) -UCHAR -READ_PORT_UCHAR( - __in PVOID Port - ); - -__declspec(dllimport) -USHORT -READ_PORT_USHORT( - __in PVOID Port - ); - -__declspec(dllimport) -ULONG -READ_PORT_ULONG( - __in PVOID Port - ); - -// -// All these function prototypes take a ULONG as a parameter so that -// we don't force an extra typecast in the code (which will cause -// the X86 to generate bad code). -// - -__declspec(dllimport) -VOID -WRITE_PORT_UCHAR( - __in PVOID Port, - __in ULONG Value - ); - -__declspec(dllimport) -VOID -WRITE_PORT_USHORT( - __in PVOID Port, - __in ULONG Value - ); - -__declspec(dllimport) -VOID -WRITE_PORT_ULONG( - __in PVOID Port, - __in ULONG Value - ); - -#elif defined(_X86_) -#define READ_REGISTER_UCHAR(Register) (*(volatile UCHAR *)(Register)) -#define READ_REGISTER_USHORT(Register) (*(volatile USHORT *)(Register)) -#define READ_REGISTER_ULONG(Register) (*(volatile ULONG *)(Register)) -#define WRITE_REGISTER_UCHAR(Register, Value) (*(volatile UCHAR *)(Register) = (Value)) -#define WRITE_REGISTER_USHORT(Register, Value) (*(volatile USHORT *)(Register) = (Value)) -#define WRITE_REGISTER_ULONG(Register, Value) (*(volatile ULONG *)(Register) = (Value)) -#define READ_PORT_UCHAR(Port) (UCHAR)(inp (Port)) -#define READ_PORT_USHORT(Port) (USHORT)(inpw (Port)) -#define READ_PORT_ULONG(Port) (ULONG)(inpd (Port)) -#define WRITE_PORT_UCHAR(Port, Value) outp ((Port), (Value)) -#define WRITE_PORT_USHORT(Port, Value) outpw ((Port), (Value)) -#define WRITE_PORT_ULONG(Port, Value) outpd ((Port), (Value)) - -#elif defined(_PPC_) || defined(_MIPS_) - -#define READ_REGISTER_UCHAR(x) (*(volatile UCHAR * const)(x)) -#define READ_REGISTER_USHORT(x) (*(volatile USHORT * const)(x)) -#define READ_REGISTER_ULONG(x) (*(volatile ULONG * const)(x)) -#define WRITE_REGISTER_UCHAR(x, y) (*(volatile UCHAR * const)(x) = (y)) -#define WRITE_REGISTER_USHORT(x, y) (*(volatile USHORT * const)(x) = (y)) -#define WRITE_REGISTER_ULONG(x, y) (*(volatile ULONG * const)(x) = (y)) -#define READ_PORT_UCHAR(x) READ_REGISTER_UCHAR(x) -#define READ_PORT_USHORT(x) READ_REGISTER_USHORT(x) -#define READ_PORT_ULONG(x) READ_REGISTER_ULONG(x) - -// -// All these macros take a ULONG as a parameter so that we don't -// force an extra typecast in the code (which will cause the X86 to -// generate bad code). -// - -#define WRITE_PORT_UCHAR(x, y) WRITE_REGISTER_UCHAR(x, (UCHAR) (y)) -#define WRITE_PORT_USHORT(x, y) WRITE_REGISTER_USHORT(x, (USHORT) (y)) -#define WRITE_PORT_ULONG(x, y) WRITE_REGISTER_ULONG(x, (ULONG) (y)) - - -#elif defined(_ALPHA_) || (_AXP64_) - -// -// READ/WRITE_PORT/REGISTER_UCHAR_USHORT_ULONG are all functions that -// go to the HAL on ALPHA -// -// So we only put the prototypes here -// - -__declspec(dllimport) -UCHAR -READ_REGISTER_UCHAR( - __in PVOID Register - ); - -__declspec(dllimport) -USHORT -READ_REGISTER_USHORT( - __in PVOID Register - ); - -__declspec(dllimport) -ULONG -READ_REGISTER_ULONG( - __in PVOID Register - ); - -__declspec(dllimport) -VOID -WRITE_REGISTER_UCHAR( - __in PVOID Register, - UCHAR Value - ); - -__declspec(dllimport) -VOID -WRITE_REGISTER_USHORT( - __in PVOID Register, - __in USHORT Value - ); - -__declspec(dllimport) -VOID -WRITE_REGISTER_ULONG( - __in PVOID Register, - __in ULONG Value - ); - -__declspec(dllimport) -UCHAR -READ_PORT_UCHAR( - __in PVOID Port - ); - -__declspec(dllimport) -USHORT -READ_PORT_USHORT( - __in PVOID Port - ); - -__declspec(dllimport) -ULONG -READ_PORT_ULONG( - __in PVOID Port - ); - -// -// All these function prototypes take a ULONG as a parameter so that -// we don't force an extra typecast in the code (which will cause -// the X86 to generate bad code). -// - -__declspec(dllimport) -VOID -WRITE_PORT_UCHAR( - __in PVOID Port, - __in ULONG Value - ); - -__declspec(dllimport) -VOID -WRITE_PORT_USHORT( - __in PVOID Port, - __in ULONG Value - ); - -__declspec(dllimport) -VOID -WRITE_PORT_ULONG( - __in PVOID Port, - __in ULONG Value - ); - -#elif defined(_AMD64_) - -UCHAR -__inbyte ( - __in USHORT Port - ); - -USHORT -__inword ( - __in USHORT Port - ); - -ULONG -__indword ( - __in USHORT Port - ); - -VOID -__outbyte ( - __in USHORT Port, - __in UCHAR Data - ); - -VOID -__outword ( - __in USHORT Port, - __in USHORT Data - ); - -VOID -__outdword ( - __in USHORT Port, - __in ULONG Data - ); - -#pragma intrinsic(__inbyte) -#pragma intrinsic(__inword) -#pragma intrinsic(__indword) -#pragma intrinsic(__outbyte) -#pragma intrinsic(__outword) -#pragma intrinsic(__outdword) - -LONG -_InterlockedOr ( - __inout LONG volatile *Target, - __in LONG Set - ); - -#pragma intrinsic(_InterlockedOr) - - -__inline -UCHAR -READ_REGISTER_UCHAR ( - __in PVOID Register - ) -{ - return *(UCHAR volatile *)Register; -} - -__inline -USHORT -READ_REGISTER_USHORT ( - __in PVOID Register - ) -{ - return *(USHORT volatile *)Register; -} - -__inline -ULONG -READ_REGISTER_ULONG ( - __in PVOID Register - ) -{ - return *(ULONG volatile *)Register; -} - -__inline -VOID -WRITE_REGISTER_UCHAR ( - __in PVOID Register, - __in UCHAR Value - ) -{ - LONG Synch; - - *(UCHAR volatile *)Register = Value; - _InterlockedOr(&Synch, 1); - return; -} - -__inline -VOID -WRITE_REGISTER_USHORT ( - __in PVOID Register, - __in USHORT Value - ) -{ - LONG Synch; - - *(USHORT volatile *)Register = Value; - _InterlockedOr(&Synch, 1); - return; -} - -__inline -VOID -WRITE_REGISTER_ULONG ( - __in PVOID Register, - __in ULONG Value - ) -{ - LONG Synch; - - *(ULONG volatile *)Register = Value; - _InterlockedOr(&Synch, 1); - return; -} - -__inline -UCHAR -READ_PORT_UCHAR ( - __in PVOID Port - ) - -{ - return __inbyte((USHORT)((ULONG64)Port)); -} - -__inline -USHORT -READ_PORT_USHORT ( - __in PVOID Port - ) - -{ - return __inword((USHORT)((ULONG64)Port)); -} - -__inline -ULONG -READ_PORT_ULONG ( - __in PVOID Port - ) - -{ - return __indword((USHORT)((ULONG64)Port)); -} - -__inline -VOID -WRITE_PORT_UCHAR ( - __in PVOID Port, - __in UCHAR Value - ) - -{ - __outbyte((USHORT)((ULONG64)Port), Value); - return; -} - -__inline -VOID -WRITE_PORT_USHORT ( - __in PVOID Port, - __in USHORT Value - ) - -{ - __outword((USHORT)((ULONG64)Port), Value); - return; -} - -__inline -VOID -WRITE_PORT_ULONG ( - __in PVOID Port, - __in ULONG Value - ) - -{ - __outdword((USHORT)((ULONG64)Port), Value); - return; -} - -#endif // NO_PORT_MACROS - -#endif - diff --git a/qt-correction-tool/pub/ddk/iointex.h b/qt-correction-tool/pub/ddk/iointex.h deleted file mode 100644 index d594a0e..0000000 --- a/qt-correction-tool/pub/ddk/iointex.h +++ /dev/null @@ -1,73 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - iointex.h - -Abstract: - - This header exposes the new kernel APIs to connect and disconnect - interrupts in a manner that makes it possible for drivers referencing - these new APIs to run on downlevel systems. - ---*/ - -#ifndef _IOINTEX_IOINTEX_H_ -#define _IOINTEX_IOINTEX_H_ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Supply an overrideable library implementation of IoConnectInterruptEx. -// See DDK documentation for more details on this API. -// - -#undef IoConnectInterruptEx -#define IoConnectInterruptEx WdmlibIoConnectInterruptEx - -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -WdmlibIoConnectInterruptEx ( - __inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters - ); - -// -// Supply an overrideable library implementation of IoDisconnectInterruptEx. -// See DDK documentation for more details on this API. -// - -#undef IoDisconnectInterruptEx -#define IoDisconnectInterruptEx WdmlibIoDisconnectInterruptEx - -__drv_requiresIRQL(PASSIVE_LEVEL) -NTSTATUS -WdmlibIoDisconnectInterruptEx ( - __inout PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters - ); - -// -// Supply an overrideable library implementation of IoGetAffinityInterrupt. -// See DDK documentation for more details on this API. -// - -#undef IoGetAffinityInterrupt -#define IoGetAffinityInterrupt WdmlibIoGetAffinityInterrupt - -NTSTATUS -WdmlibIoGetAffinityInterrupt ( - __in PKINTERRUPT InterruptObject, - __out PGROUP_AFFINITY GroupAffinity - ); - - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // !defined(_IOINTEX_IOINTEX_H_) - diff --git a/qt-correction-tool/pub/ddk/ip6firewall.h b/qt-correction-tool/pub/ddk/ip6firewall.h deleted file mode 100644 index b55877b..0000000 --- a/qt-correction-tool/pub/ddk/ip6firewall.h +++ /dev/null @@ -1,112 +0,0 @@ -/*++ - -Copyright (c) 2004-2005 Microsoft Corporation - -Module Name: - - ip6firewall.h - -Abstract: - - This module contains definitions for the IPv6 firewall hook. - -Environment: - - Kernel mode only. - ---*/ - -#if (NTDDI_VERSION < NTDDI_LONGHORN) - -#ifndef _IP6FIREWALL_ -#define _IP6FIREWALL_ - -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Types used by the firewall hook. -// - -typedef enum { - DirectionTransmit, - DirectionReceive, - DirectionMax -} IPv6Direction; - -typedef enum { - ActionAccept, - ActionDrop, - ActionMax -} IPv6Action; - -__drv_functionClass(IPv6FirewallHookProcType) -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -IPv6Action -IPv6FirewallHookProcType ( - __in const IPv6Addr *SourceAddress, - __in const IPv6Addr *DestinationAddress, - __in uint PayloadLength, - __in uchar HeaderType, - __in const uchar *HeaderData, - __in const void *PacketContext, - __in uint DataLength, - __in uint InterfaceIndex, - __in IPv6Direction Direction, - __in BOOLEAN IsLoopBack - ); - -typedef IPv6FirewallHookProcType *IPv6FirewallHookProc; - -typedef void -(*IPv6FirewallDeregistrationCompleteProc)( - ); - -// -// Exported function declarations. -// - -extern NTSTATUS -__drv_maxIRQL(DISPATCH_LEVEL) -__success(return==STATUS_SUCCESS) -IPv6EnableFirewallHook( - __in IPv6FirewallHookProc FirewallHookFunction - ); - -extern void -__drv_maxIRQL(DISPATCH_LEVEL) -IPv6DisableFirewallHook( - __in IPv6FirewallDeregistrationCompleteProc CompletionRoutine - ); - -extern const uchar * -__drv_maxIRQL(DISPATCH_LEVEL) -IPv6ObtainPacketData( - __in const void *PacketContext, - __in uint DataLength, - __in uint Alignment - ); - -extern IP_STATUS -__drv_maxIRQL(DISPATCH_LEVEL) -IPv6GetBestRouteInfo( - __in const IPv6Addr *Addr, - __in ulong ScopeId, - __in ulong Index, - __out IP6RouteEntry *Ire - ); - -#ifdef __cplusplus -} -#endif - -#endif // _IP6FIREWALL_ - -#endif //(NTDDI_VERSION < NTDDI_LONGHORN) - diff --git a/qt-correction-tool/pub/ddk/ipfirewall.h b/qt-correction-tool/pub/ddk/ipfirewall.h deleted file mode 100644 index 500ab80..0000000 --- a/qt-correction-tool/pub/ddk/ipfirewall.h +++ /dev/null @@ -1,165 +0,0 @@ -/*++ - -Copyright (c) 1999-2001 Microsoft Corporation - -Module Name: - - ipfirewall.h - -Abstract: - - Header file for IP firewall hook clients. - ---*/ - -#if (NTDDI_VERSION < NTDDI_LONGHORN) - -#pragma once - -#define INVALID_IF_INDEX 0xffffffff -#define LOCAL_IF_INDEX 0 - -// -// Indicates whether it is a transmitted or received packet. -// - -typedef enum _IP_DIRECTION_E { - IP_TRANSMIT, - IP_RECEIVE -} DIRECTION_E, *PDIRECTION_E; - -typedef struct _FIREWALL_CONTEXT_T { - DIRECTION_E Direction; - void *NTE; - void *LinkCtxt; - NDIS_HANDLE LContext1; - UINT LContext2; -} FIREWALL_CONTEXT_T, *PFIREWALL_CONTEXT_T; - -// Definition of an IP receive buffer chain. -typedef struct IPRcvBuf { - struct IPRcvBuf *ipr_next; // Next buffer descriptor in chain. - UINT ipr_owner; // Owner of buffer. - __field_ecount(ipr_size) UCHAR *ipr_buffer; // Pointer to buffer. - UINT ipr_size; // Buffer size. - PMDL ipr_pMdl; - UINT *ipr_pClientCnt; - UCHAR *ipr_RcvContext; - UINT ipr_RcvOffset; -#if (NTDDI_VERSION >= NTDDI_WINXP) - ULONG ipr_flags; -#elif (NTDDI_VERSION >= NTDDI_WIN2K) - ULONG ipr_promiscuous; -#endif -} IPRcvBuf; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define IPR_FLAG_CHECKSUM_OFFLOAD 0x00000002 -#endif - -// -// Enum for values that may be returned from filter routine. -// - -typedef enum _FORWARD_ACTION { - FORWARD = 0, - DROP = 1, - ICMP_ON_DROP = 2 -} FORWARD_ACTION; - - -// Definiton for a firewall routine callout. -__drv_functionClass(IPPacketFirewallPtrType) -__drv_maxIRQL(DISPATCH_LEVEL) -typedef FORWARD_ACTION -IPPacketFirewallPtrType( - __inout VOID **pData, - __in UINT RecvInterfaceIndex, - __inout UINT *pSendInterfaceIndex, - __inout UCHAR *pDestinationType, - __in_bcount(ContextLength) VOID *pContext, - __in UINT ContextLength, - __out IPRcvBuf **ppRcvBuf - ); - -typedef IPPacketFirewallPtrType *IPPacketFirewallPtr; - -extern -int -__success(return==TRUE) -__drv_maxIRQL(DISPATCH_LEVEL) -IPAllocBuff( - __inout IPRcvBuf *pRcvBuf, - __in UINT Size - ); - -extern -VOID -__drv_maxIRQL(DISPATCH_LEVEL) -IPFreeBuff( - __in IPRcvBuf *pRcvBuf - ); - -extern -VOID -__drv_maxIRQL(DISPATCH_LEVEL) -FreeIprBuff( - __in IPRcvBuf *pRcvBuf - ); - -typedef enum _IPROUTEINFOCLASS { - IPRouteNoInformation, - IPRouteOutgoingFirewallContext, - IPRouteOutgoingFilterContext, - MaxIPRouteInfoClass -} IPROUTEINFOCLASS; - -extern -NTSTATUS -__drv_maxIRQL(DISPATCH_LEVEL) -LookupRouteInformation( - __in VOID* RouteLookupData, - __out_opt VOID* RouteEntry OPTIONAL, - __in IPROUTEINFOCLASS RouteInfoClass OPTIONAL, - __out VOID* RouteInformation OPTIONAL, - __out UINT* RouteInfoLength OPTIONAL - ); - -// Structure passed to the IPSetFirewallHook call - -typedef struct _IP_SET_FIREWALL_HOOK_INFO { - IPPacketFirewallPtr FirewallPtr; // Packet filter callout. - UINT Priority; // Priority of the hook - BOOLEAN Add; // if TRUE then ADD else DELETE -} IP_SET_FIREWALL_HOOK_INFO, *PIP_SET_FIREWALL_HOOK_INFO; - - -#define DEST_LOCAL 0 // Destination is local. -#define DEST_BCAST 0x01 // Destination is net or local bcast. -#define DEST_SN_BCAST 0x03 // A subnet bcast. -#define DEST_MCAST 0x05 // A local mcast. -#define DEST_REMOTE 0x08 // Destination is remote. -#define DEST_REM_BCAST 0x0b // Destination is a remote broadcast -#define DEST_REM_MCAST 0x0d // Destination is a remote mcast. -#define DEST_INVALID 0xff // Invalid destination - -#define DEST_PROMIS 0x20 // Dest is promiscuous - -#define DEST_BCAST_BIT 0x01 -#define DEST_OFFNET_BIT 0x10 // Destination is offnet - - // used only by upper layer - // callers. -#define DEST_MCAST_BIT 0x05 - -#define DD_IP_DEVICE_NAME L"\\Device\\Ip" - -#define FSCTL_IP_BASE FILE_DEVICE_NETWORK - -#define _IP_CTL_CODE(function, method, access) \ - CTL_CODE(FSCTL_IP_BASE, function, method, access) - -#define IOCTL_IP_SET_FIREWALL_HOOK \ - _IP_CTL_CODE(12, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#endif //(NTDDI_VERSION < NTDDI_LONGHORN) - diff --git a/qt-correction-tool/pub/ddk/ipinfo.h b/qt-correction-tool/pub/ddk/ipinfo.h deleted file mode 100644 index b758733..0000000 --- a/qt-correction-tool/pub/ddk/ipinfo.h +++ /dev/null @@ -1,410 +0,0 @@ -/********************************************************************/ -/** Microsoft LAN Manager **/ -/** Copyright (c) Microsoft Corporation. All rights reserved. **/ -/********************************************************************/ -/* :ts=4 */ - -//** IPINFO.H - IP SNMP information definitions.. -// -// This file contains all of the definitions for IP that are -// related to SNMP information gathering. - -#ifndef IPINFO_INCLUDED -#define IPINFO_INCLUDED - -#pragma warning(push) -#pragma warning(disable:4201) // nameless struct/union - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifndef CTE_TYPEDEFS_DEFINED -#define CTE_TYPEDEFS_DEFINED - -typedef unsigned long ulong; -typedef unsigned short ushort; -typedef unsigned char uchar; -typedef unsigned int uint; - -#endif // CTE_TYPEDEFS_DEFINED - - -typedef struct IPSNMPInfo { - ulong ipsi_forwarding; - ulong ipsi_defaultttl; - ulong ipsi_inreceives; - ulong ipsi_inhdrerrors; - ulong ipsi_inaddrerrors; - ulong ipsi_forwdatagrams; - ulong ipsi_inunknownprotos; - ulong ipsi_indiscards; - ulong ipsi_indelivers; - ulong ipsi_outrequests; - ulong ipsi_routingdiscards; - ulong ipsi_outdiscards; - ulong ipsi_outnoroutes; - ulong ipsi_reasmtimeout; - ulong ipsi_reasmreqds; - ulong ipsi_reasmoks; - ulong ipsi_reasmfails; - ulong ipsi_fragoks; - ulong ipsi_fragfails; - ulong ipsi_fragcreates; - ulong ipsi_numif; - ulong ipsi_numaddr; - ulong ipsi_numroutes; -} IPSNMPInfo; - -typedef struct ICMPStats { - ulong icmps_msgs; - ulong icmps_errors; - ulong icmps_destunreachs; - ulong icmps_timeexcds; - ulong icmps_parmprobs; - ulong icmps_srcquenchs; - ulong icmps_redirects; - ulong icmps_echos; - ulong icmps_echoreps; - ulong icmps_timestamps; - ulong icmps_timestampreps; - ulong icmps_addrmasks; - ulong icmps_addrmaskreps; -} ICMPStats; - -typedef struct ICMPSNMPInfo { - ICMPStats icsi_instats; - ICMPStats icsi_outstats; -} ICMPSNMPInfo; - -typedef struct ICMPv6Stats { - ulong icmps_msgs; - ulong icmps_errors; - ulong icmps_typecount[256]; -} ICMPv6Stats; - -typedef struct ICMPv6SNMPInfo { - ICMPv6Stats icsi_instats; - ICMPv6Stats icsi_outstats; -} ICMPv6SNMPInfo; - -#define IP_FORWARDING 1 -#define IP_NOT_FORWARDING 2 - -typedef struct IPAddrEntry { - ulong iae_addr; - ulong iae_index; - ulong iae_mask; - ulong iae_bcastaddr; - ulong iae_reasmsize; - ushort iae_context; - ushort iae_pad; -} IPAddrEntry; - -// -// NT4 IPRouteEntry structure -// - -typedef struct IPRouteEntry_V1 { - ulong ire_dest; - ulong ire_index; - ulong ire_metric1; - ulong ire_metric2; - ulong ire_metric3; - ulong ire_metric4; - ulong ire_nexthop; - ulong ire_type; - ulong ire_proto; - ulong ire_age; - ulong ire_mask; - ulong ire_metric5; -// removed ifdef NT because it was breaking route/inetmib1 -// NT is not defined in route and inetmib1 sources file - void *ire_context; -} IPRouteEntry_V1; - -// -// win2000(all SPs) IPRouteEntry structure -// - -typedef struct IPRouteEntry_V2 { - ulong ire_dest; - ulong ire_index; - ulong ire_metric1; - ulong ire_metric2; - ulong ire_metric3; - ulong ire_metric4; - ulong ire_nexthop; - ulong ire_type; - ulong ire_proto; - ulong ire_age; - ulong ire_mask; - ulong ire_metric5; -#ifdef NT - void *ire_context; -#endif -} IPRouteEntry_V2; - -// -// WinXP (RTM/SP1/SP2), Win2k3(RTM/SP1) and Vista (LHS/SP1) -// IPRouteEntry structure. -// - -typedef struct IPRouteEntry_V3 { - ulong ire_dest; - ulong ire_index; - ulong ire_metric1; - ulong ire_metric2; - ulong ire_metric3; - ulong ire_metric4; - ulong ire_nexthop; - ulong ire_type; - ulong ire_proto; - ulong ire_age; - ulong ire_mask; - ulong ire_metric5; -#ifdef NT - ulong ire_context; -#endif -} IPRouteEntry_V3; - -#if (NTDDI_VERSION < NTDDI_WIN2K) -typedef IPRouteEntry_V1 IPRouteEntry; -#elif (NTDDI_VERSION < NTDDI_WINXP) -typedef IPRouteEntry_V2 IPRouteEntry; -#else -typedef IPRouteEntry_V3 IPRouteEntry; -#endif //NTDDI_VERSION < NTDDI_WIN2K - -typedef struct IPRouteBlock { - ulong numofroutes; - IPRouteEntry route[1]; -} IPRouteBlock; - -// -// Route with multiple nexthops and associated defns -// - -// -// Win2000(all SPs) IPRouteNextHopEntry structure -// - -typedef struct IPRouteNextHopEntry_V1 { - ulong ine_iretype; - ulong ine_nexthop; - ulong ine_ifindex; -#ifdef NT - void *ine_context; -#endif -} IPRouteNextHopEntry_V1; - -// -// WinXP and later IPRouteNextHopEntry structure -// - -typedef struct IPRouteNextHopEntry_V2 { - ulong ine_iretype; - ulong ine_nexthop; - ulong ine_ifindex; -#ifdef NT - ulong ine_context; -#endif -} IPRouteNextHopEntry_V2; - -#if (NTDDI_VERSION < NTDDI_WINXP) -typedef IPRouteNextHopEntry_V1 IPRouteNextHopEntry; -#else -typedef IPRouteNextHopEntry_V2 IPRouteNextHopEntry; -#endif //NTDDI_VERSION < NTDDI_WINXP - -// -// Win2000(all SPs) IPMultihopRouteEntry structure -// - -typedef struct IPMultihopRouteEntry_V1 { - ulong imre_numnexthops; - IPRouteEntry imre_routeinfo; - IPRouteNextHopEntry imre_morenexthops[1]; -} IPMultihopRouteEntry_V1; - -// -// WinXP and later IPMultihopRouteEntry structure -// - -typedef struct IPMultihopRouteEntry_V2 { - ulong imre_numnexthops; - ulong imre_flags; - IPRouteEntry imre_routeinfo; - IPRouteNextHopEntry imre_morenexthops[1]; -} IPMultihopRouteEntry_V2; - -#if (NTDDI_VERSION < NTDDI_WINXP) -typedef IPMultihopRouteEntry_V1 IPMultihopRouteEntry; -#else -typedef IPMultihopRouteEntry_V2 IPMultihopRouteEntry; -#endif //NTDDI_VERSION < NTDDI_WINXP - - -#define IMRE_FLAG_DELETE_DEST 0x00000001 - -// -// Input context to pass when querying a route -// - -typedef enum { - IPNotifyNotification = 0, - IPNotifySynchronization, - IPNotifyMaximumVersion -} IPNotifyVersion; - -typedef struct IPNotifyData { - ulong Version; // See IPNotifyVersion above. - ulong Add; - char Info[1]; -} IPNotifyData, *PIPNotifyData; - -typedef struct IPNotifyOutput { - ulong ino_addr; - ulong ino_mask; - ulong ino_info[6]; -} IPNotifyOutput, *PIPNotifyOutput; - -typedef union IPRouteNotifyOutput { - IPNotifyOutput irno_info; - struct { - ulong irno_dest; - ulong irno_mask; - ulong irno_nexthop; - ulong irno_proto; - ulong irno_ifindex; - ulong irno_metric; - ulong irno_flags; - }; -} IPRouteNotifyOutput, *PIPRouteNotifyOutput; - -#define IRNO_FLAG_ADD 0x00000001 -#define IRNO_FLAG_DELETE 0x00000002 - -// -// Input context to pass when querying a route -// -typedef struct IPRouteLookupData { - ulong Version; //version of this structure - ulong DestAdd; - ulong SrcAdd; - char Info[1]; -} IPRouteLookupData, *PIPRouteLookupData; - -typedef struct AddrXlatInfo { - ulong axi_count; - ulong axi_index; -} AddrXlatInfo; - -#define IRE_TYPE_OTHER 1 -#define IRE_TYPE_INVALID 2 -#define IRE_TYPE_DIRECT 3 -#define IRE_TYPE_INDIRECT 4 - -#define IRE_PROTO_OTHER 1 -#define IRE_PROTO_LOCAL 2 -#define IRE_PROTO_NETMGMT 3 -#define IRE_PROTO_ICMP 4 -#define IRE_PROTO_EGP 5 -#define IRE_PROTO_GGP 6 -#define IRE_PROTO_HELLO 7 -#define IRE_PROTO_RIP 8 -#define IRE_PROTO_IS_IS 9 -#define IRE_PROTO_ES_IS 10 -#define IRE_PROTO_CISCO 11 -#define IRE_PROTO_BBN 12 -#define IRE_PROTO_OSPF 13 -#define IRE_PROTO_BGP 14 - -// -// IRE_PROTO_PERSIST_LOCAL was defined on W2k (all SPs), -// XP RTM, and XP SP1. It's been removed since XP SP2. -// -#if ((NTDDI_VERSION >= NTDDI_WIN2K) && (NTDDI_VERSION < NTDDI_WINXPSP2)) -#define IRE_PROTO_PERSIST_LOCAL 10010 -#endif - -#define IRE_METRIC_UNUSED 0xffffffff - -#define IP_MIB_STATS_ID 1 -#define IP_MIB_RTCHANGE_NOTIFY_ID 2 -#define ICMP_MIB_STATS_ID 1 - -#define AT_MIB_ADDRXLAT_INFO_ID 1 -#define AT_MIB_ADDRXLAT_ENTRY_ID 0x101 - -#define IP_MIB_RTTABLE_ENTRY_ID 0x101 -#define IP_MIB_ADDRTABLE_ENTRY_ID 0x102 -#define IP_MIB_RTTABLE_ENTRY_ID_EX 0x103 - -#define IP_INTFC_FLAG_P2P 1 -#define IP_INTFC_FLAG_P2MP 2 -#define IP_INTFC_FLAG_UNIDIRECTIONAL 4 - - -typedef struct IPInterfaceInfo { - ulong iii_flags; - ulong iii_mtu; - ulong iii_speed; - ulong iii_addrlength; - uchar iii_addr[1]; -} IPInterfaceInfo; - -#define IP_INTFC_INFO_ID 0x103 -#define IP_MIB_SINGLE_RT_ENTRY_ID 0x104 -#define IP_GET_BEST_SOURCE 0x105 - -// -// Pick up in6_addr type. -// -#include - -// -// IP6RouteEntry_V1, defined on WinXP RTM, WinXP SP1, W2k3 RTM, -// and Longhorn/Vista. -// -typedef struct IP6RouteEntry_V1 { - ulong ire_Length; - struct in6_addr ire_Source; - ulong ire_ScopeId; - ulong ire_IfIndex; -} IP6RouteEntry_V1; - -// -// IP6RouteEntry_V2, defined on WinXP SP2, W2k3 SP1 -// (and possibly on subsequent service packs of XP and 2k3) -// -typedef struct IP6RouteEntry_V2 { - ulong ire_Length; - ulong ire_Type; - ulong ire_IfIndex; - ulong ire_SourceScopeId; - ulong ire_NextHopScopeId; - struct in6_addr ire_Source; - struct in6_addr ire_NextHop; -} IP6RouteEntry_V2; - -#if (NTDDI_VERSION < NTDDI_WINXPSP2) //XPSP1 and before -typedef IP6RouteEntry_V1 IP6RouteEntry; -#elif (NTDDI_VERSION < NTDDI_WS03) //[XPSP2, 2k3RTM) -typedef IP6RouteEntry_V2 IP6RouteEntry; -#elif (NTDDI_VERSION < NTDDI_WS03SP1) //[2k3RTM] -typedef IP6RouteEntry_V1 IP6RouteEntry; -#elif (NTDDI_VERSION < NTDDI_LONGHORN) //[2k3SP1, Longhorn) -typedef IP6RouteEntry_V2 IP6RouteEntry; -#else //[Longhorn, ...] -typedef IP6RouteEntry_V1 IP6RouteEntry; -#endif //NTDDI_VERSION < NTDDI_WINXPSP2 - -#define IP6_MIB_STATS_ID IP_MIB_STATS_ID -#define IP6_GET_BEST_ROUTE_ID 3 -#define ICMP6_MIB_STATS_ID 4 - -#pragma warning(pop) - -#endif // IPINFO_INCLUDED - diff --git a/qt-correction-tool/pub/ddk/irb.h b/qt-correction-tool/pub/ddk/irb.h deleted file mode 100644 index 6cfc6d8..0000000 --- a/qt-correction-tool/pub/ddk/irb.h +++ /dev/null @@ -1,1973 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - irb.h - -Abstract: - - Defines the interface between the Ataport and the ATA miniport drivers. - -Authors: - -Revision History: - ---*/ - -#include - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -#ifndef _NTIRB_ -#define _NTIRB_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - -#ifdef __cplusplus -extern "C" -{ -#endif - -// -// pre-defined channel numbers for P-ATA -// -#define PRIMARY_CHANNEL_NUMBER 0 -#define SECONDARY_CHANNEL_NUMBER 1 - -// -// max number of devices per channel for P-ATA -// -#define MAX_IDE_DEVICE 2 - -#define MAX_IDE_LUN 8 - -#define IDE_UNTAGGED 0xFF -#define IDE_UNINITIALIZED_VALUE (-1) - -#define IDE_REG_SZ (1) -#define IDE_REG_BINARY (3) -#define IDE_REG_DWORD (4) - -typedef PHYSICAL_ADDRESS IDE_PHYSICAL_ADDRESS, *PIDE_PHYSICAL_ADDRESS; - -#undef TraceNotification -#define TraceNotification 0 - -#ifndef _NTDDSCSIH_ - -// -// Miniport ioctl header -// -typedef struct _IDE_IO_CONTROL { - ULONG HeaderLength; - UCHAR Signature[8]; - ULONG Timeout; - ULONG ControlCode; - ULONG ReturnStatus; - ULONG DataLength; -} IDE_IO_CONTROL, *PIDE_IO_CONTROL; -#endif - -// -// Notification Event Types -// -typedef enum _IDE_NOTIFICATION_TYPE { - IdeDeviceArrival, - IdeDeviceRemoval, - IdePowerStateChange -} IDE_NOTIFICATION_TYPE, *PIDE_NOTIFICATION_TYPE; - -// -// Callback types supported by the port driver -// -typedef enum _IDE_CALLBACK_TYPE { - IdeTimerRoutine, - IdeWorkerRoutine, - IdeSynchronizedRoutine, - IdeControllerSyncRoutine, - IdeMaxCallbackType -} IDE_CALLBACK_TYPE, *PIDE_CALLBACK_TYPE; - -// -// Device type -// -typedef enum { - DeviceUnknown = 0, - DeviceIsAta, - DeviceIsAtapi, - DeviceNotExist -} IDE_DEVICE_TYPE; - -// -// addressing mode -// -typedef enum { - UnknownMode = 0, - ChsMode, - LbaMode, - Lba48BitMode -}ATA_ADDRESS_TRANSLATION; - -// -// control action for ChannelControl -// -typedef enum { - IdeStart = 0, - IdeStop, - IdePowerUp, - IdePowerDown, - IdeVendorDefined -} IDE_CONTROL_ACTION; - -// -// device power states -// -typedef enum { - IdePowerUnSpecified = 0, - IdePowerD0, - IdePowerD3 -} IDE_POWER_STATE; - - -// -// SenseInfoBuffer return types -// -#define SENSE_INFO_BUFFER_RETURN_TYPE_CDB 0 -#define SENSE_INFO_BUFFER_RETURN_TYPE_28BIT_TASKFILE 1 -#define SENSE_INFO_BUFFER_RETURN_TYPE_48BIT_TASKFILE 2 -#define SENSE_INFO_BUFFER_RETURN_TYPE_D2H_FIS 3 - -// -// power transition information -// defines a transition from -// currentPowerState -> DesiredPowerState -// -typedef struct _IDE_POWER_INFO { - IDE_POWER_STATE CurrentPowerState; - IDE_POWER_STATE DesiredPowerState; -} IDE_POWER_INFO, *PIDE_POWER_INFO; - -typedef struct _IDE_VENDOR_DEFINED_POWER_INFO { - UCHAR TargetId; - GUID SettingGuid; - __field_bcount(ValueLength) - PVOID Value; - ULONG ValueLength; -} IDE_VENDOR_DEFINED_POWER_INFO, *PIDE_VENDOR_DEFINED_POWER_INFO; - - -// -// task file register contents -// -typedef struct _IDEREGISTERS { - - // - // ATA features/error register - // - UCHAR bFeaturesReg; - - // - // sector count - // - UCHAR bSectorCountReg; - - // - // block number (7:0) - // - UCHAR bSectorNumberReg; - - // - // cylinder number (7:0) or LBA (15:8) - // - UCHAR bCylLowReg; - - // - // cylinder number (15:8) or LBA (23:16) - // - UCHAR bCylHighReg; - - // - // device/Head and LBA (27:24) - // - UCHAR bDriveHeadReg; - - // - // command/status register - // - UCHAR bCommandReg; - - // - // Reserved for future use. Shall be 0 - // - UCHAR bReserved; - -} IDEREGISTERS, *PIDEREGISTERS; - -// -// task file (to hold 48 bit) -// -typedef struct _IDE_TASK_FILE { - IDEREGISTERS Current; - IDEREGISTERS Previous; -} IDE_TASK_FILE, *PIDE_TASK_FILE; - -typedef UCHAR IRB_STATUS; - -// -// irb -// -typedef struct _IDE_REQUEST_BLOCK { - - // - // IRB_FUNCTION_XXX - // - USHORT Function; - - // - // IRB_STATUS_XXX - // - UCHAR IrbStatus; - - // - // contents of the status and error registers - // at the completion of the command - // - UCHAR AtaStatus; - UCHAR AtaError; - - // - // channel, target and lun ids uniquely identify the target device - // - UCHAR Channel; - UCHAR TargetId; - UCHAR Lun; - // - // Length of the actual CDB in the Cdb[16] array - // - UCHAR CdbLength; - - // - // sense info buffer length - // - UCHAR SenseInfoBufferLength; - - // - // Type of data structure returned in the SenseInfoBuffer - // - UCHAR SenseInfoBufferType; - - // - // holds the queue tag - // - UCHAR QueueTag; - - ULONG ReservedAsUlong; - - // - // Irb Flags - // - ULONG IrbFlags; - - // - // timeout - // - ULONG TimeOutValue; - - // - // data transfer length - // - ULONG DataTransferLength; - - // - // irb extension - // - PVOID IrbExtension; - - // - // data buffer - // - __field_bcount(DataTransferLength) - PVOID DataBuffer; - - // - // sense buffer - // - __field_bcount(SenseInfoBufferLength) - PVOID SenseInfoBuffer; - - // - // Used for queueing irbs - // - PVOID NextIrb; - - // - // For future use (shall be set to NULL) - // - PVOID Reserved; - - // - // task file for ATA devices or - // CDB for ATAPI devices or - // power transition information or - // an array of chars - // (determined by IrbFunction) - // - union { - - // - // ATA Task file register contents - // - IDE_TASK_FILE IdeTaskFile; - - // - // CDB for ATAPI devices - // - UCHAR Cdb[16]; - - // - // power transitition information - // - IDE_POWER_INFO PowerChange; - - // - // array of 16 uchars - // - UCHAR AsUChar[16]; - }; - -} IDE_REQUEST_BLOCK, *PIDE_REQUEST_BLOCK; - -// -// irb status -// -#define IRB_STATUS_PENDING 0x0 -#define IRB_STATUS_SUCCESS 0x1 -#define IRB_STATUS_DATALENGTH_MISMATCH 0x2 -#define IRB_STATUS_DEVICE_ERROR 0x3 -#define IRB_STATUS_INVALID_REQUEST 0x4 -#define IRB_STATUS_BUS_RESET 0x5 -#define IRB_STATUS_SELECTION_TIMEOUT 0x6 -#define IRB_STATUS_BUSY 0x7 - -// -// bit to indicate the SenseInfoBuffer holds a valid Task File -// -#define IRB_STATUS_RETURN_TASKFILE_VALID 0x10 - -// -// bit mask to indicate valid sense info -// -#define IRB_STATUS_AUTOSENSE_VALID 0x20 - -// -// 0x40 and above are reserved for the port driver -// -#define IRB_STATUS_INTERNAL_ERROR 0x40 - -// -// irb function -// - -// -// 0x100 - 0x1FF indicate ATA commands -// -#define IRB_FUNCTION_ATA_COMMAND 0x100 -#define IRB_FUNCTION_ATA_IDENTIFY 0x101 -#define IRB_FUNCTION_ATA_READ 0x102 -#define IRB_FUNCTION_ATA_WRITE 0x103 -#define IRB_FUNCTION_ATA_FLUSH 0x104 -#define IRB_FUNCTION_ATA_SMART 0x105 - -// -// 0x200 - 0x2FF indicate ATAPI commands -// -#define IRB_FUNCTION_ATAPI_COMMAND 0x200 -#define IRB_FUNCTION_REQUEST_SENSE 0x201 - -// -// 0x400-0x4FF indicate miniport commands -// -#define IRB_FUNCTION_MINIPORT_COMMAND 0x400 -#define IRB_FUNCTION_ADAPTER_FLUSH 0x401 -#define IRB_FUNCTION_SHUTDOWN 0x402 -#define IRB_FUNCTION_POWER_CHANGE 0x403 -#define IRB_FUNCTION_LUN_RESET 0x404 -#define IRB_FUNCTION_MINIPORT_IOCTL 0x405 -#define IRB_FUNCTION_POWER_REBOOT 0x406 - -// -// irb flags -// -#define IRB_FLAGS_DRDY_REQUIRED 0x1 -#define IRB_FLAGS_USE_DMA 0x2 -#define IRB_FLAGS_MAP_BUFFERS 0x4 -#define IRB_FLAGS_48BIT 0x8 -#define IRB_FLAGS_PIO_MULTIPLE 0x10 -#define IRB_FLAGS_RETURN_RESULTS 0x20 -#define IRB_FLAGS_DATA_IN 0x40 -#define IRB_FLAGS_DATA_OUT 0x80 -#define IRB_FLAGS_DISCARDABLE 0x100 -#define IRB_FLAGS_HIGH_PRIORITY 0x200 - -// -// helper macros -// -#define IsAtapiCommand(irb) (irb->Function & IRB_FUNCTION_ATAPI_COMMAND) -#define IsAtaCommand(irb) (irb->Function & IRB_FUNCTION_ATA_COMMAND) -#define IsMiniportCommand(irb) (irb->Function & IRB_FUNCTION_MINIPORT_COMMAND) -#define IsRequestSenseIrb(irb) (irb->Function == IRB_FUNCTION_REQUEST_SENSE) -#define IsReturnResults(irb) (irb->IrbFlags & IRB_FLAGS_RETURN_RESULTS) - -#define NeedRequestSense(irb) \ - (IsAtapiCommand(irb) && \ - !IsRequestSenseIrb(irb) && \ - (irb->IrbStatus == IRB_STATUS_DEVICE_ERROR) && \ - (irb->SenseInfoBuffer != NULL) && \ - (irb->SenseInfoBufferLength > 0)) - -#define Is48BitIrb(irb) (irb->IrbFlags & IRB_FLAGS_48BIT) -#define IsPioMultipleIrb(irb) (irb->IrbFlags & IRB_FLAGS_PIO_MULTIPLE) -#define IsHighPriorityIrb(irb) (irb->IrbFlags & IRB_FLAGS_HIGH_PRIORITY) - -#define IRB_USES_DMA(irb) (irb->IrbFlags & IRB_FLAGS_USE_DMA) - -#define MARK_IRB_FOR_DMA(irb) (irb->IrbFlags |= IRB_FLAGS_USE_DMA) -#define MARK_IRB_FOR_PIO(irb) (irb->IrbFlags &= ~IRB_FLAGS_USE_DMA) - -#define IRB_FOR_DATA_TRANSFER(irb) \ - (irb->IrbFlags & (IRB_FLAGS_DATA_IN | IRB_FLAGS_DATA_OUT)) - - -#define GET_IRB_CURRENT_REG(irb) (&((irb->IdeTaskFile).Current)) -#define GET_IRB_PREVIOUS_REG(irb) (&((irb->IdeTaskFile).Previous)) - -#define GET_CURRENT_REG(taskFile) (&(taskFile)->Current) -#define GET_PREVIOUS_REG(taskFile) (&(taskFile)->Previous) - -#define GetIrbErrorReg(irb) (irb->AtaError) -#define GetIrbStatusReg(irb) (irb->AtaStatus) -#define SetIrbCommandReg(irb, cmd) (irb->IdeTaskFile.Current.bCommandReg=cmd) - -// -// TargetId >= 1 implies slave device -// -#define SetIrbDeviceReg(irb, val) \ - (irb->IdeTaskFile.Current.bDriveHeadReg = ((irb->TargetId == 0x0) ? (0xA0 | val) : (0xB0 | val))) - -// -// algorithm used by the port driver to set the irbFunction -// for an ATA command -// -#define IdeMapAtaCommandToIrbFunction(AtaCommand, irbFunc) \ -{ \ - switch (AtaCommand) { \ - case IDE_COMMAND_IDENTIFY: \ - case IDE_COMMAND_ATAPI_IDENTIFY: \ - irbFunc = IRB_FUNCTION_ATA_IDENTIFY; \ - break; \ - case IDE_COMMAND_READ: \ - case IDE_COMMAND_READ_MULTIPLE: \ - case IDE_COMMAND_READ_DMA: \ - case IDE_COMMAND_READ_EXT: \ - case IDE_COMMAND_READ_DMA_EXT: \ - case IDE_COMMAND_READ_MULTIPLE_EXT: \ - irbFunc = IRB_FUNCTION_ATA_READ; \ - break; \ - case IDE_COMMAND_WRITE: \ - case IDE_COMMAND_WRITE_MULTIPLE: \ - case IDE_COMMAND_WRITE_DMA: \ - case IDE_COMMAND_WRITE_EXT: \ - case IDE_COMMAND_WRITE_DMA_EXT: \ - case IDE_COMMAND_WRITE_DMA_FUA_EXT: \ - case IDE_COMMAND_WRITE_MULTIPLE_EXT: \ - case IDE_COMMAND_WRITE_MULTIPLE_FUA_EXT: \ - irbFunc = IRB_FUNCTION_ATA_WRITE; \ - break; \ - case IDE_COMMAND_CHECK_POWER: \ - case IDE_COMMAND_FLUSH_CACHE: \ - case IDE_COMMAND_FLUSH_CACHE_EXT: \ - irbFunc = IRB_FUNCTION_ATA_FLUSH;\ - break; \ - case IDE_COMMAND_SMART: \ - irbFunc = IRB_FUNCTION_ATA_SMART; \ - break;\ - default:\ - irbFunc = IRB_FUNCTION_ATA_COMMAND;\ - break;\ - } \ -} - -// -// scatter-gather list -// -typedef struct _IDE_SCATTER_GATHER_ELEMENT { - IDE_PHYSICAL_ADDRESS Address; - ULONG Length; - ULONG_PTR Reserved; -} IDE_SCATTER_GATHER_ELEMENT, *PIDE_SCATTER_GATHER_ELEMENT; - -#if defined(_MSC_VER) && (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#endif -#pragma warning(disable:4200) /* nonstandard extension used : zero-sized array in struct/union */ -#endif - -typedef struct _IDE_SCATTER_GATHER_LIST { - ULONG NumberOfElements; - ULONG_PTR Reserved; - __field_ecount(NumberOfElements) - IDE_SCATTER_GATHER_ELEMENT Elements[]; -} IDE_SCATTER_GATHER_LIST, *PIDE_SCATTER_GATHER_LIST; - -#if defined(_MSC_VER) && (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#else -#pragma warning(default:4200) /* nonstandard extension used : zero-sized array in struct/union */ -#endif -#endif - -// -// task file register addresses -// -typedef struct _IDE_REGISTERS_1 { - PUCHAR RegistersBaseAddress; - - PUSHORT Data; - - union { - PUCHAR Error; - PUCHAR Features; - }; - - union { - PUCHAR BlockCount; - PUCHAR InterruptReason; - }; - - PUCHAR BlockNumber; - - union { - PUCHAR CylinderLow; - PUCHAR ByteCountLow; - }; - - union { - PUCHAR CylinderHigh; - PUCHAR ByteCountHigh; - }; - - PUCHAR DriveSelect; - PUCHAR Command; -} IDE_REGISTERS_1, *PIDE_REGISTERS_1; - -// -// device control register addresses -// -typedef struct _IDE_REGISTERS_2 { - PUCHAR RegistersBaseAddress; - - PUCHAR DeviceControl; - PUCHAR DriveAddress; -} IDE_REGISTERS_2, *PIDE_REGISTERS_2; - -// -// access range that indicates the resources -// -typedef struct _IDE_ACCESS_RANGE { - IDE_PHYSICAL_ADDRESS RangeStart; - IDE_PHYSICAL_ADDRESS PhysicalRangeStart; - ULONG RangeLength; - BOOLEAN InMemory; - UCHAR Bar; -} IDE_ACCESS_RANGE, *PIDE_ACCESS_RANGE; - -// -// the miniport's error log entry -// -typedef struct _IDE_ERROR_LOG_ENTRY { - UCHAR IrbStatus; - UCHAR Channel; - UCHAR TargetId; - UCHAR Lun; - UCHAR UniqueId; - UCHAR DumpDataSize; - __field_bcount(DumpDataSize) - UCHAR DumpData[1]; -} IDE_ERROR_LOG_ENTRY, *PIDE_ERROR_LOG_ENTRY; - -// -// device characterstics flags -// - -// -// Indicates that the drive has the 'removable' bit set in -// identify data (offset 128) -// -#define DFLAGS_REMOVABLE_MEDIA (1 << 0) - -// -// Indicates whether device interrupts as DRQ is set after -// receiving Atapi Packet Command -// -#define DFLAGS_INT_DRQ (1 << 1) - -// -// Device supports media status notification -// -#define DFLAGS_MSN_SUPPORT (1 << 2) - -// -// Device can be electronically safe unplugged (such as: eSATA device) -// -#define DFLAGS_REMOVABLE_DEVICE (1 << 3) - -// -// Indicates device supports for FUA -// -#define DFLAGS_FUA_SUPPORT (1 << 12) - - -typedef struct _IDE_DEVICE_PARAMETERS { - - // - // size of this structure - // - USHORT Version; - - // - // device type (ata, atapi etc) - // - IDE_DEVICE_TYPE IdeDeviceType; - - // - // target id - // - UCHAR TargetId; - - // - // Number of Luns - // - UCHAR MaximumLun; - - // - // number of requests the miniport can handle - // at a time for this device - // - UCHAR NumberOfOverlappedRequests; - - // - // max number of blocks that can be transferred - // using read/write multiple command - // - UCHAR MaxBlockXfer; - - // - // device characteristics (removable etc) - // - USHORT DeviceCharacteristics; - - // - // Geometry - // - ATA_ADDRESS_TRANSLATION AddressTranslation; - - union { - LARGE_INTEGER MaxLba; - struct { - USHORT NumCylinders; - USHORT NumHeads; - USHORT NumSectorsPerTrack; - USHORT Reserved; - } Chs; - }; - - // - // number of bytes per sector - // - ULONG BytesPerLogicalSector; - - // - // number of bytes per sector - // - ULONG BytesPerPhysicalSector; - - // - // number of bytes per sector - // - ULONG BytesOffsetForSectorAlignment; - - // - // The transfer modes supported by this device - // - ULONG TransferModeSupported; - - // - // The selected transfer mode for this device - // - ULONG TransferModeSelected; - -} IDE_DEVICE_PARAMETERS, *PIDE_DEVICE_PARAMETERS; - -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_INITIALIZE) ( - __in PVOID ChannelExtension, - __inout PIDE_DEVICE_PARAMETERS DeviceParameters, - __in PIDENTIFY_DEVICE_DATA IdentifyData - ); - -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_STARTIO) ( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_BUILDIO) ( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__checkReturn -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_INTERRUPT) ( - __in PVOID ChannelExtension - ); - -__drv_minFunctionIRQL(DISPATCH_LEVEL) -__drv_requiresIRQL(DISPATCH_LEVEL) -typedef -VOID -//KSYNCHRONIZE_ROUTINE -(*IDE_HW_DPC) ( - __in PVOID ChannelExtension - ); - -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_RESET) ( - __in PVOID ChannelExtension - ); - -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_HW_CONTROL) ( - __in PVOID ChannelExtension, - __in IDE_CONTROL_ACTION ControlAction, - __inout_opt PVOID Parameters - ); - -// -// Indicates the operation constraints -// -typedef enum _IDE_OPERATION_MODE { - IdeModeNormal = 0, - IdeModeDump, - IdeModeRemovableBay -} IDE_OPERATION_MODE, *PIDE_OPERATION_MODE; - -// -// miniport hardware resources -// -typedef struct _IDE_MINIPORT_RESOURCES{ - - // - // Number of access ranges - // - ULONG NumberOfAccessRanges; - - // - // array of access range elements. - // - __inout_ecount(NumberOfAccessRanges) - PIDE_ACCESS_RANGE IdeAccessRange; - -} IDE_MINIPORT_RESOURCES, *PIDE_MINIPORT_RESOURCES; - -typedef struct _IDE_VENDOR_DEFINED_POWER { - UCHAR ValidGuids; - GUID Guid[3]; -} IDE_VENDOR_DEFINED_POWER, *PIDE_VENDOR_DEFINED_POWER; - - -typedef union _SUPPORTED_ADVANCES { - - struct { - //LSB - USHORT AdvancedChannelConfigurationSupported :1; - USHORT Reserved :15; - //MSB - }; - - USHORT AsUshort; -} SUPPORTED_ADVANCES, *PSUPPORTED_ADVANCES; - -typedef union _IDE_ADVANCED_CHANNEL_CONFIGURATION_FIELDS_PRESENT { - - struct { - //LSB - USHORT VendorDefinedPower :1; - USHORT Reserved :15; - //MSB - }; - - USHORT AsUshort; -} IDE_ADVANCED_CHANNEL_CONFIGURATION_FIELDS_PRESENT, *PIDE_ADVANCED_CHANNEL_CONFIGURATION_FIELDS_PRESENT; - -typedef struct _IDE_ADVANCED_CHANNEL_CONFIGURATION { - USHORT Length; - IDE_ADVANCED_CHANNEL_CONFIGURATION_FIELDS_PRESENT Present; - IDE_VENDOR_DEFINED_POWER VendorDefinedPower; -} IDE_ADVANCED_CHANNEL_CONFIGURATION, *PIDE_ADVANCED_CHANNEL_CONFIGURATION; - -typedef struct _IDE_CHANNEL_CONFIGURATION { - - // - // Input parameters - // - - // - // IN only. version - // - USHORT Version; - - // - // IN only. The channel number - // - UCHAR ChannelNumber; - - // - // Reserved - // - SUPPORTED_ADVANCES SupportedAdvances; - - // - // Operating mode - // - IDE_OPERATION_MODE ChannelMode; - - // - // IN only field. Pointer to hardware resources - // - PIDE_MINIPORT_RESOURCES ChannelResources; - - // - // Output parameters - // - - // - // Number of overlapped requests the channel can handle - // - UCHAR NumberOfOverlappedRequests; - - // - // The maximum targetId. - // Typically (MaxNumDevices - 1) - // - UCHAR MaxTargetId; - - // - // Always TRUE - // - BOOLEAN SyncWithIsr; - - // - // Always TRUE - // - BOOLEAN SupportsWmi; - - // - // Reserved - // - PIDE_ADVANCED_CHANNEL_CONFIGURATION AdvancedChannelConfiguration; - -} IDE_CHANNEL_CONFIGURATION, *PIDE_CHANNEL_CONFIGURATION; - - -typedef struct _IDE_CHANNEL_INTERFACE { - - // - // Input parameters - // - - // - // Size of this structure - // - USHORT Version; - - // - // The channel number - // - UCHAR ChannelNumber; - - // - // Reserved for future use - // - UCHAR Reserved; - - // - // Reserved - // - ULONG ReservedUlong; - - // - // Output parameters - // - IDE_HW_INITIALIZE IdeHwInitialize; - IDE_HW_BUILDIO IdeHwBuildIo; - IDE_HW_STARTIO IdeHwStartIo; - IDE_HW_INTERRUPT IdeHwInterrupt; - IDE_HW_RESET IdeHwReset; - IDE_HW_CONTROL IdeHwControl; - -} IDE_CHANNEL_INTERFACE, *PIDE_CHANNEL_INTERFACE; - -__checkReturn -__drv_sameIRQL -typedef BOOLEAN - (* IDE_CHANNEL_INIT) ( - __in PVOID ChannelExtension, - __inout PIDE_CHANNEL_INTERFACE ChannelInterface, - __inout_opt PVOID InitContext - ); - -typedef struct _IDE_TRANSFER_MODE_PARAMETERS { - - // - // Input Parameters - // - - // - // IDE Channel Number. - // - UCHAR ChannelNumber; - - // - // Indicate whether devices are present - // - IDE_DEVICE_TYPE DeviceType[MAX_IDE_DEVICE]; - - // - // Indicate whether devices support IO Ready Line - // - BOOLEAN IoReadySupported[MAX_IDE_DEVICE]; - - // - // Indicate the data transfer modes devices support - // - ULONG DeviceTransferModeSupported[MAX_IDE_DEVICE]; - - // - // Indicate devices' current data transfer modes - // - ULONG DeviceTransferModeCurrent[MAX_IDE_DEVICE]; - - // - // Output Parameters - // - - // - // Indicate devices' data transfer modes chosen by - // the miniport - // - ULONG DeviceTransferModeSelected[MAX_IDE_DEVICE]; - -} IDE_TRANSFER_MODE_PARAMETERS, *PIDE_TRANSFER_MODE_PARAMETERS; - -__checkReturn -__drv_sameIRQL -typedef BOOLEAN - (*IDE_TRANSFER_MODE_SELECT) ( - __in PVOID ControllerExtension, - __inout PIDE_TRANSFER_MODE_PARAMETERS TransferModeSelect - ); - -// -// possible channel state -// -typedef enum { - ChannelStateDisabled = 0, - ChannelStateEnabled, - ChannelStateUnKnown -} ATA_CHANNEL_STATE; - -__checkReturn -__drv_sameIRQL -typedef ATA_CHANNEL_STATE - (*IDE_CHANNEL_ENABLED) ( - __in PVOID ControllerExtension, - __in ULONG Channel - ); - -typedef enum { - IdeBusPata = 0, - IdeBusSata, - IdeBusUnknown -} IDE_BUS_TYPE, *PIDE_BUS_TYPE; - -typedef struct _IDE_CONTROLLER_CONFIGURATION { - - // - // size of this structure - // - USHORT Version; - - // - // number of IDE channels - // - UCHAR NumberOfChannels; - - // - // Operating mode - // - IDE_OPERATION_MODE ControllerMode; - - // - // number of elements in the scatter gather list - // - UCHAR NumberOfPhysicalBreaks; - - // - // maximum transfer bytes supported by the controller - // - ULONG MaximumTransferLength; - - // - // Reserved for future use - // - BOOLEAN Reserved; - - // - // TRUE if the controller is in native mode - // - BOOLEAN NativeModeEnabled; - - // - // TRUE if the controller supports 64 bit DMA - // - BOOLEAN Dma64BitAddress; - - // - // TRUE if the controller is a bus master - // - BOOLEAN BusMaster; - - // - // SATA or PATA - // - IDE_BUS_TYPE AtaBusType; - - // - // IN only field. Pointer to hardware resources - // - PIDE_MINIPORT_RESOURCES ControllerResources; - -} IDE_CONTROLLER_CONFIGURATION, *PIDE_CONTROLLER_CONFIGURATION; - -__checkReturn -__drv_sameIRQL -typedef -BOOLEAN -(*IDE_ADAPTER_CONTROL) ( - __in PVOID ControllerExtension, - __in IDE_CONTROL_ACTION ControlAction, - __inout_opt PVOID Parameters - ); - -typedef struct _IDE_CONTROLLER_INTERFACE { - - // - // Size of this structure - // - USHORT Version; - - // - // Reserved for future use - // - USHORT Reserved; - - // Size of the controller device extension - // - ULONG ControllerExtensionSize; - - // - // Size of the channel extension - // - ULONG ChannelExtensionSize; - - // - // Alignment requirement - // - ULONG AlignmentMask; - - // - // mini driver entry point - // - - // - // init routine for each channel - // - IDE_CHANNEL_INIT AtaChannelInitRoutine; - - // - // channelEnabled routine - // - IDE_CHANNEL_ENABLED AtaControllerChannelEnabled; - - // - // Transfer mode select routine - // - IDE_TRANSFER_MODE_SELECT AtaControllerTransferModeSelect; - - // - // Adapter control routine - // - IDE_ADAPTER_CONTROL AtaAdapterControl; - -} IDE_CONTROLLER_INTERFACE, *PIDE_CONTROLLER_INTERFACE; - - -// -// -// -typedef struct _IDE_LBA_RANGE { - ULONGLONG StartSector:48; - ULONGLONG SectorCount:16; -} IDE_LBA_RANGE, *PIDE_LBA_RANGE; - -// by ATA spec, the SectorCount value is 1 - 0xffff. 0 means this entry is not valid. -#define MAX_IDE_LBA_RANGE_SECTOR_COUNT_VALUE 0xffff - - -// -// Transfer mode support bit masks -// -#define PIO_MODE0 (1 << 0) -#define PIO_MODE1 (1 << 1) -#define PIO_MODE2 (1 << 2) -#define PIO_MODE3 (1 << 3) -#define PIO_MODE4 (1 << 4) - -#define SWDMA_MODE0 (1 << 5) -#define SWDMA_MODE1 (1 << 6) -#define SWDMA_MODE2 (1 << 7) - -#define MWDMA_MODE0 (1 << 8) -#define MWDMA_MODE1 (1 << 9) -#define MWDMA_MODE2 (1 << 10) - -#define UDMA_MODE0 (1 << 11) -#define UDMA_MODE1 (1 << 12) -#define UDMA_MODE2 (1 << 13) -#define UDMA_MODE3 (1 << 14) -#define UDMA_MODE4 (1 << 15) -#define UDMA_MODE5 (1 << 16) - -#define PIO_SUPPORT (PIO_MODE0 | PIO_MODE1 | PIO_MODE2 | PIO_MODE3 | PIO_MODE4) -#define SWDMA_SUPPORT (SWDMA_MODE0 | SWDMA_MODE1 | SWDMA_MODE2) -#define MWDMA_SUPPORT (MWDMA_MODE0 | MWDMA_MODE1 | MWDMA_MODE2) -#define UDMA_SUPPORT (UNINITIALIZED_TRANSFER_MODE & (~(PIO_SUPPORT | SWDMA_SUPPORT | MWDMA_SUPPORT))) - -#define DMA_SUPPORT (SWDMA_SUPPORT | MWDMA_SUPPORT | UDMA_SUPPORT) -#define ALL_MODE_SUPPORT (PIO_SUPPORT | DMA_SUPPORT) - -#define PIO0 0 -#define PIO1 1 -#define PIO2 2 -#define PIO3 3 -#define PIO4 4 -#define SWDMA0 5 -#define SWDMA1 6 -#define SWDMA2 7 -#define MWDMA0 8 -#define MWDMA1 9 -#define MWDMA2 10 -#define UDMA0 11 - -#ifdef MAX_XFER_MODE -#undef MAX_XFER_MODE -#endif - -#define MAX_XFER_MODE 18 -#define UNINITIALIZED_CYCLE_TIME 0xffffffff -#define UNINITIALIZED_TRANSFER_MODE 0x7fffffff -#define IS_DEFAULT(mode) (!(mode & 0x80000000)) - -#ifdef GenTransferModeMask -#undef GenTransferModeMask -#endif - -#define GenTransferModeMask(i, mode) {\ - ULONG temp=0xffffffff; \ - mode = (temp >> (31-(i)));\ -} - -#define GetHighestBitSet(mode, i) {\ - ULONG temp = (mode); \ - i=0; \ - while (temp) { \ - temp >>= 1; \ - i++; \ - } \ - i--; \ -} - -__checkReturn -__drv_sameIRQL -ULONG -AtaPortInitializeEx( - __in PVOID DriverObject, - __in PVOID RegistryPath, - __in PIDE_CONTROLLER_INTERFACE ControllerInterface - ); - -// -// To query PCI IDE config space data -// -__drv_sameIRQL -ULONG -AtaPortGetBusData( - __in PVOID ControllerExtension, - __in_bcount(BufferLength) PVOID Buffer, - __in ULONG ConfigDataOffset, - __in ULONG BufferLength - ); - -// -// To save PCI IDE config space data -// -__drv_sameIRQL -ULONG -AtaPortSetBusData( - __in PVOID ControllerExtension, - __in_bcount(BufferLength) PVOID Buffer, - __in ULONG ConfigDataOffset, - __in ULONG BufferLength - ); - -__checkReturn -__drv_sameIRQL -PIDE_SCATTER_GATHER_LIST -AtaPortGetScatterGatherList ( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__checkReturn -__drv_sameIRQL -IDE_PHYSICAL_ADDRESS -AtaPortGetPhysicalAddress ( - __in PVOID ChannelExtension, - __in_opt PIDE_REQUEST_BLOCK Irb, - __in_opt PVOID VirtualAddress, - __out_opt ULONG * Length - ); - -__checkReturn -__drv_sameIRQL -PVOID -AtaPortGetDeviceBase ( - __in PVOID ChannelExtension, - __in IDE_PHYSICAL_ADDRESS IoAddress, - __in ULONG NumberOfBytes - ); - -__drv_sameIRQL -VOID -AtaPortCompleteRequest( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__drv_sameIRQL -VOID -AtaPortCompleteAllActiveRequests( - __in PVOID ChannelExtension, - __in UCHAR Target, - __in UCHAR Lun, - __in UCHAR IrbStatus - ); - -__drv_sameIRQL -VOID -AtaPortNotification( - __in IDE_NOTIFICATION_TYPE NotificationType, - __in PVOID ChannelExtension, - ... - ); - -__drv_sameIRQL -VOID -AtaPortMoveMemory( - __out_bcount(Length) PVOID WriteBuffer, - __in_bcount(Length) PVOID ReadBuffer, - __in ULONG Length - ); - -__drv_sameIRQL -VOID -AtaPortCopyMemory( - __out_bcount(Length) PVOID WriteBuffer, - __in_bcount(Length) PVOID ReadBuffer, - __in ULONG Length - ); - -__drv_sameIRQL -IDE_PHYSICAL_ADDRESS -AtaPortConvertUlongToPhysicalAddress( - __in ULONG_PTR UlongAddress - ); - -__drv_sameIRQL -ULONG -AtaPortConvertPhysicalAddressToUlong( - __in IDE_PHYSICAL_ADDRESS Address - ); - -__drv_sameIRQL -VOID -AtaPortStallExecution( - __in ULONG Delay - ); - -__checkReturn -__drv_sameIRQL -PVOID -AtaPortGetUnCachedExtension ( - __in PVOID ChannelExtension, - __in ULONG UncachedExtensionSize, - __in ULONG IrbExtensionSize - ); - -VOID -AtaPortDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); - - -__drv_sameIRQL -VOID -AtaPortLogError( - __in PVOID ChannelExtension, - __in PIDE_ERROR_LOG_ENTRY ErrorLogEntry - ); - -__checkReturn -__drv_sameIRQL -PIDE_REQUEST_BLOCK -AtaPortBuildRequestSenseIrb( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__drv_sameIRQL -VOID -AtaPortReleaseRequestSenseIrb( - __in PVOID ChannelExtension, - __in PIDE_REQUEST_BLOCK Irb - ); - -__drv_sameIRQL -VOID -AtaPortDeviceStateChange ( - __in PVOID ChannelExtension, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG BusyTimeout - ); - -__checkReturn -__drv_sameIRQL -BOOLEAN -AtaPortRequestCallback ( - __in IDE_CALLBACK_TYPE CallbackType, - __in PVOID ChannelExtension, - __in IDE_HW_DPC CallBackRoutine, - __in ULONG TimerValue - ); - -__checkReturn -__drv_sameIRQL -__bcount_opt(BufferSize) -PVOID -AtaPortRegistryAllocateBuffer ( - __in PVOID ChannelExtension, - __in ULONG BufferSize - ); - -__drv_sameIRQL -VOID -AtaPortRegistryFreeBuffer ( - __in PVOID ChannelExtension, - __in PVOID Buffer - ); - -__checkReturn -__drv_sameIRQL -BOOLEAN -AtaPortInitializeQueueTag ( - __in PVOID DeviceExtension, - __in UCHAR TargetId, - __in UCHAR Lun, - __in UCHAR MaxQueueTag - ); - -__checkReturn -__drv_sameIRQL -UCHAR -AtaPortAllocateQueueTag ( - __in PVOID DeviceExtension, - __in UCHAR TargetId, - __in UCHAR Lun - ); - -__drv_sameIRQL -VOID -AtaPortReleaseQueueTag ( - __in PVOID DeviceExtension, - __in UCHAR TargetId, - __in UCHAR Lun, - __in UCHAR QueueTag - ); - -__checkReturn -__drv_sameIRQL -BOOLEAN -AtaPortRegistryRead ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in BOOLEAN ChannelSubKey, - __in PCHAR ValueName, - __in UCHAR ValueType, - __out_bcount_opt(*BufferLength) PUCHAR Buffer, - __inout PULONG BufferLength - ); - -__checkReturn -__drv_sameIRQL -BOOLEAN -AtaPortRegistryWrite ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in BOOLEAN ChannelSubKey, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in_bcount(*BufferLength) PUCHAR Buffer, - __in PULONG BufferLength - ); - -__checkReturn -__drv_sameIRQL -BOOLEAN -AtaPortRegistryWriteDeferred ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in BOOLEAN ChannelSubKey, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in_ecount(*BufferLength) PUCHAR Buffer, - __in PULONG BufferLength - ); - -VOID -__inline -AtaPortDeviceBusy ( - __in PVOID ChannelExtension, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG BusyTimeout - ) -{ - AtaPortDeviceStateChange(ChannelExtension, - TargetId, - Lun, - BusyTimeout - ); -} - -VOID -__inline -AtaPortDeviceReady ( - __in PVOID ChannelExtension, - __in UCHAR TargetId, - __in UCHAR Lun - ) -{ - AtaPortDeviceStateChange(ChannelExtension, - TargetId, - Lun, - 0 - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryControllerKeyRead ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __out_opt PUCHAR Buffer, - __inout PULONG BufferLength - ) -{ - return AtaPortRegistryRead (ChannelExtension, - ControllerNumber, - FALSE, - ValueName, - ValueType, - Buffer, - BufferLength - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryControllerKeyWrite ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in PUCHAR Buffer, - __in PULONG BufferLength - ) -{ - return AtaPortRegistryWrite (ChannelExtension, - ControllerNumber, - FALSE, - ValueName, - ValueType, - Buffer, - BufferLength - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryControllerKeyWriteDeferred ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in PUCHAR Buffer, - __in PULONG BufferLength - ) -{ - return AtaPortRegistryWriteDeferred (ChannelExtension, - ControllerNumber, - FALSE, - ValueName, - ValueType, - Buffer, - BufferLength - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryChannelSubkeyRead ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __out_opt PUCHAR Buffer, - __inout PULONG BufferLength - ) -{ - return AtaPortRegistryRead (ChannelExtension, - ControllerNumber, - TRUE, - ValueName, - ValueType, - Buffer, - BufferLength - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryChannelSubkeyWrite ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in PUCHAR Buffer, - __in PULONG BufferLength - ) -{ - return AtaPortRegistryWrite (ChannelExtension, - ControllerNumber, - TRUE, - ValueName, - ValueType, - Buffer, - BufferLength - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRegistryChannelSubkeyWriteDeferred ( - __in PVOID ChannelExtension, - __in UCHAR ControllerNumber, - __in PCHAR ValueName, - __in UCHAR ValueType, - __in PUCHAR Buffer, - __in PULONG BufferLength - ) -{ - return AtaPortRegistryWriteDeferred (ChannelExtension, - ControllerNumber, - TRUE, - ValueName, - ValueType, - Buffer, - BufferLength - ); - -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRequestWorkerRoutine ( - __in PVOID ChannelExtension, - __in IDE_HW_DPC CallBackRoutine - ) -{ - return AtaPortRequestCallback (IdeWorkerRoutine, - ChannelExtension, - CallBackRoutine, - 0 - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRequestSynchronizedRoutine ( - __in PVOID ChannelExtension, - __in IDE_HW_DPC CallBackRoutine - ) -{ - return AtaPortRequestCallback (IdeSynchronizedRoutine, - ChannelExtension, - CallBackRoutine, - 0 - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortControllerSyncRoutine ( - __in PVOID ChannelExtension, - __in IDE_HW_DPC CallBackRoutine - ) -{ - return AtaPortRequestCallback (IdeControllerSyncRoutine, - ChannelExtension, - CallBackRoutine, - 0 - ); -} - -__checkReturn -__drv_sameIRQL -BOOLEAN -__inline -AtaPortRequestTimer ( - __in PVOID ChannelExtension, - __in IDE_HW_DPC CallBackRoutine, - __in ULONG TimerValue - ) -{ - return AtaPortRequestCallback(IdeTimerRoutine, - ChannelExtension, - CallBackRoutine, - TimerValue - ); -} - -VOID -__inline -AtaPortBusChangeDetected ( - __in PVOID ChannelExtension - ) -{ - AtaPortNotification(IdeDeviceArrival, - ChannelExtension, - IDE_UNTAGGED, - 0 - ); -} - - -VOID -__inline -AtaPortDeviceArrived ( - __in PVOID ChannelExtension, - __in UCHAR TargetId - ) -{ - AtaPortNotification(IdeDeviceArrival, - ChannelExtension, - TargetId, - 0 - ); -} - -VOID -__inline -AtaPortDeviceRemoved ( - __in PVOID ChannelExtension, - __in UCHAR TargetId - ) -{ - AtaPortNotification(IdeDeviceRemoval, - ChannelExtension, - TargetId, - 0 - ); -} - -VOID -__inline -AtaPortRequestPowerStateChange ( - __in PVOID ChannelExtension, - __in UCHAR TargetId, - __in UCHAR Lun, - __in IDE_POWER_STATE DesiredPowerState - ) -{ - AtaPortNotification(IdePowerStateChange, - ChannelExtension, - TargetId, - Lun, - DesiredPowerState - ); -} - -__drv_sameIRQL -VOID -AtaPortQuerySystemTime ( - __out PLARGE_INTEGER CurrentTime - ); - -VOID -AtaPortDebugBreak ( - __in PVOID ChannelExtension - ); - -VOID -AtaPortTraceNotification( - __in ULONG NotificationType, - __in_opt PVOID HwDeviceExtension, - ... - ); - -// -// The below I/O access routines should be forwarded to the HAL or NTOSKRNL on -// Intel platforms. -// -UCHAR -AtaPortReadPortUchar( - __in PUCHAR Port - ); - -USHORT -AtaPortReadPortUshort( - __in PUSHORT Port - ); - -ULONG -AtaPortReadPortUlong( - __in PULONG Port - ); - -VOID -AtaPortReadPortBufferUchar( - __in PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -AtaPortReadPortBufferUshort( - __in PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -AtaPortReadPortBufferUlong( - __in PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -UCHAR -AtaPortReadRegisterUchar( - __in PUCHAR Register - ); - -USHORT -AtaPortReadRegisterUshort( - __in PUSHORT Register - ); - -ULONG -AtaPortReadRegisterUlong( - __in PULONG Register - ); - -VOID -AtaPortReadRegisterBufferUchar( - __in PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -AtaPortReadRegisterBufferUshort( - __in PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -AtaPortReadRegisterBufferUlong( - __in PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -VOID -AtaPortWritePortUchar( - __in PUCHAR Port, - __in UCHAR Value - ); - -VOID -AtaPortWritePortUshort( - __in PUSHORT Port, - __in USHORT Value - ); - -VOID -AtaPortWritePortUlong( - __in PULONG Port, - __in ULONG Value - ); - -VOID -AtaPortWritePortBufferUchar( - __in PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -AtaPortWritePortBufferUshort( - __in PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -AtaPortWritePortBufferUlong( - __in PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - - -VOID -AtaPortWriteRegisterUchar( - __in PUCHAR Register, - __in UCHAR Value - ); - -VOID -AtaPortWriteRegisterUshort( - __in PUSHORT Register, - __in USHORT Value - ); - -VOID -AtaPortWriteRegisterBufferUchar( - __in PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -AtaPortWriteRegisterBufferUshort( - __in PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -AtaPortWriteRegisterBufferUlong( - __in PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -VOID -AtaPortWriteRegisterUlong( - __in PULONG Register, - __in ULONG Value - ); - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#pragma warning(default:4214) -#endif - -#endif - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - diff --git a/qt-correction-tool/pub/ddk/irclass_ioctl.h b/qt-correction-tool/pub/ddk/irclass_ioctl.h deleted file mode 100644 index a92ce8b..0000000 --- a/qt-correction-tool/pub/ddk/irclass_ioctl.h +++ /dev/null @@ -1,634 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Copyright 2005 OSR, Open Systems Resources, Inc. All rights Reserved. -// -// Module Name: -// -// irclass_ioctl.h -// -// Abstract: -// -// This module contains the IOCTL definitions for the -// WDF IRCLASS class driver -// -// -// Author: -// -// Revision History: -// -#ifndef __IRCLASS_IOCTL_H__ -#define __IRCLASS_IOCTL_H__ - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// disable warnings -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - -#define FILE_DEVICE_IRCLASS 0x0F60 - -// -// This value is defined in wdm.h, but user mode code shouldn't include wdm.h, -// so we define this here. -// -#ifndef MAXIMUM_FILENAME_LENGTH -#define MAXIMUM_FILENAME_LENGTH 256 -#endif - -/*++ - - IOCTL_IR_GET_DEVCAPS - - Returns device capabilities. For legacy devices, the Capabilities - registry entry can be used to populate this structure. For new devices, - the implementation is left as an exercise for the reader. - - The capabilities structure gets rev'ed when new capabilities are - added to the class driver. The class driver sends the largest possible - structure size to the port driver. The port driver populates the - capabilties structure, including the ProtocolVersion member. The - class driver then uses the ProtocolVersion member to decide which - version of IR_DEV_CAPS the port driver has filled in. - - Used in IR DDI Versions: V1, V2 - - V1: port driver must set ProtocolVersion to 0x100 and fill in - required members of IR_DEV_CAPS_V1 structure. - - V2: port driver must set ProtocolVersion to 0x200 and fill in - required members of IR_DEV_CAPS_V2 structure - - Parameters: - - lpOutBuffer - pointer to caller-allocated IR_DEV_CAPS_V2 structure - - nOutBufferSize - sizeof (IR_DEV_CAPS_V2) - ---*/ - -#define IOCTL_IR_GET_DEV_CAPS CTL_CODE(FILE_DEVICE_IRCLASS, \ - 1, \ - METHOD_BUFFERED, \ - FILE_READ_ACCESS) - -// -// IR_DEV_CAPS - This is the older version of teh IR_DEV_CAPS -// structure. This is here for historical reasons. New drivers should -// use the full IR_DEV_CAPS_V2 structure. -// -typedef struct _IR_DEV_CAPS { - - // - // Protocol version. Must be 100 (1.0) if using the IR_DEV_CAPS - // structure. - // - /* out */ ULONG_PTR ProtocolVersion; - - // - // Number of transmit ports - 0-32 - // - /* out */ ULONG_PTR NumTransmitPorts; - - // - // Number of receive ports - 0-32 (for snowflake, - // this would be one. For beanbag, this would be - // two (one for learning, one for normal) - // - /* out */ ULONG_PTR NumReceivePorts; - - // - // Bitmask identifying which receivers are - // learning receivers - low bit is the first - // receiver, second-low bit is the second receiver, - // etc - // - /* out */ ULONG_PTR LearningReceiverMask; - - // - // Flags - // - /* out */ ULONG_PTR DevCapsFlags; - -}IR_DEV_CAPS, *PIR_DEV_CAPS; - -typedef IR_DEV_CAPS IR_DEV_CAPS_V1, *PIR_DEV_CAPS_V1; - -#define DEV_CAPS_PROTOCOL_VERSION 0x100 -#define DEV_CAPS_PROTOCOL_VERSION_V1 0x100 - -// -// Valid capabilities bits for protocol V1 -// -#define DEV_CAPS_SUPPORTS_LEGACY_SIGNING 0x1 -#define DEV_CAPS_HAS_UNIQUE_SERIAL 0x2 -#define DEV_CAPS_CAN_FLASH_RECEIVER_LED 0x4 -#define DEV_CAPS_IS_LEGACY 0x8 - -#define V1_DEV_CAPS_VALID_BITS 0xf - - -// -// IR_DEV_CAPS_V2 - This is the full capabilties structure. Drivers -// should use this version whenever possible. The port -// driver must set ProtocolVersion to 0x200 (2.00) if using this -// strucutre. -// -// -// IR_DEV_CAPS_V2 is an extension of IR_DEV_CAPS_V1. This is expressed -// differently between C and C++. -// -#ifdef __cplusplus - -typedef struct _IR_DEV_CAPS_V2 : - public IR_DEV_CAPS_V1 { - -#else - -typedef struct _IR_DEV_CAPS_V2 { - IR_DEV_CAPS_V1; - -#endif - - // - // Bitmask with supported wake protocols - // - /* out */ ULONG_PTR WakeProtocols; - - // - // PNP ID for affiliated tuner. Only valid if - // DEV_CAPS_V2_ATTACHED_TO_TUNER is set. - // - /* out */ WCHAR TunerPnpId[MAXIMUM_FILENAME_LENGTH] ; - -} IR_DEV_CAPS_V2, *PIR_DEV_CAPS_V2; - -#define DEV_CAPS_PROTOCOL_VERSION_V2 0x200 - -// -// Valid capabilities bits for protocol V2 -// - -#define V2_DEV_CAPS_SUPPORTS_WAKE 0x10 -#define V2_DEV_CAPS_MULTIPLE_WAKE 0x20 -#define V2_DEV_CAPS_PROGRAMMABLE_WAKE 0x40 -#define V2_DEV_CAPS_VOLATILE_WAKE_PATTERN 0x80 - -#define V2_DEV_CAPS_LEARNING_ONLY 0x100 -#define V2_DEV_CAPS_NARROW_BPF 0x200 -#define V2_DEV_CAPS_NO_SWDECODE_INPUT 0x400 -#define V2_DEV_CAPS_HWDECODE_INPUT 0x800 - -#define V2_DEV_CAPS_EMULATOR_V1 0x1000 -#define V2_DEV_CAPS_EMULATOR_V2 0x2000 -#define V2_DEV_CAPS_ATTACHED_TO_TUNER 0x4000 - -#define V2_DEV_CAPS_VALID_BITS 0x7fff - -// -// Wake protocols -// -#define V2_WAKE_PROTOCOL_RC6 0x1 -#define V2_WAKE_PROTOCOL_QP 0x2 -#define V2_WAKE_PROTOCOL_SAMSUNG 0x4 -#define V2_WAKE_PROTOCOL_DONTCARE 0x8 - -#define V2_VALID_WAKE_PROTOCOLS 0xf - -/*++ - - IOCTL_IR_GET_EMITTERS - - Gets attached emitters and returns the information in a bitmask. - Information returned in lpOutBuffer. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpOutBuffer - pointer to caller-allocated buffer sizeof(ULONG) - - nOutBufferSize - sizeof(ULONG) - ---*/ -#define IOCTL_IR_GET_EMITTERS CTL_CODE(FILE_DEVICE_IRCLASS, \ - 2, \ - METHOD_BUFFERED, \ - FILE_READ_ACCESS) - - -/*++ - - IOCTL_IR_FLASH_RECEIVER - - Flash an LED on the given receiver. Used to tell the user where to point - their remote, so a given "receiver box" with multiple receiver parts only - needs one LED to flash. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpInBuffer - pointer to caller-allocated buffer sizeof(ULONG) with - bitmask of receivers to flash - - nInBufferSize - sizeof(ULONG) - ---*/ -#define IOCTL_IR_FLASH_RECEIVER CTL_CODE(FILE_DEVICE_IRCLASS, \ - 3, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - - -/*++ - - IOCTL_IR_RESET_DEVICE - - Resets the given device. When a device is reset, all pending transmit and - receive IOCTLs are cancelled by the class driver - - Used in IR DDI Versions: V1, V2 - - Parameters: - ---*/ -#define IOCTL_IR_RESET_DEVICE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 4, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - - -/*++ - - IOCTL_IR_TRANSMIT - - - Transmits the given IR stream on the given port(s) at the given carrier - frequency. On legacy devices, this maintains the pre-existing carrier - frequency, port masks, and sample period values. (ie. it gets the old - values, changes them, transmits, and then changes them back.) - - This IOCTL is synchronous. It does not return until the IR has actually - been transmitted. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpInBuffer - pointer to caller-allocated IR_TRANSMIT_PARAMS structure - - nInBufferSize - sizeof(IR_TRANSMIT_PARAMS) - - lpOutBuffer - pointer to caller-allocated IR_TRANSMIT_CHUNCK that contains - the data to be transmitted - - nOutBufferSize - size of caller-allocated buffer. - ---*/ -#define IOCTL_IR_TRANSMIT CTL_CODE(FILE_DEVICE_IRCLASS, \ - 5, \ - METHOD_IN_DIRECT, \ - FILE_WRITE_ACCESS) - - -typedef struct _IR_TRANSMIT_PARAMS { - - // - // Bitmask containing ports to transmit on. - // - /* in */ ULONG_PTR TransmitPortMask; - - // - // Carrier period to use. If zero, Flags - // needs to define DC mode or pulse mode. - // - /* in */ ULONG_PTR CarrierPeriod; - - // - // Flags - // - /* in */ ULONG_PTR Flags; - - // - // If pulse mode is set, this contains the length of pulse - // to use. - // - /* in */ ULONG_PTR PulseSize; - -} IR_TRANSMIT_PARAMS, *PIR_TRANSMIT_PARAMS; - -#define TRANSMIT_FLAGS_PULSE_MODE 0x0001 -#define TRANSMIT_FLAGS_DC_MODE 0x0002 - -typedef struct _IR_TRANSMIT_CHUNK { - - // - // offset, in bytes, from Data member of this buffer to next - // IR_TRANSMIT_CHUNK (or zero if no more chunks in buffer) - // - ULONG_PTR OffsetToNextChunk; - - // - // number of times to serially repeat "ByteCount" bytes of data - // - ULONG_PTR RepeatCount; - - // - // count of data bytes to be sent - // - ULONG_PTR ByteCount; - - // - // First byte of "ByteCount" bytes of data. - // Note: Each chunk is filled to integral ULONG_PTR boundary - // - LONG Data[1]; - -} IR_TRANSMIT_CHUNK, *PIR_TRANSMIT_CHUNK; - - -/*++ - - IOCTL_IR_RECEIVE - - Receives IR. Does not return until IR is available. If there is no more IR - data available than space in the buffer, IrReceiveParms->DataEnd is set to - TRUE. The provided timeout is used to define the end of a keypress. So, - once the driver starts receiving IR from the hardware, it will continue to - add it to the buffer until the specified time passes with no IR. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpOutBuffer - pointer to caller-allocated IR_RECEIVE_PARAMS structure - - nOutBufferSize - sizeof(IR_RECEIVE_PARAMS) - ---*/ -#define IOCTL_IR_RECEIVE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 6, \ - METHOD_OUT_DIRECT, \ - FILE_READ_ACCESS) - -typedef struct _IR_RECEIVE_PARAMS { - - // - // Does this receive represent a data end event? - // - /* out */ ULONG_PTR DataEnd; - - // - // Size of the data buffer - // - /* in */ ULONG_PTR ByteCount; - - // - // The data buffer itself. - // - /* out */ LONG Data[1]; - -}IR_RECEIVE_PARAMS, *PIR_RECEIVE_PARAMS; - - -/*++ - - IOCTL_IR_PRIORITY_RECEIVE - - This request is sent from CIRClass and receives Run Length Coded (RLC) IR - data when the device is running in Priority Receive mode. If the device is - not already in Priority Receive mode, initiated by having previously - received an IOCTL_ENTER_PRIORITY_RECEIVE, the CIR Port driver fails this - request immediately. If in Priority Receive mode, the request will remain - pending until one of two events occurs: - - 1) The data buffer provided in the request has been completely filled with - data. - - 2) An IR timeout occurs. The length of time required for the IR timeout was - specified when entering Priority Receive mode. - - While in Priority Receive mode and processing IOCTL_IR_PRIORITY_RECEIVE - requests, IOCTL_IR_RECEIVE requests remain pending and are not filled with - IR data. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpOutBuffer - pointer to caller-allocated IR_PRIORITY_RECEIVE_PARAMS structure - - nOutBufferSize - sizeof(IR_PRIORITY_RECEIVE_PARAMS) - ---*/ -#define IOCTL_IR_PRIORITY_RECEIVE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 8, \ - METHOD_OUT_DIRECT, \ - FILE_READ_ACCESS) - -typedef struct _IR_PRIORITY_RECEIVE_PARAMS { - - // - // Does this receive represent a data end event? - // - /* out */ ULONG_PTR DataEnd; - - // - // Size of the data buffer - // - /* in */ ULONG_PTR ByteCount; - - // - // Carrier frequency (only valid if DataEnd != 0) - // - /* out */ ULONG_PTR CarrierFrequency; - - // - // The data buffer itself. - // - /* in */ LONG Data[1]; - -}IR_PRIORITY_RECEIVE_PARAMS, *PIR_PRIORITY_RECEIVE_PARAMS; - -/*++ - - IOCTL_IR_HANDSHAKE - - This IOCTL is sent from CIRClass before creating the HID child device to - represent the port. This IOCTL is to be completed synchronously by the - port as an indication that it is prepared to return RLC IR data to the - class driver. - - Used in IR DDI Versions: V1, V2 - - Parameters: - ---*/ -#define IOCTL_IR_HANDSHAKE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 9, \ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) -/*++ - - IOCTL_IR_ENTER_PRIORITY_RECEIVE - - This request is sent to prepare the port to enter Priority Receive mode. - While the device is in Priority Receive mode, all IOCTL_IR_RECEIVE requests - should be starved and IOCTL_IR_PRIORITY_RECEIVE requests should be - completed. - - Used in IR DDI Versions: V1, V2 - - Parameters: - - lpOutBuffer - pointer to caller-allocated IOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS structure - - nOutBufferSize - sizeof(IOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS) - ---*/ -#define IOCTL_IR_ENTER_PRIORITY_RECEIVE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 10, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - -typedef struct _IOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS { - - // - // Index of the receiver to use - // - /* in */ ULONG_PTR Receiver; - - // - // Timeout value, in micsec. Used to define - // the end of a given sample. - // - /* in */ ULONG_PTR TimeOut; - -}IOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS, *PIOCTL_IR_ENTER_PRIORITY_RECEIVE_PARAMS; - - -/*++ - - IOCTL_IR_EXIT_PRIORITY_RECEIVE - - This request is sent to end Priority Receive mode. Upon receipt of the - request, the port should abort any outstanding IOCTL_IR_PRIORITY_RECEIVE - requests and fail any future IOCTL_IR_PRIORITY_RECEIVE requests (before - receiving a new IOCTL_IR_ENTER_PRIORITY_RECEIVE request). As a result of - receiving this IOCTL, the CIR Port driver is responsible for restoring the - device to the state that it was in before receipt of the - IOCTL_IR_ENTER_PRIORITY_RECEIVE. - - Used in IR DDI Versions: V1, V2 - - Parameters: - ---*/ -#define IOCTL_IR_EXIT_PRIORITY_RECEIVE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 11, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - -/*++ - - IOCTL_IR_USER_OPEN - - This IOCTL is sent from the class driver when a user has indirectly opened - the port driver through IRCLASS. This IOCTL is informational only, allowing - the port to do any initialization or bookkeeping required to handle - requests not directly originating from IRCLASS. - - Used in IR DDI Versions: V1, V2 - - Parameters: - ---*/ -#define IOCTL_IR_USER_OPEN CTL_CODE(FILE_DEVICE_IRCLASS, \ - 12, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - - -/*++ - - IOCTL_IR_USER_CLOSE - - This IOCTL is sent from IRCLASS when a user has indirectly closed the port - driver. This IOCTL is informational only, allowing the port to do any - cleanup required when closed by a user. - - Used in IR DDI Versions: V1, V2 - - Parameters: - ---*/ -#define IOCTL_IR_USER_CLOSE CTL_CODE(FILE_DEVICE_IRCLASS, \ - 13, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - -/*++ - - IOCTL_IR_SET_WAKE_PATTERN - - This IOCTL is sent from IRCLASS to configure the wake pattern. This is - done dynamically in response to user input, so it could be done at any - time. - - Used in IR DDI Versions: V2 only - - Parameters: - - lpInBuffer - pointer to caller-allocated IR_SET_WAKE_PATTERN_PARAMS structure - - nInBufferSize - sizeof(IR_SET_WAKE_PATTERN_PARAMS) - ---*/ -#define IOCTL_IR_SET_WAKE_PATTERN CTL_CODE(FILE_DEVICE_IRCLASS, \ - 14, \ - METHOD_BUFFERED, \ - FILE_WRITE_ACCESS) - -typedef struct _IOCTL_IR_SET_WAKE_PATTERN_PARAMS { - - // - // Protocol to wake on. One of the V2_WAKE_PROTOCOL_* values. - // - /* in */ ULONG Protocol; - - // - // Key code to wake on. WAKE_CODE_ALL_KEYS to wake on all keys. See - // WAKE_KEY_* for valid values. - // - /* in */ ULONG Payload; - - // - // Address to wake on. The device may ignore this, but we tell them - // anyway. - // - /* in */ ULONG Address; -} IR_SET_WAKE_PATTERN_PARAMS, *PIR_SET_WAKE_PATTERN_PARAMS; - -// -// Valid wake keys. A good implementation will be able to wake on all key -// codes but this is not required. -// -#define WAKE_KEY_POWER_TOGGLE 0x0C -#define WAKE_KEY_DISCRETE_ON 0x29 -#define WAKE_KEY_ALL_KEYS 0xffff - -//re-enable warnings -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -// #pragma warning(default:4214) -#endif - - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#endif // __IRCLASS_IOCTL_H__ - diff --git a/qt-correction-tool/pub/ddk/iscsicfg.h b/qt-correction-tool/pub/ddk/iscsicfg.h deleted file mode 100644 index 654c329..0000000 --- a/qt-correction-tool/pub/ddk/iscsicfg.h +++ /dev/null @@ -1,388 +0,0 @@ -#ifndef _iscsicfg_h_ -#define _iscsicfg_h_ - -// MSiSCSI_TCPIPConfig - MSiSCSI_TCPIPConfig - - -//*************************************************************************** -// -// iscsicfg.h -// -// Module: iScsi Discovery api -// -// Purpose: Header defining interface between user mode configuration -// apps and HBA driver miniport. -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -#include - -// -// -// This class is required. -// -// TCP/IP configuration class, implement one instance for each IP address on -// your adapter. For example, if you adapter supports 3 IP addresses then -// your adapter would implement 3 instances of this class. -// -// This class uses PDO instance names with 1 instance for each TCP/IP interface. -// - -#define MSiSCSI_TCPIPConfigGuid \ - { 0x7a2c6c2b,0xe5a5,0x49ad, { 0xad,0x68,0x13,0x30,0x89,0xac,0xd7,0x4d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_TCPIPConfig_GUID, \ - 0x7a2c6c2b,0xe5a5,0x49ad,0xad,0x68,0x13,0x30,0x89,0xac,0xd7,0x4d); -#endif - - -typedef struct _MSiSCSI_TCPIPConfig -{ - // TRUE if the adapter should use an autogenerated and non routable (link local) address as its IP address. - BOOLEAN UseLinkLocalAddress; - #define MSiSCSI_TCPIPConfig_UseLinkLocalAddress_SIZE sizeof(BOOLEAN) - #define MSiSCSI_TCPIPConfig_UseLinkLocalAddress_ID 1 - - // TRUE if the adapter should use DHCP to discovery its IP address information. - BOOLEAN EnableDHCP; - #define MSiSCSI_TCPIPConfig_EnableDHCP_SIZE sizeof(BOOLEAN) - #define MSiSCSI_TCPIPConfig_EnableDHCP_ID 2 - - // TRUE if the adapter should use DHCP to discover DNS addresses. - BOOLEAN UseDHCPForDNS; - #define MSiSCSI_TCPIPConfig_UseDHCPForDNS_SIZE sizeof(BOOLEAN) - #define MSiSCSI_TCPIPConfig_UseDHCPForDNS_ID 3 - - // IP Versions supported **Add #defines** - ULONG IPVersions; - #define MSiSCSI_TCPIPConfig_IPVersions_SIZE sizeof(ULONG) - #define MSiSCSI_TCPIPConfig_IPVersions_ID 4 - - // IP address of the adapter - ISCSI_IP_Address IpAddress; - #define MSiSCSI_TCPIPConfig_IpAddress_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_TCPIPConfig_IpAddress_ID 5 - - // Static Default Gateway IP address - ISCSI_IP_Address DefaultGateway; - #define MSiSCSI_TCPIPConfig_DefaultGateway_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_TCPIPConfig_DefaultGateway_ID 6 - - // Static Subnet Mask - ISCSI_IP_Address SubnetMask; - #define MSiSCSI_TCPIPConfig_SubnetMask_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_TCPIPConfig_SubnetMask_ID 7 - - // Preferred DNS Server - ISCSI_IP_Address PreferredDNSServer; - #define MSiSCSI_TCPIPConfig_PreferredDNSServer_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_TCPIPConfig_PreferredDNSServer_ID 8 - - // Alternate DNS Server - ISCSI_IP_Address AlternateDNSServer; - #define MSiSCSI_TCPIPConfig_AlternateDNSServer_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_TCPIPConfig_AlternateDNSServer_ID 9 - -} MSiSCSI_TCPIPConfig, *PMSiSCSI_TCPIPConfig; - -#define MSiSCSI_TCPIPConfig_SIZE (FIELD_OFFSET(MSiSCSI_TCPIPConfig, AlternateDNSServer) + MSiSCSI_TCPIPConfig_AlternateDNSServer_SIZE) - -// MSiSCSI_NICConfig - MSiSCSI_NICConfig - -// -// This class is optional. -// -// NIC Port configuration class, implement one instance for each physical -// network interface port on your adapter. -// -// This class uses PDO instance names with 1 instance for each physical -// network interface port on your adapter. -// - -typedef enum -{ - ISCSI_NIC_LINKSTATE_DISCONNECTED = 0, - ISCSI_NIC_LINKSTATE_CONNECTED = 1 -} ISCSI_NIC_LINKSTATE, *PISCSI_NIC_LINKSTATE; - -#define MSiSCSI_NICConfigGuid \ - { 0xc75258e9,0xbe79,0x4a48, { 0xa2,0x3d,0xee,0xb6,0xf8,0xfb,0x94,0x0c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_NICConfig_GUID, \ - 0xc75258e9,0xbe79,0x4a48,0xa2,0x3d,0xee,0xb6,0xf8,0xfb,0x94,0x0c); -#endif - - -typedef struct _MSiSCSI_NICConfig -{ - // Speed of network link in megabits per second. - ULONG LinkSpeed; - #define MSiSCSI_NICConfig_LinkSpeed_SIZE sizeof(ULONG) - #define MSiSCSI_NICConfig_LinkSpeed_ID 1 - - // Maximum Speed of network link in megabits per second. - ULONG MaxLinkSpeed; - #define MSiSCSI_NICConfig_MaxLinkSpeed_SIZE sizeof(ULONG) - #define MSiSCSI_NICConfig_MaxLinkSpeed_ID 2 - - // Link State **typedef** - ULONG LinkState; - #define MSiSCSI_NICConfig_LinkState_SIZE sizeof(ULONG) - #define MSiSCSI_NICConfig_LinkState_ID 3 - - // Maximum frame size - ULONG MaxFrameSize; - #define MSiSCSI_NICConfig_MaxFrameSize_SIZE sizeof(ULONG) - #define MSiSCSI_NICConfig_MaxFrameSize_ID 4 - - // Ethernet MAC Address - UCHAR MacAddress[6]; - #define MSiSCSI_NICConfig_MacAddress_SIZE sizeof(UCHAR[6]) - #define MSiSCSI_NICConfig_MacAddress_ID 5 - -} MSiSCSI_NICConfig, *PMSiSCSI_NICConfig; - -#define MSiSCSI_NICConfig_SIZE (FIELD_OFFSET(MSiSCSI_NICConfig, MacAddress) + MSiSCSI_NICConfig_MacAddress_SIZE) - -// MSiSCSI_BootConfiguration - MSiSCSI_BootConfiguration - -// -// This class is optional. -// -// This class exposes the boot configuration if the adapter is configured to -// boot from an iSCSI disk. -// -// This class uses PDO instance names with a single instance. -// - -#define MSiSCSI_BootConfigurationGuid \ - { 0x53ef8d5f,0x36f3,0x4124, { 0x8b,0x76,0xc6,0xad,0x52,0x1a,0x10,0x21 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_BootConfiguration_GUID, \ - 0x53ef8d5f,0x36f3,0x4124,0x8b,0x76,0xc6,0xad,0x52,0x1a,0x10,0x21); -#endif - - -typedef struct _MSiSCSI_BootConfiguration -{ - // LUN on target to use as boot device. - ULONGLONG LUN; - #define MSiSCSI_BootConfiguration_LUN_SIZE sizeof(ULONGLONG) - #define MSiSCSI_BootConfiguration_LUN_ID 1 - - // Security flags - ULONGLONG SecurityFlags; - #define MSiSCSI_BootConfiguration_SecurityFlags_SIZE sizeof(ULONGLONG) - #define MSiSCSI_BootConfiguration_SecurityFlags_ID 2 - - // Size in bytes of Target Username. - ULONG UsernameSize; - #define MSiSCSI_BootConfiguration_UsernameSize_SIZE sizeof(ULONG) - #define MSiSCSI_BootConfiguration_UsernameSize_ID 3 - - // Size in bytes of Target Password. - ULONG PasswordSize; - #define MSiSCSI_BootConfiguration_PasswordSize_SIZE sizeof(ULONG) - #define MSiSCSI_BootConfiguration_PasswordSize_ID 4 - - // If TRUE dynamically discover boot device. - BOOLEAN DiscoverBootDevice; - #define MSiSCSI_BootConfiguration_DiscoverBootDevice_SIZE sizeof(BOOLEAN) - #define MSiSCSI_BootConfiguration_DiscoverBootDevice_ID 5 - - // The InitiatorNode specifies the iSCSI name of the initiator node to use for the connection. If empty, then the adapter can choose any initiator node name. - WCHAR InitiatorNode[223 + 1]; - #define MSiSCSI_BootConfiguration_InitiatorNode_ID 6 - - // TargetName specifies the iSCSI target name on which the boot device resides. - WCHAR TargetName[223 + 1]; - #define MSiSCSI_BootConfiguration_TargetName_ID 7 - - // Target portal to use for connection to the target. - ISCSI_TargetPortal TargetPortal; - #define MSiSCSI_BootConfiguration_TargetPortal_SIZE sizeof(ISCSI_TargetPortal) - #define MSiSCSI_BootConfiguration_TargetPortal_ID 8 - - // Options that affect how login is performed. See ISCSI_LoginOptions - ISCSI_LoginOptions LoginOptions; - #define MSiSCSI_BootConfiguration_LoginOptions_SIZE sizeof(ISCSI_LoginOptions) - #define MSiSCSI_BootConfiguration_LoginOptions_ID 9 - - // **extra fields** Authentication Username, for CHAP this is the CHAP Name (CHAP_N) use when authenticating with the target. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. - UCHAR Username[1]; - #define MSiSCSI_BootConfiguration_Username_ID 10 - - // Authentication Password, for CHAP this is the shared secret to use when generating the response to the target challange. This field is a variable length array. -// UCHAR Password[1]; - #define MSiSCSI_BootConfiguration_Password_ID 11 - -} MSiSCSI_BootConfiguration, *PMSiSCSI_BootConfiguration; - -// MSiSCSI_SecurityCapabilities - MSiSCSI_SecurityCapabilities - -// -// This class is required if adapter supports IPSEC. -// -// This class exposes the security capabilities if the adapter -// supports IPSEC. -// -// This class uses PDO instance names with a single instance. -// -typedef enum { - ISCSI_ENCRYPT_NONE = 0, - ISCSI_ENCRYPT_3DES_HMAC_SHA1 = 1, - ISCSI_ENCRYPT_AES_CTR = 2 -} ISCSI_ENCRYPTION_TYPES, *PISCSI_ENCRYPTION_TYPES; - - -#define MSiSCSI_SecurityCapabilitiesGuid \ - { 0x225b9d64,0x47a9,0x41c8, { 0x81,0xcd,0x69,0xbc,0x02,0x65,0x2d,0x87 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_SecurityCapabilities_GUID, \ - 0x225b9d64,0x47a9,0x41c8,0x81,0xcd,0x69,0xbc,0x02,0x65,0x2d,0x87); -#endif - - -typedef struct _MSiSCSI_SecurityCapabilities -{ - // TRUE if the adapter can use IPSEC to protect iSCSI traffic. - BOOLEAN ProtectiScsiTraffic; - #define MSiSCSI_SecurityCapabilities_ProtectiScsiTraffic_SIZE sizeof(BOOLEAN) - #define MSiSCSI_SecurityCapabilities_ProtectiScsiTraffic_ID 1 - - // TRUE if the adapter can use IPSEC to protect iSNS traffic. - BOOLEAN ProtectiSNSTraffic; - #define MSiSCSI_SecurityCapabilities_ProtectiSNSTraffic_SIZE sizeof(BOOLEAN) - #define MSiSCSI_SecurityCapabilities_ProtectiSNSTraffic_ID 2 - - // TRUE if adapter supports certificates - BOOLEAN CertificatesSupported; - #define MSiSCSI_SecurityCapabilities_CertificatesSupported_SIZE sizeof(BOOLEAN) - #define MSiSCSI_SecurityCapabilities_CertificatesSupported_ID 3 - - // Number of encryption types available. - ULONG EncryptionAvailableCount; - #define MSiSCSI_SecurityCapabilities_EncryptionAvailableCount_SIZE sizeof(ULONG) - #define MSiSCSI_SecurityCapabilities_EncryptionAvailableCount_ID 4 - - // **typedef** Array of encryption types. This field is a variable length array. - ULONG EncryptionAvailable[1]; - #define MSiSCSI_SecurityCapabilities_EncryptionAvailable_ID 5 - -} MSiSCSI_SecurityCapabilities, *PMSiSCSI_SecurityCapabilities; - -// MSiSCSI_DiscoveryConfig - MSiSCSI_DiscoveryConfig - -// -// This class is required. -// -// This class exposes the configuration capabilities for the adapter to be able to -// perform target discovery. An adapter needs to support target discovery -// if it is ever placed on a separate network from the PC NIC. Although -// the iSCSI Initiator service can use this class with any discovery mechanism -// the best results are obtained by using iSNS. -// -// This class uses PDO instance names with a single instance. -// - -#define MSiSCSI_DiscoveryConfigGuid \ - { 0x45755098,0x4291,0x43df, { 0x97,0x20,0xb5,0x86,0x42,0xdd,0x63,0xdf } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_DiscoveryConfig_GUID, \ - 0x45755098,0x4291,0x43df,0x97,0x20,0xb5,0x86,0x42,0xdd,0x63,0xdf); -#endif - - -typedef struct _MSiSCSI_DiscoveryConfig -{ - // TRUE if adapter should perform target discovery via iSNS. - BOOLEAN PerformiSNSDiscovery; - #define MSiSCSI_DiscoveryConfig_PerformiSNSDiscovery_SIZE sizeof(BOOLEAN) - #define MSiSCSI_DiscoveryConfig_PerformiSNSDiscovery_ID 1 - - // TRUE if adapter should perform target discovery via SLP. - BOOLEAN PerformSLPDiscovery; - #define MSiSCSI_DiscoveryConfig_PerformSLPDiscovery_SIZE sizeof(BOOLEAN) - #define MSiSCSI_DiscoveryConfig_PerformSLPDiscovery_ID 2 - - // TRUE if adapter should perform automatic discovery of iSNS server. - BOOLEAN AutomaticiSNSDiscovery; - #define MSiSCSI_DiscoveryConfig_AutomaticiSNSDiscovery_SIZE sizeof(BOOLEAN) - #define MSiSCSI_DiscoveryConfig_AutomaticiSNSDiscovery_ID 3 - - // Default initiator name for registering with iSNS. - WCHAR InitiatorName[256 + 1]; - #define MSiSCSI_DiscoveryConfig_InitiatorName_ID 4 - - // If AutomaticiSNSDiscovery is FALSE then this contains the fixed addresses of iSNS servers - ISCSI_IP_Address iSNSServer; - #define MSiSCSI_DiscoveryConfig_iSNSServer_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_DiscoveryConfig_iSNSServer_ID 5 - -} MSiSCSI_DiscoveryConfig, *PMSiSCSI_DiscoveryConfig; - -#define MSiSCSI_DiscoveryConfig_SIZE (FIELD_OFFSET(MSiSCSI_DiscoveryConfig, iSNSServer) + MSiSCSI_DiscoveryConfig_iSNSServer_SIZE) - -// MSiSCSI_RADIUSConfig - MSiSCSI_RADIUSConfig - -// -// This class is required if adapter supports using RADIUS for CHAP authentication. -// -// This class exposes the configuration capabilities if the adapter able to -// use radius to perform CHAP authentication. Using RADIUS is encouraged -// since it allows centralized management of CHAP credentials. -// -// This class uses PDO instance names with a single instance. -// - -#define MSiSCSI_RADIUSConfigGuid \ - { 0x8eaef9d8,0xc053,0x49d3, { 0x92,0x05,0x65,0xc7,0x03,0xc2,0xec,0xc1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_RADIUSConfig_GUID, \ - 0x8eaef9d8,0xc053,0x49d3,0x92,0x05,0x65,0xc7,0x03,0xc2,0xec,0xc1); -#endif - - -typedef struct _MSiSCSI_RADIUSConfig -{ - // TRUE if adapter should use RADIUS for CHAP authentication - BOOLEAN UseRADIUSForCHAP; - #define MSiSCSI_RADIUSConfig_UseRADIUSForCHAP_SIZE sizeof(BOOLEAN) - #define MSiSCSI_RADIUSConfig_UseRADIUSForCHAP_ID 1 - - // Size in bytes of shared secret used to communicate with RADIUS servers - ULONG SharedSecretSizeInBytes; - #define MSiSCSI_RADIUSConfig_SharedSecretSizeInBytes_SIZE sizeof(ULONG) - #define MSiSCSI_RADIUSConfig_SharedSecretSizeInBytes_ID 2 - - // Fixed address of primary RADIUS server - ISCSI_IP_Address RADIUSServer; - #define MSiSCSI_RADIUSConfig_RADIUSServer_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_RADIUSConfig_RADIUSServer_ID 3 - - // Fixed address of backup RADIUS server - ISCSI_IP_Address BackupRADIUSServer; - #define MSiSCSI_RADIUSConfig_BackupRADIUSServer_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_RADIUSConfig_BackupRADIUSServer_ID 4 - - // Must be zero - ULONG Reserved; - #define MSiSCSI_RADIUSConfig_Reserved_SIZE sizeof(ULONG) - #define MSiSCSI_RADIUSConfig_Reserved_ID 5 - - // Shared secret for communicating with primary and backup RADIUS servers. This field is a variable length array. - UCHAR SharedSecret[1]; - #define MSiSCSI_RADIUSConfig_SharedSecret_ID 6 - -} MSiSCSI_RADIUSConfig, *PMSiSCSI_RADIUSConfig; - -#endif - diff --git a/qt-correction-tool/pub/ddk/iscsidef.h b/qt-correction-tool/pub/ddk/iscsidef.h deleted file mode 100644 index ff24f74..0000000 --- a/qt-correction-tool/pub/ddk/iscsidef.h +++ /dev/null @@ -1,350 +0,0 @@ -#ifndef _iscsidef_h_ -#define _iscsidef_h_ - -// ISCSI_IP_Address - ISCSI_IP_Address - - -//*************************************************************************** -// -// iscsidef.h -// -// Module: iScsi Discovery api -// -// Purpose: Internal header defining interface between user mode discovery -// api dll and HBA driver miniport. -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -// -// Definitions for iscsi security flags. These flags provide -// information about the security expectations of a target portal and -// are needed to insure a successful IKE/IPSEC negotiation. Note that -// the flags and values are taken directly from the iSNS spec -// - - // 1 = Tunnel Mode Preferred; 0 = No Preference -#define ISCSI_SECURITY_FLAG_TUNNEL_MODE_PREFERRED 0x00000040 - - // 1 = Transport Mode Preferred; 0 = No Preference -#define ISCSI_SECURITY_FLAG_TRANSPORT_MODE_PREFERRED 0x00000020 - - // 1 = PFS Enabled; 0 = PFS Disabled -#define ISCSI_SECURITY_FLAG_PFS_ENABLED 0x00000010 - - // 1 = Aggressive Mode Enabled; 0 = Disabled -#define ISCSI_SECURITY_FLAG_AGGRESSIVE_MODE_ENABLED 0x00000008 - - // 1 = Main Mode Enabled; 0 = MM Disabled -#define ISCSI_SECURITY_FLAG_MAIN_MODE_ENABLED 0x00000004 - - // 1 = IKE/IPSec Enabled; 0 = IKE/IPSec Disabled -#define ISCSI_SECURITY_FLAG_IKE_IPSEC_ENABLED 0x00000002 - - // If set then all other ISCSI_SECURITY_FLAGS are valid -#define ISCSI_SECURITY_FLAG_VALID 0x00000001 - - -// -// Types of addresses that can be passed by management app to driver -// -typedef enum { - // Text based host name. This needs to be resolved to binary form - ISCSI_IP_ADDRESS_TEXT = 0, - // Binary IPv4 address - ISCSI_IP_ADDRESS_IPV4 = 1, - // Binary IPv6 address - ISCSI_IP_ADDRESS_IPV6 = 2, - // Empty address - ISCSI_IP_ADDRESS_EMPTY = 3 -} ISCSIIPADDRESSTYPE, *PISCSIIPADDRESSTYPE; - -#define ISCSI_IP_AddressGuid \ - { 0x9ac5d4a1,0x1a1a,0x48ec, { 0x8e,0x79,0x73,0x58,0x06,0xe9,0xa1,0xfa } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_IP_Address_GUID, \ - 0x9ac5d4a1,0x1a1a,0x48ec,0x8e,0x79,0x73,0x58,0x06,0xe9,0xa1,0xfa); -#endif - - -typedef struct _ISCSI_IP_Address -{ - // Type of address specified. It can be text: a DNS or dotted address or it can be a binary ipv4 or ipv6 address - ULONG Type; - #define ISCSI_IP_Address_Type_SIZE sizeof(ULONG) - #define ISCSI_IP_Address_Type_ID 1 - - // If IPV4 Address is specified as the Address Format then this conains the binary IPv4 ip address - ULONG IpV4Address; - #define ISCSI_IP_Address_IpV4Address_SIZE sizeof(ULONG) - #define ISCSI_IP_Address_IpV4Address_ID 2 - - // If IPV6 Address is specified as the Address Format then this conains the binary IPv6 ip address - UCHAR IpV6Address[16]; - #define ISCSI_IP_Address_IpV6Address_SIZE sizeof(UCHAR[16]) - #define ISCSI_IP_Address_IpV6Address_ID 3 - - // IPV6 flow information - ULONG IpV6FlowInfo; - #define ISCSI_IP_Address_IpV6FlowInfo_SIZE sizeof(ULONG) - #define ISCSI_IP_Address_IpV6FlowInfo_ID 4 - - // IPV6 scope id - ULONG IpV6ScopeId; - #define ISCSI_IP_Address_IpV6ScopeId_SIZE sizeof(ULONG) - #define ISCSI_IP_Address_IpV6ScopeId_ID 5 - - // Text address, either a DNS address or dotted address - WCHAR TextAddress[256 + 1]; - #define ISCSI_IP_Address_TextAddress_ID 6 - -} ISCSI_IP_Address, *PISCSI_IP_Address; - -// ISCSI_TargetPortal - ISCSI_TargetPortal -// ISCSI target portal -#define ISCSI_TargetPortalGuid \ - { 0xde5051a7,0xbf27,0x48f1, { 0xbd,0x12,0x07,0xca,0xde,0x92,0xae,0xfd } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_TargetPortal_GUID, \ - 0xde5051a7,0xbf27,0x48f1,0xbd,0x12,0x07,0xca,0xde,0x92,0xae,0xfd); -#endif - - -typedef struct _ISCSI_TargetPortal -{ - // Network Address - ISCSI_IP_Address Address; - #define ISCSI_TargetPortal_Address_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_TargetPortal_Address_ID 1 - - // Reserved - ULONG Reserved; - #define ISCSI_TargetPortal_Reserved_SIZE sizeof(ULONG) - #define ISCSI_TargetPortal_Reserved_ID 2 - - // Socket number - USHORT Socket; - #define ISCSI_TargetPortal_Socket_SIZE sizeof(USHORT) - #define ISCSI_TargetPortal_Socket_ID 3 - -} ISCSI_TargetPortal, *PISCSI_TargetPortal; - -#define ISCSI_TargetPortal_SIZE (FIELD_OFFSET(ISCSI_TargetPortal, Socket) + ISCSI_TargetPortal_Socket_SIZE) - -// ISCSI_TargetPortalGroup - ISCSI_TargetPortalGroup -// iSCSI target portal group -#define ISCSI_TargetPortalGroupGuid \ - { 0x3081f2a5,0x95f5,0x4d2a, { 0x81,0x3d,0xee,0x59,0x86,0x4c,0x6f,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_TargetPortalGroup_GUID, \ - 0x3081f2a5,0x95f5,0x4d2a,0x81,0x3d,0xee,0x59,0x86,0x4c,0x6f,0xc5); -#endif - - -typedef struct _ISCSI_TargetPortalGroup -{ - // Number of portals in group - ULONG PortalCount; - #define ISCSI_TargetPortalGroup_PortalCount_SIZE sizeof(ULONG) - #define ISCSI_TargetPortalGroup_PortalCount_ID 1 - - // Target portals in group - ISCSI_TargetPortal Portals[1]; - #define ISCSI_TargetPortalGroup_Portals_ID 2 - -} ISCSI_TargetPortalGroup, *PISCSI_TargetPortalGroup; - -// ISCSI_LoginOptions - ISCSI_LoginOptions -// These are options that can be used for logging into a target - -#ifndef _ISCSI_ISCSIDSC_ -typedef enum -{ - ISCSI_DIGEST_TYPE_NONE = 0, - ISCSI_DIGEST_TYPE_CRC32C = 1 -} ISCSI_DIGEST_TYPES, *PISCSI_DIGEST_TYPES; - -typedef enum -{ - ISCSI_NO_AUTH_TYPE = 0, - ISCSI_CHAP_AUTH_TYPE = 1, - ISCSI_MUTUAL_CHAP_AUTH_TYPE = 2 -} ISCSI_AUTH_TYPES, *PISCSI_AUTH_TYPES; -#endif - -#define ISCSI_LoginOptionsGuid \ - { 0x3011a7bd,0x0491,0x478e, { 0x8c,0x79,0x3c,0x76,0x42,0x4d,0x05,0xe2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_LoginOptions_GUID, \ - 0x3011a7bd,0x0491,0x478e,0x8c,0x79,0x3c,0x76,0x42,0x4d,0x05,0xe2); -#endif - - -typedef struct _ISCSI_LoginOptions -{ - -// -// Bit flags for InformationSpecifies -// -#define ISCSI_LOGIN_OPTIONS_HEADER_DIGEST 0x00000001 -#define ISCSI_LOGIN_OPTIONS_DATA_DIGEST 0x00000002 -#define ISCSI_LOGIN_OPTIONS_MAXIMUM_CONNECTIONS 0x00000004 -#define ISCSI_LOGIN_OPTIONS_DEFAULT_TIME_2_WAIT 0x00000008 -#define ISCSI_LOGIN_OPTIONS_DEFAULT_TIME_2_RETAIN 0x00000010 -#define ISCSI_LOGIN_OPTIONS_USERNAME 0x00000020 -#define ISCSI_LOGIN_OPTIONS_PASSWORD 0x00000040 -#define ISCSI_LOGIN_OPTIONS_AUTH_TYPE 0x00000080 - - - // Bit flags that specify which login option values are specified - ULONG InformationSpecified; - #define ISCSI_LoginOptions_InformationSpecified_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_InformationSpecified_ID 1 - - // cyclic integrity checksums that can be negotiated for the header digests - ULONG HeaderDigest; - #define ISCSI_LoginOptions_HeaderDigest_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_HeaderDigest_ID 2 - - // cyclic integrity checksums that can be negotiated for the header digests - ULONG DataDigest; - #define ISCSI_LoginOptions_DataDigest_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_DataDigest_ID 3 - - // Maximum number of connections, 0 implies no limit - ULONG MaximumConnections; - #define ISCSI_LoginOptions_MaximumConnections_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_MaximumConnections_ID 4 - - // The initiator and target negotiate the minimum time, in seconds, to wait before attempting an explicit/implicit logout or active task reassignment after an unexpected connection termination or a connection reset. - ULONG DefaultTime2Wait; - #define ISCSI_LoginOptions_DefaultTime2Wait_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_DefaultTime2Wait_ID 5 - - // The initiator and target negotiate the maximum time, in seconds after an initial wait (Time2Wait), before which an explicit/implicit connection Logout or active task reassignment is still possible after an unexpected connection termination or a connection reset. - ULONG DefaultTime2Retain; - #define ISCSI_LoginOptions_DefaultTime2Retain_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_DefaultTime2Retain_ID 6 - - -// -// bit flags for ISCSI_LOGIN_FLAGS -// -#ifndef _ISCSI_ISCSIDSC_ -#define ISCSI_LOGIN_FLAGS ULONG - -#define ISCSI_LOGIN_FLAG_REQUIRE_IPSEC 0x00000001 -#define ISCSI_LOGIN_FLAG_MULTIPATH_ENABLED 0x00000002 -#define ISCSI_LOGIN_FLAG_RESERVED1 0x00000004 -#define ISCSI_LOGIN_FLAG_ALLOW_PORTAL_HOPPING 0x00000008 -#define ISCSI_LOGIN_FLAG_USE_RADIUS_RESPONSE 0x00000010 -#define ISCSI_LOGIN_FLAG_USE_RADIUS_VERIFICATION 0x00000020 - -#endif - - // Flags that affect how login occurs - ULONG LoginFlags; - #define ISCSI_LoginOptions_LoginFlags_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_LoginFlags_ID 7 - - // Authentication method specified for login - ULONG AuthType; - #define ISCSI_LoginOptions_AuthType_SIZE sizeof(ULONG) - #define ISCSI_LoginOptions_AuthType_ID 8 - -} ISCSI_LoginOptions, *PISCSI_LoginOptions; - -#define ISCSI_LoginOptions_SIZE (FIELD_OFFSET(ISCSI_LoginOptions, AuthType) + ISCSI_LoginOptions_AuthType_SIZE) - -// ISCSI_LUNList - ISCSI_LUNList -// This class describes a mapping from a an OS LUN to target device LUN -#define ISCSI_LUNListGuid \ - { 0x994ff278,0x3512,0x4d9b, { 0xa2,0x41,0x54,0xce,0xf4,0x5f,0x5a,0x25 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_LUNList_GUID, \ - 0x994ff278,0x3512,0x4d9b,0xa2,0x41,0x54,0xce,0xf4,0x5f,0x5a,0x25); -#endif - - -typedef struct _ISCSI_LUNList -{ - // Target LUN - ULONGLONG TargetLUN; - #define ISCSI_LUNList_TargetLUN_SIZE sizeof(ULONGLONG) - #define ISCSI_LUNList_TargetLUN_ID 1 - - // OS Scsi bus number target is mapped to - ULONG OSLUN; - #define ISCSI_LUNList_OSLUN_SIZE sizeof(ULONG) - #define ISCSI_LUNList_OSLUN_ID 2 - - // Reserved - ULONG Reserved; - #define ISCSI_LUNList_Reserved_SIZE sizeof(ULONG) - #define ISCSI_LUNList_Reserved_ID 3 - -} ISCSI_LUNList, *PISCSI_LUNList; - -#define ISCSI_LUNList_SIZE (FIELD_OFFSET(ISCSI_LUNList, Reserved) + ISCSI_LUNList_Reserved_SIZE) - -// ISCSI_TargetMapping - ISCSI_TargetMapping -// This class describes a mapping from a target LUN to a Windows port driver LUN -#define ISCSI_TargetMappingGuid \ - { 0x21a28820,0x3c4c,0x4944, { 0xac,0x4f,0xda,0x7f,0xeb,0xa2,0x11,0x68 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_TargetMapping_GUID, \ - 0x21a28820,0x3c4c,0x4944,0xac,0x4f,0xda,0x7f,0xeb,0xa2,0x11,0x68); -#endif - - -typedef struct _ISCSI_TargetMapping -{ - // OS Scsi bus number target is mapped to. If 0xffffffff then any value can be picked by the miniport. - ULONG OSBus; - #define ISCSI_TargetMapping_OSBus_SIZE sizeof(ULONG) - #define ISCSI_TargetMapping_OSBus_ID 1 - - // OS Scsi Target number target is mapped to. If 0xffffffff then any value can be picked by the miniport. - ULONG OSTarget; - #define ISCSI_TargetMapping_OSTarget_SIZE sizeof(ULONG) - #define ISCSI_TargetMapping_OSTarget_ID 2 - - // Unique Session ID for the target mapping - ULONGLONG UniqueSessionId; - #define ISCSI_TargetMapping_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ISCSI_TargetMapping_UniqueSessionId_ID 3 - - // Count of LUNs mapped for this target - ULONG LUNCount; - #define ISCSI_TargetMapping_LUNCount_SIZE sizeof(ULONG) - #define ISCSI_TargetMapping_LUNCount_ID 4 - - // Target Name - WCHAR TargetName[223 + 1]; - #define ISCSI_TargetMapping_TargetName_ID 5 - - // TRUE if session created from a persistent login - BOOLEAN FromPersistentLogin; - #define ISCSI_TargetMapping_FromPersistentLogin_SIZE sizeof(BOOLEAN) - #define ISCSI_TargetMapping_FromPersistentLogin_ID 6 - - // Reserved - ULONGLONG Reserved; - #define ISCSI_TargetMapping_Reserved_SIZE sizeof(ULONGLONG) - #define ISCSI_TargetMapping_Reserved_ID 7 - - // List of LUNs mapped for this target - ISCSI_LUNList LUNList[1]; - #define ISCSI_TargetMapping_LUNList_ID 8 - -} ISCSI_TargetMapping, *PISCSI_TargetMapping; - -#endif - diff --git a/qt-correction-tool/pub/ddk/iscsierr.h b/qt-correction-tool/pub/ddk/iscsierr.h deleted file mode 100644 index ddf4b96..0000000 --- a/qt-correction-tool/pub/ddk/iscsierr.h +++ /dev/null @@ -1,1031 +0,0 @@ -/*++ - -Copyright (c) 2001 Microsoft Corporation - -Module Name: - - iscsierr.h - -Abstract: - - Constant definitions for the IScsi discover error codes - -Revision History: - ---*/ - -#ifndef _ISCSIERR_ -#define _ISCSIERR_ - -// -// Status values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-------------------------+-------------------------------+ -// |Sev|C| Facility | Code | -// +---+-+-------------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// Facility - is the facility code -// -// Code - is the facility's status code -// - -// -// Error status code for ISCSI discovery apis. Error codes can be a -// standard Windows error code as defined in Winerror.h or one of the -// iscsi discovery specific error codes defined below. -// -#ifndef MOFCOMP_PASS -typedef ULONG ISDSC_STATUS; -#endif - -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_ERROR 0x3 - - -// -// MessageId: ISDSC_NON_SPECIFIC_ERROR -// -// MessageText: -// -// A non specific error occurred. -// -#define ISDSC_NON_SPECIFIC_ERROR ((ISDSC_STATUS)0xEFFF0001L) - -// -// MessageId: ISDSC_LOGIN_FAILED -// -// MessageText: -// -// Login Failed. -// -#define ISDSC_LOGIN_FAILED ((ISDSC_STATUS)0xEFFF0002L) - -// -// MessageId: ISDSC_CONNECTION_FAILED -// -// MessageText: -// -// Connection Failed. -// -#define ISDSC_CONNECTION_FAILED ((ISDSC_STATUS)0xEFFF0003L) - -// -// MessageId: ISDSC_INITIATOR_NODE_ALREADY_EXISTS -// -// MessageText: -// -// Initiator Node Already Exists. -// -#define ISDSC_INITIATOR_NODE_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0004L) - -// -// MessageId: ISDSC_INITIATOR_NODE_NOT_FOUND -// -// MessageText: -// -// Initiator Node Does Not Exist. -// -#define ISDSC_INITIATOR_NODE_NOT_FOUND ((ISDSC_STATUS)0xEFFF0005L) - -// -// MessageId: ISDSC_TARGET_MOVED_TEMPORARILY -// -// MessageText: -// -// Target Moved Temporarily. -// -#define ISDSC_TARGET_MOVED_TEMPORARILY ((ISDSC_STATUS)0xEFFF0006L) - -// -// MessageId: ISDSC_TARGET_MOVED_PERMANENTLY -// -// MessageText: -// -// Target Moved Permanently. -// -#define ISDSC_TARGET_MOVED_PERMANENTLY ((ISDSC_STATUS)0xEFFF0007L) - -// -// MessageId: ISDSC_INITIATOR_ERROR -// -// MessageText: -// -// Initiator Error. -// -#define ISDSC_INITIATOR_ERROR ((ISDSC_STATUS)0xEFFF0008L) - -// -// MessageId: ISDSC_AUTHENTICATION_FAILURE -// -// MessageText: -// -// Authentication Failure. -// -#define ISDSC_AUTHENTICATION_FAILURE ((ISDSC_STATUS)0xEFFF0009L) - -// -// MessageId: ISDSC_AUTHORIZATION_FAILURE -// -// MessageText: -// -// Authorization Failure. -// -#define ISDSC_AUTHORIZATION_FAILURE ((ISDSC_STATUS)0xEFFF000AL) - -// -// MessageId: ISDSC_NOT_FOUND -// -// MessageText: -// -// Not Found. -// -#define ISDSC_NOT_FOUND ((ISDSC_STATUS)0xEFFF000BL) - -// -// MessageId: ISDSC_TARGET_REMOVED -// -// MessageText: -// -// Target Removed. -// -#define ISDSC_TARGET_REMOVED ((ISDSC_STATUS)0xEFFF000CL) - -// -// MessageId: ISDSC_UNSUPPORTED_VERSION -// -// MessageText: -// -// Unsupported Version. -// -#define ISDSC_UNSUPPORTED_VERSION ((ISDSC_STATUS)0xEFFF000DL) - -// -// MessageId: ISDSC_TOO_MANY_CONNECTIONS -// -// MessageText: -// -// Too many Connections. -// -#define ISDSC_TOO_MANY_CONNECTIONS ((ISDSC_STATUS)0xEFFF000EL) - -// -// MessageId: ISDSC_MISSING_PARAMETER -// -// MessageText: -// -// Missing Parameter. -// -#define ISDSC_MISSING_PARAMETER ((ISDSC_STATUS)0xEFFF000FL) - -// -// MessageId: ISDSC_CANT_INCLUDE_IN_SESSION -// -// MessageText: -// -// Can not include in session. -// -#define ISDSC_CANT_INCLUDE_IN_SESSION ((ISDSC_STATUS)0xEFFF0010L) - -// -// MessageId: ISDSC_SESSION_TYPE_NOT_SUPPORTED -// -// MessageText: -// -// Session type not supported. -// -#define ISDSC_SESSION_TYPE_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF0011L) - -// -// MessageId: ISDSC_TARGET_ERROR -// -// MessageText: -// -// Target Error. -// -#define ISDSC_TARGET_ERROR ((ISDSC_STATUS)0xEFFF0012L) - -// -// MessageId: ISDSC_SERVICE_UNAVAILABLE -// -// MessageText: -// -// Service Unavailable. -// -#define ISDSC_SERVICE_UNAVAILABLE ((ISDSC_STATUS)0xEFFF0013L) - -// -// MessageId: ISDSC_OUT_OF_RESOURCES -// -// MessageText: -// -// Out of Resources. -// -#define ISDSC_OUT_OF_RESOURCES ((ISDSC_STATUS)0xEFFF0014L) - -// -// MessageId: ISDSC_CONNECTION_ALREADY_EXISTS -// -// MessageText: -// -// Connections already exist on initiator node. -// -#define ISDSC_CONNECTION_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0015L) - -// -// MessageId: ISDSC_SESSION_ALREADY_EXISTS -// -// MessageText: -// -// Session Already Exists. -// -#define ISDSC_SESSION_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0016L) - -// -// MessageId: ISDSC_INITIATOR_INSTANCE_NOT_FOUND -// -// MessageText: -// -// Initiator Instance Does Not Exist. -// -#define ISDSC_INITIATOR_INSTANCE_NOT_FOUND ((ISDSC_STATUS)0xEFFF0017L) - -// -// MessageId: ISDSC_TARGET_ALREADY_EXISTS -// -// MessageText: -// -// Target Already Exists. -// -#define ISDSC_TARGET_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0018L) - -// -// MessageId: ISDSC_DRIVER_BUG -// -// MessageText: -// -// The iscsi driver implementation did not complete an operation correctly. -// -#define ISDSC_DRIVER_BUG ((ISDSC_STATUS)0xEFFF0019L) - -// -// MessageId: ISDSC_INVALID_TEXT_KEY -// -// MessageText: -// -// An invalid key text was encountered. -// -#define ISDSC_INVALID_TEXT_KEY ((ISDSC_STATUS)0xEFFF001AL) - -// -// MessageId: ISDSC_INVALID_SENDTARGETS_TEXT -// -// MessageText: -// -// Invalid SendTargets response text was encountered. -// -#define ISDSC_INVALID_SENDTARGETS_TEXT ((ISDSC_STATUS)0xEFFF001BL) - -// -// MessageId: ISDSC_INVALID_SESSION_ID -// -// MessageText: -// -// Invalid Session Id. -// -#define ISDSC_INVALID_SESSION_ID ((ISDSC_STATUS)0xEFFF001CL) - -// -// MessageId: ISDSC_SCSI_REQUEST_FAILED -// -// MessageText: -// -// The scsi request failed. -// -#define ISDSC_SCSI_REQUEST_FAILED ((ISDSC_STATUS)0xEFFF001DL) - -// -// MessageId: ISDSC_TOO_MANY_SESSIONS -// -// MessageText: -// -// Exceeded max sessions for this initiator. -// -#define ISDSC_TOO_MANY_SESSIONS ((ISDSC_STATUS)0xEFFF001EL) - -// -// MessageId: ISDSC_SESSION_BUSY -// -// MessageText: -// -// Session is busy since a request is already in progress. -// -#define ISDSC_SESSION_BUSY ((ISDSC_STATUS)0xEFFF001FL) - -// -// MessageId: ISDSC_TARGET_MAPPING_UNAVAILABLE -// -// MessageText: -// -// The target mapping requested is not available. -// -#define ISDSC_TARGET_MAPPING_UNAVAILABLE ((ISDSC_STATUS)0xEFFF0020L) - -// -// MessageId: ISDSC_ADDRESS_TYPE_NOT_SUPPORTED -// -// MessageText: -// -// The Target Address type given is not supported. -// -#define ISDSC_ADDRESS_TYPE_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF0021L) - -// -// MessageId: ISDSC_LOGON_FAILED -// -// MessageText: -// -// Logon Failed. -// -#define ISDSC_LOGON_FAILED ((ISDSC_STATUS)0xEFFF0022L) - -// -// MessageId: ISDSC_SEND_FAILED -// -// MessageText: -// -// TCP Send Failed. -// -#define ISDSC_SEND_FAILED ((ISDSC_STATUS)0xEFFF0023L) - -// -// MessageId: ISDSC_TRANSPORT_ERROR -// -// MessageText: -// -// TCP Transport Error -// -#define ISDSC_TRANSPORT_ERROR ((ISDSC_STATUS)0xEFFF0024L) - -// -// MessageId: ISDSC_VERSION_MISMATCH -// -// MessageText: -// -// iSCSI Version Mismatch -// -#define ISDSC_VERSION_MISMATCH ((ISDSC_STATUS)0xEFFF0025L) - -// -// MessageId: ISDSC_TARGET_MAPPING_OUT_OF_RANGE -// -// MessageText: -// -// The Target Mapping Address passed is out of range for the adapter configuration. -// -#define ISDSC_TARGET_MAPPING_OUT_OF_RANGE ((ISDSC_STATUS)0xEFFF0026L) - -// -// MessageId: ISDSC_TARGET_PRESHAREDKEY_UNAVAILABLE -// -// MessageText: -// -// The preshared key for the target or IKE identification payload is not available. -// -#define ISDSC_TARGET_PRESHAREDKEY_UNAVAILABLE ((ISDSC_STATUS)0xEFFF0027L) - -// -// MessageId: ISDSC_TARGET_AUTHINFO_UNAVAILABLE -// -// MessageText: -// -// The authentication information for the target is not available. -// -#define ISDSC_TARGET_AUTHINFO_UNAVAILABLE ((ISDSC_STATUS)0xEFFF0028L) - -// -// MessageId: ISDSC_TARGET_NOT_FOUND -// -// MessageText: -// -// The target name is not found or is marked as hidden from login. -// -#define ISDSC_TARGET_NOT_FOUND ((ISDSC_STATUS)0xEFFF0029L) - -// -// MessageId: ISDSC_LOGIN_USER_INFO_BAD -// -// MessageText: -// -// One or more parameters specified in LoginTargetIN structure is invalid. -// -#define ISDSC_LOGIN_USER_INFO_BAD ((ISDSC_STATUS)0xEFFF002AL) - -// -// MessageId: ISDSC_TARGET_MAPPING_EXISTS -// -// MessageText: -// -// Given target mapping already exists. -// -#define ISDSC_TARGET_MAPPING_EXISTS ((ISDSC_STATUS)0xEFFF002BL) - -// -// MessageId: ISDSC_HBA_SECURITY_CACHE_FULL -// -// MessageText: -// -// The HBA security information cache is full. -// -#define ISDSC_HBA_SECURITY_CACHE_FULL ((ISDSC_STATUS)0xEFFF002CL) - -// -// MessageId: ISDSC_INVALID_PORT_NUMBER -// -// MessageText: -// -// The port number passed is not valid for the initiator. -// -#define ISDSC_INVALID_PORT_NUMBER ((ISDSC_STATUS)0xEFFF002DL) - -// -// MessageId: ISDSC_OPERATION_NOT_ALL_SUCCESS -// -// MessageText: -// -// The operation was not successful for all initiators or discovery methods. -// -#define ISDSC_OPERATION_NOT_ALL_SUCCESS ((ISDSC_STATUS)0xAFFF002EL) - -// -// MessageId: ISDSC_HBA_SECURITY_CACHE_NOT_SUPPORTED -// -// MessageText: -// -// The HBA security information cache is not supported by this adapter. -// -#define ISDSC_HBA_SECURITY_CACHE_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF002FL) - -// -// MessageId: ISDSC_IKE_ID_PAYLOAD_TYPE_NOT_SUPPORTED -// -// MessageText: -// -// The IKE id payload type specified is not supported. -// -#define ISDSC_IKE_ID_PAYLOAD_TYPE_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF0030L) - -// -// MessageId: ISDSC_IKE_ID_PAYLOAD_INCORRECT_SIZE -// -// MessageText: -// -// The IKE id payload size specified is not correct. -// -#define ISDSC_IKE_ID_PAYLOAD_INCORRECT_SIZE ((ISDSC_STATUS)0xEFFF0031L) - -// -// MessageId: ISDSC_TARGET_PORTAL_ALREADY_EXISTS -// -// MessageText: -// -// Target Portal Structure Already Exists. -// -#define ISDSC_TARGET_PORTAL_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0032L) - -// -// MessageId: ISDSC_TARGET_ADDRESS_ALREADY_EXISTS -// -// MessageText: -// -// Target Address Structure Already Exists. -// -#define ISDSC_TARGET_ADDRESS_ALREADY_EXISTS ((ISDSC_STATUS)0xEFFF0033L) - -// -// MessageId: ISDSC_NO_AUTH_INFO_AVAILABLE -// -// MessageText: -// -// There is no IKE authentication information available. -// -#define ISDSC_NO_AUTH_INFO_AVAILABLE ((ISDSC_STATUS)0xEFFF0034L) - -// -// MessageId: ISDSC_NO_TUNNEL_OUTER_MODE_ADDRESS -// -// MessageText: -// -// There is no tunnel mode outer address specified. -// -#define ISDSC_NO_TUNNEL_OUTER_MODE_ADDRESS ((ISDSC_STATUS)0xEFFF0035L) - -// -// MessageId: ISDSC_CACHE_CORRUPTED -// -// MessageText: -// -// Authentication or tunnel address cache is corrupted. -// -#define ISDSC_CACHE_CORRUPTED ((ISDSC_STATUS)0xEFFF0036L) - -// -// MessageId: ISDSC_REQUEST_NOT_SUPPORTED -// -// MessageText: -// -// The request or operation is not supported. -// -#define ISDSC_REQUEST_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF0037L) - -// -// MessageId: ISDSC_TARGET_OUT_OF_RESORCES -// -// MessageText: -// -// The target does not have enough resources to process the given request. -// -#define ISDSC_TARGET_OUT_OF_RESORCES ((ISDSC_STATUS)0xEFFF0038L) - -// -// MessageId: ISDSC_SERVICE_DID_NOT_RESPOND -// -// MessageText: -// -// The initiator service did not respond to the request sent by the driver. -// -#define ISDSC_SERVICE_DID_NOT_RESPOND ((ISDSC_STATUS)0xEFFF0039L) - -// -// MessageId: ISDSC_ISNS_SERVER_NOT_FOUND -// -// MessageText: -// -// The Internet Storage Name Server (iSNS) server was not found or is unavailable. -// -#define ISDSC_ISNS_SERVER_NOT_FOUND ((ISDSC_STATUS)0xEFFF003AL) - -// -// MessageId: ISDSC_OPERATION_REQUIRES_REBOOT -// -// MessageText: -// -// The operation was successful but requires a driver reload or reboot to become effective. -// -#define ISDSC_OPERATION_REQUIRES_REBOOT ((ISDSC_STATUS)0xAFFF003BL) - -// -// MessageId: ISDSC_NO_PORTAL_SPECIFIED -// -// MessageText: -// -// There is no target portal available to complete the login. -// -#define ISDSC_NO_PORTAL_SPECIFIED ((ISDSC_STATUS)0xEFFF003CL) - -// -// MessageId: ISDSC_CANT_REMOVE_LAST_CONNECTION -// -// MessageText: -// -// Cannot remove the last connection for a session. -// -#define ISDSC_CANT_REMOVE_LAST_CONNECTION ((ISDSC_STATUS)0xEFFF003DL) - -// -// MessageId: ISDSC_SERVICE_NOT_RUNNING -// -// MessageText: -// -// The Microsoft iSCSI initiator service has not been started. -// -#define ISDSC_SERVICE_NOT_RUNNING ((ISDSC_STATUS)0xEFFF003EL) - -// -// MessageId: ISDSC_TARGET_ALREADY_LOGGED_IN -// -// MessageText: -// -// The target has already been logged in via an iSCSI session. -// -#define ISDSC_TARGET_ALREADY_LOGGED_IN ((ISDSC_STATUS)0xEFFF003FL) - -// -// MessageId: ISDSC_DEVICE_BUSY_ON_SESSION -// -// MessageText: -// -// The session cannot be logged out since a device on that session is currently being used. -// -#define ISDSC_DEVICE_BUSY_ON_SESSION ((ISDSC_STATUS)0xEFFF0040L) - -// -// MessageId: ISDSC_COULD_NOT_SAVE_PERSISTENT_LOGIN_DATA -// -// MessageText: -// -// Failed to save persistent login information. -// -#define ISDSC_COULD_NOT_SAVE_PERSISTENT_LOGIN_DATA ((ISDSC_STATUS)0xEFFF0041L) - -// -// MessageId: ISDSC_COULD_NOT_REMOVE_PERSISTENT_LOGIN_DATA -// -// MessageText: -// -// Failed to remove persistent login information. -// -#define ISDSC_COULD_NOT_REMOVE_PERSISTENT_LOGIN_DATA ((ISDSC_STATUS)0xEFFF0042L) - -// -// MessageId: ISDSC_PORTAL_NOT_FOUND -// -// MessageText: -// -// The specified portal was not found. -// -#define ISDSC_PORTAL_NOT_FOUND ((ISDSC_STATUS)0xEFFF0043L) - -// -// MessageId: ISDSC_INITIATOR_NOT_FOUND -// -// MessageText: -// -// The specified initiator name was not found. -// -#define ISDSC_INITIATOR_NOT_FOUND ((ISDSC_STATUS)0xEFFF0044L) - -// -// MessageId: ISDSC_DISCOVERY_MECHANISM_NOT_FOUND -// -// MessageText: -// -// The specified discovery mechanism was not found. -// -#define ISDSC_DISCOVERY_MECHANISM_NOT_FOUND ((ISDSC_STATUS)0xEFFF0045L) - -// -// MessageId: ISDSC_IPSEC_NOT_SUPPORTED_ON_OS -// -// MessageText: -// -// iSCSI does not support IPSEC for this version of the OS. -// -#define ISDSC_IPSEC_NOT_SUPPORTED_ON_OS ((ISDSC_STATUS)0xEFFF0046L) - -// -// MessageId: ISDSC_PERSISTENT_LOGIN_TIMEOUT -// -// MessageText: -// -// The iSCSI service timed out waiting for all persistent logins to complete. -// -#define ISDSC_PERSISTENT_LOGIN_TIMEOUT ((ISDSC_STATUS)0xEFFF0047L) - -// -// MessageId: ISDSC_SHORT_CHAP_SECRET -// -// MessageText: -// -// The specified CHAP secret is less than 96 bits and will not be usable for authenticating over non ipsec connections. -// -#define ISDSC_SHORT_CHAP_SECRET ((ISDSC_STATUS)0xAFFF0048L) - -// -// MessageId: ISDSC_EVALUATION_PEROID_EXPIRED -// -// MessageText: -// -// The evaluation period for the iSCSI initiator service has expired. -// -#define ISDSC_EVALUATION_PEROID_EXPIRED ((ISDSC_STATUS)0xEFFF0049L) - -// -// MessageId: ISDSC_INVALID_CHAP_SECRET -// -// MessageText: -// -// CHAP secret given does not conform to the standard. Please see system event log for more information. -// -#define ISDSC_INVALID_CHAP_SECRET ((ISDSC_STATUS)0xEFFF004AL) - -// -// MessageId: ISDSC_INVALID_TARGET_CHAP_SECRET -// -// MessageText: -// -// Target CHAP secret given is invalid. Maximum size of CHAP secret is 16 bytes. Minimum size is 12 bytes if IPSec is not used. -// -#define ISDSC_INVALID_TARGET_CHAP_SECRET ((ISDSC_STATUS)0xEFFF004BL) - -// -// MessageId: ISDSC_INVALID_INITIATOR_CHAP_SECRET -// -// MessageText: -// -// Initiator CHAP secret given is invalid. Maximum size of CHAP secret is 16 bytes. Minimum size is 12 bytes if IPSec is not used. -// -#define ISDSC_INVALID_INITIATOR_CHAP_SECRET ((ISDSC_STATUS)0xEFFF004CL) - -// -// MessageId: ISDSC_INVALID_CHAP_USER_NAME -// -// MessageText: -// -// CHAP Username given is invalid. -// -#define ISDSC_INVALID_CHAP_USER_NAME ((ISDSC_STATUS)0xEFFF004DL) - -// -// MessageId: ISDSC_INVALID_LOGON_AUTH_TYPE -// -// MessageText: -// -// Logon Authentication type given is invalid. -// -#define ISDSC_INVALID_LOGON_AUTH_TYPE ((ISDSC_STATUS)0xEFFF004EL) - -// -// MessageId: ISDSC_INVALID_TARGET_MAPPING -// -// MessageText: -// -// Target Mapping information given is invalid. -// -#define ISDSC_INVALID_TARGET_MAPPING ((ISDSC_STATUS)0xEFFF004FL) - -// -// MessageId: ISDSC_INVALID_TARGET_ID -// -// MessageText: -// -// Target Id given in Target Mapping is invalid. -// -#define ISDSC_INVALID_TARGET_ID ((ISDSC_STATUS)0xEFFF0050L) - -// -// MessageId: ISDSC_INVALID_ISCSI_NAME -// -// MessageText: -// -// The iSCSI name specified contains invalid characters or is too long. -// -#define ISDSC_INVALID_ISCSI_NAME ((ISDSC_STATUS)0xEFFF0051L) - -// -// MessageId: ISDSC_INCOMPATIBLE_ISNS_VERSION -// -// MessageText: -// -// The version number returned from the Internet Storage Name Server (iSNS) server is not compatible with this version of the iSNS client. -// -#define ISDSC_INCOMPATIBLE_ISNS_VERSION ((ISDSC_STATUS)0xEFFF0052L) - -// -// MessageId: ISDSC_FAILED_TO_CONFIGURE_IPSEC -// -// MessageText: -// -// Initiator failed to configure IPSec for the given connection. This could be because of low resources. -// -#define ISDSC_FAILED_TO_CONFIGURE_IPSEC ((ISDSC_STATUS)0xEFFF0053L) - -// -// MessageId: ISDSC_BUFFER_TOO_SMALL -// -// MessageText: -// -// The buffer given for processing the request is too small. -// -#define ISDSC_BUFFER_TOO_SMALL ((ISDSC_STATUS)0xEFFF0054L) - -// -// MessageId: ISDSC_INVALID_LOAD_BALANCE_POLICY -// -// MessageText: -// -// The given Load Balance policy is not recognized by iScsi initiator. -// -#define ISDSC_INVALID_LOAD_BALANCE_POLICY ((ISDSC_STATUS)0xEFFF0055L) - -// -// MessageId: ISDSC_INVALID_PARAMETER -// -// MessageText: -// -// One or more paramaters specified is not valid. -// -#define ISDSC_INVALID_PARAMETER ((ISDSC_STATUS)0xEFFF0056L) - -// -// MessageId: ISDSC_DUPLICATE_PATH_SPECIFIED -// -// MessageText: -// -// Duplicate PathIds were specified in the call to set Load Balance Policy. -// -#define ISDSC_DUPLICATE_PATH_SPECIFIED ((ISDSC_STATUS)0xEFFF0057L) - -// -// MessageId: ISDSC_PATH_COUNT_MISMATCH -// -// MessageText: -// -// Number of paths specified in Set Load Balance Policy does not match the number of paths to the target. -// -#define ISDSC_PATH_COUNT_MISMATCH ((ISDSC_STATUS)0xEFFF0058L) - -// -// MessageId: ISDSC_INVALID_PATH_ID -// -// MessageText: -// -// Path Id specified in the call to set Load Balance Policy is not valid -// -#define ISDSC_INVALID_PATH_ID ((ISDSC_STATUS)0xEFFF0059L) - -// -// MessageId: ISDSC_MULTIPLE_PRIMARY_PATHS_SPECIFIED -// -// MessageText: -// -// Multiple primary paths specified when only one primary path is expected. -// -#define ISDSC_MULTIPLE_PRIMARY_PATHS_SPECIFIED ((ISDSC_STATUS)0xEFFF005AL) - -// -// MessageId: ISDSC_NO_PRIMARY_PATH_SPECIFIED -// -// MessageText: -// -// No primary path specified when at least one is expected. -// -#define ISDSC_NO_PRIMARY_PATH_SPECIFIED ((ISDSC_STATUS)0xEFFF005BL) - -// -// MessageId: ISDSC_DEVICE_ALREADY_PERSISTENTLY_BOUND -// -// MessageText: -// -// Device is already a persistently bound device. -// -#define ISDSC_DEVICE_ALREADY_PERSISTENTLY_BOUND ((ISDSC_STATUS)0xEFFF005CL) - -// -// MessageId: ISDSC_DEVICE_NOT_FOUND -// -// MessageText: -// -// Device was not found. -// -#define ISDSC_DEVICE_NOT_FOUND ((ISDSC_STATUS)0xEFFF005DL) - -// -// MessageId: ISDSC_DEVICE_NOT_ISCSI_OR_PERSISTENT -// -// MessageText: -// -// The device specified does not originate from an iSCSI disk or a persistent iSCSI login. -// -#define ISDSC_DEVICE_NOT_ISCSI_OR_PERSISTENT ((ISDSC_STATUS)0xEFFF005EL) - -// -// MessageId: ISDSC_DNS_NAME_UNRESOLVED -// -// MessageText: -// -// The DNS name specified was not resolved. -// -#define ISDSC_DNS_NAME_UNRESOLVED ((ISDSC_STATUS)0xEFFF005FL) - -// -// MessageId: ISDSC_NO_CONNECTION_AVAILABLE -// -// MessageText: -// -// There is no connection available in the iSCSI session to process the request. -// -#define ISDSC_NO_CONNECTION_AVAILABLE ((ISDSC_STATUS)0xEFFF0060L) - -// -// MessageId: ISDSC_LB_POLICY_NOT_SUPPORTED -// -// MessageText: -// -// The given Load Balance policy is not supported. -// -#define ISDSC_LB_POLICY_NOT_SUPPORTED ((ISDSC_STATUS)0xEFFF0061L) - -// -// MessageId: ISDSC_REMOVE_CONNECTION_IN_PROGRESS -// -// MessageText: -// -// A remove connection request is already in progress for this session. -// -#define ISDSC_REMOVE_CONNECTION_IN_PROGRESS ((ISDSC_STATUS)0xEFFF0062L) - -// -// MessageId: ISDSC_INVALID_CONNECTION_ID -// -// MessageText: -// -// Given connection was not found in the session. -// -#define ISDSC_INVALID_CONNECTION_ID ((ISDSC_STATUS)0xEFFF0063L) - -// -// MessageId: ISDSC_CANNOT_REMOVE_LEADING_CONNECTION -// -// MessageText: -// -// The leading connection in the session cannot be removed. -// -#define ISDSC_CANNOT_REMOVE_LEADING_CONNECTION ((ISDSC_STATUS)0xEFFF0064L) - -// -// MessageId: ISDSC_RESTRICTED_BY_GROUP_POLICY -// -// MessageText: -// -// The operation cannot be performed since it does not conform with the group policy assigned to this computer. -// -#define ISDSC_RESTRICTED_BY_GROUP_POLICY ((ISDSC_STATUS)0xEFFF0065L) - -// -// MessageId: ISDSC_ISNS_FIREWALL_BLOCKED -// -// MessageText: -// -// The operation cannot be performed since the Internet Storage Name Server (iSNS) firewall exception has not been enabled. -// -#define ISDSC_ISNS_FIREWALL_BLOCKED ((ISDSC_STATUS)0xEFFF0066L) - -// -// MessageId: ISDSC_FAILURE_TO_PERSIST_LB_POLICY -// -// MessageText: -// -// Failed to persist load balancing policy parameters. -// -#define ISDSC_FAILURE_TO_PERSIST_LB_POLICY ((ISDSC_STATUS)0xEFFF0067L) - -// -// MessageId: ISDSC_INVALID_HOST -// -// MessageText: -// -// The name could not be resolved to an IP Address. -// -#define ISDSC_INVALID_HOST ((ISDSC_STATUS)0xEFFF0068L) - -#endif /* _ISCSIERR_ */ - diff --git a/qt-correction-tool/pub/ddk/iscsifnd.h b/qt-correction-tool/pub/ddk/iscsifnd.h deleted file mode 100644 index 4e73340..0000000 --- a/qt-correction-tool/pub/ddk/iscsifnd.h +++ /dev/null @@ -1,274 +0,0 @@ -#ifndef _iscsifnd_h_ -#define _iscsifnd_h_ - -// ISCSI_DiscoveredTargetPortal - ISCSI_DiscoveredTargetPortal -// iSCSI target portal - - -//*************************************************************************** -// -// iscsifnd.h -// -// Module: iScsi Discovery api -// -// Purpose: Header defining interface between user mode discovery -// engine and HBA driver miniport. -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -#include - - -#define ISCSI_DiscoveredTargetPortalGuid \ - { 0xfa218c5d,0xb306,0x4d5d, { 0xb2,0xdb,0x6b,0xba,0x05,0x0f,0xd8,0xfa } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTargetPortal_GUID, \ - 0xfa218c5d,0xb306,0x4d5d,0xb2,0xdb,0x6b,0xba,0x05,0x0f,0xd8,0xfa); -#endif - - -typedef struct _ISCSI_DiscoveredTargetPortal -{ - // Socket number - USHORT Socket; - #define ISCSI_DiscoveredTargetPortal_Socket_SIZE sizeof(USHORT) - #define ISCSI_DiscoveredTargetPortal_Socket_ID 1 - - // Network Address - ISCSI_IP_Address Address; - #define ISCSI_DiscoveredTargetPortal_Address_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_DiscoveredTargetPortal_Address_ID 2 - - // Portal Symbolic Name - WCHAR SymbolicName[256 + 1]; - #define ISCSI_DiscoveredTargetPortal_SymbolicName_ID 3 - -} ISCSI_DiscoveredTargetPortal, *PISCSI_DiscoveredTargetPortal; - -// ISCSI_DiscoveredTargetPortalGroup - ISCSI_DiscoveredTargetPortalGroup -// iSCSI target portal group -#define ISCSI_DiscoveredTargetPortalGroupGuid \ - { 0x28c3af2c,0xa453,0x4a3d, { 0x8e,0x10,0x9e,0x09,0xd8,0x9e,0xf3,0x33 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTargetPortalGroup_GUID, \ - 0x28c3af2c,0xa453,0x4a3d,0x8e,0x10,0x9e,0x09,0xd8,0x9e,0xf3,0x33); -#endif - - -typedef struct _ISCSI_DiscoveredTargetPortalGroup -{ - // Number of portals in group - ULONG PortalCount; - #define ISCSI_DiscoveredTargetPortalGroup_PortalCount_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTargetPortalGroup_PortalCount_ID 1 - - // Target portals in group. NOTE: this field is a variable length array. - ISCSI_DiscoveredTargetPortal Portals[1]; - #define ISCSI_DiscoveredTargetPortalGroup_Portals_ID 2 - -} ISCSI_DiscoveredTargetPortalGroup, *PISCSI_DiscoveredTargetPortalGroup; - -// ISCSI_DiscoveredTarget - ISCSI_DiscoveredTarget -// ISCSI discovered target information -#define ISCSI_DiscoveredTargetGuid \ - { 0x08cdf465,0xe18d,0x42fe, { 0x8e,0xb2,0x56,0x8c,0xa9,0x6a,0x98,0x56 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTarget_GUID, \ - 0x08cdf465,0xe18d,0x42fe,0x8e,0xb2,0x56,0x8c,0xa9,0x6a,0x98,0x56); -#endif - - -typedef struct _ISCSI_DiscoveredTarget -{ - // Number of portal groups for target - ULONG TargetPortalGroupCount; - #define ISCSI_DiscoveredTarget_TargetPortalGroupCount_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTarget_TargetPortalGroupCount_ID 1 - - // Target Name - WCHAR TargetName[223 + 1]; - #define ISCSI_DiscoveredTarget_TargetName_ID 2 - - // Target Alias - WCHAR TargetAlias[255 + 1]; - #define ISCSI_DiscoveredTarget_TargetAlias_ID 3 - - // Portal Groups available for connection to target. NOTE: this field is a variable length array - ISCSI_DiscoveredTargetPortalGroup TargetDiscoveredPortalGroups[1]; - #define ISCSI_DiscoveredTarget_TargetDiscoveredPortalGroups_ID 4 - -} ISCSI_DiscoveredTarget, *PISCSI_DiscoveredTarget; - -// ISCSI_DiscoveredTargetPortal2 - ISCSI_DiscoveredTargetPortal2 -// iSCSI target portal -#define ISCSI_DiscoveredTargetPortal2Guid \ - { 0xe95162a2,0x8ee5,0x40f1, { 0xb0,0x5d,0xa5,0x32,0x1a,0x30,0xd0,0x3d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTargetPortal2_GUID, \ - 0xe95162a2,0x8ee5,0x40f1,0xb0,0x5d,0xa5,0x32,0x1a,0x30,0xd0,0x3d); -#endif - - -typedef struct _ISCSI_DiscoveredTargetPortal2 -{ - // Socket number - USHORT Socket; - #define ISCSI_DiscoveredTargetPortal2_Socket_SIZE sizeof(USHORT) - #define ISCSI_DiscoveredTargetPortal2_Socket_ID 1 - - // Network Address - ISCSI_IP_Address Address; - #define ISCSI_DiscoveredTargetPortal2_Address_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_DiscoveredTargetPortal2_Address_ID 2 - - // Security capabilities bitmap as specified in iSNS spec - ULONG SecurityBitmap; - #define ISCSI_DiscoveredTargetPortal2_SecurityBitmap_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTargetPortal2_SecurityBitmap_ID 3 - - // Number of bytes contained in key associated with portal address - ULONG KeySize; - #define ISCSI_DiscoveredTargetPortal2_KeySize_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTargetPortal2_KeySize_ID 4 - - // Key associated with portal address. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. All fields after this are commented out in the header. - UCHAR Key[1]; - #define ISCSI_DiscoveredTargetPortal2_Key_ID 5 - - // Portal Symbolic Name -// WCHAR SymbolicName[256 + 1]; - #define ISCSI_DiscoveredTargetPortal2_SymbolicName_ID 6 - -} ISCSI_DiscoveredTargetPortal2, *PISCSI_DiscoveredTargetPortal2; - -// ISCSI_DiscoveredTargetPortalGroup2 - ISCSI_DiscoveredTargetPortalGroup2 -// iSCSI target portal group -#define ISCSI_DiscoveredTargetPortalGroup2Guid \ - { 0x1732b30d,0xee08,0x4de7, { 0xbe,0xd1,0xde,0x16,0x5f,0x1d,0x7b,0x45 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTargetPortalGroup2_GUID, \ - 0x1732b30d,0xee08,0x4de7,0xbe,0xd1,0xde,0x16,0x5f,0x1d,0x7b,0x45); -#endif - - -typedef struct _ISCSI_DiscoveredTargetPortalGroup2 -{ - // Number of portals in group - ULONG PortalCount; - #define ISCSI_DiscoveredTargetPortalGroup2_PortalCount_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTargetPortalGroup2_PortalCount_ID 1 - - // portal group tag - USHORT Tag; - #define ISCSI_DiscoveredTargetPortalGroup2_Tag_SIZE sizeof(USHORT) - #define ISCSI_DiscoveredTargetPortalGroup2_Tag_ID 2 - - // Target portals in group. NOTE: This field is a variable length array. - ISCSI_DiscoveredTargetPortal2 Portals[1]; - #define ISCSI_DiscoveredTargetPortalGroup2_Portals_ID 3 - -} ISCSI_DiscoveredTargetPortalGroup2, *PISCSI_DiscoveredTargetPortalGroup2; - -// ISCSI_DiscoveredTarget2 - ISCSI_DiscoveredTarget2 -// ISCSI discovered target information -#define ISCSI_DiscoveredTarget2Guid \ - { 0xa71bcde9,0x5433,0x4b36, { 0xb9,0xc1,0x07,0x86,0x8e,0x18,0xb4,0x8a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_DiscoveredTarget2_GUID, \ - 0xa71bcde9,0x5433,0x4b36,0xb9,0xc1,0x07,0x86,0x8e,0x18,0xb4,0x8a); -#endif - - -typedef struct _ISCSI_DiscoveredTarget2 -{ - // Number of portal groups for target - ULONG TargetPortalGroupCount; - #define ISCSI_DiscoveredTarget2_TargetPortalGroupCount_SIZE sizeof(ULONG) - #define ISCSI_DiscoveredTarget2_TargetPortalGroupCount_ID 1 - - // Target Name - WCHAR TargetName[223 + 1]; - #define ISCSI_DiscoveredTarget2_TargetName_ID 2 - - // Target Alias - WCHAR TargetAlias[255 + 1]; - #define ISCSI_DiscoveredTarget2_TargetAlias_ID 3 - - // Portal Groups available for connection to target. NOTE: This field is a variable length array. - ISCSI_DiscoveredTargetPortalGroup2 TargetDiscoveredPortalGroups[1]; - #define ISCSI_DiscoveredTarget2_TargetDiscoveredPortalGroups_ID 4 - -} ISCSI_DiscoveredTarget2, *PISCSI_DiscoveredTarget2; - -// MSiSCSI_DiscoveryOperations - MSiSCSI_DiscoveryOperations -// Discovery operations - -// -// This class is required -// -// This class exposes the configuration capabilities if the adapter is able to -// perform target discovery. An adapter would need to support target discovery -// if it is ever placed on a separate network from the PC NIC. -// -// This classes uses PDO instance names with a single instance -// - -#define MSiSCSI_DiscoveryOperationsGuid \ - { 0x556bc0b0,0x0fb5,0x40f2, { 0x92,0x55,0xb7,0xd9,0xa6,0x69,0xda,0xec } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_DiscoveryOperations_GUID, \ - 0x556bc0b0,0x0fb5,0x40f2,0x92,0x55,0xb7,0xd9,0xa6,0x69,0xda,0xec); -#endif - -// -// Method id definitions for MSiSCSI_DiscoveryOperations -#define ReportDiscoveredTargets 10 -typedef struct _ReportDiscoveredTargets_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ReportDiscoveredTargets_OUT_Status_SIZE sizeof(ULONG) - #define ReportDiscoveredTargets_OUT_Status_ID 1 - - // Number of targets discovered - ULONG TargetCount; - #define ReportDiscoveredTargets_OUT_TargetCount_SIZE sizeof(ULONG) - #define ReportDiscoveredTargets_OUT_TargetCount_ID 2 - - // Targets that have been discovered. NOTE: This field is a variabale length array. - ISCSI_DiscoveredTarget Targets[1]; - #define ReportDiscoveredTargets_OUT_Targets_ID 3 - -} ReportDiscoveredTargets_OUT, *PReportDiscoveredTargets_OUT; - -#define ReportDiscoveredTargets2 11 -typedef struct _ReportDiscoveredTargets2_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ReportDiscoveredTargets2_OUT_Status_SIZE sizeof(ULONG) - #define ReportDiscoveredTargets2_OUT_Status_ID 1 - - // Number of targets discovered - ULONG TargetCount; - #define ReportDiscoveredTargets2_OUT_TargetCount_SIZE sizeof(ULONG) - #define ReportDiscoveredTargets2_OUT_TargetCount_ID 2 - - // Targets that have been discovered. NOTE: This field is a variabale length array. - ISCSI_DiscoveredTarget2 Targets[1]; - #define ReportDiscoveredTargets2_OUT_Targets_ID 3 - -} ReportDiscoveredTargets2_OUT, *PReportDiscoveredTargets2_OUT; - - -#endif - diff --git a/qt-correction-tool/pub/ddk/iscsilog.h b/qt-correction-tool/pub/ddk/iscsilog.h deleted file mode 100644 index 5e3a6f7..0000000 --- a/qt-correction-tool/pub/ddk/iscsilog.h +++ /dev/null @@ -1,737 +0,0 @@ -/*++ - -Copyright (c) 1991 Microsoft Corporation - -Module Name: - - iscsilog.h - -Abstract: - - Constant definitions for the iSCSI error code log values. - ---*/ - -#ifndef _ISCSILOG_ -#define _ISCSILOG_ - -// -// Status values are 32 bit values layed out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-------------------------+-------------------------------+ -// |Sev|C| Facility | Code | -// +---+-+-------------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// Facility - is the facility code -// -// Code - is the facility's status code -// - -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_WARNING 0x2 -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_INFORMATIONAL 0x1 -#define STATUS_SEVERITY_ERROR 0x3 - - -// -// MessageId: ISCSI_ERR_TDI_CONNECT_FAILED -// -// MessageText: -// -// Initiator failed to connect to the target. Target IP address and TCP Port number are given in dump data. -// -#define ISCSI_ERR_TDI_CONNECT_FAILED ((NTSTATUS)0xC0000001L) - -// -// MessageId: ISCSI_ERR_INSUFFICIENT_SESSION_RESOURCES -// -// MessageText: -// -// The initiator could not allocate resources for an iSCSI session. -// -#define ISCSI_ERR_INSUFFICIENT_SESSION_RESOURCES ((NTSTATUS)0xC0000002L) - -// -// MessageId: ISCSI_ERR_INVALID_COMMAND_SEQUENCE_NUMBER -// -// MessageText: -// -// Maximum command sequence number is not serially greater than expected command sequence number in login response. -// Dump data contains Expected Command Sequence number followed by Maximum Command Sequence number. -// -#define ISCSI_ERR_INVALID_COMMAND_SEQUENCE_NUMBER ((NTSTATUS)0xC0000003L) - -// -// MessageId: ISCSI_ERR_INVALID_BURST_LENGTH -// -// MessageText: -// -// MaxBurstLength is not serially greater than FirstBurstLength. -// Dump data contains FirstBurstLength followed by MaxBurstLength. -// -#define ISCSI_ERR_INVALID_BURST_LENGTH ((NTSTATUS)0xC0000004L) - -// -// MessageId: ISCSI_ERR_SETUP_NETWORK_NODE -// -// MessageText: -// -// Failed to setup initiator portal. Error status is given in the dump data. -// -#define ISCSI_ERR_SETUP_NETWORK_NODE ((NTSTATUS)0xC0000005L) - -// -// MessageId: ISCSI_ERR_INSUFFICIENT_CONNECTION_RESOURCES -// -// MessageText: -// -// The initiator could not allocate resources for an iSCSI connection -// -#define ISCSI_ERR_INSUFFICIENT_CONNECTION_RESOURCES ((NTSTATUS)0xC0000006L) - -// -// MessageId: ISCSI_ERR_SEND_FAILED -// -// MessageText: -// -// The initiator could not send an iSCSI PDU. Error status is given in the dump data. -// -#define ISCSI_ERR_SEND_FAILED ((NTSTATUS)0xC0000007L) - -// -// MessageId: ISCSI_ERR_ISCSI_REQUEST_TIMEOUT -// -// MessageText: -// -// Target or discovery service did not respond in time for an iSCSI request sent by the initiator. -// iSCSI Function code is given in the dump data. For details about iSCSI Function code please refer -// to iSCSI User's Guide. -// -#define ISCSI_ERR_ISCSI_REQUEST_TIMEOUT ((NTSTATUS)0xC0000008L) - -// -// MessageId: ISCSI_ERR_SCSI_REQUEST_TIMEOUT -// -// MessageText: -// -// Target did not respond in time for a SCSI request. The CDB is given in the dump data. -// -#define ISCSI_ERR_SCSI_REQUEST_TIMEOUT ((NTSTATUS)0xC0000009L) - -// -// MessageId: ISCSI_ERR_LOGIN_FAILED -// -// MessageText: -// -// Login request failed. The login response packet is given in the dump data. -// -#define ISCSI_ERR_LOGIN_FAILED ((NTSTATUS)0xC000000AL) - -// -// MessageId: ISCSI_ERR_LOGIN_PDU_ERROR -// -// MessageText: -// -// Target returned an invalid login response packet. The login response packet is given in the dump data. -// -#define ISCSI_ERR_LOGIN_PDU_ERROR ((NTSTATUS)0xC000000BL) - -// -// MessageId: ISCSI_ERR_INVALID_LOGIN_REDIRECT_DATA -// -// MessageText: -// -// Target provided invalid data for login redirect. Dump data contains the data returned by the target. -// -#define ISCSI_ERR_INVALID_LOGIN_REDIRECT_DATA ((NTSTATUS)0xC000000CL) - -// -// MessageId: ISCSI_ERR_INVALID_AUTHMETHOD -// -// MessageText: -// -// Target offered an unknown AuthMethod. Dump data contains the data returned by the target. -// -#define ISCSI_ERR_INVALID_AUTHMETHOD ((NTSTATUS)0xC000000DL) - -// -// MessageId: ISCSI_ERR_INVALID_CHAP_ALGORITHM -// -// MessageText: -// -// Target offered an unknown digest algorithm for CHAP. Dump data contains the data returned by the target. -// -#define ISCSI_ERR_INVALID_CHAP_ALGORITHM ((NTSTATUS)0xC000000EL) - -// -// MessageId: ISCSI_ERR_INVALID_CHAP_CHALLENGE -// -// MessageText: -// -// CHAP challenge given by the target contains invalid characters. Dump data contains the challenge given. -// -#define ISCSI_ERR_INVALID_CHAP_CHALLENGE ((NTSTATUS)0xC000000FL) - -// -// MessageId: ISCSI_ERR_INVALID_KEY_DURING_CHAP -// -// MessageText: -// -// An invalid key was received during CHAP negotiation. The key=value pair is given in the dump data. -// -#define ISCSI_ERR_INVALID_KEY_DURING_CHAP ((NTSTATUS)0xC0000010L) - -// -// MessageId: ISCSI_ERR_INVALID_CHAP_RESPONSE -// -// MessageText: -// -// CHAP Response given by the target did not match the expected one. Dump data contains the CHAP response. -// -#define ISCSI_ERR_INVALID_CHAP_RESPONSE ((NTSTATUS)0xC0000011L) - -// -// MessageId: ISCSI_ERR_HEADER_DIGEST_NEEDED -// -// MessageText: -// -// Header Digest is required by the initiator, but target did not offer it. -// -#define ISCSI_ERR_HEADER_DIGEST_NEEDED ((NTSTATUS)0xC0000012L) - -// -// MessageId: ISCSI_ERR_HEADER_DATA_NEEDED -// -// MessageText: -// -// Data Digest is required by the initiator, but target did not offer it. -// -#define ISCSI_ERR_HEADER_DATA_NEEDED ((NTSTATUS)0xC0000013L) - -// -// MessageId: ISCSI_ERR_CONNECTION_LOST -// -// MessageText: -// -// Connection to the target was lost. The initiator will attempt to retry the connection. -// -#define ISCSI_ERR_CONNECTION_LOST ((NTSTATUS)0xC0000014L) - -// -// MessageId: ISCSI_ERR_INVALID_DATA_SEGMENT_LENGTH -// -// MessageText: -// -// Data Segment Length given in the header exceeds MaxRecvDataSegmentLength declared by the target. -// -#define ISCSI_ERR_INVALID_DATA_SEGMENT_LENGTH ((NTSTATUS)0xC0000015L) - -// -// MessageId: ISCSI_ERR_HEADER_DIGEST_ERROR -// -// MessageText: -// -// Header digest error was detected for the given PDU. Dump data contains the header and digest. -// -#define ISCSI_ERR_HEADER_DIGEST_ERROR ((NTSTATUS)0xC0000016L) - -// -// MessageId: ISCSI_ERR_ISCSI_PDU_ERROR -// -// MessageText: -// -// Target sent an invalid iSCSI PDU. Dump data contains the entire iSCSI header. -// -#define ISCSI_ERR_ISCSI_PDU_ERROR ((NTSTATUS)0xC0000017L) - -// -// MessageId: ISCSI_ERR_UNKNOWN_ISCSI_OPCODE -// -// MessageText: -// -// Target sent an iSCSI PDU with an invalid opcode. Dump data contains the entire iSCSI header. -// -#define ISCSI_ERR_UNKNOWN_ISCSI_OPCODE ((NTSTATUS)0xC0000018L) - -// -// MessageId: ISCSI_ERR_DATA_DIGEST_ERROR -// -// MessageText: -// -// Data digest error was detected. Dump data contains the calculated checksum followed by the given checksum. -// -#define ISCSI_ERR_DATA_DIGEST_ERROR ((NTSTATUS)0xC0000019L) - -// -// MessageId: ISCSI_ERR_EXCESS_DATA_SENT -// -// MessageText: -// -// Target trying to send more data than requested by the initiator. -// -#define ISCSI_ERR_EXCESS_DATA_SENT ((NTSTATUS)0xC000001AL) - -// -// MessageId: ISCSI_ERR_UNEXPECTED_PDU -// -// MessageText: -// -// Initiator could not find a match for the initiator task tag in the received PDU. Dump data contains the entire iSCSI header. -// -#define ISCSI_ERR_UNEXPECTED_PDU ((NTSTATUS)0xC000001BL) - -// -// MessageId: ISCSI_ERR_INVALID_RTT_PDU -// -// MessageText: -// -// Initiator received an invalid R2T packet. Dump data contains the entire iSCSI header. -// -#define ISCSI_ERR_INVALID_RTT_PDU ((NTSTATUS)0xC000001CL) - -// -// MessageId: ISCSI_ERR_ISCSI_PDU_REJECTED -// -// MessageText: -// -// Target rejected an iSCSI PDU sent by the initiator. Dump data contains the rejected PDU. -// -#define ISCSI_ERR_ISCSI_PDU_REJECTED ((NTSTATUS)0xC000001DL) - -// -// MessageId: ISCSI_ERR_INSUFFICIENT_WORKITEM_RESOURCES -// -// MessageText: -// -// Initiator could not allocate a workitem for processing a request. -// -#define ISCSI_ERR_INSUFFICIENT_WORKITEM_RESOURCES ((NTSTATUS)0xC000001EL) - -// -// MessageId: ISCSI_ERR_INSUFFICIENT_REQ_PACKET_RESOURCES -// -// MessageText: -// -// Initiator could not allocate resource for processing a request. -// -#define ISCSI_ERR_INSUFFICIENT_REQ_PACKET_RESOURCES ((NTSTATUS)0xC000001FL) - -// -// MessageId: ISCSI_INFO_RECEIVED_ASYNC_LOGOUT -// -// MessageText: -// -// Initiator received an asynchronous logout message. The Target name is given in the dump data. -// -#define ISCSI_INFO_RECEIVED_ASYNC_LOGOUT ((NTSTATUS)0x40000020L) - -// -// MessageId: ISCSI_ERR_INVALID_CHAP_CHALLENGE_SIZE -// -// MessageText: -// -// Challenge size given by the target exceeds the maximum specified in iSCSI specification. -// -#define ISCSI_ERR_INVALID_CHAP_CHALLENGE_SIZE ((NTSTATUS)0xC0000021L) - -// -// MessageId: ISCSI_INFO_RECONNECTED_TO_TARGET -// -// MessageText: -// -// A connection to the target was lost, but Initiator successfully reconnected to the target. Dump data contains the target name. -// -#define ISCSI_INFO_RECONNECTED_TO_TARGET ((NTSTATUS)0x40000022L) - -// -// MessageId: ISCSI_ERR_INVALID_TARGET_CHAP_SECRET -// -// MessageText: -// -// Target CHAP secret is smaller than the minimum size (12 bytes) required by the spec. -// -#define ISCSI_ERR_INVALID_TARGET_CHAP_SECRET ((NTSTATUS)0xC0000023L) - -// -// MessageId: ISCSI_ERR_INVALID_INITIATOR_CHAP_SECRET -// -// MessageText: -// -// Initiator CHAP secret is smaller than the minimum size (12 bytes) required by the spec. Dump data contains the given CHAP secret. -// -#define ISCSI_ERR_INVALID_INITIATOR_CHAP_SECRET ((NTSTATUS)0xC0000024L) - -// -// MessageId: ISCSI_ERR_FIPS_NOT_AVAILABLE -// -// MessageText: -// -// FIPS service could not be initialized. Persistent logons will not be processed. -// -#define ISCSI_ERR_FIPS_NOT_AVAILABLE ((NTSTATUS)0xC0000025L) - -// -// MessageId: ISCSI_ERR_CHAP_NOT_OFFERED -// -// MessageText: -// -// Initiator requires CHAP for logon authentication, but target did not offer CHAP. -// -#define ISCSI_ERR_CHAP_NOT_OFFERED ((NTSTATUS)0xC0000026L) - -// -// MessageId: ISCSI_ERR_DEVICE_RESET -// -// MessageText: -// -// Initiator sent a task management command to reset the target. The target name is given in the dump data. -// -#define ISCSI_ERR_DEVICE_RESET ((NTSTATUS)0xC0000027L) - -// -// MessageId: ISCSI_ERR_CHAP_OFFERED -// -// MessageText: -// -// Target requires logon authentication via CHAP, but Initiator is not configured to perform CHAP. -// -#define ISCSI_ERR_CHAP_OFFERED ((NTSTATUS)0xC0000028L) - -// -// MessageId: ISCSI_ERR_AUTH_METHOD_NOT_OFFERED -// -// MessageText: -// -// Target did not send AuthMethod key during security negotiation phase. -// -#define ISCSI_ERR_AUTH_METHOD_NOT_OFFERED ((NTSTATUS)0xC0000029L) - -// -// MessageId: ISCSI_ERR_INVALID_STATUS_SEQ_NUM -// -// MessageText: -// -// Target sent an invalid status sequence number for a connection. Dump data contains -// Expected Status Sequence number followed by the given status sequence number. -// -#define ISCSI_ERR_INVALID_STATUS_SEQ_NUM ((NTSTATUS)0xC000002AL) - -// -// MessageId: ISCSI_ERR_LOGIN_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time for a login request. -// -#define ISCSI_ERR_LOGIN_TIMED_OUT ((NTSTATUS)0xC000002BL) - -// -// MessageId: ISCSI_ERR_LOGOUT_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time for a logout request. -// -#define ISCSI_ERR_LOGOUT_TIMED_OUT ((NTSTATUS)0xC000002CL) - -// -// MessageId: ISCSI_ERR_ADDCONNECTION_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time for a login request. This login request was for adding a new connection to a session. -// -#define ISCSI_ERR_ADDCONNECTION_TIMED_OUT ((NTSTATUS)0xC000002DL) - -// -// MessageId: ISCSI_ERR_SENDTARGETS_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time for a SendTargets command. -// -#define ISCSI_ERR_SENDTARGETS_TIMED_OUT ((NTSTATUS)0xC000002EL) - -// -// MessageId: ISCSI_ERR_SCSICOMMAND_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time for a SCSI command sent through a WMI request. -// -#define ISCSI_ERR_SCSICOMMAND_TIMED_OUT ((NTSTATUS)0xC000002FL) - -// -// MessageId: ISCSI_ERR_NOP_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time to a NOP request. -// -#define ISCSI_ERR_NOP_TIMED_OUT ((NTSTATUS)0xC0000030L) - -// -// MessageId: ISCSI_ERR_TASKMGMT_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time to a Task Management request. -// -#define ISCSI_ERR_TASKMGMT_TIMED_OUT ((NTSTATUS)0xC0000031L) - -// -// MessageId: ISCSI_ERR_ASYNC_TEXT_CMD_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time to a Text Command sent to renegotiate iSCSI parameters. -// -#define ISCSI_ERR_ASYNC_TEXT_CMD_TIMED_OUT ((NTSTATUS)0xC0000032L) - -// -// MessageId: ISCSI_ERR_ASYNC_LOGOUT_TIMED_OUT -// -// MessageText: -// -// Target failed to respond in time to a logout request sent in response to an asynchronous message from the target. -// -#define ISCSI_ERR_ASYNC_LOGOUT_TIMED_OUT ((NTSTATUS)0xC0000033L) - -// -// MessageId: ISCSI_ERR_CONFIG_IPSEC_TIMED_OUT -// -// MessageText: -// -// Initiator Service failed to respond in time to a request to configure IPSec resources for an iSCSI connection. -// -#define ISCSI_ERR_CONFIG_IPSEC_TIMED_OUT ((NTSTATUS)0xC0000034L) - -// -// MessageId: ISCSI_ERR_RELEASE_IPSEC_TIMED_OUT -// -// MessageText: -// -// Initiator Service failed to respond in time to a request to release IPSec resources allocated for an iSCSI connection. -// -#define ISCSI_ERR_RELEASE_IPSEC_TIMED_OUT ((NTSTATUS)0xC0000035L) - -// -// MessageId: ISCSI_ERR_ENCRYPT_DECRYPT_TIMED_OUT -// -// MessageText: -// -// Initiator Service failed to respond in time to a request to encrypt or decrypt data. -// -#define ISCSI_ERR_ENCRYPT_DECRYPT_TIMED_OUT ((NTSTATUS)0xC0000036L) - -// -// MessageId: ISCSI_ERR_INSUFFICIENT_RESOURCES_FOR_SEND -// -// MessageText: -// -// Initiator failed to allocate resources to send data to target. -// -#define ISCSI_ERR_INSUFFICIENT_RESOURCES_FOR_SEND ((NTSTATUS)0xC0000037L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_GET_SYSTEM_ADDRESS -// -// MessageText: -// -// Initiator could not map an user virtual address to kernel virtual address resulting in I/O failure. -// -#define ISCSI_ERR_FAILED_TO_GET_SYSTEM_ADDRESS ((NTSTATUS)0xC0000038L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_ALLOCATE_RESOURCES_FOR_IO -// -// MessageText: -// -// Initiator could not allocate required resources for processing a request resulting in I/O failure. -// -#define ISCSI_ERR_FAILED_TO_ALLOCATE_RESOURCES_FOR_IO ((NTSTATUS)0xC0000039L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_ALLOCATE_REQUEST_TAG -// -// MessageText: -// -// Initiator could not allocate a tag for processing a request resulting in I/O failure. -// -#define ISCSI_ERR_FAILED_TO_ALLOCATE_REQUEST_TAG ((NTSTATUS)0xC000003AL) - -// -// MessageId: ISCSI_ERR_CONNECTION_DROPPED_BEFORE_FFP -// -// MessageText: -// -// Target dropped the connection before the initiator could transition to Full Feature Phase. -// -#define ISCSI_ERR_CONNECTION_DROPPED_BEFORE_FFP ((NTSTATUS)0xC000003BL) - -// -// MessageId: ISCSI_ERR_DATA_SENT_IN_SCSI_RESPONSE -// -// MessageText: -// -// Target sent data in SCSI Response PDU instead of Data_IN PDU. Only Sense Data can be sent in SCSI Response. -// -#define ISCSI_ERR_DATA_SENT_IN_SCSI_RESPONSE ((NTSTATUS)0xC000003CL) - -// -// MessageId: ISCSI_ERR_DATA_PDU_IN_ORDER_FALSE -// -// MessageText: -// -// Target set DataPduInOrder to NO when initiator requested YES. Login will be failed. -// -#define ISCSI_ERR_DATA_PDU_IN_ORDER_FALSE ((NTSTATUS)0xC000003DL) - -// -// MessageId: ISCSI_ERR_DATA_SEQ_IN_ORDER_FALSE -// -// MessageText: -// -// Target set DataSequenceInOrder to NO when initiator requested YES. Login will be failed. -// -#define ISCSI_ERR_DATA_SEQ_IN_ORDER_FALSE ((NTSTATUS)0xC000003EL) - -// -// MessageId: ISCSI_ERR_TOO_MANY_RESET_FAILURE -// -// MessageText: -// -// Can not Reset the Target or LUN. Will attempt session recovery. -// -#define ISCSI_ERR_TOO_MANY_RESET_FAILURE ((NTSTATUS)0xC000003FL) - -// -// MessageId: ISCSI_INFO_NIC_BOOT -// -// MessageText: -// -// Attempt to bootstrap Windows using iSCSI NIC Boot (iBF) -// -#define ISCSI_INFO_NIC_BOOT ((NTSTATUS)0x40000040L) - -// -// MessageId: ISCSI_PAGING_IRP_ERROR -// -// MessageText: -// -// Booting from iSCSI, but Could not set any NIC in Paging Path. -// -#define ISCSI_PAGING_IRP_ERROR ((NTSTATUS)0xC0000041L) - -// -// MessageId: ISCSI_ERR_DISABLE_NAGLE -// -// MessageText: -// -// Attempt to disable the Nagle Algorithm for iSCSI connection failed. -// -#define ISCSI_ERR_DISABLE_NAGLE ((NTSTATUS)0xC0000042L) - -// -// MessageId: ISCSI_USING_PROCESSOR_CRC32 -// -// MessageText: -// -// If Digest support selected for iSCSI Session, Will use Processor support for Digest computation. -// -#define ISCSI_USING_PROCESSOR_CRC32 ((NTSTATUS)0x40000043L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_RECOVER_SESSION_AFTER_ASYNCLOGOUT -// -// MessageText: -// -// After receiving an async logout from the target, attempt to relogin the session failed. Error status is given in the dump data. -// -#define ISCSI_ERR_FAILED_TO_RECOVER_SESSION_AFTER_ASYNCLOGOUT ((NTSTATUS)0xC0000044L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_RECOVER_UNEXPECTED_TERMINATED_SESSION -// -// MessageText: -// -// Attempt to recover an unexpected terminated session failed. Error status is given in the dump data. -// -#define ISCSI_ERR_FAILED_TO_RECOVER_UNEXPECTED_TERMINATED_SESSION ((NTSTATUS)0xC0000045L) - -// -// MessageId: ISCSI_ERR_FAILED_TO_PROCESS_LOGON_REQUEST -// -// MessageText: -// -// Error occurred when processing iSCSI logon request. The request was not retried. Error status is given in the dump data. -// -#define ISCSI_ERR_FAILED_TO_PROCESS_LOGON_REQUEST ((NTSTATUS)0xC0000046L) - -// -// MessageId: ISCSI_SESSION_RECOVERY_REQUEST_NOT_STARTED -// -// MessageText: -// -// Initiator did not start a session recovery upon receiving the request. Dump data contains the error status. -// -#define ISCSI_SESSION_RECOVERY_REQUEST_NOT_STARTED ((NTSTATUS)0x40000047L) - -// -// MessageId: ISCSI_UNEXPECTED_TARGET_PORTAL_IP_TYPE -// -// MessageText: -// -// Unexpected target portal IP types. Dump data contains the expected IP type. -// -#define ISCSI_UNEXPECTED_TARGET_PORTAL_IP_TYPE ((NTSTATUS)0xC0000048L) - -#endif /* _ISCSILOG_ */ - diff --git a/qt-correction-tool/pub/ddk/iscsimgt.h b/qt-correction-tool/pub/ddk/iscsimgt.h deleted file mode 100644 index 6a71277..0000000 --- a/qt-correction-tool/pub/ddk/iscsimgt.h +++ /dev/null @@ -1,1143 +0,0 @@ -#ifndef _iscsimgt_h_ -#define _iscsimgt_h_ - -// MSiSCSI_HBAInformation - MSiSCSI_HBAInformation - - -//*************************************************************************** -// -// iscsimgt.h -// -// Module: iScsi Discovery api -// -// Purpose: Internal header defining interface between user mode discovery -// api dll and HBA driver miniport. -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -#include - -// -// -// This class is required. -// -// Adapter Information class. The iSCSI initiator service relies upon this -// class in order to interface with your adapter. Implement one instance -// per adapter instance. -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_HBAInformationGuid \ - { 0x58515bf3,0x2f59,0x4f37, { 0xb7,0x4f,0x85,0xae,0xec,0x65,0x2a,0xd6 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_HBAInformation_GUID, \ - 0x58515bf3,0x2f59,0x4f37,0xb7,0x4f,0x85,0xae,0xec,0x65,0x2a,0xd6); -#endif - - -typedef struct _MSiSCSI_HBAInformation -{ - // Id that is globally unique for all instances of iSCSI initiators. Use the address of the Adapter Extension or another address owned by the device driver. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_HBAInformation_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_HBAInformation_UniqueAdapterId_ID 1 - - // TRUE if TCP/IP traffic is integrated with the Windows networking TCP/IP stack via a software only initiator. An adapter with its own TCP/IP stack would set this to FALSE. - BOOLEAN IntegratedTCPIP; - #define MSiSCSI_HBAInformation_IntegratedTCPIP_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBAInformation_IntegratedTCPIP_ID 2 - - // If TRUE the iSCSI Initiator service will perform any DNS lookup and pass binary IP addresses to the adapter; the adapter must be on the same network as the Windows TCP/IP stack. If FALSE then DNS must be available on adapter. - BOOLEAN RequiresBinaryIpAddresses; - #define MSiSCSI_HBAInformation_RequiresBinaryIpAddresses_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBAInformation_RequiresBinaryIpAddresses_ID 3 - - // Minimum version number of the iScsi spec supported by adapter - UCHAR VersionMin; - #define MSiSCSI_HBAInformation_VersionMin_SIZE sizeof(UCHAR) - #define MSiSCSI_HBAInformation_VersionMin_ID 4 - - // Maximum version number of the iSCSI spec supported by adapter - UCHAR VersionMax; - #define MSiSCSI_HBAInformation_VersionMax_SIZE sizeof(UCHAR) - #define MSiSCSI_HBAInformation_VersionMax_ID 5 - - // TRUE if this adapter is a multifunction device, that is it also exposes a netcard interface - BOOLEAN MultifunctionDevice; - #define MSiSCSI_HBAInformation_MultifunctionDevice_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBAInformation_MultifunctionDevice_ID 6 - - // TRUE if the adapter caches are valid - BOOLEAN CacheValid; - #define MSiSCSI_HBAInformation_CacheValid_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBAInformation_CacheValid_ID 7 - - // Number of ports (or TCP/IP addresses) on the adapter - ULONG NumberOfPorts; - #define MSiSCSI_HBAInformation_NumberOfPorts_SIZE sizeof(ULONG) - #define MSiSCSI_HBAInformation_NumberOfPorts_ID 8 - - -#define ISCSI_HBA_STATUS_WORKING 0 -#define ISCSI_HBA_STATUS_DEGRADED 1 -#define ISCSI_HBA_STATUS_CRITICAL 2 -#define ISCSI_HBA_STATUS_FAILED 3 - - // **typedef** Current status of adapter - ULONG Status; - #define MSiSCSI_HBAInformation_Status_SIZE sizeof(ULONG) - #define MSiSCSI_HBAInformation_Status_ID 9 - - - -// -// Flags that define the functionality supported by the HBA -// -#define ISCSI_HBA_PRESHARED_KEY_CACHE 0x00000001 -#define ISCSI_HBA_ISCSI_AUTHENTICATION_CACHE 0x00000002 -#define ISCSI_HBA_IPSEC_TUNNEL_MODE 0x00000004 -#define ISCSI_HBA_CHAP_VIA_RADIUS 0x00000008 -#define ISCSI_HBA_ISNS_DISCOVERY 0x00000010 -#define ISCSI_HBA_SLP_DISCOVERY 0x00000020 - - - // **typedef** Bit flags that indicate various functionality supported - ULONG FunctionalitySupported; - #define MSiSCSI_HBAInformation_FunctionalitySupported_SIZE sizeof(ULONG) - #define MSiSCSI_HBAInformation_FunctionalitySupported_ID 10 - - // This is the GUID value last set by the SetGenerationalGuid method in the MSiSCSI_Operations class. - UCHAR GenerationalGuid[16]; - #define MSiSCSI_HBAInformation_GenerationalGuid_SIZE sizeof(UCHAR[16]) - #define MSiSCSI_HBAInformation_GenerationalGuid_ID 11 - - // Maxumum CDB length supported by the adapter - ULONG MaxCDBLength; - #define MSiSCSI_HBAInformation_MaxCDBLength_SIZE sizeof(ULONG) - #define MSiSCSI_HBAInformation_MaxCDBLength_ID 12 - - // TRUE if Bi-directionsal SCSI comamnd supported - BOOLEAN BiDiScsiCommands; - #define MSiSCSI_HBAInformation_BiDiScsiCommands_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBAInformation_BiDiScsiCommands_ID 13 - - // A text string describing the manufacturer of adapter - WCHAR VendorID[255 + 1]; - #define MSiSCSI_HBAInformation_VendorID_ID 14 - - // A text string set by the manufacturer describing the model of adapter - WCHAR VendorModel[255 + 1]; - #define MSiSCSI_HBAInformation_VendorModel_ID 15 - - // A text string set by the manufacturer describing the version of adapter - WCHAR VendorVersion[255 + 1]; - #define MSiSCSI_HBAInformation_VendorVersion_ID 16 - - // A text string set by the manufacturer describing the firmware version of adapter - WCHAR FirmwareVersion[255 + 1]; - #define MSiSCSI_HBAInformation_FirmwareVersion_ID 17 - - // A text string set by the manufacturer describing the Asic version - WCHAR AsicVersion[255 + 1]; - #define MSiSCSI_HBAInformation_AsicVersion_ID 18 - - // A text string set by the manufacturer describing the option rom version of adapter - WCHAR OptionRomVersion[255 + 1]; - #define MSiSCSI_HBAInformation_OptionRomVersion_ID 19 - - // A text string set by the manufacturer describing the serial number of adapter - WCHAR SerialNumber[255 + 1]; - #define MSiSCSI_HBAInformation_SerialNumber_ID 20 - - // A text string specifying the name of the driver for the adapter - WCHAR DriverName[255 + 1]; - #define MSiSCSI_HBAInformation_DriverName_ID 21 - -} MSiSCSI_HBAInformation, *PMSiSCSI_HBAInformation; - -// MSiSCSI_HBASessionConfig - MSiSCSI_HBASessionConfig - -// -// -// This class is optional. -// -// This class allows the default session configuration to be managed. It -// contains the default values to use when establishing a session. -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_HBASessionConfigGuid \ - { 0xb35694de,0xd323,0x49d2, { 0xab,0xb2,0x81,0x39,0x20,0x9a,0xd1,0x50 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_HBASessionConfig_GUID, \ - 0xb35694de,0xd323,0x49d2,0xab,0xb2,0x81,0x39,0x20,0x9a,0xd1,0x50); -#endif - - -typedef struct _MSiSCSI_HBASessionConfig -{ - // The InitialR2T key is used to turn off the default use of R2T, thus allowing an initiator to start sending data to a target as if it has received an initial R2T with Buffer Offset=0 and Desired Data Transfer Length=min (FirstBurstSize, Expected Data Transfer Length). - BOOLEAN InitialR2T; - #define MSiSCSI_HBASessionConfig_InitialR2T_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBASessionConfig_InitialR2T_ID 1 - - // The initiator and target negotiate support for immediate data. To turn immediate data off, the initiator or target must state its desire to do so. ImmediateData can be turned on if both the initiator and target have ImmediateData=Yes. - BOOLEAN ImmediateData; - #define MSiSCSI_HBASessionConfig_ImmediateData_SIZE sizeof(BOOLEAN) - #define MSiSCSI_HBASessionConfig_ImmediateData_ID 2 - - // Maximum data segment length in bytes they can receive in an iSCSI PDU. - ULONG MaxRecvDataSegmentLength; - #define MSiSCSI_HBASessionConfig_MaxRecvDataSegmentLength_SIZE sizeof(ULONG) - #define MSiSCSI_HBASessionConfig_MaxRecvDataSegmentLength_ID 3 - - // Maximum SCSI data payload in bytes in an Data-In or a solicited Data-Out iSCSI sequence. - ULONG MaxBurstLength; - #define MSiSCSI_HBASessionConfig_MaxBurstLength_SIZE sizeof(ULONG) - #define MSiSCSI_HBASessionConfig_MaxBurstLength_ID 4 - - // maximum amount in bytes of unsolicited data an iSCSI initiator may send to the target, during the execution of a single SCSI command. This covers the immediate data (if any) and the sequence of unsolicited Data-Out PDUs (if any) that follow the command. - ULONG FirstBurstLength; - #define MSiSCSI_HBASessionConfig_FirstBurstLength_SIZE sizeof(ULONG) - #define MSiSCSI_HBASessionConfig_FirstBurstLength_ID 5 - - // Initiator and target negotiate the maximum number of outstanding R2Ts per task, excluding any implied initial R2T that might be part of that task. An R2T is considered outstanding until the last data PDU (with the F bit set to 1) is transferred, or a sequence reception timeout (section 6.12.1) is encountered for that data sequence. - ULONG MaxOutstandingR2T; - #define MSiSCSI_HBASessionConfig_MaxOutstandingR2T_SIZE sizeof(ULONG) - #define MSiSCSI_HBASessionConfig_MaxOutstandingR2T_ID 6 - -} MSiSCSI_HBASessionConfig, *PMSiSCSI_HBASessionConfig; - -#define MSiSCSI_HBASessionConfig_SIZE (FIELD_OFFSET(MSiSCSI_HBASessionConfig, MaxOutstandingR2T) + MSiSCSI_HBASessionConfig_MaxOutstandingR2T_SIZE) - -// ISCSI_ConnectionStaticInfo - ISCSI_ConnectionStaticInfo -// iSCSI Static Connection Statistics Information -#define ISCSI_ConnectionStaticInfoGuid \ - { 0x3ce2d6a0,0x7346,0x4826, { 0x97,0x2f,0xf2,0xc1,0x97,0x79,0xd1,0xd1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_ConnectionStaticInfo_GUID, \ - 0x3ce2d6a0,0x7346,0x4826,0x97,0x2f,0xf2,0xc1,0x97,0x79,0xd1,0xd1); -#endif - - -typedef struct _ISCSI_ConnectionStaticInfo -{ - // A uniquely generated connection ID. Do not confuse this with CID. - ULONGLONG UniqueConnectionId; - #define ISCSI_ConnectionStaticInfo_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define ISCSI_ConnectionStaticInfo_UniqueConnectionId_ID 1 - - // The iSCSI connection ID for this connection instance. - USHORT CID; - #define ISCSI_ConnectionStaticInfo_CID_SIZE sizeof(USHORT) - #define ISCSI_ConnectionStaticInfo_CID_ID 2 - - - - //login - The TCP connection has been established, but a valid iSCSI - // login response with the final bit set has not been sent or received. - //full - A valid iSCSI login response with the final bit set - // has been sent or received. - //logout - A valid iSCSI logout command has been sent or received, but - // the TCP connection has not yet been closed. - - - -// login -#define login 0 -// full -#define full 1 -// logout -#define logout 2 - - // **typedef** Indicates the current state of this connection - UCHAR State; - #define ISCSI_ConnectionStaticInfo_State_SIZE sizeof(UCHAR) - #define ISCSI_ConnectionStaticInfo_State_ID 3 - - -// TCP -#define TCP 6 - - // **typedef** The transport protocol over which this connection instance is running. - UCHAR Protocol; - #define ISCSI_ConnectionStaticInfo_Protocol_SIZE sizeof(UCHAR) - #define ISCSI_ConnectionStaticInfo_Protocol_ID 4 - - -// None -#define None 0 -// crc32c -#define crc32c 1 - - // **typedef** The name of the iSCSI header digest scheme in use within this session. - UCHAR HeaderIntegrity; - #define ISCSI_ConnectionStaticInfo_HeaderIntegrity_SIZE sizeof(UCHAR) - #define ISCSI_ConnectionStaticInfo_HeaderIntegrity_ID 5 - - -// None -#define None 0 -// crc32c -#define crc32c 1 - - // **typedef** The name of the iSCSI data digest scheme in use within this session. - UCHAR DataIntegrity; - #define ISCSI_ConnectionStaticInfo_DataIntegrity_SIZE sizeof(UCHAR) - #define ISCSI_ConnectionStaticInfo_DataIntegrity_ID 6 - - // Must be zero - USHORT Reserved; - #define ISCSI_ConnectionStaticInfo_Reserved_SIZE sizeof(USHORT) - #define ISCSI_ConnectionStaticInfo_Reserved_ID 7 - - // The maximum data payload size supported for command or data PDUs within this session. - ULONG MaxRecvDataSegmentLength; - #define ISCSI_ConnectionStaticInfo_MaxRecvDataSegmentLength_SIZE sizeof(ULONG) - #define ISCSI_ConnectionStaticInfo_MaxRecvDataSegmentLength_ID 8 - - // **typedef** Authentication type used when establishing the connection. - ULONG AuthType; - #define ISCSI_ConnectionStaticInfo_AuthType_SIZE sizeof(ULONG) - #define ISCSI_ConnectionStaticInfo_AuthType_ID 9 - - // The local network address used for the connection - ISCSI_IP_Address LocalAddr; - #define ISCSI_ConnectionStaticInfo_LocalAddr_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_ConnectionStaticInfo_LocalAddr_ID 10 - - // The local port used for the connection - ULONG LocalPort; - #define ISCSI_ConnectionStaticInfo_LocalPort_SIZE sizeof(ULONG) - #define ISCSI_ConnectionStaticInfo_LocalPort_ID 11 - - // The remote network address used for the connection - ISCSI_IP_Address RemoteAddr; - #define ISCSI_ConnectionStaticInfo_RemoteAddr_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_ConnectionStaticInfo_RemoteAddr_ID 12 - - // The remote port used for the connection - ULONG RemotePort; - #define ISCSI_ConnectionStaticInfo_RemotePort_SIZE sizeof(ULONG) - #define ISCSI_ConnectionStaticInfo_RemotePort_ID 13 - - // Estimated throughput of the link in bytes per second - ULONGLONG EstimatedThroughput; - #define ISCSI_ConnectionStaticInfo_EstimatedThroughput_SIZE sizeof(ULONGLONG) - #define ISCSI_ConnectionStaticInfo_EstimatedThroughput_ID 14 - - // Maximum Datagram size supported by the transport in bytes - ULONG MaxDatagramSize; - #define ISCSI_ConnectionStaticInfo_MaxDatagramSize_SIZE sizeof(ULONG) - #define ISCSI_ConnectionStaticInfo_MaxDatagramSize_ID 15 - -} ISCSI_ConnectionStaticInfo, *PISCSI_ConnectionStaticInfo; - -#define ISCSI_ConnectionStaticInfo_SIZE (FIELD_OFFSET(ISCSI_ConnectionStaticInfo, MaxDatagramSize) + ISCSI_ConnectionStaticInfo_MaxDatagramSize_SIZE) - -// ISCSI_SessionStaticInfo - ISCSI_SessionStaticInfo -// iSCSI Static Sessions Statistics Information -#define ISCSI_SessionStaticInfoGuid \ - { 0xb71d2538,0x57e2,0x4228, { 0x88,0x8b,0x1a,0xf9,0xb3,0xbd,0x01,0xcd } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_SessionStaticInfo_GUID, \ - 0xb71d2538,0x57e2,0x4228,0x88,0x8b,0x1a,0xf9,0xb3,0xbd,0x01,0xcd); -#endif - - -typedef struct _ISCSI_SessionStaticInfo -{ - // A uniquely generated session ID, it is the same id returned by the LoginToTarget method. Do not confuse this with ISID or SSID. - ULONGLONG UniqueSessionId; - #define ISCSI_SessionStaticInfo_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ISCSI_SessionStaticInfo_UniqueSessionId_ID 1 - - // Initiator node name used to establish the session - WCHAR InitiatoriSCSIName[223 + 1]; - #define ISCSI_SessionStaticInfo_InitiatoriSCSIName_ID 2 - - // iSCSI node name of the target - WCHAR TargetiSCSIName[223 + 1]; - #define ISCSI_SessionStaticInfo_TargetiSCSIName_ID 3 - - // Target-defined portion of the iSCSI Session ID - USHORT TSID; - #define ISCSI_SessionStaticInfo_TSID_SIZE sizeof(USHORT) - #define ISCSI_SessionStaticInfo_TSID_ID 4 - - // Initiator-defined portion of the iSCSI Session ID - UCHAR ISID[6]; - #define ISCSI_SessionStaticInfo_ISID_SIZE sizeof(UCHAR[6]) - #define ISCSI_SessionStaticInfo_ISID_ID 5 - - // If TRUE, the initiator must wait for an R2T before sending data to the target. If FALSE, the initiator may send data immediately, within limits set by FirstBurstSize and the expected data transfer length of the request. - BOOLEAN InitialR2t; - #define ISCSI_SessionStaticInfo_InitialR2t_SIZE sizeof(BOOLEAN) - #define ISCSI_SessionStaticInfo_InitialR2t_ID 6 - - // If TRUE indicates whether the initiator and target have agreed to support immediate commands on this session. - BOOLEAN ImmediateData; - #define ISCSI_SessionStaticInfo_ImmediateData_SIZE sizeof(BOOLEAN) - #define ISCSI_SessionStaticInfo_ImmediateData_ID 7 - - - - // Type of iSCSI session - // discoverySession - session is being used only for discovery - // informationalSession - session is used for a limited number of scsi commands - // dataSession - session is being used as a full feature session - // bootSession - session is being used to boot an initiator - - - -// discoverySession -#define discoverySession 0 -// informationalSession -#define informationalSession 1 -// dataSession -#define dataSession 2 -// bootSession -#define bootSession 3 - - // **typedef** Type of iSCSI session - UCHAR Type; - #define ISCSI_SessionStaticInfo_Type_SIZE sizeof(UCHAR) - #define ISCSI_SessionStaticInfo_Type_ID 8 - - // If FALSE indicates that data PDU Sequences may be transferred in any order. If TRUE indicates that data PDU sequences must be transferred using continuously increasing offsets, except during error recovery. - BOOLEAN DataSequenceInOrder; - #define ISCSI_SessionStaticInfo_DataSequenceInOrder_SIZE sizeof(BOOLEAN) - #define ISCSI_SessionStaticInfo_DataSequenceInOrder_ID 9 - - // If FALSE indicates that data PDUs within sequences may be in any order. If TRUE indicates that data PDUs within sequences must be at continuously increasing addresses, with no gaps or overlay between PDUs. - BOOLEAN DataPduInOrder; - #define ISCSI_SessionStaticInfo_DataPduInOrder_SIZE sizeof(BOOLEAN) - #define ISCSI_SessionStaticInfo_DataPduInOrder_ID 10 - - // The level of error recovery negotiated between the initiator and the target. - UCHAR ErrorRecoveryLevel; - #define ISCSI_SessionStaticInfo_ErrorRecoveryLevel_SIZE sizeof(UCHAR) - #define ISCSI_SessionStaticInfo_ErrorRecoveryLevel_ID 11 - - // The maximum number of outstanding request-to-transmit (R2T) per task within this session - ULONG MaxOutstandingR2t; - #define ISCSI_SessionStaticInfo_MaxOutstandingR2t_SIZE sizeof(ULONG) - #define ISCSI_SessionStaticInfo_MaxOutstandingR2t_ID 12 - - // The maximum length supported for unsolicited data sent within this session - ULONG FirstBurstLength; - #define ISCSI_SessionStaticInfo_FirstBurstLength_SIZE sizeof(ULONG) - #define ISCSI_SessionStaticInfo_FirstBurstLength_ID 13 - - // The maximum number of bytes which can be sent within a single sequence of Data-In or Data-Out PDUs - ULONG MaxBurstLength; - #define ISCSI_SessionStaticInfo_MaxBurstLength_SIZE sizeof(ULONG) - #define ISCSI_SessionStaticInfo_MaxBurstLength_ID 14 - - // The maximum number of connections that will be allowed within this session - ULONG MaxConnections; - #define ISCSI_SessionStaticInfo_MaxConnections_SIZE sizeof(ULONG) - #define ISCSI_SessionStaticInfo_MaxConnections_ID 15 - - // The number of connections that currently belong to this session - USHORT ConnectionCount; - #define ISCSI_SessionStaticInfo_ConnectionCount_SIZE sizeof(USHORT) - #define ISCSI_SessionStaticInfo_ConnectionCount_ID 16 - - // List of ISCSI_ConnectionStaticInfo. ConnectionCount specifies the number of elements in the array. NOTE: This is a variable length array. - ISCSI_ConnectionStaticInfo ConnectionsList[1]; - #define ISCSI_SessionStaticInfo_ConnectionsList_ID 17 - -} ISCSI_SessionStaticInfo, *PISCSI_SessionStaticInfo; - -// ISCSI_PortalInfo - ISCSI_PortalInfo -// iSCSI Portal Info -#define ISCSI_PortalInfoGuid \ - { 0x4fb9130e,0x1fef,0x4ae6, { 0x9e,0x48,0x77,0x83,0x92,0x04,0xd4,0x13 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_PortalInfo_GUID, \ - 0x4fb9130e,0x1fef,0x4ae6,0x9e,0x48,0x77,0x83,0x92,0x04,0xd4,0x13); -#endif - - -typedef struct _ISCSI_PortalInfo -{ - // An integer used to uniquely identify a paticular port - ULONG Index; - #define ISCSI_PortalInfo_Index_SIZE sizeof(ULONG) - #define ISCSI_PortalInfo_Index_ID 1 - - -// Initiator -#define InitiatorPortals 0 -// Target -#define TargetPortals 1 - - // **typedef** The type of portal (Initiator or Target) - - UCHAR PortalType; - #define ISCSI_PortalInfo_PortalType_SIZE sizeof(UCHAR) - #define ISCSI_PortalInfo_PortalType_ID 2 - - -// TCP -#define TCP 6 - - // The portal's transport protocol - UCHAR Protocol; - #define ISCSI_PortalInfo_Protocol_SIZE sizeof(UCHAR) - #define ISCSI_PortalInfo_Protocol_ID 3 - - // - UCHAR Reserved1; - #define ISCSI_PortalInfo_Reserved1_SIZE sizeof(UCHAR) - #define ISCSI_PortalInfo_Reserved1_ID 4 - - // - UCHAR Reserved2; - #define ISCSI_PortalInfo_Reserved2_SIZE sizeof(UCHAR) - #define ISCSI_PortalInfo_Reserved2_ID 5 - - // The portal's network address - ISCSI_IP_Address IPAddr; - #define ISCSI_PortalInfo_IPAddr_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_PortalInfo_IPAddr_ID 6 - - // The portal's socket number - ULONG Port; - #define ISCSI_PortalInfo_Port_SIZE sizeof(ULONG) - #define ISCSI_PortalInfo_Port_ID 7 - - // The portal's aggregation tag - USHORT PortalTag; - #define ISCSI_PortalInfo_PortalTag_SIZE sizeof(USHORT) - #define ISCSI_PortalInfo_PortalTag_ID 8 - -} ISCSI_PortalInfo, *PISCSI_PortalInfo; - -#define ISCSI_PortalInfo_SIZE (FIELD_OFFSET(ISCSI_PortalInfo, PortalTag) + ISCSI_PortalInfo_PortalTag_SIZE) - -// MSiSCSI_PortalInfoClass - MSiSCSI_PortalInfoClass -// iScsi Portal Information Class - -// -// -// This class is recommended. -// -// This class exposes portal information. -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_PortalInfoClassGuid \ - { 0x84ca6fd6,0xb152,0x4e6a, { 0x88,0x69,0xfd,0xe5,0xe3,0x7b,0x61,0x57 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_PortalInfoClass_GUID, \ - 0x84ca6fd6,0xb152,0x4e6a,0x88,0x69,0xfd,0xe5,0xe3,0x7b,0x61,0x57); -#endif - - -typedef struct _MSiSCSI_PortalInfoClass -{ - // Number of elements in iScsiPortalInfo array - ULONG PortalInfoCount; - #define MSiSCSI_PortalInfoClass_PortalInfoCount_SIZE sizeof(ULONG) - #define MSiSCSI_PortalInfoClass_PortalInfoCount_ID 1 - - // Variable length array of iScsiPortalInfo. PortalInfoCount specifies the number of elements in the array. NOTE: this is a variable length array. - ISCSI_PortalInfo PortalInformation[1]; - #define MSiSCSI_PortalInfoClass_PortalInformation_ID 2 - -} MSiSCSI_PortalInfoClass, *PMSiSCSI_PortalInfoClass; - -// MSiSCSI_InitiatorSessionInfo - MSiSCSI_InitiatorSessionInfo -// iSCSI Static Initiator Session Information - -// -// -// This class is required. -// -// This class exposes session and connection information on the initiator. -// -// This class should use PDO instance names with a single instance. -// - -#define MSiSCSI_InitiatorSessionInfoGuid \ - { 0xd7931411,0x0376,0x4869, { 0xa4,0x91,0x8d,0x67,0x9b,0xfc,0x00,0x4a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_InitiatorSessionInfo_GUID, \ - 0xd7931411,0x0376,0x4869,0xa4,0x91,0x8d,0x67,0x9b,0xfc,0x00,0x4a); -#endif - - -typedef struct _MSiSCSI_InitiatorSessionInfo -{ - // Id that is globally unique to each instance of each adapter. Using the address of the Adapter Extension is a good idea. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_InitiatorSessionInfo_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_InitiatorSessionInfo_UniqueAdapterId_ID 1 - - // Number of elements in SessionList array - ULONG SessionCount; - #define MSiSCSI_InitiatorSessionInfo_SessionCount_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorSessionInfo_SessionCount_ID 2 - - // Variable length array of sessions. SessionCount specifies the number of elements in the array. NOTE: this is a variable length array. - ISCSI_SessionStaticInfo SessionsList[1]; - #define MSiSCSI_InitiatorSessionInfo_SessionsList_ID 3 - -} MSiSCSI_InitiatorSessionInfo, *PMSiSCSI_InitiatorSessionInfo; - -// MSiSCSI_InitiatorNodeFailureEvent - MSiSCSI_InitiatorNodeFailureEvent -// iSCSI Initiator Node Failure Event - -// -// -// This class is recommended. -// -// This class fires an event when a node failure occurs. -// -// This class should use PDO instance names with a single instance. -// - -#define MSiSCSI_InitiatorNodeFailureEventGuid \ - { 0x1221948a,0x6332,0x4ac2, { 0xaa,0x04,0x26,0x8a,0xab,0xce,0xce,0x4f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_InitiatorNodeFailureEvent_GUID, \ - 0x1221948a,0x6332,0x4ac2,0xaa,0x04,0x26,0x8a,0xab,0xce,0xce,0x4f); -#endif - - -typedef struct _MSiSCSI_InitiatorNodeFailureEvent -{ - // Timestamp denoting time failure occured - ULONGLONG FailureTime; - #define MSiSCSI_InitiatorNodeFailureEvent_FailureTime_SIZE sizeof(ULONGLONG) - #define MSiSCSI_InitiatorNodeFailureEvent_FailureTime_ID 1 - - -// LoginOtherFail -#define LoginOtherFail 0 -// LoginAuthFail -#define LoginAuthFail 1 -// LoginAuthenticateFail -#define LoginAuthenticateFail 2 -// LoginNegotiateFail -#define LoginNegotiateFail 3 -// LogoutOthers -#define LogoutOthers 4 - - // **typedef** Types of initiator node failure - UCHAR FailureType; - #define MSiSCSI_InitiatorNodeFailureEvent_FailureType_SIZE sizeof(UCHAR) - #define MSiSCSI_InitiatorNodeFailureEvent_FailureType_ID 2 - - // Name of target involved in failure - WCHAR TargetFailureName[223 + 1]; - #define MSiSCSI_InitiatorNodeFailureEvent_TargetFailureName_ID 3 - - // Network address of target involved in failure - ISCSI_IP_Address TargetFailureAddr; - #define MSiSCSI_InitiatorNodeFailureEvent_TargetFailureAddr_SIZE sizeof(ISCSI_IP_Address) - #define MSiSCSI_InitiatorNodeFailureEvent_TargetFailureAddr_ID 4 - -} MSiSCSI_InitiatorNodeFailureEvent, *PMSiSCSI_InitiatorNodeFailureEvent; - -#define MSiSCSI_InitiatorNodeFailureEvent_SIZE (FIELD_OFFSET(MSiSCSI_InitiatorNodeFailureEvent, TargetFailureAddr) + MSiSCSI_InitiatorNodeFailureEvent_TargetFailureAddr_SIZE) - -// MSiSCSI_InitiatorInstanceFailureEvent - MSiSCSI_InitiatorInstanceFailureEvent -// iSCSI Initiator Instance Failure Event - -// -// -// This class is recommended. -// -// This class fires an event when an initiator failure occurs. -// -// This class should use PDO instance names with a single instance. -// - -#define MSiSCSI_InitiatorInstanceFailureEventGuid \ - { 0xe67e1bdb,0xd130,0x4143, { 0x9e,0xb2,0x8b,0xee,0x18,0x99,0xfd,0x52 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_InitiatorInstanceFailureEvent_GUID, \ - 0xe67e1bdb,0xd130,0x4143,0x9e,0xb2,0x8b,0xee,0x18,0x99,0xfd,0x52); -#endif - - -typedef struct _MSiSCSI_InitiatorInstanceFailureEvent -{ - -// SessionDigestError -#define SessionDigestError 0 -// SessionCxnTimeoutError -#define SessionCxnTimeoutError 1 -// SessionFormatError -#define SessionFormatError 2 - - // **typedef** Type of failure - UCHAR FailureType; - #define MSiSCSI_InitiatorInstanceFailureEvent_FailureType_SIZE sizeof(UCHAR) - #define MSiSCSI_InitiatorInstanceFailureEvent_FailureType_ID 1 - - // Name of target involved in failure - WCHAR RemoteNodeName[223 + 1]; - #define MSiSCSI_InitiatorInstanceFailureEvent_RemoteNodeName_ID 2 - -} MSiSCSI_InitiatorInstanceFailureEvent, *PMSiSCSI_InitiatorInstanceFailureEvent; - -// ISCSI_Path - ISCSI_Path -// This class describes an iSCSI Path (A TCP Connection to the target) -#define ISCSI_PathGuid \ - { 0xc8775641,0x5430,0x4220, { 0xba,0x25,0x7d,0xa5,0x61,0xcb,0x64,0xce } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_Path_GUID, \ - 0xc8775641,0x5430,0x4220,0xba,0x25,0x7d,0xa5,0x61,0xcb,0x64,0xce); -#endif - - -typedef struct _ISCSI_Path -{ - // iSCSI Unique connection id - ULONGLONG UniqueConnectionId; - #define ISCSI_Path_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define ISCSI_Path_UniqueConnectionId_ID 1 - - // Estimated speed of the connection in MegaBits Per Second - ULONGLONG EstimatedLinkSpeed; - #define ISCSI_Path_EstimatedLinkSpeed_SIZE sizeof(ULONGLONG) - #define ISCSI_Path_EstimatedLinkSpeed_ID 2 - - // Weight assigned to the path - ULONG PathWeight; - #define ISCSI_Path_PathWeight_SIZE sizeof(ULONG) - #define ISCSI_Path_PathWeight_ID 3 - - // Flag set to 1 if the path is a primary path, 0 otherwise. - ULONG PrimaryPath; - #define ISCSI_Path_PrimaryPath_SIZE sizeof(ULONG) - #define ISCSI_Path_PrimaryPath_ID 4 - - -// Connected -#define CONNECTION_STATE_CONNECTED 1 -// Disconnected -#define CONNECTION_STATE_DISCONNECTED 2 -// Reconnecting -#define CONNECTION_STATE_RECONNECTING 3 - - // Status of the path - connected, disconnected, reconnecting - ULONG ConnectionStatus; - #define ISCSI_Path_ConnectionStatus_SIZE sizeof(ULONG) - #define ISCSI_Path_ConnectionStatus_ID 5 - - // Flag set to 1 if TCP offload is supported for this connection, 0 otherwise. - ULONG TCPOffLoadAvailable; - #define ISCSI_Path_TCPOffLoadAvailable_SIZE sizeof(ULONG) - #define ISCSI_Path_TCPOffLoadAvailable_ID 6 - -} ISCSI_Path, *PISCSI_Path; - -#define ISCSI_Path_SIZE (FIELD_OFFSET(ISCSI_Path, TCPOffLoadAvailable) + ISCSI_Path_TCPOffLoadAvailable_SIZE) - -// ISCSI_Supported_LB_Policies - ISCSI_Supported_LB_Policies -// iSCSI Initiator Load Balance Policies supported -#define ISCSI_Supported_LB_PoliciesGuid \ - { 0x749afe4d,0x804d,0x4662, { 0xa6,0x8b,0xdc,0x69,0x66,0x55,0xc7,0x9a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_Supported_LB_Policies_GUID, \ - 0x749afe4d,0x804d,0x4662,0xa6,0x8b,0xdc,0x69,0x66,0x55,0xc7,0x9a); -#endif - - -typedef struct _ISCSI_Supported_LB_Policies -{ - // Id that is unique to this session within this adapter. - ULONGLONG UniqueSessionId; - #define ISCSI_Supported_LB_Policies_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ISCSI_Supported_LB_Policies_UniqueSessionId_ID 1 - - -// Fail Over Only -#define MSiSCSI_LB_FAILOVER 1 -// Round Robin -#define MSiSCSI_LB_ROUND_ROBIN 2 -// Round Robin with Subset -#define MSiSCSI_LB_ROUND_ROBIN_WITH_SUBSET 3 -// Dynamic Least Queue Depth -#define MSiSCSI_LB_DYN_LEAST_QUEUE_DEPTH 4 -// Weighted Paths -#define MSiSCSI_LB_WEIGHTED_PATHS 5 -// Vendor Specific -#define MSiSCSI_LB_VENDOR_SPECIFIC 6 - - // Load Balance policy supported by the iSCSI Initiator - ULONG LoadBalancePolicy; - #define ISCSI_Supported_LB_Policies_LoadBalancePolicy_SIZE sizeof(ULONG) - #define ISCSI_Supported_LB_Policies_LoadBalancePolicy_ID 2 - - // Number of entries in MSiSCSI_Paths array - ULONG iSCSI_PathCount; - #define ISCSI_Supported_LB_Policies_iSCSI_PathCount_SIZE sizeof(ULONG) - #define ISCSI_Supported_LB_Policies_iSCSI_PathCount_ID 3 - - // Describes iSCSI Initiator Paths - ISCSI_Path iSCSI_Paths[1]; - #define ISCSI_Supported_LB_Policies_iSCSI_Paths_ID 4 - -} ISCSI_Supported_LB_Policies, *PISCSI_Supported_LB_Policies; - -// MSiSCSI_LB_Operations - MSiSCSI_LB_Operations -// Set iSCSI Initiator Load Balance Policies -#define MSiSCSI_LB_OperationsGuid \ - { 0xa7dfe761,0xb6bc,0x4490, { 0x91,0xb0,0xd9,0xcf,0x4a,0x24,0xd3,0x7c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_LB_Operations_GUID, \ - 0xa7dfe761,0xb6bc,0x4490,0x91,0xb0,0xd9,0xcf,0x4a,0x24,0xd3,0x7c); -#endif - -// -// Method id definitions for MSiSCSI_LB_Operations - -// -// SetLoadBalancePolicy instructs the iSCSI Initiator what Load Balance -// policy to use. -// - -#define SetLoadBalancePolicy 10 -typedef struct _SetLoadBalancePolicy_IN -{ - // New Load Balance policy to be set - ISCSI_Supported_LB_Policies LoadBalancePolicies; - #define SetLoadBalancePolicy_IN_LoadBalancePolicies_SIZE sizeof(ISCSI_Supported_LB_Policies) - #define SetLoadBalancePolicy_IN_LoadBalancePolicies_ID 1 - -} SetLoadBalancePolicy_IN, *PSetLoadBalancePolicy_IN; - -#define SetLoadBalancePolicy_IN_SIZE (FIELD_OFFSET(SetLoadBalancePolicy_IN, LoadBalancePolicies) + SetLoadBalancePolicy_IN_LoadBalancePolicies_SIZE) - -typedef struct _SetLoadBalancePolicy_OUT -{ - // Status of the operation - ULONG Status; - #define SetLoadBalancePolicy_OUT_Status_SIZE sizeof(ULONG) - #define SetLoadBalancePolicy_OUT_Status_ID 2 - -} SetLoadBalancePolicy_OUT, *PSetLoadBalancePolicy_OUT; - -#define SetLoadBalancePolicy_OUT_SIZE (FIELD_OFFSET(SetLoadBalancePolicy_OUT, Status) + SetLoadBalancePolicy_OUT_Status_SIZE) - - -// MSiSCSI_QueryLBPolicy - MSiSCSI_QueryLBPolicy -// Query Load Balance policy used by iSCSI Initiator - -// -// MSiSCSI_QueryLBPolicy class is used to query the Initiator about -// the load balance policy that is currently used. -// - -#define MSiSCSI_QueryLBPolicyGuid \ - { 0xe0aecaee,0xb311,0x426f, { 0xb6,0x7a,0x18,0xd5,0xe5,0x5d,0x09,0x96 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_QueryLBPolicy_GUID, \ - 0xe0aecaee,0xb311,0x426f,0xb6,0x7a,0x18,0xd5,0xe5,0x5d,0x09,0x96); -#endif - - -typedef struct _MSiSCSI_QueryLBPolicy -{ - // Id that is globally unique to each instance of each adapter. Using the address of the Adapter Extension is a good idea. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_QueryLBPolicy_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QueryLBPolicy_UniqueAdapterId_ID 1 - - // - ULONG Reserved; - #define MSiSCSI_QueryLBPolicy_Reserved_SIZE sizeof(ULONG) - #define MSiSCSI_QueryLBPolicy_Reserved_ID 2 - - - - // Number of elements in LoadBalancePolicies array - - // Number of elements in LoadBalancePolicies array - ULONG SessionCount; - #define MSiSCSI_QueryLBPolicy_SessionCount_SIZE sizeof(ULONG) - #define MSiSCSI_QueryLBPolicy_SessionCount_ID 3 - - // Load Balance Policy that is currently being used by iSCSI Initiator - one element for each session on the adapter - ISCSI_Supported_LB_Policies LoadBalancePolicies[1]; - #define MSiSCSI_QueryLBPolicy_LoadBalancePolicies_ID 4 - -} MSiSCSI_QueryLBPolicy, *PMSiSCSI_QueryLBPolicy; - -// MSiSCSI_Eventlog - MSiSCSI_Eventlog -// iSCSI Eventlog generation event - -// -// Miniports can fire this event to cause eventlog entries to be -// included in the system eventlog. This is useful as the iscsilog.h -// header has many iSCSI specific eventlog messages that are useful for -// troubleshooting, but can't be fired directly by a miniport. By -// firing this WMI event appropriately a miniport can cause a useful -// eventlog entry to be included in the system eventlog -// - -#define MSiSCSI_EventlogGuid \ - { 0xe6b8552b,0x7c62,0x4c6e, { 0x99,0xeb,0x67,0xce,0x60,0x87,0x89,0x4c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_Eventlog_GUID, \ - 0xe6b8552b,0x7c62,0x4c6e,0x99,0xeb,0x67,0xce,0x60,0x87,0x89,0x4c); -#endif - - -typedef struct _MSiSCSI_Eventlog -{ - // Type of eventlog message - ULONG Type; - #define MSiSCSI_Eventlog_Type_SIZE sizeof(ULONG) - #define MSiSCSI_Eventlog_Type_ID 1 - - // If zero then this event is not logged to system eventlog - ULONG LogToEventlog; - #define MSiSCSI_Eventlog_LogToEventlog_SIZE sizeof(ULONG) - #define MSiSCSI_Eventlog_LogToEventlog_ID 2 - - // Size of Additional Data - ULONG Size; - #define MSiSCSI_Eventlog_Size_SIZE sizeof(ULONG) - #define MSiSCSI_Eventlog_Size_ID 3 - - // Additional data to include in eventlog message, typically iSCSI Header - UCHAR AdditionalData[1]; - #define MSiSCSI_Eventlog_AdditionalData_ID 4 - -} MSiSCSI_Eventlog, *PMSiSCSI_Eventlog; - -// ISCSI_RedirectPortalInfo - ISCSI_RedirectPortalInfo -// iSCSI Redirect Portal Info -#define ISCSI_RedirectPortalInfoGuid \ - { 0xf6004ce6,0x9507,0x4d86, { 0xae,0x1e,0xe9,0xd6,0x4f,0x16,0x6f,0x2f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_RedirectPortalInfo_GUID, \ - 0xf6004ce6,0x9507,0x4d86,0xae,0x1e,0xe9,0xd6,0x4f,0x16,0x6f,0x2f); -#endif - - -typedef struct _ISCSI_RedirectPortalInfo -{ - // A uniquely generated connection ID. Do not confuse this with CID. - ULONGLONG UniqueConnectionId; - #define ISCSI_RedirectPortalInfo_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define ISCSI_RedirectPortalInfo_UniqueConnectionId_ID 1 - - // Original Target IP Address given in the login - ISCSI_IP_Address OriginalIPAddr; - #define ISCSI_RedirectPortalInfo_OriginalIPAddr_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_RedirectPortalInfo_OriginalIPAddr_ID 2 - - // Original Target portal's socket number given in the login - ULONG OriginalPort; - #define ISCSI_RedirectPortalInfo_OriginalPort_SIZE sizeof(ULONG) - #define ISCSI_RedirectPortalInfo_OriginalPort_ID 3 - - // Redirected Target IP Address - ISCSI_IP_Address RedirectedIPAddr; - #define ISCSI_RedirectPortalInfo_RedirectedIPAddr_SIZE sizeof(ISCSI_IP_Address) - #define ISCSI_RedirectPortalInfo_RedirectedIPAddr_ID 4 - - // Redirected Target portal's socket number - ULONG RedirectedPort; - #define ISCSI_RedirectPortalInfo_RedirectedPort_SIZE sizeof(ULONG) - #define ISCSI_RedirectPortalInfo_RedirectedPort_ID 5 - - // TRUE if login was redirected. RedirectedIPAddr and RedirectedPort are valid then. - UCHAR Redirected; - #define ISCSI_RedirectPortalInfo_Redirected_SIZE sizeof(UCHAR) - #define ISCSI_RedirectPortalInfo_Redirected_ID 6 - - // TRUE if the redirection is temporary. FALSE otherwise - UCHAR TemporaryRedirect; - #define ISCSI_RedirectPortalInfo_TemporaryRedirect_SIZE sizeof(UCHAR) - #define ISCSI_RedirectPortalInfo_TemporaryRedirect_ID 7 - -} ISCSI_RedirectPortalInfo, *PISCSI_RedirectPortalInfo; - -#define ISCSI_RedirectPortalInfo_SIZE (FIELD_OFFSET(ISCSI_RedirectPortalInfo, TemporaryRedirect) + ISCSI_RedirectPortalInfo_TemporaryRedirect_SIZE) - -// ISCSI_RedirectSessionInfo - ISCSI_RedirectSessionInfo -// iSCSI Redirect Session Info -#define ISCSI_RedirectSessionInfoGuid \ - { 0xed60bc3f,0x3d56,0x42f0, { 0xb4,0xd0,0x81,0xdd,0x16,0xe2,0x85,0x15 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_RedirectSessionInfo_GUID, \ - 0xed60bc3f,0x3d56,0x42f0,0xb4,0xd0,0x81,0xdd,0x16,0xe2,0x85,0x15); -#endif - - -typedef struct _ISCSI_RedirectSessionInfo -{ - // A uniquely generated session ID, it is the same id returned by the LoginToTarget method. Do not confuse this with ISID or SSID. - ULONGLONG UniqueSessionId; - #define ISCSI_RedirectSessionInfo_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ISCSI_RedirectSessionInfo_UniqueSessionId_ID 1 - - // Target portal group tag for this Session - ULONG TargetPortalGroupTag; - #define ISCSI_RedirectSessionInfo_TargetPortalGroupTag_SIZE sizeof(ULONG) - #define ISCSI_RedirectSessionInfo_TargetPortalGroupTag_ID 2 - - - - // Number of elements in RedirectPortalList array - - // Number of elements in RedirectPortalList array - ULONG ConnectionCount; - #define ISCSI_RedirectSessionInfo_ConnectionCount_SIZE sizeof(ULONG) - #define ISCSI_RedirectSessionInfo_ConnectionCount_ID 3 - - // Redirect portal info - one element for each connection in the session - ISCSI_RedirectPortalInfo RedirectPortalList[1]; - #define ISCSI_RedirectSessionInfo_RedirectPortalList_ID 4 - -} ISCSI_RedirectSessionInfo, *PISCSI_RedirectSessionInfo; - -// MSiSCSI_RedirectPortalInfoClass - MSiSCSI_RedirectPortalInfoClass -// iScsi Redirect Portal Information Class - -// -// -// This class is recommended. -// -// This class exposes portal information. It provides the original and -// redirected target portal information for an iSCSI Connection. -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_RedirectPortalInfoClassGuid \ - { 0xdaf7f63a,0xf9ea,0x4869, { 0x87,0xe1,0xae,0x8a,0x7c,0x22,0x61,0xe2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_RedirectPortalInfoClass_GUID, \ - 0xdaf7f63a,0xf9ea,0x4869,0x87,0xe1,0xae,0x8a,0x7c,0x22,0x61,0xe2); -#endif - - -typedef struct _MSiSCSI_RedirectPortalInfoClass -{ - // Id that is globally unique for all instances of iSCSI initiators. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_RedirectPortalInfoClass_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_RedirectPortalInfoClass_UniqueAdapterId_ID 1 - - // Number of elements in RedirectSessionInfo array - ULONG SessionCount; - #define MSiSCSI_RedirectPortalInfoClass_SessionCount_SIZE sizeof(ULONG) - #define MSiSCSI_RedirectPortalInfoClass_SessionCount_ID 2 - - // Variable length array of ISCSI_RedirectSessionInfo. SessionCount specifies the number of elements in the array. NOTE: this is a variable length array. - ISCSI_RedirectSessionInfo RedirectSessionList[1]; - #define MSiSCSI_RedirectPortalInfoClass_RedirectSessionList_ID 3 - -} MSiSCSI_RedirectPortalInfoClass, *PMSiSCSI_RedirectPortalInfoClass; - -// MSiSCSI_ManagementOperations - MSiSCSI_ManagementOperations - - -// -// -// This class is recommended. -// -// iSCSI management applications rely upon this -// class in order to interface with the adapter. Implement one instance -// per miniport instance (adapter). -// -// This class must be registered using PDO instance names with a single instance. -// - -#define MSiSCSI_ManagementOperationsGuid \ - { 0xb8d765f0,0x2d93,0x4da2, { 0x81,0x86,0xa1,0x87,0x62,0x2b,0x43,0x02 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_ManagementOperations_GUID, \ - 0xb8d765f0,0x2d93,0x4da2,0x81,0x86,0xa1,0x87,0x62,0x2b,0x43,0x02); -#endif - -// -// Method id definitions for MSiSCSI_ManagementOperations - -// -// This method is recommended. -// -// Ping will perform ICMP ping requests to the destination address -// and return the number of ping responses received. This is only supported -// by some HBA, use the ping command for the software initiator. -// - -#define PingIPAddress 10 -typedef struct _PingIPAddress_IN -{ - // Number of requests to send - ULONG RequestCount; - #define PingIPAddress_IN_RequestCount_SIZE sizeof(ULONG) - #define PingIPAddress_IN_RequestCount_ID 1 - - // Number of bytes in each request - ULONG RequestSize; - #define PingIPAddress_IN_RequestSize_SIZE sizeof(ULONG) - #define PingIPAddress_IN_RequestSize_ID 2 - - // Number of ms to wait for response - ULONG Timeout; - #define PingIPAddress_IN_Timeout_SIZE sizeof(ULONG) - #define PingIPAddress_IN_Timeout_ID 3 - - // IP address to ping - ISCSI_IP_Address Address; - #define PingIPAddress_IN_Address_SIZE sizeof(ISCSI_IP_Address) - #define PingIPAddress_IN_Address_ID 4 - -} PingIPAddress_IN, *PPingIPAddress_IN; - -#define PingIPAddress_IN_SIZE (FIELD_OFFSET(PingIPAddress_IN, Address) + PingIPAddress_IN_Address_SIZE) - -typedef struct _PingIPAddress_OUT -{ - // Status code resulting from operation - ULONG Status; - #define PingIPAddress_OUT_Status_SIZE sizeof(ULONG) - #define PingIPAddress_OUT_Status_ID 5 - - // Number of responses received - ULONG ResponsesReceived; - #define PingIPAddress_OUT_ResponsesReceived_SIZE sizeof(ULONG) - #define PingIPAddress_OUT_ResponsesReceived_ID 6 - -} PingIPAddress_OUT, *PPingIPAddress_OUT; - -#define PingIPAddress_OUT_SIZE (FIELD_OFFSET(PingIPAddress_OUT, ResponsesReceived) + PingIPAddress_OUT_ResponsesReceived_SIZE) - - -#endif - diff --git a/qt-correction-tool/pub/ddk/iscsiop.h b/qt-correction-tool/pub/ddk/iscsiop.h deleted file mode 100644 index 1fea5f2..0000000 --- a/qt-correction-tool/pub/ddk/iscsiop.h +++ /dev/null @@ -1,1449 +0,0 @@ -#ifndef _iscsiop_h_ -#define _iscsiop_h_ - -// MSiSCSI_Operations - MSiSCSI_Operations - - -//*************************************************************************** -// -// iscsiop.h -// -// Module: iSCSI Discovery api -// -// Purpose: Internal header defining interface between user mode discovery -// api dll and HBA driver miniport. -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -#include - - -// -// -// This class is required. -// -// The iSCSI initiator service relies upon this -// class in order to interface with the adapter. Implement one instance -// per miniport instance (adapter). -// -// This class must be registered using PDO instance names with a single instance. -// - -#define MSiSCSI_OperationsGuid \ - { 0xea4d82bf,0x29da,0x4e12, { 0x80,0x0a,0xe5,0x43,0x79,0x64,0x46,0x2c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_Operations_GUID, \ - 0xea4d82bf,0x29da,0x4e12,0x80,0x0a,0xe5,0x43,0x79,0x64,0x46,0x2c); -#endif - -// -// Method id definitions for MSiSCSI_Operations - -// -// This method is required. -// -// SendTargets instructs the adapter to use an existing discovery session -// with the target portal and issue the SendTargets command to it. -// SendTargetsText specifies the value for the SendTargets key in -// the PDU sent to the target. -// - -#define SendTargets 10 -typedef struct _SendTargets_IN -{ - // Unique Session ID on which to do send targets. This is the session ID returned from the LoginToTarget method. - ULONGLONG UniqueSessionId; - #define SendTargets_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define SendTargets_IN_UniqueSessionId_ID 1 - - // SendTargets key text - WCHAR SendTargetsText[223 + 1]; - #define SendTargets_IN_SendTargetsText_ID 2 - -} SendTargets_IN, *PSendTargets_IN; - -typedef struct _SendTargets_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SendTargets_OUT_Status_SIZE sizeof(ULONG) - #define SendTargets_OUT_Status_ID 3 - - // Number of bytes in SendTargets response - ULONG ResponseSize; - #define SendTargets_OUT_ResponseSize_SIZE sizeof(ULONG) - #define SendTargets_OUT_ResponseSize_ID 4 - - // Response to SendTargets in UTF8 characters. NOTE: This field is a variable length array - UCHAR Response[1]; - #define SendTargets_OUT_Response_ID 5 - -} SendTargets_OUT, *PSendTargets_OUT; - - - -// -// This method is required. -// -// LoginTarget instructs the adapter to perform a login to the target -// portal and esatablish a session with the target. -// -// Types of login sessions. -// Discovery - a discovery session is used exclusively for SendTargets -// operations. -// -// Informational - an informational session is a full featured session -// but the miniport should not report the devices on -// the target to the port driver since the devices -// should not be exposed as local devices to Windows. -// Instead a subset of SCSI commands can be executed -// on the devices via other WMI methods. This allows -// applications to gather information about the devices -// without causing the corresponding Windows device -// driver stack to be loaded. -// -// Data - a data session is a full featured session and the miniport -// should report the devices on the target to the port driver. -// In this way the corresponding driver stack will be loaded and -// the device will be available to all applications. -// -// The session id assigned to a session must remain constant for -// the lifetime of a session. Reconnections due to async logout or -// network event should not affect the value of the session id. Also -// the session must be reported to the MSiSCSI_InitiatorSessionInfo -// class. -// -// Data and informational sessions have specific rules related to -// how reconnections should be handled. If a session is disconnected due -// to async logout or a network event then the initiator must periodically -// retry logging back into the session until the session is either -// successfully reconnected or the initiator is called to -// logout of the session. The period between retries is not mandated -// though it is recommended that 5 seconds be a default value. Another -// rule is that the miniport should not immediately call the port -// driver to remove the devices on the target when a session is -// disconnected due to a network event or async logout. If this were to -// happen then the devices would disappear and no longer be available to -// applications. Instead the miniport should maintain the availability -// of the device by queueing requests and faking success for -// INQUIRY and REPORT LUNS commands. It would need to do this for a -// period of time (60 seconds is recommended). If the session is -// reconnected before the end of that period then an application will -// suffer no interruption in its work. If times runs out the miniport -// should report the removal of the devices on the target to the port -// driver. Note that a longer time might mean more requests being queued -// and more system resources used. It is recommended that these value -// be configurable. -// -typedef enum { - // Discovery session is used for SendTargets. - ISCSI_LOGINTARGET_DISCOVERY = 0, - - // Informational session is used for sending Scsi - // Commands and should not cause LUNs to be reported - // to the port driver - ISCSI_LOGINTARGET_INFORMATIONAL = 1, - - // Data session is used for full operations - // to a device and should cause LUNs to be reported - // to the port driver - ISCSI_LOGINTARGET_DATA = 2 - -} LOGINSESSIONTYPE, *PLOGINSESSIONTYPE; - -#define LoginToTarget 30 -typedef struct _LoginToTarget_IN -{ - // Port number corresponding to port in which to initiate the session - ULONG PortNumber; - #define LoginToTarget_IN_PortNumber_SIZE sizeof(ULONG) - #define LoginToTarget_IN_PortNumber_ID 1 - - -// -// Options that affect how login is performed. See ISCSI_LoginOptions -// - - // - ISCSI_LoginOptions LoginOptions; - #define LoginToTarget_IN_LoginOptions_SIZE sizeof(ISCSI_LoginOptions) - #define LoginToTarget_IN_LoginOptions_ID 2 - - // **typedef**Specifies the session type - either discovery, informational or data - ULONG SessionType; - #define LoginToTarget_IN_SessionType_SIZE sizeof(ULONG) - #define LoginToTarget_IN_SessionType_ID 3 - - // Security flags - ULONGLONG SecurityFlags; - #define LoginToTarget_IN_SecurityFlags_SIZE sizeof(ULONGLONG) - #define LoginToTarget_IN_SecurityFlags_ID 4 - - // On target portal to use for initial connection. - ISCSI_TargetPortal TargetPortal; - #define LoginToTarget_IN_TargetPortal_SIZE sizeof(ISCSI_TargetPortal) - #define LoginToTarget_IN_TargetPortal_ID 5 - - // Size in bytes of authentication Username - ULONG UsernameSize; - #define LoginToTarget_IN_UsernameSize_SIZE sizeof(ULONG) - #define LoginToTarget_IN_UsernameSize_ID 6 - - // Size in bytes of authentication Password - ULONG PasswordSize; - #define LoginToTarget_IN_PasswordSize_SIZE sizeof(ULONG) - #define LoginToTarget_IN_PasswordSize_ID 7 - - // Size in bytes of preshared key associated with target ip address - ULONG KeySize; - #define LoginToTarget_IN_KeySize_SIZE sizeof(ULONG) - #define LoginToTarget_IN_KeySize_ID 8 - - // The service will pass an id that is guaranteed to be gloally unique over all initiators for use when connecting to this target. It may be useful as part of the the ISID - USHORT UniqueIdForISID; - #define LoginToTarget_IN_UniqueIdForISID_SIZE sizeof(USHORT) - #define LoginToTarget_IN_UniqueIdForISID_ID 9 - - // If TRUE then this login should be persisted in non-volatile memory. The adapter will then automatically login to the target using the information passed each time the device driver loads. The driver should not attempt to login, just save the information for login later. - BOOLEAN PersistentLogin; - #define LoginToTarget_IN_PersistentLogin_SIZE sizeof(BOOLEAN) - #define LoginToTarget_IN_PersistentLogin_ID 10 - - // The InitiatorNode specifies the iSCSI name of the initiator node to use for the connection. If empty, then the HBA can choose any initiator node - WCHAR InitiatorNode[223 + 1]; - #define LoginToTarget_IN_InitiatorNode_ID 11 - - // The InitiatorAlias specifies the iSCSI alias of the initiator node to use for the connection. - WCHAR InitiatorAlias[255 + 1]; - #define LoginToTarget_IN_InitiatorAlias_ID 12 - - // TargetName specifies the iSCSI target name to which a session should be established. - WCHAR TargetName[223 + 1]; - #define LoginToTarget_IN_TargetName_ID 13 - - // Target mappings. If no mappings are specified then the initiator can use any mappings for the LUNs. If mappings are specified then any LUN on the target that is not specified in the mappings should not be exposed to the port driver. - ISCSI_TargetMapping Mappings; - #define LoginToTarget_IN_Mappings_SIZE sizeof(ISCSI_TargetMapping) - #define LoginToTarget_IN_Mappings_ID 14 - - // **field**Preshared key associated with target ip address. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. All fields after this are commented out in the header. - UCHAR Key[1]; - #define LoginToTarget_IN_Key_ID 15 - - // Authentication Username, for CHAP this is the CHAP Name (CHAP_N) to use when authenticating the target. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. -// UCHAR Username[1]; - #define LoginToTarget_IN_Username_ID 16 - - // Authentication Password, for CHAP this is the shared secret to use when generating the respose to the target challange. NOTE: This field is a variable length array. -// UCHAR Password[1]; - #define LoginToTarget_IN_Password_ID 17 - -} LoginToTarget_IN, *PLoginToTarget_IN; - -typedef struct _LoginToTarget_OUT -{ - // Status code resulting from operation - ULONG Status; - #define LoginToTarget_OUT_Status_SIZE sizeof(ULONG) - #define LoginToTarget_OUT_Status_ID 18 - - // Unique Session ID. This ID is used to identify this session in subsqeuent method calls. The unique session ID can never change until the session is logged out. - ULONGLONG UniqueSessionId; - #define LoginToTarget_OUT_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define LoginToTarget_OUT_UniqueSessionId_ID 19 - - // Unique Connection ID - ULONGLONG UniqueConnectionId; - #define LoginToTarget_OUT_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define LoginToTarget_OUT_UniqueConnectionId_ID 20 - -} LoginToTarget_OUT, *PLoginToTarget_OUT; - -#define LoginToTarget_OUT_SIZE (FIELD_OFFSET(LoginToTarget_OUT, UniqueConnectionId) + LoginToTarget_OUT_UniqueConnectionId_SIZE) - - -// -// This method is required. -// -// This method causes a logout from the target and removal of all LUNs -// exposed on that target. If the session is not connected to the target -// then the driver should stop trying to reconnect. -// - - -#define LogoutFromTarget 31 -typedef struct _LogoutFromTarget_IN -{ - // Unique Session ID. This is the session ID that was returned by the driver when the target was logged in. - ULONGLONG UniqueSessionId; - #define LogoutFromTarget_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define LogoutFromTarget_IN_UniqueSessionId_ID 1 - -} LogoutFromTarget_IN, *PLogoutFromTarget_IN; - -#define LogoutFromTarget_IN_SIZE (FIELD_OFFSET(LogoutFromTarget_IN, UniqueSessionId) + LogoutFromTarget_IN_UniqueSessionId_SIZE) - -typedef struct _LogoutFromTarget_OUT -{ - // Status code resulting from operation - ULONG Status; - #define LogoutFromTarget_OUT_Status_SIZE sizeof(ULONG) - #define LogoutFromTarget_OUT_Status_ID 2 - -} LogoutFromTarget_OUT, *PLogoutFromTarget_OUT; - -#define LogoutFromTarget_OUT_SIZE (FIELD_OFFSET(LogoutFromTarget_OUT, Status) + LogoutFromTarget_OUT_Status_SIZE) - - -// -// This method is required to exist, but the functionality may not be implemented. -// If the functionality is not implemented the driver should return an error -// -// This method causes an additional connection to be established to a target -// over a session -// - - -#define AddConnectionToSession 32 -typedef struct _AddConnectionToSession_IN -{ - // Unique Adapter specific ID. This is the UniqueAdapterId returned by the MSiSCSI_HBAInfo class. - ULONGLONG UniqueAdapterId; - #define AddConnectionToSession_IN_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define AddConnectionToSession_IN_UniqueAdapterId_ID 1 - - // Unique Session ID. This is the unique session id returned when the target was logged in. - ULONGLONG UniqueSessionId; - #define AddConnectionToSession_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define AddConnectionToSession_IN_UniqueSessionId_ID 2 - - // Security flags - ULONGLONG SecurityFlags; - #define AddConnectionToSession_IN_SecurityFlags_SIZE sizeof(ULONGLONG) - #define AddConnectionToSession_IN_SecurityFlags_ID 3 - - // Port number corresponding to port from which to initiate the connection - ULONG PortNumber; - #define AddConnectionToSession_IN_PortNumber_SIZE sizeof(ULONG) - #define AddConnectionToSession_IN_PortNumber_ID 4 - - -// -// Options that affect how login is performed. See ISCSI_LoginOptions -// - - // - ISCSI_LoginOptions LoginOptions; - #define AddConnectionToSession_IN_LoginOptions_SIZE sizeof(ISCSI_LoginOptions) - #define AddConnectionToSession_IN_LoginOptions_ID 5 - - // Target portal to use for additional connection. - ISCSI_TargetPortal TargetPortal; - #define AddConnectionToSession_IN_TargetPortal_SIZE sizeof(ISCSI_TargetPortal) - #define AddConnectionToSession_IN_TargetPortal_ID 6 - - // Size in bytes of authentication Username. - ULONG UsernameSize; - #define AddConnectionToSession_IN_UsernameSize_SIZE sizeof(ULONG) - #define AddConnectionToSession_IN_UsernameSize_ID 7 - - // Size in bytes of authentication Password. - ULONG PasswordSize; - #define AddConnectionToSession_IN_PasswordSize_SIZE sizeof(ULONG) - #define AddConnectionToSession_IN_PasswordSize_ID 8 - - // Size in bytes of preshared key associated with target ip address. - ULONG KeySize; - #define AddConnectionToSession_IN_KeySize_SIZE sizeof(ULONG) - #define AddConnectionToSession_IN_KeySize_ID 9 - - // **fields** Preshared key associated with target ip address. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. All fields after this are commented out in the header. - UCHAR Key[1]; - #define AddConnectionToSession_IN_Key_ID 10 - - // Authentication Username, for CHAP this is the CHAP_N value to use when authenticating the target. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. -// UCHAR Username[1]; - #define AddConnectionToSession_IN_Username_ID 11 - - // Authentication Password, for CHAP this is the shared secret to use when generating the respose to the target challange. NOTE: This field is a variable length array. -// UCHAR Password[1]; - #define AddConnectionToSession_IN_Password_ID 12 - -} AddConnectionToSession_IN, *PAddConnectionToSession_IN; - -typedef struct _AddConnectionToSession_OUT -{ - // Status code resulting from operation - ULONG Status; - #define AddConnectionToSession_OUT_Status_SIZE sizeof(ULONG) - #define AddConnectionToSession_OUT_Status_ID 13 - - // Unique Connection ID - ULONGLONG UniqueConnectionId; - #define AddConnectionToSession_OUT_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define AddConnectionToSession_OUT_UniqueConnectionId_ID 14 - -} AddConnectionToSession_OUT, *PAddConnectionToSession_OUT; - -#define AddConnectionToSession_OUT_SIZE (FIELD_OFFSET(AddConnectionToSession_OUT, UniqueConnectionId) + AddConnectionToSession_OUT_UniqueConnectionId_SIZE) - - -// -// This method is required. -// -// This method will remove a target from the list of persistent logins -// maintained by the adapter. -// - - -#define RemovePersistentLogin 33 -typedef struct _RemovePersistentLogin_IN -{ - // Port number corresponding to port from which to initiate the session - ULONG PortNumber; - #define RemovePersistentLogin_IN_PortNumber_SIZE sizeof(ULONG) - #define RemovePersistentLogin_IN_PortNumber_ID 1 - - // TargetName specifies the iSCSI target name which should be removed. - WCHAR TargetName[223 + 1]; - #define RemovePersistentLogin_IN_TargetName_ID 2 - - // Target portal. If an empty target portal is specified then all persistent logins to this target name for all portals are removed. - ISCSI_TargetPortal TargetPortal; - #define RemovePersistentLogin_IN_TargetPortal_SIZE sizeof(ISCSI_TargetPortal) - #define RemovePersistentLogin_IN_TargetPortal_ID 3 - -} RemovePersistentLogin_IN, *PRemovePersistentLogin_IN; - -#define RemovePersistentLogin_IN_SIZE (FIELD_OFFSET(RemovePersistentLogin_IN, TargetPortal) + RemovePersistentLogin_IN_TargetPortal_SIZE) - -typedef struct _RemovePersistentLogin_OUT -{ - // Status code resulting from operation - ULONG Status; - #define RemovePersistentLogin_OUT_Status_SIZE sizeof(ULONG) - #define RemovePersistentLogin_OUT_Status_ID 4 - -} RemovePersistentLogin_OUT, *PRemovePersistentLogin_OUT; - -#define RemovePersistentLogin_OUT_SIZE (FIELD_OFFSET(RemovePersistentLogin_OUT, Status) + RemovePersistentLogin_OUT_Status_SIZE) - - -// -// This method is required. -// -// This method will remove a connection from a session. -// Note that it is specifically disallowed to remove the last -// connection from a session, use LogoutIScsiTarget instead -// - - -#define RemoveConnectionFromSession 34 -typedef struct _RemoveConnectionFromSession_IN -{ - // Unique Session ID - ULONGLONG UniqueSessionId; - #define RemoveConnectionFromSession_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define RemoveConnectionFromSession_IN_UniqueSessionId_ID 1 - - // Unique Connection ID - ULONGLONG UniqueConnectionId; - #define RemoveConnectionFromSession_IN_UniqueConnectionId_SIZE sizeof(ULONGLONG) - #define RemoveConnectionFromSession_IN_UniqueConnectionId_ID 2 - -} RemoveConnectionFromSession_IN, *PRemoveConnectionFromSession_IN; - -#define RemoveConnectionFromSession_IN_SIZE (FIELD_OFFSET(RemoveConnectionFromSession_IN, UniqueConnectionId) + RemoveConnectionFromSession_IN_UniqueConnectionId_SIZE) - -typedef struct _RemoveConnectionFromSession_OUT -{ - // Status code resulting from operation - ULONG Status; - #define RemoveConnectionFromSession_OUT_Status_SIZE sizeof(ULONG) - #define RemoveConnectionFromSession_OUT_Status_ID 3 - -} RemoveConnectionFromSession_OUT, *PRemoveConnectionFromSession_OUT; - -#define RemoveConnectionFromSession_OUT_SIZE (FIELD_OFFSET(RemoveConnectionFromSession_OUT, Status) + RemoveConnectionFromSession_OUT_Status_SIZE) - - -// -// This method is required. -// -// This method causes a SCSI INQUIRY CDB to be sent to a target. The method -// should return success if the SCSI request succeeded. If the SCSI request -// failed the Status returned should be ISDSC_SCSI_REQUEST_FAILED and the -// ScsiStatus and SenseBuffer fields returned. -// - - -#define ScsiInquiry 50 -typedef struct _ScsiInquiry_IN -{ - // Unique Session ID - ULONGLONG UniqueSessionId; - #define ScsiInquiry_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ScsiInquiry_IN_UniqueSessionId_ID 1 - - // Logical unit to which to send INQUIRY - ULONGLONG Lun; - #define ScsiInquiry_IN_Lun_SIZE sizeof(ULONGLONG) - #define ScsiInquiry_IN_Lun_ID 2 - - // Flags to use for inquiry - UCHAR InquiryFlags; - #define ScsiInquiry_IN_InquiryFlags_SIZE sizeof(UCHAR) - #define ScsiInquiry_IN_InquiryFlags_ID 3 - - // Page code - UCHAR PageCode; - #define ScsiInquiry_IN_PageCode_SIZE sizeof(UCHAR) - #define ScsiInquiry_IN_PageCode_ID 4 - -} ScsiInquiry_IN, *PScsiInquiry_IN; - -#define ScsiInquiry_IN_SIZE (FIELD_OFFSET(ScsiInquiry_IN, PageCode) + ScsiInquiry_IN_PageCode_SIZE) - -typedef struct _ScsiInquiry_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ScsiInquiry_OUT_Status_SIZE sizeof(ULONG) - #define ScsiInquiry_OUT_Status_ID 5 - - // Size of the response buffer in bytes - ULONG ResponseBufferSize; - #define ScsiInquiry_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiInquiry_OUT_ResponseBufferSize_ID 6 - - // SCSI Status result - UCHAR ScsiStatus; - #define ScsiInquiry_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiInquiry_OUT_ScsiStatus_ID 7 - - // Sense buffer returned if SCSI error occured - UCHAR SenseBuffer[18]; - #define ScsiInquiry_OUT_SenseBuffer_SIZE sizeof(UCHAR[18]) - #define ScsiInquiry_OUT_SenseBuffer_ID 8 - - // Response to the SCSI CDB. NOTE: This field is a variable length array. - UCHAR ResponseBuffer[1]; - #define ScsiInquiry_OUT_ResponseBuffer_ID 9 - -} ScsiInquiry_OUT, *PScsiInquiry_OUT; - - -// -// This method is required. -// -// This method causes a READ CAPACITY CDB to be sent to a target. The method -// should return success if the SCSI request succeeded. If the SCSI request -// failed the Status returned should be ISDSC_SCSI_REQUEST_FAILED and the -// ScsiStatus and SenseBuffer fields returned. -// - - -#define ScsiReadCapacity 51 -typedef struct _ScsiReadCapacity_IN -{ - // Unique Session ID - ULONGLONG UniqueSessionId; - #define ScsiReadCapacity_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ScsiReadCapacity_IN_UniqueSessionId_ID 1 - - // Logical unit to which to send READ CAPACITY - ULONGLONG Lun; - #define ScsiReadCapacity_IN_Lun_SIZE sizeof(ULONGLONG) - #define ScsiReadCapacity_IN_Lun_ID 2 - -} ScsiReadCapacity_IN, *PScsiReadCapacity_IN; - -#define ScsiReadCapacity_IN_SIZE (FIELD_OFFSET(ScsiReadCapacity_IN, Lun) + ScsiReadCapacity_IN_Lun_SIZE) - -typedef struct _ScsiReadCapacity_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ScsiReadCapacity_OUT_Status_SIZE sizeof(ULONG) - #define ScsiReadCapacity_OUT_Status_ID 3 - - // Size of the response buffer in bytes - ULONG ResponseBufferSize; - #define ScsiReadCapacity_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiReadCapacity_OUT_ResponseBufferSize_ID 4 - - // SCSI Status result - UCHAR ScsiStatus; - #define ScsiReadCapacity_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiReadCapacity_OUT_ScsiStatus_ID 5 - - // Sense buffer returned on SCSI error - UCHAR SenseBuffer[18]; - #define ScsiReadCapacity_OUT_SenseBuffer_SIZE sizeof(UCHAR[18]) - #define ScsiReadCapacity_OUT_SenseBuffer_ID 6 - - // Response to the SCSI CDB. NOTE: This field is a variable length array. - UCHAR ResponseBuffer[1]; - #define ScsiReadCapacity_OUT_ResponseBuffer_ID 7 - -} ScsiReadCapacity_OUT, *PScsiReadCapacity_OUT; - - -// -// This method is required. -// -// This method causes a REPORT LUNS CDB to be sent to a target. The method -// should return success if the SCSI request succeeded. If the SCSI request -// failed the Status returned should be ISDSC_SCSI_REQUEST_FAILED and the -// ScsiStatus and SenseBuffer fields returned. -// - - -#define ScsiReportLuns 52 -typedef struct _ScsiReportLuns_IN -{ - // Unique Session ID - ULONGLONG UniqueSessionId; - #define ScsiReportLuns_IN_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define ScsiReportLuns_IN_UniqueSessionId_ID 1 - -} ScsiReportLuns_IN, *PScsiReportLuns_IN; - -#define ScsiReportLuns_IN_SIZE (FIELD_OFFSET(ScsiReportLuns_IN, UniqueSessionId) + ScsiReportLuns_IN_UniqueSessionId_SIZE) - -typedef struct _ScsiReportLuns_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ScsiReportLuns_OUT_Status_SIZE sizeof(ULONG) - #define ScsiReportLuns_OUT_Status_ID 2 - - // Size of the response buffer in bytes - ULONG ResponseBufferSize; - #define ScsiReportLuns_OUT_ResponseBufferSize_SIZE sizeof(ULONG) - #define ScsiReportLuns_OUT_ResponseBufferSize_ID 3 - - // SCSI Status result - UCHAR ScsiStatus; - #define ScsiReportLuns_OUT_ScsiStatus_SIZE sizeof(UCHAR) - #define ScsiReportLuns_OUT_ScsiStatus_ID 4 - - // Sense buffer returned on SCSI error - UCHAR SenseBuffer[18]; - #define ScsiReportLuns_OUT_SenseBuffer_SIZE sizeof(UCHAR[18]) - #define ScsiReportLuns_OUT_SenseBuffer_ID 5 - - // Response to the SCSI CDB. NOTE: This field is a variable length array. - UCHAR ResponseBuffer[1]; - #define ScsiReportLuns_OUT_ResponseBuffer_ID 6 - -} ScsiReportLuns_OUT, *PScsiReportLuns_OUT; - - -// -// This method is required. -// -// This method establishes a CHAP shared secret that is assigned to -// this initiator and should be used when verifying the CHAP response -// to a challange sent by the initiator. Note that the shared secret -// that is used to generate the CHAP response to a target's challange -// is passed in the LoginToTarget method -// - - -#define SetCHAPSharedSecret 71 -typedef struct _SetCHAPSharedSecret_IN -{ - // Size of Chap shared secret in bytes - ULONG SharedSecretSize; - #define SetCHAPSharedSecret_IN_SharedSecretSize_SIZE sizeof(ULONG) - #define SetCHAPSharedSecret_IN_SharedSecretSize_ID 1 - - // CHAP shared secret. NOTE: This field is a variable length array. - UCHAR SharedSecret[1]; - #define SetCHAPSharedSecret_IN_SharedSecret_ID 2 - -} SetCHAPSharedSecret_IN, *PSetCHAPSharedSecret_IN; - -typedef struct _SetCHAPSharedSecret_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetCHAPSharedSecret_OUT_Status_SIZE sizeof(ULONG) - #define SetCHAPSharedSecret_OUT_Status_ID 3 - -} SetCHAPSharedSecret_OUT, *PSetCHAPSharedSecret_OUT; - -#define SetCHAPSharedSecret_OUT_SIZE (FIELD_OFFSET(SetCHAPSharedSecret_OUT, Status) + SetCHAPSharedSecret_OUT_Status_SIZE) - - -// -// This method is required. -// -// This method establishes a RADIUS shared secret that is assigned to -// this initiator and should be used when authenticating oneself -// to the RADIUS server. -// - - -#define SetRADIUSSharedSecret 72 -typedef struct _SetRADIUSSharedSecret_IN -{ - // Size of RADIUS shared secret in bytes - ULONG SharedSecretSize; - #define SetRADIUSSharedSecret_IN_SharedSecretSize_SIZE sizeof(ULONG) - #define SetRADIUSSharedSecret_IN_SharedSecretSize_ID 1 - - // RADIUS shared secret. NOTE: This field is a variable length array. - UCHAR SharedSecret[1]; - #define SetRADIUSSharedSecret_IN_SharedSecret_ID 2 - -} SetRADIUSSharedSecret_IN, *PSetRADIUSSharedSecret_IN; - -typedef struct _SetRADIUSSharedSecret_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetRADIUSSharedSecret_OUT_Status_SIZE sizeof(ULONG) - #define SetRADIUSSharedSecret_OUT_Status_ID 3 - -} SetRADIUSSharedSecret_OUT, *PSetRADIUSSharedSecret_OUT; - -#define SetRADIUSSharedSecret_OUT_SIZE (FIELD_OFFSET(SetRADIUSSharedSecret_OUT, Status) + SetRADIUSSharedSecret_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method informs the initiator that an initiator node name is no -// longer in use. -// - - -#define DeleteInitiatorNodeName 91 -typedef struct _DeleteInitiatorNodeName_IN -{ - // Initiator name that is deleted. - WCHAR DeletedInitiatorName[223 + 1]; - #define DeleteInitiatorNodeName_IN_DeletedInitiatorName_ID 1 - -} DeleteInitiatorNodeName_IN, *PDeleteInitiatorNodeName_IN; - -typedef struct _DeleteInitiatorNodeName_OUT -{ - // Status code resulting from operation - ULONG Status; - #define DeleteInitiatorNodeName_OUT_Status_SIZE sizeof(ULONG) - #define DeleteInitiatorNodeName_OUT_Status_ID 2 - -} DeleteInitiatorNodeName_OUT, *PDeleteInitiatorNodeName_OUT; - -#define DeleteInitiatorNodeName_OUT_SIZE (FIELD_OFFSET(DeleteInitiatorNodeName_OUT, Status) + DeleteInitiatorNodeName_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method informs the initiator that a new initiator node name is -// begin to be in use// - - -#define SetInitiatorNodeName 92 -typedef struct _SetInitiatorNodeName_IN -{ - // New initiator name. - WCHAR CreatedInitiatorName[223 + 1]; - #define SetInitiatorNodeName_IN_CreatedInitiatorName_ID 1 - -} SetInitiatorNodeName_IN, *PSetInitiatorNodeName_IN; - -typedef struct _SetInitiatorNodeName_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetInitiatorNodeName_OUT_Status_SIZE sizeof(ULONG) - #define SetInitiatorNodeName_OUT_Status_ID 2 - -} SetInitiatorNodeName_OUT, *PSetInitiatorNodeName_OUT; - -#define SetInitiatorNodeName_OUT_SIZE (FIELD_OFFSET(SetInitiatorNodeName_OUT, Status) + SetInitiatorNodeName_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method adds an iSNS server to the list of iSNS servers the HBA -// should manage -// - - -#define AddiSNSServer 101 -typedef struct _AddiSNSServer_IN -{ - // iSNS Server Name - WCHAR iSNSServerName[223 + 1]; - #define AddiSNSServer_IN_iSNSServerName_ID 1 - -} AddiSNSServer_IN, *PAddiSNSServer_IN; - -typedef struct _AddiSNSServer_OUT -{ - // Status code resulting from operation - ULONG Status; - #define AddiSNSServer_OUT_Status_SIZE sizeof(ULONG) - #define AddiSNSServer_OUT_Status_ID 2 - -} AddiSNSServer_OUT, *PAddiSNSServer_OUT; - -#define AddiSNSServer_OUT_SIZE (FIELD_OFFSET(AddiSNSServer_OUT, Status) + AddiSNSServer_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method removes an iSNS server from the list of iSNS servers the HBA -// should manage -// - - -#define RemoveiSNSServer 102 -typedef struct _RemoveiSNSServer_IN -{ - // iSNS Server Name - WCHAR iSNSServerName[223 + 1]; - #define RemoveiSNSServer_IN_iSNSServerName_ID 1 - -} RemoveiSNSServer_IN, *PRemoveiSNSServer_IN; - -typedef struct _RemoveiSNSServer_OUT -{ - // Status code resulting from operation - ULONG Status; - #define RemoveiSNSServer_OUT_Status_SIZE sizeof(ULONG) - #define RemoveiSNSServer_OUT_Status_ID 2 - -} RemoveiSNSServer_OUT, *PRemoveiSNSServer_OUT; - -#define RemoveiSNSServer_OUT_SIZE (FIELD_OFFSET(RemoveiSNSServer_OUT, Status) + RemoveiSNSServer_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method adds a RADIUS server to the list of RADIUS servers the initiator/HBA -// should manage -// - - -#define AddRADIUSServer 103 -typedef struct _AddRADIUSServer_IN -{ - // RADIUS Server Address - ISCSI_IP_Address RADIUSIPAddress; - #define AddRADIUSServer_IN_RADIUSIPAddress_SIZE sizeof(ISCSI_IP_Address) - #define AddRADIUSServer_IN_RADIUSIPAddress_ID 1 - -} AddRADIUSServer_IN, *PAddRADIUSServer_IN; - -#define AddRADIUSServer_IN_SIZE (FIELD_OFFSET(AddRADIUSServer_IN, RADIUSIPAddress) + AddRADIUSServer_IN_RADIUSIPAddress_SIZE) - -typedef struct _AddRADIUSServer_OUT -{ - // Status code resulting from operation - ULONG Status; - #define AddRADIUSServer_OUT_Status_SIZE sizeof(ULONG) - #define AddRADIUSServer_OUT_Status_ID 2 - -} AddRADIUSServer_OUT, *PAddRADIUSServer_OUT; - -#define AddRADIUSServer_OUT_SIZE (FIELD_OFFSET(AddRADIUSServer_OUT, Status) + AddRADIUSServer_OUT_Status_SIZE) - - -// -// This method is optional and does not need to be implemented. -// -// This method removes a RADIUS server from the list of RADIUS servers the initiator/HBA -// should manage -// - - -#define RemoveRADIUSServer 104 -typedef struct _RemoveRADIUSServer_IN -{ - // RADIUS Server Address - ISCSI_IP_Address RADIUSIPAddress; - #define RemoveRADIUSServer_IN_RADIUSIPAddress_SIZE sizeof(ISCSI_IP_Address) - #define RemoveRADIUSServer_IN_RADIUSIPAddress_ID 1 - -} RemoveRADIUSServer_IN, *PRemoveRADIUSServer_IN; - -#define RemoveRADIUSServer_IN_SIZE (FIELD_OFFSET(RemoveRADIUSServer_IN, RADIUSIPAddress) + RemoveRADIUSServer_IN_RADIUSIPAddress_SIZE) - -typedef struct _RemoveRADIUSServer_OUT -{ - // Status code resulting from operation - ULONG Status; - #define RemoveRADIUSServer_OUT_Status_SIZE sizeof(ULONG) - #define RemoveRADIUSServer_OUT_Status_ID 2 - -} RemoveRADIUSServer_OUT, *PRemoveRADIUSServer_OUT; - -#define RemoveRADIUSServer_OUT_SIZE (FIELD_OFFSET(RemoveRADIUSServer_OUT, Status) + RemoveRADIUSServer_OUT_Status_SIZE) - - -// ISCSI_Persistent_Login - ISCSI_Persistent_Login -// Persistent Target login -#define ISCSI_Persistent_LoginGuid \ - { 0x1ac62a5d,0xa418,0x4c15, { 0x96,0xbd,0x2c,0x3a,0x9d,0xb8,0xc8,0xca } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ISCSI_Persistent_Login_GUID, \ - 0x1ac62a5d,0xa418,0x4c15,0x96,0xbd,0x2c,0x3a,0x9d,0xb8,0xc8,0xca); -#endif - - -typedef struct _ISCSI_Persistent_Login -{ - // Name of the target for persistent login - WCHAR TargetName[223 + 1]; - #define ISCSI_Persistent_Login_TargetName_ID 1 - - // Security flags - ULONGLONG SecurityFlags; - #define ISCSI_Persistent_Login_SecurityFlags_SIZE sizeof(ULONGLONG) - #define ISCSI_Persistent_Login_SecurityFlags_ID 2 - - // Port number on which to perform the login - ULONG InitiatorPortNumber; - #define ISCSI_Persistent_Login_InitiatorPortNumber_SIZE sizeof(ULONG) - #define ISCSI_Persistent_Login_InitiatorPortNumber_ID 3 - - // Number of bytes in username - ULONG UsernameSize; - #define ISCSI_Persistent_Login_UsernameSize_SIZE sizeof(ULONG) - #define ISCSI_Persistent_Login_UsernameSize_ID 4 - - // TRUE if informational session - BOOLEAN IsInformationalSession; - #define ISCSI_Persistent_Login_IsInformationalSession_SIZE sizeof(BOOLEAN) - #define ISCSI_Persistent_Login_IsInformationalSession_ID 5 - - // ISID that the persistent login will use for login - USHORT UniqueIdForISID; - #define ISCSI_Persistent_Login_UniqueIdForISID_SIZE sizeof(USHORT) - #define ISCSI_Persistent_Login_UniqueIdForISID_ID 6 - - // Portal to use for initial connection - ISCSI_TargetPortal TargetPortal; - #define ISCSI_Persistent_Login_TargetPortal_SIZE sizeof(ISCSI_TargetPortal) - #define ISCSI_Persistent_Login_TargetPortal_ID 7 - - // Login options - ISCSI_LoginOptions LoginOptions; - #define ISCSI_Persistent_Login_LoginOptions_SIZE sizeof(ISCSI_LoginOptions) - #define ISCSI_Persistent_Login_LoginOptions_ID 8 - - // Target mappings - ISCSI_TargetMapping TargetMapping; - #define ISCSI_Persistent_Login_TargetMapping_SIZE sizeof(ISCSI_TargetMapping) - #define ISCSI_Persistent_Login_TargetMapping_ID 9 - - // Authentication Username, for CHAP this is the CHAP Name (CHAP_N) when authenticating the target. NOTE: This field is a variable length array. - UCHAR Username[1]; - #define ISCSI_Persistent_Login_Username_ID 10 - -} ISCSI_Persistent_Login, *PISCSI_Persistent_Login; - -// MSiSCSI_PersistentLogins - MSiSCSI_PersistentLogins - -// -// This class is required. -// -// This class returns the list of persistent target logins. A persistent -// target login is one where the initiator must login to the -// target immediately upon loading so that the device is available -// early in boot -// - -#define MSiSCSI_PersistentLoginsGuid \ - { 0x420512d9,0x0537,0x4c67, { 0xa7,0x79,0x84,0xba,0x7b,0x29,0xce,0x9f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_PersistentLogins_GUID, \ - 0x420512d9,0x0537,0x4c67,0xa7,0x79,0x84,0xba,0x7b,0x29,0xce,0x9f); -#endif - - -typedef struct _MSiSCSI_PersistentLogins -{ - // Number of persistent logins - ULONG PersistentLoginCount; - #define MSiSCSI_PersistentLogins_PersistentLoginCount_SIZE sizeof(ULONG) - #define MSiSCSI_PersistentLogins_PersistentLoginCount_ID 1 - - // Reserved - ULONG Reserved; - #define MSiSCSI_PersistentLogins_Reserved_SIZE sizeof(ULONG) - #define MSiSCSI_PersistentLogins_Reserved_ID 2 - - // Array of PersistentLoginCount ISCSI_Persistent_Login structures. NOTE: This field is a variable length array. - ISCSI_Persistent_Login PersistentLogins[1]; - #define MSiSCSI_PersistentLogins_PersistentLogins_ID 3 - -} MSiSCSI_PersistentLogins, *PMSiSCSI_PersistentLogins; - -// MSiSCSI_TargetMappings - MSiSCSI_TargetMappings -// Target mappings for iSCSI LUNs - -// -// This class is required. -// -// This class returns the list of current OS mappings for iSCSI LUNs -// The iSCSI initiator service relies upon this -// class in order to interface with your HBA. Implement one instance -// per adapter. This class must be registered using PDO -// instance names. -// - -#define MSiSCSI_TargetMappingsGuid \ - { 0x41646815,0x7524,0x4bc0, { 0x90,0x4a,0xcd,0x7d,0x51,0x0e,0xac,0x02 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_TargetMappings_GUID, \ - 0x41646815,0x7524,0x4bc0,0x90,0x4a,0xcd,0x7d,0x51,0x0e,0xac,0x02); -#endif - - -typedef struct _MSiSCSI_TargetMappings -{ - // Id that is globally unique to each instance of each adapter. This should be the value returned by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_TargetMappings_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_TargetMappings_UniqueAdapterId_ID 1 - - // Number of target mappings - ULONG TargetMappingCount; - #define MSiSCSI_TargetMappings_TargetMappingCount_SIZE sizeof(ULONG) - #define MSiSCSI_TargetMappings_TargetMappingCount_ID 2 - - // Reserved - ULONG Reserved; - #define MSiSCSI_TargetMappings_Reserved_SIZE sizeof(ULONG) - #define MSiSCSI_TargetMappings_Reserved_ID 3 - - // Array of TargetMappingCount ISCSI_TargetMapping structures. NOTE: This field is a variable length array. - ISCSI_TargetMapping TargetMappings[1]; - #define MSiSCSI_TargetMappings_TargetMappings_ID 4 - -} MSiSCSI_TargetMappings, *PMSiSCSI_TargetMappings; - -// MSiSCSI_LUNMappingInformation - MSiSCSI_LUNMappingInformation -// LUN Mapping Information - -// -// This class is required. -// -// It must be implemented using PDO instance names by the PDO device object -// -// This class exposes the OS SCSI address information for a particular LUN. -// The SCSI address information must be consistent with the information returned -// by the MSIScsi_TargetMappings class and the information reported to the port -// driver. The class must be implemented on the PDO device object so that there -// will be one instance for each device created by the adapter and named by the -// PDO name for the created device and not the adapter -// - -#define MSiSCSI_LUNMappingInformationGuid \ - { 0x7bb02370,0xb8ae,0x4d29, { 0x88,0xde,0x76,0x95,0x1d,0x32,0x45,0xba } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_LUNMappingInformation_GUID, \ - 0x7bb02370,0xb8ae,0x4d29,0x88,0xde,0x76,0x95,0x1d,0x32,0x45,0xba); -#endif - - -typedef struct _MSiSCSI_LUNMappingInformation -{ - // Id that is globally unique to each instance of each adapter. Using the address of the Adapter Extension is a good idea. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_LUNMappingInformation_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_LUNMappingInformation_UniqueAdapterId_ID 1 - - // Id that is unique to this session within this adapter. This should be the same session id as the one assigned when the session was logged in. - ULONGLONG UniqueSessionId; - #define MSiSCSI_LUNMappingInformation_UniqueSessionId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_LUNMappingInformation_UniqueSessionId_ID 2 - - // OS Bus Number - ULONG OSBus; - #define MSiSCSI_LUNMappingInformation_OSBus_SIZE sizeof(ULONG) - #define MSiSCSI_LUNMappingInformation_OSBus_ID 3 - - // OS Target Number - ULONG OSTarget; - #define MSiSCSI_LUNMappingInformation_OSTarget_SIZE sizeof(ULONG) - #define MSiSCSI_LUNMappingInformation_OSTarget_ID 4 - - // OS LUN Number - ULONG OSLUN; - #define MSiSCSI_LUNMappingInformation_OSLUN_SIZE sizeof(ULONG) - #define MSiSCSI_LUNMappingInformation_OSLUN_ID 5 - -} MSiSCSI_LUNMappingInformation, *PMSiSCSI_LUNMappingInformation; - -#define MSiSCSI_LUNMappingInformation_SIZE (FIELD_OFFSET(MSiSCSI_LUNMappingInformation, OSLUN) + MSiSCSI_LUNMappingInformation_OSLUN_SIZE) - -// MSiSCSI_SecurityConfigOperations - MSiSCSI_SecurityConfigOperations - -// -// This class is required if your adapter supports IPSEC or CHAP. -// -// An adapter must support the appropriate methods if it implements -// security including IKE (using preshared keys) and/or a non volatile -// cache for IPSEC preshared keys and iSCSI authentication credentials -// (ie, username and passwords). The adapter should also indicate that -// that the cache is implemented by setting the appropriate flags in the -// MSiSCSI_HBAInformation class -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_SecurityConfigOperationsGuid \ - { 0x391f3325,0x0ba3,0x4083, { 0xa8,0x61,0xcf,0x4f,0x6f,0x97,0xa5,0x27 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_SecurityConfigOperations_GUID, \ - 0x391f3325,0x0ba3,0x4083,0xa8,0x61,0xcf,0x4f,0x6f,0x97,0xa5,0x27); -#endif - -// -// Method id definitions for MSiSCSI_SecurityConfigOperations - -// -// This method is required if the initiator supports IKE. -// -// SetPresharedKeyForId allows a management application to configure an -// adapter with a preshared key that is associated with an id. The -// id corresponds to the contents of the identification payload in the -// IKE phase 1 aggressive or main mode exchange. The -// key can be associated with an ip address for use in the IKE phase 1 -// main mode exchange. The adapter should maintain the key in its non -// volatile storage if it is available. The adapter should also maintain -// the key in its working memory so that it is available for IKE phase 1 -// negotiation. If NVRAM is not available then the initiator service will -// maintain the key on behalf of the adapter. -// -// -// -// IKE Identification payload types (from RFC 2407) -// -#define ID_IPV4_ADDR 1 -#define ID_FQDN 2 -#define ID_USER_FQDN 3 -#define ID_IPV6_ADDR 5 - - -#define SetPresharedKeyForId 1 -typedef struct _SetPresharedKeyForId_IN -{ - // Specific port number or 0xffffffff for all ports - ULONG PortNumber; - #define SetPresharedKeyForId_IN_PortNumber_SIZE sizeof(ULONG) - #define SetPresharedKeyForId_IN_PortNumber_ID 1 - - // - ULONGLONG SecurityFlags; - #define SetPresharedKeyForId_IN_SecurityFlags_SIZE sizeof(ULONGLONG) - #define SetPresharedKeyForId_IN_SecurityFlags_ID 2 - - // Type of Id to associate with the preshared key - UCHAR IdType; - #define SetPresharedKeyForId_IN_IdType_SIZE sizeof(UCHAR) - #define SetPresharedKeyForId_IN_IdType_ID 3 - - // Size in bytes of the Id - ULONG IdSize; - #define SetPresharedKeyForId_IN_IdSize_SIZE sizeof(ULONG) - #define SetPresharedKeyForId_IN_IdSize_ID 4 - - // Size in bytes of the Key - ULONG KeySize; - #define SetPresharedKeyForId_IN_KeySize_SIZE sizeof(ULONG) - #define SetPresharedKeyForId_IN_KeySize_ID 5 - - // **fields** Id to associate with the key. NOTE: This field is a variable length array, the field that follows this field starts immediately after the end of this field subject to appropriate padding. All fields after this are commented out in the header. - UCHAR Id[1]; - #define SetPresharedKeyForId_IN_Id_ID 6 - - // Key to associate with the id. NOTE: This field is a variable length array. -// UCHAR Key[1]; - #define SetPresharedKeyForId_IN_Key_ID 7 - -} SetPresharedKeyForId_IN, *PSetPresharedKeyForId_IN; - -typedef struct _SetPresharedKeyForId_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetPresharedKeyForId_OUT_Status_SIZE sizeof(ULONG) - #define SetPresharedKeyForId_OUT_Status_ID 8 - -} SetPresharedKeyForId_OUT, *PSetPresharedKeyForId_OUT; - -#define SetPresharedKeyForId_OUT_SIZE (FIELD_OFFSET(SetPresharedKeyForId_OUT, Status) + SetPresharedKeyForId_OUT_Status_SIZE) - - -// -// This method is required if the initiator supports IKE. -// -// GetPresharedKeyForId allows a management application to determine if -// a particular IKE identification payload is configured with a preshared -// key -// - -#define GetPresharedKeyForId 2 -typedef struct _GetPresharedKeyForId_IN -{ - // - ULONG PortNumber; - #define GetPresharedKeyForId_IN_PortNumber_SIZE sizeof(ULONG) - #define GetPresharedKeyForId_IN_PortNumber_ID 1 - - // Type of Id to associate with the preshared key - UCHAR IdType; - #define GetPresharedKeyForId_IN_IdType_SIZE sizeof(UCHAR) - #define GetPresharedKeyForId_IN_IdType_ID 2 - - // Size in bytes of the Id - ULONG IdSize; - #define GetPresharedKeyForId_IN_IdSize_SIZE sizeof(ULONG) - #define GetPresharedKeyForId_IN_IdSize_ID 3 - - // Id to associate with the key. NOTE: This field is a variable length array. - UCHAR Id[1]; - #define GetPresharedKeyForId_IN_Id_ID 4 - -} GetPresharedKeyForId_IN, *PGetPresharedKeyForId_IN; - -typedef struct _GetPresharedKeyForId_OUT -{ - // Status code resulting from operation - ULONG Status; - #define GetPresharedKeyForId_OUT_Status_SIZE sizeof(ULONG) - #define GetPresharedKeyForId_OUT_Status_ID 5 - - // - ULONGLONG SecurityFlags; - #define GetPresharedKeyForId_OUT_SecurityFlags_SIZE sizeof(ULONGLONG) - #define GetPresharedKeyForId_OUT_SecurityFlags_ID 6 - -} GetPresharedKeyForId_OUT, *PGetPresharedKeyForId_OUT; - -#define GetPresharedKeyForId_OUT_SIZE (FIELD_OFFSET(GetPresharedKeyForId_OUT, SecurityFlags) + GetPresharedKeyForId_OUT_SecurityFlags_SIZE) - - -// -// This method is required if the initiator supports IKE -// -// SetGroupPresharedKey allows a management application to configure an -// adapter with a group preshared key that is used in an IKE phase 1 exchange -// when there is no specific key available for that exchange. The adapter -// should maintain the key in its non volatile storage if available and -// maintain the key in its working memory so that it is available for IKE -// phase 1 negotiation -// -// - -#define SetGroupPresharedKey 3 -typedef struct _SetGroupPresharedKey_IN -{ - // Number of bytes passed in Key for the preshared key - ULONG KeySize; - #define SetGroupPresharedKey_IN_KeySize_SIZE sizeof(ULONG) - #define SetGroupPresharedKey_IN_KeySize_ID 1 - - // Preshared key used as group key. NOTE: This field is a variable length array. - UCHAR Key[1]; - #define SetGroupPresharedKey_IN_Key_ID 2 - -} SetGroupPresharedKey_IN, *PSetGroupPresharedKey_IN; - -typedef struct _SetGroupPresharedKey_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetGroupPresharedKey_OUT_Status_SIZE sizeof(ULONG) - #define SetGroupPresharedKey_OUT_Status_ID 3 - -} SetGroupPresharedKey_OUT, *PSetGroupPresharedKey_OUT; - -#define SetGroupPresharedKey_OUT_SIZE (FIELD_OFFSET(SetGroupPresharedKey_OUT, Status) + SetGroupPresharedKey_OUT_Status_SIZE) - - -// -// This method is required if the initiator supports IPSEC tunnel mode -// -// SetTunnelModeOuterAddress allows a management application to configure the -// tunnel mode outer address that is used by a port on an adapter -// The adapter should maintain the address in its non volatile -// storage if available -// - -#define SetTunnelModeOuterAddress 4 -typedef struct _SetTunnelModeOuterAddress_IN -{ - // Port number to which to associate tunnel mode address. Use 0xffffffff to associate with all ports. - ULONG PortNumber; - #define SetTunnelModeOuterAddress_IN_PortNumber_SIZE sizeof(ULONG) - #define SetTunnelModeOuterAddress_IN_PortNumber_ID 1 - - // Destination address - ISCSI_IP_Address DestinationAddress; - #define SetTunnelModeOuterAddress_IN_DestinationAddress_SIZE sizeof(ISCSI_IP_Address) - #define SetTunnelModeOuterAddress_IN_DestinationAddress_ID 2 - - // Tunnel mode outer address - ISCSI_IP_Address TunnelModeOuterAddress; - #define SetTunnelModeOuterAddress_IN_TunnelModeOuterAddress_SIZE sizeof(ISCSI_IP_Address) - #define SetTunnelModeOuterAddress_IN_TunnelModeOuterAddress_ID 3 - -} SetTunnelModeOuterAddress_IN, *PSetTunnelModeOuterAddress_IN; - -#define SetTunnelModeOuterAddress_IN_SIZE (FIELD_OFFSET(SetTunnelModeOuterAddress_IN, TunnelModeOuterAddress) + SetTunnelModeOuterAddress_IN_TunnelModeOuterAddress_SIZE) - -typedef struct _SetTunnelModeOuterAddress_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetTunnelModeOuterAddress_OUT_Status_SIZE sizeof(ULONG) - #define SetTunnelModeOuterAddress_OUT_Status_ID 4 - -} SetTunnelModeOuterAddress_OUT, *PSetTunnelModeOuterAddress_OUT; - -#define SetTunnelModeOuterAddress_OUT_SIZE (FIELD_OFFSET(SetTunnelModeOuterAddress_OUT, Status) + SetTunnelModeOuterAddress_OUT_Status_SIZE) - - -// -// This method is required if the initiator caches information -// -// ClearCache instructs the HBA to clear the iSCSI authentication and -// preshared key caches -// - -#define ClearCache 5 -typedef struct _ClearCache_OUT -{ - // Status code resulting from operation - ULONG Status; - #define ClearCache_OUT_Status_SIZE sizeof(ULONG) - #define ClearCache_OUT_Status_ID 1 - -} ClearCache_OUT, *PClearCache_OUT; - -#define ClearCache_OUT_SIZE (FIELD_OFFSET(ClearCache_OUT, Status) + ClearCache_OUT_Status_SIZE) - - -// -// This method is required if the initiator caches information -// -// This method establishes a marker that the service can subsequently -// validate to ensure that the initiator cache is valid -// - -#define SetGenerationalGuid 6 -typedef struct _SetGenerationalGuid_IN -{ - // Generational Guid - UCHAR GenerationalGuid[16]; - #define SetGenerationalGuid_IN_GenerationalGuid_SIZE sizeof(UCHAR[16]) - #define SetGenerationalGuid_IN_GenerationalGuid_ID 1 - -} SetGenerationalGuid_IN, *PSetGenerationalGuid_IN; - -#define SetGenerationalGuid_IN_SIZE (FIELD_OFFSET(SetGenerationalGuid_IN, GenerationalGuid) + SetGenerationalGuid_IN_GenerationalGuid_SIZE) - -typedef struct _SetGenerationalGuid_OUT -{ - // Status code resulting from operation - ULONG Status; - #define SetGenerationalGuid_OUT_Status_SIZE sizeof(ULONG) - #define SetGenerationalGuid_OUT_Status_ID 2 - -} SetGenerationalGuid_OUT, *PSetGenerationalGuid_OUT; - -#define SetGenerationalGuid_OUT_SIZE (FIELD_OFFSET(SetGenerationalGuid_OUT, Status) + SetGenerationalGuid_OUT_Status_SIZE) - - -// MSiSCSI_BootInformation - MSiSCSI_BootInformation -#define MSiSCSI_BootInformationGuid \ - { 0xee5a2356,0xc703,0x489b, { 0xb1,0x36,0x69,0xc9,0x94,0xae,0x3a,0x20 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_BootInformation_GUID, \ - 0xee5a2356,0xc703,0x489b,0xb1,0x36,0x69,0xc9,0x94,0xae,0x3a,0x20); -#endif - - -typedef struct _MSiSCSI_BootInformation -{ - // Initiator Node Name used for boot - UCHAR NodeName[223]; - #define MSiSCSI_BootInformation_NodeName_SIZE sizeof(UCHAR[223]) - #define MSiSCSI_BootInformation_NodeName_ID 1 - - // Length of Initiator Shared Secret - ULONG SharedSecretLength; - #define MSiSCSI_BootInformation_SharedSecretLength_SIZE sizeof(ULONG) - #define MSiSCSI_BootInformation_SharedSecretLength_ID 2 - - // Initiator Shared Secret - UCHAR SharedSecret[255]; - #define MSiSCSI_BootInformation_SharedSecret_SIZE sizeof(UCHAR[255]) - #define MSiSCSI_BootInformation_SharedSecret_ID 3 - -} MSiSCSI_BootInformation, *PMSiSCSI_BootInformation; - -#define MSiSCSI_BootInformation_SIZE (FIELD_OFFSET(MSiSCSI_BootInformation, SharedSecret) + MSiSCSI_BootInformation_SharedSecret_SIZE) - -// MSiSCSI_AdapterEvent - MSiSCSI_AdapterEvent - -typedef enum { - ISCSI_ADAPTER_TARGETS_CHANGED = 3 -} ISCSI_ADAPTER_EVENT_CODE, *PISCSI_ADAPTER_EVENT_CODE; - -// -// This class is required if the HBA supports discovery -// -// This class must be registered using PDO instance names with a single instance -// - -#define MSiSCSI_AdapterEventGuid \ - { 0x46b122c0,0x3767,0x4069, { 0x91,0x6e,0x3a,0x43,0x70,0x2f,0x05,0xce } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_AdapterEvent_GUID, \ - 0x46b122c0,0x3767,0x4069,0x91,0x6e,0x3a,0x43,0x70,0x2f,0x05,0xce); -#endif - - -typedef struct _MSiSCSI_AdapterEvent -{ - // Id that is unique to each instance of each adapter. This is the ID returned in the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_AdapterEvent_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_AdapterEvent_UniqueAdapterId_ID 1 - - // **typedef**Adapter Event Code - ULONG EventCode; - #define MSiSCSI_AdapterEvent_EventCode_SIZE sizeof(ULONG) - #define MSiSCSI_AdapterEvent_EventCode_ID 2 - -} MSiSCSI_AdapterEvent, *PMSiSCSI_AdapterEvent; - -#define MSiSCSI_AdapterEvent_SIZE (FIELD_OFFSET(MSiSCSI_AdapterEvent, EventCode) + MSiSCSI_AdapterEvent_EventCode_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/iscsiprf.h b/qt-correction-tool/pub/ddk/iscsiprf.h deleted file mode 100644 index b3b67d1..0000000 --- a/qt-correction-tool/pub/ddk/iscsiprf.h +++ /dev/null @@ -1,712 +0,0 @@ -#ifndef _iscsiprf_h_ -#define _iscsiprf_h_ - -// MSiSCSI_MMIPSECStats - MSiSCSI_MMIPSECStats -// iSCSI HBA main mode IPSEC Statistics - - -//*************************************************************************** -// -// iscsiprf.h -// -// Module: iSCSI Discovery api -// -// Purpose: Internal header defining interface between user mode discovery -// api dll and HBA driver miniport. -// -// Note: These classes are recommended as by implementing them the data -// exposed will be available in sysmon (perfmon) when running on -// Windows XP and Windows .Net server -// -// Copyright (c) 2001 Microsoft Corporation -// -//*************************************************************************** - -// -// This class exposes the main mode IPSEC statistics -// -// This class must be registered with PDO instance names using a single instance -// - -#define MSiSCSI_MMIPSECStatsGuid \ - { 0x36b58ea2,0xc461,0x4bb0, { 0xac,0x8e,0x95,0x2f,0x59,0xd2,0x51,0xed } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_MMIPSECStats_GUID, \ - 0x36b58ea2,0xc461,0x4bb0,0xac,0x8e,0x95,0x2f,0x59,0xd2,0x51,0xed); -#endif - - -typedef struct _MSiSCSI_MMIPSECStats -{ - -// An acquire is a request by the IPSEC driver to have IKE perform a task. The active acquire statistic includes the outstanding request and the number of any queued requests. Typically, the number of active acquires is 1. Under a heavy load, the number of active acquires is 1 and the number of requests that are queued by IKE for processing. - // An acquire is a request by the IPSEC driver to have IKE perform a task. The active acquire statistic includes the outstanding request and the number of any queued requests. Typically, the number of active acquires is 1. Under a heavy load, the number of active acquires is 1 and the number of requests that are queued by IKE for processing. - ULONGLONG ActiveAcquire; - #define MSiSCSI_MMIPSECStats_ActiveAcquire_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_ActiveAcquire_ID 1 - - -// The number of IKE messages received that are queued for processing. - // The number of IKE messages received that are queued for processing. - ULONGLONG ActiveReceive; - #define MSiSCSI_MMIPSECStats_ActiveReceive_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_ActiveReceive_ID 2 - - -// The number of times that an acquire has failed. - // The number of times that an acquire has failed. - ULONGLONG AcquireFailures; - #define MSiSCSI_MMIPSECStats_AcquireFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_AcquireFailures_ID 3 - - -// The number of times that the TCP stack has failed when receiving IKE messages. - // The number of times that the TCP stack has failed when receiving IKE messages. - ULONGLONG ReceiveFailures; - #define MSiSCSI_MMIPSECStats_ReceiveFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_ReceiveFailures_ID 4 - - -// The number of times that the TCP/IP stack has failed when sending IKE messages. - // The number of times that the TCP/IP stack has failed when sending IKE messages. - ULONGLONG SendFailures; - #define MSiSCSI_MMIPSECStats_SendFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_SendFailures_ID 5 - - -// The number of entries in the acquire heap, which stores active acquires. This number increases under a heavy load and then gradually decreases over time, as the acquire heap is cleared. - // The number of entries in the acquire heap, which stores active acquires. This number increases under a heavy load and then gradually decreases over time, as the acquire heap is cleared. - ULONGLONG AcquireHeapSize; - #define MSiSCSI_MMIPSECStats_AcquireHeapSize_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_AcquireHeapSize_ID 6 - - -// The number of entries in the IKE receive buffers for incoming IKE messages. - // The number of entries in the IKE receive buffers for incoming IKE messages. - ULONGLONG ReceiveHeapSize; - #define MSiSCSI_MMIPSECStats_ReceiveHeapSize_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_ReceiveHeapSize_ID 7 - - -// The total number of negotiation failures that occurred during main mode (also known as Phase I) or quick mode (also known as Phase II) negotiation. - // The total number of negotiation failures that occurred during main mode (also known as Phase I) or quick mode (also known as Phase II) negotiation. - ULONGLONG NegotiationFailures; - #define MSiSCSI_MMIPSECStats_NegotiationFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_NegotiationFailures_ID 8 - - -// The total number of identity authentication failures (Kerberos, certificate, and preshared key) that occurred during main mode negotiation. - // The total number of identity authentication failures (Kerberos, certificate, and preshared key) that occurred during main mode negotiation. - ULONGLONG AuthenticationFailures; - #define MSiSCSI_MMIPSECStats_AuthenticationFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_AuthenticationFailures_ID 9 - - -// A cookie is a value contained in a received IKE message that is used by IKE to find the state of an active main mode. A cookie in a received IKE message that cannot be matched with an active main mode is invalid. - // A cookie is a value contained in a received IKE message that is used by IKE to find the state of an active main mode. A cookie in a received IKE message that cannot be matched with an active main mode is invalid. - ULONGLONG InvalidCookiesReceived; - #define MSiSCSI_MMIPSECStats_InvalidCookiesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_InvalidCookiesReceived_ID 10 - - -// The total number of requests submitted by IKE to obtain a unique Security Parameters Index (SPI). - // The total number of requests submitted by IKE to obtain a unique Security Parameters Index (SPI). - ULONGLONG TotalGetSPI; - #define MSiSCSI_MMIPSECStats_TotalGetSPI_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_TotalGetSPI_ID 11 - - -// The number of outbound quick mode security associations (SAs) added by IKE - // The number of outbound quick mode security associations (SAs) added by IKE - ULONGLONG KeyAdditions; - #define MSiSCSI_MMIPSECStats_KeyAdditions_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_KeyAdditions_ID 12 - - -// The number of inbound quick mode security associations (SAs) added by IKE - // The number of inbound quick mode security associations (SAs) added by IKE - ULONGLONG KeyUpdates; - #define MSiSCSI_MMIPSECStats_KeyUpdates_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_KeyUpdates_ID 13 - - -// The total number of requests submitted by IKE to obtain a unique Security Parameters Index (SPI) that failed. - // The total number of requests submitted by IKE to obtain a unique Security Parameters Index (SPI) that failed. - ULONGLONG GetSPIFailures; - #define MSiSCSI_MMIPSECStats_GetSPIFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_GetSPIFailures_ID 14 - - -// The number of outbound quick mode security associations (SAs) submitted by IKE that failed - // The number of outbound quick mode security associations (SAs) submitted by IKE that failed - ULONGLONG KeyAdditionFailures; - #define MSiSCSI_MMIPSECStats_KeyAdditionFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_KeyAdditionFailures_ID 15 - - -// The number of inbound quick mode security associations (SAs) added by IKE - // The number of inbound quick mode security associations (SAs) added by IKE - ULONGLONG KeyUpdateFailures; - #define MSiSCSI_MMIPSECStats_KeyUpdateFailures_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_KeyUpdateFailures_ID 16 - - -// The number of quick mode state entries. - // The number of quick mode state entries. - ULONGLONG ConnectionListSize; - #define MSiSCSI_MMIPSECStats_ConnectionListSize_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_ConnectionListSize_ID 17 - - -// The total number of successful SAs created during main mode negotiations. - // The total number of successful SAs created during main mode negotiations. - ULONGLONG OakleyMainMode; - #define MSiSCSI_MMIPSECStats_OakleyMainMode_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_OakleyMainMode_ID 18 - - -// The total number of successful SAs created during quick mode negotiations - // The total number of successful SAs created during quick mode negotiations - ULONGLONG OakleyQuickMode; - #define MSiSCSI_MMIPSECStats_OakleyQuickMode_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_OakleyQuickMode_ID 19 - - -// The number of received IKE messages that are invalid, including IKE messages with invalid header fields, incorrect payload lengths, and incorrect values for the responder cookie (when it should be set to 0). - // The number of received IKE messages that are invalid, including IKE messages with invalid header fields, incorrect payload lengths, and incorrect values for the responder cookie (when it should be set to 0). - ULONGLONG InvalidPackets; - #define MSiSCSI_MMIPSECStats_InvalidPackets_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_InvalidPackets_ID 20 - - -// The total number of negotiations that resulted in the use of plaintext (also known as soft SAs). This typically reflects the number of associations formed with computers that did not respond to main mode negotiation attempts. This can include both non-IPSEC-aware computers and IPSEC-aware computers that do not have IPSEC policy to negotiate security with this IPSEC peer. - // The total number of negotiations that resulted in the use of plaintext (also known as soft SAs). This typically reflects the number of associations formed with computers that did not respond to main mode negotiation attempts. This can include both non-IPSEC-aware computers and IPSEC-aware computers that do not have IPSEC policy to negotiate security with this IPSEC peer. - ULONGLONG SoftAssociations; - #define MSiSCSI_MMIPSECStats_SoftAssociations_SIZE sizeof(ULONGLONG) - #define MSiSCSI_MMIPSECStats_SoftAssociations_ID 21 - -} MSiSCSI_MMIPSECStats, *PMSiSCSI_MMIPSECStats; - -#define MSiSCSI_MMIPSECStats_SIZE (FIELD_OFFSET(MSiSCSI_MMIPSECStats, SoftAssociations) + MSiSCSI_MMIPSECStats_SoftAssociations_SIZE) - -// MSiSCSI_QMIPSECStats - MSiSCSI_QMIPSECStats -// iSCSI HBA quick mode IPSEC Statistics - -// -// This class exposes the quick mode IPSEC statistics -// -// This class must be registered with PDO instance names using a single instance -// - -#define MSiSCSI_QMIPSECStatsGuid \ - { 0xb4d1c606,0x8682,0x4b7a, { 0xac,0x6b,0xd8,0x83,0xd9,0x15,0x55,0xfb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_QMIPSECStats_GUID, \ - 0xb4d1c606,0x8682,0x4b7a,0xac,0x6b,0xd8,0x83,0xd9,0x15,0x55,0xfb); -#endif - - -typedef struct _MSiSCSI_QMIPSECStats -{ - -// The number of active IPSEC SAs - // The number of active IPSEC SAs - ULONGLONG ActiveSA; - #define MSiSCSI_QMIPSECStats_ActiveSA_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_ActiveSA_ID 1 - - -// The number of IPSEC key operations in progress - // The number of IPSEC key operations in progress - ULONGLONG PendingKeyOperations; - #define MSiSCSI_QMIPSECStats_PendingKeyOperations_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_PendingKeyOperations_ID 2 - - -// The total number of successful IPSEC SA negotiations - // The total number of successful IPSEC SA negotiations - ULONGLONG KeyAdditions; - #define MSiSCSI_QMIPSECStats_KeyAdditions_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_KeyAdditions_ID 3 - - -// The total number of key deletions for IPSEC SA - // The total number of key deletions for IPSEC SA - ULONGLONG KeyDeletions; - #define MSiSCSI_QMIPSECStats_KeyDeletions_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_KeyDeletions_ID 4 - - -// The number of rekey operations for IPSEC SAs. - // The number of rekey operations for IPSEC SAs. - ULONGLONG ReKeys; - #define MSiSCSI_QMIPSECStats_ReKeys_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_ReKeys_ID 5 - - -// The number of active IPSEC tunnels. - // The number of active IPSEC tunnels. - ULONGLONG ActiveTunnels; - #define MSiSCSI_QMIPSECStats_ActiveTunnels_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_ActiveTunnels_ID 6 - - -// The total number of packets for which the Security Parameters Index (SPI) was incorrect. - // The total number of packets for which the Security Parameters Index (SPI) was incorrect. - ULONGLONG BadSPIPackets; - #define MSiSCSI_QMIPSECStats_BadSPIPackets_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_BadSPIPackets_ID 7 - - -// The total number of packets that failed decryption. - // The total number of packets that failed decryption. - ULONGLONG PacketsNotDecrypted; - #define MSiSCSI_QMIPSECStats_PacketsNotDecrypted_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_PacketsNotDecrypted_ID 8 - - -// The total number of packets for which data could not be verified. - // The total number of packets for which data could not be verified. - ULONGLONG PacketsNotAuthenticated; - #define MSiSCSI_QMIPSECStats_PacketsNotAuthenticated_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_PacketsNotAuthenticated_ID 9 - - -// The total number of packets that contained a valid Sequence Number field. - // The total number of packets that contained a valid Sequence Number field. - ULONGLONG PacketsWithReplayDetection; - #define MSiSCSI_QMIPSECStats_PacketsWithReplayDetection_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_PacketsWithReplayDetection_ID 10 - - -// The number of bytes sent using the ESP protocol. - // The number of bytes sent using the ESP protocol. - ULONGLONG ConfidentialBytesSent; - #define MSiSCSI_QMIPSECStats_ConfidentialBytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_ConfidentialBytesSent_ID 11 - - -// The number of bytes received using the ESP protocol. - // The number of bytes received using the ESP protocol. - ULONGLONG ConfidentialBytesReceived; - #define MSiSCSI_QMIPSECStats_ConfidentialBytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_ConfidentialBytesReceived_ID 12 - - -// The number of bytes sent using the AH protocol. - // The number of bytes sent using the AH protocol. - ULONGLONG AuthenticatedBytesSent; - #define MSiSCSI_QMIPSECStats_AuthenticatedBytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_AuthenticatedBytesSent_ID 13 - - -// The number of bytes received using the AH protocol. - // The number of bytes received using the AH protocol. - ULONGLONG AuthenticatedBytesReceived; - #define MSiSCSI_QMIPSECStats_AuthenticatedBytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_AuthenticatedBytesReceived_ID 14 - - -// The number of bytes sent using the IPSEC protocol. - // The number of bytes sent using the IPSEC protocol. - ULONGLONG TransportBytesSent; - #define MSiSCSI_QMIPSECStats_TransportBytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_TransportBytesSent_ID 15 - - -// The number of bytes received using the IPSEC protocol. - // The number of bytes received using the IPSEC protocol. - ULONGLONG TransportBytesReceived; - #define MSiSCSI_QMIPSECStats_TransportBytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_TransportBytesReceived_ID 16 - - -// The number of bytes sent using the IPSEC tunnel mode. - // The number of bytes sent using the IPSEC tunnel mode. - ULONGLONG TunnelBytesSent; - #define MSiSCSI_QMIPSECStats_TunnelBytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_TunnelBytesSent_ID 17 - - -// The number of bytes received using the IPSEC tunnel mode. - // The number of bytes received using the IPSEC tunnel mode. - ULONGLONG TunnelBytesReceived; - #define MSiSCSI_QMIPSECStats_TunnelBytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_QMIPSECStats_TunnelBytesReceived_ID 18 - -} MSiSCSI_QMIPSECStats, *PMSiSCSI_QMIPSECStats; - -#define MSiSCSI_QMIPSECStats_SIZE (FIELD_OFFSET(MSiSCSI_QMIPSECStats, TunnelBytesReceived) + MSiSCSI_QMIPSECStats_TunnelBytesReceived_SIZE) - -// MSiSCSI_ConnectionStatistics - MSiSCSI_ConnectionStatistics -// iSCSI Connection Statistics - -// -// This class exposes connection statistics statistics -// -// This class must be registered with dynamic instance names using -// a specific format: -// -// targetname_#:# where the first # is the SID, and the second -// # is the CID. -// - -#define MSiSCSI_ConnectionStatisticsGuid \ - { 0x4ae27cd9,0x8dfa,0x4c37, { 0xa4,0x2c,0xb8,0x8a,0x93,0xe3,0xe5,0x21 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_ConnectionStatistics_GUID, \ - 0x4ae27cd9,0x8dfa,0x4c37,0xa4,0x2c,0xb8,0x8a,0x93,0xe3,0xe5,0x21); -#endif - - -typedef struct _MSiSCSI_ConnectionStatistics -{ - // Name of the iSCSI Target - WCHAR iSCSIName[223 + 1]; - #define MSiSCSI_ConnectionStatistics_iSCSIName_ID 1 - - // The iSCSI connection ID for this connection instance. - USHORT CID; - #define MSiSCSI_ConnectionStatistics_CID_SIZE sizeof(USHORT) - #define MSiSCSI_ConnectionStatistics_CID_ID 2 - - // A uniquely generated session ID used only internally. This is the value returned by the LoginToTarget method. - ULONGLONG USID; - #define MSiSCSI_ConnectionStatistics_USID_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_USID_ID 3 - - // Id that is globally unique to each instance of each adapter. This is the value reported by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_ConnectionStatistics_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_UniqueAdapterId_ID 4 - - // Count of # of bytes sent over this connection - ULONGLONG BytesSent; - #define MSiSCSI_ConnectionStatistics_BytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_BytesSent_ID 5 - - // Count of # of bytes received over this connection - ULONGLONG BytesReceived; - #define MSiSCSI_ConnectionStatistics_BytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_BytesReceived_ID 6 - - // Count of # of PDU sent over this connection - ULONGLONG PDUCommandsSent; - #define MSiSCSI_ConnectionStatistics_PDUCommandsSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_PDUCommandsSent_ID 7 - - // Count of # of PDU received over this connection - ULONGLONG PDUResponsesReceived; - #define MSiSCSI_ConnectionStatistics_PDUResponsesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_ConnectionStatistics_PDUResponsesReceived_ID 8 - -} MSiSCSI_ConnectionStatistics, *PMSiSCSI_ConnectionStatistics; - -#define MSiSCSI_ConnectionStatistics_SIZE (FIELD_OFFSET(MSiSCSI_ConnectionStatistics, PDUResponsesReceived) + MSiSCSI_ConnectionStatistics_PDUResponsesReceived_SIZE) - -// MSiSCSI_SessionStatistics - MSiSCSI_SessionStatistics -// iSCSI Session Statistics - -// -// This class exposes session statistics -// -// This class must be registered with dynamic instance names using -// a specific format: -// -// targetname_# where the # is the SID -// - -#define MSiSCSI_SessionStatisticsGuid \ - { 0xc827993c,0x6d1f,0x4194, { 0x9b,0x5c,0xd7,0xc0,0xa5,0xf1,0xcf,0xb7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_SessionStatistics_GUID, \ - 0xc827993c,0x6d1f,0x4194,0x9b,0x5c,0xd7,0xc0,0xa5,0xf1,0xcf,0xb7); -#endif - - -typedef struct _MSiSCSI_SessionStatistics -{ - // Name of the iSCSI Target - WCHAR iSCSIName[223 + 1]; - #define MSiSCSI_SessionStatistics_iSCSIName_ID 1 - - // A uniquely generated session ID used only internally. This is the value returned by the LoginToTarget method. - ULONGLONG USID; - #define MSiSCSI_SessionStatistics_USID_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_USID_ID 2 - - // Id that is globally unique to each instance of each adapter. This is the value reported by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_SessionStatistics_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_UniqueAdapterId_ID 3 - - // Number of bytes sent over this session - ULONGLONG BytesSent; - #define MSiSCSI_SessionStatistics_BytesSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_BytesSent_ID 4 - - // Number of bytes received over this session - ULONGLONG BytesReceived; - #define MSiSCSI_SessionStatistics_BytesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_BytesReceived_ID 5 - - // Number of PDU sent over this session - ULONGLONG PDUCommandsSent; - #define MSiSCSI_SessionStatistics_PDUCommandsSent_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_PDUCommandsSent_ID 6 - - // Number of PDU received over this session - ULONGLONG PDUResponsesReceived; - #define MSiSCSI_SessionStatistics_PDUResponsesReceived_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_PDUResponsesReceived_ID 7 - - // Count of Number of Digest errors occured in this session - ULONGLONG DigestErrors; - #define MSiSCSI_SessionStatistics_DigestErrors_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_DigestErrors_ID 8 - - // Count of Number of ConnectionTimeout errors occured in this session - ULONGLONG ConnectionTimeoutErrors; - #define MSiSCSI_SessionStatistics_ConnectionTimeoutErrors_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_ConnectionTimeoutErrors_ID 9 - - // Count of Number of Format errors occured in this session - ULONGLONG FormatErrors; - #define MSiSCSI_SessionStatistics_FormatErrors_SIZE sizeof(ULONGLONG) - #define MSiSCSI_SessionStatistics_FormatErrors_ID 10 - -} MSiSCSI_SessionStatistics, *PMSiSCSI_SessionStatistics; - -#define MSiSCSI_SessionStatistics_SIZE (FIELD_OFFSET(MSiSCSI_SessionStatistics, FormatErrors) + MSiSCSI_SessionStatistics_FormatErrors_SIZE) - -// MSiSCSI_InitiatorLoginStatistics - MSiSCSI_InitiatorLoginStatistics -// iSCSI Initiator Login Statistics - -// -// This class exposes login statistics -// -// This class must be registered with PDO instance names -// - -#define MSiSCSI_InitiatorLoginStatisticsGuid \ - { 0xf022f413,0x3bf5,0x47ec, { 0xa9,0x42,0x33,0xb8,0x1c,0xf8,0xe7,0xff } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_InitiatorLoginStatistics_GUID, \ - 0xf022f413,0x3bf5,0x47ec,0xa9,0x42,0x33,0xb8,0x1c,0xf8,0xe7,0xff); -#endif - - -typedef struct _MSiSCSI_InitiatorLoginStatistics -{ - // Id that is globally unique to each instance of each adapter. This is the value reported by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_InitiatorLoginStatistics_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_InitiatorLoginStatistics_UniqueAdapterId_ID 1 - - // Count of Login Accept Responses - ULONG LoginAcceptRsps; - #define MSiSCSI_InitiatorLoginStatistics_LoginAcceptRsps_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginAcceptRsps_ID 2 - - // Count of Login other failed Responses - ULONG LoginOtherFailRsps; - #define MSiSCSI_InitiatorLoginStatistics_LoginOtherFailRsps_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginOtherFailRsps_ID 3 - - // Count of Login Redirect Responses - ULONG LoginRedirectRsps; - #define MSiSCSI_InitiatorLoginStatistics_LoginRedirectRsps_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginRedirectRsps_ID 4 - - // Count of Login Authentication Failed Responses - ULONG LoginAuthFailRsps; - #define MSiSCSI_InitiatorLoginStatistics_LoginAuthFailRsps_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginAuthFailRsps_ID 5 - - // Count of the number of times a login is aborted due to a target authentication failure - ULONG LoginAuthenticateFails; - #define MSiSCSI_InitiatorLoginStatistics_LoginAuthenticateFails_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginAuthenticateFails_ID 6 - - // Count of the number of times login failed due to negotiation failure with target - ULONG LoginNegotiateFails; - #define MSiSCSI_InitiatorLoginStatistics_LoginNegotiateFails_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginNegotiateFails_ID 7 - - // Count of Logout command PDU with reason code 0 - ULONG LogoutNormals; - #define MSiSCSI_InitiatorLoginStatistics_LogoutNormals_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LogoutNormals_ID 8 - - // Count of Logout command PDUs with status code other than 0 - ULONG LogoutOtherCodes; - #define MSiSCSI_InitiatorLoginStatistics_LogoutOtherCodes_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LogoutOtherCodes_ID 9 - - // The object counts the number of times a login attempt from this local initiator has failed - ULONG LoginFailures; - #define MSiSCSI_InitiatorLoginStatistics_LoginFailures_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorLoginStatistics_LoginFailures_ID 10 - -} MSiSCSI_InitiatorLoginStatistics, *PMSiSCSI_InitiatorLoginStatistics; - -#define MSiSCSI_InitiatorLoginStatistics_SIZE (FIELD_OFFSET(MSiSCSI_InitiatorLoginStatistics, LoginFailures) + MSiSCSI_InitiatorLoginStatistics_LoginFailures_SIZE) - -// MSiSCSI_InitiatorInstanceStatistics - MSiSCSI_InitiatorInstanceStatistics -// iSCSI Initiator Instance Statistics - -// -// This class exposes initiator statistics -// -// This class must be registered with PDO instance names -// - -#define MSiSCSI_InitiatorInstanceStatisticsGuid \ - { 0xfa30c290,0x68db,0x430a, { 0xaf,0x76,0x91,0xa2,0xe1,0xc4,0x91,0x54 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_InitiatorInstanceStatistics_GUID, \ - 0xfa30c290,0x68db,0x430a,0xaf,0x76,0x91,0xa2,0xe1,0xc4,0x91,0x54); -#endif - - -typedef struct _MSiSCSI_InitiatorInstanceStatistics -{ - // Id that is globally unique to each instance of each adapter. This is the value reported by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_InitiatorInstanceStatistics_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_InitiatorInstanceStatistics_UniqueAdapterId_ID 1 - - // Count of Session digest errors - ULONG SessionDigestErrorCount; - #define MSiSCSI_InitiatorInstanceStatistics_SessionDigestErrorCount_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorInstanceStatistics_SessionDigestErrorCount_ID 2 - - // Count of Session connection timeout error - ULONG SessionConnectionTimeoutErrorCount; - #define MSiSCSI_InitiatorInstanceStatistics_SessionConnectionTimeoutErrorCount_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorInstanceStatistics_SessionConnectionTimeoutErrorCount_ID 3 - - // Count of Session format error - ULONG SessionFormatErrorCount; - #define MSiSCSI_InitiatorInstanceStatistics_SessionFormatErrorCount_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorInstanceStatistics_SessionFormatErrorCount_ID 4 - - // Number of Sessions failed belonging to this instance - ULONG SessionFailureCount; - #define MSiSCSI_InitiatorInstanceStatistics_SessionFailureCount_SIZE sizeof(ULONG) - #define MSiSCSI_InitiatorInstanceStatistics_SessionFailureCount_ID 5 - -} MSiSCSI_InitiatorInstanceStatistics, *PMSiSCSI_InitiatorInstanceStatistics; - -#define MSiSCSI_InitiatorInstanceStatistics_SIZE (FIELD_OFFSET(MSiSCSI_InitiatorInstanceStatistics, SessionFailureCount) + MSiSCSI_InitiatorInstanceStatistics_SessionFailureCount_SIZE) - -// MSiSCSI_NICPerformance - MSiSCSI_NICPerformance - -// -// NIC performance information class, implement one instance for each port on -// your adapter. -// -// This class must be registered with PDO instance names with one instance -// names for each port -// - -#define MSiSCSI_NICPerformanceGuid \ - { 0x5c59fd61,0xe919,0x4687, { 0x84,0xe2,0x72,0x00,0xab,0xe2,0x20,0x9b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_NICPerformance_GUID, \ - 0x5c59fd61,0xe919,0x4687,0x84,0xe2,0x72,0x00,0xab,0xe2,0x20,0x9b); -#endif - - -typedef struct _MSiSCSI_NICPerformance -{ - // Number of bytes transmitted via ethernet port - ULONG BytesTransmitted; - #define MSiSCSI_NICPerformance_BytesTransmitted_SIZE sizeof(ULONG) - #define MSiSCSI_NICPerformance_BytesTransmitted_ID 1 - - // Number of bytes received via ethernet port - ULONG BytesReceived; - #define MSiSCSI_NICPerformance_BytesReceived_SIZE sizeof(ULONG) - #define MSiSCSI_NICPerformance_BytesReceived_ID 2 - - // Number of PDU transmitted via ethernet port - ULONG PDUTransmitted; - #define MSiSCSI_NICPerformance_PDUTransmitted_SIZE sizeof(ULONG) - #define MSiSCSI_NICPerformance_PDUTransmitted_ID 3 - - // Number of PDU received via ethernet port - ULONG PDUReceived; - #define MSiSCSI_NICPerformance_PDUReceived_SIZE sizeof(ULONG) - #define MSiSCSI_NICPerformance_PDUReceived_ID 4 - -} MSiSCSI_NICPerformance, *PMSiSCSI_NICPerformance; - -#define MSiSCSI_NICPerformance_SIZE (FIELD_OFFSET(MSiSCSI_NICPerformance, PDUReceived) + MSiSCSI_NICPerformance_PDUReceived_SIZE) - -// MSiSCSI_RequestTimeStatistics - MSiSCSI_RequestTimeStatistics -// iSCSI Request Processing Time - -// -// This class exposes request processing time statistics -// -// This class must be registered with dynamic instance names using -// a specific format: -// -// targetname_#:# where the first # is the SID, and the second -// # is the CID. -// - -#define MSiSCSI_RequestTimeStatisticsGuid \ - { 0xe0b40aa8,0x544b,0x4d5e, { 0xba,0x60,0xa0,0x3f,0x13,0x6d,0xa8,0x3d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSiSCSI_RequestTimeStatistics_GUID, \ - 0xe0b40aa8,0x544b,0x4d5e,0xba,0x60,0xa0,0x3f,0x13,0x6d,0xa8,0x3d); -#endif - - -typedef struct _MSiSCSI_RequestTimeStatistics -{ - // Name of the iSCSI Target - WCHAR iSCSIName[223 + 1]; - #define MSiSCSI_RequestTimeStatistics_iSCSIName_ID 1 - - // The iSCSI connection ID for this connection instance. - USHORT CID; - #define MSiSCSI_RequestTimeStatistics_CID_SIZE sizeof(USHORT) - #define MSiSCSI_RequestTimeStatistics_CID_ID 2 - - // A uniquely generated session ID used only internally. This is the value returned by the LoginToTarget method. - ULONGLONG USID; - #define MSiSCSI_RequestTimeStatistics_USID_SIZE sizeof(ULONGLONG) - #define MSiSCSI_RequestTimeStatistics_USID_ID 3 - - // Id that is globally unique to each instance of each adapter. This is the value reported by the MSiSCSI_HBAInformation class. - ULONGLONG UniqueAdapterId; - #define MSiSCSI_RequestTimeStatistics_UniqueAdapterId_SIZE sizeof(ULONGLONG) - #define MSiSCSI_RequestTimeStatistics_UniqueAdapterId_ID 4 - - // Maximum time taken to process a request over this connection - ULONG MaximumProcessingTime; - #define MSiSCSI_RequestTimeStatistics_MaximumProcessingTime_SIZE sizeof(ULONG) - #define MSiSCSI_RequestTimeStatistics_MaximumProcessingTime_ID 5 - - // Average time taken to process a request over this connection - ULONG AverageProcessingTime; - #define MSiSCSI_RequestTimeStatistics_AverageProcessingTime_SIZE sizeof(ULONG) - #define MSiSCSI_RequestTimeStatistics_AverageProcessingTime_ID 6 - -} MSiSCSI_RequestTimeStatistics, *PMSiSCSI_RequestTimeStatistics; - -#define MSiSCSI_RequestTimeStatistics_SIZE (FIELD_OFFSET(MSiSCSI_RequestTimeStatistics, AverageProcessingTime) + MSiSCSI_RequestTimeStatistics_AverageProcessingTime_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/isvbop.h b/qt-correction-tool/pub/ddk/isvbop.h deleted file mode 100644 index c947665..0000000 --- a/qt-correction-tool/pub/ddk/isvbop.h +++ /dev/null @@ -1,139 +0,0 @@ -/*++ BUILD Version: 0001 - -Copyright (c) 1990-1999 Microsoft Corporation - -Module Name: - - ISVBOP.H - -Abstract: - - This is the header file supporting third party bops. - isvbop.inc is the inc file for this h file. - -Note: - Following include file uses 'DB' to define assembly macros. Some - assemblers use 'emit' instead. If you are using such a compiler, - you will have to change db's to emit's. - ---*/ - - -#if _MSC_VER > 1000 -#pragma once -#endif - -#define BOP_3RDPARTY 0x58 -#define BOP_UNSIMULATE 0xFE - -/* XLATOFF */ - -/** RegisterModule - This Bop call is made from the 16 bit module - * to register a third party DLL with the bop - * manager. This call returns a handle to the - * 16bit caller which is to be used later to - * dispatch a call to the DLL. - * - * INPUT: - * Client DS:SI - asciiz string of DLL name. - * Client ES:DI - asciiz string of Init Routine in the DLL. (Optional) - * Client DS:BX - asciiz string to Dispatch routine in the DLL. - * - * OUTPUT: - * SUCCESS: - * Client Carry Clear - * Client AX = Handle (non Zero) - * FAILURE: - * Client Carry Set - * Client AX = Error Code - * AX = 1 - DLL not found - * AX = 2 - Dispacth routine not found. - * AX = 3 - Init Routine Not Found - * AX = 4 - Insufficient Memory - * - * NOTES: - * RegisterModule results in loading the DLL (specified in DS:SI). - * Its Init routine (specified in ES:DI) is called. Its Dispatch - * routine (specified in DS:BX) is stored away and all the calls - * made from DispatchCall are dispacthed to this routine. - * If ES and DI both are null than the caller did'nt supply the init - * routine. - */ - -#define RegisterModule() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 0x0 - -/** UnRegisterModule - This Bop call is made from the 16 bit module - * to unregister a third party DLL with the bop - * manager. - * - * INPUT: - * Client AX - Handle returned by RegisterModule Call. - * - * OUTPUT: - * None (VDM Is terminated with a debug message if Handle is invalid) - * - * NOTES: - * Use it if initialization of 16bit app fails after registering the - * Bop. - */ - -#define UnRegisterModule() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 0x1 - -/** DispacthCall - This Bop call is made from the 16 bit module - * to pass a request to its DLL. - * - * INPUT: - * Client AX - Handle returned by RegisterModule Call. - * - * OUTPUT: - * None (DLL should set the proper output registers etc.) - * (VDM Is terminated with a debug message if Handle is invalid) - * - * NOTES: - * Use it to pass a request to 32bit DLL. The request index and the - * parameters are passed in different registers. These register settings - * are private to the 16bit module and its associated VDD. Bop manager - * does'nt know anything about these registers. - */ -#define DispatchCall() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_3RDPARTY _asm _emit 0x2 - -/*** VDDUnSimulate16 - * - * This service causes the simulation of intel instructions to stop and - * control to return to VDD. - * - * INPUT - * None - * - * OUTPUT - * None - * - * NOTES - * This service is a macro intended for 16bit stub-drivers. At the - * end of worker routine stub-driver should use it. - */ - -#define VDDUnSimulate16() _asm _emit 0xC4 _asm _emit 0xC4 _asm _emit BOP_UNSIMULATE - -/* XLATON */ - - -/* ASM -RegisterModule macro - db 0C4h, 0C4h, BOP_3RDPARTY, 0 - endm - -UnRegisterModule macro - db 0C4h, 0C4h, BOP_3RDPARTY, 1 - endm - -DispatchCall macro - db 0C4h, 0C4h, BOP_3RDPARTY, 2 - endm - -VDDUnSimulate16 macro - db 0C4h, 0C4h, BOP_UNSIMULATE - endm - - */ - diff --git a/qt-correction-tool/pub/ddk/isvbop.inc b/qt-correction-tool/pub/ddk/isvbop.inc deleted file mode 100644 index bb197e0..0000000 --- a/qt-correction-tool/pub/ddk/isvbop.inc +++ /dev/null @@ -1,22 +0,0 @@ -; This is the inc file for isvbop.h. -; Please refer to isvbop.h for comments and notes on these interfaces -; -BOP_3RDPARTY EQU 58H -BOP_UNSIMULATE EQU 0FEH - -RegisterModule macro - db 0C4h, 0C4h, BOP_3RDPARTY, 0 - endm - -UnRegisterModule macro - db 0C4h, 0C4h, BOP_3RDPARTY, 1 - endm - -DispatchCall macro - db 0C4h, 0C4h, BOP_3RDPARTY, 2 - endm - -VDDUnSimulate16 macro - db 0C4h, 0C4h, BOP_UNSIMULATE - endm - diff --git a/qt-correction-tool/pub/ddk/kbdmou.h b/qt-correction-tool/pub/ddk/kbdmou.h deleted file mode 100644 index 9b6af4f..0000000 --- a/qt-correction-tool/pub/ddk/kbdmou.h +++ /dev/null @@ -1,134 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - kbdmou.h - -Abstract: - - These are the structures and defines that are used in the - keyboard class driver, mouse class driver, and keyboard/mouse port - driver. - -Author: - - lees - -Revision History: - ---*/ - -#ifndef _KBDMOU_ -#define _KBDMOU_ - -#include -#include - -// -// Define the keyboard/mouse port device name strings. -// - -#define DD_KEYBOARD_PORT_DEVICE_NAME "\\Device\\KeyboardPort" -#define DD_KEYBOARD_PORT_DEVICE_NAME_U L"\\Device\\KeyboardPort" -#define DD_KEYBOARD_PORT_BASE_NAME_U L"KeyboardPort" -#define DD_POINTER_PORT_DEVICE_NAME "\\Device\\PointerPort" -#define DD_POINTER_PORT_DEVICE_NAME_U L"\\Device\\PointerPort" -#define DD_POINTER_PORT_BASE_NAME_U L"PointerPort" - -// -// Define the keyboard/mouse class device name strings. -// - -#define DD_KEYBOARD_CLASS_BASE_NAME_U L"KeyboardClass" -#define DD_POINTER_CLASS_BASE_NAME_U L"PointerClass" - -// -// Define the keyboard/mouse resource class names. -// - -#define DD_KEYBOARD_RESOURCE_CLASS_NAME_U L"Keyboard" -#define DD_POINTER_RESOURCE_CLASS_NAME_U L"Pointer" -#define DD_KEYBOARD_MOUSE_COMBO_RESOURCE_CLASS_NAME_U L"Keyboard/Pointer" - -// -// Define the maximum number of pointer/keyboard port names the port driver -// will use in an attempt to IoCreateDevice. -// - -#define POINTER_PORTS_MAXIMUM 8 -#define KEYBOARD_PORTS_MAXIMUM 8 - -// -// Define the port connection data structure. -// - -typedef struct _CONNECT_DATA { - IN PDEVICE_OBJECT ClassDeviceObject; - IN PVOID ClassService; -} CONNECT_DATA, *PCONNECT_DATA; - -// -// Define the service callback routine's structure. -// - -typedef -VOID -(*PSERVICE_CALLBACK_ROUTINE) ( - __in PVOID NormalContext, - __in PVOID SystemArgument1, - __in PVOID SystemArgument2, - __inout PVOID SystemArgument3 - ); - -// -// WMI structures returned by port drivers -// -#include - -// -// NtDeviceIoControlFile internal IoControlCode values for keyboard device. -// - -#define IOCTL_INTERNAL_KEYBOARD_CONNECT CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_KEYBOARD_DISCONNECT CTL_CODE(FILE_DEVICE_KEYBOARD,0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_KEYBOARD_ENABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_KEYBOARD_DISABLE CTL_CODE(FILE_DEVICE_KEYBOARD, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) - -// -// NtDeviceIoControlFile internal IoControlCode values for mouse device. -// - - -#define IOCTL_INTERNAL_MOUSE_CONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0080, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_MOUSE_DISCONNECT CTL_CODE(FILE_DEVICE_MOUSE, 0x0100, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_MOUSE_ENABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0200, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_MOUSE_DISABLE CTL_CODE(FILE_DEVICE_MOUSE, 0x0400, METHOD_NEITHER, FILE_ANY_ACCESS) - -// -// Error log definitions (specific to the keyboard/mouse) for DumpData[0] -// in the IO_ERROR_LOG_PACKET. -// -// DumpData[1] <= hardware port/register -// DumpData[2] <= {command byte || expected response byte} -// DumpData[3] <= {command's parameter byte || actual response byte} -// -// - -#define KBDMOU_COULD_NOT_SEND_COMMAND 0x0000 -#define KBDMOU_COULD_NOT_SEND_PARAM 0x0001 -#define KBDMOU_NO_RESPONSE 0x0002 -#define KBDMOU_INCORRECT_RESPONSE 0x0004 - -// -// Define the base values for the error log packet's UniqueErrorValue field. -// - -#define I8042_ERROR_VALUE_BASE 1000 -#define INPORT_ERROR_VALUE_BASE 2000 -#define SERIAL_MOUSE_ERROR_VALUE_BASE 3000 - -#endif // _KBDMOU_ - - diff --git a/qt-correction-tool/pub/ddk/ksi.h b/qt-correction-tool/pub/ddk/ksi.h deleted file mode 100644 index d7f7daa..0000000 --- a/qt-correction-tool/pub/ddk/ksi.h +++ /dev/null @@ -1,194 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ksi.h - -Abstract: - - Windows Driver Model/Connection and Streaming Architecture (WDM-CSA) - core internal definitions. - ---*/ - -#if !defined(_KSI_) -#define _KSI_ - -#if defined(__cplusplus) -extern "C" { -#endif // defined(__cplusplus) - -#if defined(_NTDDK_) - -typedef struct { - LONGLONG Frequency; - LONGLONG LastDueTime; - LONGLONG RunningTimeDelta; - LONGLONG LastRunningTime; - KSPIN_LOCK TimeAccessLock; - LIST_ENTRY EventQueue; - KSPIN_LOCK EventQueueLock; - KTIMER QueueTimer; - KDPC QueueDpc; - LONG ReferenceCount; - KSSTATE State; - LONGLONG SuspendDelta; - LONGLONG SuspendTime; - PFNKSSETTIMER SetTimer; - PFNKSCANCELTIMER CancelTimer; - PFNKSCLOCK_CORRELATEDTIME CorrelatedTime; - PVOID Context; - KSRESOLUTION Resolution; - KEVENT FreeEvent; - LONG ExternalTimeReferenceCount; - BOOLEAN ExternalTimeValid; - LONGLONG LastStreamTime; -} KSIDEFAULTCLOCK, *PKSIDEFAULTCLOCK; - -typedef struct { - KSOBJECT_HEADER Header; - PKSIDEFAULTCLOCK DefaultClock; - ULONG Reserved; -} KSCLOCKINSTANCE, *PKSCLOCKINSTANCE; - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetTime( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PLONGLONG Time - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetPhysicalTime( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PLONGLONG Time - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetCorrelatedTime( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PKSCORRELATED_TIME Time - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetCorrelatedPhysicalTime( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PKSCORRELATED_TIME Time - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetResolution( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PKSRESOLUTION Resolution - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetState( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PKSSTATE State - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiPropertyDefaultClockGetFunctionTable( - __in PIRP Irp, - __in PKSPROPERTY Property, - __out PKSCLOCK_FUNCTIONTABLE FunctionTable - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -KSDDKAPI -NTSTATUS -NTAPI -KsiDefaultClockAddMarkEvent( - __in PIRP Irp, - __in PKSEVENT_TIME_INTERVAL EventTime, - __in PKSEVENT_ENTRY EventEntry - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -BOOLEAN -NTAPI -KsiQueryObjectCreateItemsPresent( - __in KSDEVICE_HEADER Header - ); - -#endif // !defined(_NTDDK_) - -#define STATIC_KSNAME_Server\ - 0x3C0D501AL, 0x140B, 0x11D1, 0xB4, 0x0F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("3C0D501A-140B-11D1-B40F-00A0C9223196", KSNAME_Server); -#define KSNAME_Server DEFINE_GUIDNAMED(KSNAME_Server) - -#define KSSTRING_Server L"{3C0D501A-140B-11D1-B40F-00A0C9223196}" - -#define STATIC_KSPROPSETID_Service \ - 0x3C0D501BL, 0x140B, 0x11D1, 0xB4, 0x0F, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96 -DEFINE_GUIDSTRUCT("3C0D501B-140B-11D1-B40F-00A0C9223196", KSPROPSETID_Service); -#define KSPROPSETID_Service DEFINE_GUIDNAMED(KSPROPSETID_Service) - -typedef enum { - KSPROPERTY_SERVICE_BUILDCACHE, - KSPROPERTY_SERVICE_MERIT -} KSPROPERTY_SERVICE; - -#define DEFINE_KSPROPERTY_ITEM_SERVICE_BUILDCACHE(SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_SERVICE_BUILDCACHE,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(L"\\\\?\\"),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#define DEFINE_KSPROPERTY_ITEM_SERVICE_MERIT(SetHandler)\ - DEFINE_KSPROPERTY_ITEM(\ - KSPROPERTY_SERVICE_MERIT,\ - NULL,\ - sizeof(KSPROPERTY),\ - sizeof(ULONG) + sizeof(L"\\\\?\\"),\ - (SetHandler),\ - NULL, 0, NULL, NULL, 0) - -#if defined(__cplusplus) -} -#endif // defined(__cplusplus) - -#endif // !_KSI_ - diff --git a/qt-correction-tool/pub/ddk/lmstats.h b/qt-correction-tool/pub/ddk/lmstats.h deleted file mode 100644 index d4ea345..0000000 --- a/qt-correction-tool/pub/ddk/lmstats.h +++ /dev/null @@ -1,191 +0,0 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects - -Copyright (c) 1991-1999 Microsoft Corporation - -Module Name: - - lmstats.h - -Abstract: - - This module defines the API function prototypes and data structures - for the following groups of NT API functions: - NetStatistics - -Environment: - - User Mode - Win32 - -Notes: - - You must include NETCONS.H before this file, since this file depends - on values defined in NETCONS.H. - ---*/ - -#ifndef _LMSTATS_ -#define _LMSTATS_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -// -// Function Prototypes - Statistics -// - -NET_API_STATUS NET_API_FUNCTION -NetStatisticsGet ( - __in LPTSTR ServerName, - __in LPTSTR Service, - __in DWORD Level, - __in DWORD Options, - __deref_out LPBYTE *Buffer - ); - -// -// Data Structures - Statistics -// - -#ifdef LM20_WORKSTATION_STATISTICS -typedef struct _STAT_WORKSTATION_0 { - DWORD stw0_start; - DWORD stw0_numNCB_r; - DWORD stw0_numNCB_s; - DWORD stw0_numNCB_a; - DWORD stw0_fiNCB_r; - DWORD stw0_fiNCB_s; - DWORD stw0_fiNCB_a; - DWORD stw0_fcNCB_r; - DWORD stw0_fcNCB_s; - DWORD stw0_fcNCB_a; - DWORD stw0_sesstart; - DWORD stw0_sessfailcon; - DWORD stw0_sessbroke; - DWORD stw0_uses; - DWORD stw0_usefail; - DWORD stw0_autorec; - DWORD stw0_bytessent_r_lo; - DWORD stw0_bytessent_r_hi; - DWORD stw0_bytesrcvd_r_lo; - DWORD stw0_bytesrcvd_r_hi; - DWORD stw0_bytessent_s_lo; - DWORD stw0_bytessent_s_hi; - DWORD stw0_bytesrcvd_s_lo; - DWORD stw0_bytesrcvd_s_hi; - DWORD stw0_bytessent_a_lo; - DWORD stw0_bytessent_a_hi; - DWORD stw0_bytesrcvd_a_lo; - DWORD stw0_bytesrcvd_a_hi; - DWORD stw0_reqbufneed; - DWORD stw0_bigbufneed; -} STAT_WORKSTATION_0, *PSTAT_WORKSTATION_0, *LPSTAT_WORKSTATION_0; -#else - -// -// NB: The following structure is REDIR_STATISTICS in sdk\inc\ntddnfs.h. If you -// change the structure, change it in both places -// - -typedef struct _STAT_WORKSTATION_0 { - LARGE_INTEGER StatisticsStartTime; - - LARGE_INTEGER BytesReceived; - LARGE_INTEGER SmbsReceived; - LARGE_INTEGER PagingReadBytesRequested; - LARGE_INTEGER NonPagingReadBytesRequested; - LARGE_INTEGER CacheReadBytesRequested; - LARGE_INTEGER NetworkReadBytesRequested; - - LARGE_INTEGER BytesTransmitted; - LARGE_INTEGER SmbsTransmitted; - LARGE_INTEGER PagingWriteBytesRequested; - LARGE_INTEGER NonPagingWriteBytesRequested; - LARGE_INTEGER CacheWriteBytesRequested; - LARGE_INTEGER NetworkWriteBytesRequested; - - DWORD InitiallyFailedOperations; - DWORD FailedCompletionOperations; - - DWORD ReadOperations; - DWORD RandomReadOperations; - DWORD ReadSmbs; - DWORD LargeReadSmbs; - DWORD SmallReadSmbs; - - DWORD WriteOperations; - DWORD RandomWriteOperations; - DWORD WriteSmbs; - DWORD LargeWriteSmbs; - DWORD SmallWriteSmbs; - - DWORD RawReadsDenied; - DWORD RawWritesDenied; - - DWORD NetworkErrors; - - // Connection/Session counts - DWORD Sessions; - DWORD FailedSessions; - DWORD Reconnects; - DWORD CoreConnects; - DWORD Lanman20Connects; - DWORD Lanman21Connects; - DWORD LanmanNtConnects; - DWORD ServerDisconnects; - DWORD HungSessions; - DWORD UseCount; - DWORD FailedUseCount; - - // - // Queue Lengths (updates protected by RdrMpxTableSpinLock NOT - // RdrStatisticsSpinlock) - // - - DWORD CurrentCommands; - -} STAT_WORKSTATION_0, *PSTAT_WORKSTATION_0, *LPSTAT_WORKSTATION_0; -#endif - -typedef struct _STAT_SERVER_0 { - DWORD sts0_start; - DWORD sts0_fopens; - DWORD sts0_devopens; - DWORD sts0_jobsqueued; - DWORD sts0_sopens; - DWORD sts0_stimedout; - DWORD sts0_serrorout; - DWORD sts0_pwerrors; - DWORD sts0_permerrors; - DWORD sts0_syserrors; - DWORD sts0_bytessent_low; - DWORD sts0_bytessent_high; - DWORD sts0_bytesrcvd_low; - DWORD sts0_bytesrcvd_high; - DWORD sts0_avresponse; - DWORD sts0_reqbufneed; - DWORD sts0_bigbufneed; -} STAT_SERVER_0, *PSTAT_SERVER_0, *LPSTAT_SERVER_0; - - -// -// Special Values and Constants -// - -#define STATSOPT_CLR 1 -#define STATS_NO_VALUE ((unsigned long) -1L) -#define STATS_OVERFLOW ((unsigned long) -2L) - - -#ifdef __cplusplus -} -#endif - -#endif // _LMSTATS.H - diff --git a/qt-correction-tool/pub/ddk/lmuseflg.h b/qt-correction-tool/pub/ddk/lmuseflg.h deleted file mode 100644 index ec69546..0000000 --- a/qt-correction-tool/pub/ddk/lmuseflg.h +++ /dev/null @@ -1,43 +0,0 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects - -Copyright (c) 1991-1999 Microsoft Corporation - -Module Name: - - lmuseflg.h - -Abstract: - - This file contains deletion force levels for deleting a connection. - -Environment: - - User Mode - Win32 - -Notes: - - This file has no dependencies. It is included by lmwksta.h and - lmuse.h. - -Revision History: - ---*/ - -#ifndef _LMUSEFLG_ -#define _LMUSEFLG_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -// -// Definition for NetWkstaTransportDel and NetUseDel deletion force levels -// - -#define USE_NOFORCE 0 -#define USE_FORCE 1 -#define USE_LOTS_OF_FORCE 2 - - -#endif // _LMUSEFLG_ - diff --git a/qt-correction-tool/pub/ddk/lmwksta.h b/qt-correction-tool/pub/ddk/lmwksta.h deleted file mode 100644 index 8399690..0000000 --- a/qt-correction-tool/pub/ddk/lmwksta.h +++ /dev/null @@ -1,545 +0,0 @@ -/*++ BUILD Version: 0006 // Increment this if a change has global effects - -Copyright (c) 1991-1999 Microsoft Corporation - -Module Name: - - lmwksta.h - -Abstract: - - This file contains structures, function prototypes, and definitions - for the NetWorkstation and NetWkstaTransport API. - -Environment: - - User Mode - Win32 - Portable to any flat, 32-bit environment. (Uses Win32 typedefs.) - Requires ANSI C extensions: slash-slash comments, long external names. - -Notes: - - You must include NETCONS.H before this file, since this file depends - on values defined in NETCONS.H. - ---*/ - -#ifndef _LMWKSTA_ -#define _LMWKSTA_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include // Deletion force level flags - -// -// Function Prototypes -// - -NET_API_STATUS NET_API_FUNCTION -NetWkstaGetInfo ( - __in_opt IN LMSTR servername OPTIONAL, - IN DWORD level, - __deref_opt_out_xcount("size varies with level") OUT LPBYTE *bufptr - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaSetInfo ( - __in_opt IN LMSTR servername OPTIONAL, - IN DWORD level, - IN LPBYTE buffer, - __out_opt OUT LPDWORD parm_err OPTIONAL - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaUserGetInfo ( - __in_opt IN LMSTR reserved, - IN DWORD level, - __out_opt OUT LPBYTE *bufptr - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaUserSetInfo ( - __in_opt IN LMSTR reserved, - IN DWORD level, - OUT LPBYTE buf, - __out_opt OUT LPDWORD parm_err OPTIONAL - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaUserEnum ( - __in_opt LMSTR servername OPTIONAL, - IN DWORD level, - __out_opt LPBYTE *bufptr, - IN DWORD prefmaxlen, - __out_opt LPDWORD entriesread, - __out LPDWORD totalentries, - __inout_opt LPDWORD resumehandle OPTIONAL - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaTransportAdd ( - __in_opt LMSTR servername OPTIONAL, - IN DWORD level, - __in LPBYTE buf, - __out_opt LPDWORD parm_err - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaTransportDel ( - __in_opt IN LMSTR servername OPTIONAL, - __in_opt IN LMSTR transportname, - IN DWORD ucond - ); - -NET_API_STATUS NET_API_FUNCTION -NetWkstaTransportEnum ( - __in_opt LMSTR servername OPTIONAL, - IN DWORD level, - __out_opt LPBYTE *bufptr, - IN DWORD prefmaxlen, - __out_opt LPDWORD entriesread, - __out LPDWORD totalentries, - __inout_opt LPDWORD resumehandle OPTIONAL - ); - -// -// Data Structures -// - -// -// NetWkstaGetInfo and NetWkstaSetInfo -// - -// -// NetWkstaGetInfo only. System information - guest access -// -typedef struct _WKSTA_INFO_100 { - DWORD wki100_platform_id; - LMSTR wki100_computername; - LMSTR wki100_langroup; - DWORD wki100_ver_major; - DWORD wki100_ver_minor; -}WKSTA_INFO_100, *PWKSTA_INFO_100, *LPWKSTA_INFO_100; - -// -// NetWkstaGetInfo only. System information - user access -// -typedef struct _WKSTA_INFO_101 { - DWORD wki101_platform_id; - LMSTR wki101_computername; - LMSTR wki101_langroup; - DWORD wki101_ver_major; - DWORD wki101_ver_minor; - LMSTR wki101_lanroot; -}WKSTA_INFO_101, *PWKSTA_INFO_101, *LPWKSTA_INFO_101; - -// -// NetWkstaGetInfo only. System information - admin or operator access -// -typedef struct _WKSTA_INFO_102 { - DWORD wki102_platform_id; - LMSTR wki102_computername; - LMSTR wki102_langroup; - DWORD wki102_ver_major; - DWORD wki102_ver_minor; - LMSTR wki102_lanroot; - DWORD wki102_logged_on_users; -}WKSTA_INFO_102, *PWKSTA_INFO_102, *LPWKSTA_INFO_102; - -// -// Down-level NetWkstaGetInfo and NetWkstaSetInfo. -// -// DOS specific workstation information - -// admin or domain operator access -// -typedef struct _WKSTA_INFO_302{ - DWORD wki302_char_wait; - DWORD wki302_collection_time; - DWORD wki302_maximum_collection_count; - DWORD wki302_keep_conn; - DWORD wki302_keep_search; - DWORD wki302_max_cmds; - DWORD wki302_num_work_buf; - DWORD wki302_siz_work_buf; - DWORD wki302_max_wrk_cache; - DWORD wki302_sess_timeout; - DWORD wki302_siz_error; - DWORD wki302_num_alerts; - DWORD wki302_num_services; - DWORD wki302_errlog_sz; - DWORD wki302_print_buf_time; - DWORD wki302_num_char_buf; - DWORD wki302_siz_char_buf; - LMSTR wki302_wrk_heuristics; - DWORD wki302_mailslots; - DWORD wki302_num_dgram_buf; -}WKSTA_INFO_302, *PWKSTA_INFO_302, *LPWKSTA_INFO_302; - -// -// Down-level NetWkstaGetInfo and NetWkstaSetInfo -// -// OS/2 specific workstation information - -// admin or domain operator access -// -typedef struct _WKSTA_INFO_402{ - DWORD wki402_char_wait; - DWORD wki402_collection_time; - DWORD wki402_maximum_collection_count; - DWORD wki402_keep_conn; - DWORD wki402_keep_search; - DWORD wki402_max_cmds; - DWORD wki402_num_work_buf; - DWORD wki402_siz_work_buf; - DWORD wki402_max_wrk_cache; - DWORD wki402_sess_timeout; - DWORD wki402_siz_error; - DWORD wki402_num_alerts; - DWORD wki402_num_services; - DWORD wki402_errlog_sz; - DWORD wki402_print_buf_time; - DWORD wki402_num_char_buf; - DWORD wki402_siz_char_buf; - LMSTR wki402_wrk_heuristics; - DWORD wki402_mailslots; - DWORD wki402_num_dgram_buf; - DWORD wki402_max_threads; -}WKSTA_INFO_402, *PWKSTA_INFO_402, *LPWKSTA_INFO_402; - -// -// Same-level NetWkstaGetInfo and NetWkstaSetInfo. -// -// NT specific workstation information - -// admin or domain operator access -// -typedef struct _WKSTA_INFO_502{ - DWORD wki502_char_wait; - DWORD wki502_collection_time; - DWORD wki502_maximum_collection_count; - DWORD wki502_keep_conn; - DWORD wki502_max_cmds; - DWORD wki502_sess_timeout; - DWORD wki502_siz_char_buf; - DWORD wki502_max_threads; - - DWORD wki502_lock_quota; - DWORD wki502_lock_increment; - DWORD wki502_lock_maximum; - DWORD wki502_pipe_increment; - DWORD wki502_pipe_maximum; - DWORD wki502_cache_file_timeout; - DWORD wki502_dormant_file_limit; - DWORD wki502_read_ahead_throughput; - - DWORD wki502_num_mailslot_buffers; - DWORD wki502_num_srv_announce_buffers; - DWORD wki502_max_illegal_datagram_events; - DWORD wki502_illegal_datagram_event_reset_frequency; - BOOL wki502_log_election_packets; - - BOOL wki502_use_opportunistic_locking; - BOOL wki502_use_unlock_behind; - BOOL wki502_use_close_behind; - BOOL wki502_buf_named_pipes; - BOOL wki502_use_lock_read_unlock; - BOOL wki502_utilize_nt_caching; - BOOL wki502_use_raw_read; - BOOL wki502_use_raw_write; - BOOL wki502_use_write_raw_data; - BOOL wki502_use_encryption; - BOOL wki502_buf_files_deny_write; - BOOL wki502_buf_read_only_files; - BOOL wki502_force_core_create_mode; - BOOL wki502_use_512_byte_max_transfer; -}WKSTA_INFO_502, *PWKSTA_INFO_502, *LPWKSTA_INFO_502; - - -// -// The following info-levels are only valid for NetWkstaSetInfo -// - -// -// The following levels are supported on down-level systems (LAN Man 2.x) -// as well as NT systems: -// -typedef struct _WKSTA_INFO_1010 { - DWORD wki1010_char_wait; -} WKSTA_INFO_1010, *PWKSTA_INFO_1010, *LPWKSTA_INFO_1010; - -typedef struct _WKSTA_INFO_1011 { - DWORD wki1011_collection_time; -} WKSTA_INFO_1011, *PWKSTA_INFO_1011, *LPWKSTA_INFO_1011; - -typedef struct _WKSTA_INFO_1012 { - DWORD wki1012_maximum_collection_count; -} WKSTA_INFO_1012, *PWKSTA_INFO_1012, *LPWKSTA_INFO_1012; - -// -// The following level are supported on down-level systems (LAN Man 2.x) -// only: -// -typedef struct _WKSTA_INFO_1027 { - DWORD wki1027_errlog_sz; -} WKSTA_INFO_1027, *PWKSTA_INFO_1027, *LPWKSTA_INFO_1027; - -typedef struct _WKSTA_INFO_1028 { - DWORD wki1028_print_buf_time; -} WKSTA_INFO_1028, *PWKSTA_INFO_1028, *LPWKSTA_INFO_1028; - -typedef struct _WKSTA_INFO_1032 { - DWORD wki1032_wrk_heuristics; -} WKSTA_INFO_1032, *PWKSTA_INFO_1032, *LPWKSTA_INFO_1032; - -// -// The following levels are settable on NT systems, and have no -// effect on down-level systems (i.e. LANMan 2.x) since these -// fields cannot be set on them: -// -typedef struct _WKSTA_INFO_1013 { - DWORD wki1013_keep_conn; -} WKSTA_INFO_1013, *PWKSTA_INFO_1013, *LPWKSTA_INFO_1013; - -typedef struct _WKSTA_INFO_1018 { - DWORD wki1018_sess_timeout; -} WKSTA_INFO_1018, *PWKSTA_INFO_1018, *LPWKSTA_INFO_1018; - -typedef struct _WKSTA_INFO_1023 { - DWORD wki1023_siz_char_buf; -} WKSTA_INFO_1023, *PWKSTA_INFO_1023, *LPWKSTA_INFO_1023; - -typedef struct _WKSTA_INFO_1033 { - DWORD wki1033_max_threads; -} WKSTA_INFO_1033, *PWKSTA_INFO_1033, *LPWKSTA_INFO_1033; - -// -// The following levels are only supported on NT systems: -// -typedef struct _WKSTA_INFO_1041 { - DWORD wki1041_lock_quota; -} WKSTA_INFO_1041, *PWKSTA_INFO_1041, *LPWKSTA_INFO_1041; - -typedef struct _WKSTA_INFO_1042 { - DWORD wki1042_lock_increment; -} WKSTA_INFO_1042, *PWKSTA_INFO_1042, *LPWKSTA_INFO_1042; - -typedef struct _WKSTA_INFO_1043 { - DWORD wki1043_lock_maximum; -} WKSTA_INFO_1043, *PWKSTA_INFO_1043, *LPWKSTA_INFO_1043; - -typedef struct _WKSTA_INFO_1044 { - DWORD wki1044_pipe_increment; -} WKSTA_INFO_1044, *PWKSTA_INFO_1044, *LPWKSTA_INFO_1044; - -typedef struct _WKSTA_INFO_1045 { - DWORD wki1045_pipe_maximum; -} WKSTA_INFO_1045, *PWKSTA_INFO_1045, *LPWKSTA_INFO_1045; - -typedef struct _WKSTA_INFO_1046 { - DWORD wki1046_dormant_file_limit; -} WKSTA_INFO_1046, *PWKSTA_INFO_1046, *LPWKSTA_INFO_1046; - -typedef struct _WKSTA_INFO_1047 { - DWORD wki1047_cache_file_timeout; -} WKSTA_INFO_1047, *PWKSTA_INFO_1047, *LPWKSTA_INFO_1047; - -typedef struct _WKSTA_INFO_1048 { - BOOL wki1048_use_opportunistic_locking; -} WKSTA_INFO_1048, *PWKSTA_INFO_1048, *LPWKSTA_INFO_1048; - -typedef struct _WKSTA_INFO_1049 { - BOOL wki1049_use_unlock_behind; -} WKSTA_INFO_1049, *PWKSTA_INFO_1049, *LPWKSTA_INFO_1049; - -typedef struct _WKSTA_INFO_1050 { - BOOL wki1050_use_close_behind; -} WKSTA_INFO_1050, *PWKSTA_INFO_1050, *LPWKSTA_INFO_1050; - -typedef struct _WKSTA_INFO_1051 { - BOOL wki1051_buf_named_pipes; -} WKSTA_INFO_1051, *PWKSTA_INFO_1051, *LPWKSTA_INFO_1051; - -typedef struct _WKSTA_INFO_1052 { - BOOL wki1052_use_lock_read_unlock; -} WKSTA_INFO_1052, *PWKSTA_INFO_1052, *LPWKSTA_INFO_1052; - -typedef struct _WKSTA_INFO_1053 { - BOOL wki1053_utilize_nt_caching; -} WKSTA_INFO_1053, *PWKSTA_INFO_1053, *LPWKSTA_INFO_1053; - -typedef struct _WKSTA_INFO_1054 { - BOOL wki1054_use_raw_read; -} WKSTA_INFO_1054, *PWKSTA_INFO_1054, *LPWKSTA_INFO_1054; - -typedef struct _WKSTA_INFO_1055 { - BOOL wki1055_use_raw_write; -} WKSTA_INFO_1055, *PWKSTA_INFO_1055, *LPWKSTA_INFO_1055; - -typedef struct _WKSTA_INFO_1056 { - BOOL wki1056_use_write_raw_data; -} WKSTA_INFO_1056, *PWKSTA_INFO_1056, *LPWKSTA_INFO_1056; - -typedef struct _WKSTA_INFO_1057 { - BOOL wki1057_use_encryption; -} WKSTA_INFO_1057, *PWKSTA_INFO_1057, *LPWKSTA_INFO_1057; - -typedef struct _WKSTA_INFO_1058 { - BOOL wki1058_buf_files_deny_write; -} WKSTA_INFO_1058, *PWKSTA_INFO_1058, *LPWKSTA_INFO_1058; - -typedef struct _WKSTA_INFO_1059 { - BOOL wki1059_buf_read_only_files; -} WKSTA_INFO_1059, *PWKSTA_INFO_1059, *LPWKSTA_INFO_1059; - -typedef struct _WKSTA_INFO_1060 { - BOOL wki1060_force_core_create_mode; -} WKSTA_INFO_1060, *PWKSTA_INFO_1060, *LPWKSTA_INFO_1060; - -typedef struct _WKSTA_INFO_1061 { - BOOL wki1061_use_512_byte_max_transfer; -} WKSTA_INFO_1061, *PWKSTA_INFO_1061, *LPWKSTA_INFO_1061; - -typedef struct _WKSTA_INFO_1062 { - DWORD wki1062_read_ahead_throughput; -} WKSTA_INFO_1062, *PWKSTA_INFO_1062, *LPWKSTA_INFO_1062; - - -// -// NetWkstaUserGetInfo (local only) and NetWkstaUserEnum - -// no access restrictions. -// -typedef struct _WKSTA_USER_INFO_0 { - LMSTR wkui0_username; -}WKSTA_USER_INFO_0, *PWKSTA_USER_INFO_0, *LPWKSTA_USER_INFO_0; - -// -// NetWkstaUserGetInfo (local only) and NetWkstaUserEnum - -// no access restrictions. -// -typedef struct _WKSTA_USER_INFO_1 { - LMSTR wkui1_username; - LMSTR wkui1_logon_domain; - LMSTR wkui1_oth_domains; - LMSTR wkui1_logon_server; -}WKSTA_USER_INFO_1, *PWKSTA_USER_INFO_1, *LPWKSTA_USER_INFO_1; - -// -// NetWkstaUserSetInfo - local access. -// -typedef struct _WKSTA_USER_INFO_1101 { - LMSTR wkui1101_oth_domains; -} WKSTA_USER_INFO_1101, *PWKSTA_USER_INFO_1101, - *LPWKSTA_USER_INFO_1101; - - -// -// NetWkstaTransportAdd - admin access -// -typedef struct _WKSTA_TRANSPORT_INFO_0 { - DWORD wkti0_quality_of_service; - DWORD wkti0_number_of_vcs; - LMSTR wkti0_transport_name; - LMSTR wkti0_transport_address; - BOOL wkti0_wan_ish; -}WKSTA_TRANSPORT_INFO_0, *PWKSTA_TRANSPORT_INFO_0, - *LPWKSTA_TRANSPORT_INFO_0; - - -// -// Special Values and Constants -// - -// -// Identifiers for use as NetWkstaSetInfo parmnum parameter -// - -// -// One of these values indicates the parameter within an information -// structure that is invalid when ERROR_INVALID_PARAMETER is returned by -// NetWkstaSetInfo. -// - -#define WKSTA_PLATFORM_ID_PARMNUM 100 -#define WKSTA_COMPUTERNAME_PARMNUM 1 -#define WKSTA_LANGROUP_PARMNUM 2 -#define WKSTA_VER_MAJOR_PARMNUM 4 -#define WKSTA_VER_MINOR_PARMNUM 5 -#define WKSTA_LOGGED_ON_USERS_PARMNUM 6 -#define WKSTA_LANROOT_PARMNUM 7 -#define WKSTA_LOGON_DOMAIN_PARMNUM 8 -#define WKSTA_LOGON_SERVER_PARMNUM 9 -#define WKSTA_CHARWAIT_PARMNUM 10 // Supported by down-level. -#define WKSTA_CHARTIME_PARMNUM 11 // Supported by down-level. -#define WKSTA_CHARCOUNT_PARMNUM 12 // Supported by down-level. -#define WKSTA_KEEPCONN_PARMNUM 13 -#define WKSTA_KEEPSEARCH_PARMNUM 14 -#define WKSTA_MAXCMDS_PARMNUM 15 -#define WKSTA_NUMWORKBUF_PARMNUM 16 -#define WKSTA_MAXWRKCACHE_PARMNUM 17 -#define WKSTA_SESSTIMEOUT_PARMNUM 18 -#define WKSTA_SIZERROR_PARMNUM 19 -#define WKSTA_NUMALERTS_PARMNUM 20 -#define WKSTA_NUMSERVICES_PARMNUM 21 -#define WKSTA_NUMCHARBUF_PARMNUM 22 -#define WKSTA_SIZCHARBUF_PARMNUM 23 -#define WKSTA_ERRLOGSZ_PARMNUM 27 // Supported by down-level. -#define WKSTA_PRINTBUFTIME_PARMNUM 28 // Supported by down-level. -#define WKSTA_SIZWORKBUF_PARMNUM 29 -#define WKSTA_MAILSLOTS_PARMNUM 30 -#define WKSTA_NUMDGRAMBUF_PARMNUM 31 -#define WKSTA_WRKHEURISTICS_PARMNUM 32 // Supported by down-level. -#define WKSTA_MAXTHREADS_PARMNUM 33 - -#define WKSTA_LOCKQUOTA_PARMNUM 41 -#define WKSTA_LOCKINCREMENT_PARMNUM 42 -#define WKSTA_LOCKMAXIMUM_PARMNUM 43 -#define WKSTA_PIPEINCREMENT_PARMNUM 44 -#define WKSTA_PIPEMAXIMUM_PARMNUM 45 -#define WKSTA_DORMANTFILELIMIT_PARMNUM 46 -#define WKSTA_CACHEFILETIMEOUT_PARMNUM 47 -#define WKSTA_USEOPPORTUNISTICLOCKING_PARMNUM 48 -#define WKSTA_USEUNLOCKBEHIND_PARMNUM 49 -#define WKSTA_USECLOSEBEHIND_PARMNUM 50 -#define WKSTA_BUFFERNAMEDPIPES_PARMNUM 51 -#define WKSTA_USELOCKANDREADANDUNLOCK_PARMNUM 52 -#define WKSTA_UTILIZENTCACHING_PARMNUM 53 -#define WKSTA_USERAWREAD_PARMNUM 54 -#define WKSTA_USERAWWRITE_PARMNUM 55 -#define WKSTA_USEWRITERAWWITHDATA_PARMNUM 56 -#define WKSTA_USEENCRYPTION_PARMNUM 57 -#define WKSTA_BUFFILESWITHDENYWRITE_PARMNUM 58 -#define WKSTA_BUFFERREADONLYFILES_PARMNUM 59 -#define WKSTA_FORCECORECREATEMODE_PARMNUM 60 -#define WKSTA_USE512BYTESMAXTRANSFER_PARMNUM 61 -#define WKSTA_READAHEADTHRUPUT_PARMNUM 62 - - -// -// One of these values indicates the parameter within an information -// structure that is invalid when ERROR_INVALID_PARAMETER is returned by -// NetWkstaUserSetInfo. -// - -#define WKSTA_OTH_DOMAINS_PARMNUM 101 - - -// -// One of these values indicates the parameter within an information -// structure that is invalid when ERROR_INVALID_PARAMETER is returned by -// NetWkstaTransportAdd. -// - -#define TRANSPORT_QUALITYOFSERVICE_PARMNUM 201 -#define TRANSPORT_NAME_PARMNUM 202 - -#ifdef __cplusplus -} -#endif - -#endif // _LMWKSTA_ - diff --git a/qt-correction-tool/pub/ddk/lowio.h b/qt-correction-tool/pub/ddk/lowio.h deleted file mode 100644 index 4af3199..0000000 --- a/qt-correction-tool/pub/ddk/lowio.h +++ /dev/null @@ -1,88 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - lowio.h - -Abstract: - - This module defines all of the structures and prototypes for Low IO. - -Author: -Revision History: - ---*/ - -#ifndef _RXLOWIO_ -#define _RXLOWIO_ - -#include "mrx.h" // mini redirector related definitions .... - -#ifndef WIN9X -extern FAST_MUTEX RxLowIoPagingIoSyncMutex; -#endif - -#define RxLowIoIsMdlLocked(MDL) ( \ - RxMdlIsLocked((MDL)) || RxMdlSourceIsNonPaged((MDL)) \ - ) - -#define RxLowIoIsBufferLocked(LOWIOCONTEXT) \ - ( ((LOWIOCONTEXT)->Operation > LOWIO_OP_WRITE ) || \ - ((LOWIOCONTEXT)->ParamsFor.ReadWrite.Buffer == NULL) || \ - ( \ - ((LOWIOCONTEXT)->ParamsFor.ReadWrite.Buffer != NULL) && \ - RxLowIoIsMdlLocked(((LOWIOCONTEXT)->ParamsFor.ReadWrite.Buffer)) \ - ) \ - ) - -typedef struct _LOWIO_PER_FCB_INFO { - LIST_ENTRY PagingIoReadsOutstanding; - LIST_ENTRY PagingIoWritesOutstanding; -} LOWIO_PER_FCB_INFO, *PLOWIO_PER_FCB_INFO; - -PVOID -NTAPI -RxLowIoGetBufferAddress ( - IN PRX_CONTEXT RxContext - ); - -NTSTATUS -NTAPI -RxLowIoPopulateFsctlInfo ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -NTSTATUS -NTAPI -RxLowIoSubmit ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PFCB Fcb, - IN PLOWIO_COMPLETION_ROUTINE CompletionRoutine - ); - -NTSTATUS -NTAPI -RxLowIoCompletion ( - PRX_CONTEXT RxContext - ); - -VOID -NTAPI -RxInitializeLowIoContext ( - IN PRX_CONTEXT RxContext, - IN ULONG Operation, - OUT PLOWIO_CONTEXT LowIoContext - ); - -VOID -RxInitializeLowIoPerFcbInfo ( - PLOWIO_PER_FCB_INFO LowIoPerFcbInfo - ); - - -#endif // _RXLOWIO_ - diff --git a/qt-correction-tool/pub/ddk/mcd.h b/qt-correction-tool/pub/ddk/mcd.h deleted file mode 100644 index 852b8e7..0000000 --- a/qt-correction-tool/pub/ddk/mcd.h +++ /dev/null @@ -1,471 +0,0 @@ - -/*++ - -Copyright (C) Microsoft Corporation, 1996 - 1998 - -Module Name: - - mcd.h - -Abstract: - - These are the structures and defines that are used in the - changer class drivers. The changer class driver is separated - into two modules. Mcd.c contains code common to all medium - changer drivers including the driver's major entry points. - - -Environment: - - Kernel mode - -Revision History : - ---*/ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // named type definition in parentheses -#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int - -#include "scsi.h" -#include "ntddchgr.h" -#include - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#include -#include -#endif - -#ifdef DebugPrint -#undef DebugPrint -#endif - -#if DBG -#if (NTDDI_VERSION < NTDDI_WINXP) -#define DebugPrint(x) MCDebugPrint x -#else -#define DebugPrint(x) ChangerClassDebugPrint x -#endif -#else -#define DebugPrint(x) -#endif - -#define MAXIMUM_CHANGER_INQUIRY_DATA 252 - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef -NTSTATUS -(*CHANGER_COMMAND_ROUTINE)( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -typedef -ULONG -(*CHANGER_EXTENSION_SIZE)( - __in VOID - ); - -typedef -NTSTATUS -(*CHANGER_INITIALIZE)( - __in PDEVICE_OBJECT DeviceObject - ); - -typedef -NTSTATUS -(*CHANGER_PERFORM_DIAGNOSTICS)( - __in PDEVICE_OBJECT DeviceObject, - __out PWMI_CHANGER_PROBLEM_DEVICE_ERROR changerDeviceError - ); - -typedef -VOID -(*CHANGER_ERROR_ROUTINE)( - __in PDEVICE_OBJECT DeviceObject, - __in PSCSI_REQUEST_BLOCK Srb, - __in NTSTATUS *Status, - __in BOOLEAN *Retry - ); - -typedef struct _MCD_INIT_DATA { - - // - // Size of this structure. - // - - ULONG InitDataSize; - - // - // To return the size of the minidriver extension - // - - CHANGER_EXTENSION_SIZE ChangerAdditionalExtensionSize; - - // - // To perform minidriver specific initialization - // - - CHANGER_INITIALIZE ChangerInitialize; - - // - // To perform minidriver specific error processing - // - - CHANGER_ERROR_ROUTINE ChangerError; - - // - // To perform diagnostic tests on the device - // - - CHANGER_PERFORM_DIAGNOSTICS ChangerPerformDiagnostics; - - // - // Minidriver dispatch routines - // - - CHANGER_COMMAND_ROUTINE ChangerGetParameters; - - CHANGER_COMMAND_ROUTINE ChangerGetStatus; - - CHANGER_COMMAND_ROUTINE ChangerGetProductData; - - CHANGER_COMMAND_ROUTINE ChangerSetAccess; - - CHANGER_COMMAND_ROUTINE ChangerGetElementStatus; - - CHANGER_COMMAND_ROUTINE ChangerInitializeElementStatus; - - CHANGER_COMMAND_ROUTINE ChangerSetPosition; - - CHANGER_COMMAND_ROUTINE ChangerExchangeMedium; - - CHANGER_COMMAND_ROUTINE ChangerMoveMedium; - - CHANGER_COMMAND_ROUTINE ChangerReinitializeUnit; - - CHANGER_COMMAND_ROUTINE ChangerQueryVolumeTags; - -} MCD_INIT_DATA, *PMCD_INIT_DATA; -#endif - -typedef struct _MODE_ELEMENT_ADDRESS_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PS : 1; - UCHAR PageLength; - UCHAR MediumTransportElementAddress[2]; - UCHAR NumberTransportElements[2]; - UCHAR FirstStorageElementAddress[2]; - UCHAR NumberStorageElements[2]; - UCHAR FirstIEPortElementAddress[2]; - UCHAR NumberIEPortElements[2]; - UCHAR FirstDataXFerElementAddress[2]; - UCHAR NumberDataXFerElements[2]; - UCHAR Reserved2[2]; - -} MODE_ELEMENT_ADDRESS_PAGE, *PMODE_ELEMENT_ADDRESS_PAGE; - -typedef struct _MODE_TRANSPORT_GEOMETRY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PS : 1; - UCHAR PageLength; - UCHAR Flip : 1; - UCHAR Reserved2: 7; - UCHAR TransportElementNumber; - -} MODE_TRANSPORT_GEOMETRY_PAGE, *PMODE_TRANSPORT_GEOMETRY_PAGE; - -// -// Capabilities page decribes the various functions that the device -// supports. Used in GetParameters. -// - -typedef struct _MODE_DEVICE_CAPABILITIES_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PS : 1; - UCHAR PageLength; - UCHAR MediumTransport : 1; - UCHAR StorageLocation : 1; - UCHAR IEPort : 1; - UCHAR DataXFer : 1; - UCHAR Reserved2 : 4; - UCHAR Reserved3; - UCHAR MTtoMT : 1; - UCHAR MTtoST : 1; - UCHAR MTtoIE : 1; - UCHAR MTtoDT : 1; - UCHAR Reserved4 : 4; - UCHAR STtoMT : 1; - UCHAR STtoST : 1; - UCHAR STtoIE : 1; - UCHAR STtoDT : 1; - UCHAR Reserved5 : 4; - UCHAR IEtoMT : 1; - UCHAR IEtoST : 1; - UCHAR IEtoIE : 1; - UCHAR IEtoDT : 1; - UCHAR Reserved6 : 4; - UCHAR DTtoMT : 1; - UCHAR DTtoST : 1; - UCHAR DTtoIE : 1; - UCHAR DTtoDT : 1; - UCHAR Reserved7 : 4; - UCHAR Reserved8[4]; - UCHAR XMTtoMT : 1; - UCHAR XMTtoST : 1; - UCHAR XMTtoIE : 1; - UCHAR XMTtoDT : 1; - UCHAR Reserved9 : 4; - UCHAR XSTtoMT : 1; - UCHAR XSTtoST : 1; - UCHAR XSTtoIE : 1; - UCHAR XSTtoDT : 1; - UCHAR Reserved10 : 4; - UCHAR XIEtoMT : 1; - UCHAR XIEtoST : 1; - UCHAR XIEtoIE : 1; - UCHAR XIEtoDT : 1; - UCHAR Reserved11 : 4; - UCHAR XDTtoMT : 1; - UCHAR XDTtoST : 1; - UCHAR XDTtoIE : 1; - UCHAR XDTtoDT : 1; - UCHAR Reserved12 : 4; - -} MODE_DEVICE_CAPABILITIES_PAGE, *PMODE_DEVICE_CAPABILITIES_PAGE; - -#define MODE_PAGE_DISPLAY 0x22 - -// -// Structures describing return data from READ_ELEMENT_STATUS -// - -typedef struct _ELEMENT_STATUS_HEADER { - UCHAR FirstElementAddress[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved1; - UCHAR ReportByteCount[3]; -} ELEMENT_STATUS_HEADER, *PELEMENT_STATUS_HEADER; - -typedef struct _ELEMENT_STATUS_PAGE { - UCHAR ElementType; - UCHAR Reserved1 : 6; - UCHAR AVolTag : 1; - UCHAR PVolTag : 1; - UCHAR ElementDescriptorLength[2]; - UCHAR Reserved2; - UCHAR DescriptorByteCount[3]; -} ELEMENT_STATUS_PAGE, *PELEMENT_STATUS_PAGE; - - -typedef struct _ELEMENT_DESCRIPTOR { - UCHAR ElementAddress[2]; - UCHAR Full : 1; - UCHAR Reserved1 : 1; - UCHAR Exception : 1; - UCHAR Accessible : 1; - UCHAR Reserved2 : 4; - UCHAR Reserved3; - UCHAR AdditionalSenseCode; - UCHAR AddSenseCodeQualifier; - UCHAR Lun : 3; - UCHAR Reserved4 : 1; - UCHAR LunValid : 1; - UCHAR IdValid : 1; - UCHAR Reserved5 : 1; - UCHAR NotThisBus : 1; - UCHAR BusAddress; - UCHAR Reserved6; - UCHAR Reserved7 : 6; - UCHAR Invert : 1; - UCHAR SValid : 1; - UCHAR SourceStorageElementAddress[2]; -} ELEMENT_DESCRIPTOR, *PELEMENT_DESCRIPTOR; - - -// -// The following routines are the exported entry points for -// all changer class drivers. -// - -NTSTATUS -DriverEntry( - __in PDRIVER_OBJECT DriverObject, - __in PUNICODE_STRING RegistryPath - ); - -PVOID -ChangerClassAllocatePool( - __in POOL_TYPE PoolType, - __in ULONG NumberOfBytes - ); - -VOID -ChangerClassFreePool( - __in PVOID PoolToFree - ); - - -// -// The following routines are provided by the changer -// device-specific module. Each routine name is -// prefixed with 'Changer.' - - -ULONG -ChangerAdditionalExtensionSize( - VOID - ); - -NTSTATUS -ChangerInitialize( - __in PDEVICE_OBJECT DeviceObject - ); - -VOID -ChangerError( - PDEVICE_OBJECT DeviceObject, - PSCSI_REQUEST_BLOCK Srb, - NTSTATUS *Status, - BOOLEAN *Retry - ); - -NTSTATUS -ChangerGetParameters( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerGetStatus( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerGetProductData( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerSetAccess( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerGetElementStatus( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - - -NTSTATUS -ChangerInitializeElementStatus( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerSetPosition( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerExchangeMedium( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerMoveMedium( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerReinitializeUnit( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerQueryVolumeTags( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSTATUS -ChangerClassInitialize( - __in PDRIVER_OBJECT DriverObject, - __in PUNICODE_STRING RegistryPath, - __in PMCD_INIT_DATA ChangerInitData - ); - -NTSTATUS -ChangerPerformDiagnostics( - __in PDEVICE_OBJECT DeviceObject, - __out PWMI_CHANGER_PROBLEM_DEVICE_ERROR changerDeviceError - ); - -NTSTATUS -ChangerClassSendSrbSynchronous( - __in PDEVICE_OBJECT DeviceObject, - __in PSCSI_REQUEST_BLOCK Srb, - __in PVOID Buffer, - __in ULONG BufferSize, - __in BOOLEAN WriteToDevice - ); - -VOID -ChangerClassDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); -#endif - -#if (NTDDI_VERSION < NTDDI_WINXP) -VOID -MCDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); - -BOOLEAN -ChangerVerifyInquiry( - PINQUIRYDATA InquiryData - ); -#endif - -#if (NTDDI_VERSION < NTDDI_WS03) -NTSTATUS -ChangerClassCreate ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -NTSTATUS -ChangerClassDeviceControl( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); -#endif - - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - diff --git a/qt-correction-tool/pub/ddk/mce.h b/qt-correction-tool/pub/ddk/mce.h deleted file mode 100644 index b23816c..0000000 --- a/qt-correction-tool/pub/ddk/mce.h +++ /dev/null @@ -1,1391 +0,0 @@ -/*++ BUILD Version: 0011 // Increment this if a change has global effects - -Copyright (c) 1991-2001 Microsoft Corporation - -Module Name: - - mce.h - -Abstract: - - This header file defines the Machine Check Errors definitions. - -Author: - -Revision History: - - Creation: 04-Apr-2001 - ---*/ - -#ifndef _MCE_ -#define _MCE_ - -#pragma once - -// -// HalMcaLogInformation -// - -#if defined(_X86_) || defined(_IA64_) || defined(_AMD64_) - -// -// ADDR register for each MCA bank -// - -typedef union _MCI_ADDR{ - struct { - ULONG Address; - ULONG Reserved; - } DUMMYSTRUCTNAME; - - ULONGLONG QuadPart; -} MCI_ADDR, *PMCI_ADDR; - - -typedef enum { - HAL_MCE_RECORD, - HAL_MCA_RECORD -} MCA_EXCEPTION_TYPE; - - -#if defined(_AMD64_) - -// -// STATUS register for each MCA bank. -// - -#if (NTDDI_VERSION <= NTDDI_WINXP) -typedef union _MCI_STATS { - struct { - USHORT McaCod; - USHORT ModelErrorCode; - ULONG OtherInfo : 25; - ULONG Damage : 1; - ULONG AddressValid : 1; - ULONG MiscValid : 1; - ULONG Enabled : 1; - ULONG Uncorrected : 1; - ULONG OverFlow : 1; - ULONG Valid : 1; - } MciStatus; - - ULONG64 QuadPart; -} MCI_STATS, *PMCI_STATS; -#else -typedef union _MCI_STATS { - struct { - USHORT McaErrorCode; - USHORT ModelErrorCode; - ULONG OtherInformation : 25; - ULONG ContextCorrupt : 1; - ULONG AddressValid : 1; - ULONG MiscValid : 1; - ULONG ErrorEnabled : 1; - ULONG UncorrectedError : 1; - ULONG StatusOverFlow : 1; - ULONG Valid : 1; - } MciStatus; - - ULONG64 QuadPart; -} MCI_STATS, *PMCI_STATS; -#endif - -#endif // _AMD64_ - -#if defined(_X86_) - -// -// STATUS register for each MCA bank. -// - -typedef union _MCI_STATS { - struct { - USHORT McaCod; - USHORT MsCod; - ULONG OtherInfo : 25; - ULONG Damage : 1; - ULONG AddressValid : 1; - ULONG MiscValid : 1; - ULONG Enabled : 1; - ULONG UnCorrected : 1; - ULONG OverFlow : 1; - ULONG Valid : 1; - } MciStats; - - ULONGLONG QuadPart; - -} MCI_STATS, *PMCI_STATS; - -#endif // _X86_ - -// -// MCA exception log entry -// Defined as a union to contain MCA specific log or Pentium style MCE info. -// - -#define MCA_EXTREG_V2MAX 24 // X86: Max. Number of extended registers - -#if defined(_X86_) || defined(_AMD64_) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef struct _MCA_EXCEPTION { - - // Begin Version 1 stuff - ULONG VersionNumber; // Version number of this record type - MCA_EXCEPTION_TYPE ExceptionType; // MCA or MCE - LARGE_INTEGER TimeStamp; // exception recording timestamp - ULONG ProcessorNumber; - ULONG Reserved1; - - union { - struct { - UCHAR BankNumber; - UCHAR Reserved2[7]; - MCI_STATS Status; - MCI_ADDR Address; - ULONGLONG Misc; - } Mca; - - struct { - ULONGLONG Address; // physical addr of cycle causing the error - ULONGLONG Type; // cycle specification causing the error - } Mce; - } u; - // End Version 1 stuff - - // Begin Version 2 stuff - ULONG ExtCnt; - ULONG Reserved3; - ULONGLONG ExtReg[MCA_EXTREG_V2MAX]; - // End Version 2 stuff - -} MCA_EXCEPTION, *PMCA_EXCEPTION; -#else -typedef struct _MCA_EXCEPTION { - - ULONG VersionNumber; // Version number of this record type - MCA_EXCEPTION_TYPE ExceptionType; // MCA or MCE - LARGE_INTEGER TimeStamp; // exception recording timestamp - ULONG ProcessorNumber; - ULONG Reserved1; - - union { - struct { - UCHAR BankNumber; - UCHAR Reserved2[7]; - MCI_STATS Status; - MCI_ADDR Address; - ULONGLONG Misc; - } Mca; - - struct { - ULONGLONG Address; // physical addr of cycle causing the error - ULONGLONG Type; // cycle specification causing the error - } Mce; - } u; - -} MCA_EXCEPTION, *PMCA_EXCEPTION; -#endif - -typedef MCA_EXCEPTION CMC_EXCEPTION, *PCMC_EXCEPTION; // Corrected Machine Check -typedef MCA_EXCEPTION CPE_EXCEPTION, *PCPE_EXCEPTION; // Corrected Platform Error - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define MCA_EXCEPTION_V1_SIZE FIELD_OFFSET(MCA_EXCEPTION, ExtCnt) -#define MCA_EXCEPTION_V2_SIZE sizeof(struct _MCA_EXCEPTION) -#endif - -#endif // _X86_ || _AMD64_ - -// -// ERRORS: ERROR_SEVERITY definitions -// -// One day the MS compiler will support typed enums with type != int so this -// type of enums (UCHAR, __int64) could be defined... -// - -#if defined(_AMD64_) || defined(_IA64_) - -typedef UCHAR ERROR_SEVERITY, *PERROR_SEVERITY; - -typedef enum _ERROR_SEVERITY_VALUE { - ErrorRecoverable = 0, - ErrorFatal = 1, - ErrorCorrected = 2, - ErrorOthers = 3, // [3,...] values are reserved -} ERROR_SEVERITY_VALUE; - -#endif - -#if defined(_IA64_) - -#if 0 -// FIXFIX: This should not be required for IA64. -// -// STATUS register for each MCA bank. -// - -typedef union _MCI_STATS { - struct { - USHORT McaCod; - USHORT MsCod; - ULONG OtherInfo : 25; - ULONG Damage : 1; - ULONG AddressValid : 1; - ULONG MiscValid : 1; - ULONG Enabled : 1; - ULONG UnCorrected : 1; - ULONG OverFlow : 1; - ULONG Valid : 1; - } MciStats; - - ULONGLONG QuadPart; - -} MCI_STATS, *PMCI_STATS; - -#endif // 0 - -// -// IA64 ERRORS: ERROR_REVISION definitions -// - -typedef union _ERROR_REVISION { - USHORT Revision; // Major and Minor revision number of the record: - struct { - UCHAR Minor; // Byte0: Minor. - UCHAR Major; // Byte1: Major. - } DUMMYSTRUCTNAME; -} ERROR_REVISION, *PERROR_REVISION; - -// For Info: -#if (NTDDI_VERSION > NTDDI_WINXP) -#define ERROR_MAJOR_REVISION_SAL_03_00 0 -#define ERROR_MINOR_REVISION_SAL_03_00 2 -#define ERROR_REVISION_SAL_03_00 { ERROR_MINOR_REVISION_SAL_03_00, \ - ERROR_MAJOR_REVISION_SAL_03_00 } - -// -// Section Header revision is fixed at Major == 2 and Minor == 0 -// -#define ERROR_FIXED_SECTION_REVISION { 2,\ - 0 } -#else -#define ERROR_REVISION_SAL_03_00 { 2, 0 } -#endif - -// -// IA64 ERRORS: ERROR_TIMESTAMP definitions -// - -typedef union _ERROR_TIMESTAMP { - ULONGLONG TimeStamp; - struct { - UCHAR Seconds; // Byte0: Seconds - UCHAR Minutes; // Byte1: Minutes - UCHAR Hours; // Byte2: Hours - UCHAR Reserved; // Byte3: Reserved - UCHAR Day; // Byte4: Day - UCHAR Month; // Byte5: Month - UCHAR Year; // Byte6: Year - UCHAR Century; // Byte7: Century - } DUMMYSTRUCTNAME; -} ERROR_TIMESTAMP, *PERROR_TIMESTAMP; - -// -// IA64 ERRORS: ERROR_GUID definitions -// - -typedef struct _ERROR_GUID { - ULONG Data1; - USHORT Data2; - USHORT Data3; - UCHAR Data4[8]; -} ERROR_GUID, *PERROR_GUID; - -// -// IA64 ERRORS: ERROR GUIDs definitions -// - -typedef ERROR_GUID _ERROR_DEVICE_GUID; -typedef _ERROR_DEVICE_GUID ERROR_DEVICE_GUID, *PERROR_DEVICE_GUID; - -typedef ERROR_GUID _ERROR_PLATFORM_GUID; -typedef _ERROR_PLATFORM_GUID ERROR_PLATFORM_GUID, *PERROR_PLATFORM_GUID; - -// -// IA64 ERRORS: ERROR_RECORD_HEADER definitions -// - -typedef union _ERROR_RECORD_VALID { - UCHAR Valid; - struct { // Bits - UCHAR OemPlatformID:1; // 0: OEM Platform Id is present in the record header - UCHAR Reserved:7; // 1-7: Reserved - } DUMMYSTRUCTNAME; -} ERROR_RECORD_VALID, *PERROR_RECORD_VALID; - -typedef struct _ERROR_RECORD_HEADER { // Offsets: - ULONGLONG Id; // 0: Unique identifier - ERROR_REVISION Revision; // 8: Major and Minor revision number of the record - ERROR_SEVERITY ErrorSeverity; // 10: Error Severity - ERROR_RECORD_VALID Valid; // 11: Validation bits - ULONG Length; // 12: Length of this record in bytes, including the header - ERROR_TIMESTAMP TimeStamp; // 16: Timestamp recorded when event occured - UCHAR OemPlatformId[16]; // 24: Unique platform identifier. OEM defined. -} ERROR_RECORD_HEADER, *PERROR_RECORD_HEADER; - -// -// IA64 ERRORS: ERROR_SECTION_HEADER definitions -// - -typedef union _ERROR_RECOVERY_INFO { - UCHAR RecoveryInfo; - struct { // Bits: - UCHAR Corrected:1; // 0: Corrected - UCHAR NotContained:1; // 1: Containment Warning - UCHAR Reset:1; // 2: Reset - UCHAR Reserved:4; // 6-3: Reserved - UCHAR Valid:1; // 7: Valid Recovery Information - } DUMMYSTRUCTNAME; -} ERROR_RECOVERY_INFO, *PERROR_RECOVERY_INFO; - -typedef struct _ERROR_SECTION_HEADER { - ERROR_DEVICE_GUID Guid; // Unique identifier - ERROR_REVISION Revision; // Major and Minor revision number of the section - ERROR_RECOVERY_INFO RecoveryInfo; // Recovery Information - UCHAR Reserved; - ULONG Length; // Length of this error device section in bytes, - // including the header. -} ERROR_SECTION_HEADER, *PERROR_SECTION_HEADER; - -// -// IA64 Machine Check Error Logs: -// WMI requires processor LID being stored in the Log. -// This LID corresponds to the processor on which the SAL_PROC was executed on. -// -// TEMPTEMP: Implementation is temporary, until we implement HAL SW Error Section. -// Note that the current FW builds do not update the _ERROR_PROCESSOR.CRLid field, -// assuming there is a _ERROR_PROCESSOR section in the record. -// - -#if !defined(__midl) && defined(_MSC_EXTENSIONS) -__inline -USHORT -GetFwMceLogProcessorNumber( - PERROR_RECORD_HEADER Log - ) -{ - PERROR_SECTION_HEADER section = (PERROR_SECTION_HEADER)((ULONG64)Log + sizeof(*Log)); - USHORT lid = (USHORT)((UCHAR)(section->Reserved)); - lid |= (USHORT)((UCHAR)(Log->TimeStamp.Reserved) << 8); - return( lid ); -} // GetFwMceLogProcessorNumber() -#endif // !__midl - -// -// IA64 ERRORS: ERROR_PROCESSOR device definitions -// -// The MCA architecture supports five different types of error reporting functional units -// with the associated error records and its error severity. -// At any point in time, a processor could encounter an MCA/CMC event due to errors detected -// in one or more of the following units: -// - Cache Check -// - TLB Check -// - Bus Check -// - Register File -// - Micro Architectural -// -// Terminology: -// -// - Target Address: -// 64-bit integer containing the physical address where the data was to be delivered or -// obtained. This could also be the incoming address for external snoops and TLB shoot-downs. -// -// - Requestor Identifier: -// 64-bit integer specifying the bus agent that generated the transaction responsible for -// the Machine Check event. -// -// - Responder Identifier: -// 64-bit integer specifying the bus agent that responded to a transaction responsible for -// the Machine Check event. -// -// - Precise Instruction Pointer: -// 64-bit integer specifying the virtual address that points to the IA-64 bundle that -// contained the instruction responsible for the Machine Check event. -// - -#define ERROR_PROCESSOR_GUID \ - { 0xe429faf1, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_MODINFO_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG CheckInfo: 1; // 0: - ULONGLONG RequestorIdentifier: 1; // 1: - ULONGLONG ResponderIdentifier: 1; // 2: - ULONGLONG TargetIdentifier: 1; // 3: - ULONGLONG PreciseIP: 1; // 4: - ULONGLONG Reserved: 59; // 5-63: - } DUMMYSTRUCTNAME; -} ERROR_MODINFO_VALID, *PERROR_MODINFO_VALID; - -typedef enum _ERROR_CHECK_IS { - isIA64 = 0, - isIA32 = 1, -} ERROR_CHECK_IS; - -typedef enum _ERROR_CACHE_CHECK_OPERATION { - CacheUnknownOp = 0, - CacheLoad = 1, - CacheStore = 2, - CacheInstructionFetch = 3, - CacheDataPrefetch = 4, - CacheSnoop = 5, - CacheCastOut = 6, - CacheMoveIn = 7, -} ERROR_CACHE_CHECK_OPERATION; - -typedef enum _ERROR_CACHE_CHECK_MESI { - CacheInvalid = 0, - CacheHeldShared = 1, - CacheHeldExclusive = 2, - CacheModified = 3, -} ERROR_CACHE_CHECK_MESI; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef union _ERROR_CACHE_CHECK { - ULONGLONG CacheCheck; - struct - { - ULONGLONG Operation:4; // bits 0- 3: Cache operation - ULONGLONG Level:2; // 4- 5: Cache Level - ULONGLONG Reserved1:2; // 6- 7 - ULONGLONG DataLine:1; // 8 : Failure data part of cache line - ULONGLONG TagLine:1; // 9 : Failure tag part of cache line - ULONGLONG DataCache:1; // 10 : Failure in data cache - ULONGLONG InstructionCache:1; // 11 : Failure in instruction cache - ULONGLONG MESI:3; // 12-14: - ULONGLONG MESIValid:1; // 15 : MESI field is valid - ULONGLONG Way:5; // 16-20: Failure in Way of Cache - ULONGLONG WayIndexValid:1; // 21 : Way and Index fields valid - ULONGLONG Reserved2:1; // 22 - ULONGLONG DP:1; // 23 : 1 - error due to data poisoning - ULONGLONG Reserved3:8; // 24-31 - ULONGLONG Index:20; // 32-51: Index of cache line - ULONGLONG Reserved4:2; // 52-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_CACHE_CHECK, *PERROR_CACHE_CHECK; -# else -typedef union _ERROR_CACHE_CHECK { - ULONGLONG CacheCheck; - struct - { - ULONGLONG Operation:4; // bits 0- 3: Cache operation - ULONGLONG Level:2; // 4- 5: Cache Level - ULONGLONG Reserved1:2; // 6- 7 - ULONGLONG DataLine:1; // 8 : Failure data part of cache line - ULONGLONG TagLine:1; // 9 : Failure tag part of cache line - ULONGLONG DataCache:1; // 10 : Failure in data cache - ULONGLONG InstructionCache:1; // 11 : Failure in instruction cache - ULONGLONG MESI:3; // 12-14: - ULONGLONG MESIValid:1; // 15 : MESI field is valid - ULONGLONG Way:5; // 16-20: Failure in Way of Cache - ULONGLONG WayIndexValid:1; // 21 : Way and Index fields valid - ULONGLONG Reserved2:10; // 22-31 - ULONGLONG Index:20; // 32-51: Index of cache line - ULONGLONG Reserved3:2; // 52-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_CACHE_CHECK, *PERROR_CACHE_CHECK; -#endif - -typedef enum _ERROR_TLB_CHECK_OPERATION { - TlbUnknownOp = 0, - TlbAccessWithLoad = 1, - TlbAccessWithStore = 2, - TlbAccessWithInstructionFetch = 3, - TlbAccessWithDataPrefetch = 4, - TlbShootDown = 5, - TlbProbe = 6, - TlbVhptFill = 7, - TlbPurge = 8, -} ERROR_TLB_CHECK_OPERATION; - -typedef union _ERROR_TLB_CHECK { - ULONGLONG TlbCheck; - struct - { - ULONGLONG TRSlot:8; // bits 0- 7: Slot number of Translation Register - ULONGLONG TRSlotValid:1; // 8 : TRSlot field is valid - ULONGLONG Reserved1:1; // 9 - ULONGLONG Level:2; // 10-11: TLB Level - ULONGLONG Reserved2:4; // 12-15 - ULONGLONG DataTransReg:1; // 16 : Error in data translation register - ULONGLONG InstructionTransReg:1; // 17 : Error in instruction translation register - ULONGLONG DataTransCache:1; // 18 : Error in data translation cache - ULONGLONG InstructionTransCache:1; // 19 : Error in instruction translation cache - ULONGLONG Operation:4; // 20-23: Operation - ULONGLONG Reserved3:30; // 24-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_TLB_CHECK, *PERROR_TLB_CHECK; - -typedef enum _ERROR_BUS_CHECK_OPERATION { - BusUnknownOp = 0, - BusPartialRead = 1, - BusPartialWrite = 2, - BusFullLineRead = 3, - BusFullLineWrite = 4, - BusWriteBack = 5, - BusSnoopProbe = 6, - BusIncomingPtcG = 7, - BusWriteCoalescing = 8, -} ERROR_BUS_CHECK_OPERATION; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef union _ERROR_BUS_CHECK { - ULONGLONG BusCheck; - struct - { - ULONGLONG Size:5; // bits 0- 4: Transaction size - ULONGLONG Internal:1; // 5 : Internal bus error - ULONGLONG External:1; // 6 : External bus error - ULONGLONG CacheTransfer:1; // 7 : Error occured in Cache to Cache Transfer - ULONGLONG Type:8; // 8-15: Transaction type - ULONGLONG Severity:5; // 16-20: Error severity - platform specific - ULONGLONG Hierarchy:2; // 21-22: Level or Bus hierarchy - ULONGLONG DP:1; // 23 : 1 - error due to data poisoning - ULONGLONG Status:8; // 24-31: Bus error status - processor bus specific - ULONGLONG Reserved1:22; // 32-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_BUS_CHECK, *PERROR_BUS_CHECK; -#else -typedef union _ERROR_BUS_CHECK { - ULONGLONG BusCheck; - struct - { - ULONGLONG Size:5; // bits 0- 4: Transaction size - ULONGLONG Internal:1; // 5 : Internal bus error - ULONGLONG External:1; // 6 : External bus error - ULONGLONG CacheTransfer:1; // 7 : Error occured in Cache to Cache Transfer - ULONGLONG Type:8; // 8-15: Transaction type - ULONGLONG Severity:5; // 16-20: Error severity - platform specific - ULONGLONG Hierarchy:2; // 21-22: Level or Bus hierarchy - ULONGLONG Reserved1:1; // 23 - ULONGLONG Status:8; // 24-31: Bus error status - processor bus specific - ULONGLONG Reserved2:22; // 32-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_BUS_CHECK, *PERROR_BUS_CHECK; -#endif - -typedef enum _ERROR_REGFILE_CHECK_IDENTIFIER { - RegFileUnknownId = 0, - GeneralRegisterBank1 = 1, - GeneralRegisterBank0 = 2, - FloatingPointRegister = 3, - BranchRegister = 4, - PredicateRegister = 5, - ApplicationRegister = 6, - ControlRegister = 7, - RegionRegister = 8, - ProtectionKeyRegister = 9, - DataBreakPointRegister = 10, - InstructionBreakPointRegister = 11, - PerformanceMonitorControlRegister = 12, - PerformanceMonitorDataRegister = 13, -} ERROR_REGFILE_CHECK_IDENTIFIER; - -typedef enum _ERROR_REGFILE_CHECK_OPERATION { - RegFileUnknownOp = 0, - RegFileRead = 1, - RegFileWrite = 2, -} ERROR_REGFILE_CHECK_OPERATION; - -typedef union _ERROR_REGFILE_CHECK { - ULONGLONG RegFileCheck; - struct - { - ULONGLONG Identifier:4; // bits 0- 3: Register file identifier - ULONGLONG Operation:4; // 4- 7: Operation that causes the MC event - ULONGLONG RegisterNumber:7; // 8-14: Register number responsible for MC event - ULONGLONG RegisterNumberValid:1; // 15 : Register number field is valid - ULONGLONG Reserved1:38; // 16-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG Reserved2:3; // 60-62 - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_REGFILE_CHECK, *PERROR_REGFILE_CHECK; - -#if (NTDDK_VERSION <= WINXP) -typedef enum _ERROR_MS_CHECK_OPERATION { - MsUnknownOp = 0, - MsReadOrLoad = 1, - MsWriteOrStore = 2 -} ERROR_MS_CHECK_OPERATION; -#else -typedef enum _ERROR_MS_CHECK_OPERATION { - MsUnknownOp = 0, - MsReadOrLoad = 1, - MsWriteOrStore = 2, - MsOverTemperature = 3, - MsNormalTemperature = 4 -} ERROR_MS_CHECK_OPERATION; -#endif - -typedef union _ERROR_MS_CHECK { - ULONGLONG MsCheck; - struct - { - ULONGLONG StructureIdentifier:5; // bits 0- 4: Structure Identifier - impl. specific - ULONGLONG Level:3; // 5- 7: Structure Level where error was generated - ULONGLONG ArrayId:4; // 8-11: Identification of the array - ULONGLONG Operation:4; // 12-15: Operation - ULONGLONG Way:6; // 16-21: Way where the error was located - ULONGLONG WayValid:1; // 22 : Way field is valid - ULONGLONG IndexValid:1; // 23 : Index field is valid - ULONGLONG Reserved1:8; // 24-31 - ULONGLONG Index:8; // 32-39: Index where the error was located - ULONGLONG Reserved2:14; // 40-53 - ULONGLONG InstructionSet:1; // 54 : 0 - IA64 instruction, 1- IA32 instruction - ULONGLONG InstructionSetValid:1; // 55 : InstructionSet field is valid - ULONGLONG PrivilegeLevel:2; // 56-57: Privlege level of instrustion - ULONGLONG PrivilegeLevelValid:1; // 58 : PrivilegeLevel field is Valid - ULONGLONG MachineCheckCorrected:1; // 59 : 1 - Machine Check Corrected - ULONGLONG TargetAddressValid:1; // 60 : Target Address is valid - ULONGLONG RequestIdValid:1; // 61 : RequestId is valid - ULONGLONG ResponderIdValid:1; // 62 : ResponderId is valid - ULONGLONG PreciseIPValid:1; // 63 : Precise Inststruction Pointer is Valid - } DUMMYSTRUCTNAME; -} ERROR_MS_CHECK, *PERROR_MS_CHECK; - -typedef union _ERROR_CHECK_INFO { - ULONGLONG CheckInfo; - ERROR_CACHE_CHECK CacheCheck; - ERROR_TLB_CHECK TlbCheck; - ERROR_BUS_CHECK BusCheck; - ERROR_REGFILE_CHECK RegFileCheck; - ERROR_MS_CHECK MsCheck; -} ERROR_CHECK_INFO, *PERROR_CHECK_INFO; - -// SAL Specs July 2000: The size of _ERROR_MODINFO will always be 48 Bytes. - -typedef struct _ERROR_MODINFO { - ERROR_MODINFO_VALID Valid; - ERROR_CHECK_INFO CheckInfo; - ULONGLONG RequestorId; - ULONGLONG ResponderId; - ULONGLONG TargetId; - ULONGLONG PreciseIP; -} ERROR_MODINFO, *PERROR_MODINFO; - -typedef union _ERROR_PROCESSOR_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG ErrorMap: 1; // 0: - ULONGLONG StateParameter: 1; // 1: - ULONGLONG CRLid: 1; // 2: - ULONGLONG StaticStruct:1; // 3: Processor Static Info error. - ULONGLONG CacheCheckNum:4; // 4-7: Cache errors. - ULONGLONG TlbCheckNum:4; // 8-11: Tlb errors. - ULONGLONG BusCheckNum:4; // 12-15: Bus errors. - ULONGLONG RegFileCheckNum:4; // 16-19: Registers file errors. - ULONGLONG MsCheckNum:4; // 20-23: Micro-Architecture errors. - ULONGLONG CpuIdInfo:1; // 24: CPUID Info. - ULONGLONG Reserved:39; // 25-63: Reserved. - } DUMMYSTRUCTNAME; -} ERROR_PROCESSOR_VALID, *PERROR_PROCESSOR_VALID; - -typedef union _ERROR_PROCESSOR_ERROR_MAP { - ULONGLONG ErrorMap; - struct { - ULONGLONG Cid:4; // bits 0- 3: Processor Core Identifier - ULONGLONG Tid:4; // 4- 7: Logical Thread Identifier - ULONGLONG Eic:4; // 8-11: Instruction Caches Level Information - ULONGLONG Edc:4; // 12-15: Data Caches Level Information - ULONGLONG Eit:4; // 16-19: Instruction TLB Level Information - ULONGLONG Edt:4; // 20-23: Data TLB Level Information - ULONGLONG Ebh:4; // 24-27: Processor Bus Level Information - ULONGLONG Erf:4; // 28-31: Register File Level Information - ULONGLONG Ems:16; // 32-47: MicroArchitecture Level Information - ULONGLONG Reserved:16; - } DUMMYSTRUCTNAME; -} ERROR_PROCESSOR_ERROR_MAP, *PERROR_PROCESSOR_ERROR_MAP; - -typedef ERROR_PROCESSOR_ERROR_MAP _ERROR_PROCESSOR_LEVEL_INDEX; -typedef _ERROR_PROCESSOR_LEVEL_INDEX ERROR_PROCESSOR_LEVEL_INDEX, *PERROR_PROCESSOR_LEVEL_INDEX; - -typedef union _ERROR_PROCESSOR_STATE_PARAMETER { - ULONGLONG StateParameter; - struct { - ULONGLONG reserved0:2; // 0-1 : reserved - ULONGLONG rz:1; // 2 : Rendez-vous successful - ULONGLONG ra:1; // 3 : Rendez-vous attempted - ULONGLONG me:1; // 4 : Distinct Multiple errors - ULONGLONG mn:1; // 5 : Min-state Save Area registered - ULONGLONG sy:1; // 6 : Storage integrity synchronized - ULONGLONG co:1; // 7 : Continuable - ULONGLONG ci:1; // 8 : Machine Check isolated - ULONGLONG us:1; // 9 : Uncontained Storage damage - ULONGLONG hd:1; // 10 : Hardware damage - ULONGLONG tl:1; // 11 : Trap lost - ULONGLONG mi:1; // 12 : More Information - ULONGLONG pi:1; // 13 : Precise Instruction pointer - ULONGLONG pm:1; // 14 : Precise Min-state Save Area - ULONGLONG dy:1; // 15 : Processor Dynamic State valid - ULONGLONG in:1; // 16 : INIT interruption - ULONGLONG rs:1; // 17 : RSE valid - ULONGLONG cm:1; // 18 : Machine Check corrected - ULONGLONG ex:1; // 19 : Machine Check expected - ULONGLONG cr:1; // 20 : Control Registers valid - ULONGLONG pc:1; // 21 : Performance Counters valid - ULONGLONG dr:1; // 22 : Debug Registers valid - ULONGLONG tr:1; // 23 : Translation Registers valid - ULONGLONG rr:1; // 24 : Region Registers valid - ULONGLONG ar:1; // 25 : Application Registers valid - ULONGLONG br:1; // 26 : Branch Registers valid - ULONGLONG pr:1; // 27 : Predicate Registers valid - ULONGLONG fp:1; // 28 : Floating-Point Registers valid - ULONGLONG b1:1; // 29 : Preserved Bank 1 General Registers valid - ULONGLONG b0:1; // 30 : Preserved Bank 0 General Registers valid - ULONGLONG gr:1; // 31 : General Registers valid - ULONGLONG dsize:16; // 47-32 : Processor Dynamic State size - ULONGLONG reserved1:11; // 48-58 : reserved - ULONGLONG cc:1; // 59 : Cache Check - ULONGLONG tc:1; // 60 : TLB Check - ULONGLONG bc:1; // 61 : Bus Check - ULONGLONG rc:1; // 62 : Register File Check - ULONGLONG uc:1; // 63 : Micro-Architectural Check - } DUMMYSTRUCTNAME; -} ERROR_PROCESSOR_STATE_PARAMETER, *PERROR_PROCESSOR_STATE_PARAMETER; - -typedef union _PROCESSOR_LOCAL_ID { - ULONGLONG LocalId; - struct { - ULONGLONG reserved:16; // 0-16 : reserved - ULONGLONG eid:8; // 16-23 : Extended Id - ULONGLONG id:8; // 24-31 : Id - ULONGLONG ignored:32; // 32-63 : ignored - } DUMMYSTRUCTNAME; -} PROCESSOR_LOCAL_ID, *PPROCESSOR_LOCAL_ID; - -typedef struct _ERROR_PROCESSOR_MS { - ULONGLONG MsError [ /* Valid.MsCheckNum */ 1]; // 0 -> 15 registers file errors. -} ERROR_PROCESSOR_MS, *PERROR_PROCESSOR_MS; - -typedef struct _ERROR_PROCESSOR_CPUID_INFO { // Must be 48 bytes. - ULONGLONG CpuId0; - ULONGLONG CpuId1; - ULONGLONG CpuId2; - ULONGLONG CpuId3; - ULONGLONG CpuId4; - ULONGLONG Reserved; -} ERROR_PROCESSOR_CPUID_INFO, *PERROR_PROCESSOR_CPUID_INFO; - -typedef union _ERROR_PROCESSOR_STATIC_INFO_VALID { - ULONGLONG Valid; - struct { // Bits - // Warning: Match the VALID fields with the _ERROR_PROCESSOR_STATIC_INFO members. - // KD extensions use the field names to access the PSI structure. - ULONGLONG MinState: 1; // 0: MinState valid. - ULONGLONG BR: 1; // 1: Branch Registers valid. - ULONGLONG CR: 1; // 2: Control Registers valid. - ULONGLONG AR: 1; // 3: Application Registers valid. - ULONGLONG RR: 1; // 4: Registers valid. - ULONGLONG FR: 1; // 5: Registers valid. - ULONGLONG Reserved: 58; // 6-63: Reserved. - } DUMMYSTRUCTNAME; -} ERROR_PROCESSOR_STATIC_INFO_VALID, *PERROR_PROCESSOR_STATIC_INFO_VALID; - -typedef struct _ERROR_PROCESSOR_STATIC_INFO { - ERROR_PROCESSOR_STATIC_INFO_VALID Valid; - UCHAR MinState[ /* SAL Specs, July 2000 and Jan 2001 state approximatively: */ 1024]; - ULONGLONG BR [ 8 ]; - ULONGLONG CR [ /* SAL Specs, July 2000 states that it is processor dependent */ 128 ]; - ULONGLONG AR [ /* SAL Specs, July 2000 states that it is processor dependent */ 128 ]; - ULONGLONG RR [ 8 ]; - ULONGLONG FR [ 2 * 128 ]; -} ERROR_PROCESSOR_STATIC_INFO, *PERROR_PROCESSOR_STATIC_INFO; - -typedef struct _ERROR_PROCESSOR { - ERROR_SECTION_HEADER Header; - ERROR_PROCESSOR_VALID Valid; - ERROR_PROCESSOR_ERROR_MAP ErrorMap; - ERROR_PROCESSOR_STATE_PARAMETER StateParameter; - PROCESSOR_LOCAL_ID CRLid; -#if 0 -// The presence of the following data depends on the valid bits -// from ERROR_PROCESSOR.Valid. -// - ERROR_MODINFO CacheErrorInfo [ /* Valid.CacheCheckNum */ ]; // 0->15 cache error modinfo structs. - ERROR_MODINFO TlbErrorInfo [ /* Valid.TlbCheckNum */ ]; // 0->15 tlb error modinfo structs. - ERROR_MODINFO BusErrorInfo [ /* Valid.BusCheckNum */ ]; // 0->15 bus error modinfo structs. - ERROR_MODINFO RegFileCheckInfo [ /* Valid.RegFileCheckNum */ ]; // 0->15 registers file errors. - ERROR_MODINFO MsCheckInfo [ /* Valid.MsCheckNum */ ]; // 0->15 registers file errors. - ERROR_PROCESSOR_CPUID_INFO CpuIdInfo; // field will always be there but could be zero-padded. - ERROR_PROCESSOR_STATIC_INFO StaticInfo; // field will always be there but could be zero-padded. -#endif // 0 -} ERROR_PROCESSOR, *PERROR_PROCESSOR; - -// -// IA64 ERROR PROCESSOR State Parameter - GR18 - definitions. -// - -#define ERROR_PROCESSOR_STATE_PARAMETER_CACHE_CHECK_SHIFT 59 -#define ERROR_PROCESSOR_STATE_PARAMETER_CACHE_CHECK_MASK 0x1 -#define ERROR_PROCESSOR_STATE_PARAMETER_TLB_CHECK_SHIFT 60 -#define ERROR_PROCESSOR_STATE_PARAMETER_TLB_CHECK_MASK 0x1 -#define ERROR_PROCESSOR_STATE_PARAMETER_BUS_CHECK_SHIFT 61 -#define ERROR_PROCESSOR_STATE_PARAMETER_BUS_CHECK_MASK 0x1 -#define ERROR_PROCESSOR_STATE_PARAMETER_REG_CHECK_SHIFT 62 -#define ERROR_PROCESSOR_STATE_PARAMETER_REG_CHECK_MASK 0x1 -#define ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_SHIFT 63 -#define ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_MASK 0x1 - -// -// For legacy consumers -// -#define ERROR_PROCESSOR_STATE_PARAMETER_UNKNOWN_CHECK_SHIFT ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_SHIFT -#define ERROR_PROCESSOR_STATE_PARAMETER_UNKNOWN_CHECK_MASK ERROR_PROCESSOR_STATE_PARAMETER_MICROARCH_CHECK_MASK - -//////////////////////////////////////////////////////////////////// -// -// IA64 PLATFORM ERRORS Definitions -// -// We tried to respect the order in which these error devices are -// presented in the SAL specs. - -// -// IA64 ERRORS: _ERR_TYPE definitions -// -// Warning 04/01/01: "ERR_TYPE" or "ERROR_TYPE" are already used in the NT namespace. -// - -typedef enum _ERR_TYPES { -// Generic error types: - ERR_INTERNAL = 1, // Error detected internal to the component - ERR_BUS = 16, // Error detected in the bus -// Detailed Internal Error Types: - ERR_MEM = 4, // Storage error in memory (DRAM) - ERR_TLB = 5, // Storage error in TLB - ERR_CACHE = 6, // Storage error in cache - ERR_FUNCTION = 7, // Error in one or more functional units - ERR_SELFTEST = 8, // Component failed self test - ERR_FLOW = 9, // Overflow or Undervalue of internal queue -// Detailed Bus Error Types: - ERR_MAP = 17, // Virtual address not found on IO-TLB or IO-PDIR - ERR_IMPROPER = 18, // Improper access error - ERR_UNIMPL = 19, // Access to a memory address which is not mapped to any component - ERR_LOL = 20, // Loss Of Lockstep - ERR_RESPONSE = 21, // Response to which there is no associated request - ERR_PARITY = 22, // Bus parity error - ERR_PROTOCOL = 23, // Detection of a protocol error - ERR_ERROR = 24, // Detection of PATH_ERROR - ERR_TIMEOUT = 25, // Bus operation time-out - ERR_POISONED = 26, // A read was issued to data which has been poisoned -} _ERR_TYPE; - -// -// IA64 ERRORS: ERROR_STATUS definitions -// - -typedef union _ERROR_STATUS { - ULONGLONG Status; - struct { // Bits: - ULONGLONG Reserved0:8; // 7-0: Reserved - ULONGLONG Type:8; // 15-8: Error Type - See _ERR_TYPE definitions. - ULONGLONG Address:1; // 16: Error was detected on address signals or on address portion of transaction - ULONGLONG Control:1; // 17: Error was detected on control signals or in control portion of transaction - ULONGLONG Data:1; // 18: Error was detected on data signals or in data portion of transaction - ULONGLONG Responder:1; // 19: Error was detected by responder of transaction - ULONGLONG Requestor:1; // 20: Error was detected by requestor of transaction - ULONGLONG FirstError:1; // 21: If multiple errors, this is the first error of the highest severity that occurred - ULONGLONG Overflow:1; // 22: Additional errors occurred which were not logged because registers overflow - ULONGLONG Reserved1:41; // 63-23: Reserved - } DUMMYSTRUCTNAME; -} ERROR_STATUS, *PERROR_STATUS; - -// -// IA64 ERRORS: Platform OEM_DATA definitions -// - -typedef struct _ERROR_OEM_DATA { - USHORT Length; -#if 0 - UCHAR Data[/* ERROR_OEM_DATA.Length */]; -#endif // 0 -} ERROR_OEM_DATA, *PERROR_OEM_DATA; - -// -// IA64 ERRORS: Platform BUS_SPECIFIC_DATA definitions -// - -typedef union _ERROR_BUS_SPECIFIC_DATA { - ULONGLONG BusSpecificData; - struct { // Bits : - ULONGLONG LockAsserted:1; // 0: LOCK# Asserted during request phase - ULONGLONG DeferLogged:1; // 1: Defer phase is logged - ULONGLONG IOQEmpty:1; // 2: IOQ is empty - ULONGLONG DeferredTransaction:1; // 3: Component interface deferred transaction - ULONGLONG RetriedTransaction:1; // 4: Component interface retried transaction - ULONGLONG MemoryClaimedTransaction:1; // 5: memory claimed the transaction - ULONGLONG IOClaimedTransaction:1; // 6: IO controller claimed the transaction - ULONGLONG ResponseParitySignal:1; // 7: Response parity signal - ULONGLONG DeferSignal:1; // 8: DEFER# signal - ULONGLONG HitMSignal:1; // 9: HITM# signal - ULONGLONG HitSignal:1; // 10: HIT# signal - ULONGLONG RequestBusFirstCycle:6; // 16-11: First cycle of request bus - ULONGLONG RequestBusSecondCycle:6; // 22-17: Second cycle of request bus - ULONGLONG AddressParityBusFirstCycle:2; // 24-23: First cycle of address parity bus - ULONGLONG AddressParityBusSecondCycle:2; // 26-25: Second cycle of address parity - ULONGLONG ResponseBus:3; // 29-27: Response bus - ULONGLONG RequestParitySignalFirstCycle:1; // 30: First cycle of request parity signal - ULONGLONG RequestParitySignalSecondCycle:1; // 31: Second cycle of request parity signal - ULONGLONG Reserved:32; // 63-32: Reserved - } DUMMYSTRUCTNAME; -} ERROR_BUS_SPECIFIC_DATA, *PERROR_BUS_SPECIFIC_DATA; - -// -// IA64 ERRORS: Platform ERROR_MEMORY device definitions -// -// With reference to the ACPI Memory Device. -// - -#define ERROR_MEMORY_GUID \ - { 0xe429faf2, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_MEMORY_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG PhysicalAddress:1; // 1: Physical Address valid bit - ULONGLONG AddressMask:1; // 2: Address Mask bit - ULONGLONG Node:1; // 3: Node valid bit - ULONGLONG Card:1; // 4: Card valid bit - ULONGLONG Module:1; // 5: Module valid bit - ULONGLONG Bank:1; // 6: Bank valid bit - ULONGLONG Device:1; // 7: Device valid bit - ULONGLONG Row:1; // 8: Row valid bit - ULONGLONG Column:1; // 9: Column valid bit - ULONGLONG BitPosition:1; // 10: Bit Position valid bit - ULONGLONG RequestorId:1; // 11: Platform Requestor Id valid bit - ULONGLONG ResponderId:1; // 12: Platform Respinder Id valid bit - ULONGLONG TargetId:1; // 13: Platform Target Id valid bit - ULONGLONG BusSpecificData:1; // 14: Platform Bus specific data valid bit - ULONGLONG OemId:1; // 15: Platform OEM id valid bit - ULONGLONG OemData:1; // 16: Platform OEM data valid bit - ULONGLONG Reserved:47; // 63-17: Reserved - } DUMMYSTRUCTNAME; -} ERROR_MEMORY_VALID, *PERROR_MEMORY_VALID; - -typedef struct _ERROR_MEMORY { - ERROR_SECTION_HEADER Header; - ERROR_MEMORY_VALID Valid; - ERROR_STATUS ErrorStatus; // Memory device error status fields - See ERROR_STATUS defs. - ULONGLONG PhysicalAddress; // Physical Address of the memory error - ULONGLONG PhysicalAddressMask; // Valid bits for Physical Address - USHORT Node; // Node identifier in a multi-node system - USHORT Card; // Card number of the memory error location - USHORT Module; // Module number of the memory error location - USHORT Bank; // Bank number of the memory error location - USHORT Device; // Device number of the memory error location - USHORT Row; // Row number of the memory error location - USHORT Column; // Column number of the memory error location - USHORT BitPosition; // Bit within the word that is in error - ULONGLONG RequestorId; // Hardware address of the device or component initiating transaction - ULONGLONG ResponderId; // Hardware address of the responder to transaction - ULONGLONG TargetId; // Hardware address of intended target of transaction - ULONGLONG BusSpecificData; // Bus dependent data of the on-board processor. It is a OEM specific field. - UCHAR OemId[16]; // OEM defined identification for memory controller - ERROR_OEM_DATA OemData; // OEM platform specific data. -} ERROR_MEMORY, *PERROR_MEMORY; - -// -// IA64 ERRORS: Platform ERROR_PCI_BUS device definitions -// -// With reference to the PCI Specifications. -// - -#define ERROR_PCI_BUS_GUID \ - { 0xe429faf4, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_PCI_BUS_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG ErrorType:1; // 1: Error Type valid bit - ULONGLONG Id:1; // 2: Identifier valid bit - ULONGLONG Address:1; // 3: Address valid bit - ULONGLONG Data:1; // 4: Data valid bit - ULONGLONG CmdType:1; // 5: Command Type valid bit - ULONGLONG RequestorId:1; // 6: Requestor Identifier valid bit - ULONGLONG ResponderId:1; // 7: Responder Identifier valid bit - ULONGLONG TargetId:1; // 8: Target Identifer valid bit - ULONGLONG OemId:1; // 9: OEM Identification valid bit - ULONGLONG OemData:1; // 10: OEM Data valid bit - ULONGLONG Reserved:53; // 11-63: Reserved - } DUMMYSTRUCTNAME; -} ERROR_PCI_BUS_VALID, *PERROR_PCI_BUS_VALID; - -typedef struct _ERROR_PCI_BUS_TYPE { - UCHAR Type; - UCHAR Reserved; -} ERROR_PCI_BUS_TYPE, *PERROR_PCI_BUS_TYPE; - -#define PciBusUnknownError ((UCHAR)0) -#define PciBusDataParityError ((UCHAR)1) -#define PciBusSystemError ((UCHAR)2) -#define PciBusMasterAbort ((UCHAR)3) -#define PciBusTimeOut ((UCHAR)4) -#define PciMasterDataParityError ((UCHAR)5) -#define PciAddressParityError ((UCHAR)6) -#define PciCommandParityError ((UCHAR)7) -// PciOtherErrors Reserved - -typedef struct _ERROR_PCI_BUS_ID { - UCHAR BusNumber; // Bus Number - UCHAR SegmentNumber; // Segment Number -} ERROR_PCI_BUS_ID, *PERROR_PCI_BUS_ID; - -typedef struct _ERROR_PCI_BUS { - ERROR_SECTION_HEADER Header; - ERROR_PCI_BUS_VALID Valid; - ERROR_STATUS ErrorStatus; // PCI Bus Error Status - See ERROR_STATUS definitions. - ERROR_PCI_BUS_TYPE Type; // PCI Bus Error Type - ERROR_PCI_BUS_ID Id; // PCI Bus Identifier - UCHAR Reserved[4]; // Reserved - ULONGLONG Address; // Memory or IO Address on the PCI bus at - // the time of the event - ULONGLONG Data; // Data on the PCI bus at time of the event - ULONGLONG CmdType; // Bus Command or Operation at time of the event - ULONGLONG RequestorId; // Bus Requestor Identifier at time of the event - ULONGLONG ResponderId; // Bus Responder Identifier at time of the event - ULONGLONG TargetId; // Intended Bus Target Identifier at time of the event - UCHAR OemId[16]; // OEM defined identification for pci bus - ERROR_OEM_DATA OemData; // OEM specific data. -} ERROR_PCI_BUS, *PERROR_PCI_BUS; - -// -// IA64 ERRORS: Platform ERROR_PCI_COMPONENT device definitions -// -// With reference to the PCI Specifications. -// - -#define ERROR_PCI_COMPONENT_GUID \ - { 0xe429faf6, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_PCI_COMPONENT_VALID { - ULONGLONG Valid; - struct { // Bits: - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG Info:1; // 1: Information valid bit - ULONGLONG MemoryMappedRegistersPairs:1; // 2: Number of Memory Mapped Registers Pairs valid bit - ULONGLONG ProgrammedIORegistersPairs:1; // 3: Number of Programmed IO Registers Pairs valid bit - ULONGLONG RegistersDataPairs:1; // 4: Memory Mapped Registers Pairs valid bit - ULONGLONG OemData:1; // 5: OEM Data valid bit. - ULONGLONG Reserved:58; // 63-6: Reserved - } DUMMYSTRUCTNAME; -} ERROR_PCI_COMPONENT_VALID, *PERROR_PCI_COMPONENT_VALID; - -typedef struct _ERROR_PCI_COMPONENT_INFO { // Bytes: - USHORT VendorId; // 0-1: Vendor Identifier - USHORT DeviceId; // 2-3: Device Identifier - UCHAR ClassCodeInterface; // 4: Class Code.Interface field - UCHAR ClassCodeSubClass; // 5: Class Code.SubClass field - UCHAR ClassCodeBaseClass; // 6: Class Code.BaseClass field - UCHAR FunctionNumber; // 7: Function Number - UCHAR DeviceNumber; // 8: Device Number - UCHAR BusNumber; // 9: Bus Number - UCHAR SegmentNumber; // 10: Segment Number - UCHAR Reserved0; - ULONG Reserved1; -} ERROR_PCI_COMPONENT_INFO, *PERROR_PCI_COMPONENT_INFO; - -typedef struct _ERROR_PCI_COMPONENT { - ERROR_SECTION_HEADER Header; - ERROR_PCI_COMPONENT_VALID Valid; - ERROR_STATUS ErrorStatus; // Component Error Status - ERROR_PCI_COMPONENT_INFO Info; // Component Information - ULONG MemoryMappedRegistersPairs; // Number of Memory Mapped Registers Pairs - ULONG ProgrammedIORegistersPairs; // Number of Programmed IO Registers Pairs -#if 0 - ULONGLONG RegistersPairs[/* 2 * (MemoryMappedRegistersPairs + ProgrammedIORegistersPairs) */]; - ERROR_OEM_DATA OemData; -#endif // 0 - } ERROR_PCI_COMPONENT, *PERROR_PCI_COMPONENT; - -// -// IA64 ERRORS: Platform ERROR_SYSTEM_EVENT_LOG device definitions -// -// With reference to the IPMI System Event Log. -// - -#define ERROR_SYSTEM_EVENT_LOG_GUID \ - { 0xe429faf3, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_SYSTEM_EVENT_LOG_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG RecordId:1; // 0: Record Identifier valid bit - ULONGLONG RecordType:1; // 1: Record Type valid bit - ULONGLONG GeneratorId:1; // 2: Generator Identifier valid bit - ULONGLONG EVMRev:1; // 3: Event Format Revision valid bit - ULONGLONG SensorType:1; // 4: Sensor Type valid bit - ULONGLONG SensorNum:1; // 5: Sensor Number valid bit - ULONGLONG EventDirType:1; // 6: Event Dir valid bit - ULONGLONG EventData1:1; // 7: Event Data1 valid bit - ULONGLONG EventData2:1; // 8: Event Data2 valid bit - ULONGLONG EventData3:1; // 9: Event Data3 valid bit - ULONGLONG Reserved:54; // 10-63: - } DUMMYSTRUCTNAME; -} ERROR_SYSTEM_EVENT_LOG_VALID, *PSYSTEM_EVENT_LOG_VALID; - -typedef struct _ERROR_SYSTEM_EVENT_LOG { - ERROR_SECTION_HEADER Header; - ERROR_SYSTEM_EVENT_LOG_VALID Valid; - USHORT RecordId; // Record Identifier used for SEL record access - UCHAR RecordType; // Record Type: - // 0x02 - System Event Record - // 0xC0 - 0xDF OEM time stamped, bytes 8-16 OEM defined - // 0xE0 - 0xFF OEM non-time stamped, bytes 4-16 OEM defined - ULONG TimeStamp; // Time stamp of the event log - USHORT GeneratorId; // Software ID if event was generated by software - // Byte 1: - // Bit 0 - set to 1 when using system software - // Bit 7:1 - 7-bit system ID - // Byte 2: - // Bit 1:0 - IPMB device LUN if byte 1 holds slave - // address, 0x0 otherwise - // Bit 7:2 - Reserved. - UCHAR EVMRevision; // Error message format version - UCHAR SensorType; // Sensor Type code of the sensor that generated event - UCHAR SensorNumber; // Number of the sensor that generated event - UCHAR EventDir; // Event Dir - // Bit 7 - 0: asserted, 1: desasserted - // Event Type - // Bit 6:0 - Event Type code - UCHAR Data1; // Event data field - UCHAR Data2; // Event data field - UCHAR Data3; // Event data field -} ERROR_SYSTEM_EVENT_LOG, *PERROR_SYSTEM_EVENT_LOG; - -// -// IA64 ERRORS: Platform ERROR_SMBIOS device definitions -// -// With reference to the SMBIOS Specifications. -// - -#define ERROR_SMBIOS_GUID \ - { 0xe429faf5, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_SMBIOS_VALID { - ULONGLONG Valid; - struct { // Bits - ULONGLONG EventType:1; // 0: Event Type valid bit - ULONGLONG Length:1; // 1: Length valid bit - ULONGLONG TimeStamp:1; // 2: Time Stamp valid bit - ULONGLONG OemData:1; // 3: Data valid bit - ULONGLONG Reserved:60; // 4-63: - } DUMMYSTRUCTNAME; -} ERROR_SMBIOS_VALID, *PERROR_SMBIOS_VALID; - -// -// ERROR_SMBIOS.Type definitions -// - -typedef UCHAR ERROR_SMBIOS_EVENT_TYPE, *PERROR_SMBIOS_EVENT_TYPE; -// enum values defined in SMBIOS 2.3 - 3.3.16.6.1 - -typedef struct _ERROR_SMBIOS { - ERROR_SECTION_HEADER Header; - ERROR_SMBIOS_VALID Valid; - ERROR_SMBIOS_EVENT_TYPE EventType; // Event Type - UCHAR Length; // Length of the error information in bytes - ERROR_TIMESTAMP TimeStamp; // Event Time Stamp - ERROR_OEM_DATA OemData; // Optional data validated by SMBIOS.Valid.Data. -} ERROR_SMBIOS, *PERROR_SMBIOS; - -// -// IA64 ERRORS: Platform Specific error device definitions -// - -#define ERROR_PLATFORM_SPECIFIC_GUID \ - { 0xe429faf7, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_PLATFORM_SPECIFIC_VALID { - ULONGLONG Valid; - struct { // Bits: - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG RequestorId:1; // 1: Requestor Identifier valid bit - ULONGLONG ResponderId:1; // 2: Responder Identifier valid bit - ULONGLONG TargetId:1; // 3: Target Identifier valid bit - ULONGLONG BusSpecificData:1; // 4: Bus Specific Data valid bit - ULONGLONG OemId:1; // 5: OEM Identification valid bit - ULONGLONG OemData:1; // 6: OEM Data valid bit - ULONGLONG OemDevicePath:1; // 7: OEM Device Path valid bit - ULONGLONG Reserved:56; // 63-8: Reserved - } DUMMYSTRUCTNAME; -} ERROR_PLATFORM_SPECIFIC_VALID, *PERROR_PLATFORM_SPECIFIC_VALID; - -typedef struct _ERROR_PLATFORM_SPECIFIC { - ERROR_SECTION_HEADER Header; - ERROR_PLATFORM_SPECIFIC_VALID Valid; - ERROR_STATUS ErrorStatus; // Platform Generic Error Status - ULONGLONG RequestorId; // Bus Requestor ID at the time of the event - ULONGLONG ResponderId; // Bus Responder ID at the time of the event - ULONGLONG TargetId; // Bus intended Target ID at the time of the event - ERROR_BUS_SPECIFIC_DATA BusSpecificData; // OEM specific Bus dependent data - UCHAR OemId[16]; // OEM specific data for bus identification - ERROR_OEM_DATA OemData; // OEM specific data -#if 0 - UCHAR OemDevicePath[/* 16 ? */]; // OEM specific vendor device path. -#endif // 0 - } ERROR_PLATFORM_SPECIFIC, *PERROR_PLATFORM_SPECIFIC; - -// -// IA64 ERRORS: Platform Bus error device definitions -// - -#define ERROR_PLATFORM_BUS_GUID \ - { 0xe429faf9, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - -typedef union _ERROR_PLATFORM_BUS_VALID { - ULONGLONG Valid; - struct { // Bits: - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG RequestorId:1; // 1: Requestor Identifier valid bit - ULONGLONG ResponderId:1; // 2: Responder Identifier valid bit - ULONGLONG TargetId:1; // 3: Target Identifier valid bit - ULONGLONG BusSpecificData:1; // 4: Bus Specific Data valid bit - ULONGLONG OemId:1; // 5: OEM Identification valid bit - ULONGLONG OemData:1; // 6: OEM Data valid bit - ULONGLONG OemDevicePath:1; // 7: OEM Device Path valid bit - ULONGLONG Reserved:56; // 63-8: Reserved - } DUMMYSTRUCTNAME; -} ERROR_PLATFORM_BUS_VALID, *PERROR_PLATFORM_BUS_VALID; - -typedef struct _ERROR_PLATFORM_BUS { - ERROR_SECTION_HEADER Header; - ERROR_PLATFORM_BUS_VALID Valid; - ERROR_STATUS ErrorStatus; // Bus Error Status - ULONGLONG RequestorId; // Bus Requestor ID at the time of the event - ULONGLONG ResponderId; // Bus Responder ID at the time of the event - ULONGLONG TargetId; // Bus intended Target ID at the time of the event - ERROR_BUS_SPECIFIC_DATA BusSpecificData; // OEM specific Bus dependent data - UCHAR OemId[16]; // OEM specific data for bus identification - ERROR_OEM_DATA OemData; // OEM specific data -#if 0 - UCHAR OemDevicePath[/* 16 ? */]; // OEM specific vendor device path. -#endif // 0 - } ERROR_PLATFORM_BUS, *PERROR_PLATFORM_BUS; - -// -// IA64 ERRORS: Platform Host Controller error device definitions -// - -#define ERROR_PLATFORM_HOST_CONTROLLER_GUID \ - { 0xe429faf8, 0x3cb7, 0x11d4, { 0xbc, 0xa7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 }} - - -typedef union _ERROR_PLATFORM_HOST_CONTROLLER_VALID { - ULONGLONG Valid; - struct { // Bits: - ULONGLONG ErrorStatus:1; // 0: Error Status valid bit - ULONGLONG RequestorId:1; // 1: Requestor Identifier valid bit - ULONGLONG ResponderId:1; // 2: Responder Identifier valid bit - ULONGLONG TargetId:1; // 3: Target Identifier valid bit - ULONGLONG BusSpecificData:1; // 4: Bus Specific Data valid bit - ULONGLONG OemId:1; // 5: OEM Identification valid bit - ULONGLONG OemData:1; // 6: OEM Data valid bit - ULONGLONG OemDevicePath:1; // 7: OEM Device Path valid bit - ULONGLONG Reserved:56; // 63-8: Reserved - } DUMMYSTRUCTNAME; -} ERROR_PLATFORM_HOST_CONTROLLER_VALID, *PERROR_PLATFORM_HOST_CONTROLLER_VALID; - -typedef struct _ERROR_PLATFORM_HOST_CONTROLLER { - ERROR_SECTION_HEADER Header; - ERROR_PCI_COMPONENT_VALID Valid; - ERROR_STATUS ErrorStatus; // Host Controller Error Status - ULONGLONG RequestorId; // Host controller Requestor ID at the time of the event - ULONGLONG ResponderId; // Host controller Responder ID at the time of the event - ULONGLONG TargetId; // Host controller intended Target ID at the time of the event - ERROR_BUS_SPECIFIC_DATA BusSpecificData; // OEM specific Bus dependent data - UCHAR OemId[16]; // OEM specific data for bus identification - ERROR_OEM_DATA OemData; // OEM specific data -#if 0 - UCHAR OemDevicePath[/* 16 ? */]; // OEM specific vendor device path. -#endif // 0 -} ERROR_PLATFORM_HOST_CONTROLLER, *PERROR_PLATFORM_HOST_CONTROLLER; - -// -// IA64 ERROR_LOGRECORDS definitions -// -// MCA_EXCEPTION, -// CMC_EXCEPTION, -// CPE_EXCEPTION. -// - -// For compatibility with previous versions of the definitions: -typedef ERROR_RECORD_HEADER ERROR_LOGRECORD, *PERROR_LOGRECORD; - -typedef ERROR_RECORD_HEADER MCA_EXCEPTION, *PMCA_EXCEPTION; // Machine Check Abort -typedef ERROR_RECORD_HEADER CMC_EXCEPTION, *PCMC_EXCEPTION; // Corrected Machine Check -typedef ERROR_RECORD_HEADER CPE_EXCEPTION, *PCPE_EXCEPTION; // Corrected Platform Error -#if (NTDDI_VERSION > NTDDI_WINXP) -typedef ERROR_RECORD_HEADER INIT_EXCEPTION, *PINIT_EXCEPTION; // Init Event -#endif - -#endif // _IA64_ - -#endif // defined(_X86_) || defined(_IA64_) || defined(_AMD64_) - -#endif // _MCE_ - - diff --git a/qt-correction-tool/pub/ddk/messagedeviceservice.h b/qt-correction-tool/pub/ddk/messagedeviceservice.h deleted file mode 100644 index 1b41379..0000000 --- a/qt-correction-tool/pub/ddk/messagedeviceservice.h +++ /dev/null @@ -1,398 +0,0 @@ -/* - * MessageDeviceService.h - * - * Contains declarations for the Message Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _MESSAGEDEVICESERVICE_H_ -#define _MESSAGEDEVICESERVICE_H_ - -#include - -/*****************************************************************************/ -/* Message Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Message, - 0x29b43bd0, 0x6b16, 0x49af, 0xb7, 0x2e, 0x85, 0x77, 0x0a, 0xdf, 0xeb, 0xdd); - -#define NAME_MessageSvc L"Message" -#define TYPE_MessageSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Message Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AbstractMessage - * - * MTP Format: Abstract Message (0xBB01) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractMessage, - 0xBB010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractMessage L"AbstractMessage" - - -/* FORMAT_AbstractMessageFolder - * - * MTP Format: Abstract Message Folder (0xBA07) - * Suggested MIME Type: - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractMessageFolder, - 0xBA070000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7); - -#define NAME_AbstractMessageFolder L"AbstractMessageFolder" - - -/*****************************************************************************/ -/* Message Service Object Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(MESSAGESVC_OBJECT_PROPERTIES, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F); - - -/* MessageObj.Subject - * - * MTP Property: Subject (0xDCE2) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Subject, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 2); - -#define NAME_MessageObj_Subject L"Subject" - - -/* MessageObj.Body - * - * MTP Property: Body Text (0xDCE1) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Body, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 3); - -#define NAME_MessageObj_Body L"Body" - - -/* MessageObj.Priority - * - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Priority, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 4); - -#define NAME_MessageObj_Priority L"Priority" - -#define ENUM_MessageObj_PriorityHighest 2 -#define ENUM_MessageObj_PriorityNormal 1 -#define ENUM_MessageObj_PriorityLowest 0 - - -/* MessageObj.Category - * - * MTP Property: () - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Category, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 10); - -#define NAME_MessageObj_Category L"Category" - - -/* MessageObj.Sender - * - * MTP Property: Message Sender (0xDD45) - * Type: String/AUInt16 - * Form: None/LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Sender, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 18); - -#define NAME_MessageObj_Sender L"Sender" - - -/* MessageObj.To - * - * MTP Property: Message To (0xDD40) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_To, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 20); - -#define NAME_MessageObj_To L"To" - - -/* MessageObj.CC - * - * MTP Property: Message CC (0xDD41) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_CC, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 21); - -#define NAME_MessageObj_CC L"CC" - - -/* MessageObj.BCC - * - * MTP Property: Message BCC (0xDD42) - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_BCC, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 22); - -#define NAME_MessageObj_BCC L"BCC" - - -/* MessageObj.Read - * - * MTP Property: Message Read (0xDD43) - * Type: UInt16 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_Read, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 23); - -#define NAME_MessageObj_Read L"Read" - -#define ENUM_MessageObj_ReadFalse 0x00 -#define ENUM_MessageObj_ReadTrue 0xff - - -/* MessageObj.ReceivedTime - * - * MTP Property: Message Received Time (0xDD44) - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_ReceivedTime, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 24); - -#define NAME_MessageObj_ReceivedTime L"ReceivedTime" - - -/* MessageObj.PatternOriginalDateTime - * - * Contains the original UTC time that a recurring item was to take place. - * - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternOriginalDateTime, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 26); - -#define NAME_MessageObj_PatternOriginalDateTime L"PatternOriginalDateTime" - - -/* MessageObj.PatternType - * - * Contains the pattern type of the recurring item. - * - * Type: UInt32 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternType, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 27); - -#define NAME_MessageObj_PatternType L"PatternType" - -#define ENUM_MessageObj_PatternTypeDaily 0x00000001 -#define ENUM_MessageObj_PatternTypeWeekly 0x00000002 -#define ENUM_MessageObj_PatternTypeMonthly 0x00000003 -#define ENUM_MessageObj_PatternTypeYearly 0x00000004 - - -/* MessageObj.PatternValidStartDate - * - * Contains the first date on which the recurrence pattern is valid. The - * first instance of the recurring item is on or after this date. The date - * is in the time reference of the recurring item. - * - * Type: String - * Form: ISO 8601 Date - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternValidStartDate, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 28); - -#define NAME_MessageObj_PatternValidStartDate L"PatternValidStartDate" - - -/* MessageObj.PatternValidEndDate - * - * Contains the last date on which the recurrence pattern is valid. The - * last instance of the recurring item is on or before this date. The date - * is in the time reference of the recurring item. - * - * Type: String - * Form: ISO 8601 Date - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternValidEndDate, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 29); - -#define NAME_MessageObj_PatternValidEndDate L"PatternValidEndDate" - - -/* MessageObj.PatternPeriod - * - * Contains the period of the repeating recurrence pattern. The units of this - * property are determined by the value of MessageObj.PatternType. - * - * Type: UInt32 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternPeriod, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 31); - -#define NAME_MessageObj_PatternPeriod L"PatternPeriod" - - -/* MessageObj.PatternDayOfWeek - * - * Contains the day of week mask for weekly, monthly, and yearly recurrence - * patterns. - * - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternDayOfWeek, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 32); - -#define NAME_MessageObj_PatternDayOfWeek L"PatternDayOfWeek" - -#define FLAG_MessageObj_DayOfWeekNone 0x0000 -#define FLAG_MessageObj_DayOfWeekSunday 0x0001 -#define FLAG_MessageObj_DayOfWeekMonday 0x0002 -#define FLAG_MessageObj_DayOfWeekTuesday 0x0004 -#define FLAG_MessageObj_DayOfWeekWednesday 0x0008 -#define FLAG_MessageObj_DayOfWeekThursday 0x0010 -#define FLAG_MessageObj_DayOfWeekFriday 0x0020 -#define FLAG_MessageObj_DayOfWeekSaturday 0x0040 - - -/* MessageObj.PatternDayOfMonth - * - * Contains the day of the month for monthly and yearly recurrence patterns. - * If day specified is greater than the number of days in the month the - * value is interpreted as the last valid day of the month. - * - * Type: UInt8 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternDayOfMonth, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 33); - -#define NAME_MessageObj_PatternDayOfMonth L"PatternDayOfMonth" - -#define RANGEMIN_MessageObj_PatternDayOfMonth 1 -#define RANGEMAX_MessageObj_PatternDayOfMonth 31 -#define RANGESTEP_MessageObj_PatternDayOfMonth 1 - -/* MessageObj.PatternMonthOfYear - * - * Contains the month of the year for yearly recurrence patterns. - * - * Type: UInt8 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternMonthOfYear, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 34); - -#define NAME_MessageObj_PatternMonthOfYear L"PatternMonthOfYear" - -#define RANGEMIN_MessageObj_PatternMonthOfYear 1 -#define RANGEMAX_MessageObj_PatternMonthOfYear 12 -#define RANGESTEP_MessageObj_PatternMonthOfYear 1 - - -/* MessageObj.PatternInstance - * - * Contains the instance of the recurring pattern that is to be matched. - * - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternInstance, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 35); - -#define NAME_MessageObj_PatternInstance L"PatternInstance" - -#define ENUM_MessageObj_PatternInstanceNone 0x00 -#define ENUM_MessageObj_PatternInstanceFirst 0x01 -#define ENUM_MessageObj_PatternInstanceSecond 0x02 -#define ENUM_MessageObj_PatternInstanceThird 0x03 -#define ENUM_MessageObj_PatternInstanceFourth 0x04 -#define ENUM_MessageObj_PatternInstanceLast 0x05 - - -/* MessageObj.PatternDeleteDates - * - * Contains a semi-colon separated list of the the dates on which instances - * of the recurring item have been deleted. Does not contain the original - * dates for items which have been moved. The date specified is in the - * time reference of the recurrence. - * - * Type: AUInt16 - * Form: LongString - */ - -DEFINE_DEVSVCPROPKEY(PKEY_MessageObj_PatternDeleteDates, - 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F, - 36); - -#define NAME_MessageObj_PatternDeleteDates L"PatternDeleteDates" - -#endif /* _MESSAGEDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/metadatadeviceservice.h b/qt-correction-tool/pub/ddk/metadatadeviceservice.h deleted file mode 100644 index 3a4f553..0000000 --- a/qt-correction-tool/pub/ddk/metadatadeviceservice.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * MetadataDeviceService.h - * - * Contains definitions of the Device Metadata Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _METADATADEVICESERVICE_H_ -#define _METADATADEVICESERVICE_H_ - -#include - -/*****************************************************************************/ -/* Device Metadata Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_DeviceMetadata, - 0x332ffe6a, 0xaf65, 0x41e1, 0xa0, 0xaf, 0xd3, 0xe2, 0x62, 0x7b, 0xdf, 0x54); - -#define NAME_DeviceMetadataSvc L"Metadata" -#define TYPE_DeviceMetadataSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Device Metadata Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_DeviceMetadataCAB - * - * CAB object format - */ - -DEFINE_DEVSVCGUID(FORMAT_DeviceMetadataCAB, - 0xe1809599, 0x4303, 0x4e3b, 0x92, 0x44, 0x99, 0xc6, 0x2c, 0x25, 0x45, 0x51); - -#define NAME_DeviceMetadataCAB L"DeviceMetadataCAB" - - -/*****************************************************************************/ -/* Device Metadata Service Object Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_DeviceMetadataObj, - 0x68bb7eeb, 0x9eef, 0x45bd, 0x8d, 0xe6, 0x3b, 0x92, 0xa5, 0x7c, 0xae, 0x1e); - - -/* PKEY_DeviceMetadataObj_ContentID - * - * Contains the GUID that uniquely identifies the object cab contents. - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_DeviceMetadataObj_ContentID, - 0x68bb7eeb, 0x9eef, 0x45bd, 0x8d, 0xe6, 0x3b, 0x92, 0xa5, 0x7c, 0xae, 0x1e, - 3); - -#define NAME_DeviceMetadataObj_ContentID L"ContentID" - - -/* PKEY_DeviceMetadataObj_DefaultCAB - * - * Indicates whether this object is the default cab. Each service shall have - * only one object marked as default. - * - * Type: UInt8 Boolean - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_DeviceMetadataObj_DefaultCAB, - 0x68bb7eeb, 0x9eef, 0x45bd, 0x8d, 0xe6, 0x3b, 0x92, 0xa5, 0x7c, 0xae, 0x1e, - 4); - -#define NAME_DeviceMetadataObj_DefaultCAB L"DefaultCAB" - -#define ENUM_DeviceMetadataObj_DefaultCABFalse 0 -#define ENUM_DeviceMetadataObj_DefaultCABTrue 1 - -#endif /* _METADATADEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/mf.h b/qt-correction-tool/pub/ddk/mf.h deleted file mode 100644 index 809a454..0000000 --- a/qt-correction-tool/pub/ddk/mf.h +++ /dev/null @@ -1,161 +0,0 @@ -/*++ - -Copyright (c) 1997 Microsoft Corporation - -Module Name: - - mf.h - -Abstract: - - This header describes the structures and interfaces required to interact - with the multifunction enumerator. - -Author: - -Revision History: - ---*/ - - -#if !defined(_MF_) -#define _MF_ - -// -// MfFlags value -// - -#define MF_FLAGS_EVEN_IF_NO_RESOURCE 0x00000001 -#define MF_FLAGS_NO_CREATE_IF_NO_RESOURCE 0x00000002 -#define MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE 0x00000004 -#define MF_FLAGS_CREATE_BUT_NO_SHOW_DISABLED 0x00000008 - -typedef struct _MF_RESOURCE_MAP { - - ULONG Count; - UCHAR Resources[ANYSIZE_ARRAY]; - -} MF_RESOURCE_MAP, *PMF_RESOURCE_MAP; - - -typedef struct _MF_VARYING_RESOURCE_ENTRY { - - UCHAR ResourceIndex; - UCHAR Reserved[3]; // Packing - ULONG Offset; - ULONG Size; - ULONG MaxCount; - -} MF_VARYING_RESOURCE_ENTRY, *PMF_VARYING_RESOURCE_ENTRY; - - -typedef struct _MF_VARYING_RESOURCE_MAP { - - ULONG Count; - MF_VARYING_RESOURCE_ENTRY Resources[ANYSIZE_ARRAY]; - -} MF_VARYING_RESOURCE_MAP, *PMF_VARYING_RESOURCE_MAP; - - -typedef struct _MF_DEVICE_INFO *PMF_DEVICE_INFO; - -typedef struct _MF_DEVICE_INFO { - - // - // Name for this child, unique with respect to the other children - // - UNICODE_STRING Name; - - // - // A REG_MULTI_SZ style list of hardware IDs - // - UNICODE_STRING HardwareID; - - // - // A REG_MULTI_SZ style list of compatible IDs - // - UNICODE_STRING CompatibleID; - - // - // Map of resource that we totally consume - // - PMF_RESOURCE_MAP ResourceMap; - - // - // Map of resource that we partially consume - // - PMF_VARYING_RESOURCE_MAP VaryingResourceMap; - - // - // Flags - - // MF_FLAGS_FILL_IN_UNKNOWN_RESOURCE - if the parent resource doesn't - // contain a descriptor referenced in the ResourceMap use a - // null (CmResourceTypeNull) descriptor instead. - // - ULONG MfFlags; - -} MF_DEVICE_INFO; - -typedef -__drv_functionClass(MF_ENUMERATE_CHILD) -NTSTATUS -MF_ENUMERATE_CHILD( - __in_opt PVOID Context, - __in ULONG Index, - __out - __drv_at(ChildInfo->Name.Buffer, __drv_allocatesMem(Mem)) - __drv_at(ChildInfo->HardwareID.Buffer, __drv_allocatesMem(Mem)) - __drv_at(ChildInfo->CompatibleID.Buffer, __drv_allocatesMem(Mem)) - __drv_at(ChildInfo->ResourceMap, __drv_allocatesMem(Mem)) - __drv_at(ChildInfo->VaryingResourceMap, __drv_allocatesMem(Mem)) - PMF_DEVICE_INFO ChildInfo - ); -typedef MF_ENUMERATE_CHILD *PMF_ENUMERATE_CHILD; - -/*++ - - -Routine Description: - - This returns information about children to be enumerated by a multifunction - driver. - -Arguments: - - Context - Context from the MF_ENUMERATION_INTERFACE - - Index - Zero based index of the children - - ChildInfo - Pointer to a caller allocated buffer that should be filled in - by the callee. This will involve allocation of extra buffers for each - piece of information. These will be freed by calling ExFreePool when - they are no longer required. - -Return Value: - - Status code that indicates whether or not the function was successful. - - STATUS_NO_MORE_ENTRIES indicates that the are no more children to enumerate - ---*/ - -typedef struct _MF_ENUMERATION_INTERFACE { - - // - // Generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // Multi-function enumeration data - // - PMF_ENUMERATE_CHILD EnumerateChild; - -} MF_ENUMERATION_INTERFACE, *PMF_ENUMERATION_INTERFACE; - -#endif - diff --git a/qt-correction-tool/pub/ddk/midatlax.h b/qt-correction-tool/pub/ddk/midatlax.h deleted file mode 100644 index 3482ebe..0000000 --- a/qt-correction-tool/pub/ddk/midatlax.h +++ /dev/null @@ -1,122 +0,0 @@ -/*++ BUILD Version: 0009 // Increment this if a change has global effects -Copyright (c) 1987-1993 Microsoft Corporation - -Module Name: - - midatlas.h - -Abstract: - - This module defines the data structure used in mapping MIDS to the corresponding requests/ - contexts associated with them. - -Author: -Notes: - - MID (Multiplex ID) is used at both the server and the client ( redirector ) to distinguish - between the concurrently active requests on any connection. This data structure has been - designed to meet the following criterion. - - 1) It should scale well to handle the differing capabilities of a server, e.g., the typical - NT server permits 50 outstanding requests on any connection. The CORE level servers can go as - low as one and on Gateway machines the desired number can be very high ( in the oreder of thousands) - - 2) The two primary operations that need to be handled well are - i) mapping a MID to the context associated with it. - -- This routine will be invoked to process every packet received along any connection - at both the server and the client. - ii) generating a new MID for sending requests to the server. - -- This will be used at the client both for max. command enforcement as well as - tagging each concurrent request with a unique id. - - The most common case is that of a connection between a NT client and a NT server. All - design decisions have been made in order to ensure that the solutions are optimal - for this case. - - The MID data structure must be efficiently able to manage the unique tagging and identification - of a number of mids ( typically 50 ) from a possible combination of 65536 values. In order to - ensure a proper time space tradeoff the lookup is organized as a three level hierarchy. - - The 16 bits used to represent a MID are split upinto three bit fields. The length of the - rightmost field ( least signifiant ) is decided by the number of mids that are to be - allocated on creation. The remaining length is split up equally between the next two - fields, e.g., if 50 mids are to be allocated on creation , the length of the first field - is 6 ( 64 ( 2 ** 6 ) is greater than 50 ), 5 and 5. - ---*/ - -#ifndef _MIDATLAX_H_ -#define _MIDATLAX_H_ - -// -// Forward declaration -// - -typedef struct _MID_MAP_ *PMID_MAP; - - -typedef struct _RX_MID_ATLAS { - USHORT MaximumNumberOfMids; - USHORT MidsAllocated; - USHORT NumberOfMidsInUse; - USHORT NumberOfMidsDiscarded; - USHORT MaximumMidFieldWidth; - USHORT Reserved; - USHORT MidQuantum; - UCHAR MidQuantumFieldWidth; - UCHAR NumberOfLevels; - LIST_ENTRY MidMapFreeList; - LIST_ENTRY MidMapExpansionList; - PMID_MAP pRootMidMap; -} RX_MID_ATLAS, *PRX_MID_ATLAS; - -typedef -VOID (*PCONTEXT_DESTRUCTOR) ( - PVOID Context - ); - -#define RxGetMaximumNumberOfMids(ATLAS) ((ATLAS)->MaximumNumberOfMids) - -#define RxGetNumberOfMidsInUse(ATLAS) ((ATLAS)->NumberOfMidsInUse) - -PRX_MID_ATLAS -RxCreateMidAtlas ( - USHORT MaximumNumberOfEntries, - USHORT InitialAllocation - ); - -VOID -RxDestroyMidAtlas ( - PRX_MID_ATLAS MidAtlas, - PCONTEXT_DESTRUCTOR ContextDestructor - ); - -PVOID -RxMapMidToContext ( - PRX_MID_ATLAS MidAtlas, - USHORT Mid - ); - -NTSTATUS -RxAssociateContextWithMid ( - PRX_MID_ATLAS MidAtlas, - PVOID Context, - PUSHORT NewMid - ); - -NTSTATUS -RxMapAndDissociateMidFromContext ( - PRX_MID_ATLAS MidAtlas, - USHORT Mid, - PVOID *ContextPointer - ); - -NTSTATUS -RxReassociateMid ( - PRX_MID_ATLAS MidAtlas, - USHORT Mid, - PVOID NewContext - ); - -#endif - diff --git a/qt-correction-tool/pub/ddk/miniport.h b/qt-correction-tool/pub/ddk/miniport.h deleted file mode 100644 index 6bbcda5..0000000 --- a/qt-correction-tool/pub/ddk/miniport.h +++ /dev/null @@ -1,6608 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - miniport.h - -Abstract: - - Type definitions for miniport drivers. - -Revision History: - ---*/ - -#ifndef _MINIPORT_ -#define _MINIPORT_ - -#include "stddef.h" - -#define ASSERT( exp ) - -#ifndef FAR -#define FAR -#endif - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field other than int -#endif -#endif - - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef OPTIONAL -#define OPTIONAL -#endif - -#ifndef NOTHING -#define NOTHING -#endif - -#ifndef CRITICAL -#define CRITICAL -#endif - -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 // winnt -#endif - -// begin_winnt - -// -// For compilers that don't support nameless unions/structs -// -#ifndef DUMMYUNIONNAME -#if defined(NONAMELESSUNION) || !defined(_MSC_EXTENSIONS) -#define DUMMYUNIONNAME u -#define DUMMYUNIONNAME2 u2 -#define DUMMYUNIONNAME3 u3 -#define DUMMYUNIONNAME4 u4 -#define DUMMYUNIONNAME5 u5 -#define DUMMYUNIONNAME6 u6 -#define DUMMYUNIONNAME7 u7 -#define DUMMYUNIONNAME8 u8 -#define DUMMYUNIONNAME9 u9 -#else -#define DUMMYUNIONNAME -#define DUMMYUNIONNAME2 -#define DUMMYUNIONNAME3 -#define DUMMYUNIONNAME4 -#define DUMMYUNIONNAME5 -#define DUMMYUNIONNAME6 -#define DUMMYUNIONNAME7 -#define DUMMYUNIONNAME8 -#define DUMMYUNIONNAME9 -#endif -#endif // DUMMYUNIONNAME - -#ifndef DUMMYSTRUCTNAME -#if defined(NONAMELESSUNION) || !defined(_MSC_EXTENSIONS) -#define DUMMYSTRUCTNAME s -#define DUMMYSTRUCTNAME2 s2 -#define DUMMYSTRUCTNAME3 s3 -#define DUMMYSTRUCTNAME4 s4 -#define DUMMYSTRUCTNAME5 s5 -#else -#define DUMMYSTRUCTNAME -#define DUMMYSTRUCTNAME2 -#define DUMMYSTRUCTNAME3 -#define DUMMYSTRUCTNAME4 -#define DUMMYSTRUCTNAME5 -#endif -#endif // DUMMYSTRUCTNAME - -#include -#include - -#if defined(STRICT_GS_ENABLED) -#pragma strict_gs_check(push, on) -#endif - -#if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED) -#define RESTRICTED_POINTER __restrict -#else -#define RESTRICTED_POINTER -#endif - -#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) -#define ALIGNMENT_MACHINE -#define UNALIGNED __unaligned -#if defined(_WIN64) -#define UNALIGNED64 __unaligned -#else -#define UNALIGNED64 -#endif -#else -#undef ALIGNMENT_MACHINE -#define UNALIGNED -#define UNALIGNED64 -#endif - - -#if defined(_WIN64) || defined(_M_ALPHA) -#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) -#define MEMORY_ALLOCATION_ALIGNMENT 16 -#else -#define MAX_NATURAL_ALIGNMENT sizeof(ULONG) -#define MEMORY_ALLOCATION_ALIGNMENT 8 -#endif - -// -// TYPE_ALIGNMENT will return the alignment requirements of a given type for -// the current platform. -// - -#ifdef __cplusplus -#if _MSC_VER >= 1300 -#define TYPE_ALIGNMENT( t ) __alignof(t) -#endif -#else -#define TYPE_ALIGNMENT( t ) \ - FIELD_OFFSET( struct { char x; t test; }, test ) -#endif - -#if defined(_WIN64) - -#if defined(_AMD64_) -#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( ULONG ) -#elif defined(_IA64_) -#define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( ULONG ) ? \ - TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( ULONG )) -#else -#error "No Target Architecture" -#endif - -#define PROBE_ALIGNMENT32( _s ) TYPE_ALIGNMENT( ULONG ) - -#else - -#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( ULONG ) - -#endif - -// -// C_ASSERT() can be used to perform many compile-time assertions: -// type sizes, field offsets, etc. -// -// An assertion failure results in error C2118: negative subscript. -// - -#ifndef SORTPP_PASS -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#else -#define C_ASSERT(e) /* nothing */ -#endif - -#include - -// end_winnt - -#ifndef CONST -#define CONST const -#endif - -// begin_winnt - -#if (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64)) && !defined(MIDL_PASS) -#define DECLSPEC_IMPORT __declspec(dllimport) -#else -#define DECLSPEC_IMPORT -#endif - -#ifndef DECLSPEC_NORETURN -#if (_MSC_VER >= 1200) && !defined(MIDL_PASS) -#define DECLSPEC_NORETURN __declspec(noreturn) -#else -#define DECLSPEC_NORETURN -#endif -#endif - -#ifndef DECLSPEC_NOTHROW -#if (_MSC_VER >= 1200) && !defined(MIDL_PASS) -#define DECLSPEC_NOTHROW __declspec(nothrow) -#else -#define DECLSPEC_NOTHROW -#endif -#endif - -#ifndef DECLSPEC_ALIGN -#if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -#define DECLSPEC_ALIGN(x) __declspec(align(x)) -#else -#define DECLSPEC_ALIGN(x) -#endif -#endif - -#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE -#if defined(_AMD64_) || defined(_X86_) -#define SYSTEM_CACHE_ALIGNMENT_SIZE 64 -#else -#define SYSTEM_CACHE_ALIGNMENT_SIZE 128 -#endif -#endif - -#ifndef DECLSPEC_CACHEALIGN -#define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) -#endif - -#ifndef DECLSPEC_UUID -#if (_MSC_VER >= 1100) && defined (__cplusplus) -#define DECLSPEC_UUID(x) __declspec(uuid(x)) -#else -#define DECLSPEC_UUID(x) -#endif -#endif - -#ifndef DECLSPEC_NOVTABLE -#if (_MSC_VER >= 1100) && defined(__cplusplus) -#define DECLSPEC_NOVTABLE __declspec(novtable) -#else -#define DECLSPEC_NOVTABLE -#endif -#endif - -#ifndef DECLSPEC_SELECTANY -#if (_MSC_VER >= 1100) -#define DECLSPEC_SELECTANY __declspec(selectany) -#else -#define DECLSPEC_SELECTANY -#endif -#endif - -#ifndef NOP_FUNCTION -#if (_MSC_VER >= 1210) -#define NOP_FUNCTION __noop -#else -#define NOP_FUNCTION (void)0 -#endif -#endif - -#ifndef DECLSPEC_ADDRSAFE -#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) -#define DECLSPEC_ADDRSAFE __declspec(address_safe) -#else -#define DECLSPEC_ADDRSAFE -#endif -#endif - -#ifndef DECLSPEC_NOINLINE -#if (_MSC_VER >= 1300) -#define DECLSPEC_NOINLINE __declspec(noinline) -#else -#define DECLSPEC_NOINLINE -#endif -#endif - -#ifndef FORCEINLINE -#if (_MSC_VER >= 1200) -#define FORCEINLINE __forceinline -#else -#define FORCEINLINE __inline -#endif -#endif - -#ifndef DECLSPEC_DEPRECATED -#if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -#define DECLSPEC_DEPRECATED __declspec(deprecated) -#define DEPRECATE_SUPPORTED -#else -#define DECLSPEC_DEPRECATED -#undef DEPRECATE_SUPPORTED -#endif -#endif - -#ifdef DEPRECATE_DDK_FUNCTIONS -#ifdef _NTDDK_ -#define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED -#ifdef DEPRECATE_SUPPORTED -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 0 -#endif - -// -// Void -// - -typedef void *PVOID; -typedef void * POINTER_64 PVOID64; - -// end_winnt - -#ifndef _MANAGED -#if defined(_M_IX86) -#define FASTCALL __fastcall -#else -#define FASTCALL -#endif -#else -#define FASTCALL NTAPI -#endif - - -// -// Basics -// - -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -#if !defined(MIDL_PASS) -typedef int INT; -#endif -#endif - -// -// UNICODE (Wide Character) types -// - -#ifndef _MAC -typedef wchar_t WCHAR; // wc, 16-bit UNICODE character -#else -// some Macintosh compilers don't define wchar_t in a convenient location, or define it as a char -typedef unsigned short WCHAR; // wc, 16-bit UNICODE character -#endif - -typedef WCHAR *PWCHAR, *LPWCH, *PWCH; -typedef CONST WCHAR *LPCWCH, *PCWCH; - -typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR; -typedef __nullterminated PWSTR *PZPWSTR; -typedef __nullterminated CONST PWSTR *PCZPWSTR; -typedef __nullterminated WCHAR UNALIGNED *LPUWSTR, *PUWSTR; -typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR; -typedef __nullterminated PCWSTR *PZPCWSTR; -typedef __nullterminated CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR; - -typedef __nullnullterminated WCHAR *PZZWSTR; -typedef __nullnullterminated CONST WCHAR *PCZZWSTR; -typedef __nullnullterminated WCHAR UNALIGNED *PUZZWSTR; -typedef __nullnullterminated CONST WCHAR UNALIGNED *PCUZZWSTR; - -typedef __possibly_notnullterminated WCHAR *PNZWCH; -typedef __possibly_notnullterminated CONST WCHAR *PCNZWCH; -typedef __possibly_notnullterminated WCHAR UNALIGNED *PUNZWCH; -typedef __possibly_notnullterminated CONST WCHAR UNALIGNED *PCUNZWCH; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -typedef CONST WCHAR *LPCWCHAR, *PCWCHAR; -typedef CONST WCHAR UNALIGNED *LPCUWCHAR, *PCUWCHAR; - -// -// UCS (Universal Character Set) types -// - -typedef unsigned long UCSCHAR; - -// -// Even pre-Unicode agreement, UCS values are always in the -// range U+00000000 to U+7FFFFFFF, so we'll pick an obvious -// value. - -#define UCSCHAR_INVALID_CHARACTER (0xffffffff) - -#define MIN_UCSCHAR (0) - -// -// We'll assume here that the ISO-10646 / Unicode agreement -// not to assign code points after U+0010FFFF holds so that -// we do not have to have separate "UCSCHAR" and "UNICODECHAR" -// types. -// - -#define MAX_UCSCHAR (0x0010FFFF) - -typedef UCSCHAR *PUCSCHAR; -typedef const UCSCHAR *PCUCSCHAR; - -typedef UCSCHAR *PUCSSTR; -typedef UCSCHAR UNALIGNED *PUUCSSTR; - -typedef const UCSCHAR *PCUCSSTR; -typedef const UCSCHAR UNALIGNED *PCUUCSSTR; - -typedef UCSCHAR UNALIGNED *PUUCSCHAR; -typedef const UCSCHAR UNALIGNED *PCUUCSCHAR; - -#endif // _WIN32_WINNT >= 0x0600 - - -// -// ANSI (Multi-byte Character) types -// -typedef CHAR *PCHAR, *LPCH, *PCH; -typedef CONST CHAR *LPCCH, *PCCH; - -typedef __nullterminated CHAR *NPSTR, *LPSTR, *PSTR; -typedef __nullterminated PSTR *PZPSTR; -typedef __nullterminated CONST PSTR *PCZPSTR; -typedef __nullterminated CONST CHAR *LPCSTR, *PCSTR; -typedef __nullterminated PCSTR *PZPCSTR; - -typedef __nullnullterminated CHAR *PZZSTR; -typedef __nullnullterminated CONST CHAR *PCZZSTR; - -typedef __possibly_notnullterminated CHAR *PNZCH; -typedef __possibly_notnullterminated CONST CHAR *PCNZCH; - -// -// Neutral ANSI/UNICODE types and macros -// -#ifdef UNICODE // r_winnt - -#ifndef _TCHAR_DEFINED -typedef WCHAR TCHAR, *PTCHAR; -typedef WCHAR TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ - -typedef LPWCH LPTCH, PTCH; -typedef LPCWCH LPCTCH, PCTCH; -typedef LPWSTR PTSTR, LPTSTR; -typedef LPCWSTR PCTSTR, LPCTSTR; -typedef LPUWSTR PUTSTR, LPUTSTR; -typedef LPCUWSTR PCUTSTR, LPCUTSTR; -typedef LPWSTR LP; -typedef PZZWSTR PZZTSTR; -typedef PCZZWSTR PCZZTSTR; -typedef PUZZWSTR PUZZTSTR; -typedef PCUZZWSTR PCUZZTSTR; -typedef PNZWCH PNZTCH; -typedef PCNZWCH PCNZTCH; -typedef PUNZWCH PUNZTCH; -typedef PCUNZWCH PCUNZTCH; -#define __TEXT(quote) L##quote // r_winnt - -#else /* UNICODE */ // r_winnt - -#ifndef _TCHAR_DEFINED -typedef char TCHAR, *PTCHAR; -typedef unsigned char TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ - -typedef LPCH LPTCH, PTCH; -typedef LPCCH LPCTCH, PCTCH; -typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; -typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR; -typedef PZZSTR PZZTSTR, PUZZTSTR; -typedef PCZZSTR PCZZTSTR, PCUZZTSTR; -typedef PNZCH PNZTCH, PUNZTCH; -typedef PCNZCH PCNZTCH, PCUNZTCH; -#define __TEXT(quote) quote // r_winnt - -#endif /* UNICODE */ // r_winnt -#define TEXT(quote) __TEXT(quote) // r_winnt - - -// end_winnt - -// -// The type QUAD and UQUAD are intended to use when a 8 byte aligned structure -// is required, but it is not a floating point number. -// - -typedef double DOUBLE; - -typedef struct _QUAD { - union { - __int64 UseThisFieldToCopy; - double DoNotUseThisField; - } DUMMYUNIONNAME; - -} QUAD; - -// -// Pointer to Basics -// - -typedef SHORT *PSHORT; // winnt -typedef LONG *PLONG; // winnt -typedef QUAD *PQUAD; - -// -// Unsigned Basics -// - -// Tell windef.h that some types are already defined. -#define BASETYPES - -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned long ULONG; -typedef QUAD UQUAD; - -// -// Pointer to Unsigned Basics -// - -typedef UCHAR *PUCHAR; -typedef USHORT *PUSHORT; -typedef ULONG *PULONG; -typedef UQUAD *PUQUAD; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -// -// Pointer to Const Unsigned Basics -// - -typedef CONST UCHAR *PCUCHAR; -typedef CONST USHORT *PCUSHORT; -typedef CONST ULONG *PCULONG; -typedef CONST UQUAD *PCUQUAD; - -#endif // _WIN32_WINNT >= 0x0600 - -// -// Signed characters -// - -typedef signed char SCHAR; -typedef SCHAR *PSCHAR; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -typedef CONST SCHAR *PCSCHAR; - -#endif // _WIN32_WINNT >= 0x0600 - -#ifndef NO_STRICT -#ifndef STRICT -#define STRICT 1 -#endif -#endif - -// begin_winnt - -#define ALL_PROCESSOR_GROUPS 0xffff - -// -// Structure to represent a system wide processor number. It contains a -// group number and relative processor number within the group. -// - -typedef struct _PROCESSOR_NUMBER { - USHORT Group; - UCHAR Number; - UCHAR Reserved; -} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; - -// -// Structure to represent a group-specific affinity, such as that of a -// thread. Specifies the group number and the affinity within that group. -// - -typedef struct _GROUP_AFFINITY { - KAFFINITY Mask; - USHORT Group; - USHORT Reserved[3]; -} GROUP_AFFINITY, *PGROUP_AFFINITY; - -// -// Handle to an Object -// - -#ifdef STRICT -typedef void *HANDLE; -#if 0 && (_MSC_VER > 1000) -#define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name -#else -#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name -#endif -#else -typedef PVOID HANDLE; -#define DECLARE_HANDLE(name) typedef HANDLE name -#endif -typedef HANDLE *PHANDLE; - -// -// Flag (bit) fields -// - -typedef UCHAR FCHAR; -typedef USHORT FSHORT; -typedef ULONG FLONG; - -// Component Object Model defines, and macros - -#ifndef _HRESULT_DEFINED -#define _HRESULT_DEFINED -#ifdef __midl -typedef LONG HRESULT; -#else -typedef __success(return >= 0) long HRESULT; -#endif // __midl -#endif // !_HRESULT_DEFINED - -#ifdef __cplusplus - #define EXTERN_C extern "C" -#else - #define EXTERN_C extern -#endif - -#if defined(_WIN32) || defined(_MPPC_) - -// Win32 doesn't support __export - -#ifdef _68K_ -#define STDMETHODCALLTYPE __cdecl -#else -#define STDMETHODCALLTYPE __stdcall -#endif -#define STDMETHODVCALLTYPE __cdecl - -#define STDAPICALLTYPE __stdcall -#define STDAPIVCALLTYPE __cdecl - -#else - -#define STDMETHODCALLTYPE __export __stdcall -#define STDMETHODVCALLTYPE __export __cdecl - -#define STDAPICALLTYPE __export __stdcall -#define STDAPIVCALLTYPE __export __cdecl - -#endif - - -#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE -#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE - -#define STDMETHODIMP HRESULT STDMETHODCALLTYPE -#define STDMETHODIMP_(type) type STDMETHODCALLTYPE - -#define STDOVERRIDEMETHODIMP __override STDMETHODIMP -#define STDOVERRIDEMETHODIMP_(type) __override STDMETHODIMP_(type) - -#define IFACEMETHODIMP __override STDMETHODIMP -#define IFACEMETHODIMP_(type) __override STDMETHODIMP_(type) - -// The 'V' versions allow Variable Argument lists. - -#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE -#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE - -#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE -#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE - -#define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV -#define STDOVERRIDEMETHODIMPV_(type) __override STDMETHODIMPV_(type) - -#define IFACEMETHODIMPV __override STDMETHODIMPV -#define IFACEMETHODIMPV_(type) __override STDMETHODIMPV_(type) - -// end_winnt - - -// -// Low order two bits of a handle are ignored by the system and available -// for use by application code as tag bits. The remaining bits are opaque -// and used to store a serial number and table index. -// - -#define OBJ_HANDLE_TAGBITS 0x00000003L - -// -// Cardinal Data Types [0 - 2**N-2) -// - -typedef char CCHAR; // winnt -typedef short CSHORT; -typedef ULONG CLONG; - -typedef CCHAR *PCCHAR; -typedef CSHORT *PCSHORT; -typedef CLONG *PCLONG; - - -// -// __int64 is only supported by 2.0 and later midl. -// __midl is set by the 2.0 midl and not by 1.0 midl. -// - -#define _ULONGLONG_ -#if (!defined (_MAC) && (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))) -typedef __int64 LONGLONG; -typedef unsigned __int64 ULONGLONG; - -#define MAXLONGLONG (0x7fffffffffffffff) - - -#else - -#if defined(_MAC) && defined(_MAC_INT_64) -typedef __int64 LONGLONG; -typedef unsigned __int64 ULONGLONG; - -#define MAXLONGLONG (0x7fffffffffffffff) - - -#else -typedef double LONGLONG; -typedef double ULONGLONG; -#endif //_MAC and int64 - -#endif - -typedef LONGLONG *PLONGLONG; -typedef ULONGLONG *PULONGLONG; - -// Update Sequence Number - -typedef LONGLONG USN; - -#if defined(MIDL_PASS) -typedef struct _LARGE_INTEGER { -#else // MIDL_PASS -typedef union _LARGE_INTEGER { - struct { - ULONG LowPart; - LONG HighPart; - } DUMMYSTRUCTNAME; - struct { - ULONG LowPart; - LONG HighPart; - } u; -#endif //MIDL_PASS - LONGLONG QuadPart; -} LARGE_INTEGER; - -typedef LARGE_INTEGER *PLARGE_INTEGER; - -#if defined(MIDL_PASS) -typedef struct _ULARGE_INTEGER { -#else // MIDL_PASS -typedef union _ULARGE_INTEGER { - struct { - ULONG LowPart; - ULONG HighPart; - } DUMMYSTRUCTNAME; - struct { - ULONG LowPart; - ULONG HighPart; - } u; -#endif //MIDL_PASS - ULONGLONG QuadPart; -} ULARGE_INTEGER; - -typedef ULARGE_INTEGER *PULARGE_INTEGER; - - -// -// Physical address. -// - -typedef LARGE_INTEGER PHYSICAL_ADDRESS, *PPHYSICAL_ADDRESS; - - -// -// Boolean -// - -typedef UCHAR BOOLEAN; // winnt -typedef BOOLEAN *PBOOLEAN; // winnt - - -// -// Constants -// - -#define FALSE 0 -#define TRUE 1 - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#define NULL64 0 -#else -#define NULL ((void *)0) -#define NULL64 ((void * POINTER_64)0) -#endif -#endif // NULL - -// -// Calculate the byte offset of a field in a structure of type type. -// - -#define FIELD_OFFSET(type, field) ((LONG)(LONG_PTR)&(((type *)0)->field)) - -// -// Calculate the size of a field in a structure of type type, without -// knowing or stating the type of the field. -// -#define RTL_FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) - -// -// Calculate the size of a structure of type type up through and -// including a field. -// -#define RTL_SIZEOF_THROUGH_FIELD(type, field) \ - (FIELD_OFFSET(type, field) + RTL_FIELD_SIZE(type, field)) - -// -// RTL_CONTAINS_FIELD usage: -// -// if (RTL_CONTAINS_FIELD(pBlock, pBlock->cbSize, dwMumble)) { // safe to use pBlock->dwMumble -// -#define RTL_CONTAINS_FIELD(Struct, Size, Field) \ - ( (((PCHAR)(&(Struct)->Field)) + sizeof((Struct)->Field)) <= (((PCHAR)(Struct))+(Size)) ) - -// -// Return the number of elements in a statically sized array. -// ULONG Buffer[100]; -// RTL_NUMBER_OF(Buffer) == 100 -// This is also popularly known as: NUMBER_OF, ARRSIZE, _countof, NELEM, etc. -// -#define RTL_NUMBER_OF_V1(A) (sizeof(A)/sizeof((A)[0])) - -#if defined(__cplusplus) && \ - !defined(MIDL_PASS) && \ - !defined(RC_INVOKED) && \ - !defined(_PREFAST_) && \ - (_MSC_FULL_VER >= 13009466) && \ - !defined(SORTPP_PASS) -// -// RtlpNumberOf is a function that takes a reference to an array of N Ts. -// -// typedef T array_of_T[N]; -// typedef array_of_T &reference_to_array_of_T; -// -// RtlpNumberOf returns a pointer to an array of N chars. -// We could return a reference instead of a pointer but older compilers do not accept that. -// -// typedef char array_of_char[N]; -// typedef array_of_char *pointer_to_array_of_char; -// -// sizeof(array_of_char) == N -// sizeof(*pointer_to_array_of_char) == N -// -// pointer_to_array_of_char RtlpNumberOf(reference_to_array_of_T); -// -// We never even call RtlpNumberOf, we just take the size of dereferencing its return type. -// We do not even implement RtlpNumberOf, we just decare it. -// -// Attempts to pass pointers instead of arrays to this macro result in compile time errors. -// That is the point. -// -extern "C++" // templates cannot be declared to have 'C' linkage -template -char (*RtlpNumberOf( UNALIGNED T (&)[N] ))[N]; - -#define RTL_NUMBER_OF_V2(A) (sizeof(*RtlpNumberOf(A))) - -// -// This does not work with: -// -// void Foo() -// { -// struct { int x; } y[2]; -// RTL_NUMBER_OF_V2(y); // illegal use of anonymous local type in template instantiation -// } -// -// You must instead do: -// -// struct Foo1 { int x; }; -// -// void Foo() -// { -// Foo1 y[2]; -// RTL_NUMBER_OF_V2(y); // ok -// } -// -// OR -// -// void Foo() -// { -// struct { int x; } y[2]; -// RTL_NUMBER_OF_V1(y); // ok -// } -// -// OR -// -// void Foo() -// { -// struct { int x; } y[2]; -// _ARRAYSIZE(y); // ok -// } -// - -#else -#define RTL_NUMBER_OF_V2(A) RTL_NUMBER_OF_V1(A) -#endif - -#ifdef ENABLE_RTL_NUMBER_OF_V2 -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V2(A) -#else -#define RTL_NUMBER_OF(A) RTL_NUMBER_OF_V1(A) -#endif - -// -// ARRAYSIZE is more readable version of RTL_NUMBER_OF_V2, and uses -// it regardless of ENABLE_RTL_NUMBER_OF_V2 -// -// _ARRAYSIZE is a version useful for anonymous types -// -#define ARRAYSIZE(A) RTL_NUMBER_OF_V2(A) -#define _ARRAYSIZE(A) RTL_NUMBER_OF_V1(A) - -// -// An expression that yields the type of a field in a struct. -// -#define RTL_FIELD_TYPE(type, field) (((type*)0)->field) - -// RTL_ to avoid collisions in the global namespace. -// -// Given typedef struct _FOO { BYTE Bar[123]; } FOO; -// RTL_NUMBER_OF_FIELD(FOO, Bar) == 123 -// -#define RTL_NUMBER_OF_FIELD(type, field) (RTL_NUMBER_OF(RTL_FIELD_TYPE(type, field))) - -// -// eg: -// typedef struct FOO { -// ULONG Integer; -// PVOID Pointer; -// } FOO; -// -// RTL_PADDING_BETWEEN_FIELDS(FOO, Integer, Pointer) == 0 for Win32, 4 for Win64 -// -#define RTL_PADDING_BETWEEN_FIELDS(T, F1, F2) \ - ((FIELD_OFFSET(T, F2) > FIELD_OFFSET(T, F1)) \ - ? (FIELD_OFFSET(T, F2) - FIELD_OFFSET(T, F1) - RTL_FIELD_SIZE(T, F1)) \ - : (FIELD_OFFSET(T, F1) - FIELD_OFFSET(T, F2) - RTL_FIELD_SIZE(T, F2))) - -// RTL_ to avoid collisions in the global namespace. -#if defined(__cplusplus) -#define RTL_CONST_CAST(type) const_cast -#else -#define RTL_CONST_CAST(type) (type) -#endif - -// end_winnt -// -// This works "generically" for Unicode and Ansi/Oem strings. -// Usage: -// const static UNICODE_STRING FooU = RTL_CONSTANT_STRING(L"Foo"); -// const static STRING Foo = RTL_CONSTANT_STRING( "Foo"); -// instead of the slower: -// UNICODE_STRING FooU; -// STRING Foo; -// RtlInitUnicodeString(&FooU, L"Foo"); -// RtlInitString(&Foo , "Foo"); -// -// Or: -// const static char szFoo[] = "Foo"; -// const static STRING sFoo = RTL_CONSTANT_STRING(szFoo); -// -// This will compile without error or warning in C++. C will get a warning. -// -#ifdef __cplusplus -extern "C++" -{ -char _RTL_CONSTANT_STRING_type_check(const char *s); -char _RTL_CONSTANT_STRING_type_check(const WCHAR *s); -// __typeof would be desirable here instead of sizeof. -template class _RTL_CONSTANT_STRING_remove_const_template_class; -template <> class _RTL_CONSTANT_STRING_remove_const_template_class {public: typedef char T; }; -template <> class _RTL_CONSTANT_STRING_remove_const_template_class {public: typedef WCHAR T; }; -#define _RTL_CONSTANT_STRING_remove_const_macro(s) \ - (const_cast<_RTL_CONSTANT_STRING_remove_const_template_class::T*>(s)) -} -#else -char _RTL_CONSTANT_STRING_type_check(const void *s); -#define _RTL_CONSTANT_STRING_remove_const_macro(s) (s) -#endif -#define RTL_CONSTANT_STRING(s) \ -{ \ - sizeof( s ) - sizeof( (s)[0] ), \ - sizeof( s ) / sizeof(_RTL_CONSTANT_STRING_type_check(s)), \ - _RTL_CONSTANT_STRING_remove_const_macro(s) \ -} -// begin_winnt - -// like sizeof -// usually this would be * CHAR_BIT, but we don't necessarily have #include -#define RTL_BITS_OF(sizeOfArg) (sizeof(sizeOfArg) * 8) - -#define RTL_BITS_OF_FIELD(type, field) (RTL_BITS_OF(RTL_FIELD_TYPE(type, field))) - -// -// Calculate the address of the base of the structure given its type, and an -// address of a field within the structure. -// - -#define CONTAINING_RECORD(address, type, field) ((type *)( \ - (PCHAR)(address) - \ - (ULONG_PTR)(&((type *)0)->field))) - - -// -// Interrupt Request Level (IRQL) -// - -typedef UCHAR KIRQL; - -typedef KIRQL *PKIRQL; - -#include - -// -// Macros used to eliminate compiler warning generated when formal -// parameters or local variables are not declared. -// -// Use DBG_UNREFERENCED_PARAMETER() when a parameter is not yet -// referenced but will be once the module is completely developed. -// -// Use DBG_UNREFERENCED_LOCAL_VARIABLE() when a local variable is not yet -// referenced but will be once the module is completely developed. -// -// Use UNREFERENCED_PARAMETER() if a parameter will never be referenced. -// -// DBG_UNREFERENCED_PARAMETER and DBG_UNREFERENCED_LOCAL_VARIABLE will -// eventually be made into a null macro to help determine whether there -// is unfinished work. -// - -#if ! defined(lint) -#define UNREFERENCED_PARAMETER(P) (P) -#define DBG_UNREFERENCED_PARAMETER(P) (P) -#define DBG_UNREFERENCED_LOCAL_VARIABLE(V) (V) - -#else // lint - -// Note: lint -e530 says don't complain about uninitialized variables for -// this varible. Error 527 has to do with unreachable code. -// -restore restores checking to the -save state - -#define UNREFERENCED_PARAMETER(P) \ - /*lint -save -e527 -e530 */ \ - { \ - (P) = (P); \ - } \ - /*lint -restore */ -#define DBG_UNREFERENCED_PARAMETER(P) \ - /*lint -save -e527 -e530 */ \ - { \ - (P) = (P); \ - } \ - /*lint -restore */ -#define DBG_UNREFERENCED_LOCAL_VARIABLE(V) \ - /*lint -save -e527 -e530 */ \ - { \ - (V) = (V); \ - } \ - /*lint -restore */ - -#endif // lint - -// -// Macro used to eliminate compiler warning 4715 within a switch statement -// when all possible cases have already been accounted for. -// -// switch (a & 3) { -// case 0: return 1; -// case 1: return Foo(); -// case 2: return Bar(); -// case 3: return 1; -// DEFAULT_UNREACHABLE; -// - -#if (_MSC_VER > 1200) -#define DEFAULT_UNREACHABLE default: __assume(0) -#else - -// -// Older compilers do not support __assume(), and there is no other free -// method of eliminating the warning. -// - -#define DEFAULT_UNREACHABLE - -#endif - -#ifdef __cplusplus - -// Define operator overloads to enable bit operations on enum values that are -// used to define flags. Use DEFINE_ENUM_FLAG_OPERATORS(YOUR_TYPE) to enable these -// operators on YOUR_TYPE. - -// Moved here from objbase.w. - -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ -extern "C++" { \ -inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ -inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ -inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ -inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ -inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ -inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ -inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ -} -#else -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) // NOP, C allows these operators. -#endif - -// Compile-time macros for initializing flag values in const data. -// -// When using DEFINE_ENUM_FLAG_OPERATORS for enum values you should use the macros below -// when you need to initialize global const data. Without these macros the inline operators -// from DEFINE_ENUM_FLAG_OPERATORS force a runtime initialization rather than a -// compile time initialization. This applies even if you have declared the data as const. -#define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b)) -#define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c)) -#define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)) -#define COMPILETIME_OR_5FLAGS(a,b,c,d,e) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e)) - -// end_winnt - -// -// Define standard min and max macros -// - -#ifndef NOMINMAX - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#endif // NOMINMAX - - -#ifdef _AMD64_ - - -#if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -// -// Define bit test intrinsics. -// - -#ifdef __cplusplus -extern "C" { -#endif - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset -#define InterlockedBitTestAndSet _interlockedbittestandset -#define InterlockedBitTestAndReset _interlockedbittestandreset - -#define BitTest64 _bittest64 -#define BitTestAndComplement64 _bittestandcomplement64 -#define BitTestAndSet64 _bittestandset64 -#define BitTestAndReset64 _bittestandreset64 -#define InterlockedBitTestAndSet64 _interlockedbittestandset64 -#define InterlockedBitTestAndReset64 _interlockedbittestandreset64 - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandreset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_bittest64 ( - __in_bcount((Offset+7)/8) LONG64 const *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandcomplement64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandreset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_interlockedbittestandset64 ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG64 volatile *Base, - __in LONG64 Offset - ); - -BOOLEAN -_interlockedbittestandreset64 ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG64 volatile *Base, - __in LONG64 Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) -#pragma intrinsic(_interlockedbittestandset) -#pragma intrinsic(_interlockedbittestandreset) - -#pragma intrinsic(_bittest64) -#pragma intrinsic(_bittestandcomplement64) -#pragma intrinsic(_bittestandset64) -#pragma intrinsic(_bittestandreset64) -#pragma intrinsic(_interlockedbittestandset64) -#pragma intrinsic(_interlockedbittestandreset64) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse -#define BitScanForward64 _BitScanForward64 -#define BitScanReverse64 _BitScanReverse64 - -__success(return!=0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanForward64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) - -// -// Interlocked intrinsic functions. -// - -#define InterlockedIncrement16 _InterlockedIncrement16 -#define InterlockedDecrement16 _InterlockedDecrement16 -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 - -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAcquire _InterlockedAnd -#define InterlockedAndRelease _InterlockedAnd -#define InterlockedOr _InterlockedOr -#define InterlockedOrAcquire _InterlockedOr -#define InterlockedOrRelease _InterlockedOr -#define InterlockedXor _InterlockedXor -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedIncrementAcquire InterlockedIncrement -#define InterlockedIncrementRelease InterlockedIncrement -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedDecrementAcquire InterlockedDecrement -#define InterlockedDecrementRelease InterlockedDecrement -#define InterlockedAdd _InterlockedAdd -#define InterlockedExchange _InterlockedExchange -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire InterlockedCompareExchange -#define InterlockedCompareExchangeRelease InterlockedCompareExchange - -#define InterlockedAnd64 _InterlockedAnd64 -#define InterlockedAnd64Acquire _InterlockedAnd64 -#define InterlockedAnd64Release _InterlockedAnd64 -#define InterlockedAndAffinity InterlockedAnd64 -#define InterlockedOr64 _InterlockedOr64 -#define InterlockedOr64Acquire _InterlockedOr64 -#define InterlockedOr64Release _InterlockedOr64 -#define InterlockedOrAffinity InterlockedOr64 -#define InterlockedXor64 _InterlockedXor64 -#define InterlockedIncrement64 _InterlockedIncrement64 -#define InterlockedDecrement64 _InterlockedDecrement64 -#define InterlockedAdd64 _InterlockedAdd64 -#define InterlockedExchange64 _InterlockedExchange64 -#define InterlockedExchangeAcquire64 InterlockedExchange64 -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 -#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 - -#define InterlockedExchangePointer _InterlockedExchangePointer -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a) - -SHORT -InterlockedIncrement16 ( - __inout __drv_interlocked SHORT volatile *Addend - ); - -SHORT -InterlockedDecrement16 ( - __inout __drv_interlocked SHORT volatile *Addend - ); - -SHORT -InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -LONG -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -InterlockedXor ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG64 -InterlockedAnd64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG64 -InterlockedOr64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG64 -InterlockedXor64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -#if !defined(_X86AMD64_) - -__forceinline -LONG -InterlockedAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ) - -{ - return InterlockedExchangeAdd(Addend, Value) + Value; -} - -#endif - -LONG -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - -LONG64 -InterlockedIncrement64( - __inout __drv_interlocked LONG64 volatile *Addend - ); - -LONG64 -InterlockedDecrement64( - __inout __drv_interlocked LONG64 volatile *Addend - ); - -LONG64 -InterlockedExchange64( - __inout __drv_interlocked LONG64 volatile *Target, - __in LONG64 Value - ); - -LONG64 -InterlockedExchangeAdd64( - __inout __drv_interlocked LONG64 volatile *Addend, - __in LONG64 Value - ); - -#if !defined(_X86AMD64_) - -__forceinline -LONG64 -InterlockedAdd64( - __inout __drv_interlocked LONG64 volatile *Addend, - __in LONG64 Value - ) - -{ - return InterlockedExchangeAdd64(Addend, Value) + Value; -} - -#endif - -LONG64 -InterlockedCompareExchange64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExChange, - __in LONG64 Comperand - ); - -PVOID -InterlockedCompareExchangePointer ( - __inout __drv_interlocked PVOID volatile *Destination, - __in_opt PVOID Exchange, - __in_opt PVOID Comperand - ); - -PVOID -InterlockedExchangePointer( - __inout __drv_interlocked PVOID volatile *Target, - __in_opt PVOID Value - ); - -#pragma intrinsic(_InterlockedIncrement16) -#pragma intrinsic(_InterlockedDecrement16) -#pragma intrinsic(_InterlockedCompareExchange16) -#pragma intrinsic(_InterlockedAnd) -#pragma intrinsic(_InterlockedOr) -#pragma intrinsic(_InterlockedXor) -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedAnd64) -#pragma intrinsic(_InterlockedOr64) -#pragma intrinsic(_InterlockedXor64) -#pragma intrinsic(_InterlockedIncrement64) -#pragma intrinsic(_InterlockedDecrement64) -#pragma intrinsic(_InterlockedExchange64) -#pragma intrinsic(_InterlockedExchangeAdd64) -#pragma intrinsic(_InterlockedCompareExchange64) -#pragma intrinsic(_InterlockedExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer) - -#if _MSC_FULL_VER >= 140041204 - -#define InterlockedAnd8 _InterlockedAnd8 -#define InterlockedOr8 _InterlockedOr8 -#define InterlockedXor8 _InterlockedXor8 -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedOr16 _InterlockedOr16 -#define InterlockedXor16 _InterlockedXor16 - -char -InterlockedAnd8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -char -InterlockedOr8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -char -InterlockedXor8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -SHORT -InterlockedAnd16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -InterlockedOr16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -InterlockedXor16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -#pragma intrinsic (_InterlockedAnd8) -#pragma intrinsic (_InterlockedOr8) -#pragma intrinsic (_InterlockedXor8) -#pragma intrinsic (_InterlockedAnd16) -#pragma intrinsic (_InterlockedOr16) -#pragma intrinsic (_InterlockedXor16) - -#endif - -// -// Define function to flush a cache line. -// - -#define CacheLineFlush(Address) _mm_clflush(Address) - -VOID -_mm_clflush ( - __in VOID const *Address - ); - -#pragma intrinsic(_mm_clflush) - -VOID -_ReadWriteBarrier ( - VOID - ); - -#pragma intrinsic(_ReadWriteBarrier) - -// -// Define memory fence intrinsics -// - -#define FastFence __faststorefence -#define LoadFence _mm_lfence -#define MemoryFence _mm_mfence -#define StoreFence _mm_sfence - -VOID -__faststorefence ( - VOID - ); - -VOID -_mm_lfence ( - VOID - ); - -VOID -_mm_mfence ( - VOID - ); - -VOID -_mm_sfence ( - VOID - ); - -VOID -_mm_pause ( - VOID - ); - -VOID -_mm_prefetch ( - __in CHAR CONST *a, - __in int sel - ); - -VOID -_m_prefetchw ( - __in volatile CONST VOID *Source - ); - -// -// Define constants for use with _mm_prefetch. -// - -#define _MM_HINT_T0 1 -#define _MM_HINT_T1 2 -#define _MM_HINT_T2 3 -#define _MM_HINT_NTA 0 - -#pragma intrinsic(__faststorefence) -#pragma intrinsic(_mm_pause) -#pragma intrinsic(_mm_prefetch) -#pragma intrinsic(_mm_lfence) -#pragma intrinsic(_mm_mfence) -#pragma intrinsic(_mm_sfence) -#pragma intrinsic(_m_prefetchw) - -#define YieldProcessor _mm_pause -#define MemoryBarrier __faststorefence -#define PreFetchCacheLine(l, a) _mm_prefetch((CHAR CONST *) a, l) -#define PrefetchForWrite(p) _m_prefetchw(p) -#define ReadForWriteAccess(p) (_m_prefetchw(p), *(p)) - -// -// PreFetchCacheLine level defines. -// - -#define PF_TEMPORAL_LEVEL_1 _MM_HINT_T0 -#define PF_TEMPORAL_LEVEL_2 _MM_HINT_T1 -#define PF_TEMPORAL_LEVEL_3 _MM_HINT_T2 -#define PF_NON_TEMPORAL_LEVEL_ALL _MM_HINT_NTA - -// -// Define get/set MXCSR intrinsics. -// - -#define ReadMxCsr _mm_getcsr -#define WriteMxCsr _mm_setcsr - -unsigned int -_mm_getcsr ( - VOID - ); - -VOID -_mm_setcsr ( - __in unsigned int MxCsr - ); - -#pragma intrinsic(_mm_getcsr) -#pragma intrinsic(_mm_setcsr) - -// -// Assert exception. -// - -VOID -__int2c ( - VOID - ); - -#pragma intrinsic(__int2c) - -__analysis_noreturn -FORCEINLINE -VOID -DbgRaiseAssertionFailure ( - VOID - ) - -{ - __int2c(); -} - -// -// Define function to get the caller's EFLAGs value. -// - -#define GetCallersEflags() __getcallerseflags() - -unsigned __int32 -__getcallerseflags ( - VOID - ); - -#pragma intrinsic(__getcallerseflags) - -// -// Define function to get segment limit. -// - -#define GetSegmentLimit __segmentlimit - -ULONG -__segmentlimit ( - __in ULONG Selector - ); - -#pragma intrinsic(__segmentlimit) - -// -// Define function to read the value of a performance counter. -// - -#define ReadPMC __readpmc - -ULONG64 -__readpmc ( - __in ULONG Counter - ); - -#pragma intrinsic(__readpmc) - -// -// Define function to read the value of the time stamp counter -// - -#define ReadTimeStampCounter() __rdtsc() - -ULONG64 -__rdtsc ( - VOID - ); - -#pragma intrinsic(__rdtsc) - -// -// Define functions to move strings as bytes, words, dwords, and qwords. -// - -VOID -__movsb ( - __out_ecount_full(Count) PUCHAR Destination, - __in_ecount(Count) UCHAR const *Source, - __in SIZE_T Count - ); - -VOID -__movsw ( - __out_ecount_full(Count) PUSHORT Destination, - __in_ecount(Count) USHORT const *Source, - __in SIZE_T Count - ); - -VOID -__movsd ( - __out_ecount_full(Count) PULONG Destination, - __in_ecount(Count) ULONG const *Source, - __in SIZE_T Count - ); - -VOID -__movsq ( - __out_ecount_full(Count) PULONG64 Destination, - __in_ecount(Count) ULONG64 const *Source, - __in SIZE_T Count - ); - -#pragma intrinsic(__movsb) -#pragma intrinsic(__movsw) -#pragma intrinsic(__movsd) -#pragma intrinsic(__movsq) - -// -// Define functions to store strings as bytes, words, dwords, and qwords. -// - -VOID -__stosb ( - __out_ecount_full(Count) PUCHAR Destination, - __in UCHAR Value, - __in SIZE_T Count - ); - -VOID -__stosw ( - __out_ecount_full(Count) PUSHORT Destination, - __in USHORT Value, - __in SIZE_T Count - ); - -VOID -__stosd ( - __out_ecount_full(Count) PULONG Destination, - __in ULONG Value, - __in SIZE_T Count - ); - -VOID -__stosq ( - __out_ecount_full(Count) PULONG64 Destination, - __in ULONG64 Value, - __in SIZE_T Count - ); - -#pragma intrinsic(__stosb) -#pragma intrinsic(__stosw) -#pragma intrinsic(__stosd) -#pragma intrinsic(__stosq) - -// -// Define functions to capture the high 64-bits of a 128-bit multiply. -// - -#define MultiplyHigh __mulh -#define UnsignedMultiplyHigh __umulh - -LONGLONG -MultiplyHigh ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand - ); - -ULONGLONG -UnsignedMultiplyHigh ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand - ); - -#pragma intrinsic(__mulh) -#pragma intrinsic(__umulh) - -// -// Define functions to perform 128-bit shifts -// - -#define ShiftLeft128 __shiftleft128 -#define ShiftRight128 __shiftright128 - -ULONG64 -ShiftLeft128 ( - __in ULONG64 LowPart, - __in ULONG64 HighPart, - __in UCHAR Shift - ); - -ULONG64 -ShiftRight128 ( - __in ULONG64 LowPart, - __in ULONG64 HighPart, - __in UCHAR Shift - ); - -#pragma intrinsic(__shiftleft128) -#pragma intrinsic(__shiftright128) - -// -// Define functions to perform 128-bit multiplies. -// - -#define Multiply128 _mul128 - -LONG64 -Multiply128 ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand, - __out LONG64 *HighProduct - ); - -#pragma intrinsic(_mul128) - -#ifndef UnsignedMultiply128 - -#define UnsignedMultiply128 _umul128 - -ULONG64 -UnsignedMultiply128 ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand, - __out ULONG64 *HighProduct - ); - -#pragma intrinsic(_umul128) - -#endif - -__forceinline -LONG64 -MultiplyExtract128 ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand, - __in UCHAR Shift - ) - -{ - - LONG64 extractedProduct; - LONG64 highProduct; - LONG64 lowProduct; - BOOLEAN negate; - ULONG64 uhighProduct; - ULONG64 ulowProduct; - - lowProduct = Multiply128(Multiplier, Multiplicand, &highProduct); - negate = FALSE; - uhighProduct = (ULONG64)highProduct; - ulowProduct = (ULONG64)lowProduct; - if (highProduct < 0) { - negate = TRUE; - uhighProduct = (ULONG64)(-highProduct); - ulowProduct = (ULONG64)(-lowProduct); - if (ulowProduct != 0) { - uhighProduct -= 1; - } - } - - extractedProduct = (LONG64)ShiftRight128(ulowProduct, uhighProduct, Shift); - if (negate != FALSE) { - extractedProduct = -extractedProduct; - } - - return extractedProduct; -} - -__forceinline -ULONG64 -UnsignedMultiplyExtract128 ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand, - __in UCHAR Shift - ) - -{ - - ULONG64 extractedProduct; - ULONG64 highProduct; - ULONG64 lowProduct; - - lowProduct = UnsignedMultiply128(Multiplier, Multiplicand, &highProduct); - extractedProduct = ShiftRight128(lowProduct, highProduct, Shift); - return extractedProduct; -} - -// -// Define functions to read and write the uer TEB and the system PCR/PRCB. -// - -UCHAR -__readgsbyte ( - __in ULONG Offset - ); - -USHORT -__readgsword ( - __in ULONG Offset - ); - -ULONG -__readgsdword ( - __in ULONG Offset - ); - -ULONG64 -__readgsqword ( - __in ULONG Offset - ); - -VOID -__writegsbyte ( - __in ULONG Offset, - __in UCHAR Data - ); - -VOID -__writegsword ( - __in ULONG Offset, - __in USHORT Data - ); - -VOID -__writegsdword ( - __in ULONG Offset, - __in ULONG Data - ); - -VOID -__writegsqword ( - __in ULONG Offset, - __in ULONG64 Data - ); - -#pragma intrinsic(__readgsbyte) -#pragma intrinsic(__readgsword) -#pragma intrinsic(__readgsdword) -#pragma intrinsic(__readgsqword) -#pragma intrinsic(__writegsbyte) -#pragma intrinsic(__writegsword) -#pragma intrinsic(__writegsdword) -#pragma intrinsic(__writegsqword) - -#if !defined(_MANAGED) - -VOID -__incgsbyte ( - __in ULONG Offset - ); - -VOID -__addgsbyte ( - __in ULONG Offset, - __in UCHAR Value - ); - -VOID -__incgsword ( - __in ULONG Offset - ); - -VOID -__addgsword ( - __in ULONG Offset, - __in USHORT Value - ); - -VOID -__incgsdword ( - __in ULONG Offset - ); - -VOID -__addgsdword ( - __in ULONG Offset, - __in ULONG Value - ); - -VOID -__incgsqword ( - __in ULONG Offset - ); - -VOID -__addgsqword ( - __in ULONG Offset, - __in ULONG64 Value - ); - -#if 0 -#pragma intrinsic(__incgsbyte) -#pragma intrinsic(__addgsbyte) -#pragma intrinsic(__incgsword) -#pragma intrinsic(__addgsword) -#pragma intrinsic(__incgsdword) -#pragma intrinsic(__addgsdword) -#pragma intrinsic(__incgsqword) -#pragma intrinsic(__addgsqword) -#endif - -#endif - -#ifdef __cplusplus -} -#endif - -#endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - - -#endif // _AMD64_ - - -#ifdef _X86_ - -// -// Disable these two pragmas that evaluate to "sti" "cli" on x86 so that driver -// writers to not leave them inadvertantly in their code. -// - -#if !defined(MIDL_PASS) -#if !defined(RC_INVOKED) - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4164) // disable C4164 warning so that apps that - // build with /Od don't get weird errors ! -#ifdef _M_IX86 -#pragma function(_enable) -#pragma function(_disable) -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4164) // reenable C4164 warning -#endif - -#endif -#endif - -// end_ntddk end_nthal -#if defined(_M_IX86) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#ifdef __cplusplus -extern "C" { -#endif - - - -#if (_MSC_FULL_VER >= 14000101) - - -// -// Define bit test intrinsics. -// - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset -#define InterlockedBitTestAndSet _interlockedbittestandset -#define InterlockedBitTestAndReset _interlockedbittestandreset - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandreset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) -#pragma intrinsic(_interlockedbittestandset) -#pragma intrinsic(_interlockedbittestandreset) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse - -__success(return != 0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return != 0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) - -#else - -#pragma warning(push) -#pragma warning(disable:4035 4793) - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndSet ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock bts [ecx], eax - setc al - }; -} - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndReset ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock btr [ecx], eax - setc al - }; -} -#pragma warning(pop) - -#endif /* _MSC_FULL_VER >= 14000101 */ - -// -// [pfx_parse] - guard against PREfix intrinsic error -// -#if (_MSC_FULL_VER >= 140040816) || (defined(_PREFAST_) && (_MSC_VER >= 1400)) - -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 -#define InterlockedOr16 _InterlockedOr16 - -SHORT -_InterlockedAnd16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -_InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -SHORT -_InterlockedOr16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -#pragma intrinsic(_InterlockedAnd16) -#pragma intrinsic(_InterlockedCompareExchange16) -#pragma intrinsic(_InterlockedOr16) - -#endif /* _MSC_FULL_VER >= 140040816 */ - -#if !defined(_M_CEE_PURE) -#pragma warning(push) -#pragma warning(disable:4035 4793) - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndComplement ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock btc [ecx], eax - setc al - }; -} -#pragma warning(pop) -#endif /* _M_CEE_PURE */ - -// -// [pfx_parse] -// guard against __readfsbyte parsing error -// -#if (_MSC_FULL_VER >= 13012035) || defined(_PREFIX_) || defined(_PREFAST_) - -// -// Define FS referencing intrinsics -// - -UCHAR -__readfsbyte ( - __in ULONG Offset - ); - -USHORT -__readfsword ( - __in ULONG Offset - ); - -ULONG -__readfsdword ( - __in ULONG Offset - ); - -VOID -__writefsbyte ( - __in ULONG Offset, - __in UCHAR Data - ); - -VOID -__writefsword ( - __in ULONG Offset, - __in USHORT Data - ); - -VOID -__writefsdword ( - __in ULONG Offset, - __in ULONG Data - ); - -#pragma intrinsic(__readfsbyte) -#pragma intrinsic(__readfsword) -#pragma intrinsic(__readfsdword) -#pragma intrinsic(__writefsbyte) -#pragma intrinsic(__writefsword) -#pragma intrinsic(__writefsdword) - -#endif /* _MSC_FULL_VER >= 13012035 */ - -#if (_MSC_FULL_VER >= 140050727) || defined(_PREFIX_) || defined(_PREFAST_) - -#if !defined(_MANAGED) - -VOID -__incfsbyte ( - __in ULONG Offset - ); - -VOID -__addfsbyte ( - __in ULONG Offset, - __in UCHAR Value - ); - -VOID -__incfsword ( - __in ULONG Offset - ); - -VOID -__addfsword ( - __in ULONG Offset, - __in USHORT Value - ); - -VOID -__incfsdword ( - __in ULONG Offset - ); - -VOID -__addfsdword ( - __in ULONG Offset, - __in ULONG Value - ); - -#pragma intrinsic(__incfsbyte) -#pragma intrinsic(__addfsbyte) -#pragma intrinsic(__incfsword) -#pragma intrinsic(__addfsword) -#pragma intrinsic(__incfsdword) -#pragma intrinsic(__addfsdword) - -#endif - -#endif /* _MSC_FULL_VER >= 140050727 */ - -#if (_MSC_FULL_VER >= 140041204) || defined(_PREFIX_) || defined(_PREFAST_) - -VOID -_mm_pause ( - VOID - ); - -#pragma intrinsic(_mm_pause) - -#define YieldProcessor _mm_pause - -#else - -#if !defined(_M_CEE_PURE) -#define YieldProcessor() __asm { rep nop } -#endif // !defined(_M_CEE_PURE) - -#endif // (_MSC_FULL_VER >= 140041204) - -#ifdef __cplusplus -} -#endif - -#endif /* !defined(MIDL_PASS) || defined(_M_IX86) */ - -#endif //_X86_ - - -#if defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define bit test intrinsics. -// - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset - -#define BitTest64 _bittest64 -#define BitTestAndComplement64 _bittestandcomplement64 -#define BitTestAndSet64 _bittestandset64 -#define BitTestAndReset64 _bittestandreset64 - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -__checkReturn -BOOLEAN -_bittest64 ( - __in_bcount((Offset+7)/8) LONG64 const *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandcomplement64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandreset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) - -#pragma intrinsic(_bittest64) -#pragma intrinsic(_bittestandcomplement64) -#pragma intrinsic(_bittestandset64) -#pragma intrinsic(_bittestandreset64) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse -#define BitScanForward64 _BitScanForward64 -#define BitScanReverse64 _BitScanReverse64 - -__success(return!=0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanForward64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) - -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 - -SHORT -_InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -#pragma intrinsic(_InterlockedCompareExchange16) - -#ifdef __cplusplus -} -#endif - -#define InterlockedAdd _InterlockedAdd -#define InterlockedAddAcquire _InterlockedAdd_acq -#define InterlockedAddRelease _InterlockedAdd_rel - -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedIncrementAcquire _InterlockedIncrement_acq -#define InterlockedIncrementRelease _InterlockedIncrement_rel - -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedDecrementAcquire _InterlockedDecrement_acq -#define InterlockedDecrementRelease _InterlockedDecrement_rel - -#define InterlockedExchange _InterlockedExchange -#define InterlockedExchangeAcquire _InterlockedExchange_acq - -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedExchangeAddAcquire _InterlockedExchangeAdd_acq -#define InterlockedExchangeAddRelease _InterlockedExchangeAdd_rel - -#define InterlockedAdd64 _InterlockedAdd64 -#define InterlockedAddAcquire64 _InterlockedAdd64_acq -#define InterlockedAddRelease64 _InterlockedAdd64_rel - -#define InterlockedIncrement64 _InterlockedIncrement64 -#define InterlockedIncrementAcquire64 _InterlockedIncrement64_acq -#define InterlockedIncrementRelease64 _InterlockedIncrement64_rel - -#define InterlockedDecrement64 _InterlockedDecrement64 -#define InterlockedDecrementAcquire64 _InterlockedDecrement64_acq -#define InterlockedDecrementRelease64 _InterlockedDecrement64_rel - -#define InterlockedExchange64 _InterlockedExchange64 -#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq - -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 -#define InterlockedExchangeAddAcquire64 _InterlockedExchangeAdd64_acq -#define InterlockedExchangeAddRelease64 _InterlockedExchangeAdd64_rel - -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq -#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel - -#define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128 -#define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128_acq -#define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128_rel - -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq -#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel - -#define InterlockedExchangePointer _InterlockedExchangePointer -#define InterlockedExchangePointerAcquire _InterlockedExchangePointer_acq - -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel -#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq - - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a) - -#define InterlockedOr _InterlockedOr -#define InterlockedOrAcquire _InterlockedOr_acq -#define InterlockedOrRelease _InterlockedOr_rel -#define InterlockedOr8 _InterlockedOr8 -#define InterlockedOr8Acquire _InterlockedOr8_acq -#define InterlockedOr8Release _InterlockedOr8_rel -#define InterlockedOr16 _InterlockedOr16 -#define InterlockedOr16Acquire _InterlockedOr16_acq -#define InterlockedOr16Release _InterlockedOr16_rel -#define InterlockedOr64 _InterlockedOr64 -#define InterlockedOr64Acquire _InterlockedOr64_acq -#define InterlockedOr64Release _InterlockedOr64_rel -#define InterlockedXor _InterlockedXor -#define InterlockedXorAcquire _InterlockedXor_acq -#define InterlockedXorRelease _InterlockedXor_rel -#define InterlockedXor8 _InterlockedXor8 -#define InterlockedXor8Acquire _InterlockedXor8_acq -#define InterlockedXor8Release _InterlockedXor8_rel -#define InterlockedXor16 _InterlockedXor16 -#define InterlockedXor16Acquire _InterlockedXor16_acq -#define InterlockedXor16Release _InterlockedXor16_rel -#define InterlockedXor64 _InterlockedXor64 -#define InterlockedXor64Acquire _InterlockedXor64_acq -#define InterlockedXor64Release _InterlockedXor64_rel -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAcquire _InterlockedAnd_acq -#define InterlockedAndRelease _InterlockedAnd_rel -#define InterlockedAnd8 _InterlockedAnd8 -#define InterlockedAnd8Acquire _InterlockedAnd8_acq -#define InterlockedAnd8Release _InterlockedAnd8_rel -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedAnd16Acquire _InterlockedAnd16_acq -#define InterlockedAnd16Release _InterlockedAnd16_rel -#define InterlockedAnd64 _InterlockedAnd64 -#define InterlockedAnd64Acquire _InterlockedAnd64_acq -#define InterlockedAnd64Release _InterlockedAnd64_rel - -#ifdef __cplusplus -extern "C" { -#endif - -LONG -__cdecl -InterlockedAdd ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddAcquire ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddRelease ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONGLONG -__cdecl -InterlockedAdd64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAddAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - - -LONGLONG -__cdecl -InterlockedAddRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAcquire( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddAcquire( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddRelease( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONGLONG -__cdecl -InterlockedIncrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedExchange64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAcquire64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAdd64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64Exchange128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeAcquire128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeRelease128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointer ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerAcquire ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerRelease ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedExchangePointer( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -PVOID -__cdecl -InterlockedExchangePointerAcquire( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -LONG -__cdecl -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedOr8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedOr16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedOr64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedXor ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedXor8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedXor16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedXor64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedAnd8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedAnd16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedAnd64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -#pragma intrinsic(_InterlockedAdd) -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedIncrement_acq) -#pragma intrinsic(_InterlockedIncrement_rel) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedDecrement_acq) -#pragma intrinsic(_InterlockedDecrement_rel) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedCompareExchange_acq) -#pragma intrinsic(_InterlockedCompareExchange_rel) -#pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedAdd64) -#pragma intrinsic(_InterlockedIncrement64) -#pragma intrinsic(_InterlockedDecrement64) -#pragma intrinsic(_InterlockedExchange64) -#pragma intrinsic(_InterlockedExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64) -#pragma intrinsic(_InterlockedCompareExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64_rel) -#pragma intrinsic(_InterlockedCompare64Exchange128) -#pragma intrinsic(_InterlockedCompare64Exchange128_acq) -#pragma intrinsic(_InterlockedCompare64Exchange128_rel) -#pragma intrinsic(_InterlockedExchangeAdd64) -#pragma intrinsic(_InterlockedExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer_acq) -#pragma intrinsic(_InterlockedCompareExchangePointer_rel) -#pragma intrinsic(_InterlockedAdd_acq) -#pragma intrinsic(_InterlockedAdd_rel) -#pragma intrinsic(_InterlockedExchange_acq) -#pragma intrinsic(_InterlockedExchangeAdd_acq) -#pragma intrinsic(_InterlockedExchangeAdd_rel) -#pragma intrinsic(_InterlockedAdd64_acq) -#pragma intrinsic(_InterlockedAdd64_rel) -#pragma intrinsic(_InterlockedIncrement64_acq) -#pragma intrinsic(_InterlockedIncrement64_rel) -#pragma intrinsic(_InterlockedDecrement64_acq) -#pragma intrinsic(_InterlockedDecrement64_rel) -#pragma intrinsic(_InterlockedExchangeAdd64_acq) -#pragma intrinsic(_InterlockedExchangeAdd64_rel) -#pragma intrinsic(_InterlockedExchangePointer_acq) -#pragma intrinsic (_InterlockedOr) -#pragma intrinsic (_InterlockedOr_acq) -#pragma intrinsic (_InterlockedOr_rel) -#pragma intrinsic (_InterlockedOr8) -#pragma intrinsic (_InterlockedOr8_acq) -#pragma intrinsic (_InterlockedOr8_rel) -#pragma intrinsic (_InterlockedOr16) -#pragma intrinsic (_InterlockedOr16_acq) -#pragma intrinsic (_InterlockedOr16_rel) -#pragma intrinsic (_InterlockedOr64) -#pragma intrinsic (_InterlockedOr64_acq) -#pragma intrinsic (_InterlockedOr64_rel) -#pragma intrinsic (_InterlockedXor) -#pragma intrinsic (_InterlockedXor_acq) -#pragma intrinsic (_InterlockedXor_rel) -#pragma intrinsic (_InterlockedXor8) -#pragma intrinsic (_InterlockedXor8_acq) -#pragma intrinsic (_InterlockedXor8_rel) -#pragma intrinsic (_InterlockedXor16) -#pragma intrinsic (_InterlockedXor16_acq) -#pragma intrinsic (_InterlockedXor16_rel) -#pragma intrinsic (_InterlockedXor64) -#pragma intrinsic (_InterlockedXor64_acq) -#pragma intrinsic (_InterlockedXor64_rel) -#pragma intrinsic (_InterlockedAnd) -#pragma intrinsic (_InterlockedAnd_acq) -#pragma intrinsic (_InterlockedAnd_rel) -#pragma intrinsic (_InterlockedAnd8) -#pragma intrinsic (_InterlockedAnd8_acq) -#pragma intrinsic (_InterlockedAnd8_rel) -#pragma intrinsic (_InterlockedAnd16) -#pragma intrinsic (_InterlockedAnd16_acq) -#pragma intrinsic (_InterlockedAnd16_rel) -#pragma intrinsic (_InterlockedAnd64) -#pragma intrinsic (_InterlockedAnd64_acq) -#pragma intrinsic (_InterlockedAnd64_rel) - -#if !defined (InterlockedAnd64) - -#define InterlockedAnd64 InterlockedAnd64_Inline - -LONGLONG -FORCEINLINE -InterlockedAnd64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old & Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedAndAffinity InterlockedAnd64 - -#if !defined (InterlockedOr64) - -#define InterlockedOr64 InterlockedOr64_Inline - -LONGLONG -FORCEINLINE -InterlockedOr64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old | Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedOrAffinity InterlockedOr64 - -#if !defined (InterlockedXor64) - -#define InterlockedXor64 InterlockedXor64_Inline - -LONGLONG -FORCEINLINE -InterlockedXor64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old ^ Value, - Old) != Old); - - return Old; -} - -#endif - -#if !defined (InterlockedBitTestAndSet) - -#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset) - -#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndSet64) - -#define InterlockedBitTestAndSet64 InterlockedBitTestAndSet64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset64) - -#define InterlockedBitTestAndReset64 InterlockedBitTestAndReset64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd64 (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement) - -#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement64) - -#define InterlockedBitTestAndComplement64 InterlockedBitTestAndComplement64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) */ - - -typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP { - RelationProcessorCore, - RelationNumaNode, - RelationCache, - RelationProcessorPackage, - RelationGroup, - RelationAll = 0xffff -} LOGICAL_PROCESSOR_RELATIONSHIP; - -#define LTP_PC_SMT 0x1 - -typedef enum _PROCESSOR_CACHE_TYPE { - CacheUnified, - CacheInstruction, - CacheData, - CacheTrace -} PROCESSOR_CACHE_TYPE; - -#define CACHE_FULLY_ASSOCIATIVE 0xFF - -typedef struct _CACHE_DESCRIPTOR { - UCHAR Level; - UCHAR Associativity; - USHORT LineSize; - ULONG Size; - PROCESSOR_CACHE_TYPE Type; -} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR; - -typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { - ULONG_PTR ProcessorMask; - LOGICAL_PROCESSOR_RELATIONSHIP Relationship; - union { - struct { - UCHAR Flags; - } ProcessorCore; - struct { - ULONG NodeNumber; - } NumaNode; - CACHE_DESCRIPTOR Cache; - ULONGLONG Reserved[2]; - } DUMMYUNIONNAME; -} SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; - -typedef struct _PROCESSOR_RELATIONSHIP { - UCHAR Flags; - UCHAR Reserved[21]; - USHORT GroupCount; - __field_ecount(GroupCount) GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY]; -} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP; - -typedef struct _NUMA_NODE_RELATIONSHIP { - ULONG NodeNumber; - UCHAR Reserved[20]; - GROUP_AFFINITY GroupMask; -} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP; - -typedef struct _CACHE_RELATIONSHIP { - UCHAR Level; - UCHAR Associativity; - USHORT LineSize; - ULONG CacheSize; - PROCESSOR_CACHE_TYPE Type; - UCHAR Reserved[20]; - GROUP_AFFINITY GroupMask; -} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP; - -typedef struct _PROCESSOR_GROUP_INFO { - UCHAR MaximumProcessorCount; - UCHAR ActiveProcessorCount; - UCHAR Reserved[38]; - KAFFINITY ActiveProcessorMask; -} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO; - -typedef struct _GROUP_RELATIONSHIP { - USHORT MaximumGroupCount; - USHORT ActiveGroupCount; - UCHAR Reserved[20]; - PROCESSOR_GROUP_INFO GroupInfo[ANYSIZE_ARRAY]; -} GROUP_RELATIONSHIP, *PGROUP_RELATIONSHIP; - -__struct_bcount(Size) struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { - LOGICAL_PROCESSOR_RELATIONSHIP Relationship; - ULONG Size; - union { - PROCESSOR_RELATIONSHIP Processor; - NUMA_NODE_RELATIONSHIP NumaNode; - CACHE_RELATIONSHIP Cache; - GROUP_RELATIONSHIP Group; - } DUMMYUNIONNAME; -}; - -typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; - -// -// Define the I/O bus interface types. -// - -typedef enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal, - Isa, - Eisa, - MicroChannel, - TurboChannel, - PCIBus, - VMEBus, - NuBus, - PCMCIABus, - CBus, - MPIBus, - MPSABus, - ProcessorInternal, - InternalPowerBus, - PNPISABus, - PNPBus, - Vmcs, - MaximumInterfaceType -}INTERFACE_TYPE, *PINTERFACE_TYPE; - -// -// Define the DMA transfer widths. -// - -typedef enum _DMA_WIDTH { - Width8Bits, - Width16Bits, - Width32Bits, - MaximumDmaWidth -}DMA_WIDTH, *PDMA_WIDTH; - -// -// Define DMA transfer speeds. -// - -typedef enum _DMA_SPEED { - Compatible, - TypeA, - TypeB, - TypeC, - TypeF, - MaximumDmaSpeed -}DMA_SPEED, *PDMA_SPEED; - -// -// Define Interface reference/dereference routines for -// Interfaces exported by IRP_MN_QUERY_INTERFACE -// - -typedef VOID (*PINTERFACE_REFERENCE)(PVOID Context); -typedef VOID (*PINTERFACE_DEREFERENCE)(PVOID Context); - -// end_wdm -// begin_ntddk - -// -// Define types of bus information. -// - -typedef enum _BUS_DATA_TYPE { - ConfigurationSpaceUndefined = -1, - Cmos, - EisaConfiguration, - Pos, - CbusConfiguration, - PCIConfiguration, - VMEConfiguration, - NuBusConfiguration, - PCMCIAConfiguration, - MPIConfiguration, - MPSAConfiguration, - PNPISAConfiguration, - SgiInternalConfiguration, - MaximumBusDataType -} BUS_DATA_TYPE, *PBUS_DATA_TYPE; - - -#include - - -#if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -// -// Define intrinsic function to do in's and out's. -// - -#ifdef __cplusplus -extern "C" { -#endif - -UCHAR -__inbyte ( - __in USHORT Port - ); - -USHORT -__inword ( - __in USHORT Port - ); - -ULONG -__indword ( - __in USHORT Port - ); - -VOID -__outbyte ( - __in USHORT Port, - __in UCHAR Data - ); - -VOID -__outword ( - __in USHORT Port, - __in USHORT Data - ); - -VOID -__outdword ( - __in USHORT Port, - __in ULONG Data - ); - -VOID -__inbytestring ( - __in USHORT Port, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -__inwordstring ( - __in USHORT Port, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -__indwordstring ( - __in USHORT Port, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ); - -VOID -__outbytestring ( - __in USHORT Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -__outwordstring ( - __in USHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -__outdwordstring ( - __in USHORT Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -#pragma intrinsic(__inbyte) -#pragma intrinsic(__inword) -#pragma intrinsic(__indword) -#pragma intrinsic(__outbyte) -#pragma intrinsic(__outword) -#pragma intrinsic(__outdword) -#pragma intrinsic(__inbytestring) -#pragma intrinsic(__inwordstring) -#pragma intrinsic(__indwordstring) -#pragma intrinsic(__outbytestring) -#pragma intrinsic(__outwordstring) -#pragma intrinsic(__outdwordstring) - -#ifdef __cplusplus -} -#endif - -#endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#if defined(_AMD64_) && !defined(DSF_DRIVER) - -// -// I/O space read and write macros. -// -// The READ/WRITE_REGISTER_* calls manipulate I/O registers in MEMORY space. -// -// The READ/WRITE_PORT_* calls manipulate I/O registers in PORT space. -// - -#ifdef __cplusplus -extern "C" { -#endif - -__forceinline -UCHAR -READ_REGISTER_UCHAR ( - __in __drv_nonConstant volatile UCHAR *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -USHORT -READ_REGISTER_USHORT ( - __in __drv_nonConstant volatile USHORT *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -ULONG -READ_REGISTER_ULONG ( - __in __drv_nonConstant volatile ULONG *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -ULONG64 -READ_REGISTER_ULONG64 ( - __in __drv_nonConstant volatile ULONG64 *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Register, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsb(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Register, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsw(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Register, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsd(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_ULONG64 ( - __in __drv_nonConstant PULONG64 Register, - __out_ecount_full(Count) PULONG64 Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsq(Buffer, Register, Count); - return; -} - -__forceinline -VOID -WRITE_REGISTER_UCHAR ( - __in __drv_nonConstant volatile UCHAR *Register, - __in UCHAR Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_USHORT ( - __in __drv_nonConstant volatile USHORT *Register, - __in USHORT Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_ULONG ( - __in __drv_nonConstant volatile ULONG *Register, - __in ULONG Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_ULONG64 ( - __in __drv_nonConstant volatile ULONG64 *Register, - __in ULONG64 Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ) -{ - - __movsb(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ) -{ - - __movsw(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ) -{ - - __movsd(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_ULONG64 ( - __in __drv_nonConstant PULONG64 Register, - __in_ecount(Count) PULONG64 Buffer, - __in ULONG Count - ) -{ - - __movsq(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -UCHAR -READ_PORT_UCHAR ( - __in __drv_nonConstant PUCHAR Port - ) - -{ - UCHAR Result; - - _ReadWriteBarrier(); - Result = __inbyte((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - -__forceinline -USHORT -READ_PORT_USHORT ( - __in __drv_nonConstant PUSHORT Port - ) - -{ - USHORT Result; - - _ReadWriteBarrier(); - Result = __inword((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - -__forceinline -ULONG -READ_PORT_ULONG ( - __in __drv_nonConstant PULONG Port - ) - -{ - ULONG Result; - - _ReadWriteBarrier(); - Result = __indword((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - - -__forceinline -VOID -READ_PORT_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __inbytestring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -READ_PORT_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __inwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -READ_PORT_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Port, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __indwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __in UCHAR Value - ) - -{ - _ReadWriteBarrier(); - __outbyte((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __in USHORT Value - ) - -{ - _ReadWriteBarrier(); - __outword((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_ULONG ( - __in __drv_nonConstant PULONG Port, - __in ULONG Value - ) - -{ - _ReadWriteBarrier(); - __outdword((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outbytestring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outdwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -#ifdef __cplusplus -} -#endif - -#elif defined(_AMD64_) && defined(DSF_DRIVER) -#include -#endif - - -// -// Interrupt modes. -// - -typedef enum _KINTERRUPT_MODE { - LevelSensitive, - Latched -} KINTERRUPT_MODE; - -typedef enum _KINTERRUPT_POLARITY { - InterruptPolarityUnknown, - InterruptActiveHigh, - InterruptActiveLow -} KINTERRUPT_POLARITY, *PKINTERRUPT_POLARITY; - - -typedef enum _MEMORY_CACHING_TYPE_ORIG { - MmFrameBufferCached = 2 -} MEMORY_CACHING_TYPE_ORIG; - -typedef enum _MEMORY_CACHING_TYPE { - MmNonCached = FALSE, - MmCached = TRUE, - MmWriteCombined = MmFrameBufferCached, - MmHardwareCoherentCached, - MmNonCachedUnordered, // IA64 - MmUSWCCached, - MmMaximumCacheType -} MEMORY_CACHING_TYPE; - - -// -// Structures used by the kernel drivers to describe which ports must be -// hooked out directly from the V86 emulator to the driver. -// - -typedef enum _EMULATOR_PORT_ACCESS_TYPE { - Uchar, - Ushort, - Ulong -} EMULATOR_PORT_ACCESS_TYPE, *PEMULATOR_PORT_ACCESS_TYPE; - -// -// Access Modes -// - -#define EMULATOR_READ_ACCESS 0x01 -#define EMULATOR_WRITE_ACCESS 0x02 - -typedef struct _EMULATOR_ACCESS_ENTRY { - ULONG BasePort; - ULONG NumConsecutivePorts; - EMULATOR_PORT_ACCESS_TYPE AccessType; - UCHAR AccessMode; - UCHAR StringSupport; - PVOID Routine; -} EMULATOR_ACCESS_ENTRY, *PEMULATOR_ACCESS_ENTRY; - - -typedef struct _PCI_SLOT_NUMBER { - union { - struct { - ULONG DeviceNumber:5; - ULONG FunctionNumber:3; - ULONG Reserved:24; - } bits; - ULONG AsULONG; - } u; -} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; - - -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - -typedef struct _PCI_COMMON_HEADER { - USHORT VendorID; // (ro) - USHORT DeviceID; // (ro) - USHORT Command; // Device control - USHORT Status; - UCHAR RevisionID; // (ro) - UCHAR ProgIf; // (ro) - UCHAR SubClass; // (ro) - UCHAR BaseClass; // (ro) - UCHAR CacheLineSize; // (ro+) - UCHAR LatencyTimer; // (ro+) - UCHAR HeaderType; // (ro) - UCHAR BIST; // Built in self test - - union { - struct _PCI_HEADER_TYPE_0 { - ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; - ULONG CIS; - USHORT SubVendorID; - USHORT SubSystemID; - ULONG ROMBaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved1[3]; - ULONG Reserved2; - UCHAR InterruptLine; // - UCHAR InterruptPin; // (ro) - UCHAR MinimumGrant; // (ro) - UCHAR MaximumLatency; // (ro) - } type0; - - - } u; - -} PCI_COMMON_HEADER, *PPCI_COMMON_HEADER; - -#ifdef __cplusplus - -typedef struct _PCI_COMMON_CONFIG : PCI_COMMON_HEADER { - UCHAR DeviceSpecific[192]; -} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - -#else - -typedef struct _PCI_COMMON_CONFIG { - PCI_COMMON_HEADER DUMMYSTRUCTNAME; - UCHAR DeviceSpecific[192]; -} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - -#endif - -#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET (PCI_COMMON_CONFIG, DeviceSpecific)) -#define PCI_EXTENDED_CONFIG_LENGTH 0x1000 - -#define PCI_MAX_DEVICES 32 -#define PCI_MAX_FUNCTION 8 -#define PCI_MAX_BRIDGE_NUMBER 0xFF - -#define PCI_INVALID_VENDORID 0xFFFF - -// -// Bit encodings for PCI_COMMON_CONFIG.HeaderType -// - -#define PCI_MULTIFUNCTION 0x80 -#define PCI_DEVICE_TYPE 0x00 -#define PCI_BRIDGE_TYPE 0x01 -#define PCI_CARDBUS_BRIDGE_TYPE 0x02 - -#define PCI_CONFIGURATION_TYPE(PciData) \ - (((PPCI_COMMON_CONFIG)(PciData))->HeaderType & ~PCI_MULTIFUNCTION) - -#define PCI_MULTIFUNCTION_DEVICE(PciData) \ - ((((PPCI_COMMON_CONFIG)(PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) - -// -// Bit encodings for PCI_COMMON_CONFIG.Command -// - -#define PCI_ENABLE_IO_SPACE 0x0001 -#define PCI_ENABLE_MEMORY_SPACE 0x0002 -#define PCI_ENABLE_BUS_MASTER 0x0004 -#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 -#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 -#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 -#define PCI_ENABLE_PARITY 0x0040 // (ro+) -#define PCI_ENABLE_WAIT_CYCLE 0x0080 // (ro+) -#define PCI_ENABLE_SERR 0x0100 // (ro+) -#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 // (ro) -#define PCI_DISABLE_LEVEL_INTERRUPT 0x0400 - -// -// Bit encodings for PCI_COMMON_CONFIG.Status -// - -#define PCI_STATUS_INTERRUPT_PENDING 0x0008 -#define PCI_STATUS_CAPABILITIES_LIST 0x0010 // (ro) -#define PCI_STATUS_66MHZ_CAPABLE 0x0020 // (ro) -#define PCI_STATUS_UDF_SUPPORTED 0x0040 // (ro) -#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 // (ro) -#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 -#define PCI_STATUS_DEVSEL 0x0600 // 2 bits wide -#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 -#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 -#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 -#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 -#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 - -// -// The NT PCI Driver uses a WhichSpace parameter on its CONFIG_READ/WRITE -// routines. The following values are defined- -// - -#define PCI_WHICHSPACE_CONFIG 0x0 -#define PCI_WHICHSPACE_ROM 0x52696350 - -// -// PCI Capability IDs -// - -#define PCI_CAPABILITY_ID_POWER_MANAGEMENT 0x01 -#define PCI_CAPABILITY_ID_AGP 0x02 -#define PCI_CAPABILITY_ID_VPD 0x03 -#define PCI_CAPABILITY_ID_SLOT_ID 0x04 -#define PCI_CAPABILITY_ID_MSI 0x05 -#define PCI_CAPABILITY_ID_CPCI_HOTSWAP 0x06 -#define PCI_CAPABILITY_ID_PCIX 0x07 -#define PCI_CAPABILITY_ID_HYPERTRANSPORT 0x08 -#define PCI_CAPABILITY_ID_VENDOR_SPECIFIC 0x09 -#define PCI_CAPABILITY_ID_DEBUG_PORT 0x0A -#define PCI_CAPABILITY_ID_CPCI_RES_CTRL 0x0B -#define PCI_CAPABILITY_ID_SHPC 0x0C -#define PCI_CAPABILITY_ID_P2P_SSID 0x0D -#define PCI_CAPABILITY_ID_AGP_TARGET 0x0E -#define PCI_CAPABILITY_ID_SECURE 0x0F -#define PCI_CAPABILITY_ID_PCI_EXPRESS 0x10 -#define PCI_CAPABILITY_ID_MSIX 0x11 - -// -// All PCI Capability structures have the following header. -// -// CapabilityID is used to identify the type of the structure (is -// one of the PCI_CAPABILITY_ID values above. -// -// Next is the offset in PCI Configuration space (0x40 - 0xfc) of the -// next capability structure in the list, or 0x00 if there are no more -// entries. -// -typedef struct _PCI_CAPABILITIES_HEADER { - UCHAR CapabilityID; - UCHAR Next; -} PCI_CAPABILITIES_HEADER, *PPCI_CAPABILITIES_HEADER; - -// -// Power Management Capability -// - -typedef struct _PCI_PMC { - UCHAR Version:3; - UCHAR PMEClock:1; - UCHAR Rsvd1:1; - UCHAR DeviceSpecificInitialization:1; - UCHAR Rsvd2:2; - struct _PM_SUPPORT { - UCHAR Rsvd2:1; - UCHAR D1:1; - UCHAR D2:1; - UCHAR PMED0:1; - UCHAR PMED1:1; - UCHAR PMED2:1; - UCHAR PMED3Hot:1; - UCHAR PMED3Cold:1; - } Support; -} PCI_PMC, *PPCI_PMC; - -typedef struct _PCI_PMCSR { - USHORT PowerState:2; - USHORT Rsvd1:6; - USHORT PMEEnable:1; - USHORT DataSelect:4; - USHORT DataScale:2; - USHORT PMEStatus:1; -} PCI_PMCSR, *PPCI_PMCSR; - - -typedef struct _PCI_PMCSR_BSE { - UCHAR Rsvd1:6; - UCHAR D3HotSupportsStopClock:1; // B2_B3# - UCHAR BusPowerClockControlEnabled:1; // BPCC_EN -} PCI_PMCSR_BSE, *PPCI_PMCSR_BSE; - - -typedef struct _PCI_PM_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - // - // Power Management Capabilities (Offset = 2) - // - - union { - PCI_PMC Capabilities; - USHORT AsUSHORT; - } PMC; - - // - // Power Management Control/Status (Offset = 4) - // - - union { - PCI_PMCSR ControlStatus; - USHORT AsUSHORT; - } PMCSR; - - // - // PMCSR PCI-PCI Bridge Support Extensions - // - - union { - PCI_PMCSR_BSE BridgeSupport; - UCHAR AsUCHAR; - } PMCSR_BSE; - - // - // Optional read only 8 bit Data register. Contents controlled by - // DataSelect and DataScale in ControlStatus. - // - - UCHAR Data; - -} PCI_PM_CAPABILITY, *PPCI_PM_CAPABILITY; - -// end_wdm -// begin_ntddk - -// -// AGP Capabilities -// -typedef struct _PCI_AGP_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - USHORT Minor:4; - USHORT Major:4; - USHORT Rsvd1:8; - - struct _PCI_AGP_STATUS { - ULONG Rate:3; - ULONG Agp3Mode:1; - ULONG FastWrite:1; - ULONG FourGB:1; - ULONG HostTransDisable:1; - ULONG Gart64:1; - ULONG ITA_Coherent:1; - ULONG SideBandAddressing:1; // SBA - ULONG CalibrationCycle:3; - ULONG AsyncRequestSize:3; - ULONG Rsvd1:1; - ULONG Isoch:1; - ULONG Rsvd2:6; - ULONG RequestQueueDepthMaximum:8; // RQ - } AGPStatus; - - struct _PCI_AGP_COMMAND { - ULONG Rate:3; - ULONG Rsvd1:1; - ULONG FastWriteEnable:1; - ULONG FourGBEnable:1; - ULONG Rsvd2:1; - ULONG Gart64:1; - ULONG AGPEnable:1; - ULONG SBAEnable:1; - ULONG CalibrationCycle:3; - ULONG AsyncReqSize:3; - ULONG Rsvd3:8; - ULONG RequestQueueDepth:8; - } AGPCommand; - -} PCI_AGP_CAPABILITY, *PPCI_AGP_CAPABILITY; - -// -// An AGPv3 Target must have an extended capability, -// but it's only present for a Master when the Isoch -// bit is set in its status register -// -typedef enum _EXTENDED_AGP_REGISTER { - IsochStatus, - AgpControl, - ApertureSize, - AperturePageSize, - GartLow, - GartHigh, - IsochCommand -} EXTENDED_AGP_REGISTER, *PEXTENDED_AGP_REGISTER; - -typedef struct _PCI_AGP_ISOCH_STATUS { - ULONG ErrorCode: 2; - ULONG Rsvd1: 1; - ULONG Isoch_L: 3; - ULONG Isoch_Y: 2; - ULONG Isoch_N: 8; - ULONG Rsvd2: 16; -} PCI_AGP_ISOCH_STATUS, *PPCI_AGP_ISOCH_STATUS; - -typedef struct _PCI_AGP_CONTROL { - ULONG Rsvd1: 7; - ULONG GTLB_Enable: 1; - ULONG AP_Enable: 1; - ULONG CAL_Disable: 1; - ULONG Rsvd2: 22; -} PCI_AGP_CONTROL, *PPCI_AGP_CONTROL; - -typedef struct _PCI_AGP_APERTURE_PAGE_SIZE { - USHORT PageSizeMask: 11; - USHORT Rsvd1: 1; - USHORT PageSizeSelect: 4; -} PCI_AGP_APERTURE_PAGE_SIZE, *PPCI_AGP_APERTURE_PAGE_SIZE; - -typedef struct _PCI_AGP_ISOCH_COMMAND { - USHORT Rsvd1: 6; - USHORT Isoch_Y: 2; - USHORT Isoch_N: 8; -} PCI_AGP_ISOCH_COMMAND, *PPCI_AGP_ISOCH_COMMAND; - -typedef struct PCI_AGP_EXTENDED_CAPABILITY { - - PCI_AGP_ISOCH_STATUS IsochStatus; - -// -// Target only ----------------<<-begin->> -// - PCI_AGP_CONTROL AgpControl; - USHORT ApertureSize; - PCI_AGP_APERTURE_PAGE_SIZE AperturePageSize; - ULONG GartLow; - ULONG GartHigh; -// -// ------------------------------<<-end->> -// - - PCI_AGP_ISOCH_COMMAND IsochCommand; - -} PCI_AGP_EXTENDED_CAPABILITY, *PPCI_AGP_EXTENDED_CAPABILITY; - - -#define PCI_AGP_RATE_1X 0x1 -#define PCI_AGP_RATE_2X 0x2 -#define PCI_AGP_RATE_4X 0x4 - -// end_ntddk -// begin_wdm - -// -// PCI-X Capability -// - -typedef struct { - - PCI_CAPABILITIES_HEADER Header; - - union { - struct { - USHORT DataParityErrorRecoveryEnable:1; - USHORT EnableRelaxedOrdering:1; - USHORT MaxMemoryReadByteCount:2; - USHORT MaxOutstandingSplitTransactions:3; - USHORT Reserved:9; - } bits; - USHORT AsUSHORT; - } Command; - - union { - struct { - ULONG FunctionNumber:3; - ULONG DeviceNumber:5; - ULONG BusNumber:8; - ULONG Device64Bit:1; - ULONG Capable133MHz:1; - ULONG SplitCompletionDiscarded:1; - ULONG UnexpectedSplitCompletion:1; - ULONG DeviceComplexity:1; - ULONG DesignedMaxMemoryReadByteCount:2; - ULONG DesignedMaxOutstandingSplitTransactions:3; - ULONG DesignedMaxCumulativeReadSize:3; - ULONG ReceivedSplitCompletionErrorMessage:1; - ULONG CapablePCIX266:1; - ULONG CapablePCIX533:1; - } bits; - ULONG AsULONG; - } Status; -} PCI_X_CAPABILITY, *PPCI_X_CAPABILITY; - -// end_wdm -// begin_ntddk - -// -// PCI-X Bridge Capability -// - -// -// Values for BusModeFrequency in the SecondaryStatus register -// -#define PCIX_MODE_CONVENTIONAL_PCI 0x0 -#define PCIX_MODE1_66MHZ 0x1 -#define PCIX_MODE1_100MHZ 0x2 -#define PCIX_MODE1_133MHZ 0x3 -#define PCIX_MODE2_266_66MHZ 0x9 -#define PCIX_MODE2_266_100MHZ 0xA -#define PCIX_MODE2_266_133MHZ 0xB -#define PCIX_MODE2_533_66MHZ 0xD -#define PCIX_MODE2_533_100MHZ 0xE -#define PCIX_MODE2_533_133MHZ 0xF - -// -// Values for the Version in the SecondaryStatus register -// -#define PCIX_VERSION_MODE1_ONLY 0x0 -#define PCIX_VERSION_MODE2_ECC 0x1 -#define PCIX_VERSION_DUAL_MODE_ECC 0x2 - -typedef struct _PCIX_BRIDGE_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - union { - struct { - USHORT Bus64Bit:1; - USHORT Bus133MHzCapable:1; - USHORT SplitCompletionDiscarded:1; - USHORT UnexpectedSplitCompletion:1; - USHORT SplitCompletionOverrun:1; - USHORT SplitRequestDelayed:1; - USHORT BusModeFrequency:4; // PCIX_MODE_x - USHORT Rsvd:2; - USHORT Version:2; // PCIX_VERSION_x - USHORT Bus266MHzCapable:1; - USHORT Bus533MHzCapable:1; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; - } SecondaryStatus; - - union { - struct { - ULONG FunctionNumber:3; - ULONG DeviceNumber:5; - ULONG BusNumber:8; - ULONG Device64Bit:1; - ULONG Device133MHzCapable:1; - ULONG SplitCompletionDiscarded:1; - ULONG UnexpectedSplitCompletion:1; - ULONG SplitCompletionOverrun:1; - ULONG SplitRequestDelayed:1; - ULONG Rsvd:7; - ULONG DIMCapable:1; - ULONG Device266MHzCapable:1; - ULONG Device533MHzCapable:1; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } BridgeStatus; - - USHORT UpstreamSplitTransactionCapacity; - USHORT UpstreamSplitTransactionLimit; - - USHORT DownstreamSplitTransactionCapacity; - USHORT DownstreamSplitTransactionLimit; - - union { - struct { - ULONG SelectSecondaryRegisters:1; - ULONG ErrorPresentInOtherBank:1; - ULONG AdditionalCorrectableError:1; - ULONG AdditionalUncorrectableError:1; - ULONG ErrorPhase:3; - ULONG ErrorCorrected:1; - ULONG Syndrome:8; - ULONG ErrorFirstCommand:4; - ULONG ErrorSecondCommand:4; - ULONG ErrorUpperAttributes:4; - ULONG ControlUpdateEnable:1; - ULONG Rsvd:1; - ULONG DisableSingleBitCorrection:1; - ULONG EccMode:1; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } EccControlStatus; - - ULONG EccFirstAddress; - ULONG EccSecondAddress; - ULONG EccAttribute; - -} PCIX_BRIDGE_CAPABILITY, *PPCIX_BRIDGE_CAPABILITY; - -// -// PCI to PCI Bridge Subsystem ID Capability -// -typedef struct _PCI_SUBSYSTEM_IDS_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - USHORT Reserved; - USHORT SubVendorID; - USHORT SubSystemID; - -} PCI_SUBSYSTEM_IDS_CAPABILITY, *PPCI_SUBSYSTEM_IDS_CAPABILITY; - -// -// _OSC is used by OSPM to query the capabilities of a device and to -// communicate the features supported by the device driver to the platform. -// The _OSC interface for PCI host bridge devices that originate PCI, PCI-X or -// PCI Express hierarchies is identified by a UUID of {33db4d5b-1ff7-401c-9657- -// 7441c03dd766}. A revision ID of 1 indicates that the capabilities buffer is -// composed of 3 DWORDs. -// The first DWORD is common across all OSC implementations and includes status -// and error information. -// The second DWORD (Support Field) provides information regarding OS supported -// features. -// The third DWORD (Control Field) is used to submit request for control of -// associated features. If any bits in the control field are returned cleared, -// then the respective feature is unsupported by the platform and must not be -// enabled. -// According to the PCI Firmware Specification a machine with multiple host -// bridge devices should report the same capabilities for all host bridges -// and also negotiate control of the features in the same way. -// - -#define OSC_FIRMWARE_FAILURE 0x02 -#define OSC_UNRECOGNIZED_UUID 0x04 -#define OSC_UNRECOGNIZED_REVISION 0x08 -#define OSC_CAPABILITIES_MASKED 0x10 - -#define PCI_ROOT_BUS_OSC_METHOD_CAPABILITY_REVISION 0x01 - -// -// The following declarations pertain to the second and third DWORD in -// evaluation of _OSC for PCI host bridge devices. -// - -typedef struct _PCI_ROOT_BUS_OSC_SUPPORT_FIELD { - union { - struct { - ULONG ExtendedConfigOpRegions:1; - ULONG ActiveStatePowerManagement:1; - ULONG ClockPowerManagement:1; - ULONG SegmentGroups:1; - ULONG MessageSignaledInterrupts:1; - ULONG WindowsHardwareErrorArchitecture:1; - ULONG Reserved:26; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } u; -} PCI_ROOT_BUS_OSC_SUPPORT_FIELD, *PPCI_ROOT_BUS_OSC_SUPPORT_FIELD; - -typedef struct _PCI_ROOT_BUS_OSC_CONTROL_FIELD { - union { - struct { - ULONG ExpressNativeHotPlug:1; - ULONG ShpcNativeHotPlug:1; - ULONG ExpressNativePME:1; - ULONG ExpressAdvancedErrorReporting:1; - ULONG ExpressCapabilityStructure:1; - ULONG Reserved:27; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } u; -} PCI_ROOT_BUS_OSC_CONTROL_FIELD, *PPCI_ROOT_BUS_OSC_CONTROL_FIELD; - -// -// An enumerator for the PCI physical and electrical interface. -// - -typedef enum _PCI_HARDWARE_INTERFACE { - - PciConventional, - PciXMode1, - PciXMode2, - PciExpress - -} PCI_HARDWARE_INTERFACE, *PPCI_HARDWARE_INTERFACE; - -typedef enum { - - BusWidth32Bits, - BusWidth64Bits - -} PCI_BUS_WIDTH; - -typedef struct _PCI_ROOT_BUS_HARDWARE_CAPABILITY { - - // - // Describes the secondary side of a PCI root bus. - // - - PCI_HARDWARE_INTERFACE SecondaryInterface; - - // - // These additional capabilities are available when each of the following - // is true. - // 1. The secondary side of a PCI root bus operates in conventional or - // PCI-X mode. - // 2. The PCI root bus has a hardware ID or compatible ID of PNP0A03. - // 3. A _DSM function 4 is defined for the root bus. - // - - struct { - - // - // This boolean indicates if the remaining fields describing the bus - // capabilities are valid or not. - // - - BOOLEAN BusCapabilitiesFound; - - - // - // Provides information on current and supported speeds/modes. - // - - ULONG CurrentSpeedAndMode; - ULONG SupportedSpeedsAndModes; - - // - // Describes the root bus capability on forwarding of Device ID message - // transactions. - // - - BOOLEAN DeviceIDMessagingCapable; - - // - // Provides the width for a PCI interface. - // - - PCI_BUS_WIDTH SecondaryBusWidth; - } DUMMYSTRUCTNAME; - - // - // Fields describing features supported as well as control for them from - // the bios. - // - - PCI_ROOT_BUS_OSC_SUPPORT_FIELD OscFeatureSupport; - PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlRequest; - PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlGranted; - -} PCI_ROOT_BUS_HARDWARE_CAPABILITY, *PPCI_ROOT_BUS_HARDWARE_CAPABILITY; - -// -// PCI Express Capability -// - -typedef union _PCI_EXPRESS_CAPABILITIES_REGISTER { - - struct { - - USHORT CapabilityVersion:4; - USHORT DeviceType:4; // PCI_EXPRESS_DEVICE_TYPE - USHORT SlotImplemented:1; - USHORT InterruptMessageNumber:5; - USHORT Rsvd:2; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_CAPABILITIES_REGISTER, *PPCI_EXPRESS_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER { - - struct { - - ULONG MaxPayloadSizeSupported:3; // EXPRESS_MAX_PAYLOAD_SIZE - ULONG PhantomFunctionsSupported:2; - ULONG ExtendedTagSupported:1; - ULONG L0sAcceptableLatency:3; // EXPRESS_L0S_LATENCY - ULONG L1AcceptableLatency:3; // EXPRESS_L1_LATENCY - ULONG Undefined:3; - ULONG RoleBasedErrorReporting:1; - ULONG Rsvd1:2; - ULONG CapturedSlotPowerLimit:8; - ULONG CapturedSlotPowerLimitScale:2; - ULONG Rsvd2:4; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER, *PPCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER; - -// -// The low 3 bits of the PCI Express device control register dictate whether -// a device that implements AER routes error messages to the root complex. -// This mask is used when programming the AER bits in the device control -// register. -// - -#define PCI_EXPRESS_AER_DEVICE_CONTROL_MASK 0x07; - -typedef union _PCI_EXPRESS_DEVICE_CONTROL_REGISTER { - - struct { - - USHORT CorrectableErrorEnable:1; - USHORT NonFatalErrorEnable:1; - USHORT FatalErrorEnable:1; - USHORT UnsupportedRequestErrorEnable:1; - USHORT EnableRelaxedOrder:1; - USHORT MaxPayloadSize:3; // EXPRESS_MAX_PAYLOAD_SIZE - USHORT ExtendedTagEnable:1; - USHORT PhantomFunctionsEnable:1; - USHORT AuxPowerEnable:1; - USHORT NoSnoopEnable:1; - USHORT MaxReadRequestSize:3; // EXPRESS_MAX_PAYLOAD_SIZE - USHORT BridgeConfigRetryEnable:1; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_DEVICE_CONTROL_REGISTER, *PPCI_EXPRESS_DEVICE_CONTROL_REGISTER; - -// -// The low 4 bits of the PCI Express device status register hold AER device -// status. This mask is used when programming the AER bits in the device status -// register. -// - -#define PCI_EXPRESS_AER_DEVICE_STATUS_MASK 0x0F; - -typedef union _PCI_EXPRESS_DEVICE_STATUS_REGISTER { - - struct { - - USHORT CorrectableErrorDetected:1; - USHORT NonFatalErrorDetected:1; - USHORT FatalErrorDetected:1; - USHORT UnsupportedRequestDetected:1; - USHORT AuxPowerDetected:1; - USHORT TransactionsPending:1; - USHORT Rsvd:10; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_DEVICE_STATUS_REGISTER, *PPCI_EXPRESS_DEVICE_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_LINK_CAPABILITIES_REGISTER { - - struct { - - ULONG MaximumLinkSpeed:4; - ULONG MaximumLinkWidth:6; - ULONG ActiveStatePMSupport:2; // EXPRESS_ASPM_CONFIG - ULONG L0sExitLatency:3; // EXPRESS_L0S_LATENCY - ULONG L1ExitLatency:3; // EXPRESS_L1_LATENCY - ULONG ClockPowerManagement:1; - ULONG SurpriseDownErrorReportingCapable:1; - ULONG DataLinkLayerActiveReportingCapable:1; - ULONG Rsvd:3; - ULONG PortNumber:8; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_LINK_CAPABILITIES_REGISTER, *PPCI_EXPRESS_LINK_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_LINK_CONTROL_REGISTER { - - struct { - - USHORT ActiveStatePMControl:2; // EXPRESS_ASPM_CONFIG - USHORT Rsvd1:1; - USHORT ReadCompletionBoundary:1; // EXPRESS_RCB - USHORT LinkDisable:1; - USHORT RetrainLink:1; - USHORT CommonClockConfig:1; - USHORT ExtendedSynch:1; - USHORT EnableClockPowerManagement:1; - USHORT Rsvd2:7; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_LINK_CONTROL_REGISTER, *PPCI_EXPRESS_LINK_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_LINK_STATUS_REGISTER { - - struct { - - USHORT LinkSpeed:4; - USHORT LinkWidth:6; - USHORT Undefined:1; - USHORT LinkTraining:1; - USHORT SlotClockConfig:1; - USHORT DataLinkLayerActive:1; - USHORT Rsvd:2; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_LINK_STATUS_REGISTER, *PPCI_EXPRESS_LINK_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER { - - struct { - - ULONG AttentionButtonPresent:1; - ULONG PowerControllerPresent:1; - ULONG MRLSensorPresent:1; - ULONG AttentionIndicatorPresent:1; - ULONG PowerIndicatorPresent:1; - ULONG HotPlugSurprise:1; - ULONG HotPlugCapable:1; - ULONG SlotPowerLimit:8; - ULONG SlotPowerLimitScale:2; - ULONG ElectromechanicalLockPresent:1; - ULONG NoCommandCompletedSupport:1; - ULONG PhysicalSlotNumber:13; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_SLOT_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_CONTROL_REGISTER { - - struct { - - USHORT AttentionButtonEnable:1; - USHORT PowerFaultDetectEnable:1; - USHORT MRLSensorEnable:1; - USHORT PresenceDetectEnable:1; - USHORT CommandCompletedEnable:1; - USHORT HotPlugInterruptEnable:1; - USHORT AttentionIndicatorControl:2; // EXPRESS_INDICATOR_STATE - USHORT PowerIndicatorControl:2; // EXPRESS_INDICATOR_STATE - USHORT PowerControllerControl:1; // EXPRESS_POWER_STATE - USHORT ElectromechanicalLockControl:1; - USHORT DataLinkStateChangeEnable:1; - USHORT Rsvd:3; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SLOT_CONTROL_REGISTER, *PPCI_EXPRESS_SLOT_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_STATUS_REGISTER { - - struct { - - USHORT AttentionButtonPressed:1; - USHORT PowerFaultDetected:1; - USHORT MRLSensorChanged:1; - USHORT PresenceDetectChanged:1; - USHORT CommandCompleted:1; - USHORT MRLSensorState:1; // EXPRESS_MRL_STATE - USHORT PresenceDetectState:1; // EXPRESS_CARD_PRESENCE - USHORT ElectromechanicalLockEngaged:1; - USHORT DataLinkStateChanged:1; - USHORT Rsvd:7; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SLOT_STATUS_REGISTER, *PPCI_EXPRESS_SLOT_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_CONTROL_REGISTER { - - struct { - - USHORT CorrectableSerrEnable:1; - USHORT NonFatalSerrEnable:1; - USHORT FatalSerrEnable:1; - USHORT PMEInterruptEnable:1; - USHORT CRSSoftwareVisibilityEnable:1; - USHORT Rsvd:11; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_ROOT_CONTROL_REGISTER, *PPCI_EXPRESS_ROOT_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER { - - struct { - - USHORT CRSSoftwareVisibility:1; - USHORT Rsvd:15; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_ROOT_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_STATUS_REGISTER { - - struct { - - ULONG PMERequestorId:16; // PCI_EXPRESS_REQUESTOR_ID - ULONG PMEStatus:1; - ULONG PMEPending:1; - ULONG Rsvd:14; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_STATUS_REGISTER, *PPCI_EXPRESS_ROOT_STATUS_REGISTER; - -// -// PCI Express Capability -// - -typedef struct _PCI_EXPRESS_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - PCI_EXPRESS_CAPABILITIES_REGISTER ExpressCapabilities; - - PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER DeviceCapabilities; - - PCI_EXPRESS_DEVICE_CONTROL_REGISTER DeviceControl; - PCI_EXPRESS_DEVICE_STATUS_REGISTER DeviceStatus; - - PCI_EXPRESS_LINK_CAPABILITIES_REGISTER LinkCapabilities; - - PCI_EXPRESS_LINK_CONTROL_REGISTER LinkControl; - PCI_EXPRESS_LINK_STATUS_REGISTER LinkStatus; - - PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER SlotCapabilities; - - PCI_EXPRESS_SLOT_CONTROL_REGISTER SlotControl; - PCI_EXPRESS_SLOT_STATUS_REGISTER SlotStatus; - - PCI_EXPRESS_ROOT_CONTROL_REGISTER RootControl; - PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER RootCapabilities; - - PCI_EXPRESS_ROOT_STATUS_REGISTER RootStatus; - -} PCI_EXPRESS_CAPABILITY, *PPCI_EXPRESS_CAPABILITY; - -typedef enum { - - MRLClosed = 0, - MRLOpen - -} PCI_EXPRESS_MRL_STATE; - -typedef enum { - - SlotEmpty = 0, - CardPresent - -} PCI_EXPRESS_CARD_PRESENCE; - -typedef enum { - - IndicatorOn = 1, - IndicatorBlink, - IndicatorOff - -} PCI_EXPRESS_INDICATOR_STATE; - -typedef enum { - - PowerOn = 0, - PowerOff - -} PCI_EXPRESS_POWER_STATE; - -typedef enum { - - L0sEntrySupport = 1, - L0sAndL1EntrySupport = 3 - -} PCI_EXPRESS_ASPM_SUPPORT; - -typedef enum { - - L0sAndL1EntryDisabled, - L0sEntryEnabled, - L1EntryEnabled, - L0sAndL1EntryEnabled - -} PCI_EXPRESS_ASPM_CONTROL; - -typedef enum { - - L0s_Below64ns = 0, - L0s_64ns_128ns, - L0s_128ns_256ns, - L0s_256ns_512ns, - L0s_512ns_1us, - L0s_1us_2us, - L0s_2us_4us, - L0s_Above4us - -} PCI_EXPRESS_L0s_EXIT_LATENCY; - -typedef enum { - - L1_Below1us = 0, - L1_1us_2us, - L1_2us_4us, - L1_4us_8us, - L1_8us_16us, - L1_16us_32us, - L1_32us_64us, - L1_Above64us - -} PCI_EXPRESS_L1_EXIT_LATENCY; - -typedef enum { - - PciExpressEndpoint = 0, - PciExpressLegacyEndpoint, - PciExpressRootPort = 4, - PciExpressUpstreamSwitchPort, - PciExpressDownstreamSwitchPort, - PciExpressToPciXBridge, - PciXToExpressBridge, - PciExpressRootComplexIntegratedEndpoint, - PciExpressRootComplexEventCollector - -} PCI_EXPRESS_DEVICE_TYPE; - -typedef enum { - - MaxPayload128Bytes = 0, - MaxPayload256Bytes, - MaxPayload512Bytes, - MaxPayload1024Bytes, - MaxPayload2048Bytes, - MaxPayload4096Bytes - -} PCI_EXPRESS_MAX_PAYLOAD_SIZE; - -typedef union _PCI_EXPRESS_PME_REQUESTOR_ID { - - struct { - - USHORT FunctionNumber:3; - USHORT DeviceNumber:5; - USHORT BusNumber:8; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_PME_REQUESTOR_ID, *PPCI_EXPRESS_PME_REQUESTOR_ID; - -// end_ntddk -// begin_wdm - -// -// PCI Express Extended Capabilities. -// - -#define PCI_EXPRESS_ADVANCED_ERROR_REPORTING_CAP_ID 0x0001 -#define PCI_EXPRESS_VIRTUAL_CHANNEL_CAP_ID 0x0002 -#define PCI_EXPRESS_DEVICE_SERIAL_NUMBER_CAP_ID 0x0003 -#define PCI_EXPRESS_POWER_BUDGETING_CAP_ID 0x0004 -#define PCI_EXPRESS_RC_LINK_DECLARATION_CAP_ID 0x0005 -#define PCI_EXPRESS_RC_INTERNAL_LINK_CONTROL_CAP_ID 0x0006 -#define PCI_EXPRESS_RC_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_CAP_ID 0x0007 -#define PCI_EXPRESS_MFVC_CAP_ID 0x0008 -#define PCI_EXPRESS_VC_AND_MFVC_CAP_ID 0x0009 -#define PCI_EXPRESS_RCRB_HEADER_CAP_ID 0x000A -#define PCI_EXPRESS_SINGLE_ROOT_IO_VIRTUALIZATION_CAP_ID 0x0010 - -// -// All Enhanced capabilities have the following header. -// - -typedef struct _PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER { - - USHORT CapabilityID; - USHORT Version:4; - USHORT Next:12; - -} PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER, *PPCI_EXPRESS_ENHANCED_CAPABILITY_HEADER; - -// -// Serial Number Capability. -// - -typedef struct _PCI_EXPRESS_SERIAL_NUMBER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - ULONG LowSerialNumber; - ULONG HighSerialNumber; - -} PCI_EXPRESS_SERIAL_NUMBER_CAPABILITY, *PPCI_EXPRESS_SERIAL_NUMBER_CAPABILITY; - -// -// PCI Express Advanced Error Reporting structures. -// - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY; - -typedef union _PCI_EXPRESS_CORRECTABLE_ERROR_STATUS { - - struct { - ULONG ReceiverError:1; - ULONG Reserved1:5; - ULONG BadTLP:1; - ULONG BadDLLP:1; - ULONG ReplayNumRollover:1; - ULONG Reserved2:3; - ULONG ReplayTimerTimeout:1; - ULONG AdvisoryNonFatalError:1; - ULONG Reserved3:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_CORRECTABLE_ERROR_STATUS, *PPCI_CORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_CORRECTABLE_ERROR_MASK { - - struct { - ULONG ReceiverError:1; - ULONG Reserved1:5; - ULONG BadTLP:1; - ULONG BadDLLP:1; - ULONG ReplayNumRollover:1; - ULONG Reserved2:3; - ULONG ReplayTimerTimeout:1; - ULONG AdvisoryNonFatalError:1; - ULONG Reserved3:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_CORRECTABLE_ERROR_MASK, *PPCI_CORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_AER_CAPABILITIES { - - struct { - ULONG FirstErrorPointer:5; - ULONG ECRCGenerationCapable:1; - ULONG ECRCGenerationEnable:1; - ULONG ECRCCheckCapable:1; - ULONG ECRCCheckEnable:1; - ULONG Reserved:23; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_AER_CAPABILITIES, *PPCI_EXPRESS_AER_CAPABILITIES; - -typedef union _PCI_EXPRESS_ROOT_ERROR_COMMAND { - - struct { - ULONG CorrectableErrorReportingEnable:1; - ULONG NonFatalErrorReportingEnable:1; - ULONG FatalErrorReportingEnable:1; - ULONG Reserved:29; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_ERROR_COMMAND, *PPCI_EXPRESS_ROOT_ERROR_COMMAND; - -typedef union _PCI_EXPRESS_ROOT_ERROR_STATUS { - - struct { - ULONG CorrectableErrorReceived:1; - ULONG MultipleCorrectableErrorsReceived:1; - ULONG UncorrectableErrorReceived:1; - ULONG MultipleUncorrectableErrorsReceived:1; - ULONG FirstUncorrectableFatal:1; - ULONG NonFatalErrorMessagesReceived:1; - ULONG FatalErrorMessagesReceived:1; - ULONG Reserved:20; - ULONG AdvancedErrorInterruptMessageNumber:5; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_ERROR_STATUS, *PPCI_EXPRESS_ROOT_ERROR_STATUS; - -typedef union _PCI_EXPRESS_ERROR_SOURCE_ID { - - struct { - USHORT CorrectableSourceIdFun:3; - USHORT CorrectableSourceIdDev:5; - USHORT CorrectableSourceIdBus:8; - USHORT UncorrectableSourceIdFun:3; - USHORT UncorrectableSourceIdDev:5; - USHORT UncorrectableSourceIdBus:8; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ERROR_SOURCE_ID, *PPCI_EXPRESS_ERROR_SOURCE_ID; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY; - -typedef union _PCI_EXPRESS_SEC_AER_CAPABILITIES { - - struct { - ULONG SecondaryUncorrectableFirstErrorPtr:5; - ULONG Reserved:27; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_AER_CAPABILITIES, *PPCI_EXPRESS_SEC_AER_CAPABILITIES; - -#define ROOT_CMD_ENABLE_CORRECTABLE_ERROR_REPORTING 0x00000001 -#define ROOT_CMD_ENABLE_NONFATAL_ERROR_REPORTING 0x00000002 -#define ROOT_CMD_ENABLE_FATAL_ERROR_REPORTING 0x00000004 - -#define ROOT_CMD_ERROR_REPORTING_ENABLE_MASK \ - (ROOT_CMD_ENABLE_FATAL_ERROR_REPORTING | \ - ROOT_CMD_ENABLE_NONFATAL_ERROR_REPORTING | \ - ROOT_CMD_ENABLE_CORRECTABLE_ERROR_REPORTING) - -// -// Advanced Error Reporting Capability structure. -// - -typedef struct _PCI_EXPRESS_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS SecUncorrectableErrorStatus; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK SecUncorrectableErrorMask; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY SecUncorrectableErrorSeverity; - PCI_EXPRESS_SEC_AER_CAPABILITIES SecCapabilitiesAndControl; - ULONG SecHeaderLog[4]; - -} PCI_EXPRESS_AER_CAPABILITY, *PPCI_EXPRESS_AER_CAPABILITY; - -// -// Advanced Error Reporting Capability structure for root port. -// - -typedef struct _PCI_EXPRESS_ROOTPORT_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_ROOT_ERROR_COMMAND RootErrorCommand; - PCI_EXPRESS_ROOT_ERROR_STATUS RootErrorStatus; - PCI_EXPRESS_ERROR_SOURCE_ID ErrorSourceId; - -} PCI_EXPRESS_ROOTPORT_AER_CAPABILITY, *PPCI_EXPRESS_ROOTPORT_AER_CAPABILITY; - -// -// Advanced Error Reporting Capability structure for root port. -// - -typedef struct _PCI_EXPRESS_BRIDGE_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS SecUncorrectableErrorStatus; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK SecUncorrectableErrorMask; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY SecUncorrectableErrorSeverity; - PCI_EXPRESS_SEC_AER_CAPABILITIES SecCapabilitiesAndControl; - ULONG SecHeaderLog[4]; - -} PCI_EXPRESS_BRIDGE_AER_CAPABILITY, *PPCI_EXPRESS_BRIDGE_AER_CAPABILITY; - -// -// Single-Root I/O Virtualization Capability structure for endpoints -// - -typedef union _PCI_EXPRESS_SRIOV_CAPS { - - struct { - ULONG VFMigrationCapable:1; - ULONG Reserved1:20; - ULONG VFMigrationInterruptNumber:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SRIOV_CAPS, *PPCI_EXPRESS_SRIOV_CAPS; - -typedef union _PCI_EXPRESS_SRIOV_CONTROL { - - struct { - USHORT VFEnable:1; - USHORT VFMigrationEnable:1; - USHORT VFMigrationInterruptEnable:1; - USHORT VFMemorySpaceEnable:1; - USHORT ARICapableHierarchy:1; - USHORT Reserved1:11; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SRIOV_CONTROL, *PPCI_EXPRESS_SRIOV_CONTROL; - -typedef union _PCI_EXPRESS_SRIOV_STATUS { - - struct { - USHORT VFMigrationStatus:1; - USHORT Reserved1:15; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SRIOV_STATUS, *PPCI_EXPRESS_SRIOV_STATUS; - -typedef union _PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY { - - struct { - ULONG VFMigrationStateBIR:3; - ULONG VFMigrationStateOffset:29; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY, *PPCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY; - -typedef struct _PCI_EXPRESS_SRIOV_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_SRIOV_CAPS SRIOVCapabilities; - PCI_EXPRESS_SRIOV_CONTROL SRIOVControl; - PCI_EXPRESS_SRIOV_STATUS SRIOVStatus; - USHORT InitialVFs; - USHORT TotalVFs; - USHORT NumVFs; - UCHAR FunctionDependencyLink; - UCHAR RsvdP1; - USHORT FirstVFOffset; - USHORT VFStride; - USHORT RsvdP2; - USHORT VFDeviceId; - ULONG SupportedPageSizes; - ULONG SystemPageSize; - ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; - PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY VFMigrationStateArrayOffset; - -} PCI_EXPRESS_SRIOV_CAPABILITY, *PPCI_EXPRESS_SRIOV_CAPABILITY; - -// -// Base Class Code encodings for Base Class (from PCI spec rev 2.1). -// - -#define PCI_CLASS_PRE_20 0x00 -#define PCI_CLASS_MASS_STORAGE_CTLR 0x01 -#define PCI_CLASS_NETWORK_CTLR 0x02 -#define PCI_CLASS_DISPLAY_CTLR 0x03 -#define PCI_CLASS_MULTIMEDIA_DEV 0x04 -#define PCI_CLASS_MEMORY_CTLR 0x05 -#define PCI_CLASS_BRIDGE_DEV 0x06 -#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07 -#define PCI_CLASS_BASE_SYSTEM_DEV 0x08 -#define PCI_CLASS_INPUT_DEV 0x09 -#define PCI_CLASS_DOCKING_STATION 0x0a -#define PCI_CLASS_PROCESSOR 0x0b -#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c -#define PCI_CLASS_WIRELESS_CTLR 0x0d -#define PCI_CLASS_INTELLIGENT_IO_CTLR 0x0e -#define PCI_CLASS_SATELLITE_COMMS_CTLR 0x0f -#define PCI_CLASS_ENCRYPTION_DECRYPTION 0x10 -#define PCI_CLASS_DATA_ACQ_SIGNAL_PROC 0x11 - -// 0d thru fe reserved - -#define PCI_CLASS_NOT_DEFINED 0xff - -// -// Sub Class Code encodings (PCI rev 2.1). -// - -// Class 00 - PCI_CLASS_PRE_20 - -#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 -#define PCI_SUBCLASS_PRE_20_VGA 0x01 - -// Class 01 - PCI_CLASS_MASS_STORAGE_CTLR - -#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 -#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 -#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 -#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03 -#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04 -#define PCI_SUBCLASS_MSC_OTHER 0x80 - -// Class 02 - PCI_CLASS_NETWORK_CTLR - -#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 -#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 -#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 -#define PCI_SUBCLASS_NET_ATM_CTLR 0x03 -#define PCI_SUBCLASS_NET_ISDN_CTLR 0x04 -#define PCI_SUBCLASS_NET_OTHER 0x80 - -// Class 03 - PCI_CLASS_DISPLAY_CTLR - -// N.B. Sub Class 00 could be VGA or 8514 depending on Interface byte - -#define PCI_SUBCLASS_VID_VGA_CTLR 0x00 -#define PCI_SUBCLASS_VID_XGA_CTLR 0x01 -#define PCI_SUBLCASS_VID_3D_CTLR 0x02 -#define PCI_SUBCLASS_VID_OTHER 0x80 - -// Class 04 - PCI_CLASS_MULTIMEDIA_DEV - -#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 -#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 -#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 -#define PCI_SUBCLASS_MM_OTHER 0x80 - -// Class 05 - PCI_CLASS_MEMORY_CTLR - -#define PCI_SUBCLASS_MEM_RAM 0x00 -#define PCI_SUBCLASS_MEM_FLASH 0x01 -#define PCI_SUBCLASS_MEM_OTHER 0x80 - -// Class 06 - PCI_CLASS_BRIDGE_DEV - -#define PCI_SUBCLASS_BR_HOST 0x00 -#define PCI_SUBCLASS_BR_ISA 0x01 -#define PCI_SUBCLASS_BR_EISA 0x02 -#define PCI_SUBCLASS_BR_MCA 0x03 -#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 -#define PCI_SUBCLASS_BR_PCMCIA 0x05 -#define PCI_SUBCLASS_BR_NUBUS 0x06 -#define PCI_SUBCLASS_BR_CARDBUS 0x07 -#define PCI_SUBCLASS_BR_RACEWAY 0x08 -#define PCI_SUBCLASS_BR_OTHER 0x80 - -// Class 07 - PCI_CLASS_SIMPLE_COMMS_CTLR - -// N.B. Sub Class 00 and 01 additional info in Interface byte - -#define PCI_SUBCLASS_COM_SERIAL 0x00 -#define PCI_SUBCLASS_COM_PARALLEL 0x01 -#define PCI_SUBCLASS_COM_MULTIPORT 0x02 -#define PCI_SUBCLASS_COM_MODEM 0x03 -#define PCI_SUBCLASS_COM_OTHER 0x80 - -// Class 08 - PCI_CLASS_BASE_SYSTEM_DEV - -// N.B. See Interface byte for additional info. - -#define PCI_SUBCLASS_SYS_INTERRUPT_CTLR 0x00 -#define PCI_SUBCLASS_SYS_DMA_CTLR 0x01 -#define PCI_SUBCLASS_SYS_SYSTEM_TIMER 0x02 -#define PCI_SUBCLASS_SYS_REAL_TIME_CLOCK 0x03 -#define PCI_SUBCLASS_SYS_GEN_HOTPLUG_CTLR 0x04 -#define PCI_SUBCLASS_SYS_SDIO_CTRL 0x05 -#define PCI_SUBCLASS_SYS_OTHER 0x80 - -// Class 09 - PCI_CLASS_INPUT_DEV - -#define PCI_SUBCLASS_INP_KEYBOARD 0x00 -#define PCI_SUBCLASS_INP_DIGITIZER 0x01 -#define PCI_SUBCLASS_INP_MOUSE 0x02 -#define PCI_SUBCLASS_INP_SCANNER 0x03 -#define PCI_SUBCLASS_INP_GAMEPORT 0x04 -#define PCI_SUBCLASS_INP_OTHER 0x80 - -// Class 0a - PCI_CLASS_DOCKING_STATION - -#define PCI_SUBCLASS_DOC_GENERIC 0x00 -#define PCI_SUBCLASS_DOC_OTHER 0x80 - -// Class 0b - PCI_CLASS_PROCESSOR - -#define PCI_SUBCLASS_PROC_386 0x00 -#define PCI_SUBCLASS_PROC_486 0x01 -#define PCI_SUBCLASS_PROC_PENTIUM 0x02 -#define PCI_SUBCLASS_PROC_ALPHA 0x10 -#define PCI_SUBCLASS_PROC_POWERPC 0x20 -#define PCI_SUBCLASS_PROC_COPROCESSOR 0x40 - -// Class 0c - PCI_CLASS_SERIAL_BUS_CTLR - -#define PCI_SUBCLASS_SB_IEEE1394 0x00 -#define PCI_SUBCLASS_SB_ACCESS 0x01 -#define PCI_SUBCLASS_SB_SSA 0x02 -#define PCI_SUBCLASS_SB_USB 0x03 -#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04 -#define PCI_SUBCLASS_SB_SMBUS 0x05 - -// Class 0d - PCI_CLASS_WIRELESS_CTLR - -#define PCI_SUBCLASS_WIRELESS_IRDA 0x00 -#define PCI_SUBCLASS_WIRELESS_CON_IR 0x01 -#define PCI_SUBCLASS_WIRELESS_RF 0x10 -#define PCI_SUBCLASS_WIRELESS_OTHER 0x80 - -// Class 0e - PCI_CLASS_INTELLIGENT_IO_CTLR - -#define PCI_SUBCLASS_INTIO_I2O 0x00 - -// Class 0f - PCI_CLASS_SATELLITE_CTLR - -#define PCI_SUBCLASS_SAT_TV 0x01 -#define PCI_SUBCLASS_SAT_AUDIO 0x02 -#define PCI_SUBCLASS_SAT_VOICE 0x03 -#define PCI_SUBCLASS_SAT_DATA 0x04 - -// Class 10 - PCI_CLASS_ENCRYPTION_DECRYPTION - -#define PCI_SUBCLASS_CRYPTO_NET_COMP 0x00 -#define PCI_SUBCLASS_CRYPTO_ENTERTAINMENT 0x10 -#define PCI_SUBCLASS_CRYPTO_OTHER 0x80 - -// Class 11 - PCI_CLASS_DATA_ACQ_SIGNAL_PROC - -#define PCI_SUBCLASS_DASP_DPIO 0x00 -#define PCI_SUBCLASS_DASP_OTHER 0x80 - -// end_ntndis - -// -// Bit encodes for PCI_COMMON_CONFIG.u.type0.BaseAddresses -// - -#define PCI_ADDRESS_IO_SPACE 0x00000001 // (ro) -#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006 // (ro) -#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008 // (ro) - -#define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc -#define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0 -#define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800 - -#define PCI_TYPE_32BIT 0 -#define PCI_TYPE_20BIT 2 -#define PCI_TYPE_64BIT 4 - -// -// Bit encodes for PCI_COMMON_CONFIG.u.type0.ROMBaseAddresses -// - -#define PCI_ROMADDRESS_ENABLED 0x00000001 - - -// -// Reference notes for PCI configuration fields: -// -// ro these field are read only. changes to these fields are ignored -// -// ro+ these field are intended to be read only and should be initialized -// by the system to their proper values. However, driver may change -// these settings. -// -// --- -// -// All resources comsumed by a PCI device start as unitialized -// under NT. An uninitialized memory or I/O base address can be -// determined by checking it's corrisponding enabled bit in the -// PCI_COMMON_CONFIG.Command value. An InterruptLine is unitialized -// if it contains the value of -1. -// - - -typedef ULONG NODE_REQUIREMENT; - -#define MM_ANY_NODE_OK 0x80000000 - - -// -// Graphics support routines. -// - -typedef -VOID -(*PBANKED_SECTION_ROUTINE) ( - __in ULONG ReadBank, - __in ULONG WriteBank, - __in PVOID Context - ); - -// -// WMI minor function codes under IRP_MJ_SYSTEM_CONTROL -// - -#define IRP_MN_QUERY_ALL_DATA 0x00 -#define IRP_MN_QUERY_SINGLE_INSTANCE 0x01 -#define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02 -#define IRP_MN_CHANGE_SINGLE_ITEM 0x03 -#define IRP_MN_ENABLE_EVENTS 0x04 -#define IRP_MN_DISABLE_EVENTS 0x05 -#define IRP_MN_ENABLE_COLLECTION 0x06 -#define IRP_MN_DISABLE_COLLECTION 0x07 -#define IRP_MN_REGINFO 0x08 -#define IRP_MN_EXECUTE_METHOD 0x09 -// Minor code 0x0a is reserved -#define IRP_MN_REGINFO_EX 0x0b -// Minor code 0x0c is reserved - - -// workaround overloaded definition (rpc generated headers all define INTERFACE -// to match the class name). -#undef INTERFACE - -typedef struct _INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // interface specific entries go here -} INTERFACE, *PINTERFACE; - - -// -// Defines the Type in the RESOURCE_DESCRIPTOR -// -// NOTE: For all CM_RESOURCE_TYPE values, there must be a -// corresponding ResType value in the 32-bit ConfigMgr headerfile -// (cfgmgr32.h). Values in the range [0x6,0x80) use the same values -// as their ConfigMgr counterparts. CM_RESOURCE_TYPE values with -// the high bit set (i.e., in the range [0x80,0xFF]), are -// non-arbitrated resources. These correspond to the same values -// in cfgmgr32.h that have their high bit set (however, since -// cfgmgr32.h uses 16 bits for ResType values, these values are in -// the range [0x8000,0x807F). Note that ConfigMgr ResType values -// cannot be in the range [0x8080,0xFFFF), because they would not -// be able to map into CM_RESOURCE_TYPE values. (0xFFFF itself is -// a special value, because it maps to CmResourceTypeDeviceSpecific.) -// - -typedef int CM_RESOURCE_TYPE; - -// CmResourceTypeNull is reserved - -#define CmResourceTypeNull 0 // ResType_All or ResType_None (0x0000) -#define CmResourceTypePort 1 // ResType_IO (0x0002) -#define CmResourceTypeInterrupt 2 // ResType_IRQ (0x0004) -#define CmResourceTypeMemory 3 // ResType_Mem (0x0001) -#define CmResourceTypeDma 4 // ResType_DMA (0x0003) -#define CmResourceTypeDeviceSpecific 5 // ResType_ClassSpecific (0xFFFF) -#define CmResourceTypeBusNumber 6 // ResType_BusNumber (0x0006) -#define CmResourceTypeMemoryLarge 7 // ResType_MemLarge (0x0007) -// end_wdm -// begin_ntddk -#define CmResourceTypeMaximum 8 -// end_ntddk -// begin_wdm -#define CmResourceTypeNonArbitrated 128 // Not arbitrated if 0x80 bit set -#define CmResourceTypeConfigData 128 // ResType_Reserved (0x8000) -#define CmResourceTypeDevicePrivate 129 // ResType_DevicePrivate (0x8001) -#define CmResourceTypePcCardConfig 130 // ResType_PcCardConfig (0x8002) -#define CmResourceTypeMfCardConfig 131 // ResType_MfCardConfig (0x8003) - -// -// Defines the ShareDisposition in the RESOURCE_DESCRIPTOR -// - -typedef enum _CM_SHARE_DISPOSITION { - CmResourceShareUndetermined = 0, // Reserved - CmResourceShareDeviceExclusive, - CmResourceShareDriverExclusive, - CmResourceShareShared -} CM_SHARE_DISPOSITION; - -// -// Define the bit masks for Flags when type is CmResourceTypeInterrupt -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0 -#define CM_RESOURCE_INTERRUPT_LATCHED 1 -#define CM_RESOURCE_INTERRUPT_MESSAGE 2 -#define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 4 -// end_wdm -#define CM_RESOURCE_INTERRUPT_ALLOW_RESERVED_IDT 8 -// begin_wdm - -// -// A bitmask defining the bits in a resource or requirements descriptor -// flags field that corresponds to the latch mode or a level triggered -// interrupt. -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS 0x0001 - -// -// Define the token value used for an interrupt vector to mean that the vector -// is message signaled. This value is used in the MaximumVector field. -// - -#define CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN ((ULONG)-2) - -// -// Define the bit masks for Flags when type is CmResourceTypeMemory -// or CmResourceTypeMemoryLarge -// - -#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 -#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 -#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 -#define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003 -#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 - -#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 -#define CM_RESOURCE_MEMORY_24 0x0010 -#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 -#define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040 -#define CM_RESOURCE_MEMORY_BAR 0x0080 - -#define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100 - -// -// Define the bit masks exclusive to type CmResourceTypeMemoryLarge. -// - -#define CM_RESOURCE_MEMORY_LARGE 0x0E00 -#define CM_RESOURCE_MEMORY_LARGE_40 0x0200 -#define CM_RESOURCE_MEMORY_LARGE_48 0x0400 -#define CM_RESOURCE_MEMORY_LARGE_64 0x0800 - -// -// Define limits for large memory resources -// - -#define CM_RESOURCE_MEMORY_LARGE_40_MAXLEN 0x000000FFFFFFFF00 -#define CM_RESOURCE_MEMORY_LARGE_48_MAXLEN 0x0000FFFFFFFF0000 -#define CM_RESOURCE_MEMORY_LARGE_64_MAXLEN 0xFFFFFFFF00000000 - -// -// Define the bit masks for Flags when type is CmResourceTypePort -// - -#define CM_RESOURCE_PORT_MEMORY 0x0000 -#define CM_RESOURCE_PORT_IO 0x0001 -#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 -#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 -#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 -#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 -#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 -#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 -#define CM_RESOURCE_PORT_BAR 0x0100 - -// -// Define the bit masks for Flags when type is CmResourceTypeDma -// - -#define CM_RESOURCE_DMA_8 0x0000 -#define CM_RESOURCE_DMA_16 0x0001 -#define CM_RESOURCE_DMA_32 0x0002 -#define CM_RESOURCE_DMA_8_AND_16 0x0004 -#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 -#define CM_RESOURCE_DMA_TYPE_A 0x0010 -#define CM_RESOURCE_DMA_TYPE_B 0x0020 -#define CM_RESOURCE_DMA_TYPE_F 0x0040 - - -#include "pshpack1.h" - - -// -// Define Mca POS data block for slot -// - -typedef struct _CM_MCA_POS_DATA { - USHORT AdapterId; - UCHAR PosData1; - UCHAR PosData2; - UCHAR PosData3; - UCHAR PosData4; -} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; - -// -// Memory configuration of eisa data block structure -// - -typedef struct _EISA_MEMORY_TYPE { - UCHAR ReadWrite: 1; - UCHAR Cached : 1; - UCHAR Reserved0 :1; - UCHAR Type:2; - UCHAR Shared:1; - UCHAR Reserved1 :1; - UCHAR MoreEntries : 1; -} EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE; - -typedef struct _EISA_MEMORY_CONFIGURATION { - EISA_MEMORY_TYPE ConfigurationByte; - UCHAR DataSize; - USHORT AddressLowWord; - UCHAR AddressHighByte; - USHORT MemorySize; -} EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION; - - -// -// Interrupt configurationn of eisa data block structure -// - -typedef struct _EISA_IRQ_DESCRIPTOR { - UCHAR Interrupt : 4; - UCHAR Reserved :1; - UCHAR LevelTriggered :1; - UCHAR Shared : 1; - UCHAR MoreEntries : 1; -} EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR; - -typedef struct _EISA_IRQ_CONFIGURATION { - EISA_IRQ_DESCRIPTOR ConfigurationByte; - UCHAR Reserved; -} EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION; - - -// -// DMA description of eisa data block structure -// - -typedef struct _DMA_CONFIGURATION_BYTE0 { - UCHAR Channel : 3; - UCHAR Reserved : 3; - UCHAR Shared :1; - UCHAR MoreEntries :1; -} DMA_CONFIGURATION_BYTE0; - -typedef struct _DMA_CONFIGURATION_BYTE1 { - UCHAR Reserved0 : 2; - UCHAR TransferSize : 2; - UCHAR Timing : 2; - UCHAR Reserved1 : 2; -} DMA_CONFIGURATION_BYTE1; - -typedef struct _EISA_DMA_CONFIGURATION { - DMA_CONFIGURATION_BYTE0 ConfigurationByte0; - DMA_CONFIGURATION_BYTE1 ConfigurationByte1; -} EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION; - - -// -// Port description of eisa data block structure -// - -typedef struct _EISA_PORT_DESCRIPTOR { - UCHAR NumberPorts : 5; - UCHAR Reserved :1; - UCHAR Shared :1; - UCHAR MoreEntries : 1; -} EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR; - -typedef struct _EISA_PORT_CONFIGURATION { - EISA_PORT_DESCRIPTOR Configuration; - USHORT PortAddress; -} EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION; - - -// -// Eisa slot information definition -// N.B. This structure is different from the one defined -// in ARC eisa addendum. -// - -typedef struct _CM_EISA_SLOT_INFORMATION { - UCHAR ReturnCode; - UCHAR ReturnFlags; - UCHAR MajorRevision; - UCHAR MinorRevision; - USHORT Checksum; - UCHAR NumberFunctions; - UCHAR FunctionInformation; - ULONG CompressedId; -} CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION; - - -// -// Eisa function information definition -// - -typedef struct _CM_EISA_FUNCTION_INFORMATION { - ULONG CompressedId; - UCHAR IdSlotFlags1; - UCHAR IdSlotFlags2; - UCHAR MinorRevision; - UCHAR MajorRevision; - UCHAR Selections[26]; - UCHAR FunctionFlags; - UCHAR TypeString[80]; - EISA_MEMORY_CONFIGURATION EisaMemory[9]; - EISA_IRQ_CONFIGURATION EisaIrq[7]; - EISA_DMA_CONFIGURATION EisaDma[4]; - EISA_PORT_CONFIGURATION EisaPort[20]; - UCHAR InitializationData[60]; -} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION; - -// -// The following defines the way pnp bios information is stored in -// the registry \\HKEY_LOCAL_MACHINE\HARDWARE\Description\System\MultifunctionAdapter\x -// key, where x is an integer number indicating adapter instance. The -// "Identifier" of the key must equal to "PNP BIOS" and the -// "ConfigurationData" is organized as follow: -// -// CM_PNP_BIOS_INSTALLATION_CHECK + -// CM_PNP_BIOS_DEVICE_NODE for device 1 + -// CM_PNP_BIOS_DEVICE_NODE for device 2 + -// ... -// CM_PNP_BIOS_DEVICE_NODE for device n -// - -// -// Pnp BIOS device node structure -// - -typedef struct _CM_PNP_BIOS_DEVICE_NODE { - USHORT Size; - UCHAR Node; - ULONG ProductId; - UCHAR DeviceType[3]; - USHORT DeviceAttributes; - // followed by AllocatedResourceBlock, PossibleResourceBlock - // and CompatibleDeviceId -} CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE; - -// -// Pnp BIOS Installation check -// - -typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK { - UCHAR Signature[4]; // $PnP (ascii) - UCHAR Revision; - UCHAR Length; - USHORT ControlField; - UCHAR Checksum; - ULONG EventFlagAddress; // Physical address - USHORT RealModeEntryOffset; - USHORT RealModeEntrySegment; - USHORT ProtectedModeEntryOffset; - ULONG ProtectedModeCodeBaseAddress; - ULONG OemDeviceId; - USHORT RealModeDataBaseAddress; - ULONG ProtectedModeDataBaseAddress; -} CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK; - -#include "poppack.h" - -// -// Masks for EISA function information -// - -#define EISA_FUNCTION_ENABLED 0x80 -#define EISA_FREE_FORM_DATA 0x40 -#define EISA_HAS_PORT_INIT_ENTRY 0x20 -#define EISA_HAS_PORT_RANGE 0x10 -#define EISA_HAS_DMA_ENTRY 0x08 -#define EISA_HAS_IRQ_ENTRY 0x04 -#define EISA_HAS_MEMORY_ENTRY 0x02 -#define EISA_HAS_TYPE_ENTRY 0x01 -#define EISA_HAS_INFORMATION EISA_HAS_PORT_RANGE + \ - EISA_HAS_DMA_ENTRY + \ - EISA_HAS_IRQ_ENTRY + \ - EISA_HAS_MEMORY_ENTRY + \ - EISA_HAS_TYPE_ENTRY - -// -// Masks for EISA memory configuration -// - -#define EISA_MORE_ENTRIES 0x80 -#define EISA_SYSTEM_MEMORY 0x00 -#define EISA_MEMORY_TYPE_RAM 0x01 - -// -// Returned error code for EISA bios call -// - -#define EISA_INVALID_SLOT 0x80 -#define EISA_INVALID_FUNCTION 0x81 -#define EISA_INVALID_CONFIGURATION 0x82 -#define EISA_EMPTY_SLOT 0x83 -#define EISA_INVALID_BIOS_CALL 0x86 - - -// -// Define the bitmasks for resource options -// - -#define IO_RESOURCE_PREFERRED 0x01 -#define IO_RESOURCE_DEFAULT 0x02 -#define IO_RESOURCE_ALTERNATIVE 0x08 - -// -// Define interrupt affinity policy values -// - -#if defined(NT_PROCESSOR_GROUPS) - -typedef USHORT IRQ_DEVICE_POLICY, *PIRQ_DEVICE_POLICY; -typedef enum _IRQ_DEVICE_POLICY_USHORT { - IrqPolicyMachineDefault = 0, - IrqPolicyAllCloseProcessors = 1, - IrqPolicyOneCloseProcessor = 2, - IrqPolicyAllProcessorsInMachine = 3, - IrqPolicyAllProcessorsInGroup = 3, - IrqPolicySpecifiedProcessors = 4, - IrqPolicySpreadMessagesAcrossAllProcessors = 5 -}; - -#else - -typedef enum _IRQ_DEVICE_POLICY { - IrqPolicyMachineDefault = 0, - IrqPolicyAllCloseProcessors, - IrqPolicyOneCloseProcessor, - IrqPolicyAllProcessorsInMachine, - IrqPolicySpecifiedProcessors, - IrqPolicySpreadMessagesAcrossAllProcessors -} IRQ_DEVICE_POLICY, *PIRQ_DEVICE_POLICY; - -#endif - -// -// Define interrupt priority policy values -// - -typedef enum _IRQ_PRIORITY { - IrqPriorityUndefined = 0, - IrqPriorityLow, - IrqPriorityNormal, - IrqPriorityHigh -} IRQ_PRIORITY, *PIRQ_PRIORITY; - -// -// Define interrupt group affinity policy -// - -typedef enum _IRQ_GROUP_POLICY { - GroupAffinityAllGroupZero = 0, - GroupAffinityDontCare -} IRQ_GROUP_POLICY, *PIRQ_GROUP_POLICY; - -// -// This structure defines one type of resource requested by the driver -// - -typedef struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option; - UCHAR Type; // use CM_RESOURCE_TYPE - UCHAR ShareDisposition; // use CM_SHARE_DISPOSITION - UCHAR Spare1; - USHORT Flags; // use CM resource flag defines - USHORT Spare2; // align - - union { - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Port; - - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory; - - struct { - ULONG MinimumVector; - ULONG MaximumVector; -#if defined(NT_PROCESSOR_GROUPS) - IRQ_DEVICE_POLICY AffinityPolicy; - USHORT Group; -#else - IRQ_DEVICE_POLICY AffinityPolicy; -#endif - IRQ_PRIORITY PriorityPolicy; - KAFFINITY TargetedProcessors; - } Interrupt; - - struct { - ULONG MinimumChannel; - ULONG MaximumChannel; - } Dma; - - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Generic; - - struct { - ULONG Data[3]; - } DevicePrivate; - - // - // Bus Number information. - // - - struct { - ULONG Length; - ULONG MinBusNumber; - ULONG MaxBusNumber; - ULONG Reserved; - } BusNumber; - - struct { - ULONG Priority; // use LCPRI_Xxx values in cfg.h - ULONG Reserved1; - ULONG Reserved2; - } ConfigData; - - // - // The following structures provide descriptions - // for memory resource requirement greater than MAXULONG - // - - struct { - ULONG Length40; - ULONG Alignment40; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory40; - - struct { - ULONG Length48; - ULONG Alignment48; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory48; - - struct { - ULONG Length64; - ULONG Alignment64; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory64; - - - } u; - -} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; - - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#endif -#endif - -#endif /* _MINIPORT_ */ - diff --git a/qt-correction-tool/pub/ddk/minitape.h b/qt-correction-tool/pub/ddk/minitape.h deleted file mode 100644 index bb5d435..0000000 --- a/qt-correction-tool/pub/ddk/minitape.h +++ /dev/null @@ -1,5905 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - minitape.h - -Abstract: - - Type definitions for minitape drivers. - -Revision History: - ---*/ - -#ifndef _MINITAPE_ -#define _MINITAPE_ - -#include "stddef.h" - -#define ASSERT( exp ) - -#if DBG - -#define DebugPrint(x) ScsiDebugPrint x - -#else - -#define DebugPrint(x) - -#endif // DBG - -#if defined(_MSC_VER) && (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#endif -#pragma warning(disable:4200) /* nonstandard extension used : zero-sized array in struct/union */ -#pragma warning(disable:4201) /* nonstandard extension used : Nameless struct/union */ -#pragma warning(disable:4214) /* nonstandard extension used : Bit field types other than int */ -#endif - - -#ifndef IN -#define IN -#endif - -#ifndef OUT -#define OUT -#endif - -#ifndef OPTIONAL -#define OPTIONAL -#endif - -#ifndef NOTHING -#define NOTHING -#endif - -#ifndef CRITICAL -#define CRITICAL -#endif - -#ifndef ANYSIZE_ARRAY -#define ANYSIZE_ARRAY 1 // winnt -#endif - -// begin_winnt - -// -// For compilers that don't support nameless unions/structs -// -#ifndef DUMMYUNIONNAME -#if defined(NONAMELESSUNION) || !defined(_MSC_EXTENSIONS) -#define DUMMYUNIONNAME u -#define DUMMYUNIONNAME2 u2 -#define DUMMYUNIONNAME3 u3 -#define DUMMYUNIONNAME4 u4 -#define DUMMYUNIONNAME5 u5 -#define DUMMYUNIONNAME6 u6 -#define DUMMYUNIONNAME7 u7 -#define DUMMYUNIONNAME8 u8 -#define DUMMYUNIONNAME9 u9 -#else -#define DUMMYUNIONNAME -#define DUMMYUNIONNAME2 -#define DUMMYUNIONNAME3 -#define DUMMYUNIONNAME4 -#define DUMMYUNIONNAME5 -#define DUMMYUNIONNAME6 -#define DUMMYUNIONNAME7 -#define DUMMYUNIONNAME8 -#define DUMMYUNIONNAME9 -#endif -#endif // DUMMYUNIONNAME - -#ifndef DUMMYSTRUCTNAME -#if defined(NONAMELESSUNION) || !defined(_MSC_EXTENSIONS) -#define DUMMYSTRUCTNAME s -#define DUMMYSTRUCTNAME2 s2 -#define DUMMYSTRUCTNAME3 s3 -#define DUMMYSTRUCTNAME4 s4 -#define DUMMYSTRUCTNAME5 s5 -#else -#define DUMMYSTRUCTNAME -#define DUMMYSTRUCTNAME2 -#define DUMMYSTRUCTNAME3 -#define DUMMYSTRUCTNAME4 -#define DUMMYSTRUCTNAME5 -#endif -#endif // DUMMYSTRUCTNAME - -#include -#include - -#if defined(STRICT_GS_ENABLED) -#pragma strict_gs_check(push, on) -#endif - -#if defined(_M_MRX000) && !(defined(MIDL_PASS) || defined(RC_INVOKED)) && defined(ENABLE_RESTRICTED) -#define RESTRICTED_POINTER __restrict -#else -#define RESTRICTED_POINTER -#endif - -#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) -#define ALIGNMENT_MACHINE -#define UNALIGNED __unaligned -#if defined(_WIN64) -#define UNALIGNED64 __unaligned -#else -#define UNALIGNED64 -#endif -#else -#undef ALIGNMENT_MACHINE -#define UNALIGNED -#define UNALIGNED64 -#endif - - -#if defined(_WIN64) || defined(_M_ALPHA) -#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG) -#define MEMORY_ALLOCATION_ALIGNMENT 16 -#else -#define MAX_NATURAL_ALIGNMENT sizeof(ULONG) -#define MEMORY_ALLOCATION_ALIGNMENT 8 -#endif - -// -// TYPE_ALIGNMENT will return the alignment requirements of a given type for -// the current platform. -// - -#ifdef __cplusplus -#if _MSC_VER >= 1300 -#define TYPE_ALIGNMENT( t ) __alignof(t) -#endif -#else -#define TYPE_ALIGNMENT( t ) \ - FIELD_OFFSET( struct { char x; t test; }, test ) -#endif - -#if defined(_WIN64) - -#if defined(_AMD64_) -#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( ULONG ) -#elif defined(_IA64_) -#define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( ULONG ) ? \ - TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( ULONG )) -#else -#error "No Target Architecture" -#endif - -#define PROBE_ALIGNMENT32( _s ) TYPE_ALIGNMENT( ULONG ) - -#else - -#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( ULONG ) - -#endif - -// -// C_ASSERT() can be used to perform many compile-time assertions: -// type sizes, field offsets, etc. -// -// An assertion failure results in error C2118: negative subscript. -// - -#ifndef SORTPP_PASS -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#else -#define C_ASSERT(e) /* nothing */ -#endif - -#include - -// end_winnt - -#ifndef CONST -#define CONST const -#endif - -// begin_winnt - -#if (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64)) && !defined(MIDL_PASS) -#define DECLSPEC_IMPORT __declspec(dllimport) -#else -#define DECLSPEC_IMPORT -#endif - -#ifndef DECLSPEC_NORETURN -#if (_MSC_VER >= 1200) && !defined(MIDL_PASS) -#define DECLSPEC_NORETURN __declspec(noreturn) -#else -#define DECLSPEC_NORETURN -#endif -#endif - -#ifndef DECLSPEC_NOTHROW -#if (_MSC_VER >= 1200) && !defined(MIDL_PASS) -#define DECLSPEC_NOTHROW __declspec(nothrow) -#else -#define DECLSPEC_NOTHROW -#endif -#endif - -#ifndef DECLSPEC_ALIGN -#if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -#define DECLSPEC_ALIGN(x) __declspec(align(x)) -#else -#define DECLSPEC_ALIGN(x) -#endif -#endif - -#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE -#if defined(_AMD64_) || defined(_X86_) -#define SYSTEM_CACHE_ALIGNMENT_SIZE 64 -#else -#define SYSTEM_CACHE_ALIGNMENT_SIZE 128 -#endif -#endif - -#ifndef DECLSPEC_CACHEALIGN -#define DECLSPEC_CACHEALIGN DECLSPEC_ALIGN(SYSTEM_CACHE_ALIGNMENT_SIZE) -#endif - -#ifndef DECLSPEC_UUID -#if (_MSC_VER >= 1100) && defined (__cplusplus) -#define DECLSPEC_UUID(x) __declspec(uuid(x)) -#else -#define DECLSPEC_UUID(x) -#endif -#endif - -#ifndef DECLSPEC_NOVTABLE -#if (_MSC_VER >= 1100) && defined(__cplusplus) -#define DECLSPEC_NOVTABLE __declspec(novtable) -#else -#define DECLSPEC_NOVTABLE -#endif -#endif - -#ifndef DECLSPEC_SELECTANY -#if (_MSC_VER >= 1100) -#define DECLSPEC_SELECTANY __declspec(selectany) -#else -#define DECLSPEC_SELECTANY -#endif -#endif - -#ifndef NOP_FUNCTION -#if (_MSC_VER >= 1210) -#define NOP_FUNCTION __noop -#else -#define NOP_FUNCTION (void)0 -#endif -#endif - -#ifndef DECLSPEC_ADDRSAFE -#if (_MSC_VER >= 1200) && (defined(_M_ALPHA) || defined(_M_AXP64)) -#define DECLSPEC_ADDRSAFE __declspec(address_safe) -#else -#define DECLSPEC_ADDRSAFE -#endif -#endif - -#ifndef DECLSPEC_NOINLINE -#if (_MSC_VER >= 1300) -#define DECLSPEC_NOINLINE __declspec(noinline) -#else -#define DECLSPEC_NOINLINE -#endif -#endif - -#ifndef FORCEINLINE -#if (_MSC_VER >= 1200) -#define FORCEINLINE __forceinline -#else -#define FORCEINLINE __inline -#endif -#endif - -#ifndef DECLSPEC_DEPRECATED -#if (_MSC_VER >= 1300) && !defined(MIDL_PASS) -#define DECLSPEC_DEPRECATED __declspec(deprecated) -#define DEPRECATE_SUPPORTED -#else -#define DECLSPEC_DEPRECATED -#undef DEPRECATE_SUPPORTED -#endif -#endif - -#ifdef DEPRECATE_DDK_FUNCTIONS -#ifdef _NTDDK_ -#define DECLSPEC_DEPRECATED_DDK DECLSPEC_DEPRECATED -#ifdef DEPRECATE_SUPPORTED -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 1 -#endif -#else -#define DECLSPEC_DEPRECATED_DDK -#define PRAGMA_DEPRECATED_DDK 0 -#endif - -// -// Void -// - -typedef void *PVOID; -typedef void * POINTER_64 PVOID64; - -// end_winnt - -#ifndef _MANAGED -#if defined(_M_IX86) -#define FASTCALL __fastcall -#else -#define FASTCALL -#endif -#else -#define FASTCALL NTAPI -#endif - - -// -// Basics -// - -#ifndef VOID -#define VOID void -typedef char CHAR; -typedef short SHORT; -typedef long LONG; -#if !defined(MIDL_PASS) -typedef int INT; -#endif -#endif - -// -// UNICODE (Wide Character) types -// - -#ifndef _MAC -typedef wchar_t WCHAR; // wc, 16-bit UNICODE character -#else -// some Macintosh compilers don't define wchar_t in a convenient location, or define it as a char -typedef unsigned short WCHAR; // wc, 16-bit UNICODE character -#endif - -typedef WCHAR *PWCHAR, *LPWCH, *PWCH; -typedef CONST WCHAR *LPCWCH, *PCWCH; - -typedef __nullterminated WCHAR *NWPSTR, *LPWSTR, *PWSTR; -typedef __nullterminated PWSTR *PZPWSTR; -typedef __nullterminated CONST PWSTR *PCZPWSTR; -typedef __nullterminated WCHAR UNALIGNED *LPUWSTR, *PUWSTR; -typedef __nullterminated CONST WCHAR *LPCWSTR, *PCWSTR; -typedef __nullterminated PCWSTR *PZPCWSTR; -typedef __nullterminated CONST WCHAR UNALIGNED *LPCUWSTR, *PCUWSTR; - -typedef __nullnullterminated WCHAR *PZZWSTR; -typedef __nullnullterminated CONST WCHAR *PCZZWSTR; -typedef __nullnullterminated WCHAR UNALIGNED *PUZZWSTR; -typedef __nullnullterminated CONST WCHAR UNALIGNED *PCUZZWSTR; - -typedef __possibly_notnullterminated WCHAR *PNZWCH; -typedef __possibly_notnullterminated CONST WCHAR *PCNZWCH; -typedef __possibly_notnullterminated WCHAR UNALIGNED *PUNZWCH; -typedef __possibly_notnullterminated CONST WCHAR UNALIGNED *PCUNZWCH; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -typedef CONST WCHAR *LPCWCHAR, *PCWCHAR; -typedef CONST WCHAR UNALIGNED *LPCUWCHAR, *PCUWCHAR; - -// -// UCS (Universal Character Set) types -// - -typedef unsigned long UCSCHAR; - -// -// Even pre-Unicode agreement, UCS values are always in the -// range U+00000000 to U+7FFFFFFF, so we'll pick an obvious -// value. - -#define UCSCHAR_INVALID_CHARACTER (0xffffffff) - -#define MIN_UCSCHAR (0) - -// -// We'll assume here that the ISO-10646 / Unicode agreement -// not to assign code points after U+0010FFFF holds so that -// we do not have to have separate "UCSCHAR" and "UNICODECHAR" -// types. -// - -#define MAX_UCSCHAR (0x0010FFFF) - -typedef UCSCHAR *PUCSCHAR; -typedef const UCSCHAR *PCUCSCHAR; - -typedef UCSCHAR *PUCSSTR; -typedef UCSCHAR UNALIGNED *PUUCSSTR; - -typedef const UCSCHAR *PCUCSSTR; -typedef const UCSCHAR UNALIGNED *PCUUCSSTR; - -typedef UCSCHAR UNALIGNED *PUUCSCHAR; -typedef const UCSCHAR UNALIGNED *PCUUCSCHAR; - -#endif // _WIN32_WINNT >= 0x0600 - - -// -// ANSI (Multi-byte Character) types -// -typedef CHAR *PCHAR, *LPCH, *PCH; -typedef CONST CHAR *LPCCH, *PCCH; - -typedef __nullterminated CHAR *NPSTR, *LPSTR, *PSTR; -typedef __nullterminated PSTR *PZPSTR; -typedef __nullterminated CONST PSTR *PCZPSTR; -typedef __nullterminated CONST CHAR *LPCSTR, *PCSTR; -typedef __nullterminated PCSTR *PZPCSTR; - -typedef __nullnullterminated CHAR *PZZSTR; -typedef __nullnullterminated CONST CHAR *PCZZSTR; - -typedef __possibly_notnullterminated CHAR *PNZCH; -typedef __possibly_notnullterminated CONST CHAR *PCNZCH; - -// -// Neutral ANSI/UNICODE types and macros -// -#ifdef UNICODE // r_winnt - -#ifndef _TCHAR_DEFINED -typedef WCHAR TCHAR, *PTCHAR; -typedef WCHAR TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ - -typedef LPWCH LPTCH, PTCH; -typedef LPCWCH LPCTCH, PCTCH; -typedef LPWSTR PTSTR, LPTSTR; -typedef LPCWSTR PCTSTR, LPCTSTR; -typedef LPUWSTR PUTSTR, LPUTSTR; -typedef LPCUWSTR PCUTSTR, LPCUTSTR; -typedef LPWSTR LP; -typedef PZZWSTR PZZTSTR; -typedef PCZZWSTR PCZZTSTR; -typedef PUZZWSTR PUZZTSTR; -typedef PCUZZWSTR PCUZZTSTR; -typedef PNZWCH PNZTCH; -typedef PCNZWCH PCNZTCH; -typedef PUNZWCH PUNZTCH; -typedef PCUNZWCH PCUNZTCH; -#define __TEXT(quote) L##quote // r_winnt - -#else /* UNICODE */ // r_winnt - -#ifndef _TCHAR_DEFINED -typedef char TCHAR, *PTCHAR; -typedef unsigned char TUCHAR, *PTUCHAR; -#define _TCHAR_DEFINED -#endif /* !_TCHAR_DEFINED */ - -typedef LPCH LPTCH, PTCH; -typedef LPCCH LPCTCH, PCTCH; -typedef LPSTR PTSTR, LPTSTR, PUTSTR, LPUTSTR; -typedef LPCSTR PCTSTR, LPCTSTR, PCUTSTR, LPCUTSTR; -typedef PZZSTR PZZTSTR, PUZZTSTR; -typedef PCZZSTR PCZZTSTR, PCUZZTSTR; -typedef PNZCH PNZTCH, PUNZTCH; -typedef PCNZCH PCNZTCH, PCUNZTCH; -#define __TEXT(quote) quote // r_winnt - -#endif /* UNICODE */ // r_winnt -#define TEXT(quote) __TEXT(quote) // r_winnt - - -// end_winnt - -// -// The type QUAD and UQUAD are intended to use when a 8 byte aligned structure -// is required, but it is not a floating point number. -// - -typedef double DOUBLE; - -typedef struct _QUAD { - union { - __int64 UseThisFieldToCopy; - double DoNotUseThisField; - } DUMMYUNIONNAME; - -} QUAD; - -// -// Pointer to Basics -// - -typedef SHORT *PSHORT; // winnt -typedef LONG *PLONG; // winnt -typedef QUAD *PQUAD; - -// -// Unsigned Basics -// - -// Tell windef.h that some types are already defined. -#define BASETYPES - -typedef unsigned char UCHAR; -typedef unsigned short USHORT; -typedef unsigned long ULONG; -typedef QUAD UQUAD; - -// -// Pointer to Unsigned Basics -// - -typedef UCHAR *PUCHAR; -typedef USHORT *PUSHORT; -typedef ULONG *PULONG; -typedef UQUAD *PUQUAD; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -// -// Pointer to Const Unsigned Basics -// - -typedef CONST UCHAR *PCUCHAR; -typedef CONST USHORT *PCUSHORT; -typedef CONST ULONG *PCULONG; -typedef CONST UQUAD *PCUQUAD; - -#endif // _WIN32_WINNT >= 0x0600 - -// -// Signed characters -// - -typedef signed char SCHAR; -typedef SCHAR *PSCHAR; - -#if _WIN32_WINNT >= 0x0600 || (defined(__cplusplus) && defined(WINDOWS_ENABLE_CPLUSPLUS)) - -typedef CONST SCHAR *PCSCHAR; - -#endif // _WIN32_WINNT >= 0x0600 - -#ifndef NO_STRICT -#ifndef STRICT -#define STRICT 1 -#endif -#endif - -// begin_winnt - -#define ALL_PROCESSOR_GROUPS 0xffff - -// -// Structure to represent a system wide processor number. It contains a -// group number and relative processor number within the group. -// - -typedef struct _PROCESSOR_NUMBER { - USHORT Group; - UCHAR Number; - UCHAR Reserved; -} PROCESSOR_NUMBER, *PPROCESSOR_NUMBER; - -// -// Structure to represent a group-specific affinity, such as that of a -// thread. Specifies the group number and the affinity within that group. -// - -typedef struct _GROUP_AFFINITY { - KAFFINITY Mask; - USHORT Group; - USHORT Reserved[3]; -} GROUP_AFFINITY, *PGROUP_AFFINITY; - -// -// Handle to an Object -// - -#ifdef STRICT -typedef void *HANDLE; -#if 0 && (_MSC_VER > 1000) -#define DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name -#else -#define DECLARE_HANDLE(name) struct name##__{int unused;}; typedef struct name##__ *name -#endif -#else -typedef PVOID HANDLE; -#define DECLARE_HANDLE(name) typedef HANDLE name -#endif -typedef HANDLE *PHANDLE; - -// -// Flag (bit) fields -// - -typedef UCHAR FCHAR; -typedef USHORT FSHORT; -typedef ULONG FLONG; - -// Component Object Model defines, and macros - -#ifndef _HRESULT_DEFINED -#define _HRESULT_DEFINED -#ifdef __midl -typedef LONG HRESULT; -#else -typedef __success(return >= 0) long HRESULT; -#endif // __midl -#endif // !_HRESULT_DEFINED - -#ifdef __cplusplus - #define EXTERN_C extern "C" -#else - #define EXTERN_C extern -#endif - -#if defined(_WIN32) || defined(_MPPC_) - -// Win32 doesn't support __export - -#ifdef _68K_ -#define STDMETHODCALLTYPE __cdecl -#else -#define STDMETHODCALLTYPE __stdcall -#endif -#define STDMETHODVCALLTYPE __cdecl - -#define STDAPICALLTYPE __stdcall -#define STDAPIVCALLTYPE __cdecl - -#else - -#define STDMETHODCALLTYPE __export __stdcall -#define STDMETHODVCALLTYPE __export __cdecl - -#define STDAPICALLTYPE __export __stdcall -#define STDAPIVCALLTYPE __export __cdecl - -#endif - - -#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE -#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE - -#define STDMETHODIMP HRESULT STDMETHODCALLTYPE -#define STDMETHODIMP_(type) type STDMETHODCALLTYPE - -#define STDOVERRIDEMETHODIMP __override STDMETHODIMP -#define STDOVERRIDEMETHODIMP_(type) __override STDMETHODIMP_(type) - -#define IFACEMETHODIMP __override STDMETHODIMP -#define IFACEMETHODIMP_(type) __override STDMETHODIMP_(type) - -// The 'V' versions allow Variable Argument lists. - -#define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE -#define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE - -#define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE -#define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE - -#define STDOVERRIDEMETHODIMPV __override STDMETHODIMPV -#define STDOVERRIDEMETHODIMPV_(type) __override STDMETHODIMPV_(type) - -#define IFACEMETHODIMPV __override STDMETHODIMPV -#define IFACEMETHODIMPV_(type) __override STDMETHODIMPV_(type) - -// end_winnt - - -// -// Low order two bits of a handle are ignored by the system and available -// for use by application code as tag bits. The remaining bits are opaque -// and used to store a serial number and table index. -// - -#define OBJ_HANDLE_TAGBITS 0x00000003L - -// -// Cardinal Data Types [0 - 2**N-2) -// - -typedef char CCHAR; // winnt -typedef short CSHORT; -typedef ULONG CLONG; - -typedef CCHAR *PCCHAR; -typedef CSHORT *PCSHORT; -typedef CLONG *PCLONG; - - -// -// __int64 is only supported by 2.0 and later midl. -// __midl is set by the 2.0 midl and not by 1.0 midl. -// - -#define _ULONGLONG_ -#if (!defined (_MAC) && (!defined(MIDL_PASS) || defined(__midl)) && (!defined(_M_IX86) || (defined(_INTEGRAL_MAX_BITS) && _INTEGRAL_MAX_BITS >= 64))) -typedef __int64 LONGLONG; -typedef unsigned __int64 ULONGLONG; - -#define MAXLONGLONG (0x7fffffffffffffff) - - -#else - -#if defined(_MAC) && defined(_MAC_INT_64) -typedef __int64 LONGLONG; -typedef unsigned __int64 ULONGLONG; - -#define MAXLONGLONG (0x7fffffffffffffff) - - -#else -typedef double LONGLONG; -typedef double ULONGLONG; -#endif //_MAC and int64 - -#endif - -typedef LONGLONG *PLONGLONG; -typedef ULONGLONG *PULONGLONG; - -// Update Sequence Number - -typedef LONGLONG USN; - -#if defined(MIDL_PASS) -typedef struct _LARGE_INTEGER { -#else // MIDL_PASS -typedef union _LARGE_INTEGER { - struct { - ULONG LowPart; - LONG HighPart; - } DUMMYSTRUCTNAME; - struct { - ULONG LowPart; - LONG HighPart; - } u; -#endif //MIDL_PASS - LONGLONG QuadPart; -} LARGE_INTEGER; - -typedef LARGE_INTEGER *PLARGE_INTEGER; - -#if defined(MIDL_PASS) -typedef struct _ULARGE_INTEGER { -#else // MIDL_PASS -typedef union _ULARGE_INTEGER { - struct { - ULONG LowPart; - ULONG HighPart; - } DUMMYSTRUCTNAME; - struct { - ULONG LowPart; - ULONG HighPart; - } u; -#endif //MIDL_PASS - ULONGLONG QuadPart; -} ULARGE_INTEGER; - -typedef ULARGE_INTEGER *PULARGE_INTEGER; - - -// -// Boolean -// - -typedef UCHAR BOOLEAN; // winnt -typedef BOOLEAN *PBOOLEAN; // winnt - - -// -// Constants -// - -#define FALSE 0 -#define TRUE 1 - -#ifndef NULL -#ifdef __cplusplus -#define NULL 0 -#define NULL64 0 -#else -#define NULL ((void *)0) -#define NULL64 ((void * POINTER_64)0) -#endif -#endif // NULL - -#include - -// -// Macros used to eliminate compiler warning generated when formal -// parameters or local variables are not declared. -// -// Use DBG_UNREFERENCED_PARAMETER() when a parameter is not yet -// referenced but will be once the module is completely developed. -// -// Use DBG_UNREFERENCED_LOCAL_VARIABLE() when a local variable is not yet -// referenced but will be once the module is completely developed. -// -// Use UNREFERENCED_PARAMETER() if a parameter will never be referenced. -// -// DBG_UNREFERENCED_PARAMETER and DBG_UNREFERENCED_LOCAL_VARIABLE will -// eventually be made into a null macro to help determine whether there -// is unfinished work. -// - -#if ! defined(lint) -#define UNREFERENCED_PARAMETER(P) (P) -#define DBG_UNREFERENCED_PARAMETER(P) (P) -#define DBG_UNREFERENCED_LOCAL_VARIABLE(V) (V) - -#else // lint - -// Note: lint -e530 says don't complain about uninitialized variables for -// this varible. Error 527 has to do with unreachable code. -// -restore restores checking to the -save state - -#define UNREFERENCED_PARAMETER(P) \ - /*lint -save -e527 -e530 */ \ - { \ - (P) = (P); \ - } \ - /*lint -restore */ -#define DBG_UNREFERENCED_PARAMETER(P) \ - /*lint -save -e527 -e530 */ \ - { \ - (P) = (P); \ - } \ - /*lint -restore */ -#define DBG_UNREFERENCED_LOCAL_VARIABLE(V) \ - /*lint -save -e527 -e530 */ \ - { \ - (V) = (V); \ - } \ - /*lint -restore */ - -#endif // lint - -// -// Macro used to eliminate compiler warning 4715 within a switch statement -// when all possible cases have already been accounted for. -// -// switch (a & 3) { -// case 0: return 1; -// case 1: return Foo(); -// case 2: return Bar(); -// case 3: return 1; -// DEFAULT_UNREACHABLE; -// - -#if (_MSC_VER > 1200) -#define DEFAULT_UNREACHABLE default: __assume(0) -#else - -// -// Older compilers do not support __assume(), and there is no other free -// method of eliminating the warning. -// - -#define DEFAULT_UNREACHABLE - -#endif - -#ifdef __cplusplus - -// Define operator overloads to enable bit operations on enum values that are -// used to define flags. Use DEFINE_ENUM_FLAG_OPERATORS(YOUR_TYPE) to enable these -// operators on YOUR_TYPE. - -// Moved here from objbase.w. - -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \ -extern "C++" { \ -inline ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) | ((int)b)); } \ -inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) |= ((int)b)); } \ -inline ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) & ((int)b)); } \ -inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) &= ((int)b)); } \ -inline ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((int)a)); } \ -inline ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((int)a) ^ ((int)b)); } \ -inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((int &)a) ^= ((int)b)); } \ -} -#else -#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) // NOP, C allows these operators. -#endif - -// Compile-time macros for initializing flag values in const data. -// -// When using DEFINE_ENUM_FLAG_OPERATORS for enum values you should use the macros below -// when you need to initialize global const data. Without these macros the inline operators -// from DEFINE_ENUM_FLAG_OPERATORS force a runtime initialization rather than a -// compile time initialization. This applies even if you have declared the data as const. -#define COMPILETIME_OR_2FLAGS(a,b) ((UINT)(a)|(UINT)(b)) -#define COMPILETIME_OR_3FLAGS(a,b,c) ((UINT)(a)|(UINT)(b)|(UINT)(c)) -#define COMPILETIME_OR_4FLAGS(a,b,c,d) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)) -#define COMPILETIME_OR_5FLAGS(a,b,c,d,e) ((UINT)(a)|(UINT)(b)|(UINT)(c)|(UINT)(d)|(UINT)(e)) - -// end_winnt - -// -// Define standard min and max macros -// - -#ifndef NOMINMAX - -#ifndef min -#define min(a,b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef max -#define max(a,b) (((a) > (b)) ? (a) : (b)) -#endif - -#endif // NOMINMAX - - - -// -// IOCTL_TAPE_ERASE definitions -// - -#define TAPE_ERASE_SHORT 0L -#define TAPE_ERASE_LONG 1L - -typedef struct _TAPE_ERASE { - ULONG Type; - BOOLEAN Immediate; -} TAPE_ERASE, *PTAPE_ERASE; - -// -// IOCTL_TAPE_PREPARE definitions -// - -#define TAPE_LOAD 0L -#define TAPE_UNLOAD 1L -#define TAPE_TENSION 2L -#define TAPE_LOCK 3L -#define TAPE_UNLOCK 4L -#define TAPE_FORMAT 5L - -typedef struct _TAPE_PREPARE { - ULONG Operation; - BOOLEAN Immediate; -} TAPE_PREPARE, *PTAPE_PREPARE; - -// -// IOCTL_TAPE_WRITE_MARKS definitions -// - -#define TAPE_SETMARKS 0L -#define TAPE_FILEMARKS 1L -#define TAPE_SHORT_FILEMARKS 2L -#define TAPE_LONG_FILEMARKS 3L - -typedef struct _TAPE_WRITE_MARKS { - ULONG Type; - ULONG Count; - BOOLEAN Immediate; -} TAPE_WRITE_MARKS, *PTAPE_WRITE_MARKS; - -// -// IOCTL_TAPE_GET_POSITION definitions -// - -#define TAPE_ABSOLUTE_POSITION 0L -#define TAPE_LOGICAL_POSITION 1L -#define TAPE_PSEUDO_LOGICAL_POSITION 2L - -typedef struct _TAPE_GET_POSITION { - ULONG Type; - ULONG Partition; - LARGE_INTEGER Offset; -} TAPE_GET_POSITION, *PTAPE_GET_POSITION; - -// -// IOCTL_TAPE_SET_POSITION definitions -// - -#define TAPE_REWIND 0L -#define TAPE_ABSOLUTE_BLOCK 1L -#define TAPE_LOGICAL_BLOCK 2L -#define TAPE_PSEUDO_LOGICAL_BLOCK 3L -#define TAPE_SPACE_END_OF_DATA 4L -#define TAPE_SPACE_RELATIVE_BLOCKS 5L -#define TAPE_SPACE_FILEMARKS 6L -#define TAPE_SPACE_SEQUENTIAL_FMKS 7L -#define TAPE_SPACE_SETMARKS 8L -#define TAPE_SPACE_SEQUENTIAL_SMKS 9L - -typedef struct _TAPE_SET_POSITION { - ULONG Method; - ULONG Partition; - LARGE_INTEGER Offset; - BOOLEAN Immediate; -} TAPE_SET_POSITION, *PTAPE_SET_POSITION; - -// -// IOCTL_TAPE_GET_DRIVE_PARAMS definitions -// - -// -// Definitions for FeaturesLow parameter -// - -#define TAPE_DRIVE_FIXED 0x00000001 -#define TAPE_DRIVE_SELECT 0x00000002 -#define TAPE_DRIVE_INITIATOR 0x00000004 - -#define TAPE_DRIVE_ERASE_SHORT 0x00000010 -#define TAPE_DRIVE_ERASE_LONG 0x00000020 -#define TAPE_DRIVE_ERASE_BOP_ONLY 0x00000040 -#define TAPE_DRIVE_ERASE_IMMEDIATE 0x00000080 - -#define TAPE_DRIVE_TAPE_CAPACITY 0x00000100 -#define TAPE_DRIVE_TAPE_REMAINING 0x00000200 -#define TAPE_DRIVE_FIXED_BLOCK 0x00000400 -#define TAPE_DRIVE_VARIABLE_BLOCK 0x00000800 - -#define TAPE_DRIVE_WRITE_PROTECT 0x00001000 -#define TAPE_DRIVE_EOT_WZ_SIZE 0x00002000 - -#define TAPE_DRIVE_ECC 0x00010000 -#define TAPE_DRIVE_COMPRESSION 0x00020000 -#define TAPE_DRIVE_PADDING 0x00040000 -#define TAPE_DRIVE_REPORT_SMKS 0x00080000 - -#define TAPE_DRIVE_GET_ABSOLUTE_BLK 0x00100000 -#define TAPE_DRIVE_GET_LOGICAL_BLK 0x00200000 -#define TAPE_DRIVE_SET_EOT_WZ_SIZE 0x00400000 - -#define TAPE_DRIVE_EJECT_MEDIA 0x01000000 -#define TAPE_DRIVE_CLEAN_REQUESTS 0x02000000 -#define TAPE_DRIVE_SET_CMP_BOP_ONLY 0x04000000 - -#define TAPE_DRIVE_RESERVED_BIT 0x80000000 //don't use this bit! -// //can't be a low features bit! -// //reserved; high features only - -// -// Definitions for FeaturesHigh parameter -// - -#define TAPE_DRIVE_LOAD_UNLOAD 0x80000001 -#define TAPE_DRIVE_TENSION 0x80000002 -#define TAPE_DRIVE_LOCK_UNLOCK 0x80000004 -#define TAPE_DRIVE_REWIND_IMMEDIATE 0x80000008 - -#define TAPE_DRIVE_SET_BLOCK_SIZE 0x80000010 -#define TAPE_DRIVE_LOAD_UNLD_IMMED 0x80000020 -#define TAPE_DRIVE_TENSION_IMMED 0x80000040 -#define TAPE_DRIVE_LOCK_UNLK_IMMED 0x80000080 - -#define TAPE_DRIVE_SET_ECC 0x80000100 -#define TAPE_DRIVE_SET_COMPRESSION 0x80000200 -#define TAPE_DRIVE_SET_PADDING 0x80000400 -#define TAPE_DRIVE_SET_REPORT_SMKS 0x80000800 - -#define TAPE_DRIVE_ABSOLUTE_BLK 0x80001000 -#define TAPE_DRIVE_ABS_BLK_IMMED 0x80002000 -#define TAPE_DRIVE_LOGICAL_BLK 0x80004000 -#define TAPE_DRIVE_LOG_BLK_IMMED 0x80008000 - -#define TAPE_DRIVE_END_OF_DATA 0x80010000 -#define TAPE_DRIVE_RELATIVE_BLKS 0x80020000 -#define TAPE_DRIVE_FILEMARKS 0x80040000 -#define TAPE_DRIVE_SEQUENTIAL_FMKS 0x80080000 - -#define TAPE_DRIVE_SETMARKS 0x80100000 -#define TAPE_DRIVE_SEQUENTIAL_SMKS 0x80200000 -#define TAPE_DRIVE_REVERSE_POSITION 0x80400000 -#define TAPE_DRIVE_SPACE_IMMEDIATE 0x80800000 - -#define TAPE_DRIVE_WRITE_SETMARKS 0x81000000 -#define TAPE_DRIVE_WRITE_FILEMARKS 0x82000000 -#define TAPE_DRIVE_WRITE_SHORT_FMKS 0x84000000 -#define TAPE_DRIVE_WRITE_LONG_FMKS 0x88000000 - -#define TAPE_DRIVE_WRITE_MARK_IMMED 0x90000000 -#define TAPE_DRIVE_FORMAT 0xA0000000 -#define TAPE_DRIVE_FORMAT_IMMEDIATE 0xC0000000 -#define TAPE_DRIVE_HIGH_FEATURES 0x80000000 //mask for high features flag - -typedef struct _TAPE_GET_DRIVE_PARAMETERS { - BOOLEAN ECC; - BOOLEAN Compression; - BOOLEAN DataPadding; - BOOLEAN ReportSetmarks; - ULONG DefaultBlockSize; - ULONG MaximumBlockSize; - ULONG MinimumBlockSize; - ULONG MaximumPartitionCount; - ULONG FeaturesLow; - ULONG FeaturesHigh; - ULONG EOTWarningZoneSize; -} TAPE_GET_DRIVE_PARAMETERS, *PTAPE_GET_DRIVE_PARAMETERS; - -// -// IOCTL_TAPE_SET_DRIVE_PARAMETERS definitions -// - -typedef struct _TAPE_SET_DRIVE_PARAMETERS { - BOOLEAN ECC; - BOOLEAN Compression; - BOOLEAN DataPadding; - BOOLEAN ReportSetmarks; - ULONG EOTWarningZoneSize; -} TAPE_SET_DRIVE_PARAMETERS, *PTAPE_SET_DRIVE_PARAMETERS; - -// -// IOCTL_TAPE_GET_MEDIA_PARAMETERS definitions -// - -typedef struct _TAPE_GET_MEDIA_PARAMETERS { - LARGE_INTEGER Capacity; - LARGE_INTEGER Remaining; - ULONG BlockSize; - ULONG PartitionCount; - BOOLEAN WriteProtected; -} TAPE_GET_MEDIA_PARAMETERS, *PTAPE_GET_MEDIA_PARAMETERS; - -// -// IOCTL_TAPE_SET_MEDIA_PARAMETERS definitions -// - -typedef struct _TAPE_SET_MEDIA_PARAMETERS { - ULONG BlockSize; -} TAPE_SET_MEDIA_PARAMETERS, *PTAPE_SET_MEDIA_PARAMETERS; - -// -// IOCTL_TAPE_CREATE_PARTITION definitions -// - -#define TAPE_FIXED_PARTITIONS 0L -#define TAPE_SELECT_PARTITIONS 1L -#define TAPE_INITIATOR_PARTITIONS 2L - -typedef struct _TAPE_CREATE_PARTITION { - ULONG Method; - ULONG Count; - ULONG Size; -} TAPE_CREATE_PARTITION, *PTAPE_CREATE_PARTITION; - - -// -// WMI Methods -// -#define TAPE_QUERY_DRIVE_PARAMETERS 0L -#define TAPE_QUERY_MEDIA_CAPACITY 1L -#define TAPE_CHECK_FOR_DRIVE_PROBLEM 2L -#define TAPE_QUERY_IO_ERROR_DATA 3L -#define TAPE_QUERY_DEVICE_ERROR_DATA 4L - -typedef struct _TAPE_WMI_OPERATIONS { - ULONG Method; - ULONG DataBufferSize; - PVOID DataBuffer; -} TAPE_WMI_OPERATIONS, *PTAPE_WMI_OPERATIONS; - -// -// Type of drive errors -// -typedef enum _TAPE_DRIVE_PROBLEM_TYPE { - TapeDriveProblemNone, TapeDriveReadWriteWarning, - TapeDriveReadWriteError, TapeDriveReadWarning, - TapeDriveWriteWarning, TapeDriveReadError, - TapeDriveWriteError, TapeDriveHardwareError, - TapeDriveUnsupportedMedia, TapeDriveScsiConnectionError, - TapeDriveTimetoClean, TapeDriveCleanDriveNow, - TapeDriveMediaLifeExpired, TapeDriveSnappedTape -} TAPE_DRIVE_PROBLEM_TYPE; - - - -typedef struct _TAPE_STATISTICS { - ULONG Version; - ULONG Flags; - LARGE_INTEGER RecoveredWrites; - LARGE_INTEGER UnrecoveredWrites; - LARGE_INTEGER RecoveredReads; - LARGE_INTEGER UnrecoveredReads; - UCHAR CompressionRatioReads; - UCHAR CompressionRatioWrites; -} TAPE_STATISTICS, *PTAPE_STATISTICS; - -#define RECOVERED_WRITES_VALID 0x00000001 -#define UNRECOVERED_WRITES_VALID 0x00000002 -#define RECOVERED_READS_VALID 0x00000004 -#define UNRECOVERED_READS_VALID 0x00000008 -#define WRITE_COMPRESSION_INFO_VALID 0x00000010 -#define READ_COMPRESSION_INFO_VALID 0x00000020 - -typedef struct _TAPE_GET_STATISTICS { - ULONG Operation; -} TAPE_GET_STATISTICS, *PTAPE_GET_STATISTICS; - -#define TAPE_RETURN_STATISTICS 0L -#define TAPE_RETURN_ENV_INFO 1L -#define TAPE_RESET_STATISTICS 2L - -// -// IOCTL_STORAGE_GET_MEDIA_TYPES_EX will return an array of DEVICE_MEDIA_INFO -// structures, one per supported type, embedded in the GET_MEDIA_TYPES struct. -// - -typedef enum _STORAGE_MEDIA_TYPE { - // - // Following are defined in ntdddisk.h in the MEDIA_TYPE enum - // - // Unknown, // Format is unknown - // F5_1Pt2_512, // 5.25", 1.2MB, 512 bytes/sector - // F3_1Pt44_512, // 3.5", 1.44MB, 512 bytes/sector - // F3_2Pt88_512, // 3.5", 2.88MB, 512 bytes/sector - // F3_20Pt8_512, // 3.5", 20.8MB, 512 bytes/sector - // F3_720_512, // 3.5", 720KB, 512 bytes/sector - // F5_360_512, // 5.25", 360KB, 512 bytes/sector - // F5_320_512, // 5.25", 320KB, 512 bytes/sector - // F5_320_1024, // 5.25", 320KB, 1024 bytes/sector - // F5_180_512, // 5.25", 180KB, 512 bytes/sector - // F5_160_512, // 5.25", 160KB, 512 bytes/sector - // RemovableMedia, // Removable media other than floppy - // FixedMedia, // Fixed hard disk media - // F3_120M_512, // 3.5", 120M Floppy - // F3_640_512, // 3.5" , 640KB, 512 bytes/sector - // F5_640_512, // 5.25", 640KB, 512 bytes/sector - // F5_720_512, // 5.25", 720KB, 512 bytes/sector - // F3_1Pt2_512, // 3.5" , 1.2Mb, 512 bytes/sector - // F3_1Pt23_1024, // 3.5" , 1.23Mb, 1024 bytes/sector - // F5_1Pt23_1024, // 5.25", 1.23MB, 1024 bytes/sector - // F3_128Mb_512, // 3.5" MO 128Mb 512 bytes/sector - // F3_230Mb_512, // 3.5" MO 230Mb 512 bytes/sector - // F8_256_128, // 8", 256KB, 128 bytes/sector - // F3_200Mb_512, // 3.5", 200M Floppy (HiFD) - // - - DDS_4mm = 0x20, // Tape - DAT DDS1,2,... (all vendors) - MiniQic, // Tape - miniQIC Tape - Travan, // Tape - Travan TR-1,2,3,... - QIC, // Tape - QIC - MP_8mm, // Tape - 8mm Exabyte Metal Particle - AME_8mm, // Tape - 8mm Exabyte Advanced Metal Evap - AIT1_8mm, // Tape - 8mm Sony AIT - DLT, // Tape - DLT Compact IIIxt, IV - NCTP, // Tape - Philips NCTP - IBM_3480, // Tape - IBM 3480 - IBM_3490E, // Tape - IBM 3490E - IBM_Magstar_3590, // Tape - IBM Magstar 3590 - IBM_Magstar_MP, // Tape - IBM Magstar MP - STK_DATA_D3, // Tape - STK Data D3 - SONY_DTF, // Tape - Sony DTF - DV_6mm, // Tape - 6mm Digital Video - DMI, // Tape - Exabyte DMI and compatibles - SONY_D2, // Tape - Sony D2S and D2L - CLEANER_CARTRIDGE, // Cleaner - All Drive types that support Drive Cleaners - CD_ROM, // Opt_Disk - CD - CD_R, // Opt_Disk - CD-Recordable (Write Once) - CD_RW, // Opt_Disk - CD-Rewriteable - DVD_ROM, // Opt_Disk - DVD-ROM - DVD_R, // Opt_Disk - DVD-Recordable (Write Once) - DVD_RW, // Opt_Disk - DVD-Rewriteable - MO_3_RW, // Opt_Disk - 3.5" Rewriteable MO Disk - MO_5_WO, // Opt_Disk - MO 5.25" Write Once - MO_5_RW, // Opt_Disk - MO 5.25" Rewriteable (not LIMDOW) - MO_5_LIMDOW, // Opt_Disk - MO 5.25" Rewriteable (LIMDOW) - PC_5_WO, // Opt_Disk - Phase Change 5.25" Write Once Optical - PC_5_RW, // Opt_Disk - Phase Change 5.25" Rewriteable - PD_5_RW, // Opt_Disk - PhaseChange Dual Rewriteable - ABL_5_WO, // Opt_Disk - Ablative 5.25" Write Once Optical - PINNACLE_APEX_5_RW, // Opt_Disk - Pinnacle Apex 4.6GB Rewriteable Optical - SONY_12_WO, // Opt_Disk - Sony 12" Write Once - PHILIPS_12_WO, // Opt_Disk - Philips/LMS 12" Write Once - HITACHI_12_WO, // Opt_Disk - Hitachi 12" Write Once - CYGNET_12_WO, // Opt_Disk - Cygnet/ATG 12" Write Once - KODAK_14_WO, // Opt_Disk - Kodak 14" Write Once - MO_NFR_525, // Opt_Disk - Near Field Recording (Terastor) - NIKON_12_RW, // Opt_Disk - Nikon 12" Rewriteable - IOMEGA_ZIP, // Mag_Disk - Iomega Zip - IOMEGA_JAZ, // Mag_Disk - Iomega Jaz - SYQUEST_EZ135, // Mag_Disk - Syquest EZ135 - SYQUEST_EZFLYER, // Mag_Disk - Syquest EzFlyer - SYQUEST_SYJET, // Mag_Disk - Syquest SyJet - AVATAR_F2, // Mag_Disk - 2.5" Floppy - MP2_8mm, // Tape - 8mm Hitachi - DST_S, // Ampex DST Small Tapes - DST_M, // Ampex DST Medium Tapes - DST_L, // Ampex DST Large Tapes - VXATape_1, // Ecrix 8mm Tape - VXATape_2, // Ecrix 8mm Tape -#if (NTDDI_VERSION < NTDDI_WINXP) - STK_EAGLE, // STK Eagle -#else - STK_9840, // STK 9840 -#endif - LTO_Ultrium, // IBM, HP, Seagate LTO Ultrium - LTO_Accelis, // IBM, HP, Seagate LTO Accelis - DVD_RAM, // Opt_Disk - DVD-RAM - AIT_8mm, // AIT2 or higher - ADR_1, // OnStream ADR Mediatypes - ADR_2, - STK_9940, // STK 9940 - SAIT, // SAIT Tapes - VXATape // VXA (Ecrix 8mm) Tape -}STORAGE_MEDIA_TYPE, *PSTORAGE_MEDIA_TYPE; - -#define MEDIA_ERASEABLE 0x00000001 -#define MEDIA_WRITE_ONCE 0x00000002 -#define MEDIA_READ_ONLY 0x00000004 -#define MEDIA_READ_WRITE 0x00000008 - -#define MEDIA_WRITE_PROTECTED 0x00000100 -#define MEDIA_CURRENTLY_MOUNTED 0x80000000 - -// -// Define the different storage bus types -// Bus types below 128 (0x80) are reserved for Microsoft use -// - -typedef enum _STORAGE_BUS_TYPE { - BusTypeUnknown = 0x00, - BusTypeScsi, - BusTypeAtapi, - BusTypeAta, - BusType1394, - BusTypeSsa, - BusTypeFibre, - BusTypeUsb, - BusTypeRAID, - BusTypeiScsi, - BusTypeSas, - BusTypeSata, - BusTypeSd, - BusTypeMmc, - BusTypeVirtual, - BusTypeFileBackedVirtual, - BusTypeMax, - BusTypeMaxReserved = 0x7F -} STORAGE_BUS_TYPE, *PSTORAGE_BUS_TYPE; - -typedef struct _DEVICE_MEDIA_INFO { - union { - struct { - LARGE_INTEGER Cylinders; - STORAGE_MEDIA_TYPE MediaType; - ULONG TracksPerCylinder; - ULONG SectorsPerTrack; - ULONG BytesPerSector; - ULONG NumberMediaSides; - ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values. - } DiskInfo; - - struct { - LARGE_INTEGER Cylinders; - STORAGE_MEDIA_TYPE MediaType; - ULONG TracksPerCylinder; - ULONG SectorsPerTrack; - ULONG BytesPerSector; - ULONG NumberMediaSides; - ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values. - } RemovableDiskInfo; - - struct { - STORAGE_MEDIA_TYPE MediaType; - ULONG MediaCharacteristics; // Bitmask of MEDIA_XXX values. - ULONG CurrentBlockSize; - STORAGE_BUS_TYPE BusType; - - // - // Bus specific information describing the medium supported. - // - - union { - struct { - UCHAR MediumType; - UCHAR DensityCode; - } ScsiInformation; - } BusSpecificData; - - } TapeInfo; - } DeviceSpecific; -} DEVICE_MEDIA_INFO, *PDEVICE_MEDIA_INFO; - -typedef struct _GET_MEDIA_TYPES { - ULONG DeviceType; // FILE_DEVICE_XXX values - ULONG MediaInfoCount; - DEVICE_MEDIA_INFO MediaInfo[1]; -} GET_MEDIA_TYPES, *PGET_MEDIA_TYPES; - - -// -// IOCTL_STORAGE_PREDICT_FAILURE -// -// input - none -// -// output - STORAGE_PREDICT_FAILURE structure -// PredictFailure returns zero if no failure predicted and non zero -// if a failure is predicted. -// -// VendorSpecific returns 512 bytes of vendor specific information -// if a failure is predicted -// -typedef struct _STORAGE_PREDICT_FAILURE -{ - ULONG PredictFailure; - UCHAR VendorSpecific[512]; -} STORAGE_PREDICT_FAILURE, *PSTORAGE_PREDICT_FAILURE; - - -#define MAXIMUM_CDB_SIZE 12 - -// -// SCSI I/O Request Block -// - -typedef struct _SCSI_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR ScsiStatus; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - UCHAR QueueTag; // offset 8 - UCHAR QueueAction; // offset 9 - UCHAR CdbLength; // offset a - UCHAR SenseInfoBufferLength; // offset b - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - __field_bcount(DataTransferLength) \ - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - union { - ULONG InternalStatus; // offset 2c - ULONG QueueSortKey; // offset 2c - ULONG LinkTimeoutValue; // offset 2c - }; - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Cdb[16]; // offset 30 -} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK; - -#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK) - -// -// SCSI I/O Request Block for WMI Requests -// - -typedef struct _SCSI_WMI_REQUEST_BLOCK { - USHORT Length; - UCHAR Function; // SRB_FUNCTION_WMI - UCHAR SrbStatus; - UCHAR WMISubFunction; - UCHAR PathId; // If SRB_WMI_FLAGS_ADAPTER_REQUEST is set in - UCHAR TargetId; // WMIFlags then PathId, TargetId and Lun are - UCHAR Lun; // reserved fields. - UCHAR Reserved1; - UCHAR WMIFlags; - UCHAR Reserved2[2]; - ULONG SrbFlags; - ULONG DataTransferLength; - ULONG TimeOutValue; - PVOID DataBuffer; - PVOID DataPath; - PVOID Reserved3; - PVOID OriginalRequest; - PVOID SrbExtension; - ULONG Reserved4; - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved6; - -#endif -#endif - - UCHAR Reserved5[16]; -} SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK; - -typedef enum _STOR_DEVICE_POWER_STATE { - StorPowerDeviceUnspecified = 0, - StorPowerDeviceD0, - StorPowerDeviceD1, - StorPowerDeviceD2, - StorPowerDeviceD3, - StorPowerDeviceMaximum -} STOR_DEVICE_POWER_STATE, *PSTOR_DEVICE_POWER_STATE; - -typedef enum { - StorPowerActionNone = 0, - StorPowerActionReserved, - StorPowerActionSleep, - StorPowerActionHibernate, - StorPowerActionShutdown, - StorPowerActionShutdownReset, - StorPowerActionShutdownOff, - StorPowerActionWarmEject -} STOR_POWER_ACTION, *PSTOR_POWER_ACTION; - -typedef struct _SCSI_POWER_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR SrbPowerFlags; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_DEVICE_POWER_STATE DevicePowerState; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - STOR_POWER_ACTION PowerAction; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Reserved5[16]; // offset 30 -} SCSI_POWER_REQUEST_BLOCK, *PSCSI_POWER_REQUEST_BLOCK; - -// -// PNP minor function codes. -// -typedef enum { - StorStartDevice = 0x0, - StorRemoveDevice = 0x2, - StorStopDevice = 0x4, - StorQueryCapabilities = 0x9, - StorQueryResourceRequirements = 0xB, - StorFilterResourceRequirements = 0xD, - StorSurpriseRemoval = 0x17 -} STOR_PNP_ACTION, *PSTOR_PNP_ACTION; - -typedef struct _STOR_DEVICE_CAPABILITIES { - USHORT Version; - ULONG DeviceD1:1; - ULONG DeviceD2:1; - ULONG LockSupported:1; - ULONG EjectSupported:1; - ULONG Removable:1; - ULONG DockDevice:1; - ULONG UniqueID:1; - ULONG SilentInstall:1; - ULONG SurpriseRemovalOK:1; - ULONG NoDisplayInUI:1; - -} STOR_DEVICE_CAPABILITIES, *PSTOR_DEVICE_CAPABILITIES; - -typedef struct _SCSI_PNP_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR PnPSubFunction; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_PNP_ACTION PnPAction; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - ULONG SrbPnPFlags; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - UCHAR Reserved4[16]; // offset 30 -} SCSI_PNP_REQUEST_BLOCK, *PSCSI_PNP_REQUEST_BLOCK; - - -// -// SRB Functions -// - -#define SRB_FUNCTION_EXECUTE_SCSI 0x00 -#define SRB_FUNCTION_CLAIM_DEVICE 0x01 -#define SRB_FUNCTION_IO_CONTROL 0x02 -#define SRB_FUNCTION_RECEIVE_EVENT 0x03 -#define SRB_FUNCTION_RELEASE_QUEUE 0x04 -#define SRB_FUNCTION_ATTACH_DEVICE 0x05 -#define SRB_FUNCTION_RELEASE_DEVICE 0x06 -#define SRB_FUNCTION_SHUTDOWN 0x07 -#define SRB_FUNCTION_FLUSH 0x08 -#define SRB_FUNCTION_ABORT_COMMAND 0x10 -#define SRB_FUNCTION_RELEASE_RECOVERY 0x11 -#define SRB_FUNCTION_RESET_BUS 0x12 -#define SRB_FUNCTION_RESET_DEVICE 0x13 -#define SRB_FUNCTION_TERMINATE_IO 0x14 -#define SRB_FUNCTION_FLUSH_QUEUE 0x15 -#define SRB_FUNCTION_REMOVE_DEVICE 0x16 -#define SRB_FUNCTION_WMI 0x17 -#define SRB_FUNCTION_LOCK_QUEUE 0x18 -#define SRB_FUNCTION_UNLOCK_QUEUE 0x19 -#define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20 -#define SRB_FUNCTION_SET_LINK_TIMEOUT 0x21 -#define SRB_FUNCTION_LINK_TIMEOUT_OCCURRED 0x22 -#define SRB_FUNCTION_LINK_TIMEOUT_COMPLETE 0x23 -#define SRB_FUNCTION_POWER 0x24 -#define SRB_FUNCTION_PNP 0x25 -#define SRB_FUNCTION_DUMP_POINTERS 0x26 -// -// SRB Status -// - -#define SRB_STATUS_PENDING 0x00 -#define SRB_STATUS_SUCCESS 0x01 -#define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 -#define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 -#define SRB_STATUS_INVALID_REQUEST 0x06 -#define SRB_STATUS_INVALID_PATH_ID 0x07 -#define SRB_STATUS_NO_DEVICE 0x08 -#define SRB_STATUS_TIMEOUT 0x09 -#define SRB_STATUS_SELECTION_TIMEOUT 0x0A -#define SRB_STATUS_COMMAND_TIMEOUT 0x0B -#define SRB_STATUS_MESSAGE_REJECTED 0x0D -#define SRB_STATUS_BUS_RESET 0x0E -#define SRB_STATUS_PARITY_ERROR 0x0F -#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 -#define SRB_STATUS_NO_HBA 0x11 -#define SRB_STATUS_DATA_OVERRUN 0x12 -#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 -#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 -#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 -#define SRB_STATUS_REQUEST_FLUSHED 0x16 -#define SRB_STATUS_INVALID_LUN 0x20 -#define SRB_STATUS_INVALID_TARGET_ID 0x21 -#define SRB_STATUS_BAD_FUNCTION 0x22 -#define SRB_STATUS_ERROR_RECOVERY 0x23 -#define SRB_STATUS_NOT_POWERED 0x24 -#define SRB_STATUS_LINK_DOWN 0x25 - -// -// This value is used by the port driver to indicate that a non-scsi-related -// error occured. Miniports must never return this status. -// - -#define SRB_STATUS_INTERNAL_ERROR 0x30 - -// -// Srb status values 0x38 through 0x3f are reserved for internal port driver -// use. -// - - - -// -// SRB Status Masks -// - -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - -#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) - -// -// SRB Flag Bits -// - -#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002 -#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004 -#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 - -#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010 -#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 -#define SRB_FLAGS_DATA_IN 0x00000040 -#define SRB_FLAGS_DATA_OUT 0x00000080 -#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 -#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT) - -#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100 -#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200 -#define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400 - -#define SRB_FLAGS_IS_ACTIVE 0x00010000 -#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000 -#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000 -#define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000 - -#define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000 -#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000 - -#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000 -#define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000 - -#define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000 -#define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000 - -#if DBG==1 -// -// A signature used to validate the scsi port number -// at the end of a sense buffer. -// -#define SCSI_PORT_SIGNATURE 0x54524f50 -#endif - -// -// Queue Action -// - -#define SRB_SIMPLE_TAG_REQUEST 0x20 -#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21 -#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22 - -#define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_POWER_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_PNP_FLAGS_ADAPTER_REQUEST 0x01 - - -#ifndef _NTDDK_ -#define SCSIPORT_API DECLSPEC_IMPORT -#else -#define SCSIPORT_API -#endif - - -SCSIPORT_API -VOID -ScsiDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); - - -// begin_storport - -// -// Command Descriptor Block. Passed by SCSI controller chip over the SCSI bus -// - -#pragma pack(push, cdb, 1) -typedef union _CDB { - - // - // Generic 6-Byte CDB - // - - struct _CDB6GENERIC { - UCHAR OperationCode; - UCHAR Immediate : 1; - UCHAR CommandUniqueBits : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR CommandUniqueBytes[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } CDB6GENERIC; - - // - // Standard 6-byte CDB - // - - struct _CDB6READWRITE { - UCHAR OperationCode; // 0x08, 0x0A - SCSIOP_READ, SCSIOP_WRITE - UCHAR LogicalBlockMsb1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockMsb0; - UCHAR LogicalBlockLsb; - UCHAR TransferBlocks; - UCHAR Control; - } CDB6READWRITE; - - // - // SCSI-1 Inquiry CDB - // - - struct _CDB6INQUIRY { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode; - UCHAR IReserved; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY; - - // - // SCSI-3 Inquiry CDB - // - - struct _CDB6INQUIRY3 { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR EnableVitalProductData : 1; - UCHAR CommandSupportData : 1; - UCHAR Reserved1 : 6; - UCHAR PageCode; - UCHAR Reserved2; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY3; - - struct _CDB6VERIFY { - UCHAR OperationCode; // 0x13 - SCSIOP_VERIFY - UCHAR Fixed : 1; - UCHAR ByteCompare : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR VerificationLength[3]; - UCHAR Control; - } CDB6VERIFY; - - // - // SCSI Format CDB - // - - struct _CDB6FORMAT { - UCHAR OperationCode; // 0x04 - SCSIOP_FORMAT_UNIT - UCHAR FormatControl : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR FReserved1; - UCHAR InterleaveMsb; - UCHAR InterleaveLsb; - UCHAR FReserved2; - } CDB6FORMAT; - - // - // Standard 10-byte CDB - - struct _CDB10 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved2; - UCHAR TransferBlocksMsb; - UCHAR TransferBlocksLsb; - UCHAR Control; - } CDB10; - - // - // Standard 12-byte CDB - // - - struct _CDB12 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB12; - - - - // - // Standard 16-byte CDB - // - - struct _CDB16 { - UCHAR OperationCode; - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR Protection : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB16; - - - // - // CD Rom Audio CDBs - // - - struct _PAUSE_RESUME { - UCHAR OperationCode; // 0x4B - SCSIOP_PAUSE_RESUME - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[6]; - UCHAR Action; - UCHAR Control; - } PAUSE_RESUME; - - // - // Read Table of Contents - // - - struct _READ_TOC { - UCHAR OperationCode; // 0x43 - SCSIOP_READ_TOC - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Format2 : 4; - UCHAR Reserved2 : 4; - UCHAR Reserved3[3]; - UCHAR StartingTrack; - UCHAR AllocationLength[2]; - UCHAR Control : 6; - UCHAR Format : 2; - } READ_TOC; - - struct _READ_DISK_INFORMATION { - UCHAR OperationCode; // 0x51 - SCSIOP_READ_DISC_INFORMATION - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_DISK_INFORMATION, READ_DISC_INFORMATION; - - struct _READ_TRACK_INFORMATION { - UCHAR OperationCode; // 0x52 - SCSIOP_READ_TRACK_INFORMATION - UCHAR Track : 2; - UCHAR Reserved4 : 3; - UCHAR Lun : 3; - UCHAR BlockAddress[4]; // or Track Number - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_TRACK_INFORMATION; - - struct _RESERVE_TRACK_RZONE { - UCHAR OperationCode; // 0x53 - SCSIOP_RESERVE_TRACK_RZONE - UCHAR Reserved1[4]; - UCHAR ReservationSize[4]; - UCHAR Control; - } RESERVE_TRACK_RZONE; - - struct _SEND_OPC_INFORMATION { - UCHAR OperationCode; // 0x54 - SCSIOP_SEND_OPC_INFORMATION - UCHAR DoOpc : 1; // perform OPC - UCHAR Reserved1 : 7; - UCHAR Exclude0 : 1; // exclude layer 0 - UCHAR Exclude1 : 1; // exclude layer 1 - UCHAR Reserved2 : 6; - UCHAR Reserved3[4]; - UCHAR ParameterListLength[2]; - UCHAR Reserved4; - } SEND_OPC_INFORMATION; - - struct _REPAIR_TRACK { - UCHAR OperationCode; // 0x58 - SCSIOP_REPAIR_TRACK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[2]; - UCHAR TrackNumber[2]; - UCHAR Reserved3[3]; - UCHAR Control; - } REPAIR_TRACK; - - struct _CLOSE_TRACK { - UCHAR OperationCode; // 0x5B - SCSIOP_CLOSE_TRACK_SESSION - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Track : 1; - UCHAR Session : 1; - UCHAR Reserved2 : 6; - UCHAR Reserved3; - UCHAR TrackNumber[2]; - UCHAR Reserved4[3]; - UCHAR Control; - } CLOSE_TRACK; - - struct _READ_BUFFER_CAPACITY { - UCHAR OperationCode; // 0x5C - SCSIOP_READ_BUFFER_CAPACITY - UCHAR BlockInfo : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_BUFFER_CAPACITY; - - struct _SEND_CUE_SHEET { - UCHAR OperationCode; // 0x5D - SCSIOP_SEND_CUE_SHEET - UCHAR Reserved[5]; - UCHAR CueSheetSize[3]; - UCHAR Control; - } SEND_CUE_SHEET; - - struct _READ_HEADER { - UCHAR OperationCode; // 0x44 - SCSIOP_READ_HEADER - UCHAR Reserved1 : 1; - UCHAR Msf : 1; - UCHAR Reserved2 : 3; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_HEADER; - - struct _PLAY_AUDIO { - UCHAR OperationCode; // 0x45 - SCSIOP_PLAY_AUDIO - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingBlockAddress[4]; - UCHAR Reserved2; - UCHAR PlayLength[2]; - UCHAR Control; - } PLAY_AUDIO; - - struct _PLAY_AUDIO_MSF { - UCHAR OperationCode; // 0x47 - SCSIOP_PLAY_AUDIO_MSF - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Control; - } PLAY_AUDIO_MSF; - - struct _BLANK_MEDIA { - UCHAR OperationCode; // 0xA1 - SCSIOP_BLANK - UCHAR BlankType : 3; - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 3; - UCHAR AddressOrTrack[4]; - UCHAR Reserved3[5]; - UCHAR Control; - } BLANK_MEDIA; - - struct _PLAY_CD { - UCHAR OperationCode; // 0xBC - SCSIOP_PLAY_CD - UCHAR Reserved1 : 1; - UCHAR CMSF : 1; // LBA = 0, MSF = 1 - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - - union { - struct _LBA { - UCHAR StartingBlockAddress[4]; - UCHAR PlayLength[4]; - } LBA; - - struct _MSF { - UCHAR Reserved1; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved2; - } MSF; - }; - - UCHAR Audio : 1; - UCHAR Composite : 1; - UCHAR Port1 : 1; - UCHAR Port2 : 1; - UCHAR Reserved2 : 3; - UCHAR Speed : 1; - UCHAR Control; - } PLAY_CD; - - struct _SCAN_CD { - UCHAR OperationCode; // 0xBA - SCSIOP_SCAN_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 3; - UCHAR Direct : 1; - UCHAR Lun : 3; - UCHAR StartingAddress[4]; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 6; - UCHAR Type : 2; - UCHAR Reserved4; - UCHAR Control; - } SCAN_CD; - - struct _STOP_PLAY_SCAN { - UCHAR OperationCode; // 0x4E - SCSIOP_STOP_PLAY_SCAN - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[7]; - UCHAR Control; - } STOP_PLAY_SCAN; - - - // - // Read SubChannel Data - // - - struct _SUBCHANNEL { - UCHAR OperationCode; // 0x42 - SCSIOP_READ_SUB_CHANNEL - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2 : 6; - UCHAR SubQ : 1; - UCHAR Reserved3 : 1; - UCHAR Format; - UCHAR Reserved4[2]; - UCHAR TrackNumber; - UCHAR AllocationLength[2]; - UCHAR Control; - } SUBCHANNEL; - - // - // Read CD. Used by Atapi for raw sector reads. - // - - struct _READ_CD { - UCHAR OperationCode; // 0xBE - SCSIOP_READ_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved0 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR StartingLBA[4]; - UCHAR TransferBlocks[3]; - UCHAR Reserved2 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved3 : 5; - UCHAR Control; - } READ_CD; - - struct _READ_CD_MSF { - UCHAR OperationCode; // 0xB9 - SCSIOP_READ_CD_MSF - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved4 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved5 : 5; - UCHAR Control; - } READ_CD_MSF; - - // - // Plextor Read CD-DA - // - - struct _PLXTR_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0 : 5; - UCHAR LogicalUnitNumber :3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR TransferBlockByte2; - UCHAR TransferBlockByte3; - UCHAR SubCode; - UCHAR Control; - } PLXTR_READ_CDDA; - - // - // NEC Read CD-DA - // - - struct _NEC_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved1; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR Control; - } NEC_READ_CDDA; - - // - // Mode sense - // - - struct _MODE_SENSE { - UCHAR OperationCode; // 0x1A - SCSIOP_MODE_SENSE - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3; - UCHAR AllocationLength; - UCHAR Control; - } MODE_SENSE; - - struct _MODE_SENSE10 { - UCHAR OperationCode; // 0x5A - SCSIOP_MODE_SENSE10 - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3[4]; - UCHAR AllocationLength[2]; - UCHAR Control; - } MODE_SENSE10; - - // - // Mode select - // - - struct _MODE_SELECT { - UCHAR OperationCode; // 0x15 - SCSIOP_MODE_SELECT - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR ParameterListLength; - UCHAR Control; - } MODE_SELECT; - - struct _MODE_SELECT10 { - UCHAR OperationCode; // 0x55 - SCSIOP_MODE_SELECT10 - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[5]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } MODE_SELECT10; - - struct _LOCATE { - UCHAR OperationCode; // 0x2B - SCSIOP_LOCATE - UCHAR Immediate : 1; - UCHAR CPBit : 1; - UCHAR BTBit : 1; - UCHAR Reserved1 : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved4; - UCHAR Partition; - UCHAR Control; - } LOCATE; - - struct _LOGSENSE { - UCHAR OperationCode; // 0x4D - SCSIOP_LOG_SENSE - UCHAR SPBit : 1; - UCHAR PPCBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR PCBit : 2; - UCHAR Reserved2; - UCHAR Reserved3; - UCHAR ParameterPointer[2]; - UCHAR AllocationLength[2]; - UCHAR Control; - } LOGSENSE; - - struct _LOGSELECT { - UCHAR OperationCode; // 0x4C - SCSIOP_LOG_SELECT - UCHAR SPBit : 1; - UCHAR PCRBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved : 6; - UCHAR PCBit : 2; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } LOGSELECT; - - struct _PRINT { - UCHAR OperationCode; // 0x0A - SCSIOP_PRINT - UCHAR Reserved : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } PRINT; - - struct _SEEK { - UCHAR OperationCode; // 0x2B - SCSIOP_SEEK - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved2[3]; - UCHAR Control; - } SEEK; - - struct _ERASE { - UCHAR OperationCode; // 0x19 - SCSIOP_ERASE - UCHAR Long : 1; - UCHAR Immediate : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[3]; - UCHAR Control; - } ERASE; - - struct _START_STOP { - UCHAR OperationCode; // 0x1B - SCSIOP_START_STOP_UNIT - UCHAR Immediate: 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } START_STOP; - - struct _MEDIA_REMOVAL { - UCHAR OperationCode; // 0x1E - SCSIOP_MEDIUM_REMOVAL - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - - UCHAR Prevent : 1; - UCHAR Persistant : 1; - UCHAR Reserved3 : 6; - - UCHAR Control; - } MEDIA_REMOVAL; - - // - // Tape CDBs - // - - struct _SEEK_BLOCK { - UCHAR OperationCode; // 0x0C - SCSIOP_SEEK_BLOCK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR BlockAddress[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } SEEK_BLOCK; - - struct _REQUEST_BLOCK_ADDRESS { - UCHAR OperationCode; // 0x02 - SCSIOP_REQUEST_BLOCK_ADDR - UCHAR Reserved1[3]; - UCHAR AllocationLength; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } REQUEST_BLOCK_ADDRESS; - - struct _PARTITION { - UCHAR OperationCode; // 0x0D - SCSIOP_PARTITION - UCHAR Immediate : 1; - UCHAR Sel: 1; - UCHAR PartitionSelect : 6; - UCHAR Reserved1[3]; - UCHAR Control; - } PARTITION; - - struct _WRITE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Immediate : 1; - UCHAR WriteSetMarks: 1; - UCHAR Reserved : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } WRITE_TAPE_MARKS; - - struct _SPACE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Code : 3; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR NumMarksMSB ; - UCHAR NumMarks; - UCHAR NumMarksLSB; - union { - UCHAR value; - struct { - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } Fields; - } Byte6; - } SPACE_TAPE_MARKS; - - // - // Read tape position - // - - struct _READ_POSITION { - UCHAR Operation; // 0x43 - SCSIOP_READ_POSITION - UCHAR BlockType:1; - UCHAR Reserved1:4; - UCHAR Lun:3; - UCHAR Reserved2[7]; - UCHAR Control; - } READ_POSITION; - - // - // ReadWrite for Tape - // - - struct _CDB6READWRITETAPE { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR VendorSpecific : 5; - UCHAR Reserved : 3; - UCHAR TransferLenMSB; - UCHAR TransferLen; - UCHAR TransferLenLSB; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved1 : 4; - UCHAR VendorUnique : 2; - } CDB6READWRITETAPE; - - // - // Medium changer CDB's - // - - struct _INIT_ELEMENT_STATUS { - UCHAR OperationCode; // 0x07 - SCSIOP_INIT_ELEMENT_STATUS - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNubmer : 3; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 7; - UCHAR NoBarCode : 1; - } INIT_ELEMENT_STATUS; - - struct _INITIALIZE_ELEMENT_RANGE { - UCHAR OperationCode; // 0xE7 - SCSIOP_INIT_ELEMENT_RANGE - UCHAR Range : 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNubmer : 3; - UCHAR FirstElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved3; - UCHAR Reserved4 : 7; - UCHAR NoBarCode : 1; - } INITIALIZE_ELEMENT_RANGE; - - struct _POSITION_TO_ELEMENT { - UCHAR OperationCode; // 0x2B - SCSIOP_POSITION_TO_ELEMENT - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } POSITION_TO_ELEMENT; - - struct _MOVE_MEDIUM { - UCHAR OperationCode; // 0xA5 - SCSIOP_MOVE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } MOVE_MEDIUM; - - struct _EXCHANGE_MEDIUM { - UCHAR OperationCode; // 0xA6 - SCSIOP_EXCHANGE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR Destination1ElementAddress[2]; - UCHAR Destination2ElementAddress[2]; - UCHAR Flip1 : 1; - UCHAR Flip2 : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } EXCHANGE_MEDIUM; - - struct _READ_ELEMENT_STATUS { - UCHAR OperationCode; // 0xB8 - SCSIOP_READ_ELEMENT_STATUS - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } READ_ELEMENT_STATUS; - - struct _SEND_VOLUME_TAG { - UCHAR OperationCode; // 0xB6 - SCSIOP_SEND_VOLUME_TAG - UCHAR ElementType : 4; - UCHAR Reserved1 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR Reserved2; - UCHAR ActionCode : 5; - UCHAR Reserved3 : 3; - UCHAR Reserved4[2]; - UCHAR ParameterListLength[2]; - UCHAR Reserved5; - UCHAR Control; - } SEND_VOLUME_TAG; - - struct _REQUEST_VOLUME_ELEMENT_ADDRESS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } REQUEST_VOLUME_ELEMENT_ADDRESS; - - // - // Atapi 2.5 Changer 12-byte CDBs - // - - struct _LOAD_UNLOAD { - UCHAR OperationCode; // 0xA6 - SCSIOP_LOAD_UNLOAD_SLOT - UCHAR Immediate : 1; - UCHAR Reserved1 : 4; - UCHAR Lun : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3: 6; - UCHAR Reserved4[3]; - UCHAR Slot; - UCHAR Reserved5[3]; - } LOAD_UNLOAD; - - struct _MECH_STATUS { - UCHAR OperationCode; // 0xBD - SCSIOP_MECHANISM_STATUS - UCHAR Reserved : 5; - UCHAR Lun : 3; - UCHAR Reserved1[6]; - UCHAR AllocationLength[2]; - UCHAR Reserved2[1]; - UCHAR Control; - } MECH_STATUS; - - // - // C/DVD 0.9 CDBs - // - - struct _SYNCHRONIZE_CACHE10 { - - UCHAR OperationCode; // 0x35 - SCSIOP_SYNCHRONIZE_CACHE - - UCHAR RelAddr : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 3; - UCHAR Lun : 3; - - UCHAR LogicalBlockAddress[4]; // Unused - set to zero - UCHAR Reserved2; - UCHAR BlockCount[2]; // Unused - set to zero - UCHAR Control; - } SYNCHRONIZE_CACHE10; - - struct _GET_EVENT_STATUS_NOTIFICATION { - UCHAR OperationCode; // 0x4A - SCSIOP_GET_EVENT_STATUS_NOTIFICATION - - UCHAR Immediate : 1; - UCHAR Reserved : 4; - UCHAR Lun : 3; - - UCHAR Reserved2[2]; - UCHAR NotificationClassRequest; - UCHAR Reserved3[2]; - UCHAR EventListLength[2]; - - UCHAR Control; - } GET_EVENT_STATUS_NOTIFICATION; - - struct _GET_PERFORMANCE { - UCHAR OperationCode; // 0xAC - SCSIOP_GET_PERFORMANCE - UCHAR Except : 2; - UCHAR Write : 1; - UCHAR Tolerance : 2; - UCHAR Reserved0 : 3; - UCHAR StartingLBA[4]; - UCHAR Reserved1[2]; - UCHAR MaximumNumberOfDescriptors[2]; - UCHAR Type; - UCHAR Control; - } GET_PERFORMANCE; - - struct _READ_DVD_STRUCTURE { - UCHAR OperationCode; // 0xAD - SCSIOP_READ_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR RMDBlockNumber[4]; - UCHAR LayerNumber; - UCHAR Format; - UCHAR AllocationLength[2]; - UCHAR Reserved3 : 6; - UCHAR AGID : 2; - UCHAR Control; - } READ_DVD_STRUCTURE; - - struct _SET_STREAMING { - UCHAR OperationCode; // 0xB6 - SCSIOP_SET_STREAMING - UCHAR Reserved[8]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } SET_STREAMING; - - struct _SEND_DVD_STRUCTURE { - UCHAR OperationCode; // 0xBF - SCSIOP_SEND_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR Format; - UCHAR ParameterListLength[2]; - UCHAR Reserved3; - UCHAR Control; - } SEND_DVD_STRUCTURE; - - struct _SEND_KEY { - UCHAR OperationCode; // 0xA3 - SCSIOP_SEND_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[6]; - UCHAR ParameterListLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } SEND_KEY; - - struct _REPORT_KEY { - UCHAR OperationCode; // 0xA4 - SCSIOP_REPORT_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; // for title key - UCHAR Reserved2[2]; - UCHAR AllocationLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } REPORT_KEY; - - struct _SET_READ_AHEAD { - UCHAR OperationCode; // 0xA7 - SCSIOP_SET_READ_AHEAD - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR TriggerLBA[4]; - UCHAR ReadAheadLBA[4]; - UCHAR Reserved2; - UCHAR Control; - } SET_READ_AHEAD; - - struct _READ_FORMATTED_CAPACITIES { - UCHAR OperationCode; // 0x23 - SCSIOP_READ_FORMATTED_CAPACITY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_FORMATTED_CAPACITIES; - - // - // SCSI-3 - // - - struct _REPORT_LUNS { - UCHAR OperationCode; // 0xA0 - SCSIOP_REPORT_LUNS - UCHAR Reserved1[5]; - UCHAR AllocationLength[4]; - UCHAR Reserved2[1]; - UCHAR Control; - } REPORT_LUNS; - - struct _PERSISTENT_RESERVE_IN { - UCHAR OperationCode; // 0x5E - SCSIOP_PERSISTENT_RESERVE_IN - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } PERSISTENT_RESERVE_IN; - - struct _PERSISTENT_RESERVE_OUT { - UCHAR OperationCode; // 0x5F - SCSIOP_PERSISTENT_RESERVE_OUT - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; // 0x18 - UCHAR Control; - } PERSISTENT_RESERVE_OUT; - - // - // MMC / SFF-8090 commands - // - - struct _GET_CONFIGURATION { - UCHAR OperationCode; // 0x46 - SCSIOP_GET_CONFIGURATION - UCHAR RequestType : 2; // SCSI_GET_CONFIGURATION_REQUEST_TYPE_* - UCHAR Reserved1 : 6; // includes obsolete LUN field - UCHAR StartingFeature[2]; - UCHAR Reserved2[3]; - UCHAR AllocationLength[2]; - UCHAR Control; - } GET_CONFIGURATION; - - struct _SET_CD_SPEED { - UCHAR OperationCode; // 0xB8 - SCSIOP_SET_CD_SPEED - union { - UCHAR Reserved1; - struct { - UCHAR RotationControl : 2; - UCHAR Reserved3 : 6; - }; - }; - UCHAR ReadSpeed[2]; // 1x == (75 * 2352) - UCHAR WriteSpeed[2]; // 1x == (75 * 2352) - UCHAR Reserved2[5]; - UCHAR Control; - } SET_CD_SPEED; - - struct _READ12 { - UCHAR OperationCode; // 0xA8 - SCSIOP_READ12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ12; - - struct _WRITE12 { - UCHAR OperationCode; // 0xAA - SCSIOP_WRITE12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR EBP : 1; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE12; - - // - // 16-byte CDBs - // - - struct _READ16 { - UCHAR OperationCode; // 0x88 - SCSIOP_READ16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR ReadProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ16; - - struct _WRITE16 { - UCHAR OperationCode; // 0x8A - SCSIOP_WRITE16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR WriteProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE16; - - struct _VERIFY16 { - UCHAR OperationCode; // 0x8F - SCSIOP_VERIFY16 - UCHAR Reserved1 : 1; - UCHAR ByteCheck : 1; - UCHAR BlockVerify : 1; - UCHAR Reserved2 : 1; - UCHAR DisablePageOut : 1; - UCHAR VerifyProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR VerificationLength[4]; - UCHAR Reserved3 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } VERIFY16; - - struct _SYNCHRONIZE_CACHE16 { - UCHAR OperationCode; // 0x91 - SCSIOP_SYNCHRONIZE_CACHE16 - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 6; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR Reserved3; - UCHAR Control; - } SYNCHRONIZE_CACHE16; - - struct _READ_CAPACITY16 { - UCHAR OperationCode; // 0x9E - SCSIOP_READ_CAPACITY16 - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR PMI : 1; - UCHAR Reserved2 : 7; - UCHAR Control; - } READ_CAPACITY16; - - ULONG AsUlong[4]; - UCHAR AsByte[16]; - -} CDB, *PCDB; -#pragma pack(pop, cdb) - -//////////////////////////////////////////////////////////////////////////////// -// -// GET_EVENT_STATUS_NOTIFICATION -// - - -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_MASK 0x02 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_MASK 0x04 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_MASK 0x08 -#define NOTIFICATION_MEDIA_STATUS_CLASS_MASK 0x10 -#define NOTIFICATION_MULTI_HOST_CLASS_MASK 0x20 -#define NOTIFICATION_DEVICE_BUSY_CLASS_MASK 0x40 - - -#define NOTIFICATION_NO_CLASS_EVENTS 0x0 -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_EVENTS 0x1 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_EVENTS 0x2 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_EVENTS 0x3 -#define NOTIFICATION_MEDIA_STATUS_CLASS_EVENTS 0x4 -#define NOTIFICATION_MULTI_HOST_CLASS_EVENTS 0x5 -#define NOTIFICATION_DEVICE_BUSY_CLASS_EVENTS 0x6 - -#pragma pack(push, not_header, 1) -typedef struct _NOTIFICATION_EVENT_STATUS_HEADER { - UCHAR EventDataLength[2]; - - UCHAR NotificationClass : 3; - UCHAR Reserved : 4; - UCHAR NEA : 1; - - UCHAR SupportedEventClasses; -#if !defined(__midl) - UCHAR ClassEventData[0]; -#endif -} NOTIFICATION_EVENT_STATUS_HEADER, *PNOTIFICATION_EVENT_STATUS_HEADER; -#pragma pack(pop, not_header) - -#define NOTIFICATION_OPERATIONAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_REQUESTED 0x1 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_OCCURRED 0x2 - -#define NOTIFICATION_OPERATIONAL_STATUS_AVAILABLE 0x0 -#define NOTIFICATION_OPERATIONAL_STATUS_TEMPORARY_BUSY 0x1 -#define NOTIFICATION_OPERATIONAL_STATUS_EXTENDED_BUSY 0x2 - -#define NOTIFICATION_OPERATIONAL_OPCODE_NONE 0x0 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_CHANGE 0x1 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_ADDED 0x2 -#define NOTIFICATION_OPERATIONAL_OPCODE_UNIT_RESET 0x3 -#define NOTIFICATION_OPERATIONAL_OPCODE_FIRMWARE_CHANGED 0x4 -#define NOTIFICATION_OPERATIONAL_OPCODE_INQUIRY_CHANGED 0x5 - -// -// Class event data may be one (or none) of the following: -// - -#pragma pack(push, not_op, 1) -typedef struct _NOTIFICATION_OPERATIONAL_STATUS { // event class == 0x1 - UCHAR OperationalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR OperationalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Operation[2]; -} NOTIFICATION_OPERATIONAL_STATUS, *PNOTIFICATION_OPERATIONAL_STATUS; -#pragma pack(pop, not_op) - - -#define NOTIFICATION_POWER_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_POWER_EVENT_CHANGE_SUCCEEDED 0x1 -#define NOTIFICATION_POWER_EVENT_CHANGE_FAILED 0x2 - -#define NOTIFICATION_POWER_STATUS_ACTIVE 0x1 -#define NOTIFICATION_POWER_STATUS_IDLE 0x2 -#define NOTIFICATION_POWER_STATUS_STANDBY 0x3 -#define NOTIFICATION_POWER_STATUS_SLEEP 0x4 - -#pragma pack(push, not_power, 1) -typedef struct _NOTIFICATION_POWER_STATUS { // event class == 0x2 - UCHAR PowerEvent : 4; - UCHAR Reserved : 4; - UCHAR PowerStatus; - UCHAR Reserved2[2]; -} NOTIFICATION_POWER_STATUS, *PNOTIFICATION_POWER_STATUS; -#pragma pack(pop, not_power) - -#define NOTIFICATION_MEDIA_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_DOWN 0x1 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_UP 0x2 -#define NOTIFICATION_EXTERNAL_EVENT_EXTERNAL 0x3 // respond with GET_CONFIGURATION? - -#define NOTIFICATION_EXTERNAL_STATUS_READY 0x0 -#define NOTIFICATION_EXTERNAL_STATUS_PREVENT 0x1 - -#define NOTIFICATION_EXTERNAL_REQUEST_NONE 0x0000 -#define NOTIFICATION_EXTERNAL_REQUEST_QUEUE_OVERRUN 0x0001 -#define NOTIFICATION_EXTERNAL_REQUEST_PLAY 0x0101 -#define NOTIFICATION_EXTERNAL_REQUEST_REWIND_BACK 0x0102 -#define NOTIFICATION_EXTERNAL_REQUEST_FAST_FORWARD 0x0103 -#define NOTIFICATION_EXTERNAL_REQUEST_PAUSE 0x0104 -#define NOTIFICATION_EXTERNAL_REQUEST_STOP 0x0106 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_LOW 0x0200 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_HIGH 0x02ff - -#pragma pack(push, not_extern, 1) -typedef struct _NOTIFICATION_EXTERNAL_STATUS { // event class == 0x3 - UCHAR ExternalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR ExternalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Request[2]; -} NOTIFICATION_EXTERNAL_STATUS, *PNOTIFICATION_EXTERNAL_STATUS; -#pragma pack(pop, not_extern) - -#define NOTIFICATION_MEDIA_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MEDIA_EVENT_EJECT_REQUEST 0x1 -#define NOTIFICATION_MEDIA_EVENT_NEW_MEDIA 0x2 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_REMOVAL 0x3 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_CHANGE 0x4 - -#pragma pack(push, not_media, 1) -typedef struct _NOTIFICATION_MEDIA_STATUS { // event class == 0x4 - UCHAR MediaEvent : 4; - UCHAR Reserved : 4; - - union { - UCHAR PowerStatus; // OBSOLETE -- was improperly named in NT5 headers - UCHAR MediaStatus; // Use this for currently reserved fields - struct { - UCHAR DoorTrayOpen : 1; - UCHAR MediaPresent : 1; - UCHAR ReservedX : 6; // do not reference this directly! - }; - }; - UCHAR StartSlot; - UCHAR EndSlot; -} NOTIFICATION_MEDIA_STATUS, *PNOTIFICATION_MEDIA_STATUS; -#pragma pack(pop, not_media) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_REQUEST 0x1 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_GRANT 0x2 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_RELEASE 0x3 - -#define NOTIFICATION_MULTI_HOST_STATUS_READY 0x0 -#define NOTIFICATION_MULTI_HOST_STATUS_PREVENT 0x1 - -#define NOTIFICATION_MULTI_HOST_PRIORITY_NO_REQUESTS 0x0 -#define NOTIFICATION_MULTI_HOST_PRIORITY_LOW 0x1 -#define NOTIFICATION_MULTI_HOST_PRIORITY_MEDIUM 0x2 -#define NOTIFICATION_MULTI_HOST_PRIORITY_HIGH 0x3 - -#pragma pack(push, not_multi, 1) -typedef struct _NOTIFICATION_MULTI_HOST_STATUS { // event class == 0x5 - UCHAR MultiHostEvent : 4; - UCHAR Reserved1 : 4; - UCHAR MultiHostStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Priority[2]; -} NOTIFICATION_MULTI_HOST_STATUS, *PNOTIFICATION_MULTI_HOST_STATUS; -#pragma pack(pop, not_multi) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_BUSY_EVENT_BUSY 0x1 - -#define NOTIFICATION_BUSY_STATUS_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_STATUS_POWER 0x1 -#define NOTIFICATION_BUSY_STATUS_IMMEDIATE 0x2 -#define NOTIFICATION_BUSY_STATUS_DEFERRED 0x3 - -#pragma pack(push, not_busy, 1) -typedef struct _NOTIFICATION_BUSY_STATUS { // event class == 0x6 - UCHAR DeviceBusyEvent : 4; - UCHAR Reserved : 4; - - UCHAR DeviceBusyStatus; - UCHAR Time[2]; -} NOTIFICATION_BUSY_STATUS, *PNOTIFICATION_BUSY_STATUS; -#pragma pack(pop, not_busy) - -//////////////////////////////////////////////////////////////////////////////// - -// -// Read DVD Structure Definitions and Constants -// - -#define DVD_FORMAT_LEAD_IN 0x00 -#define DVD_FORMAT_COPYRIGHT 0x01 -#define DVD_FORMAT_DISK_KEY 0x02 -#define DVD_FORMAT_BCA 0x03 -#define DVD_FORMAT_MANUFACTURING 0x04 - -#pragma pack(push, dvd_struct_header, 1) -typedef struct _READ_DVD_STRUCTURES_HEADER { - UCHAR Length[2]; - UCHAR Reserved[2]; - -#if !defined(__midl) - UCHAR Data[0]; -#endif -} READ_DVD_STRUCTURES_HEADER, *PREAD_DVD_STRUCTURES_HEADER; -#pragma pack(pop, dvd_struct_header) - -// -// DiskKey, BCA & Manufacturer information will provide byte arrays as their -// data. -// - -// -// CDVD 0.9 Send & Report Key Definitions and Structures -// - -#define DVD_REPORT_AGID 0x00 -#define DVD_CHALLENGE_KEY 0x01 -#define DVD_KEY_1 0x02 -#define DVD_KEY_2 0x03 -#define DVD_TITLE_KEY 0x04 -#define DVD_REPORT_ASF 0x05 -#define DVD_INVALIDATE_AGID 0x3F - -#pragma pack(push, dvdstuff, 1) -typedef struct _CDVD_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved[2]; -#if !defined(__midl) - UCHAR Data[0]; -#endif -} CDVD_KEY_HEADER, *PCDVD_KEY_HEADER; - -typedef struct _CDVD_REPORT_AGID_DATA { - UCHAR Reserved1[3]; - UCHAR Reserved2 : 6; - UCHAR AGID : 2; -} CDVD_REPORT_AGID_DATA, *PCDVD_REPORT_AGID_DATA; - -typedef struct _CDVD_CHALLENGE_KEY_DATA { - UCHAR ChallengeKeyValue[10]; - UCHAR Reserved[2]; -} CDVD_CHALLENGE_KEY_DATA, *PCDVD_CHALLENGE_KEY_DATA; - -typedef struct _CDVD_KEY_DATA { - UCHAR Key[5]; - UCHAR Reserved[3]; -} CDVD_KEY_DATA, *PCDVD_KEY_DATA; - -typedef struct _CDVD_REPORT_ASF_DATA { - UCHAR Reserved1[3]; - UCHAR Success : 1; - UCHAR Reserved2 : 7; -} CDVD_REPORT_ASF_DATA, *PCDVD_REPORT_ASF_DATA; - -typedef struct _CDVD_TITLE_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved1[1]; - UCHAR Reserved2 : 3; - UCHAR CGMS : 2; - UCHAR CP_SEC : 1; - UCHAR CPM : 1; - UCHAR Zero : 1; - CDVD_KEY_DATA TitleKey; -} CDVD_TITLE_KEY_HEADER, *PCDVD_TITLE_KEY_HEADER; -#pragma pack(pop, dvdstuff) - - -// -// Format Unit Data definitions and structures -// - -#pragma pack(push, format_unit, 1) -typedef struct _FORMAT_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR FormatSubType : 2; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMAT_DESCRIPTOR, *PFORMAT_DESCRIPTOR; - -typedef struct _FORMAT_LIST_HEADER { - UCHAR Reserved; - UCHAR VendorSpecific : 1; - UCHAR Immediate : 1; - UCHAR TryOut : 1; - UCHAR IP : 1; - UCHAR STPF : 1; - UCHAR DCRT : 1; - UCHAR DPRY : 1; - UCHAR FOV : 1; - UCHAR FormatDescriptorLength[2]; -#if !defined(__midl) - FORMAT_DESCRIPTOR Descriptors[0]; -#endif -} FORMAT_LIST_HEADER, *PFORMAT_LIST_HEADER; -#pragma pack(pop, format_unit) - -// -// Read Formatted Capacity Data - returned in Big Endian Format -// - - -#pragma pack(push, formatted_capacity, 1) -typedef struct _FORMATTED_CAPACITY_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR Maximum : 1; - UCHAR Valid : 1; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMATTED_CAPACITY_DESCRIPTOR, *PFORMATTED_CAPACITY_DESCRIPTOR; - -typedef struct _FORMATTED_CAPACITY_LIST { - UCHAR Reserved[3]; - UCHAR CapacityListLength; -#if !defined(__midl) - FORMATTED_CAPACITY_DESCRIPTOR Descriptors[0]; -#endif -} FORMATTED_CAPACITY_LIST, *PFORMATTED_CAPACITY_LIST; -#pragma pack(pop, formatted_capacity) - -// -// BLANK command blanking type codes -// - -#define BLANK_FULL 0x0 -#define BLANK_MINIMAL 0x1 -#define BLANK_TRACK 0x2 -#define BLANK_UNRESERVE_TRACK 0x3 -#define BLANK_TAIL 0x4 -#define BLANK_UNCLOSE_SESSION 0x5 -#define BLANK_SESSION 0x6 - -// -// PLAY_CD definitions and constants -// - -#define CD_EXPECTED_SECTOR_ANY 0x0 -#define CD_EXPECTED_SECTOR_CDDA 0x1 -#define CD_EXPECTED_SECTOR_MODE1 0x2 -#define CD_EXPECTED_SECTOR_MODE2 0x3 -#define CD_EXPECTED_SECTOR_MODE2_FORM1 0x4 -#define CD_EXPECTED_SECTOR_MODE2_FORM2 0x5 - -// -// Read Disk Information Definitions and Capabilities -// - -#define DISK_STATUS_EMPTY 0x00 -#define DISK_STATUS_INCOMPLETE 0x01 -#define DISK_STATUS_COMPLETE 0x02 -#define DISK_STATUS_OTHERS 0x03 - -#define LAST_SESSION_EMPTY 0x00 -#define LAST_SESSION_INCOMPLETE 0x01 -#define LAST_SESSION_RESERVED_DAMAGED 0x02 -#define LAST_SESSION_COMPLETE 0x03 - -#define DISK_TYPE_CDDA 0x00 -#define DISK_TYPE_CDI 0x10 -#define DISK_TYPE_XA 0x20 -#define DISK_TYPE_UNDEFINED 0xFF - -// -// Values for MrwStatus field. -// - -#define DISC_BGFORMAT_STATE_NONE 0x0 -#define DISC_BGFORMAT_STATE_INCOMPLETE 0x1 -#define DISC_BGFORMAT_STATE_RUNNING 0x2 -#define DISC_BGFORMAT_STATE_COMPLETE 0x3 - - -#pragma pack(push, discinfo, 1) -typedef struct _OPC_TABLE_ENTRY { - UCHAR Speed[2]; - UCHAR OPCValue[6]; -} OPC_TABLE_ENTRY, *POPC_TABLE_ENTRY; - -typedef struct _DISC_INFORMATION { - - UCHAR Length[2]; - UCHAR DiscStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - UCHAR FirstTrackNumber; - - UCHAR NumberOfSessionsLsb; - UCHAR LastSessionFirstTrackLsb; - UCHAR LastSessionLastTrackLsb; - UCHAR MrwStatus : 2; - UCHAR MrwDirtyBit : 1; - UCHAR Reserved2 : 2; - UCHAR URU : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiscType; - UCHAR NumberOfSessionsMsb; - UCHAR LastSessionFirstTrackMsb; - UCHAR LastSessionLastTrackMsb; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // HMSF - UCHAR LastPossibleLeadOutStartTime[4]; // HMSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; - OPC_TABLE_ENTRY OPCTable[ 1 ]; // can be many of these here.... - -} DISC_INFORMATION, *PDISC_INFORMATION; - -// TODO: Deprecate DISK_INFORMATION -//#if PRAGMA_DEPRECATED_DDK -//#pragma deprecated(_DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated( DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated(PDISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#endif - -typedef struct _DISK_INFORMATION { - UCHAR Length[2]; - - UCHAR DiskStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - - UCHAR FirstTrackNumber; - UCHAR NumberOfSessions; - UCHAR LastSessionFirstTrack; - UCHAR LastSessionLastTrack; - - UCHAR Reserved2 : 5; - UCHAR GEN : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiskType; - UCHAR Reserved3[3]; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // MSF - UCHAR LastPossibleStartTime[4]; // MSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; -#if !defined(__midl) - OPC_TABLE_ENTRY OPCTable[0]; -#endif -} DISK_INFORMATION, *PDISK_INFORMATION; -#pragma pack(pop, discinfo) - - -// -// Read Header definitions and structures -// -#pragma pack(push, cdheader, 1) -typedef struct _DATA_BLOCK_HEADER { - UCHAR DataMode; - UCHAR Reserved[4]; - union { - UCHAR LogicalBlockAddress[4]; - struct { - UCHAR Reserved; - UCHAR M; - UCHAR S; - UCHAR F; - } MSF; - }; -} DATA_BLOCK_HEADER, *PDATA_BLOCK_HEADER; -#pragma pack(pop, cdheader) - - -#define DATA_BLOCK_MODE0 0x0 -#define DATA_BLOCK_MODE1 0x1 -#define DATA_BLOCK_MODE2 0x2 - -// -// Read TOC Format Codes -// - -#define READ_TOC_FORMAT_TOC 0x00 -#define READ_TOC_FORMAT_SESSION 0x01 -#define READ_TOC_FORMAT_FULL_TOC 0x02 -#define READ_TOC_FORMAT_PMA 0x03 -#define READ_TOC_FORMAT_ATIP 0x04 - -// TODO: Deprecate TRACK_INFORMATION structure, use TRACK_INFORMATION2 instead -#pragma pack(push, track_info, 1) -typedef struct _TRACK_INFORMATION { - UCHAR Length[2]; - UCHAR TrackNumber; - UCHAR SessionNumber; - UCHAR Reserved1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved2 : 2; - UCHAR DataMode : 4; - UCHAR FP : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR RT : 1; - UCHAR NWA_V : 1; - UCHAR Reserved3 : 7; - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; -} TRACK_INFORMATION, *PTRACK_INFORMATION; - -// Second Revision Modifies: -// * Longer names for some fields -// * LSB to track/session number fields -// * LRA_V bit -// Second Revision Adds: -// * TrackSize -// * LastRecordedAddress -// * MSB to track/session -// * Two reserved bytes -// Total structure size increased by 12 (0x0C) bytes -typedef struct _TRACK_INFORMATION2 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - -} TRACK_INFORMATION2, *PTRACK_INFORMATION2; - -// Third Revision Adds -// * ReadCompatibilityLBA -// Total structure size increased by 4 bytes -typedef struct _TRACK_INFORMATION3 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - UCHAR ReadCompatibilityLba[4]; - -} TRACK_INFORMATION3, *PTRACK_INFORMATION3; - -#pragma pack(pop, track_info) - -#pragma pack(push, perf_descriptor, 1) -typedef struct _PERFORMANCE_DESCRIPTOR { - - UCHAR RandomAccess : 1; - UCHAR Exact : 1; - UCHAR RestoreDefaults : 1; - UCHAR WriteRotationControl : 2; - UCHAR Reserved1 : 3; - - UCHAR Reserved[3]; - UCHAR StartLba[4]; - UCHAR EndLba[4]; - UCHAR ReadSize[4]; - UCHAR ReadTime[4]; - UCHAR WriteSize[4]; - UCHAR WriteTime[4]; - -} PERFORMANCE_DESCRIPTOR, *PPERFORMANCE_DESCRIPTOR; -#pragma pack(pop, perf_descriptor) - -// -// Command Descriptor Block constants. -// - -#define CDB6GENERIC_LENGTH 6 -#define CDB10GENERIC_LENGTH 10 -#define CDB12GENERIC_LENGTH 12 - -#define SETBITON 1 -#define SETBITOFF 0 - -// -// Mode Sense/Select page constants. -// - -#define MODE_PAGE_VENDOR_SPECIFIC 0x00 -#define MODE_PAGE_ERROR_RECOVERY 0x01 -#define MODE_PAGE_DISCONNECT 0x02 -#define MODE_PAGE_FORMAT_DEVICE 0x03 // disk -#define MODE_PAGE_MRW 0x03 // cdrom -#define MODE_PAGE_RIGID_GEOMETRY 0x04 -#define MODE_PAGE_FLEXIBILE 0x05 // disk -#define MODE_PAGE_WRITE_PARAMETERS 0x05 // cdrom -#define MODE_PAGE_VERIFY_ERROR 0x07 -#define MODE_PAGE_CACHING 0x08 -#define MODE_PAGE_PERIPHERAL 0x09 -#define MODE_PAGE_CONTROL 0x0A -#define MODE_PAGE_MEDIUM_TYPES 0x0B -#define MODE_PAGE_NOTCH_PARTITION 0x0C -#define MODE_PAGE_CD_AUDIO_CONTROL 0x0E -#define MODE_PAGE_DATA_COMPRESS 0x0F -#define MODE_PAGE_DEVICE_CONFIG 0x10 -#define MODE_PAGE_XOR_CONTROL 0x10 // disk -#define MODE_PAGE_MEDIUM_PARTITION 0x11 -#define MODE_PAGE_ENCLOSURE_SERVICES_MANAGEMENT 0x14 -#define MODE_PAGE_EXTENDED 0x15 -#define MODE_PAGE_EXTENDED_DEVICE_SPECIFIC 0x16 -#define MODE_PAGE_CDVD_FEATURE_SET 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_LUN 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_PORT 0x19 -#define MODE_PAGE_POWER_CONDITION 0x1A -#define MODE_PAGE_LUN_MAPPING 0x1B -#define MODE_PAGE_FAULT_REPORTING 0x1C -#define MODE_PAGE_CDVD_INACTIVITY 0x1D // cdrom -#define MODE_PAGE_ELEMENT_ADDRESS 0x1D -#define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E -#define MODE_PAGE_DEVICE_CAPABILITIES 0x1F -#define MODE_PAGE_CAPABILITIES 0x2A // cdrom - -#define MODE_SENSE_RETURN_ALL 0x3f - -#define MODE_SENSE_CURRENT_VALUES 0x00 -#define MODE_SENSE_CHANGEABLE_VALUES 0x40 -#define MODE_SENSE_DEFAULT_VAULES 0x80 -#define MODE_SENSE_SAVED_VALUES 0xc0 - - -// -// SCSI CDB operation codes -// - -// 6-byte commands: -#define SCSIOP_TEST_UNIT_READY 0x00 -#define SCSIOP_REZERO_UNIT 0x01 -#define SCSIOP_REWIND 0x01 -#define SCSIOP_REQUEST_BLOCK_ADDR 0x02 -#define SCSIOP_REQUEST_SENSE 0x03 -#define SCSIOP_FORMAT_UNIT 0x04 -#define SCSIOP_READ_BLOCK_LIMITS 0x05 -#define SCSIOP_REASSIGN_BLOCKS 0x07 -#define SCSIOP_INIT_ELEMENT_STATUS 0x07 -#define SCSIOP_READ6 0x08 -#define SCSIOP_RECEIVE 0x08 -#define SCSIOP_WRITE6 0x0A -#define SCSIOP_PRINT 0x0A -#define SCSIOP_SEND 0x0A -#define SCSIOP_SEEK6 0x0B -#define SCSIOP_TRACK_SELECT 0x0B -#define SCSIOP_SLEW_PRINT 0x0B -#define SCSIOP_SET_CAPACITY 0x0B // tape -#define SCSIOP_SEEK_BLOCK 0x0C -#define SCSIOP_PARTITION 0x0D -#define SCSIOP_READ_REVERSE 0x0F -#define SCSIOP_WRITE_FILEMARKS 0x10 -#define SCSIOP_FLUSH_BUFFER 0x10 -#define SCSIOP_SPACE 0x11 -#define SCSIOP_INQUIRY 0x12 -#define SCSIOP_VERIFY6 0x13 -#define SCSIOP_RECOVER_BUF_DATA 0x14 -#define SCSIOP_MODE_SELECT 0x15 -#define SCSIOP_RESERVE_UNIT 0x16 -#define SCSIOP_RELEASE_UNIT 0x17 -#define SCSIOP_COPY 0x18 -#define SCSIOP_ERASE 0x19 -#define SCSIOP_MODE_SENSE 0x1A -#define SCSIOP_START_STOP_UNIT 0x1B -#define SCSIOP_STOP_PRINT 0x1B -#define SCSIOP_LOAD_UNLOAD 0x1B -#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C -#define SCSIOP_SEND_DIAGNOSTIC 0x1D -#define SCSIOP_MEDIUM_REMOVAL 0x1E - -// 10-byte commands -#define SCSIOP_READ_FORMATTED_CAPACITY 0x23 -#define SCSIOP_READ_CAPACITY 0x25 -#define SCSIOP_READ 0x28 -#define SCSIOP_WRITE 0x2A -#define SCSIOP_SEEK 0x2B -#define SCSIOP_LOCATE 0x2B -#define SCSIOP_POSITION_TO_ELEMENT 0x2B -#define SCSIOP_WRITE_VERIFY 0x2E -#define SCSIOP_VERIFY 0x2F -#define SCSIOP_SEARCH_DATA_HIGH 0x30 -#define SCSIOP_SEARCH_DATA_EQUAL 0x31 -#define SCSIOP_SEARCH_DATA_LOW 0x32 -#define SCSIOP_SET_LIMITS 0x33 -#define SCSIOP_READ_POSITION 0x34 -#define SCSIOP_SYNCHRONIZE_CACHE 0x35 -#define SCSIOP_COMPARE 0x39 -#define SCSIOP_COPY_COMPARE 0x3A -#define SCSIOP_WRITE_DATA_BUFF 0x3B -#define SCSIOP_READ_DATA_BUFF 0x3C -#define SCSIOP_WRITE_LONG 0x3F -#define SCSIOP_CHANGE_DEFINITION 0x40 -#define SCSIOP_WRITE_SAME 0x41 -#define SCSIOP_READ_SUB_CHANNEL 0x42 -#define SCSIOP_READ_TOC 0x43 -#define SCSIOP_READ_HEADER 0x44 -#define SCSIOP_REPORT_DENSITY_SUPPORT 0x44 // tape -#define SCSIOP_PLAY_AUDIO 0x45 -#define SCSIOP_GET_CONFIGURATION 0x46 -#define SCSIOP_PLAY_AUDIO_MSF 0x47 -#define SCSIOP_PLAY_TRACK_INDEX 0x48 -#define SCSIOP_PLAY_TRACK_RELATIVE 0x49 -#define SCSIOP_GET_EVENT_STATUS 0x4A -#define SCSIOP_PAUSE_RESUME 0x4B -#define SCSIOP_LOG_SELECT 0x4C -#define SCSIOP_LOG_SENSE 0x4D -#define SCSIOP_STOP_PLAY_SCAN 0x4E -#define SCSIOP_XDWRITE 0x50 -#define SCSIOP_XPWRITE 0x51 -#define SCSIOP_READ_DISK_INFORMATION 0x51 -#define SCSIOP_READ_DISC_INFORMATION 0x51 // proper use of disc over disk -#define SCSIOP_READ_TRACK_INFORMATION 0x52 -#define SCSIOP_XDWRITE_READ 0x53 -#define SCSIOP_RESERVE_TRACK_RZONE 0x53 -#define SCSIOP_SEND_OPC_INFORMATION 0x54 // optimum power calibration -#define SCSIOP_MODE_SELECT10 0x55 -#define SCSIOP_RESERVE_UNIT10 0x56 -#define SCSIOP_RESERVE_ELEMENT 0x56 -#define SCSIOP_RELEASE_UNIT10 0x57 -#define SCSIOP_RELEASE_ELEMENT 0x57 -#define SCSIOP_REPAIR_TRACK 0x58 -#define SCSIOP_MODE_SENSE10 0x5A -#define SCSIOP_CLOSE_TRACK_SESSION 0x5B -#define SCSIOP_READ_BUFFER_CAPACITY 0x5C -#define SCSIOP_SEND_CUE_SHEET 0x5D -#define SCSIOP_PERSISTENT_RESERVE_IN 0x5E -#define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F - -// 12-byte commands -#define SCSIOP_REPORT_LUNS 0xA0 -#define SCSIOP_BLANK 0xA1 -#define SCSIOP_ATA_PASSTHROUGH12 0xA1 -#define SCSIOP_SEND_EVENT 0xA2 -#define SCSIOP_SEND_KEY 0xA3 -#define SCSIOP_MAINTENANCE_IN 0xA3 -#define SCSIOP_REPORT_KEY 0xA4 -#define SCSIOP_MAINTENANCE_OUT 0xA4 -#define SCSIOP_MOVE_MEDIUM 0xA5 -#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6 -#define SCSIOP_EXCHANGE_MEDIUM 0xA6 -#define SCSIOP_SET_READ_AHEAD 0xA7 -#define SCSIOP_MOVE_MEDIUM_ATTACHED 0xA7 -#define SCSIOP_READ12 0xA8 -#define SCSIOP_GET_MESSAGE 0xA8 -#define SCSIOP_SERVICE_ACTION_OUT12 0xA9 -#define SCSIOP_WRITE12 0xAA -#define SCSIOP_SEND_MESSAGE 0xAB -#define SCSIOP_SERVICE_ACTION_IN12 0xAB -#define SCSIOP_GET_PERFORMANCE 0xAC -#define SCSIOP_READ_DVD_STRUCTURE 0xAD -#define SCSIOP_WRITE_VERIFY12 0xAE -#define SCSIOP_VERIFY12 0xAF -#define SCSIOP_SEARCH_DATA_HIGH12 0xB0 -#define SCSIOP_SEARCH_DATA_EQUAL12 0xB1 -#define SCSIOP_SEARCH_DATA_LOW12 0xB2 -#define SCSIOP_SET_LIMITS12 0xB3 -#define SCSIOP_READ_ELEMENT_STATUS_ATTACHED 0xB4 -#define SCSIOP_REQUEST_VOL_ELEMENT 0xB5 -#define SCSIOP_SEND_VOLUME_TAG 0xB6 -#define SCSIOP_SET_STREAMING 0xB6 // C/DVD -#define SCSIOP_READ_DEFECT_DATA 0xB7 -#define SCSIOP_READ_ELEMENT_STATUS 0xB8 -#define SCSIOP_READ_CD_MSF 0xB9 -#define SCSIOP_SCAN_CD 0xBA -#define SCSIOP_REDUNDANCY_GROUP_IN 0xBA -#define SCSIOP_SET_CD_SPEED 0xBB -#define SCSIOP_REDUNDANCY_GROUP_OUT 0xBB -#define SCSIOP_PLAY_CD 0xBC -#define SCSIOP_SPARE_IN 0xBC -#define SCSIOP_MECHANISM_STATUS 0xBD -#define SCSIOP_SPARE_OUT 0xBD -#define SCSIOP_READ_CD 0xBE -#define SCSIOP_VOLUME_SET_IN 0xBE -#define SCSIOP_SEND_DVD_STRUCTURE 0xBF -#define SCSIOP_VOLUME_SET_OUT 0xBF -#define SCSIOP_INIT_ELEMENT_RANGE 0xE7 - -// 16-byte commands -#define SCSIOP_XDWRITE_EXTENDED16 0x80 // disk -#define SCSIOP_WRITE_FILEMARKS16 0x80 // tape -#define SCSIOP_REBUILD16 0x81 // disk -#define SCSIOP_READ_REVERSE16 0x81 // tape -#define SCSIOP_REGENERATE16 0x82 // disk -#define SCSIOP_EXTENDED_COPY 0x83 -#define SCSIOP_RECEIVE_COPY_RESULTS 0x84 -#define SCSIOP_ATA_PASSTHROUGH16 0x85 -#define SCSIOP_ACCESS_CONTROL_IN 0x86 -#define SCSIOP_ACCESS_CONTROL_OUT 0x87 -#define SCSIOP_READ16 0x88 -#define SCSIOP_WRITE16 0x8A -#define SCSIOP_READ_ATTRIBUTES 0x8C -#define SCSIOP_WRITE_ATTRIBUTES 0x8D -#define SCSIOP_WRITE_VERIFY16 0x8E -#define SCSIOP_VERIFY16 0x8F -#define SCSIOP_PREFETCH16 0x90 -#define SCSIOP_SYNCHRONIZE_CACHE16 0x91 -#define SCSIOP_SPACE16 0x91 // tape -#define SCSIOP_LOCK_UNLOCK_CACHE16 0x92 -#define SCSIOP_LOCATE16 0x92 // tape -#define SCSIOP_WRITE_SAME16 0x93 -#define SCSIOP_ERASE16 0x93 // tape -#define SCSIOP_READ_CAPACITY16 0x9E -#define SCSIOP_SERVICE_ACTION_IN16 0x9E -#define SCSIOP_SERVICE_ACTION_OUT16 0x9F - - -// -// If the IMMED bit is 1, status is returned as soon -// as the operation is initiated. If the IMMED bit -// is 0, status is not returned until the operation -// is completed. -// - -#define CDB_RETURN_ON_COMPLETION 0 -#define CDB_RETURN_IMMEDIATE 1 - - -// -// Inquiry buffer structure. This is the data returned from the target -// after it receives an inquiry. -// -// This structure may be extended by the number of bytes specified -// in the field AdditionalLength. The defined size constant only -// includes fields through ProductRevisionLevel. -// -// The NT SCSI drivers are only interested in the first 36 bytes of data. -// - -#define INQUIRYDATABUFFERSIZE 36 - -#if (NTDDI_VERSION < NTDDI_WINXP) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - UCHAR Versions; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR ReservedBit : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved[2]; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR Reserved2 : 1; - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; - UCHAR Wide16Bit : 1; - UCHAR Wide32Bit : 1; - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#else -#pragma pack(push, inquiry, 1) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - union { - UCHAR Versions; - struct { - UCHAR ANSIVersion : 3; - UCHAR ECMAVersion : 3; - UCHAR ISOVersion : 2; - }; - }; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR TerminateTask : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved; - UCHAR Addr16 : 1; // defined only for SIP devices. - UCHAR Addr32 : 1; // defined only for SIP devices. - UCHAR AckReqQ: 1; // defined only for SIP devices. - UCHAR MediumChanger : 1; - UCHAR MultiPort : 1; - UCHAR ReservedBit2 : 1; - UCHAR EnclosureServices : 1; - UCHAR ReservedBit3 : 1; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR TransferDisable : 1; // defined only for SIP devices. - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; // defined only for SIP devices. - UCHAR Wide16Bit : 1; // defined only for SIP devices. - UCHAR Wide32Bit : 1; // defined only for SIP devices. - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#pragma pack(pop, inquiry) -#endif - -// -// Inquiry defines. Used to interpret data returned from target as result -// of inquiry command. -// -// DeviceType field -// - -#define DIRECT_ACCESS_DEVICE 0x00 // disks -#define SEQUENTIAL_ACCESS_DEVICE 0x01 // tapes -#define PRINTER_DEVICE 0x02 // printers -#define PROCESSOR_DEVICE 0x03 // scanners, printers, etc -#define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04 // worms -#define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05 // cdroms -#define SCANNER_DEVICE 0x06 // scanners -#define OPTICAL_DEVICE 0x07 // optical disks -#define MEDIUM_CHANGER 0x08 // jukebox -#define COMMUNICATION_DEVICE 0x09 // network -// 0xA and 0xB are obsolete -#define ARRAY_CONTROLLER_DEVICE 0x0C -#define SCSI_ENCLOSURE_DEVICE 0x0D -#define REDUCED_BLOCK_DEVICE 0x0E // e.g., 1394 disk -#define OPTICAL_CARD_READER_WRITER_DEVICE 0x0F -#define BRIDGE_CONTROLLER_DEVICE 0x10 -#define OBJECT_BASED_STORAGE_DEVICE 0x11 // OSD -#define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F - -#define DEVICE_QUALIFIER_ACTIVE 0x00 -#define DEVICE_QUALIFIER_NOT_ACTIVE 0x01 -#define DEVICE_QUALIFIER_NOT_SUPPORTED 0x03 - -// -// DeviceTypeQualifier field -// - -#define DEVICE_CONNECTED 0x00 - -// -// Vital Product Data Pages -// - -// -// Unit Serial Number Page (page code 0x80) -// -// Provides a product serial number for the target or the logical unit. -// -#pragma pack(push, vpd_media_sn, 1) -typedef struct _VPD_MEDIA_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_MEDIA_SERIAL_NUMBER_PAGE, *PVPD_MEDIA_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_media_sn) - -#pragma pack(push, vpd_sn, 1) -typedef struct _VPD_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_SERIAL_NUMBER_PAGE, *PVPD_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_sn) - -// -// Device Identification Page (page code 0x83) -// Provides the means to retrieve zero or more identification descriptors -// applying to the logical unit. -// - -#pragma pack(push, vpd_stuff, 1) -typedef enum _VPD_CODE_SET { - VpdCodeSetReserved = 0, - VpdCodeSetBinary = 1, - VpdCodeSetAscii = 2, - VpdCodeSetUTF8 = 3 -} VPD_CODE_SET, *PVPD_CODE_SET; - -typedef enum _VPD_ASSOCIATION { - VpdAssocDevice = 0, - VpdAssocPort = 1, - VpdAssocTarget = 2, - VpdAssocReserved1 = 3, - VpdAssocReserved2 = 4 // bogus, only two bits -} VPD_ASSOCIATION, *PVPD_ASSOCIATION; - -typedef enum _VPD_IDENTIFIER_TYPE { - VpdIdentifierTypeVendorSpecific = 0, - VpdIdentifierTypeVendorId = 1, - VpdIdentifierTypeEUI64 = 2, - VpdIdentifierTypeFCPHName = 3, - VpdIdentifierTypePortRelative = 4, - VpdIdentifierTypeTargetPortGroup = 5, - VpdIdentifierTypeLogicalUnitGroup = 6, - VpdIdentifierTypeMD5LogicalUnitId = 7, - VpdIdentifierTypeSCSINameString = 8 -} VPD_IDENTIFIER_TYPE, *PVPD_IDENTIFIER_TYPE; - -typedef struct _VPD_IDENTIFICATION_DESCRIPTOR { - UCHAR CodeSet : 4; // VPD_CODE_SET - UCHAR Reserved : 4; - UCHAR IdentifierType : 4; // VPD_IDENTIFIER_TYPE - UCHAR Association : 2; - UCHAR Reserved2 : 2; - UCHAR Reserved3; - UCHAR IdentifierLength; -#if !defined(__midl) - UCHAR Identifier[0]; -#endif -} VPD_IDENTIFICATION_DESCRIPTOR, *PVPD_IDENTIFICATION_DESCRIPTOR; - -typedef struct _VPD_IDENTIFICATION_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; - - - // - // The following field is actually a variable length array of identification - // descriptors. Unfortunately there's no C notation for an array of - // variable length structures so we're forced to just pretend. - // - -#if !defined(__midl) - // VPD_IDENTIFICATION_DESCRIPTOR Descriptors[0]; - UCHAR Descriptors[0]; -#endif -} VPD_IDENTIFICATION_PAGE, *PVPD_IDENTIFICATION_PAGE; - -// -// Supported Vital Product Data Pages Page (page code 0x00) -// Contains a list of the vital product data page cods supported by the target -// or logical unit. -// - -typedef struct _VPD_SUPPORTED_PAGES_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SupportedPageList[0]; -#endif -} VPD_SUPPORTED_PAGES_PAGE, *PVPD_SUPPORTED_PAGES_PAGE; -#pragma pack(pop, vpd_stuff) - - -#define VPD_MAX_BUFFER_SIZE 0xff - -#define VPD_SUPPORTED_PAGES 0x00 -#define VPD_SERIAL_NUMBER 0x80 -#define VPD_DEVICE_IDENTIFIERS 0x83 -#define VPD_MEDIA_SERIAL_NUMBER 0x84 -#define VPD_SOFTWARE_INTERFACE_IDENTIFIERS 0x84 -#define VPD_NETWORK_MANAGEMENT_ADDRESSES 0x85 -#define VPD_EXTENDED_INQUIRY_DATA 0x86 -#define VPD_MODE_PAGE_POLICY 0x87 -#define VPD_SCSI_PORTS 0x88 - - -// -// Persistent Reservation Definitions. -// - -// -// PERSISTENT_RESERVE_* definitions -// - -#define RESERVATION_ACTION_READ_KEYS 0x00 -#define RESERVATION_ACTION_READ_RESERVATIONS 0x01 - -#define RESERVATION_ACTION_REGISTER 0x00 -#define RESERVATION_ACTION_RESERVE 0x01 -#define RESERVATION_ACTION_RELEASE 0x02 -#define RESERVATION_ACTION_CLEAR 0x03 -#define RESERVATION_ACTION_PREEMPT 0x04 -#define RESERVATION_ACTION_PREEMPT_ABORT 0x05 -#define RESERVATION_ACTION_REGISTER_IGNORE_EXISTING 0x06 - -#define RESERVATION_SCOPE_LU 0x00 -#define RESERVATION_SCOPE_ELEMENT 0x02 - -#define RESERVATION_TYPE_WRITE_EXCLUSIVE 0x01 -#define RESERVATION_TYPE_EXCLUSIVE 0x03 -#define RESERVATION_TYPE_WRITE_EXCLUSIVE_REGISTRANTS 0x05 -#define RESERVATION_TYPE_EXCLUSIVE_REGISTRANTS 0x06 - -// -// Structures for reserve in command. -// - -#pragma pack(push, reserve_in_stuff, 1) -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - UCHAR ReservationKeyList[0][8]; -#endif -} PRI_REGISTRATION_LIST, *PPRI_REGISTRATION_LIST; - -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR Reserved; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Obsolete[2]; -} PRI_RESERVATION_DESCRIPTOR, *PPRI_RESERVATION_DESCRIPTOR; - -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - PRI_RESERVATION_DESCRIPTOR Reservations[0]; -#endif -} PRI_RESERVATION_LIST, *PPRI_RESERVATION_LIST; -#pragma pack(pop, reserve_in_stuff) - -// -// Structures for reserve out command. -// - -#pragma pack(push, reserve_out_stuff, 1) -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ServiceActionReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR ActivatePersistThroughPowerLoss : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2; - UCHAR Obsolete[2]; -} PRO_PARAMETER_LIST, *PPRO_PARAMETER_LIST; -#pragma pack(pop, reserve_out_stuff) - - -// -// Sense Data Format -// - -#pragma pack(push, sensedata, 1) -typedef struct _SENSE_DATA { - UCHAR ErrorCode:7; - UCHAR Valid:1; - UCHAR SegmentNumber; - UCHAR SenseKey:4; - UCHAR Reserved:1; - UCHAR IncorrectLength:1; - UCHAR EndOfMedia:1; - UCHAR FileMark:1; - UCHAR Information[4]; - UCHAR AdditionalSenseLength; - UCHAR CommandSpecificInformation[4]; - UCHAR AdditionalSenseCode; - UCHAR AdditionalSenseCodeQualifier; - UCHAR FieldReplaceableUnitCode; - UCHAR SenseKeySpecific[3]; -} SENSE_DATA, *PSENSE_DATA; -#pragma pack(pop, sensedata) - -// -// Default request sense buffer size -// - -#define SENSE_BUFFER_SIZE 18 - -// -// Maximum request sense buffer size -// - -#define MAX_SENSE_BUFFER_SIZE 255 - -// -// Maximum number of additional sense bytes. -// - -#define MAX_ADDITIONAL_SENSE_BYTES (MAX_SENSE_BUFFER_SIZE - SENSE_BUFFER_SIZE) - -// -// Sense codes -// - -#define SCSI_SENSE_NO_SENSE 0x00 -#define SCSI_SENSE_RECOVERED_ERROR 0x01 -#define SCSI_SENSE_NOT_READY 0x02 -#define SCSI_SENSE_MEDIUM_ERROR 0x03 -#define SCSI_SENSE_HARDWARE_ERROR 0x04 -#define SCSI_SENSE_ILLEGAL_REQUEST 0x05 -#define SCSI_SENSE_UNIT_ATTENTION 0x06 -#define SCSI_SENSE_DATA_PROTECT 0x07 -#define SCSI_SENSE_BLANK_CHECK 0x08 -#define SCSI_SENSE_UNIQUE 0x09 -#define SCSI_SENSE_COPY_ABORTED 0x0A -#define SCSI_SENSE_ABORTED_COMMAND 0x0B -#define SCSI_SENSE_EQUAL 0x0C -#define SCSI_SENSE_VOL_OVERFLOW 0x0D -#define SCSI_SENSE_MISCOMPARE 0x0E -#define SCSI_SENSE_RESERVED 0x0F - -// -// Additional tape bit -// - -#define SCSI_ILLEGAL_LENGTH 0x20 -#define SCSI_EOM 0x40 -#define SCSI_FILE_MARK 0x80 - -// -// Additional Sense codes -// - -#define SCSI_ADSENSE_NO_SENSE 0x00 -#define SCSI_ADSENSE_NO_SEEK_COMPLETE 0x02 -#define SCSI_ADSENSE_LUN_NOT_READY 0x04 -#define SCSI_ADSENSE_LUN_COMMUNICATION 0x08 -#define SCSI_ADSENSE_WRITE_ERROR 0x0C -#define SCSI_ADSENSE_TRACK_ERROR 0x14 -#define SCSI_ADSENSE_SEEK_ERROR 0x15 -#define SCSI_ADSENSE_REC_DATA_NOECC 0x17 -#define SCSI_ADSENSE_REC_DATA_ECC 0x18 -#define SCSI_ADSENSE_PARAMETER_LIST_LENGTH 0x1A -#define SCSI_ADSENSE_ILLEGAL_COMMAND 0x20 -#define SCSI_ADSENSE_ILLEGAL_BLOCK 0x21 -#define SCSI_ADSENSE_INVALID_CDB 0x24 -#define SCSI_ADSENSE_INVALID_LUN 0x25 -#define SCSI_ADSENSE_INVALID_FIELD_PARAMETER_LIST 0x26 -#define SCSI_ADSENSE_WRITE_PROTECT 0x27 -#define SCSI_ADSENSE_MEDIUM_CHANGED 0x28 -#define SCSI_ADSENSE_BUS_RESET 0x29 -#define SCSI_ADSENSE_PARAMETERS_CHANGED 0x2A -#define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION 0x2E -#define SCSI_ADSENSE_INVALID_MEDIA 0x30 -#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE 0x3a -#define SCSI_ADSENSE_POSITION_ERROR 0x3b -#define SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED 0x3f -#define SCSI_ADSENSE_OPERATOR_REQUEST 0x5a // see below -#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED 0x5d -#define SCSI_ADSENSE_ILLEGAL_MODE_FOR_THIS_TRACK 0x64 -#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE 0x6f -#define SCSI_ADSENSE_POWER_CALIBRATION_ERROR 0x73 -#define SCSI_ADSENSE_VENDOR_UNIQUE 0x80 // and higher -#define SCSI_ADSENSE_MUSIC_AREA 0xA0 -#define SCSI_ADSENSE_DATA_AREA 0xA1 -#define SCSI_ADSENSE_VOLUME_OVERFLOW 0xA7 - -// for legacy apps: -#define SCSI_ADWRITE_PROTECT SCSI_ADSENSE_WRITE_PROTECT -#define SCSI_FAILURE_PREDICTION_THRESHOLD_EXCEEDED SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED - - -// -// SCSI_ADSENSE_LUN_NOT_READY (0x04) qualifiers -// - -#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE 0x00 -#define SCSI_SENSEQ_BECOMING_READY 0x01 -#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED 0x02 -#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED 0x03 -#define SCSI_SENSEQ_FORMAT_IN_PROGRESS 0x04 -#define SCSI_SENSEQ_REBUILD_IN_PROGRESS 0x05 -#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS 0x06 -#define SCSI_SENSEQ_OPERATION_IN_PROGRESS 0x07 -#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS 0x08 - -// -// SCSI_ADSENSE_LUN_COMMUNICATION (0x08) qualifiers -// - -#define SCSI_SENSEQ_COMM_FAILURE 0x00 -#define SCSI_SENSEQ_COMM_TIMEOUT 0x01 -#define SCSI_SENSEQ_COMM_PARITY_ERROR 0x02 -#define SCSI_SESNEQ_COMM_CRC_ERROR 0x03 -#define SCSI_SENSEQ_UNREACHABLE_TARGET 0x04 - -// -// SCSI_ADSENSE_WRITE_ERROR (0x0C) qualifiers -// -#define SCSI_SENSEQ_LOSS_OF_STREAMING 0x09 -#define SCSI_SENSEQ_PADDING_BLOCKS_ADDED 0x0A - - -// -// SCSI_ADSENSE_NO_SENSE (0x00) qualifiers -// - -#define SCSI_SENSEQ_FILEMARK_DETECTED 0x01 -#define SCSI_SENSEQ_END_OF_MEDIA_DETECTED 0x02 -#define SCSI_SENSEQ_SETMARK_DETECTED 0x03 -#define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED 0x04 - -// -// SCSI_ADSENSE_ILLEGAL_BLOCK (0x21) qualifiers -// - -#define SCSI_SENSEQ_ILLEGAL_ELEMENT_ADDR 0x01 - -// -// SCSI_ADSENSE_POSITION_ERROR (0x3b) qualifiers -// - -#define SCSI_SENSEQ_DESTINATION_FULL 0x0d -#define SCSI_SENSEQ_SOURCE_EMPTY 0x0e - -// -// SCSI_ADSENSE_INVALID_MEDIA (0x30) qualifiers -// - -#define SCSI_SENSEQ_INCOMPATIBLE_MEDIA_INSTALLED 0x00 -#define SCSI_SENSEQ_UNKNOWN_FORMAT 0x01 -#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT 0x02 -#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED 0x03 - - -// -// SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED (0x3f) qualifiers -// - -#define SCSI_SENSEQ_TARGET_OPERATING_CONDITIONS_CHANGED 0x00 -#define SCSI_SENSEQ_MICROCODE_CHANGED 0x01 -#define SCSI_SENSEQ_OPERATING_DEFINITION_CHANGED 0x02 -#define SCSI_SENSEQ_INQUIRY_DATA_CHANGED 0x03 -#define SCSI_SENSEQ_COMPONENT_DEVICE_ATTACHED 0x04 -#define SCSI_SENSEQ_DEVICE_IDENTIFIER_CHANGED 0x05 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_MODIFIED 0x06 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_DELETED 0x07 -#define SCSI_SENSEQ_SPARE_MODIFIED 0x08 -#define SCSI_SENSEQ_SPARE_DELETED 0x09 -#define SCSI_SENSEQ_VOLUME_SET_MODIFIED 0x0A -#define SCSI_SENSEQ_VOLUME_SET_DELETED 0x0B -#define SCSI_SENSEQ_VOLUME_SET_DEASSIGNED 0x0C -#define SCSI_SENSEQ_VOLUME_SET_REASSIGNED 0x0D -#define SCSI_SENSEQ_REPORTED_LUNS_DATA_CHANGED 0x0E -#define SCSI_SENSEQ_ECHO_BUFFER_OVERWRITTEN 0x0F -#define SCSI_SENSEQ_MEDIUM_LOADABLE 0x10 -#define SCSI_SENSEQ_MEDIUM_AUXILIARY_MEMORY_ACCESSIBLE 0x11 - - -// -// SCSI_ADSENSE_OPERATOR_REQUEST (0x5a) qualifiers -// - -#define SCSI_SENSEQ_STATE_CHANGE_INPUT 0x00 // generic request -#define SCSI_SENSEQ_MEDIUM_REMOVAL 0x01 -#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE 0x02 -#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE 0x03 - -// -// SCSI_ADSENSE_COPY_PROTECTION_FAILURE (0x6f) qualifiers -// -#define SCSI_SENSEQ_AUTHENTICATION_FAILURE 0x00 -#define SCSI_SENSEQ_KEY_NOT_PRESENT 0x01 -#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED 0x02 -#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION 0x03 -#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT 0x04 -#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR 0x05 - -// -// SCSI_ADSENSE_POWER_CALIBRATION_ERROR (0x73) qualifiers -// - -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ALMOST_FULL 0x01 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_FULL 0x02 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ERROR 0x03 -#define SCSI_SENSEQ_PMA_RMA_UPDATE_FAILURE 0x04 -#define SCSI_SENSEQ_PMA_RMA_IS_FULL 0x05 -#define SCSI_SENSEQ_PMA_RMA_ALMOST_FULL 0x06 - - - -// -// Read Capacity Data - returned in Big Endian format -// - -#pragma pack(push, read_capacity, 1) -typedef struct _READ_CAPACITY_DATA { - ULONG LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA; -#pragma pack(pop, read_capacity) - - -#pragma pack(push, read_capacity_ex, 1) -typedef struct _READ_CAPACITY_DATA_EX { - LARGE_INTEGER LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA_EX, *PREAD_CAPACITY_DATA_EX; -#pragma pack(pop, read_capacity_ex) - - -// -// Read Block Limits Data - returned in Big Endian format -// This structure returns the maximum and minimum block -// size for a TAPE device. -// - -#pragma pack(push, read_block_limits, 1) -typedef struct _READ_BLOCK_LIMITS { - UCHAR Reserved; - UCHAR BlockMaximumSize[3]; - UCHAR BlockMinimumSize[2]; -} READ_BLOCK_LIMITS_DATA, *PREAD_BLOCK_LIMITS_DATA; -#pragma pack(pop, read_block_limits) - -#pragma pack(push, read_buffer_capacity, 1) -typedef struct _READ_BUFFER_CAPACITY_DATA { - UCHAR DataLength[2]; - UCHAR Reserved1; - UCHAR BlockDataReturned : 1; - UCHAR Reserved4 : 7; - UCHAR TotalBufferSize[4]; - UCHAR AvailableBufferSize[4]; -} READ_BUFFER_CAPACITY_DATA, *PREAD_BUFFER_CAPACITY_DATA; -#pragma pack(pop, read_buffer_capacity) - -// -// Mode data structures. -// - -// -// Define Mode parameter header. -// - -#pragma pack(push, mode_params, 1) -typedef struct _MODE_PARAMETER_HEADER { - UCHAR ModeDataLength; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR BlockDescriptorLength; -}MODE_PARAMETER_HEADER, *PMODE_PARAMETER_HEADER; - -typedef struct _MODE_PARAMETER_HEADER10 { - UCHAR ModeDataLength[2]; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR Reserved[2]; - UCHAR BlockDescriptorLength[2]; -}MODE_PARAMETER_HEADER10, *PMODE_PARAMETER_HEADER10; -#pragma pack(pop, mode_params) - -#define MODE_FD_SINGLE_SIDE 0x01 -#define MODE_FD_DOUBLE_SIDE 0x02 -#define MODE_FD_MAXIMUM_TYPE 0x1E -#define MODE_DSP_FUA_SUPPORTED 0x10 -#define MODE_DSP_WRITE_PROTECT 0x80 - -// -// Define the mode parameter block. -// - -#pragma pack(push, mode_params_block, 1) -typedef struct _MODE_PARAMETER_BLOCK { - UCHAR DensityCode; - UCHAR NumberOfBlocks[3]; - UCHAR Reserved; - UCHAR BlockLength[3]; -}MODE_PARAMETER_BLOCK, *PMODE_PARAMETER_BLOCK; -#pragma pack(pop, mode_params_block) - -// -// Define Disconnect-Reconnect page. -// - - -#pragma pack(push, mode_page_disconnect, 1) -typedef struct _MODE_DISCONNECT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR BufferFullRatio; - UCHAR BufferEmptyRatio; - UCHAR BusInactivityLimit[2]; - UCHAR BusDisconnectTime[2]; - UCHAR BusConnectTime[2]; - UCHAR MaximumBurstSize[2]; - UCHAR DataTransferDisconnect : 2; - UCHAR Reserved2[3]; -}MODE_DISCONNECT_PAGE, *PMODE_DISCONNECT_PAGE; -#pragma pack(pop, mode_page_disconnect) - -// -// Define mode caching page. -// - -#pragma pack(push, mode_page_caching, 1) -typedef struct _MODE_CACHING_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR ReadDisableCache : 1; - UCHAR MultiplicationFactor : 1; - UCHAR WriteCacheEnable : 1; - UCHAR Reserved2 : 5; - UCHAR WriteRetensionPriority : 4; - UCHAR ReadRetensionPriority : 4; - UCHAR DisablePrefetchTransfer[2]; - UCHAR MinimumPrefetch[2]; - UCHAR MaximumPrefetch[2]; - UCHAR MaximumPrefetchCeiling[2]; -}MODE_CACHING_PAGE, *PMODE_CACHING_PAGE; -#pragma pack(pop, mode_page_caching) - -// -// Define write parameters cdrom page -// -#pragma pack(push, mode_page_wp2, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE2 { - UCHAR PageCode : 6; // 0x05 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR MediaCatalogNumber[16]; - UCHAR ISRC[16]; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE2, *PMODE_CDROM_WRITE_PARAMETERS_PAGE2; -#pragma pack(pop, mode_page_wp2) - -#ifndef DEPRECATE_DDK_FUNCTIONS -// this structure is being retired due to missing fields and overly -// complex data definitions for the MCN and ISRC. -#pragma pack(push, mode_page_wp, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE { - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR Reserved7 : 7; - UCHAR MediaCatalogNumberValid : 1; - UCHAR MediaCatalogNumber[13]; - UCHAR MediaCatalogNumberZero; - UCHAR MediaCatalogNumberAFrame; - UCHAR Reserved8 : 7; - UCHAR ISRCValid : 1; - UCHAR ISRCCountry[2]; - UCHAR ISRCOwner[3]; - UCHAR ISRCRecordingYear[2]; - UCHAR ISRCSerialNumber[5]; - UCHAR ISRCZero; - UCHAR ISRCAFrame; - UCHAR ISRCReserved; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE, *PMODE_CDROM_WRITE_PARAMETERS_PAGE; -#pragma pack(pop, mode_page_wp) -#endif //ifndef DEPRECATE_DDK_FUNCTIONS - -// -// Define the MRW mode page for CDROM device types -// -#pragma pack(push, mode_page_mrw, 1) -typedef struct _MODE_MRW_PAGE { - UCHAR PageCode : 6; // 0x03 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; //0x06 - UCHAR Reserved1; - UCHAR LbaSpace : 1; - UCHAR Reserved2 : 7; - UCHAR Reserved3[4]; -} MODE_MRW_PAGE, *PMODE_MRW_PAGE; -#pragma pack(pop, mode_page_mrw) - -// -// Define mode flexible disk page. -// - -#pragma pack(push, mode_page_flex, 1) -typedef struct _MODE_FLEXIBLE_DISK_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TransferRate[2]; - UCHAR NumberOfHeads; - UCHAR SectorsPerTrack; - UCHAR BytesPerSector[2]; - UCHAR NumberOfCylinders[2]; - UCHAR StartWritePrecom[2]; - UCHAR StartReducedCurrent[2]; - UCHAR StepRate[2]; - UCHAR StepPluseWidth; - UCHAR HeadSettleDelay[2]; - UCHAR MotorOnDelay; - UCHAR MotorOffDelay; - UCHAR Reserved2 : 5; - UCHAR MotorOnAsserted : 1; - UCHAR StartSectorNumber : 1; - UCHAR TrueReadySignal : 1; - UCHAR StepPlusePerCyclynder : 4; - UCHAR Reserved3 : 4; - UCHAR WriteCompenstation; - UCHAR HeadLoadDelay; - UCHAR HeadUnloadDelay; - UCHAR Pin2Usage : 4; - UCHAR Pin34Usage : 4; - UCHAR Pin1Usage : 4; - UCHAR Pin4Usage : 4; - UCHAR MediumRotationRate[2]; - UCHAR Reserved4[2]; -} MODE_FLEXIBLE_DISK_PAGE, *PMODE_FLEXIBLE_DISK_PAGE; -#pragma pack(pop, mode_page_flex) - -// -// Define mode format page. -// - -#pragma pack(push, mode_page_format, 1) -typedef struct _MODE_FORMAT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TracksPerZone[2]; - UCHAR AlternateSectorsPerZone[2]; - UCHAR AlternateTracksPerZone[2]; - UCHAR AlternateTracksPerLogicalUnit[2]; - UCHAR SectorsPerTrack[2]; - UCHAR BytesPerPhysicalSector[2]; - UCHAR Interleave[2]; - UCHAR TrackSkewFactor[2]; - UCHAR CylinderSkewFactor[2]; - UCHAR Reserved2 : 4; - UCHAR SurfaceFirst : 1; - UCHAR RemovableMedia : 1; - UCHAR HardSectorFormating : 1; - UCHAR SoftSectorFormating : 1; - UCHAR Reserved3[3]; -} MODE_FORMAT_PAGE, *PMODE_FORMAT_PAGE; -#pragma pack(pop, mode_page_format) - -// -// Define rigid disk driver geometry page. -// - -#pragma pack(push, mode_page_geometry, 1) -typedef struct _MODE_RIGID_GEOMETRY_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR NumberOfCylinders[3]; - UCHAR NumberOfHeads; - UCHAR StartWritePrecom[3]; - UCHAR StartReducedCurrent[3]; - UCHAR DriveStepRate[2]; - UCHAR LandZoneCyclinder[3]; - UCHAR RotationalPositionLock : 2; - UCHAR Reserved2 : 6; - UCHAR RotationOffset; - UCHAR Reserved3; - UCHAR RoataionRate[2]; - UCHAR Reserved4[2]; -}MODE_RIGID_GEOMETRY_PAGE, *PMODE_RIGID_GEOMETRY_PAGE; -#pragma pack(pop, mode_page_geometry) - -// -// Define read write recovery page -// - -#pragma pack(push, mode_page_rw_recovery, 1) -typedef struct _MODE_READ_WRITE_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR EERBit : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR ARRE : 1; - UCHAR AWRE : 1; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - UCHAR WriteRetryCount; - UCHAR Reserved5[3]; - -} MODE_READ_WRITE_RECOVERY_PAGE, *PMODE_READ_WRITE_RECOVERY_PAGE; -#pragma pack(pop, mode_page_rw_recovery) - -// -// Define read recovery page - cdrom -// - -#pragma pack(push, mode_page_r_recovery, 1) -typedef struct _MODE_READ_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR Reserved2 : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR Reserved3 : 2; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - -} MODE_READ_RECOVERY_PAGE, *PMODE_READ_RECOVERY_PAGE; -#pragma pack(pop, mode_page_r_recovery) - - -// -// Define Informational Exception Control Page. Used for failure prediction -// - -#pragma pack(push, mode_page_xcpt, 1) -typedef struct _MODE_INFO_EXCEPTIONS -{ - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; - - union - { - UCHAR Flags; - struct - { - UCHAR LogErr : 1; - UCHAR Reserved2 : 1; - UCHAR Test : 1; - UCHAR Dexcpt : 1; - UCHAR Reserved3 : 3; - UCHAR Perf : 1; - }; - }; - - UCHAR ReportMethod : 4; - UCHAR Reserved4 : 4; - - UCHAR IntervalTimer[4]; - UCHAR ReportCount[4]; - -} MODE_INFO_EXCEPTIONS, *PMODE_INFO_EXCEPTIONS; -#pragma pack(pop, mode_page_xcpt) - -// -// Begin C/DVD 0.9 definitions -// - -// -// Power Condition Mode Page Format -// - -#pragma pack(push, mode_page_power, 1) -typedef struct _POWER_CONDITION_PAGE { - UCHAR PageCode : 6; // 0x1A - UCHAR Reserved : 1; - UCHAR PSBit : 1; - UCHAR PageLength; // 0x0A - UCHAR Reserved2; - - UCHAR Standby : 1; - UCHAR Idle : 1; - UCHAR Reserved3 : 6; - - UCHAR IdleTimer[4]; - UCHAR StandbyTimer[4]; -} POWER_CONDITION_PAGE, *PPOWER_CONDITION_PAGE; -#pragma pack(pop, mode_page_power) - -// -// CD-Audio Control Mode Page Format -// - -#pragma pack(push, mode_page_cdaudio, 1) -typedef struct _CDDA_OUTPUT_PORT { - UCHAR ChannelSelection : 4; - UCHAR Reserved : 4; - UCHAR Volume; -} CDDA_OUTPUT_PORT, *PCDDA_OUTPUT_PORT; - -typedef struct _CDAUDIO_CONTROL_PAGE { - UCHAR PageCode : 6; // 0x0E - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x0E - - UCHAR Reserved2 : 1; - UCHAR StopOnTrackCrossing : 1; // Default 0 - UCHAR Immediate : 1; // Always 1 - UCHAR Reserved3 : 5; - - UCHAR Reserved4[3]; - UCHAR Obsolete[2]; - - CDDA_OUTPUT_PORT CDDAOutputPorts[4]; - -} CDAUDIO_CONTROL_PAGE, *PCDAUDIO_CONTROL_PAGE; -#pragma pack(pop, mode_page_cdaudio) - -#define CDDA_CHANNEL_MUTED 0x0 -#define CDDA_CHANNEL_ZERO 0x1 -#define CDDA_CHANNEL_ONE 0x2 -#define CDDA_CHANNEL_TWO 0x4 -#define CDDA_CHANNEL_THREE 0x8 - -// -// C/DVD Feature Set Support & Version Page -// - -#pragma pack(push, mode_page_features, 1) -typedef struct _CDVD_FEATURE_SET_PAGE { - UCHAR PageCode : 6; // 0x18 - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x16 - - UCHAR CDAudio[2]; - UCHAR EmbeddedChanger[2]; - UCHAR PacketSMART[2]; - UCHAR PersistantPrevent[2]; - UCHAR EventStatusNotification[2]; - UCHAR DigitalOutput[2]; - UCHAR CDSequentialRecordable[2]; - UCHAR DVDSequentialRecordable[2]; - UCHAR RandomRecordable[2]; - UCHAR KeyExchange[2]; - UCHAR Reserved2[2]; -} CDVD_FEATURE_SET_PAGE, *PCDVD_FEATURE_SET_PAGE; -#pragma pack(pop, mode_page_features) - -// -// CDVD Inactivity Time-out Page Format -// - -#pragma pack(push, mode_page_timeout, 1) -typedef struct _CDVD_INACTIVITY_TIMEOUT_PAGE { - UCHAR PageCode : 6; // 0x1D - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x08 - UCHAR Reserved2[2]; - - UCHAR SWPP : 1; - UCHAR DISP : 1; - UCHAR Reserved3 : 6; - - UCHAR Reserved4; - UCHAR GroupOneMinimumTimeout[2]; - UCHAR GroupTwoMinimumTimeout[2]; -} CDVD_INACTIVITY_TIMEOUT_PAGE, *PCDVD_INACTIVITY_TIMEOUT_PAGE; -#pragma pack(pop, mode_page_timeout) - -// -// CDVD Capabilities & Mechanism Status Page -// - -#define CDVD_LMT_CADDY 0 -#define CDVD_LMT_TRAY 1 -#define CDVD_LMT_POPUP 2 -#define CDVD_LMT_RESERVED1 3 -#define CDVD_LMT_CHANGER_INDIVIDUAL 4 -#define CDVD_LMT_CHANGER_CARTRIDGE 5 -#define CDVD_LMT_RESERVED2 6 -#define CDVD_LMT_RESERVED3 7 - - -#pragma pack(push, mode_page_capabilities, 1) -typedef struct _CDVD_CAPABILITIES_PAGE { - UCHAR PageCode : 6; // 0x2A - UCHAR Reserved : 1; - UCHAR PSBit : 1; // offset 0 - - UCHAR PageLength; // >= 0x18 // offset 1 - - UCHAR CDRRead : 1; - UCHAR CDERead : 1; - UCHAR Method2 : 1; - UCHAR DVDROMRead : 1; - UCHAR DVDRRead : 1; - UCHAR DVDRAMRead : 1; - UCHAR Reserved2 : 2; // offset 2 - - UCHAR CDRWrite : 1; - UCHAR CDEWrite : 1; - UCHAR TestWrite : 1; - UCHAR Reserved3 : 1; - UCHAR DVDRWrite : 1; - UCHAR DVDRAMWrite : 1; - UCHAR Reserved4 : 2; // offset 3 - - UCHAR AudioPlay : 1; - UCHAR Composite : 1; - UCHAR DigitalPortOne : 1; - UCHAR DigitalPortTwo : 1; - UCHAR Mode2Form1 : 1; - UCHAR Mode2Form2 : 1; - UCHAR MultiSession : 1; - UCHAR BufferUnderrunFree : 1; // offset 4 - - UCHAR CDDA : 1; - UCHAR CDDAAccurate : 1; - UCHAR RWSupported : 1; - UCHAR RWDeinterleaved : 1; - UCHAR C2Pointers : 1; - UCHAR ISRC : 1; - UCHAR UPC : 1; - UCHAR ReadBarCodeCapable : 1; // offset 5 - - UCHAR Lock : 1; - UCHAR LockState : 1; - UCHAR PreventJumper : 1; - UCHAR Eject : 1; - UCHAR Reserved6 : 1; - UCHAR LoadingMechanismType : 3; // offset 6 - - UCHAR SeparateVolume : 1; - UCHAR SeperateChannelMute : 1; - UCHAR SupportsDiskPresent : 1; - UCHAR SWSlotSelection : 1; - UCHAR SideChangeCapable : 1; - UCHAR RWInLeadInReadable : 1; - UCHAR Reserved7 : 2; // offset 7 - - union { - UCHAR ReadSpeedMaximum[2]; - UCHAR ObsoleteReserved[2]; // offset 8 - }; - - UCHAR NumberVolumeLevels[2]; // offset 10 - UCHAR BufferSize[2]; // offset 12 - - union { - UCHAR ReadSpeedCurrent[2]; - UCHAR ObsoleteReserved2[2]; // offset 14 - }; - UCHAR ObsoleteReserved3; // offset 16 - - UCHAR Reserved8 : 1; - UCHAR BCK : 1; - UCHAR RCK : 1; - UCHAR LSBF : 1; - UCHAR Length : 2; - UCHAR Reserved9 : 2; // offset 17 - - union { - UCHAR WriteSpeedMaximum[2]; - UCHAR ObsoleteReserved4[2]; // offset 18 - }; - union { - UCHAR WriteSpeedCurrent[2]; - UCHAR ObsoleteReserved11[2]; // offset 20 - }; - - // - // NOTE: This mode page is two bytes too small in the release - // version of the Windows2000 DDK. it also incorrectly - // put the CopyManagementRevision at offset 20 instead - // of offset 22, so fix that with a nameless union (for - // backwards-compatibility with those who "fixed" it on - // their own by looking at Reserved10[]). - // - - union { - UCHAR CopyManagementRevision[2]; // offset 22 - UCHAR Reserved10[2]; - }; - //UCHAR Reserved12[2]; // offset 24 - -} CDVD_CAPABILITIES_PAGE, *PCDVD_CAPABILITIES_PAGE; -#pragma pack(pop, mode_page_capabilities) - -#pragma pack(push, lun_list, 1) -typedef struct _LUN_LIST { - UCHAR LunListLength[4]; // sizeof LunSize * 8 - UCHAR Reserved[4]; -#if !defined(__midl) - UCHAR Lun[0][8]; // 4 level of addressing. 2 bytes each. -#endif -} LUN_LIST, *PLUN_LIST; -#pragma pack(pop, lun_list) - - -#define LOADING_MECHANISM_CADDY 0x00 -#define LOADING_MECHANISM_TRAY 0x01 -#define LOADING_MECHANISM_POPUP 0x02 -#define LOADING_MECHANISM_INDIVIDUAL_CHANGER 0x04 -#define LOADING_MECHANISM_CARTRIDGE_CHANGER 0x05 - -// -// end C/DVD 0.9 mode page definitions - -// -// Mode parameter list block descriptor - -// set the block length for reading/writing -// -// - -#define MODE_BLOCK_DESC_LENGTH 8 -#define MODE_HEADER_LENGTH 4 -#define MODE_HEADER_LENGTH10 8 - -#pragma pack(push, mode_parm_rw, 1) -typedef struct _MODE_PARM_READ_WRITE { - - MODE_PARAMETER_HEADER ParameterListHeader; // List Header Format - MODE_PARAMETER_BLOCK ParameterListBlock; // List Block Descriptor - -} MODE_PARM_READ_WRITE_DATA, *PMODE_PARM_READ_WRITE_DATA; -#pragma pack(pop, mode_parm_rw) - - -// -// Tape definitions -// - -#pragma pack(push, tape_position, 1) -typedef struct _TAPE_POSITION_DATA { - UCHAR Reserved1:2; - UCHAR BlockPositionUnsupported:1; - UCHAR Reserved2:3; - UCHAR EndOfPartition:1; - UCHAR BeginningOfPartition:1; - UCHAR PartitionNumber; - USHORT Reserved3; - UCHAR FirstBlock[4]; - UCHAR LastBlock[4]; - UCHAR Reserved4; - UCHAR NumberOfBlocks[3]; - UCHAR NumberOfBytes[4]; -} TAPE_POSITION_DATA, *PTAPE_POSITION_DATA; -#pragma pack(pop, tape_position) - -// -// This structure is used to convert little endian -// ULONGs to SCSI CDB big endians values. -// - -#pragma pack(push, byte_stuff, 1) -typedef union _EIGHT_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - UCHAR Byte4; - UCHAR Byte5; - UCHAR Byte6; - UCHAR Byte7; - }; - - ULONGLONG AsULongLong; -} EIGHT_BYTE, *PEIGHT_BYTE; - -typedef union _FOUR_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - }; - - ULONG AsULong; -} FOUR_BYTE, *PFOUR_BYTE; - -typedef union _TWO_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - }; - - USHORT AsUShort; -} TWO_BYTE, *PTWO_BYTE; -#pragma pack(pop, byte_stuff) - -// -// Byte reversing macro for converting -// between big- and little-endian formats -// - -#define REVERSE_BYTES_QUAD(Destination, Source) { \ - PEIGHT_BYTE d = (PEIGHT_BYTE)(Destination); \ - PEIGHT_BYTE s = (PEIGHT_BYTE)(Source); \ - d->Byte7 = s->Byte0; \ - d->Byte6 = s->Byte1; \ - d->Byte5 = s->Byte2; \ - d->Byte4 = s->Byte3; \ - d->Byte3 = s->Byte4; \ - d->Byte2 = s->Byte5; \ - d->Byte1 = s->Byte6; \ - d->Byte0 = s->Byte7; \ -} - -#define REVERSE_BYTES(Destination, Source) { \ - PFOUR_BYTE d = (PFOUR_BYTE)(Destination); \ - PFOUR_BYTE s = (PFOUR_BYTE)(Source); \ - d->Byte3 = s->Byte0; \ - d->Byte2 = s->Byte1; \ - d->Byte1 = s->Byte2; \ - d->Byte0 = s->Byte3; \ -} - -#define REVERSE_BYTES_SHORT(Destination, Source) { \ - PTWO_BYTE d = (PTWO_BYTE)(Destination); \ - PTWO_BYTE s = (PTWO_BYTE)(Source); \ - d->Byte1 = s->Byte0; \ - d->Byte0 = s->Byte1; \ -} - -// -// Byte reversing macro for converting -// USHORTS from big to little endian in place -// - -#define REVERSE_SHORT(Short) { \ - UCHAR tmp; \ - PTWO_BYTE w = (PTWO_BYTE)(Short); \ - tmp = w->Byte0; \ - w->Byte0 = w->Byte1; \ - w->Byte1 = tmp; \ - } - -// -// Byte reversing macro for convering -// ULONGS between big & little endian in place -// - -#define REVERSE_LONG(Long) { \ - UCHAR tmp; \ - PFOUR_BYTE l = (PFOUR_BYTE)(Long); \ - tmp = l->Byte3; \ - l->Byte3 = l->Byte0; \ - l->Byte0 = tmp; \ - tmp = l->Byte2; \ - l->Byte2 = l->Byte1; \ - l->Byte1 = tmp; \ - } - -// -// This macro has the effect of Bit = log2(Data) -// - -#define WHICH_BIT(Data, Bit) { \ - UCHAR tmp; \ - for (tmp = 0; tmp < 32; tmp++) { \ - if (((Data) >> tmp) == 1) { \ - break; \ - } \ - } \ - ASSERT(tmp != 32); \ - (Bit) = tmp; \ -} - -// end_storport - - -#if defined DebugPrint - #undef DebugPrint -#endif - -#if DBG - -#define DebugPrint(x) TapeDebugPrint x - -#else - -#define DebugPrint(x) - -#endif // DBG - -// -// Define Device Configuration Page -// - -typedef struct _MODE_DEVICE_CONFIGURATION_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PS : 1; - UCHAR PageLength; - UCHAR ActiveFormat : 5; - UCHAR CAFBit : 1; - UCHAR CAPBit : 1; - UCHAR Reserved2 : 1; - UCHAR ActivePartition; - UCHAR WriteBufferFullRatio; - UCHAR ReadBufferEmptyRatio; - UCHAR WriteDelayTime[2]; - UCHAR REW : 1; - UCHAR RBO : 1; - UCHAR SOCF : 2; - UCHAR AVC : 1; - UCHAR RSmk : 1; - UCHAR BIS : 1; - UCHAR DBR : 1; - UCHAR GapSize; - UCHAR Reserved3 : 3; - UCHAR SEW : 1; - UCHAR EEG : 1; - UCHAR EODdefined : 3; - UCHAR BufferSize[3]; - UCHAR DCAlgorithm; - UCHAR Reserved4; - -} MODE_DEVICE_CONFIGURATION_PAGE, *PMODE_DEVICE_CONFIGURATION_PAGE; - -// -// Define Medium Partition Page -// - -typedef struct _MODE_MEDIUM_PARTITION_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR MaximumAdditionalPartitions; - UCHAR AdditionalPartitionDefined; - UCHAR Reserved2 : 3; - UCHAR PSUMBit : 2; - UCHAR IDPBit : 1; - UCHAR SDPBit : 1; - UCHAR FDPBit : 1; - UCHAR MediumFormatRecognition; - UCHAR Reserved3[2]; - UCHAR Partition0Size[2]; - UCHAR Partition1Size[2]; - -} MODE_MEDIUM_PARTITION_PAGE, *PMODE_MEDIUM_PARTITION_PAGE; - -// -// Define Data Compression Page -// - -typedef struct _MODE_DATA_COMPRESSION_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 2; - UCHAR PageLength; - UCHAR Reserved2 : 6; - UCHAR DCC : 1; - UCHAR DCE : 1; - UCHAR Reserved3 : 5; - UCHAR RED : 2; - UCHAR DDE : 1; - UCHAR CompressionAlgorithm[4]; - UCHAR DecompressionAlgorithm[4]; - UCHAR Reserved4[4]; - -} MODE_DATA_COMPRESSION_PAGE, *PMODE_DATA_COMPRESSION_PAGE; - -// -// Define capabilites and mechanical status page. -// - -typedef struct _MODE_CAPABILITIES_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 2; - UCHAR PageLength; - UCHAR Reserved2[2]; - UCHAR RO : 1; - UCHAR Reserved3 : 4; - UCHAR SPREV : 1; - UCHAR Reserved4 : 2; - UCHAR Reserved5 : 3; - UCHAR EFMT : 1; - UCHAR Reserved6 : 1; - UCHAR QFA : 1; - UCHAR Reserved7 : 2; - UCHAR LOCK : 1; - UCHAR LOCKED : 1; - UCHAR PREVENT : 1; - UCHAR UNLOAD : 1; - UCHAR Reserved8 : 2; - UCHAR ECC : 1; - UCHAR CMPRS : 1; - UCHAR Reserved9 : 1; - UCHAR BLK512 : 1; - UCHAR BLK1024 : 1; - UCHAR Reserved10 : 4; - UCHAR SLOWB : 1; - UCHAR MaximumSpeedSupported[2]; - UCHAR MaximumStoredDefectedListEntries[2]; - UCHAR ContinuousTransferLimit[2]; - UCHAR CurrentSpeedSelected[2]; - UCHAR BufferSize[2]; - UCHAR Reserved11[2]; - -} MODE_CAPABILITIES_PAGE, *PMODE_CAPABILITIES_PAGE; - -typedef struct _MODE_CAP_PAGE { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_PARAMETER_BLOCK ParameterListBlock; - MODE_CAPABILITIES_PAGE CapabilitiesPage; - -} MODE_CAP_PAGE, *PMODE_CAP_PAGE; - - - -// -// Mode parameter list header and medium partition page - -// used in creating partitions -// - -typedef struct _MODE_MEDIUM_PART_PAGE { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_MEDIUM_PARTITION_PAGE MediumPartPage; - -} MODE_MEDIUM_PART_PAGE, *PMODE_MEDIUM_PART_PAGE; - -typedef struct _MODE_MEDIUM_PART_PAGE_PLUS { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_PARAMETER_BLOCK ParameterListBlock; - MODE_MEDIUM_PARTITION_PAGE MediumPartPage; - -} MODE_MEDIUM_PART_PAGE_PLUS, *PMODE_MEDIUM_PART_PAGE_PLUS; - - - -// -// Mode parameters for retrieving tape or media information -// - -typedef struct _MODE_TAPE_MEDIA_INFORMATION { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_PARAMETER_BLOCK ParameterListBlock; - MODE_MEDIUM_PARTITION_PAGE MediumPartPage; - -} MODE_TAPE_MEDIA_INFORMATION, *PMODE_TAPE_MEDIA_INFORMATION; - -// -// Mode parameter list header and device configuration page - -// used in retrieving device configuration information -// - -typedef struct _MODE_DEVICE_CONFIG_PAGE { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_DEVICE_CONFIGURATION_PAGE DeviceConfigPage; - -} MODE_DEVICE_CONFIG_PAGE, *PMODE_DEVICE_CONFIG_PAGE; - -typedef struct _MODE_DEVICE_CONFIG_PAGE_PLUS { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_PARAMETER_BLOCK ParameterListBlock; - MODE_DEVICE_CONFIGURATION_PAGE DeviceConfigPage; - -} MODE_DEVICE_CONFIG_PAGE_PLUS, *PMODE_DEVICE_CONFIG_PAGE_PLUS ; - -// -// Mode parameter list header and data compression page - -// used in retrieving data compression information -// - -typedef struct _MODE_DATA_COMPRESS_PAGE { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_DATA_COMPRESSION_PAGE DataCompressPage; - -} MODE_DATA_COMPRESS_PAGE, *PMODE_DATA_COMPRESS_PAGE; - -typedef struct _MODE_DATA_COMPRESS_PAGE_PLUS { - - MODE_PARAMETER_HEADER ParameterListHeader; - MODE_PARAMETER_BLOCK ParameterListBlock; - MODE_DATA_COMPRESSION_PAGE DataCompressPage; - -} MODE_DATA_COMPRESS_PAGE_PLUS, *PMODE_DATA_COMPRESS_PAGE_PLUS; - - - -// -// Tape/Minitape definition. -// - -typedef -BOOLEAN -(*TAPE_VERIFY_INQUIRY_ROUTINE)( - __in PINQUIRYDATA InquiryData, - __in PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage - ); - -typedef -VOID -(*TAPE_EXTENSION_INIT_ROUTINE)( - __in PVOID MinitapeExtension, - __in PINQUIRYDATA InquiryData, - __in PMODE_CAPABILITIES_PAGE ModeCapabilitiesPage - ); - -typedef enum _TAPE_STATUS { - TAPE_STATUS_SEND_SRB_AND_CALLBACK, - TAPE_STATUS_CALLBACK, - TAPE_STATUS_CHECK_TEST_UNIT_READY, - - TAPE_STATUS_SUCCESS, - TAPE_STATUS_INSUFFICIENT_RESOURCES, - TAPE_STATUS_NOT_IMPLEMENTED, - TAPE_STATUS_INVALID_DEVICE_REQUEST, - TAPE_STATUS_INVALID_PARAMETER, - - TAPE_STATUS_MEDIA_CHANGED, - TAPE_STATUS_BUS_RESET, - TAPE_STATUS_SETMARK_DETECTED, - TAPE_STATUS_FILEMARK_DETECTED, - TAPE_STATUS_BEGINNING_OF_MEDIA, - TAPE_STATUS_END_OF_MEDIA, - TAPE_STATUS_BUFFER_OVERFLOW, - TAPE_STATUS_NO_DATA_DETECTED, - TAPE_STATUS_EOM_OVERFLOW, - TAPE_STATUS_NO_MEDIA, - TAPE_STATUS_IO_DEVICE_ERROR, - TAPE_STATUS_UNRECOGNIZED_MEDIA, - - TAPE_STATUS_DEVICE_NOT_READY, - TAPE_STATUS_MEDIA_WRITE_PROTECTED, - TAPE_STATUS_DEVICE_DATA_ERROR, - TAPE_STATUS_NO_SUCH_DEVICE, - TAPE_STATUS_INVALID_BLOCK_LENGTH, - TAPE_STATUS_IO_TIMEOUT, - TAPE_STATUS_DEVICE_NOT_CONNECTED, - TAPE_STATUS_DATA_OVERRUN, - TAPE_STATUS_DEVICE_BUSY, - TAPE_STATUS_REQUIRES_CLEANING, - TAPE_STATUS_CLEANER_CARTRIDGE_INSTALLED - -} TAPE_STATUS, *PTAPE_STATUS; - -typedef -VOID -(*TAPE_ERROR_ROUTINE)( - __in PVOID MinitapeExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __inout PTAPE_STATUS TapeStatus - ); - -#define TAPE_RETRY_MASK 0x0000FFFF -#define IGNORE_ERRORS 0x00010000 -#define RETURN_ERRORS 0x00020000 - -typedef -TAPE_STATUS -(*TAPE_PROCESS_COMMAND_ROUTINE)( - __inout PVOID MinitapeExtension, - __inout PVOID CommandExtension, - __inout PVOID CommandParameters, - __inout PSCSI_REQUEST_BLOCK Srb, - __in ULONG CallNumber, - __in TAPE_STATUS StatusOfLastCommand, - __inout PULONG RetryFlags - ); - -// -// NT 4.0 miniclass drivers will be using this. -// - -typedef struct _TAPE_INIT_DATA { - TAPE_VERIFY_INQUIRY_ROUTINE VerifyInquiry; - BOOLEAN QueryModeCapabilitiesPage ; - ULONG MinitapeExtensionSize; - TAPE_EXTENSION_INIT_ROUTINE ExtensionInit; /* OPTIONAL */ - ULONG DefaultTimeOutValue; /* OPTIONAL */ - TAPE_ERROR_ROUTINE TapeError; /* OPTIONAL */ - ULONG CommandExtensionSize; - TAPE_PROCESS_COMMAND_ROUTINE CreatePartition; - TAPE_PROCESS_COMMAND_ROUTINE Erase; - TAPE_PROCESS_COMMAND_ROUTINE GetDriveParameters; - TAPE_PROCESS_COMMAND_ROUTINE GetMediaParameters; - TAPE_PROCESS_COMMAND_ROUTINE GetPosition; - TAPE_PROCESS_COMMAND_ROUTINE GetStatus; - TAPE_PROCESS_COMMAND_ROUTINE Prepare; - TAPE_PROCESS_COMMAND_ROUTINE SetDriveParameters; - TAPE_PROCESS_COMMAND_ROUTINE SetMediaParameters; - TAPE_PROCESS_COMMAND_ROUTINE SetPosition; - TAPE_PROCESS_COMMAND_ROUTINE WriteMarks; - TAPE_PROCESS_COMMAND_ROUTINE PreProcessReadWrite; -} TAPE_INIT_DATA, *PTAPE_INIT_DATA; - -typedef struct _TAPE_INIT_DATA_EX { - - // - // Size of this structure. - // - - ULONG InitDataSize; - - // - // Keep the 4.0 init data as is, so support of these - // drivers can be as seamless as possible. - // - - TAPE_VERIFY_INQUIRY_ROUTINE VerifyInquiry; - BOOLEAN QueryModeCapabilitiesPage ; - ULONG MinitapeExtensionSize; - TAPE_EXTENSION_INIT_ROUTINE ExtensionInit; /* OPTIONAL */ - ULONG DefaultTimeOutValue; /* OPTIONAL */ - TAPE_ERROR_ROUTINE TapeError; /* OPTIONAL */ - ULONG CommandExtensionSize; - TAPE_PROCESS_COMMAND_ROUTINE CreatePartition; - TAPE_PROCESS_COMMAND_ROUTINE Erase; - TAPE_PROCESS_COMMAND_ROUTINE GetDriveParameters; - TAPE_PROCESS_COMMAND_ROUTINE GetMediaParameters; - TAPE_PROCESS_COMMAND_ROUTINE GetPosition; - TAPE_PROCESS_COMMAND_ROUTINE GetStatus; - TAPE_PROCESS_COMMAND_ROUTINE Prepare; - TAPE_PROCESS_COMMAND_ROUTINE SetDriveParameters; - TAPE_PROCESS_COMMAND_ROUTINE SetMediaParameters; - TAPE_PROCESS_COMMAND_ROUTINE SetPosition; - TAPE_PROCESS_COMMAND_ROUTINE WriteMarks; - TAPE_PROCESS_COMMAND_ROUTINE PreProcessReadWrite; - - // - // New entry points / information for 5.0 - // - // Returns supported media types for the device. - // - - TAPE_PROCESS_COMMAND_ROUTINE TapeGetMediaTypes; - - // - // Indicates the number of different types the drive supports. - // - - ULONG MediaTypesSupported; - - // - // Entry point for all WMI operations that the driver/device supports. - // - - TAPE_PROCESS_COMMAND_ROUTINE TapeWMIOperations; - ULONG Reserved[2]; -} TAPE_INIT_DATA_EX, *PTAPE_INIT_DATA_EX; - -SCSIPORT_API -ULONG -TapeClassInitialize( - __in PVOID Argument1, - __in PVOID Argument2, - __in PTAPE_INIT_DATA_EX TapeInitData - ); - -SCSIPORT_API -BOOLEAN -TapeClassAllocateSrbBuffer( - __inout PSCSI_REQUEST_BLOCK Srb, - __in ULONG SrbBufferSize - ); - -SCSIPORT_API -VOID -TapeClassZeroMemory( - __inout_bcount(BufferSize) __inout PVOID Buffer, - __in ULONG BufferSize - ); - -SCSIPORT_API -ULONG -TapeClassCompareMemory( - __inout PVOID Source1, - __inout PVOID Source2, - __in ULONG Length - ); - -SCSIPORT_API -LARGE_INTEGER -TapeClassLiDiv( - __in LARGE_INTEGER Dividend, - __in LARGE_INTEGER Divisor - ); - -SCSIPORT_API -VOID -TapeDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); - - -// -// defines for QIC tape density codes -// - -#define QIC_XX 0 // ???? -#define QIC_24 5 // 0x05 -#define QIC_120 15 // 0x0F -#define QIC_150 16 // 0x10 -#define QIC_525 17 // 0x11 -#define QIC_1350 18 // 0x12 -#define QIC_1000 21 // 0x15 -#define QIC_1000C 30 // 0x1E -#define QIC_2100 31 // 0x1F -#define QIC_2GB 34 // 0x22 -#define QIC_5GB 40 // 0x28 - -// -// defines for QIC tape media codes -// - -#define DCXXXX 0 -#define DC300 1 -#define DC300XLP 2 -#define DC615 3 -#define DC600 4 -#define DC6037 5 -#define DC6150 6 -#define DC6250 7 -#define DC6320 8 -#define DC6525 9 -#define DC9135SL 33 //0x21 -#define DC9210 34 //0x22 -#define DC9135 35 //0x23 -#define DC9100 36 //0x24 -#define DC9120 37 //0x25 -#define DC9120SL 38 //0x26 -#define DC9164 39 //0x27 -#define DCXXXXFW 48 //0x30 -#define DC9200SL 49 //0x31 -#define DC9210XL 50 //0x32 -#define DC10GB 51 //0x33 -#define DC9200 52 //0x34 -#define DC9120XL 53 //0x35 -#define DC9210SL 54 //0x36 -#define DC9164XL 55 //0x37 -#define DC9200XL 64 //0x40 -#define DC9400 65 //0x41 -#define DC9500 66 //0x42 -#define DC9500SL 70 //0x46 - -// -// defines for translation reference point -// - -#define NOT_FROM_BOT 0 -#define FROM_BOT 1 - -// -// info/structure returned by/from -// TapeLogicalBlockToPhysicalBlock( ) -// - -typedef struct _TAPE_PHYS_POSITION { - ULONG SeekBlockAddress; - ULONG SpaceBlockCount; -} TAPE_PHYS_POSITION, PTAPE_PHYS_POSITION; - -// -// function prototypes -// - -TAPE_PHYS_POSITION -TapeClassLogicalBlockToPhysicalBlock( - __in UCHAR DensityCode, - __in ULONG LogicalBlockAddress, - __in ULONG BlockLength, - __in BOOLEAN FromBOT - ); - -ULONG -TapeClassPhysicalBlockToLogicalBlock( - __in UCHAR DensityCode, - __in ULONG PhysicalBlockAddress, - __in ULONG BlockLength, - __in BOOLEAN FromBOT - ); - - -// -// LOG SENSE Page codes -// -#define TapeAlertLogPage 0x2E - -// -// Type of tape drive alert information -// supported by the drive. -// For example, if the type is TapeAlertInfoNone, the drive doesn't -// support any alert info. Need to use read\write error counters -// to predict drive problems. If the type is TapeAlertInfoRequestSense, -// request sense command can be used to determine drive problems. -// -typedef enum _TAPE_ALERT_INFO_TYPE { - TapeAlertInfoNone, - TapeAlertInfoRequestSense, - TapeAlertInfoLogPage -} TAPE_ALERT_INFO_TYPE; - -// -// Tape alert information -// -#define READ_WARNING 1 -#define WRITE_WARNING 2 -#define HARD_ERROR 3 -#define MEDIA_ERROR 4 -#define READ_FAILURE 5 -#define WRITE_FAILURE 6 -#define MEDIA_LIFE 7 -#define NOT_DATA_GRADE 8 -#define WRITE_PROTECT 9 -#define NO_REMOVAL 10 -#define CLEANING_MEDIA 11 -#define UNSUPPORTED_FORMAT 12 -#define SNAPPED_TAPE 13 -#define CLEAN_NOW 20 -#define CLEAN_PERIODIC 21 -#define EXPIRED_CLEANING_MEDIA 22 -#define HARDWARE_A 30 -#define HARDWARE_B 31 -#define INTERFACE_ERROR 32 -#define EJECT_MEDIA 33 -#define DOWNLOAD_FAIL 34 - -// -// The following structs are duplicated from wmidata.h -// wmidata.h is generated from wmicore.mof file. Should -// the MOF file change for these structs, the corresponding -// change should be made in these structs also. -// Since minidrivers do not have access wmidata.h, we need -// to duplicate it here. -// -// ISSUE : 02/28/2000 - nramas : Should find a better way to -// handle the above. Duplication will cause problems in keeping -// these definitions in sync. -// -typedef struct _WMI_TAPE_DRIVE_PARAMETERS -{ - // Maximum block size supported - ULONG MaximumBlockSize; - - // Minimum block size supported - ULONG MinimumBlockSize; - - // Default block size supported - ULONG DefaultBlockSize; - - // Maximum number of partitions allowed. - ULONG MaximumPartitionCount; - - // TRUE if drive supports compression. - BOOLEAN CompressionCapable; - - // TRUE if compression is enabled. - BOOLEAN CompressionEnabled; - - // TRUE if drive reports setmarks - BOOLEAN ReportSetmarks; - - // TRUE if drive supports hardware error correction - BOOLEAN HardwareErrorCorrection; -} WMI_TAPE_DRIVE_PARAMETERS, *PWMI_TAPE_DRIVE_PARAMETERS; - -typedef struct _WMI_TAPE_MEDIA_PARAMETERS -{ - // Maximum capacity of the media - ULONGLONG MaximumCapacity; - - // Available capacity of the media - ULONGLONG AvailableCapacity; - - // Current blocksize - ULONG BlockSize; - - // Current number of partitions - ULONG PartitionCount; - - // TRUEif media is write protected - BOOLEAN MediaWriteProtected; -} WMI_TAPE_MEDIA_PARAMETERS, *PWMI_TAPE_MEDIA_PARAMETERS; - - -typedef struct _WMI_TAPE_PROBLEM_WARNING -{ - // Tape drive problem warning event - ULONG DriveProblemType; - - // Tape drive problem data - UCHAR TapeData[512]; -} WMI_TAPE_PROBLEM_WARNING, *PWMI_TAPE_PROBLEM_WARNING; - -typedef struct _WMI_TAPE_PROBLEM_IO_ERROR -{ - // Read errors corrected without much delay - ULONG ReadCorrectedWithoutDelay; - - // Read errors corrected with substantial delay - ULONG ReadCorrectedWithDelay; - - // Total number of Read errors - ULONG ReadTotalErrors; - - // Total number of read errors that were corrected - ULONG ReadTotalCorrectedErrors; - - // Total number of uncorrected read errors - ULONG ReadTotalUncorrectedErrors; - - // Number of times correction algorithm was processed for read - ULONG ReadCorrectionAlgorithmProcessed; - - // Write errors corrected without much delay - ULONG WriteCorrectedWithoutDelay; - - // Write errors corrected with substantial delay - ULONG WriteCorrectedWithDelay; - - // Total number of Read errors - ULONG WriteTotalErrors; - - // Total number of write errors that were corrected - ULONG WriteTotalCorrectedErrors; - - // Total number of uncorrected write errors - ULONG WriteTotalUncorrectedErrors; - - // Number of times correction algorithm was processed for write - ULONG WriteCorrectionAlgorithmProcessed; - - // Errors not related to medium - ULONG NonMediumErrors; -} WMI_TAPE_PROBLEM_IO_ERROR, *PWMI_TAPE_PROBLEM_IO_ERROR; - -typedef struct _WMI_TAPE_PROBLEM_DEVICE_ERROR -{ - - // WARNING : Drive is experiencing read problem. - BOOLEAN ReadWarning; - - // WARNING : Drive is experiencing write problem. - BOOLEAN WriteWarning; - - // Drive hardware problem - BOOLEAN HardError; - - // Critical Error : Too many read errors. - BOOLEAN ReadFailure; - - // Critical Error : Too many write errors. - BOOLEAN WriteFailure; - - // Tape format not supported - BOOLEAN UnsupportedFormat; - - // Tape is snapped. Replace media - BOOLEAN TapeSnapped; - - // Drive Requires Cleaning - BOOLEAN DriveRequiresCleaning; - - // It's time to clean the drive - BOOLEAN TimetoCleanDrive; - - // Hardware error. Check drive - BOOLEAN DriveHardwareError; - - // Some error in cabling, or connection. - BOOLEAN ScsiInterfaceError; - - // Critical Error : Media life expired. - BOOLEAN MediaLife; -} WMI_TAPE_PROBLEM_DEVICE_ERROR, *PWMI_TAPE_PROBLEM_DEVICE_ERROR; - - -#if defined(_MSC_VER) && (_MSC_VER >= 800) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#else -#pragma warning(default:4200) /* nonstandard extension used : zero-sized array in struct/union */ -#pragma warning(default:4201) /* nonstandard extension used : Nameless struct/union */ -#pragma warning(default:4214) /* nonstandard extension used : Bit field types other than int */ -#endif -#endif - -#endif /* _MINITAPE_ */ - diff --git a/qt-correction-tool/pub/ddk/mountdev.h b/qt-correction-tool/pub/ddk/mountdev.h deleted file mode 100644 index 569868b..0000000 --- a/qt-correction-tool/pub/ddk/mountdev.h +++ /dev/null @@ -1,77 +0,0 @@ -/*++ - -Copyright (c) 1997 Microsoft Corporation - -Module Name: - - mountdev.h - -Abstract: - - This file defines the private interfaces between the mount point manager - and the mounted devices. - - - -Revision History: - ---*/ - -#ifndef _MOUNTDEV_ -#define _MOUNTDEV_ - -#include - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID CTL_CODE(MOUNTDEVCONTROLTYPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME CTL_CODE(MOUNTDEVCONTROLTYPE, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_MOUNTDEV_LINK_CREATED CTL_CODE(MOUNTDEVCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTDEV_LINK_DELETED CTL_CODE(MOUNTDEVCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - -// -// Output structure for IOCTL_MOUNTDEV_QUERY_UNIQUE_ID. -// Input structure for IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY. -// - -typedef struct _MOUNTDEV_UNIQUE_ID { - USHORT UniqueIdLength; - UCHAR UniqueId[1]; -} MOUNTDEV_UNIQUE_ID, *PMOUNTDEV_UNIQUE_ID; - -// -// MOUNTDEV_NAME -// -// Input structure for IOCTL_MOUNTDEV_LINK_CREATED. -// Input structure for IOCTL_MOUNTDEV_LINK_DELETED. -// - -// -// Output structure for IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME -// - -typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME { - BOOLEAN UseOnlyIfThereAreNoOtherLinks; - USHORT NameLength; - WCHAR Name[1]; -} MOUNTDEV_SUGGESTED_LINK_NAME, *PMOUNTDEV_SUGGESTED_LINK_NAME; - - -#endif // NTDDI_VERSION >= NTDDI_WIN2K - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#define IOCTL_MOUNTDEV_QUERY_STABLE_GUID CTL_CODE(MOUNTDEVCONTROLTYPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// -// Output structure for IOCTL_MOUNTDEV_QUERY_STABLE_GUID. -// - -typedef struct _MOUNTDEV_STABLE_GUID { - GUID StableGuid; -} MOUNTDEV_STABLE_GUID, *PMOUNTDEV_STABLE_GUID; - -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#endif // _MOUNTDEV_ - diff --git a/qt-correction-tool/pub/ddk/mountmgr.h b/qt-correction-tool/pub/ddk/mountmgr.h deleted file mode 100644 index 39ed80a..0000000 --- a/qt-correction-tool/pub/ddk/mountmgr.h +++ /dev/null @@ -1,295 +0,0 @@ -/*++ - -Copyright (c) 1997-1999 Microsoft Corporation - -Module Name: - - mountmgr.h - -Abstract: - - This file defines the external mount point interface for administering - mount points. - -Revision History: - ---*/ - -#ifndef _MOUNTMGR_ -#define _MOUNTMGR_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifndef FAR -#define FAR -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager" -#define MOUNTMGR_DOS_DEVICE_NAME L"\\\\.\\MountPointManager" - -#define MOUNTMGRCONTROLTYPE 0x0000006D // 'm' -#define MOUNTDEVCONTROLTYPE 0x0000004D // 'M' - -// -// These are the IOCTLs supported by the mount point manager. -// - -#define IOCTL_MOUNTMGR_CREATE_POINT CTL_CODE(MOUNTMGRCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_DELETE_POINTS CTL_CODE(MOUNTMGRCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_QUERY_POINTS CTL_CODE(MOUNTMGRCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY CTL_CODE(MOUNTMGRCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER CTL_CODE(MOUNTMGRCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS CTL_CODE(MOUNTMGRCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED CTL_CODE(MOUNTMGRCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED CTL_CODE(MOUNTMGRCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_CHANGE_NOTIFY CTL_CODE(MOUNTMGRCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE CTL_CODE(MOUNTMGRCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS) -#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS) - -// -// Input structure for IOCTL_MOUNTMGR_CREATE_POINT. -// - -typedef struct _MOUNTMGR_CREATE_POINT_INPUT { - USHORT SymbolicLinkNameOffset; - USHORT SymbolicLinkNameLength; - USHORT DeviceNameOffset; - USHORT DeviceNameLength; -} MOUNTMGR_CREATE_POINT_INPUT, *PMOUNTMGR_CREATE_POINT_INPUT; - -// -// Input structure for IOCTL_MOUNTMGR_DELETE_POINTS, -// IOCTL_MOUNTMGR_QUERY_POINTS, and IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY. -// - -typedef struct _MOUNTMGR_MOUNT_POINT { - ULONG SymbolicLinkNameOffset; - USHORT SymbolicLinkNameLength; - ULONG UniqueIdOffset; - USHORT UniqueIdLength; - ULONG DeviceNameOffset; - USHORT DeviceNameLength; -} MOUNTMGR_MOUNT_POINT, *PMOUNTMGR_MOUNT_POINT; - -// -// Output structure for IOCTL_MOUNTMGR_DELETE_POINTS, -// IOCTL_MOUNTMGR_QUERY_POINTS, and IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY. -// - -typedef struct _MOUNTMGR_MOUNT_POINTS { - ULONG Size; - ULONG NumberOfMountPoints; - MOUNTMGR_MOUNT_POINT MountPoints[1]; -} MOUNTMGR_MOUNT_POINTS, *PMOUNTMGR_MOUNT_POINTS; - -// -// Input structure for IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER. -// - -typedef struct _MOUNTMGR_DRIVE_LETTER_TARGET { - USHORT DeviceNameLength; - WCHAR DeviceName[1]; -} MOUNTMGR_DRIVE_LETTER_TARGET, *PMOUNTMGR_DRIVE_LETTER_TARGET; - -// -// Output structure for IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER. -// - -typedef struct _MOUNTMGR_DRIVE_LETTER_INFORMATION { - BOOLEAN DriveLetterWasAssigned; - UCHAR CurrentDriveLetter; -} MOUNTMGR_DRIVE_LETTER_INFORMATION, *PMOUNTMGR_DRIVE_LETTER_INFORMATION; - -// -// Input structure for IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED and -// IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED. -// - -typedef struct _MOUNTMGR_VOLUME_MOUNT_POINT { - USHORT SourceVolumeNameOffset; - USHORT SourceVolumeNameLength; - USHORT TargetVolumeNameOffset; - USHORT TargetVolumeNameLength; -} MOUNTMGR_VOLUME_MOUNT_POINT, *PMOUNTMGR_VOLUME_MOUNT_POINT; - -// -// Input structure for IOCTL_MOUNTMGR_CHANGE_NOTIFY. -// Output structure for IOCTL_MOUNTMGR_CHANGE_NOTIFY. -// - -typedef struct _MOUNTMGR_CHANGE_NOTIFY_INFO { - ULONG EpicNumber; -} MOUNTMGR_CHANGE_NOTIFY_INFO, *PMOUNTMGR_CHANGE_NOTIFY_INFO; - -// -// Input structure for IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE, -// IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION, -// IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH, and -// IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS. -// - -typedef struct _MOUNTMGR_TARGET_NAME { - USHORT DeviceNameLength; - WCHAR DeviceName[1]; -} MOUNTMGR_TARGET_NAME, *PMOUNTMGR_TARGET_NAME; - -// -// Macro that defines what a "drive letter" mount point is. This macro can -// be used to scan the result from QUERY_POINTS to discover which mount points -// are find "drive letter" mount points. -// - -#define MOUNTMGR_IS_DRIVE_LETTER(s) ( \ - (s)->Length == 28 && \ - (s)->Buffer[0] == '\\' && \ - (s)->Buffer[1] == 'D' && \ - (s)->Buffer[2] == 'o' && \ - (s)->Buffer[3] == 's' && \ - (s)->Buffer[4] == 'D' && \ - (s)->Buffer[5] == 'e' && \ - (s)->Buffer[6] == 'v' && \ - (s)->Buffer[7] == 'i' && \ - (s)->Buffer[8] == 'c' && \ - (s)->Buffer[9] == 'e' && \ - (s)->Buffer[10] == 's' && \ - (s)->Buffer[11] == '\\' && \ - (s)->Buffer[12] >= 'A' && \ - (s)->Buffer[12] <= 'Z' && \ - (s)->Buffer[13] == ':') - -// -// Macro that defines what a "volume name" mount point is. This macro can -// be used to scan the result from QUERY_POINTS to discover which mount points -// are "volume name" mount points. -// - -#define MOUNTMGR_IS_VOLUME_NAME(s) ( \ - ((s)->Length == 96 || ((s)->Length == 98 && (s)->Buffer[48] == '\\')) && \ - (s)->Buffer[0] == '\\' && \ - ((s)->Buffer[1] == '?' || (s)->Buffer[1] == '\\') && \ - (s)->Buffer[2] == '?' && \ - (s)->Buffer[3] == '\\' && \ - (s)->Buffer[4] == 'V' && \ - (s)->Buffer[5] == 'o' && \ - (s)->Buffer[6] == 'l' && \ - (s)->Buffer[7] == 'u' && \ - (s)->Buffer[8] == 'm' && \ - (s)->Buffer[9] == 'e' && \ - (s)->Buffer[10] == '{' && \ - (s)->Buffer[19] == '-' && \ - (s)->Buffer[24] == '-' && \ - (s)->Buffer[29] == '-' && \ - (s)->Buffer[34] == '-' && \ - (s)->Buffer[47] == '}' \ - ) - -// -// The following IOCTL is supported by mounted devices. -// - -#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME CTL_CODE(MOUNTDEVCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// -// Output structure for IOCTL_MOUNTDEV_QUERY_DEVICE_NAME. -// - -typedef struct _MOUNTDEV_NAME { - USHORT NameLength; - WCHAR Name[1]; -} MOUNTDEV_NAME, *PMOUNTDEV_NAME; - -// -// Devices that wish to be mounted should report this GUID in -// IoRegisterDeviceInterface. -// - -#ifdef DEFINE_GUID - -DEFINE_GUID(MOUNTDEV_MOUNTED_DEVICE_GUID, 0x53f5630d, 0xb6bf, 0x11d0, 0x94, 0xf2, 0x00, 0xa0, 0xc9, 0x1e, 0xfb, 0x8b); - -#endif - - -#endif // NTDDI_VERSION >= NTDDI_WIN2K - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH CTL_CODE(MOUNTMGRCONTROLTYPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS CTL_CODE(MOUNTMGRCONTROLTYPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// -// Output structure for IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH and -// IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS. -// - -typedef struct _MOUNTMGR_VOLUME_PATHS { - ULONG MultiSzLength; - WCHAR MultiSz[1]; -} MOUNTMGR_VOLUME_PATHS, *PMOUNTMGR_VOLUME_PATHS; - - -#define MOUNTMGR_IS_DOS_VOLUME_NAME(s) ( \ - MOUNTMGR_IS_VOLUME_NAME(s) && \ - (s)->Length == 96 && \ - (s)->Buffer[1] == '\\' \ - ) - -#define MOUNTMGR_IS_DOS_VOLUME_NAME_WB(s) ( \ - MOUNTMGR_IS_VOLUME_NAME(s) && \ - (s)->Length == 98 && \ - (s)->Buffer[1] == '\\' \ - ) - -#define MOUNTMGR_IS_NT_VOLUME_NAME(s) ( \ - MOUNTMGR_IS_VOLUME_NAME(s) && \ - (s)->Length == 96 && \ - (s)->Buffer[1] == '?' \ - ) - -#define MOUNTMGR_IS_NT_VOLUME_NAME_WB(s) ( \ - MOUNTMGR_IS_VOLUME_NAME(s) && \ - (s)->Length == 98 && \ - (s)->Buffer[1] == '?' \ - ) - -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WS03) - -#define IOCTL_MOUNTMGR_SCRUB_REGISTRY CTL_CODE(MOUNTMGRCONTROLTYPE, 14, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT CTL_CODE(MOUNTMGRCONTROLTYPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_MOUNTMGR_SET_AUTO_MOUNT CTL_CODE(MOUNTMGRCONTROLTYPE, 16, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - -// -// Input / Output structure for querying / setting the auto-mount setting -// - -typedef enum _MOUNTMGR_AUTO_MOUNT_STATE { - Disabled = 0, - Enabled - } MOUNTMGR_AUTO_MOUNT_STATE; - -typedef struct _MOUNTMGR_QUERY_AUTO_MOUNT { - MOUNTMGR_AUTO_MOUNT_STATE CurrentState; - } MOUNTMGR_QUERY_AUTO_MOUNT, *PMOUNTMGR_QUERY_AUTO_MOUNT; - -typedef struct _MOUNTMGR_SET_AUTO_MOUNT { - MOUNTMGR_AUTO_MOUNT_STATE NewState; - } MOUNTMGR_SET_AUTO_MOUNT, *PMOUNTMGR_SET_AUTO_MOUNT; - -#endif // NTDDI_VERSION >= NTDDI_WS03 - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -#define IOCTL_MOUNTMGR_BOOT_DL_ASSIGNMENT CTL_CODE(MOUNTMGRCONTROLTYPE, 17, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) -#define IOCTL_MOUNTMGR_TRACELOG_CACHE CTL_CODE(MOUNTMGRCONTROLTYPE, 18, METHOD_BUFFERED, FILE_READ_ACCESS) - -#endif // NTDDI_VERSION >= NTDDI_WIN7 - -#endif // _MOUNTMGR_ - diff --git a/qt-correction-tool/pub/ddk/mpiodisk.h b/qt-correction-tool/pub/ddk/mpiodisk.h deleted file mode 100644 index 901bd96..0000000 --- a/qt-correction-tool/pub/ddk/mpiodisk.h +++ /dev/null @@ -1,674 +0,0 @@ -#ifndef _mpiodisk_h_ -#define _mpiodisk_h_ - -// PDOSCSI_ADDR - PDOSCSI_ADDR -#define PDOSCSI_ADDRGuid \ - { 0xc74aece4,0x468b,0x4113, { 0xb0,0x06,0x0c,0xec,0xdc,0x96,0x8a,0xc4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(PDOSCSI_ADDR_GUID, \ - 0xc74aece4,0x468b,0x4113,0xb0,0x06,0x0c,0xec,0xdc,0x96,0x8a,0xc4); -#endif - - -typedef struct _PDOSCSI_ADDR -{ - // - UCHAR PortNumber; - #define PDOSCSI_ADDR_PortNumber_SIZE sizeof(UCHAR) - #define PDOSCSI_ADDR_PortNumber_ID 1 - - // - UCHAR ScsiPathId; - #define PDOSCSI_ADDR_ScsiPathId_SIZE sizeof(UCHAR) - #define PDOSCSI_ADDR_ScsiPathId_ID 2 - - // - UCHAR TargetId; - #define PDOSCSI_ADDR_TargetId_SIZE sizeof(UCHAR) - #define PDOSCSI_ADDR_TargetId_ID 3 - - // - UCHAR Lun; - #define PDOSCSI_ADDR_Lun_SIZE sizeof(UCHAR) - #define PDOSCSI_ADDR_Lun_ID 4 - -} PDOSCSI_ADDR, *PPDOSCSI_ADDR; - -#define PDOSCSI_ADDR_SIZE (FIELD_OFFSET(PDOSCSI_ADDR, Lun) + PDOSCSI_ADDR_Lun_SIZE) - -// PDO_INFORMATION - PDO_INFORMATION -#define PDO_INFORMATIONGuid \ - { 0xe69e581d,0x6580,0x4bc2, { 0xba,0xd1,0x7e,0xee,0x85,0x98,0x90,0x86 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(PDO_INFORMATION_GUID, \ - 0xe69e581d,0x6580,0x4bc2,0xba,0xd1,0x7e,0xee,0x85,0x98,0x90,0x86); -#endif - - -typedef struct _PDO_INFORMATION -{ - // - PDOSCSI_ADDR ScsiAddress; - #define PDO_INFORMATION_ScsiAddress_SIZE sizeof(PDOSCSI_ADDR) - #define PDO_INFORMATION_ScsiAddress_ID 1 - - // - ULONG DeviceState; - #define PDO_INFORMATION_DeviceState_SIZE sizeof(ULONG) - #define PDO_INFORMATION_DeviceState_ID 2 - - // - ULONGLONG PathIdentifier; - #define PDO_INFORMATION_PathIdentifier_SIZE sizeof(ULONGLONG) - #define PDO_INFORMATION_PathIdentifier_ID 3 - - // - ULONG IdentifierType; - #define PDO_INFORMATION_IdentifierType_SIZE sizeof(ULONG) - #define PDO_INFORMATION_IdentifierType_ID 4 - - // - ULONG IdentifierLength; - #define PDO_INFORMATION_IdentifierLength_SIZE sizeof(ULONG) - #define PDO_INFORMATION_IdentifierLength_ID 5 - - // - UCHAR Identifier[32]; - #define PDO_INFORMATION_Identifier_SIZE sizeof(UCHAR[32]) - #define PDO_INFORMATION_Identifier_ID 6 - - // - UCHAR Pad[4]; - #define PDO_INFORMATION_Pad_SIZE sizeof(UCHAR[4]) - #define PDO_INFORMATION_Pad_ID 7 - -} PDO_INFORMATION, *PPDO_INFORMATION; - -#define PDO_INFORMATION_SIZE (FIELD_OFFSET(PDO_INFORMATION, Pad) + PDO_INFORMATION_Pad_SIZE) - -// MPIO_GET_DESCRIPTOR - MPIO_GET_DESCRIPTOR -#define MPIO_GET_DESCRIPTORGuid \ - { 0x85134d46,0xd17c,0x4992, { 0x83,0xf9,0x07,0x0d,0xd4,0xc4,0x8e,0x0b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_GET_DESCRIPTOR_GUID, \ - 0x85134d46,0xd17c,0x4992,0x83,0xf9,0x07,0x0d,0xd4,0xc4,0x8e,0x0b); -#endif - - -typedef struct _MPIO_GET_DESCRIPTOR -{ - // - ULONG NumberPdos; - #define MPIO_GET_DESCRIPTOR_NumberPdos_SIZE sizeof(ULONG) - #define MPIO_GET_DESCRIPTOR_NumberPdos_ID 1 - - // - WCHAR DeviceName[63 + 1]; - #define MPIO_GET_DESCRIPTOR_DeviceName_ID 2 - - // - PDO_INFORMATION PdoInformation[1]; - #define MPIO_GET_DESCRIPTOR_PdoInformation_ID 3 - -} MPIO_GET_DESCRIPTOR, *PMPIO_GET_DESCRIPTOR; - -// MPIO_DEVINSTANCE_HEALTH_CLASS - MPIO_DEVINSTANCE_HEALTH_CLASS -#define MPIO_DEVINSTANCE_HEALTH_CLASSGuid \ - { 0xf5e3daf3,0x4fe2,0x4faa, { 0xb0,0x00,0x48,0x85,0x10,0xa6,0x91,0xe4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DEVINSTANCE_HEALTH_CLASS_GUID, \ - 0xf5e3daf3,0x4fe2,0x4faa,0xb0,0x00,0x48,0x85,0x10,0xa6,0x91,0xe4); -#endif - - -typedef struct _MPIO_DEVINSTANCE_HEALTH_CLASS -{ - // - ULONGLONG PathId; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_PathId_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_PathId_ID 1 - - // - ULONGLONG NumberReads; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberReads_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberReads_ID 2 - - // - ULONGLONG NumberWrites; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberWrites_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberWrites_ID 3 - - // - ULONGLONG NumberBytesRead; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesRead_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesRead_ID 4 - - // - ULONGLONG NumberBytesWritten; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesWritten_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesWritten_ID 5 - - // - ULONGLONG NumberRetries; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberRetries_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberRetries_ID 6 - - // - ULONGLONG NumberIoErrors; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberIoErrors_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberIoErrors_ID 7 - - // - ULONGLONG CreateTime; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_CreateTime_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_CreateTime_ID 8 - - // - ULONGLONG FailTime; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_FailTime_SIZE sizeof(ULONGLONG) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_FailTime_ID 9 - - // - BOOLEAN DeviceOffline; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_DeviceOffline_SIZE sizeof(BOOLEAN) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_DeviceOffline_ID 10 - - // - UCHAR NumberReadsWrap; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberReadsWrap_SIZE sizeof(UCHAR) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberReadsWrap_ID 11 - - // - UCHAR NumberWritesWrap; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberWritesWrap_SIZE sizeof(UCHAR) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberWritesWrap_ID 12 - - // - UCHAR NumberBytesReadWrap; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesReadWrap_SIZE sizeof(UCHAR) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesReadWrap_ID 13 - - // - UCHAR NumberBytesWrittenWrap; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesWrittenWrap_SIZE sizeof(UCHAR) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_NumberBytesWrittenWrap_ID 14 - - // - UCHAR Pad[3]; - #define MPIO_DEVINSTANCE_HEALTH_CLASS_Pad_SIZE sizeof(UCHAR[3]) - #define MPIO_DEVINSTANCE_HEALTH_CLASS_Pad_ID 15 - -} MPIO_DEVINSTANCE_HEALTH_CLASS, *PMPIO_DEVINSTANCE_HEALTH_CLASS; - -#define MPIO_DEVINSTANCE_HEALTH_CLASS_SIZE (FIELD_OFFSET(MPIO_DEVINSTANCE_HEALTH_CLASS, Pad) + MPIO_DEVINSTANCE_HEALTH_CLASS_Pad_SIZE) - -// MPIO_DEVINSTANCE_HEALTH_INFO - MPIO_DEVINSTANCE_HEALTH_INFO -#define MPIO_DEVINSTANCE_HEALTH_INFOGuid \ - { 0x9e4f39ac,0xcbaa,0x4298, { 0xb6,0x00,0x48,0x8a,0xc5,0x65,0x2e,0xa9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DEVINSTANCE_HEALTH_INFO_GUID, \ - 0x9e4f39ac,0xcbaa,0x4298,0xb6,0x00,0x48,0x8a,0xc5,0x65,0x2e,0xa9); -#endif - - -typedef struct _MPIO_DEVINSTANCE_HEALTH_INFO -{ - // - ULONG NumberDevInstancePackets; - #define MPIO_DEVINSTANCE_HEALTH_INFO_NumberDevInstancePackets_SIZE sizeof(ULONG) - #define MPIO_DEVINSTANCE_HEALTH_INFO_NumberDevInstancePackets_ID 1 - - // - ULONG Reserved; - #define MPIO_DEVINSTANCE_HEALTH_INFO_Reserved_SIZE sizeof(ULONG) - #define MPIO_DEVINSTANCE_HEALTH_INFO_Reserved_ID 2 - - // - MPIO_DEVINSTANCE_HEALTH_CLASS DevInstanceHealthPackets[1]; - #define MPIO_DEVINSTANCE_HEALTH_INFO_DevInstanceHealthPackets_ID 3 - -} MPIO_DEVINSTANCE_HEALTH_INFO, *PMPIO_DEVINSTANCE_HEALTH_INFO; - -// MPIO_DISK_WMI_METHODS - MPIO_DISK_WMI_METHODS -#define MPIO_DISK_WMI_METHODSGuid \ - { 0xe6f52471,0xf302,0x49ce, { 0x99,0x0b,0xfa,0x7f,0xc9,0xeb,0xe6,0x66 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DISK_WMI_METHODS_GUID, \ - 0xe6f52471,0xf302,0x49ce,0x99,0x0b,0xfa,0x7f,0xc9,0xeb,0xe6,0x66); -#endif - -// -// Method id definitions for MPIO_DISK_WMI_METHODS -#define ClearAllDevInstancesHealthCounters 1 -#define ClearDevInstanceHealthCounters 2 -typedef struct _ClearDevInstanceHealthCounters_IN -{ - // - ULONGLONG PathID; - #define ClearDevInstanceHealthCounters_IN_PathID_SIZE sizeof(ULONGLONG) - #define ClearDevInstanceHealthCounters_IN_PathID_ID 1 - -} ClearDevInstanceHealthCounters_IN, *PClearDevInstanceHealthCounters_IN; - -#define ClearDevInstanceHealthCounters_IN_SIZE (FIELD_OFFSET(ClearDevInstanceHealthCounters_IN, PathID) + ClearDevInstanceHealthCounters_IN_PathID_SIZE) - - -// MPIO_DSM_Path_V2 - MPIO_DSM_Path_V2 -#define MPIO_DSM_Path_V2Guid \ - { 0xac4e13b0,0x7cb6,0x4599, { 0xb3,0x97,0xfb,0x36,0xfa,0xec,0x5c,0x96 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DSM_Path_V2_GUID, \ - 0xac4e13b0,0x7cb6,0x4599,0xb3,0x97,0xfb,0x36,0xfa,0xec,0x5c,0x96); -#endif - - -typedef struct _MPIO_DSM_Path_V2 -{ - // - ULONGLONG DsmPathId; - #define MPIO_DSM_Path_V2_DsmPathId_SIZE sizeof(ULONGLONG) - #define MPIO_DSM_Path_V2_DsmPathId_ID 1 - - // - ULONGLONG Reserved; - #define MPIO_DSM_Path_V2_Reserved_SIZE sizeof(ULONGLONG) - #define MPIO_DSM_Path_V2_Reserved_ID 2 - - // - ULONG PathWeight; - #define MPIO_DSM_Path_V2_PathWeight_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_PathWeight_ID 3 - - // - ULONG PrimaryPath; - #define MPIO_DSM_Path_V2_PrimaryPath_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_PrimaryPath_ID 4 - - // - ULONG OptimizedPath; - #define MPIO_DSM_Path_V2_OptimizedPath_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_OptimizedPath_ID 5 - - // - ULONG PreferredPath; - #define MPIO_DSM_Path_V2_PreferredPath_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_PreferredPath_ID 6 - - // - ULONG FailedPath; - #define MPIO_DSM_Path_V2_FailedPath_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_FailedPath_ID 7 - - -#define STATE_ACTIVE_OPTIMIZED 0 -#define STATE_ACTIVE_UNOPTIMIZED 1 -#define STATE_STANDBY 2 -#define STATE_UNAVAILABLE 3 -#define STATE_NOT_USED 16 - - // - ULONG TargetPortGroup_State; - #define MPIO_DSM_Path_V2_TargetPortGroup_State_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_TargetPortGroup_State_ID 8 - - -#define ALUA_NOT_SUPPORTED 0 -#define ALUA_IMPLICIT_ONLY 1 -#define ALUA_EXPLICIT_ONLY 2 -#define ALUA_IMPLICIT_AND_EXPLICIT 3 - - // - ULONG ALUASupport; - #define MPIO_DSM_Path_V2_ALUASupport_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_ALUASupport_ID 9 - - // - UCHAR SymmetricLUA; - #define MPIO_DSM_Path_V2_SymmetricLUA_SIZE sizeof(UCHAR) - #define MPIO_DSM_Path_V2_SymmetricLUA_ID 10 - - // - UCHAR TargetPortGroup_Preferred; - #define MPIO_DSM_Path_V2_TargetPortGroup_Preferred_SIZE sizeof(UCHAR) - #define MPIO_DSM_Path_V2_TargetPortGroup_Preferred_ID 11 - - // - USHORT TargetPortGroup_Identifier; - #define MPIO_DSM_Path_V2_TargetPortGroup_Identifier_SIZE sizeof(USHORT) - #define MPIO_DSM_Path_V2_TargetPortGroup_Identifier_ID 12 - - // - ULONG TargetPort_Identifier; - #define MPIO_DSM_Path_V2_TargetPort_Identifier_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_TargetPort_Identifier_ID 13 - - // - ULONG Reserved32; - #define MPIO_DSM_Path_V2_Reserved32_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_V2_Reserved32_ID 14 - - // - ULONGLONG Reserved64; - #define MPIO_DSM_Path_V2_Reserved64_SIZE sizeof(ULONGLONG) - #define MPIO_DSM_Path_V2_Reserved64_ID 15 - -} MPIO_DSM_Path_V2, *PMPIO_DSM_Path_V2; - -#define MPIO_DSM_Path_V2_SIZE (FIELD_OFFSET(MPIO_DSM_Path_V2, Reserved64) + MPIO_DSM_Path_V2_Reserved64_SIZE) - -// DSM_Load_Balance_Policy_V2 - DSM_Load_Balance_Policy_V2 -#define DSM_Load_Balance_Policy_V2Guid \ - { 0x6f4474ce,0xd20e,0x426c, { 0x93,0x71,0x9b,0x87,0xc2,0xe2,0xcd,0x5a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_Load_Balance_Policy_V2_GUID, \ - 0x6f4474ce,0xd20e,0x426c,0x93,0x71,0x9b,0x87,0xc2,0xe2,0xcd,0x5a); -#endif - - -typedef struct _DSM_Load_Balance_Policy_V2 -{ - // - ULONG Version; - #define DSM_Load_Balance_Policy_V2_Version_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_V2_Version_ID 1 - - -#define DSM_LB_FAILOVER 1 -#define DSM_LB_ROUND_ROBIN 2 -#define DSM_LB_ROUND_ROBIN_WITH_SUBSET 3 -#define DSM_LB_DYN_LEAST_QUEUE_DEPTH 4 -#define DSM_LB_WEIGHTED_PATHS 5 -#define DSM_LB_LEAST_BLOCKS 6 -#define DSM_LB_VENDOR_SPECIFIC 7 - - // - ULONG LoadBalancePolicy; - #define DSM_Load_Balance_Policy_V2_LoadBalancePolicy_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_V2_LoadBalancePolicy_ID 2 - - // - ULONG DSMPathCount; - #define DSM_Load_Balance_Policy_V2_DSMPathCount_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_V2_DSMPathCount_ID 3 - - // - ULONG Reserved; - #define DSM_Load_Balance_Policy_V2_Reserved_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_V2_Reserved_ID 4 - - // - MPIO_DSM_Path_V2 DSM_Paths[1]; - #define DSM_Load_Balance_Policy_V2_DSM_Paths_ID 5 - -} DSM_Load_Balance_Policy_V2, *PDSM_Load_Balance_Policy_V2; - -// DSM_QueryLBPolicy_V2 - DSM_QueryLBPolicy_V2 -#define DSM_QueryLBPolicy_V2Guid \ - { 0xd14fed0e,0xbdfb,0x4615, { 0x85,0x78,0x35,0x0c,0x4c,0x2b,0x06,0xd7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_QueryLBPolicy_V2_GUID, \ - 0xd14fed0e,0xbdfb,0x4615,0x85,0x78,0x35,0x0c,0x4c,0x2b,0x06,0xd7); -#endif - - -typedef struct _DSM_QueryLBPolicy_V2 -{ - // - DSM_Load_Balance_Policy_V2 LoadBalancePolicy; - #define DSM_QueryLBPolicy_V2_LoadBalancePolicy_SIZE sizeof(DSM_Load_Balance_Policy_V2) - #define DSM_QueryLBPolicy_V2_LoadBalancePolicy_ID 1 - -} DSM_QueryLBPolicy_V2, *PDSM_QueryLBPolicy_V2; - -#define DSM_QueryLBPolicy_V2_SIZE (FIELD_OFFSET(DSM_QueryLBPolicy_V2, LoadBalancePolicy) + DSM_QueryLBPolicy_V2_LoadBalancePolicy_SIZE) - -// DSM_QuerySupportedLBPolicies_V2 - DSM_QuerySupportedLBPolicies_V2 -#define DSM_QuerySupportedLBPolicies_V2Guid \ - { 0xfc777b74,0x7bcc,0x47ae, { 0xaa,0x63,0x59,0x65,0x6b,0xa5,0x93,0xfe } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_QuerySupportedLBPolicies_V2_GUID, \ - 0xfc777b74,0x7bcc,0x47ae,0xaa,0x63,0x59,0x65,0x6b,0xa5,0x93,0xfe); -#endif - - -typedef struct _DSM_QuerySupportedLBPolicies_V2 -{ - // - ULONG SupportedLBPoliciesCount; - #define DSM_QuerySupportedLBPolicies_V2_SupportedLBPoliciesCount_SIZE sizeof(ULONG) - #define DSM_QuerySupportedLBPolicies_V2_SupportedLBPoliciesCount_ID 1 - - // - ULONG Reserved; - #define DSM_QuerySupportedLBPolicies_V2_Reserved_SIZE sizeof(ULONG) - #define DSM_QuerySupportedLBPolicies_V2_Reserved_ID 2 - - // - DSM_Load_Balance_Policy_V2 Supported_LB_Policies[1]; - #define DSM_QuerySupportedLBPolicies_V2_Supported_LB_Policies_ID 3 - -} DSM_QuerySupportedLBPolicies_V2, *PDSM_QuerySupportedLBPolicies_V2; - -// MPIO_DSM_Path - MPIO_DSM_Path -#define MPIO_DSM_PathGuid \ - { 0x80ebd5b4,0x3baf,0x41f1, { 0x9c,0x41,0xbd,0x36,0xc5,0x28,0x2b,0x67 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DSM_Path_GUID, \ - 0x80ebd5b4,0x3baf,0x41f1,0x9c,0x41,0xbd,0x36,0xc5,0x28,0x2b,0x67); -#endif - - -typedef struct _MPIO_DSM_Path -{ - // - ULONGLONG DsmPathId; - #define MPIO_DSM_Path_DsmPathId_SIZE sizeof(ULONGLONG) - #define MPIO_DSM_Path_DsmPathId_ID 1 - - // - ULONGLONG Reserved; - #define MPIO_DSM_Path_Reserved_SIZE sizeof(ULONGLONG) - #define MPIO_DSM_Path_Reserved_ID 2 - - // - ULONG PathWeight; - #define MPIO_DSM_Path_PathWeight_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_PathWeight_ID 3 - - // - ULONG PrimaryPath; - #define MPIO_DSM_Path_PrimaryPath_SIZE sizeof(ULONG) - #define MPIO_DSM_Path_PrimaryPath_ID 4 - -} MPIO_DSM_Path, *PMPIO_DSM_Path; - -#define MPIO_DSM_Path_SIZE (FIELD_OFFSET(MPIO_DSM_Path, PrimaryPath) + MPIO_DSM_Path_PrimaryPath_SIZE) - -// DSM_Load_Balance_Policy - DSM_Load_Balance_Policy -#define DSM_Load_Balance_PolicyGuid \ - { 0x3078b89b,0xa34f,0x4ff6, { 0x81,0x0a,0xc5,0x6a,0xd3,0xba,0x94,0x7d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_Load_Balance_Policy_GUID, \ - 0x3078b89b,0xa34f,0x4ff6,0x81,0x0a,0xc5,0x6a,0xd3,0xba,0x94,0x7d); -#endif - - -typedef struct _DSM_Load_Balance_Policy -{ - // - ULONG Version; - #define DSM_Load_Balance_Policy_Version_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_Version_ID 1 - - -#define DSM_LB_FAILOVER 1 -#define DSM_LB_ROUND_ROBIN 2 -#define DSM_LB_ROUND_ROBIN_WITH_SUBSET 3 -#define DSM_LB_DYN_LEAST_QUEUE_DEPTH 4 -#define DSM_LB_WEIGHTED_PATHS 5 -#define DSM_LB_LEAST_BLOCKS 6 -#define DSM_LB_VENDOR_SPECIFIC 7 - - // - ULONG LoadBalancePolicy; - #define DSM_Load_Balance_Policy_LoadBalancePolicy_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_LoadBalancePolicy_ID 2 - - // - ULONG DSMPathCount; - #define DSM_Load_Balance_Policy_DSMPathCount_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_DSMPathCount_ID 3 - - // - ULONG Reserved; - #define DSM_Load_Balance_Policy_Reserved_SIZE sizeof(ULONG) - #define DSM_Load_Balance_Policy_Reserved_ID 4 - - // - MPIO_DSM_Path DSM_Paths[1]; - #define DSM_Load_Balance_Policy_DSM_Paths_ID 5 - -} DSM_Load_Balance_Policy, *PDSM_Load_Balance_Policy; - -// DSM_QueryLBPolicy - DSM_QueryLBPolicy -#define DSM_QueryLBPolicyGuid \ - { 0x20a4663b,0xbf54,0x4738, { 0xb4,0x03,0x0c,0xfc,0x71,0xec,0xfc,0x90 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_QueryLBPolicy_GUID, \ - 0x20a4663b,0xbf54,0x4738,0xb4,0x03,0x0c,0xfc,0x71,0xec,0xfc,0x90); -#endif - - -typedef struct _DSM_QueryLBPolicy -{ - // - DSM_Load_Balance_Policy LoadBalancePolicy; - #define DSM_QueryLBPolicy_LoadBalancePolicy_SIZE sizeof(DSM_Load_Balance_Policy) - #define DSM_QueryLBPolicy_LoadBalancePolicy_ID 1 - -} DSM_QueryLBPolicy, *PDSM_QueryLBPolicy; - -#define DSM_QueryLBPolicy_SIZE (FIELD_OFFSET(DSM_QueryLBPolicy, LoadBalancePolicy) + DSM_QueryLBPolicy_LoadBalancePolicy_SIZE) - -// DSM_QuerySupportedLBPolicies - DSM_QuerySupportedLBPolicies -#define DSM_QuerySupportedLBPoliciesGuid \ - { 0xffcf3f4e,0xbab6,0x455c, { 0xba,0x99,0xd6,0x0c,0xfb,0xc5,0x88,0x7d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_QuerySupportedLBPolicies_GUID, \ - 0xffcf3f4e,0xbab6,0x455c,0xba,0x99,0xd6,0x0c,0xfb,0xc5,0x88,0x7d); -#endif - - -typedef struct _DSM_QuerySupportedLBPolicies -{ - // - ULONG SupportedLBPoliciesCount; - #define DSM_QuerySupportedLBPolicies_SupportedLBPoliciesCount_SIZE sizeof(ULONG) - #define DSM_QuerySupportedLBPolicies_SupportedLBPoliciesCount_ID 1 - - // - ULONG Reserved; - #define DSM_QuerySupportedLBPolicies_Reserved_SIZE sizeof(ULONG) - #define DSM_QuerySupportedLBPolicies_Reserved_ID 2 - - // - DSM_Load_Balance_Policy Supported_LB_Policies[1]; - #define DSM_QuerySupportedLBPolicies_Supported_LB_Policies_ID 3 - -} DSM_QuerySupportedLBPolicies, *PDSM_QuerySupportedLBPolicies; - -// DSM_LB_Operations - DSM_LB_Operations -#define DSM_LB_OperationsGuid \ - { 0xc944053c,0xc90f,0x4012, { 0xb7,0x75,0x1f,0x1a,0x26,0x1d,0x4b,0xe4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_LB_Operations_GUID, \ - 0xc944053c,0xc90f,0x4012,0xb7,0x75,0x1f,0x1a,0x26,0x1d,0x4b,0xe4); -#endif - -// -// Method id definitions for DSM_LB_Operations -#define DsmSetLoadBalancePolicy 1 -typedef struct _DsmSetLoadBalancePolicy_IN -{ - // - DSM_Load_Balance_Policy LoadBalancePolicy; - #define DsmSetLoadBalancePolicy_IN_LoadBalancePolicy_SIZE sizeof(DSM_Load_Balance_Policy) - #define DsmSetLoadBalancePolicy_IN_LoadBalancePolicy_ID 1 - -} DsmSetLoadBalancePolicy_IN, *PDsmSetLoadBalancePolicy_IN; - -#define DsmSetLoadBalancePolicy_IN_SIZE (FIELD_OFFSET(DsmSetLoadBalancePolicy_IN, LoadBalancePolicy) + DsmSetLoadBalancePolicy_IN_LoadBalancePolicy_SIZE) - -typedef struct _DsmSetLoadBalancePolicy_OUT -{ - // - ULONG Status; - #define DsmSetLoadBalancePolicy_OUT_Status_SIZE sizeof(ULONG) - #define DsmSetLoadBalancePolicy_OUT_Status_ID 2 - -} DsmSetLoadBalancePolicy_OUT, *PDsmSetLoadBalancePolicy_OUT; - -#define DsmSetLoadBalancePolicy_OUT_SIZE (FIELD_OFFSET(DsmSetLoadBalancePolicy_OUT, Status) + DsmSetLoadBalancePolicy_OUT_Status_SIZE) - -#define DsmSetLoadBalancePolicyALUA 2 -typedef struct _DsmSetLoadBalancePolicyALUA_IN -{ - // - DSM_Load_Balance_Policy_V2 LoadBalancePolicy; - #define DsmSetLoadBalancePolicyALUA_IN_LoadBalancePolicy_SIZE sizeof(DSM_Load_Balance_Policy_V2) - #define DsmSetLoadBalancePolicyALUA_IN_LoadBalancePolicy_ID 1 - -} DsmSetLoadBalancePolicyALUA_IN, *PDsmSetLoadBalancePolicyALUA_IN; - -#define DsmSetLoadBalancePolicyALUA_IN_SIZE (FIELD_OFFSET(DsmSetLoadBalancePolicyALUA_IN, LoadBalancePolicy) + DsmSetLoadBalancePolicyALUA_IN_LoadBalancePolicy_SIZE) - -typedef struct _DsmSetLoadBalancePolicyALUA_OUT -{ - // - ULONG Status; - #define DsmSetLoadBalancePolicyALUA_OUT_Status_SIZE sizeof(ULONG) - #define DsmSetLoadBalancePolicyALUA_OUT_Status_ID 2 - -} DsmSetLoadBalancePolicyALUA_OUT, *PDsmSetLoadBalancePolicyALUA_OUT; - -#define DsmSetLoadBalancePolicyALUA_OUT_SIZE (FIELD_OFFSET(DsmSetLoadBalancePolicyALUA_OUT, Status) + DsmSetLoadBalancePolicyALUA_OUT_Status_SIZE) - - -// DSM_QueryUniqueId - DSM_QueryUniqueId -#define DSM_QueryUniqueIdGuid \ - { 0x7b47cbe2,0x63d0,0x4e6b, { 0xb9,0x87,0x4b,0xfc,0xbd,0x6c,0x36,0x8e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_QueryUniqueId_GUID, \ - 0x7b47cbe2,0x63d0,0x4e6b,0xb9,0x87,0x4b,0xfc,0xbd,0x6c,0x36,0x8e); -#endif - - -typedef struct _DSM_QueryUniqueId -{ - // - ULONGLONG DsmUniqueId; - #define DSM_QueryUniqueId_DsmUniqueId_SIZE sizeof(ULONGLONG) - #define DSM_QueryUniqueId_DsmUniqueId_ID 1 - -} DSM_QueryUniqueId, *PDSM_QueryUniqueId; - -#define DSM_QueryUniqueId_SIZE (FIELD_OFFSET(DSM_QueryUniqueId, DsmUniqueId) + DSM_QueryUniqueId_DsmUniqueId_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/mpiowmi.h b/qt-correction-tool/pub/ddk/mpiowmi.h deleted file mode 100644 index facbc9c..0000000 --- a/qt-correction-tool/pub/ddk/mpiowmi.h +++ /dev/null @@ -1,806 +0,0 @@ -#ifndef _mpiowmi_h_ -#define _mpiowmi_h_ - -// MPIO_PATH_HEALTH_CLASS - MPIO_PATH_HEALTH_CLASS -#define MPIO_PATH_HEALTH_CLASSGuid \ - { 0xea0f7134,0x269e,0x44ca, { 0xb3,0x50,0x7c,0x7e,0xbe,0xba,0x8b,0xbc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_PATH_HEALTH_CLASS_GUID, \ - 0xea0f7134,0x269e,0x44ca,0xb3,0x50,0x7c,0x7e,0xbe,0xba,0x8b,0xbc); -#endif - - -typedef struct _MPIO_PATH_HEALTH_CLASS -{ - // - ULONGLONG PathId; - #define MPIO_PATH_HEALTH_CLASS_PathId_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_PathId_ID 1 - - // - ULONGLONG NumberReads; - #define MPIO_PATH_HEALTH_CLASS_NumberReads_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberReads_ID 2 - - // - ULONGLONG NumberWrites; - #define MPIO_PATH_HEALTH_CLASS_NumberWrites_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberWrites_ID 3 - - // - ULONGLONG NumberBytesRead; - #define MPIO_PATH_HEALTH_CLASS_NumberBytesRead_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberBytesRead_ID 4 - - // - ULONGLONG NumberBytesWritten; - #define MPIO_PATH_HEALTH_CLASS_NumberBytesWritten_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberBytesWritten_ID 5 - - // - ULONGLONG NumberRetries; - #define MPIO_PATH_HEALTH_CLASS_NumberRetries_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberRetries_ID 6 - - // - ULONGLONG NumberIoErrors; - #define MPIO_PATH_HEALTH_CLASS_NumberIoErrors_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_NumberIoErrors_ID 7 - - // - ULONGLONG CreateTime; - #define MPIO_PATH_HEALTH_CLASS_CreateTime_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_CreateTime_ID 8 - - // - ULONGLONG FailTime; - #define MPIO_PATH_HEALTH_CLASS_FailTime_SIZE sizeof(ULONGLONG) - #define MPIO_PATH_HEALTH_CLASS_FailTime_ID 9 - - // - BOOLEAN PathOffline; - #define MPIO_PATH_HEALTH_CLASS_PathOffline_SIZE sizeof(BOOLEAN) - #define MPIO_PATH_HEALTH_CLASS_PathOffline_ID 10 - - // - UCHAR NumberReadsWrap; - #define MPIO_PATH_HEALTH_CLASS_NumberReadsWrap_SIZE sizeof(UCHAR) - #define MPIO_PATH_HEALTH_CLASS_NumberReadsWrap_ID 11 - - // - UCHAR NumberWritesWrap; - #define MPIO_PATH_HEALTH_CLASS_NumberWritesWrap_SIZE sizeof(UCHAR) - #define MPIO_PATH_HEALTH_CLASS_NumberWritesWrap_ID 12 - - // - UCHAR NumberBytesReadWrap; - #define MPIO_PATH_HEALTH_CLASS_NumberBytesReadWrap_SIZE sizeof(UCHAR) - #define MPIO_PATH_HEALTH_CLASS_NumberBytesReadWrap_ID 13 - - // - UCHAR NumberBytesWrittenWrap; - #define MPIO_PATH_HEALTH_CLASS_NumberBytesWrittenWrap_SIZE sizeof(UCHAR) - #define MPIO_PATH_HEALTH_CLASS_NumberBytesWrittenWrap_ID 14 - - // - UCHAR OutstandingRequests; - #define MPIO_PATH_HEALTH_CLASS_OutstandingRequests_SIZE sizeof(UCHAR) - #define MPIO_PATH_HEALTH_CLASS_OutstandingRequests_ID 15 - - // - UCHAR Pad[2]; - #define MPIO_PATH_HEALTH_CLASS_Pad_SIZE sizeof(UCHAR[2]) - #define MPIO_PATH_HEALTH_CLASS_Pad_ID 16 - -} MPIO_PATH_HEALTH_CLASS, *PMPIO_PATH_HEALTH_CLASS; - -#define MPIO_PATH_HEALTH_CLASS_SIZE (FIELD_OFFSET(MPIO_PATH_HEALTH_CLASS, Pad) + MPIO_PATH_HEALTH_CLASS_Pad_SIZE) - -// MPIO_PATH_HEALTH_INFO - MPIO_PATH_HEALTH_INFO -#define MPIO_PATH_HEALTH_INFOGuid \ - { 0x01ea1dfb,0x668b,0x48bc, { 0xa8,0x6e,0xa8,0xb4,0xca,0xbf,0xce,0x33 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_PATH_HEALTH_INFO_GUID, \ - 0x01ea1dfb,0x668b,0x48bc,0xa8,0x6e,0xa8,0xb4,0xca,0xbf,0xce,0x33); -#endif - - -typedef struct _MPIO_PATH_HEALTH_INFO -{ - // - ULONG NumberPathPackets; - #define MPIO_PATH_HEALTH_INFO_NumberPathPackets_SIZE sizeof(ULONG) - #define MPIO_PATH_HEALTH_INFO_NumberPathPackets_ID 1 - - // - ULONG Reserved; - #define MPIO_PATH_HEALTH_INFO_Reserved_SIZE sizeof(ULONG) - #define MPIO_PATH_HEALTH_INFO_Reserved_ID 2 - - // - MPIO_PATH_HEALTH_CLASS PathHealthPackets[1]; - #define MPIO_PATH_HEALTH_INFO_PathHealthPackets_ID 3 - -} MPIO_PATH_HEALTH_INFO, *PMPIO_PATH_HEALTH_INFO; - -// MPIO_DISK_HEALTH_CLASS - MPIO_DISK_HEALTH_CLASS -#define MPIO_DISK_HEALTH_CLASSGuid \ - { 0x6453c476,0x0499,0x42ab, { 0x98,0x25,0x51,0x33,0x28,0x2b,0x0b,0x56 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DISK_HEALTH_CLASS_GUID, \ - 0x6453c476,0x0499,0x42ab,0x98,0x25,0x51,0x33,0x28,0x2b,0x0b,0x56); -#endif - - -typedef struct _MPIO_DISK_HEALTH_CLASS -{ - // - WCHAR Name[63 + 1]; - #define MPIO_DISK_HEALTH_CLASS_Name_ID 1 - - // - ULONGLONG NumberReads; - #define MPIO_DISK_HEALTH_CLASS_NumberReads_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberReads_ID 2 - - // - ULONGLONG NumberWrites; - #define MPIO_DISK_HEALTH_CLASS_NumberWrites_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberWrites_ID 3 - - // - ULONGLONG NumberBytesRead; - #define MPIO_DISK_HEALTH_CLASS_NumberBytesRead_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberBytesRead_ID 4 - - // - ULONGLONG NumberBytesWritten; - #define MPIO_DISK_HEALTH_CLASS_NumberBytesWritten_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberBytesWritten_ID 5 - - // - ULONGLONG NumberRetries; - #define MPIO_DISK_HEALTH_CLASS_NumberRetries_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberRetries_ID 6 - - // - ULONGLONG NumberIoErrors; - #define MPIO_DISK_HEALTH_CLASS_NumberIoErrors_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_NumberIoErrors_ID 7 - - // - ULONGLONG CreateTime; - #define MPIO_DISK_HEALTH_CLASS_CreateTime_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_CreateTime_ID 8 - - // - ULONGLONG PathFailures; - #define MPIO_DISK_HEALTH_CLASS_PathFailures_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_PathFailures_ID 9 - - // - ULONGLONG FailTime; - #define MPIO_DISK_HEALTH_CLASS_FailTime_SIZE sizeof(ULONGLONG) - #define MPIO_DISK_HEALTH_CLASS_FailTime_ID 10 - - // - BOOLEAN DeviceOffline; - #define MPIO_DISK_HEALTH_CLASS_DeviceOffline_SIZE sizeof(BOOLEAN) - #define MPIO_DISK_HEALTH_CLASS_DeviceOffline_ID 11 - - // - UCHAR NumberReadsWrap; - #define MPIO_DISK_HEALTH_CLASS_NumberReadsWrap_SIZE sizeof(UCHAR) - #define MPIO_DISK_HEALTH_CLASS_NumberReadsWrap_ID 12 - - // - UCHAR NumberWritesWrap; - #define MPIO_DISK_HEALTH_CLASS_NumberWritesWrap_SIZE sizeof(UCHAR) - #define MPIO_DISK_HEALTH_CLASS_NumberWritesWrap_ID 13 - - // - UCHAR NumberBytesReadWrap; - #define MPIO_DISK_HEALTH_CLASS_NumberBytesReadWrap_SIZE sizeof(UCHAR) - #define MPIO_DISK_HEALTH_CLASS_NumberBytesReadWrap_ID 14 - - // - UCHAR NumberBytesWrittenWrap; - #define MPIO_DISK_HEALTH_CLASS_NumberBytesWrittenWrap_SIZE sizeof(UCHAR) - #define MPIO_DISK_HEALTH_CLASS_NumberBytesWrittenWrap_ID 15 - - // - UCHAR Pad[3]; - #define MPIO_DISK_HEALTH_CLASS_Pad_SIZE sizeof(UCHAR[3]) - #define MPIO_DISK_HEALTH_CLASS_Pad_ID 16 - -} MPIO_DISK_HEALTH_CLASS, *PMPIO_DISK_HEALTH_CLASS; - -#define MPIO_DISK_HEALTH_CLASS_SIZE (FIELD_OFFSET(MPIO_DISK_HEALTH_CLASS, Pad) + MPIO_DISK_HEALTH_CLASS_Pad_SIZE) - -// MPIO_DISK_HEALTH_INFO - MPIO_DISK_HEALTH_INFO -#define MPIO_DISK_HEALTH_INFOGuid \ - { 0xef04568a,0x782b,0x443c, { 0xa3,0xdb,0x96,0x6a,0xb4,0x37,0x75,0xf9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DISK_HEALTH_INFO_GUID, \ - 0xef04568a,0x782b,0x443c,0xa3,0xdb,0x96,0x6a,0xb4,0x37,0x75,0xf9); -#endif - - -typedef struct _MPIO_DISK_HEALTH_INFO -{ - // - ULONG NumberDiskPackets; - #define MPIO_DISK_HEALTH_INFO_NumberDiskPackets_SIZE sizeof(ULONG) - #define MPIO_DISK_HEALTH_INFO_NumberDiskPackets_ID 1 - - // - ULONG Reserved; - #define MPIO_DISK_HEALTH_INFO_Reserved_SIZE sizeof(ULONG) - #define MPIO_DISK_HEALTH_INFO_Reserved_ID 2 - - // - MPIO_DISK_HEALTH_CLASS DiskHealthPackets[1]; - #define MPIO_DISK_HEALTH_INFO_DiskHealthPackets_ID 3 - -} MPIO_DISK_HEALTH_INFO, *PMPIO_DISK_HEALTH_INFO; - -// SCSI_ADDR - SCSI_ADDR -#define SCSI_ADDRGuid \ - { 0xc74aece4,0x468b,0x4113, { 0xb0,0x06,0x0c,0xec,0xdc,0x96,0x8a,0xc4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(SCSI_ADDR_GUID, \ - 0xc74aece4,0x468b,0x4113,0xb0,0x06,0x0c,0xec,0xdc,0x96,0x8a,0xc4); -#endif - - -typedef struct _SCSI_ADDR -{ - // - UCHAR PortNumber; - #define SCSI_ADDR_PortNumber_SIZE sizeof(UCHAR) - #define SCSI_ADDR_PortNumber_ID 1 - - // - UCHAR ScsiPathId; - #define SCSI_ADDR_ScsiPathId_SIZE sizeof(UCHAR) - #define SCSI_ADDR_ScsiPathId_ID 2 - - // - UCHAR TargetId; - #define SCSI_ADDR_TargetId_SIZE sizeof(UCHAR) - #define SCSI_ADDR_TargetId_ID 3 - - // - UCHAR Lun; - #define SCSI_ADDR_Lun_SIZE sizeof(UCHAR) - #define SCSI_ADDR_Lun_ID 4 - -} SCSI_ADDR, *PSCSI_ADDR; - -#define SCSI_ADDR_SIZE (FIELD_OFFSET(SCSI_ADDR, Lun) + SCSI_ADDR_Lun_SIZE) - -// MPIO_DRIVE_INFO - MPIO_DRIVE_INFO -#define MPIO_DRIVE_INFOGuid \ - { 0xcb9d55b2,0xd833,0x4a4c, { 0x8c,0xaa,0x4a,0xee,0x3f,0x24,0x0e,0x9a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DRIVE_INFO_GUID, \ - 0xcb9d55b2,0xd833,0x4a4c,0x8c,0xaa,0x4a,0xee,0x3f,0x24,0x0e,0x9a); -#endif - - -typedef struct _MPIO_DRIVE_INFO -{ - // - ULONG NumberPaths; - #define MPIO_DRIVE_INFO_NumberPaths_SIZE sizeof(ULONG) - #define MPIO_DRIVE_INFO_NumberPaths_ID 1 - - // - WCHAR Name[63 + 1]; - #define MPIO_DRIVE_INFO_Name_ID 2 - - // - WCHAR SerialNumber[63 + 1]; - #define MPIO_DRIVE_INFO_SerialNumber_ID 3 - - // - WCHAR DsmName[63 + 1]; - #define MPIO_DRIVE_INFO_DsmName_ID 4 - -} MPIO_DRIVE_INFO, *PMPIO_DRIVE_INFO; - -// MPIO_DISK_INFO - MPIO_DISK_INFO -#define MPIO_DISK_INFOGuid \ - { 0x9f9765ed,0xc3a0,0x451f, { 0x86,0xc1,0x47,0x0a,0x1d,0xdd,0x32,0x17 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_DISK_INFO_GUID, \ - 0x9f9765ed,0xc3a0,0x451f,0x86,0xc1,0x47,0x0a,0x1d,0xdd,0x32,0x17); -#endif - - -typedef struct _MPIO_DISK_INFO -{ - // - ULONG NumberDrives; - #define MPIO_DISK_INFO_NumberDrives_SIZE sizeof(ULONG) - #define MPIO_DISK_INFO_NumberDrives_ID 1 - - // - MPIO_DRIVE_INFO DriveInfo[1]; - #define MPIO_DISK_INFO_DriveInfo_ID 2 - -} MPIO_DISK_INFO, *PMPIO_DISK_INFO; - -// DSM_VERSION - DSM_VERSION -#define DSM_VERSIONGuid \ - { 0x7cc0ae8e,0xf30d,0x4ecd, { 0xa3,0xc6,0x5b,0xee,0x8d,0xe6,0x1d,0x48 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_VERSION_GUID, \ - 0x7cc0ae8e,0xf30d,0x4ecd,0xa3,0xc6,0x5b,0xee,0x8d,0xe6,0x1d,0x48); -#endif - - -typedef struct _DSM_VERSION -{ - // - ULONG MajorVersion; - #define DSM_VERSION_MajorVersion_SIZE sizeof(ULONG) - #define DSM_VERSION_MajorVersion_ID 1 - - // - ULONG MinorVersion; - #define DSM_VERSION_MinorVersion_SIZE sizeof(ULONG) - #define DSM_VERSION_MinorVersion_ID 2 - - // - ULONG ProductBuild; - #define DSM_VERSION_ProductBuild_SIZE sizeof(ULONG) - #define DSM_VERSION_ProductBuild_ID 3 - - // - ULONG QfeNumber; - #define DSM_VERSION_QfeNumber_SIZE sizeof(ULONG) - #define DSM_VERSION_QfeNumber_ID 4 - -} DSM_VERSION, *PDSM_VERSION; - -#define DSM_VERSION_SIZE (FIELD_OFFSET(DSM_VERSION, QfeNumber) + DSM_VERSION_QfeNumber_SIZE) - -// DSM_COUNTERS - DSM_COUNTERS -#define DSM_COUNTERSGuid \ - { 0x39026ae4,0x9e81,0x468b, { 0x81,0x9c,0x25,0x34,0x48,0x12,0x7f,0xd5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_COUNTERS_GUID, \ - 0x39026ae4,0x9e81,0x468b,0x81,0x9c,0x25,0x34,0x48,0x12,0x7f,0xd5); -#endif - - -typedef struct _DSM_COUNTERS -{ - // - ULONG PathVerifyEnabled; - #define DSM_COUNTERS_PathVerifyEnabled_SIZE sizeof(ULONG) - #define DSM_COUNTERS_PathVerifyEnabled_ID 1 - - // - ULONG PathVerificationPeriod; - #define DSM_COUNTERS_PathVerificationPeriod_SIZE sizeof(ULONG) - #define DSM_COUNTERS_PathVerificationPeriod_ID 2 - - // - ULONG PDORemovePeriod; - #define DSM_COUNTERS_PDORemovePeriod_SIZE sizeof(ULONG) - #define DSM_COUNTERS_PDORemovePeriod_ID 3 - - // - ULONG RetryCount; - #define DSM_COUNTERS_RetryCount_SIZE sizeof(ULONG) - #define DSM_COUNTERS_RetryCount_ID 4 - - // - ULONG RetryInterval; - #define DSM_COUNTERS_RetryInterval_SIZE sizeof(ULONG) - #define DSM_COUNTERS_RetryInterval_ID 5 - - // - ULONG Reserved32; - #define DSM_COUNTERS_Reserved32_SIZE sizeof(ULONG) - #define DSM_COUNTERS_Reserved32_ID 6 - - // - ULONGLONG Reserved64; - #define DSM_COUNTERS_Reserved64_SIZE sizeof(ULONGLONG) - #define DSM_COUNTERS_Reserved64_ID 7 - -} DSM_COUNTERS, *PDSM_COUNTERS; - -#define DSM_COUNTERS_SIZE (FIELD_OFFSET(DSM_COUNTERS, Reserved64) + DSM_COUNTERS_Reserved64_SIZE) - -// DSM_PARAMETERS - DSM_PARAMETERS -#define DSM_PARAMETERSGuid \ - { 0x695df15f,0x9bd1,0x49f7, { 0xbe,0xbb,0x16,0xde,0xbd,0x15,0x11,0xcb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(DSM_PARAMETERS_GUID, \ - 0x695df15f,0x9bd1,0x49f7,0xbe,0xbb,0x16,0xde,0xbd,0x15,0x11,0xcb); -#endif - - -typedef struct _DSM_PARAMETERS -{ - // - WCHAR DsmName[63 + 1]; - #define DSM_PARAMETERS_DsmName_ID 1 - - // - ULONGLONG DsmContext; - #define DSM_PARAMETERS_DsmContext_SIZE sizeof(ULONGLONG) - #define DSM_PARAMETERS_DsmContext_ID 2 - - // - DSM_VERSION DsmVersion; - #define DSM_PARAMETERS_DsmVersion_SIZE sizeof(DSM_VERSION) - #define DSM_PARAMETERS_DsmVersion_ID 3 - - // - DSM_COUNTERS DsmCounters; - #define DSM_PARAMETERS_DsmCounters_SIZE sizeof(DSM_COUNTERS) - #define DSM_PARAMETERS_DsmCounters_ID 4 - -} DSM_PARAMETERS, *PDSM_PARAMETERS; - -#define DSM_PARAMETERS_SIZE (FIELD_OFFSET(DSM_PARAMETERS, DsmCounters) + DSM_PARAMETERS_DsmCounters_SIZE) - -// MPIO_REGISTERED_DSM - MPIO_REGISTERED_DSM -#define MPIO_REGISTERED_DSMGuid \ - { 0x0c2c484b,0x030b,0x4540, { 0x88,0x90,0xbb,0x66,0x81,0x94,0x1c,0xe3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_REGISTERED_DSM_GUID, \ - 0x0c2c484b,0x030b,0x4540,0x88,0x90,0xbb,0x66,0x81,0x94,0x1c,0xe3); -#endif - - -typedef struct _MPIO_REGISTERED_DSM -{ - // - ULONG NumberDSMs; - #define MPIO_REGISTERED_DSM_NumberDSMs_SIZE sizeof(ULONG) - #define MPIO_REGISTERED_DSM_NumberDSMs_ID 1 - - // - DSM_PARAMETERS DsmParameters[1]; - #define MPIO_REGISTERED_DSM_DsmParameters_ID 2 - -} MPIO_REGISTERED_DSM, *PMPIO_REGISTERED_DSM; - -// MPIO_ADAPTER_INFORMATION - MPIO_ADAPTER_INFORMATION -#define MPIO_ADAPTER_INFORMATIONGuid \ - { 0xb87c0fec,0x88b7,0x451d, { 0xa3,0x78,0x38,0x7b,0xa6,0x1a,0xeb,0x89 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_ADAPTER_INFORMATION_GUID, \ - 0xb87c0fec,0x88b7,0x451d,0xa3,0x78,0x38,0x7b,0xa6,0x1a,0xeb,0x89); -#endif - - -typedef struct _MPIO_ADAPTER_INFORMATION -{ - // - ULONGLONG PathId; - #define MPIO_ADAPTER_INFORMATION_PathId_SIZE sizeof(ULONGLONG) - #define MPIO_ADAPTER_INFORMATION_PathId_ID 1 - - // - UCHAR BusNumber; - #define MPIO_ADAPTER_INFORMATION_BusNumber_SIZE sizeof(UCHAR) - #define MPIO_ADAPTER_INFORMATION_BusNumber_ID 2 - - // - UCHAR DeviceNumber; - #define MPIO_ADAPTER_INFORMATION_DeviceNumber_SIZE sizeof(UCHAR) - #define MPIO_ADAPTER_INFORMATION_DeviceNumber_ID 3 - - // - UCHAR FunctionNumber; - #define MPIO_ADAPTER_INFORMATION_FunctionNumber_SIZE sizeof(UCHAR) - #define MPIO_ADAPTER_INFORMATION_FunctionNumber_ID 4 - - // - UCHAR Pad; - #define MPIO_ADAPTER_INFORMATION_Pad_SIZE sizeof(UCHAR) - #define MPIO_ADAPTER_INFORMATION_Pad_ID 5 - - // - WCHAR AdapterName[63 + 1]; - #define MPIO_ADAPTER_INFORMATION_AdapterName_ID 6 - -} MPIO_ADAPTER_INFORMATION, *PMPIO_ADAPTER_INFORMATION; - -// MPIO_PATH_INFORMATION - MPIO_PATH_INFORMATION -#define MPIO_PATH_INFORMATIONGuid \ - { 0xb3a05997,0x2077,0x40a3, { 0xbf,0x36,0xeb,0xd9,0x1f,0xf8,0xb2,0x54 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_PATH_INFORMATION_GUID, \ - 0xb3a05997,0x2077,0x40a3,0xbf,0x36,0xeb,0xd9,0x1f,0xf8,0xb2,0x54); -#endif - - -typedef struct _MPIO_PATH_INFORMATION -{ - // - ULONG NumberPaths; - #define MPIO_PATH_INFORMATION_NumberPaths_SIZE sizeof(ULONG) - #define MPIO_PATH_INFORMATION_NumberPaths_ID 1 - - // - ULONG Pad; - #define MPIO_PATH_INFORMATION_Pad_SIZE sizeof(ULONG) - #define MPIO_PATH_INFORMATION_Pad_ID 2 - - // - MPIO_ADAPTER_INFORMATION PathList[1]; - #define MPIO_PATH_INFORMATION_PathList_ID 3 - -} MPIO_PATH_INFORMATION, *PMPIO_PATH_INFORMATION; - -// MPIO_CONTROLLER_INFO - MPIO_CONTROLLER_INFO -#define MPIO_CONTROLLER_INFOGuid \ - { 0xe732405b,0xb15e,0x4872, { 0xaf,0xd0,0x0d,0xf6,0x9d,0xc1,0xbb,0x01 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_CONTROLLER_INFO_GUID, \ - 0xe732405b,0xb15e,0x4872,0xaf,0xd0,0x0d,0xf6,0x9d,0xc1,0xbb,0x01); -#endif - - -typedef struct _MPIO_CONTROLLER_INFO -{ - // - ULONG IdentifierType; - #define MPIO_CONTROLLER_INFO_IdentifierType_SIZE sizeof(ULONG) - #define MPIO_CONTROLLER_INFO_IdentifierType_ID 1 - - // - ULONG IdentifierLength; - #define MPIO_CONTROLLER_INFO_IdentifierLength_SIZE sizeof(ULONG) - #define MPIO_CONTROLLER_INFO_IdentifierLength_ID 2 - - // - UCHAR Identifier[32]; - #define MPIO_CONTROLLER_INFO_Identifier_SIZE sizeof(UCHAR[32]) - #define MPIO_CONTROLLER_INFO_Identifier_ID 3 - - // - ULONG ControllerState; - #define MPIO_CONTROLLER_INFO_ControllerState_SIZE sizeof(ULONG) - #define MPIO_CONTROLLER_INFO_ControllerState_ID 4 - - // - ULONG Pad; - #define MPIO_CONTROLLER_INFO_Pad_SIZE sizeof(ULONG) - #define MPIO_CONTROLLER_INFO_Pad_ID 5 - - // - WCHAR AssociatedDsm[63 + 1]; - #define MPIO_CONTROLLER_INFO_AssociatedDsm_ID 6 - -} MPIO_CONTROLLER_INFO, *PMPIO_CONTROLLER_INFO; - -// MPIO_CONTROLLER_CONFIGURATION - MPIO_CONTROLLER_CONFIGURATION -#define MPIO_CONTROLLER_CONFIGURATIONGuid \ - { 0xcf07da2c,0xe598,0x45d2, { 0x9d,0x78,0x75,0xc3,0x8b,0x81,0x64,0xe8 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_CONTROLLER_CONFIGURATION_GUID, \ - 0xcf07da2c,0xe598,0x45d2,0x9d,0x78,0x75,0xc3,0x8b,0x81,0x64,0xe8); -#endif - - -typedef struct _MPIO_CONTROLLER_CONFIGURATION -{ - // - ULONG NumberControllers; - #define MPIO_CONTROLLER_CONFIGURATION_NumberControllers_SIZE sizeof(ULONG) - #define MPIO_CONTROLLER_CONFIGURATION_NumberControllers_ID 1 - - // - MPIO_CONTROLLER_INFO ControllerInfo[1]; - #define MPIO_CONTROLLER_CONFIGURATION_ControllerInfo_ID 2 - -} MPIO_CONTROLLER_CONFIGURATION, *PMPIO_CONTROLLER_CONFIGURATION; - -// MPIO_TIMERS_COUNTERS - MPIO_TIMERS_COUNTERS -#define MPIO_TIMERS_COUNTERSGuid \ - { 0xce49b95b,0x690f,0x4cd0, { 0x8a,0x95,0xec,0xe3,0xfa,0xd8,0xef,0xc2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_TIMERS_COUNTERS_GUID, \ - 0xce49b95b,0x690f,0x4cd0,0x8a,0x95,0xec,0xe3,0xfa,0xd8,0xef,0xc2); -#endif - - -typedef struct _MPIO_TIMERS_COUNTERS -{ - // - ULONG PathVerifyEnabled; - #define MPIO_TIMERS_COUNTERS_PathVerifyEnabled_SIZE sizeof(ULONG) - #define MPIO_TIMERS_COUNTERS_PathVerifyEnabled_ID 1 - - // - ULONG PathVerificationPeriod; - #define MPIO_TIMERS_COUNTERS_PathVerificationPeriod_SIZE sizeof(ULONG) - #define MPIO_TIMERS_COUNTERS_PathVerificationPeriod_ID 2 - - // - ULONG PDORemovePeriod; - #define MPIO_TIMERS_COUNTERS_PDORemovePeriod_SIZE sizeof(ULONG) - #define MPIO_TIMERS_COUNTERS_PDORemovePeriod_ID 3 - - // - ULONG RetryCount; - #define MPIO_TIMERS_COUNTERS_RetryCount_SIZE sizeof(ULONG) - #define MPIO_TIMERS_COUNTERS_RetryCount_ID 4 - - // - ULONG RetryInterval; - #define MPIO_TIMERS_COUNTERS_RetryInterval_SIZE sizeof(ULONG) - #define MPIO_TIMERS_COUNTERS_RetryInterval_ID 5 - -} MPIO_TIMERS_COUNTERS, *PMPIO_TIMERS_COUNTERS; - -#define MPIO_TIMERS_COUNTERS_SIZE (FIELD_OFFSET(MPIO_TIMERS_COUNTERS, RetryInterval) + MPIO_TIMERS_COUNTERS_RetryInterval_SIZE) - -// MPIO_WMI_METHODS - MPIO_WMI_METHODS -#define MPIO_WMI_METHODSGuid \ - { 0xe37bc327,0xf7b1,0x4675, { 0x80,0x18,0x85,0x27,0x32,0xe2,0xed,0xe1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_WMI_METHODS_GUID, \ - 0xe37bc327,0xf7b1,0x4675,0x80,0x18,0x85,0x27,0x32,0xe2,0xed,0xe1); -#endif - -// -// Method id definitions for MPIO_WMI_METHODS -#define MPIOMoveDevice 1 -typedef struct _MPIOMoveDevice_IN -{ - // - ULONG DiskOrdinal; - #define MPIOMoveDevice_IN_DiskOrdinal_SIZE sizeof(ULONG) - #define MPIOMoveDevice_IN_DiskOrdinal_ID 1 - - // - ULONG Flags; - #define MPIOMoveDevice_IN_Flags_SIZE sizeof(ULONG) - #define MPIOMoveDevice_IN_Flags_ID 2 - - // - ULONGLONG PathID; - #define MPIOMoveDevice_IN_PathID_SIZE sizeof(ULONGLONG) - #define MPIOMoveDevice_IN_PathID_ID 3 - -} MPIOMoveDevice_IN, *PMPIOMoveDevice_IN; - -#define MPIOMoveDevice_IN_SIZE (FIELD_OFFSET(MPIOMoveDevice_IN, PathID) + MPIOMoveDevice_IN_PathID_SIZE) - -#define GetPathConfiguration 2 -typedef struct _GetPathConfiguration_IN -{ - // - ULONGLONG PathID; - #define GetPathConfiguration_IN_PathID_SIZE sizeof(ULONGLONG) - #define GetPathConfiguration_IN_PathID_ID 1 - -} GetPathConfiguration_IN, *PGetPathConfiguration_IN; - -#define GetPathConfiguration_IN_SIZE (FIELD_OFFSET(GetPathConfiguration_IN, PathID) + GetPathConfiguration_IN_PathID_SIZE) - -typedef struct _GetPathConfiguration_OUT -{ - // - ULONG EntryCount; - #define GetPathConfiguration_OUT_EntryCount_SIZE sizeof(ULONG) - #define GetPathConfiguration_OUT_EntryCount_ID 2 - - // - SCSI_ADDR Address[1]; - #define GetPathConfiguration_OUT_Address_ID 3 - -} GetPathConfiguration_OUT, *PGetPathConfiguration_OUT; - -#define SetDSMCounters 3 -typedef struct _SetDSMCounters_IN -{ - // - ULONGLONG DsmContext; - #define SetDSMCounters_IN_DsmContext_SIZE sizeof(ULONGLONG) - #define SetDSMCounters_IN_DsmContext_ID 1 - - // - DSM_COUNTERS DsmCounters; - #define SetDSMCounters_IN_DsmCounters_SIZE sizeof(DSM_COUNTERS) - #define SetDSMCounters_IN_DsmCounters_ID 2 - -} SetDSMCounters_IN, *PSetDSMCounters_IN; - -#define SetDSMCounters_IN_SIZE (FIELD_OFFSET(SetDSMCounters_IN, DsmCounters) + SetDSMCounters_IN_DsmCounters_SIZE) - -#define ClearAllHealthCounters 4 -#define ClearPathHealthCounters 5 -typedef struct _ClearPathHealthCounters_IN -{ - // - ULONGLONG PathID; - #define ClearPathHealthCounters_IN_PathID_SIZE sizeof(ULONGLONG) - #define ClearPathHealthCounters_IN_PathID_ID 1 - -} ClearPathHealthCounters_IN, *PClearPathHealthCounters_IN; - -#define ClearPathHealthCounters_IN_SIZE (FIELD_OFFSET(ClearPathHealthCounters_IN, PathID) + ClearPathHealthCounters_IN_PathID_SIZE) - -#define ClearAllPathsHealthCounters 6 -#define ClearMpioDiskHealthCounters 7 -typedef struct _ClearMpioDiskHealthCounters_IN -{ - // - ULONG DiskOrdinal; - #define ClearMpioDiskHealthCounters_IN_DiskOrdinal_SIZE sizeof(ULONG) - #define ClearMpioDiskHealthCounters_IN_DiskOrdinal_ID 1 - -} ClearMpioDiskHealthCounters_IN, *PClearMpioDiskHealthCounters_IN; - -#define ClearMpioDiskHealthCounters_IN_SIZE (FIELD_OFFSET(ClearMpioDiskHealthCounters_IN, DiskOrdinal) + ClearMpioDiskHealthCounters_IN_DiskOrdinal_SIZE) - -#define ClearAllMpioDisksHealthCounters 8 - -// MPIO_EventEntry - MPIO_EventEntry -#define MPIO_EventEntryGuid \ - { 0x2abb031a,0x71aa,0x46d4, { 0xa5,0x3f,0xea,0xe3,0x40,0x51,0xe3,0x57 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MPIO_EventEntry_GUID, \ - 0x2abb031a,0x71aa,0x46d4,0xa5,0x3f,0xea,0xe3,0x40,0x51,0xe3,0x57); -#endif - - -typedef struct _MPIO_EventEntry -{ - // - ULONGLONG TimeStamp; - #define MPIO_EventEntry_TimeStamp_SIZE sizeof(ULONGLONG) - #define MPIO_EventEntry_TimeStamp_ID 1 - - -#define MPIO_FATAL_ERROR 1 -#define MPIO_ERROR 2 -#define MPIO_WARNING 3 -#define MPIO_INFORMATION 4 - - // - ULONG Severity; - #define MPIO_EventEntry_Severity_SIZE sizeof(ULONG) - #define MPIO_EventEntry_Severity_ID 2 - - // - WCHAR Component[63 + 1]; - #define MPIO_EventEntry_Component_ID 3 - - // - WCHAR EventDescription[63 + 1]; - #define MPIO_EventEntry_EventDescription_ID 4 - -} MPIO_EventEntry, *PMPIO_EventEntry; - -#endif - diff --git a/qt-correction-tool/pub/ddk/mrx.h b/qt-correction-tool/pub/ddk/mrx.h deleted file mode 100644 index 2ae4e5f..0000000 --- a/qt-correction-tool/pub/ddk/mrx.h +++ /dev/null @@ -1,818 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - mrx.h - -Abstract: - - This module defines the interface between the MINI Redirectors and the RDBSS. - The inteface is a dispatch table for the normal file system operations. In - addition routines are provided for registrations/deregistration of mini - redirectors. - -Author: -Revision History: - -Notes: - - The interface definition between the mini redirectors and the wrapper - consists of two parts, the data structures used and the dispatch vector. - The data structures are defined in mrxfcb.h while the signatures of the - various entries in the dispatch vector and the dispatch vector itself is - defined in this file. - ---*/ - -#ifndef _RXMINIRDR_ -#define _RXMINIRDR_ - -// -// RDBSS data structures shared with the mini redirectors -// - -#include - -// -// The following macros encapsulate commonly used operations in the mini redirector. -// These include setting the status/information associated with the completion of -// a request etc. -// - - -// -// The following three macros are used for passing back operation status from the -// minirdr to the NT wrapper. information passed back is either the open_action -// for a create or the actual byte count or an operation. these should be passed -// back directly in the rxcontext. -// - -#define RxSetIoStatusStatus(RXCONTEXT, STATUS) \ - (RXCONTEXT)->CurrentIrp->IoStatus.Status = (STATUS) - -#define RxSetIoStatusInfo(RXCONTEXT, INFORMATION) \ - ((RXCONTEXT))->CurrentIrp->IoStatus.Information = (INFORMATION) - -#define RxGetIoStatusInfo(RXCONTEXT) \ - ((RXCONTEXT)->CurrentIrp->IoStatus.Information) - -#define RxShouldPostCompletion() ((KeGetCurrentIrql() >= DISPATCH_LEVEL)) - -// -// The mini rdr's register/unregister with the RDBSS whenever they are loaded/unloaded. -// The registartion process is a two way hand shake in which the mini rdr informs the RDBSS -// by invoking the registartion routine. The RDBSS completes the initialization by invoking -// the Start routine in the dispatch vector. -// - -#define RX_REGISTERMINI_FLAG_DONT_PROVIDE_UNCS 0x00000001 -#define RX_REGISTERMINI_FLAG_DONT_PROVIDE_MAILSLOTS 0x00000002 -#define RX_REGISTERMINI_FLAG_DONT_INIT_DRIVER_DISPATCH 0x00000004 -#define RX_REGISTERMINI_FLAG_DONT_INIT_PREFIX_N_SCAVENGER 0x00000008 -#define RX_REGISTERMINI_FLAG_DONT_USE_VISTA_REDIRECTOR 0x00000010 - -NTSTATUS -NTAPI -RxRegisterMinirdr ( - OUT PRDBSS_DEVICE_OBJECT *DeviceObject, // the deviceobject that was created - IN OUT PDRIVER_OBJECT DriverObject, // the minirdr driver object - IN PMINIRDR_DISPATCH MrdrDispatch, // the mini rdr dispatch vector - IN ULONG Controls, - IN PUNICODE_STRING DeviceName, - IN ULONG DeviceExtensionSize, - IN DEVICE_TYPE DeviceType, - IN ULONG DeviceCharacteristics - ); - -VOID -NTAPI -RxMakeLateDeviceAvailable ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -VOID -NTAPI -__RxFillAndInstallFastIoDispatch ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN OUT PFAST_IO_DISPATCH FastIoDispatch, - IN ULONG FastIoDispatchSize - ); -#define RxFillAndInstallFastIoDispatch(__devobj,__fastiodisp) {\ - __RxFillAndInstallFastIoDispatch(&__devobj->RxDeviceObject,\ - &__fastiodisp, \ - sizeof(__fastiodisp)); \ - } - -VOID -NTAPI -RxpUnregisterMinirdr ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -NTSTATUS -RxStartMinirdr ( - IN PRX_CONTEXT RxContext, - OUT PBOOLEAN PostToFsp - ); - -NTSTATUS -RxStopMinirdr ( - IN PRX_CONTEXT RxContext, - OUT PBOOLEAN PostToFsp - ); - -NTSTATUS -RxSetDomainForMailslotBroadcast ( - IN PUNICODE_STRING DomainName - ); - -NTSTATUS -RxFsdDispatch ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN PIRP Irp - ); - -typedef -NTSTATUS -(NTAPI *PMRX_CALLDOWN) ( - IN OUT PRX_CONTEXT RxContext - ); - -typedef -NTSTATUS -(NTAPI *PMRX_CALLDOWN_CTX) ( - IN OUT PRX_CONTEXT RxContext, - IN OUT PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -typedef -NTSTATUS -(NTAPI *PMRX_CHKDIR_CALLDOWN) ( - IN OUT PRX_CONTEXT RxContext, - IN PUNICODE_STRING DirectoryName - ); - -typedef -NTSTATUS -(NTAPI *PMRX_CHKFCB_CALLDOWN) ( - IN PFCB Fcb1, - IN PFCB Fcb2 - ); - -// -// The two important abstractions used in the interface between the mini rdr and RDBSS are -// Server Calls and Net Roots. The former corresponds to the context associated with a -// server with which a connection has been established and the later corresponds to a -// share on a server ( This could also be viewed as a portion of the name space which has -// been claimed by a mini rdr). -// -// The creation of Server calls and net roots typically involve atleast one network round trip. -// In order to provide for asynchronous operations to continue these operations are modelled -// as a two phase activity. Each calldown to a mini rdr for creating a server call and net root is -// accompanied by a callup from the mini rdr to the RDBSS notifying with the completion status -// of the request. Currently these are synchronous! -// -// The creation of Srv calls is further complicated by the fact that the RDBSS has to choose -// from a number of mini rdr's to establish a connection with a server. In order to provide -// the RDBSS with maximum flexibility in choosing the mini rdr's that it wishes to deploy the -// creation of server calls involves a third phase in which the RDBSS notifies the mini rdr of -// a winner. All the losing mini rdrs destroy the associated context. -// - -typedef enum _RX_BLOCK_CONDITION { - Condition_Uninitialized = 0, - Condition_InTransition, - Condition_Closing, - Condition_Good, - Condition_Bad, - Condition_Closed - } RX_BLOCK_CONDITION, *PRX_BLOCK_CONDITION; - -#define StableCondition(X) ((X) >= Condition_Good) - -// -// The routine for notifying the RDBSS about the completion status of the NetRoot creation -// request. -// - -typedef -VOID -(NTAPI *PMRX_NETROOT_CALLBACK) ( - IN OUT PMRX_CREATENETROOT_CONTEXT CreateContext - ); - -// -// this routine allows the minirdr to specify the netrootname. NetRootName and RestOfName are set -// to point to the appropriate places within FilePathName. SrvCall is used to find the lengthof the srvcallname. -// - -typedef -VOID -(NTAPI *PMRX_EXTRACT_NETROOT_NAME) ( - IN PUNICODE_STRING FilePathName, - IN PMRX_SRV_CALL SrvCall, - OUT PUNICODE_STRING NetRootName, - OUT PUNICODE_STRING RestOfName OPTIONAL - ); -// -// The resumption context for the RDBSS. -// - -typedef struct _MRX_CREATENETROOT_CONTEXT { - PRX_CONTEXT RxContext; - PV_NET_ROOT pVNetRoot; - KEVENT FinishEvent; - NTSTATUS VirtualNetRootStatus; - NTSTATUS NetRootStatus; - RX_WORK_QUEUE_ITEM WorkQueueItem; - PMRX_NETROOT_CALLBACK Callback; -} MRX_CREATENETROOT_CONTEXT, *PMRX_CREATENETROOT_CONTEXT; - -// -// the calldown from RDBSS to the mini rdr for creating a netroot. -// - -typedef -NTSTATUS -(NTAPI *PMRX_CREATE_V_NET_ROOT) ( - IN OUT PMRX_CREATENETROOT_CONTEXT Context - ); - -// -// the calldown for querying a net root state. -// - -typedef -NTSTATUS -(NTAPI *PMRX_UPDATE_NETROOT_STATE) ( - IN OUT PMRX_NET_ROOT NetRoot - ); - -// -// The resumption context for the RDBSS. -// -typedef struct _MRX_SRVCALL_CALLBACK_CONTEXT { - struct _MRX_SRVCALLDOWN_STRUCTURE *SrvCalldownStructure; // could be computed - ULONG CallbackContextOrdinal; - PRDBSS_DEVICE_OBJECT RxDeviceObject; - NTSTATUS Status; - PVOID RecommunicateContext; -} MRX_SRVCALL_CALLBACK_CONTEXT, *PMRX_SRVCALL_CALLBACK_CONTEXT; - - -// -// The routine for notifying the RDBSS about the completion status of the SrvCall creation -// request. -// - -typedef -VOID -(NTAPI *PMRX_SRVCALL_CALLBACK) ( - IN OUT PMRX_SRVCALL_CALLBACK_CONTEXT Context - ); - -// -// The context passed from the RDBSS to the mini rdr for creating a server call. -// - -typedef struct _MRX_SRVCALLDOWN_STRUCTURE { - KEVENT FinishEvent; - LIST_ENTRY SrvCalldownList; - PRX_CONTEXT RxContext; - PMRX_SRV_CALL SrvCall; - PMRX_SRVCALL_CALLBACK CallBack; - BOOLEAN CalldownCancelled; - ULONG NumberRemaining; - ULONG NumberToWait; - ULONG BestFinisherOrdinal; - PRDBSS_DEVICE_OBJECT BestFinisher; - MRX_SRVCALL_CALLBACK_CONTEXT CallbackContexts[1]; -} MRX_SRVCALLDOWN_STRUCTURE; - -// -// the calldown from the RDBSS to the mini rdr for creating a server call -// - -typedef -NTSTATUS -(NTAPI *PMRX_CREATE_SRVCALL) ( - IN OUT PMRX_SRV_CALL SrvCall, - IN OUT PMRX_SRVCALL_CALLBACK_CONTEXT SrvCallCallBackContext - ); -// -// the calldown from the RDBSS to the mini rdr for notifying the mini rdr's of the winner. -// - -typedef -NTSTATUS -(NTAPI *PMRX_SRVCALL_WINNER_NOTIFY)( - IN OUT PMRX_SRV_CALL SrvCall, - IN BOOLEAN ThisMinirdrIsTheWinner, - IN OUT PVOID RecommunicateContext - ); - -// -// The prototypes for calldown routines relating to various file system operations -// - -typedef -VOID -(NTAPI *PMRX_NEWSTATE_CALLDOWN) ( - IN OUT PVOID Context - ); - -typedef -NTSTATUS -(NTAPI *PMRX_DEALLOCATE_FOR_FCB) ( - IN OUT PMRX_FCB Fcb - ); - -typedef -NTSTATUS -(NTAPI *PMRX_DEALLOCATE_FOR_FOBX) ( - IN OUT PMRX_FOBX Fobx - ); - -typedef -NTSTATUS -(NTAPI *PMRX_IS_LOCK_REALIZABLE) ( - IN OUT PMRX_FCB Fcb, - IN PLARGE_INTEGER ByteOffset, - IN PLARGE_INTEGER Length, - IN ULONG LowIoLockFlags - ); - -typedef -NTSTATUS -(NTAPI *PMRX_FORCECLOSED_CALLDOWN) ( - IN OUT PMRX_SRV_OPEN SrvOpen - ); - -typedef -NTSTATUS -(NTAPI *PMRX_FINALIZE_SRVCALL_CALLDOWN) ( - IN OUT PMRX_SRV_CALL SrvCall, - IN BOOLEAN Force - ); - -typedef -NTSTATUS -(NTAPI *PMRX_FINALIZE_V_NET_ROOT_CALLDOWN) ( - IN OUT PMRX_V_NET_ROOT VirtualNetRoot, - IN PBOOLEAN Force - ); - -typedef -NTSTATUS -(NTAPI *PMRX_FINALIZE_NET_ROOT_CALLDOWN) ( - IN OUT PMRX_NET_ROOT NetRoot, - IN PBOOLEAN Force - ); - -typedef -ULONG -(NTAPI *PMRX_EXTENDFILE_CALLDOWN) ( - IN OUT PRX_CONTEXT RxContext, - IN OUT PLARGE_INTEGER NewFileSize, - OUT PLARGE_INTEGER NewAllocationSize - ); - -typedef -BOOLEAN -(*PRX_LOCK_ENUMERATOR) ( - IN OUT PMRX_SRV_OPEN SrvOpen, - IN OUT PVOID *ContinuationHandle, - OUT PLARGE_INTEGER FileOffset, - OUT PLARGE_INTEGER LockRange, - OUT PBOOLEAN IsLockExclusive - ); -typedef -NTSTATUS -(NTAPI *PMRX_CHANGE_BUFFERING_STATE_CALLDOWN) ( - IN OUT PRX_CONTEXT RxContext, - IN OUT PMRX_SRV_OPEN SrvOpen, - IN PVOID MRxContext - ); - -typedef -NTSTATUS -(NTAPI *PMRX_PREPARSE_NAME) ( - IN OUT PRX_CONTEXT RxContext, - IN PUNICODE_STRING Name - ); - -typedef -NTSTATUS -(NTAPI *PMRX_GET_CONNECTION_ID) ( - IN OUT PRX_CONTEXT RxContext, - IN OUT PRX_CONNECTION_ID UniqueId - ); - -// -// Buffering state/Policy management TBD -// -typedef enum _MINIRDR_BUFSTATE_COMMANDS { - MRDRBUFSTCMD__COMMAND_FORCEPURGE0, - MRDRBUFSTCMD__1, - MRDRBUFSTCMD__2, - MRDRBUFSTCMD__3, - MRDRBUFSTCMD__4, - MRDRBUFSTCMD__5, - MRDRBUFSTCMD__6, - MRDRBUFSTCMD__7, - MRDRBUFSTCMD__8, - MRDRBUFSTCMD__9, - MRDRBUFSTCMD__10, - MRDRBUFSTCMD__11, - MRDRBUFSTCMD__12, - MRDRBUFSTCMD__13, - MRDRBUFSTCMD__14, - MRDRBUFSTCMD__15, - MRDRBUFSTCMD__16, - MRDRBUFSTCMD__17, - MRDRBUFSTCMD__18, - MRDRBUFSTCMD__19, - MRDRBUFSTCMD__20, - MRDRBUFSTCMD__21, - MRDRBUFSTCMD__22, - MRDRBUFSTCMD__23, - MRDRBUFSTCMD__24, - MRDRBUFSTCMD__25, - MRDRBUFSTCMD__26, - MRDRBUFSTCMD__27, - MRDRBUFSTCMD__28, - MRDRBUFSTCMD__29, - MRDRBUFSTCMD__30, - MRDRBUFSTCMD__31, - MRDRBUFSTCMD_MAXXX -} MINIRDR_BUFSTATE_COMMANDS; - - -#define MINIRDR_BUFSTATE_COMMAND_FORCEPURGE 0x00000001 -#define MINIRDR_BUFSTATE_COMMAND_MASK ((MINIRDR_BUFSTATE_COMMAND_FORCEPURGE)) - -typedef -NTSTATUS -(NTAPI *PMRX_COMPUTE_NEW_BUFFERING_STATE) ( - IN OUT PMRX_SRV_OPEN SrvOpen, - IN PVOID MRxContext, - OUT PULONG NewBufferingState - ); - -typedef enum _LOWIO_OPS { - LOWIO_OP_READ=0, - LOWIO_OP_WRITE, - LOWIO_OP_SHAREDLOCK, - LOWIO_OP_EXCLUSIVELOCK, - LOWIO_OP_UNLOCK, - LOWIO_OP_UNLOCK_MULTIPLE, - //LOWIO_OP_UNLOCKALLBYKEY, - LOWIO_OP_FSCTL, - LOWIO_OP_IOCTL, - LOWIO_OP_NOTIFY_CHANGE_DIRECTORY, - LOWIO_OP_CLEAROUT, - LOWIO_OP_MAXIMUM -} LOWIO_OPS; - -typedef -NTSTATUS -(NTAPI *PLOWIO_COMPLETION_ROUTINE) ( - IN PRX_CONTEXT RxContext - ); - -typedef LONGLONG RXVBO; - -// -// we may, at some point, want a smarter implementation of this. we don't statically allocate the first -// element because that would make unlock behind much harder. -// - -typedef struct _LOWIO_LOCK_LIST { - - struct _LOWIO_LOCK_LIST * Next; - ULONG LockNumber; - RXVBO ByteOffset; - LONGLONG Length; - BOOLEAN ExclusiveLock; - ULONG Key; - -} LOWIO_LOCK_LIST, *PLOWIO_LOCK_LIST; - -VOID -NTAPI -RxFinalizeLockList( - struct _RX_CONTEXT *RxContext - ); - -typedef struct _XXCTL_LOWIO_COMPONENT { - ULONG Flags; - union { - ULONG FsControlCode; - ULONG IoControlCode; - }; - ULONG InputBufferLength; - PVOID pInputBuffer; - ULONG OutputBufferLength; - PVOID pOutputBuffer; - UCHAR MinorFunction; -} XXCTL_LOWIO_COMPONENT; - -typedef struct _LOWIO_CONTEXT { - USHORT Operation; // padding! - USHORT Flags; - PLOWIO_COMPLETION_ROUTINE CompletionRoutine; - PERESOURCE Resource; - ERESOURCE_THREAD ResourceThreadId; - union { - struct { - ULONG Flags; - PMDL Buffer; - RXVBO ByteOffset; - ULONG ByteCount; - ULONG Key; - PNON_PAGED_FCB NonPagedFcb; - } ReadWrite; - struct { - union { - PLOWIO_LOCK_LIST LockList; - LONGLONG Length; - }; - // - // these fields are not used if locklist is used - // - - ULONG Flags; - RXVBO ByteOffset; - ULONG Key; - } Locks; - XXCTL_LOWIO_COMPONENT FsCtl; - XXCTL_LOWIO_COMPONENT IoCtl; // these must be the same - struct { - BOOLEAN WatchTree; - ULONG CompletionFilter; - ULONG NotificationBufferLength; - PVOID pNotificationBuffer; - } NotifyChangeDirectory; - } ParamsFor; -} LOWIO_CONTEXT; - -#define LOWIO_CONTEXT_FLAG_SYNCCALL 0x0001 // this is set if lowiocompletion is called from lowiosubmit -#define LOWIO_CONTEXT_FLAG_SAVEUNLOCKS 0x0002 // WRAPPER INTERNAL: on NT, it means the unlock routine add unlocks to the list -#define LOWIO_CONTEXT_FLAG_LOUDOPS 0x0004 // WRAPPER INTERNAL: on NT, it means read and write routines generate dbg output -#define LOWIO_CONTEXT_FLAG_CAN_COMPLETE_AT_DPC_LEVEL 0x0008 // WRAPPER INTERNAL: on NT, it means the completion routine maybe can - // complete when called at DPC. otherwise it cannnot. currently - // none can. - -#define LOWIO_READWRITEFLAG_PAGING_IO 0x01 -#define LOWIO_READWRITEFLAG_EXTENDING_FILESIZE 0x02 -#define LOWIO_READWRITEFLAG_EXTENDING_VDL 0x04 - -// -// these must match the SL_ values in io.h (ntifs.h) since the flags field is just copied -// - -#define LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY 0x01 -#define LOWIO_LOCKSFLAG_EXCLUSIVELOCK 0x02 - -#if (LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY!=SL_FAIL_IMMEDIATELY) -#error LOWIO_LOCKSFLAG_FAIL_IMMEDIATELY!=SL_FAIL_IMMEDIATELY -#endif -#if (LOWIO_LOCKSFLAG_EXCLUSIVELOCK!=SL_EXCLUSIVE_LOCK) -#error LOWIO_LOCKSFLAG_EXCLUSIVELOCK!=SL_EXCLUSIVE_LOCK -#endif - -// -// The six important data structures (SRV_CALL,NET_ROOT,V_NET_ROOT,FCB,SRV_OPEN and -// FOBX) that are an integral part of the mini rdr architecture have a corresponding -// counterpart in every mini rdr implementation. In order to provide maximal flexibility -// and at the same time enhance performance the sizes and the desired allocation -// behaviour are communicated at the registration time of a mini rdr. -// -// There is no single way in which these extensions can be managed which will -// address the concerns of flexibility as well as performance. The solution adopted -// in the current architecture that meets the dual goals in most cases. The solution -// and the rationale is as follows ... -// -// Each mini rdr implementor specifies the size of the data structure extensions -// alongwith a flag specfying if the allocation/free of the extensions are to be -// managed by the wrapper. -// -// In all those cases where a one to one relationship exists between the wrapper -// data structure and the corresponding mini rdr counterpart specifying the flag -// results in maximal performance gains. There are a certain data structures for -// which many instances of a wrapper data structure map onto the same extension in -// the mini redirector. In such cases the mini rdr implementor will be better off -// managing the allocation/deallocation of the data structure extension without the -// intervention of the wrapper. -// -// Irrespective of the mechanism choosen the convention is to always associate the -// extension with the Context field in the corresponding RDBSS data structure. -// !!!NO EXCEPTIONS!!! -// -// The remaining field in all the RDBSS data structures, i.e., Context2 is left to -// the discretion og the mini rdr implementor. -// -// -// The SRV_CALL extension is not handled currently. This is because of further fixes -// required in RDBSS w.r.t the mecahsnism used to select the mini rdr and to allow several -// minis to share the srvcall. -// -// Please do not use it till further notice; rather, the mini should manage its own srcall -// storage. There is a finalization calldown that assists in this endeavor. -// - -#define RDBSS_MANAGE_SRV_CALL_EXTENSION (0x1) -#define RDBSS_MANAGE_NET_ROOT_EXTENSION (0x2) -#define RDBSS_MANAGE_V_NET_ROOT_EXTENSION (0x4) -#define RDBSS_MANAGE_FCB_EXTENSION (0x8) -#define RDBSS_MANAGE_SRV_OPEN_EXTENSION (0x10) -#define RDBSS_MANAGE_FOBX_EXTENSION (0x20) - -#define RDBSS_NO_DEFERRED_CACHE_READAHEAD (0x1000) - -typedef struct _MINIRDR_DISPATCH { - - // - // Normal Header - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // Flags to control the allocation of extensions. - // and various other per-minirdr policies - // - - ULONG MRxFlags; - - // - // size of the SRV_CALL extensions - // - - ULONG MRxSrvCallSize; - - // - // size of the NET_ROOT extensions - // - - ULONG MRxNetRootSize; - - // - // size of the V_NET_ROOT extensions - // - - ULONG MRxVNetRootSize; - - // - // size of FCB extensions - // - - ULONG MRxFcbSize; - - // - // size of SRV_OPEN extensions - // - - ULONG MRxSrvOpenSize; - - // - // size of FOBX extensions - // - - ULONG MRxFobxSize; - - // - // Call downs for starting/stopping the mini rdr - // - - PMRX_CALLDOWN_CTX MRxStart; - PMRX_CALLDOWN_CTX MRxStop; - - // - // Call down for cancelling outstanding requests - // - - PMRX_CALLDOWN MRxCancel; - - // - // Call downs related to creating/opening/closing file system objects - // - - PMRX_CALLDOWN MRxCreate; - PMRX_CALLDOWN MRxCollapseOpen; - PMRX_CALLDOWN MRxShouldTryToCollapseThisOpen; - PMRX_CALLDOWN MRxFlush; - PMRX_CALLDOWN MRxZeroExtend; - PMRX_CALLDOWN MRxTruncate; - PMRX_CALLDOWN MRxCleanupFobx; - PMRX_CALLDOWN MRxCloseSrvOpen; - PMRX_DEALLOCATE_FOR_FCB MRxDeallocateForFcb; - PMRX_DEALLOCATE_FOR_FOBX MRxDeallocateForFobx; - PMRX_IS_LOCK_REALIZABLE MRxIsLockRealizable; - PMRX_FORCECLOSED_CALLDOWN MRxForceClosed; - PMRX_CHKFCB_CALLDOWN MRxAreFilesAliased; - - // - // call downs related to nonNT style printing.....note that the connect goes thru - // the normal srvcall/netroot interface - // - - PMRX_CALLDOWN MRxOpenPrintFile; - PMRX_CALLDOWN MRxClosePrintFile; - PMRX_CALLDOWN MRxWritePrintFile; - PMRX_CALLDOWN MRxEnumeratePrintQueue; - - // - // call downs related to unsatisfied requests, i.e., time outs - // - - PMRX_CALLDOWN MRxClosedSrvOpenTimeOut; - PMRX_CALLDOWN MRxClosedFcbTimeOut; - - // - // call downs related to query/set information on file system objects - // - - PMRX_CALLDOWN MRxQueryDirectory; - PMRX_CALLDOWN MRxQueryFileInfo; - PMRX_CALLDOWN MRxSetFileInfo; - PMRX_CALLDOWN MRxSetFileInfoAtCleanup; - PMRX_CALLDOWN MRxQueryEaInfo; - PMRX_CALLDOWN MRxSetEaInfo; - PMRX_CALLDOWN MRxQuerySdInfo; - PMRX_CALLDOWN MRxSetSdInfo; - PMRX_CALLDOWN MRxQueryQuotaInfo; - PMRX_CALLDOWN MRxSetQuotaInfo; - PMRX_CALLDOWN MRxQueryVolumeInfo; - PMRX_CALLDOWN MRxSetVolumeInfo; - PMRX_CHKDIR_CALLDOWN MRxIsValidDirectory; - - // - // call downs related to buffer management - // - - PMRX_COMPUTE_NEW_BUFFERING_STATE MRxComputeNewBufferingState; - - // - // call downs related to Low I/O management (reads/writes on file system objects) - // - - PMRX_CALLDOWN MRxLowIOSubmit[LOWIO_OP_MAXIMUM+1]; - PMRX_EXTENDFILE_CALLDOWN MRxExtendForCache; - PMRX_EXTENDFILE_CALLDOWN MRxExtendForNonCache; - PMRX_CHANGE_BUFFERING_STATE_CALLDOWN MRxCompleteBufferingStateChangeRequest; - - // - // call downs related to name space management - // - - PMRX_CREATE_V_NET_ROOT MRxCreateVNetRoot; - PMRX_FINALIZE_V_NET_ROOT_CALLDOWN MRxFinalizeVNetRoot; - PMRX_FINALIZE_NET_ROOT_CALLDOWN MRxFinalizeNetRoot; - PMRX_UPDATE_NETROOT_STATE MRxUpdateNetRootState; - PMRX_EXTRACT_NETROOT_NAME MRxExtractNetRootName; - - // - // call downs related to establishing connections with servers - // - - PMRX_CREATE_SRVCALL MRxCreateSrvCall; - PMRX_CREATE_SRVCALL MRxCancelCreateSrvCall; - PMRX_SRVCALL_WINNER_NOTIFY MRxSrvCallWinnerNotify; - PMRX_FINALIZE_SRVCALL_CALLDOWN MRxFinalizeSrvCall; - - PMRX_CALLDOWN MRxDevFcbXXXControlFile; - - // - // New calldowns - // - - // - // Allow a client to preparse the name - // - - PMRX_PREPARSE_NAME MRxPreparseName; - - // - // call down for controlling multi-plexing - // - - PMRX_GET_CONNECTION_ID MRxGetConnectionId; - - // - // New field to allow mini-rdrs to specify - // scavenger time interval (in seconds) - // - ULONG ScavengerTimeout; - -} MINIRDR_DISPATCH, *PMINIRDR_DISPATCH; - - -#endif // _RXMINIRDR_ - - - - diff --git a/qt-correction-tool/pub/ddk/mrxfcb.h b/qt-correction-tool/pub/ddk/mrxfcb.h deleted file mode 100644 index a78fa60..0000000 --- a/qt-correction-tool/pub/ddk/mrxfcb.h +++ /dev/null @@ -1,822 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - mrxfFcb.h - -Abstract: - - This module defines the macros/inline functions and function prototypes used by - the mini redirectors to access the RDBSS wrapper data structures. - - IMPORTANT: All mini redirector writers cannot and should not make any assumptions - about the layout of the RDBSS wrapper data structures. They are not guaranteed to - be the same across platforms and even on a single platform are liable to change - across versions. - - The following six data structure abstractions are available to the mini - redirector writer. - - 1) Server Call Context (SRV_CALL) - The context associated with each known file system server. - - 2) Net Roots (NET_ROOT) - The root of a file system volume( local/remote) opened by the user. - - 3) Virtual Net Roots (V_NET_ROOT) - The view of a file system volume on a server. The view can be - constrained along multiple dimensions. As an example the view can be - associated with a logon id. which will constrain the operations that - can be performed on the file system volume. - - 4) File Control Blocks (FCB) - The RDBSS data structure associated with each unique file opened. - - 5) File Object Extensions (FOXB) - - 6) ServerSide Open Context (SRV_OPEN) - - A common convention that is adopted for defining Flags in all of these data structures - is to define a ULONG ( 32 ) flags and split them into two groups -- those that are visible - to the mini redirector and those that are invisible. These flags are not meant for use - by the mini redirector writers and are reserved for the wrapper. - -Author: -Revision History: - ---*/ - -#ifndef __MRXFCB_H__ -#define __MRXFCB_H__ - -// -// The SRVCALL flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs. -// The visible ones are defined above and the definitions for the invisible ones can be found -// in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible -// to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be -// enforced in defining new flags. -// - -#define SRVCALL_FLAG_MAILSLOT_SERVER (0x1) -#define SRVCALL_FLAG_FILE_SERVER (0x2) -#define SRVCALL_FLAG_CASE_INSENSITIVE_NETROOTS (0x4) -#define SRVCALL_FLAG_CASE_INSENSITIVE_FILENAMES (0x8) -#define SRVCALL_FLAG_DFS_AWARE_SERVER (0x10) -#define SRVCALL_FLAG_FORCE_FINALIZED (0x20) -#define SRVCALL_FLAG_LWIO_AWARE_SERVER (0x40) -#define SRVCALL_FLAG_LOOPBACK_SERVER (0x80) - -typedef struct _MRX_NORMAL_NODE_HEADER { - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - __volatile ULONG NodeReferenceCount; -} MRX_NORMAL_NODE_HEADER; - -#ifdef __cplusplus -typedef struct _MRX_SRV_CALL_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_SRV_CALL_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // the context fields for extensions required by the mini redirectors - // - - PVOID Context; - PVOID Context2; - - // - // Associated DeviceObject which also contains the dispatch vector - // - - PRDBSS_DEVICE_OBJECT RxDeviceObject; - - // - // the srv call name, the server principal name and the server domain name. - // - - PUNICODE_STRING pSrvCallName; - PUNICODE_STRING pPrincipalName; - PUNICODE_STRING pDomainName; - - // - // Flags used to denote the state of the SRV_CALL. - // - - ULONG Flags; - - // - // Server parameters updated by the mini redirectors. - // - - LONG MaximumNumberOfCloseDelayedFiles; - - // - // Status return from the transport in case of failure - // - - NTSTATUS Status; - -} MRX_SRV_CALL, *PMRX_SRV_CALL; - -// -// The various types of NET_ROOT's currently supported by the wrapper. -// - -#define NET_ROOT_DISK ((UCHAR)0) -#define NET_ROOT_PIPE ((UCHAR)1) -#define NET_ROOT_COMM ((UCHAR)2) -#define NET_ROOT_PRINT ((UCHAR)3) -#define NET_ROOT_WILD ((UCHAR)4) -#define NET_ROOT_MAILSLOT ((UCHAR)5) - -typedef UCHAR NET_ROOT_TYPE, *PNET_ROOT_TYPE; - -// -// The pipe buffer size for transferring cannot be larger than 0xffff -// - -#define MAX_PIPE_BUFFER_SIZE 0xFFFF - -// -// The possible states associated with a NET_ROOT. These have been defined to be -// line with the definitions foe the LanManager service to avoid redundant mappings. -// These MUST agree with sdkinc\lmuse.h use_ok, etc..... -// - -#define MRX_NET_ROOT_STATE_GOOD ((UCHAR)0) -#define MRX_NET_ROOT_STATE_PAUSED ((UCHAR)1) -#define MRX_NET_ROOT_STATE_DISCONNECTED ((UCHAR)2) -#define MRX_NET_ROOT_STATE_ERROR ((UCHAR)3) -#define MRX_NET_ROOT_STATE_CONNECTED ((UCHAR)4) -#define MRX_NET_ROOT_STATE_RECONN ((UCHAR)5) - -typedef UCHAR MRX_NET_ROOT_STATE, *PMRX_NET_ROOT_STATE; - -// -// The file systems on the remote servers provide varying levels of functionality to -// detect aliasing between file names. As an example consider two shares on the same -// file system volume. In the absence of any support from the file system on the server -// the correct and conservative approach is to flush all the files to the server as -// opposed to all the files on the same NET_ROOT to preserve coherency and handle -// delayed close operations. -// - -#define MRX_PURGE_SAME_NETROOT ((UCHAR)0) -#define MRX_PURGE_SAME_SRVCALL ((UCHAR)1) - -// -// these are not implemented yet.... -// #define MRX_PURGE_SAME_FCB ((UCHAR)2) -// #define MRX_PURGE_SAME_VOLUME ((UCHAR)3) -// #define MRX_PURGE_ALL ((UCHAR)4) -// - -typedef UCHAR MRX_PURGE_RELATIONSHIP, *PMRX_PURGE_RELATIONSHIP; - -#define MRX_PURGE_SYNC_AT_NETROOT ((UCHAR)0) -#define MRX_PURGE_SYNC_AT_SRVCALL ((UCHAR)1) - -typedef UCHAR MRX_PURGE_SYNCLOCATION, *PMRX_PURGE_SYNCLOCATION; - -// -// The NET_ROOT flags are split into two groups, i.e., visible to mini rdrs and -// invisible to mini rdrs. The visible ones are defined above and the definitions -// for the invisible ones can be found in fcb.h. The convention that has been -// adopted is that the lower 16 flags will be visible to the mini rdr and the -// upper 16 flags will be reserved for the wrapper. This needs to be enforced -// in defining new flags. -// - -#define NETROOT_FLAG_SUPPORTS_SYMBOLIC_LINKS ( 0x0001 ) -#define NETROOT_FLAG_DFS_AWARE_NETROOT ( 0x0002 ) -#define NETROOT_FLAG_DEFER_READAHEAD ( 0x0004 ) -#define NETROOT_FLAG_VOLUMEID_INITIALIZED ( 0x0008 ) -#define NETROOT_FLAG_FINALIZE_INVOKED ( 0x0010 ) -#define NETROOT_FLAG_UNIQUE_FILE_NAME ( 0x0020 ) - -// -// Read ahead amount used for normal data files (32k) -// - -#define DEFAULT_READ_AHEAD_GRANULARITY (0x08000) - -// -// the wrapper implements throttling for certain kinds of operations: -// PeekNamedPipe/ReadNamedPipe -// LockFile -// -// a minirdr can set the timing parameters for this in the netroot. leaving them -// as zero will disable throttling. -// - -typedef struct _NETROOT_THROTTLING_PARAMETERS { - - // - // Supplies the increase in delay in milliseconds, each time a request - // to the network fails. - // - - ULONG Increment; - - // - // Supplies the longest delay the backoff package can introduce - // in milliseconds. - - ULONG MaximumDelay; - -} NETROOT_THROTTLING_PARAMETERS, *PNETROOT_THROTTLING_PARAMETERS; - -#define RxInitializeNetRootThrottlingParameters(__tp,__incr,__maxdelay) { \ - PNETROOT_THROTTLING_PARAMETERS tp = (__tp); \ - tp->Increment = (__incr); \ - tp->MaximumDelay = (__maxdelay); \ -} - -#ifdef __cplusplus -typedef struct _MRX_NET_ROOT_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_NET_ROOT_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // - // the MRX_SRV_CALL instance with which this MRX_NET_ROOT instance is associated - // - - PMRX_SRV_CALL pSrvCall; - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // the context fields used by the mini redirectors for recording - // additional state. - // - - PVOID Context; - PVOID Context2; - - // - // The flags used to denote the state of the NET_ROOT instance. - // - - ULONG Flags; - - // - // We count the number of fcbs, srvopens on the netroot - // - - __volatile ULONG NumberOfFcbs; - __volatile ULONG NumberOfSrvOpens; - - // - // The current state and the purge relationships based on the support - // provided by the file system on the server. - // - - MRX_NET_ROOT_STATE MRxNetRootState; - NET_ROOT_TYPE Type; - MRX_PURGE_RELATIONSHIP PurgeRelationship; - MRX_PURGE_SYNCLOCATION PurgeSyncLocation; - - // - // the type of device, i.e., file system volume, printer, com port etc. - // - - DEVICE_TYPE DeviceType; - - // - // Name of the NET_ROOT instance - // - - PUNICODE_STRING pNetRootName; - - // - // the name to be prepended to all FCBS associated with this NET_ROOT - // - - UNICODE_STRING InnerNamePrefix; - - // - // Parameters based upon the type of the NET_ROOT. - // - - ULONG ParameterValidationStamp; - union { - struct { - ULONG DataCollectionSize; - NETROOT_THROTTLING_PARAMETERS PipeReadThrottlingParameters; - } NamedPipeParameters; - - struct { - ULONG ClusterSize; - ULONG ReadAheadGranularity; - NETROOT_THROTTLING_PARAMETERS LockThrottlingParameters; - ULONG RenameInfoOverallocationSize; //could be a USHORT - GUID VolumeId; - } DiskParameters; - }; -} MRX_NET_ROOT, *PMRX_NET_ROOT; - -// -// The VNET_ROOT flags are split into two groups, i.e., visible to mini rdrs and -// invisible to mini rdrs. The visible ones are defined below and the definitions -// for the invisible ones can be found in fcb.h. The convention that has been -// adopted is that the lower 16 flags will be visible to the mini rdr and the -// upper 16 flags will be reserved for the wrapper. This needs to be enforced -// in defining new flags. -// - -#define VNETROOT_FLAG_CSCAGENT_INSTANCE 0x00000001 -#define VNETROOT_FLAG_FINALIZE_INVOKED 0x00000002 -#define VNETROOT_FLAG_FORCED_FINALIZE 0x00000004 -#define VNETROOT_FLAG_NOT_FINALIZED 0x00000008 - -#ifdef __cplusplus -typedef struct _MRX_V_NET_ROOT_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_V_NET_ROOT_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // - // the MRX_NET_ROOT instance with which the MRX_V_NET_ROOT instance is associated - // - - PMRX_NET_ROOT pNetRoot; - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // the context fields provided for storing additional information as deemed - // necessary by the mini redirectors - // - - PVOID Context; - PVOID Context2; - - ULONG Flags; - - // - // This field should not be updated by the mini redirectors. Its usage is intended - // to provide an easy mechanism for accessing certain state information - // - - ULONG NumberOfOpens; - - // - // We count the number of Fobxss on the virtual netroot - // - - __volatile ULONG NumberOfFobxs; - - // - // the security parameters associated with the V_NET_ROOT instance. - // - - LUID LogonId; - - // - // These are the parameters supplied by the used in a NtCreateFile call in - // which the FILE_CREATE_TREE_CONNECTION flag is specified as part of the - // CreateOptions. - // - - PUNICODE_STRING pUserDomainName; - PUNICODE_STRING pUserName; - PUNICODE_STRING pPassword; - ULONG SessionId; - NTSTATUS ConstructionStatus; - BOOLEAN IsExplicitConnection; -} MRX_V_NET_ROOT, *PMRX_V_NET_ROOT; - -// -// ALL FIELDS IN AN FCB ARE READONLY EXCEPT Context and Context2.... -// Also, Context is read only the the mini has specified RDBSS_MANAGE_FCB_EXTENSION -// - -typedef struct _MRX_FCB_ { - - FSRTL_ADVANCED_FCB_HEADER Header; - - // - // The MRX_NET_ROOT instance with which this is associated - // - - PMRX_NET_ROOT pNetRoot; - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // the context fields to store additional information as deemed necessary by the - // mini redirectors. - // - - PVOID Context; - PVOID Context2; - - // - // The reference count: in a different place because we must prefix with - // the FSRTL_COMMON_FCB_HEADER structure. - // - - __volatile ULONG NodeReferenceCount; - - // - // The internal state of the Fcb. THIS FIELD IS READONLY FOR MINIRDRS - // - - ULONG FcbState; - - // - // A count of the number of file objects that have been opened for - // this file/directory, but not yet been cleaned up yet. This count - // is only used for data file objects, not for the Acl or Ea stream - // file objects. This count gets decremented in RxCommonCleanup, - // while the OpenCount below gets decremented in RxCommonClose. - // - - __volatile CLONG UncleanCount; - - // - // A count of the number of file objects that have been opened for - // this file/directory, but not yet been cleaned up yet and for which - // cacheing is not supported. This is used in cleanup.c to tell if extra - // purges are required to maintain coherence. - // - - CLONG UncachedUncleanCount; - - // - // A count of the number of file objects that have opened - // this file/directory. For files & directories the FsContext of the - // file object points to this record. - // - - __volatile CLONG OpenCount; - - // - // The outstanding locks count: if this count is nonzero, the we silently - // ignore adding LOCK_BUFFERING in a ChangeBufferingState request. This field - // is manipulated by interlocked operations so you only have to have the fcb - // shared to manipulate it but you have to have it exclusive to use it. - // - - __volatile ULONG OutstandingLockOperationsCount; - - // - // The actual allocation length as opposed to the valid data length - // - - ULONGLONG ActualAllocationLength; - - // - // Attributes of the MRX_FCB, - // - - ULONG Attributes; - - // - // Intended for future use, currently used to round off allocation to - // DWORD boundaries. - // - - BOOLEAN IsFileWritten; - BOOLEAN fShouldBeOrphaned; - BOOLEAN fMiniInited; - - // - // Type of the associated MRX_NET_ROOT, intended to avoid pointer chasing. - // - - UCHAR CachedNetRootType; - - // - // Header for the list of srv_opens for this FCB.... - // THIS FIELD IS READONLY FOR MINIS - // - - LIST_ENTRY SrvOpenList; - - // - // changes whenever the list changes..prevents extra lookups - // THIS FIELD IS READONLY FOR MINIS - // - - ULONG SrvOpenListVersion; - -} MRX_FCB, *PMRX_FCB; - - -// -// The following flags define the various types of buffering that can be selectively -// enabled or disabled for each SRV_OPEN. -// - -#define SRVOPEN_FLAG_DONTUSE_READ_CACHING (0x1) -#define SRVOPEN_FLAG_DONTUSE_WRITE_CACHING (0x2) -#define SRVOPEN_FLAG_CLOSED (0x4) -#define SRVOPEN_FLAG_CLOSE_DELAYED (0x8) -#define SRVOPEN_FLAG_FILE_RENAMED (0x10) -#define SRVOPEN_FLAG_FILE_DELETED (0x20) -#define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING (0x40) -#define SRVOPEN_FLAG_COLLAPSING_DISABLED (0x80) -#define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_REQUESTS_PURGED (0x100) -#define SRVOPEN_FLAG_NO_BUFFERING_STATE_CHANGE (0x200) -#define SRVOPEN_FLAG_ORPHANED (0x400) - -typedef -NTSTATUS -(NTAPI *PMRX_SHADOW_CALLDOWN) ( - IN OUT struct _RX_CONTEXT * RxContext - ); - -// -// Minirdrs allocate, initialize and free this structure -// - -typedef struct { - - // - // Pointer to the file object associated with the handle. This is set - // after the handle is successfully created in the usermode. - // - - PFILE_OBJECT UnderlyingFileObject; - - // - // Pointer to the device object represented by the file object mentioned - // above. - // - - PDEVICE_OBJECT UnderlyingDeviceObject; - - ULONG LockKey; - - PFAST_IO_READ FastIoRead; - PFAST_IO_WRITE FastIoWrite; - - PMRX_SHADOW_CALLDOWN DispatchRoutine; - -} MRXSHADOW_SRV_OPEN, *PMRXSHADOW_SRV_OPEN; - -#ifdef __cplusplus -typedef struct _MRX_SRV_OPEN_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_SRV_OPEN_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // - // the MRX_FCB instance with which the SRV_OPEN is associated. - // - - PMRX_FCB pFcb; - - // - // the V_NET_ROOT instance with which the SRV_OPEN is associated - // - - PMRX_V_NET_ROOT pVNetRoot; - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // the context fields to store additional state information as deemed necessary - // by the mini redirectors - // - - PVOID Context; - PVOID Context2; - - // - // shadow context, mini-rdr allocates and deallocates this structure - // - - PMRXSHADOW_SRV_OPEN ShadowContext; - - // - // The flags are split into two groups, i.e., visible to mini rdrs and invisible - // to mini rdrs. The visible ones are defined above and the definitions for the - // invisible ones can be found in fcb.h. The convention that has been adopted is - // that the lower 16 flags will be visible to the mini rdr and the upper 16 flags - // will be reserved for the wrapper. This needs to be enforced in defining new flags. - // - - ULONG Flags; - - // - // the name alongwith the MRX_NET_ROOT prefix, i.e. fully qualified name - // - - PUNICODE_STRING pAlreadyPrefixedName; - - // - // the number of Fobx's associated with this open for which a cleanup IRP - // has not been processed. - // - - CLONG UncleanFobxCount; - - // - // the number of local opens associated with this open on the server - // - - CLONG OpenCount; - - // - // the Key assigned by the mini redirector for this SRV_OPEN. Since the various mini - // redirectors do not always get to pick the unique id for a open instance, the key - // used to identify the open to the server is different for different mini redirectors - // based upon the convention adopted at the server. - // - - PVOID Key; - - // - // the access and sharing rights specified for this SRV_OPEN. This is used in - // determining is subsequent open requests can be collapsed with an existing - // SRV_OPEN instance. - // - - ACCESS_MASK DesiredAccess; - ULONG ShareAccess; - ULONG CreateOptions; - - // - // The BufferingFlags field is temporal.....it does not really belong to the - // srvopen; rather the srvopen is used as a representative of the fcb. On - // each open, the bufferingflags field of the srvopen is taken as the minirdr's - // contribution to the buffering state. On an oplock break, a srvopen is passed - // (the one that's being broken) whose bufferflags field is taken as the new - // proxy. On a close that changes the minirdr's contribution, the minirdr should - // take steps to cause a ChangeBufferingState to the new state. - // - // just to reiterate, the field is just used to carry the information from - // the minirdr to RxChangeBufferingState and does not hold longterm coherent - // information. - // - - ULONG BufferingFlags; - - // - // List Entry to wire the SRV_OPEN to the list of SRV_OPENS maintained as - // part of theFCB - // THIS FIELD IS READONLY FOR MINIS - // - - ULONG ulFileSizeVersion; - - LIST_ENTRY SrvOpenQLinks; - -} MRX_SRV_OPEN, *PMRX_SRV_OPEN; - -#define FOBX_FLAG_DFS_OPEN (0x0001) -#define FOBX_FLAG_BAD_HANDLE (0x0002) -#define FOBX_FLAG_BACKUP_INTENT (0x0004) -#define FOBX_FLAG_NOT_USED (0x0008) - -#define FOBX_FLAG_FLUSH_EVEN_CACHED_READS (0x0010) -#define FOBX_FLAG_DONT_ALLOW_PAGING_IO (0x0020) -#define FOBX_FLAG_DONT_ALLOW_FASTIO_READ (0x0040) - -typedef struct _MRX_PIPE_HANDLE_INFORMATION { - - ULONG TypeOfPipe; - ULONG ReadMode; - ULONG CompletionMode; - -} MRX_PIPE_HANDLE_INFORMATION, *PMRX_PIPE_HANDLE_INFORMATION; - -#ifdef __cplusplus -typedef struct _MRX_FOBX_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_FOBX_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // - // the MRX_SRV_OPEN instance with which the FOBX is associated - // - - PMRX_SRV_OPEN pSrvOpen; - - // - // the FILE_OBJECT with which this FOBX is associated - // In certain instances the I/O subsystem creates a FILE_OBJECT instance - // on the stack in the interests of efficiency. In such cases this field - // is NULL. - // - - PFILE_OBJECT AssociatedFileObject; - - // - // !!!! changes above this require realignment with fcb.h - // - - // - // The fields provided to accomodate additional state to be associated - // by the various mini redirectors - // - - PVOID Context; - PVOID Context2; - - // - // The FOBX flags are split into two groups, i.e., visible to mini rdrs and invisible to mini rdrs. - // The visible ones are defined above and the definitions for the invisible ones can be found - // in fcb.h. The convention that has been adopted is that the lower 16 flags will be visible - // to the mini rdr and the upper 16 flags will be reserved for the wrapper. This needs to be - // enforced in defining new flags. - // - - ULONG Flags; - - union { - struct { - - // - // The query template is used to filter directory query requests. - // It originally is set to null and on the first call the NtQueryDirectory - // it is set to the input filename or "*" if the name is not supplied. - // All subsquent queries then use this template. - // - - UNICODE_STRING UnicodeQueryTemplate; - }; // for directories - - PMRX_PIPE_HANDLE_INFORMATION PipeHandleInformation; // for pipes - }; - - // - // The following field is used as an offset into the Eas for a - // particular file. This will be the offset for the next - // Ea to return. A value of 0xffffffff indicates that the - // Ea's are exhausted. - // - - // - // This field is manipulated directly by the smbmini....maybe it should move down - // one thing is that it is a reminder that NT allows a resume on getting EAs - // - - ULONG OffsetOfNextEaToReturn; -} MRX_FOBX, *PMRX_FOBX; - -// -// Resource accquisition routines. -// -// The synchronization resources of interest to mini redirector writers are -// primarily associated with the FCB. There is a paging I/O resource and a -// regular resource. The paging I/O resource is managed by the wrapper. The only -// resource accesible to mini redirector writers is the regular resource which -// should be accessed using the supplied routines. -// - -NTSTATUS -RxAcquireExclusiveFcbResourceInMRx ( - __inout PMRX_FCB Fcb - ); - -NTSTATUS -RxAcquireSharedFcbResourceInMRx ( - __inout PMRX_FCB Fcb - ); - -NTSTATUS -RxAcquireSharedFcbResourceInMRxEx ( - IN PRX_CONTEXT pRxContext, - PMRX_FCB Fcb - ); - -VOID -RxReleaseFcbResourceInMRx ( - PMRX_FCB Fcb - ); - -extern VOID -RxReleaseFcbResourceForThreadInMRx( - IN PRX_CONTEXT pRxContext, - IN OUT PMRX_FCB MrxFcb, - IN ERESOURCE_THREAD ResourceThreadId); - -#endif // __MRXFCB_H__ - - - - diff --git a/qt-correction-tool/pub/ddk/msdadc.h b/qt-correction-tool/pub/ddk/msdadc.h deleted file mode 100644 index 1459440..0000000 --- a/qt-correction-tool/pub/ddk/msdadc.h +++ /dev/null @@ -1,392 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for msdadc.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __msdadc_h__ -#define __msdadc_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IDataConvert_FWD_DEFINED__ -#define __IDataConvert_FWD_DEFINED__ -typedef interface IDataConvert IDataConvert; -#endif /* __IDataConvert_FWD_DEFINED__ */ - - -#ifndef __IDCInfo_FWD_DEFINED__ -#define __IDCInfo_FWD_DEFINED__ -typedef interface IDCInfo IDCInfo; -#endif /* __IDCInfo_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "oledb.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_msdadc_0000_0000 */ -/* [local] */ - -//----------------------------------------------------------------------------- -// File: .C or .H file generated by msdadc.idl -// -// Copyright: Copyright (c) 1998-1999 Microsoft Corporation -// -// Contents: .C or .H file generated by msdadc.idl -// -// Comments: -// -//----------------------------------------------------------------------------- -#include // 8-byte structure packing -#undef OLEDBDECLSPEC -#if _MSC_VER >= 1100 -#define OLEDBDECLSPEC __declspec(selectany) -#else -#define OLEDBDECLSPEC -#endif //_MSC_VER - - -extern RPC_IF_HANDLE __MIDL_itf_msdadc_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msdadc_0000_0000_v0_0_s_ifspec; - -#ifndef __IDataConvert_INTERFACE_DEFINED__ -#define __IDataConvert_INTERFACE_DEFINED__ - -/* interface IDataConvert */ -/* [unique][helpstring][uuid][object] */ - -typedef DWORD DBDATACONVERT; - - -enum DBDATACONVERTENUM - { DBDATACONVERT_DEFAULT = 0, - DBDATACONVERT_SETDATABEHAVIOR = 0x1, - DBDATACONVERT_LENGTHFROMNTS = 0x2, - DBDATACONVERT_DSTISFIXEDLENGTH = 0x4, - DBDATACONVERT_DECIMALSCALE = 0x8 - } ; - -EXTERN_C const IID IID_IDataConvert; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0c733a8d-2a1c-11ce-ade5-00aa0044773d") - IDataConvert : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE DataConvert( - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType, - /* [in] */ DBLENGTH cbSrcLength, - /* [annotation][out][in] */ - __out_opt DBLENGTH *pcbDstLength, - /* [annotation][in] */ - __in_bcount(cbSrcLength) void *pSrc, - /* [annotation][out] */ - __out_xcount(cbDstMaxLength) void *pDst, - /* [in] */ DBLENGTH cbDstMaxLength, - /* [in] */ DBSTATUS dbsSrcStatus, - /* [annotation][out] */ - __out_opt DBSTATUS *pdbsStatus, - /* [in] */ BYTE bPrecision, - /* [in] */ BYTE bScale, - /* [in] */ DBDATACONVERT dwFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE CanConvert( - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetConversionSize( - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType, - /* [annotation][in] */ - __in_opt DBLENGTH *pcbSrcLength, - /* [annotation][out] */ - __out_opt DBLENGTH *pcbDstLength, - /* [annotation][size_is][in] */ - __in_bcount_opt(*pcbSrcLength) void *pSrc) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDataConvertVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDataConvert * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDataConvert * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDataConvert * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *DataConvert )( - IDataConvert * This, - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType, - /* [in] */ DBLENGTH cbSrcLength, - /* [annotation][out][in] */ - __out_opt DBLENGTH *pcbDstLength, - /* [annotation][in] */ - __in_bcount(cbSrcLength) void *pSrc, - /* [annotation][out] */ - __out_xcount(cbDstMaxLength) void *pDst, - /* [in] */ DBLENGTH cbDstMaxLength, - /* [in] */ DBSTATUS dbsSrcStatus, - /* [annotation][out] */ - __out_opt DBSTATUS *pdbsStatus, - /* [in] */ BYTE bPrecision, - /* [in] */ BYTE bScale, - /* [in] */ DBDATACONVERT dwFlags); - - HRESULT ( STDMETHODCALLTYPE *CanConvert )( - __RPC__in IDataConvert * This, - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetConversionSize )( - IDataConvert * This, - /* [in] */ DBTYPE wSrcType, - /* [in] */ DBTYPE wDstType, - /* [annotation][in] */ - __in_opt DBLENGTH *pcbSrcLength, - /* [annotation][out] */ - __out_opt DBLENGTH *pcbDstLength, - /* [annotation][size_is][in] */ - __in_bcount_opt(*pcbSrcLength) void *pSrc); - - END_INTERFACE - } IDataConvertVtbl; - - interface IDataConvert - { - CONST_VTBL struct IDataConvertVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDataConvert_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDataConvert_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDataConvert_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDataConvert_DataConvert(This,wSrcType,wDstType,cbSrcLength,pcbDstLength,pSrc,pDst,cbDstMaxLength,dbsSrcStatus,pdbsStatus,bPrecision,bScale,dwFlags) \ - ( (This)->lpVtbl -> DataConvert(This,wSrcType,wDstType,cbSrcLength,pcbDstLength,pSrc,pDst,cbDstMaxLength,dbsSrcStatus,pdbsStatus,bPrecision,bScale,dwFlags) ) - -#define IDataConvert_CanConvert(This,wSrcType,wDstType) \ - ( (This)->lpVtbl -> CanConvert(This,wSrcType,wDstType) ) - -#define IDataConvert_GetConversionSize(This,wSrcType,wDstType,pcbSrcLength,pcbDstLength,pSrc) \ - ( (This)->lpVtbl -> GetConversionSize(This,wSrcType,wDstType,pcbSrcLength,pcbDstLength,pSrc) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDataConvert_INTERFACE_DEFINED__ */ - - -#ifndef __IDCInfo_INTERFACE_DEFINED__ -#define __IDCInfo_INTERFACE_DEFINED__ - -/* interface IDCInfo */ -/* [unique][helpstring][uuid][object] */ - -typedef DWORD DCINFOTYPE; - - -enum DCINFOTYPEENUM - { DCINFOTYPE_VERSION = 1 - } ; -typedef struct tagDCINFO - { - DCINFOTYPE eInfoType; - VARIANT vData; - } DCINFO; - - -EXTERN_C const IID IID_IDCInfo; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0c733a9c-2a1c-11ce-ade5-00aa0044773d") - IDCInfo : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetInfo( - /* [in] */ ULONG cInfo, - /* [size_is][in] */ __RPC__in_ecount_full(cInfo) DCINFOTYPE rgeInfoType[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cInfo) DCINFO **prgInfo) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetInfo( - /* [in] */ ULONG cInfo, - /* [size_is][in] */ __RPC__in_ecount_full(cInfo) DCINFO rgInfo[ ]) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDCInfoVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDCInfo * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDCInfo * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDCInfo * This); - - HRESULT ( STDMETHODCALLTYPE *GetInfo )( - __RPC__in IDCInfo * This, - /* [in] */ ULONG cInfo, - /* [size_is][in] */ __RPC__in_ecount_full(cInfo) DCINFOTYPE rgeInfoType[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cInfo) DCINFO **prgInfo); - - HRESULT ( STDMETHODCALLTYPE *SetInfo )( - __RPC__in IDCInfo * This, - /* [in] */ ULONG cInfo, - /* [size_is][in] */ __RPC__in_ecount_full(cInfo) DCINFO rgInfo[ ]); - - END_INTERFACE - } IDCInfoVtbl; - - interface IDCInfo - { - CONST_VTBL struct IDCInfoVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDCInfo_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDCInfo_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDCInfo_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDCInfo_GetInfo(This,cInfo,rgeInfoType,prgInfo) \ - ( (This)->lpVtbl -> GetInfo(This,cInfo,rgeInfoType,prgInfo) ) - -#define IDCInfo_SetInfo(This,cInfo,rgInfo) \ - ( (This)->lpVtbl -> SetInfo(This,cInfo,rgInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDCInfo_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_msdadc_0000_0002 */ -/* [local] */ - -extern const GUID OLEDBDECLSPEC IID_IDataConvert = { 0x0c733a8dL,0x2a1c,0x11ce, { 0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d } }; -extern const GUID OLEDBDECLSPEC IID_IDCInfo = { 0x0c733a9cL,0x2a1c,0x11ce, { 0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d } }; -#include // restore original structure packing - - -extern RPC_IF_HANDLE __MIDL_itf_msdadc_0000_0002_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msdadc_0000_0002_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER VARIANT_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); -void __RPC_USER VARIANT_UserFree( __RPC__in unsigned long *, __RPC__in VARIANT * ); - -unsigned long __RPC_USER VARIANT_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in VARIANT * ); -unsigned char * __RPC_USER VARIANT_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out VARIANT * ); -void __RPC_USER VARIANT_UserFree64( __RPC__in unsigned long *, __RPC__in VARIANT * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/msdaguid.h b/qt-correction-tool/pub/ddk/msdaguid.h deleted file mode 100644 index 21eec36..0000000 --- a/qt-correction-tool/pub/ddk/msdaguid.h +++ /dev/null @@ -1,41 +0,0 @@ -//--------------------------------------------------------------------------- -// -// File: MSDAGUID.H -// -// Copyright: Copyright (c) Microsoft Corporation -// -// Contents: Microsoft Data Access GUID defintions -// -// Comments: -// -//--------------------------------------------------------------------------- - -#ifndef MSDAGUID -#define MSDAGUID - -#undef OLEDBDECLSPEC -#if _MSC_VER >= 1100 -#define OLEDBDECLSPEC __declspec(selectany) -#else -#define OLEDBDECLSPEC -#endif //_MSC_VER - -#ifdef DBINITCONSTANTS -EXTERN_C const OLEDBDECLSPEC GUID CLSID_OLEDB_ENUMERATOR = {0xc8b522d0L,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}}; -EXTERN_C const OLEDBDECLSPEC GUID CLSID_EXTENDEDERRORINFO = {0xc8b522cfL,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}}; -EXTERN_C const OLEDBDECLSPEC GUID CLSID_MSDAVTM = {0x0c733a8eL,0x2a1c,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}}; -EXTERN_C const OLEDBDECLSPEC GUID CLSID_OLEDB_CONVERSIONLIBRARY= {0xc8b522d1L,0x5cf3,0x11ce,{0xad,0xe5,0x00,0xaa,0x00,0x44,0x77,0x3d}}; -EXTERN_C const OLEDBDECLSPEC GUID CLSID_OLEDB_ROWPOSITIONLIBRARY= {0x2048eee6l,0x7fa2,0x11d0,{0x9e,0x6a,0x00,0xa0,0xc9,0x13,0x8c,0x29}}; -EXTERN_C const OLEDBDECLSPEC GUID OLEDB_SVC_DSLPropertyPages = {0x51740c02,0x7e8e,0x11d2,{0xa0,0x2d,0x00,0xc0,0x4f,0xa3,0x73,0x48}}; - -#else -EXTERN_C const GUID CLSID_OLEDB_ENUMERATOR; -EXTERN_C const GUID CLSID_EXTENDEDERRORINFO; -EXTERN_C const GUID CLSID_MSDAVTM; -EXTERN_C const GUID CLSID_OLEDB_CONVERSIONLIBRARY; -EXTERN_C const GUID CLSID_OLEDB_ROWPOSITIONLIBRARY; -EXTERN_C const GUID OLEDB_SVC_DSLPropertyPages; -#endif - -#endif // MSDAGUID - diff --git a/qt-correction-tool/pub/ddk/msdasc.h b/qt-correction-tool/pub/ddk/msdasc.h deleted file mode 100644 index aca318a..0000000 --- a/qt-correction-tool/pub/ddk/msdasc.h +++ /dev/null @@ -1,828 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for msdasc.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __msdasc_h__ -#define __msdasc_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IService_FWD_DEFINED__ -#define __IService_FWD_DEFINED__ -typedef interface IService IService; -#endif /* __IService_FWD_DEFINED__ */ - - -#ifndef __IDBPromptInitialize_FWD_DEFINED__ -#define __IDBPromptInitialize_FWD_DEFINED__ -typedef interface IDBPromptInitialize IDBPromptInitialize; -#endif /* __IDBPromptInitialize_FWD_DEFINED__ */ - - -#ifndef __IDataInitialize_FWD_DEFINED__ -#define __IDataInitialize_FWD_DEFINED__ -typedef interface IDataInitialize IDataInitialize; -#endif /* __IDataInitialize_FWD_DEFINED__ */ - - -#ifndef __IDataSourceLocator_FWD_DEFINED__ -#define __IDataSourceLocator_FWD_DEFINED__ -typedef interface IDataSourceLocator IDataSourceLocator; -#endif /* __IDataSourceLocator_FWD_DEFINED__ */ - - -#ifndef __DataLinks_FWD_DEFINED__ -#define __DataLinks_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class DataLinks DataLinks; -#else -typedef struct DataLinks DataLinks; -#endif /* __cplusplus */ - -#endif /* __DataLinks_FWD_DEFINED__ */ - - -#ifndef __MSDAINITIALIZE_FWD_DEFINED__ -#define __MSDAINITIALIZE_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class MSDAINITIALIZE MSDAINITIALIZE; -#else -typedef struct MSDAINITIALIZE MSDAINITIALIZE; -#endif /* __cplusplus */ - -#endif /* __MSDAINITIALIZE_FWD_DEFINED__ */ - - -#ifndef __PDPO_FWD_DEFINED__ -#define __PDPO_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PDPO PDPO; -#else -typedef struct PDPO PDPO; -#endif /* __cplusplus */ - -#endif /* __PDPO_FWD_DEFINED__ */ - - -#ifndef __RootBinder_FWD_DEFINED__ -#define __RootBinder_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class RootBinder RootBinder; -#else -typedef struct RootBinder RootBinder; -#endif /* __cplusplus */ - -#endif /* __RootBinder_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "oledb.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_msdasc_0000_0000 */ -/* [local] */ - -//----------------------------------------------------------------------------- -// File: .C or .H file generated by msdasc.idl -// -// Copyright: Copyright (c) 1998-1999 Microsoft Corporation -// -// Contents: .C or .H file generated by msdasc.idl -// -// Comments: -// -//----------------------------------------------------------------------------- - -#ifdef _WIN64 - -typedef LONGLONG COMPATIBLE_LONG; - -#else - -typedef LONG COMPATIBLE_LONG; - -#endif // _WIN64 -typedef -enum tagEBindInfoOptions - { BIO_BINDER = 0x1 - } EBindInfoOptions; - -#define STGM_COLLECTION 0x00002000L -#define STGM_OUTPUT 0x00008000L -#define STGM_OPEN 0x80000000L -#define STGM_RECURSIVE 0x01000000L -#define STGM_STRICTOPEN 0x40000000L - - -extern RPC_IF_HANDLE __MIDL_itf_msdasc_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msdasc_0000_0000_v0_0_s_ifspec; - -#ifndef __IService_INTERFACE_DEFINED__ -#define __IService_INTERFACE_DEFINED__ - -/* interface IService */ -/* [object][unique][helpstring][uuid] */ - - -EXTERN_C const IID IID_IService; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("06210E88-01F5-11D1-B512-0080C781C384") - IService : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE InvokeService( - /* [annotation][in] */ - __in IUnknown *pUnkInner) = 0; - - }; - -#else /* C style interface */ - - typedef struct IServiceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IService * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IService * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IService * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *InvokeService )( - IService * This, - /* [annotation][in] */ - __in IUnknown *pUnkInner); - - END_INTERFACE - } IServiceVtbl; - - interface IService - { - CONST_VTBL struct IServiceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IService_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IService_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IService_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IService_InvokeService(This,pUnkInner) \ - ( (This)->lpVtbl -> InvokeService(This,pUnkInner) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IService_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_msdasc_0000_0001 */ -/* [local] */ - -typedef DWORD DBPROMPTOPTIONS; - -typedef -enum tagDBPROMPTOPTIONSENUM - { DBPROMPTOPTIONS_NONE = 0, - DBPROMPTOPTIONS_WIZARDSHEET = 0x1, - DBPROMPTOPTIONS_PROPERTYSHEET = 0x2, - DBPROMPTOPTIONS_BROWSEONLY = 0x8, - DBPROMPTOPTIONS_DISABLE_PROVIDER_SELECTION = 0x10, - DBPROMPTOPTIONS_DISABLESAVEPASSWORD = 0x20 - } DBPROMPTOPTIONSENUM; - - - -extern RPC_IF_HANDLE __MIDL_itf_msdasc_0000_0001_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_msdasc_0000_0001_v0_0_s_ifspec; - -#ifndef __IDBPromptInitialize_INTERFACE_DEFINED__ -#define __IDBPromptInitialize_INTERFACE_DEFINED__ - -/* interface IDBPromptInitialize */ -/* [restricted][local][unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IDBPromptInitialize; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2206CCB0-19C1-11D1-89E0-00C04FD7A829") - IDBPromptInitialize : public IUnknown - { - public: - virtual /* [local][helpstring] */ HRESULT STDMETHODCALLTYPE PromptDataSource( - /* [annotation][in] */ - __in_opt IUnknown *pUnkOuter, - /* [in] */ HWND hWndParent, - /* [in] */ DBPROMPTOPTIONS dwPromptOptions, - /* [in] */ ULONG cSourceTypeFilter, - /* [annotation][size_is][in] */ - __in_ecount_opt(cSourceTypeFilter) DBSOURCETYPE *rgSourceTypeFilter, - /* [annotation][in] */ - __in_z_opt LPCOLESTR pwszszzProviderFilter, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out][in] */ - __deref_inout IUnknown **ppDataSource) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PromptFileName( - /* [in] */ HWND hWndParent, - /* [in] */ DBPROMPTOPTIONS dwPromptOptions, - /* [in] */ LPCOLESTR pwszInitialDirectory, - /* [in] */ LPCOLESTR pwszInitialFile, - /* [annotation][out] */ - __deref_out LPOLESTR *ppwszSelectedFile) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDBPromptInitializeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - IDBPromptInitialize * This, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - IDBPromptInitialize * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - IDBPromptInitialize * This); - - /* [local][helpstring] */ HRESULT ( STDMETHODCALLTYPE *PromptDataSource )( - IDBPromptInitialize * This, - /* [annotation][in] */ - __in_opt IUnknown *pUnkOuter, - /* [in] */ HWND hWndParent, - /* [in] */ DBPROMPTOPTIONS dwPromptOptions, - /* [in] */ ULONG cSourceTypeFilter, - /* [annotation][size_is][in] */ - __in_ecount_opt(cSourceTypeFilter) DBSOURCETYPE *rgSourceTypeFilter, - /* [annotation][in] */ - __in_z_opt LPCOLESTR pwszszzProviderFilter, - /* [in] */ REFIID riid, - /* [annotation][iid_is][out][in] */ - __deref_inout IUnknown **ppDataSource); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *PromptFileName )( - IDBPromptInitialize * This, - /* [in] */ HWND hWndParent, - /* [in] */ DBPROMPTOPTIONS dwPromptOptions, - /* [in] */ LPCOLESTR pwszInitialDirectory, - /* [in] */ LPCOLESTR pwszInitialFile, - /* [annotation][out] */ - __deref_out LPOLESTR *ppwszSelectedFile); - - END_INTERFACE - } IDBPromptInitializeVtbl; - - interface IDBPromptInitialize - { - CONST_VTBL struct IDBPromptInitializeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDBPromptInitialize_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDBPromptInitialize_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDBPromptInitialize_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDBPromptInitialize_PromptDataSource(This,pUnkOuter,hWndParent,dwPromptOptions,cSourceTypeFilter,rgSourceTypeFilter,pwszszzProviderFilter,riid,ppDataSource) \ - ( (This)->lpVtbl -> PromptDataSource(This,pUnkOuter,hWndParent,dwPromptOptions,cSourceTypeFilter,rgSourceTypeFilter,pwszszzProviderFilter,riid,ppDataSource) ) - -#define IDBPromptInitialize_PromptFileName(This,hWndParent,dwPromptOptions,pwszInitialDirectory,pwszInitialFile,ppwszSelectedFile) \ - ( (This)->lpVtbl -> PromptFileName(This,hWndParent,dwPromptOptions,pwszInitialDirectory,pwszInitialFile,ppwszSelectedFile) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDBPromptInitialize_INTERFACE_DEFINED__ */ - - -#ifndef __IDataInitialize_INTERFACE_DEFINED__ -#define __IDataInitialize_INTERFACE_DEFINED__ - -/* interface IDataInitialize */ -/* [unique][helpstring][uuid][object] */ - - - - -EXTERN_C const IID IID_IDataInitialize; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2206CCB1-19C1-11D1-89E0-00C04FD7A829") - IDataInitialize : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetDataSource( - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszInitializationString, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out][in] */ __RPC__deref_inout_opt IUnknown **ppDataSource) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetInitializationString( - /* [in] */ __RPC__in_opt IUnknown *pDataSource, - /* [in] */ boolean fIncludePassword, - /* [out] */ __RPC__deref_out_opt LPOLESTR *ppwszInitString) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateDBInstance( - /* [in] */ __RPC__in REFCLSID clsidProvider, - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPOLESTR pwszReserved, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ __RPC__deref_out_opt IUnknown **ppDataSource) = 0; - - virtual /* [local][helpstring] */ HRESULT STDMETHODCALLTYPE CreateDBInstanceEx( - /* [in] */ REFCLSID clsidProvider, - /* [annotation][in] */ - __in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [annotation][unique][in] */ - __in_z_opt LPOLESTR pwszReserved, - /* [annotation][unique][in] */ - __in COSERVERINFO *pServerInfo, - /* [in] */ ULONG cmq, - /* [annotation][size_is][out][in] */ - __out_ecount(cmq) MULTI_QI *rgmqResults) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LoadStringFromStorage( - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszFileName, - /* [out] */ __RPC__deref_out_opt LPOLESTR *ppwszInitializationString) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE WriteStringToStorage( - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszFileName, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszInitializationString, - /* [in] */ DWORD dwCreationDisposition) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDataInitializeVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDataInitialize * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDataInitialize * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetDataSource )( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszInitializationString, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out][in] */ __RPC__deref_inout_opt IUnknown **ppDataSource); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetInitializationString )( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in_opt IUnknown *pDataSource, - /* [in] */ boolean fIncludePassword, - /* [out] */ __RPC__deref_out_opt LPOLESTR *ppwszInitString); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateDBInstance )( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in REFCLSID clsidProvider, - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPOLESTR pwszReserved, - /* [in] */ __RPC__in REFIID riid, - /* [iid_is][out] */ __RPC__deref_out_opt IUnknown **ppDataSource); - - /* [local][helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateDBInstanceEx )( - IDataInitialize * This, - /* [in] */ REFCLSID clsidProvider, - /* [annotation][in] */ - __in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [annotation][unique][in] */ - __in_z_opt LPOLESTR pwszReserved, - /* [annotation][unique][in] */ - __in COSERVERINFO *pServerInfo, - /* [in] */ ULONG cmq, - /* [annotation][size_is][out][in] */ - __out_ecount(cmq) MULTI_QI *rgmqResults); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LoadStringFromStorage )( - __RPC__in IDataInitialize * This, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszFileName, - /* [out] */ __RPC__deref_out_opt LPOLESTR *ppwszInitializationString); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *WriteStringToStorage )( - __RPC__in IDataInitialize * This, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszFileName, - /* [unique][in] */ __RPC__in_opt LPCOLESTR pwszInitializationString, - /* [in] */ DWORD dwCreationDisposition); - - END_INTERFACE - } IDataInitializeVtbl; - - interface IDataInitialize - { - CONST_VTBL struct IDataInitializeVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDataInitialize_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDataInitialize_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDataInitialize_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDataInitialize_GetDataSource(This,pUnkOuter,dwClsCtx,pwszInitializationString,riid,ppDataSource) \ - ( (This)->lpVtbl -> GetDataSource(This,pUnkOuter,dwClsCtx,pwszInitializationString,riid,ppDataSource) ) - -#define IDataInitialize_GetInitializationString(This,pDataSource,fIncludePassword,ppwszInitString) \ - ( (This)->lpVtbl -> GetInitializationString(This,pDataSource,fIncludePassword,ppwszInitString) ) - -#define IDataInitialize_CreateDBInstance(This,clsidProvider,pUnkOuter,dwClsCtx,pwszReserved,riid,ppDataSource) \ - ( (This)->lpVtbl -> CreateDBInstance(This,clsidProvider,pUnkOuter,dwClsCtx,pwszReserved,riid,ppDataSource) ) - -#define IDataInitialize_CreateDBInstanceEx(This,clsidProvider,pUnkOuter,dwClsCtx,pwszReserved,pServerInfo,cmq,rgmqResults) \ - ( (This)->lpVtbl -> CreateDBInstanceEx(This,clsidProvider,pUnkOuter,dwClsCtx,pwszReserved,pServerInfo,cmq,rgmqResults) ) - -#define IDataInitialize_LoadStringFromStorage(This,pwszFileName,ppwszInitializationString) \ - ( (This)->lpVtbl -> LoadStringFromStorage(This,pwszFileName,ppwszInitializationString) ) - -#define IDataInitialize_WriteStringToStorage(This,pwszFileName,pwszInitializationString,dwCreationDisposition) \ - ( (This)->lpVtbl -> WriteStringToStorage(This,pwszFileName,pwszInitializationString,dwCreationDisposition) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IDataInitialize_RemoteCreateDBInstanceEx_Proxy( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in REFCLSID clsidProvider, - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPOLESTR pwszReserved, - /* [unique][in] */ __RPC__in_opt COSERVERINFO *pServerInfo, - /* [in] */ ULONG cmq, - /* [size_is][in] */ __RPC__in_ecount_full(cmq) const IID **rgpIID, - /* [size_is][out] */ __RPC__out_ecount_full(cmq) IUnknown **rgpItf, - /* [size_is][out] */ __RPC__out_ecount_full(cmq) HRESULT *rghr); - - -void __RPC_STUB IDataInitialize_RemoteCreateDBInstanceEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IDataInitialize_INTERFACE_DEFINED__ */ - - - -#ifndef __MSDASC_LIBRARY_DEFINED__ -#define __MSDASC_LIBRARY_DEFINED__ - -/* library MSDASC */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_MSDASC; - -#ifndef __IDataSourceLocator_INTERFACE_DEFINED__ -#define __IDataSourceLocator_INTERFACE_DEFINED__ - -/* interface IDataSourceLocator */ -/* [unique][helpstring][dual][uuid][object] */ - - -EXTERN_C const IID IID_IDataSourceLocator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2206CCB2-19C1-11D1-89E0-00C04FD7A829") - IDataSourceLocator : public IDispatch - { - public: - virtual /* [helpstring][propget] */ HRESULT STDMETHODCALLTYPE get_hWnd( - /* [retval][out] */ __RPC__out COMPATIBLE_LONG *phwndParent) = 0; - - virtual /* [helpstring][propput] */ HRESULT STDMETHODCALLTYPE put_hWnd( - /* [in] */ COMPATIBLE_LONG hwndParent) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PromptNew( - /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppADOConnection) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE PromptEdit( - /* [out][in] */ __RPC__deref_inout_opt IDispatch **ppADOConnection, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pbSuccess) = 0; - - }; - -#else /* C style interface */ - - typedef struct IDataSourceLocatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IDataSourceLocator * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IDataSourceLocator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IDataSourceLocator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in IDataSourceLocator * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in IDataSourceLocator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in IDataSourceLocator * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - IDataSourceLocator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstring][propget] */ HRESULT ( STDMETHODCALLTYPE *get_hWnd )( - __RPC__in IDataSourceLocator * This, - /* [retval][out] */ __RPC__out COMPATIBLE_LONG *phwndParent); - - /* [helpstring][propput] */ HRESULT ( STDMETHODCALLTYPE *put_hWnd )( - __RPC__in IDataSourceLocator * This, - /* [in] */ COMPATIBLE_LONG hwndParent); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *PromptNew )( - __RPC__in IDataSourceLocator * This, - /* [retval][out] */ __RPC__deref_out_opt IDispatch **ppADOConnection); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *PromptEdit )( - __RPC__in IDataSourceLocator * This, - /* [out][in] */ __RPC__deref_inout_opt IDispatch **ppADOConnection, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pbSuccess); - - END_INTERFACE - } IDataSourceLocatorVtbl; - - interface IDataSourceLocator - { - CONST_VTBL struct IDataSourceLocatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IDataSourceLocator_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IDataSourceLocator_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IDataSourceLocator_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IDataSourceLocator_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define IDataSourceLocator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define IDataSourceLocator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define IDataSourceLocator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define IDataSourceLocator_get_hWnd(This,phwndParent) \ - ( (This)->lpVtbl -> get_hWnd(This,phwndParent) ) - -#define IDataSourceLocator_put_hWnd(This,hwndParent) \ - ( (This)->lpVtbl -> put_hWnd(This,hwndParent) ) - -#define IDataSourceLocator_PromptNew(This,ppADOConnection) \ - ( (This)->lpVtbl -> PromptNew(This,ppADOConnection) ) - -#define IDataSourceLocator_PromptEdit(This,ppADOConnection,pbSuccess) \ - ( (This)->lpVtbl -> PromptEdit(This,ppADOConnection,pbSuccess) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IDataSourceLocator_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_DataLinks; - -#ifdef __cplusplus - -class DECLSPEC_UUID("2206CDB2-19C1-11D1-89E0-00C04FD7A829") -DataLinks; -#endif - -EXTERN_C const CLSID CLSID_MSDAINITIALIZE; - -#ifdef __cplusplus - -class DECLSPEC_UUID("2206CDB0-19C1-11D1-89E0-00C04FD7A829") -MSDAINITIALIZE; -#endif - -EXTERN_C const CLSID CLSID_PDPO; - -#ifdef __cplusplus - -class DECLSPEC_UUID("CCB4EC60-B9DC-11D1-AC80-00A0C9034873") -PDPO; -#endif - -EXTERN_C const CLSID CLSID_RootBinder; - -#ifdef __cplusplus - -class DECLSPEC_UUID("FF151822-B0BF-11D1-A80D-000000000000") -RootBinder; -#endif -#endif /* __MSDASC_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* [local][helpstring] */ HRESULT STDMETHODCALLTYPE IDataInitialize_CreateDBInstanceEx_Proxy( - IDataInitialize * This, - /* [in] */ REFCLSID clsidProvider, - /* [annotation][in] */ - __in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [annotation][unique][in] */ - __in_z_opt LPOLESTR pwszReserved, - /* [annotation][unique][in] */ - __in COSERVERINFO *pServerInfo, - /* [in] */ ULONG cmq, - /* [annotation][size_is][out][in] */ - __out_ecount(cmq) MULTI_QI *rgmqResults); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IDataInitialize_CreateDBInstanceEx_Stub( - __RPC__in IDataInitialize * This, - /* [in] */ __RPC__in REFCLSID clsidProvider, - /* [in] */ __RPC__in_opt IUnknown *pUnkOuter, - /* [in] */ DWORD dwClsCtx, - /* [unique][in] */ __RPC__in_opt LPOLESTR pwszReserved, - /* [unique][in] */ __RPC__in_opt COSERVERINFO *pServerInfo, - /* [in] */ ULONG cmq, - /* [size_is][in] */ __RPC__in_ecount_full(cmq) const IID **rgpIID, - /* [size_is][out] */ __RPC__out_ecount_full(cmq) IUnknown **rgpItf, - /* [size_is][out] */ __RPC__out_ecount_full(cmq) HRESULT *rghr); - - - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/msviddrv.h b/qt-correction-tool/pub/ddk/msviddrv.h deleted file mode 100644 index bc2d19b..0000000 --- a/qt-correction-tool/pub/ddk/msviddrv.h +++ /dev/null @@ -1,127 +0,0 @@ -/****************************************************************************/ -/* */ -/* MSVIDDRV.H - Include file for messages to video capture drivers */ -/* */ -/* Note: You must include WINDOWS.H before including this file. */ -/* */ -/* Copyright (c) Microsoft Corporation. All rights reserved. */ -/* */ -/****************************************************************************/ - -#ifndef _INC_MSVIDDRV -#define _INC_MSVIDDRV 50 /* version number */ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { /* Assume C declarations for C++ */ -#endif /* __cplusplus */ - -/**************************************************************************** - - Digital Video Messages (DVM_) - -****************************************************************************/ - -// General messages -#define DVM_START DRV_USER -#define DVM_GETERRORTEXT (DVM_START + 0) -#define DVM_GETVIDEOAPIVER (DVM_START + 1) - -// This value increments each time the API changes -// It is passed to the driver in the DRV_OPEN message. -#define VIDEOAPIVERSION 4 - -// General messages applicable to all channel types -#define DVM_DIALOG (DVM_START + 100) -#define DVM_CONFIGURESTORAGE (DVM_START + 101) -#define DVM_GET_CHANNEL_CAPS (DVM_START + 102) -#define DVM_UPDATE (DVM_START + 103) - -// Single frame msg -#define DVM_FRAME (DVM_START + 200) - -// stream messages -#define DVM_STREAM_MSG_START (DVM_START + 300) -#define DVM_STREAM_MSG_END (DVM_START + 399) - -#define DVM_STREAM_ADDBUFFER (DVM_START + 300) -#define DVM_STREAM_FINI (DVM_START + 301) -#define DVM_STREAM_GETERROR (DVM_START + 302) -#define DVM_STREAM_GETPOSITION (DVM_START + 303) -#define DVM_STREAM_INIT (DVM_START + 304) -#define DVM_STREAM_PREPAREHEADER (DVM_START + 305) -#define DVM_STREAM_RESET (DVM_START + 306) -#define DVM_STREAM_START (DVM_START + 307) -#define DVM_STREAM_STOP (DVM_START + 308) -#define DVM_STREAM_UNPREPAREHEADER (DVM_START + 309) - -// Following added post VFW1.1a, but are now obsolete -#define DVM_STREAM_ALLOCHDRANDBUFFER (DVM_START + 310) -#define DVM_STREAM_FREEHDRANDBUFFER (DVM_START + 311) -// The 2 messages above will be removed once the ALLOCBUFFER code is ready - -// Following added for Win95 and NTPPC -#define DVM_STREAM_ALLOCBUFFER (DVM_START + 312) -#define DVM_STREAM_FREEBUFFER (DVM_START + 313) - -// NOTE that DVM_CONFIGURE numbers will start at 0x1000 (for configure API) - - -/**************************************************************************** - - Open Definitions - -****************************************************************************/ -#define OPEN_TYPE_VCAP mmioFOURCC('v', 'c', 'a', 'p') - -// The following structure is the same as IC_OPEN -// to allow compressors and capture devices to share -// the same DriverProc. - -typedef struct tag_video_open_parms { - DWORD dwSize; // sizeof(VIDEO_OPEN_PARMS) - FOURCC fccType; // 'vcap' - FOURCC fccComp; // unused - DWORD dwVersion; // version of msvideo opening you - DWORD dwFlags; // channel type - DWORD dwError; // if open fails, this is why - LPVOID pV1Reserved; // Reserved - LPVOID pV2Reserved; // Reserved - DWORD dnDevNode; // Devnode for PnP devices -} VIDEO_OPEN_PARMS, FAR * LPVIDEO_OPEN_PARMS; - -typedef struct tag_video_geterrortext_parms { - DWORD dwError; // The error number to identify -#ifdef _WIN32 - LPWSTR lpText; // Text buffer to fill -#else - LPSTR lpText; // Text buffer to fill -#endif - DWORD dwLength; // Size of text buffer in characters -} VIDEO_GETERRORTEXT_PARMS, FAR * LPVIDEO_GETERRORTEXT_PARMS; - -typedef struct tag_video_stream_init_parms { - DWORD dwMicroSecPerFrame; - DWORD dwCallback; - DWORD dwCallbackInst; - DWORD dwFlags; - HANDLE hVideo; -} VIDEO_STREAM_INIT_PARMS, FAR * LPVIDEO_STREAM_INIT_PARMS; - -typedef struct tag_video_configure_parms { - LPDWORD lpdwReturn; // Return parameter from configure MSG. - LPVOID lpData1; // Pointer to data 1. - DWORD dwSize1; // size of data buffer 1. - LPVOID lpData2; // Pointer to data 2. - DWORD dwSize2; // size of data buffer 2. -} VIDEOCONFIGPARMS, FAR * LPVIDEOCONFIGPARMS; - -#ifdef __cplusplus -} /* End of extern "C" { */ -#endif /* __cplusplus */ - -#endif /* _INC_MSVIDDRV */ - diff --git a/qt-correction-tool/pub/ddk/namcache.h b/qt-correction-tool/pub/ddk/namcache.h deleted file mode 100644 index a4040a1..0000000 --- a/qt-correction-tool/pub/ddk/namcache.h +++ /dev/null @@ -1,210 +0,0 @@ -/*++ - -Copyright (c) 1996 Microsoft Corporation - -Module Name: - - namcache.h - -Abstract: - -The NAME_CACHE structure is used to remember the name strings of recent -operations performed at the server so the client can suppress redundant -requests. For example if an open has recently failed with file not found and -the client app tries it again with an upcased string then we can fail it -immediately with STATUS_OBJECT_NAME_NOT_FOUND without hitting the server. In -general the algorithm is to put a time window and SMB operation count limit on -the NAME_CACHE entry. The time window is usually 2 seconds so if NAME_CACHE -entry is more than 2 seconds old the match will fail and the request will go to -the server. If the request fails again at the server the NAME_CACHE is updated -with another 2 second window. If the SMB operation count doesn't match then one -or more SMBs have been sent to the server which could make this NAME_CACHE entry -invalid. So again this operation will get sent to the server. - -A NAME_CACHE struct has a mini-rdr portion and an RDBSS portion. The mini-rdr -portion has a context field (see below), an NTSTATUS field for the result of a -prior server operation on this name entry and a context extension pointer for -some additional mini-rdr specific storage that can be co-allocated with the -NAME_CACHE structure. See RxNameCacheInitialize(). - -The SMB operation count is an example of mini-rdr specific state which could be -saved in the context field of MRX_NAME_CACHE. When the wrapper routine -RxNameCacheCheckEntry() is called it will perform an equality check between the -context field and a supplied parameter as part of finding a match in the name -cache. When a NAME_CACHE entry is created or updated it is the mini-rdr's job -to supply an appropriate value for this field. - -The RDBSS portion of the NAME_CACHE struct contains the name (in a UNICODE -STRING) and the expiration time of the entry. The MaximumEntries field is used -to limit the number of NAME_CACHE entries created in case a poorly behaved -program were to generate a large number of opens with bad file names and so -consume large quanities of pool. - -The NAME_CACHE_CONTROL struct is used to manage a given name cache. It has -a free list, an active list and a lock used to synchronize updates. - -Currently there are name caches for: - 1. OBJECT_NAME_NOT_FOUND - 2 second window, any SMB op sent to the - server will invalidate it. This is because you could have the case - where the client app has a file (foo) open which an app on the server could - use to signal the creation of a file (bar) on the server. When the client - reads file foo and learns that file bar has been created on the - server then a hit in the name cache which matches bar can't return an - error. So this optimization only handles the case of successive file - opens on the same file which does not yet exist. Happens in WORD. - -Author: - - -Revision History: - ---*/ - -#ifndef _NAME_CACHE_DEFINED_ -#define _NAME_CACHE_DEFINED_ - - -#ifdef __cplusplus -typedef struct _MRX_NAME_CACHE_ : public MRX_NORMAL_NODE_HEADER { -#else // !__cplusplus -typedef struct _MRX_NAME_CACHE_ { - MRX_NORMAL_NODE_HEADER; -#endif // __cplusplus - - // !!!! changes above this require realignment with fcb.h - - ULONG Context; // Operation Count snapshot when entry made - PVOID ContextExtension; // Pointer to mini-rdr extension area - NTSTATUS PriorStatus; // Saved Status from last attempt at operation - -} MRX_NAME_CACHE, *PMRX_NAME_CACHE; - - -#ifdef __cplusplus -typedef struct _NAME_CACHE : public MRX_NAME_CACHE { - // I didn't find any use of the spacer in the union below, - // and the MRX_NAME_CACHE is by definition larger than - // MRX_NORMAL_NODE_HEADER, so I didn't worry about the union -#else // !__cplusplus -typedef struct _NAME_CACHE { - // - // The portion of NAME_CACHE visible to mini redirectors. - // - union { - MRX_NAME_CACHE; - struct { - MRX_NORMAL_NODE_HEADER spacer; - }; - }; -#endif // __cplusplus - // - // The portion of NAME_CACHE visible to RDBSS. - // - LARGE_INTEGER ExpireTime; // Time when entry expires - LIST_ENTRY Link; // Entry on free or active list - UNICODE_STRING Name; // Cached name - ULONG HashValue; // Hash value of name - BOOLEAN CaseInsensitive; // Controls name string compare - -} NAME_CACHE, *PNAME_CACHE; - - -typedef struct _NAME_CACHE_CONTROL_ { - - FAST_MUTEX NameCacheLock; // Lock to synchronize access to the list - LIST_ENTRY ActiveList; // List of active name cache entries - LIST_ENTRY FreeList; // Free list of NAME_CACHE structs - __volatile ULONG EntryCount; // Current number of NAME_CACHE entries allocated - ULONG MaximumEntries; // Max number of entries we will allocate - ULONG MRxNameCacheSize; // Size of Mini-rdr storage area in entry - // - // Stats - // - ULONG NumberActivates; // Number of times cache was updated - ULONG NumberChecks; // Number of times cache was checked - ULONG NumberNameHits; // Number of times a valid match was returned - ULONG NumberNetOpsSaved; // Number of times mini-rdr saved a net op - - ULONG Spare[4]; - -} NAME_CACHE_CONTROL, *PNAME_CACHE_CONTROL; - - -// -// Return status for RxNameCacheCheckEntry() -// -typedef enum _RX_NC_CHECK_STATUS { - RX_NC_SUCCESS = 0, - RX_NC_TIME_EXPIRED, - RX_NC_MRXCTX_FAIL -} RX_NC_CHECK_STATUS; - - - -// -// Mini-rdr function to count the number of times the cached state avoided -// a trip to the server. -// -#define RxNameCacheOpSaved(_NCC) (_NCC)->NumberNetOpsSaved += 1 - - - -VOID -RxNameCacheInitialize( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN ULONG MRxNameCacheSize, - IN ULONG MaximumEntries - ); - -PNAME_CACHE -RxNameCacheCreateEntry ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PUNICODE_STRING Name, - IN BOOLEAN CaseInsensitive - ); - -PNAME_CACHE -RxNameCacheFetchEntry ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PUNICODE_STRING Name - ); - -RX_NC_CHECK_STATUS -RxNameCacheCheckEntry ( - IN PNAME_CACHE NameCache, - IN ULONG MRxContext - ); - -VOID -RxNameCacheActivateEntry ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PNAME_CACHE NameCache, - IN ULONG LifeTime, - IN ULONG MRxContext - ); - -VOID -RxNameCacheExpireEntry ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PNAME_CACHE NameCache - ); - -VOID -RxNameCacheExpireEntryWithShortName ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PUNICODE_STRING Name - ); - -VOID -RxNameCacheFreeEntry ( - IN PNAME_CACHE_CONTROL NameCacheCtl, - IN PNAME_CACHE NameCache - ); - -VOID -RxNameCacheFinalize ( - IN PNAME_CACHE_CONTROL NameCacheCtl - ); - -#endif // _NAME_CACHE_DEFINED_ - diff --git a/qt-correction-tool/pub/ddk/ndis.h b/qt-correction-tool/pub/ddk/ndis.h deleted file mode 100644 index d14766f..0000000 --- a/qt-correction-tool/pub/ddk/ndis.h +++ /dev/null @@ -1,12456 +0,0 @@ -/*++ BUILD Version: ???? // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ndis.h - -Abstract: - - This module defines the structures, macros, and functions available - to NDIS drivers. - -Revision History: - ---*/ - -#if !defined(_NDIS_) -#define _NDIS_ - -#if !defined(NDIS_WDM) -#define NDIS_WDM 0 -#endif - - -// -// Set BINARY_COMPATIBLE to 0 if it is not defined. Error out if user tries -// to build a Win9x binary compatible driver using this DDK. -// - -#if !defined(BINARY_COMPATIBLE) -#define BINARY_COMPATIBLE 0 -#else -#if (BINARY_COMPATIBLE != 0) -#error "can not build Win9x binary compatible drivers, please remove the definition for BINARY_COMPATIBLE or set it to 0" -#endif -#endif - - -// -// BEGIN INTERNAL DEFINITIONS -// - - -#include - -// -// END INTERNAL DEFINITIONS -// -// The following definitions may be used by NDIS drivers, except as noted. -// - -#ifndef __NET_PNP__ -#define __NET_PNP__ - -#pragma once - -// -// PnP and PM event codes that can be indicated up to transports -// and clients. -// -typedef enum _NET_PNP_EVENT_CODE -{ - NetEventSetPower, - NetEventQueryPower, - NetEventQueryRemoveDevice, - NetEventCancelRemoveDevice, - NetEventReconfigure, - NetEventBindList, - NetEventBindsComplete, - NetEventPnPCapabilities, - NetEventPause, - NetEventRestart, - NetEventPortActivation, - NetEventPortDeactivation, - NetEventIMReEnableDevice, - NetEventMaximum -} NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE; - -// -// Networking PnP event indication structure. -// -typedef struct _NET_PNP_EVENT -{ - // - // Event code describing action to take. - // - NET_PNP_EVENT_CODE NetEvent; - - // - // Event specific data. - // - PVOID Buffer; - - // - // Length of event specific data. - // - ULONG BufferLength; - - // - // Reserved values are for use by respective components only. - // - // Note: these reserved areas must be pointer aligned. - // - - ULONG_PTR NdisReserved[4]; - ULONG_PTR TransportReserved[4]; - ULONG_PTR TdiReserved[4]; - ULONG_PTR TdiClientReserved[4]; -} NET_PNP_EVENT, *PNET_PNP_EVENT; - -// -// The following structure defines the device power states. -// -typedef enum _NET_DEVICE_POWER_STATE -{ - NetDeviceStateUnspecified = 0, - NetDeviceStateD0, - NetDeviceStateD1, - NetDeviceStateD2, - NetDeviceStateD3, - NetDeviceStateMaximum -} NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE; - -#endif // __NET_PNP__ - -#pragma once - -// -// Indicate that we're building for NT. NDIS_NT is always used for -// miniport builds. -// - -#define NDIS_NT 1 - -#if defined(NDIS_DOS) -#undef NDIS_DOS -#endif - -// -// Define status codes and event log codes. -// - -#include -#include -#include - -#pragma warning(push) - - -#pragma warning(disable:4201) // (nonstandard extension used : nameless struct/union) -#pragma warning(disable:4214) // (extension used : bit field types other than int) - - -// -// Define a couple of extra types. -// - -#if !defined(_WINDEF_) // these are defined in windows.h too -typedef signed int INT, *PINT; -typedef unsigned int UINT, *PUINT; -#endif - -typedef UNICODE_STRING NDIS_STRING, *PNDIS_STRING; -// -// Landmarks for PFD and SDV to detect kernel mode drivers -// - -__drv_Mode_impl(NDIS_INCLUDED) - -// -// Portability extentions -// - -#define NDIS_INIT_FUNCTION(_F) alloc_text(INIT,_F) -#define NDIS_PAGABLE_FUNCTION(_F) alloc_text(PAGE,_F) -#define NDIS_PAGEABLE_FUNCTION(_F) alloc_text(PAGE,_F) - -// -// This file contains the definition of an NDIS_OID as -// well as #defines for all the current OID values. -// - -// -// Define NDIS_STATUS and NDIS_HANDLE here -// -typedef PVOID NDIS_HANDLE, *PNDIS_HANDLE; - -typedef int NDIS_STATUS, *PNDIS_STATUS; // note default size - -#if (!defined(NDIS_WRAPPER)) - - -#if defined(NTDDI_VERSION) -#if (NTDDI_VERSION > NTDDI_WIN7) -#error "unsupported NTDDI_VERSION" -#endif -#endif - - -// -// -// error out if driver has defined these values -// -#if (defined(NDIS_MINIPORT_MAJOR_VERSION) || \ - (defined(NDIS_MINIPORT_MINOR_VERSION)) || \ - (defined(NDIS_PROTOCOL_MAJOR_VERSION)) || \ - (defined(NDIS_PROTOCOL_MINOR_VERSION)) || \ - (defined(NDIS_FILTER_MAJOR_VERSION)) || \ - (defined(NDIS_FILTER_MINOR_VERSION))) -#error "Driver is re-defining NDIS reserved macros" -#endif - -#if (defined(NDIS_MINIPORT_DRIVER)) - -// -// for Miniports versions 5.0 and up, provide a consistent way to match -// Ndis version in their characteristics with their makefile defines -// -#if (defined(NDIS620_MINIPORT)) -#define NDIS_MINIPORT_MAJOR_VERSION 6 -#define NDIS_MINIPORT_MINOR_VERSION 20 -#elif (defined(NDIS61_MINIPORT)) -#define NDIS_MINIPORT_MAJOR_VERSION 6 -#define NDIS_MINIPORT_MINOR_VERSION 1 -#elif (defined(NDIS60_MINIPORT)) -#define NDIS_MINIPORT_MAJOR_VERSION 6 -#define NDIS_MINIPORT_MINOR_VERSION 0 -#elif (defined(NDIS51_MINIPORT)) -#define NDIS_MINIPORT_MAJOR_VERSION 5 -#define NDIS_MINIPORT_MINOR_VERSION 1 -#elif (defined(NDIS50_MINIPORT)) -#define NDIS_MINIPORT_MAJOR_VERSION 5 -#define NDIS_MINIPORT_MINOR_VERSION 0 -#else -#error ("Only NDIS miniport drivers with version >= 5 are supported") -#endif - - - -// -// disallow invalid major/minor combination -// -#if ((NDIS_MINIPORT_MAJOR_VERSION == 6) && \ - (NDIS_MINIPORT_MINOR_VERSION != 20) && \ - (NDIS_MINIPORT_MINOR_VERSION != 1) && \ - (NDIS_MINIPORT_MINOR_VERSION != 0)) -#error "Invalid Miniport major/minor version" -#elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \ - (NDIS_MINIPORT_MINOR_VERSION != 1) && \ - (NDIS_MINIPORT_MINOR_VERSION != 0)) -#error "Invalid Miniport major/minor version" -#endif - - - - -// -// make sure the target platform is consistent with miniport version -// -#if (NDIS_MINIPORT_MAJOR_VERSION == 6) && \ - ((NDIS_MINIPORT_MINOR_VERSION == 20 && NTDDI_VERSION < NTDDI_WIN7) || \ - (NDIS_MINIPORT_MINOR_VERSION == 1 && NTDDI_VERSION < NTDDI_VISTA) || \ - (NDIS_MINIPORT_MINOR_VERSION == 0 && NTDDI_VERSION < NTDDI_VISTA)) -#error "Wrong NDIS or DDI version specified" -#elif ((NDIS_MINIPORT_MAJOR_VERSION == 5) && \ - (((NDIS_MINIPORT_MINOR_VERSION == 1) && (NTDDI_VERSION < NTDDI_WINXP)) || \ - ((NDIS_MINIPORT_MINOR_VERSION == 0) && (NTDDI_VERSION < NTDDI_WIN2K)))) -#error "Wrong NDIS or DDI version specified" -#endif - - -#endif // NDIS_MINIPORT_DRIVER - - - -#if (defined(NDIS30)) -#error "Only NDIS Protocol drivers versions >= 4 are supported" -#endif - -// -// for protocol versions 4.0 and up, provide a consistent way to match -// Ndis version in their characteristics with their makefile defines -// -// -// a protocol only or filter driver -// - -#if (defined(NDIS620)) -#define NDIS_PROTOCOL_MAJOR_VERSION 6 -#define NDIS_PROTOCOL_MINOR_VERSION 20 -#define NDIS_FILTER_MAJOR_VERSION 6 -#define NDIS_FILTER_MINOR_VERSION 20 -#elif (defined(NDIS61)) -#define NDIS_PROTOCOL_MAJOR_VERSION 6 -#define NDIS_PROTOCOL_MINOR_VERSION 1 -#define NDIS_FILTER_MAJOR_VERSION 6 -#define NDIS_FILTER_MINOR_VERSION 1 -#elif (defined(NDIS60)) -#define NDIS_PROTOCOL_MAJOR_VERSION 6 -#define NDIS_PROTOCOL_MINOR_VERSION 0 -#define NDIS_FILTER_MAJOR_VERSION 6 -#define NDIS_FILTER_MINOR_VERSION 0 -#elif (defined(NDIS51)) -#define NDIS_PROTOCOL_MAJOR_VERSION 5 -#define NDIS_PROTOCOL_MINOR_VERSION 1 -#elif (defined(NDIS50)) -#define NDIS_PROTOCOL_MAJOR_VERSION 5 -#define NDIS_PROTOCOL_MINOR_VERSION 0 -#elif(defined(NDIS40)) -#define NDIS_PROTOCOL_MAJOR_VERSION 4 -#define NDIS_PROTOCOL_MINOR_VERSION 0 -#endif // (defined(NDIS60)) - - -#if (!defined(NDIS_MINIPORT_DRIVER) && !defined (NDIS_PROTOCOL_MAJOR_VERSION)) -// -// if it is not a miniport and -// NDIS_PROTOCOL_MAJOR_VERSION is not defined, define it here -// -#define NDIS40 -#define NDIS_PROTOCOL_MAJOR_VERSION 4 -#define NDIS_PROTOCOL_MINOR_VERSION 0 -#endif // (!defined(NDIS_MINIPORT_DRIVER) && !defined (NDIS_PROTOCOL_MAJOR_VERSION)) - - - -#if defined (NDIS_FILTER_MAJOR_VERSION) -// -// disallow invalid major/minor combination -// -#if ((NDIS_FILTER_MAJOR_VERSION == 6) && \ - (NDIS_FILTER_MINOR_VERSION != 20) && \ - (NDIS_FILTER_MINOR_VERSION != 1) && \ - (NDIS_FILTER_MINOR_VERSION != 0)) -#error "Invalid Filter version" -#endif -#endif // defined (NDIS_FILTER_MAJOR_VERSION) - - -#if defined (NDIS_PROTOCOL_MAJOR_VERSION) -// -// disallow invalid major/minor combination -// -#if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && \ - (NDIS_PROTOCOL_MINOR_VERSION != 20) && \ - (NDIS_PROTOCOL_MINOR_VERSION != 1) && \ - (NDIS_PROTOCOL_MINOR_VERSION != 0)) -#error "Invalid Protocol version" -#elif ((NDIS_PROTOCOL_MAJOR_VERSION == 5) && \ - (NDIS_PROTOCOL_MINOR_VERSION != 1) && (NDIS_PROTOCOL_MINOR_VERSION != 0)) -#error "Invalid Protocol version" -#elif ((NDIS_PROTOCOL_MAJOR_VERSION == 4) && (NDIS_PROTOCOL_MINOR_VERSION != 0)) -#error "Invalid Protocol major/minor version" -#endif - -// -// make sure the target platform is consistent with protocol version -// but don't stop NDIS protocol drivers older than 6.0 from specifying NTDDI_VISTA -// -#if ((NDIS_PROTOCOL_MAJOR_VERSION == 6) && (NTDDI_VERSION < NTDDI_VISTA)) -#error "Wrong NDIS or DDI version specified" -#endif -#endif // defined (NDIS_PROTOCOL_MAJOR_VERSION) - - - -#endif // !NDIS_WRAPPER - -// -// identify Legacy miniport drivers -// -#if !defined(NDIS_LEGACY_MINIPORT) -#if ((defined(NDIS_MINIPORT_DRIVER) && (NDIS_MINIPORT_MAJOR_VERSION < 6)) || NDIS_WRAPPER) -#define NDIS_LEGACY_MINIPORT 1 -#else -#define NDIS_LEGACY_MINIPORT 0 -#endif // ((defined(NDIS_MINIPORT_DRIVER) && (NDIS_MINIPORT_MAJOR_VERSION < 6)) || NDIS_WRAPPER) -#endif // !defined(NDIS_LEGACY_MINIPORT) - - -// -// identify Legacy protocol drivers -// -#if !defined(NDIS_LEGACY_PROTOCOL) -#if ((defined(NDIS_PROTOCOL_MAJOR_VERSION) && (NDIS_PROTOCOL_MAJOR_VERSION < 6)) || NDIS_WRAPPER) -#define NDIS_LEGACY_PROTOCOL 1 -#else -#define NDIS_LEGACY_PROTOCOL 0 -#endif // ((defined(NDIS_PROTOCOL_MAJOR_VERSION) && (NDIS_PROTOCOL_MAJOR_VERSION < 6)) || NDIS_WRAPPER) -#endif // !defined(NDIS_LEGACY_PROTOCOL) - - -// -// use something to identify legacy (pre NDIS 6 drivers) + NDIS itself -// -#if !defined(NDIS_LEGACY_DRIVER) -#if (NDIS_LEGACY_MINIPORT || NDIS_LEGACY_PROTOCOL || NDIS_WRAPPER) -#define NDIS_LEGACY_DRIVER 1 -#else -#define NDIS_LEGACY_DRIVER 0 -#endif // either protocol is legacy or miniport is legacy or this is NDIS -#endif // !defined(NDIS_LEGACY_DRIVER) - - -// -// and something to identify Vista+ drivers + NDIS itself -// -#if !defined(NDIS_SUPPORT_NDIS6) -#if ((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) || \ - (defined (NDIS60)) || NDIS_WRAPPER) -#define NDIS_SUPPORT_NDIS6 1 -#else -#define NDIS_SUPPORT_NDIS6 0 -#endif -#endif // !defined(NDIS_SUPPORT_NDIS6) - - -// -// and something to identify Server 2008+ drivers + NDIS itself -// -#if !defined(NDIS_SUPPORT_NDIS61) -#if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \ - (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 1))) || \ - (defined (NDIS61)) || NDIS_WRAPPER) -#define NDIS_SUPPORT_NDIS61 1 -#else -#define NDIS_SUPPORT_NDIS61 0 -#endif -#endif // !defined(NDIS_SUPPORT_NDIS61) - - -// -// and something to identify new (Win7 and up) drivers + NDIS itself -// -#if !defined(NDIS_SUPPORT_NDIS620) -#if (((defined (NDIS_MINIPORT_MAJOR_VERSION) && (NDIS_MINIPORT_MAJOR_VERSION >= 6)) && \ - (defined (NDIS_MINIPORT_MINOR_VERSION) && (NDIS_MINIPORT_MINOR_VERSION >= 20))) || \ - (defined (NDIS620)) || NDIS_WRAPPER) -#define NDIS_SUPPORT_NDIS620 1 -#else -#define NDIS_SUPPORT_NDIS620 0 -#endif -#endif // !defined(NDIS_SUPPORT_NDIS620) - -// -// Enable NDIS61 defines for NDIS 62 drivers -// -#if (NDIS_SUPPORT_NDIS620) -#undef NDIS_SUPPORT_NDIS61 -#define NDIS_SUPPORT_NDIS61 1 -#endif - -// -// Enable NDIS60 defines for NDIS 61 drivers -// -#if (NDIS_SUPPORT_NDIS61) -#undef NDIS_SUPPORT_NDIS6 -#define NDIS_SUPPORT_NDIS6 1 -#endif - -// -// Enable deprecated NDIS 6.0/1 APIs for NDIS 6.20+ drivers -// that also want to run the same binary on NDIS 6.0/1 -// In this case, such a driver would need to define both -// NDIS620_MINIPORT and NDIS60/61_MINIPORT -// Note: We cannot use NDIS_SUPPORT_NDIS6/61 in this check because -// that would be defined even for NDIS 6.20+ -// -#if defined(NDIS61_MINIPORT) || defined(NDIS60_MINIPORT) || \ - defined(NDIS61) || defined(NDIS60) || \ - defined(NDIS_WRAPPER) || defined(NDIS_LEGACY_DRIVER) -#define NDIS_SUPPORT_60_COMPATIBLE_API 1 -#else -#define NDIS_SUPPORT_60_COMPATIBLE_API 0 -#endif - -#include - -// -// Ndis defines for configuration manager data structures -// -typedef CM_MCA_POS_DATA NDIS_MCA_POS_DATA, *PNDIS_MCA_POS_DATA; -typedef CM_EISA_SLOT_INFORMATION NDIS_EISA_SLOT_INFORMATION, *PNDIS_EISA_SLOT_INFORMATION; -typedef CM_EISA_FUNCTION_INFORMATION NDIS_EISA_FUNCTION_INFORMATION, *PNDIS_EISA_FUNCTION_INFORMATION; - -// -// Define an exported function. -// -#if defined(NDIS_WRAPPER) -#define EXPORT -#else -#define EXPORT DECLSPEC_IMPORT -#endif - -#if NDIS_SUPPORT_NDIS6 -typedef struct _NDIS_GENERIC_OBJECT -{ - NDIS_OBJECT_HEADER Header; - PVOID Caller; - PVOID CallersCaller; - PDRIVER_OBJECT DriverObject; -} NDIS_GENERIC_OBJECT, *PNDIS_GENERIC_OBJECT; - -EXPORT -PNDIS_GENERIC_OBJECT -NdisAllocateGenericObject( - PDRIVER_OBJECT DriverObject OPTIONAL, - ULONG Tag, - USHORT Size - ); - -EXPORT -VOID -NdisFreeGenericObject( - IN PNDIS_GENERIC_OBJECT NdisObject - ); - -#endif // NDIS_SUPPORT_NDIS6 - - -// -// Memory manipulation functions. -// -#define NdisMoveMemory(Destination, Source, Length) RtlCopyMemory(Destination, Source, Length) -#define NdisZeroMemory(Destination, Length) RtlZeroMemory(Destination, Length) -#define NdisEqualMemory(Source1, Source2, Length) RtlEqualMemory(Source1, Source2, Length) -#define NdisFillMemory(Destination, Length, Fill) RtlFillMemory(Destination, Length, Fill) -#define NdisRetrieveUlong(Destination, Source) RtlRetrieveUlong(Destination, Source) -#define NdisStoreUlong(Destination, Value) RtlStoreUlong(Destination, Value) - -#define NDIS_STRING_CONST(x) {sizeof(L##x)-2, sizeof(L##x), L##x} - -// -// On a RISC machine, I/O mapped memory can't be accessed with -// the Rtl routines. -// -#if defined(_M_IX86) || defined(_M_AMD64) - -#define NdisMoveMappedMemory(Destination,Source,Length) RtlCopyMemory(Destination,Source,Length) -#define NdisZeroMappedMemory(Destination,Length) RtlZeroMemory(Destination,Length) - -#elif defined(_M_IA64) - -#define NdisMoveMappedMemory(Destination,Source,Length) \ -{ \ - PUCHAR _Src = (Source); \ - PUCHAR _Dest = (Destination); \ - PUCHAR _End = _Dest + (Length); \ - while (_Dest < _End) \ - { \ - *_Dest++ = *_Src++; \ - } \ -} - -#define NdisZeroMappedMemory(Destination,Length) \ -{ \ - PUCHAR _Dest = (Destination); \ - PUCHAR _End = _Dest + (Length); \ - while (_Dest < _End) \ - { \ - *_Dest++ = 0; \ - } \ -} -#endif - - -#define NdisMoveToMappedMemory(Destination,Source,Length) \ - NdisMoveMappedMemory(Destination,Source,Length) -#define NdisMoveFromMappedMemory(Destination,Source,Length) \ - NdisMoveMappedMemory(Destination,Source,Length) - - -// -// definition of the basic spin lock structure -// - -typedef struct _NDIS_SPIN_LOCK -{ - KSPIN_LOCK SpinLock; - KIRQL OldIrql; -} NDIS_SPIN_LOCK, * PNDIS_SPIN_LOCK; - - -// -// definition of the ndis event structure -// -typedef struct _NDIS_EVENT -{ - KEVENT Event; -} NDIS_EVENT, *PNDIS_EVENT; - -#pragma warning(push) -#pragma warning(disable:4115) // named type definition in parenthesis -typedef VOID (*NDIS_PROC)(struct _NDIS_WORK_ITEM *, PVOID); -#pragma warning(pop) - - -// -// Definition of an ndis work-item -// -typedef struct _NDIS_WORK_ITEM -{ - PVOID Context; - NDIS_PROC Routine; - UCHAR WrapperReserved[8*sizeof(PVOID)]; -} NDIS_WORK_ITEM, *PNDIS_WORK_ITEM; - -#define NdisInterruptLatched Latched -#define NdisInterruptLevelSensitive LevelSensitive -typedef KINTERRUPT_MODE NDIS_INTERRUPT_MODE, *PNDIS_INTERRUPT_MODE; - -// -// Configuration definitions -// - -// -// Possible data types -// - -typedef enum _NDIS_PARAMETER_TYPE -{ - NdisParameterInteger, - NdisParameterHexInteger, - NdisParameterString, - NdisParameterMultiString, - NdisParameterBinary -} NDIS_PARAMETER_TYPE, *PNDIS_PARAMETER_TYPE; - -typedef struct -{ - USHORT Length; - PVOID Buffer; -} BINARY_DATA; - -// -// To store configuration information -// -typedef struct _NDIS_CONFIGURATION_PARAMETER -{ - NDIS_PARAMETER_TYPE ParameterType; - union - { - ULONG IntegerData; - NDIS_STRING StringData; - BINARY_DATA BinaryData; - } ParameterData; -} NDIS_CONFIGURATION_PARAMETER, *PNDIS_CONFIGURATION_PARAMETER; - - -// -// Definitions for the "ProcessorType" keyword -// -typedef enum _NDIS_PROCESSOR_TYPE -{ - NdisProcessorX86, - NdisProcessorMips, - NdisProcessorAlpha, - NdisProcessorPpc, - NdisProcessorAmd64, - NdisProcessorIA64 -} NDIS_PROCESSOR_TYPE, *PNDIS_PROCESSOR_TYPE; - -// -// Definitions for the "Environment" keyword -// -typedef enum _NDIS_ENVIRONMENT_TYPE -{ - NdisEnvironmentWindows, - NdisEnvironmentWindowsNt -} NDIS_ENVIRONMENT_TYPE, *PNDIS_ENVIRONMENT_TYPE; - - -// -// Possible Hardware Architecture. Define these to -// match the HAL INTERFACE_TYPE enum. -// -typedef enum _NDIS_INTERFACE_TYPE -{ - NdisInterfaceInternal = Internal, - NdisInterfaceIsa = Isa, - NdisInterfaceEisa = Eisa, - NdisInterfaceMca = MicroChannel, - NdisInterfaceTurboChannel = TurboChannel, - NdisInterfacePci = PCIBus, - NdisInterfacePcMcia = PCMCIABus, - NdisInterfaceCBus = CBus, - NdisInterfaceMPIBus = MPIBus, - NdisInterfaceMPSABus = MPSABus, - NdisInterfaceProcessorInternal = ProcessorInternal, - NdisInterfaceInternalPowerBus = InternalPowerBus, - NdisInterfacePNPISABus = PNPISABus, - NdisInterfacePNPBus = PNPBus, - NdisInterfaceUSB, - NdisInterfaceIrda, - NdisInterface1394, - NdisMaximumInterfaceType -} NDIS_INTERFACE_TYPE, *PNDIS_INTERFACE_TYPE; - -// -// Stuff for PCI configuring -// - -typedef CM_PARTIAL_RESOURCE_LIST NDIS_RESOURCE_LIST, *PNDIS_RESOURCE_LIST; - - -// -// The structure passed up on a WAN_LINE_UP indication -// - -typedef struct _NDIS_WAN_LINE_UP -{ - IN ULONG LinkSpeed; // 100 bps units - IN ULONG MaximumTotalSize; // suggested max for send packets - IN NDIS_WAN_QUALITY Quality; - IN USHORT SendWindow; // suggested by the MAC - IN UCHAR RemoteAddress[6]; - IN OUT UCHAR LocalAddress[6]; - IN ULONG ProtocolBufferLength; // Length of protocol info buffer - IN PUCHAR ProtocolBuffer; // Information used by protocol - IN USHORT ProtocolType; // Protocol ID - IN OUT NDIS_STRING DeviceName; -} NDIS_WAN_LINE_UP, *PNDIS_WAN_LINE_UP; - - -// -// The structure passed up on a WAN_LINE_DOWN indication -// - -typedef struct _NDIS_WAN_LINE_DOWN -{ - IN UCHAR RemoteAddress[6]; - IN UCHAR LocalAddress[6]; -} NDIS_WAN_LINE_DOWN, *PNDIS_WAN_LINE_DOWN; - -// -// The structure passed up on a WAN_FRAGMENT indication -// - -typedef struct _NDIS_WAN_FRAGMENT -{ - IN UCHAR RemoteAddress[6]; - IN UCHAR LocalAddress[6]; -} NDIS_WAN_FRAGMENT, *PNDIS_WAN_FRAGMENT; - -// -// The structure passed up on a WAN_GET_STATS indication -// - -typedef struct _NDIS_WAN_GET_STATS -{ - IN UCHAR LocalAddress[6]; - OUT ULONG BytesSent; - OUT ULONG BytesRcvd; - OUT ULONG FramesSent; - OUT ULONG FramesRcvd; - OUT ULONG CRCErrors; // Serial-like info only - OUT ULONG TimeoutErrors; // Serial-like info only - OUT ULONG AlignmentErrors; // Serial-like info only - OUT ULONG SerialOverrunErrors; // Serial-like info only - OUT ULONG FramingErrors; // Serial-like info only - OUT ULONG BufferOverrunErrors; // Serial-like info only - OUT ULONG BytesTransmittedUncompressed; // Compression info only - OUT ULONG BytesReceivedUncompressed; // Compression info only - OUT ULONG BytesTransmittedCompressed; // Compression info only - OUT ULONG BytesReceivedCompressed; // Compression info only -} NDIS_WAN_GET_STATS, *PNDIS_WAN_GET_STATS; - - -// -// Ndis Buffer is actually an Mdl -// -typedef MDL NDIS_BUFFER, *PNDIS_BUFFER; - -#if NDIS_LEGACY_DRIVER -struct _NDIS_PACKET; -typedef NDIS_HANDLE PNDIS_PACKET_POOL; - -// -// -// wrapper-specific part of a packet -// -typedef struct _NDIS_PACKET_PRIVATE -{ - UINT PhysicalCount; // number of physical pages in packet. - UINT TotalLength; // Total amount of data in the packet. - PNDIS_BUFFER Head; // first buffer in the chain - PNDIS_BUFFER Tail; // last buffer in the chain - - // if Head is NULL the chain is empty; Tail doesn't have to be NULL also - - PNDIS_PACKET_POOL Pool; // so we know where to free it back to - UINT Count; - ULONG Flags; - BOOLEAN ValidCounts; - UCHAR NdisPacketFlags; // See fPACKET_xxx bits below - USHORT NdisPacketOobOffset; -} NDIS_PACKET_PRIVATE, * PNDIS_PACKET_PRIVATE; - -// -// The bits define the bits in the Flags -// -#define NDIS_FLAGS_PROTOCOL_ID_MASK 0x0000000F // The low 4 bits are defined for protocol-id - // The values are defined in ntddndis.h -#define NDIS_FLAGS_MULTICAST_PACKET 0x00000010 // don't use -#define NDIS_FLAGS_RESERVED2 0x00000020 // don't use -#define NDIS_FLAGS_RESERVED3 0x00000040 // don't use -#define NDIS_FLAGS_DONT_LOOPBACK 0x00000080 // Write only -#define NDIS_FLAGS_IS_LOOPBACK_PACKET 0x00000100 // Read only -#define NDIS_FLAGS_LOOPBACK_ONLY 0x00000200 // Write only -#define NDIS_FLAGS_RESERVED4 0x00000400 // don't use -#define NDIS_FLAGS_DOUBLE_BUFFERED 0x00000800 // used by ndis -#define NDIS_FLAGS_SENT_AT_DPC 0x00001000 // the protocol sent this packet at DPC -#define NDIS_FLAGS_USES_SG_BUFFER_LIST 0x00002000 // used by Ndis -#define NDIS_FLAGS_USES_ORIGINAL_PACKET 0x00004000 // used by Ndis -#define NDIS_FLAGS_PADDED 0x00010000 // used by NDIS -#define NDIS_FLAGS_XLATE_AT_TOP 0x00020000 // used by NDIS - -// -// Low-bits in the NdisPacketFlags are reserved by NDIS Wrapper for internal use -// -#define fPACKET_WRAPPER_RESERVED 0x3F -#define fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO 0x40 -#define fPACKET_ALLOCATED_BY_NDIS 0x80 - -#endif // NDIS_LEGACY_DRIVER - -// -// Definition for layout of the media-specific data. More than one class of media-specific -// information can be tagged onto a packet. -// -typedef enum _NDIS_CLASS_ID -{ - NdisClass802_3Priority, - NdisClassWirelessWanMbxMailbox, - NdisClassIrdaPacketInfo, - NdisClassAtmAALInfo - -} NDIS_CLASS_ID; - -typedef struct _MEDIA_SPECIFIC_INFORMATION -{ - UINT NextEntryOffset; - NDIS_CLASS_ID ClassId; - UINT Size; - UCHAR ClassInformation[1]; - -} MEDIA_SPECIFIC_INFORMATION, *PMEDIA_SPECIFIC_INFORMATION; - -#if NDIS_LEGACY_DRIVER - -typedef struct _NDIS_PACKET_OOB_DATA -{ - union - { - ULONGLONG TimeToSend; - ULONGLONG TimeSent; - }; - ULONGLONG TimeReceived; - UINT HeaderSize; - UINT SizeMediaSpecificInfo; - PVOID MediaSpecificInformation; - - NDIS_STATUS Status; -} NDIS_PACKET_OOB_DATA, *PNDIS_PACKET_OOB_DATA; - -#define NDIS_GET_PACKET_PROTOCOL_TYPE(_Packet_) ((_Packet_)->Private.Flags & NDIS_PROTOCOL_ID_MASK) - -#define NDIS_OOB_DATA_FROM_PACKET(_p) \ - (PNDIS_PACKET_OOB_DATA)((PUCHAR)(_p) + \ - (_p)->Private.NdisPacketOobOffset) -#define NDIS_GET_PACKET_HEADER_SIZE(_Packet) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->HeaderSize -#define NDIS_GET_PACKET_STATUS(_Packet) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->Status -#define NDIS_GET_PACKET_TIME_TO_SEND(_Packet) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeToSend -#define NDIS_GET_PACKET_TIME_SENT(_Packet) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeSent -#define NDIS_GET_PACKET_TIME_RECEIVED(_Packet) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeReceived -#define NDIS_GET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \ - _pMediaSpecificInfo, \ - _pSizeMediaSpecificInfo) \ -{ \ - if (!((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) ||\ - !((_Packet)->Private.NdisPacketFlags & fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO))\ - { \ - *(_pMediaSpecificInfo) = NULL; \ - *(_pSizeMediaSpecificInfo) = 0; \ - } \ - else \ - { \ - *(_pMediaSpecificInfo) =((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) +\ - (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation;\ - *(_pSizeMediaSpecificInfo) = ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) +\ - (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo;\ - } \ -} - -#define NDIS_SET_PACKET_HEADER_SIZE(_Packet, _HdrSize) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->HeaderSize = (_HdrSize) -#define NDIS_SET_PACKET_STATUS(_Packet, _Status) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->Status = (_Status) -#define NDIS_SET_PACKET_TIME_TO_SEND(_Packet, _TimeToSend) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeToSend = (_TimeToSend) -#define NDIS_SET_PACKET_TIME_SENT(_Packet, _TimeSent) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeSent = (_TimeSent) -#define NDIS_SET_PACKET_TIME_RECEIVED(_Packet, _TimeReceived) \ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->TimeReceived = (_TimeReceived) -#define NDIS_SET_PACKET_MEDIA_SPECIFIC_INFO(_Packet, \ - _MediaSpecificInfo, \ - _SizeMediaSpecificInfo) \ -{ \ - if ((_Packet)->Private.NdisPacketFlags & fPACKET_ALLOCATED_BY_NDIS) \ - { \ - (_Packet)->Private.NdisPacketFlags |= fPACKET_CONTAINS_MEDIA_SPECIFIC_INFO;\ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->MediaSpecificInformation = (_MediaSpecificInfo);\ - ((PNDIS_PACKET_OOB_DATA)((PUCHAR)(_Packet) + \ - (_Packet)->Private.NdisPacketOobOffset))->SizeMediaSpecificInfo = (_SizeMediaSpecificInfo);\ - } \ -} - -// -// packet definition -// -typedef struct _NDIS_PACKET -{ - NDIS_PACKET_PRIVATE Private; - - union - { - struct // For Connection-less miniports - { - UCHAR MiniportReserved[2*sizeof(PVOID)]; - UCHAR WrapperReserved[2*sizeof(PVOID)]; - }; - - struct - { - // - // For de-serialized miniports. And by implication conn-oriented miniports. - // - UCHAR MiniportReservedEx[3*sizeof(PVOID)]; - UCHAR WrapperReservedEx[sizeof(PVOID)]; - }; - - struct - { - UCHAR MacReserved[4*sizeof(PVOID)]; - }; - }; - - ULONG_PTR Reserved[2]; // For compatibility with Win95 - UCHAR ProtocolReserved[1]; - -} NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET; - -#endif // NDIS_LEGACY_DRIVER - -// -// NDIS per-packet information. -// -typedef enum _NDIS_PER_PACKET_INFO -{ - TcpIpChecksumPacketInfo, - IpSecPacketInfo, - TcpLargeSendPacketInfo, - ClassificationHandlePacketInfo, - NdisReserved, - ScatterGatherListPacketInfo, - Ieee8021QInfo, - OriginalPacketInfo, - PacketCancelId, - OriginalNetBufferList, - CachedNetBufferList, - ShortPacketPaddingInfo, - MaxPerPacketInfo -} NDIS_PER_PACKET_INFO, *PNDIS_PER_PACKET_INFO; - -#if NDIS_LEGACY_DRIVER -typedef struct _NDIS_PACKET_EXTENSION -{ - PVOID NdisPacketInfo[MaxPerPacketInfo]; -} NDIS_PACKET_EXTENSION, *PNDIS_PACKET_EXTENSION; - -#define NDIS_PACKET_EXTENSION_FROM_PACKET(_P) ((PNDIS_PACKET_EXTENSION)((PUCHAR)(_P) + (_P)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA))) -#define NDIS_PER_PACKET_INFO_FROM_PACKET(_P, _Id) ((PNDIS_PACKET_EXTENSION)((PUCHAR)(_P) + (_P)->Private.NdisPacketOobOffset + sizeof(NDIS_PACKET_OOB_DATA)))->NdisPacketInfo[(_Id)] -#define NDIS_GET_ORIGINAL_PACKET(_P) NDIS_PER_PACKET_INFO_FROM_PACKET(_P, OriginalPacketInfo) -#define NDIS_SET_ORIGINAL_PACKET(_P, _OP) NDIS_PER_PACKET_INFO_FROM_PACKET(_P, OriginalPacketInfo) = _OP -#define NDIS_GET_PACKET_CANCEL_ID(_P) NDIS_PER_PACKET_INFO_FROM_PACKET(_P, PacketCancelId) -#define NDIS_SET_PACKET_CANCEL_ID(_P, _cId) NDIS_PER_PACKET_INFO_FROM_PACKET(_P, PacketCancelId) = _cId - - -// -// Ndis 5.1 entry points for setting/gettign packet's CancelId and cancelling send packets -// - -/* -EXPORT -VOID -NdisSetPacketCancelId( - IN PNDIS_PACKET Packet, - IN PVOID CancelId - ); -*/ -#define NdisSetPacketCancelId(_Packet, _CancelId) NDIS_SET_PACKET_CANCEL_ID(_Packet, _CancelId) - -/* -EXPORT -PVOID -NdisGetPacketCancelId( - IN PNDIS_PACKET Packet - ); -*/ -#define NdisGetPacketCancelId(_Packet) NDIS_GET_PACKET_CANCEL_ID(_Packet) - - -typedef struct _NDIS_PACKET_STACK -{ - ULONG_PTR IMReserved[2]; - ULONG_PTR NdisReserved[4]; -} NDIS_PACKET_STACK, *PNDIS_PACKET_STACK; - - -#endif // NDIS_LEGACY_DRIVER - -// -// Per-packet information for TcpIpChecksumPacketInfo. -// - - - - - -typedef struct _NDIS_TCP_IP_CHECKSUM_PACKET_INFO -{ - union - { - struct - { - ULONG NdisPacketChecksumV4:1; - ULONG NdisPacketChecksumV6:1; - ULONG NdisPacketTcpChecksum:1; - ULONG NdisPacketUdpChecksum:1; - ULONG NdisPacketIpChecksum:1; - } Transmit; - - struct - { - ULONG NdisPacketTcpChecksumFailed:1; - ULONG NdisPacketUdpChecksumFailed:1; - ULONG NdisPacketIpChecksumFailed:1; - ULONG NdisPacketTcpChecksumSucceeded:1; - ULONG NdisPacketUdpChecksumSucceeded:1; - ULONG NdisPacketIpChecksumSucceeded:1; - ULONG NdisPacketLoopback:1; - } Receive; - - ULONG Value; - }; -} NDIS_TCP_IP_CHECKSUM_PACKET_INFO, *PNDIS_TCP_IP_CHECKSUM_PACKET_INFO; - - -// -// Per-packet information for Ieee8021QInfo. -// -typedef struct _NDIS_PACKET_8021Q_INFO -{ - union - { - struct - { - UINT32 UserPriority:3; // 802.1p priority - UINT32 CanonicalFormatId:1; // always 0 - UINT32 VlanId:12; // VLAN Identification - UINT32 Reserved:16; // set to 0 - } TagHeader; - - PVOID Value; - }; -} NDIS_PACKET_8021Q_INFO, *PNDIS_PACKET_8021Q_INFO; - - -#if NDIS_LEGACY_DRIVER -// -// Old definitions, to be obsoleted. -// -#define Ieee8021pPriority Ieee8021QInfo -typedef UINT IEEE8021PPRIORITY; - -// -// WAN Packet. This is used by WAN miniports only. This is the legacy model. -// Co-Ndis is the preferred model for WAN miniports -// -typedef struct _NDIS_WAN_PACKET -{ - LIST_ENTRY WanPacketQueue; - PUCHAR CurrentBuffer; - ULONG CurrentLength; - PUCHAR StartBuffer; - PUCHAR EndBuffer; - PVOID ProtocolReserved1; - PVOID ProtocolReserved2; - PVOID ProtocolReserved3; - PVOID ProtocolReserved4; - PVOID MacReserved1; - PVOID MacReserved2; - PVOID MacReserved3; - PVOID MacReserved4; -} NDIS_WAN_PACKET, *PNDIS_WAN_PACKET; - -// -// Routines to get/set packet flags -// - -/*++ - -UINT -NdisGetPacketFlags( - IN PNDIS_PACKET Packet - ); - ---*/ - -#define NdisGetPacketFlags(_Packet) ((_Packet)->Private.Flags) - -#define NDIS_PACKET_FIRST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Head) -#define NDIS_PACKET_LAST_NDIS_BUFFER(_Packet) ((_Packet)->Private.Tail) -#define NDIS_PACKET_VALID_COUNTS(_Packet) ((_Packet)->Private.ValidCounts) - - -/*++ - -VOID -NdisSetPacketFlags( - IN PNDIS_PACKET Packet, - IN UINT Flags - ); - ---*/ - -#define NdisSetPacketFlags(_Packet, _Flags) (_Packet)->Private.Flags |= (_Flags) -#define NdisClearPacketFlags(_Packet, _Flags) (_Packet)->Private.Flags &= ~(_Flags) - -#endif // NDIS_LEGACY_DRIVER - -// -// Request types used by NdisRequest; constants are added for -// all entry points in the MAC, for those that want to create -// their own internal requests. -// - -#if NDIS_SUPPORT_NDIS6 -typedef enum _NDIS_REQUEST_TYPE -{ - NdisRequestQueryInformation, - NdisRequestSetInformation, - NdisRequestQueryStatistics, - NdisRequestOpen, - NdisRequestClose, - NdisRequestSend, - NdisRequestTransferData, - NdisRequestReset, - NdisRequestGeneric1, - NdisRequestGeneric2, - NdisRequestGeneric3, - NdisRequestGeneric4, - NdisRequestMethod, -} NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE; -#else -typedef enum _NDIS_REQUEST_TYPE -{ - NdisRequestQueryInformation, - NdisRequestSetInformation, - NdisRequestQueryStatistics, - NdisRequestOpen, - NdisRequestClose, - NdisRequestSend, - NdisRequestTransferData, - NdisRequestReset, - NdisRequestGeneric1, - NdisRequestGeneric2, - NdisRequestGeneric3, - NdisRequestGeneric4, -} NDIS_REQUEST_TYPE, *PNDIS_REQUEST_TYPE; -#endif // NDIS_SUPPORT_NDIS6 - - -#if NDIS_LEGACY_DRIVER - -// -// Structure of requests sent via NdisRequest -// - -typedef struct _NDIS_REQUEST -{ - UCHAR MacReserved[4*sizeof(PVOID)]; - NDIS_REQUEST_TYPE RequestType; - union _DATA - { - struct _QUERY_INFORMATION - { - NDIS_OID Oid; - PVOID InformationBuffer; - UINT InformationBufferLength; - UINT BytesWritten; - UINT BytesNeeded; - } QUERY_INFORMATION; - - struct _SET_INFORMATION - { - NDIS_OID Oid; - PVOID InformationBuffer; - UINT InformationBufferLength; - UINT BytesRead; - UINT BytesNeeded; - } SET_INFORMATION; - - } DATA; -#if (defined(NDIS50) || defined(NDIS51) || defined(NDIS50_MINIPORT) || defined(NDIS51_MINIPORT)) - UCHAR NdisReserved[9*sizeof(PVOID)]; - union - { - UCHAR CallMgrReserved[2*sizeof(PVOID)]; - UCHAR ProtocolReserved[2*sizeof(PVOID)]; - }; - UCHAR MiniportReserved[2*sizeof(PVOID)]; -#endif -} NDIS_REQUEST, *PNDIS_REQUEST; - -#endif - -// -// NDIS Address Family definitions. -// -typedef ULONG NDIS_AF, *PNDIS_AF; -#define CO_ADDRESS_FAMILY_Q2931 ((NDIS_AF)0x1) // ATM -#define CO_ADDRESS_FAMILY_PSCHED ((NDIS_AF)0x2) // Packet scheduler -#define CO_ADDRESS_FAMILY_L2TP ((NDIS_AF)0x3) -#define CO_ADDRESS_FAMILY_IRDA ((NDIS_AF)0x4) -#define CO_ADDRESS_FAMILY_1394 ((NDIS_AF)0x5) -#define CO_ADDRESS_FAMILY_PPP ((NDIS_AF)0x6) -#define CO_ADDRESS_FAMILY_INFINIBAND ((NDIS_AF)0x7) -#define CO_ADDRESS_FAMILY_TAPI ((NDIS_AF)0x800) -#define CO_ADDRESS_FAMILY_TAPI_PROXY ((NDIS_AF)0x801) - -// -// The following is OR'ed with the base AF to denote proxy support -// -#define CO_ADDRESS_FAMILY_PROXY 0x80000000 - - -// -// Address family structure registered/opened via -// NdisCmRegisterAddressFamily -// NdisClOpenAddressFamily -// -typedef struct -{ - NDIS_AF AddressFamily; // one of the CO_ADDRESS_FAMILY_xxx values above - ULONG MajorVersion; // the major version of call manager - ULONG MinorVersion; // the minor version of call manager -} CO_ADDRESS_FAMILY, *PCO_ADDRESS_FAMILY; - -// -// Definition for a SAP -// -typedef struct -{ - ULONG SapType; - ULONG SapLength; - UCHAR Sap[1]; -} CO_SAP, *PCO_SAP; - -// -// Definitions for physical address. -// - -typedef PHYSICAL_ADDRESS NDIS_PHYSICAL_ADDRESS, *PNDIS_PHYSICAL_ADDRESS; -typedef struct _NDIS_PHYSICAL_ADDRESS_UNIT -{ - NDIS_PHYSICAL_ADDRESS PhysicalAddress; - UINT Length; -} NDIS_PHYSICAL_ADDRESS_UNIT, *PNDIS_PHYSICAL_ADDRESS_UNIT; - - -/*++ - -ULONG -NdisGetPhysicalAddressHigh( - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress - ); - ---*/ - -#define NdisGetPhysicalAddressHigh(_PhysicalAddress) \ - ((_PhysicalAddress).HighPart) - -/*++ - -VOID -NdisSetPhysicalAddressHigh( - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, - IN ULONG Value - ); - ---*/ - -#define NdisSetPhysicalAddressHigh(_PhysicalAddress, _Value) \ - ((_PhysicalAddress).HighPart) = (_Value) - - -/*++ - -ULONG -NdisGetPhysicalAddressLow( - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress - ); - ---*/ - -#define NdisGetPhysicalAddressLow(_PhysicalAddress) \ - ((_PhysicalAddress).LowPart) - - -/*++ - -VOID -NdisSetPhysicalAddressLow( - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, - IN ULONG Value - ); - ---*/ - -#define NdisSetPhysicalAddressLow(_PhysicalAddress, _Value) \ - ((_PhysicalAddress).LowPart) = (_Value) - -// -// Macro to initialize an NDIS_PHYSICAL_ADDRESS constant -// - -#define NDIS_PHYSICAL_ADDRESS_CONST(_Low, _High) \ - { (ULONG)(_Low), (LONG)(_High) } - -// -// block used for references... -// -typedef struct _REFERENCE -{ - KSPIN_LOCK SpinLock; - USHORT ReferenceCount; - BOOLEAN Closing; -} REFERENCE, * PREFERENCE; - -// -// Types of Memory (not mutually exclusive) -// - -#define NDIS_MEMORY_CONTIGUOUS 0x00000001 -#define NDIS_MEMORY_NONCACHED 0x00000002 - -// -// Open options -// - -// -// This flag has been deprecated -// -#pragma deprecated(NDIS_OPEN_RECEIVE_NOT_REENTRANT) -#define NDIS_OPEN_RECEIVE_NOT_REENTRANT 0x00000001 - -// -// NDIS_STATUS values used in status indication -// - -#define NDIS_STATUS_ONLINE ((NDIS_STATUS)0x40010003L) -#define NDIS_STATUS_RESET_START ((NDIS_STATUS)0x40010004L) -#define NDIS_STATUS_RESET_END ((NDIS_STATUS)0x40010005L) -#define NDIS_STATUS_RING_STATUS ((NDIS_STATUS)0x40010006L) -#define NDIS_STATUS_CLOSED ((NDIS_STATUS)0x40010007L) -#define NDIS_STATUS_WAN_LINE_UP ((NDIS_STATUS)0x40010008L) -#define NDIS_STATUS_WAN_LINE_DOWN ((NDIS_STATUS)0x40010009L) -#define NDIS_STATUS_WAN_FRAGMENT ((NDIS_STATUS)0x4001000AL) -#define NDIS_STATUS_MEDIA_CONNECT ((NDIS_STATUS)0x4001000BL) -#define NDIS_STATUS_MEDIA_DISCONNECT ((NDIS_STATUS)0x4001000CL) -#define NDIS_STATUS_HARDWARE_LINE_UP ((NDIS_STATUS)0x4001000DL) -#define NDIS_STATUS_HARDWARE_LINE_DOWN ((NDIS_STATUS)0x4001000EL) -#define NDIS_STATUS_INTERFACE_UP ((NDIS_STATUS)0x4001000FL) -#define NDIS_STATUS_INTERFACE_DOWN ((NDIS_STATUS)0x40010010L) -#define NDIS_STATUS_MEDIA_BUSY ((NDIS_STATUS)0x40010011L) -#define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION ((NDIS_STATUS)0x40010012L) -#define NDIS_STATUS_WW_INDICATION NDIS_STATUS_MEDIA_SPECIFIC_INDICATION -#define NDIS_STATUS_LINK_SPEED_CHANGE ((NDIS_STATUS)0x40010013L) -#define NDIS_STATUS_WAN_GET_STATS ((NDIS_STATUS)0x40010014L) -#define NDIS_STATUS_WAN_CO_FRAGMENT ((NDIS_STATUS)0x40010015L) -#define NDIS_STATUS_WAN_CO_LINKPARAMS ((NDIS_STATUS)0x40010016L) -#define NDIS_STATUS_WAN_CO_MTULINKPARAMS ((NDIS_STATUS)0x40010025L) -// -// new status indication codes used by NDIS 6 drivers -// -#if NDIS_SUPPORT_NDIS6 -#define NDIS_STATUS_LINK_STATE ((NDIS_STATUS)0x40010017L) -#define NDIS_STATUS_NETWORK_CHANGE ((NDIS_STATUS)0x40010018L) -#define NDIS_STATUS_MEDIA_SPECIFIC_INDICATION_EX ((NDIS_STATUS)0x40010019L) -#define NDIS_STATUS_PORT_STATE ((NDIS_STATUS)0x40010022L) -#define NDIS_STATUS_OPER_STATUS ((NDIS_STATUS)0x40010023L) -#define NDIS_STATUS_PACKET_FILTER ((NDIS_STATUS)0x40010024L) -// Note that 0x40010025L is reserved for NDIS_STATUS_WAN_CO_MTULINKPARAMS - -#define NDIS_STATUS_IP_OPER_STATUS ((NDIS_STATUS)0x40010026L) - -// -// offload specific status indication codes -// -#define NDIS_STATUS_OFFLOAD_PAUSE ((NDIS_STATUS)0x40020001L) -#define NDIS_STATUS_UPLOAD_ALL ((NDIS_STATUS)0x40020002L) -#define NDIS_STATUS_OFFLOAD_RESUME ((NDIS_STATUS)0x40020003L) -#define NDIS_STATUS_OFFLOAD_PARTIAL_SUCCESS ((NDIS_STATUS)0x40020004L) -#define NDIS_STATUS_OFFLOAD_STATE_INVALID ((NDIS_STATUS)0x40020005L) -#define NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG ((NDIS_STATUS)0x40020006L) -#define NDIS_STATUS_TASK_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x40020007L) -#define NDIS_STATUS_OFFLOAD_ENCASPULATION_CHANGE ((NDIS_STATUS)0x40020008L) -#define NDIS_STATUS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES ((NDIS_STATUS)0x4002000BL) -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG ((NDIS_STATUS)0x4002000CL) -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_STATUS_RECEIVE_QUEUE_STATE ((NDIS_STATUS)0x4002000DL) -#endif - -#define NDIS_STATUS_OFFLOAD_IM_RESERVED1 ((NDIS_STATUS)0x40020100L) -#define NDIS_STATUS_OFFLOAD_IM_RESERVED2 ((NDIS_STATUS)0x40020101L) -#define NDIS_STATUS_OFFLOAD_IM_RESERVED3 ((NDIS_STATUS)0x40020102L) - -// -// 802.11 specific status indication codes -// -#define NDIS_STATUS_DOT11_SCAN_CONFIRM ((NDIS_STATUS)0x40030000L) -#define NDIS_STATUS_DOT11_MPDU_MAX_LENGTH_CHANGED ((NDIS_STATUS)0x40030001L) -#define NDIS_STATUS_DOT11_ASSOCIATION_START ((NDIS_STATUS)0x40030002L) -#define NDIS_STATUS_DOT11_ASSOCIATION_COMPLETION ((NDIS_STATUS)0x40030003L) -#define NDIS_STATUS_DOT11_CONNECTION_START ((NDIS_STATUS)0x40030004L) -#define NDIS_STATUS_DOT11_CONNECTION_COMPLETION ((NDIS_STATUS)0x40030005L) -#define NDIS_STATUS_DOT11_ROAMING_START ((NDIS_STATUS)0x40030006L) -#define NDIS_STATUS_DOT11_ROAMING_COMPLETION ((NDIS_STATUS)0x40030007L) -#define NDIS_STATUS_DOT11_DISASSOCIATION ((NDIS_STATUS)0x40030008L) -#define NDIS_STATUS_DOT11_TKIPMIC_FAILURE ((NDIS_STATUS)0x40030009L) -#define NDIS_STATUS_DOT11_PMKID_CANDIDATE_LIST ((NDIS_STATUS)0x4003000AL) -#define NDIS_STATUS_DOT11_PHY_STATE_CHANGED ((NDIS_STATUS)0x4003000BL) -#define NDIS_STATUS_DOT11_LINK_QUALITY ((NDIS_STATUS)0x4003000CL) -#define NDIS_STATUS_DOT11_INCOMING_ASSOC_STARTED ((NDIS_STATUS)0x4003000DL) -#define NDIS_STATUS_DOT11_INCOMING_ASSOC_REQUEST_RECEIVED ((NDIS_STATUS)0x4003000EL) -#define NDIS_STATUS_DOT11_INCOMING_ASSOC_COMPLETION ((NDIS_STATUS)0x4003000FL) -#define NDIS_STATUS_DOT11_STOP_AP ((NDIS_STATUS)0x40030010L) -#define NDIS_STATUS_DOT11_PHY_FREQUENCY_ADOPTED ((NDIS_STATUS)0x40030011L) -#define NDIS_STATUS_DOT11_CAN_SUSTAIN_AP ((NDIS_STATUS)0x40030012L) - -// -// Add WWAN specific status indication codes -// -#define NDIS_STATUS_WWAN_DEVICE_CAPS ((NDIS_STATUS)0x40041000) -#define NDIS_STATUS_WWAN_READY_INFO ((NDIS_STATUS)0x40041001) -#define NDIS_STATUS_WWAN_RADIO_STATE ((NDIS_STATUS)0x40041002) -#define NDIS_STATUS_WWAN_PIN_INFO ((NDIS_STATUS)0x40041003) -#define NDIS_STATUS_WWAN_PIN_LIST ((NDIS_STATUS)0x40041004) -#define NDIS_STATUS_WWAN_HOME_PROVIDER ((NDIS_STATUS)0x40041005) -#define NDIS_STATUS_WWAN_PREFERRED_PROVIDERS ((NDIS_STATUS)0x40041006) -#define NDIS_STATUS_WWAN_VISIBLE_PROVIDERS ((NDIS_STATUS)0x40041007) -#define NDIS_STATUS_WWAN_REGISTER_STATE ((NDIS_STATUS)0x40041008) -#define NDIS_STATUS_WWAN_PACKET_SERVICE ((NDIS_STATUS)0x40041009) -#define NDIS_STATUS_WWAN_SIGNAL_STATE ((NDIS_STATUS)0x4004100a) -#define NDIS_STATUS_WWAN_CONTEXT_STATE ((NDIS_STATUS)0x4004100b) -#define NDIS_STATUS_WWAN_PROVISIONED_CONTEXTS ((NDIS_STATUS)0x4004100c) -#define NDIS_STATUS_WWAN_SERVICE_ACTIVATION ((NDIS_STATUS)0x4004100d) -#define NDIS_STATUS_WWAN_SMS_CONFIGURATION ((NDIS_STATUS)0x4004100e) -#define NDIS_STATUS_WWAN_SMS_RECEIVE ((NDIS_STATUS)0x4004100f) -#define NDIS_STATUS_WWAN_SMS_SEND ((NDIS_STATUS)0x40041010) -#define NDIS_STATUS_WWAN_SMS_DELETE ((NDIS_STATUS)0x40041011) -#define NDIS_STATUS_WWAN_SMS_STATUS ((NDIS_STATUS)0x40041012) -#define NDIS_STATUS_WWAN_DNS_ADDRESS ((NDIS_STATUS)0x40041013) - -#define NDIS_STATUS_WWAN_VENDOR_SPECIFIC ((NDIS_STATUS)0x40043000) -// -// End of WWAN specific status indication codes -// - -// -// Add WiMAX specific status indication codes -// - - -#endif NDIS_SUPPORT_NDIS6 - -// -// Status codes for NDIS 6.20 Power Management -// -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_STATUS_PM_WOL_PATTERN_REJECTED ((NDIS_STATUS)0x40030051L) -#define NDIS_STATUS_PM_OFFLOAD_REJECTED ((NDIS_STATUS)0x40030052L) -#define NDIS_STATUS_PM_CAPABILITIES_CHANGE ((NDIS_STATUS)0x40030053L) -#endif - - -// -// status codes returned by drivers -// -#define NDIS_STATUS_SUCCESS ((NDIS_STATUS)STATUS_SUCCESS) -#define NDIS_STATUS_PENDING ((NDIS_STATUS)STATUS_PENDING) -#define NDIS_STATUS_NOT_RECOGNIZED ((NDIS_STATUS)0x00010001L) -#define NDIS_STATUS_NOT_COPIED ((NDIS_STATUS)0x00010002L) -#define NDIS_STATUS_NOT_ACCEPTED ((NDIS_STATUS)0x00010003L) -#define NDIS_STATUS_CALL_ACTIVE ((NDIS_STATUS)0x00010007L) -#define NDIS_STATUS_INDICATION_REQUIRED ((NDIS_STATUS)STATUS_NDIS_INDICATION_REQUIRED) -#define NDIS_STATUS_NOT_RESETTABLE ((NDIS_STATUS)0x80010001L) -#define NDIS_STATUS_SOFT_ERRORS ((NDIS_STATUS)0x80010003L) -#define NDIS_STATUS_HARD_ERRORS ((NDIS_STATUS)0x80010004L) -#define NDIS_STATUS_BUFFER_OVERFLOW ((NDIS_STATUS)STATUS_BUFFER_OVERFLOW) -#define NDIS_STATUS_FAILURE ((NDIS_STATUS)STATUS_UNSUCCESSFUL) -#define NDIS_STATUS_RESOURCES ((NDIS_STATUS)STATUS_INSUFFICIENT_RESOURCES) -#define NDIS_STATUS_CLOSING ((NDIS_STATUS)0xC0010002L) -#define NDIS_STATUS_BAD_VERSION ((NDIS_STATUS)0xC0010004L) -#define NDIS_STATUS_BAD_CHARACTERISTICS ((NDIS_STATUS)0xC0010005L) -#define NDIS_STATUS_ADAPTER_NOT_FOUND ((NDIS_STATUS)0xC0010006L) -#define NDIS_STATUS_OPEN_FAILED ((NDIS_STATUS)0xC0010007L) -#define NDIS_STATUS_DEVICE_FAILED ((NDIS_STATUS)0xC0010008L) -#define NDIS_STATUS_MULTICAST_FULL ((NDIS_STATUS)0xC0010009L) -#define NDIS_STATUS_MULTICAST_EXISTS ((NDIS_STATUS)0xC001000AL) -#define NDIS_STATUS_MULTICAST_NOT_FOUND ((NDIS_STATUS)0xC001000BL) -#define NDIS_STATUS_REQUEST_ABORTED ((NDIS_STATUS)0xC001000CL) -#define NDIS_STATUS_RESET_IN_PROGRESS ((NDIS_STATUS)0xC001000DL) -#define NDIS_STATUS_CLOSING_INDICATING ((NDIS_STATUS)0xC001000EL) -#define NDIS_STATUS_NOT_SUPPORTED ((NDIS_STATUS)STATUS_NOT_SUPPORTED) -#define NDIS_STATUS_INVALID_PACKET ((NDIS_STATUS)0xC001000FL) -#define NDIS_STATUS_OPEN_LIST_FULL ((NDIS_STATUS)0xC0010010L) -#define NDIS_STATUS_ADAPTER_NOT_READY ((NDIS_STATUS)0xC0010011L) -#define NDIS_STATUS_ADAPTER_NOT_OPEN ((NDIS_STATUS)0xC0010012L) -#define NDIS_STATUS_NOT_INDICATING ((NDIS_STATUS)0xC0010013L) -#define NDIS_STATUS_INVALID_LENGTH ((NDIS_STATUS)0xC0010014L) -#define NDIS_STATUS_INVALID_DATA ((NDIS_STATUS)0xC0010015L) -#define NDIS_STATUS_BUFFER_TOO_SHORT ((NDIS_STATUS)0xC0010016L) -#define NDIS_STATUS_INVALID_OID ((NDIS_STATUS)0xC0010017L) -#define NDIS_STATUS_ADAPTER_REMOVED ((NDIS_STATUS)0xC0010018L) -#define NDIS_STATUS_UNSUPPORTED_MEDIA ((NDIS_STATUS)0xC0010019L) -#define NDIS_STATUS_GROUP_ADDRESS_IN_USE ((NDIS_STATUS)0xC001001AL) -#define NDIS_STATUS_FILE_NOT_FOUND ((NDIS_STATUS)0xC001001BL) -#define NDIS_STATUS_ERROR_READING_FILE ((NDIS_STATUS)0xC001001CL) -#define NDIS_STATUS_ALREADY_MAPPED ((NDIS_STATUS)0xC001001DL) -#define NDIS_STATUS_RESOURCE_CONFLICT ((NDIS_STATUS)0xC001001EL) -#define NDIS_STATUS_NO_CABLE ((NDIS_STATUS)0xC001001FL) -#define NDIS_STATUS_INVALID_DEVICE_REQUEST ((NDIS_STATUS)STATUS_INVALID_DEVICE_REQUEST) -#define NDIS_STATUS_NETWORK_UNREACHABLE ((NDIS_STATUS)STATUS_NETWORK_UNREACHABLE) - -// -// CO-NDIS specific -// -#define NDIS_STATUS_INVALID_SAP ((NDIS_STATUS)0xC0010020L) -#define NDIS_STATUS_SAP_IN_USE ((NDIS_STATUS)0xC0010021L) -#define NDIS_STATUS_INVALID_ADDRESS ((NDIS_STATUS)0xC0010022L) -#define NDIS_STATUS_VC_NOT_ACTIVATED ((NDIS_STATUS)0xC0010023L) -#define NDIS_STATUS_DEST_OUT_OF_ORDER ((NDIS_STATUS)0xC0010024L) // cause 27 -#define NDIS_STATUS_VC_NOT_AVAILABLE ((NDIS_STATUS)0xC0010025L) // cause 35,45 -#define NDIS_STATUS_CELLRATE_NOT_AVAILABLE ((NDIS_STATUS)0xC0010026L) // cause 37 -#define NDIS_STATUS_INCOMPATABLE_QOS ((NDIS_STATUS)0xC0010027L) // cause 49 -#define NDIS_STATUS_AAL_PARAMS_UNSUPPORTED ((NDIS_STATUS)0xC0010028L) // cause 93 -#define NDIS_STATUS_NO_ROUTE_TO_DESTINATION ((NDIS_STATUS)0xC0010029L) // cause 3 - -// -// 802.5 specific -// -#define NDIS_STATUS_TOKEN_RING_OPEN_ERROR ((NDIS_STATUS)0xC0011000L) - - -// -// new status codes used in NDIS 6 -// -#if NDIS_SUPPORT_NDIS6 -#define NDIS_STATUS_SEND_ABORTED ((NDIS_STATUS)STATUS_NDIS_REQUEST_ABORTED) -#define NDIS_STATUS_PAUSED ((NDIS_STATUS)STATUS_NDIS_PAUSED) -#define NDIS_STATUS_INTERFACE_NOT_FOUND ((NDIS_STATUS)STATUS_NDIS_INTERFACE_NOT_FOUND) -#define NDIS_STATUS_INVALID_PARAMETER ((NDIS_STATUS)STATUS_INVALID_PARAMETER) -#define NDIS_STATUS_UNSUPPORTED_REVISION ((NDIS_STATUS)STATUS_NDIS_UNSUPPORTED_REVISION) -#define NDIS_STATUS_INVALID_PORT ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT) -#define NDIS_STATUS_INVALID_PORT_STATE ((NDIS_STATUS)STATUS_NDIS_INVALID_PORT_STATE) -#define NDIS_STATUS_INVALID_STATE ((NDIS_STATUS)STATUS_INVALID_DEVICE_STATE) -#define NDIS_STATUS_MEDIA_DISCONNECTED ((NDIS_STATUS)STATUS_NDIS_MEDIA_DISCONNECTED) -#define NDIS_STATUS_LOW_POWER_STATE ((NDIS_STATUS)STATUS_NDIS_LOW_POWER_STATE) - -#define NDIS_STATUS_DOT11_AUTO_CONFIG_ENABLED ((NDIS_STATUS)STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED) -#define NDIS_STATUS_DOT11_MEDIA_IN_USE ((NDIS_STATUS)STATUS_NDIS_DOT11_MEDIA_IN_USE) -#define NDIS_STATUS_DOT11_POWER_STATE_INVALID ((NDIS_STATUS)STATUS_NDIS_DOT11_POWER_STATE_INVALID) - -// -// new status codes used in NDIS 6.20 -// -#if NDIS_SUPPORT_NDIS620 -#define NDIS_STATUS_PM_WOL_PATTERN_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_WOL_PATTERN_LIST_FULL) -#define NDIS_STATUS_PM_PROTOCOL_OFFLOAD_LIST_FULL ((NDIS_STATUS)STATUS_NDIS_PM_PROTOCOL_OFFLOAD_LIST_FULL) -#endif - -// -// status codes for offload operations -// -#define NDIS_STATUS_UPLOAD_IN_PROGRESS ((NDIS_STATUS)0xC0231001L) -#define NDIS_STATUS_REQUEST_UPLOAD ((NDIS_STATUS)0xC0231002L) -#define NDIS_STATUS_UPLOAD_REQUESTED ((NDIS_STATUS)0xC0231003L) -#define NDIS_STATUS_OFFLOAD_TCP_ENTRIES ((NDIS_STATUS)0xC0231004L) -#define NDIS_STATUS_OFFLOAD_PATH_ENTRIES ((NDIS_STATUS)0xC0231005L) -#define NDIS_STATUS_OFFLOAD_NEIGHBOR_ENTRIES ((NDIS_STATUS)0xC0231006L) -#define NDIS_STATUS_OFFLOAD_IP_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231007L) -#define NDIS_STATUS_OFFLOAD_HW_ADDRESS_ENTRIES ((NDIS_STATUS)0xC0231008L) -#define NDIS_STATUS_OFFLOAD_VLAN_ENTRIES ((NDIS_STATUS)0xC0231009L) -#define NDIS_STATUS_OFFLOAD_TCP_XMIT_BUFFER ((NDIS_STATUS)0xC023100AL) -#define NDIS_STATUS_OFFLOAD_TCP_RCV_BUFFER ((NDIS_STATUS)0xC023100BL) -#define NDIS_STATUS_OFFLOAD_TCP_RCV_WINDOW ((NDIS_STATUS)0xC023100CL) -#define NDIS_STATUS_OFFLOAD_VLAN_MISMATCH ((NDIS_STATUS)0xC023100DL) -#define NDIS_STATUS_OFFLOAD_DATA_NOT_ACCEPTED ((NDIS_STATUS)0xC023100EL) -#define NDIS_STATUS_OFFLOAD_POLICY ((NDIS_STATUS)0xC023100FL) -#define NDIS_STATUS_OFFLOAD_DATA_PARTIALLY_ACCEPTED ((NDIS_STATUS)0xC0231010L) -#define NDIS_STATUS_OFFLOAD_REQUEST_RESET ((NDIS_STATUS)0xC0231011L) -#endif // NDIS_SUPPORT_NDIS6 - -// -// Status codes for NDIS 6.20 capable Chimney offload miniports. -// -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_STATUS_OFFLOAD_CONNECTION_REJECTED ((NDIS_STATUS)STATUS_NDIS_OFFLOAD_CONNECTION_REJECTED) -#endif - -// -// used in error logging -// - -#define NDIS_ERROR_CODE ULONG - -#define NDIS_ERROR_CODE_RESOURCE_CONFLICT EVENT_NDIS_RESOURCE_CONFLICT -#define NDIS_ERROR_CODE_OUT_OF_RESOURCES EVENT_NDIS_OUT_OF_RESOURCE -#define NDIS_ERROR_CODE_HARDWARE_FAILURE EVENT_NDIS_HARDWARE_FAILURE -#define NDIS_ERROR_CODE_ADAPTER_NOT_FOUND EVENT_NDIS_ADAPTER_NOT_FOUND -#define NDIS_ERROR_CODE_INTERRUPT_CONNECT EVENT_NDIS_INTERRUPT_CONNECT -#define NDIS_ERROR_CODE_DRIVER_FAILURE EVENT_NDIS_DRIVER_FAILURE -#define NDIS_ERROR_CODE_BAD_VERSION EVENT_NDIS_BAD_VERSION -#define NDIS_ERROR_CODE_TIMEOUT EVENT_NDIS_TIMEOUT -#define NDIS_ERROR_CODE_NETWORK_ADDRESS EVENT_NDIS_NETWORK_ADDRESS -#define NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION EVENT_NDIS_UNSUPPORTED_CONFIGURATION -#define NDIS_ERROR_CODE_INVALID_VALUE_FROM_ADAPTER EVENT_NDIS_INVALID_VALUE_FROM_ADAPTER -#define NDIS_ERROR_CODE_MISSING_CONFIGURATION_PARAMETER EVENT_NDIS_MISSING_CONFIGURATION_PARAMETER -#define NDIS_ERROR_CODE_BAD_IO_BASE_ADDRESS EVENT_NDIS_BAD_IO_BASE_ADDRESS -#define NDIS_ERROR_CODE_RECEIVE_SPACE_SMALL EVENT_NDIS_RECEIVE_SPACE_SMALL -#define NDIS_ERROR_CODE_ADAPTER_DISABLED EVENT_NDIS_ADAPTER_DISABLED - - -#define NdisAllocateSpinLock(_SpinLock) KeInitializeSpinLock(&(_SpinLock)->SpinLock) - -#define NdisFreeSpinLock(_SpinLock) - -#define NdisAcquireSpinLock(_SpinLock) KeAcquireSpinLock(&(_SpinLock)->SpinLock, &(_SpinLock)->OldIrql) - -#define NdisReleaseSpinLock(_SpinLock) KeReleaseSpinLock(&(_SpinLock)->SpinLock,(_SpinLock)->OldIrql) - -#define NdisDprAcquireSpinLock(_SpinLock) \ -{ \ - KeAcquireSpinLockAtDpcLevel(&(_SpinLock)->SpinLock); \ -} - -#define NdisDprReleaseSpinLock(_SpinLock) KeReleaseSpinLockFromDpcLevel(&(_SpinLock)->SpinLock) - -#define NdisGetCurrentSystemTime(_pSystemTime) \ - { \ - KeQuerySystemTime(_pSystemTime); \ - } - -// -// Interlocked support functions -// - -#define NdisInterlockedIncrement(Addend) InterlockedIncrement(Addend) - -#define NdisInterlockedDecrement(Addend) InterlockedDecrement(Addend) - -#define NdisInterlockedAddUlong(_Addend, _Increment, _SpinLock) \ - ExInterlockedAddUlong(_Addend, _Increment, &(_SpinLock)->SpinLock) - -#define NdisInterlockedInsertHeadList(_ListHead, _ListEntry, _SpinLock) \ - ExInterlockedInsertHeadList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock) - -#define NdisInterlockedInsertTailList(_ListHead, _ListEntry, _SpinLock) \ - ExInterlockedInsertTailList(_ListHead, _ListEntry, &(_SpinLock)->SpinLock) - -#define NdisInterlockedRemoveHeadList(_ListHead, _SpinLock) \ - ExInterlockedRemoveHeadList(_ListHead, &(_SpinLock)->SpinLock) - -#define NdisInterlockedPushEntryList(ListHead, ListEntry, Lock) \ - ExInterlockedPushEntryList(ListHead, ListEntry, &(Lock)->SpinLock) - -#define NdisInterlockedPopEntryList(ListHead, Lock) \ - ExInterlockedPopEntryList(ListHead, &(Lock)->SpinLock) - - - -#if NDIS_SUPPORT_60_COMPATIBLE_API - -typedef union _NDIS_RW_LOCK_REFCOUNT -{ - ULONG RefCount; - UCHAR cacheLine[16]; // This is smaller than a cacheline on most CPUs now -} NDIS_RW_LOCK_REFCOUNT; - -typedef struct _NDIS_RW_LOCK -{ - union - { - struct - { - KSPIN_LOCK SpinLock; - PVOID Context; - }; - UCHAR Reserved[16]; - }; - - union - { - NDIS_RW_LOCK_REFCOUNT RefCount[MAXIMUM_PROCESSORS]; - ULONG RefCountEx[sizeof(NDIS_RW_LOCK_REFCOUNT)/sizeof(ULONG) - * MAXIMUM_PROCESSORS]; - struct - { - KSPIN_LOCK RefCountLock; - volatile ULONG SharedRefCount; - volatile BOOLEAN WriterWaiting; - }; - }; -} NDIS_RW_LOCK, *PNDIS_RW_LOCK; - -typedef struct _LOCK_STATE -{ - USHORT LockState; - KIRQL OldIrql; -} LOCK_STATE, *PLOCK_STATE; - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisInitializeReadWriteLock( - __out PNDIS_RW_LOCK Lock - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_setsIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAcquireReadWriteLock( - __inout __drv_acquiresResource(NdisReadWriteLock) PNDIS_RW_LOCK Lock, - __in BOOLEAN fWrite,// TRUE -> Write, FALSE -> Read - __out __drv_savesIRQL - __drv_deref(__drv_acquiresExclusiveResource(NdisReadWriteLockState)) - PLOCK_STATE LockState - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisReleaseReadWriteLock( - __inout __drv_releasesResource(NdisReadWriteLock) PNDIS_RW_LOCK Lock, - __in __drv_restoresIRQL __drv_deref( - __drv_releasesExclusiveResource(NdisReadWriteLockState)) - PLOCK_STATE LockState - ); - -#if NDIS_SUPPORT_NDIS6 - -EXPORT -VOID -NdisDprAcquireReadWriteLock( - IN PNDIS_RW_LOCK Lock, - IN BOOLEAN fWrite, // TRUE -> Write, FALSE -> Read - IN PLOCK_STATE LockState - ); - -EXPORT -VOID -NdisDprReleaseReadWriteLock( - IN PNDIS_RW_LOCK Lock, - IN PLOCK_STATE LockState - ); - -#endif -#endif - -#if NDIS_SUPPORT_NDIS620 - -struct _NDIS_RW_LOCK_EX; -typedef struct _NDIS_RW_LOCK_EX NDIS_RW_LOCK_EX; -typedef struct _NDIS_RW_LOCK_EX* PNDIS_RW_LOCK_EX; - -typedef struct _LOCK_STATE_EX -{ - KIRQL OldIrql; - UCHAR LockState; - UCHAR Flags; -} LOCK_STATE_EX, *PLOCK_STATE_EX; - -#define NDIS_RWL_AT_DISPATCH_LEVEL 1 - -EXPORT -PNDIS_RW_LOCK_EX -NdisAllocateRWLock( - NDIS_HANDLE NdisHandle - ); - -EXPORT -VOID -NdisFreeRWLock( - __in PNDIS_RW_LOCK_EX Lock - ); - -EXPORT -VOID -NdisAcquireRWLockRead( - __in PNDIS_RW_LOCK_EX Lock, - __out PLOCK_STATE_EX LockState, - __in UCHAR Flags - ); - -EXPORT -VOID -NdisAcquireRWLockWrite( - __in PNDIS_RW_LOCK_EX Lock, - __out PLOCK_STATE_EX LockState, - __in UCHAR Flags - ); - -EXPORT -VOID -NdisReleaseRWLock( - __in PNDIS_RW_LOCK_EX Lock, - __in PLOCK_STATE_EX LockState - ); - -#endif - -#define NdisInterlockedAddLargeStatistic(_Addend, _Increment) \ - ExInterlockedAddLargeStatistic((PLARGE_INTEGER)_Addend, _Increment) - -// -// S-List support -// - -#define NdisInterlockedPushEntrySList(SListHead, SListEntry, Lock) \ - ExInterlockedPushEntrySList(SListHead, SListEntry, &(Lock)->SpinLock) - -#define NdisInterlockedPopEntrySList(SListHead, Lock) \ - ExInterlockedPopEntrySList(SListHead, &(Lock)->SpinLock) - -#define NdisInterlockedFlushSList(SListHead) ExInterlockedFlushSList(SListHead) - -#define NdisInitializeSListHead(SListHead) ExInitializeSListHead(SListHead) - -#define NdisQueryDepthSList(SListHead) ExQueryDepthSList(SListHead) - -EXPORT -VOID -NdisGetCurrentProcessorCpuUsage( - OUT PULONG pCpuUsage - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisGetCurrentProcessorCounts( - __out PULONG pIdleCount, - __out PULONG pKernelAndUser, - __out PULONG pIndex - ); - - -#if NDIS_LEGACY_DRIVER - -/* -NdisGetSystemUpTime is deprecated, use NdisGetSystemUpTimeEx instead. -*/ -DECLSPEC_DEPRECATED_DDK -EXPORT -VOID -NdisGetSystemUpTime( - OUT PULONG pSystemUpTime - ); - -#endif // NDIS_LEGACY_DRIVER - -// -// List manipulation -// - -/*++ - -VOID -NdisInitializeListHead( - IN PLIST_ENTRY ListHead - ); - ---*/ -#define NdisInitializeListHead(_ListHead) InitializeListHead(_ListHead) - -// -// Configuration Requests -// - -#if NDIS_LEGACY_DRIVER - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisOpenConfiguration( - OUT __checkReturn PNDIS_STATUS Status, - OUT PNDIS_HANDLE ConfigurationHandle, - IN NDIS_HANDLE WrapperConfigurationContext - ); - -#endif // NDIS_LEGACY_DRIVER - - -__drv_maxIRQL(APC_LEVEL) -EXPORT -VOID -NdisOpenConfigurationKeyByName( - __out __checkReturn PNDIS_STATUS Status, - __in NDIS_HANDLE ConfigurationHandle, - __in PNDIS_STRING SubKeyName, - __out PNDIS_HANDLE SubKeyHandle - ); - - -__drv_maxIRQL(APC_LEVEL) -EXPORT -VOID -NdisOpenConfigurationKeyByIndex( - __out __checkReturn PNDIS_STATUS Status, - __in NDIS_HANDLE ConfigurationHandle, - __in ULONG Index, - __out PNDIS_STRING KeyName, - __out PNDIS_HANDLE KeyHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisReadConfiguration( - __out __checkReturn PNDIS_STATUS Status, - __deref_out PNDIS_CONFIGURATION_PARAMETER *ParameterValue, - __in NDIS_HANDLE ConfigurationHandle, - __in PNDIS_STRING Keyword, - __in NDIS_PARAMETER_TYPE ParameterType - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisWriteConfiguration( - __out __checkReturn PNDIS_STATUS Status, - __in NDIS_HANDLE ConfigurationHandle, - __in PNDIS_STRING Keyword, - __in PNDIS_CONFIGURATION_PARAMETER ParameterValue - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCloseConfiguration( - __in __drv_freesMem(mem) NDIS_HANDLE ConfigurationHandle - ); - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisReadNetworkAddress( - __out __checkReturn PNDIS_STATUS Status, - __deref_out_bcount(*NetworkAddressLength) PVOID * NetworkAddress, - __out PUINT NetworkAddressLength, - __in NDIS_HANDLE ConfigurationHandle - ); - - -#if NDIS_LEGACY_MINIPORT - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisReadPciSlotInformation( - __in NDIS_HANDLE NdisAdapterHandle, - __in ULONG SlotNumber, - __in ULONG Offset, - __out_bcount(Length) - PVOID Buffer, - __in ULONG Length - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisWritePciSlotInformation( - __in NDIS_HANDLE NdisAdapterHandle, - __in ULONG SlotNumber, - __in ULONG Offset, - __in_bcount(Length) - PVOID Buffer, - __in ULONG Length - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisReadPcmciaAttributeMemory( - __in NDIS_HANDLE NdisAdapterHandle, - __in ULONG Offset, - __out_bcount(Length) - PVOID Buffer, - __in ULONG Length - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisWritePcmciaAttributeMemory( - __in NDIS_HANDLE NdisAdapterHandle, - __in ULONG Offset, - __in_bcount(Length) - PVOID Buffer, - __in ULONG Length - ); - -#endif // NDIS_LEGACY_MINIPORT - - -#if NDIS_LEGACY_DRIVER -// -// Buffer Pool -// - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAllocateBufferPool( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE PoolHandle, - __in UINT NumberOfDescriptors - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeBufferPool( - __in NDIS_HANDLE PoolHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAllocateBuffer( - __out PNDIS_STATUS Status, - __out PNDIS_BUFFER * Buffer, - __in_opt NDIS_HANDLE PoolHandle, - __in_bcount(Length) - PVOID VirtualAddress, - __in UINT Length - ); - -#define NdisFreeBuffer(Buffer) IoFreeMdl(Buffer) -#endif - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCopyBuffer( - __out PNDIS_STATUS Status, - __out PNDIS_BUFFER * Buffer, - __in NDIS_HANDLE PoolHandle, - __in PVOID MemoryDescriptor, - __in UINT Offset, - __in UINT Length - ); - - -// -// VOID -// NdisCopyLookaheadData( -// IN PVOID Destination, -// IN PVOID Source, -// IN ULONG Length, -// IN ULONG ReceiveFlags -// ); -// - -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisCopyLookaheadData(_Destination, _Source, _Length, _MacOptions) \ - RtlCopyMemory(_Destination, _Source, _Length) -#else -#define NdisCopyLookaheadData(_Destination, _Source, _Length, _MacOptions) \ - { \ - if ((_MacOptions) & NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA) \ - { \ - RtlCopyMemory(_Destination, _Source, _Length); \ - } \ - else \ - { \ - PUCHAR _Src = (PUCHAR)(_Source); \ - PUCHAR _Dest = (PUCHAR)(_Destination); \ - PUCHAR _End = _Dest + (_Length); \ - while (_Dest < _End) \ - { \ - *_Dest++ = *_Src++; \ - } \ - } \ - } -#endif - -#if NDIS_LEGACY_DRIVER -// -// Packet Pool -// -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAllocatePacketPool( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE PoolHandle, - __in UINT NumberOfDescriptors, - __in UINT ProtocolReservedLength - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAllocatePacketPoolEx( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE PoolHandle, - __in UINT NumberOfDescriptors, - __in UINT NumberOfOverflowDescriptors, - __in UINT ProtocolReservedLength - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisSetPacketPoolProtocolId( - __in NDIS_HANDLE PacketPoolHandle, - __in UINT ProtocolId - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -UINT -NdisPacketPoolUsage( - __in NDIS_HANDLE PoolHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -UINT -NdisPacketSize( - __in UINT ProtocolReservedSize - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisGetPoolFromPacket( - __in PNDIS_PACKET Packet - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNDIS_PACKET_STACK -NdisIMGetCurrentPacketStack( - __in PNDIS_PACKET Packet, - __out BOOLEAN * StacksRemaining - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreePacketPool( - __in NDIS_HANDLE PoolHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreePacket( - __in PNDIS_PACKET Packet - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisDprFreePacket( - __in PNDIS_PACKET Packet - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisDprFreePacketNonInterlocked( - __in PNDIS_PACKET Packet - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAllocatePacket( - __out PNDIS_STATUS Status, - __out PNDIS_PACKET * Packet, - __in NDIS_HANDLE PoolHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisDprAllocatePacket( - __out PNDIS_STATUS Status, - __out PNDIS_PACKET* Packet, - __in NDIS_HANDLE PoolHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisDprAllocatePacketNonInterlocked( - __out PNDIS_STATUS Status, - __out PNDIS_PACKET * Packet, - __in NDIS_HANDLE PoolHandle - ); - -// VOID -// NdisReinitializePacket( -// IN OUT PNDIS_PACKET Packet -// ); -#define NdisReinitializePacket(Packet) \ -{ \ - (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \ - (Packet)->Private.ValidCounts = FALSE; \ -} - -#endif // NDIS_LEGACY_DRIVER - -#define NdisFreeBuffer(Buffer) IoFreeMdl(Buffer) - -#if NDIS_LEGACY_DRIVER -#define NdisQueryBuffer(_Buffer, _VirtualAddress, _Length) \ -{ \ - if (ARGUMENT_PRESENT(_VirtualAddress)) \ - { \ - *(PVOID *)(_VirtualAddress) = MmGetSystemAddressForMdl(_Buffer); \ - } \ - *(_Length) = MmGetMdlByteCount(_Buffer); \ -} -#endif // NDIS_LEGACY_DRIVER - -#define NdisQueryBufferSafe(_Buffer, _VirtualAddress, _Length, _Priority) \ -{ \ - if (ARGUMENT_PRESENT(_VirtualAddress)) \ - { \ - *(PVOID *)(_VirtualAddress) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \ - } \ - *(_Length) = MmGetMdlByteCount(_Buffer); \ -} - -#define NdisQueryBufferOffset(_Buffer, _Offset, _Length) \ -{ \ - *(_Offset) = MmGetMdlByteOffset(_Buffer); \ - *(_Length) = MmGetMdlByteCount(_Buffer); \ -} - - -#if NDIS_LEGACY_DRIVER - -#define NdisGetFirstBufferFromPacket(_Packet, \ - _FirstBuffer, \ - _FirstBufferVA, \ - _FirstBufferLength, \ - _TotalBufferLength) \ - { \ - PNDIS_BUFFER _pBuf; \ - \ - _pBuf = (_Packet)->Private.Head; \ - *(_FirstBuffer) = _pBuf; \ - if (_pBuf) \ - { \ - *(_FirstBufferVA) = MmGetSystemAddressForMdl(_pBuf); \ - *(_FirstBufferLength) = \ - *(_TotalBufferLength) = MmGetMdlByteCount(_pBuf); \ - for (_pBuf = _pBuf->Next; \ - _pBuf != NULL; \ - _pBuf = _pBuf->Next) \ - { \ - *(_TotalBufferLength) += MmGetMdlByteCount(_pBuf); \ - } \ - } \ - else \ - { \ - *(_FirstBufferVA) = 0; \ - *(_FirstBufferLength) = 0; \ - *(_TotalBufferLength) = 0; \ - } \ - } - -#define NdisGetFirstBufferFromPacketSafe(_Packet, \ - _FirstBuffer, \ - _FirstBufferVA, \ - _FirstBufferLength, \ - _TotalBufferLength, \ - _Priority) \ - { \ - PNDIS_BUFFER _pBuf; \ - \ - _pBuf = (_Packet)->Private.Head; \ - *(_FirstBuffer) = _pBuf; \ - if (_pBuf) \ - { \ - *(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_pBuf, _Priority); \ - *(_FirstBufferLength) = *(_TotalBufferLength) = MmGetMdlByteCount(_pBuf); \ - for (_pBuf = _pBuf->Next; \ - _pBuf != NULL; \ - _pBuf = _pBuf->Next) \ - { \ - *(_TotalBufferLength) += MmGetMdlByteCount(_pBuf); \ - } \ - } \ - else \ - { \ - *(_FirstBufferVA) = 0; \ - *(_FirstBufferLength) = 0; \ - *(_TotalBufferLength) = 0; \ - } \ - } - -#endif // NDIS_LEGACY_DRIVER - -#define NDIS_BUFFER_TO_SPAN_PAGES(_Buffer) \ - (MmGetMdlByteCount(_Buffer)==0 ? \ - 1 : \ - (ADDRESS_AND_SIZE_TO_SPAN_PAGES( \ - MmGetMdlVirtualAddress(_Buffer), \ - MmGetMdlByteCount(_Buffer)))) - -#define NdisGetBufferPhysicalArraySize(Buffer, ArraySize) \ - (*(ArraySize) = NDIS_BUFFER_TO_SPAN_PAGES(Buffer)) - - -/*++ - -NDIS_BUFFER_LINKAGE( - IN PNDIS_BUFFER Buffer - ); - ---*/ - -#define NDIS_BUFFER_LINKAGE(Buffer) ((Buffer)->Next) - - -#if NDIS_LEGACY_DRIVER - -/*++ - -VOID -NdisRecalculatePacketCounts( - IN OUT PNDIS_PACKET Packet - ); - ---*/ - -#define NdisRecalculatePacketCounts(Packet) \ -{ \ - { \ - PNDIS_BUFFER TmpBuffer = (Packet)->Private.Head; \ - if (TmpBuffer) \ - { \ - while (TmpBuffer->Next) \ - { \ - TmpBuffer = TmpBuffer->Next; \ - } \ - (Packet)->Private.Tail = TmpBuffer; \ - } \ - (Packet)->Private.ValidCounts = FALSE; \ - } \ -} - - -/*++ - -VOID -NdisChainBufferAtFront( - IN OUT PNDIS_PACKET Packet, - IN OUT PNDIS_BUFFER Buffer - ); - ---*/ - -#define NdisChainBufferAtFront(Packet, Buffer) \ -{ \ - PNDIS_BUFFER TmpBuffer = (Buffer); \ - \ - for (;;) \ - { \ - if (TmpBuffer->Next == (PNDIS_BUFFER)NULL) \ - break; \ - TmpBuffer = TmpBuffer->Next; \ - } \ - if ((Packet)->Private.Head == NULL) \ - { \ - (Packet)->Private.Tail = TmpBuffer; \ - } \ - TmpBuffer->Next = (Packet)->Private.Head; \ - (Packet)->Private.Head = (Buffer); \ - (Packet)->Private.ValidCounts = FALSE; \ -} - -/*++ - -VOID -NdisChainBufferAtBack( - IN OUT PNDIS_PACKET Packet, - IN OUT PNDIS_BUFFER Buffer - ); - ---*/ - -#define NdisChainBufferAtBack(Packet, Buffer) \ -{ \ - PNDIS_BUFFER TmpBuffer = (Buffer); \ - \ - for (;;) \ - { \ - if (TmpBuffer->Next == NULL) \ - break; \ - TmpBuffer = TmpBuffer->Next; \ - } \ - if ((Packet)->Private.Head != NULL) \ - { \ - (Packet)->Private.Tail->Next = (Buffer); \ - } \ - else \ - { \ - (Packet)->Private.Head = (Buffer); \ - } \ - (Packet)->Private.Tail = TmpBuffer; \ - (Packet)->Private.ValidCounts = FALSE; \ -} - -EXPORT -VOID -NdisUnchainBufferAtFront( - IN OUT PNDIS_PACKET Packet, - OUT PNDIS_BUFFER * Buffer - ); - -EXPORT -VOID -NdisUnchainBufferAtBack( - IN OUT PNDIS_PACKET Packet, - OUT PNDIS_BUFFER * Buffer - ); - - -/*++ - -VOID -NdisQueryPacket( - IN PNDIS_PACKET _Packet, - OUT PUINT _PhysicalBufferCount OPTIONAL, - OUT PUINT _BufferCount OPTIONAL, - OUT PNDIS_BUFFER * _FirstBuffer OPTIONAL, - OUT PUINT _TotalPacketLength OPTIONAL - ); - ---*/ - -#pragma warning(push) -#pragma warning(disable:4127) -__inline -VOID -NdisQueryPacket( - IN PNDIS_PACKET _Packet, - OUT PUINT _PhysicalBufferCount OPTIONAL, - OUT PUINT _BufferCount OPTIONAL, - OUT PNDIS_BUFFER * _FirstBuffer OPTIONAL, - OUT PUINT _TotalPacketLength OPTIONAL - ) -{ - if ((_FirstBuffer) != NULL) - { - PNDIS_BUFFER * __FirstBuffer = (_FirstBuffer); - *(__FirstBuffer) = (_Packet)->Private.Head; - } - if ((_TotalPacketLength) || (_BufferCount) || (_PhysicalBufferCount)) - { - if (!(_Packet)->Private.ValidCounts) - { - PNDIS_BUFFER TmpBuffer = (_Packet)->Private.Head; - UINT PTotalLength = 0, PPhysicalCount = 0, PAddedCount = 0; - UINT PacketLength, Offset; - - while (TmpBuffer != (PNDIS_BUFFER)NULL) - { - NdisQueryBufferOffset(TmpBuffer, &Offset, &PacketLength); - PTotalLength += PacketLength; - PPhysicalCount += (UINT)NDIS_BUFFER_TO_SPAN_PAGES(TmpBuffer); - ++PAddedCount; - TmpBuffer = TmpBuffer->Next; - } - (_Packet)->Private.Count = PAddedCount; - (_Packet)->Private.TotalLength = PTotalLength; - (_Packet)->Private.PhysicalCount = PPhysicalCount; - (_Packet)->Private.ValidCounts = TRUE; - } - - if (_PhysicalBufferCount) - { - PUINT __PhysicalBufferCount = (_PhysicalBufferCount); - *(__PhysicalBufferCount) = (_Packet)->Private.PhysicalCount; - } - if (_BufferCount) - { - PUINT __BufferCount = (_BufferCount); - *(__BufferCount) = (_Packet)->Private.Count; - } - if (_TotalPacketLength) - { - PUINT __TotalPacketLength = (_TotalPacketLength); - *(__TotalPacketLength) = (_Packet)->Private.TotalLength; - } - } -} -#pragma warning(pop) - -/*++ - -VOID -NdisQueryPacketLength( - IN PNDIS_PACKET _Packet, - OUT PUINT _TotalPacketLength OPTIONAL - ); - ---*/ - -#define NdisQueryPacketLength(_Packet, \ - _TotalPacketLength) \ -{ \ - if (!(_Packet)->Private.ValidCounts) \ - { \ - NdisQueryPacket(_Packet, NULL, NULL, NULL, _TotalPacketLength); \ - } \ - else *(_TotalPacketLength) = (_Packet)->Private.TotalLength; \ -} - -#endif // NDIS_LEGACY_DRIVER - - -/*++ - -VOID -NdisGetNextBuffer( - IN PNDIS_BUFFER CurrentBuffer, - OUT PNDIS_BUFFER * NextBuffer - ); - ---*/ - -#define NdisGetNextBuffer(CurrentBuffer, NextBuffer) \ -{ \ - *(NextBuffer) = (CurrentBuffer)->Next; \ -} - - -#define NdisAdjustBufferLength(Buffer, Length) (((Buffer)->ByteCount) = (Length)) - - -#if NDIS_SUPPORT_NDIS6 -/* -VOID -NdisAdjustMdlLength( - IN PMDL Mdl, - IN UINT Length - ); - -*/ -#define NdisAdjustMdlLength(_Mdl, _Length) (((_Mdl)->ByteCount) = (_Length)) -#endif // NDIS_SUPPORT_NDIS6 - -#if NDIS_LEGACY_DRIVER - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCopyFromPacketToPacket( - __in PNDIS_PACKET Destination, - __in UINT DestinationOffset, - __in UINT BytesToCopy, - __in PNDIS_PACKET Source, - __in UINT SourceOffset, - __out PUINT BytesCopied - ); - -EXPORT -VOID -NdisCopyFromPacketToPacketSafe( - IN PNDIS_PACKET Destination, - IN UINT DestinationOffset, - IN UINT BytesToCopy, - IN PNDIS_PACKET Source, - IN UINT SourceOffset, - OUT PUINT BytesCopied, - IN MM_PAGE_PRIORITY Priority - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_preferredFunction("NdisAllocateMemoryWithTag", "Obsolete") -DECLSPEC_DEPRECATED_DDK -EXPORT -NDIS_STATUS -NdisAllocateMemory( - __deref_out_bcount_opt(Length) __drv_allocatesMem(Mem) - PVOID * VirtualAddress, - __in UINT Length, - __in UINT MemoryFlags, - __in NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress - ); - -#endif // NDIS_LEGACY_DRIVER - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisAllocateMemoryWithTag( - __deref_out_bcount_opt(Length) __drv_allocatesMem(Mem) - PVOID * VirtualAddress, - __in UINT Length, - __in ULONG Tag - ); - -__drv_when(MemoryFlags==0, - __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(MemoryFlags==NDIS_MEMORY_NONCACHED, - __drv_maxIRQL(APC_LEVEL)) -__drv_when(MemoryFlags==NDIS_MEMORY_CONTIGUOUS, - __drv_requiresIRQL(PASSIVE_LEVEL)) -EXPORT -VOID -NdisFreeMemory( - __in_bcount(Length) __drv_freesMem(Mem) - PVOID VirtualAddress, - __in UINT Length, - __in __drv_in(__drv_valueIs(==0; - ==NDIS_MEMORY_NONCACHED; - ==NDIS_MEMORY_CONTIGUOUS)) - UINT MemoryFlags - ); - -EXPORT -VOID -NdisFreeMemoryWithTag( - IN PVOID VirtualAddress, - IN ULONG Tag - ); - -/*++ -VOID -NdisStallExecution( - IN UINT MicrosecondsToStall - ) ---*/ - -#define NdisStallExecution(MicroSecondsToStall) KeStallExecutionProcessor(MicroSecondsToStall) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisInitializeEvent( - __out PNDIS_EVENT Event -); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisSetEvent( - __in PNDIS_EVENT Event -); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisResetEvent( - __in PNDIS_EVENT Event -); - -__drv_when(MsToWait !=0, __checkReturn) -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -BOOLEAN -NdisWaitEvent( - __in PNDIS_EVENT Event, - __in UINT MsToWait -); - - -#if NDIS_LEGACY_DRIVER -/*++ -VOID -NdisInitializeWorkItem( - IN PNDIS_WORK_ITEM WorkItem, - IN NDIS_PROC Routine, - IN PVOID Context - ); ---*/ - -#define NdisInitializeWorkItem(_WI_, _R_, _C_) \ - { \ - (_WI_)->Context = _C_; \ - (_WI_)->Routine = _R_; \ - } - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisScheduleWorkItem( - __in PNDIS_WORK_ITEM WorkItem - ); - -#endif // NDIS_LEGACY_DRIVER - -// -// Simple I/O support -// - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisOpenFile( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE FileHandle, - __out PUINT FileLength, - __in PNDIS_STRING FileName, - __in NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCloseFile( - __in NDIS_HANDLE FileHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMapFile( - __out PNDIS_STATUS Status, - __out PVOID * MappedBuffer, - __in NDIS_HANDLE FileHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisUnmapFile( - __in NDIS_HANDLE FileHandle - ); - - -// -// Portability extensions -// - -/*++ -VOID -NdisFlushBuffer( - IN PNDIS_BUFFER Buffer, - IN BOOLEAN WriteToDevice - ) ---*/ - -#define NdisFlushBuffer(Buffer,WriteToDevice) \ - KeFlushIoBuffers((Buffer),!(WriteToDevice), TRUE) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisGetSharedDataAlignment( - VOID - ); - - -// -// Raw Routines -// - -// -// Write Port Raw -// - -/*++ -VOID -NdisRawWritePortUchar( - IN ULONG_PTR Port, - IN UCHAR Data - ) ---*/ -#define NdisRawWritePortUchar(Port,Data) \ - WRITE_PORT_UCHAR((PUCHAR)(Port),(UCHAR)(Data)) - -/*++ -VOID -NdisRawWritePortUshort( - IN ULONG_PTR Port, - IN USHORT Data - ) ---*/ -#define NdisRawWritePortUshort(Port,Data) \ - WRITE_PORT_USHORT((PUSHORT)(Port),(USHORT)(Data)) - -/*++ -VOID -NdisRawWritePortUlong( - IN ULONG_PTR Port, - IN ULONG Data - ) ---*/ -#define NdisRawWritePortUlong(Port,Data) \ - WRITE_PORT_ULONG((PULONG)(Port),(ULONG)(Data)) - - -// -// Raw Write Port Buffers -// - -/*++ -VOID -NdisRawWritePortBufferUchar( - IN ULONG_PTR Port, - IN PUCHAR Buffer, - IN ULONG Length - ) ---*/ -#define NdisRawWritePortBufferUchar(Port,Buffer,Length) \ - WRITE_PORT_BUFFER_UCHAR((PUCHAR)(Port),(PUCHAR)(Buffer),(Length)) - -/*++ -VOID -NdisRawWritePortBufferUshort( - IN ULONG_PTR Port, - IN PUSHORT Buffer, - IN ULONG Length - ) ---*/ -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisRawWritePortBufferUshort(Port,Buffer,Length) \ - WRITE_PORT_BUFFER_USHORT((PUSHORT)(Port),(PUSHORT)(Buffer),(Length)) -#else -#define NdisRawWritePortBufferUshort(Port,Buffer,Length) \ -{ \ - ULONG_PTR _Port = (ULONG_PTR)(Port); \ - PUSHORT _Current = (Buffer); \ - PUSHORT _End = _Current + (Length); \ - for ( ; _Current < _End; ++_Current) \ - { \ - WRITE_PORT_USHORT((PUSHORT)_Port,*(UNALIGNED USHORT *)_Current);\ - } \ -} -#endif - - -/*++ -VOID -NdisRawWritePortBufferUlong( - IN ULONG_PTR Port, - IN PULONG Buffer, - IN ULONG Length - ) ---*/ -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisRawWritePortBufferUlong(Port,Buffer,Length) \ - WRITE_PORT_BUFFER_ULONG((PULONG)(Port),(PULONG)(Buffer),(Length)) -#else -#define NdisRawWritePortBufferUlong(Port,Buffer,Length) \ -{ \ - ULONG_PTR _Port = (ULONG_PTR)(Port); \ - PULONG _Current = (Buffer); \ - PULONG _End = _Current + (Length); \ - for ( ; _Current < _End; ++_Current) \ - { \ - WRITE_PORT_ULONG((PULONG)_Port,*(UNALIGNED ULONG *)_Current); \ - } \ -} -#endif - - -// -// Raw Read Ports -// - -/*++ -VOID -NdisRawReadPortUchar( - IN ULONG_PTR Port, - OUT PUCHAR Data - ) ---*/ -#define NdisRawReadPortUchar(Port, Data) \ - *(Data) = READ_PORT_UCHAR((PUCHAR)(Port)) - -/*++ -VOID -NdisRawReadPortUshort( - IN ULONG_PTR Port, - OUT PUSHORT Data - ) ---*/ -#define NdisRawReadPortUshort(Port,Data) \ - *(Data) = READ_PORT_USHORT((PUSHORT)(Port)) - -/*++ -VOID -NdisRawReadPortUlong( - IN ULONG_PTR Port, - OUT PULONG Data - ) ---*/ -#define NdisRawReadPortUlong(Port,Data) \ - *(Data) = READ_PORT_ULONG((PULONG)(Port)) - - -// -// Raw Read Buffer Ports -// - -/*++ -VOID -NdisRawReadPortBufferUchar( - IN ULONG_PTR Port, - OUT PUCHAR Buffer, - IN ULONG Length - ) ---*/ -#define NdisRawReadPortBufferUchar(Port,Buffer,Length) \ - READ_PORT_BUFFER_UCHAR((PUCHAR)(Port),(PUCHAR)(Buffer),(Length)) - - -/*++ -VOID -NdisRawReadPortBufferUshort( - IN ULONG_PTR Port, - OUT PUSHORT Buffer, - IN ULONG Length - ) ---*/ -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisRawReadPortBufferUshort(Port,Buffer,Length) \ - READ_PORT_BUFFER_USHORT((PUSHORT)(Port),(PUSHORT)(Buffer),(Length)) -#else -#define NdisRawReadPortBufferUshort(Port,Buffer,Length) \ -{ \ - ULONG_PTR _Port = (ULONG_PTR)(Port); \ - PUSHORT _Current = (Buffer); \ - PUSHORT _End = _Current + (Length); \ - for ( ; _Current < _End; ++_Current) \ - { \ - *(UNALIGNED USHORT *)_Current = READ_PORT_USHORT((PUSHORT)_Port); \ - } \ -} -#endif - - -/*++ -VOID -NdisRawReadPortBufferUlong( - IN ULONG_PTR Port, - OUT PULONG Buffer, - IN ULONG Length - ) ---*/ -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisRawReadPortBufferUlong(Port,Buffer,Length) \ - READ_PORT_BUFFER_ULONG((PULONG)(Port),(PULONG)(Buffer),(Length)) -#else -#define NdisRawReadPortBufferUlong(Port,Buffer,Length) \ -{ \ - ULONG_PTR _Port = (ULONG_PTR)(Port); \ - PULONG _Current = (Buffer); \ - PULONG _End = _Current + (Length); \ - for ( ; _Current < _End; ++_Current) \ - { \ - *(UNALIGNED ULONG *)_Current = READ_PORT_ULONG((PULONG)_Port); \ - } \ -} -#endif - - -// -// Write Registers -// - -/*++ -VOID -NdisWriteRegisterUchar( - IN PUCHAR Register, - IN UCHAR Data - ) ---*/ - -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisWriteRegisterUchar(Register,Data) \ - WRITE_REGISTER_UCHAR((Register),(Data)) -#else -#define NdisWriteRegisterUchar(Register,Data) \ - { \ - WRITE_REGISTER_UCHAR((Register),(Data)); \ - READ_REGISTER_UCHAR(Register); \ - } -#endif - -/*++ -VOID -NdisWriteRegisterUshort( - IN PUCHAR Register, - IN USHORT Data - ) ---*/ - -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisWriteRegisterUshort(Register,Data) \ - WRITE_REGISTER_USHORT((Register),(Data)) -#else -#define NdisWriteRegisterUshort(Register,Data) \ - { \ - WRITE_REGISTER_USHORT((Register),(Data)); \ - READ_REGISTER_USHORT(Register); \ - } -#endif - -/*++ -VOID -NdisWriteRegisterUlong( - IN PUCHAR Register, - IN ULONG Data - ) ---*/ - -#if defined(_M_IX86) || defined(_M_AMD64) -#define NdisWriteRegisterUlong(Register,Data) WRITE_REGISTER_ULONG((Register),(Data)) -#else -#define NdisWriteRegisterUlong(Register,Data) \ - { \ - WRITE_REGISTER_ULONG((Register),(Data)); \ - READ_REGISTER_ULONG(Register); \ - } -#endif - -/*++ -VOID -NdisReadRegisterUchar( - IN PUCHAR Register, - OUT PUCHAR Data - ) ---*/ -#if defined(_M_IX86) -#define NdisReadRegisterUchar(Register,Data) \ - _ReadWriteBarrier(); \ - *(Data) = *((volatile UCHAR * const)(Register)); -#else -#define NdisReadRegisterUchar(Register,Data) *(Data) = READ_REGISTER_UCHAR((PUCHAR)(Register)) -#endif - -/*++ -VOID -NdisReadRegisterUshort( - IN PUSHORT Register, - OUT PUSHORT Data - ) ---*/ -#if defined(_M_IX86) -#define NdisReadRegisterUshort(Register,Data) \ - _ReadWriteBarrier(); \ - *(Data) = *((volatile USHORT * const)(Register)) -#else -#define NdisReadRegisterUshort(Register,Data) *(Data) = READ_REGISTER_USHORT((PUSHORT)(Register)) -#endif - -/*++ -VOID -NdisReadRegisterUlong( - IN PULONG Register, - OUT PULONG Data - ) ---*/ -#if defined(_M_IX86) -#define NdisReadRegisterUlong(Register,Data) \ - _ReadWriteBarrier(); \ - *(Data) = *((volatile ULONG * const)(Register)) -#else -#define NdisReadRegisterUlong(Register,Data) *(Data) = READ_REGISTER_ULONG((PULONG)(Register)) -#endif - -#define NdisEqualString(_String1, _String2, _CaseInsensitive) \ - RtlEqualUnicodeString(_String1, _String2, _CaseInsensitive) - -#define NdisEqualUnicodeString(_String1, _String2, _CaseInsensitive) \ - RtlEqualUnicodeString(_String1, _String2, _CaseInsensitive) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID __cdecl -NdisWriteErrorLogEntry( - __in NDIS_HANDLE NdisAdapterHandle, - __in NDIS_ERROR_CODE ErrorCode, - __in ULONG NumberOfErrorValues, - ... - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisInitializeString( - __out PNDIS_STRING Destination, - __in PUCHAR Source - ); - -#define NdisFreeString(String) NdisFreeMemory((String).Buffer, (String).MaximumLength, 0) - -#define NdisPrintString(String) DbgPrint("%ls",(String).Buffer) - - -/*++ - -VOID -NdisCreateLookaheadBufferFromSharedMemory( - IN PVOID pSharedMemory, - IN UINT LookaheadLength, - OUT PVOID * pLookaheadBuffer - ); - ---*/ - -#define NdisCreateLookaheadBufferFromSharedMemory(_S, _L, _B) ((*(_B)) = (_S)) - -/*++ - -VOID -NdisDestroyLookaheadBufferFromSharedMemory( - IN PVOID pLookaheadBuffer - ); - ---*/ - -#define NdisDestroyLookaheadBufferFromSharedMemory(_B) - - -// -// The following declarations are shared between ndismac.h and ndismini.h. They -// are meant to be for internal use only. They should not be used directly by -// miniport drivers. -// - -// -// declare these first since they point to each other -// - -typedef struct _NDIS_WRAPPER_HANDLE NDIS_WRAPPER_HANDLE, *PNDIS_WRAPPER_HANDLE; -typedef struct _NDIS_PROTOCOL_BLOCK NDIS_PROTOCOL_BLOCK, *PNDIS_PROTOCOL_BLOCK; -typedef struct _NDIS_OPEN_BLOCK NDIS_OPEN_BLOCK, *PNDIS_OPEN_BLOCK; -typedef struct _NDIS_M_DRIVER_BLOCK NDIS_M_DRIVER_BLOCK, *PNDIS_M_DRIVER_BLOCK; -typedef struct _NDIS_MINIPORT_BLOCK NDIS_MINIPORT_BLOCK,*PNDIS_MINIPORT_BLOCK; -typedef struct _CO_CALL_PARAMETERS CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS; -typedef struct _CO_MEDIA_PARAMETERS CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS; -typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS *PNDIS_CALL_MANAGER_CHARACTERISTICS; -typedef struct _NDIS_OFFLOAD NDIS_OFFLOAD, *PNDIS_OFFLOAD; -typedef struct _NDIS_AF_LIST NDIS_AF_LIST, *PNDIS_AF_LIST; -typedef struct _X_FILTER ETH_FILTER, *PETH_FILTER; -typedef struct _X_FILTER TR_FILTER, *PTR_FILTER; -typedef struct _X_FILTER NULL_FILTER, *PNULL_FILTER; - -#if NDIS_SUPPORT_NDIS6 - -typedef USHORT NET_FRAME_TYPE, *PNET_FRAME_TYPE; - -#endif NDIS_SUPPORT_NDIS6 - - - -// -// Timers. -// - -typedef -VOID -(NDIS_TIMER_FUNCTION) ( - __in PVOID SystemSpecific1, - __in PVOID FunctionContext, - __in PVOID SystemSpecific2, - __in PVOID SystemSpecific3 - ); -typedef NDIS_TIMER_FUNCTION (*PNDIS_TIMER_FUNCTION); - -typedef struct _NDIS_TIMER -{ - KTIMER Timer; - KDPC Dpc; -} NDIS_TIMER, *PNDIS_TIMER; - - -#if NDIS_SUPPORT_NDIS6 -__drv_preferredFunction(NdisAllocateTimerObject, "Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisAllocateTimerObject instead.") -#endif NDIS_SUPPORT_NDIS6 -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisInitializeTimer( - __inout PNDIS_TIMER Timer, - __in PNDIS_TIMER_FUNCTION TimerFunction, - __in_opt __drv_isObjectPointer - PVOID FunctionContext - ); - -#if NDIS_SUPPORT_NDIS6 -__drv_preferredFunction(NdisCancelTimerObject, "Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisCancelTimerObject instead.") -#endif NDIS_SUPPORT_NDIS6 -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -NdisCancelTimer( - __in PNDIS_TIMER Timer, - __out __checkReturn - PBOOLEAN TimerCancelled - ); - -#if NDIS_SUPPORT_NDIS6 -__drv_preferredFunction(NdisSetTimerObject, "Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisSetTimerObject instead.") -#endif NDIS_SUPPORT_NDIS6 -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisSetTimer( - __in PNDIS_TIMER Timer, - __in UINT MillisecondsToDelay - ); - -#if NDIS_SUPPORT_NDIS6 -__drv_preferredFunction(NdisSetTimerObject, "Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisSetTimerObject instead.") -#endif NDIS_SUPPORT_NDIS6 -EXPORT -VOID -NdisSetPeriodicTimer( - __in PNDIS_TIMER NdisTimer, - __in UINT MillisecondsPeriod - ); - -#if NDIS_SUPPORT_NDIS6 -__drv_preferredFunction(NdisSetTimerObject, "Not supported for NDIS 6.0 drivers in Windows Vista. Use NdisSetTimerObject instead.") -#endif NDIS_SUPPORT_NDIS6 - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisSetTimerEx( - __in PNDIS_TIMER NdisTimer, - __in UINT MillisecondsToDelay, - __in __drv_isObjectPointer - PVOID FunctionContext - ); - - -#if NDIS_SUPPORT_60_COMPATIBLE_API -// -// System processor count -// - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -CCHAR -NdisSystemProcessorCount( - VOID - ); - -#endif - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -PVOID -NdisGetRoutineAddress( - __in PNDIS_STRING NdisRoutineName - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -UINT -NdisGetVersion( - VOID - ); - - -// -// Ansi/Unicode support routines -// - - -#define NdisInitAnsiString(_as, s) RtlInitString(_as, s) -#define NdisInitUnicodeString(_us, s) RtlInitUnicodeString(_us, s) -#define NdisAnsiStringToUnicodeString(_us, _as) RtlAnsiStringToUnicodeString(_us, _as, FALSE) -#define NdisUnicodeStringToAnsiString(_as, _us) RtlUnicodeStringToAnsiString(_as, _us, FALSE) -#define NdisUpcaseUnicodeString(_d, _s) RtlUpcaseUnicodeString(_d, _s, FALSE) - - -// -// Non-paged lookaside list support routines -// - -#define NdisInitializeNPagedLookasideList(_L, _AR, _FR, _Fl, _S, _T, _D) \ - ExInitializeNPagedLookasideList(_L, _AR, _FR, _Fl, _S, _T, _D) - -#define NdisDeleteNPagedLookasideList(_L) ExDeleteNPagedLookasideList(_L) -#define NdisAllocateFromNPagedLookasideList(_L) ExAllocateFromNPagedLookasideList(_L) -#define NdisFreeToNPagedLookasideList(_L, _E) ExFreeToNPagedLookasideList(_L, _E) - -#if NDIS_LEGACY_DRIVER -/* -NdisSetPacketStatus is deprecated. use NDIS_SET_PACKET_STATUS macro -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -DECLSPEC_DEPRECATED_DDK -EXPORT -VOID -NdisSetPacketStatus( - __in PNDIS_PACKET Packet, - __in NDIS_STATUS Status, - __in NDIS_HANDLE Handle, - __in ULONG Code - ); - -#endif - -#define NDIS_MAX_EVENT_LOG_DATA_SIZE ((ERROR_LOG_MAXIMUM_SIZE - sizeof(IO_ERROR_LOG_PACKET) + sizeof(ULONG)) & ~3) - -#if NDIS_SUPPORT_60_COMPATIBLE_API && !defined(NDIS_WRAPPER) - -#ifdef _WIN64 -#define NDIS_MAX_PROCESSOR_COUNT 64 -#else -#define NDIS_MAX_PROCESSOR_COUNT 32 -#endif - -#endif - -#if NDIS_SUPPORT_NDIS6 - -// -// NDIS_RESTART_ATTRIBUTES is used in NDIS_FILTER_RESTART_PARAMETERS, -// NDIS_MINIPORT_RESTART_PARAMETERS and NDIS_PROTOCOL_RESTART_PARAMETERS -// -typedef struct _NDIS_RESTART_ATTRIBUTES NDIS_RESTART_ATTRIBUTES, *PNDIS_RESTART_ATTRIBUTES; - -typedef struct _NDIS_RESTART_ATTRIBUTES -{ - PNDIS_RESTART_ATTRIBUTES Next; - NDIS_OID Oid; - ULONG DataLength; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) UCHAR Data[1]; -}NDIS_RESTART_ATTRIBUTES, *PNDIS_RESTART_ATTRIBUTES; - - - -// -// used in all NDIS drivers -// -typedef -NDIS_STATUS -(SET_OPTIONS)( - __in NDIS_HANDLE NdisDriverHandle, - __in NDIS_HANDLE DriverContext - ); - -typedef SET_OPTIONS (*SET_OPTIONS_HANDLER); -typedef SET_OPTIONS (MINIPORT_SET_OPTIONS); -typedef SET_OPTIONS (PROTOCOL_SET_OPTIONS); -typedef SET_OPTIONS (FILTER_SET_OPTIONS); - -#endif // NDIS_SUPPORT_NDIS6 - -#if NDIS_LEGACY_DRIVER -typedef -NDIS_STATUS -(*WAN_SEND_HANDLER)( - __in NDIS_HANDLE NdisBindingHandle, - __in NDIS_HANDLE LinkHandle, - __in PVOID Packet - ); - -typedef -NDIS_STATUS -(*SEND_HANDLER)( - __in NDIS_HANDLE NdisBindingHandle, - __in PNDIS_PACKET Packet - ); - -typedef -NDIS_STATUS -(*TRANSFER_DATA_HANDLER)( - __in NDIS_HANDLE NdisBindingHandle, - __in NDIS_HANDLE MacReceiveContext, - __in UINT ByteOffset, - __in UINT BytesToTransfer, - __out PNDIS_PACKET Packet, - __out PUINT BytesTransferred - ); - -typedef -NDIS_STATUS -(*RESET_HANDLER)( - __in NDIS_HANDLE NdisBindingHandle - ); - -typedef -NDIS_STATUS -(*REQUEST_HANDLER)( - __in NDIS_HANDLE NdisBindingHandle, - __in PNDIS_REQUEST NdisRequest - ); - -typedef -VOID -(*SEND_PACKETS_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -#endif // NDIS_LEGACY_DRIVER - -// -// NDIS object types created by NDIS drivers -// - - -#if NDIS_SUPPORT_NDIS6 - -#if NDIS_SUPPORT_60_COMPATIBLE_API -#define NDIS_CURRENT_PROCESSOR_NUMBER KeGetCurrentProcessorNumber() -#endif - -#define NDIS_CURRENT_IRQL() KeGetCurrentIrql() - -#define NDIS_RAISE_IRQL_TO_DISPATCH(_pIrql_) KeRaiseIrql(DISPATCH_LEVEL, _pIrql_) - -#define NDIS_LOWER_IRQL(_OldIrql_, _CurIrql_) \ -{ \ - if (_OldIrql_ != _CurIrql_) KeLowerIrql(_OldIrql_); \ -} - -typedef KMUTEX NDIS_MUTEX, *PNDIS_MUTEX; - -#define NDIS_INIT_MUTEX(_M_) KeInitializeMutex(_M_, 0xFFFF) -#define NDIS_RELEASE_MUTEX(_M_) KeReleaseMutex(_M_, FALSE) - -#define NDIS_WAIT_FOR_MUTEX(_M_) KeWaitForSingleObject(_M_, \ - Executive,\ - KernelMode,\ - FALSE, \ - NULL) \ - - - -#if NDIS_SUPPORT_60_COMPATIBLE_API - -EXPORT -ULONG -NdisSystemActiveProcessorCount( - PKAFFINITY ActiveProcessors - ); - -#endif - -#if NDIS_SUPPORT_NDIS620 - -EXPORT -USHORT -NdisActiveGroupCount( - VOID - ); - -EXPORT -USHORT -NdisMaxGroupCount( - VOID - ); - -EXPORT -ULONG -NdisGroupMaxProcessorCount( - USHORT Group - ); - -EXPORT -ULONG -NdisGroupActiveProcessorCount( - USHORT Group - ); - -EXPORT -KAFFINITY -NdisGroupActiveProcessorMask( - USHORT Group - ); - -EXPORT -PROCESSOR_NUMBER -NdisCurrentGroupAndProcessor( - VOID - ); - -EXPORT -ULONG -NdisCurrentProcessorIndex( - VOID - ); - -EXPORT -ULONG -NdisProcessorNumberToIndex( - PROCESSOR_NUMBER ProcNum - ); - -EXPORT -NTSTATUS -NdisProcessorIndexToNumber( - __in ULONG ProcIndex, - __out PPROCESSOR_NUMBER ProcNum - ); - -#endif - -#define NDIS_CONFIGURATION_OBJECT_REVISION_1 1 - -// -// Flags for NdisOpenConfigurationEx -// -#define NDIS_CONFIG_FLAG_FILTER_INSTANCE_CONFIGURATION 0x00000001 - -typedef struct _NDIS_CONFIGURATION_OBJECT -{ - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE NdisHandle; - ULONG Flags; -} NDIS_CONFIGURATION_OBJECT, *PNDIS_CONFIGURATION_OBJECT; - -#define NDIS_SIZEOF_CONFIGURATION_OBJECT_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_CONFIGURATION_OBJECT, Flags) - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisOpenConfigurationEx( - __in PNDIS_CONFIGURATION_OBJECT ConfigObject, - __out __drv_when(return==NDIS_STATUS_SUCCESS, - __drv_deref(__drv_allocatesMem(mem))) PNDIS_HANDLE ConfigurationHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_allocatesMem(Mem) -EXPORT -PVOID -NdisAllocateMemoryWithTagPriority( - __in NDIS_HANDLE NdisHandle, - __in UINT Length, - __in ULONG Tag, - __in EX_POOL_PRIORITY Priority - ); - - -typedef struct _NDIS_DRIVER_OPTIONAL_HANDLERS -{ - NDIS_OBJECT_HEADER Header; -} NDIS_DRIVER_OPTIONAL_HANDLERS, *PNDIS_DRIVER_OPTIONAL_HANDLERS; - -EXPORT -NDIS_STATUS -NdisSetOptionalHandlers( - NDIS_HANDLE NdisDriverHandle, - PNDIS_DRIVER_OPTIONAL_HANDLERS OptionalHandlers - ); - -// -// Flags used in NET_PNP_EVENT_NOTIFICATION Flags field -// - -#define NET_EVENT_HALT_MINIPORT_ON_LOW_POWER 0x00000001 - -#define NET_PNP_EVENT_NOTIFICATION_REVISION_1 1 - -typedef struct _NET_PNP_EVENT_NOTIFICATION -{ - // - // Caller must set Header to - // Type = NDIS_OBJECT_TYPE_DEFAULT - // Revision = NET_PNP_EVENT_NOTIFICATION_REVISION_1 - // Size = sizeof(_NET_PNP_EVENT_NOTIFICATION) - // - NDIS_OBJECT_HEADER Header; - - NDIS_PORT_NUMBER PortNumber; - - NET_PNP_EVENT NetPnPEvent; - ULONG Flags; - - -} NET_PNP_EVENT_NOTIFICATION, *PNET_PNP_EVENT_NOTIFICATION; - -#define NDIS_SIZEOF_NET_PNP_EVENT_NOTIFICATION_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_PNP_EVENT_NOTIFICATION, NetPnPEvent) - -// -// new request and status structures -// - -#define NDIS_OID_REQUEST_REVISION_1 1 -#define NDIS_OID_REQUEST_TIMEOUT_INFINITE 0 -#define NDIS_OID_REQUEST_NDIS_RESERVED_SIZE 16 - -typedef struct _NDIS_OID_REQUEST -{ - // - // Caller must set Header to - // Header.Type = NDIS_OBJECT_TYPE_OID_REQUEST - // Header.Revision = NDIS_OID_REQUEST_REVISION_1 - // Header.Size = NDIS_SIZEOF_OID_REQUEST_REVISION_1 - // - NDIS_OBJECT_HEADER Header; - NDIS_REQUEST_TYPE RequestType; - NDIS_PORT_NUMBER PortNumber; - UINT Timeout; // in Seconds - PVOID RequestId; - NDIS_HANDLE RequestHandle; - - // - // OID - Information - // - union _REQUEST_DATA - { - struct _QUERY - { - NDIS_OID Oid; - PVOID InformationBuffer; - UINT InformationBufferLength; - UINT BytesWritten; - UINT BytesNeeded; - } QUERY_INFORMATION; - - struct _SET - { - NDIS_OID Oid; - PVOID InformationBuffer; - UINT InformationBufferLength; - UINT BytesRead; - UINT BytesNeeded; - } SET_INFORMATION; - - struct _METHOD - { - NDIS_OID Oid; - PVOID InformationBuffer; - ULONG InputBufferLength; - ULONG OutputBufferLength; - ULONG MethodId; - UINT BytesWritten; - UINT BytesRead; - UINT BytesNeeded; - } METHOD_INFORMATION; - } DATA; - // - // NDIS Reserved - // - UCHAR NdisReserved[NDIS_OID_REQUEST_NDIS_RESERVED_SIZE * sizeof(PVOID)]; - UCHAR MiniportReserved[2*sizeof(PVOID)]; - UCHAR SourceReserved[2*sizeof(PVOID)]; - UCHAR SupportedRevision; - UCHAR Reserved1; - USHORT Reserved2; - -}NDIS_OID_REQUEST, *PNDIS_OID_REQUEST; - -#define NDIS_SIZEOF_OID_REQUEST_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_OID_REQUEST, Reserved2) -// -// Macros to set, clear and test NDIS_STATUS_INDICATION Flags -// -#define NDIS_STATUS_INDICATION_SET_FLAG(_StatusIndication, _F) \ - ((_StatusIndication)->Flags |= (_F)) - -#define NDIS_STATUS_INDICATION_TEST_FLAG(_StatusIndication, _F) \ - (((_StatusIndication)->Flags & (_F)) != 0) - -#define NDIS_STATUS_INDICATION_CLEAR_FLAG(_StatusIndication, _F) \ - ((_StatusIndication)->Flags &= ~(_F)) - -#define NDIS_STATUS_INDICATION_FLAGS_NDIS_RESERVED 0xFFF - -// -// Public flags for NDIS_STATUS_INDICATION -// -#define NDIS_STATUS_INDICATION_FLAGS_MEDIA_CONNECT_TO_CONNECT 0x1000 - -#define NDIS_STATUS_INDICATION_REVISION_1 1 - -typedef struct _NDIS_STATUS_INDICATION -{ - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE SourceHandle; - NDIS_PORT_NUMBER PortNumber; - NDIS_STATUS StatusCode; - ULONG Flags; - NDIS_HANDLE DestinationHandle; - PVOID RequestId; - PVOID StatusBuffer; - ULONG StatusBufferSize; - GUID Guid; // optional and valid only if StatusCode = NDIS_STATUS_MEDIA_SPECIFIC_INDICATION - PVOID NdisReserved[4]; -}NDIS_STATUS_INDICATION, *PNDIS_STATUS_INDICATION; - -#define NDIS_SIZEOF_STATUS_INDICATION_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_STATUS_INDICATION, NdisReserved) - - -// -// Generic Timer support -// - -#define NDIS_TIMER_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_TIMER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - ULONG AllocationTag; - PNDIS_TIMER_FUNCTION TimerFunction; - PVOID FunctionContext; -} NDIS_TIMER_CHARACTERISTICS, *PNDIS_TIMER_CHARACTERISTICS; - -#define NDIS_SIZEOF_TIMER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_TIMER_CHARACTERISTICS, FunctionContext) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_MAX_LOOKAHEAD_SIZE_ACCESSED_UNDEFINED -1 - -// -// Bits used in Flags field of NDIS_RESTART_GENERAL_ATTRIBUTES structure -// -#define NDIS_RESTART_GENERAL_ATTRIBUTES_MAX_LOOKAHEAD_ACCESSED_DEFINED 0x00000001 -#endif - -// -// NDIS_RESTART_GENERAL_ATTRIBUTES is used in NDIS_RESTART_ATTRIBUTES -// - -#define NDIS_RESTART_GENERAL_ATTRIBUTES_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_RESTART_GENERAL_ATTRIBUTES_REVISION_2 2 -#endif - -typedef struct _NDIS_RESTART_GENERAL_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - ULONG MtuSize; - ULONG64 MaxXmitLinkSpeed; - ULONG64 MaxRcvLinkSpeed; - ULONG LookaheadSize; - ULONG MacOptions; - ULONG SupportedPacketFilters; - ULONG MaxMulticastListSize; - PNDIS_RECEIVE_SCALE_CAPABILITIES RecvScaleCapabilities; - NET_IF_ACCESS_TYPE AccessType; - ULONG Flags; - NET_IF_CONNECTION_TYPE ConnectionType; - ULONG SupportedStatistics; - ULONG DataBackFillSize; - ULONG ContextBackFillSize; - PNDIS_OID SupportedOidList; - ULONG SupportedOidListLength; -#if (NDIS_SUPPORT_NDIS620) - ULONG MaxLookaheadSizeAccessed; -#endif -}NDIS_RESTART_GENERAL_ATTRIBUTES, *PNDIS_RESTART_GENERAL_ATTRIBUTES; - -#define NDIS_SIZEOF_RESTART_GENERAL_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_RESTART_GENERAL_ATTRIBUTES, SupportedOidListLength) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SIZEOF_RESTART_GENERAL_ATTRIBUTES_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_RESTART_GENERAL_ATTRIBUTES, MaxLookaheadSizeAccessed) -#endif - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisAllocateTimerObject( - __in NDIS_HANDLE NdisHandle, - __in PNDIS_TIMER_CHARACTERISTICS TimerCharacteristics, - __out __drv_deref(__drv_isObjectPointer) - PNDIS_HANDLE pTimerObject - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -BOOLEAN -NdisSetTimerObject( - __in NDIS_HANDLE TimerObject, - __in LARGE_INTEGER DueTime, - __in_opt LONG MillisecondsPeriod, - __in_opt PVOID FunctionContext - ); - -// -// Marking this as <= DISPATCH but in reality this should actually be == PASSIVE -// (in some cases). It depends if the TimerObject was created to be a Periodic Timer -// or not. We'll rely on SDV to catch these extra cases for now. -// -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -EXPORT -BOOLEAN -NdisCancelTimerObject( - __in NDIS_HANDLE TimerObject - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeTimerObject( - __in NDIS_HANDLE TimerObject - ); - -EXPORT -NDIS_STATUS -NdisAllocateCloneOidRequest( - IN NDIS_HANDLE SourceHandle, - IN PNDIS_OID_REQUEST OidRequest, - IN UINT PoolTag, - OUT PNDIS_OID_REQUEST* ClonedOidRequest - ); - -EXPORT -VOID -NdisFreeCloneOidRequest( - IN NDIS_HANDLE SourceHandle, - IN PNDIS_OID_REQUEST Request - ); - -EXPORT -VOID -NdisGetSystemUpTimeEx( - OUT PLARGE_INTEGER pSystemUpTime - ); - -#if NDIS_SUPPORT_60_COMPATIBLE_API - -typedef struct _NDIS_PROCESSOR_INFO -{ - ULONG CpuNumber; - ULONG PhysicalPackageId; - ULONG CoreId; - ULONG HyperThreadID; -}NDIS_PROCESSOR_INFO, *PNDIS_PROCESSOR_INFO; - -#define NDIS_SYSTEM_PROCESSOR_INFO_REVISION_1 1 - -typedef struct _NDIS_SYSTEM_PROCESSOR_INFO -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - NDIS_PROCESSOR_VENDOR ProcessorVendor; - ULONG NumPhysicalPackages; - ULONG NumCores; - ULONG NumCoresPerPhysicalPackage; - ULONG MaxHyperThreadingCpusPerCore; - ULONG RssBaseCpu; - ULONG RssCpuCount; - __out_ecount(MAXIMUM_PROC_PER_GROUP) PUCHAR RssProcessors; - NDIS_PROCESSOR_INFO CpuInfo[MAXIMUM_PROC_PER_GROUP]; -}NDIS_SYSTEM_PROCESSOR_INFO, *PNDIS_SYSTEM_PROCESSOR_INFO; - -#define NDIS_SIZEOF_SYSTEM_PROCESSOR_INFO_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_SYSTEM_PROCESSOR_INFO, CpuInfo) - -EXPORT -NDIS_STATUS -NdisGetProcessorInformation( - __inout PNDIS_SYSTEM_PROCESSOR_INFO SystemProcessorInfo - ); - -#endif // NDIS_SUPPORT_60_COMPATIBLE_API - -#if NDIS_SUPPORT_NDIS620 - -EXPORT -NDIS_STATUS -NdisGetRssProcessorInformation( - __in NDIS_HANDLE NdisHandle, - __out_bcount_opt(*Size) PNDIS_RSS_PROCESSOR_INFO RssProcessorInfo, - __inout PSIZE_T Size - ); - -EXPORT -NDIS_STATUS -NdisGetProcessorInformationEx( - __in_opt NDIS_HANDLE NdisHandle, - __out_bcount_opt(*Size) PNDIS_SYSTEM_PROCESSOR_INFO_EX SystemProcessorInfo, - __inout PSIZE_T Size - ); - -#endif - - -// -// Pause reason used in NDIS_MINIPORT_PAUSE_PARAMETERS, NDIS_FILTER_PAUSE_PARAMETERS -// and NDIS_PROTOCOL_PAUSE_PARAMETERS -// -#define NDIS_PAUSE_NDIS_INTERNAL 0x00000001 -#define NDIS_PAUSE_LOW_POWER 0x00000002 -#define NDIS_PAUSE_BIND_PROTOCOL 0x00000004 -#define NDIS_PAUSE_UNBIND_PROTOCOL 0x00000008 -#define NDIS_PAUSE_ATTACH_FILTER 0x00000010 -#define NDIS_PAUSE_DETACH_FILTER 0x00000020 -#define NDIS_PAUSE_FILTER_RESTART_STACK 0x00000040 -#define NDIS_PAUSE_MINIPORT_DEVICE_REMOVE 0x00000080 - -#endif // NDIS_SUPPORT_NDIS6 - -#if (NTDDI_VERSION >= NTDDI_VISTA) -#if (NDIS_LEGACY_DRIVER || NDIS_SUPPORT_NDIS6) -// -// Flags used in NDIS_FILTER_INTERFACE -// -#define NDIS_FILTER_INTERFACE_IM_FILTER 0x00000001 -#define NDIS_FILTER_INTERFACE_LW_FILTER 0x00000002 - - -// -// NDIS_FILTER_INTERFACE is used in NDIS_ENUM_FILTERS -// structure that is used in NdisEnumerateFilterModules -// -#define NDIS_FILTER_INTERFACE_REVISION_1 1 - -typedef struct _NDIS_FILTER_INTERFACE -{ - - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG FilterType; - ULONG FilterRunType; - NET_IFINDEX IfIndex; - NET_LUID NetLuid; - NDIS_STRING FilterClass; - NDIS_STRING FilterInstanceName; -} NDIS_FILTER_INTERFACE, *PNDIS_FILTER_INTERFACE; - -#define NDIS_SIZEOF_FILTER_INTERFACE_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_INTERFACE, FilterInstanceName) - -// -// NDIS_ENUM_FILTERS is used in NdisEnumerateFilterModules -// -#define NDIS_ENUM_FILTERS_REVISION_1 1 - -typedef struct _NDIS_ENUM_FILTERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG NumberOfFilters; - ULONG OffsetFirstFilter; - NDIS_FILTER_INTERFACE Filter[1]; -} NDIS_ENUM_FILTERS, *PNDIS_ENUM_FILTERS; - -#define NDIS_SIZEOF_ENUM_FILTERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_ENUM_FILTERS, Filter) - -EXPORT -NDIS_STATUS -NdisEnumerateFilterModules( - IN NDIS_HANDLE NdisHandle, - IN PVOID InterfaceBuffer, - IN ULONG InterfaceBufferLength, - IN OUT PULONG BytesNeeded, - IN OUT PULONG BytesWritten - ); - -// -// The NdisRegisterDeviceEx is used by NDIS 5 and 6 drivers on NTDDI_VISTA -// These drivers use NdisRegisterDeviceEx to use the new security features -// not available in NdisRegisterDevice or NdisMRegisterDevice -// -#define NDIS_DEVICE_OBJECT_ATTRIBUTES_REVISION_1 1 - -typedef struct _NDIS_DEVICE_OBJECT_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - PNDIS_STRING DeviceName; - PNDIS_STRING SymbolicName; - PDRIVER_DISPATCH* MajorFunctions; - ULONG ExtensionSize; - PCUNICODE_STRING DefaultSDDLString; - LPCGUID DeviceClassGuid; -} NDIS_DEVICE_OBJECT_ATTRIBUTES, *PNDIS_DEVICE_OBJECT_ATTRIBUTES; - -#define NDIS_SIZEOF_DEVICE_OBJECT_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_DEVICE_OBJECT_ATTRIBUTES, DeviceClassGuid) - -EXPORT -NDIS_STATUS -NdisRegisterDeviceEx( - IN NDIS_HANDLE NdisObjectHandle, - IN PNDIS_DEVICE_OBJECT_ATTRIBUTES DeviceObjectAttributes, - OUT PDEVICE_OBJECT * pDeviceObject, - OUT PNDIS_HANDLE NdisDeviceHandle - ); - -EXPORT -VOID -NdisDeregisterDeviceEx( - IN NDIS_HANDLE NdisDeviceHandle - ); - -EXPORT -PVOID -NdisGetDeviceReservedExtension( - IN PDEVICE_OBJECT DeviceObject - ); - -// -// This structure is used by NDIS 5.x drivers that want to use -// NdisRegisterDeviceEx -// -#define NDIS_OBJECT_TYPE_DRIVER_WRAPPER_REVISION_1 1 -typedef struct _NDIS_DRIVER_WRAPPER_HANDLE -{ - // - // Caller must set Header to - // Header.Type = NDIS_OBJECT_TYPE_DRIVER_WRAPPER_OBJECT - // Header.Revision = NDIS_OBJECT_TYPE_DRIVER_WRAPPER_REVISION_1 - // Header.Size = sizeof(NDIS_DRIVER_WRAPPER_HANDLE) - // - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE NdisWrapperHandle; - -} NDIS_DRIVER_WRAPPER_HANDLE, *PNDIS_DRIVER_WRAPPER_HANDLE; - -#define NDIS_SIZEOF_DRIVER_WRAPPER_HANDLE_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_DRIVER_WRAPPER_HANDLE, NdisWrapperHandle) - -#endif // NDIS_SUPPORT_NDIS6 || NDIS_LEGACY_DRIVER -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#if (NDIS_SUPPORT_NDIS620) - -// -// shared memory usage types used in NDIS_SHARED_MEMORY_PARAMETERS -// - -typedef enum _NDIS_SHARED_MEMORY_USAGE -{ - NdisSharedMemoryUsageUndefined, - NdisSharedMemoryUsageXmit, - NdisSharedMemoryUsageXmitHeader, - NdisSharedMemoryUsageXmitData, - NdisSharedMemoryUsageReceive, - NdisSharedMemoryUsageReceiveLookahead, - NdisSharedMemoryUsageReceivePostLookahead, - NdisSharedMemoryUsageReceiveHeader, - NdisSharedMemoryUsageReceiveData, - NdisSharedMemoryUsageOther, - NdisSharedMemoryUsageMax -}NDIS_SHARED_MEMORY_USAGE, *PNDIS_SHARED_MEMORY_USAGE; - -// -// NDIS_SHARED_MEMORY_PARAMETERS structure describes -// a shared memory allocation request for a receive queue. -// This structure is used in NdisMAllocateSharedMemoryEx API -// as well as ALLOCATE_SHARED_MEMORY_HANDLER entry point -// - -// -// TODO: Temporary definition to get around VSP build break -// -typedef ULONG NODE_REQUIREMENT; - -// -// flags used in Flags field of NDIS_SHARED_MEMORY_PARAMETERS structure -// -#define NDIS_SHARED_MEM_PARAMETERS_CONTIGOUS 0x00000001 - - -// -// shared memory handle used for allocation from HAL -// -#define NDIS_SHARED_MEM_HANDLE_HAL_ALLOCATED ((NDIS_HANDLE)(NULL)) - -#define NDIS_SHARED_MEMORY_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_SHARED_MEMORY_PARAMETERS -{ - __in NDIS_OBJECT_HEADER Header; - __in ULONG Flags; - __in NDIS_RECEIVE_QUEUE_ID QueueId; - __out NDIS_HANDLE SharedMemoryHandle; - __in NODE_REQUIREMENT PreferredNode; - __in NDIS_SHARED_MEMORY_USAGE Usage; - __in ULONG Length; - __out PVOID VirtualAddress; - __in ULONG SGListBufferLength; - __inout PSCATTER_GATHER_LIST SGListBuffer; - }NDIS_SHARED_MEMORY_PARAMETERS, *PNDIS_SHARED_MEMORY_PARAMETERS; - -#define NDIS_SIZEOF_SHARED_MEMORY_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_SHARED_MEMORY_PARAMETERS, SGListBuffer) - -typedef -NDIS_STATUS -(*ALLOCATE_SHARED_MEMORY_HANDLER)( - __in NDIS_HANDLE ProviderContext, - __in PNDIS_SHARED_MEMORY_PARAMETERS SharedMemoryParameters, - __inout PNDIS_HANDLE pSharedMemoryProviderContext - ); - -typedef -VOID -(*FREE_SHARED_MEMORY_HANDLER)( - __in NDIS_HANDLE ProviderContext, - __in NDIS_HANDLE SharedMemoryProviderContext - ); - -#define NDIS_SHARED_MEMORY_PROVIDER_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_SHARED_MEMORY_PROVIDER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_SHARED_MEMORY_PROVIDER_CHARACTERISTICS - ULONG Flags; - NDIS_HANDLE ProviderContext; - ALLOCATE_SHARED_MEMORY_HANDLER AllocateSharedMemoryHandler; - FREE_SHARED_MEMORY_HANDLER FreeSharedMemoryHandler; -} NDIS_SHARED_MEMORY_PROVIDER_CHARACTERISTICS, *PNDIS_SHARED_MEMORY_PROVIDER_CHARACTERISTICS; - -#define NDIS_SIZEOF_SHARED_MEMORY_PROVIDER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_SHARED_MEMORY_PROVIDER_CHARACTERISTICS, FreeSharedMemoryHandler) - -EXPORT -VOID -NdisFreeMemoryWithTagPriority( - IN NDIS_HANDLE NdisHandle, - IN PVOID VirtualAddress, - IN ULONG Tag - ); - -// -// the following structure is used in NDIS_STATUS_RECEIVE_QUEUE_STATE -// status indication -// -#define NDIS_RECEIVE_QUEUE_STATE_REVISION_1 1 -typedef struct _NDIS_RECEIVE_QUEUE_STATE -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - NDIS_RECEIVE_QUEUE_ID QueueId; - NDIS_RECEIVE_QUEUE_OPERATIONAL_STATE QueueState; -}NDIS_RECEIVE_QUEUE_STATE, *PNDIS_RECEIVE_QUEUE_STATE; - -#define NDIS_SIZEOF_NDIS_RECEIVE_QUEUE_STATE_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_RECEIVE_QUEUE_STATE, QueueState) - -EXPORT -NDIS_STATUS -NdisAllocateSharedMemory( - IN NDIS_HANDLE NdisHandle, - IN PNDIS_SHARED_MEMORY_PARAMETERS SharedMemoryParameters, - IN OUT PNDIS_HANDLE pAllocationHandle - ); - -EXPORT -VOID -NdisFreeSharedMemory( - IN NDIS_HANDLE NdisHandle, - IN NDIS_HANDLE AllocationHandle - ); - -// -// NDIS_PROCESS_SG_LIST is a driver supplied callback routine used -// in NdisBuildScatterGatherList -// - -typedef -VOID -(NDIS_PROCESS_SG_LIST)( - __in PDEVICE_OBJECT DeviceObject, - __in PVOID Reserved, - __in PSCATTER_GATHER_LIST ScatterGatherListBuffer, - __in PVOID Context - ); - -typedef NDIS_PROCESS_SG_LIST (*NDIS_PROCESS_SG_LIST_HANDLER); - - -// -// NDIS_SCATTER_GATHER_LIST_PARAMETERS is used in NdisBuildScatterGatherList -// API call to build a scatter gather list for a buffer -// - -#define NDIS_SCATTER_GATHER_LIST_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_SCATTER_GATHER_LIST_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - NDIS_RECEIVE_QUEUE_ID QueueId; - NDIS_SHARED_MEMORY_USAGE SharedMemoryUsage; - PMDL Mdl; - PVOID CurrentVa; - ULONG Length; - NDIS_PROCESS_SG_LIST_HANDLER ProcessSGListHandler; - PVOID Context; - PSCATTER_GATHER_LIST ScatterGatherListBuffer; - ULONG ScatterGatherListBufferSize; - ULONG ScatterGatherListBufferSizeNeeded; -}NDIS_SCATTER_GATHER_LIST_PARAMETERS, *PNDIS_SCATTER_GATHER_LIST_PARAMETERS; -#define NDIS_SIZEOF_SCATTER_GATHER_LIST_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_SCATTER_GATHER_LIST_PARAMETERS, ScatterGatherListBufferSizeNeeded) - -EXPORT -NDIS_STATUS -NdisBuildScatterGatherList( - IN NDIS_HANDLE NdisHandle, - IN PNDIS_SCATTER_GATHER_LIST_PARAMETERS SGListParameters - ); - -EXPORT -VOID -NdisFreeScatterGatherList( - IN NDIS_HANDLE NdisHandle, - IN PSCATTER_GATHER_LIST ScatterGatherListBuffer, - IN BOOLEAN WriteToDevice - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -BOOLEAN -NdisSetCoalescableTimerObject( - __in NDIS_HANDLE TimerObject, - __in LARGE_INTEGER DueTime, - __in_opt LONG MillisecondsPeriod, - __in_opt PVOID FunctionContext, - __in_opt ULONG Tolerance - ); - -NDIS_STATUS -NdisGetHypervisorInfo( - __inout PNDIS_HYPERVISOR_INFO HypervisorInfo - ); - -#endif // #if (NDIS_SUPPORT_NDIS620) - - -#ifndef AFFINITY_MASK -#define AFFINITY_MASK(n) ((KAFFINITY)1 << (n)) -#endif - -#pragma warning(pop) - - -#pragma once - -#pragma warning(push) - -#pragma warning(disable:4201) // (nonstandard extension used : nameless struct/union) -#pragma warning(disable:4214) // (extension used : bit field types other than int) - -#if (NDIS_SUPPORT_NDIS6 || NDIS60) - -// -// NET_BUFFER data structures, APIs and macros -// - -typedef struct _NET_BUFFER NET_BUFFER, *PNET_BUFFER; -typedef struct _NET_BUFFER_LIST_CONTEXT NET_BUFFER_LIST_CONTEXT, *PNET_BUFFER_LIST_CONTEXT; -typedef struct _NET_BUFFER_LIST NET_BUFFER_LIST, *PNET_BUFFER_LIST; - -struct _SCATTER_GATHER_LIST; -typedef struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST; - -typedef union _NET_BUFFER_DATA_LENGTH -{ - ULONG DataLength; - SIZE_T stDataLength; -} NET_BUFFER_DATA_LENGTH, *PNET_BUFFER_DATA_LENGTH; - - -typedef struct _NET_BUFFER_DATA -{ - PNET_BUFFER Next; - PMDL CurrentMdl; - ULONG CurrentMdlOffset; -#ifdef __cplusplus - NET_BUFFER_DATA_LENGTH NbDataLength; -#else - NET_BUFFER_DATA_LENGTH; -#endif - PMDL MdlChain; - ULONG DataOffset; -} NET_BUFFER_DATA, *PNET_BUFFER_DATA; - -typedef union _NET_BUFFER_HEADER -{ -#ifdef __cplusplus - NET_BUFFER_DATA NetBufferData; -#else - NET_BUFFER_DATA; -#endif - SLIST_HEADER Link; - -} NET_BUFFER_HEADER, *PNET_BUFFER_HEADER; - - -#if (NDIS_SUPPORT_NDIS620) - -// -// NET_BUFFER_SHARED_MEMORY is used to describe the -// shared memory segments used in each NET_BUFFER. -// for NDIS 6.20, they are used in VM queue capable NICs -// used in virtualization environment -// -typedef struct _NET_BUFFER_SHARED_MEMORY NET_BUFFER_SHARED_MEMORY, *PNET_BUFFER_SHARED_MEMORY; - -typedef struct _NET_BUFFER_SHARED_MEMORY -{ - PNET_BUFFER_SHARED_MEMORY NextSharedMemorySegment; - ULONG SharedMemoryFlags; - NDIS_HANDLE SharedMemoryHandle; - ULONG SharedMemoryOffset; - ULONG SharedMemoryLength; -}NET_BUFFER_SHARED_MEMORY, *PNET_BUFFER_SHARED_MEMORY; - -#endif // NDIS_SUPPORT_NDIS620 - - - -typedef struct _NET_BUFFER -{ - -#ifdef __cplusplus - NET_BUFFER_HEADER NetBufferHeader; -#else - NET_BUFFER_HEADER; -#endif - - USHORT ChecksumBias; - USHORT Reserved; - NDIS_HANDLE NdisPoolHandle; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID NdisReserved[2]; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID ProtocolReserved[6]; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID MiniportReserved[4]; - NDIS_PHYSICAL_ADDRESS DataPhysicalAddress; -#if (NDIS_SUPPORT_NDIS620) - union - { - PNET_BUFFER_SHARED_MEMORY SharedMemoryInfo; - PSCATTER_GATHER_LIST ScatterGatherList; - }; -#endif -}NET_BUFFER, *PNET_BUFFER; - -#pragma warning(push) -#pragma warning(disable:4200) // nonstandard extension used : zero-sized array in struct/union - -typedef struct _NET_BUFFER_LIST_CONTEXT -{ - PNET_BUFFER_LIST_CONTEXT Next; - USHORT Size; - USHORT Offset; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) UCHAR ContextData[]; -} NET_BUFFER_LIST_CONTEXT, *PNET_BUFFER_LIST_CONTEXT; - -#pragma warning(pop) - -typedef enum _NDIS_NET_BUFFER_LIST_INFO -{ - TcpIpChecksumNetBufferListInfo, - TcpOffloadBytesTransferred = TcpIpChecksumNetBufferListInfo, - IPsecOffloadV1NetBufferListInfo, -#if (NDIS_SUPPORT_NDIS61) - IPsecOffloadV2NetBufferListInfo = IPsecOffloadV1NetBufferListInfo, -#endif // (NDIS_SUPPORT_NDIS61) - TcpLargeSendNetBufferListInfo, - TcpReceiveNoPush = TcpLargeSendNetBufferListInfo, - ClassificationHandleNetBufferListInfo, - Ieee8021QNetBufferListInfo, - NetBufferListCancelId, - MediaSpecificInformation, - NetBufferListFrameType, - NetBufferListProtocolId = NetBufferListFrameType, - NetBufferListHashValue, - NetBufferListHashInfo, - WfpNetBufferListInfo, -#if (NDIS_SUPPORT_NDIS61) - IPsecOffloadV2TunnelNetBufferListInfo, - IPsecOffloadV2HeaderNetBufferListInfo, -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) - NetBufferListCorrelationId, - NetBufferListFilteringInfo, - - - MediaSpecificInformationEx, - NblOriginalInterfaceIfIndex, - NblReAuthWfpFlowContext = NblOriginalInterfaceIfIndex, - TcpReceiveBytesTransferred, -#endif // (NDIS_SUPPORT_NDIS620) - - - MaxNetBufferListInfo -} NDIS_NET_BUFFER_LIST_INFO, *PNDIS_NET_BUFFER_LIST_INFO; - -typedef struct _NET_BUFFER_LIST_DATA -{ - PNET_BUFFER_LIST Next; // Next NetBufferList in the chain - PNET_BUFFER FirstNetBuffer; // First NetBuffer on this NetBufferList -} NET_BUFFER_LIST_DATA, *PNET_BUFFER_LIST_DATA; - -typedef union _NET_BUFFER_LIST_HEADER -{ -#ifdef __cplusplus - NET_BUFFER_LIST_DATA NetBufferListData; -#else - NET_BUFFER_LIST_DATA; -#endif - SLIST_HEADER Link; // used in SLIST of free NetBuffers in the block -} NET_BUFFER_LIST_HEADER, *PNET_BUFFER_LIST_HEADER; - - -typedef struct _NET_BUFFER_LIST -{ - -#ifdef __cplusplus - NET_BUFFER_LIST_HEADER NetBufferListHeader; -#else - NET_BUFFER_LIST_HEADER; -#endif - - PNET_BUFFER_LIST_CONTEXT Context; - PNET_BUFFER_LIST ParentNetBufferList; - NDIS_HANDLE NdisPoolHandle; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID NdisReserved[2]; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID ProtocolReserved[4]; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT)PVOID MiniportReserved[2]; - PVOID Scratch; - NDIS_HANDLE SourceHandle; - ULONG NblFlags; // public flags - LONG ChildRefCount; - ULONG Flags; // private flags used by NDIs, protocols, miniport, etc. - NDIS_STATUS Status; - PVOID NetBufferListInfo[MaxNetBufferListInfo]; -} NET_BUFFER_LIST, *PNET_BUFFER_LIST; - - - - -#ifdef __cplusplus -#define NET_BUFFER_NEXT_NB(_NB) ((_NB)->NetBufferHeader.NetBufferData.Next) -#define NET_BUFFER_FIRST_MDL(_NB) ((_NB)->NetBufferHeader.NetBufferData.MdlChain) -#define NET_BUFFER_DATA_LENGTH(_NB) ((_NB)->NetBufferHeader.NetBufferData.NbDataLength.DataLength) -#define NET_BUFFER_DATA_OFFSET(_NB) ((_NB)->NetBufferHeader.NetBufferData.DataOffset) -#define NET_BUFFER_CURRENT_MDL(_NB) ((_NB)->NetBufferHeader.NetBufferData.CurrentMdl) -#define NET_BUFFER_CURRENT_MDL_OFFSET(_NB) ((_NB)->NetBufferHeader.NetBufferData.CurrentMdlOffset) -#else -#define NET_BUFFER_NEXT_NB(_NB) ((_NB)->Next) -#define NET_BUFFER_FIRST_MDL(_NB) ((_NB)->MdlChain) -#define NET_BUFFER_DATA_LENGTH(_NB) ((_NB)->DataLength) -#define NET_BUFFER_DATA_OFFSET(_NB) ((_NB)->DataOffset) -#define NET_BUFFER_CURRENT_MDL(_NB) ((_NB)->CurrentMdl) -#define NET_BUFFER_CURRENT_MDL_OFFSET(_NB) ((_NB)->CurrentMdlOffset) -#endif - -#define NET_BUFFER_PROTOCOL_RESERVED(_NB) ((_NB)->ProtocolReserved) -#define NET_BUFFER_MINIPORT_RESERVED(_NB) ((_NB)->MiniportReserved) -#define NET_BUFFER_CHECKSUM_BIAS(_NB) ((_NB)->ChecksumBias) - -#if (NDIS_SUPPORT_NDIS61) -#define NET_BUFFER_DATA_PHYSICAL_ADDRESS(_NB) ((_NB)->DataPhysicalAddress) -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NET_BUFFER_FIRST_SHARED_MEM_INFO(_NB) ((_NB)->SharedMemoryInfo) -#define NET_BUFFER_SHARED_MEM_NEXT_SEGMENT(_SHI) ((_SHI)->NextSharedMemorySegment) -#define NET_BUFFER_SHARED_MEM_FLAGS(_SHI) ((_SHI)->SharedMemoryFlags) -#define NET_BUFFER_SHARED_MEM_HANDLE(_SHI) ((_SHI)->SharedMemoryHandle) -#define NET_BUFFER_SHARED_MEM_OFFSET(_SHI) ((_SHI)->SharedMemoryOffset) -#define NET_BUFFER_SHARED_MEM_LENGTH(_SHI) ((_SHI)->SharedMemoryLength) - -#define NET_BUFFER_SCATTER_GATHER_LIST(_NB) ((_NB)->ScatterGatherList) - -#endif // (NDIS_SUPPORT_NDIS620) - - -#ifdef __cplusplus -#define NET_BUFFER_LIST_NEXT_NBL(_NBL) ((_NBL)->NetBufferListHeader.NetBufferListData.Next) -#define NET_BUFFER_LIST_FIRST_NB(_NBL) ((_NBL)->NetBufferListHeader.NetBufferListData.FirstNetBuffer) -#else -#define NET_BUFFER_LIST_NEXT_NBL(_NBL) ((_NBL)->Next) -#define NET_BUFFER_LIST_FIRST_NB(_NBL) ((_NBL)->FirstNetBuffer) -#endif - -#define NET_BUFFER_LIST_FLAGS(_NBL) ((_NBL)->Flags) -#define NET_BUFFER_LIST_NBL_FLAGS(_NBL) ((_NBL)->NblFlags) -#define NET_BUFFER_LIST_PROTOCOL_RESERVED(_NBL) ((_NBL)->ProtocolReserved) -#define NET_BUFFER_LIST_MINIPORT_RESERVED(_NBL) ((_NBL)->MiniportReserved) -#define NET_BUFFER_LIST_CONTEXT_DATA_START(_NBL) ((PUCHAR)(((_NBL)->Context)+1)+(_NBL)->Context->Offset) -#define NET_BUFFER_LIST_CONTEXT_DATA_SIZE(_NBL) (((_NBL)->Context)->Size) - -#define NET_BUFFER_LIST_INFO(_NBL, _Id) ((_NBL)->NetBufferListInfo[(_Id)]) -#define NET_BUFFER_LIST_STATUS(_NBL) ((_NBL)->Status) - - -#define NDIS_GET_NET_BUFFER_LIST_CANCEL_ID(_NBL) (NET_BUFFER_LIST_INFO(_NBL, NetBufferListCancelId)) -#define NDIS_SET_NET_BUFFER_LIST_CANCEL_ID(_NBL, _CancelId) \ - NET_BUFFER_LIST_INFO(_NBL, NetBufferListCancelId) = _CancelId - - -// -// Per-NBL information for Ieee8021QNetBufferListInfo. -// -typedef struct _NDIS_NET_BUFFER_LIST_8021Q_INFO -{ - union - { - struct - { - UINT32 UserPriority:3; // 802.1p priority - UINT32 CanonicalFormatId:1; // always 0 - UINT32 VlanId:12; // VLAN Identification - UINT32 Reserved:16; // set to 0 for ethernet - }TagHeader; - - struct - { - UINT32 UserPriority:3; // 802.1p priority - UINT32 CanonicalFormatId:1; // always 0 - UINT32 VlanId:12; // VLAN Identification - UINT32 WMMInfo:4; - UINT32 Reserved:12; // set to 0 for wireless lan - - }WLanTagHeader; - - PVOID Value; - }; -} NDIS_NET_BUFFER_LIST_8021Q_INFO, *PNDIS_NET_BUFFER_LIST_8021Q_INFO; - -typedef struct _NDIS_NET_BUFFER_LIST_MEDIA_SPECIFIC_INFO -{ - union - { - PVOID MediaSpecificInfo; - PVOID NativeWifiSpecificInfo; - - PVOID Value; - }; - -} NDIS_NET_BUFFER_LIST_MEDIA_SPECIFIC_INFO, *PNDIS_NET_BUFFER_LIST_MEDIA_SPECIFIC_INFO; - -typedef struct _NDIS_NBL_MEDIA_MEDIA_SPECIFIC_INFORMATION NDIS_NBL_MEDIA_SPECIFIC_INFORMATION, *PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION; - - -struct _NDIS_NBL_MEDIA_MEDIA_SPECIFIC_INFORMATION -{ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION NextEntry; - ULONG Tag; - DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) UCHAR Data[1]; -}; - -#define NDIS_NBL_ADD_MEDIA_SPECIFIC_INFO(_NBL, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION HeadEntry = NULL; \ - if (NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformation) != NULL) \ - { \ - HeadEntry = (PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION)(NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformation)); \ - } \ - NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformation) = (_MediaSpecificInfo); \ - (_MediaSpecificInfo)->NextEntry = HeadEntry; \ - } - -#define NDIS_NBL_REMOVE_MEDIA_SPECIFIC_INFO(_NBL, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION *HeadEntry; \ - HeadEntry = (PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION *)&(NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformation)); \ - for (; *HeadEntry != NULL; HeadEntry = &(*HeadEntry)->NextEntry) \ - { \ - if ((*HeadEntry)->Tag == (_MediaSpecificInfo)->Tag) \ - { \ - *HeadEntry = (*HeadEntry)->NextEntry; \ - break; \ - } \ - } \ - } - -#define NDIS_NBL_GET_MEDIA_SPECIFIC_INFO(_NBL, _Tag, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION HeadEntry; \ - (_MediaSpecificInfo) = NULL; \ - HeadEntry = (PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION)(NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformation)); \ - for (; HeadEntry != NULL; HeadEntry = HeadEntry->NextEntry) \ - { \ - if (HeadEntry->Tag == (_Tag)) \ - { \ - (_MediaSpecificInfo) = HeadEntry; \ - break; \ - } \ - } \ - } - -#if NDIS_SUPPORT_NDIS620 - -typedef struct _NDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX -{ - NDIS_OBJECT_HEADER Header; - struct _NDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX* NextEntry; - ULONG Tag; - PVOID Data; -} NDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX, *PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX; - -#define NDIS_NBL_MEDIA_SPECIFIC_INFO_REVISION_1 1 - -#define NDIS_SIZEOF_NBL_MEDIA_SPECIFIC_INFO_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX,Data) - -#define NDIS_NBL_ADD_MEDIA_SPECIFIC_INFO_EX(_NBL, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX HeadEntry; \ - \ - HeadEntry = NET_BUFFER_LIST_INFO(_NBL, MediaSpecificInformationEx); \ - NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformationEx) = (_MediaSpecificInfo); \ - (_MediaSpecificInfo)->NextEntry = HeadEntry; \ - } - -#define NDIS_NBL_REMOVE_MEDIA_SPECIFIC_INFO_EX(_NBL, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX *HeadEntry; \ - HeadEntry = (PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX *)&(NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformationEx)); \ - for (; *HeadEntry != NULL; HeadEntry = &(*HeadEntry)->NextEntry) \ - { \ - if ((*HeadEntry)->Tag == (_MediaSpecificInfo)->Tag) \ - { \ - *HeadEntry = (*HeadEntry)->NextEntry; \ - break; \ - } \ - } \ - } - -#define NDIS_NBL_GET_MEDIA_SPECIFIC_INFO_EX(_NBL, _Tag, _MediaSpecificInfo) \ - { \ - PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX HeadEntry; \ - (_MediaSpecificInfo) = NULL; \ - HeadEntry = (PNDIS_NBL_MEDIA_SPECIFIC_INFORMATION_EX)(NET_BUFFER_LIST_INFO((_NBL), MediaSpecificInformationEx)); \ - for (; HeadEntry != NULL; HeadEntry = HeadEntry->NextEntry) \ - { \ - if (HeadEntry->Tag == (_Tag)) \ - { \ - (_MediaSpecificInfo) = HeadEntry; \ - break; \ - } \ - } \ - } - -#endif - - -/* -Bit 31 - 0 for MS tag - 1 for Vendor tag -Bits 30-16 - Vendor ID (if Bit 31 = 1) - - Technology ID (if Bit 31 = 0) -Bits 15-0 - Tag ID - -*/ - -// -// Microsoft Media Specific-Info tags -// -//TUNNEL - Technology ID : 1 -#define NDIS_MEDIA_SPECIFIC_INFO_TUNDL 0x00010001 -// -// Intel Media Specific Info tags -// -#define NDIS_MEDIA_SPECIFIC_INFO_FCOE 0x80010000 -#define NDIS_MEDIA_SPECIFIC_INFO_EAPOL 0x80010001 -#define NDIS_MEDIA_SPECIFIC_INFO_LLDP 0x80010002 -#define NDIS_MEDIA_SPECIFIC_INFO_TIMESYNC 0x80010003 - - -#ifndef NDIS_HASH_FUNCTION_MASK -#define NDIS_HASH_FUNCTION_MASK 0x000000FF -#define NDIS_HASH_TYPE_MASK 0x00FFFF00 -#endif - -// -// The following macros are used by miniport driver and protocol driver to set and get -// the hash value, hash type and hash function. -// -VOID -FORCEINLINE -NET_BUFFER_LIST_SET_HASH_TYPE( - __in PNET_BUFFER_LIST _NBL, - __in volatile ULONG _HashType - ) -{ - (NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo) = - UlongToPtr(((PtrToUlong (NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo)) & (~NDIS_HASH_TYPE_MASK)) | ((_HashType) & (NDIS_HASH_TYPE_MASK))))); -} - -VOID -FORCEINLINE -NET_BUFFER_LIST_SET_HASH_FUNCTION( - __in PNET_BUFFER_LIST _NBL, - __in volatile ULONG _HashFunction - ) -{ - (NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo) = - UlongToPtr(((PtrToUlong(NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo)) & (~NDIS_HASH_FUNCTION_MASK)) | ((_HashFunction) & (NDIS_HASH_FUNCTION_MASK))))); -} - -#define NET_BUFFER_LIST_SET_HASH_VALUE(_NBL, _HashValue) \ - (NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashValue) = UlongToPtr(_HashValue)) - -#define NET_BUFFER_LIST_GET_HASH_TYPE(_NBL) \ - (PtrToUlong(NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo)) & (NDIS_HASH_TYPE_MASK)) - -#define NET_BUFFER_LIST_GET_HASH_FUNCTION(_NBL) \ - (PtrToUlong(NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashInfo)) & (NDIS_HASH_FUNCTION_MASK)) - -#define NET_BUFFER_LIST_GET_HASH_VALUE(_NBL) \ - (PtrToUlong(NET_BUFFER_LIST_INFO(_NBL, NetBufferListHashValue))) - -#define NdisSetNetBufferListProtocolId(_NBL,_ProtocolId) \ - *((PUCHAR)(&NET_BUFFER_LIST_INFO(_NBL, NetBufferListProtocolId))) = _ProtocolId - - -#if (NDIS_SUPPORT_NDIS620) - -// -// Per-NBL information for NetBufferListFilteringInfo. -// -typedef struct _NDIS_NET_BUFFER_LIST_FILTERING_INFO -{ - union - { - struct - { - USHORT FilterId; - USHORT QueueId; - } FilteringInfo; - PVOID Value; - }; -} NDIS_NET_BUFFER_LIST_FILTERING_INFO, *PNDIS_NET_BUFFER_LIST_FILTERING_INFO; - -#define NET_BUFFER_LIST_RECEIVE_FILTER_ID(_NBL) \ - (((PNDIS_NET_BUFFER_LIST_FILTERING_INFO)&NET_BUFFER_LIST_INFO(_NBL, NetBufferListFilteringInfo))->FilteringInfo.FilterId) - -#define NET_BUFFER_LIST_RECEIVE_QUEUE_ID(_NBL) \ - (((PNDIS_NET_BUFFER_LIST_FILTERING_INFO)&NET_BUFFER_LIST_INFO(_NBL, NetBufferListFilteringInfo))->FilteringInfo.QueueId) - - - -#endif // (NDIS_SUPPORT_NDIS620) - - -#define NdisQueryMdl(_Mdl, _VirtualAddress, _Length, _Priority) \ -{ \ - if (ARGUMENT_PRESENT(_VirtualAddress)) \ - { \ - *(PVOID *)(_VirtualAddress) = MmGetSystemAddressForMdlSafe(_Mdl, _Priority); \ - } \ - *(_Length) = MmGetMdlByteCount(_Mdl); \ -} - -#define NdisQueryMdlOffset(_Mdl, _Offset, _Length) \ -{ \ - *(_Offset) = MmGetMdlByteOffset(_Mdl); \ - *(_Length) = MmGetMdlByteCount(_Mdl); \ -} - -#define NDIS_MDL_TO_SPAN_PAGES(_Mdl) \ - (MmGetMdlByteCount(_Mdl)==0 ? \ - 1 : \ - (ADDRESS_AND_SIZE_TO_SPAN_PAGES( \ - MmGetMdlVirtualAddress(_Mdl), \ - MmGetMdlByteCount(_Mdl)))) - -#define NdisGetMdlPhysicalArraySize(_Mdl, _ArraySize) \ - (*(_ArraySize) = NDIS_MDL_TO_SPAN_PAGES(_Mdl)) - - -#define NDIS_MDL_LINKAGE(_Mdl) ((_Mdl)->Next) - -#define NdisGetNextMdl(_CurrentMdl, _NextMdl) \ -{ \ - *(_NextMdl) = (_CurrentMdl)->Next; \ -} - - -__drv_maxIRQL(DISPATCH_LEVEL) -UCHAR -NdisGetNetBufferListProtocolId( - __in PNET_BUFFER_LIST NetBufferList - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -NdisAdjustNetBufferCurrentMdl( - __in PNET_BUFFER NetBuffer - ); - - -// -// The flags that can be set at NET_BUFFER_LIST.Flags are defined below. -// -#define NBL_FLAGS_PROTOCOL_RESERVED 0xFFF00000 -#define NBL_FLAGS_MINIPORT_RESERVED 0x0000F000 -#define NBL_FLAGS_SCRATCH 0x000F0000 -#define NBL_FLAGS_NDIS_RESERVED 0x00000FFF - - -#define NBL_TEST_FLAG(_NBL, _F) (((_NBL)->Flags & (_F)) != 0) -#define NBL_SET_FLAG(_NBL, _F) ((_NBL)->Flags |= (_F)) -#define NBL_CLEAR_FLAG(_NBL, _F) ((_NBL)->Flags &= ~(_F)) - -#define NBL_SET_PROTOCOL_RSVD_FLAG(_NBL, _F) ((_NBL)->Flags |= ((_F) & NBL_FLAGS_PROTOCOL_RESERVED)) -#define NBL_CLEAR_PROTOCOL_RSVD_FLAG(_NBL, _F) ((_NBL)->Flags &= ~((_F) & NBL_FLAGS_PROTOCOL_RESERVED)) -#define NBL_TEST_PROTOCOL_RSVD_FLAG(_NBL, _F) (((_NBL)->Flags & ((_F) & NBL_FLAGS_PROTOCOL_RESERVED)) != 0) - - -// -// Define some flags for protocols' own use -// -#define NBL_PROT_RSVD_FLAGS NBL_FLAGS_PROTOCOL_RESERVED -#define NBL_SET_PROT_RSVD_FLAG(_NBL, _F) NBL_SET_PROTOCOL_RSVD_FLAG(_NBL,_F) -#define NBL_CLEAR_PROT_RSVD_FLAG(_NBL, _F) NBL_CLEAR_PROTOCOL_RSVD_FLAG(_NBL, _F) -#define NBL_TEST_PROT_RSVD_FLAG(_NBL, _F) NBL_TEST_PROTOCOL_RSVD_FLAG(_NBL, _F) - - -// -// Flags used in NBL->NblFlags -// 0x01 to 0xFF are reserved for use by NDIS -// -#define NDIS_NBL_FLAGS_SEND_READ_ONLY 0x00000001 -#define NDIS_NBL_FLAGS_RECV_READ_ONLY 0x00000002 - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_NBL_FLAGS_HD_SPLIT 0x00000100 // Data and header are split -#define NDIS_NBL_FLAGS_IS_IPV4 0x00000200 // Packet is an IPv4 packet -#define NDIS_NBL_FLAGS_IS_IPV6 0x00000400 // Packet is an IPv6 packet -#define NDIS_NBL_FLAGS_IS_TCP 0x00000800 // Packet is a TCP packet -#define NDIS_NBL_FLAGS_IS_UDP 0x00001000 // Packet is a UDP packet -#define NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_HEADER 0x00002000 // Packet is split at the beginning of upper layer protocol header -#define NDIS_NBL_FLAGS_SPLIT_AT_UPPER_LAYER_PROTOCOL_PAYLOAD 0x00004000 // Packet is split at the beginning of upper layer protocol data (TCP or UDP) -#endif // (NDIS_SUPPORT_NDIS61) - -#define NDIS_NBL_FLAGS_IS_LOOPBACK_PACKET 0x00008000 // The NBL is loopback NBL. - -#define NdisTestNblFlag(_NBL, _F) (((_NBL)->NblFlags & (_F)) != 0) -#define NdisTestNblFlags(_NBL, _F) (((_NBL)->NblFlags & (_F)) == (_F)) -#define NdisSetNblFlag(_NBL, _F) ((_NBL)->NblFlags |= (_F)) -#define NdisClearNblFlag(_NBL, _F) ((_NBL)->NblFlags &= ~(_F)) - - - -#define NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1 1 - -typedef struct _NET_BUFFER_LIST_POOL_PARAMETERS -{ - // - // Set ObjectHeader.Type to NDIS_OBJECT_TYPE_DEFAULT - // - NDIS_OBJECT_HEADER Header; - UCHAR ProtocolId; - BOOLEAN fAllocateNetBuffer; - USHORT ContextSize; - ULONG PoolTag; - ULONG DataSize; -}NET_BUFFER_LIST_POOL_PARAMETERS, *PNET_BUFFER_LIST_POOL_PARAMETERS; - -#define NDIS_SIZEOF_NET_BUFFER_LIST_POOL_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_BUFFER_LIST_POOL_PARAMETERS, DataSize) - -#define NET_BUFFER_POOL_PARAMETERS_REVISION_1 1 - -typedef struct _NET_BUFFER_POOL_PARAMETERS -{ - // - // Set ObjectHeader.Type to NDIS_OBJECT_TYPE_DEFAULT - // - NDIS_OBJECT_HEADER Header; - ULONG PoolTag; - ULONG DataSize; -}NET_BUFFER_POOL_PARAMETERS,*PNET_BUFFER_POOL_PARAMETERS; - -#define NDIS_SIZEOF_NET_BUFFER_POOL_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_BUFFER_POOL_PARAMETERS, DataSize); - -// -// Prototypes of the MDL allocation and free callback. -// - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -PMDL -(*NET_BUFFER_ALLOCATE_MDL_HANDLER)( - __inout PULONG BufferSize - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(*NET_BUFFER_FREE_MDL_HANDLER)( - __in PMDL Mdl - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisAllocateNetBufferPool( - __in_opt NDIS_HANDLE NdisHandle, - __in PNET_BUFFER_POOL_PARAMETERS Parameters - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeNetBufferPool( - __in __drv_freesMem(mem) NDIS_HANDLE PoolHandle - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER -NdisAllocateNetBuffer( - __in NDIS_HANDLE PoolHandle, - __in_opt PMDL MdlChain, - __in ULONG DataOffset, - __in SIZE_T DataLength - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeNetBuffer( - __in __drv_freesMem(mem) PNET_BUFFER NetBuffer - ); - - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER -NdisAllocateNetBufferMdlAndData( - __in NDIS_HANDLE PoolHandle - ); - - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisAllocateNetBufferListPool( - __in_opt NDIS_HANDLE NdisHandle, - __in PNET_BUFFER_LIST_POOL_PARAMETERS Parameters - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeNetBufferListPool( - __in __drv_freesMem(mem) NDIS_HANDLE PoolHandle - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER_LIST -NdisAllocateNetBufferList( - __in NDIS_HANDLE PoolHandle, - __in USHORT ContextSize, - __in USHORT ContextBackFill - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeNetBufferList( - __in __drv_freesMem(mem) PNET_BUFFER_LIST NetBufferList - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisRetreatNetBufferDataStart( - __in PNET_BUFFER NetBuffer, - __in ULONG DataOffsetDelta, - __in ULONG DataBackFill, - __in_opt NET_BUFFER_ALLOCATE_MDL_HANDLER AllocateMdlHandler - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAdvanceNetBufferDataStart( - __in PNET_BUFFER NetBuffer, - __in ULONG DataOffsetDelta, - __in BOOLEAN FreeMdl, - __in_opt NET_BUFFER_FREE_MDL_HANDLER FreeMdlHandler - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisRetreatNetBufferListDataStart( - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG DataOffsetDelta, - __in ULONG DataBackFill, - __in_opt NET_BUFFER_ALLOCATE_MDL_HANDLER AllocateMdlHandler, - __in_opt NET_BUFFER_FREE_MDL_HANDLER FreeMdlHandler - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisAdvanceNetBufferListDataStart( - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG DataOffsetDelta, - __in BOOLEAN FreeMdl, - __in_opt NET_BUFFER_FREE_MDL_HANDLER FreeMdlMdlHandler - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_when(return==0,__drv_at(NetBufferList->Context, __drv_allocatesMem(mem))) -EXPORT -NDIS_STATUS -NdisAllocateNetBufferListContext( - __in PNET_BUFFER_LIST NetBufferList, - __in USHORT ContextSize, - __in USHORT ContextBackFill, - __in ULONG PoolTag - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_at(NetBufferList->Context, __drv_freesMem(mem)) -EXPORT -VOID -NdisFreeNetBufferListContext( - __in PNET_BUFFER_LIST NetBufferList, - __in USHORT ContextSize - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER_LIST -NdisAllocateCloneNetBufferList( - __in PNET_BUFFER_LIST OriginalNetBufferList, - __in_opt NDIS_HANDLE NetBufferListPoolHandle, - __in_opt NDIS_HANDLE NetBufferPoolHandle, - __in ULONG AllocateCloneFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeCloneNetBufferList( - __in __drv_freesMem(mem) PNET_BUFFER_LIST CloneNetBufferList, - __in ULONG FreeCloneFlags - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER_LIST -NdisAllocateFragmentNetBufferList( - __in PNET_BUFFER_LIST OriginalNetBufferList, - __in_opt NDIS_HANDLE NetBufferListPool, - __in_opt NDIS_HANDLE NetBufferPool, - __in ULONG StartOffset, - __in ULONG MaximumLength, - __in ULONG DataOffsetDelta, - __in ULONG DataBackFill, - __in ULONG AllocateFragmentFlags - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeFragmentNetBufferList( - __in __drv_freesMem(mem) PNET_BUFFER_LIST FragmentNetBufferList, - __in ULONG DataOffsetDelta, - __in ULONG FreeFragmentFlags - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER_LIST -NdisAllocateReassembledNetBufferList( - __in PNET_BUFFER_LIST FagmentNetBufferList, - __in_opt NDIS_HANDLE NetBufferAndNetBufferListPoolHandle, - __in ULONG StartOffset, - __in ULONG DataOffsetDelta, - __in ULONG DataBackFill, - __in ULONG AllocateReassembleFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeReassembledNetBufferList( - __in __drv_freesMem(mem) PNET_BUFFER_LIST ReassembledNetBufferList, - __in ULONG DataOffsetDelta, - __in ULONG FreeReassembleFlags - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNET_BUFFER_LIST -NdisAllocateNetBufferAndNetBufferList( - __in NDIS_HANDLE PoolHandle, - __in USHORT ContextSize, - __in USHORT ContextBackFill, - __in_opt __drv_aliasesMem PMDL MdlChain, - __in ULONG DataOffset, - __in SIZE_T DataLength - ); - -__allocator -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PVOID -NdisGetDataBuffer( - __in PNET_BUFFER NetBuffer, - __in ULONG BytesNeeded, - __in_opt PVOID Storage, - __in UINT AlignMultiple, - __in UINT AlignOffset - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisGetPoolFromNetBufferList( - __in PNET_BUFFER_LIST NetBufferList - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisGetPoolFromNetBuffer( - __in PNET_BUFFER NetBuffer - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCopyFromNetBufferToNetBuffer( - __in PNET_BUFFER Destination, - __in ULONG DestinationOffset, - __in ULONG BytesToCopy, - __in PNET_BUFFER Source, - __in ULONG SourceOffset, - __out PULONG BytesCopied - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCopySendNetBufferListInfo( - __in PNET_BUFFER_LIST DestNetBufferList, - __in PNET_BUFFER_LIST SrcNetBufferList - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCopyReceiveNetBufferListInfo( - __in PNET_BUFFER_LIST DestNetBufferList, - __in PNET_BUFFER_LIST SrcNetBufferList - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisQueryNetBufferPhysicalCount( - __in PNET_BUFFER NetBuffer - ); - -__checkReturn -__drv_ret(__drv_allocatesMem(mem)) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PMDL -NdisAllocateMdl( - __in NDIS_HANDLE NdisHandle, - __in_bcount(Length) - PVOID VirtualAddress, - __in UINT Length - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeMdl( - __in __drv_freesMem(mem) PMDL Mdl - ); - -// -// The following flags are used in the Send APIs such as Ndis(F)SendNetBufferLists -// and MINIPORT_SEND_NET_BUFFER_LISTS_HANDLER -// -#define NDIS_SEND_FLAGS_DISPATCH_LEVEL 0x00000001 -#define NDIS_SEND_FLAGS_CHECK_FOR_LOOPBACK 0x00000002 -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SEND_FLAGS_SINGLE_QUEUE 0x00000004 -#endif - -#define NDIS_TEST_SEND_FLAG(_Flags, _Fl) (((_Flags) & (_Fl)) == (_Fl)) -#define NDIS_SET_SEND_FLAG(_Flags, _Fl) ((_Flags) |= (_Fl)) - -#define NDIS_TEST_SEND_AT_DISPATCH_LEVEL(_Flags) \ - NDIS_TEST_SEND_FLAG((_Flags), NDIS_SEND_FLAGS_DISPATCH_LEVEL) - -// -// The following flags are used in the SendComplete APIs such as -// NdisMSendNetBufferListsComplete -// -#define NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL 0x00000001 -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SEND_COMPLETE_FLAGS_SINGLE_QUEUE 0x00000002 -#endif - - -#define NDIS_TEST_SEND_COMPLETE_FLAG(_Flags, _Fl) (((_Flags) & (_Fl)) == (_Fl)) -#define NDIS_SET_SEND_COMPLETE_FLAG(_Flags, _Fl) ((_Flags) |= (_Fl)) - -#define NDIS_TEST_SEND_COMPLETE_AT_DISPATCH_LEVEL(_Flags) \ - NDIS_TEST_SEND_COMPLETE_FLAG((_Flags), NDIS_SEND_COMPLETE_FLAGS_DISPATCH_LEVEL) - -// -// The following flags are used in the IndicateReceive APIs such -// as NdisMIndicateReceiveNetBufferLists and RECEIVE_NET_BUFFER_LISTS_HANDLER -// -#define NDIS_RECEIVE_FLAGS_DISPATCH_LEVEL 0x00000001 -#define NDIS_RECEIVE_FLAGS_RESOURCES 0x00000002 -#define NDIS_RECEIVE_FLAGS_SINGLE_ETHER_TYPE 0x00000100 -#define NDIS_RECEIVE_FLAGS_SINGLE_VLAN 0x00000200 -#define NDIS_RECEIVE_FLAGS_PERFECT_FILTERED 0x00000400 -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_RECEIVE_FLAGS_SINGLE_QUEUE 0x00000800 -#define NDIS_RECEIVE_FLAGS_SHARED_MEMORY_INFO_VALID 0x00001000 -#define NDIS_RECEIVE_FLAGS_MORE_NBLS 0x00002000 -#endif - - -#define NDIS_TEST_RECEIVE_FLAG(_Flags, _Fl) (((_Flags) & (_Fl)) == (_Fl)) -#define NDIS_SET_RECEIVE_FLAG(_Flags, _Fl) ((_Flags) |= (_Fl)) - -#define NDIS_TEST_RECEIVE_AT_DISPATCH_LEVEL(_Flags) \ - NDIS_TEST_RECEIVE_FLAG((_Flags), NDIS_RECEIVE_FLAGS_DISPATCH_LEVEL) - -#define NDIS_TEST_RECEIVE_CANNOT_PEND(_Flags) \ - NDIS_TEST_RECEIVE_FLAG((_Flags), NDIS_RECEIVE_FLAGS_RESOURCES) - -#define NDIS_TEST_RECEIVE_CAN_PEND(_Flags) \ - (((_Flags) & NDIS_RECEIVE_FLAGS_RESOURCES) == 0) -// -// The following flags are used in the ReturnNetBufferLists APIs such -// as NdisReturnNetBufferLists and MINIPORT_RETURN_NET_BUFFER_LISTS -// -#define NDIS_RETURN_FLAGS_DISPATCH_LEVEL 0x00000001 -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_RETURN_FLAGS_SINGLE_QUEUE 0x00000002 -#endif - - -#define NDIS_TEST_RETURN_FLAG(_Flags, _Fl) (((_Flags) & (_Fl)) == (_Fl)) -#define NDIS_SET_RETURN_FLAG(_Flags, _Fl) ((_Flags) |= (_Fl)) - -#define NDIS_TEST_RETURN_AT_DISPATCH_LEVEL(_Flags) \ - NDIS_TEST_RETURN_FLAG((_Flags),NDIS_RETURN_FLAGS_DISPATCH_LEVEL) - - -// -// The following flags are used in the NdisAllocateCloneNetBufferList -// and NdisFreeCloneNetBufferList -// - -#define NDIS_CLONE_FLAGS_RESERVED 0x00000001 -#define NDIS_CLONE_FLAGS_USE_ORIGINAL_MDLS 0x00000002 - -#define NDIS_TEST_CLONE_FLAG(_Flags, _Fl) (((_Flags) & (_Fl)) == (_Fl)) -#define NDIS_SET_CLONE_FLAG(_Flags, _Fl) ((_Flags) |= (_Fl)) -#define NDIS_CLEAR_CLONE_FLAG(_Flags, _Fl) ((_Flags) &= ~(_Fl)) - - -#endif // (NDIS_SUPPORT_NDIS6 || NDIS60) - -#pragma warning(pop) - - -#pragma once -#pragma warning(push) - -#pragma warning(disable:4201) // (nonstandard extension used : nameless struct/union) -#pragma warning(disable:4214) // (extension used : bit field types other than int) - -#define NDIS_TASK_OFFLOAD_VERSION 1 - -#define MAX_HASHES 4 -#define TRUNCATED_HASH_LEN 12 - -#define CRYPTO_SUCCESS 0 -#define CRYPTO_GENERIC_ERROR 1 -#define CRYPTO_TRANSPORT_AH_AUTH_FAILED 2 -#define CRYPTO_TRANSPORT_ESP_AUTH_FAILED 3 -#define CRYPTO_TUNNEL_AH_AUTH_FAILED 4 -#define CRYPTO_TUNNEL_ESP_AUTH_FAILED 5 -#define CRYPTO_INVALID_PACKET_SYNTAX 6 -#define CRYPTO_INVALID_PROTOCOL 7 - -#if NDIS_LEGACY_DRIVER -typedef struct _NDIS_IPSEC_PACKET_INFO -{ - union - { - struct - { - NDIS_HANDLE OffloadHandle; - NDIS_HANDLE NextOffloadHandle; - - } Transmit; - - struct - { - ULONG SA_DELETE_REQ:1; - ULONG CRYPTO_DONE:1; - ULONG NEXT_CRYPTO_DONE:1; - ULONG CryptoStatus; - } Receive; - }; -} NDIS_IPSEC_PACKET_INFO, *PNDIS_IPSEC_PACKET_INFO; -#endif // NDIS_LEGACY_DRIVER - -#if (NDIS_SUPPORT_NDIS6 || NDIS60) -typedef struct _NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO -{ - union - { - struct - { - NDIS_HANDLE OffloadHandle; - - } Transmit; - - struct - { - USHORT SaDeleteReq:1; - USHORT CryptoDone:1; - USHORT NextCryptoDone:1; - USHORT Pad:13; - USHORT CryptoStatus; - } Receive; - }; -} NDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V1_NET_BUFFER_LIST_INFO; -#endif // (NDIS_SUPPORT_NDIS6 || NDIS60) - -#if NDIS_LEGACY_DRIVER -// -// The following defines are used in the Task field above to define -// the type of task offloading necessary. -// -typedef enum _NDIS_TASK -{ - TcpIpChecksumNdisTask, - IpSecNdisTask, - TcpLargeSendNdisTask, - MaxNdisTask -} NDIS_TASK, *PNDIS_TASK; - - -typedef enum _NDIS_ENCAPSULATION -{ - UNSPECIFIED_Encapsulation, - NULL_Encapsulation, - IEEE_802_3_Encapsulation, - IEEE_802_5_Encapsulation, - LLC_SNAP_ROUTED_Encapsulation, - LLC_SNAP_BRIDGED_Encapsulation - -} NDIS_ENCAPSULATION; - -// -// Encapsulation header format -// -typedef struct _NDIS_ENCAPSULATION_FORMAT -{ - NDIS_ENCAPSULATION Encapsulation; // Encapsulation type - struct - { - ULONG FixedHeaderSize:1; - ULONG Reserved:31; - } Flags; - - ULONG EncapsulationHeaderSize; // Encapsulation header size - -} NDIS_ENCAPSULATION_FORMAT,*PNDIS_ENCAPSULATION_FORMAT; - - -// -// OFFLOAD header structure for OID_TCP_TASK_OFFLOAD -// -typedef struct _NDIS_TASK_OFFLOAD_HEADER -{ - ULONG Version; // set to NDIS_TASK_OFFLOAD_VERSION - ULONG Size; // Size of this structure - ULONG Reserved; // Reserved for future use - ULONG OffsetFirstTask; // Offset to the first - NDIS_ENCAPSULATION_FORMAT EncapsulationFormat; // Encapsulation information. - // NDIS_TASK_OFFLOAD structure(s) - -} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER; - - -// -// Task offload Structure, which follows the above header in ndis query -// -typedef struct _NDIS_TASK_OFFLOAD -{ - ULONG Version; // NDIS_TASK_OFFLOAD_VERSION - ULONG Size; // Size of this structure. Used for version checking. - NDIS_TASK Task; // Task. - ULONG OffsetNextTask; // Offset to the next NDIS_TASK_OFFLOAD - ULONG TaskBufferLength; // Length of the task offload information. - UCHAR TaskBuffer[1]; // The task offload information. -} NDIS_TASK_OFFLOAD, *PNDIS_TASK_OFFLOAD; - -// -// Offload structure for NDIS_TASK_TCP_IP_CHECKSUM -// -typedef struct _NDIS_TASK_TCP_IP_CHECKSUM -{ - struct - { - ULONG IpOptionsSupported:1; - ULONG TcpOptionsSupported:1; - ULONG TcpChecksum:1; - ULONG UdpChecksum:1; - ULONG IpChecksum:1; - } V4Transmit; - - struct - { - ULONG IpOptionsSupported:1; - ULONG TcpOptionsSupported:1; - ULONG TcpChecksum:1; - ULONG UdpChecksum:1; - ULONG IpChecksum:1; - } V4Receive; - - - struct - { - ULONG IpOptionsSupported:1; // This field implies IpExtensionHeaders support - ULONG TcpOptionsSupported:1; - ULONG TcpChecksum:1; - ULONG UdpChecksum:1; - - } V6Transmit; - - struct - { - ULONG IpOptionsSupported:1; // This field implies IpExtensionHeaders support - ULONG TcpOptionsSupported:1; - ULONG TcpChecksum:1; - ULONG UdpChecksum:1; - - } V6Receive; - - -} NDIS_TASK_TCP_IP_CHECKSUM, *PNDIS_TASK_TCP_IP_CHECKSUM; - -// -// Off-load structure for NDIS_TASK_TCP_LARGE_SEND -// -#define NDIS_TASK_TCP_LARGE_SEND_V0 0 - -typedef struct _NDIS_TASK_TCP_LARGE_SEND -{ - ULONG Version; // set to NDIS_TASK_TCP_LARGE_SEND_V0 - ULONG MaxOffLoadSize; - ULONG MinSegmentCount; - BOOLEAN TcpOptions; - BOOLEAN IpOptions; - -} NDIS_TASK_TCP_LARGE_SEND, *PNDIS_TASK_TCP_LARGE_SEND; - - -typedef struct _NDIS_TASK_IPSEC -{ - struct - { - ULONG AH_ESP_COMBINED; - ULONG TRANSPORT_TUNNEL_COMBINED; - ULONG V4_OPTIONS; - ULONG RESERVED; - } Supported; - - struct - { - ULONG MD5:1; - ULONG SHA_1:1; - ULONG Transport:1; - ULONG Tunnel:1; - ULONG Send:1; - ULONG Receive:1; - } V4AH; - - struct - { - ULONG DES:1; - ULONG RESERVED:1; - ULONG TRIPLE_DES:1; - ULONG NULL_ESP:1; - ULONG Transport:1; - ULONG Tunnel:1; - ULONG Send:1; - ULONG Receive:1; - } V4ESP; - -} NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC; -#endif // NDIS_LEGACY_DRIVER - -// -// flags used in NDIS_TASK_IPSEC->Supprted.RESERVED and -// NDIS_IPSEC_OFFLOAD_V1->Supported.Flags -// -#define IPSEC_TPT_UDPESP_ENCAPTYPE_IKE 0x00000001 -#define IPSEC_TUN_UDPESP_ENCAPTYPE_IKE 0x00000002 -#define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_IKE 0x00000004 -#define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_IKE 0x00000008 -#define IPSEC_TPT_UDPESP_ENCAPTYPE_OTHER 0x00000010 -#define IPSEC_TUN_UDPESP_ENCAPTYPE_OTHER 0x00000020 -#define IPSEC_TPTOVERTUN_UDPESP_ENCAPTYPE_OTHER 0x00000040 -#define IPSEC_TPT_UDPESP_OVER_PURE_TUN_ENCAPTYPE_OTHER 0x00000080 - - -#if (NDIS_SUPPORT_NDIS6 || NDIS60) - -// -// The definitions for the NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO.Transmit.Type -// A miniport will use this definition to identify what offload type to use -// on the NetBufferList -// -#define NDIS_TCP_LARGE_SEND_OFFLOAD_V1_TYPE 0 -#define NDIS_TCP_LARGE_SEND_OFFLOAD_V2_TYPE 1 - -// -// IP protocol version encoded in IPVersion field of -// NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO->LsoV2Transmit.IPVersion -// -#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPv4 0 -#define NDIS_TCP_LARGE_SEND_OFFLOAD_IPv6 1 - -// -// The maximum length of the headers (MAC+IP+IP option or extension headers+TCP+TCP options) -// when stack does large send offload. If header is bigger than this value, it will not do -// LSO -// -#define NDIS_LARGE_SEND_OFFLOAD_MAX_HEADER_LENGTH 128 - -// -// This structure is used in the OOB TcpLargeSendNetBufferListInfo. -// -typedef struct _NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO -{ - union - { - struct - { - ULONG Unused:30; - ULONG Type:1; - ULONG Reserved2:1; - } Transmit; - - struct - { - ULONG MSS:20; - ULONG TcpHeaderOffset:10; - ULONG Type:1; - ULONG Reserved2:1; - } LsoV1Transmit; - - struct - { - ULONG TcpPayload:30; - ULONG Type:1; - ULONG Reserved2:1; - } LsoV1TransmitComplete; - - struct - { - ULONG MSS:20; - ULONG TcpHeaderOffset:10; - ULONG Type:1; - ULONG IPVersion:1; - } LsoV2Transmit; - - struct - { - ULONG Reserved:30; - ULONG Type:1; - ULONG Reserved2:1; - } LsoV2TransmitComplete; - - PVOID Value; - }; -} NDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO,*PNDIS_TCP_LARGE_SEND_OFFLOAD_NET_BUFFER_LIST_INFO; - - -// -// Per-NetBufferList information for TcpIpChecksumNetBufferListInfo. -// -typedef struct _NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO -{ - union - { - struct - { - ULONG IsIPv4:1; - ULONG IsIPv6:1; - ULONG TcpChecksum:1; - ULONG UdpChecksum:1; - ULONG IpHeaderChecksum:1; - ULONG Reserved:11; - ULONG TcpHeaderOffset:10; - } Transmit; - - struct - { - ULONG TcpChecksumFailed:1; - ULONG UdpChecksumFailed:1; - ULONG IpChecksumFailed:1; - ULONG TcpChecksumSucceeded:1; - ULONG UdpChecksumSucceeded:1; - ULONG IpChecksumSucceeded:1; - ULONG Loopback:1; - } Receive; - - PVOID Value; - }; -} NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO, *PNDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO; - -// -// used in NDIS_STATUS_OFFLOAD_ENCASPULATION_CHANGE status indication and -// and OID_OFFLOAD_ENCAPSULATION OID request -// -#define NDIS_OFFLOAD_ENCAPSULATION_REVISION_1 1 - -typedef struct _NDIS_OFFLOAD_ENCAPSULATION -{ - // - // Header.Type = NDIS_OBJECT_TYPE_OFFLOAD_ENCAPSULATION; - // Header.Size = sizeof(NDIS_OFFLOAD_ENCAPSULATION); - // Header.Revision = NDIS_OFFLOAD_ENCAPSULATION_REVISION_1; - // - - NDIS_OBJECT_HEADER Header; - - struct - { - // - // A Protocol sets Enable to NDIS_OFFLOAD_SET_ON if it is enabling IPv4 LSO, - // or XSum offloads - // otherwise it is set to NDIS_OFFLOAD_SET_NO_CHANGE - // - ULONG Enabled; - - // - // If Enabled is TRUE, a Protocol must set this to - // either NDIS_ENCAPSULATION_IEEE_802_3 - // or NDIS_ENCAPSULATION_IEEE_LLC_SNAP_ROUTED - // - ULONG EncapsulationType; - - // - // If Enabled is TRUE, a protocol must set this field to the - // HeaderSize it uses - // - ULONG HeaderSize; - } IPv4; - - - struct - { - // - // A Protocol sets Enable to NDIS_OFFLOAD_SET_ON if it is enabling IPv6 LSO, - // or XSum offloads - // otherwise it is set to NDIS_OFFLOAD_SET_NO_CHANGE - // - ULONG Enabled; - // - // If Enabled is TRUE, a Protocol must set this to - // either NDIS_ENCAPSULATION_IEEE_802_3 - // or NDIS_ENCAPSULATION_IEEE_LLC_SNAP_ROUTED - // - ULONG EncapsulationType; - - // - // If Enabled is TRUE, a protocol must set this field to the - // HeaderSize it uses - // - ULONG HeaderSize; - } IPv6; - -}NDIS_OFFLOAD_ENCAPSULATION, *PNDIS_OFFLOAD_ENCAPSULATION; - -#define NDIS_SIZEOF_OFFLOAD_ENCAPSULATION_REVISION_1 RTL_SIZEOF_THROUGH_FIELD(NDIS_OFFLOAD_ENCAPSULATION, IPv6.HeaderSize) - -#if (NDIS_SUPPORT_NDIS61) -// -// Per-NetBufferList information for IPsecOffloadV2NetBufferListInfo. -// -typedef struct _NDIS_IPSEC_OFFLOAD_V2_NET_BUFFER_LIST_INFO -{ - union - { - struct - { - PVOID OffloadHandle; - } Transmit; - - struct - { - ULONG SaDeleteReq:1; - ULONG CryptoDone:1; - ULONG NextCryptoDone:1; // Required for transport over tunnel - ULONG Reserved:13; - ULONG CryptoStatus:16; - } Receive; - }; -} NDIS_IPSEC_OFFLOAD_V2_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V2_NET_BUFFER_LIST_INFO; - -// -// Per-NetBufferList information for IPsecOffloadV2TunnelNetBufferListInfo. -// -typedef struct _NDIS_IPSEC_OFFLOAD_V2_TUNNEL_NET_BUFFER_LIST_INFO -{ - struct - { - NDIS_HANDLE TunnelHandle; // Tunnel SA handle in Transport over tunnel - } Transmit; -} NDIS_IPSEC_OFFLOAD_V2_TUNNEL_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V2_TUNNEL_NET_BUFFER_LIST_INFO; - -// -// Per-NetBufferList information for IPsecOffloadV2HeaderNetBufferListInfo. -// -typedef struct _NDIS_IPSEC_OFFLOAD_V2_HEADER_NET_BUFFER_LIST_INFO -{ - union - { - struct - { - ULONG NextHeader:8; // Next Header value is the one carried in ESP trailer - ULONG PadLength:8; - ULONG AhHeaderOffset:8; // This is offset from beginning of IP Header and is measured in 4 byte increments - ULONG EspHeaderOffset:8; // This is offset from beginning of IP Header and is measured in 4 byte increments - } Transmit; - - struct - { - ULONG NextHeader:8; - ULONG PadLength:8; - ULONG HeaderInfoSet:1; - } Receive; - }; -} NDIS_IPSEC_OFFLOAD_V2_HEADER_NET_BUFFER_LIST_INFO, *PNDIS_IPSEC_OFFLOAD_V2_HEADER_NET_BUFFER_LIST_INFO; - -// -// Used in IPSEC_OFFLOAD_V2_ADD_SA.SecAssoc -// -#define IPSEC_OFFLOAD_V2_MAX_EXTENSION_HEADERS 2 - -// -// used in IPSEC_OFFLOAD_V2_ADD_SA.UdpEspEncapsulation and -// NDIS_IPSEC_OFFLOAD_V2.UdpEsp -// -#define IPSEC_OFFLOAD_V2_UDP_ESP_ENCAPSULATION_NONE 0x00000000 -#define IPSEC_OFFLOAD_V2_UDP_ESP_ENCAPSULATION_TRANSPORT 0x00000001 -#define IPSEC_OFFLOAD_V2_UDP_ESP_ENCAPSULATION_TUNNEL 0x00000002 -#define IPSEC_OFFLOAD_V2_TRANSPORT_OVER_UDP_ESP_ENCAPSULATION_TUNNEL 0x00000004 -#define IPSEC_OFFLOAD_V2_UDP_ESP_ENCAPSULATION_TRANSPORT_OVER_TUNNEL 0x00000008 - -// -// used in IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION.Flags -// -#define IPSEC_OFFLOAD_V2_ESN_SA 0x00000001 - -// -// used in IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION.Operation -// -typedef enum _IPSEC_OFFLOAD_V2_OPERATION -{ - IPsecOffloadV2Ah = 1, - IPsecOffloadV2Esp, - IPsecOffloadV2Max -} IPSEC_OFFLOAD_V2_OPERATION, *PIPSEC_OFFLOAD_V2_OPERATION; - -// -// used in IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION.Spi -// -typedef ULONG IPSEC_OFFLOAD_V2_SPI_TYPE; - -// -// used in AuthenticationAlgorithm and EncryptionAlgorithm fields -// of IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION structure -// -typedef struct _IPSEC_OFFLOAD_V2_ALGORITHM_INFO -{ - ULONG Identifier; - ULONG KeyLength; - ULONG KeyOffsetBytes; - ULONG AdditionalInfo; -} IPSEC_OFFLOAD_V2_ALGORITHM_INFO, *PIPSEC_OFFLOAD_V2_ALGORITHM_INFO; - -// -// used in IPSEC_OFFLOAD_V2_ADD_SA.SecAssoc -// -typedef struct _IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION -{ - ULONG Flags; - IPSEC_OFFLOAD_V2_OPERATION Operation; // AH - SA is used for AH, ESP - SA is used for ESP - IPSEC_OFFLOAD_V2_SPI_TYPE Spi; - IPSEC_OFFLOAD_V2_ALGORITHM_INFO AuthenticationAlgorithm; - IPSEC_OFFLOAD_V2_ALGORITHM_INFO EncryptionAlgorithm; - ULONG SequenceNumberHighOrder; -} IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION, *PIPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION; - -// -// used in IPSEC_OFFLOAD_V2_ADD_SA.Flags -// -#define IPSEC_OFFLOAD_V2_INBOUND 0x00000001 -#define IPSEC_OFFLOAD_V2_IPv6 0x00000010 - -// -// used in OID_TCP_TASK_IPSEC_OFFLOAD_V2_ADD_SA -// -typedef struct _IPSEC_OFFLOAD_V2_ADD_SA IPSEC_OFFLOAD_V2_ADD_SA, *PIPSEC_OFFLOAD_V2_ADD_SA; - -#define NDIS_IPSEC_OFFLOAD_V2_ADD_SA_REVISION_1 1 - -typedef struct _IPSEC_OFFLOAD_V2_ADD_SA -{ - // - // Header.Type = NDIS_OBJECT_TYPE_DEFAULT; - // Header.Revision = NDIS_IPSEC_OFFLOAD_V2_ADD_SA_REVISION_1; - // Header.Size = sizeof(IPSEC_OFFLOAD_V2_ADD_SA); - // - NDIS_OBJECT_HEADER Header; - PIPSEC_OFFLOAD_V2_ADD_SA Next; - ULONG NumExtHdrs; - ULONG Flags; - - union - { - struct - { - IPAddr SrcAddr; - IPAddr DestAddr; - } IPv4Endpoints; - - struct - { - UCHAR SrcAddr[16]; - UCHAR DestAddr[16]; - } IPv6Endpoints; - }; - - NDIS_HANDLE OffloadHandle; - ULONG UdpEspEncapsulation; - IPSEC_OFFLOAD_V2_SECURITY_ASSOCIATION SecAssoc[IPSEC_OFFLOAD_V2_MAX_EXTENSION_HEADERS]; - ULONG KeyLength; - UCHAR KeyData[1]; -} IPSEC_OFFLOAD_V2_ADD_SA, *PIPSEC_OFFLOAD_V2_ADD_SA; - -#define NDIS_SIZEOF_IPSEC_OFFLOAD_V2_ADD_SA_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(IPSEC_OFFLOAD_V2_ADD_SA, KeyData) - -// -// used in OID_TCP_TASK_IPSEC_OFFLOAD_V2_DELETE_SA -// -typedef struct _IPSEC_OFFLOAD_V2_DELETE_SA IPSEC_OFFLOAD_V2_DELETE_SA, *PIPSEC_OFFLOAD_V2_DELETE_SA; - -#define NDIS_IPSEC_OFFLOAD_V2_DELETE_SA_REVISION_1 1 - -typedef struct _IPSEC_OFFLOAD_V2_DELETE_SA -{ - // - // Header.Type = NDIS_OBJECT_TYPE_DEFAULT; - // Header.Revision = NDIS_IPSEC_OFFLOAD_V2_DELETE_SA_REVISION_1; - // Header.Size = sizeof(IPSEC_OFFLOAD_V2_DELETE_SA); - // - NDIS_OBJECT_HEADER Header; - PIPSEC_OFFLOAD_V2_DELETE_SA Next; - NDIS_HANDLE OffloadHandle; -} IPSEC_OFFLOAD_V2_DELETE_SA, *PIPSEC_OFFLOAD_V2_DELETE_SA; - -#define NDIS_SIZEOF_IPSEC_OFFLOAD_V2_DELETE_SA_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(IPSEC_OFFLOAD_V2_DELETE_SA, OffloadHandle) - -// -// Structure and defines used in -// OID_TCP_TASK_IPSEC_OFFLOAD_V2_UPDATE_SA -// - -#define NDIS_IPSEC_OFFLOAD_V2_UPDATE_SA_REVISION_1 1 - -typedef struct _IPSEC_OFFLOAD_V2_UPDATE_SA -{ - // - // Header.Type = NDIS_OBJECT_TYPE_DEFAULT; - // Header.Revision = NDIS_IPSEC_OFFLOAD_V2_UPDATE_SA_REVISION_1; - // Header.Size = sizeof(IPSEC_OFFLOAD_V2_UPDATE_SA); - // - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE OffloadHandle; - IPSEC_OFFLOAD_V2_OPERATION Operation; - IPSEC_OFFLOAD_V2_SPI_TYPE Spi; - ULONG SequenceNumberHighOrder; -} IPSEC_OFFLOAD_V2_UPDATE_SA, *PIPSEC_OFFLOAD_V2_UPDATE_SA; - -#define NDIS_SIZEOF_IPSEC_OFFLOAD_V2_UPDATE_SA_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(IPSEC_OFFLOAD_V2_UPDATE_SA, SequenceNumberHighOrder) - -#endif // (NDIS_SUPPORT_NDIS61) - -#endif // (NDIS_SUPPORT_NDIS6 || NDIS60) - -#pragma warning(pop) - - - -#pragma once - -#if NDIS_LEGACY_PROTOCOL - -// -// Function types for NDIS_PROTOCOL_CHARACTERISTICS -// - -typedef -VOID -(*OPEN_ADAPTER_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_STATUS Status, - __in NDIS_STATUS OpenErrorStatus - ); - -typedef -VOID -(*CLOSE_ADAPTER_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*RESET_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*REQUEST_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_REQUEST NdisRequest, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*STATUS_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_STATUS GeneralStatus, - __in PVOID StatusBuffer, - __in UINT StatusBufferSize - ); - -typedef -VOID -(*STATUS_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext - ); - -typedef -VOID -(*SEND_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_PACKET Packet, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*WAN_SEND_COMPLETE_HANDLER) ( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_WAN_PACKET Packet, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*TRANSFER_DATA_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_PACKET Packet, - __in NDIS_STATUS Status, - __in UINT BytesTransferred - ); - -typedef -VOID -(*WAN_TRANSFER_DATA_COMPLETE_HANDLER)( - VOID - ); - -typedef -NDIS_STATUS -(*RECEIVE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_HANDLE MacReceiveContext, - __in PVOID HeaderBuffer, - __in UINT HeaderBufferSize, - __in PVOID LookAheadBuffer, - __in UINT LookaheadBufferSize, - __in UINT PacketSize - ); - -typedef -NDIS_STATUS -(*WAN_RECEIVE_HANDLER)( - __in NDIS_HANDLE NdisLinkHandle, - __in PUCHAR Packet, - __in ULONG PacketSize - ); - -typedef -VOID -(*RECEIVE_COMPLETE_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext - ); - -// -// Function types extensions for NDIS 4.0 Protocols -// -typedef -INT -(*RECEIVE_PACKET_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_PACKET Packet - ); - -typedef -VOID -(*BIND_HANDLER)( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE BindContext, - __in PNDIS_STRING DeviceName, - __in PVOID SystemSpecific1, - __in PVOID SystemSpecific2 - ); - -typedef -VOID -(*UNBIND_HANDLER)( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_HANDLE UnbindContext - ); - -typedef -NDIS_STATUS -(*PNP_EVENT_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNET_PNP_EVENT NetPnPEvent - ); - - -typedef -VOID -(*UNLOAD_PROTOCOL_HANDLER)( - VOID - ); - -// -// Protocol characteristics for NDIS 4.0 protocols -// -typedef struct _NDIS40_PROTOCOL_CHARACTERISTICS -{ - UCHAR MajorNdisVersion; - UCHAR MinorNdisVersion; - USHORT Filler; - union - { - UINT Reserved; - UINT Flags; - }; - OPEN_ADAPTER_COMPLETE_HANDLER OpenAdapterCompleteHandler; - CLOSE_ADAPTER_COMPLETE_HANDLER CloseAdapterCompleteHandler; - union - { - SEND_COMPLETE_HANDLER SendCompleteHandler; - WAN_SEND_COMPLETE_HANDLER WanSendCompleteHandler; - }; - union - { - TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; - WAN_TRANSFER_DATA_COMPLETE_HANDLER WanTransferDataCompleteHandler; - }; - - RESET_COMPLETE_HANDLER ResetCompleteHandler; - REQUEST_COMPLETE_HANDLER RequestCompleteHandler; - union - { - RECEIVE_HANDLER ReceiveHandler; - WAN_RECEIVE_HANDLER WanReceiveHandler; - }; - RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; - STATUS_HANDLER StatusHandler; - STATUS_COMPLETE_HANDLER StatusCompleteHandler; - NDIS_STRING Name; - - // - // Start of NDIS 4.0 extensions. - // - RECEIVE_PACKET_HANDLER ReceivePacketHandler; - - // - // PnP protocol entry-points - // - BIND_HANDLER BindAdapterHandler; - UNBIND_HANDLER UnbindAdapterHandler; - PNP_EVENT_HANDLER PnPEventHandler; - UNLOAD_PROTOCOL_HANDLER UnloadHandler; - -} NDIS40_PROTOCOL_CHARACTERISTICS; - -#endif - -#if NDIS_LEGACY_DRIVER - -// -// NDIS 5.0 co-NDIS Protocol handler proto-types - used by clients as well as call manager modules -// -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(*CO_SEND_COMPLETE_HANDLER)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolVcContext, - __in PNDIS_PACKET Packet - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(*CO_STATUS_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in_opt NDIS_HANDLE ProtocolVcContext, - __in NDIS_STATUS GeneralStatus, - __in PVOID StatusBuffer, - __in UINT StatusBufferSize - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -UINT -(*CO_RECEIVE_PACKET_HANDLER)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_HANDLE ProtocolVcContext, - __in PNDIS_PACKET Packet - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(*CO_REQUEST_HANDLER)( - __in NDIS_HANDLE ProtocolAfContext, - __in_opt NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE ProtocolPartyContext, - __inout PNDIS_REQUEST NdisRequest - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(*CO_REQUEST_COMPLETE_HANDLER)( - __in NDIS_STATUS Status, - __in_opt NDIS_HANDLE ProtocolAfContext, - __in_opt NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE ProtocolPartyContext, - __in PNDIS_REQUEST NdisRequest - ); - -#endif // NDIS_LEGACY_DRIVER - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CO_OID_REQUEST)( - __in NDIS_HANDLE ProtocolAfContext, - __in_opt NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE ProtocolPartyContext, - __inout PNDIS_OID_REQUEST OidRequest - ); - -typedef PROTOCOL_CO_OID_REQUEST (*CO_OID_REQUEST_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CO_OID_REQUEST_COMPLETE)( - __in_opt NDIS_HANDLE ProtocolAfContext, - __in_opt NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE ProtocolPartyContext, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_CO_OID_REQUEST_COMPLETE (*CO_OID_REQUEST_COMPLETE_HANDLER); - -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -// -// CO_CREATE_VC_HANDLER and CO_DELETE_VC_HANDLER are synchronous calls -// the following APIs are used by NDIS 6 protocols as well as NDIS 5 protocols -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CO_CREATE_VC)( - __in NDIS_HANDLE ProtocolAfContext, - __in NDIS_HANDLE NdisVcHandle, - __out PNDIS_HANDLE ProtocolVcContext - ); - -typedef PROTOCOL_CO_CREATE_VC (*CO_CREATE_VC_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CO_DELETE_VC)( - __in NDIS_HANDLE ProtocolVcContext - ); - -typedef PROTOCOL_CO_DELETE_VC (*CO_DELETE_VC_HANDLER); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(PROTCOL_CO_AF_REGISTER_NOTIFY)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PCO_ADDRESS_FAMILY AddressFamily - ); -typedef PROTCOL_CO_AF_REGISTER_NOTIFY (*CO_AF_REGISTER_NOTIFY_HANDLER); - -#if NDIS_LEGACY_PROTOCOL - -typedef struct _NDIS50_PROTOCOL_CHARACTERISTICS -{ -#ifdef __cplusplus - NDIS40_PROTOCOL_CHARACTERISTICS Ndis40Chars; -#else - NDIS40_PROTOCOL_CHARACTERISTICS; -#endif - - // - // Placeholders for protocol extensions for PnP/PM etc. - // - PVOID ReservedHandlers[4]; - - // - // Start of NDIS 5.0 extensions. - // - - CO_SEND_COMPLETE_HANDLER CoSendCompleteHandler; - CO_STATUS_HANDLER CoStatusHandler; - CO_RECEIVE_PACKET_HANDLER CoReceivePacketHandler; - CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler; - -} NDIS50_PROTOCOL_CHARACTERISTICS; - -#endif // NDIS_LEGACY_PROTOCOL - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -// -// CONDIS 6.0 protocol's entry points -// - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CO_RECEIVE_NET_BUFFER_LISTS)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_HANDLE ProtocolVcContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG NumberOfNetBufferLists, - __in ULONG ReceiveFlags - ); - -typedef PROTOCOL_CO_RECEIVE_NET_BUFFER_LISTS (*CO_RECEIVE_NET_BUFFER_LISTS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CO_SEND_NET_BUFFER_LISTS_COMPLETE)( - __in NDIS_HANDLE ProtocolVcContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG SendCompleteFlags - ); - -typedef PROTOCOL_CO_SEND_NET_BUFFER_LISTS_COMPLETE (*CO_SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CO_STATUS_EX)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_HANDLE ProtocolVcContext, - __in PNDIS_STATUS_INDICATION StatusIndication - ); - -typedef PROTOCOL_CO_STATUS_EX (*CO_STATUS_HANDLER_EX); - -// -// CoNDIS 6 Client handler -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CL_NOTIFY_CLOSE_AF)( - __in NDIS_HANDLE ClientAfContext - ); - -typedef PROTOCOL_CL_NOTIFY_CLOSE_AF (*CL_NOTIFY_CLOSE_AF_HANDLER); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(PROTOCOL_CL_OPEN_AF_COMPLETE_EX)( - __in NDIS_HANDLE ProtocolAfContext, - __in NDIS_HANDLE NdisAfHandle, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_CL_OPEN_AF_COMPLETE_EX (*CL_OPEN_AF_COMPLETE_HANDLER_EX); - -// -// CoNDIS 6 Call manager handler -// - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CM_NOTIFY_CLOSE_AF_COMPLETE)( - __in NDIS_HANDLE CallMgrAfContext, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_CM_NOTIFY_CLOSE_AF_COMPLETE (*CM_NOTIFY_CLOSE_AF_COMPLETE_HANDLER); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisDeregisterProtocolDriver( - __in NDIS_HANDLE NdisProtocolHandle - ); - - -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - - -#if NDIS_LEGACY_PROTOCOL - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisDeregisterProtocol( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE NdisProtocolHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisOpenAdapter( - __out __checkReturn PNDIS_STATUS Status, - __out PNDIS_STATUS OpenErrorStatus, - __out PNDIS_HANDLE NdisBindingHandle, - __out PUINT SelectedMediumIndex, - __in PNDIS_MEDIUM MediumArray, - __in UINT MediumArraySize, - __in NDIS_HANDLE NdisProtocolHandle, - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_STRING AdapterName, - __in UINT OpenOptions, - __in_opt PSTRING AddressingInformation - ); - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCloseAdapter( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE NdisBindingHandle - ); - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCompleteBindAdapter( - __in NDIS_HANDLE BindAdapterContext, - __in NDIS_STATUS Status, - __in NDIS_STATUS OpenStatus - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCompleteUnbindAdapter( - __in NDIS_HANDLE UnbindAdapterContext, - __in NDIS_STATUS Status - ); - -EXPORT -VOID -NdisSetProtocolFilter( - __out __checkReturn - PNDIS_STATUS Status, - __in NDIS_HANDLE NdisBindingHandle, - __in RECEIVE_HANDLER ReceiveHandler, - __in RECEIVE_PACKET_HANDLER ReceivePacketHandler, - __in NDIS_MEDIUM Medium, - __in UINT Offset, - __in UINT Size, - __in PUCHAR Pattern - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisGetDriverHandle( - __in NDIS_HANDLE NdisBindingHandle, - __out PNDIS_HANDLE NdisDriverHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisOpenProtocolConfiguration( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE ConfigurationHandle, - __in PNDIS_STRING ProtocolSection - ); - -#endif // NDIS_LEGACY_PROTOCOL - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisReEnumerateProtocolBindings( - __in NDIS_HANDLE NdisProtocolHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisWriteEventLogEntry( - __in __drv_isObjectPointer - PVOID LogHandle, - __in NDIS_STATUS EventCode, - __in ULONG UniqueEventValue, - __in USHORT NumStrings, - __in_opt PVOID StringsList, - __in ULONG DataSize, - __in_bcount_opt(DataSize) - PVOID Data - ); - -#if NDIS_LEGACY_PROTOCOL - -// -// The following routine is used by transports to complete pending -// network PnP events. -// -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCompletePnPEvent( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisBindingHandle, - __in PNET_PNP_EVENT NetPnPEvent - ); - -#endif // NDIS_LEGACY_PROTOCOL - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisCompleteNetPnPEvent( - __in NDIS_HANDLE NdisBindingHandle, - __in PNET_PNP_EVENT_NOTIFICATION NetPnPEventNotification, - __in NDIS_STATUS Status - ); -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -// -// The following routine is used by a transport to query the localized -// friendly instance name of the adapter that they are bound to. There -// are two variations of this, one uses the binding handle and the other -// the binding context. Some transports need this before they bind - like -// TCP/IP for instance. -// - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisQueryAdapterInstanceName( - __out PNDIS_STRING pAdapterInstanceName, - __in NDIS_HANDLE NdisBindingHandle - ); - -__checkReturn -EXPORT -NDIS_STATUS -NdisQueryBindInstanceName( - __out PNDIS_STRING pAdapterInstanceName, - __in NDIS_HANDLE BindingContext - ); - -// -// The following is used by TDI/NDIS interface as part of Network PnP. -// For use by TDI alone. -// -typedef -NTSTATUS -(*TDI_REGISTER_CALLBACK)( - __in PUNICODE_STRING DeviceName, - __out HANDLE * TdiHandle - ); - -typedef -NTSTATUS -(*TDI_PNP_HANDLER)( - __in PUNICODE_STRING UpperComponent, - __in PUNICODE_STRING LowerComponent, - __in PUNICODE_STRING BindList, - __in PVOID ReconfigBuffer, - __in UINT ReconfigBufferSize, - __in UINT Operation - ); - -EXPORT -VOID -NdisRegisterTdiCallBack( - __in TDI_REGISTER_CALLBACK RegisterCallback, - __in TDI_PNP_HANDLER PnPHandler - ); - -EXPORT -VOID -NdisDeregisterTdiCallBack( - VOID - ); - -#if NDIS_LEGACY_PROTOCOL - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -NdisReset( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE NdisBindingHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -NdisRequest( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE NdisBindingHandle, - __in PNDIS_REQUEST NdisRequest - ); - -#ifdef __cplusplus - -#define NdisSend(Status, NdisBindingHandle, Packet) \ -{ \ - *(Status) = \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.SendHandler)( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.BindingHandle, \ - (Packet)); \ -} - -#define NdisSendPackets(NdisBindingHandle, PacketArray, NumberOfPackets) \ -{ \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.SendPacketsHandler)( \ - (PNDIS_OPEN_BLOCK)(NdisBindingHandle), \ - (PacketArray), \ - (NumberOfPackets)); \ -} - - -#define NdisTransferData(Status, \ - NdisBindingHandle, \ - MacReceiveContext, \ - ByteOffset, \ - BytesToTransfer, \ - Packet, \ - BytesTransferred) \ -{ \ - *(Status) = \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.TransferDataHandler)( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.BindingHandle, \ - (MacReceiveContext), \ - (ByteOffset), \ - (BytesToTransfer), \ - (Packet), \ - (BytesTransferred)); \ -} - -#else - -#define NdisSend(Status, NdisBindingHandle, Packet) \ -{ \ - *(Status) = \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->SendHandler)( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->BindingHandle, \ - (Packet)); \ -} - - -#define NdisSendPackets(NdisBindingHandle, PacketArray, NumberOfPackets) \ -{ \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->SendPacketsHandler)( \ - (PNDIS_OPEN_BLOCK)(NdisBindingHandle), \ - (PacketArray), \ - (NumberOfPackets)); \ -} - -#define NdisTransferData(Status, \ - NdisBindingHandle, \ - MacReceiveContext, \ - ByteOffset, \ - BytesToTransfer, \ - Packet, \ - BytesTransferred) \ -{ \ - *(Status) = \ - (((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->TransferDataHandler)( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->BindingHandle, \ - (MacReceiveContext), \ - (ByteOffset), \ - (BytesToTransfer), \ - (Packet), \ - (BytesTransferred)); \ -} - -#endif // ifdef __cplusplus -#endif // NDIS_LEGACY_PROTOCOL - -#if NDIS_LEGACY_PROTOCOL -// -// Routines to access packet flags -// - -/*++ - -VOID -NdisSetSendFlags( - IN PNDIS_PACKET Packet, - IN UINT Flags - ); - ---*/ - -#define NdisSetSendFlags(_Packet,_Flags) (_Packet)->Private.Flags = (_Flags) - -/*++ - -VOID -NdisQuerySendFlags( - IN PNDIS_PACKET Packet, - OUT PUINT Flags - ); - ---*/ - -#define NdisQuerySendFlags(_Packet,_Flags) *(_Flags) = (_Packet)->Private.Flags - -#endif // NDIS_LEGACY_PROTOCOL - -#if NDIS_LEGACY_DRIVER -// -// The following is the minimum size of packets a miniport must allocate -// when it indicates packets via NdisMIndicatePacket or NdisMCoIndicatePacket -// -#define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID)) -#endif // NDIS_LEGACY_DRIVER - - -#ifdef __cplusplus -#define WanMiniportSend(Status, \ - NdisBindingHandle, \ - NdisLinkHandle, \ - WanPacket) \ -{ \ - *(Status) = \ - ((((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.WanSendHandler))( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->NdisCommonOpenBlock.BindingHandle, \ - (NdisLinkHandle), \ - (PNDIS_PACKET)(WanPacket)); \ -} - -#else -#define WanMiniportSend(Status, \ - NdisBindingHandle, \ - NdisLinkHandle, \ - WanPacket) \ -{ \ - *(Status) = \ - ((((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->WanSendHandler))( \ - ((PNDIS_OPEN_BLOCK)(NdisBindingHandle))->BindingHandle, \ - (NdisLinkHandle), \ - (PNDIS_PACKET)(WanPacket)); \ -} - -#endif - - -#if NDIS_LEGACY_PROTOCOL - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisReturnPackets( - __in PNDIS_PACKET * PacketsToReturn, - __in UINT NumberOfPackets - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -PNDIS_PACKET -NdisGetReceivedPacket( - __in NDIS_HANDLE NdisBindingHandle, - __in NDIS_HANDLE MacContext - ); - -#endif // NDIS_LEGACY_PROTOCOL - -// -// Macros to portably manipulate NDIS buffers. -// - -#define NdisBufferLength(Buffer) MmGetMdlByteCount(Buffer) -#define NdisBufferVirtualAddress(_Buffer) MmGetSystemAddressForMdl(_Buffer) -#define NdisBufferVirtualAddressSafe(_Buffer, _Priority) MmGetSystemAddressForMdlSafe(_Buffer, _Priority) - - - -#if NDIS_LEGACY_PROTOCOL - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCancelSendPackets( - __in NDIS_HANDLE NdisBindingHandle, - __in __drv_isObjectPointer - PVOID CancelId - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisQueryPendingIOCount( - __in __drv_isObjectPointer - PVOID NdisBindingHandle, - __out PULONG IoCount - ); - -#endif // NDIS_LEGACY_PROTOCOL - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -UCHAR -NdisGeneratePartialCancelId( - VOID - ); - - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -// -// NDIS 6.0 protocol's entry points -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_OID_REQUEST_COMPLETE)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_OID_REQUEST_COMPLETE (*OID_REQUEST_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_RECEIVE_NET_BUFFER_LISTS)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG NumberOfNetBufferLists, - __in ULONG ReceiveFlags - ); - -typedef PROTOCOL_RECEIVE_NET_BUFFER_LISTS (*RECEIVE_NET_BUFFER_LISTS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG SendCompleteFlags - ); - -typedef PROTOCOL_SEND_NET_BUFFER_LISTS_COMPLETE (*SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER); - -#if (NDIS_SUPPORT_NDIS61) -// -// NDIS 6.1 protocol's entry points -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_DIRECT_OID_REQUEST_COMPLETE)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_DIRECT_OID_REQUEST_COMPLETE (*DIRECT_OID_REQUEST_COMPLETE_HANDLER); - -#endif // (NDIS_SUPPORT_NDIS61) - -// -// structure passed to protocol's BIND_HANDLER_EX -// -#define NDIS_BIND_PARAMETERS_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_BIND_PARAMETERS_REVISION_2 2 -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_BIND_PARAMETERS_REVISION_3 3 -#endif // (NDIS_SUPPORT_NDIS620) - - -typedef struct _NDIS_BIND_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - PNDIS_STRING ProtocolSection; - PNDIS_STRING AdapterName; - PDEVICE_OBJECT PhysicalDeviceObject; - NDIS_MEDIUM MediaType; - ULONG MtuSize; - ULONG64 MaxXmitLinkSpeed; - ULONG64 XmitLinkSpeed; - ULONG64 MaxRcvLinkSpeed; - ULONG64 RcvLinkSpeed; - NDIS_MEDIA_CONNECT_STATE MediaConnectState; - NDIS_MEDIA_DUPLEX_STATE MediaDuplexState; - ULONG LookaheadSize; - PNDIS_PNP_CAPABILITIES PowerManagementCapabilities; // 6.20 drivers must use PowerManagementCapabilitiesEx - ULONG SupportedPacketFilters; - ULONG MaxMulticastListSize; - USHORT MacAddressLength; - UCHAR CurrentMacAddress[NDIS_MAX_PHYS_ADDRESS_LENGTH]; - NDIS_PHYSICAL_MEDIUM PhysicalMediumType; - PNDIS_RECEIVE_SCALE_CAPABILITIES RcvScaleCapabilities; - NET_LUID BoundIfNetluid; - NET_IFINDEX BoundIfIndex; - NET_LUID LowestIfNetluid; - NET_IFINDEX LowestIfIndex; - NET_IF_ACCESS_TYPE AccessType; // NET_IF_ACCESS_BROADCAST for a typical ethernet adapter - NET_IF_DIRECTION_TYPE DirectionType; // NET_IF_DIRECTION_SENDRECEIVE for a typical ethernet adapter - NET_IF_CONNECTION_TYPE ConnectionType; // NET_IF_CONNECTION_DEDICATED for a typical ethernet adapter - NET_IFTYPE IfType; // IF_TYPE_ETHERNET_CSMACD for a typical ethernet adapter (regardless of speed) - BOOLEAN IfConnectorPresent; // RFC 2665 TRUE if physical adapter - PNDIS_PORT ActivePorts; - ULONG DataBackFillSize; - ULONG ContextBackFillSize; - ULONG MacOptions; - NET_IF_COMPARTMENT_ID CompartmentId; - PNDIS_OFFLOAD DefaultOffloadConfiguration; - PNDIS_TCP_CONNECTION_OFFLOAD TcpConnectionOffloadCapabilities; - PNDIS_STRING BoundAdapterName; -#if (NDIS_SUPPORT_NDIS61) - PNDIS_HD_SPLIT_CURRENT_CONFIG HDSplitCurrentConfig; -#endif // (NDIS_SUPPORT_NDIS61) -#if (NDIS_SUPPORT_NDIS620) - PNDIS_RECEIVE_FILTER_CAPABILITIES ReceiveFilterCapabilities; - PNDIS_PM_CAPABILITIES PowerManagementCapabilitiesEx; - PNDIS_NIC_SWITCH_CAPABILITIES NicSwitchCapabilities; -#endif // (NDIS_SUPPORT_NDIS620) -}NDIS_BIND_PARAMETERS, *PNDIS_BIND_PARAMETERS; - -#define NDIS_SIZEOF_BIND_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_BIND_PARAMETERS, BoundAdapterName) - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_SIZEOF_BIND_PARAMETERS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_BIND_PARAMETERS, HDSplitCurrentConfig) -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SIZEOF_BIND_PARAMETERS_REVISION_3 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_BIND_PARAMETERS, NicSwitchCapabilities) -#endif // (NDIS_SUPPORT_NDIS620) - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(PROTOCOL_BIND_ADAPTER_EX)( - __in NDIS_HANDLE ProtocolDriverContext, - __in NDIS_HANDLE BindContext, - __in PNDIS_BIND_PARAMETERS BindParameters - ); - -typedef PROTOCOL_BIND_ADAPTER_EX (*BIND_HANDLER_EX); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(PROTOCOL_UNBIND_ADAPTER_EX)( - __in NDIS_HANDLE UnbindContext, - __in NDIS_HANDLE ProtocolBindingContext - ); - -typedef PROTOCOL_UNBIND_ADAPTER_EX (*UNBIND_HANDLER_EX); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(PROTOCOL_OPEN_ADAPTER_COMPLETE_EX)( - __in NDIS_HANDLE ProtocolBindingContext, - __in NDIS_STATUS Status - ); - -typedef PROTOCOL_OPEN_ADAPTER_COMPLETE_EX (*OPEN_ADAPTER_COMPLETE_HANDLER_EX); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(PROTOCOL_CLOSE_ADAPTER_COMPLETE_EX)( - __in NDIS_HANDLE ProtocolBindingContext - ); - -typedef PROTOCOL_CLOSE_ADAPTER_COMPLETE_EX (*CLOSE_ADAPTER_COMPLETE_HANDLER_EX); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_STATUS_EX)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_STATUS_INDICATION StatusIndication - ); - -typedef PROTOCOL_STATUS_EX (*STATUS_HANDLER_EX); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(PROTOCOL_NET_PNP_EVENT)( - __in NDIS_HANDLE ProtocolBindingContext, - __in PNET_PNP_EVENT_NOTIFICATION NetPnPEventNotification - ); - -typedef PROTOCOL_NET_PNP_EVENT (*NET_PNP_EVENT_HANDLER); - -typedef -__drv_requiresIRQL(PASSIVE_LEVEL) -VOID -(PROTOCOL_UNINSTALL)( - VOID - ); -typedef PROTOCOL_UNINSTALL (*UNINSTALL_PROTOCOL_HANDLER); - - -#define NDIS_PROTOCOL_CO_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_PROTOCOL_CO_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_PROTOCOL_CO_CHARACTERISTICS - ULONG Flags; - CO_STATUS_HANDLER_EX CoStatusHandlerEx; - CO_AF_REGISTER_NOTIFY_HANDLER CoAfRegisterNotifyHandler; - CO_RECEIVE_NET_BUFFER_LISTS_HANDLER CoReceiveNetBufferListsHandler; - CO_SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER CoSendNetBufferListsCompleteHandler; -} NDIS_PROTOCOL_CO_CHARACTERISTICS, *PNDIS_PROTOCOL_CO_CHARACTERISTICS; - -#define NDIS_SIZEOF_PROTOCOL_CO_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_PROTOCOL_CO_CHARACTERISTICS, CoSendNetBufferListsCompleteHandler) - -#define NDIS_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_1 1 -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_2 2 -#endif // (NDIS_SUPPORT_NDIS61) - -typedef struct _NDIS_PROTOCOL_DRIVER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - UCHAR MajorNdisVersion; - UCHAR MinorNdisVersion; - UCHAR MajorDriverVersion; - UCHAR MinorDriverVersion; - ULONG Flags; - NDIS_STRING Name; - SET_OPTIONS_HANDLER SetOptionsHandler; - BIND_HANDLER_EX BindAdapterHandlerEx; - UNBIND_HANDLER_EX UnbindAdapterHandlerEx; - OPEN_ADAPTER_COMPLETE_HANDLER_EX OpenAdapterCompleteHandlerEx; - CLOSE_ADAPTER_COMPLETE_HANDLER_EX CloseAdapterCompleteHandlerEx; - NET_PNP_EVENT_HANDLER NetPnPEventHandler; - UNINSTALL_PROTOCOL_HANDLER UninstallHandler; - OID_REQUEST_COMPLETE_HANDLER OidRequestCompleteHandler; - STATUS_HANDLER_EX StatusHandlerEx; - RECEIVE_NET_BUFFER_LISTS_HANDLER ReceiveNetBufferListsHandler; - SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER SendNetBufferListsCompleteHandler; -#if (NDIS_SUPPORT_NDIS61) - DIRECT_OID_REQUEST_COMPLETE_HANDLER DirectOidRequestCompleteHandler; -#endif // (NDIS_SUPPORT_NDIS61) -} NDIS_PROTOCOL_DRIVER_CHARACTERISTICS, *PNDIS_PROTOCOL_DRIVER_CHARACTERISTICS; - -#define NDIS_SIZEOF_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_PROTOCOL_DRIVER_CHARACTERISTICS, SendNetBufferListsCompleteHandler) - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_SIZEOF_PROTOCOL_DRIVER_CHARACTERISTICS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_PROTOCOL_DRIVER_CHARACTERISTICS, DirectOidRequestCompleteHandler) -#endif // (NDIS_SUPPORT_NDIS61) - -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - - -#if NDIS_LEGACY_PROTOCOL - -#if (defined(NDIS50) || defined(NDIS51)) -typedef NDIS50_PROTOCOL_CHARACTERISTICS NDIS_PROTOCOL_CHARACTERISTICS; -#else -typedef NDIS40_PROTOCOL_CHARACTERISTICS NDIS_PROTOCOL_CHARACTERISTICS; -#endif - - -typedef NDIS_PROTOCOL_CHARACTERISTICS *PNDIS_PROTOCOL_CHARACTERISTICS; - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisRegisterProtocol( - __out PNDIS_STATUS Status, - __out PNDIS_HANDLE NdisProtocolHandle, - __in PNDIS_PROTOCOL_CHARACTERISTICS ProtocolCharacteristics, - __in UINT CharacteristicsLength - ); - -#endif // NDIS_LEGACY_PROTOCOL - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisRegisterProtocolDriver( - __in_opt NDIS_HANDLE ProtocolDriverContext, - __in PNDIS_PROTOCOL_DRIVER_CHARACTERISTICS ProtocolCharacteristics, - __out PNDIS_HANDLE NdisProtocolHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisSendNetBufferLists( - __in NDIS_HANDLE NdisBindingHandle, - __in __drv_aliasesMem PNET_BUFFER_LIST NetBufferLists, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG SendFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisReturnNetBufferLists( - __in NDIS_HANDLE NdisBindingHandle, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG ReturnFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCancelSendNetBufferLists( - __in NDIS_HANDLE NdisBindingHandle, - __in __drv_isObjectPointer - PVOID CancelId - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisOidRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in PNDIS_OID_REQUEST OidRequest - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCancelOidRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in __drv_isObjectPointer - PVOID RequestId - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisUnbindAdapter( - __in NDIS_HANDLE NdisBindingHandle - ); - - -// -// structure passed to NdisOpenAdapterEx -// - -#define NDIS_OPEN_PARAMETERS_REVISION_1 1 -typedef struct _NDIS_OPEN_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - PNDIS_STRING AdapterName; - PNDIS_MEDIUM MediumArray; - UINT MediumArraySize; - PUINT SelectedMediumIndex; - PNET_FRAME_TYPE FrameTypeArray; - UINT FrameTypeArraySize; -} NDIS_OPEN_PARAMETERS, *PNDIS_OPEN_PARAMETERS; - -#define NDIS_SIZEOF_OPEN_PARAMETERS_REVSION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_OPEN_PARAMETERS, FrameTypeArraySize) - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisOpenAdapterEx( - __in NDIS_HANDLE NdisProtocolHandle, - __in NDIS_HANDLE ProtocolBindingContext, - __in PNDIS_OPEN_PARAMETERS OpenParameters, - __in NDIS_HANDLE BindContext, - __out PNDIS_HANDLE NdisBindingHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCompleteBindAdapterEx( - __in NDIS_HANDLE BindAdapterContext, - __in NDIS_STATUS Status - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisCloseAdapterEx( - __in NDIS_HANDLE NdisBindingHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCompleteUnbindAdapterEx( - __in NDIS_HANDLE UnbindContext - ); - - - -#define NDIS_PROTOCOL_PAUSE_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_PROTOCOL_PAUSE_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG PauseReason; -} NDIS_PROTOCOL_PAUSE_PARAMETERS, *PNDIS_PROTOCOL_PAUSE_PARAMETERS; - -#define NDIS_SIZEOF_PROTOCOL_PAUSE_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_PROTOCOL_PAUSE_PARAMETERS, PauseReason) - - -// -// NDIS_PROTOCOL_RESTART_PARAMETERS is used in -// NetEventRestart event indication to the protocols -// -#define NDIS_PROTOCOL_RESTART_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_PROTOCOL_RESTART_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - PUCHAR FilterModuleNameBuffer; - ULONG FilterModuleNameBufferLength; - PNDIS_RESTART_ATTRIBUTES RestartAttributes; - NET_IFINDEX BoundIfIndex; - NET_LUID BoundIfNetluid; - ULONG Flags; -} NDIS_PROTOCOL_RESTART_PARAMETERS, *PNDIS_PROTOCOL_RESTART_PARAMETERS; - -#define NDIS_SIZEOF_PROTOCOL_RESTART_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_PROTOCOL_RESTART_PARAMETERS, Flags) - -#if (NDIS_SUPPORT_NDIS61) - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisDirectOidRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in PNDIS_OID_REQUEST OidRequest - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCancelDirectOidRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in __drv_isObjectPointer - PVOID RequestId - ); -#endif // (NDIS_SUPPORT_NDIS61) - -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - - -// -// needed for macros used by legacy protocols -// -#if !defined(NDIS_WRAPPER) -#if NDIS_LEGACY_PROTOCOL - typedef struct _NDIS_COMMON_OPEN_BLOCK - { - PVOID MacHandle; // needed for backward compatibility - - NDIS_HANDLE BindingHandle; - NDIS_HANDLE Reserved6; - NDIS_HANDLE Reserved7; - NDIS_HANDLE Reserved8; - - PVOID Reserved9; - NDIS_HANDLE Reserved10; - - NDIS_HANDLE Reserved11; - BOOLEAN Reserved12; - BOOLEAN Reserved2; - BOOLEAN Reserved3; - BOOLEAN Reserved4; - PVOID Reserved13; - KSPIN_LOCK Reserved5; - NDIS_HANDLE Reserved14; - - // - // These are referenced by the macros used by protocols to call. - // All of the ones referenced by the macros are internal NDIS handlers for the miniports - // - union - { - SEND_HANDLER SendHandler; - WAN_SEND_HANDLER WanSendHandler; - }; - TRANSFER_DATA_HANDLER TransferDataHandler; - - // - // These are referenced internally by NDIS - // - SEND_COMPLETE_HANDLER SendCompleteHandler; - TRANSFER_DATA_COMPLETE_HANDLER TransferDataCompleteHandler; - RECEIVE_HANDLER ReceiveHandler; - RECEIVE_COMPLETE_HANDLER ReceiveCompleteHandler; - WAN_RECEIVE_HANDLER WanReceiveHandler; - REQUEST_COMPLETE_HANDLER RequestCompleteHandler; - - // - // NDIS 4.0 extensions - // - RECEIVE_PACKET_HANDLER ReceivePacketHandler; - SEND_PACKETS_HANDLER SendPacketsHandler; - - // - // More Cached Handlers - // - RESET_HANDLER ResetHandler; - REQUEST_HANDLER RequestHandler; - RESET_COMPLETE_HANDLER ResetCompleteHandler; - STATUS_HANDLER StatusHandler; - STATUS_COMPLETE_HANDLER StatusCompleteHandler; - - }NDIS_COMMON_OPEN_BLOCK, *PNDIS_COMMON_OPEN_BLOCK; - // - // one of these per open on an adapter/protocol - // - struct _NDIS_OPEN_BLOCK - { -#ifdef __cplusplus - NDIS_COMMON_OPEN_BLOCK NdisCommonOpenBlock; -#else - NDIS_COMMON_OPEN_BLOCK; -#endif - - }; - -#endif // NDIS_LEGACY_PROTOCOL -#endif // NDIS_WRAPPER - - - - -#pragma once - -#include - -#define NDIS_M_MAX_LOOKAHEAD 526 - -#if NDIS_LEGACY_MINIPORT - -// -// Function types for NDIS_MINIPORT_CHARACTERISTICS -// - - -typedef -BOOLEAN -(*W_CHECK_FOR_HANG_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -VOID -(*W_DISABLE_INTERRUPT_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -VOID -(*W_ENABLE_INTERRUPT_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -VOID -(*W_HALT_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -VOID -(*W_HANDLE_INTERRUPT_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -NDIS_STATUS -(*W_INITIALIZE_HANDLER)( - __out PNDIS_STATUS OpenErrorStatus, - __out PUINT SelectedMediumIndex, - __in PNDIS_MEDIUM MediumArray, - __in UINT MediumArraySize, - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE WrapperConfigurationContext - ); - -typedef -VOID -(*W_ISR_HANDLER)( - __out PBOOLEAN InterruptRecognized, - __out PBOOLEAN QueueMiniportHandleInterrupt, - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -NDIS_STATUS -(*W_QUERY_INFORMATION_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_OID Oid, - __in PVOID InformationBuffer, - __in ULONG InformationBufferLength, - __out PULONG BytesWritten, - __out PULONG BytesNeeded - ); - -typedef -NDIS_STATUS -(*W_RECONFIGURE_HANDLER)( - __out PNDIS_STATUS OpenErrorStatus, - __in NDIS_HANDLE MiniportAdapterContext OPTIONAL, - __in NDIS_HANDLE WrapperConfigurationContext - ); - -typedef -NDIS_STATUS -(*W_RESET_HANDLER)( - __out PBOOLEAN AddressingReset, - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef -NDIS_STATUS -(*W_SEND_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_PACKET Packet, - __in UINT Flags - ); - -typedef -NDIS_STATUS -(*WM_SEND_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE NdisLinkHandle, - __in PNDIS_WAN_PACKET Packet - ); - -typedef -NDIS_STATUS -(*W_SET_INFORMATION_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_OID Oid, - __in PVOID InformationBuffer, - __in ULONG InformationBufferLength, - __out PULONG BytesRead, - __out PULONG BytesNeeded - ); - -typedef -NDIS_STATUS -(*W_TRANSFER_DATA_HANDLER)( - __out PNDIS_PACKET Packet, - __out PUINT BytesTransferred, - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE MiniportReceiveContext, - __in UINT ByteOffset, - __in UINT BytesToTransfer - ); - -typedef -NDIS_STATUS -(*WM_TRANSFER_DATA_HANDLER)( - VOID - ); - -// -// Definition for shutdown handler -// - -typedef -VOID -(*ADAPTER_SHUTDOWN_HANDLER) ( - __in PVOID ShutdownContext - ); - -// -// Miniport extensions for NDIS 4.0 -// -typedef -VOID -(*W_RETURN_PACKET_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_PACKET Packet - ); - -// -// NDIS 4.0 extension -// -typedef -VOID -(*W_SEND_PACKETS_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -typedef -VOID -(*W_ALLOCATE_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID VirtualAddress, - __in PNDIS_PHYSICAL_ADDRESS PhysicalAddress, - __in ULONG Length, - __in PVOID Context - ); - -#endif // NDIS_LEGACY_MINIPORT - - -// -// W_CO_CREATE_VC_HANDLER is a synchronous call -// -typedef -NDIS_STATUS -(MINIPORT_CO_CREATE_VC)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE NdisVcHandle, - __out PNDIS_HANDLE MiniportVcContext - ); - -typedef MINIPORT_CO_CREATE_VC (*W_CO_CREATE_VC_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_CO_DELETE_VC)( - __in NDIS_HANDLE MiniportVcContext - ); - -typedef MINIPORT_CO_DELETE_VC (*W_CO_DELETE_VC_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_CO_ACTIVATE_VC)( - __in NDIS_HANDLE MiniportVcContext, - __inout PCO_CALL_PARAMETERS CallParameters - ); - -typedef MINIPORT_CO_ACTIVATE_VC (*W_CO_ACTIVATE_VC_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_CO_DEACTIVATE_VC)( - __in NDIS_HANDLE MiniportVcContext - ); -typedef MINIPORT_CO_DEACTIVATE_VC (*W_CO_DEACTIVATE_VC_HANDLER); - -#if NDIS_LEGACY_MINIPORT - -typedef -VOID -(*W_CO_SEND_PACKETS_HANDLER)( - __in NDIS_HANDLE MiniportVcContext, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -typedef -NDIS_STATUS -(*W_CO_REQUEST_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE MiniportVcContext OPTIONAL, - __inout PNDIS_REQUEST NdisRequest - ); - -#endif // NDIS_LEGACY_MINIPORT - - -#if NDIS_SUPPORT_NDIS6 - -// -// CONDIS 6.0 handlers -// - -typedef -VOID -(MINIPORT_CO_SEND_NET_BUFFER_LISTS)( - __in NDIS_HANDLE MiniportVcContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG SendFlags - ); - -typedef MINIPORT_CO_SEND_NET_BUFFER_LISTS (*W_CO_SEND_NET_BUFFER_LISTS_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_CO_OID_REQUEST)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HANDLE MiniportVcContext OPTIONAL, - __inout PNDIS_OID_REQUEST NdisRequest - ); - -typedef MINIPORT_CO_OID_REQUEST (*W_CO_OID_REQUEST_HANDLER); - -#endif // NDIS_SUPPORT_NDIS6 - -typedef enum _NDIS_DEVICE_PNP_EVENT -{ - NdisDevicePnPEventQueryRemoved, - NdisDevicePnPEventRemoved, - NdisDevicePnPEventSurpriseRemoved, - NdisDevicePnPEventQueryStopped, - NdisDevicePnPEventStopped, - NdisDevicePnPEventPowerProfileChanged, -#if NDIS_SUPPORT_NDIS6 - NdisDevicePnPEventFilterListChanged, -#endif // NDIS_SUPPORT_NDIS6 - NdisDevicePnPEventMaximum -} NDIS_DEVICE_PNP_EVENT, *PNDIS_DEVICE_PNP_EVENT; - -// -// power profiles -// -typedef enum _NDIS_POWER_PROFILE -{ - NdisPowerProfileBattery, - NdisPowerProfileAcOnLine -} NDIS_POWER_PROFILE, *PNDIS_POWER_PROFILE; - -#if NDIS_LEGACY_MINIPORT - -typedef struct _NDIS50_MINIPORT_CHARACTERISTICS -{ - UCHAR MajorNdisVersion; - UCHAR MinorNdisVersion; - USHORT Filler; - UINT Reserved; - W_CHECK_FOR_HANG_HANDLER CheckForHangHandler; - W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; - W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; - W_HALT_HANDLER HaltHandler; - W_HANDLE_INTERRUPT_HANDLER HandleInterruptHandler; - W_INITIALIZE_HANDLER InitializeHandler; - W_ISR_HANDLER ISRHandler; - W_QUERY_INFORMATION_HANDLER QueryInformationHandler; - W_RECONFIGURE_HANDLER ReconfigureHandler; - W_RESET_HANDLER ResetHandler; - union - { - W_SEND_HANDLER SendHandler; - WM_SEND_HANDLER WanSendHandler; - }; - W_SET_INFORMATION_HANDLER SetInformationHandler; - union - { - W_TRANSFER_DATA_HANDLER TransferDataHandler; - WM_TRANSFER_DATA_HANDLER WanTransferDataHandler; - }; - - // - // Extensions for NDIS 4.0 - // - W_RETURN_PACKET_HANDLER ReturnPacketHandler; - W_SEND_PACKETS_HANDLER SendPacketsHandler; - W_ALLOCATE_COMPLETE_HANDLER AllocateCompleteHandler; - - // - // Extensions for NDIS 5.0 - // - W_CO_CREATE_VC_HANDLER CoCreateVcHandler; - W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; - W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; - W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; - W_CO_SEND_PACKETS_HANDLER CoSendPacketsHandler; - W_CO_REQUEST_HANDLER CoRequestHandler; -} NDIS50_MINIPORT_CHARACTERISTICS; - -#if (((NDIS_MINIPORT_MAJOR_VERSION == 5) && (NDIS_MINIPORT_MINOR_VERSION == 1)) || NDIS_WRAPPER) -// -// Miniport extensions for NDIS 5.1 -// -typedef VOID -(*W_CANCEL_SEND_PACKETS_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID CancelId - ); - -typedef VOID -(*W_PNP_EVENT_NOTIFY_HANDLER)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_DEVICE_PNP_EVENT DevicePnPEvent, - __in PVOID InformationBuffer, - __in ULONG InformationBufferLength - ); - -typedef VOID -(*W_MINIPORT_SHUTDOWN_HANDLER) ( - __in NDIS_HANDLE MiniportAdapterContext - ); - -#endif // (((NDIS_MINIPORT_MAJOR_VERSION == 5) && (NDIS_MINIPORT_MINOR_VERSION == 1)) || NDIS_WRAPPER) - -#endif // NDIS_LEGACY_MINIPORT - -#if NDIS_SUPPORT_NDIS6 -typedef -BOOLEAN -(MINIPORT_ISR)( - __in NDIS_HANDLE MiniportInterruptContext, - __out PBOOLEAN QueueDefaultInterruptDpc, - __out PULONG TargetProcessors - ); - -typedef MINIPORT_ISR (*MINIPORT_ISR_HANDLER); - -typedef -VOID -(MINIPORT_INTERRUPT_DPC)( - __in NDIS_HANDLE MiniportInterruptContext, - __in PVOID MiniportDpcContext, - __in PVOID ReceiveThrottleParameters, - __in PVOID NdisReserved2 - ); - -typedef MINIPORT_INTERRUPT_DPC (*MINIPORT_INTERRUPT_DPC_HANDLER); - -#if NDIS_SUPPORT_NDIS620 - -typedef struct _NDIS_RECEIVE_THROTTLE_PARAMETERS -{ - __in ULONG MaxNblsToIndicate; - __out ULONG MoreNblsPending:1; -} NDIS_RECEIVE_THROTTLE_PARAMETERS, *PNDIS_RECEIVE_THROTTLE_PARAMETERS; - -#define NDIS_INDICATE_ALL_NBLS (~0ul) - -#endif - - -typedef -VOID -(MINIPORT_DISABLE_INTERRUPT)( - __in NDIS_HANDLE MiniportInterruptContext - ); - -typedef MINIPORT_DISABLE_INTERRUPT (*MINIPORT_DISABLE_INTERRUPT_HANDLER); - -typedef -VOID -(MINIPORT_ENABLE_INTERRUPT)( - __in NDIS_HANDLE MiniportInterruptContext - ); - -typedef MINIPORT_ENABLE_INTERRUPT (*MINIPORT_ENABLE_INTERRUPT_HANDLER); -// -// MSI support handlers -// -typedef -BOOLEAN -(MINIPORT_MESSAGE_INTERRUPT)( - __in NDIS_HANDLE MiniportInterruptContext, - __in ULONG MessageId, - __out PBOOLEAN QueueDefaultInterruptDpc, - __out PULONG TargetProcessors - ); - -typedef MINIPORT_MESSAGE_INTERRUPT (*MINIPORT_MSI_ISR_HANDLER); - -typedef -VOID -(MINIPORT_MESSAGE_INTERRUPT_DPC)( - __in NDIS_HANDLE MiniportInterruptContext, - __in ULONG MessageId, - __in PVOID MiniportDpcContext, -#if NDIS_SUPPORT_NDIS620 - __in PVOID ReceiveThrottleParameters, - __in PVOID NdisReserved2 -#else - __in PULONG NdisReserved1, - __in PULONG NdisReserved2 -#endif - ); - -typedef MINIPORT_MESSAGE_INTERRUPT_DPC (*MINIPORT_MSI_INTERRUPT_DPC_HANDLER); - -typedef -VOID -(MINIPORT_DISABLE_MESSAGE_INTERRUPT)( - __in NDIS_HANDLE MiniportInterruptContext, - __in ULONG MessageId - ); - -typedef MINIPORT_DISABLE_MESSAGE_INTERRUPT (*MINIPORT_DISABLE_MSI_INTERRUPT_HANDLER); - -typedef -VOID -(MINIPORT_ENABLE_MESSAGE_INTERRUPT)( - __in NDIS_HANDLE MiniportInterruptContext, - __in ULONG MessageId - ); -typedef MINIPORT_ENABLE_MESSAGE_INTERRUPT (*MINIPORT_ENABLE_MSI_INTERRUPT_HANDLER); - -typedef -BOOLEAN -(MINIPORT_SYNCHRONIZE_INTERRUPT)( - __in NDIS_HANDLE SynchronizeContext - ); -typedef MINIPORT_SYNCHRONIZE_INTERRUPT (*MINIPORT_SYNCHRONIZE_INTERRUPT_HANDLER); -typedef MINIPORT_SYNCHRONIZE_INTERRUPT (MINIPORT_SYNCHRONIZE_MESSAGE_INTERRUPT); -typedef MINIPORT_SYNCHRONIZE_MESSAGE_INTERRUPT (*MINIPORT_SYNCHRONIZE_MSI_INTERRUPT_HANDLER); - -typedef enum _NDIS_INTERRUPT_TYPE -{ - NDIS_CONNECT_LINE_BASED = 1, - NDIS_CONNECT_MESSAGE_BASED -} NDIS_INTERRUPT_TYPE, *PNDIS_INTERRUPT_TYPE; - -#define NDIS_MINIPORT_INTERRUPT_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS -{ - __in NDIS_OBJECT_HEADER Header; - __in MINIPORT_ISR_HANDLER InterruptHandler; - __in MINIPORT_INTERRUPT_DPC_HANDLER InterruptDpcHandler; - __in MINIPORT_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; - __in MINIPORT_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; - __in BOOLEAN MsiSupported; - __in BOOLEAN MsiSyncWithAllMessages; - __in MINIPORT_MSI_ISR_HANDLER MessageInterruptHandler; - __in MINIPORT_MSI_INTERRUPT_DPC_HANDLER MessageInterruptDpcHandler; - __in MINIPORT_DISABLE_MSI_INTERRUPT_HANDLER DisableMessageInterruptHandler; - __in MINIPORT_ENABLE_MSI_INTERRUPT_HANDLER EnableMessageInterruptHandler; - __out NDIS_INTERRUPT_TYPE InterruptType; - __out PIO_INTERRUPT_MESSAGE_INFO MessageInfoTable; -} NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS, *PNDIS_MINIPORT_INTERRUPT_CHARACTERISTICS; - -#define NDIS_SIZEOF_MINIPORT_INTERRUPT_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_INTERRUPT_CHARACTERISTICS, MessageInfoTable) - -typedef -NDIS_STATUS -(MINIPORT_ADD_DEVICE)( - __in NDIS_HANDLE NdisMiniportHandle, - __in NDIS_HANDLE MiniportDriverContext - ); - -typedef MINIPORT_ADD_DEVICE (*MINIPORT_ADD_DEVICE_HANDLER); - -typedef -VOID -(MINIPORT_REMOVE_DEVICE)( - __in NDIS_HANDLE MiniportAddDeviceContext - ); - -typedef MINIPORT_REMOVE_DEVICE (*MINIPORT_REMOVE_DEVICE_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_PNP_IRP)( - __in NDIS_HANDLE MiniportAddDeviceContext, - __in PIRP Irp - ); - -typedef MINIPORT_PNP_IRP (*MINIPORT_PNP_IRP_HANDLER); - -typedef MINIPORT_PNP_IRP (MINIPORT_START_DEVICE); -typedef MINIPORT_PNP_IRP (* MINIPORT_START_DEVICE_HANDLER); -typedef MINIPORT_PNP_IRP (MINIPORT_FILTER_RESOURCE_REQUIREMENTS); -typedef MINIPORT_PNP_IRP (*MINIPORT_FILTER_RESOURCE_REQUIREMENTS_HANDLER); - -#define NDIS_MINIPORT_PNP_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_PNP_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - MINIPORT_ADD_DEVICE_HANDLER MiniportAddDeviceHandler; - MINIPORT_REMOVE_DEVICE_HANDLER MiniportRemoveDeviceHandler; - MINIPORT_FILTER_RESOURCE_REQUIREMENTS_HANDLER MiniportFilterResourceRequirementsHandler; - MINIPORT_START_DEVICE_HANDLER MiniportStartDeviceHandler; - ULONG Flags; - -} NDIS_MINIPORT_PNP_CHARACTERISTICS, *PNDIS_MINIPORT_PNP_CHARACTERISTICS; - -#define NDIS_SIZEOF_MINIPORT_PNP_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_PNP_CHARACTERISTICS, Flags) - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterInterruptEx( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_HANDLE MiniportInterruptContext, - __in PNDIS_MINIPORT_INTERRUPT_CHARACTERISTICS MiniportInterruptCharacteristics, - __out PNDIS_HANDLE NdisInterruptHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterInterruptEx( - __in NDIS_HANDLE NdisInterruptHandle - ); - -EXPORT -BOOLEAN -NdisMSynchronizeWithInterruptEx( - __in NDIS_HANDLE NdisInterruptHandle, - __in ULONG MessageId, -#if (NDIS_SUPPORT_NDIS620) - __in MINIPORT_SYNCHRONIZE_INTERRUPT_HANDLER SynchronizeFunction, -#else - __in PVOID SynchronizeFunction, -#endif - __in __drv_isObjectPointer - PVOID SynchronizeContext - ); - -#if NDIS_SUPPORT_60_COMPATIBLE_API - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisMQueueDpc( - __in NDIS_HANDLE NdisInterruptHandle, - __in ULONG MessageId, - __in ULONG TargetProcessors, - __in_opt __drv_isObjectPointer - PVOID MiniportDpcContext - ); - -#endif - -#if NDIS_SUPPORT_NDIS620 - -EXPORT -KAFFINITY -NdisMQueueDpcEx( - IN NDIS_HANDLE NdisInterruptHandle, - IN ULONG MessageId, - IN PGROUP_AFFINITY TargetProcessors, - IN PVOID MiniportDpcContext - ); - -#endif - - - -#endif // NDIS_SUPPORT_NDIS6 - -#if NDIS_LEGACY_MINIPORT -#if (((NDIS_MINIPORT_MAJOR_VERSION == 5) && (NDIS_MINIPORT_MINOR_VERSION == 1)) || NDIS_WRAPPER) -typedef struct _NDIS51_MINIPORT_CHARACTERISTICS -{ -#ifdef __cplusplus - NDIS50_MINIPORT_CHARACTERISTICS Ndis50Chars; -#else - NDIS50_MINIPORT_CHARACTERISTICS; -#endif - // - // Extensions for NDIS 5.1 - // - W_CANCEL_SEND_PACKETS_HANDLER CancelSendPacketsHandler; - W_PNP_EVENT_NOTIFY_HANDLER PnPEventNotifyHandler; - W_MINIPORT_SHUTDOWN_HANDLER AdapterShutdownHandler; - PVOID Reserved1; - PVOID Reserved2; - PVOID Reserved3; - PVOID Reserved4; -} NDIS51_MINIPORT_CHARACTERISTICS; -#endif // (((NDIS_MINIPORT_MAJOR_VERSION == 5) && (NDIS_MINIPORT_MINOR_VERSION == 1)) || NDIS_WRAPPER) - -typedef struct _NDIS_MINIPORT_INTERRUPT -{ - PKINTERRUPT InterruptObject; - KSPIN_LOCK DpcCountLock; - PVOID Reserved; - W_ISR_HANDLER MiniportIsr; - W_HANDLE_INTERRUPT_HANDLER MiniportDpc; - KDPC InterruptDpc; - PNDIS_MINIPORT_BLOCK Miniport; - - UCHAR DpcCount; - BOOLEAN Filler1; - - // - // This is used to tell when all the Dpcs for the adapter are completed. - // - - KEVENT DpcsCompletedEvent; - - BOOLEAN SharedInterrupt; - BOOLEAN IsrRequested; - -} NDIS_MINIPORT_INTERRUPT, *PNDIS_MINIPORT_INTERRUPT; -#endif // NDIS_LEGACY_MINIPORT - -typedef struct _NDIS_MINIPORT_TIMER -{ - KTIMER Timer; - KDPC Dpc; - PNDIS_TIMER_FUNCTION MiniportTimerFunction; - PVOID MiniportTimerContext; - PNDIS_MINIPORT_BLOCK Miniport; - struct _NDIS_MINIPORT_TIMER *NextTimer; -} NDIS_MINIPORT_TIMER, *PNDIS_MINIPORT_TIMER; - -#if NDIS_LEGACY_MINIPORT -typedef -VOID -(*ETH_RCV_INDICATE_HANDLER)( - __in PETH_FILTER Filter, - __in NDIS_HANDLE MacReceiveContext, - __in PCHAR Address, - __in PVOID HeaderBuffer, - __in UINT HeaderBufferSize, - __in PVOID LookaheadBuffer, - __in UINT LookaheadBufferSize, - __in UINT PacketSize - ); - -typedef -VOID -(*ETH_RCV_COMPLETE_HANDLER)( - __in PETH_FILTER Filter - ); - -typedef -VOID -(*TR_RCV_INDICATE_HANDLER)( - __in PTR_FILTER Filter, - __in NDIS_HANDLE MacReceiveContext, - __in PVOID HeaderBuffer, - __in UINT HeaderBufferSize, - __in PVOID LookaheadBuffer, - __in UINT LookaheadBufferSize, - __in UINT PacketSize - ); - -typedef -VOID -(*TR_RCV_COMPLETE_HANDLER)( - __in PTR_FILTER Filter - ); - -typedef -VOID -(*WAN_RCV_HANDLER)( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_HANDLE NdisLinkContext, - __in PUCHAR Packet, - __in ULONG PacketSize - ); - -typedef -VOID -(*WAN_RCV_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_HANDLE NdisLinkContext - ); - -typedef -VOID -(*NDIS_M_SEND_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_PACKET Packet, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*NDIS_WM_SEND_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PVOID Packet, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*NDIS_M_TD_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_PACKET Packet, - __in NDIS_STATUS Status, - __in UINT BytesTransferred - ); - -typedef -VOID -(*NDIS_M_SEND_RESOURCES_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -typedef -VOID -(*NDIS_M_STATUS_HANDLER)( - __in NDIS_HANDLE MiniportHandle, - __in NDIS_STATUS GeneralStatus, - __in PVOID StatusBuffer, - __in UINT StatusBufferSize - ); - -typedef -VOID -(*NDIS_M_STS_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -typedef -VOID -(*NDIS_M_REQ_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_STATUS Status - ); - -typedef -VOID -(*NDIS_M_RESET_COMPLETE_HANDLER)( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_STATUS Status, - __in BOOLEAN AddressingReset - ); - -typedef -BOOLEAN -(FASTCALL *NDIS_M_START_SENDS)( - __in PNDIS_MINIPORT_BLOCK Miniport - ); - -// -// Wrapper initialization and termination. -// - -EXPORT -VOID -NdisInitializeWrapper( - OUT PNDIS_HANDLE NdisWrapperHandle, - IN PVOID SystemSpecific1, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3 - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisTerminateWrapper( - __in NDIS_HANDLE NdisWrapperHandle, - __in PVOID SystemSpecific - ); - -#endif // NDIS_LEGACY_MINIPORT - -#if NDIS_SUPPORT_NDIS6 - -typedef -VOID -(MINIPORT_PROCESS_SG_LIST)( - __in PDEVICE_OBJECT pDO, - __in PVOID Reserved, - __in PSCATTER_GATHER_LIST pSGL, - __in PVOID Context - ); - -typedef MINIPORT_PROCESS_SG_LIST (*MINIPORT_PROCESS_SG_LIST_HANDLER); -// -// NDIS DMA description structure -// - -typedef -VOID -(MINIPORT_ALLOCATE_SHARED_MEM_COMPLETE)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID VirtualAddress, - __in PNDIS_PHYSICAL_ADDRESS PhysicalAddress, - __in ULONG Length, - __in PVOID Context - ); -typedef MINIPORT_ALLOCATE_SHARED_MEM_COMPLETE (*MINIPORT_ALLOCATE_SHARED_MEM_COMPLETE_HANDLER); - -/* -NDIS_STATUS -NdisMAllocateSharedMemoryAsyncEx( - IN NDIS_HANDLE MiniportDmaHandle, - IN ULONG Length, - IN BOOLEAN Cached, - IN PVOID Context - ); -*/ -#define NdisMAllocateSharedMemoryAsyncEx(_H, _L, _C, _X) NdisMAllocateSharedMemoryAsync(_H, _L, _C, _X) -#endif // NDIS_SUPPORT_NDIS6 - - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMAllocateSharedMemoryAsync( - __in NDIS_HANDLE MiniportAdapterHandle, - __in ULONG Length, - __in BOOLEAN Cached, - __in PVOID Context - ); - -// -// defintions for subordinate (as referred in Master/subordinate) DMA -// - -// -// DMA Channel information -// -typedef struct _NDIS_DMA_DESCRIPTION -{ - BOOLEAN DemandMode; - BOOLEAN AutoInitialize; - BOOLEAN DmaChannelSpecified; - DMA_WIDTH DmaWidth; - DMA_SPEED DmaSpeed; - ULONG DmaPort; - ULONG DmaChannel; -} NDIS_DMA_DESCRIPTION, *PNDIS_DMA_DESCRIPTION; - -// -// Internal structure representing an NDIS DMA channel -// -typedef struct _NDIS_DMA_BLOCK -{ - PVOID MapRegisterBase; - KEVENT AllocationEvent; - PVOID SystemAdapterObject; - PVOID Miniport; - BOOLEAN InProgress; -} NDIS_DMA_BLOCK, *PNDIS_DMA_BLOCK; - - -EXPORT -VOID -NdisSetupDmaTransfer( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE NdisDmaHandle, - IN PNDIS_BUFFER Buffer, - IN ULONG Offset, - IN ULONG Length, - IN BOOLEAN WriteToDevice - ); - -EXPORT -VOID -NdisCompleteDmaTransfer( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE NdisDmaHandle, - IN PNDIS_BUFFER Buffer, - IN ULONG Offset, - IN ULONG Length, - IN BOOLEAN WriteToDevice - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterDmaChannel( - __out PNDIS_HANDLE MiniportDmaHandle, - __in NDIS_HANDLE MiniportAdapterHandle, - __in UINT DmaChannel, - __in BOOLEAN Dma32BitAddresses, - __in PNDIS_DMA_DESCRIPTION DmaDescription, - __in ULONG MaximumLength - ); - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterDmaChannel( - __in NDIS_HANDLE MiniportDmaHandle - ); - -/*++ -VOID -NdisMSetupDmaTransfer( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE MiniportDmaHandle, - IN PNDIS_BUFFER Buffer, - IN ULONG Offset, - IN ULONG Length, - IN BOOLEAN WriteToDevice - ) ---*/ -#define NdisMSetupDmaTransfer(_S, _H, _B, _O, _L, _M_) \ - NdisSetupDmaTransfer(_S, _H, _B, _O, _L, _M_) - -/*++ -VOID -NdisMCompleteDmaTransfer( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE MiniportDmaHandle, - IN PNDIS_BUFFER Buffer, - IN ULONG Offset, - IN ULONG Length, - IN BOOLEAN WriteToDevice - ) ---*/ -#define NdisMCompleteDmaTransfer(_S, _H, _B, _O, _L, _M_) \ - NdisCompleteDmaTransfer(_S, _H, _B, _O, _L, _M_) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisMReadDmaCounter( - __in NDIS_HANDLE MiniportDmaHandle - ); - - -// -// This API has been deprecated -// -DECLSPEC_DEPRECATED_DDK -EXPORT -VOID -NdisUpdateSharedMemory( - IN NDIS_HANDLE NdisAdapterHandle, - IN ULONG Length, - IN PVOID VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress - ); - - -#if NDIS_SUPPORT_NDIS6 - - -// -// Flags used in NDIS_SG_DMA_DESCRIPTION -// - -#define NDIS_SG_DMA_64_BIT_ADDRESS 0x00000001 - -// -// supported revision -// -#define NDIS_SG_DMA_DESCRIPTION_REVISION_1 1 - -typedef struct _NDIS_SG_DMA_DESCRIPTION -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG MaximumPhysicalMapping; - MINIPORT_PROCESS_SG_LIST_HANDLER ProcessSGListHandler; - MINIPORT_ALLOCATE_SHARED_MEM_COMPLETE_HANDLER SharedMemAllocateCompleteHandler; - ULONG ScatterGatherListSize; -} NDIS_SG_DMA_DESCRIPTION, *PNDIS_SG_DMA_DESCRIPTION; - -#define NDIS_SIZEOF_SG_DMA_DESCRIPTION_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_SG_DMA_DESCRIPTION, ScatterGatherListSize) - -#define NDIS_MINIPORT_INIT_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_INIT_PARAMETERS -{ - __in NDIS_OBJECT_HEADER Header; - __in ULONG Flags; - __in PNDIS_RESOURCE_LIST AllocatedResources; - __in NDIS_HANDLE IMDeviceInstanceContext; - __in NDIS_HANDLE MiniportAddDeviceContext; - __in NET_IFINDEX IfIndex; - __in NET_LUID NetLuid; - __in PNDIS_PORT_AUTHENTICATION_PARAMETERS DefaultPortAuthStates; - __in PNDIS_PCI_DEVICE_CUSTOM_PROPERTIES PciDeviceCustomProperties; -} NDIS_MINIPORT_INIT_PARAMETERS, *PNDIS_MINIPORT_INIT_PARAMETERS; - -#define NDIS_SIZEOF_MINIPORT_INIT_PARAMETER_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_INIT_PARAMETERS, PciDeviceCustomProperties) - -// -// NDIS_MINIPORT_RESTART_PARAMETERS is used in MINIPORT_RESTART handler -// -#define NDIS_MINIPORT_RESTART_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_RESTART_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - PNDIS_RESTART_ATTRIBUTES RestartAttributes; - ULONG Flags; -} NDIS_MINIPORT_RESTART_PARAMETERS, *PNDIS_MINIPORT_RESTART_PARAMETERS; - -#define NDIS_SIZEOF_MINIPORT_RESTART_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_RESTART_PARAMETERS, Flags) - -#define NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE MiniportAdapterContext; - ULONG AttributeFlags; - UINT CheckForHangTimeInSeconds; - NDIS_INTERFACE_TYPE InterfaceType; -} NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES, *PNDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES, InterfaceType) - -// -// flags used in NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES->SupportedStatistics -// - -#define NDIS_STATISTICS_XMIT_OK_SUPPORTED 0x00000001 -#define NDIS_STATISTICS_RCV_OK_SUPPORTED 0x00000002 -#define NDIS_STATISTICS_XMIT_ERROR_SUPPORTED 0x00000004 -#define NDIS_STATISTICS_RCV_ERROR_SUPPORTED 0x00000008 -#define NDIS_STATISTICS_RCV_NO_BUFFER_SUPPORTED 0x00000010 -#define NDIS_STATISTICS_DIRECTED_BYTES_XMIT_SUPPORTED 0x00000020 -#define NDIS_STATISTICS_DIRECTED_FRAMES_XMIT_SUPPORTED 0x00000040 -#define NDIS_STATISTICS_MULTICAST_BYTES_XMIT_SUPPORTED 0x00000080 -#define NDIS_STATISTICS_MULTICAST_FRAMES_XMIT_SUPPORTED 0x00000100 -#define NDIS_STATISTICS_BROADCAST_BYTES_XMIT_SUPPORTED 0x00000200 -#define NDIS_STATISTICS_BROADCAST_FRAMES_XMIT_SUPPORTED 0x00000400 -#define NDIS_STATISTICS_DIRECTED_BYTES_RCV_SUPPORTED 0x00000800 -#define NDIS_STATISTICS_DIRECTED_FRAMES_RCV_SUPPORTED 0x00001000 -#define NDIS_STATISTICS_MULTICAST_BYTES_RCV_SUPPORTED 0x00002000 -#define NDIS_STATISTICS_MULTICAST_FRAMES_RCV_SUPPORTED 0x00004000 -#define NDIS_STATISTICS_BROADCAST_BYTES_RCV_SUPPORTED 0x00008000 -#define NDIS_STATISTICS_BROADCAST_FRAMES_RCV_SUPPORTED 0x00010000 -#define NDIS_STATISTICS_RCV_CRC_ERROR_SUPPORTED 0x00020000 -#define NDIS_STATISTICS_TRANSMIT_QUEUE_LENGTH_SUPPORTED 0x00040000 -#define NDIS_STATISTICS_BYTES_RCV_SUPPORTED 0x00080000 -#define NDIS_STATISTICS_BYTES_XMIT_SUPPORTED 0x00100000 -#define NDIS_STATISTICS_RCV_DISCARDS_SUPPORTED 0x00200000 -#define NDIS_STATISTICS_GEN_STATISTICS_SUPPORTED 0x00400000 -#define NDIS_STATISTICS_XMIT_DISCARDS_SUPPORTED 0x08000000 - - -#define NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - NDIS_HANDLE MiniportAddDeviceContext; - ULONG Flags; - -} NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES, - *PNDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES, Flags) - -#define NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_2 2 -#endif - -typedef struct _NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - NDIS_MEDIUM MediaType; - NDIS_PHYSICAL_MEDIUM PhysicalMediumType; - ULONG MtuSize; - ULONG64 MaxXmitLinkSpeed; - ULONG64 XmitLinkSpeed; - ULONG64 MaxRcvLinkSpeed; - ULONG64 RcvLinkSpeed; - NDIS_MEDIA_CONNECT_STATE MediaConnectState; - NDIS_MEDIA_DUPLEX_STATE MediaDuplexState; - ULONG LookaheadSize; - PNDIS_PNP_CAPABILITIES PowerManagementCapabilities; // 6.20 drivers must use PowerManagementCapabilitiesEx - ULONG MacOptions; - ULONG SupportedPacketFilters; - ULONG MaxMulticastListSize; - USHORT MacAddressLength; - UCHAR PermanentMacAddress[NDIS_MAX_PHYS_ADDRESS_LENGTH]; - UCHAR CurrentMacAddress[NDIS_MAX_PHYS_ADDRESS_LENGTH]; - PNDIS_RECEIVE_SCALE_CAPABILITIES RecvScaleCapabilities; - NET_IF_ACCESS_TYPE AccessType; // NET_IF_ACCESS_BROADCAST for a typical ethernet adapter - NET_IF_DIRECTION_TYPE DirectionType; // NET_IF_DIRECTION_SENDRECEIVE for a typical ethernet adapter - NET_IF_CONNECTION_TYPE ConnectionType; // IF_CONNECTION_DEDICATED for a typical ethernet adapter - NET_IFTYPE IfType; // IF_TYPE_ETHERNET_CSMACD for a typical ethernet adapter (regardless of speed) - BOOLEAN IfConnectorPresent; // RFC 2665 TRUE if physical adapter - ULONG SupportedStatistics; // use NDIS_STATISTICS_XXXX_SUPPORTED - ULONG SupportedPauseFunctions; // IEEE 802.3 37.2.1 - ULONG DataBackFillSize; - ULONG ContextBackFillSize; - PNDIS_OID SupportedOidList; - ULONG SupportedOidListLength; - ULONG AutoNegotiationFlags; -#if (NDIS_SUPPORT_NDIS620) - PNDIS_PM_CAPABILITIES PowerManagementCapabilitiesEx; -#endif -} NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES, *PNDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES, AutoNegotiationFlags) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SIZEOF_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES, PowerManagementCapabilitiesEx) -#endif - -#if (NDIS_SUPPORT_NDIS61) - -// -// Flags and structure for Header/Data split -// -#define NDIS_HD_SPLIT_ATTRIBUTES_REVISION_1 1 - -typedef struct _NDIS_HD_SPLIT_ATTRIBUTES -{ - __in NDIS_OBJECT_HEADER Header; - __in ULONG HardwareCapabilities; - __in ULONG CurrentCapabilities; - __out ULONG HDSplitFlags; - __out ULONG BackfillSize; - __out ULONG MaxHeaderSize; -} NDIS_HD_SPLIT_ATTRIBUTES, *PNDIS_HD_SPLIT_ATTRIBUTES; - -#define NDIS_SIZEOF_HD_SPLIT_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_HD_SPLIT_ATTRIBUTES, MaxHeaderSize) - -// -// The miniport registers its hardware assist capabilities through this -// structure -// -#define NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_2 2 -#endif - - -typedef struct _NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - PNDIS_HD_SPLIT_ATTRIBUTES HDSplitAttributes; -#if (NDIS_SUPPORT_NDIS620) - PNDIS_RECEIVE_FILTER_CAPABILITIES HardwareReceiveFilterCapabilities; - PNDIS_RECEIVE_FILTER_CAPABILITIES CurrentReceiveFilterCapabilities; - PNDIS_NIC_SWITCH_CAPABILITIES HardwareNicSwitchCapabilities; - PNDIS_NIC_SWITCH_CAPABILITIES CurrentNicSwitchCapabilities; -#endif -} NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES, *PNDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES, HDSplitAttributes) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SIZEOF_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES, CurrentNicSwitchCapabilities) -#endif - -#endif // (NDIS_SUPPORT_NDIS61) - -// -// The miniport registers its offload capabilities through this -// structure -// -#define NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1 1 -typedef struct _NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - PNDIS_OFFLOAD DefaultOffloadConfiguration; - PNDIS_OFFLOAD HardwareOffloadCapabilities; - PNDIS_TCP_CONNECTION_OFFLOAD DefaultTcpConnectionOffloadConfiguration; - PNDIS_TCP_CONNECTION_OFFLOAD TcpConnectionOffloadHardwareCapabilities; -} NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES, *PNDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES, TcpConnectionOffloadHardwareCapabilities) - -#include - -#define NDIS_MINIPORT_ADAPTER_802_11_ATTRIBUTES_REVISION_1 1 -#define NDIS_MINIPORT_ADAPTER_802_11_ATTRIBUTES_REVISION_2 2 - -typedef struct _NDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - - ULONG OpModeCapability; - ULONG NumOfTXBuffers; - ULONG NumOfRXBuffers; - BOOLEAN MultiDomainCapabilityImplemented; - ULONG NumSupportedPhys; -#ifdef __midl - [size_is(NumSupportedPhys)] -#endif - PDOT11_PHY_ATTRIBUTES SupportedPhyAttributes; - - // Attributes specific to the operation modes - PDOT11_EXTSTA_ATTRIBUTES ExtSTAAttributes; - - -#if (NDIS_SUPPORT_NDIS620) - // virtual wifi specific attributes - PDOT11_VWIFI_ATTRIBUTES VWiFiAttributes; - // Ext AP specific attributes - PDOT11_EXTAP_ATTRIBUTES ExtAPAttributes; -#endif // (NDIS_SUPPORT_NDIS620) - - -}NDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES, - *PNDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES; - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES, ExtSTAAttributes) - -#if (NDIS_SUPPORT_NDIS620) - -#define NDIS_SIZEOF_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES, ExtAPAttributes) - -#endif // (NDIS_SUPPORT_NDIS620) - - -typedef union _NDIS_MINIPORT_ADAPTER_ATTRIBUTES -{ - NDIS_MINIPORT_ADD_DEVICE_REGISTRATION_ATTRIBUTES AddDeviceRegistrationAttributes; - NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES RegistrationAttributes; - NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES GeneralAttributes; - NDIS_MINIPORT_ADAPTER_OFFLOAD_ATTRIBUTES OffloadAttributes; - NDIS_MINIPORT_ADAPTER_NATIVE_802_11_ATTRIBUTES Native_802_11_Attributes; -#if (NDIS_SUPPORT_NDIS61) - NDIS_MINIPORT_ADAPTER_HARDWARE_ASSIST_ATTRIBUTES HardwareAssistAttributes; -#endif // (NDIS_SUPPORT_NDIS61) -} NDIS_MINIPORT_ADAPTER_ATTRIBUTES, *PNDIS_MINIPORT_ADAPTER_ATTRIBUTES; - - -// -// flags used in NDIS_MINIPORT_ADAPTER_REGISTRATION_ATTRIBUTES -// - -#define NDIS_MINIPORT_ATTRIBUTES_HARDWARE_DEVICE 0x00000001 -#define NDIS_MINIPORT_ATTRIBUTES_NDIS_WDM 0x00000002 -#define NDIS_MINIPORT_ATTRIBUTES_SURPRISE_REMOVE_OK 0x00000004 -#define NDIS_MINIPORT_ATTRIBUTES_NOT_CO_NDIS 0x00000008 -#define NDIS_MINIPORT_ATTRIBUTES_DO_NOT_BIND_TO_ALL_CO 0x00000010 -#define NDIS_MINIPORT_ATTRIBUTES_NO_HALT_ON_SUSPEND 0x00000020 -#define NDIS_MINIPORT_ATTRIBUTES_BUS_MASTER 0x00000040 -#define NDIS_MINIPORT_ATTRIBUTES_CONTROLS_DEFAULT_PORT 0x00000080 - -// -// NDIS 6.0 miniport's entry points -// - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMSetMiniportAttributes( - __in NDIS_HANDLE NdisMiniportHandle, - __in_bcount(((NDIS_OBJECT_HEADER)MiniportAttributes).Size) - PNDIS_MINIPORT_ADAPTER_ATTRIBUTES MiniportAttributes - ); - -typedef -NDIS_STATUS -(MINIPORT_INITIALIZE)( - __in NDIS_HANDLE NdisMiniportHandle, - __in NDIS_HANDLE MiniportDriverContext, - __in PNDIS_MINIPORT_INIT_PARAMETERS MiniportInitParameters - ); - -typedef MINIPORT_INITIALIZE (*MINIPORT_INITIALIZE_HANDLER); - -typedef enum _NDIS_HALT_ACTION -{ - NdisHaltDeviceDisabled, - NdisHaltDeviceInstanceDeInitialized, - NdisHaltDevicePoweredDown, - NdisHaltDeviceSurpriseRemoved, - NdisHaltDeviceFailed, - NdisHaltDeviceInitializationFailed, - NdisHaltDeviceStopped -} NDIS_HALT_ACTION, *PNDIS_HALT_ACTION; - -typedef -VOID -(MINIPORT_HALT)( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_HALT_ACTION HaltAction - ); - -typedef MINIPORT_HALT (*MINIPORT_HALT_HANDLER); - - -#define NDIS_MINIPORT_PAUSE_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_PAUSE_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG PauseReason; -} NDIS_MINIPORT_PAUSE_PARAMETERS, *PNDIS_MINIPORT_PAUSE_PARAMETERS; - -#define NDIS_SIZEOF_MINIPORT_PAUSE_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_PAUSE_PARAMETERS, PauseReason) - -typedef -NDIS_STATUS -(MINIPORT_PAUSE)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_MINIPORT_PAUSE_PARAMETERS PauseParameters - ); - -typedef MINIPORT_PAUSE (*MINIPORT_PAUSE_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_RESTART)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_MINIPORT_RESTART_PARAMETERS RestartParameters - ); - -typedef MINIPORT_RESTART (*MINIPORT_RESTART_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_OID_REQUEST) ( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_OID_REQUEST OidRequest - ); - -typedef MINIPORT_OID_REQUEST (*MINIPORT_OID_REQUEST_HANDLER); - -typedef -VOID -(MINIPORT_UNLOAD) ( - __in PDRIVER_OBJECT DriverObject - ); -typedef MINIPORT_UNLOAD (*MINIPORT_DRIVER_UNLOAD); - -// -// reasons for calling shutdown handler -// -typedef enum _NDIS_SHUTDOWN_ACTION { - NdisShutdownPowerOff, - NdisShutdownBugCheck -} NDIS_SHUTDOWN_ACTION, PNDIS_SHUTDOWN_ACTION; - -typedef -VOID -(MINIPORT_SHUTDOWN) ( - __in NDIS_HANDLE MiniportAdapterContext, - __in NDIS_SHUTDOWN_ACTION ShutdownAction - ); - -typedef MINIPORT_SHUTDOWN (*MINIPORT_SHUTDOWN_HANDLER); - - -#define NET_DEVICE_PNP_EVENT_REVISION_1 1 - -typedef struct _NET_DEVICE_PNP_EVENT -{ - NDIS_OBJECT_HEADER Header; - NDIS_PORT_NUMBER PortNumber; - NDIS_DEVICE_PNP_EVENT DevicePnPEvent; - PVOID InformationBuffer; - ULONG InformationBufferLength; - UCHAR NdisReserved[2 * sizeof(PVOID)]; - -} NET_DEVICE_PNP_EVENT, *PNET_DEVICE_PNP_EVENT; - -#define NDIS_SIZEOF_NET_DEVICE_PNP_EVENT_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_DEVICE_PNP_EVENT, NdisReserved) - -typedef -VOID -(MINIPORT_DEVICE_PNP_EVENT_NOTIFY)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNET_DEVICE_PNP_EVENT NetDevicePnPEvent - ); - -typedef MINIPORT_DEVICE_PNP_EVENT_NOTIFY (*MINIPORT_DEVICE_PNP_EVENT_NOTIFY_HANDLER); - -typedef -VOID -(MINIPORT_CANCEL_SEND)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID CancelId - ); - -typedef MINIPORT_CANCEL_SEND (*MINIPORT_CANCEL_SEND_HANDLER); - -typedef -BOOLEAN -(MINIPORT_CHECK_FOR_HANG)( - __in NDIS_HANDLE MiniportAdapterContext - ); - -typedef MINIPORT_CHECK_FOR_HANG (*MINIPORT_CHECK_FOR_HANG_HANDLER); - -typedef -NDIS_STATUS -(MINIPORT_RESET)( - __in NDIS_HANDLE MiniportAdapterContext, - __out PBOOLEAN AddressingReset - ); - -typedef MINIPORT_RESET (*MINIPORT_RESET_HANDLER); - -typedef -VOID -(MINIPORT_CANCEL_OID_REQUEST)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID RequestId - ); - -typedef MINIPORT_CANCEL_OID_REQUEST (*MINIPORT_CANCEL_OID_REQUEST_HANDLER); - -typedef -VOID -(MINIPORT_SEND_NET_BUFFER_LISTS)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNET_BUFFER_LIST NetBufferList, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG SendFlags - ); - -typedef MINIPORT_SEND_NET_BUFFER_LISTS (*MINIPORT_SEND_NET_BUFFER_LISTS_HANDLER); - -typedef -VOID -(MINIPORT_RETURN_NET_BUFFER_LISTS)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG ReturnFlags - ); - -typedef MINIPORT_RETURN_NET_BUFFER_LISTS (*MINIPORT_RETURN_NET_BUFFER_LISTS_HANDLER); - -#if (NDIS_SUPPORT_NDIS61) -// -// NDIS 6.1 miniport's entry points -// - -typedef -NDIS_STATUS -(MINIPORT_DIRECT_OID_REQUEST) ( - __in NDIS_HANDLE MiniportAdapterContext, - __in PNDIS_OID_REQUEST OidRequest - ); - -typedef MINIPORT_DIRECT_OID_REQUEST (*MINIPORT_DIRECT_OID_REQUEST_HANDLER); - -typedef -VOID -(MINIPORT_CANCEL_DIRECT_OID_REQUEST)( - __in NDIS_HANDLE MiniportAdapterContext, - __in PVOID RequestId - ); - -typedef MINIPORT_CANCEL_DIRECT_OID_REQUEST (*MINIPORT_CANCEL_DIRECT_OID_REQUEST_HANDLER); - - -#endif // (NDIS_SUPPORT_NDIS61) - -// -// flags used in Flags field of NDIS60_MINIPORT_CHARACTERISTICS -// -#define NDIS_INTERMEDIATE_DRIVER 0x00000001 -#define NDIS_WDM_DRIVER 0x00000002 - - -#define NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2 2 -#endif // (NDIS_SUPPORT_NDIS61) - -typedef struct _NDIS_MINIPORT_DRIVER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - UCHAR MajorNdisVersion; - UCHAR MinorNdisVersion; - UCHAR MajorDriverVersion; - UCHAR MinorDriverVersion; - ULONG Flags; - SET_OPTIONS_HANDLER SetOptionsHandler; - MINIPORT_INITIALIZE_HANDLER InitializeHandlerEx; - MINIPORT_HALT_HANDLER HaltHandlerEx; - MINIPORT_DRIVER_UNLOAD UnloadHandler; - MINIPORT_PAUSE_HANDLER PauseHandler; - MINIPORT_RESTART_HANDLER RestartHandler; - MINIPORT_OID_REQUEST_HANDLER OidRequestHandler; - MINIPORT_SEND_NET_BUFFER_LISTS_HANDLER SendNetBufferListsHandler; - MINIPORT_RETURN_NET_BUFFER_LISTS_HANDLER ReturnNetBufferListsHandler; - MINIPORT_CANCEL_SEND_HANDLER CancelSendHandler; - MINIPORT_CHECK_FOR_HANG_HANDLER CheckForHangHandlerEx; - MINIPORT_RESET_HANDLER ResetHandlerEx; - MINIPORT_DEVICE_PNP_EVENT_NOTIFY_HANDLER DevicePnPEventNotifyHandler; - MINIPORT_SHUTDOWN_HANDLER ShutdownHandlerEx; - MINIPORT_CANCEL_OID_REQUEST_HANDLER CancelOidRequestHandler; -#if (NDIS_SUPPORT_NDIS61) - MINIPORT_DIRECT_OID_REQUEST_HANDLER DirectOidRequestHandler; - MINIPORT_CANCEL_DIRECT_OID_REQUEST_HANDLER CancelDirectOidRequestHandler; -#endif // (NDIS_SUPPORT_NDIS61) -} NDIS_MINIPORT_DRIVER_CHARACTERISTICS, *PNDIS_MINIPORT_DRIVER_CHARACTERISTICS; - -#define NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_DRIVER_CHARACTERISTICS, CancelOidRequestHandler) - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_SIZEOF_MINIPORT_DRIVER_CHARACTERISTICS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_DRIVER_CHARACTERISTICS, CancelDirectOidRequestHandler) -#endif // (NDIS_SUPPORT_NDIS61) - -// -// CO NDIS 6.0 handlers -// - -#define NDIS_MINIPORT_CO_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_MINIPORT_CO_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_PROTOCOL_CO_CHARACTERISTICS - ULONG Flags; - W_CO_CREATE_VC_HANDLER CoCreateVcHandler; - W_CO_DELETE_VC_HANDLER CoDeleteVcHandler; - W_CO_ACTIVATE_VC_HANDLER CoActivateVcHandler; - W_CO_DEACTIVATE_VC_HANDLER CoDeactivateVcHandler; - W_CO_SEND_NET_BUFFER_LISTS_HANDLER CoSendNetBufferListsHandler; - W_CO_OID_REQUEST_HANDLER CoOidRequestHandler; - -} NDIS_MINIPORT_CO_CHARACTERISTICS, *PNDIS_MINIPORT_CO_CHARACTERISTICS; - -#define NDIS_SIZEOF_MINIPORT_CO_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MINIPORT_CO_CHARACTERISTICS, CoOidRequestHandler) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMIndicateStatusEx( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_STATUS_INDICATION StatusIndication - ); - -EXPORT -VOID -NdisMCoOidRequestComplete( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE NdisMiniportVcHandle, - IN PNDIS_OID_REQUEST Request, - IN NDIS_STATUS Status - ); - - -EXPORT -NDIS_STATUS -NdisMCmOidRequest( - IN NDIS_HANDLE NdisAfHandle, - IN NDIS_HANDLE NdisVcHandle OPTIONAL, - IN NDIS_HANDLE NdisPartyHandle OPTIONAL, - IN OUT PNDIS_OID_REQUEST NdisRequest - ); - - -EXPORT -VOID -NdisMCoIndicateStatusEx( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE NdisVcHandle OPTIONAL, - IN PNDIS_STATUS_INDICATION StatusIndication - ); - -#endif // NDIS_SUPPORT_NDIS6 - - -// -// Do not change the structure below !!! -// -typedef struct -{ - union - { - PETH_FILTER EthDB; - PNULL_FILTER NullDB; // Default Filter - }; - PTR_FILTER TrDB; - - PVOID YYYDB; - - PVOID XXXDB; -} FILTERDBS, *PFILTERDBS; - -#if NDIS_LEGACY_MINIPORT -typedef -VOID -(*FILTER_PACKET_INDICATION_HANDLER)( - __in NDIS_HANDLE Miniport, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -#endif // NDIS_LEGACY_MINIPORT - -#if !NDIS_WRAPPER -// -// one of these per mini-port registered on a Driver -// - -#if NDIS_LEGACY_MINIPORT - -#pragma warning(push) - -#pragma warning(disable:4201) // (nonstandard extension used : nameless struct/union) - - -struct _NDIS_MINIPORT_BLOCK -{ - NDIS_OBJECT_HEADER Header; - PNDIS_MINIPORT_BLOCK NextMiniport; // used by driver's MiniportQueue - PNDIS_MINIPORT_BLOCK BaseMiniport; - NDIS_HANDLE MiniportAdapterContext; // context when calling mini-port functions - UNICODE_STRING Reserved4; - PVOID Reserved10; - NDIS_HANDLE OpenQueue; // queue of opens for this mini-port - REFERENCE ShortRef; // contains spinlock for OpenQueue - - NDIS_HANDLE Reserved12; - - UCHAR Padding1; // DO NOT REMOVE OR NDIS WILL BREAK!!! - - // - // Synchronization stuff. - // - // The boolean is used to lock out several DPCs from running at the same time. - // - UCHAR LockAcquired; // EXPOSED via macros. Do not move - - UCHAR PmodeOpens; // Count of opens which turned on pmode/all_local - - // - // This is the processor number that the miniport's - // interrupt DPC and timers are running on. - // - // Note: This field is no longer used - // - UCHAR Reserved23; - - KSPIN_LOCK Lock; - - PNDIS_REQUEST MediaRequest; - - PVOID Interrupt; - - ULONG Flags; // Flags to keep track of the miniport's state. - ULONG PnPFlags; - - // - // Send information - // - LIST_ENTRY PacketList; - PNDIS_PACKET FirstPendingPacket; // This is head of the queue of packets - // waiting to be sent to miniport. - PNDIS_PACKET ReturnPacketsQueue; - - // - // Space used for temp. use during request processing - // - ULONG RequestBuffer; - PVOID SetMCastBuffer; - - PNDIS_MINIPORT_BLOCK PrimaryMiniport; - PVOID Reserved11; - - // - // context to pass to bus driver when reading or writing config space - // - PVOID BusDataContext; - ULONG Reserved3; - - // - // Resource information - // - PCM_RESOURCE_LIST Resources; - - // - // Watch-dog timer - // - NDIS_TIMER WakeUpDpcTimer; - - // - // Needed for PnP. Upcased version. The buffer is allocated as part of the - // NDIS_MINIPORT_BLOCK itself. - // - // Note: - // the following two fields should be explicitly UNICODE_STRING because - // under Win9x the NDIS_STRING is an ANSI_STRING - // - UNICODE_STRING Reserved20; - UNICODE_STRING SymbolicLinkName; - - // - // Check for hang stuff - // - ULONG CheckForHangSeconds; - USHORT CFHangTicks; - USHORT CFHangCurrentTick; - - // - // Reset information - // - NDIS_STATUS ResetStatus; - NDIS_HANDLE ResetOpen; - - // - // Holds media specific information. - // -#ifdef __cplusplus - FILTERDBS FilterDbs; // EXPOSED via macros. Do not move -#else - FILTERDBS; // EXPOSED via macros. Do not move -#endif - - FILTER_PACKET_INDICATION_HANDLER PacketIndicateHandler; - NDIS_M_SEND_COMPLETE_HANDLER SendCompleteHandler; - NDIS_M_SEND_RESOURCES_HANDLER SendResourcesHandler; - NDIS_M_RESET_COMPLETE_HANDLER ResetCompleteHandler; - - NDIS_MEDIUM MediaType; - - // - // contains mini-port information - // - ULONG BusNumber; - NDIS_INTERFACE_TYPE BusType; - NDIS_INTERFACE_TYPE AdapterType; - - PDEVICE_OBJECT Reserved6; - PDEVICE_OBJECT Reserved7; - PDEVICE_OBJECT Reserved8; - - - PVOID MiniportSGDmaBlock; - - // - // List of registered address families. Valid for the call-manager, Null for the client - // - PNDIS_AF_LIST CallMgrAfList; - - PVOID MiniportThread; - PVOID SetInfoBuf; - USHORT SetInfoBufLen; - USHORT MaxSendPackets; - - // - // Status code that is returned from the fake handlers. - // - NDIS_STATUS FakeStatus; - - PVOID Reserved24; // For the filter lock - - PUNICODE_STRING Reserved9; - - PVOID Reserved21; - - UINT MacOptions; - - // - // RequestInformation - // - PNDIS_REQUEST PendingRequest; - UINT MaximumLongAddresses; - UINT MaximumShortAddresses; - UINT CurrentLookahead; - UINT MaximumLookahead; - - // - // For efficiency - // - ULONG_PTR Reserved1; - W_DISABLE_INTERRUPT_HANDLER DisableInterruptHandler; - W_ENABLE_INTERRUPT_HANDLER EnableInterruptHandler; - W_SEND_PACKETS_HANDLER SendPacketsHandler; - NDIS_M_START_SENDS DeferredSendHandler; - - // - // The following cannot be unionized. - // - ETH_RCV_INDICATE_HANDLER EthRxIndicateHandler; // EXPOSED via macros. Do not move - TR_RCV_INDICATE_HANDLER TrRxIndicateHandler; // EXPOSED via macros. Do not move - PVOID Reserved2; - - ETH_RCV_COMPLETE_HANDLER EthRxCompleteHandler; // EXPOSED via macros. Do not move - TR_RCV_COMPLETE_HANDLER TrRxCompleteHandler; // EXPOSED via macros. Do not move - PVOID Reserved22; - - NDIS_M_STATUS_HANDLER StatusHandler; // EXPOSED via macros. Do not move - NDIS_M_STS_COMPLETE_HANDLER StatusCompleteHandler; // EXPOSED via macros. Do not move - NDIS_M_TD_COMPLETE_HANDLER TDCompleteHandler; // EXPOSED via macros. Do not move - NDIS_M_REQ_COMPLETE_HANDLER QueryCompleteHandler; // EXPOSED via macros. Do not move - NDIS_M_REQ_COMPLETE_HANDLER SetCompleteHandler; // EXPOSED via macros. Do not move - - NDIS_WM_SEND_COMPLETE_HANDLER WanSendCompleteHandler;// EXPOSED via macros. Do not move - WAN_RCV_HANDLER WanRcvHandler; // EXPOSED via macros. Do not move - WAN_RCV_COMPLETE_HANDLER WanRcvCompleteHandler; // EXPOSED via macros. Do not move - - /********************************************************************************************/ - /**************** **********/ - /**************** STUFF ABOVE IS POTENTIALLY ACCESSED BY MACROS. ADD STUFF BELOW **********/ - /**************** SEVERE POSSIBILITY OF BREAKING SOMETHING IF STUFF ABOVE IS MOVED **********/ - /**************** **********/ - /********************************************************************************************/ - -}; - -#pragma warning(pop) - - -#endif // NDIS_LEGACY_MINIPORT - -#endif // NDIS_WRAPPER not defined - - -#if NDIS_LEGACY_MINIPORT - -#ifdef NDIS51_MINIPORT -typedef struct _NDIS51_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS; -#else -#ifdef NDIS50_MINIPORT -typedef struct _NDIS50_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS; -#else -#ifdef NDIS40_MINIPORT -typedef struct _NDIS40_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS; -#else -typedef struct _NDIS30_MINIPORT_CHARACTERISTICS NDIS_MINIPORT_CHARACTERISTICS; -#endif -#endif -#endif - -typedef NDIS_MINIPORT_CHARACTERISTICS * PNDIS_MINIPORT_CHARACTERISTICS; -typedef NDIS_MINIPORT_CHARACTERISTICS NDIS_WAN_MINIPORT_CHARACTERISTICS; -typedef NDIS_WAN_MINIPORT_CHARACTERISTICS * PNDIS_MINIPORT_CHARACTERISTICS; - - -// -// Routines for intermediate miniport drivers. NDIS 6 IM drivers -// use the same registration deregistration APIs as regular miniports -// - -EXPORT -NDIS_STATUS -NdisIMRegisterLayeredMiniport( - IN NDIS_HANDLE NdisWrapperHandle, - IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, - IN UINT CharacteristicsLength, - OUT PNDIS_HANDLE DriverHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisIMDeregisterLayeredMiniport( - __in NDIS_HANDLE DriverHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterDevice( - __in NDIS_HANDLE NdisWrapperHandle, - __in PNDIS_STRING DeviceName, - __in PNDIS_STRING SymbolicName, - __in PDRIVER_DISPATCH MajorFunctions[], - __out PDEVICE_OBJECT * pDeviceObject, - __out NDIS_HANDLE * NdisDeviceHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMDeregisterDevice( - __in NDIS_HANDLE NdisDeviceHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMRegisterUnloadHandler( - __in NDIS_HANDLE NdisWrapperHandle, - __in PDRIVER_UNLOAD UnloadHandler - ); - -#endif // NDIS_LEGACY_MINIPORT - - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisIMAssociateMiniport( - __in NDIS_HANDLE DriverHandle, - __in NDIS_HANDLE ProtocolHandle - ); - -// -// Operating System Requests -// -typedef UCHAR NDIS_DMA_SIZE; - -#define NDIS_DMA_24BITS ((NDIS_DMA_SIZE)0) -#define NDIS_DMA_32BITS ((NDIS_DMA_SIZE)1) -#define NDIS_DMA_64BITS ((NDIS_DMA_SIZE)2) - -#if NDIS_LEGACY_MINIPORT -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("NdisMInitializeScatterGatherDma", "See details in NdisMAllocateMapRegisters documentation") -EXPORT -NDIS_STATUS -NdisMAllocateMapRegisters( - __in NDIS_HANDLE MiniportAdapterHandle, - __in UINT DmaChannel, - __in NDIS_DMA_SIZE DmaSize, - __in ULONG BaseMapRegistersNeeded, - __in ULONG MaximumPhysicalMapping - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMFreeMapRegisters( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMInitializeScatterGatherDma( - __in NDIS_HANDLE MiniportAdapterHandle, - __in BOOLEAN Dma64BitAddresses, - __in ULONG MaximumPhysicalMapping - ); - -#endif // NDIS_LEGACY_MINIPORT - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterIoPortRange( - __out PVOID * PortOffset, - __in NDIS_HANDLE MiniportAdapterHandle, - __in UINT InitialPort, - __in UINT NumberOfPorts - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterIoPortRange( - __in NDIS_HANDLE MiniportAdapterHandle, - __in UINT InitialPort, - __in UINT NumberOfPorts, - __in PVOID PortOffset - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMMapIoSpace( - __deref_out_bcount(Length) PVOID * VirtualAddress, - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_PHYSICAL_ADDRESS PhysicalAddress, - __in UINT Length - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMUnmapIoSpace( - __in NDIS_HANDLE MiniportAdapterHandle, - __in_bcount(Length) PVOID VirtualAddress, - __in UINT Length - ); - -#if NDIS_LEGACY_MINIPORT - -EXPORT -NDIS_STATUS -NdisMRegisterInterrupt( - OUT PNDIS_MINIPORT_INTERRUPT Interrupt, - IN NDIS_HANDLE MiniportAdapterHandle, - IN UINT InterruptVector, - IN UINT InterruptLevel, - IN BOOLEAN RequestIsr, - IN BOOLEAN SharedInterrupt, - IN NDIS_INTERRUPT_MODE InterruptMode - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterInterrupt( - __in PNDIS_MINIPORT_INTERRUPT Interrupt - ); - -EXPORT -BOOLEAN -NdisMSynchronizeWithInterrupt( - IN PNDIS_MINIPORT_INTERRUPT Interrupt, -#if (NDIS_SUPPORT_NDIS620) - IN MINIPORT_SYNCHRONIZE_INTERRUPT_HANDLER SynchronizeFunction, -#else - IN PVOID SynchronizeFunction, -#endif - IN PVOID SynchronizeContext - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMQueryAdapterResources( - __out PNDIS_STATUS Status, - __in NDIS_HANDLE WrapperConfigurationContext, - __out PNDIS_RESOURCE_LIST ResourceList, - __deref_inout PUINT BufferSize - ); - -// -// Physical Mapping -// -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMStartBufferPhysicalMapping( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_BUFFER Buffer, - __in ULONG PhysicalMapRegister, - __in BOOLEAN WriteToDevice, - __out PNDIS_PHYSICAL_ADDRESS_UNIT PhysicalAddressArray, - __out PUINT ArraySize - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCompleteBufferPhysicalMapping( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_BUFFER Buffer, - __in ULONG PhysicalMapRegister - ); - -/*++ -// -// This API has been deprecated -// -VOID -NdisMUpdateSharedMemory( - IN NDIS_HANDLE MiniportAdapterHandle, - IN ULONG Length, - IN PVOID VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress - ); -*/ -#define NdisMUpdateSharedMemory(_H, _L, _V, _P) -#pragma deprecated(NdisMUpdateSharedMemory) - - -#endif // NDIS_LEGACY_MINIPORT - -// -// Timers -// -// VOID -// NdisMSetTimer( -// IN PNDIS_MINIPORT_TIMER Timer, -// IN UINT MillisecondsToDelay -// ); -#define NdisMSetTimer(_Timer, _Delay) NdisSetTimer((PNDIS_TIMER)_Timer, _Delay) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMSetPeriodicTimer( - __in PNDIS_MINIPORT_TIMER Timer, - __in UINT MillisecondPeriod - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMInitializeTimer( - __in OUT PNDIS_MINIPORT_TIMER Timer, - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_TIMER_FUNCTION TimerFunction, - __in PVOID FunctionContext - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCancelTimer( - __in PNDIS_MINIPORT_TIMER Timer, - __out __checkReturn - PBOOLEAN TimerCancelled - ); - -__drv_maxIRQL(APC_LEVEL) -EXPORT -VOID -NdisMSleep( - __in ULONG MicrosecondsToSleep - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -ULONG -NdisMGetDmaAlignment( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -// -// Shared memory -// -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMAllocateSharedMemory( - __in NDIS_HANDLE MiniportAdapterHandle, - __in ULONG Length, - __in BOOLEAN Cached, - __deref_out __checkReturn - PVOID * VirtualAddress, - __out __checkReturn - PNDIS_PHYSICAL_ADDRESS PhysicalAddress - ); - - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMFreeSharedMemory( - __in NDIS_HANDLE MiniportAdapterHandle, - __in ULONG Length, - __in BOOLEAN Cached, - __in_bcount(Length) PVOID VirtualAddress, - __in NDIS_PHYSICAL_ADDRESS PhysicalAddress - ); - -#if NDIS_LEGACY_MINIPORT - -// -// Requests Used by Miniport Drivers -// -#define NdisMInitializeWrapper(_a,_b,_c,_d) NdisInitializeWrapper((_a),(_b),(_c),(_d)) - - -EXPORT -NDIS_STATUS -NdisMRegisterMiniport( - IN NDIS_HANDLE NdisWrapperHandle, - IN PNDIS_MINIPORT_CHARACTERISTICS MiniportCharacteristics, - IN UINT CharacteristicsLength - ); - - -// EXPORT -// NDIS_STATUS -// NdisIMInitializeDeviceInstance( -// IN NDIS_HANDLE DriverHandle, -// IN PNDIS_STRING DriverInstance -// ); -#define NdisIMInitializeDeviceInstance(_H_, _I_) \ - NdisIMInitializeDeviceInstanceEx(_H_, _I_, NULL) -#endif // NDIS_LEGACY_MINIPORT - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIMInitializeDeviceInstanceEx( - __in NDIS_HANDLE DriverHandle, - __in PNDIS_STRING DriverInstance, - __in_opt NDIS_HANDLE DeviceContext - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIMCancelInitializeDeviceInstance( - __in NDIS_HANDLE DriverHandle, - __in PNDIS_STRING DeviceInstance - ); - -#if NDIS_LEGACY_MINIPORT -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisIMGetDeviceContext( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -#endif // NDIS_LEGACY_MINIPORT - -__drv_maxIRQL(APC_LEVEL) -EXPORT -NDIS_HANDLE -NdisIMGetBindingContext( - __in NDIS_HANDLE NdisBindingHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIMDeInitializeDeviceInstance( - __in NDIS_HANDLE NdisMiniportHandle - ); - - -#if NDIS_LEGACY_MINIPORT - -EXPORT -VOID -NdisIMCopySendPerPacketInfo( - OUT PNDIS_PACKET DstPacket, - IN PNDIS_PACKET SrcPacket - ); - -EXPORT -VOID -NdisIMCopySendCompletePerPacketInfo( - OUT PNDIS_PACKET DstPacket, - IN PNDIS_PACKET SrcPacket - ); - -// EXPORT -// VOID -// NdisMSetAttributes( -// IN NDIS_HANDLE MiniportAdapterHandle, -// IN NDIS_HANDLE MiniportAdapterContext, -// IN BOOLEAN BusMaster, -// IN NDIS_INTERFACE_TYPE AdapterType -// ); -#define NdisMSetAttributes(_H_, _C_, _M_, _T_) \ - NdisMSetAttributesEx(_H_, \ - _C_, \ - 0, \ - (_M_) ? NDIS_ATTRIBUTE_BUS_MASTER : 0, \ - _T_) \ - - -EXPORT -VOID -NdisMSetAttributesEx( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE MiniportAdapterContext, - IN UINT CheckForHangTimeInSeconds OPTIONAL, - IN ULONG AttributeFlags, - IN NDIS_INTERFACE_TYPE AdapterType OPTIONAL - ); - -#define NDIS_ATTRIBUTE_IGNORE_PACKET_TIMEOUT 0x00000001 -#define NDIS_ATTRIBUTE_IGNORE_REQUEST_TIMEOUT 0x00000002 -#define NDIS_ATTRIBUTE_IGNORE_TOKEN_RING_ERRORS 0x00000004 -#define NDIS_ATTRIBUTE_BUS_MASTER 0x00000008 -#define NDIS_ATTRIBUTE_INTERMEDIATE_DRIVER 0x00000010 -#define NDIS_ATTRIBUTE_DESERIALIZE 0x00000020 -#define NDIS_ATTRIBUTE_NO_HALT_ON_SUSPEND 0x00000040 -#define NDIS_ATTRIBUTE_SURPRISE_REMOVE_OK 0x00000080 -#define NDIS_ATTRIBUTE_NOT_CO_NDIS 0x00000100 -#define NDIS_ATTRIBUTE_USES_SAFE_BUFFER_APIS 0x00000200 -#define NDIS_ATTRIBUTE_DO_NOT_BIND_TO_ALL_CO 0x00000400 -#define NDIS_ATTRIBUTE_MINIPORT_PADS_SHORT_PACKETS 0x00000800 - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMSetMiniportSecondary( - __in NDIS_HANDLE MiniportHandle, - __in NDIS_HANDLE PrimaryMiniportHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMPromoteMiniport( - __in NDIS_HANDLE MiniportHandle - ); - -#endif // NDIS_LEGACY_MINIPORT - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMRemoveMiniport( - __in NDIS_HANDLE MiniportHandle - ); - - -#if NDIS_LEGACY_MINIPORT - -#define NdisMSendComplete(_M, _P, _S) (*((PNDIS_MINIPORT_BLOCK)(_M))->SendCompleteHandler)(_M, _P, _S) - -#define NdisMSendResourcesAvailable(_M) (*((PNDIS_MINIPORT_BLOCK)(_M))->SendResourcesHandler)(_M) - -#if (!NDIS_WRAPPER) -#if (!NDIS_SUPPORT_NDIS6) - -#define NdisMResetComplete(_M, _S, _A) (*((PNDIS_MINIPORT_BLOCK)(_M))->ResetCompleteHandler)(_M, _S, _A) -#endif // NDIS_SUPPORT_NDIS6 -#endif // !NDIS_WRAPPER - -#define NdisMTransferDataComplete(_M, _P, _S, _B) \ - (*((PNDIS_MINIPORT_BLOCK)(_M))->TDCompleteHandler)(_M, _P, _S, _B) - -/*++ - -VOID -NdisMWanSendComplete( - IN NDIS_HANDLE MiniportAdapterHandle, - IN PVOID Packet, - IN NDIS_STATUS Status - ); - ---*/ - -#define NdisMWanSendComplete(_M_, _P_, _S_) \ - (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanSendCompleteHandler)(_M_, _P_, _S_) - -#define NdisMQueryInformationComplete(_M, _S) \ - (*((PNDIS_MINIPORT_BLOCK)(_M))->QueryCompleteHandler)(_M, _S) - -#define NdisMSetInformationComplete(_M, _S) \ - (*((PNDIS_MINIPORT_BLOCK)(_M))->SetCompleteHandler)(_M, _S) - -/*++ - -VOID -NdisMIndicateReceivePacket( - IN NDIS_HANDLE MiniportAdapterHandle, - IN PPNDIS_PACKET ReceivedPackets, - IN UINT NumberOfPackets - ); - ---*/ -#define NdisMIndicateReceivePacket(_H, _P, _N) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->PacketIndicateHandler)( \ - _H, \ - _P, \ - _N); \ -} - -/*++ - -VOID -NdisMWanIndicateReceive( - OUT PNDIS_STATUS Status, - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE NdisLinkContext, - IN PUCHAR Packet, - IN ULONG PacketSize - ); - ---*/ - -#define NdisMWanIndicateReceive(_S_, _M_, _C_, _P_, _Z_) \ - (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanRcvHandler)(_S_, _M_, _C_, _P_, _Z_) - -/*++ - -VOID -NdisMWanIndicateReceiveComplete( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE NdisLinkContext - ); - ---*/ - -#define NdisMWanIndicateReceiveComplete(_M_, _C_) \ - (*((PNDIS_MINIPORT_BLOCK)(_M_))->WanRcvCompleteHandler)(_M_, _C_) - -/*++ - -VOID -NdisMEthIndicateReceive( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE MiniportReceiveContext, - IN PVOID HeaderBuffer, - IN UINT HeaderBufferSize, - IN PVOID LookaheadBuffer, - IN UINT LookaheadBufferSize, - IN UINT PacketSize - ) - ---*/ -#ifdef __cplusplus - -#define NdisMEthIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxIndicateHandler)( \ - ((PNDIS_MINIPORT_BLOCK)(_H))->FilterDbs.EthDB, \ - _C, \ - _B, \ - _B, \ - _SZ, \ - _L, \ - _LSZ, \ - _PSZ \ - ); \ -} - -#else - -#define NdisMEthIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxIndicateHandler)( \ - ((PNDIS_MINIPORT_BLOCK)(_H))->EthDB, \ - _C, \ - _B, \ - _B, \ - _SZ, \ - _L, \ - _LSZ, \ - _PSZ \ - ); \ -} - -#endif - -/*++ - -VOID -NdisMTrIndicateReceive( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_HANDLE MiniportReceiveContext, - IN PVOID HeaderBuffer, - IN UINT HeaderBufferSize, - IN PVOID LookaheadBuffer, - IN UINT LookaheadBufferSize, - IN UINT PacketSize - ) - ---*/ -#ifdef __cplusplus -#define NdisMTrIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxIndicateHandler)( \ - ((PNDIS_MINIPORT_BLOCK)(_H))->FilterDbs.TrDB, \ - _C, \ - _B, \ - _SZ, \ - _L, \ - _LSZ, \ - _PSZ \ - ); \ -} - -#else - -#define NdisMTrIndicateReceive( _H, _C, _B, _SZ, _L, _LSZ, _PSZ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxIndicateHandler)( \ - ((PNDIS_MINIPORT_BLOCK)(_H))->TrDB, \ - _C, \ - _B, \ - _SZ, \ - _L, \ - _LSZ, \ - _PSZ \ - ); \ -} -#endif - -/*++ - -VOID -NdisMEthIndicateReceiveComplete( - IN NDIS_HANDLE MiniportHandle - ); - ---*/ -#ifdef __cplusplus - -#define NdisMEthIndicateReceiveComplete( _H ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxCompleteHandler)( \ - ((PNDIS_MINIPORT_BLOCK)_H)->FilterDbs.EthDB); \ -} - -#else - -#define NdisMEthIndicateReceiveComplete( _H ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->EthRxCompleteHandler)( \ - ((PNDIS_MINIPORT_BLOCK)_H)->EthDB); \ -} - -#endif - - -/*++ - -VOID -NdisMTrIndicateReceiveComplete( - IN NDIS_HANDLE MiniportHandle - ); - ---*/ -#ifdef __cplusplus -#define NdisMTrIndicateReceiveComplete( _H ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxCompleteHandler)( \ - ((PNDIS_MINIPORT_BLOCK)_H)->FilterDbs.TrDB); \ -} -#else -#define NdisMTrIndicateReceiveComplete( _H ) \ -{ \ - (*((PNDIS_MINIPORT_BLOCK)(_H))->TrRxCompleteHandler)( \ - ((PNDIS_MINIPORT_BLOCK)_H)->TrDB); \ -} -#endif - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMIndicateStatus( - __in NDIS_HANDLE MiniportHandle, - __in NDIS_STATUS GeneralStatus, - __in_bcount(StatusBufferSize) - PVOID StatusBuffer, - __in UINT StatusBufferSize - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMIndicateStatusComplete( - __in NDIS_HANDLE MiniportHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMRegisterAdapterShutdownHandler( - __in NDIS_HANDLE MiniportHandle, - __in PVOID ShutdownContext, - __in ADAPTER_SHUTDOWN_HANDLER ShutdownHandler - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterAdapterShutdownHandler( - __in NDIS_HANDLE MiniportHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("NdisMQueryAdapterResources", "Obsolete") -EXPORT -NDIS_STATUS -NdisMPciAssignResources( - __in NDIS_HANDLE MiniportHandle, - __in ULONG SlotNumber, - __out PNDIS_RESOURCE_LIST * AssignedResources - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIMNotifyPnPEvent( - __in NDIS_HANDLE MiniportHandle, - __in PNET_PNP_EVENT NetPnPEvent - ); - -#endif // NDIS_LEGACY_MINIPORT - - -// -// Logging support for miniports -// - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMCreateLog( - __in NDIS_HANDLE MiniportAdapterHandle, - __in UINT Size, - __out PNDIS_HANDLE LogHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMCloseLog( - __in NDIS_HANDLE LogHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMWriteLogData( - __in NDIS_HANDLE LogHandle, - __in_bcount(LogBufferSize) - PVOID LogBuffer, - __in UINT LogBufferSize - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMFlushLog( - __in NDIS_HANDLE LogHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMGetDeviceProperty( - __in NDIS_HANDLE MiniportAdapterHandle, - __inout_opt PDEVICE_OBJECT * PhysicalDeviceObject, - __inout_opt PDEVICE_OBJECT * FunctionalDeviceObject, - __inout_opt PDEVICE_OBJECT * NextDeviceObject, - __inout_opt PCM_RESOURCE_LIST * AllocatedResources, - __inout_opt PCM_RESOURCE_LIST * AllocatedResourcesTranslated - ); - -// -// Get a pointer to the adapter's localized instance name. -// -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMQueryAdapterInstanceName( - __out PNDIS_STRING pAdapterInstanceName, - __in NDIS_HANDLE MiniportHandle - ); - - -#if NDIS_LEGACY_MINIPORT - -// -// NDIS 5.0 extensions for miniports -// - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoIndicateReceivePacket( - __in NDIS_HANDLE NdisVcHandle, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -NdisMCoIndicateStatus( - __in NDIS_HANDLE MiniportAdapterHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in NDIS_STATUS GeneralStatus, - __in_bcount_opt(StatusBufferSize) - PVOID StatusBuffer, - __in ULONG StatusBufferSize - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoReceiveComplete( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoSendComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in PNDIS_PACKET Packet - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoRequestComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_REQUEST Request - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMCmRequest( - __in NDIS_HANDLE NdisAfHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __inout PNDIS_REQUEST NdisRequest - ); - -#endif // NDIS_LEGACY_MINIPORT - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoActivateVcComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMCoDeactivateVcComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle - ); - -EXPORT -NDIS_STATUS -NdisMCmRegisterAddressFamily( - IN NDIS_HANDLE MiniportAdapterHandle, - IN PCO_ADDRESS_FAMILY AddressFamily, - IN PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics, - IN UINT SizeOfCmCharacteristics - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -NdisMCmCreateVc( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_HANDLE NdisAfHandle, - __in NDIS_HANDLE MiniportVcContext, - __out PNDIS_HANDLE NdisVcHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMCmDeleteVc( - __in NDIS_HANDLE NdisVcHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMCmActivateVc( - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMCmDeactivateVc( - __in NDIS_HANDLE NdisVcHandle - ); - - -#if NDIS_LEGACY_MINIPORT - -// EXPORT -// VOID -// NdisMCmRequestComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisAfHandle, -// IN NDIS_HANDLE NdisVcHandle OPTIONAL, -// IN NDIS_HANDLE NdisPartyHandle OPTIONAL, -// IN PNDIS_REQUEST NdisRequest -// ); -#define NdisMCmRequestComplete(_S_, _AH_, _VH_, _PH_, _R_) \ - NdisCoRequestComplete(_S_, _AH_, _VH_, _PH_, _R_) -#endif // NDIS_LEGACY_MINIPORT - -#if (NDIS_SUPPORT_NDIS6 || NDIS60) - -// EXPORT -// VOID -// NdisMCmOidRequestComplete( -// IN NDIS_HANDLE NdisAfHandle, -// IN NDIS_HANDLE NdisVcHandle OPTIONAL, -// IN NDIS_HANDLE NdisPartyHandle OPTIONAL, -// IN PNDIS_OID_REQUEST OidRequest, -// IN NDIS_STATUS Status -// ); -#define NdisMCmOidRequestComplete(_AH_, _VH_, _PH_, _R_, _S_) \ - NdisCoOidRequestComplete(_AH_, _VH_, _PH_, _R_, _S_) -#endif // NDIS_SUPPORT_NDIS6 || NDIS60 - - -// EXPORT -// VOID -// NdisMCmOpenAddressFamilyComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisAfHandle, -// IN NDIS_HANDLE CallMgrAfContext -// ); - -#define NdisMCmOpenAddressFamilyComplete(_S_, _H_, _C_) \ - NdisCmOpenAddressFamilyComplete(_S_, _H_, _C_) -// EXPORT -// NDIS_STATUS -// NdisMCmNotifyCloseAddressFamily( -// IN NDIS_HANDLE NdisAfHandle -// ); - -#define NdisMCmNotifyCloseAddressFamily(_AH_) \ - NdisCmNotifyCloseAddressFamily(_AH_) - -// EXPORT -// VOID -// NdisMCmCloseAddressFamilyComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisAfHandle -// ); - -#define NdisMCmCloseAddressFamilyComplete(_S_, _H_) \ - NdisCmCloseAddressFamilyComplete(_S_, _H_) - - - -// EXPORT -// VOID -// NdisMCmRegisterSapComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisSapHandle, -// IN NDIS_HANDLE CallMgrSapContext -// ); - -#define NdisMCmRegisterSapComplete(_S_, _H_, _C_) \ - NdisCmRegisterSapComplete(_S_, _H_, _C_) - - -// EXPORT -// VOID -// NdisMCmDeregisterSapComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisSapHandle -// ); - -#define NdisMCmDeregisterSapComplete(_S_, _H_) \ - NdisCmDeregisterSapComplete(_S_, _H_) - - -// EXPORT -// VOID -// NdisMCmMakeCallComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisVcHandle, -// IN NDIS_HANDLE NdisPartyHandle OPTIONAL, -// IN NDIS_HANDLE CallMgrPartyContext OPTIONAL, -// IN PCO_CALL_PARAMETERS CallParameters -// ); - -#define NdisMCmMakeCallComplete(_S_, _VH_, _PH_, _CC_, _CP_) \ - NdisCmMakeCallComplete(_S_, _VH_, _PH_, _CC_, _CP_) - - -// EXPORT -// VOID -// NdisMCmCloseCallComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisVcHandle, -// IN NDIS_HANDLE NdisPartyHandle OPTIONAL -// ); - -#define NdisMCmCloseCallComplete(_S_, _VH_, _PH_) \ - NdisCmCloseCallComplete(_S_, _VH_, _PH_) - - -// EXPORT -// VOID -// NdisMCmAddPartyComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisPartyHandle, -// IN NDIS_HANDLE CallMgrPartyContext OPTIONAL, -// IN PCO_CALL_PARAMETERS CallParameters -// ); - -#define NdisMCmAddPartyComplete(_S_, _H_, _C_, _P_) \ - NdisCmAddPartyComplete(_S_, _H_, _C_, _P_) - - -// EXPORT -// VOID -// NdisMCmDropPartyComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisPartyHandle -// ); - -#define NdisMCmDropPartyComplete(_S_, _H_) \ - NdisCmDropPartyComplete(_S_, _H_) - - -// EXPORT -// NDIS_STATUS -// NdisMCmDispatchIncomingCall( -// IN NDIS_HANDLE NdisSapHandle, -// IN NDIS_HANDLE NdisVcHandle, -// IN PCO_CALL_PARAMETERS CallParameters -// ); - -#define NdisMCmDispatchIncomingCall(_SH_, _VH_, _CP_) \ - NdisCmDispatchIncomingCall(_SH_, _VH_, _CP_) - - -// EXPORT -// VOID -// NdisMCmDispatchCallConnected( -// IN NDIS_HANDLE NdisVcHandle -// ); - -#define NdisMCmDispatchCallConnected(_H_) \ - NdisCmDispatchCallConnected(_H_) - - -// EXPORT -// NdisMCmModifyCallQoSComplete( -// IN NDIS_STATUS Status, -// IN NDIS_HANDLE NdisVcHandle, -// IN PCO_CALL_PARAMETERS CallParameters -// ); - -#define NdisMCmModifyCallQoSComplete(_S_, _H_, _P_) \ - NdisCmModifyCallQoSComplete(_S_, _H_, _P_) - - -// EXPORT -// VOID -// VOID -// NdisMCmDispatchIncomingCallQoSChange( -// IN NDIS_HANDLE NdisVcHandle, -// IN PCO_CALL_PARAMETERS CallParameters -// ); - -#define NdisMCmDispatchIncomingCallQoSChange(_H_, _P_) \ - NdisCmDispatchIncomingCallQoSChange(_H_, _P_) - - -// EXPORT -// VOID -// NdisMCmDispatchIncomingCloseCall( -// IN NDIS_STATUS CloseStatus, -// IN NDIS_HANDLE NdisVcHandle, -// IN PVOID Buffer OPTIONAL, -// IN UINT Size -// ); - -#define NdisMCmDispatchIncomingCloseCall(_S_, _H_, _B_, _Z_) \ - NdisCmDispatchIncomingCloseCall(_S_, _H_, _B_, _Z_) - - -// EXPORT -// VOID -// NdisMCmDispatchIncomingDropParty( -// IN NDIS_STATUS DropStatus, -// IN NDIS_HANDLE NdisPartyHandle, -// IN PVOID Buffer OPTIONAL, -// IN UINT Size -// ); -#define NdisMCmDispatchIncomingDropParty(_S_, _H_, _B_, _Z_) \ - NdisCmDispatchIncomingDropParty(_S_, _H_, _B_, _Z_) - - -#if NDIS_SUPPORT_NDIS6 - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterScatterGatherDma( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_SG_DMA_DESCRIPTION DmaDescription, - __out PNDIS_HANDLE NdisMiniportDmaHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterScatterGatherDma( - __in NDIS_HANDLE NdisMiniportDmaHandle - ); - -// -// flags used in the call to NdisMAllocateNetBufferSGList -// -#define NDIS_SG_LIST_WRITE_TO_DEVICE 0x000000001 - - -__checkReturn -__drv_requiresIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMAllocateNetBufferSGList( - __in NDIS_HANDLE NdisMiniportDmaHandle, - __in PNET_BUFFER NetBuffer, - __in __drv_isObjectPointer - PVOID Context, - __in ULONG Flags, - __in_bcount_opt(ScatterGatherListBufferSize) __drv_isObjectPointer - PVOID ScatterGatherListBuffer, - __in ULONG ScatterGatherListBufferSize - ); - -__drv_requiresIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMFreeNetBufferSGList( - __in NDIS_HANDLE NdisMiniportDmaHandle, - __in PSCATTER_GATHER_LIST pSGL, - __in PNET_BUFFER NetBuffer - ); - - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMRegisterMiniportDriver( - __in PDRIVER_OBJECT DriverObject, - __in PUNICODE_STRING RegistryPath, - __in_opt NDIS_HANDLE MiniportDriverContext, - __in PNDIS_MINIPORT_DRIVER_CHARACTERISTICS MiniportDriverCharacteristics, - __out PNDIS_HANDLE NdisMiniportDriverHandle - ); - -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisMDeregisterMiniportDriver( - __in NDIS_HANDLE NdisMiniportDriverHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMPauseComplete( - __in NDIS_HANDLE MiniportAdapterHandle - ); - -EXPORT -VOID -NdisMRestartComplete( - IN NDIS_HANDLE MiniportAdapterHandle, - IN NDIS_STATUS Status - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMOidRequestComplete( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMSendNetBufferListsComplete( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG SendCompleteFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMIndicateReceiveNetBufferLists( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNET_BUFFER_LIST NetBufferList, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG NumberOfNetBufferLists, - __in ULONG ReceiveFlags - ); - - -// -// IO workitem routines -// - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_HANDLE -NdisAllocateIoWorkItem( - __in NDIS_HANDLE NdisObjectHandle - ); - -typedef -VOID -(NDIS_IO_WORKITEM_FUNCTION)( - IN PVOID WorkItemContext, - IN NDIS_HANDLE NdisIoWorkItemHandle - ); -typedef NDIS_IO_WORKITEM_FUNCTION (*NDIS_IO_WORKITEM_ROUTINE); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisQueueIoWorkItem( - __in NDIS_HANDLE NdisIoWorkItemHandle, - __in NDIS_IO_WORKITEM_ROUTINE Routine, - __in __drv_isObjectPointer PVOID WorkItemContext - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFreeIoWorkItem( - __in NDIS_HANDLE NdisIoWorkItemHandle - ); - -// -// CONDIS 6.0 extensions -// - -EXPORT -VOID -NdisMCoSendNetBufferListsComplete( - IN NDIS_HANDLE NdisVcHandle, - IN PNET_BUFFER_LIST NetBufferLists, - IN ULONG SendCompleteFlags - ); - -EXPORT -VOID -NdisMCoIndicateReceiveNetBufferLists( - IN NDIS_HANDLE NdisVcHandle, - IN PNET_BUFFER_LIST NetBufferLists, - IN ULONG NumberOfNetBufferLists, - IN ULONG CoReceiveFlags - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMNetPnPEvent( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNET_PNP_EVENT_NOTIFICATION NetPnPEventNotification - ); - - -#if NDIS_SUPPORT_NDIS6 -__drv_maxIRQL(DISPATCH_LEVEL) -#endif NDIS_SUPPORT_NDIS6 -EXPORT -VOID -NdisMResetComplete( - __in NDIS_HANDLE MiniportAdapterHandle, - __in NDIS_STATUS Status, - __in BOOLEAN AddressingReset - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -ULONG -NdisMGetBusData( - __in NDIS_HANDLE NdisMiniportHandle, - __in ULONG WhichSpace, - __in ULONG Offset, - __out_bcount_full(Length) PVOID Buffer, - __in ULONG Length - ); - -EXPORT -ULONG -NdisMSetBusData( - IN NDIS_HANDLE NdisMiniportHandle, - IN ULONG WhichSpace, - IN ULONG Offset, - IN PVOID Buffer, - IN ULONG Length - ); - -// -// NDIS port APIs -// - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMAllocatePort( - __in NDIS_HANDLE NdisMiniportHandle, - __inout PNDIS_PORT_CHARACTERISTICS PortCharacteristics - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisMFreePort( - __in NDIS_HANDLE NdisMiniportHandle, - __in NDIS_PORT_NUMBER PortNumber - ); - -#if (NDIS_SUPPORT_NDIS61) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisMDirectOidRequestComplete( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef enum _NDIS_MSIX_TABLE_CONFIG -{ - NdisMSIXTableConfigSetTableEntry, - NdisMSIXTableConfigMaskTableEntry, - NdisMSIXTableConfigUnmaskTableEntry, - NdisMSIXTableConfigMax -}NDIS_MSIX_TABLE_OPERATION, *PNDIS_MSIX_TABLE_OPERATION; - -#define NDIS_MSIX_CONFIG_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_MSIX_CONFIG_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - NDIS_MSIX_TABLE_OPERATION ConfigOperation; - ULONG TableEntry; - ULONG MessageNumber; -}NDIS_MSIX_CONFIG_PARAMETERS, *PNDIS_MSIX_CONFIG_PARAMETERS; - -#define NDIS_SIZEOF_MSIX_CONFIG_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_MSIX_CONFIG_PARAMETERS, MessageNumber) - -EXPORT -NDIS_STATUS -NdisMConfigMSIXTableEntry( - __in NDIS_HANDLE NdisMiniportHandle, - __in PNDIS_MSIX_CONFIG_PARAMETERS MSIXConfigParameters - ); - -#endif // (NDIS_SUPPORT_NDIS61) - -#endif // NDIS_SUPPORT_NDIS6 - - -#pragma once - -typedef struct _CO_CALL_PARAMETERS CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS; -typedef struct _CO_MEDIA_PARAMETERS CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS; - -// -// CoNdis client only handler proto-types - used by clients of call managers -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_OPEN_AF_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolAfContext, - __in NDIS_HANDLE NdisAfHandle - ); - -typedef PROTOCOL_CL_OPEN_AF_COMPLETE (*CL_OPEN_AF_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_CLOSE_AF_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolAfContext - ); - -typedef PROTOCOL_CL_CLOSE_AF_COMPLETE (*CL_CLOSE_AF_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_REGISTER_SAP_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolSapContext, - __in PCO_SAP Sap, - __in NDIS_HANDLE NdisSapHandle - ); - -typedef PROTOCOL_CL_REGISTER_SAP_COMPLETE (*CL_REG_SAP_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_DEREGISTER_SAP_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolSapContext - ); - -typedef PROTOCOL_CL_DEREGISTER_SAP_COMPLETE (*CL_DEREG_SAP_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_MAKE_CALL_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE NdisPartyHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CL_MAKE_CALL_COMPLETE (*CL_MAKE_CALL_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_CLOSE_CALL_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolVcContext, - __in_opt NDIS_HANDLE ProtocolPartyContext - ); - -typedef PROTOCOL_CL_CLOSE_CALL_COMPLETE (*CL_CLOSE_CALL_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_ADD_PARTY_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolPartyContext, - __in NDIS_HANDLE NdisPartyHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CL_ADD_PARTY_COMPLETE (*CL_ADD_PARTY_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_DROP_PARTY_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolPartyContext - ); - -typedef PROTOCOL_CL_DROP_PARTY_COMPLETE (*CL_DROP_PARTY_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CL_INCOMING_CALL)( - __in NDIS_HANDLE ProtocolSapContext, - __in NDIS_HANDLE ProtocolVcContext, - __inout PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CL_INCOMING_CALL (*CL_INCOMING_CALL_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_CALL_CONNECTED)( - __in NDIS_HANDLE ProtocolVcContext - ); - -typedef PROTOCOL_CL_CALL_CONNECTED (*CL_CALL_CONNECTED_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_INCOMING_CLOSE_CALL)( - __in NDIS_STATUS CloseStatus, - __in NDIS_HANDLE ProtocolVcContext, - __in_opt PVOID CloseData, - __in_opt UINT Size - ); - -typedef PROTOCOL_CL_INCOMING_CLOSE_CALL (*CL_INCOMING_CLOSE_CALL_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_INCOMING_DROP_PARTY)( - __in NDIS_STATUS DropStatus, - __in NDIS_HANDLE ProtocolPartyContext, - __in_opt PVOID CloseData, - __in_opt UINT Size - ); - -typedef PROTOCOL_CL_INCOMING_DROP_PARTY (*CL_INCOMING_DROP_PARTY_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_MODIFY_CALL_QOS_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE ProtocolVcContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CL_MODIFY_CALL_QOS_COMPLETE (*CL_MODIFY_CALL_QOS_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CL_INCOMING_CALL_QOS_CHANGE)( - __in NDIS_HANDLE ProtocolVcContext, - __in PCO_CALL_PARAMETERS CallParameters - ); -typedef PROTOCOL_CL_INCOMING_CALL_QOS_CHANGE (*CL_INCOMING_CALL_QOS_CHANGE_HANDLER); - -#if NDIS_LEGACY_PROTOCOL -typedef struct _NDIS_CLIENT_CHARACTERISTICS -{ - UCHAR MajorVersion; - UCHAR MinorVersion; - - USHORT Filler; - UINT Reserved; - - CO_CREATE_VC_HANDLER ClCreateVcHandler; - CO_DELETE_VC_HANDLER ClDeleteVcHandler; - CO_REQUEST_HANDLER ClRequestHandler; - CO_REQUEST_COMPLETE_HANDLER ClRequestCompleteHandler; - CL_OPEN_AF_COMPLETE_HANDLER ClOpenAfCompleteHandler; - CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler; - CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler; - CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler; - CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler; - CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler; - CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler; - CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler; - CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler; - CL_INCOMING_CALL_HANDLER ClIncomingCallHandler; - CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler; - CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler; - CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler; - CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler; - -} NDIS_CLIENT_CHARACTERISTICS, *PNDIS_CLIENT_CHARACTERISTICS; -#endif // NDIS_LEGACY_PROTOCOL - -// -// CoNdis call-manager only handler proto-types - used by call managers only -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_OPEN_AF)( - __in NDIS_HANDLE CallMgrBindingContext, - __in PCO_ADDRESS_FAMILY AddressFamily, - __in NDIS_HANDLE NdisAfHandle, - __out PNDIS_HANDLE CallMgrAfContext - ); - -typedef PROTOCOL_CM_OPEN_AF (*CM_OPEN_AF_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_CLOSE_AF)( - __in NDIS_HANDLE CallMgrAfContext - ); - -typedef PROTOCOL_CM_CLOSE_AF (*CM_CLOSE_AF_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_REG_SAP)( - __in NDIS_HANDLE CallMgrAfContext, - __in PCO_SAP Sap, - __in NDIS_HANDLE NdisSapHandle, - __out PNDIS_HANDLE CallMgrSapContext - ); - -typedef PROTOCOL_CM_REG_SAP (*CM_REG_SAP_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_DEREGISTER_SAP)( - __in NDIS_HANDLE CallMgrSapContext - ); - -typedef PROTOCOL_CM_DEREGISTER_SAP (*CM_DEREG_SAP_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_MAKE_CALL)( - __in NDIS_HANDLE CallMgrVcContext, - __inout PCO_CALL_PARAMETERS CallParameters, - __in_opt NDIS_HANDLE NdisPartyHandle, - __out_opt PNDIS_HANDLE CallMgrPartyContext - ); - -typedef PROTOCOL_CM_MAKE_CALL (*CM_MAKE_CALL_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_CLOSE_CALL)( - __in NDIS_HANDLE CallMgrVcContext, - __in_opt NDIS_HANDLE CallMgrPartyContext, - __in_opt PVOID CloseData, - __in_opt UINT Size - ); - -typedef PROTOCOL_CM_CLOSE_CALL (*CM_CLOSE_CALL_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_MODIFY_QOS_CALL)( - __in NDIS_HANDLE CallMgrVcContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CM_MODIFY_QOS_CALL (*CM_MODIFY_CALL_QOS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CM_INCOMING_CALL_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE CallMgrVcContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CM_INCOMING_CALL_COMPLETE (*CM_INCOMING_CALL_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CM_ACTIVATE_VC_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE CallMgrVcContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - -typedef PROTOCOL_CM_ACTIVATE_VC_COMPLETE (*CM_ACTIVATE_VC_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(PROTOCOL_CM_DEACTIVATE_VC_COMPLETE)( - __in NDIS_STATUS Status, - __in NDIS_HANDLE CallMgrVcContext - ); - -typedef PROTOCOL_CM_DEACTIVATE_VC_COMPLETE (*CM_DEACTIVATE_VC_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_ADD_PARTY)( - __in NDIS_HANDLE CallMgrVcContext, - __inout PCO_CALL_PARAMETERS CallParameters, - __in NDIS_HANDLE NdisPartyHandle, - __out PNDIS_HANDLE CallMgrPartyContext - ); - -typedef PROTOCOL_CM_ADD_PARTY (*CM_ADD_PARTY_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(PROTOCOL_CM_DROP_PARTY)( - __in NDIS_HANDLE CallMgrPartyContext, - __in_opt PVOID CloseData, - __in_opt UINT Size - ); - -typedef PROTOCOL_CM_DROP_PARTY (*CM_DROP_PARTY_HANDLER); - -#if NDIS_LEGACY_DRIVER - -typedef struct _NDIS_CALL_MANAGER_CHARACTERISTICS -{ - UCHAR MajorVersion; - UCHAR MinorVersion; - USHORT Filler; - UINT Reserved; - - CO_CREATE_VC_HANDLER CmCreateVcHandler; - CO_DELETE_VC_HANDLER CmDeleteVcHandler; - CM_OPEN_AF_HANDLER CmOpenAfHandler; - CM_CLOSE_AF_HANDLER CmCloseAfHandler; - CM_REG_SAP_HANDLER CmRegisterSapHandler; - CM_DEREG_SAP_HANDLER CmDeregisterSapHandler; - CM_MAKE_CALL_HANDLER CmMakeCallHandler; - CM_CLOSE_CALL_HANDLER CmCloseCallHandler; - CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler; - CM_ADD_PARTY_HANDLER CmAddPartyHandler; - CM_DROP_PARTY_HANDLER CmDropPartyHandler; - CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler; - CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler; - CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler; - CO_REQUEST_HANDLER CmRequestHandler; - CO_REQUEST_COMPLETE_HANDLER CmRequestCompleteHandler; - -} NDIS_CALL_MANAGER_CHARACTERISTICS, *PNDIS_CALL_MANAGER_CHARACTERISTICS; - -#endif // NDIS_LEGACY_DRIVER - -// -// this send flag is used on ATM net cards to set ( turn on ) the CLP bit -// (Cell Loss Priority) bit -// -#define CO_SEND_FLAG_SET_DISCARD_ELIBILITY 0x00000001 - -// -// the Address structure used on NDIS_CO_ADD_ADDRESS or NDIS_CO_DELETE_ADDRESS -// -typedef struct _CO_ADDRESS -{ - ULONG AddressSize; - UCHAR Address[1]; -} CO_ADDRESS, *PCO_ADDRESS; - -// -// the list of addresses returned from the CallMgr on a NDIS_CO_GET_ADDRESSES -// -typedef struct _CO_ADDRESS_LIST -{ - ULONG NumberOfAddressesAvailable; - ULONG NumberOfAddresses; - CO_ADDRESS AddressList; -} CO_ADDRESS_LIST, *PCO_ADDRESS_LIST; - -#ifndef FAR -#define FAR -#endif -#include - -typedef struct _CO_SPECIFIC_PARAMETERS -{ - ULONG ParamType; - ULONG Length; - UCHAR Parameters[1]; -} CO_SPECIFIC_PARAMETERS, *PCO_SPECIFIC_PARAMETERS; - -typedef struct _CO_CALL_MANAGER_PARAMETERS -{ - FLOWSPEC Transmit; - FLOWSPEC Receive; - CO_SPECIFIC_PARAMETERS CallMgrSpecific; -} CO_CALL_MANAGER_PARAMETERS, *PCO_CALL_MANAGER_PARAMETERS; - - -// -// this is the generic portion of the media parameters, including the media -// specific component too. -// -typedef struct _CO_MEDIA_PARAMETERS -{ - ULONG Flags; - ULONG ReceivePriority; - ULONG ReceiveSizeHint; - CO_SPECIFIC_PARAMETERS POINTER_ALIGNMENT MediaSpecific; -} CO_MEDIA_PARAMETERS, *PCO_MEDIA_PARAMETERS; - - -// -// definitions for the flags in CO_MEDIA_PARAMETERS -// -#define RECEIVE_TIME_INDICATION 0x00000001 -#define USE_TIME_STAMPS 0x00000002 -#define TRANSMIT_VC 0x00000004 -#define RECEIVE_VC 0x00000008 -#define INDICATE_ERRED_PACKETS 0x00000010 -#define INDICATE_END_OF_TX 0x00000020 -#define RESERVE_RESOURCES_VC 0x00000040 -#define ROUND_DOWN_FLOW 0x00000080 -#define ROUND_UP_FLOW 0x00000100 -// -// define a flag to set in the flags of an Ndis packet when the miniport -// indicates a receive with an error in it -// -#define ERRED_PACKET_INDICATION 0x00000001 - -// -// this is the structure passed during call-setup -// -typedef struct _CO_CALL_PARAMETERS -{ - ULONG Flags; - PCO_CALL_MANAGER_PARAMETERS CallMgrParameters; - PCO_MEDIA_PARAMETERS MediaParameters; -} CO_CALL_PARAMETERS, *PCO_CALL_PARAMETERS; - -// -// Definitions for the Flags in CO_CALL_PARAMETERS -// -#define PERMANENT_VC 0x00000001 -#define CALL_PARAMETERS_CHANGED 0x00000002 -#define QUERY_CALL_PARAMETERS 0x00000004 -#define BROADCAST_VC 0x00000008 -#define MULTIPOINT_VC 0x00000010 - -// -// The format of the Request for adding/deleting a PVC -// -typedef struct _CO_PVC -{ - NDIS_HANDLE NdisAfHandle; - CO_SPECIFIC_PARAMETERS PvcParameters; -} CO_PVC,*PCO_PVC; - - - -// -// NDIS 5.0 Extensions for protocols -// -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoAssignInstanceName( - __in NDIS_HANDLE NdisVcHandle, - __in PNDIS_STRING BaseInstanceName, - __out_opt PNDIS_STRING VcInstanceName - ); - -#if NDIS_LEGACY_PROTOCOL -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCoSendPackets( - __in NDIS_HANDLE NdisVcHandle, - __in PPNDIS_PACKET PacketArray, - __in UINT NumberOfPackets - ); - -#endif // NDIS_LEGACY_PROTOCOL - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoCreateVc( - __in NDIS_HANDLE NdisBindingHandle, - __in_opt NDIS_HANDLE NdisAfHandle, // For CM signalling VCs - __in NDIS_HANDLE ProtocolVcContext, - __inout PNDIS_HANDLE NdisVcHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoDeleteVc( - __in NDIS_HANDLE NdisVcHandle - ); - -#if NDIS_LEGACY_PROTOCOL -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in_opt NDIS_HANDLE NdisAfHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __inout PNDIS_REQUEST NdisRequest - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCoRequestComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisAfHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __in PNDIS_REQUEST NdisRequest - ); - -#endif // NDIS_LEGACY_PROTOCOL - -#ifndef __NDISTAPI_VAR_STRING_DECLARED -#define __NDISTAPI_VAR_STRING_DECLARED - -typedef struct _VAR_STRING -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulStringFormat; - ULONG ulStringSize; - ULONG ulStringOffset; - -} VAR_STRING, *PVAR_STRING; - -#endif // __NDISTAPI_VAR_STRING_DECLARED - - -#ifndef __NDISTAPI_STRINGFORMATS_DEFINED -#define __NDISTAPI_STRINGFORMATS_DEFINED - -#define STRINGFORMAT_ASCII 0x00000001 -#define STRINGFORMAT_DBCS 0x00000002 -#define STRINGFORMAT_UNICODE 0x00000003 -#define STRINGFORMAT_BINARY 0x00000004 - -#endif // __NDISTAPI_STRINGFORMATS_DEFINED - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoGetTapiCallId( - __in NDIS_HANDLE NdisVcHandle, - __inout PVAR_STRING TapiCallId - ); - -#if NDIS_LEGACY_PROTOCOL -// -// Client Apis -// -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisClOpenAddressFamily( - __in NDIS_HANDLE NdisBindingHandle, - __in PCO_ADDRESS_FAMILY AddressFamily, - __in NDIS_HANDLE ProtocolAfContext, - __in PNDIS_CLIENT_CHARACTERISTICS ClCharacteristics, - __in UINT SizeOfClCharacteristics, - __out PNDIS_HANDLE NdisAfHandle - ); - -#endif // NDIS_LEGACY_PROTOCOL - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClCloseAddressFamily( - __in NDIS_HANDLE NdisAfHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClRegisterSap( - __in NDIS_HANDLE NdisAfHandle, - __in NDIS_HANDLE ProtocolSapContext, - __in PCO_SAP Sap, - __out PNDIS_HANDLE NdisSapHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClDeregisterSap( - __in NDIS_HANDLE NdisSapHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClMakeCall( - __in NDIS_HANDLE NdisVcHandle, - __inout PCO_CALL_PARAMETERS CallParameters, - __in_opt NDIS_HANDLE ProtocolPartyContext, - __out_opt PNDIS_HANDLE NdisPartyHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClCloseCall( - __in NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __in_bcount_opt(Size) PVOID Buffer, - __in UINT Size - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClModifyCallQoS( - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisClIncomingCallComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClAddParty( - __in NDIS_HANDLE NdisVcHandle, - __in NDIS_HANDLE ProtocolPartyContext, - __inout PCO_CALL_PARAMETERS CallParameters, - __out PNDIS_HANDLE NdisPartyHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClDropParty( - __in NDIS_HANDLE NdisPartyHandle, - __in_bcount_opt(Size) PVOID Buffer, - __in_opt UINT Size - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisClGetProtocolVcContextFromTapiCallId( - __in UNICODE_STRING TapiCallId, - __out PNDIS_HANDLE ProtocolVcContext - ); - -// -// Call Manager Apis -// - -#if NDIS_LEGACY_DRIVER -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisCmRegisterAddressFamily( - __in NDIS_HANDLE NdisBindingHandle, - __in PCO_ADDRESS_FAMILY AddressFamily, - __in PNDIS_CALL_MANAGER_CHARACTERISTICS CmCharacteristics, - __in UINT SizeOfCmCharacteristics - ); - -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmOpenAddressFamilyComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisAfHandle, - __in NDIS_HANDLE CallMgrAfContext - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmCloseAddressFamilyComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisAfHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmRegisterSapComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisSapHandle, - __in NDIS_HANDLE CallMgrSapContext - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDeregisterSapComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisSapHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCmActivateVc( - __in NDIS_HANDLE NdisVcHandle, - __inout PCO_CALL_PARAMETERS CallParameters - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCmDeactivateVc( - __in NDIS_HANDLE NdisVcHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmMakeCallComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __in_opt NDIS_HANDLE CallMgrPartyContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmCloseCallComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmAddPartyComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisPartyHandle, - __in_opt NDIS_HANDLE CallMgrPartyContext, - __in PCO_CALL_PARAMETERS CallParameters - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDropPartyComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisPartyHandle - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCmDispatchIncomingCall( - __in NDIS_HANDLE NdisSapHandle, - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDispatchCallConnected( - __in NDIS_HANDLE NdisVcHandle - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmModifyCallQoSComplete( - __in NDIS_STATUS Status, - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDispatchIncomingCallQoSChange( - __in NDIS_HANDLE NdisVcHandle, - __in PCO_CALL_PARAMETERS CallParameters - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDispatchIncomingCloseCall( - __in NDIS_STATUS CloseStatus, - __in NDIS_HANDLE NdisVcHandle, - __in_bcount_opt(Size) PVOID Buffer, - __in UINT Size - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCmDispatchIncomingDropParty( - __in NDIS_STATUS DropStatus, - __in NDIS_HANDLE NdisPartyHandle, - __in_bcount_opt(Size) PVOID Buffer, - __in UINT Size - ); - -#if (NDIS_SUPPORT_NDIS6) - -// -// CONDIS 6.0 extensions -// -#define NDIS_CO_CLIENT_OPTIONAL_HANDLERS_REVISION_1 1 - -typedef struct _NDIS_CO_CLIENT_OPTIONAL_HANDLERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Reserved; - - CO_CREATE_VC_HANDLER ClCreateVcHandler; - CO_DELETE_VC_HANDLER ClDeleteVcHandler; - CO_OID_REQUEST_HANDLER ClOidRequestHandler; - CO_OID_REQUEST_COMPLETE_HANDLER ClOidRequestCompleteHandler; - CL_OPEN_AF_COMPLETE_HANDLER_EX ClOpenAfCompleteHandlerEx; - CL_CLOSE_AF_COMPLETE_HANDLER ClCloseAfCompleteHandler; - CL_REG_SAP_COMPLETE_HANDLER ClRegisterSapCompleteHandler; - CL_DEREG_SAP_COMPLETE_HANDLER ClDeregisterSapCompleteHandler; - CL_MAKE_CALL_COMPLETE_HANDLER ClMakeCallCompleteHandler; - CL_MODIFY_CALL_QOS_COMPLETE_HANDLER ClModifyCallQoSCompleteHandler; - CL_CLOSE_CALL_COMPLETE_HANDLER ClCloseCallCompleteHandler; - CL_ADD_PARTY_COMPLETE_HANDLER ClAddPartyCompleteHandler; - CL_DROP_PARTY_COMPLETE_HANDLER ClDropPartyCompleteHandler; - CL_INCOMING_CALL_HANDLER ClIncomingCallHandler; - CL_INCOMING_CALL_QOS_CHANGE_HANDLER ClIncomingCallQoSChangeHandler; - CL_INCOMING_CLOSE_CALL_HANDLER ClIncomingCloseCallHandler; - CL_INCOMING_DROP_PARTY_HANDLER ClIncomingDropPartyHandler; - CL_CALL_CONNECTED_HANDLER ClCallConnectedHandler; - CL_NOTIFY_CLOSE_AF_HANDLER ClNotifyCloseAfHandler; -}NDIS_CO_CLIENT_OPTIONAL_HANDLERS, *PNDIS_CO_CLIENT_OPTIONAL_HANDLERS; - -#define NDIS_SIZEOF_CO_CLIENT_OPTIONAL_HANDLERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_CO_CLIENT_OPTIONAL_HANDLERS, ClNotifyCloseAfHandler) - -#define NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS_REVISION_1 1 - -typedef struct _NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Reserved; - CO_CREATE_VC_HANDLER CmCreateVcHandler; - CO_DELETE_VC_HANDLER CmDeleteVcHandler; - CM_OPEN_AF_HANDLER CmOpenAfHandler; - CM_CLOSE_AF_HANDLER CmCloseAfHandler; - CM_REG_SAP_HANDLER CmRegisterSapHandler; - CM_DEREG_SAP_HANDLER CmDeregisterSapHandler; - CM_MAKE_CALL_HANDLER CmMakeCallHandler; - CM_CLOSE_CALL_HANDLER CmCloseCallHandler; - CM_INCOMING_CALL_COMPLETE_HANDLER CmIncomingCallCompleteHandler; - CM_ADD_PARTY_HANDLER CmAddPartyHandler; - CM_DROP_PARTY_HANDLER CmDropPartyHandler; - CM_ACTIVATE_VC_COMPLETE_HANDLER CmActivateVcCompleteHandler; - CM_DEACTIVATE_VC_COMPLETE_HANDLER CmDeactivateVcCompleteHandler; - CM_MODIFY_CALL_QOS_HANDLER CmModifyCallQoSHandler; - CO_OID_REQUEST_HANDLER CmOidRequestHandler; - CO_OID_REQUEST_COMPLETE_HANDLER CmOidRequestCompleteHandler; - CM_NOTIFY_CLOSE_AF_COMPLETE_HANDLER CmNotifyCloseAfCompleteHandler; - -} NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS, *PNDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS; - -#define NDIS_SIZEOF_CO_CALL_MANAGER_OPTIONAL_HANDLERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_CO_CALL_MANAGER_OPTIONAL_HANDLERS, CmOidRequestCompleteHandler) - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCoSendNetBufferLists( - __in NDIS_HANDLE NdisVcHandle, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG SendFlags - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisCoOidRequest( - __in NDIS_HANDLE NdisBindingHandle, - __in_opt NDIS_HANDLE NdisAfHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __inout PNDIS_OID_REQUEST OidRequest - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisCoOidRequestComplete( - __in NDIS_HANDLE NdisAfHandle, - __in_opt NDIS_HANDLE NdisVcHandle, - __in_opt NDIS_HANDLE NdisPartyHandle, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisClOpenAddressFamilyEx ( - __in NDIS_HANDLE NdisBindingHandle, - __in PCO_ADDRESS_FAMILY AddressFamily, - __in NDIS_HANDLE ClientAfContext, - __out PNDIS_HANDLE NdisAfHandle - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisCmRegisterAddressFamilyEx( - __in NDIS_HANDLE NdisBindingHandle, - __in PCO_ADDRESS_FAMILY AddressFamily - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisMCmRegisterAddressFamilyEx( - __in NDIS_HANDLE MiniportAdapterHandle, - __in PCO_ADDRESS_FAMILY AddressFamily - ); - -__checkReturn -__drv_requiresIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisCmNotifyCloseAddressFamily ( - __in NDIS_HANDLE NdisAfHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisClNotifyCloseAddressFamilyComplete ( - __in NDIS_HANDLE NdisAfHandle, - __in NDIS_STATUS Status - ); - - -#endif // NDIS_SUPPORT_NDIS6 - - -#pragma once - -#if NDIS_SUPPORT_NDIS6 -// -// Ndis Light Weight filters -// - - -// -// init / de-init -// - -// -// Flags used in NDIS_FILTER_ATTACH_PARAMETERS -// - -#define NDIS_FILTER_ATTACH_FLAGS_IGNORE_MANDATORY 0x00000001 // If a mandatory filter fails to attach, it can set the flag - // to ask NDIS to ignore it is a mandatory filter - - -#define NDIS_FILTER_ATTACH_PARAMETERS_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_FILTER_ATTACH_PARAMETERS_REVISION_2 2 -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_FILTER_ATTACH_PARAMETERS_REVISION_3 3 -#endif // (NDIS_SUPPORT_NDIS61) - -typedef struct _NDIS_FILTER_ATTACH_PARAMETERS -{ - __in NDIS_OBJECT_HEADER Header; - __in NET_IFINDEX IfIndex; - __in NET_LUID NetLuid; - __in PNDIS_STRING FilterModuleGuidName; - __in NET_IFINDEX BaseMiniportIfIndex; - __in PNDIS_STRING BaseMiniportInstanceName; - __in PNDIS_STRING BaseMiniportName; - __in NDIS_MEDIA_CONNECT_STATE MediaConnectState; - __in NET_IF_MEDIA_DUPLEX_STATE MediaDuplexState; - __in ULONG64 XmitLinkSpeed; - __in ULONG64 RcvLinkSpeed; - __inout NDIS_MEDIUM MiniportMediaType; - __inout NDIS_PHYSICAL_MEDIUM MiniportPhysicalMediaType; - __in NDIS_HANDLE MiniportMediaSpecificAttributes; - __in PNDIS_OFFLOAD DefaultOffloadConfiguration; - __in USHORT MacAddressLength; - __in UCHAR CurrentMacAddress[NDIS_MAX_PHYS_ADDRESS_LENGTH]; - __in NET_LUID BaseMiniportNetLuid; - __in NET_IFINDEX LowerIfIndex; - __in NET_LUID LowerIfNetLuid; - __inout ULONG Flags; -#if (NDIS_SUPPORT_NDIS61) - __in PNDIS_HD_SPLIT_CURRENT_CONFIG HDSplitCurrentConfig; -#endif // (NDIS_SUPPORT_NDIS61) -#if (NDIS_SUPPORT_NDIS620) - __in PNDIS_RECEIVE_FILTER_CAPABILITIES ReceiveFilterCapabilities; - __in PDEVICE_OBJECT MiniportPhysicalDeviceObject; - __in PNDIS_NIC_SWITCH_CAPABILITIES NicSwitchCapabilities; -#endif -} NDIS_FILTER_ATTACH_PARAMETERS, *PNDIS_FILTER_ATTACH_PARAMETERS; -#define NDIS_SIZEOF_FILTER_ATTACH_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_ATTACH_PARAMETERS, Flags) - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_SIZEOF_FILTER_ATTACH_PARAMETERS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_ATTACH_PARAMETERS, HDSplitCurrentConfig) -#endif // (NDIS_SUPPORT_NDIS61) - -#if (NDIS_SUPPORT_NDIS620) -#define NDIS_SIZEOF_FILTER_ATTACH_PARAMETERS_REVISION_3 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_ATTACH_PARAMETERS, NicSwitchCapabilities) -#endif // (NDIS_SUPPORT_NDIS620) - - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(FILTER_ATTACH)( - __in NDIS_HANDLE NdisFilterHandle, - __in NDIS_HANDLE FilterDriverContext, - __in PNDIS_FILTER_ATTACH_PARAMETERS AttachParameters - ); - -typedef FILTER_ATTACH (*FILTER_ATTACH_HANDLER); - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -(FILTER_DETACH)( - __in NDIS_HANDLE FilterModuleContext - ); - -typedef FILTER_DETACH (*FILTER_DETACH_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(FILTER_SET_MODULE_OPTIONS)( - __in NDIS_HANDLE FilterModuleContext - ); - -typedef FILTER_SET_MODULE_OPTIONS (*FILTER_SET_FILTER_MODULE_OPTIONS_HANDLER); - - -// -// NDIS_FILTER_RESTART_PARAMETERS is used in FILTER_RESTART handler -// -#define NDIS_FILTER_RESTART_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_FILTER_RESTART_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - NDIS_MEDIUM MiniportMediaType; - NDIS_PHYSICAL_MEDIUM MiniportPhysicalMediaType; - PNDIS_RESTART_ATTRIBUTES RestartAttributes; - NET_IFINDEX LowerIfIndex; - NET_LUID LowerIfNetLuid; - ULONG Flags; -} NDIS_FILTER_RESTART_PARAMETERS, *PNDIS_FILTER_RESTART_PARAMETERS; - -#define NDIS_SIZEOF__FILTER_RESTART_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_RESTART_PARAMETERS, Flags) - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(FILTER_RESTART)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_FILTER_RESTART_PARAMETERS RestartParameters - ); -typedef FILTER_RESTART (*FILTER_RESTART_HANDLER); - -#define NDIS_FILTER_PAUSE_PARAMETERS_REVISION_1 1 - -typedef struct _NDIS_FILTER_PAUSE_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; - ULONG PauseReason; -} NDIS_FILTER_PAUSE_PARAMETERS, *PNDIS_FILTER_PAUSE_PARAMETERS; - -#define NDIS_SIZEOF_FILTER_PAUSE_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_PAUSE_PARAMETERS, PauseReason) - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(FILTER_PAUSE)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_FILTER_PAUSE_PARAMETERS PauseParameters - ); - -typedef FILTER_PAUSE (*FILTER_PAUSE_HANDLER); -// -// inbound requests/data -// - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(FILTER_OID_REQUEST)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_OID_REQUEST OidRequest - ); - -typedef FILTER_OID_REQUEST (*FILTER_OID_REQUEST_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_CANCEL_OID_REQUEST)( - __in NDIS_HANDLE FilterModuleContext, - __in PVOID RequestId - ); - -typedef FILTER_CANCEL_OID_REQUEST (*FILTER_CANCEL_OID_REQUEST_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_SEND_NET_BUFFER_LISTS)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_BUFFER_LIST NetBufferList, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG SendFlags - ); - -typedef FILTER_SEND_NET_BUFFER_LISTS (*FILTER_SEND_NET_BUFFER_LISTS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_CANCEL_SEND_NET_BUFFER_LISTS)( - __in NDIS_HANDLE FilterModuleContext, - __in PVOID CancelId - ); - -typedef FILTER_CANCEL_SEND_NET_BUFFER_LISTS (*FILTER_CANCEL_SEND_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_RETURN_NET_BUFFER_LISTS)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG ReturnFlags - ); - -typedef FILTER_RETURN_NET_BUFFER_LISTS (*FILTER_RETURN_NET_BUFFER_LISTS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_SEND_NET_BUFFER_LISTS_COMPLETE)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG SendCompleteFlags - ); - -typedef FILTER_SEND_NET_BUFFER_LISTS_COMPLETE (*FILTER_SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_RECEIVE_NET_BUFFER_LISTS)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_BUFFER_LIST NetBufferLists, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG NumberOfNetBufferLists, - __in ULONG ReceiveFlags - ); - -typedef FILTER_RECEIVE_NET_BUFFER_LISTS (*FILTER_RECEIVE_NET_BUFFER_LISTS_HANDLER); - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -(FILTER_DEVICE_PNP_EVENT_NOTIFY)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_DEVICE_PNP_EVENT NetDevicePnPEvent - ); - -typedef FILTER_DEVICE_PNP_EVENT_NOTIFY (*FILTER_DEVICE_PNP_EVENT_NOTIFY_HANDLER); - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(FILTER_NET_PNP_EVENT)( - __in NDIS_HANDLE FilterModuleContext, - __in PNET_PNP_EVENT_NOTIFICATION NetPnPEventNotification - ); - -typedef FILTER_NET_PNP_EVENT (*FILTER_NET_PNP_EVENT_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_STATUS)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_STATUS_INDICATION StatusIndication - ); - -typedef FILTER_STATUS (*FILTER_STATUS_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_OID_REQUEST_COMPLETE)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef FILTER_OID_REQUEST_COMPLETE (*FILTER_OID_REQUEST_COMPLETE_HANDLER); -#if (NDIS_SUPPORT_NDIS61) -// -// NDIS 6.1 filter's entry points -// -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -NDIS_STATUS -(FILTER_DIRECT_OID_REQUEST)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_OID_REQUEST OidRequest - ); - -typedef FILTER_DIRECT_OID_REQUEST (*FILTER_DIRECT_OID_REQUEST_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_DIRECT_OID_REQUEST_COMPLETE)( - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -typedef FILTER_DIRECT_OID_REQUEST_COMPLETE (*FILTER_DIRECT_OID_REQUEST_COMPLETE_HANDLER); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(FILTER_CANCEL_DIRECT_OID_REQUEST)( - __in NDIS_HANDLE FilterModuleContext, - __in PVOID RequestId - ); - -typedef FILTER_CANCEL_DIRECT_OID_REQUEST (*FILTER_CANCEL_DIRECT_OID_REQUEST_HANDLER); -#endif (NDIS_SUPPORT_NDIS61) - -#define NDIS_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_FILTER_PARTIAL_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_FILTER_PARTIAL_CHARACTERISTICS - ULONG Flags; - FILTER_SEND_NET_BUFFER_LISTS_HANDLER SendNetBufferListsHandler; - FILTER_SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER SendNetBufferListsCompleteHandler; - FILTER_CANCEL_SEND_HANDLER CancelSendNetBufferListsHandler; - FILTER_RECEIVE_NET_BUFFER_LISTS_HANDLER ReceiveNetBufferListsHandler; - FILTER_RETURN_NET_BUFFER_LISTS_HANDLER ReturnNetBufferListsHandler; -} NDIS_FILTER_PARTIAL_CHARACTERISTICS, *PNDIS_FILTER_PARTIAL_CHARACTERISTICS; - -#define NDIS_SIZEOF_FILTER_PARTIAL_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_PARTIAL_CHARACTERISTICS, ReturnNetBufferListsHandler) - -// -// Filter driver flags -// -#define NDIS_FILTER_DRIVER_MANDATORY 0x00000001 - -#define NDIS_FILTER_CHARACTERISTICS_REVISION_1 1 - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_FILTER_CHARACTERISTICS_REVISION_2 2 -#endif // (NDIS_SUPPORT_NDIS61) - -typedef struct _NDIS_FILTER_DRIVER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - UCHAR MajorNdisVersion; - UCHAR MinorNdisVersion; - UCHAR MajorDriverVersion; - UCHAR MinorDriverVersion; - ULONG Flags; - NDIS_STRING FriendlyName; - NDIS_STRING UniqueName; - NDIS_STRING ServiceName; - SET_OPTIONS_HANDLER SetOptionsHandler; - FILTER_SET_FILTER_MODULE_OPTIONS_HANDLER SetFilterModuleOptionsHandler; - FILTER_ATTACH_HANDLER AttachHandler; - FILTER_DETACH_HANDLER DetachHandler; - FILTER_RESTART_HANDLER RestartHandler; - FILTER_PAUSE_HANDLER PauseHandler; - FILTER_SEND_NET_BUFFER_LISTS_HANDLER SendNetBufferListsHandler; - FILTER_SEND_NET_BUFFER_LISTS_COMPLETE_HANDLER SendNetBufferListsCompleteHandler; - FILTER_CANCEL_SEND_HANDLER CancelSendNetBufferListsHandler; - FILTER_RECEIVE_NET_BUFFER_LISTS_HANDLER ReceiveNetBufferListsHandler; - FILTER_RETURN_NET_BUFFER_LISTS_HANDLER ReturnNetBufferListsHandler; - FILTER_OID_REQUEST_HANDLER OidRequestHandler; - FILTER_OID_REQUEST_COMPLETE_HANDLER OidRequestCompleteHandler; - FILTER_CANCEL_OID_REQUEST_HANDLER CancelOidRequestHandler; - FILTER_DEVICE_PNP_EVENT_NOTIFY_HANDLER DevicePnPEventNotifyHandler; - FILTER_NET_PNP_EVENT_HANDLER NetPnPEventHandler; - FILTER_STATUS_HANDLER StatusHandler; -#if (NDIS_SUPPORT_NDIS61) - FILTER_DIRECT_OID_REQUEST_HANDLER DirectOidRequestHandler; - FILTER_DIRECT_OID_REQUEST_COMPLETE_HANDLER DirectOidRequestCompleteHandler; - FILTER_CANCEL_DIRECT_OID_REQUEST_HANDLER CancelDirectOidRequestHandler; -#endif // (NDIS_SUPPORT_NDIS61) -} NDIS_FILTER_DRIVER_CHARACTERISTICS, *PNDIS_FILTER_DRIVER_CHARACTERISTICS; -#define NDIS_SIZEOF_FILTER_DRIVER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_DRIVER_CHARACTERISTICS, StatusHandler) - -#if (NDIS_SUPPORT_NDIS61) -#define NDIS_SIZEOF_FILTER_DRIVER_CHARACTERISTICS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_DRIVER_CHARACTERISTICS, CancelDirectOidRequestHandler) -#endif //(NDIS_SUPPORT_NDIS61) - -#define NDIS_FILTER_ATTRIBUTES_REVISION_1 1 - -typedef struct _NDIS_FILTER_ATTRIBUTES -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; -} NDIS_FILTER_ATTRIBUTES, *PNDIS_FILTER_ATTRIBUTES; - -#define NDIS_SIZEOF_FILTER_ATTRIBUTES_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_FILTER_ATTRIBUTES, Flags) - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisFRegisterFilterDriver( - __in PDRIVER_OBJECT DriverObject, - __in NDIS_HANDLE FilterDriverContext, - __in PNDIS_FILTER_DRIVER_CHARACTERISTICS FilterDriverCharacteristics, - __out PNDIS_HANDLE NdisFilterDriverHandle - ); - - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisFDeregisterFilterDriver( - __in NDIS_HANDLE NdisFilterDriverHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisFSetAttributes( - __in NDIS_HANDLE NdisFilterHandle, - __in NDIS_HANDLE FilterModuleContext, - __in PNDIS_FILTER_ATTRIBUTES FilterAttributes - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisFRestartFilter( - __in NDIS_HANDLE NdisFilterHandle - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFSendNetBufferLists( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_BUFFER_LIST NetBufferList, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG SendFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFReturnNetBufferLists( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_BUFFER_LIST NetBufferLists, - __in ULONG ReturnFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFSendNetBufferListsComplete( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_BUFFER_LIST NetBufferList, - __in ULONG SendCompleteFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFIndicateReceiveNetBufferLists( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_BUFFER_LIST NetBufferLists, - __in NDIS_PORT_NUMBER PortNumber, - __in ULONG NumberOfNetBufferLists, - __in ULONG ReceiveFlags - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisFOidRequest( - __in NDIS_HANDLE NdisFilterHandle, - __in PNDIS_OID_REQUEST OidRequest - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFOidRequestComplete( - __in NDIS_HANDLE NdisFilterHandle, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFIndicateStatus( - __in NDIS_HANDLE NdisFilterHandle, - __in PNDIS_STATUS_INDICATION StatusIndication - ); - - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisFRestartComplete( - __in NDIS_HANDLE NdisFilterHandle, - __in NDIS_STATUS Status - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFPauseComplete( - __in NDIS_HANDLE NdisFilterHandle - ); - - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisFDevicePnPEventNotify( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_DEVICE_PNP_EVENT NetDevicePnPEvent - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisFNetPnPEvent( - __in NDIS_HANDLE NdisFilterHandle, - __in PNET_PNP_EVENT_NOTIFICATION NetPnPEventNotification - ); - - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFCancelSendNetBufferLists( - __in NDIS_HANDLE NdisFilterHandle, - __in PVOID CancelId - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFCancelOidRequest( - __in NDIS_HANDLE NdisFilterHandle, - __in PVOID RequestId - ); - -#if (NDIS_SUPPORT_NDIS61) -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -NDIS_STATUS -NdisFDirectOidRequest( - __in NDIS_HANDLE NdisFilterHandle, - __in PNDIS_OID_REQUEST OidRequest - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFDirectOidRequestComplete( - __in NDIS_HANDLE NdisFilterHandle, - __in PNDIS_OID_REQUEST OidRequest, - __in NDIS_STATUS Status - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -EXPORT -VOID -NdisFCancelDirectOidRequest( - __in NDIS_HANDLE NdisFilterHandle, - __in PVOID RequestId - ); - -#endif // (NDIS_SUPPORT_NDIS61) - -#endif // NDIS_SUPPORT_NDIS6 - -#pragma once - -#if (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -// -// NDIS IF data structures, function prototypes and macros -// - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(*IFP_QUERY_OBJECT)( - __in NDIS_HANDLE ProviderIfContext, - __in NET_IF_OBJECT_ID ObjectId, - __inout PULONG pOutputBufferLength, - __out PVOID pOutputBuffer - ); - -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -NDIS_STATUS -(*IFP_SET_OBJECT)( - __in NDIS_HANDLE ProviderIfContext, - __in NET_IF_OBJECT_ID ObjectId, - __in ULONG InputBufferLength, - __in PVOID pInputBuffer - ); - - -typedef struct _NDIS_IF_PROVIDER_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; - - // - // Generic query and set handlers: - // - IFP_QUERY_OBJECT QueryObjectHandler; - IFP_SET_OBJECT SetObjectHandler; - - PVOID Reserved1; - PVOID Reserved2; - -} NDIS_IF_PROVIDER_CHARACTERISTICS, *PNDIS_IF_PROVIDER_CHARACTERISTICS; - -#define NDIS_SIZEOF_IF_PROVIDER_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_IF_PROVIDER_CHARACTERISTICS, Reserved2) - -// -// NET_IF_INFORMATION is passed to NdisIfRegisterInterface -// -typedef struct _NET_IF_INFORMATION -{ - NDIS_OBJECT_HEADER Header; - ULONG Flags; // Misc. information - NET_PHYSICAL_LOCATION PhysicalLocation; // physical location on machine - ULONG WanTunnelType; // tunnelIfEncapsMethod (RFC 2667) - ULONG PortNumber; // for WAN devices. - NET_IF_ACCESS_TYPE AccessType; - NET_IF_DIRECTION_TYPE DirectionType; - NET_IF_CONNECTION_TYPE ConnectionType; - BOOLEAN ifConnectorPresent; - USHORT PhysAddressLength; // in bytes (ifPhysAddress). this is -current- mac address - USHORT PhysAddressOffset; // from beginning of this struct - USHORT PermanentPhysAddressOffset; // from beginning of this struct - // - // The "friendly name" represents ifDescr: - // - USHORT FriendlyNameLength; // in bytes - USHORT FriendlyNameOffset; // from beginning of this struct - GUID InterfaceGuid; - NET_IF_NETWORK_GUID NetworkGuid; - ULONG SupportedStatistics; - NDIS_MEDIUM MediaType; - NDIS_PHYSICAL_MEDIUM PhysicalMediumType; -} NET_IF_INFORMATION, *PNET_IF_INFORMATION; - - -#define NDIS_SIZEOF_NET_IF_INFORMATION_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_IF_INFORMATION, PhysicalMediumType) - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfRegisterProvider( - __in PNDIS_IF_PROVIDER_CHARACTERISTICS ProviderCharacteristics, - __in NDIS_HANDLE IfProviderContext, - __out PNDIS_HANDLE pNdisIfProviderHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisIfDeregisterProvider( - __in NDIS_HANDLE NdisProviderHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfAllocateNetLuidIndex( - __in NET_IFTYPE ifType, - __out PUINT32 pNetLuidIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfFreeNetLuidIndex( - __in NET_IFTYPE ifType, - __in UINT32 NetLuidIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfRegisterInterface( - __in NDIS_HANDLE NdisProviderHandle, - __in NET_LUID NetLuid, - __in NDIS_HANDLE ProviderIfContext, - __in PNET_IF_INFORMATION pIfInfo, - __out PNET_IFINDEX pfIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisIfDeregisterInterface( - __in NET_IFINDEX ifIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfGetInterfaceIndexFromNetLuid( - __in NET_LUID NetLuid, - __out PNET_IFINDEX pIfIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfGetNetLuidFromInterfaceIndex( - __in NET_IFINDEX ifIndex, - __out PNET_LUID pNetLuid - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfQueryBindingIfIndex( - __in NDIS_HANDLE NdisBindingHandle, - __out PNET_IFINDEX pBoundIfIndex, - __out PNET_LUID pBoundIfNetLuid, - __out PNET_IFINDEX pLowestIfIndex, - __out PNET_LUID pLowestIfNetLuid - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -NDIS_STATUS -NdisIfAddIfStackEntry( - __in NET_IFINDEX HigherLayerIfIndex, - __in NET_IFINDEX LowerLayerIfIndex - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -EXPORT -VOID -NdisIfDeleteIfStackEntry( - __in NET_IFINDEX HigherLayerIfIndex, - __in NET_IFINDEX LowerLayerIfIndex - ); - -#endif // (NDIS_SUPPORT_NDIS6 || defined(NDIS60)) - -#endif // _NDIS_ - diff --git a/qt-correction-tool/pub/ddk/ndischimney.h b/qt-correction-tool/pub/ddk/ndischimney.h deleted file mode 100644 index d3a61d0..0000000 --- a/qt-correction-tool/pub/ddk/ndischimney.h +++ /dev/null @@ -1,973 +0,0 @@ -#ifndef _CHIMNEY_OFFLOAD_ -#define _CHIMNEY_OFFLOAD_ - -#pragma once - -#if (defined(NDIS60) || NDIS_WRAPPER || defined(NDIS61) || defined(NDIS620)) - -// -// This is the encapsulation type used by the stack for TCP connection offload -// -typedef struct _NDIS_TCP_CONNECTION_OFFLOAD_ENCAPSULATION -{ - struct - { - UCHAR Enabled; - ULONG EncapsulationType; - ULONG HeaderSize; - }V4; - struct - { - UCHAR Enabled; - ULONG EncapsulationType; - ULONG HeaderSize; - }V6; - -}NDIS_TCP_CONNECTION_OFFLOAD_ENCAPSULATION, NDIS_TCP_CONNECTION_OFFLOAD_ENCAPSULATION; -// -// These are the parameters that the stack sets on the NIC to use during -// connection offload by setting OID OID_TCP_CONNECTION_OFFLOAD_PARAMETERS -// - -// -// Header.Type = NDIS_OBJECT_TYPE_DEFAULT; -// Header.Revision = NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS_1; -// Header.Size = sizeof(NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS); -// -#define NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS_1 1 -#if NDIS_SUPPORT_NDIS61 -#define NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS_2 2 -#endif // NDIS_SUPPORT_NDIS61 - -typedef struct _NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS -{ - NDIS_OBJECT_HEADER Header; - NDIS_OFFLOAD_ENCAPSULATION Encapsulation; - ULONG TicksPerSecond; - UCHAR TcpAckFrequency; - UCHAR TcpDelayedAckTicks; - UCHAR TcpMaximumRetransmissions; - UCHAR TcpDoubtReachabilityRetransmissions; - ULONG TcpSwsPreventionTicks; - ULONG TcpDuplicateAckThreshold; - ULONG TcpPushTicks; - ULONG NceStaleTicks; -#if NDIS_SUPPORT_NDIS61 - ULONG CongestionAlgorithm; -#endif // NDIS_SUPPORT_NDIS61 -} NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS, *PNDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS; - -#define NDIS_SIZEOF_TCP_CONNECTION_OFFLOAD_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS, NceStaleTicks) -#if NDIS_SUPPORT_NDIS61 -#define NDIS_SIZEOF_TCP_CONNECTION_OFFLOAD_PARAMETERS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_TCP_CONNECTION_OFFLOAD_PARAMETERS, CongestionAlgorithm) -#endif // NDIS_SUPPORT_NDIS61 - -// -// NDIS_CHIMNEY_OFFLOAD_TYPE -// -// Specifies the chimney type. -// -typedef enum -{ - NdisTcpChimneyOffload = 1, - NdisIpsecChimneyOffload, - NdisRdmaChimneyOffload, - NdisMaxChimneyOffload -} NDIS_CHIMNEY_OFFLOAD_TYPE, *PNDIS_CHIMNEY_OFFLOAD_TYPE; - -// -// INDICATE_OFFLOAD_EVENT -// -// Qualifies a Offload Event indication. -// -typedef enum -{ - NeighborReachabilityInDoubt = 0x0001, - NeighborReachabilityQuery, - MaxOffloadEvent -} INDICATE_OFFLOAD_EVENT, *PINDICATE_OFFLOAD_EVENT; - -// -// OFFLOAD_STATE_TYPE -// -// State type at each layer in the stack. -// -typedef enum -{ - NeighborOffloadConstState = 0x1, - NeighborOffloadCachedState, - NeighborOffloadDelegatedState, - NeighborOffloadState, - Ip4OffloadConstState, - Ip4OffloadCachedState, - Ip4OffloadDelegatedState, - Ip4OffloadState, - Ip6OffloadConstState, - Ip6OffloadCachedState, - Ip6OffloadDelegatedState, - Ip6OffloadState, - TcpOffloadConstState, - TcpOffloadCachedState, - TcpOffloadDelegatedState, - TcpOffloadResourceState, - TcpOffloadState, - FilterReservedOffloadState = 0xFE, - MaximumOffloadState -} OFFLOAD_STATE_TYPE, *POFFLOAD_STATE_TYPE; - -// -// OFFLOAD_STATE_HEADER -// -// Offload state header, precedes each offload state. -// -typedef struct _OFFLOAD_STATE_HEADER -{ - ULONG Length; - ULONG RecognizedOptions; -} OFFLOAD_STATE_HEADER, *POFFLOAD_STATE_HEADER; - -// -// -// TCP_OFFLOAD_CONNECTION_STATE -// -// TCP connection state [RFC 793]. -// -typedef enum -{ - TcpConnectionClosed, - TcpConnectionListen, - TcpConnectionSynSent, - TcpConnectionSynRcvd, - TcpConnectionEstablished, - TcpConnectionFinWait1, - TcpConnectionFinWait2, - TcpConnectionCloseWait, - TcpConnectionClosing, - TcpConnectionLastAck, - TcpConnectionTimeWait, - TcpConnectionMaxState -} TCP_OFFLOAD_CONNECTION_STATE, *PTCP_OFFLOAD_CONNECTION_STATE; - -// -// TCP_UPLOAD_REASON -// -// Reason for upoloading an offloaded TCP connection back to the host. -// -typedef enum -{ - LowActivity = 1, - HighDropRate, - SmallIO, - NoBufferProposting, - ReceivedUrgentData, - HighFragmentation, - HighOutOfOrderPackets, - TimeoutExpiration, - InvalidState, - UploadRequested, - HardwareFailure, - MaxUploadReason -} TCP_UPLOAD_REASON, *PTCP_UPLOAD_REASON; - -// -// Qualifies a disconnect event or a disconnect request on a TCP connection. -// -#define TCP_DISCONNECT_GRACEFUL_CLOSE 0x01 -#define TCP_DISCONNECT_ABORTIVE_CLOSE 0x02 - -// -// TCP_OFFLOAD_EVENT_TYPE -// -// Event indications possible on an offloaded TCP connection. -// -typedef enum -{ - TcpIndicateSendBacklogChange = 1, - TcpIndicateDisconnect, - TcpIndicateRetrieve, - TcpIndicateAbort -} TCP_OFFLOAD_EVENT_TYPE, *PTCP_OFFLOAD_EVENT_TYPE; - - -// -// Flags part of the TCP constant state. -// -#define TCP_FLAG_TIMESTAMP_ENABLED 0x01 -#define TCP_FLAG_SACK_ENABLED 0x02 -#define TCP_FLAG_WINDOW_SCALING_ENABLED 0x04 - -// -// TCP_OFFLOAD_STATE_CONST -// -// Constant fields of a Connection. -// -typedef struct _TCP_OFFLOAD_STATE_CONST -{ - OFFLOAD_STATE_HEADER Header; - USHORT Flags; - USHORT RemotePort; - USHORT LocalPort; - UCHAR SndWindScale: 4; - UCHAR RcvWindScale: 4; - USHORT RemoteMss; - ULONG HashValue; -} TCP_OFFLOAD_STATE_CONST, *PTCP_OFFLOAD_STATE_CONST; - -// -// Flags part of the TCP cached state. -// -#define TCP_FLAG_KEEP_ALIVE_ENABLED 0x01 -#define TCP_FLAG_NAGLING_ENABLED 0x02 -#define TCP_FLAG_KEEP_ALIVE_RESTART 0x04 -#define TCP_FLAG_MAX_RT_RESTART 0x08 -#define TCP_FLAG_UPDATE_RCV_WND 0x10 - -// -// TCP_OFFLOAD_STATE_CACHED -// -// Cached fields of a TCB. -// -typedef struct _TCP_OFFLOAD_STATE_CACHED -{ - OFFLOAD_STATE_HEADER Header; - USHORT Flags; - ULONG InitialRcvWnd; - ULONG RcvIndicationSize; - UCHAR KaProbeCount; - ULONG KaTimeout; - ULONG KaInterval; - ULONG MaxRT; - ULONG FlowLabel:20; - UCHAR TtlOrHopLimit; - UCHAR TosOrTrafficClass; - UCHAR UserPriority:3; -} TCP_OFFLOAD_STATE_CACHED, *PTCP_OFFLOAD_STATE_CACHED; - -// -// TCP_OFFLOAD_STATE_DELEGATED -// -// Delegated fields of a TCB. -// -typedef struct _TCP_OFFLOAD_STATE_DELEGATED -{ - OFFLOAD_STATE_HEADER Header; - TCP_OFFLOAD_CONNECTION_STATE State; - USHORT Flags; - ULONG RcvNxt; - ULONG RcvWnd; - ULONG SndUna; - ULONG SndNxt; - ULONG SndMax; - ULONG SndWnd; - ULONG MaxSndWnd; - ULONG SendWL1; - ULONG CWnd; - ULONG SsThresh; - USHORT SRtt; - USHORT RttVar; - ULONG TsRecent; - ULONG TsRecentAge; - ULONG TsTime; - ULONG TotalRT; - UCHAR DupAckCount; - UCHAR SndWndProbeCount; - - struct - { - UCHAR ProbeCount; - ULONG TimeoutDelta; - } KeepAlive; - - struct - { - UCHAR Count; - ULONG TimeoutDelta; - } Retransmit; - - union - { - struct - { - PNET_BUFFER_LIST SendDataHead; - PNET_BUFFER_LIST SendDataTail; - }; - - ULONG SendBacklogSize; - }; - - union - { - PNET_BUFFER_LIST BufferedData; - ULONG ReceiveBacklogSize; - }; -#if NDIS_SUPPORT_NDIS61 - ULONG DWnd; -#endif // NDIS_SUPPORT_NDIS61 -} TCP_OFFLOAD_STATE_DELEGATED, *PTCP_OFFLOAD_STATE_DELEGATED; - -// -// PATH_OFFLOAD_STATE_CONST -// -// IP path constant parameters. -// -typedef struct _PATH_OFFLOAD_STATE_CONST -{ - OFFLOAD_STATE_HEADER Header; - CONST UCHAR *SourceAddress; - CONST UCHAR *DestinationAddress; -} PATH_OFFLOAD_STATE_CONST, *PPATH_OFFLOAD_STATE_CONST; - -// -// PATH_OFFLOAD_STATE_CACHED -// -// IP path cached parameters. -// -typedef struct _PATH_OFFLOAD_STATE_CACHED -{ - OFFLOAD_STATE_HEADER Header; - ULONG PathMtu; -} PATH_OFFLOAD_STATE_CACHED, *PPATH_OFFLOAD_STATE_CACHED; - -// -// PATH_OFFLOAD_STATE_DELEGATED -// -// IP path delegated parameters. -// -typedef struct _PATH_OFFLOAD_STATE_DELEGATED -{ - OFFLOAD_STATE_HEADER Header; -} PATH_OFFLOAD_STATE_DELEGATED, *PPATH_OFFLOAD_STATE_DELEGATED; - -// -// NEIGHBOR_OFFLOAD_STATE_CONST -// -// Neighbor const parameters. -// -typedef struct _NEIGHBOR_OFFLOAD_STATE_CONST -{ - OFFLOAD_STATE_HEADER Header; - UCHAR DlSourceAddress[32]; - ULONG VlanId: 12; -} NEIGHBOR_OFFLOAD_STATE_CONST, *PNEIGHBOR_OFFLOAD_STATE_CONST; - -// -// NEIGHBOR_OFFLOAD_STATE_CACHED -// -// Neighbor cached parameters. -// -typedef struct _NEIGHBOR_OFFLOAD_STATE_CACHED -{ - OFFLOAD_STATE_HEADER Header; - UCHAR DlDestinationAddress[32]; - ULONG HostReachabilityDelta; -} NEIGHBOR_OFFLOAD_STATE_CACHED, *PNEIGHBOR_OFFLOAD_STATE_CACHED; - -// -// NEIGHBOR_OFFLOAD_STATE_DELEGATED -// -// Neighbor cached parameters. -// -typedef struct _NEIGHBOR_OFFLOAD_STATE_DELEGATED -{ - OFFLOAD_STATE_HEADER Header; - ULONG NicReachabilityDelta; -} NEIGHBOR_OFFLOAD_STATE_DELEGATED, *PNEIGHBOR_OFFLOAD_STATE_DELEGATED; - - -// -// TCP_OFFLOAD_STATS -// -// Statistics definitions in TCP on a per interface basis -// -typedef struct _TCP_OFFLOAD_STATS -{ - ULONG64 InSegments; - ULONG64 OutSegments; - ULONG CurrentlyEstablished; - ULONG ResetEstablished; - ULONG RetransmittedSegments; - ULONG InErrors; - ULONG OutResets; -} TCP_OFFLOAD_STATS, *PTCP_OFFLOAD_STATS; - -// -// IP_OFFLOAD_STATS -// -// Stats definitions in IPV4/IPV6 on a per interface basis -// -typedef struct _IP_OFFLOAD_STATS -{ - ULONG64 InReceives; - ULONG64 InOctets; - ULONG64 InDelivers; - ULONG64 OutRequests; - ULONG64 OutOctets; - ULONG InHeaderErrors; - ULONG InTruncatedPackets; - ULONG InDiscards; - ULONG OutDiscards; - ULONG OutNoRoutes; -} IP_OFFLOAD_STATS, *PIP_OFFLOAD_STATS; - - -typedef struct _NDIS_OFFLOAD_HANDLE -{ - PVOID NdisReserved[1]; - PVOID MiniportOffloadContext; -} NDIS_OFFLOAD_HANDLE, *PNDIS_OFFLOAD_HANDLE; - - -// -// Internal wrapper sround NDIS_OFFLOAD_HANDLE. -// ProtocolBindingContext is required for handling Receive Indications in FL. -// -typedef struct _NDIS_OFFLOAD_HANDLE_PRIVATE -{ - NDIS_OFFLOAD_HANDLE Handle; - PVOID ProtocolBindingContext; -} NDIS_OFFLOAD_HANDLE_PRIVATE, *PNDIS_OFFLOAD_HANDLE_PRIVATE; - - -typedef struct _NDIS_PROTOCOL_OFFLOAD_BLOCK_LIST -{ - IN NDIS_OBJECT_HEADER Header; - IN struct _NDIS_PROTOCOL_OFFLOAD_BLOCK_LIST *NextBlock; - IN struct _NDIS_PROTOCOL_OFFLOAD_BLOCK_LIST *DependentBlockList; - OUT NDIS_STATUS Status; - IN PVOID NdisReserved[3]; - IN OUT PNDIS_OFFLOAD_HANDLE OffloadHandle; - IN PVOID ProtocolReserved[2]; - IN PVOID MiniportReserved[2]; - IN PVOID ImReserved[2]; - IN PVOID Scratch[2]; - IN PVOID SourceHandle; - IN NDIS_PORT_NUMBER PortNumber; - IN OUT PNET_BUFFER_LIST NetBufferListChain; - // - // The state specific information (if any) will follow this. - // -} NDIS_PROTOCOL_OFFLOAD_BLOCK_LIST, *PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST; - -// -// Generic offload functions supported by the protocol. -// -typedef -VOID -(*INITIATE_OFFLOAD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*TERMINATE_OFFLOAD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*INVALIDATE_OFFLOAD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*UPDATE_OFFLOAD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*QUERY_OFFLOAD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -// -// Generic indication handlers supported by the protocol. -// -typedef -VOID -(*INDICATE_OFFLOAD_EVENT_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList, - IN ULONG IndicationCode - ); - -// -// Tcp offload specific functions supported by the protocol, for completions. -// -typedef -VOID -(*TCP_OFFLOAD_SEND_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*TCP_OFFLOAD_RECV_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*TCP_OFFLOAD_DISCONNECT_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*TCP_OFFLOAD_FORWARD_COMPLETE_HANDLER)( - IN NDIS_HANDLE ProtocolBindingContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -// -// Tcp offload specific functions supported by the protocol, for indications. -// -typedef -VOID -(*TCP_OFFLOAD_EVENT_HANDLER)( - IN PVOID OffloadContext, - IN ULONG EventType, - IN ULONG EventSpecificInformation - ); - -typedef -NDIS_STATUS -(*TCP_OFFLOAD_RECEIVE_INDICATE_HANDLER)( - IN PVOID OffloadContext, - IN PNET_BUFFER_LIST NetBufferList, - IN NDIS_STATUS Status, - OUT PULONG BytesConsumed - ); - -typedef struct _NDIS_OFFLOAD_CLIENT_HANDLERS -{ - NDIS_OBJECT_HEADER Header; -} NDIS_OFFLOAD_CLIENT_HANDLERS, *PNDIS_OFFLOAD_CLIENT_HANDLERS; - -typedef struct _NDIS_TCP_OFFLOAD_CLIENT_HANDLERS -{ - NDIS_OBJECT_HEADER Header; - TCP_OFFLOAD_SEND_COMPLETE_HANDLER TcpOffloadSendCompleteHandler; - TCP_OFFLOAD_RECV_COMPLETE_HANDLER TcpOffloadReceiveCompleteHandler; - TCP_OFFLOAD_DISCONNECT_COMPLETE_HANDLER TcpOffloadDisconnectCompleteHandler; - TCP_OFFLOAD_FORWARD_COMPLETE_HANDLER TcpOffloadForwardCompleteHandler; - TCP_OFFLOAD_EVENT_HANDLER TcpOffloadEventHandler; - TCP_OFFLOAD_RECEIVE_INDICATE_HANDLER TcpOffloadReceiveIndicateHandler; -} NDIS_TCP_OFFLOAD_CLIENT_HANDLERS, *PNDIS_TCP_OFFLOAD_CLIENT_HANDLERS; - - -#define NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS - ULONG Flags; - // - // Generic Offload initiation and termination completion handlers. - // - INITIATE_OFFLOAD_COMPLETE_HANDLER InitiateOffloadCompleteHandler; - TERMINATE_OFFLOAD_COMPLETE_HANDLER TerminateOffloadCompleteHandler; - - // - // Generic offload state control request completion handlers. - // - UPDATE_OFFLOAD_COMPLETE_HANDLER UpdateOffloadCompleteHandler; - INVALIDATE_OFFLOAD_COMPLETE_HANDLER InvalidateOffloadCompleteHandler; - QUERY_OFFLOAD_COMPLETE_HANDLER QueryOffloadCompleteHandler; - - // - // Generic offload state indication handlers. - // - INDICATE_OFFLOAD_EVENT_HANDLER IndicateOffloadEventHandler; - -} NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS, *PNDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS; - -#define NDIS_SIZEOF_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_CLIENT_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS, IndicateOffloadEventHandler) - -#define NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS_REVISION_1 1 - -typedef struct _NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_CLIENT_CHIMNEY_OFFLOAD_CHARACTERISTICS - ULONG Flags; - NDIS_CHIMNEY_OFFLOAD_TYPE OffloadType; // NdisTcpChimneyOffload - TCP_OFFLOAD_SEND_COMPLETE_HANDLER TcpOffloadSendCompleteHandler; - TCP_OFFLOAD_RECV_COMPLETE_HANDLER TcpOffloadReceiveCompleteHandler; - TCP_OFFLOAD_DISCONNECT_COMPLETE_HANDLER TcpOffloadDisconnectCompleteHandler; - TCP_OFFLOAD_FORWARD_COMPLETE_HANDLER TcpOffloadForwardCompleteHandler; - TCP_OFFLOAD_EVENT_HANDLER TcpOffloadEventHandler; - TCP_OFFLOAD_RECEIVE_INDICATE_HANDLER TcpOffloadReceiveIndicateHandler; -} NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS, *PNDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS; - -#define NDIS_SIZEOF_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_CLIENT_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS, TcpOffloadReceiveIndicateHandler) - -// -// Generic offload functions supported by NDIS, for use by the protocol. -// -EXPORT -VOID -NdisInitiateOffload( - IN NDIS_HANDLE NdisBindingHandle, - IN OUT PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisTerminateOffload( - IN NDIS_HANDLE NdisBindingHandle, - IN OUT PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisInvalidateOffload( - IN NDIS_HANDLE NdisBindingHandle, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisUpdateOffload( - IN NDIS_HANDLE NdisBindingHandle, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisQueryOffloadState( - IN NDIS_HANDLE NdisBindingHandle, - IN PNDIS_PROTOCOL_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -// -// Tcp specific offload functions supported by NDIS, for use by the protocol. -// -EXPORT -NDIS_STATUS -NdisOffloadTcpSend( - IN PNDIS_OFFLOAD_HANDLE NdisOffloadHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -EXPORT -NDIS_STATUS -NdisOffloadTcpReceive( - IN PNDIS_OFFLOAD_HANDLE NdisOffloadHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -EXPORT -NDIS_STATUS -NdisOffloadTcpDisconnect( - IN PNDIS_OFFLOAD_HANDLE NdisOffloadHandle, - IN PNET_BUFFER_LIST NetBufferList, - IN ULONG Flags - ); - -EXPORT -NDIS_STATUS -NdisOffloadTcpForward( - IN PNDIS_OFFLOAD_HANDLE NdisOffloadHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -VOID -NdisOffloadTcpReceiveReturn( - IN NDIS_HANDLE NdisBindingHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef struct _NDIS_MINIPORT_OFFLOAD_BLOCK_LIST -{ - IN NDIS_OBJECT_HEADER Header; - IN struct _NDIS_MINIPORT_OFFLOAD_BLOCK_LIST *NextBlock; - IN struct _NDIS_MINIPORT_OFFLOAD_BLOCK_LIST *DependentBlockList; - OUT NDIS_STATUS Status; - IN PVOID NdisReserved[2]; - IN OUT PVOID *MiniportOffloadContext; - IN NDIS_HANDLE NdisOffloadHandle; - IN PVOID ProtocolReserved[2]; - IN PVOID MiniportReserved[2]; - IN PVOID ImReserved[2]; - IN PVOID Scratch[2]; - IN PVOID SourceHandle; - IN NDIS_PORT_NUMBER PortNumber; - IN OUT PNET_BUFFER_LIST NetBufferListChain; - // - // The state specific information (if any) will follow this. - // -} NDIS_MINIPORT_OFFLOAD_BLOCK_LIST, *PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST; - -// -// Generic offload functions supported by the miniport. -// -typedef -VOID -(*W_INITIATE_OFFLOAD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN OUT PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*W_TERMINATE_OFFLOAD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN OUT PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*W_INVALIDATE_OFFLOAD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*W_UPDATE_OFFLOAD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -typedef -VOID -(*W_QUERY_OFFLOAD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN OUT PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -// -// Tcp specific offload functions supported by the miniport. -// -typedef -NDIS_STATUS -(*W_TCP_OFFLOAD_SEND_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PVOID MiniportOffloadContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -NDIS_STATUS -(*W_TCP_OFFLOAD_RECEIVE_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PVOID MiniportOffloadContext, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -NDIS_STATUS -(*W_TCP_OFFLOAD_DISCONNECT_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PVOID MiniportOffloadContext, - IN PNET_BUFFER_LIST NetBufferList, - IN ULONG Flags - ); - -typedef -NDIS_STATUS -(*W_TCP_OFFLOAD_FORWARD_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PVOID MiniportOffloadContext, - IN PNET_BUFFER_LIST NetBufferList - ); - - -typedef -NDIS_STATUS -(*W_TCP_OFFLOAD_RECEIVE_RETURN_HANDLER)( - IN NDIS_HANDLE MiniportAdapterContext, - IN PNET_BUFFER_LIST NetBufferList - ); - - -typedef struct _NDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS - ULONG Flags; - - // - // Generic Offload initiation and termination handlers. - // - W_INITIATE_OFFLOAD_HANDLER InitiateOffloadHandler; - W_TERMINATE_OFFLOAD_HANDLER TerminateOffloadHandler; - - // - // Generic offload state control functions. - // - W_UPDATE_OFFLOAD_HANDLER UpdateOffloadHandler; - W_INVALIDATE_OFFLOAD_HANDLER InvalidateOffloadHandler; - W_QUERY_OFFLOAD_HANDLER QueryOffloadHandler; - -} NDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS, *PNDIS_PROVIDER_CHIMNEY_OFFLOAD_GENERIC_CHARACTERISTICS; - -typedef struct _NDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS -{ - NDIS_OBJECT_HEADER Header; // Header.Type = NDIS_OBJECT_TYPE_PROVIDER_CHIMNEY_OFFLOAD_CHARACTERISTICS - ULONG Flags; - NDIS_CHIMNEY_OFFLOAD_TYPE OffloadType; // NdisTcpChimneyOffload - // - // TCP function handlers - // - W_TCP_OFFLOAD_SEND_HANDLER TcpOffloadSendHandler; - W_TCP_OFFLOAD_RECEIVE_HANDLER TcpOffloadReceiveHandler; - W_TCP_OFFLOAD_DISCONNECT_HANDLER TcpOffloadDisconnectHandler; - W_TCP_OFFLOAD_FORWARD_HANDLER TcpOffloadForwardHandler; - - // - // Receive return handler. - // - W_TCP_OFFLOAD_RECEIVE_RETURN_HANDLER TcpOffloadReceiveReturnHandler; - -} NDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS, *PNDIS_PROVIDER_CHIMNEY_OFFLOAD_TCP_CHARACTERISTICS; - - - -// -// Generic offload functions supported by NDIS for use by the miniport. -// -EXPORT -VOID -NdisMInitiateOffloadComplete( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisMTerminateOffloadComplete( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisMInvalidateOffloadComplete( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisMUpdateOffloadComplete( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -EXPORT -VOID -NdisMQueryOffloadStateComplete( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList - ); - -// -// Generic offload event indication handlers. -// -EXPORT -VOID -NdisMOffloadEventIndicate( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNDIS_MINIPORT_OFFLOAD_BLOCK_LIST OffloadBlockList, - IN ULONG IndicationCode - ); - -// -// Tcp offload specific functions supported by NDIS used for completions. -// -typedef -VOID -(*NDIS_TCP_OFFLOAD_SEND_COMPLETE)( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*NDIS_TCP_OFFLOAD_RECEIVE_COMPLETE)( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*NDIS_TCP_OFFLOAD_DISCONNECT_COMPLETE)( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -typedef -VOID -(*NDIS_TCP_OFFLOAD_FORWARD_COMPLETE)( - IN NDIS_HANDLE NdisMiniportHandle, - IN PNET_BUFFER_LIST NetBufferList - ); - -// -// Tcp offload specific functions supported by NDIS used for indication. -// -typedef -VOID -(*NDIS_TCP_OFFLOAD_EVENT_INDICATE)( - IN NDIS_HANDLE NdisOffloadHandle, - IN ULONG EventType, - IN ULONG EventSpecificInformation - ); - -typedef -NDIS_STATUS -(*NDIS_TCP_OFFLOAD_RECEIVE_INDICATE)( - IN NDIS_HANDLE NdisOffloadHandle, - IN PNET_BUFFER_LIST NetBufferList, - IN NDIS_STATUS Status, - OUT PULONG BytesConsumed - ); - -typedef struct _NDIS_OFFLOAD_EVENT_HANDLERS -{ - NDIS_OBJECT_HEADER Header; -} NDIS_OFFLOAD_EVENT_HANDLERS, *PNDIS_OFFLOAD_EVENT_HANDLERS; - - -EXPORT -NDIS_STATUS -NdisMGetOffloadHandlers( - IN NDIS_HANDLE NdisMiniportHandle, - IN NDIS_CHIMNEY_OFFLOAD_TYPE ChimneyType, - OUT PNDIS_OFFLOAD_EVENT_HANDLERS *OffloadHandlers - ); - - -#define NDIS_OBJECT_TCP_OFFLOAD_REVISION_1 1 - -typedef struct _NDIS_TCP_OFFLOAD_EVENT_HANDLERS -{ - NDIS_OBJECT_HEADER Header; - NDIS_TCP_OFFLOAD_EVENT_INDICATE NdisTcpOffloadEventHandler; - NDIS_TCP_OFFLOAD_RECEIVE_INDICATE NdisTcpOffloadReceiveHandler; - NDIS_TCP_OFFLOAD_SEND_COMPLETE NdisTcpOffloadSendComplete; - NDIS_TCP_OFFLOAD_RECEIVE_COMPLETE NdisTcpOffloadReceiveComplete; - NDIS_TCP_OFFLOAD_DISCONNECT_COMPLETE NdisTcpOffloadDisconnectComplete; - NDIS_TCP_OFFLOAD_FORWARD_COMPLETE NdisTcpOffloadForwardComplete; -} NDIS_TCP_OFFLOAD_EVENT_HANDLERS, *PNDIS_TCP_OFFLOAD_EVENT_HANDLERS; - -#define NDIS_SIZEOF_TCP_OFFLOAD_EVENT_HANDLERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NDIS_TCP_OFFLOAD_EVENT_HANDLERS, NdisTcpOffloadForwardComplete) - -#endif //#if (defined(NDIS60) || NDIS_WRAPPER || defined(NDIS61)) -#endif //_CHIMNEY_OFFLOAD - - diff --git a/qt-correction-tool/pub/ddk/ndisguid.h b/qt-correction-tool/pub/ddk/ndisguid.h deleted file mode 100644 index 3fa41a0..0000000 --- a/qt-correction-tool/pub/ddk/ndisguid.h +++ /dev/null @@ -1,278 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ndisguid.h - -Abstract: - - GUID definitions for NDIS objects. - -Environment: - - User/Kernel mode - -Revision History: - ---*/ - -#pragma once - - -// -// Guid for Lan Class. -// -DEFINE_GUID(GUID_NDIS_LAN_CLASS, 0xad498944, 0x762f, 0x11d0, 0x8d, 0xcb, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_DEVINTERFACE_NET, 0xcac88484, 0x7515, 0x4c03, 0x82, 0xe6, 0x71, 0xa8, 0x7a, 0xba, 0xc3, 0x61); -DEFINE_GUID(UNSPECIFIED_NETWORK_GUID, 0x12ba5bde, 0x143e, 0x4c0d, 0xb6, 0x6d, 0x23, 0x79, 0xbb, 0x14, 0x19, 0x13); - -// -// NDIS global GUIDs -// -DEFINE_GUID(GUID_NDIS_ENUMERATE_ADAPTER, 0x981f2d7f, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_ADAPTER_REMOVAL, 0x981f2d80, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_ADAPTER_ARRIVAL, 0x981f2d81, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_ENUMERATE_VC, 0x981f2d82, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_VC_REMOVAL, 0x981f2d79, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_VC_ARRIVAL, 0x182f9e0c, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_BIND, 0x5413531c, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_NOTIFY_UNBIND, 0x6e3ce1ec, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_WAKE_ON_MAGIC_PACKET_ONLY, 0xa14f1c97, 0x8839, 0x4f8a, 0x99, 0x96, 0xa2, 0x89, 0x96, 0xeb, 0xbf, 0x1d); -DEFINE_GUID(GUID_NDIS_NOTIFY_DEVICE_POWER_ON, 0x5f81cfd0, 0xf046, 0x4342, 0xaf, 0x61, 0x89, 0x5a, 0xce, 0xda, 0xef, 0xd9); -DEFINE_GUID(GUID_NDIS_NOTIFY_DEVICE_POWER_OFF, 0x81bc8189, 0xb026, 0x46ab, 0xb9, 0x64, 0xf1, 0x82, 0xe3, 0x42, 0x93, 0x4e); - -DEFINE_GUID(GUID_NDIS_NOTIFY_FILTER_REMOVAL, 0x1f177cd9, 0x5955, 0x4721, 0x9f, 0x6a, 0x78, 0xeb, 0xdf, 0xae, 0xf8, 0x89); -DEFINE_GUID(GUID_NDIS_NOTIFY_FILTER_ARRIVAL, 0x0b6d3c89, 0x5917, 0x43ca, 0xb5, 0x78, 0xd0, 0x1a, 0x79, 0x67, 0xc4, 0x1c); - -DEFINE_GUID(GUID_NDIS_NOTIFY_DEVICE_POWER_ON_EX, 0x2b440188, 0x92ac, 0x4f60, 0x9b, 0x2d, 0x20, 0xa3, 0x0c, 0xbb, 0x6b, 0xbe); -DEFINE_GUID(GUID_NDIS_NOTIFY_DEVICE_POWER_OFF_EX, 0x4159353c, 0x5cd7, 0x42ce, 0x8f, 0xe4, 0xa4, 0x5a, 0x23, 0x80, 0xcc, 0x4f); - -// {1528D111-708A-4ca4-9215-C05771161CDA} - used with NDIS_WMI_PM_ADMIN_CONFIG -DEFINE_GUID(GUID_NDIS_PM_ADMIN_CONFIG, 0x1528d111, 0x708a, 0x4ca4, 0x92, 0x15, 0xc0, 0x57, 0x71, 0x16, 0x1c, 0xda); -// {B2CF76E3-B3AE-4394-A01F-338C9870E939} - use with NDIS_WMI_PM_ACTIVE_CAPABILITIES -DEFINE_GUID(GUID_NDIS_PM_ACTIVE_CAPABILITIES, 0xb2cf76e3, 0xb3ae, 0x4394, 0xa0, 0x1f, 0x33, 0x8c, 0x98, 0x70, 0xe9, 0x39); - -DEFINE_GUID(GUID_NDIS_RSS_ENABLED, 0x9565cd55, 0x3402, 0x4e32, 0xa5, 0xb6, 0x2f, 0x14, 0x3f, 0x2f, 0x2c, 0x30); - -// -// GUIDs for General OIDs -// -DEFINE_GUID(GUID_NDIS_GEN_HARDWARE_STATUS, 0x5ec10354, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MEDIA_SUPPORTED, 0x5ec10355, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MEDIA_IN_USE, 0x5ec10356, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_LOOKAHEAD, 0x5ec10357, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_FRAME_SIZE, 0x5ec10358, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_LINK_SPEED, 0x5ec10359, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_TRANSMIT_BUFFER_SPACE, 0x5ec1035a, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_RECEIVE_BUFFER_SPACE, 0x5ec1035b, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_TRANSMIT_BLOCK_SIZE, 0x5ec1035c, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_RECEIVE_BLOCK_SIZE, 0x5ec1035d, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_VENDOR_ID, 0x5ec1035e, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_VENDOR_DESCRIPTION, 0x5ec1035f, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CURRENT_PACKET_FILTER, 0x5ec10360, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CURRENT_LOOKAHEAD, 0x5ec10361, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_DRIVER_VERSION, 0x5ec10362, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_TOTAL_SIZE, 0x5ec10363, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MAC_OPTIONS, 0x5ec10365, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MEDIA_CONNECT_STATUS, 0x5ec10366, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_MAXIMUM_SEND_PACKETS, 0x5ec10367, 0xa61a, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_VENDOR_DRIVER_VERSION, 0x447956f9, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_VLAN_ID, 0x765dc702, 0xc5e8, 0x4b67, 0x84, 0x3b, 0x3f, 0x5a, 0x4f, 0xf2, 0x64, 0x8b); -DEFINE_GUID(GUID_NDIS_GEN_PHYSICAL_MEDIUM, 0x418ca16d, 0x3937, 0x4208, 0x94, 0x0a, 0xec, 0x61, 0x96, 0x27, 0x80, 0x85); -DEFINE_GUID(GUID_NDIS_TCP_OFFLOAD_CURRENT_CONFIG, 0x68542fed, 0x5c74, 0x461e, 0x89, 0x34, 0x91, 0xc6, 0xf9, 0xc6, 0x09, 0x60); // uses NDIS_OFFLOAD -DEFINE_GUID(GUID_NDIS_TCP_OFFLOAD_HARDWARE_CAPABILITIES, 0xcd5f1102, 0x590f, 0x4ada, 0xab, 0x65, 0x5b, 0x31, 0xb1, 0xdc, 0x01, 0x72); // uses NDIS_OFFLOAD -DEFINE_GUID(GUID_NDIS_TCP_OFFLOAD_PARAMETERS, 0x8ead9a22, 0x7f69, 0x4bc6, 0x94, 0x9a, 0xc8, 0x18, 0x7b, 0x07, 0x4e, 0x61); // uses NDIS_OFFLOAD_PARAMETERS -DEFINE_GUID(GUID_NDIS_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG, 0x2ee6aef1, 0x0851, 0x458b, 0xbf, 0x0d, 0x79, 0x23, 0x43, 0xd1, 0xcd, 0xe1); // uses NDIS_TCP_CONNECTION_OFFLOAD -DEFINE_GUID(GUID_NDIS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES, 0x8ce71f2c, 0xd63a, 0x4390, 0xa4, 0x87, 0x18, 0xfa, 0x47, 0x26, 0x2c, 0xeb); // uses NDIS_TCP_CONNECTION_OFFLOAD -DEFINE_GUID(GUID_NDIS_RECEIVE_SCALE_CAPABILITIES, 0x26c28774, 0x4252, 0x48fe, 0xa6, 0x10, 0xa5, 0x8a, 0x39, 0x8c, 0x0e, 0xb1); - - -DEFINE_GUID(GUID_NDIS_GEN_LINK_STATE, 0xba1f4c14, 0xa945, 0x4762, 0xb9, 0x16, 0x0b, 0x55, 0x15, 0xb6, 0xf4, 0x3a); -DEFINE_GUID(GUID_NDIS_GEN_LINK_PARAMETERS, 0x8c7d3579, 0x252b, 0x4614, 0x82, 0xc5, 0xa6, 0x50, 0xda, 0xa1, 0x50, 0x49); -DEFINE_GUID(GUID_NDIS_GEN_STATISTICS, 0x368c45b5, 0xc129, 0x43c1, 0x93, 0x9e, 0x7e, 0xdc, 0x2d, 0x7f, 0xe6, 0x21); -DEFINE_GUID(GUID_NDIS_GEN_PORT_STATE, 0x6fbf2a5f, 0x8b8f, 0x4920, 0x81, 0x43, 0xe6, 0xc4, 0x60, 0xf5, 0x25, 0x24); -DEFINE_GUID(GUID_NDIS_GEN_ENUMERATE_PORTS, 0xf1d6abe8, 0x15e4, 0x4407, 0x81, 0xb7, 0x6b, 0x83, 0x0c, 0x77, 0x7c, 0xd9); -DEFINE_GUID(GUID_NDIS_ENUMERATE_ADAPTERS_EX, 0x16716917, 0x4306, 0x4be4, 0x9b, 0x5a, 0x38, 0x09, 0xae, 0x44, 0xb1, 0x25); -DEFINE_GUID(GUID_NDIS_GEN_PORT_AUTHENTICATION_PARAMETERS, 0xaab6ac31, 0x86fb, 0x48fb, 0x8b, 0x48, 0x63, 0xdb, 0x23, 0x5a, 0xce, 0x16); -DEFINE_GUID(GUID_NDIS_GEN_INTERRUPT_MODERATION, 0xd9c8eea5, 0xf16e, 0x467c, 0x84, 0xd5, 0x63, 0x45, 0xa2, 0x2c, 0xe2, 0x13); -DEFINE_GUID(GUID_NDIS_GEN_INTERRUPT_MODERATION_PARAMETERS, 0xd789adfa, 0x9c56, 0x433b, 0xad, 0x01, 0x75, 0x74, 0xf3, 0xce, 0xdb, 0xe9); -DEFINE_GUID(GUID_NDIS_GEN_PCI_DEVICE_CUSTOM_PROPERTIES, 0xaa39f5ab, 0xe260,0x4d01, 0x82, 0xb0, 0xb7, 0x37, 0xc8, 0x80, 0xea, 0x05); -DEFINE_GUID(GUID_NDIS_GEN_PHYSICAL_MEDIUM_EX, 0x899e7782, 0x035b,0x43f9, 0x8b, 0xb6, 0x2b, 0x58, 0x97, 0x16, 0x12, 0xe5); -DEFINE_GUID(GUID_NDIS_HD_SPLIT_CURRENT_CONFIG, 0x81d1303c, 0xab00, 0x4e49, 0x80, 0xb1, 0x5e, 0x6e, 0x0b, 0xf9, 0xbe, 0x53); // uses NDIS_HD_SPLIT_CURRENT_CONFIGURATION -DEFINE_GUID(GUID_NDIS_HD_SPLIT_PARAMETERS, 0x8c048bea, 0x2913, 0x4458, 0xb6, 0x8e, 0x17, 0xf6, 0xc1, 0xe5, 0xc6, 0x0e); // uses NDIS_HD_SPLIT_PARAMETERS - - -// {ece5360d-3291-4a6e-8044-00511fed27ee} - uses NDIS_PM_CAPABILITIES -DEFINE_GUID(GUID_PM_HARDWARE_CAPABILITIES, 0xece5360d, 0x3291, 0x4a6e, 0x80, 0x44, 0x00, 0x51, 0x1f, 0xed, 0x27, 0xee); -// {3ABDBD14-D44A-4a3f-9A63-A0A42A51B131} - uses NDIS_PM_CAPABILITIES -DEFINE_GUID(GUID_PM_CURRENT_CAPABILITIES, 0x3abdbd14, 0xd44a, 0x4a3f, 0x9a, 0x63, 0xa0, 0xa4, 0x2a, 0x51, 0xb1, 0x31); -// {560245D2-E251-409c-A280-311935BE3B28} - use NDIS_PM_PARAMETERS -DEFINE_GUID(GUID_PM_PARAMETERS, 0x560245d2, 0xe251, 0x409c, 0xa2, 0x80, 0x31, 0x19, 0x35, 0xbe, 0x3b, 0x28); -// {6FC83BA7-52BC-4faa-AC51-7D2FFE63BA90} - use NDIS_PM_WOL_PATTERN -DEFINE_GUID(GUID_PM_ADD_WOL_PATTERN, 0x6fc83ba7, 0x52bc, 0x4faa, 0xac, 0x51, 0x7d, 0x2f, 0xfe, 0x63, 0xba, 0x90); -// {A037A915-C6CA-4322-B3E3-EF754EC498DC} -DEFINE_GUID(GUID_PM_REMOVE_WOL_PATTERN, 0xa037a915, 0xc6ca, 0x4322, 0xb3, 0xe3, 0xef, 0x75, 0x4e, 0xc4, 0x98, 0xdc); -// {4022BE37-7EE2-47be-A5A5-050FC79AFC75} -DEFINE_GUID(GUID_PM_WOL_PATTERN_LIST, 0x4022be37, 0x7ee2, 0x47be, 0xa5, 0xa5, 0x05, 0x0f, 0xc7, 0x9a, 0xfc, 0x75); -// {0C06C112-0D93-439b-9E6D-26BE130C9784} - uses NDIS_PM_PROTOCOL_OFFLOAD -DEFINE_GUID(GUID_PM_ADD_PROTOCOL_OFFLOAD, 0x0c06c112, 0x0d93, 0x439b, 0x9e, 0x6d, 0x26, 0xbe, 0x13, 0x0c, 0x97, 0x84); -// {A6435CD9-149F-498e-951B-2D94BEA3E3A3} - uses NDIS_PM_PROTOCOL_OFFLOAD -DEFINE_GUID(GUID_PM_GET_PROTOCOL_OFFLOAD, 0xa6435cd9, 0x149f, 0x498e, 0x95, 0x1b, 0x2d, 0x94, 0xbe, 0xa3, 0xe3, 0xa3); -// {DECD7BE2-A6B0-43ca-AE45-D000D20E5265} -DEFINE_GUID(GUID_PM_REMOVE_PROTOCOL_OFFLOAD, 0xdecd7be2, 0xa6b0, 0x43ca, 0xae, 0x45, 0xd0, 0x00, 0xd2, 0x0e, 0x52, 0x65); -// {736EC5AB-CA8F-4043-BB58-DA402A48D9CC} -DEFINE_GUID(GUID_PM_PROTOCOL_OFFLOAD_LIST, 0x736ec5ab, 0xca8f, 0x4043, 0xbb, 0x58, 0xda, 0x40, 0x2a, 0x48, 0xd9, 0xcc); - -// -// GUIDs for receive filters -// -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_HARDWARE_CAPABILITIES, 0x3f2c1419, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_FILTER_CAPABILITIES -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_GLOBAL_PARAMETERS, 0x3f2c141a, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_FILTER_GLOBAL_PARAMETERS -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_ENUM_QUEUES, 0x3f2c141b, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_QUEUE_INFO_ARRAY -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_QUEUE_PARAMETERS, 0x3f2c141c, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_QUEUE_PARAMETERS -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_ENUM_FILTERS, 0x3f2c141d, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_FILTER_INFO_ARRAY -DEFINE_GUID(GUID_NDIS_RECEIVE_FILTER_PARAMETERS, 0x3f2c141e, 0x83bc, 0x11dd, 0x94, 0xb8, 0x00, 0x1d, 0x09, 0x16, 0x2b, 0xc3); // uses NDIS_RECEIVE_FILTER_PARAMETERS -DEFINE_GUID(GUID_RECEIVE_FILTER_CURRENT_CAPABILITIES, 0x4054e80f, 0x2bc1, 0x4ccc, 0xb0, 0x33, 0x4a, 0xbc, 0x0c, 0x4a, 0x1e, 0x8c); // uses RECEIVE_FILTER_CAPABILITIES -DEFINE_GUID(GUID_NIC_SWITCH_HARDWARE_CAPABILITIES, 0x37cab40c, 0xd1e8, 0x4301, 0x8c, 0x1d, 0x58, 0x46, 0x5e, 0x0c, 0x4c, 0x0f); // uses NIC_SWITCH_CAPABILITIES -DEFINE_GUID(GUID_NIC_SWITCH_CURRENT_CAPABILITIES, 0xe76fdaf3, 0x0be7, 0x4d95, 0x87, 0xe9, 0x5a, 0xea, 0xd4, 0xb5, 0x90, 0xe9); // uses NIC_SWITCH_CAPABILITIES -// -// GUIDs for General Required Statistics OIDs -// -DEFINE_GUID(GUID_NDIS_GEN_XMIT_OK, 0x447956fa, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_RCV_OK, 0x447956fb, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_XMIT_ERROR, 0x447956fc, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_RCV_ERROR, 0x447956fd, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_RCV_NO_BUFFER, 0x447956fe, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for General Required CO-NDIS OIDs -// -DEFINE_GUID(GUID_NDIS_GEN_CO_HARDWARE_STATUS, 0x791ad192, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_SUPPORTED, 0x791ad193, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_IN_USE, 0x791ad194, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_LINK_SPEED, 0x791ad195, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_ID, 0x791ad196, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_DESCRIPTION, 0x791ad197, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_DRIVER_VERSION, 0x791ad198, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_MAC_OPTIONS, 0x791ad19a, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_MEDIA_CONNECT_STATUS, 0x791ad19b, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_VENDOR_DRIVER_VERSION, 0x791ad19c, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_MINIMUM_LINK_SPEED, 0x791ad19d, 0xe35c, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for General Required CO-NDIS Statistics OIDs -// -DEFINE_GUID(GUID_NDIS_GEN_CO_XMIT_PDUS_OK, 0x0a214805, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_OK, 0x0a214806, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_XMIT_PDUS_ERROR, 0x0a214807, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_ERROR, 0x0a214808, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_GEN_CO_RCV_PDUS_NO_BUFFER, 0x0a214809, 0xe35f, 0x11d0, 0x96, 0x92, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for Required Ethernet OIDs -// -DEFINE_GUID(GUID_NDIS_802_3_PERMANENT_ADDRESS, 0x447956ff, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_CURRENT_ADDRESS, 0x44795700, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_MULTICAST_LIST, 0x44795701, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_MAXIMUM_LIST_SIZE, 0x44795702, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_MAC_OPTIONS, 0x44795703, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for Required Ethernet Statistics OIDs -// -DEFINE_GUID(GUID_NDIS_802_3_RCV_ERROR_ALIGNMENT, 0x44795704, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_XMIT_ONE_COLLISION, 0x44795705, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_3_XMIT_MORE_COLLISIONS, 0x44795706, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for Required Token-Ring OIDs -// -DEFINE_GUID(GUID_NDIS_802_5_PERMANENT_ADDRESS, 0x44795707, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_CURRENT_ADDRESS, 0x44795708, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_CURRENT_FUNCTIONAL, 0x44795709, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_CURRENT_GROUP, 0x4479570a, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_LAST_OPEN_STATUS, 0x4479570b, 0xa61b, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_CURRENT_RING_STATUS, 0x890a36ec, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_CURRENT_RING_STATE, 0xacf14032, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for Required Token-Ring Statistics OIDs -// -DEFINE_GUID(GUID_NDIS_802_5_LINE_ERRORS, 0xacf14033, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_802_5_LOST_FRAMES, 0xacf14034, 0xa61c, 0x11d0, 0x8d, 0xd4, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); - -// -// GUIDs for required and optional 802.11 Wireless LAN OIDs -// -DEFINE_GUID(GUID_NDIS_802_11_BSSID, 0x2504b6c2, 0x1fa5, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_SSID, 0x7d2a90ea, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_NETWORK_TYPES_SUPPORTED, 0x8531d6e6, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_NETWORK_TYPE_IN_USE, 0x857e2326, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_POWER_MODE, 0x85be837c, 0x2041, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_TX_POWER_LEVEL, 0x11e6ba76, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_RSSI, 0x1507db16, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_RSSI_TRIGGER, 0x155689b8, 0x2053, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_BSSID_LIST, 0x69526f9a, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_INFRASTRUCTURE_MODE, 0x697d5a7e, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_FRAGMENTATION_THRESHOLD, 0x69aaa7c4, 0x2062, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_RTS_THRESHOLD, 0x0134d07e, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_NUMBER_OF_ANTENNAS, 0x01779336, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_RX_ANTENNA_SELECTED, 0x01ac07a2, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_TX_ANTENNA_SELECTED, 0x01dbb74a, 0x2064, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_SUPPORTED_RATES, 0x49db8722, 0x2068, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_DESIRED_RATES, 0x452ee08e, 0x2536, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_CONFIGURATION, 0x4a4df982, 0x2068, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_STATISTICS, 0x42bb73b0, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_ADD_WEP, 0x4307bff0, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_REMOVE_WEP, 0x433c345c, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_DISASSOCIATE, 0x43671f40, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_AUTHENTICATION_MODE, 0x43920a24, 0x2129, 0x11d4, 0x97, 0xeb, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_PRIVACY_FILTER, 0x6733c4e9, 0x4792, 0x11d4, 0x97, 0xf1, 0x00, 0xc0, 0x4f, 0x79, 0xc4, 0x03); -DEFINE_GUID(GUID_NDIS_802_11_BSSID_LIST_SCAN, 0x0d9e01e1, 0xba70, 0x11d4, 0xb6, 0x75, 0x00, 0x20, 0x48, 0x57, 0x03, 0x37); -DEFINE_GUID(GUID_NDIS_802_11_WEP_STATUS, 0xb027a21f, 0x3cfa, 0x4125, 0x80, 0x0b, 0x3f, 0x7a, 0x18, 0xfd, 0xdc, 0xdc); -DEFINE_GUID(GUID_NDIS_802_11_RELOAD_DEFAULTS, 0x748b14e8, 0x32ee, 0x4425, 0xb9, 0x1b, 0xc9, 0x84, 0x8c, 0x58, 0xb5, 0x5a); -DEFINE_GUID(GUID_NDIS_802_11_ADD_KEY, 0xab8b5a62, 0x1d51, 0x49d8, 0xba, 0x5c, 0xfa, 0x98, 0x0b, 0xe0, 0x3a, 0x1d); -DEFINE_GUID(GUID_NDIS_802_11_REMOVE_KEY, 0x73cb28e9, 0x3188, 0x42d5, 0xb5, 0x53, 0xb2, 0x12, 0x37, 0xe6, 0x08, 0x8c); -DEFINE_GUID(GUID_NDIS_802_11_ASSOCIATION_INFORMATION, 0xa08d4dd0, 0x960e, 0x40bd, 0x8c, 0xf6, 0xc5, 0x38, 0xaf, 0x98, 0xf2, 0xe3); -DEFINE_GUID(GUID_NDIS_802_11_TEST, 0x4b9ca16a, 0x6a60, 0x4e9d, 0x92, 0x0c, 0x63, 0x35, 0x95, 0x3f, 0xa0, 0xb5); -DEFINE_GUID(GUID_NDIS_802_11_MEDIA_STREAM_MODE, 0x0a56af66, 0xd84b, 0x49eb, 0xa2, 0x8d, 0x52, 0x82, 0xcb, 0xb6, 0xd0, 0xcd); - -// -// GUIDs for NDIS status indications -// - -DEFINE_GUID(GUID_NDIS_STATUS_RESET_START, 0x981f2d76, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_RESET_END, 0x981f2d77, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_CONNECT, 0x981f2d7d, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_DISCONNECT, 0x981f2d7e, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_MEDIA_SPECIFIC_INDICATION, 0x981f2d84, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_LINK_SPEED_CHANGE, 0x981f2d85, 0xb1f3, 0x11d0, 0x8d, 0xd7, 0x00, 0xc0, 0x4f, 0xc3, 0x35, 0x8c); -DEFINE_GUID(GUID_NDIS_STATUS_PACKET_FILTER, 0xd47c5407, 0x2e75, 0x46dd, 0x81, 0x46, 0x1d, 0x7e, 0xd2, 0xd6, 0xab, 0x1d); -DEFINE_GUID(GUID_NDIS_STATUS_NETWORK_CHANGE, 0xca8a56f9, 0xce81, 0x40e6, 0xa7, 0x0f, 0xa0, 0x67,0xa4,0x76, 0xe9, 0xe9); -DEFINE_GUID(GUID_NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG, 0x45049fc6, 0x54d8, 0x40c8, 0x9c, 0x3d, 0xb0, 0x11, 0xc4, 0xe7, 0x15, 0xbc); // NDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG -DEFINE_GUID(GUID_NDIS_STATUS_TASK_OFFLOAD_HARDWARE_CAPABILITIES, 0xb6b8158b, 0x217c, 0x4b2a, 0xbe, 0x86, 0x6a, 0x04, 0xbe, 0xea, 0x65, 0xb8); // NDIS_STATUS_TASK_OFFLOAD_HARDWARE_CAPABILITIES -DEFINE_GUID(GUID_NDIS_STATUS_TCP_CONNECTION_OFFLOAD_CURRENT_CONFIG, 0xf8edaeff, 0x24e4, 0x4ae6, 0xa4, 0x13, 0x0b, 0x27, 0xf7, 0x6b, 0x24, 0x3d); // NDIS_STATUS_OFFLOAD_RESUME -DEFINE_GUID(GUID_NDIS_STATUS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES, 0x391969b6, 0x402c, 0x43bf, 0x89, 0x22, 0x39, 0xea, 0xe0, 0xda, 0x1b, 0xb5); // NDIS_STATUS_TCP_CONNECTION_OFFLOAD_HARDWARE_CAPABILITIES - -DEFINE_GUID(GUID_NDIS_STATUS_OPER_STATUS, 0xf917b663, 0x845e, 0x4d3d, 0xb6, 0xd4, 0x15, 0xeb, 0x27, 0xaf, 0x81, 0xc5); -DEFINE_GUID(GUID_NDIS_STATUS_LINK_STATE, 0x64c6f797, 0x878c, 0x4311, 0x92, 0x46, 0x65, 0xdb, 0xa8, 0x9c, 0x3a, 0x61); -DEFINE_GUID(GUID_NDIS_STATUS_PORT_STATE, 0x1dac0dfe, 0x43e5, 0x44b7, 0xb7, 0x59, 0x7b, 0xf4, 0x6d, 0xe3, 0x2e, 0x81); -DEFINE_GUID(GUID_STATUS_MEDIA_SPECIFIC_INDICATION_EX, 0xaaacfca7, 0x954a, 0x4632, 0xa1, 0x6e, 0xa8, 0xa6, 0x37, 0x93, 0xa9, 0xe5); -DEFINE_GUID(GUID_NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG, 0x6c744b0e, 0xee9c, 0x4205, 0x90, 0xa2, 0x01, 0x5f, 0x6d, 0x65, 0xf4, 0x03); // NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG - -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_SCAN_CONFIRM, 0x8500591e, 0xa0c7, 0x4efb, 0x93, 0x42, 0xb6, 0x74, 0xb0, 0x02, 0xcb, 0xe6); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_MPDU_MAX_LENGTH_CHANGED, 0x1d6560ec, 0x8e48, 0x4a3e, 0x9f, 0xd5, 0xa0, 0x1b, 0x69, 0x8d, 0xb6, 0xc5); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_ASSOCIATION_START, 0x3927843b, 0x6980, 0x4b48, 0xb1, 0x5b, 0x4d, 0xe5, 0x09, 0x77, 0xac, 0x40); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_ASSOCIATION_COMPLETION, 0x458bbea7, 0x45a4, 0x4ae2, 0xb1, 0x76, 0xe5, 0x1f, 0x96, 0xfc, 0x05, 0x68); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_CONNECTION_START, 0x7b74299d, 0x998f, 0x4454, 0xad, 0x08, 0xc5, 0xaf, 0x28, 0x57, 0x6d, 0x1b); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_CONNECTION_COMPLETION, 0x96efd9c9, 0x7f1b, 0x4a89, 0xbc, 0x04, 0x3e, 0x9e, 0x27, 0x17, 0x65, 0xf1); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_ROAMING_START, 0xb2412d0d, 0x26c8, 0x4f4e, 0x93, 0xdf, 0xf7, 0xb7, 0x05, 0xa0, 0xb4, 0x33); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_ROAMING_COMPLETION, 0xdd9d47d1, 0x282b, 0x41e4, 0xb9, 0x24, 0x66, 0x36, 0x88, 0x17, 0xfc, 0xd3); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_DISASSOCIATION, 0x3fbeb6fc, 0x0fe2, 0x43fd, 0xb2, 0xad, 0xbd, 0x99, 0xb5, 0xf9, 0x3e, 0x13); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_TKIPMIC_FAILURE, 0x442c2ae4, 0x9bc5, 0x4b90, 0xa8, 0x89, 0x45, 0x5e, 0xf2, 0x20, 0xf4, 0xee); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_PMKID_CANDIDATE_LIST, 0x26d8b8f6, 0xdb82, 0x49eb, 0x8b, 0xf3, 0x4c, 0x13, 0x0e, 0xf0, 0x69, 0x50); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_PHY_STATE_CHANGED, 0xdeb45316, 0x71b5, 0x4736, 0xbd, 0xef, 0x0a, 0x9e, 0x9f, 0x4e, 0x62, 0xdc); -DEFINE_GUID(GUID_NDIS_STATUS_DOT11_LINK_QUALITY, 0xa3285184, 0xea99, 0x48ed, 0x82, 0x5e, 0xa4, 0x26, 0xb1, 0x1c, 0x27, 0x54); - diff --git a/qt-correction-tool/pub/ddk/ndistapi.h b/qt-correction-tool/pub/ddk/ndistapi.h deleted file mode 100644 index 22f4712..0000000 --- a/qt-correction-tool/pub/ddk/ndistapi.h +++ /dev/null @@ -1,1676 +0,0 @@ -/*++ BUILD Version: 0000 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ndiswan.h - -Abstract: - - Main header file for the TAPI wrapper - - -Revision History: - ---*/ - -#ifndef _NDIS_TAPI_ -#define _NDIS_TAPI_ - -#pragma once - -// -// -// -// -// Begin definitions for TAPI -// -// -// -// - -#ifndef NDIS_TAPI_CURRENT_VERSION -#define NDIS_TAPI_CURRENT_VERSION 0x00010003 -#endif -// -// Symbolic constants -// - - -#define NDIS_STATUS_TAPI_ADDRESSBLOCKED ((NDIS_STATUS)0xC0012000L) -#define NDIS_STATUS_TAPI_BEARERMODEUNAVAIL ((NDIS_STATUS)0xC0012001L) -#define NDIS_STATUS_TAPI_CALLUNAVAIL ((NDIS_STATUS)0xC0012002L) -#define NDIS_STATUS_TAPI_DIALBILLING ((NDIS_STATUS)0xC0012003L) -#define NDIS_STATUS_TAPI_DIALDIALTONE ((NDIS_STATUS)0xC0012004L) -#define NDIS_STATUS_TAPI_DIALPROMPT ((NDIS_STATUS)0xC0012005L) -#define NDIS_STATUS_TAPI_DIALQUIET ((NDIS_STATUS)0xC0012006L) -#define NDIS_STATUS_TAPI_INCOMPATIBLEEXTVERSION ((NDIS_STATUS)0xC0012007L) -#define NDIS_STATUS_TAPI_INUSE ((NDIS_STATUS)0xC0012008L) -#define NDIS_STATUS_TAPI_INVALADDRESS ((NDIS_STATUS)0xC0012009L) -#define NDIS_STATUS_TAPI_INVALADDRESSID ((NDIS_STATUS)0xC001200AL) -#define NDIS_STATUS_TAPI_INVALADDRESSMODE ((NDIS_STATUS)0xC001200BL) -#define NDIS_STATUS_TAPI_INVALBEARERMODE ((NDIS_STATUS)0xC001200CL) -#define NDIS_STATUS_TAPI_INVALCALLHANDLE ((NDIS_STATUS)0xC001200DL) -#define NDIS_STATUS_TAPI_INVALCALLPARAMS ((NDIS_STATUS)0xC001200EL) -#define NDIS_STATUS_TAPI_INVALCALLSTATE ((NDIS_STATUS)0xC001200FL) -#define NDIS_STATUS_TAPI_INVALDEVICECLASS ((NDIS_STATUS)0xC0012010L) -#define NDIS_STATUS_TAPI_INVALLINEHANDLE ((NDIS_STATUS)0xC0012011L) -#define NDIS_STATUS_TAPI_INVALLINESTATE ((NDIS_STATUS)0xC0012012L) -#define NDIS_STATUS_TAPI_INVALMEDIAMODE ((NDIS_STATUS)0xC0012013L) -#define NDIS_STATUS_TAPI_INVALRATE ((NDIS_STATUS)0xC0012014L) -#define NDIS_STATUS_TAPI_NODRIVER ((NDIS_STATUS)0xC0012015L) -#define NDIS_STATUS_TAPI_OPERATIONUNAVAIL ((NDIS_STATUS)0xC0012016L) -#define NDIS_STATUS_TAPI_RATEUNAVAIL ((NDIS_STATUS)0xC0012017L) -#define NDIS_STATUS_TAPI_RESOURCEUNAVAIL ((NDIS_STATUS)0xC0012018L) -#define NDIS_STATUS_TAPI_STRUCTURETOOSMALL ((NDIS_STATUS)0xC0012019L) -#define NDIS_STATUS_TAPI_USERUSERINFOTOOBIG ((NDIS_STATUS)0xC001201AL) -#define NDIS_STATUS_TAPI_ALLOCATED ((NDIS_STATUS)0xC001201BL) -#define NDIS_STATUS_TAPI_INVALADDRESSSTATE ((NDIS_STATUS)0xC001201CL) -#define NDIS_STATUS_TAPI_INVALPARAM ((NDIS_STATUS)0xC001201DL) -#define NDIS_STATUS_TAPI_NODEVICE ((NDIS_STATUS)0xC001201EL) - -// -// The following DISCONNECTMODE status codes are used by CO_ADDRESS_FAMILY_TAPI -// NDIS Call Managers as the NDIS status passed to: -// -// - Ndis[M]CmMakeCallComplete -// - Ndis[M]CmDispatchIncomingCloseCall -// -#define NDIS_STATUS_TAPI_DISCONNECTMODE_NORMAL ((NDIS_STATUS)0xC0012020L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNKNOWN ((NDIS_STATUS)0xC0012021L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_REJECT ((NDIS_STATUS)0xC0012022L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_PICKUP ((NDIS_STATUS)0xC0012023L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_FORWARDED ((NDIS_STATUS)0xC0012024L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_BUSY ((NDIS_STATUS)0xC0012025L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_NOANSWER ((NDIS_STATUS)0xC0012026L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_BADADDRESS ((NDIS_STATUS)0xC0012027L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNREACHABLE ((NDIS_STATUS)0xC0012028L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_CONGESTION ((NDIS_STATUS)0xC0012029L) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_INCOMPATIBLE ((NDIS_STATUS)0xC001202AL) -#define NDIS_STATUS_TAPI_DISCONNECTMODE_UNAVAIL ((NDIS_STATUS)0xC001202BL) - - -#define NDIS_STATUS_TAPI_RECV_DIGIT ((NDIS_STATUS)0x40010020L) // FIXME: Should this be in ndis.h? - -#define LINE_ADDRESSSTATE 0L -#define LINE_CALLINFO 1L -#define LINE_CALLSTATE 2L -#define LINE_CLOSE 3L -#define LINE_DEVSPECIFIC 4L -#define LINE_DEVSPECIFICFEATURE 5L // not used -#define LINE_GATHERDIGITS 6L // not used -#define LINE_GENERATE 7L // not used -#define LINE_LINEDEVSTATE 8L -#define LINE_MONITORDIGITS 9L // not used -#define LINE_MONITORMEDIA 10L // not used -#define LINE_MONITORTONE 11L // not used -#define LINE_REPLY 12L // not used -#define LINE_REQUEST 13L // not used -#define LINE_CREATE 19L // TAPI v1.4 - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINE_AGENTSPECIFIC 21L // TAPI v2.0 -#define LINE_AGENTSTATUS 22L // TAPI v2.0 -#define LINE_APPNEWCALL 23L // TAPI v2.0 -#define LINE_PROXYREQUEST 24L // TAPI v2.0 -#define LINE_REMOVE 25L // TAPI v2.0 -#endif - - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020002) -#define LINE_AGENTSESSIONSTATUS 27L // TAPI v2.2 -#define LINE_QUEUESTATUS 28L // TAPI v2.2 -#define LINE_AGENTSTATUSEX 29L // TAPI v2.2 -#define LINE_GROUPSTATUS 30L // TAPI v2.2 -#define LINE_PROXYSTATUS 31L // TAPI v2.2 -#endif - - -#if (TAPI_CURRENT_VERSION >= 0x00030000) -#define LINE_APPNEWCALLHUB 32L // TAPI v3.0 -#define LINE_CALLHUBCLOSE 33L // TAPI v3.0 -#define LINE_DEVSPECIFICEX 34L // TAPI v3.0 -#endif - - -#define TSPI_MESSAGE_BASE 500L - -#define LINE_NEWCALL TSPI_MESSAGE_BASE -#define LINE_CALLDEVSPECIFIC (TSPI_MESSAGE_BASE + 1L) - -#ifndef __NDISTAPI_STRINGFORMATS_DEFINED -#define __NDISTAPI_STRINGFORMATS_DEFINED - -#define STRINGFORMAT_ASCII 0x00000001 -#define STRINGFORMAT_DBCS 0x00000002 -#define STRINGFORMAT_UNICODE 0x00000003 -#define STRINGFORMAT_BINARY 0x00000004 - -#endif // __NDISTAPI_STRINGFORMATS_DEFINED - -#define LINEADDRCAPFLAGS_FWDNUMRINGS 0x00000001 -#define LINEADDRCAPFLAGS_PICKUPGROUPID 0x00000002 -#define LINEADDRCAPFLAGS_SECURE 0x00000004 -#define LINEADDRCAPFLAGS_BLOCKIDDEFAULT 0x00000008 -#define LINEADDRCAPFLAGS_BLOCKIDOVERRIDE 0x00000010 -#define LINEADDRCAPFLAGS_DIALED 0x00000020 -#define LINEADDRCAPFLAGS_ORIGOFFHOOK 0x00000040 -#define LINEADDRCAPFLAGS_DESTOFFHOOK 0x00000080 -#define LINEADDRCAPFLAGS_FWDCONSULT 0x00000100 -#define LINEADDRCAPFLAGS_SETUPCONFNULL 0x00000200 -#define LINEADDRCAPFLAGS_AUTORECONNECT 0x00000400 -#define LINEADDRCAPFLAGS_COMPLETIONID 0x00000800 -#define LINEADDRCAPFLAGS_TRANSFERHELD 0x00001000 -#define LINEADDRCAPFLAGS_TRANSFERMAKE 0x00002000 -#define LINEADDRCAPFLAGS_CONFERENCEHELD 0x00004000 -#define LINEADDRCAPFLAGS_CONFERENCEMAKE 0x00008000 -#define LINEADDRCAPFLAGS_PARTIALDIAL 0x00010000 -#define LINEADDRCAPFLAGS_FWDSTATUSVALID 0x00020000 -#define LINEADDRCAPFLAGS_FWDINTEXTADDR 0x00040000 -#define LINEADDRCAPFLAGS_FWDBUSYNAADDR 0x00080000 -#define LINEADDRCAPFLAGS_ACCEPTTOALERT 0x00100000 -#define LINEADDRCAPFLAGS_CONFDROP 0x00200000 -#define LINEADDRCAPFLAGS_PICKUPCALLWAIT 0x00400000 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINEADDRCAPFLAGS_PREDICTIVEDIALER 0x00800000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_QUEUE 0x01000000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_ROUTEPOINT 0x02000000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_HOLDMAKESNEW 0x04000000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_NOINTERNALCALLS 0x08000000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_NOEXTERNALCALLS 0x10000000 // TAPI v2.0 -#define LINEADDRCAPFLAGS_SETCALLINGID 0x20000000 // TAPI v2.0 -#endif -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) -#define LINEADDRCAPFLAGS_ACDGROUP 0x40000000 // TAPI v3.0 -#define LINEADDRCAPFLAGS_NOPSTNADDRESSTRANSLATION 0x80000000 // TAPI v3.0 -#endif - - -#define LINEADDRESSMODE_ADDRESSID 0x00000001 -#define LINEADDRESSMODE_DIALABLEADDR 0x00000002 - -#define LINEADDRESSSHARING_PRIVATE 0x00000001 -#define LINEADDRESSSHARING_BRIDGEDEXCL 0x00000002 -#define LINEADDRESSSHARING_BRIDGEDNEW 0x00000004 -#define LINEADDRESSSHARING_BRIDGEDSHARED 0x00000008 -#define LINEADDRESSSHARING_MONITORED 0x00000010 - -#define LINEADDRESSSTATE_OTHER 0x00000001 -#define LINEADDRESSSTATE_DEVSPECIFIC 0x00000002 -#define LINEADDRESSSTATE_INUSEZERO 0x00000004 -#define LINEADDRESSSTATE_INUSEONE 0x00000008 -#define LINEADDRESSSTATE_INUSEMANY 0x00000010 -#define LINEADDRESSSTATE_NUMCALLS 0x00000020 -#define LINEADDRESSSTATE_FORWARD 0x00000040 -#define LINEADDRESSSTATE_TERMINALS 0x00000080 - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) -#define LINEADDRESSTYPE_PHONENUMBER 0x00000001 -#define LINEADDRESSTYPE_SDP 0x00000002 -#define LINEADDRESSTYPE_EMAILNAME 0x00000004 -#define LINEADDRESSTYPE_DOMAINNAME 0x00000008 -#define LINEADDRESSTYPE_IPADDRESS 0x00000010 -#endif - -#define LINEADDRFEATURE_FORWARD 0x00000001 -#define LINEADDRFEATURE_MAKECALL 0x00000002 -#define LINEADDRFEATURE_PICKUP 0x00000004 -#define LINEADDRFEATURE_SETMEDIACONTROL 0x00000008 -#define LINEADDRFEATURE_SETTERMINAL 0x00000010 -#define LINEADDRFEATURE_SETUPCONF 0x00000020 -#define LINEADDRFEATURE_UNCOMPLETECALL 0x00000040 -#define LINEADDRFEATURE_UNPARK 0x00000080 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINEADDRFEATURE_PICKUPHELD 0x00000100 // TAPI v2.0 -#define LINEADDRFEATURE_PICKUPGROUP 0x00000200 // TAPI v2.0 -#define LINEADDRFEATURE_PICKUPDIRECT 0x00000400 // TAPI v2.0 -#define LINEADDRFEATURE_PICKUPWAITING 0x00000800 // TAPI v2.0 -#define LINEADDRFEATURE_FORWARDFWD 0x00001000 // TAPI v2.0 -#define LINEADDRFEATURE_FORWARDDND 0x00002000 // TAPI v2.0 -#endif - - -#define LINEANSWERMODE_NONE 0x00000001 -#define LINEANSWERMODE_DROP 0x00000002 -#define LINEANSWERMODE_HOLD 0x00000004 - -#define LINEBEARERMODE_VOICE 0x00000001 -#define LINEBEARERMODE_SPEECH 0x00000002 -#define LINEBEARERMODE_MULTIUSE 0x00000004 -#define LINEBEARERMODE_DATA 0x00000008 -#define LINEBEARERMODE_ALTSPEECHDATA 0x00000010 -#define LINEBEARERMODE_NONCALLSIGNALING 0x00000020 -#define LINEBEARERMODE_PASSTHROUGH 0x00000040 // TAPI v1.4 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINEBEARERMODE_RESTRICTEDDATA 0x00000080 // TAPI v2.0 -#endif - -#define LINEBUSYMODE_STATION 0x00000001 -#define LINEBUSYMODE_TRUNK 0x00000002 -#define LINEBUSYMODE_UNKNOWN 0x00000004 -#define LINEBUSYMODE_UNAVAIL 0x00000008 - -#define LINECALLCOMPLCOND_BUSY 0x00000001 -#define LINECALLCOMPLCOND_NOANSWER 0x00000002 - -#define LINECALLCOMPLMODE_CAMPON 0x00000001 -#define LINECALLCOMPLMODE_CALLBACK 0x00000002 -#define LINECALLCOMPLMODE_INTRUDE 0x00000004 -#define LINECALLCOMPLMODE_MESSAGE 0x00000008 - -#define LINECALLFEATURE_ACCEPT 0x00000001 -#define LINECALLFEATURE_ADDTOCONF 0x00000002 -#define LINECALLFEATURE_ANSWER 0x00000004 -#define LINECALLFEATURE_BLINDTRANSFER 0x00000008 -#define LINECALLFEATURE_COMPLETECALL 0x00000010 -#define LINECALLFEATURE_COMPLETETRANSF 0x00000020 -#define LINECALLFEATURE_DIAL 0x00000040 -#define LINECALLFEATURE_DROP 0x00000080 -#define LINECALLFEATURE_GATHERDIGITS 0x00000100 -#define LINECALLFEATURE_GENERATEDIGITS 0x00000200 -#define LINECALLFEATURE_GENERATETONE 0x00000400 -#define LINECALLFEATURE_HOLD 0x00000800 -#define LINECALLFEATURE_MONITORDIGITS 0x00001000 -#define LINECALLFEATURE_MONITORMEDIA 0x00002000 -#define LINECALLFEATURE_MONITORTONES 0x00004000 -#define LINECALLFEATURE_PARK 0x00008000 -#define LINECALLFEATURE_PREPAREADDCONF 0x00010000 -#define LINECALLFEATURE_REDIRECT 0x00020000 -#define LINECALLFEATURE_REMOVEFROMCONF 0x00040000 -#define LINECALLFEATURE_SECURECALL 0x00080000 -#define LINECALLFEATURE_SENDUSERUSER 0x00100000 -#define LINECALLFEATURE_SETCALLPARAMS 0x00200000 -#define LINECALLFEATURE_SETMEDIACONTROL 0x00400000 -#define LINECALLFEATURE_SETTERMINAL 0x00800000 -#define LINECALLFEATURE_SETUPCONF 0x01000000 -#define LINECALLFEATURE_SETUPTRANSFER 0x02000000 -#define LINECALLFEATURE_SWAPHOLD 0x04000000 -#define LINECALLFEATURE_UNHOLD 0x08000000 -#define LINECALLFEATURE_RELEASEUSERUSERINFO 0x10000000 // TAPI v1.4 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINECALLFEATURE_SETTREATMENT 0x20000000 // TAPI v2.0 -#define LINECALLFEATURE_SETQOS 0x40000000 // TAPI v2.0 -#define LINECALLFEATURE_SETCALLDATA 0x80000000 // TAPI v2.0 -#endif - - -#define LINECALLINFOSTATE_OTHER 0x00000001 -#define LINECALLINFOSTATE_DEVSPECIFIC 0x00000002 -#define LINECALLINFOSTATE_BEARERMODE 0x00000004 -#define LINECALLINFOSTATE_RATE 0x00000008 -#define LINECALLINFOSTATE_MEDIAMODE 0x00000010 -#define LINECALLINFOSTATE_APPSPECIFIC 0x00000020 -#define LINECALLINFOSTATE_CALLID 0x00000040 -#define LINECALLINFOSTATE_RELATEDCALLID 0x00000080 -#define LINECALLINFOSTATE_ORIGIN 0x00000100 -#define LINECALLINFOSTATE_REASON 0x00000200 -#define LINECALLINFOSTATE_COMPLETIONID 0x00000400 -#define LINECALLINFOSTATE_NUMOWNERINCR 0x00000800 -#define LINECALLINFOSTATE_NUMOWNERDECR 0x00001000 -#define LINECALLINFOSTATE_NUMMONITORS 0x00002000 -#define LINECALLINFOSTATE_TRUNK 0x00004000 -#define LINECALLINFOSTATE_CALLERID 0x00008000 -#define LINECALLINFOSTATE_CALLEDID 0x00010000 -#define LINECALLINFOSTATE_CONNECTEDID 0x00020000 -#define LINECALLINFOSTATE_REDIRECTIONID 0x00040000 -#define LINECALLINFOSTATE_REDIRECTINGID 0x00080000 -#define LINECALLINFOSTATE_DISPLAY 0x00100000 -#define LINECALLINFOSTATE_USERUSERINFO 0x00200000 -#define LINECALLINFOSTATE_HIGHLEVELCOMP 0x00400000 -#define LINECALLINFOSTATE_LOWLEVELCOMP 0x00800000 -#define LINECALLINFOSTATE_CHARGINGINFO 0x01000000 -#define LINECALLINFOSTATE_TERMINAL 0x02000000 -#define LINECALLINFOSTATE_DIALPARAMS 0x04000000 -#define LINECALLINFOSTATE_MONITORMODES 0x08000000 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINECALLINFOSTATE_TREATMENT 0x10000000 // TAPI v2.0 -#define LINECALLINFOSTATE_QOS 0x20000000 // TAPI v2.0 -#define LINECALLINFOSTATE_CALLDATA 0x40000000 // TAPI v2.0 -#endif - - -#define LINECALLORIGIN_OUTBOUND 0x00000001 -#define LINECALLORIGIN_INTERNAL 0x00000002 -#define LINECALLORIGIN_EXTERNAL 0x00000004 -#define LINECALLORIGIN_UNKNOWN 0x00000010 -#define LINECALLORIGIN_UNAVAIL 0x00000020 -#define LINECALLORIGIN_CONFERENCE 0x00000040 -#define LINECALLORIGIN_INBOUND 0x00000080 - -#define LINECALLPARAMFLAGS_SECURE 0x00000001 -#define LINECALLPARAMFLAGS_IDLE 0x00000002 -#define LINECALLPARAMFLAGS_BLOCKID 0x00000004 -#define LINECALLPARAMFLAGS_ORIGOFFHOOK 0x00000008 -#define LINECALLPARAMFLAGS_DESTOFFHOOK 0x00000010 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINECALLPARAMFLAGS_NOHOLDCONFERENCE 0x00000020 // TAPI v2.0 -#define LINECALLPARAMFLAGS_PREDICTIVEDIAL 0x00000040 // TAPI v2.0 -#define LINECALLPARAMFLAGS_ONESTEPTRANSFER 0x00000080 // TAPI v2.0 -#endif - - -#define LINECALLPARTYID_BLOCKED 0x00000001 -#define LINECALLPARTYID_OUTOFAREA 0x00000002 -#define LINECALLPARTYID_NAME 0x00000004 -#define LINECALLPARTYID_ADDRESS 0x00000008 -#define LINECALLPARTYID_PARTIAL 0x00000010 -#define LINECALLPARTYID_UNKNOWN 0x00000020 -#define LINECALLPARTYID_UNAVAIL 0x00000040 - -#define LINECALLPRIVILEGE_NONE 0x00000001 -#define LINECALLPRIVILEGE_MONITOR 0x00000002 -#define LINECALLPRIVILEGE_OWNER 0x00000004 - -#define LINECALLREASON_DIRECT 0x00000001 -#define LINECALLREASON_FWDBUSY 0x00000002 -#define LINECALLREASON_FWDNOANSWER 0x00000004 -#define LINECALLREASON_FWDUNCOND 0x00000008 -#define LINECALLREASON_PICKUP 0x00000010 -#define LINECALLREASON_UNPARK 0x00000020 -#define LINECALLREASON_REDIRECT 0x00000040 -#define LINECALLREASON_CALLCOMPLETION 0x00000080 -#define LINECALLREASON_TRANSFER 0x00000100 -#define LINECALLREASON_REMINDER 0x00000200 -#define LINECALLREASON_UNKNOWN 0x00000400 -#define LINECALLREASON_UNAVAIL 0x00000800 -#define LINECALLREASON_INTRUDE 0x00001000 // TAPI v1.4 -#define LINECALLREASON_PARKED 0x00002000 // TAPI v1.4 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINECALLREASON_CAMPEDON 0x00004000 // TAPI v2.0 -#define LINECALLREASON_ROUTEREQUEST 0x00008000 // TAPI v2.0 -#endif - - -#define LINECALLSELECT_LINE 0x00000001 -#define LINECALLSELECT_ADDRESS 0x00000002 -#define LINECALLSELECT_CALL 0x00000004 -#if (NDIS_TAPI_CURRENT_VERSION > 0x00020000) -#define LINECALLSELECT_DEVICEID 0x00000008 -#endif -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) -#define LINECALLSELECT_CALLID 0x00000010 -#endif - - -#define LINECALLSTATE_IDLE 0x00000001 -#define LINECALLSTATE_OFFERING 0x00000002 -#define LINECALLSTATE_ACCEPTED 0x00000004 -#define LINECALLSTATE_DIALTONE 0x00000008 -#define LINECALLSTATE_DIALING 0x00000010 -#define LINECALLSTATE_RINGBACK 0x00000020 -#define LINECALLSTATE_BUSY 0x00000040 -#define LINECALLSTATE_SPECIALINFO 0x00000080 -#define LINECALLSTATE_CONNECTED 0x00000100 -#define LINECALLSTATE_PROCEEDING 0x00000200 -#define LINECALLSTATE_ONHOLD 0x00000400 -#define LINECALLSTATE_CONFERENCED 0x00000800 -#define LINECALLSTATE_ONHOLDPENDCONF 0x00001000 -#define LINECALLSTATE_ONHOLDPENDTRANSFER 0x00002000 -#define LINECALLSTATE_DISCONNECTED 0x00004000 -#define LINECALLSTATE_UNKNOWN 0x00008000 - -#define LINEDEVCAPFLAGS_CROSSADDRCONF 0x00000001 -#define LINEDEVCAPFLAGS_HIGHLEVCOMP 0x00000002 -#define LINEDEVCAPFLAGS_LOWLEVCOMP 0x00000004 -#define LINEDEVCAPFLAGS_MEDIACONTROL 0x00000008 -#define LINEDEVCAPFLAGS_MULTIPLEADDR 0x00000010 -#define LINEDEVCAPFLAGS_CLOSEDROP 0x00000020 -#define LINEDEVCAPFLAGS_DIALBILLING 0x00000040 -#define LINEDEVCAPFLAGS_DIALQUIET 0x00000080 -#define LINEDEVCAPFLAGS_DIALDIALTONE 0x00000100 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) -#define LINEDEVCAPFLAGS_MSP 0x00000200 // TAPI v3.0 -#define LINEDEVCAPFLAGS_CALLHUB 0x00000400 // TAPI v3.0 -#define LINEDEVCAPFLAGS_CALLHUBTRACKING 0x00000800 // TAPI v3.0 -#define LINEDEVCAPFLAGS_PRIVATEOBJECTS 0x00001000 // TAPI v3.0 -#endif - - -#define LINEDEVSTATE_OTHER 0x00000001 -#define LINEDEVSTATE_RINGING 0x00000002 -#define LINEDEVSTATE_CONNECTED 0x00000004 -#define LINEDEVSTATE_DISCONNECTED 0x00000008 -#define LINEDEVSTATE_MSGWAITON 0x00000010 -#define LINEDEVSTATE_MSGWAITOFF 0x00000020 -#define LINEDEVSTATE_INSERVICE 0x00000040 -#define LINEDEVSTATE_OUTOFSERVICE 0x00000080 -#define LINEDEVSTATE_MAINTENANCE 0x00000100 -#define LINEDEVSTATE_OPEN 0x00000200 -#define LINEDEVSTATE_CLOSE 0x00000400 -#define LINEDEVSTATE_NUMCALLS 0x00000800 -#define LINEDEVSTATE_NUMCOMPLETIONS 0x00001000 -#define LINEDEVSTATE_TERMINALS 0x00002000 -#define LINEDEVSTATE_ROAMMODE 0x00004000 -#define LINEDEVSTATE_BATTERY 0x00008000 -#define LINEDEVSTATE_SIGNAL 0x00010000 -#define LINEDEVSTATE_DEVSPECIFIC 0x00020000 -#define LINEDEVSTATE_REINIT 0x00040000 -#define LINEDEVSTATE_LOCK 0x00080000 - -#define LINEDEVSTATUSFLAGS_CONNECTED 0x00000001 -#define LINEDEVSTATUSFLAGS_MSGWAIT 0x00000002 -#define LINEDEVSTATUSFLAGS_INSERVICE 0x00000004 -#define LINEDEVSTATUSFLAGS_LOCKED 0x00000008 - -#define LINEDIALTONEMODE_NORMAL 0x00000001 -#define LINEDIALTONEMODE_SPECIAL 0x00000002 -#define LINEDIALTONEMODE_INTERNAL 0x00000004 -#define LINEDIALTONEMODE_EXTERNAL 0x00000008 -#define LINEDIALTONEMODE_UNKNOWN 0x00000010 -#define LINEDIALTONEMODE_UNAVAIL 0x00000020 - -#define LINEDIGITMODE_PULSE 0x00000001 -#define LINEDIGITMODE_DTMF 0x00000002 -#define LINEDIGITMODE_DTMFEND 0x00000004 - -#define LINEDISCONNECTMODE_NORMAL 0x00000001 -#define LINEDISCONNECTMODE_UNKNOWN 0x00000002 -#define LINEDISCONNECTMODE_REJECT 0x00000004 -#define LINEDISCONNECTMODE_PICKUP 0x00000008 -#define LINEDISCONNECTMODE_FORWARDED 0x00000010 -#define LINEDISCONNECTMODE_BUSY 0x00000020 -#define LINEDISCONNECTMODE_NOANSWER 0x00000040 -#define LINEDISCONNECTMODE_BADADDRESS 0x00000080 -#define LINEDISCONNECTMODE_UNREACHABLE 0x00000100 -#define LINEDISCONNECTMODE_CONGESTION 0x00000200 -#define LINEDISCONNECTMODE_INCOMPATIBLE 0x00000400 -#define LINEDISCONNECTMODE_UNAVAIL 0x00000800 -#define LINEDISCONNECTMODE_NODIALTONE 0x00001000 // TAPI v1.4 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINEDISCONNECTMODE_NUMBERCHANGED 0x00002000 // TAPI v2.0 -#define LINEDISCONNECTMODE_OUTOFORDER 0x00004000 // TAPI v2.0 -#define LINEDISCONNECTMODE_TEMPFAILURE 0x00008000 // TAPI v2.0 -#define LINEDISCONNECTMODE_QOSUNAVAIL 0x00010000 // TAPI v2.0 -#define LINEDISCONNECTMODE_BLOCKED 0x00020000 // TAPI v2.0 -#define LINEDISCONNECTMODE_DONOTDISTURB 0x00040000 // TAPI v2.0 -#define LINEDISCONNECTMODE_CANCELLED 0x00080000 // TAPI v2.0 -#endif - - -#define LINEFEATURE_DEVSPECIFIC 0x00000001 -#define LINEFEATURE_DEVSPECIFICFEAT 0x00000002 -#define LINEFEATURE_FORWARD 0x00000004 -#define LINEFEATURE_MAKECALL 0x00000008 -#define LINEFEATURE_SETMEDIACONTROL 0x00000010 -#define LINEFEATURE_SETTERMINAL 0x00000020 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINEFEATURE_SETDEVSTATUS 0x00000040 // TAPI v2.0 -#define LINEFEATURE_FORWARDFWD 0x00000080 // TAPI v2.0 -#define LINEFEATURE_FORWARDDND 0x00000100 // TAPI v2.0 -#endif - - -#define LINEFORWARDMODE_UNCOND 0x00000001 -#define LINEFORWARDMODE_UNCONDINTERNAL 0x00000002 -#define LINEFORWARDMODE_UNCONDEXTERNAL 0x00000004 -#define LINEFORWARDMODE_UNCONDSPECIFIC 0x00000008 -#define LINEFORWARDMODE_BUSY 0x00000010 -#define LINEFORWARDMODE_BUSYINTERNAL 0x00000020 -#define LINEFORWARDMODE_BUSYEXTERNAL 0x00000040 -#define LINEFORWARDMODE_BUSYSPECIFIC 0x00000080 -#define LINEFORWARDMODE_NOANSW 0x00000100 -#define LINEFORWARDMODE_NOANSWINTERNAL 0x00000200 -#define LINEFORWARDMODE_NOANSWEXTERNAL 0x00000400 -#define LINEFORWARDMODE_NOANSWSPECIFIC 0x00000800 -#define LINEFORWARDMODE_BUSYNA 0x00001000 -#define LINEFORWARDMODE_BUSYNAINTERNAL 0x00002000 -#define LINEFORWARDMODE_BUSYNAEXTERNAL 0x00004000 -#define LINEFORWARDMODE_BUSYNASPECIFIC 0x00008000 - -#define LINEGATHERTERM_BUFFERFULL 0x00000001 -#define LINEGATHERTERM_TERMDIGIT 0x00000002 -#define LINEGATHERTERM_FIRSTTIMEOUT 0x00000004 -#define LINEGATHERTERM_INTERTIMEOUT 0x00000008 -#define LINEGATHERTERM_CANCEL 0x00000010 - -#define LINEGENERATETERM_DONE 0x00000001 -#define LINEGENERATETERM_CANCEL 0x00000002 - -#define LINEMEDIACONTROL_NONE 0x00000001 -#define LINEMEDIACONTROL_START 0x00000002 -#define LINEMEDIACONTROL_RESET 0x00000004 -#define LINEMEDIACONTROL_PAUSE 0x00000008 -#define LINEMEDIACONTROL_RESUME 0x00000010 -#define LINEMEDIACONTROL_RATEUP 0x00000020 -#define LINEMEDIACONTROL_RATEDOWN 0x00000040 -#define LINEMEDIACONTROL_RATENORMAL 0x00000080 -#define LINEMEDIACONTROL_VOLUMEUP 0x00000100 -#define LINEMEDIACONTROL_VOLUMEDOWN 0x00000200 -#define LINEMEDIACONTROL_VOLUMENORMAL 0x00000400 - -#define LINEMEDIAMODE_UNKNOWN 0x00000002 -#define LINEMEDIAMODE_INTERACTIVEVOICE 0x00000004 -#define LINEMEDIAMODE_AUTOMATEDVOICE 0x00000008 -#define LINEMEDIAMODE_DATAMODEM 0x00000010 -#define LINEMEDIAMODE_G3FAX 0x00000020 -#define LINEMEDIAMODE_TDD 0x00000040 -#define LINEMEDIAMODE_G4FAX 0x00000080 -#define LINEMEDIAMODE_DIGITALDATA 0x00000100 -#define LINEMEDIAMODE_TELETEX 0x00000200 -#define LINEMEDIAMODE_VIDEOTEX 0x00000400 -#define LINEMEDIAMODE_TELEX 0x00000800 -#define LINEMEDIAMODE_MIXED 0x00001000 -#define LINEMEDIAMODE_ADSI 0x00002000 - -#define LINEMEDIAMODE_VOICEVIEW 0x00004000 // TAPI v1.4 -#define LAST_LINEMEDIAMODE 0x00004000 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020001) -#define LINEMEDIAMODE_VIDEO 0x00008000 // TAPI v2.1 -#undef LAST_LINEMEDIAMODE -#define LAST_LINEMEDIAMODE 0x00008000 // Should override last definition. -#endif - - - - -#define LINEPARKMODE_DIRECTED 0x00000001 -#define LINEPARKMODE_NONDIRECTED 0x00000002 - -#define LINEREMOVEFROMCONF_NONE 0x00000001 -#define LINEREMOVEFROMCONF_LAST 0x00000002 -#define LINEREMOVEFROMCONF_ANY 0x00000003 - -#define LINEREQUESTMODE_MAKECALL 0x00000001 -#define LINEREQUESTMODE_MEDIACALL 0x00000002 -#define LINEREQUESTMODE_DROP 0x00000004 - -#define LAST_LINEREQUESTMODE LINEREQUESTMODE_MEDIACALL - -#define LINEROAMMODE_UNKNOWN 0x00000001 -#define LINEROAMMODE_UNAVAIL 0x00000002 -#define LINEROAMMODE_HOME 0x00000004 -#define LINEROAMMODE_ROAMA 0x00000008 -#define LINEROAMMODE_ROAMB 0x00000010 - -#define LINESPECIALINFO_NOCIRCUIT 0x00000001 -#define LINESPECIALINFO_CUSTIRREG 0x00000002 -#define LINESPECIALINFO_REORDER 0x00000004 -#define LINESPECIALINFO_UNKNOWN 0x00000008 -#define LINESPECIALINFO_UNAVAIL 0x00000010 - -#define LINETERMDEV_PHONE 0x00000001 -#define LINETERMDEV_HEADSET 0x00000002 -#define LINETERMDEV_SPEAKER 0x00000004 - -#define LINETERMMODE_BUTTONS 0x00000001 -#define LINETERMMODE_LAMPS 0x00000002 -#define LINETERMMODE_DISPLAY 0x00000004 -#define LINETERMMODE_RINGER 0x00000008 -#define LINETERMMODE_HOOKSWITCH 0x00000010 -#define LINETERMMODE_MEDIATOLINE 0x00000020 -#define LINETERMMODE_MEDIAFROMLINE 0x00000040 -#define LINETERMMODE_MEDIABIDIRECT 0x00000080 - -#define LINETERMSHARING_PRIVATE 0x00000001 -#define LINETERMSHARING_SHAREDEXCL 0x00000002 -#define LINETERMSHARING_SHAREDCONF 0x00000004 - -#define LINETONEMODE_CUSTOM 0x00000001 -#define LINETONEMODE_RINGBACK 0x00000002 -#define LINETONEMODE_BUSY 0x00000004 -#define LINETONEMODE_BEEP 0x00000008 -#define LINETONEMODE_BILLING 0x00000010 - -#define LINETRANSFERMODE_TRANSFER 0x00000001 -#define LINETRANSFERMODE_CONFERENCE 0x00000002 - -#define LINETOLLLISTOPTION_ADD 0x00000001 -#define LINETOLLLISTOPTION_REMOVE 0x00000002 - -#define LINETRANSLATEOPTION_CARDOVERRIDE 0x00000001 - -#define LINETRANSLATERESULT_CANONICAL 0x00000001 -#define LINETRANSLATERESULT_INTERNATIONAL 0x00000002 -#define LINETRANSLATERESULT_LONGDISTANCE 0x00000004 -#define LINETRANSLATERESULT_LOCAL 0x00000008 -#define LINETRANSLATERESULT_INTOLLLIST 0x00000010 -#define LINETRANSLATERESULT_NOTINTOLLLIST 0x00000020 -#define LINETRANSLATERESULT_DIALBILLING 0x00000040 -#define LINETRANSLATERESULT_DIALQUIET 0x00000080 -#define LINETRANSLATERESULT_DIALDIALTONE 0x00000100 -#define LINETRANSLATERESULT_DIALPROMPT 0x00000200 -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) -#define LINETRANSLATERESULT_VOICEDETECT 0x00000400 // TAPI v2.0 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) -#define LINETRANSLATERESULT_NOTRANSLATION 0x00000800 // TAPI v3.0 -#endif - -// -// Type definitions -// - -typedef ULONG_PTR HTAPI_LINE; -typedef ULONG_PTR HDRV_LINE; -typedef ULONG_PTR HTAPI_CALL; -typedef ULONG_PTR HDRV_CALL; - -typedef struct _LINE_ADDRESS_CAPS -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulLineDeviceID; - - ULONG ulAddressSize; - ULONG ulAddressOffset; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - - ULONG ulAddressSharing; - ULONG ulAddressStates; - ULONG ulCallInfoStates; - ULONG ulCallerIDFlags; - ULONG ulCalledIDFlags; - ULONG ulConnectedIDFlags; - ULONG ulRedirectionIDFlags; - ULONG ulRedirectingIDFlags; - ULONG ulCallStates; - ULONG ulDialToneModes; - ULONG ulBusyModes; - ULONG ulSpecialInfo; - ULONG ulDisconnectModes; - - ULONG ulMaxNumActiveCalls; - ULONG ulMaxNumOnHoldCalls; - ULONG ulMaxNumOnHoldPendingCalls; - ULONG ulMaxNumConference; - ULONG ulMaxNumTransConf; - - ULONG ulAddrCapFlags; - ULONG ulCallFeatures; - ULONG ulRemoveFromConfCaps; - ULONG ulRemoveFromConfState; - ULONG ulTransferModes; - ULONG ulParkModes; - - ULONG ulForwardModes; - ULONG ulMaxForwardEntries; - ULONG ulMaxSpecificEntries; - ULONG ulMinFwdNumRings; - ULONG ulMaxFwdNumRings; - - ULONG ulMaxCallCompletions; - ULONG ulCallCompletionConds; - ULONG ulCallCompletionModes; - ULONG ulNumCompletionMessages; - ULONG ulCompletionMsgTextEntrySize; - ULONG ulCompletionMsgTextSize; - ULONG ulCompletionMsgTextOffset; - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00010004) - ULONG ulAddressFeatures; // TAPI v1.4 - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) - ULONG ulPredictiveAutoTransferStates; // TAPI v2.0 - ULONG ulNumCallTreatments; // TAPI v2.0 - ULONG ulCallTreatmentListSize; // TAPI v2.0 - ULONG ulCallTreatmentListOffset; // TAPI v2.0 - ULONG ulDeviceClassesSize; // TAPI v2.0 - ULONG ulDeviceClassesOffset; // TAPI v2.0 - ULONG ulMaxCallDataSize; // TAPI v2.0 - ULONG ulCallFeatures2; // TAPI v2.0 - ULONG ulMaxNoAnswerTimeout; // TAPI v2.0 - ULONG ulConnectedModes; // TAPI v2.0 - ULONG ulOfferingModes; // TAPI v2.0 - ULONG ulAvailableMediaModes; // TAPI v2.0 -#endif -#endif - -} LINE_ADDRESS_CAPS, *PLINE_ADDRESS_CAPS; - - -typedef struct _LINE_ADDRESS_STATUS -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulNumInUse; - ULONG ulNumActiveCalls; - ULONG ulNumOnHoldCalls; - ULONG ulNumOnHoldPendCalls; - ULONG ulAddressFeatures; - - ULONG ulNumRingsNoAnswer; - ULONG ulForwardNumEntries; - ULONG ulForwardSize; - ULONG ulForwardOffset; - - ULONG ulTerminalModesSize; - ULONG ulTerminalModesOffset; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - -} LINE_ADDRESS_STATUS, *PLINE_ADDRESS_STATUS; - - -typedef struct _LINE_DIAL_PARAMS -{ - ULONG ulDialPause; - ULONG ulDialSpeed; - ULONG ulDigitDuration; - ULONG ulWaitForDialtone; - -} LINE_DIAL_PARAMS, *PLINE_DIAL_PARAMS; - - -typedef struct _LINE_CALL_INFO -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG hLine; - ULONG ulLineDeviceID; - ULONG ulAddressID; - - ULONG ulBearerMode; - ULONG ulRate; - ULONG ulMediaMode; - - ULONG ulAppSpecific; - ULONG ulCallID; - ULONG ulRelatedCallID; - ULONG ulCallParamFlags; - ULONG ulCallStates; - - ULONG ulMonitorDigitModes; - ULONG ulMonitorMediaModes; - LINE_DIAL_PARAMS DialParams; - - ULONG ulOrigin; - ULONG ulReason; - ULONG ulCompletionID; - ULONG ulNumOwners; - ULONG ulNumMonitors; - - ULONG ulCountryCode; - ULONG ulTrunk; - - ULONG ulCallerIDFlags; - ULONG ulCallerIDSize; - ULONG ulCallerIDOffset; - ULONG ulCallerIDNameSize; - ULONG ulCallerIDNameOffset; - - ULONG ulCalledIDFlags; - ULONG ulCalledIDSize; - ULONG ulCalledIDOffset; - ULONG ulCalledIDNameSize; - ULONG ulCalledIDNameOffset; - - ULONG ulConnectedIDFlags; - ULONG ulConnectedIDSize; - ULONG ulConnectedIDOffset; - ULONG ulConnectedIDNameSize; - ULONG ulConnectedIDNameOffset; - - ULONG ulRedirectionIDFlags; - ULONG ulRedirectionIDSize; - ULONG ulRedirectionIDOffset; - ULONG ulRedirectionIDNameSize; - ULONG ulRedirectionIDNameOffset; - - ULONG ulRedirectingIDFlags; - ULONG ulRedirectingIDSize; - ULONG ulRedirectingIDOffset; - ULONG ulRedirectingIDNameSize; - ULONG ulRedirectingIDNameOffset; - - ULONG ulAppNameSize; - ULONG ulAppNameOffset; - - ULONG ulDisplayableAddressSize; - ULONG ulDisplayableAddressOffset; - - ULONG ulCalledPartySize; - ULONG ulCalledPartyOffset; - - ULONG ulCommentSize; - ULONG ulCommentOffset; - - ULONG ulDisplaySize; - ULONG ulDisplayOffset; - - ULONG ulUserUserInfoSize; - ULONG ulUserUserInfoOffset; - - ULONG ulHighLevelCompSize; - ULONG ulHighLevelCompOffset; - - ULONG ulLowLevelCompSize; - ULONG ulLowLevelCompOffset; - - ULONG ulChargingInfoSize; - ULONG ulChargingInfoOffset; - - ULONG ulTerminalModesSize; - ULONG ulTerminalModesOffset; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) - ULONG ulCallTreatment; // TAPI v2.0 - ULONG ulCallDataSize; // TAPI v2.0 - ULONG ulCallDataOffset; // TAPI v2.0 - ULONG ulSendingFlowspecSize; // TAPI v2.0 - ULONG ulSendingFlowspecOffset; // TAPI v2.0 - ULONG ulReceivingFlowspecSize; // TAPI v2.0 - ULONG ulReceivingFlowspecOffset; // TAPI v2.0 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) - ULONG ulCallerIDAddressType; // TAPI v3.0 - ULONG ulCalledIDAddressType; // TAPI v3.0 - ULONG ulConnectedIDAddressType; // TAPI v3.0 - ULONG ulRedirectionIDAddressType; // TAPI v3.0 - ULONG ulRedirectingIDAddressType; // TAPI v3.0 -#endif - -} LINE_CALL_INFO, *PLINE_CALL_INFO; - - -typedef struct _LINE_CALL_PARAMS // Defaults: -{ - ULONG ulTotalSize; // --------- - - ULONG ulBearerMode; // voice - ULONG ulMinRate; // (3.1kHz) - ULONG ulMaxRate; // (3.1kHz) - ULONG ulMediaMode; // interactiveVoice - - ULONG ulCallParamFlags; // 0 - ULONG ulAddressMode; // addressID - ULONG ulAddressID; // (any available) - - LINE_DIAL_PARAMS DialParams; // (0, 0, 0, 0) - - ULONG ulOrigAddressSize; // 0 - ULONG ulOrigAddressOffset; - ULONG ulDisplayableAddressSize; - ULONG ulDisplayableAddressOffset; - - ULONG ulCalledPartySize; // 0 - ULONG ulCalledPartyOffset; - - ULONG ulCommentSize; // 0 - ULONG ulCommentOffset; - - ULONG ulUserUserInfoSize; // 0 - ULONG ulUserUserInfoOffset; - - ULONG ulHighLevelCompSize; // 0 - ULONG ulHighLevelCompOffset; - - ULONG ulLowLevelCompSize; // 0 - ULONG ulLowLevelCompOffset; - - ULONG ulDevSpecificSize; // 0 - ULONG ulDevSpecificOffset; - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) - ULONG ulPredictiveAutoTransferStates; // TAPI v2.0 - ULONG ulTargetAddressSize; // TAPI v2.0 - ULONG ulTargetAddressOffset; // TAPI v2.0 - ULONG ulSendingFlowspecSize; // TAPI v2.0 - ULONG ulSendingFlowspecOffset; // TAPI v2.0 - ULONG ulReceivingFlowspecSize; // TAPI v2.0 - ULONG ulReceivingFlowspecOffset; // TAPI v2.0 - ULONG ulDeviceClassSize; // TAPI v2.0 - ULONG ulDeviceClassOffset; // TAPI v2.0 - ULONG ulDeviceConfigSize; // TAPI v2.0 - ULONG ulDeviceConfigOffset; // TAPI v2.0 - ULONG ulCallDataSize; // TAPI v2.0 - ULONG ulCallDataOffset; // TAPI v2.0 - ULONG ulNoAnswerTimeout; // TAPI v2.0 - ULONG ulCallingPartyIDSize; // TAPI v2.0 - ULONG ulCallingPartyIDOffset; // TAPI v2.0 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) - ULONG ulAddressType; // TAPI v3.0 -#endif - -} LINE_CALL_PARAMS, *PLINE_CALL_PARAMS; - - -typedef struct _LINE_CALL_STATUS -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulCallState; - ULONG ulCallStateMode; - ULONG ulCallPrivilege; - ULONG ulCallFeatures; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - -} LINE_CALL_STATUS, *PLINE_CALL_STATUS; - - -typedef struct _LINE_EXTENSION_ID -{ - ULONG ulExtensionID0; - ULONG ulExtensionID1; - ULONG ulExtensionID2; - ULONG ulExtensionID3; - -} LINE_EXTENSION_ID, *PLINE_EXTENSION_ID; - - -typedef struct _LINE_DEV_CAPS -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulProviderInfoSize; - ULONG ulProviderInfoOffset; - - ULONG ulSwitchInfoSize; - ULONG ulSwitchInfoOffset; - - ULONG ulPermanentLineID; - ULONG ulLineNameSize; - ULONG ulLineNameOffset; - ULONG ulStringFormat; - - ULONG ulAddressModes; - ULONG ulNumAddresses; - ULONG ulBearerModes; - ULONG ulMaxRate; - ULONG ulMediaModes; - - ULONG ulGenerateToneModes; - ULONG ulGenerateToneMaxNumFreq; - ULONG ulGenerateDigitModes; - ULONG ulMonitorToneMaxNumFreq; - ULONG ulMonitorToneMaxNumEntries; - ULONG ulMonitorDigitModes; - ULONG ulGatherDigitsMinTimeout; - ULONG ulGatherDigitsMaxTimeout; - - ULONG ulMedCtlDigitMaxListSize; - ULONG ulMedCtlMediaMaxListSize; - ULONG ulMedCtlToneMaxListSize; - ULONG ulMedCtlCallStateMaxListSize; - - ULONG ulDevCapFlags; - ULONG ulMaxNumActiveCalls; - ULONG ulAnswerMode; - ULONG ulRingModes; - ULONG ulLineStates; - - ULONG ulUUIAcceptSize; - ULONG ulUUIAnswerSize; - ULONG ulUUIMakeCallSize; - ULONG ulUUIDropSize; - ULONG ulUUISendUserUserInfoSize; - ULONG ulUUICallInfoSize; - - LINE_DIAL_PARAMS MinDialParams; - LINE_DIAL_PARAMS MaxDialParams; - LINE_DIAL_PARAMS DefaultDialParams; - - ULONG ulNumTerminals; - ULONG ulTerminalCapsSize; - ULONG ulTerminalCapsOffset; - ULONG ulTerminalTextEntrySize; - ULONG ulTerminalTextSize; - ULONG ulTerminalTextOffset; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00010004) - ULONG ulLineFeatures; // TAPI v1.4 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020000) - ULONG ulSettableDevStatus; // TAPI v2.0 - ULONG ulDeviceClassesSize; // TAPI v2.0 - ULONG ulDeviceClassesOffset; // TAPI v2.0 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00020002) - GUID PermanentLineGuid; // TAPI v3.0 -#endif - -#if (NDIS_TAPI_CURRENT_VERSION >= 0x00030000) - ULONG ulAddressTypes; // TAPI v3.0 - GUID ProtocolGuid; // TAPI v3.0 - ULONG ulAvailableTracking; // TAPI v3.0 -#endif - -} LINE_DEV_CAPS, *PLINE_DEV_CAPS; - - -typedef struct _LINE_DEV_STATUS -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulNumOpens; - ULONG ulOpenMediaModes; - ULONG ulNumActiveCalls; - ULONG ulNumOnHoldCalls; - ULONG ulNumOnHoldPendCalls; - ULONG ulLineFeatures; - ULONG ulNumCallCompletions; - ULONG ulRingMode; - ULONG ulSignalLevel; - ULONG ulBatteryLevel; - ULONG ulRoamMode; - - ULONG ulDevStatusFlags; - - ULONG ulTerminalModesSize; - ULONG ulTerminalModesOffset; - - ULONG ulDevSpecificSize; - ULONG ulDevSpecificOffset; - -} LINE_DEV_STATUS, *PLINE_DEV_STATUS; - - -#ifndef __NDISTAPI_VAR_STRING_DECLARED -#define __NDISTAPI_VAR_STRING_DECLARED - -typedef struct _VAR_STRING -{ - ULONG ulTotalSize; - ULONG ulNeededSize; - ULONG ulUsedSize; - - ULONG ulStringFormat; - ULONG ulStringSize; - ULONG ulStringOffset; - -} VAR_STRING, *PVAR_STRING; - -#endif // __NDISTAPI_VAR_STRING_DECLARED - -typedef struct _NDIS_TAPI_ACCEPT -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulUserUserInfoSize; - __in UCHAR UserUserInfo[1]; - -} NDIS_TAPI_ACCEPT, *PNDIS_TAPI_ACCEPT; - - -typedef struct _NDIS_TAPI_ANSWER -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulUserUserInfoSize; - __in UCHAR UserUserInfo[1]; - -} NDIS_TAPI_ANSWER, *PNDIS_TAPI_ANSWER; - - -typedef struct _NDIS_TAPI_CLOSE -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - -} NDIS_TAPI_CLOSE, *PNDIS_TAPI_CLOSE; - - -typedef struct _NDIS_TAPI_CLOSE_CALL -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - -} NDIS_TAPI_CLOSE_CALL, *PNDIS_TAPI_CLOSE_CALL; - - -typedef struct _NDIS_TAPI_CONDITIONAL_MEDIA_DETECTION -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulMediaModes; - __in LINE_CALL_PARAMS LineCallParams; - -} NDIS_TAPI_CONDITIONAL_MEDIA_DETECTION, -*PNDIS_TAPI_CONDITIONAL_MEDIA_DETECTION; - - -typedef struct _NDIS_TAPI_CONFIG_DIALOG -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulDeviceClassSize; - __in ULONG ulDeviceClassOffset; - __in ULONG ulLibraryNameTotalSize; - __out ULONG ulLibraryNameNeededSize; - __out CHAR szLibraryName[1]; - -} NDIS_TAPI_CONFIG_DIALOG, *PNDIS_TAPI_CONFIG_DIALOG; - - -typedef struct _NDIS_TAPI_DEV_SPECIFIC -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulAddressID; - __in HDRV_CALL hdCall; - __inout ULONG ulParamsSize; - __inout UCHAR Params[1]; - -} NDIS_TAPI_DEV_SPECIFIC, *PNDIS_TAPI_DEV_SPECIFIC; - - -typedef struct _NDIS_TAPI_DIAL -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulDestAddressSize; - __in CHAR szDestAddress[1]; - -} NDIS_TAPI_DIAL, *PNDIS_TAPI_DIAL; - - -typedef struct _NDIS_TAPI_DROP -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulUserUserInfoSize; - __in UCHAR UserUserInfo[1]; - -} NDIS_TAPI_DROP, *PNDIS_TAPI_DROP; - - -typedef struct _NDIS_TAPI_GET_ADDRESS_CAPS -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulAddressID; - __in ULONG ulExtVersion; - __out LINE_ADDRESS_CAPS LineAddressCaps; - -} NDIS_TAPI_GET_ADDRESS_CAPS, *PNDIS_TAPI_GET_ADDRESS_CAPS; - - -typedef struct _NDIS_TAPI_GET_ADDRESS_ID -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __out ULONG ulAddressID; - __in ULONG ulAddressMode; - __in ULONG ulAddressSize; - __in CHAR szAddress[1]; - -} NDIS_TAPI_GET_ADDRESS_ID, *PNDIS_TAPI_GET_ADDRESS_ID; - - -typedef struct _NDIS_TAPI_GET_ADDRESS_STATUS -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulAddressID; - __out LINE_ADDRESS_STATUS LineAddressStatus; - -} NDIS_TAPI_GET_ADDRESS_STATUS, *PNDIS_TAPI_GET_ADDRESS_STATUS; - - -typedef struct _NDIS_TAPI_GET_CALL_ADDRESS_ID -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __out ULONG ulAddressID; - -} NDIS_TAPI_GET_CALL_ADDRESS_ID, *PNDIS_TAPI_GET_CALL_ADDRESS_ID; - - -typedef struct _NDIS_TAPI_GET_CALL_INFO -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __out LINE_CALL_INFO LineCallInfo; - -} NDIS_TAPI_GET_CALL_INFO, *PNDIS_TAPI_GET_CALL_INFO; - - -typedef struct _NDIS_TAPI_GET_CALL_STATUS -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __out LINE_CALL_STATUS LineCallStatus; - -} NDIS_TAPI_GET_CALL_STATUS, *PNDIS_TAPI_GET_CALL_STATUS; - - -typedef struct _NDIS_TAPI_GET_DEV_CAPS -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulExtVersion; - __out LINE_DEV_CAPS LineDevCaps; - -} NDIS_TAPI_GET_DEV_CAPS, *PNDIS_TAPI_GET_DEV_CAPS; - - -typedef struct _NDIS_TAPI_GET_DEV_CONFIG -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulDeviceClassSize; - __in ULONG ulDeviceClassOffset; - __out VAR_STRING DeviceConfig; - -} NDIS_TAPI_GET_DEV_CONFIG, *PNDIS_TAPI_GET_DEV_CONFIG; - - -typedef struct _NDIS_TAPI_GET_EXTENSION_ID -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __out LINE_EXTENSION_ID LineExtensionID; - -} NDIS_TAPI_GET_EXTENSION_ID, *PNDIS_TAPI_GET_EXTENSION_ID; - - -typedef struct _NDIS_TAPI_GET_ID -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulAddressID; - __in HDRV_CALL hdCall; - __in ULONG ulSelect; - __in ULONG ulDeviceClassSize; - __in ULONG ulDeviceClassOffset; - __out VAR_STRING DeviceID; - -} NDIS_TAPI_GET_ID, *PNDIS_TAPI_GET_ID; - - -typedef struct _NDIS_TAPI_GET_LINE_DEV_STATUS -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __out LINE_DEV_STATUS LineDevStatus; - -} NDIS_TAPI_GET_LINE_DEV_STATUS, *PNDIS_TAPI_GET_LINE_DEV_STATUS; - - -typedef struct _NDIS_TAPI_MAKE_CALL -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in HTAPI_CALL htCall; - __out HDRV_CALL hdCall; - __in ULONG ulDestAddressSize; - __in ULONG ulDestAddressOffset; - __in BOOLEAN bUseDefaultLineCallParams; - __in LINE_CALL_PARAMS LineCallParams; - -} NDIS_TAPI_MAKE_CALL, *PNDIS_TAPI_MAKE_CALL; - - -typedef struct _NDIS_TAPI_NEGOTIATE_EXT_VERSION -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulLowVersion; - __in ULONG ulHighVersion; - __out ULONG ulExtVersion; - -} NDIS_TAPI_NEGOTIATE_EXT_VERSION, *PNDIS_TAPI_NEGOTIATE_EXT_VERSION; - - -typedef struct _NDIS_TAPI_OPEN -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in HTAPI_LINE htLine; - __out HDRV_LINE hdLine; - -} NDIS_TAPI_OPEN, *PNDIS_TAPI_OPEN; - - -typedef struct _NDIS_TAPI_PROVIDER_INITIALIZE -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceIDBase; - __out ULONG ulNumLineDevs; - __out ULONG_PTR ulProviderID; - -} NDIS_TAPI_PROVIDER_INITIALIZE, *PNDIS_TAPI_PROVIDER_INITIALIZE; - - -typedef struct _NDIS_TAPI_PROVIDER_SHUTDOWN -{ - __in ULONG ulRequestID; - -} NDIS_TAPI_PROVIDER_SHUTDOWN, *PNDIS_TAPI_PROVIDER_SHUTDOWN; - - -typedef struct _NDIS_TAPI_SECURE_CALL -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - -} NDIS_TAPI_SECURE_CALL, *PNDIS_TAPI_SECURE_CALL; - - -typedef struct _NDIS_TAPI_SELECT_EXT_VERSION -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulExtVersion; - -} NDIS_TAPI_SELECT_EXT_VERSION, *PNDIS_TAPI_SELECT_EXT_VERSION; - - -typedef struct _NDIS_TAPI_SEND_USER_USER_INFO -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulUserUserInfoSize; - __in UCHAR UserUserInfo[1]; - -} NDIS_TAPI_SEND_USER_USER_INFO, *PNDIS_TAPI_SEND_USER_USER_INFO; - - -typedef struct _NDIS_TAPI_SET_APP_SPECIFIC -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulAppSpecific; - -} NDIS_TAPI_SET_APP_SPECIFIC, *PNDIS_TAPI_SET_APP_SPECIFIC; - - -typedef struct _NDIS_TAPI_SET_CALL_PARAMS -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulBearerMode; - __in ULONG ulMinRate; - __in ULONG ulMaxRate; - __in BOOLEAN bSetLineDialParams; - __in LINE_DIAL_PARAMS LineDialParams; - -} NDIS_TAPI_SET_CALL_PARAMS, *PNDIS_TAPI_SET_CALL_PARAMS; - - -typedef struct _NDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulMediaModes; - -} NDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION, -*PNDIS_TAPI_SET_DEFAULT_MEDIA_DETECTION; - - -typedef struct _NDIS_TAPI_SET_DEV_CONFIG -{ - __in ULONG ulRequestID; - __in ULONG ulDeviceID; - __in ULONG ulDeviceClassSize; - __in ULONG ulDeviceClassOffset; - __in ULONG ulDeviceConfigSize; - __in UCHAR DeviceConfig[1]; - -} NDIS_TAPI_SET_DEV_CONFIG, *PNDIS_TAPI_SET_DEV_CONFIG; - - -typedef struct _NDIS_TAPI_SET_MEDIA_MODE -{ - __in ULONG ulRequestID; - __in HDRV_CALL hdCall; - __in ULONG ulMediaMode; - -} NDIS_TAPI_SET_MEDIA_MODE, *PNDIS_TAPI_SET_MEDIA_MODE; - - -typedef struct _NDIS_TAPI_SET_STATUS_MESSAGES -{ - __in ULONG ulRequestID; - __in HDRV_LINE hdLine; - __in ULONG ulLineStates; - __in ULONG ulAddressStates; - -} NDIS_TAPI_SET_STATUS_MESSAGES, *PNDIS_TAPI_SET_STATUS_MESSAGES; - - -typedef struct _NDIS_TAPI_EVENT -{ - __in HTAPI_LINE htLine; - __in HTAPI_CALL htCall; - __in ULONG ulMsg; - __in ULONG_PTR ulParam1; - __in ULONG_PTR ulParam2; - __in ULONG_PTR ulParam3; - -} NDIS_TAPI_EVENT, *PNDIS_TAPI_EVENT; - -typedef struct _NDISTAPI_CHARACTERISTICS { - PVOID RequestProc; - GUID Guid; - NDIS_WAN_MEDIUM_SUBTYPE MediaType; -} NDISTAPI_CHARACTERISTICS, *PNDISTAPI_CHARACTERISTICS; - - -typedef struct _NDIS_TAPI_GATHER_DIGITS -{ - __in ULONG ulRequestID; - IN HDRV_CALL hdCall; - IN ULONG ulEndToEndID; - IN ULONG ulDigitModes; - __field_ecount(ulNumDigitsNeeded) IN LPWSTR lpsOrigDigitsBuffer; - IN ULONG ulDigitsBufferOffset; - IN ULONG ulNumDigitsNeeded; - OUT ULONG ulNumDigitsRead; - OUT ULONG ulTickCount; - OUT ULONG ulTerminationReason; - IN ULONG ulTerminationDigitsMask; - IN ULONG ulFirstDigitTimeout; - IN ULONG ulInterDigitTimeout; -} NDIS_TAPI_GATHER_DIGITS, *PNDIS_TAPI_GATHER_DIGITS; - -typedef struct _NDIS_TAPI_MONITOR_DIGITS -{ - IN HDRV_CALL hdCall; - IN ULONG ulDigitModes; -} NDIS_TAPI_MONITOR_DIGITS, *PNDIS_TAPI_MONITOR_DIGITS; - -#define CO_TAPI_VERSION NDIS_TAPI_CURRENT_VERSION - -// -// The CO_TAPI structures below are meant for TAPI support -// over CONDIS Call Managers and Miniport Call Managers. -// - -// Structure associated with OID_CO_TAPI_CM_CAPS -// -typedef struct _CO_TAPI_CM_CAPS -{ - __out ULONG ulCoTapiVersion; - __out ULONG ulNumLines; - __out ULONG ulFlags; - -} CO_TAPI_CM_CAPS, *PCO_TAPI_CM_CAPS; - -// -// Bit definitions for Flags in CO_TAPI_CM_CAPS -// -#define CO_TAPI_FLAG_PER_LINE_CAPS 0x00000001 - -// -// Structure associated with OID_CO_TAPI_LINE_CAPS. -// -typedef struct _CO_TAPI_LINE_CAPS -{ - __in ULONG ulLineID; - __out ULONG ulFlags; - __out LINE_DEV_CAPS LineDevCaps; - -} CO_TAPI_LINE_CAPS, *PCO_TAPI_LINE_CAPS; - -// -// Bit definitions for Flags in CO_TAPI_LINE_CAPS -// -#define CO_TAPI_FLAG_PER_ADDRESS_CAPS 0x00000001 - -// -// Structure associated with OID_CO_TAPI_ADDRESS_CAPS. -// -typedef struct _CO_TAPI_ADDRESS_CAPS -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __out ULONG ulFlags; - __out LINE_ADDRESS_CAPS LineAddressCaps; - -} CO_TAPI_ADDRESS_CAPS, *PCO_TAPI_ADDRESS_CAPS; - - -// -// Special values for Line and Address ID fields: -// -#define CO_TAPI_LINE_ID_UNSPECIFIED 0xFFFFFFFF -#define CO_TAPI_ADDRESS_ID_UNSPECIFIED 0xFFFFFFFF - -// -// Structure associated with OID_CO_TAPI_TRANSLATE_TAPI_CALLPARAMS. -// -typedef struct _CO_TAPI_TRANSLATE_TAPI_CALLPARAMS -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __in ULONG ulFlags; // see below - __in NDIS_VAR_DATA_DESC DestAddress; - __in NDIS_VAR_DATA_DESC LineCallParams; // LINE_CALL_PARAMS - __out NDIS_VAR_DATA_DESC NdisCallParams; // CO_CALL_PARAMETERS - -} CO_TAPI_TRANSLATE_TAPI_CALLPARAMS, *PCO_TAPI_TRANSLATE_TAPI_CALLPARAMS; - -// -// Bit definitions for Flags in CO_TAPI_TRANSLATE_TAPI_CALLPARAMS -// and CO_TAPI_TRANSLATE_NDIS_CALLPARAMS. -// -#define CO_TAPI_FLAG_OUTGOING_CALL 0x00000001 -#define CO_TAPI_FLAG_INCOMING_CALL 0x00000002 -#define CO_TAPI_FLAG_USE_DEFAULT_CALLPARAMS 0x00000004 - - -// -// Structure associated with OID_CO_TAPI_TRANSLATE_NDIS_CALLPARAMS. -// -typedef struct _CO_TAPI_TRANSLATE_NDIS_CALLPARAMS -{ - __in ULONG ulFlags; // see above - __in NDIS_VAR_DATA_DESC NdisCallParams; // CO_CALL_PARAMETERS - __out NDIS_VAR_DATA_DESC LineCallInfo; // LINE_CALL_INFO - -} CO_TAPI_TRANSLATE_NDIS_CALLPARAMS, *PCO_TAPI_TRANSLATE_NDIS_CALLPARAMS; - - -// -// Structure associated with OID_CO_TAPI_TRANSLATE_SAP. -// -typedef struct _CO_TAPI_TRANSLATE_SAP -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __in ULONG ulMediaModes; - __in ULONG Reserved; - __out ULONG NumberOfSaps; - __out NDIS_VAR_DATA_DESC NdisSapParams[1]; // CO_SAP - -} CO_TAPI_TRANSLATE_SAP, *PCO_TAPI_TRANSLATE_SAP; - - -// -// Structure associated with OID_CO_TAPI_GET_CALL_DIAGNOSTICS. -// -typedef struct _CO_TAPI_CALL_DIAGNOSTICS -{ - __out ULONG ulOrigin; - __out ULONG ulReason; - __out NDIS_VAR_DATA_DESC DiagInfo; - -} CO_TAPI_CALL_DIAGNOSTICS, *PCO_TAPI_CALL_DIAGNOSTICS; - - -// -// Structure used in the Media-specific part of CO_CALL_PARAMETERS -// for an outgoing call for the CO_ADDRESS_FAMILY_TAPI address family. -// This is used in NdisClMakeCall/Ndis[M]CmActivateVc, and -// completion routines. -// -// This overlays: -// CO_CALL_PARAMETERS.MediaParameters->MediaSpecific.Parameters[] -// -typedef struct _CO_AF_TAPI_MAKE_CALL_PARAMETERS -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __in ULONG ulFlags; // see CO_TAPI_TRANSLATE_TAPI_CALLPARAMS - __in NDIS_VAR_DATA_DESC DestAddress; - __in NDIS_VAR_DATA_DESC LineCallParams; // LINE_CALL_PARAMS - -} CO_AF_TAPI_MAKE_CALL_PARAMETERS, *PCO_AF_TAPI_MAKE_CALL_PARAMETERS; - - - -// -// Structure used in the Media-specific part of CO_CALL_PARAMETERS -// for an incoming call for the CO_ADDRESS_FAMILY_TAPI address family. -// This is used in Ndis[M]CmDispatchIncomingCall/Ndis[M]CmActivateVc -// and completion routines. -// -// This overlays: -// CO_CALL_PARAMETERS.MediaParameters->MediaSpecific.Parameters[] -// -typedef struct _CO_AF_TAPI_INCOMING_CALL_PARAMETERS -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __in ULONG ulFlags; // see CO_TAPI_TRANSLATE_TAPI_CALLPARAMS - __in NDIS_VAR_DATA_DESC LineCallInfo; // LINE_CALL_INFO - -} CO_AF_TAPI_INCOMING_CALL_PARAMETERS, *PCO_AF_TAPI_INCOMING_CALL_PARAMETERS; - - - -// -// Value of SapType in CO_SAP for a Service Access Point on the -// CO_ADDRESS_FAMILY_TAPI address family. -// -#define AF_TAPI_SAP_TYPE 0x00008000 - -// -// Structure used to convey TAPI-style SAP information in the NDIS CO_SAP -// structure. -// -// This overlays: -// CO_SAP.Sap[] -// -typedef struct _CO_AF_TAPI_SAP -{ - __in ULONG ulLineID; - __in ULONG ulAddressID; - __in ULONG ulMediaModes; - -} CO_AF_TAPI_SAP, *PCO_AF_TAPI_SAP; - - - -#endif // _NDIS_TAPI_ - diff --git a/qt-correction-tool/pub/ddk/ndiswan.h b/qt-correction-tool/pub/ddk/ndiswan.h deleted file mode 100644 index f640082..0000000 --- a/qt-correction-tool/pub/ddk/ndiswan.h +++ /dev/null @@ -1,485 +0,0 @@ -/*++ BUILD Version: 0000 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ndiswan.h - -Abstract: - - Main header file for the wan wrapper - - -Revision History: - ---*/ - - -#ifndef _NDIS_WAN_ -#define _NDIS_WAN_ - -#pragma once - -// -// Begin definitions for WANs -// - -// -// Bit field set int he Reserved field for -// NdisRegisterMiniport or passed in NdisRegisterSpecial -// - -#define NDIS_USE_WAN_WRAPPER 0x00000001 - -#define NDIS_STATUS_TAPI_INDICATION ((NDIS_STATUS)0x40010080L) - - -// -// NDIS WAN Framing bits -// -#define RAS_FRAMING 0x00000001 -#define RAS_COMPRESSION 0x00000002 - -#define ARAP_V1_FRAMING 0x00000004 -#define ARAP_V2_FRAMING 0x00000008 -#define ARAP_FRAMING (ARAP_V1_FRAMING | ARAP_V2_FRAMING) - -#define PPP_MULTILINK_FRAMING 0x00000010 -#define PPP_SHORT_SEQUENCE_HDR_FORMAT 0x00000020 -#define PPP_MC_MULTILINK_FRAMING 0x00000040 - -#define PPP_FRAMING 0x00000100 -#define PPP_COMPRESS_ADDRESS_CONTROL 0x00000200 -#define PPP_COMPRESS_PROTOCOL_FIELD 0x00000400 -#define PPP_ACCM_SUPPORTED 0x00000800 - -#define SLIP_FRAMING 0x00001000 -#define SLIP_VJ_COMPRESSION 0x00002000 -#define SLIP_VJ_AUTODETECT 0x00004000 - -#define MEDIA_NRZ_ENCODING 0x00010000 -#define MEDIA_NRZI_ENCODING 0x00020000 -#define MEDIA_NLPID 0x00040000 - -#define RFC_1356_FRAMING 0x00100000 -#define RFC_1483_FRAMING 0x00200000 -#define RFC_1490_FRAMING 0x00400000 -#define LLC_ENCAPSULATION 0x00800000 - -#define SHIVA_FRAMING 0x01000000 -#define NBF_PRESERVE_MAC_ADDRESS 0x01000000 -#define PASS_THROUGH_MODE 0x10000000 - -#ifndef _WAN50_ -#define RAW_PASS_THROUGH_MODE 0x20000000 -#endif - -#define TAPI_PROVIDER 0x80000000 - -// -// NDIS WAN Information structures used -// by NDIS 3.1 Wan Miniport drivers -// -typedef struct _NDIS_WAN_INFO -{ - __out ULONG MaxFrameSize; - __out ULONG MaxTransmit; - __out ULONG HeaderPadding; - __out ULONG TailPadding; - __out ULONG Endpoints; - __out UINT MemoryFlags; - __out NDIS_PHYSICAL_ADDRESS HighestAcceptableAddress; - __out ULONG FramingBits; - __out ULONG DesiredACCM; -} NDIS_WAN_INFO, *PNDIS_WAN_INFO; - -typedef struct _NDIS_WAN_SET_LINK_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __in ULONG MaxSendFrameSize; - __in ULONG MaxRecvFrameSize; - ULONG HeaderPadding; - ULONG TailPadding; - __in ULONG SendFramingBits; - __in ULONG RecvFramingBits; - __in ULONG SendCompressionBits; - __in ULONG RecvCompressionBits; - __in ULONG SendACCM; - __in ULONG RecvACCM; -} NDIS_WAN_SET_LINK_INFO, *PNDIS_WAN_SET_LINK_INFO; - -typedef struct _NDIS_WAN_GET_LINK_INFO { - __in NDIS_HANDLE NdisLinkHandle; - __out ULONG MaxSendFrameSize; - __out ULONG MaxRecvFrameSize; - __out ULONG HeaderPadding; - __out ULONG TailPadding; - __out ULONG SendFramingBits; - __out ULONG RecvFramingBits; - __out ULONG SendCompressionBits; - __out ULONG RecvCompressionBits; - __out ULONG SendACCM; - __out ULONG RecvACCM; -} NDIS_WAN_GET_LINK_INFO, *PNDIS_WAN_GET_LINK_INFO; - -// -// NDIS WAN Bridging Options -// -#define BRIDGING_FLAG_LANFCS 0x00000001 -#define BRIDGING_FLAG_LANID 0x00000002 -#define BRIDGING_FLAG_PADDING 0x00000004 - -// -// NDIS WAN Bridging Capabilities -// -#define BRIDGING_TINYGRAM 0x00000001 -#define BRIDGING_LANID 0x00000002 -#define BRIDGING_NO_SPANNING_TREE 0x00000004 -#define BRIDGING_8021D_SPANNING_TREE 0x00000008 -#define BRIDGING_8021G_SPANNING_TREE 0x00000010 -#define BRIDGING_SOURCE_ROUTING 0x00000020 -#define BRIDGING_DEC_LANBRIDGE 0x00000040 - -// -// NDIS WAN Bridging Type -// -#define BRIDGING_TYPE_RESERVED 0x00000001 -#define BRIDGING_TYPE_8023_CANON 0x00000002 -#define BRIDGING_TYPE_8024_NO_CANON 0x00000004 -#define BRIDGING_TYPE_8025_NO_CANON 0x00000008 -#define BRIDGING_TYPE_FDDI_NO_CANON 0x00000010 -#define BRIDGING_TYPE_8024_CANON 0x00000400 -#define BRIDGING_TYPE_8025_CANON 0x00000800 -#define BRIDGING_TYPE_FDDI_CANON 0x00001000 - -typedef struct _NDIS_WAN_GET_BRIDGE_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __out USHORT LanSegmentNumber; - __out UCHAR BridgeNumber; - __out UCHAR BridgingOptions; - __out ULONG BridgingCapabilities; - __out UCHAR BridgingType; - __out UCHAR MacBytes[6]; -} NDIS_WAN_GET_BRIDGE_INFO, *PNDIS_WAN_GET_BRIDGE_INFO; - -typedef struct _NDIS_WAN_SET_BRIDGE_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __in USHORT LanSegmentNumber; - __in UCHAR BridgeNumber; - __in UCHAR BridgingOptions; - __in ULONG BridgingCapabilities; - __in UCHAR BridgingType; - __in UCHAR MacBytes[6]; -} NDIS_WAN_SET_BRIDGE_INFO, *PNDIS_WAN_SET_BRIDGE_INFO; - -// -// NDIS WAN Compression Information -// - -// -// Define MSCompType bit field, 0 disables all -// -#define NDISWAN_COMPRESSION 0x00000001 -#define NDISWAN_ENCRYPTION 0x00000010 -#define NDISWAN_40_ENCRYPTION 0x00000020 -#define NDISWAN_128_ENCRYPTION 0x00000040 -#define NDISWAN_56_ENCRYPTION 0x00000080 -#define NDISWAN_HISTORY_LESS 0x01000000 - -// -// Define CompType codes -// -#define COMPTYPE_OUI 0 -#define COMPTYPE_NT31RAS 254 -#define COMPTYPE_NONE 255 - - -typedef struct _NDIS_WAN_COMPRESS_INFO -{ - UCHAR SessionKey[8]; - ULONG MSCompType; - - // Fields above indicate NDISWAN capabilities. - // Fields below indicate MAC-specific capabilities. - - UCHAR CompType; - USHORT CompLength; - - union - { - struct - { - UCHAR CompOUI[3]; - UCHAR CompSubType; - UCHAR CompValues[32]; - } Proprietary; - - struct - { - UCHAR CompValues[32]; - } Public; - }; -} NDIS_WAN_COMPRESS_INFO; - -typedef NDIS_WAN_COMPRESS_INFO UNALIGNED *PNDIS_WAN_COMPRESS_INFO; - -typedef struct _NDIS_WAN_GET_COMP_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __out NDIS_WAN_COMPRESS_INFO SendCapabilities; - __out NDIS_WAN_COMPRESS_INFO RecvCapabilities; -} NDIS_WAN_GET_COMP_INFO, *PNDIS_WAN_GET_COMP_INFO; - -typedef struct _NDIS_WAN_SET_COMP_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __in NDIS_WAN_COMPRESS_INFO SendCapabilities; - __in NDIS_WAN_COMPRESS_INFO RecvCapabilities; -} NDIS_WAN_SET_COMP_INFO, *PNDIS_WAN_SET_COMP_INFO; - -// -// NDIS WAN Statistics Information -// - -typedef struct _NDIS_WAN_GET_STATS_INFO -{ - __in NDIS_HANDLE NdisLinkHandle; - __out ULONG BytesSent; - __out ULONG BytesRcvd; - __out ULONG FramesSent; - __out ULONG FramesRcvd; - __out ULONG CRCErrors; // Serial-like info only - __out ULONG TimeoutErrors; // Serial-like info only - __out ULONG AlignmentErrors; // Serial-like info only - __out ULONG SerialOverrunErrors; // Serial-like info only - __out ULONG FramingErrors; // Serial-like info only - __out ULONG BufferOverrunErrors; // Serial-like info only - __out ULONG BytesTransmittedUncompressed; // Compression info only - __out ULONG BytesReceivedUncompressed; // Compression info only - __out ULONG BytesTransmittedCompressed; // Compression info only - __out ULONG BytesReceivedCompressed; // Compression info only - __out ULONG TunnelPacketsRecieved; - __out ULONG TunnelRecievePacketsPending; - __out ULONG TunnelPacketsIndicatedUp; - __out ULONG TunnelRecievePacketsRejected; - __out ULONG TunnelPacketsSent; - __out ULONG TunnelPacketsSentComplete; - __out ULONG TunnelTransmitPacketsPending; - __out ULONG TunnelPacketsTransmitError; - __out ULONG TunnelPacketsSentError; - __out ULONG TunnelTransmitPacketsRejected; - __out ULONG TunnelAcksSent; - __out ULONG TunnelAcksSentComplete; - __out ULONG TunnelGeneric1; - __out ULONG TunnelGeneric2; - __out ULONG TunnelGeneric3; -} NDIS_WAN_GET_STATS_INFO, *PNDIS_WAN_GET_STATS_INFO; - -#define NdisMWanInitializeWrapper(NdisWrapperHandle, \ - SystemSpecific1, \ - SystemSpecific2, \ - SystemSpecific3) \ -{ \ - NdisMInitializeWrapper(NdisWrapperHandle, \ - SystemSpecific1, \ - SystemSpecific2, \ - SystemSpecific3); \ -} - -typedef struct _NDIS_MAC_LINE_UP -{ - __in ULONG LinkSpeed; - __in NDIS_WAN_QUALITY Quality; - __in USHORT SendWindow; - __in NDIS_HANDLE ConnectionWrapperID; - __in NDIS_HANDLE NdisLinkHandle; - __out NDIS_HANDLE NdisLinkContext; -} NDIS_MAC_LINE_UP, *PNDIS_MAC_LINE_UP; - - -typedef struct _NDIS_MAC_LINE_DOWN -{ - __in NDIS_HANDLE NdisLinkContext; -} NDIS_MAC_LINE_DOWN, *PNDIS_MAC_LINE_DOWN; - - -// -// These are the error values that can be indicated by the driver. -// This bit field is set when calling NdisIndicateStatus. -// -#define WAN_ERROR_CRC ((ULONG)0x00000001) -#define WAN_ERROR_FRAMING ((ULONG)0x00000002) -#define WAN_ERROR_HARDWAREOVERRUN ((ULONG)0x00000004) -#define WAN_ERROR_BUFFEROVERRUN ((ULONG)0x00000008) -#define WAN_ERROR_TIMEOUT ((ULONG)0x00000010) -#define WAN_ERROR_ALIGNMENT ((ULONG)0x00000020) - -typedef struct _NDIS_MAC_FRAGMENT -{ - __in NDIS_HANDLE NdisLinkContext; - __in ULONG Errors; -} NDIS_MAC_FRAGMENT, *PNDIS_MAC_FRAGMENT; - -// -// NDIS WAN Information structures used -// by NDIS 5.0 Miniport drivers -// - -// -// Defines for the individual fields are the -// same as for NDIS 3.x/4.x Wan miniports. -// -// See the DDK. -// - -// -// Information that applies to all VC's on -// this adapter. -// -// OID: OID_WAN_CO_GET_INFO -// -typedef struct _NDIS_WAN_CO_INFO { - __out ULONG MaxFrameSize; - __out ULONG MaxSendWindow; - __out ULONG FramingBits; - __out ULONG DesiredACCM; -} NDIS_WAN_CO_INFO, *PNDIS_WAN_CO_INFO; - -// -// Set VC specific PPP framing information. -// -// OID: OID_WAN_CO_SET_LINK_INFO -// -typedef struct _NDIS_WAN_CO_SET_LINK_INFO { - __in ULONG MaxSendFrameSize; - __in ULONG MaxRecvFrameSize; - __in ULONG SendFramingBits; - __in ULONG RecvFramingBits; - __in ULONG SendCompressionBits; - __in ULONG RecvCompressionBits; - __in ULONG SendACCM; - __in ULONG RecvACCM; -} NDIS_WAN_CO_SET_LINK_INFO, *PNDIS_WAN_CO_SET_LINK_INFO; - -// -// Get VC specific PPP framing information. -// -// OID: OID_WAN_CO_GET_LINK_INFO -// -typedef struct _NDIS_WAN_CO_GET_LINK_INFO { - __out ULONG MaxSendFrameSize; - __out ULONG MaxRecvFrameSize; - __out ULONG SendFramingBits; - __out ULONG RecvFramingBits; - __out ULONG SendCompressionBits; - __out ULONG RecvCompressionBits; - __out ULONG SendACCM; - __out ULONG RecvACCM; -} NDIS_WAN_CO_GET_LINK_INFO, *PNDIS_WAN_CO_GET_LINK_INFO; - -// -// Get VC specific PPP compression information -// -// OID: OID_WAN_CO_GET_COMP_INFO -// -typedef struct _NDIS_WAN_CO_GET_COMP_INFO { - __out NDIS_WAN_COMPRESS_INFO SendCapabilities; - __out NDIS_WAN_COMPRESS_INFO RecvCapabilities; -} NDIS_WAN_CO_GET_COMP_INFO, *PNDIS_WAN_CO_GET_COMP_INFO; - - -// -// Set VC specific PPP compression information -// -// OID: OID_WAN_CO_SET_COMP_INFO -// -typedef struct _NDIS_WAN_CO_SET_COMP_INFO { - __in NDIS_WAN_COMPRESS_INFO SendCapabilities; - __in NDIS_WAN_COMPRESS_INFO RecvCapabilities; -} NDIS_WAN_CO_SET_COMP_INFO, *PNDIS_WAN_CO_SET_COMP_INFO; - - -// -// Get VC specific statistics -// -// OID: OID_WAN_CO_GET_STATS_INFO -// -typedef struct _NDIS_WAN_CO_GET_STATS_INFO { - __out ULONG BytesSent; - __out ULONG BytesRcvd; - __out ULONG FramesSent; - __out ULONG FramesRcvd; - __out ULONG CRCErrors; // Serial-like info only - __out ULONG TimeoutErrors; // Serial-like info only - __out ULONG AlignmentErrors; // Serial-like info only - __out ULONG SerialOverrunErrors; // Serial-like info only - __out ULONG FramingErrors; // Serial-like info only - __out ULONG BufferOverrunErrors; // Serial-like info only - __out ULONG BytesTransmittedUncompressed; // Compression info only - __out ULONG BytesReceivedUncompressed; // Compression info only - __out ULONG BytesTransmittedCompressed; // Compression info only - __out ULONG BytesReceivedCompressed; // Compression info only - __out ULONG TunnelPacketsRecieved; - __out ULONG TunnelRecievePacketsPending; - __out ULONG TunnelPacketsIndicatedUp; - __out ULONG TunnelRecievePacketsRejected; - __out ULONG TunnelPacketsSent; - __out ULONG TunnelPacketsSentComplete; - __out ULONG TunnelTransmitPacketsPending; - __out ULONG TunnelPacketsTransmitError; - __out ULONG TunnelPacketsSentError; - __out ULONG TunnelTransmitPacketsRejected; - __out ULONG TunnelAcksSent; - __out ULONG TunnelAcksSentComplete; - __out ULONG TunnelGeneric1; - __out ULONG TunnelGeneric2; - __out ULONG TunnelGeneric3; -} NDIS_WAN_CO_GET_STATS_INFO, *PNDIS_WAN_CO_GET_STATS_INFO; - -// -// Used to notify NdisWan of Errors. See error -// bit mask in ndiswan.h -// -// NDIS_STATUS: NDIS_STATUS_WAN_CO_FRAGMENT -// -typedef struct _NDIS_WAN_CO_FRAGMENT { - __in ULONG Errors; -} NDIS_WAN_CO_FRAGMENT, *PNDIS_WAN_CO_FRAGMENT; - -// -// Used to notify NdisWan of changes in link speed and -// send window. Can be given at any time. NdisWan will honor -// any send window (even zero). NdisWan will default zero -// TransmitSpeed/ReceiveSpeed settings to 28.8Kbs. -// -// NDIS_STATUS: NDIS_STATUS_WAN_CO_LINKPARAMS -// -typedef struct _WAN_CO_LINKPARAMS { - ULONG TransmitSpeed; // Transmit speed of the VC in Bytes/sec - ULONG ReceiveSpeed; // Receive speed of the VC in Bytes/sec - ULONG SendWindow; // Current send window for the VC -} WAN_CO_LINKPARAMS, *PWAN_CO_LINKPARAMS; - - -// -// Used to notify NdisWan of changes in link speed and -// send window. Can be given at any time. NdisWan will honor -// any send window (even zero). NdisWan will default zero -// TransmitSpeed/ReceiveSpeed settings to 28.8Kbs. -// -// NDIS_STATUS: NDIS_STATUS_WAN_CO_MTULINKPARAMS -// - -typedef struct _WAN_CO_MTULINKPARAMS { - ULONG Version; // Specifies the version: In future it can be extended using this version field: Current Supported version: 1 - ULONG TransmitSpeed; // Transmit speed of the VC in Bytes/sec - ULONG ReceiveSpeed; // Receive speed of the VC in Bytes/sec - ULONG SendWindow; // Current send window for the VC - ULONG MTU; // MTU for the current Vc -} WAN_CO_MTULINKPARAMS, *PWAN_CO_MTULINKPARAMS; - -#endif // _NDIS_WAN - diff --git a/qt-correction-tool/pub/ddk/ndiswwan.h b/qt-correction-tool/pub/ddk/ndiswwan.h deleted file mode 100644 index 21652bf..0000000 --- a/qt-correction-tool/pub/ddk/ndiswwan.h +++ /dev/null @@ -1,285 +0,0 @@ -/*++ -Copyright (c) 2007 Microsoft Corporation - -Module Name: - ndiswwan.h - -Abstract: - Header file for WWAN structures - -Revision History: - DATE DESCRIPTION - ------------ ----------- - 23-FEB-2007 V0.40 Driver Model Compliant - 23-MAY-2007 V0.50 Driver Model Compliant - 02-APR-2008 V1.00 Driver Model Compliant ---*/ - -#ifndef __NDIS_WWAN_DECL__ -#define __NDIS_WWAN_DECL__ - -/////////////////////////////////////////////////////////////////////////// -// wwansvc requests // -/////////////////////////////////////////////////////////////////////////// - -#define NDIS_WWAN_DRIVER_CAPS_REVISION_1 1 - -typedef struct _NDIS_WWAN_DRIVER_CAPS { - NDIS_OBJECT_HEADER Header; - WWAN_DRIVER_CAPS DriverCaps; -} NDIS_WWAN_DRIVER_CAPS, *PNDIS_WWAN_DRIVER_CAPS; - -#define NDIS_WWAN_SERVICE_ACTIVATION_REVISION_1 1 - -typedef struct _NDIS_WWAN_SERVICE_ACTIVATION { - NDIS_OBJECT_HEADER Header; - WWAN_SERVICE_ACTIVATION ServiceActivation; -} NDIS_WWAN_SERVICE_ACTIVATION, *PNDIS_WWAN_SERVICE_ACTIVATION; - -#define NDIS_WWAN_SET_RADIO_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_RADIO_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_RADIO RadioAction; -} NDIS_WWAN_SET_RADIO_STATE, *PNDIS_WWAN_SET_RADIO_STATE; - -#define NDIS_WWAN_SET_PIN_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_PIN { - NDIS_OBJECT_HEADER Header; - WWAN_PIN_ACTION PinAction; -} NDIS_WWAN_SET_PIN, *PNDIS_WWAN_SET_PIN; - -#define NDIS_WWAN_SET_PREFERRED_PROVIDERS_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_PREFERRED_PROVIDERS { - NDIS_OBJECT_HEADER Header; - WWAN_LIST_HEADER PreferredListHeader; -} NDIS_WWAN_SET_PREFERRED_PROVIDERS, *PNDIS_WWAN_SET_PREFERRED_PROVIDERS; - -#define NDIS_WWAN_SET_REGISTER_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_REGISTER_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_SET_REGISTER_STATE SetRegisterState; -} NDIS_WWAN_SET_REGISTER_STATE, *PNDIS_WWAN_SET_REGISTER_STATE; - -#define NDIS_WWAN_SET_SIGNAL_INDICATION_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_SIGNAL_INDICATION { - NDIS_OBJECT_HEADER Header; - WWAN_SET_SIGNAL_INDICATION SignalIndication; -} NDIS_WWAN_SET_SIGNAL_INDICATION, *PNDIS_WWAN_SET_SIGNAL_INDICATION; - -#define NDIS_WWAN_SET_PACKET_SERVICE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_PACKET_SERVICE { - NDIS_OBJECT_HEADER Header; - WWAN_PACKET_SERVICE_ACTION PacketServiceAction; -} NDIS_WWAN_SET_PACKET_SERVICE, *PNDIS_WWAN_SET_PACKET_SERVICE; - -#define NDIS_WWAN_SET_PROVISIONED_CONTEXT_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_PROVISIONED_CONTEXT { - NDIS_OBJECT_HEADER Header; - WWAN_SET_CONTEXT ProvisionedContext; -} NDIS_WWAN_SET_PROVISIONED_CONTEXT, *PNDIS_WWAN_SET_PROVISIONED_CONTEXT; - -#define NDIS_WWAN_SET_CONTEXT_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_CONTEXT_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_SET_CONTEXT_STATE SetContextState; -} NDIS_WWAN_SET_CONTEXT_STATE, *PNDIS_WWAN_SET_CONTEXT_STATE; - -#define NDIS_WWAN_SET_SMS_CONFIGURATION_REVISION_1 1 - -typedef struct _NDIS_WWAN_SET_SMS_CONFIGURATION { - NDIS_OBJECT_HEADER Header; - WWAN_SET_SMS_CONFIGURATION SetSmsConfiguration; -} NDIS_WWAN_SET_SMS_CONFIGURATION, *PNDIS_WWAN_SET_SMS_CONFIGURATION; - -#define NDIS_WWAN_SMS_READ_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_READ { - NDIS_OBJECT_HEADER Header; - WWAN_SMS_READ SmsRead; -} NDIS_WWAN_SMS_READ, *PNDIS_WWAN_SMS_READ; - -#define NDIS_WWAN_SMS_SEND_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_SEND { - NDIS_OBJECT_HEADER Header; - WWAN_SMS_SEND SmsSend; -} NDIS_WWAN_SMS_SEND, *PNDIS_WWAN_SMS_SEND; - -#define NDIS_WWAN_SMS_DELETE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_DELETE { - NDIS_OBJECT_HEADER Header; - WWAN_SMS_FILTER SmsFilter; -} NDIS_WWAN_SMS_DELETE, *PNDIS_WWAN_SMS_DELETE; - -/////////////////////////////////////////////////////////////////////////// -// device indications and responses // -/////////////////////////////////////////////////////////////////////////// - -#define NDIS_WWAN_DEVICE_CAPS_REVISION_1 1 - -typedef struct _NDIS_WWAN_DEVICE_CAPS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_DEVICE_CAPS DeviceCaps; -} NDIS_WWAN_DEVICE_CAPS, *PNDIS_WWAN_DEVICE_CAPS; - -#define NDIS_WWAN_READY_INFO_REVISION_1 1 - -typedef struct _NDIS_WWAN_READY_INFO { - NDIS_OBJECT_HEADER Header; - WWAN_READY_INFO ReadyInfo; -} NDIS_WWAN_READY_INFO, *PNDIS_WWAN_READY_INFO; - -#define NDIS_WWAN_SERVICE_ACTIVATION_STATUS_REVISION_1 1 - -typedef struct _NDIS_WWAN_SERVICE_ACTIVATION_STATUS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_SERVICE_ACTIVATION_STATUS ServiceActivationStatus; -} NDIS_WWAN_SERVICE_ACTIVATION_STATUS, *PNDIS_WWAN_SERVICE_ACTIVATION_STATUS; - -#define NDIS_WWAN_VENDOR_SPECIFIC_REVISION_1 1 - -typedef struct _NDIS_WWAN_VENDOR_SPECIFIC { - NDIS_OBJECT_HEADER Header; - WWAN_VENDOR_SPECIFIC VendorSpecificData; -} NDIS_WWAN_VENDOR_SPECIFIC, *PNDIS_WWAN_VENDOR_SPECIFIC; - -#define NDIS_WWAN_RADIO_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_RADIO_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_RADIO_STATE RadioState; -} NDIS_WWAN_RADIO_STATE, *PNDIS_WWAN_RADIO_STATE; - -#define NDIS_WWAN_PIN_INFO_REVISION_1 1 - -typedef struct _NDIS_WWAN_PIN_INFO { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_PIN_INFO PinInfo; -} NDIS_WWAN_PIN_INFO, *PNDIS_WWAN_PIN_INFO; - -#define NDIS_WWAN_PIN_LIST_REVISION_1 1 - -typedef struct _NDIS_WWAN_PIN_LIST { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_PIN_LIST PinList; -} NDIS_WWAN_PIN_LIST, *PNDIS_WWAN_PIN_LIST; - -#define NDIS_WWAN_HOME_PROVIDER_REVISION_1 1 - -typedef struct _NDIS_WWAN_HOME_PROVIDER { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_PROVIDER Provider; -} NDIS_WWAN_HOME_PROVIDER, *PNDIS_WWAN_HOME_PROVIDER; - -#define NDIS_WWAN_PREFERRED_PROVIDERS_REVISION_1 1 - -typedef struct _NDIS_WWAN_PREFERRED_PROVIDERS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_LIST_HEADER PreferredListHeader; -} NDIS_WWAN_PREFERRED_PROVIDERS, *PNDIS_WWAN_PREFERRED_PROVIDERS; - -#define NDIS_WWAN_VISIBLE_PROVIDERS_REVISION_1 1 - -typedef struct _NDIS_WWAN_VISIBLE_PROVIDERS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_LIST_HEADER VisibleListHeader; -} NDIS_WWAN_VISIBLE_PROVIDERS, *PNDIS_WWAN_VISIBLE_PROVIDERS; - -#define NDIS_WWAN_REGISTRATION_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_REGISTRATION_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_REGISTRATION_STATE RegistrationState; -} NDIS_WWAN_REGISTRATION_STATE, *PNDIS_WWAN_REGISTRATION_STATE; - -#define NDIS_WWAN_SIGNAL_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SIGNAL_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_SIGNAL_STATE SignalState; -} NDIS_WWAN_SIGNAL_STATE, *PNDIS_WWAN_SIGNAL_STATE; - -#define NDIS_WWAN_PACKET_SERVICE_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_PACKET_SERVICE_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_PACKET_SERVICE PacketService; -} NDIS_WWAN_PACKET_SERVICE_STATE, *PNDIS_WWAN_PACKET_SERVICE_STATE; - -#define NDIS_WWAN_CONTEXT_STATE_REVISION_1 1 - -typedef struct _NDIS_WWAN_CONTEXT_STATE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_CONTEXT_STATE ContextState; -} NDIS_WWAN_CONTEXT_STATE, *PNDIS_WWAN_CONTEXT_STATE; - -#define NDIS_WWAN_PROVISIONED_CONTEXTS_REVISION_1 1 - -typedef struct _NDIS_WWAN_PROVISIONED_CONTEXTS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_LIST_HEADER ContextListHeader; -} NDIS_WWAN_PROVISIONED_CONTEXTS, *PNDIS_WWAN_PROVISIONED_CONTEXTS; - -#define NDIS_WWAN_SMS_CONFIGURATION_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_CONFIGURATION { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_SMS_CONFIGURATION SmsConfiguration; -} NDIS_WWAN_SMS_CONFIGURATION, *PNDIS_WWAN_SMS_CONFIGURATION; - -#define NDIS_WWAN_SMS_RECEIVE_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_RECEIVE { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_LIST_HEADER SmsListHeader; -} NDIS_WWAN_SMS_RECEIVE, *PNDIS_WWAN_SMS_RECEIVE; - -#define NDIS_WWAN_SMS_SEND_STATUS_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_SEND_STATUS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - ULONG MessageReference; -} NDIS_WWAN_SMS_SEND_STATUS, *PNDIS_WWAN_SMS_SEND_STATUS; - -#define NDIS_WWAN_SMS_DELETE_STATUS_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_DELETE_STATUS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; -} NDIS_WWAN_SMS_DELETE_STATUS, *PNDIS_WWAN_SMS_DELETE_STATUS; - -#define NDIS_WWAN_SMS_STATUS_REVISION_1 1 - -typedef struct _NDIS_WWAN_SMS_STATUS { - NDIS_OBJECT_HEADER Header; - WWAN_STATUS uStatus; - WWAN_SMS_STATUS SmsStatus; -} NDIS_WWAN_SMS_STATUS, *PNDIS_WWAN_SMS_STATUS; - -#endif - diff --git a/qt-correction-tool/pub/ddk/ndr64types.h b/qt-correction-tool/pub/ddk/ndr64types.h deleted file mode 100644 index e418d70..0000000 --- a/qt-correction-tool/pub/ddk/ndr64types.h +++ /dev/null @@ -1,754 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ndr64types.h - -Abstract: - - Definitions for NDR64 format strings. - ---*/ - - - -#ifndef _NDR64TYPES_H -#define _NDR64TYPES_H - -#include - -#include // REVIEW: or just redefine GUID here -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning (disable: 4201) // nameless struct/union -#pragma warning (disable: 4214) // bitfield - - -typedef const void * FormatInfoRef; -#define INVALID_FRAGMENT_ID 0 - -/* -* Format string types -*/ -typedef unsigned __int8 NDR64_UINT8; -typedef unsigned __int16 NDR64_UINT16; -typedef unsigned __int32 NDR64_UINT32; -typedef unsigned __int64 NDR64_UINT64; - -typedef __int8 NDR64_INT8; -typedef __int16 NDR64_INT16; -typedef __int32 NDR64_INT32; -typedef __int64 NDR64_INT64; - -typedef NDR64_UINT8 NDR64_FORMAT_CHAR; -typedef const void * PNDR64_FORMAT; -typedef NDR64_UINT8 NDR64_ALIGNMENT; -typedef NDR64_UINT32 NDR64_FORMAT_UINT32; - - -#define NDR64_FC_EXPLICIT_HANDLE 0 -#define NDR64_FC_BIND_GENERIC 1 -#define NDR64_FC_BIND_PRIMITIVE 2 -#define NDR64_FC_AUTO_HANDLE 3 -#define NDR64_FC_CALLBACK_HANDLE 4 -#define NDR64_FC_NO_HANDLE 5 - - -#if defined(__RPC_WIN32__) -typedef NDR64_INT32 NDR64_PTR_WIRE_TYPE; -#else -typedef NDR64_INT64 NDR64_PTR_WIRE_TYPE; -#endif - -#define NDR64_PTR_WIRE_ALIGN (sizeof(NDR64_PTR_WIRE_TYPE)-1) - -typedef NDR64_UINT64 NDR64_WIRE_COUNT_TYPE; -#define NDR64_WIRE_COUNT_ALIGN (sizeof(NDR64_WIRE_COUNT_TYPE)-1) - -// -// Procedures and parameters -// - -typedef struct _NDR64_PROC_FLAGS -{ - NDR64_UINT32 HandleType : 3; // 0x00000000 - NDR64_UINT32 ProcType : 3; // 0x00000008 - NDR64_UINT32 IsInterpreted : 2; // 0x00000040 - NDR64_UINT32 IsObject : 1; // 0x00000100 - NDR64_UINT32 IsAsync : 1; // 0x00000200 - NDR64_UINT32 IsEncode : 1; // 0x00000400 - NDR64_UINT32 IsDecode : 1; // 0x00000800 - NDR64_UINT32 UsesFullPtrPackage : 1; // 0x00001000 - NDR64_UINT32 UsesRpcSmPackage : 1; // 0x00002000 - NDR64_UINT32 UsesPipes : 1; // 0x00004000 - NDR64_UINT32 HandlesExceptions : 2; // 0x00008000 - NDR64_UINT32 ServerMustSize : 1; // 0x00020000 - NDR64_UINT32 ClientMustSize : 1; // 0x00040000 - NDR64_UINT32 HasReturn : 1; // 0x00080000 - NDR64_UINT32 HasComplexReturn : 1; // 0x00100000 - NDR64_UINT32 ServerHasCorrelation : 1; // 0x00200000 - NDR64_UINT32 ClientHasCorrelation : 1; // 0x00400000 - NDR64_UINT32 HasNotify : 1; // 0x00800000 - NDR64_UINT32 HasOtherExtensions : 1; // 0x01000000 - NDR64_UINT32 HasBigByValueParam : 1; // 0x02000000 - NDR64_UINT32 Reserved : 6; // 0x04000000 -} NDR64_PROC_FLAGS; - -typedef struct _NDR64_RPC_FLAGS -{ - NDR64_UINT16 Idempotent : 1; - NDR64_UINT16 Broadcast : 1; - NDR64_UINT16 Maybe : 1; - NDR64_UINT16 Reserved0 : 1; - NDR64_UINT16 HasGuarantee : 1; - NDR64_UINT16 Reserved1 : 3; - NDR64_UINT16 Message : 1; - NDR64_UINT16 Reserved2 : 4; - NDR64_UINT16 InputSynchronous : 1; - NDR64_UINT16 Asynchronous : 1; - NDR64_UINT16 Reserved3 : 1; -} NDR64_RPC_FLAGS; - - -typedef struct _NDR64_PROC_FORMAT -{ - NDR64_UINT32 Flags; - NDR64_UINT32 StackSize; - NDR64_UINT32 ConstantClientBufferSize; - NDR64_UINT32 ConstantServerBufferSize; - NDR64_UINT16 RpcFlags; - NDR64_UINT16 FloatDoubleMask; - NDR64_UINT16 NumberOfParams; - NDR64_UINT16 ExtensionSize; -} NDR64_PROC_FORMAT, *PNDR64_PROC_FORMAT; - -typedef struct _NDR64_PARAM_FLAGS -{ - NDR64_UINT16 MustSize : 1; - NDR64_UINT16 MustFree : 1; - NDR64_UINT16 IsPipe : 1; - NDR64_UINT16 IsIn : 1; - NDR64_UINT16 IsOut : 1; - NDR64_UINT16 IsReturn : 1; - NDR64_UINT16 IsBasetype : 1; - NDR64_UINT16 IsByValue : 1; - NDR64_UINT16 IsSimpleRef : 1; - NDR64_UINT16 IsDontCallFreeInst : 1; - NDR64_UINT16 SaveForAsyncFinish : 1; - NDR64_UINT16 IsPartialIgnore : 1; - NDR64_UINT16 IsForceAllocate : 1; - NDR64_UINT16 Reserved : 2; - NDR64_UINT16 UseCache : 1; -} NDR64_PARAM_FLAGS; - - -typedef struct _NDR64_PARAM_FORMAT -{ - PNDR64_FORMAT Type; - NDR64_PARAM_FLAGS Attributes; - NDR64_UINT16 Reserved; - NDR64_UINT32 StackOffset; -} NDR64_PARAM_FORMAT, *PNDR64_PARAM_FORMAT; - - -// -// Base types -// - -typedef struct _NDR64_RANGE_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_FORMAT_CHAR RangeType; - NDR64_UINT16 Reserved; - NDR64_INT64 MinValue; - NDR64_INT64 MaxValue; -} NDR64_RANGE_FORMAT; - -// -// Handles & bindings -// - -typedef struct _NDR64_CONTEXT_HANDLE_FLAGS -{ - NDR64_UINT8 CannotBeNull : 1; - NDR64_UINT8 Serialize : 1; - NDR64_UINT8 NoSerialize : 1; - NDR64_UINT8 Strict : 1; - NDR64_UINT8 IsReturn : 1; - NDR64_UINT8 IsOut : 1; - NDR64_UINT8 IsIn : 1; - NDR64_UINT8 IsViaPointer : 1; -} NDR64_CONTEXT_HANDLE_FLAGS; - -typedef struct _NDR64_CONTEXT_HANDLE_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 ContextFlags; - NDR64_UINT8 RundownRoutineIndex; - NDR64_UINT8 Ordinal; -} NDR64_CONTEXT_HANDLE_FORMAT; - -typedef struct _NDR64_BIND_PRIMITIVE -{ - NDR64_FORMAT_CHAR HandleType; - NDR64_UINT8 Flags; - NDR64_UINT16 StackOffset; - NDR64_UINT16 Reserved; -} NDR64_BIND_PRIMITIVE; - -typedef struct _NDR64_BIND_GENERIC -{ - NDR64_FORMAT_CHAR HandleType; - NDR64_UINT8 Flags; - NDR64_UINT16 StackOffset; - NDR64_UINT8 RoutineIndex; - NDR64_UINT8 Size; -} NDR64_BIND_GENERIC; - -typedef struct _NDR64_BIND_CONTEXT -{ - NDR64_FORMAT_CHAR HandleType; - NDR64_UINT8 Flags; - NDR64_UINT16 StackOffset; - NDR64_UINT8 RoutineIndex; - NDR64_UINT8 Ordinal; -} NDR64_BIND_CONTEXT; - -typedef union _NDR64_BINDINGS -{ - NDR64_BIND_PRIMITIVE Primitive; - NDR64_BIND_GENERIC Generic; - NDR64_BIND_CONTEXT Context; -} NDR64_BINDINGS; - -// NOTE: The type of the Binding member below is actually NDR64_BINDINGS. -// We use NDR64_BIND_CONTEXT because it has essentially the same -// signature as the others and it makes static initilization clearer. - -typedef struct _NDR64_BIND_AND_NOTIFY_EXTENSION -{ - NDR64_BIND_CONTEXT Binding; - NDR64_UINT16 NotifyIndex; -} NDR64_BIND_AND_NOTIFY_EXTENSION; - - -// -// Pointers -// - -typedef struct _NDR64_POINTER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 Reserved; - PNDR64_FORMAT Pointee; -} NDR64_POINTER_FORMAT; - -typedef struct _NDR64_NO_REPEAT_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 Reserved1; - NDR64_UINT32 Reserved2; -} NDR64_NO_REPEAT_FORMAT; - -typedef struct _NDR64_POINTER_INSTANCE_HEADER_FORMAT -{ - NDR64_UINT32 Offset; - NDR64_UINT32 Reserved; -} NDR64_POINTER_INSTANCE_HEADER_FORMAT; - -typedef struct _NDR64_POINTER_REPEAT_FLAGS -{ - NDR64_UINT8 SetCorrMark : 1; - NDR64_UINT8 Reserved : 7; -} NDR64_POINTER_REPEAT_FLAGS, *PNDR64_POINTER_REPEAT_FLAGS; - -typedef struct _NDR64_REPEAT_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_POINTER_REPEAT_FLAGS Flags; - NDR64_UINT16 Reserved; - NDR64_UINT32 Increment; - NDR64_UINT32 OffsetToArray; - NDR64_UINT32 NumberOfPointers; -} NDR64_REPEAT_FORMAT, *PNDR64_REPEAT_FORMAT; - -typedef struct _NDR64_FIXED_REPEAT_FORMAT -{ - NDR64_REPEAT_FORMAT RepeatFormat; - NDR64_UINT32 Iterations; - NDR64_UINT32 Reserved; -} NDR64_FIXED_REPEAT_FORMAT, *PNDR64_FIXED_REPEAT_FORMAT; - -typedef struct _NDR64_IID_FLAGS -{ - NDR64_UINT8 ConstantIID : 1; - NDR64_UINT8 Reserved : 7; -} NDR64_IID_FLAGS; - -typedef struct _NDR64_CONSTANT_IID_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 Reserved; - GUID Guid; -} NDR64_CONSTANT_IID_FORMAT; - -typedef struct _NDR64_IID_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 Reserved; - PNDR64_FORMAT IIDDescriptor; -} NDR64_IID_FORMAT; - -// -// Structures -// - -typedef struct _NDR64_STRUCTURE_FLAGS -{ - NDR64_UINT8 HasPointerInfo : 1; /* 1 */ - NDR64_UINT8 HasMemberInfo : 1; /* 2 */ - NDR64_UINT8 HasConfArray : 1; /* 3 */ - NDR64_UINT8 HasOrigPointerInfo : 1; /* 4 */ - NDR64_UINT8 HasOrigMemberInfo : 1; /* 5 */ - NDR64_UINT8 Reserved1 : 1; /* 6 */ - NDR64_UINT8 Reserved2 : 1; /* 7 */ - NDR64_UINT8 Reserved3 : 1; /* 8 */ -} NDR64_STRUCTURE_FLAGS; - -typedef struct _NDR64_STRUCTURE_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_STRUCTURE_FLAGS Flags; - NDR64_UINT8 Reserve; - NDR64_UINT32 MemorySize; -} NDR64_STRUCTURE_HEADER_FORMAT; - -typedef struct _NDR64_CONF_STRUCTURE_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_STRUCTURE_FLAGS Flags; - NDR64_UINT8 Reserve; - NDR64_UINT32 MemorySize; - PNDR64_FORMAT ArrayDescription; -} NDR64_CONF_STRUCTURE_HEADER_FORMAT; - -typedef struct _NDR64_BOGUS_STRUCTURE_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_STRUCTURE_FLAGS Flags; - NDR64_UINT8 Reserve; - NDR64_UINT32 MemorySize; - PNDR64_FORMAT OriginalMemberLayout; - PNDR64_FORMAT OriginalPointerLayout; - PNDR64_FORMAT PointerLayout; -} NDR64_BOGUS_STRUCTURE_HEADER_FORMAT; - -typedef struct _NDR64_CONF_BOGUS_STRUCTURE_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_STRUCTURE_FLAGS Flags; - NDR64_UINT8 Dimensions; - NDR64_UINT32 MemorySize; - PNDR64_FORMAT OriginalMemberLayout; - PNDR64_FORMAT OriginalPointerLayout; - PNDR64_FORMAT PointerLayout; - PNDR64_FORMAT ConfArrayDescription; -} NDR64_CONF_BOGUS_STRUCTURE_HEADER_FORMAT; - -/* -* Structure member layout components -*/ - -typedef struct _NDR64_SIMPLE_MEMBER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Reserved1; - NDR64_UINT16 Reserved2; - NDR64_UINT32 Reserved3; -} NDR64_SIMPLE_MEMBER_FORMAT; - -typedef struct _NDR64_MEMPAD_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Reserve1; - NDR64_UINT16 MemPad; - NDR64_UINT32 Reserved2; -} NDR64_MEMPAD_FORMAT; - -typedef struct _NDR64_EMBEDDED_COMPLEX_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Reserve1; - NDR64_UINT16 Reserve2; - PNDR64_FORMAT Type; -} NDR64_EMBEDDED_COMPLEX_FORMAT; - -typedef struct _NDR64_BUFFER_ALIGN_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_UINT16 Reserved; - NDR64_UINT32 Reserved2; -} NDR64_BUFFER_ALIGN_FORMAT; - -typedef struct _NDR64_SIMPLE_REGION_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_UINT16 RegionSize; - NDR64_UINT32 Reserved; -} NDR64_SIMPLE_REGION_FORMAT; - -// -// Unions -// - -typedef struct _NDR64_ENCAPSULATED_UNION -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Alignment; - NDR64_UINT8 Flags; - NDR64_FORMAT_CHAR SwitchType; - NDR64_UINT32 MemoryOffset; - NDR64_UINT32 MemorySize; - NDR64_UINT32 Reserved; -} -NDR64_ENCAPSULATED_UNION; - -typedef struct _NDR64_NON_ENCAPSULATED_UNION -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Alignment; - NDR64_UINT8 Flags; - NDR64_FORMAT_CHAR SwitchType; - NDR64_UINT32 MemorySize; - PNDR64_FORMAT Switch; - NDR64_UINT32 Reserved; -} -NDR64_NON_ENCAPSULATED_UNION; - -typedef struct _NDR64_UNION_ARM_SELECTOR -{ - NDR64_UINT8 Reserved1; - NDR64_UINT8 Alignment; - NDR64_UINT16 Reserved2; - NDR64_UINT32 Arms; -} -NDR64_UNION_ARM_SELECTOR; - -typedef struct _NDR64_UNION_ARM -{ - NDR64_INT64 CaseValue; - PNDR64_FORMAT Type; - NDR64_UINT32 Reserved; -} -NDR64_UNION_ARM; - -/* -* Array related data -*/ - -typedef struct _NDR64_ARRAY_FLAGS -{ - NDR64_UINT8 HasPointerInfo : 1; /* 1 */ - NDR64_UINT8 HasElementInfo : 1; /* 2 */ - NDR64_UINT8 IsMultiDimensional : 1; /* 3 */ - NDR64_UINT8 IsArrayofStrings : 1; /* 4 */ - NDR64_UINT8 Reserved1 : 1; /* 5 */ - NDR64_UINT8 Reserved2 : 1; /* 6 */ - NDR64_UINT8 Reserved3 : 1; /* 7 */ - NDR64_UINT8 Reserved4 : 1; /* 8 */ -} NDR64_ARRAY_FLAGS; - -typedef struct _NDR64_ARRAY_ELEMENT_INFO -{ - NDR64_UINT32 ElementMemSize; - PNDR64_FORMAT Element; -} NDR64_ARRAY_ELEMENT_INFO; - -typedef struct _NDR64_FIX_ARRAY_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_ARRAY_FLAGS Flags; - NDR64_UINT8 Reserved; - NDR64_UINT32 TotalSize; -} NDR64_FIX_ARRAY_HEADER_FORMAT; - -typedef struct _NDR64_CONF_ARRAY_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_ARRAY_FLAGS Flags; - NDR64_UINT8 Reserved; - NDR64_UINT32 ElementSize; - PNDR64_FORMAT ConfDescriptor; -} NDR64_CONF_ARRAY_HEADER_FORMAT; - -typedef struct _NDR64_CONF_VAR_ARRAY_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_ARRAY_FLAGS Flags; - NDR64_UINT8 Reserved; - NDR64_UINT32 ElementSize; - PNDR64_FORMAT ConfDescriptor; - PNDR64_FORMAT VarDescriptor; -} NDR64_CONF_VAR_ARRAY_HEADER_FORMAT; - -typedef struct _NDR64_VAR_ARRAY_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_ARRAY_FLAGS Flags; - NDR64_UINT8 Reserved; - NDR64_UINT32 TotalSize; - NDR64_UINT32 ElementSize; - PNDR64_FORMAT VarDescriptor; -} NDR64_VAR_ARRAY_HEADER_FORMAT; - -typedef struct _NDR64_BOGUS_ARRAY_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_ALIGNMENT Alignment; - NDR64_ARRAY_FLAGS Flags; - NDR64_UINT8 NumberDims; - NDR64_UINT32 NumberElements; - PNDR64_FORMAT Element; -} NDR64_BOGUS_ARRAY_HEADER_FORMAT; - -typedef struct _NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT -{ - NDR64_BOGUS_ARRAY_HEADER_FORMAT FixedArrayFormat; - PNDR64_FORMAT ConfDescription; - PNDR64_FORMAT VarDescription; - PNDR64_FORMAT OffsetDescription; -} NDR64_CONF_VAR_BOGUS_ARRAY_HEADER_FORMAT; - -/* -* String related data. -*/ - -typedef struct _NDR64_STRING_FLAGS -{ - NDR64_UINT8 IsSized : 1; - NDR64_UINT8 IsRanged : 1; - NDR64_UINT8 Reserved3 : 1; - NDR64_UINT8 Reserved4 : 1; - NDR64_UINT8 Reserved5 : 1; - NDR64_UINT8 Reserved6 : 1; - NDR64_UINT8 Reserved7 : 1; - NDR64_UINT8 Reserved8 : 1; -} NDR64_STRING_FLAGS; - -typedef struct NDR64_STRING_HEADER_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_STRING_FLAGS Flags; - NDR64_UINT16 ElementSize; -} NDR64_STRING_HEADER_FORMAT; - -typedef struct _NDR64_NON_CONFORMANT_STRING_FORMAT -{ - NDR64_STRING_HEADER_FORMAT Header; - NDR64_UINT32 TotalSize; -} NDR64_NON_CONFORMANT_STRING_FORMAT; - -#if NTDDI_VERSION >= NTDDI_VISTA -typedef struct _NDR64_RANGED_STRING_FORMAT -{ - NDR64_STRING_HEADER_FORMAT Header; - NDR64_UINT32 Reserved; - NDR64_UINT64 Min; - NDR64_UINT64 Max; -} NDR64_RANGED_STRING_FORMAT; -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -typedef struct _NDR64_CONFORMANT_STRING_FORMAT -{ - NDR64_STRING_HEADER_FORMAT Header; -} NDR64_CONFORMANT_STRING_FORMAT; - -typedef struct NDR64_SIZED_CONFORMANT_STRING_FORMAT -{ - NDR64_STRING_HEADER_FORMAT Header; - PNDR64_FORMAT SizeDescription; -} NDR64_SIZED_CONFORMANT_STRING_FORMAT; - -// -// Correlation expressions -// - -typedef enum _tagEXPR_TOKEN -{ - FC_EXPR_START = 0, - FC_EXPR_ILLEGAL = FC_EXPR_START, - FC_EXPR_CONST32, - FC_EXPR_CONST64, - FC_EXPR_VAR, - FC_EXPR_OPER, - FC_EXPR_NOOP, // pad up the format string buffer. - FC_EXPR_END - -} EXPR_TOKEN; - -typedef struct _NDR64_EXPR_OPERATOR -{ - NDR64_FORMAT_CHAR ExprType; - NDR64_FORMAT_CHAR Operator; - NDR64_FORMAT_CHAR CastType; - NDR64_UINT8 Reserved; -} NDR64_EXPR_OPERATOR; - -typedef struct _NDR64_EXPR_CONST32 -{ - NDR64_FORMAT_CHAR ExprType; - NDR64_FORMAT_CHAR Reserved; - NDR64_UINT16 Reserved1; - NDR64_UINT32 ConstValue; -} NDR64_EXPR_CONST32; - -typedef struct _NDR64_EXPR_CONST64 -{ - NDR64_FORMAT_CHAR ExprType; - NDR64_FORMAT_CHAR Reserved; - NDR64_UINT16 Reserved1; - NDR64_INT64 ConstValue; -} NDR64_EXPR_CONST64; - -typedef struct _NDR64_EXPR_VAR -{ - NDR64_FORMAT_CHAR ExprType; - NDR64_FORMAT_CHAR VarType; - NDR64_UINT16 Reserved; - NDR64_UINT32 Offset; -} NDR64_EXPR_VAR; - -typedef struct _NDR64_EXPR_NOOP -{ - NDR64_FORMAT_CHAR ExprType; - NDR64_UINT8 Size; - NDR64_UINT16 Reserved; -} NDR64_EXPR_NOOP; - -// -// transmit_as, represent_as -// - -typedef struct _NDR64_TRANSMIT_AS_FLAGS -{ - NDR64_UINT8 PresentedTypeIsArray : 1; - NDR64_UINT8 PresentedTypeAlign4 : 1; - NDR64_UINT8 PresentedTypeAlign8 : 1; - NDR64_UINT8 Reserved : 5; -} NDR64_TRANSMIT_AS_FLAGS; - -typedef struct _NDR64_TRANSMIT_AS_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 RoutineIndex; - NDR64_UINT16 TransmittedTypeWireAlignment; - NDR64_UINT16 MemoryAlignment; - NDR64_UINT32 PresentedTypeMemorySize; - NDR64_UINT32 TransmittedTypeBufferSize; - PNDR64_FORMAT TransmittedType; -} NDR64_TRANSMIT_AS_FORMAT; - -typedef NDR64_TRANSMIT_AS_FORMAT NDR64_REPRESENT_AS_FORMAT; - -// -// user_marshal -// - -typedef struct _NDR64_USER_MARSHAL_FLAGS -{ - NDR64_UINT8 Reserved : 5; - NDR64_UINT8 IID : 1; - NDR64_UINT8 RefPointer : 1; - NDR64_UINT8 UniquePointer : 1; -} NDR64_USER_MARSHAL_FLAGS; - -typedef struct _NDR64_USER_MARSHAL_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT16 RoutineIndex; - NDR64_UINT16 TransmittedTypeWireAlignment; - NDR64_UINT16 MemoryAlignment; - NDR64_UINT32 UserTypeMemorySize; - NDR64_UINT32 TransmittedTypeBufferSize; - PNDR64_FORMAT TransmittedType; -} NDR64_USER_MARSHAL_FORMAT; - -// -// Pipes -// - -typedef struct NDR64_PIPE_FLAGS -{ - NDR64_UINT8 Reserved1 : 5; - NDR64_UINT8 HasRange : 1; - NDR64_UINT8 BlockCopy : 1; - NDR64_UINT8 Reserved2 : 1; -} NDR64_PIPE_FLAGS; - -typedef struct _NDR64_PIPE_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT8 Alignment; - NDR64_UINT8 Reserved; - PNDR64_FORMAT Type; - NDR64_UINT32 MemorySize; - NDR64_UINT32 BufferSize; -} NDR64_PIPE_FORMAT; - - -typedef struct _NDR64_RANGE_PIPE_FORMAT -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_UINT8 Flags; - NDR64_UINT8 Alignment; - NDR64_UINT8 Reserved; - PNDR64_FORMAT Type; - NDR64_UINT32 MemorySize; - NDR64_UINT32 BufferSize; - NDR64_UINT32 MinValue; - NDR64_UINT32 MaxValue; -} NDR64_RANGE_PIPE_FORMAT; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _NDR64_TYPE_STRICT_CONTEXT_HANDLE -{ - NDR64_FORMAT_CHAR FormatCode; - NDR64_FORMAT_CHAR RealFormatCode; - NDR64_UINT16 Reserved; - PNDR64_FORMAT Type; - NDR64_UINT32 CtxtFlags; - NDR64_UINT32 CtxtID; -} NDR64_TYPE_STRICT_CONTEXT_HANDLE; -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#include - -#endif //_NDR64TYPES_H - - diff --git a/qt-correction-tool/pub/ddk/netdma.h b/qt-correction-tool/pub/ddk/netdma.h deleted file mode 100644 index c6dcf81..0000000 --- a/qt-correction-tool/pub/ddk/netdma.h +++ /dev/null @@ -1,461 +0,0 @@ -/*++ - -Copyright (c) 2005-2006 Microsoft Corporation - -Module Name: - - netdma.h - -Abstract: - - This module contains function prototypes and definitons for memory to memory DMA - providers - -Author: - - -Revision history: - Nov 2006: Added support for a subset of IOAT V2 features (page break and descriptor ring) - Feb 2005: Original version - -Environment: - - kernel mode only - ---*/ -#ifndef _NET_DMA_H -#define _NET_DMA_H - -#if NTDDI_VERSION >= NTDDI_VISTASP1 - -#undef NET_DMA_EXPORT -#if defined(NET_DMA) -#define NET_DMA_EXPORT -#else -#define NET_DMA_EXPORT DECLSPEC_IMPORT -#endif - -// -// flags used in NET_DMA_DESCRIPTOR->ControlFlags -// -#define NET_DMA_INTERRUPT_ON_COMPLETION 0x00000001 -#define NET_DMA_SOURCE_NO_SNOOP 0x00000002 -#define NET_DMA_DESTINATION_NO_SNOOP 0x00000004 -#define NET_DMA_STATUS_UPDATE_ON_COMPLETION 0x00000008 -#define NET_DMA_SERIALIZE_TRANSFER 0x00000010 // fence bit -#define NET_DMA_NULL_TRANSFER 0x00000020 - -// -// new flags supported in NETDMA V2 -// - -#define NET_DMA_SOURCE_PAGE_BREAK 0x00000040 -#define NET_DMA_DESTINATION_PAGE_BREAK 0x00000080 -#define NET_DMA_DESTINATION_DCA_ENABLE 0x00000200 - -// -// flags used in NET_DMA_DESCRIPTOR->ControlFlags with NET_DMA_OP_TYPE_CONTEXT_CHANGE -// -#define NET_DMA_DCA_CONTEXT_CHANGE 0x00000001 - - -#define NET_DMA_OP_TYPE_STANDARD_DMA 0x00000000 -#define NET_DMA_OP_TYPE_CONTEXT_CHANGE 0xFF000000 - - -// -// The low 3 bits in "Completed Descriptor Address" are used -// to indicate the status of a DMA transfer. The physical and virtual address of -// "Completed Descriptor Address" of a DMA channel are specified -// by CompletionVirtualAddress and CompletionPhysicalAddress fields of -// NET_DMA_CHANNEL_PARAMETERS at the time of allocating a DMA channel -// -#define NET_DMA_TRANSFER_STATUS_MASK 0x00000007 - -typedef enum _NET_DMA_TRANSFER_STATUS -{ - NetDmaTransferStatusActive = 0, // 000 = Active, transfer completed successfully. This was -not- the last pending descriptor - NetDmaTransferStatusIdle = 1, // 001 = Idle, transfer completed successfully. This was the last pending descriptor - NetDmaTransferStatusSuspend = 2, // 010 = Suspend completed (no hard error). DMA channel is in Halt state - NetDmaTransferStatusHalted = 3, // 011 = Halted, operation aborted - NetDmaTransferStatusArmed = 4 // 100 = Armed, first descriptor has not yet completed and Completed Descriptor Address is not valid -} NET_DMA_TRANSFER_STATUS, *PNET_DMA_TRANSFER_STATUS; - - -// -// NET_DMA_DESCRIPTOR data structure is used to submit a dma transfer to DMA engine -// DMA descriptors can be chained together. Descriptor structure is modeled after -// CB DMA descriptors. DMA descriptors are aligned on 64 bit boundary -// -typedef struct _NET_DMA_DESCRIPTOR -{ - union - { - ULONG TransferSize; // DMA Transfer size - // DCA context = the APIC ID of the target CPU - struct - { - ULONG DCAContext:32; - }DCAContext32; - struct - { - ULONG DCAContext:16; - ULONG Reserved:16; - }DCAContext16; - struct - { - ULONG DCAContext:8; - ULONG Reserved:24; - }DCAContext8; - }; - - ULONG ControlFlags; // see NET_DMA_xxx flags - PHYSICAL_ADDRESS SourceAddress; // Source physical address - PHYSICAL_ADDRESS DestinationAddress; // Destination physical address - PHYSICAL_ADDRESS NextDescriptor; // Physical address of the next descriptor in the chain - union - { - ULONG64 Reserved1; // reserved for use by DMA engine (Provider) - PHYSICAL_ADDRESS NextSourceAddress; - }; - union - { - ULONG64 Reserved2; // reserved for use by DMA engine (Provider) - PHYSICAL_ADDRESS NextDestinationAddress; - }; - ULONG64 UserContext1; // Used by netdma driver and/or DMA client - ULONG64 UserContext2; // Used by netdma driver and/or DMA client -} NET_DMA_DESCRIPTOR, *PNET_DMA_DESCRIPTOR; - - -// -// DMA Provider entry points -// - -typedef struct _NET_DMA_CHANNEL_CPU_AFFINITY -{ - ULONG DmaChannel; - ULONG CpuNumber; -}NET_DMA_CHANNEL_CPU_AFFINITY,*PNET_DMA_CHANNEL_CPU_AFFINITY; - -// -// DMA channel CPU affinity handler. NETDMA calls this entry point to set the affinity -// policy of DMA channels -// -typedef -NTSTATUS -(*DMA_CHANNELS_CPU_AFFINITY_HANDLER)( - __in PVOID ProviderContext, // the Provider context passed to NetDmaRegisterProvider - __in PNET_DMA_CHANNEL_CPU_AFFINITY CpuAffinityArray, // see NET_DMA_CHANNEL_CPU_AFFINITY - __in ULONG CpuAffinityArraySize // size of CpuAffinityArray - ); - - -// -// NET_DMA_CHANNEL_PARAMETERS is used to set up a DMA channel -// at the time of allocating the channel -// - -#define NET_DMA_CHANNEL_REVISION_1 1 - -#define SIZEOF_NET_DMA_CHANNEL_PARAMETERS_REVISION_1 \ - RTL_SIZEOF_THROUGH_FIELD(NET_DMA_CHANNEL_PARAMETERS, CpuNumber) - -#if NTDDI_VERSION >= NTDDI_WIN7 - -#define NET_DMA_CHANNEL_REVISION_2 2 - -#define SIZEOF_NET_DMA_CHANNEL_PARAMETERS_REVISION_2 \ - RTL_SIZEOF_THROUGH_FIELD(NET_DMA_CHANNEL_PARAMETERS, ProcessorAffinityMaskEx) - -#endif - -typedef struct _NET_DMA_CHANNEL_PARAMETERS -{ - USHORT Revision; // Structure revision - USHORT Size; // size of this structure - ULONG Flags; // TBD - PVOID CompletionVirtualAddress; // the virtual address where the engine will write the completion status - PHYSICAL_ADDRESS CompletionPhysicalAddress; // the physical address where the engine will write the completion status - ULONG ProcessorAffinityMask; // bitmap of CPUs that this channel could be associated with (deprecated in Win7) - ULONG ChannelPriority; // per CB spec - ULONG CpuNumber; // provider will fill this with the CPU this channel is associated with -#if NTDDI_VERSION >= NTDDI_WIN7 - GROUP_AFFINITY ProcessorAffinityMaskEx; // group number and bitmap of CPUs that this channel could be associated with -#endif -} NET_DMA_CHANNEL_PARAMETERS, *PNET_DMA_CHANNEL_PARAMETERS; - -// -// DMA channel Allocate handler. NETDMA calls this entry point to allocate a DMA channel -// -typedef -NTSTATUS -(*DMA_CHANNEL_ALLOCATE_HANDLER)( - __in PVOID ProviderContext, // the Provider context passed to NetDmaRegisterProvider - __in PNET_DMA_CHANNEL_PARAMETERS ChannelParameters, // see NET_DMA_CHANNEL_PARAMETERS - __in PVOID NetDmaChannelHandle, // NETDMA handle for this channel. used by all calls from Provider to NETDMA regarding this channel - __deref_out PVOID * pProviderChannelContext // on return holds Provider context for this channel. used in all calls from NETDMA to provider regarding this channel - ); - -// -// NETDMA calls this entry point to free a DMA channel. When NETDMA calls this -// entry points, there are no outstanding DMA operations on this channel. Once -// NETDMA makes this call, it can not call the provider for any operation on the -// channel -// - -typedef -VOID -(*DMA_CHANNEL_FREE_HANDLER)( - __in PVOID ProviderChannelContext // Provider context for this channel (retuned from DMA_CHANNEL_ALLOCATE_HANDLER in pProviderChannelContext) - ); - -// -// NETDMA calls this entry point to start a DMA transfer -// -typedef -NTSTATUS -(*DMA_START_HANDLER)( - __in PVOID ProviderChannelContext, // Provider context for this channel - __in PNET_DMA_DESCRIPTOR DescriptorVirtualAddress, // pointer to the virtual address of the first descriptor - __in PHYSICAL_ADDRESS DescriptorPhysicalAddress, // pointer to the physical address of the first descriptor - __in ULONG DescriptorCount // number of descriptors - ); - -// -// NETDMA calls this entry point to suspend the DMA transfers -// currently in progress. The provider will return the -// physical address of the last DMA descriptor that it processed -// -typedef -NTSTATUS -(*DMA_SUSPEND_HANDLER)( - __in PVOID ProviderChannelContext, // Provider context for this channel - __deref_out PPHYSICAL_ADDRESS* pLastDescriptor // the physical address of the last processed descriptor - ); - -// -// NETDMA calls this entry point to resume DMA operations on -// a suspended DMA channel -// -typedef -NTSTATUS -(*DMA_RESUME_HANDLER)( - __in PVOID ProviderChannelContext // Provider context for this channel - ); - -// -// NETDMA calls this entry point to abort all DMA transfers -// that have been scheduled on a DMA channel -// -typedef -NTSTATUS -(*DMA_ABORT_HANDLER)( - __in PVOID ProviderChannelContext // Provider context for this channel - ); - -// -// NETDMA calls this entry point to append a chain of DMA descriptors -// to the last descriptor on a DMA channel -// -typedef -NTSTATUS -(*DMA_APPEND_HANDLER)( - __in PVOID ProviderChannelContext, // Provider context for this channel - __in PNET_DMA_DESCRIPTOR DescriptorVirtualAddress, // pointer to the virtual address of the first descriptor to append - __in PHYSICAL_ADDRESS DescriptorPhysicalAddress, // pointer to the physical address of the first descriptor to append - __in ULONG DescriptorCount // number of descriptors - ); - -// -// TBD: -// -typedef -NTSTATUS -(*DMA_RESET_HANDLER)( - __in PVOID ProviderChannelContext - ); - - -// -// DMA providers use NET_DMA_PROVIDER_CHARACTERISTICS structure in the call to -// NetDmaRegisterProvider -// -#define NET_DMA_PROVIDER_REVISION_1 1 -#define NET_DMA_PROVIDER_REVISION_2 2 - -// -// Flags for use in the NET_DMA_PROVIDER_CHARACTERISTICS structure -// -#define NET_DMA_PROVIDER_CHARACTERISTICS_DCA_SUPPORTED 0x00000001 - -#if NTDDI_VERSION >= NTDDI_WIN7 -#define NET_DMA_PROVIDER_SUPPORTS_PROC_GROUPS 0x00000002 -#endif - -// -// For back-compat with Vista headers -// -#if NTDDI_VERSION < NTDDI_WIN7 -#define NET_DMA_PROVIDER_ATTRIBUTES_DCA_SUPPORTED NET_DMA_PROVIDER_CHARACTERISTICS_DCA_SUPPORTED -#endif - - - -typedef struct _NET_DMA_PROVIDER_CHARACTERISTICS -{ - UCHAR MajorVersion; // Major version of the DMA provider - UCHAR MinorVersion; // Minor version of the DMA provider - USHORT Size; // the size of this structure - ULONG Flags; // Possible values listed below - PDEVICE_OBJECT PhysicalDeviceObject; // The physical device object PnP associates with this device - ULONG MaxDmaChannelCount; // Maximum number of DMA channels - DMA_CHANNELS_CPU_AFFINITY_HANDLER SetDmaChannelCpuAffinity; // Set channel CPU affinity handler - DMA_CHANNEL_ALLOCATE_HANDLER AllocateDmaChannel; // Allocate DMA channel handler - DMA_CHANNEL_FREE_HANDLER FreeDmaChannel; // Free DMA channel handler - DMA_START_HANDLER StartDma; // Start DMA handler - DMA_SUSPEND_HANDLER SuspendDma; // Suspend DMA handler - DMA_RESUME_HANDLER ResumeDma; // Resume DMA handler - DMA_ABORT_HANDLER AbortDma; // Abort DMA handler - DMA_APPEND_HANDLER AppendDma; // Append DMA handler - DMA_RESET_HANDLER ResetChannel; // Reset channel handler - UNICODE_STRING FriendlyName; // Provider's friendly name -} NET_DMA_PROVIDER_CHARACTERISTICS, *PNET_DMA_PROVIDER_CHARACTERISTICS; - -// -// DMA providers call NetDmaRegisterProvider to register an instance of a -// DMA provider. An instance of a DMA provider is associated with a device -// (DMA engine). Providers usually make this call in their AddDevice entry point. -// Note: the reason that the call has to be made during AddDevice and not -// START IRP is because allocating MSI-X resources has to be done in -// FILTER_RESOURCE_REQUIREMENTS that is sent to the device drivers before -// the START IRP -// -__drv_requiresIRQL(PASSIVE_LEVEL) -NET_DMA_EXPORT -NTSTATUS -NetDmaRegisterProvider( - __in PVOID ProviderContext, // Provider context for this device - __in PVOID * pNetDmaProviderHandle, // upon return, this will hold NETDMA handle for this device - __in PNET_DMA_PROVIDER_CHARACTERISTICS ProviderCharacteristics // provider's characteristics - ); - -// -// DMA providers call NetDmaDeregisterProvider to deregister a provider -// that was previously registered by a call to NetDmaRegisterProvider -// the call is usually made while handling REMOVE IRP. -// -__drv_requiresIRQL(PASSIVE_LEVEL) -NET_DMA_EXPORT -VOID -NetDmaDeregisterProvider( - __in PVOID NetDmaProviderHandle // Handle obtained by the call to NetDmaRegisterProvider - ); - -// -// DMA providers use this structure in the call to NetDmaProviderStart -// - -typedef struct _NET_DMA_PROVIDER_ATTRIBUTES -{ - UCHAR MajorHwVersion; // Major version of the DMA provider - UCHAR MinorHwVersion; // Minor version of the DMA provider - USHORT Size; // the size of this structure - ULONG Flags; // TBD - ULONG VendorId; // vendor ID - ULONG DmaChannelCount; // number of DMA channels - ULONG MaximumTransferSize; // Maximum DMA transfer size (minimum of 4K) - PHYSICAL_ADDRESS MaximumAddressSpace; // Maximum physical adddress that can be addressed by this device -} NET_DMA_PROVIDER_ATTRIBUTES, *PNET_DMA_PROVIDER_ATTRIBUTES; - -// -// DMA providers call NetDmaProviderStart to notify NETDMA that all the DMA channels -// on a provider are initialized and ready to be used. DMA providers call this API in the -// context of handling START IRP. -// -NET_DMA_EXPORT -VOID -NetDmaProviderStart( - __in PVOID NetDmaProviderHandle, // Handle obtained by the call to NetDmaRegisterProvider - __in PNET_DMA_PROVIDER_ATTRIBUTES ProviderAttributes // the provider's device attributes - ); - -// -// DMA providers call NetDmaProviderStop to notify NETDMA that a previously started -// DMA engine is no longer available. -// DMA providers call this API in the context of handling REMOVE or STOP IRP. NETDMA will wait -// for outstanding DMA operations to complete and frees all the DMA channels -// before returning back from this API -// -NET_DMA_EXPORT -VOID -NetDmaProviderStop( - __in PVOID NetDmaProviderHandle // Handle obtained by the call to NetDmaRegisterProvider - ); - -// -// DMA providers call NetDmaIsr in their ISR handler -// -NET_DMA_EXPORT -VOID -NetDmaIsr( - __in PVOID NetDmaChannelHandle, - __in PHYSICAL_ADDRESS DmaDescriptor, - __out PULONG pCpuNumber - ); - -// -// DMA providers call NetDmaInterruptDpc in their interrupt DPC handler -// -NET_DMA_EXPORT -VOID -NetDmaInterruptDpc( - __in PVOID NetDmaChannelHandle, // DMA channel - __in_opt PHYSICAL_ADDRESS DmaDescriptor // optional if this is called for reasons other DMA completion - ); - - -NET_DMA_EXPORT -UINT -NetDmaGetVersion( - VOID - ); - - -typedef enum _NET_DMA_PNP_NOTIFICATION_CODE -{ - NetDmaNotificationProviderRegistered = 1, // a provider has registered. not used by providers - NetDmaNotificationProviderArrival, // a provider is ready for use. not used by providers - NetDmaNotificationProviderRemoval, // a provider is about to be removed. not used by providers - NetDmaNotificationChannelArrival, // a DMA channel has become available. not used by providers - NetDmaNotificationProviderPowerDown, // the DMA provider is going to D3. - NetDmaNotificationProviderPowerUp, // the DMA provider is back to D0 - NetDmaNotificationMax -}NET_DMA_PNP_NOTIFICATION_CODE, *PNET_DMA_PNP_NOTIFICATION_CODE; - -#define NET_DMA_PNP_NOTIFICATION_REVISION_1 1 - -typedef struct _NET_DMA_PNP_NOTIFICATION -{ - ULONG StructureRevision; - ULONG StructureSize; - NET_DMA_PNP_NOTIFICATION_CODE NotificationCode; - PVOID Buffer; - ULONG BufferLength; -}NET_DMA_PNP_NOTIFICATION, *PNET_DMA_PNP_NOTIFICATION; - -// -// this API is available to Providers version 1.1 and above -// -NET_DMA_EXPORT -VOID -NetDmaPnPEventNotify( - __in PVOID NetDmaProviderHandle, // Provider handle - __in PNET_DMA_PNP_NOTIFICATION PnPEvent // PnP and Power Management event - ); - -#endif // NTDDI_VISTASP1 - -#endif //_NET_DMA_H - - diff --git a/qt-correction-tool/pub/ddk/netioddk.h b/qt-correction-tool/pub/ddk/netioddk.h deleted file mode 100644 index 622cc15..0000000 --- a/qt-correction-tool/pub/ddk/netioddk.h +++ /dev/null @@ -1,254 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - netioddk.h - -Abstract: - - This module contains the DDK definitions and structures for the - network I/O subsystem. - -Environment: - - kernel mode only - ---*/ - -#ifndef _NETIODDK_ -#define _NETIODDK_ -#pragma once - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#pragma warning(push) -#pragma warning(disable:4200) // zero-sized array in struct/union - - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// These types define the pointers to constant data supplied by a client -// or provider during its registration. The data pointed to must be -// kept valid for the life of the registration. -// - -typedef CONST struct _NPI_CLIENT_CHARACTERISTICS * PNPI_CLIENT_CHARACTERISTICS; -typedef CONST struct _NPI_PROVIDER_CHARACTERISTICS * PNPI_PROVIDER_CHARACTERISTICS; -typedef CONST struct _NPI_REGISTRATION_INSTANCE * PNPI_REGISTRATION_INSTANCE; - -// -// Network Programming Interface Registration Instance: represents a -// registration of an implementation of a specific network programming -// interface by a specific network module. The information in this structure -// is specified by the module implementing an instance of a network -// programming interface. -// - -typedef struct _NPI_REGISTRATION_INSTANCE { - USHORT Version; - USHORT Size; - PNPIID NpiId; - PNPI_MODULEID ModuleId; - ULONG Number; - CONST VOID *NpiSpecificCharacteristics OPTIONAL; -} NPI_REGISTRATION_INSTANCE; - - -// -// A Network Programming Interface (NPI) is a well-defined table of function -// pointers and a caller-specific handle representing the caller of the -// functions. The handle is usually passed as a parameter to the functions -// as defined by the specific network programming interface definition. -// This structure is a place holder to opaquely describe network programming -// interfaces. It is usually cast to a specific NPI structure for use. -// -typedef struct _NPI { - HANDLE Handle; - CONST VOID* Dispatch; -} NPI; - - -typedef -NTSTATUS -(NTAPI NPI_CLIENT_ATTACH_PROVIDER_FN)( - __in HANDLE NmrBindingHandle, - __in PVOID ClientContext, - __in PNPI_REGISTRATION_INSTANCE ProviderRegistrationInstance - ); -typedef NPI_CLIENT_ATTACH_PROVIDER_FN *PNPI_CLIENT_ATTACH_PROVIDER_FN; - - -typedef -NTSTATUS -(NTAPI NPI_CLIENT_DETACH_PROVIDER_FN )( - __in PVOID ClientBindingContext - ); -typedef NPI_CLIENT_DETACH_PROVIDER_FN *PNPI_CLIENT_DETACH_PROVIDER_FN; - - -typedef -VOID -(NTAPI NPI_CLIENT_CLEANUP_BINDING_CONTEXT_FN)( - __in PVOID ClientBindingContext - ); -typedef NPI_CLIENT_CLEANUP_BINDING_CONTEXT_FN *PNPI_CLIENT_CLEANUP_BINDING_CONTEXT_FN; - - -typedef struct _NPI_CLIENT_CHARACTERISTICS { - USHORT Version; - USHORT Length; - PNPI_CLIENT_ATTACH_PROVIDER_FN ClientAttachProvider; - PNPI_CLIENT_DETACH_PROVIDER_FN ClientDetachProvider; - PNPI_CLIENT_CLEANUP_BINDING_CONTEXT_FN ClientCleanupBindingContext; - NPI_REGISTRATION_INSTANCE ClientRegistrationInstance; -} NPI_CLIENT_CHARACTERISTICS; - - -// -// Definition for provider side of structures and prototypes. -// -typedef -NTSTATUS -(NTAPI NPI_PROVIDER_ATTACH_CLIENT_FN)( - __in HANDLE NmrBindingHandle, - __in PVOID ProviderContext, - __in PNPI_REGISTRATION_INSTANCE ClientRegistrationInstance, - __in PVOID ClientBindingContext, - __in CONST VOID *ClientDispatch, - __out PVOID *ProviderBindingContext, - __out CONST VOID* *ProviderDispatch - ); -typedef NPI_PROVIDER_ATTACH_CLIENT_FN *PNPI_PROVIDER_ATTACH_CLIENT_FN; - - -typedef -NTSTATUS -(NTAPI NPI_PROVIDER_DETACH_CLIENT_FN)( - __in PVOID ProviderBindingContext - ); -typedef NPI_PROVIDER_DETACH_CLIENT_FN *PNPI_PROVIDER_DETACH_CLIENT_FN; - - -typedef -VOID -(NTAPI NPI_PROVIDER_CLEANUP_BINDING_CONTEXT_FN)( - __in PVOID ProviderBindingContext - ); -typedef NPI_PROVIDER_CLEANUP_BINDING_CONTEXT_FN *PNPI_PROVIDER_CLEANUP_BINDING_CONTEXT_FN; - - -typedef struct _NPI_PROVIDER_CHARACTERISTICS { - USHORT Version; - USHORT Length; - PNPI_PROVIDER_ATTACH_CLIENT_FN ProviderAttachClient; - PNPI_PROVIDER_DETACH_CLIENT_FN ProviderDetachClient; - PNPI_PROVIDER_CLEANUP_BINDING_CONTEXT_FN ProviderCleanupBindingContext; - NPI_REGISTRATION_INSTANCE ProviderRegistrationInstance; -} NPI_PROVIDER_CHARACTERISTICS; - - -// -// Called by a module to register an instance of an implementation of the -// client side of a particular network programming interface. -// -NTSTATUS -NmrRegisterClient( - __in PNPI_CLIENT_CHARACTERISTICS ClientCharacteristics, - __in PVOID ClientContext, - __out PHANDLE NmrClientHandle - ); - -// -// Called by a module to un-register an instance of an implementation of the -// client side of a particular network programming interface. -// -NTSTATUS -NmrDeregisterClient( - __in HANDLE NmrClientHandle - ); - -// -// Called by a client to close a registration. -// -NTSTATUS -NmrWaitForClientDeregisterComplete( - __in HANDLE NmrClientHandle - ); - -// -// Called by a client module to attach itself to a provider. -// -NTSTATUS -NmrClientAttachProvider( - __in HANDLE NmrBindingHandle, - __in PVOID ClientBindingContext, - __in CONST VOID *ClientDispatch, - __out PVOID *ProviderBindingContext, - __out CONST VOID* *ProviderDispatch - ); - -// -// Called by a client module to indicate detach to a provider is -// complete. -// -VOID -NmrClientDetachProviderComplete( - __in HANDLE NmrBindingHandle - ); - - -// -// Called by a module to register an instance of an implementation of the -// provider side of a particular network programming interface. -// -NTSTATUS -NmrRegisterProvider( - __in PNPI_PROVIDER_CHARACTERISTICS ProviderCharacteristics, - __in PVOID ProviderContext, - __out PHANDLE NmrProviderHandle - ); - -// -// Called by a module to un-register an instance of an implementation of the -// provider side of a particular network programming interface. -// -NTSTATUS -NmrDeregisterProvider( - __in HANDLE NmrProviderHandle - ); - -// -// Called by a provider to close a registration. -// -NTSTATUS -NmrWaitForProviderDeregisterComplete( - __in HANDLE NmrProviderHandle - ); - -// -// Called by a provider module to notify NMR that a detach from client -// is complete. -// -VOID -NmrProviderDetachClientComplete( - __in HANDLE NmrBindingHandle - ); - -#endif // if (NTDDI_VERSION >= NTDDI_VISTA) - - -#pragma warning(pop) - -#ifdef __cplusplus -} -#endif - -#endif // _NETIODDK_ - diff --git a/qt-correction-tool/pub/ddk/netpnp.h b/qt-correction-tool/pub/ddk/netpnp.h deleted file mode 100644 index 9a0fa45..0000000 --- a/qt-correction-tool/pub/ddk/netpnp.h +++ /dev/null @@ -1,74 +0,0 @@ -#ifndef __NET_PNP__ -#define __NET_PNP__ - -#pragma once - -// -// PnP and PM event codes that can be indicated up to transports -// and clients. -// -typedef enum _NET_PNP_EVENT_CODE -{ - NetEventSetPower, - NetEventQueryPower, - NetEventQueryRemoveDevice, - NetEventCancelRemoveDevice, - NetEventReconfigure, - NetEventBindList, - NetEventBindsComplete, - NetEventPnPCapabilities, - NetEventPause, - NetEventRestart, - NetEventPortActivation, - NetEventPortDeactivation, - NetEventIMReEnableDevice, - NetEventMaximum -} NET_PNP_EVENT_CODE, *PNET_PNP_EVENT_CODE; - -// -// Networking PnP event indication structure. -// -typedef struct _NET_PNP_EVENT -{ - // - // Event code describing action to take. - // - NET_PNP_EVENT_CODE NetEvent; - - // - // Event specific data. - // - PVOID Buffer; - - // - // Length of event specific data. - // - ULONG BufferLength; - - // - // Reserved values are for use by respective components only. - // - // Note: these reserved areas must be pointer aligned. - // - - ULONG_PTR NdisReserved[4]; - ULONG_PTR TransportReserved[4]; - ULONG_PTR TdiReserved[4]; - ULONG_PTR TdiClientReserved[4]; -} NET_PNP_EVENT, *PNET_PNP_EVENT; - -// -// The following structure defines the device power states. -// -typedef enum _NET_DEVICE_POWER_STATE -{ - NetDeviceStateUnspecified = 0, - NetDeviceStateD0, - NetDeviceStateD1, - NetDeviceStateD2, - NetDeviceStateD3, - NetDeviceStateMaximum -} NET_DEVICE_POWER_STATE, *PNET_DEVICE_POWER_STATE; - -#endif // __NET_PNP__ - diff --git a/qt-correction-tool/pub/ddk/nodetype.h b/qt-correction-tool/pub/ddk/nodetype.h deleted file mode 100644 index 6cb5b16..0000000 --- a/qt-correction-tool/pub/ddk/nodetype.h +++ /dev/null @@ -1,243 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - NodeType.h - -Abstract: - - This module defines all of the node type codes used in the RDBSS. - Every major data structure in the file system is assigned a node - type code that is. This code is the first CSHORT in the structure and is - followed by a CSHORT containing the size, in bytes, of the structure. - -Author: -Revision History: - ---*/ - -#ifndef _NODETYPE_INCLUDED_ -#define _NODETYPE_INCLUDED_ - - -typedef USHORT NODE_TYPE_CODE; -typedef NODE_TYPE_CODE *PNODE_TYPE_CODE; -typedef CSHORT NODE_BYTE_SIZE; - -// -// So all records start with -// -// typedef struct _RECORD_NAME { -// NODE_TYPE_CODE NodeTypeCode; -// NODE_BYTE_SIZE NodeByteSize; -// : -// } RECORD_NAME, *PRECORD_NAME; -// - -#ifndef NodeType -#define NodeType(Ptr) (*((PNODE_TYPE_CODE)(Ptr))) -#endif - - -typedef struct _NODE_TYPE_CODE_AND_SIZE_NO_REFCOUNT { - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; -} NODE_TYPE_CODE_AND_SIZE_NO_REFCOUNT; - -#ifdef __cplusplus -typedef struct _NODE_TYPE_CODE_AND_SIZE : public NODE_TYPE_CODE_AND_SIZE_NO_REFCOUNT { -#else // !__cplusplus -typedef struct _NODE_TYPE_CODE_AND_SIZE { - NODE_TYPE_CODE_AND_SIZE_NO_REFCOUNT; -#endif // __cplusplus - - // - // this is for guys with reference counts....not everyone has one - // - - __volatile ULONG NodeReferenceCount; -} NODE_TYPE_CODE_AND_SIZE, *PNODE_TYPE_AND_SIZE; - - -#define ZeroAndInitializeNodeType(Ptr,TType,Size) {\ - RtlZeroMemory( Ptr, Size ); \ - ((NODE_TYPE_CODE_AND_SIZE *)(Ptr))->NodeTypeCode = TType; \ - ((NODE_TYPE_CODE_AND_SIZE *)(Ptr))->NodeByteSize = (CSHORT)Size; \ - } - - -// -// N O D E T Y P E S -// - - -// -// 0xeb00 was selected as being far from the other codes -// 0xec00 was added so that we could encode the structure type in the code. -// - -#define NTC_UNDEFINED ((NODE_TYPE_CODE)0x0000) - - - -#define RDBSS_STORAGE_NTC(x) (0xec00+(x)) - -// -// these are here to ensure that we don't use any of the old cairo storage types. -// - -#define StorageTypeDirectory (@@@) -#define StorageTypeFile (@@@) - -typedef enum _RX_FILE_TYPE { - FileTypeNotYetKnown = 0, - FileTypeDirectory = 2, - FileTypeFile = 3 -} RX_FILE_TYPE; - -// -// according to markz, i should plan on the number of STORAGE_NTCs growing to bytesize!! -// - -#define RDBSS_NTC_STORAGE_TYPE_UNKNOWN ((NODE_TYPE_CODE)0xec00) -#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY ((NODE_TYPE_CODE)0xec02) -#define RDBSS_NTC_STORAGE_TYPE_FILE ((NODE_TYPE_CODE)0xec03) - -#define RDBSS_NTC_OPENTARGETDIR_FCB ((NODE_TYPE_CODE)0xecff) // must be an fcb type and not the same -#define RDBSS_NTC_IPC_SHARE ((NODE_TYPE_CODE)0xecfe) -#define RDBSS_NTC_MAILSLOT ((NODE_TYPE_CODE)0xecfd) -#define RDBSS_NTC_SPOOLFILE ((NODE_TYPE_CODE)0xecfc) - -#define RDBSS_NTC_SRVCALL ((NODE_TYPE_CODE)0xeb10) -#define RDBSS_NTC_NETROOT ((NODE_TYPE_CODE)0xeb11) -#define RDBSS_NTC_V_NETROOT ((NODE_TYPE_CODE)0xeb12) - -// -// Local filesystems sometimes need volume opens. these are not yet -// implemented but we reserve the nodetype now. -// - -#define RDBSS_NTC_VOLUME_FCB ((NODE_TYPE_CODE)0xeb1f) - -#define RDBSS_NTC_SRVOPEN ((NODE_TYPE_CODE)0xeb1c) -#define RDBSS_NTC_INTERNAL_SRVOPEN ((NODE_TYPE_CODE)0xeb1d) -#define RDBSS_NTC_DEVICE_FCB ((NODE_TYPE_CODE)0xeb9a) - -#define RDBSS_NTC_DATA_HEADER ((NODE_TYPE_CODE)0xeb00) -#define RDBSS_NTC_VCB ((NODE_TYPE_CODE)0xeb01) -#define RDBSS_NTC_FOBX ((NODE_TYPE_CODE)0xeb07) -#define RDBSS_NTC_RX_CONTEXT ((NODE_TYPE_CODE)0xeb08) - -#define RDBSS_NTC_PREFIX_TABLE ((NODE_TYPE_CODE)0xeb0d) -#define RDBSS_NTC_PREFIX_ENTRY ((NODE_TYPE_CODE)0xeb0e) - -#define RDBSS_NTC_FCB_TABLE ((NODE_TYPE_CODE)0xeb09) -#define RDBSS_NTC_FCB_TABLE_ENTRY ((NODE_TYPE_CODE)0xeb0a) - -#define RDBSS_NTC_RXCE_TRANSPORT ((NODE_TYPE_CODE)0xeb71) -#define RDBSS_NTC_RXCE_ADDRESS ((NODE_TYPE_CODE)0xeb72) -#define RDBSS_NTC_RXCE_CONNECTION ((NODE_TYPE_CODE)0xeb73) -#define RDBSS_NTC_RXCE_VC ((NODE_TYPE_CODE)0xeb74) - -#define RDBSS_NTC_NONPAGED_FCB ((NODE_TYPE_CODE)0xebfd) -#define RDBSS_NTC_COMMON_DISPATCH ((NODE_TYPE_CODE)0xebfe) -#define RDBSS_NTC_MINIRDR_DISPATCH ((NODE_TYPE_CODE)0xebff) - -typedef USHORT RDBSS_STORAGE_TYPE_CODES; - -#define RDBSS_NTC_FCB RDBSS_NTC_STORAGE_TYPE_FILE - -#define NodeTypeIsFcb( FCB ) \ - ((((NodeType(FCB) & 0xff00) == RDBSS_NTC_STORAGE_TYPE_UNKNOWN)) || ((NodeType( FCB ) & 0xfff0) == 0xeb90)) - -// -// a mask to alter the type of a data structure once it is marked for scavenging so -// that subsequent tests will fail. -// - -#define RX_SCAVENGER_MASK (0x1000) - - -// -// The following definitions are used to generate meaningful blue bugcheck -// screens. On a bugcheck the file system can output 4 ulongs of useful -// information. The first ulong will have encoded the line number of the -// bugcheck call in the low order 16 bits. The high order bits can be whatever -// the caller wants. In the wrapper, we actually define file identifiers as well. -// However, the system also displays quire a but of the backtrace; this shows -// the .sys file of the caller and it is frequently the case that the linenumber -// is completely disambiguating. -// - -// -// Each individual wrapper file that calls bugcheck has defined at the -// start of the file a constant called BugCheckFileId with one of the -// RDBSS_BUG_CHECK_ values defined below and then use RxBugCheck to bugcheck -// the system. -// - - -typedef enum _RDBSS_BUG_CHECK_CODES { - - RDBSS_BUG_CHECK_FCBSTRUC = 0xfcb00000, - RDBSS_BUG_CHECK_CACHESUP = 0xca550000, - RDBSS_BUG_CHECK_CLEANUP = 0xc1ee0000, - RDBSS_BUG_CHECK_CLOSE = 0xc10e0000, - RDBSS_BUG_CHECK_NTEXCEPT = 0xbaad0000, - -} RDBSS_BUG_CHECK_CODES; - -// we overload on the original redirector's bugcheck code using the stack -// backtrace to differentiate among consumers - -#define RDBSS_FILE_SYSTEM RDR_FILE_SYSTEM -#define RxBugCheck(A,B,C) { \ - KeBugCheckEx(RDBSS_FILE_SYSTEM, \ - BugCheckFileId | ((ULONG)(__LINE__)), \ - A, B, C ); \ - } - - -// -// In this module we'll also define some globally known constants -// - -#define UCHAR_NUL 0x00 -#define UCHAR_SOH 0x01 -#define UCHAR_STX 0x02 -#define UCHAR_ETX 0x03 -#define UCHAR_EOT 0x04 -#define UCHAR_ENQ 0x05 -#define UCHAR_ACK 0x06 -#define UCHAR_BEL 0x07 -#define UCHAR_BS 0x08 -#define UCHAR_HT 0x09 -#define UCHAR_LF 0x0a -#define UCHAR_VT 0x0b -#define UCHAR_FF 0x0c -#define UCHAR_CR 0x0d -#define UCHAR_SO 0x0e -#define UCHAR_SI 0x0f -#define UCHAR_DLE 0x10 -#define UCHAR_DC1 0x11 -#define UCHAR_DC2 0x12 -#define UCHAR_DC3 0x13 -#define UCHAR_DC4 0x14 -#define UCHAR_NAK 0x15 -#define UCHAR_SYN 0x16 -#define UCHAR_ETB 0x17 -#define UCHAR_CAN 0x18 -#define UCHAR_EM 0x19 -#define UCHAR_SUB 0x1a -#define UCHAR_ESC 0x1b -#define UCHAR_FS 0x1c -#define UCHAR_GS 0x1d -#define UCHAR_RS 0x1e -#define UCHAR_US 0x1f -#define UCHAR_SP 0x20 - -#endif // _NODETYPE_INCLUDED_ - - diff --git a/qt-correction-tool/pub/ddk/notesdeviceservice.h b/qt-correction-tool/pub/ddk/notesdeviceservice.h deleted file mode 100644 index a91afc9..0000000 --- a/qt-correction-tool/pub/ddk/notesdeviceservice.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * NotesDeviceService.h - * - * Contains declarations for the Notes Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _NOTESDEVICESERVICE_H_ -#define _NOTESDEVICESERVICE_H_ - -#include -#include - - -/*****************************************************************************/ -/* Notes Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Notes, - 0x5c017aea, 0xe706, 0x4719, 0x8c, 0xc0, 0xa3, 0x03, 0x83, 0x6f, 0xd3, 0x21); - -#define NAME_NotesSvc L"Notes" -#define TYPE_NotesSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Notes Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AbstractNote - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractNote, - 0xb3d1b688, 0x39f6, 0x4703, 0xb3, 0x39, 0xc6, 0x9b, 0x7d, 0x2a, 0xbb, 0x3f); - -#define NAME_AbstractNote L"AbstractNote" - - -/*****************************************************************************/ -/* Notes Service Object Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_NotesObj, - 0x5FFBFC7B, 0x7483, 0x41AD, 0xAF, 0xB9, 0xDA, 0x3F, 0x4E, 0x59, 0x2B, 0x8D); - -#endif /* _NOTESDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/npapi.h b/qt-correction-tool/pub/ddk/npapi.h deleted file mode 100644 index b6e8823..0000000 --- a/qt-correction-tool/pub/ddk/npapi.h +++ /dev/null @@ -1,609 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - npapi.h - -Abstract: - - Network Provider API prototypes and manifests. A network provider - is a client of the Win32 WNet APIs. See the "NT/Win32 Network - Provider API Specification" document for further details. - -Environment: - - User Mode -Win32 - ---*/ - -#ifndef _NPAPI_INCLUDED -#define _NPAPI_INCLUDED - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// CONNECTIONS -// - -DWORD APIENTRY -NPAddConnection ( - __in LPNETRESOURCEW lpNetResource, - __in_opt LPWSTR lpPassword, - __in_opt LPWSTR lpUserName - ); - -typedef DWORD (APIENTRY *PF_NPAddConnection) ( - __in LPNETRESOURCEW lpNetResource, - __in_opt LPWSTR lpPassword, - __in_opt LPWSTR lpUserName - ); - - -DWORD APIENTRY -NPAddConnection3 ( - __in_opt HWND hwndOwner, - __in LPNETRESOURCEW lpNetResource, - __in_opt LPWSTR lpPassword, - __in_opt LPWSTR lpUserName, - __in DWORD dwFlags - ); - -typedef DWORD (APIENTRY *PF_NPAddConnection3) ( - __in_opt HWND hwndOwner, - __in LPNETRESOURCEW lpNetResource, - __in_opt LPWSTR lpPassword, - __in_opt LPWSTR lpUserName, - __in DWORD dwFlags - ); - - -DWORD APIENTRY -NPCancelConnection ( - __in LPWSTR lpName, - __in BOOL fForce - ); - -typedef DWORD (APIENTRY *PF_NPCancelConnection) ( - __in LPWSTR lpName, - __in BOOL fForce - ); - - -DWORD APIENTRY -NPGetConnection ( - __in LPWSTR lpLocalName, - __out_ecount_opt(*lpnBufferLen) LPWSTR lpRemoteName, - __inout LPDWORD lpnBufferLen - ); - -typedef DWORD (APIENTRY *PF_NPGetConnection) ( - __in LPWSTR lpLocalName, - __out_ecount_opt(*lpnBufferLen) LPWSTR lpRemoteName, - __inout LPDWORD lpnBufferLen - ); - - -#define WNGETCON_CONNECTED 0x00000000 -#define WNGETCON_DISCONNECTED 0x00000001 - -DWORD APIENTRY -NPGetConnection3 ( - __in LPCWSTR lpLocalName, - __in DWORD dwLevel, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -typedef DWORD (APIENTRY *PF_NPGetConnection3) ( - __in LPCWSTR lpLocalName, - __in DWORD dwLevel, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - - -DWORD APIENTRY -NPGetUniversalName ( - __in LPCWSTR lpLocalPath, - __in DWORD dwInfoLevel, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -typedef DWORD (APIENTRY *PF_NPGetUniversalName) ( - __in LPCWSTR lpLocalPath, - __in DWORD dwInfoLevel, - __out_bcount(*lpnBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpnBufferSize - ); - -DWORD APIENTRY -NPGetConnectionPerformance ( - __in LPCWSTR lpRemoteName, - __out LPNETCONNECTINFOSTRUCT lpNetConnectInfo - ); - -typedef DWORD (APIENTRY *PF_NPGetConnectionPerformance) ( - __in LPCWSTR lpRemoteName, - __out LPNETCONNECTINFOSTRUCT lpNetConnectInfo - ); - - -DWORD APIENTRY -NPOpenEnum ( - __in DWORD dwScope, - __in DWORD dwType, - __in DWORD dwUsage, - __in_opt LPNETRESOURCEW lpNetResource, - __out LPHANDLE lphEnum - ); - -typedef DWORD (APIENTRY *PF_NPOpenEnum) ( - __in DWORD dwScope, - __in DWORD dwType, - __in DWORD dwUsage, - __in_opt LPNETRESOURCEW lpNetResource, - __out LPHANDLE lphEnum - ); - -DWORD APIENTRY -NPEnumResource ( - __in HANDLE hEnum, - __inout LPDWORD lpcCount, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -typedef DWORD (APIENTRY *PF_NPEnumResource) ( - __in HANDLE hEnum, - __inout LPDWORD lpcCount, - __out_bcount(*lpbufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -DWORD APIENTRY -NPCloseEnum ( - __in HANDLE hEnum - ); - -typedef DWORD (APIENTRY *PF_NPCloseEnum) ( - __in HANDLE hEnum - ); - - -// -// CAPABILITIES -// - -#define WNNC_SPEC_VERSION 0x00000001 -#define WNNC_SPEC_VERSION51 0x00050001 - -#define WNNC_NET_TYPE 0x00000002 -#define WNNC_NET_NONE 0x00000000 - -#define WNNC_DRIVER_VERSION 0x00000003 - -#define WNNC_USER 0x00000004 -#define WNNC_USR_GETUSER 0x00000001 - -#define WNNC_CONNECTION 0x00000006 -#define WNNC_CON_ADDCONNECTION 0x00000001 -#define WNNC_CON_CANCELCONNECTION 0x00000002 -#define WNNC_CON_GETCONNECTIONS 0x00000004 -#define WNNC_CON_ADDCONNECTION3 0x00000008 -#define WNNC_CON_GETPERFORMANCE 0x00000040 -#define WNNC_CON_DEFER 0x00000080 - -#define WNNC_DIALOG 0x00000008 -#define WNNC_DLG_DEVICEMODE 0x00000001 -#define WNNC_DLG_PROPERTYDIALOG 0x00000020 -#define WNNC_DLG_SEARCHDIALOG 0x00000040 -#define WNNC_DLG_FORMATNETWORKNAME 0x00000080 -#define WNNC_DLG_PERMISSIONEDITOR 0x00000100 -#define WNNC_DLG_GETRESOURCEPARENT 0x00000200 -#define WNNC_DLG_GETRESOURCEINFORMATION 0x00000800 - -#define WNNC_ADMIN 0x00000009 -#define WNNC_ADM_GETDIRECTORYTYPE 0x00000001 -#define WNNC_ADM_DIRECTORYNOTIFY 0x00000002 - -#define WNNC_ENUMERATION 0x0000000B -#define WNNC_ENUM_GLOBAL 0x00000001 -#define WNNC_ENUM_LOCAL 0x00000002 -#define WNNC_ENUM_CONTEXT 0x00000004 -#define WNNC_ENUM_SHAREABLE 0x00000008 - -#define WNNC_START 0x0000000C -#define WNNC_WAIT_FOR_START 0x00000001 - -#define WNNC_CONNECTION_FLAGS 0x0000000D -#define WNNC_CF_DEFAULT ( CONNECT_TEMPORARY | CONNECT_INTERACTIVE | CONNECT_PROMPT ) -#define WNNC_CF_MAXIMUM (WNNC_CF_DEFAULT | CONNECT_DEFERRED | CONNECT_COMMANDLINE | CONNECT_CMD_SAVECRED | CONNECT_CRED_RESET) - - - -DWORD APIENTRY -NPGetCaps ( - __in DWORD ndex - ); - -typedef DWORD (APIENTRY *PF_NPGetCaps) ( - __in DWORD ndex - ); - -// -// OTHER -// - -DWORD APIENTRY -NPGetUser ( - __in LPWSTR lpName, - __out_ecount(*lpnBufferLen) LPWSTR lpUserName, - __inout LPDWORD lpnBufferLen - ); - -typedef DWORD (APIENTRY *PF_NPGetUser) ( - __in LPWSTR lpName, - __out_ecount(*lpnBufferLen) LPWSTR lpUserName, - __inout LPDWORD lpnBufferLen - ); - -#define WNTYPE_DRIVE 1 -#define WNTYPE_FILE 2 -#define WNTYPE_PRINTER 3 -#define WNTYPE_COMM 4 - -#define WNPS_FILE 0 -#define WNPS_DIR 1 -#define WNPS_MULT 2 - -DWORD APIENTRY -NPDeviceMode( - __in HWND hParent - ); - -typedef DWORD (APIENTRY *PF_NPDeviceMode) ( - __in HWND hParent - ); - -// flag for search dialog -#define WNSRCH_REFRESH_FIRST_LEVEL 0x00000001 - -DWORD APIENTRY -NPSearchDialog( - __in HWND hwndParent, - __in_opt LPNETRESOURCEW lpNetResource, - __out_ecount(cbBuffer) LPVOID lpBuffer, - __in DWORD cbBuffer, - __out LPDWORD lpnFlags - ); - -typedef DWORD (APIENTRY *PF_NPSearchDialog) ( - __in HWND hwndParent, - __in_opt LPNETRESOURCEW lpNetResource, - __out_ecount(cbBuffer) LPVOID lpBuffer, - __in DWORD cbBuffer, - __out LPDWORD lpnFlags - ); - -DWORD APIENTRY -NPGetResourceParent( - __in LPNETRESOURCEW lpNetResource, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -typedef DWORD (APIENTRY *PF_NPGetResourceParent) ( - __in LPNETRESOURCEW lpNetResource, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize - ); - -DWORD APIENTRY NPGetResourceInformation( - __in LPNETRESOURCEW lpNetResource, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize, - __deref_out LPWSTR *lplpSystem - ); - -typedef DWORD (APIENTRY *PF_NPGetResourceInformation) ( - __in LPNETRESOURCEW lpNetResource, - __out_bcount(*lpBufferSize) LPVOID lpBuffer, - __inout LPDWORD lpBufferSize, - __deref_out LPWSTR *lplpSystem - ); - -DWORD APIENTRY -NPFormatNetworkName( - __in LPWSTR lpRemoteName, - __out_ecount(*lpnLength) LPWSTR lpFormattedName, - __inout LPDWORD lpnLength, - __in DWORD dwFlags, - __in DWORD dwAveCharPerLine - ); - -typedef DWORD (APIENTRY *PF_NPFormatNetworkName) ( - __in LPWSTR lpRemoteName, - __out_ecount(*lpnLength) LPWSTR lpFormattedName, - __inout LPDWORD lpnLength, - __in DWORD dwFlags, - __in DWORD dwAveCharPerLine - ); - -DWORD APIENTRY -NPGetPropertyText( - __in DWORD iButton, - __in DWORD nPropSel, - __in LPWSTR lpName, - __out_ecount(nButtonNameLen) LPWSTR lpButtonName, - __in DWORD nButtonNameLen, - __in DWORD nType - ); - -typedef DWORD (APIENTRY *PF_NPGetPropertyText) ( - __in DWORD iButton, - __in DWORD nPropSel, - __in LPWSTR lpName, - __out_ecount(nButtonNameLen) LPWSTR lpButtonName, - __in DWORD nButtonNameLen, - __in DWORD nType - ); - -DWORD APIENTRY -NPPropertyDialog( - __in HWND hwndParent, - __in DWORD iButtonDlg, - __in DWORD nPropSel, - __in LPWSTR lpFileName, - __in DWORD nType - ); - -typedef DWORD (APIENTRY *PF_NPPropertyDialog) ( - __in HWND hwndParent, - __in DWORD iButtonDlg, - __in DWORD nPropSel, - __in LPWSTR lpFileName, - __in DWORD nType - ); - - -// -// ADMIN -// - -#define WNDT_NORMAL 0 -#define WNDT_NETWORK 1 - -#define WNDN_MKDIR 1 -#define WNDN_RMDIR 2 -#define WNDN_MVDIR 3 - -DWORD APIENTRY -NPGetDirectoryType ( - __in LPWSTR lpName, - __in LPINT lpType, - __in BOOL bFlushCache - ); - -typedef DWORD (APIENTRY *PF_NPGetDirectoryType) ( - __in LPWSTR lpName, - __in LPINT lpType, - __in BOOL bFlushCache - ); - -DWORD APIENTRY -NPDirectoryNotify ( - __in HWND hwnd, - __in LPWSTR lpDir, - __in DWORD dwOper - ); - -typedef DWORD (APIENTRY *PF_NPDirectoryNotify) ( - __in HWND hwnd, - __in LPWSTR lpDir, - __in DWORD dwOper - ); - -VOID -WNetSetLastErrorA( - __in DWORD err, - __in LPSTR lpError, - __in LPSTR lpProviders - ); - -VOID -WNetSetLastErrorW( - __in DWORD err, - __in LPWSTR lpError, - __in LPWSTR lpProviders - ); - -#ifdef UNICODE -#define WNetSetLastError WNetSetLastErrorW -#else -#define WNetSetLastError WNetSetLastErrorA -#endif // UNICODE - -// -// CREDENTIAL MANAGEMENT and other classes of providers -// - - -// Define the Net/Authentication and othr Provider Classes -#define WN_NETWORK_CLASS 0x00000001 -#define WN_CREDENTIAL_CLASS 0x00000002 -#define WN_PRIMARY_AUTHENT_CLASS 0x00000004 -#define WN_SERVICE_CLASS 0x00000008 - -#define WN_VALID_LOGON_ACCOUNT 0x00000001 -#define WN_NT_PASSWORD_CHANGED 0x00000002 - -DWORD APIENTRY -NPLogonNotify ( - __in PLUID lpLogonId, - __in LPCWSTR lpAuthentInfoType, - __in LPVOID lpAuthentInfo, - __in_opt LPCWSTR lpPreviousAuthentInfoType, - __in_opt LPVOID lpPreviousAuthentInfo, - __in LPWSTR lpStationName, - __in_opt LPVOID StationHandle, - __out LPWSTR *lpLogonScript - ); - -typedef DWORD (APIENTRY *PF_NPLogonNotify) ( - __in PLUID lpLogonId, - __in LPCWSTR lpAuthentInfoType, - __in LPVOID lpAuthentInfo, - __in_opt LPCWSTR lpPreviousAuthentInfoType, - __in_opt LPVOID lpPreviousAuthentInfo, - __in LPWSTR lpStationName, - __in_opt LPVOID StationHandle, - __out LPWSTR *lpLogonScript - ); - -DWORD APIENTRY -NPPasswordChangeNotify ( - __in LPCWSTR lpAuthentInfoType, - __in LPVOID lpAuthentInfo, - __in LPCWSTR lpPreviousAuthentInfoType, - __in LPVOID lpPreviousAuthentInfo, - __in LPWSTR lpStationName, - __in_opt LPVOID StationHandle, - __in DWORD dwChangeInfo - ); - -typedef DWORD (APIENTRY *PF_NPPasswordChangeNotify) ( - __in LPCWSTR lpAuthentInfoType, - __in LPVOID lpAuthentInfo, - __in LPCWSTR lpPreviousAuthentInfoType, - __in LPVOID lpPreviousAuthentInfo, - __in LPWSTR lpStationName, - __in_opt LPVOID StationHandle, - __in DWORD dwChangeInfo - ); - -// -// CONNECTION NOTIFICATION -// - -// -// NotifyStatus -// -#define NOTIFY_PRE 0x00000001 -#define NOTIFY_POST 0x00000002 - -typedef struct _NOTIFYINFO { - DWORD dwNotifyStatus; - DWORD dwOperationStatus; - LPVOID lpContext; -} NOTIFYINFO, *LPNOTIFYINFO; - -typedef struct _NOTIFYADD { - HWND hwndOwner; - NETRESOURCE NetResource; - DWORD dwAddFlags; -} NOTIFYADD, *LPNOTIFYADD; - -typedef struct _NOTIFYCANCEL { - LPWSTR lpName; - LPWSTR lpProvider; - DWORD dwFlags; - BOOL fForce; -} NOTIFYCANCEL, *LPNOTIFYCANCEL; - - -DWORD APIENTRY -AddConnectNotify ( - __inout LPNOTIFYINFO lpNotifyInfo, - __in LPNOTIFYADD lpAddInfo - ); - -typedef DWORD (APIENTRY *PF_AddConnectNotify) ( - __inout LPNOTIFYINFO lpNotifyInfo, - __in LPNOTIFYADD lpAddInfo - ); - -DWORD APIENTRY -CancelConnectNotify ( - __inout LPNOTIFYINFO lpNotifyInfo, - __in LPNOTIFYCANCEL lpCancelInfo - ); - -typedef DWORD (APIENTRY *PF_CancelConnectNotify) ( - __inout LPNOTIFYINFO lpNotifyInfo, - __in LPNOTIFYCANCEL lpCancelInfo - ); - -// -// Permission editor dialogs -// - -// -// Capabilities bits of permission editor dialogs -// -#define WNPERMC_PERM 0x00000001 -#define WNPERMC_AUDIT 0x00000002 -#define WNPERMC_OWNER 0x00000004 - -DWORD APIENTRY -NPFMXGetPermCaps ( - __in LPWSTR lpDriveName - ); - -typedef DWORD (APIENTRY *PF_NPFMXGetPermCaps) ( - __in LPWSTR lpDriveName - ); - -// -// Type of security dialog -// -#define WNPERM_DLG_PERM 0 -#define WNPERM_DLG_AUDIT 1 -#define WNPERM_DLG_OWNER 2 - -DWORD APIENTRY -NPFMXEditPerm ( - __in LPWSTR lpDriveName, - __in HWND hwndFMX, - __in DWORD nDialogType - ); - -typedef DWORD (APIENTRY *PF_NPFMXEditPerm) ( - __in LPWSTR lpDriveName, - __in HWND hwndFMX, - __in DWORD nDialogType - ); - -DWORD APIENTRY -NPFMXGetPermHelp ( - __in LPWSTR lpDriveName, - __in DWORD nDialogType, - __in BOOL fDirectory, - __out_ecount(*lpBufferSize) LPVOID lpFileNameBuffer, - __inout LPDWORD lpBufferSize, - __out LPDWORD lpnHelpContext - ); - -typedef DWORD (APIENTRY *PF_NPFMXGetPermHelp) ( - __in LPWSTR lpDriveName, - __in DWORD nDialogType, - __in BOOL fDirectory, - __out_ecount(*lpBufferSize) LPVOID lpFileNameBuffer, - __inout LPDWORD lpBufferSize, - __out LPDWORD lpnHelpContext - ); - -#ifdef __cplusplus -} -#endif - -#endif // _NPAPI_INCLUDED - diff --git a/qt-correction-tool/pub/ddk/npivwmi.h b/qt-correction-tool/pub/ddk/npivwmi.h deleted file mode 100644 index 407517b..0000000 --- a/qt-correction-tool/pub/ddk/npivwmi.h +++ /dev/null @@ -1,203 +0,0 @@ -#ifndef _npivwmi_h_ -#define _npivwmi_h_ - -// MSFC_FibrePortNPIVMethods - MSFC_FibrePortNPIVMethods -#define MSFC_FibrePortNPIVMethodsGuid \ - { 0x8d49ef4c,0xc172,0x45d8, { 0xa3,0x03,0xc5,0xfb,0xc5,0x60,0x1f,0x37 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FibrePortNPIVMethods_GUID, \ - 0x8d49ef4c,0xc172,0x45d8,0xa3,0x03,0xc5,0xfb,0xc5,0x60,0x1f,0x37); -#endif - -// -// Method id definitions for MSFC_FibrePortNPIVMethods -#define CreateVirtualPort 1 -typedef struct _CreateVirtualPort_IN -{ - // - UCHAR WWPN[8]; - #define CreateVirtualPort_IN_WWPN_SIZE sizeof(UCHAR[8]) - #define CreateVirtualPort_IN_WWPN_ID 2 - - // - UCHAR WWNN[8]; - #define CreateVirtualPort_IN_WWNN_SIZE sizeof(UCHAR[8]) - #define CreateVirtualPort_IN_WWNN_ID 3 - - // - UCHAR Tag[16]; - #define CreateVirtualPort_IN_Tag_SIZE sizeof(UCHAR[16]) - #define CreateVirtualPort_IN_Tag_ID 4 - - // - USHORT VirtualName[64]; - #define CreateVirtualPort_IN_VirtualName_SIZE sizeof(USHORT[64]) - #define CreateVirtualPort_IN_VirtualName_ID 5 - -} CreateVirtualPort_IN, *PCreateVirtualPort_IN; - -#define CreateVirtualPort_IN_SIZE (FIELD_OFFSET(CreateVirtualPort_IN, VirtualName) + CreateVirtualPort_IN_VirtualName_SIZE) - -typedef struct _CreateVirtualPort_OUT -{ - // - ULONG Status; - #define CreateVirtualPort_OUT_Status_SIZE sizeof(ULONG) - #define CreateVirtualPort_OUT_Status_ID 1 - -} CreateVirtualPort_OUT, *PCreateVirtualPort_OUT; - -#define CreateVirtualPort_OUT_SIZE (FIELD_OFFSET(CreateVirtualPort_OUT, Status) + CreateVirtualPort_OUT_Status_SIZE) - -#define RemoveVirtualPort 2 -typedef struct _RemoveVirtualPort_IN -{ - // - UCHAR WWPN[8]; - #define RemoveVirtualPort_IN_WWPN_SIZE sizeof(UCHAR[8]) - #define RemoveVirtualPort_IN_WWPN_ID 2 - -} RemoveVirtualPort_IN, *PRemoveVirtualPort_IN; - -#define RemoveVirtualPort_IN_SIZE (FIELD_OFFSET(RemoveVirtualPort_IN, WWPN) + RemoveVirtualPort_IN_WWPN_SIZE) - -typedef struct _RemoveVirtualPort_OUT -{ - // - ULONG Status; - #define RemoveVirtualPort_OUT_Status_SIZE sizeof(ULONG) - #define RemoveVirtualPort_OUT_Status_ID 1 - -} RemoveVirtualPort_OUT, *PRemoveVirtualPort_OUT; - -#define RemoveVirtualPort_OUT_SIZE (FIELD_OFFSET(RemoveVirtualPort_OUT, Status) + RemoveVirtualPort_OUT_Status_SIZE) - - -// MSFC_VirtualFibrePortAttributes - MSFC_VirtualFibrePortAttributes -#define MSFC_VirtualFibrePortAttributesGuid \ - { 0x3574bc0b,0x6f5f,0x4baf, { 0xaf,0x67,0xc4,0x8c,0xc7,0x9f,0xe9,0x57 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_VirtualFibrePortAttributes_GUID, \ - 0x3574bc0b,0x6f5f,0x4baf,0xaf,0x67,0xc4,0x8c,0xc7,0x9f,0xe9,0x57); -#endif - - -typedef struct _MSFC_VirtualFibrePortAttributes -{ - // - ULONG Status; - #define MSFC_VirtualFibrePortAttributes_Status_SIZE sizeof(ULONG) - #define MSFC_VirtualFibrePortAttributes_Status_ID 1 - - // - ULONG FCId; - #define MSFC_VirtualFibrePortAttributes_FCId_SIZE sizeof(ULONG) - #define MSFC_VirtualFibrePortAttributes_FCId_ID 2 - - // - USHORT VirtualName[64]; - #define MSFC_VirtualFibrePortAttributes_VirtualName_SIZE sizeof(USHORT[64]) - #define MSFC_VirtualFibrePortAttributes_VirtualName_ID 3 - - // - UCHAR Tag[16]; - #define MSFC_VirtualFibrePortAttributes_Tag_SIZE sizeof(UCHAR[16]) - #define MSFC_VirtualFibrePortAttributes_Tag_ID 4 - - // - UCHAR WWPN[8]; - #define MSFC_VirtualFibrePortAttributes_WWPN_SIZE sizeof(UCHAR[8]) - #define MSFC_VirtualFibrePortAttributes_WWPN_ID 5 - - // - UCHAR WWNN[8]; - #define MSFC_VirtualFibrePortAttributes_WWNN_SIZE sizeof(UCHAR[8]) - #define MSFC_VirtualFibrePortAttributes_WWNN_ID 6 - - // - UCHAR FabricWWN[8]; - #define MSFC_VirtualFibrePortAttributes_FabricWWN_SIZE sizeof(UCHAR[8]) - #define MSFC_VirtualFibrePortAttributes_FabricWWN_ID 7 - -} MSFC_VirtualFibrePortAttributes, *PMSFC_VirtualFibrePortAttributes; - -#define MSFC_VirtualFibrePortAttributes_SIZE (FIELD_OFFSET(MSFC_VirtualFibrePortAttributes, FabricWWN) + MSFC_VirtualFibrePortAttributes_FabricWWN_SIZE) - -// MSFC_FibrePortNPIVAttributes - MSFC_FibrePortNPIVAttributes -#define MSFC_FibrePortNPIVAttributesGuid \ - { 0x66902796,0x54f4,0x4e24, { 0xad,0x91,0x0a,0xb3,0xb1,0xad,0x65,0xaf } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_FibrePortNPIVAttributes_GUID, \ - 0x66902796,0x54f4,0x4e24,0xad,0x91,0x0a,0xb3,0xb1,0xad,0x65,0xaf); -#endif - - -typedef struct _MSFC_FibrePortNPIVAttributes -{ - // - UCHAR WWPN[8]; - #define MSFC_FibrePortNPIVAttributes_WWPN_SIZE sizeof(UCHAR[8]) - #define MSFC_FibrePortNPIVAttributes_WWPN_ID 1 - - // - UCHAR WWNN[8]; - #define MSFC_FibrePortNPIVAttributes_WWNN_SIZE sizeof(UCHAR[8]) - #define MSFC_FibrePortNPIVAttributes_WWNN_ID 2 - - // - ULONG NumberVirtualPorts; - #define MSFC_FibrePortNPIVAttributes_NumberVirtualPorts_SIZE sizeof(ULONG) - #define MSFC_FibrePortNPIVAttributes_NumberVirtualPorts_ID 3 - - // - MSFC_VirtualFibrePortAttributes VirtualPorts[1]; - #define MSFC_FibrePortNPIVAttributes_VirtualPorts_ID 4 - -} MSFC_FibrePortNPIVAttributes, *PMSFC_FibrePortNPIVAttributes; - -// MSFC_NPIVLUNMappingInformation - MSFC_NPIVLUNMappingInformation -#define MSFC_NPIVLUNMappingInformationGuid \ - { 0x21763208,0xfeb5,0x49bc, { 0xa4,0xe6,0xf5,0x6f,0xdd,0x8c,0xcb,0xd4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSFC_NPIVLUNMappingInformation_GUID, \ - 0x21763208,0xfeb5,0x49bc,0xa4,0xe6,0xf5,0x6f,0xdd,0x8c,0xcb,0xd4); -#endif - - -typedef struct _MSFC_NPIVLUNMappingInformation -{ - // - UCHAR WWPNVirtualPort[8]; - #define MSFC_NPIVLUNMappingInformation_WWPNVirtualPort_SIZE sizeof(UCHAR[8]) - #define MSFC_NPIVLUNMappingInformation_WWPNVirtualPort_ID 1 - - // - UCHAR WWPNPhysicalPort[8]; - #define MSFC_NPIVLUNMappingInformation_WWPNPhysicalPort_SIZE sizeof(UCHAR[8]) - #define MSFC_NPIVLUNMappingInformation_WWPNPhysicalPort_ID 2 - - // - UCHAR OSBus; - #define MSFC_NPIVLUNMappingInformation_OSBus_SIZE sizeof(UCHAR) - #define MSFC_NPIVLUNMappingInformation_OSBus_ID 3 - - // - UCHAR OSTarget; - #define MSFC_NPIVLUNMappingInformation_OSTarget_SIZE sizeof(UCHAR) - #define MSFC_NPIVLUNMappingInformation_OSTarget_ID 4 - - // - UCHAR OSLUN; - #define MSFC_NPIVLUNMappingInformation_OSLUN_SIZE sizeof(UCHAR) - #define MSFC_NPIVLUNMappingInformation_OSLUN_ID 5 - -} MSFC_NPIVLUNMappingInformation, *PMSFC_NPIVLUNMappingInformation; - -#define MSFC_NPIVLUNMappingInformation_SIZE (FIELD_OFFSET(MSFC_NPIVLUNMappingInformation, OSLUN) + MSFC_NPIVLUNMappingInformation_OSLUN_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/ntagp.h b/qt-correction-tool/pub/ddk/ntagp.h deleted file mode 100644 index e956bca..0000000 --- a/qt-correction-tool/pub/ddk/ntagp.h +++ /dev/null @@ -1,289 +0,0 @@ -/*++ - -Copyright (c) 1997-1999 Microsoft Corporation - -Module Name: - - ntagp.h - -Abstract: - - This file defines the external interface for the AGP bus filter driver - - -Revision History: - ---*/ -#ifndef _NTAGP_ -#define _NTAGP_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -typedef struct _AGP_INFO_COMMON -{ - PCI_AGP_CAPABILITY MasterCap; - PCI_AGP_CAPABILITY TargetCap; - USHORT DeviceId; - USHORT VendorId; - USHORT SubVendorId; - USHORT SubSystemId; - UCHAR HwRevisionId; - ULONG VerifierFlags; - BOOLEAN GuardPageCorruption; -}AGP_INFO_COMMON, *PAGP_INFO_COMMON; - -typedef struct _AGP_INFO_DRIVER -{ - ULONG AGPReg1; - ULONG AGPReg2; - PHYSICAL_ADDRESS ApertureStart; - PHYSICAL_ADDRESS GartTranslationTable; - ULONG ApertureLength; -}AGP_INFO_DRIVER, *PAGP_INFO_DRIVER; - -typedef struct -{ - // - // This is gerneic info collected by the AgpLib - // - AGP_INFO_COMMON CommonInfo; - - // - // The following data is collected differently by each AGP driver - // - AGP_INFO_DRIVER DriverInfo; -}AGP_INFO, *PAGP_INFO; - -DEFINE_GUID(GUID_AGP_BUS_INTERFACE_STANDARD, 0x2ef74803, 0xd8d3, 0x11d1, 0x9c, 0xaa, 0x00, 0xc0, 0xf0, 0x16, 0x56, 0x36 ); -// -// Define AGP Interface version -// -#define AGP_BUS_INTERFACE_V1 1 -#define AGP_BUS_INTERFACE_V2 2 -#define AGP_BUS_INTERFACE_V3 3 -#define AGP_BUS_INTERFACE_V4 4 -#define AGP_BUS_INTERFACE_V5 5 - -// -// Define AGP Capabilities field -// -#define AGP_CAPABILITIES_MAP_PHYSICAL 0x00000001 -#define AGP_CAPABILITIES_CACHE_COHERENT 0x00000002 -#define AGP_CAPABILITIES_REQUIRES_GPU_FLUSH 0x00000004 - -// -// Video can disable SBA and/or FW by OR'ing these into AgpSetRate's AgpRate -// parameter -// -#define AGP_SET_RATE_DISABLE_SBA 0x00010000 -#define AGP_SET_RATE_DISABLE_FW 0x00020000 - -typedef -NTSTATUS -(*PAGP_BUS_SET_RATE)( - IN PVOID AgpContext, - IN ULONG AgpRate - ); - -typedef -NTSTATUS -(*PAGP_BUS_RESERVE_MEMORY)( - IN PVOID AgpContext, - IN ULONG NumberOfPages, - IN MEMORY_CACHING_TYPE MemoryType, - OUT PVOID *MapHandle, - OUT OPTIONAL PHYSICAL_ADDRESS *PhysicalAddress - ); - -typedef -NTSTATUS -(*PAGP_BUS_RELEASE_MEMORY)( - IN PVOID AgpContext, - IN PVOID MapHandle - ); - -typedef -NTSTATUS -(*PAGP_BUS_COMMIT_MEMORY)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - IN OUT PMDL Mdl OPTIONAL, - OUT PHYSICAL_ADDRESS *MemoryBase - ); - -typedef -NTSTATUS -(*PAGP_BUS_FREE_MEMORY)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages - ); - -typedef -NTSTATUS -(*PAGP_GET_MAPPED_PAGES)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - OUT PMDL Mld - ); - -typedef -NTSTATUS -(*PAGP_MAP_MEMORY)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - IN PMDL Mdl, - OUT PHYSICAL_ADDRESS *MemoryBase - ); - -typedef -NTSTATUS -(*PAGP_UNMAP_MEMORY)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - IN PMDL Mdl - ); - -typedef -NTSTATUS -(*PAGP_FLUSH_CHIPSET_CACHES)( - IN PVOID AgpContext - ); - -typedef -NTSTATUS -(*PAGP_CHECK_INTEGRITY)( - IN PVOID AgpContext - ); - -typedef -NTSTATUS -(*PAGP_MAP_MEMORY_EX)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - IN PMDL Mdl, - IN OPTIONAL MEMORY_CACHING_TYPE *CacheTypeOverride, - OUT PHYSICAL_ADDRESS *MemoryBase - ); - -typedef -NTSTATUS -(*PAGP_UNMAP_MEMORY_EX)( - IN PVOID AgpContext, - IN PVOID MapHandle, - IN ULONG NumberOfPages, - IN ULONG OffsetInPages, - IN PMDL Mdl - ); - -typedef -NTSTATUS -(*PAGP_FLUSH_GART_TLB)( - IN PVOID AgpContext - ); - -typedef -NTSTATUS -(*PAGP_CHECK_GUARD_PAGE)( - IN PVOID AgpContext, - IN ULONG Flags, - IN ULONG ULongsToCheck - ); - -typedef -VOID -(*PAGP_GET_INFO)( - IN PVOID AgpContext, - OUT PAGP_INFO AgpInfo - ); - - -#define AGP_GUARD_PAGE_CHECK_FIRST_ULONG 0x00000001 -#define AGP_GUARD_PAGE_CHECK_USE_SAME_OFFSET 0x00000002 -#define AGP_GUARD_PAGE_CHECK_DO_NOT_BUGCHECK 0x00000004 - -typedef struct _AGP_BUS_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID AgpContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // AGP bus interfaces (Version 1.0) - // - - ULONG Capabilities; - PAGP_BUS_RESERVE_MEMORY ReserveMemory; - PAGP_BUS_RELEASE_MEMORY ReleaseMemory; - PAGP_BUS_COMMIT_MEMORY CommitMemory; - PAGP_BUS_FREE_MEMORY FreeMemory; - PAGP_GET_MAPPED_PAGES GetMappedPages; - - // - // New functionnality in Version 2.0 of the interface. - // - - PAGP_BUS_SET_RATE SetRate; - - // - // New functionnality in Version 3.0 of the interface. - // - - SIZE_T AgpSize; - PHYSICAL_ADDRESS AgpBase; - PHYSICAL_ADDRESS MaxPhysicalAddress; - PAGP_MAP_MEMORY MapMemory; - PAGP_UNMAP_MEMORY UnMapMemory; - - // - // New functionnality in Version 4.0 of the interface. - // - - PAGP_FLUSH_CHIPSET_CACHES FlushChipsetCaches; - PAGP_CHECK_INTEGRITY CheckIntegrity; - - // - // New functionnality in Version 5.0 of the interface. - // - PAGP_MAP_MEMORY_EX MapMemoryEx; - PAGP_UNMAP_MEMORY_EX UnMapMemoryEx; - PAGP_FLUSH_GART_TLB FlushGartTLB; - PAGP_CHECK_GUARD_PAGE CheckGuardPage; - PAGP_GET_INFO GetAgpInfo; -} AGP_BUS_INTERFACE_STANDARD, *PAGP_BUS_INTERFACE_STANDARD; - -// -// Support for older version of the interface. -// - -#define AGP_BUS_INTERFACE_V1_SIZE \ - (FIELD_OFFSET(AGP_BUS_INTERFACE_STANDARD,SetRate)) - -#define AGP_BUS_INTERFACE_V2_SIZE \ - (FIELD_OFFSET(AGP_BUS_INTERFACE_STANDARD, AgpSize)) - -#define AGP_BUS_INTERFACE_V3_SIZE \ - (FIELD_OFFSET(AGP_BUS_INTERFACE_STANDARD, FlushChipsetCaches)) - -#define AGP_BUS_INTERFACE_V4_SIZE \ - (FIELD_OFFSET(AGP_BUS_INTERFACE_STANDARD, MapMemoryEx)) - -#endif - diff --git a/qt-correction-tool/pub/ddk/ntdddump.h b/qt-correction-tool/pub/ddk/ntdddump.h deleted file mode 100644 index 68f79af..0000000 --- a/qt-correction-tool/pub/ddk/ntdddump.h +++ /dev/null @@ -1,176 +0,0 @@ -/*++ - -Copyright (c) 2003 Microsoft Corporation - -Module Name: - - ntdddump.h - -Abstract: - - Definitions required for filter drivers on the dump path. - -Environment: - - Kernel mode - -Revision History: - - ---*/ - -#include - -#ifndef __NTDDDUMP_H__ -#define __NTDDDUMP_H__ - -#define DUMP_FILTER_MAJOR_VERSION 1 -#define DUMP_FILTER_MINOR_VERSION 0 - -#define DUMP_FILTER_CRITICAL 0x00000001 - -typedef enum _FILTER_DUMP_TYPE { - DumpTypeUndefined, - DumpTypeCrashdump, - DumpTypeHibernation -} FILTER_DUMP_TYPE, *PFILTER_DUMP_TYPE; - -typedef enum _FILTER_CALLBACK { - CallbackDumpInit, - CallbackDumpStart, - CallbackDumpWrite, - CallbackDumpFinish, - CallbackMaxCallback -} FILTER_CALLBACK, *PFILTER_CALLBACK; - -// -// Define the filter driver extension structure -// - -typedef struct _FILTER_EXTENSION { - - // - // Dump type - // - FILTER_DUMP_TYPE DumpType; - - // - // Pointer to dump volume object - // - PDEVICE_OBJECT DeviceObject; - - // - // Dump device geometry - // - DISK_GEOMETRY Geometry; - - // - // Dump disk size - // - LARGE_INTEGER DiskSize; - - // - // Dump partition Information - // Contains dump partition offset - // - DISK_PARTITION_INFO PartitionInfo; - - // - // Filter driver specific data - // - PVOID DumpData; - -} FILTER_EXTENSION, *PFILTER_EXTENSION; - - -typedef -NTSTATUS -(*PDUMP_START) ( - __in PFILTER_EXTENSION FilterExtension - ); - -typedef -NTSTATUS -(*PDUMP_WRITE) ( - __in PFILTER_EXTENSION FilterExtension, - __in PLARGE_INTEGER DiskByteOffset, - __in PMDL Mdl - ); - -typedef -NTSTATUS -(*PDUMP_FINISH) ( - __in PFILTER_EXTENSION FilterExtension - ); - -typedef -NTSTATUS -(*PDUMP_UNLOAD) ( - __in PFILTER_EXTENSION FilterExtension - ); - - -// -// Define the filter driver call table structure -// - -typedef struct _FILTER_INITIALIZATION_DATA { - - // - // Major version of the structure - // Set to DUMP_FILTER_MAJOR_VERSION - // - ULONG MajorVersion; - - // - // Major version of the structure - // Set to DUMP_FILTER_MINOR_VERSION - // - ULONG MinorVersion; - - // - // Pointer to the dump init routine - // This will be called when the dump starts - // - PDUMP_START DumpStart; - - // - // Pointer to the write routine - // This will be called before every write - // - PDUMP_WRITE DumpWrite; - - // - // Pointer to the dump finish routine - // This will be called when the dump completes - // - PDUMP_FINISH DumpFinish; - - // - // Pointer to the dump unload routine - // This will be called before unloading the driver - // - PDUMP_UNLOAD DumpUnload; - - // - // Filter driver specific data - // - PVOID DumpData; - - // - // Maximum number of pages per dump write. - // - ULONG MaxPagesPerWrite; - - // - // Flags. - // - ULONG Flags; - -} FILTER_INITIALIZATION_DATA, *PFILTER_INITIALIZATION_DATA; - - -#endif // __NTDDDUMP_H__ - - - diff --git a/qt-correction-tool/pub/ddk/ntddk.h b/qt-correction-tool/pub/ddk/ntddk.h deleted file mode 100644 index e6fbb86..0000000 --- a/qt-correction-tool/pub/ddk/ntddk.h +++ /dev/null @@ -1,16070 +0,0 @@ -/*++ BUILD Version: 0184 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntddk.h - -Abstract: - - This module defines the NT types, constants, and functions that are - exposed to device drivers. - -Revision History: - ---*/ - -#ifndef _NTDDK_ -#define _NTDDK_ - -#if !defined(_NTHAL_) && !defined(_NTIFS_) -#define _NTDDK_INCLUDED_ -#define _DDK_DRIVER_ -#endif - -#ifndef RC_INVOKED -#if _MSC_VER < 1300 -#error Compiler version not supported by Windows DDK -#endif -#endif // RC_INVOKED - -#define NT_INCLUDED -#define _CTYPE_DISABLE_MACROS - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning(disable:4115) // named type definition in parentheses -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define types that are not exported. -// - -typedef struct _BUS_HANDLER *PBUS_HANDLER; -typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; -typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT; -#if defined(_NTHAL_INCLUDED_) -typedef struct _KPROCESS *PEPROCESS; -typedef struct _ETHREAD *PETHREAD; -typedef struct _KAFFINITY_EX *PKAFFINITY_EX; -#elif defined(_NTIFS_INCLUDED_) -typedef struct _KPROCESS *PEPROCESS; -typedef struct _KTHREAD *PETHREAD; -#else -typedef struct _EPROCESS *PEPROCESS; -typedef struct _ETHREAD *PETHREAD; -#endif -typedef struct _IO_TIMER *PIO_TIMER; -typedef struct _KINTERRUPT *PKINTERRUPT; -typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; -typedef struct _OBJECT_TYPE *POBJECT_TYPE; -typedef struct _PEB *PPEB; -typedef struct _IMAGE_NT_HEADERS *PIMAGE_NT_HEADERS32; -typedef struct _IMAGE_NT_HEADERS64 *PIMAGE_NT_HEADERS64; -#ifdef _WIN64 -typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS; -#else -typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; -#endif - -#define PsGetCurrentProcess IoGetCurrentProcess - -#if (NTDDI_VERSION >= NTDDI_VISTA) -extern NTSYSAPI volatile CCHAR KeNumberProcessors; -#elif (NTDDI_VERSION >= NTDDI_WINXP) -extern NTSYSAPI CCHAR KeNumberProcessors; -#else -extern PCCHAR KeNumberProcessors; -#endif - -#include - -#ifndef FAR -#define FAR -#endif - -#ifdef _X86_ - -// -// Disable these two pragmas that evaluate to "sti" "cli" on x86 so that driver -// writers to not leave them inadvertantly in their code. -// - -#if !defined(MIDL_PASS) -#if !defined(RC_INVOKED) - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4164) // disable C4164 warning so that apps that - // build with /Od don't get weird errors ! -#ifdef _M_IX86 -#pragma function(_enable) -#pragma function(_disable) -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4164) // reenable C4164 warning -#endif - -#endif -#endif - -// -// Size of kernel mode stack. -// - -#define KERNEL_STACK_SIZE 12288 - -// -// Define size of large kernel mode stack for callbacks. -// - -#define KERNEL_LARGE_STACK_SIZE 61440 - -// -// Define number of pages to initialize in a large kernel stack. -// - -#define KERNEL_LARGE_STACK_COMMIT 12288 - -#ifdef _X86_ - -#if !defined(MIDL_PASS) && defined(_M_IX86) - -#if !defined(_M_CEE_PURE) - -#pragma warning( push ) -#pragma warning( disable : 4793 ) -FORCEINLINE -VOID -MemoryBarrier ( - VOID - ) -{ - LONG Barrier; - __asm { - xchg Barrier, eax - } -} -#pragma warning( pop ) - -#endif /* _M_CEE_PURE */ -// -// Prefetch is not supported on all x86 procssors. -// - -#define PreFetchCacheLine(l, a) -#define PrefetchForWrite(p) -#define ReadForWriteAccess(p) (*(p)) - -// -// PreFetchCacheLine level defines. -// - -#define PF_TEMPORAL_LEVEL_1 -#define PF_NON_TEMPORAL_LEVEL_ALL - -// -// Define function to read the value of a performance counter. -// - -#if _MSC_FULL_VER >= 140050727 - -#define ReadPMC __readpmc - -ULONG64 -__readpmc ( - __in ULONG Counter - ); - -#pragma intrinsic(__readpmc) - -#else - -FORCEINLINE -ULONG64 -ReadPMC ( - __in ULONG Counter - ) - -{ - __asm { - mov ecx, Counter - rdpmc - }; -} - -#endif - -// -// Define function to read the value of the time stamp counter -// - -#if _MSC_FULL_VER >= 140040310 - -#define ReadTimeStampCounter() __rdtsc() - -ULONG64 -__rdtsc ( - VOID - ); - -#pragma intrinsic(__rdtsc) - -#else - -FORCEINLINE -ULONG64 -ReadTimeStampCounter ( - VOID - ) - -{ - __asm rdtsc -} - -#endif - -#endif // !defined(MIDL_PASS) && defined(_M_IX86) - -// -// Define the size of the 80387 save area, which is in the context frame. -// - -#define SIZE_OF_80387_REGISTERS 80 - -// -// The following flags control the contents of the CONTEXT structure. -// - -#if !defined(RC_INVOKED) - -#define CONTEXT_i386 0x00010000 // this assumes that i386 and -#define CONTEXT_i486 0x00010000 // i486 have identical context records - - - -#define CONTEXT_CONTROL (CONTEXT_i386 | 0x00000001L) // SS:SP, CS:IP, FLAGS, BP -#define CONTEXT_INTEGER (CONTEXT_i386 | 0x00000002L) // AX, BX, CX, DX, SI, DI -#define CONTEXT_SEGMENTS (CONTEXT_i386 | 0x00000004L) // DS, ES, FS, GS -#define CONTEXT_FLOATING_POINT (CONTEXT_i386 | 0x00000008L) // 387 state -#define CONTEXT_DEBUG_REGISTERS (CONTEXT_i386 | 0x00000010L) // DB 0-3,6,7 -#define CONTEXT_EXTENDED_REGISTERS (CONTEXT_i386 | 0x00000020L) // cpu specific extensions - -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER |\ - CONTEXT_SEGMENTS) - -#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | \ - CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS | \ - CONTEXT_EXTENDED_REGISTERS) - -#define CONTEXT_XSTATE (CONTEXT_i386 | 0x00000040L) - - - -#endif // !defined(RC_INVOKED) - -typedef struct _FLOATING_SAVE_AREA { - ULONG ControlWord; - ULONG StatusWord; - ULONG TagWord; - ULONG ErrorOffset; - ULONG ErrorSelector; - ULONG DataOffset; - ULONG DataSelector; - UCHAR RegisterArea[SIZE_OF_80387_REGISTERS]; - ULONG Cr0NpxState; -} FLOATING_SAVE_AREA; - -typedef FLOATING_SAVE_AREA *PFLOATING_SAVE_AREA; - - - -#include "pshpack4.h" - -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) is is used to constuct a call frame for APC delivery, -// and 3) it is used in the user level thread creation routines. -// -// The layout of the record conforms to a standard call frame. -// - -typedef struct _CONTEXT { - - // - // The flags values within this flag control the contents of - // a CONTEXT record. - // - // If the context record is used as an input parameter, then - // for each portion of the context record controlled by a flag - // whose value is set, it is assumed that that portion of the - // context record contains valid context. If the context record - // is being used to modify a threads context, then only that - // portion of the threads context will be modified. - // - // If the context record is used as an IN OUT parameter to capture - // the context of a thread, then only those portions of the thread's - // context corresponding to set flags will be returned. - // - // The context record is never used as an OUT only parameter. - // - - ULONG ContextFlags; - - // - // This section is specified/returned if CONTEXT_DEBUG_REGISTERS is - // set in ContextFlags. Note that CONTEXT_DEBUG_REGISTERS is NOT - // included in CONTEXT_FULL. - // - - ULONG Dr0; - ULONG Dr1; - ULONG Dr2; - ULONG Dr3; - ULONG Dr6; - ULONG Dr7; - - // - // This section is specified/returned if the - // ContextFlags word contians the flag CONTEXT_FLOATING_POINT. - // - - FLOATING_SAVE_AREA FloatSave; - - // - // This section is specified/returned if the - // ContextFlags word contians the flag CONTEXT_SEGMENTS. - // - - ULONG SegGs; - ULONG SegFs; - ULONG SegEs; - ULONG SegDs; - - // - // This section is specified/returned if the - // ContextFlags word contians the flag CONTEXT_INTEGER. - // - - ULONG Edi; - ULONG Esi; - ULONG Ebx; - ULONG Edx; - ULONG Ecx; - ULONG Eax; - - // - // This section is specified/returned if the - // ContextFlags word contians the flag CONTEXT_CONTROL. - // - - ULONG Ebp; - ULONG Eip; - ULONG SegCs; // MUST BE SANITIZED - ULONG EFlags; // MUST BE SANITIZED - ULONG Esp; - ULONG SegSs; - - // - // This section is specified/returned if the ContextFlags word - // contains the flag CONTEXT_EXTENDED_REGISTERS. - // The format and contexts are processor specific - // - - UCHAR ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION]; - -} CONTEXT; - -typedef CONTEXT *PCONTEXT; - -#include "poppack.h" - - -#endif //_X86_ - -#endif // _X86_ - -#ifdef _AMD64_ - -// -// Size of kernel mode stack. -// - -#define KERNEL_STACK_SIZE 0x6000 - -// -// Define size of large kernel mode stack for callbacks. -// - -#define KERNEL_LARGE_STACK_SIZE 0x12000 - -// -// Define number of pages to initialize in a large kernel stack. -// - -#define KERNEL_LARGE_STACK_COMMIT KERNEL_STACK_SIZE - -// -// Define the size of the stack used for processing an MCA exception. -// - -#define KERNEL_MCA_EXCEPTION_STACK_SIZE 0x2000 - -// -// The following values specify the type of access in the first parameter -// of the exception record whan the exception code specifies an access -// violation. -// - -#define EXCEPTION_READ_FAULT 0 // exception caused by a read -#define EXCEPTION_WRITE_FAULT 1 // exception caused by a write -#define EXCEPTION_EXECUTE_FAULT 8 // exception caused by an instruction fetch - - -// -// The following flags control the contents of the CONTEXT structure. -// - -#if !defined(RC_INVOKED) - -#define CONTEXT_AMD64 0x100000 - - - -#define CONTEXT_CONTROL (CONTEXT_AMD64 | 0x1L) -#define CONTEXT_INTEGER (CONTEXT_AMD64 | 0x2L) -#define CONTEXT_SEGMENTS (CONTEXT_AMD64 | 0x4L) -#define CONTEXT_FLOATING_POINT (CONTEXT_AMD64 | 0x8L) -#define CONTEXT_DEBUG_REGISTERS (CONTEXT_AMD64 | 0x10L) - -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT) - -#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_SEGMENTS | CONTEXT_FLOATING_POINT | CONTEXT_DEBUG_REGISTERS) - -#define CONTEXT_XSTATE (CONTEXT_AMD64 | 0x20L) - -#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 -#define CONTEXT_SERVICE_ACTIVE 0x10000000 -#define CONTEXT_EXCEPTION_REQUEST 0x40000000 -#define CONTEXT_EXCEPTION_REPORTING 0x80000000 - - - -#endif // !defined(RC_INVOKED) - -// -// Define initial MxCsr and FpCsr control. -// - -#define INITIAL_MXCSR 0x1f80 // initial MXCSR value -#define INITIAL_FPCSR 0x027f // initial FPCSR value - - -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) it is used to constuct a call frame for APC delivery, -// and 3) it is used in the user level thread creation routines. -// -// -// The flags field within this record controls the contents of a CONTEXT -// record. -// -// If the context record is used as an input parameter, then for each -// portion of the context record controlled by a flag whose value is -// set, it is assumed that that portion of the context record contains -// valid context. If the context record is being used to modify a threads -// context, then only that portion of the threads context is modified. -// -// If the context record is used as an output parameter to capture the -// context of a thread, then only those portions of the thread's context -// corresponding to set flags will be returned. -// -// CONTEXT_CONTROL specifies SegSs, Rsp, SegCs, Rip, and EFlags. -// -// CONTEXT_INTEGER specifies Rax, Rcx, Rdx, Rbx, Rbp, Rsi, Rdi, and R8-R15. -// -// CONTEXT_SEGMENTS specifies SegDs, SegEs, SegFs, and SegGs. -// -// CONTEXT_FLOATING_POINT specifies Xmm0-Xmm15. -// -// CONTEXT_DEBUG_REGISTERS specifies Dr0-Dr3 and Dr6-Dr7. -// - -typedef struct DECLSPEC_ALIGN(16) _CONTEXT { - - // - // Register parameter home addresses. - // - // N.B. These fields are for convience - they could be used to extend the - // context record in the future. - // - - ULONG64 P1Home; - ULONG64 P2Home; - ULONG64 P3Home; - ULONG64 P4Home; - ULONG64 P5Home; - ULONG64 P6Home; - - // - // Control flags. - // - - ULONG ContextFlags; - ULONG MxCsr; - - // - // Segment Registers and processor flags. - // - - USHORT SegCs; - USHORT SegDs; - USHORT SegEs; - USHORT SegFs; - USHORT SegGs; - USHORT SegSs; - ULONG EFlags; - - // - // Debug registers - // - - ULONG64 Dr0; - ULONG64 Dr1; - ULONG64 Dr2; - ULONG64 Dr3; - ULONG64 Dr6; - ULONG64 Dr7; - - // - // Integer registers. - // - - ULONG64 Rax; - ULONG64 Rcx; - ULONG64 Rdx; - ULONG64 Rbx; - ULONG64 Rsp; - ULONG64 Rbp; - ULONG64 Rsi; - ULONG64 Rdi; - ULONG64 R8; - ULONG64 R9; - ULONG64 R10; - ULONG64 R11; - ULONG64 R12; - ULONG64 R13; - ULONG64 R14; - ULONG64 R15; - - // - // Program counter. - // - - ULONG64 Rip; - - // - // Floating point state. - // - - union { - XMM_SAVE_AREA32 FltSave; - struct { - M128A Header[2]; - M128A Legacy[8]; - M128A Xmm0; - M128A Xmm1; - M128A Xmm2; - M128A Xmm3; - M128A Xmm4; - M128A Xmm5; - M128A Xmm6; - M128A Xmm7; - M128A Xmm8; - M128A Xmm9; - M128A Xmm10; - M128A Xmm11; - M128A Xmm12; - M128A Xmm13; - M128A Xmm14; - M128A Xmm15; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - - // - // Vector registers. - // - - M128A VectorRegister[26]; - ULONG64 VectorControl; - - // - // Special debug control registers. - // - - ULONG64 DebugControl; - ULONG64 LastBranchToRip; - ULONG64 LastBranchFromRip; - ULONG64 LastExceptionToRip; - ULONG64 LastExceptionFromRip; -} CONTEXT, *PCONTEXT; - - -#endif // _AMD64_ - - -#ifdef _IA64_ - -// -// Define size of kernel mode stack. -// - -#define KERNEL_STACK_SIZE 0x8000 - -// -// Define size of large kernel mode stack for callbacks. -// - -#define KERNEL_LARGE_STACK_SIZE 0x1A000 - -// -// Define number of pages to initialize in a large kernel stack. -// - -#define KERNEL_LARGE_STACK_COMMIT 0x8000 - -// -// Define size of kernel mode backing store stack. -// - -#define KERNEL_BSTORE_SIZE 0x8000 - -// -// Define size of large kernel mode backing store for callbacks. -// - -#define KERNEL_LARGE_BSTORE_SIZE 0x10000 - -// -// Define number of pages to initialize in a large kernel backing store. -// - -#define KERNEL_LARGE_BSTORE_COMMIT 0x8000 - -// -// Define base address for kernel and user space. -// - -#define UREGION_INDEX 0 - -#define KREGION_INDEX 7 - -#define UADDRESS_BASE ((ULONGLONG)UREGION_INDEX << 61) - - -#define KADDRESS_BASE ((ULONGLONG)KREGION_INDEX << 61) - - -#if defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define bit test intrinsics. -// - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset - -#define BitTest64 _bittest64 -#define BitTestAndComplement64 _bittestandcomplement64 -#define BitTestAndSet64 _bittestandset64 -#define BitTestAndReset64 _bittestandreset64 - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -__checkReturn -BOOLEAN -_bittest64 ( - __in_bcount((Offset+7)/8) LONG64 const *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandcomplement64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandreset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) - -#pragma intrinsic(_bittest64) -#pragma intrinsic(_bittestandcomplement64) -#pragma intrinsic(_bittestandset64) -#pragma intrinsic(_bittestandreset64) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse -#define BitScanForward64 _BitScanForward64 -#define BitScanReverse64 _BitScanReverse64 - -__success(return!=0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanForward64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) - -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 - -SHORT -_InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -#pragma intrinsic(_InterlockedCompareExchange16) - -#ifdef __cplusplus -} -#endif - -#define InterlockedAdd _InterlockedAdd -#define InterlockedAddAcquire _InterlockedAdd_acq -#define InterlockedAddRelease _InterlockedAdd_rel - -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedIncrementAcquire _InterlockedIncrement_acq -#define InterlockedIncrementRelease _InterlockedIncrement_rel - -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedDecrementAcquire _InterlockedDecrement_acq -#define InterlockedDecrementRelease _InterlockedDecrement_rel - -#define InterlockedExchange _InterlockedExchange -#define InterlockedExchangeAcquire _InterlockedExchange_acq - -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedExchangeAddAcquire _InterlockedExchangeAdd_acq -#define InterlockedExchangeAddRelease _InterlockedExchangeAdd_rel - -#define InterlockedAdd64 _InterlockedAdd64 -#define InterlockedAddAcquire64 _InterlockedAdd64_acq -#define InterlockedAddRelease64 _InterlockedAdd64_rel - -#define InterlockedIncrement64 _InterlockedIncrement64 -#define InterlockedIncrementAcquire64 _InterlockedIncrement64_acq -#define InterlockedIncrementRelease64 _InterlockedIncrement64_rel - -#define InterlockedDecrement64 _InterlockedDecrement64 -#define InterlockedDecrementAcquire64 _InterlockedDecrement64_acq -#define InterlockedDecrementRelease64 _InterlockedDecrement64_rel - -#define InterlockedExchange64 _InterlockedExchange64 -#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq - -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 -#define InterlockedExchangeAddAcquire64 _InterlockedExchangeAdd64_acq -#define InterlockedExchangeAddRelease64 _InterlockedExchangeAdd64_rel - -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq -#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel - -#define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128 -#define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128_acq -#define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128_rel - -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq -#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel - -#define InterlockedExchangePointer _InterlockedExchangePointer -#define InterlockedExchangePointerAcquire _InterlockedExchangePointer_acq - -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel -#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq - - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a) - -#define InterlockedOr _InterlockedOr -#define InterlockedOrAcquire _InterlockedOr_acq -#define InterlockedOrRelease _InterlockedOr_rel -#define InterlockedOr8 _InterlockedOr8 -#define InterlockedOr8Acquire _InterlockedOr8_acq -#define InterlockedOr8Release _InterlockedOr8_rel -#define InterlockedOr16 _InterlockedOr16 -#define InterlockedOr16Acquire _InterlockedOr16_acq -#define InterlockedOr16Release _InterlockedOr16_rel -#define InterlockedOr64 _InterlockedOr64 -#define InterlockedOr64Acquire _InterlockedOr64_acq -#define InterlockedOr64Release _InterlockedOr64_rel -#define InterlockedXor _InterlockedXor -#define InterlockedXorAcquire _InterlockedXor_acq -#define InterlockedXorRelease _InterlockedXor_rel -#define InterlockedXor8 _InterlockedXor8 -#define InterlockedXor8Acquire _InterlockedXor8_acq -#define InterlockedXor8Release _InterlockedXor8_rel -#define InterlockedXor16 _InterlockedXor16 -#define InterlockedXor16Acquire _InterlockedXor16_acq -#define InterlockedXor16Release _InterlockedXor16_rel -#define InterlockedXor64 _InterlockedXor64 -#define InterlockedXor64Acquire _InterlockedXor64_acq -#define InterlockedXor64Release _InterlockedXor64_rel -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAcquire _InterlockedAnd_acq -#define InterlockedAndRelease _InterlockedAnd_rel -#define InterlockedAnd8 _InterlockedAnd8 -#define InterlockedAnd8Acquire _InterlockedAnd8_acq -#define InterlockedAnd8Release _InterlockedAnd8_rel -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedAnd16Acquire _InterlockedAnd16_acq -#define InterlockedAnd16Release _InterlockedAnd16_rel -#define InterlockedAnd64 _InterlockedAnd64 -#define InterlockedAnd64Acquire _InterlockedAnd64_acq -#define InterlockedAnd64Release _InterlockedAnd64_rel - -#ifdef __cplusplus -extern "C" { -#endif - -LONG -__cdecl -InterlockedAdd ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddAcquire ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddRelease ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONGLONG -__cdecl -InterlockedAdd64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAddAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - - -LONGLONG -__cdecl -InterlockedAddRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAcquire( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddAcquire( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddRelease( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONGLONG -__cdecl -InterlockedIncrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedExchange64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAcquire64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAdd64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64Exchange128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeAcquire128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeRelease128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointer ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerAcquire ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerRelease ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedExchangePointer( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -PVOID -__cdecl -InterlockedExchangePointerAcquire( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -LONG -__cdecl -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedOr8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedOr16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedOr64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedXor ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedXor8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedXor16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedXor64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedAnd8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedAnd16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedAnd64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -#pragma intrinsic(_InterlockedAdd) -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedIncrement_acq) -#pragma intrinsic(_InterlockedIncrement_rel) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedDecrement_acq) -#pragma intrinsic(_InterlockedDecrement_rel) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedCompareExchange_acq) -#pragma intrinsic(_InterlockedCompareExchange_rel) -#pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedAdd64) -#pragma intrinsic(_InterlockedIncrement64) -#pragma intrinsic(_InterlockedDecrement64) -#pragma intrinsic(_InterlockedExchange64) -#pragma intrinsic(_InterlockedExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64) -#pragma intrinsic(_InterlockedCompareExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64_rel) -#pragma intrinsic(_InterlockedCompare64Exchange128) -#pragma intrinsic(_InterlockedCompare64Exchange128_acq) -#pragma intrinsic(_InterlockedCompare64Exchange128_rel) -#pragma intrinsic(_InterlockedExchangeAdd64) -#pragma intrinsic(_InterlockedExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer_acq) -#pragma intrinsic(_InterlockedCompareExchangePointer_rel) -#pragma intrinsic(_InterlockedAdd_acq) -#pragma intrinsic(_InterlockedAdd_rel) -#pragma intrinsic(_InterlockedExchange_acq) -#pragma intrinsic(_InterlockedExchangeAdd_acq) -#pragma intrinsic(_InterlockedExchangeAdd_rel) -#pragma intrinsic(_InterlockedAdd64_acq) -#pragma intrinsic(_InterlockedAdd64_rel) -#pragma intrinsic(_InterlockedIncrement64_acq) -#pragma intrinsic(_InterlockedIncrement64_rel) -#pragma intrinsic(_InterlockedDecrement64_acq) -#pragma intrinsic(_InterlockedDecrement64_rel) -#pragma intrinsic(_InterlockedExchangeAdd64_acq) -#pragma intrinsic(_InterlockedExchangeAdd64_rel) -#pragma intrinsic(_InterlockedExchangePointer_acq) -#pragma intrinsic (_InterlockedOr) -#pragma intrinsic (_InterlockedOr_acq) -#pragma intrinsic (_InterlockedOr_rel) -#pragma intrinsic (_InterlockedOr8) -#pragma intrinsic (_InterlockedOr8_acq) -#pragma intrinsic (_InterlockedOr8_rel) -#pragma intrinsic (_InterlockedOr16) -#pragma intrinsic (_InterlockedOr16_acq) -#pragma intrinsic (_InterlockedOr16_rel) -#pragma intrinsic (_InterlockedOr64) -#pragma intrinsic (_InterlockedOr64_acq) -#pragma intrinsic (_InterlockedOr64_rel) -#pragma intrinsic (_InterlockedXor) -#pragma intrinsic (_InterlockedXor_acq) -#pragma intrinsic (_InterlockedXor_rel) -#pragma intrinsic (_InterlockedXor8) -#pragma intrinsic (_InterlockedXor8_acq) -#pragma intrinsic (_InterlockedXor8_rel) -#pragma intrinsic (_InterlockedXor16) -#pragma intrinsic (_InterlockedXor16_acq) -#pragma intrinsic (_InterlockedXor16_rel) -#pragma intrinsic (_InterlockedXor64) -#pragma intrinsic (_InterlockedXor64_acq) -#pragma intrinsic (_InterlockedXor64_rel) -#pragma intrinsic (_InterlockedAnd) -#pragma intrinsic (_InterlockedAnd_acq) -#pragma intrinsic (_InterlockedAnd_rel) -#pragma intrinsic (_InterlockedAnd8) -#pragma intrinsic (_InterlockedAnd8_acq) -#pragma intrinsic (_InterlockedAnd8_rel) -#pragma intrinsic (_InterlockedAnd16) -#pragma intrinsic (_InterlockedAnd16_acq) -#pragma intrinsic (_InterlockedAnd16_rel) -#pragma intrinsic (_InterlockedAnd64) -#pragma intrinsic (_InterlockedAnd64_acq) -#pragma intrinsic (_InterlockedAnd64_rel) - -#if !defined (InterlockedAnd64) - -#define InterlockedAnd64 InterlockedAnd64_Inline - -LONGLONG -FORCEINLINE -InterlockedAnd64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old & Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedAndAffinity InterlockedAnd64 - -#if !defined (InterlockedOr64) - -#define InterlockedOr64 InterlockedOr64_Inline - -LONGLONG -FORCEINLINE -InterlockedOr64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old | Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedOrAffinity InterlockedOr64 - -#if !defined (InterlockedXor64) - -#define InterlockedXor64 InterlockedXor64_Inline - -LONGLONG -FORCEINLINE -InterlockedXor64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old ^ Value, - Old) != Old); - - return Old; -} - -#endif - -#if !defined (InterlockedBitTestAndSet) - -#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset) - -#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndSet64) - -#define InterlockedBitTestAndSet64 InterlockedBitTestAndSet64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset64) - -#define InterlockedBitTestAndReset64 InterlockedBitTestAndReset64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd64 (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement) - -#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement64) - -#define InterlockedBitTestAndComplement64 InterlockedBitTestAndComplement64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) */ - - -#ifdef __cplusplus -extern "C" { -#endif - - -void -__yield( - void - ); - -void -__mf( - void - ); - -void -__lfetch( - int Level, - __in volatile VOID CONST *Address - ); - -void -__lfetchfault( - __in int Level, - __in volatile VOID CONST *Address - ); - -void -__lfetch_excl( - __in int Level, - __in volatile VOID CONST *Address - ); - -void -__lfetchfault_excl( - __in int Level, - __in volatile VOID CONST *Address - ); - -// -// __lfetch control defines. -// - -#define MD_LFHINT_NONE 0x00 -#define MD_LFHINT_NT1 0x01 -#define MD_LFHINT_NT2 0x02 -#define MD_LFHINT_NTA 0x03 - -#pragma intrinsic (__yield) -#pragma intrinsic (__lfetch) -#pragma intrinsic (__lfetchfault) -#pragma intrinsic (__lfetchfault_excl) -#pragma intrinsic (__lfetch_excl) -#pragma intrinsic (__mf) - -// -// Define function to read the value of the time stamp counter -// -// N.B. The register number for the time stamp counter is CV_IA64_ApITC which -// is 3116. -// - -#define ReadTimeStampCounter() __getReg(3116) - -unsigned __int64 -__getReg ( - __in int Number - ); - -#pragma intrinsic(__getReg) - -#define YieldProcessor __yield -#define MemoryBarrier __mf -#define PreFetchCacheLine __lfetch -#define PrefetchForWrite(p) -#define ReadForWriteAccess(p) (__lfetch_excl(MD_LFHINT_NONE, (p)), (*(p))) - - -// -// PreFetchCacheLine level defines. -// - -#define PF_TEMPORAL_LEVEL_1 MD_LFHINT_NONE -#define PF_TEMPORAL_LEVEL_2 MD_LFHINT_NT1 -#define PF_TEMPORAL_LEVEL_3 MD_LFHINT_NT2 -#define PF_NON_TEMPORAL_LEVEL_ALL MD_LFHINT_NTA - -// -// Define functions to capture the high 64-bits of a 128-bit multiply. -// - -#define UnsignedMultiplyHigh __UMULH - -ULONGLONG -UnsignedMultiplyHigh ( - __in ULONGLONG Multiplier, - __in ULONGLONG Multiplicand - ); - -#pragma intrinsic(__UMULH) - -#if (_MSC_VER >= 1400) - -#define UnsignedMultiply128 _umul128 - -ULONG64 -UnsignedMultiply128 ( - __in unsigned __int64 Multiplier, - __in unsigned __int64 Multiplicand, - __out __deref_out_range(==,Multiplier * Multiplicand) unsigned __int64 *HighProduct - ); - -#pragma intrinsic(_umul128) - -#endif - -#ifdef __cplusplus -} -#endif - - -// -// The following values specify the type of failing access when the status is -// STATUS_ACCESS_VIOLATION and the first parameter in the exception record. -// - -#define EXCEPTION_READ_FAULT 0 // Access violation was caused by a read -#define EXCEPTION_WRITE_FAULT 1 // Access violation was caused by a write -#define EXCEPTION_EXECUTE_FAULT 2 // Access violation was caused by an instruction fetch - -// -// The following flags control the contents of the CONTEXT structure. -// - -#if !defined(RC_INVOKED) - -#define CONTEXT_IA64 0x00080000 - -#define CONTEXT_CONTROL (CONTEXT_IA64 | 0x00000001L) -#define CONTEXT_LOWER_FLOATING_POINT (CONTEXT_IA64 | 0x00000002L) -#define CONTEXT_HIGHER_FLOATING_POINT (CONTEXT_IA64 | 0x00000004L) -#define CONTEXT_INTEGER (CONTEXT_IA64 | 0x00000008L) -#define CONTEXT_DEBUG (CONTEXT_IA64 | 0x00000010L) -#define CONTEXT_IA32_CONTROL (CONTEXT_IA64 | 0x00000020L) // Includes StIPSR - - -#define CONTEXT_FLOATING_POINT (CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT) -#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_IA32_CONTROL) -#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_FLOATING_POINT | CONTEXT_INTEGER | CONTEXT_DEBUG | CONTEXT_IA32_CONTROL) - -#define CONTEXT_EXCEPTION_ACTIVE 0x8000000 -#define CONTEXT_SERVICE_ACTIVE 0x10000000 -#define CONTEXT_EXCEPTION_REQUEST 0x40000000 -#define CONTEXT_EXCEPTION_REPORTING 0x80000000 - -#endif // !defined(RC_INVOKED) - -// -// Context Frame -// -// This frame has a several purposes: 1) it is used as an argument to -// NtContinue, 2) it is used to construct a call frame for APC delivery, -// 3) it is used to construct a call frame for exception dispatching -// in user mode, 4) it is used in the user level thread creation -// routines, and 5) it is used to to pass thread state to debuggers. -// -// N.B. Because this record is used as a call frame, it must be EXACTLY -// a multiple of 16 bytes in length and aligned on a 16-byte boundary. -// - -typedef struct _CONTEXT { - - // - // The flags values within this flag control the contents of - // a CONTEXT record. - // - // If the context record is used as an input parameter, then - // for each portion of the context record controlled by a flag - // whose value is set, it is assumed that that portion of the - // context record contains valid context. If the context record - // is being used to modify a thread's context, then only that - // portion of the threads context will be modified. - // - // If the context record is used as an __inout parameter to capture - // the context of a thread, then only those portions of the thread's - // context corresponding to set flags will be returned. - // - // The context record is never used as an __out only parameter. - // - - ULONG ContextFlags; - ULONG Fill1[3]; // for alignment of following on 16-byte boundary - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_DEBUG. - // - // N.B. CONTEXT_DEBUG is *not* part of CONTEXT_FULL. - // - - ULONGLONG DbI0; - ULONGLONG DbI1; - ULONGLONG DbI2; - ULONGLONG DbI3; - ULONGLONG DbI4; - ULONGLONG DbI5; - ULONGLONG DbI6; - ULONGLONG DbI7; - - ULONGLONG DbD0; - ULONGLONG DbD1; - ULONGLONG DbD2; - ULONGLONG DbD3; - ULONGLONG DbD4; - ULONGLONG DbD5; - ULONGLONG DbD6; - ULONGLONG DbD7; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_LOWER_FLOATING_POINT. - // - - FLOAT128 FltS0; - FLOAT128 FltS1; - FLOAT128 FltS2; - FLOAT128 FltS3; - FLOAT128 FltT0; - FLOAT128 FltT1; - FLOAT128 FltT2; - FLOAT128 FltT3; - FLOAT128 FltT4; - FLOAT128 FltT5; - FLOAT128 FltT6; - FLOAT128 FltT7; - FLOAT128 FltT8; - FLOAT128 FltT9; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_HIGHER_FLOATING_POINT. - // - - FLOAT128 FltS4; - FLOAT128 FltS5; - FLOAT128 FltS6; - FLOAT128 FltS7; - FLOAT128 FltS8; - FLOAT128 FltS9; - FLOAT128 FltS10; - FLOAT128 FltS11; - FLOAT128 FltS12; - FLOAT128 FltS13; - FLOAT128 FltS14; - FLOAT128 FltS15; - FLOAT128 FltS16; - FLOAT128 FltS17; - FLOAT128 FltS18; - FLOAT128 FltS19; - - FLOAT128 FltF32; - FLOAT128 FltF33; - FLOAT128 FltF34; - FLOAT128 FltF35; - FLOAT128 FltF36; - FLOAT128 FltF37; - FLOAT128 FltF38; - FLOAT128 FltF39; - - FLOAT128 FltF40; - FLOAT128 FltF41; - FLOAT128 FltF42; - FLOAT128 FltF43; - FLOAT128 FltF44; - FLOAT128 FltF45; - FLOAT128 FltF46; - FLOAT128 FltF47; - FLOAT128 FltF48; - FLOAT128 FltF49; - - FLOAT128 FltF50; - FLOAT128 FltF51; - FLOAT128 FltF52; - FLOAT128 FltF53; - FLOAT128 FltF54; - FLOAT128 FltF55; - FLOAT128 FltF56; - FLOAT128 FltF57; - FLOAT128 FltF58; - FLOAT128 FltF59; - - FLOAT128 FltF60; - FLOAT128 FltF61; - FLOAT128 FltF62; - FLOAT128 FltF63; - FLOAT128 FltF64; - FLOAT128 FltF65; - FLOAT128 FltF66; - FLOAT128 FltF67; - FLOAT128 FltF68; - FLOAT128 FltF69; - - FLOAT128 FltF70; - FLOAT128 FltF71; - FLOAT128 FltF72; - FLOAT128 FltF73; - FLOAT128 FltF74; - FLOAT128 FltF75; - FLOAT128 FltF76; - FLOAT128 FltF77; - FLOAT128 FltF78; - FLOAT128 FltF79; - - FLOAT128 FltF80; - FLOAT128 FltF81; - FLOAT128 FltF82; - FLOAT128 FltF83; - FLOAT128 FltF84; - FLOAT128 FltF85; - FLOAT128 FltF86; - FLOAT128 FltF87; - FLOAT128 FltF88; - FLOAT128 FltF89; - - FLOAT128 FltF90; - FLOAT128 FltF91; - FLOAT128 FltF92; - FLOAT128 FltF93; - FLOAT128 FltF94; - FLOAT128 FltF95; - FLOAT128 FltF96; - FLOAT128 FltF97; - FLOAT128 FltF98; - FLOAT128 FltF99; - - FLOAT128 FltF100; - FLOAT128 FltF101; - FLOAT128 FltF102; - FLOAT128 FltF103; - FLOAT128 FltF104; - FLOAT128 FltF105; - FLOAT128 FltF106; - FLOAT128 FltF107; - FLOAT128 FltF108; - FLOAT128 FltF109; - - FLOAT128 FltF110; - FLOAT128 FltF111; - FLOAT128 FltF112; - FLOAT128 FltF113; - FLOAT128 FltF114; - FLOAT128 FltF115; - FLOAT128 FltF116; - FLOAT128 FltF117; - FLOAT128 FltF118; - FLOAT128 FltF119; - - FLOAT128 FltF120; - FLOAT128 FltF121; - FLOAT128 FltF122; - FLOAT128 FltF123; - FLOAT128 FltF124; - FLOAT128 FltF125; - FLOAT128 FltF126; - FLOAT128 FltF127; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_LOWER_FLOATING_POINT | CONTEXT_HIGHER_FLOATING_POINT | CONTEXT_CONTROL. - // - - ULONGLONG StFPSR; // FP status - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_INTEGER. - // - // N.B. The registers gp, sp, rp are part of the control context - // - - ULONGLONG IntGp; // r1, volatile - ULONGLONG IntT0; // r2-r3, volatile - ULONGLONG IntT1; // - ULONGLONG IntS0; // r4-r7, preserved - ULONGLONG IntS1; - ULONGLONG IntS2; - ULONGLONG IntS3; - ULONGLONG IntV0; // r8, volatile - ULONGLONG IntT2; // r9-r11, volatile - ULONGLONG IntT3; - ULONGLONG IntT4; - ULONGLONG IntSp; // stack pointer (r12), special - ULONGLONG IntTeb; // teb (r13), special - ULONGLONG IntT5; // r14-r31, volatile - ULONGLONG IntT6; - ULONGLONG IntT7; - ULONGLONG IntT8; - ULONGLONG IntT9; - ULONGLONG IntT10; - ULONGLONG IntT11; - ULONGLONG IntT12; - ULONGLONG IntT13; - ULONGLONG IntT14; - ULONGLONG IntT15; - ULONGLONG IntT16; - ULONGLONG IntT17; - ULONGLONG IntT18; - ULONGLONG IntT19; - ULONGLONG IntT20; - ULONGLONG IntT21; - ULONGLONG IntT22; - - ULONGLONG IntNats; // Nat bits for r1-r31 - // r1-r31 in bits 1 thru 31. - ULONGLONG Preds; // predicates, preserved - - ULONGLONG BrRp; // return pointer, b0, preserved - ULONGLONG BrS0; // b1-b5, preserved - ULONGLONG BrS1; - ULONGLONG BrS2; - ULONGLONG BrS3; - ULONGLONG BrS4; - ULONGLONG BrT0; // b6-b7, volatile - ULONGLONG BrT1; - - // - // This section is specified/returned if the ContextFlags word contains - // the flag CONTEXT_CONTROL. - // - - // Other application registers - ULONGLONG ApUNAT; // User Nat collection register, preserved - ULONGLONG ApLC; // Loop counter register, preserved - ULONGLONG ApEC; // Epilog counter register, preserved - ULONGLONG ApCCV; // CMPXCHG value register, volatile - ULONGLONG ApDCR; // Default control register (TBD) - - // Register stack info - ULONGLONG RsPFS; // Previous function state, preserved - ULONGLONG RsBSP; // Backing store pointer, preserved - ULONGLONG RsBSPSTORE; - ULONGLONG RsRSC; // RSE configuration, volatile - ULONGLONG RsRNAT; // RSE Nat collection register, preserved - - // Trap Status Information - ULONGLONG StIPSR; // Interruption Processor Status - ULONGLONG StIIP; // Interruption IP - ULONGLONG StIFS; // Interruption Function State - - // iA32 related control registers - ULONGLONG StFCR; // copy of Ar21 - ULONGLONG Eflag; // Eflag copy of Ar24 - ULONGLONG SegCSD; // iA32 CSDescriptor (Ar25) - ULONGLONG SegSSD; // iA32 SSDescriptor (Ar26) - ULONGLONG Cflag; // Cr0+Cr4 copy of Ar27 - ULONGLONG StFSR; // x86 FP status (copy of AR28) - ULONGLONG StFIR; // x86 FP status (copy of AR29) - ULONGLONG StFDR; // x86 FP status (copy of AR30) - - ULONGLONG UNUSEDPACK; // added to pack StFDR to 16-bytes - -} CONTEXT, *PCONTEXT; - -// -// Plabel descriptor structure definition -// - -typedef struct _PLABEL_DESCRIPTOR { - ULONGLONG EntryPoint; - ULONGLONG GlobalPointer; -} PLABEL_DESCRIPTOR, *PPLABEL_DESCRIPTOR; - - - -#endif // _IA64_ - - -// -// Well known SID definitions for lookup. -// - -typedef enum { - - WinNullSid = 0, - WinWorldSid = 1, - WinLocalSid = 2, - WinCreatorOwnerSid = 3, - WinCreatorGroupSid = 4, - WinCreatorOwnerServerSid = 5, - WinCreatorGroupServerSid = 6, - WinNtAuthoritySid = 7, - WinDialupSid = 8, - WinNetworkSid = 9, - WinBatchSid = 10, - WinInteractiveSid = 11, - WinServiceSid = 12, - WinAnonymousSid = 13, - WinProxySid = 14, - WinEnterpriseControllersSid = 15, - WinSelfSid = 16, - WinAuthenticatedUserSid = 17, - WinRestrictedCodeSid = 18, - WinTerminalServerSid = 19, - WinRemoteLogonIdSid = 20, - WinLogonIdsSid = 21, - WinLocalSystemSid = 22, - WinLocalServiceSid = 23, - WinNetworkServiceSid = 24, - WinBuiltinDomainSid = 25, - WinBuiltinAdministratorsSid = 26, - WinBuiltinUsersSid = 27, - WinBuiltinGuestsSid = 28, - WinBuiltinPowerUsersSid = 29, - WinBuiltinAccountOperatorsSid = 30, - WinBuiltinSystemOperatorsSid = 31, - WinBuiltinPrintOperatorsSid = 32, - WinBuiltinBackupOperatorsSid = 33, - WinBuiltinReplicatorSid = 34, - WinBuiltinPreWindows2000CompatibleAccessSid = 35, - WinBuiltinRemoteDesktopUsersSid = 36, - WinBuiltinNetworkConfigurationOperatorsSid = 37, - WinAccountAdministratorSid = 38, - WinAccountGuestSid = 39, - WinAccountKrbtgtSid = 40, - WinAccountDomainAdminsSid = 41, - WinAccountDomainUsersSid = 42, - WinAccountDomainGuestsSid = 43, - WinAccountComputersSid = 44, - WinAccountControllersSid = 45, - WinAccountCertAdminsSid = 46, - WinAccountSchemaAdminsSid = 47, - WinAccountEnterpriseAdminsSid = 48, - WinAccountPolicyAdminsSid = 49, - WinAccountRasAndIasServersSid = 50, - WinNTLMAuthenticationSid = 51, - WinDigestAuthenticationSid = 52, - WinSChannelAuthenticationSid = 53, - WinThisOrganizationSid = 54, - WinOtherOrganizationSid = 55, - WinBuiltinIncomingForestTrustBuildersSid = 56, - WinBuiltinPerfMonitoringUsersSid = 57, - WinBuiltinPerfLoggingUsersSid = 58, - WinBuiltinAuthorizationAccessSid = 59, - WinBuiltinTerminalServerLicenseServersSid = 60, - WinBuiltinDCOMUsersSid = 61, - WinBuiltinIUsersSid = 62, - WinIUserSid = 63, - WinBuiltinCryptoOperatorsSid = 64, - WinUntrustedLabelSid = 65, - WinLowLabelSid = 66, - WinMediumLabelSid = 67, - WinHighLabelSid = 68, - WinSystemLabelSid = 69, - WinWriteRestrictedCodeSid = 70, - WinCreatorOwnerRightsSid = 71, - WinCacheablePrincipalsGroupSid = 72, - WinNonCacheablePrincipalsGroupSid = 73, - WinEnterpriseReadonlyControllersSid = 74, - WinAccountReadonlyControllersSid = 75, - WinBuiltinEventLogReadersGroup = 76, - WinNewEnterpriseReadonlyControllersSid = 77, - WinBuiltinCertSvcDComAccessGroup = 78, - WinMediumPlusLabelSid = 79, - WinLocalLogonSid = 80, - WinConsoleLogonSid = 81, - WinThisOrganizationCertificateSid = 82, -} WELL_KNOWN_SID_TYPE; - -// -// Unsolicited Input is obsolete and unused. -// - -#define SE_UNSOLICITED_INPUT_PRIVILEGE (6L) - - -#ifndef _NTLSA_IFS_ - - -// -// All of this stuff (between the Ifndef _NTLSA_AUDIT_ and its endif) were not -// present in NTIFS prior to Windows Server 2003 SP1. All of the definitions however -// exist down to windows 2000 (except for the few exceptions noted in the code). -// - -#ifndef _NTLSA_AUDIT_ -#define _NTLSA_AUDIT_ - -///////////////////////////////////////////////////////////////////////// -// // -// Data types related to Auditing // -// // -///////////////////////////////////////////////////////////////////////// - - -// -// The following enumerated type is used between the reference monitor and -// LSA in the generation of audit messages. It is used to indicate the -// type of data being passed as a parameter from the reference monitor -// to LSA. LSA is responsible for transforming the specified data type -// into a set of unicode strings that are added to the event record in -// the audit log. -// - -typedef enum _SE_ADT_PARAMETER_TYPE { - - SeAdtParmTypeNone = 0, //Produces 1 parameter - //Received value: - // - // None. - // - //Results in: - // - // a unicode string containing "-". - // - //Note: This is typically used to - // indicate that a parameter value - // was not available. - // - - SeAdtParmTypeString, //Produces 1 parameter. - //Received Value: - // - // Unicode String (variable length) - // - //Results in: - // - // No transformation. The string - // entered into the event record as - // received. - // - // The Address value of the audit info - // should be a pointer to a UNICODE_STRING - // structure. - - - - SeAdtParmTypeFileSpec, //Produces 1 parameter. - //Received value: - // - // Unicode string containing a file or - // directory name. - // - //Results in: - // - // Unicode string with the prefix of the - // file's path replaced by a drive letter - // if possible. - // - - - - - SeAdtParmTypeUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value. - - - SeAdtParmTypeSid, //Produces 1 parameter. - //Received value: - // - // SID (variable length) - // - //Results in: - // - // String representation of SID - // - - - - - SeAdtParmTypeLogonId, //Produces 4 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Sid string - // param 2: Username string - // param 3: domain name string - // param 4: Logon ID (Luid) string - - - SeAdtParmTypeNoLogonId, //Produces 3 parameters. - //Received value: - // - // None. - // - //Results in: - // - // param 1: "-" - // param 2: "-" - // param 3: "-" - // param 4: "-" - // - //Note: - // - // This type is used when a logon ID - // is needed, but one is not available - // to pass. For example, if an - // impersonation logon ID is expected - // but the subject is not impersonating - // anyone. - // - - SeAdtParmTypeAccessMask, //Produces 1 parameter with formatting. - //Received value: - // - // ACCESS_MASK followed by - // a Unicode string. The unicode - // string contains the name of the - // type of object the access mask - // applies to. The event's source - // further qualifies the object type. - // - //Results in: - // - // formatted unicode string built to - // take advantage of the specified - // source's parameter message file. - // - //Note: - // - // An access mask containing three - // access types for a Widget object - // type (defined by the Foozle source) - // might end up looking like: - // - // %%1062\n\t\t%1066\n\t\t%%601 - // - // The %%numbers are signals to the - // event viewer to perform parameter - // substitution before display. - // - - - - SeAdtParmTypePrivs, //Produces 1 parameter with formatting. - //Received value: - // - //Results in: - // - // formatted unicode string similar to - // that for access types. Each priv - // will be formatted to be displayed - // on its own line. E.g., - // - // %%642\n\t\t%%651\n\t\t%%655 - // - - SeAdtParmTypeObjectTypes, //Produces 10 parameters with formatting. - //Received value: - // - // Produces a list a stringized GUIDS along - // with information similar to that for - // an access mask. - - SeAdtParmTypeHexUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// In W2k this value did not exist, it was ParmTypeLUID - - SeAdtParmTypePtr, //Produces 1 parameter - //Received value: - // - // pointer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// -// Everything below exists only in Windows XP and greater -// - - SeAdtParmTypeTime, //Produces 2 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time. - - // - SeAdtParmTypeGuid, //Produces 1 parameter - //Received value: - // - // GUID pointer - // - //Results in: - // - // Unicode string representation of GUID - // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - // - -// -// Everything below exists only in Windows Server 2003 and Greater -// - - SeAdtParmTypeLuid, // - //Produces 1 parameter - //Received value: - // - // LUID - // - //Results in: - // - // Hex LUID - // - - SeAdtParmTypeHexInt64, //Produces 1 parameter - //Received value: - // - // 64 bit integer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - - SeAdtParmTypeStringList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_STRING_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the strings in the list - - SeAdtParmTypeSidList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_SID_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the SIDs in the list - - SeAdtParmTypeDuration, //Produces 1 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // a duration. - - SeAdtParmTypeUserAccountControl,//Produces 3 parameters - //Received value: - // - // old and new UserAccountControl values - // - //Results in: - // - // Unicode string representations of - // the flags in UserAccountControl. - // 1 - old value in hex - // 2 - new value in hex - // 3 - difference as strings - - SeAdtParmTypeNoUac, //Produces 3 parameters - //Received value: - // - // none - // - //Results in: - // - // Three dashes ('-') as unicode strings. - - SeAdtParmTypeMessage, //Produces 1 Parameter - //Received value: - // - // ULONG (MessageNo from msobjs.mc) - // - //Results in: - // - // Unicode string representation of - // %%MessageNo which the event viewer - // will replace with the message string - // from msobjs.mc - - SeAdtParmTypeDateTime, //Produces 1 Parameter - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time (in _one_ string). - - SeAdtParmTypeSockAddr, // Produces 2 parameters - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IP address string - // param 2: Port number string - // - -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeSD, // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure - // - // Results in: - // - // SDDL string representation of SD - // - - SeAdtParmTypeLogonHours, // Produces 1 parameters - // - // Received value: - // - // pointer to LOGON_HOURS - // structure - // - // Results in: - // - // String representation of allowed logon hours - // - - SeAdtParmTypeLogonIdNoSid, //Produces 3 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Username string - // param 2: domain name string - // param 3: Logon ID (Luid) string - - SeAdtParmTypeUlongNoConv, // Produces 1 parameter. - // Received Value: - // Ulong - // - //Results in: - // Not converted to string - // - - SeAdtParmTypeSockAddrNoPort, // Produces 1 parameter - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IPv4/IPv6 address string - // -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeAccessReason // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure followed by the reason code. - // The reason code could be the index - // of the ACE in the SD or privilege ID or - // other reason codes. - // - // Results in: - // - // String representation of the access reason. - // - -} SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE; - -#ifndef GUID_DEFINED -#include -#endif /* GUID_DEFINED */ - -typedef struct _SE_ADT_OBJECT_TYPE { - GUID ObjectType; - USHORT Flags; -#define SE_ADT_OBJECT_ONLY 0x1 - USHORT Level; - ACCESS_MASK AccessMask; -} SE_ADT_OBJECT_TYPE, *PSE_ADT_OBJECT_TYPE; - -typedef struct _SE_ADT_PARAMETER_ARRAY_ENTRY { - - SE_ADT_PARAMETER_TYPE Type; - ULONG Length; - ULONG_PTR Data[2]; - PVOID Address; - -} SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY; - - -typedef struct _SE_ADT_ACCESS_REASON{ - ACCESS_MASK AccessMask; - ULONG AccessReasons[32]; - ULONG ObjectTypeIndex; - ULONG AccessGranted; - PSECURITY_DESCRIPTOR SecurityDescriptor; // multple SDs may be stored here in self-relative way. -} SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON; - - - -// -// Structure that will be passed between the Reference Monitor and LSA -// to transmit auditing information. -// - -#define SE_MAX_AUDIT_PARAMETERS 32 -#define SE_MAX_GENERIC_AUDIT_PARAMETERS 28 - -typedef struct _SE_ADT_PARAMETER_ARRAY { - - ULONG CategoryId; - ULONG AuditId; - ULONG ParameterCount; - ULONG Length; - USHORT FlatSubCategoryId; - USHORT Type; - ULONG Flags; - SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ]; - -} SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY; - - -#define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001 -#define SE_ADT_PARAMETERS_SEND_TO_LSA 0x00000002 -#define SE_ADT_PARAMETER_EXTENSIBLE_AUDIT 0x00000004 -#define SE_ADT_PARAMETER_GENERIC_AUDIT 0x00000008 -#define SE_ADT_PARAMETER_WRITE_SYNCHRONOUS 0x00000010 - - -// -// This macro only existed in Windows Server 2008 and after -// - -#define LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE(AuditParameters) \ - ( sizeof(SE_ADT_PARAMETER_ARRAY) - \ - sizeof(SE_ADT_PARAMETER_ARRAY_ENTRY) * \ - (SE_MAX_AUDIT_PARAMETERS - AuditParameters->ParameterCount) ) - -#endif // _NTLSA_AUDIT_ - - -#endif // _NTLSA_IFS_ - - -#ifndef _RTL_RUN_ONCE_DEF -#define _RTL_RUN_ONCE_DEF - -// -// Run once -// - -#define RTL_RUN_ONCE_INIT {0} // Static initializer - -// -// Run once flags -// - -#define RTL_RUN_ONCE_CHECK_ONLY 0x00000001UL -#define RTL_RUN_ONCE_ASYNC 0x00000002UL -#define RTL_RUN_ONCE_INIT_FAILED 0x00000004UL - -// -// The context stored in the run once structure must leave the following number -// of low order bits unused. -// - -#define RTL_RUN_ONCE_CTX_RESERVED_BITS 2 - -typedef union _RTL_RUN_ONCE { - PVOID Ptr; -} RTL_RUN_ONCE, *PRTL_RUN_ONCE; - -typedef -__drv_functionClass(RTL_RUN_ONCE_INIT_FN) -__drv_sameIRQL -ULONG /* LOGICAL */ -NTAPI -RTL_RUN_ONCE_INIT_FN ( - __inout PRTL_RUN_ONCE RunOnce, - __inout_opt PVOID Parameter, - __deref_opt_inout_opt PVOID *Context - ); -typedef RTL_RUN_ONCE_INIT_FN *PRTL_RUN_ONCE_INIT_FN; - -#endif // _RTL_RUN_ONCE_DEF - -#if (NTDDI_VERSION >= NTDDI_LONGHORN) - -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlRunOnceInitialize ( - __out PRTL_RUN_ONCE RunOnce - ); - -__drv_maxIRQL(APC_LEVEL) -__drv_inTry -NTSYSAPI -NTSTATUS -NTAPI -RtlRunOnceExecuteOnce ( - __inout PRTL_RUN_ONCE RunOnce, - __in __callback PRTL_RUN_ONCE_INIT_FN InitFn, - __inout_opt PVOID Parameter, - __deref_opt_out_opt PVOID *Context - ); - -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlRunOnceBeginInitialize ( - __inout PRTL_RUN_ONCE RunOnce, - __in ULONG Flags, - __deref_opt_out_opt PVOID *Context - ); - -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlRunOnceComplete ( - __inout PRTL_RUN_ONCE RunOnce, - __in ULONG Flags, - __in_opt PVOID Context - ); - -#endif // NTDDI_VERSION >= NTDDI_LONGHORN - - -// -// This enumerated type is used as the function return value of the function -// that is used to search the tree for a key. FoundNode indicates that the -// function found the key. Insert as left indicates that the key was not found -// and the node should be inserted as the left child of the parent. Insert as -// right indicates that the key was not found and the node should be inserted -// as the right child of the parent. -// -typedef enum _TABLE_SEARCH_RESULT{ - TableEmptyTree, - TableFoundNode, - TableInsertAsLeft, - TableInsertAsRight -} TABLE_SEARCH_RESULT; - -// -// The results of a compare can be less than, equal, or greater than. -// - -typedef enum _RTL_GENERIC_COMPARE_RESULTS { - GenericLessThan, - GenericGreaterThan, - GenericEqual -} RTL_GENERIC_COMPARE_RESULTS; - -// -// Define the Avl version of the generic table package. Note a generic table -// should really be an opaque type. We provide routines to manipulate the structure. -// -// A generic table is package for inserting, deleting, and looking up elements -// in a table (e.g., in a symbol table). To use this package the user -// defines the structure of the elements stored in the table, provides a -// comparison function, a memory allocation function, and a memory -// deallocation function. -// -// Note: the user compare function must impose a complete ordering among -// all of the elements, and the table does not allow for duplicate entries. -// - -// -// Add an empty typedef so that functions can reference the -// a pointer to the generic table struct before it is declared. -// - -struct _RTL_AVL_TABLE; - -// -// The comparison function takes as input pointers to elements containing -// user defined structures and returns the results of comparing the two -// elements. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_AVL_COMPARE_ROUTINE) -RTL_GENERIC_COMPARE_RESULTS -NTAPI -RTL_AVL_COMPARE_ROUTINE ( - __in struct _RTL_AVL_TABLE *Table, - __in PVOID FirstStruct, - __in PVOID SecondStruct - ); -typedef RTL_AVL_COMPARE_ROUTINE *PRTL_AVL_COMPARE_ROUTINE; - -// -// The allocation function is called by the generic table package whenever -// it needs to allocate memory for the table. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_AVL_ALLOCATE_ROUTINE) -__drv_allocatesMem(Mem) -PVOID -NTAPI -RTL_AVL_ALLOCATE_ROUTINE ( - __in struct _RTL_AVL_TABLE *Table, - __in CLONG ByteSize - ); -typedef RTL_AVL_ALLOCATE_ROUTINE *PRTL_AVL_ALLOCATE_ROUTINE; - -// -// The deallocation function is called by the generic table package whenever -// it needs to deallocate memory from the table that was allocated by calling -// the user supplied allocation function. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_AVL_FREE_ROUTINE) -VOID -NTAPI -RTL_AVL_FREE_ROUTINE ( - __in struct _RTL_AVL_TABLE *Table, - __in __drv_freesMem(Mem) __post_invalid PVOID Buffer - ); -typedef RTL_AVL_FREE_ROUTINE *PRTL_AVL_FREE_ROUTINE; - -// -// The match function takes as input the user data to be matched and a pointer -// to some match data, which was passed along with the function pointer. It -// returns TRUE for a match and FALSE for no match. -// -// RTL_AVL_MATCH_FUNCTION returns -// STATUS_SUCCESS if the IndexRow matches -// STATUS_NO_MATCH if the IndexRow does not match, but the enumeration should -// continue -// STATUS_NO_MORE_MATCHES if the IndexRow does not match, and the enumeration -// should terminate -// - - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_AVL_MATCH_FUNCTION) -NTSTATUS -NTAPI -RTL_AVL_MATCH_FUNCTION ( - __in struct _RTL_AVL_TABLE *Table, - __in PVOID UserData, - __in PVOID MatchData - ); -typedef RTL_AVL_MATCH_FUNCTION *PRTL_AVL_MATCH_FUNCTION; - -// -// Define the balanced tree links and Balance field. (No Rank field -// defined at this time.) -// -// Callers should treat this structure as opaque! -// -// The root of a balanced binary tree is not a real node in the tree -// but rather points to a real node which is the root. It is always -// in the table below, and its fields are used as follows: -// -// Parent Pointer to self, to allow for detection of the root. -// LeftChild NULL -// RightChild Pointer to real root -// Balance Undefined, however it is set to a convenient value -// (depending on the algorithm) prior to rebalancing -// in insert and delete routines. -// - -typedef struct _RTL_BALANCED_LINKS { - struct _RTL_BALANCED_LINKS *Parent; - struct _RTL_BALANCED_LINKS *LeftChild; - struct _RTL_BALANCED_LINKS *RightChild; - CHAR Balance; - UCHAR Reserved[3]; -} RTL_BALANCED_LINKS; -typedef RTL_BALANCED_LINKS *PRTL_BALANCED_LINKS; - -// -// To use the generic table package the user declares a variable of type -// GENERIC_TABLE and then uses the routines described below to initialize -// the table and to manipulate the table. Note that the generic table -// should really be an opaque type. -// - -typedef struct _RTL_AVL_TABLE { - RTL_BALANCED_LINKS BalancedRoot; - PVOID OrderedPointer; - ULONG WhichOrderedElement; - ULONG NumberGenericTableElements; - ULONG DepthOfTree; - PRTL_BALANCED_LINKS RestartKey; - ULONG DeleteCount; - PRTL_AVL_COMPARE_ROUTINE CompareRoutine; - PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine; - PRTL_AVL_FREE_ROUTINE FreeRoutine; - PVOID TableContext; -} RTL_AVL_TABLE; -typedef RTL_AVL_TABLE *PRTL_AVL_TABLE; - -// -// The procedure InitializeGenericTable takes as input an uninitialized -// generic table variable and pointers to the three user supplied routines. -// This must be called for every individual generic table variable before -// it can be used. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -VOID -NTAPI -RtlInitializeGenericTableAvl ( - __out PRTL_AVL_TABLE Table, - __in PRTL_AVL_COMPARE_ROUTINE CompareRoutine, - __in PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine, - __in PRTL_AVL_FREE_ROUTINE FreeRoutine, - __in_opt PVOID TableContext - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function InsertElementGenericTable will insert a new element -// in a table. It does this by allocating space for the new element -// (this includes AVL links), inserting the element in the table, and -// then returning to the user a pointer to the new element. If an element -// with the same key already exists in the table the return value is a pointer -// to the old element. The optional output parameter NewElement is used -// to indicate if the element previously existed in the table. Note: the user -// supplied Buffer is only used for searching the table, upon insertion its -// contents are copied to the newly created element. This means that -// pointer to the input buffer will not point to the new element. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -PVOID -NTAPI -RtlInsertElementGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in_bcount(BufferSize) PVOID Buffer, - __in CLONG BufferSize, - __out_opt PBOOLEAN NewElement - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function InsertElementGenericTableFull will insert a new element -// in a table. It does this by allocating space for the new element -// (this includes AVL links), inserting the element in the table, and -// then returning to the user a pointer to the new element. If an element -// with the same key already exists in the table the return value is a pointer -// to the old element. The optional output parameter NewElement is used -// to indicate if the element previously existed in the table. Note: the user -// supplied Buffer is only used for searching the table, upon insertion its -// contents are copied to the newly created element. This means that -// pointer to the input buffer will not point to the new element. -// This routine is passed the NodeOrParent and SearchResult from a -// previous RtlLookupElementGenericTableFull. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -PVOID -NTAPI -RtlInsertElementGenericTableFullAvl ( - __in PRTL_AVL_TABLE Table, - __in_bcount(BufferSize) PVOID Buffer, - __in CLONG BufferSize, - __out_opt PBOOLEAN NewElement, - __in PVOID NodeOrParent, - __in TABLE_SEARCH_RESULT SearchResult - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function DeleteElementGenericTable will find and delete an element -// from a generic table. If the element is located and deleted the return -// value is TRUE, otherwise if the element is not located the return value -// is FALSE. The user supplied input buffer is only used as a key in -// locating the element in the table. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -BOOLEAN -NTAPI -RtlDeleteElementGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in PVOID Buffer - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function LookupElementGenericTable will find an element in a generic -// table. If the element is located the return value is a pointer to -// the user defined structure associated with the element, otherwise if -// the element is not located the return value is NULL. The user supplied -// input buffer is only used as a key in locating the element in the table. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlLookupElementGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in PVOID Buffer - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function LookupElementGenericTableFull will find an element in a generic -// table. If the element is located the return value is a pointer to -// the user defined structure associated with the element. If the element is not -// located then a pointer to the parent for the insert location is returned. The -// user must look at the SearchResult value to determine which is being returned. -// The user can use the SearchResult and parent for a subsequent FullInsertElement -// call to optimize the insert. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -PVOID -NTAPI -RtlLookupElementGenericTableFullAvl ( - __in PRTL_AVL_TABLE Table, - __in PVOID Buffer, - __out PVOID *NodeOrParent, - __out TABLE_SEARCH_RESULT *SearchResult - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function EnumerateGenericTable will return to the caller one-by-one -// the elements of of a table. The return value is a pointer to the user -// defined structure associated with the element. The input parameter -// Restart indicates if the enumeration should start from the beginning -// or should return the next element. If the are no more new elements to -// return the return value is NULL. As an example of its use, to enumerate -// all of the elements in a table the user would write: -// -// for (ptr = EnumerateGenericTable(Table, TRUE); -// ptr != NULL; -// ptr = EnumerateGenericTable(Table, FALSE)) { -// : -// } -// -// NOTE: This routine does not modify the structure of the tree, but saves -// the last node returned in the generic table itself, and for this -// reason requires exclusive access to the table for the duration of -// the enumeration. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlEnumerateGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in BOOLEAN Restart - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function EnumerateGenericTableWithoutSplaying will return to the -// caller one-by-one the elements of of a table. The return value is a -// pointer to the user defined structure associated with the element. -// The input parameter RestartKey indicates if the enumeration should -// start from the beginning or should return the next element. If the -// are no more new elements to return the return value is NULL. As an -// example of its use, to enumerate all of the elements in a table the -// user would write: -// -// RestartKey = NULL; -// for (ptr = EnumerateGenericTableWithoutSplaying(Table, &RestartKey); -// ptr != NULL; -// ptr = EnumerateGenericTableWithoutSplaying(Table, &RestartKey)) { -// : -// } -// -// If RestartKey is NULL, the package will start from the least entry in the -// table, otherwise it will start from the last entry returned. -// -// NOTE: This routine does not modify either the structure of the tree -// or the generic table itself, but must insure that no deletes -// occur for the duration of the enumeration, typically by having -// at least shared access to the table for the duration. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlEnumerateGenericTableWithoutSplayingAvl ( - __in PRTL_AVL_TABLE Table, - __inout PVOID *RestartKey - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// RtlLookupFirstMatchingElementGenericTableAvl will return the left-most -// element in the tree matching the data in Buffer. If, for example, the tree -// contains filenames there may exist several that differ only in case. A case- -// blind searcher can use this routine to position himself in the tree at the -// first match, and use an enumeration routine (such as RtlEnumerateGenericTableWithoutSplayingAvl -// to return each subsequent match. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlLookupFirstMatchingElementGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in PVOID Buffer, - __out PVOID *RestartKey - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function EnumerateGenericTableLikeADirectory will return to the -// caller one-by-one the elements of of a table. The return value is a -// pointer to the user defined structure associated with the element. -// The input parameter RestartKey indicates if the enumeration should -// start from the beginning or should return the next element. If the -// are no more new elements to return the return value is NULL. As an -// example of its use, to enumerate all of the elements in a table the -// user would write: -// -// RestartKey = NULL; -// for (ptr = EnumerateGenericTableLikeADirectory(Table, &RestartKey, ...); -// ptr != NULL; -// ptr = EnumerateGenericTableLikeADirectory(Table, &RestartKey, ...)) { -// : -// } -// -// If RestartKey is NULL, the package will start from the least entry in the -// table, otherwise it will start from the last entry returned. -// -// NOTE: This routine does not modify either the structure of the tree -// or the generic table itself. The table must only be acquired -// shared for the duration of this call, and all synchronization -// may optionally be dropped between calls. Enumeration is always -// correctly resumed in the most efficient manner possible via the -// IN OUT parameters provided. -// -// ****** Explain NextFlag. Directory enumeration resumes from a key -// requires more thought. Also need the match pattern and IgnoreCase. -// Should some structure be introduced to carry it all? -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlEnumerateGenericTableLikeADirectory ( - __in PRTL_AVL_TABLE Table, - __in_opt PRTL_AVL_MATCH_FUNCTION MatchFunction, - __in_opt PVOID MatchData, - __in ULONG NextFlag, - __inout PVOID *RestartKey, - __inout PULONG DeleteCount, - __in PVOID Buffer - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function GetElementGenericTable will return the i'th element -// inserted in the generic table. I = 0 implies the first element, -// I = (RtlNumberGenericTableElements(Table)-1) will return the last element -// inserted into the generic table. The type of I is ULONG. Values -// of I > than (NumberGenericTableElements(Table)-1) will return NULL. If -// an arbitrary element is deleted from the generic table it will cause -// all elements inserted after the deleted element to "move up". - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlGetElementGenericTableAvl ( - __in PRTL_AVL_TABLE Table, - __in ULONG I - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function NumberGenericTableElements returns a ULONG value -// which is the number of generic table elements currently inserted -// in the generic table. - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -ULONG -NTAPI -RtlNumberGenericTableElementsAvl ( - __in PRTL_AVL_TABLE Table - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// The function IsGenericTableEmpty will return to the caller TRUE if -// the input table is empty (i.e., does not contain any elements) and -// FALSE otherwise. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlIsGenericTableEmptyAvl ( - __in PRTL_AVL_TABLE Table - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// As an aid to allowing existing generic table users to do (in most -// cases) a single-line edit to switch over to Avl table use, we -// have the following defines and inline routine definitions which -// redirect calls and types. Note that the type override (performed -// by #define below) will not work in the unexpected event that someone -// has used a pointer or type specifier in their own #define, since -// #define processing is one pass and does not nest. The __inline -// declarations below do not have this limitation, however. -// -// To switch to using Avl tables, add the following line before your -// includes: -// -// #define RTL_USE_AVL_TABLES 0 -// - -#ifdef RTL_USE_AVL_TABLES - -#undef PRTL_GENERIC_COMPARE_ROUTINE -#undef RTL_GENERIC_COMPARE_ROUTINE -#undef PRTL_GENERIC_ALLOCATE_ROUTINE -#undef RTL_GENERIC_ALLOCATE_ROUTINE -#undef PRTL_GENERIC_FREE_ROUTINE -#undef RTL_GENERIC_FREE_ROUTINE -#undef RTL_GENERIC_TABLE -#undef PRTL_GENERIC_TABLE - -#define PRTL_GENERIC_COMPARE_ROUTINE PRTL_AVL_COMPARE_ROUTINE -#define RTL_GENERIC_COMPARE_ROUTINE RTL_AVL_COMPARE_ROUTINE -#define PRTL_GENERIC_ALLOCATE_ROUTINE PRTL_AVL_ALLOCATE_ROUTINE -#define RTL_GENERIC_ALLOCATE_ROUTINE RTL_AVL_ALLOCATE_ROUTINE -#define PRTL_GENERIC_FREE_ROUTINE PRTL_AVL_FREE_ROUTINE -#define RTL_GENERIC_FREE_ROUTINE RTL_AVL_FREE_ROUTINE -#define RTL_GENERIC_TABLE RTL_AVL_TABLE -#define PRTL_GENERIC_TABLE PRTL_AVL_TABLE - -#define RtlInitializeGenericTable RtlInitializeGenericTableAvl -#define RtlInsertElementGenericTable RtlInsertElementGenericTableAvl -#define RtlInsertElementGenericTableFull RtlInsertElementGenericTableFullAvl -#define RtlDeleteElementGenericTable RtlDeleteElementGenericTableAvl -#define RtlLookupElementGenericTable RtlLookupElementGenericTableAvl -#define RtlLookupElementGenericTableFull RtlLookupElementGenericTableFullAvl -#define RtlEnumerateGenericTable RtlEnumerateGenericTableAvl -#define RtlEnumerateGenericTableWithoutSplaying RtlEnumerateGenericTableWithoutSplayingAvl -#define RtlGetElementGenericTable RtlGetElementGenericTableAvl -#define RtlNumberGenericTableElements RtlNumberGenericTableElementsAvl -#define RtlIsGenericTableEmpty RtlIsGenericTableEmptyAvl - -#endif // RTL_USE_AVL_TABLES - - -// -// Define the splay links and the associated manipuliation macros and -// routines. Note that the splay_links should be an opaque type. -// Routine are provided to traverse and manipulate the structure. -// - -typedef struct _RTL_SPLAY_LINKS { - struct _RTL_SPLAY_LINKS *Parent; - struct _RTL_SPLAY_LINKS *LeftChild; - struct _RTL_SPLAY_LINKS *RightChild; -} RTL_SPLAY_LINKS; -typedef RTL_SPLAY_LINKS *PRTL_SPLAY_LINKS; - -// -// The macro procedure InitializeSplayLinks takes as input a pointer to -// splay link and initializes its substructure. All splay link nodes must -// be initialized before they are used in the different splay routines and -// macros. -// -// VOID -// RtlInitializeSplayLinks ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlInitializeSplayLinks(Links) { \ - PRTL_SPLAY_LINKS _SplayLinks; \ - _SplayLinks = (PRTL_SPLAY_LINKS)(Links); \ - _SplayLinks->Parent = _SplayLinks; \ - _SplayLinks->LeftChild = NULL; \ - _SplayLinks->RightChild = NULL; \ - } - -// -// The macro function Parent takes as input a pointer to a splay link in a -// tree and returns a pointer to the splay link of the parent of the input -// node. If the input node is the root of the tree the return value is -// equal to the input value. -// -// PRTL_SPLAY_LINKS -// RtlParent ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlParent(Links) ( \ - (PRTL_SPLAY_LINKS)(Links)->Parent \ - ) - -// -// The macro function LeftChild takes as input a pointer to a splay link in -// a tree and returns a pointer to the splay link of the left child of the -// input node. If the left child does not exist, the return value is NULL. -// -// PRTL_SPLAY_LINKS -// RtlLeftChild ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlLeftChild(Links) ( \ - (PRTL_SPLAY_LINKS)(Links)->LeftChild \ - ) - -// -// The macro function RightChild takes as input a pointer to a splay link -// in a tree and returns a pointer to the splay link of the right child of -// the input node. If the right child does not exist, the return value is -// NULL. -// -// PRTL_SPLAY_LINKS -// RtlRightChild ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlRightChild(Links) ( \ - (PRTL_SPLAY_LINKS)(Links)->RightChild \ - ) - -// -// The macro function IsRoot takes as input a pointer to a splay link -// in a tree and returns TRUE if the input node is the root of the tree, -// otherwise it returns FALSE. -// -// BOOLEAN -// RtlIsRoot ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlIsRoot(Links) ( \ - (RtlParent(Links) == (PRTL_SPLAY_LINKS)(Links)) \ - ) - -// -// The macro function IsLeftChild takes as input a pointer to a splay link -// in a tree and returns TRUE if the input node is the left child of its -// parent, otherwise it returns FALSE. -// -// BOOLEAN -// RtlIsLeftChild ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlIsLeftChild(Links) ( \ - (RtlLeftChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)) \ - ) - -// -// The macro function IsRightChild takes as input a pointer to a splay link -// in a tree and returns TRUE if the input node is the right child of its -// parent, otherwise it returns FALSE. -// -// BOOLEAN -// RtlIsRightChild ( -// PRTL_SPLAY_LINKS Links -// ); -// - -#define RtlIsRightChild(Links) ( \ - (RtlRightChild(RtlParent(Links)) == (PRTL_SPLAY_LINKS)(Links)) \ - ) - -// -// The macro procedure InsertAsLeftChild takes as input a pointer to a splay -// link in a tree and a pointer to a node not in a tree. It inserts the -// second node as the left child of the first node. The first node must not -// already have a left child, and the second node must not already have a -// parent. -// -// VOID -// RtlInsertAsLeftChild ( -// PRTL_SPLAY_LINKS ParentLinks, -// PRTL_SPLAY_LINKS ChildLinks -// ); -// - -#define RtlInsertAsLeftChild(ParentLinks,ChildLinks) { \ - PRTL_SPLAY_LINKS _SplayParent; \ - PRTL_SPLAY_LINKS _SplayChild; \ - _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ - _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ - _SplayParent->LeftChild = _SplayChild; \ - _SplayChild->Parent = _SplayParent; \ - } - -// -// The macro procedure InsertAsRightChild takes as input a pointer to a splay -// link in a tree and a pointer to a node not in a tree. It inserts the -// second node as the right child of the first node. The first node must not -// already have a right child, and the second node must not already have a -// parent. -// -// VOID -// RtlInsertAsRightChild ( -// PRTL_SPLAY_LINKS ParentLinks, -// PRTL_SPLAY_LINKS ChildLinks -// ); -// - -#define RtlInsertAsRightChild(ParentLinks,ChildLinks) { \ - PRTL_SPLAY_LINKS _SplayParent; \ - PRTL_SPLAY_LINKS _SplayChild; \ - _SplayParent = (PRTL_SPLAY_LINKS)(ParentLinks); \ - _SplayChild = (PRTL_SPLAY_LINKS)(ChildLinks); \ - _SplayParent->RightChild = _SplayChild; \ - _SplayChild->Parent = _SplayParent; \ - } - -// -// The Splay function takes as input a pointer to a splay link in a tree -// and splays the tree. Its function return value is a pointer to the -// root of the splayed tree. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlSplay ( - __inout PRTL_SPLAY_LINKS Links - ); -#endif - -// -// The Delete function takes as input a pointer to a splay link in a tree -// and deletes that node from the tree. Its function return value is a -// pointer to the root of the tree. If the tree is now empty, the return -// value is NULL. -// - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlDelete ( - __in PRTL_SPLAY_LINKS Links - ); -#endif - -// -// The DeleteNoSplay function takes as input a pointer to a splay link in a tree, -// the caller's pointer to the root of the tree and deletes that node from the -// tree. Upon return the caller's pointer to the root node will correctly point -// at the root of the tree. -// -// It operationally differs from RtlDelete only in that it will not splay the tree. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlDeleteNoSplay ( - __in PRTL_SPLAY_LINKS Links, - __inout PRTL_SPLAY_LINKS *Root - ); -#endif - -// -// The SubtreeSuccessor function takes as input a pointer to a splay link -// in a tree and returns a pointer to the successor of the input node of -// the substree rooted at the input node. If there is not a successor, the -// return value is NULL. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlSubtreeSuccessor ( - __in PRTL_SPLAY_LINKS Links - ); -#endif - -// -// The SubtreePredecessor function takes as input a pointer to a splay link -// in a tree and returns a pointer to the predecessor of the input node of -// the substree rooted at the input node. If there is not a predecessor, -// the return value is NULL. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlSubtreePredecessor ( - __in PRTL_SPLAY_LINKS Links - ); -#endif - -// -// The RealSuccessor function takes as input a pointer to a splay link -// in a tree and returns a pointer to the successor of the input node within -// the entire tree. If there is not a successor, the return value is NULL. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlRealSuccessor ( - __in PRTL_SPLAY_LINKS Links - ); -#endif - -// -// The RealPredecessor function takes as input a pointer to a splay link -// in a tree and returns a pointer to the predecessor of the input node -// within the entire tree. If there is not a predecessor, the return value -// is NULL. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PRTL_SPLAY_LINKS -NTAPI -RtlRealPredecessor ( - __in PRTL_SPLAY_LINKS Links - ); -#endif - - -// -// Define the generic table package. Note a generic table should really -// be an opaque type. We provide routines to manipulate the structure. -// -// A generic table is package for inserting, deleting, and looking up elements -// in a table (e.g., in a symbol table). To use this package the user -// defines the structure of the elements stored in the table, provides a -// comparison function, a memory allocation function, and a memory -// deallocation function. -// -// Note: the user compare function must impose a complete ordering among -// all of the elements, and the table does not allow for duplicate entries. -// - -// -// Do not do the following defines if using Avl -// - -#ifndef RTL_USE_AVL_TABLES - -// -// Add an empty typedef so that functions can reference the -// a pointer to the generic table struct before it is declared. -// - -struct _RTL_GENERIC_TABLE; - -// -// The comparison function takes as input pointers to elements containing -// user defined structures and returns the results of comparing the two -// elements. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_GENERIC_COMPARE_ROUTINE) -RTL_GENERIC_COMPARE_RESULTS -NTAPI -RTL_GENERIC_COMPARE_ROUTINE ( - __in struct _RTL_GENERIC_TABLE *Table, - __in PVOID FirstStruct, - __in PVOID SecondStruct - ); -typedef RTL_GENERIC_COMPARE_ROUTINE *PRTL_GENERIC_COMPARE_ROUTINE; - -// -// The allocation function is called by the generic table package whenever -// it needs to allocate memory for the table. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_GENERIC_ALLOCATE_ROUTINE) -__drv_allocatesMem(Mem) -PVOID -NTAPI -RTL_GENERIC_ALLOCATE_ROUTINE ( - __in struct _RTL_GENERIC_TABLE *Table, - __in CLONG ByteSize - ); -typedef RTL_GENERIC_ALLOCATE_ROUTINE *PRTL_GENERIC_ALLOCATE_ROUTINE; - -// -// The deallocation function is called by the generic table package whenever -// it needs to deallocate memory from the table that was allocated by calling -// the user supplied allocation function. -// - -typedef -__drv_sameIRQL -__drv_functionClass(RTL_GENERIC_FREE_ROUTINE) -VOID -NTAPI -RTL_GENERIC_FREE_ROUTINE ( - __in struct _RTL_GENERIC_TABLE *Table, - __in __drv_freesMem(Mem) __post_invalid PVOID Buffer - ); -typedef RTL_GENERIC_FREE_ROUTINE *PRTL_GENERIC_FREE_ROUTINE; - -// -// To use the generic table package the user declares a variable of type -// GENERIC_TABLE and then uses the routines described below to initialize -// the table and to manipulate the table. Note that the generic table -// should really be an opaque type. -// - -typedef struct _RTL_GENERIC_TABLE { - PRTL_SPLAY_LINKS TableRoot; - LIST_ENTRY InsertOrderList; - PLIST_ENTRY OrderedPointer; - ULONG WhichOrderedElement; - ULONG NumberGenericTableElements; - PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine; - PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine; - PRTL_GENERIC_FREE_ROUTINE FreeRoutine; - PVOID TableContext; -} RTL_GENERIC_TABLE; -typedef RTL_GENERIC_TABLE *PRTL_GENERIC_TABLE; - -// -// The procedure InitializeGenericTable takes as input an uninitialized -// generic table variable and pointers to the three user supplied routines. -// This must be called for every individual generic table variable before -// it can be used. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlInitializeGenericTable ( - __out PRTL_GENERIC_TABLE Table, - __in PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine, - __in PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine, - __in PRTL_GENERIC_FREE_ROUTINE FreeRoutine, - __in_opt PVOID TableContext - ); -#endif - -// -// The function InsertElementGenericTable will insert a new element -// in a table. It does this by allocating space for the new element -// (this includes splay links), inserting the element in the table, and -// then returning to the user a pointer to the new element. If an element -// with the same key already exists in the table the return value is a pointer -// to the old element. The optional output parameter NewElement is used -// to indicate if the element previously existed in the table. Note: the user -// supplied Buffer is only used for searching the table, upon insertion its -// contents are copied to the newly created element. This means that -// pointer to the input buffer will not point to the new element. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PVOID -NTAPI -RtlInsertElementGenericTable ( - __in PRTL_GENERIC_TABLE Table, - __in_bcount(BufferSize) PVOID Buffer, - __in CLONG BufferSize, - __out_opt PBOOLEAN NewElement - ); -#endif - -// -// The function InsertElementGenericTableFull will insert a new element -// in a table. It does this by allocating space for the new element -// (this includes splay links), inserting the element in the table, and -// then returning to the user a pointer to the new element. If an element -// with the same key already exists in the table the return value is a pointer -// to the old element. The optional output parameter NewElement is used -// to indicate if the element previously existed in the table. Note: the user -// supplied Buffer is only used for searching the table, upon insertion its -// contents are copied to the newly created element. This means that -// pointer to the input buffer will not point to the new element. -// This routine is passed the NodeOrParent and SearchResult from a -// previous RtlLookupElementGenericTableFull. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PVOID -NTAPI -RtlInsertElementGenericTableFull ( - __in PRTL_GENERIC_TABLE Table, - __in_bcount(BufferSize) PVOID Buffer, - __in CLONG BufferSize, - __out_opt PBOOLEAN NewElement, - __in PVOID NodeOrParent, - __in TABLE_SEARCH_RESULT SearchResult - ); -#endif - -// -// The function DeleteElementGenericTable will find and delete an element -// from a generic table. If the element is located and deleted the return -// value is TRUE, otherwise if the element is not located the return value -// is FALSE. The user supplied input buffer is only used as a key in -// locating the element in the table. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -BOOLEAN -NTAPI -RtlDeleteElementGenericTable ( - __in PRTL_GENERIC_TABLE Table, - __in PVOID Buffer - ); -#endif - -// -// The function LookupElementGenericTable will find an element in a generic -// table. If the element is located the return value is a pointer to -// the user defined structure associated with the element, otherwise if -// the element is not located the return value is NULL. The user supplied -// input buffer is only used as a key in locating the element in the table. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlLookupElementGenericTable ( - __in PRTL_GENERIC_TABLE Table, - __in PVOID Buffer - ); -#endif - -// -// The function LookupElementGenericTableFull will find an element in a generic -// table. If the element is located the return value is a pointer to -// the user defined structure associated with the element. If the element is not -// located then a pointer to the parent for the insert location is returned. The -// user must look at the SearchResult value to determine which is being returned. -// The user can use the SearchResult and parent for a subsequent FullInsertElement -// call to optimize the insert. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PVOID -NTAPI -RtlLookupElementGenericTableFull ( - __in PRTL_GENERIC_TABLE Table, - __in PVOID Buffer, - __out PVOID *NodeOrParent, - __out TABLE_SEARCH_RESULT *SearchResult - ); -#endif - -// -// The function EnumerateGenericTable will return to the caller one-by-one -// the elements of of a table. The return value is a pointer to the user -// defined structure associated with the element. The input parameter -// Restart indicates if the enumeration should start from the beginning -// or should return the next element. If the are no more new elements to -// return the return value is NULL. As an example of its use, to enumerate -// all of the elements in a table the user would write: -// -// for (ptr = EnumerateGenericTable(Table, TRUE); -// ptr != NULL; -// ptr = EnumerateGenericTable(Table, FALSE)) { -// : -// } -// -// -// PLEASE NOTE: -// -// If you enumerate a GenericTable using RtlEnumerateGenericTable, you -// will flatten the table, turning it into a sorted linked list. -// To enumerate the table without perturbing the splay links, use -// RtlEnumerateGenericTableWithoutSplaying - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlEnumerateGenericTable ( - __in PRTL_GENERIC_TABLE Table, - __in BOOLEAN Restart - ); -#endif - -// -// The function EnumerateGenericTableWithoutSplaying will return to the -// caller one-by-one the elements of of a table. The return value is a -// pointer to the user defined structure associated with the element. -// The input parameter RestartKey indicates if the enumeration should -// start from the beginning or should return the next element. If the -// are no more new elements to return the return value is NULL. As an -// example of its use, to enumerate all of the elements in a table the -// user would write: -// -// RestartKey = NULL; -// for (ptr = EnumerateGenericTableWithoutSplaying(Table, &RestartKey); -// ptr != NULL; -// ptr = EnumerateGenericTableWithoutSplaying(Table, &RestartKey)) { -// : -// } -// -// If RestartKey is NULL, the package will start from the least entry in the -// table, otherwise it will start from the last entry returned. -// -// -// Note that unlike RtlEnumerateGenericTable, this routine will NOT perturb -// the splay order of the tree. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlEnumerateGenericTableWithoutSplaying ( - __in PRTL_GENERIC_TABLE Table, - __inout PVOID *RestartKey - ); -#endif - -// -// The function GetElementGenericTable will return the i'th element -// inserted in the generic table. I = 0 implies the first element, -// I = (RtlNumberGenericTableElements(Table)-1) will return the last element -// inserted into the generic table. The type of I is ULONG. Values -// of I > than (NumberGenericTableElements(Table)-1) will return NULL. If -// an arbitrary element is deleted from the generic table it will cause -// all elements inserted after the deleted element to "move up". - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlGetElementGenericTable( - __in PRTL_GENERIC_TABLE Table, - __in ULONG I - ); -#endif - -// -// The function NumberGenericTableElements returns a ULONG value -// which is the number of generic table elements currently inserted -// in the generic table. - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlNumberGenericTableElements( - __in PRTL_GENERIC_TABLE Table - ); -#endif - -// -// The function IsGenericTableEmpty will return to the caller TRUE if -// the input table is empty (i.e., does not contain any elements) and -// FALSE otherwise. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlIsGenericTableEmpty ( - __in PRTL_GENERIC_TABLE Table - ); -#endif - -#endif // RTL_USE_AVL_TABLES - - - -// -// The hash table header structure can either be allocated -// by the caller, or by the hash table creation function itself. -// This flag indicates what was done at creation time. -// -#define RTL_HASH_ALLOCATED_HEADER 0x00000001 - - -// -// The RTL_HASH_RESERVED_SIGNATURE is the signature used internally for -// enumerators. A caller can never assign this signature to -// valid entries. -// -#define RTL_HASH_RESERVED_SIGNATURE 0 - - -typedef struct _RTL_DYNAMIC_HASH_TABLE_ENTRY { - LIST_ENTRY Linkage; - ULONG_PTR Signature; -} RTL_DYNAMIC_HASH_TABLE_ENTRY, *PRTL_DYNAMIC_HASH_TABLE_ENTRY; - - -// -// Some components want to see the actual signature and can use -// this macro to encapsulate that operation. -// -#define HASH_ENTRY_KEY(x) ((x)->Signature) - - -// -// Brief background on each of the parameters and their -// justification: -// 1. ChainHead stores the pointer to a bucket. This is needed since -// our hash chains are doubly-linked circular lists, and there is -// is no way to determine whether we've reached the end of the -// chain unless we store the pointer to the bucket itself. This -// is particularly used in walking the sub-list of entries returned -// by a lookup. We need to know when the sub-list has been -// completely returned. -// 2. PrevLinkage stores a pointer to the entry before the entry -// under consideration. The reason for storing the previous entry -// instead of the entry itself is for cases where a lookup fails -// and PrevLinkage actually stores the entry that would have been -// the previous entry, had the looked up entry existed. This can -// then be used to actually insert the entry at that place. -// 3. Signature is used primarily as a safety check in insertion. -// This field must match the Signature of the entry being inserted. -// - -typedef struct _RTL_DYNAMIC_HASH_TABLE_CONTEXT { - PLIST_ENTRY ChainHead; - PLIST_ENTRY PrevLinkage; - ULONG_PTR Signature; -} RTL_DYNAMIC_HASH_TABLE_CONTEXT, *PRTL_DYNAMIC_HASH_TABLE_CONTEXT; - -typedef struct _RTL_DYNAMIC_HASH_TABLE_ENUMERATOR { - RTL_DYNAMIC_HASH_TABLE_ENTRY HashEntry; - PLIST_ENTRY ChainHead; - ULONG BucketIndex; -} RTL_DYNAMIC_HASH_TABLE_ENUMERATOR, *PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR; - -typedef struct _RTL_DYNAMIC_HASH_TABLE { - - // Entries initialized at creation - ULONG Flags; - ULONG Shift; - - // Entries used in bucket computation. - ULONG TableSize; - ULONG Pivot; - ULONG DivisorMask; - - // Counters - ULONG NumEntries; - ULONG NonEmptyBuckets; - ULONG NumEnumerators; - - // The directory. This field is for internal use only. - PVOID Directory; - -} RTL_DYNAMIC_HASH_TABLE, *PRTL_DYNAMIC_HASH_TABLE; - - -// -// Inline functions first. -// -#if !defined(MIDL_PASS) && !defined(SORTPP_PASS) - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -VOID -RtlInitHashTableContext( - __inout PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ) -{ - Context->ChainHead = NULL; - Context->PrevLinkage = NULL; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -VOID -RtlInitHashTableContextFromEnumerator( - __inout PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context, - __in PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ) -{ - Context->ChainHead = Enumerator->ChainHead; - Context->PrevLinkage = Enumerator->HashEntry.Linkage.Blink; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -void -RtlReleaseHashTableContext( - __inout PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ) -{ - UNREFERENCED_PARAMETER(Context); - return; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -ULONG -RtlTotalBucketsHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ) -{ - return HashTable->TableSize; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -ULONG -RtlNonEmptyBucketsHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ) -{ - return HashTable->NonEmptyBuckets; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -ULONG -RtlEmptyBucketsHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ) -{ - return HashTable->TableSize - HashTable->NonEmptyBuckets; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -ULONG -RtlTotalEntriesHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ) -{ - return HashTable->NumEntries; -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -FORCEINLINE -ULONG -RtlActiveEnumeratorsHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ) -{ - return HashTable->NumEnumerators; -} -#endif - -#endif // !defined(MIDL_PASS) && !defined(SORTPP_PASS) - -// -// Almost all the hash functions take in a Context. -// If a valid context is passed in, it will be used -// in executing the operation if possible. If a -// blank context is passed in, it will be initialized -// appropriately. -// - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlCreateHashTable( - __deref_inout_opt __drv_when(NULL == *HashTable, __drv_allocatesMem(Mem)) - PRTL_DYNAMIC_HASH_TABLE *HashTable, - __in ULONG Shift, - __in __reserved ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -VOID -NTAPI -RtlDeleteHashTable( - __in __drv_when((HashTable->Flags & RTL_HASH_ALLOCATED_HEADER), __drv_freesMem(Mem) __post_invalid) - PRTL_DYNAMIC_HASH_TABLE HashTable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlInsertEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __in __drv_aliasesMem PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, - __in ULONG_PTR Signature, - __inout_opt PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlRemoveEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __in PRTL_DYNAMIC_HASH_TABLE_ENTRY Entry, - __inout_opt PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTSYSAPI -PRTL_DYNAMIC_HASH_TABLE_ENTRY -NTAPI -RtlLookupEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __in ULONG_PTR Signature, - __out_opt PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTSYSAPI -PRTL_DYNAMIC_HASH_TABLE_ENTRY -NTAPI -RtlGetNextEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __in PRTL_DYNAMIC_HASH_TABLE_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlInitEnumerationHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __out PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTSYSAPI -PRTL_DYNAMIC_HASH_TABLE_ENTRY -NTAPI -RtlEnumerateEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __inout PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -VOID -NTAPI -RtlEndEnumerationHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __inout PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlInitWeakEnumerationHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __out PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTSYSAPI -PRTL_DYNAMIC_HASH_TABLE_ENTRY -NTAPI -RtlWeaklyEnumerateEntryHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __inout PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -VOID -NTAPI -RtlEndWeakEnumerationHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable, - __inout PRTL_DYNAMIC_HASH_TABLE_ENUMERATOR Enumerator - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlExpandHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSYSAPI -BOOLEAN -NTAPI -RtlContractHashTable( - __in PRTL_DYNAMIC_HASH_TABLE HashTable - ); -#endif - - - -#if defined (_MSC_VER) && ( _MSC_VER >= 900 ) - -PVOID -_ReturnAddress ( - VOID - ); - -#pragma intrinsic(_ReturnAddress) - -#endif - -#if (defined(_M_AMD64) || defined(_M_IA64)) && !defined(_REALLY_GET_CALLERS_CALLER_) - -#define RtlGetCallersAddress(CallersAddress, CallersCaller) \ - *CallersAddress = (PVOID)_ReturnAddress(); \ - *CallersCaller = NULL; - -#else - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlGetCallersAddress( - __out PVOID *CallersAddress, - __out PVOID *CallersCaller - ); - -#endif - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// Reserve byte 1 of the RtlWalkFrameChain flags for -// specifying a number of frames to skip. -// - -#define RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT 8 - -NTSYSAPI -ULONG -NTAPI -RtlWalkFrameChain ( - __out_ecount(Count - (Flags >> RTL_STACK_WALKING_MODE_FRAMES_TO_SKIP_SHIFT)) PVOID *Callers, - __in ULONG Count, - __in ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCharToInteger ( - __in_z PCSZ String, - __in_opt ULONG Base, - __out PULONG Value - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlCopyString( - __out PSTRING DestinationString, - __in_opt const STRING * SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -CHAR -NTAPI -RtlUpperChar ( - __in CHAR Character - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -LONG -NTAPI -RtlCompareString( - __in const STRING * String1, - __in const STRING * String2, - __in BOOLEAN CaseInSensitive - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlEqualString( - __in const STRING * String1, - __in const STRING * String2, - __in BOOLEAN CaseInSensitive - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlUpperString( - __inout PSTRING DestinationString, - __in const STRING * SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlPrefixUnicodeString( - __in PCUNICODE_STRING String1, - __in PCUNICODE_STRING String2, - __in BOOLEAN CaseInSensitive - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(AllocateDestinationString, __checkReturn) -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if !defined(MIDL_PASS) -#if defined(_AMD64_) || defined(_IA64_) -// -// Large Integer divide - 64-bits / 64-bits -> 64-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerDivide ( - __in LARGE_INTEGER Dividend, - __in LARGE_INTEGER Divisor, - __out_opt PLARGE_INTEGER Remainder - ) -{ - LARGE_INTEGER Quotient; - - Quotient.QuadPart = Dividend.QuadPart / Divisor.QuadPart; - if (ARGUMENT_PRESENT(Remainder)) { - Remainder->QuadPart = Dividend.QuadPart % Divisor.QuadPart; - } - - return Quotient; -} - -#else -// -// Large Integer divide - 64-bits / 64-bits -> 64-bits -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -NTSYSAPI -LARGE_INTEGER -NTAPI -RtlLargeIntegerDivide ( - __in LARGE_INTEGER Dividend, - __in LARGE_INTEGER Divisor, - __out_opt PLARGE_INTEGER Remainder - ); -#endif - -#endif // defined(_AMD64_) || defined(_IA64_) -#endif // !defined(MIDL_PASS) - - -// -// BOOLEAN -// RtlEqualLuid( -// PLUID L1, -// PLUID L2 -// ); - -#define RtlEqualLuid(L1, L2) (((L1)->LowPart == (L2)->LowPart) && \ - ((L1)->HighPart == (L2)->HighPart)) - -// -// BOOLEAN -// RtlIsZeroLuid( -// PLUID L1 -// ); -// -#define RtlIsZeroLuid(L1) ((BOOLEAN) (((L1)->LowPart | (L1)->HighPart) == 0)) - - - -#if !defined(MIDL_PASS) - -FORCEINLINE -LUID -NTAPI_INLINE -RtlConvertLongToLuid( - __in LONG Long - ) -{ - LUID TempLuid; - LARGE_INTEGER TempLi; - - TempLi.QuadPart = Long; - TempLuid.LowPart = TempLi.u.LowPart; - TempLuid.HighPart = TempLi.u.HighPart; - return(TempLuid); -} - -FORCEINLINE -LUID -NTAPI_INLINE -RtlConvertUlongToLuid( - __in ULONG Ulong - ) -{ - LUID TempLuid; - - TempLuid.LowPart = Ulong; - TempLuid.HighPart = 0; - return(TempLuid); -} -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlMapGenericMask( - __inout PACCESS_MASK AccessMask, - __in PGENERIC_MAPPING GenericMapping - ); -#endif - -// -// Routine for converting from a volume device object to a DOS name. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(NTDDI_VERSION >= NTDDI_WINXP, - __drv_preferredFunction("IoVolumeDeviceToDosName", - "Obsolete on WINXP and above")) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlVolumeDeviceToDosName( - __in PVOID VolumeDeviceObject, - __out PUNICODE_STRING DosName - ); -#endif - -typedef struct _OSVERSIONINFOA { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - CHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage -} OSVERSIONINFOA, *POSVERSIONINFOA, *LPOSVERSIONINFOA; - -typedef struct _OSVERSIONINFOW { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - WCHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage -} OSVERSIONINFOW, *POSVERSIONINFOW, *LPOSVERSIONINFOW, RTL_OSVERSIONINFOW, *PRTL_OSVERSIONINFOW; -#ifdef UNICODE -typedef OSVERSIONINFOW OSVERSIONINFO; -typedef POSVERSIONINFOW POSVERSIONINFO; -typedef LPOSVERSIONINFOW LPOSVERSIONINFO; -#else -typedef OSVERSIONINFOA OSVERSIONINFO; -typedef POSVERSIONINFOA POSVERSIONINFO; -typedef LPOSVERSIONINFOA LPOSVERSIONINFO; -#endif // UNICODE - -typedef struct _OSVERSIONINFOEXA { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - CHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage - USHORT wServicePackMajor; - USHORT wServicePackMinor; - USHORT wSuiteMask; - UCHAR wProductType; - UCHAR wReserved; -} OSVERSIONINFOEXA, *POSVERSIONINFOEXA, *LPOSVERSIONINFOEXA; -typedef struct _OSVERSIONINFOEXW { - ULONG dwOSVersionInfoSize; - ULONG dwMajorVersion; - ULONG dwMinorVersion; - ULONG dwBuildNumber; - ULONG dwPlatformId; - WCHAR szCSDVersion[ 128 ]; // Maintenance string for PSS usage - USHORT wServicePackMajor; - USHORT wServicePackMinor; - USHORT wSuiteMask; - UCHAR wProductType; - UCHAR wReserved; -} OSVERSIONINFOEXW, *POSVERSIONINFOEXW, *LPOSVERSIONINFOEXW, RTL_OSVERSIONINFOEXW, *PRTL_OSVERSIONINFOEXW; -#ifdef UNICODE -typedef OSVERSIONINFOEXW OSVERSIONINFOEX; -typedef POSVERSIONINFOEXW POSVERSIONINFOEX; -typedef LPOSVERSIONINFOEXW LPOSVERSIONINFOEX; -#else -typedef OSVERSIONINFOEXA OSVERSIONINFOEX; -typedef POSVERSIONINFOEXA POSVERSIONINFOEX; -typedef LPOSVERSIONINFOEXA LPOSVERSIONINFOEX; -#endif // UNICODE - -// -// RtlVerifyVersionInfo() conditions -// - -#define VER_EQUAL 1 -#define VER_GREATER 2 -#define VER_GREATER_EQUAL 3 -#define VER_LESS 4 -#define VER_LESS_EQUAL 5 -#define VER_AND 6 -#define VER_OR 7 - -#define VER_CONDITION_MASK 7 -#define VER_NUM_BITS_PER_CONDITION_MASK 3 - -// -// RtlVerifyVersionInfo() type mask bits -// - -#define VER_MINORVERSION 0x0000001 -#define VER_MAJORVERSION 0x0000002 -#define VER_BUILDNUMBER 0x0000004 -#define VER_PLATFORMID 0x0000008 -#define VER_SERVICEPACKMINOR 0x0000010 -#define VER_SERVICEPACKMAJOR 0x0000020 -#define VER_SUITENAME 0x0000040 -#define VER_PRODUCT_TYPE 0x0000080 - -// -// RtlVerifyVersionInfo() os product type values -// - -#define VER_NT_WORKSTATION 0x0000001 -#define VER_NT_DOMAIN_CONTROLLER 0x0000002 -#define VER_NT_SERVER 0x0000003 - -// -// dwPlatformId defines: -// - -#define VER_PLATFORM_WIN32s 0 -#define VER_PLATFORM_WIN32_WINDOWS 1 -#define VER_PLATFORM_WIN32_NT 2 - - -// -// -// VerifyVersionInfo() macro to set the condition mask -// -// For documentation sakes here's the old version of the macro that got -// changed to call an API -// #define VER_SET_CONDITION(_m_,_t_,_c_) _m_=(_m_|(_c_<<(1<<_t_))) -// - -#define VER_SET_CONDITION(_m_,_t_,_c_) \ - ((_m_)=VerSetConditionMask((_m_),(_t_),(_c_))) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONGLONG -NTAPI -VerSetConditionMask( - __in ULONGLONG ConditionMask, - __in ULONG TypeMask, - __in UCHAR Condition - ); -#endif - -// - -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetVersion( - __out __drv_at(lpVersionInformation->dwOSVersionInfoSize, __inout) - PRTL_OSVERSIONINFOW lpVersionInformation - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlVerifyVersionInfo( - __in PRTL_OSVERSIONINFOEXW VersionInfo, - __in ULONG TypeMask, - __in ULONGLONG ConditionMask - ); -#endif - -NTSYSAPI -ULONG -NTAPI -DbgPrompt ( - __in_z PCCH Prompt, - __out_bcount(Length) PCH Response, - __in ULONG Length - ); - -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -NTSYSAPI -BOOLEAN -NTAPI -RtlGetProductInfo( - __in ULONG OSMajorVersion, - __in ULONG OSMinorVersion, - __in ULONG SpMajorVersion, - __in ULONG SpMinorVersion, - __out PULONG ReturnedProductType - ); - -#endif - -// -// Define the various device type values. Note that values used by Microsoft -// Corporation are in the range 0-32767, and 32768-65535 are reserved for use -// by customers. -// - -#define DEVICE_TYPE ULONG - -#define FILE_DEVICE_BEEP 0x00000001 -#define FILE_DEVICE_CD_ROM 0x00000002 -#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 -#define FILE_DEVICE_CONTROLLER 0x00000004 -#define FILE_DEVICE_DATALINK 0x00000005 -#define FILE_DEVICE_DFS 0x00000006 -#define FILE_DEVICE_DISK 0x00000007 -#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 -#define FILE_DEVICE_FILE_SYSTEM 0x00000009 -#define FILE_DEVICE_INPORT_PORT 0x0000000a -#define FILE_DEVICE_KEYBOARD 0x0000000b -#define FILE_DEVICE_MAILSLOT 0x0000000c -#define FILE_DEVICE_MIDI_IN 0x0000000d -#define FILE_DEVICE_MIDI_OUT 0x0000000e -#define FILE_DEVICE_MOUSE 0x0000000f -#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 -#define FILE_DEVICE_NAMED_PIPE 0x00000011 -#define FILE_DEVICE_NETWORK 0x00000012 -#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 -#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 -#define FILE_DEVICE_NULL 0x00000015 -#define FILE_DEVICE_PARALLEL_PORT 0x00000016 -#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 -#define FILE_DEVICE_PRINTER 0x00000018 -#define FILE_DEVICE_SCANNER 0x00000019 -#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a -#define FILE_DEVICE_SERIAL_PORT 0x0000001b -#define FILE_DEVICE_SCREEN 0x0000001c -#define FILE_DEVICE_SOUND 0x0000001d -#define FILE_DEVICE_STREAMS 0x0000001e -#define FILE_DEVICE_TAPE 0x0000001f -#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 -#define FILE_DEVICE_TRANSPORT 0x00000021 -#define FILE_DEVICE_UNKNOWN 0x00000022 -#define FILE_DEVICE_VIDEO 0x00000023 -#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 -#define FILE_DEVICE_WAVE_IN 0x00000025 -#define FILE_DEVICE_WAVE_OUT 0x00000026 -#define FILE_DEVICE_8042_PORT 0x00000027 -#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 -#define FILE_DEVICE_BATTERY 0x00000029 -#define FILE_DEVICE_BUS_EXTENDER 0x0000002a -#define FILE_DEVICE_MODEM 0x0000002b -#define FILE_DEVICE_VDM 0x0000002c -#define FILE_DEVICE_MASS_STORAGE 0x0000002d -#define FILE_DEVICE_SMB 0x0000002e -#define FILE_DEVICE_KS 0x0000002f -#define FILE_DEVICE_CHANGER 0x00000030 -#define FILE_DEVICE_SMARTCARD 0x00000031 -#define FILE_DEVICE_ACPI 0x00000032 -#define FILE_DEVICE_DVD 0x00000033 -#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 -#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 -#define FILE_DEVICE_DFS_VOLUME 0x00000036 -#define FILE_DEVICE_SERENUM 0x00000037 -#define FILE_DEVICE_TERMSRV 0x00000038 -#define FILE_DEVICE_KSEC 0x00000039 -#define FILE_DEVICE_FIPS 0x0000003A -#define FILE_DEVICE_INFINIBAND 0x0000003B -#define FILE_DEVICE_VMBUS 0x0000003E -#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F -#define FILE_DEVICE_WPD 0x00000040 -#define FILE_DEVICE_BLUETOOTH 0x00000041 -#define FILE_DEVICE_MT_COMPOSITE 0x00000042 -#define FILE_DEVICE_MT_TRANSPORT 0x00000043 -#define FILE_DEVICE_BIOMETRIC 0x00000044 -#define FILE_DEVICE_PMI 0x00000045 - -// -// Macro definition for defining IOCTL and FSCTL function control codes. Note -// that function codes 0-2047 are reserved for Microsoft Corporation, and -// 2048-4095 are reserved for customers. -// - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -// -// Macro to extract device type out of the device io control code -// -#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16) - -// -// Macro to extract buffering method out of the device io control code -// -#define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3)) - -// -// Define the method codes for how buffers are passed for I/O and FS controls -// - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -// -// Define some easier to comprehend aliases: -// METHOD_DIRECT_TO_HARDWARE (writes, aka METHOD_IN_DIRECT) -// METHOD_DIRECT_FROM_HARDWARE (reads, aka METHOD_OUT_DIRECT) -// - -#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT -#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT - -// -// Define the access check value for any access -// -// -// The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in -// ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these -// constants *MUST* always be in sync. -// -// -// FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS. -// The file systems, however, may add additional access checks for I/O and FS controls -// that use this value. -// - - -#define FILE_ANY_ACCESS 0 -#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) -#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe -#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX 0x00004000 -#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX 0x00008000 -#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_EX \ - (FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX | \ - FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX) - -#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_DEPRECATED 0x00000200 -#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_DEPRECATED 0x00000300 -#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_DEPRECATED 0x00000300 - -#else -#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL 0x00000200 -#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL 0x00000300 -#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK 0x00000300 - -#define FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL_EX FILE_CHARACTERISTICS_EXPECT_ORDERLY_REMOVAL -#define FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL_EX FILE_CHARACTERISTICS_EXPECT_SURPRISE_REMOVAL -#define FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK_EX FILE_CHARACTERISTICS_REMOVAL_POLICY_MASK -#endif - -// -// flags specified here will be propagated up and down a device stack -// after FDO and all filter devices are added, but before the device -// stack is started -// - -#define FILE_CHARACTERISTICS_PROPAGATED ( FILE_REMOVABLE_MEDIA | \ - FILE_READ_ONLY_DEVICE | \ - FILE_FLOPPY_DISKETTE | \ - FILE_WRITE_ONCE_MEDIA | \ - FILE_DEVICE_SECURE_OPEN ) - - -typedef struct _FILE_ALIGNMENT_INFORMATION { - ULONG AlignmentRequirement; -} FILE_ALIGNMENT_INFORMATION, *PFILE_ALIGNMENT_INFORMATION; - -// -// This is also used for FileNormalizedNameInformation -// - -typedef struct _FILE_NAME_INFORMATION { - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_NAME_INFORMATION, *PFILE_NAME_INFORMATION; - -typedef struct _FILE_ATTRIBUTE_TAG_INFORMATION { - ULONG FileAttributes; - ULONG ReparseTag; -} FILE_ATTRIBUTE_TAG_INFORMATION, *PFILE_ATTRIBUTE_TAG_INFORMATION; - -typedef struct _FILE_DISPOSITION_INFORMATION { - BOOLEAN DeleteFile; -} FILE_DISPOSITION_INFORMATION, *PFILE_DISPOSITION_INFORMATION; - -typedef struct _FILE_END_OF_FILE_INFORMATION { - LARGE_INTEGER EndOfFile; -} FILE_END_OF_FILE_INFORMATION, *PFILE_END_OF_FILE_INFORMATION; - -typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION { - LARGE_INTEGER ValidDataLength; -} FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION; - -// -// NtQuery[Set]VolumeInformationFile types: -// -// FILE_FS_LABEL_INFORMATION -// FILE_FS_VOLUME_INFORMATION -// FILE_FS_SIZE_INFORMATION -// FILE_FS_DEVICE_INFORMATION -// FILE_FS_ATTRIBUTE_INFORMATION -// FILE_FS_CONTROL_INFORMATION -// FILE_FS_OBJECTID_INFORMATION -// - -typedef struct _FILE_FS_LABEL_INFORMATION { - ULONG VolumeLabelLength; - WCHAR VolumeLabel[1]; -} FILE_FS_LABEL_INFORMATION, *PFILE_FS_LABEL_INFORMATION; - -typedef struct _FILE_FS_VOLUME_INFORMATION { - LARGE_INTEGER VolumeCreationTime; - ULONG VolumeSerialNumber; - ULONG VolumeLabelLength; - BOOLEAN SupportsObjects; - WCHAR VolumeLabel[1]; -} FILE_FS_VOLUME_INFORMATION, *PFILE_FS_VOLUME_INFORMATION; - -typedef struct _FILE_FS_SIZE_INFORMATION { - LARGE_INTEGER TotalAllocationUnits; - LARGE_INTEGER AvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; -} FILE_FS_SIZE_INFORMATION, *PFILE_FS_SIZE_INFORMATION; - -typedef struct _FILE_FS_FULL_SIZE_INFORMATION { - LARGE_INTEGER TotalAllocationUnits; - LARGE_INTEGER CallerAvailableAllocationUnits; - LARGE_INTEGER ActualAvailableAllocationUnits; - ULONG SectorsPerAllocationUnit; - ULONG BytesPerSector; -} FILE_FS_FULL_SIZE_INFORMATION, *PFILE_FS_FULL_SIZE_INFORMATION; - -typedef struct _FILE_FS_OBJECTID_INFORMATION { - UCHAR ObjectId[16]; - UCHAR ExtendedInfo[48]; -} FILE_FS_OBJECTID_INFORMATION, *PFILE_FS_OBJECTID_INFORMATION; - - -// -// Define segement buffer structure for scatter/gather read/write. -// - -typedef union _FILE_SEGMENT_ELEMENT { - PVOID64 Buffer; - ULONGLONG Alignment; -}FILE_SEGMENT_ELEMENT, *PFILE_SEGMENT_ELEMENT; - -// -// AVIO IOCTLS. -// - -#define IOCTL_AVIO_ALLOCATE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 1, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define IOCTL_AVIO_FREE_STREAM CTL_CODE(FILE_DEVICE_AVIO, 2, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define IOCTL_AVIO_MODIFY_STREAM CTL_CODE(FILE_DEVICE_AVIO, 3, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) - - -// -// Define types of bus information. -// - -typedef enum _BUS_DATA_TYPE { - ConfigurationSpaceUndefined = -1, - Cmos, - EisaConfiguration, - Pos, - CbusConfiguration, - PCIConfiguration, - VMEConfiguration, - NuBusConfiguration, - PCMCIAConfiguration, - MPIConfiguration, - MPSAConfiguration, - PNPISAConfiguration, - SgiInternalConfiguration, - MaximumBusDataType -} BUS_DATA_TYPE, *PBUS_DATA_TYPE; - -typedef struct _KEY_NAME_INFORMATION { - ULONG NameLength; - WCHAR Name[1]; // Variable length string -} KEY_NAME_INFORMATION, *PKEY_NAME_INFORMATION; - -typedef struct _KEY_CACHED_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG SubKeys; - ULONG MaxNameLen; - ULONG Values; - ULONG MaxValueNameLen; - ULONG MaxValueDataLen; - ULONG NameLength; -} KEY_CACHED_INFORMATION, *PKEY_CACHED_INFORMATION; - -typedef struct _KEY_VIRTUALIZATION_INFORMATION { - ULONG VirtualizationCandidate : 1; // Tells whether the key is part of the virtualization namespace scope (only HKLM\Software for now) - ULONG VirtualizationEnabled : 1; // Tells whether virtualization is enabled on this key. Can be 1 only if above flag is 1. - ULONG VirtualTarget : 1; // Tells if the key is a virtual key. Can be 1 only if above 2 are 0. Valid only on the virtual store key handles. - ULONG VirtualStore : 1; // Tells if the key is a part of the virtual sore path. Valid only on the virtual store key handles. - ULONG VirtualSource : 1; // Tells if the key has ever been virtualized, Can be 1 only if VirtualizationCandidate is 1 - ULONG Reserved : 27; -} KEY_VIRTUALIZATION_INFORMATION, *PKEY_VIRTUALIZATION_INFORMATION; - -// -// Thread Environment Block (and portable part of Thread Information Block) -// - -// -// NT_TIB - Thread Information Block - Portable part. -// -// This is the subsystem portable part of the Thread Information Block. -// It appears as the first part of the TEB for all threads which have -// a user mode component. -// -// - - - -typedef struct _NT_TIB { - struct _EXCEPTION_REGISTRATION_RECORD *ExceptionList; - PVOID StackBase; - PVOID StackLimit; - PVOID SubSystemTib; -#if defined(_MSC_EXTENSIONS) - union { - PVOID FiberData; - ULONG Version; - }; -#else - PVOID FiberData; -#endif - PVOID ArbitraryUserPointer; - struct _NT_TIB *Self; -} NT_TIB; -typedef NT_TIB *PNT_TIB; - -// -// 32 and 64 bit specific version for wow64 and the debugger -// -typedef struct _NT_TIB32 { - ULONG ExceptionList; - ULONG StackBase; - ULONG StackLimit; - ULONG SubSystemTib; - -#if defined(_MSC_EXTENSIONS) - union { - ULONG FiberData; - ULONG Version; - }; -#else - ULONG FiberData; -#endif - - ULONG ArbitraryUserPointer; - ULONG Self; -} NT_TIB32, *PNT_TIB32; - -typedef struct _NT_TIB64 { - ULONG64 ExceptionList; - ULONG64 StackBase; - ULONG64 StackLimit; - ULONG64 SubSystemTib; - -#if defined(_MSC_EXTENSIONS) - union { - ULONG64 FiberData; - ULONG Version; - }; - -#else - ULONG64 FiberData; -#endif - - ULONG64 ArbitraryUserPointer; - ULONG64 Self; -} NT_TIB64, *PNT_TIB64; - -// -// Process Information Classes -// - -typedef enum _PROCESSINFOCLASS { - ProcessBasicInformation, - ProcessQuotaLimits, - ProcessIoCounters, - ProcessVmCounters, - ProcessTimes, - ProcessBasePriority, - ProcessRaisePriority, - ProcessDebugPort, - ProcessExceptionPort, - ProcessAccessToken, - ProcessLdtInformation, - ProcessLdtSize, - ProcessDefaultHardErrorMode, - ProcessIoPortHandlers, // Note: this is kernel mode only - ProcessPooledUsageAndLimits, - ProcessWorkingSetWatch, - ProcessUserModeIOPL, - ProcessEnableAlignmentFaultFixup, - ProcessPriorityClass, - ProcessWx86Information, - ProcessHandleCount, - ProcessAffinityMask, - ProcessPriorityBoost, - ProcessDeviceMap, - ProcessSessionInformation, - ProcessForegroundInformation, - ProcessWow64Information, - ProcessImageFileName, - ProcessLUIDDeviceMapsEnabled, - ProcessBreakOnTermination, - ProcessDebugObjectHandle, - ProcessDebugFlags, - ProcessHandleTracing, - ProcessIoPriority, - ProcessExecuteFlags, - ProcessTlsInformation, - ProcessCookie, - ProcessImageInformation, - ProcessCycleTime, - ProcessPagePriority, - ProcessInstrumentationCallback, - ProcessThreadStackAllocation, - ProcessWorkingSetWatchEx, - ProcessImageFileNameWin32, - ProcessImageFileMapping, - ProcessAffinityUpdateMode, - ProcessMemoryAllocationMode, - ProcessGroupInformation, - ProcessTokenVirtualizationEnabled, - ProcessConsoleHostProcess, - ProcessWindowInformation, - MaxProcessInfoClass // MaxProcessInfoClass should always be the last enum -} PROCESSINFOCLASS; - -// -// Thread Information Classes -// - -typedef enum _THREADINFOCLASS { - ThreadBasicInformation, - ThreadTimes, - ThreadPriority, - ThreadBasePriority, - ThreadAffinityMask, - ThreadImpersonationToken, - ThreadDescriptorTableEntry, - ThreadEnableAlignmentFaultFixup, - ThreadEventPair_Reusable, - ThreadQuerySetWin32StartAddress, - ThreadZeroTlsCell, - ThreadPerformanceCount, - ThreadAmILastThread, - ThreadIdealProcessor, - ThreadPriorityBoost, - ThreadSetTlsArrayAddress, // Obsolete - ThreadIsIoPending, - ThreadHideFromDebugger, - ThreadBreakOnTermination, - ThreadSwitchLegacyState, - ThreadIsTerminated, - ThreadLastSystemCall, - ThreadIoPriority, - ThreadCycleTime, - ThreadPagePriority, - ThreadActualBasePriority, - ThreadTebInformation, - ThreadCSwitchMon, // Obsolete - ThreadCSwitchPmu, - ThreadWow64Context, - ThreadGroupInformation, - ThreadUmsInformation, // UMS - ThreadCounterProfiling, - ThreadIdealProcessorEx, - MaxThreadInfoClass -} THREADINFOCLASS; - -#define THREAD_CSWITCH_PMU_DISABLE FALSE -#define THREAD_CSWITCH_PMU_ENABLE TRUE - - -// -// Process Information Structures -// - -// -// Working set page priority information. -// Used with ProcessPagePriority and ThreadPagePriority -// - -typedef struct _PAGE_PRIORITY_INFORMATION { - ULONG PagePriority; -} PAGE_PRIORITY_INFORMATION, *PPAGE_PRIORITY_INFORMATION; - -// -// PageFaultHistory Information -// NtQueryInformationProcess using ProcessWorkingSetWatch -// -typedef struct _PROCESS_WS_WATCH_INFORMATION { - PVOID FaultingPc; - PVOID FaultingVa; -} PROCESS_WS_WATCH_INFORMATION, *PPROCESS_WS_WATCH_INFORMATION; - -// -// Basic and Extended Basic Process Information -// NtQueryInformationProcess using ProcessBasicInformation -// - -typedef struct _PROCESS_BASIC_INFORMATION { - NTSTATUS ExitStatus; - PPEB PebBaseAddress; - ULONG_PTR AffinityMask; - KPRIORITY BasePriority; - ULONG_PTR UniqueProcessId; - ULONG_PTR InheritedFromUniqueProcessId; -} PROCESS_BASIC_INFORMATION,*PPROCESS_BASIC_INFORMATION; - -typedef struct _PROCESS_EXTENDED_BASIC_INFORMATION { - SIZE_T Size; // Must be set to structure size on input - PROCESS_BASIC_INFORMATION BasicInfo; - union { - ULONG Flags; - struct { - ULONG IsProtectedProcess : 1; - ULONG IsWow64Process : 1; - ULONG IsProcessDeleting : 1; - ULONG IsCrossSessionCreate : 1; - ULONG SpareBits : 28; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; -} PROCESS_EXTENDED_BASIC_INFORMATION, *PPROCESS_EXTENDED_BASIC_INFORMATION; - - -// -// Process Device Map information -// NtQueryInformationProcess using ProcessDeviceMap -// NtSetInformationProcess using ProcessDeviceMap -// - -typedef struct _PROCESS_DEVICEMAP_INFORMATION { - union { - struct { - HANDLE DirectoryHandle; - } Set; - struct { - ULONG DriveMap; - UCHAR DriveType[ 32 ]; - } Query; - } DUMMYUNIONNAME; -} PROCESS_DEVICEMAP_INFORMATION, *PPROCESS_DEVICEMAP_INFORMATION; - -typedef struct _PROCESS_DEVICEMAP_INFORMATION_EX { - union { - struct { - HANDLE DirectoryHandle; - } Set; - struct { - ULONG DriveMap; - UCHAR DriveType[ 32 ]; - } Query; - } DUMMYUNIONNAME; - ULONG Flags; // specifies that the query type -} PROCESS_DEVICEMAP_INFORMATION_EX, *PPROCESS_DEVICEMAP_INFORMATION_EX; - -// -// PROCESS_DEVICEMAP_INFORMATION_EX flags -// -#define PROCESS_LUID_DOSDEVICES_ONLY 0x00000001 - -// -// Multi-User Session specific Process Information -// NtQueryInformationProcess using ProcessSessionInformation -// - -typedef struct _PROCESS_SESSION_INFORMATION { - ULONG SessionId; -} PROCESS_SESSION_INFORMATION, *PPROCESS_SESSION_INFORMATION; - -typedef struct _PROCESS_HANDLE_TRACING_ENABLE { - ULONG Flags; -} PROCESS_HANDLE_TRACING_ENABLE, *PPROCESS_HANDLE_TRACING_ENABLE; - -typedef struct _PROCESS_HANDLE_TRACING_ENABLE_EX { - ULONG Flags; - ULONG TotalSlots; -} PROCESS_HANDLE_TRACING_ENABLE_EX, *PPROCESS_HANDLE_TRACING_ENABLE_EX; - - -#define PROCESS_HANDLE_TRACING_MAX_STACKS 16 - -typedef struct _PROCESS_HANDLE_TRACING_ENTRY { - HANDLE Handle; - CLIENT_ID ClientId; - ULONG Type; - PVOID Stacks[PROCESS_HANDLE_TRACING_MAX_STACKS]; -} PROCESS_HANDLE_TRACING_ENTRY, *PPROCESS_HANDLE_TRACING_ENTRY; - -typedef struct _PROCESS_HANDLE_TRACING_QUERY { - HANDLE Handle; - ULONG TotalTraces; - PROCESS_HANDLE_TRACING_ENTRY HandleTrace[1]; -} PROCESS_HANDLE_TRACING_QUERY, *PPROCESS_HANDLE_TRACING_QUERY; - -// -// Process Quotas -// NtQueryInformationProcess using ProcessQuotaLimits -// NtQueryInformationProcess using ProcessPooledQuotaLimits -// NtSetInformationProcess using ProcessQuotaLimits -// - - - -typedef struct _QUOTA_LIMITS { - SIZE_T PagedPoolLimit; - SIZE_T NonPagedPoolLimit; - SIZE_T MinimumWorkingSetSize; - SIZE_T MaximumWorkingSetSize; - SIZE_T PagefileLimit; - LARGE_INTEGER TimeLimit; -} QUOTA_LIMITS, *PQUOTA_LIMITS; - -#define QUOTA_LIMITS_HARDWS_MIN_ENABLE 0x00000001 -#define QUOTA_LIMITS_HARDWS_MIN_DISABLE 0x00000002 -#define QUOTA_LIMITS_HARDWS_MAX_ENABLE 0x00000004 -#define QUOTA_LIMITS_HARDWS_MAX_DISABLE 0x00000008 -#define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010 - -typedef union _RATE_QUOTA_LIMIT { - ULONG RateData; - struct { - ULONG RatePercent : 7; - ULONG Reserved0 : 25; - } DUMMYSTRUCTNAME; -} RATE_QUOTA_LIMIT, *PRATE_QUOTA_LIMIT; - -typedef struct _QUOTA_LIMITS_EX { - SIZE_T PagedPoolLimit; - SIZE_T NonPagedPoolLimit; - SIZE_T MinimumWorkingSetSize; - SIZE_T MaximumWorkingSetSize; - SIZE_T PagefileLimit; // Limit expressed in pages - LARGE_INTEGER TimeLimit; - SIZE_T WorkingSetLimit; // Limit expressed in pages - SIZE_T Reserved2; - SIZE_T Reserved3; - SIZE_T Reserved4; - ULONG Flags; - RATE_QUOTA_LIMIT CpuRateLimit; -} QUOTA_LIMITS_EX, *PQUOTA_LIMITS_EX; - - - -// -// Process I/O Counters -// NtQueryInformationProcess using ProcessIoCounters -// - - -typedef struct _IO_COUNTERS { - ULONGLONG ReadOperationCount; - ULONGLONG WriteOperationCount; - ULONGLONG OtherOperationCount; - ULONGLONG ReadTransferCount; - ULONGLONG WriteTransferCount; - ULONGLONG OtherTransferCount; -} IO_COUNTERS; -typedef IO_COUNTERS *PIO_COUNTERS; - - - -// -// Process Virtual Memory Counters -// NtQueryInformationProcess using ProcessVmCounters -// - -typedef struct _VM_COUNTERS { - SIZE_T PeakVirtualSize; - SIZE_T VirtualSize; - ULONG PageFaultCount; - SIZE_T PeakWorkingSetSize; - SIZE_T WorkingSetSize; - SIZE_T QuotaPeakPagedPoolUsage; - SIZE_T QuotaPagedPoolUsage; - SIZE_T QuotaPeakNonPagedPoolUsage; - SIZE_T QuotaNonPagedPoolUsage; - SIZE_T PagefileUsage; - SIZE_T PeakPagefileUsage; -} VM_COUNTERS; -typedef VM_COUNTERS *PVM_COUNTERS; - -typedef struct _VM_COUNTERS_EX { - SIZE_T PeakVirtualSize; - SIZE_T VirtualSize; - ULONG PageFaultCount; - SIZE_T PeakWorkingSetSize; - SIZE_T WorkingSetSize; - SIZE_T QuotaPeakPagedPoolUsage; - SIZE_T QuotaPagedPoolUsage; - SIZE_T QuotaPeakNonPagedPoolUsage; - SIZE_T QuotaNonPagedPoolUsage; - SIZE_T PagefileUsage; - SIZE_T PeakPagefileUsage; - SIZE_T PrivateUsage; -} VM_COUNTERS_EX; - -typedef VM_COUNTERS_EX *PVM_COUNTERS_EX; - - -#define MAX_HW_COUNTERS 16 -#define THREAD_PROFILING_FLAG_DISPATCH 0x00000001 - -typedef enum _HARDWARE_COUNTER_TYPE { - PMCCounter, - MaxHardwareCounterType -} HARDWARE_COUNTER_TYPE, *PHARDWARE_COUNTER_TYPE; - - -typedef struct _HARDWARE_COUNTER { - HARDWARE_COUNTER_TYPE Type; - ULONG Reserved; - ULONG64 Index; -} HARDWARE_COUNTER, *PHARDWARE_COUNTER; - -// -// Process Pooled Quota Usage and Limits -// NtQueryInformationProcess using ProcessPooledUsageAndLimits -// - -typedef struct _POOLED_USAGE_AND_LIMITS { - SIZE_T PeakPagedPoolUsage; - SIZE_T PagedPoolUsage; - SIZE_T PagedPoolLimit; - SIZE_T PeakNonPagedPoolUsage; - SIZE_T NonPagedPoolUsage; - SIZE_T NonPagedPoolLimit; - SIZE_T PeakPagefileUsage; - SIZE_T PagefileUsage; - SIZE_T PagefileLimit; -} POOLED_USAGE_AND_LIMITS; -typedef POOLED_USAGE_AND_LIMITS *PPOOLED_USAGE_AND_LIMITS; - -// -// Process Security Context Information -// NtSetInformationProcess using ProcessAccessToken -// PROCESS_SET_ACCESS_TOKEN access to the process is needed -// to use this info level. -// - -typedef struct _PROCESS_ACCESS_TOKEN { - - // - // Handle to Primary token to assign to the process. - // TOKEN_ASSIGN_PRIMARY access to this token is needed. - // - - HANDLE Token; - - // - // Handle to the initial thread of the process. - // A process's access token can only be changed if the process has - // no threads or a single thread that has not yet begun execution. - // - // N.B. This field is unused. - // - - HANDLE Thread; - -} PROCESS_ACCESS_TOKEN, *PPROCESS_ACCESS_TOKEN; - -// -// Process Exception Port Information -// NtSetInformationProcess using ProcessExceptionPort -// PROCESS_SET_PORT access to the process is needed -// to use this info level. -// - -#define PROCESS_EXCEPTION_PORT_ALL_STATE_BITS 0x00000003UL -#define PROCESS_EXCEPTION_PORT_ALL_STATE_FLAGS ((ULONG_PTR)((1UL << PROCESS_EXCEPTION_PORT_ALL_STATE_BITS) - 1)) - -typedef struct _PROCESS_EXCEPTION_PORT { - - // - // Handle to the exception port. No particular access required. - // - - __in HANDLE ExceptionPortHandle; - - // - // Miscellaneous state flags to be cached along with the exception - // port in the kernel. - // - - __inout ULONG StateFlags; - -} PROCESS_EXCEPTION_PORT, *PPROCESS_EXCEPTION_PORT; - -// -// Process/Thread System and User Time -// NtQueryInformationProcess using ProcessTimes -// NtQueryInformationThread using ThreadTimes -// - -typedef struct _KERNEL_USER_TIMES { - LARGE_INTEGER CreateTime; - LARGE_INTEGER ExitTime; - LARGE_INTEGER KernelTime; - LARGE_INTEGER UserTime; -} KERNEL_USER_TIMES; -typedef KERNEL_USER_TIMES *PKERNEL_USER_TIMES; - - -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenProcess ( - __out PHANDLE ProcessHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PCLIENT_ID ClientId - ); - - -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationProcess ( - __in HANDLE ProcessHandle, - __in PROCESSINFOCLASS ProcessInformationClass, - __out_bcount_opt(ProcessInformationLength) PVOID ProcessInformation, - __in ULONG ProcessInformationLength, - __out_opt PULONG ReturnLength - ); - -#define NTKERNELAPI DECLSPEC_IMPORT - -#if defined(_X86_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -KIRQL -KeRaiseIrqlToDpcLevel ( - VOID - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_savesIRQL -_DECL_HAL_KE_IMPORT -KIRQL -KeRaiseIrqlToSynchLevel ( - VOID - ); -#endif - - -#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) - - - -#define KeQueryTickCount(CurrentCount) { \ - KSYSTEM_TIME volatile *_TickCount = *((PKSYSTEM_TIME *)(&KeTickCount)); \ - for (;;) { \ - (CurrentCount)->HighPart = _TickCount->High1Time; \ - (CurrentCount)->LowPart = _TickCount->LowPart; \ - if ((CurrentCount)->HighPart == _TickCount->High2Time) break; \ - YieldProcessor(); \ - } \ -} - - - -#else - -VOID -NTAPI -KeQueryTickCount ( - __out PLARGE_INTEGER CurrentCount - ); - -#endif // defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) - - - -// -// Processor Control Region Structure Definition -// - -#define PCR_MINOR_VERSION 1 -#define PCR_MAJOR_VERSION 1 - -typedef struct _KPCR { - -// -// Start of the architecturally defined section of the PCR. This section -// may be directly addressed by vendor/platform specific HAL code and will -// not change from version to version of NT. -// -// Certain fields in the TIB are not used in kernel mode. These include the -// stack limit, subsystem TIB, fiber data, arbitrary user pointer, and the -// self address of then PCR itself (another field has been added for that -// purpose). Therefore, these fields are overlaid with other data to get -// better cache locality. -// - - union { - NT_TIB NtTib; - struct { - struct _EXCEPTION_REGISTRATION_RECORD *Used_ExceptionList; - PVOID Used_StackBase; - PVOID Spare2; - PVOID TssCopy; - ULONG ContextSwitches; - KAFFINITY SetMemberCopy; - PVOID Used_Self; - }; - }; - - struct _KPCR *SelfPcr; // flat address of this PCR - struct _KPRCB *Prcb; // pointer to Prcb - KIRQL Irql; // do not use 3 bytes after this as - // HALs assume they are zero. - ULONG IRR; - ULONG IrrActive; - ULONG IDR; - PVOID KdVersionBlock; - - struct _KIDTENTRY *IDT; - struct _KGDTENTRY *GDT; - struct _KTSS *TSS; - USHORT MajorVersion; - USHORT MinorVersion; - KAFFINITY SetMember; - ULONG StallScaleFactor; - UCHAR SpareUnused; - UCHAR Number; - - - - UCHAR Spare0; - UCHAR SecondLevelCacheAssociativity; - ULONG VdmAlert; - ULONG KernelReserved[14]; // For use by the kernel - ULONG SecondLevelCacheSize; - ULONG HalReserved[16]; // For use by Hal - - -} KPCR, *PKPCR; - -// -// Define the number of bits to shift to right justify the Page Directory Index -// field of a PTE. -// - -#define PDI_SHIFT_X86 22 -#define PDI_SHIFT_X86PAE 21 - -#if !defined (_X86PAE_) -#define PDI_SHIFT PDI_SHIFT_X86 -#else -#define PDI_SHIFT PDI_SHIFT_X86PAE -#define PPI_SHIFT 30 -#endif - -#define GUARD_PAGE_SIZE (PAGE_SIZE * 1) - -// -// Define the number of bits to shift to right justify the Page Table Index -// field of a PTE. -// - -#define PTI_SHIFT 12 - -// -// Define the highest user address and user probe address. -// - -extern NTKERNELAPI PVOID MmHighestUserAddress; -extern NTKERNELAPI PVOID MmSystemRangeStart; -extern NTKERNELAPI ULONG MmUserProbeAddress; - -#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress -#define MM_SYSTEM_RANGE_START MmSystemRangeStart - -#if defined(_LOCAL_COPY_USER_PROBE_ADDRESS_) - -#define MM_USER_PROBE_ADDRESS _LOCAL_COPY_USER_PROBE_ADDRESS_ - -extern ULONG _LOCAL_COPY_USER_PROBE_ADDRESS_; - -#else - -#define MM_USER_PROBE_ADDRESS MmUserProbeAddress - -#endif - -#define MM_KSEG0_BASE MM_SYSTEM_RANGE_START -#define MM_SYSTEM_SPACE_END 0xFFFFFFFF - -// -// The lowest user address reserves the low 64k. -// - -#define MM_LOWEST_USER_ADDRESS (PVOID)0x10000 - -// -// The lowest address for system space. -// - -#if !defined (_X86PAE_) -#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0800000 -#else -#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xC0C00000 -#endif - - -// -// Prototypes for architectural specific versions of Exi386 Api -// - -// -// Interlocked result type is portable, but its values are machine specific. -// Constants for value are in i386.h, mips.h, etc. -// - -typedef enum _INTERLOCKED_RESULT { - ResultNegative = RESULT_NEGATIVE, - ResultZero = RESULT_ZERO, - ResultPositive = RESULT_POSITIVE -} INTERLOCKED_RESULT; - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedIncrementLong ( - __inout __drv_interlocked LONG volatile *Addend - ); - -NTKERNELAPI -INTERLOCKED_RESULT -FASTCALL -Exfi386InterlockedDecrementLong ( - __inout __drv_interlocked LONG volatile *Addend - ); - -NTKERNELAPI -ULONG -FASTCALL -Exfi386InterlockedExchangeUlong ( - __inout __drv_interlocked ULONG volatile *Target, - __in ULONG Value - ); - - -// -// Turn these instrinsics off until the compiler can handle them -// - -#if (_MSC_FULL_VER > 13009037) - -LONG -_InterlockedOr ( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Set - ); - -#pragma intrinsic(_InterlockedOr) - -#define InterlockedOr _InterlockedOr -#define InterlockedOrAffinity InterlockedOr - -LONG -_InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Set - ); - -#pragma intrinsic(_InterlockedAnd) - -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAffinity InterlockedAnd - -LONG -_InterlockedXor ( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Set - ); - -#pragma intrinsic(_InterlockedXor) - -#define InterlockedXor _InterlockedXor - -#if !defined(_WINBASE_) && !defined(NONTOSPINTERLOCK) - -FORCEINLINE -LONGLONG -_InterlockedAnd64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old & Value, - Old) != Old); - - return Old; -} - -#define InterlockedAnd64 _InterlockedAnd64 - -LONGLONG -FORCEINLINE -_InterlockedOr64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old | Value, - Old) != Old); - - return Old; -} - -#define InterlockedOr64 _InterlockedOr64 - -FORCEINLINE -LONGLONG -_InterlockedXor64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old ^ Value, - Old) != Old); - - return Old; -} - -#define InterlockedXor64 _InterlockedXor64 - -LONGLONG -FORCEINLINE -_InterlockedIncrement64 ( - __inout __drv_interlocked LONGLONG volatile *Addend - ) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old + 1, - Old) != Old); - - return Old + 1; -} - -#define InterlockedIncrement64 _InterlockedIncrement64 - -FORCEINLINE -LONGLONG -_InterlockedDecrement64 ( - __inout __drv_interlocked LONGLONG volatile *Addend - ) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old - 1, - Old) != Old); - - return Old - 1; -} - -#define InterlockedDecrement64 _InterlockedDecrement64 - -FORCEINLINE -LONGLONG -_InterlockedExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Target; - } while (InterlockedCompareExchange64(Target, - Value, - Old) != Old); - - return Old; -} - -#define InterlockedExchange64 _InterlockedExchange64 - -FORCEINLINE -LONGLONG -_InterlockedExchangeAdd64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Addend; - } while (InterlockedCompareExchange64(Addend, - Old + Value, - Old) != Old); - - return Old; -} - -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 - -#endif // !defined(_WINBASE_) && !defined(NONTOSPINTERLOCK) - -#else // compiler version - -FORCEINLINE -LONG -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Set - ) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = InterlockedCompareExchange(Target, - i & Set, - i); - - } while (i != j); - - return j; -} - -FORCEINLINE -LONG -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Set - ) -{ - LONG i; - LONG j; - - j = *Target; - do { - i = j; - j = InterlockedCompareExchange(Target, - i | Set, - i); - - } while (i != j); - - return j; -} - -#endif // compiler version - - -#if !defined(MIDL_PASS) && defined(_M_IX86) - -// -// i386 function definitions -// - - - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4035) // re-enable below - -#define _PCR fs:[0] - -// -// Get the current processor number -// - -FORCEINLINE -ULONG -NTAPI -KeGetCurrentProcessorNumber(VOID) -{ -#if (_MSC_FULL_VER >= 13012035) - return (ULONG) __readfsbyte (FIELD_OFFSET (KPCR, Number)); -#else - __asm { movzx eax, _PCR KPCR.Number } -#endif -} - - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4035) -#endif - - -#endif // !defined(MIDL_PASS) && defined(_M_IX86) - - -#endif // defined(_X86_) - - -// Use the following for kernel mode runtime checks of X86 system architecture - -#ifdef _X86_ - -#ifdef IsNEC_98 -#undef IsNEC_98 -#endif - -#ifdef IsNotNEC_98 -#undef IsNotNEC_98 -#endif - -#ifdef SetNEC_98 -#undef SetNEC_98 -#endif - -#ifdef SetNotNEC_98 -#undef SetNotNEC_98 -#endif - -#define IsNEC_98 (SharedUserData->AlternativeArchitecture == NEC98x86) -#define IsNotNEC_98 (SharedUserData->AlternativeArchitecture != NEC98x86) -#define SetNEC_98 SharedUserData->AlternativeArchitecture = NEC98x86 -#define SetNotNEC_98 SharedUserData->AlternativeArchitecture = StandardDesign - -#endif - -#if defined(_AMD64_) - -// -// Processor Control Region Structure Definition -// - -#define PCR_MINOR_VERSION 1 -#define PCR_MAJOR_VERSION 1 - -typedef struct _KPCR { - -// -// Start of the architecturally defined section of the PCR. This section -// may be directly addressed by vendor/platform specific HAL code and will -// not change from version to version of NT. -// -// Certain fields in the TIB are not used in kernel mode. These include the -// exception list, stack base, stack limit, subsystem TIB, fiber data, and -// the arbitrary user pointer. Therefore, these fields are overlaid with -// other data to get better cache locality. -// -// N.B. The offset to the PRCB in the PCR is fixed for all time. -// - - union { - NT_TIB NtTib; - struct { - union _KGDTENTRY64 *GdtBase; - struct _KTSS64 *TssBase; - ULONG64 UserRsp; - struct _KPCR *Self; - struct _KPRCB *CurrentPrcb; - PKSPIN_LOCK_QUEUE LockArray; - PVOID Used_Self; - }; - }; - - union _KIDTENTRY64 *IdtBase; - ULONG64 Unused[2]; - KIRQL Irql; - UCHAR SecondLevelCacheAssociativity; - UCHAR ObsoleteNumber; - UCHAR Fill0; - ULONG Unused0[3]; - USHORT MajorVersion; - USHORT MinorVersion; - ULONG StallScaleFactor; - PVOID Unused1[3]; - - ULONG KernelReserved[15]; - ULONG SecondLevelCacheSize; - ULONG HalReserved[16]; - ULONG Unused2; - PVOID KdVersionBlock; - PVOID Unused3; - ULONG PcrAlign1[24]; - - -} KPCR, *PKPCR; - -// -// Exception frame -// -// This frame is established when handling an exception. It provides a place -// to save all nonvolatile registers. The volatile registers will already -// have been saved in a trap frame. -// -// N.B. The exception frame has a built in exception record capable of -// storing information for four parameter values. This exception -// record is used exclusively within the trap handling code. -// - -typedef struct _KEXCEPTION_FRAME { - -// -// Home address for the parameter registers. -// - - ULONG64 P1Home; - ULONG64 P2Home; - ULONG64 P3Home; - ULONG64 P4Home; - ULONG64 P5; - -// -// Kernel callout initial stack value. -// - - ULONG64 InitialStack; - -// -// Saved nonvolatile floating registers. -// - - M128A Xmm6; - M128A Xmm7; - M128A Xmm8; - M128A Xmm9; - M128A Xmm10; - M128A Xmm11; - M128A Xmm12; - M128A Xmm13; - M128A Xmm14; - M128A Xmm15; - -// -// Kernel callout frame variables. -// - - ULONG64 TrapFrame; - ULONG64 CallbackStack; - ULONG64 OutputBuffer; - ULONG64 OutputLength; - -// -// Saved MXCSR when a thread is interrupted in kernel mode via a dispatch -// interrupt. -// - - ULONG64 MxCsr; - -// -// Saved nonvolatile register - not always saved. -// - - ULONG64 Rbp; - -// -// Saved nonvolatile registers. -// - - ULONG64 Rbx; - ULONG64 Rdi; - ULONG64 Rsi; - ULONG64 R12; - ULONG64 R13; - ULONG64 R14; - ULONG64 R15; - -// -// EFLAGS and return address. -// - - ULONG64 Return; -} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; - -// -// Trap frame -// -// This frame is established when handling a trap. It provides a place to -// save all volatile registers. The nonvolatile registers are saved in an -// exception frame or through the normal C calling conventions for saved -// registers. -// - -typedef struct _KTRAP_FRAME { - -// -// Home address for the parameter registers. -// - - ULONG64 P1Home; - ULONG64 P2Home; - ULONG64 P3Home; - ULONG64 P4Home; - ULONG64 P5; - -// -// Previous processor mode (system services only) and previous IRQL -// (interrupts only). -// - - KPROCESSOR_MODE PreviousMode; - KIRQL PreviousIrql; - -// -// Page fault load/store indicator. -// - - UCHAR FaultIndicator; - -// -// Exception active indicator. -// -// 0 - interrupt frame. -// 1 - exception frame. -// 2 - service frame. -// - - UCHAR ExceptionActive; - -// -// Floating point state. -// - - ULONG MxCsr; - -// -// Volatile registers. -// -// N.B. These registers are only saved on exceptions and interrupts. They -// are not saved for system calls. -// - - ULONG64 Rax; - ULONG64 Rcx; - ULONG64 Rdx; - ULONG64 R8; - ULONG64 R9; - ULONG64 R10; - ULONG64 R11; - -// -// Gsbase is only used if the previous mode was kernel. -// -// GsSwap is only used if the previous mode was user. -// - - union { - ULONG64 GsBase; - ULONG64 GsSwap; - }; - -// -// Volatile floating registers. -// -// N.B. These registers are only saved on exceptions and interrupts. They -// are not saved for system calls. -// - - M128A Xmm0; - M128A Xmm1; - M128A Xmm2; - M128A Xmm3; - M128A Xmm4; - M128A Xmm5; - -// -// First parameter, page fault address, context record address if user APC -// bypass, or time stamp value. -// - - union { - ULONG64 FaultAddress; - ULONG64 ContextRecord; - ULONG64 TimeStampCKCL; - }; - -// -// Debug registers. -// - - ULONG64 Dr0; - ULONG64 Dr1; - ULONG64 Dr2; - ULONG64 Dr3; - ULONG64 Dr6; - ULONG64 Dr7; - -// -// Special debug registers. -// -// N.B. Either AMD64 or EM64T information is stored in the following locations. -// - - union { - struct { - ULONG64 DebugControl; - ULONG64 LastBranchToRip; - ULONG64 LastBranchFromRip; - ULONG64 LastExceptionToRip; - ULONG64 LastExceptionFromRip; - }; - - struct { - ULONG64 LastBranchControl; - ULONG LastBranchMSR; - }; - }; - -// -// Segment registers -// - - USHORT SegDs; - USHORT SegEs; - USHORT SegFs; - USHORT SegGs; - -// -// Previous trap frame address. -// - - ULONG64 TrapFrame; - -// -// Saved nonvolatile registers RBX, RDI and RSI. These registers are only -// saved in system service trap frames. -// - - ULONG64 Rbx; - ULONG64 Rdi; - ULONG64 Rsi; - -// -// Saved nonvolatile register RBP. This register is used as a frame -// pointer during trap processing and is saved in all trap frames. -// - - ULONG64 Rbp; - -// -// Information pushed by hardware. -// -// N.B. The error code is not always pushed by hardware. For those cases -// where it is not pushed by hardware a dummy error code is allocated -// on the stack. -// - - union { - ULONG64 ErrorCode; - ULONG64 ExceptionFrame; - ULONG64 TimeStampKlog; - }; - - ULONG64 Rip; - USHORT SegCs; - UCHAR Fill0; - UCHAR Logging; - USHORT Fill1[2]; - ULONG EFlags; - ULONG Fill2; - ULONG64 Rsp; - USHORT SegSs; - USHORT Fill3; - -// -// Copy of the global patch cycle at the time of the fault. Filled in by the -// invalid opcode and general protection fault routines. -// - - LONG CodePatchCycle; -} KTRAP_FRAME, *PKTRAP_FRAME; - -typedef struct _KUMS_CONTEXT_HEADER { - ULONG64 P1Home; - ULONG64 P2Home; - ULONG64 P3Home; - ULONG64 P4Home; - PVOID StackTop; - ULONG64 StackSize; - ULONG64 RspOffset; - ULONG64 Rip; - PXMM_SAVE_AREA32 FltSave; -#define KUMS_UCH_VOLATILE_BIT (0) -#define KUMS_UCH_VOLATILE_MASK (1ULL << KUMS_UCH_VOLATILE_BIT) - union { - struct { - ULONG64 Volatile : 1; - ULONG64 Reserved : 63; - }; - ULONG64 Flags; - }; - PKTRAP_FRAME TrapFrame; - PKEXCEPTION_FRAME ExceptionFrame; - struct _KTHREAD *SourceThread; - ULONG64 Return; -} KUMS_CONTEXT_HEADER, *PKUMS_CONTEXT_HEADER; - - -#define PXE_BASE 0xFFFFF6FB7DBED000UI64 -#define PXE_SELFMAP 0xFFFFF6FB7DBEDF68UI64 -#define PPE_BASE 0xFFFFF6FB7DA00000UI64 -#define PDE_BASE 0xFFFFF6FB40000000UI64 -#define PTE_BASE 0xFFFFF68000000000UI64 - -#define PXE_TOP 0xFFFFF6FB7DBEDFFFUI64 -#define PPE_TOP 0xFFFFF6FB7DBFFFFFUI64 -#define PDE_TOP 0xFFFFF6FB7FFFFFFFUI64 -#define PTE_TOP 0xFFFFF6FFFFFFFFFFUI64 - -#define PDE_KTBASE_AMD64 PPE_BASE - -#define PTI_SHIFT 12 -#define PDI_SHIFT 21 -#define PPI_SHIFT 30 -#define PXI_SHIFT 39 - -#define PTE_PER_PAGE 512 -#define PDE_PER_PAGE 512 -#define PPE_PER_PAGE 512 -#define PXE_PER_PAGE 512 - -#define PTI_MASK_AMD64 (PTE_PER_PAGE - 1) -#define PDI_MASK_AMD64 (PDE_PER_PAGE - 1) -#define PPI_MASK (PPE_PER_PAGE - 1) -#define PXI_MASK (PXE_PER_PAGE - 1) - -#define GUARD_PAGE_SIZE (PAGE_SIZE * 2) - -// -// Define the last branch control MSR address. -// - -extern NTKERNELAPI ULONG KeLastBranchMSR; - -// -// Define the highest user address and user probe address. -// - -extern NTKERNELAPI PVOID MmHighestUserAddress; -extern NTKERNELAPI PVOID MmSystemRangeStart; -extern NTKERNELAPI ULONG64 MmUserProbeAddress; - -#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress -#define MM_SYSTEM_RANGE_START MmSystemRangeStart - -// -// Allow non-kernel components to capture the user probe address and use a -// local copy for efficiency. -// - -#if defined(_LOCAL_COPY_USER_PROBE_ADDRESS_) - -#define MM_USER_PROBE_ADDRESS _LOCAL_COPY_USER_PROBE_ADDRESS_ - -extern ULONG64 _LOCAL_COPY_USER_PROBE_ADDRESS_; - -#else - -#define MM_USER_PROBE_ADDRESS MmUserProbeAddress - -#endif - -// -// The lowest user address reserves the low 64k. -// - -#define MM_LOWEST_USER_ADDRESS (PVOID)(LONG_PTR)0x10000 - -// -// The lowest address for system space. -// - -#define MM_LOWEST_SYSTEM_ADDRESS (PVOID)0xFFFF080000000000 - - -// -// Intrinsic functions -// - -#if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -// -// The following routines are provided for backward compatibility with old -// code. They are no longer the preferred way to accomplish these functions. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInterlockedIncrementLong) // Use InterlockedIncrement -#pragma deprecated(ExInterlockedDecrementLong) // Use InterlockedDecrement -#pragma deprecated(ExInterlockedExchangeUlong) // Use InterlockedExchange -#endif - -#define RESULT_ZERO 0 -#define RESULT_NEGATIVE 1 -#define RESULT_POSITIVE 2 - -typedef enum _INTERLOCKED_RESULT { - ResultNegative = RESULT_NEGATIVE, - ResultZero = RESULT_ZERO, - ResultPositive = RESULT_POSITIVE -} INTERLOCKED_RESULT; - -#define ExInterlockedDecrementLong(Addend, Lock) \ - _ExInterlockedDecrementLong(Addend) - -__drv_valueIs(==0;==1;==2) -__forceinline -LONG -_ExInterlockedDecrementLong ( - __inout __drv_interlocked PLONG Addend - ) - -{ - - LONG Result; - - Result = InterlockedDecrement(Addend); - if (Result < 0) { - return ResultNegative; - - } else if (Result > 0) { - return ResultPositive; - - } else { - return ResultZero; - } -} - -#define ExInterlockedIncrementLong(Addend, Lock) \ - _ExInterlockedIncrementLong(Addend) - -__drv_valueIs(==0;==1;==2) -__forceinline -LONG -_ExInterlockedIncrementLong ( - __inout __drv_interlocked PLONG Addend - ) - -{ - - LONG Result; - - Result = InterlockedIncrement(Addend); - if (Result < 0) { - return ResultNegative; - - } else if (Result > 0) { - return ResultPositive; - - } else { - return ResultZero; - } -} - -#define ExInterlockedExchangeUlong(Target, Value, Lock) \ - _ExInterlockedExchangeUlong(Target, Value) - -__forceinline -ULONG -_ExInterlockedExchangeUlong ( - __inout __drv_interlocked PULONG Target, - __in ULONG Value - ) - -{ - - return (ULONG)InterlockedExchange((PLONG)Target, (LONG)Value); -} - -#endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - - -#if !defined(MIDL_PASS) && defined(_M_AMD64) - -// -// AMD646 function prototype definitions -// - - -// -// Get address of current processor block. -// - -__forceinline -PKPCR -KeGetPcr ( - VOID - ) - -{ - return (PKPCR)__readgsqword(FIELD_OFFSET(KPCR, Self)); -} - - -#if (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS) - -// -// Get the current processor number -// - -__forceinline -ULONG -KeGetCurrentProcessorNumber ( - VOID - ) - -{ - return (ULONG)__readgsbyte(0x184); -} - -#endif - - -#endif // !defined(MIDL_PASS) && defined(_M_AMD64) - - -#endif // defined(_AMD64_) - - -// -// Platform specific kernel fucntions to raise and lower IRQL. -// - - -#if defined(_AMD64_) && !defined(MIDL_PASS) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -__forceinline -KIRQL -KeRaiseIrqlToDpcLevel ( - VOID - ) - -/*++ - -Routine Description: - - This function raises the current IRQL to DPC_LEVEL and returns the - previous IRQL. - -Arguments: - - None. - -Return Value: - - The previous IRQL is retured as the function value. - ---*/ - -{ - - return KfRaiseIrql(DISPATCH_LEVEL); -} - -__drv_savesIRQL -__drv_setsIRQL(12) -__forceinline -KIRQL -KeRaiseIrqlToSynchLevel ( - VOID - ) - -/*++ - -Routine Description: - - This function raises the current IRQL to SYNCH_LEVEL and returns the - previous IRQL. - -Arguments: - -Return Value: - - The previous IRQL is retured as the function value. - ---*/ - -{ - - return KfRaiseIrql(12); -} - - -#endif // defined(_AMD64_) && !defined(MIDL_PASS) - - -#if defined(_IA64_) - -// -// IA64 specific interlocked operation result values. -// - -#define RESULT_ZERO 0 -#define RESULT_NEGATIVE 1 -#define RESULT_POSITIVE 2 - -// -// Interlocked result type is portable, but its values are machine specific. -// Constants for values are in i386.h, mips.h, etc. -// - -typedef enum _INTERLOCKED_RESULT { - ResultNegative = RESULT_NEGATIVE, - ResultZero = RESULT_ZERO, - ResultPositive = RESULT_POSITIVE -} INTERLOCKED_RESULT; - -// -// Convert portable interlock interfaces to architecture specific interfaces. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInterlockedIncrementLong) // Use InterlockedIncrement -#pragma deprecated(ExInterlockedDecrementLong) // Use InterlockedDecrement -#pragma deprecated(ExInterlockedExchangeUlong) // Use InterlockedExchange -#endif - -#define ExInterlockedIncrementLong(Addend, Lock) \ - ExIa64InterlockedIncrementLong(Addend) - -#define ExInterlockedDecrementLong(Addend, Lock) \ - ExIa64InterlockedDecrementLong(Addend) - -#define ExInterlockedExchangeUlong(Target, Value, Lock) \ - ExIa64InterlockedExchangeUlong(Target, Value) - -NTKERNELAPI -INTERLOCKED_RESULT -ExIa64InterlockedIncrementLong ( - IN PLONG Addend - ); - -NTKERNELAPI -INTERLOCKED_RESULT -ExIa64InterlockedDecrementLong ( - IN PLONG Addend - ); - -NTKERNELAPI -ULONG -ExIa64InterlockedExchangeUlong ( - IN PULONG Target, - IN ULONG Value - ); - -// -// Get address of processor control region. -// - -#define KeGetPcr() PCR - -// -// Get address of current kernel thread object. -// - -#if defined(_M_IA64) -#define KeGetCurrentThread() PCR->CurrentThread -#endif - -#if (NTDDI_VERSION < NTDDI_WIN7) || !defined(NT_PROCESSOR_GROUPS) - -// -// Get current processor number. -// - -#define KeGetCurrentProcessorNumber() ((ULONG)(PCR->LegacyNumber)) - -#endif - -// -// Get data cache fill size. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(KeGetDcacheFillSize) // Use GetDmaAlignment -#endif - -#define KeGetDcacheFillSize() PCR->DcacheFillSize - -// -// Exception frame -// -// This frame is established when handling an exception. It provides a place -// to save all preserved registers. The volatile registers will already -// have been saved in a trap frame. Also used as part of switch frame built -// at thread switch. -// -// The frame is 16-byte aligned to maintain 16-byte alignment for the stack, -// - -typedef struct _KEXCEPTION_FRAME { - - - // Preserved application registers - ULONGLONG ApEC; // epilogue count - ULONGLONG ApLC; // loop count - ULONGLONG IntNats; // Nats for S0-S3; i.e. ar.UNAT after spill - - // Preserved (saved) interger registers, s0-s3 - ULONGLONG IntS0; - ULONGLONG IntS1; - ULONGLONG IntS2; - ULONGLONG IntS3; - - // Preserved (saved) branch registers, bs0-bs4 - ULONGLONG BrS0; - ULONGLONG BrS1; - ULONGLONG BrS2; - ULONGLONG BrS3; - ULONGLONG BrS4; - - // Preserved (saved) floating point registers, f2 - f5, f16 - f31 - FLOAT128 FltS0; - FLOAT128 FltS1; - FLOAT128 FltS2; - FLOAT128 FltS3; - FLOAT128 FltS4; - FLOAT128 FltS5; - FLOAT128 FltS6; - FLOAT128 FltS7; - FLOAT128 FltS8; - FLOAT128 FltS9; - FLOAT128 FltS10; - FLOAT128 FltS11; - FLOAT128 FltS12; - FLOAT128 FltS13; - FLOAT128 FltS14; - FLOAT128 FltS15; - FLOAT128 FltS16; - FLOAT128 FltS17; - FLOAT128 FltS18; - FLOAT128 FltS19; - - -} KEXCEPTION_FRAME, *PKEXCEPTION_FRAME; - -// -// Trap frame -// This frame is established when handling a trap. It provides a place to -// save all volatile registers. The nonvolatile registers are saved in an -// exception frame or through the normal C calling conventions for saved -// registers. Its size must be a multiple of 16 bytes. -// -// N.B - the 16-byte alignment is required to maintain the stack alignment. -// - -#define KTRAP_FRAME_ARGUMENTS (8 * 8) // up to 8 in-memory syscall args - - -typedef struct _KTRAP_FRAME { - - // - // Reserved for additional memory arguments and stack scratch area - // The size of Reserved[] must be a multiple of 16 bytes. - // - - ULONGLONG Reserved[(KTRAP_FRAME_ARGUMENTS+16)/8]; - - // Temporary (volatile) FP registers - f6-f15 (don't use f32+ in kernel) - FLOAT128 FltT0; - FLOAT128 FltT1; - FLOAT128 FltT2; - FLOAT128 FltT3; - FLOAT128 FltT4; - FLOAT128 FltT5; - FLOAT128 FltT6; - FLOAT128 FltT7; - FLOAT128 FltT8; - FLOAT128 FltT9; - - // Temporary (volatile) interger registers - ULONGLONG IntGp; // global pointer (r1) - ULONGLONG IntT0; - ULONGLONG IntT1; - // The following 4 registers fill in space of preserved (S0-S3) to align Nats - ULONGLONG ApUNAT; // ar.UNAT on kernel entry - ULONGLONG ApCCV; // ar.CCV - ULONGLONG SegCSD; // Second register for 16 byte values - ULONGLONG Preds; // Predicates - - ULONGLONG IntV0; // return value (r8) - ULONGLONG IntT2; - ULONGLONG IntT3; - ULONGLONG IntT4; - ULONGLONG IntSp; // stack pointer (r12) - ULONGLONG IntTeb; // teb (r13) - ULONGLONG IntT5; - ULONGLONG IntT6; - ULONGLONG IntT7; - ULONGLONG IntT8; - ULONGLONG IntT9; - ULONGLONG IntT10; - ULONGLONG IntT11; - ULONGLONG IntT12; - ULONGLONG IntT13; - ULONGLONG IntT14; - ULONGLONG IntT15; - ULONGLONG IntT16; - ULONGLONG IntT17; - ULONGLONG IntT18; - ULONGLONG IntT19; - ULONGLONG IntT20; - ULONGLONG IntT21; - ULONGLONG IntT22; - - ULONGLONG IntNats; // Temporary (volatile) registers' Nats directly from ar.UNAT at point of spill - - ULONGLONG BrRp; // Return pointer on kernel entry - - ULONGLONG BrT0; // Temporary (volatile) branch registers (b6-b7) - ULONGLONG BrT1; - - // Register stack info - ULONGLONG RsRSC; // RSC on kernel entry - ULONGLONG RsBSP; // BSP on kernel entry - ULONGLONG RsBSPSTORE; // User BSP Store at point of switch to kernel backing store - ULONGLONG RsRNAT; // old RNAT at point of switch to kernel backing store - ULONGLONG RsPFS; // PFS on kernel entry - - // Trap Status Information - ULONGLONG StIPSR; // Interruption Processor Status Register - ULONGLONG StIIP; // Interruption IP - ULONGLONG StIFS; // Interruption Function State - ULONGLONG StFPSR; // FP status - ULONGLONG StISR; // Interruption Status Register - ULONGLONG StIFA; // Interruption Data Address - ULONGLONG StIIPA; // Last executed bundle address - ULONGLONG StIIM; // Interruption Immediate - ULONGLONG StIHA; // Interruption Hash Address - - ULONG OldIrql; // Previous Irql. - ULONG PreviousMode; // Previous Mode. - ULONGLONG TrapFrame;// Previous Trap Frame - - // - // Exception record - // - UCHAR ExceptionRecord[(sizeof(EXCEPTION_RECORD) + 15) & (~15)]; - - // End of frame marker (for debugging) - - ULONGLONG NewBSP; // NewBSP When a stack switch occur this is the value of the new BSP - ULONGLONG EOFMarker; - - ULONGLONG SegSSD; // IA32 SSDescriptor (Ar26) - -} KTRAP_FRAME, *PKTRAP_FRAME; - -typedef struct _KUMS_CONTEXT_HEADER { - ULONGLONG Scratch[2]; - PVOID StackTop; - ULONGLONG StackSize; - ULONGLONG IntSpOffset; - PVOID BStoreBottom; - ULONGLONG RsBspOffset; - ULONGLONG RsPFS; - ULONGLONG RsRNAT; - ULONGLONG BrRp; - ULONGLONG IntTeb; - -#define KUMS_UCH_VOLATILE_BIT 0 - - union { - struct { - ULONG64 Volatile : 1; - ULONG64 Reserved : 63; - }; - ULONG64 Flags; - }; - PKTRAP_FRAME TrapFrame; - PKEXCEPTION_FRAME ExceptionFrame; - struct _KTHREAD *SourceThread; -} KUMS_CONTEXT_HEADER, *PKUMS_CONTEXT_HEADER; - -// -// OS_MCA, OS_INIT HandOff State definitions -// -// Note: The following definitions *must* match the definions of the -// corresponding SAL Revision Hand-Off structures. -// - -typedef struct _SAL_HANDOFF_STATE { - ULONGLONG PalProcEntryPoint; - ULONGLONG SalProcEntryPoint; - ULONGLONG SalGlobalPointer; - LONGLONG RendezVousResult; - ULONGLONG SalReturnAddress; - ULONGLONG MinStateSavePtr; -} SAL_HANDOFF_STATE, *PSAL_HANDOFF_STATE; - -typedef struct _OS_HANDOFF_STATE { - ULONGLONG Result; - ULONGLONG SalGlobalPointer; - ULONGLONG MinStateSavePtr; - ULONGLONG SalReturnAddress; - ULONGLONG NewContextFlag; -} OS_HANDOFF_STATE, *POS_HANDOFF_STATE; - -// -// per processor OS_MCA and OS_INIT resource structure -// - - -#define SER_EVENT_STACK_FRAME_ENTRIES 8 - -typedef struct _SAL_EVENT_RESOURCES { - - SAL_HANDOFF_STATE SalToOsHandOff; - OS_HANDOFF_STATE OsToSalHandOff; - PVOID StateDump; - ULONGLONG StateDumpPhysical; - PVOID BackStore; - ULONGLONG BackStoreLimit; - PVOID Stack; - ULONGLONG StackLimit; - PULONGLONG PTOM; - ULONGLONG StackFrame[SER_EVENT_STACK_FRAME_ENTRIES]; - PVOID EventPool; - ULONG EventPoolSize; - PVOID ErrorSummarySection; - ULONGLONG PoisonPageAddress; -} SAL_EVENT_RESOURCES, *PSAL_EVENT_RESOURCES; - -// -// Define Processor Control Region Structure. -// - -#define PCR_MINOR_VERSION 1 -#define PCR_MAJOR_VERSION 1 - -typedef struct _KPCR { - -// -// Major and minor version numbers of the PCR. -// - ULONG MinorVersion; - ULONG MajorVersion; - -// -// Start of the architecturally defined section of the PCR. This section -// may be directly addressed by vendor/platform specific HAL code and will -// not change from version to version of NT. -// - -// -// First and second level cache parameters. -// - - ULONG FirstLevelDcacheSize; - ULONG FirstLevelDcacheFillSize; - ULONG FirstLevelIcacheSize; - ULONG FirstLevelIcacheFillSize; - ULONG SecondLevelDcacheSize; - ULONG SecondLevelDcacheFillSize; - ULONG SecondLevelIcacheSize; - ULONG SecondLevelIcacheFillSize; - -// -// Data cache alignment and fill size used for cache flushing and alignment. -// These fields are set to the larger of the first and second level data -// cache fill sizes. -// - - ULONG DcacheAlignment; - ULONG DcacheFillSize; - -// -// Instruction cache alignment and fill size used for cache flushing and -// alignment. These fields are set to the larger of the first and second -// level data cache fill sizes. -// - - ULONG IcacheAlignment; - ULONG IcacheFillSize; - -// -// Processor identification from PrId register. -// - - ULONG ProcessorId; - -// -// Profiling data. -// - - ULONG ProfileInterval; - ULONG ProfileCount; - -// -// Stall execution count and scale factor. -// - - ULONG StallExecutionCount; - ULONG StallScaleFactor; - - ULONG InterruptionCount; - -// -// Space reserved for the system. -// - - ULONGLONG SystemReserved[6]; - -// -// Space reserved for the HAL -// - - ULONGLONG HalReserved[64]; - -// -// IRQL mapping tables. -// - - UCHAR IrqlMask[64]; - UCHAR IrqlTable[64]; - -// -// External Interrupt vectors. -// - - PKINTERRUPT_ROUTINE InterruptRoutine[MAXIMUM_VECTOR]; - -// -// Reserved interrupt vector mask. -// - - ULONG ReservedVectors; - -// -// Group relative processor affinity mask. -// - - KAFFINITY GroupSetMember; - -// -// Complement of the group relative processor affinity mask. -// - - KAFFINITY NotGroupMember; - -// -// Pointer to processor control block. -// - - struct _KPRCB *Prcb; - -// -// Shadow copy of Prcb->CurrentThread for fast access -// - - struct _KTHREAD *CurrentThread; - -// -// Processor number. -// - - CCHAR LegacyNumber; // Legacy Processor Number. - CCHAR Pad1[3]; - ULONG Number; // Processor Number. - - - - CCHAR Pad2; - CCHAR PollSlot; // Used by the clock routine track when we should break in. - UCHAR KernelDebugActive; // debug register active in kernel flag - UCHAR CurrentIrql; // Current IRQL - union { - USHORT SoftwareInterruptPending; // Software Interrupt Pending Flag - struct { - UCHAR ApcInterrupt; // 0x01 if APC int pending - UCHAR DispatchInterrupt; // 0x01 if dispatch int pending - }; - }; - -// -// Address of per processor SAPIC EOI Table -// - - PVOID EOITable; - -// -// IA-64 Machine Check Events trackers -// - - UCHAR InOsMca; - UCHAR InOsInit; - UCHAR InOsCmc; - UCHAR InOsCpe; - ULONG InOsULONG_Spare; // Spare ULONG - PSAL_EVENT_RESOURCES OsMcaResourcePtr; - PSAL_EVENT_RESOURCES OsInitResourcePtr; - - UCHAR AlternateStack; - UCHAR Pad[7]; - -// -// End of the architecturally defined section of the PCR. This section -// may be directly addressed by vendor/platform specific HAL code and will -// not change from version to version of NT. -// - - -} KPCR, *PKPCR; - - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -NTKERNELAPI -KIRQL -KeRaiseIrqlToDpcLevel ( - VOID - ); - -NTKERNELAPI -KIRQL -KeRaiseIrqlToSynchLevel ( - VOID - ); - - -// -// The highest user address reserves 64K bytes for a guard page. This -// the probing of address from kernel mode to only have to check the -// starting address for structures of 64k bytes or less. -// - -extern NTKERNELAPI PVOID MmHighestUserAddress; -extern NTKERNELAPI PVOID MmSystemRangeStart; -extern NTKERNELAPI ULONG_PTR MmUserProbeAddress; - - -#define MM_HIGHEST_USER_ADDRESS MmHighestUserAddress -#define MM_USER_PROBE_ADDRESS MmUserProbeAddress -#define MM_SYSTEM_RANGE_START MmSystemRangeStart - -#define MM_KSEG0_BASE 0xE000000080000000UI64 -#define MM_SYSTEM_SPACE_END (KADDRESS_BASE + 0x70000000000UI64) - -// -// The lowest user address reserves the low 64k. -// - -#define MM_LOWEST_USER_ADDRESS (PVOID)((ULONG_PTR)(UADDRESS_BASE+0x00010000)) - -#endif // defined(_IA64_) - -// -// Firmware Table provider definitions -// - -typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION { - SystemFirmwareTable_Enumerate, - SystemFirmwareTable_Get -} SYSTEM_FIRMWARE_TABLE_ACTION; - -typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION { - ULONG ProviderSignature; - SYSTEM_FIRMWARE_TABLE_ACTION Action; - ULONG TableID; - ULONG TableBufferLength; - UCHAR TableBuffer[ANYSIZE_ARRAY]; -} SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION; - -typedef -NTSTATUS -(__cdecl *PFNFTH) ( - __inout PSYSTEM_FIRMWARE_TABLE_INFORMATION SystemFirmwareTableInfo - ); - -typedef struct _SYSTEM_FIRMWARE_TABLE_HANDLER { - ULONG ProviderSignature; - BOOLEAN Register; - PFNFTH FirmwareTableHandler; - PVOID DriverObject; -} SYSTEM_FIRMWARE_TABLE_HANDLER, *PSYSTEM_FIRMWARE_TABLE_HANDLER; - - -// -// Timer APC routine definition. -// - -typedef -VOID -(*PTIMER_APC_ROUTINE) ( - __in PVOID TimerContext, - __in ULONG TimerLowValue, - __in LONG TimerHighValue - ); - -// -// Data structures used by NtSetTimerEx -// - -typedef enum _TIMER_SET_INFORMATION_CLASS { - TimerSetCoalescableTimer, - MaxTimerInfoClass // MaxTimerInfoClass should always be the last enum -} TIMER_SET_INFORMATION_CLASS; - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _TIMER_SET_COALESCABLE_TIMER_INFO { - __in LARGE_INTEGER DueTime; - __in_opt PTIMER_APC_ROUTINE TimerApcRoutine; - __in_opt PVOID TimerContext; - __in_opt struct _COUNTED_REASON_CONTEXT *WakeContext; - __in_opt ULONG Period; - __in ULONG TolerableDelay; - __out_opt PBOOLEAN PreviousState; -} TIMER_SET_COALESCABLE_TIMER_INFO, *PTIMER_SET_COALESCABLE_TIMER_INFO; - -#endif // (NTDDI_VERSION >= NTDDI_WIN7) - - -// -// Driver Verifier Definitions -// - -typedef -ULONG_PTR -(*PDRIVER_VERIFIER_THUNK_ROUTINE) ( - __in PVOID Context - ); - -// -// This structure is passed in by drivers that want to thunk callers of -// their exports. -// - -typedef struct _DRIVER_VERIFIER_THUNK_PAIRS { - PDRIVER_VERIFIER_THUNK_ROUTINE PristineRoutine; - PDRIVER_VERIFIER_THUNK_ROUTINE NewRoutine; -} DRIVER_VERIFIER_THUNK_PAIRS, *PDRIVER_VERIFIER_THUNK_PAIRS; - -// -// Driver Verifier flags. -// - -#define DRIVER_VERIFIER_SPECIAL_POOLING 0x0001 -#define DRIVER_VERIFIER_FORCE_IRQL_CHECKING 0x0002 -#define DRIVER_VERIFIER_INJECT_ALLOCATION_FAILURES 0x0004 -#define DRIVER_VERIFIER_TRACK_POOL_ALLOCATIONS 0x0008 -#define DRIVER_VERIFIER_IO_CHECKING 0x0010 - - -// -// Known extended CPU state feature IDs -// - -#define XSTATE_LEGACY_FLOATING_POINT 0 -#define XSTATE_LEGACY_SSE 1 -#define XSTATE_GSSE 2 - -#define XSTATE_MASK_LEGACY_FLOATING_POINT (1i64 << (XSTATE_LEGACY_FLOATING_POINT)) -#define XSTATE_MASK_LEGACY_SSE (1i64 << (XSTATE_LEGACY_SSE)) -#define XSTATE_MASK_LEGACY (XSTATE_MASK_LEGACY_FLOATING_POINT | XSTATE_MASK_LEGACY_SSE) -#define XSTATE_MASK_GSSE (1i64 << (XSTATE_GSSE)) - -#define MAXIMUM_XSTATE_FEATURES 64 - -// -// Extended processor state configuration -// - -typedef struct _XSTATE_FEATURE { - ULONG Offset; - ULONG Size; -} XSTATE_FEATURE, *PXSTATE_FEATURE; - -typedef struct _XSTATE_CONFIGURATION { - // Mask of enabled features - ULONG64 EnabledFeatures; - - // Total size of the save area - ULONG Size; - - ULONG OptimizedSave : 1; - - // List of features ( - XSTATE_FEATURE Features[MAXIMUM_XSTATE_FEATURES]; - -} XSTATE_CONFIGURATION, *PXSTATE_CONFIGURATION; - - -// -// Define data shared between kernel and user mode. -// -// N.B. User mode has read only access to this data -// - -#ifdef _MAC -#pragma warning( disable : 4121) -#endif - -#define MAX_WOW64_SHARED_ENTRIES 16 - -// -// WARNING: This structure must have exactly the same layout for 32- and -// 64-bit systems. The layout of this structure cannot change and new -// fields can only be added at the end of the structure (unless a gap -// can be exploited). Deprecated fields cannot be deleted. Platform -// specific fields are included on all systems. -// -// Layout exactness is required for Wow64 support of 32-bit applications -// on Win64 systems. -// -// The layout itself cannot change since this structure has been exported -// in ntddk, ntifs.h, and nthal.h for some time. -// -// Define NX support policy values. -// - -#define NX_SUPPORT_POLICY_ALWAYSOFF 0 -#define NX_SUPPORT_POLICY_ALWAYSON 1 -#define NX_SUPPORT_POLICY_OPTIN 2 -#define NX_SUPPORT_POLICY_OPTOUT 3 - -// -// Global shared data flags and manipulation macros. -// - -#define SHARED_GLOBAL_FLAGS_ERROR_PORT_V 0x0 -#define SHARED_GLOBAL_FLAGS_ERROR_PORT (1UL << SHARED_GLOBAL_FLAGS_ERROR_PORT_V) - -#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V 0x1 -#define SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED (1UL << SHARED_GLOBAL_FLAGS_ELEVATION_ENABLED_V) - -#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V 0x2 -#define SHARED_GLOBAL_FLAGS_VIRT_ENABLED (1UL << SHARED_GLOBAL_FLAGS_VIRT_ENABLED_V) - -#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V 0x3 -#define SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED \ - (1UL << SHARED_GLOBAL_FLAGS_INSTALLER_DETECT_ENABLED_V) - -#define SHARED_GLOBAL_FLAGS_SPARE_V 0x4 -#define SHARED_GLOBAL_FLAGS_SPARE \ - (1UL << SHARED_GLOBAL_FLAGS_SPARE_V) - -#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V 0x5 -#define SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED \ - (1UL << SHARED_GLOBAL_FLAGS_DYNAMIC_PROC_ENABLED_V) - -#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V 0x6 -#define SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED \ - (1UL << SHARED_GLOBAL_FLAGS_SEH_VALIDATION_ENABLED_V) - -#define EX_INIT_BITS(Flags, Bit) \ - *((Flags)) |= (Bit) // Safe to use before concurrently accessible - -#define EX_TEST_SET_BIT(Flags, Bit) \ - InterlockedBitTestAndSet ((PLONG)(Flags), (Bit)) - -#define EX_TEST_CLEAR_BIT(Flags, Bit) \ - InterlockedBitTestAndReset ((PLONG)(Flags), (Bit)) - -typedef struct _KUSER_SHARED_DATA { - - // - // Current low 32-bit of tick count and tick count multiplier. - // - // N.B. The tick count is updated each time the clock ticks. - // - - ULONG TickCountLowDeprecated; - ULONG TickCountMultiplier; - - // - // Current 64-bit interrupt time in 100ns units. - // - - volatile KSYSTEM_TIME InterruptTime; - - // - // Current 64-bit system time in 100ns units. - // - - volatile KSYSTEM_TIME SystemTime; - - // - // Current 64-bit time zone bias. - // - - volatile KSYSTEM_TIME TimeZoneBias; - - // - // Support image magic number range for the host system. - // - // N.B. This is an inclusive range. - // - - USHORT ImageNumberLow; - USHORT ImageNumberHigh; - - // - // Copy of system root in unicode. - // - - WCHAR NtSystemRoot[260]; - - // - // Maximum stack trace depth if tracing enabled. - // - - ULONG MaxStackTraceDepth; - - // - // Crypto exponent value. - // - - ULONG CryptoExponent; - - // - // Time zone ID. - // - - ULONG TimeZoneId; - ULONG LargePageMinimum; - ULONG Reserved2[7]; - - // - // Product type. - // - - NT_PRODUCT_TYPE NtProductType; - BOOLEAN ProductTypeIsValid; - - // - // three bytes of padding here -- offsets 0x269, 0x26A, 0x26B - // - - // - // The NT Version. - // - // N. B. Note that each process sees a version from its PEB, but if the - // process is running with an altered view of the system version, - // the following two fields are used to correctly identify the - // version - // - - ULONG NtMajorVersion; - ULONG NtMinorVersion; - - // - // Processor features. - // - - BOOLEAN ProcessorFeatures[PROCESSOR_FEATURE_MAX]; - - // - // Reserved fields - do not use. - // - - ULONG Reserved1; - ULONG Reserved3; - - // - // Time slippage while in debugger. - // - - volatile ULONG TimeSlip; - - // - // Alternative system architecture, e.g., NEC PC98xx on x86. - // - - ALTERNATIVE_ARCHITECTURE_TYPE AlternativeArchitecture; - - // - // four bytes of padding here -- offsets 0x2c4, 0x2c5, 0x2c6, 0x2c7 - // - - ULONG AltArchitecturePad[1]; - - // - // If the system is an evaluation unit, the following field contains the - // date and time that the evaluation unit expires. A value of 0 indicates - // that there is no expiration. A non-zero value is the UTC absolute time - // that the system expires. - // - - LARGE_INTEGER SystemExpirationDate; - - // - // Suite support. - // - - ULONG SuiteMask; - - // - // TRUE if a kernel debugger is connected/enabled. - // - - BOOLEAN KdDebuggerEnabled; - - // - // NX support policy. - // - - UCHAR NXSupportPolicy; - - // - // two bytes of padding here -- offsets 0x2d6, 0x2d7 - // - - // - // Current console session Id. Always zero on non-TS systems. - // - - volatile ULONG ActiveConsoleId; - - // - // Force-dismounts cause handles to become invalid. Rather than always - // probe handles, a serial number of dismounts is maintained that clients - // can use to see if they need to probe handles. - // - - volatile ULONG DismountCount; - - // - // This field indicates the status of the 64-bit COM+ package on the - // system. It indicates whether the Itermediate Language (IL) COM+ - // images need to use the 64-bit COM+ runtime or the 32-bit COM+ runtime. - // - - ULONG ComPlusPackage; - - // - // Time in tick count for system-wide last user input across all terminal - // sessions. For MP performance, it is not updated all the time (e.g. once - // a minute per session). It is used for idle detection. - // - - ULONG LastSystemRITEventTickCount; - - // - // Number of physical pages in the system. This can dynamically change as - // physical memory can be added or removed from a running system. - // - - ULONG NumberOfPhysicalPages; - - // - // True if the system was booted in safe boot mode. - // - - BOOLEAN SafeBootMode; - - // - // The following byte is consumed by the user-mode performance counter - // routines to improve latency when the source is the processor's cycle - // counter. - // - - union { - UCHAR TscQpcData; - struct { - UCHAR TscQpcEnabled : 1; - UCHAR TscQpcSpareFlag : 1; - UCHAR TscQpcShift : 6; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - - // - // two bytes of padding here -- offsets 0x2ee, 0x2ef - // - - UCHAR TscQpcPad[2]; - -#if 0 // pre-Vista - ULONG TraceLogging; -#endif - - // - // This is a packed bitfield that contains various flags concerning - // the system state. They must be manipulated using interlocked - // operations. - // - - union { - ULONG SharedDataFlags; - struct { - - // - // The following bit fields are for the debugger only. Do not use. - // Use the bit definitions instead. - // - - ULONG DbgErrorPortPresent : 1; - ULONG DbgElevationEnabled : 1; - ULONG DbgVirtEnabled : 1; - ULONG DbgInstallerDetectEnabled : 1; - ULONG DbgSystemDllRelocated : 1; - ULONG DbgDynProcessorEnabled : 1; - ULONG DbgSEHValidationEnabled : 1; - ULONG SpareBits : 25; - } DUMMYSTRUCTNAME2; - } DUMMYUNIONNAME2; - - ULONG DataFlagsPad[1]; - - // - // Depending on the processor, the code for fast system call will differ, - // Stub code is provided pointers below to access the appropriate code. - // - // N.B. The following two fields are only used on 32-bit systems. - // - - ULONGLONG TestRetInstruction; - ULONG SystemCall; - ULONG SystemCallReturn; - ULONGLONG SystemCallPad[3]; - - // - // The 64-bit tick count. - // - - union { - volatile KSYSTEM_TIME TickCount; - volatile ULONG64 TickCountQuad; - struct { - ULONG ReservedTickCountOverlay[3]; - ULONG TickCountPad[1]; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME3; - - // - // Cookie for encoding pointers system wide. - // - - ULONG Cookie; - ULONG CookiePad[1]; - - // - // Client id of the process having the focus in the current - // active console session id. - // - - LONGLONG ConsoleSessionForegroundProcessId; - - // - // Shared information for Wow64 processes. - // - - ULONG Wow64SharedInformation[MAX_WOW64_SHARED_ENTRIES]; - - // - // The following field is used for ETW user mode global logging - // (UMGL). - // - - USHORT UserModeGlobalLogger[16]; - - // - // Settings that can enable the use of Image File Execution Options - // from HKCU in addition to the original HKLM. - // - - ULONG ImageFileExecutionOptions; - -#if 0 - // - // pre-Vista Service Pack 1, four bytes of padding here -- offsets 0x3a4, 0x3a5, 0x3a6, 0x3a7 - // - -#else - // - // Generation of the kernel structure holding system language information - // - ULONG LangGenerationCount; -#endif - - // - // Reserved. - // - - ULONGLONG Reserved5; - - // - // Current 64-bit interrupt time bias in 100ns units. - // - - volatile ULONG64 InterruptTimeBias; - - // - // Current 64-bit performance counter bias in processor cycles. - // - - volatile ULONG64 TscQpcBias; - - // - // Number of active processors and groups. - // - - volatile ULONG ActiveProcessorCount; - volatile USHORT ActiveGroupCount; - USHORT Reserved4; - - // - // This value controls the AIT Sampling rate. - // - - volatile ULONG AitSamplingValue; - volatile ULONG AppCompatFlag; - - // - // Relocation diff for ntdll (native and wow64). - // - - ULONGLONG SystemDllNativeRelocation; - ULONG SystemDllWowRelocation; - - // - // Extended processor state configuration - // - - ULONG XStatePad[1]; - XSTATE_CONFIGURATION XState; - -} KUSER_SHARED_DATA, *PKUSER_SHARED_DATA; - -// -// Mostly enforce earlier comment about the stability and -// architecture-neutrality of this struct. -// - -#if !defined(__midl) && !defined(MIDL_PASS) - -// -// The overall size can change, but it must be the same for all architectures. -// - -C_ASSERT(sizeof(KUSER_SHARED_DATA) == 0x5F0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TickCountLowDeprecated) == 0x0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TickCountMultiplier) == 0x4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, InterruptTime) == 0x08); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemTime) == 0x014); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TimeZoneBias) == 0x020); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ImageNumberLow) == 0x02c); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ImageNumberHigh) == 0x02e); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NtSystemRoot) == 0x030); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, MaxStackTraceDepth) == 0x238); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, CryptoExponent) == 0x23c); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TimeZoneId) == 0x240); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, LargePageMinimum) == 0x244); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Reserved2) == 0x248); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NtProductType) == 0x264); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ProductTypeIsValid) == 0x268); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NtMajorVersion) == 0x26c); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NtMinorVersion) == 0x270); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ProcessorFeatures) == 0x274); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Reserved1) == 0x2b4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Reserved3) == 0x2b8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TimeSlip) == 0x2bc); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, AlternativeArchitecture) == 0x2c0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemExpirationDate) == 0x2c8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SuiteMask) == 0x2d0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, KdDebuggerEnabled) == 0x2d4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NXSupportPolicy) == 0x2d5); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ActiveConsoleId) == 0x2d8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, DismountCount) == 0x2dc); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ComPlusPackage) == 0x2e0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, LastSystemRITEventTickCount) == 0x2e4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, NumberOfPhysicalPages) == 0x2e8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SafeBootMode) == 0x2ec); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TscQpcData) == 0x2ed); - -C_ASSERT(__alignof(KSYSTEM_TIME) == 4); - -#if 0 // pre-Vista - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TraceLogging) == 0x2f0); - -#else - -#if defined(_MSC_EXTENSIONS) - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SharedDataFlags) == 0x2f0); - -#endif - -#endif - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TestRetInstruction) == 0x2f8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemCall) == 0x300); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemCallReturn) == 0x304); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemCallPad) == 0x308); - -#if defined(_MSC_EXTENSIONS) - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TickCount) == 0x320); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TickCountQuad) == 0x320); - -#endif - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Cookie) == 0x330); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ConsoleSessionForegroundProcessId) == 0x338); - -#if 0 // pre-Vista - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Wow64SharedInformation) == 0x334); - -#else - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Wow64SharedInformation) == 0x340); - -#endif - -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, UserModeGlobalLogger) == 0x380); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ImageFileExecutionOptions) == 0x3a0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, LangGenerationCount) == 0x3a4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, InterruptTimeBias) == 0x3b0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, UserModeGlobalLogger) == 0x380); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ImageFileExecutionOptions) == 0x3a0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, LangGenerationCount) == 0x3a4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Reserved5) == 0x3a8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, InterruptTimeBias) == 0x3b0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, TscQpcBias) == 0x3b8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ActiveProcessorCount) == 0x3c0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, ActiveGroupCount) == 0x3c4); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, Reserved4) == 0x3c6); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, AitSamplingValue) == 0x3c8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, AppCompatFlag) == 0x3cc); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemDllNativeRelocation) == 0x3d0); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, SystemDllWowRelocation) == 0x3d8); -C_ASSERT(FIELD_OFFSET(KUSER_SHARED_DATA, XState) == 0x3e0); - -#endif /* __midl | MIDL_PASS */ - -#ifdef _MAC -#pragma warning(default:4121) -#endif - -#define CmResourceTypeMaximum 8 -// -// Declaration of the structure for the PcCard ISA IRQ map -// - -typedef struct _CM_PCCARD_DEVICE_DATA { - UCHAR Flags; - UCHAR ErrorCode; - USHORT Reserved; - ULONG BusData; - ULONG DeviceId; - ULONG LegacyBaseAddress; - UCHAR IRQMap[16]; -} CM_PCCARD_DEVICE_DATA, *PCM_PCCARD_DEVICE_DATA; - -// Definitions for Flags - -#define PCCARD_MAP_ERROR 0x01 -#define PCCARD_DEVICE_PCI 0x10 - -#define PCCARD_SCAN_DISABLED 0x01 -#define PCCARD_MAP_ZERO 0x02 -#define PCCARD_NO_TIMER 0x03 -#define PCCARD_NO_PIC 0x04 -#define PCCARD_NO_LEGACY_BASE 0x05 -#define PCCARD_DUP_LEGACY_BASE 0x06 -#define PCCARD_NO_CONTROLLERS 0x07 - -#ifndef _ARC_DDK_ -#define _ARC_DDK_ - -// -// Define configuration routine types. -// -// Configuration information. -// - -typedef enum _CONFIGURATION_TYPE { - ArcSystem, - CentralProcessor, - FloatingPointProcessor, - PrimaryIcache, - PrimaryDcache, - SecondaryIcache, - SecondaryDcache, - SecondaryCache, - EisaAdapter, - TcAdapter, - ScsiAdapter, - DtiAdapter, - MultiFunctionAdapter, - DiskController, - TapeController, - CdromController, - WormController, - SerialController, - NetworkController, - DisplayController, - ParallelController, - PointerController, - KeyboardController, - AudioController, - OtherController, - DiskPeripheral, - FloppyDiskPeripheral, - TapePeripheral, - ModemPeripheral, - MonitorPeripheral, - PrinterPeripheral, - PointerPeripheral, - KeyboardPeripheral, - TerminalPeripheral, - OtherPeripheral, - LinePeripheral, - NetworkPeripheral, - SystemMemory, - DockingInformation, - RealModeIrqRoutingTable, - RealModePCIEnumeration, - MaximumType -} CONFIGURATION_TYPE, *PCONFIGURATION_TYPE; - -#endif // _ARC_DDK_ - -// -// Several routines have an architecture specific implementation. Generate -// an error if a supported target is not defined. -// - -#if !(defined(_X86_) || defined(_AMD64_) || defined(_IA64_)) - -#error "No target architecture defined" - -#endif - -#if (NTDDI_VERSION < NTDDI_WIN7) || defined(_X86_) || !defined(NT_PROCESSOR_GROUPS) - -#define SINGLE_GROUP_LEGACY_API 1 - -#endif - - -// - -#if defined(_X86_) || defined(_AMD64_) - -#define PAUSE_PROCESSOR YieldProcessor(); - -#elif defined(_IA64_) - -#define PAUSE_PROCESSOR __yield(); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeSetImportanceDpc ( - __inout PRKDPC Dpc, - __in KDPC_IMPORTANCE Importance - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -VOID -KeSetTargetProcessorDpc ( - __inout PRKDPC Dpc, - __in CCHAR Number - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KePulseEvent ( - __inout PRKEVENT Event, - __in KPRIORITY Increment, - __in BOOLEAN Wait - ); -#endif - - - -#define MAXIMUM_EXPANSION_SIZE (KERNEL_LARGE_STACK_SIZE - (PAGE_SIZE / 2)) - -typedef -__drv_sameIRQL -__drv_functionClass(EXPAND_STACK_CALLOUT) -VOID -(NTAPI EXPAND_STACK_CALLOUT) ( - __in_opt PVOID Parameter - ); - -typedef EXPAND_STACK_CALLOUT *PEXPAND_STACK_CALLOUT; - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_reportError("DISPATCH_LEVEL is only supported on Windows 7 or later.") -NTKERNELAPI -NTSTATUS -KeExpandKernelStackAndCallout ( - __in PEXPAND_STACK_CALLOUT Callout, - __in_opt PVOID Parameter, - __in SIZE_T Size - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeSetBasePriorityThread ( - __inout PKTHREAD Thread, - __in LONG Increment - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_neverHoldCriticalRegion -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeEnterCriticalRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeLeaveCriticalRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_neverHoldCriticalRegion -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeEnterGuardedRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeLeaveGuardedRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -KeAreApcsDisabled ( - VOID - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_preferredFunction("error logging or driver shutdown", - "Whenever possible, all kernel-mode components should log an error and " - "continue to run, rather than calling KeBugCheck") -NTKERNELAPI -DECLSPEC_NORETURN -VOID -NTAPI -KeBugCheck ( - __in ULONG BugCheckCode - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeInvalidateAllCaches ( - VOID - ); -#endif - -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeInvalidateRangeAllCaches ( - __in PVOID BaseAddress, - __in ULONG Length - ); - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -KAFFINITY -KeQueryActiveProcessors ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -ULONG -KeQueryActiveProcessorCount ( - __out_opt PKAFFINITY ActiveProcessors - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeQueryActiveProcessorCountEx ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_LONGHORN) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -ULONG -KeQueryMaximumProcessorCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeQueryMaximumProcessorCountEx ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryActiveGroupCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryMaximumGroupCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -KAFFINITY -KeQueryGroupAffinity ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeGetCurrentProcessorNumberEx ( - __out_opt PPROCESSOR_NUMBER ProcNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -KeQueryNodeActiveAffinity ( - __in USHORT NodeNumber, - __out_opt PGROUP_AFFINITY Affinity, - __out_opt PUSHORT Count - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryNodeMaximumProcessorCount ( - __in USHORT NodeNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryHighestNodeNumber ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeGetCurrentNodeNumber ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -KeQueryLogicalProcessorRelationship ( - __in_opt PPROCESSOR_NUMBER ProcessorNumber, - __in LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, - __out_bcount_opt(*Length) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information, - __inout PULONG Length - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -KeSetHardwareCounterConfiguration ( - __in_ecount(Count) PHARDWARE_COUNTER CounterArray, - __in ULONG Count - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -KeQueryHardwareCounterConfiguration ( - __out_ecount_part(MaximumCount, *Count) PHARDWARE_COUNTER CounterArray, - __in ULONG MaximumCount, - __out PULONG Count - ); -#endif - - -#if defined(POOL_TAGGING) -#define ExFreePool(a) ExFreePoolWithTag(a,0) -#endif - -// -// If high order bit in Pool tag is set, then must use ExFreePoolWithTag to free -// - -#define PROTECTED_POOL 0x80000000 - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -DECLSPEC_NORETURN -VOID -ExRaiseDatatypeMisalignment ( - VOID - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -DECLSPEC_NORETURN -VOID -ExRaiseAccessViolation ( - VOID - ); - -#endif - - -// -// Zone Allocation -// - -typedef struct _ZONE_SEGMENT_HEADER { - SINGLE_LIST_ENTRY SegmentList; - PVOID Reserved; -} ZONE_SEGMENT_HEADER, *PZONE_SEGMENT_HEADER; - -typedef struct _ZONE_HEADER { - SINGLE_LIST_ENTRY FreeList; - SINGLE_LIST_ENTRY SegmentList; - ULONG BlockSize; - ULONG TotalSegmentSize; -} ZONE_HEADER, *PZONE_HEADER; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_preferredFunction("lookaside lists instead", "Obsolete") -DECLSPEC_DEPRECATED_DDK -NTKERNELAPI -NTSTATUS -ExInitializeZone( - __out PZONE_HEADER Zone, - __in ULONG BlockSize, - __inout PVOID InitialSegment, - __in ULONG InitialSegmentSize - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_preferredFunction("lookaside lists instead", "Obsolete") -DECLSPEC_DEPRECATED_DDK -NTKERNELAPI -NTSTATUS -ExExtendZone( - __inout PZONE_HEADER Zone, - __inout PVOID Segment, - __in ULONG SegmentSize - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_preferredFunction("lookaside lists instead", "Obsolete") -DECLSPEC_DEPRECATED_DDK -NTKERNELAPI -NTSTATUS -ExInterlockedExtendZone( - __inout PZONE_HEADER Zone, - __inout PVOID Segment, - __in ULONG SegmentSize, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - -//++ -// -// PVOID -// ExAllocateFromZone( -// IN PZONE_HEADER Zone -// ) -// -// Routine Description: -// -// This routine removes an entry from the zone and returns a pointer to it. -// -// Arguments: -// -// Zone - Pointer to the zone header controlling the storage from which the -// entry is to be allocated. -// -// Return Value: -// -// The function value is a pointer to the storage allocated from the zone. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExAllocateFromZone) -#endif - -#define ExAllocateFromZone(Zone) \ - (PVOID)((Zone)->FreeList.Next); \ - if ( (Zone)->FreeList.Next ) (Zone)->FreeList.Next = (Zone)->FreeList.Next->Next - -//++ -// -// PVOID -// ExFreeToZone( -// IN PZONE_HEADER Zone, -// IN PVOID Block -// ) -// -// Routine Description: -// -// This routine places the specified block of storage back onto the free -// list in the specified zone. -// -// Arguments: -// -// Zone - Pointer to the zone header controlling the storage to which the -// entry is to be inserted. -// -// Block - Pointer to the block of storage to be freed back to the zone. -// -// Return Value: -// -// Pointer to previous block of storage that was at the head of the free -// list. NULL implies the zone went from no available free blocks to -// at least one free block. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExFreeToZone) -#endif - -#define ExFreeToZone(Zone,Block) \ - ( ((PSINGLE_LIST_ENTRY)(Block))->Next = (Zone)->FreeList.Next, \ - (Zone)->FreeList.Next = ((PSINGLE_LIST_ENTRY)(Block)), \ - ((PSINGLE_LIST_ENTRY)(Block))->Next \ - ) - -//++ -// -// BOOLEAN -// ExIsFullZone( -// IN PZONE_HEADER Zone -// ) -// -// Routine Description: -// -// This routine determines if the specified zone is full or not. A zone -// is considered full if the free list is empty. -// -// Arguments: -// -// Zone - Pointer to the zone header to be tested. -// -// Return Value: -// -// TRUE if the zone is full and FALSE otherwise. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExIsFullZone) -#endif - -#define ExIsFullZone(Zone) \ - ( (Zone)->FreeList.Next == (PSINGLE_LIST_ENTRY)NULL ) - -//++ -// -// PVOID -// ExInterlockedAllocateFromZone( -// IN PZONE_HEADER Zone, -// IN PKSPIN_LOCK Lock -// ) -// -// Routine Description: -// -// This routine removes an entry from the zone and returns a pointer to it. -// The removal is performed with the specified lock owned for the sequence -// to make it MP-safe. -// -// Arguments: -// -// Zone - Pointer to the zone header controlling the storage from which the -// entry is to be allocated. -// -// Lock - Pointer to the spin lock which should be obtained before removing -// the entry from the allocation list. The lock is released before -// returning to the caller. -// -// Return Value: -// -// The function value is a pointer to the storage allocated from the zone. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInterlockedAllocateFromZone) -#endif - -#define ExInterlockedAllocateFromZone(Zone,Lock) \ - (PVOID) ExInterlockedPopEntryList( &(Zone)->FreeList, Lock ) - -//++ -// -// PVOID -// ExInterlockedFreeToZone( -// IN PZONE_HEADER Zone, -// IN PVOID Block, -// IN PKSPIN_LOCK Lock -// ) -// -// Routine Description: -// -// This routine places the specified block of storage back onto the free -// list in the specified zone. The insertion is performed with the lock -// owned for the sequence to make it MP-safe. -// -// Arguments: -// -// Zone - Pointer to the zone header controlling the storage to which the -// entry is to be inserted. -// -// Block - Pointer to the block of storage to be freed back to the zone. -// -// Lock - Pointer to the spin lock which should be obtained before inserting -// the entry onto the free list. The lock is released before returning -// to the caller. -// -// Return Value: -// -// Pointer to previous block of storage that was at the head of the free -// list. NULL implies the zone went from no available free blocks to -// at least one free block. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInterlockedFreeToZone) -#endif - -#define ExInterlockedFreeToZone(Zone,Block,Lock) \ - ExInterlockedPushEntryList( &(Zone)->FreeList, ((PSINGLE_LIST_ENTRY) (Block)), Lock ) - - -//++ -// -// BOOLEAN -// ExIsObjectInFirstZoneSegment( -// IN PZONE_HEADER Zone, -// IN PVOID Object -// ) -// -// Routine Description: -// -// This routine determines if the specified pointer lives in the zone. -// -// Arguments: -// -// Zone - Pointer to the zone header controlling the storage to which the -// object may belong. -// -// Object - Pointer to the object in question. -// -// Return Value: -// -// TRUE if the Object came from the first segment of zone. -// -//-- - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExIsObjectInFirstZoneSegment) -#endif - -#define ExIsObjectInFirstZoneSegment(Zone,Object) ((BOOLEAN) \ - (((PUCHAR)(Object) >= (PUCHAR)(Zone)->SegmentList.Next) && \ - ((PUCHAR)(Object) < (PUCHAR)(Zone)->SegmentList.Next + \ - (Zone)->TotalSegmentSize)) \ -) - - -// -// ntddk.h stole the entrypoints we wanted so fix them up here. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInitializeResource) // use ExInitializeResourceLite -#pragma deprecated(ExAcquireResourceShared) // use ExAcquireResourceSharedLite -#pragma deprecated(ExAcquireResourceExclusive) // use ExAcquireResourceExclusiveLite -#pragma deprecated(ExReleaseResourceForThread) // use ExReleaseResourceForThreadLite -#pragma deprecated(ExConvertExclusiveToShared) // use ExConvertExclusiveToSharedLite -#pragma deprecated(ExDeleteResource) // use ExDeleteResourceLite -#pragma deprecated(ExIsResourceAcquiredExclusive) // use ExIsResourceAcquiredExclusiveLite -#pragma deprecated(ExIsResourceAcquiredShared) // use ExIsResourceAcquiredSharedLite -#pragma deprecated(ExIsResourceAcquired) // use ExIsResourceAcquiredSharedLite -#endif -#define ExInitializeResource ExInitializeResourceLite -#define ExAcquireResourceShared ExAcquireResourceSharedLite -#define ExAcquireResourceExclusive ExAcquireResourceExclusiveLite -#define ExReleaseResourceForThread ExReleaseResourceForThreadLite -#define ExConvertExclusiveToShared ExConvertExclusiveToSharedLite -#define ExDeleteResource ExDeleteResourceLite -#define ExIsResourceAcquiredExclusive ExIsResourceAcquiredExclusiveLite -#define ExIsResourceAcquiredShared ExIsResourceAcquiredSharedLite -#define ExIsResourceAcquired ExIsResourceAcquiredSharedLite - - -// -// UUID Generation -// - -typedef GUID UUID; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -ExUuidCreate( - __out UUID *Uuid - ); - -#endif - -// -// Priority increment definitions. The comment for each definition gives -// the names of the system services that use the definition when satisfying -// a wait. -// - -// -// Priority increment used when satisfying a wait on an executive event -// (NtPulseEvent and NtSetEvent) -// - -#define EVENT_INCREMENT 1 - -// -// Priority increment when no I/O has been done. This is used by device -// and file system drivers when completing an IRP (IoCompleteRequest). -// - -#define IO_NO_INCREMENT 0 - - -// -// Priority increment for completing CD-ROM I/O. This is used by CD-ROM device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_CD_ROM_INCREMENT 1 - -// -// Priority increment for completing disk I/O. This is used by disk device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_DISK_INCREMENT 1 - - - -// -// Priority increment for completing keyboard I/O. This is used by keyboard -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_KEYBOARD_INCREMENT 6 - - -// -// Priority increment for completing mailslot I/O. This is used by the mail- -// slot file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_MAILSLOT_INCREMENT 2 - - -// -// Priority increment for completing mouse I/O. This is used by mouse device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_MOUSE_INCREMENT 6 - - -// -// Priority increment for completing named pipe I/O. This is used by the -// named pipe file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_NAMED_PIPE_INCREMENT 2 - -// -// Priority increment for completing network I/O. This is used by network -// device and network file system drivers when completing an IRP -// (IoCompleteRequest). -// - -#define IO_NETWORK_INCREMENT 2 - - -// -// Priority increment for completing parallel I/O. This is used by parallel -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_PARALLEL_INCREMENT 1 - -// -// Priority increment for completing serial I/O. This is used by serial device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SERIAL_INCREMENT 2 - -// -// Priority increment for completing sound I/O. This is used by sound device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SOUND_INCREMENT 8 - -// -// Priority increment for completing video I/O. This is used by video device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_VIDEO_INCREMENT 1 - -// -// Priority increment used when satisfying a wait on an executive semaphore -// (NtReleaseSemaphore) -// - -#define SEMAPHORE_INCREMENT 1 - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -MmIsThisAnNtAsSystem ( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmMapUserAddressesToPage ( - __in_bcount(NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes, - __in PVOID PageAddress - ); -#endif - - -typedef struct _PHYSICAL_MEMORY_RANGE { - PHYSICAL_ADDRESS BaseAddress; - LARGE_INTEGER NumberOfBytes; -} PHYSICAL_MEMORY_RANGE, *PPHYSICAL_MEMORY_RANGE; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -MmAddPhysicalMemory ( - __in PPHYSICAL_ADDRESS StartAddress, - __inout PLARGE_INTEGER NumberOfBytes - ); -#endif - -typedef NTSTATUS (*PMM_ROTATE_COPY_CALLBACK_FUNCTION) ( - __in PMDL DestinationMdl, - __in PMDL SourceMdl, - __in PVOID Context - ); - -typedef enum _MM_ROTATE_DIRECTION { - MmToFrameBuffer, - MmToFrameBufferNoCopy, - MmToRegularMemory, - MmToRegularMemoryNoCopy, - MmMaximumRotateDirection -} MM_ROTATE_DIRECTION, *PMM_ROTATE_DIRECTION; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSTATUS -MmRotatePhysicalView ( - __in PVOID VirtualAddress, - __inout PSIZE_T NumberOfBytes, - __in_opt PMDLX NewMdl, - __in MM_ROTATE_DIRECTION Direction, - __in PMM_ROTATE_COPY_CALLBACK_FUNCTION CopyFunction, - __in_opt PVOID Context - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -MmRemovePhysicalMemory ( - __in PPHYSICAL_ADDRESS StartAddress, - __inout PLARGE_INTEGER NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (PASSIVE_LEVEL) -NTKERNELAPI -PPHYSICAL_MEMORY_RANGE -MmGetPhysicalMemoryRanges ( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmMapVideoDisplay ( - __in PHYSICAL_ADDRESS PhysicalAddress, - __in SIZE_T NumberOfBytes, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -VOID -MmUnmapVideoDisplay ( - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PHYSICAL_ADDRESS -MmGetPhysicalAddress ( - __in PVOID BaseAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PVOID -MmGetVirtualForPhysical ( - __in PHYSICAL_ADDRESS PhysicalAddress - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__bcount (NumberOfBytes) PVOID -MmAllocateContiguousMemory ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS HighestAcceptableAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateContiguousMemorySpecifyCache ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS LowestAcceptableAddress, - __in PHYSICAL_ADDRESS HighestAcceptableAddress, - __in_opt PHYSICAL_ADDRESS BoundaryAddressMultiple, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - - - -typedef ULONG NODE_REQUIREMENT; - -#define MM_ANY_NODE_OK 0x80000000 - - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateContiguousMemorySpecifyCacheNode ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS LowestAcceptableAddress, - __in PHYSICAL_ADDRESS HighestAcceptableAddress, - __in_opt PHYSICAL_ADDRESS BoundaryAddressMultiple, - __in MEMORY_CACHING_TYPE CacheType, - __in NODE_REQUIREMENT PreferredNode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmFreeContiguousMemory ( - __in PVOID BaseAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmFreeContiguousMemorySpecifyCache ( - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateNonCachedMemory ( - __in SIZE_T NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -MmFreeNonCachedMemory ( - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -MmIsAddressValid ( - __in PVOID VirtualAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_preferredFunction("(see documentation)", "Obsolete") -DECLSPEC_DEPRECATED_DDK -NTKERNELAPI -BOOLEAN -MmIsNonPagedSystemAddressValid ( - __in PVOID VirtualAddress - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -MmLockPagableSectionByHandle ( - __in PVOID ImageSectionHandle - ); -#endif - - -// -// Note that even though this function prototype -// says "HANDLE", MmSecureVirtualMemory does NOT return -// anything resembling a Win32-style handle. The return -// value from this function can ONLY be used with MmUnsecureVirtualMemory. -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -__drv_reportError("Caution: MmSecureVirtualMemory ensures the specified VA " - "range protections cannot be tightened - but accesses to the memory can " - "still fail and so they must be protected by try-except.") -NTKERNELAPI -HANDLE -MmSecureVirtualMemory ( - __in_data_source(USER_MODE) __out_validated(MEMORY) __in_bcount (Size) PVOID Address, - __in __in_data_source(USER_MODE) SIZE_T Size, - __in ULONG ProbeMode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -MmUnsecureVirtualMemory ( - __in HANDLE SecureHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmMapViewInSystemSpace ( - __in PVOID Section, - __deref_out_bcount (*ViewSize) PVOID *MappedBase, - __inout PSIZE_T ViewSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmUnmapViewInSystemSpace ( - __in PVOID MappedBase - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmMapViewInSessionSpace ( - __in PVOID Section, - __deref_out_bcount (*ViewSize) PVOID *MappedBase, - __inout PSIZE_T ViewSize - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmUnmapViewInSessionSpace ( - __in PVOID MappedBase - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WS03) -__checkReturn -__drv_maxIRQL (PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -MmCreateMirror ( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -SeSinglePrivilegeCheck( - __in LUID PrivilegeValue, - __in KPROCESSOR_MODE PreviousMode - ); -#endif - - -extern NTKERNELAPI PEPROCESS PsInitialSystemProcess; - - -#if !defined(_PSGETCURRENTTHREAD_) - -#define _PSGETCURRENTTHREAD_ - -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -PETHREAD -PsGetCurrentThread ( - VOID - ) - -/*++ - -Routine Description: - - This function returns a pointer to the current executive thread object. - -Arguments: - - None. - -Return Value: - - A pointer to the current executive thread object. - ---*/ - -{ - - return (PETHREAD)KeGetCurrentThread(); -} - -#endif - - -typedef -VOID -(*PCREATE_PROCESS_NOTIFY_ROUTINE)( - __in HANDLE ParentId, - __in HANDLE ProcessId, - __in BOOLEAN Create - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsSetCreateProcessNotifyRoutine( - __in PCREATE_PROCESS_NOTIFY_ROUTINE NotifyRoutine, - __in BOOLEAN Remove - ); -#endif - -typedef struct _PS_CREATE_NOTIFY_INFO { - __in SIZE_T Size; - union { - __in ULONG Flags; - struct { - __in ULONG FileOpenNameAvailable : 1; - __in ULONG Reserved : 31; - }; - }; - __in HANDLE ParentProcessId; - __in CLIENT_ID CreatingThreadId; - __inout struct _FILE_OBJECT *FileObject; - __in PCUNICODE_STRING ImageFileName; - __in_opt PCUNICODE_STRING CommandLine; - __inout NTSTATUS CreationStatus; -} PS_CREATE_NOTIFY_INFO, *PPS_CREATE_NOTIFY_INFO; - -typedef -VOID -(*PCREATE_PROCESS_NOTIFY_ROUTINE_EX) ( - __inout PEPROCESS Process, - __in HANDLE ProcessId, - __in_opt PPS_CREATE_NOTIFY_INFO CreateInfo - ); - -#if (NTDDI_VERSION >= NTDDI_VISTASP1) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsSetCreateProcessNotifyRoutineEx ( - __in PCREATE_PROCESS_NOTIFY_ROUTINE_EX NotifyRoutine, - __in BOOLEAN Remove - ); -#endif - -typedef -VOID -(*PCREATE_THREAD_NOTIFY_ROUTINE)( - __in HANDLE ProcessId, - __in HANDLE ThreadId, - __in BOOLEAN Create - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsSetCreateThreadNotifyRoutine( - __in PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -PsRemoveCreateThreadNotifyRoutine ( - __in PCREATE_THREAD_NOTIFY_ROUTINE NotifyRoutine - ); -#endif - -// -// Structures for Load Image Notify -// - -#define IMAGE_ADDRESSING_MODE_32BIT 3 - -typedef struct _IMAGE_INFO { - union { - ULONG Properties; - struct { - ULONG ImageAddressingMode : 8; // Code addressing mode - ULONG SystemModeImage : 1; // System mode image - ULONG ImageMappedToAllPids : 1; // Image mapped into all processes - ULONG ExtendedInfoPresent : 1; // IMAGE_INFO_EX available - ULONG Reserved : 21; - }; - }; - PVOID ImageBase; - ULONG ImageSelector; - SIZE_T ImageSize; - ULONG ImageSectionNumber; -} IMAGE_INFO, *PIMAGE_INFO; - -typedef struct _IMAGE_INFO_EX { - SIZE_T Size; - IMAGE_INFO ImageInfo; - struct _FILE_OBJECT *FileObject; -} IMAGE_INFO_EX, *PIMAGE_INFO_EX; - -typedef -VOID -(*PLOAD_IMAGE_NOTIFY_ROUTINE)( - __in PUNICODE_STRING FullImageName, - __in HANDLE ProcessId, // pid into which image is being mapped - __in PIMAGE_INFO ImageInfo - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsSetLoadImageNotifyRoutine( - __in PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsRemoveLoadImageNotifyRoutine( - __in PLOAD_IMAGE_NOTIFY_ROUTINE NotifyRoutine - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -HANDLE -PsGetCurrentProcessId( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -HANDLE -PsGetCurrentThreadId( - VOID - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("RtlGetVersion", "Obsolete") -NTKERNELAPI -BOOLEAN -PsGetVersion( - __out_opt PULONG MajorVersion, - __out_opt PULONG MinorVersion, - __out_opt PULONG BuildNumber, - __out_opt PUNICODE_STRING CSDVersion - ); -#endif - -// -// Prefetch information. -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -PsSetCurrentThreadPrefetching ( - __in BOOLEAN Prefetching - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -PsIsCurrentThreadPrefetching ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONGLONG -PsGetProcessCreateTimeQuadPart( - __in PEPROCESS Process - ); -#endif -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -HANDLE -PsGetProcessId( - __in PEPROCESS Process - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -HANDLE -PsGetThreadId( - __in PETHREAD Thread - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -HANDLE -PsGetThreadProcessId( - __in PETHREAD Thread - ); -#endif - -// -// Directory control minor function codes -// - -#define IRP_MN_QUERY_DIRECTORY 0x01 -#define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02 - -// -// File system control minor function codes. Note that "user request" is -// assumed to be zero by both the I/O system and file systems. Do not change -// this value. -// - -#define IRP_MN_USER_FS_REQUEST 0x00 -#define IRP_MN_MOUNT_VOLUME 0x01 -#define IRP_MN_VERIFY_VOLUME 0x02 -#define IRP_MN_LOAD_FILE_SYSTEM 0x03 -#define IRP_MN_TRACK_LINK 0x04 // To be obsoleted soon -#define IRP_MN_KERNEL_CALL 0x04 - -// -// Lock control minor function codes -// - -#define IRP_MN_LOCK 0x01 -#define IRP_MN_UNLOCK_SINGLE 0x02 -#define IRP_MN_UNLOCK_ALL 0x03 -#define IRP_MN_UNLOCK_ALL_BY_KEY 0x04 - -// -// Flush minor function codes -// - -#define IRP_MN_FLUSH_AND_PURGE 0x01 - -// -// Read and Write minor function codes for file systems supporting Lan Manager -// software. All of these subfunction codes are invalid if the file has been -// opened with FO_NO_INTERMEDIATE_BUFFERING. They are also invalid in combi- -// nation with synchronous calls (Irp Flag or file open option). -// -// Note that "normal" is assumed to be zero by both the I/O system and file -// systems. Do not change this value. -// - -#define IRP_MN_NORMAL 0x00 -#define IRP_MN_DPC 0x01 -#define IRP_MN_MDL 0x02 -#define IRP_MN_COMPLETE 0x04 -#define IRP_MN_COMPRESSED 0x08 - -#define IRP_MN_MDL_DPC (IRP_MN_MDL | IRP_MN_DPC) -#define IRP_MN_COMPLETE_MDL (IRP_MN_COMPLETE | IRP_MN_MDL) -#define IRP_MN_COMPLETE_MDL_DPC (IRP_MN_COMPLETE_MDL | IRP_MN_DPC) - -#define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18 - -#define IO_CHECK_CREATE_PARAMETERS 0x0200 -#define IO_ATTACH_DEVICE 0x0400 - -// -// This flag is only meaningful to IoCreateFileSpecifyDeviceObjectHint. -// FileHandles created using IoCreateFileSpecifyDeviceObjectHint with this -// flag set will bypass ShareAccess checks on this file. -// - -#define IO_IGNORE_SHARE_ACCESS_CHECK 0x0800 // Ignores share access checks on opens. - -// -// Define callout routine type for use in IoQueryDeviceDescription(). -// - -typedef NTSTATUS (*PIO_QUERY_DEVICE_ROUTINE)( - __in PVOID Context, - __in PUNICODE_STRING PathName, - __in INTERFACE_TYPE BusType, - __in ULONG BusNumber, - __in PKEY_VALUE_FULL_INFORMATION *BusInformation, - __in CONFIGURATION_TYPE ControllerType, - __in ULONG ControllerNumber, - __in PKEY_VALUE_FULL_INFORMATION *ControllerInformation, - __in CONFIGURATION_TYPE PeripheralType, - __in ULONG PeripheralNumber, - __in PKEY_VALUE_FULL_INFORMATION *PeripheralInformation - ); - - -// Defines the order of the information in the array of -// PKEY_VALUE_FULL_INFORMATION. -// - -typedef enum _IO_QUERY_DEVICE_DATA_FORMAT { - IoQueryDeviceIdentifier = 0, - IoQueryDeviceConfigurationData, - IoQueryDeviceComponentInformation, - IoQueryDeviceMaxData -} IO_QUERY_DEVICE_DATA_FORMAT, *PIO_QUERY_DEVICE_DATA_FORMAT; - -// -// Define driver reinitialization routine type. -// - -typedef -VOID -DRIVER_REINITIALIZE ( - __in struct _DRIVER_OBJECT *DriverObject, - __in_opt PVOID Context, - __in ULONG Count - ); - -typedef DRIVER_REINITIALIZE *PDRIVER_REINITIALIZE; - - -typedef struct _CONTROLLER_OBJECT { - CSHORT Type; - CSHORT Size; - PVOID ControllerExtension; - KDEVICE_QUEUE DeviceWaitQueue; - - ULONG Spare1; - LARGE_INTEGER Spare2; - -} CONTROLLER_OBJECT, *PCONTROLLER_OBJECT; - -#define DO_VERIFY_VOLUME 0x00000002 -#define DO_BUFFERED_IO 0x00000004 -#define DO_EXCLUSIVE 0x00000008 -#define DO_DIRECT_IO 0x00000010 -#define DO_MAP_IO_BUFFER 0x00000020 -#define DO_DEVICE_HAS_NAME 0x00000040 -#define DO_DEVICE_INITIALIZING 0x00000080 -#define DO_SYSTEM_BOOT_PARTITION 0x00000100 -#define DO_LONG_TERM_REQUESTS 0x00000200 -#define DO_NEVER_LAST_DEVICE 0x00000400 -#define DO_SHUTDOWN_REGISTERED 0x00000800 -#define DO_BUS_ENUMERATED_DEVICE 0x00001000 -#define DO_POWER_PAGABLE 0x00002000 -#define DO_POWER_INRUSH 0x00004000 -#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 -#define DO_SUPPORTS_TRANSACTIONS 0x00040000 -#define DO_FORCE_NEITHER_IO 0x00080000 -#define DO_VOLUME_DEVICE_OBJECT 0x00100000 -#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000 -#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000 -#define DO_DISALLOW_EXECUTE 0x00800000 -#define DRVO_REINIT_REGISTERED 0x00000008 -#define DRVO_INITIALIZED 0x00000010 -#define DRVO_BOOTREINIT_REGISTERED 0x00000020 -#define DRVO_LEGACY_RESOURCES 0x00000040 - -// -// The following structure is used by drivers that are initializing to -// determine the number of devices of a particular type that have already -// been initialized. It is also used to track whether or not the AtDisk -// address range has already been claimed. Finally, it is used by the -// NtQuerySystemInformation system service to return device type counts. -// - -typedef struct _CONFIGURATION_INFORMATION { - - // - // This field indicates the total number of disks in the system. This - // number should be used by the driver to determine the name of new - // disks. This field should be updated by the driver as it finds new - // disks. - // - - ULONG DiskCount; // Count of hard disks thus far - ULONG FloppyCount; // Count of floppy disks thus far - ULONG CdRomCount; // Count of CD-ROM drives thus far - ULONG TapeCount; // Count of tape drives thus far - ULONG ScsiPortCount; // Count of SCSI port adapters thus far - ULONG SerialCount; // Count of serial devices thus far - ULONG ParallelCount; // Count of parallel devices thus far - - // - // These next two fields indicate ownership of one of the two IO address - // spaces that are used by WD1003-compatable disk controllers. - // - - BOOLEAN AtDiskPrimaryAddressClaimed; // 0x1F0 - 0x1FF - BOOLEAN AtDiskSecondaryAddressClaimed; // 0x170 - 0x17F - - // - // Indicates the structure version, as anything value belong this will have been added. - // Use the structure size as the version. - // - - ULONG Version; - - // - // Indicates the total number of medium changer devices in the system. - // This field will be updated by the drivers as it determines that - // new devices have been found and will be supported. - // - - ULONG MediumChangerCount; - -} CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION; - -#if !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use AllocateAdapterChannel -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -__drv_preferredFunction("AllocateAdapterChannel","obsolete") -NTKERNELAPI -NTSTATUS -IoAllocateAdapterChannel( - __in PADAPTER_OBJECT AdapterObject, - __in PDEVICE_OBJECT DeviceObject, - __in ULONG NumberOfMapRegisters, - __in PDRIVER_CONTROL ExecutionRoutine, - __in PVOID Context - ); -#endif - -#endif // !(defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoAllocateController( - __in PCONTROLLER_OBJECT ControllerObject, - __in PDEVICE_OBJECT DeviceObject, - __in PDRIVER_CONTROL ExecutionRoutine, - __in_opt PVOID Context - ); -#endif - -//++ -// -// VOID -// IoAssignArcName( -// __in PUNICODE_STRING ArcName, -// __in PUNICODE_STRING DeviceName -// ) -// -// Routine Description: -// -// This routine is invoked by drivers of bootable media to create a symbolic -// link between the ARC name of their device and its NT name. This allows -// the system to determine which device in the system was actually booted -// from since the ARC firmware only deals in ARC names, and NT only deals -// in NT names. -// -// Arguments: -// -// ArcName - Supplies the Unicode string representing the ARC name. -// -// DeviceName - Supplies the name to which the ARCname refers. -// -// Return Value: -// -// None. -// -//-- - -#define IoAssignArcName( ArcName, DeviceName ) ( \ - IoCreateSymbolicLink( (ArcName), (DeviceName) ) ) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use Pnp or IoReprtDetectedDevice -__drv_preferredFunction("(see documentation)", "Obsolete") -NTKERNELAPI -NTSTATUS -IoAssignResources ( - __in PUNICODE_STRING RegistryPath, - __in_opt PUNICODE_STRING DriverClassName, - __in PDRIVER_OBJECT DriverObject, - __in_opt PDEVICE_OBJECT DeviceObject, - __in_opt PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources, - __inout PCM_RESOURCE_LIST *AllocatedResources - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IoAttachDeviceToDeviceStack -__drv_preferredFunction("IoAttachDeviceToDeviceStack", "Obsolete") -NTKERNELAPI -NTSTATUS -IoAttachDeviceByPointer( - __in PDEVICE_OBJECT SourceDevice, - __in PDEVICE_OBJECT TargetDevice - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PCONTROLLER_OBJECT -IoCreateController( - __in ULONG Size - ); -#endif - - -//++ -// -// VOID -// IoDeassignArcName( -// __in PUNICODE_STRING ArcName -// ) -// -// Routine Description: -// -// This routine is invoked by drivers to deassign an ARC name that they -// created to a device. This is generally only called if the driver is -// deleting the device object, which means that the driver is probably -// unloading. -// -// Arguments: -// -// ArcName - Supplies the ARC name to be removed. -// -// Return Value: -// -// None. -// -//-- - -#define IoDeassignArcName( ArcName ) ( \ - IoDeleteSymbolicLink( (ArcName) ) ) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoDeleteController( - __in PCONTROLLER_OBJECT ControllerObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoFreeController( - __in PCONTROLLER_OBJECT ControllerObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PCONFIGURATION_INFORMATION -__drv_maxIRQL(PASSIVE_LEVEL) -IoGetConfigurationInformation( VOID ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PDEVICE_OBJECT -IoGetDeviceToVerify( - __in PETHREAD Thread - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PGENERIC_MAPPING -IoGetFileObjectGenericMapping( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoCancelFileOpen( - __in PDEVICE_OBJECT DeviceObject, - __in PFILE_OBJECT FileObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PIRP -IoMakeAssociatedIrp( - __in PIRP Irp, - __in CCHAR StackSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IoGetDeviceProperty -__drv_preferredFunction("IoGetDeviceProperty", "Obsolete") -NTKERNELAPI -NTSTATUS -IoQueryDeviceDescription( - __in_opt PINTERFACE_TYPE BusType, - __in_opt PULONG BusNumber, - __in_opt PCONFIGURATION_TYPE ControllerType, - __in_opt PULONG ControllerNumber, - __in_opt PCONFIGURATION_TYPE PeripheralType, - __in_opt PULONG PeripheralNumber, - __in PIO_QUERY_DEVICE_ROUTINE CalloutRoutine, - __inout_opt PVOID Context - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -IoRaiseHardError( - __in PIRP Irp, - __in_opt PVPB Vpb, - __in PDEVICE_OBJECT RealDeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -IoRaiseInformationalHardError( - __in NTSTATUS ErrorStatus, - __in_opt PUNICODE_STRING String, - __in_opt PKTHREAD Thread - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -IoSetThreadHardErrorMode( - __in BOOLEAN EnableHardErrors - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoRegisterBootDriverReinitialization( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_REINITIALIZE DriverReinitializationRoutine, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoRegisterDriverReinitialization( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_REINITIALIZE DriverReinitializationRoutine, - __in_opt PVOID Context - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IoReportResourceForDetection -__drv_preferredFunction("IoReportResourceForDetection if needed", "Obsolete") -NTKERNELAPI -NTSTATUS -IoReportResourceUsage( - __in_opt PUNICODE_STRING DriverClassName, - __in PDRIVER_OBJECT DriverObject, - __in_opt PCM_RESOURCE_LIST DriverList, - __in_opt ULONG DriverListSize, - __in PDEVICE_OBJECT DeviceObject, - __in_opt PCM_RESOURCE_LIST DeviceList, - __in_opt ULONG DeviceListSize, - __in BOOLEAN OverrideConflict, - __out PBOOLEAN ConflictDetected - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -BOOLEAN -IoTranslateBusAddress( - __in INTERFACE_TYPE InterfaceType, - __in ULONG BusNumber, - __in PHYSICAL_ADDRESS BusAddress, - __inout PULONG AddressSpace, - __out PPHYSICAL_ADDRESS TranslatedAddress - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoSetHardErrorOrVerifyDevice( - __in PIRP Irp, - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FASTCALL -HalExamineMBR( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG MBRTypeIdentifier, - __out PVOID *Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DECLSPEC_DEPRECATED_DDK // Use IoReadPartitionTableEx -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("IoReadPartitionTableEx", "Obsolete") -NTKERNELAPI -NTSTATUS -FASTCALL -IoReadPartitionTable( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in BOOLEAN ReturnRecognizedPartitions, - __out struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DECLSPEC_DEPRECATED_DDK // Use IoSetPartitionInformationEx -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("IoSetPartitionInformationEx", "Obsolete") -NTKERNELAPI -NTSTATUS -FASTCALL -IoSetPartitionInformation( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG PartitionNumber, - __in ULONG PartitionType - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DECLSPEC_DEPRECATED_DDK // Use IoWritePartitionTableEx -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("IoWritePartitionTableEx", "Obsolete") -NTKERNELAPI -NTSTATUS -FASTCALL -IoWritePartitionTable( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG SectorsPerTrack, - __in ULONG NumberOfHeads, - __in struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoCreateDisk( - __in PDEVICE_OBJECT DeviceObject, - __in_opt struct _CREATE_DISK* Disk - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoReadPartitionTableEx( - __in PDEVICE_OBJECT DeviceObject, - __out struct _DRIVE_LAYOUT_INFORMATION_EX** DriveLayout - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoWritePartitionTableEx( - __in PDEVICE_OBJECT DeviceObject, - __in_xcount(FIELD_OFFSET(DRIVE_LAYOUT_INFORMATION_EX, PartitionEntry[0])) struct _DRIVE_LAYOUT_INFORMATION_EX* DriveLayout - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoSetPartitionInformationEx( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG PartitionNumber, - __in struct _SET_PARTITION_INFORMATION_EX* PartitionInfo - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -IoUpdateDiskGeometry( - __in PDEVICE_OBJECT DeviceObject, - __in struct _DISK_GEOMETRY_EX* OldDiskGeometry, - __in struct _DISK_GEOMETRY_EX* NewDiskGeometry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoVerifyPartitionTable( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN FixErrors - ); -#endif - -typedef struct _DISK_SIGNATURE { - ULONG PartitionStyle; - union { - struct { - ULONG Signature; - ULONG CheckSum; - } Mbr; - - struct { - GUID DiskId; - } Gpt; - }; -} DISK_SIGNATURE, *PDISK_SIGNATURE; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoReadDiskSignature( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG BytesPerSector, - __out PDISK_SIGNATURE Signature - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoVolumeDeviceToDosName( - __in PVOID VolumeDeviceObject, - __out PUNICODE_STRING DosName - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoSetSystemPartition( - __in PUNICODE_STRING VolumeNameString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoCreateFileSpecifyDeviceObjectHint( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG Disposition, - __in ULONG CreateOptions, - __in_opt PVOID EaBuffer, - __in ULONG EaLength, - __in CREATE_FILE_TYPE CreateFileType, - __in_opt PVOID InternalParameters, - __in ULONG Options, - __in_opt PVOID DeviceObject - ); -#endif - -typedef struct _TXN_PARAMETER_BLOCK { - - USHORT Length; // sizeof( TXN_PARAMETER_BLOCK ) - USHORT TxFsContext; // this is mini version of the requested file - PVOID TransactionObject; // referenced pointer to KTRANSACTION - -} TXN_PARAMETER_BLOCK, *PTXN_PARAMETER_BLOCK; - -// -// This value should be used in the TxFsContext member of the -// TXN_PARAMETER_BLOCK in the absence of a specific miniversion. -// - -#define TXF_MINIVERSION_DEFAULT_VIEW (0xFFFE) - -#if (NTDDI_VERSION >= NTDDI_VISTA) -PTXN_PARAMETER_BLOCK -IoGetTransactionParameterBlock ( - __in PFILE_OBJECT FileObject - ); -#endif - -typedef struct _IO_DRIVER_CREATE_CONTEXT { - CSHORT Size; - struct _ECP_LIST *ExtraCreateParameter; - PVOID DeviceObjectHint; - PTXN_PARAMETER_BLOCK TxnParameters; -} IO_DRIVER_CREATE_CONTEXT, *PIO_DRIVER_CREATE_CONTEXT; - -VOID -FORCEINLINE -IoInitializeDriverCreateContext( - PIO_DRIVER_CREATE_CONTEXT DriverContext - ) -{ - // Initialize the context - RtlZeroMemory(DriverContext, sizeof(IO_DRIVER_CREATE_CONTEXT)); - DriverContext->Size = sizeof(IO_DRIVER_CREATE_CONTEXT); -} - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -IoCreateFileEx( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG Disposition, - __in ULONG CreateOptions, - __in_opt PVOID EaBuffer, - __in ULONG EaLength, - __in CREATE_FILE_TYPE CreateFileType, - __in_opt PVOID InternalParameters, - __in ULONG Options, - __in_opt PIO_DRIVER_CREATE_CONTEXT DriverContext - ); - -NTSTATUS -IoSetIrpExtraCreateParameter( - __inout PIRP Irp, - __in struct _ECP_LIST *ExtraCreateParameter - ); - -VOID -IoClearIrpExtraCreateParameter( - __inout PIRP Irp - ); - -NTSTATUS -IoGetIrpExtraCreateParameter( - __in PIRP Irp, - __deref_out_opt struct _ECP_LIST **ExtraCreateParameter - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoAttachDeviceToDeviceStackSafe( - __in PDEVICE_OBJECT SourceDevice, - __in PDEVICE_OBJECT TargetDevice, - __deref_out PDEVICE_OBJECT *AttachedToDeviceObject - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2KSP3) -NTKERNELAPI -BOOLEAN -IoIsFileOriginRemote( - __in PFILE_OBJECT FileObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2KSP3) -NTKERNELAPI -NTSTATUS -IoSetFileOrigin( - __in PFILE_OBJECT FileObject, - __in BOOLEAN Remote - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -BOOLEAN -IoIsFileObjectIgnoringSharing ( - __in PFILE_OBJECT FileObject -); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSTATUS -IoSetFileObjectIgnoreSharing ( - __in PFILE_OBJECT FileObject -); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -IO_PAGING_PRIORITY -FASTCALL -IoGetPagingIoPriority( - __in PIRP Irp - ); -#endif - - -typedef struct _AGP_TARGET_BUS_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // config munging routines - // - PGET_SET_DEVICE_DATA SetBusData; - PGET_SET_DEVICE_DATA GetBusData; - UCHAR CapabilityID; // 2 (AGPv2 host) or new 0xE (AGPv3 bridge) - -} AGP_TARGET_BUS_INTERFACE_STANDARD, *PAGP_TARGET_BUS_INTERFACE_STANDARD; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoReportDetectedDevice( - __in PDRIVER_OBJECT DriverObject, - __in INTERFACE_TYPE LegacyBusType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __in_opt PCM_RESOURCE_LIST ResourceList, - __in_opt PIO_RESOURCE_REQUIREMENTS_LIST ResourceRequirements, - __in BOOLEAN ResourceAssigned, - __deref_inout_opt PDEVICE_OBJECT *DeviceObject - ); -#endif - -// -// Device location interface declarations -// -typedef -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSTATUS -(*PGET_LOCATION_STRING) ( - __inout_opt PVOID Context, - __deref_out - __drv_deref(__drv_when(return==0, - __drv_allocatesMem(Mem) __drv_valueIs(!=0))) - PWCHAR *LocationStrings - ); - -typedef struct _PNP_LOCATION_INTERFACE { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // interface specific entry - // - PGET_LOCATION_STRING GetLocationString; - -} PNP_LOCATION_INTERFACE, *PPNP_LOCATION_INTERFACE; - -// -// Resource arbiter declarations -// - -typedef enum _ARBITER_ACTION { - ArbiterActionTestAllocation, - ArbiterActionRetestAllocation, - ArbiterActionCommitAllocation, - ArbiterActionRollbackAllocation, - ArbiterActionQueryAllocatedResources, - ArbiterActionWriteReservedResources, - ArbiterActionQueryConflict, - ArbiterActionQueryArbitrate, - ArbiterActionAddReserved, - ArbiterActionBootAllocation -} ARBITER_ACTION, *PARBITER_ACTION; - -typedef struct _ARBITER_CONFLICT_INFO { - // - // The device object owning the device that is causing the conflict - // - PDEVICE_OBJECT OwningObject; - - // - // The start of the conflicting range - // - ULONGLONG Start; - - // - // The end of the conflicting range - // - ULONGLONG End; - -} ARBITER_CONFLICT_INFO, *PARBITER_CONFLICT_INFO; - -// -// The parameters for those actions -// - -typedef struct _ARBITER_TEST_ALLOCATION_PARAMETERS { - - // - // Doubly linked list of ARBITER_LIST_ENTRY's - // - __inout PLIST_ENTRY ArbitrationList; - - // - // The size of the AllocateFrom array - // - __in ULONG AllocateFromCount; - - // - // Array of resource descriptors describing the resources available - // to the arbiter for it to arbitrate - // - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; - -} ARBITER_TEST_ALLOCATION_PARAMETERS, *PARBITER_TEST_ALLOCATION_PARAMETERS; - - -typedef struct _ARBITER_RETEST_ALLOCATION_PARAMETERS { - - // - // Doubly linked list of ARBITER_LIST_ENTRY's - // - __inout PLIST_ENTRY ArbitrationList; - - // - // The size of the AllocateFrom array - // - __in ULONG AllocateFromCount; - - // - // Array of resource descriptors describing the resources available - // to the arbiter for it to arbitrate - // - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR AllocateFrom; - -} ARBITER_RETEST_ALLOCATION_PARAMETERS, *PARBITER_RETEST_ALLOCATION_PARAMETERS; - -typedef struct _ARBITER_BOOT_ALLOCATION_PARAMETERS { - - // - // Doubly linked list of ARBITER_LIST_ENTRY's - // - __inout PLIST_ENTRY ArbitrationList; - -} ARBITER_BOOT_ALLOCATION_PARAMETERS, *PARBITER_BOOT_ALLOCATION_PARAMETERS; - - -typedef struct _ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS { - - // - // The resources that are currently allocated - // - __out PCM_PARTIAL_RESOURCE_LIST *AllocatedResources; - -} ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS, *PARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS; - -typedef struct _ARBITER_QUERY_CONFLICT_PARAMETERS { - - // - // This is the device we are trying to find a conflict for - // - __in PDEVICE_OBJECT PhysicalDeviceObject; - - // - // This is the resource to find the conflict for - // - __in PIO_RESOURCE_DESCRIPTOR ConflictingResource; - - // - // Number of devices conflicting on the resource - // - __out PULONG ConflictCount; - - // - // Pointer to array describing the conflicting device objects and ranges - // - __out PARBITER_CONFLICT_INFO *Conflicts; - -} ARBITER_QUERY_CONFLICT_PARAMETERS, *PARBITER_QUERY_CONFLICT_PARAMETERS; - -typedef struct _ARBITER_QUERY_ARBITRATE_PARAMETERS { - - // - // Doubly linked list of ARBITER_LIST_ENTRY's - should have - // only one entry - // - __in PLIST_ENTRY ArbitrationList; - -} ARBITER_QUERY_ARBITRATE_PARAMETERS, *PARBITER_QUERY_ARBITRATE_PARAMETERS; - -typedef struct _ARBITER_ADD_RESERVED_PARAMETERS { - - // - // Doubly linked list of ARBITER_LIST_ENTRY's - should have - // only one entry - // - __in PDEVICE_OBJECT ReserveDevice; - -} ARBITER_ADD_RESERVED_PARAMETERS, *PARBITER_ADD_RESERVED_PARAMETERS; - - -typedef struct _ARBITER_PARAMETERS { - - union { - - ARBITER_TEST_ALLOCATION_PARAMETERS TestAllocation; - ARBITER_RETEST_ALLOCATION_PARAMETERS RetestAllocation; - ARBITER_BOOT_ALLOCATION_PARAMETERS BootAllocation; - ARBITER_QUERY_ALLOCATED_RESOURCES_PARAMETERS QueryAllocatedResources; - ARBITER_QUERY_CONFLICT_PARAMETERS QueryConflict; - ARBITER_QUERY_ARBITRATE_PARAMETERS QueryArbitrate; - ARBITER_ADD_RESERVED_PARAMETERS AddReserved; - - } Parameters; - -} ARBITER_PARAMETERS, *PARBITER_PARAMETERS; - -typedef enum _ARBITER_REQUEST_SOURCE { - - ArbiterRequestUndefined = -1, - ArbiterRequestLegacyReported, // IoReportResourceUsage - ArbiterRequestHalReported, // IoReportHalResourceUsage - ArbiterRequestLegacyAssigned, // IoAssignResources - ArbiterRequestPnpDetected, // IoReportResourceForDetection - ArbiterRequestPnpEnumerated // IRP_MN_QUERY_RESOURCE_REQUIREMENTS - -} ARBITER_REQUEST_SOURCE; - - -typedef enum _ARBITER_RESULT { - - ArbiterResultUndefined = -1, - ArbiterResultSuccess, - ArbiterResultExternalConflict, // This indicates that the request can never be solved for devices in this list - ArbiterResultNullRequest // The request was for length zero and thus no translation should be attempted - -} ARBITER_RESULT; - -// -// ARBITER_FLAG_BOOT_CONFIG - this indicates that the request is for the -// resources assigned by the firmware/BIOS. It should be succeeded even if -// it conflicts with another devices boot config. -// - -#define ARBITER_FLAG_BOOT_CONFIG 0x00000001 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoReportResourceForDetection( - __in PDRIVER_OBJECT DriverObject, - __in_bcount_opt(DriverListSize) PCM_RESOURCE_LIST DriverList, - __in_opt ULONG DriverListSize, - __in_opt PDEVICE_OBJECT DeviceObject, - __in_bcount_opt(DeviceListSize) PCM_RESOURCE_LIST DeviceList, - __in_opt ULONG DeviceListSize, - __out PBOOLEAN ConflictDetected - ); -#endif - -typedef struct _ARBITER_LIST_ENTRY { - - // - // This is a doubly linked list of entries for easy sorting - // - LIST_ENTRY ListEntry; - - // - // The number of alternative allocation - // - ULONG AlternativeCount; - - // - // Pointer to an array of resource descriptors for the possible allocations - // - PIO_RESOURCE_DESCRIPTOR Alternatives; - - // - // The device object of the device requesting these resources. - // - PDEVICE_OBJECT PhysicalDeviceObject; - - // - // Indicates where the request came from - // - ARBITER_REQUEST_SOURCE RequestSource; - - // - // Flags these indicate a variety of things (use ARBITER_FLAG_*) - // - ULONG Flags; - - // - // Space to aid the arbiter in processing the list it is initialized to 0 when - // the entry is created. The system will not attempt to interpret it. - // - LONG_PTR WorkSpace; - - // - // Interface Type, Slot Number and Bus Number from Resource Requirements list, - // used only for reverse identification. - // - INTERFACE_TYPE InterfaceType; - ULONG SlotNumber; - ULONG BusNumber; - - // - // A pointer to a descriptor to indicate the resource that was allocated. - // This is allocated by the system and filled in by the arbiter in response to an - // ArbiterActionTestAllocation. - // - PCM_PARTIAL_RESOURCE_DESCRIPTOR Assignment; - - // - // Pointer to the alternative that was chosen from to provide the assignment. - // This is filled in by the arbiter in response to an ArbiterActionTestAllocation. - // - PIO_RESOURCE_DESCRIPTOR SelectedAlternative; - - // - // The result of the operation - // This is filled in by the arbiter in response to an ArbiterActionTestAllocation. - // - ARBITER_RESULT Result; - -} ARBITER_LIST_ENTRY, *PARBITER_LIST_ENTRY; - -// -// The arbiter's entry point -// - -typedef -NTSTATUS -(*PARBITER_HANDLER) ( - __inout_opt PVOID Context, - __in ARBITER_ACTION Action, - __inout PARBITER_PARAMETERS Parameters - ); - -// -// Arbiter interface -// - -#define ARBITER_PARTIAL 0x00000001 - - -typedef struct _ARBITER_INTERFACE { - - // - // Generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // Entry point to the arbiter - // - PARBITER_HANDLER ArbiterHandler; - - // - // Other information about the arbiter, use ARBITER_* flags - // - ULONG Flags; - -} ARBITER_INTERFACE, *PARBITER_INTERFACE; - -// -// The directions translation can take place in -// - -typedef enum _RESOURCE_TRANSLATION_DIRECTION { - TranslateChildToParent, - TranslateParentToChild -} RESOURCE_TRANSLATION_DIRECTION; - -// -// Translation functions -// - -typedef -NTSTATUS -(*PTRANSLATE_RESOURCE_HANDLER)( - __inout_opt PVOID Context, - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Source, - __in RESOURCE_TRANSLATION_DIRECTION Direction, - __in_opt ULONG AlternativesCount, - __in_ecount_opt(AlternativesCount) IO_RESOURCE_DESCRIPTOR Alternatives[], - __in PDEVICE_OBJECT PhysicalDeviceObject, - __out PCM_PARTIAL_RESOURCE_DESCRIPTOR Target -); - -typedef -NTSTATUS -(*PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER)( - __inout_opt PVOID Context, - __in PIO_RESOURCE_DESCRIPTOR Source, - __in PDEVICE_OBJECT PhysicalDeviceObject, - __out PULONG TargetCount, - __out_ecount(TargetCount) PIO_RESOURCE_DESCRIPTOR *Target -); - -// -// Translator Interface -// - -typedef struct _TRANSLATOR_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - PTRANSLATE_RESOURCE_HANDLER TranslateResources; - PTRANSLATE_RESOURCE_REQUIREMENTS_HANDLER TranslateResourceRequirements; -} TRANSLATOR_INTERFACE, *PTRANSLATOR_INTERFACE; - -// -// The following function prototypes are for HAL routines with a prefix of Hal. -// -// General functions. -// - -typedef -BOOLEAN -(*PHAL_RESET_DISPLAY_PARAMETERS) ( - __in ULONG Columns, - __in ULONG Rows - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK -NTHALAPI -VOID -HalAcquireDisplayOwnership ( - __in PHAL_RESET_DISPLAY_PARAMETERS ResetDisplayParameters - ); -#endif - -#if defined(_IA64_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use GetDmaRequirement -__drv_preferredFunction("GetDmaAlignment", "Obsolete") -NTHALAPI -ULONG -HalGetDmaAlignmentRequirement ( - VOID - ); -#endif - -#endif - -#if defined(_M_IX86) || defined(_M_AMD64) - -#define HalGetDmaAlignmentRequirement() 1L -#endif - -// -// I/O driver configuration functions. -// -#if !defined(NO_LEGACY_DRIVERS) -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use Pnp or IoReportDetectedDevice -__drv_preferredFunction("(see documentation)", "Obsolete") -NTHALAPI -NTSTATUS -HalAssignSlotResources ( - __in PUNICODE_STRING RegistryPath, - __in PUNICODE_STRING DriverClassName OPTIONAL, - __in PDRIVER_OBJECT DriverObject, - __in PDEVICE_OBJECT DeviceObject, - __in INTERFACE_TYPE BusType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __inout PCM_RESOURCE_LIST *AllocatedResources - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use Pnp or IoReportDetectedDevice -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction( - "IoReportDetectedDevice and IoReportResourceForDetection", "Obsolete") -NTHALAPI -ULONG -HalGetInterruptVector ( - __in INTERFACE_TYPE InterfaceType, - __in ULONG BusNumber, - __in ULONG BusInterruptLevel, - __in ULONG BusInterruptVector, - __out PKIRQL Irql, - __out PKAFFINITY Affinity - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG -__drv_when(BusDataType!=0, /* Cmos == 0 */ - __drv_preferredFunction( - "IRP_MN_QUERY_INTERFACE and IRP_MN_WRITE_CONFIG requests", - "Obsolete except for BusDataType==Cmos")) -NTHALAPI -ULONG -HalSetBusData ( - __in BUS_DATA_TYPE BusDataType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length - ); -#endif - -#endif // NO_LEGACY_DRIVERS - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG -__drv_when(BusDataType!=0, /* Cmos == 0 */ - __drv_preferredFunction( - "IRP_MN_QUERY_INTERFACE and IRP_MN_WRITE_CONFIG requests", - "Obsolete except for BusDataType==Cmos")) -NTHALAPI -ULONG -HalSetBusDataByOffset ( - __in BUS_DATA_TYPE BusDataType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG -__drv_preferredFunction("(see documentation)", "Obsolete") -NTHALAPI -BOOLEAN -HalTranslateBusAddress ( - __in INTERFACE_TYPE InterfaceType, - __in ULONG BusNumber, - __in PHYSICAL_ADDRESS BusAddress, - __inout PULONG AddressSpace, - __out PPHYSICAL_ADDRESS TranslatedAddress - ); -#endif - -// -// Values for AddressSpace parameter of HalTranslateBusAddress -// -// 0x0 - Memory space -// 0x1 - Port space -// 0x2 - 0x1F - Address spaces specific for Alpha -// 0x2 - UserMode view of memory space -// 0x3 - UserMode view of port space -// 0x4 - Dense memory space -// 0x5 - reserved -// 0x6 - UserMode view of dense memory space -// 0x7 - 0x1F - reserved -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTHALAPI -PVOID -HalAllocateCrashDumpRegisters ( - __in PADAPTER_OBJECT AdapterObject, - __inout PULONG NumberOfMapRegisters - ); -#endif - -#if !defined(NO_LEGACY_DRIVERS) -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG -__drv_when(BusDataType!=0, - __drv_preferredFunction( - "IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG requests", - "Obsolete except for BusDataType==Cmos")) -NTHALAPI -ULONG -HalGetBusData ( - __in BUS_DATA_TYPE BusDataType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length - ); -#endif -#endif // NO_LEGACY_DRIVERS - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IRP_MN_QUERY_INTERFACE and IRP_MN_READ_CONFIG -__drv_when(BusDataType!=0, - __drv_preferredFunction("IRP_MN_QUERY_INTERFACE", - "Obsolete except for BusDataType==Cmos")) -NTHALAPI -ULONG -HalGetBusDataByOffset ( - __in BUS_DATA_TYPE BusDataType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __out_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IoGetDmaAdapter -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("IoGetDmaAdapter", "Obsolete") -NTHALAPI -PADAPTER_OBJECT -HalGetAdapter ( - __in PDEVICE_DESCRIPTION DeviceDescription, - __out PULONG NumberOfMapRegisters - ); -#endif - -// -// System beep functions. -// -#if !defined(NO_LEGACY_DRIVERS) -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK -NTHALAPI -BOOLEAN -HalMakeBeep( - __in ULONG Frequency - ); -#endif -#endif // NO_LEGACY_DRIVERS - -// -// The following function prototypes are for HAL routines with a prefix of Io. -// -// DMA adapter object functions. -// - -typedef -PBUS_HANDLER -(FASTCALL *pHalHandlerForBus) ( - __in INTERFACE_TYPE InterfaceType, - __in ULONG BusNumber - ); -typedef -VOID -(FASTCALL *pHalReferenceBusHandler) ( - __in PBUS_HANDLER BusHandler - ); - -//----------------------------------------------------------------------------- -// HAL Function dispatch -// - -typedef enum _HAL_QUERY_INFORMATION_CLASS { - HalInstalledBusInformation, - HalProfileSourceInformation, - HalInformationClassUnused1, - HalPowerInformation, - HalProcessorSpeedInformation, - HalCallbackInformation, - HalMapRegisterInformation, - HalMcaLogInformation, // Machine Check Abort Information - HalFrameBufferCachingInformation, - HalDisplayBiosInformation, - HalProcessorFeatureInformation, - HalNumaTopologyInterface, - HalErrorInformation, // General MCA, CMC, CPE Error Information. - HalCmcLogInformation, // Processor Corrected Machine Check Information - HalCpeLogInformation, // Corrected Platform Error Information - HalQueryMcaInterface, - HalQueryAMLIIllegalIOPortAddresses, - HalQueryMaxHotPlugMemoryAddress, - HalPartitionIpiInterface, - HalPlatformInformation, - HalQueryProfileSourceList, - HalInitLogInformation, - HalFrequencyInformation, - HalProcessorBrandString, - HalHypervisorInformation, - HalPlatformTimerInformation, - HalAcpiAuditInformation, - // information levels >= 0x8000000 reserved for OEM use -} HAL_QUERY_INFORMATION_CLASS, *PHAL_QUERY_INFORMATION_CLASS; - - -typedef enum _HAL_SET_INFORMATION_CLASS { - HalProfileSourceInterval, - HalProfileSourceInterruptHandler, // Register performance monitor interrupt callback - HalMcaRegisterDriver, // Register Machine Check Abort driver - HalKernelErrorHandler, - HalCmcRegisterDriver, // Register Processor Corrected Machine Check driver - HalCpeRegisterDriver, // Register Corrected Platform Error driver - HalMcaLog, - HalCmcLog, - HalCpeLog, - HalGenerateCmcInterrupt, // Used to test CMC - HalProfileSourceTimerHandler, // Resister profile timer interrupt callback - HalEnlightenment, - HalProfileDpgoSourceInterruptHandler // Register performance monitor interrupt callback for dpgo -} HAL_SET_INFORMATION_CLASS, *PHAL_SET_INFORMATION_CLASS; - - - -typedef -NTSTATUS -(*pHalQuerySystemInformation)( - __in HAL_QUERY_INFORMATION_CLASS InformationClass, - __in ULONG BufferSize, - __inout PVOID Buffer, - __out PULONG ReturnedLength - ); - - -typedef -NTSTATUS -(*pHalSetSystemInformation)( - __in HAL_SET_INFORMATION_CLASS InformationClass, - __in ULONG BufferSize, - __in PVOID Buffer - ); - - -typedef -VOID -(FASTCALL *pHalExamineMBR)( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG MBRTypeIdentifier, - __out PVOID *Buffer - ); - -typedef -NTSTATUS -(FASTCALL *pHalIoReadPartitionTable)( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in BOOLEAN ReturnRecognizedPartitions, - __out struct _DRIVE_LAYOUT_INFORMATION **PartitionBuffer - ); - -typedef -NTSTATUS -(FASTCALL *pHalIoSetPartitionInformation)( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG PartitionNumber, - __in ULONG PartitionType - ); - -typedef -NTSTATUS -(FASTCALL *pHalIoWritePartitionTable)( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG SectorSize, - __in ULONG SectorsPerTrack, - __in ULONG NumberOfHeads, - __in struct _DRIVE_LAYOUT_INFORMATION *PartitionBuffer - ); - -typedef -NTSTATUS -(*pHalQueryBusSlots)( - __in PBUS_HANDLER BusHandler, - __in ULONG BufferSize, - __out PULONG SlotNumbers, - __out PULONG ReturnedLength - ); - -typedef -NTSTATUS -(*pHalInitPnpDriver)( - VOID - ); - - -typedef struct _PM_DISPATCH_TABLE { - ULONG Signature; - ULONG Version; - PVOID Function[1]; -} PM_DISPATCH_TABLE, *PPM_DISPATCH_TABLE; - - - -typedef -NTSTATUS -(*pHalInitPowerManagement)( - __in PPM_DISPATCH_TABLE PmDriverDispatchTable, - __out PPM_DISPATCH_TABLE *PmHalDispatchTable - ); - - -typedef -struct _DMA_ADAPTER * -(*pHalGetDmaAdapter)( - __in PVOID Context, - __in struct _DEVICE_DESCRIPTION *DeviceDescriptor, - __out PULONG NumberOfMapRegisters - ); - - -typedef -NTSTATUS -(*pHalGetInterruptTranslator)( - __in INTERFACE_TYPE ParentInterfaceType, - __in ULONG ParentBusNumber, - __in INTERFACE_TYPE BridgeInterfaceType, - __in USHORT Size, - __in USHORT Version, - __out PTRANSLATOR_INTERFACE Translator, - __out PULONG BridgeBusNumber - ); - - -typedef -BOOLEAN -(*pHalTranslateBusAddress)( - __in INTERFACE_TYPE InterfaceType, - __in ULONG BusNumber, - __in PHYSICAL_ADDRESS BusAddress, - __inout PULONG AddressSpace, - __out PPHYSICAL_ADDRESS TranslatedAddress - ); - -typedef -NTSTATUS -(*pHalAssignSlotResources) ( - __in PUNICODE_STRING RegistryPath, - __in PUNICODE_STRING DriverClassName OPTIONAL, - __in PDRIVER_OBJECT DriverObject, - __in PDEVICE_OBJECT DeviceObject, - __in INTERFACE_TYPE BusType, - __in ULONG BusNumber, - __in ULONG SlotNumber, - __inout PCM_RESOURCE_LIST *AllocatedResources - ); - -typedef -VOID -(*pHalHaltSystem) ( - VOID - ); - -typedef -BOOLEAN -(*pHalResetDisplay) ( - VOID - ); - - - -typedef struct _MAP_REGISTER_ENTRY { - PVOID MapRegister; - BOOLEAN WriteToDevice; -} MAP_REGISTER_ENTRY, *PMAP_REGISTER_ENTRY; - - - - -typedef -UCHAR -(*pHalVectorToIDTEntry) ( - ULONG Vector -); - -typedef -BOOLEAN -(*pHalFindBusAddressTranslation) ( - __in PHYSICAL_ADDRESS BusAddress, - __inout PULONG AddressSpace, - __out PPHYSICAL_ADDRESS TranslatedAddress, - __inout PULONG_PTR Context, - __in BOOLEAN NextBus - ); - -typedef -NTSTATUS -(*pHalStartMirroring)( - VOID - ); - -typedef -NTSTATUS -(*pHalEndMirroring)( - __in ULONG PassNumber - ); - -typedef -NTSTATUS -(*pHalMirrorPhysicalMemory)( - __in PHYSICAL_ADDRESS PhysicalAddress, - __in LARGE_INTEGER NumberOfBytes - ); - -typedef -NTSTATUS -(*pHalMirrorVerify)( - __in PHYSICAL_ADDRESS PhysicalAddress, - __in LARGE_INTEGER NumberOfBytes - ); - - -typedef struct { - UCHAR Type; //CmResourceType - BOOLEAN Valid; - UCHAR Reserved[2]; - PUCHAR TranslatedAddress; - ULONG Length; -} DEBUG_DEVICE_ADDRESS, *PDEBUG_DEVICE_ADDRESS; - -typedef struct { - PHYSICAL_ADDRESS Start; - PHYSICAL_ADDRESS MaxEnd; - PVOID VirtualAddress; - ULONG Length; - BOOLEAN Cached; - BOOLEAN Aligned; -} DEBUG_MEMORY_REQUIREMENTS, *PDEBUG_MEMORY_REQUIREMENTS; - -typedef struct { - ULONG Bus; - USHORT Segment; - ULONG Slot; - USHORT VendorID; - USHORT DeviceID; - UCHAR BaseClass; - UCHAR SubClass; - UCHAR ProgIf; - BOOLEAN Initialized; - BOOLEAN Configured; - DEBUG_DEVICE_ADDRESS BaseAddress[6]; - DEBUG_MEMORY_REQUIREMENTS Memory; -} DEBUG_DEVICE_DESCRIPTOR, *PDEBUG_DEVICE_DESCRIPTOR; - - - -typedef -NTSTATUS -(*pKdSetupPciDeviceForDebugging)( - __in PVOID LoaderBlock, OPTIONAL - __inout PDEBUG_DEVICE_DESCRIPTOR PciDevice -); - -typedef -NTSTATUS -(*pKdReleasePciDeviceForDebugging)( - __inout PDEBUG_DEVICE_DESCRIPTOR PciDevice -); - -typedef -PVOID -(*pKdGetAcpiTablePhase0)( - __in struct _LOADER_PARAMETER_BLOCK *LoaderBlock, - __in ULONG Signature - ); - -typedef -VOID -(*pKdCheckPowerButton)( - VOID - ); - -typedef -VOID -(*pHalEndOfBoot)( - VOID - ); - -typedef -PVOID -(*pKdMapPhysicalMemory64)( - __in PHYSICAL_ADDRESS PhysicalAddress, - __in ULONG NumberPages, - __in BOOLEAN FlushCurrentTLB - ); - -typedef -VOID -(*pKdUnmapVirtualAddress)( - __in PVOID VirtualAddress, - __in ULONG NumberPages, - __in BOOLEAN FlushCurrentTLB - ); - -typedef -ULONG -(*pKdGetPciDataByOffset)( - __in ULONG BusNumber, - __in ULONG SlotNumber, - __out_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -typedef -ULONG -(*pKdSetPciDataByOffset)( - __in ULONG BusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -typedef -PVOID -(*pHalGetAcpiTable)( - __in ULONG Signature, - __in_opt PCSTR OemId, - __in_opt PCSTR OemTableId - ); - -#if defined(_IA64_) -typedef -NTSTATUS -(*pHalGetErrorCapList)( - __inout PULONG CapsListLength, - __inout_bcount(*CapsListLength) PUCHAR ErrorCapList - ); - -typedef -NTSTATUS -(*pHalInjectError)( - __in ULONG BufferLength, - __in_bcount(BufferLength) PUCHAR Buffer - ); -#endif - -typedef -VOID -(*PCI_ERROR_HANDLER_CALLBACK)( - VOID - ); - -typedef -VOID -(*pHalSetPciErrorHandlerCallback)( - __in PCI_ERROR_HANDLER_CALLBACK Callback - ); - - - - -typedef struct { - ULONG Version; - pHalQuerySystemInformation HalQuerySystemInformation; - pHalSetSystemInformation HalSetSystemInformation; - pHalQueryBusSlots HalQueryBusSlots; - ULONG Spare1; - pHalExamineMBR HalExamineMBR; - pHalIoReadPartitionTable HalIoReadPartitionTable; - pHalIoSetPartitionInformation HalIoSetPartitionInformation; - pHalIoWritePartitionTable HalIoWritePartitionTable; - - pHalHandlerForBus HalReferenceHandlerForBus; - pHalReferenceBusHandler HalReferenceBusHandler; - pHalReferenceBusHandler HalDereferenceBusHandler; - - pHalInitPnpDriver HalInitPnpDriver; - pHalInitPowerManagement HalInitPowerManagement; - - pHalGetDmaAdapter HalGetDmaAdapter; - pHalGetInterruptTranslator HalGetInterruptTranslator; - - pHalStartMirroring HalStartMirroring; - pHalEndMirroring HalEndMirroring; - pHalMirrorPhysicalMemory HalMirrorPhysicalMemory; - pHalEndOfBoot HalEndOfBoot; - pHalMirrorVerify HalMirrorVerify; - - pHalGetAcpiTable HalGetCachedAcpiTable; - pHalSetPciErrorHandlerCallback HalSetPciErrorHandlerCallback; - -#if defined(_IA64_) - pHalGetErrorCapList HalGetErrorCapList; - pHalInjectError HalInjectError; -#endif - -} HAL_DISPATCH, *PHAL_DISPATCH; - - - -#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) - -extern PHAL_DISPATCH HalDispatchTable; -#define HALDISPATCH HalDispatchTable - -#else - -extern HAL_DISPATCH HalDispatchTable; -#define HALDISPATCH (&HalDispatchTable) - -#endif - -#define HAL_DISPATCH_VERSION 4 - -#define HalDispatchTableVersion HALDISPATCH->Version -#define HalQuerySystemInformation HALDISPATCH->HalQuerySystemInformation -#define HalSetSystemInformation HALDISPATCH->HalSetSystemInformation -#define HalQueryBusSlots HALDISPATCH->HalQueryBusSlots - -#define HalReferenceHandlerForBus HALDISPATCH->HalReferenceHandlerForBus -#define HalReferenceBusHandler HALDISPATCH->HalReferenceBusHandler -#define HalDereferenceBusHandler HALDISPATCH->HalDereferenceBusHandler - -#define HalInitPnpDriver HALDISPATCH->HalInitPnpDriver -#define HalInitPowerManagement HALDISPATCH->HalInitPowerManagement - -#define HalGetDmaAdapter HALDISPATCH->HalGetDmaAdapter -#define HalGetInterruptTranslator HALDISPATCH->HalGetInterruptTranslator - -#define HalStartMirroring HALDISPATCH->HalStartMirroring -#define HalEndMirroring HALDISPATCH->HalEndMirroring -#define HalMirrorPhysicalMemory HALDISPATCH->HalMirrorPhysicalMemory -#define HalEndOfBoot HALDISPATCH->HalEndOfBoot -#define HalMirrorVerify HALDISPATCH->HalMirrorVerify - -#define HalGetCachedAcpiTable HALDISPATCH->HalGetCachedAcpiTable -#define HalSetPciErrorHandlerCallback HALDISPATCH->HalSetPciErrorHandlerCallback - -#if defined(_IA64_) -#define HalGetErrorCapList HALDISPATCH->HalGetErrorCapList -#define HalInjectError HALDISPATCH->HalInjectError -#endif - - -// -// HAL System Information Structures. -// - -// for the information class "HalInstalledBusInformation" -typedef struct _HAL_BUS_INFORMATION{ - INTERFACE_TYPE BusType; - BUS_DATA_TYPE ConfigurationType; - ULONG BusNumber; - ULONG Reserved; -} HAL_BUS_INFORMATION, *PHAL_BUS_INFORMATION; - -// for the information class "HalProfileSourceInformation" -typedef struct _HAL_PROFILE_SOURCE_INFORMATION { - KPROFILE_SOURCE Source; - BOOLEAN Supported; - ULONG Interval; -} HAL_PROFILE_SOURCE_INFORMATION, *PHAL_PROFILE_SOURCE_INFORMATION; - -// for the information class "HalProfileSourceInformation" -typedef struct _HAL_PROFILE_SOURCE_INFORMATION_EX { - KPROFILE_SOURCE Source; - BOOLEAN Supported; - ULONG_PTR Interval; - ULONG_PTR DefInterval; - ULONG_PTR MaxInterval; - ULONG_PTR MinInterval; -} HAL_PROFILE_SOURCE_INFORMATION_EX, *PHAL_PROFILE_SOURCE_INFORMATION_EX; - -// for the information class "HalProfileSourceInterval" -typedef struct _HAL_PROFILE_SOURCE_INTERVAL { - KPROFILE_SOURCE Source; - ULONG_PTR Interval; -} HAL_PROFILE_SOURCE_INTERVAL, *PHAL_PROFILE_SOURCE_INTERVAL; - -// for the information class "HalQueryProfileSourceList" -typedef struct _HAL_PROFILE_SOURCE_LIST { - KPROFILE_SOURCE Source; - PWSTR Description; -} HAL_PROFILE_SOURCE_LIST, *PHAL_PROFILE_SOURCE_LIST; - -// for the information class "HalDispayBiosInformation" -typedef enum _HAL_DISPLAY_BIOS_INFORMATION { - HalDisplayInt10Bios, - HalDisplayEmulatedBios, - HalDisplayNoBios -} HAL_DISPLAY_BIOS_INFORMATION, *PHAL_DISPLAY_BIOS_INFORMATION; - -// for the information class "HalPowerInformation" -typedef struct _HAL_POWER_INFORMATION { - ULONG TBD; -} HAL_POWER_INFORMATION, *PHAL_POWER_INFORMATION; - -// for the information class "HalProcessorSpeedInformation" -typedef struct _HAL_PROCESSOR_SPEED_INFO { - ULONG ProcessorSpeed; -} HAL_PROCESSOR_SPEED_INFORMATION, *PHAL_PROCESSOR_SPEED_INFORMATION; - -// for the information class "HalCallbackInformation" -typedef struct _HAL_CALLBACKS { - PCALLBACK_OBJECT SetSystemInformation; - PCALLBACK_OBJECT BusCheck; -} HAL_CALLBACKS, *PHAL_CALLBACKS; - -// for the information class "HalProcessorFeatureInformation" -typedef struct _HAL_PROCESSOR_FEATURE { - ULONG UsableFeatureBits; -} HAL_PROCESSOR_FEATURE; - - -typedef -NTSTATUS -(*PHALIOREADWRITEHANDLER)( - __in BOOLEAN fRead, - __in ULONG dwAddr, - __in ULONG dwSize, - __inout PULONG pdwData - ); - - - -// for the information class "HalQueryIllegalIOPortAddresses" -typedef struct _HAL_AMLI_BAD_IO_ADDRESS_LIST -{ - ULONG BadAddrBegin; - ULONG BadAddrSize; - ULONG OSVersionTrigger; - PHALIOREADWRITEHANDLER IOHandler; -} HAL_AMLI_BAD_IO_ADDRESS_LIST, *PHAL_AMLI_BAD_IO_ADDRESS_LIST; - - - - -#if defined(_X86_) || defined(_IA64_) || defined(_AMD64_) - -// -// HalQueryMcaInterface -// - -typedef -VOID -(*PHALMCAINTERFACELOCK)( - VOID - ); - -typedef -VOID -(*PHALMCAINTERFACEUNLOCK)( - VOID - ); - -typedef -NTSTATUS -(*PHALMCAINTERFACEREADREGISTER)( - __in UCHAR BankNumber, - __inout PVOID Exception - ); - - -typedef struct _HAL_MCA_INTERFACE { - PHALMCAINTERFACELOCK Lock; - PHALMCAINTERFACEUNLOCK Unlock; - PHALMCAINTERFACEREADREGISTER ReadRegister; -} HAL_MCA_INTERFACE; - -typedef enum { - ApicDestinationModePhysical = 1, - ApicDestinationModeLogicalFlat, - ApicDestinationModeLogicalClustered, - ApicDestinationModeUnknown -} HAL_APIC_DESTINATION_MODE, *PHAL_APIC_DESTINATION_MODE; - - -#if defined(_AMD64_) - -struct _KTRAP_FRAME; -struct _KEXCEPTION_FRAME; - -typedef -ERROR_SEVERITY -(*PDRIVER_EXCPTN_CALLBACK) ( - __in PVOID Context, - __in struct _KTRAP_FRAME *TrapFrame, - __in struct _KEXCEPTION_FRAME *ExceptionFrame, - __in PMCA_EXCEPTION Exception -); - -#endif - -#if defined(_X86_) || defined(_IA64_) - -typedef -#if defined(_IA64_) -ERROR_SEVERITY -#else -VOID -#endif -(*PDRIVER_EXCPTN_CALLBACK) ( - __in PVOID Context, - __in PMCA_EXCEPTION BankLog -); - -#endif - -typedef PDRIVER_EXCPTN_CALLBACK PDRIVER_MCA_EXCEPTION_CALLBACK; - - -// -// Structure to record the callbacks from driver -// - -typedef struct _MCA_DRIVER_INFO { - PDRIVER_MCA_EXCEPTION_CALLBACK ExceptionCallback; - PKDEFERRED_ROUTINE DpcCallback; - PVOID DeviceContext; -} MCA_DRIVER_INFO, *PMCA_DRIVER_INFO; - - - -typedef struct _HAL_ERROR_INFO { - ULONG Version; // Version of this structure - ULONG InitMaxSize; // Maximum size of the INIT record. - ULONG McaMaxSize; // Maximum size of a Machine Check Abort record - ULONG McaPreviousEventsCount; // Flag indicating previous or early-boot MCA event logs. - ULONG McaCorrectedEventsCount; // Number of corrected MCA events since boot. approx. - ULONG McaKernelDeliveryFails; // Number of Kernel callback failures. approx. - ULONG McaDriverDpcQueueFails; // Number of OEM MCA Driver Dpc queueing failures. approx. - ULONG McaReserved; - ULONG CmcMaxSize; // Maximum size of a Corrected Machine Check record - ULONG CmcPollingInterval; // In units of seconds - ULONG CmcInterruptsCount; // Number of CMC interrupts. approx. - ULONG CmcKernelDeliveryFails; // Number of Kernel callback failures. approx. - ULONG CmcDriverDpcQueueFails; // Number of OEM CMC Driver Dpc queueing failures. approx. - ULONG CmcGetStateFails; // Number of failures in getting the log from FW. - ULONG CmcClearStateFails; // Number of failures in clearing the log from FW. - ULONG CmcReserved; - ULONGLONG CmcLogId; // Last seen record identifier. - ULONG CpeMaxSize; // Maximum size of a Corrected Platform Event record - ULONG CpePollingInterval; // In units of seconds - ULONG CpeInterruptsCount; // Number of CPE interrupts. approx. - ULONG CpeKernelDeliveryFails; // Number of Kernel callback failures. approx. - ULONG CpeDriverDpcQueueFails; // Number of OEM CPE Driver Dpc queueing failures. approx. - ULONG CpeGetStateFails; // Number of failures in getting the log from FW. - ULONG CpeClearStateFails; // Number of failures in clearing the log from FW. - ULONG CpeInterruptSources; // Number of SAPIC Platform Interrupt Sources - ULONGLONG CpeLogId; // Last seen record identifier. - ULONGLONG KernelReserved[4]; -} HAL_ERROR_INFO, *PHAL_ERROR_INFO; - - - -#define HAL_MCE_INTERRUPTS_BASED ((ULONG)-1) -#define HAL_MCE_DISABLED ((ULONG)0) - -// -// Known values for HAL_ERROR_INFO.CmcPollingInterval. -// - -#define HAL_CMC_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED -#define HAL_CMC_DISABLED HAL_MCE_DISABLED - -// -// Known values for HAL_ERROR_INFO.CpePollingInterval. -// - -#define HAL_CPE_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED -#define HAL_CPE_DISABLED HAL_MCE_DISABLED - -#define HAL_MCA_INTERRUPTS_BASED HAL_MCE_INTERRUPTS_BASED -#define HAL_MCA_DISABLED HAL_MCE_DISABLED - - - -// -// Driver Callback type for the information class "HalCmcRegisterDriver" -// - -typedef -VOID -(*PDRIVER_CMC_EXCEPTION_CALLBACK) ( - __in PVOID Context, - __in PCMC_EXCEPTION CmcLog -); - -// -// Driver Callback type for the information class "HalCpeRegisterDriver" -// - -typedef -VOID -(*PDRIVER_CPE_EXCEPTION_CALLBACK) ( - __in PVOID Context, - __in PCPE_EXCEPTION CmcLog -); - - -// -// -// Structure to record the callbacks from driver -// - -typedef struct _CMC_DRIVER_INFO { - PDRIVER_CMC_EXCEPTION_CALLBACK ExceptionCallback; - PKDEFERRED_ROUTINE DpcCallback; - PVOID DeviceContext; -} CMC_DRIVER_INFO, *PCMC_DRIVER_INFO; - -typedef struct _CPE_DRIVER_INFO { - PDRIVER_CPE_EXCEPTION_CALLBACK ExceptionCallback; - PKDEFERRED_ROUTINE DpcCallback; - PVOID DeviceContext; -} CPE_DRIVER_INFO, *PCPE_DRIVER_INFO; - - - -#endif // defined(_X86_) || defined(_IA64_) || defined(_AMD64_) - - - -#if defined(_IA64_) - -typedef -NTSTATUS -(*HALSENDCROSSPARTITIONIPI)( - __in USHORT ProcessorID, - __in UCHAR HardwareVector - ); - -typedef -NTSTATUS -(*HALRESERVECROSSPARTITIONINTERRUPTVECTOR)( - __out PULONG Vector, - __out PKIRQL Irql, - __inout PGROUP_AFFINITY Affinity, - __out PUCHAR HardwareVector - ); - -typedef -VOID -(*HALFREECROSSPARTITIONINTERRUPTVECTOR)( - __in ULONG Vector, - __in PGROUP_AFFINITY Affinity - ); - -typedef struct _HAL_CROSS_PARTITION_IPI_INTERFACE { - HALSENDCROSSPARTITIONIPI HalSendCrossPartitionIpi; - HALRESERVECROSSPARTITIONINTERRUPTVECTOR HalReserveCrossPartitionInterruptVector; - HALFREECROSSPARTITIONINTERRUPTVECTOR HalFreeCrossPartitionInterruptVector; -} HAL_CROSS_PARTITION_IPI_INTERFACE; - -#define HAL_CROSS_PARTITION_IPI_INTERFACE_MINIMUM_SIZE \ - FIELD_OFFSET(HAL_CROSS_PARTITION_IPI_INTERFACE, \ - HalFreeCrossPartitionInterruptVector) - -#endif - -typedef struct _HAL_PLATFORM_INFORMATION { - ULONG PlatformFlags; -} HAL_PLATFORM_INFORMATION, *PHAL_PLATFORM_INFORMATION; - - - -// -// These platform flags are carried over from the IPPT table -// definition if appropriate. -// - -#define HAL_PLATFORM_DISABLE_WRITE_COMBINING 0x01L -#define HAL_PLATFORM_DISABLE_PTCG 0x04L -#define HAL_PLATFORM_DISABLE_UC_MAIN_MEMORY 0x08L -#define HAL_PLATFORM_ENABLE_WRITE_COMBINING_MMIO 0x10L -#define HAL_PLATFORM_ACPI_TABLES_CACHED 0x20L - - - -#if defined(_WIN64) - -// -// Use __inline DMA macros (hal.h) -// -#ifndef USE_DMA_MACROS -#define USE_DMA_MACROS -#endif - -// -// Only PnP drivers! -// -#ifndef NO_LEGACY_DRIVERS -#define NO_LEGACY_DRIVERS -#endif - -#endif // _WIN64 - -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) - -#else - -// -// DMA adapter object functions. -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use AllocateAdapterChannel -NTHALAPI -NTSTATUS -HalAllocateAdapterChannel( - __in PADAPTER_OBJECT AdapterObject, - __in PWAIT_CONTEXT_BLOCK Wcb, - __in ULONG NumberOfMapRegisters, - __in PDRIVER_CONTROL ExecutionRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use AllocateCommonBuffer -__drv_preferredFunction("AllocateCommonBuffer","Obsolete") -NTHALAPI -PVOID -HalAllocateCommonBuffer( - __in PADAPTER_OBJECT AdapterObject, - __in ULONG Length, - __out PPHYSICAL_ADDRESS LogicalAddress, - __in BOOLEAN CacheEnabled - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use FreeCommonBuffer -__drv_preferredFunction("FreeCommonBuffer","Obsolete") -NTHALAPI -VOID -HalFreeCommonBuffer( - __in PADAPTER_OBJECT AdapterObject, - __in ULONG Length, - __in PHYSICAL_ADDRESS LogicalAddress, - __in PVOID VirtualAddress, - __in BOOLEAN CacheEnabled - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use ReadDmaCounter -__drv_preferredFunction("ReadDmaCounter","Obsolete") -NTHALAPI -ULONG -HalReadDmaCounter( - __in PADAPTER_OBJECT AdapterObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use FlushAdapterBuffers -__drv_preferredFunction("FlushAdapterBuffers","Obsolete") -NTHALAPI -BOOLEAN -IoFlushAdapterBuffers( - __in PADAPTER_OBJECT AdapterObject, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __in ULONG Length, - __in BOOLEAN WriteToDevice - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use FreeAdapterChannel -__drv_preferredFunction("FreeAdapterChannel","Obsolete") -NTHALAPI -VOID -IoFreeAdapterChannel( - __in PADAPTER_OBJECT AdapterObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use FreeMapRegisters -__drv_preferredFunction("FreeMapRegisters","Obsolete") -NTHALAPI -VOID -IoFreeMapRegisters( - __in PADAPTER_OBJECT AdapterObject, - __in PVOID MapRegisterBase, - __in ULONG NumberOfMapRegisters - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use MapTransfer -__drv_preferredFunction("MapTransfer","Obsolete") -NTHALAPI -PHYSICAL_ADDRESS -IoMapTransfer( - __in PADAPTER_OBJECT AdapterObject, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __inout PULONG Length, - __in BOOLEAN WriteToDevice - ); -#endif - -#endif // USE_DMA_MACROS && (_NTDDK_ || _NTDRIVER_) - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK -NTSTATUS -HalGetScatterGatherList ( // Use GetScatterGatherList - __in PADAPTER_OBJECT DmaAdapter, - __in PDEVICE_OBJECT DeviceObject, - __in PMDL Mdl, - __in PVOID CurrentVa, - __in ULONG Length, - __in PDRIVER_LIST_CONTROL ExecutionRoutine, - __in PVOID Context, - __in BOOLEAN WriteToDevice - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use PutScatterGatherList -VOID -HalPutScatterGatherList ( - __in PADAPTER_OBJECT DmaAdapter, - __in PSCATTER_GATHER_LIST ScatterGather, - __in BOOLEAN WriteToDevice - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use PutDmaAdapter -VOID -HalPutDmaAdapter( - __in PADAPTER_OBJECT DmaAdapter - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR *PWHEA_ERROR_SOURCE_DESCRIPTOR; -typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; - -NTHALAPI -VOID -HalBugCheckSystem ( - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, - __in PWHEA_ERROR_RECORD ErrorRecord - ); - -#else - -typedef struct _WHEA_ERROR_RECORD *PWHEA_ERROR_RECORD; - -NTHALAPI -VOID -HalBugCheckSystem ( - __in PWHEA_ERROR_RECORD ErrorRecord - ); - -#endif - - -typedef enum _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE { - ResourceTypeSingle = 0, - ResourceTypeRange, - ResourceTypeExtendedCounterConfiguration, - ResourceTypeOverflow, - ResourceTypeMax -} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE; - -/*++ - -Physical Counter Resource Descriptor Types: - - Describes the format of a physical counter resource. - - PhysicalCounterResourceTypeSingle - The decriptor specifies a single - physical counter in the the u.CounterIndex member. - - PhysicalCounterResourceTypeRange - The descriptor specifies a range of - counter indices in the u.Range member. - - PhysicalCounterResourceTypeExtendedConfiguration - The descriptor specifies - an extended counter configuration register address in in the - u.ExtendedRegisterAddress member. Only used on Intel NetBurst systems. - - PhysicalCounterResourceTypeOverflow - The descriptor specifies a counter - overflow interrupt. - ---*/ - -typedef struct _PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR { - PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR_TYPE Type; - ULONG Flags; - union { - ULONG CounterIndex; - ULONG ExtendedRegisterAddress; - struct { - ULONG Begin; - ULONG End; - } Range; - } u; -} PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR, *PPHYSICAL_COUNTER_RESOURCE_DESCRIPTOR; - -/*++ - -Physical Counter Resource Descriptor: - - Data structure used to describe physical counter resources on the platform. - -Fields: - - Type - Supplies the type of counter resource described. - - Flags - Reserved for future use. - - CounterIndex - Supplies a physical counter index. - - ExtendedRegisterAddress - Supplies an extended configuration register index. - - Range - Supplies a range of counter indices or register addresses. - ---*/ - -typedef struct _PHYSICAL_COUNTER_RESOURCE_LIST { - ULONG Count; - PHYSICAL_COUNTER_RESOURCE_DESCRIPTOR Descriptors[ANYSIZE_ARRAY]; -} PHYSICAL_COUNTER_RESOURCE_LIST, *PPHYSICAL_COUNTER_RESOURCE_LIST; - -/*++ - -Physical Counter Resource List: - - Data structure used to report or request a set of physical counter - resources on the platform. - -Fields: - - Count - Supplies the number of physical counter resources in the list. - - Descriptors - Supplies the a variable length array of physical counter - descriptors. - ---*/ - -NTSTATUS -HalAllocateHardwareCounters ( - __in_ecount(GroupCount) PGROUP_AFFINITY GroupAffinty, - __in ULONG GroupCount, - __in PPHYSICAL_COUNTER_RESOURCE_LIST ResourceList, - __out PHANDLE CounterSetHandle - ); - -NTSTATUS -HalFreeHardwareCounters ( - __in HANDLE CounterSetHandle - ); - -// -// Determine if there is a complete device failure on an error. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTKERNELAPI -BOOLEAN -FsRtlIsTotalDeviceFailure( - __in NTSTATUS Status - ); -#endif - - -// -// AGP Capabilities -// -typedef struct _PCI_AGP_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - USHORT Minor:4; - USHORT Major:4; - USHORT Rsvd1:8; - - struct _PCI_AGP_STATUS { - ULONG Rate:3; - ULONG Agp3Mode:1; - ULONG FastWrite:1; - ULONG FourGB:1; - ULONG HostTransDisable:1; - ULONG Gart64:1; - ULONG ITA_Coherent:1; - ULONG SideBandAddressing:1; // SBA - ULONG CalibrationCycle:3; - ULONG AsyncRequestSize:3; - ULONG Rsvd1:1; - ULONG Isoch:1; - ULONG Rsvd2:6; - ULONG RequestQueueDepthMaximum:8; // RQ - } AGPStatus; - - struct _PCI_AGP_COMMAND { - ULONG Rate:3; - ULONG Rsvd1:1; - ULONG FastWriteEnable:1; - ULONG FourGBEnable:1; - ULONG Rsvd2:1; - ULONG Gart64:1; - ULONG AGPEnable:1; - ULONG SBAEnable:1; - ULONG CalibrationCycle:3; - ULONG AsyncReqSize:3; - ULONG Rsvd3:8; - ULONG RequestQueueDepth:8; - } AGPCommand; - -} PCI_AGP_CAPABILITY, *PPCI_AGP_CAPABILITY; - -// -// An AGPv3 Target must have an extended capability, -// but it's only present for a Master when the Isoch -// bit is set in its status register -// -typedef enum _EXTENDED_AGP_REGISTER { - IsochStatus, - AgpControl, - ApertureSize, - AperturePageSize, - GartLow, - GartHigh, - IsochCommand -} EXTENDED_AGP_REGISTER, *PEXTENDED_AGP_REGISTER; - -typedef struct _PCI_AGP_ISOCH_STATUS { - ULONG ErrorCode: 2; - ULONG Rsvd1: 1; - ULONG Isoch_L: 3; - ULONG Isoch_Y: 2; - ULONG Isoch_N: 8; - ULONG Rsvd2: 16; -} PCI_AGP_ISOCH_STATUS, *PPCI_AGP_ISOCH_STATUS; - -typedef struct _PCI_AGP_CONTROL { - ULONG Rsvd1: 7; - ULONG GTLB_Enable: 1; - ULONG AP_Enable: 1; - ULONG CAL_Disable: 1; - ULONG Rsvd2: 22; -} PCI_AGP_CONTROL, *PPCI_AGP_CONTROL; - -typedef struct _PCI_AGP_APERTURE_PAGE_SIZE { - USHORT PageSizeMask: 11; - USHORT Rsvd1: 1; - USHORT PageSizeSelect: 4; -} PCI_AGP_APERTURE_PAGE_SIZE, *PPCI_AGP_APERTURE_PAGE_SIZE; - -typedef struct _PCI_AGP_ISOCH_COMMAND { - USHORT Rsvd1: 6; - USHORT Isoch_Y: 2; - USHORT Isoch_N: 8; -} PCI_AGP_ISOCH_COMMAND, *PPCI_AGP_ISOCH_COMMAND; - -typedef struct PCI_AGP_EXTENDED_CAPABILITY { - - PCI_AGP_ISOCH_STATUS IsochStatus; - -// -// Target only ----------------<<-begin->> -// - PCI_AGP_CONTROL AgpControl; - USHORT ApertureSize; - PCI_AGP_APERTURE_PAGE_SIZE AperturePageSize; - ULONG GartLow; - ULONG GartHigh; -// -// ------------------------------<<-end->> -// - - PCI_AGP_ISOCH_COMMAND IsochCommand; - -} PCI_AGP_EXTENDED_CAPABILITY, *PPCI_AGP_EXTENDED_CAPABILITY; - - -#define PCI_AGP_RATE_1X 0x1 -#define PCI_AGP_RATE_2X 0x2 -#define PCI_AGP_RATE_4X 0x4 - - -// -// PCI-X Bridge Capability -// - -// -// Values for BusModeFrequency in the SecondaryStatus register -// -#define PCIX_MODE_CONVENTIONAL_PCI 0x0 -#define PCIX_MODE1_66MHZ 0x1 -#define PCIX_MODE1_100MHZ 0x2 -#define PCIX_MODE1_133MHZ 0x3 -#define PCIX_MODE2_266_66MHZ 0x9 -#define PCIX_MODE2_266_100MHZ 0xA -#define PCIX_MODE2_266_133MHZ 0xB -#define PCIX_MODE2_533_66MHZ 0xD -#define PCIX_MODE2_533_100MHZ 0xE -#define PCIX_MODE2_533_133MHZ 0xF - -// -// Values for the Version in the SecondaryStatus register -// -#define PCIX_VERSION_MODE1_ONLY 0x0 -#define PCIX_VERSION_MODE2_ECC 0x1 -#define PCIX_VERSION_DUAL_MODE_ECC 0x2 - -typedef struct _PCIX_BRIDGE_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - union { - struct { - USHORT Bus64Bit:1; - USHORT Bus133MHzCapable:1; - USHORT SplitCompletionDiscarded:1; - USHORT UnexpectedSplitCompletion:1; - USHORT SplitCompletionOverrun:1; - USHORT SplitRequestDelayed:1; - USHORT BusModeFrequency:4; // PCIX_MODE_x - USHORT Rsvd:2; - USHORT Version:2; // PCIX_VERSION_x - USHORT Bus266MHzCapable:1; - USHORT Bus533MHzCapable:1; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; - } SecondaryStatus; - - union { - struct { - ULONG FunctionNumber:3; - ULONG DeviceNumber:5; - ULONG BusNumber:8; - ULONG Device64Bit:1; - ULONG Device133MHzCapable:1; - ULONG SplitCompletionDiscarded:1; - ULONG UnexpectedSplitCompletion:1; - ULONG SplitCompletionOverrun:1; - ULONG SplitRequestDelayed:1; - ULONG Rsvd:7; - ULONG DIMCapable:1; - ULONG Device266MHzCapable:1; - ULONG Device533MHzCapable:1; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } BridgeStatus; - - USHORT UpstreamSplitTransactionCapacity; - USHORT UpstreamSplitTransactionLimit; - - USHORT DownstreamSplitTransactionCapacity; - USHORT DownstreamSplitTransactionLimit; - - union { - struct { - ULONG SelectSecondaryRegisters:1; - ULONG ErrorPresentInOtherBank:1; - ULONG AdditionalCorrectableError:1; - ULONG AdditionalUncorrectableError:1; - ULONG ErrorPhase:3; - ULONG ErrorCorrected:1; - ULONG Syndrome:8; - ULONG ErrorFirstCommand:4; - ULONG ErrorSecondCommand:4; - ULONG ErrorUpperAttributes:4; - ULONG ControlUpdateEnable:1; - ULONG Rsvd:1; - ULONG DisableSingleBitCorrection:1; - ULONG EccMode:1; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } EccControlStatus; - - ULONG EccFirstAddress; - ULONG EccSecondAddress; - ULONG EccAttribute; - -} PCIX_BRIDGE_CAPABILITY, *PPCIX_BRIDGE_CAPABILITY; - -// -// PCI to PCI Bridge Subsystem ID Capability -// -typedef struct _PCI_SUBSYSTEM_IDS_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - USHORT Reserved; - USHORT SubVendorID; - USHORT SubSystemID; - -} PCI_SUBSYSTEM_IDS_CAPABILITY, *PPCI_SUBSYSTEM_IDS_CAPABILITY; - -// -// _OSC is used by OSPM to query the capabilities of a device and to -// communicate the features supported by the device driver to the platform. -// The _OSC interface for PCI host bridge devices that originate PCI, PCI-X or -// PCI Express hierarchies is identified by a UUID of {33db4d5b-1ff7-401c-9657- -// 7441c03dd766}. A revision ID of 1 indicates that the capabilities buffer is -// composed of 3 DWORDs. -// The first DWORD is common across all OSC implementations and includes status -// and error information. -// The second DWORD (Support Field) provides information regarding OS supported -// features. -// The third DWORD (Control Field) is used to submit request for control of -// associated features. If any bits in the control field are returned cleared, -// then the respective feature is unsupported by the platform and must not be -// enabled. -// According to the PCI Firmware Specification a machine with multiple host -// bridge devices should report the same capabilities for all host bridges -// and also negotiate control of the features in the same way. -// - -#define OSC_FIRMWARE_FAILURE 0x02 -#define OSC_UNRECOGNIZED_UUID 0x04 -#define OSC_UNRECOGNIZED_REVISION 0x08 -#define OSC_CAPABILITIES_MASKED 0x10 - -#define PCI_ROOT_BUS_OSC_METHOD_CAPABILITY_REVISION 0x01 - -// -// The following declarations pertain to the second and third DWORD in -// evaluation of _OSC for PCI host bridge devices. -// - -typedef struct _PCI_ROOT_BUS_OSC_SUPPORT_FIELD { - union { - struct { - ULONG ExtendedConfigOpRegions:1; - ULONG ActiveStatePowerManagement:1; - ULONG ClockPowerManagement:1; - ULONG SegmentGroups:1; - ULONG MessageSignaledInterrupts:1; - ULONG WindowsHardwareErrorArchitecture:1; - ULONG Reserved:26; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } u; -} PCI_ROOT_BUS_OSC_SUPPORT_FIELD, *PPCI_ROOT_BUS_OSC_SUPPORT_FIELD; - -typedef struct _PCI_ROOT_BUS_OSC_CONTROL_FIELD { - union { - struct { - ULONG ExpressNativeHotPlug:1; - ULONG ShpcNativeHotPlug:1; - ULONG ExpressNativePME:1; - ULONG ExpressAdvancedErrorReporting:1; - ULONG ExpressCapabilityStructure:1; - ULONG Reserved:27; - } DUMMYSTRUCTNAME; - ULONG AsULONG; - } u; -} PCI_ROOT_BUS_OSC_CONTROL_FIELD, *PPCI_ROOT_BUS_OSC_CONTROL_FIELD; - -// -// An enumerator for the PCI physical and electrical interface. -// - -typedef enum _PCI_HARDWARE_INTERFACE { - - PciConventional, - PciXMode1, - PciXMode2, - PciExpress - -} PCI_HARDWARE_INTERFACE, *PPCI_HARDWARE_INTERFACE; - -typedef enum { - - BusWidth32Bits, - BusWidth64Bits - -} PCI_BUS_WIDTH; - -typedef struct _PCI_ROOT_BUS_HARDWARE_CAPABILITY { - - // - // Describes the secondary side of a PCI root bus. - // - - PCI_HARDWARE_INTERFACE SecondaryInterface; - - // - // These additional capabilities are available when each of the following - // is true. - // 1. The secondary side of a PCI root bus operates in conventional or - // PCI-X mode. - // 2. The PCI root bus has a hardware ID or compatible ID of PNP0A03. - // 3. A _DSM function 4 is defined for the root bus. - // - - struct { - - // - // This boolean indicates if the remaining fields describing the bus - // capabilities are valid or not. - // - - BOOLEAN BusCapabilitiesFound; - - - // - // Provides information on current and supported speeds/modes. - // - - ULONG CurrentSpeedAndMode; - ULONG SupportedSpeedsAndModes; - - // - // Describes the root bus capability on forwarding of Device ID message - // transactions. - // - - BOOLEAN DeviceIDMessagingCapable; - - // - // Provides the width for a PCI interface. - // - - PCI_BUS_WIDTH SecondaryBusWidth; - } DUMMYSTRUCTNAME; - - // - // Fields describing features supported as well as control for them from - // the bios. - // - - PCI_ROOT_BUS_OSC_SUPPORT_FIELD OscFeatureSupport; - PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlRequest; - PCI_ROOT_BUS_OSC_CONTROL_FIELD OscControlGranted; - -} PCI_ROOT_BUS_HARDWARE_CAPABILITY, *PPCI_ROOT_BUS_HARDWARE_CAPABILITY; - -// -// PCI Express Capability -// - -typedef union _PCI_EXPRESS_CAPABILITIES_REGISTER { - - struct { - - USHORT CapabilityVersion:4; - USHORT DeviceType:4; // PCI_EXPRESS_DEVICE_TYPE - USHORT SlotImplemented:1; - USHORT InterruptMessageNumber:5; - USHORT Rsvd:2; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_CAPABILITIES_REGISTER, *PPCI_EXPRESS_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER { - - struct { - - ULONG MaxPayloadSizeSupported:3; // EXPRESS_MAX_PAYLOAD_SIZE - ULONG PhantomFunctionsSupported:2; - ULONG ExtendedTagSupported:1; - ULONG L0sAcceptableLatency:3; // EXPRESS_L0S_LATENCY - ULONG L1AcceptableLatency:3; // EXPRESS_L1_LATENCY - ULONG Undefined:3; - ULONG RoleBasedErrorReporting:1; - ULONG Rsvd1:2; - ULONG CapturedSlotPowerLimit:8; - ULONG CapturedSlotPowerLimitScale:2; - ULONG Rsvd2:4; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER, *PPCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER; - -// -// The low 3 bits of the PCI Express device control register dictate whether -// a device that implements AER routes error messages to the root complex. -// This mask is used when programming the AER bits in the device control -// register. -// - -#define PCI_EXPRESS_AER_DEVICE_CONTROL_MASK 0x07; - -typedef union _PCI_EXPRESS_DEVICE_CONTROL_REGISTER { - - struct { - - USHORT CorrectableErrorEnable:1; - USHORT NonFatalErrorEnable:1; - USHORT FatalErrorEnable:1; - USHORT UnsupportedRequestErrorEnable:1; - USHORT EnableRelaxedOrder:1; - USHORT MaxPayloadSize:3; // EXPRESS_MAX_PAYLOAD_SIZE - USHORT ExtendedTagEnable:1; - USHORT PhantomFunctionsEnable:1; - USHORT AuxPowerEnable:1; - USHORT NoSnoopEnable:1; - USHORT MaxReadRequestSize:3; // EXPRESS_MAX_PAYLOAD_SIZE - USHORT BridgeConfigRetryEnable:1; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_DEVICE_CONTROL_REGISTER, *PPCI_EXPRESS_DEVICE_CONTROL_REGISTER; - -// -// The low 4 bits of the PCI Express device status register hold AER device -// status. This mask is used when programming the AER bits in the device status -// register. -// - -#define PCI_EXPRESS_AER_DEVICE_STATUS_MASK 0x0F; - -typedef union _PCI_EXPRESS_DEVICE_STATUS_REGISTER { - - struct { - - USHORT CorrectableErrorDetected:1; - USHORT NonFatalErrorDetected:1; - USHORT FatalErrorDetected:1; - USHORT UnsupportedRequestDetected:1; - USHORT AuxPowerDetected:1; - USHORT TransactionsPending:1; - USHORT Rsvd:10; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_DEVICE_STATUS_REGISTER, *PPCI_EXPRESS_DEVICE_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_LINK_CAPABILITIES_REGISTER { - - struct { - - ULONG MaximumLinkSpeed:4; - ULONG MaximumLinkWidth:6; - ULONG ActiveStatePMSupport:2; // EXPRESS_ASPM_CONFIG - ULONG L0sExitLatency:3; // EXPRESS_L0S_LATENCY - ULONG L1ExitLatency:3; // EXPRESS_L1_LATENCY - ULONG ClockPowerManagement:1; - ULONG SurpriseDownErrorReportingCapable:1; - ULONG DataLinkLayerActiveReportingCapable:1; - ULONG Rsvd:3; - ULONG PortNumber:8; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_LINK_CAPABILITIES_REGISTER, *PPCI_EXPRESS_LINK_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_LINK_CONTROL_REGISTER { - - struct { - - USHORT ActiveStatePMControl:2; // EXPRESS_ASPM_CONFIG - USHORT Rsvd1:1; - USHORT ReadCompletionBoundary:1; // EXPRESS_RCB - USHORT LinkDisable:1; - USHORT RetrainLink:1; - USHORT CommonClockConfig:1; - USHORT ExtendedSynch:1; - USHORT EnableClockPowerManagement:1; - USHORT Rsvd2:7; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_LINK_CONTROL_REGISTER, *PPCI_EXPRESS_LINK_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_LINK_STATUS_REGISTER { - - struct { - - USHORT LinkSpeed:4; - USHORT LinkWidth:6; - USHORT Undefined:1; - USHORT LinkTraining:1; - USHORT SlotClockConfig:1; - USHORT DataLinkLayerActive:1; - USHORT Rsvd:2; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_LINK_STATUS_REGISTER, *PPCI_EXPRESS_LINK_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER { - - struct { - - ULONG AttentionButtonPresent:1; - ULONG PowerControllerPresent:1; - ULONG MRLSensorPresent:1; - ULONG AttentionIndicatorPresent:1; - ULONG PowerIndicatorPresent:1; - ULONG HotPlugSurprise:1; - ULONG HotPlugCapable:1; - ULONG SlotPowerLimit:8; - ULONG SlotPowerLimitScale:2; - ULONG ElectromechanicalLockPresent:1; - ULONG NoCommandCompletedSupport:1; - ULONG PhysicalSlotNumber:13; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_SLOT_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_CONTROL_REGISTER { - - struct { - - USHORT AttentionButtonEnable:1; - USHORT PowerFaultDetectEnable:1; - USHORT MRLSensorEnable:1; - USHORT PresenceDetectEnable:1; - USHORT CommandCompletedEnable:1; - USHORT HotPlugInterruptEnable:1; - USHORT AttentionIndicatorControl:2; // EXPRESS_INDICATOR_STATE - USHORT PowerIndicatorControl:2; // EXPRESS_INDICATOR_STATE - USHORT PowerControllerControl:1; // EXPRESS_POWER_STATE - USHORT ElectromechanicalLockControl:1; - USHORT DataLinkStateChangeEnable:1; - USHORT Rsvd:3; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SLOT_CONTROL_REGISTER, *PPCI_EXPRESS_SLOT_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_SLOT_STATUS_REGISTER { - - struct { - - USHORT AttentionButtonPressed:1; - USHORT PowerFaultDetected:1; - USHORT MRLSensorChanged:1; - USHORT PresenceDetectChanged:1; - USHORT CommandCompleted:1; - USHORT MRLSensorState:1; // EXPRESS_MRL_STATE - USHORT PresenceDetectState:1; // EXPRESS_CARD_PRESENCE - USHORT ElectromechanicalLockEngaged:1; - USHORT DataLinkStateChanged:1; - USHORT Rsvd:7; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SLOT_STATUS_REGISTER, *PPCI_EXPRESS_SLOT_STATUS_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_CONTROL_REGISTER { - - struct { - - USHORT CorrectableSerrEnable:1; - USHORT NonFatalSerrEnable:1; - USHORT FatalSerrEnable:1; - USHORT PMEInterruptEnable:1; - USHORT CRSSoftwareVisibilityEnable:1; - USHORT Rsvd:11; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_ROOT_CONTROL_REGISTER, *PPCI_EXPRESS_ROOT_CONTROL_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER { - - struct { - - USHORT CRSSoftwareVisibility:1; - USHORT Rsvd:15; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER, *PPCI_EXPRESS_ROOT_CAPABILITIES_REGISTER; - -typedef union _PCI_EXPRESS_ROOT_STATUS_REGISTER { - - struct { - - ULONG PMERequestorId:16; // PCI_EXPRESS_REQUESTOR_ID - ULONG PMEStatus:1; - ULONG PMEPending:1; - ULONG Rsvd:14; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_STATUS_REGISTER, *PPCI_EXPRESS_ROOT_STATUS_REGISTER; - -// -// PCI Express Capability -// - -typedef struct _PCI_EXPRESS_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - PCI_EXPRESS_CAPABILITIES_REGISTER ExpressCapabilities; - - PCI_EXPRESS_DEVICE_CAPABILITIES_REGISTER DeviceCapabilities; - - PCI_EXPRESS_DEVICE_CONTROL_REGISTER DeviceControl; - PCI_EXPRESS_DEVICE_STATUS_REGISTER DeviceStatus; - - PCI_EXPRESS_LINK_CAPABILITIES_REGISTER LinkCapabilities; - - PCI_EXPRESS_LINK_CONTROL_REGISTER LinkControl; - PCI_EXPRESS_LINK_STATUS_REGISTER LinkStatus; - - PCI_EXPRESS_SLOT_CAPABILITIES_REGISTER SlotCapabilities; - - PCI_EXPRESS_SLOT_CONTROL_REGISTER SlotControl; - PCI_EXPRESS_SLOT_STATUS_REGISTER SlotStatus; - - PCI_EXPRESS_ROOT_CONTROL_REGISTER RootControl; - PCI_EXPRESS_ROOT_CAPABILITIES_REGISTER RootCapabilities; - - PCI_EXPRESS_ROOT_STATUS_REGISTER RootStatus; - -} PCI_EXPRESS_CAPABILITY, *PPCI_EXPRESS_CAPABILITY; - -typedef enum { - - MRLClosed = 0, - MRLOpen - -} PCI_EXPRESS_MRL_STATE; - -typedef enum { - - SlotEmpty = 0, - CardPresent - -} PCI_EXPRESS_CARD_PRESENCE; - -typedef enum { - - IndicatorOn = 1, - IndicatorBlink, - IndicatorOff - -} PCI_EXPRESS_INDICATOR_STATE; - -typedef enum { - - PowerOn = 0, - PowerOff - -} PCI_EXPRESS_POWER_STATE; - -typedef enum { - - L0sEntrySupport = 1, - L0sAndL1EntrySupport = 3 - -} PCI_EXPRESS_ASPM_SUPPORT; - -typedef enum { - - L0sAndL1EntryDisabled, - L0sEntryEnabled, - L1EntryEnabled, - L0sAndL1EntryEnabled - -} PCI_EXPRESS_ASPM_CONTROL; - -typedef enum { - - L0s_Below64ns = 0, - L0s_64ns_128ns, - L0s_128ns_256ns, - L0s_256ns_512ns, - L0s_512ns_1us, - L0s_1us_2us, - L0s_2us_4us, - L0s_Above4us - -} PCI_EXPRESS_L0s_EXIT_LATENCY; - -typedef enum { - - L1_Below1us = 0, - L1_1us_2us, - L1_2us_4us, - L1_4us_8us, - L1_8us_16us, - L1_16us_32us, - L1_32us_64us, - L1_Above64us - -} PCI_EXPRESS_L1_EXIT_LATENCY; - -typedef enum { - - PciExpressEndpoint = 0, - PciExpressLegacyEndpoint, - PciExpressRootPort = 4, - PciExpressUpstreamSwitchPort, - PciExpressDownstreamSwitchPort, - PciExpressToPciXBridge, - PciXToExpressBridge, - PciExpressRootComplexIntegratedEndpoint, - PciExpressRootComplexEventCollector - -} PCI_EXPRESS_DEVICE_TYPE; - -typedef enum { - - MaxPayload128Bytes = 0, - MaxPayload256Bytes, - MaxPayload512Bytes, - MaxPayload1024Bytes, - MaxPayload2048Bytes, - MaxPayload4096Bytes - -} PCI_EXPRESS_MAX_PAYLOAD_SIZE; - -typedef union _PCI_EXPRESS_PME_REQUESTOR_ID { - - struct { - - USHORT FunctionNumber:3; - USHORT DeviceNumber:5; - USHORT BusNumber:8; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_PME_REQUESTOR_ID, *PPCI_EXPRESS_PME_REQUESTOR_ID; - - -// -// Portable portion of HAL & HAL bus extender definitions for BUSHANDLER -// BusData for installed PCI buses. -// - -typedef VOID -(*PciPin2Line) ( - __in struct _BUS_HANDLER *BusHandler, - __in struct _BUS_HANDLER *RootHandler, - __in PCI_SLOT_NUMBER SlotNumber, - __in PPCI_COMMON_CONFIG PciData - ); - -typedef VOID -(*PciLine2Pin) ( - __in struct _BUS_HANDLER *BusHandler, - __in struct _BUS_HANDLER *RootHandler, - __in PCI_SLOT_NUMBER SlotNumber, - __in PPCI_COMMON_CONFIG PciNewData, - __in PPCI_COMMON_CONFIG PciOldData - ); - -typedef VOID -(*PciReadWriteConfig) ( - __in struct _BUS_HANDLER *BusHandler, - __in PCI_SLOT_NUMBER Slot, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -#define PCI_DATA_TAG ' ICP' -#define PCI_DATA_VERSION 1 - -typedef struct _PCIBUSDATA { - ULONG Tag; - ULONG Version; - PciReadWriteConfig ReadConfig; - PciReadWriteConfig WriteConfig; - PciPin2Line Pin2Line; - PciLine2Pin Line2Pin; - PCI_SLOT_NUMBER ParentSlot; - PVOID Reserved[4]; -} PCIBUSDATA, *PPCIBUSDATA; - - -#ifndef _PCIINTRF_X_ -#define _PCIINTRF_X_ - -// -// PCI Bus interface -// - -typedef ULONG (*PCI_READ_WRITE_CONFIG)( - __in PVOID Context, - __in ULONG BusOffset, - __in ULONG Slot, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -typedef VOID (*PCI_PIN_TO_LINE)( - __in PVOID Context, - __in PPCI_COMMON_CONFIG PciData - ); - -typedef VOID (*PCI_LINE_TO_PIN)( - __in PVOID Context, - __in PPCI_COMMON_CONFIG PciNewData, - __in PPCI_COMMON_CONFIG PciOldData - ); - -typedef VOID (*PCI_ROOT_BUS_CAPABILITY) ( - __in PVOID Context, - __out PPCI_ROOT_BUS_HARDWARE_CAPABILITY HardwareCapability - ); - -typedef VOID (*PCI_EXPRESS_WAKE_CONTROL) ( - __in PVOID Context, - __in BOOLEAN EnableWake - ); - -typedef struct _PCI_BUS_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // standard PCI bus interfaces - // - PCI_READ_WRITE_CONFIG ReadConfig; - PCI_READ_WRITE_CONFIG WriteConfig; - PCI_PIN_TO_LINE PinToLine; - PCI_LINE_TO_PIN LineToPin; - PCI_ROOT_BUS_CAPABILITY RootBusCapability; - PCI_EXPRESS_WAKE_CONTROL ExpressWakeControl; - -} PCI_BUS_INTERFACE_STANDARD, *PPCI_BUS_INTERFACE_STANDARD; - -#define PCI_BUS_INTERFACE_STANDARD_VERSION 1 - - -#endif - -// -// Define exported ZwXxx routines to device drivers. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetInformationThread ( - __in HANDLE ThreadHandle, - __in THREADINFOCLASS ThreadInformationClass, - __in_bcount(ThreadInformationLength) PVOID ThreadInformation, - __in ULONG ThreadInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(return=0, __drv_allocatesMem(TimerObject)) -NTSTATUS -ZwCreateTimer ( - __out PHANDLE TimerHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in TIMER_TYPE TimerType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwOpenTimer ( - __out PHANDLE TimerHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwCancelTimer ( - __in HANDLE TimerHandle, - __out_opt PBOOLEAN CurrentState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwSetTimer ( - __in HANDLE TimerHandle, - __in PLARGE_INTEGER DueTime, - __in_opt PTIMER_APC_ROUTINE TimerApcRoutine, - __in_opt PVOID TimerContext, - __in BOOLEAN ResumeTimer, - __in_opt LONG Period, - __out_opt PBOOLEAN PreviousState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwSetTimerEx ( - __in HANDLE TimerHandle, - __in TIMER_SET_INFORMATION_CLASS TimerSetInformationClass, - __inout_bcount_opt(TimerSetInformationLength) PVOID TimerSetInformation, - __in ULONG TimerSetInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryVolumeInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDeviceIoControlFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG IoControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDisplayString( - __in PUNICODE_STRING String - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwPowerInformation( - __in POWER_INFORMATION_LEVEL InformationLevel, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwAllocateLocallyUniqueId( - __out PLUID Luid - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwTerminateProcess ( - __in_opt HANDLE ProcessHandle, - __in NTSTATUS ExitStatus - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenProcess ( - __out PHANDLE ProcessHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PCLIENT_ID ClientId - ); - - -//------------------------------------------------------ WHEA_ERROR_SOURCE_TYPE - -#define WHEA_PHYSICAL_ADDRESS LARGE_INTEGER - -// -// This enumeration defines the various types of error sources that a platform -// can expose to the operating system. -// - -typedef enum _WHEA_ERROR_SOURCE_TYPE { - WheaErrSrcTypeMCE = 0x00, // Machine Check Exception - WheaErrSrcTypeCMC = 0x01, // Corrected Machine Check - WheaErrSrcTypeCPE = 0x02, // Corrected Platform Error - WheaErrSrcTypeNMI = 0x03, // Non-Maskable Interrupt - WheaErrSrcTypePCIe = 0x04, // PCI Express Error - WheaErrSrcTypeGeneric = 0x05, // Other types of error sources - WheaErrSrcTypeINIT = 0x06, // IA64 INIT Error Source - WheaErrSrcTypeBOOT = 0x07, // BOOT Error Source - WheaErrSrcTypeSCIGeneric = 0x08, // SCI-based generic error source - WheaErrSrcTypeIPFMCA = 0x09, // Itanium Machine Check Abort - WheaErrSrcTypeIPFCMC = 0x0a, // Itanium Machine check - WheaErrSrcTypeIPFCPE = 0x0b, // Itanium Corrected Platform Error - WheaErrSrcTypeMax -} WHEA_ERROR_SOURCE_TYPE, *PWHEA_ERROR_SOURCE_TYPE; - -// -// Error sources have a runtime state associated with them. The following are -// the valid states for an error source. -// - -typedef enum _WHEA_ERROR_SOURCE_STATE { - WheaErrSrcStateStopped = 0x01, - WheaErrSrcStateStarted = 0x02 -} WHEA_ERROR_SOURCE_STATE, *PWHEA_ERROR_SOURCE_STATE; - -#define WHEA_ERROR_SOURCE_DESCRIPTOR_VERSION_10 10 - -#define WHEA_MAX_MC_BANKS 32 - -#define WHEA_ERROR_SOURCE_FLAG_FIRMWAREFIRST 0x00000001 -#define WHEA_ERROR_SOURCE_FLAG_GLOBAL 0x00000002 -#define WHEA_ERROR_SOURCE_FLAG_PREALLOCATE_PER_PROCESSOR 0x00000004 -#define WHEA_ERROR_SOURCE_FLAG_DEFAULTSOURCE 0x80000000 - -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_XPFMCE 0 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_XPFCMC 1 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_XPFNMI 2 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_IPFMCA 3 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_IPFCMC 4 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_IPFCPE 5 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_AERROOTPORT 6 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_AERENDPOINT 7 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_AERBRIDGE 8 -#define WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_GENERIC 9 - -#define WHEA_XPF_MC_BANK_STATUSFORMAT_IA32MCA 0 -#define WHEA_XPF_MC_BANK_STATUSFORMAT_Intel64MCA 1 -#define WHEA_XPF_MC_BANK_STATUSFORMAT_AMD64MCA 2 - -#define WHEA_NOTIFICATION_TYPE_POLLED 0 -#define WHEA_NOTIFICATION_TYPE_EXTERNALINTERRUPT 1 -#define WHEA_NOTIFICATION_TYPE_LOCALINTERRUPT 2 -#define WHEA_NOTIFICATION_TYPE_SCI 3 -#define WHEA_NOTIFICATION_TYPE_NMI 4 - -#include - -//------------------------------------------------ WHEA_ERROR_SOURCE_DESCRIPTOR - -typedef union _WHEA_NOTIFICATION_FLAGS { - struct { - USHORT PollIntervalRW:1; - USHORT SwitchToPollingThresholdRW:1; - USHORT SwitchToPollingWindowRW:1; - USHORT ErrorThresholdRW:1; - USHORT ErrorThresholdWindowRW:1; - USHORT Reserved:11; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} WHEA_NOTIFICATION_FLAGS, *PWHEA_NOTIFICATION_FLAGS; - -typedef union _XPF_MC_BANK_FLAGS { - struct { - UCHAR ClearOnInitializationRW:1; - UCHAR ControlDataRW:1; - UCHAR Reserved:6; - } DUMMYSTRUCTNAME; - UCHAR AsUCHAR; -} XPF_MC_BANK_FLAGS, *PXPF_MC_BANK_FLAGS; - -typedef union _XPF_MCE_FLAGS { - struct { - ULONG MCG_CapabilityRW:1; - ULONG MCG_GlobalControlRW:1; - ULONG Reserved:30; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} XPF_MCE_FLAGS, *PXPF_MCE_FLAGS; - -typedef union _AER_ROOTPORT_DESCRIPTOR_FLAGS { - struct { - USHORT UncorrectableErrorMaskRW:1; - USHORT UncorrectableErrorSeverityRW:1; - USHORT CorrectableErrorMaskRW:1; - USHORT AdvancedCapsAndControlRW:1; - USHORT RootErrorCommandRW:1; - USHORT Reserved:11; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} AER_ROOTPORT_DESCRIPTOR_FLAGS, *PAER_ROOTPORT_DESCRIPTOR_FLAGS; - -typedef union _AER_ENDPOINT_DESCRIPTOR_FLAGS { - struct { - USHORT UncorrectableErrorMaskRW:1; - USHORT UncorrectableErrorSeverityRW:1; - USHORT CorrectableErrorMaskRW:1; - USHORT AdvancedCapsAndControlRW:1; - USHORT Reserved:12; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} AER_ENDPOINT_DESCRIPTOR_FLAGS, *PAER_ENDPOINT_DESCRIPTOR_FLAGS; - -typedef union _AER_BRIDGE_DESCRIPTOR_FLAGS { - struct { - USHORT UncorrectableErrorMaskRW:1; - USHORT UncorrectableErrorSeverityRW:1; - USHORT CorrectableErrorMaskRW:1; - USHORT AdvancedCapsAndControlRW:1; - USHORT SecondaryUncorrectableErrorMaskRW:1; - USHORT SecondaryUncorrectableErrorSevRW:1; - USHORT SecondaryCapsAndControlRW:1; - USHORT Reserved:9; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} AER_BRIDGE_DESCRIPTOR_FLAGS, *PAER_BRIDGE_DESCRIPTOR_FLAGS; - -// -// The following structure is used to describe how a given error source reports -// errors to the OS. -// - -typedef struct _WHEA_NOTIFICATION_DESCRIPTOR { - UCHAR Type; - UCHAR Length; - WHEA_NOTIFICATION_FLAGS Flags; - - union { - struct { - ULONG PollInterval; - } Polled; - - struct { - ULONG PollInterval; - ULONG Vector; - ULONG SwitchToPollingThreshold; - ULONG SwitchToPollingWindow; - ULONG ErrorThreshold; - ULONG ErrorThresholdWindow; - } Interrupt; - - struct { - ULONG PollInterval; - ULONG Vector; - ULONG SwitchToPollingThreshold; - ULONG SwitchToPollingWindow; - ULONG ErrorThreshold; - ULONG ErrorThresholdWindow; - } LocalInterrupt; - - struct { - ULONG PollInterval; - ULONG Vector; - ULONG SwitchToPollingThreshold; - ULONG SwitchToPollingWindow; - ULONG ErrorThreshold; - ULONG ErrorThresholdWindow; - } Sci; - - struct { - ULONG PollInterval; - ULONG Vector; - ULONG SwitchToPollingThreshold; - ULONG SwitchToPollingWindow; - ULONG ErrorThreshold; - ULONG ErrorThresholdWindow; - } Nmi; - } u; -} WHEA_NOTIFICATION_DESCRIPTOR, *PWHEA_NOTIFICATION_DESCRIPTOR; - -// -// The following structure describes an XPF machine check bank. It identifies -// the bank with a BankNumber and it contains information that is used to -// configure the bank. MCE and CMC error sources make use of this descriptor -// to describe and configure each bank. -// - -typedef struct _WHEA_XPF_MC_BANK_DESCRIPTOR { - UCHAR BankNumber; - BOOLEAN ClearOnInitialization; - UCHAR StatusDataFormat; - XPF_MC_BANK_FLAGS Flags; - ULONG ControlMsr; - ULONG StatusMsr; - ULONG AddressMsr; - ULONG MiscMsr; - ULONGLONG ControlData; -} WHEA_XPF_MC_BANK_DESCRIPTOR, *PWHEA_XPF_MC_BANK_DESCRIPTOR; - -// -// The following structure describes an XPF platform's machine check exception -// error source mechanism. The information represented in this structure tells -// the OS how to configure the platform's MCE error source. -// - -typedef struct _WHEA_XPF_MCE_DESCRIPTOR { - USHORT Type; - UCHAR Enabled; - UCHAR NumberOfBanks; - XPF_MCE_FLAGS Flags; - ULONGLONG MCG_Capability; - ULONGLONG MCG_GlobalControl; - WHEA_XPF_MC_BANK_DESCRIPTOR Banks[WHEA_MAX_MC_BANKS]; -} WHEA_XPF_MCE_DESCRIPTOR, *PWHEA_XPF_MCE_DESCRIPTOR; - -// -// The following structure describes an XPF platform's corrected machine check -// error source mechanism. The information represented in this structure tells -// the OS how to configure the platform's CMC error source. -// - -typedef struct _WHEA_XPF_CMC_DESCRIPTOR { - USHORT Type; - BOOLEAN Enabled; - UCHAR NumberOfBanks; - ULONG Reserved; - WHEA_NOTIFICATION_DESCRIPTOR Notify; - WHEA_XPF_MC_BANK_DESCRIPTOR Banks[WHEA_MAX_MC_BANKS]; -} WHEA_XPF_CMC_DESCRIPTOR, *PWHEA_XPF_CMC_DESCRIPTOR; - -typedef struct _WHEA_PCI_SLOT_NUMBER { - union { - struct { - ULONG DeviceNumber:5; - ULONG FunctionNumber:3; - ULONG Reserved:24; - } bits; - ULONG AsULONG; - } u; -} WHEA_PCI_SLOT_NUMBER, *PWHEA_PCI_SLOT_NUMBER; - -// -// The following structure describes an XPF platform's non-maskable interrupt -// error source mechanism. The information represented in this structure tells -// the OS how to configure the platform's NMI error source. -// - -typedef struct _WHEA_XPF_NMI_DESCRIPTOR { - USHORT Type; - BOOLEAN Enabled; -} WHEA_XPF_NMI_DESCRIPTOR, *PWHEA_XPF_NMI_DESCRIPTOR; - -// -// The following structure describes a platform's PCI Express AER root port -// error source. The information represented in this structure tells the OS how -// to configure the root port's AER settings. -// - -typedef struct _WHEA_AER_ROOTPORT_DESCRIPTOR { - USHORT Type; - BOOLEAN Enabled; - UCHAR Reserved; - ULONG BusNumber; - WHEA_PCI_SLOT_NUMBER Slot; - USHORT DeviceControl; - AER_ROOTPORT_DESCRIPTOR_FLAGS Flags; - ULONG UncorrectableErrorMask; - ULONG UncorrectableErrorSeverity; - ULONG CorrectableErrorMask; - ULONG AdvancedCapsAndControl; - ULONG RootErrorCommand; -} WHEA_AER_ROOTPORT_DESCRIPTOR, *PWHEA_AER_ROOTPORT_DESCRIPTOR; - -// -// The following structure describes a platform's PCI Express AER endpoint -// error source. The information represented in this structure tells the OS how -// to configure the device's AER settings. -// - -typedef struct _WHEA_AER_ENDPOINT_DESCRIPTOR { - USHORT Type; - BOOLEAN Enabled; - UCHAR Reserved; - ULONG BusNumber; - WHEA_PCI_SLOT_NUMBER Slot; - USHORT DeviceControl; - AER_ENDPOINT_DESCRIPTOR_FLAGS Flags; - ULONG UncorrectableErrorMask; - ULONG UncorrectableErrorSeverity; - ULONG CorrectableErrorMask; - ULONG AdvancedCapsAndControl; -} WHEA_AER_ENDPOINT_DESCRIPTOR, *PWHEA_AER_ENDPOINT_DESCRIPTOR; - -// -// The following structure describes a platform's PCI Express AER bridge -// error source. The information represented in this structure tells the OS how -// to configure the bridge's AER settings. -// - -typedef struct _WHEA_AER_BRIDGE_DESCRIPTOR { - USHORT Type; - BOOLEAN Enabled; - UCHAR Reserved; - ULONG BusNumber; - WHEA_PCI_SLOT_NUMBER Slot; - USHORT DeviceControl; - AER_BRIDGE_DESCRIPTOR_FLAGS Flags; - ULONG UncorrectableErrorMask; - ULONG UncorrectableErrorSeverity; - ULONG CorrectableErrorMask; - ULONG AdvancedCapsAndControl; - ULONG SecondaryUncorrectableErrorMask; - ULONG SecondaryUncorrectableErrorSev; - ULONG SecondaryCapsAndControl; -} WHEA_AER_BRIDGE_DESCRIPTOR, *PWHEA_AER_BRIDGE_DESCRIPTOR; - -// -// The following structure describes a generic error source to the OS. Using -// the information in this structure the OS is able to configure a handler for -// the generic error source. -// - -typedef struct _WHEA_GENERIC_ERROR_DESCRIPTOR { - - // - // Type is WHEA_ERROR_SOURCE_DESCRIPTOR_TYPE_GENERIC. - // - - USHORT Type; - - // - // This field is reserved. - // - - UCHAR Reserved; - - // - // Indicates whether the generic error source is to be enabled. - // - - UCHAR Enabled; - - // - // Length of the error status block. - // - - ULONG ErrStatusBlockLength; - - // - // If this generic error source relates back to another error source, keep - // it's identifier here. - // - - ULONG RelatedErrorSourceId; - - // - // The following 5 fields have the same layout as a GEN_ADDR structure. They - // describe the address at which the OS reads error status information - // from the error source. - // - - UCHAR ErrStatusAddressSpaceID; - UCHAR ErrStatusAddressBitWidth; - UCHAR ErrStatusAddressBitOffset; - UCHAR ErrStatusAddressAccessSize; - WHEA_PHYSICAL_ADDRESS ErrStatusAddress; - - // - // Notify describes how the generic error source notifies the OS that error - // information is available. - // - - WHEA_NOTIFICATION_DESCRIPTOR Notify; - -} WHEA_GENERIC_ERROR_DESCRIPTOR, *PWHEA_GENERIC_ERROR_DESCRIPTOR; - -typedef struct _WHEA_IPF_MCA_DESCRIPTOR { - USHORT Type; - UCHAR Enabled; - UCHAR Reserved; -} WHEA_IPF_MCA_DESCRIPTOR, *PWHEA_IPF_MCA_DESCRIPTOR; - -typedef struct _WHEA_IPF_CMC_DESCRIPTOR { - USHORT Type; - UCHAR Enabled; - UCHAR Reserved; -} WHEA_IPF_CMC_DESCRIPTOR, *PWHEA_IPF_CMC_DESCRIPTOR; - -typedef struct _WHEA_IPF_CPE_DESCRIPTOR { - USHORT Type; - UCHAR Enabled; - UCHAR Reserved; -} WHEA_IPF_CPE_DESCRIPTOR, *PWHEA_IPF_CPE_DESCRIPTOR; - -typedef struct _WHEA_ERROR_SOURCE_DESCRIPTOR { - ULONG Length; // +00 (0) - ULONG Version; // +04 (4) - WHEA_ERROR_SOURCE_TYPE Type; // +08 (8) - WHEA_ERROR_SOURCE_STATE State; // +0C (12) - ULONG MaxRawDataLength; // +10 (16) - ULONG NumRecordsToPreallocate; // +14 (20) - ULONG MaxSectionsPerRecord; // +18 (24) - ULONG ErrorSourceId; // +1C (28) - ULONG PlatformErrorSourceId; // +20 (32) - ULONG Flags; // +24 (36) - - union { // +28 (40) - WHEA_XPF_MCE_DESCRIPTOR XpfMceDescriptor; - WHEA_XPF_CMC_DESCRIPTOR XpfCmcDescriptor; - WHEA_XPF_NMI_DESCRIPTOR XpfNmiDescriptor; - WHEA_IPF_MCA_DESCRIPTOR IpfMcaDescriptor; - WHEA_IPF_CMC_DESCRIPTOR IpfCmcDescriptor; - WHEA_IPF_CPE_DESCRIPTOR IpfCpeDescriptor; - WHEA_AER_ROOTPORT_DESCRIPTOR AerRootportDescriptor; - WHEA_AER_ENDPOINT_DESCRIPTOR AerEndpointDescriptor; - WHEA_AER_BRIDGE_DESCRIPTOR AerBridgeDescriptor; - WHEA_GENERIC_ERROR_DESCRIPTOR GenErrDescriptor; - } Info; - -} WHEA_ERROR_SOURCE_DESCRIPTOR, *PWHEA_ERROR_SOURCE_DESCRIPTOR; - -#include - - -// -// The general format of the common platform error record is illustrated below. -// A record consists of a header; followed by one or more section descriptors; -// and for each descriptor, an associated section which may contain either error -// or informational data. -// -// The record may include extra buffer space to allow for the dynamic addition -// of error sections descriptors and bodies, as well as for dynamically -// increasing the size of existing sections. -// -// +---------------------------------------------+ -// | Record Header | -// | SectionCount == N | -// +---------------------------------------------+ -// | Section Descriptor 1 | -// | Offset, size | ---+ -// +---------------------------------------------+ | -// | Section Descriptor 2 | | -// | Offset, size | ---+---+ -// +---------------------------------------------+ | | -// | | | | -// | .... | | | -// | | | | -// +---------------------------------------------+ | | -// | Section Descriptor N | ---+---+---+ -// | Offset, size | | | | -// +---------------------------------------------+ | | | -// | Buffer space for adding | | | | -// | more section descriptors. | | | | -// +---------------------------------------------| | | | -// | Section 1 | <--+ | | -// | | | | -// +---------------------------------------------+ | | -// | Section 2 | <------+ | -// | | | -// +---------------------------------------------+ | -// | | | -// | | | -// | .... | | -// | | | -// | | | -// +---------------------------------------------+ | -// | Section N | <----------+ -// | | -// +---------------------------------------------+ -// | | -// | | -// | | -// | Buffer space for adding | -// | more section bodies. | -// | | -// | | -// | | -// +---------------------------------------------+ -// - -// -------------------------------------------- Specification validation macros - -// -// The following macro implements a compile-time check for the offset and length -// of the specified structure member. This can be used to validate the defined -// structures against the specification. -// - -#define CPER_FIELD_CHECK(type, field, offset, length) \ - C_ASSERT(((FIELD_OFFSET(type, field) == (offset)) && \ - (RTL_FIELD_SIZE(type, field) == (length)))) - -#include - -//---------------------------------- Downlevel GUID variable name compatibility - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -#define PROCESSOR_GENERIC_SECTION_GUID PROCESSOR_GENERIC_ERROR_SECTION_GUID -#define X86_PROCESSOR_SPECIFIC_SECTION_GUID XPF_PROCESSOR_ERROR_SECTION_GUID -#define IPF_PROCESSOR_SPECIFIC_SECTION_GUID IPF_PROCESSOR_ERROR_SECTION_GUID -#define PLATFORM_MEMORY_SECTION_GUID MEMORY_ERROR_SECTION_GUID -#define PCIEXPRESS_SECTION_GUID PCIEXPRESS_ERROR_SECTION_GUID -#define PCIX_BUS_SECTION_GUID PCIXBUS_ERROR_SECTION_GUID -#define PCIX_COMPONENT_SECTION_GUID PCIXDEVICE_ERROR_SECTION_GUID -#define IPF_SAL_RECORD_REFERENCE_SECTION_GUID FIRMWARE_ERROR_RECORD_REFERENCE_GUID - -#endif - -//------------------------------------------ Common Platform Error Record types - -// -// These types are used in several of the common platform error record -// structures. -// - -typedef union _WHEA_REVISION { - struct { - UCHAR MinorRevision; - UCHAR MajorRevision; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} WHEA_REVISION, *PWHEA_REVISION; - -typedef enum _WHEA_ERROR_SEVERITY { - WheaErrSevRecoverable = 0, - WheaErrSevFatal = 1, - WheaErrSevCorrected = 2, - WheaErrSevInformational = 3 -} WHEA_ERROR_SEVERITY, *PWHEA_ERROR_SEVERITY; - -typedef union _WHEA_TIMESTAMP { - struct { - ULONGLONG Seconds:8; - ULONGLONG Minutes:8; - ULONGLONG Hours:8; - ULONGLONG Precise:1; - ULONGLONG Reserved:7; - ULONGLONG Day:8; - ULONGLONG Month:8; - ULONGLONG Year:8; - ULONGLONG Century:8; - } DUMMYSTRUCTNAME; - LARGE_INTEGER AsLARGE_INTEGER; -} WHEA_TIMESTAMP, *PWHEA_TIMESTAMP; - -typedef union _WHEA_PERSISTENCE_INFO { - struct { - ULONGLONG Signature:16; - ULONGLONG Length:24; - ULONGLONG Identifier:16; - ULONGLONG Attributes:2; - ULONGLONG DoNotLog:1; - ULONGLONG Reserved:5; - } DUMMYSTRUCTNAME; - ULONGLONG AsULONGLONG; -} WHEA_PERSISTENCE_INFO, *PWHEA_PERSISTENCE_INFO; - -#define ERRTYP_INTERNAL 0x01 // 1 -#define ERRTYP_BUS 0x10 // 16 -#define ERRTYP_MEM 0x04 // 4 -#define ERRTYP_TLB 0x05 // 5 -#define ERRTYP_CACHE 0x06 // 6 -#define ERRTYP_FUNCTION 0x07 // 7 -#define ERRTYP_SELFTEST 0x08 // 8 -#define ERRTYP_FLOW 0x09 // 9 -#define ERRTYP_MAP 0x11 // 17 -#define ERRTYP_IMPROPER 0x12 // 18 -#define ERRTYP_UNIMPL 0x13 // 19 -#define ERRTYP_LOSSOFLOCKSTEP 0x14 // 20 -#define ERRTYP_RESPONSE 0x15 // 21 -#define ERRTYP_PARITY 0x16 // 22 -#define ERRTYP_PROTOCOL 0x17 // 23 -#define ERRTYP_PATHERROR 0x18 // 24 -#define ERRTYP_TIMEOUT 0x19 // 25 -#define ERRTYP_POISONED 0x1A // 26 - -typedef union _WHEA_ERROR_STATUS { - ULONGLONG ErrorStatus; - struct { - ULONGLONG Reserved1:8; - ULONGLONG ErrorType:8; - ULONGLONG Address:1; - ULONGLONG Control:1; - ULONGLONG Data:1; - ULONGLONG Responder:1; - ULONGLONG Requester:1; - ULONGLONG FirstError:1; - ULONGLONG Overflow:1; - ULONGLONG Reserved2:41; - } DUMMYSTRUCTNAME; -} WHEA_ERROR_STATUS, *PWHEA_ERROR_STATUS; - -//---------------------------------------------------- WHEA_ERROR_RECORD_HEADER - -typedef union _WHEA_ERROR_RECORD_HEADER_VALIDBITS { - struct { - ULONG PlatformId:1; - ULONG Timestamp:1; - ULONG PartitionId:1; - ULONG Reserved:29; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_ERROR_RECORD_HEADER_VALIDBITS, *PWHEA_ERROR_RECORD_HEADER_VALIDBITS; - -#define WHEA_ERROR_RECORD_VALID_PLATFORMID 0x00000001 -#define WHEA_ERROR_RECORD_VALID_TIMESTAMP 0x00000002 -#define WHEA_ERROR_RECORD_VALID_PARTITIONID 0x00000004 - -typedef union _WHEA_ERROR_RECORD_HEADER_FLAGS { - struct { - ULONG Recovered:1; - ULONG PreviousError:1; - ULONG Simulated:1; - ULONG Reserved:29; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_ERROR_RECORD_HEADER_FLAGS, *PWHEA_ERROR_RECORD_HEADER_FLAGS; - -#define WHEA_ERROR_RECORD_FLAGS_RECOVERED 0x00000001 -#define WHEA_ERROR_RECORD_FLAGS_PREVIOUSERROR 0x00000002 -#define WHEA_ERROR_RECORD_FLAGS_SIMULATED 0x00000004 - -typedef struct _WHEA_ERROR_RECORD_HEADER { - ULONG Signature; - WHEA_REVISION Revision; - ULONG SignatureEnd; - USHORT SectionCount; - WHEA_ERROR_SEVERITY Severity; - WHEA_ERROR_RECORD_HEADER_VALIDBITS ValidBits; - ULONG Length; - WHEA_TIMESTAMP Timestamp; - GUID PlatformId; - GUID PartitionId; - GUID CreatorId; - GUID NotifyType; - ULONGLONG RecordId; - WHEA_ERROR_RECORD_HEADER_FLAGS Flags; - WHEA_PERSISTENCE_INFO PersistenceInfo; - UCHAR Reserved[12]; -} WHEA_ERROR_RECORD_HEADER, *PWHEA_ERROR_RECORD_HEADER; - -// -// Distinguished values used in the common platform error record header -// signature. -// - -#define WHEA_ERROR_RECORD_SIGNATURE 'REPC' -#define WHEA_ERROR_RECORD_REVISION 0x0210 -#define WHEA_ERROR_RECORD_SIGNATURE_END 0xFFFFFFFF - -// -// Validate the error record header structure against the definitions in the -// UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Signature, 0, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Revision, 4, 2); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, SignatureEnd, 6, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, SectionCount, 10, 2); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Severity, 12, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, ValidBits, 16, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Length, 20, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Timestamp, 24, 8); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, PlatformId, 32, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, PartitionId, 48, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, CreatorId, 64, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, NotifyType, 80, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, RecordId, 96, 8); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Flags, 104, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, PersistenceInfo, 108, 8); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_HEADER, Reserved, 116, 12); - -//---------------------------------------- WHEA_ERROR_RECORD_SECTION_DESCRIPTOR - -typedef union _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_FLAGS { - struct { - ULONG Primary:1; - ULONG ContainmentWarning:1; - ULONG Reset:1; - ULONG ThresholdExceeded:1; - ULONG ResourceNotAvailable:1; - ULONG LatentError:1; - ULONG Reserved:26; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_FLAGS, - *PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR_FLAGS; - -#define WHEA_SECTION_DESCRIPTOR_FLAGS_PRIMARY 0x00000001 -#define WHEA_SECTION_DESCRIPTOR_FLAGS_CONTAINMENTWRN 0x00000002 -#define WHEA_SECTION_DESCRIPTOR_FLAGS_RESET 0x00000004 -#define WHEA_SECTION_DESCRIPTOR_FLAGS_THRESHOLDEXCEEDED 0x00000008 -#define WHEA_SECTION_DESCRIPTOR_FLAGS_RESOURCENA 0x00000010 -#define WHEA_SECTION_DESCRIPTOR_FLAGS_LATENTERROR 0x00000020 - -typedef union _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_VALIDBITS { - struct { - UCHAR FRUId:1; - UCHAR FRUText:1; - UCHAR Reserved:6; - } DUMMYSTRUCTNAME; - UCHAR AsUCHAR; -} WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_VALIDBITS, - *PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR_VALIDBITS; - -typedef struct _WHEA_ERROR_RECORD_SECTION_DESCRIPTOR { - ULONG SectionOffset; - ULONG SectionLength; - WHEA_REVISION Revision; - WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_VALIDBITS ValidBits; - UCHAR Reserved; - WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_FLAGS Flags; - GUID SectionType; - GUID FRUId; - WHEA_ERROR_SEVERITY SectionSeverity; - CCHAR FRUText[20]; -} WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, *PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR; - -#define WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_REVISION 0x0201 - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -#define WHEA_SECTION_DESCRIPTOR_REVISION \ - WHEA_ERROR_RECORD_SECTION_DESCRIPTOR_REVISION - -#endif - -// -// Validate the error record section descriptor structure against the -// definitions in the UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, SectionOffset, 0, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, SectionLength, 4, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, Revision, 8, 2); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, ValidBits, 10, 1); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, Reserved, 11, 1); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, Flags, 12, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, SectionType, 16, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, FRUId, 32, 16); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, SectionSeverity, 48, 4); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR, FRUText, 52, 20); - -//----------------------------------------------------------- WHEA_ERROR_RECORD - -typedef struct _WHEA_ERROR_RECORD { - WHEA_ERROR_RECORD_HEADER Header; - WHEA_ERROR_RECORD_SECTION_DESCRIPTOR SectionDescriptor[ANYSIZE_ARRAY]; -} WHEA_ERROR_RECORD, *PWHEA_ERROR_RECORD; - -// -// Validate the error record structure against the definitions in the UEFI -// specification. -// - -CPER_FIELD_CHECK(WHEA_ERROR_RECORD, Header, 0, 128); -CPER_FIELD_CHECK(WHEA_ERROR_RECORD, SectionDescriptor, 128, 72); - -//---------------------------------------- WHEA_PROCESSOR_GENERIC_ERROR_SECTION - -#define GENPROC_PROCTYPE_XPF 0 -#define GENPROC_PROCTYPE_IPF 1 - -#define GENPROC_PROCISA_X86 0 -#define GENPROC_PROCISA_IPF 1 -#define GENPROC_PROCISA_X64 2 - -#define GENPROC_PROCERRTYPE_UNKNOWN 0 -#define GENPROC_PROCERRTYPE_CACHE 1 -#define GENPROC_PROCERRTYPE_TLB 2 -#define GENPROC_PROCERRTYPE_BUS 4 -#define GENPROC_PROCERRTYPE_MAE 8 - -#define GENPROC_OP_GENERIC 0 -#define GENPROC_OP_DATAREAD 1 -#define GENPROC_OP_DATAWRITE 2 -#define GENPROC_OP_INSTRUCTIONEXE 3 - -#define GENPROC_FLAGS_RESTARTABLE 0x01 -#define GENPROC_FLAGS_PRECISEIP 0x02 -#define GENPROC_FLAGS_OVERFLOW 0x04 -#define GENPROC_FLAGS_CORRECTED 0x08 - -typedef union _WHEA_PROCESSOR_FAMILY_INFO { - struct { - ULONG Stepping:4; - ULONG Model:4; - ULONG Family:4; - ULONG ProcessorType:2; - ULONG Reserved1:2; - ULONG ExtendedModel:4; - ULONG ExtendedFamily:8; - ULONG Reserved2:4; - ULONG Reserved3; - } DUMMYSTRUCTNAME; - ULONGLONG AsULONGLONG; -} WHEA_PROCESSOR_FAMILY_INFO, *PWHEA_PROCESSOR_FAMILY_INFO; - -typedef union _WHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG ProcessorType:1; - ULONGLONG InstructionSet:1; - ULONGLONG ErrorType:1; - ULONGLONG Operation:1; - ULONGLONG Flags:1; - ULONGLONG Level:1; - ULONGLONG CPUVersion:1; - ULONGLONG CPUBrandString:1; - ULONGLONG ProcessorId:1; - ULONGLONG TargetAddress:1; - ULONGLONG RequesterId:1; - ULONGLONG ResponderId:1; - ULONGLONG InstructionPointer:1; - ULONGLONG Reserved:51; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS, - *PWHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS; - -typedef struct _WHEA_PROCESSOR_GENERIC_ERROR_SECTION { - WHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS ValidBits; - UCHAR ProcessorType; - UCHAR InstructionSet; - UCHAR ErrorType; - UCHAR Operation; - UCHAR Flags; - UCHAR Level; - USHORT Reserved; - ULONGLONG CPUVersion; - UCHAR CPUBrandString[128]; - ULONGLONG ProcessorId; - ULONGLONG TargetAddress; - ULONGLONG RequesterId; - ULONGLONG ResponderId; - ULONGLONG InstructionPointer; -} WHEA_PROCESSOR_GENERIC_ERROR_SECTION, *PWHEA_PROCESSOR_GENERIC_ERROR_SECTION; - -// -// Define alternate type name for downlevel source compatibility. -// - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_PROCESSOR_GENERIC_ERROR_SECTION_VALIDBITS - WHEA_GENERIC_PROCESSOR_ERROR_VALIDBITS, - *PWHEA_GENERIC_PROCESSOR_ERROR_VALIDBITS; - -typedef WHEA_PROCESSOR_GENERIC_ERROR_SECTION - WHEA_GENERIC_PROCESSOR_ERROR, *PWHEA_GENERIC_PROCESSOR_ERROR; - -#endif - -// -// Validate the processor generic error section structure against the -// definitions in the UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, ProcessorType, 8, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, InstructionSet, 9, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, ErrorType, 10, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, Operation, 11, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, Flags, 12, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, Level, 13, 1); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, Reserved, 14, 2); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, CPUVersion, 16, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, CPUBrandString, 24, 128); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, ProcessorId, 152, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, TargetAddress, 160, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, RequesterId, 168, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, ResponderId, 176, 8); -CPER_FIELD_CHECK(WHEA_PROCESSOR_GENERIC_ERROR_SECTION, InstructionPointer, 184, 8); - -//-------------------------------------------- WHEA_XPF_PROCESSOR_ERROR_SECTION - -// -// x86/x64 cache check structure. -// - -#define XPF_CACHE_CHECK_TRANSACTIONTYPE_INSTRUCTION 0 -#define XPF_CACHE_CHECK_TRANSACTIONTYPE_DATAACCESS 1 -#define XPF_CACHE_CHECK_TRANSACTIONTYPE_GENERIC 2 - -#define XPF_CACHE_CHECK_OPERATION_GENERIC 0 -#define XPF_CACHE_CHECK_OPERATION_GENREAD 1 -#define XPF_CACHE_CHECK_OPERATION_GENWRITE 2 -#define XPF_CACHE_CHECK_OPERATION_DATAREAD 3 -#define XPF_CACHE_CHECK_OPERATION_DATAWRITE 4 -#define XPF_CACHE_CHECK_OPERATION_INSTRUCTIONFETCH 5 -#define XPF_CACHE_CHECK_OPERATION_PREFETCH 6 -#define XPF_CACHE_CHECK_OPERATION_EVICTION 7 -#define XPF_CACHE_CHECK_OPERATION_SNOOP 8 - -typedef union _WHEA_XPF_CACHE_CHECK { - struct { - ULONGLONG TransactionTypeValid:1; - ULONGLONG OperationValid:1; - ULONGLONG LevelValid:1; - ULONGLONG ProcessorContextCorruptValid:1; - ULONGLONG UncorrectedValid:1; - ULONGLONG PreciseIPValid:1; - ULONGLONG RestartableIPValid:1; - ULONGLONG OverflowValid:1; - ULONGLONG ReservedValid:8; - - ULONGLONG TransactionType:2; - ULONGLONG Operation:4; - ULONGLONG Level:3; - ULONGLONG ProcessorContextCorrupt:1; - ULONGLONG Uncorrected:1; - ULONGLONG PreciseIP:1; - ULONGLONG RestartableIP:1; - ULONGLONG Overflow:1; - - ULONGLONG Reserved:34; - } DUMMYSTRUCTNAME; - ULONGLONG XpfCacheCheck; -} WHEA_XPF_CACHE_CHECK, *PWHEA_XPF_CACHE_CHECK; - -// -// x86/x64 TLB check structure. -// - -#define XPF_TLB_CHECK_TRANSACTIONTYPE_INSTRUCTION 0 -#define XPF_TLB_CHECK_TRANSACTIONTYPE_DATAACCESS 1 -#define XPF_TLB_CHECK_TRANSACTIONTYPE_GENERIC 2 - -#define XPF_TLB_CHECK_OPERATION_GENERIC 0 -#define XPF_TLB_CHECK_OPERATION_GENREAD 1 -#define XPF_TLB_CHECK_OPERATION_GENWRITE 2 -#define XPF_TLB_CHECK_OPERATION_DATAREAD 3 -#define XPF_TLB_CHECK_OPERATION_DATAWRITE 4 -#define XPF_TLB_CHECK_OPERATION_INSTRUCTIONFETCH 5 -#define XPF_TLB_CHECK_OPERATION_PREFETCH 6 - -typedef union _WHEA_XPF_TLB_CHECK { - struct { - ULONGLONG TransactionTypeValid:1; - ULONGLONG OperationValid:1; - ULONGLONG LevelValid:1; - ULONGLONG ProcessorContextCorruptValid:1; - ULONGLONG UncorrectedValid:1; - ULONGLONG PreciseIPValid:1; - ULONGLONG RestartableIPValid:1; - ULONGLONG OverflowValid:1; - ULONGLONG ReservedValid:8; - - ULONGLONG TransactionType:2; - ULONGLONG Operation:4; - ULONGLONG Level:3; - ULONGLONG ProcessorContextCorrupt:1; - ULONGLONG Uncorrected:1; - ULONGLONG PreciseIP:1; - ULONGLONG RestartableIP:1; - ULONGLONG Overflow:1; - ULONGLONG Reserved:34; - } DUMMYSTRUCTNAME; - ULONGLONG XpfTLBCheck; -} WHEA_XPF_TLB_CHECK, *PWHEA_XPF_TLB_CHECK; - -// -// x86/x64 bus check structure. -// - -#define XPF_BUS_CHECK_TRANSACTIONTYPE_INSTRUCTION 0 -#define XPF_BUS_CHECK_TRANSACTIONTYPE_DATAACCESS 1 -#define XPF_BUS_CHECK_TRANSACTIONTYPE_GENERIC 2 - -#define XPF_BUS_CHECK_OPERATION_GENERIC 0 -#define XPF_BUS_CHECK_OPERATION_GENREAD 1 -#define XPF_BUS_CHECK_OPERATION_GENWRITE 2 -#define XPF_BUS_CHECK_OPERATION_DATAREAD 3 -#define XPF_BUS_CHECK_OPERATION_DATAWRITE 4 -#define XPF_BUS_CHECK_OPERATION_INSTRUCTIONFETCH 5 -#define XPF_BUS_CHECK_OPERATION_PREFETCH 6 - -#define XPF_BUS_CHECK_PARTICIPATION_PROCORIGINATED 0 -#define XPF_BUS_CHECK_PARTICIPATION_PROCRESPONDED 1 -#define XPF_BUS_CHECK_PARTICIPATION_PROCOBSERVED 2 -#define XPF_BUS_CHECK_PARTICIPATION_GENERIC 3 - -#define XPF_BUS_CHECK_ADDRESS_MEMORY 0 -#define XPF_BUS_CHECK_ADDRESS_RESERVED 1 -#define XPF_BUS_CHECK_ADDRESS_IO 2 -#define XPF_BUS_CHECK_ADDRESS_OTHER 3 - -typedef union _WHEA_XPF_BUS_CHECK { - struct { - ULONGLONG TransactionTypeValid:1; - ULONGLONG OperationValid:1; - ULONGLONG LevelValid:1; - ULONGLONG ProcessorContextCorruptValid:1; - ULONGLONG UncorrectedValid:1; - ULONGLONG PreciseIPValid:1; - ULONGLONG RestartableIPValid:1; - ULONGLONG OverflowValid:1; - ULONGLONG ParticipationValid:1; - ULONGLONG TimeoutValid:1; - ULONGLONG AddressSpaceValid:1; - ULONGLONG ReservedValid:5; - - ULONGLONG TransactionType:2; - ULONGLONG Operation:4; - ULONGLONG Level:3; - ULONGLONG ProcessorContextCorrupt:1; - ULONGLONG Uncorrected:1; - ULONGLONG PreciseIP:1; - ULONGLONG RestartableIP:1; - ULONGLONG Overflow:1; - ULONGLONG Participation:2; - ULONGLONG Timeout:1; - ULONGLONG AddressSpace:2; - ULONGLONG Reserved:29; - } DUMMYSTRUCTNAME; - ULONGLONG XpfBusCheck; -} WHEA_XPF_BUS_CHECK, *PWHEA_XPF_BUS_CHECK; - -// -// x86/x64 micro-architecture specific check structure. -// - -#define XPF_MS_CHECK_ERRORTYPE_NOERROR 0 -#define XPF_MS_CHECK_ERRORTYPE_UNCLASSIFIED 1 -#define XPF_MS_CHECK_ERRORTYPE_MCROMPARITY 2 -#define XPF_MS_CHECK_ERRORTYPE_EXTERNAL 3 -#define XPF_MS_CHECK_ERRORTYPE_FRC 4 -#define XPF_MS_CHECK_ERRORTYPE_INTERNALUNCLASSIFIED 5 - -typedef union _WHEA_XPF_MS_CHECK { - struct { - ULONGLONG ErrorTypeValid:1; - ULONGLONG ProcessorContextCorruptValid:1; - ULONGLONG UncorrectedValid:1; - ULONGLONG PreciseIPValid:1; - ULONGLONG RestartableIPValid:1; - ULONGLONG OverflowValid:1; - ULONGLONG ReservedValue:10; - - ULONGLONG ErrorType:3; - ULONGLONG ProcessorContextCorrupt:1; - ULONGLONG Uncorrected:1; - ULONGLONG PreciseIP:1; - ULONGLONG RestartableIP:1; - ULONGLONG Overflow:1; - ULONGLONG Reserved:40; - } DUMMYSTRUCTNAME; - ULONGLONG XpfMsCheck; -} WHEA_XPF_MS_CHECK, *PWHEA_XPF_MS_CHECK; - -// -// x86/x64 Processor Error Information Structure. -// - -typedef union _WHEA_XPF_PROCINFO_VALIDBITS { - struct { - ULONGLONG CheckInfo:1; - ULONGLONG TargetId:1; - ULONGLONG RequesterId:1; - ULONGLONG ResponderId:1; - ULONGLONG InstructionPointer:1; - ULONGLONG Reserved:59; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_XPF_PROCINFO_VALIDBITS, *PWHEA_XPF_PROCINFO_VALIDBITS; - -typedef struct _WHEA_XPF_PROCINFO { - GUID CheckInfoId; - WHEA_XPF_PROCINFO_VALIDBITS ValidBits; - union { - WHEA_XPF_CACHE_CHECK CacheCheck; - WHEA_XPF_TLB_CHECK TlbCheck; - WHEA_XPF_BUS_CHECK BusCheck; - WHEA_XPF_MS_CHECK MsCheck; - ULONGLONG AsULONGLONG; - } CheckInfo; - ULONGLONG TargetId; - ULONGLONG RequesterId; - ULONGLONG ResponderId; - ULONGLONG InstructionPointer; -} WHEA_XPF_PROCINFO, *PWHEA_XPF_PROCINFO; - -// -// x86/x64 Processor Context Information Structure. -// - -typedef struct _WHEA_X86_REGISTER_STATE { - ULONG Eax; - ULONG Ebx; - ULONG Ecx; - ULONG Edx; - ULONG Esi; - ULONG Edi; - ULONG Ebp; - ULONG Esp; - USHORT Cs; - USHORT Ds; - USHORT Ss; - USHORT Es; - USHORT Fs; - USHORT Gs; - ULONG Eflags; - ULONG Eip; - ULONG Cr0; - ULONG Cr1; - ULONG Cr2; - ULONG Cr3; - ULONG Cr4; - ULONGLONG Gdtr; - ULONGLONG Idtr; - USHORT Ldtr; - USHORT Tr; -} WHEA_X86_REGISTER_STATE, *PWHEA_X86_REGISTER_STATE; - -typedef struct DECLSPEC_ALIGN(16) _WHEA128A { - ULONGLONG Low; - LONGLONG High; -} WHEA128A, *PWHEA128A; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#pragma warning(disable:4324) // structure padded due to __declspec(align()) -#endif -#endif - -typedef struct _WHEA_X64_REGISTER_STATE { - ULONGLONG Rax; - ULONGLONG Rbx; - ULONGLONG Rcx; - ULONGLONG Rdx; - ULONGLONG Rsi; - ULONGLONG Rdi; - ULONGLONG Rbp; - ULONGLONG Rsp; - ULONGLONG R8; - ULONGLONG R9; - ULONGLONG R10; - ULONGLONG R11; - ULONGLONG R12; - ULONGLONG R13; - ULONGLONG R14; - ULONGLONG R15; - USHORT Cs; - USHORT Ds; - USHORT Ss; - USHORT Es; - USHORT Fs; - USHORT Gs; - ULONG Reserved; - ULONGLONG Rflags; - ULONGLONG Eip; - ULONGLONG Cr0; - ULONGLONG Cr1; - ULONGLONG Cr2; - ULONGLONG Cr3; - ULONGLONG Cr4; - ULONGLONG Cr8; - WHEA128A Gdtr; - WHEA128A Idtr; - USHORT Ldtr; - USHORT Tr; -} WHEA_X64_REGISTER_STATE, *PWHEA_X64_REGISTER_STATE; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#endif -#endif - -#define XPF_CONTEXT_INFO_UNCLASSIFIEDDATA 0 -#define XPF_CONTEXT_INFO_MSRREGISTERS 1 -#define XPF_CONTEXT_INFO_32BITCONTEXT 2 -#define XPF_CONTEXT_INFO_64BITCONTEXT 3 -#define XPF_CONTEXT_INFO_FXSAVE 4 -#define XPF_CONTEXT_INFO_32BITDEBUGREGS 5 -#define XPF_CONTEXT_INFO_64BITDEBUGREGS 6 -#define XPF_CONTEXT_INFO_MMREGISTERS 7 - -typedef struct _WHEA_XPF_CONTEXT_INFO { - USHORT RegisterContextType; - USHORT RegisterDataSize; - ULONG MSRAddress; - ULONGLONG MmRegisterAddress; - - // - // UCHAR RegisterData[ANYSIZE_ARRAY]; - // - -} WHEA_XPF_CONTEXT_INFO, *PWHEA_XPF_CONTEXT_INFO; - -// -// x86/x64 Processor Error Section -// - -typedef union _WHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG LocalAPICId:1; - ULONGLONG CpuId:1; - ULONGLONG ProcInfoCount:6; - ULONGLONG ContextInfoCount:6; - ULONGLONG Reserved:50; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS, - *PWHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS; - -typedef struct _WHEA_XPF_PROCESSOR_ERROR_SECTION { - WHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS ValidBits; - ULONGLONG LocalAPICId; - UCHAR CpuId[48]; - - // - // WHEA_XPF_PROCINFO ProcInfo[ANYSIZE_ARRAY]; - // WHEA_XPF_CONTEXT_INFO ContextInfo[ANYSIZE_ARRAY]; - // - - UCHAR VariableInfo[ANYSIZE_ARRAY]; -} WHEA_XPF_PROCESSOR_ERROR_SECTION, *PWHEA_XPF_PROCESSOR_ERROR_SECTION; - -// -// Define alternate type names for downlevel source compatibility. -// - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef struct WHEA_XPF_PROCESSOR_ERROR_SECTION_VALIDBITS - WHEA_XPF_PROCESSOR_ERROR_VALIDBITS, *PWHEA_XPF_PROCESSOR_ERROR_VALIDBITS; - -typedef struct WHEA_XPF_PROCESSOR_ERROR_SECTION - WHEA_XPF_PROCESSOR_ERROR, *PWHEA_XPF_PROCESSOR_ERROR; - -#endif - -// -// Validate the x86/x64 processor error section structures against the -// definitions in the UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, CheckInfoId, 0, 16); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, ValidBits, 16, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, CheckInfo, 24, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, TargetId, 32, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, RequesterId, 40, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, ResponderId, 48, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCINFO, InstructionPointer, 56, 8); - -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Eax, 0, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ebx, 4, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ecx, 8, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Edx, 12, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Esi, 16, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Edi, 20, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ebp, 24, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Esp, 28, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cs, 32, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ds, 34, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ss, 36, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Es, 38, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Fs, 40, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Gs, 42, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Eflags, 44, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Eip, 48, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cr0, 52, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cr1, 56, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cr2, 60, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cr3, 64, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Cr4, 68, 4); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Gdtr, 72, 8); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Idtr, 80, 8); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Ldtr, 88, 2); -CPER_FIELD_CHECK(WHEA_X86_REGISTER_STATE, Tr, 90, 2); - -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rax, 0, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rbx, 8, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rcx, 16, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rdx, 24, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rsi, 32, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rdi, 40, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rbp, 48, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rsp, 56, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R8, 64, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R9, 72, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R10, 80, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R11, 88, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R12, 96, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R13, 104, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R14, 112, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, R15, 120, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cs, 128, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Ds, 130, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Ss, 132, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Es, 134, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Fs, 136, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Gs, 138, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Reserved, 140, 4); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Rflags, 144, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Eip, 152, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr0, 160, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr1, 168, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr2, 176, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr3, 184, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr4, 192, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Cr8, 200, 8); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Gdtr, 208, 16); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Idtr, 224, 16); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Ldtr, 240, 2); -CPER_FIELD_CHECK(WHEA_X64_REGISTER_STATE, Tr, 242, 2); - -CPER_FIELD_CHECK(WHEA_XPF_CONTEXT_INFO, RegisterContextType, 0, 2); -CPER_FIELD_CHECK(WHEA_XPF_CONTEXT_INFO, RegisterDataSize, 2, 2); -CPER_FIELD_CHECK(WHEA_XPF_CONTEXT_INFO, MSRAddress, 4, 4); -CPER_FIELD_CHECK(WHEA_XPF_CONTEXT_INFO, MmRegisterAddress, 8, 8); - -CPER_FIELD_CHECK(WHEA_XPF_PROCESSOR_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCESSOR_ERROR_SECTION, LocalAPICId, 8, 8); -CPER_FIELD_CHECK(WHEA_XPF_PROCESSOR_ERROR_SECTION, CpuId, 16, 48); -CPER_FIELD_CHECK(WHEA_XPF_PROCESSOR_ERROR_SECTION, VariableInfo, 64, ANYSIZE_ARRAY); - -//--------------------------------------------------- WHEA_MEMORY_ERROR_SECTION - -typedef union _WHEA_MEMORY_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG ErrorStatus:1; - ULONGLONG PhysicalAddress:1; - ULONGLONG PhysicalAddressMask:1; - ULONGLONG Node:1; - ULONGLONG Card:1; - ULONGLONG Module:1; - ULONGLONG Bank:1; - ULONGLONG Device:1; - ULONGLONG Row:1; - ULONGLONG Column:1; - ULONGLONG BitPosition:1; - ULONGLONG RequesterId:1; - ULONGLONG ResponderId:1; - ULONGLONG TargetId:1; - ULONGLONG ErrorType:1; - ULONGLONG Reserved:49; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_MEMORY_ERROR_SECTION_VALIDBITS, - *PWHEA_MEMORY_ERROR_SECTION_VALIDBITS; - -#define WHEA_MEMERRTYPE_UNKNOWN 0x00 -#define WHEA_MEMERRTYPE_NOERROR 0x01 -#define WHEA_MEMERRTYPE_SINGLEBITECC 0x02 -#define WHEA_MEMERRTYPE_MULTIBITECC 0x03 -#define WHEA_MEMERRTYPE_SINGLESYMCHIPKILL 0x04 -#define WHEA_MEMERRTYPE_MULTISYMCHIPKILL 0x05 -#define WHEA_MEMERRTYPE_MASTERABORT 0x06 -#define WHEA_MEMERRTYPE_TARGETABORT 0x07 -#define WHEA_MEMERRTYPE_PARITYERROR 0x08 -#define WHEA_MEMERRTYPE_WATCHDOGTIMEOUT 0x09 -#define WHEA_MEMERRTYPE_INVALIDADDRESS 0x0A -#define WHEA_MEMERRTYPE_MIRRORBROKEN 0x0B -#define WHEA_MEMERRTYPE_MEMORYSPARING 0x0C - -typedef struct _WHEA_MEMORY_ERROR_SECTION { - WHEA_MEMORY_ERROR_SECTION_VALIDBITS ValidBits; - WHEA_ERROR_STATUS ErrorStatus; - ULONGLONG PhysicalAddress; - ULONGLONG PhysicalAddressMask; - USHORT Node; - USHORT Card; - USHORT Module; - USHORT Bank; - USHORT Device; - USHORT Row; - USHORT Column; - USHORT BitPosition; - ULONGLONG RequesterId; - ULONGLONG ResponderId; - ULONGLONG TargetId; - UCHAR ErrorType; -} WHEA_MEMORY_ERROR_SECTION, *PWHEA_MEMORY_ERROR_SECTION; - -// -// Define alternate names allowing for downlevel source compatibility. -// - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_MEMORY_ERROR_SECTION_VALIDBITS - WHEA_MEMORY_ERROR_VALIDBITS, *PWHEA_MEMORY_ERROR_VALIDBITS; - -typedef WHEA_MEMORY_ERROR_SECTION - WHEA_MEMORY_ERROR, *PWHEA_MEMORY_ERROR; - -#endif - -// -// Validate the memory error section structures against the definitions in the -// UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, ErrorStatus, 8, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, PhysicalAddress, 16, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, PhysicalAddressMask, 24, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Node, 32, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Card, 34, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Module, 36, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Bank, 38, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Device, 40, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Row, 42, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, Column, 44, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, BitPosition, 46, 2); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, RequesterId, 48, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, ResponderId, 56, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, TargetId, 64, 8); -CPER_FIELD_CHECK(WHEA_MEMORY_ERROR_SECTION, ErrorType, 72, 1); - -//----------------------------------------------- WHEA_PCIEXPRESS_ERROR_SECTION - -typedef union _WHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG PortType:1; - ULONGLONG Version:1; - ULONGLONG CommandStatus:1; - ULONGLONG DeviceId:1; - ULONGLONG DeviceSerialNumber:1; - ULONGLONG BridgeControlStatus:1; - ULONGLONG ExpressCapability:1; - ULONGLONG AerInfo:1; - ULONGLONG Reserved:56; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS, - *PWHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS; - -typedef struct _WHEA_PCIEXPRESS_DEVICE_ID { - USHORT VendorID; - USHORT DeviceID; - ULONG ClassCode:24; - ULONG FunctionNumber:8; - ULONG DeviceNumber:8; - ULONG Segment:16; - ULONG PrimaryBusNumber:8; - ULONG SecondaryBusNumber:8; - ULONG Reserved1:3; - ULONG SlotNumber:13; - ULONG Reserved2:8; -} WHEA_PCIEXPRESS_DEVICE_ID, *PWHEA_PCIEXPRESS_DEVICE_ID; - -typedef union _WHEA_PCIEXPRESS_VERSION { - struct { - UCHAR MinorVersion; - UCHAR MajorVersion; - USHORT Reserved; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_PCIEXPRESS_VERSION, *PWHEA_PCIEXPRESS_VERSION; - -typedef union _WHEA_PCIEXPRESS_COMMAND_STATUS { - struct { - USHORT Command; - USHORT Status; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_PCIEXPRESS_COMMAND_STATUS, *PWHEA_PCIEXPRESS_COMMAND_STATUS; - -typedef union _WHEA_PCIEXPRESS_BRIDGE_CONTROL_STATUS { - struct { - USHORT BridgeSecondaryStatus; - USHORT BridgeControl; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_PCIEXPRESS_BRIDGE_CONTROL_STATUS, - *PWHEA_PCIEXPRESS_BRIDGE_CONTROL_STATUS; - -typedef enum _WHEA_PCIEXPRESS_DEVICE_TYPE { - WheaPciExpressEndpoint = 0, - WheaPciExpressLegacyEndpoint, - WheaPciExpressRootPort = 4, - WheaPciExpressUpstreamSwitchPort, - WheaPciExpressDownstreamSwitchPort, - WheaPciExpressToPciXBridge, - WheaPciXToExpressBridge, - WheaPciExpressRootComplexIntegratedEndpoint, - WheaPciExpressRootComplexEventCollector -} WHEA_PCIEXPRESS_DEVICE_TYPE; - -typedef struct _WHEA_PCIEXPRESS_ERROR_SECTION { - WHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS ValidBits; - WHEA_PCIEXPRESS_DEVICE_TYPE PortType; - WHEA_PCIEXPRESS_VERSION Version; - WHEA_PCIEXPRESS_COMMAND_STATUS CommandStatus; - ULONG Reserved; - WHEA_PCIEXPRESS_DEVICE_ID DeviceId; - ULONGLONG DeviceSerialNumber; - WHEA_PCIEXPRESS_BRIDGE_CONTROL_STATUS BridgeControlStatus; - UCHAR ExpressCapability[60]; - UCHAR AerInfo[96]; -} WHEA_PCIEXPRESS_ERROR_SECTION, *PWHEA_PCIEXPRESS_ERROR_SECTION; - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_PCIEXPRESS_ERROR_SECTION_VALIDBITS - WHEA_PCIEXPRESS_ERROR_VALIDBITS, - *PWHEA_PCIEXPRESS_ERROR_VALIDBITS; - -typedef WHEA_PCIEXPRESS_ERROR_SECTION - WHEA_PCIEXPRESS_ERROR, *PWHEA_PCIEXPRESS_ERROR; - -#endif - -// -// Validate the PCI Express error section structures against the definitions -// in the UEFI specification. -// - -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, PortType, 8, 4); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, Version, 12, 4); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, CommandStatus, 16, 4); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, Reserved, 20, 4); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, DeviceId, 24, 16); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, DeviceSerialNumber, 40, 8); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, BridgeControlStatus, 48, 4); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, ExpressCapability, 52, 60); -CPER_FIELD_CHECK(WHEA_PCIEXPRESS_ERROR_SECTION, AerInfo, 112, 96); - -//-------------------------------------------------- WHEA_PCIXBUS_ERROR_SECTION - -#define PCIXBUS_ERRTYPE_UNKNOWN 0x0000 -#define PCIXBUS_ERRTYPE_DATAPARITY 0x0001 -#define PCIXBUS_ERRTYPE_SYSTEM 0x0002 -#define PCIXBUS_ERRTYPE_MASTERABORT 0x0003 -#define PCIXBUS_ERRTYPE_BUSTIMEOUT 0x0004 -#define PCIXBUS_ERRTYPE_MASTERDATAPARITY 0x0005 -#define PCIXBUS_ERRTYPE_ADDRESSPARITY 0x0006 -#define PCIXBUS_ERRTYPE_COMMANDPARITY 0x0007 - -typedef union _WHEA_PCIXBUS_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG ErrorStatus:1; - ULONGLONG ErrorType:1; - ULONGLONG BusId:1; - ULONGLONG BusAddress:1; - ULONGLONG BusData:1; - ULONGLONG BusCommand:1; - ULONGLONG RequesterId:1; - ULONGLONG CompleterId:1; - ULONGLONG TargetId:1; - ULONGLONG Reserved:55; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_PCIXBUS_ERROR_SECTION_VALIDBITS, *PWHEA_PCIXBUS_ERROR_SECTION_VALIDBITS; - -typedef union _WHEA_PCIXBUS_ID { - struct { - UCHAR BusNumber; - UCHAR BusSegment; - } DUMMYSTRUCTNAME; - USHORT AsUSHORT; -} WHEA_PCIXBUS_ID, *PWHEA_PCIXBUS_ID; - -typedef union _WHEA_PCIXBUS_COMMAND { - struct { - ULONGLONG Command:56; - ULONGLONG PCIXCommand:1; - ULONGLONG Reserved:7; - } DUMMYSTRUCTNAME; - ULONGLONG AsULONGLONG; -} WHEA_PCIXBUS_COMMAND, *PWHEA_PCIXBUS_COMMAND; - -typedef struct _WHEA_PCIXBUS_ERROR_SECTION { - WHEA_PCIXBUS_ERROR_SECTION_VALIDBITS ValidBits; - WHEA_ERROR_STATUS ErrorStatus; - USHORT ErrorType; - WHEA_PCIXBUS_ID BusId; - ULONG Reserved; - ULONGLONG BusAddress; - ULONGLONG BusData; - WHEA_PCIXBUS_COMMAND BusCommand; - ULONGLONG RequesterId; - ULONGLONG CompleterId; - ULONGLONG TargetId; -} WHEA_PCIXBUS_ERROR_SECTION, *PWHEA_PCIXBUS_ERROR_SECTION; - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_PCIXBUS_ERROR_SECTION_VALIDBITS - WHEA_PCIXBUS_ERROR_VALIDBITS, - *PWHEA_PCIXBUS_ERROR_VALIDBITS; - -typedef WHEA_PCIXBUS_ERROR_SECTION - WHEA_PCIXBUS_ERROR, *PWHEA_PCIXBUS_ERROR; - -#endif - -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, ErrorStatus, 8, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, ErrorType, 16, 2); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, BusId, 18, 2); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, Reserved, 20, 4); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, BusAddress, 24, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, BusData, 32, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, BusCommand, 40, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, RequesterId, 48, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, CompleterId, 56, 8); -CPER_FIELD_CHECK(WHEA_PCIXBUS_ERROR_SECTION, TargetId, 64, 8); - -//----------------------------------------------- WHEA_PCIXDEVICE_ERROR_SECTION - -typedef union _WHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS { - struct { - ULONGLONG ErrorStatus:1; - ULONGLONG IdInfo:1; - ULONGLONG MemoryNumber:1; - ULONGLONG IoNumber:1; - ULONGLONG RegisterDataPairs:1; - ULONGLONG Reserved:59; - } DUMMYSTRUCTNAME; - ULONGLONG ValidBits; -} WHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS, - *PWHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS; - -typedef struct _WHEA_PCIXDEVICE_ID { - USHORT VendorId; - USHORT DeviceId; - ULONG ClassCode:24; - ULONG FunctionNumber:8; - ULONG DeviceNumber:8; - ULONG BusNumber:8; - ULONG SegmentNumber:8; - ULONG Reserved1:8; - ULONG Reserved2; -} WHEA_PCIXDEVICE_ID, *PWHEA_PCIXDEVICE_ID; - -typedef struct WHEA_PCIXDEVICE_REGISTER_PAIR { - ULONGLONG Register; - ULONGLONG Data; -} WHEA_PCIXDEVICE_REGISTER_PAIR, *PWHEA_PCIXDEVICE_REGISTER_PAIR; - -typedef struct _WHEA_PCIXDEVICE_ERROR_SECTION { - WHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS ValidBits; - WHEA_ERROR_STATUS ErrorStatus; - WHEA_PCIXDEVICE_ID IdInfo; - ULONG MemoryNumber; - ULONG IoNumber; - WHEA_PCIXDEVICE_REGISTER_PAIR RegisterDataPairs[ANYSIZE_ARRAY]; -} WHEA_PCIXDEVICE_ERROR_SECTION, *PWHEA_PCIXDEVICE_ERROR_SECTION; - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_PCIXDEVICE_ERROR_SECTION_VALIDBITS - WHEA_PCIXDEVICE_ERROR_VALIDBITS, *PWHEA_PCIXDEVICE_ERROR_VALIDBITS; - -typedef WHEA_PCIXDEVICE_ERROR_SECTION - WHEA_PCIXDEVICE_ERROR, *PWHEA_PCIXDEVICE_ERROR; - -#endif - -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, ValidBits, 0, 8); -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, ErrorStatus, 8, 8); -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, IdInfo, 16, 16); -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, MemoryNumber, 32, 4); -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, IoNumber, 36, 4); -CPER_FIELD_CHECK(WHEA_PCIXDEVICE_ERROR_SECTION, RegisterDataPairs, 40, 16); - -//---------------------------------------- WHEA_FIRMWARE_ERROR_RECORD_REFERENCE - -#define WHEA_FIRMWARE_RECORD_TYPE_IPFSAL 0 - -typedef struct _WHEA_FIRMWARE_ERROR_RECORD_REFERENCE { - UCHAR Type; - UCHAR Reserved[7]; - ULONGLONG FirmwareRecordId; -} WHEA_FIRMWARE_ERROR_RECORD_REFERENCE, *PWHEA_FIRMWARE_ERROR_RECORD_REFERENCE; - -#if WHEA_DOWNLEVEL_TYPE_NAMES - -typedef WHEA_FIRMWARE_ERROR_RECORD_REFERENCE - WHEA_FIRMWARE_RECORD, *PWHEA_FIRMWARE_RECORD; - -#endif - -CPER_FIELD_CHECK(WHEA_FIRMWARE_ERROR_RECORD_REFERENCE, Type, 0, 1); -CPER_FIELD_CHECK(WHEA_FIRMWARE_ERROR_RECORD_REFERENCE, Reserved, 1, 7); -CPER_FIELD_CHECK(WHEA_FIRMWARE_ERROR_RECORD_REFERENCE, FirmwareRecordId, 8, 8); - -// -// This is the start of the Microsoft specific extensions to the Common Platform -// Error Record specification. This is in accordance with Appendix N, section -// 2.3 of the Unified Extensible Firware Interface specification, which allows -// the specification of non-standard section bodies. -// - -//------------------------------------------------------------- XPF_MCA_SECTION - -typedef union _MCG_STATUS { - struct { - ULONG RestartIpValid:1; - ULONG ErrorIpValid:1; - ULONG MachineCheckInProgress:1; - ULONG Reserved1:29; - ULONG Reserved2; - } DUMMYSTRUCTNAME; - ULONGLONG QuadPart; -} MCG_STATUS, *PMCG_STATUS; - -typedef union _MCI_STATUS { - struct { - USHORT McaErrorCode; - USHORT ModelErrorCode; - ULONG OtherInformation : 23; - ULONG ActionRequired : 1; - ULONG Signalling : 1; - ULONG ContextCorrupt : 1; - ULONG AddressValid : 1; - ULONG MiscValid : 1; - ULONG ErrorEnabled : 1; - ULONG UncorrectedError : 1; - ULONG StatusOverFlow : 1; - ULONG Valid : 1; - } DUMMYSTRUCTNAME; - ULONG64 QuadPart; -} MCI_STATUS, *PMCI_STATUS; - -typedef enum _WHEA_CPU_VENDOR { - WheaCpuVendorOther = 0, - WheaCpuVendorIntel, - WheaCpuVendorAmd -} WHEA_CPU_VENDOR, *PWHEA_CPU_VENDOR; - -#define WHEA_XPF_MCA_EXTREG_MAX_COUNT 24 -#define WHEA_XPF_MCA_SECTION_VERSION 1 - -typedef struct _WHEA_XPF_MCA_SECTION { - ULONG VersionNumber; - WHEA_CPU_VENDOR CpuVendor; - LARGE_INTEGER Timestamp; - ULONG ProcessorNumber; - MCG_STATUS GlobalStatus; - ULONGLONG InstructionPointer; - ULONG BankNumber; - MCI_STATUS Status; - ULONGLONG Address; - ULONGLONG Misc; - ULONG ExtendedRegisterCount; - ULONG Reserved2; - ULONGLONG ExtendedRegisters[WHEA_XPF_MCA_EXTREG_MAX_COUNT]; -} WHEA_XPF_MCA_SECTION, *PWHEA_XPF_MCA_SECTION; - -//------------------------------------------------------ WHEA_NMI_ERROR_SECTION - -typedef union _WHEA_NMI_ERROR_SECTION_FLAGS { - struct { - ULONG HypervisorError:1; - ULONG Reserved:31; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_NMI_ERROR_SECTION_FLAGS, *PWHEA_NMI_ERROR_SECTION_FLAGS; - -typedef struct _WHEA_NMI_ERROR_SECTION { - UCHAR Data[8]; - WHEA_NMI_ERROR_SECTION_FLAGS Flags; -} WHEA_NMI_ERROR_SECTION, *PWHEA_NMI_ERROR_SECTION; - -#include - - -//-------------------------------------- Standard Error Notification Type GUIDs - -/* 2dce8bb1-bdd7-450e-b9ad-9cf4ebd4f890 */ -DEFINE_GUID(CMC_NOTIFY_TYPE_GUID, - 0x2dce8bb1, 0xbdd7, 0x450e, 0xb9, 0xad, - 0x9c, 0xf4, 0xeb, 0xd4, 0xf8, 0x90); - -/* 4e292f96-d843-4a55-a8c2-d481f27ebeee */ -DEFINE_GUID(CPE_NOTIFY_TYPE_GUID, - 0x4e292f96, 0xd843, 0x4a55, 0xa8, 0xc2, - 0xd4, 0x81, 0xf2, 0x7e, 0xbe, 0xee); - -/* e8f56ffe-919c-4cc5-ba88-65abe14913bb */ -DEFINE_GUID(MCE_NOTIFY_TYPE_GUID, - 0xe8f56ffe, 0x919c, 0x4cc5, 0xba, 0x88, - 0x65, 0xab, 0xe1, 0x49, 0x13, 0xbb); - -/* cf93c01f-1a16-4dfc-b8bc-9c4daf67c104 */ -DEFINE_GUID(PCIe_NOTIFY_TYPE_GUID, - 0xcf93c01f, 0x1a16, 0x4dfc, 0xb8, 0xbc, - 0x9c, 0x4d, 0xaf, 0x67, 0xc1, 0x04); - -/* cc5263e8-9308-454a-89d0-340bd39bc98e */ -DEFINE_GUID(INIT_NOTIFY_TYPE_GUID, - 0xcc5263e8, 0x9308, 0x454a, 0x89, 0xd0, - 0x34, 0x0b, 0xd3, 0x9b, 0xc9, 0x8e); - -/* 5bad89ff-b7e6-42c9-814a-cf2485d6e98a */ -DEFINE_GUID(NMI_NOTIFY_TYPE_GUID, - 0x5bad89ff, 0xb7e6, 0x42c9, 0x81, 0x4a, - 0xcf, 0x24, 0x85, 0xd6, 0xe9, 0x8a); - -/* 3d61a466-ab40-409a-a698-f362d464b38f */ -DEFINE_GUID(BOOT_NOTIFY_TYPE_GUID, - 0x3d61a466, 0xab40, 0x409a, 0xa6, 0x98, - 0xf3, 0x62, 0xd4, 0x64, 0xb3, 0x8f); - -//------------------------------------------- Standard Error Section type GUIDs - -/* 9876ccad-47b4-4bdb-b65e-16f193c4f3db */ -DEFINE_GUID(PROCESSOR_GENERIC_ERROR_SECTION_GUID, - 0x9876ccad, 0x47b4, 0x4bdb, 0xb6, 0x5e, - 0x16, 0xf1, 0x93, 0xc4, 0xf3, 0xdb); - -/* dc3ea0b0-a144-4797-b95b-53fa242b6e1d */ -DEFINE_GUID(XPF_PROCESSOR_ERROR_SECTION_GUID, - 0xdc3ea0b0, 0xa144, 0x4797, 0xb9, 0x5b, - 0x53, 0xfa, 0x24, 0x2b, 0x6e, 0x1d); - -/* e429faf1-3cb7-11d4-bca7-0080c73c8881 */ -DEFINE_GUID(IPF_PROCESSOR_ERROR_SECTION_GUID, - 0xe429faf1, 0x3cb7, 0x11d4, 0xbc, 0xa7, - 0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81); - -/* a5bc1114-6f64-4ede-b863-3e83ed7c83b1 */ -DEFINE_GUID(MEMORY_ERROR_SECTION_GUID, - 0xa5bc1114, 0x6f64, 0x4ede, 0xb8, 0x63, - 0x3e, 0x83, 0xed, 0x7c, 0x83, 0xb1); - -/* d995e954-bbc1-430f-ad91-b44dcb3c6f35 */ -DEFINE_GUID(PCIEXPRESS_ERROR_SECTION_GUID, - 0xd995e954, 0xbbc1, 0x430f, 0xad, 0x91, - 0xb4, 0x4d, 0xcb, 0x3c, 0x6f, 0x35); - -/* c5753963-3b84-4095-bf78-eddad3f9c9dd */ -DEFINE_GUID(PCIXBUS_ERROR_SECTION_GUID, - 0xc5753963, 0x3b84, 0x4095, 0xbf, 0x78, - 0xed, 0xda, 0xd3, 0xf9, 0xc9, 0xdd); - -/* eb5e4685-ca66-4769-b6a2-26068b001326 */ -DEFINE_GUID(PCIXDEVICE_ERROR_SECTION_GUID, - 0xeb5e4685, 0xca66, 0x4769, 0xb6, 0xa2, - 0x26, 0x06, 0x8b, 0x00, 0x13, 0x26); - -/* 81212a96-09ed-4996-9471-8d729c8e69ed */ -DEFINE_GUID(FIRMWARE_ERROR_RECORD_REFERENCE_GUID, - 0x81212a96, 0x09ed, 0x4996, 0x94, 0x71, - 0x8d, 0x72, 0x9c, 0x8e, 0x69, 0xed); - -//-------------------------------------- Processor check information type GUIDs - -/* a55701f5-e3ef-43de-ac72-249b573fad2c */ -DEFINE_GUID(WHEA_CACHECHECK_GUID, - 0xa55701f5, 0xe3ef, 0x43de, 0xac, 0x72, - 0x24, 0x9b, 0x57, 0x3f, 0xad, 0x2c); - -/* fc06b535-5e1f-4562-9f25-0a3b9adb63c3 */ -DEFINE_GUID(WHEA_TLBCHECK_GUID, - 0xfc06b535, 0x5e1f, 0x4562, 0x9f, 0x25, - 0x0a, 0x3b, 0x9a, 0xdb, 0x63, 0xc3); - -/* 1cf3f8b3-c5b1-49a2-aa59-5eef92ffa63c */ -DEFINE_GUID(WHEA_BUSCHECK_GUID, - 0x1cf3f8b3, 0xc5b1, 0x49a2, 0xaa, 0x59, - 0x5e, 0xef, 0x92, 0xff, 0xa6, 0x3c); - -/* 48ab7f57-dc34-4f6c-a7d3-b0b5b0a74314 */ -DEFINE_GUID(WHEA_MSCHECK_GUID, - 0x48ab7f57, 0xdc34, 0x4f6c, 0xa7, 0xd3, - 0xb0, 0xb5, 0xb0, 0xa7, 0x43, 0x14); - -// -// This is the start of the Microsoft specific extensions to the Common Platform -// Error Record specification. This is in accordance with Appendix N, section -// 2.3 of the Unified Extensible Firware Interface specification, which allows -// the specification of non-standard section bodies. -// - -//---------------------------------------------------- Microsoft record creator - -/* cf07c4bd-b789-4e18-b3c4-1f732cb57131 */ -DEFINE_GUID(WHEA_RECORD_CREATOR_GUID, - 0xcf07c4bd, - 0xb789, 0x4e18, - 0xb3, 0xc4, 0x1f, 0x73, 0x2c, 0xb5, 0x71, 0x31); - -//--------------------------------------- Microsoft specific notification types - -/* 3e62a467-ab40-409a-a698-f362d464b38f */ -DEFINE_GUID(GENERIC_NOTIFY_TYPE_GUID, - 0x3e62a467, - 0xab40, 0x409a, - 0xa6, 0x98, 0xf3, 0x62, 0xd4, 0x64, 0xb3, 0x8f); - -//-------------------------------------- Microsoft specific error section types - -/* 6f3380d1-6eb0-497f-a578-4d4c65a71617 */ -DEFINE_GUID(IPF_SAL_RECORD_SECTION_GUID, - 0x6f3380d1, - 0x6eb0, 0x497f, - 0xa5, 0x78, 0x4d, 0x4c, 0x65, 0xa7, 0x16, 0x17); - -/* 8a1e1d01-42f9-4557-9c33-565e5cc3f7e8 */ -DEFINE_GUID(XPF_MCA_SECTION_GUID, - 0x8a1e1d01, - 0x42f9, 0x4557, - 0x9c, 0x33, 0x56, 0x5e, 0x5c, 0xc3, 0xf7, 0xe8); - -/* e71254e7-c1b9-4940-ab76-909703a4320f */ -DEFINE_GUID(NMI_SECTION_GUID, - 0xe71254e7, - 0xc1b9, 0x4940, - 0xab, 0x76, 0x90, 0x97, 0x03, 0xa4, 0x32, 0x0f); - -/* e71254e8-c1b9-4940-ab76-909703a4320f */ -DEFINE_GUID(GENERIC_SECTION_GUID, - 0xe71254e8, - 0xc1b9, 0x4940, - 0xab, 0x76, 0x90, 0x97, 0x03, 0xa4, 0x32, 0x0f); - -/* e71254e9-c1b9-4940-ab76-909703a4320f */ -DEFINE_GUID(WHEA_ERROR_PACKET_SECTION_GUID, - 0xe71254e9, - 0xc1b9, 0x4940, - 0xab, 0x76, 0x90, 0x97, 0x03, 0xa4, 0x32, 0x0f); - - -#include - -//----------------------------------------------------------- WHEA_ERROR_PACKET - -typedef enum _WHEA_ERROR_TYPE { - WheaErrTypeProcessor = 0, - WheaErrTypeMemory, - WheaErrTypePCIExpress, - WheaErrTypeNMI, - WheaErrTypePCIXBus, - WheaErrTypePCIXDevice, - WheaErrTypeGeneric -} WHEA_ERROR_TYPE, *PWHEA_ERROR_TYPE; - -typedef union _WHEA_ERROR_PACKET_FLAGS { - struct { - ULONG PreviousError:1; - ULONG Reserved1:1; - ULONG HypervisorError:1; - ULONG Simulated:1; - ULONG PlatformPfaControl:1; - ULONG PlatformDirectedOffline:1; - ULONG Reserved2:26; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_ERROR_PACKET_FLAGS, *PWHEA_ERROR_PACKET_FLAGS; - -typedef enum _WHEA_ERROR_PACKET_DATA_FORMAT { - WheaDataFormatIPFSalRecord = 0, - WheaDataFormatXPFMCA, - WheaDataFormatMemory, - WheaDataFormatPCIExpress, - WheaDataFormatNMIPort, - WheaDataFormatPCIXBus, - WheaDataFormatPCIXDevice, - WheaDataFormatGeneric, - WheaDataFormatMax -} WHEA_ERROR_PACKET_DATA_FORMAT, *PWHEA_ERROR_PACKET_DATA_FORMAT; - -typedef enum _WHEA_RAW_DATA_FORMAT { - WheaRawDataFormatIPFSalRecord = 0x00, - WheaRawDataFormatIA32MCA, - WheaRawDataFormatIntel64MCA, - WheaRawDataFormatAMD64MCA, - WheaRawDataFormatMemory, - WheaRawDataFormatPCIExpress, - WheaRawDataFormatNMIPort, - WheaRawDataFormatPCIXBus, - WheaRawDataFormatPCIXDevice, - WheaRawDataFormatGeneric, - WheaRawDataFormatMax -} WHEA_RAW_DATA_FORMAT, *PWHEA_RAW_DATA_FORMAT; - -typedef struct _WHEA_ERROR_PACKET_V1 { - ULONG Signature; // +0x00 (0) - WHEA_ERROR_PACKET_FLAGS Flags; // +0x04 (4) - ULONG Size; // +0x08 (8) - ULONG RawDataLength; // +0x0C (12) - ULONGLONG Reserved1; // +0x10 (16) - ULONGLONG Context; // +0x18 (24) - WHEA_ERROR_TYPE ErrorType; // +0x20 (32) - WHEA_ERROR_SEVERITY ErrorSeverity; // +0x24 (36) - ULONG ErrorSourceId; // +0x28 (40) - WHEA_ERROR_SOURCE_TYPE ErrorSourceType; // +0x2C (44) - ULONG Reserved2; // +0x30 (48) - ULONG Version; // +0x34 (52) - ULONGLONG Cpu; // +0x38 (56) - union { - WHEA_PROCESSOR_GENERIC_ERROR_SECTION ProcessorError; // +0x40 (64) - WHEA_MEMORY_ERROR_SECTION MemoryError; - WHEA_NMI_ERROR_SECTION NmiError; - WHEA_PCIEXPRESS_ERROR_SECTION PciExpressError; - WHEA_PCIXBUS_ERROR_SECTION PciXBusError; - WHEA_PCIXDEVICE_ERROR_SECTION PciXDeviceError; - } u; - WHEA_RAW_DATA_FORMAT RawDataFormat; // +0x110 (272) - ULONG RawDataOffset; // +0x114 (276) - UCHAR RawData[1]; // +0x118 (280) - -} WHEA_ERROR_PACKET_V1, *PWHEA_ERROR_PACKET_V1; - -#define WHEA_ERROR_PACKET_V1_SIGNATURE 'tPrE' -#define WHEA_ERROR_PACKET_V1_VERSION 2 - -typedef struct _WHEA_ERROR_PACKET_V2 { - ULONG Signature; - ULONG Version; - ULONG Length; - WHEA_ERROR_PACKET_FLAGS Flags; - WHEA_ERROR_TYPE ErrorType; - WHEA_ERROR_SEVERITY ErrorSeverity; - ULONG ErrorSourceId; - WHEA_ERROR_SOURCE_TYPE ErrorSourceType; - GUID NotifyType; - ULONGLONG Context; - WHEA_ERROR_PACKET_DATA_FORMAT DataFormat; - ULONG Reserved1; - ULONG DataOffset; - ULONG DataLength; - ULONG PshedDataOffset; - ULONG PshedDataLength; - // UCHAR Data[ANYSIZE_ARRAY]; - // UCHAR PshedData[ANYSIZE_ARRAY]; -} WHEA_ERROR_PACKET_V2, *PWHEA_ERROR_PACKET_V2; - -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Signature, 0, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Version, 4, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Length, 8, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Flags, 12, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, ErrorType, 16, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, ErrorSeverity, 20, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, ErrorSourceId, 24, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, ErrorSourceType, 28, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, NotifyType, 32, 16); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Context, 48, 8); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, DataFormat, 56, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, Reserved1, 60, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, DataOffset, 64, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, DataLength, 68, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, PshedDataOffset, 72, 4); -CPER_FIELD_CHECK(WHEA_ERROR_PACKET_V2, PshedDataLength, 76, 4); - -#define WHEA_ERROR_PACKET_V2_SIGNATURE 'AEHW' -#define WHEA_ERROR_PACKET_V2_VERSION 3 - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -#define WHEA_ERROR_PACKET_SIGNATURE WHEA_ERROR_PACKET_V2_SIGNATURE -#define WHEA_ERROR_PACKET_VERSION WHEA_ERROR_PACKET_V2_VERSION -typedef struct _WHEA_ERROR_PACKET_V2 WHEA_ERROR_PACKET, *PWHEA_ERROR_PACKET; - -#else - -#define WHEA_ERROR_PACKET_SIGNATURE WHEA_ERROR_PACKET_V1_SIGNATURE -#define WHEA_ERROR_PACKET_VERSION WHEA_ERROR_PACKET_V1_VERSION -#define WHEA_ERROR_PKT_SIGNATURE WHEA_ERROR_PACKET_SIGNATURE -#define WHEA_ERROR_PKT_VERSION WHEA_ERROR_PACKET_VERSION -typedef struct _WHEA_ERROR_PACKET_V1 WHEA_ERROR_PACKET, *PWHEA_ERROR_PACKET; - -#endif - -//---------------------------------------------------------- WHEA_GENERIC_ERROR - -// -// These structure define the data format that must be used by error sources -// when reporting errors of the generic error type. -// - -typedef union _WHEA_GENERIC_ERROR_BLOCKSTATUS { - struct { - ULONG UncorrectableError:1; - ULONG CorrectableError:1; - ULONG MultipleUncorrectableErrors:1; - ULONG MultipleCorrectableErrors:1; - ULONG ErrorDataEntryCount:10; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_GENERIC_ERROR_BLOCKSTATUS, *PWHEA_GENERIC_ERROR_BLOCKSTATUS; - -typedef struct _WHEA_GENERIC_ERROR { - WHEA_GENERIC_ERROR_BLOCKSTATUS BlockStatus; - ULONG RawDataOffset; - ULONG RawDataLength; - ULONG DataLength; - WHEA_ERROR_SEVERITY ErrorSeverity; - UCHAR Data[1]; -} WHEA_GENERIC_ERROR, *PWHEA_GENERIC_ERROR; - -typedef struct _WHEA_GENERIC_ERROR_DATA_ENTRY { - GUID SectionType; - WHEA_ERROR_SEVERITY ErrorSeverity; - WHEA_REVISION Revision; - UCHAR ValidBits; - UCHAR Flags; - ULONG ErrorDataLength; - GUID FRUId; - UCHAR FRUText[20]; - UCHAR Data[1]; -} WHEA_GENERIC_ERROR_DATA_ENTRY, *PWHEA_GENERIC_ERROR_DATA_ENTRY; - -#include - - -//----------------------------------------------- WheaGetErrPacketFromErrRecord - -__checkReturn -FORCEINLINE -PWHEA_ERROR_PACKET -WheaGetErrPacketFromErrRecord ( - __in PWHEA_ERROR_RECORD Record - ) - -/*++ - -Routine Description: - - This routine will search out the error packet contained within an error - record and return a reference to it. - -Arguments: - - Record - Supplies a pointer to the error record to be searched. - -Return Value: - - If successful, a pointer to the error packet. - - NULL otherwise. - ---*/ - -{ - - PWHEA_ERROR_PACKET Packet; - PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR Descriptor; - ULONG Section; - ULONG SizeRequired; - - Packet = NULL; - if (Record->Header.Signature != WHEA_ERROR_RECORD_SIGNATURE) { - goto GetErrPacketFromErrRecordEnd; - } - - // - // Calculate the size required for the header and section descriptors. - // Ensure that at least these will be properly contained within the extent - // of the error record. - // - - SizeRequired = sizeof(WHEA_ERROR_RECORD_HEADER) + - (sizeof(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR) * - Record->Header.SectionCount); - - if (Record->Header.Length < SizeRequired) { - goto GetErrPacketFromErrRecordEnd; - } - - // - // Step through the section descriptors looking for the error packet. If the - // error packet descriptor is found, ensure that the error packet section is - // properly contained within the extent of the error record. - // - - Descriptor = &Record->SectionDescriptor[0]; - for (Section = 0; Section < Record->Header.SectionCount; Section += 1) { - - if (RtlCompareMemory(&Descriptor->SectionType, - &WHEA_ERROR_PACKET_SECTION_GUID, - sizeof(GUID)) == sizeof(GUID)) { - - SizeRequired = Descriptor->SectionOffset + - Descriptor->SectionLength; - - if (Record->Header.Length < SizeRequired) { - goto GetErrPacketFromErrRecordEnd; - } - - Packet = (PWHEA_ERROR_PACKET) - (((PUCHAR)Record) + Descriptor->SectionOffset); - - if (Packet->Signature != WHEA_ERROR_PACKET_SIGNATURE) { - Packet = NULL; - } - - goto GetErrPacketFromErrRecordEnd; - } - - Descriptor += 1; - } - -GetErrPacketFromErrRecordEnd: - return Packet; -} - -//------------------------------------------- WHEA_ERROR_INJECTION_CAPABILITIES - -// -// PSHED plug-ins use this structure to communicate error injection capabilities -// to the operating system. -// - -typedef union _WHEA_ERROR_INJECTION_CAPABILITIES { - struct { - ULONG ProcessorCorrectable:1; // 0x00000001 - ULONG ProcessorUncorrectableNonFatal:1; // 0x00000002 - ULONG ProcessorUncorrectableFatal:1; // 0x00000004 - ULONG MemoryCorrectable:1; // 0x00000008 - ULONG MemoryUncorrectableNonFatal:1; // 0x00000010 - ULONG MemoryUncorrectableFatal:1; // 0x00000020 - ULONG PCIExpressCorrectable:1; // 0x00000040 - ULONG PCIExpressUncorrectableNonFatal:1; // 0x00000080 - ULONG PCIExpressUncorrectableFatal:1; // 0x00000100 - ULONG PlatformCorrectable:1; // 0x00000200 - ULONG PlatformUncorrectableNonFatal:1; // 0x00000400 - ULONG PlatformUncorrectableFatal:1; // 0x00000800 - ULONG IA64Corrected:1; // 0x00001000 - ULONG IA64Recoverable:1; // 0x00002000 - ULONG IA64Fatal:1; // 0x00004000 - ULONG IA64RecoverableCache:1; // 0x00008000 - ULONG IA64RecoverableRegFile:1; // 0x00010000 - ULONG Reserved:15; - } DUMMYSTRUCTNAME; - ULONG AsULONG; -} WHEA_ERROR_INJECTION_CAPABILITIES, *PWHEA_ERROR_INJECTION_CAPABILITIES; - -#define INJECT_ERRTYPE_PROCESSOR_CORRECTABLE 0x00000001 -#define INJECT_ERRTYPE_PROCESSOR_UNCORRECTABLENONFATAL 0x00000002 -#define INJECT_ERRTYPE_PROCESSOR_UNCORRECTABLEFATAL 0x00000004 -#define INJECT_ERRTYPE_MEMORY_CORRECTABLE 0x00000008 -#define INJECT_ERRTYPE_MEMORY_UNCORRECTABLENONFATAL 0x00000010 -#define INJECT_ERRTYPE_MEMORY_UNCORRECTABLEFATAL 0x00000020 -#define INJECT_ERRTYPE_PCIEXPRESS_CORRECTABLE 0x00000040 -#define INJECT_ERRTYPE_PCIEXPRESS_UNCORRECTABLENONFATAL 0x00000080 -#define INJECT_ERRTYPE_PCIEXPRESS_UNCORRECTABLEFATAL 0x00000100 -#define INJECT_ERRTYPE_PLATFORM_CORRECTABLE 0x00000200 -#define INJECT_ERRTYPE_PLATFORM_UNCORRECTABLENONFATAL 0x00000400 -#define INJECT_ERRTYPE_PLATFORM_UNCORRECTABLEFATAL 0x00000800 - - -//------------------------------------------------ PSHED Plug-in Callback Types - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_GET_ALL_ERROR_SOURCES) ( - __inout_opt PVOID PluginContext, - __inout PULONG Count, - __inout_bcount(*Length) PWHEA_ERROR_SOURCE_DESCRIPTOR *ErrorSrcs, - __inout PULONG Length - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_GET_ERROR_SOURCE_INFO) ( - __inout_opt PVOID PluginContext, - __inout PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_SET_ERROR_SOURCE_INFO) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource - ); - -typedef -NTSTATUS - (*PSHED_PI_ENABLE_ERROR_SOURCE) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource - ); - -typedef -NTSTATUS - (*PSHED_PI_DISABLE_ERROR_SOURCE) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource - ); - -typedef -NTSTATUS -(*PSHED_PI_WRITE_ERROR_RECORD) ( - __inout_opt PVOID PluginContext, - __in ULONG Flags, - __in ULONG RecordLength, - __in_bcount(RecordLength) PWHEA_ERROR_RECORD ErrorRecord - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_READ_ERROR_RECORD) ( - __inout_opt PVOID PluginContext, - __in ULONG Flags, - __in ULONGLONG ErrorRecordId, - __out PULONGLONG NextErrorRecordId, - __inout PULONG RecordLength, - __out_bcount(*RecordLength) PWHEA_ERROR_RECORD ErrorRecord - ); - -typedef -NTSTATUS -(*PSHED_PI_CLEAR_ERROR_RECORD) ( - __inout_opt PVOID PluginContext, - __in ULONG Flags, - __in ULONGLONG ErrorRecordId - ); - -typedef -NTSTATUS -(*PSHED_PI_RETRIEVE_ERROR_INFO) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, - __in ULONGLONG BufferLength, - __inout_bcount(BufferLength) PWHEA_ERROR_PACKET Packet - ); - -typedef -NTSTATUS -(*PSHED_PI_FINALIZE_ERROR_RECORD) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, - __in ULONG BufferLength, - __inout_bcount(BufferLength) PWHEA_ERROR_RECORD ErrorRecord - ); - -typedef -NTSTATUS -(*PSHED_PI_CLEAR_ERROR_STATUS) ( - __inout_opt PVOID PluginContext, - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, - __in ULONG BufferLength, - __in_bcount(BufferLength) PWHEA_ERROR_RECORD ErrorRecord - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_ATTEMPT_ERROR_RECOVERY) ( - __inout_opt PVOID PluginContext, - __in ULONG BufferLength, - __in_bcount(BufferLength) PWHEA_ERROR_RECORD ErrorRecord - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_GET_INJECTION_CAPABILITIES) ( - __inout_opt PVOID PluginContext, - __out PWHEA_ERROR_INJECTION_CAPABILITIES Capabilities - ); - -__checkReturn -typedef -NTSTATUS -(*PSHED_PI_INJECT_ERROR) ( - __inout_opt PVOID PluginContext, - __in ULONGLONG ErrorType, - __in ULONGLONG Parameter1, - __in ULONGLONG Parameter2, - __in ULONGLONG Parameter3, - __in ULONGLONG Parameter4 - ); - -//--------------------------------------- WHEA_PSHED_PLUGIN_REGISTRATION_PACKET - -typedef struct _WHEA_PSHED_PLUGIN_CALLBACKS { - PSHED_PI_GET_ALL_ERROR_SOURCES GetAllErrorSources; - PVOID Reserved; - PSHED_PI_GET_ERROR_SOURCE_INFO GetErrorSourceInfo; - PSHED_PI_SET_ERROR_SOURCE_INFO SetErrorSourceInfo; - PSHED_PI_ENABLE_ERROR_SOURCE EnableErrorSource; - PSHED_PI_DISABLE_ERROR_SOURCE DisableErrorSource; - PSHED_PI_WRITE_ERROR_RECORD WriteErrorRecord; - PSHED_PI_READ_ERROR_RECORD ReadErrorRecord; - PSHED_PI_CLEAR_ERROR_RECORD ClearErrorRecord; - PSHED_PI_RETRIEVE_ERROR_INFO RetrieveErrorInfo; - PSHED_PI_FINALIZE_ERROR_RECORD FinalizeErrorRecord; - PSHED_PI_CLEAR_ERROR_STATUS ClearErrorStatus; - PSHED_PI_ATTEMPT_ERROR_RECOVERY AttemptRecovery; - PSHED_PI_GET_INJECTION_CAPABILITIES GetInjectionCapabilities; - PSHED_PI_INJECT_ERROR InjectError; -} WHEA_PSHED_PLUGIN_CALLBACKS, *PWHEA_PSHED_PLUGIN_CALLBACKS; - -typedef struct _WHEA_PSHED_PLUGIN_REGISTRATION_PACKET { - ULONG Length; - ULONG Version; - PVOID Context; - ULONG FunctionalAreaMask; - ULONG Reserved; - WHEA_PSHED_PLUGIN_CALLBACKS Callbacks; -} WHEA_PSHED_PLUGIN_REGISTRATION_PACKET, - *PWHEA_PSHED_PLUGIN_REGISTRATION_PACKET; - -#define WHEA_PLUGIN_REGISTRATION_PACKET_VERSION 0x00010000 - -// -// These defines specify the values of the bits in the functional area mask -// field of the PSHED plug-in registration packet. -// - -#define PshedFADiscovery 0x00000001 -#define PshedFAErrorSourceControl 0x00000002 -#define PshedFAErrorRecordPersistence 0x00000004 -#define PshedFAErrorInfoRetrieval 0x00000008 -#define PshedFAErrorRecovery 0x00000010 -#define PshedFAErrorInjection 0x00000020 - -//------------------------------------------------------ PSHED Plug-in services - -#define WHEA_WRITE_FLAG_DUMMY 0x00000001 - -// -// The following services are exported by the PSHED for use by PSHED plug-ins. -// - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_allocatesMem(Mem) -__bcount(Size) -__checkReturn -PVOID -PshedAllocateMemory ( - __in ULONG Size - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -PshedFreeMemory ( - __in __drv_freesMem(Mem) PVOID Address - ); - -BOOLEAN -PshedIsSystemWheaEnabled ( - VOID - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -PshedRegisterPlugin ( - __inout PWHEA_PSHED_PLUGIN_REGISTRATION_PACKET Packet - ); - -BOOLEAN -PshedSynchronizeExecution ( - __in PWHEA_ERROR_SOURCE_DESCRIPTOR ErrorSource, - __in PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, - __in PVOID SynchronizeContext - ); - -//----------------------------------------------- Error record access functions - -__checkReturn -FORCEINLINE -BOOLEAN -WheaIsValidErrorRecordSignature ( - __in PWHEA_ERROR_RECORD Record - ) - -/*++ - -Routine Description: - - This routine will compare the error record signature with the proper values - and signal whether it is correct or not. - -Arguments: - - Record - Supplies a pointer to the error record. - -Return Value: - - TRUE if the error record signature is correct. - - FALSE otherwise. - ---*/ - -{ - - BOOLEAN Valid; - - if ((Record->Header.Signature == WHEA_ERROR_RECORD_SIGNATURE) && - (Record->Header.Revision.AsUSHORT == WHEA_ERROR_RECORD_REVISION) && - (Record->Header.SignatureEnd == WHEA_ERROR_RECORD_SIGNATURE_END)) { - - Valid = TRUE; - - } else { - Valid = FALSE; - } - - return Valid; -} - -__checkReturn -FORCEINLINE -NTSTATUS -WheaFindErrorRecordSection ( - __in PWHEA_ERROR_RECORD Record, - __in const GUID *SectionType, - __out PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR *SectionDescriptor, - __out_opt PVOID *SectionData - ) - -/*++ - -Routine Description: - - This routine provides a means to search an error record for a specific - section. - -Arguments: - - Record - Supplies a pointer to the error record. - - SectionType - Supplies a GUID specifying the section being sought. This may - be any standard common platform error record or implementation specific - section type. - - Descriptor - Supplies a location in which a pointer to the descriptor for - the found section is returned. - - Section - Supplies an optional location in which a pointer to the found - section is returned. - -Return Value: - - STATUS_SUCCESS if the specified section is found. - - STATUS_NOT_FOUND if the specified section is not found. - - STATUS_INVALID_PARAMETER if the record does not appear well formed or the - context parameter is null in cases where it is required. - ---*/ - -{ - - NTSTATUS Status; - PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR Descriptor; - ULONG Index; - ULONG MinimumLength; - - if ((Record == NULL) || - (SectionType == NULL) || - (SectionDescriptor == NULL) || - (WheaIsValidErrorRecordSignature(Record) == FALSE) || - (Record->Header.SectionCount == 0)) { - - Status = STATUS_INVALID_PARAMETER; - goto FindErrorRecordSectionEnd; - } - - // - // Ensure that the supplied record is at least as long as required to store - // the descriptors for the sections supposedly in the record. - // - - MinimumLength = sizeof(WHEA_ERROR_RECORD_HEADER) + - (Record->Header.SectionCount * - sizeof(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR)); - - if (Record->Header.Length < MinimumLength) { - Status = STATUS_INVALID_PARAMETER; - goto FindErrorRecordSectionEnd; - } - - // - // Iterate through the record searching for the section in question. - // - - Descriptor = &Record->SectionDescriptor[0]; - for (Index = 0; Index < Record->Header.SectionCount; Index += 1) { - if (RtlCompareMemory(&Descriptor->SectionType, - SectionType, - sizeof(GUID)) == sizeof(GUID)) { - - break; - } - - Descriptor += 1; - } - - if (Index >= Record->Header.SectionCount) { - Status = STATUS_NOT_FOUND; - goto FindErrorRecordSectionEnd; - } - - // - // If the descriptor describes a section that is not completely contained - // within the record then the record is invalid. - // - - if ((Descriptor->SectionOffset + Descriptor->SectionLength) > - Record->Header.Length) { - - Status = STATUS_INVALID_PARAMETER; - goto FindErrorRecordSectionEnd; - } - - // - // Return the descriptor and optionally a pointer to the section itself. - // - - *SectionDescriptor = Descriptor; - if (SectionData != NULL) { - *SectionData = (PVOID)(((PUCHAR)Record) + Descriptor->SectionOffset); - } - - Status = STATUS_SUCCESS; - -FindErrorRecordSectionEnd: - return Status; -} - -__checkReturn -FORCEINLINE -NTSTATUS -WheaFindNextErrorRecordSection ( - __in PWHEA_ERROR_RECORD Record, - __inout ULONG *Context, - __out PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR *SectionDescriptor, - __out_opt PVOID *SectionData - ) - -/*++ - -Routine Description: - - This routine allows the caller to iterate through the sections in an error - record. - -Arguments: - - Record - Supplies a pointer to the error record. - - Context - Supplies a pointer to a variable that maintains the current state - of the search. This variable should be zero for the first call, and the - same variable should be used in subsequent calls to enumerate the next - sections in the record. - - Descriptor - Supplies a location in which a pointer to the descriptor for - the found section is returned. - - Section - Supplies an optional location in which a pointer to the found - section is returned. - -Return Value: - - STATUS_SUCCESS if the specified section is found. - - STATUS_NOT_FOUND if the specified section is not found. - - STATUS_INVALID_PARAMETER if the record does not appear well formed or a - required parameter is null. - ---*/ - -{ - - NTSTATUS Status; - PWHEA_ERROR_RECORD_SECTION_DESCRIPTOR Descriptor; - ULONG Index; - ULONG MinimumLength; - - if ((Record == NULL) || - (Context == NULL) || - (SectionDescriptor == NULL) || - (WheaIsValidErrorRecordSignature(Record) == FALSE) || - (Record->Header.SectionCount == 0)) { - - Status = STATUS_INVALID_PARAMETER; - goto FindNextErrorRecordSectionEnd; - } - - // - // Ensure that the supplied record is at least as long as required to store - // the descriptors for the sections supposedly in the record. - // - - MinimumLength = sizeof(WHEA_ERROR_RECORD_HEADER) + - (Record->Header.SectionCount * - sizeof(WHEA_ERROR_RECORD_SECTION_DESCRIPTOR)); - - if (Record->Header.Length < MinimumLength) { - Status = STATUS_INVALID_PARAMETER; - goto FindNextErrorRecordSectionEnd; - } - - // - // If the index is greater than the number of sections, then it has been - // incorrectly fabricated by the caller or the record had section removed - // during the enumeration. Either way, this is different to the case where - // there are no sections left. - // - - Index = *Context; - if (Index > Record->Header.SectionCount) { - Status = STATUS_INVALID_PARAMETER; - goto FindNextErrorRecordSectionEnd; - } - - if (Index == Record->Header.SectionCount) { - Status = STATUS_NOT_FOUND; - goto FindNextErrorRecordSectionEnd; - } - - Descriptor = &Record->SectionDescriptor[Index]; - - // - // If the descriptor describes a section that is not completely contained - // within the record then the record is invalid. - // - - if ((Descriptor->SectionOffset + Descriptor->SectionLength) > - Record->Header.Length) { - - Status = STATUS_INVALID_PARAMETER; - goto FindNextErrorRecordSectionEnd; - } - - *Context = Index + 1; - *SectionDescriptor = Descriptor; - if (SectionData != NULL) { - *SectionData = (PVOID)(((PUCHAR)Record) + Descriptor->SectionOffset); - } - - Status = STATUS_SUCCESS; - -FindNextErrorRecordSectionEnd: - return Status; -} - - - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4115) -#pragma warning(default:4201) -#pragma warning(default:4214) -#endif - -#endif // _NTDDK_ - diff --git a/qt-correction-tool/pub/ddk/ntddnlb.h b/qt-correction-tool/pub/ddk/ntddnlb.h deleted file mode 100644 index 06462b0..0000000 --- a/qt-correction-tool/pub/ddk/ntddnlb.h +++ /dev/null @@ -1,778 +0,0 @@ -/*++ - -Copyright (c) 2001 Microsoft Corporation - -Module Name: - - ntddnlb.h - -Abstract: - - This header describes the structures and interfaces required to interact - with the NLB intermediate device driver. - -Revision History: - ---*/ - -#ifndef __NTDDNLB_H__ -#define __NTDDNLB_H__ - -#pragma once - -#if (NTDDI_VERSION >= NTDDI_WS03) - -/* - * Note: This file is intended for inclusion by kernel-mode components that - * wish to utilize the public kernel-mode NLB connection notification - * interface or the public kernel-mode NLB hook IOCTLs. In order to - * include only those definitions that are relevant to user-level - * programs (i.e., registry key names), ensure that the following - * macro is defined prior to including this file either via the - * compiler command line: - * - * -DNTDDNLB_USER_MODE_DEFINITIONS_ONLY=1 - * - * or in the source file(s) before inclusion of this file: - * - * #define NTDDNLB_USER_MODE_DEFINITIONS_ONLY - * - * Failing to define this macro before including this file in a user- - * level program will otherwise result in compilation failure. - */ - -/* - This registry key can be used to configure NLB to allow inter-host - communication in a unicast cluster under the following conditions: - - (i) EVERY host in the cluster is properly configured with a Dedicated - IP address, where "properly configured" implies: - - (a) The Dedicated IP address configured in NLB is valid - (b) The Dedicated IP address configured in NLB has been added to - to the TCP/IP properties IP address list OF THE NLB ADAPTER - (c) The Dedicated IP address is the FIRST IP address listed in - the TCP/IP properties IP address list OF THE NLB ADAPTER - - If any of these conditions is not met, do not expect inter-host - communication to work between all hosts, nor under all circumstances. - - (ii) The host is operating in unicast mode - - If the host is operating in eith multicast mode (multicast or IGMP multicast, - this feature is not needed, as hosts can already communication between one - another without additional support. - - This registry key will not exist by default, but can be created and - set on a per-adapter basis under the following registry hive: - - HKLM\System\CurrentControlSet\Services\WLBS\Parameters\Interface\{GUID}\ - - where {GUID} is the GUID of the particular NLB instance (use the "ClusterIP - Address" key in this hive to identify clusters). This key is boolean in - nature and is interpreted as follows: - - = 0 -> The feature is not active - > 0 -> The feature is active - - ** This feature is intended solely for the purpose of inter-host communication - within a clustered firewall application (for example, Microsoft ISA Server). - Though its use outside of these types of applications is not precluded, ITS - USE OUTSIDE OF THESE APPLICATIONS IS EXPLICITLY NOT SUPPORTED BY MICROSOFT. -*/ -#define NLB_INTERHOST_COMM_SUPPORT_KEY L"UnicastInterHostCommSupport" - -/* - These registry keys instruct NLB on which notification mechanism to use. - When deciding what notifications to use for a given type of notification X, - NLB checks the following, in this order: - - (i) NLB first looks for the Enable[X]Notification registry key under - - HKLM\System\CurrentControlSet\Services\WLBS\Parameters\Global\ - - This key has three possible values that instruct NLB on which - notifications to listen for. They are: - - 0 = Do not use any notifications. - 1 = Use the TCP/IP stack's internal notifications. - 2 = Use the NLB public callback notifications. - - (ii) If the Enable[X]Notification registry key is not present, NLB - defaults to using the internal TCP/IP notifications. - - Note: The EnableSYNAttackNotification and EnableTimerStarvationNotification - keys are not available in Windows Server 2003. Also, post-Windows Server - 2003, a value of 0 is not permitted for the EnableTCPNotification key. -*/ -#define NLB_CONNECTION_CALLBACK_KEY L"EnableTCPNotification" -#define NLB_SYN_ATTACK_CALLBACK_KEY L"EnableSYNAttackNotification" -#define NLB_TIMER_STARVATION_CALLBACK_KEY L"EnableTimerStarvationNotification" - -/* Each of the above keys can be set to one of the values listed below. */ -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define NLB_NOTIFICATION_NONE 0 -#define NLB_NOTIFICATION_TCPIP 1 -#define NLB_NOTIFICATION_ALTERNATE 2 -#else -/* The following are legacy definitions from Windows Server 2003. */ -#define NLB_CONNECTION_CALLBACK_NONE 0 -#define NLB_CONNECTION_CALLBACK_TCP 1 -#define NLB_CONNECTION_CALLBACK_ALTERNATE 2 -#endif - -/* This is the public callback object on which NLB will listen for all - public notifications. Currently, the types of notifications accepted by - NLB are session state notifications for TCP (protocol=6), SYN attack - notifications, and timer starvation notifications (*). - - To notify NLB of the beginning/end of a SYN attack or timer starvation, - open the callback object and call ExNotifyCallback with the following - parameters: - - CallbackObject - The handle to the NLB public callback object. - Argument1 - A callback code of type NLB_PUBLIC_CALLBACK_CODE, set to the - NLBSYNAttackBegins[Ends] or NLBTimerStarvationBegins[Ends] - value. - Argument2 - NULL (this parameter is unused) - - NLB requires that each begin notification is accompanied by a - corresponding end notification. Furthermore, NLB makes no guarantees as - to the order in which multiple begin/end notifications are processed; it - is up to the caller to provide any necessary serialization. - - To notify NLB when connections change state, open the callback object, - and call ExNotifyCallback with the following parameters (**): - - CallbackObject - The handle to the NLB public callback object. - Argument1 - A callback code of type NLB_PUBLIC_CALLBACK_CODE, set to the - NLBSessionStateChange value. - Argument2 - A pointer to an NLBConnectionInfo block, defined below. - - For TCP connections, NLB needs to be notified of the following state - changes: - - CLOSED -> SYN_RCVD: A new incoming connection is being established. This - notification requires the IP interface index on which the SYN was - received. NLB will create state on the appropriate interface to track - this TCP connection. - - CLOSED -> SYN_SENT: A new outgoing connection is being established. At - this time, it is unknown on which interface the connection will - ultimately be established, so the IP interface index is NOT required for - this notification. NLB will create temporary state to track this - connection should it return on an NLB interface. - - SYN_SENT -> ESTAB: An outgoing connection has been established. This - nofication requires the IP interface index on which the connection was - ultimately established. If the interface was NLB, state will be created - to track the new connection; if the interface was not NLB, the temporary - state created by the SYN_SENT notification is cleaned up. - - SYN_RCVD -> ESTAB: An incoming connection has been established. This - notification is not currently required by NLB. - - SYN_SENT -> CLOSED: An outgoing connection has been prematurely - terminated (the connection never reached the ESTABlished state). This - notification does not require the IP interface index. NLB will destroy - any state created to track this connection. - - SYN_RCVD -> CLOSED: An outgoing connection has been prematurely - terminated (the connection never reached the ESTABlished state). This - notification does not require the IP interface index. NLB will destroy - any state created to track this connection. - - ESTAB -> CLOSED: A connection has been *completely* terminated (i.e., the - connection has gone through TIME_WAIT, if necessary, already). This - notification does not require the IP interface index. NLB will destroy - any state created to track this connection. - - (*) SYN attack and timer starvation notifications are not available in - Windows Server 2003. - - (**) In Windows Server 2003, the pointer to the NLBConnectionInfo block - is passed in Argument1 and Argument2 is set to NULL (unused). -*/ -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define NLB_PUBLIC_CALLBACK_NAME L"\\Callback\\NLBPublicCallback" -#else -/* The following are legacy definitions from Windows Server 2003. */ -#define NLB_CONNECTION_CALLBACK_NAME L"\\Callback\\NLBConnectionCallback" -#endif - -/* Starting from V3 NLB hooks support versioning to allow writing backward and - forward compatible code. Now all the structures passed as a parameter to the - call backs start from the Version field. - To prevent legacy code (V1 or V2) from registering for the hooks - we are adding Version field to the call-back registration structure. Moving - forward this also will allow NLB to gracefully handle binaries that are compiled - for a different version of the hook. -*/ -typedef enum { - NLBHookApiInvalid = 0, - NLBHookApiV3 = 3, - NLBHookApiMax = 0xFFFF, -} NLB_HOOK_API_VERSION; - - -/* This enumerated type is used to indicate the type of notification that is - being sent to the NLB connection callback object. -*/ -typedef enum { - NLBSessionStateChange, /* The state of a session (e.g. a TCP connection) has changed. */ - NLBSYNAttackBegins, /* A SYN attack has begun on the machine. */ - NLBSYNAttackEnds, /* A SYN attack has ended on the machine. */ - NLBTimerStarvationBegins, /* Timer starvation has begun on the machine. */ - NLBTimerStarvationEnds /* Timer starvation has ended on the machine. */ -} NLB_PUBLIC_CALLBACK_CODE; - -#define NLB_TCPIP_PROTOCOL_TCP 6 /* IP protocol ID for TCP. */ - -#define NLB_TCP_CLOSED 1 /* The TCP connection is/was CLOSED. */ -#define NLB_TCP_SYN_SENT 3 /* The TCP connection is/was in SYN_SENT. */ -#define NLB_TCP_SYN_RCVD 4 /* The TCP connection is/was in SYN_RCVD. */ -#define NLB_TCP_ESTAB 5 /* The TCP connection is/was ESTABlished. */ - -/* Force default alignment on the callback buffers. */ -#pragma pack(push) -#pragma pack() -typedef struct NLBTCPAddressInfo_v1 { - ULONG RemoteIPAddress; /* The remote (client) IP address, in network byte order. */ - ULONG LocalIPAddress; /* The local (server) IP address, in network byte order. */ - USHORT RemotePort; /* The remote (client) TCP port, in network byte order. */ - USHORT LocalPort; /* The local (server) TCP port, in network byte order. */ -} NLBTCPAddressInfo_v1; - -typedef struct NLBTCPAddressInfo_v2 { - ADDRESS_FAMILY AddressFamily; /* The address family of the remote/local IP addresses (AF_INET or AF_INET6). */ - const UCHAR * RemoteIPAddress; /* The remote (client) IP address, in network byte order. */ - const UCHAR * LocalIPAddress; /* The local (server) IP address, in network byte order. */ - USHORT RemotePort; /* The remote (client) TCP port, in network byte order. */ - USHORT LocalPort; /* The local (server) TCP port, in network byte order. */ -} NLBTCPAddressInfo_v2; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef NLBTCPAddressInfo_v2 NLBTCPAddressInfo; -#else -typedef NLBTCPAddressInfo_v1 NLBTCPAddressInfo; -#endif - -typedef struct NLBTCPConnectionInfo { - ULONG PreviousState; /* The previous state for the connection, as defined above. */ - ULONG CurrentState; /* The new state for the connection, as defined above. */ - ULONG IPInterface; /* The IP interface index on which the connection was, or is being, established. */ - NLBTCPAddressInfo Address; /* A pointer to a block containing the IP tuple for the connection. */ -} NLBTCPConnectionInfo; - -typedef struct NLBConnectionInfo { - UCHAR Protocol; /* The protocol of the connection (currently, only TCP is supported). */ - union { - NLBTCPConnectionInfo * pTCPInfo; /* A pointer to the TCP connection information block. */ - }; -} NLBConnectionInfo; - -#pragma pack(pop) - -#if !defined (NTDDNLB_USER_MODE_DEFINITIONS_ONLY) - -//#include -//#include -//#include - -#define NLB_DEVICE_NAME L"\\Device\\WLBS" /* The NLB device name for use in ZwCreateFile, for instance. */ - -/* - This IOCTL registers or de-registers a kernel-mode hook with NLB. The - IOCTL must be called at IRQL = PASSIVE_LEVEL. - - Returns: - o STATUS_SUCCESS - if the (de)registration succeeds. - o STATUS_INVALID_PARAMETER - if a parameter is invalid. E.g., - - The I/O buffers are missing or the incorrect size. - - The HookIdentifier does not match a known NLB hook GUID. - - The HookTable entry is non-NULL, but the DeregisterCallback is NULL. - - The HookTable entry is non-NULL, but all hook function pointers are NULL. - - The HookTable entry is NULL, but no function is registered for this hook. - o STATUS_ACCESS_DENIED - if the operation will NOT be permitted by NLB. E.g., - - The request to (de)register a hook does not come from kernel-mode. - - The request to (de)register a hook is called at an IRQL > PASSIVE_LEVEL. - - The de-register information provided is for a hook that was registered - by a different component, as identified by the RegisteringEntity. - - The specified hook has already been registered by somebody (anybody). - Components wishing to change their hook must first de-register it. -*/ -#define NLB_IOCTL_REGISTER_HOOK CTL_CODE(0xc0c0, 18, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define NLB_HOOK_IDENTIFIER_LENGTH 39 /* 39 is sufficient for {GUID}. */ - -#define NLB_FILTER_HOOK_INTERFACE L"{069267c4-7eee-4aff-832c-02e22e00f96f}" /* The filter interface includes hooks for influencing the NLB - load-balancing decision on either the send path, receive path, - or both. This hook will be called for any packet for which - NLB would normally apply load-balancing policy. Components - registering this interface should use an NLB_FILTER_HOOK_TABLE - as the hook table in the NLB_IOCTL_REGISTER_HOOK_REQUEST. */ - -/* The de-register callback must be specifed for all register - operations. This function is called by NLB whenever a - registered hook is de-registered, either gracefully by the - registrar, or forcefully by NLB itself (as a result of the - NLB device driver getting unloaded). - */ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef VOID (* NLBHookDeregister) ( - __in_z const PWCHAR pHookIdentifier, - __in HANDLE RegisteringEntity, - __in ULONG Flags); - -/* Bit settings for the Flags field of the de-register callback. */ -#define NLB_HOOK_DEREGISTER_FLAGS_FORCED 0x00000001 - -/* This enumerated type is the feedback for all filter hooks. */ -typedef enum { - NLB_FILTER_HOOK_PROCEED_WITH_HASH, /* Continue to load-balance normally; i.e., the hook has no specific feedback. */ - NLB_FILTER_HOOK_REVERSE_HASH, /* Use reverse hashing (use destination parameters, rather than source). */ - NLB_FILTER_HOOK_FORWARD_HASH, /* Use conventional forward hashing (use source parameters). */ - NLB_FILTER_HOOK_ACCEPT_UNCONDITIONALLY, /* By-pass load-balancing and accept the packet unconditionally. */ - NLB_FILTER_HOOK_REJECT_UNCONDITIONALLY, /* By-pass load-balancing and reject the packet unconditionally. */ - NLB_FILTER_HOOK_USE_MODIFIED_TUPLE /* Use the NewTuple provided by the Client for Load Balancing. */ -}NLB_FILTER_HOOK_DIRECTIVE; - -#define HOOK_IPv6_ADDRESS_NUM_FIELDS 16 -#define HOOK_IPv4_ADDRESS_NUM_FIELDS 4 - -//typedef UINT32 HOOK_IP_ADDRESS_V4; -//typedef USHORT HOOK_IP_ADDRESS_V6[IPv6_ADDRESS_NUM_FIELDS]; -typedef UCHAR HOOK_IP_ADDRESS_V4[HOOK_IPv4_ADDRESS_NUM_FIELDS]; /* Accepts IP Address in NETWORK BYTE ORDER */ -typedef UCHAR HOOK_IP_ADDRESS_V6[HOOK_IPv6_ADDRESS_NUM_FIELDS]; /* Accepts IP Address in NETWORK BYTE ORDER */ - -/* IP Address Types supported by NLB; - Both your Source IP and Destination IP needs to be of the same type. -*/ -typedef enum { - IP_INVALID = 0, - IP_v4, - IP_v6 -} HOOK_IP_ADDRESS_TYPE; - -/* Represents IP Address in NLBHookIPTuple */ -typedef struct _HOOK_IP_ADDRESS { - HOOK_IP_ADDRESS_TYPE Type; - union - { - UCHAR Address; - HOOK_IP_ADDRESS_V4 v4; /* Accepts IP Address in NETWORK BYTE ORDER. */ - HOOK_IP_ADDRESS_V6 v6; /* Accepts IP Address in NETWORK BYTE ORDER. */ - }; -} HOOK_IP_ADDRESS, * PHOOK_IP_ADDRESS; - -/* Flags for the NLB_HOOK_IP_TUPLE. - Only TCP or UDP protocol(s) supported. - For TCP, indicate whether it is a first packet. - */ -#define NLB_HOOK_FLAGS_PROTOCOL_IS_TCP 0x00000100 /* To be set in case of TCP; If not set, the protocol is assumed to be UDP */ -#define NLB_HOOK_FLAGS_CONNECTION_UP 0x00000002 /* TCP/UDP connection UP (equivalent of TCP SYN or UDP IPSec Initial Contact) */ -#define NLB_HOOK_FLAGS_CONNECTION_DOWN 0x00000004 /* TCP/UDP connection DOWN (equivalent of TCP FIN) - can be used for UDP IPSec connections as well */ - -/* NLB Tuple is represented by a combination of: - "Protocol, Source IP, Source Port, Destination IP, Destination Port"; - This NLB Tuple is used by NLB to make load balancing decisions. - Client can now modify the Tuple used by NLB to make load balancing decisions. - As part of the Send, Receive and Query Hooks, NLB provides a new structure: - "NewTuple of type NLBHookIPTuple"; - Note: - Client would have to update the complete Tuple; - Incomplete Tuple or Incorrectly filled up Tuples can lead to the packet being possibly dropped by NLB; - Source IP and Destination IP are "required" to be of the same Type. Refer to HOOK_IP_ADDRESS_TYPE enum. -*/ -typedef struct _NLB_HOOK_IP_TUPLE { - struct { - HOOK_IP_ADDRESS IP; /* Source IP used by NLB to make load balancing decisions */ - USHORT Port; /* Source Port - Accepts Port in HOST BYTE ORDER. */ - } Source; - - struct { - HOOK_IP_ADDRESS IP; /* Destination IP */ - USHORT Port; /* Destination Port - Accepts Port in HOST BYTE ORDER. */ - } Destination; - - ULONG Flags; /* Flag to indicate Protocol (TCP or UDP Only). If TCP Protocol, also indicate whether it is a SYN packet or not. */ -} NLB_HOOK_IP_TUPLE, * PNLB_HOOK_IP_TUPLE; - -/* This structure is used as a single parameter in the New Send and Receive Hook functions. - This has the same parameters as the Send and Receive Hooks of version 2 (v2) - along with NewTuple that should be populated by Client who wishes to modify the IP/Port/Protocol information used by NLB. - Refer to NLBHookIPTuple for more information. -*/ -typedef struct _SEND_RECEIVE_HOOK_INFO { - __in NLB_HOOK_API_VERSION Version; /* Version of the structure. For the V3 hooks it has to be set to NLBHookApiV3 */ - __in_z const WCHAR * pAdapter; /* The GUID of the adapter on which the packet was received. */ - __in IF_INDEX IFIndex; /* The interface index of the adapter on which the packet was received/sent. */ - __in_opt const NET_BUFFER * pPacket; /* A pointer to the NDIS packet, which CAN be NULL if not available. */ - __in_bcount(cMediaHeaderLength) const UCHAR * pMediaHeader; /* A pointer to the media header (ethernet, since NLB supports only ethernet). */ - __in ULONG cMediaHeaderLength; /* The length of contiguous memory accessible from the media header pointer. */ - __in_bcount(cPayloadLength) const UCHAR * pPayload; /* A pointer to the payload of the packet. */ - __in ULONG cPayloadLength; /* The length of contiguous memory accesible from the payload pointer. */ - __in ULONG Flags; /* Hook-related flags including whether or not the cluster is stopped. */ - __in VOID * Reserved; /* This field is reserved for future use. */ - __in NLB_HOOK_IP_TUPLE NewTuple; /* This should be populated with new tuple values */ -} SEND_RECEIVE_HOOK_INFO, * PSEND_RECEIVE_HOOK_INFO; - -/* This structure is used as a single parameter in the New Query Hook function. - This has the same parameters as the Query Hook of version 2 (v2) - along with NewTuple that should be populated by Client who wishes to modify the IP/Port/Protocol information used by NLB. - Refer to NLBHookIPTuple for more information. -*/ -typedef struct _QUERY_HOOK_INFO { - __in NLB_HOOK_API_VERSION Version; /* Version of the structure. For the V3 hooks it has to be set to NLBHookApiV3 */ - __in_z const WCHAR * pAdapter; /* The GUID of the adapter on which the packet was received. */ - __in IF_INDEX IFIndex; /* The interface index of the adapter on which the new connection would be established. */ - __in ADDRESS_FAMILY AddressFamily; /* The address family of the server/client IP addresses (AF_INET or AF_INET6). */ - __drv_when(AddressFamily==2, __in_bcount(4)) /* AF_INET == 2, address is 4 bytes */ - __drv_when(AddressFamily==23, __in_bcount(16)) /* AF_INET6 == 23, address is 16 bytes */ - const UCHAR * ServerIPAddress; /* The server IP address of the "packet" in NETWORK byte order. */ - __in USHORT ServerPort; /* The server port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __drv_when(AddressFamily==2, __in_bcount(4)) /* AF_INET == 2, address is 4 bytes */ - __drv_when(AddressFamily==23, __in_bcount(16)) /* AF_INET6 == 23, address is 16 bytes */ - const UCHAR * ClientIPAddress; /* The client IP address of the "packet" in NETWORK byte order. */ - __in USHORT ClientPort; /* The client port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __in USHORT Protocol; /* The IP protocol of the "packet"; TCP, UDP, ICMP, GRE, etc. */ - __in BOOLEAN bReceiveContext; /* A boolean to indicate whether the packet is being processed in send or receive context. */ - __in ULONG Flags; /* Hook-related flags including whether or not the cluster is stopped. */ - __in VOID * Reserved; /* This field is reserved for future use. */ - __in NLB_HOOK_IP_TUPLE NewTuple; /* This should be populated with new tuple values */ -} QUERY_HOOK_INFO, * PQUERY_HOOK_INFO; - -/* This structure is used as a single parameter in the NotifyClearClientStickinessHook. - This hook would get called for each port rule that is affected. If all of the port rules are affected, then the hook would be called for each of those port rules. - pAdapter - Miniport GUID whose port rule is affected. In case of BDA, only the Master miniport is set. The hook implementation should then map this to the corresponding slave(s) as well. - PortRuleIndex - Index of the port rule which is affected. - BDATeaming - Set to TRUE in case of BDATeaming. This would be useful since inside the hook the pAdapter should be mapped to master and the slave(s). -*/ -typedef struct _CLEAR_CLIENT_STICKINESS_HOOK_INFO { - __in NLB_HOOK_API_VERSION Version; /* Version of the structure. For the V3 hooks it has to be set to NLBHookApiV3 */ - __in_z const WCHAR * pAdapter; /* The GUID of the adapter whose connections would be affected due to change in the client stickiness state. */ - __in ULONG PortRuleIndex; /* Index of the Port Rule whose Client Stickiness List would be flushed. */ - __in BOOLEAN BDATeaming; /* This Flag would be set, when BDA Teaming is enabled. */ -} CLEAR_CLIENT_STICKINESS_HOOK_INFO, * PCLEAR_CLIENT_STICKINESS_HOOK_INFO; - -/* - Filter hooks: - - The adapter GUID (1st parameter) will allow the hook consumer to - determine the adapter on which the packet is being sent or received. - Note that the length parameters are not necesarily indicative of the - actual length of the media header or payload themselves, but rather - indicate how much of the buffers pointed to are contiguously - accessible from the provided pointer. For instance, the payload - length may just be the length of an IP header, meaning that only - the IP header can be found at that pointer. However, it might - be equal to the total size of the packet payload, in which case, - that pointer can be used to access subsequent pieces of the - packet, such as the TCP header. If the payload length provided - is not sufficient to find all necessary packet information, the - packet pointer can be used to traverse the packet buffers manually - to try and find the information needed. However, note that the - packet may not always be available (it may be NULL). -*/ - -/* The send filter hook is invoked for every packet sent on any - adapter to which NLB is bound for which NLB would normally - apply load-balancing policy. ARPs, for instance, are not - filtered by NLB, so such packets would not be indicated to - this hook. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBSendFilterHook_v1) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet is being sent. */ -/* Even though this type is versioned, a compile error occurs if the - NDIS_PACKET type is referenced from a non-legacy (NDIS 6.0+) driver. */ -#ifndef NDIS60 - __in_opt const NDIS_PACKET * pPacket, /* A pointer to the NDIS packet, which CAN be NULL if not available. */ -#else - __in_opt const VOID * pPacket, -#endif - __in_bcount(cMediaHeaderLength) const UCHAR * pMediaHeader, /* A pointer to the media header (ethernet, since NLB supports only ethernet). */ - __in ULONG cMediaHeaderLength, /* The length of contiguous memory accessible from the media header pointer. */ - __in_bcount(cPayloadLength) const UCHAR * pPayload, /* A pointer to the payload of the packet. */ - __in ULONG cPayloadLength, /* The length of contiguous memory accesible from the payload pointer. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBSendFilterHook_v2) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet is being sent. */ - __in_opt const NET_BUFFER * pPacket, /* A pointer to the NDIS packet, which CAN be NULL if not available. */ - __in_bcount(cMediaHeaderLength) const UCHAR * pMediaHeader, /* A pointer to the media header (ethernet, since NLB supports only ethernet). */ - __in ULONG cMediaHeaderLength, /* The length of contiguous memory accessible from the media header pointer. */ - __in_bcount(cPayloadLength) const UCHAR * pPayload, /* A pointer to the payload of the packet. */ - __in ULONG cPayloadLength, /* The length of contiguous memory accesible from the payload pointer. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -/* In v3, all the arguments passed to the Send Hook would be consolidated within the SendReceiveHookInfo structure. - Any future changes to the arguments would be made in the structure so that the signature of the hook interface doesn't need to change. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBSendFilterHook_v3) ( - __in PSEND_RECEIVE_HOOK_INFO SendReceiveInfoPtr); /* The SendReceiveHookInfo structure would be used to pass all arguments in Send Hook. */ - - -/* The receive filter hook is invoked for every packet received - on any adapter to which NLB is bound for which NLB would - normally apply load-balancing policy. Some protocols, such - as ARP, or NLB-specific packets not normally seen by the - protocol(s) bound to NLB (heartbeats, remote control requests) - are not filtered by NLB and will not be indicated to the hook. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBReceiveFilterHook_v1) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet was received. */ -/* Even though this type is versioned, a compile error occurs if the - NDIS_PACKET type is referenced from a non-legacy (NDIS 6.0+) driver. */ -#ifndef NDIS60 - __in_opt const NDIS_PACKET * pPacket, /* A pointer to the NDIS packet, which CAN be NULL if not available. */ -#else - __in_opt const VOID * pPacket, -#endif - __in_bcount(cMediaHeaderLength) const UCHAR * pMediaHeader, /* A pointer to the media header (ethernet, since NLB supports only ethernet). */ - __in ULONG cMediaHeaderLength, /* The length of contiguous memory accessible from the media header pointer. */ - __in_bcount(cPayloadLength) const UCHAR * pPayload, /* A pointer to the payload of the packet. */ - __in ULONG cPayloadLength, /* The length of contiguous memory accesible from the payload pointer. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBReceiveFilterHook_v2) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet was received. */ - __in_opt const NET_BUFFER * pPacket, /* A pointer to the NDIS packet, which CAN be NULL if not available. */ - __in_bcount(cMediaHeaderLength) const UCHAR * pMediaHeader, /* A pointer to the media header (ethernet, since NLB supports only ethernet). */ - __in ULONG cMediaHeaderLength, /* The length of contiguous memory accessible from the media header pointer. */ - __in_bcount(cPayloadLength) const UCHAR * pPayload, /* A pointer to the payload of the packet. */ - __in ULONG cPayloadLength, /* The length of contiguous memory accesible from the payload pointer. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -/* In v3, all the arguments passed to the Receive Hook would be consolidated within the SendReceiveHookInfo structure. - Any future changes to the arguments would be made in the structure so that the signature of the hook interface doesn't need to change. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBReceiveFilterHook_v3) ( - __in PSEND_RECEIVE_HOOK_INFO SendReceiveInfoPtr); /* The SendReceiveHookInfo structure would be used to pass all arguments in Receive Hook. */ - - -/* The query filter hook is invoked in cases where the NLB driver - needs to invoke its hashing algorithm and therefore needs to - know whether or not the hook will influence the way in which - manner NLB performs the hash, if at all. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBQueryFilterHook_v1) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet was received. */ - __in ULONG ServerIPAddress, /* The server IP address of the "packet" in NETWORK byte order. */ - __in USHORT ServerPort, /* The server port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __in ULONG ClientIPAddress, /* The client IP address of the "packet" in NETWORK byte order. */ - __in USHORT ClientPort, /* The client port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __in UCHAR Protocol, /* The IP protocol of the "packet"; TCP, UDP, ICMP, GRE, etc. */ - __in BOOLEAN bReceiveContext, /* A boolean to indicate whether the packet is being processed in send or receive context. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBQueryFilterHook_v2) ( - __in_z const WCHAR * pAdapter, /* The GUID of the adapter on which the packet was received. */ - __in ADDRESS_FAMILY AddressFamily, /* The address family of the server/client IP addresses (AF_INET or AF_INET6). */ - __drv_when(AddressFamily==2, __in_bcount(4)) /* AF_INET == 2, address is 4 bytes */ - __drv_when(AddressFamily==23, __in_bcount(16)) /* AF_INET6 == 23, address is 16 bytes */ - const UCHAR * ServerIPAddress, /* The server IP address of the "packet" in NETWORK byte order. */ - __in USHORT ServerPort, /* The server port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __drv_when(AddressFamily==2, __in_bcount(4)) /* AF_INET == 2, address is 4 bytes */ - __drv_when(AddressFamily==23, __in_bcount(16)) /* AF_INET6 == 23, address is 16 bytes */ - const UCHAR * ClientIPAddress, /* The client IP address of the "packet" in NETWORK byte order. */ - __in USHORT ClientPort, /* The client port of the "packet" (if applicable to the Protocol) in HOST byte order. */ - __in UCHAR Protocol, /* The IP protocol of the "packet"; TCP, UDP, ICMP, GRE, etc. */ - __in BOOLEAN bReceiveContext, /* A boolean to indicate whether the packet is being processed in send or receive context. */ - __in ULONG Flags); /* Hook-related flags including whether or not the cluster is stopped. */ - -/* In v3, all the arguments passed to the Query Hook would be consolidated within the QueryHookInfo structure. - Any future changes to the arguments would be made in the structure so that the signature of the hook interface doesn't need to change. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef NLB_FILTER_HOOK_DIRECTIVE (* NLBQueryFilterHook_v3) ( - __in PQUERY_HOOK_INFO QueryHookInfoPtr); /* The QueryHookInfo structure would be used to pass all arguments in Query Hook. */ - -/* The purpose of this hook is to synchronize the NLB's Client Stickiness state (built up by the Client Stickiness Notify IOCTL) with the 3rd party application's own state (if any). - The NotifyClearClientStickinessHook gets invoked when NLB flushes its client stickiness state for all or a specific port rule(s). - This hook should be registered to receive notifications for client stickiness state being cleared. - This hook would get called for each port rule that is affected. If all of the port rules are affected, then the hook would be called for each of those port rules. - This hook would also be called every time a NLB Load module is started for each of the port rules configured on that load module. - - Note: When the NLB is in the transient state of stopping or draining load module or a specific port rule, the Client Stickiness Notify IOCTL would return "STATUS_RETRY" error. - The caller then may decide to call the IOCTL after delay or at a later time. - Once the 3rd party application is notified of this change, after that Client Stickiness IOCTL should function as expected. -*/ -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef void (* NLBClearClientStickinessFilterHook_v3) ( - __in PCLEAR_CLIENT_STICKINESS_HOOK_INFO ClearClientStickinessHookInfoPtr); - -#if (NTDDI_VERSION >= NTDDI_WIN7) -typedef NLBSendFilterHook_v3 NLBSendFilterHook; -typedef NLBReceiveFilterHook_v3 NLBReceiveFilterHook; -typedef NLBQueryFilterHook_v3 NLBQueryFilterHook; -typedef NLBClearClientStickinessFilterHook_v3 NLBClearClientStickinessFilterHook; -#else - #if (NTDDI_VERSION >= NTDDI_VISTA) - typedef NLBSendFilterHook_v2 NLBSendFilterHook; - typedef NLBReceiveFilterHook_v2 NLBReceiveFilterHook; - typedef NLBQueryFilterHook_v2 NLBQueryFilterHook; - #else - typedef NLBSendFilterHook_v1 NLBSendFilterHook; - typedef NLBReceiveFilterHook_v1 NLBReceiveFilterHook; - typedef NLBQueryFilterHook_v1 NLBQueryFilterHook; - #endif -#endif - -/* Bit settings for the Flags field of the filter hooks. */ -#define NLB_FILTER_HOOK_FLAGS_STOPPED 0x00000001 -#define NLB_FILTER_HOOK_FLAGS_DRAINING 0x00000002 - -/* Force default alignment on the IOCTL buffers. */ -#pragma pack(push) -#pragma pack() -/* This table contains function pointers to register or de-register - a packet filter hook. To register a hook, set the appropriate - function pointer. Those not being specified (for instance if - you want to register a receive hook, but not a send hook) should - be set to NULL. The QueryHook should ONLY be specified if in - conjunction with setting either the send or receive hook; i.e. - a user may not ONLY register the QueryHook. Further, if regis- - tering a send or receive hook (or both), the QueryHook MUST be - provided in order for NLB to query the hook response for cases - where a hashing decision is needed, but we are not in the context - of sending or receiving a packet; most notably, in a connection - up or down notification from IPSec or TCP. -*/ -typedef struct { - __in ULONG Reserved; /* This field must be set to 0 */ - __in NLB_HOOK_API_VERSION Version; /* Version of the structure. For the V3 hooks it has to be set to NLBHookApiV3 */ - __in NLBSendFilterHook SendHook; - __in NLBQueryFilterHook QueryHook; - __in NLBReceiveFilterHook ReceiveHook; - __in NLBClearClientStickinessFilterHook ClearClientStickinessHook; -} NLB_FILTER_HOOK_TABLE, * PNLB_FILTER_HOOK_TABLE; - -/* This is the input buffer for the hook (de)register IOCTL. There is - no corresponding output buffer. This structure identifies the hook - interface being (de)registered, the entity registering the hook and - all appropriate function pointers (callbacks). Note that hooks are - registered in groups, called interfaces, which prevents different - related hooks from being owned by different entities (for example, - it prevents one entity owned the send hook, but another owned the - receive hook). Interfaces are identified by a GUID, and to set any - hook in the interface requires ownership of the entire interface - - even if not all hooks in the interface are being specified. The hook - table should be a pointer to a hook table of the type required by the - specified hook identifier. To de-register a hook, set the hook table - pointer to NULL. - - Note: The HookTable pointer does NOT need to be valid following the - completion of the IOCTL. That is, this pointer is only referenced - within the context of the IOCTL. -*/ -typedef struct { - WCHAR HookIdentifier[NLB_HOOK_IDENTIFIER_LENGTH]; /* The GUID identifying the hook interface being registered. */ - HANDLE RegisteringEntity; /* The open file handle on the NLB driver, which uniquely identifies the registrar. */ - PVOID HookTable; /* A pointer to the appropriate hook table containing the hook function pointers. */ - NLBHookDeregister DeregisterCallback; /* The de-register callback function, which MUST be non-NULL if the operation is a registration. */ -} NLB_IOCTL_REGISTER_HOOK_REQUEST, * PNLB_IOCTL_REGISTER_HOOK_REQUEST; - - -/* These define which IOCTLs would be published to the Client Apps of NLB. - Currently, only Kernel mode components can call the IOCTLs. - All the IOCTLs originating from user-mode components would be rejected. -*/ -#define NLB_PUBLIC_DEVICE_TYPE_CORE 0xc0c0 -#define NLB_PUBLIC_DEVICE_NAME L"\\Device\\WLBS" -#define NLB_PUBLIC_IOCTL_MINIPORT_NAME_LENGTH 48 - -/* These values are used by ClientStickinessNotify structure. */ -#define START_CLIENT_STICKINESS 0 -#define STOP_CLIENT_STICKINESS 1 - -#define NLB_PUBLIC_IOCTL_CLIENT_STICKINESS_NOTIFY CTL_CODE(NLB_PUBLIC_DEVICE_TYPE_CORE, 21, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -/* All NLB IOCTLs expect the following structure as input. */ -typedef struct _NLB_PUBLIC_IOCTL_INPUT -{ - /* The MiniPortName (adapter GUID) field needs to be filled out for all - IOCTLs. */ - WCHAR MiniportName[NLB_PUBLIC_IOCTL_MINIPORT_NAME_LENGTH]; - - union - { - /* NLB IOCTLS may fill out IOCTL-specific fields below to identify - a particular target of the IOCTL. */ - - /* Is used to start/stop client stickiness for connectionless protocols (like UDP) - Currently, only UDP is supported. - Parameters: - a) RequestType: Indicate whether it's a start/stop request - Accepted values: - START_CLIENT_STICKINESS - STOP_CLIENT_STICKINESS - b) ClientIPAddress: Client IP for which stickiness needs to start/stop. - c) Protocol: Used to identify Port Rule. Currently Unused. Defaults to UDP. - d) UsePortIndex: - TRUE: Use PortIndex for identifying port rule - FALSE: Use ServerTuple for identifying port rule - e) PortIndex: Port Rule Index - f) ServerTuple: IP and Port of Server used to identify PortRule - - It applies to IOCTL: - NLB_PUBLIC_IOCTL_CLIENT_STICKINESS_NOTIFY - */ - struct - { - USHORT RequestType; /* Indicate request type (start/stop) */ - HOOK_IP_ADDRESS ClientIPAddress; /* Client IP and it's type for the stickiness is to be started/stopped. Accepts IP Address in NETWORK BYTE ORDER. */ - USHORT Protocol; /* For future use. Currently ignored. This should be set to 0. Only UDP protocol is supported. */ - BOOLEAN UsePortIndex; /* Indicate which type of port rule identification is specified. */ - union - { - ULONG PortIndex; /* Port Rule Index. */ - struct - { - HOOK_IP_ADDRESS IP; /* Server IP and Type - Accepts IP Address in NETWORK BYTE ORDER. */ - USHORT Port; /* Server Port - Accepts Port in HOST BYTE ORDER. */ - } - ServerTuple; /* Required to identify the Port Rule */ - }; - } - ClientStickinessNotify; - }; -} NLB_PUBLIC_IOCTL_INPUT, * PNLB_PUBLIC_IOCTL_INPUT; - -#pragma pack(pop) - -#endif /* !USER_MODE_DEFINITIONS_ONLY */ - -#endif /* (NTDDI_VERSION >= NTDDI_WS03) */ - -#endif /* __NTDDNLB_H__ */ - diff --git a/qt-correction-tool/pub/ddk/ntddpcm.h b/qt-correction-tool/pub/ddk/ntddpcm.h deleted file mode 100644 index acf96e3..0000000 --- a/qt-correction-tool/pub/ddk/ntddpcm.h +++ /dev/null @@ -1,245 +0,0 @@ -/*++ - -Copyright (c) 1994-1999 Microsoft Corporation - -Module Name: - - ntddpcm.h - -Abstract: - - This is the include file that defines all constants and types for - accessing the PCMCIA Adapters. - ---*/ - -#ifndef _NTDDPCMH_ -#define _NTDDPCMH_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Device Name - this string is the name of the device. It is the name -// that should be passed to NtOpenFile when accessing the device. -// -// Note: For devices that support multiple units, it should be suffixed -// with the Ascii representation of the unit number. -// -// Note: The IOCTL interface to pcmcia host controllers is turned off by -// default. These IOCTLs are provided for testing purposes only. To -// turn on this interface, add the following registry value: -// HKLM\SYSTEM\CurrentControlSet\Services\Pcmcia\Parameters\IoctlInterface : REG_DWORD : 1 -// - -#define IOCTL_PCMCIA_BASE FILE_DEVICE_CONTROLLER - -#define DD_PCMCIA_DEVICE_NAME "\\\\.\\Pcmcia" - -// -// IoControlCode values for this device. -// - -#define IOCTL_GET_TUPLE_DATA CTL_CODE(IOCTL_PCMCIA_BASE, 3000, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SOCKET_INFORMATION CTL_CODE(IOCTL_PCMCIA_BASE, 3004, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_PCMCIA_HIDE_DEVICE CTL_CODE(IOCTL_PCMCIA_BASE, 3010, METHOD_BUFFERED, FILE_WRITE_ACCESS) -#define IOCTL_PCMCIA_REVEAL_DEVICE CTL_CODE(IOCTL_PCMCIA_BASE, 3011, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -// -// Tuple request parameters. -// - -typedef struct _PCMCIA_SOCKET_REQUEST { - USHORT Socket; -} PCMCIA_SOCKET_REQUEST, *PPCMCIA_SOCKET_REQUEST; - -typedef struct _TUPLE_REQUEST { - USHORT Socket; -} TUPLE_REQUEST, *PTUPLE_REQUEST; - -#define MANUFACTURER_NAME_LENGTH 64 -#define DEVICE_IDENTIFIER_LENGTH 64 -#define DRIVER_NAME_LENGTH 32 - -#define PcmciaInvalidControllerType 0xffffffff - -// -// Controller classes returned in socket information structure. -// - -typedef enum _PCMCIA_CONTROLLER_CLASS { - PcmciaInvalidControllerClass = -1, - PcmciaIntelCompatible, - PcmciaCardBusCompatible, - PcmciaElcController, - PcmciaDatabook, - PcmciaPciPcmciaBridge, - PcmciaCirrusLogic, - PcmciaTI, - PcmciaTopic, - PcmciaRicoh, - PcmciaDatabookCB, - PcmciaOpti, - PcmciaTrid, - PcmciaO2Micro, - PcmciaNEC, - PcmciaNEC_98 -} PCMCIA_CONTROLLER_CLASS, *PPCMCIA_CONTROLLER_CLASS; - - -typedef struct _PCMCIA_SOCKET_INFORMATION { - USHORT Socket; - USHORT TupleCrc; - UCHAR Manufacturer[MANUFACTURER_NAME_LENGTH]; - UCHAR Identifier[DEVICE_IDENTIFIER_LENGTH]; - UCHAR DriverName[DRIVER_NAME_LENGTH]; - UCHAR DeviceFunctionId; - UCHAR Reserved; - UCHAR CardInSocket; - UCHAR CardEnabled; - ULONG ControllerType; -} PCMCIA_SOCKET_INFORMATION, *PPCMCIA_SOCKET_INFORMATION; - -// -// macros to crack the ControllerId field of the socket info structure -// -#define PcmciaClassFromControllerType(type) ((PCMCIA_CONTROLLER_CLASS)((type) & 0xff)) -#define PcmciaModelFromControllerType(type) (((type) >> 8) & 0x3ffff) -#define PcmciaRevisionFromControllerType(type) ((type) >> 26) - -// -// Begin pcmcia exported interfaces to other drivers -// - -#ifdef _NTDDK_ - -DEFINE_GUID( GUID_PCMCIA_INTERFACE_STANDARD, 0xbed5dadfL, 0x38fb, 0x11d1, 0x94, 0x62, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee); - -#define PCMCIA_MEMORY_8BIT_ACCESS 0 -#define PCMCIA_MEMORY_16BIT_ACCESS 1 - -typedef -__drv_functionClass(PCMCIA_MODIFY_MEMORY_WINDOW) -BOOLEAN -PCMCIA_MODIFY_MEMORY_WINDOW( - __in_opt PVOID Context, - __in ULONGLONG HostBase, - __in ULONGLONG CardBase, - __in BOOLEAN Enable, - __in_opt ULONG WindowSize, - __in_opt UCHAR AccessSpeed, - __in_opt UCHAR BusWidth, - __in_opt BOOLEAN IsAttributeMemory - ); -typedef PCMCIA_MODIFY_MEMORY_WINDOW *PPCMCIA_MODIFY_MEMORY_WINDOW; - -#define PCMCIA_VPP_0V 0 -#define PCMCIA_VPP_12V 1 -#define PCMCIA_VPP_IS_VCC 2 - -typedef -__drv_functionClass(PCMCIA_SET_VPP) -BOOLEAN -PCMCIA_SET_VPP( - __in_opt PVOID Context, - __in UCHAR VppLevel - ); -typedef PCMCIA_SET_VPP *PPCMCIA_SET_VPP; - -typedef -__drv_functionClass(PCMCIA_IS_WRITE_PROTECTED) -BOOLEAN -PCMCIA_IS_WRITE_PROTECTED( - __in_opt PVOID Context - ); -typedef PCMCIA_IS_WRITE_PROTECTED *PPCMCIA_IS_WRITE_PROTECTED; - -// -// These are interfaces for manipulating memory windows, setting Vpp etc., -// primarily used by flash memory card drivers -// -typedef struct _PCMCIA_INTERFACE_STANDARD { - USHORT Size; - USHORT Version; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - PVOID Context; - PPCMCIA_MODIFY_MEMORY_WINDOW ModifyMemoryWindow; - PPCMCIA_SET_VPP SetVpp; - PPCMCIA_IS_WRITE_PROTECTED IsWriteProtected; -} PCMCIA_INTERFACE_STANDARD, *PPCMCIA_INTERFACE_STANDARD; - -// -// Definitions for PCMCIA_BUS_INTERFACE_STANDARD. -// This interface is obtained using GUID_PCMCIA_BUS_INTERFACE_STANDARD -// and is used for reading/writing to PCMCIA config. space -// - -typedef -__drv_functionClass(PCMCIA_READ_CONFIG) -ULONG -PCMCIA_READ_CONFIG( - __in_opt PVOID Context, - __in ULONG WhichSpace, - __out_bcount_full(Length) PUCHAR Buffer, - __in ULONG Offset, - __in ULONG Length - ); -typedef PCMCIA_READ_CONFIG *PPCMCIA_READ_CONFIG; - -typedef -__drv_functionClass(PCMCIA_WRITE_CONFIG) -ULONG -PCMCIA_WRITE_CONFIG( - __in_opt PVOID Context, - __in ULONG WhichSpace, - __in_bcount(Length) PUCHAR Buffer, - __in ULONG Offset, - __in ULONG Length - ); -typedef PCMCIA_WRITE_CONFIG *PPCMCIA_WRITE_CONFIG; - -// -// WhichSpace for IRP_MN_READ_CONFIG/WRITE_CONFIG -// and PCMCIA_BUS_INTERFACE_STANDARD -// -typedef ULONG MEMORY_SPACE; - -#define PCCARD_PCI_CONFIGURATION_SPACE 0 // for cardbus cards -#define PCCARD_ATTRIBUTE_MEMORY 1 -#define PCCARD_COMMON_MEMORY 2 -#define PCCARD_ATTRIBUTE_MEMORY_INDIRECT 3 -#define PCCARD_COMMON_MEMORY_INDIRECT 4 - -// Legacy support -// -#define PCMCIA_CONFIG_SPACE PCCARD_ATTRIBUTE_MEMORY - -typedef struct _PCMCIA_BUS_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // standard PCMCIA bus interfaces - // - PPCMCIA_READ_CONFIG ReadConfig; - PPCMCIA_WRITE_CONFIG WriteConfig; -} PCMCIA_BUS_INTERFACE_STANDARD, *PPCMCIA_BUS_INTERFACE_STANDARD; - -#endif - -#ifdef __cplusplus -} -#endif -#endif - diff --git a/qt-correction-tool/pub/ddk/ntddsd.h b/qt-correction-tool/pub/ddk/ntddsd.h deleted file mode 100644 index 5328ed4..0000000 --- a/qt-correction-tool/pub/ddk/ntddsd.h +++ /dev/null @@ -1,468 +0,0 @@ -/*++ - -Copyright (c) 2002 Microsoft Corporation - -Module Name: - - ntddsd.h - -Abstract: - - This is the include file that defines the SD (aka Secure Digital) - bus driver interface. - - ---*/ - -#ifndef _NTDDSDH_ -#define _NTDDSDH_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -// -// Disable warning: named type definition in parentheses -// - -#pragma warning(disable:4201) - - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Use this version in the interface_data structure -// - -#define SDBUS_INTERFACE_VERSION 0x101 - -// -// Prototype of the callback routine which is called for SDIO -// devices to reflect device interrupts. -// - -__drv_functionClass(SDBUS_CALLBACK_ROUTINE) -__drv_sameIRQL -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -VOID -SDBUS_CALLBACK_ROUTINE( - __in PVOID CallbackRoutineContext, - __in ULONG InterruptType - ); - -typedef SDBUS_CALLBACK_ROUTINE *PSDBUS_CALLBACK_ROUTINE; - - -#define SDBUS_INTTYPE_DEVICE 0 - -// -// The interface parameters structure is passed to the InitializeInterface -// function in the SDBUS_INTERFACE_STANDARD -// - -typedef struct _SDBUS_INTERFACE_PARAMETERS { - USHORT Size; - USHORT Reserved; - - // - // Points to next lower device object in the device stack. - // - PDEVICE_OBJECT TargetObject; - - // - // This flag indicates whether the caller expects any device - // interrupts from the device. - // - BOOLEAN DeviceGeneratesInterrupts; - - // - // The caller can specify here the IRQL at which the callback - // function is entered. If this value is TRUE, the callback will - // be entered at DPC level. If this value is FALSE, the callback - // will be entered at passive level. - // - // Specifying TRUE will generally lower latency time of the interrupt - // delivery, at the cost of complicating the device driver, which - // must then deal with running at different IRQLs. - // - BOOLEAN CallbackAtDpcLevel; - - // - // When an IO device interrupts, the SD bus driver will generate a - // callback to this routine. The caller must supply this pointer if - // the field DeviceGeneratesInterrupts was set to TRUE; - // - PSDBUS_CALLBACK_ROUTINE CallbackRoutine; - - // - // The caller can specify here a context value which will be passed - // to the device interrupt callback routine. - // - PVOID CallbackRoutineContext; - -} SDBUS_INTERFACE_PARAMETERS, *PSDBUS_INTERFACE_PARAMETERS; - -// -// Prototype of function used to initialize the the interface once -// it has been opened. -// - -__checkReturn -__drv_sameIRQL -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -NTSTATUS -(*PSDBUS_INITIALIZE_INTERFACE_ROUTINE)( - __in PVOID Context, - __in PSDBUS_INTERFACE_PARAMETERS InterfaceParameters - ); - - -// -// Prototype of routine that the function driver must call -// when the function driver has completed its interrupt processing -// - -__drv_sameIRQL -__drv_maxIRQL(DISPATCH_LEVEL) -typedef -NTSTATUS -(*PSDBUS_ACKNOWLEDGE_INT_ROUTINE)( - __in PVOID Context - ); - - -// -// SDBUS_INTERFACE_STANDARD -// -// Interface Data structure used in the SdBusOpenInterface call. This -// structure defines the communication path between the SD function -// driver and the bus driver. -// - -DEFINE_GUID( GUID_SDBUS_INTERFACE_STANDARD, 0x6bb24d81L, 0xe924, 0x4825, 0xaf, 0x49, 0x3a, 0xcd, 0x33, 0xc1, 0xd8, 0x20 ); - - -typedef struct _SDBUS_INTERFACE_STANDARD { - USHORT Size; - USHORT Version; - // - // Interface Context - // - // This context pointer is filled in by the bus driver during the call - // to SdBusOpenInterface(). This data must be passed as a parameter to - // the other interface functions. - // - PVOID Context; - - // - // Interface Reference/Dereference maintain the interface's reference - // count. The reference count is automatically incremented to 1 when - // the interface is opened. The caller must dereference the interface - // under the following circumstances: - // a) the function driver receives a query_remove IRP - // b) the function driver receives a surprise_remove IRP - // c) the function driver receives a remove IRP without either a - // query_remove or a surprise_remove. - // - // In all cases, the function driver should dereference the interface - // before passing the respective IRP down to the bus driver. - // - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // - // After the interface has been opened, the bus driver will have filled - // in the pointer to the following routine which allows the function - // driver to set the parameters of the interface. - // - - PSDBUS_INITIALIZE_INTERFACE_ROUTINE InitializeInterface; - - // - // NTSTATUS SdBusAcknowledgeInterrupt(InterfaceContext) - // - // This routine is filled in by the call to SdBusOpenInterface(), - // and is used by the function driver to indicate when processing - // of an IO device interrupt is complete. - // - // When an IO function of an SD device asserts an interrupt, the bus - // driver will disable that interrupt to allow I/O operations to be - // sent to the device at a reasonable IRQL (that is, <=DISPATCH_LEVEL). - // - // When the function driver's callback routine, which is equivalent to - // an ISR, is done clearing the function's interrupt, this routine should - // be called to re-enable the IRQ for card interrupts. - // - // Callers must be running at IRQL <= DISPATCH_LEVEL. - // - // Returns STATUS_UNSUCCESSFUL if the InterfaceContext pointer is invalid. - // - - PSDBUS_ACKNOWLEDGE_INT_ROUTINE AcknowledgeInterrupt; - -} SDBUS_INTERFACE_STANDARD, *PSDBUS_INTERFACE_STANDARD; - - -// -// SdBusOpenInterface() -// -// This routine establishes a connection to the SD bus driver. -// It should be called in the AddDevice routine with the FDO for -// the device stack is created. -// -// If STATUS_SUCCESS is returned, then the InterfaceData structure -// is filled in with valid function pointers and an interface context -// parameter. The context pointer must be used in all other SD bus -// driver calls. -// -// Callers must be running at IRQL < DISPATCH_LEVEL. -// - -__checkReturn -__drv_sameIRQL -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -SdBusOpenInterface( - __in PDEVICE_OBJECT Pdo, - __out PSDBUS_INTERFACE_STANDARD InterfaceStandard, - __in USHORT Size, - __in USHORT Version - ); - - -// -// Definitions for properties used in Get/Set Property requests -// -// The bus driver version where any given property was introduced is -// indicated as a comment to the right of the property. Note that the -// property to retrieve the version was not introduced until v2.0. -// Callers can determine the bus driver is at version 1.0 by looking -// for a STATUS_INVALID_PARAMETER return from an get property call on -// SDP_BUS_DRIVER_VERSION. -// - -typedef enum { - SDP_MEDIA_CHANGECOUNT = 0, // v1.0 ULONG - SDP_MEDIA_STATE, // v1.0 SDPROP_MEDIA_STATE - SDP_WRITE_PROTECTED, // v1.0 BOOLEAN - SDP_FUNCTION_NUMBER, // v1.0 UCHAR - SDP_FUNCTION_TYPE, // v2.0 SDBUS_FUNCTION_TYPE - SDP_BUS_DRIVER_VERSION, // v2.0 USHORT - SDP_BUS_WIDTH, // v2.0 UCHAR - SDP_BUS_CLOCK, // v2.0 ULONG - SDP_BUS_INTERFACE_CONTROL, // v2.0 UCHAR - SDP_HOST_BLOCK_LENGTH, // v2.0 USHORT - SDP_FUNCTION_BLOCK_LENGTH, // v2.0 USHORT - SDP_FN0_BLOCK_LENGTH, // v2.0 USHORT - SDP_FUNCTION_INT_ENABLE, // v2.0 BOOLEAN -} SDBUS_PROPERTY; - -// -// Bus driver versions -// - -#define SDBUS_DRIVER_VERSION_1 0x100 -#define SDBUS_DRIVER_VERSION_2 0x200 - -// -// Media states defined for SDP_MEDIA_STATE -// - -typedef enum { - SDPMS_NO_MEDIA = 0, - SDPMS_MEDIA_INSERTED -} SDPROP_MEDIA_STATE; - - -// -// Values defined for SDP_FUNCTION_TYPE -// - -typedef enum { - SDBUS_FUNCTION_TYPE_UNKNOWN = 0, - SDBUS_FUNCTION_TYPE_SDIO, - SDBUS_FUNCTION_TYPE_SD_MEMORY, - SDBUS_FUNCTION_TYPE_MMC_MEMORY, -} SDBUS_FUNCTION_TYPE; - -#define IsTypeMemory(type) ((type == SDBUS_FUNCTION_TYPE_SD_MEMORY) || \ - (type == SDBUS_FUNCTION_TYPE_MMC_MEMORY)) -#define IsTypeIo(type) (type == SDBUS_FUNCTION_TYPE_SDIO) - - -// -// Data structures for request packets -// - -typedef enum { - SDRF_GET_PROPERTY, - SDRF_SET_PROPERTY, - SDRF_DEVICE_COMMAND -} SD_REQUEST_FUNCTION; - - -// -// SDBUS_REQUEST_PACKET -// -// This structure specifies parameters for individual requests -// and commands sent to the bus driver by SdBusSubmitRequest() -// - -typedef struct _SDBUS_REQUEST_PACKET { - - // - // specifies the parameters for the operation, and how they - // are interpreted - // - SD_REQUEST_FUNCTION RequestFunction; - - // - // These context fields are provided for the optional use of the caller. - // They are not referenced by the bus driver - // - PVOID UserContext[3]; - - // - // Information from the operation. Its usage is equivalent to - // the Irp->IoStatus.Information field. For example, the length - // of data transmitted for read/write operations will be filled - // in here by the bus driver. - // - ULONG_PTR Information; - - // - // Response data and length is returned by the device. Maximum - // returned is 16 bytes. The content of this field is defined - // in the SD spec. - // - union { - UCHAR AsUCHAR[16]; - ULONG AsULONG[4]; - SDRESP_TYPE3 Type3; - } ResponseData; - UCHAR ResponseLength; - - // - // Parameters to the individual functions - // - union { - - // - // The property functions allow the caller to control aspects of - // bus driver operation. - // - - struct { - SDBUS_PROPERTY Property; - PVOID Buffer; - ULONG Length; - } GetSetProperty; - - // - // DeviceCommand is the 'pipe' that allows SD device codes and arguments - // to be executed. These codes are either defined in the SD spec, - // can be based per device class, or can also be proprietary. - // - - struct { - SDCMD_DESCRIPTOR CmdDesc; - ULONG Argument; - PMDL Mdl; - ULONG Length; - } DeviceCommand; - - } Parameters; - - -} SDBUS_REQUEST_PACKET, *PSDBUS_REQUEST_PACKET; - - - -// -// SdBusSubmitRequest() -// SdBusSubmitRequestAsync() -// -// These routines send SD request packets to the bus driver. The SubmitRequest -// version is synchronous, and must be called at IRQL < DISPATCH_LEVEL. The -// SubmitRequestAsync version is asynchronous, and the user must supply an IRP -// and completion routine. -// -// Arguments: -// -// InterfaceContext - this is the context pointer returned by the -// SdBusOpenInterface() call. -// -// Packet - The parameters of the request are specified in this -// SDBUS_REQUEST_PACKET, which is allocated by the caller. -// -// Irp - The passed IRP will be used to transfer the request -// packet to the bus driver. It can either be a new irp -// allocated by the caller just for this request, or it can -// also be an IRP the caller is processing. The packet will -// be placed in the Parameters.Others.Argument1 of the IRP. -// -// CompletionRoutine- When the request is completed by the bus driver, this -// completion routine will be called. -// -// UserContext - This context will be passed to the specified CompletionRoutine -// -// Notes: -// -// Callers of SdBusSubmitRequest must be running at IRQL < DISPATCH_LEVEL. -// Callers of SdBusSubmitRequestAsync must be running at IRQL <= DISPATCH_LEVEL. -// - -__checkReturn -__drv_sameIRQL -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -SdBusSubmitRequest( - __in PVOID InterfaceContext, - __in PSDBUS_REQUEST_PACKET Packet - ); - - -__checkReturn -__drv_sameIRQL -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -SdBusSubmitRequestAsync( - __in PVOID InterfaceContext, - __in PSDBUS_REQUEST_PACKET Packet, - __in PIRP Irp, - __in PIO_COMPLETION_ROUTINE CompletionRoutine, - __in PVOID UserContext - ); - - -// -// IoControlCode values used in this interface. There normally should be no -// need to use these values directly, as SDBUS.LIB provides the support routines -// which issue these IOCTLs to the bus driver. -// -// - -#define IOCTL_SDBUS_BASE FILE_DEVICE_CONTROLLER -#define IOCTL_SD_SUBMIT_REQUEST CTL_CODE(IOCTL_SDBUS_BASE, 3100, METHOD_NEITHER, FILE_ANY_ACCESS) - - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#endif - diff --git a/qt-correction-tool/pub/ddk/ntddsfio.h b/qt-correction-tool/pub/ddk/ntddsfio.h deleted file mode 100644 index 307d7b4..0000000 --- a/qt-correction-tool/pub/ddk/ntddsfio.h +++ /dev/null @@ -1,60 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntddsfio.h - -Abstract: - - This is the include file that defines all common constants, ioctls and types - for Scheduled File I/O (SFIO). - -Revision History: - ---*/ -#if (NTDDI_VERSION >= NTDDI_VISTA) - -#pragma once - -typedef enum _IO_ACCESS_TYPE { - - // - // Indicates that the Io will - // be comprised solely of reads - // - ReadAccess, - - // - // Indicates that the Io will - // be comprised solely of writes - // - WriteAccess, - - // - // Indicates that the Io will be - // comprised of reads and writes - // - ModifyAccess - -} IO_ACCESS_TYPE; - -typedef enum _IO_ACCESS_MODE { - - // - // Indicates that the Io will be - // sent down in a sequential order - // - SequentialAccess, - - // - // Indicates that the Io might - // not be in a predictable order - // - RandomAccess - -} IO_ACCESS_MODE; - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - diff --git a/qt-correction-tool/pub/ddk/ntifs.h b/qt-correction-tool/pub/ddk/ntifs.h deleted file mode 100644 index 91d4630..0000000 --- a/qt-correction-tool/pub/ddk/ntifs.h +++ /dev/null @@ -1,18685 +0,0 @@ -/*++ BUILD Version: 0146 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntifs.h - -Abstract: - - This module defines the NT types, constants, and functions that are - exposed to file system drivers. - -Revision History: - ---*/ - -#ifndef _NTIFS_ -#define _NTIFS_ - -#define _NTIFS_INCLUDED_ - -#ifndef RC_INVOKED -#if _MSC_VER < 1300 -#error Compiler version not supported by Windows DDK -#endif -#endif // RC_INVOKED - -#ifndef __cplusplus -#pragma warning(disable:4116) // TYPE_ALIGNMENT generates this - move it - // outside the warning push/pop scope. -#endif - -#define NT_INCLUDED -#define _NTMSV1_0_ -#define _CTYPE_DISABLE_MACROS - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning(disable:4115) // named type definition in parentheses -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - - -#include -#include -#include -#include -#include -#include -#include - - -// -// These macros are used to test, set and clear flags respectivly -// - -#ifndef FlagOn -#define FlagOn(_F,_SF) ((_F) & (_SF)) -#endif - -#ifndef BooleanFlagOn -#define BooleanFlagOn(F,SF) ((BOOLEAN)(((F) & (SF)) != 0)) -#endif - -#ifndef SetFlag -#define SetFlag(_F,_SF) ((_F) |= (_SF)) -#endif - -#ifndef ClearFlag -#define ClearFlag(_F,_SF) ((_F) &= ~(_SF)) -#endif - -// -// Define types that are not exported. -// - -typedef struct _BUS_HANDLER *PBUS_HANDLER; -typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; -typedef struct _DEVICE_HANDLER_OBJECT *PDEVICE_HANDLER_OBJECT; -typedef struct _IO_TIMER *PIO_TIMER; -typedef struct _KINTERRUPT *PKINTERRUPT; -typedef struct _KPROCESS *PKPROCESS ,*PRKPROCESS, *PEPROCESS; -typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD, *PETHREAD; -typedef struct _OBJECT_TYPE *POBJECT_TYPE; -typedef struct _PEB *PPEB; -typedef struct _ACL *PACL; - -#ifdef __cplusplus -extern "C" { -#endif - -#define PsGetCurrentProcess IoGetCurrentProcess - -#if (NTDDI_VERSION >= NTDDI_VISTA) -extern NTSYSAPI volatile CCHAR KeNumberProcessors; -#elif (NTDDI_VERSION >= NTDDI_WINXP) -extern NTSYSAPI CCHAR KeNumberProcessors; -#else -extern PCCHAR KeNumberProcessors; -#endif - -typedef UNICODE_STRING LSA_UNICODE_STRING, *PLSA_UNICODE_STRING; -typedef STRING LSA_STRING, *PLSA_STRING; -typedef OBJECT_ATTRIBUTES LSA_OBJECT_ATTRIBUTES, *PLSA_OBJECT_ATTRIBUTES; - -#ifndef SID_IDENTIFIER_AUTHORITY_DEFINED -#define SID_IDENTIFIER_AUTHORITY_DEFINED -typedef struct _SID_IDENTIFIER_AUTHORITY { - UCHAR Value[6]; -} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY; -#endif - - -#ifndef SID_DEFINED -#define SID_DEFINED -typedef struct _SID { - UCHAR Revision; - UCHAR SubAuthorityCount; - SID_IDENTIFIER_AUTHORITY IdentifierAuthority; -#ifdef MIDL_PASS - [size_is(SubAuthorityCount)] ULONG SubAuthority[*]; -#else // MIDL_PASS - ULONG SubAuthority[ANYSIZE_ARRAY]; -#endif // MIDL_PASS -} SID, *PISID; -#endif - -#define SID_REVISION (1) // Current revision level -#define SID_MAX_SUB_AUTHORITIES (15) -#define SID_RECOMMENDED_SUB_AUTHORITIES (1) // Will change to around 6 - - // in a future release. -#ifndef MIDL_PASS -#define SECURITY_MAX_SID_SIZE \ - (sizeof(SID) - sizeof(ULONG) + (SID_MAX_SUB_AUTHORITIES * sizeof(ULONG))) -#endif // MIDL_PASS - - -typedef enum _SID_NAME_USE { - SidTypeUser = 1, - SidTypeGroup, - SidTypeDomain, - SidTypeAlias, - SidTypeWellKnownGroup, - SidTypeDeletedAccount, - SidTypeInvalid, - SidTypeUnknown, - SidTypeComputer, - SidTypeLabel -} SID_NAME_USE, *PSID_NAME_USE; - -typedef struct _SID_AND_ATTRIBUTES { -#ifdef MIDL_PASS - PISID Sid; -#else // MIDL_PASS - PSID Sid; -#endif // MIDL_PASS - ULONG Attributes; - } SID_AND_ATTRIBUTES, * PSID_AND_ATTRIBUTES; - -typedef SID_AND_ATTRIBUTES SID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; -typedef SID_AND_ATTRIBUTES_ARRAY *PSID_AND_ATTRIBUTES_ARRAY; - -#define SID_HASH_SIZE 32 -typedef ULONG_PTR SID_HASH_ENTRY, *PSID_HASH_ENTRY; - -typedef struct _SID_AND_ATTRIBUTES_HASH { - ULONG SidCount; - PSID_AND_ATTRIBUTES SidAttr; - SID_HASH_ENTRY Hash[SID_HASH_SIZE]; -} SID_AND_ATTRIBUTES_HASH, *PSID_AND_ATTRIBUTES_HASH; - - -///////////////////////////////////////////////////////////////////////////// -// // -// Universal well-known SIDs // -// // -// Null SID S-1-0-0 // -// World S-1-1-0 // -// Local S-1-2-0 // -// Creator Owner ID S-1-3-0 // -// Creator Group ID S-1-3-1 // -// Creator Owner Server ID S-1-3-2 // -// Creator Group Server ID S-1-3-3 // -// // -// (Non-unique IDs) S-1-4 // -// // -///////////////////////////////////////////////////////////////////////////// - -#define SECURITY_NULL_SID_AUTHORITY {0,0,0,0,0,0} -#define SECURITY_WORLD_SID_AUTHORITY {0,0,0,0,0,1} -#define SECURITY_LOCAL_SID_AUTHORITY {0,0,0,0,0,2} -#define SECURITY_CREATOR_SID_AUTHORITY {0,0,0,0,0,3} -#define SECURITY_NON_UNIQUE_AUTHORITY {0,0,0,0,0,4} -#define SECURITY_RESOURCE_MANAGER_AUTHORITY {0,0,0,0,0,9} - - -#define SECURITY_NULL_RID (0x00000000L) -#define SECURITY_WORLD_RID (0x00000000L) -#define SECURITY_LOCAL_RID (0x00000000L) -#define SECURITY_LOCAL_LOGON_RID (0x00000001L) - -#define SECURITY_CREATOR_OWNER_RID (0x00000000L) -#define SECURITY_CREATOR_GROUP_RID (0x00000001L) - -#define SECURITY_CREATOR_OWNER_SERVER_RID (0x00000002L) -#define SECURITY_CREATOR_GROUP_SERVER_RID (0x00000003L) - -#define SECURITY_CREATOR_OWNER_RIGHTS_RID (0x00000004L) - -/////////////////////////////////////////////////////////////////////////////// -// // -// NT well-known SIDs // -// // -// NT Authority S-1-5 // -// Dialup S-1-5-1 // -// // -// Network S-1-5-2 // -// Batch S-1-5-3 // -// Interactive S-1-5-4 // -// (Logon IDs) S-1-5-5-X-Y // -// Service S-1-5-6 // -// AnonymousLogon S-1-5-7 (aka null logon session) // -// Proxy S-1-5-8 // -// Enterprise DC (EDC) S-1-5-9 (aka domain controller account) // -// Self S-1-5-10 (self RID) // -// Authenticated User S-1-5-11 (Authenticated user somewhere) // -// Restricted Code S-1-5-12 (Running restricted code) // -// Terminal Server S-1-5-13 (Running on Terminal Server) // -// Remote Logon S-1-5-14 (Remote Interactive Logon) // -// This Organization S-1-5-15 // -// // -// IUser S-1-5-17 -// Local System S-1-5-18 // -// Local Service S-1-5-19 // -// Network Service S-1-5-20 // -// // -// (NT non-unique IDs) S-1-5-0x15-... (NT Domain Sids) // -// // -// (Built-in domain) S-1-5-0x20 // -// // -// (Security Package IDs) S-1-5-0x40 // -// NTLM Authentication S-1-5-0x40-10 // -// SChannel Authentication S-1-5-0x40-14 // -// Digest Authentication S-1-5-0x40-21 // -// // -// Other Organization S-1-5-1000 (>=1000 can not be filtered) // -// // -// // -// NOTE: the relative identifier values (RIDs) determine which security // -// boundaries the SID is allowed to cross. Before adding new RIDs, // -// a determination needs to be made regarding which range they should // -// be added to in order to ensure proper "SID filtering" // -// // -/////////////////////////////////////////////////////////////////////////////// - - -#define SECURITY_NT_AUTHORITY {0,0,0,0,0,5} // ntifs - -#define SECURITY_DIALUP_RID (0x00000001L) -#define SECURITY_NETWORK_RID (0x00000002L) -#define SECURITY_BATCH_RID (0x00000003L) -#define SECURITY_INTERACTIVE_RID (0x00000004L) -#define SECURITY_LOGON_IDS_RID (0x00000005L) -#define SECURITY_LOGON_IDS_RID_COUNT (3L) -#define SECURITY_SERVICE_RID (0x00000006L) -#define SECURITY_ANONYMOUS_LOGON_RID (0x00000007L) -#define SECURITY_PROXY_RID (0x00000008L) -#define SECURITY_ENTERPRISE_CONTROLLERS_RID (0x00000009L) -#define SECURITY_SERVER_LOGON_RID SECURITY_ENTERPRISE_CONTROLLERS_RID -#define SECURITY_PRINCIPAL_SELF_RID (0x0000000AL) -#define SECURITY_AUTHENTICATED_USER_RID (0x0000000BL) -#define SECURITY_RESTRICTED_CODE_RID (0x0000000CL) -#define SECURITY_TERMINAL_SERVER_RID (0x0000000DL) -#define SECURITY_REMOTE_LOGON_RID (0x0000000EL) -#define SECURITY_THIS_ORGANIZATION_RID (0x0000000FL) -#define SECURITY_IUSER_RID (0x00000011L) -#define SECURITY_LOCAL_SYSTEM_RID (0x00000012L) -#define SECURITY_LOCAL_SERVICE_RID (0x00000013L) -#define SECURITY_NETWORK_SERVICE_RID (0x00000014L) - -#define SECURITY_NT_NON_UNIQUE (0x00000015L) -#define SECURITY_NT_NON_UNIQUE_SUB_AUTH_COUNT (3L) - -#define SECURITY_ENTERPRISE_READONLY_CONTROLLERS_RID (0x00000016L) - -#define SECURITY_BUILTIN_DOMAIN_RID (0x00000020L) -#define SECURITY_WRITE_RESTRICTED_CODE_RID (0x00000021L) - - -#define SECURITY_PACKAGE_BASE_RID (0x00000040L) -#define SECURITY_PACKAGE_RID_COUNT (2L) -#define SECURITY_PACKAGE_NTLM_RID (0x0000000AL) -#define SECURITY_PACKAGE_SCHANNEL_RID (0x0000000EL) -#define SECURITY_PACKAGE_DIGEST_RID (0x00000015L) - -#define SECURITY_CRED_TYPE_BASE_RID (0x00000041L) -#define SECURITY_CRED_TYPE_RID_COUNT (2L) -#define SECURITY_CRED_TYPE_THIS_ORG_CERT_RID (0x00000001L) - -#define SECURITY_MIN_BASE_RID (0x00000050L) - -#define SECURITY_SERVICE_ID_BASE_RID (0x00000050L) -#define SECURITY_SERVICE_ID_RID_COUNT (6L) - -#define SECURITY_RESERVED_ID_BASE_RID (0x00000051L) - -#define SECURITY_APPPOOL_ID_BASE_RID (0x00000052L) -#define SECURITY_APPPOOL_ID_RID_COUNT (6L) - -#define SECURITY_VIRTUALSERVER_ID_BASE_RID (0x00000053L) -#define SECURITY_VIRTUALSERVER_ID_RID_COUNT (6L) - -#define SECURITY_USERMODEDRIVERHOST_ID_BASE_RID (0x00000054L) -#define SECURITY_USERMODEDRIVERHOST_ID_RID_COUNT (6L) - -#define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_BASE_RID (0x00000055L) -#define SECURITY_CLOUD_INFRASTRUCTURE_SERVICES_ID_RID_COUNT (6L) - -#define SECURITY_WMIHOST_ID_BASE_RID (0x00000056L) -#define SECURITY_WMIHOST_ID_RID_COUNT (6L) - -#define SECURITY_TASK_ID_BASE_RID (0x00000057L) - -#define SECURITY_NFS_ID_BASE_RID (0x00000058L) - -#define SECURITY_COM_ID_BASE_RID (0x00000059L) - -#define SECURITY_VIRTUALACCOUNT_ID_RID_COUNT (6L) - -#define SECURITY_MAX_BASE_RID (0x0000006FL) -#define SECURITY_MAX_ALWAYS_FILTERED (0x000003E7L) -#define SECURITY_MIN_NEVER_FILTERED (0x000003E8L) - -#define SECURITY_OTHER_ORGANIZATION_RID (0x000003E8L) - -// -//Service SID type RIDs are in the range 0x50- 0x6F. Therefore, we are giving the next available RID to Windows Mobile team. -// -#define SECURITY_WINDOWSMOBILE_ID_BASE_RID (0x00000070L) - - -///////////////////////////////////////////////////////////////////////////// -// // -// well-known domain relative sub-authority values (RIDs)... // -// // -///////////////////////////////////////////////////////////////////////////// - - - -#define DOMAIN_GROUP_RID_ENTERPRISE_READONLY_DOMAIN_CONTROLLERS (0x000001F2L) - -#define FOREST_USER_RID_MAX (0x000001F3L) - -// Well-known users ... - -#define DOMAIN_USER_RID_ADMIN (0x000001F4L) -#define DOMAIN_USER_RID_GUEST (0x000001F5L) -#define DOMAIN_USER_RID_KRBTGT (0x000001F6L) - -#define DOMAIN_USER_RID_MAX (0x000003E7L) - - -// well-known groups ... - -#define DOMAIN_GROUP_RID_ADMINS (0x00000200L) -#define DOMAIN_GROUP_RID_USERS (0x00000201L) -#define DOMAIN_GROUP_RID_GUESTS (0x00000202L) -#define DOMAIN_GROUP_RID_COMPUTERS (0x00000203L) -#define DOMAIN_GROUP_RID_CONTROLLERS (0x00000204L) -#define DOMAIN_GROUP_RID_CERT_ADMINS (0x00000205L) -#define DOMAIN_GROUP_RID_SCHEMA_ADMINS (0x00000206L) -#define DOMAIN_GROUP_RID_ENTERPRISE_ADMINS (0x00000207L) -#define DOMAIN_GROUP_RID_POLICY_ADMINS (0x00000208L) -#define DOMAIN_GROUP_RID_READONLY_CONTROLLERS (0x00000209L) - -// well-known aliases ... - -#define DOMAIN_ALIAS_RID_ADMINS (0x00000220L) -#define DOMAIN_ALIAS_RID_USERS (0x00000221L) -#define DOMAIN_ALIAS_RID_GUESTS (0x00000222L) -#define DOMAIN_ALIAS_RID_POWER_USERS (0x00000223L) - -#define DOMAIN_ALIAS_RID_ACCOUNT_OPS (0x00000224L) -#define DOMAIN_ALIAS_RID_SYSTEM_OPS (0x00000225L) -#define DOMAIN_ALIAS_RID_PRINT_OPS (0x00000226L) -#define DOMAIN_ALIAS_RID_BACKUP_OPS (0x00000227L) - -#define DOMAIN_ALIAS_RID_REPLICATOR (0x00000228L) -#define DOMAIN_ALIAS_RID_RAS_SERVERS (0x00000229L) -#define DOMAIN_ALIAS_RID_PREW2KCOMPACCESS (0x0000022AL) -#define DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS (0x0000022BL) -#define DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS (0x0000022CL) -#define DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS (0x0000022DL) - -#define DOMAIN_ALIAS_RID_MONITORING_USERS (0x0000022EL) -#define DOMAIN_ALIAS_RID_LOGGING_USERS (0x0000022FL) -#define DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS (0x00000230L) -#define DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS (0x00000231L) -#define DOMAIN_ALIAS_RID_DCOM_USERS (0x00000232L) -#define DOMAIN_ALIAS_RID_IUSERS (0x00000238L) -#define DOMAIN_ALIAS_RID_CRYPTO_OPERATORS (0x00000239L) -#define DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP (0x0000023BL) -#define DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP (0x0000023CL) -#define DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP (0x0000023DL) -#define DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP (0x0000023EL) - - -#define SECURITY_MANDATORY_LABEL_AUTHORITY {0,0,0,0,0,16} -#define SECURITY_MANDATORY_UNTRUSTED_RID (0x00000000L) -#define SECURITY_MANDATORY_LOW_RID (0x00001000L) -#define SECURITY_MANDATORY_MEDIUM_RID (0x00002000L) -#define SECURITY_MANDATORY_MEDIUM_PLUS_RID (SECURITY_MANDATORY_MEDIUM_RID + 0x100) -#define SECURITY_MANDATORY_HIGH_RID (0x00003000L) -#define SECURITY_MANDATORY_SYSTEM_RID (0x00004000L) -#define SECURITY_MANDATORY_PROTECTED_PROCESS_RID (0x00005000L) - -// -// SECURITY_MANDATORY_MAXIMUM_USER_RID is the highest RID that -// can be set by a usermode caller. -// - -#define SECURITY_MANDATORY_MAXIMUM_USER_RID SECURITY_MANDATORY_SYSTEM_RID - -#define MANDATORY_LEVEL_TO_MANDATORY_RID(IL) (IL * 0x1000) - -// -// Allocate the System Luid. The first 1000 LUIDs are reserved. -// Use #999 here (0x3e7 = 999) -// - -#define SYSTEM_LUID { 0x3e7, 0x0 } -#define ANONYMOUS_LOGON_LUID { 0x3e6, 0x0 } -#define LOCALSERVICE_LUID { 0x3e5, 0x0 } -#define NETWORKSERVICE_LUID { 0x3e4, 0x0 } -#define IUSER_LUID { 0x3e3, 0x0 } - - -// -// The structure of an ACE is a common ace header followed by ace type -// specific data. Pictorally the structure of the common ace header is -// as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---------------+-------+-------+---------------+---------------+ -// | AceSize | AceFlags | AceType | -// +---------------+-------+-------+---------------+---------------+ -// -// AceType denotes the type of the ace, there are some predefined ace -// types -// -// AceSize is the size, in bytes, of ace. -// -// AceFlags are the Ace flags for audit and inheritance, defined shortly. - -typedef struct _ACE_HEADER { - UCHAR AceType; - UCHAR AceFlags; - USHORT AceSize; -} ACE_HEADER; -typedef ACE_HEADER *PACE_HEADER; - -// -// The following are the predefined ace types that go into the AceType -// field of an Ace header. -// - -#define ACCESS_MIN_MS_ACE_TYPE (0x0) -#define ACCESS_ALLOWED_ACE_TYPE (0x0) -#define ACCESS_DENIED_ACE_TYPE (0x1) -#define SYSTEM_AUDIT_ACE_TYPE (0x2) -#define SYSTEM_ALARM_ACE_TYPE (0x3) -#define ACCESS_MAX_MS_V2_ACE_TYPE (0x3) - -#define ACCESS_ALLOWED_COMPOUND_ACE_TYPE (0x4) -#define ACCESS_MAX_MS_V3_ACE_TYPE (0x4) - -#define ACCESS_MIN_MS_OBJECT_ACE_TYPE (0x5) -#define ACCESS_ALLOWED_OBJECT_ACE_TYPE (0x5) -#define ACCESS_DENIED_OBJECT_ACE_TYPE (0x6) -#define SYSTEM_AUDIT_OBJECT_ACE_TYPE (0x7) -#define SYSTEM_ALARM_OBJECT_ACE_TYPE (0x8) -#define ACCESS_MAX_MS_OBJECT_ACE_TYPE (0x8) - -#define ACCESS_MAX_MS_V4_ACE_TYPE (0x8) -#define ACCESS_MAX_MS_ACE_TYPE (0x8) - -#define ACCESS_ALLOWED_CALLBACK_ACE_TYPE (0x9) -#define ACCESS_DENIED_CALLBACK_ACE_TYPE (0xA) -#define ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE (0xB) -#define ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE (0xC) -#define SYSTEM_AUDIT_CALLBACK_ACE_TYPE (0xD) -#define SYSTEM_ALARM_CALLBACK_ACE_TYPE (0xE) -#define SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE (0xF) -#define SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE (0x10) - -#define SYSTEM_MANDATORY_LABEL_ACE_TYPE (0x11) -#define ACCESS_MAX_MS_V5_ACE_TYPE (0x11) - -// end_winnt - - -// begin_winnt - -// -// The following are the inherit flags that go into the AceFlags field -// of an Ace header. -// - -#define OBJECT_INHERIT_ACE (0x1) -#define CONTAINER_INHERIT_ACE (0x2) -#define NO_PROPAGATE_INHERIT_ACE (0x4) -#define INHERIT_ONLY_ACE (0x8) -#define INHERITED_ACE (0x10) -#define VALID_INHERIT_FLAGS (0x1F) - - -// The following are the currently defined ACE flags that go into the -// AceFlags field of an ACE header. Each ACE type has its own set of -// AceFlags. -// -// SUCCESSFUL_ACCESS_ACE_FLAG - used only with system audit and alarm ACE -// types to indicate that a message is generated for successful accesses. -// -// FAILED_ACCESS_ACE_FLAG - used only with system audit and alarm ACE types -// to indicate that a message is generated for failed accesses. -// - -// -// SYSTEM_AUDIT and SYSTEM_ALARM AceFlags -// -// These control the signaling of audit and alarms for success or failure. -// - -#define SUCCESSFUL_ACCESS_ACE_FLAG (0x40) -#define FAILED_ACCESS_ACE_FLAG (0x80) - - -// -// We'll define the structure of the predefined ACE types. Pictorally -// the structure of the predefined ACE's is as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---------------+-------+-------+---------------+---------------+ -// | AceFlags | Resd |Inherit| AceSize | AceType | -// +---------------+-------+-------+---------------+---------------+ -// | Mask | -// +---------------------------------------------------------------+ -// | | -// + + -// | | -// + Sid + -// | | -// + + -// | | -// +---------------------------------------------------------------+ -// -// Mask is the access mask associated with the ACE. This is either the -// access allowed, access denied, audit, or alarm mask. -// -// Sid is the Sid associated with the ACE. -// - -// The following are the four predefined ACE types. - -// Examine the AceType field in the Header to determine -// which structure is appropriate to use for casting. - - -typedef struct _ACCESS_ALLOWED_ACE { - ACE_HEADER Header; - ACCESS_MASK Mask; - ULONG SidStart; -} ACCESS_ALLOWED_ACE; - -typedef ACCESS_ALLOWED_ACE *PACCESS_ALLOWED_ACE; - -typedef struct _ACCESS_DENIED_ACE { - ACE_HEADER Header; - ACCESS_MASK Mask; - ULONG SidStart; -} ACCESS_DENIED_ACE; -typedef ACCESS_DENIED_ACE *PACCESS_DENIED_ACE; - -typedef struct _SYSTEM_AUDIT_ACE { - ACE_HEADER Header; - ACCESS_MASK Mask; - ULONG SidStart; -} SYSTEM_AUDIT_ACE; -typedef SYSTEM_AUDIT_ACE *PSYSTEM_AUDIT_ACE; - -typedef struct _SYSTEM_ALARM_ACE { - ACE_HEADER Header; - ACCESS_MASK Mask; - ULONG SidStart; -} SYSTEM_ALARM_ACE; -typedef SYSTEM_ALARM_ACE *PSYSTEM_ALARM_ACE; - -typedef struct _SYSTEM_MANDATORY_LABEL_ACE { - ACE_HEADER Header; - ACCESS_MASK Mask; - ULONG SidStart; -} SYSTEM_MANDATORY_LABEL_ACE, *PSYSTEM_MANDATORY_LABEL_ACE; - -#define SYSTEM_MANDATORY_LABEL_NO_WRITE_UP 0x1 -#define SYSTEM_MANDATORY_LABEL_NO_READ_UP 0x2 -#define SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP 0x4 - -#define SYSTEM_MANDATORY_LABEL_VALID_MASK (SYSTEM_MANDATORY_LABEL_NO_WRITE_UP | \ - SYSTEM_MANDATORY_LABEL_NO_READ_UP | \ - SYSTEM_MANDATORY_LABEL_NO_EXECUTE_UP) - -#define SECURITY_DESCRIPTOR_MIN_LENGTH (sizeof(SECURITY_DESCRIPTOR)) - - -typedef USHORT SECURITY_DESCRIPTOR_CONTROL, *PSECURITY_DESCRIPTOR_CONTROL; - -#define SE_OWNER_DEFAULTED (0x0001) -#define SE_GROUP_DEFAULTED (0x0002) -#define SE_DACL_PRESENT (0x0004) -#define SE_DACL_DEFAULTED (0x0008) -#define SE_SACL_PRESENT (0x0010) -#define SE_SACL_DEFAULTED (0x0020) -// end_winnt -#define SE_DACL_UNTRUSTED (0x0040) -#define SE_SERVER_SECURITY (0x0080) -// begin_winnt -#define SE_DACL_AUTO_INHERIT_REQ (0x0100) -#define SE_SACL_AUTO_INHERIT_REQ (0x0200) -#define SE_DACL_AUTO_INHERITED (0x0400) -#define SE_SACL_AUTO_INHERITED (0x0800) -#define SE_DACL_PROTECTED (0x1000) -#define SE_SACL_PROTECTED (0x2000) -#define SE_RM_CONTROL_VALID (0x4000) -#define SE_SELF_RELATIVE (0x8000) - -// -// Where: -// -// SE_OWNER_DEFAULTED - This boolean flag, when set, indicates that the -// SID pointed to by the Owner field was provided by a -// defaulting mechanism rather than explicitly provided by the -// original provider of the security descriptor. This may -// affect the treatment of the SID with respect to inheritence -// of an owner. -// -// SE_GROUP_DEFAULTED - This boolean flag, when set, indicates that the -// SID in the Group field was provided by a defaulting mechanism -// rather than explicitly provided by the original provider of -// the security descriptor. This may affect the treatment of -// the SID with respect to inheritence of a primary group. -// -// SE_DACL_PRESENT - This boolean flag, when set, indicates that the -// security descriptor contains a discretionary ACL. If this -// flag is set and the Dacl field of the SECURITY_DESCRIPTOR is -// null, then a null ACL is explicitly being specified. -// -// SE_DACL_DEFAULTED - This boolean flag, when set, indicates that the -// ACL pointed to by the Dacl field was provided by a defaulting -// mechanism rather than explicitly provided by the original -// provider of the security descriptor. This may affect the -// treatment of the ACL with respect to inheritence of an ACL. -// This flag is ignored if the DaclPresent flag is not set. -// -// SE_SACL_PRESENT - This boolean flag, when set, indicates that the -// security descriptor contains a system ACL pointed to by the -// Sacl field. If this flag is set and the Sacl field of the -// SECURITY_DESCRIPTOR is null, then an empty (but present) -// ACL is being specified. -// -// SE_SACL_DEFAULTED - This boolean flag, when set, indicates that the -// ACL pointed to by the Sacl field was provided by a defaulting -// mechanism rather than explicitly provided by the original -// provider of the security descriptor. This may affect the -// treatment of the ACL with respect to inheritence of an ACL. -// This flag is ignored if the SaclPresent flag is not set. -// -// end_winnt -// SE_DACL_TRUSTED - This boolean flag, when set, indicates that the -// ACL pointed to by the Dacl field was provided by a trusted source -// and does not require any editing of compound ACEs. If this flag -// is not set and a compound ACE is encountered, the system will -// substitute known valid SIDs for the server SIDs in the ACEs. -// -// SE_SERVER_SECURITY - This boolean flag, when set, indicates that the -// caller wishes the system to create a Server ACL based on the -// input ACL, regardess of its source (explicit or defaulting. -// This is done by replacing all of the GRANT ACEs with compound -// ACEs granting the current server. This flag is only -// meaningful if the subject is impersonating. -// -// begin_winnt -// SE_SELF_RELATIVE - This boolean flag, when set, indicates that the -// security descriptor is in self-relative form. In this form, -// all fields of the security descriptor are contiguous in memory -// and all pointer fields are expressed as offsets from the -// beginning of the security descriptor. This form is useful -// for treating security descriptors as opaque data structures -// for transmission in communication protocol or for storage on -// secondary media. -// -// -// -// Pictorially the structure of a security descriptor is as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---------------------------------------------------------------+ -// | Control |Reserved1 (SBZ)| Revision | -// +---------------------------------------------------------------+ -// | Owner | -// +---------------------------------------------------------------+ -// | Group | -// +---------------------------------------------------------------+ -// | Sacl | -// +---------------------------------------------------------------+ -// | Dacl | -// +---------------------------------------------------------------+ -// -// In general, this data structure should be treated opaquely to ensure future -// compatibility. -// -// - -typedef struct _SECURITY_DESCRIPTOR_RELATIVE { - UCHAR Revision; - UCHAR Sbz1; - SECURITY_DESCRIPTOR_CONTROL Control; - ULONG Owner; - ULONG Group; - ULONG Sacl; - ULONG Dacl; - } SECURITY_DESCRIPTOR_RELATIVE, *PISECURITY_DESCRIPTOR_RELATIVE; - -typedef struct _SECURITY_DESCRIPTOR { - UCHAR Revision; - UCHAR Sbz1; - SECURITY_DESCRIPTOR_CONTROL Control; - PSID Owner; - PSID Group; - PACL Sacl; - PACL Dacl; - - } SECURITY_DESCRIPTOR, *PISECURITY_DESCRIPTOR; - - - -//////////////////////////////////////////////////////////////////////// -// // -// Object Type list for AccessCheckByType // -// // -//////////////////////////////////////////////////////////////////////// - -typedef struct _OBJECT_TYPE_LIST { - USHORT Level; - USHORT Sbz; - GUID *ObjectType; -} OBJECT_TYPE_LIST, *POBJECT_TYPE_LIST; - -// -// DS values for Level -// - -#define ACCESS_OBJECT_GUID 0 -#define ACCESS_PROPERTY_SET_GUID 1 -#define ACCESS_PROPERTY_GUID 2 - -#define ACCESS_MAX_LEVEL 4 - -// -// Parameters to NtAccessCheckByTypeAndAditAlarm -// - -typedef enum _AUDIT_EVENT_TYPE { - AuditEventObjectAccess, - AuditEventDirectoryServiceAccess -} AUDIT_EVENT_TYPE, *PAUDIT_EVENT_TYPE; - -#define AUDIT_ALLOW_NO_PRIVILEGE 0x1 - -// -// DS values for Source and ObjectTypeName -// - -#define ACCESS_DS_SOURCE_A "DS" -#define ACCESS_DS_SOURCE_W L"DS" -#define ACCESS_DS_OBJECT_TYPE_NAME_A "Directory Service Object" -#define ACCESS_DS_OBJECT_TYPE_NAME_W L"Directory Service Object" - -//////////////////////////////////////////////////////////////////////// -// // -// Privilege Related Data Structures // -// // -//////////////////////////////////////////////////////////////////////// - - - -// -// Values for different access granted\denied reasons: -// AccessReasonAceN = AccessReasonAce + N. -// AccessReasonPrivilegeN = AccessReasonPrivilege + N. -// - -#define ACCESS_REASON_TYPE_MASK 0xffff0000 -#define ACCESS_REASON_DATA_MASK 0x0000ffff - -typedef enum _ACCESS_REASON_TYPE{ - - AccessReasonNone = 0x00000000, // Indicate no reason for the bit. The bit may not be checked, or just no known reason. - - // - // The lowest 2 bytes store the index of the ACE that grant/deny this bit. - // If the corresponding access maskt is zero, then it is deny ACE; otherwise, - // it is allow ACE. - // - AccessReasonAllowedAce = 0x00010000, // Granted a permission. - AccessReasonDeniedAce = 0x00020000, // Denied a permission. - - AccessReasonAllowedParentAce = 0x00030000, // Granted a permission from parent ACE - AccessReasonDeniedParentAce = 0x00040000, // Denied a permission from parent ACE - - AccessReasonMissingPrivilege = 0x00100000, - AccessReasonFromPrivilege = 0x00200000, - - - AccessReasonIntegrityLevel = 0x00300000, - - AccessReasonOwnership = 0x00400000, - - AccessReasonNullDacl = 0x00500000, - AccessReasonEmptyDacl = 0x00600000, - - AccessReasonNoSD = 0x00700000, - AccessReasonNoGrant = 0x00800000 // this access bit is not granted by any ACE. -} ACCESS_REASON_TYPE; - - // -// Structure to hold access denied\granted reason for every bit of ACCESS_MASK. -// There are 32-bits in ACCESS_MASK and only 27-bits are actually valid on -// return from AccessCheck because MAXIMUM_ALLOWED, GENERIC_READ, -// GENERIC_WRITE, GENERIC_EXECUTE, and GENERIC_ALL are never returned. -// -// The content in Data fields depends on the Access Reason, for example, -// if the reason is AccessReasonAce, the Data will be the ACE ID. -// If there are more than one reason (more than one bit is set), the array size -// of the Data is equal to the number of bits set (or number of reasons). -// The Data could be null for a particular reason. -// - -typedef ULONG ACCESS_REASON; - -typedef struct _ACCESS_REASONS{ - ACCESS_REASON Data[32]; -} ACCESS_REASONS, *PACCESS_REASONS; - - -/* -The following data structures are defined to consolidate various falvors of -access check functions. In particular for Windows 7, the new access check -function will enable security attribute check, plus returning the reason -for a access check result. - -The new access check function based on these data structures will -form the foundation to reimplement other flavors of access check -functions. - -*/ - -// -// Structure to hold pointer to security descriptor and its unique id, which -// can be used for caching access check results. -// (NOTE NOTE) The cache key can be constructed by SecurityDescriptorId, Token and -// PrincipalSelfSid. Watch how GenericMapping affects the cache results. -// -#define SE_SECURITY_DESCRIPTOR_FLAG_NO_OWNER_ACE 0x00000001 -#define SE_SECURITY_DESCRIPTOR_FLAG_NO_LABEL_ACE 0x00000002 -#define SE_SECURITY_DESCRIPTOR_VALID_FLAGS 0x00000003 - -typedef struct _SE_SECURITY_DESCRIPTOR -{ - ULONG Size; - ULONG Flags; - PSECURITY_DESCRIPTOR SecurityDescriptor; -} SE_SECURITY_DESCRIPTOR, *PSE_SECURITY_DESCRIPTOR; - -typedef struct _SE_ACCESS_REQUEST -{ - ULONG Size; - PSE_SECURITY_DESCRIPTOR SeSecurityDescriptor; - ACCESS_MASK DesiredAccess; - ACCESS_MASK PreviouslyGrantedAccess; - PSID PrincipalSelfSid; // Need to watch how this field affects the cache. - PGENERIC_MAPPING GenericMapping; - ULONG ObjectTypeListCount; - POBJECT_TYPE_LIST ObjectTypeList; -} SE_ACCESS_REQUEST, *PSE_ACCESS_REQUEST; - - -typedef struct _SE_ACCESS_REPLY -{ - ULONG Size; - ULONG ResultListCount; // Indicate the array size of GrantedAccess and AccessStatus, it only can be either 1 or ObjectTypeListCount. - PACCESS_MASK GrantedAccess; - PNTSTATUS AccessStatus; - PACCESS_REASONS AccessReason; - PPRIVILEGE_SET* Privileges; -} SE_ACCESS_REPLY, *PSE_ACCESS_REPLY; - -// end_winnt - -typedef enum _SE_AUDIT_OPERATION -{ - AuditPrivilegeObject, - AuditPrivilegeService, - AuditAccessCheck, - AuditOpenObject, - AuditOpenObjectWithTransaction, - AuditCloseObject, - AuditDeleteObject, - AuditOpenObjectForDelete, - AuditOpenObjectForDeleteWithTransaction, - AuditCloseNonObject, - AuditOpenNonObject, - AuditObjectReference, - AuditHandleCreation, -} SE_AUDIT_OPERATION, *PSE_AUDIT_OPERATION; - - - -typedef struct _SE_AUDIT_INFO -{ - ULONG Size; - AUDIT_EVENT_TYPE AuditType; - SE_AUDIT_OPERATION AuditOperation; - ULONG AuditFlags; - UNICODE_STRING SubsystemName; - UNICODE_STRING ObjectTypeName; - UNICODE_STRING ObjectName; - PVOID HandleId; - GUID* TransactionId; - LUID* OperationId; - BOOLEAN ObjectCreation; - BOOLEAN GenerateOnClose; -} SE_AUDIT_INFO, *PSE_AUDIT_INFO; - - - -//////////////////////////////////////////////////////////////////// -// // -// Token Object Definitions // -// // -// // -//////////////////////////////////////////////////////////////////// - - -// -// Token Specific Access Rights. -// - -#define TOKEN_ASSIGN_PRIMARY (0x0001) -#define TOKEN_DUPLICATE (0x0002) -#define TOKEN_IMPERSONATE (0x0004) -#define TOKEN_QUERY (0x0008) -#define TOKEN_QUERY_SOURCE (0x0010) -#define TOKEN_ADJUST_PRIVILEGES (0x0020) -#define TOKEN_ADJUST_GROUPS (0x0040) -#define TOKEN_ADJUST_DEFAULT (0x0080) -#define TOKEN_ADJUST_SESSIONID (0x0100) - -#define TOKEN_ALL_ACCESS_P (STANDARD_RIGHTS_REQUIRED |\ - TOKEN_ASSIGN_PRIMARY |\ - TOKEN_DUPLICATE |\ - TOKEN_IMPERSONATE |\ - TOKEN_QUERY |\ - TOKEN_QUERY_SOURCE |\ - TOKEN_ADJUST_PRIVILEGES |\ - TOKEN_ADJUST_GROUPS |\ - TOKEN_ADJUST_DEFAULT ) - -#if ((defined(_WIN32_WINNT) && (_WIN32_WINNT > 0x0400)) || (!defined(_WIN32_WINNT))) -#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P |\ - TOKEN_ADJUST_SESSIONID ) -#else -#define TOKEN_ALL_ACCESS (TOKEN_ALL_ACCESS_P) -#endif - -#define TOKEN_READ (STANDARD_RIGHTS_READ |\ - TOKEN_QUERY) - - -#define TOKEN_WRITE (STANDARD_RIGHTS_WRITE |\ - TOKEN_ADJUST_PRIVILEGES |\ - TOKEN_ADJUST_GROUPS |\ - TOKEN_ADJUST_DEFAULT) - -#define TOKEN_EXECUTE (STANDARD_RIGHTS_EXECUTE) - -// -// -// Token Types -// - -typedef enum _TOKEN_TYPE { - TokenPrimary = 1, - TokenImpersonation - } TOKEN_TYPE; -typedef TOKEN_TYPE *PTOKEN_TYPE; - -// -// Token elevation values describe the relative strength of a given token. -// A full token is a token with all groups and privileges to which the principal -// is authorized. A limited token is one with some groups or privileges removed. -// - -typedef enum _TOKEN_ELEVATION_TYPE { - TokenElevationTypeDefault = 1, - TokenElevationTypeFull, - TokenElevationTypeLimited, -} TOKEN_ELEVATION_TYPE, *PTOKEN_ELEVATION_TYPE; - -// -// Token Information Classes. -// - - -typedef enum _TOKEN_INFORMATION_CLASS { - TokenUser = 1, - TokenGroups, - TokenPrivileges, - TokenOwner, - TokenPrimaryGroup, - TokenDefaultDacl, - TokenSource, - TokenType, - TokenImpersonationLevel, - TokenStatistics, - TokenRestrictedSids, - TokenSessionId, - TokenGroupsAndPrivileges, - TokenSessionReference, - TokenSandBoxInert, - TokenAuditPolicy, - TokenOrigin, - TokenElevationType, - TokenLinkedToken, - TokenElevation, - TokenHasRestrictions, - TokenAccessInformation, - TokenVirtualizationAllowed, - TokenVirtualizationEnabled, - TokenIntegrityLevel, - TokenUIAccess, - TokenMandatoryPolicy, - TokenLogonSid, - MaxTokenInfoClass // MaxTokenInfoClass should always be the last enum -} TOKEN_INFORMATION_CLASS, *PTOKEN_INFORMATION_CLASS; - -// -// Token information class structures -// - - -typedef struct _TOKEN_USER { - SID_AND_ATTRIBUTES User; -} TOKEN_USER, *PTOKEN_USER; - -typedef struct _TOKEN_GROUPS { - ULONG GroupCount; -#ifdef MIDL_PASS - [size_is(GroupCount)] SID_AND_ATTRIBUTES Groups[*]; -#else // MIDL_PASS - SID_AND_ATTRIBUTES Groups[ANYSIZE_ARRAY]; -#endif // MIDL_PASS -} TOKEN_GROUPS, *PTOKEN_GROUPS; - - -typedef struct _TOKEN_PRIVILEGES { - ULONG PrivilegeCount; - LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]; -} TOKEN_PRIVILEGES, *PTOKEN_PRIVILEGES; - - -typedef struct _TOKEN_OWNER { - PSID Owner; -} TOKEN_OWNER, *PTOKEN_OWNER; - - -typedef struct _TOKEN_PRIMARY_GROUP { - PSID PrimaryGroup; -} TOKEN_PRIMARY_GROUP, *PTOKEN_PRIMARY_GROUP; - - -typedef struct _TOKEN_DEFAULT_DACL { - PACL DefaultDacl; -} TOKEN_DEFAULT_DACL, *PTOKEN_DEFAULT_DACL; - -typedef struct _TOKEN_GROUPS_AND_PRIVILEGES { - ULONG SidCount; - ULONG SidLength; - PSID_AND_ATTRIBUTES Sids; - ULONG RestrictedSidCount; - ULONG RestrictedSidLength; - PSID_AND_ATTRIBUTES RestrictedSids; - ULONG PrivilegeCount; - ULONG PrivilegeLength; - PLUID_AND_ATTRIBUTES Privileges; - LUID AuthenticationId; -} TOKEN_GROUPS_AND_PRIVILEGES, *PTOKEN_GROUPS_AND_PRIVILEGES; - -typedef struct _TOKEN_LINKED_TOKEN { - HANDLE LinkedToken; -} TOKEN_LINKED_TOKEN, *PTOKEN_LINKED_TOKEN; - -typedef struct _TOKEN_ELEVATION { - ULONG TokenIsElevated; -} TOKEN_ELEVATION, *PTOKEN_ELEVATION; - -typedef struct _TOKEN_MANDATORY_LABEL { - SID_AND_ATTRIBUTES Label; -} TOKEN_MANDATORY_LABEL, *PTOKEN_MANDATORY_LABEL; - -#define TOKEN_MANDATORY_POLICY_OFF 0x0 -#define TOKEN_MANDATORY_POLICY_NO_WRITE_UP 0x1 -#define TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN 0x2 - -#define TOKEN_MANDATORY_POLICY_VALID_MASK (TOKEN_MANDATORY_POLICY_NO_WRITE_UP | \ - TOKEN_MANDATORY_POLICY_NEW_PROCESS_MIN) - -typedef struct _TOKEN_MANDATORY_POLICY { - ULONG Policy; -} TOKEN_MANDATORY_POLICY, *PTOKEN_MANDATORY_POLICY; - -typedef struct _TOKEN_ACCESS_INFORMATION { - PSID_AND_ATTRIBUTES_HASH SidHash; - PSID_AND_ATTRIBUTES_HASH RestrictedSidHash; - PTOKEN_PRIVILEGES Privileges; - LUID AuthenticationId; - TOKEN_TYPE TokenType; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - TOKEN_MANDATORY_POLICY MandatoryPolicy; - ULONG Flags; -} TOKEN_ACCESS_INFORMATION, *PTOKEN_ACCESS_INFORMATION; - -// -// Valid bits for each TOKEN_AUDIT_POLICY policy mask field. -// - -#define POLICY_AUDIT_SUBCATEGORY_COUNT (53) - -typedef struct _TOKEN_AUDIT_POLICY { - UCHAR PerUserPolicy[((POLICY_AUDIT_SUBCATEGORY_COUNT) >> 1) + 1]; -} TOKEN_AUDIT_POLICY, *PTOKEN_AUDIT_POLICY; - -#define TOKEN_SOURCE_LENGTH 8 - -typedef struct _TOKEN_SOURCE { - CHAR SourceName[TOKEN_SOURCE_LENGTH]; - LUID SourceIdentifier; -} TOKEN_SOURCE, *PTOKEN_SOURCE; - - -typedef struct _TOKEN_STATISTICS { - LUID TokenId; - LUID AuthenticationId; - LARGE_INTEGER ExpirationTime; - TOKEN_TYPE TokenType; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - ULONG DynamicCharged; - ULONG DynamicAvailable; - ULONG GroupCount; - ULONG PrivilegeCount; - LUID ModifiedId; -} TOKEN_STATISTICS, *PTOKEN_STATISTICS; - - - -typedef struct _TOKEN_CONTROL { - LUID TokenId; - LUID AuthenticationId; - LUID ModifiedId; - TOKEN_SOURCE TokenSource; -} TOKEN_CONTROL, *PTOKEN_CONTROL; - -typedef struct _TOKEN_ORIGIN { - LUID OriginatingLogonSession ; -} TOKEN_ORIGIN, * PTOKEN_ORIGIN ; - - -typedef enum _MANDATORY_LEVEL { - MandatoryLevelUntrusted = 0, - MandatoryLevelLow, - MandatoryLevelMedium, - MandatoryLevelHigh, - MandatoryLevelSystem, - MandatoryLevelSecureProcess, - MandatoryLevelCount -} MANDATORY_LEVEL, *PMANDATORY_LEVEL; - - - - -// end_winnt - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenThreadToken( - __in HANDLE ThreadHandle, - __in ACCESS_MASK DesiredAccess, - __in BOOLEAN OpenAsSelf, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenThreadTokenEx( - __in HANDLE ThreadHandle, - __in ACCESS_MASK DesiredAccess, - __in BOOLEAN OpenAsSelf, - __in ULONG HandleAttributes, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenProcessToken( - __in HANDLE ProcessHandle, - __in ACCESS_MASK DesiredAccess, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenProcessTokenEx( - __in HANDLE ProcessHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG HandleAttributes, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -NtOpenJobObjectToken( - __in HANDLE JobHandle, - __in ACCESS_MASK DesiredAccess, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtDuplicateToken( - __in HANDLE ExistingTokenHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in BOOLEAN EffectiveOnly, - __in TOKEN_TYPE TokenType, - __out PHANDLE NewTokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtFilterToken ( - __in HANDLE ExistingTokenHandle, - __in ULONG Flags, - __in_opt PTOKEN_GROUPS SidsToDisable, - __in_opt PTOKEN_PRIVILEGES PrivilegesToDelete, - __in_opt PTOKEN_GROUPS RestrictedSids, - __out PHANDLE NewTokenHandle - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtImpersonateAnonymousToken( - __in HANDLE ThreadHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationToken ( - __in HANDLE TokenHandle, - __in TOKEN_INFORMATION_CLASS TokenInformationClass, - __out_bcount_part_opt(TokenInformationLength, *ReturnLength) PVOID TokenInformation, - __in ULONG TokenInformationLength, - __out PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationToken ( - __in HANDLE TokenHandle, - __in TOKEN_INFORMATION_CLASS TokenInformationClass, - __in_bcount(TokenInformationLength) PVOID TokenInformation, - __in ULONG TokenInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAdjustPrivilegesToken ( - __in HANDLE TokenHandle, - __in BOOLEAN DisableAllPrivileges, - __in_opt PTOKEN_PRIVILEGES NewState, - __in ULONG BufferLength, - __out_bcount_part_opt(BufferLength, *ReturnLength) PTOKEN_PRIVILEGES PreviousState, - __out __drv_when(PreviousState == NULL, __out_opt) PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAdjustGroupsToken ( - __in HANDLE TokenHandle, - __in BOOLEAN ResetToDefault, - __in_opt PTOKEN_GROUPS NewState, - __in_opt ULONG BufferLength, - __out_bcount_part_opt(BufferLength, *ReturnLength) PTOKEN_GROUPS PreviousState, - __out PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrivilegeCheck ( - __in HANDLE ClientToken, - __inout PPRIVILEGE_SET RequiredPrivileges, - __out PBOOLEAN Result - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAccessCheckAndAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in PUNICODE_STRING ObjectTypeName, - __in PUNICODE_STRING ObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in ACCESS_MASK DesiredAccess, - __in PGENERIC_MAPPING GenericMapping, - __in BOOLEAN ObjectCreation, - __out PACCESS_MASK GrantedAccess, - __out PNTSTATUS AccessStatus, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAccessCheckByTypeAndAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in PUNICODE_STRING ObjectTypeName, - __in PUNICODE_STRING ObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSID PrincipalSelfSid, - __in ACCESS_MASK DesiredAccess, - __in AUDIT_EVENT_TYPE AuditType, - __in ULONG Flags, - __in_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, - __in ULONG ObjectTypeListLength, - __in PGENERIC_MAPPING GenericMapping, - __in BOOLEAN ObjectCreation, - __out PACCESS_MASK GrantedAccess, - __out PNTSTATUS AccessStatus, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAccessCheckByTypeResultListAndAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in PUNICODE_STRING ObjectTypeName, - __in PUNICODE_STRING ObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSID PrincipalSelfSid, - __in ACCESS_MASK DesiredAccess, - __in AUDIT_EVENT_TYPE AuditType, - __in ULONG Flags, - __in_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, - __in ULONG ObjectTypeListLength, - __in PGENERIC_MAPPING GenericMapping, - __in BOOLEAN ObjectCreation, - __out_ecount(ObjectTypeListLength) PACCESS_MASK GrantedAccess, - __out_ecount(ObjectTypeListLength) PNTSTATUS AccessStatus, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAccessCheckByTypeResultListAndAuditAlarmByHandle ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in HANDLE ClientToken, - __in PUNICODE_STRING ObjectTypeName, - __in PUNICODE_STRING ObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSID PrincipalSelfSid, - __in ACCESS_MASK DesiredAccess, - __in AUDIT_EVENT_TYPE AuditType, - __in ULONG Flags, - __in_ecount_opt(ObjectTypeListLength) POBJECT_TYPE_LIST ObjectTypeList, - __in ULONG ObjectTypeListLength, - __in PGENERIC_MAPPING GenericMapping, - __in BOOLEAN ObjectCreation, - __out_ecount(ObjectTypeListLength) PACCESS_MASK GrantedAccess, - __out_ecount(ObjectTypeListLength) PNTSTATUS AccessStatus, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenObjectAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in PUNICODE_STRING ObjectTypeName, - __in PUNICODE_STRING ObjectName, - __in_opt PSECURITY_DESCRIPTOR SecurityDescriptor, - __in HANDLE ClientToken, - __in ACCESS_MASK DesiredAccess, - __in ACCESS_MASK GrantedAccess, - __in_opt PPRIVILEGE_SET Privileges, - __in BOOLEAN ObjectCreation, - __in BOOLEAN AccessGranted, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrivilegeObjectAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in HANDLE ClientToken, - __in ACCESS_MASK DesiredAccess, - __in PPRIVILEGE_SET Privileges, - __in BOOLEAN AccessGranted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtCloseObjectAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in BOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtDeleteObjectAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in_opt PVOID HandleId, - __in BOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrivilegedServiceAuditAlarm ( - __in PUNICODE_STRING SubsystemName, - __in PUNICODE_STRING ServiceName, - __in HANDLE ClientToken, - __in PPRIVILEGE_SET Privileges, - __in BOOLEAN AccessGranted - ); -#endif - - -typedef -__drv_functionClass(RTL_HEAP_COMMIT_ROUTINE) -__drv_sameIRQL -NTSTATUS -NTAPI -RTL_HEAP_COMMIT_ROUTINE( - __in PVOID Base, - __inout PVOID *CommitAddress, - __inout PSIZE_T CommitSize - ); -typedef RTL_HEAP_COMMIT_ROUTINE *PRTL_HEAP_COMMIT_ROUTINE; - -typedef struct _RTL_HEAP_PARAMETERS { - ULONG Length; - SIZE_T SegmentReserve; - SIZE_T SegmentCommit; - SIZE_T DeCommitFreeBlockThreshold; - SIZE_T DeCommitTotalFreeThreshold; - SIZE_T MaximumAllocationSize; - SIZE_T VirtualMemoryThreshold; - SIZE_T InitialCommit; - SIZE_T InitialReserve; - PRTL_HEAP_COMMIT_ROUTINE CommitRoutine; - SIZE_T Reserved[ 2 ]; -} RTL_HEAP_PARAMETERS, *PRTL_HEAP_PARAMETERS; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -PVOID -NTAPI -RtlCreateHeap( - __in ULONG Flags, - __in_opt PVOID HeapBase, - __in_opt SIZE_T ReserveSize, - __in_opt SIZE_T CommitSize, - __in_opt PVOID Lock, - __in_opt PRTL_HEAP_PARAMETERS Parameters - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#define HEAP_NO_SERIALIZE 0x00000001 // winnt -#define HEAP_GROWABLE 0x00000002 // winnt -#define HEAP_GENERATE_EXCEPTIONS 0x00000004 // winnt -#define HEAP_ZERO_MEMORY 0x00000008 // winnt -#define HEAP_REALLOC_IN_PLACE_ONLY 0x00000010 // winnt -#define HEAP_TAIL_CHECKING_ENABLED 0x00000020 // winnt -#define HEAP_FREE_CHECKING_ENABLED 0x00000040 // winnt -#define HEAP_DISABLE_COALESCE_ON_FREE 0x00000080 // winnt - -#define HEAP_CREATE_ALIGN_16 0x00010000 // winnt Create heap with 16 byte alignment (obsolete) -#define HEAP_CREATE_ENABLE_TRACING 0x00020000 // winnt Create heap call tracing enabled (obsolete) -#define HEAP_CREATE_ENABLE_EXECUTE 0x00040000 // winnt Create heap with executable pages - -#define HEAP_SETTABLE_USER_VALUE 0x00000100 -#define HEAP_SETTABLE_USER_FLAG1 0x00000200 -#define HEAP_SETTABLE_USER_FLAG2 0x00000400 -#define HEAP_SETTABLE_USER_FLAG3 0x00000800 -#define HEAP_SETTABLE_USER_FLAGS 0x00000E00 - -#define HEAP_CLASS_0 0x00000000 // process heap -#define HEAP_CLASS_1 0x00001000 // private heap -#define HEAP_CLASS_2 0x00002000 // Kernel Heap -#define HEAP_CLASS_3 0x00003000 // GDI heap -#define HEAP_CLASS_4 0x00004000 // User heap -#define HEAP_CLASS_5 0x00005000 // Console heap -#define HEAP_CLASS_6 0x00006000 // User Desktop heap -#define HEAP_CLASS_7 0x00007000 // Csrss Shared heap -#define HEAP_CLASS_8 0x00008000 // Csr Port heap -#define HEAP_CLASS_MASK 0x0000F000 - -#define HEAP_MAXIMUM_TAG 0x0FFF // winnt -#define HEAP_GLOBAL_TAG 0x0800 -#define HEAP_PSEUDO_TAG_FLAG 0x8000 // winnt -#define HEAP_TAG_SHIFT 18 // winnt -#define HEAP_TAG_MASK (HEAP_MAXIMUM_TAG << HEAP_TAG_SHIFT) - -#define HEAP_CREATE_VALID_MASK (HEAP_NO_SERIALIZE | \ - HEAP_GROWABLE | \ - HEAP_GENERATE_EXCEPTIONS | \ - HEAP_ZERO_MEMORY | \ - HEAP_REALLOC_IN_PLACE_ONLY | \ - HEAP_TAIL_CHECKING_ENABLED | \ - HEAP_FREE_CHECKING_ENABLED | \ - HEAP_DISABLE_COALESCE_ON_FREE | \ - HEAP_CLASS_MASK | \ - HEAP_CREATE_ALIGN_16 | \ - HEAP_CREATE_ENABLE_TRACING | \ - HEAP_CREATE_ENABLE_EXECUTE) - -// begin_winnt -#if !defined(MIDL_PASS) -FORCEINLINE -ULONG -HEAP_MAKE_TAG_FLAGS ( - __in ULONG TagBase, - __in ULONG Tag - ) - -{ - __assume_bound(TagBase); - return ((ULONG)((TagBase) + ((Tag) << HEAP_TAG_SHIFT))); -} -#endif -// end_winnt - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -PVOID -NTAPI -RtlDestroyHeap( - __in __post_invalid PVOID HeapHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -__checkReturn -__bcount_opt(Size) __allocator -PVOID -NTAPI -RtlAllocateHeap( - __in PVOID HeapHandle, - __in_opt ULONG Flags, - __in SIZE_T Size - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != 0) -NTSYSAPI -BOOLEAN -NTAPI -RtlFreeHeap( - __in PVOID HeapHandle, - __in_opt ULONG Flags, - __in __post_invalid PVOID BaseAddress - ); -#endif // NTDDI_VERSION >= NTDDI_WIN2K - - - -#if (NTDDI_VERSION > NTDDI_WINXP) -NTSYSAPI -USHORT -NTAPI -RtlCaptureStackBackTrace( - __in ULONG FramesToSkip, - __in ULONG FramesToCapture, - __out_ecount(FramesToCapture) PVOID *BackTrace, - __out_opt PULONG BackTraceHash - ); -#endif - -#if (NTDDI_VERSION > NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlCaptureContext ( - __out PCONTEXT ContextRecord - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__range(<, MAXLONG) -NTSYSAPI -ULONG -NTAPI -RtlRandom ( - __inout PULONG Seed - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__range(<, MAXLONG) -NTSYSAPI -ULONG -NTAPI -RtlRandomEx ( - __inout PULONG Seed - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlInitUnicodeStringEx( - __out PUNICODE_STRING DestinationString, - __in_z_opt __drv_aliasesMem PCWSTR SourceString - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlInitAnsiStringEx( - __out PANSI_STRING DestinationString, - __in_z_opt __drv_aliasesMem PCSZ SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__success(return != 0) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlCreateUnicodeString( - __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem)) - PUNICODE_STRING DestinationString, - __in_z PCWSTR SourceString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlAppendStringToString ( - __inout PSTRING Destination, - __in const STRING * Source - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlOemStringToUnicodeString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PUNICODE_STRING DestinationString, - __in PCOEM_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeStringToOemString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - POEM_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeStringToOemString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - POEM_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlOemStringToCountedUnicodeString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PUNICODE_STRING DestinationString, - __in PCOEM_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeStringToCountedOemString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - POEM_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeStringToCountedOemString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - POEM_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlValidateUnicodeString( - __in __reserved ULONG Flags, - __in PCUNICODE_STRING String - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE (0x00000001) -#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING (0x00000002) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlDuplicateUnicodeString( - __in ULONG Flags, - __in PCUNICODE_STRING StringIn, - __out __drv_at(StringOut->Buffer, __drv_allocatesMem(Mem)) - PUNICODE_STRING StringOut - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(AllocateDestinationString, __checkReturn) -NTSYSAPI -NTSTATUS -NTAPI -RtlDowncaseUnicodeString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlFreeOemString( - __inout __drv_at(OemString->Buffer, __drv_freesMem(Mem)) - POEM_STRING OemString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlxUnicodeStringToOemSize( - __in PCUNICODE_STRING UnicodeString - ); -#endif - -// -// NTSYSAPI -// ULONG -// NTAPI -// RtlUnicodeStringToOemSize( -// PUNICODE_STRING UnicodeString -// ); -// - -#define RtlUnicodeStringToOemSize(STRING) ( \ - NLS_MB_OEM_CODE_PAGE_TAG ? \ - RtlxUnicodeStringToOemSize(STRING) : \ - ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ -) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlxOemStringToUnicodeSize( - __in PCOEM_STRING OemString - ); -#endif - -// -// NTSYSAPI -// ULONG -// NTAPI -// RtlOemStringToUnicodeSize( -// POEM_STRING OemString -// ); -// - -#define RtlOemStringToUnicodeSize(STRING) ( \ - NLS_MB_OEM_CODE_PAGE_TAG ? \ - RtlxOemStringToUnicodeSize(STRING) : \ - ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ -) - -// -// ULONG -// RtlOemStringToCountedUnicodeSize( -// POEM_STRING OemString -// ); -// - -#define RtlOemStringToCountedUnicodeSize(STRING) ( \ - (ULONG)(RtlOemStringToUnicodeSize(STRING) - sizeof(UNICODE_NULL)) \ - ) - -// Use Unicode if possible -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlMultiByteToUnicodeN( - __out_bcount_part(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString, - __in ULONG MaxBytesInUnicodeString, - __out_opt PULONG BytesInUnicodeString, - __in_bcount(BytesInMultiByteString) const CHAR *MultiByteString, - __in ULONG BytesInMultiByteString - ); -#endif - -// Use Unicode if possible -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlMultiByteToUnicodeSize( - __out PULONG BytesInUnicodeString, - __in_bcount(BytesInMultiByteString) const CHAR *MultiByteString, - __in ULONG BytesInMultiByteString - ); -#endif - -// Use Unicode if possible -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToMultiByteSize( - __out PULONG BytesInMultiByteString, - __in_bcount(BytesInUnicodeString) PCWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -// Use Unicode if possible -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToMultiByteN( - __out_bcount_part(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString, - __in ULONG MaxBytesInMultiByteString, - __out_opt PULONG BytesInMultiByteString, - __in_bcount(BytesInUnicodeString) PCWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -// UTF 8 conversion - -// begin_wdm -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToUTF8N( - __out_bcount_part(UTF8StringMaxByteCount, *UTF8StringActualByteCount) PCHAR UTF8StringDestination, - __in ULONG UTF8StringMaxByteCount, - __out PULONG UTF8StringActualByteCount, - __in_bcount(UnicodeStringByteCount) PCWCH UnicodeStringSource, - __in ULONG UnicodeStringByteCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUTF8ToUnicodeN( - __out_bcount_part(UnicodeStringMaxByteCount, *UnicodeStringActualByteCount) PWSTR UnicodeStringDestination, - __in ULONG UnicodeStringMaxByteCount, - __out PULONG UnicodeStringActualByteCount, - __in_bcount(UTF8StringByteCount) PCCH UTF8StringSource, - __in ULONG UTF8StringByteCount - ); -#endif -// end_wdm - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeToMultiByteN( - __out_bcount_part(MaxBytesInMultiByteString, *BytesInMultiByteString) PCHAR MultiByteString, - __in ULONG MaxBytesInMultiByteString, - __out_opt PULONG BytesInMultiByteString, - __in_bcount(BytesInUnicodeString) PCWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlOemToUnicodeN( - __out_bcount_part(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString, - __in ULONG MaxBytesInUnicodeString, - __out_opt PULONG BytesInUnicodeString, - __in_bcount(BytesInOemString) PCCH OemString, - __in ULONG BytesInOemString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToOemN( - __out_bcount_part(MaxBytesInOemString, *BytesInOemString) PCHAR OemString, - __in ULONG MaxBytesInOemString, - __out_opt PULONG BytesInOemString, - __in_bcount(BytesInUnicodeString) PCWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeToOemN( - __out_bcount_part(MaxBytesInOemString, *BytesInOemString) PCHAR OemString, - __in ULONG MaxBytesInOemString, - __out_opt PULONG BytesInOemString, - __in_bcount(BytesInUnicodeString) PCWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlNormalizeString( - __in ULONG NormForm, - __in PCWSTR SourceString, - __in LONG SourceStringLength, - __out_ecount_part(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, - __inout PLONG DestinationStringLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlIsNormalizedString( - __in ULONG NormForm, - __in PCWSTR SourceString, - __in LONG SourceStringLength, - __out PBOOLEAN Normalized - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlIdnToAscii( - __in ULONG Flags, - __in PCWSTR SourceString, - __in LONG SourceStringLength, - __out_ecount_part(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, - __inout PLONG DestinationStringLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlIdnToUnicode( - __in ULONG Flags, - __in PCWSTR SourceString, - __in LONG SourceStringLength, - __out_ecount_part(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, - __inout PLONG DestinationStringLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlIdnToNameprepUnicode( - __in ULONG Flags, - __in PCWSTR SourceString, - __in LONG SourceStringLength, - __out_ecount_part(*DestinationStringLength, *DestinationStringLength) PWSTR DestinationString, - __inout PLONG DestinationStringLength - ); -#endif - - -typedef -__drv_functionClass(RTL_ALLOCATE_STRING_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_allocatesMem(Mem) -PVOID -NTAPI -RTL_ALLOCATE_STRING_ROUTINE ( - __in SIZE_T NumberOfBytes - ); -typedef RTL_ALLOCATE_STRING_ROUTINE *PRTL_ALLOCATE_STRING_ROUTINE; - -#if _WIN32_WINNT >= 0x0600 - -typedef -__drv_functionClass(RTL_REALLOCATE_STRING_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_allocatesMem(Mem) -PVOID -NTAPI -RTL_REALLOCATE_STRING_ROUTINE( - __in SIZE_T NumberOfBytes, - __in __drv_freesMem(Mem) __post_invalid PVOID Buffer - ); -typedef RTL_REALLOCATE_STRING_ROUTINE *PRTL_REALLOCATE_STRING_ROUTINE; - -#endif // _WIN32_WINNT >= 0x0600 - -typedef -__drv_functionClass(RTL_FREE_STRING_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -NTAPI -RTL_FREE_STRING_ROUTINE ( - __in __drv_freesMem(Mem) __post_invalid PVOID Buffer - ); -typedef RTL_FREE_STRING_ROUTINE *PRTL_FREE_STRING_ROUTINE; - -extern const PRTL_ALLOCATE_STRING_ROUTINE RtlAllocateStringRoutine; -extern const PRTL_FREE_STRING_ROUTINE RtlFreeStringRoutine; - -#if _WIN32_WINNT >= 0x0600 -extern const PRTL_REALLOCATE_STRING_ROUTINE RtlReallocateStringRoutine; -#endif // _WIN32_WINNT >= 0x0600 - -// -// Defines and Routines for handling GUID's. -// - -// -// Routine for generating 8.3 names from long names. -// - -// -// The context structure is used when generating 8.3 names. The caller must -// always zero out the structure before starting a new generation sequence -// - -typedef struct _GENERATE_NAME_CONTEXT { - - // - // The structure is divided into two strings. The Name, and extension. - // Each part contains the value that was last inserted in the name. - // The length values are in terms of wchars and not bytes. We also - // store the last index value used in the generation collision algorithm. - // - - USHORT Checksum; - BOOLEAN ChecksumInserted; - - __field_range(<=, 8) UCHAR NameLength; // not including extension - WCHAR NameBuffer[8]; // e.g., "ntoskrnl" - - __field_range(<=, 4) ULONG ExtensionLength; // including dot - WCHAR ExtensionBuffer[4]; // e.g., ".exe" - - ULONG LastIndexValue; - -} GENERATE_NAME_CONTEXT; -typedef GENERATE_NAME_CONTEXT *PGENERATE_NAME_CONTEXT; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_VISTASP1) -// -// In Vista SP1 and beyond this routine now returns -// STATUS_FILE_SYSTEM_LIMITATION if the system can not generate a unique -// shortname for a given file. It returns this error after 1 million retry -// attempts for a single given longname. -// - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlGenerate8dot3Name ( - __in PCUNICODE_STRING Name, - __in BOOLEAN AllowExtendedCharacters, - __inout PGENERATE_NAME_CONTEXT Context, - __inout PUNICODE_STRING Name8dot3 - ); -#else // (NTDDI_VERSION < NTDDI_VISTASP1) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlGenerate8dot3Name ( - __in PCUNICODE_STRING Name, - __in BOOLEAN AllowExtendedCharacters, - __inout PGENERATE_NAME_CONTEXT Context, - __inout PUNICODE_STRING Name8dot3 - ); -#endif -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlIsNameLegalDOS8Dot3 ( - __in PCUNICODE_STRING Name, - __inout_opt POEM_STRING OemName, - __out_opt PBOOLEAN NameContainsSpaces - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlIsValidOemCharacter ( - __inout PWCHAR Char - ); -#endif - -// -// Prefix package types and procedures. -// -// Note that the following two record structures should really be opaque -// to the user of this package. The only information about the two -// structures available for the user should be the size and alignment -// of the structures. -// - -typedef struct _PREFIX_TABLE_ENTRY { - CSHORT NodeTypeCode; - CSHORT NameLength; - struct _PREFIX_TABLE_ENTRY *NextPrefixTree; - RTL_SPLAY_LINKS Links; - PSTRING Prefix; -} PREFIX_TABLE_ENTRY; -typedef PREFIX_TABLE_ENTRY *PPREFIX_TABLE_ENTRY; - -typedef struct _PREFIX_TABLE { - CSHORT NodeTypeCode; - CSHORT NameLength; - PPREFIX_TABLE_ENTRY NextPrefixTree; -} PREFIX_TABLE; -typedef PREFIX_TABLE *PPREFIX_TABLE; - -// -// The procedure prototypes for the prefix package -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -PfxInitialize ( - __out PPREFIX_TABLE PrefixTable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -BOOLEAN -NTAPI -PfxInsertPrefix ( - __in PPREFIX_TABLE PrefixTable, - __in __drv_aliasesMem PSTRING Prefix, - __out PPREFIX_TABLE_ENTRY PrefixTableEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -PfxRemovePrefix ( - __in PPREFIX_TABLE PrefixTable, - __in PPREFIX_TABLE_ENTRY PrefixTableEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -PPREFIX_TABLE_ENTRY -NTAPI -PfxFindPrefix ( - __in PPREFIX_TABLE PrefixTable, - __in PSTRING FullName - ); -#endif - -// -// The following definitions are for the unicode version of the prefix -// package. -// - -typedef struct _UNICODE_PREFIX_TABLE_ENTRY { - CSHORT NodeTypeCode; - CSHORT NameLength; - struct _UNICODE_PREFIX_TABLE_ENTRY *NextPrefixTree; - struct _UNICODE_PREFIX_TABLE_ENTRY *CaseMatch; - RTL_SPLAY_LINKS Links; - PUNICODE_STRING Prefix; -} UNICODE_PREFIX_TABLE_ENTRY; -typedef UNICODE_PREFIX_TABLE_ENTRY *PUNICODE_PREFIX_TABLE_ENTRY; - -typedef struct _UNICODE_PREFIX_TABLE { - CSHORT NodeTypeCode; - CSHORT NameLength; - PUNICODE_PREFIX_TABLE_ENTRY NextPrefixTree; - PUNICODE_PREFIX_TABLE_ENTRY LastNextEntry; -} UNICODE_PREFIX_TABLE; -typedef UNICODE_PREFIX_TABLE *PUNICODE_PREFIX_TABLE; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitializeUnicodePrefix ( - __out PUNICODE_PREFIX_TABLE PrefixTable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -BOOLEAN -NTAPI -RtlInsertUnicodePrefix ( - __in PUNICODE_PREFIX_TABLE PrefixTable, - __in __drv_aliasesMem PUNICODE_STRING Prefix, - __out PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlRemoveUnicodePrefix ( - __in PUNICODE_PREFIX_TABLE PrefixTable, - __in PUNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -PUNICODE_PREFIX_TABLE_ENTRY -NTAPI -RtlFindUnicodePrefix ( - __in PUNICODE_PREFIX_TABLE PrefixTable, - __in PCUNICODE_STRING FullName, - __in ULONG CaseInsensitiveIndex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -PUNICODE_PREFIX_TABLE_ENTRY -NTAPI -RtlNextUnicodePrefix ( - __in PUNICODE_PREFIX_TABLE PrefixTable, - __in BOOLEAN Restart - ); -#endif - -// -// -// Compression package types and procedures. -// - -#define COMPRESSION_FORMAT_NONE (0x0000) // winnt -#define COMPRESSION_FORMAT_DEFAULT (0x0001) // winnt -#define COMPRESSION_FORMAT_LZNT1 (0x0002) // winnt - -#define COMPRESSION_ENGINE_STANDARD (0x0000) // winnt -#define COMPRESSION_ENGINE_MAXIMUM (0x0100) // winnt -#define COMPRESSION_ENGINE_HIBER (0x0200) // winnt - -// -// Compressed Data Information structure. This structure is -// used to describe the state of a compressed data buffer, -// whose uncompressed size is known. All compressed chunks -// described by this structure must be compressed with the -// same format. On compressed reads, this entire structure -// is an output, and on compressed writes the entire structure -// is an input. -// - -typedef struct _COMPRESSED_DATA_INFO { - - // - // Code for the compression format (and engine) as - // defined in ntrtl.h. Note that COMPRESSION_FORMAT_NONE - // and COMPRESSION_FORMAT_DEFAULT are invalid if - // any of the described chunks are compressed. - // - - USHORT CompressionFormatAndEngine; - - // - // Since chunks and compression units are expected to be - // powers of 2 in size, we express then log2. So, for - // example (1 << ChunkShift) == ChunkSizeInBytes. The - // ClusterShift indicates how much space must be saved - // to successfully compress a compression unit - each - // successfully compressed compression unit must occupy - // at least one cluster less in bytes than an uncompressed - // compression unit. - // - - UCHAR CompressionUnitShift; - UCHAR ChunkShift; - UCHAR ClusterShift; - UCHAR Reserved; - - // - // This is the number of entries in the CompressedChunkSizes - // array. - // - - USHORT NumberOfChunks; - - // - // This is an array of the sizes of all chunks resident - // in the compressed data buffer. There must be one entry - // in this array for each chunk possible in the uncompressed - // buffer size. A size of FSRTL_CHUNK_SIZE indicates the - // corresponding chunk is uncompressed and occupies exactly - // that size. A size of 0 indicates that the corresponding - // chunk contains nothing but binary 0's, and occupies no - // space in the compressed data. All other sizes must be - // less than FSRTL_CHUNK_SIZE, and indicate the exact size - // of the compressed data in bytes. - // - - ULONG CompressedChunkSizes[ANYSIZE_ARRAY]; - -} COMPRESSED_DATA_INFO; -typedef COMPRESSED_DATA_INFO *PCOMPRESSED_DATA_INFO; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetCompressionWorkSpaceSize ( - __in USHORT CompressionFormatAndEngine, - __out PULONG CompressBufferWorkSpaceSize, - __out PULONG CompressFragmentWorkSpaceSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -NTSTATUS -NTAPI -RtlCompressBuffer ( - __in USHORT CompressionFormatAndEngine, - __in_bcount(UncompressedBufferSize) PUCHAR UncompressedBuffer, - __in ULONG UncompressedBufferSize, - __out_bcount_part(CompressedBufferSize, *FinalCompressedSize) PUCHAR CompressedBuffer, - __in ULONG CompressedBufferSize, - __in ULONG UncompressedChunkSize, - __out PULONG FinalCompressedSize, - __in PVOID WorkSpace - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDecompressBuffer ( - __in USHORT CompressionFormat, - __out_bcount_part(UncompressedBufferSize, *FinalUncompressedSize) PUCHAR UncompressedBuffer, - __in ULONG UncompressedBufferSize, - __in_bcount(CompressedBufferSize) PUCHAR CompressedBuffer, - __in ULONG CompressedBufferSize, - __out PULONG FinalUncompressedSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDecompressFragment ( - __in USHORT CompressionFormat, - __out_bcount_part(UncompressedFragmentSize, *FinalUncompressedSize) PUCHAR UncompressedFragment, - __in ULONG UncompressedFragmentSize, - __in_bcount(CompressedBufferSize) PUCHAR CompressedBuffer, - __in ULONG CompressedBufferSize, - __in_range(<, CompressedBufferSize) ULONG FragmentOffset, - __out PULONG FinalUncompressedSize, - __in PVOID WorkSpace - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDescribeChunk ( - __in USHORT CompressionFormat, - __inout PUCHAR *CompressedBuffer, - __in PUCHAR EndOfCompressedBufferPlus1, - __out PUCHAR *ChunkBuffer, - __out PULONG ChunkSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlReserveChunk ( - __in USHORT CompressionFormat, - __inout PUCHAR *CompressedBuffer, - __in PUCHAR EndOfCompressedBufferPlus1, - __out PUCHAR *ChunkBuffer, - __in ULONG ChunkSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDecompressChunks ( - __out_bcount(UncompressedBufferSize) PUCHAR UncompressedBuffer, - __in ULONG UncompressedBufferSize, - __in_bcount(CompressedBufferSize) PUCHAR CompressedBuffer, - __in ULONG CompressedBufferSize, - __in_bcount(CompressedTailSize) PUCHAR CompressedTail, - __in ULONG CompressedTailSize, - __in PCOMPRESSED_DATA_INFO CompressedDataInfo - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCompressChunks ( - __in_bcount(UncompressedBufferSize) PUCHAR UncompressedBuffer, - __in ULONG UncompressedBufferSize, - __out_bcount(CompressedBufferSize) PUCHAR CompressedBuffer, - __in_range(>=, (UncompressedBufferSize - (UncompressedBufferSize / 16))) ULONG CompressedBufferSize, - __inout_bcount(CompressedDataInfoLength) PCOMPRESSED_DATA_INFO CompressedDataInfo, - __in_range(>, sizeof(COMPRESSED_DATA_INFO)) ULONG CompressedDataInfoLength, - __in PVOID WorkSpace - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -SIZE_T -NTAPI -RtlCompareMemoryUlong ( - __in_bcount(Length) PVOID Source, - __in SIZE_T Length, - __in ULONG Pattern - ); - -#endif - -#if defined(_M_AMD64) - -#if !defined(MIDL_PASS) - -FORCEINLINE -VOID -RtlFillMemoryUlong ( - __out_bcount_full(Length) PVOID Destination, - __in SIZE_T Length, - __in ULONG Pattern - ) - -{ - - PULONG Address = (PULONG)Destination; - - // - // If the number of DWORDs is not zero, then fill the specified buffer - // with the specified pattern. - // - - if ((Length /= 4) != 0) { - - // - // If the destination is not quadword aligned (ignoring low bits), - // then align the destination by storing one DWORD. - // - - if (((ULONG64)Address & 4) != 0) { - *Address = Pattern; - if ((Length -= 1) == 0) { - return; - } - - Address += 1; - } - - // - // If the number of QWORDs is not zero, then fill the destination - // buffer a QWORD at a time. - // - - __stosq((PULONG64)(Address), - Pattern | ((ULONG64)Pattern << 32), - Length / 2); - - if ((Length & 1) != 0) { - Address[Length - 1] = Pattern; - } - } - - return; -} - -#define RtlFillMemoryUlonglong(Destination, Length, Pattern) \ - __stosq((PULONG64)(Destination), Pattern, (Length) / 8) - -#endif - -#else - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -VOID -NTAPI -RtlFillMemoryUlong ( - __out_bcount_full(Length) PVOID Destination, - __in SIZE_T Length, - __in ULONG Pattern - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -VOID -NTAPI -RtlFillMemoryUlonglong ( - __out_bcount_full(Length) PVOID Destination, - __in SIZE_T Length, - __in ULONGLONG Pattern - ); -#endif - -#endif // defined(_M_AMD64) - - - -// -// A 64 bit Time value -> Seconds since the start of 1980 -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != 0) -NTSYSAPI -BOOLEAN -NTAPI -RtlTimeToSecondsSince1980 ( - __in PLARGE_INTEGER Time, - __out PULONG ElapsedSeconds - ); -#endif - -// -// Seconds since the start of 1980 -> 64 bit Time value -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlSecondsSince1980ToTime ( - __in ULONG ElapsedSeconds, - __out PLARGE_INTEGER Time - ); -#endif - -// -// A 64 bit Time value -> Seconds since the start of 1970 -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != 0) -NTSYSAPI -BOOLEAN -NTAPI -RtlTimeToSecondsSince1970 ( - __in PLARGE_INTEGER Time, - __out PULONG ElapsedSeconds - ); -#endif - -// -// Seconds since the start of 1970 -> 64 bit Time value -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlSecondsSince1970ToTime ( - __in ULONG ElapsedSeconds, - __out PLARGE_INTEGER Time - ); -#endif - - -//++ -// -// PCHAR -// RtlOffsetToPointer ( -// PVOID Base, -// ULONG Offset -// ) -// -// Routine Description: -// -// This macro generates a pointer which points to the byte that is 'Offset' -// bytes beyond 'Base'. This is useful for referencing fields within -// self-relative data structures. -// -// Arguments: -// -// Base - The address of the base of the structure. -// -// Offset - An unsigned integer offset of the byte whose address is to -// be generated. -// -// Return Value: -// -// A PCHAR pointer to the byte that is 'Offset' bytes beyond 'Base'. -// -// -//-- - -#define RtlOffsetToPointer(B,O) ((PCHAR)( ((PCHAR)(B)) + ((ULONG_PTR)(O)) )) - - -//++ -// -// ULONG -// RtlPointerToOffset ( -// PVOID Base, -// PVOID Pointer -// ) -// -// Routine Description: -// -// This macro calculates the offset from Base to Pointer. This is useful -// for producing self-relative offsets for structures. -// -// Arguments: -// -// Base - The address of the base of the structure. -// -// Pointer - A pointer to a field, presumably within the structure -// pointed to by Base. This value must be larger than that specified -// for Base. -// -// Return Value: -// -// A ULONG offset from Base to Pointer. -// -// -//-- - -#define RtlPointerToOffset(B,P) ((ULONG)( ((PCHAR)(P)) - ((PCHAR)(B)) )) - -// -// Security ID RTL routine definitions -// - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlValidSid ( - __in PSID Sid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlEqualSid ( - __in PSID Sid1, - __in PSID Sid2 - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlEqualPrefixSid ( - __in PSID Sid1, - __in PSID Sid2 - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlLengthRequiredSid ( - __in ULONG SubAuthorityCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PVOID -NTAPI -RtlFreeSid( - __in __post_invalid PSID Sid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlAllocateAndInitializeSid( - __in PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, - __in UCHAR SubAuthorityCount, - __in ULONG SubAuthority0, - __in ULONG SubAuthority1, - __in ULONG SubAuthority2, - __in ULONG SubAuthority3, - __in ULONG SubAuthority4, - __in ULONG SubAuthority5, - __in ULONG SubAuthority6, - __in ULONG SubAuthority7, - __deref_out PSID *Sid - ); -#endif // NTDDI_VERSION >= NTDDI_WIN2K - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlInitializeSid ( - __out PSID Sid, - __in PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, - __in UCHAR SubAuthorityCount - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -PSID_IDENTIFIER_AUTHORITY -NTAPI -RtlIdentifierAuthoritySid ( - __in PSID Sid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -PULONG -NTAPI -RtlSubAuthoritySid ( - __in PSID Sid, - __in ULONG SubAuthority - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -PUCHAR -NTAPI -RtlSubAuthorityCountSid ( - __in PSID Sid - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlLengthSid ( - __in PSID Sid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCopySid ( - __in ULONG DestinationSidLength, - __in_bcount(DestinationSidLength) PSID DestinationSid, - __in PSID SourceSid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateServiceSid( - __in PUNICODE_STRING ServiceName, - __out_bcount(*ServiceSidLength) PSID ServiceSid, - __inout PULONG ServiceSidLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetSaclSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __out PBOOLEAN SaclPresent, - __out PACL *Sacl, - __out PBOOLEAN SaclDefaulted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlReplaceSidInSd( - __inout PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PSID OldSid, - __in PSID NewSid, - __out ULONG *NumChanges - ); - -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateVirtualAccountSid ( - __in PCUNICODE_STRING Name, - __in ULONG BaseSubAuthority, - __out_bcount(*SidLength) PSID Sid, - __inout PULONG SidLength - ); -#endif - -// -// MAX_UNICODE_STACK_BUFFER_LENGTH is the maximum stack buffer -// that RtlConvertSidToUnicodeString can fill if the caller -// specifies AllocateDestinationString = FALSE. -// - -#define MAX_UNICODE_STACK_BUFFER_LENGTH 256 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlConvertSidToUnicodeString( - __inout PUNICODE_STRING UnicodeString, - __in PSID Sid, - __in BOOLEAN AllocateDestinationString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlCopyLuid ( - __out PLUID DestinationLuid, - __in PLUID SourceLuid - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateAcl ( - __out_bcount(AclLength) PACL Acl, - __in ULONG AclLength, - __in ULONG AclRevision - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlAddAce ( - __inout PACL Acl, - __in ULONG AceRevision, - __in ULONG StartingAceIndex, - __in_bcount(AceListLength) PVOID AceList, - __in ULONG AceListLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDeleteAce ( - __inout PACL Acl, - __in ULONG AceIndex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetAce ( - __in PACL Acl, - __in ULONG AceIndex, - __deref_out PVOID *Ace - ); -#endif // NTDDI_VERSION >= NTDDI_WIN2K - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlAddAccessAllowedAce ( - __inout PACL Acl, - __in ULONG AceRevision, - __in ACCESS_MASK AccessMask, - __in PSID Sid - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlAddAccessAllowedAceEx ( - __inout PACL Acl, - __in ULONG AceRevision, - __in ULONG AceFlags, - __in ACCESS_MASK AccessMask, - __in PSID Sid - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateSecurityDescriptorRelative ( - __out PISECURITY_DESCRIPTOR_RELATIVE SecurityDescriptor, - __in ULONG Revision - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetDaclSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __out PBOOLEAN DaclPresent, - __out PACL *Dacl, - __out PBOOLEAN DaclDefaulted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlSetOwnerSecurityDescriptor ( - __inout PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSID Owner, - __in_opt BOOLEAN OwnerDefaulted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlSetGroupSecurityDescriptor ( - __inout PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSID Group, - __in_opt BOOLEAN GroupDefaulted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetGroupSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __out PSID *Group, - __out PBOOLEAN GroupDefaulted - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlAbsoluteToSelfRelativeSD ( - __in PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, - __out_bcount_part_opt(*BufferLength, *BufferLength) PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, - __inout PULONG BufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlSelfRelativeToAbsoluteSD ( - __in PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, - __out_bcount_part_opt(*AbsoluteSecurityDescriptorSize, *AbsoluteSecurityDescriptorSize) PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, - __inout PULONG AbsoluteSecurityDescriptorSize, - __out_bcount_part_opt(*DaclSize, *DaclSize) PACL Dacl, - __inout PULONG DaclSize, - __out_bcount_part_opt(*SaclSize, *SaclSize) PACL Sacl, - __inout PULONG SaclSize, - __out_bcount_part_opt(*OwnerSize, *OwnerSize) PSID Owner, - __inout PULONG OwnerSize, - __out_bcount_part_opt(*PrimaryGroupSize, *PrimaryGroupSize) PSID PrimaryGroup, - __inout PULONG PrimaryGroupSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlGetOwnerSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __out PSID *Owner, - __out PBOOLEAN OwnerDefaulted - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlNtStatusToDosError ( - __in NTSTATUS Status - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -ULONG -NTAPI -RtlNtStatusToDosErrorNoTeb ( - __in NTSTATUS Status - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCustomCPToUnicodeN( - __in PCPTABLEINFO CustomCP, - __out_bcount_part(MaxBytesInUnicodeString, *BytesInUnicodeString) PWCH UnicodeString, - __in ULONG MaxBytesInUnicodeString, - __out_opt PULONG BytesInUnicodeString, - __in_bcount(BytesInCustomCPString) PCH CustomCPString, - __in ULONG BytesInCustomCPString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToCustomCPN( - __in PCPTABLEINFO CustomCP, - __out_bcount_part(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString, - __in ULONG MaxBytesInCustomCPString, - __out_opt PULONG BytesInCustomCPString, - __in_bcount(BytesInUnicodeString) PWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUpcaseUnicodeToCustomCPN( - __in PCPTABLEINFO CustomCP, - __out_bcount_part(MaxBytesInCustomCPString, *BytesInCustomCPString) PCH CustomCPString, - __in ULONG MaxBytesInCustomCPString, - __out_opt PULONG BytesInCustomCPString, - __in_bcount(BytesInUnicodeString) PWCH UnicodeString, - __in ULONG BytesInUnicodeString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitCodePageTable( - __in PUSHORT TableBase, - __inout PCPTABLEINFO CodePageTable - ); -#endif - - -// -// Routine for verifying or creating the "System Volume Information" -// folder on NTFS volumes. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateSystemVolumeInformationFolder( - __in PCUNICODE_STRING VolumeRootPath - ); -#endif - -#define RTL_SYSTEM_VOLUME_INFORMATION_FOLDER L"System Volume Information" - -// -// Altitude Routines -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -LONG -NTAPI -RtlCompareAltitudes( - __in PCUNICODE_STRING Altitude1, - __in PCUNICODE_STRING Altitude2 - ); -#endif - -// -// Define the various device type values. Note that values used by Microsoft -// Corporation are in the range 0-32767, and 32768-65535 are reserved for use -// by customers. -// - -#define DEVICE_TYPE ULONG - -#define FILE_DEVICE_BEEP 0x00000001 -#define FILE_DEVICE_CD_ROM 0x00000002 -#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 -#define FILE_DEVICE_CONTROLLER 0x00000004 -#define FILE_DEVICE_DATALINK 0x00000005 -#define FILE_DEVICE_DFS 0x00000006 -#define FILE_DEVICE_DISK 0x00000007 -#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 -#define FILE_DEVICE_FILE_SYSTEM 0x00000009 -#define FILE_DEVICE_INPORT_PORT 0x0000000a -#define FILE_DEVICE_KEYBOARD 0x0000000b -#define FILE_DEVICE_MAILSLOT 0x0000000c -#define FILE_DEVICE_MIDI_IN 0x0000000d -#define FILE_DEVICE_MIDI_OUT 0x0000000e -#define FILE_DEVICE_MOUSE 0x0000000f -#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 -#define FILE_DEVICE_NAMED_PIPE 0x00000011 -#define FILE_DEVICE_NETWORK 0x00000012 -#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 -#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 -#define FILE_DEVICE_NULL 0x00000015 -#define FILE_DEVICE_PARALLEL_PORT 0x00000016 -#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 -#define FILE_DEVICE_PRINTER 0x00000018 -#define FILE_DEVICE_SCANNER 0x00000019 -#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a -#define FILE_DEVICE_SERIAL_PORT 0x0000001b -#define FILE_DEVICE_SCREEN 0x0000001c -#define FILE_DEVICE_SOUND 0x0000001d -#define FILE_DEVICE_STREAMS 0x0000001e -#define FILE_DEVICE_TAPE 0x0000001f -#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 -#define FILE_DEVICE_TRANSPORT 0x00000021 -#define FILE_DEVICE_UNKNOWN 0x00000022 -#define FILE_DEVICE_VIDEO 0x00000023 -#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 -#define FILE_DEVICE_WAVE_IN 0x00000025 -#define FILE_DEVICE_WAVE_OUT 0x00000026 -#define FILE_DEVICE_8042_PORT 0x00000027 -#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 -#define FILE_DEVICE_BATTERY 0x00000029 -#define FILE_DEVICE_BUS_EXTENDER 0x0000002a -#define FILE_DEVICE_MODEM 0x0000002b -#define FILE_DEVICE_VDM 0x0000002c -#define FILE_DEVICE_MASS_STORAGE 0x0000002d -#define FILE_DEVICE_SMB 0x0000002e -#define FILE_DEVICE_KS 0x0000002f -#define FILE_DEVICE_CHANGER 0x00000030 -#define FILE_DEVICE_SMARTCARD 0x00000031 -#define FILE_DEVICE_ACPI 0x00000032 -#define FILE_DEVICE_DVD 0x00000033 -#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 -#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 -#define FILE_DEVICE_DFS_VOLUME 0x00000036 -#define FILE_DEVICE_SERENUM 0x00000037 -#define FILE_DEVICE_TERMSRV 0x00000038 -#define FILE_DEVICE_KSEC 0x00000039 -#define FILE_DEVICE_FIPS 0x0000003A -#define FILE_DEVICE_INFINIBAND 0x0000003B -#define FILE_DEVICE_VMBUS 0x0000003E -#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F -#define FILE_DEVICE_WPD 0x00000040 -#define FILE_DEVICE_BLUETOOTH 0x00000041 -#define FILE_DEVICE_MT_COMPOSITE 0x00000042 -#define FILE_DEVICE_MT_TRANSPORT 0x00000043 -#define FILE_DEVICE_BIOMETRIC 0x00000044 -#define FILE_DEVICE_PMI 0x00000045 - -// -// Macro definition for defining IOCTL and FSCTL function control codes. Note -// that function codes 0-2047 are reserved for Microsoft Corporation, and -// 2048-4095 are reserved for customers. -// - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -// -// Macro to extract device type out of the device io control code -// -#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16) - -// -// Macro to extract buffering method out of the device io control code -// -#define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3)) - -// -// Define the method codes for how buffers are passed for I/O and FS controls -// - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -// -// Define some easier to comprehend aliases: -// METHOD_DIRECT_TO_HARDWARE (writes, aka METHOD_IN_DIRECT) -// METHOD_DIRECT_FROM_HARDWARE (reads, aka METHOD_OUT_DIRECT) -// - -#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT -#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT - -// -// Define the access check value for any access -// -// -// The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in -// ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these -// constants *MUST* always be in sync. -// -// -// FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS. -// The file systems, however, may add additional access checks for I/O and FS controls -// that use this value. -// - - -#define FILE_ANY_ACCESS 0 -#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) -#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe -#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationThread ( - __in HANDLE ThreadHandle, - __in THREADINFOCLASS ThreadInformationClass, - __in_bcount(ThreadInformationLength) PVOID ThreadInformation, - __in ULONG ThreadInformationLength - ); - -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -// -// Security operation mode of the system is held in a control -// longword. -// - -typedef ULONG LSA_OPERATIONAL_MODE, *PLSA_OPERATIONAL_MODE; - -// -// Used by a logon process to indicate what type of logon is being -// requested. -// - -typedef enum _SECURITY_LOGON_TYPE { - UndefinedLogonType = 0, // This is used to specify an undefied logon type - Interactive = 2, // Interactively logged on (locally or remotely) - Network, // Accessing system via network - Batch, // Started via a batch queue - Service, // Service started by service controller - Proxy, // Proxy logon - Unlock, // Unlock workstation - NetworkCleartext, // Network logon with cleartext credentials - NewCredentials, // Clone caller, new default credentials - //The types below only exist in Windows XP and greater -#if (_WIN32_WINNT >= 0x0501) - RemoteInteractive, // Remote, yet interactive. Terminal server - CachedInteractive, // Try cached credentials without hitting the net. - // The types below only exist in Windows Server 2003 and greater -#endif -#if (_WIN32_WINNT >= 0x0502) - CachedRemoteInteractive, // Same as RemoteInteractive, this is used internally for auditing purpose - CachedUnlock // Cached Unlock workstation -#endif -} SECURITY_LOGON_TYPE, *PSECURITY_LOGON_TYPE; - - -// -// All of this stuff (between the Ifndef _NTLSA_AUDIT_ and its endif) were not -// present in NTIFS prior to Windows Server 2003 SP1. All of the definitions however -// exist down to windows 2000 (except for the few exceptions noted in the code). -// - -#ifndef _NTLSA_AUDIT_ -#define _NTLSA_AUDIT_ - -///////////////////////////////////////////////////////////////////////// -// // -// Data types related to Auditing // -// // -///////////////////////////////////////////////////////////////////////// - - -// -// The following enumerated type is used between the reference monitor and -// LSA in the generation of audit messages. It is used to indicate the -// type of data being passed as a parameter from the reference monitor -// to LSA. LSA is responsible for transforming the specified data type -// into a set of unicode strings that are added to the event record in -// the audit log. -// - -typedef enum _SE_ADT_PARAMETER_TYPE { - - SeAdtParmTypeNone = 0, //Produces 1 parameter - //Received value: - // - // None. - // - //Results in: - // - // a unicode string containing "-". - // - //Note: This is typically used to - // indicate that a parameter value - // was not available. - // - - SeAdtParmTypeString, //Produces 1 parameter. - //Received Value: - // - // Unicode String (variable length) - // - //Results in: - // - // No transformation. The string - // entered into the event record as - // received. - // - // The Address value of the audit info - // should be a pointer to a UNICODE_STRING - // structure. - - - - SeAdtParmTypeFileSpec, //Produces 1 parameter. - //Received value: - // - // Unicode string containing a file or - // directory name. - // - //Results in: - // - // Unicode string with the prefix of the - // file's path replaced by a drive letter - // if possible. - // - - - - - SeAdtParmTypeUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value. - - - SeAdtParmTypeSid, //Produces 1 parameter. - //Received value: - // - // SID (variable length) - // - //Results in: - // - // String representation of SID - // - - - - - SeAdtParmTypeLogonId, //Produces 4 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Sid string - // param 2: Username string - // param 3: domain name string - // param 4: Logon ID (Luid) string - - - SeAdtParmTypeNoLogonId, //Produces 3 parameters. - //Received value: - // - // None. - // - //Results in: - // - // param 1: "-" - // param 2: "-" - // param 3: "-" - // param 4: "-" - // - //Note: - // - // This type is used when a logon ID - // is needed, but one is not available - // to pass. For example, if an - // impersonation logon ID is expected - // but the subject is not impersonating - // anyone. - // - - SeAdtParmTypeAccessMask, //Produces 1 parameter with formatting. - //Received value: - // - // ACCESS_MASK followed by - // a Unicode string. The unicode - // string contains the name of the - // type of object the access mask - // applies to. The event's source - // further qualifies the object type. - // - //Results in: - // - // formatted unicode string built to - // take advantage of the specified - // source's parameter message file. - // - //Note: - // - // An access mask containing three - // access types for a Widget object - // type (defined by the Foozle source) - // might end up looking like: - // - // %%1062\n\t\t%1066\n\t\t%%601 - // - // The %%numbers are signals to the - // event viewer to perform parameter - // substitution before display. - // - - - - SeAdtParmTypePrivs, //Produces 1 parameter with formatting. - //Received value: - // - //Results in: - // - // formatted unicode string similar to - // that for access types. Each priv - // will be formatted to be displayed - // on its own line. E.g., - // - // %%642\n\t\t%%651\n\t\t%%655 - // - - SeAdtParmTypeObjectTypes, //Produces 10 parameters with formatting. - //Received value: - // - // Produces a list a stringized GUIDS along - // with information similar to that for - // an access mask. - - SeAdtParmTypeHexUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// In W2k this value did not exist, it was ParmTypeLUID - - SeAdtParmTypePtr, //Produces 1 parameter - //Received value: - // - // pointer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// -// Everything below exists only in Windows XP and greater -// - - SeAdtParmTypeTime, //Produces 2 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time. - - // - SeAdtParmTypeGuid, //Produces 1 parameter - //Received value: - // - // GUID pointer - // - //Results in: - // - // Unicode string representation of GUID - // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - // - -// -// Everything below exists only in Windows Server 2003 and Greater -// - - SeAdtParmTypeLuid, // - //Produces 1 parameter - //Received value: - // - // LUID - // - //Results in: - // - // Hex LUID - // - - SeAdtParmTypeHexInt64, //Produces 1 parameter - //Received value: - // - // 64 bit integer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - - SeAdtParmTypeStringList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_STRING_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the strings in the list - - SeAdtParmTypeSidList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_SID_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the SIDs in the list - - SeAdtParmTypeDuration, //Produces 1 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // a duration. - - SeAdtParmTypeUserAccountControl,//Produces 3 parameters - //Received value: - // - // old and new UserAccountControl values - // - //Results in: - // - // Unicode string representations of - // the flags in UserAccountControl. - // 1 - old value in hex - // 2 - new value in hex - // 3 - difference as strings - - SeAdtParmTypeNoUac, //Produces 3 parameters - //Received value: - // - // none - // - //Results in: - // - // Three dashes ('-') as unicode strings. - - SeAdtParmTypeMessage, //Produces 1 Parameter - //Received value: - // - // ULONG (MessageNo from msobjs.mc) - // - //Results in: - // - // Unicode string representation of - // %%MessageNo which the event viewer - // will replace with the message string - // from msobjs.mc - - SeAdtParmTypeDateTime, //Produces 1 Parameter - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time (in _one_ string). - - SeAdtParmTypeSockAddr, // Produces 2 parameters - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IP address string - // param 2: Port number string - // - -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeSD, // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure - // - // Results in: - // - // SDDL string representation of SD - // - - SeAdtParmTypeLogonHours, // Produces 1 parameters - // - // Received value: - // - // pointer to LOGON_HOURS - // structure - // - // Results in: - // - // String representation of allowed logon hours - // - - SeAdtParmTypeLogonIdNoSid, //Produces 3 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Username string - // param 2: domain name string - // param 3: Logon ID (Luid) string - - SeAdtParmTypeUlongNoConv, // Produces 1 parameter. - // Received Value: - // Ulong - // - //Results in: - // Not converted to string - // - - SeAdtParmTypeSockAddrNoPort, // Produces 1 parameter - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IPv4/IPv6 address string - // -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeAccessReason // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure followed by the reason code. - // The reason code could be the index - // of the ACE in the SD or privilege ID or - // other reason codes. - // - // Results in: - // - // String representation of the access reason. - // - -} SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE; - -#ifndef GUID_DEFINED -#include -#endif /* GUID_DEFINED */ - -typedef struct _SE_ADT_OBJECT_TYPE { - GUID ObjectType; - USHORT Flags; -#define SE_ADT_OBJECT_ONLY 0x1 - USHORT Level; - ACCESS_MASK AccessMask; -} SE_ADT_OBJECT_TYPE, *PSE_ADT_OBJECT_TYPE; - -typedef struct _SE_ADT_PARAMETER_ARRAY_ENTRY { - - SE_ADT_PARAMETER_TYPE Type; - ULONG Length; - ULONG_PTR Data[2]; - PVOID Address; - -} SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY; - - -typedef struct _SE_ADT_ACCESS_REASON{ - ACCESS_MASK AccessMask; - ULONG AccessReasons[32]; - ULONG ObjectTypeIndex; - ULONG AccessGranted; - PSECURITY_DESCRIPTOR SecurityDescriptor; // multple SDs may be stored here in self-relative way. -} SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON; - - - -// -// Structure that will be passed between the Reference Monitor and LSA -// to transmit auditing information. -// - -#define SE_MAX_AUDIT_PARAMETERS 32 -#define SE_MAX_GENERIC_AUDIT_PARAMETERS 28 - -typedef struct _SE_ADT_PARAMETER_ARRAY { - - ULONG CategoryId; - ULONG AuditId; - ULONG ParameterCount; - ULONG Length; - USHORT FlatSubCategoryId; - USHORT Type; - ULONG Flags; - SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ]; - -} SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY; - - -#define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001 -#define SE_ADT_PARAMETERS_SEND_TO_LSA 0x00000002 -#define SE_ADT_PARAMETER_EXTENSIBLE_AUDIT 0x00000004 -#define SE_ADT_PARAMETER_GENERIC_AUDIT 0x00000008 -#define SE_ADT_PARAMETER_WRITE_SYNCHRONOUS 0x00000010 - - -// -// This macro only existed in Windows Server 2008 and after -// - -#define LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE(AuditParameters) \ - ( sizeof(SE_ADT_PARAMETER_ARRAY) - \ - sizeof(SE_ADT_PARAMETER_ARRAY_ENTRY) * \ - (SE_MAX_AUDIT_PARAMETERS - AuditParameters->ParameterCount) ) - -#endif // _NTLSA_AUDIT_ - - -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -LsaRegisterLogonProcess ( - __in PLSA_STRING LogonProcessName, - __out PHANDLE LsaHandle, - __out PLSA_OPERATIONAL_MODE SecurityMode - ); - -// -// The function below did not exist in NTIFS before windows XP -// However, the function has always been there, so it is okay to use -// even on w2k -// -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTAPI -LsaLogonUser ( - __in HANDLE LsaHandle, - __in PLSA_STRING OriginName, - __in SECURITY_LOGON_TYPE LogonType, - __in ULONG AuthenticationPackage, - __in_bcount(AuthenticationInformationLength) PVOID AuthenticationInformation, - __in ULONG AuthenticationInformationLength, - __in_opt PTOKEN_GROUPS LocalGroups, - __in PTOKEN_SOURCE SourceContext, - __out PVOID *ProfileBuffer, - __out PULONG ProfileBufferLength, - __out PLUID LogonId, - __out PHANDLE Token, - __out PQUOTA_LIMITS Quotas, - __out PNTSTATUS SubStatus - ); - - - -__drv_sameIRQL -NTSTATUS -NTAPI -LsaFreeReturnBuffer ( - __in PVOID Buffer - ); - - -#ifndef _NTLSA_IFS_ -#define _NTLSA_IFS_ -#endif - -///////////////////////////////////////////////////////////////////////// -// // -// Name of the MSV1_0 authentication package // -// // -///////////////////////////////////////////////////////////////////////// - -#define MSV1_0_PACKAGE_NAME "MICROSOFT_AUTHENTICATION_PACKAGE_V1_0" -#define MSV1_0_PACKAGE_NAMEW L"MICROSOFT_AUTHENTICATION_PACKAGE_V1_0" -#define MSV1_0_PACKAGE_NAMEW_LENGTH sizeof(MSV1_0_PACKAGE_NAMEW) - sizeof(WCHAR) - -// -// Location of MSV authentication package data -// -#define MSV1_0_SUBAUTHENTICATION_KEY "SYSTEM\\CurrentControlSet\\Control\\Lsa\\MSV1_0" -#define MSV1_0_SUBAUTHENTICATION_VALUE "Auth" - - -///////////////////////////////////////////////////////////////////////// -// // -// Widely used MSV1_0 data types // -// // -///////////////////////////////////////////////////////////////////////// - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// LOGON Related Data Structures -// -// // -/////////////////////////////////////////////////////////////////////////////// - -// -// When a LsaLogonUser() call is dispatched to the MsV1_0 authentication -// package, the beginning of the AuthenticationInformation buffer is -// cast to a MSV1_0_LOGON_SUBMIT_TYPE to determine the type of logon -// being requested. Similarly, upon return, the type of profile buffer -// can be determined by typecasting it to a MSV_1_0_PROFILE_BUFFER_TYPE. -// - -// -// MSV1.0 LsaLogonUser() submission message types. -// - -typedef enum _MSV1_0_LOGON_SUBMIT_TYPE { - MsV1_0InteractiveLogon = 2, - MsV1_0Lm20Logon, - MsV1_0NetworkLogon, - MsV1_0SubAuthLogon, - MsV1_0WorkstationUnlockLogon = 7, - // defined in Windows Server 2008 and up - MsV1_0S4ULogon = 12, - MsV1_0VirtualLogon = 82 -} MSV1_0_LOGON_SUBMIT_TYPE, *PMSV1_0_LOGON_SUBMIT_TYPE; - - -// -// MSV1.0 LsaLogonUser() profile buffer types. -// - -typedef enum _MSV1_0_PROFILE_BUFFER_TYPE { - MsV1_0InteractiveProfile = 2, - MsV1_0Lm20LogonProfile, - MsV1_0SmartCardProfile -} MSV1_0_PROFILE_BUFFER_TYPE, *PMSV1_0_PROFILE_BUFFER_TYPE; - -// -// MsV1_0InteractiveLogon -// -// The AuthenticationInformation buffer of an LsaLogonUser() call to -// perform an interactive logon contains the following data structure: -// - -typedef struct _MSV1_0_INTERACTIVE_LOGON { - MSV1_0_LOGON_SUBMIT_TYPE MessageType; - UNICODE_STRING LogonDomainName; - UNICODE_STRING UserName; - UNICODE_STRING Password; -} MSV1_0_INTERACTIVE_LOGON, *PMSV1_0_INTERACTIVE_LOGON; - -// -// Where: -// -// MessageType - Contains the type of logon being requested. This -// field must be set to MsV1_0InteractiveLogon. -// -// UserName - Is a string representing the user's account name. The -// name may be up to 255 characters long. The name is treated case -// insensitive. -// -// Password - Is a string containing the user's cleartext password. -// The password may be up to 255 characters long and contain any -// UNICODE value. -// -// - - -// -// The ProfileBuffer returned upon a successful logon of this type -// contains the following data structure: -// - -typedef struct _MSV1_0_INTERACTIVE_PROFILE { - MSV1_0_PROFILE_BUFFER_TYPE MessageType; - USHORT LogonCount; - USHORT BadPasswordCount; - LARGE_INTEGER LogonTime; - LARGE_INTEGER LogoffTime; - LARGE_INTEGER KickOffTime; - LARGE_INTEGER PasswordLastSet; - LARGE_INTEGER PasswordCanChange; - LARGE_INTEGER PasswordMustChange; - UNICODE_STRING LogonScript; - UNICODE_STRING HomeDirectory; - UNICODE_STRING FullName; - UNICODE_STRING ProfilePath; - UNICODE_STRING HomeDirectoryDrive; - UNICODE_STRING LogonServer; - ULONG UserFlags; -} MSV1_0_INTERACTIVE_PROFILE, *PMSV1_0_INTERACTIVE_PROFILE; - -// -// where: -// -// MessageType - Identifies the type of profile data being returned. -// Contains the type of logon being requested. This field must -// be set to MsV1_0InteractiveProfile. -// -// LogonCount - Number of times the user is currently logged on. -// -// BadPasswordCount - Number of times a bad password was applied to -// the account since last successful logon. -// -// LogonTime - Time when user last logged on. This is an absolute -// format NT standard time value. -// -// LogoffTime - Time when user should log off. This is an absolute -// format NT standard time value. -// -// KickOffTime - Time when system should force user logoff. This is -// an absolute format NT standard time value. -// -// PasswordLastChanged - Time and date the password was last -// changed. This is an absolute format NT standard time -// value. -// -// PasswordCanChange - Time and date when the user can change the -// password. This is an absolute format NT time value. To -// prevent a password from ever changing, set this field to a -// date very far into the future. -// -// PasswordMustChange - Time and date when the user must change the -// password. If the user can never change the password, this -// field is undefined. This is an absolute format NT time -// value. -// -// LogonScript - The (relative) path to the account's logon -// script. -// -// HomeDirectory - The home directory for the user. -// - - -// -// MsV1_0Lm20Logon and MsV1_0NetworkLogon -// -// The AuthenticationInformation buffer of an LsaLogonUser() call to -// perform an network logon contains the following data structure: -// -// MsV1_0NetworkLogon logon differs from MsV1_0Lm20Logon in that the -// ParameterControl field exists. -// - -#define MSV1_0_CHALLENGE_LENGTH 8 -#define MSV1_0_USER_SESSION_KEY_LENGTH 16 -#define MSV1_0_LANMAN_SESSION_KEY_LENGTH 8 - -// -// Values for ParameterControl. -// - -#define MSV1_0_CLEARTEXT_PASSWORD_ALLOWED 0x02 -#define MSV1_0_UPDATE_LOGON_STATISTICS 0x04 -#define MSV1_0_RETURN_USER_PARAMETERS 0x08 -#define MSV1_0_DONT_TRY_GUEST_ACCOUNT 0x10 -#define MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT 0x20 -#define MSV1_0_RETURN_PASSWORD_EXPIRY 0x40 -// this next flag says that CaseInsensitiveChallengeResponse -// (aka LmResponse) contains a client challenge in the first 8 bytes -#define MSV1_0_USE_CLIENT_CHALLENGE 0x80 -#define MSV1_0_TRY_GUEST_ACCOUNT_ONLY 0x100 -#define MSV1_0_RETURN_PROFILE_PATH 0x200 -#define MSV1_0_TRY_SPECIFIED_DOMAIN_ONLY 0x400 -#define MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT 0x800 -//#if (_WIN32_WINNT >= 0x0501) -- Disabled until IIS fixes their target version. -#define MSV1_0_DISABLE_PERSONAL_FALLBACK 0x00001000 -#define MSV1_0_ALLOW_FORCE_GUEST 0x00002000 -//#endif -#if (_WIN32_WINNT >= 0x0502) -#define MSV1_0_CLEARTEXT_PASSWORD_SUPPLIED 0x00004000 -// Start -// Doesnt exist in Windows XP but does exist in Windows 2000 Security Rollup and up -#define MSV1_0_USE_DOMAIN_FOR_ROUTING_ONLY 0x00008000 -#endif -#define MSV1_0_SUBAUTHENTICATION_DLL_EX 0x00100000 -// Defined in Windows Server 2003 SP1 and above -#define MSV1_0_ALLOW_MSVCHAPV2 0x00010000 - -#if (_WIN32_WINNT >= 0x0600) - -//Defined in Windows Server 2008 and up -#define MSV1_0_S4U2SELF 0x00020000 // no password is needed -#define MSV1_0_CHECK_LOGONHOURS_FOR_S4U 0x00040000 // check logon hours for S4U logon - -#endif - -// -// The high order byte is a value indicating the SubAuthentication DLL. -// Zero indicates no SubAuthentication DLL. -// -#define MSV1_0_SUBAUTHENTICATION_DLL 0xFF000000 -#define MSV1_0_SUBAUTHENTICATION_DLL_SHIFT 24 -#define MSV1_0_MNS_LOGON 0x01000000 - -// -// This is the list of subauthentication dlls used in MS -// - -#define MSV1_0_SUBAUTHENTICATION_DLL_RAS 2 -#define MSV1_0_SUBAUTHENTICATION_DLL_IIS 132 - -typedef struct _MSV1_0_LM20_LOGON { - MSV1_0_LOGON_SUBMIT_TYPE MessageType; - UNICODE_STRING LogonDomainName; - UNICODE_STRING UserName; - UNICODE_STRING Workstation; - UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; - STRING CaseSensitiveChallengeResponse; - STRING CaseInsensitiveChallengeResponse; - ULONG ParameterControl; -} MSV1_0_LM20_LOGON, * PMSV1_0_LM20_LOGON; - -// -// NT 5.0 SubAuth dlls can use this struct -// - -typedef struct _MSV1_0_SUBAUTH_LOGON{ - MSV1_0_LOGON_SUBMIT_TYPE MessageType; - UNICODE_STRING LogonDomainName; - UNICODE_STRING UserName; - UNICODE_STRING Workstation; - UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; - STRING AuthenticationInfo1; - STRING AuthenticationInfo2; - ULONG ParameterControl; - ULONG SubAuthPackageId; -} MSV1_0_SUBAUTH_LOGON, * PMSV1_0_SUBAUTH_LOGON; - -#if (_WIN32_WINNT >= 0x0600) - -// -// s4u2self logon -// -// Defined in Windows Server 2008 and above - -// -// request to enforce logon hours policy -// - -#define MSV1_0_S4U_LOGON_FLAG_CHECK_LOGONHOURS 0x2 - -typedef struct _MSV1_0_S4U_LOGON { - MSV1_0_LOGON_SUBMIT_TYPE MessageType; - ULONG Flags; - UNICODE_STRING UserPrincipalName; // username or username@domain - UNICODE_STRING DomainName; // Optional: if missing, using the local machine -} MSV1_0_S4U_LOGON, *PMSV1_0_S4U_LOGON; - -#endif - -// -// Values for UserFlags. -// - -#define LOGON_GUEST 0x01 -#define LOGON_NOENCRYPTION 0x02 -#define LOGON_CACHED_ACCOUNT 0x04 -#define LOGON_USED_LM_PASSWORD 0x08 -#define LOGON_EXTRA_SIDS 0x20 -#define LOGON_SUBAUTH_SESSION_KEY 0x40 -#define LOGON_SERVER_TRUST_ACCOUNT 0x80 -#define LOGON_NTLMV2_ENABLED 0x100 // says DC understands NTLMv2 -#define LOGON_RESOURCE_GROUPS 0x200 -#define LOGON_PROFILE_PATH_RETURNED 0x400 -// Defined in Windows Server 2008 and above -#define LOGON_NT_V2 0x800 // NT response was used for validation -#define LOGON_LM_V2 0x1000 // LM response was used for validation -#define LOGON_NTLM_V2 0x2000 // LM response was used to authenticate but NT response was used to derive the session key - -#if (_WIN32_WINNT >= 0x0600) - -#define LOGON_OPTIMIZED 0x4000 // this is an optimized logon -#define LOGON_WINLOGON 0x8000 // the logon session was created for winlogon -#define LOGON_PKINIT 0x10000 // Kerberos PKINIT extension was used to authenticate the user -#define LOGON_NO_OPTIMIZED 0x20000 // optimized logon has been disabled for this account - -#endif - -// -// The high order byte is reserved for return by SubAuthentication DLLs. -// - -#define MSV1_0_SUBAUTHENTICATION_FLAGS 0xFF000000 - -// Values returned by the MSV1_0_MNS_LOGON SubAuthentication DLL -#define LOGON_GRACE_LOGON 0x01000000 - -typedef struct _MSV1_0_LM20_LOGON_PROFILE { - MSV1_0_PROFILE_BUFFER_TYPE MessageType; - LARGE_INTEGER KickOffTime; - LARGE_INTEGER LogoffTime; - ULONG UserFlags; - UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; - UNICODE_STRING LogonDomainName; - UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH]; - UNICODE_STRING LogonServer; - UNICODE_STRING UserParameters; -} MSV1_0_LM20_LOGON_PROFILE, * PMSV1_0_LM20_LOGON_PROFILE; - - -// -// Supplemental credentials structure used for passing credentials into -// MSV1_0 from other packages -// - -#define MSV1_0_OWF_PASSWORD_LENGTH 16 -#define MSV1_0_CRED_LM_PRESENT 0x1 -#define MSV1_0_CRED_NT_PRESENT 0x2 -#define MSV1_0_CRED_VERSION 0 - -typedef struct _MSV1_0_SUPPLEMENTAL_CREDENTIAL { - ULONG Version; - ULONG Flags; - UCHAR LmPassword[MSV1_0_OWF_PASSWORD_LENGTH]; - UCHAR NtPassword[MSV1_0_OWF_PASSWORD_LENGTH]; -} MSV1_0_SUPPLEMENTAL_CREDENTIAL, *PMSV1_0_SUPPLEMENTAL_CREDENTIAL; - - -// -// NTLM3 definitions. -// - -#define MSV1_0_NTLM3_RESPONSE_LENGTH 16 -#define MSV1_0_NTLM3_OWF_LENGTH 16 - -// -// this is the longest amount of time we'll allow challenge response -// pairs to be used. Note that this also has to allow for worst case clock skew -// -#if (_WIN32_WINNT == 0x0500) -#define MSV1_0_MAX_NTLM3_LIFE 1800 // 30 minutes (in seconds) -#else -#define MSV1_0_MAX_NTLM3_LIFE 129600 // 36 hours (in seconds) -#endif -#define MSV1_0_MAX_AVL_SIZE 64000 - -#if (_WIN32_WINNT >= 0x0501) -// -// MsvAvFlags bit values -// -// Exists only after Windows 2000 -// - -#define MSV1_0_AV_FLAG_FORCE_GUEST 0x00000001 -#if (_WIN32_WINNT >= 0x0600) -#define MSV1_0_AV_FLAG_MIC_HANDSHAKE_MESSAGES 0x00000002 // the client supports - // hand-shake messages integrity -#endif -#endif - -// this is an MSV1_0 private data structure, defining the layout of an NTLM3 response, as sent by a -// client in the NtChallengeResponse field of the NETLOGON_NETWORK_INFO structure. If can be differentiated -// from an old style NT response by its length. This is crude, but it needs to pass through servers and -// the servers' DCs that do not understand NTLM3 but that are willing to pass longer responses. -typedef struct _MSV1_0_NTLM3_RESPONSE { - UCHAR Response[MSV1_0_NTLM3_RESPONSE_LENGTH]; // hash of OWF of password with all the following fields - UCHAR RespType; // id number of response; current is 1 - UCHAR HiRespType; // highest id number understood by client - USHORT Flags; // reserved; must be sent as zero at this version - ULONG MsgWord; // 32 bit message from client to server (for use by auth protocol) - ULONGLONG TimeStamp; // time stamp when client generated response -- NT system time, quad part - UCHAR ChallengeFromClient[MSV1_0_CHALLENGE_LENGTH]; - ULONG AvPairsOff; // offset to start of AvPairs (to allow future expansion) - UCHAR Buffer[1]; // start of buffer with AV pairs (or future stuff -- so use the offset) -} MSV1_0_NTLM3_RESPONSE, *PMSV1_0_NTLM3_RESPONSE; - -#define MSV1_0_NTLM3_INPUT_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) - MSV1_0_NTLM3_RESPONSE_LENGTH) -#if(_WIN32_WINNT >= 0x0502) -#define MSV1_0_NTLM3_MIN_NT_RESPONSE_LENGTH RTL_SIZEOF_THROUGH_FIELD(MSV1_0_NTLM3_RESPONSE, AvPairsOff) -#endif - -typedef enum { - MsvAvEOL, // end of list - MsvAvNbComputerName, // server's computer name -- NetBIOS - MsvAvNbDomainName, // server's domain name -- NetBIOS - MsvAvDnsComputerName, // server's computer name -- DNS - MsvAvDnsDomainName, // server's domain name -- DNS -#if (_WIN32_WINNT >= 0x0501) - MsvAvDnsTreeName, // server's tree name -- DNS - MsvAvFlags, // server's extended flags -- DWORD mask -#if (_WIN32_WINNT >= 0x0600) - MsvAvTimestamp, // contains the server's local time in FILETIME, - // (64 bit 100 ns ticks since 1602 - // (UTC)) in little endian byte order - MsvAvRestrictions, // token restrictions - MsvAvTargetName, - MsvAvChannelBindings, -#endif -#endif -} MSV1_0_AVID; - -typedef struct _MSV1_0_AV_PAIR { - USHORT AvId; - USHORT AvLen; - // Data is treated as byte array following structure -} MSV1_0_AV_PAIR, *PMSV1_0_AV_PAIR; - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// CALL PACKAGE Related Data Structures // -// // -/////////////////////////////////////////////////////////////////////////////// - - -// -// MSV1.0 LsaCallAuthenticationPackage() submission and response -// message types. -// - -typedef enum _MSV1_0_PROTOCOL_MESSAGE_TYPE { - MsV1_0Lm20ChallengeRequest = 0, // Both submission and response - MsV1_0Lm20GetChallengeResponse, // Both submission and response - MsV1_0EnumerateUsers, // Both submission and response - MsV1_0GetUserInfo, // Both submission and response - MsV1_0ReLogonUsers, // Submission only - MsV1_0ChangePassword, // Both submission and response - MsV1_0ChangeCachedPassword, // Both submission and response - MsV1_0GenericPassthrough, // Both submission and response - MsV1_0CacheLogon, // Submission only, no response - MsV1_0SubAuth, // Both submission and response - MsV1_0DeriveCredential, // Both submission and response - MsV1_0CacheLookup, // Both submission and response -#if (_WIN32_WINNT >= 0x0501) - MsV1_0SetProcessOption, // Submission only, no response -#endif -#if (_WIN32_WINNT >= 0x0600) - MsV1_0ConfigLocalAliases, - MsV1_0ClearCachedCredentials, -#endif -} MSV1_0_PROTOCOL_MESSAGE_TYPE, *PMSV1_0_PROTOCOL_MESSAGE_TYPE; - -// end_ntsecapi - -// -// MsV1_0Lm20ChallengeRequest submit buffer and response -// - -typedef struct _MSV1_0_LM20_CHALLENGE_REQUEST { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; -} MSV1_0_LM20_CHALLENGE_REQUEST, *PMSV1_0_LM20_CHALLENGE_REQUEST; - -typedef struct _MSV1_0_LM20_CHALLENGE_RESPONSE { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; -} MSV1_0_LM20_CHALLENGE_RESPONSE, *PMSV1_0_LM20_CHALLENGE_RESPONSE; - -// -// MsV1_0Lm20GetChallengeResponse submit buffer and response -// - -#define USE_PRIMARY_PASSWORD 0x01 -#define RETURN_PRIMARY_USERNAME 0x02 -#define RETURN_PRIMARY_LOGON_DOMAINNAME 0x04 -#define RETURN_NON_NT_USER_SESSION_KEY 0x08 -#define GENERATE_CLIENT_CHALLENGE 0x10 -#define GCR_NTLM3_PARMS 0x20 -#define GCR_TARGET_INFO 0x40 // ServerName field contains target info AV pairs -#define RETURN_RESERVED_PARAMETER 0x80 // was 0x10 -#define GCR_ALLOW_NTLM 0x100 // allow the use of NTLM -// Exists in Windows XPSP2 and later -#define GCR_USE_OEM_SET 0x200 // response uses oem character set -#define GCR_MACHINE_CREDENTIAL 0x400 -#define GCR_USE_OWF_PASSWORD 0x800 // use owf passwords -#define GCR_ALLOW_LM 0x1000 // allow the use of LM -// Defined in Windows Server 2003 and above -#define GCR_ALLOW_NO_TARGET 0x2000 // allow no target server or target domain name - -// -// version 1 of the GETCHALLENRESP structure, which was used by RAS and others. -// compiled before the additional fields added to GETCHALLENRESP_REQUEST. -// here to allow sizing operations for backwards compatibility. -// - -typedef struct _MSV1_0_GETCHALLENRESP_REQUEST_V1 { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - ULONG ParameterControl; - LUID LogonId; - UNICODE_STRING Password; - UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; -} MSV1_0_GETCHALLENRESP_REQUEST_V1, *PMSV1_0_GETCHALLENRESP_REQUEST_V1; - -typedef struct _MSV1_0_GETCHALLENRESP_REQUEST { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - ULONG ParameterControl; - LUID LogonId; - UNICODE_STRING Password; - UCHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; - - // - // the following 3 fields are only present if GCR_NTLM3_PARMS is set in ParameterControl - // - - UNICODE_STRING UserName; - UNICODE_STRING LogonDomainName; - UNICODE_STRING ServerName; // server domain or target info AV pairs -} MSV1_0_GETCHALLENRESP_REQUEST, *PMSV1_0_GETCHALLENRESP_REQUEST; - -typedef struct _MSV1_0_GETCHALLENRESP_RESPONSE { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - STRING CaseSensitiveChallengeResponse; - STRING CaseInsensitiveChallengeResponse; - UNICODE_STRING UserName; - UNICODE_STRING LogonDomainName; - UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; - UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH]; -} MSV1_0_GETCHALLENRESP_RESPONSE, *PMSV1_0_GETCHALLENRESP_RESPONSE; - -// -// MsV1_0EnumerateUsers submit buffer and response -// - -typedef struct _MSV1_0_ENUMUSERS_REQUEST { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; -} MSV1_0_ENUMUSERS_REQUEST, *PMSV1_0_ENUMUSERS_REQUEST; - -typedef struct _MSV1_0_ENUMUSERS_RESPONSE { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - ULONG NumberOfLoggedOnUsers; - PLUID LogonIds; - PULONG EnumHandles; -} MSV1_0_ENUMUSERS_RESPONSE, *PMSV1_0_ENUMUSERS_RESPONSE; - -// -// MsV1_0GetUserInfo submit buffer and response -// - -typedef struct _MSV1_0_GETUSERINFO_REQUEST { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - LUID LogonId; -} MSV1_0_GETUSERINFO_REQUEST, *PMSV1_0_GETUSERINFO_REQUEST; - -typedef struct _MSV1_0_GETUSERINFO_RESPONSE { - MSV1_0_PROTOCOL_MESSAGE_TYPE MessageType; - PSID UserSid; - UNICODE_STRING UserName; - UNICODE_STRING LogonDomainName; - UNICODE_STRING LogonServer; - SECURITY_LOGON_TYPE LogonType; -} MSV1_0_GETUSERINFO_RESPONSE, *PMSV1_0_GETUSERINFO_RESPONSE; - - -// -// Define the I/O status information return values for requests for oplocks -// via NtFsControlFile -// - -#define FILE_OPLOCK_BROKEN_TO_LEVEL_2 0x00000007 -#define FILE_OPLOCK_BROKEN_TO_NONE 0x00000008 - -// -// Define the I/O status information return values for NtCreateFile/NtOpenFile -// when the sharing access fails but a batch oplock break is in progress -// - -#define FILE_OPBATCH_BREAK_UNDERWAY 0x00000009 - -// -// Define the filter flags for NtNotifyChangeDirectoryFile -// - -#define FILE_NOTIFY_CHANGE_FILE_NAME 0x00000001 // winnt -#define FILE_NOTIFY_CHANGE_DIR_NAME 0x00000002 // winnt -#define FILE_NOTIFY_CHANGE_NAME 0x00000003 -#define FILE_NOTIFY_CHANGE_ATTRIBUTES 0x00000004 // winnt -#define FILE_NOTIFY_CHANGE_SIZE 0x00000008 // winnt -#define FILE_NOTIFY_CHANGE_LAST_WRITE 0x00000010 // winnt -#define FILE_NOTIFY_CHANGE_LAST_ACCESS 0x00000020 // winnt -#define FILE_NOTIFY_CHANGE_CREATION 0x00000040 // winnt -#define FILE_NOTIFY_CHANGE_EA 0x00000080 -#define FILE_NOTIFY_CHANGE_SECURITY 0x00000100 // winnt -#define FILE_NOTIFY_CHANGE_STREAM_NAME 0x00000200 -#define FILE_NOTIFY_CHANGE_STREAM_SIZE 0x00000400 -#define FILE_NOTIFY_CHANGE_STREAM_WRITE 0x00000800 -#define FILE_NOTIFY_VALID_MASK 0x00000fff - -// -// Define the file action type codes for NtNotifyChangeDirectoryFile -// - -#define FILE_ACTION_ADDED 0x00000001 // winnt -#define FILE_ACTION_REMOVED 0x00000002 // winnt -#define FILE_ACTION_MODIFIED 0x00000003 // winnt -#define FILE_ACTION_RENAMED_OLD_NAME 0x00000004 // winnt -#define FILE_ACTION_RENAMED_NEW_NAME 0x00000005 // winnt -#define FILE_ACTION_ADDED_STREAM 0x00000006 -#define FILE_ACTION_REMOVED_STREAM 0x00000007 -#define FILE_ACTION_MODIFIED_STREAM 0x00000008 -#define FILE_ACTION_REMOVED_BY_DELETE 0x00000009 -#define FILE_ACTION_ID_NOT_TUNNELLED 0x0000000A -#define FILE_ACTION_TUNNELLED_ID_COLLISION 0x0000000B - -// -// Define the NamedPipeType flags for NtCreateNamedPipeFile -// - -#define FILE_PIPE_BYTE_STREAM_TYPE 0x00000000 -#define FILE_PIPE_MESSAGE_TYPE 0x00000001 - -#define FILE_PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000 -#define FILE_PIPE_REJECT_REMOTE_CLIENTS 0x00000002 - -#define FILE_PIPE_TYPE_VALID_MASK 0x00000003 - -// -// Define the CompletionMode flags for NtCreateNamedPipeFile -// - -#define FILE_PIPE_QUEUE_OPERATION 0x00000000 -#define FILE_PIPE_COMPLETE_OPERATION 0x00000001 - -// -// Define the ReadMode flags for NtCreateNamedPipeFile -// - -#define FILE_PIPE_BYTE_STREAM_MODE 0x00000000 -#define FILE_PIPE_MESSAGE_MODE 0x00000001 - -// -// Define the NamedPipeConfiguration flags for NtQueryInformation -// - -#define FILE_PIPE_INBOUND 0x00000000 -#define FILE_PIPE_OUTBOUND 0x00000001 -#define FILE_PIPE_FULL_DUPLEX 0x00000002 - -// -// Define the NamedPipeState flags for NtQueryInformation -// - -#define FILE_PIPE_DISCONNECTED_STATE 0x00000001 -#define FILE_PIPE_LISTENING_STATE 0x00000002 -#define FILE_PIPE_CONNECTED_STATE 0x00000003 -#define FILE_PIPE_CLOSING_STATE 0x00000004 - -// -// Define the NamedPipeEnd flags for NtQueryInformation -// - -#define FILE_PIPE_CLIENT_END 0x00000000 -#define FILE_PIPE_SERVER_END 0x00000001 - - -// -// Define the file system attributes flags -// - -#define FILE_CASE_SENSITIVE_SEARCH 0x00000001 // winnt -#define FILE_CASE_PRESERVED_NAMES 0x00000002 // winnt -#define FILE_UNICODE_ON_DISK 0x00000004 // winnt -#define FILE_PERSISTENT_ACLS 0x00000008 // winnt -#define FILE_FILE_COMPRESSION 0x00000010 // winnt -#define FILE_VOLUME_QUOTAS 0x00000020 // winnt -#define FILE_SUPPORTS_SPARSE_FILES 0x00000040 // winnt -#define FILE_SUPPORTS_REPARSE_POINTS 0x00000080 // winnt -#define FILE_SUPPORTS_REMOTE_STORAGE 0x00000100 // winnt -#define FILE_VOLUME_IS_COMPRESSED 0x00008000 // winnt -#define FILE_SUPPORTS_OBJECT_IDS 0x00010000 // winnt -#define FILE_SUPPORTS_ENCRYPTION 0x00020000 // winnt -#define FILE_NAMED_STREAMS 0x00040000 // winnt -#define FILE_READ_ONLY_VOLUME 0x00080000 // winnt -#define FILE_SEQUENTIAL_WRITE_ONCE 0x00100000 // winnt -#define FILE_SUPPORTS_TRANSACTIONS 0x00200000 // winnt -#define FILE_SUPPORTS_HARD_LINKS 0x00400000 // winnt -#define FILE_SUPPORTS_EXTENDED_ATTRIBUTES 0x00800000 // winnt -// -// When enabled this attribute implies that the FileID's for the supported -// file system are also durable. This means the FileID will not change due -// to other file system operations like rename or defrag. If a file -// is deleted and re-created the ID will change. -// -#define FILE_SUPPORTS_OPEN_BY_FILE_ID 0x01000000 // winnt -#define FILE_SUPPORTS_USN_JOURNAL 0x02000000 // winnt - - - -// -// Define the flags for NtSet(Query)EaFile service structure entries -// - -#define FILE_NEED_EA 0x00000080 - -// -// Define EA type values -// - -#define FILE_EA_TYPE_BINARY 0xfffe -#define FILE_EA_TYPE_ASCII 0xfffd -#define FILE_EA_TYPE_BITMAP 0xfffb -#define FILE_EA_TYPE_METAFILE 0xfffa -#define FILE_EA_TYPE_ICON 0xfff9 -#define FILE_EA_TYPE_EA 0xffee -#define FILE_EA_TYPE_MVMT 0xffdf -#define FILE_EA_TYPE_MVST 0xffde -#define FILE_EA_TYPE_ASN1 0xffdd -#define FILE_EA_TYPE_FAMILY_IDS 0xff01 - - -// -// Define the file notification information structure -// - -typedef struct _FILE_NOTIFY_INFORMATION { - ULONG NextEntryOffset; - ULONG Action; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_NOTIFY_INFORMATION, *PFILE_NOTIFY_INFORMATION; - - -// -// NtQueryDirectoryFile return types: -// -// FILE_DIRECTORY_INFORMATION -// FILE_FULL_DIR_INFORMATION -// FILE_ID_FULL_DIR_INFORMATION -// FILE_BOTH_DIR_INFORMATION -// FILE_ID_BOTH_DIR_INFORMATION -// FILE_NAMES_INFORMATION -// FILE_OBJECTID_INFORMATION -// - -typedef struct _FILE_DIRECTORY_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_DIRECTORY_INFORMATION, *PFILE_DIRECTORY_INFORMATION; - -typedef struct _FILE_FULL_DIR_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - WCHAR FileName[1]; -} FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION; - -typedef struct _FILE_ID_FULL_DIR_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - LARGE_INTEGER FileId; - WCHAR FileName[1]; -} FILE_ID_FULL_DIR_INFORMATION, *PFILE_ID_FULL_DIR_INFORMATION; - -typedef struct _FILE_BOTH_DIR_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - CCHAR ShortNameLength; - WCHAR ShortName[12]; - WCHAR FileName[1]; -} FILE_BOTH_DIR_INFORMATION, *PFILE_BOTH_DIR_INFORMATION; - -typedef struct _FILE_ID_BOTH_DIR_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - ULONG EaSize; - CCHAR ShortNameLength; - WCHAR ShortName[12]; - LARGE_INTEGER FileId; - WCHAR FileName[1]; -} FILE_ID_BOTH_DIR_INFORMATION, *PFILE_ID_BOTH_DIR_INFORMATION; - -typedef struct _FILE_NAMES_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_NAMES_INFORMATION, *PFILE_NAMES_INFORMATION; - -typedef struct _FILE_ID_GLOBAL_TX_DIR_INFORMATION { - ULONG NextEntryOffset; - ULONG FileIndex; - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER EndOfFile; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG FileNameLength; - LARGE_INTEGER FileId; - GUID LockingTransactionId; - ULONG TxInfoFlags; - WCHAR FileName[1]; -} FILE_ID_GLOBAL_TX_DIR_INFORMATION, *PFILE_ID_GLOBAL_TX_DIR_INFORMATION; - -#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_WRITELOCKED 0x00000001 -#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_TO_TX 0x00000002 -#define FILE_ID_GLOBAL_TX_DIR_INFO_FLAG_VISIBLE_OUTSIDE_TX 0x00000004 - -typedef struct _FILE_OBJECTID_INFORMATION { - LONGLONG FileReference; - UCHAR ObjectId[16]; - union { - struct { - UCHAR BirthVolumeId[16]; - UCHAR BirthObjectId[16]; - UCHAR DomainId[16]; - } DUMMYSTRUCTNAME; - UCHAR ExtendedInfo[48]; - } DUMMYUNIONNAME; -} FILE_OBJECTID_INFORMATION, *PFILE_OBJECTID_INFORMATION; - -// -// The following constants provide addition meta characters to fully -// support the more obscure aspects of DOS wild card processing. -// - -#define ANSI_DOS_STAR ('<') -#define ANSI_DOS_QM ('>') -#define ANSI_DOS_DOT ('"') - -#define DOS_STAR (L'<') -#define DOS_QM (L'>') -#define DOS_DOT (L'"') - -// -// NtQuery(Set)InformationFile return types: -// -// FILE_BASIC_INFORMATION -// FILE_STANDARD_INFORMATION -// FILE_INTERNAL_INFORMATION -// FILE_EA_INFORMATION -// FILE_ACCESS_INFORMATION -// FILE_POSITION_INFORMATION -// FILE_MODE_INFORMATION -// FILE_ALIGNMENT_INFORMATION -// FILE_NAME_INFORMATION -// FILE_ALL_INFORMATION -// -// FILE_NETWORK_OPEN_INFORMATION -// -// FILE_ALLOCATION_INFORMATION -// FILE_COMPRESSION_INFORMATION -// FILE_DISPOSITION_INFORMATION -// FILE_END_OF_FILE_INFORMATION -// FILE_LINK_INFORMATION -// FILE_MOVE_CLUSTER_INFORMATION -// FILE_RENAME_INFORMATION -// FILE_SHORT_NAME_INFORMATION -// FILE_STREAM_INFORMATION -// FILE_COMPLETION_INFORMATION -// -// FILE_PIPE_INFORMATION -// FILE_PIPE_LOCAL_INFORMATION -// FILE_PIPE_REMOTE_INFORMATION -// -// FILE_MAILSLOT_QUERY_INFORMATION -// FILE_MAILSLOT_SET_INFORMATION -// FILE_REPARSE_POINT_INFORMATION -// -// FILE_NETWORK_PHYSICAL_NAME_INFORMATION -// - - -typedef struct _FILE_INTERNAL_INFORMATION { - LARGE_INTEGER IndexNumber; -} FILE_INTERNAL_INFORMATION, *PFILE_INTERNAL_INFORMATION; - -typedef struct _FILE_EA_INFORMATION { - ULONG EaSize; -} FILE_EA_INFORMATION, *PFILE_EA_INFORMATION; - -typedef struct _FILE_ACCESS_INFORMATION { - ACCESS_MASK AccessFlags; -} FILE_ACCESS_INFORMATION, *PFILE_ACCESS_INFORMATION; - -typedef struct _FILE_MODE_INFORMATION { - ULONG Mode; -} FILE_MODE_INFORMATION, *PFILE_MODE_INFORMATION; - -typedef struct _FILE_ALL_INFORMATION { - FILE_BASIC_INFORMATION BasicInformation; - FILE_STANDARD_INFORMATION StandardInformation; - FILE_INTERNAL_INFORMATION InternalInformation; - FILE_EA_INFORMATION EaInformation; - FILE_ACCESS_INFORMATION AccessInformation; - FILE_POSITION_INFORMATION PositionInformation; - FILE_MODE_INFORMATION ModeInformation; - FILE_ALIGNMENT_INFORMATION AlignmentInformation; - FILE_NAME_INFORMATION NameInformation; -} FILE_ALL_INFORMATION, *PFILE_ALL_INFORMATION; - - -typedef struct _FILE_ALLOCATION_INFORMATION { - LARGE_INTEGER AllocationSize; -} FILE_ALLOCATION_INFORMATION, *PFILE_ALLOCATION_INFORMATION; - - -typedef struct _FILE_COMPRESSION_INFORMATION { - LARGE_INTEGER CompressedFileSize; - USHORT CompressionFormat; - UCHAR CompressionUnitShift; - UCHAR ChunkShift; - UCHAR ClusterShift; - UCHAR Reserved[3]; -} FILE_COMPRESSION_INFORMATION, *PFILE_COMPRESSION_INFORMATION; - - -#ifdef _MAC -#pragma warning( disable : 4121) -#endif - -typedef struct _FILE_LINK_INFORMATION { - BOOLEAN ReplaceIfExists; - HANDLE RootDirectory; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_LINK_INFORMATION, *PFILE_LINK_INFORMATION; - - -#ifdef _MAC -#pragma warning( default : 4121 ) -#endif - -typedef struct _FILE_MOVE_CLUSTER_INFORMATION { - ULONG ClusterCount; - HANDLE RootDirectory; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_MOVE_CLUSTER_INFORMATION, *PFILE_MOVE_CLUSTER_INFORMATION; - -#ifdef _MAC -#pragma warning( disable : 4121) -#endif - -typedef struct _FILE_RENAME_INFORMATION { - BOOLEAN ReplaceIfExists; - HANDLE RootDirectory; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_RENAME_INFORMATION, *PFILE_RENAME_INFORMATION; - -#ifdef _MAC -#pragma warning( default : 4121 ) -#endif - -typedef struct _FILE_STREAM_INFORMATION { - ULONG NextEntryOffset; - ULONG StreamNameLength; - LARGE_INTEGER StreamSize; - LARGE_INTEGER StreamAllocationSize; - WCHAR StreamName[1]; -} FILE_STREAM_INFORMATION, *PFILE_STREAM_INFORMATION; - -typedef struct _FILE_TRACKING_INFORMATION { - HANDLE DestinationFile; - ULONG ObjectInformationLength; - CHAR ObjectInformation[1]; -} FILE_TRACKING_INFORMATION, *PFILE_TRACKING_INFORMATION; - -typedef struct _FILE_COMPLETION_INFORMATION { - HANDLE Port; - PVOID Key; -} FILE_COMPLETION_INFORMATION, *PFILE_COMPLETION_INFORMATION; - -typedef struct _FILE_PIPE_INFORMATION { - ULONG ReadMode; - ULONG CompletionMode; -} FILE_PIPE_INFORMATION, *PFILE_PIPE_INFORMATION; - -typedef struct _FILE_PIPE_LOCAL_INFORMATION { - ULONG NamedPipeType; - ULONG NamedPipeConfiguration; - ULONG MaximumInstances; - ULONG CurrentInstances; - ULONG InboundQuota; - ULONG ReadDataAvailable; - ULONG OutboundQuota; - ULONG WriteQuotaAvailable; - ULONG NamedPipeState; - ULONG NamedPipeEnd; -} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION; - -typedef struct _FILE_PIPE_REMOTE_INFORMATION { - LARGE_INTEGER CollectDataTime; - ULONG MaximumCollectionCount; -} FILE_PIPE_REMOTE_INFORMATION, *PFILE_PIPE_REMOTE_INFORMATION; - - -typedef struct _FILE_MAILSLOT_QUERY_INFORMATION { - ULONG MaximumMessageSize; - ULONG MailslotQuota; - ULONG NextMessageSize; - ULONG MessagesAvailable; - LARGE_INTEGER ReadTimeout; -} FILE_MAILSLOT_QUERY_INFORMATION, *PFILE_MAILSLOT_QUERY_INFORMATION; - -typedef struct _FILE_MAILSLOT_SET_INFORMATION { - PLARGE_INTEGER ReadTimeout; -} FILE_MAILSLOT_SET_INFORMATION, *PFILE_MAILSLOT_SET_INFORMATION; - -typedef struct _FILE_REPARSE_POINT_INFORMATION { - LONGLONG FileReference; - ULONG Tag; -} FILE_REPARSE_POINT_INFORMATION, *PFILE_REPARSE_POINT_INFORMATION; - -typedef struct _FILE_LINK_ENTRY_INFORMATION { - ULONG NextEntryOffset; - LONGLONG ParentFileId; - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_LINK_ENTRY_INFORMATION, *PFILE_LINK_ENTRY_INFORMATION; - -typedef struct _FILE_LINKS_INFORMATION { - ULONG BytesNeeded; - ULONG EntriesReturned; - FILE_LINK_ENTRY_INFORMATION Entry; -} FILE_LINKS_INFORMATION, *PFILE_LINKS_INFORMATION; - -typedef struct _FILE_NETWORK_PHYSICAL_NAME_INFORMATION { - ULONG FileNameLength; - WCHAR FileName[1]; -} FILE_NETWORK_PHYSICAL_NAME_INFORMATION, *PFILE_NETWORK_PHYSICAL_NAME_INFORMATION; - -typedef struct _FILE_STANDARD_LINK_INFORMATION { - ULONG NumberOfAccessibleLinks; - ULONG TotalNumberOfLinks; - BOOLEAN DeletePending; - BOOLEAN Directory; -} FILE_STANDARD_LINK_INFORMATION, *PFILE_STANDARD_LINK_INFORMATION; - -// -// NtQuery(Set)EaFile -// -// The offset for the start of EaValue is EaName[EaNameLength + 1] -// -// begin_wdm - - -typedef struct _FILE_GET_EA_INFORMATION { - ULONG NextEntryOffset; - UCHAR EaNameLength; - CHAR EaName[1]; -} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION; - - -// -// File Remote protocol information (FileRemoteProtocolInformation) -// - -#define REMOTE_PROTOCOL_FLAG_LOOPBACK 0x00000001 -#define REMOTE_PROTOCOL_FLAG_OFFLINE 0x00000002 - -typedef struct _FILE_REMOTE_PROTOCOL_INFORMATION -{ - // Structure Version - USHORT StructureVersion; // 1 - USHORT StructureSize; // sizeof(FILE_REMOTE_PROTOCOL_INFORMATION) - - ULONG Protocol; // Protocol (WNNC_NET_*) defined in winnetwk.h or ntifs.h. - - // Protocol Version & Type - USHORT ProtocolMajorVersion; - USHORT ProtocolMinorVersion; - USHORT ProtocolRevision; - - USHORT Reserved; - - // Protocol-Generic Information - ULONG Flags; - - struct { - ULONG Reserved[8]; - } GenericReserved; - - // Protocol specific information - - struct { - ULONG Reserved[16]; - } ProtocolSpecificReserved; - -} FILE_REMOTE_PROTOCOL_INFORMATION, *PFILE_REMOTE_PROTOCOL_INFORMATION; - -// -// NtQuery(Set)QuotaInformationFile -// - -typedef struct _FILE_GET_QUOTA_INFORMATION { - ULONG NextEntryOffset; - ULONG SidLength; - SID Sid; -} FILE_GET_QUOTA_INFORMATION, *PFILE_GET_QUOTA_INFORMATION; - -typedef struct _FILE_QUOTA_INFORMATION { - ULONG NextEntryOffset; - ULONG SidLength; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER QuotaUsed; - LARGE_INTEGER QuotaThreshold; - LARGE_INTEGER QuotaLimit; - SID Sid; -} FILE_QUOTA_INFORMATION, *PFILE_QUOTA_INFORMATION; - - -typedef struct _FILE_FS_ATTRIBUTE_INFORMATION { - ULONG FileSystemAttributes; - LONG MaximumComponentNameLength; - ULONG FileSystemNameLength; - WCHAR FileSystemName[1]; -} FILE_FS_ATTRIBUTE_INFORMATION, *PFILE_FS_ATTRIBUTE_INFORMATION; - -typedef struct _FILE_FS_DRIVER_PATH_INFORMATION { - BOOLEAN DriverInPath; - ULONG DriverNameLength; - WCHAR DriverName[1]; -} FILE_FS_DRIVER_PATH_INFORMATION, *PFILE_FS_DRIVER_PATH_INFORMATION; - -typedef struct _FILE_FS_VOLUME_FLAGS_INFORMATION { - ULONG Flags; -} FILE_FS_VOLUME_FLAGS_INFORMATION, *PFILE_FS_VOLUME_FLAGS_INFORMATION; - -// -// File system control flags -// - -#define FILE_VC_QUOTA_NONE 0x00000000 -#define FILE_VC_QUOTA_TRACK 0x00000001 -#define FILE_VC_QUOTA_ENFORCE 0x00000002 -#define FILE_VC_QUOTA_MASK 0x00000003 - -#define FILE_VC_CONTENT_INDEX_DISABLED 0x00000008 - -#define FILE_VC_LOG_QUOTA_THRESHOLD 0x00000010 -#define FILE_VC_LOG_QUOTA_LIMIT 0x00000020 -#define FILE_VC_LOG_VOLUME_THRESHOLD 0x00000040 -#define FILE_VC_LOG_VOLUME_LIMIT 0x00000080 - -#define FILE_VC_QUOTAS_INCOMPLETE 0x00000100 -#define FILE_VC_QUOTAS_REBUILDING 0x00000200 - -#define FILE_VC_VALID_MASK 0x000003ff - -typedef struct _FILE_FS_CONTROL_INFORMATION { - LARGE_INTEGER FreeSpaceStartFiltering; - LARGE_INTEGER FreeSpaceThreshold; - LARGE_INTEGER FreeSpaceStopFiltering; - LARGE_INTEGER DefaultQuotaThreshold; - LARGE_INTEGER DefaultQuotaLimit; - ULONG FileSystemControlFlags; -} FILE_FS_CONTROL_INFORMATION, *PFILE_FS_CONTROL_INFORMATION; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateFile ( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG CreateDisposition, - __in ULONG CreateOptions, - __in_bcount_opt(EaLength) PVOID EaBuffer, - __in ULONG EaLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtDeviceIoControlFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG IoControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtFsControlFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG FsControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtLockFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in PLARGE_INTEGER ByteOffset, - __in PLARGE_INTEGER Length, - __in ULONG Key, - __in BOOLEAN FailImmediately, - __in BOOLEAN ExclusiveLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenFile ( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG ShareAccess, - __in ULONG OpenOptions - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryDirectoryFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass, - __in BOOLEAN ReturnSingleEntry, - __in_opt PUNICODE_STRING FileName, - __in BOOLEAN RestartScan - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryQuotaInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in BOOLEAN ReturnSingleEntry, - __in_bcount_opt(SidListLength) PVOID SidList, - __in ULONG SidListLength, - __in_opt PSID StartSid, - __in BOOLEAN RestartScan - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryVolumeInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtReadFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in_opt PLARGE_INTEGER ByteOffset, - __in_opt PULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetQuotaInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetVolumeInformationFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtWriteFile ( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in_opt PLARGE_INTEGER ByteOffset, - __in_opt PULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtUnlockFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in PLARGE_INTEGER ByteOffset, - __in PLARGE_INTEGER Length, - __in ULONG Key - ); -#endif - -// -// Macro definition for defining IOCTL and FSCTL function control codes. Note -// that function codes 0-2047 are reserved for Microsoft Corporation, and -// 2048-4095 are reserved for customers. -// -// These macros are defined in devioctl.h which contains the portable IO -// definitions (for use by both DOS and NT) -// - -// -// The IoGetFunctionCodeFromCtlCode( ControlCode ) Macro is defined in io.h -// This macro is used to extract the function code from an IOCTL (or FSCTL). -// The macro can only be used in kernel mode code. -// - -// -// General File System control codes - Note that these values are valid -// regardless of the actual file system type -// - -// -// IMPORTANT: These values have been arranged in order of increasing -// control codes. Do NOT breaks this!! Add all new codes -// at end of list regardless of functionality type. -// -// Note: FSCTL_QUERY_RETRIEVAL_POINTER and FSCTL_MARK_AS_SYSTEM_HIVE only -// work from Kernel mode on local paging files or the system hives. -// - -// begin_winioctl - -#ifndef _FILESYSTEMFSCTL_ -#define _FILESYSTEMFSCTL_ - -// -// The following is a list of the native file system fsctls followed by -// additional network file system fsctls. Some values have been -// decommissioned. -// - -#define FSCTL_REQUEST_OPLOCK_LEVEL_1 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_REQUEST_OPLOCK_LEVEL_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_REQUEST_BATCH_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_OPLOCK_BREAK_ACKNOWLEDGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 3, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_OPBATCH_ACK_CLOSE_PENDING CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_OPLOCK_BREAK_NOTIFY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 5, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_LOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_UNLOCK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_DISMOUNT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) -// decommissioned fsctl value 9 -#define FSCTL_IS_VOLUME_MOUNTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_IS_PATHNAME_VALID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) // PATHNAME_BUFFER, -#define FSCTL_MARK_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) -// decommissioned fsctl value 13 -#define FSCTL_QUERY_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 14, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_GET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_SET_COMPRESSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) -// decommissioned fsctl value 17 -// decommissioned fsctl value 18 -#define FSCTL_SET_BOOTLOADER_ACCESSED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 19, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_OPLOCK_BREAK_ACK_NO_2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_INVALIDATE_VOLUMES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_QUERY_FAT_BPB CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) // FSCTL_QUERY_FAT_BPB_BUFFER -#define FSCTL_REQUEST_FILTER_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_FILESYSTEM_GET_STATISTICS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILESYSTEM_STATISTICS - -#if (_WIN32_WINNT >= 0x0400) -#define FSCTL_GET_NTFS_VOLUME_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_VOLUME_DATA_BUFFER -#define FSCTL_GET_NTFS_FILE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS) // NTFS_FILE_RECORD_INPUT_BUFFER, NTFS_FILE_RECORD_OUTPUT_BUFFER -#define FSCTL_GET_VOLUME_BITMAP CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 27, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_LCN_INPUT_BUFFER, VOLUME_BITMAP_BUFFER -#define FSCTL_GET_RETRIEVAL_POINTERS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 28, METHOD_NEITHER, FILE_ANY_ACCESS) // STARTING_VCN_INPUT_BUFFER, RETRIEVAL_POINTERS_BUFFER -#define FSCTL_MOVE_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 29, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // MOVE_FILE_DATA, -#define FSCTL_IS_VOLUME_DIRTY CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) -// decomissioned fsctl value 31 -#define FSCTL_ALLOW_EXTENDED_DASD_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 32, METHOD_NEITHER, FILE_ANY_ACCESS) -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0500) -// decommissioned fsctl value 33 -// decommissioned fsctl value 34 -#define FSCTL_FIND_FILES_BY_SID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 35, METHOD_NEITHER, FILE_ANY_ACCESS) -// decommissioned fsctl value 36 -// decommissioned fsctl value 37 -#define FSCTL_SET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 38, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // FILE_OBJECTID_BUFFER -#define FSCTL_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 39, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_OBJECTID_BUFFER -#define FSCTL_DELETE_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 40, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define FSCTL_SET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER, -#define FSCTL_GET_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) // REPARSE_DATA_BUFFER -#define FSCTL_DELETE_REPARSE_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 43, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // REPARSE_DATA_BUFFER, -#define FSCTL_ENUM_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 44, METHOD_NEITHER, FILE_ANY_ACCESS) // MFT_ENUM_DATA, -#define FSCTL_SECURITY_ID_CHECK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 45, METHOD_NEITHER, FILE_READ_DATA) // BULK_SECURITY_TEST_DATA, -#define FSCTL_READ_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 46, METHOD_NEITHER, FILE_ANY_ACCESS) // READ_USN_JOURNAL_DATA, USN -#define FSCTL_SET_OBJECT_ID_EXTENDED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 47, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define FSCTL_CREATE_OR_GET_OBJECT_ID CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 48, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_OBJECTID_BUFFER -#define FSCTL_SET_SPARSE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 49, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define FSCTL_SET_ZERO_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 50, METHOD_BUFFERED, FILE_WRITE_DATA) // FILE_ZERO_DATA_INFORMATION, -#define FSCTL_QUERY_ALLOCATED_RANGES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 51, METHOD_NEITHER, FILE_READ_DATA) // FILE_ALLOCATED_RANGE_BUFFER, FILE_ALLOCATED_RANGE_BUFFER -#define FSCTL_ENABLE_UPGRADE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 52, METHOD_BUFFERED, FILE_WRITE_DATA) -// decommissioned fsctl value 52 -#define FSCTL_SET_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 53, METHOD_NEITHER, FILE_ANY_ACCESS) // ENCRYPTION_BUFFER, DECRYPTION_STATUS_BUFFER -#define FSCTL_ENCRYPTION_FSCTL_IO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 54, METHOD_NEITHER, FILE_ANY_ACCESS) -#define FSCTL_WRITE_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 55, METHOD_NEITHER, FILE_SPECIAL_ACCESS) // ENCRYPTED_DATA_INFO, EXTENDED_ENCRYPTED_DATA_INFO -#define FSCTL_READ_RAW_ENCRYPTED CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 56, METHOD_NEITHER, FILE_SPECIAL_ACCESS) // REQUEST_RAW_ENCRYPTED_DATA, ENCRYPTED_DATA_INFO, EXTENDED_ENCRYPTED_DATA_INFO -#define FSCTL_CREATE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 57, METHOD_NEITHER, FILE_ANY_ACCESS) // CREATE_USN_JOURNAL_DATA, -#define FSCTL_READ_FILE_USN_DATA CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 58, METHOD_NEITHER, FILE_ANY_ACCESS) // Read the Usn Record for a file -#define FSCTL_WRITE_USN_CLOSE_RECORD CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 59, METHOD_NEITHER, FILE_ANY_ACCESS) // Generate Close Usn Record -#define FSCTL_EXTEND_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 60, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_QUERY_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 61, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_DELETE_USN_JOURNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 62, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_MARK_HANDLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 63, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_SIS_COPYFILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 64, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_SIS_LINK_FILES CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 65, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA) -// decommissional fsctl value 66 -// decommissioned fsctl value 67 -// decommissioned fsctl value 68 -#define FSCTL_RECALL_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 69, METHOD_NEITHER, FILE_ANY_ACCESS) -// decommissioned fsctl value 70 -#define FSCTL_READ_FROM_PLEX CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 71, METHOD_OUT_DIRECT, FILE_READ_DATA) -#define FSCTL_FILE_PREFETCH CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 72, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // FILE_PREFETCH -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0600) -#define FSCTL_MAKE_MEDIA_COMPATIBLE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 76, METHOD_BUFFERED, FILE_WRITE_DATA) // UDFS R/W -#define FSCTL_SET_DEFECT_MANAGEMENT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 77, METHOD_BUFFERED, FILE_WRITE_DATA) // UDFS R/W -#define FSCTL_QUERY_SPARING_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 78, METHOD_BUFFERED, FILE_ANY_ACCESS) // UDFS R/W -#define FSCTL_QUERY_ON_DISK_VOLUME_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 79, METHOD_BUFFERED, FILE_ANY_ACCESS) // C/UDFS -#define FSCTL_SET_VOLUME_COMPRESSION_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 80, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // VOLUME_COMPRESSION_STATE -// decommissioned fsctl value 80 -#define FSCTL_TXFS_MODIFY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 81, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_QUERY_RM_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 82, METHOD_BUFFERED, FILE_READ_DATA) // TxF -// decommissioned fsctl value 83 -#define FSCTL_TXFS_ROLLFORWARD_REDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 84, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_ROLLFORWARD_UNDO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 85, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_START_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 86, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_SHUTDOWN_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 87, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_READ_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 88, METHOD_BUFFERED, FILE_READ_DATA) // TxF -#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 89, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_CREATE_SECONDARY_RM CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 90, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_GET_METADATA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 91, METHOD_BUFFERED, FILE_READ_DATA) // TxF -#define FSCTL_TXFS_GET_TRANSACTED_VERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 92, METHOD_BUFFERED, FILE_READ_DATA) // TxF -// decommissioned fsctl value 93 -#define FSCTL_TXFS_SAVEPOINT_INFORMATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 94, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -#define FSCTL_TXFS_CREATE_MINIVERSION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 95, METHOD_BUFFERED, FILE_WRITE_DATA) // TxF -// decommissioned fsctl value 96 -// decommissioned fsctl value 97 -// decommissioned fsctl value 98 -#define FSCTL_TXFS_TRANSACTION_ACTIVE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 99, METHOD_BUFFERED, FILE_READ_DATA) // TxF -#define FSCTL_SET_ZERO_ON_DEALLOCATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 101, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) -#define FSCTL_SET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 102, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_GET_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 103, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_WAIT_FOR_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 104, METHOD_BUFFERED, FILE_ANY_ACCESS) -// decommissioned fsctl value 105 -#define FSCTL_INITIATE_REPAIR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 106, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_CSC_INTERNAL CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 107, METHOD_NEITHER, FILE_ANY_ACCESS) // CSC internal implementation -#define FSCTL_SHRINK_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 108, METHOD_BUFFERED, FILE_SPECIAL_ACCESS) // SHRINK_VOLUME_INFORMATION -#define FSCTL_SET_SHORT_NAME_BEHAVIOR CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 109, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_DFSR_SET_GHOST_HANDLE_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 110, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// -// Values 111 - 119 are reserved for FSRM. -// - -#define FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES \ - CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 120, METHOD_BUFFERED, FILE_READ_DATA) // TxF -#define FSCTL_TXFS_LIST_TRANSACTIONS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 121, METHOD_BUFFERED, FILE_READ_DATA) // TxF -#define FSCTL_QUERY_PAGEFILE_ENCRYPTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 122, METHOD_BUFFERED, FILE_ANY_ACCESS) -#endif /* _WIN32_WINNT >= 0x0600 */ - -#if (_WIN32_WINNT >= 0x0600) -#define FSCTL_RESET_VOLUME_ALLOCATION_HINTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 123, METHOD_BUFFERED, FILE_ANY_ACCESS) -#endif /* _WIN32_WINNT >= 0x0600 */ - -#if (_WIN32_WINNT >= 0x0601) -#define FSCTL_QUERY_DEPENDENT_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 124, METHOD_BUFFERED, FILE_ANY_ACCESS) // Dependency File System Filter -#define FSCTL_SD_GLOBAL_CHANGE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 125, METHOD_BUFFERED, FILE_ANY_ACCESS) // Update NTFS Security Descriptors -#endif /* _WIN32_WINNT >= 0x0601 */ - -#if (_WIN32_WINNT >= 0x0600) -#define FSCTL_TXFS_READ_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 126, METHOD_BUFFERED, FILE_ANY_ACCESS) // TxF -#endif /* _WIN32_WINNT >= 0x0600 */ - -#if (_WIN32_WINNT >= 0x0601) -#define FSCTL_LOOKUP_STREAM_FROM_CLUSTER CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 127, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_TXFS_WRITE_BACKUP_INFORMATION2 CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 128, METHOD_BUFFERED, FILE_ANY_ACCESS) // TxF -#define FSCTL_FILE_TYPE_NOTIFICATION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 129, METHOD_BUFFERED, FILE_ANY_ACCESS) -#endif - - -// -// Values 130 - 130 are available -// - -// -// Values 131 - 139 are reserved for FSRM. -// - -#if (_WIN32_WINNT >= 0x0601) -#define FSCTL_GET_BOOT_AREA_INFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 140, METHOD_BUFFERED, FILE_ANY_ACCESS) // BOOT_AREA_INFO -#define FSCTL_GET_RETRIEVAL_POINTER_BASE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 141, METHOD_BUFFERED, FILE_ANY_ACCESS) // RETRIEVAL_POINTER_BASE -#define FSCTL_SET_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 142, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_FS_PERSISTENT_VOLUME_INFORMATION -#define FSCTL_QUERY_PERSISTENT_VOLUME_STATE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 143, METHOD_BUFFERED, FILE_ANY_ACCESS) // FILE_FS_PERSISTENT_VOLUME_INFORMATION - -#define FSCTL_REQUEST_OPLOCK CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 144, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define FSCTL_CSV_TUNNEL_REQUEST CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 145, METHOD_BUFFERED, FILE_ANY_ACCESS) // CSV_TUNNEL_REQUEST -#define FSCTL_IS_CSV_FILE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 146, METHOD_BUFFERED, FILE_ANY_ACCESS) // IS_CSV_FILE - -#define FSCTL_QUERY_FILE_SYSTEM_RECOGNITION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 147, METHOD_BUFFERED, FILE_ANY_ACCESS) // -#define FSCTL_CSV_GET_VOLUME_PATH_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 148, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_CSV_GET_VOLUME_NAME_FOR_VOLUME_MOUNT_POINT CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 149, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_CSV_GET_VOLUME_PATH_NAMES_FOR_VOLUME_NAME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 150, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_IS_FILE_ON_CSV_VOLUME CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 151, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#endif /* _WIN32_WINNT >= 0x0601 */ - -#define FSCTL_MARK_AS_SYSTEM_HIVE FSCTL_SET_BOOTLOADER_ACCESSED - - -#if(_WIN32_WINNT >= 0x0601) - -// -// Structure for FSCTL_IS_CSV_FILE -// - -typedef struct _CSV_NAMESPACE_INFO { - - ULONG Version; - ULONG DeviceNumber; - LARGE_INTEGER StartingOffset; - ULONG SectorSize; - -} CSV_NAMESPACE_INFO, *PCSV_NAMESPACE_INFO; - -#define CSV_NAMESPACE_INFO_V1 (sizeof(CSV_NAMESPACE_INFO)) -#define CSV_INVALID_DEVICE_NUMBER 0xFFFFFFFF - -#endif /* _WIN32_WINNT >= 0x0601 */ - -// -// The following long list of structs are associated with the preceeding -// file system fsctls. -// - -// -// Structure for FSCTL_IS_PATHNAME_VALID -// - -typedef struct _PATHNAME_BUFFER { - - ULONG PathNameLength; - WCHAR Name[1]; - -} PATHNAME_BUFFER, *PPATHNAME_BUFFER; - -// -// Structure for FSCTL_QUERY_BPB_INFO -// - -typedef struct _FSCTL_QUERY_FAT_BPB_BUFFER { - - UCHAR First0x24BytesOfBootSector[0x24]; - -} FSCTL_QUERY_FAT_BPB_BUFFER, *PFSCTL_QUERY_FAT_BPB_BUFFER; - -#if (_WIN32_WINNT >= 0x0400) -// -// Structures for FSCTL_GET_NTFS_VOLUME_DATA. -// The user must pass the basic buffer below. Ntfs -// will return as many fields as available in the extended -// buffer which follows immediately after the VOLUME_DATA_BUFFER. -// - -typedef struct { - - LARGE_INTEGER VolumeSerialNumber; - LARGE_INTEGER NumberSectors; - LARGE_INTEGER TotalClusters; - LARGE_INTEGER FreeClusters; - LARGE_INTEGER TotalReserved; - ULONG BytesPerSector; - ULONG BytesPerCluster; - ULONG BytesPerFileRecordSegment; - ULONG ClustersPerFileRecordSegment; - LARGE_INTEGER MftValidDataLength; - LARGE_INTEGER MftStartLcn; - LARGE_INTEGER Mft2StartLcn; - LARGE_INTEGER MftZoneStart; - LARGE_INTEGER MftZoneEnd; - -} NTFS_VOLUME_DATA_BUFFER, *PNTFS_VOLUME_DATA_BUFFER; - -typedef struct { - - ULONG ByteCount; - - USHORT MajorVersion; - USHORT MinorVersion; - -} NTFS_EXTENDED_VOLUME_DATA, *PNTFS_EXTENDED_VOLUME_DATA; -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0400) -// -// Structure for FSCTL_GET_VOLUME_BITMAP -// - -typedef struct { - - LARGE_INTEGER StartingLcn; - -} STARTING_LCN_INPUT_BUFFER, *PSTARTING_LCN_INPUT_BUFFER; - -typedef struct { - - LARGE_INTEGER StartingLcn; - LARGE_INTEGER BitmapSize; - UCHAR Buffer[1]; - -} VOLUME_BITMAP_BUFFER, *PVOLUME_BITMAP_BUFFER; -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0400) -// -// Structure for FSCTL_GET_RETRIEVAL_POINTERS -// - -typedef struct { - - LARGE_INTEGER StartingVcn; - -} STARTING_VCN_INPUT_BUFFER, *PSTARTING_VCN_INPUT_BUFFER; - -typedef struct RETRIEVAL_POINTERS_BUFFER { - - ULONG ExtentCount; - LARGE_INTEGER StartingVcn; - struct { - LARGE_INTEGER NextVcn; - LARGE_INTEGER Lcn; - } Extents[1]; - -} RETRIEVAL_POINTERS_BUFFER, *PRETRIEVAL_POINTERS_BUFFER; -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0400) -// -// Structures for FSCTL_GET_NTFS_FILE_RECORD -// - -typedef struct { - - LARGE_INTEGER FileReferenceNumber; - -} NTFS_FILE_RECORD_INPUT_BUFFER, *PNTFS_FILE_RECORD_INPUT_BUFFER; - -typedef struct { - - LARGE_INTEGER FileReferenceNumber; - ULONG FileRecordLength; - UCHAR FileRecordBuffer[1]; - -} NTFS_FILE_RECORD_OUTPUT_BUFFER, *PNTFS_FILE_RECORD_OUTPUT_BUFFER; -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0400) -// -// Structure for FSCTL_MOVE_FILE -// - -typedef struct { - - HANDLE FileHandle; - LARGE_INTEGER StartingVcn; - LARGE_INTEGER StartingLcn; - ULONG ClusterCount; - -} MOVE_FILE_DATA, *PMOVE_FILE_DATA; - -typedef struct { - - HANDLE FileHandle; - LARGE_INTEGER SourceFileRecord; - LARGE_INTEGER TargetFileRecord; - -} MOVE_FILE_RECORD_DATA, *PMOVE_FILE_RECORD_DATA; - - -#if defined(_WIN64) -// -// 32/64 Bit thunking support structure -// - -typedef struct _MOVE_FILE_DATA32 { - - UINT32 FileHandle; - LARGE_INTEGER StartingVcn; - LARGE_INTEGER StartingLcn; - ULONG ClusterCount; - -} MOVE_FILE_DATA32, *PMOVE_FILE_DATA32; -#endif -#endif /* _WIN32_WINNT >= 0x0400 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// Structures for FSCTL_FIND_FILES_BY_SID -// - -typedef struct { - ULONG Restart; - SID Sid; -} FIND_BY_SID_DATA, *PFIND_BY_SID_DATA; - -typedef struct { - ULONG NextEntryOffset; - ULONG FileIndex; - ULONG FileNameLength; - WCHAR FileName[1]; -} FIND_BY_SID_OUTPUT, *PFIND_BY_SID_OUTPUT; - -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// The following structures apply to Usn operations. -// - -// -// Structure for FSCTL_ENUM_USN_DATA -// - -typedef struct { - - ULONGLONG StartFileReferenceNumber; - USN LowUsn; - USN HighUsn; - -} MFT_ENUM_DATA, *PMFT_ENUM_DATA; - -// -// Structure for FSCTL_CREATE_USN_JOURNAL -// - -typedef struct { - - ULONGLONG MaximumSize; - ULONGLONG AllocationDelta; - -} CREATE_USN_JOURNAL_DATA, *PCREATE_USN_JOURNAL_DATA; - -// -// Structure for FSCTL_READ_USN_JOURNAL -// - -typedef struct { - - USN StartUsn; - ULONG ReasonMask; - ULONG ReturnOnlyOnClose; - ULONGLONG Timeout; - ULONGLONG BytesToWaitFor; - ULONGLONG UsnJournalID; - -} READ_USN_JOURNAL_DATA, *PREAD_USN_JOURNAL_DATA; - -// -// The initial Major.Minor version of the Usn record will be 2.0. -// In general, the MinorVersion may be changed if fields are added -// to this structure in such a way that the previous version of the -// software can still correctly the fields it knows about. The -// MajorVersion should only be changed if the previous version of -// any software using this structure would incorrectly handle new -// records due to structure changes. -// -// The first update to this will force the structure to version 2.0. -// This will add the extended information about the source as -// well as indicate the file name offset within the structure. -// -// The following structure is returned with these fsctls. -// -// FSCTL_READ_USN_JOURNAL -// FSCTL_READ_FILE_USN_DATA -// FSCTL_ENUM_USN_DATA -// - -typedef struct { - - ULONG RecordLength; - USHORT MajorVersion; - USHORT MinorVersion; - ULONGLONG FileReferenceNumber; - ULONGLONG ParentFileReferenceNumber; - USN Usn; - LARGE_INTEGER TimeStamp; - ULONG Reason; - ULONG SourceInfo; - ULONG SecurityId; - ULONG FileAttributes; - USHORT FileNameLength; - USHORT FileNameOffset; - WCHAR FileName[1]; - -} USN_RECORD, *PUSN_RECORD; - -#define USN_PAGE_SIZE (0x1000) - -#define USN_REASON_DATA_OVERWRITE (0x00000001) -#define USN_REASON_DATA_EXTEND (0x00000002) -#define USN_REASON_DATA_TRUNCATION (0x00000004) -#define USN_REASON_NAMED_DATA_OVERWRITE (0x00000010) -#define USN_REASON_NAMED_DATA_EXTEND (0x00000020) -#define USN_REASON_NAMED_DATA_TRUNCATION (0x00000040) -#define USN_REASON_FILE_CREATE (0x00000100) -#define USN_REASON_FILE_DELETE (0x00000200) -#define USN_REASON_EA_CHANGE (0x00000400) -#define USN_REASON_SECURITY_CHANGE (0x00000800) -#define USN_REASON_RENAME_OLD_NAME (0x00001000) -#define USN_REASON_RENAME_NEW_NAME (0x00002000) -#define USN_REASON_INDEXABLE_CHANGE (0x00004000) -#define USN_REASON_BASIC_INFO_CHANGE (0x00008000) -#define USN_REASON_HARD_LINK_CHANGE (0x00010000) -#define USN_REASON_COMPRESSION_CHANGE (0x00020000) -#define USN_REASON_ENCRYPTION_CHANGE (0x00040000) -#define USN_REASON_OBJECT_ID_CHANGE (0x00080000) -#define USN_REASON_REPARSE_POINT_CHANGE (0x00100000) -#define USN_REASON_STREAM_CHANGE (0x00200000) -#define USN_REASON_TRANSACTED_CHANGE (0x00400000) -#define USN_REASON_CLOSE (0x80000000) - -// -// Structure for FSCTL_QUERY_USN_JOUNAL -// - -typedef struct { - - ULONGLONG UsnJournalID; - USN FirstUsn; - USN NextUsn; - USN LowestValidUsn; - USN MaxUsn; - ULONGLONG MaximumSize; - ULONGLONG AllocationDelta; - -} USN_JOURNAL_DATA, *PUSN_JOURNAL_DATA; - -// -// Structure for FSCTL_DELETE_USN_JOURNAL -// - -typedef struct { - - ULONGLONG UsnJournalID; - ULONG DeleteFlags; - -} DELETE_USN_JOURNAL_DATA, *PDELETE_USN_JOURNAL_DATA; - -#define USN_DELETE_FLAG_DELETE (0x00000001) -#define USN_DELETE_FLAG_NOTIFY (0x00000002) - -#define USN_DELETE_VALID_FLAGS (0x00000003) - -// -// Structure for FSCTL_MARK_HANDLE -// - -typedef struct { - - ULONG UsnSourceInfo; - HANDLE VolumeHandle; - ULONG HandleInfo; - -} MARK_HANDLE_INFO, *PMARK_HANDLE_INFO; - -#if defined(_WIN64) -// -// 32/64 Bit thunking support structure -// - -typedef struct { - - ULONG UsnSourceInfo; - UINT32 VolumeHandle; - ULONG HandleInfo; - -} MARK_HANDLE_INFO32, *PMARK_HANDLE_INFO32; -#endif - -// -// Flags for the additional source information above. -// -// USN_SOURCE_DATA_MANAGEMENT - Service is not modifying the external view -// of any part of the file. Typical case is HSM moving data to -// and from external storage. -// -// USN_SOURCE_AUXILIARY_DATA - Service is not modifying the external view -// of the file with regard to the application that created this file. -// Can be used to add private data streams to a file. -// -// USN_SOURCE_REPLICATION_MANAGEMENT - Service is modifying a file to match -// the contents of the same file which exists in another member of the -// replica set. -// - -#define USN_SOURCE_DATA_MANAGEMENT (0x00000001) -#define USN_SOURCE_AUXILIARY_DATA (0x00000002) -#define USN_SOURCE_REPLICATION_MANAGEMENT (0x00000004) - -// -// Flags for the HandleInfo field above -// -// MARK_HANDLE_PROTECT_CLUSTERS - disallow any defragmenting (FSCTL_MOVE_FILE) until the -// the handle is closed -// -// MARK_HANDLE_TXF_SYSTEM_LOG - indicates that this stream is being used as the Txf -// log for an RM on the volume. Must be called in the kernel using -// IRP_MN_KERNEL_CALL. -// -// MARK_HANDLE_NOT_TXF_SYSTEM_LOG - indicates that this user is no longer using this -// object as a log file. -// - -#define MARK_HANDLE_PROTECT_CLUSTERS (0x00000001) -#define MARK_HANDLE_TXF_SYSTEM_LOG (0x00000004) -#define MARK_HANDLE_NOT_TXF_SYSTEM_LOG (0x00000008) - -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0601) - -#define MARK_HANDLE_REALTIME (0x00000020) -#define MARK_HANDLE_NOT_REALTIME (0x00000040) - -#define NO_8DOT3_NAME_PRESENT (0x00000001) -#define REMOVED_8DOT3_NAME (0x00000002) - -#define PERSISTENT_VOLUME_STATE_SHORT_NAME_CREATION_DISABLED (0x00000001) - -#endif /* _WIN32_WINNT >= 0x0601 */ - - -#if (_WIN32_WINNT >= 0x0500) -// -// Structure for FSCTL_SECURITY_ID_CHECK -// - -typedef struct { - - ACCESS_MASK DesiredAccess; - ULONG SecurityIds[1]; - -} BULK_SECURITY_TEST_DATA, *PBULK_SECURITY_TEST_DATA; -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// Output flags for the FSCTL_IS_VOLUME_DIRTY -// - -#define VOLUME_IS_DIRTY (0x00000001) -#define VOLUME_UPGRADE_SCHEDULED (0x00000002) -#define VOLUME_SESSION_OPEN (0x00000004) -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// Structures for FSCTL_FILE_PREFETCH -// - -typedef struct _FILE_PREFETCH { - ULONG Type; - ULONG Count; - ULONGLONG Prefetch[1]; -} FILE_PREFETCH, *PFILE_PREFETCH; - -typedef struct _FILE_PREFETCH_EX { - ULONG Type; - ULONG Count; - PVOID Context; - ULONGLONG Prefetch[1]; -} FILE_PREFETCH_EX, *PFILE_PREFETCH_EX; - -#define FILE_PREFETCH_TYPE_FOR_CREATE 0x1 -#define FILE_PREFETCH_TYPE_FOR_DIRENUM 0x2 -#define FILE_PREFETCH_TYPE_FOR_CREATE_EX 0x3 -#define FILE_PREFETCH_TYPE_FOR_DIRENUM_EX 0x4 - -#define FILE_PREFETCH_TYPE_MAX 0x4 - -#endif /* _WIN32_WINNT >= 0x0500 */ - -// -// Structures for FSCTL_FILESYSTEM_GET_STATISTICS -// -// Filesystem performance counters -// - -typedef struct _FILESYSTEM_STATISTICS { - - USHORT FileSystemType; - USHORT Version; // currently version 1 - - ULONG SizeOfCompleteStructure; // must by a mutiple of 64 bytes - - ULONG UserFileReads; - ULONG UserFileReadBytes; - ULONG UserDiskReads; - ULONG UserFileWrites; - ULONG UserFileWriteBytes; - ULONG UserDiskWrites; - - ULONG MetaDataReads; - ULONG MetaDataReadBytes; - ULONG MetaDataDiskReads; - ULONG MetaDataWrites; - ULONG MetaDataWriteBytes; - ULONG MetaDataDiskWrites; - - // - // The file system's private structure is appended here. - // - -} FILESYSTEM_STATISTICS, *PFILESYSTEM_STATISTICS; - -// values for FS_STATISTICS.FileSystemType - -#define FILESYSTEM_STATISTICS_TYPE_NTFS 1 -#define FILESYSTEM_STATISTICS_TYPE_FAT 2 -#define FILESYSTEM_STATISTICS_TYPE_EXFAT 3 - -// -// File System Specific Statistics Data -// - -typedef struct _FAT_STATISTICS { - ULONG CreateHits; - ULONG SuccessfulCreates; - ULONG FailedCreates; - - ULONG NonCachedReads; - ULONG NonCachedReadBytes; - ULONG NonCachedWrites; - ULONG NonCachedWriteBytes; - - ULONG NonCachedDiskReads; - ULONG NonCachedDiskWrites; -} FAT_STATISTICS, *PFAT_STATISTICS; - -typedef struct _EXFAT_STATISTICS { - ULONG CreateHits; - ULONG SuccessfulCreates; - ULONG FailedCreates; - - ULONG NonCachedReads; - ULONG NonCachedReadBytes; - ULONG NonCachedWrites; - ULONG NonCachedWriteBytes; - - ULONG NonCachedDiskReads; - ULONG NonCachedDiskWrites; -} EXFAT_STATISTICS, *PEXFAT_STATISTICS; - -typedef struct _NTFS_STATISTICS { - - ULONG LogFileFullExceptions; - ULONG OtherExceptions; - - // - // Other meta data io's - // - - ULONG MftReads; - ULONG MftReadBytes; - ULONG MftWrites; - ULONG MftWriteBytes; - struct { - USHORT Write; - USHORT Create; - USHORT SetInfo; - USHORT Flush; - } MftWritesUserLevel; - - USHORT MftWritesFlushForLogFileFull; - USHORT MftWritesLazyWriter; - USHORT MftWritesUserRequest; - - ULONG Mft2Writes; - ULONG Mft2WriteBytes; - struct { - USHORT Write; - USHORT Create; - USHORT SetInfo; - USHORT Flush; - } Mft2WritesUserLevel; - - USHORT Mft2WritesFlushForLogFileFull; - USHORT Mft2WritesLazyWriter; - USHORT Mft2WritesUserRequest; - - ULONG RootIndexReads; - ULONG RootIndexReadBytes; - ULONG RootIndexWrites; - ULONG RootIndexWriteBytes; - - ULONG BitmapReads; - ULONG BitmapReadBytes; - ULONG BitmapWrites; - ULONG BitmapWriteBytes; - - USHORT BitmapWritesFlushForLogFileFull; - USHORT BitmapWritesLazyWriter; - USHORT BitmapWritesUserRequest; - - struct { - USHORT Write; - USHORT Create; - USHORT SetInfo; - } BitmapWritesUserLevel; - - ULONG MftBitmapReads; - ULONG MftBitmapReadBytes; - ULONG MftBitmapWrites; - ULONG MftBitmapWriteBytes; - - USHORT MftBitmapWritesFlushForLogFileFull; - USHORT MftBitmapWritesLazyWriter; - USHORT MftBitmapWritesUserRequest; - - struct { - USHORT Write; - USHORT Create; - USHORT SetInfo; - USHORT Flush; - } MftBitmapWritesUserLevel; - - ULONG UserIndexReads; - ULONG UserIndexReadBytes; - ULONG UserIndexWrites; - ULONG UserIndexWriteBytes; - - // - // Additions for NT 5.0 - // - - ULONG LogFileReads; - ULONG LogFileReadBytes; - ULONG LogFileWrites; - ULONG LogFileWriteBytes; - - struct { - ULONG Calls; // number of individual calls to allocate clusters - ULONG Clusters; // number of clusters allocated - ULONG Hints; // number of times a hint was specified - - ULONG RunsReturned; // number of runs used to satisify all the requests - - ULONG HintsHonored; // number of times the hint was useful - ULONG HintsClusters; // number of clusters allocated via the hint - ULONG Cache; // number of times the cache was useful other than the hint - ULONG CacheClusters; // number of clusters allocated via the cache other than the hint - ULONG CacheMiss; // number of times the cache wasn't useful - ULONG CacheMissClusters; // number of clusters allocated without the cache - } Allocate; - -} NTFS_STATISTICS, *PNTFS_STATISTICS; - -#if (_WIN32_WINNT >= 0x0500) -// -// Structure for FSCTL_SET_OBJECT_ID, FSCTL_GET_OBJECT_ID, and FSCTL_CREATE_OR_GET_OBJECT_ID -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // unnamed struct - -typedef struct _FILE_OBJECTID_BUFFER { - - // - // This is the portion of the object id that is indexed. - // - - UCHAR ObjectId[16]; - - // - // This portion of the object id is not indexed, it's just - // some metadata for the user's benefit. - // - - union { - struct { - UCHAR BirthVolumeId[16]; - UCHAR BirthObjectId[16]; - UCHAR DomainId[16]; - } DUMMYSTRUCTNAME; - UCHAR ExtendedInfo[48]; - } DUMMYUNIONNAME; - -} FILE_OBJECTID_BUFFER, *PFILE_OBJECTID_BUFFER; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning( default : 4201 ) /* nonstandard extension used : nameless struct/union */ -#endif - -#endif /* _WIN32_WINNT >= 0x0500 */ - - -#if (_WIN32_WINNT >= 0x0500) -// -// Structure for FSCTL_SET_SPARSE -// - -typedef struct _FILE_SET_SPARSE_BUFFER { - BOOLEAN SetSparse; -} FILE_SET_SPARSE_BUFFER, *PFILE_SET_SPARSE_BUFFER; - - -#endif /* _WIN32_WINNT >= 0x0500 */ - - -#if (_WIN32_WINNT >= 0x0500) -// -// Structure for FSCTL_SET_ZERO_DATA -// - -typedef struct _FILE_ZERO_DATA_INFORMATION { - - LARGE_INTEGER FileOffset; - LARGE_INTEGER BeyondFinalZero; - -} FILE_ZERO_DATA_INFORMATION, *PFILE_ZERO_DATA_INFORMATION; -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// Structure for FSCTL_QUERY_ALLOCATED_RANGES -// - -// -// Querying the allocated ranges requires an output buffer to store the -// allocated ranges and an input buffer to specify the range to query. -// The input buffer contains a single entry, the output buffer is an -// array of the following structure. -// - -typedef struct _FILE_ALLOCATED_RANGE_BUFFER { - - LARGE_INTEGER FileOffset; - LARGE_INTEGER Length; - -} FILE_ALLOCATED_RANGE_BUFFER, *PFILE_ALLOCATED_RANGE_BUFFER; -#endif /* _WIN32_WINNT >= 0x0500 */ - - -#if (_WIN32_WINNT >= 0x0500) -// -// Structures for FSCTL_SET_ENCRYPTION, FSCTL_WRITE_RAW_ENCRYPTED, and FSCTL_READ_RAW_ENCRYPTED -// - -// -// The input buffer to set encryption indicates whether we are to encrypt/decrypt a file -// or an individual stream. -// - -typedef struct _ENCRYPTION_BUFFER { - - ULONG EncryptionOperation; - UCHAR Private[1]; - -} ENCRYPTION_BUFFER, *PENCRYPTION_BUFFER; - -#define FILE_SET_ENCRYPTION 0x00000001 -#define FILE_CLEAR_ENCRYPTION 0x00000002 -#define STREAM_SET_ENCRYPTION 0x00000003 -#define STREAM_CLEAR_ENCRYPTION 0x00000004 - -#define MAXIMUM_ENCRYPTION_VALUE 0x00000004 - -// -// The optional output buffer to set encryption indicates that the last encrypted -// stream in a file has been marked as decrypted. -// - -typedef struct _DECRYPTION_STATUS_BUFFER { - - BOOLEAN NoEncryptedStreams; - -} DECRYPTION_STATUS_BUFFER, *PDECRYPTION_STATUS_BUFFER; - -#define ENCRYPTION_FORMAT_DEFAULT (0x01) - -#define COMPRESSION_FORMAT_SPARSE (0x4000) - -// -// Request Encrypted Data structure. This is used to indicate -// the range of the file to read. It also describes the -// output buffer used to return the data. -// - -typedef struct _REQUEST_RAW_ENCRYPTED_DATA { - - // - // Requested file offset and requested length to read. - // The fsctl will round the starting offset down - // to a file system boundary. It will also - // round the length up to a file system boundary. - // - - LONGLONG FileOffset; - ULONG Length; - -} REQUEST_RAW_ENCRYPTED_DATA, *PREQUEST_RAW_ENCRYPTED_DATA; - -// -// Encrypted Data Information structure. This structure -// is used to return raw encrypted data from a file in -// order to perform off-line recovery. The data will be -// encrypted or encrypted and compressed. The off-line -// service will need to use the encryption and compression -// format information to recover the file data. In the -// event that the data is both encrypted and compressed then -// the decryption must occur before decompression. All -// the data units below must be encrypted and compressed -// with the same format. -// -// The data will be returned in units. The data unit size -// will be fixed per request. If the data is compressed -// then the data unit size will be the compression unit size. -// -// This structure is at the beginning of the buffer used to -// return the encrypted data. The actual raw bytes from -// the file will follow this buffer. The offset of the -// raw bytes from the beginning of this structure is -// specified in the REQUEST_RAW_ENCRYPTED_DATA structure -// described above. -// - -typedef struct _ENCRYPTED_DATA_INFO { - - // - // This is the file offset for the first entry in the - // data block array. The file system will round - // the requested start offset down to a boundary - // that is consistent with the format of the file. - // - - ULONGLONG StartingFileOffset; - - // - // Data offset in output buffer. The output buffer - // begins with an ENCRYPTED_DATA_INFO structure. - // The file system will then store the raw bytes from - // disk beginning at the following offset within the - // output buffer. - // - - ULONG OutputBufferOffset; - - // - // The number of bytes being returned that are within - // the size of the file. If this value is less than - // (NumberOfDataBlocks << DataUnitShift), it means the - // end of the file occurs within this transfer. Any - // data beyond file size is invalid and was never - // passed to the encryption driver. - // - - ULONG BytesWithinFileSize; - - // - // The number of bytes being returned that are below - // valid data length. If this value is less than - // (NumberOfDataBlocks << DataUnitShift), it means the - // end of the valid data occurs within this transfer. - // After decrypting the data from this transfer, any - // byte(s) beyond valid data length must be zeroed. - // - - ULONG BytesWithinValidDataLength; - - // - // Code for the compression format as defined in - // ntrtl.h. Note that COMPRESSION_FORMAT_NONE - // and COMPRESSION_FORMAT_DEFAULT are invalid if - // any of the described chunks are compressed. - // - - USHORT CompressionFormat; - - // - // The DataUnit is the granularity used to access the - // disk. It will be the same as the compression unit - // size for a compressed file. For an uncompressed - // file, it will be some cluster-aligned power of 2 that - // the file system deems convenient. A caller should - // not expect that successive calls will have the - // same data unit shift value as the previous call. - // - // Since chunks and compression units are expected to be - // powers of 2 in size, we express them log2. So, for - // example (1 << ChunkShift) == ChunkSizeInBytes. The - // ClusterShift indicates how much space must be saved - // to successfully compress a compression unit - each - // successfully compressed data unit must occupy - // at least one cluster less in bytes than an uncompressed - // data block unit. - // - - UCHAR DataUnitShift; - UCHAR ChunkShift; - UCHAR ClusterShift; - - // - // The format for the encryption. - // - - UCHAR EncryptionFormat; - - // - // This is the number of entries in the data block size - // array. - // - - USHORT NumberOfDataBlocks; - - // - // This is an array of sizes in the data block array. There - // must be one entry in this array for each data block - // read from disk. The size has a different meaning - // depending on whether the file is compressed. - // - // A size of zero always indicates that the final data consists entirely - // of zeroes. There is no decryption or decompression to - // perform. - // - // If the file is compressed then the data block size indicates - // whether this block is compressed. A size equal to - // the block size indicates that the corresponding block did - // not compress. Any other non-zero size indicates the - // size of the compressed data which needs to be - // decrypted/decompressed. - // - // If the file is not compressed then the data block size - // indicates the amount of data within the block that - // needs to be decrypted. Any other non-zero size indicates - // that the remaining bytes in the data unit within the file - // consists of zeros. An example of this is when the - // the read spans the valid data length of the file. There - // is no data to decrypt past the valid data length. - // - - ULONG DataBlockSize[ANYSIZE_ARRAY]; - -} ENCRYPTED_DATA_INFO; -typedef ENCRYPTED_DATA_INFO *PENCRYPTED_DATA_INFO; -#endif /* _WIN32_WINNT >= 0x0500 */ - - -#if (_WIN32_WINNT >= 0x0500) -// -// FSCTL_READ_FROM_PLEX support -// Request Plex Read Data structure. This is used to indicate -// the range of the file to read. It also describes -// which plex to perform the read from. -// - -typedef struct _PLEX_READ_DATA_REQUEST { - - // - // Requested offset and length to read. - // The offset can be the virtual offset (vbo) in to a file, - // or a volume. In the case of a file offset, - // the fsd will round the starting offset down - // to a file system boundary. It will also - // round the length up to a file system boundary and - // enforce any other applicable limits. - // - - LARGE_INTEGER ByteOffset; - ULONG ByteLength; - ULONG PlexNumber; - -} PLEX_READ_DATA_REQUEST, *PPLEX_READ_DATA_REQUEST; -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0500) -// -// FSCTL_SIS_COPYFILE support -// Source and destination file names are passed in the FileNameBuffer. -// Both strings are null terminated, with the source name starting at -// the beginning of FileNameBuffer, and the destination name immediately -// following. Length fields include terminating nulls. -// - -typedef struct _SI_COPYFILE { - ULONG SourceFileNameLength; - ULONG DestinationFileNameLength; - ULONG Flags; - WCHAR FileNameBuffer[1]; -} SI_COPYFILE, *PSI_COPYFILE; - -#define COPYFILE_SIS_LINK 0x0001 // Copy only if source is SIS -#define COPYFILE_SIS_REPLACE 0x0002 // Replace destination if it exists, otherwise don't. -#define COPYFILE_SIS_FLAGS 0x0003 -#endif /* _WIN32_WINNT >= 0x0500 */ - -#if (_WIN32_WINNT >= 0x0600) -// -// Input parameter structure for FSCTL_MAKE_COMPATIBLE -// - -typedef struct _FILE_MAKE_COMPATIBLE_BUFFER { - BOOLEAN CloseDisc; -} FILE_MAKE_COMPATIBLE_BUFFER, *PFILE_MAKE_COMPATIBLE_BUFFER; - -// -// Input parameter structure for FSCTL_SET_DEFECT_MANAGEMENT -// - -typedef struct _FILE_SET_DEFECT_MGMT_BUFFER { - BOOLEAN Disable; -} FILE_SET_DEFECT_MGMT_BUFFER, *PFILE_SET_DEFECT_MGMT_BUFFER; - -// -// Output structure for FSCTL_QUERY_SPARING_INFO -// - -typedef struct _FILE_QUERY_SPARING_BUFFER { - ULONG SparingUnitBytes; - BOOLEAN SoftwareSparing; - ULONG TotalSpareBlocks; - ULONG FreeSpareBlocks; -} FILE_QUERY_SPARING_BUFFER, *PFILE_QUERY_SPARING_BUFFER; - -// -// Output structure for FSCTL_QUERY_ON_DISK_VOLUME_INFO -// - -typedef struct _FILE_QUERY_ON_DISK_VOL_INFO_BUFFER { - LARGE_INTEGER DirectoryCount; // -1 = unknown - LARGE_INTEGER FileCount; // -1 = unknown - USHORT FsFormatMajVersion; // -1 = unknown or n/a - USHORT FsFormatMinVersion; // -1 = unknown or n/a - WCHAR FsFormatName[ 12]; - LARGE_INTEGER FormatTime; - LARGE_INTEGER LastUpdateTime; - WCHAR CopyrightInfo[ 34]; - WCHAR AbstractInfo[ 34]; - WCHAR FormattingImplementationInfo[ 34]; - WCHAR LastModifyingImplementationInfo[ 34]; -} FILE_QUERY_ON_DISK_VOL_INFO_BUFFER, *PFILE_QUERY_ON_DISK_VOL_INFO_BUFFER; - -// -// Input flags for FSCTL_SET_REPAIR -// - -#define SET_REPAIR_ENABLED (0x00000001) -#define SET_REPAIR_VOLUME_BITMAP_SCAN (0x00000002) -#define SET_REPAIR_DELETE_CROSSLINK (0x00000004) -#define SET_REPAIR_WARN_ABOUT_DATA_LOSS (0x00000008) -#define SET_REPAIR_DISABLED_AND_BUGCHECK_ON_CORRUPT (0x00000010) -#define SET_REPAIR_VALID_MASK (0x0000001F) - -// -// Input structures for FSCTL_SHRINK_VOLUME. -// - -typedef enum _SHRINK_VOLUME_REQUEST_TYPES -{ - ShrinkPrepare = 1, - ShrinkCommit, - ShrinkAbort - -} SHRINK_VOLUME_REQUEST_TYPES, *PSHRINK_VOLUME_REQUEST_TYPES; - -typedef struct _SHRINK_VOLUME_INFORMATION -{ - SHRINK_VOLUME_REQUEST_TYPES ShrinkRequestType; - ULONGLONG Flags; - LONGLONG NewNumberOfSectors; - -} SHRINK_VOLUME_INFORMATION, *PSHRINK_VOLUME_INFORMATION; - -// -// Structures for FSCTL_TXFS_MODIFY_RM and FSCTL_TXFS_QUERY_RM_INFORMATION -// -// For ModifyRM, TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS and -// TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT are mutually exclusive. -// You can specify the log growth amount in number of containers or as a percentage. -// -// For ModifyRM, TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX and -// TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX are mutually exclusive. -// -// For ModifyRM, TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN and -// TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN are mutually exclusive. -// -// For ModifyRM, TXFS_RM_FLAG_RESET_RM_AT_NEXT_START and -// TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START are mutually exclusive and only -// apply to default RMs. -// -// For ModifyRM, TXFS_RM_FLAG_PREFER_CONSISTENCY and -// TXFS_RM_FLAG_PREFER_AVAILABILITY are mutually exclusive. After calling ModifyRM -// with one of these flags set the RM must be restarted for the change to take effect. -// - -#define TXFS_RM_FLAG_LOGGING_MODE 0x00000001 -#define TXFS_RM_FLAG_RENAME_RM 0x00000002 -#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX 0x00000004 -#define TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN 0x00000008 -#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS 0x00000010 -#define TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT 0x00000020 -#define TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE 0x00000040 -#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX 0x00000080 -#define TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN 0x00000100 -#define TXFS_RM_FLAG_GROW_LOG 0x00000400 -#define TXFS_RM_FLAG_SHRINK_LOG 0x00000800 -#define TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE 0x00001000 -#define TXFS_RM_FLAG_PRESERVE_CHANGES 0x00002000 -#define TXFS_RM_FLAG_RESET_RM_AT_NEXT_START 0x00004000 -#define TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START 0x00008000 -#define TXFS_RM_FLAG_PREFER_CONSISTENCY 0x00010000 -#define TXFS_RM_FLAG_PREFER_AVAILABILITY 0x00020000 - -#define TXFS_LOGGING_MODE_SIMPLE (0x0001) -#define TXFS_LOGGING_MODE_FULL (0x0002) - -#define TXFS_TRANSACTION_STATE_NONE 0x00 -#define TXFS_TRANSACTION_STATE_ACTIVE 0x01 -#define TXFS_TRANSACTION_STATE_PREPARED 0x02 -#define TXFS_TRANSACTION_STATE_NOTACTIVE 0x03 - -#define TXFS_MODIFY_RM_VALID_FLAGS \ - (TXFS_RM_FLAG_LOGGING_MODE | \ - TXFS_RM_FLAG_RENAME_RM | \ - TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX | \ - TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN | \ - TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \ - TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \ - TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE | \ - TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \ - TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN | \ - TXFS_RM_FLAG_SHRINK_LOG | \ - TXFS_RM_FLAG_GROW_LOG | \ - TXFS_RM_FLAG_ENFORCE_MINIMUM_SIZE | \ - TXFS_RM_FLAG_PRESERVE_CHANGES | \ - TXFS_RM_FLAG_RESET_RM_AT_NEXT_START | \ - TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START | \ - TXFS_RM_FLAG_PREFER_CONSISTENCY | \ - TXFS_RM_FLAG_PREFER_AVAILABILITY) - -typedef struct _TXFS_MODIFY_RM { - - // - // TXFS_RM_FLAG_* flags - // - - ULONG Flags; - - // - // Maximum log container count if TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MAX is set. - // - - ULONG LogContainerCountMax; - - // - // Minimum log container count if TXFS_RM_FLAG_LOG_CONTAINER_COUNT_MIN is set. - // - - ULONG LogContainerCountMin; - - // - // Target log container count for TXFS_RM_FLAG_SHRINK_LOG or _GROW_LOG. - // - - ULONG LogContainerCount; - - // - // When the log is full, increase its size by this much. Indicated as either a percent of - // the log size or absolute container count, depending on which of the TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_* - // flags is set. - // - - ULONG LogGrowthIncrement; - - // - // Sets autoshrink policy if TXFS_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE is set. Autoshrink - // makes the log shrink so that no more than this percentage of the log is free at any time. - // - - ULONG LogAutoShrinkPercentage; - - // - // Reserved. - // - - ULONGLONG Reserved; - - // - // If TXFS_RM_FLAG_LOGGING_MODE is set, this must contain one of TXFS_LOGGING_MODE_SIMPLE - // or TXFS_LOGGING_MODE_FULL. - // - - USHORT LoggingMode; - -} TXFS_MODIFY_RM, - *PTXFS_MODIFY_RM; - -#define TXFS_RM_STATE_NOT_STARTED 0 -#define TXFS_RM_STATE_STARTING 1 -#define TXFS_RM_STATE_ACTIVE 2 -#define TXFS_RM_STATE_SHUTTING_DOWN 3 - -// -// The flags field for query RM information is used for the following information: -// -// 1) To indicate whether the LogGrowthIncrement field is reported as a percent -// or as a number of containers. Possible flag values for this are: -// -// TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS xor TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT -// -// 2) To indicate that there is no set maximum or minimum container count. Possible -// flag values for this are: -// -// TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX -// TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN -// -// Note that these flags are not mutually exclusive. -// -// 2) To report whether the RM will be reset the next time it is started. Note that -// only the default RM will report a meaningful value (secondary RMs will always -// report DO_NOT_RESET) Possible flag values for this are: -// -// TXFS_RM_FLAG_RESET_RM_AT_NEXT_START xor TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START -// -// 3) To report whether the RM is in consistency mode or availability mode. Possible -// flag values for this are: -// -// TXFS_RM_FLAG_PREFER_CONSISTENCY xor TXFS_RM_FLAG_PREFER_AVAILABILITY -// -// The RmState field can have exactly one of the above-defined TXF_RM_STATE_ values. -// - -#define TXFS_QUERY_RM_INFORMATION_VALID_FLAGS \ - (TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \ - TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \ - TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \ - TXFS_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN | \ - TXFS_RM_FLAG_RESET_RM_AT_NEXT_START | \ - TXFS_RM_FLAG_DO_NOT_RESET_RM_AT_NEXT_START | \ - TXFS_RM_FLAG_PREFER_CONSISTENCY | \ - TXFS_RM_FLAG_PREFER_AVAILABILITY) - -typedef struct _TXFS_QUERY_RM_INFORMATION { - - // - // If the return value is STATUS_BUFFER_OVERFLOW (ERROR_MORE_DATA), this - // will indicate how much space is required to hold everything. - // - - ULONG BytesRequired; - - // - // LSN of earliest available record in the RM's log. - // - - ULONGLONG TailLsn; - - // - // LSN of most recently-written record in the RM's log. - // - - ULONGLONG CurrentLsn; - - // - // LSN of the log's archive tail. - // - - ULONGLONG ArchiveTailLsn; - - // - // Size of a log container in bytes. - // - - ULONGLONG LogContainerSize; - - // - // Highest virtual clock value recorded in this RM's log. - // - - LARGE_INTEGER HighestVirtualClock; - - // - // Number of containers in this RM's log. - // - - ULONG LogContainerCount; - - // - // Maximum-allowed log container count. - // - - ULONG LogContainerCountMax; - - // - // Minimum-allowed log container count. - // - - ULONG LogContainerCountMin; - - // - // Amount by which log will grow when it gets full. Indicated as either a percent of - // the log size or absolute container count, depending on which of the TXFS_RM_FLAG_LOG_GROWTH_INCREMENT_* - // flags is set. - // - - ULONG LogGrowthIncrement; - - // - // Reports on the autoshrink policy if. Autoshrink makes the log shrink so that no more than this - // percentage of the log is free at any time. A value of 0 indicates that autoshrink is off (i.e. - // the log will not automatically shrink). - // - - ULONG LogAutoShrinkPercentage; - - // - // TXFS_RM_FLAG_* flags. See the comment above at TXFS_QUERY_RM_INFORMATION_VALID_FLAGS to see - // what the flags here mean. - // - - ULONG Flags; - - // - // Exactly one of TXFS_LOGGING_MODE_SIMPLE or TXFS_LOGGING_MODE_FULL. - // - - USHORT LoggingMode; - - // - // Reserved. - // - - USHORT Reserved; - - // - // Activity state of the RM. May be exactly one of the above-defined TXF_RM_STATE_ values. - // - - ULONG RmState; - - // - // Total capacity of the log in bytes. - // - - ULONGLONG LogCapacity; - - // - // Amount of free space in the log in bytes. - // - - ULONGLONG LogFree; - - // - // Size of $Tops in bytes. - // - - ULONGLONG TopsSize; - - // - // Amount of space in $Tops in use. - // - - ULONGLONG TopsUsed; - - // - // Number of transactions active in the RM at the time of the call. - // - - ULONGLONG TransactionCount; - - // - // Total number of single-phase commits that have happened the RM. - // - - ULONGLONG OnePCCount; - - // - // Total number of two-phase commits that have happened the RM. - // - - ULONGLONG TwoPCCount; - - // - // Number of times the log has filled up. - // - - ULONGLONG NumberLogFileFull; - - // - // Age of oldest active transaction in the RM, in milliseconds. - // - - ULONGLONG OldestTransactionAge; - - // - // Name of the RM. - // - - GUID RMName; - - // - // Offset in bytes from the beginning of this structure to a NULL-terminated Unicode - // string indicating the path to the RM's transaction manager's log. - // - - ULONG TmLogPathOffset; - -} TXFS_QUERY_RM_INFORMATION, - *PTXFS_QUERY_RM_INFORMATION; - -// -// Structures for FSCTL_TXFS_ROLLFORWARD_REDO -// - -#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN 0x01 -#define TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK 0x02 - -#define TXFS_ROLLFORWARD_REDO_VALID_FLAGS \ - (TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_REDO_LSN | \ - TXFS_ROLLFORWARD_REDO_FLAG_USE_LAST_VIRTUAL_CLOCK) - -typedef struct _TXFS_ROLLFORWARD_REDO_INFORMATION { - LARGE_INTEGER LastVirtualClock; - ULONGLONG LastRedoLsn; - ULONGLONG HighestRecoveryLsn; - ULONG Flags; -} TXFS_ROLLFORWARD_REDO_INFORMATION, - *PTXFS_ROLLFORWARD_REDO_INFORMATION; - -// -// Structures for FSCTL_TXFS_START_RM -// -// Note that TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS and -// TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT are mutually exclusive. -// You can specify the log growth amount in number of containers or as a percentage. -// -// TXFS_START_RM_FLAG_CONTAINER_COUNT_MAX and TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX -// are mutually exclusive. -// -// TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN and TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN -// are mutually exclusive. -// -// TXFS_START_RM_FLAG_PREFER_CONSISTENCY and TXFS_START_RM_FLAG_PREFER_AVAILABILITY -// are mutually exclusive. -// -// Optional parameters will have system-supplied defaults applied if omitted. -// - -#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX 0x00000001 -#define TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN 0x00000002 -#define TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE 0x00000004 -#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS 0x00000008 -#define TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT 0x00000010 -#define TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE 0x00000020 -#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX 0x00000040 -#define TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MIN 0x00000080 - -#define TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT 0x00000200 -#define TXFS_START_RM_FLAG_LOGGING_MODE 0x00000400 -#define TXFS_START_RM_FLAG_PRESERVE_CHANGES 0x00000800 - -#define TXFS_START_RM_FLAG_PREFER_CONSISTENCY 0x00001000 -#define TXFS_START_RM_FLAG_PREFER_AVAILABILITY 0x00002000 - -#define TXFS_START_RM_VALID_FLAGS \ - (TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MAX | \ - TXFS_START_RM_FLAG_LOG_CONTAINER_COUNT_MIN | \ - TXFS_START_RM_FLAG_LOG_CONTAINER_SIZE | \ - TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_NUM_CONTAINERS | \ - TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_PERCENT | \ - TXFS_START_RM_FLAG_LOG_AUTO_SHRINK_PERCENTAGE | \ - TXFS_START_RM_FLAG_RECOVER_BEST_EFFORT | \ - TXFS_START_RM_FLAG_LOG_NO_CONTAINER_COUNT_MAX | \ - TXFS_START_RM_FLAG_LOGGING_MODE | \ - TXFS_START_RM_FLAG_PRESERVE_CHANGES | \ - TXFS_START_RM_FLAG_PREFER_CONSISTENCY | \ - TXFS_START_RM_FLAG_PREFER_AVAILABILITY) - -typedef struct _TXFS_START_RM_INFORMATION { - - // - // TXFS_START_RM_FLAG_* flags. - // - - ULONG Flags; - - // - // RM log container size, in bytes. This parameter is optional. - // - - ULONGLONG LogContainerSize; - - // - // RM minimum log container count. This parameter is optional. - // - - ULONG LogContainerCountMin; - - // - // RM maximum log container count. This parameter is optional. - // - - ULONG LogContainerCountMax; - - // - // RM log growth increment in number of containers or percent, as indicated - // by TXFS_START_RM_FLAG_LOG_GROWTH_INCREMENT_* flag. This parameter is - // optional. - // - - ULONG LogGrowthIncrement; - - // - // RM log auto shrink percentage. This parameter is optional. - // - - ULONG LogAutoShrinkPercentage; - - // - // Offset from the beginning of this structure to the log path for the KTM - // instance to be used by this RM. This must be a two-byte (WCHAR) aligned - // value. This parameter is required. - // - - ULONG TmLogPathOffset; - - // - // Length in bytes of log path for the KTM instance to be used by this RM. - // This parameter is required. - // - - USHORT TmLogPathLength; - - // - // Logging mode for this RM. One of TXFS_LOGGING_MODE_SIMPLE or - // TXFS_LOGGING_MODE_FULL (mutually exclusive). This parameter is optional, - // and will default to TXFS_LOGGING_MODE_SIMPLE. - // - - USHORT LoggingMode; - - // - // Length in bytes of the path to the log to be used by the RM. This parameter - // is required. - // - - USHORT LogPathLength; - - // - // Reserved. - // - - USHORT Reserved; - - // - // The path to the log (in Unicode characters) to be used by the RM goes here. - // This parameter is required. - // - - WCHAR LogPath[1]; - -} TXFS_START_RM_INFORMATION, - *PTXFS_START_RM_INFORMATION; - -// -// Structures for FSCTL_TXFS_GET_METADATA_INFO -// - -typedef struct _TXFS_GET_METADATA_INFO_OUT { - - // - // Returns the TxfId of the file referenced by the handle used to call this routine. - // - - struct { - LONGLONG LowPart; - LONGLONG HighPart; - } TxfFileId; - - // - // The GUID of the transaction that has the file locked, if applicable. - // - - GUID LockingTransaction; - - // - // Returns the LSN for the most recent log record we've written for the file. - // - - ULONGLONG LastLsn; - - // - // Transaction state, a TXFS_TRANSACTION_STATE_* value. - // - - ULONG TransactionState; - -} TXFS_GET_METADATA_INFO_OUT, *PTXFS_GET_METADATA_INFO_OUT; - -// -// Structures for FSCTL_TXFS_LIST_TRANSACTION_LOCKED_FILES -// -// TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_CREATED means the reported name was created -// in the locking transaction. -// -// TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_DELETED means the reported name was deleted -// in the locking transaction. -// -// Note that both flags may appear if the name was both created and deleted in the same -// transaction. In that case the FileName[] member will contain only "\0", as there is -// no meaningful name to report. -// - -#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_CREATED 0x00000001 -#define TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_DELETED 0x00000002 - -typedef struct _TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY { - - // - // Offset in bytes from the beginning of the TXFS_LIST_TRANSACTION_LOCKED_FILES - // structure to the next TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY. - // - - ULONGLONG Offset; - - // - // TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY_FLAG_* flags to indicate whether the - // current name was deleted or created in the transaction. - // - - ULONG NameFlags; - - // - // NTFS File ID of the file. - // - - LONGLONG FileId; - - // - // Reserved. - // - - ULONG Reserved1; - ULONG Reserved2; - LONGLONG Reserved3; - - // - // NULL-terminated Unicode path to this file, relative to RM root. - // - - WCHAR FileName[1]; -} TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY, *PTXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY; - - -typedef struct _TXFS_LIST_TRANSACTION_LOCKED_FILES { - - // - // GUID name of the KTM transaction that files should be enumerated from. - // - - GUID KtmTransaction; - - // - // On output, the number of files involved in the transaction on this RM. - // - - ULONGLONG NumberOfFiles; - - // - // The length of the buffer required to obtain the complete list of files. - // This value may change from call to call as the transaction locks more files. - // - - ULONGLONG BufferSizeRequired; - - // - // Offset in bytes from the beginning of this structure to the first - // TXFS_LIST_TRANSACTION_LOCKED_FILES_ENTRY. - // - - ULONGLONG Offset; -} TXFS_LIST_TRANSACTION_LOCKED_FILES, *PTXFS_LIST_TRANSACTION_LOCKED_FILES; - -// -// Structures for FSCTL_TXFS_LIST_TRANSACTIONS -// - -typedef struct _TXFS_LIST_TRANSACTIONS_ENTRY { - - // - // Transaction GUID. - // - - GUID TransactionId; - - // - // Transaction state, a TXFS_TRANSACTION_STATE_* value. - // - - ULONG TransactionState; - - // - // Reserved fields - // - - ULONG Reserved1; - ULONG Reserved2; - LONGLONG Reserved3; -} TXFS_LIST_TRANSACTIONS_ENTRY, *PTXFS_LIST_TRANSACTIONS_ENTRY; - -typedef struct _TXFS_LIST_TRANSACTIONS { - - // - // On output, the number of transactions involved in this RM. - // - - ULONGLONG NumberOfTransactions; - - // - // The length of the buffer required to obtain the complete list of - // transactions. Note that this value may change from call to call - // as transactions enter and exit the system. - // - - ULONGLONG BufferSizeRequired; -} TXFS_LIST_TRANSACTIONS, *PTXFS_LIST_TRANSACTIONS; - - -// -// Structures for FSCTL_TXFS_READ_BACKUP_INFORMATION -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // unnamed struct - -typedef struct _TXFS_READ_BACKUP_INFORMATION_OUT { - union { - - // - // Used to return the required buffer size if return code is STATUS_BUFFER_OVERFLOW - // - - ULONG BufferLength; - - // - // On success the data is copied here. - // - - UCHAR Buffer[1]; - } DUMMYUNIONNAME; -} TXFS_READ_BACKUP_INFORMATION_OUT, *PTXFS_READ_BACKUP_INFORMATION_OUT; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning( default : 4201 ) -#endif - -// -// Structures for FSCTL_TXFS_WRITE_BACKUP_INFORMATION -// - -typedef struct _TXFS_WRITE_BACKUP_INFORMATION { - - // - // The data returned in the Buffer member of a previous call to - // FSCTL_TXFS_READ_BACKUP_INFORMATION goes here. - // - - UCHAR Buffer[1]; -} TXFS_WRITE_BACKUP_INFORMATION, *PTXFS_WRITE_BACKUP_INFORMATION; - -// -// Output structure for FSCTL_TXFS_GET_TRANSACTED_VERSION -// - -#define TXFS_TRANSACTED_VERSION_NONTRANSACTED 0xFFFFFFFE -#define TXFS_TRANSACTED_VERSION_UNCOMMITTED 0xFFFFFFFF - -typedef struct _TXFS_GET_TRANSACTED_VERSION { - - // - // The version that this handle is opened to. This will be - // TXFS_TRANSACTED_VERSION_UNCOMMITTED for nontransacted and - // transactional writer handles. - // - - ULONG ThisBaseVersion; - - // - // The most recent committed version available. - // - - ULONG LatestVersion; - - // - // If this is a handle to a miniversion, the ID of the miniversion. - // If it is not a handle to a minivers, this field will be 0. - // - - USHORT ThisMiniVersion; - - // - // The first available miniversion. Unless the miniversions are - // visible to the transaction bound to this handle, this field will be zero. - // - - USHORT FirstMiniVersion; - - // - // The latest available miniversion. Unless the miniversions are - // visible to the transaction bound to this handle, this field will be zero. - // - - USHORT LatestMiniVersion; - -} TXFS_GET_TRANSACTED_VERSION, *PTXFS_GET_TRANSACTED_VERSION; - -// -// Structures for FSCTL_TXFS_SAVEPOINT_INFORMATION -// -// Note that the TXFS_SAVEPOINT_INFORMATION structure is both and in and out structure. -// The KtmTransaction and ActionCode members are always in-parameters, and the SavepointId -// member is either an in-parameter, an out-parameter, or not used (see its definition below). -// - -// -// Create a new savepoint. -// - -#define TXFS_SAVEPOINT_SET 0x00000001 - -// -// Roll back to a specified savepoint. -// - -#define TXFS_SAVEPOINT_ROLLBACK 0x00000002 - -// -// Clear (make unavailable for rollback) the most recently set savepoint -// that has not yet been cleared. -// - -#define TXFS_SAVEPOINT_CLEAR 0x00000004 - -// -// Clear all savepoints from the transaction. -// - -#define TXFS_SAVEPOINT_CLEAR_ALL 0x00000010 - -typedef struct _TXFS_SAVEPOINT_INFORMATION { - - // - // Handle to the transaction on which to perform the savepoint operation. - // - - HANDLE KtmTransaction; - - // - // Specifies the savepoint action to take. A TXFS_SAVEPOINT_* value. - // - - ULONG ActionCode; - - // - // In-parameter for TXFS_ROLLBACK_TO_SAVEPOINT - specifies the savepoint to which - // to roll back. - // - // Out-parameter for TXFS_SET_SAVEPOINT - the newly-created savepoint ID will be - // returned here. - // - // Not used for TXFS_CLEAR_SAVEPOINT or TXFS_CLEAR_ALL_SAVEPOINTS. - // - - ULONG SavepointId; - -} TXFS_SAVEPOINT_INFORMATION, *PTXFS_SAVEPOINT_INFORMATION; - -// -// Structures for FSCTL_TXFS_CREATE_MINIVERSION -// -// Only an out parameter is necessary. That returns the identifier of the new miniversion created. -// - -typedef struct _TXFS_CREATE_MINIVERSION_INFO { - - USHORT StructureVersion; - - USHORT StructureLength; - - // - // The base version for the newly created miniversion. - // - - ULONG BaseVersion; - - // - // The miniversion that was just created. - // - - USHORT MiniVersion; - -} TXFS_CREATE_MINIVERSION_INFO, *PTXFS_CREATE_MINIVERSION_INFO; - -// -// Structure for FSCTL_TXFS_TRANSACTION_ACTIVE -// - -typedef struct _TXFS_TRANSACTION_ACTIVE_INFO { - - // - // Whether or not the volume had active transactions when this snapshot was taken. - // - - BOOLEAN TransactionsActiveAtSnapshot; - -} TXFS_TRANSACTION_ACTIVE_INFO, *PTXFS_TRANSACTION_ACTIVE_INFO; - -#endif /* _WIN32_WINNT >= 0x0600 */ - -#if (_WIN32_WINNT >= 0x0601) -// -// Output structure for FSCTL_GET_BOOT_AREA_INFO -// - -typedef struct _BOOT_AREA_INFO { - - ULONG BootSectorCount; // the count of boot sectors present on the file system - struct { - LARGE_INTEGER Offset; - } BootSectors[2]; // variable number of boot sectors. - -} BOOT_AREA_INFO, *PBOOT_AREA_INFO; - -// -// Output structure for FSCTL_GET_RETRIEVAL_POINTER_BASE -// - -typedef struct _RETRIEVAL_POINTER_BASE { - - LARGE_INTEGER FileAreaOffset; // sector offset to the first allocatable unit on the filesystem -} RETRIEVAL_POINTER_BASE, *PRETRIEVAL_POINTER_BASE; - -// -// Structure for FSCTL_SET_PERSISTENT_VOLUME_STATE and FSCTL_GET_PERSISTENT_VOLUME_STATE -// The initial version will be 1.0 -// - -typedef struct _FILE_FS_PERSISTENT_VOLUME_INFORMATION { - - ULONG VolumeFlags; - ULONG FlagMask; - ULONG Version; - ULONG Reserved; - -} FILE_FS_PERSISTENT_VOLUME_INFORMATION, *PFILE_FS_PERSISTENT_VOLUME_INFORMATION; - -// -// Structure for FSCTL_QUERY_FILE_SYSTEM_RECOGNITION -// - -typedef struct _FILE_SYSTEM_RECOGNITION_INFORMATION { - - CHAR FileSystem[9]; - -} FILE_SYSTEM_RECOGNITION_INFORMATION, *PFILE_SYSTEM_RECOGNITION_INFORMATION; - -// -// Structures for FSCTL_REQUEST_OPLOCK -// - -#define OPLOCK_LEVEL_CACHE_READ (0x00000001) -#define OPLOCK_LEVEL_CACHE_HANDLE (0x00000002) -#define OPLOCK_LEVEL_CACHE_WRITE (0x00000004) - -#define REQUEST_OPLOCK_INPUT_FLAG_REQUEST (0x00000001) -#define REQUEST_OPLOCK_INPUT_FLAG_ACK (0x00000002) -#define REQUEST_OPLOCK_INPUT_FLAG_COMPLETE_ACK_ON_CLOSE (0x00000004) - -#define REQUEST_OPLOCK_CURRENT_VERSION 1 - -typedef struct _REQUEST_OPLOCK_INPUT_BUFFER { - - // - // This should be set to REQUEST_OPLOCK_CURRENT_VERSION. - // - - USHORT StructureVersion; - - USHORT StructureLength; - - // - // One or more OPLOCK_LEVEL_CACHE_* values to indicate the desired level of the oplock. - // - - ULONG RequestedOplockLevel; - - // - // REQUEST_OPLOCK_INPUT_FLAG_* flags. - // - - ULONG Flags; - -} REQUEST_OPLOCK_INPUT_BUFFER, *PREQUEST_OPLOCK_INPUT_BUFFER; - -#define REQUEST_OPLOCK_OUTPUT_FLAG_ACK_REQUIRED (0x00000001) -#define REQUEST_OPLOCK_OUTPUT_FLAG_MODES_PROVIDED (0x00000002) - -typedef struct _REQUEST_OPLOCK_OUTPUT_BUFFER { - - // - // This should be set to REQUEST_OPLOCK_CURRENT_VERSION. - // - - USHORT StructureVersion; - - USHORT StructureLength; - - // - // One or more OPLOCK_LEVEL_CACHE_* values indicating the level of the oplock that - // was just broken. - // - - ULONG OriginalOplockLevel; - - // - // One or more OPLOCK_LEVEL_CACHE_* values indicating the level to which an oplock - // is being broken, or an oplock level that may be available for granting, depending - // on the operation returning this buffer. - // - - ULONG NewOplockLevel; - - // - // REQUEST_OPLOCK_OUTPUT_FLAG_* flags. - // - - ULONG Flags; - - // - // When REQUEST_OPLOCK_OUTPUT_FLAG_MODES_PROVIDED is set, and when the - // OPLOCK_LEVEL_CACHE_HANDLE level is being lost in an oplock break, these fields - // contain the access mode and share mode of the request that is causing the break. - // - - ACCESS_MASK AccessMode; - - USHORT ShareMode; - -} REQUEST_OPLOCK_OUTPUT_BUFFER, *PREQUEST_OPLOCK_OUTPUT_BUFFER; - -// -// Structures for FSCTL_SD_GLOBAL_CHANGE -// - -// -// list of operations supported -// - -#define SD_GLOBAL_CHANGE_TYPE_MACHINE_SID 1 - - -// -// Operation specific structures for SD_GLOBAL_CHANGE_TYPE_MACHINE_SID -// -// This con -// - -typedef struct _SD_CHANGE_MACHINE_SID_INPUT { - - // - // The current machine SID to change. - // This define the offset from the beginning of the SD_GLOBAL_CHANGE_INPUT - // structure of where the CurrentMachineSID to replace begins. This will - // be a SID structure. The length defines the length of the imbedded SID - // structure. - // - - USHORT CurrentMachineSIDOffset; - USHORT CurrentMachineSIDLength; - - // - // The new machine SID value to set inplace of the current machine SID - // This define the offset from the beginning of the SD_GLOBAL_CHANGE_INPUT - // structure of where the NewMachineSID to set begins. This will - // be a SID structure. The length defines the length of the imbedded SID - // structure. - // - - USHORT NewMachineSIDOffset; - USHORT NewMachineSIDLength; - -} SD_CHANGE_MACHINE_SID_INPUT, *PSD_CHANGE_MACHINE_SID_INPUT; - -typedef struct _SD_CHANGE_MACHINE_SID_OUTPUT { - - // - // How many entries were successfully changed in the $Secure stream - // - - ULONGLONG NumSDChangedSuccess; - - // - // How many entires failed the update in the $Secure stream - // - - ULONGLONG NumSDChangedFail; - - // - // How many entires are unused in the current security stream - // - - ULONGLONG NumSDUnused; - - // - // The total number of entries processed in the $Secure stream - // - - ULONGLONG NumSDTotal; - - // - // How many entries were successfully changed in the $MFT file - // - - ULONGLONG NumMftSDChangedSuccess; - - // - // How many entries failed the update in the $MFT file - // - - ULONGLONG NumMftSDChangedFail; - - // - // Total number of entriess process in the $MFT file - // - - ULONGLONG NumMftSDTotal; - -} SD_CHANGE_MACHINE_SID_OUTPUT, *PSD_CHANGE_MACHINE_SID_OUTPUT; - -// -// Generic INPUT & OUTPUT structures for FSCTL_SD_GLOBAL_CHANGE -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // unnamed struct - -typedef struct _SD_GLOBAL_CHANGE_INPUT -{ - // - // Input flags (none currently defined) - // - - ULONG Flags; - - // - // Specifies which type of change we are doing and pics which member - // of the below union is in use. - // - - ULONG ChangeType; - - union { - - SD_CHANGE_MACHINE_SID_INPUT SdChange; - }; - -} SD_GLOBAL_CHANGE_INPUT, *PSD_GLOBAL_CHANGE_INPUT; - -typedef struct _SD_GLOBAL_CHANGE_OUTPUT -{ - - // - // Output State Flags (none currently defined) - // - - ULONG Flags; - - // - // Specifies which below union to use - // - - ULONG ChangeType; - - union { - - SD_CHANGE_MACHINE_SID_OUTPUT SdChange; - }; - -} SD_GLOBAL_CHANGE_OUTPUT, *PSD_GLOBAL_CHANGE_OUTPUT; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning( default : 4201 ) /* nonstandard extension used : nameless struct/union */ -#endif - -// -// Flag to indicate the encrypted file is sparse -// - -#define ENCRYPTED_DATA_INFO_SPARSE_FILE 1 - -typedef struct _EXTENDED_ENCRYPTED_DATA_INFO { - - // - // This is really a 4 byte character array which - // must have the value "EXTD". We use this - // to determine if we should read the extended data - // or not. - // - - ULONG ExtendedCode; - - // - // The length of the extended data structure - // - - ULONG Length; - - // - // Encrypted data flags (currently only sparse is defined) - // - - ULONG Flags; - ULONG Reserved; - -} EXTENDED_ENCRYPTED_DATA_INFO, *PEXTENDED_ENCRYPTED_DATA_INFO; - - -typedef struct _LOOKUP_STREAM_FROM_CLUSTER_INPUT { - - // - // Flags for the operation. Currently no flags are defined. - // - ULONG Flags; - - // - // Number of clusters in the following array of clusters. - // The input buffer must be large enough to contain this - // number or the operation will fail. - // - ULONG NumberOfClusters; - - // - // An array of one or more clusters to look up. - // - LARGE_INTEGER Cluster[1]; -} LOOKUP_STREAM_FROM_CLUSTER_INPUT, *PLOOKUP_STREAM_FROM_CLUSTER_INPUT; - -typedef struct _LOOKUP_STREAM_FROM_CLUSTER_OUTPUT { - // - // Offset from the beginning of this structure to the first entry - // returned. If no entries are returned, this value is zero. - // - ULONG Offset; - - // - // Number of matches to the input criteria. Note that more matches - // may be found than entries returned if the buffer is not large - // enough. - // - ULONG NumberOfMatches; - - // - // Minimum size of the buffer, in bytes, which would be needed to - // contain all matching entries to the input criteria. - // - ULONG BufferSizeRequired; -} LOOKUP_STREAM_FROM_CLUSTER_OUTPUT, *PLOOKUP_STREAM_FROM_CLUSTER_OUTPUT; - -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_PAGE_FILE 0x00000001 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_DENY_DEFRAG_SET 0x00000002 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_FS_SYSTEM_FILE 0x00000004 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_FLAG_TXF_SYSTEM_FILE 0x00000008 - -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_MASK 0xff000000 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_DATA 0x01000000 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_INDEX 0x02000000 -#define LOOKUP_STREAM_FROM_CLUSTER_ENTRY_ATTRIBUTE_SYSTEM 0x03000000 - -typedef struct _LOOKUP_STREAM_FROM_CLUSTER_ENTRY { - // - // Offset from the beginning of this structure to the next entry - // returned. If there are no more entries, this value is zero. - // - ULONG OffsetToNext; - - // - // Flags describing characteristics about this stream. - // - ULONG Flags; - - // - // This value is reserved and is currently zero. - // - LARGE_INTEGER Reserved; - - // - // This is the cluster that this entry refers to. It will be one - // of the clusters passed in the input structure. - // - LARGE_INTEGER Cluster; - - // - // A NULL-terminated Unicode string containing the path of the - // object relative to the root of the volume. This string - // will refer to the attribute or stream represented by the - // cluster. - // - WCHAR FileName[1]; -} LOOKUP_STREAM_FROM_CLUSTER_ENTRY, *PLOOKUP_STREAM_FROM_CLUSTER_ENTRY; - -// -// This is the structure for the FSCTL_FILE_TYPE_NOTIFICATION operation. -// Its purpose is to notify the storage stack about the extents of certain -// types of files. This is only callable from kernel mode -// - -typedef struct _FILE_TYPE_NOTIFICATION_INPUT { - - // - // Flags for this operation - // FILE_TYPE_NOTIFICATION_FLAG_* - // - - ULONG Flags; - - // - // A count of how many FileTypeID guids are given - // - - ULONG NumFileTypeIDs; - - // - // This is a unique identifer for the type of file notification occuring - // - - GUID FileTypeID[1]; - -} FILE_TYPE_NOTIFICATION_INPUT, *PFILE_TYPE_NOTIFICATION_INPUT; - -// -// Flags for the given operation -// - -#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_BEGIN 0x00000001 //Set when adding the specified usage on the given file -#define FILE_TYPE_NOTIFICATION_FLAG_USAGE_END 0x00000002 //Set when removing the specified usage on the given file - -// -// These are the globally defined file types -// - -DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_PAGE_FILE, 0x0d0a64a1, 0x38fc, 0x4db8, 0x9f, 0xe7, 0x3f, 0x43, 0x52, 0xcd, 0x7c, 0x5c ); -DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_HIBERNATION_FILE, 0xb7624d64, 0xb9a3, 0x4cf8, 0x80, 0x11, 0x5b, 0x86, 0xc9, 0x40, 0xe7, 0xb7 ); -DEFINE_GUID( FILE_TYPE_NOTIFICATION_GUID_CRASHDUMP_FILE, 0x9d453eb7, 0xd2a6, 0x4dbd, 0xa2, 0xe3, 0xfb, 0xd0, 0xed, 0x91, 0x09, 0xa9 ); -#endif /* _WIN32_WINNT >= 0x0601 */ - -#endif // _FILESYSTEMFSCTL_ - -// end_winioctl - -// -// Structures for FSCTL_SET_REPARSE_POINT, FSCTL_GET_REPARSE_POINT, and FSCTL_DELETE_REPARSE_POINT -// - -// -// The reparse structure is used by layered drivers to store data in a -// reparse point. The constraints on reparse tags are defined below. -// This version of the reparse data buffer is only for Microsoft tags. -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // unnamed struct - -#define SYMLINK_FLAG_RELATIVE 1 - -typedef struct _REPARSE_DATA_BUFFER { - ULONG ReparseTag; - USHORT ReparseDataLength; - USHORT Reserved; - union { - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - ULONG Flags; - WCHAR PathBuffer[1]; - } SymbolicLinkReparseBuffer; - struct { - USHORT SubstituteNameOffset; - USHORT SubstituteNameLength; - USHORT PrintNameOffset; - USHORT PrintNameLength; - WCHAR PathBuffer[1]; - } MountPointReparseBuffer; - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; - } DUMMYUNIONNAME; -} REPARSE_DATA_BUFFER, *PREPARSE_DATA_BUFFER; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning( default : 4201 ) -#endif - -#define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER, GenericReparseBuffer) - - -// begin_winnt -// -// The reparse GUID structure is used by all 3rd party layered drivers to -// store data in a reparse point. For non-Microsoft tags, The GUID field -// cannot be GUID_NULL. -// The constraints on reparse tags are defined below. -// Microsoft tags can also be used with this format of the reparse point buffer. -// - -typedef struct _REPARSE_GUID_DATA_BUFFER { - ULONG ReparseTag; - USHORT ReparseDataLength; - USHORT Reserved; - GUID ReparseGuid; - struct { - UCHAR DataBuffer[1]; - } GenericReparseBuffer; -} REPARSE_GUID_DATA_BUFFER, *PREPARSE_GUID_DATA_BUFFER; - -#define REPARSE_GUID_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_GUID_DATA_BUFFER, GenericReparseBuffer) - - - -// -// Maximum allowed size of the reparse data. -// - -#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 ) - -// -// Predefined reparse tags. -// These tags need to avoid conflicting with IO_REMOUNT defined in ntos\inc\io.h -// - -#define IO_REPARSE_TAG_RESERVED_ZERO (0) -#define IO_REPARSE_TAG_RESERVED_ONE (1) - -// -// The value of the following constant needs to satisfy the following conditions: -// (1) Be at least as large as the largest of the reserved tags. -// (2) Be strictly smaller than all the tags in use. -// - -#define IO_REPARSE_TAG_RESERVED_RANGE IO_REPARSE_TAG_RESERVED_ONE - -// -// The reparse tags are a ULONG. The 32 bits are laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +-+-+-+-+-----------------------+-------------------------------+ -// |M|R|N|R| Reserved bits | Reparse Tag Value | -// +-+-+-+-+-----------------------+-------------------------------+ -// -// M is the Microsoft bit. When set to 1, it denotes a tag owned by Microsoft. -// All ISVs must use a tag with a 0 in this position. -// Note: If a Microsoft tag is used by non-Microsoft software, the -// behavior is not defined. -// -// R is reserved. Must be zero for non-Microsoft tags. -// -// N is name surrogate. When set to 1, the file represents another named -// entity in the system. -// -// The M and N bits are OR-able. -// The following macros check for the M and N bit values: -// - -// -// Macro to determine whether a reparse point tag corresponds to a tag -// owned by Microsoft. -// - -#define IsReparseTagMicrosoft(_tag) ( \ - ((_tag) & 0x80000000) \ - ) - -// -// Macro to determine whether a reparse point tag is a name surrogate -// - -#define IsReparseTagNameSurrogate(_tag) ( \ - ((_tag) & 0x20000000) \ - ) - -// end_winnt - -// -// The following constant represents the bits that are valid to use in -// reparse tags. -// - -#define IO_REPARSE_TAG_VALID_VALUES (0xF000FFFF) - -// -// Macro to determine whether a reparse tag is a valid tag. -// - -#define IsReparseTagValid(_tag) ( \ - !((_tag) & ~IO_REPARSE_TAG_VALID_VALUES) && \ - ((_tag) > IO_REPARSE_TAG_RESERVED_RANGE) \ - ) - -/////////////////////////////////////////////////////////////////////////////// -// -// Microsoft tags for reparse points. -// -/////////////////////////////////////////////////////////////////////////////// - -#define IO_REPARSE_TAG_MOUNT_POINT (0xA0000003L) // winnt -#define IO_REPARSE_TAG_HSM (0xC0000004L) // winnt -#define IO_REPARSE_TAG_DRIVE_EXTENDER (0x80000005L) -#define IO_REPARSE_TAG_HSM2 (0x80000006L) // winnt -#define IO_REPARSE_TAG_SIS (0x80000007L) // winnt -#define IO_REPARSE_TAG_WIM (0x80000008L) // winnt -#define IO_REPARSE_TAG_CSV (0x80000009L) // winnt -#define IO_REPARSE_TAG_DFS (0x8000000AL) // winnt -#define IO_REPARSE_TAG_FILTER_MANAGER (0x8000000BL) -#define IO_REPARSE_TAG_SYMLINK (0xA000000CL) // winnt -#define IO_REPARSE_TAG_IIS_CACHE (0xA0000010L) -#define IO_REPARSE_TAG_DFSR (0x80000012L) // winnt - - - -/////////////////////////////////////////////////////////////////////////////// -// -// Non-Microsoft tags for reparse points -// -/////////////////////////////////////////////////////////////////////////////// - -// -// Tag allocated to CONGRUENT, May 2000. Used by IFSTEST -// - -#define IO_REPARSE_TAG_IFSTEST_CONGRUENT (0x00000009L) - -// -// Tag allocated to Moonwalk Univeral for HSM -// GUID: 257ABE42-5A28-4C8C-AC46-8FEA5619F18F -// - -#define IO_REPARSE_TAG_MOONWALK_HSM (0x0000000AL) - -// -// Tag allocated to Tsinghua Univeristy for Research purposes -// No released products should use this tag -// GUID: b86dff51-a31e-4bac-b3cf-e8cfe75c9fc2 -// - -#define IO_REPARSE_TAG_TSINGHUA_UNIVERSITY_RESEARCH (0x0000000BL) - -// -// Tag allocated to ARKIVIO for HSM -// - -#define IO_REPARSE_TAG_ARKIVIO (0x0000000CL) - -// -// Tag allocated to SOLUTIONSOFT for name surrogate -// - -#define IO_REPARSE_TAG_SOLUTIONSOFT (0x2000000DL) - -// -// Tag allocated to COMMVAULT for HSM -// - -#define IO_REPARSE_TAG_COMMVAULT (0x0000000EL) - -// -// Tag allocated to Overtone Software for HSM -// - -#define IO_REPARSE_TAG_OVERTONE (0x0000000FL) - -// -// Tag allocated to Symantec (formerly to KVS Inc) for HSM -// GUID: A49F7BF6-77CA-493c-A0AA-18DBB28D1098 -// - -#define IO_REPARSE_TAG_SYMANTEC_HSM2 (0x00000010L) - -// -// Tag allocated to Enigma Data for HSM -// - -#define IO_REPARSE_TAG_ENIGMA_HSM (0x00000011L) - -// -// Tag allocated to Symantec for HSM -// GUID: B99F4235-CF1C-48dd-9E6C-459FA289F8C7 -// - -#define IO_REPARSE_TAG_SYMANTEC_HSM (0x00000012L) - -// -// Tag allocated to INTERCOPE for HSM -// GUID: F204BE2D-AEEB-4728-A31C-C7F4E9BEA758} -// - -#define IO_REPARSE_TAG_INTERCOPE_HSM (0x00000013L) - -// -// Tag allocated to KOM Networks for HSM -// - -#define IO_REPARSE_TAG_KOM_NETWORKS_HSM (0x00000014L) - -// -// Tag allocated to MEMORY_TECH for HSM -// GUID: E51BA456-046C-43ea-AEC7-DC1A87E1FD49 -// - -#define IO_REPARSE_TAG_MEMORY_TECH_HSM (0x00000015L) - -// -// Tag allocated to BridgeHead Software for HSM -// GUID: EBAFF6E3-F21D-4496-8342-58144B3D2BD0 -// - -#define IO_REPARSE_TAG_BRIDGEHEAD_HSM (0x00000016L) - -// -// Tag allocated to OSR for samples reparse point filter -// GUID: 3740c860-b19b-11d9-9669-0800200c9a66 -// - -#define IO_REPARSE_TAG_OSR_SAMPLE (0x20000017L) - -// -// Tag allocated to Global 360 for HSM -// GUID: C4B51F66-7F00-4c55-9441-8A1B159F209B -// - -#define IO_REPARSE_TAG_GLOBAL360_HSM (0x00000018L) - -// -// Tag allocated to Altiris for HSM -// GUID: fc1047eb-fb2d-45f2-a2f4-a71c1032fa2dB -// - -#define IO_REPARSE_TAG_ALTIRIS_HSM (0x00000019L) - -// -// Tag allocated to Hermes for HSM -// GUID: 437E0FD5-FCB4-42fe-877A-C785DA662AC2 -// - -#define IO_REPARSE_TAG_HERMES_HSM (0x0000001AL) - -// -// Tag allocated to PointSoft for HSM -// GUID: 547BC7FD-9604-4deb-AE07-B6514DF5FBC6 -// - -#define IO_REPARSE_TAG_POINTSOFT_HSM (0x0000001BL) - -// -// Tag allocated to GRAU Data Storage for HSM -// GUID: 6662D310-5653-4D10-8C31-F8E166D1A1BD -// - -#define IO_REPARSE_TAG_GRAU_DATASTORAGE_HSM (0x0000001CL) - -// -// Tag allocated to CommVault for HSM -// GUID: cc38adf3-c583-4efa-b183-72c1671941de -// - -#define IO_REPARSE_TAG_COMMVAULT_HSM (0x0000001DL) - - -// -// Tag allocated to Data Storage Group for single instance storage -// GUID: C1182673-0562-447a-8E40-4F0549FDF817 -// - -#define IO_REPARSE_TAG_DATASTOR_SIS (0x0000001EL) - - -// -// Tag allocated to Enterprise Data Solutions, Inc. for HSM -// GUID: EB63DF9D-8874-41cd-999A-A197542CDAFC -// - -#define IO_REPARSE_TAG_EDSI_HSM (0x0000001FL) - - -// -// Tag allocated to HP StorageWorks Reference Information Manager for Files (HSM) -// GUID: 3B0F6B23-0C2E-4281-9C19-C6AEEBC88CD8 -// - -#define IO_REPARSE_TAG_HP_HSM (0x00000020L) - - -// -// Tag allocated to SER Beteiligung Solutions Deutschland GmbH (HSM) -// GUID: 55B673F0-978E-41c5-9ADB-AF99640BE90E -// - -#define IO_REPARSE_TAG_SER_HSM (0x00000021L) - - -// -// Tag allocated to Double-Take Software (formerly NSI Software, Inc.) for HSM -// GUID: f7cb0ce8-453a-4ae1-9c56-db41b55f6ed4 -// - -#define IO_REPARSE_TAG_DOUBLE_TAKE_HSM (0x00000022L) - - -// -// Tag allocated to Beijing Wisdata Systems CO, LTD for HSM -// GUID: d546500a-2aeb-45f6-9482-f4b1799c3177 -// - -#define IO_REPARSE_TAG_WISDATA_HSM (0x00000023L) - - -// -// Tag allocated to Mimosa Systems Inc for HSM -// GUID: 8ddd4144-1a22-404b-8a5a-fcd91c6ee9f3 -// - -#define IO_REPARSE_TAG_MIMOSA_HSM (0x00000024L) - - -// -// Tag allocated to H&S Heilig und Schubert Software AG for HSM -// GUID: 77CA30C0-E5EC-43df-9E44-A4910378E284 -// - -#define IO_REPARSE_TAG_HSAG_HSM (0x00000025L) - - -// -// Tag allocated to Atempo Inc. (Atempo Digital Archive) for HSM -// GUID: 9B64518A-D6A4-495f-8D01-392F38862F0C -// - -#define IO_REPARSE_TAG_ADA_HSM (0x00000026L) - - -// -// Tag allocated to Autonomy Corporation for HSM -// GUID: EB112A57-10FC-4b42-B590-A61897FDC432 -// - -#define IO_REPARSE_TAG_AUTN_HSM (0x00000027L) - - -// -// Tag allocated to Nexsan for HSM -// GUID: d35eba9a-e722-445d-865f-dde1120acf16 -// - -#define IO_REPARSE_TAG_NEXSAN_HSM (0x00000028L) - - -// -// Tag allocated to Double-Take for SIS -// GUID: BDA506C2-F74D-4495-9A8D-44FD8D5B4F42 -// - -#define IO_REPARSE_TAG_DOUBLE_TAKE_SIS (0x00000029L) - - -// -// Tag allocated to Sony for HSM -// GUID: E95032E4-FD81-4e15-A8E2-A1F078061C4E -// - -#define IO_REPARSE_TAG_SONY_HSM (0x0000002AL) - - -// -// Tag allocated to Eltan Comm for HSM -// GUID: E1596D9F-44D8-43f4-A2D6-E9FE8D3E28FB -// - -#define IO_REPARSE_TAG_ELTAN_HSM (0x0000002BL) - - -// -// Tag allocated to Utixo LLC for HSM -// GUID: 5401F960-2F95-46D0-BBA6-052929FE2C32 -// - -#define IO_REPARSE_TAG_UTIXO_HSM (0x0000002CL) - - -// -// Tag allocated to Quest Software for HSM -// GUID: D546500A-2AEB-45F6-9482-F4B1799C3177 -// - -#define IO_REPARSE_TAG_QUEST_HSM (0x0000002DL) - - -// -// Tag allocated to DataGlobal GmbH for HSM -// GUID: 7A09CA83-B7B1-4614-ADFD-0BD5F4F989C9 -// - -#define IO_REPARSE_TAG_DATAGLOBAL_HSM (0x0000002EL) - - -// -// Tag allocated to Qi Tech LLC for HSM -// GUID: C8110B39-A4CE-432E-B58A-FBEAD296DF03 -// - -#define IO_REPARSE_TAG_QI_TECH_HSM (0x2000002FL) - -// -// Tag allocated to DataFirst Corporation for HSM -// GUID: E0E40591-6434-479f-94AC-DECF6DAEFB5C -// - -#define IO_REPARSE_TAG_DATAFIRST_HSM (0x00000030L) - -// -// Tag allocated to C2C Systems for HSM -// GUID: 6F2F829C-36AE-4E88-A3B6-E2C24377EA1C -// - -#define IO_REPARSE_TAG_C2CSYSTEMS_HSM (0x00000031L) - - -// -// Reparse point index keys. -// -// The index with all the reparse points that exist in a volume at a -// given time contains entries with keys of the form -// . -// The data part of these records is empty. -// - -#pragma pack(4) - -typedef struct _REPARSE_INDEX_KEY { - - // - // The tag of the reparse point. - // - - ULONG FileReparseTag; - - // - // The file record Id where the reparse point is set. - // - - LARGE_INTEGER FileId; - -} REPARSE_INDEX_KEY, *PREPARSE_INDEX_KEY; - -#pragma pack() - - - -// -// The following three FSCTLs are placed in this file to facilitate sharing -// between the redirector and the IO subsystem -// -// This FSCTL is used to garner the link tracking information for a file. -// The data structures used for retreving the information are -// LINK_TRACKING_INFORMATION defined further down in this file. -// - -#define FSCTL_LMR_GET_LINK_TRACKING_INFORMATION CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,58,METHOD_BUFFERED,FILE_ANY_ACCESS) - -// -// This FSCTL is used to update the link tracking information on a server for -// an intra machine/ inter volume move on that server -// - -#define FSCTL_LMR_SET_LINK_TRACKING_INFORMATION CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,59,METHOD_BUFFERED,FILE_ANY_ACCESS) - -// -// The following IOCTL is used in link tracking implementation. It determines if the -// two file objects passed in are on the same server. This IOCTL is available in -// kernel mode only since it accepts FILE_OBJECT as parameters -// - -#define IOCTL_LMR_ARE_FILE_OBJECTS_ON_SAME_SERVER CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM,60,METHOD_BUFFERED,FILE_ANY_ACCESS) - - - -// -// Named Pipe file control code and structure declarations -// - -// -// External named pipe file control operations -// - -#define FSCTL_PIPE_ASSIGN_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_DISCONNECT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 1, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_LISTEN CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_PEEK CTL_CODE(FILE_DEVICE_NAMED_PIPE, 3, METHOD_BUFFERED, FILE_READ_DATA) -#define FSCTL_PIPE_QUERY_EVENT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 4, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 5, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) -#define FSCTL_PIPE_WAIT CTL_CODE(FILE_DEVICE_NAMED_PIPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_IMPERSONATE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 7, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_SET_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 8, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_QUERY_CLIENT_PROCESS CTL_CODE(FILE_DEVICE_NAMED_PIPE, 9, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_GET_PIPE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 10, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_SET_PIPE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_GET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_SET_CONNECTION_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_GET_HANDLE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_SET_HANDLE_ATTRIBUTE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define FSCTL_PIPE_FLUSH CTL_CODE(FILE_DEVICE_NAMED_PIPE, 16, METHOD_BUFFERED, FILE_WRITE_DATA) - -// -// Internal named pipe file control operations -// - -#define FSCTL_PIPE_INTERNAL_READ CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2045, METHOD_BUFFERED, FILE_READ_DATA) -#define FSCTL_PIPE_INTERNAL_WRITE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2046, METHOD_BUFFERED, FILE_WRITE_DATA) -#define FSCTL_PIPE_INTERNAL_TRANSCEIVE CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2047, METHOD_NEITHER, FILE_READ_DATA | FILE_WRITE_DATA) -#define FSCTL_PIPE_INTERNAL_READ_OVFLOW CTL_CODE(FILE_DEVICE_NAMED_PIPE, 2048, METHOD_BUFFERED, FILE_READ_DATA) - -// -// Define entry types for query event information -// - -#define FILE_PIPE_READ_DATA 0x00000000 -#define FILE_PIPE_WRITE_SPACE 0x00000001 - -// -// Named pipe file system control structure declarations -// - -// Control structure for FSCTL_PIPE_ASSIGN_EVENT - -typedef struct _FILE_PIPE_ASSIGN_EVENT_BUFFER { - HANDLE EventHandle; - ULONG KeyValue; -} FILE_PIPE_ASSIGN_EVENT_BUFFER, *PFILE_PIPE_ASSIGN_EVENT_BUFFER; - -// Control structure for FSCTL_PIPE_PEEK - -typedef struct _FILE_PIPE_PEEK_BUFFER { - ULONG NamedPipeState; - ULONG ReadDataAvailable; - ULONG NumberOfMessages; - ULONG MessageLength; - CHAR Data[1]; -} FILE_PIPE_PEEK_BUFFER, *PFILE_PIPE_PEEK_BUFFER; - -// Control structure for FSCTL_PIPE_QUERY_EVENT - -typedef struct _FILE_PIPE_EVENT_BUFFER { - ULONG NamedPipeState; - ULONG EntryType; - ULONG ByteCount; - ULONG KeyValue; - ULONG NumberRequests; -} FILE_PIPE_EVENT_BUFFER, *PFILE_PIPE_EVENT_BUFFER; - -// Control structure for FSCTL_PIPE_WAIT - -typedef struct _FILE_PIPE_WAIT_FOR_BUFFER { - LARGE_INTEGER Timeout; - ULONG NameLength; - BOOLEAN TimeoutSpecified; - WCHAR Name[1]; -} FILE_PIPE_WAIT_FOR_BUFFER, *PFILE_PIPE_WAIT_FOR_BUFFER; - -// Control structure for FSCTL_PIPE_SET_CLIENT_PROCESS and FSCTL_PIPE_QUERY_CLIENT_PROCESS - -typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER { -#if !defined(BUILD_WOW6432) - PVOID ClientSession; - PVOID ClientProcess; -#else - ULONGLONG ClientSession; - ULONGLONG ClientProcess; -#endif -} FILE_PIPE_CLIENT_PROCESS_BUFFER, *PFILE_PIPE_CLIENT_PROCESS_BUFFER; - -// This is an extension to the client process info buffer containing the client -// computer name - -#define FILE_PIPE_COMPUTER_NAME_LENGTH 15 - -typedef struct _FILE_PIPE_CLIENT_PROCESS_BUFFER_EX { -#if !defined(BUILD_WOW6432) - PVOID ClientSession; - PVOID ClientProcess; -#else - ULONGLONG ClientSession; - ULONGLONG ClientProcess; -#endif - USHORT ClientComputerNameLength; // in bytes - WCHAR ClientComputerBuffer[FILE_PIPE_COMPUTER_NAME_LENGTH+1]; // terminated -} FILE_PIPE_CLIENT_PROCESS_BUFFER_EX, *PFILE_PIPE_CLIENT_PROCESS_BUFFER_EX; - -// -// Mailslot file control operations. -// - -#define FSCTL_MAILSLOT_PEEK CTL_CODE(FILE_DEVICE_MAILSLOT, 0, METHOD_NEITHER, FILE_READ_DATA) // ntifs - -// -// Control structure for FSCTL_LMR_GET_LINK_TRACKING_INFORMATION -// - -// -// For links on DFS volumes the volume id and machine id are returned for -// link tracking -// - -typedef enum _LINK_TRACKING_INFORMATION_TYPE { - NtfsLinkTrackingInformation, - DfsLinkTrackingInformation -} LINK_TRACKING_INFORMATION_TYPE, *PLINK_TRACKING_INFORMATION_TYPE; - -typedef struct _LINK_TRACKING_INFORMATION { - LINK_TRACKING_INFORMATION_TYPE Type; - UCHAR VolumeId[16]; -} LINK_TRACKING_INFORMATION, *PLINK_TRACKING_INFORMATION; - -// -// Control structure for FSCTL_LMR_SET_LINK_TRACKING_INFORMATION -// - -typedef struct _REMOTE_LINK_TRACKING_INFORMATION_ { - PVOID TargetFileObject; - ULONG TargetLinkTrackingInformationLength; - UCHAR TargetLinkTrackingInformationBuffer[1]; -} REMOTE_LINK_TRACKING_INFORMATION, - *PREMOTE_LINK_TRACKING_INFORMATION; - - -#if (_WIN32_WINNT >= 0x0601) - -#pragma warning(push) -#pragma warning(disable : 4200) -#pragma warning(disable : 4201) - -#ifndef _VIRTUAL_STORAGE_TYPE_DEFINED -#define _VIRTUAL_STORAGE_TYPE_DEFINED -typedef struct _VIRTUAL_STORAGE_TYPE -{ - ULONG DeviceId; - GUID VendorId; -} VIRTUAL_STORAGE_TYPE, *PVIRTUAL_STORAGE_TYPE; -#endif - -// -// These structures are used by the FSCTL_QUERY_DEPENDENT_VOLUME -// - -typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST { - ULONG RequestLevel; - ULONG RequestFlags; -} STORAGE_QUERY_DEPENDENT_VOLUME_REQUEST, *PSTORAGE_QUERY_DEPENDENT_VOLUME_REQUEST; - -#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_HOST_VOLUMES 0x1 -#define QUERY_DEPENDENT_VOLUME_REQUEST_FLAG_GUEST_VOLUMES 0x2 - -typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY { - ULONG EntryLength; - ULONG DependencyTypeFlags; - ULONG ProviderSpecificFlags; - VIRTUAL_STORAGE_TYPE VirtualStorageType; -} STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY, *PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY; - -typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY { - ULONG EntryLength; - ULONG DependencyTypeFlags; - ULONG ProviderSpecificFlags; - VIRTUAL_STORAGE_TYPE VirtualStorageType; - ULONG AncestorLevel; // Root parent is 0, every child level after that is incremented - ULONG HostVolumeNameOffset; - ULONG HostVolumeNameSize; - ULONG DependentVolumeNameOffset; - ULONG DependentVolumeNameSize; - ULONG RelativePathOffset; - ULONG RelativePathSize; - ULONG DependentDeviceNameOffset; - ULONG DependentDeviceNameSize; -} STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY, *PSTORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY; - -typedef struct _STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE { - ULONG ResponseLevel; - ULONG NumberEntries; - union { - STORAGE_QUERY_DEPENDENT_VOLUME_LEV1_ENTRY Lev1Depends[]; - STORAGE_QUERY_DEPENDENT_VOLUME_LEV2_ENTRY Lev2Depends[]; - }; -} STORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE, *PSTORAGE_QUERY_DEPENDENT_VOLUME_RESPONSE; - -#pragma warning(pop) - -#endif // WinVer >= 0x0601 - - -// -// Object Information Classes -// - -typedef enum _OBJECT_INFORMATION_CLASS { - ObjectBasicInformation = 0, - ObjectTypeInformation = 2 -} OBJECT_INFORMATION_CLASS; - -// -// Public Object Information definitions -// - -typedef struct _PUBLIC_OBJECT_BASIC_INFORMATION { - ULONG Attributes; - ACCESS_MASK GrantedAccess; - ULONG HandleCount; - ULONG PointerCount; - - ULONG Reserved[10]; // reserved for internal use - -} PUBLIC_OBJECT_BASIC_INFORMATION, *PPUBLIC_OBJECT_BASIC_INFORMATION; - -typedef struct __PUBLIC_OBJECT_TYPE_INFORMATION { - - UNICODE_STRING TypeName; - - ULONG Reserved [22]; // reserved for internal use - -} PUBLIC_OBJECT_TYPE_INFORMATION, *PPUBLIC_OBJECT_TYPE_INFORMATION; - -#if (NTDDI_VERSION >= NTDDI_NT4) -__drv_maxIRQL(PASSIVE_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryObject ( - __in_opt HANDLE Handle, - __in OBJECT_INFORMATION_CLASS ObjectInformationClass, - __out_bcount_opt(ObjectInformationLength) PVOID ObjectInformation, - __in ULONG ObjectInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetSecurityObject ( - __in HANDLE Handle, - __in SECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtQuerySecurityObject ( - __in HANDLE Handle, - __in SECURITY_INFORMATION SecurityInformation, - __out_bcount_opt(Length) PSECURITY_DESCRIPTOR SecurityDescriptor, - __in ULONG Length, - __out PULONG LengthNeeded - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtClose ( - __in HANDLE Handle - ); -#endif // NTDDI_VERSION >= NTDDI_WIN2K - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateSection ( - __out PHANDLE SectionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PLARGE_INTEGER MaximumSize, - __in ULONG SectionPageProtection, - __in ULONG AllocationAttributes, - __in_opt HANDLE FileHandle - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_allocatesMem(Mem) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtAllocateVirtualMemory ( - __in HANDLE ProcessHandle, - __inout PVOID *BaseAddress, - __in ULONG_PTR ZeroBits, - __inout PSIZE_T RegionSize, - __in ULONG AllocationType, - __in ULONG Protect - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtFreeVirtualMemory ( - __in HANDLE ProcessHandle, - __inout __drv_freesMem(Mem) PVOID *BaseAddress, - __inout PSIZE_T RegionSize, - __in ULONG FreeType - ); -#endif // NTDDI_VERSION >= NTDDI_WIN2K - -// -// Data structure used to represent client security context for a thread. -// This data structure is used to support impersonation. -// -// THE FIELDS OF THIS DATA STRUCTURE SHOULD BE CONSIDERED OPAQUE -// BY ALL EXCEPT THE SECURITY ROUTINES. -// - -typedef struct _SECURITY_CLIENT_CONTEXT { - SECURITY_QUALITY_OF_SERVICE SecurityQos; - PACCESS_TOKEN ClientToken; - BOOLEAN DirectlyAccessClientToken; - BOOLEAN DirectAccessEffectiveOnly; - BOOLEAN ServerIsRemote; - TOKEN_CONTROL ClientTokenControl; - } SECURITY_CLIENT_CONTEXT, *PSECURITY_CLIENT_CONTEXT; - -// -// where -// -// SecurityQos - is the security quality of service information in effect -// for this client. This information is used when directly accessing -// the client's token. In this case, the information here over-rides -// the information in the client's token. If a copy of the client's -// token is requested, it must be generated using this information, -// not the information in the client's token. In all cases, this -// information may not provide greater access than the information -// in the client's token. In particular, if the client's token is -// an impersonation token with an impersonation level of -// "SecurityDelegation", but the information in this field indicates -// an impersonation level of "SecurityIdentification", then -// the server may only get a copy of the token with an Identification -// level of impersonation. -// -// ClientToken - If the DirectlyAccessClientToken field is FALSE, -// then this field contains a pointer to a duplicate of the -// client's token. Otherwise, this field points directly to -// the client's token. -// -// DirectlyAccessClientToken - This boolean flag indicates whether the -// token pointed to by ClientToken is a copy of the client's token -// or is a direct reference to the client's token. A value of TRUE -// indicates the client's token is directly accessed, FALSE indicates -// a copy has been made. -// -// DirectAccessEffectiveOnly - This boolean flag indicates whether the -// the disabled portions of the token that is currently directly -// referenced may be enabled. This field is only valid if the -// DirectlyAccessClientToken field is TRUE. In that case, this -// value supersedes the EffectiveOnly value in the SecurityQos -// FOR THE CURRENT TOKEN ONLY! If the client changes to impersonate -// another client, this value may change. This value is always -// minimized by the EffectiveOnly flag in the SecurityQos field. -// -// ServerIsRemote - If TRUE indicates that the server of the client's -// request is remote. This is used for determining the legitimacy -// of certain levels of impersonation and to determine how to -// track context. -// -// ClientTokenControl - If the ServerIsRemote flag is TRUE, and the -// tracking mode is DYNAMIC, then this field contains a copy of -// the TOKEN_SOURCE from the client's token to assist in deciding -// whether the information at the remote server needs to be -// updated to match the current state of the client's security -// context. -// -// -// NOTE: At some point, we may find it worthwhile to keep an array of -// elements in this data structure, where each element of the -// array contains {ClientToken, ClientTokenControl} fields. -// This would allow efficient handling of the case where a client -// thread was constantly switching between a couple different -// contexts - presumably impersonating client's of its own. -// -#define NTKERNELAPI DECLSPEC_IMPORT -#define NTHALAPI DECLSPEC_IMPORT -// -// Priority increment definitions. The comment for each definition gives -// the names of the system services that use the definition when satisfying -// a wait. -// - -// -// Priority increment used when satisfying a wait on an executive event -// (NtPulseEvent and NtSetEvent) -// - -#define EVENT_INCREMENT 1 - -// -// Priority increment when no I/O has been done. This is used by device -// and file system drivers when completing an IRP (IoCompleteRequest). -// - -#define IO_NO_INCREMENT 0 - - -// -// Priority increment for completing CD-ROM I/O. This is used by CD-ROM device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_CD_ROM_INCREMENT 1 - -// -// Priority increment for completing disk I/O. This is used by disk device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_DISK_INCREMENT 1 - -// -// Priority increment for completing mailslot I/O. This is used by the mail- -// slot file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_MAILSLOT_INCREMENT 2 - -// -// Priority increment for completing named pipe I/O. This is used by the -// named pipe file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_NAMED_PIPE_INCREMENT 2 - -// -// Priority increment for completing network I/O. This is used by network -// device and network file system drivers when completing an IRP -// (IoCompleteRequest). -// - -#define IO_NETWORK_INCREMENT 2 - -// -// Priority increment used when satisfying a wait on an executive semaphore -// (NtReleaseSemaphore) -// - -#define SEMAPHORE_INCREMENT 1 - - - -// -// Memory priority definitions. -// - -#define SYSTEM_PAGE_PRIORITY_BITS 3 -#define SYSTEM_PAGE_PRIORITY_LEVELS (1 << SYSTEM_PAGE_PRIORITY_BITS) - - -// -// Miscellaneous type definitions -// -// APC state -// -// N.B. The user APC pending field must be the last member of this structure. -// - -typedef struct _KAPC_STATE { - LIST_ENTRY ApcListHead[MaximumMode]; - struct _KPROCESS *Process; - BOOLEAN KernelApcInProgress; - BOOLEAN KernelApcPending; - BOOLEAN UserApcPending; -} KAPC_STATE, *PKAPC_STATE, *PRKAPC_STATE; - -#define KAPC_STATE_ACTUAL_LENGTH \ - (FIELD_OFFSET(KAPC_STATE, UserApcPending) + sizeof(BOOLEAN)) - -// -// Queue object -// - -#define ASSERT_QUEUE(Q) NT_ASSERT(KOBJECT_TYPE(Q) == QueueObject); - -// begin_ntosp - -typedef struct _KQUEUE { - DISPATCHER_HEADER Header; - LIST_ENTRY EntryListHead; // Object lock - volatile ULONG CurrentCount; // Interlocked - ULONG MaximumCount; - LIST_ENTRY ThreadListHead; // Object lock -} KQUEUE, *PKQUEUE, *PRKQUEUE; - -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeInitializeMutant ( - __out PRKMUTANT Mutant, - __in BOOLEAN InitialOwner - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeQueryOwnerMutant ( - __in PKMUTANT Mutant, - __out PCLIENT_ID ClientId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeReadStateMutant ( - __in PRKMUTANT Mutant - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(Wait==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(Wait==1, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Wait==1, __drv_reportError("Caution: 'Wait' argument does not provide" - " any synchronization guarantees, only a hint" - " to the system that the thread will immediately" - " issue a wait operation")) -NTKERNELAPI -LONG -KeReleaseMutant ( - __inout PRKMUTANT Mutant, - __in KPRIORITY Increment, - __in BOOLEAN Abandoned, - __in BOOLEAN Wait - ); -#endif - -// -// Queue Object. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeInitializeQueue ( - __out PRKQUEUE Queue, - __in ULONG Count - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeReadStateQueue ( - __in PRKQUEUE Queue - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeInsertQueue ( - __inout PRKQUEUE Queue, - __inout PLIST_ENTRY Entry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeInsertHeadQueue ( - __inout PRKQUEUE Queue, - __inout PLIST_ENTRY Entry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_when((Timeout==NULL || *Timeout!=0), __drv_maxIRQL(APC_LEVEL)) -__drv_when((Timeout!=NULL && *Timeout==0), __drv_maxIRQL(DISPATCH_LEVEL)) -NTKERNELAPI -PLIST_ENTRY -KeRemoveQueue ( - __inout PRKQUEUE Queue, - __in KPROCESSOR_MODE WaitMode, - __in_opt PLARGE_INTEGER Timeout - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_when((Timeout==NULL || *Timeout!=0), __drv_maxIRQL(APC_LEVEL)) -__drv_when((Timeout!=NULL && *Timeout==0), __drv_maxIRQL(DISPATCH_LEVEL)) -NTKERNELAPI -ULONG -KeRemoveQueueEx ( - __inout PKQUEUE Queue, - __in KPROCESSOR_MODE WaitMode, - __in BOOLEAN Alertable, - __in_opt PLARGE_INTEGER Timeout, - __out_ecount_part(Count, return) PLIST_ENTRY *EntryArray, - __in ULONG Count - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PLIST_ENTRY -KeRundownQueue ( - __inout PRKQUEUE Queue - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeAttachProcess ( - __inout PRKPROCESS Process - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeDetachProcess ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeStackAttachProcess ( - __inout PRKPROCESS PROCESS, - __out PRKAPC_STATE ApcState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeUnstackDetachProcess ( - __in PRKAPC_STATE ApcState - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -UCHAR -KeSetIdealProcessorThread ( - __inout PKTHREAD Thread, - __in UCHAR Processor - ); -#endif - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -KeSetKernelStackSwapEnable ( - __in BOOLEAN Enable - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_raisesIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -KIRQL -FASTCALL -KeAcquireQueuedSpinLock ( - __inout __deref __drv_acquiresExclusiveResource(KeQueuedSpinLockType) - __in KSPIN_LOCK_QUEUE_NUMBER Number - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -_DECL_HAL_KE_IMPORT -VOID -FASTCALL -KeReleaseQueuedSpinLock ( - __inout __deref __drv_releasesExclusiveResource(KeQueuedSpinLockType) - __in KSPIN_LOCK_QUEUE_NUMBER Number, - __in KIRQL OldIrql - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_valueIs(==1;==0) -_DECL_HAL_KE_IMPORT -LOGICAL -FASTCALL -KeTryToAcquireQueuedSpinLock ( - __in KSPIN_LOCK_QUEUE_NUMBER Number, - __out __deref __drv_savesIRQL - PKIRQL OldIrql - ); -#endif - -#if defined(_X86_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_raisesIRQL(SYNCH_LEVEL) -__drv_savesIRQL -_DECL_HAL_KE_IMPORT -KIRQL -FASTCALL -KeAcquireSpinLockRaiseToSynch ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - __inout PKSPIN_LOCK SpinLock - ); -#endif - -#else - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_raisesIRQL(SYNCH_LEVEL) -__drv_savesIRQL -NTKERNELAPI -KIRQL -KeAcquireSpinLockRaiseToSynch ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - __inout PKSPIN_LOCK SpinLock - ); -#endif - -#endif - -#define INVALID_PROCESSOR_INDEX 0xffffffff - -NTSTATUS -KeGetProcessorNumberFromIndex ( - __in ULONG ProcIndex, - __out PPROCESSOR_NUMBER ProcNumber - ); - -ULONG -KeGetProcessorIndexFromNumber ( - __in PPROCESSOR_NUMBER ProcNumber - ); - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -SIZE_T -ExQueryPoolBlockSize( - __in PVOID PoolBlock, - __out PBOOLEAN QuotaCharged - ); - -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -PSLIST_ENTRY -FASTCALL -InterlockedPushListSList ( - __inout PSLIST_HEADER ListHead, - __inout __drv_aliasesMem PSLIST_ENTRY List, - __inout PSLIST_ENTRY ListEnd, - __in ULONG Count - ); - -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// Define interlocked lookaside list structure and allocation functions. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -ExAdjustLookasideDepth ( - VOID - ); - -#endif - - -#if !defined(_X86AMD64_) - -#if defined(_WIN64) - -C_ASSERT(sizeof(ERESOURCE) == 0x68); -C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x18); -C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x1a); - -#else - -C_ASSERT(sizeof(ERESOURCE) == 0x38); -C_ASSERT(FIELD_OFFSET(ERESOURCE,ActiveCount) == 0x0c); -C_ASSERT(FIELD_OFFSET(ERESOURCE,Flag) == 0x0e); - -#endif - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExDisableResourceBoostLite ( - __in PERESOURCE Resource - ); - -#endif - - -#define ExDisableResourceBoost ExDisableResourceBoostLite - - -// -// Push lock definitions -// - - -#define EX_PUSH_LOCK ULONG_PTR -#define PEX_PUSH_LOCK PULONG_PTR - - -VOID -ExInitializePushLock ( - __out PEX_PUSH_LOCK PushLock - ); - -// -// Token Flags -// -// Flags that may be defined in the TokenFlags field of the token object, -// or in an ACCESS_STATE structure -// - -#define TOKEN_HAS_TRAVERSE_PRIVILEGE 0x0001 -#define TOKEN_HAS_BACKUP_PRIVILEGE 0x0002 -#define TOKEN_HAS_RESTORE_PRIVILEGE 0x0004 -#define TOKEN_WRITE_RESTRICTED 0x0008 -#define TOKEN_IS_RESTRICTED 0x0010 -#define TOKEN_SESSION_NOT_REFERENCED 0x0020 -#define TOKEN_SANDBOX_INERT 0x0040 -#define TOKEN_HAS_IMPERSONATE_PRIVILEGE 0x0080 -#define SE_BACKUP_PRIVILEGES_CHECKED 0x0100 -#define TOKEN_VIRTUALIZE_ALLOWED 0x0200 -#define TOKEN_VIRTUALIZE_ENABLED 0x0400 -#define TOKEN_IS_FILTERED 0x0800 -#define TOKEN_UIACCESS 0x1000 -#define TOKEN_NOT_LOW 0x2000 - - -typedef struct _SE_EXPORTS { - - // - // Privilege values - // - - LUID SeCreateTokenPrivilege; - LUID SeAssignPrimaryTokenPrivilege; - LUID SeLockMemoryPrivilege; - LUID SeIncreaseQuotaPrivilege; - LUID SeUnsolicitedInputPrivilege; - LUID SeTcbPrivilege; - LUID SeSecurityPrivilege; - LUID SeTakeOwnershipPrivilege; - LUID SeLoadDriverPrivilege; - LUID SeCreatePagefilePrivilege; - LUID SeIncreaseBasePriorityPrivilege; - LUID SeSystemProfilePrivilege; - LUID SeSystemtimePrivilege; - LUID SeProfileSingleProcessPrivilege; - LUID SeCreatePermanentPrivilege; - LUID SeBackupPrivilege; - LUID SeRestorePrivilege; - LUID SeShutdownPrivilege; - LUID SeDebugPrivilege; - LUID SeAuditPrivilege; - LUID SeSystemEnvironmentPrivilege; - LUID SeChangeNotifyPrivilege; - LUID SeRemoteShutdownPrivilege; - - - // - // Universally defined Sids - // - - - PSID SeNullSid; - PSID SeWorldSid; - PSID SeLocalSid; - PSID SeCreatorOwnerSid; - PSID SeCreatorGroupSid; - - - // - // Nt defined Sids - // - - - PSID SeNtAuthoritySid; - PSID SeDialupSid; - PSID SeNetworkSid; - PSID SeBatchSid; - PSID SeInteractiveSid; - PSID SeLocalSystemSid; - PSID SeAliasAdminsSid; - PSID SeAliasUsersSid; - PSID SeAliasGuestsSid; - PSID SeAliasPowerUsersSid; - PSID SeAliasAccountOpsSid; - PSID SeAliasSystemOpsSid; - PSID SeAliasPrintOpsSid; - PSID SeAliasBackupOpsSid; - - // - // New Sids defined for NT5 - // - - PSID SeAuthenticatedUsersSid; - - PSID SeRestrictedSid; - PSID SeAnonymousLogonSid; - - // - // New Privileges defined for NT5 - // - - LUID SeUndockPrivilege; - LUID SeSyncAgentPrivilege; - LUID SeEnableDelegationPrivilege; - - // - // New Sids defined for post-Windows 2000 - - PSID SeLocalServiceSid; - PSID SeNetworkServiceSid; - - // - // New Privileges defined for post-Windows 2000 - // - - LUID SeManageVolumePrivilege; - LUID SeImpersonatePrivilege; - LUID SeCreateGlobalPrivilege; - - // - // New Privileges defined for post Windows Server 2003 - // - - LUID SeTrustedCredManAccessPrivilege; - LUID SeRelabelPrivilege; - LUID SeIncreaseWorkingSetPrivilege; - - LUID SeTimeZonePrivilege; - LUID SeCreateSymbolicLinkPrivilege; - - // - // New Sids defined for post Windows Server 2003 - // - - PSID SeIUserSid; - - // - // Mandatory Sids, ordered lowest to highest. - // - - PSID SeUntrustedMandatorySid; - PSID SeLowMandatorySid; - PSID SeMediumMandatorySid; - PSID SeHighMandatorySid; - PSID SeSystemMandatorySid; - - PSID SeOwnerRightsSid; - -} SE_EXPORTS, *PSE_EXPORTS; - -/////////////////////////////////////////////////////////////////////////////// -// // -// Logon session notification callback routines // -// // -/////////////////////////////////////////////////////////////////////////////// - -// -// These callback routines are used to notify file systems that have -// registered of logon sessions being terminated, so they can cleanup state -// associated with this logon session -// - -typedef NTSTATUS -(*PSE_LOGON_SESSION_TERMINATED_ROUTINE)( - __in PLUID LogonId); - -//++ -// -// ULONG -// SeLengthSid( -// __in PSID Sid -// ); -// -// Routine Description: -// -// This routine computes the length of a SID. -// -// Arguments: -// -// Sid - Points to the SID whose length is to be returned. -// -// Return Value: -// -// The length, in bytes of the SID. -// -//-- - -#define SeLengthSid( Sid ) \ - (8 + (4 * ((SID *)Sid)->SubAuthorityCount)) - -// -//VOID -//SeDeleteClientSecurity( -// __in PSECURITY_CLIENT_CONTEXT ClientContext -// ) -// -///*++ -// -//Routine Description: -// -// This service deletes a client security context block, -// performing whatever cleanup might be necessary to do so. In -// particular, reference to any client token is removed. -// -//Arguments: -// -// ClientContext - Points to the client security context block to be -// deleted. -// -// -//Return Value: -// -// -// -//--*/ -//-- - -// begin_ntosp -#define SeDeleteClientSecurity(C) { \ - if (SeTokenType((C)->ClientToken) == TokenPrimary) { \ - PsDereferencePrimaryToken( (C)->ClientToken ); \ - } else { \ - PsDereferenceImpersonationToken( (C)->ClientToken ); \ - } \ - } - - -//++ -//VOID -//SeStopImpersonatingClient() -// -///*++ -// -//Routine Description: -// -// This service is used to stop impersonating a client using an -// impersonation token. This service must be called in the context -// of the server thread which wishes to stop impersonating its -// client. -// -// -//Arguments: -// -// None. -// -//Return Value: -// -// None. -// -//--*/ -//-- - -#define SeStopImpersonatingClient() PsRevertToSelf() - - -//++ -// -// PACCESS_TOKEN -// SeQuerySubjectContextToken( -// __in PSECURITY_SUBJECT_CONTEXT SubjectContext -// ); -// -// Routine Description: -// -// This routine returns the effective token from the subject context, -// either the client token, if present, or the process token. -// -// Arguments: -// -// SubjectContext - Context to query -// -// Return Value: -// -// This routine returns the PACCESS_TOKEN for the effective token. -// The pointer may be passed to SeQueryInformationToken. This routine -// does not affect the lock status of the token, i.e. the token is not -// locked. If the SubjectContext has been locked, the token remains locked, -// if not, the token remains unlocked. -// -//-- - -#define SeQuerySubjectContextToken( SubjectContext ) \ - ( ARGUMENT_PRESENT( ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken) ? \ - ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->ClientToken : \ - ((PSECURITY_SUBJECT_CONTEXT) SubjectContext)->PrimaryToken ) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeCaptureSubjectContext ( - __out PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeLockSubjectContext( - __in PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeUnlockSubjectContext( - __in PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeReleaseSubjectContext ( - __inout PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - - -NTSTATUS -SeReportSecurityEventWithSubCategory( - __in ULONG Flags, - __in PUNICODE_STRING SourceName, - __in_opt PSID UserSid, - __in PSE_ADT_PARAMETER_ARRAY AuditParameters, - __in ULONG AuditSubcategoryId - ); - -BOOLEAN -SeAccessCheckFromState ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PTOKEN_ACCESS_INFORMATION PrimaryTokenInformation, - __in_opt PTOKEN_ACCESS_INFORMATION ClientTokenInformation, - __in ACCESS_MASK DesiredAccess, - __in ACCESS_MASK PreviouslyGrantedAccess, - __deref_opt_out_opt PPRIVILEGE_SET *Privileges, - __in PGENERIC_MAPPING GenericMapping, - __in KPROCESSOR_MODE AccessMode, - __out PACCESS_MASK GrantedAccess, - __out PNTSTATUS AccessStatus - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -SePrivilegeCheck( - __inout PPRIVILEGE_SET RequiredPrivileges, - __in PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, - __in KPROCESSOR_MODE AccessMode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeFreePrivileges( - __in PPRIVILEGE_SET Privileges - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeOpenObjectAuditAlarm ( - __in PUNICODE_STRING ObjectTypeName, - __in_opt PVOID Object, - __in_opt PUNICODE_STRING AbsoluteObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PACCESS_STATE AccessState, - __in BOOLEAN ObjectCreated, - __in BOOLEAN AccessGranted, - __in KPROCESSOR_MODE AccessMode, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeOpenObjectAuditAlarmWithTransaction ( - __in PUNICODE_STRING ObjectTypeName, - __in_opt PVOID Object, - __in_opt PUNICODE_STRING AbsoluteObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PACCESS_STATE AccessState, - __in BOOLEAN ObjectCreated, - __in BOOLEAN AccessGranted, - __in KPROCESSOR_MODE AccessMode, - __in_opt GUID *TransactionId, - __out PBOOLEAN GenerateOnClose - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeOpenObjectForDeleteAuditAlarm ( - __in PUNICODE_STRING ObjectTypeName, - __in_opt PVOID Object, - __in_opt PUNICODE_STRING AbsoluteObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PACCESS_STATE AccessState, - __in BOOLEAN ObjectCreated, - __in BOOLEAN AccessGranted, - __in KPROCESSOR_MODE AccessMode, - __out PBOOLEAN GenerateOnClose - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeOpenObjectForDeleteAuditAlarmWithTransaction ( - __in PUNICODE_STRING ObjectTypeName, - __in_opt PVOID Object, - __in_opt PUNICODE_STRING AbsoluteObjectName, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PACCESS_STATE AccessState, - __in BOOLEAN ObjectCreated, - __in BOOLEAN AccessGranted, - __in KPROCESSOR_MODE AccessMode, - __in_opt GUID *TransactionId, - __out PBOOLEAN GenerateOnClose - ); - -NTKERNELAPI -VOID -SeExamineSacl( - __in PACL Sacl, - __in PACCESS_TOKEN Token, - __in ACCESS_MASK DesiredAccess, - __in BOOLEAN AccessGranted, - __out PBOOLEAN GenerateAudit, - __out PBOOLEAN GenerateAlarm - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeDeleteObjectAuditAlarm( - __in PVOID Object, - __in HANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeDeleteObjectAuditAlarmWithTransaction( - __in PVOID Object, - __in HANDLE Handle, - __in_opt GUID *TransactionId - ); - - - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -TOKEN_TYPE -SeTokenType( - __in PACCESS_TOKEN Token - ); -#endif -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -SeTokenIsAdmin( - __in PACCESS_TOKEN Token - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -SeTokenIsRestricted( - __in PACCESS_TOKEN Token - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA || (NTDDI_VERSION >= NTDDI_WINXPSP2 && NTDDI_VERSION < NTDDI_WS03)) -NTKERNELAPI -BOOLEAN -SeTokenIsWriteRestricted( - __in PACCESS_TOKEN Token - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -SeFilterToken ( - __in PACCESS_TOKEN ExistingToken, - __in ULONG Flags, - __in_opt PTOKEN_GROUPS SidsToDisable, - __in_opt PTOKEN_PRIVILEGES PrivilegesToDelete, - __in_opt PTOKEN_GROUPS RestrictedSids, - __deref_out PACCESS_TOKEN * FilteredToken - ); -#endif - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeQueryAuthenticationIdToken( - __in PACCESS_TOKEN Token, - __out PLUID AuthenticationId - ); -#endif - -// end_ntosp - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeQueryTokenIntegrity( - __in PACCESS_TOKEN Token, - __inout PSID_AND_ATTRIBUTES IntegritySA - ); -#endif -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeQuerySessionIdToken( - __in PACCESS_TOKEN Token, - __out PULONG SessionId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -SeSetSessionIdToken( - __in PACCESS_TOKEN Token, - __in ULONG SessionId - ); -#endif - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeCreateClientSecurity ( - __in PETHREAD ClientThread, - __in PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos, - __in BOOLEAN RemoteSession, - __out PSECURITY_CLIENT_CONTEXT ClientContext - ); -#endif -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeImpersonateClient( - __in PSECURITY_CLIENT_CONTEXT ClientContext, - __in_opt PETHREAD ServerThread - ); -#endif - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeImpersonateClientEx( - __in PSECURITY_CLIENT_CONTEXT ClientContext, - __in_opt PETHREAD ServerThread - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeCreateClientSecurityFromSubjectContext ( - __in PSECURITY_SUBJECT_CONTEXT SubjectContext, - __in PSECURITY_QUALITY_OF_SERVICE ClientSecurityQos, - __in BOOLEAN ServerIsRemote, - __out PSECURITY_CLIENT_CONTEXT ClientContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeQuerySecurityDescriptorInfo ( - __in PSECURITY_INFORMATION SecurityInformation, - __out_bcount(*Length) PSECURITY_DESCRIPTOR SecurityDescriptor, - __inout PULONG Length, - __deref_inout PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeSetSecurityDescriptorInfo ( - __in_opt PVOID Object, - __in PSECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR ModificationDescriptor, - __inout PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, - __in POOL_TYPE PoolType, - __in PGENERIC_MAPPING GenericMapping - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeSetSecurityDescriptorInfoEx ( - __in_opt PVOID Object, - __in PSECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR ModificationDescriptor, - __inout PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor, - __in ULONG AutoInheritFlags, - __in POOL_TYPE PoolType, - __in PGENERIC_MAPPING GenericMapping - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeAppendPrivileges( - __inout PACCESS_STATE AccessState, - __in PPRIVILEGE_SET Privileges - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -SeAuditHardLinkCreation( - __in __in PUNICODE_STRING FileName, - __in __in PUNICODE_STRING LinkName, - __in __in BOOLEAN bSuccess - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeAuditHardLinkCreationWithTransaction( - __in PUNICODE_STRING FileName, - __in PUNICODE_STRING LinkName, - __in BOOLEAN bSuccess, - __in_opt GUID *TransactionId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -SeAuditTransactionStateChange( - __in GUID *TransactionId, - __in GUID *ResourceManagerId, - __in ULONG NewTransactionState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -SeAuditingFileEvents( - __in BOOLEAN AccessGranted, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXPSP2) -NTKERNELAPI -BOOLEAN -SeAuditingFileEventsWithContext( - __in BOOLEAN AccessGranted, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -BOOLEAN -SeAuditingAnyFileEventsWithContext( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2KSP3) -NTKERNELAPI -BOOLEAN -SeAuditingHardLinkEvents( - __in BOOLEAN AccessGranted, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXPSP2) -NTKERNELAPI -BOOLEAN -SeAuditingHardLinkEventsWithContext( - __in BOOLEAN AccessGranted, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -SeAuditingFileOrGlobalEvents( - __in BOOLEAN AccessGranted, - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -VOID -SeSetAccessStateGenericMapping ( - __inout PACCESS_STATE AccessState, - __in PGENERIC_MAPPING GenericMapping - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeRegisterLogonSessionTerminatedRoutine( - __in PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeUnregisterLogonSessionTerminatedRoutine( - __in PSE_LOGON_SESSION_TERMINATED_ROUTINE CallbackRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeMarkLogonSessionForTerminationNotification( - __in PLUID LogonId - ); -#endif - -// begin_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeQueryInformationToken ( - __in PACCESS_TOKEN Token, - __in TOKEN_INFORMATION_CLASS TokenInformationClass, - __deref_out PVOID *TokenInformation - ); -#endif - - -NTSTATUS -SeLocateProcessImageName( - __inout PEPROCESS Process, - __deref_out PUNICODE_STRING *pImageFileName - ); - -// -// Grants access to SeExports structure -// - -extern NTKERNELAPI PSE_EXPORTS SeExports; - - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -NTKERNELAPI -VOID -SeExamineGlobalSacl( - __in PUNICODE_STRING ObjectType, - __in PACCESS_TOKEN Token, - __in ACCESS_MASK DesiredAccess, - __in BOOLEAN AccessGranted, - __inout PBOOLEAN GenerateAudit, - __inout_opt PBOOLEAN GenerateAlarm -); - -NTKERNELAPI -VOID -SeMaximumAuditMaskFromGlobalSacl( - __in_opt PUNICODE_STRING ObjectTypeName, - __in ACCESS_MASK GrantedAccess, - __in PACCESS_TOKEN Token, - __inout PACCESS_MASK AuditMask - ); - -#endif - - -#if !defined(_PSGETCURRENTTHREAD_) - -#define _PSGETCURRENTTHREAD_ - -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -PETHREAD -PsGetCurrentThread ( - VOID - ) - -/*++ - -Routine Description: - - This function returns a pointer to the current executive thread object. - -Arguments: - - None. - -Return Value: - - A pointer to the current executive thread object. - ---*/ - -{ - - return (PETHREAD)KeGetCurrentThread(); -} - -#endif - - -// -// Security Support -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsAssignImpersonationToken( - __in PETHREAD Thread, - __in_opt HANDLE Token - ); -#endif - -// begin_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PACCESS_TOKEN -PsReferencePrimaryToken ( - __inout PEPROCESS Process - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -PsDereferencePrimaryToken( - __in PACCESS_TOKEN PrimaryToken - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -PsDereferenceImpersonationToken( - __in PACCESS_TOKEN ImpersonationToken - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PACCESS_TOKEN -PsReferenceImpersonationToken( - __inout PETHREAD Thread, - __out PBOOLEAN CopyOnOpen, - __out PBOOLEAN EffectiveOnly, - __out PSECURITY_IMPERSONATION_LEVEL ImpersonationLevel - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -LARGE_INTEGER -PsGetProcessExitTime( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -PsIsThreadTerminating( - __in PETHREAD Thread - ); -#endif - -// begin_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsImpersonateClient( - __inout PETHREAD Thread, - __in PACCESS_TOKEN Token, - __in BOOLEAN CopyOnOpen, - __in BOOLEAN EffectiveOnly, - __in SECURITY_IMPERSONATION_LEVEL ImpersonationLevel - ); -#endif - -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -PsDisableImpersonation( - __inout PETHREAD Thread, - __inout PSE_IMPERSONATION_STATE ImpersonationState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -PsRestoreImpersonation( - __inout PETHREAD Thread, - __in PSE_IMPERSONATION_STATE ImpersonationState - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -PsRevertToSelf( - VOID - ); -#endif - - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PsLookupProcessByProcessId( - __in HANDLE ProcessId, - __deref_out PEPROCESS *Process - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PsLookupThreadByThreadId( - __in HANDLE ThreadId, - __deref_out PETHREAD *Thread - ); - -// -// Quota Operations -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PsChargePoolQuota ( - __in PEPROCESS Process, - __in POOL_TYPE PoolType, - __in ULONG_PTR Amount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PsChargeProcessPoolQuota ( - __in PEPROCESS Process, - __in POOL_TYPE PoolType, - __in ULONG_PTR Amount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PsReturnPoolQuota( - __in PEPROCESS Process, - __in POOL_TYPE PoolType, - __in ULONG_PTR Amount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -BOOLEAN -PsIsSystemThread( - __in PETHREAD Thread - ); -#endif - -#define IO_OPEN_PAGING_FILE 0x0002 -#define IO_OPEN_TARGET_DIRECTORY 0x0004 - -#define IO_STOP_ON_SYMLINK 0x0008 - - -#define IO_MM_PAGING_FILE 0x0010 - - -// -// Define driver FS notification change routine type. -// - -typedef -VOID -DRIVER_FS_NOTIFICATION ( - __in struct _DEVICE_OBJECT *DeviceObject, - __in BOOLEAN FsActive - ); - -typedef DRIVER_FS_NOTIFICATION *PDRIVER_FS_NOTIFICATION; - - -// -// Valid values for FS_FILTER_PARAMETERS.AcquireForSectionSynchronization.SyncType -// - -typedef enum _FS_FILTER_SECTION_SYNC_TYPE { - SyncTypeOther = 0, - SyncTypeCreateSection -} FS_FILTER_SECTION_SYNC_TYPE, *PFS_FILTER_SECTION_SYNC_TYPE; - -// -// Valid values for FS_FILTER_PARAMETERS.NotifyStreamFileObject.NotificationType -// - -typedef enum _FS_FILTER_STREAM_FO_NOTIFICATION_TYPE { - NotifyTypeCreate = 0, - NotifyTypeRetired -} FS_FILTER_STREAM_FO_NOTIFICATION_TYPE, *PFS_FILTER_STREAM_FO_NOTIFICATION_TYPE; - -// -// Parameters union for the operations that -// are exposed to the filters through the -// FsFilterCallbacks registration mechanism. -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#pragma warning(disable:4324) // structure was padded due to __declspec(align()) -#endif - -typedef union _FS_FILTER_PARAMETERS { - - // - // AcquireForModifiedPageWriter - // - - struct { - PLARGE_INTEGER EndingOffset; - PERESOURCE *ResourceToRelease; - } AcquireForModifiedPageWriter; - - // - // ReleaseForModifiedPageWriter - // - - struct { - PERESOURCE ResourceToRelease; - } ReleaseForModifiedPageWriter; - - // - // AcquireForSectionSynchronization - // - - struct { - FS_FILTER_SECTION_SYNC_TYPE SyncType; - ULONG PageProtection; - } AcquireForSectionSynchronization; - - // - // NotifyStreamFileObjectCreation - // - - struct { - FS_FILTER_STREAM_FO_NOTIFICATION_TYPE NotificationType; - BOOLEAN POINTER_ALIGNMENT SafeToRecurse; - } NotifyStreamFileObject; - - // - // Other - // - - struct { - PVOID Argument1; - PVOID Argument2; - PVOID Argument3; - PVOID Argument4; - PVOID Argument5; - } Others; - -} FS_FILTER_PARAMETERS, *PFS_FILTER_PARAMETERS; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -// -// These are the valid values for the Operation field -// of the FS_FILTER_CALLBACK_DATA structure. -// - -#define FS_FILTER_ACQUIRE_FOR_SECTION_SYNCHRONIZATION (UCHAR)-1 -#define FS_FILTER_RELEASE_FOR_SECTION_SYNCHRONIZATION (UCHAR)-2 -#define FS_FILTER_ACQUIRE_FOR_MOD_WRITE (UCHAR)-3 -#define FS_FILTER_RELEASE_FOR_MOD_WRITE (UCHAR)-4 -#define FS_FILTER_ACQUIRE_FOR_CC_FLUSH (UCHAR)-5 -#define FS_FILTER_RELEASE_FOR_CC_FLUSH (UCHAR)-6 - -typedef struct _FS_FILTER_CALLBACK_DATA { - - ULONG SizeOfFsFilterCallbackData; - UCHAR Operation; - UCHAR Reserved; - - struct _DEVICE_OBJECT *DeviceObject; - struct _FILE_OBJECT *FileObject; - - FS_FILTER_PARAMETERS Parameters; - -} FS_FILTER_CALLBACK_DATA, *PFS_FILTER_CALLBACK_DATA; - -// -// Prototype for the callbacks received before an operation -// is passed to the base file system. -// -// A filter can fail this operation, but consistant failure -// will halt system progress. -// - -typedef -NTSTATUS -(*PFS_FILTER_CALLBACK) ( - __in PFS_FILTER_CALLBACK_DATA Data, - __out PVOID *CompletionContext - ); - -// -// Prototype for the completion callback received after an -// operation is completed. -// - -typedef -VOID -(*PFS_FILTER_COMPLETION_CALLBACK) ( - __in PFS_FILTER_CALLBACK_DATA Data, - __in NTSTATUS OperationStatus, - __in PVOID CompletionContext - ); - -// -// This is the structure that the file system filter fills in to -// receive notifications for these locking operations. -// -// A filter should set the field to NULL for any notification callback -// it doesn't wish to receive. -// - -typedef struct _FS_FILTER_CALLBACKS { - - ULONG SizeOfFsFilterCallbacks; - ULONG Reserved; // For alignment - - PFS_FILTER_CALLBACK PreAcquireForSectionSynchronization; - PFS_FILTER_COMPLETION_CALLBACK PostAcquireForSectionSynchronization; - PFS_FILTER_CALLBACK PreReleaseForSectionSynchronization; - PFS_FILTER_COMPLETION_CALLBACK PostReleaseForSectionSynchronization; - PFS_FILTER_CALLBACK PreAcquireForCcFlush; - PFS_FILTER_COMPLETION_CALLBACK PostAcquireForCcFlush; - PFS_FILTER_CALLBACK PreReleaseForCcFlush; - PFS_FILTER_COMPLETION_CALLBACK PostReleaseForCcFlush; - PFS_FILTER_CALLBACK PreAcquireForModifiedPageWriter; - PFS_FILTER_COMPLETION_CALLBACK PostAcquireForModifiedPageWriter; - PFS_FILTER_CALLBACK PreReleaseForModifiedPageWriter; - PFS_FILTER_COMPLETION_CALLBACK PostReleaseForModifiedPageWriter; - -} FS_FILTER_CALLBACKS, *PFS_FILTER_CALLBACKS; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -FsRtlRegisterFileSystemFilterCallbacks ( - __in struct _DRIVER_OBJECT *FilterDriverObject, - __in PFS_FILTER_CALLBACKS Callbacks - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -FsRtlNotifyStreamFileObject ( - __in struct _FILE_OBJECT * StreamFileObject, - __in_opt struct _DEVICE_OBJECT *DeviceObjectHint, - __in FS_FILTER_STREAM_FO_NOTIFICATION_TYPE NotificationType, - __in BOOLEAN SafeToRecurse - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#define DO_VERIFY_VOLUME 0x00000002 -#define DO_BUFFERED_IO 0x00000004 -#define DO_EXCLUSIVE 0x00000008 -#define DO_DIRECT_IO 0x00000010 -#define DO_MAP_IO_BUFFER 0x00000020 -#define DO_DEVICE_HAS_NAME 0x00000040 -#define DO_DEVICE_INITIALIZING 0x00000080 -#define DO_SYSTEM_BOOT_PARTITION 0x00000100 -#define DO_LONG_TERM_REQUESTS 0x00000200 -#define DO_NEVER_LAST_DEVICE 0x00000400 -#define DO_SHUTDOWN_REGISTERED 0x00000800 -#define DO_BUS_ENUMERATED_DEVICE 0x00001000 -#define DO_POWER_PAGABLE 0x00002000 -#define DO_POWER_INRUSH 0x00004000 -#define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 -#define DO_SUPPORTS_TRANSACTIONS 0x00040000 -#define DO_FORCE_NEITHER_IO 0x00080000 -#define DO_VOLUME_DEVICE_OBJECT 0x00100000 -#define DO_SYSTEM_SYSTEM_PARTITION 0x00200000 -#define DO_SYSTEM_CRITICAL_PARTITION 0x00400000 -#define DO_DISALLOW_EXECUTE 0x00800000 - -// -// The following are global counters used by the I/O system to indicate the -// amount of I/O being performed in the system. The first three counters -// are just that, counts of operations that have been requested, while the -// last three counters track the amount of data transferred for each type -// of I/O request. -// - -extern KSPIN_LOCK IoStatisticsLock; -extern ULONG IoReadOperationCount; -extern ULONG IoWriteOperationCount; -extern ULONG IoOtherOperationCount; -extern LARGE_INTEGER IoReadTransferCount; -extern LARGE_INTEGER IoWriteTransferCount; -extern LARGE_INTEGER IoOtherTransferCount; - -// -// It is difficult for cached file systems to properly charge quota -// for the storage that they allocate on behalf of user file handles, -// so the following amount of additional quota is charged against each -// handle as a "best guess" as to the amount of quota the file system -// will allocate on behalf of this handle. -// - -// -// These numbers are totally arbitrary, and can be changed if it turns out -// that the file systems actually allocate more (or less) on behalf of -// their file objects. The non-paged pool charge constant is added to the -// size of a FILE_OBJECT to get the actual charge amount. -// - -#define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64 -#define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024 - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoAcquireVpbSpinLock( - __out PKIRQL Irql - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckDesiredAccess( - __inout PACCESS_MASK DesiredAccess, - __in ACCESS_MASK GrantedAccess - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckEaBufferValidity( - __in PFILE_FULL_EA_INFORMATION EaBuffer, - __in ULONG EaLength, - __out PULONG ErrorOffset - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckFunctionAccess( - __in ACCESS_MASK GrantedAccess, - __in UCHAR MajorFunction, - __in UCHAR MinorFunction, - __in ULONG IoControlCode, - __in_opt PVOID Arg1, - __in_opt PVOID Arg2 - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckQuerySetFileInformation( - __in FILE_INFORMATION_CLASS FileInformationClass, - __in ULONG Length, - __in BOOLEAN SetOperation - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckQuerySetVolumeInformation( - __in FS_INFORMATION_CLASS FsInformationClass, - __in ULONG Length, - __in BOOLEAN SetOperation - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoCheckQuotaBufferValidity( - __in PFILE_QUOTA_INFORMATION QuotaBuffer, - __in ULONG QuotaLength, - __out PULONG ErrorOffset - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PFILE_OBJECT -IoCreateStreamFileObject( - __in_opt PFILE_OBJECT FileObject, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -PFILE_OBJECT -IoCreateStreamFileObjectEx( - __in_opt PFILE_OBJECT FileObject, - __in_opt PDEVICE_OBJECT DeviceObject, - __out_opt PHANDLE FileObjectHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PFILE_OBJECT -IoCreateStreamFileObjectLite( - __in_opt PFILE_OBJECT FileObject, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -IoFastQueryNetworkAttributes( - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in ACCESS_MASK DesiredAccess, - __in ULONG OpenOptions, - __out PIO_STATUS_BLOCK IoStatus, - __out PFILE_NETWORK_OPEN_INFORMATION Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoPageRead( - __in PFILE_OBJECT FileObject, - __in PMDL MemoryDescriptorList, - __in PLARGE_INTEGER StartingOffset, - __in PKEVENT Event, - __out PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PDEVICE_OBJECT -IoGetAttachedDevice( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) // wdm -NTKERNELAPI // wdm -PDEVICE_OBJECT // wdm -__drv_maxIRQL(DISPATCH_LEVEL) // wdm -IoGetAttachedDeviceReference( // wdm - __in PDEVICE_OBJECT DeviceObject // wdm - ); // wdm -#endif // wdm - // wdm -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PDEVICE_OBJECT -IoGetBaseFileSystemDeviceObject( - __in PFILE_OBJECT FileObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) // ntddk -NTKERNELAPI // ntddk ntosp -PCONFIGURATION_INFORMATION // ntddk ntosp -__drv_maxIRQL(PASSIVE_LEVEL) // ntddk ntosp -IoGetConfigurationInformation( VOID ); // ntddk ntosp -#endif // ntddk - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -ULONG -IoGetRequestorProcessId( - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PEPROCESS -IoGetRequestorProcess( - __in PIRP Irp - ); -#endif - -// begin_wdm - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PIRP -IoGetTopLevelIrp( - VOID - ); -#endif - - -//++ -// -// BOOLEAN -// IoIsFileOpenedExclusively( -// __in PFILE_OBJECT FileObject -// ) -// -// Routine Description: -// -// This routine is invoked to determine whether the file open represented -// by the specified file object is opened exclusively. -// -// Arguments: -// -// FileObject - Pointer to the file object that represents the open instance -// of the target file to be tested for exclusive access. -// -// Return Value: -// -// The function value is TRUE if the open instance of the file is exclusive; -// otherwise FALSE is returned. -// -//-- - -#define IoIsFileOpenedExclusively( FileObject ) (\ - (BOOLEAN) !((FileObject)->SharedRead || (FileObject)->SharedWrite || (FileObject)->SharedDelete)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -IoIsOperationSynchronous( - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -IoIsSystemThread( - __in PETHREAD Thread - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -IoIsValidNameGraftingBuffer( - __in PIRP Irp, - __in PREPARSE_DATA_BUFFER ReparseBuffer - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoQueryFileDosDeviceName( - __in PFILE_OBJECT FileObject, - __out POBJECT_NAME_INFORMATION *ObjectNameInformation - ); -#endif - -// begin_ntosp -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoQueryFileInformation( - __in PFILE_OBJECT FileObject, - __in FILE_INFORMATION_CLASS FileInformationClass, - __in ULONG Length, - __out PVOID FileInformation, - __out PULONG ReturnedLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoQueryVolumeInformation( - __in PFILE_OBJECT FileObject, - __in FS_INFORMATION_CLASS FsInformationClass, - __in ULONG Length, - __out PVOID FsInformation, - __out PULONG ReturnedLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoQueueThreadIrp( - __in PIRP Irp - ); -#endif - -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -IoRegisterFileSystem( - __in __drv_aliasesMem PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoRegisterFsRegistrationChange( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_FS_NOTIFICATION DriverNotificationRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -NTSTATUS -IoRegisterFsRegistrationChangeMountAware( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_FS_NOTIFICATION DriverNotificationRoutine, - __in BOOLEAN SynchronizeWithMounts - ); -#endif - -#if (NTDDI_VERSION == NTDDI_WIN2K) -// This API only exists in W2K, it does not exist in any later OS -NTKERNELAPI -NTSTATUS -IoRegisterFsRegistrationChangeEx( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_FS_NOTIFICATION DriverNotificationRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -NTKERNELAPI -NTSTATUS -IoEnumerateRegisteredFiltersList( - __out_bcount_part_opt(DriverObjectListSize,(*ActualNumberDriverObjects)*sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList, - __in ULONG DriverObjectListSize, //in bytes - __out PULONG ActualNumberDriverObjects //in elements - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -NTSTATUS -IoReplaceFileObjectName ( - __in PFILE_OBJECT FileObject, - __in_bcount(FileNameLength) PWSTR NewFileName, - __in USHORT FileNameLength - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoReleaseVpbSpinLock( - __in KIRQL Irql - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoSetDeviceToVerify( - __in PETHREAD Thread, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoSetInformation( - __in PFILE_OBJECT FileObject, - __in FILE_INFORMATION_CLASS FileInformationClass, - __in ULONG Length, - __in PVOID FileInformation - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoSetTopLevelIrp( - __in_opt PIRP Irp - ); -#endif - - -//++ -// -// USHORT -// IoSizeOfIrp( -// __in CCHAR StackSize -// ) -// -// Routine Description: -// -// Determines the size of an IRP given the number of stack locations -// the IRP will have. -// -// Arguments: -// -// StackSize - Number of stack locations for the IRP. -// -// Return Value: -// -// Size in bytes of the IRP. -// -//-- - -#define IoSizeOfIrp( StackSize ) \ - ((USHORT) (sizeof( IRP ) + ((StackSize) * (sizeof( IO_STACK_LOCATION ))))) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) __drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartNextPacket( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN Cancelable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartNextPacketByKey( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN Cancelable, - __in ULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartPacket( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in_opt PULONG Key, - __in_opt PDRIVER_CANCEL CancelFunction - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -VOID -IoSetStartIoAttributes( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN DeferredStartIo, - __in BOOLEAN NonCancelable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartTimer( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStopTimer( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -// end_wdm end_ntosp -// begin_ntifs - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoSynchronousPageWrite( - __in PFILE_OBJECT FileObject, - __in PMDL MemoryDescriptorList, - __in PLARGE_INTEGER StartingOffset, - __in PKEVENT Event, - __out PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - -// begin_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PEPROCESS -IoThreadToProcess( - __in PETHREAD Thread - ); -#endif -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoUnregisterFileSystem( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoUnregisterFsRegistrationChange( - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_FS_NOTIFICATION DriverNotificationRoutine - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoVerifyVolume( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN AllowRawMount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) // wdm -NTKERNELAPI // wdm -VOID // wdm -__drv_maxIRQL(DISPATCH_LEVEL) // wdm -IoWriteErrorLogEntry( // wdm - __in PVOID ElEntry // wdm - ); // wdm -#endif // wdm - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoGetRequestorSessionId( - __in PIRP Irp, - __out PULONG pSessionId - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoEnumerateDeviceObjectList( - __in PDRIVER_OBJECT DriverObject, - __out_bcount_part_opt(DeviceObjectListSize,(*ActualNumberDeviceObjects)*sizeof(PDEVICE_OBJECT)) PDEVICE_OBJECT *DeviceObjectList, - __in ULONG DeviceObjectListSize, - __out PULONG ActualNumberDeviceObjects - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -PDEVICE_OBJECT -IoGetLowerDeviceObject( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -PDEVICE_OBJECT -IoGetDeviceAttachmentBaseRef( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoGetDiskDeviceObject( - __in PDEVICE_OBJECT FileSystemDeviceObject, - __out PDEVICE_OBJECT *DiskDeviceObject - ); -#endif - - -// -// IoPrioirityHint support -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _IO_PRIORITY_INFO { - ULONG Size; - ULONG ThreadPriority; - ULONG PagePriority; - IO_PRIORITY_HINT IoPriority; -} IO_PRIORITY_INFO, *PIO_PRIORITY_INFO; -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -VOID -FORCEINLINE -IoInitializePriorityInfo( - __in PIO_PRIORITY_INFO PriorityInfo - ) -{ - PriorityInfo->Size = sizeof(IO_PRIORITY_INFO); - PriorityInfo->ThreadPriority = 0xffff; - PriorityInfo->IoPriority = IoPriorityNormal; - PriorityInfo->PagePriority = 0; -} -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -PoRegisterSystemState ( - __inout_opt PVOID StateHandle, - __in EXECUTION_STATE Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoCreatePowerRequest ( - __deref_out PVOID *PowerRequest, - __in PDEVICE_OBJECT DeviceObject, - __in PCOUNTED_REASON_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoSetPowerRequest ( - __inout PVOID PowerRequest, - __in POWER_REQUEST_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoClearPowerRequest ( - __inout PVOID PowerRequest, - __in POWER_REQUEST_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PoDeletePowerRequest ( - __inout PVOID PowerRequest - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PoUnregisterSystemState ( - __inout PVOID StateHandle - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -POWER_STATE -PoSetPowerState ( - __in PDEVICE_OBJECT DeviceObject, - __in POWER_STATE_TYPE Type, - __in POWER_STATE State - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoCallDriver ( - __in PDEVICE_OBJECT DeviceObject, - __inout __drv_aliasesMem PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -PoStartNextPowerIrp( - __inout PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PULONG -PoRegisterDeviceForIdleDetection ( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG ConservationIdleTime, - __in ULONG PerformanceIdleTime, - __in DEVICE_POWER_STATE State - ); -#endif - -#define PoSetDeviceBusy(IdlePointer) \ - *IdlePointer = 0 - -#if (NTDDI_VERSION >= NTDDI_WIN6SP1) -NTKERNELAPI -VOID -PoSetDeviceBusyEx ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -PoStartDeviceBusy ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -PoEndDeviceBusy ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -PoQueryWatchdogTime ( - __in PDEVICE_OBJECT Pdo, - __out PULONG SecondsRemaining - ); -#endif - -typedef -__drv_functionClass(POWER_SETTING_CALLBACK) -__drv_sameIRQL -NTSTATUS -POWER_SETTING_CALLBACK ( - __in LPCGUID SettingGuid, - __in_bcount(ValueLength) PVOID Value, - __in ULONG ValueLength, - __inout_opt PVOID Context -); - -typedef POWER_SETTING_CALLBACK *PPOWER_SETTING_CALLBACK; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoRegisterPowerSettingCallback ( - __in_opt PDEVICE_OBJECT DeviceObject, - __in LPCGUID SettingGuid, - __in PPOWER_SETTING_CALLBACK Callback, - __in_opt PVOID Context, - __deref_opt_out PVOID *Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoUnregisterPowerSettingCallback ( - __inout PVOID Handle - ); -#endif - -// -// \Callback\PowerState values -// - -#define PO_CB_SYSTEM_POWER_POLICY 0 -#define PO_CB_AC_STATUS 1 -#define PO_CB_BUTTON_COLLISION 2 // deprecated -#define PO_CB_SYSTEM_STATE_LOCK 3 -#define PO_CB_LID_SWITCH_STATE 4 -#define PO_CB_PROCESSOR_POWER_POLICY 5 // deprecated - - -// Used for queuing work items to be performed at shutdown time. Same -// rules apply as per Ex work queues. -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoQueueShutdownWorkItem( - __inout __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem - ); -#endif - -#if defined(_IA64_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use GetDmaRequirement -__drv_preferredFunction("GetDmaAlignment", "Obsolete") -NTHALAPI -ULONG -HalGetDmaAlignmentRequirement ( - VOID - ); -#endif - -#endif - -#if defined(_M_IX86) || defined(_M_AMD64) - -#define HalGetDmaAlignmentRequirement() 1L -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -MmIsRecursiveIoFault ( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -BOOLEAN -MmForceSectionClosed ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in BOOLEAN DelayClose - ); -#endif - - -typedef enum _MMFLUSH_TYPE { - MmFlushForDelete, - MmFlushForWrite -} MMFLUSH_TYPE; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -BOOLEAN -MmFlushImageSection ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in MMFLUSH_TYPE FlushType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -BOOLEAN -MmCanFileBeTruncated ( - __in PSECTION_OBJECT_POINTERS SectionPointer, - __in_opt PLARGE_INTEGER NewFileSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -BOOLEAN -MmSetAddressRangeModified ( - __in_bcount (Length) PVOID Address, - __in SIZE_T Length - ); -#endif - - -// -// Prefetch public interface. -// - -typedef struct _READ_LIST { - PFILE_OBJECT FileObject; - ULONG NumberOfEntries; - LOGICAL IsImage; - FILE_SEGMENT_ELEMENT List[ANYSIZE_ARRAY]; -} READ_LIST, *PREAD_LIST; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef union _MM_PREFETCH_FLAGS { - struct { - ULONG Priority : SYSTEM_PAGE_PRIORITY_BITS; - ULONG RepurposePriority : SYSTEM_PAGE_PRIORITY_BITS; - } Flags; - ULONG AllFlags; - -} MM_PREFETCH_FLAGS, *PMM_PREFETCH_FLAGS; - -#define MM_PREFETCH_FLAGS_MASK ((1 << (2*SYSTEM_PAGE_PRIORITY_BITS)) - 1) - -__drv_maxIRQL (PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -MmPrefetchPages ( - __in ULONG NumberOfLists, - __in_ecount (NumberOfLists) PREAD_LIST *ReadLists - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -// -// This routine is used by local file systems to detect the case where the -// user has closed the file handles and the section handles, but still has -// open writable views to the file -// - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -ULONG -MmDoesFileHaveUserWritableReferences ( - __in PSECTION_OBJECT_POINTERS SectionPointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -ObInsertObject( - __in PVOID Object, - __inout_opt PACCESS_STATE PassedAccessState, - __in_opt ACCESS_MASK DesiredAccess, - __in ULONG ObjectPointerBias, - __out_opt PVOID *NewObject, - __out_opt PHANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -ObOpenObjectByPointer( - __in PVOID Object, - __in ULONG HandleAttributes, - __in_opt PACCESS_STATE PassedAccessState, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode, - __out PHANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -NTSTATUS -ObOpenObjectByPointerWithTag( - __in PVOID Object, - __in ULONG HandleAttributes, - __in_opt PACCESS_STATE PassedAccessState, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode, - __in ULONG Tag, - __out PHANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -ObMakeTemporaryObject( - __in PVOID Object - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -ObQueryNameString( - __in PVOID Object, - __out_bcount_opt(Length) POBJECT_NAME_INFORMATION ObjectNameInfo, - __in ULONG Length, - __out PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -BOOLEAN -ObIsKernelHandle ( - __in HANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -ObQueryObjectAuditingByHandle( - __in HANDLE Handle, - __out PBOOLEAN GenerateOnClose - ); -#endif - - -// -// The following are globally used definitions for an LBN and a VBN -// - -typedef ULONG LBN; -typedef LBN *PLBN; - -typedef ULONG VBN; -typedef VBN *PVBN; - - -// -// Every file system that uses the cache manager must have FsContext -// of the file object point to a common fcb header structure. -// - -typedef enum _FAST_IO_POSSIBLE { - FastIoIsNotPossible = 0, - FastIoIsPossible, - FastIoIsQuestionable -} FAST_IO_POSSIBLE; - - -typedef struct _FSRTL_COMMON_FCB_HEADER { - - CSHORT NodeTypeCode; - CSHORT NodeByteSize; - - // - // General flags available to FsRtl. - // - - UCHAR Flags; - - // - // Indicates if fast I/O is possible or if we should be calling - // the check for fast I/O routine which is found via the driver - // object. - // - - UCHAR IsFastIoPossible; // really type FAST_IO_POSSIBLE - - // - // Second Flags Field - // - - UCHAR Flags2; - - // - // The following reserved field should always be 0 - // - - UCHAR Reserved : 4 ; - - // - // Indicates the version of this header - // - - UCHAR Version : 4 ; - - PERESOURCE Resource; - - PERESOURCE PagingIoResource; - - LARGE_INTEGER AllocationSize; - LARGE_INTEGER FileSize; - LARGE_INTEGER ValidDataLength; - -} FSRTL_COMMON_FCB_HEADER; -typedef FSRTL_COMMON_FCB_HEADER *PFSRTL_COMMON_FCB_HEADER; - - -// -// NodeTypeCode values used ranges -// -// CDFS - 0x0300 - 0x033F -// CLFS - 0x0400 - 0x043F -// WINFS - 0x0440 - 0x047F -// FASTFAT - 0x0500 - 0x053F -// RAW - 0x0600 - 0x063F -// NTFS - 0x0700 - 0x07FF -// UDFS - 0x0900 - 0x093F -// EXFAT - 0x0D00 - 0x0D3F -// - 0x8000 - 0xBFFF reserved for 3rd party file systems -// WIMFilter - 0x1000 - 0x103F -// NCFILTER - 0x2200 - 0x223F sample minifilter -// RDBSS - 0xEB00 - 0xECFF -// NULMRX - 0xFF00 - 0xFF3F sample redirector - - - -// -// This Fcb header is used for files which support caching -// of compressed data, and related new support. -// -// We start out by prefixing this structure with the normal -// FsRtl header from above, which we have to do two different -// ways for c++ or c. -// - -#ifdef __cplusplus -typedef struct _FSRTL_ADVANCED_FCB_HEADER:FSRTL_COMMON_FCB_HEADER { -#else // __cplusplus - -typedef struct _FSRTL_ADVANCED_FCB_HEADER { - - // - // Put in the standard FsRtl header fields - // - - FSRTL_COMMON_FCB_HEADER DUMMYSTRUCTNAME; - -#endif // __cplusplus - - // - // The following two fields are supported only if - // Flags2 contains FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS - // - - // - // This is a pointer to a Fast Mutex which may be used to - // properly synchronize access to the FsRtl header. The - // Fast Mutex must be nonpaged. - // - - PFAST_MUTEX FastMutex; - - // - // This is a pointer to a list of stream context structures belonging to - // filesystem filter drivers that are linked above the filesystem. - // Each structure is headed by FSRTL_FILTER_CONTEXT. - // - - LIST_ENTRY FilterContexts; - - -#if (NTDDI_VERSION >= NTDDI_VISTA) - // - // The following fields are valid only if the Version - // field in the FSRTL_COMMON_FCB_HEADER is greater than - // or equal to FSRTL_FCB_HEADER_V1 - // These fields are present in VISTA and beyond - // - - // - // This is a pushlock which is used to properly synchronize access - // to the list of stream contexts - // - - EX_PUSH_LOCK PushLock; - - // - // This is a pointer to a blob of information that is - // associated with the opened file in the filesystem - // corresponding to the structure containing this - // FSRTL_ADVANCED_FCB_HEADER. - // - - PVOID* FileContextSupportPointer; -#endif - -} FSRTL_ADVANCED_FCB_HEADER; -typedef FSRTL_ADVANCED_FCB_HEADER *PFSRTL_ADVANCED_FCB_HEADER; - -// -// Define FsRtl common header versions -// - -#define FSRTL_FCB_HEADER_V0 (0x00) -#define FSRTL_FCB_HEADER_V1 (0x01) - - -// -// Define FsRtl common header flags -// - -#define FSRTL_FLAG_FILE_MODIFIED (0x01) -#define FSRTL_FLAG_FILE_LENGTH_CHANGED (0x02) -#define FSRTL_FLAG_LIMIT_MODIFIED_PAGES (0x04) - -// -// Following flags determine how the modified page writer should -// acquire the file. These flags can't change while either resource -// is acquired. If neither of these flags is set then the -// modified/mapped page writer will attempt to acquire the paging io -// resource shared. -// - -#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_EX (0x08) -#define FSRTL_FLAG_ACQUIRE_MAIN_RSRC_SH (0x10) - -// -// This flag will be set by the Cache Manager if a view is mapped -// to a file. -// - -#define FSRTL_FLAG_USER_MAPPED_FILE (0x20) - -// This flag indicates that the file system is using the -// FSRTL_ADVANCED_FCB_HEADER structure instead of the FSRTL_COMMON_FCB_HEADER -// structure. -// - -#define FSRTL_FLAG_ADVANCED_HEADER (0x40) - -// This flag determines whether there currently is an Eof advance -// in progress. All such advances must be serialized. -// - -#define FSRTL_FLAG_EOF_ADVANCE_ACTIVE (0x80) - -// -// Flag values for Flags2 -// -// All unused bits are reserved and should NOT be modified. -// - -// -// If this flag is set, the Cache Manager will allow modified writing -// in spite of the value of FsContext2. -// - -#define FSRTL_FLAG2_DO_MODIFIED_WRITE (0x01) - -// -// If this flag is set, the additional fields FilterContexts and FastMutex -// are supported in FSRTL_COMMON_HEADER, and can be used to associate -// context for filesystem filters with streams. -// - -#define FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS (0x02) - -// -// If this flag is set, the cache manager will flush and purge the cache map when -// a user first maps a file -// - -#define FSRTL_FLAG2_PURGE_WHEN_MAPPED (0x04) - -// If set this represents a PAGING file -// - -#define FSRTL_FLAG2_IS_PAGING_FILE (0x08) - - -// begin_ntosp -// -// -// The following constants are used to block top level Irp processing when -// (in either the fast io or cc case) file system resources have been -// acquired above the file system, or we are in an Fsp thread. -// - -#define FSRTL_FSP_TOP_LEVEL_IRP ((LONG_PTR)0x01) -#define FSRTL_CACHE_TOP_LEVEL_IRP ((LONG_PTR)0x02) -#define FSRTL_MOD_WRITE_TOP_LEVEL_IRP ((LONG_PTR)0x03) -#define FSRTL_FAST_IO_TOP_LEVEL_IRP ((LONG_PTR)0x04) -#define FSRTL_NETWORK1_TOP_LEVEL_IRP ((LONG_PTR)0x05) -#define FSRTL_NETWORK2_TOP_LEVEL_IRP ((LONG_PTR)0x06) -#define FSRTL_MAX_TOP_LEVEL_IRP_FLAG ((LONG_PTR)0xFFFF) - -// end_ntosp - -// -// The following structure is used to synchronize Eof extends. -// - -typedef struct _EOF_WAIT_BLOCK { - - LIST_ENTRY EofWaitLinks; - KEVENT Event; - -} EOF_WAIT_BLOCK; - -typedef EOF_WAIT_BLOCK *PEOF_WAIT_BLOCK; - -// begin_ntosp -// -// Normal uncompressed Copy and Mdl Apis -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCopyRead ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in ULONG LockKey, - __out_bcount(Length) PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCopyWrite ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in ULONG LockKey, - __in_bcount(Length) PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in PDEVICE_OBJECT DeviceObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlMdlReadDev ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __deref_out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlMdlReadCompleteDev ( - __in PFILE_OBJECT FileObject, - __in PMDL MdlChain, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlPrepareMdlWriteDev ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __deref_out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlMdlWriteCompleteDev ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in PMDL MdlChain, - __in_opt PDEVICE_OBJECT DeviceObject - ); -#endif - -// -// In Irps, compressed reads and writes are designated by the -// subfunction IRP_MN_COMPRESSED must be set and the Compressed -// Data Info buffer must be described by the following structure -// pointed to by Irp->Tail.Overlay.AuxiliaryBuffer. -// - -typedef struct _FSRTL_AUXILIARY_BUFFER { - - // - // Buffer description with length. - // - - PVOID Buffer; - ULONG Length; - - // - // Flags - // - - ULONG Flags; - - // - // Pointer to optional Mdl mapping buffer for file system use - // - - PMDL Mdl; - -} FSRTL_AUXILIARY_BUFFER; -typedef FSRTL_AUXILIARY_BUFFER *PFSRTL_AUXILIARY_BUFFER; - -// -// If this flag is set, the auxiliary buffer structure is -// deallocated on Irp completion. The caller has the -// option in this case of appending this structure to the -// structure being described, causing it all to be -// deallocated at once. If this flag is clear, no deallocate -// occurs. -// - -#define FSRTL_AUXILIARY_FLAG_DEALLOCATE 0x00000001 - -// -// The following two routines are called from NtCreateSection to avoid -// deadlocks with the file systems. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlAcquireFileExclusive ( - __in PFILE_OBJECT FileObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlReleaseFile ( - __in PFILE_OBJECT FileObject - ); -#endif - -// -// These routines provide a simple interface for the common operations -// of query/set file size. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FsRtlGetFileSize( - __in PFILE_OBJECT FileObject, - __out PLARGE_INTEGER FileSize - ); -#endif - -// -// Determine if there is a complete device failure on an error. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTKERNELAPI -BOOLEAN -FsRtlIsTotalDeviceFailure( - __in NTSTATUS Status - ); -#endif - -// end_ntddk end_ntosp - -// -// Byte range file lock routines, implemented in FileLock.c -// -// The file lock info record is used to return enumerated information -// about a file lock -// - -typedef struct _FILE_LOCK_INFO { - - // - // A description of the current locked range, and if the lock - // is exclusive or shared - // - - LARGE_INTEGER StartingByte; - LARGE_INTEGER Length; - BOOLEAN ExclusiveLock; - - // - // The following fields describe the owner of the lock. - // - - ULONG Key; - PFILE_OBJECT FileObject; - PVOID ProcessId; - - // - // The following field is used internally by FsRtl - // - - LARGE_INTEGER EndingByte; - -} FILE_LOCK_INFO; -typedef FILE_LOCK_INFO *PFILE_LOCK_INFO; - -// -// The following two procedure prototypes are used by the caller of the -// file lock package to supply an alternate routine to call when -// completing an IRP and when unlocking a byte range. Note that the only -// utility to us this interface is currently the redirector, all other file -// system will probably let the IRP complete normally with IoCompleteRequest. -// The user supplied routine returns any value other than success then the -// lock package will remove any lock that we just inserted. -// - -typedef NTSTATUS (*PCOMPLETE_LOCK_IRP_ROUTINE) ( - __in PVOID Context, - __in PIRP Irp - ); - -typedef VOID (*PUNLOCK_ROUTINE) ( - __in PVOID Context, - __in PFILE_LOCK_INFO FileLockInfo - ); - -// -// A FILE_LOCK is an opaque structure but we need to declare the size of -// it here so that users can allocate space for one. -// - -typedef struct _FILE_LOCK { - - // - // The optional procedure to call to complete a request - // - - PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine; - - // - // The optional procedure to call when unlocking a byte range - // - - PUNLOCK_ROUTINE UnlockRoutine; - - // - // FastIoIsQuestionable is set to true whenever the filesystem require - // additional checking about whether the fast path can be taken. As an - // example Ntfs requires checking for disk space before the writes can - // occur. - // - - BOOLEAN FastIoIsQuestionable; - BOOLEAN SpareC[3]; - - // - // FsRtl lock information - // - - PVOID LockInformation; - - // - // Contains continuation information for FsRtlGetNextFileLock - // - - FILE_LOCK_INFO LastReturnedLockInfo; - PVOID LastReturnedLock; - - // - // Number of lock requests in progress. Used for synchronization purposes - // (so far, this only means byte range locks vs. oplocks). - // - - LONG volatile LockRequestsInProgress; - -} FILE_LOCK; -typedef FILE_LOCK *PFILE_LOCK; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFILE_LOCK -FsRtlAllocateFileLock ( - __in_opt PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine, - __in_opt PUNLOCK_ROUTINE UnlockRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlFreeFileLock ( - __in PFILE_LOCK FileLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlInitializeFileLock ( - __in PFILE_LOCK FileLock, - __in_opt PCOMPLETE_LOCK_IRP_ROUTINE CompleteLockIrpRoutine, - __in_opt PUNLOCK_ROUTINE UnlockRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlUninitializeFileLock ( - __in PFILE_LOCK FileLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlProcessFileLock ( - __in PFILE_LOCK FileLock, - __in PIRP Irp, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCheckLockForReadAccess ( - __in PFILE_LOCK FileLock, - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCheckLockForWriteAccess ( - __in PFILE_LOCK FileLock, - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlFastCheckLockForRead ( - __in PFILE_LOCK FileLock, - __in PLARGE_INTEGER StartingByte, - __in PLARGE_INTEGER Length, - __in ULONG Key, - __in PFILE_OBJECT FileObject, - __in PVOID ProcessId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlFastCheckLockForWrite ( - __in PFILE_LOCK FileLock, - __in PLARGE_INTEGER StartingByte, - __in PLARGE_INTEGER Length, - __in ULONG Key, - __in PVOID FileObject, - __in PVOID ProcessId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFILE_LOCK_INFO -FsRtlGetNextFileLock ( - __in PFILE_LOCK FileLock, - __in BOOLEAN Restart - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAreThereCurrentOrInProgressFileLocks ( - __in PFILE_LOCK FileLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlFastUnlockSingle ( - __in PFILE_LOCK FileLock, - __in PFILE_OBJECT FileObject, - __in LARGE_INTEGER UNALIGNED *FileOffset, - __in PLARGE_INTEGER Length, - __in PEPROCESS ProcessId, - __in ULONG Key, - __in_opt PVOID Context, - __in BOOLEAN AlreadySynchronized - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlFastUnlockAll ( - __in PFILE_LOCK FileLock, - __in PFILE_OBJECT FileObject, - __in PEPROCESS ProcessId, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlFastUnlockAllByKey ( - __in PFILE_LOCK FileLock, - __in PFILE_OBJECT FileObject, - __in PEPROCESS ProcessId, - __in ULONG Key, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -__drv_preferredFunction(FsRtlFastLock, "Obsolete") -NTKERNELAPI -BOOLEAN -FsRtlPrivateLock ( - __in PFILE_LOCK FileLock, - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in PLARGE_INTEGER Length, - __in PEPROCESS ProcessId, - __in ULONG Key, - __in BOOLEAN FailImmediately, - __in BOOLEAN ExclusiveLock, - __out PIO_STATUS_BLOCK Iosb, - __in_opt PIRP Irp, - __in_opt __drv_aliasesMem PVOID Context, - __in BOOLEAN AlreadySynchronized - ); -#endif - -// -// BOOLEAN -// FsRtlFastLock ( -// __in PFILE_LOCK FileLock, -// __in PFILE_OBJECT FileObject, -// __in PLARGE_INTEGER FileOffset, -// __in PLARGE_INTEGER Length, -// __in PEPROCESS ProcessId, -// __in ULONG Key, -// __in BOOLEAN FailImmediately, -// __in BOOLEAN ExclusiveLock, -// __out PIO_STATUS_BLOCK Iosb, -// __in PVOID Context OPTIONAL, -// __in BOOLEAN AlreadySynchronized -// ); -// - -#define FsRtlFastLock(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11) ( \ - FsRtlPrivateLock( A1, /* FileLock */ \ - A2, /* FileObject */ \ - A3, /* FileOffset */ \ - A4, /* Length */ \ - A5, /* ProcessId */ \ - A6, /* Key */ \ - A7, /* FailImmediately */ \ - A8, /* ExclusiveLock */ \ - A9, /* Iosb */ \ - NULL, /* Irp */ \ - A10, /* Context */ \ - A11 /* AlreadySynchronized */ ) \ -) - -// -// BOOLEAN -// FsRtlAreThereCurrentFileLocks ( -// __in PFILE_LOCK FileLock -// ); -// - -#define FsRtlAreThereCurrentFileLocks(FL) ( \ - ((FL)->FastIoIsQuestionable)) - -// -// These macros are used by file systems to increment or decrement the -// number of lock requests in progress, in order to prevent races with -// oplocks etc. -// - -#define FsRtlIncrementLockRequestsInProgress(FL) { \ - ASSERT( (FL)->LockRequestsInProgress >= 0 ); \ - (void) \ - (InterlockedIncrement((LONG volatile *)&((FL)->LockRequestsInProgress)));\ -} - -#define FsRtlDecrementLockRequestsInProgress(FL) { \ - ASSERT( (FL)->LockRequestsInProgress > 0 ); \ - (void) \ - (InterlockedDecrement((LONG volatile *)&((FL)->LockRequestsInProgress)));\ -} - - - -// -// Filesystem property tunneling, implemented in tunnel.c -// - -// -// Tunnel cache structure -// - -typedef struct { - - // - // Mutex for cache manipulation - // - - FAST_MUTEX Mutex; - - // - // Splay Tree of tunneled information keyed by - // DirKey ## Name - // - - PRTL_SPLAY_LINKS Cache; - - // - // Timer queue used to age entries out of the main cache - // - - LIST_ENTRY TimerQueue; - - // - // Keep track of the number of entries in the cache to prevent - // excessive use of memory - // - - USHORT NumEntries; - -} TUNNEL, *PTUNNEL; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlInitializeTunnelCache ( - __in TUNNEL *Cache - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlAddToTunnelCache ( - __in TUNNEL *Cache, - __in ULONGLONG DirectoryKey, - __in UNICODE_STRING *ShortName, - __in UNICODE_STRING *LongName, - __in BOOLEAN KeyByShortName, - __in ULONG DataLength, - __in_bcount(DataLength) VOID *Data - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlFindInTunnelCache ( - __in TUNNEL *Cache, - __in ULONGLONG DirectoryKey, - __in UNICODE_STRING *Name, - __out UNICODE_STRING *ShortName, - __out UNICODE_STRING *LongName, - __inout ULONG *DataLength, - __out_bcount_part(*DataLength, *DataLength) VOID *Data - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlDeleteKeyFromTunnelCache ( - __in TUNNEL *Cache, - __in ULONGLONG DirectoryKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlDeleteTunnelCache ( - __in TUNNEL *Cache - ); -#endif - - -// -// Dbcs name support routines, implemented in DbcsName.c -// - -// -// The following enumerated type is used to denote the result of name -// comparisons -// - -typedef enum _FSRTL_COMPARISON_RESULT { - LessThan = -1, - EqualTo = 0, - GreaterThan = 1 -} FSRTL_COMPARISON_RESULT; - -#ifdef NLS_MB_CODE_PAGE_TAG -#undef NLS_MB_CODE_PAGE_TAG -#endif // NLS_MB_CODE_PAGE_TAG - - -#define LEGAL_ANSI_CHARACTER_ARRAY (*FsRtlLegalAnsiCharacterArray) // ntosp -#define NLS_MB_CODE_PAGE_TAG (*NlsMbOemCodePageTag) -#define NLS_OEM_LEAD_BYTE_INFO (*NlsOemLeadByteInfo) // ntosp - - -extern UCHAR const* const LEGAL_ANSI_CHARACTER_ARRAY; -extern PUSHORT NLS_OEM_LEAD_BYTE_INFO; // Lead byte info. for ACP - -// -// These following bit values are set in the FsRtlLegalDbcsCharacterArray -// - -#define FSRTL_FAT_LEGAL 0x01 -#define FSRTL_HPFS_LEGAL 0x02 -#define FSRTL_NTFS_LEGAL 0x04 -#define FSRTL_WILD_CHARACTER 0x08 -#define FSRTL_OLE_LEGAL 0x10 -#define FSRTL_NTFS_STREAM_LEGAL (FSRTL_NTFS_LEGAL | FSRTL_OLE_LEGAL) - -// -// The following macro is used to determine if an Ansi character is wild. -// - -#define FsRtlIsAnsiCharacterWild(C) ( \ - FsRtlTestAnsiCharacter((C), FALSE, FALSE, FSRTL_WILD_CHARACTER) \ -) - -// -// The following macro is used to determine if an Ansi character is Fat legal. -// - -#define FsRtlIsAnsiCharacterLegalFat(C,WILD_OK) ( \ - FsRtlTestAnsiCharacter((C), TRUE, (WILD_OK), FSRTL_FAT_LEGAL) \ -) - -// -// The following macro is used to determine if an Ansi character is Hpfs legal. -// - -#define FsRtlIsAnsiCharacterLegalHpfs(C,WILD_OK) ( \ - FsRtlTestAnsiCharacter((C), TRUE, (WILD_OK), FSRTL_HPFS_LEGAL) \ -) - -// -// The following macro is used to determine if an Ansi character is Ntfs legal. -// - -#define FsRtlIsAnsiCharacterLegalNtfs(C,WILD_OK) ( \ - FsRtlTestAnsiCharacter((C), TRUE, (WILD_OK), FSRTL_NTFS_LEGAL) \ -) - -// -// The following macro is used to determine if an Ansi character is -// legal in an Ntfs stream name -// - -#define FsRtlIsAnsiCharacterLegalNtfsStream(C,WILD_OK) ( \ - FsRtlTestAnsiCharacter((C), TRUE, (WILD_OK), FSRTL_NTFS_STREAM_LEGAL) \ -) - -// -// The following macro is used to determine if an Ansi character is legal, -// according to the caller's specification. -// - -#define FsRtlIsAnsiCharacterLegal(C,FLAGS) ( \ - FsRtlTestAnsiCharacter((C), TRUE, FALSE, (FLAGS)) \ -) - -// -// The following macro is used to test attributes of an Ansi character, -// according to the caller's specified flags. -// - -#define FsRtlTestAnsiCharacter(C, DEFAULT_RET, WILD_OK, FLAGS) ( \ - ((SCHAR)(C) < 0) ? DEFAULT_RET : \ - FlagOn( LEGAL_ANSI_CHARACTER_ARRAY[(C)], \ - (FLAGS) | \ - ((WILD_OK) ? FSRTL_WILD_CHARACTER : 0) ) \ -) - - -// -// The following two macros use global data defined in ntos\rtl\nlsdata.c -// -// BOOLEAN -// FsRtlIsLeadDbcsCharacter ( -// __in UCHAR DbcsCharacter -// ); -// -// /*++ -// -// Routine Description: -// -// This routine takes the first bytes of a Dbcs character and -// returns whether it is a lead byte in the system code page. -// -// Arguments: -// -// DbcsCharacter - Supplies the input character being examined -// -// Return Value: -// -// BOOLEAN - TRUE if the input character is a dbcs lead and -// FALSE otherwise -// -// --*/ -// -// - -#define FsRtlIsLeadDbcsCharacter(DBCS_CHAR) ( \ - (BOOLEAN)((UCHAR)(DBCS_CHAR) < 0x80 ? FALSE : \ - (NLS_MB_CODE_PAGE_TAG && \ - (NLS_OEM_LEAD_BYTE_INFO[(UCHAR)(DBCS_CHAR)] != 0))) \ -) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlDissectDbcs ( - __in ANSI_STRING Path, - __out PANSI_STRING FirstName, - __out PANSI_STRING RemainingName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlDoesDbcsContainWildCards ( - __in PANSI_STRING Name - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsDbcsInExpression ( - __in PANSI_STRING Expression, - __in PANSI_STRING Name - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsFatDbcsLegal ( - __in ANSI_STRING DbcsName, - __in BOOLEAN WildCardsPermissible, - __in BOOLEAN PathNamePermissible, - __in BOOLEAN LeadingBackslashPermissible - ); -#endif - -// end_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsHpfsDbcsLegal ( - __in ANSI_STRING DbcsName, - __in BOOLEAN WildCardsPermissible, - __in BOOLEAN PathNamePermissible, - __in BOOLEAN LeadingBackslashPermissible - ); -#endif - - -// -// Exception filter routines, implemented in Filter.c -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -FsRtlNormalizeNtstatus ( - __in NTSTATUS Exception, - __in NTSTATUS GenericException - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTKERNELAPI -BOOLEAN -FsRtlIsNtstatusExpected ( - __in NTSTATUS Exception - ); -#endif - -// -// The following procedures are used to allocate executive pool and raise -// insufficient resource status if pool isn't currently available. -// - -#define FsRtlAllocatePoolWithTag(PoolType, NumberOfBytes, Tag) \ - ExAllocatePoolWithTag((POOL_TYPE)((PoolType) | POOL_RAISE_IF_ALLOCATION_FAILURE), \ - NumberOfBytes, \ - Tag) - - -#define FsRtlAllocatePoolWithQuotaTag(PoolType, NumberOfBytes, Tag) \ - ExAllocatePoolWithQuotaTag((POOL_TYPE)((PoolType) | POOL_RAISE_IF_ALLOCATION_FAILURE), \ - NumberOfBytes, \ - Tag) - -// -// The following function allocates a resource from the FsRtl pool. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_preferredFunction(ExAllocateFromNPagedLookasideList, "The FsRtlAllocateResource routine is obsolete, but is exported to support existing driver binaries. Use ExAllocateFromNPagedLookasideList and ExInitializeResourceLite instead.") -NTKERNELAPI -PERESOURCE -FsRtlAllocateResource ( - VOID - ); -#endif - - -// -// Large Integer Mapped Control Blocks routines, implemented in LargeMcb.c -// -// Originally this structure was truly opaque and code outside largemcb was -// never allowed to examine or alter the structures. However, for performance -// reasons we want to allow ntfs the ability to quickly truncate down the -// mcb without the overhead of an actual call to largemcb.c. So to do that we -// need to export the structure. This structure is not exact. The Mapping field -// is declared here as a pvoid but largemcb.c it is a pointer to mapping pairs. -// - -typedef struct _BASE_MCB { - ULONG MaximumPairCount; - ULONG PairCount; - USHORT PoolType; - USHORT Flags; - PVOID Mapping; -} BASE_MCB; -typedef BASE_MCB *PBASE_MCB; - -typedef struct _LARGE_MCB { - PKGUARDED_MUTEX GuardedMutex; - BASE_MCB BaseMcb; -} LARGE_MCB; -typedef LARGE_MCB *PLARGE_MCB; - -#define MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE 1 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlInitializeLargeMcb ( - __in PLARGE_MCB Mcb, - __in POOL_TYPE PoolType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlUninitializeLargeMcb ( - __in PLARGE_MCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlResetLargeMcb ( - __in PLARGE_MCB Mcb, - __in BOOLEAN SelfSynchronized - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlTruncateLargeMcb ( - __in PLARGE_MCB Mcb, - __in LONGLONG Vbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAddLargeMcbEntry ( - __in PLARGE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG Lbn, - __in LONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlRemoveLargeMcbEntry ( - __in PLARGE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLargeMcbEntry ( - __in PLARGE_MCB Mcb, - __in LONGLONG Vbn, - __out_opt PLONGLONG Lbn, - __out_opt PLONGLONG SectorCountFromLbn, - __out_opt PLONGLONG StartingLbn, - __out_opt PLONGLONG SectorCountFromStartingLbn, - __out_opt PULONG Index - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLastLargeMcbEntry ( - __in PLARGE_MCB Mcb, - __out PLONGLONG Vbn, - __out PLONGLONG Lbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLastLargeMcbEntryAndIndex ( - __in PLARGE_MCB OpaqueMcb, - __out PLONGLONG LargeVbn, - __out PLONGLONG LargeLbn, - __out PULONG Index - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -ULONG -FsRtlNumberOfRunsInLargeMcb ( - __in PLARGE_MCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlGetNextLargeMcbEntry ( - __in PLARGE_MCB Mcb, - __in ULONG RunIndex, - __out PLONGLONG Vbn, - __out PLONGLONG Lbn, - __out PLONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlSplitLargeMcb ( - __in PLARGE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG Amount - ); -#endif - -// -// Unsynchronzied base mcb functions. There is one of these for every -// large mcb equivalent function - they are identical other than lack of -// synchronization -// - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlInitializeBaseMcb ( - __in PBASE_MCB Mcb, - __in POOL_TYPE PoolType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_when(!Flags & MCB_FLAG_RAISE_ON_ALLOCATION_FAILURE, __checkReturn) -__drv_maxIRQL(APC_LEVEL) -BOOLEAN -FsRtlInitializeBaseMcbEx ( - __in PBASE_MCB Mcb, - __in POOL_TYPE PoolType, - __in USHORT Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlUninitializeBaseMcb ( - __in PBASE_MCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlResetBaseMcb ( - __in PBASE_MCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlTruncateBaseMcb ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAddBaseMcbEntry ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG Lbn, - __in LONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -FsRtlAddBaseMcbEntryEx ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG Lbn, - __in LONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlRemoveBaseMcbEntry ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupBaseMcbEntry ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn, - __out_opt PLONGLONG Lbn, - __out_opt PLONGLONG SectorCountFromLbn, - __out_opt PLONGLONG StartingLbn, - __out_opt PLONGLONG SectorCountFromStartingLbn, - __out_opt PULONG Index - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLastBaseMcbEntry ( - __in PBASE_MCB Mcb, - __out PLONGLONG Vbn, - __out PLONGLONG Lbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLastBaseMcbEntryAndIndex ( - __in PBASE_MCB OpaqueMcb, - __inout PLONGLONG LargeVbn, - __inout PLONGLONG LargeLbn, - __inout PULONG Index - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -ULONG -FsRtlNumberOfRunsInBaseMcb ( - __in PBASE_MCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlGetNextBaseMcbEntry ( - __in PBASE_MCB Mcb, - __in ULONG RunIndex, - __out PLONGLONG Vbn, - __out PLONGLONG Lbn, - __out PLONGLONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlSplitBaseMcb ( - __in PBASE_MCB Mcb, - __in LONGLONG Vbn, - __in LONGLONG Amount - ); -#endif - - -// -// Mapped Control Blocks routines, implemented in Mcb.c -// -// An MCB is an opaque structure but we need to declare the size of -// it here so that users can allocate space for one. Consequently the -// size computation here must be updated by hand if the MCB changes. -// - -typedef struct _MCB { - LARGE_MCB DummyFieldThatSizesThisStructureCorrectly; -} MCB; -typedef MCB *PMCB; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_preferredFunction(FsRtlInitializeLargeMcb, "Obsolete") -NTKERNELAPI -VOID -FsRtlInitializeMcb ( - __in PMCB Mcb, - __in POOL_TYPE PoolType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlUninitializeMcb ( - __in PMCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlTruncateMcb ( - __in PMCB Mcb, - __in VBN Vbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAddMcbEntry ( - __in PMCB Mcb, - __in VBN Vbn, - __in LBN Lbn, - __in ULONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlRemoveMcbEntry ( - __in PMCB Mcb, - __in VBN Vbn, - __in ULONG SectorCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupMcbEntry ( - __in PMCB Mcb, - __in VBN Vbn, - __out PLBN Lbn, - __out_opt PULONG SectorCount, - __out PULONG Index - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlLookupLastMcbEntry ( - __in PMCB Mcb, - __out PVBN Vbn, - __out PLBN Lbn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -ULONG -FsRtlNumberOfRunsInMcb ( - __in PMCB Mcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlGetNextMcbEntry ( - __in PMCB Mcb, - __in ULONG RunIndex, - __out PVBN Vbn, - __out PLBN Lbn, - __out PULONG SectorCount - ); -#endif - - -// -// Fault Tolerance routines, implemented in FaultTol.c -// -// The routines in this package implement routines that help file -// systems interact with the FT device drivers. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlBalanceReads ( - __in PDEVICE_OBJECT TargetDevice - ); -#endif - - -// -// Oplock routines, implemented in Oplock.c -// -// An OPLOCK is an opaque structure, we declare it as a PVOID and -// allocate the actual memory only when needed. -// - -typedef PVOID OPLOCK, *POPLOCK; - -typedef -VOID -(*POPLOCK_WAIT_COMPLETE_ROUTINE) ( - __in PVOID Context, - __in PIRP Irp - ); - -typedef -VOID -(*POPLOCK_FS_PREPOST_IRP) ( - __in PVOID Context, - __in PIRP Irp - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlInitializeOplock ( - __inout POPLOCK Oplock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlUninitializeOplock ( - __inout POPLOCK Oplock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlOplockFsctrl ( - __in POPLOCK Oplock, - __in PIRP Irp, - __in ULONG OpenCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(CompletionRoutine != NULL, __checkReturn) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlCheckOplock ( - __in POPLOCK Oplock, - __in PIRP Irp, - __in_opt PVOID Context, - __in_opt POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, - __in_opt POPLOCK_FS_PREPOST_IRP PostIrpRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTASP1) -// -// Flags for FsRtlCheckOplockEx. -// - -#define OPLOCK_FLAG_COMPLETE_IF_OPLOCKED 0x00000001 -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -#define OPLOCK_FLAG_OPLOCK_KEY_CHECK_ONLY 0x00000002 -#define OPLOCK_FLAG_BACK_OUT_ATOMIC_OPLOCK 0x00000004 -#define OPLOCK_FLAG_IGNORE_OPLOCK_KEYS 0x00000008 - -// -// Flags for FsRtlOplockFsctrlEx -// - -#define OPLOCK_FSCTRL_FLAG_ALL_KEYS_MATCH 0x00000001 -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTASP1) -__drv_when(Flags | OPLOCK_FLAG_BACK_OUT_ATOMIC_OPLOCK, __checkReturn) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlCheckOplockEx ( - __in POPLOCK Oplock, - __in PIRP Irp, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, - __in_opt POPLOCK_FS_PREPOST_IRP PostIrpRoutine - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlOplockIsFastIoPossible ( - __in POPLOCK Oplock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCurrentBatchOplock ( - __in POPLOCK Oplock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCurrentOplock ( - __in POPLOCK Oplock - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlOplockBreakToNone ( - __inout POPLOCK Oplock, - __in_opt PIO_STACK_LOCATION IrpSp, - __in PIRP Irp, - __in_opt PVOID Context, - __in_opt POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, - __in_opt POPLOCK_FS_PREPOST_IRP PostIrpRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -// -// ECP context for an oplock key. -// - -typedef struct _OPLOCK_KEY_ECP_CONTEXT { - - // - // The caller places a GUID of their own devising here to serve as - // the oplock key. - // - - GUID OplockKey; - - // - // This must be set to zero. - // - - ULONG Reserved; - -} OPLOCK_KEY_ECP_CONTEXT, *POPLOCK_KEY_ECP_CONTEXT; - -// -// The GUID used for the OPLOCK_KEY_ECP_CONTEXT structure. -// -// {48850596-3050-4be7-9863-fec350ce8d7f} -// - -DEFINE_GUID( GUID_ECP_OPLOCK_KEY, 0x48850596, 0x3050, 0x4be7, 0x98, 0x63, 0xfe, 0xc3, 0x50, 0xce, 0x8d, 0x7f ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlOplockIsSharedRequest( - __in PIRP Irp - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlOplockBreakH ( - __in POPLOCK Oplock, - __in PIRP Irp, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, - __in_opt POPLOCK_FS_PREPOST_IRP PostIrpRoutine - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlCurrentOplockH ( - __in POPLOCK Oplock - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlOplockBreakToNoneEx ( - __inout POPLOCK Oplock, - __in PIRP Irp, - __in ULONG Flags, - __in_opt PVOID Context, - __in_opt POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine, - __in_opt POPLOCK_FS_PREPOST_IRP PostIrpRoutine - ); - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlOplockFsctrlEx ( - __in POPLOCK Oplock, - __in PIRP Irp, - __in ULONG OpenCount, - __in ULONG Flags - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlOplockKeysEqual ( - __in_opt PFILE_OBJECT Fo1, - __in_opt PFILE_OBJECT Fo2 - ); -#endif - - - -// -// Volume lock/unlock notification routines, implemented in PnP.c -// -// These routines provide PnP volume lock notification support -// for all filesystems. -// - -#define FSRTL_VOLUME_DISMOUNT 1 -#define FSRTL_VOLUME_DISMOUNT_FAILED 2 -#define FSRTL_VOLUME_LOCK 3 -#define FSRTL_VOLUME_LOCK_FAILED 4 -#define FSRTL_VOLUME_UNLOCK 5 -#define FSRTL_VOLUME_MOUNT 6 -#define FSRTL_VOLUME_NEEDS_CHKDSK 7 -#define FSRTL_VOLUME_WORM_NEAR_FULL 8 -#define FSRTL_VOLUME_WEARING_OUT 9 -#define FSRTL_VOLUME_FORCED_CLOSED 10 -#define FSRTL_VOLUME_INFO_MAKE_COMPAT 11 -#define FSRTL_VOLUME_PREPARING_EJECT 12 -#define FSRTL_VOLUME_CHANGE_SIZE 13 -#define FSRTL_VOLUME_BACKGROUND_FORMAT 14 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlNotifyVolumeEvent ( - __in PFILE_OBJECT FileObject, - __in ULONG EventCode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlNotifyVolumeEventEx ( - __in PFILE_OBJECT FileObject, - __in ULONG EventCode, - __in PTARGET_DEVICE_CUSTOM_NOTIFICATION Event - ); -#endif - - -// -// Notify Change routines, implemented in Notify.c -// -// These routines provide Notify Change support for all filesystems. -// Any of the 'Full' notify routines will support returning the -// change information into the user's buffer. -// - -typedef PVOID PNOTIFY_SYNC; - -typedef -BOOLEAN (*PCHECK_FOR_TRAVERSE_ACCESS) ( - __in PVOID NotifyContext, - __in_opt PVOID TargetContext, - __in PSECURITY_SUBJECT_CONTEXT SubjectContext - ); - -typedef -BOOLEAN (*PFILTER_REPORT_CHANGE) ( - __in PVOID NotifyContext, - __in PVOID FilterContext - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyInitializeSync ( - __in PNOTIFY_SYNC *NotifySync - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyUninitializeSync ( - __in PNOTIFY_SYNC *NotifySync - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyFullChangeDirectory ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList, - __in PVOID FsContext, - __in PSTRING FullDirectoryName, - __in BOOLEAN WatchTree, - __in BOOLEAN IgnoreBuffer, - __in ULONG CompletionFilter, - __in_opt PIRP NotifyIrp, - __in_opt PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyFilterChangeDirectory ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList, - __in PVOID FsContext, - __in PSTRING FullDirectoryName, - __in BOOLEAN WatchTree, - __in BOOLEAN IgnoreBuffer, - __in ULONG CompletionFilter, - __in_opt PIRP NotifyIrp, - __in_opt PCHECK_FOR_TRAVERSE_ACCESS TraverseCallback, - __in_opt PSECURITY_SUBJECT_CONTEXT SubjectContext, - __in_opt PFILTER_REPORT_CHANGE FilterCallback - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyFilterReportChange ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList, - __in PSTRING FullTargetName, - __in USHORT TargetNameOffset, - __in_opt PSTRING StreamName, - __in_opt PSTRING NormalizedParentName, - __in ULONG FilterMatch, - __in ULONG Action, - __in_opt PVOID TargetContext, - __in_opt PVOID FilterContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyFullReportChange ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList, - __in PSTRING FullTargetName, - __in USHORT TargetNameOffset, - __in_opt PSTRING StreamName, - __in_opt PSTRING NormalizedParentName, - __in ULONG FilterMatch, - __in ULONG Action, - __in_opt PVOID TargetContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyCleanup ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList, - __in PVOID FsContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlNotifyCleanupAll ( - __in PNOTIFY_SYNC NotifySync, - __in PLIST_ENTRY NotifyList - ); -#endif - - -// -// Unicode Name support routines, implemented in Name.c -// -// The routines here are used to manipulate unicode names -// - -// -// The following macro is used to determine if a character is wild. -// - -#define FsRtlIsUnicodeCharacterWild(C) ( \ - (((C) >= 0x40) ? FALSE : FlagOn( LEGAL_ANSI_CHARACTER_ARRAY[(C)], \ - FSRTL_WILD_CHARACTER ) ) \ -) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlDissectName ( - __in UNICODE_STRING Path, - __out PUNICODE_STRING FirstName, - __out PUNICODE_STRING RemainingName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlDoesNameContainWildCards ( - __in PUNICODE_STRING Name - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAreNamesEqual ( - __in PCUNICODE_STRING ConstantNameA, - __in PCUNICODE_STRING ConstantNameB, - __in BOOLEAN IgnoreCase, - __in_ecount_opt(0x10000) PCWCH UpcaseTable - ); -#endif - -// begin_ntosp - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsNameInExpression ( - __in PUNICODE_STRING Expression, - __in PUNICODE_STRING Name, - __in BOOLEAN IgnoreCase, - __in_opt PWCH UpcaseTable - ); -#endif - -// end_ntosp - - -// -// Stack Overflow support routine, implemented in StackOvf.c -// - -typedef -VOID -(*PFSRTL_STACK_OVERFLOW_ROUTINE) ( - __in PVOID Context, - __in PKEVENT Event - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FsRtlPostStackOverflow ( - __in PVOID Context, - __in PKEVENT Event, - __in PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FsRtlPostPagingFileStackOverflow ( - __in PVOID Context, - __in PKEVENT Event, - __in PFSRTL_STACK_OVERFLOW_ROUTINE StackOverflowRoutine - ); -#endif - - -// -// UNC Provider support -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Flags passed in to FsRtlRegisterUncProviderEx -// - -#define FSRTL_UNC_PROVIDER_FLAGS_MAILSLOTS_SUPPORTED 0x00000001 -#define FSRTL_UNC_PROVIDER_FLAGS_CSC_ENABLED 0x00000002 -#define FSRTL_UNC_PROVIDER_FLAGS_DOMAIN_SVC_AWARE 0x00000004 - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -FsRtlRegisterUncProviderEx( - __out PHANDLE MupHandle, - __in PUNICODE_STRING RedirDevName, - __in PDEVICE_OBJECT DeviceObject, - __in ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlRegisterUncProvider( - __out PHANDLE MupHandle, - __in PUNICODE_STRING RedirectorDeviceName, - __in BOOLEAN MailslotsSupported - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FsRtlDeregisterUncProvider( - __in HANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -__checkReturn -__drv_when(Irp!=NULL, __drv_maxIRQL(PASSIVE_LEVEL)) -__drv_when(Irp==NULL, __drv_maxIRQL(APC_LEVEL)) -NTKERNELAPI -NTSTATUS -FsRtlCancellableWaitForSingleObject( - __in PVOID Object, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PIRP Irp - ); - -__checkReturn -__drv_when(Irp != NULL, __drv_maxIRQL(PASSIVE_LEVEL)) -__drv_when(Irp == NULL, __drv_maxIRQL(APC_LEVEL)) -NTKERNELAPI -NTSTATUS -FsRtlCancellableWaitForMultipleObjects( - __in ULONG Count, - __in_ecount(Count) PVOID ObjectArray[], - __in WAIT_TYPE WaitType, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PKWAIT_BLOCK WaitBlockArray, - __in_opt PIRP Irp - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// For use by filter drivers to get information on provider corresponding to a given -// fileobject on the remote filesystem stack. Without this, filters will always end up -// getting \Device\Mup for providers registering with FsRtlRegisterUncProviderEx(). -// - - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlMupGetProviderInfoFromFileObject( - __in PFILE_OBJECT pFileObject, - __in ULONG Level, - __out_bcount(*pBufferSize) PVOID pBuffer, - __inout PULONG pBufferSize - ); - -// -// Format of output in pBuffer. -// - -// -// Level 1. -// - - -typedef struct _FSRTL_MUP_PROVIDER_INFO_LEVEL_1 { - ULONG32 ProviderId; // ID for quick comparison, stable across provider load/unload. - -} FSRTL_MUP_PROVIDER_INFO_LEVEL_1, *PFSRTL_MUP_PROVIDER_INFO_LEVEL_1; - -typedef struct _FSRTL_MUP_PROVIDER_INFO_LEVEL_2 { - ULONG32 ProviderId; // ID for quick comparison, stable across provider load/unload. - UNICODE_STRING ProviderName; // Device name of provider. - -} FSRTL_MUP_PROVIDER_INFO_LEVEL_2, *PFSRTL_MUP_PROVIDER_INFO_LEVEL_2; - - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlMupGetProviderIdFromName( - __in PUNICODE_STRING pProviderName, - __out PULONG32 pProviderId - ); - - -#endif - - - -// -// File System Filter PerFile Context Support -// - -// -// Filesystem filter drivers use these APIs to associate context -// with open files (for filesystems that support this). -// - -// -// OwnerId should uniquely identify a particular filter driver -// (e.g. the address of the driver's device object). -// InstanceId can be used to distinguish distinct contexts associated -// by a filter driver with a single file -// - -// -// This structure needs to be embedded within the users context that -// they want to associate with a given file -// - -typedef struct _FSRTL_PER_FILE_CONTEXT { - // - // This is linked into the FileContext list maintained by the - // kernel - // - - LIST_ENTRY Links; - - // - // A Unique ID for this filter (ex: address of Driver Object, Device - // Object, or Device Extension) - // - - PVOID OwnerId; - - // - // An optional ID to differentiate different contexts for the same - // filter. - // - - PVOID InstanceId; - - // - // A callback routine which is called by the underlying file system - // when the per-file structure is being torn down. When this routine is called - // the given context has already been removed from the context linked - // list. The callback routine cannot recursively call down into the - // filesystem or acquire any of their resources which they might hold - // when calling the filesystem outside of the callback. This must - // be defined. - // - - PFREE_FUNCTION FreeCallback; - -} FSRTL_PER_FILE_CONTEXT, *PFSRTL_PER_FILE_CONTEXT; - - -// -// This will initialize the given FSRTL_PER_FILE_CONTEXT structure. This -// should be used before calling "FsRtlInsertPerFileContext". -// - -#define FsRtlInitPerFileContext( _fc, _owner, _inst, _cb) \ - ((_fc)->OwnerId = (_owner), \ - (_fc)->InstanceId = (_inst), \ - (_fc)->FreeCallback = (_cb)) - -// -// Given a FileObject this will return the FileContext pointer that -// needs to be passed into the other FsRtl PerFile Context routines. -// If the file system does not support filter file contexts then -// NULL is returned -// - -#define FsRtlGetPerFileContextPointer(_fo) \ - (FsRtlSupportsPerFileContexts(_fo) ? \ - FsRtlGetPerStreamContextPointer(_fo)->FileContextSupportPointer : \ - NULL) - -// -// This will test to see if PerFile contexts are supported for the given -// FileObject -// - -#define FsRtlSupportsPerFileContexts(_fo) \ - ((FsRtlGetPerStreamContextPointer(_fo) != NULL) && \ - (FsRtlGetPerStreamContextPointer(_fo)->Version >= FSRTL_FCB_HEADER_V1) && \ - (FsRtlGetPerStreamContextPointer(_fo)->FileContextSupportPointer != NULL)) - - -// -// Associate the context at Ptr with the given file. The Ptr structure -// should be filled in by the caller before calling this routine (see -// FsRtlInitPerFileContext). If the underlying filesystem does not support -// filter file contexts, STATUS_INVALID_DEVICE_REQUEST will be returned. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlInsertPerFileContext ( - __in PVOID* PerFileContextPointer, - __in PFSRTL_PER_FILE_CONTEXT Ptr - ); - -// -// Lookup a filter context associated with the file specified. The first -// context matching OwnerId (and InstanceId, if present) is returned. By not -// specifying InstanceId, a filter driver can search for any context that it -// has previously associated with a stream. If no matching context is found, -// NULL is returned. If the file system does not support filter contexts, -// NULL is returned. -// - - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_FILE_CONTEXT -FsRtlLookupPerFileContext ( - __in PVOID* PerFileContextPointer, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); - - -// -// Normally, contexts should be deleted when the file system notifies the -// filter that the file is being closed. There are cases when a filter -// may want to remove all existing contexts for a specific volume. This -// routine should be called at those times. This routine should NOT be -// called for the following cases: -// - Inside your FreeCallback handler - The underlying file system has -// already removed it from the linked list). -// - Inside your IRP_CLOSE handler - If you do this then you will not -// be notified when the stream is torn down. -// -// This functions identically to FsRtlLookupPerFileContext, except that the -// returned context has been removed from the list. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_FILE_CONTEXT -FsRtlRemovePerFileContext ( - __in PVOID* PerFileContextPointer, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); - - -// -// APIs for file systems to use for initializing and cleaning up -// the Advaned FCB Header fields for PerStreamContext and -// PerFileContext support -// - -// -// This will properly initialize the advanced header so that it can be -// used with PerStream contexts and PerFile contexts. -// Note: A fast mutex must be placed in an advanced header. It is the -// caller's responsibility to properly create and initialize this -// mutex before calling this macro. The mutex field is only set -// if a non-NULL value is passed in. -// If the file system supports filter file contexts then it must -// initialize the FileContextSupportPointer field to point to a PVOID -// embedded in its per-file structure (FCB). If a NULL is passed in, -// then the macro assumes that the file system does not support filter -// file contexts -// - -#define FsRtlSetupAdvancedHeaderEx( _advhdr, _fmutx, _fctxptr ) \ -{ \ - FsRtlSetupAdvancedHeader( _advhdr, _fmutx ); \ - if ((_fctxptr) != NULL) { \ - (_advhdr)->FileContextSupportPointer = (_fctxptr); \ - } \ -} - -// -// File systems call this API to free any filter contexts still associated -// with a per-file structure (FCB) that they are tearing down. -// The FreeCallback routine for each filter context will be called. -// - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlTeardownPerFileContexts ( - __in PVOID* PerFileContextPointer - ); - - -// -// File System Filter PerStream Context Support -// - -// -// Filesystem filter drivers use these APIs to associate context -// with open streams (for filesystems that support this). -// - -// -// OwnerId should uniquely identify a particular filter driver -// (e.g. the address of the driver's device object). -// InstanceId can be used to distinguish distinct contexts associated -// by a filter driver with a single stream (e.g. the address of the -// PerStream Context structure). -// - -// -// This structure needs to be embedded within the users context that -// they want to associate with a given stream -// - -typedef struct _FSRTL_PER_STREAM_CONTEXT { - // - // This is linked into the StreamContext list inside the - // FSRTL_ADVANCED_FCB_HEADER structure. - // - - LIST_ENTRY Links; - - // - // A Unique ID for this filter (ex: address of Driver Object, Device - // Object, or Device Extension) - // - - PVOID OwnerId; - - // - // An optional ID to differentiate different contexts for the same - // filter. - // - - PVOID InstanceId; - - // - // A callback routine which is called by the underlying file system - // when the stream is being torn down. When this routine is called - // the given context has already been removed from the context linked - // list. The callback routine cannot recursively call down into the - // filesystem or acquire any of their resources which they might hold - // when calling the filesystem outside of the callback. This must - // be defined. - // - - PFREE_FUNCTION FreeCallback; - -} FSRTL_PER_STREAM_CONTEXT, *PFSRTL_PER_STREAM_CONTEXT; - - -// -// This will initialize the given FSRTL_PER_STREAM_CONTEXT structure. This -// should be used before calling "FsRtlInsertPerStreamContext". -// - -#define FsRtlInitPerStreamContext( _fc, _owner, _inst, _cb) \ - ((_fc)->OwnerId = (_owner), \ - (_fc)->InstanceId = (_inst), \ - (_fc)->FreeCallback = (_cb)) - -// -// Given a FileObject this will return the StreamContext pointer that -// needs to be passed into the other FsRtl PerStream Context routines. -// - -#define FsRtlGetPerStreamContextPointer(_fo) \ - ((PFSRTL_ADVANCED_FCB_HEADER)((_fo)->FsContext)) - -// -// This will test to see if PerStream contexts are supported for the given -// FileObject -// - -#define FsRtlSupportsPerStreamContexts(_fo) \ - ((NULL != FsRtlGetPerStreamContextPointer(_fo)) && \ - FlagOn(FsRtlGetPerStreamContextPointer(_fo)->Flags2, \ - FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS)) - -// -// Associate the context at Ptr with the given stream. The Ptr structure -// should be filled in by the caller before calling this routine (see -// FsRtlInitPerStreamContext). If the underlying filesystem does not support -// filter contexts, STATUS_INVALID_DEVICE_REQUEST will be returned. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlInsertPerStreamContext ( - __in PFSRTL_ADVANCED_FCB_HEADER PerStreamContext, - __in PFSRTL_PER_STREAM_CONTEXT Ptr - ); -#endif - -// -// Lookup a filter context associated with the stream specified. The first -// context matching OwnerId (and InstanceId, if present) is returned. By not -// specifying InstanceId, a filter driver can search for any context that it -// has previously associated with a stream. If no matching context is found, -// NULL is returned. If the file system does not support filter contexts, -// NULL is returned. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_STREAM_CONTEXT -FsRtlLookupPerStreamContextInternal ( - __in PFSRTL_ADVANCED_FCB_HEADER StreamContext, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); -#endif - -#define FsRtlLookupPerStreamContext(_sc, _oid, _iid) \ - (((NULL != (_sc)) && \ - FlagOn((_sc)->Flags2,FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS) && \ - !IsListEmpty(&(_sc)->FilterContexts)) ? \ - FsRtlLookupPerStreamContextInternal((_sc), (_oid), (_iid)) : \ - NULL) - -// -// Normally, contexts should be deleted when the file system notifies the -// filter that the stream is being closed. There are cases when a filter -// may want to remove all existing contexts for a specific volume. This -// routine should be called at those times. This routine should NOT be -// called for the following cases: -// - Inside your FreeCallback handler - The underlying file system has -// already removed it from the linked list). -// - Inside your IRP_CLOSE handler - If you do this then you will not -// be notified when the stream is torn down. -// -// This functions identically to FsRtlLookupPerStreamContext, except that the -// returned context has been removed from the list. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_STREAM_CONTEXT -FsRtlRemovePerStreamContext ( - __in PFSRTL_ADVANCED_FCB_HEADER StreamContext, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); -#endif - - -// -// APIs for file systems to use for initializing and cleaning up -// the Advaned FCB Header fields for PerStreamContext support -// - -// -// This will properly initialize the advanced header so that it can be -// used with PerStream contexts. -// Note: A fast mutex must be placed in an advanced header. It is the -// caller's responsibility to properly create and initialize this -// mutex before calling this macro. The mutex field is only set -// if a non-NULL value is passed in. -// - -__drv_maxIRQL(APC_LEVEL) -VOID -FORCEINLINE -FsRtlSetupAdvancedHeader( - __in PVOID AdvHdr, - __in PFAST_MUTEX FMutex ) - -/* - The AdvHdr parameter should have a type of PFSRTL_ADVANCED_FCB_HEADER but - I had to make it a PVOID because there are cases where this routine is - called where a different type is passed in (where the advanced header - is at the front of this other type). This routine used to be a macro and - I changed it to an INLINE so we could put the NTDDI_VERSION conditional into - it. To maintain compatiblity I made the AdvHdr parameter a PVOID and cast - it to the correct type internally. -*/ - -{ - PFSRTL_ADVANCED_FCB_HEADER localAdvHdr = (PFSRTL_ADVANCED_FCB_HEADER)AdvHdr; - - localAdvHdr->Flags |= FSRTL_FLAG_ADVANCED_HEADER; - localAdvHdr->Flags2 |= FSRTL_FLAG2_SUPPORTS_FILTER_CONTEXTS; - -#if (NTDDI_VERSION >= NTDDI_VISTA) - localAdvHdr->Version = FSRTL_FCB_HEADER_V1; -#else - localAdvHdr->Version = FSRTL_FCB_HEADER_V0; -#endif - - InitializeListHead( &localAdvHdr->FilterContexts ); - - if (FMutex != NULL) { - - localAdvHdr->FastMutex = FMutex; - } - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// API not avaialble down level -// We want to support a driver compiled to the last version running downlevel, -// so continue to use use the direct init of the push lock and not call -// ExInitializePushLock. -// - - *((PULONG_PTR)(&localAdvHdr->PushLock)) = 0; - /*ExInitializePushLock( &localAdvHdr->PushLock ); API not avaialble down level*/ - - localAdvHdr->FileContextSupportPointer = NULL; -#endif -} - - -// -// File systems call this API to free any filter contexts still associated -// with an FSRTL_COMMON_FCB_HEADER that they are tearing down. -// The FreeCallback routine for each filter context will be called. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlTeardownPerStreamContexts ( - __in PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader - ); - -// -// Function pointer to above routine for modules that need to dynamically import -// - -typedef VOID (*PFN_FSRTLTEARDOWNPERSTREAMCONTEXTS) (__in PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader); -#endif - -// -// File System Filter PerFileObject Context Support -// - -// -// Filesystem filter drivers use these APIs to associate context -// with individual open files. For now these are only supported on file -// objects with a FileObject extension which are only created by using -// IoCreateFileSpecifyDeviceObjectHint. -// - -// -// OwnerId should uniquely identify a particular filter driver -// (e.g. the address of the driver's device object). -// InstanceId can be used to distinguish distinct contexts associated -// by a filter driver with a single stream (e.g. the address of the -// fileobject). -// - -// -// This structure needs to be embedded within the users context that -// they want to associate with a given stream -// - -typedef struct _FSRTL_PER_FILEOBJECT_CONTEXT { - // - // This is linked into the File Object - // - - LIST_ENTRY Links; - - // - // A Unique ID for this filter (ex: address of Driver Object, Device - // Object, or Device Extension) - // - - PVOID OwnerId; - - // - // An optional ID to differentiate different contexts for the same - // filter. - // - - PVOID InstanceId; - -} FSRTL_PER_FILEOBJECT_CONTEXT, *PFSRTL_PER_FILEOBJECT_CONTEXT; - - -// -// This will initialize the given FSRTL_PER_FILEOBJECT_CONTEXT structure. This -// should be used before calling "FsRtlInsertPerFileObjectContext". -// - -#define FsRtlInitPerFileObjectContext( _fc, _owner, _inst ) \ - ((_fc)->OwnerId = (_owner), \ - (_fc)->InstanceId = (_inst)) \ - -// -// Associate the context at Ptr with the given FileObject. The Ptr -// structure should be filled in by the caller before calling this -// routine (see FsRtlInitPerFileObjectContext). If this file object does not -// support filter contexts, STATUS_INVALID_DEVICE_REQUEST will be returned. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlInsertPerFileObjectContext ( - __in PFILE_OBJECT FileObject, - __in PFSRTL_PER_FILEOBJECT_CONTEXT Ptr - ); - -// -// Lookup a filter context associated with the FileObject specified. The first -// context matching OwnerId (and InstanceId, if present) is returned. By not -// specifying InstanceId, a filter driver can search for any context that it -// has previously associated with a stream. If no matching context is found, -// NULL is returned. If the FileObject does not support contexts, -// NULL is returned. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_FILEOBJECT_CONTEXT -FsRtlLookupPerFileObjectContext ( - __in PFILE_OBJECT FileObject, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); - -// -// Normally, contexts should be deleted when the IoManager notifies the -// filter that the FileObject is being freed. There are cases when a filter -// may want to remove all existing contexts for a specific volume. This -// routine should be called at those times. This routine should NOT be -// called for the following case: -// - Inside your FreeCallback handler - The IoManager has already removed -// it from the linked list. -// -// This functions identically to FsRtlLookupPerFileObjectContext, except that -// the returned context has been removed from the list. -// - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PFSRTL_PER_FILEOBJECT_CONTEXT -FsRtlRemovePerFileObjectContext ( - __in PFILE_OBJECT FileObject, - __in_opt PVOID OwnerId, - __in_opt PVOID InstanceId - ); - -//++ -// -// VOID -// FsRtlCompleteRequest ( -// __in PIRP Irp, -// __in NTSTATUS Status -// ); -// -// Routine Description: -// -// This routine is used to complete an IRP with the indicated -// status. It does the necessary raise and lower of IRQL. -// -// Arguments: -// -// Irp - Supplies a pointer to the Irp to complete -// -// Status - Supplies the completion status for the Irp -// -// Return Value: -// -// None. -// -//-- - -#define FsRtlCompleteRequest(IRP,STATUS) { \ - (IRP)->IoStatus.Status = (STATUS); \ - IoCompleteRequest( (IRP), IO_DISK_INCREMENT ); \ -} - - -//++ -// -// VOID -// FsRtlEnterFileSystem ( -// ); -// -// Routine Description: -// -// This routine is used when entering a file system (e.g., through its -// Fsd entry point). It ensures that the file system cannot be suspended -// while running and thus block other file I/O requests. Upon exit -// the file system must call FsRtlExitFileSystem. -// -// Arguments: -// -// Return Value: -// -// None. -// -//-- - -#define FsRtlEnterFileSystem() { \ - KeEnterCriticalRegion(); \ -} - -//++ -// -// VOID -// FsRtlExitFileSystem ( -// ); -// -// Routine Description: -// -// This routine is used when exiting a file system (e.g., through its -// Fsd entry point). -// -// Arguments: -// -// Return Value: -// -// None. -// -//-- - -#define FsRtlExitFileSystem() { \ - KeLeaveCriticalRegion(); \ -} - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FsRtlIncrementCcFastReadNotPossible( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FsRtlIncrementCcFastReadWait( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FsRtlIncrementCcFastReadNoWait( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -FsRtlIncrementCcFastReadResourceMiss( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -FsRtlIncrementCcFastMdlReadWait( - VOID - ); -#endif - -// -// Returns TRUE if the given fileObject represents a paging file, returns -// FALSE otherwise. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -LOGICAL -FsRtlIsPagingFile ( - __in PFILE_OBJECT FileObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -// -// This routine is available on: -// * Windows 2000 SP4 plus URP -// * Windows XP SP2 plus QFE ? -// * Windows Server 2003 SP1 -// -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlCreateSectionForDataScan( - __out PHANDLE SectionHandle, - __deref_out PVOID *SectionObject, - __out_opt PLARGE_INTEGER SectionFileSize, - __in PFILE_OBJECT FileObject, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PLARGE_INTEGER MaximumSize, - __in ULONG SectionPageProtection, - __in ULONG AllocationAttributes, - __in ULONG Flags - ); -#endif - -// -// Reparse Routines -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlValidateReparsePointBuffer ( - __in ULONG BufferLength, - __in_bcount(BufferLength) PREPARSE_DATA_BUFFER ReparseBuffer -); - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlRemoveDotsFromPath( - __inout_bcount(PathLength) PWSTR OriginalString, - __in USHORT PathLength, - __out USHORT *NewLength -); -#endif - -// begin_ntosp -////////////////////////////////////////////////////////////////////////// -// -// Extra Create Parameter Support routines -// -// These routines are used when processing a create IRP to allow passing -// extra information up and down the file system stack. This is used by -// file system filters, Client Side Encryption, Transactions etc. -// -////////////////////////////////////////////////////////////////////////// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _ECP_LIST ECP_LIST; -typedef struct _ECP_LIST *PECP_LIST; -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -typedef struct _ECP_HEADER ECP_HEADER; -typedef struct _ECP_HEADER *PECP_HEADER; -#endif - -// -// Prototype for the ECP cleanup routine callback -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef VOID -(*PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK) ( - __inout PVOID EcpContext, - __in LPCGUID EcpType - ); -#endif - - - -// -// Basic ECP functions -// - -// -// Flags used by FsRtlAllocateExtraCreateParameterList -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef ULONG FSRTL_ALLOCATE_ECPLIST_FLAGS; - - // - // Charge this memory against the quota of the current process - // - - #define FSRTL_ALLOCATE_ECPLIST_FLAG_CHARGE_QUOTA 0x00000001 -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlAllocateExtraCreateParameterList ( - __in FSRTL_ALLOCATE_ECPLIST_FLAGS Flags, - __deref_out PECP_LIST *EcpList - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlFreeExtraCreateParameterList ( - __in PECP_LIST EcpList - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -NTSTATUS -FsRtlInitializeExtraCreateParameterList ( - __inout PECP_LIST EcpList - ); -#endif - -// -// Flags used by FsRtlAllocateExtraCreateParameter -// and FsRtlAllocateExtraCreateParameterFromLookasideList -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef ULONG FSRTL_ALLOCATE_ECP_FLAGS; - - // - // If set charage quota against the current process for this - // allocation. This flag is ignored if using a lookaside list - // - - #define FSRTL_ALLOCATE_ECP_FLAG_CHARGE_QUOTA 0x00000001 - - // - // If set allocate the ECP from non-paged pool - // Else use paged pool - // - - #define FSRTL_ALLOCATE_ECP_FLAG_NONPAGED_POOL 0x00000002 -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlAllocateExtraCreateParameter ( - __in LPCGUID EcpType, - __in ULONG SizeOfContext, - __in FSRTL_ALLOCATE_ECP_FLAGS Flags, - __in_opt PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback, - __in ULONG PoolTag, - __deref_out_bcount(SizeOfContext) PVOID *EcpContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlFreeExtraCreateParameter ( - __in PVOID EcpContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -FsRtlInitializeExtraCreateParameter( - __in PECP_HEADER Ecp, - __in ULONG EcpFlags, - __in_opt PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback, - __in ULONG TotalSize, - __in LPCGUID EcpType, - __in_opt PVOID ListAllocatedFrom - ); -#endif - -// -// Flags used by FsRtlInitExtraCreateParameterLookasideList -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef ULONG FSRTL_ECP_LOOKASIDE_FLAGS; - - // - // If set this is a NON-PAGED lookaside list - // ELSE this is a PAGED lookaside list - // - - #define FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL 0x00000002 -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_when(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(!(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL), __drv_maxIRQL(APC_LEVEL)) -NTKERNELAPI -VOID -FsRtlInitExtraCreateParameterLookasideList ( - __inout PVOID Lookaside, - __in FSRTL_ECP_LOOKASIDE_FLAGS Flags, - __in SIZE_T Size, - __in ULONG Tag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_when(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(!(Flags|FSRTL_ECP_LOOKASIDE_FLAG_NONPAGED_POOL), __drv_maxIRQL(APC_LEVEL)) -VOID -FsRtlDeleteExtraCreateParameterLookasideList ( - __inout PVOID Lookaside, - __in FSRTL_ECP_LOOKASIDE_FLAGS Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlAllocateExtraCreateParameterFromLookasideList ( - __in LPCGUID EcpType, - __in_bound ULONG SizeOfContext, - __in FSRTL_ALLOCATE_ECP_FLAGS Flags, - __in_opt PFSRTL_EXTRA_CREATE_PARAMETER_CLEANUP_CALLBACK CleanupCallback, - __inout PVOID LookasideList, - __deref_out PVOID *EcpContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlInsertExtraCreateParameter ( - __inout PECP_LIST EcpList, - __inout PVOID EcpContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlFindExtraCreateParameter ( - __in PECP_LIST EcpList, - __in LPCGUID EcpType, - __deref_opt_out PVOID *EcpContext, - __out_opt ULONG *EcpContextSize - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlRemoveExtraCreateParameter ( - __inout PECP_LIST EcpList, - __in LPCGUID EcpType, - __deref_out PVOID *EcpContext, - __out_opt ULONG *EcpContextSize - ); -#endif - -// -// Functions to get and set Extra Create Parameters into/out of a create IRP -// - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlGetEcpListFromIrp ( - __in PIRP Irp, - __deref_out_opt PECP_LIST *EcpList - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlSetEcpListIntoIrp ( - __inout PIRP Irp, - __in PECP_LIST EcpList - ); -#endif - - -// -// Additional functions used for full functionality -// - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlGetNextExtraCreateParameter ( - __in PECP_LIST EcpList, - __in_opt PVOID CurrentEcpContext, - __out_opt LPGUID NextEcpType, - __deref_opt_out PVOID *NextEcpContext, - __out_opt ULONG *NextEcpContextSize - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FsRtlAcknowledgeEcp ( - __in PVOID EcpContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsEcpAcknowledged ( - __in PVOID EcpContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlIsEcpFromUserMode ( - __in PVOID EcpContext - ); -#endif - -// end_ntosp - -////////////////////////////////////////////////////////////////////////////// -// -// This contains public ECP definitions -// -////////////////////////////////////////////////////////////////////////////// - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Start of NETWORK_OPEN_ECP_CONTEXT structures and definitions. -// This ECP can be used as a way to pass extra information at create time -// to network redirectors. -// - -typedef enum { - - NetworkOpenLocationAny, // No restrictions. - NetworkOpenLocationRemote, // Restrict to remote only. - NetworkOpenLocationLoopback // Restrict to local-machine only. - -} NETWORK_OPEN_LOCATION_QUALIFIER; - - -typedef enum { - - NetworkOpenIntegrityAny, // No restrictions on signing/encryption etc. - NetworkOpenIntegrityNone, // No signing/encryption. - NetworkOpenIntegritySigned, // Signed end to end. - NetworkOpenIntegrityEncrypted, // encrypted end-end. - NetworkOpenIntegrityMaximum // Best available. - -} NETWORK_OPEN_INTEGRITY_QUALIFIER; - - - - -// -// ECP context for network create parameters. -// - - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -// -// Below we have the structures and definitions for Win7 -// - -// in flags. - -#define NETWORK_OPEN_ECP_IN_FLAG_DISABLE_HANDLE_COLLAPSING 0x1 -#define NETWORK_OPEN_ECP_IN_FLAG_DISABLE_HANDLE_DURABILITY 0x2 -#define NETWORK_OPEN_ECP_IN_FLAG_FORCE_BUFFERED_SYNCHRONOUS_IO_HACK 0x80000000 - -typedef struct _NETWORK_OPEN_ECP_CONTEXT { - - USHORT Size; // Must be set to the size of this structure. - USHORT Reserved; // Must be set to zero. - - struct { - - // - // Pre-create restrictions - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - ULONG Flags; - - } in; - - // - // Post create information returned to the caller. - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - ULONG Flags; - - } out; - - } DUMMYSTRUCTNAME; - -} NETWORK_OPEN_ECP_CONTEXT, *PNETWORK_OPEN_ECP_CONTEXT; - -// -// This version of the NETWORK_OPEN_ECP_CONTEXT was used on -// Windows Vista. Drivers interpreting "Network ECP Contexts" on -// Vista OSes should use this version. -// - -typedef struct _NETWORK_OPEN_ECP_CONTEXT_V0 { - - USHORT Size; // Must be set to the size of this structure. - USHORT Reserved; // Must be set to zero. - - struct { - - // - // Pre-create restrictions - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - - } in; - - // - // Post create information returned to the caller. - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - - } out; - - } DUMMYSTRUCTNAME; - -} NETWORK_OPEN_ECP_CONTEXT_V0, *PNETWORK_OPEN_ECP_CONTEXT_V0; - -#elif (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Here is the definition of Network Open ECP for native Vista Drivers. -// - -typedef struct _NETWORK_OPEN_ECP_CONTEXT { - - USHORT Size; // Must be set to the size of this structure. - USHORT Reserved; // Must be set to zero. - - struct { - - // - // Pre-create restrictions - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - - } in; - - // - // Post create information returned to the caller. - // - - struct { - - NETWORK_OPEN_LOCATION_QUALIFIER Location; - NETWORK_OPEN_INTEGRITY_QUALIFIER Integrity; - - } out; - - } DUMMYSTRUCTNAME; - -} NETWORK_OPEN_ECP_CONTEXT, *PNETWORK_OPEN_ECP_CONTEXT; -#endif - -// -// The GUID used for the NETWORK_OPEN_ECP_CONTEXT structure -// - -DEFINE_GUID( GUID_ECP_NETWORK_OPEN_CONTEXT, 0xc584edbf, 0x00df, 0x4d28, 0xb8, 0x84, 0x35, 0xba, 0xca, 0x89, 0x11, 0xe8 ); - -// -// End NETWORK_OPEN_ECP_CONTEXT definitions -// - -#endif //(NTDDI_VERSION >= NTDDI_VISTA) - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Start of PREFETCH_OPEN_ECP_CONTEXT structures and definitions. -// This ECP is used to communicate the fact that a given open request is done -// by the prefetcher. -// - -// -// ECP structure for prefetcher opens. -// - -typedef struct _PREFETCH_OPEN_ECP_CONTEXT { - - PVOID Context; // Opaque context associated with the open. - -} PREFETCH_OPEN_ECP_CONTEXT, *PPREFETCH_OPEN_ECP_CONTEXT; - -// -// The GUID used for the PREFETCH_OPEN_ECP_CONTEXT structure -// - -DEFINE_GUID( GUID_ECP_PREFETCH_OPEN, 0xe1777b21, 0x847e, 0x4837, 0xaa, 0x45, 0x64, 0x16, 0x1d, 0x28, 0x6, 0x55 ); - -// -// End PREFETCH_OPEN_ECP_CONTEXT definitions -// - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -// -// The type GUID and structure for NFS (Network File System) extra create parameters -// -// -// {f326d30c-e5f8-4fe7-ab74-f5a3196d92db} -// - -typedef struct sockaddr_storage *PSOCKADDR_STORAGE_NFS; - - -DEFINE_GUID (GUID_ECP_NFS_OPEN, - 0xf326d30c, - 0xe5f8, - 0x4fe7, - 0xab, 0x74, 0xf5, 0xa3, 0x19, 0x6d, 0x92, 0xdb); - - -typedef struct _NFS_OPEN_ECP_CONTEXT { - - // - // Export alias (share name) for the create with type PUNICODE_STRING. This is a - // hint and may be a name, NULL or zero length string - // - PUNICODE_STRING ExportAlias; - - - // - // Socket address of client - // - PSOCKADDR_STORAGE_NFS ClientSocketAddress; - -} NFS_OPEN_ECP_CONTEXT, *PNFS_OPEN_ECP_CONTEXT, **PPNFS_OPEN_ECP_CONTEXT; - -// -// ECP context for SRV create parameters. -// - -// -// The GUID used for the SRV_OPEN_ECP_CONTEXT structure -// {BEBFAEBC-AABF-489d-9D2C-E9E361102853} -// -//typedef struct sockaddr_storage *PSOCKADDR_STORAGE_SMB; - -DEFINE_GUID( GUID_ECP_SRV_OPEN, - 0xbebfaebc, - 0xaabf, - 0x489d, - 0x9d, 0x2c, 0xe9, 0xe3, 0x61, 0x10, 0x28, 0x53 ); - -typedef struct _SRV_OPEN_ECP_CONTEXT { - - // - // Share name for the create with type PUNICODE_STRING - // - - PUNICODE_STRING ShareName; - - // - // Socket address of client - // - - PSOCKADDR_STORAGE_NFS SocketAddress; - - // - // Oplock state of open (for SMB/SMB2 oplock breaking logic) - // - - BOOLEAN OplockBlockState; - BOOLEAN OplockAppState; - BOOLEAN OplockFinalState; - -} SRV_OPEN_ECP_CONTEXT, *PSRV_OPEN_ECP_CONTEXT; - -// -// End SRV_OPEN_ECP_CONTEXT definitions -// - -#endif //(NTDDI_VERSION >= NTDDI_WIN7) - - - -// -// This routine allows the caller to change the referenced file object that -// is pointed to by either: -// - One of Mm's image control areas for this stream -// - Mm's data control area for this stream -// - Cc's shared cache map for this stream -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef enum _FSRTL_CHANGE_BACKING_TYPE { - - ChangeDataControlArea, - ChangeImageControlArea, - ChangeSharedCacheMap - -} FSRTL_CHANGE_BACKING_TYPE, *PFSRTL_CHANGE_BACKING_TYPE; - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlChangeBackingFileObject ( - __in_opt PFILE_OBJECT CurrentFileObject, - __in PFILE_OBJECT NewFileObject, - __in FSRTL_CHANGE_BACKING_TYPE ChangeBackingType, - __in ULONG Flags //reserved, must be zero - ); - -#endif - -// -// Flags for FsRtlLogCcFlushError -// - -#define FSRTL_CC_FLUSH_ERROR_FLAG_NO_HARD_ERROR 0x1 -#define FSRTL_CC_FLUSH_ERROR_FLAG_NO_LOG_ENTRY 0x2 - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -FsRtlLogCcFlushError( - __in PUNICODE_STRING FileName, - __in PDEVICE_OBJECT DeviceObject, - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in NTSTATUS FlushError, - __in ULONG Flags - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Routine to query whether volume startup application such as autochk -// have completed. -// - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -FsRtlAreVolumeStartupApplicationsComplete( - VOID - ); - -#endif - -// begin_ntosp - -#if (NTDDI_VERSION > NTDDI_VISTA) - -// -// Routine to query maximum depth of virtual disk layering support. -// - -NTKERNELAPI -ULONG -FsRtlQueryMaximumVirtualDiskNestingLevel ( - VOID - ); - -// -// Routine to query virtual disk info for a given disk or volume object -// - -NTKERNELAPI -NTSTATUS -FsRtlGetVirtualDiskNestingLevel ( - __in PDEVICE_OBJECT DeviceObject, - __out PULONG NestingLevel, - __out_opt PULONG NestingFlags - ); - -// -// Current possible values for NestingFlags. -// - -#define FSRTL_VIRTDISK_FULLY_ALLOCATED 0x00000001 -#define FSRTL_VIRTDISK_NO_DRIVE_LETTER 0x00000002 - -#endif - -// -// Define two constants describing the view size (and alignment) -// that the Cache Manager uses to map files. -// - -#define VACB_MAPPING_GRANULARITY (0x40000) -#define VACB_OFFSET_SHIFT (18) - -// -// Public portion of BCB -// - -typedef struct _PUBLIC_BCB { - - // - // Type and size of this record - // - // NOTE: The first four fields must be the same as the BCB in cc.h. - // - - CSHORT NodeTypeCode; - CSHORT NodeByteSize; - - // - // Description of range of file which is currently mapped. - // - - ULONG MappedLength; - LARGE_INTEGER MappedFileOffset; -} PUBLIC_BCB, *PPUBLIC_BCB; - -// -// File Sizes structure. -// - -typedef struct _CC_FILE_SIZES { - - LARGE_INTEGER AllocationSize; - LARGE_INTEGER FileSize; - LARGE_INTEGER ValidDataLength; - -} CC_FILE_SIZES, *PCC_FILE_SIZES; - -// -// Define a Cache Manager callback structure. These routines are required -// by the Lazy Writer, so that it can acquire resources in the right order -// to avoid deadlocks. Note that otherwise you would have most FS requests -// acquiring FS resources first and caching structures second, while the -// Lazy Writer needs to acquire its own resources first, and then FS -// structures later as it calls the file system. -// - -// -// First define the procedure pointer typedefs -// - -// -// This routine is called by the Lazy Writer prior to doing a write, -// since this will require some file system resources associated with -// this cached file. The context parameter supplied is whatever the FS -// passed as the LazyWriteContext parameter when is called -// CcInitializeCacheMap. -// - -typedef -BOOLEAN (*PACQUIRE_FOR_LAZY_WRITE) ( - __in PVOID Context, - __in BOOLEAN Wait - ); - -// -// This routine releases the Context acquired above. -// - -typedef -VOID (*PRELEASE_FROM_LAZY_WRITE) ( - __in PVOID Context - ); - -// -// This routine is called by the Lazy Writer prior to doing a readahead. -// - -typedef -BOOLEAN (*PACQUIRE_FOR_READ_AHEAD) ( - __in PVOID Context, - __in BOOLEAN Wait - ); - -// -// This routine releases the Context acquired above. -// - -typedef -VOID (*PRELEASE_FROM_READ_AHEAD) ( - __in PVOID Context - ); - -typedef struct _CACHE_MANAGER_CALLBACKS { - - PACQUIRE_FOR_LAZY_WRITE AcquireForLazyWrite; - PRELEASE_FROM_LAZY_WRITE ReleaseFromLazyWrite; - PACQUIRE_FOR_READ_AHEAD AcquireForReadAhead; - PRELEASE_FROM_READ_AHEAD ReleaseFromReadAhead; - -} CACHE_MANAGER_CALLBACKS, *PCACHE_MANAGER_CALLBACKS; - -// -// This structure is passed into CcUninitializeCacheMap -// if the caller wants to know when the cache map is deleted. -// - -typedef struct _CACHE_UNINITIALIZE_EVENT { - struct _CACHE_UNINITIALIZE_EVENT *Next; - KEVENT Event; -} CACHE_UNINITIALIZE_EVENT, *PCACHE_UNINITIALIZE_EVENT; - -// -// Callback routine for retrieving dirty pages from Cache Manager. -// - -typedef -VOID (*PDIRTY_PAGE_ROUTINE) ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in PLARGE_INTEGER OldestLsn, - __in PLARGE_INTEGER NewestLsn, - __in PVOID Context1, - __in PVOID Context2 - ); - -// -// Callback routine for doing log file flushes to Lsn. -// - -typedef -VOID (*PFLUSH_TO_LSN) ( - __in PVOID LogHandle, - __in LARGE_INTEGER Lsn - ); - -// -// Macro to test whether a file is cached or not. -// - -#define CcIsFileCached(FO) ( \ - ((FO)->SectionObjectPointer != NULL) && \ - (((PSECTION_OBJECT_POINTERS)(FO)->SectionObjectPointer)->SharedCacheMap != NULL) \ -) - -extern ULONG CcFastMdlReadWait; - -// -// The following routines are intended for use by File Systems Only. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcInitializeCacheMap ( - __in PFILE_OBJECT FileObject, - __in PCC_FILE_SIZES FileSizes, - __in BOOLEAN PinAccess, - __in PCACHE_MANAGER_CALLBACKS Callbacks, - __in PVOID LazyWriteContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcUninitializeCacheMap ( - __in PFILE_OBJECT FileObject, - __in_opt PLARGE_INTEGER TruncateSize, - __in_opt PCACHE_UNINITIALIZE_EVENT UninitializeEvent - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetFileSizes ( - __in PFILE_OBJECT FileObject, - __in PCC_FILE_SIZES FileSizes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -CcSetFileSizesEx ( - __in PFILE_OBJECT FileObject, - __in PCC_FILE_SIZES FileSizes - ); -#endif - -#define CcGetFileSizePointer(FO) ( \ - ((PLARGE_INTEGER)((FO)->SectionObjectPointer->SharedCacheMap) + 1) \ -) - -// -// Flags for CcPurgeCacheSection -// - -// -// UNINITIALIZE_CACHE_MAPS - All private cache maps will be uninitialized -// before purging the data. This pattern may be specified as TRUE. -// - -#define UNINITIALIZE_CACHE_MAPS (1) - -// -// DO_NOT_RETRY_PURGE - CcPurgeCacheSection will not retry purging the file -// on purge failure even if Mm says the file can be truncated. The return -// value will specify whether or not the purge succeeded. -// - -#define DO_NOT_RETRY_PURGE (2) - -// -// DO_NOT_PURGE_DIRTY_PAGES - Instructs CcPurgeCacheSection to fail any -// purge requests that would cause the caller to throw away dirty data. This -// flag should be used when initiating a coherency flush/purge to ensure that -// the file system does not throw away data generated in the gap between a -// flush and purge. -// - -#define DO_NOT_PURGE_DIRTY_PAGES (0x4) - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -BOOLEAN -CcPurgeCacheSection ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in_opt PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG Flags - ); - -#elif (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -BOOLEAN -CcPurgeCacheSection ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in_opt PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN UninitializeCacheMaps - ); -#endif - -#define CC_FLUSH_AND_PURGE_NO_PURGE (0x1) - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -CcCoherencyFlushAndPurgeCache ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in_opt PLARGE_INTEGER FileOffset, - __in ULONG Length, - __out PIO_STATUS_BLOCK IoStatus, - __in_opt ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetDirtyPageThreshold ( - __in PFILE_OBJECT FileObject, - __in ULONG DirtyPageThreshold - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcFlushCache ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in_opt PLARGE_INTEGER FileOffset, - __in ULONG Length, - __out_opt PIO_STATUS_BLOCK IoStatus - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -LARGE_INTEGER -CcGetFlushedValidData ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer, - __in BOOLEAN BcbListHeld - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcZeroData ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER StartOffset, - __in PLARGE_INTEGER EndOffset, - __in BOOLEAN Wait - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PVOID -CcRemapBcb ( - __in PVOID Bcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcRepinBcb ( - __in PVOID Bcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcUnpinRepinnedBcb ( - __in PVOID Bcb, - __in BOOLEAN WriteThrough, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PFILE_OBJECT -CcGetFileObjectFromSectionPtrs ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -PFILE_OBJECT -CcGetFileObjectFromSectionPtrsRef ( - __in PSECTION_OBJECT_POINTERS SectionObjectPointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PFILE_OBJECT -CcGetFileObjectFromBcb ( - __in PVOID Bcb - ); -#endif - - -// -// These routines are implemented to support write throttling. -// - -// -// BOOLEAN -// CcCopyWriteWontFlush ( -// IN PFILE_OBJECT FileObject, -// IN PLARGE_INTEGER FileOffset, -// IN ULONG Length -// ); -// - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -BOOLEAN -CcCopyWriteWontFlush ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length - ); -#else -#define CcCopyWriteWontFlush(FO,FOFF,LEN) ((LEN) <= 0X1000000) -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcCanIWrite ( - __in PFILE_OBJECT FileObject, - __in ULONG BytesToWrite, - __in BOOLEAN Wait, - __in UCHAR Retrying - ); -#endif - -typedef -VOID (*PCC_POST_DEFERRED_WRITE) ( - __in PVOID Context1, - __in PVOID Context2 - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcDeferWrite ( - __in PFILE_OBJECT FileObject, - __in PCC_POST_DEFERRED_WRITE PostRoutine, - __in PVOID Context1, - __in PVOID Context2, - __in ULONG BytesToWrite, - __in BOOLEAN Retrying - ); -#endif - -// -// The following routines provide a data copy interface to the cache, and -// are intended for use by File Servers and File Systems. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcCopyRead ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __out_bcount(Length) PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcFastCopyRead ( - __in PFILE_OBJECT FileObject, - __in ULONG FileOffset, - __in ULONG Length, - __in ULONG PageCount, - __out_bcount(Length) PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcCopyWrite ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in_bcount(Length) PVOID Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcFastCopyWrite ( - __in PFILE_OBJECT FileObject, - __in ULONG FileOffset, - __in ULONG Length, - __in_bcount(Length) PVOID Buffer - ); -#endif - -// -// The following routines provide an Mdl interface for transfers to and -// from the cache, and are primarily intended for File Servers. -// -// NOBODY SHOULD BE CALLING THESE MDL ROUTINES DIRECTLY, USE FSRTL AND -// FASTIO INTERFACES. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcMdlRead ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif - -// -// This routine is now a wrapper for FastIo if present or CcMdlReadComplete2 -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcMdlReadComplete ( - __in PFILE_OBJECT FileObject, - __in PMDL MdlChain - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcPrepareMdlWrite ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif -// -// This routine is now a wrapper for FastIo if present or CcMdlWriteComplete2 -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcMdlWriteComplete ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in PMDL MdlChain - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -CcMdlWriteAbort ( - __in PFILE_OBJECT FileObject, - __in PMDL MdlChain - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -// -// Common ReadAhead call for Copy Read and Mdl Read. -// -// ReadAhead should always be invoked by calling the CcReadAhead macro, -// which tests first to see if the read is large enough to warrant read -// ahead. Measurements have shown that, calling the read ahead routine -// actually decreases performance for small reads, such as issued by -// many compilers and linkers. Compilers simply want all of the include -// files to stay in memory after being read the first time. -// - -#define CcReadAhead(FO,FOFF,LEN) { \ - if ((LEN) >= 256) { \ - CcScheduleReadAhead((FO),(FOFF),(LEN)); \ - } \ -} - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcScheduleReadAhead ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length - ); -#endif - -// -// The following routine allows a caller to wait for the next batch -// of lazy writer work to complete. In particular, this provides a -// mechanism for a caller to be sure that all avaliable lazy closes -// at the time of this call have issued. -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -CcWaitForCurrentLazyWriterActivity ( - VOID - ); -#endif - -// -// This routine changes the read ahead granularity for a file, which is -// PAGE_SIZE by default. -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetReadAheadGranularity ( - __in PFILE_OBJECT FileObject, - __in ULONG Granularity - ); -#endif - -// -// The following routines provide direct access data which is pinned in the -// cache, and is primarily intended for use by File Systems. In particular, -// this mode of access is ideal for dealing with volume structures. -// - -// -// Flags for pinning -// -// Note: The flags for pinning and the flags for mapping cannot overlap unless -// the flag has the same meaning. -// - -// -// Synchronous Wait - normally specified. This pattern may be specified as TRUE. -// - -#define PIN_WAIT (1) - -// -// Acquire metadata Bcb exclusive (default is shared, Lazy Writer uses exclusive). -// -// Must be set with PIN_WAIT. -// - -#define PIN_EXCLUSIVE (2) - -// -// Acquire metadata Bcb but do not fault data in. Default is to fault the data in. -// This unusual flag is only used by Ntfs for cache coherency synchronization between -// compressed and uncompressed streams for the same compressed file. -// -// Must be set with PIN_WAIT. -// - -#define PIN_NO_READ (4) - -// -// This option may be used to pin data only if the Bcb already exists. If the Bcb -// does not already exist - the pin is unsuccessful and no Bcb is returned. This routine -// provides a way to see if data is already pinned (and possibly dirty) in the cache, -// without forcing a fault if the data is not there. -// - -#define PIN_IF_BCB (8) - -// -// If this option is specified, the caller is responsible for tracking the -// dirty ranges and calling MmSetAddressRangeModified on these ranges before -// they are flushed. Ranges should only be pinned via this manner if the -// entire range will be written or purged (one or the other must occur). -// - -#define PIN_CALLER_TRACKS_DIRTY_DATA (32) - -// -// If this option is specified, Cc will used reserved views to map the data -// requested if Mm has no views to give Cc at the time of mapping the data. -// This flag should only be used for critical data, like file system metadata -// or other data critical to the file system remaining consistent. This is -// a best effort attempt to ensure that we have enough kernel VA space for -// critical system mappings, but once they are all gone, the call will fail -// with insufficient resources. -// -// - -#define PIN_HIGH_PRIORITY (64) - -// -// Flags for mapping -// - -// -// Synchronous Wait - normally specified. This pattern may be specified as TRUE. -// - -#define MAP_WAIT (1) - -// -// Acquire metadata Bcb but do not fault data in. Default is to fault the data in. -// This should not overlap with any of the PIN_ flags so they can be passed down to -// CcPinFileData -// - -#define MAP_NO_READ (16) - -// -// If this option is specified, Cc will used reserved views to map the data -// requested if Mm has no views to give Cc at the time of mapping the data. -// This flag should only be used for critical data, like file system metadata -// or other data critical to the file system remaining consistent. This is -// a best effort attempt to ensure that we have enough kernel VA space for -// critical system mappings, but once they are all gone, the call will fail -// with insufficient resources. -// -// - -#define MAP_HIGH_PRIORITY (64) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcPinRead ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG Flags, - __deref_out PVOID *Bcb, - __deref_out_bcount(Length) PVOID *Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -BOOLEAN -CcMapData ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG Flags, - __deref_out PVOID *Bcb, - __deref_out_bcount(Length) PVOID *Buffer - ); -#elif (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -BOOLEAN -CcMapData ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __deref_out PVOID *Bcb, - __deref_out_bcount(Length) PVOID *Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcPinMappedData ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG Flags, - __deref_inout PVOID *Bcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcPreparePinWrite ( - __in PFILE_OBJECT FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Zero, - __in ULONG Flags, - __deref_out PVOID *Bcb, - __deref_out_bcount(Length) PVOID *Buffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetDirtyPinnedData ( - __in PVOID BcbVoid, - __in_opt PLARGE_INTEGER Lsn - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcUnpinData ( - __in PVOID Bcb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetBcbOwnerPointer ( - __in PVOID Bcb, - __in PVOID OwnerPointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcUnpinDataForThread ( - __in PVOID Bcb, - __in ERESOURCE_THREAD ResourceThreadId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -CcSetAdditionalCacheAttributes ( - __in PFILE_OBJECT FileObject, - __in BOOLEAN DisableReadAhead, - __in BOOLEAN DisableWriteBehind - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -CcSetParallelFlushFile ( - __in PFILE_OBJECT FileObject, - __in BOOLEAN EnableParallelFlush - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -CcSetLogHandleForFile ( - __in PFILE_OBJECT FileObject, - __in PVOID LogHandle, - __in PFLUSH_TO_LSN FlushToLsnRoutine - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -LARGE_INTEGER -CcGetDirtyPages ( - __in PVOID LogHandle, - __in PDIRTY_PAGE_ROUTINE DirtyPageRoutine, - __in PVOID Context1, - __in PVOID Context2 - ); -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -CcIsThereDirtyData ( - __in PVPB Vpb - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -BOOLEAN -CcIsThereDirtyDataEx ( - __in PVPB Vpb, - __in_opt PULONG NumberOfDirtyPages - ); -#endif - -#ifndef __SSPI_H__ -#define __SSPI_H__ -#define ISSP_LEVEL 32 -#define ISSP_MODE 0 - -#if defined(_NO_KSECDD_IMPORT_) - -#define KSECDDDECLSPEC - -#else - -#define KSECDDDECLSPEC __declspec(dllimport) - -#endif - -typedef WCHAR SEC_WCHAR; -typedef CHAR SEC_CHAR; - -#ifndef __SECSTATUS_DEFINED__ -typedef LONG SECURITY_STATUS; -#define __SECSTATUS_DEFINED__ -#endif - -#define SEC_TEXT TEXT -#define SEC_FAR -#define SEC_ENTRY __stdcall - - -#ifndef __SECHANDLE_DEFINED__ -typedef struct _SecHandle -{ - ULONG_PTR dwLower ; - ULONG_PTR dwUpper ; -} SecHandle, * PSecHandle ; - -#define __SECHANDLE_DEFINED__ -#endif // __SECHANDLE_DEFINED__ - -#define SecInvalidateHandle( x ) \ - ((PSecHandle) (x))->dwLower = ((PSecHandle) (x))->dwUpper = ((ULONG_PTR) ((INT_PTR)-1)) ; - -#define SecIsValidHandle( x ) \ - ( ( ((PSecHandle) (x))->dwLower != ((ULONG_PTR) ((INT_PTR) -1 ))) && \ - ( ((PSecHandle) (x))->dwUpper != ((ULONG_PTR) ((INT_PTR) -1 ))) ) - -// -// pseudo handle value: the handle has already been deleted -// - -#define SEC_DELETED_HANDLE ((ULONG_PTR) (-2)) - -typedef SecHandle CredHandle; -typedef PSecHandle PCredHandle; - -typedef SecHandle CtxtHandle; -typedef PSecHandle PCtxtHandle; - -typedef LARGE_INTEGER _SECURITY_INTEGER, SECURITY_INTEGER, *PSECURITY_INTEGER; -typedef SECURITY_INTEGER TimeStamp; -typedef SECURITY_INTEGER * PTimeStamp; -typedef UNICODE_STRING SECURITY_STRING, *PSECURITY_STRING; - -// -// SecPkgInfo structure -// -// Provides general information about a security provider -// - -typedef struct _SecPkgInfoW -{ - unsigned long fCapabilities; // Capability bitmask - unsigned short wVersion; // Version of driver - unsigned short wRPCID; // ID for RPC Runtime - unsigned long cbMaxToken; // Size of authentication token (max) -#ifdef MIDL_PASS - [string] -#endif - SEC_WCHAR * Name; // Text name - -#ifdef MIDL_PASS - [string] -#endif - SEC_WCHAR * Comment; // Comment -} SecPkgInfoW, * PSecPkgInfoW; - -# define SecPkgInfo SecPkgInfoW -# define PSecPkgInfo PSecPkgInfoW - -// -// Security Package Capabilities -// -#define SECPKG_FLAG_INTEGRITY 0x00000001 // Supports integrity on messages -#define SECPKG_FLAG_PRIVACY 0x00000002 // Supports privacy (confidentiality) -#define SECPKG_FLAG_TOKEN_ONLY 0x00000004 // Only security token needed -#define SECPKG_FLAG_DATAGRAM 0x00000008 // Datagram RPC support -#define SECPKG_FLAG_CONNECTION 0x00000010 // Connection oriented RPC support -#define SECPKG_FLAG_MULTI_REQUIRED 0x00000020 // Full 3-leg required for re-auth. -#define SECPKG_FLAG_CLIENT_ONLY 0x00000040 // Server side functionality not available -#define SECPKG_FLAG_EXTENDED_ERROR 0x00000080 // Supports extended error msgs -#define SECPKG_FLAG_IMPERSONATION 0x00000100 // Supports impersonation -#define SECPKG_FLAG_ACCEPT_WIN32_NAME 0x00000200 // Accepts Win32 names -#define SECPKG_FLAG_STREAM 0x00000400 // Supports stream semantics -#define SECPKG_FLAG_NEGOTIABLE 0x00000800 // Can be used by the negotiate package -#define SECPKG_FLAG_GSS_COMPATIBLE 0x00001000 // GSS Compatibility Available -#define SECPKG_FLAG_LOGON 0x00002000 // Supports common LsaLogonUser -#define SECPKG_FLAG_ASCII_BUFFERS 0x00004000 // Token Buffers are in ASCII -#define SECPKG_FLAG_FRAGMENT 0x00008000 // Package can fragment to fit -#define SECPKG_FLAG_MUTUAL_AUTH 0x00010000 // Package can perform mutual authentication -#define SECPKG_FLAG_DELEGATION 0x00020000 // Package can delegate -#define SECPKG_FLAG_READONLY_WITH_CHECKSUM 0x00040000 // Package can delegate -#define SECPKG_FLAG_RESTRICTED_TOKENS 0x00080000 // Package supports restricted callers -#define SECPKG_FLAG_NEGO_EXTENDER 0x00100000 // this package extends SPNEGO, there is at most one -#define SECPKG_FLAG_NEGOTIABLE2 0x00200000 // this package is negotiated under the NegoExtender - -#define SECPKG_ID_NONE 0xFFFF - - -// -// SecBuffer -// -// Generic memory descriptors for buffers passed in to the security -// API -// - -typedef struct _SecBuffer { - unsigned long cbBuffer; // Size of the buffer, in bytes - unsigned long BufferType; // Type of the buffer (below) -#ifdef MIDL_PASS - [size_is(cbBuffer)] char * pvBuffer; // Pointer to the buffer -#else - __field_bcount(cbBuffer) void SEC_FAR * pvBuffer; // Pointer to the buffer -#endif -} SecBuffer, * PSecBuffer; - -typedef struct _SecBufferDesc { - unsigned long ulVersion; // Version number - unsigned long cBuffers; // Number of buffers -#ifdef MIDL_PASS - [size_is(cBuffers)] -#endif - __field_ecount(cBuffers) PSecBuffer pBuffers; // Pointer to array of buffers -} SecBufferDesc, SEC_FAR * PSecBufferDesc; - -#define SECBUFFER_VERSION 0 - -#define SECBUFFER_EMPTY 0 // Undefined, replaced by provider -#define SECBUFFER_DATA 1 // Packet data -#define SECBUFFER_TOKEN 2 // Security token -#define SECBUFFER_PKG_PARAMS 3 // Package specific parameters -#define SECBUFFER_MISSING 4 // Missing Data indicator -#define SECBUFFER_EXTRA 5 // Extra data -#define SECBUFFER_STREAM_TRAILER 6 // Security Trailer -#define SECBUFFER_STREAM_HEADER 7 // Security Header -#define SECBUFFER_NEGOTIATION_INFO 8 // Hints from the negotiation pkg -#define SECBUFFER_PADDING 9 // non-data padding -#define SECBUFFER_STREAM 10 // whole encrypted message -#define SECBUFFER_MECHLIST 11 -#define SECBUFFER_MECHLIST_SIGNATURE 12 -#define SECBUFFER_TARGET 13 // obsolete -#define SECBUFFER_CHANNEL_BINDINGS 14 -#define SECBUFFER_CHANGE_PASS_RESPONSE 15 -#define SECBUFFER_TARGET_HOST 16 -#define SECBUFFER_ALERT 17 - -#define SECBUFFER_ATTRMASK 0xF0000000 -#define SECBUFFER_READONLY 0x80000000 // Buffer is read-only, no checksum -#define SECBUFFER_READONLY_WITH_CHECKSUM 0x10000000 // Buffer is read-only, and checksummed -#define SECBUFFER_RESERVED 0x60000000 // Flags reserved to security system - - -typedef struct _SEC_NEGOTIATION_INFO { - unsigned long Size; // Size of this structure - unsigned long NameLength; // Length of name hint - SEC_WCHAR * Name; // Name hint - void * Reserved; // Reserved -} SEC_NEGOTIATION_INFO, * PSEC_NEGOTIATION_INFO ; - -typedef struct _SEC_CHANNEL_BINDINGS { - unsigned long dwInitiatorAddrType; - unsigned long cbInitiatorLength; - unsigned long dwInitiatorOffset; - unsigned long dwAcceptorAddrType; - unsigned long cbAcceptorLength; - unsigned long dwAcceptorOffset; - unsigned long cbApplicationDataLength; - unsigned long dwApplicationDataOffset; -} SEC_CHANNEL_BINDINGS, * PSEC_CHANNEL_BINDINGS ; - - -// -// Data Representation Constant: -// -#define SECURITY_NATIVE_DREP 0x00000010 -#define SECURITY_NETWORK_DREP 0x00000000 - -// -// Credential Use Flags -// -#define SECPKG_CRED_INBOUND 0x00000001 -#define SECPKG_CRED_OUTBOUND 0x00000002 -#define SECPKG_CRED_BOTH 0x00000003 -#define SECPKG_CRED_DEFAULT 0x00000004 -#define SECPKG_CRED_RESERVED 0xF0000000 - -// -// SSP SHOULD prompt the user for credentials/consent, independent -// of whether credentials to be used are the 'logged on' credentials -// or retrieved from credman. -// -// An SSP may choose not to prompt, however, in circumstances determined -// by the SSP. -// - -#define SECPKG_CRED_AUTOLOGON_RESTRICTED 0x00000010 - -// -// auth will always fail, ISC() is called to process policy data only -// - -#define SECPKG_CRED_PROCESS_POLICY_ONLY 0x00000020 - -// -// InitializeSecurityContext Requirement and return flags: -// - -#define ISC_REQ_DELEGATE 0x00000001 -#define ISC_REQ_MUTUAL_AUTH 0x00000002 -#define ISC_REQ_REPLAY_DETECT 0x00000004 -#define ISC_REQ_SEQUENCE_DETECT 0x00000008 -#define ISC_REQ_CONFIDENTIALITY 0x00000010 -#define ISC_REQ_USE_SESSION_KEY 0x00000020 -#define ISC_REQ_PROMPT_FOR_CREDS 0x00000040 -#define ISC_REQ_USE_SUPPLIED_CREDS 0x00000080 -#define ISC_REQ_ALLOCATE_MEMORY 0x00000100 -#define ISC_REQ_USE_DCE_STYLE 0x00000200 -#define ISC_REQ_DATAGRAM 0x00000400 -#define ISC_REQ_CONNECTION 0x00000800 -#define ISC_REQ_CALL_LEVEL 0x00001000 -#define ISC_REQ_FRAGMENT_SUPPLIED 0x00002000 -#define ISC_REQ_EXTENDED_ERROR 0x00004000 -#define ISC_REQ_STREAM 0x00008000 -#define ISC_REQ_INTEGRITY 0x00010000 -#define ISC_REQ_IDENTIFY 0x00020000 -#define ISC_REQ_NULL_SESSION 0x00040000 -#define ISC_REQ_MANUAL_CRED_VALIDATION 0x00080000 -#define ISC_REQ_RESERVED1 0x00100000 -#define ISC_REQ_FRAGMENT_TO_FIT 0x00200000 -// This exists only in Windows Vista and greater -#define ISC_REQ_FORWARD_CREDENTIALS 0x00400000 -#define ISC_REQ_NO_INTEGRITY 0x00800000 // honored only by SPNEGO -#define ISC_REQ_USE_HTTP_STYLE 0x01000000 - -#define ISC_RET_DELEGATE 0x00000001 -#define ISC_RET_MUTUAL_AUTH 0x00000002 -#define ISC_RET_REPLAY_DETECT 0x00000004 -#define ISC_RET_SEQUENCE_DETECT 0x00000008 -#define ISC_RET_CONFIDENTIALITY 0x00000010 -#define ISC_RET_USE_SESSION_KEY 0x00000020 -#define ISC_RET_USED_COLLECTED_CREDS 0x00000040 -#define ISC_RET_USED_SUPPLIED_CREDS 0x00000080 -#define ISC_RET_ALLOCATED_MEMORY 0x00000100 -#define ISC_RET_USED_DCE_STYLE 0x00000200 -#define ISC_RET_DATAGRAM 0x00000400 -#define ISC_RET_CONNECTION 0x00000800 -#define ISC_RET_INTERMEDIATE_RETURN 0x00001000 -#define ISC_RET_CALL_LEVEL 0x00002000 -#define ISC_RET_EXTENDED_ERROR 0x00004000 -#define ISC_RET_STREAM 0x00008000 -#define ISC_RET_INTEGRITY 0x00010000 -#define ISC_RET_IDENTIFY 0x00020000 -#define ISC_RET_NULL_SESSION 0x00040000 -#define ISC_RET_MANUAL_CRED_VALIDATION 0x00080000 -#define ISC_RET_RESERVED1 0x00100000 -#define ISC_RET_FRAGMENT_ONLY 0x00200000 -// This exists only in Windows Vista and greater -#define ISC_RET_FORWARD_CREDENTIALS 0x00400000 - -#define ISC_RET_USED_HTTP_STYLE 0x01000000 -#define ISC_RET_NO_ADDITIONAL_TOKEN 0x02000000 // *INTERNAL* -#define ISC_RET_REAUTHENTICATION 0x08000000 // *INTERNAL* - -#define ASC_REQ_DELEGATE 0x00000001 -#define ASC_REQ_MUTUAL_AUTH 0x00000002 -#define ASC_REQ_REPLAY_DETECT 0x00000004 -#define ASC_REQ_SEQUENCE_DETECT 0x00000008 -#define ASC_REQ_CONFIDENTIALITY 0x00000010 -#define ASC_REQ_USE_SESSION_KEY 0x00000020 -#define ASC_REQ_ALLOCATE_MEMORY 0x00000100 -#define ASC_REQ_USE_DCE_STYLE 0x00000200 -#define ASC_REQ_DATAGRAM 0x00000400 -#define ASC_REQ_CONNECTION 0x00000800 -#define ASC_REQ_CALL_LEVEL 0x00001000 -#define ASC_REQ_EXTENDED_ERROR 0x00008000 -#define ASC_REQ_STREAM 0x00010000 -#define ASC_REQ_INTEGRITY 0x00020000 -#define ASC_REQ_LICENSING 0x00040000 -#define ASC_REQ_IDENTIFY 0x00080000 -#define ASC_REQ_ALLOW_NULL_SESSION 0x00100000 -#define ASC_REQ_ALLOW_NON_USER_LOGONS 0x00200000 -#define ASC_REQ_ALLOW_CONTEXT_REPLAY 0x00400000 -#define ASC_REQ_FRAGMENT_TO_FIT 0x00800000 -#define ASC_REQ_FRAGMENT_SUPPLIED 0x00002000 -#define ASC_REQ_NO_TOKEN 0x01000000 -#define ASC_REQ_PROXY_BINDINGS 0x04000000 -// SSP_RET_REAUTHENTICATION 0x08000000 // *INTERNAL* -#define ASC_REQ_ALLOW_MISSING_BINDINGS 0x10000000 - -#define ASC_RET_DELEGATE 0x00000001 -#define ASC_RET_MUTUAL_AUTH 0x00000002 -#define ASC_RET_REPLAY_DETECT 0x00000004 -#define ASC_RET_SEQUENCE_DETECT 0x00000008 -#define ASC_RET_CONFIDENTIALITY 0x00000010 -#define ASC_RET_USE_SESSION_KEY 0x00000020 -#define ASC_RET_ALLOCATED_MEMORY 0x00000100 -#define ASC_RET_USED_DCE_STYLE 0x00000200 -#define ASC_RET_DATAGRAM 0x00000400 -#define ASC_RET_CONNECTION 0x00000800 -#define ASC_RET_CALL_LEVEL 0x00002000 // skipped 1000 to be like ISC_ -#define ASC_RET_THIRD_LEG_FAILED 0x00004000 -#define ASC_RET_EXTENDED_ERROR 0x00008000 -#define ASC_RET_STREAM 0x00010000 -#define ASC_RET_INTEGRITY 0x00020000 -#define ASC_RET_LICENSING 0x00040000 -#define ASC_RET_IDENTIFY 0x00080000 -#define ASC_RET_NULL_SESSION 0x00100000 -#define ASC_RET_ALLOW_NON_USER_LOGONS 0x00200000 -#define ASC_RET_ALLOW_CONTEXT_REPLAY 0x00400000 // deprecated - don't use this flag!!! -#define ASC_RET_FRAGMENT_ONLY 0x00800000 -#define ASC_RET_NO_TOKEN 0x01000000 -#define ASC_RET_NO_ADDITIONAL_TOKEN 0x02000000 // *INTERNAL* -#define ASC_RET_NO_PROXY_BINDINGS 0x04000000 -// SSP_RET_REAUTHENTICATION 0x08000000 // *INTERNAL* -#define ASC_RET_MISSING_BINDINGS 0x10000000 - -// -// Security Credentials Attributes: -// - -#define SECPKG_CRED_ATTR_NAMES 1 -#define SECPKG_CRED_ATTR_SSI_PROVIDER 2 - -typedef struct _SecPkgCredentials_NamesW -{ -#ifdef MIDL_PASS - [string] -#endif - SEC_WCHAR * sUserName; - -} SecPkgCredentials_NamesW, * PSecPkgCredentials_NamesW; - -# define SecPkgCredentials_Names SecPkgCredentials_NamesW -# define PSecPkgCredentials_Names PSecPkgCredentials_NamesW - -#if NTDDI_VERSION > NTDDI_WS03 -typedef struct _SecPkgCredentials_SSIProviderW -{ - SEC_WCHAR * sProviderName; - unsigned long ProviderInfoLength; - char * ProviderInfo; -} SecPkgCredentials_SSIProviderW, * PSecPkgCredentials_SSIProviderW; -#endif // End W2k3SP1 and greater -# define SecPkgCredentials_SSIProvider SecPkgCredentials_SSIProviderW -# define PSecPkgCredentials_SSIProvider PSecPkgCredentials_SSIProviderW - -// -// Security Context Attributes: -// - -#define SECPKG_ATTR_SIZES 0 -#define SECPKG_ATTR_NAMES 1 -#define SECPKG_ATTR_LIFESPAN 2 -#define SECPKG_ATTR_DCE_INFO 3 -#define SECPKG_ATTR_STREAM_SIZES 4 -#define SECPKG_ATTR_KEY_INFO 5 -#define SECPKG_ATTR_AUTHORITY 6 -#define SECPKG_ATTR_PROTO_INFO 7 -#define SECPKG_ATTR_PASSWORD_EXPIRY 8 -#define SECPKG_ATTR_SESSION_KEY 9 -#define SECPKG_ATTR_PACKAGE_INFO 10 -#define SECPKG_ATTR_USER_FLAGS 11 -#define SECPKG_ATTR_NEGOTIATION_INFO 12 -#define SECPKG_ATTR_NATIVE_NAMES 13 -#define SECPKG_ATTR_FLAGS 14 -// These attributes exist only in Win XP and greater -#define SECPKG_ATTR_USE_VALIDATED 15 -#define SECPKG_ATTR_CREDENTIAL_NAME 16 -#define SECPKG_ATTR_TARGET_INFORMATION 17 -#define SECPKG_ATTR_ACCESS_TOKEN 18 -// These attributes exist only in Win2K3 and greater -#define SECPKG_ATTR_TARGET 19 -#define SECPKG_ATTR_AUTHENTICATION_ID 20 -// These attributes exist only in Win2K3SP1 and greater -#define SECPKG_ATTR_LOGOFF_TIME 21 -// -// win7 or greater -// -#define SECPKG_ATTR_NEGO_KEYS 22 -#define SECPKG_ATTR_PROMPTING_NEEDED 24 -#define SECPKG_ATTR_UNIQUE_BINDINGS 25 -#define SECPKG_ATTR_ENDPOINT_BINDINGS 26 -#define SECPKG_ATTR_CLIENT_SPECIFIED_TARGET 27 - -#define SECPKG_ATTR_LAST_CLIENT_TOKEN_STATUS 30 -#define SECPKG_ATTR_NEGO_PKG_INFO 31 // contains nego info of packages -#define SECPKG_ATTR_NEGO_STATUS 32 // contains the last error -#define SECPKG_ATTR_CONTEXT_DELETED 33 // a context has been deleted - -#define SECPKG_ATTR_SUBJECT_SECURITY_ATTRIBUTES 128 - -typedef struct _SecPkgContext_SubjectAttributes { - void* AttributeInfo; // contains a PAUTHZ_SECURITY_ATTRIBUTES_INFORMATION structure -} SecPkgContext_SubjectAttributes, *PSecPkgContext_SubjectAttributes; - -#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_KERBEROS 0x1 -#define SECPKG_ATTR_NEGO_INFO_FLAG_NO_NTLM 0x2 - -// -// types of credentials, used by SECPKG_ATTR_PROMPTING_NEEDED -// - -typedef enum _SECPKG_CRED_CLASS { - SecPkgCredClass_None = 0, // no creds - SecPkgCredClass_Ephemeral = 10, // logon creds - SecPkgCredClass_PersistedGeneric = 20, // saved creds, not target specific - SecPkgCredClass_PersistedSpecific = 30, // saved creds, target specific - SecPkgCredClass_Explicit = 40, // explicitly supplied creds -} SECPKG_CRED_CLASS, * PSECPKG_CRED_CLASS; - -typedef struct _SecPkgContext_CredInfo { - SECPKG_CRED_CLASS CredClass; - unsigned long IsPromptingNeeded; -} SecPkgContext_CredInfo, *PSecPkgContext_CredInfo; - -typedef struct _SecPkgContext_NegoPackageInfo -{ - unsigned long PackageMask; -} SecPkgContext_NegoPackageInfo, * PSecPkgContext_NegoPackageInfo; - -typedef struct _SecPkgContext_NegoStatus -{ - unsigned long LastStatus; -} SecPkgContext_NegoStatus, * PSecPkgContext_NegoStatus; - -typedef struct _SecPkgContext_Sizes -{ - unsigned long cbMaxToken; - unsigned long cbMaxSignature; - unsigned long cbBlockSize; - unsigned long cbSecurityTrailer; -} SecPkgContext_Sizes, * PSecPkgContext_Sizes; - -typedef struct _SecPkgContext_StreamSizes -{ - unsigned long cbHeader; - unsigned long cbTrailer; - unsigned long cbMaximumMessage; - unsigned long cBuffers; - unsigned long cbBlockSize; -} SecPkgContext_StreamSizes, * PSecPkgContext_StreamSizes; - -typedef struct _SecPkgContext_NamesW -{ - SEC_WCHAR * sUserName; -} SecPkgContext_NamesW, * PSecPkgContext_NamesW; - -# define SecPkgContext_Names SecPkgContext_NamesW -# define PSecPkgContext_Names PSecPkgContext_NamesW - -typedef struct _SecPkgContext_Lifespan -{ - TimeStamp tsStart; - TimeStamp tsExpiry; -} SecPkgContext_Lifespan, * PSecPkgContext_Lifespan; - -typedef struct _SecPkgContext_DceInfo -{ - unsigned long AuthzSvc; - void * pPac; -} SecPkgContext_DceInfo, * PSecPkgContext_DceInfo; - - -typedef struct _SecPkgContext_KeyInfoW -{ - SEC_WCHAR * sSignatureAlgorithmName; - SEC_WCHAR * sEncryptAlgorithmName; - unsigned long KeySize; - unsigned long SignatureAlgorithm; - unsigned long EncryptAlgorithm; -} SecPkgContext_KeyInfoW, * PSecPkgContext_KeyInfoW; - -#define SecPkgContext_KeyInfo SecPkgContext_KeyInfoW -#define PSecPkgContext_KeyInfo PSecPkgContext_KeyInfoW - -typedef struct _SecPkgContext_AuthorityW -{ - SEC_WCHAR * sAuthorityName; -} SecPkgContext_AuthorityW, * PSecPkgContext_AuthorityW; - -#define SecPkgContext_Authority SecPkgContext_AuthorityW -#define PSecPkgContext_Authority PSecPkgContext_AuthorityW - -typedef struct _SecPkgContext_ProtoInfoW -{ - SEC_WCHAR * sProtocolName; - unsigned long majorVersion; - unsigned long minorVersion; -} SecPkgContext_ProtoInfoW, * PSecPkgContext_ProtoInfoW; - -#define SecPkgContext_ProtoInfo SecPkgContext_ProtoInfoW -#define PSecPkgContext_ProtoInfo PSecPkgContext_ProtoInfoW - -typedef struct _SecPkgContext_PasswordExpiry -{ - TimeStamp tsPasswordExpires; -} SecPkgContext_PasswordExpiry, * PSecPkgContext_PasswordExpiry; - -#if NTDDI_VERSION > NTDDI_WS03 -typedef struct _SecPkgContext_LogoffTime -{ - TimeStamp tsLogoffTime; -} SecPkgContext_LogoffTime, * PSecPkgContext_LogoffTime; -#endif // Greater than Windows Server 2003 RTM (SP1 and greater contains this) - -typedef struct _SecPkgContext_SessionKey -{ - unsigned long SessionKeyLength; - __field_bcount(SessionKeyLength) unsigned char * SessionKey; -} SecPkgContext_SessionKey, *PSecPkgContext_SessionKey; - -// used by nego2 -typedef struct _SecPkgContext_NegoKeys -{ - unsigned long KeyType; - unsigned short KeyLength; - __field_bcount(KeyLength) unsigned char* KeyValue; - unsigned long VerifyKeyType; - unsigned short VerifyKeyLength; - __field_bcount(VerifyKeyLength) unsigned char* VerifyKeyValue; -} SecPkgContext_NegoKeys, * PSecPkgContext_NegoKeys; - -typedef struct _SecPkgContext_PackageInfoW -{ - PSecPkgInfoW PackageInfo; -} SecPkgContext_PackageInfoW, * PSecPkgContext_PackageInfoW; - - -typedef struct _SecPkgContext_UserFlags -{ - unsigned long UserFlags; -} SecPkgContext_UserFlags, * PSecPkgContext_UserFlags; - -typedef struct _SecPkgContext_Flags -{ - unsigned long Flags; -} SecPkgContext_Flags, * PSecPkgContext_Flags; - -#define SecPkgContext_PackageInfo SecPkgContext_PackageInfoW -#define PSecPkgContext_PackageInfo PSecPkgContext_PackageInfoW -typedef struct _SecPkgContext_NegotiationInfoW -{ - PSecPkgInfoW PackageInfo ; - unsigned long NegotiationState ; -} SecPkgContext_NegotiationInfoW, * PSecPkgContext_NegotiationInfoW ; - -# define SecPkgContext_NativeNames SecPkgContext_NativeNamesW -# define PSecPkgContext_NativeNames PSecPkgContext_NativeNamesW - -#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K - -typedef struct _SecPkgContext_CredentialNameW -{ - unsigned long CredentialType; - SEC_WCHAR *sCredentialName; -} SecPkgContext_CredentialNameW, * PSecPkgContext_CredentialNameW; - -#endif // Later than win2k -# define SecPkgContext_CredentialName SecPkgContext_CredentialNameW -# define PSecPkgContext_CredentialName PSecPkgContext_CredentialNameW - -typedef void -(SEC_ENTRY * SEC_GET_KEY_FN) ( - void * Arg, // Argument passed in - void * Principal, // Principal ID - unsigned long KeyVer, // Key Version - void * * Key, // Returned ptr to key - SECURITY_STATUS * Status // returned status - ); - -// -// Flags for ExportSecurityContext -// - -#define SECPKG_CONTEXT_EXPORT_RESET_NEW 0x00000001 // New context is reset to initial state -#define SECPKG_CONTEXT_EXPORT_DELETE_OLD 0x00000002 // Old context is deleted during export -// This is only valid in W2K3SP1 and greater -#define SECPKG_CONTEXT_EXPORT_TO_KERNEL 0x00000004 // Context is to be transferred to the kernel - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -AcquireCredentialsHandleW( -#if ISSP_MODE == 0 // For Kernel mode - __in_opt PSECURITY_STRING pPrincipal, - __in PSECURITY_STRING pPackage, -#else - __in_opt LPWSTR pszPrincipal, // Name of principal - __in LPWSTR pszPackage, // Name of package -#endif - __in unsigned long fCredentialUse, // Flags indicating use - __in_opt void * pvLogonId, // Pointer to logon ID - __in_opt void * pAuthData, // Package specific data - __in_opt SEC_GET_KEY_FN pGetKeyFn, // Pointer to GetKey() func - __in_opt void * pvGetKeyArgument, // Value to pass to GetKey() - __out PCredHandle phCredential, // (out) Cred Handle - __out_opt PTimeStamp ptsExpiry // (out) Lifetime (optional) - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * ACQUIRE_CREDENTIALS_HANDLE_FN_W)( -#if ISSP_MODE == 0 - PSECURITY_STRING, - PSECURITY_STRING, -#else - SEC_WCHAR *, - SEC_WCHAR *, -#endif - unsigned long, - void *, - void *, - SEC_GET_KEY_FN, - void *, - PCredHandle, - PTimeStamp); - -# define AcquireCredentialsHandle AcquireCredentialsHandleW -# define ACQUIRE_CREDENTIALS_HANDLE_FN ACQUIRE_CREDENTIALS_HANDLE_FN_W - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -FreeCredentialsHandle( - __in PCredHandle phCredential // Handle to free - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * FREE_CREDENTIALS_HANDLE_FN)( - PCredHandle ); - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -AddCredentialsW( - __in PCredHandle hCredentials, -#if ISSP_MODE == 0 // For Kernel mode - __in_opt PSECURITY_STRING pPrincipal, - __in PSECURITY_STRING pPackage, -#else - __in_opt LPWSTR pszPrincipal, // Name of principal - __in LPWSTR pszPackage, // Name of package -#endif - __in unsigned long fCredentialUse, // Flags indicating use - __in_opt void * pAuthData, // Package specific data - __in_opt SEC_GET_KEY_FN pGetKeyFn, // Pointer to GetKey() func - __in_opt void * pvGetKeyArgument, // Value to pass to GetKey() - __out_opt PTimeStamp ptsExpiry // (out) Lifetime (optional) - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * ADD_CREDENTIALS_FN_W)( - PCredHandle, -#if ISSP_MODE == 0 - PSECURITY_STRING, - PSECURITY_STRING, -#else - SEC_WCHAR *, - SEC_WCHAR *, -#endif - unsigned long, - void *, - SEC_GET_KEY_FN, - void *, - PTimeStamp); - -SECURITY_STATUS SEC_ENTRY -AddCredentialsA( - __in PCredHandle hCredentials, - __in_opt LPSTR pszPrincipal, // Name of principal - __in LPSTR pszPackage, // Name of package - __in unsigned long fCredentialUse, // Flags indicating use - __in_opt void * pAuthData, // Package specific data - __in_opt SEC_GET_KEY_FN pGetKeyFn, // Pointer to GetKey() func - __in_opt void * pvGetKeyArgument, // Value to pass to GetKey() - __out_opt PTimeStamp ptsExpiry // (out) Lifetime (optional) - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * ADD_CREDENTIALS_FN_A)( - PCredHandle, - SEC_CHAR *, - SEC_CHAR *, - unsigned long, - void *, - SEC_GET_KEY_FN, - void *, - PTimeStamp); - -#ifdef UNICODE -#define AddCredentials AddCredentialsW -#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_W -#else -#define AddCredentials AddCredentialsA -#define ADD_CREDENTIALS_FN ADD_CREDENTIALS_FN_A -#endif - -//////////////////////////////////////////////////////////////////////// -/// -/// Password Change Functions -/// -//////////////////////////////////////////////////////////////////////// - -#if ISSP_MODE != 0 - -SECURITY_STATUS SEC_ENTRY -ChangeAccountPasswordW( - __in SEC_WCHAR * pszPackageName, - __in SEC_WCHAR * pszDomainName, - __in SEC_WCHAR * pszAccountName, - __in SEC_WCHAR * pszOldPassword, - __in SEC_WCHAR * pszNewPassword, - __in BOOLEAN bImpersonating, - __in unsigned long dwReserved, - __inout PSecBufferDesc pOutput - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * CHANGE_PASSWORD_FN_W)( - SEC_WCHAR *, - SEC_WCHAR *, - SEC_WCHAR *, - SEC_WCHAR *, - SEC_WCHAR *, - BOOLEAN, - unsigned long, - PSecBufferDesc - ); - - - -SECURITY_STATUS SEC_ENTRY -ChangeAccountPasswordA( - __in SEC_CHAR * pszPackageName, - __in SEC_CHAR * pszDomainName, - __in SEC_CHAR * pszAccountName, - __in SEC_CHAR * pszOldPassword, - __in SEC_CHAR * pszNewPassword, - __in BOOLEAN bImpersonating, - __in unsigned long dwReserved, - __inout PSecBufferDesc pOutput - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * CHANGE_PASSWORD_FN_A)( - SEC_CHAR *, - SEC_CHAR *, - SEC_CHAR *, - SEC_CHAR *, - SEC_CHAR *, - BOOLEAN, - unsigned long, - PSecBufferDesc - ); - -#ifdef UNICODE -# define ChangeAccountPassword ChangeAccountPasswordW -# define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_W -#else -# define ChangeAccountPassword ChangeAccountPasswordA -# define CHANGE_PASSWORD_FN CHANGE_PASSWORD_FN_A -#endif // !UNICODE - -#endif // ISSP_MODE - - -//////////////////////////////////////////////////////////////////////// -/// -/// Context Management Functions -/// -//////////////////////////////////////////////////////////////////////// - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -InitializeSecurityContextW( - __in_opt PCredHandle phCredential, // Cred to base context - __in_opt PCtxtHandle phContext, // Existing context (OPT) -#if ISSP_MODE == 0 - __in_opt PSECURITY_STRING pTargetName, -#else - __in_opt SEC_WCHAR * pszTargetName, // Name of target -#endif - __in unsigned long fContextReq, // Context Requirements - __in unsigned long Reserved1, // Reserved, MBZ - __in unsigned long TargetDataRep, // Data rep of target - __in_opt PSecBufferDesc pInput, // Input Buffers - __in unsigned long Reserved2, // Reserved, MBZ - __inout_opt PCtxtHandle phNewContext, // (out) New Context handle - __inout_opt PSecBufferDesc pOutput, // (inout) Output Buffers - __out unsigned long * pfContextAttr, // (out) Context attrs - __out_opt PTimeStamp ptsExpiry // (out) Life span (OPT) - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * INITIALIZE_SECURITY_CONTEXT_FN_W)( - PCredHandle, - PCtxtHandle, -#if ISSP_MODE == 0 - PSECURITY_STRING, -#else - SEC_WCHAR *, -#endif - unsigned long, - unsigned long, - unsigned long, - PSecBufferDesc, - unsigned long, - PCtxtHandle, - PSecBufferDesc, - unsigned long *, - PTimeStamp); - -# define InitializeSecurityContext InitializeSecurityContextW -# define INITIALIZE_SECURITY_CONTEXT_FN INITIALIZE_SECURITY_CONTEXT_FN_W - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -AcceptSecurityContext( - __in_opt PCredHandle phCredential, // Cred to base context - __in_opt PCtxtHandle phContext, // Existing context (OPT) - __in_opt PSecBufferDesc pInput, // Input buffer - __in unsigned long fContextReq, // Context Requirements - __in unsigned long TargetDataRep, // Target Data Rep - __in_opt PCtxtHandle phNewContext, // (out) New context handle - __in_opt PSecBufferDesc pOutput, // (inout) Output buffers - __out unsigned long * pfContextAttr, // (out) Context attributes - __out_opt PTimeStamp ptsExpiry // (out) Life span (OPT) - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * ACCEPT_SECURITY_CONTEXT_FN)( - PCredHandle, - PCtxtHandle, - PSecBufferDesc, - unsigned long, - unsigned long, - PCtxtHandle, - PSecBufferDesc, - unsigned long *, - PTimeStamp); - - - -SECURITY_STATUS SEC_ENTRY -CompleteAuthToken( - __in PCtxtHandle phContext, // Context to complete - __in PSecBufferDesc pToken // Token to complete - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * COMPLETE_AUTH_TOKEN_FN)( - PCtxtHandle, - PSecBufferDesc); - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -ImpersonateSecurityContext( - __in PCtxtHandle phContext // Context to impersonate - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * IMPERSONATE_SECURITY_CONTEXT_FN)( - PCtxtHandle); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -RevertSecurityContext( - __in PCtxtHandle phContext // Context from which to re - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * REVERT_SECURITY_CONTEXT_FN)( - PCtxtHandle); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -QuerySecurityContextToken( - __in PCtxtHandle phContext, - __out void * * Token - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * QUERY_SECURITY_CONTEXT_TOKEN_FN)( - PCtxtHandle, void * *); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -DeleteSecurityContext( - __in PCtxtHandle phContext // Context to delete - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * DELETE_SECURITY_CONTEXT_FN)( - PCtxtHandle); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -ApplyControlToken( - __in PCtxtHandle phContext, // Context to modify - __in PSecBufferDesc pInput // Input token to apply - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * APPLY_CONTROL_TOKEN_FN)( - PCtxtHandle, PSecBufferDesc); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -QueryContextAttributesW( - __in PCtxtHandle phContext, // Context to query - __in unsigned long ulAttribute, // Attribute to query - __out void * pBuffer // Buffer for attributes - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * QUERY_CONTEXT_ATTRIBUTES_FN_W)( - PCtxtHandle, - unsigned long, - void *); - -# define QueryContextAttributes QueryContextAttributesW -# define QUERY_CONTEXT_ATTRIBUTES_FN QUERY_CONTEXT_ATTRIBUTES_FN_W - -#if (OSVER(NTDDI_VERSION) > NTDDI_WIN2K) - -SECURITY_STATUS SEC_ENTRY -SetContextAttributesW( - __in PCtxtHandle phContext, // Context to Set - __in unsigned long ulAttribute, // Attribute to Set - __in_bcount(cbBuffer) void * pBuffer, // Buffer for attributes - __in unsigned long cbBuffer // Size (in bytes) of Buffer - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * SET_CONTEXT_ATTRIBUTES_FN_W)( - PCtxtHandle, - unsigned long, - void *, - unsigned long ); - -#endif // Greater than w2k - -# define SetContextAttributes SetContextAttributesW -# define SET_CONTEXT_ATTRIBUTES_FN SET_CONTEXT_ATTRIBUTES_FN_W - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -QueryCredentialsAttributesW( - __in PCredHandle phCredential, // Credential to query - __in unsigned long ulAttribute, // Attribute to query - __inout void * pBuffer // Buffer for attributes - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * QUERY_CREDENTIALS_ATTRIBUTES_FN_W)( - PCredHandle, - unsigned long, - void *); - -# define QueryCredentialsAttributes QueryCredentialsAttributesW -# define QUERY_CREDENTIALS_ATTRIBUTES_FN QUERY_CREDENTIALS_ATTRIBUTES_FN_W - -#if NTDDI_VERSION > NTDDI_WS03 - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -SetCredentialsAttributesW( - __in PCredHandle phCredential, // Credential to Set - __in unsigned long ulAttribute, // Attribute to Set - __in_bcount(cbBuffer) void * pBuffer, // Buffer for attributes - __in unsigned long cbBuffer // Size (in bytes) of Buffer - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * SET_CREDENTIALS_ATTRIBUTES_FN_W)( - PCredHandle, - unsigned long, - void *, - unsigned long ); - -#endif // For W2k3SP1 and greater - -# define SetCredentialsAttributes SetCredentialsAttributesW -# define SET_CREDENTIALS_ATTRIBUTES_FN SET_CREDENTIALS_ATTRIBUTES_FN_W - -SECURITY_STATUS SEC_ENTRY -FreeContextBuffer( - __inout PVOID pvContextBuffer // buffer to free - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * FREE_CONTEXT_BUFFER_FN)( - __inout PVOID - ); - -/////////////////////////////////////////////////////////////////// -//// -//// Message Support API -//// -////////////////////////////////////////////////////////////////// - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -MakeSignature( - __in PCtxtHandle phContext, // Context to use - __in unsigned long fQOP, // Quality of Protection - __in PSecBufferDesc pMessage, // Message to sign - __in unsigned long MessageSeqNo // Message Sequence Num. - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * MAKE_SIGNATURE_FN)( - PCtxtHandle, - unsigned long, - PSecBufferDesc, - unsigned long); - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -VerifySignature( - __in PCtxtHandle phContext, // Context to use - __in PSecBufferDesc pMessage, // Message to verify - __in unsigned long MessageSeqNo, // Sequence Num. - __out unsigned long * pfQOP // QOP used - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * VERIFY_SIGNATURE_FN)( - PCtxtHandle, - PSecBufferDesc, - unsigned long, - unsigned long *); - -// This only exists win Win2k3 and Greater -#define SECQOP_WRAP_NO_ENCRYPT 0x80000001 -#define SECQOP_WRAP_OOB_DATA 0x40000000 - -SECURITY_STATUS SEC_ENTRY -EncryptMessage( __in PCtxtHandle phContext, - __in unsigned long fQOP, - __inout PSecBufferDesc pMessage, - __in unsigned long MessageSeqNo); - -typedef SECURITY_STATUS -(SEC_ENTRY * ENCRYPT_MESSAGE_FN)( - PCtxtHandle, unsigned long, PSecBufferDesc, unsigned long); - - -SECURITY_STATUS SEC_ENTRY -DecryptMessage( __in PCtxtHandle phContext, - __inout PSecBufferDesc pMessage, - __in unsigned long MessageSeqNo, - __out_opt unsigned long * pfQOP); - - -typedef SECURITY_STATUS -(SEC_ENTRY * DECRYPT_MESSAGE_FN)( - PCtxtHandle, PSecBufferDesc, unsigned long, - unsigned long *); - - -/////////////////////////////////////////////////////////////////////////// -//// -//// Misc. -//// -/////////////////////////////////////////////////////////////////////////// - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -EnumerateSecurityPackagesW( - __out unsigned long * pcPackages, // Receives num. packages - __deref_out PSecPkgInfoW * ppPackageInfo // Receives array of info - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * ENUMERATE_SECURITY_PACKAGES_FN_W)( - unsigned long *, - PSecPkgInfoW *); - -# define EnumerateSecurityPackages EnumerateSecurityPackagesW -# define ENUMERATE_SECURITY_PACKAGES_FN ENUMERATE_SECURITY_PACKAGES_FN_W - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -QuerySecurityPackageInfoW( -#if ISSP_MODE == 0 - __in PSECURITY_STRING pPackageName, -#else - __in LPWSTR pszPackageName, // Name of package -#endif - __deref_out PSecPkgInfoW *ppPackageInfo // Receives package info - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * QUERY_SECURITY_PACKAGE_INFO_FN_W)( -#if ISSP_MODE == 0 - PSECURITY_STRING, -#else - SEC_WCHAR *, -#endif - PSecPkgInfoW *); - -# define QuerySecurityPackageInfo QuerySecurityPackageInfoW -# define QUERY_SECURITY_PACKAGE_INFO_FN QUERY_SECURITY_PACKAGE_INFO_FN_W - -/////////////////////////////////////////////////////////////////////////// -//// -//// Context export/import -//// -/////////////////////////////////////////////////////////////////////////// - - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -ExportSecurityContext( - __in PCtxtHandle phContext, // (in) context to export - __in ULONG fFlags, // (in) option flags - __out PSecBuffer pPackedContext, // (out) marshalled context - __out void * * pToken // (out, optional) token handle for impersonation - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * EXPORT_SECURITY_CONTEXT_FN)( - PCtxtHandle, - ULONG, - PSecBuffer, - void * * - ); - -KSECDDDECLSPEC -SECURITY_STATUS SEC_ENTRY -ImportSecurityContextW( -#if ISSP_MODE == 0 - __in PSECURITY_STRING pszPackage, -#else - __in LPWSTR pszPackage, -#endif - __in PSecBuffer pPackedContext, // (in) marshalled context - __in void * Token, // (in, optional) handle to token for context - __out PCtxtHandle phContext // (out) new context handle - ); - -typedef SECURITY_STATUS -(SEC_ENTRY * IMPORT_SECURITY_CONTEXT_FN_W)( -#if ISSP_MODE == 0 - PSECURITY_STRING, -#else - SEC_WCHAR *, -#endif - PSecBuffer, - VOID *, - PCtxtHandle - ); - -# define ImportSecurityContext ImportSecurityContextW -# define IMPORT_SECURITY_CONTEXT_FN IMPORT_SECURITY_CONTEXT_FN_W - -#if ISSP_MODE == 0 -KSECDDDECLSPEC -NTSTATUS -NTAPI -SecMakeSPN( - IN PUNICODE_STRING ServiceClass, - IN PUNICODE_STRING ServiceName, - IN PUNICODE_STRING InstanceName OPTIONAL, - IN USHORT InstancePort OPTIONAL, - IN PUNICODE_STRING Referrer OPTIONAL, - IN OUT PUNICODE_STRING Spn, - OUT PULONG Length OPTIONAL, - IN BOOLEAN Allocate - ); - -#if OSVER(NTDDI_VERSION) > NTDD_WIN2K - -KSECDDDECLSPEC -NTSTATUS -NTAPI -SecMakeSPNEx( - IN PUNICODE_STRING ServiceClass, - IN PUNICODE_STRING ServiceName, - IN PUNICODE_STRING InstanceName OPTIONAL, - IN USHORT InstancePort OPTIONAL, - IN PUNICODE_STRING Referrer OPTIONAL, - IN PUNICODE_STRING TargetInfo OPTIONAL, - IN OUT PUNICODE_STRING Spn, - OUT PULONG Length OPTIONAL, - IN BOOLEAN Allocate - ); - -#if OSVER(NTDDI_VERSION) > NTDDI_WS03 - -KSECDDDECLSPEC -NTSTATUS -NTAPI -SecMakeSPNEx2( - IN PUNICODE_STRING ServiceClass, - IN PUNICODE_STRING ServiceName, - IN PUNICODE_STRING InstanceName OPTIONAL, - IN USHORT InstancePort OPTIONAL, - IN PUNICODE_STRING Referrer OPTIONAL, - IN PUNICODE_STRING InTargetInfo OPTIONAL, - IN OUT PUNICODE_STRING Spn, - OUT PULONG TotalSize OPTIONAL, - IN BOOLEAN Allocate, - IN BOOLEAN IsTargetInfoMarshaled - ); - -#endif // Windows Vista and greater - -KSECDDDECLSPEC -NTSTATUS -SEC_ENTRY -SecLookupAccountSid( - __in PSID Sid, - __out PULONG NameSize, - __inout PUNICODE_STRING NameBuffer, - __out PULONG DomainSize OPTIONAL, - __out_opt PUNICODE_STRING DomainBuffer OPTIONAL, - __out PSID_NAME_USE NameUse - ); - -KSECDDDECLSPEC -NTSTATUS -SEC_ENTRY -SecLookupAccountName( - __in PUNICODE_STRING Name, - __inout PULONG SidSize, - __out PSID Sid, - __out PSID_NAME_USE NameUse, - __out PULONG DomainSize OPTIONAL, - __inout_opt PUNICODE_STRING ReferencedDomain OPTIONAL - ); - -#endif // Greater than W2k - -#if OSVER(NTDDI_VERSION) > NTDDI_WINXP - -KSECDDDECLSPEC -NTSTATUS -SEC_ENTRY -SecLookupWellKnownSid( - __in WELL_KNOWN_SID_TYPE SidType, - __out PSID Sid, - __in ULONG SidBufferSize, - __inout_opt PULONG SidSize OPTIONAL - ); - -#endif // Greater than XP - - -#endif - -#define SECURITY_ENTRYPOINTW SEC_TEXT("InitSecurityInterfaceW") -# define SECURITY_ENTRYPOINT SECURITY_ENTRYPOINTW - -#define FreeCredentialHandle FreeCredentialsHandle - -typedef struct _SECURITY_FUNCTION_TABLE_W { - unsigned long dwVersion; - ENUMERATE_SECURITY_PACKAGES_FN_W EnumerateSecurityPackagesW; - QUERY_CREDENTIALS_ATTRIBUTES_FN_W QueryCredentialsAttributesW; - ACQUIRE_CREDENTIALS_HANDLE_FN_W AcquireCredentialsHandleW; - FREE_CREDENTIALS_HANDLE_FN FreeCredentialsHandle; - void * Reserved2; - INITIALIZE_SECURITY_CONTEXT_FN_W InitializeSecurityContextW; - ACCEPT_SECURITY_CONTEXT_FN AcceptSecurityContext; - COMPLETE_AUTH_TOKEN_FN CompleteAuthToken; - DELETE_SECURITY_CONTEXT_FN DeleteSecurityContext; - APPLY_CONTROL_TOKEN_FN ApplyControlToken; - QUERY_CONTEXT_ATTRIBUTES_FN_W QueryContextAttributesW; - IMPERSONATE_SECURITY_CONTEXT_FN ImpersonateSecurityContext; - REVERT_SECURITY_CONTEXT_FN RevertSecurityContext; - MAKE_SIGNATURE_FN MakeSignature; - VERIFY_SIGNATURE_FN VerifySignature; - FREE_CONTEXT_BUFFER_FN FreeContextBuffer; - QUERY_SECURITY_PACKAGE_INFO_FN_W QuerySecurityPackageInfoW; - void * Reserved3; - void * Reserved4; - EXPORT_SECURITY_CONTEXT_FN ExportSecurityContext; - IMPORT_SECURITY_CONTEXT_FN_W ImportSecurityContextW; - ADD_CREDENTIALS_FN_W AddCredentialsW ; - void * Reserved8; - QUERY_SECURITY_CONTEXT_TOKEN_FN QuerySecurityContextToken; - ENCRYPT_MESSAGE_FN EncryptMessage; - DECRYPT_MESSAGE_FN DecryptMessage; -#if OSVER(NTDDI_VERSION) > NTDDI_WIN2K - // Fields below this are available in OSes after w2k - SET_CONTEXT_ATTRIBUTES_FN_W SetContextAttributesW; -#endif // greater thean 2K - -#if NTDDI_VERSION > NTDDI_WS03SP1 - // Fields below this are available in OSes after W2k3SP1 - SET_CREDENTIALS_ATTRIBUTES_FN_W SetCredentialsAttributesW; -#endif -#if ISSP_MODE != 0 - CHANGE_PASSWORD_FN_W ChangeAccountPasswordW; -#else - void * Reserved9; -#endif -} SecurityFunctionTableW, * PSecurityFunctionTableW; - -# define SecurityFunctionTable SecurityFunctionTableW -# define PSecurityFunctionTable PSecurityFunctionTableW -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION 1 -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_2 2 -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_3 3 -#define SECURITY_SUPPORT_PROVIDER_INTERFACE_VERSION_4 4 - -KSECDDDECLSPEC -PSecurityFunctionTableW SEC_ENTRY -InitSecurityInterfaceW( - void - ); - -typedef PSecurityFunctionTableW -(SEC_ENTRY * INIT_SECURITY_INTERFACE_W)(void); - -# define InitSecurityInterface InitSecurityInterfaceW -# define INIT_SECURITY_INTERFACE INIT_SECURITY_INTERFACE_W - -#ifndef _AUTH_IDENTITY_EX2_DEFINED -#define _AUTH_IDENTITY_EX2_DEFINED - -#define SEC_WINNT_AUTH_IDENTITY_VERSION_2 0x201 - -typedef struct _SEC_WINNT_AUTH_IDENTITY_EX2 { - unsigned long Version; // contains SEC_WINNT_AUTH_IDENTITY_VERSION_2 - unsigned short cbHeaderLength; - unsigned long cbStructureLength; - unsigned long UserOffset; // Non-NULL terminated string, unicode only - unsigned short UserLength; // # of bytes (NOT WCHARs), not including NULL. - unsigned long DomainOffset; // Non-NULL terminated string, unicode only - unsigned short DomainLength; // # of bytes (NOT WCHARs), not including NULL. - unsigned long PackedCredentialsOffset; // Non-NULL terminated string, unicode only - unsigned short PackedCredentialsLength; // # of bytes (NOT WCHARs), not including NULL. - unsigned long Flags; - unsigned long PackageListOffset; // Non-NULL terminated string, unicode only - unsigned short PackageListLength; -} SEC_WINNT_AUTH_IDENTITY_EX2, *PSEC_WINNT_AUTH_IDENTITY_EX2; - -#endif // _AUTH_IDENTITY_EX2_DEFINED - -#ifndef _AUTH_IDENTITY_DEFINED -#define _AUTH_IDENTITY_DEFINED - -// -// This was not defined in NTIFS.h for windows 2000 however -// this struct has always been there and are safe to use -// in windows 2000 and above. -// - -#define SEC_WINNT_AUTH_IDENTITY_ANSI 0x1 -#define SEC_WINNT_AUTH_IDENTITY_UNICODE 0x2 - -typedef struct _SEC_WINNT_AUTH_IDENTITY_W { - unsigned short *User; // Non-NULL terminated string. - unsigned long UserLength; // # of characters (NOT bytes), not including NULL. - unsigned short *Domain; // Non-NULL terminated string. - unsigned long DomainLength; // # of characters (NOT bytes), not including NULL. - unsigned short *Password; // Non-NULL terminated string. - unsigned long PasswordLength; // # of characters (NOT bytes), not including NULL. - unsigned long Flags; -} SEC_WINNT_AUTH_IDENTITY_W, *PSEC_WINNT_AUTH_IDENTITY_W; - -#define SEC_WINNT_AUTH_IDENTITY SEC_WINNT_AUTH_IDENTITY_W -#define PSEC_WINNT_AUTH_IDENTITY PSEC_WINNT_AUTH_IDENTITY_W -#define _SEC_WINNT_AUTH_IDENTITY _SEC_WINNT_AUTH_IDENTITY_W - -#endif //_AUTH_IDENTITY_DEFINED // ntifs - -// -// This is the combined authentication identity structure that may be -// used with the negotiate package, NTLM, Kerberos, or SCHANNEL -// - -#ifndef SEC_WINNT_AUTH_IDENTITY_VERSION -#define SEC_WINNT_AUTH_IDENTITY_VERSION 0x200 - -typedef struct _SEC_WINNT_AUTH_IDENTITY_EXW { - unsigned long Version; - unsigned long Length; - unsigned short *User; // Non-NULL terminated string. - unsigned long UserLength; // # of characters (NOT bytes), not including NULL. - unsigned short *Domain; // Non-NULL terminated string. - unsigned long DomainLength; // # of characters (NOT bytes), not including NULL. - unsigned short *Password; // Non-NULL terminated string. - unsigned long PasswordLength; // # of characters (NOT bytes), not including NULL. - unsigned long Flags; - unsigned short *PackageList; - unsigned long PackageListLength; -} SEC_WINNT_AUTH_IDENTITY_EXW, *PSEC_WINNT_AUTH_IDENTITY_EXW; - -#define SEC_WINNT_AUTH_IDENTITY_EX SEC_WINNT_AUTH_IDENTITY_EXW -#define PSEC_WINNT_AUTH_IDENTITY_EX PSEC_WINNT_AUTH_IDENTITY_EXW - -#endif // SEC_WINNT_AUTH_IDENTITY_VERSION - - -typedef PVOID PSEC_WINNT_AUTH_IDENTITY_OPAQUE; // the credential structure is opaque - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -// -// Convert the _OPAQUE structure passed in to the -// 3 tuple . -// -// Note: The 'strings' returned need not necessarily be -// in user recognisable form. The purpose of this API -// is to 'flatten' the _OPAQUE structure into the 3 tuple. -// User recognisable can always be -// obtained by passing NULL to the pszPackedCredentialsString -// parameter. -// -// zero out the pszPackedCredentialsString then -// free the returned memory using SspiLocalFree() -// - -SECURITY_STATUS -SEC_ENTRY -SspiEncodeAuthIdentityAsStrings( - __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE pAuthIdentity, - __deref_out_opt PCWSTR* ppszUserName, - __deref_out_opt PCWSTR* ppszDomainName, - __deref_opt_out_opt PCWSTR* ppszPackedCredentialsString - ); - -SECURITY_STATUS -SEC_ENTRY -SspiValidateAuthIdentity( - __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData - ); - -// -// free the returned memory using SspiFreeAuthIdentity() -// - -SECURITY_STATUS -SEC_ENTRY -SspiCopyAuthIdentity( - __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData, - __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* AuthDataCopy - ); - -// -// use only for the memory returned by SspiCopyAuthIdentity(). -// Internally calls SspiZeroAuthIdentity(). -// - -VOID -SEC_ENTRY -SspiFreeAuthIdentity( - __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData - ); - -VOID -SEC_ENTRY -SspiZeroAuthIdentity( - __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthData - ); - -VOID -SEC_ENTRY -SspiLocalFree( - __in_opt PVOID DataBuffer - ); - -// -// call SspiFreeAuthIdentity to free the returned AuthIdentity -// which zeroes out the credentials blob before freeing it -// - -SECURITY_STATUS -SEC_ENTRY -SspiEncodeStringsAsAuthIdentity( - __in_opt PCWSTR pszUserName, - __in_opt PCWSTR pszDomainName, - __in_opt PCWSTR pszPackedCredentialsString, - __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity - ); - -SECURITY_STATUS -SEC_ENTRY -SspiCompareAuthIdentities( - __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity1, - __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity2, - __out_opt PBOOLEAN SameSuppliedUser, - __out_opt PBOOLEAN SameSuppliedIdentity - ); - -// -// zero out the returned AuthIdentityByteArray then -// free the returned memory using SspiLocalFree() -// - -SECURITY_STATUS -SEC_ENTRY -SspiMarshalAuthIdentity( - __in PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, - __out unsigned long* AuthIdentityLength, - __deref_out_bcount(*AuthIdentityLength) char** AuthIdentityByteArray - ); - -// -// free the returned auth identity using SspiFreeAuthIdentity() -// - -SECURITY_STATUS -SEC_ENTRY -SspiUnmarshalAuthIdentity( - __in unsigned long AuthIdentityLength, - __in_bcount(AuthIdentityLength) char* AuthIdentityByteArray, - __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppAuthIdentity - ); - -BOOLEAN -SEC_ENTRY -SspiIsPromptingNeeded( - __in unsigned long ErrorOrNtStatus - ); - -SECURITY_STATUS -SEC_ENTRY -SspiGetTargetHostName( - __in PCWSTR pszTargetName, - __deref_out PWSTR* pszHostName - ); - -SECURITY_STATUS -SEC_ENTRY -SspiExcludePackage( - __in_opt PSEC_WINNT_AUTH_IDENTITY_OPAQUE AuthIdentity, - __in PCWSTR pszPackageName, - __deref_out PSEC_WINNT_AUTH_IDENTITY_OPAQUE* ppNewAuthIdentity - ); - -// -// Common types used by negotiable security packages -// -// These are defined after W2K -// - -#define SEC_WINNT_AUTH_IDENTITY_MARSHALLED 0x4 // all data is in one buffer -#define SEC_WINNT_AUTH_IDENTITY_ONLY 0x8 // these credentials are for identity only - no PAC needed - -#endif // NTDDI_VERSION -#endif // __SSPI_H__ - -#ifndef SECURITY_USER_DATA_DEFINED -#define SECURITY_USER_DATA_DEFINED - -typedef struct _SECURITY_USER_DATA { - SECURITY_STRING UserName; // User name - SECURITY_STRING LogonDomainName; // Domain the user logged on to - SECURITY_STRING LogonServer; // Server that logged the user on - PSID pSid; // SID of user -} SECURITY_USER_DATA, *PSECURITY_USER_DATA; - -typedef SECURITY_USER_DATA SecurityUserData, * PSecurityUserData; - - -#define UNDERSTANDS_LONG_NAMES 1 -#define NO_LONG_NAMES 2 - -#endif // SECURITY_USER_DATA_DEFINED - -NTSTATUS SEC_ENTRY -GetSecurityUserInfo( - __in_opt PLUID LogonId, - __in ULONG Flags, - __deref_out PSecurityUserData * UserInformation - ); - -NTSTATUS SEC_ENTRY -MapSecurityError( __in SECURITY_STATUS SecStatus ); - -#define DD_MUP_DEVICE_NAME L"\\Device\\Mup" - - -// -// The actual prefix resolution IOCTL issued by MUP to -// redirectors to determine who is responsible for a -// \\server\share prefix. -// - -// -// For use with legacy providers, which register with -// FsRtlRegisterUncProvider(). -// - -#define IOCTL_REDIR_QUERY_PATH CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 99, METHOD_NEITHER, FILE_ANY_ACCESS) - -// -// For use by redirectors conforming to the Vista redirector model. -// These register with FsRtlRegisterUncProviderEx(). -// - -#define IOCTL_REDIR_QUERY_PATH_EX CTL_CODE(FILE_DEVICE_NETWORK_FILE_SYSTEM, 100, METHOD_NEITHER, FILE_ANY_ACCESS) - -// -// Used by MUP prefix resolution. -// For use with legacy providers, which register with -// FsRtlRegisterUncProvider(). -// - -typedef struct _QUERY_PATH_REQUEST { - ULONG PathNameLength; - PIO_SECURITY_CONTEXT SecurityContext; - WCHAR FilePathName[1]; -} QUERY_PATH_REQUEST, *PQUERY_PATH_REQUEST; - -// -// Used by MUP prefix resolution. -// Issued to providers which register with FsRtlRegisterUncProviderEx() -// These are providers conforming to the Vista redirector model. -// - -typedef struct _QUERY_PATH_REQUEST_EX { - PIO_SECURITY_CONTEXT pSecurityContext; - ULONG EaLength; - PVOID pEaBuffer; - - // - // Pointer to filename will be passed to provider. - // Providers MUST NOT modify this string. - // - - UNICODE_STRING PathName; - - // - // Pointer to optional domain service name. Only providers which - // register as FSRTL_UNC_PROVIDER_FLAGS_DOMAIN_SVC_AWARE will see - // domain service names. - // - // This consumes 2 of the 5 ULONG_PTRs initially reserved in the - // _EX query. New as of Windows 7. - // - - UNICODE_STRING DomainServiceName; - - // - // Reserved - // - - ULONG_PTR Reserved[ 3 ]; -} QUERY_PATH_REQUEST_EX, *PQUERY_PATH_REQUEST_EX; - -typedef struct _QUERY_PATH_RESPONSE { - ULONG LengthAccepted; -} QUERY_PATH_RESPONSE, *PQUERY_PATH_RESPONSE; - -#ifndef _WNNC_ -#define _WNNC_ - -// -// Network types -// - -#define WNNC_NET_MSNET 0x00010000 -#define WNNC_NET_SMB 0x00020000 -#define WNNC_NET_NETWARE 0x00030000 -#define WNNC_NET_VINES 0x00040000 -#define WNNC_NET_10NET 0x00050000 -#define WNNC_NET_LOCUS 0x00060000 -#define WNNC_NET_SUN_PC_NFS 0x00070000 -#define WNNC_NET_LANSTEP 0x00080000 -#define WNNC_NET_9TILES 0x00090000 -#define WNNC_NET_LANTASTIC 0x000A0000 -#define WNNC_NET_AS400 0x000B0000 -#define WNNC_NET_FTP_NFS 0x000C0000 -#define WNNC_NET_PATHWORKS 0x000D0000 -#define WNNC_NET_LIFENET 0x000E0000 -#define WNNC_NET_POWERLAN 0x000F0000 -#define WNNC_NET_BWNFS 0x00100000 -#define WNNC_NET_COGENT 0x00110000 -#define WNNC_NET_FARALLON 0x00120000 -#define WNNC_NET_APPLETALK 0x00130000 -#define WNNC_NET_INTERGRAPH 0x00140000 -#define WNNC_NET_SYMFONET 0x00150000 -#define WNNC_NET_CLEARCASE 0x00160000 -#define WNNC_NET_FRONTIER 0x00170000 -#define WNNC_NET_BMC 0x00180000 -#define WNNC_NET_DCE 0x00190000 -#define WNNC_NET_AVID 0x001A0000 -#define WNNC_NET_DOCUSPACE 0x001B0000 -#define WNNC_NET_MANGOSOFT 0x001C0000 -#define WNNC_NET_SERNET 0x001D0000 -#define WNNC_NET_RIVERFRONT1 0X001E0000 -#define WNNC_NET_RIVERFRONT2 0x001F0000 -#define WNNC_NET_DECORB 0x00200000 -#define WNNC_NET_PROTSTOR 0x00210000 -#define WNNC_NET_FJ_REDIR 0x00220000 -#define WNNC_NET_DISTINCT 0x00230000 -#define WNNC_NET_TWINS 0x00240000 -#define WNNC_NET_RDR2SAMPLE 0x00250000 -#define WNNC_NET_CSC 0x00260000 -#define WNNC_NET_3IN1 0x00270000 -#define WNNC_NET_EXTENDNET 0x00290000 -#define WNNC_NET_STAC 0x002A0000 -#define WNNC_NET_FOXBAT 0x002B0000 -#define WNNC_NET_YAHOO 0x002C0000 -#define WNNC_NET_EXIFS 0x002D0000 -#define WNNC_NET_DAV 0x002E0000 -#define WNNC_NET_KNOWARE 0x002F0000 -#define WNNC_NET_OBJECT_DIRE 0x00300000 -#define WNNC_NET_MASFAX 0x00310000 -#define WNNC_NET_HOB_NFS 0x00320000 -#define WNNC_NET_SHIVA 0x00330000 -#define WNNC_NET_IBMAL 0x00340000 -#define WNNC_NET_LOCK 0x00350000 -#define WNNC_NET_TERMSRV 0x00360000 -#define WNNC_NET_SRT 0x00370000 -#define WNNC_NET_QUINCY 0x00380000 -#define WNNC_NET_OPENAFS 0x00390000 -#define WNNC_NET_AVID1 0X003A0000 -#define WNNC_NET_DFS 0x003B0000 -#define WNNC_NET_KWNP 0x003C0000 -#define WNNC_NET_ZENWORKS 0x003D0000 -#define WNNC_NET_DRIVEONWEB 0x003E0000 -#define WNNC_NET_VMWARE 0x003F0000 -#define WNNC_NET_RSFX 0x00400000 -#define WNNC_NET_MFILES 0x00410000 -#define WNNC_NET_MS_NFS 0x00420000 -#define WNNC_NET_GOOGLE 0x00430000 - -#define WNNC_CRED_MANAGER 0xFFFF0000 - -// -// Network type aliases -// - -#define WNNC_NET_LANMAN WNNC_NET_SMB - - -#endif // _WNNC_ -#define VOLSNAPCONTROLTYPE 0x00000053 // 'S' -#define IOCTL_VOLSNAP_FLUSH_AND_HOLD_WRITES CTL_CODE(VOLSNAPCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryObject( - __in_opt HANDLE Handle, - __in OBJECT_INFORMATION_CLASS ObjectInformationClass, - __out_bcount_opt(ObjectInformationLength) PVOID ObjectInformation, - __in ULONG ObjectInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwNotifyChangeKey( - __in HANDLE KeyHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG CompletionFilter, - __in BOOLEAN WatchTree, - __out_bcount_opt(BufferSize) PVOID Buffer, - __in ULONG BufferSize, - __in BOOLEAN Asynchronous - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwCreateEvent ( - __out PHANDLE EventHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in EVENT_TYPE EventType, - __in BOOLEAN InitialState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDeleteFile( - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDeviceIoControlFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG IoControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryDirectoryFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass, - __in BOOLEAN ReturnSingleEntry, - __in_opt PUNICODE_STRING FileName, - __in BOOLEAN RestartScan - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryVolumeInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetVolumeInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID FsInformation, - __in ULONG Length, - __in FS_INFORMATION_CLASS FsInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwFsControlFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG FsControlCode, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDuplicateObject( - __in HANDLE SourceProcessHandle, - __in HANDLE SourceHandle, - __in_opt HANDLE TargetProcessHandle, - __out_opt PHANDLE TargetHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG HandleAttributes, - __in ULONG Options - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenDirectoryObject( - __out PHANDLE DirectoryHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(return==0, __drv_allocatesMem(Region)) -NTSYSAPI -NTSTATUS -NTAPI -ZwAllocateVirtualMemory( - __in HANDLE ProcessHandle, - __inout PVOID *BaseAddress, - __in ULONG_PTR ZeroBits, - __inout PSIZE_T RegionSize, - __in ULONG AllocationType, - __in ULONG Protect - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(return==0, __drv_freesMem(Region)) -NTSYSAPI -NTSTATUS -NTAPI -ZwFreeVirtualMemory( - __in HANDLE ProcessHandle, - __inout PVOID *BaseAddress, - __inout PSIZE_T RegionSize, - __in ULONG FreeType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(Timeout == NULL, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Timeout->QuadPart != 0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Timeout->QuadPart == 0, __drv_maxIRQL(DISPATCH_LEVEL)) -NTSYSAPI -NTSTATUS -NTAPI -ZwWaitForSingleObject( - __in HANDLE Handle, - __in BOOLEAN Alertable, - __in_opt PLARGE_INTEGER Timeout - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetEvent ( - __in HANDLE EventHandle, - __out_opt PLONG PreviousState - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwFlushVirtualMemory( - __in HANDLE ProcessHandle, - __inout PVOID *BaseAddress, - __inout PSIZE_T RegionSize, - __out PIO_STATUS_BLOCK IoStatus - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenProcessTokenEx( - __in HANDLE ProcessHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG HandleAttributes, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenThreadTokenEx( - __in HANDLE ThreadHandle, - __in ACCESS_MASK DesiredAccess, - __in BOOLEAN OpenAsSelf, - __in ULONG HandleAttributes, - __out PHANDLE TokenHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryInformationToken ( - __in HANDLE TokenHandle, - __in TOKEN_INFORMATION_CLASS TokenInformationClass, - __out_bcount_part_opt(TokenInformationLength,*ReturnLength) PVOID TokenInformation, - __in ULONG TokenInformationLength, - __out PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetInformationToken ( - __in HANDLE TokenHandle, - __in TOKEN_INFORMATION_CLASS TokenInformationClass, - __in_bcount(TokenInformationLength) PVOID TokenInformation, - __in ULONG TokenInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetSecurityObject( - __in HANDLE Handle, - __in SECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQuerySecurityObject( - __in HANDLE Handle, - __in SECURITY_INFORMATION SecurityInformation, - __out_bcount_part(Length,*LengthNeeded) PSECURITY_DESCRIPTOR SecurityDescriptor, - __in ULONG Length, - __out PULONG LengthNeeded - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwLockFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in PLARGE_INTEGER ByteOffset, - __in PLARGE_INTEGER Length, - __in ULONG Key, - __in BOOLEAN FailImmediately, - __in BOOLEAN ExclusiveLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwUnlockFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in PLARGE_INTEGER ByteOffset, - __in PLARGE_INTEGER Length, - __in ULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryQuotaInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in BOOLEAN ReturnSingleEntry, - __in_bcount_opt(SidListLength) PVOID SidList, - __in ULONG SidListLength, - __in_opt PSID StartSid, - __in BOOLEAN RestartScan - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetQuotaInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -ZwFlushBuffersFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwQueryEaFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in BOOLEAN ReturnSingleEntry, - __in_bcount_opt(EaListLength) PVOID EaList, - __in ULONG EaListLength, - __in_opt PULONG EaIndex, - __in BOOLEAN RestartScan - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -ZwSetEaFile ( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDuplicateToken( - __in HANDLE ExistingTokenHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in BOOLEAN EffectiveOnly, - __in TOKEN_TYPE TokenType, - __out PHANDLE NewTokenHandle - ); - - - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4115) -#pragma warning(default:4201) -#pragma warning(default:4214) -#endif - -#endif // _NTIFS_ - diff --git a/qt-correction-tool/pub/ddk/ntimage.h b/qt-correction-tool/pub/ddk/ntimage.h deleted file mode 100644 index b1abde0..0000000 --- a/qt-correction-tool/pub/ddk/ntimage.h +++ /dev/null @@ -1,2010 +0,0 @@ -/*++ BUILD Version: 0004 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntimage.h - -Abstract: - - This is the include file that describes all image structures. - ---*/ - -#ifndef _NTIMAGE_ -#define _NTIMAGE_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning (disable:4201) /* nonstandard extension used : nameless struct/union */ -#pragma warning (disable:4214) /* nonstandard extension used : bit field types other then int */ - -// -// Define the linker version number. This is temporary to aid -// in debugging with people trying to load images built with -// an older linker. This is not required in the final product. -// - -#define IMAGE_MAJOR_LINKER_VERSION 2 - -// begin_winnt - - -// -// Image Format -// - - -#ifndef _MAC - -#include "pshpack4.h" // 4 byte packing is the default - -#define IMAGE_DOS_SIGNATURE 0x5A4D // MZ -#define IMAGE_OS2_SIGNATURE 0x454E // NE -#define IMAGE_OS2_SIGNATURE_LE 0x454C // LE -#define IMAGE_VXD_SIGNATURE 0x454C // LE -#define IMAGE_NT_SIGNATURE 0x00004550 // PE00 - -#include "pshpack2.h" // 16 bit headers are 2 byte packed - -#else - -#include "pshpack1.h" - -#define IMAGE_DOS_SIGNATURE 0x4D5A // MZ -#define IMAGE_OS2_SIGNATURE 0x4E45 // NE -#define IMAGE_OS2_SIGNATURE_LE 0x4C45 // LE -#define IMAGE_NT_SIGNATURE 0x50450000 // PE00 -#endif - -typedef struct _IMAGE_DOS_HEADER { // DOS .EXE header - USHORT e_magic; // Magic number - USHORT e_cblp; // Bytes on last page of file - USHORT e_cp; // Pages in file - USHORT e_crlc; // Relocations - USHORT e_cparhdr; // Size of header in paragraphs - USHORT e_minalloc; // Minimum extra paragraphs needed - USHORT e_maxalloc; // Maximum extra paragraphs needed - USHORT e_ss; // Initial (relative) SS value - USHORT e_sp; // Initial SP value - USHORT e_csum; // Checksum - USHORT e_ip; // Initial IP value - USHORT e_cs; // Initial (relative) CS value - USHORT e_lfarlc; // File address of relocation table - USHORT e_ovno; // Overlay number - USHORT e_res[4]; // Reserved words - USHORT e_oemid; // OEM identifier (for e_oeminfo) - USHORT e_oeminfo; // OEM information; e_oemid specific - USHORT e_res2[10]; // Reserved words - LONG e_lfanew; // File address of new exe header - } IMAGE_DOS_HEADER, *PIMAGE_DOS_HEADER; - -typedef struct _IMAGE_OS2_HEADER { // OS/2 .EXE header - USHORT ne_magic; // Magic number - CHAR ne_ver; // Version number - CHAR ne_rev; // Revision number - USHORT ne_enttab; // Offset of Entry Table - USHORT ne_cbenttab; // Number of bytes in Entry Table - LONG ne_crc; // Checksum of whole file - USHORT ne_flags; // Flag word - USHORT ne_autodata; // Automatic data segment number - USHORT ne_heap; // Initial heap allocation - USHORT ne_stack; // Initial stack allocation - LONG ne_csip; // Initial CS:IP setting - LONG ne_sssp; // Initial SS:SP setting - USHORT ne_cseg; // Count of file segments - USHORT ne_cmod; // Entries in Module Reference Table - USHORT ne_cbnrestab; // Size of non-resident name table - USHORT ne_segtab; // Offset of Segment Table - USHORT ne_rsrctab; // Offset of Resource Table - USHORT ne_restab; // Offset of resident name table - USHORT ne_modtab; // Offset of Module Reference Table - USHORT ne_imptab; // Offset of Imported Names Table - LONG ne_nrestab; // Offset of Non-resident Names Table - USHORT ne_cmovent; // Count of movable entries - USHORT ne_align; // Segment alignment shift count - USHORT ne_cres; // Count of resource segments - UCHAR ne_exetyp; // Target Operating system - UCHAR ne_flagsothers; // Other .EXE flags - USHORT ne_pretthunks; // offset to return thunks - USHORT ne_psegrefbytes; // offset to segment ref. bytes - USHORT ne_swaparea; // Minimum code swap area size - USHORT ne_expver; // Expected Windows version number - } IMAGE_OS2_HEADER, *PIMAGE_OS2_HEADER; - -typedef struct _IMAGE_VXD_HEADER { // Windows VXD header - USHORT e32_magic; // Magic number - UCHAR e32_border; // The byte ordering for the VXD - UCHAR e32_worder; // The word ordering for the VXD - ULONG e32_level; // The EXE format level for now = 0 - USHORT e32_cpu; // The CPU type - USHORT e32_os; // The OS type - ULONG e32_ver; // Module version - ULONG e32_mflags; // Module flags - ULONG e32_mpages; // Module # pages - ULONG e32_startobj; // Object # for instruction pointer - ULONG e32_eip; // Extended instruction pointer - ULONG e32_stackobj; // Object # for stack pointer - ULONG e32_esp; // Extended stack pointer - ULONG e32_pagesize; // VXD page size - ULONG e32_lastpagesize; // Last page size in VXD - ULONG e32_fixupsize; // Fixup section size - ULONG e32_fixupsum; // Fixup section checksum - ULONG e32_ldrsize; // Loader section size - ULONG e32_ldrsum; // Loader section checksum - ULONG e32_objtab; // Object table offset - ULONG e32_objcnt; // Number of objects in module - ULONG e32_objmap; // Object page map offset - ULONG e32_itermap; // Object iterated data map offset - ULONG e32_rsrctab; // Offset of Resource Table - ULONG e32_rsrccnt; // Number of resource entries - ULONG e32_restab; // Offset of resident name table - ULONG e32_enttab; // Offset of Entry Table - ULONG e32_dirtab; // Offset of Module Directive Table - ULONG e32_dircnt; // Number of module directives - ULONG e32_fpagetab; // Offset of Fixup Page Table - ULONG e32_frectab; // Offset of Fixup Record Table - ULONG e32_impmod; // Offset of Import Module Name Table - ULONG e32_impmodcnt; // Number of entries in Import Module Name Table - ULONG e32_impproc; // Offset of Import Procedure Name Table - ULONG e32_pagesum; // Offset of Per-Page Checksum Table - ULONG e32_datapage; // Offset of Enumerated Data Pages - ULONG e32_preload; // Number of preload pages - ULONG e32_nrestab; // Offset of Non-resident Names Table - ULONG e32_cbnrestab; // Size of Non-resident Name Table - ULONG e32_nressum; // Non-resident Name Table Checksum - ULONG e32_autodata; // Object # for automatic data object - ULONG e32_debuginfo; // Offset of the debugging information - ULONG e32_debuglen; // The length of the debugging info. in bytes - ULONG e32_instpreload; // Number of instance pages in preload section of VXD file - ULONG e32_instdemand; // Number of instance pages in demand load section of VXD file - ULONG e32_heapsize; // Size of heap - for 16-bit apps - UCHAR e32_res3[12]; // Reserved words - ULONG e32_winresoff; - ULONG e32_winreslen; - USHORT e32_devid; // Device ID for VxD - USHORT e32_ddkver; // DDK version for VxD - } IMAGE_VXD_HEADER, *PIMAGE_VXD_HEADER; - -#ifndef _MAC -#include "poppack.h" // Back to 4 byte packing -#endif - -// -// File header format. -// - -typedef struct _IMAGE_FILE_HEADER { - USHORT Machine; - USHORT NumberOfSections; - ULONG TimeDateStamp; - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; - USHORT SizeOfOptionalHeader; - USHORT Characteristics; -} IMAGE_FILE_HEADER, *PIMAGE_FILE_HEADER; - -#define IMAGE_SIZEOF_FILE_HEADER 20 - -#define IMAGE_FILE_RELOCS_STRIPPED 0x0001 // Relocation info stripped from file. -#define IMAGE_FILE_EXECUTABLE_IMAGE 0x0002 // File is executable (i.e. no unresolved externel references). -#define IMAGE_FILE_LINE_NUMS_STRIPPED 0x0004 // Line nunbers stripped from file. -#define IMAGE_FILE_LOCAL_SYMS_STRIPPED 0x0008 // Local symbols stripped from file. -#define IMAGE_FILE_AGGRESIVE_WS_TRIM 0x0010 // Agressively trim working set -#define IMAGE_FILE_LARGE_ADDRESS_AWARE 0x0020 // App can handle >2gb addresses -#define IMAGE_FILE_BYTES_REVERSED_LO 0x0080 // Bytes of machine word are reversed. -#define IMAGE_FILE_32BIT_MACHINE 0x0100 // 32 bit word machine. -#define IMAGE_FILE_DEBUG_STRIPPED 0x0200 // Debugging info stripped from file in .DBG file -#define IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP 0x0400 // If Image is on removable media, copy and run from the swap file. -#define IMAGE_FILE_NET_RUN_FROM_SWAP 0x0800 // If Image is on Net, copy and run from the swap file. -#define IMAGE_FILE_SYSTEM 0x1000 // System File. -#define IMAGE_FILE_DLL 0x2000 // File is a DLL. -#define IMAGE_FILE_UP_SYSTEM_ONLY 0x4000 // File should only be run on a UP machine -#define IMAGE_FILE_BYTES_REVERSED_HI 0x8000 // Bytes of machine word are reversed. - -#define IMAGE_FILE_MACHINE_UNKNOWN 0 -#define IMAGE_FILE_MACHINE_I386 0x014c // Intel 386. -#define IMAGE_FILE_MACHINE_R3000 0x0162 // MIPS little-endian, 0x160 big-endian -#define IMAGE_FILE_MACHINE_R4000 0x0166 // MIPS little-endian -#define IMAGE_FILE_MACHINE_R10000 0x0168 // MIPS little-endian -#define IMAGE_FILE_MACHINE_WCEMIPSV2 0x0169 // MIPS little-endian WCE v2 -#define IMAGE_FILE_MACHINE_ALPHA 0x0184 // Alpha_AXP -#define IMAGE_FILE_MACHINE_SH3 0x01a2 // SH3 little-endian -#define IMAGE_FILE_MACHINE_SH3DSP 0x01a3 -#define IMAGE_FILE_MACHINE_SH3E 0x01a4 // SH3E little-endian -#define IMAGE_FILE_MACHINE_SH4 0x01a6 // SH4 little-endian -#define IMAGE_FILE_MACHINE_SH5 0x01a8 // SH5 -#define IMAGE_FILE_MACHINE_ARM 0x01c0 // ARM Little-Endian -#define IMAGE_FILE_MACHINE_THUMB 0x01c2 -#define IMAGE_FILE_MACHINE_AM33 0x01d3 -#define IMAGE_FILE_MACHINE_POWERPC 0x01F0 // IBM PowerPC Little-Endian -#define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1 -#define IMAGE_FILE_MACHINE_IA64 0x0200 // Intel 64 -#define IMAGE_FILE_MACHINE_MIPS16 0x0266 // MIPS -#define IMAGE_FILE_MACHINE_ALPHA64 0x0284 // ALPHA64 -#define IMAGE_FILE_MACHINE_MIPSFPU 0x0366 // MIPS -#define IMAGE_FILE_MACHINE_MIPSFPU16 0x0466 // MIPS -#define IMAGE_FILE_MACHINE_AXP64 IMAGE_FILE_MACHINE_ALPHA64 -#define IMAGE_FILE_MACHINE_TRICORE 0x0520 // Infineon -#define IMAGE_FILE_MACHINE_CEF 0x0CEF -#define IMAGE_FILE_MACHINE_EBC 0x0EBC // EFI Byte Code -#define IMAGE_FILE_MACHINE_AMD64 0x8664 // AMD64 (K8) -#define IMAGE_FILE_MACHINE_M32R 0x9041 // M32R little-endian -#define IMAGE_FILE_MACHINE_CEE 0xC0EE - -// -// Directory format. -// - -typedef struct _IMAGE_DATA_DIRECTORY { - ULONG VirtualAddress; - ULONG Size; -} IMAGE_DATA_DIRECTORY, *PIMAGE_DATA_DIRECTORY; - -#define IMAGE_NUMBEROF_DIRECTORY_ENTRIES 16 - -// -// Optional header format. -// - -typedef struct _IMAGE_OPTIONAL_HEADER { - // - // Standard fields. - // - - USHORT Magic; - UCHAR MajorLinkerVersion; - UCHAR MinorLinkerVersion; - ULONG SizeOfCode; - ULONG SizeOfInitializedData; - ULONG SizeOfUninitializedData; - ULONG AddressOfEntryPoint; - ULONG BaseOfCode; - ULONG BaseOfData; - - // - // NT additional fields. - // - - ULONG ImageBase; - ULONG SectionAlignment; - ULONG FileAlignment; - USHORT MajorOperatingSystemVersion; - USHORT MinorOperatingSystemVersion; - USHORT MajorImageVersion; - USHORT MinorImageVersion; - USHORT MajorSubsystemVersion; - USHORT MinorSubsystemVersion; - ULONG Win32VersionValue; - ULONG SizeOfImage; - ULONG SizeOfHeaders; - ULONG CheckSum; - USHORT Subsystem; - USHORT DllCharacteristics; - ULONG SizeOfStackReserve; - ULONG SizeOfStackCommit; - ULONG SizeOfHeapReserve; - ULONG SizeOfHeapCommit; - ULONG LoaderFlags; - ULONG NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER32, *PIMAGE_OPTIONAL_HEADER32; - -typedef struct _IMAGE_ROM_OPTIONAL_HEADER { - USHORT Magic; - UCHAR MajorLinkerVersion; - UCHAR MinorLinkerVersion; - ULONG SizeOfCode; - ULONG SizeOfInitializedData; - ULONG SizeOfUninitializedData; - ULONG AddressOfEntryPoint; - ULONG BaseOfCode; - ULONG BaseOfData; - ULONG BaseOfBss; - ULONG GprMask; - ULONG CprMask[4]; - ULONG GpValue; -} IMAGE_ROM_OPTIONAL_HEADER, *PIMAGE_ROM_OPTIONAL_HEADER; - -typedef struct _IMAGE_OPTIONAL_HEADER64 { - USHORT Magic; - UCHAR MajorLinkerVersion; - UCHAR MinorLinkerVersion; - ULONG SizeOfCode; - ULONG SizeOfInitializedData; - ULONG SizeOfUninitializedData; - ULONG AddressOfEntryPoint; - ULONG BaseOfCode; - ULONGLONG ImageBase; - ULONG SectionAlignment; - ULONG FileAlignment; - USHORT MajorOperatingSystemVersion; - USHORT MinorOperatingSystemVersion; - USHORT MajorImageVersion; - USHORT MinorImageVersion; - USHORT MajorSubsystemVersion; - USHORT MinorSubsystemVersion; - ULONG Win32VersionValue; - ULONG SizeOfImage; - ULONG SizeOfHeaders; - ULONG CheckSum; - USHORT Subsystem; - USHORT DllCharacteristics; - ULONGLONG SizeOfStackReserve; - ULONGLONG SizeOfStackCommit; - ULONGLONG SizeOfHeapReserve; - ULONGLONG SizeOfHeapCommit; - ULONG LoaderFlags; - ULONG NumberOfRvaAndSizes; - IMAGE_DATA_DIRECTORY DataDirectory[IMAGE_NUMBEROF_DIRECTORY_ENTRIES]; -} IMAGE_OPTIONAL_HEADER64, *PIMAGE_OPTIONAL_HEADER64; - -#define IMAGE_NT_OPTIONAL_HDR32_MAGIC 0x10b -#define IMAGE_NT_OPTIONAL_HDR64_MAGIC 0x20b -#define IMAGE_ROM_OPTIONAL_HDR_MAGIC 0x107 - -#ifdef _WIN64 -typedef IMAGE_OPTIONAL_HEADER64 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER64 PIMAGE_OPTIONAL_HEADER; -#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR64_MAGIC -#else -typedef IMAGE_OPTIONAL_HEADER32 IMAGE_OPTIONAL_HEADER; -typedef PIMAGE_OPTIONAL_HEADER32 PIMAGE_OPTIONAL_HEADER; -#define IMAGE_NT_OPTIONAL_HDR_MAGIC IMAGE_NT_OPTIONAL_HDR32_MAGIC -#endif - -typedef struct _IMAGE_NT_HEADERS64 { - ULONG Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER64 OptionalHeader; -} IMAGE_NT_HEADERS64, *PIMAGE_NT_HEADERS64; - -typedef struct _IMAGE_NT_HEADERS { - ULONG Signature; - IMAGE_FILE_HEADER FileHeader; - IMAGE_OPTIONAL_HEADER32 OptionalHeader; -} IMAGE_NT_HEADERS32, *PIMAGE_NT_HEADERS32; - -typedef struct _IMAGE_ROM_HEADERS { - IMAGE_FILE_HEADER FileHeader; - IMAGE_ROM_OPTIONAL_HEADER OptionalHeader; -} IMAGE_ROM_HEADERS, *PIMAGE_ROM_HEADERS; - -#ifdef _WIN64 -typedef IMAGE_NT_HEADERS64 IMAGE_NT_HEADERS; -typedef PIMAGE_NT_HEADERS64 PIMAGE_NT_HEADERS; -#else -typedef IMAGE_NT_HEADERS32 IMAGE_NT_HEADERS; -typedef PIMAGE_NT_HEADERS32 PIMAGE_NT_HEADERS; -#endif - -// IMAGE_FIRST_SECTION doesn't need 32/64 versions since the file header is the same either way. - -#define IMAGE_FIRST_SECTION( ntheader ) ((PIMAGE_SECTION_HEADER) \ - ((ULONG_PTR)(ntheader) + \ - FIELD_OFFSET( IMAGE_NT_HEADERS, OptionalHeader ) + \ - ((ntheader))->FileHeader.SizeOfOptionalHeader \ - )) - -// Subsystem Values - -#define IMAGE_SUBSYSTEM_UNKNOWN 0 // Unknown subsystem. -#define IMAGE_SUBSYSTEM_NATIVE 1 // Image doesn't require a subsystem. -#define IMAGE_SUBSYSTEM_WINDOWS_GUI 2 // Image runs in the Windows GUI subsystem. -#define IMAGE_SUBSYSTEM_WINDOWS_CUI 3 // Image runs in the Windows character subsystem. -// end_winnt -// reserved 4 // Old Windows CE subsystem. -// begin_winnt -#define IMAGE_SUBSYSTEM_OS2_CUI 5 // image runs in the OS/2 character subsystem. -#define IMAGE_SUBSYSTEM_POSIX_CUI 7 // image runs in the Posix character subsystem. -#define IMAGE_SUBSYSTEM_NATIVE_WINDOWS 8 // image is a native Win9x driver. -#define IMAGE_SUBSYSTEM_WINDOWS_CE_GUI 9 // Image runs in the Windows CE subsystem. -#define IMAGE_SUBSYSTEM_EFI_APPLICATION 10 // -#define IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER 11 // -#define IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER 12 // -#define IMAGE_SUBSYSTEM_EFI_ROM 13 -#define IMAGE_SUBSYSTEM_XBOX 14 -#define IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION 16 - -// DllCharacteristics Entries - -// IMAGE_LIBRARY_PROCESS_INIT 0x0001 // Reserved. -// IMAGE_LIBRARY_PROCESS_TERM 0x0002 // Reserved. -// IMAGE_LIBRARY_THREAD_INIT 0x0004 // Reserved. -// IMAGE_LIBRARY_THREAD_TERM 0x0008 // Reserved. -#define IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE 0x0040 // DLL can move. -#define IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY 0x0080 // Code Integrity Image -#define IMAGE_DLLCHARACTERISTICS_NX_COMPAT 0x0100 // Image is NX compatible -#define IMAGE_DLLCHARACTERISTICS_NO_ISOLATION 0x0200 // Image understands isolation and doesn't want it -#define IMAGE_DLLCHARACTERISTICS_NO_SEH 0x0400 // Image does not use SEH. No SE handler may reside in this image -#define IMAGE_DLLCHARACTERISTICS_NO_BIND 0x0800 // Do not bind this image. -// 0x1000 // Reserved. -#define IMAGE_DLLCHARACTERISTICS_WDM_DRIVER 0x2000 // Driver uses WDM model -// 0x4000 // Reserved. -#define IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE 0x8000 -// end_winnt -#define IMAGE_DLLCHARACTERISTICS_BROWSERHOSTED 0x1000 // Image is a browser hosted windows client executable -#define IMAGE_DLLCHARACTERISTICS_X86_THUNK 0x1000 // Image is a Wx86 Thunk DLL -// Note: The Borland linker sets IMAGE_LIBRARY_xxx flags in DllCharacteristics - -// LoaderFlags Values - -#define IMAGE_LOADER_FLAGS_COMPLUS 0x00000001 // COM+ image -#define IMAGE_LOADER_FLAGS_SYSTEM_GLOBAL 0x01000000 // Global subsections apply across TS sessions. - -// begin_winnt - -// Directory Entries - -#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory -#define IMAGE_DIRECTORY_ENTRY_IMPORT 1 // Import Directory -#define IMAGE_DIRECTORY_ENTRY_RESOURCE 2 // Resource Directory -#define IMAGE_DIRECTORY_ENTRY_EXCEPTION 3 // Exception Directory -#define IMAGE_DIRECTORY_ENTRY_SECURITY 4 // Security Directory -#define IMAGE_DIRECTORY_ENTRY_BASERELOC 5 // Base Relocation Table -#define IMAGE_DIRECTORY_ENTRY_DEBUG 6 // Debug Directory -// IMAGE_DIRECTORY_ENTRY_COPYRIGHT 7 // (X86 usage) -#define IMAGE_DIRECTORY_ENTRY_ARCHITECTURE 7 // Architecture Specific Data -#define IMAGE_DIRECTORY_ENTRY_GLOBALPTR 8 // RVA of GP -#define IMAGE_DIRECTORY_ENTRY_TLS 9 // TLS Directory -#define IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG 10 // Load Configuration Directory -#define IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT 11 // Bound Import Directory in headers -#define IMAGE_DIRECTORY_ENTRY_IAT 12 // Import Address Table -#define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13 // Delay Load Import Descriptors -#define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14 // COM Runtime descriptor - -// -// Non-COFF Object file header -// - -typedef struct ANON_OBJECT_HEADER { - USHORT Sig1; // Must be IMAGE_FILE_MACHINE_UNKNOWN - USHORT Sig2; // Must be 0xffff - USHORT Version; // >= 1 (implies the CLSID field is present) - USHORT Machine; - ULONG TimeDateStamp; - CLSID ClassID; // Used to invoke CoCreateInstance - ULONG SizeOfData; // Size of data that follows the header -} ANON_OBJECT_HEADER; - -typedef struct ANON_OBJECT_HEADER_V2 { - USHORT Sig1; // Must be IMAGE_FILE_MACHINE_UNKNOWN - USHORT Sig2; // Must be 0xffff - USHORT Version; // >= 2 (implies the Flags field is present - otherwise V1) - USHORT Machine; - ULONG TimeDateStamp; - CLSID ClassID; // Used to invoke CoCreateInstance - ULONG SizeOfData; // Size of data that follows the header - ULONG Flags; // 0x1 -> contains metadata - ULONG MetaDataSize; // Size of CLR metadata - ULONG MetaDataOffset; // Offset of CLR metadata -} ANON_OBJECT_HEADER_V2; - -typedef struct ANON_OBJECT_HEADER_BIGOBJ { - /* same as ANON_OBJECT_HEADER_V2 */ - USHORT Sig1; // Must be IMAGE_FILE_MACHINE_UNKNOWN - USHORT Sig2; // Must be 0xffff - USHORT Version; // >= 2 (implies the Flags field is present) - USHORT Machine; // Actual machine - IMAGE_FILE_MACHINE_xxx - ULONG TimeDateStamp; - CLSID ClassID; // {D1BAA1C7-BAEE-4ba9-AF20-FAF66AA4DCB8} - ULONG SizeOfData; // Size of data that follows the header - ULONG Flags; // 0x1 -> contains metadata - ULONG MetaDataSize; // Size of CLR metadata - ULONG MetaDataOffset; // Offset of CLR metadata - - /* bigobj specifics */ - ULONG NumberOfSections; // extended from WORD - ULONG PointerToSymbolTable; - ULONG NumberOfSymbols; -} ANON_OBJECT_HEADER_BIGOBJ; - -// -// Section header format. -// - -#define IMAGE_SIZEOF_SHORT_NAME 8 - -typedef struct _IMAGE_SECTION_HEADER { - UCHAR Name[IMAGE_SIZEOF_SHORT_NAME]; - union { - ULONG PhysicalAddress; - ULONG VirtualSize; - } Misc; - ULONG VirtualAddress; - ULONG SizeOfRawData; - ULONG PointerToRawData; - ULONG PointerToRelocations; - ULONG PointerToLinenumbers; - USHORT NumberOfRelocations; - USHORT NumberOfLinenumbers; - ULONG Characteristics; -} IMAGE_SECTION_HEADER, *PIMAGE_SECTION_HEADER; - -#define IMAGE_SIZEOF_SECTION_HEADER 40 - -// -// Section characteristics. -// -// IMAGE_SCN_TYPE_REG 0x00000000 // Reserved. -// IMAGE_SCN_TYPE_DSECT 0x00000001 // Reserved. -// IMAGE_SCN_TYPE_NOLOAD 0x00000002 // Reserved. -// IMAGE_SCN_TYPE_GROUP 0x00000004 // Reserved. -#define IMAGE_SCN_TYPE_NO_PAD 0x00000008 // Reserved. -// IMAGE_SCN_TYPE_COPY 0x00000010 // Reserved. - -#define IMAGE_SCN_CNT_CODE 0x00000020 // Section contains code. -#define IMAGE_SCN_CNT_INITIALIZED_DATA 0x00000040 // Section contains initialized data. -#define IMAGE_SCN_CNT_UNINITIALIZED_DATA 0x00000080 // Section contains uninitialized data. - -#define IMAGE_SCN_LNK_OTHER 0x00000100 // Reserved. -#define IMAGE_SCN_LNK_INFO 0x00000200 // Section contains comments or some other type of information. -// IMAGE_SCN_TYPE_OVER 0x00000400 // Reserved. -#define IMAGE_SCN_LNK_REMOVE 0x00000800 // Section contents will not become part of image. -#define IMAGE_SCN_LNK_COMDAT 0x00001000 // Section contents comdat. -// 0x00002000 // Reserved. -// IMAGE_SCN_MEM_PROTECTED - Obsolete 0x00004000 -#define IMAGE_SCN_NO_DEFER_SPEC_EXC 0x00004000 // Reset speculative exceptions handling bits in the TLB entries for this section. -#define IMAGE_SCN_GPREL 0x00008000 // Section content can be accessed relative to GP -#define IMAGE_SCN_MEM_FARDATA 0x00008000 -// IMAGE_SCN_MEM_SYSHEAP - Obsolete 0x00010000 -#define IMAGE_SCN_MEM_PURGEABLE 0x00020000 -#define IMAGE_SCN_MEM_16BIT 0x00020000 -#define IMAGE_SCN_MEM_LOCKED 0x00040000 -#define IMAGE_SCN_MEM_PRELOAD 0x00080000 - -#define IMAGE_SCN_ALIGN_1BYTES 0x00100000 // -#define IMAGE_SCN_ALIGN_2BYTES 0x00200000 // -#define IMAGE_SCN_ALIGN_4BYTES 0x00300000 // -#define IMAGE_SCN_ALIGN_8BYTES 0x00400000 // -#define IMAGE_SCN_ALIGN_16BYTES 0x00500000 // Default alignment if no others are specified. -#define IMAGE_SCN_ALIGN_32BYTES 0x00600000 // -#define IMAGE_SCN_ALIGN_64BYTES 0x00700000 // -#define IMAGE_SCN_ALIGN_128BYTES 0x00800000 // -#define IMAGE_SCN_ALIGN_256BYTES 0x00900000 // -#define IMAGE_SCN_ALIGN_512BYTES 0x00A00000 // -#define IMAGE_SCN_ALIGN_1024BYTES 0x00B00000 // -#define IMAGE_SCN_ALIGN_2048BYTES 0x00C00000 // -#define IMAGE_SCN_ALIGN_4096BYTES 0x00D00000 // -#define IMAGE_SCN_ALIGN_8192BYTES 0x00E00000 // -// Unused 0x00F00000 -#define IMAGE_SCN_ALIGN_MASK 0x00F00000 - -#define IMAGE_SCN_LNK_NRELOC_OVFL 0x01000000 // Section contains extended relocations. -#define IMAGE_SCN_MEM_DISCARDABLE 0x02000000 // Section can be discarded. -#define IMAGE_SCN_MEM_NOT_CACHED 0x04000000 // Section is not cachable. -#define IMAGE_SCN_MEM_NOT_PAGED 0x08000000 // Section is not pageable. -#define IMAGE_SCN_MEM_SHARED 0x10000000 // Section is shareable. -#define IMAGE_SCN_MEM_EXECUTE 0x20000000 // Section is executable. -#define IMAGE_SCN_MEM_READ 0x40000000 // Section is readable. -#define IMAGE_SCN_MEM_WRITE 0x80000000 // Section is writeable. - -// -// TLS Chaacteristic Flags -// -#define IMAGE_SCN_SCALE_INDEX 0x00000001 // Tls index is scaled - -#ifndef _MAC -#include "pshpack2.h" // Symbols, relocs, and linenumbers are 2 byte packed -#endif - -// -// Symbol format. -// - -typedef struct _IMAGE_SYMBOL { - union { - UCHAR ShortName[8]; - struct { - ULONG Short; // if 0, use LongName - ULONG Long; // offset into string table - } Name; - ULONG LongName[2]; // PUCHAR[2] - } N; - ULONG Value; - SHORT SectionNumber; - USHORT Type; - UCHAR StorageClass; - UCHAR NumberOfAuxSymbols; -} IMAGE_SYMBOL; -typedef IMAGE_SYMBOL UNALIGNED *PIMAGE_SYMBOL; - -#define IMAGE_SIZEOF_SYMBOL 18 - -typedef struct _IMAGE_SYMBOL_EX { - union { - UCHAR ShortName[8]; - struct { - ULONG Short; // if 0, use LongName - ULONG Long; // offset into string table - } Name; - ULONG LongName[2]; // PUCHAR [2] - } N; - ULONG Value; - LONG SectionNumber; - USHORT Type; - UCHAR StorageClass; - UCHAR NumberOfAuxSymbols; -} IMAGE_SYMBOL_EX; -typedef IMAGE_SYMBOL_EX UNALIGNED *PIMAGE_SYMBOL_EX; - -// -// Section values. -// -// Symbols have a section number of the section in which they are -// defined. Otherwise, section numbers have the following meanings: -// - -#define IMAGE_SYM_UNDEFINED (SHORT)0 // Symbol is undefined or is common. -#define IMAGE_SYM_ABSOLUTE (SHORT)-1 // Symbol is an absolute value. -#define IMAGE_SYM_DEBUG (SHORT)-2 // Symbol is a special debug item. -#define IMAGE_SYM_SECTION_MAX 0xFEFF // Values 0xFF00-0xFFFF are special -#define IMAGE_SYM_SECTION_MAX_EX MAXLONG - -// -// Type (fundamental) values. -// - -#define IMAGE_SYM_TYPE_NULL 0x0000 // no type. -#define IMAGE_SYM_TYPE_VOID 0x0001 // -#define IMAGE_SYM_TYPE_CHAR 0x0002 // type character. -#define IMAGE_SYM_TYPE_SHORT 0x0003 // type short integer. -#define IMAGE_SYM_TYPE_INT 0x0004 // -#define IMAGE_SYM_TYPE_LONG 0x0005 // -#define IMAGE_SYM_TYPE_FLOAT 0x0006 // -#define IMAGE_SYM_TYPE_DOUBLE 0x0007 // -#define IMAGE_SYM_TYPE_STRUCT 0x0008 // -#define IMAGE_SYM_TYPE_UNION 0x0009 // -#define IMAGE_SYM_TYPE_ENUM 0x000A // enumeration. -#define IMAGE_SYM_TYPE_MOE 0x000B // member of enumeration. -#define IMAGE_SYM_TYPE_UCHAR 0x000C // -#define IMAGE_SYM_TYPE_USHORT 0x000D // -#define IMAGE_SYM_TYPE_UINT 0x000E // -#define IMAGE_SYM_TYPE_ULONG 0x000F // -#define IMAGE_SYM_TYPE_PCODE 0x8000 // -// -// Type (derived) values. -// - -#define IMAGE_SYM_DTYPE_NULL 0 // no derived type. -#define IMAGE_SYM_DTYPE_POINTER 1 // pointer. -#define IMAGE_SYM_DTYPE_FUNCTION 2 // function. -#define IMAGE_SYM_DTYPE_ARRAY 3 // array. - -// -// Storage classes. -// -#define IMAGE_SYM_CLASS_END_OF_FUNCTION (UCHAR)-1 -#define IMAGE_SYM_CLASS_NULL 0x0000 -#define IMAGE_SYM_CLASS_AUTOMATIC 0x0001 -#define IMAGE_SYM_CLASS_EXTERNAL 0x0002 -#define IMAGE_SYM_CLASS_STATIC 0x0003 -#define IMAGE_SYM_CLASS_REGISTER 0x0004 -#define IMAGE_SYM_CLASS_EXTERNAL_DEF 0x0005 -#define IMAGE_SYM_CLASS_LABEL 0x0006 -#define IMAGE_SYM_CLASS_UNDEFINED_LABEL 0x0007 -#define IMAGE_SYM_CLASS_MEMBER_OF_STRUCT 0x0008 -#define IMAGE_SYM_CLASS_ARGUMENT 0x0009 -#define IMAGE_SYM_CLASS_STRUCT_TAG 0x000A -#define IMAGE_SYM_CLASS_MEMBER_OF_UNION 0x000B -#define IMAGE_SYM_CLASS_UNION_TAG 0x000C -#define IMAGE_SYM_CLASS_TYPE_DEFINITION 0x000D -#define IMAGE_SYM_CLASS_UNDEFINED_STATIC 0x000E -#define IMAGE_SYM_CLASS_ENUM_TAG 0x000F -#define IMAGE_SYM_CLASS_MEMBER_OF_ENUM 0x0010 -#define IMAGE_SYM_CLASS_REGISTER_PARAM 0x0011 -#define IMAGE_SYM_CLASS_BIT_FIELD 0x0012 - -#define IMAGE_SYM_CLASS_FAR_EXTERNAL 0x0044 // - -#define IMAGE_SYM_CLASS_BLOCK 0x0064 -#define IMAGE_SYM_CLASS_FUNCTION 0x0065 -#define IMAGE_SYM_CLASS_END_OF_STRUCT 0x0066 -#define IMAGE_SYM_CLASS_FILE 0x0067 -// new -#define IMAGE_SYM_CLASS_SECTION 0x0068 -#define IMAGE_SYM_CLASS_WEAK_EXTERNAL 0x0069 - -#define IMAGE_SYM_CLASS_CLR_TOKEN 0x006B - -// type packing constants - -#define N_BTMASK 0x000F -#define N_TMASK 0x0030 -#define N_TMASK1 0x00C0 -#define N_TMASK2 0x00F0 -#define N_BTSHFT 4 -#define N_TSHIFT 2 -// MACROS - -// Basic Type of x -#define BTYPE(x) ((x) & N_BTMASK) - -// Is x a pointer? -#ifndef ISPTR -#define ISPTR(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_POINTER << N_BTSHFT)) -#endif - -// Is x a function? -#ifndef ISFCN -#define ISFCN(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_FUNCTION << N_BTSHFT)) -#endif - -// Is x an array? - -#ifndef ISARY -#define ISARY(x) (((x) & N_TMASK) == (IMAGE_SYM_DTYPE_ARRAY << N_BTSHFT)) -#endif - -// Is x a structure, union, or enumeration TAG? -#ifndef ISTAG -#define ISTAG(x) ((x)==IMAGE_SYM_CLASS_STRUCT_TAG || (x)==IMAGE_SYM_CLASS_UNION_TAG || (x)==IMAGE_SYM_CLASS_ENUM_TAG) -#endif - -#ifndef INCREF -#define INCREF(x) ((((x)&~N_BTMASK)<>N_TSHIFT)&~N_BTMASK)|((x)&N_BTMASK)) -#endif - -#include - -typedef struct IMAGE_AUX_SYMBOL_TOKEN_DEF { - UCHAR bAuxType; // IMAGE_AUX_SYMBOL_TYPE - UCHAR bReserved; // Must be 0 - ULONG SymbolTableIndex; - UCHAR rgbReserved[12]; // Must be 0 -} IMAGE_AUX_SYMBOL_TOKEN_DEF; - -typedef IMAGE_AUX_SYMBOL_TOKEN_DEF UNALIGNED *PIMAGE_AUX_SYMBOL_TOKEN_DEF; - -#include - -// -// Auxiliary entry format. -// - -typedef union _IMAGE_AUX_SYMBOL { - struct { - ULONG TagIndex; // struct, union, or enum tag index - union { - struct { - USHORT Linenumber; // declaration line number - USHORT Size; // size of struct, union, or enum - } LnSz; - ULONG TotalSize; - } Misc; - union { - struct { // if ISFCN, tag, or .bb - ULONG PointerToLinenumber; - ULONG PointerToNextFunction; - } Function; - struct { // if ISARY, up to 4 dimen. - USHORT Dimension[4]; - } Array; - } FcnAry; - USHORT TvIndex; // tv index - } Sym; - struct { - UCHAR Name[IMAGE_SIZEOF_SYMBOL]; - } File; - struct { - ULONG Length; // section length - USHORT NumberOfRelocations; // number of relocation entries - USHORT NumberOfLinenumbers; // number of line numbers - ULONG CheckSum; // checksum for communal - SHORT Number; // section number to associate with - UCHAR Selection; // communal selection type - UCHAR bReserved; - SHORT HighNumber; // high bits of the section number - } Section; - IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef; - struct { - ULONG crc; - UCHAR rgbReserved[14]; - } CRC; -} IMAGE_AUX_SYMBOL; -typedef IMAGE_AUX_SYMBOL UNALIGNED *PIMAGE_AUX_SYMBOL; - -typedef union _IMAGE_AUX_SYMBOL_EX { - struct { - ULONG WeakDefaultSymIndex; // the weak extern default symbol index - ULONG WeakSearchType; - UCHAR rgbReserved[12]; - } Sym; - struct { - UCHAR Name[sizeof(IMAGE_SYMBOL_EX)]; - } File; - struct { - ULONG Length; // section length - USHORT NumberOfRelocations; // number of relocation entries - USHORT NumberOfLinenumbers; // number of line numbers - ULONG CheckSum; // checksum for communal - SHORT Number; // section number to associate with - UCHAR Selection; // communal selection type - UCHAR bReserved; - SHORT HighNumber; // high bits of the section number - UCHAR rgbReserved[2]; - } Section; - struct{ - IMAGE_AUX_SYMBOL_TOKEN_DEF TokenDef; - UCHAR rgbReserved[2]; - }; - struct { - ULONG crc; - UCHAR rgbReserved[16]; - } CRC; -} IMAGE_AUX_SYMBOL_EX; -typedef IMAGE_AUX_SYMBOL_EX UNALIGNED *PIMAGE_AUX_SYMBOL_EX; - -typedef enum IMAGE_AUX_SYMBOL_TYPE { - IMAGE_AUX_SYMBOL_TYPE_TOKEN_DEF = 1, -} IMAGE_AUX_SYMBOL_TYPE; - - -// -// Communal selection types. -// - -#define IMAGE_COMDAT_SELECT_NODUPLICATES 1 -#define IMAGE_COMDAT_SELECT_ANY 2 -#define IMAGE_COMDAT_SELECT_SAME_SIZE 3 -#define IMAGE_COMDAT_SELECT_EXACT_MATCH 4 -#define IMAGE_COMDAT_SELECT_ASSOCIATIVE 5 -#define IMAGE_COMDAT_SELECT_LARGEST 6 -#define IMAGE_COMDAT_SELECT_NEWEST 7 - -#define IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY 1 -#define IMAGE_WEAK_EXTERN_SEARCH_LIBRARY 2 -#define IMAGE_WEAK_EXTERN_SEARCH_ALIAS 3 - -// -// Relocation format. -// - -typedef struct _IMAGE_RELOCATION { - union { - ULONG VirtualAddress; - ULONG RelocCount; // Set to the real count when IMAGE_SCN_LNK_NRELOC_OVFL is set - } DUMMYUNIONNAME; - ULONG SymbolTableIndex; - USHORT Type; -} IMAGE_RELOCATION; -typedef IMAGE_RELOCATION UNALIGNED *PIMAGE_RELOCATION; - -// -// I386 relocation types. -// -#define IMAGE_REL_I386_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary -#define IMAGE_REL_I386_DIR16 0x0001 // Direct 16-bit reference to the symbols virtual address -#define IMAGE_REL_I386_REL16 0x0002 // PC-relative 16-bit reference to the symbols virtual address -#define IMAGE_REL_I386_DIR32 0x0006 // Direct 32-bit reference to the symbols virtual address -#define IMAGE_REL_I386_DIR32NB 0x0007 // Direct 32-bit reference to the symbols virtual address, base not included -#define IMAGE_REL_I386_SEG12 0x0009 // Direct 16-bit reference to the segment-selector bits of a 32-bit virtual address -#define IMAGE_REL_I386_SECTION 0x000A -#define IMAGE_REL_I386_SECREL 0x000B -#define IMAGE_REL_I386_TOKEN 0x000C // clr token -#define IMAGE_REL_I386_SECREL7 0x000D // 7 bit offset from base of section containing target -#define IMAGE_REL_I386_REL32 0x0014 // PC-relative 32-bit reference to the symbols virtual address - -// -// MIPS relocation types. -// -#define IMAGE_REL_MIPS_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary -#define IMAGE_REL_MIPS_REFHALF 0x0001 -#define IMAGE_REL_MIPS_REFWORD 0x0002 -#define IMAGE_REL_MIPS_JMPADDR 0x0003 -#define IMAGE_REL_MIPS_REFHI 0x0004 -#define IMAGE_REL_MIPS_REFLO 0x0005 -#define IMAGE_REL_MIPS_GPREL 0x0006 -#define IMAGE_REL_MIPS_LITERAL 0x0007 -#define IMAGE_REL_MIPS_SECTION 0x000A -#define IMAGE_REL_MIPS_SECREL 0x000B -#define IMAGE_REL_MIPS_SECRELLO 0x000C // Low 16-bit section relative referemce (used for >32k TLS) -#define IMAGE_REL_MIPS_SECRELHI 0x000D // High 16-bit section relative reference (used for >32k TLS) -#define IMAGE_REL_MIPS_TOKEN 0x000E // clr token -#define IMAGE_REL_MIPS_JMPADDR16 0x0010 -#define IMAGE_REL_MIPS_REFWORDNB 0x0022 -#define IMAGE_REL_MIPS_PAIR 0x0025 - -// -// Alpha Relocation types. -// -#define IMAGE_REL_ALPHA_ABSOLUTE 0x0000 -#define IMAGE_REL_ALPHA_REFLONG 0x0001 -#define IMAGE_REL_ALPHA_REFQUAD 0x0002 -#define IMAGE_REL_ALPHA_GPREL32 0x0003 -#define IMAGE_REL_ALPHA_LITERAL 0x0004 -#define IMAGE_REL_ALPHA_LITUSE 0x0005 -#define IMAGE_REL_ALPHA_GPDISP 0x0006 -#define IMAGE_REL_ALPHA_BRADDR 0x0007 -#define IMAGE_REL_ALPHA_HINT 0x0008 -#define IMAGE_REL_ALPHA_INLINE_REFLONG 0x0009 -#define IMAGE_REL_ALPHA_REFHI 0x000A -#define IMAGE_REL_ALPHA_REFLO 0x000B -#define IMAGE_REL_ALPHA_PAIR 0x000C -#define IMAGE_REL_ALPHA_MATCH 0x000D -#define IMAGE_REL_ALPHA_SECTION 0x000E -#define IMAGE_REL_ALPHA_SECREL 0x000F -#define IMAGE_REL_ALPHA_REFLONGNB 0x0010 -#define IMAGE_REL_ALPHA_SECRELLO 0x0011 // Low 16-bit section relative reference -#define IMAGE_REL_ALPHA_SECRELHI 0x0012 // High 16-bit section relative reference -#define IMAGE_REL_ALPHA_REFQ3 0x0013 // High 16 bits of 48 bit reference -#define IMAGE_REL_ALPHA_REFQ2 0x0014 // Middle 16 bits of 48 bit reference -#define IMAGE_REL_ALPHA_REFQ1 0x0015 // Low 16 bits of 48 bit reference -#define IMAGE_REL_ALPHA_GPRELLO 0x0016 // Low 16-bit GP relative reference -#define IMAGE_REL_ALPHA_GPRELHI 0x0017 // High 16-bit GP relative reference - -// -// IBM PowerPC relocation types. -// -#define IMAGE_REL_PPC_ABSOLUTE 0x0000 // NOP -#define IMAGE_REL_PPC_ADDR64 0x0001 // 64-bit address -#define IMAGE_REL_PPC_ADDR32 0x0002 // 32-bit address -#define IMAGE_REL_PPC_ADDR24 0x0003 // 26-bit address, shifted left 2 (branch absolute) -#define IMAGE_REL_PPC_ADDR16 0x0004 // 16-bit address -#define IMAGE_REL_PPC_ADDR14 0x0005 // 16-bit address, shifted left 2 (load doubleword) -#define IMAGE_REL_PPC_REL24 0x0006 // 26-bit PC-relative offset, shifted left 2 (branch relative) -#define IMAGE_REL_PPC_REL14 0x0007 // 16-bit PC-relative offset, shifted left 2 (br cond relative) -#define IMAGE_REL_PPC_TOCREL16 0x0008 // 16-bit offset from TOC base -#define IMAGE_REL_PPC_TOCREL14 0x0009 // 16-bit offset from TOC base, shifted left 2 (load doubleword) - -#define IMAGE_REL_PPC_ADDR32NB 0x000A // 32-bit addr w/o image base -#define IMAGE_REL_PPC_SECREL 0x000B // va of containing section (as in an image sectionhdr) -#define IMAGE_REL_PPC_SECTION 0x000C // sectionheader number -#define IMAGE_REL_PPC_IFGLUE 0x000D // substitute TOC restore instruction iff symbol is glue code -#define IMAGE_REL_PPC_IMGLUE 0x000E // symbol is glue code; virtual address is TOC restore instruction -#define IMAGE_REL_PPC_SECREL16 0x000F // va of containing section (limited to 16 bits) -#define IMAGE_REL_PPC_REFHI 0x0010 -#define IMAGE_REL_PPC_REFLO 0x0011 -#define IMAGE_REL_PPC_PAIR 0x0012 -#define IMAGE_REL_PPC_SECRELLO 0x0013 // Low 16-bit section relative reference (used for >32k TLS) -#define IMAGE_REL_PPC_SECRELHI 0x0014 // High 16-bit section relative reference (used for >32k TLS) -#define IMAGE_REL_PPC_GPREL 0x0015 -#define IMAGE_REL_PPC_TOKEN 0x0016 // clr token - -#define IMAGE_REL_PPC_TYPEMASK 0x00FF // mask to isolate above values in IMAGE_RELOCATION.Type - -// Flag bits in IMAGE_RELOCATION.TYPE - -#define IMAGE_REL_PPC_NEG 0x0100 // subtract reloc value rather than adding it -#define IMAGE_REL_PPC_BRTAKEN 0x0200 // fix branch prediction bit to predict branch taken -#define IMAGE_REL_PPC_BRNTAKEN 0x0400 // fix branch prediction bit to predict branch not taken -#define IMAGE_REL_PPC_TOCDEFN 0x0800 // toc slot defined in file (or, data in toc) - -// -// Hitachi SH3 relocation types. -// -#define IMAGE_REL_SH3_ABSOLUTE 0x0000 // No relocation -#define IMAGE_REL_SH3_DIRECT16 0x0001 // 16 bit direct -#define IMAGE_REL_SH3_DIRECT32 0x0002 // 32 bit direct -#define IMAGE_REL_SH3_DIRECT8 0x0003 // 8 bit direct, -128..255 -#define IMAGE_REL_SH3_DIRECT8_WORD 0x0004 // 8 bit direct .W (0 ext.) -#define IMAGE_REL_SH3_DIRECT8_LONG 0x0005 // 8 bit direct .L (0 ext.) -#define IMAGE_REL_SH3_DIRECT4 0x0006 // 4 bit direct (0 ext.) -#define IMAGE_REL_SH3_DIRECT4_WORD 0x0007 // 4 bit direct .W (0 ext.) -#define IMAGE_REL_SH3_DIRECT4_LONG 0x0008 // 4 bit direct .L (0 ext.) -#define IMAGE_REL_SH3_PCREL8_WORD 0x0009 // 8 bit PC relative .W -#define IMAGE_REL_SH3_PCREL8_LONG 0x000A // 8 bit PC relative .L -#define IMAGE_REL_SH3_PCREL12_WORD 0x000B // 12 LSB PC relative .W -#define IMAGE_REL_SH3_STARTOF_SECTION 0x000C // Start of EXE section -#define IMAGE_REL_SH3_SIZEOF_SECTION 0x000D // Size of EXE section -#define IMAGE_REL_SH3_SECTION 0x000E // Section table index -#define IMAGE_REL_SH3_SECREL 0x000F // Offset within section -#define IMAGE_REL_SH3_DIRECT32_NB 0x0010 // 32 bit direct not based -#define IMAGE_REL_SH3_GPREL4_LONG 0x0011 // GP-relative addressing -#define IMAGE_REL_SH3_TOKEN 0x0012 // clr token -#define IMAGE_REL_SHM_PCRELPT 0x0013 // Offset from current - // instruction in longwords - // if not NOMODE, insert the - // inverse of the low bit at - // bit 32 to select PTA/PTB -#define IMAGE_REL_SHM_REFLO 0x0014 // Low bits of 32-bit address -#define IMAGE_REL_SHM_REFHALF 0x0015 // High bits of 32-bit address -#define IMAGE_REL_SHM_RELLO 0x0016 // Low bits of relative reference -#define IMAGE_REL_SHM_RELHALF 0x0017 // High bits of relative reference -#define IMAGE_REL_SHM_PAIR 0x0018 // offset operand for relocation - -#define IMAGE_REL_SH_NOMODE 0x8000 // relocation ignores section mode - - -#define IMAGE_REL_ARM_ABSOLUTE 0x0000 // No relocation required -#define IMAGE_REL_ARM_ADDR32 0x0001 // 32 bit address -#define IMAGE_REL_ARM_ADDR32NB 0x0002 // 32 bit address w/o image base -#define IMAGE_REL_ARM_BRANCH24 0x0003 // 24 bit offset << 2 & sign ext. -#define IMAGE_REL_ARM_BRANCH11 0x0004 // Thumb: 2 11 bit offsets -#define IMAGE_REL_ARM_TOKEN 0x0005 // clr token -#define IMAGE_REL_ARM_GPREL12 0x0006 // GP-relative addressing (ARM) -#define IMAGE_REL_ARM_GPREL7 0x0007 // GP-relative addressing (Thumb) -#define IMAGE_REL_ARM_BLX24 0x0008 -#define IMAGE_REL_ARM_BLX11 0x0009 -#define IMAGE_REL_ARM_SECTION 0x000E // Section table index -#define IMAGE_REL_ARM_SECREL 0x000F // Offset within section - -#define IMAGE_REL_AM_ABSOLUTE 0x0000 -#define IMAGE_REL_AM_ADDR32 0x0001 -#define IMAGE_REL_AM_ADDR32NB 0x0002 -#define IMAGE_REL_AM_CALL32 0x0003 -#define IMAGE_REL_AM_FUNCINFO 0x0004 -#define IMAGE_REL_AM_REL32_1 0x0005 -#define IMAGE_REL_AM_REL32_2 0x0006 -#define IMAGE_REL_AM_SECREL 0x0007 -#define IMAGE_REL_AM_SECTION 0x0008 -#define IMAGE_REL_AM_TOKEN 0x0009 - -// -// x64 relocations -// -#define IMAGE_REL_AMD64_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary -#define IMAGE_REL_AMD64_ADDR64 0x0001 // 64-bit address (VA). -#define IMAGE_REL_AMD64_ADDR32 0x0002 // 32-bit address (VA). -#define IMAGE_REL_AMD64_ADDR32NB 0x0003 // 32-bit address w/o image base (RVA). -#define IMAGE_REL_AMD64_REL32 0x0004 // 32-bit relative address from byte following reloc -#define IMAGE_REL_AMD64_REL32_1 0x0005 // 32-bit relative address from byte distance 1 from reloc -#define IMAGE_REL_AMD64_REL32_2 0x0006 // 32-bit relative address from byte distance 2 from reloc -#define IMAGE_REL_AMD64_REL32_3 0x0007 // 32-bit relative address from byte distance 3 from reloc -#define IMAGE_REL_AMD64_REL32_4 0x0008 // 32-bit relative address from byte distance 4 from reloc -#define IMAGE_REL_AMD64_REL32_5 0x0009 // 32-bit relative address from byte distance 5 from reloc -#define IMAGE_REL_AMD64_SECTION 0x000A // Section index -#define IMAGE_REL_AMD64_SECREL 0x000B // 32 bit offset from base of section containing target -#define IMAGE_REL_AMD64_SECREL7 0x000C // 7 bit unsigned offset from base of section containing target -#define IMAGE_REL_AMD64_TOKEN 0x000D // 32 bit metadata token -#define IMAGE_REL_AMD64_SREL32 0x000E // 32 bit signed span-dependent value emitted into object -#define IMAGE_REL_AMD64_PAIR 0x000F -#define IMAGE_REL_AMD64_SSPAN32 0x0010 // 32 bit signed span-dependent value applied at link time - -// -// IA64 relocation types. -// -#define IMAGE_REL_IA64_ABSOLUTE 0x0000 -#define IMAGE_REL_IA64_IMM14 0x0001 -#define IMAGE_REL_IA64_IMM22 0x0002 -#define IMAGE_REL_IA64_IMM64 0x0003 -#define IMAGE_REL_IA64_DIR32 0x0004 -#define IMAGE_REL_IA64_DIR64 0x0005 -#define IMAGE_REL_IA64_PCREL21B 0x0006 -#define IMAGE_REL_IA64_PCREL21M 0x0007 -#define IMAGE_REL_IA64_PCREL21F 0x0008 -#define IMAGE_REL_IA64_GPREL22 0x0009 -#define IMAGE_REL_IA64_LTOFF22 0x000A -#define IMAGE_REL_IA64_SECTION 0x000B -#define IMAGE_REL_IA64_SECREL22 0x000C -#define IMAGE_REL_IA64_SECREL64I 0x000D -#define IMAGE_REL_IA64_SECREL32 0x000E -// -#define IMAGE_REL_IA64_DIR32NB 0x0010 -#define IMAGE_REL_IA64_SREL14 0x0011 -#define IMAGE_REL_IA64_SREL22 0x0012 -#define IMAGE_REL_IA64_SREL32 0x0013 -#define IMAGE_REL_IA64_UREL32 0x0014 -#define IMAGE_REL_IA64_PCREL60X 0x0015 // This is always a BRL and never converted -#define IMAGE_REL_IA64_PCREL60B 0x0016 // If possible, convert to MBB bundle with NOP.B in slot 1 -#define IMAGE_REL_IA64_PCREL60F 0x0017 // If possible, convert to MFB bundle with NOP.F in slot 1 -#define IMAGE_REL_IA64_PCREL60I 0x0018 // If possible, convert to MIB bundle with NOP.I in slot 1 -#define IMAGE_REL_IA64_PCREL60M 0x0019 // If possible, convert to MMB bundle with NOP.M in slot 1 -#define IMAGE_REL_IA64_IMMGPREL64 0x001A -#define IMAGE_REL_IA64_TOKEN 0x001B // clr token -#define IMAGE_REL_IA64_GPREL32 0x001C -#define IMAGE_REL_IA64_ADDEND 0x001F - -// -// CEF relocation types. -// -#define IMAGE_REL_CEF_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary -#define IMAGE_REL_CEF_ADDR32 0x0001 // 32-bit address (VA). -#define IMAGE_REL_CEF_ADDR64 0x0002 // 64-bit address (VA). -#define IMAGE_REL_CEF_ADDR32NB 0x0003 // 32-bit address w/o image base (RVA). -#define IMAGE_REL_CEF_SECTION 0x0004 // Section index -#define IMAGE_REL_CEF_SECREL 0x0005 // 32 bit offset from base of section containing target -#define IMAGE_REL_CEF_TOKEN 0x0006 // 32 bit metadata token - -// -// clr relocation types. -// -#define IMAGE_REL_CEE_ABSOLUTE 0x0000 // Reference is absolute, no relocation is necessary -#define IMAGE_REL_CEE_ADDR32 0x0001 // 32-bit address (VA). -#define IMAGE_REL_CEE_ADDR64 0x0002 // 64-bit address (VA). -#define IMAGE_REL_CEE_ADDR32NB 0x0003 // 32-bit address w/o image base (RVA). -#define IMAGE_REL_CEE_SECTION 0x0004 // Section index -#define IMAGE_REL_CEE_SECREL 0x0005 // 32 bit offset from base of section containing target -#define IMAGE_REL_CEE_TOKEN 0x0006 // 32 bit metadata token - - -#define IMAGE_REL_M32R_ABSOLUTE 0x0000 // No relocation required -#define IMAGE_REL_M32R_ADDR32 0x0001 // 32 bit address -#define IMAGE_REL_M32R_ADDR32NB 0x0002 // 32 bit address w/o image base -#define IMAGE_REL_M32R_ADDR24 0x0003 // 24 bit address -#define IMAGE_REL_M32R_GPREL16 0x0004 // GP relative addressing -#define IMAGE_REL_M32R_PCREL24 0x0005 // 24 bit offset << 2 & sign ext. -#define IMAGE_REL_M32R_PCREL16 0x0006 // 16 bit offset << 2 & sign ext. -#define IMAGE_REL_M32R_PCREL8 0x0007 // 8 bit offset << 2 & sign ext. -#define IMAGE_REL_M32R_REFHALF 0x0008 // 16 MSBs -#define IMAGE_REL_M32R_REFHI 0x0009 // 16 MSBs; adj for LSB sign ext. -#define IMAGE_REL_M32R_REFLO 0x000A // 16 LSBs -#define IMAGE_REL_M32R_PAIR 0x000B // Link HI and LO -#define IMAGE_REL_M32R_SECTION 0x000C // Section table index -#define IMAGE_REL_M32R_SECREL32 0x000D // 32 bit section relative reference -#define IMAGE_REL_M32R_TOKEN 0x000E // clr token - -#define IMAGE_REL_EBC_ABSOLUTE 0x0000 // No relocation required -#define IMAGE_REL_EBC_ADDR32NB 0x0001 // 32 bit address w/o image base -#define IMAGE_REL_EBC_REL32 0x0002 // 32-bit relative address from byte following reloc -#define IMAGE_REL_EBC_SECTION 0x0003 // Section table index -#define IMAGE_REL_EBC_SECREL 0x0004 // Offset within section - -#define EXT_IMM64(Value, Address, Size, InstPos, ValPos) /* Intel-IA64-Filler */ \ - Value |= (((ULONGLONG)((*(Address) >> InstPos) & (((ULONGLONG)1 << Size) - 1))) << ValPos) // Intel-IA64-Filler - -#define INS_IMM64(Value, Address, Size, InstPos, ValPos) /* Intel-IA64-Filler */\ - *(PULONG)Address = (*(PULONG)Address & ~(((1 << Size) - 1) << InstPos)) | /* Intel-IA64-Filler */\ - ((ULONG)((((ULONGLONG)Value >> ValPos) & (((ULONGLONG)1 << Size) - 1))) << InstPos) // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM7B_INST_WORD_X 3 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM7B_SIZE_X 7 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM7B_INST_WORD_POS_X 4 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM7B_VAL_POS_X 0 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM9D_INST_WORD_X 3 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM9D_SIZE_X 9 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM9D_INST_WORD_POS_X 18 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM9D_VAL_POS_X 7 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM5C_INST_WORD_X 3 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM5C_SIZE_X 5 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM5C_INST_WORD_POS_X 13 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM5C_VAL_POS_X 16 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IC_INST_WORD_X 3 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IC_SIZE_X 1 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IC_INST_WORD_POS_X 12 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IC_VAL_POS_X 21 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM41a_INST_WORD_X 1 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41a_SIZE_X 10 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41a_INST_WORD_POS_X 14 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41a_VAL_POS_X 22 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM41b_INST_WORD_X 1 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41b_SIZE_X 8 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41b_INST_WORD_POS_X 24 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41b_VAL_POS_X 32 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_IMM41c_INST_WORD_X 2 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41c_SIZE_X 23 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41c_INST_WORD_POS_X 0 // Intel-IA64-Filler -#define EMARCH_ENC_I17_IMM41c_VAL_POS_X 40 // Intel-IA64-Filler - -#define EMARCH_ENC_I17_SIGN_INST_WORD_X 3 // Intel-IA64-Filler -#define EMARCH_ENC_I17_SIGN_SIZE_X 1 // Intel-IA64-Filler -#define EMARCH_ENC_I17_SIGN_INST_WORD_POS_X 27 // Intel-IA64-Filler -#define EMARCH_ENC_I17_SIGN_VAL_POS_X 63 // Intel-IA64-Filler - -#define X3_OPCODE_INST_WORD_X 3 // Intel-IA64-Filler -#define X3_OPCODE_SIZE_X 4 // Intel-IA64-Filler -#define X3_OPCODE_INST_WORD_POS_X 28 // Intel-IA64-Filler -#define X3_OPCODE_SIGN_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_I_INST_WORD_X 3 // Intel-IA64-Filler -#define X3_I_SIZE_X 1 // Intel-IA64-Filler -#define X3_I_INST_WORD_POS_X 27 // Intel-IA64-Filler -#define X3_I_SIGN_VAL_POS_X 59 // Intel-IA64-Filler - -#define X3_D_WH_INST_WORD_X 3 // Intel-IA64-Filler -#define X3_D_WH_SIZE_X 3 // Intel-IA64-Filler -#define X3_D_WH_INST_WORD_POS_X 24 // Intel-IA64-Filler -#define X3_D_WH_SIGN_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_IMM20_INST_WORD_X 3 // Intel-IA64-Filler -#define X3_IMM20_SIZE_X 20 // Intel-IA64-Filler -#define X3_IMM20_INST_WORD_POS_X 4 // Intel-IA64-Filler -#define X3_IMM20_SIGN_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_IMM39_1_INST_WORD_X 2 // Intel-IA64-Filler -#define X3_IMM39_1_SIZE_X 23 // Intel-IA64-Filler -#define X3_IMM39_1_INST_WORD_POS_X 0 // Intel-IA64-Filler -#define X3_IMM39_1_SIGN_VAL_POS_X 36 // Intel-IA64-Filler - -#define X3_IMM39_2_INST_WORD_X 1 // Intel-IA64-Filler -#define X3_IMM39_2_SIZE_X 16 // Intel-IA64-Filler -#define X3_IMM39_2_INST_WORD_POS_X 16 // Intel-IA64-Filler -#define X3_IMM39_2_SIGN_VAL_POS_X 20 // Intel-IA64-Filler - -#define X3_P_INST_WORD_X 3 // Intel-IA64-Filler -#define X3_P_SIZE_X 4 // Intel-IA64-Filler -#define X3_P_INST_WORD_POS_X 0 // Intel-IA64-Filler -#define X3_P_SIGN_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_TMPLT_INST_WORD_X 0 // Intel-IA64-Filler -#define X3_TMPLT_SIZE_X 4 // Intel-IA64-Filler -#define X3_TMPLT_INST_WORD_POS_X 0 // Intel-IA64-Filler -#define X3_TMPLT_SIGN_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_BTYPE_QP_INST_WORD_X 2 // Intel-IA64-Filler -#define X3_BTYPE_QP_SIZE_X 9 // Intel-IA64-Filler -#define X3_BTYPE_QP_INST_WORD_POS_X 23 // Intel-IA64-Filler -#define X3_BTYPE_QP_INST_VAL_POS_X 0 // Intel-IA64-Filler - -#define X3_EMPTY_INST_WORD_X 1 // Intel-IA64-Filler -#define X3_EMPTY_SIZE_X 2 // Intel-IA64-Filler -#define X3_EMPTY_INST_WORD_POS_X 14 // Intel-IA64-Filler -#define X3_EMPTY_INST_VAL_POS_X 0 // Intel-IA64-Filler - -// -// Line number format. -// - -typedef struct _IMAGE_LINENUMBER { - union { - ULONG SymbolTableIndex; // Symbol table index of function name if Linenumber is 0. - ULONG VirtualAddress; // Virtual address of line number. - } Type; - USHORT Linenumber; // Line number. -} IMAGE_LINENUMBER; -typedef IMAGE_LINENUMBER UNALIGNED *PIMAGE_LINENUMBER; - -#ifndef _MAC -#include "poppack.h" // Back to 4 byte packing -#endif - -// -// Based relocation format. -// - -typedef struct _IMAGE_BASE_RELOCATION { - ULONG VirtualAddress; - ULONG SizeOfBlock; -// USHORT TypeOffset[1]; -} IMAGE_BASE_RELOCATION; -typedef IMAGE_BASE_RELOCATION UNALIGNED * PIMAGE_BASE_RELOCATION; - -// -// Based relocation types. -// - -#define IMAGE_REL_BASED_ABSOLUTE 0 -#define IMAGE_REL_BASED_HIGH 1 -#define IMAGE_REL_BASED_LOW 2 -#define IMAGE_REL_BASED_HIGHLOW 3 -#define IMAGE_REL_BASED_HIGHADJ 4 -#define IMAGE_REL_BASED_MIPS_JMPADDR 5 -// end_winnt -#define IMAGE_REL_BASED_SECTION 6 -#define IMAGE_REL_BASED_REL32 7 -// IMAGE_REL_BASED_VXD_RELATIVE 8 -// begin_winnt -#define IMAGE_REL_BASED_MIPS_JMPADDR16 9 -#define IMAGE_REL_BASED_IA64_IMM64 9 -#define IMAGE_REL_BASED_DIR64 10 - - -// -// Archive format. -// - -#define IMAGE_ARCHIVE_START_SIZE 8 -#define IMAGE_ARCHIVE_START "!\n" -#define IMAGE_ARCHIVE_END "`\n" -#define IMAGE_ARCHIVE_PAD "\n" -#define IMAGE_ARCHIVE_LINKER_MEMBER "/ " -#define IMAGE_ARCHIVE_LONGNAMES_MEMBER "// " - -typedef struct _IMAGE_ARCHIVE_MEMBER_HEADER { - UCHAR Name[16]; // File member name - `/' terminated. - UCHAR Date[12]; // File member date - decimal. - UCHAR UserID[6]; // File member user id - decimal. - UCHAR GroupID[6]; // File member group id - decimal. - UCHAR Mode[8]; // File member mode - octal. - UCHAR Size[10]; // File member size - decimal. - UCHAR EndHeader[2]; // String to end header. -} IMAGE_ARCHIVE_MEMBER_HEADER, *PIMAGE_ARCHIVE_MEMBER_HEADER; - -#define IMAGE_SIZEOF_ARCHIVE_MEMBER_HDR 60 - -// -// DLL support. -// - -// -// Export Format -// - -typedef struct _IMAGE_EXPORT_DIRECTORY { - ULONG Characteristics; - ULONG TimeDateStamp; - USHORT MajorVersion; - USHORT MinorVersion; - ULONG Name; - ULONG Base; - ULONG NumberOfFunctions; - ULONG NumberOfNames; - ULONG AddressOfFunctions; // RVA from base of image - ULONG AddressOfNames; // RVA from base of image - ULONG AddressOfNameOrdinals; // RVA from base of image -} IMAGE_EXPORT_DIRECTORY, *PIMAGE_EXPORT_DIRECTORY; - -// -// Import Format -// - -typedef struct _IMAGE_IMPORT_BY_NAME { - USHORT Hint; - UCHAR Name[1]; -} IMAGE_IMPORT_BY_NAME, *PIMAGE_IMPORT_BY_NAME; - -#include "pshpack8.h" // Use align 8 for the 64-bit IAT. - -typedef struct _IMAGE_THUNK_DATA64 { - union { - ULONGLONG ForwarderString; // PUCHAR - ULONGLONG Function; // PULONG - ULONGLONG Ordinal; - ULONGLONG AddressOfData; // PIMAGE_IMPORT_BY_NAME - } u1; -} IMAGE_THUNK_DATA64; -typedef IMAGE_THUNK_DATA64 * PIMAGE_THUNK_DATA64; - -#include "poppack.h" // Back to 4 byte packing - -typedef struct _IMAGE_THUNK_DATA32 { - union { - ULONG ForwarderString; // PUCHAR - ULONG Function; // PULONG - ULONG Ordinal; - ULONG AddressOfData; // PIMAGE_IMPORT_BY_NAME - } u1; -} IMAGE_THUNK_DATA32; -typedef IMAGE_THUNK_DATA32 * PIMAGE_THUNK_DATA32; - -#define IMAGE_ORDINAL_FLAG64 0x8000000000000000 -#define IMAGE_ORDINAL_FLAG32 0x80000000 -#define IMAGE_ORDINAL64(Ordinal) (Ordinal & 0xffff) -#define IMAGE_ORDINAL32(Ordinal) (Ordinal & 0xffff) -#define IMAGE_SNAP_BY_ORDINAL64(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG64) != 0) -#define IMAGE_SNAP_BY_ORDINAL32(Ordinal) ((Ordinal & IMAGE_ORDINAL_FLAG32) != 0) - -// -// Thread Local Storage -// - -typedef VOID -(NTAPI *PIMAGE_TLS_CALLBACK) ( - PVOID DllHandle, - ULONG Reason, - PVOID Reserved - ); - -typedef struct _IMAGE_TLS_DIRECTORY64 { - ULONGLONG StartAddressOfRawData; - ULONGLONG EndAddressOfRawData; - ULONGLONG AddressOfIndex; // PULONG - ULONGLONG AddressOfCallBacks; // PIMAGE_TLS_CALLBACK *; - ULONG SizeOfZeroFill; - ULONG Characteristics; -} IMAGE_TLS_DIRECTORY64; -typedef IMAGE_TLS_DIRECTORY64 * PIMAGE_TLS_DIRECTORY64; - -typedef struct _IMAGE_TLS_DIRECTORY32 { - ULONG StartAddressOfRawData; - ULONG EndAddressOfRawData; - ULONG AddressOfIndex; // PULONG - ULONG AddressOfCallBacks; // PIMAGE_TLS_CALLBACK * - ULONG SizeOfZeroFill; - ULONG Characteristics; -} IMAGE_TLS_DIRECTORY32; -typedef IMAGE_TLS_DIRECTORY32 * PIMAGE_TLS_DIRECTORY32; - -#ifdef _WIN64 -#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG64 -#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL64(Ordinal) -typedef IMAGE_THUNK_DATA64 IMAGE_THUNK_DATA; -typedef PIMAGE_THUNK_DATA64 PIMAGE_THUNK_DATA; -#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL64(Ordinal) -typedef IMAGE_TLS_DIRECTORY64 IMAGE_TLS_DIRECTORY; -typedef PIMAGE_TLS_DIRECTORY64 PIMAGE_TLS_DIRECTORY; -#else -#define IMAGE_ORDINAL_FLAG IMAGE_ORDINAL_FLAG32 -#define IMAGE_ORDINAL(Ordinal) IMAGE_ORDINAL32(Ordinal) -typedef IMAGE_THUNK_DATA32 IMAGE_THUNK_DATA; -typedef PIMAGE_THUNK_DATA32 PIMAGE_THUNK_DATA; -#define IMAGE_SNAP_BY_ORDINAL(Ordinal) IMAGE_SNAP_BY_ORDINAL32(Ordinal) -typedef IMAGE_TLS_DIRECTORY32 IMAGE_TLS_DIRECTORY; -typedef PIMAGE_TLS_DIRECTORY32 PIMAGE_TLS_DIRECTORY; -#endif - -typedef struct _IMAGE_IMPORT_DESCRIPTOR { - union { - ULONG Characteristics; // 0 for terminating null import descriptor - ULONG OriginalFirstThunk; // RVA to original unbound IAT (PIMAGE_THUNK_DATA) - } DUMMYUNIONNAME; - ULONG TimeDateStamp; // 0 if not bound, - // -1 if bound, and real date\time stamp - // in IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT (new BIND) - // O.W. date/time stamp of DLL bound to (Old BIND) - - ULONG ForwarderChain; // -1 if no forwarders - ULONG Name; - ULONG FirstThunk; // RVA to IAT (if bound this IAT has actual addresses) -} IMAGE_IMPORT_DESCRIPTOR; -typedef IMAGE_IMPORT_DESCRIPTOR UNALIGNED *PIMAGE_IMPORT_DESCRIPTOR; - -// -// New format import descriptors pointed to by DataDirectory[ IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT ] -// - -typedef struct _IMAGE_BOUND_IMPORT_DESCRIPTOR { - ULONG TimeDateStamp; - USHORT OffsetModuleName; - USHORT NumberOfModuleForwarderRefs; -// Array of zero or more IMAGE_BOUND_FORWARDER_REF follows -} IMAGE_BOUND_IMPORT_DESCRIPTOR, *PIMAGE_BOUND_IMPORT_DESCRIPTOR; - -typedef struct _IMAGE_BOUND_FORWARDER_REF { - ULONG TimeDateStamp; - USHORT OffsetModuleName; - USHORT Reserved; -} IMAGE_BOUND_FORWARDER_REF, *PIMAGE_BOUND_FORWARDER_REF; - -// -// Resource Format. -// - -// -// Resource directory consists of two counts, following by a variable length -// array of directory entries. The first count is the number of entries at -// beginning of the array that have actual names associated with each entry. -// The entries are in ascending order, case insensitive strings. The second -// count is the number of entries that immediately follow the named entries. -// This second count identifies the number of entries that have 16-bit integer -// Ids as their name. These entries are also sorted in ascending order. -// -// This structure allows fast lookup by either name or number, but for any -// given resource entry only one form of lookup is supported, not both. -// This is consistant with the syntax of the .RC file and the .RES file. -// - -typedef struct _IMAGE_RESOURCE_DIRECTORY { - ULONG Characteristics; - ULONG TimeDateStamp; - USHORT MajorVersion; - USHORT MinorVersion; - USHORT NumberOfNamedEntries; - USHORT NumberOfIdEntries; -// IMAGE_RESOURCE_DIRECTORY_ENTRY DirectoryEntries[]; -} IMAGE_RESOURCE_DIRECTORY, *PIMAGE_RESOURCE_DIRECTORY; - -#define IMAGE_RESOURCE_NAME_IS_STRING 0x80000000 -#define IMAGE_RESOURCE_DATA_IS_DIRECTORY 0x80000000 -// -// Each directory contains the 32-bit Name of the entry and an offset, -// relative to the beginning of the resource directory of the data associated -// with this directory entry. If the name of the entry is an actual text -// string instead of an integer Id, then the high order bit of the name field -// is set to one and the low order 31-bits are an offset, relative to the -// beginning of the resource directory of the string, which is of type -// IMAGE_RESOURCE_DIRECTORY_STRING. Otherwise the high bit is clear and the -// low-order 16-bits are the integer Id that identify this resource directory -// entry. If the directory entry is yet another resource directory (i.e. a -// subdirectory), then the high order bit of the offset field will be -// set to indicate this. Otherwise the high bit is clear and the offset -// field points to a resource data entry. -// - -typedef struct _IMAGE_RESOURCE_DIRECTORY_ENTRY { - union { - struct { - ULONG NameOffset:31; - ULONG NameIsString:1; - } DUMMYSTRUCTNAME; - ULONG Name; - USHORT Id; - } DUMMYUNIONNAME; - union { - ULONG OffsetToData; - struct { - ULONG OffsetToDirectory:31; - ULONG DataIsDirectory:1; - } DUMMYSTRUCTNAME2; - } DUMMYUNIONNAME2; -} IMAGE_RESOURCE_DIRECTORY_ENTRY, *PIMAGE_RESOURCE_DIRECTORY_ENTRY; - -// -// For resource directory entries that have actual string names, the Name -// field of the directory entry points to an object of the following type. -// All of these string objects are stored together after the last resource -// directory entry and before the first resource data object. This minimizes -// the impact of these variable length objects on the alignment of the fixed -// size directory entry objects. -// - -typedef struct _IMAGE_RESOURCE_DIRECTORY_STRING { - USHORT Length; - CHAR NameString[ 1 ]; -} IMAGE_RESOURCE_DIRECTORY_STRING, *PIMAGE_RESOURCE_DIRECTORY_STRING; - - -typedef struct _IMAGE_RESOURCE_DIR_STRING_U { - USHORT Length; - WCHAR NameString[ 1 ]; -} IMAGE_RESOURCE_DIR_STRING_U, *PIMAGE_RESOURCE_DIR_STRING_U; - - -// -// Each resource data entry describes a leaf node in the resource directory -// tree. It contains an offset, relative to the beginning of the resource -// directory of the data for the resource, a size field that gives the number -// of bytes of data at that offset, a CodePage that should be used when -// decoding code point values within the resource data. Typically for new -// applications the code page would be the unicode code page. -// - -typedef struct _IMAGE_RESOURCE_DATA_ENTRY { - ULONG OffsetToData; - ULONG Size; - ULONG CodePage; - ULONG Reserved; -} IMAGE_RESOURCE_DATA_ENTRY, *PIMAGE_RESOURCE_DATA_ENTRY; - -// -// Load Configuration Directory Entry -// - -typedef struct { - ULONG Size; - ULONG TimeDateStamp; - USHORT MajorVersion; - USHORT MinorVersion; - ULONG GlobalFlagsClear; - ULONG GlobalFlagsSet; - ULONG CriticalSectionDefaultTimeout; - ULONG DeCommitFreeBlockThreshold; - ULONG DeCommitTotalFreeThreshold; - ULONG LockPrefixTable; // VA - ULONG MaximumAllocationSize; - ULONG VirtualMemoryThreshold; - ULONG ProcessHeapFlags; - ULONG ProcessAffinityMask; - USHORT CSDVersion; - USHORT Reserved1; - ULONG EditList; // VA - ULONG SecurityCookie; // VA - ULONG SEHandlerTable; // VA - ULONG SEHandlerCount; -} IMAGE_LOAD_CONFIG_DIRECTORY32, *PIMAGE_LOAD_CONFIG_DIRECTORY32; - -typedef struct { - ULONG Size; - ULONG TimeDateStamp; - USHORT MajorVersion; - USHORT MinorVersion; - ULONG GlobalFlagsClear; - ULONG GlobalFlagsSet; - ULONG CriticalSectionDefaultTimeout; - ULONGLONG DeCommitFreeBlockThreshold; - ULONGLONG DeCommitTotalFreeThreshold; - ULONGLONG LockPrefixTable; // VA - ULONGLONG MaximumAllocationSize; - ULONGLONG VirtualMemoryThreshold; - ULONGLONG ProcessAffinityMask; - ULONG ProcessHeapFlags; - USHORT CSDVersion; - USHORT Reserved1; - ULONGLONG EditList; // VA - ULONGLONG SecurityCookie; // VA - ULONGLONG SEHandlerTable; // VA - ULONGLONG SEHandlerCount; -} IMAGE_LOAD_CONFIG_DIRECTORY64, *PIMAGE_LOAD_CONFIG_DIRECTORY64; - -#ifdef _WIN64 -typedef IMAGE_LOAD_CONFIG_DIRECTORY64 IMAGE_LOAD_CONFIG_DIRECTORY; -typedef PIMAGE_LOAD_CONFIG_DIRECTORY64 PIMAGE_LOAD_CONFIG_DIRECTORY; -#else -typedef IMAGE_LOAD_CONFIG_DIRECTORY32 IMAGE_LOAD_CONFIG_DIRECTORY; -typedef PIMAGE_LOAD_CONFIG_DIRECTORY32 PIMAGE_LOAD_CONFIG_DIRECTORY; -#endif - -// -// WIN CE Exception table format -// - -// -// Function table entry format. Function table is pointed to by the -// IMAGE_DIRECTORY_ENTRY_EXCEPTION directory entry. -// - -typedef struct _IMAGE_CE_RUNTIME_FUNCTION_ENTRY { - ULONG FuncStart; - ULONG PrologLen : 8; - ULONG FuncLen : 22; - ULONG ThirtyTwoBit : 1; - ULONG ExceptionFlag : 1; -} IMAGE_CE_RUNTIME_FUNCTION_ENTRY, * PIMAGE_CE_RUNTIME_FUNCTION_ENTRY; - -typedef struct _IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY { - ULONGLONG BeginAddress; - ULONGLONG EndAddress; - ULONGLONG ExceptionHandler; - ULONGLONG HandlerData; - ULONGLONG PrologEndAddress; -} IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY, *PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY; - -typedef struct _IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY { - ULONG BeginAddress; - ULONG EndAddress; - ULONG ExceptionHandler; - ULONG HandlerData; - ULONG PrologEndAddress; -} IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY, *PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY; - -typedef struct _IMAGE_RUNTIME_FUNCTION_ENTRY { - ULONG BeginAddress; - ULONG EndAddress; - ULONG UnwindInfoAddress; -} _IMAGE_RUNTIME_FUNCTION_ENTRY, *_PIMAGE_RUNTIME_FUNCTION_ENTRY; - -typedef _IMAGE_RUNTIME_FUNCTION_ENTRY IMAGE_IA64_RUNTIME_FUNCTION_ENTRY; -typedef _PIMAGE_RUNTIME_FUNCTION_ENTRY PIMAGE_IA64_RUNTIME_FUNCTION_ENTRY; - -#if defined(_AXP64_) - -typedef IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY IMAGE_AXP64_RUNTIME_FUNCTION_ENTRY; -typedef PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY PIMAGE_AXP64_RUNTIME_FUNCTION_ENTRY; -typedef IMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY IMAGE_RUNTIME_FUNCTION_ENTRY; -typedef PIMAGE_ALPHA64_RUNTIME_FUNCTION_ENTRY PIMAGE_RUNTIME_FUNCTION_ENTRY; - -#elif defined(_ALPHA_) - -typedef IMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY IMAGE_RUNTIME_FUNCTION_ENTRY; -typedef PIMAGE_ALPHA_RUNTIME_FUNCTION_ENTRY PIMAGE_RUNTIME_FUNCTION_ENTRY; - -#else - -typedef _IMAGE_RUNTIME_FUNCTION_ENTRY IMAGE_RUNTIME_FUNCTION_ENTRY; -typedef _PIMAGE_RUNTIME_FUNCTION_ENTRY PIMAGE_RUNTIME_FUNCTION_ENTRY; - -#endif - -// -// Debug Format -// - -typedef struct _IMAGE_DEBUG_DIRECTORY { - ULONG Characteristics; - ULONG TimeDateStamp; - USHORT MajorVersion; - USHORT MinorVersion; - ULONG Type; - ULONG SizeOfData; - ULONG AddressOfRawData; - ULONG PointerToRawData; -} IMAGE_DEBUG_DIRECTORY, *PIMAGE_DEBUG_DIRECTORY; - -#define IMAGE_DEBUG_TYPE_UNKNOWN 0 -#define IMAGE_DEBUG_TYPE_COFF 1 -#define IMAGE_DEBUG_TYPE_CODEVIEW 2 -#define IMAGE_DEBUG_TYPE_FPO 3 -#define IMAGE_DEBUG_TYPE_MISC 4 -#define IMAGE_DEBUG_TYPE_EXCEPTION 5 -#define IMAGE_DEBUG_TYPE_FIXUP 6 -#define IMAGE_DEBUG_TYPE_OMAP_TO_SRC 7 -#define IMAGE_DEBUG_TYPE_OMAP_FROM_SRC 8 -#define IMAGE_DEBUG_TYPE_BORLAND 9 -#define IMAGE_DEBUG_TYPE_RESERVED10 10 -#define IMAGE_DEBUG_TYPE_CLSID 11 - -// end_winnt - -// IMAGE_DEBUG_TYPE values > 0x7FFFFFFF are reserved for BBT - -// begin_winnt - -typedef struct _IMAGE_COFF_SYMBOLS_HEADER { - ULONG NumberOfSymbols; - ULONG LvaToFirstSymbol; - ULONG NumberOfLinenumbers; - ULONG LvaToFirstLinenumber; - ULONG RvaToFirstByteOfCode; - ULONG RvaToLastByteOfCode; - ULONG RvaToFirstByteOfData; - ULONG RvaToLastByteOfData; -} IMAGE_COFF_SYMBOLS_HEADER, *PIMAGE_COFF_SYMBOLS_HEADER; - -#define FRAME_FPO 0 -#define FRAME_TRAP 1 -#define FRAME_TSS 2 -#define FRAME_NONFPO 3 - -typedef struct _FPO_DATA { - ULONG ulOffStart; // offset 1st byte of function code - ULONG cbProcSize; // # bytes in function - ULONG cdwLocals; // # bytes in locals/4 - USHORT cdwParams; // # bytes in params/4 - USHORT cbProlog : 8; // # bytes in prolog - USHORT cbRegs : 3; // # regs saved - USHORT fHasSEH : 1; // TRUE if SEH in func - USHORT fUseBP : 1; // TRUE if EBP has been allocated - USHORT reserved : 1; // reserved for future use - USHORT cbFrame : 2; // frame type -} FPO_DATA, *PFPO_DATA; -#define SIZEOF_RFPO_DATA 16 - - -#define IMAGE_DEBUG_MISC_EXENAME 1 - -typedef struct _IMAGE_DEBUG_MISC { - ULONG DataType; // type of misc data, see defines - ULONG Length; // total length of record, rounded to four - // byte multiple. - BOOLEAN Unicode; // TRUE if data is unicode string - UCHAR Reserved[ 3 ]; - UCHAR Data[ 1 ]; // Actual data -} IMAGE_DEBUG_MISC, *PIMAGE_DEBUG_MISC; - - -// -// Function table extracted from MIPS/ALPHA/IA64 images. Does not contain -// information needed only for runtime support. Just those fields for -// each entry needed by a debugger. -// - -typedef struct _IMAGE_FUNCTION_ENTRY { - ULONG StartingAddress; - ULONG EndingAddress; - ULONG EndOfPrologue; -} IMAGE_FUNCTION_ENTRY, *PIMAGE_FUNCTION_ENTRY; - -typedef struct _IMAGE_FUNCTION_ENTRY64 { - ULONGLONG StartingAddress; - ULONGLONG EndingAddress; - union { - ULONGLONG EndOfPrologue; - ULONGLONG UnwindInfoAddress; - } DUMMYUNIONNAME; -} IMAGE_FUNCTION_ENTRY64, *PIMAGE_FUNCTION_ENTRY64; - -// -// Debugging information can be stripped from an image file and placed -// in a separate .DBG file, whose file name part is the same as the -// image file name part (e.g. symbols for CMD.EXE could be stripped -// and placed in CMD.DBG). This is indicated by the IMAGE_FILE_DEBUG_STRIPPED -// flag in the Characteristics field of the file header. The beginning of -// the .DBG file contains the following structure which captures certain -// information from the image file. This allows a debug to proceed even if -// the original image file is not accessable. This header is followed by -// zero of more IMAGE_SECTION_HEADER structures, followed by zero or more -// IMAGE_DEBUG_DIRECTORY structures. The latter structures and those in -// the image file contain file offsets relative to the beginning of the -// .DBG file. -// -// If symbols have been stripped from an image, the IMAGE_DEBUG_MISC structure -// is left in the image file, but not mapped. This allows a debugger to -// compute the name of the .DBG file, from the name of the image in the -// IMAGE_DEBUG_MISC structure. -// - -typedef struct _IMAGE_SEPARATE_DEBUG_HEADER { - USHORT Signature; - USHORT Flags; - USHORT Machine; - USHORT Characteristics; - ULONG TimeDateStamp; - ULONG CheckSum; - ULONG ImageBase; - ULONG SizeOfImage; - ULONG NumberOfSections; - ULONG ExportedNamesSize; - ULONG DebugDirectorySize; - ULONG SectionAlignment; - ULONG Reserved[2]; -} IMAGE_SEPARATE_DEBUG_HEADER, *PIMAGE_SEPARATE_DEBUG_HEADER; - -typedef struct _NON_PAGED_DEBUG_INFO { - USHORT Signature; - USHORT Flags; - ULONG Size; - USHORT Machine; - USHORT Characteristics; - ULONG TimeDateStamp; - ULONG CheckSum; - ULONG SizeOfImage; - ULONGLONG ImageBase; - //DebugDirectorySize - //IMAGE_DEBUG_DIRECTORY -} NON_PAGED_DEBUG_INFO, *PNON_PAGED_DEBUG_INFO; - -#ifndef _MAC -#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4944 -#define NON_PAGED_DEBUG_SIGNATURE 0x494E -#else -#define IMAGE_SEPARATE_DEBUG_SIGNATURE 0x4449 // DI -#define NON_PAGED_DEBUG_SIGNATURE 0x4E49 // NI -#endif - -#define IMAGE_SEPARATE_DEBUG_FLAGS_MASK 0x8000 -#define IMAGE_SEPARATE_DEBUG_MISMATCH 0x8000 // when DBG was updated, the - // old checksum didn't match. - -// -// The .arch section is made up of headers, each describing an amask position/value -// pointing to an array of IMAGE_ARCHITECTURE_ENTRY's. Each "array" (both the header -// and entry arrays) are terminiated by a quadword of 0xffffffffL. -// -// NOTE: There may be quadwords of 0 sprinkled around and must be skipped. -// - -typedef struct _ImageArchitectureHeader { - unsigned int AmaskValue: 1; // 1 -> code section depends on mask bit - // 0 -> new instruction depends on mask bit - int :7; // MBZ - unsigned int AmaskShift: 8; // Amask bit in question for this fixup - int :16; // MBZ - ULONG FirstEntryRVA; // RVA into .arch section to array of ARCHITECTURE_ENTRY's -} IMAGE_ARCHITECTURE_HEADER, *PIMAGE_ARCHITECTURE_HEADER; - -typedef struct _ImageArchitectureEntry { - ULONG FixupInstRVA; // RVA of instruction to fixup - ULONG NewInst; // fixup instruction (see alphaops.h) -} IMAGE_ARCHITECTURE_ENTRY, *PIMAGE_ARCHITECTURE_ENTRY; - -#include "poppack.h" // Back to the initial value - -// The following structure defines the new import object. Note the values of the first two fields, -// which must be set as stated in order to differentiate old and new import members. -// Following this structure, the linker emits two null-terminated strings used to recreate the -// import at the time of use. The first string is the import's name, the second is the dll's name. - -#define IMPORT_OBJECT_HDR_SIG2 0xffff - -typedef struct IMPORT_OBJECT_HEADER { - USHORT Sig1; // Must be IMAGE_FILE_MACHINE_UNKNOWN - USHORT Sig2; // Must be IMPORT_OBJECT_HDR_SIG2. - USHORT Version; - USHORT Machine; - ULONG TimeDateStamp; // Time/date stamp - ULONG SizeOfData; // particularly useful for incremental links - - union { - USHORT Ordinal; // if grf & IMPORT_OBJECT_ORDINAL - USHORT Hint; - } DUMMYUNIONNAME; - - USHORT Type : 2; // IMPORT_TYPE - USHORT NameType : 3; // IMPORT_NAME_TYPE - USHORT Reserved : 11; // Reserved. Must be zero. -} IMPORT_OBJECT_HEADER; - -typedef enum IMPORT_OBJECT_TYPE -{ - IMPORT_OBJECT_CODE = 0, - IMPORT_OBJECT_DATA = 1, - IMPORT_OBJECT_CONST = 2, -} IMPORT_OBJECT_TYPE; - -typedef enum IMPORT_OBJECT_NAME_TYPE -{ - IMPORT_OBJECT_ORDINAL = 0, // Import by ordinal - IMPORT_OBJECT_NAME = 1, // Import name == public symbol name. - IMPORT_OBJECT_NAME_NO_PREFIX = 2, // Import name == public symbol name skipping leading ?, @, or optionally _. - IMPORT_OBJECT_NAME_UNDECORATE = 3, // Import name == public symbol name skipping leading ?, @, or optionally _ - // and truncating at first @ -} IMPORT_OBJECT_NAME_TYPE; - -// end_winnt - -// The structure is used by the NT loader for clr URT support. It -// is a duplicate of the definition in corhdr.h. - -// begin_winnt - -#ifndef __IMAGE_COR20_HEADER_DEFINED__ -#define __IMAGE_COR20_HEADER_DEFINED__ - -typedef enum ReplacesCorHdrNumericDefines -{ -// COM+ Header entry point flags. - COMIMAGE_FLAGS_ILONLY =0x00000001, - COMIMAGE_FLAGS_32BITREQUIRED =0x00000002, - COMIMAGE_FLAGS_IL_LIBRARY =0x00000004, - COMIMAGE_FLAGS_STRONGNAMESIGNED =0x00000008, - COMIMAGE_FLAGS_NATIVE_ENTRYPOINT =0x00000010, - COMIMAGE_FLAGS_TRACKDEBUGDATA =0x00010000, - -// Version flags for image. - COR_VERSION_MAJOR_V2 =2, - COR_VERSION_MAJOR =COR_VERSION_MAJOR_V2, - COR_VERSION_MINOR =0, - COR_DELETED_NAME_LENGTH =8, - COR_VTABLEGAP_NAME_LENGTH =8, - -// Maximum size of a NativeType descriptor. - NATIVE_TYPE_MAX_CB =1, - COR_ILMETHOD_SECT_SMALL_MAX_DATASIZE=0xFF, - -// #defines for the MIH FLAGS - IMAGE_COR_MIH_METHODRVA =0x01, - IMAGE_COR_MIH_EHRVA =0x02, - IMAGE_COR_MIH_BASICBLOCK =0x08, - -// V-table constants - COR_VTABLE_32BIT =0x01, // V-table slots are 32-bits in size. - COR_VTABLE_64BIT =0x02, // V-table slots are 64-bits in size. - COR_VTABLE_FROM_UNMANAGED =0x04, // If set, transition from unmanaged. - COR_VTABLE_FROM_UNMANAGED_RETAIN_APPDOMAIN =0x08, // If set, transition from unmanaged with keeping the current appdomain. - COR_VTABLE_CALL_MOST_DERIVED =0x10, // Call most derived method described by - -// EATJ constants - IMAGE_COR_EATJ_THUNK_SIZE =32, // Size of a jump thunk reserved range. - -// Max name lengths - //@todo: Change to unlimited name lengths. - MAX_CLASS_NAME =1024, - MAX_PACKAGE_NAME =1024, -} ReplacesCorHdrNumericDefines; - -// CLR 2.0 header structure. -typedef struct IMAGE_COR20_HEADER -{ - // Header versioning - ULONG cb; - USHORT MajorRuntimeVersion; - USHORT MinorRuntimeVersion; - - // Symbol table and startup information - IMAGE_DATA_DIRECTORY MetaData; - ULONG Flags; - - // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is not set, EntryPointToken represents a managed entrypoint. - // If COMIMAGE_FLAGS_NATIVE_ENTRYPOINT is set, EntryPointRVA represents an RVA to a native entrypoint. - union { - ULONG EntryPointToken; - ULONG EntryPointRVA; - } DUMMYUNIONNAME; - - // Binding information - IMAGE_DATA_DIRECTORY Resources; - IMAGE_DATA_DIRECTORY StrongNameSignature; - - // Regular fixup and binding information - IMAGE_DATA_DIRECTORY CodeManagerTable; - IMAGE_DATA_DIRECTORY VTableFixups; - IMAGE_DATA_DIRECTORY ExportAddressTableJumps; - - // Precompiled image info (internal use only - set to zero) - IMAGE_DATA_DIRECTORY ManagedNativeHeader; - -} IMAGE_COR20_HEADER, *PIMAGE_COR20_HEADER; - -#endif // __IMAGE_COR20_HEADER_DEFINED__ - -// -// End Image Format -// - -// end_winnt - -typedef IMAGE_OS2_HEADER UNALIGNED * PUIMAGE_OS2_HEADER; -typedef IMAGE_IMPORT_DESCRIPTOR UNALIGNED CONST *PCIMAGE_IMPORT_DESCRIPTOR; -typedef CONST IMAGE_BOUND_IMPORT_DESCRIPTOR *PCIMAGE_BOUND_IMPORT_DESCRIPTOR; -typedef CONST IMAGE_BOUND_FORWARDER_REF *PCIMAGE_BOUND_FORWARDER_REF; -typedef CONST IMAGE_IMPORT_BY_NAME *PCIMAGE_IMPORT_BY_NAME; -typedef CONST IMAGE_THUNK_DATA *PCIMAGE_THUNK_DATA; -typedef CONST IMAGE_THUNK_DATA32 *PCIMAGE_THUNK_DATA32; -typedef CONST IMAGE_THUNK_DATA64 *PCIMAGE_THUNK_DATA64; -typedef CONST IMAGE_TLS_DIRECTORY *PCIMAGE_TLS_DIRECTORY; -typedef CONST IMAGE_TLS_DIRECTORY32 *PCIMAGE_TLS_DIRECTORY32; -typedef CONST IMAGE_TLS_DIRECTORY64 *PCIMAGE_TLS_DIRECTORY64; -typedef CONST IMAGE_EXPORT_DIRECTORY *PCIMAGE_EXPORT_DIRECTORY; -typedef CONST IMAGE_SECTION_HEADER *PCIMAGE_SECTION_HEADER; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#endif // _NTIMAGE_ - diff --git a/qt-correction-tool/pub/ddk/ntintsafe.h b/qt-correction-tool/pub/ddk/ntintsafe.h deleted file mode 100644 index 0b75171..0000000 --- a/qt-correction-tool/pub/ddk/ntintsafe.h +++ /dev/null @@ -1,8550 +0,0 @@ -/****************************************************************** -* * -* ntintsafe.h -- This module defines helper functions to prevent * -* integer overflow bugs for drivers. A similar * -* file, intsafe.h, is available for applications. * -* * -* Copyright (c) Microsoft Corp. All rights reserved. * -* * -******************************************************************/ -#ifndef _NTINTSAFE_H_INCLUDED_ -#define _NTINTSAFE_H_INCLUDED_ - -#if (_MSC_VER > 1000) -#pragma once -#endif - -#include // for __in, etc. - -#if !defined(_W64) -#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && (_MSC_VER >= 1300) -#define _W64 __w64 -#else -#define _W64 -#endif -#endif - -// -// typedefs -// -typedef char CHAR; -typedef signed char INT8; -typedef unsigned char UCHAR; -typedef unsigned char UINT8; -typedef unsigned char BYTE; -typedef short SHORT; -typedef signed short INT16; -typedef unsigned short USHORT; -typedef unsigned short UINT16; -typedef unsigned short WORD; -typedef int INT; -typedef signed int INT32; -typedef unsigned int UINT; -typedef unsigned int UINT32; -typedef long LONG; -typedef unsigned long ULONG; -typedef unsigned long DWORD; -typedef __int64 LONGLONG; -typedef __int64 LONG64; -typedef signed __int64 RtlINT64; -typedef unsigned __int64 ULONGLONG; -typedef unsigned __int64 DWORDLONG; -typedef unsigned __int64 ULONG64; -typedef unsigned __int64 DWORD64; -typedef unsigned __int64 UINT64; - -#if (__midl > 501) -typedef [public] __int3264 INT_PTR; -typedef [public] unsigned __int3264 UINT_PTR; -typedef [public] __int3264 LONG_PTR; -typedef [public] unsigned __int3264 ULONG_PTR; -#else -#ifdef _WIN64 -typedef __int64 INT_PTR; -typedef unsigned __int64 UINT_PTR; -typedef __int64 LONG_PTR; -typedef unsigned __int64 ULONG_PTR; -#else -typedef _W64 int INT_PTR; -typedef _W64 unsigned int UINT_PTR; -typedef _W64 long LONG_PTR; -typedef _W64 unsigned long ULONG_PTR; -#endif // WIN64 -#endif // (__midl > 501) - -#ifdef _WIN64 -typedef __int64 ptrdiff_t; -typedef unsigned __int64 size_t; -#else -typedef _W64 int ptrdiff_t; -typedef _W64 unsigned int size_t; -#endif - -typedef ULONG_PTR DWORD_PTR; -typedef LONG_PTR SSIZE_T; -typedef ULONG_PTR SIZE_T; - -#undef _USE_INTRINSIC_MULTIPLY128 - -#if !defined(_M_CEE) && (defined(_AMD64_) || (defined(_IA64_) && (_MSC_VER >= 1400))) -#define _USE_INTRINSIC_MULTIPLY128 -#endif - -#if defined(_USE_INTRINSIC_MULTIPLY128) -#ifdef __cplusplus -extern "C" { -#endif - -#define UnsignedMultiply128 _umul128 - -ULONG64 -UnsignedMultiply128( - __in ULONGLONG ullMultiplicand, - __in ULONGLONG ullMultiplier, - __out __deref_out_range(==, ullMultiplicand * ullMultiplier) ULONGLONG* pullResultHigh); -#pragma intrinsic(_umul128) - -#ifdef __cplusplus -} -#endif -#endif // _USE_INTRINSIC_MULTIPLY128 - - - -typedef __success(return >= 0) long NTSTATUS; - -#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) - -#define STATUS_SUCCESS ((NTSTATUS)0x00000000L) -#ifndef SORTPP_PASS -// compiletime asserts (failure results in error C2118: negative subscript) -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#else -#define C_ASSERT(e) -#endif - -// -// UInt32x32To64 macro -// -#if defined(MIDL_PASS) || defined(RC_INVOKED) || defined(_M_CEE_PURE) \ - || defined(_68K_) || defined(_MPPC_) \ - || defined(_M_IA64) || defined(_M_AMD64) -#define UInt32x32To64(a, b) (((unsigned __int64)((unsigned int)(a))) * ((unsigned __int64)((unsigned int)(b)))) -#elif defined(_M_IX86) -#define UInt32x32To64(a, b) ((unsigned __int64)(((unsigned __int64)((unsigned int)(a))) * ((unsigned int)(b)))) -#else -#error Must define a target architecture. -#endif - -// -// Min/Max type values -// -#define INT8_MIN (-127i8 - 1) -#define SHORT_MIN (-32768) -#define INT16_MIN (-32767i16 - 1) -#define INT_MIN (-2147483647 - 1) -#define INT32_MIN (-2147483647i32 - 1) -#define LONG_MIN (-2147483647L - 1) -#define LONGLONG_MIN (-9223372036854775807i64 - 1) -#define LONG64_MIN (-9223372036854775807i64 - 1) -#define INT64_MIN (-9223372036854775807i64 - 1) -#define INT128_MIN (-170141183460469231731687303715884105727i128 - 1) - -#ifdef _WIN64 -#define INT_PTR_MIN (-9223372036854775807i64 - 1) -#define LONG_PTR_MIN (-9223372036854775807i64 - 1) -#define PTRDIFF_T_MIN (-9223372036854775807i64 - 1) -#define SSIZE_T_MIN (-9223372036854775807i64 - 1) -#else -#define INT_PTR_MIN (-2147483647 - 1) -#define LONG_PTR_MIN (-2147483647L - 1) -#define PTRDIFF_T_MIN (-2147483647 - 1) -#define SSIZE_T_MIN (-2147483647L - 1) -#endif - -#define INT8_MAX 127i8 -#define UINT8_MAX 0xffui8 -#define BYTE_MAX 0xff -#define SHORT_MAX 32767 -#define INT16_MAX 32767i16 -#define USHORT_MAX 0xffff -#define UINT16_MAX 0xffffui16 -#define WORD_MAX 0xffff -#define INT_MAX 2147483647 -#define INT32_MAX 2147483647i32 -#define UINT_MAX 0xffffffff -#define UINT32_MAX 0xffffffffui32 -#define LONG_MAX 2147483647L -#define ULONG_MAX 0xffffffffUL -#define DWORD_MAX 0xffffffffUL -#define LONGLONG_MAX 9223372036854775807i64 -#define LONG64_MAX 9223372036854775807i64 -#define INT64_MAX 9223372036854775807i64 -#define ULONGLONG_MAX 0xffffffffffffffffui64 -#define DWORDLONG_MAX 0xffffffffffffffffui64 -#define ULONG64_MAX 0xffffffffffffffffui64 -#define DWORD64_MAX 0xffffffffffffffffui64 -#define UINT64_MAX 0xffffffffffffffffui64 -#define INT128_MAX 170141183460469231731687303715884105727i128 -#define UINT128_MAX 0xffffffffffffffffffffffffffffffffui128 - -#undef SIZE_T_MAX - -#ifdef _WIN64 -#define INT_PTR_MAX 9223372036854775807i64 -#define UINT_PTR_MAX 0xffffffffffffffffui64 -#define LONG_PTR_MAX 9223372036854775807i64 -#define ULONG_PTR_MAX 0xffffffffffffffffui64 -#define DWORD_PTR_MAX 0xffffffffffffffffui64 -#define PTRDIFF_T_MAX 9223372036854775807i64 -#define SIZE_T_MAX 0xffffffffffffffffui64 -#define SSIZE_T_MAX 9223372036854775807i64 -#define _SIZE_T_MAX 0xffffffffffffffffui64 -#else -#define INT_PTR_MAX 2147483647 -#define UINT_PTR_MAX 0xffffffff -#define LONG_PTR_MAX 2147483647L -#define ULONG_PTR_MAX 0xffffffffUL -#define DWORD_PTR_MAX 0xffffffffUL -#define PTRDIFF_T_MAX 2147483647 -#define SIZE_T_MAX 0xffffffff -#define SSIZE_T_MAX 2147483647L -#define _SIZE_T_MAX 0xffffffffUL -#endif - - -// -// It is common for -1 to be used as an error value -// -#define INT8_ERROR (-1i8) -#define UINT8_ERROR 0xffui8 -#define BYTE_ERROR 0xff -#define SHORT_ERROR (-1) -#define INT16_ERROR (-1i16) -#define USHORT_ERROR 0xffff -#define UINT16_ERROR 0xffffui16 -#define WORD_ERROR 0xffff -#define INT_ERROR (-1) -#define INT32_ERROR (-1i32) -#define UINT_ERROR 0xffffffff -#define UINT32_ERROR 0xffffffffui32 -#define LONG_ERROR (-1L) -#define ULONG_ERROR 0xffffffffUL -#define DWORD_ERROR 0xffffffffUL -#define LONGLONG_ERROR (-1i64) -#define LONG64_ERROR (-1i64) -#define INT64_ERROR (-1i64) -#define ULONGLONG_ERROR 0xffffffffffffffffui64 -#define DWORDLONG_ERROR 0xffffffffffffffffui64 -#define ULONG64_ERROR 0xffffffffffffffffui64 -#define UINT64_ERROR 0xffffffffffffffffui64 - -#ifdef _WIN64 -#define INT_PTR_ERROR (-1i64) -#define UINT_PTR_ERROR 0xffffffffffffffffui64 -#define LONG_PTR_ERROR (-1i64) -#define ULONG_PTR_ERROR 0xffffffffffffffffui64 -#define DWORD_PTR_ERROR 0xffffffffffffffffui64 -#define PTRDIFF_T_ERROR (-1i64) -#define SIZE_T_ERROR 0xffffffffffffffffui64 -#define SSIZE_T_ERROR (-1i64) -#define _SIZE_T_ERROR 0xffffffffffffffffui64 -#else -#define INT_PTR_ERROR (-1) -#define UINT_PTR_ERROR 0xffffffff -#define LONG_PTR_ERROR (-1L) -#define ULONG_PTR_ERROR 0xffffffffUL -#define DWORD_PTR_ERROR 0xffffffffUL -#define PTRDIFF_T_ERROR (-1) -#define SIZE_T_ERROR 0xffffffff -#define SSIZE_T_ERROR (-1L) -#define _SIZE_T_ERROR 0xffffffffUL -#endif - - -// -// We make some assumptions about the sizes of various types. Let's be -// explicit about those assumptions and check them. -// -C_ASSERT(sizeof(USHORT) == 2); -C_ASSERT(sizeof(INT) == 4); -C_ASSERT(sizeof(UINT) == 4); -C_ASSERT(sizeof(LONG) == 4); -C_ASSERT(sizeof(ULONG) == 4); -C_ASSERT(sizeof(UINT_PTR) == sizeof(ULONG_PTR)); - - -//============================================================================= -// Conversion functions -// -// There are three reasons for having conversion functions: -// -// 1. We are converting from a signed type to an unsigned type of the same -// size, or vice-versa. -// -// Since we default to only having unsigned math functions, -// (see ENABLE_INTSAFE_SIGNED_FUNCTIONS below) we prefer people to convert -// to unsigned, do the math, and then convert back to signed. -// -// 2. We are converting to a smaller type, and we could therefore possibly -// overflow. -// -// 3. We are converting to a bigger type, and we are signed and the type we are -// converting to is unsigned. -// -//============================================================================= - - -// -// INT8 -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToUChar( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) UCHAR* pch) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pch = (UCHAR)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToUInt8( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) UINT8* pu8Result) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pu8Result = (UINT8)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> BYTE conversion -// -#define RtlInt8ToByte RtlInt8ToUInt8 - -// -// INT8 -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToUShort( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) USHORT* pusResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pusResult = (USHORT)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> UINT16 conversion -// -#define RtlInt8ToUInt16 RtlInt8ToUShort - -// -// INT8 -> WORD conversion -// -#define RtlInt8ToWord RtlInt8ToUShort - -// -// INT8 -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToUInt( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) UINT* puResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *puResult = (UINT)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> UINT32 conversion -// -#define RtlInt8ToUInt32 RtlInt8ToUInt - -// -// INT8 -> UINT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToUIntPtr( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *puResult = (UINT_PTR)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToULong( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) ULONG* pulResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pulResult = (ULONG)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> ULONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToULongPtr( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pulResult = (ULONG_PTR)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> DWORD conversion -// -#define RtlInt8ToDWord RtlInt8ToULong - -// -// INT8 -> DWORD_PTR conversion -// -#define RtlInt8ToDWordPtr RtlInt8ToULongPtr - -// -// INT8 -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlInt8ToULongLong( - __in INT8 i8Operand, - __out __deref_out_range(==, i8Operand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (i8Operand >= 0) - { - *pullResult = (ULONGLONG)i8Operand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT8 -> DWORDLONG conversion -// -#define RtlInt8ToDWordLong RtlInt8ToULongLong - -// -// INT8 -> ULONG64 conversion -// -#define RtlInt8ToULong64 RtlInt8ToULongLong - -// -// INT8 -> DWORD64 conversion -// -#define RtlInt8ToDWord64 RtlInt8ToULongLong - -// -// INT8 -> UINT64 conversion -// -#define RtlInt8ToUInt64 RtlInt8ToULongLong - -// -// INT8 -> size_t conversion -// -#define RtlInt8ToSizeT RtlInt8ToUIntPtr - -// -// INT8 -> SIZE_T conversion -// -#define RtlInt8ToSIZET RtlInt8ToULongPtr - -// -// UINT8 -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUInt8ToInt8( - __in UINT8 u8Operand, - __out __deref_out_range(==, u8Operand) INT8* pi8Result) -{ - NTSTATUS status; - - if (u8Operand <= INT8_MAX) - { - *pi8Result = (INT8)u8Operand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT8 -> CHAR conversion -// -__forceinline -NTSTATUS -RtlUInt8ToChar( - __in UINT8 u8Operand, - __out __deref_out_range(==, u8Operand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - *pch = (CHAR)u8Operand; - return STATUS_SUCCESS; -#else - return RtlUInt8ToInt8(u8Operand, (INT8*)pch); -#endif -} - -// -// BYTE -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlByteToInt8( - __in BYTE bOperand, - __out __deref_out_range(==, bOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (bOperand <= INT8_MAX) - { - *pi8Result = (INT8)bOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// BYTE -> CHAR conversion -// -__forceinline -NTSTATUS -RtlByteToChar( - __in BYTE bOperand, - __out __deref_out_range(==, bOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - *pch = (CHAR)bOperand; - return STATUS_SUCCESS; -#else - return RtlByteToInt8(bOperand, (INT8*)pch); -#endif -} - -// -// SHORT -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToInt8( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((sOperand >= INT8_MIN) && (sOperand <= INT8_MAX)) - { - *pi8Result = (INT8)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToUChar( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((sOperand >= 0) && (sOperand <= 255)) - { - *pch = (UCHAR)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> CHAR conversion -// -__forceinline -NTSTATUS -RtlShortToChar( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlShortToUChar(sOperand, (UCHAR*)pch); -#else - return RtlShortToInt8(sOperand, (INT8*)pch); -#endif // _CHAR_UNSIGNED -} - -// -// SHORT -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToUInt8( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if ((sOperand >= 0) && (sOperand <= UINT8_MAX)) - { - *pui8Result = (UINT8)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> BYTE conversion -// -#define RtlShortToByte RtlShortToUInt8 - -// -// SHORT -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToUShort( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *pusResult = (USHORT)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> UINT16 conversion -// -#define RtlShortToUInt16 RtlShortToUShort - -// -// SHORT -> WORD conversion -// -#define RtlShortToWord RtlShortToUShort - -// -// SHORT -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToUInt( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) UINT* puResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *puResult = (UINT)sOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> UINT32 conversion -// -#define RtlShortToUInt32 RtlShortToUInt - -// -// SHORT -> UINT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToUIntPtr( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *puResult = (UINT_PTR)sOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToULong( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *pulResult = (ULONG)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> ULONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToULongPtr( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *pulResult = (ULONG_PTR)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> DWORD conversion -// -#define RtlShortToDWord RtlShortToULong - -// -// SHORT -> DWORD_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToDWordPtr( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) DWORD_PTR* pdwResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *pdwResult = (DWORD_PTR)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pdwResult = DWORD_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlShortToULongLong( - __in SHORT sOperand, - __out __deref_out_range(==, sOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (sOperand >= 0) - { - *pullResult = (ULONGLONG)sOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SHORT -> DWORDLONG conversion -// -#define RtlShortToDWordLong RtlShortToULongLong - -// -// SHORT -> ULONG64 conversion -// -#define RtlShortToULong64 RtlShortToULongLong - -// -// SHORT -> DWORD64 conversion -// -#define RtlShortToDWord64 RtlShortToULongLong - -// -// SHORT -> UINT64 conversion -// -#define RtlShortToUInt64 RtlShortToULongLong - -// -// SHORT -> size_t conversion -// -#define RtlShortToSizeT RtlShortToUIntPtr - -// -// SHORT -> SIZE_T conversion -// -#define RtlShortToSIZET RtlShortToULongPtr - -// -// INT16 -> CHAR conversion -// -#define RtlInt16ToChar RtlShortToChar - -// -// INT16 -> INT8 conversion -// -#define RtlInt16ToInt8 RtlShortToInt8 - -// -// INT16 -> UCHAR conversion -// -#define RtlInt16ToUChar RtlShortToUChar - -// -// INT16 -> UINT8 conversion -// -#define RtlInt16ToUInt8 RtlShortToUInt8 - -// -// INT16 -> BYTE conversion -// -#define RtlInt16ToByte RtlShortToUInt8 - -// -// INT16 -> USHORT conversion -// -#define RtlInt16ToUShort RtlShortToUShort - -// -// INT16 -> UINT16 conversion -// -#define RtlInt16ToUInt16 RtlShortToUShort - -// -// INT16 -> WORD conversion -// -#define RtlInt16ToWord RtlShortToUShort - -// -// INT16 -> UINT conversion -// -#define RtlInt16ToUInt RtlShortToUInt - -// -// INT16 -> UINT32 conversion -// -#define RtlInt16ToUInt32 RtlShortToUInt - -// -// INT16 -> UINT_PTR conversion -// -#define RtlInt16ToUIntPtr RtlShortToUIntPtr - -// -// INT16 -> ULONG conversion -// -#define RtlInt16ToULong RtlShortToULong - -// -// INT16 -> ULONG_PTR conversion -// -#define RtlInt16ToULongPtr RtlShortToULongPtr - -// -// INT16 -> DWORD conversion -// -#define RtlInt16ToDWord RtlShortToULong - -// -// INT16 -> DWORD_PTR conversion -// -#define RtlInt16ToDWordPtr RtlShortToULongPtr - -// -// INT16 -> ULONGLONG conversion -// -#define RtlInt16ToULongLong RtlShortToULongLong - -// -// INT16 -> DWORDLONG conversion -// -#define RtlInt16ToDWordLong RtlShortToULongLong - -// -// INT16 -> ULONG64 conversion -// -#define RtlInt16ToULong64 RtlShortToULongLong - -// -// INT16 -> DWORD64 conversion -// -#define RtlInt16ToDWord64 RtlShortToULongLong - -// -// INT16 -> UINT64 conversion -// -#define RtlInt16ToUInt64 RtlShortToULongLong - -// -// INT16 -> size_t conversion -// -#define RtlInt16ToSizeT RtlShortToUIntPtr - -// -// INT16 -> SIZE_T conversion -// -#define RtlInt16ToSIZET RtlShortToULongPtr - -// -// USHORT -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUShortToInt8( - __in USHORT usOperand, - __out __deref_out_range(==, usOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (usOperand <= INT8_MAX) - { - *pi8Result = (INT8)usOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlUShortToUChar( - __in USHORT usOperand, - __out __deref_out_range(==, usOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (usOperand <= 255) - { - *pch = (UCHAR)usOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT -> CHAR conversion -// -__forceinline -NTSTATUS -RtlUShortToChar( - __in USHORT usOperand, - __out __deref_out_range(==, usOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlUShortToUChar(usOperand, (UCHAR*)pch); -#else - return RtlUShortToInt8(usOperand, (INT8*)pch); -#endif // _CHAR_UNSIGNED -} - -// -// USHORT -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUShortToUInt8( - __in USHORT usOperand, - __out __deref_out_range(==, usOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if (usOperand <= UINT8_MAX) - { - *pui8Result = (UINT8)usOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT -> BYTE conversion -// -#define RtlUShortToByte RtlUShortToUInt8 - -// -// USHORT -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUShortToShort( - __in USHORT usOperand, - __out __deref_out_range(==, usOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (usOperand <= SHORT_MAX) - { - *psResult = (SHORT)usOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT -> INT16 conversion -// -#define RtlUShortToInt16 RtlUShortToShort - -// -// UINT16 -> CHAR conversion -// -#define RtlUInt16ToChar RtlUShortToChar - -// -// UINT16 -> INT8 conversion -// -#define RtlUInt16ToInt8 RtlUShortToInt8 - -// -// UINT16 -> UCHAR conversion -// -#define RtlUInt16ToUChar RtlUShortToUChar - -// -// UINT16 -> UINT8 conversion -// -#define RtlUInt16ToUInt8 RtlUShortToUInt8 - -// -// UINT16 -> BYTE conversion -// -#define RtlUInt16ToByte RtlUShortToUInt8 - -// -// UINT16 -> SHORT conversion -// -#define RtlUInt16ToShort RtlUShortToShort - -// -// UINT16 -> INT16 conversion -// -#define RtlUInt16ToInt16 RtlUShortToShort - -// -// WORD -> INT8 conversion -// -#define RtlWordToInt8 RtlUShortToInt8 - -// -// WORD -> CHAR conversion -// -#define RtlWordToChar RtlUShortToChar - -// -// WORD -> UCHAR conversion -// -#define RtlWordToUChar RtlUShortToUChar - -// -// WORD -> UINT8 conversion -// -#define RtlWordToUInt8 RtlUShortToUInt8 - -// -// WORD -> BYTE conversion -// -#define RtlWordToByte RtlUShortToUInt8 - -// -// WORD -> SHORT conversion -// -#define RtlWordToShort RtlUShortToShort - -// -// WORD -> INT16 conversion -// -#define RtlWordToInt16 RtlUShortToShort - -// -// INT -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToInt8( - __in INT iOperand, - __out __deref_out_range(==, iOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((iOperand >= INT8_MIN) && (iOperand <= INT8_MAX)) - { - *pi8Result = (INT8)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToUChar( - __in INT iOperand, - __out __deref_out_range(==, iOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= 255)) - { - *pch = (UCHAR)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> CHAR conversion -// -__forceinline -NTSTATUS -RtlIntToChar( - __in INT iOperand, - __out __deref_out_range(==, iOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlIntToUChar(iOperand, (UCHAR*)pch); -#else - return RtlIntToInt8(iOperand, (INT8*)pch); -#endif // _CHAR_UNSIGNED -} - -// -// INT -> BYTE conversion -// -#define RtlIntToByte RtlIntToUInt8 - -// -// INT -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToUInt8( - __in INT iOperand, - __out __deref_out_range(==, iOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= UINT8_MAX)) - { - *pui8Result = (UINT8)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToShort( - __in INT iOperand, - __out __deref_out_range(==, iOperand) SHORT* psResult) -{ - NTSTATUS status; - - if ((iOperand >= SHORT_MIN) && (iOperand <= SHORT_MAX)) - { - *psResult = (SHORT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> INT16 conversion -// -#define RtlIntToInt16 RtlIntToShort - -// -// INT -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToUShort( - __in INT iOperand, - __out __deref_out_range(==, iOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= USHORT_MAX)) - { - *pusResult = (USHORT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> UINT16 conversion -// -#define RtlIntToUInt16 RtlIntToUShort - -// -// INT -> WORD conversion -// -#define RtlIntToWord RtlIntToUShort - -// -// INT -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToUInt( - __in INT iOperand, - __out __deref_out_range(==, iOperand) UINT* puResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *puResult = (UINT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> UINT_PTR conversion -// -#ifdef _WIN64 -#define RtlIntToUIntPtr RtlIntToULongLong -#else -#define RtlIntToUIntPtr RtlIntToUInt -#endif - -// -// INT -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToULong( - __in INT iOperand, - __out __deref_out_range(==, iOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *pulResult = (ULONG)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> ULONG_PTR conversion -// -#ifdef _WIN64 -#define RtlIntToULongPtr RtlIntToULongLong -#else -#define RtlIntToULongPtr RtlIntToULong -#endif - -// -// INT -> DWORD conversion -// -#define RtlIntToDWord RtlIntToULong - -// -// INT -> DWORD_PTR conversion -// -#define RtlIntToDWordPtr RtlIntToULongPtr - -// -// INT -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntToULongLong( - __in INT iOperand, - __out __deref_out_range(==, iOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *pullResult = (ULONGLONG)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT -> DWORDLONG conversion -// -#define RtlIntToDWordLong RtlIntToULongLong - -// -// INT -> ULONG64 conversion -// -#define RtlIntToULong64 RtlIntToULongLong - -// -// INT -> DWORD64 conversion -// -#define RtlIntToDWord64 RtlIntToULongLong - -// -// INT -> UINT64 conversion -// -#define RtlIntToUInt64 RtlIntToULongLong - -// -// INT -> size_t conversion -// -#define RtlIntToSizeT RtlIntToUIntPtr - -// -// INT -> SIZE_T conversion -// -#define RtlIntToSIZET RtlIntToULongPtr - -// -// INT32 -> CHAR conversion -// -#define RtlInt32ToChar RtlIntToChar - -// -// INT32 -> INT328 conversion -// -#define RtlInt32ToInt8 RtlIntToInt8 - -// -// INT32 -> UCHAR conversion -// -#define RtlInt32ToUChar RtlIntToUChar - -// -// INT32 -> BYTE conversion -// -#define RtlInt32ToByte RtlIntToUInt8 - -// -// INT32 -> UINT8 conversion -// -#define RtlInt32ToUInt8 RtlIntToUInt8 - -// -// INT32 -> SHORT conversion -// -#define RtlInt32ToShort RtlIntToShort - -// -// INT32 -> INT16 conversion -// -#define RtlInt32ToInt16 RtlIntToShort - -// -// INT32 -> USHORT conversion -// -#define RtlInt32ToUShort RtlIntToUShort - -// -// INT32 -> UINT16 conversion -// -#define RtlInt32ToUInt16 RtlIntToUShort - -// -// INT32 -> WORD conversion -// -#define RtlInt32ToWord RtlIntToUShort - -// -// INT32 -> UINT conversion -// -#define RtlInt32ToUInt RtlIntToUInt - -// -// INT32 -> UINT32 conversion -// -#define RtlInt32ToUInt32 RtlIntToUInt - -// -// INT32 -> UINT_PTR conversion -// -#define RtlInt32ToUIntPtr RtlIntToUIntPtr - -// -// INT32 -> ULONG conversion -// -#define RtlInt32ToULong RtlIntToULong - -// -// INT32 -> ULONG_PTR conversion -// -#define RtlInt32ToULongPtr RtlIntToULongPtr - -// -// INT32 -> DWORD conversion -// -#define RtlInt32ToDWord RtlIntToULong - -// -// INT32 -> DWORD_PTR conversion -// -#define RtlInt32ToDWordPtr RtlIntToULongPtr - -// -// INT32 -> ULONGLONG conversion -// -#define RtlInt32ToULongLong RtlIntToULongLong - -// -// INT32 -> DWORDLONG conversion -// -#define RtlInt32ToDWordLong RtlIntToULongLong - -// -// INT32 -> ULONG64 conversion -// -#define RtlInt32ToULong64 RtlIntToULongLong - -// -// INT32 -> DWORD64 conversion -// -#define RtlInt32ToDWord64 RtlIntToULongLong - -// -// INT32 -> UINT64 conversion -// -#define RtlInt32ToUInt64 RtlIntToULongLong - -// -// INT32 -> size_t conversion -// -#define RtlInt32ToSizeT RtlIntToUIntPtr - -// -// INT32 -> SIZE_T conversion -// -#define RtlInt32ToSIZET RtlIntToULongPtr - -// -// INT_PTR -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToInt8( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((iOperand >= INT8_MIN) && (iOperand <= INT8_MAX)) - { - *pi8Result = (INT8)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT_PTR -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToUChar( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= 255)) - { - *pch = (UCHAR)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT_PTR -> CHAR conversion -// -__forceinline -NTSTATUS -RtlIntPtrToChar( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlIntPtrToUChar(iOperand, (UCHAR*)pch); -#else - return RtlIntPtrToInt8(iOperand, (INT8*)pch); -#endif // _CHAR_UNSIGNED -} - -// -// INT_PTR -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToUInt8( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= UINT8_MAX)) - { - *pui8Result = (UINT8)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT_PTR -> BYTE conversion -// -#define RtlIntPtrToByte RtlIntPtrToUInt8 - -// -// INT_PTR -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToShort( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) SHORT* psResult) -{ - NTSTATUS status; - - if ((iOperand >= SHORT_MIN) && (iOperand <= SHORT_MAX)) - { - *psResult = (SHORT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT_PTR -> INT16 conversion -// -#define RtlIntPtrToInt16 RtlIntPtrToShort - -// -// INT_PTR -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToUShort( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if ((iOperand >= 0) && (iOperand <= USHORT_MAX)) - { - *pusResult = (USHORT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// INT_PTR -> UINT16 conversion -// -#define RtlIntPtrToUInt16 RtlIntPtrToUShort - -// -// INT_PTR -> WORD conversion -// -#define RtlIntPtrToWord RtlIntPtrToUShort - -// -// INT_PTR -> INT conversion -// -#ifdef _WIN64 -#define RtlIntPtrToInt RtlLongLongToInt -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToInt( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) INT* piResult) -{ - *piResult = (INT)iOperand; - return STATUS_SUCCESS; -} -#endif - -// -// INT_PTR -> INT32 conversion -// -#define RtlIntPtrToInt32 RtlIntPtrToInt - -// -// INT_PTR -> UINT conversion -// -#ifdef _WIN64 -#define RtlIntPtrToUInt RtlLongLongToUInt -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToUInt( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) UINT* puResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *puResult = (UINT)iOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// INT_PTR -> UINT32 conversion -// -#define RtlIntPtrToUInt32 RtlIntPtrToUInt - -// -// INT_PTR -> UINT_PTR conversion -// -#ifdef _WIN64 -#define RtlIntPtrToUIntPtr RtlLongLongToULongLong -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToUIntPtr( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *puResult = (UINT_PTR)iOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// INT_PTR -> LONG conversion -// -#ifdef _WIN64 -#define RtlIntPtrToLong RtlLongLongToLong -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToLong( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) LONG* plResult) -{ - *plResult = (LONG)iOperand; - return STATUS_SUCCESS; -} -#endif - -// -// INT_PTR -> LONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlIntPtrToLongPtr( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) LONG_PTR* plResult) -{ - *plResult = (LONG_PTR)iOperand; - return STATUS_SUCCESS; -} - -// -// INT_PTR -> ULONG conversion -// -#ifdef _WIN64 -#define RtlIntPtrToULong RtlLongLongToULong -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToULong( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *pulResult = (ULONG)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// INT_PTR -> ULONG_PTR conversion -// -#ifdef _WIN64 -#define RtlIntPtrToULongPtr RtlLongLongToULongLong -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToULongPtr( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *pulResult = (ULONG_PTR)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// INT_PTR -> DWORD conversion -// -#define RtlIntPtrToDWord RtlIntPtrToULong - -// -// INT_PTR -> DWORD_PTR conversion -// -#define RtlIntPtrToDWordPtr RtlIntPtrToULongPtr - -// -// INT_PTR -> ULONGLONG conversion -// -#ifdef _WIN64 -#define RtlIntPtrToULongLong RtlLongLongToULongLong -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrToULongLong( - __in INT_PTR iOperand, - __out __deref_out_range(==, iOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (iOperand >= 0) - { - *pullResult = (ULONGLONG)iOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// INT_PTR -> DWORDLONG conversion -// -#define RtlIntPtrToDWordLong RtlIntPtrToULongLong - -// -// INT_PTR -> ULONG64 conversion -// -#define RtlIntPtrToULong64 RtlIntPtrToULongLong - -// -// INT_PTR -> DWORD64 conversion -// -#define RtlIntPtrToDWord64 RtlIntPtrToULongLong - -// -// INT_PTR -> UINT64 conversion -// -#define RtlIntPtrToUInt64 RtlIntPtrToULongLong - -// -// INT_PTR -> size_t conversion -// -#define RtlIntPtrToSizeT RtlIntPtrToUIntPtr - -// -// INT_PTR -> SIZE_T conversion -// -#define RtlIntPtrToSIZET RtlIntPtrToULongPtr - -// -// UINT -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToInt8( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (uOperand <= INT8_MAX) - { - *pi8Result = (INT8)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToUChar( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (uOperand <= 255) - { - *pch = (UCHAR)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> CHAR conversion -// -__forceinline -NTSTATUS -RtlUIntToChar( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlUIntToUChar(uOperand, (UCHAR*)pch); -#else - return RtlUIntToInt8(uOperand, (INT8*)pch); -#endif -} - -// -// UINT -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToUInt8( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if (uOperand <= UINT8_MAX) - { - *pui8Result = (UINT8)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> BYTE conversion -// -#define RtlUIntToByte RtlUIntToUInt8 - -// -// UINT -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToShort( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (uOperand <= SHORT_MAX) - { - *psResult = (SHORT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> INT16 conversion -// -#define RtlUIntToInt16 RtlUIntToShort - -// -// UINT -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToUShort( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (uOperand <= USHORT_MAX) - { - *pusResult = (USHORT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> UINT16 conversion -// -#define RtlUIntToUInt16 RtlUIntToUShort - -// -// UINT -> WORD conversion -// -#define RtlUIntToWord RtlUIntToUShort - -// -// UINT -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToInt( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) INT* piResult) -{ - NTSTATUS status; - - if (uOperand <= INT_MAX) - { - *piResult = (INT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> INT32 conversion -// -#define RtlUIntToInt32 RtlUIntToInt - -// -// UINT -> INT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlUIntToIntPtr( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) INT_PTR* piResult) -{ - *piResult = uOperand; - return STATUS_SUCCESS; -} -#else -#define RtlUIntToIntPtr RtlUIntToInt -#endif - -// -// UINT -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntToLong( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) LONG* plResult) -{ - NTSTATUS status; - - if (uOperand <= LONG_MAX) - { - *plResult = (LONG)uOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT -> LONG_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlUIntToLongPtr( - __in UINT uOperand, - __out __deref_out_range(==, uOperand) LONG_PTR* plResult) -{ - *plResult = uOperand; - return STATUS_SUCCESS; -} -#else -#define RtlUIntToLongPtr RtlUIntToLong -#endif - -// -// UINT -> ptrdiff_t conversion -// -#define RtlUIntToPtrdiffT RtlUIntToIntPtr - -// -// UINT -> SSIZE_T conversion -// -#define RtlUIntToSSIZET RtlUIntToLongPtr - -// -// UINT32 -> CHAR conversion -// -#define RtlUInt32ToChar RtlUIntToChar - -// -// UINT32 -> INT8 conversion -// -#define RtlUInt32ToInt8 RtlUIntToInt8 - -// -// UINT32 -> UCHAR conversion -// -#define RtlUInt32ToUChar RtlUIntToUChar - -// -// UINT32 -> UINT8 conversion -// -#define RtlUInt32ToUInt8 RtlUIntToUInt8 - -// -// UINT32 -> BYTE conversion -// -#define RtlUInt32ToByte RtlUInt32ToUInt8 - -// -// UINT32 -> SHORT conversion -// -#define RtlUInt32ToShort RtlUIntToShort - -// -// UINT32 -> INT16 conversion -// -#define RtlUInt32ToInt16 RtlUIntToShort - -// -// UINT32 -> USHORT conversion -// -#define RtlUInt32ToUShort RtlUIntToUShort - -// -// UINT32 -> UINT16 conversion -// -#define RtlUInt32ToUInt16 RtlUIntToUShort - -// -// UINT32 -> WORD conversion -// -#define RtlUInt32ToWord RtlUIntToUShort - -// -// UINT32 -> INT conversion -// -#define RtlUInt32ToInt RtlUIntToInt - -// -// UINT32 -> INT_PTR conversion -// -#define RtlUInt32ToIntPtr RtlUIntToIntPtr - -// -// UINT32 -> INT32 conversion -// -#define RtlUInt32ToInt32 RtlUIntToInt - -// -// UINT32 -> LONG conversion -// -#define RtlUInt32ToLong RtlUIntToLong - -// -// UINT32 -> LONG_PTR conversion -// -#define RtlUInt32ToLongPtr RtlUIntToLongPtr - -// -// UINT32 -> ptrdiff_t conversion -// -#define RtlUInt32ToPtrdiffT RtlUIntToPtrdiffT - -// -// UINT32 -> SSIZE_T conversion -// -#define RtlUInt32ToSSIZET RtlUIntToSSIZET - -// -// UINT_PTR -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToInt8( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (uOperand <= INT8_MAX) - { - *pi8Result = (INT8)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToUChar( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (uOperand <= 255) - { - *pch = (UCHAR)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> CHAR conversion -// -__forceinline -NTSTATUS -RtlUIntPtrToChar( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlUIntPtrToUChar(uOperand, (UCHAR*)pch); -#else - return RtlUIntPtrToInt8(uOperand, (INT8*)pch); -#endif -} - -// -// UINT_PTR -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToUInt8( - __in UINT_PTR uOperand, - __out __deref_out_range(==,uOperand) UINT8* pu8Result) -{ - NTSTATUS status; - - if (uOperand <= UINT8_MAX) - { - *pu8Result = (UINT8)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> BYTE conversion -// -#define RtlUIntPtrToByte RtlUIntPtrToUInt8 - -// -// UINT_PTR -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToShort( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (uOperand <= SHORT_MAX) - { - *psResult = (SHORT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> INT16 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToInt16( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) INT16* pi16Result) -{ - NTSTATUS status; - - if (uOperand <= INT16_MAX) - { - *pi16Result = (INT16)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pi16Result = INT16_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToUShort( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (uOperand <= USHORT_MAX) - { - *pusResult = (USHORT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> UINT16 conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToUInt16( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) UINT16* pu16Result) -{ - NTSTATUS status; - - if (uOperand <= UINT16_MAX) - { - *pu16Result = (UINT16)uOperand; - status = STATUS_SUCCESS; - } - else - { - *pu16Result = UINT16_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> WORD conversion -// -#define RtlUIntPtrToWord RtlUIntPtrToUShort - -// -// UINT_PTR -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToInt( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) INT* piResult) -{ - NTSTATUS status; - - if (uOperand <= INT_MAX) - { - *piResult = (INT)uOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> INT32 conversion -// -#define RtlUIntPtrToInt32 RtlUIntPtrToInt - -// -// UINT_PTR -> INT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToIntPtr( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) INT_PTR* piResult) -{ - NTSTATUS status; - - if (uOperand <= INT_PTR_MAX) - { - *piResult = (INT_PTR)uOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> UINT conversion -// -#ifdef _WIN64 -#define RtlUIntPtrToUInt RtlULongLongToUInt -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToUInt( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) UINT* puResult) -{ - *puResult = (UINT)uOperand; - return STATUS_SUCCESS; -} -#endif - -// -// UINT_PTR -> UINT32 conversion -// -#define RtlUIntPtrToUInt32 RtlUIntPtrToUInt - -// -// UINT_PTR -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToLong( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) LONG* plResult) -{ - NTSTATUS status; - - if (uOperand <= LONG_MAX) - { - *plResult = (LONG)uOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> LONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToLongPtr( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) LONG_PTR* plResult) -{ - NTSTATUS status; - - if (uOperand <= LONG_PTR_MAX) - { - *plResult = (LONG_PTR)uOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT_PTR -> ULONG conversion -// -#ifdef _WIN64 -#define RtlUIntPtrToULong RtlULongLongToULong -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToULong( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) ULONG* pulResult) -{ - *pulResult = (ULONG)uOperand; - return STATUS_SUCCESS; -} -#endif - -// -// UINT_PTR -> DWORD conversion -// -#define RtlUIntPtrToDWord RtlUIntPtrToULong - -// -// UINT_PTR -> LONGLONG conversion -// -#ifdef _WIN64 -#define RtlUIntPtrToLongLong RtlULongLongToLongLong -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrToLongLong( - __in UINT_PTR uOperand, - __out __deref_out_range(==, uOperand) LONGLONG* pllResult) -{ - *pllResult = (LONGLONG)uOperand; - return STATUS_SUCCESS; -} -#endif - -// -// UINT_PTR -> LONG64 conversion -// -#define RtlUIntPtrToLong64 RtlUIntPtrToLongLong - -// -// UINT_PTR -> RtlINT64 conversion -// -#define RtlUIntPtrToInt64 RtlUIntPtrToLongLong - -// -// UINT_PTR -> ptrdiff_t conversion -// -#define RtlUIntPtrToPtrdiffT RtlUIntPtrToIntPtr - -// -// UINT_PTR -> SSIZE_T conversion -// -#define RtlUIntPtrToSSIZET RtlUIntPtrToLongPtr - -// -// LONG -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToInt8( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((lOperand >= INT8_MIN) && (lOperand <= INT8_MAX)) - { - *pi8Result = (INT8)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToUChar( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= 255)) - { - *pch = (UCHAR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> CHAR conversion -// -__forceinline -NTSTATUS -RtlLongToChar( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlLongToUChar(lOperand, (UCHAR*)pch); -#else - return RtlLongToInt8(lOperand, (INT8*)pch); -#endif -} - -// -// LONG -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToUInt8( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= UINT8_MAX)) - { - *pui8Result = (UINT8)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> BYTE conversion -// -#define RtlLongToByte RtlLongToUInt8 - -// -// LONG -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToShort( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) SHORT* psResult) -{ - NTSTATUS status; - - if ((lOperand >= SHORT_MIN) && (lOperand <= SHORT_MAX)) - { - *psResult = (SHORT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> INT16 conversion -// -#define RtlLongToInt16 RtlLongToShort - -// -// LONG -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToUShort( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= USHORT_MAX)) - { - *pusResult = (USHORT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> UINT16 conversion -// -#define RtlLongToUInt16 RtlLongToUShort - -// -// LONG -> WORD conversion -// -#define RtlLongToWord RtlLongToUShort - -// -// LONG -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToInt( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) INT* piResult) -{ - C_ASSERT(sizeof(INT) == sizeof(LONG)); - *piResult = (INT)lOperand; - return STATUS_SUCCESS; -} - -// -// LONG -> INT32 conversion -// -#define RtlLongToInt32 RtlLongToInt - -// -// LONG -> INT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlLongToIntPtr( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) INT_PTR* piResult) -{ - *piResult = lOperand; - return STATUS_SUCCESS; -} -#else -#define RtlLongToIntPtr RtlLongToInt -#endif - -// -// LONG -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToUInt( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) UINT* puResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *puResult = (UINT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> UINT32 conversion -// -#define RtlLongToUInt32 RtlLongToUInt - -// -// LONG -> UINT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlLongToUIntPtr( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *puResult = (UINT_PTR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#else -#define RtlLongToUIntPtr RtlLongToUInt -#endif - -// -// LONG -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToULong( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pulResult = (ULONG)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> ULONG_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlLongToULongPtr( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pulResult = (ULONG_PTR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#else -#define RtlLongToULongPtr RtlLongToULong -#endif - -// -// LONG -> DWORD conversion -// -#define RtlLongToDWord RtlLongToULong - -// -// LONG -> DWORD_PTR conversion -// -#define RtlLongToDWordPtr RtlLongToULongPtr - -// -// LONG -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongToULongLong( - __in LONG lOperand, - __out __deref_out_range(==, lOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pullResult = (ULONGLONG)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG -> DWORDLONG conversion -// -#define RtlLongToDWordLong RtlLongToULongLong - -// -// LONG -> ULONG64 conversion -// -#define RtlLongToULong64 RtlLongToULongLong - -// -// LONG -> DWORD64 conversion -// -#define RtlLongToDWord64 RtlLongToULongLong - -// -// LONG -> UINT64 conversion -// -#define RtlLongToUInt64 RtlLongToULongLong - -// -// LONG -> ptrdiff_t conversion -// -#define RtlLongToPtrdiffT RtlLongToIntPtr - -// -// LONG -> size_t conversion -// -#define RtlLongToSizeT RtlLongToUIntPtr - -// -// LONG -> SIZE_T conversion -// -#define RtlLongToSIZET RtlLongToULongPtr - -// -// LONG_PTR -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToInt8( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((lOperand >= INT8_MIN) && (lOperand <= INT8_MAX)) - { - *pi8Result = (INT8)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToUChar( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= 255)) - { - *pch = (UCHAR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> CHAR conversion -// -__forceinline -NTSTATUS -RtlLongPtrToChar( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlLongPtrToUChar(lOperand, (UCHAR*)pch); -#else - return RtlLongPtrToInt8(lOperand, (INT8*)pch); -#endif -} - -// -// LONG_PTR -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToUInt8( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= UINT8_MAX)) - { - *pui8Result = (UINT8)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> BYTE conversion -// -#define RtlLongPtrToByte RtlLongPtrToUInt8 - -// -// LONG_PTR -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToShort( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) SHORT* psResult) -{ - NTSTATUS status; - - if ((lOperand >= SHORT_MIN) && (lOperand <= SHORT_MAX)) - { - *psResult = (SHORT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> INT16 conversion -// -#define RtlLongPtrToInt16 RtlLongPtrToShort - -// -// LONG_PTR -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToUShort( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if ((lOperand >= 0) && (lOperand <= USHORT_MAX)) - { - *pusResult = (USHORT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> UINT16 conversion -// -#define RtlLongPtrToUInt16 RtlLongPtrToUShort - -// -// LONG_PTR -> WORD conversion -// -#define RtlLongPtrToWord RtlLongPtrToUShort - -// -// LONG_PTR -> INT conversion -// -#ifdef _WIN64 -#define RtlLongPtrToInt RtlLongLongToInt -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrToInt( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) INT* piResult) -{ - C_ASSERT(sizeof(INT) == sizeof(LONG_PTR)); - *piResult = (INT)lOperand; - return STATUS_SUCCESS; -} -#endif - -// -// LONG_PTR -> INT32 conversion -// -#define RtlLongPtrToInt32 RtlLongPtrToInt - -// -// LONG_PTR -> INT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToIntPtr( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) INT_PTR* piResult) -{ - C_ASSERT(sizeof(LONG_PTR) == sizeof(INT_PTR)); - *piResult = (INT_PTR)lOperand; - return STATUS_SUCCESS; -} - -// -// LONG_PTR -> UINT conversion -// -#ifdef _WIN64 -#define RtlLongPtrToUInt RtlLongLongToUInt -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrToUInt( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) UINT* puResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *puResult = (UINT)lOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// LONG_PTR -> UINT32 conversion -// -#define RtlLongPtrToUInt32 RtlLongPtrToUInt - -// -// LONG_PTR -> UINT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToUIntPtr( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *puResult = (UINT_PTR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> LONG conversion -// -#ifdef _WIN64 -#define RtlLongPtrToLong RtlLongLongToLong -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrToLong( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) LONG* plResult) -{ - *plResult = (LONG)lOperand; - return STATUS_SUCCESS; -} -#endif - -// -// LONG_PTR -> ULONG conversion -// -#ifdef _WIN64 -#define RtlLongPtrToULong RtlLongLongToULong -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrToULong( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pulResult = (ULONG)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif - -// -// LONG_PTR -> ULONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToULongPtr( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pulResult = (ULONG_PTR)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> DWORD conversion -// -#define RtlLongPtrToDWord RtlLongPtrToULong - -// -// LONG_PTR -> DWORD_PTR conversion -// -#define RtlLongPtrToDWordPtr RtlLongPtrToULongPtr - -// -// LONG_PTR -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongPtrToULongLong( - __in LONG_PTR lOperand, - __out __deref_out_range(==, lOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (lOperand >= 0) - { - *pullResult = (ULONGLONG)lOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONG_PTR -> DWORDLONG conversion -// -#define RtlLongPtrToDWordLong RtlLongPtrToULongLong - -// -// LONG_PTR -> ULONG64 conversion -// -#define RtlLongPtrToULong64 RtlLongPtrToULongLong - -// -// LONG_PTR -> DWORD64 conversion -// -#define RtlLongPtrToDWord64 RtlLongPtrToULongLong - -// -// LONG_PTR -> UINT64 conversion -// -#define RtlLongPtrToUInt64 RtlLongPtrToULongLong - -// -// LONG_PTR -> size_t conversion -// -#define RtlLongPtrToSizeT RtlLongPtrToUIntPtr - -// -// LONG_PTR -> SIZE_T conversion -// -#define RtlLongPtrToSIZET RtlLongPtrToULongPtr - -// -// ULONG -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToInt8( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (ulOperand <= INT8_MAX) - { - *pi8Result = (INT8)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToUChar( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (ulOperand <= 255) - { - *pch = (UCHAR)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> CHAR conversion -// -__forceinline -NTSTATUS -RtlULongToChar( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlULongToUChar(ulOperand, (UCHAR*)pch); -#else - return RtlULongToInt8(ulOperand, (INT8*)pch); -#endif -} - -// -// ULONG -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToUInt8( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if (ulOperand <= UINT8_MAX) - { - *pui8Result = (UINT8)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> BYTE conversion -// -#define RtlULongToByte RtlULongToUInt8 - -// -// ULONG -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToShort( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (ulOperand <= SHORT_MAX) - { - *psResult = (SHORT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> INT16 conversion -// -#define RtlULongToInt16 RtlULongToShort - -// -// ULONG -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToUShort( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (ulOperand <= USHORT_MAX) - { - *pusResult = (USHORT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> UINT16 conversion -// -#define RtlULongToUInt16 RtlULongToUShort - -// -// ULONG -> WORD conversion -// -#define RtlULongToWord RtlULongToUShort - -// -// ULONG -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToInt( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) INT* piResult) -{ - NTSTATUS status; - - if (ulOperand <= INT_MAX) - { - *piResult = (INT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> INT32 conversion -// -#define RtlULongToInt32 RtlULongToInt - -// -// ULONG -> INT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlULongToIntPtr( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) INT_PTR* piResult) -{ - *piResult = (INT_PTR)ulOperand; - return STATUS_SUCCESS; -} -#else -#define RtlULongToIntPtr RtlULongToInt -#endif - -// -// ULONG -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToUInt( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) UINT* puResult) -{ - C_ASSERT(sizeof(ULONG) == sizeof(UINT)); - *puResult = (UINT)ulOperand; - return STATUS_SUCCESS; -} - -// -// ULONG -> UINT32 conversion -// -#define RtlULongToUInt32 RtlULongToUInt - -// -// ULONG -> UINT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlULongToUIntPtr( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) UINT_PTR* puiResult) -{ - C_ASSERT(sizeof(UINT_PTR) > sizeof(ULONG)); - *puiResult = (UINT_PTR)ulOperand; - return STATUS_SUCCESS; -} -#else -#define RtlULongToUIntPtr RtlULongToUInt -#endif - -// -// ULONG -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongToLong( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) LONG* plResult) -{ - NTSTATUS status; - - if (ulOperand <= LONG_MAX) - { - *plResult = (LONG)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG -> LONG_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlULongToLongPtr( - __in ULONG ulOperand, - __out __deref_out_range(==, ulOperand) LONG_PTR* plResult) -{ - C_ASSERT(sizeof(LONG_PTR) > sizeof(ULONG)); - *plResult = (LONG_PTR)ulOperand; - return STATUS_SUCCESS; -} -#else -#define RtlULongToLongPtr RtlULongToLong -#endif - -// -// ULONG -> ptrdiff_t conversion -// -#define RtlULongToPtrdiffT RtlULongToIntPtr - -// -// ULONG -> SSIZE_T conversion -// -#define RtlULongToSSIZET RtlULongToLongPtr - -// -// ULONG_PTR -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToInt8( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (ulOperand <= INT8_MAX) - { - *pi8Result = (INT8)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToUChar( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (ulOperand <= 255) - { - *pch = (UCHAR)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> CHAR conversion -// -__forceinline -NTSTATUS -RtlULongPtrToChar( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlULongPtrToUChar(ulOperand, (UCHAR*)pch); -#else - return RtlULongPtrToInt8(ulOperand, (INT8*)pch); -#endif -} - -// -// ULONG_PTR -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToUInt8( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) UINT8* pui8Result) -{ - NTSTATUS status; - - if (ulOperand <= UINT8_MAX) - { - *pui8Result = (UINT8)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pui8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> BYTE conversion -// -#define RtlULongPtrToByte RtlULongPtrToUInt8 - -// -// ULONG_PTR -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToShort( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (ulOperand <= SHORT_MAX) - { - *psResult = (SHORT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> INT16 conversion -// -#define RtlULongPtrToInt16 RtlULongPtrToShort - -// -// ULONG_PTR -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToUShort( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (ulOperand <= USHORT_MAX) - { - *pusResult = (USHORT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> UINT16 conversion -// -#define RtlULongPtrToUInt16 RtlULongPtrToUShort - -// -// ULONG_PTR -> WORD conversion -// -#define RtlULongPtrToWord RtlULongPtrToUShort - -// -// ULONG_PTR -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToInt( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) INT* piResult) -{ - NTSTATUS status; - - if (ulOperand <= INT_MAX) - { - *piResult = (INT)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> INT32 conversion -// -#define RtlULongPtrToInt32 RtlULongPtrToInt - -// -// ULONG_PTR -> INT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToIntPtr( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) INT_PTR* piResult) -{ - NTSTATUS status; - - if (ulOperand <= INT_PTR_MAX) - { - *piResult = (INT_PTR)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> UINT conversion -// -#ifdef _WIN64 -#define RtlULongPtrToUInt RtlULongLongToUInt -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrToUInt( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) UINT* puResult) -{ - C_ASSERT(sizeof(ULONG_PTR) == sizeof(UINT)); - *puResult = (UINT)ulOperand; - return STATUS_SUCCESS; -} -#endif - -// -// ULONG_PTR -> UINT32 conversion -// -#define RtlULongPtrToUInt32 RtlULongPtrToUInt - -// -// ULONG_PTR -> UINT_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToUIntPtr( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) UINT_PTR* puResult) -{ - *puResult = (UINT_PTR)ulOperand; - return STATUS_SUCCESS; -} - -// -// ULONG_PTR -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToLong( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) LONG* plResult) -{ - NTSTATUS status; - - if (ulOperand <= LONG_MAX) - { - *plResult = (LONG)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> LONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongPtrToLongPtr( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) LONG_PTR* plResult) -{ - NTSTATUS status; - - if (ulOperand <= LONG_PTR_MAX) - { - *plResult = (LONG_PTR)ulOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR -> ULONG conversion -// -#ifdef _WIN64 -#define RtlULongPtrToULong RtlULongLongToULong -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrToULong( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) ULONG* pulResult) -{ - *pulResult = (ULONG)ulOperand; - return STATUS_SUCCESS; -} -#endif - -// -// ULONG_PTR -> DWORD conversion -// -#define RtlULongPtrToDWord RtlULongPtrToULong - -// -// ULONG_PTR -> LONGLONG conversion -// -#ifdef _WIN64 -#define RtlULongPtrToLongLong RtlULongLongToLongLong -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrToLongLong( - __in ULONG_PTR ulOperand, - __out __deref_out_range(==, ulOperand) LONGLONG* pllResult) -{ - *pllResult = (LONGLONG)ulOperand; - return STATUS_SUCCESS; -} -#endif - -// -// ULONG_PTR -> LONG64 conversion -// -#define RtlULongPtrToLong64 RtlULongPtrToLongLong - -// -// ULONG_PTR -> RtlINT64 -// -#define RtlULongPtrToInt64 RtlULongPtrToLongLong - -// -// ULONG_PTR -> ptrdiff_t conversion -// -#define RtlULongPtrToPtrdiffT RtlULongPtrToIntPtr - -// -// ULONG_PTR -> SSIZE_T conversion -// -#define RtlULongPtrToSSIZET RtlULongPtrToLongPtr - -// -// DWORD -> INT8 conversion -// -#define RtlDWordToInt8 RtlULongToInt8 - -// -// DWORD -> CHAR conversion -// -#define RtlDWordToChar RtlULongToChar - -// -// DWORD -> UCHAR conversion -// -#define RtlDWordToUChar RtlULongToUChar - -// -// DWORD -> UINT8 conversion -// -#define RtlDWordToUInt8 RtlULongToUInt8 - -// -// DWORD -> BYTE conversion -// -#define RtlDWordToByte RtlULongToUInt8 - -// -// DWORD -> SHORT conversion -// -#define RtlDWordToShort RtlULongToShort - -// -// DWORD -> INT16 conversion -// -#define RtlDWordToInt16 RtlULongToShort - -// -// DWORD -> USHORT conversion -// -#define RtlDWordToUShort RtlULongToUShort - -// -// DWORD -> UINT16 conversion -// -#define RtlDWordToUInt16 RtlULongToUShort - -// -// DWORD -> WORD conversion -// -#define RtlDWordToWord RtlULongToUShort - -// -// DWORD -> INT conversion -// -#define RtlDWordToInt RtlULongToInt - -// -// DWORD -> INT32 conversion -// -#define RtlDWordToInt32 RtlULongToInt - -// -// DWORD -> INT_PTR conversion -// -#define RtlDWordToIntPtr RtlULongToIntPtr - -// -// DWORD -> UINT conversion -// -#define RtlDWordToUInt RtlULongToUInt - -// -// DWORD -> UINT32 conversion -// -#define RtlDWordToUInt32 RtlULongToUInt - -// -// DWORD -> UINT_PTR conversion -// -#define RtlDWordToUIntPtr RtlULongToUIntPtr - -// -// DWORD -> LONG conversion -// -#define RtlDWordToLong RtlULongToLong - -// -// DWORD -> LONG_PTR conversion -// -#define RtlDWordToLongPtr RtlULongToLongPtr - -// -// DWORD -> ptrdiff_t conversion -// -#define RtlDWordToPtrdiffT RtlULongToIntPtr - -// -// DWORD -> SSIZE_T conversion -// -#define RtlDWordToSSIZET RtlULongToLongPtr - -// -// DWORD_PTR -> INT8 conversion -// -#define RtlDWordPtrToInt8 RtlULongPtrToInt8 - -// -// DWORD_PTR -> UCHAR conversion -// -#define RtlDWordPtrToUChar RtlULongPtrToUChar - -// -// DWORD_PTR -> CHAR conversion -// -#define RtlDWordPtrToChar RtlULongPtrToChar - -// -// DWORD_PTR -> UINT8 conversion -// -#define RtlDWordPtrToUInt8 RtlULongPtrToUInt8 - -// -// DWORD_PTR -> BYTE conversion -// -#define RtlDWordPtrToByte RtlULongPtrToUInt8 - -// -// DWORD_PTR -> SHORT conversion -// -#define RtlDWordPtrToShort RtlULongPtrToShort - -// -// DWORD_PTR -> INT16 conversion -// -#define RtlDWordPtrToInt16 RtlULongPtrToShort - -// -// DWORD_PTR -> USHORT conversion -// -#define RtlDWordPtrToUShort RtlULongPtrToUShort - -// -// DWORD_PTR -> UINT16 conversion -// -#define RtlDWordPtrToUInt16 RtlULongPtrToUShort - -// -// DWORD_PTR -> WORD conversion -// -#define RtlDWordPtrToWord RtlULongPtrToUShort - -// -// DWORD_PTR -> INT conversion -// -#define RtlDWordPtrToInt RtlULongPtrToInt - -// -// DWORD_PTR -> INT32 conversion -// -#define RtlDWordPtrToInt32 RtlULongPtrToInt - -// -// DWORD_PTR -> INT_PTR conversion -// -#define RtlDWordPtrToIntPtr RtlULongPtrToIntPtr - -// -// DWORD_PTR -> UINT conversion -// -#define RtlDWordPtrToUInt RtlULongPtrToUInt - -// -// DWORD_PTR -> UINT32 conversion -// -#define RtlDWordPtrToUInt32 RtlULongPtrToUInt - -// -// DWODR_PTR -> UINT_PTR conversion -// -#define RtlDWordPtrToUIntPtr RtlULongPtrToUIntPtr - -// -// DWORD_PTR -> LONG conversion -// -#define RtlDWordPtrToLong RtlULongPtrToLong - -// -// DWORD_PTR -> LONG_PTR conversion -// -#define RtlDWordPtrToLongPtr RtlULongPtrToLongPtr - -// -// DWORD_PTR -> ULONG conversion -// -#define RtlDWordPtrToULong RtlULongPtrToULong - -// -// DWORD_PTR -> DWORD conversion -// -#define RtlDWordPtrToDWord RtlULongPtrToULong - -// -// DWORD_PTR -> LONGLONG conversion -// -#define RtlDWordPtrToLongLong RtlULongPtrToLongLong - -// -// DWORD_PTR -> LONG64 conversion -// -#define RtlDWordPtrToLong64 RtlULongPtrToLongLong - -// -// DWORD_PTR -> RtlINT64 conversion -// -#define RtlDWordPtrToInt64 RtlULongPtrToLongLong - -// -// DWORD_PTR -> ptrdiff_t conversion -// -#define RtlDWordPtrToPtrdiffT RtlULongPtrToIntPtr - -// -// DWORD_PTR -> SSIZE_T conversion -// -#define RtlDWordPtrToSSIZET RtlULongPtrToLongPtr - -// -// LONGLONG -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToInt8( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if ((llOperand >= INT8_MIN) && (llOperand <= INT8_MAX)) - { - *pi8Result = (INT8)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToUChar( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) UCHAR* pch) -{ - NTSTATUS status; - - if ((llOperand >= 0) && (llOperand <= 255)) - { - *pch = (UCHAR)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> CHAR conversion -// -__forceinline -NTSTATUS -RtlLongLongToChar( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlLongLongToUChar(llOperand, (UCHAR*)pch); -#else - return RtlLongLongToInt8(llOperand, (INT8*)pch); -#endif -} - -// -// LONGLONG -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToUInt8( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) UINT8* pu8Result) -{ - NTSTATUS status; - - if ((llOperand >= 0) && (llOperand <= UINT8_MAX)) - { - *pu8Result = (UINT8)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> BYTE conversion -// -#define RtlLongLongToByte RtlLongLongToUInt8 - -// -// LONGLONG -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToShort( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) SHORT* psResult) -{ - NTSTATUS status; - - if ((llOperand >= SHORT_MIN) && (llOperand <= SHORT_MAX)) - { - *psResult = (SHORT)llOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> INT16 conversion -// -#define RtlLongLongToInt16 RtlLongLongToShort - -// -// LONGLONG -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToUShort( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if ((llOperand >= 0) && (llOperand <= USHORT_MAX)) - { - *pusResult = (USHORT)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> UINT16 conversion -// -#define RtlLongLongToUInt16 RtlLongLongToUShort - -// -// LONGLONG -> WORD conversion -// -#define RtlLongLongToWord RtlLongLongToUShort - -// -// LONGLONG -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToInt( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) INT* piResult) -{ - NTSTATUS status; - - if ((llOperand >= INT_MIN) && (llOperand <= INT_MAX)) - { - *piResult = (INT)llOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> INT32 conversion -// -#define RtlLongLongToInt32 RtlLongLongToInt - -// -// LONGLONG -> INT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlLongLongToIntPtr( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) INT_PTR* piResult) -{ - *piResult = llOperand; - return STATUS_SUCCESS; -} -#else -#define RtlLongLongToIntPtr RtlLongLongToInt -#endif - -// -// LONGLONG -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToUInt( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) UINT* puResult) -{ - NTSTATUS status; - - if ((llOperand >= 0) && (llOperand <= UINT_MAX)) - { - *puResult = (UINT)llOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> UINT32 conversion -// -#define RtlLongLongToUInt32 RtlLongLongToUInt - -// -// LONGLONG -> UINT_PTR conversion -// -#ifdef _WIN64 -#define RtlLongLongToUIntPtr RtlLongLongToULongLong -#else -#define RtlLongLongToUIntPtr RtlLongLongToUInt -#endif - -// -// LONGLONG -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToLong( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) LONG* plResult) -{ - NTSTATUS status; - - if ((llOperand >= LONG_MIN) && (llOperand <= LONG_MAX)) - { - *plResult = (LONG)llOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> LONG_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlLongLongToLongPtr( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) LONG_PTR* plResult) -{ - *plResult = (LONG_PTR)llOperand; - return STATUS_SUCCESS; -} -#else -#define RtlLongLongToLongPtr RtlLongLongToLong -#endif - -// -// LONGLONG -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToULong( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if ((llOperand >= 0) && (llOperand <= ULONG_MAX)) - { - *pulResult = (ULONG)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> ULONG_PTR conversion -// -#ifdef _WIN64 -#define RtlLongLongToULongPtr RtlLongLongToULongLong -#else -#define RtlLongLongToULongPtr RtlLongLongToULong -#endif - -// -// LONGLONG -> DWORD conversion -// -#define RtlLongLongToDWord RtlLongLongToULong - -// -// LONGLONG -> DWORD_PTR conversion -// -#define RtlLongLongToDWordPtr RtlLongLongToULongPtr - -// -// LONGLONG -> ULONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlLongLongToULongLong( - __in LONGLONG llOperand, - __out __deref_out_range(==, llOperand) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (llOperand >= 0) - { - *pullResult = (ULONGLONG)llOperand; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// LONGLONG -> DWORDLONG conversion -// -#define RtlLongLongToDWordLong RtlLongLongToULongLong - -// -// LONGLONG -> ULONG64 conversion -// -#define RtlLongLongToULong64 RtlLongLongToULongLong - -// -// LONGLONG -> DWORD64 conversion -// -#define RtlLongLongToDWord64 RtlLongLongToULongLong - -// -// LONGLONG -> UINT64 conversion -// -#define RtlLongLongToUInt64 RtlLongLongToULongLong - -// -// LONGLONG -> ptrdiff_t conversion -// -#define RtlLongLongToPtrdiffT RtlLongLongToIntPtr - -// -// LONGLONG -> size_t conversion -// -#define RtlLongLongToSizeT RtlLongLongToUIntPtr - -// -// LONGLONG -> SSIZE_T conversion -// -#define RtlLongLongToSSIZET RtlLongLongToLongPtr - -// -// LONGLONG -> SIZE_T conversion -// -#define RtlLongLongToSIZET RtlLongLongToULongPtr - -// -// LONG64 -> CHAR conversion -// -#define RtlLong64ToChar RtlLongLongToChar - -// -// LONG64 -> INT8 conversion -// -#define RtlLong64ToInt8 RtlLongLongToInt8 - -// -// LONG64 -> UCHAR conversion -// -#define RtlLong64ToUChar RtlLongLongToUChar - -// -// LONG64 -> UINT8 conversion -// -#define RtlLong64ToUInt8 RtlLongLongToUInt8 - -// -// LONG64 -> BYTE conversion -// -#define RtlLong64ToByte RtlLongLongToUInt8 - -// -// LONG64 -> SHORT conversion -// -#define RtlLong64ToShort RtlLongLongToShort - -// -// LONG64 -> INT16 conversion -// -#define RtlLong64ToInt16 RtlLongLongToShort - -// -// LONG64 -> USHORT conversion -// -#define RtlLong64ToUShort RtlLongLongToUShort - -// -// LONG64 -> UINT16 conversion -// -#define RtlLong64ToUInt16 RtlLongLongToUShort - -// -// LONG64 -> WORD conversion -// -#define RtlLong64ToWord RtlLongLongToUShort - -// -// LONG64 -> INT conversion -// -#define RtlLong64ToInt RtlLongLongToInt - -// -// LONG64 -> INT32 conversion -// -#define RtlLong64ToInt32 RtlLongLongToInt - -// -// LONG64 -> INT_PTR conversion -// -#define RtlLong64ToIntPtr RtlLongLongToIntPtr - -// -// LONG64 -> UINT conversion -// -#define RtlLong64ToUInt RtlLongLongToUInt - -// -// LONG64 -> UINT32 conversion -// -#define RtlLong64ToUInt32 RtlLongLongToUInt - -// -// LONG64 -> UINT_PTR conversion -// -#define RtlLong64ToUIntPtr RtlLongLongToUIntPtr - -// -// LONG64 -> LONG conversion -// -#define RtlLong64ToLong RtlLongLongToLong - -// -// LONG64 -> LONG_PTR conversion -// -#define RtlLong64ToLongPtr RtlLongLongToLongPtr - -// -// LONG64 -> ULONG conversion -// -#define RtlLong64ToULong RtlLongLongToULong - -// -// LONG64 -> ULONG_PTR conversion -// -#define RtlLong64ToULongPtr RtlLongLongToULongPtr - -// -// LONG64 -> DWORD conversion -// -#define RtlLong64ToDWord RtlLongLongToULong - -// -// LONG64 -> DWORD_PTR conversion -// -#define RtlLong64ToDWordPtr RtlLongLongToULongPtr - -// -// LONG64 -> ULONGLONG conversion -// -#define RtlLong64ToULongLong RtlLongLongToULongLong - -// -// LONG64 -> ptrdiff_t conversion -// -#define RtlLong64ToPtrdiffT RtlLongLongToIntPtr - -// -// LONG64 -> size_t conversion -// -#define RtlLong64ToSizeT RtlLongLongToUIntPtr - -// -// LONG64 -> SSIZE_T conversion -// -#define RtlLong64ToSSIZET RtlLongLongToLongPtr - -// -// LONG64 -> SIZE_T conversion -// -#define RtlLong64ToSIZET RtlLongLongToULongPtr - -// -// RtlINT64 -> CHAR conversion -// -#define RtlInt64ToChar RtlLongLongToChar - -// -// RtlINT64 -> INT8 conversion -// -#define RtlInt64ToInt8 RtlLongLongToInt8 - -// -// RtlINT64 -> UCHAR conversion -// -#define RtlInt64ToUChar RtlLongLongToUChar - -// -// RtlINT64 -> UINT8 conversion -// -#define RtlInt64ToUInt8 RtlLongLongToUInt8 - -// -// RtlINT64 -> BYTE conversion -// -#define RtlInt64ToByte RtlLongLongToUInt8 - -// -// RtlINT64 -> SHORT conversion -// -#define RtlInt64ToShort RtlLongLongToShort - -// -// RtlINT64 -> INT16 conversion -// -#define RtlInt64ToInt16 RtlLongLongToShort - -// -// RtlINT64 -> USHORT conversion -// -#define RtlInt64ToUShort RtlLongLongToUShort - -// -// RtlINT64 -> UINT16 conversion -// -#define RtlInt64ToUInt16 RtlLongLongToUShort - -// -// RtlINT64 -> WORD conversion -// -#define RtlInt64ToWord RtlLongLongToUShort - -// -// RtlINT64 -> INT conversion -// -#define RtlInt64ToInt RtlLongLongToInt - -// -// RtlINT64 -> INT32 conversion -// -#define RtlInt64ToInt32 RtlLongLongToInt - -// -// RtlINT64 -> INT_PTR conversion -// -#define RtlInt64ToIntPtr RtlLongLongToIntPtr - -// -// RtlINT64 -> UINT conversion -// -#define RtlInt64ToUInt RtlLongLongToUInt - -// -// RtlINT64 -> UINT32 conversion -// -#define RtlInt64ToUInt32 RtlLongLongToUInt - -// -// RtlINT64 -> UINT_PTR conversion -// -#define RtlInt64ToUIntPtr RtlLongLongToUIntPtr - -// -// RtlINT64 -> LONG conversion -// -#define RtlInt64ToLong RtlLongLongToLong - -// -// RtlINT64 -> LONG_PTR conversion -// -#define RtlInt64ToLongPtr RtlLongLongToLongPtr - -// -// RtlINT64 -> ULONG conversion -// -#define RtlInt64ToULong RtlLongLongToULong - -// -// RtlINT64 -> ULONG_PTR conversion -// -#define RtlInt64ToULongPtr RtlLongLongToULongPtr - -// -// RtlINT64 -> DWORD conversion -// -#define RtlInt64ToDWord RtlLongLongToULong - -// -// RtlINT64 -> DWORD_PTR conversion -// -#define RtlInt64ToDWordPtr RtlLongLongToULongPtr - -// -// RtlINT64 -> ULONGLONG conversion -// -#define RtlInt64ToULongLong RtlLongLongToULongLong - -// -// RtlINT64 -> DWORDLONG conversion -// -#define RtlInt64ToDWordLong RtlLongLongToULongLong - -// -// RtlINT64 -> ULONG64 conversion -// -#define RtlInt64ToULong64 RtlLongLongToULongLong - -// -// RtlINT64 -> DWORD64 conversion -// -#define RtlInt64ToDWord64 RtlLongLongToULongLong - -// -// RtlINT64 -> UINT64 conversion -// -#define RtlInt64ToUInt64 RtlLongLongToULongLong - -// -// RtlINT64 -> ptrdiff_t conversion -// -#define RtlInt64ToPtrdiffT RtlLongLongToIntPtr - -// -// RtlINT64 -> size_t conversion -// -#define RtlInt64ToSizeT RtlLongLongToUIntPtr - -// -// RtlINT64 -> SSIZE_T conversion -// -#define RtlInt64ToSSIZET RtlLongLongToLongPtr - -// -// RtlINT64 -> SIZE_T conversion -// -#define RtlInt64ToSIZET RtlLongLongToULongPtr - -// -// ULONGLONG -> INT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToInt8( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) INT8* pi8Result) -{ - NTSTATUS status; - - if (ullOperand <= INT8_MAX) - { - *pi8Result = (INT8)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pi8Result = INT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> UCHAR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToUChar( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) UCHAR* pch) -{ - NTSTATUS status; - - if (ullOperand <= 255) - { - *pch = (UCHAR)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pch = '\0'; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> CHAR conversion -// -__forceinline -NTSTATUS -RtlULongLongToChar( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) CHAR* pch) -{ -#ifdef _CHAR_UNSIGNED - return RtlULongLongToUChar(ullOperand, (UCHAR*)pch); -#else - return RtlULongLongToInt8(ullOperand, (INT8*)pch); -#endif -} - -// -// ULONGLONG -> UINT8 conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToUInt8( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) UINT8* pu8Result) -{ - NTSTATUS status; - - if (ullOperand <= UINT8_MAX) - { - *pu8Result = (UINT8)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> BYTE conversion -// -#define RtlULongLongToByte RtlULongLongToUInt8 - -// -// ULONGLONG -> SHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToShort( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) SHORT* psResult) -{ - NTSTATUS status; - - if (ullOperand <= SHORT_MAX) - { - *psResult = (SHORT)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *psResult = SHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> INT16 conversion -// -#define RtlULongLongToInt16 RtlULongLongToShort - -// -// ULONGLONG -> USHORT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToUShort( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) USHORT* pusResult) -{ - NTSTATUS status; - - if (ullOperand <= USHORT_MAX) - { - *pusResult = (USHORT)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> UINT16 conversion -// -#define RtlULongLongToUInt16 RtlULongLongToUShort - -// -// ULONGLONG -> WORD conversion -// -#define RtlULongLongToWord RtlULongLongToUShort - -// -// ULONGLONG -> INT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToInt( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) INT* piResult) -{ - NTSTATUS status; - - if (ullOperand <= INT_MAX) - { - *piResult = (INT)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *piResult = INT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> INT32 conversion -// -#define RtlULongLongToInt32 RtlULongLongToInt - -// -// ULONGLONG -> INT_PTR conversion -// -#ifdef _WIN64 -#define RtlULongLongToIntPtr RtlULongLongToLongLong -#else -#define RtlULongLongToIntPtr RtlULongLongToInt -#endif - -// -// ULONGLONG -> UINT conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToUInt( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) UINT* puResult) -{ - NTSTATUS status; - - if (ullOperand <= UINT_MAX) - { - *puResult = (UINT)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> UINT32 conversion -// -#define RtlULongLongToUInt32 RtlULongLongToUInt - -// -// ULONGLONG -> UINT_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlULongLongToUIntPtr( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) UINT_PTR* puResult) -{ - *puResult = ullOperand; - return STATUS_SUCCESS; -} -#else -#define RtlULongLongToUIntPtr RtlULongLongToUInt -#endif - -// -// ULONGLONG -> LONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToLong( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) LONG* plResult) -{ - NTSTATUS status; - - if (ullOperand <= LONG_MAX) - { - *plResult = (LONG)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> LONG_PTR conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToLongPtr( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) LONG_PTR* plResult) -{ - NTSTATUS status; - - if (ullOperand <= LONG_PTR_MAX) - { - *plResult = (LONG_PTR)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *plResult = LONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> ULONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToULong( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) ULONG* pulResult) -{ - NTSTATUS status; - - if (ullOperand <= ULONG_MAX) - { - *pulResult = (ULONG)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> ULONG_PTR conversion -// -#ifdef _WIN64 -__checkReturn -__inline -NTSTATUS -RtlULongLongToULongPtr( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) ULONG_PTR* pulResult) -{ - *pulResult = ullOperand; - return STATUS_SUCCESS; -} -#else -#define RtlULongLongToULongPtr RtlULongLongToULong -#endif - -// -// ULONGLONG -> DWORD conversion -// -#define RtlULongLongToDWord RtlULongLongToULong - -// -// ULONGLONG -> DWORD_PTR conversion -// -#define RtlULongLongToDWordPtr RtlULongLongToULongPtr - -// -// ULONGLONG -> LONGLONG conversion -// -__checkReturn -__inline -NTSTATUS -RtlULongLongToLongLong( - __in ULONGLONG ullOperand, - __out __deref_out_range(==, ullOperand) LONGLONG* pllResult) -{ - NTSTATUS status; - - if (ullOperand <= LONGLONG_MAX) - { - *pllResult = (LONGLONG)ullOperand; - status = STATUS_SUCCESS; - } - else - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONGLONG -> RtlINT64 conversion -// -#define RtlULongLongToInt64 RtlULongLongToLongLong - -// -// ULONGLONG -> LONG64 conversion -// -#define RtlULongLongToLong64 RtlULongLongToLongLong - -// -// ULONGLONG -> ptrdiff_t conversion -// -#define RtlULongLongToPtrdiffT RtlULongLongToIntPtr - -// -// ULONGLONG -> size_t conversion -// -#define RtlULongLongToSizeT RtlULongLongToUIntPtr - -// -// ULONGLONG -> SSIZE_T conversion -// -#define RtlULongLongToSSIZET RtlULongLongToLongPtr - -// -// ULONGLONG -> SIZE_T conversion -// -#define RtlULongLongToSIZET RtlULongLongToULongPtr - -// -// DWORDLONG -> CHAR conversion -// -#define RtlDWordLongToChar RtlULongLongToChar - -// -// DWORDLONG -> INT8 conversion -// -#define RtlDWordLongToInt8 RtlULongLongToInt8 - -// -// DWORDLONG -> UCHAR conversion -// -#define RtlDWordLongToUChar RtlULongLongToUChar - -// -// DWORDLONG -> UINT8 conversion -// -#define RtlDWordLongToUInt8 RtlULongLongToUInt8 - -// -// DWORDLONG -> BYTE conversion -// -#define RtlDWordLongToByte RtlULongLongToUInt8 - -// -// DWORDLONG -> SHORT conversion -// -#define RtlDWordLongToShort RtlULongLongToShort - -// -// DWORDLONG -> INT16 conversion -// -#define RtlDWordLongToInt16 RtlULongLongToShort - -// -// DWORDLONG -> USHORT conversion -// -#define RtlDWordLongToUShort RtlULongLongToUShort - -// -// DWORDLONG -> UINT16 conversion -// -#define RtlDWordLongToUInt16 RtlULongLongToUShort - -// -// DWORDLONG -> WORD conversion -// -#define RtlDWordLongToWord RtlULongLongToUShort - -// -// DWORDLONG -> INT conversion -// -#define RtlDWordLongToInt RtlULongLongToInt - -// -// DWORDLONG -> INT32 conversion -// -#define RtlDWordLongToInt32 RtlULongLongToInt - -// -// DWORDLONG -> INT_PTR conversion -// -#define RtlDWordLongToIntPtr RtlULongLongToIntPtr - -// -// DWORDLONG -> UINT conversion -// -#define RtlDWordLongToUInt RtlULongLongToUInt - -// -// DWORDLONG -> UINT32 conversion -// -#define RtlDWordLongToUInt32 RtlULongLongToUInt - -// -// DWORDLONG -> UINT_PTR conversion -// -#define RtlDWordLongToUIntPtr RtlULongLongToUIntPtr - -// -// DWORDLONG -> LONG conversion -// -#define RtlDWordLongToLong RtlULongLongToLong - -// -// DWORDLONG -> LONG_PTR conversion -// -#define RtlDWordLongToLongPtr RtlULongLongToLongPtr - -// -// DWORDLONG -> ULONG conversion -// -#define RtlDWordLongToULong RtlULongLongToULong - -// -// DWORDLONG -> ULONG_PTR conversion -// -#define RtlDWordLongToULongPtr RtlULongLongToULongPtr - -// -// DWORDLONG -> DWORD conversion -// -#define RtlDWordLongToDWord RtlULongLongToULong - -// -// DWORDLONG -> DWORD_PTR conversion -// -#define RtlDWordLongToDWordPtr RtlULongLongToULongPtr - -// -// DWORDLONG -> LONGLONG conversion -// -#define RtlDWordLongToLongLong RtlULongLongToLongLong - -// -// DWORDLONG -> LONG64 conversion -// -#define RtlDWordLongToLong64 RtlULongLongToLongLong - -// -// DWORDLONG -> RtlINT64 conversion -// -#define RtlDWordLongToInt64 RtlULongLongToLongLong - -// -// DWORDLONG -> ptrdiff_t conversion -// -#define RtlDWordLongToPtrdiffT RtlULongLongToIntPtr - -// -// DWORDLONG -> size_t conversion -// -#define RtlDWordLongToSizeT RtlULongLongToUIntPtr - -// -// DWORDLONG -> SSIZE_T conversion -// -#define RtlDWordLongToSSIZET RtlULongLongToLongPtr - -// -// DWORDLONG -> SIZE_T conversion -// -#define RtlDWordLongToSIZET RtlULongLongToULongPtr - -// -// ULONG64 -> CHAR conversion -// -#define RtlULong64ToChar RtlULongLongToChar - -// -// ULONG64 -> INT8 conversion -// -#define RtlULong64ToInt8 RtlULongLongToInt8 - -// -// ULONG64 -> UCHAR conversion -// -#define RtlULong64ToUChar RtlULongLongToUChar - -// -// ULONG64 -> UINT8 conversion -// -#define RtlULong64ToUInt8 RtlULongLongToUInt8 - -// -// ULONG64 -> BYTE conversion -// -#define RtlULong64ToByte RtlULongLongToUInt8 - -// -// ULONG64 -> SHORT conversion -// -#define RtlULong64ToShort RtlULongLongToShort - -// -// ULONG64 -> INT16 conversion -// -#define RtlULong64ToInt16 RtlULongLongToShort - -// -// ULONG64 -> USHORT conversion -// -#define RtlULong64ToUShort RtlULongLongToUShort - -// -// ULONG64 -> UINT16 conversion -// -#define RtlULong64ToUInt16 RtlULongLongToUShort - -// -// ULONG64 -> WORD conversion -// -#define RtlULong64ToWord RtlULongLongToUShort - -// -// ULONG64 -> INT conversion -// -#define RtlULong64ToInt RtlULongLongToInt - -// -// ULONG64 -> INT32 conversion -// -#define RtlULong64ToInt32 RtlULongLongToInt - -// -// ULONG64 -> INT_PTR conversion -// -#define RtlULong64ToIntPtr RtlULongLongToIntPtr - -// -// ULONG64 -> UINT conversion -// -#define RtlULong64ToUInt RtlULongLongToUInt - -// -// ULONG64 -> UINT32 conversion -// -#define RtlULong64ToUInt32 RtlULongLongToUInt - -// -// ULONG64 -> UINT_PTR conversion -// -#define RtlULong64ToUIntPtr RtlULongLongToUIntPtr - -// -// ULONG64 -> LONG conversion -// -#define RtlULong64ToLong RtlULongLongToLong - -// -// ULONG64 -> LONG_PTR conversion -// -#define RtlULong64ToLongPtr RtlULongLongToLongPtr - -// -// ULONG64 -> ULONG conversion -// -#define RtlULong64ToULong RtlULongLongToULong - -// -// ULONG64 -> ULONG_PTR conversion -// -#define RtlULong64ToULongPtr RtlULongLongToULongPtr - -// -// ULONG64 -> DWORD conversion -// -#define RtlULong64ToDWord RtlULongLongToULong - -// -// ULONG64 -> DWORD_PTR conversion -// -#define RtlULong64ToDWordPtr RtlULongLongToULongPtr - -// -// ULONG64 -> LONGLONG conversion -// -#define RtlULong64ToLongLong RtlULongLongToLongLong - -// -// ULONG64 -> LONG64 conversion -// -#define RtlULong64ToLong64 RtlULongLongToLongLong - -// -// ULONG64 -> RtlINT64 conversion -// -#define RtlULong64ToInt64 RtlULongLongToLongLong - -// -// ULONG64 -> ptrdiff_t conversion -// -#define RtlULong64ToPtrdiffT RtlULongLongToIntPtr - -// -// ULONG64 -> size_t conversion -// -#define RtlULong64ToSizeT RtlULongLongToUIntPtr - -// -// ULONG64 -> SSIZE_T conversion -// -#define RtlULong64ToSSIZET RtlULongLongToLongPtr - -// -// ULONG64 -> SIZE_T conversion -// -#define RtlULong64ToSIZET RtlULongLongToULongPtr - -// -// DWORD64 -> CHAR conversion -// -#define RtlDWord64ToChar RtlULongLongToChar - -// -// DWORD64 -> INT8 conversion -// -#define RtlDWord64ToInt8 RtlULongLongToInt8 - -// -// DWORD64 -> UCHAR conversion -// -#define RtlDWord64ToUChar RtlULongLongToUChar - -// -// DWORD64 -> UINT8 conversion -// -#define RtlDWord64ToUInt8 RtlULongLongToUInt8 - -// -// DWORD64 -> BYTE conversion -// -#define RtlDWord64ToByte RtlULongLongToUInt8 - -// -// DWORD64 -> SHORT conversion -// -#define RtlDWord64ToShort RtlULongLongToShort - -// -// DWORD64 -> INT16 conversion -// -#define RtlDWord64ToInt16 RtlULongLongToShort - -// -// DWORD64 -> USHORT conversion -// -#define RtlDWord64ToUShort RtlULongLongToUShort - -// -// DWORD64 -> UINT16 conversion -// -#define RtlDWord64ToUInt16 RtlULongLongToUShort - -// -// DWORD64 -> WORD conversion -// -#define RtlDWord64ToWord RtlULongLongToUShort - -// -// DWORD64 -> INT conversion -// -#define RtlDWord64ToInt RtlULongLongToInt - -// -// DWORD64 -> INT32 conversion -// -#define RtlDWord64ToInt32 RtlULongLongToInt - -// -// DWORD64 -> INT_PTR conversion -// -#define RtlDWord64ToIntPtr RtlULongLongToIntPtr - -// -// DWORD64 -> UINT conversion -// -#define RtlDWord64ToUInt RtlULongLongToUInt - -// -// DWORD64 -> UINT32 conversion -// -#define RtlDWord64ToUInt32 RtlULongLongToUInt - -// -// DWORD64 -> UINT_PTR conversion -// -#define RtlDWord64ToUIntPtr RtlULongLongToUIntPtr - -// -// DWORD64 -> LONG conversion -// -#define RtlDWord64ToLong RtlULongLongToLong - -// -// DWORD64 -> LONG_PTR conversion -// -#define RtlDWord64ToLongPtr RtlULongLongToLongPtr - -// -// DWORD64 -> ULONG conversion -// -#define RtlDWord64ToULong RtlULongLongToULong - -// -// DWORD64 -> ULONG_PTR conversion -// -#define RtlDWord64ToULongPtr RtlULongLongToULongPtr - -// -// DWORD64 -> DWORD conversion -// -#define RtlDWord64ToDWord RtlULongLongToULong - -// -// DWORD64 -> DWORD_PTR conversion -// -#define RtlDWord64ToDWordPtr RtlULongLongToULongPtr - -// -// DWORD64 -> LONGLONG conversion -// -#define RtlDWord64ToLongLong RtlULongLongToLongLong - -// -// DWORD64 -> LONG64 conversion -// -#define RtlDWord64ToLong64 RtlULongLongToLongLong - -// -// DWORD64 -> RtlINT64 conversion -// -#define RtlDWord64ToInt64 RtlULongLongToLongLong - -// -// DWORD64 -> ptrdiff_t conversion -// -#define RtlDWord64ToPtrdiffT RtlULongLongToIntPtr - -// -// DWORD64 -> size_t conversion -// -#define RtlDWord64ToSizeT RtlULongLongToUIntPtr - -// -// DWORD64 -> SSIZE_T conversion -// -#define RtlDWord64ToSSIZET RtlULongLongToLongPtr - -// -// DWORD64 -> SIZE_T conversion -// -#define RtlDWord64ToSIZET RtlULongLongToULongPtr - -// -// UINT64 -> CHAR conversion -// -#define RtlUInt64ToChar RtlULongLongToChar - -// -// UINT64 -> INT8 conversion -// -#define RtlUInt64ToInt8 RtlULongLongToInt8 - -// -// UINT64 -> UCHAR conversion -// -#define RtlUInt64ToUChar RtlULongLongToUChar - -// -// UINT64 -> UINT8 conversion -// -#define RtlUInt64ToUInt8 RtlULongLongToUInt8 - -// -// UINT64 -> BYTE conversion -// -#define RtlUInt64ToByte RtlULongLongToUInt8 - -// -// UINT64 -> SHORT conversion -// -#define RtlUInt64ToShort RtlULongLongToShort - -// -// UINT64 -> INT16 conversion -// -// -#define RtlUInt64ToInt16 RtlULongLongToShort - -// -// UINT64 -> USHORT conversion -// -#define RtlUInt64ToUShort RtlULongLongToUShort - -// -// UINT64 -> UINT16 conversion -// -#define RtlUInt64ToUInt16 RtlULongLongToUShort - -// -// UINT64 -> WORD conversion -// -#define RtlUInt64ToWord RtlULongLongToUShort - -// -// UINT64 -> INT conversion -// -#define RtlUInt64ToInt RtlULongLongToInt - -// -// UINT64 -> INT32 conversion -// -#define RtlUInt64ToInt32 RtlULongLongToInt - -// -// UINT64 -> INT_PTR conversion -// -#define RtlUInt64ToIntPtr RtlULongLongToIntPtr - -// -// UINT64 -> UINT conversion -// -#define RtlUInt64ToUInt RtlULongLongToUInt - -// -// UINT64 -> UINT32 conversion -// -#define RtlUInt64ToUInt32 RtlULongLongToUInt - -// -// UINT64 -> UINT_PTR conversion -// -#define RtlUInt64ToUIntPtr RtlULongLongToUIntPtr - -// -// UINT64 -> LONG conversion -// -#define RtlUInt64ToLong RtlULongLongToLong - -// -// UINT64 -> LONG_PTR conversion -// -#define RtlUInt64ToLongPtr RtlULongLongToLongPtr - -// -// UINT64 -> ULONG conversion -// -#define RtlUInt64ToULong RtlULongLongToULong - -// -// UINT64 -> ULONG_PTR conversion -// -#define RtlUInt64ToULongPtr RtlULongLongToULongPtr - -// -// UINT64 -> DWORD conversion -// -#define RtlUInt64ToDWord RtlULongLongToULong - -// -// UINT64 -> DWORD_PTR conversion -// -#define RtlUInt64ToDWordPtr RtlULongLongToULongPtr - -// -// UINT64 -> LONGLONG conversion -// -#define RtlUInt64ToLongLong RtlULongLongToLongLong - -// -// UINT64 -> LONG64 conversion -// -#define RtlUInt64ToLong64 RtlULongLongToLongLong - -// -// UINT64 -> RtlINT64 conversion -// -#define RtlUInt64ToInt64 RtlULongLongToLongLong - -// -// UINT64 -> ptrdiff_t conversion -// -#define RtlUInt64ToPtrdiffT RtlULongLongToIntPtr - -// -// UINT64 -> size_t conversion -// -#define RtlUInt64ToSizeT RtlULongLongToUIntPtr - -// -// UINT64 -> SSIZE_T conversion -// -#define RtlUInt64ToSSIZET RtlULongLongToLongPtr - -// -// UINT64 -> SIZE_T conversion -// -#define RtlUInt64ToSIZET RtlULongLongToULongPtr - -// -// ptrdiff_t -> CHAR conversion -// -#define RtlPtrdiffTToChar RtlIntPtrToChar - -// -// ptrdiff_t -> INT8 conversion -// -#define RtlPtrdiffTToInt8 RtlIntPtrToInt8 - -// -// ptrdiff_t -> UCHAR conversion -// -#define RtlPtrdiffTToUChar RtlIntPtrToUChar - -// -// ptrdiff_t -> UINT8 conversion -// -#define RtlPtrdiffTToUInt8 RtlIntPtrToUInt8 - -// -// ptrdiff_t -> BYTE conversion -// -#define RtlPtrdiffTToByte RtlIntPtrToUInt8 - -// -// ptrdiff_t -> SHORT conversion -// -#define RtlPtrdiffTToShort RtlIntPtrToShort - -// -// ptrdiff_t -> INT16 conversion -// -#define RtlPtrdiffTToInt16 RtlIntPtrToShort - -// -// ptrdiff_t -> USHORT conversion -// -#define RtlPtrdiffTToUShort RtlIntPtrToUShort - -// -// ptrdiff_t -> UINT16 conversion -// -#define RtlPtrdiffTToUInt16 RtlIntPtrToUShort - -// -// ptrdiff_t -> WORD conversion -// -#define RtlPtrdiffTToWord RtlIntPtrToUShort - -// -// ptrdiff_t -> INT conversion -// -#define RtlPtrdiffTToInt RtlIntPtrToInt - -// -// ptrdiff_t -> INT32 conversion -// -#define RtlPtrdiffTToInt32 RtlIntPtrToInt - -// -// ptrdiff_t -> UINT conversion -// -#define RtlPtrdiffTToUInt RtlIntPtrToUInt - -// -// ptrdiff_t -> UINT32 conversion -// -#define RtlPtrdiffTToUInt32 RtlIntPtrToUInt - -// -// ptrdiff_t -> UINT_PTR conversion -// -#define RtlPtrdiffTToUIntPtr RtlIntPtrToUIntPtr - -// -// ptrdiff_t -> LONG conversion -// -#define RtlPtrdiffTToLong RtlIntPtrToLong - -// -// ptrdiff_t -> LONG_PTR conversion -// -#define RtlPtrdiffTToLongPtr RtlIntPtrToLongPtr - -// -// ptrdiff_t -> ULONG conversion -// -#define RtlPtrdiffTToULong RtlIntPtrToULong - -// -// ptrdiff_t -> ULONG_PTR conversion -// -#define RtlPtrdiffTToULongPtr RtlIntPtrToULongPtr - -// -// ptrdiff_t -> DWORD conversion -// -#define RtlPtrdiffTToDWord RtlIntPtrToULong - -// -// ptrdiff_t -> DWORD_PTR conversion -// -#define RtlPtrdiffTToDWordPtr RtlIntPtrToULongPtr - -// -// ptrdiff_t -> ULONGLONG conversion -// -#define RtlPtrdiffTToULongLong RtlIntPtrToULongLong - -// -// ptrdiff_t -> DWORDLONG conversion -// -#define RtlPtrdiffTToDWordLong RtlIntPtrToULongLong - -// -// ptrdiff_t -> ULONG64 conversion -// -#define RtlPtrdiffTToULong64 RtlIntPtrToULongLong - -// -// ptrdiff_t -> DWORD64 conversion -// -#define RtlPtrdiffTToDWord64 RtlIntPtrToULongLong - -// -// ptrdiff_t -> UINT64 conversion -// -#define RtlPtrdiffTToUInt64 RtlIntPtrToULongLong - -// -// ptrdiff_t -> size_t conversion -// -#define RtlPtrdiffTToSizeT RtlIntPtrToUIntPtr - -// -// ptrdiff_t -> SIZE_T conversion -// -#define RtlPtrdiffTToSIZET RtlIntPtrToULongPtr - -// -// size_t -> INT8 conversion -// -#define RtlSizeTToInt8 RtlUIntPtrToInt8 - -// -// size_t -> UCHAR conversion -// -#define RtlSizeTToUChar RtlUIntPtrToUChar - -// -// size_t -> CHAR conversion -// -#define RtlSizeTToChar RtlUIntPtrToChar - -// -// size_t -> UINT8 conversion -// -#define RtlSizeTToUInt8 RtlUIntPtrToUInt8 - -// -// size_t -> BYTE conversion -// -#define RtlSizeTToByte RtlUIntPtrToUInt8 - -// -// size_t -> SHORT conversion -// -#define RtlSizeTToShort RtlUIntPtrToShort - -// -// size_t -> INT16 conversion -// -#define RtlSizeTToInt16 RtlUIntPtrToShort - -// -// size_t -> USHORT conversion -// -#define RtlSizeTToUShort RtlUIntPtrToUShort - -// -// size_t -> UINT16 conversion -// -#define RtlSizeTToUInt16 RtlUIntPtrToUShort - -// -// size_t -> WORD -// -#define RtlSizeTToWord RtlUIntPtrToUShort - -// -// size_t -> INT conversion -// -#define RtlSizeTToInt RtlUIntPtrToInt - -// -// size_t -> INT32 conversion -// -#define RtlSizeTToInt32 RtlUIntPtrToInt - -// -// size_t -> INT_PTR conversion -// -#define RtlSizeTToIntPtr RtlUIntPtrToIntPtr - -// -// size_t -> UINT conversion -// -#define RtlSizeTToUInt RtlUIntPtrToUInt - -// -// size_t -> UINT32 conversion -// -#define RtlSizeTToUInt32 RtlUIntPtrToUInt - -// -// size_t -> LONG conversion -// -#define RtlSizeTToLong RtlUIntPtrToLong - -// -// size_t -> LONG_PTR conversion -// -#define RtlSizeTToLongPtr RtlUIntPtrToLongPtr - -// -// size_t -> ULONG conversion -// -#define RtlSizeTToULong RtlUIntPtrToULong - -// -// size_t -> DWORD conversion -// -#define RtlSizeTToDWord RtlUIntPtrToULong - -// -// size_t -> LONGLONG conversion -// -#define RtlSizeTToLongLong RtlUIntPtrToLongLong - -// -// size_t -> LONG64 conversion -// -#define RtlSizeTToLong64 RtlUIntPtrToLongLong - -// -// size_t -> RtlINT64 -// -#define RtlSizeTToInt64 RtlUIntPtrToLongLong - -// -// size_t -> ptrdiff_t conversion -// -#define RtlSizeTToPtrdiffT RtlUIntPtrToIntPtr - -// -// size_t -> SSIZE_T conversion -// -#define RtlSizeTToSSIZET RtlUIntPtrToLongPtr - -// -// SSIZE_T -> INT8 conversion -// -#define RtlSSIZETToInt8 RtlLongPtrToInt8 - -// -// SSIZE_T -> UCHAR conversion -// -#define RtlSSIZETToUChar RtlLongPtrToUChar - -// -// SSIZE_T -> CHAR conversion -// -#define RtlSSIZETToChar RtlLongPtrToChar - -// -// SSIZE_T -> UINT8 conversion -// -#define RtlSSIZETToUInt8 RtlLongPtrToUInt8 - -// -// SSIZE_T -> BYTE conversion -// -#define RtlSSIZETToByte RtlLongPtrToUInt8 - -// -// SSIZE_T -> SHORT conversion -// -#define RtlSSIZETToShort RtlLongPtrToShort - -// -// SSIZE_T -> INT16 conversion -// -#define RtlSSIZETToInt16 RtlLongPtrToShort - -// -// SSIZE_T -> USHORT conversion -// -#define RtlSSIZETToUShort RtlLongPtrToUShort - -// -// SSIZE_T -> UINT16 conversion -// -#define RtlSSIZETToUInt16 RtlLongPtrToUShort - -// -// SSIZE_T -> WORD conversion -// -#define RtlSSIZETToWord RtlLongPtrToUShort - -// -// SSIZE_T -> INT conversion -// -#define RtlSSIZETToInt RtlLongPtrToInt - -// -// SSIZE_T -> INT32 conversion -// -#define RtlSSIZETToInt32 RtlLongPtrToInt - -// -// SSIZE_T -> INT_PTR conversion -// -#define RtlSSIZETToIntPtr RtlLongPtrToIntPtr - -// -// SSIZE_T -> UINT conversion -// -#define RtlSSIZETToUInt RtlLongPtrToUInt - -// -// SSIZE_T -> UINT32 conversion -// -#define RtlSSIZETToUInt32 RtlLongPtrToUInt - -// -// SSIZE_T -> UINT_PTR conversion -// -#define RtlSSIZETToUIntPtr RtlLongPtrToUIntPtr - -// -// SSIZE_T -> LONG conversion -// -#define RtlSSIZETToLong RtlLongPtrToLong - -// -// SSIZE_T -> ULONG conversion -// -#define RtlSSIZETToULong RtlLongPtrToULong - -// -// SSIZE_T -> ULONG_PTR conversion -// -#define RtlSSIZETToULongPtr RtlLongPtrToULongPtr - -// -// SSIZE_T -> DWORD conversion -// -#define RtlSSIZETToDWord RtlLongPtrToULong - -// -// SSIZE_T -> DWORD_PTR conversion -// -#define RtlSSIZETToDWordPtr RtlLongPtrToULongPtr - -// -// SSIZE_T -> ULONGLONG conversion -// -#define RtlSSIZETToULongLong RtlLongPtrToULongLong - -// -// SSIZE_T -> DWORDLONG conversion -// -#define RtlSSIZETToDWordLong RtlLongPtrToULongLong - -// -// SSIZE_T -> ULONG64 conversion -// -#define RtlSSIZETToULong64 RtlLongPtrToULongLong - -// -// SSIZE_T -> DWORD64 conversion -// -#define RtlSSIZETToDWord64 RtlLongPtrToULongLong - -// -// SSIZE_T -> UINT64 conversion -// -#define RtlSSIZETToUInt64 RtlLongPtrToULongLong - -// -// SSIZE_T -> size_t conversion -// -#define RtlSSIZETToSizeT RtlLongPtrToUIntPtr - -// -// SSIZE_T -> SIZE_T conversion -// -#define RtlSSIZETToSIZET RtlLongPtrToULongPtr - -// -// SIZE_T -> INT8 conversion -// -#define RtlSIZETToInt8 RtlULongPtrToInt8 - -// -// SIZE_T -> UCHAR conversion -// -#define RtlSIZETToUChar RtlULongPtrToUChar - -// -// SIZE_T -> CHAR conversion -// -#define RtlSIZETToChar RtlULongPtrToChar - -// -// SIZE_T -> UINT8 conversion -// -#define RtlSIZETToUInt8 RtlULongPtrToUInt8 - -// -// SIZE_T -> BYTE conversion -// -#define RtlSIZETToByte RtlULongPtrToUInt8 - -// -// SIZE_T -> SHORT conversion -// -#define RtlSIZETToShort RtlULongPtrToShort - -// -// SIZE_T -> INT16 conversion -// -#define RtlSIZETToInt16 RtlULongPtrToShort - -// -// SIZE_T -> USHORT conversion -// -#define RtlSIZETToUShort RtlULongPtrToUShort - -// -// SIZE_T -> UINT16 conversion -// -#define RtlSIZETToUInt16 RtlULongPtrToUShort - -// -// SIZE_T -> WORD -// -#define RtlSIZETToWord RtlULongPtrToUShort - -// -// SIZE_T -> INT conversion -// -#define RtlSIZETToInt RtlULongPtrToInt - -// -// SIZE_T -> INT32 conversion -// -#define RtlSIZETToInt32 RtlULongPtrToInt - -// -// SIZE_T -> INT_PTR conversion -// -#define RtlSIZETToIntPtr RtlULongPtrToIntPtr - -// -// SIZE_T -> UINT conversion -// -#define RtlSIZETToUInt RtlULongPtrToUInt - -// -// SIZE_T -> UINT32 conversion -// -#define RtlSIZETToUInt32 RtlULongPtrToUInt - -// -// SIZE_T -> UINT_PTR conversion -// -#define RtlSIZETToUIntPtr RtlULongPtrToUIntPtr - -// -// SIZE_T -> LONG conversion -// -#define RtlSIZETToLong RtlULongPtrToLong - -// -// SIZE_T -> LONG_PTR conversion -// -#define RtlSIZETToLongPtr RtlULongPtrToLongPtr - -// -// SIZE_T -> ULONG conversion -// -#define RtlSIZETToULong RtlULongPtrToULong - -// -// SIZE_T -> DWORD conversion -// -#define RtlSIZETToDWord RtlULongPtrToULong - -// -// SIZE_T -> LONGLONG conversion -// -#define RtlSIZETToLongLong RtlULongPtrToLongLong - -// -// SIZE_T -> LONG64 conversion -// -#define RtlSIZETToLong64 RtlULongPtrToLongLong - -// -// SIZE_T -> RtlINT64 -// -#define RtlSIZETToInt64 RtlULongPtrToLongLong - -// -// SIZE_T -> ptrdiff_t conversion -// -#define RtlSIZETToPtrdiffT RtlULongPtrToIntPtr - -// -// SIZE_T -> SSIZE_T conversion -// -#define RtlSIZETToSSIZET RtlULongPtrToLongPtr - - -//============================================================================= -// Addition functions -//============================================================================= - -// -// UINT8 addition -// -__checkReturn -__inline -NTSTATUS -RtlUInt8Add( - __in UINT8 u8Augend, - __in UINT8 u8Addend, - __out __deref_out_range(==, u8Augend + u8Addend) UINT8* pu8Result) -{ - NTSTATUS status; - - if (((UINT8)(u8Augend + u8Addend)) >= u8Augend) - { - *pu8Result = (UINT8)(u8Augend + u8Addend); - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT addition -// -__checkReturn -__inline -NTSTATUS -RtlUShortAdd( - __in USHORT usAugend, - __in USHORT usAddend, - __out __deref_out_range(==, usAugend + usAddend) USHORT* pusResult) -{ - NTSTATUS status; - - if (((USHORT)(usAugend + usAddend)) >= usAugend) - { - *pusResult = (USHORT)(usAugend + usAddend); - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT16 addition -// -#define RtlUInt16Add RtlUShortAdd - -// -// WORD addtition -// -#define RtlWordAdd RtlUShortAdd - -// -// UINT addition -// -__checkReturn -__inline -NTSTATUS -RtlUIntAdd( - __in UINT uAugend, - __in UINT uAddend, - __out __deref_out_range(==, uAugend + uAddend) UINT* puResult) -{ - NTSTATUS status; - - if ((uAugend + uAddend) >= uAugend) - { - *puResult = (uAugend + uAddend); - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT32 addition -// -#define RtlUInt32Add RtlUIntAdd - -// -// UINT_PTR addition -// -#ifdef _WIN64 -#define RtlUIntPtrAdd RtlULongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrAdd( - __in UINT_PTR uAugend, - __in UINT_PTR uAddend, - __out __deref_out_range(==, uAugend + uAddend) UINT_PTR* puResult) -{ - NTSTATUS status; - - if ((uAugend + uAddend) >= uAugend) - { - *puResult = (uAugend + uAddend); - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// ULONG addition -// -__checkReturn -__inline -NTSTATUS -RtlULongAdd( - __in ULONG ulAugend, - __in ULONG ulAddend, - __out __deref_out_range(==, ulAugend + ulAddend) ULONG* pulResult) -{ - NTSTATUS status; - - if ((ulAugend + ulAddend) >= ulAugend) - { - *pulResult = (ulAugend + ulAddend); - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR addition -// -#ifdef _WIN64 -#define RtlULongPtrAdd RtlULongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrAdd( - __in ULONG_PTR ulAugend, - __in ULONG_PTR ulAddend, - __out __deref_out_range(==, ulAugend + ulAddend) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if ((ulAugend + ulAddend) >= ulAugend) - { - *pulResult = (ulAugend + ulAddend); - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// DWORD addition -// -#define RtlDWordAdd RtlULongAdd - -// -// DWORD_PTR addition -// -#ifdef _WIN64 -#define RtlDWordPtrAdd RtlULongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlDWordPtrAdd( - __in DWORD_PTR dwAugend, - __in DWORD_PTR dwAddend, - __out __deref_out_range(==, dwAugend + dwAddend) DWORD_PTR* pdwResult) -{ - NTSTATUS status; - - if ((dwAugend + dwAddend) >= dwAugend) - { - *pdwResult = (dwAugend + dwAddend); - status = STATUS_SUCCESS; - } - else - { - *pdwResult = DWORD_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// size_t addition -// -__checkReturn -__inline -NTSTATUS -RtlSizeTAdd( - __in size_t Augend, - __in size_t Addend, - __out __deref_out_range(==, Augend + Addend) size_t* pResult) -{ - NTSTATUS status; - - if ((Augend + Addend) >= Augend) - { - *pResult = (Augend + Addend); - status = STATUS_SUCCESS; - } - else - { - *pResult = SIZE_T_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SIZE_T addition -// -#ifdef _WIN64 -#define RtlSIZETAdd RtlULongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlSIZETAdd( - __in SIZE_T Augend, - __in SIZE_T Addend, - __out __deref_out_range(==, Augend + Addend) SIZE_T* pResult) -{ - NTSTATUS status; - - if ((Augend + Addend) >= Augend) - { - *pResult = (Augend + Addend); - status = STATUS_SUCCESS; - } - else - { - *pResult = _SIZE_T_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// ULONGLONG addition -// -__checkReturn -__inline -NTSTATUS -RtlULongLongAdd( - __in ULONGLONG ullAugend, - __in ULONGLONG ullAddend, - __out __deref_out_range(==, ullAugend + ullAddend) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if ((ullAugend + ullAddend) >= ullAugend) - { - *pullResult = (ullAugend + ullAddend); - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// DWORDLONG addition -// -#define RtlDWordLongAdd RtlULongLongAdd - -// -// ULONG64 addition -// -#define RtlULong64Add RtlULongLongAdd - -// -// DWORD64 addition -// -#define RtlDWord64Add RtlULongLongAdd - -// -// UINT64 addition -// -#define RtlUInt64Add RtlULongLongAdd - - -//============================================================================= -// Subtraction functions -//============================================================================= - -// -// UINT8 subtraction -// -__checkReturn -__inline -NTSTATUS -RtlUInt8Sub( - __in UINT8 u8Minuend, - __in UINT8 u8Subtrahend, - __out __deref_out_range(==, u8Minuend - u8Subtrahend) UINT8* pu8Result) -{ - NTSTATUS status; - - if (u8Minuend >= u8Subtrahend) - { - *pu8Result = (UINT8)(u8Minuend - u8Subtrahend); - status = STATUS_SUCCESS; - } - else - { - *pu8Result = UINT8_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// USHORT subtraction -// -__checkReturn -__inline -NTSTATUS -RtlUShortSub( - __in USHORT usMinuend, - __in USHORT usSubtrahend, - __out __deref_out_range(==, usMinuend - usSubtrahend) USHORT* pusResult) -{ - NTSTATUS status; - - if (usMinuend >= usSubtrahend) - { - *pusResult = (USHORT)(usMinuend - usSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *pusResult = USHORT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT16 subtraction -// -#define RtlUInt16Sub RtlUShortSub - -// -// WORD subtraction -// -#define RtlWordSub RtlUShortSub - - -// -// UINT subtraction -// -__checkReturn -__inline -NTSTATUS -RtlUIntSub( - __in UINT uMinuend, - __in UINT uSubtrahend, - __out __deref_out_range(==, uMinuend - uSubtrahend) UINT* puResult) -{ - NTSTATUS status; - - if (uMinuend >= uSubtrahend) - { - *puResult = (uMinuend - uSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// UINT32 subtraction -// -#define RtlUInt32Sub RtlUIntSub - -// -// UINT_PTR subtraction -// -#ifdef _WIN64 -#define RtlUIntPtrSub RtlULongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrSub( - __in UINT_PTR uMinuend, - __in UINT_PTR uSubtrahend, - __out __deref_out_range(==, uMinuend - uSubtrahend) UINT_PTR* puResult) -{ - NTSTATUS status; - - if (uMinuend >= uSubtrahend) - { - *puResult = (uMinuend - uSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *puResult = UINT_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// ULONG subtraction -// -__checkReturn -__inline -NTSTATUS -RtlULongSub( - __in ULONG ulMinuend, - __in ULONG ulSubtrahend, - __out __deref_out_range(==, ulMinuend - ulSubtrahend) ULONG* pulResult) -{ - NTSTATUS status; - - if (ulMinuend >= ulSubtrahend) - { - *pulResult = (ulMinuend - ulSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// ULONG_PTR subtraction -// -#ifdef _WIN64 -#define RtlULongPtrSub RtlULongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrSub( - __in ULONG_PTR ulMinuend, - __in ULONG_PTR ulSubtrahend, - __out __deref_out_range(==, ulMinuend - ulSubtrahend) ULONG_PTR* pulResult) -{ - NTSTATUS status; - - if (ulMinuend >= ulSubtrahend) - { - *pulResult = (ulMinuend - ulSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *pulResult = ULONG_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - - -// -// DWORD subtraction -// -#define RtlDWordSub RtlULongSub - -// -// DWORD_PTR subtraction -// -#ifdef _WIN64 -#define RtlDWordPtrSub RtlULongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlDWordPtrSub( - __in DWORD_PTR dwMinuend, - __in DWORD_PTR dwSubtrahend, - __out __deref_out_range(==, dwMinuend - dwSubtrahend) DWORD_PTR* pdwResult) -{ - NTSTATUS status; - - if (dwMinuend >= dwSubtrahend) - { - *pdwResult = (dwMinuend - dwSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *pdwResult = DWORD_PTR_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// size_t subtraction -// -__checkReturn -__inline -NTSTATUS -RtlSizeTSub( - __in size_t Minuend, - __in size_t Subtrahend, - __out __deref_out_range(==, Minuend - Subtrahend) size_t* pResult) -{ - NTSTATUS status; - - if (Minuend >= Subtrahend) - { - *pResult = (Minuend - Subtrahend); - status = STATUS_SUCCESS; - } - else - { - *pResult = SIZE_T_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// SIZE_T subtraction -// -#ifdef _WIN64 -#define RtlSIZETSub RtlULongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlSIZETSub( - __in SIZE_T Minuend, - __in SIZE_T Subtrahend, - __out __deref_out_range(==, Minuend - Subtrahend) SIZE_T* pResult) -{ - NTSTATUS status; - - if (Minuend >= Subtrahend) - { - *pResult = (Minuend - Subtrahend); - status = STATUS_SUCCESS; - } - else - { - *pResult = _SIZE_T_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} -#endif // _WIN64 - -// -// ULONGLONG subtraction -// -__checkReturn -__inline -NTSTATUS -RtlULongLongSub( - __in ULONGLONG ullMinuend, - __in ULONGLONG ullSubtrahend, - __out __deref_out_range(==, ullMinuend - ullSubtrahend) ULONGLONG* pullResult) -{ - NTSTATUS status; - - if (ullMinuend >= ullSubtrahend) - { - *pullResult = (ullMinuend - ullSubtrahend); - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - - return status; -} - -// -// DWORDLONG subtraction -// -#define RtlDWordLongSub RtlULongLongSub - -// -// ULONG64 subtraction -// -#define RtlULong64Sub RtlULongLongSub - -// -// DWORD64 subtraction -// -#define RtlDWord64Sub RtlULongLongSub - -// -// UINT64 subtraction -// -#define RtlUInt64Sub RtlULongLongSub - - -//============================================================================= -// Multiplication functions -//============================================================================= - -// -// UINT8 multiplication -// -__checkReturn -__inline -NTSTATUS -RtlUInt8Mult( - __in UINT8 u8Multiplicand, - __in UINT8 u8Multiplier, - __out __deref_out_range(==, u8Multiplicand * u8Multiplier) UINT8* pu8Result) -{ - UINT uResult = ((UINT)u8Multiplicand) * ((UINT)u8Multiplier); - - return RtlUIntToUInt8(uResult, pu8Result); -} - -// -// USHORT multiplication -// -__checkReturn -__inline -NTSTATUS -RtlUShortMult( - __in USHORT usMultiplicand, - __in USHORT usMultiplier, - __out __deref_out_range(==, usMultiplicand * usMultiplier) USHORT* pusResult) -{ - ULONG ulResult = ((ULONG)usMultiplicand) * ((ULONG)usMultiplier); - - return RtlULongToUShort(ulResult, pusResult); -} - -// -// UINT16 multiplication -// -#define RtlUInt16Mult RtlUShortMult - -// -// WORD multiplication -// -#define RtlWordMult RtlUShortMult - -// -// UINT multiplication -// -__checkReturn -__inline -NTSTATUS -RtlUIntMult( - __in UINT uMultiplicand, - __in UINT uMultiplier, - __out __deref_out_range(==, uMultiplicand * uMultiplier) UINT* puResult) -{ - ULONGLONG ull64Result = UInt32x32To64(uMultiplicand, uMultiplier); - - return RtlULongLongToUInt(ull64Result, puResult); -} - -// -// UINT32 multiplication -// -#define RtlUInt32Mult RtlUIntMult - -// -// UINT_PTR multiplication -// -#ifdef _WIN64 -#define RtlUIntPtrMult RtlULongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlUIntPtrMult( - __in UINT_PTR uMultiplicand, - __in UINT_PTR uMultiplier, - __out __deref_out_range(==, uMultiplicand * uMultiplier) UINT_PTR* puResult) -{ - ULONGLONG ull64Result = UInt32x32To64(uMultiplicand, uMultiplier); - - return RtlULongLongToUIntPtr(ull64Result, puResult); -} -#endif // _WIN64 - -// -// ULONG multiplication -// -__checkReturn -__inline -NTSTATUS -RtlULongMult( - __in ULONG ulMultiplicand, - __in ULONG ulMultiplier, - __out __deref_out_range(==, ulMultiplicand * ulMultiplier) ULONG* pulResult) -{ - ULONGLONG ull64Result = UInt32x32To64(ulMultiplicand, ulMultiplier); - - return RtlULongLongToULong(ull64Result, pulResult); -} - -// -// ULONG_PTR multiplication -// -#ifdef _WIN64 -#define RtlULongPtrMult RtlULongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlULongPtrMult( - __in ULONG_PTR ulMultiplicand, - __in ULONG_PTR ulMultiplier, - __out __deref_out_range(==, ulMultiplicand * ulMultiplier) ULONG_PTR* pulResult) -{ - ULONGLONG ull64Result = UInt32x32To64(ulMultiplicand, ulMultiplier); - - return RtlULongLongToULongPtr(ull64Result, pulResult); -} -#endif // _WIN64 - -// -// DWORD multiplication -// -#define RtlDWordMult RtlULongMult - -// -// DWORD_PTR multiplication -// -#ifdef _WIN64 -#define RtlDWordPtrMult RtlULongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlDWordPtrMult( - __in DWORD_PTR dwMultiplicand, - __in DWORD_PTR dwMultiplier, - __out __deref_out_range(==, dwMultiplicand * dwMultiplier) DWORD_PTR* pdwResult) -{ - ULONGLONG ull64Result = UInt32x32To64(dwMultiplicand, dwMultiplier); - - return RtlULongLongToDWordPtr(ull64Result, pdwResult); -} -#endif // _WIN64 - -// -// size_t multiplication -// - -#ifdef _WIN64 -#define RtlSizeTMult RtlULongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlSizeTMult( - __in size_t Multiplicand, - __in size_t Multiplier, - __out __deref_out_range(==, Multiplicand * Multiplier) size_t* pResult) -{ - ULONGLONG ull64Result = UInt32x32To64(Multiplicand, Multiplier); - - return RtlULongLongToSizeT(ull64Result, pResult); -} -#endif // _WIN64 - -// -// SIZE_T multiplication -// -#ifdef _WIN64 -#define RtlSIZETMult RtlULongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlSIZETMult( - __in SIZE_T Multiplicand, - __in SIZE_T Multiplier, - __out __deref_out_range(==, Multiplicand * Multiplier) SIZE_T* pResult) -{ - ULONGLONG ull64Result = UInt32x32To64(Multiplicand, Multiplier); - - return RtlULongLongToSIZET(ull64Result, pResult); -} -#endif // _WIN64 - -// -// ULONGLONG multiplication -// -__checkReturn -__inline -NTSTATUS -RtlULongLongMult( - __in ULONGLONG ullMultiplicand, - __in ULONGLONG ullMultiplier, - __out __deref_out_range(==, ullMultiplicand * ullMultiplier) ULONGLONG* pullResult) -{ - NTSTATUS status; -#if defined(_USE_INTRINSIC_MULTIPLY128) - ULONGLONG ullResultHigh; - ULONGLONG ullResultLow; - - ullResultLow = UnsignedMultiply128(ullMultiplicand, ullMultiplier, &ullResultHigh); - if (ullResultHigh == 0) - { - *pullResult = ullResultLow; - status = STATUS_SUCCESS; - } - else - { - *pullResult = ULONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } -#else - // 64x64 into 128 is like 32.32 x 32.32. - // - // a.b * c.d = a*(c.d) + .b*(c.d) = a*c + a*.d + .b*c + .b*.d - // back in non-decimal notation where A=a*2^32 and C=c*2^32: - // A*C + A*d + b*C + b*d - // So there are four components to add together. - // result = (a*c*2^64) + (a*d*2^32) + (b*c*2^32) + (b*d) - // - // a * c must be 0 or there would be bits in the high 64-bits - // a * d must be less than 2^32 or there would be bits in the high 64-bits - // b * c must be less than 2^32 or there would be bits in the high 64-bits - // then there must be no overflow of the resulting values summed up. - - ULONG dw_a; - ULONG dw_b; - ULONG dw_c; - ULONG dw_d; - ULONGLONG ad = 0; - ULONGLONG bc = 0; - ULONGLONG bd = 0; - ULONGLONG ullResult = 0; - - status = STATUS_INTEGER_OVERFLOW; - - dw_a = (ULONG)(ullMultiplicand >> 32); - dw_c = (ULONG)(ullMultiplier >> 32); - - // common case -- if high dwords are both zero, no chance for overflow - if ((dw_a == 0) && (dw_c == 0)) - { - dw_b = (DWORD)ullMultiplicand; - dw_d = (DWORD)ullMultiplier; - - *pullResult = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d); - status = STATUS_SUCCESS; - } - else - { - // a * c must be 0 or there would be bits set in the high 64-bits - if ((dw_a == 0) || - (dw_c == 0)) - { - dw_d = (DWORD)ullMultiplier; - - // a * d must be less than 2^32 or there would be bits set in the high 64-bits - ad = (((ULONGLONG)dw_a) * (ULONGLONG)dw_d); - if ((ad & 0xffffffff00000000) == 0) - { - dw_b = (DWORD)ullMultiplicand; - - // b * c must be less than 2^32 or there would be bits set in the high 64-bits - bc = (((ULONGLONG)dw_b) * (ULONGLONG)dw_c); - if ((bc & 0xffffffff00000000) == 0) - { - // now sum them all up checking for overflow. - // shifting is safe because we already checked for overflow above - if (NT_SUCCESS(RtlULongLongAdd(bc << 32, ad << 32, &ullResult))) - { - // b * d - bd = (((ULONGLONG)dw_b) * (ULONGLONG)dw_d); - - if (NT_SUCCESS(RtlULongLongAdd(ullResult, bd, &ullResult))) - { - *pullResult = ullResult; - status = STATUS_SUCCESS; - } - } - } - } - } - } - - if (!NT_SUCCESS(status)) - { - *pullResult = ULONGLONG_ERROR; - } -#endif // _USE_INTRINSIC_MULTIPLY128 - - return status; -} - -// -// DWORDLONG multiplication -// -#define RtlDWordLongMult RtlULongLongMult - -// -// ULONG64 multiplication -// -#define RtlULong64Mult RtlULongLongMult - -// -// DWORD64 multiplication -// -#define RtlDWord64Mult RtlULongLongMult - -// -// UINT64 multiplication -// -#define RtlUInt64Mult RtlULongLongMult - - -///////////////////////////////////////////////////////////////////////// -// -// signed operations -// -// Strongly consider using unsigned numbers. -// -// Signed numbers are often used where unsigned numbers should be used. -// For example file sizes and array indices should always be unsigned. -// (File sizes should be 64bit integers; array indices should be size_t.) -// Subtracting a larger positive signed number from a smaller positive -// signed number with RtlIntSubwill succeed, producing a negative number, -// that then must not be used as an array index (but can occasionally be -// used as a pointer index.) Similarly for adding a larger magnitude -// negative number to a smaller magnitude positive number. -// -// intsafe.h does not protect you from such errors. It tells you if your -// integer operations overflowed, not if you are doing the right thing -// with your non-overflowed integers. -// -// Likewise you can overflow a buffer with a non-overflowed unsigned index. -// -#if defined(ENABLE_INTSAFE_SIGNED_FUNCTIONS) - -#if defined(_USE_INTRINSIC_MULTIPLY128) -#ifdef __cplusplus -extern "C" { -#endif - -#define Multiply128 _mul128 - -LONG64 -Multiply128( - __in LONG64 Multiplier, - __in LONG64 Multiplicand, - __out LONG64 *HighProduct - ); -#pragma intrinsic(_mul128) - -#ifdef __cplusplus -} -#endif -#endif // _USE_INTRINSIC_MULTIPLY128 - - -//============================================================================= -// Signed addition functions -//============================================================================= - -// -// INT8 Addition -// -__checkReturn -__inline -NTSTATUS -RtlInt8Add( - __in INT8 i8Augend, - __in INT8 i8Addend, - __out __deref_out_range(==, i8Augend + i8Addend) INT8* pi8Result - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(INT8)); - return RtlLongToInt8(((LONG)i8Augend) + ((LONG)i8Addend), pi8Result); -} - -// -// SHORT Addition -// -__checkReturn -__inline -NTSTATUS -RtlShortAdd( - __in SHORT sAugend, - __in SHORT sAddend, - __out __deref_out_range(==, sAugend + sAddend) SHORT* psResult - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(SHORT)); - return RtlLongToShort(((LONG)sAugend) + ((LONG)sAddend), psResult); -} - -// -// INT16 Addition -// -#define RtlInt16Add RtlShortAdd - -// -// INT Addition -// -__checkReturn -__inline -NTSTATUS -RtlIntAdd( - __in INT iAugend, - __in INT iAddend, - __out __deref_out_range(==, iAugend + iAddend) INT* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT)); - return RtlLongLongToInt(((LONGLONG)iAugend) + ((LONGLONG)iAddend), piResult); -} - -// -// INT32 Addition -// -#define RtlInt32Add RtlIntAdd - -// -// INT_PTR addition -// -#ifdef _WIN64 -#define RtlIntPtrAdd RtlLongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrAdd( - __in INT_PTR iAugend, - __in INT_PTR iAddend, - __out __deref_out_range(==, iAugend + iAddend) INT_PTR* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT_PTR)); - return RtlLongLongToIntPtr(((LONGLONG)iAugend) + ((LONGLONG)iAddend), piResult); -} -#endif - -// -// LONG Addition -// -__checkReturn -__inline -NTSTATUS -RtlLongAdd( - __in LONG lAugend, - __in LONG lAddend, - __out __deref_out_range(==, lAugend + lAddend) LONG* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG)); - return RtlLongLongToLong(((LONGLONG)lAugend) + ((LONGLONG)lAddend), plResult); -} - -// -// LONG32 Addition -// -#define RtlLong32Add RtlIntAdd - -// -// LONG_PTR Addition -// -#ifdef _WIN64 -#define RtlLongPtrAdd RtlLongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrAdd( - __in LONG_PTR lAugend, - __in LONG_PTR lAddend, - __out __deref_out_range(==, lAugend + lAddend) LONG_PTR* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG_PTR)); - return RtlLongLongToLongPtr(((LONGLONG)lAugend) + ((LONGLONG)lAddend), plResult); -} -#endif - -// -// LONGLONG Addition -// -__checkReturn -__inline -NTSTATUS -RtlLongLongAdd( - __in LONGLONG llAugend, - __in LONGLONG llAddend, - __out __deref_out_range(==, llAugend + llAddend) LONGLONG* pllResult - ) -{ - NTSTATUS status; - LONGLONG llResult = llAugend + llAddend; - - // - // Adding positive to negative never overflows. - // If you add two positive numbers, you expect a positive result. - // If you add two negative numbers, you expect a negative result. - // Overflow if inputs are the same sign and output is not that sign. - // - if (((llAugend < 0) == (llAddend < 0)) && - ((llAugend < 0) != (llResult < 0))) - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - else - { - *pllResult = llResult; - status = STATUS_SUCCESS; - } - - return status; -} - -// -// LONG64 Addition -// -#define RtlLong64Add RtlLongLongAdd - -// -// RtlINT64 Addition -// -#define RtlInt64Add RtlLongLongAdd - -// -// ptrdiff_t Addition -// -#ifdef _WIN64 -#define RtlPtrdiffTAdd RtlLongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlPtrdiffTAdd( - __in ptrdiff_t Augend, - __in ptrdiff_t Addend, - __out __deref_out_range(==, Augend + Addend) ptrdiff_t* pResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(ptrdiff_t)); - return RtlLongLongToPtrdiffT(((LONGLONG)Augend) + ((LONGLONG)Addend), pResult); -} -#endif - -// -// SSIZE_T Addition -// -#ifdef _WIN64 -#define RtlSSIZETAdd RtlLongLongAdd -#else -__checkReturn -__inline -NTSTATUS -RtlSSIZETAdd( - __in SSIZE_T Augend, - __in SSIZE_T Addend, - __out __deref_out_range(==, Augend + Addend) SSIZE_T* pResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(SSIZE_T)); - return RtlLongLongToSSIZET(((LONGLONG)Augend) + ((LONGLONG)Addend), pResult); -} -#endif - - -//============================================================================= -// Signed subtraction functions -//============================================================================= - -// -// INT8 Subtraction -// -__checkReturn -__inline -NTSTATUS -RtlInt8Sub( - __in INT8 i8Minuend, - __in INT8 i8Subtrahend, - __out __deref_out_range(==, i8Minuend - i8Subtrahend) INT8* pi8Result - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(INT8)); - return RtlLongToInt8(((LONG)i8Minuend) - ((LONG)i8Subtrahend), pi8Result); -} - -// -// SHORT Subtraction -// -__checkReturn -__inline -NTSTATUS -RtlShortSub( - __in SHORT sMinuend, - __in SHORT sSubtrahend, - __out __deref_out_range(==, sMinuend - sSubtrahend) SHORT* psResult - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(SHORT)); - return RtlLongToShort(((LONG)sMinuend) - ((LONG)sSubtrahend), psResult); -} - -// -// INT16 Subtraction -// -#define RtlInt16Sub RtlShortSub - -// -// INT Subtraction -// -__checkReturn -__inline -NTSTATUS -RtlIntSub( - __in INT iMinuend, - __in INT iSubtrahend, - __out __deref_out_range(==, iMinuend - iSubtrahend) INT* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT)); - return RtlLongLongToInt(((LONGLONG)iMinuend) - ((LONGLONG)iSubtrahend), piResult); -} - -// -// INT32 Subtraction -// -#define RtlInt32Sub RtlIntSub - -// -// INT_PTR Subtraction -// -#ifdef _WIN64 -#define RtlIntPtrSub RtlLongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrSub( - __in INT_PTR iMinuend, - __in INT_PTR iSubtrahend, - __out __deref_out_range(==, iMinuend - iSubtrahend) INT_PTR* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT_PTR)); - return RtlLongLongToIntPtr(((LONGLONG)iMinuend) - ((LONGLONG)iSubtrahend), piResult); -} -#endif - -// -// LONG Subtraction -// -__checkReturn -__inline -NTSTATUS -RtlLongSub( - __in LONG lMinuend, - __in LONG lSubtrahend, - __out __deref_out_range(==, lMinuend - lSubtrahend) LONG* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG)); - return RtlLongLongToLong(((LONGLONG)lMinuend) - ((LONGLONG)lSubtrahend), plResult); -} - -// -// LONG32 Subtraction -// -#define RtlLong32Sub RtlIntSub - -// -// LONG_PTR Subtraction -// -#ifdef _WIN64 -#define RtlLongPtrSub RtlLongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrSub( - __in LONG_PTR lMinuend, - __in LONG_PTR lSubtrahend, - __out __deref_out_range(==, lMinuend - lSubtrahend) LONG_PTR* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG_PTR)); - return RtlLongLongToLongPtr(((LONGLONG)lMinuend) - ((LONGLONG)lSubtrahend), plResult); -} -#endif - -// -// RtlLongLongSub -// -__checkReturn -__inline -NTSTATUS -RtlLongLongSub( - __in LONGLONG llMinuend, - __in LONGLONG llSubtrahend, - __out __deref_out_range(==, llMinuend - llSubtrahend) LONGLONG* pllResult - ) -{ - NTSTATUS status; - LONGLONG llResult = llMinuend - llSubtrahend; - - // - // Subtracting a positive number from a positive number never overflows. - // Subtracting a negative number from a negative number never overflows. - // If you subtract a negative number from a positive number, you expect a positive result. - // If you subtract a positive number from a negative number, you expect a negative result. - // Overflow if inputs vary in sign and the output does not have the same sign as the first input. - // - if (((llMinuend < 0) != (llSubtrahend < 0)) && - ((llMinuend < 0) != (llResult < 0))) - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - else - { - *pllResult = llResult; - status = STATUS_SUCCESS; - } - - return status; -} - -// -// LONG64 Subtraction -// -#define RtlLong64Sub RtlLongLongSub - -// -// RtlINT64 Subtraction -// -#define RtlInt64Sub RtlLongLongSub - -// -// ptrdiff_t Subtraction -// -#ifdef _WIN64 -#define RtlPtrdiffTSub RtlLongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlPtrdiffTSub( - __in ptrdiff_t Minuend, - __in ptrdiff_t Subtrahend, - __out __deref_out_range(==, Minuend - Subtrahend) ptrdiff_t* pResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(ptrdiff_t)); - return RtlLongLongToPtrdiffT(((LONGLONG)Minuend) - ((LONGLONG)Subtrahend), pResult); -} -#endif - -// -// SSIZE_T Subtraction -// -#ifdef _WIN64 -#define RtlSSIZETSub RtlLongLongSub -#else -__checkReturn -__inline -NTSTATUS -RtlSSIZETSub( - __in SSIZE_T Minuend, - __in SSIZE_T Subtrahend, - __out __deref_out_range(==, Minuend - Subtrahend) SSIZE_T* pResult) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(SSIZE_T)); - return RtlLongLongToSSIZET(((LONGLONG)Minuend) - ((LONGLONG)Subtrahend), pResult); -} -#endif - - -//============================================================================= -// Signed multiplication functions -//============================================================================= - -// -// INT8 multiplication -// -__checkReturn -__inline -NTSTATUS -RtlInt8Mult( - __in INT8 i8Multiplicand, - __in INT8 i8Multiplier, - __out __deref_out_range(==, i8Multiplicand * i8Multiplier) INT8* pi8Result - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(INT8)); - return RtlLongToInt8(((LONG)i8Multiplier) * ((LONG)i8Multiplicand), pi8Result); -} - -// -// SHORT multiplication -// -__checkReturn -__inline -NTSTATUS -RtlShortMult( - __in SHORT sMultiplicand, - __in SHORT sMultiplier, - __out __deref_out_range(==, sMultiplicand * sMultiplier) SHORT* psResult - ) -{ - C_ASSERT(sizeof(LONG) > sizeof(SHORT)); - return RtlLongToShort(((LONG)sMultiplicand) * ((LONG)sMultiplier), psResult); -} - -// -// INT16 multiplication -// -#define RtlInt16Mult RtlShortMult - -// -// INT multiplication -// -__checkReturn -__inline -NTSTATUS -RtlIntMult( - __in INT iMultiplicand, - __in INT iMultiplier, - __out __deref_out_range(==, iMultiplicand * iMultiplier) INT* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT)); - return RtlLongLongToInt(((LONGLONG)iMultiplicand) * ((LONGLONG)iMultiplier), piResult); -} - -// -// INT32 multiplication -// -#define RtlInt32Mult RtlIntMult - -// -// INT_PTR multiplication -// -#ifdef _WIN64 -#define RtlIntPtrMult RtlLongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlIntPtrMult( - __in INT_PTR iMultiplicand, - __in INT_PTR iMultiplier, - __out __deref_out_range(==, iMultiplicand * iMultiplier) INT_PTR* piResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(INT_PTR)); - return RtlLongLongToIntPtr(((LONGLONG)iMultiplicand) * ((LONGLONG)iMultiplier), piResult); -} -#endif - -// -// LONG multiplication -// -__checkReturn -__inline -NTSTATUS -RtlLongMult( - __in LONG lMultiplicand, - __in LONG lMultiplier, - __out __deref_out_range(==, lMultiplicand * lMultiplier) LONG* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG)); - return RtlLongLongToLong(((LONGLONG)lMultiplicand) * ((LONGLONG)lMultiplier), plResult); -} - -// -// LONG32 multiplication -// -#define RtlLong32Mult RtlIntMult - -// -// LONG_PTR multiplication -// -#ifdef _WIN64 -#define RtlLongPtrMult RtlLongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlLongPtrMult( - __in LONG_PTR lMultiplicand, - __in LONG_PTR lMultiplier, - __out __deref_out_range(==, lMultiplicand * lMultiplier) LONG_PTR* plResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(LONG_PTR)); - return RtlLongLongToLongPtr(((LONGLONG)lMultiplicand) * ((LONGLONG)lMultiplier), plResult); -} -#endif - -// -// LONGLONG multiplication -// -__checkReturn -__inline -NTSTATUS -RtlLongLongMult( - __in LONGLONG llMultiplicand, - __in LONGLONG llMultiplier, - __out __deref_out_range(==, llMultiplicand * llMultiplier) LONGLONG* pllResult - ) -{ - NTSTATUS status; - -#if defined(_USE_INTRINSIC_MULTIPLY128) - LONGLONG llResultHigh; - LONGLONG llResultLow; - - llResultLow = Multiply128(llMultiplicand, llMultiplier, &llResultHigh); - - if (((llResultLow < 0) && (llResultHigh != -1)) || - ((llResultLow >= 0) && (llResultHigh != 0))) - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - else - { - *pllResult = llResultLow; - status = STATUS_SUCCESS; - } -#else // _USE_INTRINSIC_MULTIPLY128 - // - // Split into sign and magnitude, do unsigned operation, apply sign. - // - - ULONGLONG ullMultiplicand; - ULONGLONG ullMultiplier; - ULONGLONG ullResult; - const ULONGLONG LONGLONG_MIN_MAGNITUDE = ((((ULONGLONG) - (LONGLONG_MIN + 1))) + 1); - - if (llMultiplicand < 0) - { - // - // Avoid negating the most negative number. - // - ullMultiplicand = ((ULONGLONG)(- (llMultiplicand + 1))) + 1; - } - else - { - ullMultiplicand = (ULONGLONG)llMultiplicand; - } - - if (llMultiplier < 0) - { - // - // Avoid negating the most negative number. - // - ullMultiplier = ((ULONGLONG)(- (llMultiplier + 1))) + 1; - } - else - { - ullMultiplier = (ULONGLONG)llMultiplier; - } - - status = RtlULongLongMult(ullMultiplicand, ullMultiplier, &ullResult); - if (NT_SUCCESS(status)) - { - if ((llMultiplicand < 0) != (llMultiplier < 0)) - { - if (ullResult > LONGLONG_MIN_MAGNITUDE) - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - else - { - *pllResult = - ((LONGLONG)ullResult); - } - } - else - { - if (ullResult > LONGLONG_MAX) - { - *pllResult = LONGLONG_ERROR; - status = STATUS_INTEGER_OVERFLOW; - } - else - { - *pllResult = (LONGLONG)ullResult; - } - } - } - else - { - *pllResult = LONGLONG_ERROR; - } -#endif // _USE_INTRINSIC_MULTIPLY128 - - return status; -} - -// -// LONG64 multiplication -// -#define RtlLong64Mult RtlLongLongMult - -// -// RtlINT64 multiplication -// -#define RtlInt64Mult RtlLongLongMult - -// -// ptrdiff_t multiplication -// -#ifdef _WIN64 -#define RtlPtrdiffTMult RtlLongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlPtrdiffTMult( - __in ptrdiff_t Multiplicand, - __in ptrdiff_t Multiplier, - __out __deref_out_range(==, Multiplicand * Multiplier) ptrdiff_t* pResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(ptrdiff_t)); - return RtlLongLongToPtrdiffT(((LONGLONG)Multiplicand) * ((LONGLONG)Multiplier), pResult); -} -#endif - -// -// SSIZE_T multiplication -// -#ifdef _WIN64 -#define RtlSSIZETMult RtlLongLongMult -#else -__checkReturn -__inline -NTSTATUS -RtlSSIZETMult( - __in SSIZE_T Multiplicand, - __in SSIZE_T Multiplier, - __out __deref_out_range(==, Multiplicand * Multiplier) SSIZE_T* pResult - ) -{ - C_ASSERT(sizeof(LONGLONG) > sizeof(SSIZE_T)); - return RtlLongLongToSSIZET(((LONGLONG)Multiplicand) * ((LONGLONG)Multiplier), pResult); -} -#endif - -#endif // ENABLE_INTSAFE_SIGNED_FUNCTIONS - -// -// Macros that are no longer used in this header but which clients may -// depend on being defined here. -// -#define LOWORD(_dw) ((WORD)(((DWORD_PTR)(_dw)) & 0xffff)) -#define HIWORD(_dw) ((WORD)((((DWORD_PTR)(_dw)) >> 16) & 0xffff)) -#define LODWORD(_qw) ((DWORD)(_qw)) -#define HIDWORD(_qw) ((DWORD)(((_qw) >> 32) & 0xffffffff)) - -#endif // _NTINTSAFE_H_INCLUDED_ - diff --git a/qt-correction-tool/pub/ddk/ntlmsp.h b/qt-correction-tool/pub/ddk/ntlmsp.h deleted file mode 100644 index faadee2..0000000 --- a/qt-correction-tool/pub/ddk/ntlmsp.h +++ /dev/null @@ -1,312 +0,0 @@ -//+------------------------------------------------------------------------- -// -// Microsoft Windows -// Copyright (C) Microsoft Corporation, 1992-1999. -// -// File: ntlmsp.h -// -// Contents: -// -// Classes: -// -// Functions: -// -// -//-------------------------------------------------------------------------- - -#ifndef _NTLMSP_H_ -#define _NTLMSP_H_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -//////////////////////////////////////////////////////////////////////// -// -// Name of the package to pass in to AcquireCredentialsHandle, etc. -// -//////////////////////////////////////////////////////////////////////// - -#ifndef NTLMSP_NAME_A - -#define NTLMSP_NAME_A "NTLM" -#define NTLMSP_NAME L"NTLM" // ntifs - -#endif // NTLMSP_NAME_A - -#define NTLMSP_NAME_SIZE (sizeof(NTLMSP_NAME) - sizeof(WCHAR)) // ntifs -#define NTLMSP_COMMENT_A "NTLM Security Package" -#define NTLMSP_COMMENT L"NTLM Security Package" -#define NTLMSP_CAPABILITIES (SECPKG_FLAG_TOKEN_ONLY | \ - SECPKG_FLAG_MULTI_REQUIRED | \ - SECPKG_FLAG_CONNECTION | \ - SECPKG_FLAG_INTEGRITY | \ - SECPKG_FLAG_PRIVACY) - -#define NTLMSP_VERSION 1 -#define NTLMSP_RPCID 10 // RPC_C_AUTHN_WINNT from rpcdce.h - -//////////////////////////////////////////////////////////////////////// -// -// Opaque Messages passed between client and server -// -//////////////////////////////////////////////////////////////////////// - -// begin_ntifs - -#define NTLMSSP_SIGNATURE "NTLMSSP" - -// -// GetKey argument for AcquireCredentialsHandle that indicates that -// old style LM is required: -// - -#define NTLMSP_NTLM_CREDENTIAL ((PVOID) 1) - -// -// MessageType for the following messages. -// - -typedef enum { - NtLmNegotiate = 1, - NtLmChallenge, - NtLmAuthenticate, - NtLmUnknown -} NTLM_MESSAGE_TYPE; - -// -// Valid values of NegotiateFlags -// - -#define NTLMSSP_NEGOTIATE_UNICODE 0x00000001 // Text strings are in unicode -#define NTLMSSP_NEGOTIATE_OEM 0x00000002 // Text strings are in OEM -#define NTLMSSP_REQUEST_TARGET 0x00000004 // Server should return its authentication realm - -#define NTLMSSP_NEGOTIATE_SIGN 0x00000010 // Request signature capability -#define NTLMSSP_NEGOTIATE_SEAL 0x00000020 // Request confidentiality -#define NTLMSSP_NEGOTIATE_DATAGRAM 0x00000040 // Use datagram style authentication -#define NTLMSSP_NEGOTIATE_LM_KEY 0x00000080 // Use LM session key for sign/seal - -#define NTLMSSP_NEGOTIATE_NETWARE 0x00000100 // NetWare authentication -#define NTLMSSP_NEGOTIATE_NTLM 0x00000200 // NTLM authentication -#define NTLMSSP_NEGOTIATE_NT_ONLY 0x00000400 // NT authentication only (no LM) -#define NTLMSSP_NEGOTIATE_NULL_SESSION 0x00000800 // NULL Sessions on NT 5.0 and beyand - -#define NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED 0x1000 // Domain Name supplied on negotiate -#define NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED 0x2000 // Workstation Name supplied on negotiate -#define NTLMSSP_NEGOTIATE_LOCAL_CALL 0x00004000 // Indicates client/server are same machine -#define NTLMSSP_NEGOTIATE_ALWAYS_SIGN 0x00008000 // Sign for all security levels - -// -// Valid target types returned by the server in Negotiate Flags -// - -#define NTLMSSP_TARGET_TYPE_DOMAIN 0x00010000 // TargetName is a domain name -#define NTLMSSP_TARGET_TYPE_SERVER 0x00020000 // TargetName is a server name -#define NTLMSSP_TARGET_TYPE_SHARE 0x00040000 // TargetName is a share name -#define NTLMSSP_NEGOTIATE_NTLM2 0x00080000 // NTLM2 authentication added for NT4-SP4 - -#define NTLMSSP_NEGOTIATE_IDENTIFY 0x00100000 // Create identify level token - -// -// Valid requests for additional output buffers -// - -#define NTLMSSP_REQUEST_INIT_RESPONSE 0x00100000 // get back session keys -#define NTLMSSP_REQUEST_ACCEPT_RESPONSE 0x00200000 // get back session key, LUID -#define NTLMSSP_REQUEST_NON_NT_SESSION_KEY 0x00400000 // request non-nt session key -#define NTLMSSP_NEGOTIATE_TARGET_INFO 0x00800000 // target info present in challenge message - -#define NTLMSSP_NEGOTIATE_EXPORTED_CONTEXT 0x01000000 // It's an exported context -#define NTLMSSP_NEGOTIATE_VERSION 0x02000000 // version control - -#define NTLMSSP_NEGOTIATE_128 0x20000000 // negotiate 128 bit encryption -#define NTLMSSP_NEGOTIATE_KEY_EXCH 0x40000000 // exchange a key using key exchange key -#define NTLMSSP_NEGOTIATE_56 0x80000000 // negotiate 56 bit encryption - -// flags used in client space to control sign and seal; never appear on the wire -#define NTLMSSP_APP_SEQ 0x00000040 // Use application provided seq num - -// end_ntifs - -// -// Opaque message returned from first call to InitializeSecurityContext -// - -typedef struct _NEGOTIATE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - ULONG NegotiateFlags; - STRING32 OemDomainName; - STRING32 OemWorkstationName; - ULONG64 Version; -} NEGOTIATE_MESSAGE, *PNEGOTIATE_MESSAGE; - - -// -// Old version of the message, for old clients -// -// begin_ntifs - -typedef struct _OLD_NEGOTIATE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - ULONG NegotiateFlags; -} OLD_NEGOTIATE_MESSAGE, *POLD_NEGOTIATE_MESSAGE; - -// -// Opaque message returned from first call to AcceptSecurityContext -// -typedef struct _CHALLENGE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - STRING32 TargetName; - ULONG NegotiateFlags; - UCHAR Challenge[MSV1_0_CHALLENGE_LENGTH]; - ULONG64 ServerContextHandle; - STRING32 TargetInfo; - ULONG64 Version; -} CHALLENGE_MESSAGE, *PCHALLENGE_MESSAGE; - -// -// Old version of the challenge message -// - -typedef struct _OLD_CHALLENGE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - STRING32 TargetName; - ULONG NegotiateFlags; - UCHAR Challenge[MSV1_0_CHALLENGE_LENGTH]; -} OLD_CHALLENGE_MESSAGE, *POLD_CHALLENGE_MESSAGE; - -// -// Opaque message returned from second call to InitializeSecurityContext -// -typedef struct _AUTHENTICATE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - STRING32 LmChallengeResponse; - STRING32 NtChallengeResponse; - STRING32 DomainName; - STRING32 UserName; - STRING32 Workstation; - STRING32 SessionKey; - ULONG NegotiateFlags; - ULONG64 Version; - UCHAR HandShakeMessagesMIC[16]; // contains the HMAC-MD5 of all handshake messages, - // where MD5DIGESTLEN == 16 -} AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE; - -typedef struct _OLD_AUTHENTICATE_MESSAGE { - UCHAR Signature[sizeof(NTLMSSP_SIGNATURE)]; - NTLM_MESSAGE_TYPE MessageType; - STRING32 LmChallengeResponse; - STRING32 NtChallengeResponse; - STRING32 DomainName; - STRING32 UserName; - STRING32 Workstation; -} OLD_AUTHENTICATE_MESSAGE, *POLD_AUTHENTICATE_MESSAGE; - - -// -// Additional input message to Initialize for clients to provide a -// user-supplied password -// - -typedef struct _NTLM_CHALLENGE_MESSAGE { - UNICODE_STRING32 Password; - UNICODE_STRING32 UserName; - UNICODE_STRING32 DomainName; -} NTLM_CHALLENGE_MESSAGE, *PNTLM_CHALLENGE_MESSAGE; - - -// -// Non-opaque message returned from second call to InitializeSecurityContext -// - -typedef struct _NTLM_INITIALIZE_RESPONSE { - UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; - UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH]; -} NTLM_INITIALIZE_RESPONSE, *PNTLM_INITIALIZE_RESPONSE; - -// -// Additional input message to Accept for trusted client skipping the first -// call to Accept and providing their own challenge -// - -typedef struct _NTLM_AUTHENTICATE_MESSAGE { - CHAR ChallengeToClient[MSV1_0_CHALLENGE_LENGTH]; - ULONG ParameterControl; -} NTLM_AUTHENTICATE_MESSAGE, *PNTLM_AUTHENTICATE_MESSAGE; - - -// -// Non-opaque message returned from second call to AcceptSecurityContext -// - -typedef struct _NTLM_ACCEPT_RESPONSE { - LUID LogonId; - LARGE_INTEGER KickoffTime; - ULONG UserFlags; - UCHAR UserSessionKey[MSV1_0_USER_SESSION_KEY_LENGTH]; - UCHAR LanmanSessionKey[MSV1_0_LANMAN_SESSION_KEY_LENGTH]; -} NTLM_ACCEPT_RESPONSE, *PNTLM_ACCEPT_RESPONSE; - -// end_ntifs - -// -// Size of the largest message -// (The largest message is the AUTHENTICATE_MESSAGE) -// - -#define DNSLEN 256 // length of DNS name - -#define LSA_INFO_MAX_SIZE 20 // max LSA_INFO size - -// -// sizeof(ULONG64) is for MsvAvTimestamp -// - -#define TARGET_INFO_LEN ((3 * DNSLEN + DNLEN + CNLEN) * sizeof(WCHAR) + sizeof(ULONG64) + LSA_INFO_MAX_SIZE + \ - 9 * sizeof(MSV1_0_AV_PAIR) + sizeof(ULONG) * 2) - -// length of NTLM2 response -#define NTLM2_RESPONSE_LENGTH (sizeof(MSV1_0_NTLM3_RESPONSE) + \ - TARGET_INFO_LEN) - -#define NTLMSSP_MAX_MESSAGE_SIZE (sizeof(AUTHENTICATE_MESSAGE) + \ - LM_RESPONSE_LENGTH + \ - NTLM2_RESPONSE_LENGTH + \ - (DNSLEN + 1) * sizeof(WCHAR) + \ - (UNLEN + 1) * sizeof(WCHAR) + \ - (CNLEN + 1) * sizeof(WCHAR)) - -typedef struct _NTLMSSP_MESSAGE_SIGNATURE { - ULONG Version; - ULONG RandomPad; - ULONG CheckSum; - ULONG Nonce; -} NTLMSSP_MESSAGE_SIGNATURE, *PNTLMSSP_MESSAGE_SIGNATURE; - -#define NTLMSSP_MESSAGE_SIGNATURE_SIZE sizeof(NTLMSSP_MESSAGE_SIGNATURE) -// -// Version 1 is the structure above, using stream RC4 to encrypt the trailing -// 12 bytes. -// -#define NTLM_SIGN_VERSION 1 - - - -#ifdef __cplusplus -} -#endif - -#endif // _NTLMSP_H_ - diff --git a/qt-correction-tool/pub/ddk/ntnls.h b/qt-correction-tool/pub/ddk/ntnls.h deleted file mode 100644 index 7e3fc47..0000000 --- a/qt-correction-tool/pub/ddk/ntnls.h +++ /dev/null @@ -1,58 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntnls.h - -Abstract: - - NLS file formats and data types - - -Revision History: - ---*/ - -#ifndef _NTNLS_ -#define _NTNLS_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#define MAXIMUM_LEADBYTES 12 - -typedef struct _CPTABLEINFO { - USHORT CodePage; // code page number - USHORT MaximumCharacterSize; // max length (bytes) of a char - USHORT DefaultChar; // default character (MB) - USHORT UniDefaultChar; // default character (Unicode) - USHORT TransDefaultChar; // translation of default char (Unicode) - USHORT TransUniDefaultChar; // translation of Unic default char (MB) - USHORT DBCSCodePage; // Non 0 for DBCS code pages - UCHAR LeadByte[MAXIMUM_LEADBYTES]; // lead byte ranges - PUSHORT MultiByteTable; // pointer to MB translation table - PVOID WideCharTable; // pointer to WC translation table - PUSHORT DBCSRanges; // pointer to DBCS ranges - PUSHORT DBCSOffsets; // pointer to DBCS offsets -} CPTABLEINFO, *PCPTABLEINFO; - -typedef struct _NLSTABLEINFO { - CPTABLEINFO OemTableInfo; - CPTABLEINFO AnsiTableInfo; - PUSHORT UpperCaseTable; // 844 format upcase table - PUSHORT LowerCaseTable; // 844 format lower case table -} NLSTABLEINFO, *PNLSTABLEINFO; - -#ifdef __cplusplus -} -#endif - -#endif // _NTNLS_ - diff --git a/qt-correction-tool/pub/ddk/ntpoapi.h b/qt-correction-tool/pub/ddk/ntpoapi.h deleted file mode 100644 index 42aa767..0000000 --- a/qt-correction-tool/pub/ddk/ntpoapi.h +++ /dev/null @@ -1,2207 +0,0 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ntpoapi.h - -Abstract: - - This module contains the user APIs for the NT Power Management. - -Author: - -Revision History: - ---*/ - -#if (NTDDI_VERSION >= NTDDI_VISTA) -// begin_ntminiport begin_wdm begin_winnt - -// -// ========================================= -// Define GUIDs which represent well-known power schemes -// ========================================= -// - -// -// Maximum Power Savings - indicates that very aggressive power savings measures will be used to help -// stretch battery life. -// -// {a1841308-3541-4fab-bc81-f71556f20b4a} -// -DEFINE_GUID( GUID_MAX_POWER_SAVINGS, 0xA1841308, 0x3541, 0x4FAB, 0xBC, 0x81, 0xF7, 0x15, 0x56, 0xF2, 0x0B, 0x4A ); - -// -// No Power Savings - indicates that almost no power savings measures will be used. -// -// {8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c} -// -DEFINE_GUID( GUID_MIN_POWER_SAVINGS, 0x8C5E7FDA, 0xE8BF, 0x4A96, 0x9A, 0x85, 0xA6, 0xE2, 0x3A, 0x8C, 0x63, 0x5C ); - -// -// Typical Power Savings - indicates that fairly aggressive power savings measures will be used. -// -// {381b4222-f694-41f0-9685-ff5bb260df2e} -// -DEFINE_GUID( GUID_TYPICAL_POWER_SAVINGS, 0x381B4222, 0xF694, 0x41F0, 0x96, 0x85, 0xFF, 0x5B, 0xB2, 0x60, 0xDF, 0x2E ); - -// -// This is a special GUID that represents "no subgroup" of settings. That is, it indicates -// that settings that are in the root of the power policy hierarchy as opposed to settings -// that are buried under a subgroup of settings. This should be used when querying for -// power settings that may not fall into a subgroup. -// -DEFINE_GUID( NO_SUBGROUP_GUID, 0xFEA3413E, 0x7E05, 0x4911, 0x9A, 0x71, 0x70, 0x03, 0x31, 0xF1, 0xC2, 0x94 ); - -// -// This is a special GUID that represents "every power scheme". That is, it indicates -// that any write to this power scheme should be reflected to every scheme present. -// This allows users to write a single setting once and have it apply to all schemes. They -// can then apply custom settings to specific power schemes that they care about. -// -DEFINE_GUID( ALL_POWERSCHEMES_GUID, 0x68A1E95E, 0x13EA, 0x41E1, 0x80, 0x11, 0x0C, 0x49, 0x6C, 0xA4, 0x90, 0xB0 ); - -// -// This is a special GUID that represents a 'personality' that each power scheme will have. -// In other words, each power scheme will have this key indicating "I'm most like *this* base -// power scheme." This individual setting will have one of three settings: -// GUID_MAX_POWER_SAVINGS -// GUID_MIN_POWER_SAVINGS -// GUID_TYPICAL_POWER_SAVINGS -// -// This allows several features: -// 1. Drivers and applications can register for notification of this GUID. So when this power -// scheme is activiated, this GUID's setting will be sent across the system and drivers/applications -// can see "GUID_MAX_POWER_SAVINGS" which will tell them in a generic fashion "get real aggressive -// about conserving power". -// 2. UserB may install a driver or application which creates power settings, and UserB may modify -// those power settings. Now UserA logs in. How does he see those settings? They simply don't -// exist in his private power key. Well they do exist over in the system power key. When we -// enumerate all the power settings in this system power key and don't find a corresponding entry -// in the user's private power key, then we can go look at this "personality" key in the users -// power scheme. We can then go get a default value for the power setting, depending on which -// "personality" power scheme is being operated on. Here's an example: -// A. UserB installs an application that creates a power setting Seetting1 -// B. UserB changes Setting1 to have a value of 50 because that's one of the possible settings -// available for setting1. -// C. UserB logs out -// D. UserA logs in and his active power scheme is some custom scheme that was derived from -// the GUID_TYPICAL_POWER_SAVINGS. But remember that UserA has no setting1 in his -// private power key. -// E. When activating UserA's selected power scheme, all power settings in the system power key will -// be enumerated (including Setting1). -// F. The power manager will see that UserA has no Setting1 power setting in his private power scheme. -// G. The power manager will query UserA's power scheme for its personality and retrieve -// GUID_TYPICAL_POWER_SAVINGS. -// H. The power manager then looks in Setting1 in the system power key and looks in its set of default -// values for the corresponding value for GUID_TYPICAL_POWER_SAVINGS power schemes. -// I. This derived power setting is applied. -DEFINE_GUID( GUID_POWERSCHEME_PERSONALITY, 0x245D8541, 0x3943, 0x4422, 0xB0, 0x25, 0x13, 0xA7, 0x84, 0xF6, 0x79, 0xB7 ); - -// -// Define a special GUID which will be used to define the active power scheme. -// User will register for this power setting GUID, and when the active power -// scheme changes, they'll get a callback where the payload is the GUID -// representing the active powerscheme. -// ( 31F9F286-5084-42FE-B720-2B0264993763 } -// -DEFINE_GUID( GUID_ACTIVE_POWERSCHEME, 0x31F9F286, 0x5084, 0x42FE, 0xB7, 0x20, 0x2B, 0x02, 0x64, 0x99, 0x37, 0x63 ); - -// -// ========================================= -// Define GUIDs which represent well-known power settings -// ========================================= -// - -// Video settings -// -------------- -// -// Specifies the subgroup which will contain all of the video -// settings for a single policy. -// -DEFINE_GUID( GUID_VIDEO_SUBGROUP, 0x7516B95F, 0xF776, 0x4464, 0x8C, 0x53, 0x06, 0x16, 0x7F, 0x40, 0xCC, 0x99 ); - -// -// Specifies (in seconds) how long we wait after the last user input has been -// recieved before we power off the video. -// -DEFINE_GUID( GUID_VIDEO_POWERDOWN_TIMEOUT, 0x3C0BC021, 0xC8A8, 0x4E07, 0xA9, 0x73, 0x6B, 0x14, 0xCB, 0xCB, 0x2B, 0x7E ); - -// -// Specifies whether adaptive display dimming is turned on or off. -// 82DBCF2D-CD67-40C5-BFDC-9F1A5CCD4663 -// -DEFINE_GUID( GUID_VIDEO_ANNOYANCE_TIMEOUT, 0x82DBCF2D, 0xCD67, 0x40C5, 0xBF, 0xDC, 0x9F, 0x1A, 0x5C, 0xCD, 0x46, 0x63 ); - -// -// Specifies how much adaptive dim time out will be increased by. -// EED904DF-B142-4183-B10B-5A1197A37864 -// -DEFINE_GUID( GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE, 0xEED904DF, 0xB142, 0x4183, 0xB1, 0x0B, 0x5A, 0x11, 0x97, 0xA3, 0x78, 0x64 ); - -// -// Specifies (in seconds) how long we wait after the last user input has been -// recieved before we dim the video. -// -DEFINE_GUID( GUID_VIDEO_DIM_TIMEOUT, 0x17aaa29b, 0x8b43, 0x4b94, 0xaa, 0xfe, 0x35, 0xf6, 0x4d, 0xaa, 0xf1, 0xee); - -// -// Specifies if the operating system should use adaptive timers (based on -// previous behavior) to power down the video, -// -DEFINE_GUID( GUID_VIDEO_ADAPTIVE_POWERDOWN, 0x90959D22, 0xD6A1, 0x49B9, 0xAF, 0x93, 0xBC, 0xE8, 0x85, 0xAD, 0x33, 0x5B ); - -// -// Specifies if the monitor is currently being powered or not. -// 02731015-4510-4526-99E6-E5A17EBD1AEA -// -DEFINE_GUID( GUID_MONITOR_POWER_ON, 0x02731015, 0x4510, 0x4526, 0x99, 0xE6, 0xE5, 0xA1, 0x7E, 0xBD, 0x1A, 0xEA ); - -// -// Monitor brightness policy when in normal state -// {aded5e82-b909-4619-9949-f5d71dac0bcb} -DEFINE_GUID(GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS, 0xaded5e82L, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb); - -// -// -// Monitor brightness policy when in dim state -// {f1fbfde2-a960-4165-9f88-50667911ce96} -DEFINE_GUID(GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS, 0xf1fbfde2, 0xa960, 0x4165, 0x9f, 0x88, 0x50, 0x66, 0x79, 0x11, 0xce, 0x96); - -// -// Current Monitor brightness -// {8ffee2c6-2d01-46be-adb9-398addc5b4ff} -DEFINE_GUID(GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS, 0x8ffee2c6, 0x2d01, 0x46be, 0xad, 0xb9, 0x39, 0x8a, 0xdd, 0xc5, 0xb4, 0xff); - - -// -// Specifies if the operating system should use ambient light sensor to change -// disply brightness adatively. -// {FBD9AA66-9553-4097-BA44-ED6E9D65EAB8} -DEFINE_GUID(GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS, 0xFBD9AA66, 0x9553, 0x4097, 0xBA, 0x44, 0xED, 0x6E, 0x9D, 0x65, 0xEA, 0xB8); - -// -// Specifies a change in the session's display state. -// 73A5E93A-5BB1-4F93-895B-DBD0DA855967 -// -// N.B. This is a session-specific notification, sent only to interactive -// session registrants. Session 0 and kernel mode consumers do not receive -// this notification. -DEFINE_GUID( GUID_SESSION_DISPLAY_STATE, 0x73A5E93A, 0x5BB1, 0x4F93, 0x89, 0x5B, 0xDB, 0xD0, 0xDA, 0x85, 0x59, 0x67 ); - -// -// Specifies a change in the current monitor's display state. -// 6fe69556-704a-47a0-8f24-c28d936fda47 -// -DEFINE_GUID(GUID_CONSOLE_DISPLAY_STATE, 0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47); - -// -// Defines a guid for enabling/disabling the ability to create display required -// power requests. -// -// {A9CEB8DA-CD46-44FB-A98B-02AF69DE4623} -// -DEFINE_GUID( GUID_ALLOW_DISPLAY_REQUIRED, 0xA9CEB8DA, 0xCD46, 0x44FB, 0xA9, 0x8B, 0x02, 0xAF, 0x69, 0xDE, 0x46, 0x23 ); - -// Harddisk settings -// ----------------- -// -// Specifies the subgroup which will contain all of the harddisk -// settings for a single policy. -// -DEFINE_GUID( GUID_DISK_SUBGROUP, 0x0012EE47, 0x9041, 0x4B5D, 0x9B, 0x77, 0x53, 0x5F, 0xBA, 0x8B, 0x14, 0x42 ); - -// -// Specifies (in seconds) how long we wait after the last disk access -// before we power off the disk. -// -DEFINE_GUID( GUID_DISK_POWERDOWN_TIMEOUT, 0x6738E2C4, 0xE8A5, 0x4A42, 0xB1, 0x6A, 0xE0, 0x40, 0xE7, 0x69, 0x75, 0x6E ); - -// -// Specifies the amount of contiguous disk activity time to ignore when -// calculating disk idleness. -// -// 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 -// - -DEFINE_GUID( GUID_DISK_BURST_IGNORE_THRESHOLD, 0x80e3c60e, 0xbb94, 0x4ad8, 0xbb, 0xe0, 0x0d, 0x31, 0x95, 0xef, 0xc6, 0x63 ); - -// -// Specifies if the operating system should use adaptive timers (based on -// previous behavior) to power down the disk, -// -DEFINE_GUID( GUID_DISK_ADAPTIVE_POWERDOWN, 0x396A32E1, 0x499A, 0x40B2, 0x91, 0x24, 0xA9, 0x6A, 0xFE, 0x70, 0x76, 0x67 ); - -// System sleep settings -// --------------------- -// -// Specifies the subgroup which will contain all of the sleep -// settings for a single policy. -// { 238C9FA8-0AAD-41ED-83F4-97BE242C8F20 } -// -DEFINE_GUID( GUID_SLEEP_SUBGROUP, 0x238C9FA8, 0x0AAD, 0x41ED, 0x83, 0xF4, 0x97, 0xBE, 0x24, 0x2C, 0x8F, 0x20 ); - -// -// Specifies an idle treshold percentage (0-100). The system must be this idle -// over a period of time in order to idle to sleep. -// -// N.B. DEPRECATED IN WINDOWS 6.1 -// -DEFINE_GUID( GUID_SLEEP_IDLE_THRESHOLD, 0x81cd32e0, 0x7833, 0x44f3, 0x87, 0x37, 0x70, 0x81, 0xf3, 0x8d, 0x1f, 0x70 ); - -// -// Specifies (in seconds) how long we wait after the system is deemed -// "idle" before moving to standby (S1, S2 or S3). -// -DEFINE_GUID( GUID_STANDBY_TIMEOUT, 0x29F6C1DB, 0x86DA, 0x48C5, 0x9F, 0xDB, 0xF2, 0xB6, 0x7B, 0x1F, 0x44, 0xDA ); - -// -// Specifies (in seconds) how long the system should go back to sleep after -// waking unattended. 0 indicates that the standard standby/hibernate idle -// policy should be used instead. -// -// {7bc4a2f9-d8fc-4469-b07b-33eb785aaca0} -// -DEFINE_GUID( GUID_UNATTEND_SLEEP_TIMEOUT, 0x7bc4a2f9, 0xd8fc, 0x4469, 0xb0, 0x7b, 0x33, 0xeb, 0x78, 0x5a, 0xac, 0xa0 ); - -// -// Specifies (in seconds) how long we wait after the system is deemed -// "idle" before moving to hibernate (S4). -// -DEFINE_GUID( GUID_HIBERNATE_TIMEOUT, 0x9D7815A6, 0x7EE4, 0x497E, 0x88, 0x88, 0x51, 0x5A, 0x05, 0xF0, 0x23, 0x64 ); - -// -// Specifies whether or not Fast S4 should be enabled if the system supports it -// 94AC6D29-73CE-41A6-809F-6363BA21B47E -// -DEFINE_GUID( GUID_HIBERNATE_FASTS4_POLICY, 0x94AC6D29, 0x73CE, 0x41A6, 0x80, 0x9F, 0x63, 0x63, 0xBA, 0x21, 0xB4, 0x7E ); - -// -// Define a GUID for controlling the criticality of sleep state transitions. -// Critical sleep transitions do not query applications, services or drivers -// before transitioning the platform to a sleep state. -// -// {B7A27025-E569-46c2-A504-2B96CAD225A1} -// -DEFINE_GUID( GUID_CRITICAL_POWER_TRANSITION, 0xB7A27025, 0xE569, 0x46c2, 0xA5, 0x04, 0x2B, 0x96, 0xCA, 0xD2, 0x25, 0xA1); - -// -// Specifies if the system is entering or exiting 'away mode'. -// 98A7F580-01F7-48AA-9C0F-44352C29E5C0 -// -DEFINE_GUID( GUID_SYSTEM_AWAYMODE, 0x98A7F580, 0x01F7, 0x48AA, 0x9C, 0x0F, 0x44, 0x35, 0x2C, 0x29, 0xE5, 0xC0 ); - -// Specify whether away mode is allowed -// -// {25DFA149-5DD1-4736-B5AB-E8A37B5B8187} -// -DEFINE_GUID( GUID_ALLOW_AWAYMODE, 0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87 ); - -// -// Defines a guid for enabling/disabling standby (S1-S3) states. This does not -// affect hibernation (S4). -// -// {abfc2519-3608-4c2a-94ea-171b0ed546ab} -// -DEFINE_GUID( GUID_ALLOW_STANDBY_STATES, 0xabfc2519, 0x3608, 0x4c2a, 0x94, 0xea, 0x17, 0x1b, 0x0e, 0xd5, 0x46, 0xab ); - -// -// Defines a guid for enabling/disabling the ability to wake via RTC. -// -// {BD3B718A-0680-4D9D-8AB2-E1D2B4AC806D} -// -DEFINE_GUID( GUID_ALLOW_RTC_WAKE, 0xBD3B718A, 0x0680, 0x4D9D, 0x8A, 0xB2, 0xE1, 0xD2, 0xB4, 0xAC, 0x80, 0x6D ); - -// -// Defines a guid for enabling/disabling the ability to create system required -// power requests. -// -// {A4B195F5-8225-47D8-8012-9D41369786E2} -// -DEFINE_GUID( GUID_ALLOW_SYSTEM_REQUIRED, 0xA4B195F5, 0x8225, 0x47D8, 0x80, 0x12, 0x9D, 0x41, 0x36, 0x97, 0x86, 0xE2 ); - -// System button actions -// --------------------- -// -// -// Specifies the subgroup which will contain all of the system button -// settings for a single policy. -// -DEFINE_GUID( GUID_SYSTEM_BUTTON_SUBGROUP, 0x4F971E89, 0xEEBD, 0x4455, 0xA8, 0xDE, 0x9E, 0x59, 0x04, 0x0E, 0x73, 0x47 ); - -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system power button is pressed. -// -DEFINE_GUID( GUID_POWERBUTTON_ACTION, 0x7648EFA3, 0xDD9C, 0x4E3E, 0xB5, 0x66, 0x50, 0xF9, 0x29, 0x38, 0x62, 0x80 ); -DEFINE_GUID( GUID_POWERBUTTON_ACTION_FLAGS, 0x857E7FAC, 0x034B, 0x4704, 0xAB, 0xB1, 0xBC, 0xA5, 0x4A, 0xA3, 0x14, 0x78 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system sleep button is pressed. -// -DEFINE_GUID( GUID_SLEEPBUTTON_ACTION, 0x96996BC0, 0xAD50, 0x47EC, 0x92, 0x3B, 0x6F, 0x41, 0x87, 0x4D, 0xD9, 0xEB ); -DEFINE_GUID( GUID_SLEEPBUTTON_ACTION_FLAGS, 0x2A160AB1, 0xB69D, 0x4743, 0xB7, 0x18, 0xBF, 0x14, 0x41, 0xD5, 0xE4, 0x93 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system sleep button is pressed. -// { A7066653-8D6C-40A8-910E-A1F54B84C7E5 } -// -DEFINE_GUID( GUID_USERINTERFACEBUTTON_ACTION, 0xA7066653, 0x8D6C, 0x40A8, 0x91, 0x0E, 0xA1, 0xF5, 0x4B, 0x84, 0xC7, 0xE5 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system lid is closed. -// -DEFINE_GUID( GUID_LIDCLOSE_ACTION, 0x5CA83367, 0x6E45, 0x459F, 0xA2, 0x7B, 0x47, 0x6B, 0x1D, 0x01, 0xC9, 0x36 ); -DEFINE_GUID( GUID_LIDCLOSE_ACTION_FLAGS, 0x97E969AC, 0x0D6C, 0x4D08, 0x92, 0x7C, 0xD7, 0xBD, 0x7A, 0xD7, 0x85, 0x7B ); -DEFINE_GUID( GUID_LIDOPEN_POWERSTATE, 0x99FF10E7, 0x23B1, 0x4C07, 0xA9, 0xD1, 0x5C, 0x32, 0x06, 0xD7, 0x41, 0xB4 ); - - -// Battery Discharge Settings -// -------------------------- -// -// Specifies the subgroup which will contain all of the battery discharge -// settings for a single policy. -// -DEFINE_GUID( GUID_BATTERY_SUBGROUP, 0xE73A048D, 0xBF27, 0x4F12, 0x97, 0x31, 0x8B, 0x20, 0x76, 0xE8, 0x89, 0x1F ); - -// -// 4 battery discharge alarm settings. -// -// GUID_BATTERY_DISCHARGE_ACTION_x - This is the action to take. It is a value -// of type POWER_ACTION -// GUID_BATTERY_DISCHARGE_LEVEL_x - This is the battery level (%) -// GUID_BATTERY_DISCHARGE_FLAGS_x - Flags defined below: -// POWER_ACTION_POLICY->EventCode flags -// BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK -// BATTERY_DISCHARGE_FLAGS_ENABLE -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_0, 0x637EA02F, 0xBBCB, 0x4015, 0x8E, 0x2C, 0xA1, 0xC7, 0xB9, 0xC0, 0xB5, 0x46 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_0, 0x9A66D8D7, 0x4FF7, 0x4EF9, 0xB5, 0xA2, 0x5A, 0x32, 0x6C, 0xA2, 0xA4, 0x69 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_0, 0x5dbb7c9f, 0x38e9, 0x40d2, 0x97, 0x49, 0x4f, 0x8a, 0x0e, 0x9f, 0x64, 0x0f ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_1, 0xD8742DCB, 0x3E6A, 0x4B3C, 0xB3, 0xFE, 0x37, 0x46, 0x23, 0xCD, 0xCF, 0x06 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_1, 0x8183BA9A, 0xE910, 0x48DA, 0x87, 0x69, 0x14, 0xAE, 0x6D, 0xC1, 0x17, 0x0A ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_1, 0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58 ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_2, 0x421CBA38, 0x1A8E, 0x4881, 0xAC, 0x89, 0xE3, 0x3A, 0x8B, 0x04, 0xEC, 0xE4 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_2, 0x07A07CA2, 0xADAF, 0x40D7, 0xB0, 0x77, 0x53, 0x3A, 0xAD, 0xED, 0x1B, 0xFA ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_2, 0x7fd2f0c4, 0xfeb7, 0x4da3, 0x81, 0x17, 0xe3, 0xfb, 0xed, 0xc4, 0x65, 0x82 ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_3, 0x80472613, 0x9780, 0x455E, 0xB3, 0x08, 0x72, 0xD3, 0x00, 0x3C, 0xF2, 0xF8 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_3, 0x58AFD5A6, 0xC2DD, 0x47D2, 0x9F, 0xBF, 0xEF, 0x70, 0xCC, 0x5C, 0x59, 0x65 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_3, 0x73613ccf, 0xdbfa, 0x4279, 0x83, 0x56, 0x49, 0x35, 0xf6, 0xbf, 0x62, 0xf3 ); - -// Processor power settings -// ------------------------ -// - -// Specifies the subgroup which will contain all of the processor -// settings for a single policy. -// -DEFINE_GUID( GUID_PROCESSOR_SETTINGS_SUBGROUP, 0x54533251, 0x82BE, 0x4824, 0x96, 0xC1, 0x47, 0xB6, 0x0B, 0x74, 0x0D, 0x00 ); - -// -// Specifies various attributes that control processor performance/throttle -// states. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_POLICY, 0x57027304, 0x4AF6, 0x4104, 0x92, 0x60, 0xE3, 0xD9, 0x52, 0x48, 0xFC, 0x36 ); - -#define PERFSTATE_POLICY_CHANGE_IDEAL 0 -#define PERFSTATE_POLICY_CHANGE_SINGLE 1 -#define PERFSTATE_POLICY_CHANGE_ROCKET 2 -#define PERFSTATE_POLICY_CHANGE_MAX PERFSTATE_POLICY_CHANGE_ROCKET - -// -// Specifies a percentage (between 0 and 100) that the processor frequency -// should never go above. For example, if this value is set to 80, then -// the processor frequency will never be throttled above 80 percent of its -// maximum frequency by the system. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_MAXIMUM, 0xBC5038F7, 0x23E0, 0x4960, 0x96, 0xDA, 0x33, 0xAB, 0xAF, 0x59, 0x35, 0xEC ); - -// -// Specifies a percentage (between 0 and 100) that the processor frequency -// should not drop below. For example, if this value is set to 50, then the -// processor frequency will never be throttled below 50 percent of its -// maximum frequency by the system. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_MINIMUM, 0x893DEE8E, 0x2BEF, 0x41E0, 0x89, 0xC6, 0xB5, 0x5D, 0x09, 0x29, 0x96, 0x4C ); - -// -// Specifies whether throttle states are allowed to be used even when -// performance states are available. -// -// {3b04d4fd-1cc7-4f23-ab1c-d1337819c4bb} -// -DEFINE_GUID( GUID_PROCESSOR_ALLOW_THROTTLING, 0x3b04d4fd, 0x1cc7, 0x4f23, 0xab, 0x1c, 0xd1, 0x33, 0x78, 0x19, 0xc4, 0xbb ); - -// -// Specifies processor power settings for CState policy data -// {68F262A7-F621-4069-B9A5-4874169BE23C} -// -DEFINE_GUID( GUID_PROCESSOR_IDLESTATE_POLICY, 0x68f262a7, 0xf621, 0x4069, 0xb9, 0xa5, 0x48, 0x74, 0x16, 0x9b, 0xe2, 0x3c); - -// -// Specifies processor power settings for PerfState policy data -// {BBDC3814-18E9-4463-8A55-D197327C45C0} -// -DEFINE_GUID( GUID_PROCESSOR_PERFSTATE_POLICY, 0xBBDC3814, 0x18E9, 0x4463, 0x8A, 0x55, 0xD1, 0x97, 0x32, 0x7C, 0x45, 0xC0); - -// -// Specifies the increase busy percentage threshold that must be met before -// increasing the processor performance state. -// -// {06cadf0e-64ed-448a-8927-ce7bf90eb35d} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_THRESHOLD, 0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5d ); - -// -// Specifies the decrease busy percentage threshold that must be met before -// decreasing the processor performance state. -// -// {12a0ab44-fe28-4fa9-b3bd-4b64f44960a6} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_THRESHOLD, 0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa6 ); - -// -// Specifies, either as ideal, single or rocket, how aggressive performance -// states should be selected when increasing the processor performance state. -// -// {465E1F50-B610-473a-AB58-00D1077DC418} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_POLICY, 0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x18); - -// -// Specifies, either as ideal, single or rocket, how aggressive performance -// states should be selected when decreasing the processor performance state. -// -// {40FBEFC7-2E9D-4d25-A185-0CFD8574BAC6} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_POLICY, 0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc6); - -// -// Specifies, in milliseconds, the minimum amount of time that must elapse after -// the last processor performance state change before increasing the processor -// performance state. -// -// {984CF492-3BED-4488-A8F9-4286C97BF5AA} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_TIME, 0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xaa); - -// -// Specifies, in milliseconds, the minimum amount of time that must elapse after -// the last processor performance state change before increasing the processor -// performance state. -// -// {D8EDEB9B-95CF-4f95-A73C-B061973693C8} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_TIME, 0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc8); - -// -// Specifies the time, in milliseconds, that must expire before considering -// a change in the processor performance states or parked core set. -// -// {4D2B0152-7D5C-498b-88E2-34345392A2C5} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_TIME_CHECK, 0x4d2b0152, 0x7d5c, 0x498b, 0x88, 0xe2, 0x34, 0x34, 0x53, 0x92, 0xa2, 0xc5); - -// -// Specifies whether a processor may opportunistically increase frequency above -// the maximum when operating contitions allow it to do so safely. -// -// {45BCC044-D885-43e2-8605-EE0EC6E96B59} -// -DEFINE_GUID(GUID_PROCESSOR_PERF_BOOST_POLICY, -0x45bcc044, 0xd885, 0x43e2, 0x86, 0x5, 0xee, 0xe, 0xc6, 0xe9, 0x6b, 0x59); - -#define PROCESSOR_PERF_BOOST_POLICY_DISABLED 0 -#define PROCESSOR_PERF_BOOST_POLICY_MAX 100 - -// -// Specifies if idle state promotion and demotion values should be scaled based -// on the current peformance state. -// -// {6C2993B0-8F48-481f-BCC6-00DD2742AA06} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_ALLOW_SCALING, 0x6c2993b0, 0x8f48, 0x481f, 0xbc, 0xc6, 0x0, 0xdd, 0x27, 0x42, 0xaa, 0x6); - -// -// Specifies if idle states should be disabled. -// -// {5D76A2CA-E8C0-402f-A133-2158492D58AD} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_DISABLE, 0x5d76a2ca, 0xe8c0, 0x402f, 0xa1, 0x33, 0x21, 0x58, 0x49, 0x2d, 0x58, 0xad); - -// -// Specifies the time that elapsed since the last idle state promotion or -// demotion before idle states may be promoted or demoted again (in -// microseconds). -// -// {C4581C31-89AB-4597-8E2B-9C9CAB440E6B} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_TIME_CHECK, 0xc4581c31, 0x89ab, 0x4597, 0x8e, 0x2b, 0x9c, 0x9c, 0xab, 0x44, 0xe, 0x6b); - - -// -// Specifies the upper busy threshold that must be met before demoting the -// processor to a lighter idle state (in percentage). -// -// {4B92D758-5A24-4851-A470-815D78AEE119} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD, 0x4b92d758, 0x5a24, 0x4851, 0xa4, 0x70, 0x81, 0x5d, 0x78, 0xae, 0xe1, 0x19); - -// -// Specifies the lower busy threshold that must be met before promoting the -// processor to a deeper idle state (in percentage). -// -// {7B224883-B3CC-4d79-819F-8374152CBE7C} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD, 0x7b224883, 0xb3cc, 0x4d79, 0x81, 0x9f, 0x83, 0x74, 0x15, 0x2c, 0xbe, 0x7c); - -// -// Specifies the utilization threshold in percent that must be crossed in order to un-park cores. -// -// {df142941-20f3-4edf-9a4a-9c83d3d717d1} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD, 0xdf142941, 0x20f3, 0x4edf, 0x9a, 0x4a, 0x9c, 0x83, 0xd3, 0xd7, 0x17, 0xd1 ); - -// -// Specifies the utilization threshold in percent that must be crossed in order to park cores. -// -// {68dd2f27-a4ce-4e11-8487-3794e4135dfa} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD, 0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa); - -// -// Specifies, either as ideal, single or rocket, how aggressive core parking is when cores must be unparked. -// -// {c7be0679-2817-4d69-9d02-519a537ed0c6} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY, 0xc7be0679, 0x2817, 0x4d69, 0x9d, 0x02, 0x51, 0x9a, 0x53, 0x7e, 0xd0, 0xc6); - -#define CORE_PARKING_POLICY_CHANGE_IDEAL 0 -#define CORE_PARKING_POLICY_CHANGE_SINGLE 1 -#define CORE_PARKING_POLICY_CHANGE_ROCKET 2 -#define CORE_PARKING_POLICY_CHANGE_MAX CORE_PARKING_POLICY_CHANGE_ROCKET - -// -// Specifies, either as ideal, single or rocket, how aggressive core parking is when cores must be parked. -// -// {71021b41-c749-4d21-be74-a00f335d582b} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY, 0x71021b41, 0xc749, 0x4d21, 0xbe, 0x74, 0xa0, 0x0f, 0x33, 0x5d, 0x58, 0x2b); - -// -// Specifies, on a per processor group basis, the maximum number of cores that can be kept unparked. -// -// {ea062031-0e34-4ff1-9b6d-eb1059334028} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_MAX_CORES, 0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x28); - -// -// Specifies, on a per processor group basis, the minimum number of cores that must be kept unparked. -// -// {0cc5b647-c1df-4637-891a-dec35c318583} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_MIN_CORES, 0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x83); - -// -// Specifies, in milliseconds, the minimum amount of time a core must be parked before it can be unparked. -// -// {2ddd5a84-5a71-437e-912a-db0b8c788732} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME, 0x2ddd5a84, 0x5a71, 0x437e, 0x91, 0x2a, 0xdb, 0x0b, 0x8c, 0x78, 0x87, 0x32); - -// -// Specifies, in milliseconds, the minimum amount of time a core must be unparked before it can be parked. -// -// {dfd10d17-d5eb-45dd-877a-9a34ddd15c82} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME, 0xdfd10d17, 0xd5eb, 0x45dd, 0x87, 0x7a, 0x9a, 0x34, 0xdd, 0xd1, 0x5c, 0x82); - -// -// Specifies the factor by which to decrease affinity history on each core after each check. -// -// {8f7b45e3-c393-480a-878c-f67ac3d07082} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR, 0x8f7b45e3, 0xc393, 0x480a, 0x87, 0x8c, 0xf6, 0x7a, 0xc3, 0xd0, 0x70, 0x82); - -// -// Specifies the threshold above which a core is considered to have had significant affinitized work scheduled to it while parked. -// -// {5b33697b-e89d-4d38-aa46-9e7dfb7cd2f9} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD, 0x5b33697b, 0xe89d, 0x4d38, 0xaa, 0x46, 0x9e, 0x7d, 0xfb, 0x7c, 0xd2, 0xf9); - -// -// Specifies the weighting given to each occurence where affinitized work was scheduled to a parked core. -// -// {e70867f1-fa2f-4f4e-aea1-4d8a0ba23b20} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING, 0xe70867f1, 0xfa2f, 0x4f4e, 0xae, 0xa1, 0x4d, 0x8a, 0x0b, 0xa2, 0x3b, 0x20); - -// -// Specifies the factor by which to decrease the over utilization history on each core after the current performance check. -// -// {1299023c-bc28-4f0a-81ec-d3295a8d815d} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR, 0x1299023c, 0xbc28, 0x4f0a, 0x81, 0xec, 0xd3, 0x29, 0x5a, 0x8d, 0x81, 0x5d); - -// -// Specifies the threshold above which a core is considered to have been recently over utilized while parked. -// -// {9ac18e92-aa3c-4e27-b307-01ae37307129} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD, 0x9ac18e92, 0xaa3c, 0x4e27, 0xb3, 0x07, 0x01, 0xae, 0x37, 0x30, 0x71, 0x29); - -// -// Specifies the weighting given to each occurence where a parked core is found to be over utilized. -// -// {8809c2d8-b155-42d4-bcda-0d345651b1db} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING, 0x8809c2d8, 0xb155, 0x42d4, 0xbc, 0xda, 0x0d, 0x34, 0x56, 0x51, 0xb1, 0xdb); - -// -// Specifies, in percentage, the busy threshold that must be met before a parked core is considered over utilized. -// -// {943c8cb6-6f93-4227-ad87-e9a3feec08d1} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD, 0x943c8cb6, 0x6f93, 0x4227, 0xad, 0x87, 0xe9, 0xa3, 0xfe, 0xec, 0x08, 0xd1); - -// -// Specifies if at least one processor per core should always remain unparked. -// -// {a55612aa-f624-42c6-a443-7397d064c04f} -// - -DEFINE_GUID( GUID_PROCESSOR_PARKING_CORE_OVERRIDE, 0xa55612aa, 0xf624, 0x42c6, 0xa4, 0x43, 0x73, 0x97, 0xd0, 0x64, 0xc0, 0x4f); - -// -// Specifies what performance state a processor should enter when first parked. -// -// {447235c7-6a8d-4cc0-8e24-9eaf70b96e2b} -// - -DEFINE_GUID( GUID_PROCESSOR_PARKING_PERF_STATE, 0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2b); - -// -// Specifies the number of perf time check intervals to average utility over. -// -// {7d24baa7-0b84-480f-840c-1b0743c00f5f} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_HISTORY, 0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x5f); - -// -// Specifies active vs passive cooling. Although not directly related to -// processor settings, it is the processor that gets throttled if we're doing -// passive cooling, so it is fairly strongly related. -// {94D3A615-A899-4AC5-AE2B-E4D8F634367F} -// -DEFINE_GUID( GUID_SYSTEM_COOLING_POLICY, 0x94D3A615, 0xA899, 0x4AC5, 0xAE, 0x2B, 0xE4, 0xD8, 0xF6, 0x34, 0x36, 0x7F); - -// Lock Console on Wake -// -------------------- -// - -// Specifies the behavior of the system when we wake from standby or -// hibernate. If this is set, then we will cause the console to lock -// after we resume. -// -DEFINE_GUID( GUID_LOCK_CONSOLE_ON_WAKE, 0x0E796BDB, 0x100D, 0x47D6, 0xA2, 0xD5, 0xF7, 0xD2, 0xDA, 0xA5, 0x1F, 0x51 ); - -// Device idle characteristics -// --------------------------- -// -// Specifies whether to use the "performance" or "conservative" timeouts for -// device idle management. -// -// 4faab71a-92e5-4726-b531-224559672d19 -// -DEFINE_GUID( GUID_DEVICE_IDLE_POLICY, 0x4faab71a, 0x92e5, 0x4726, 0xb5, 0x31, 0x22, 0x45, 0x59, 0x67, 0x2d, 0x19 ); - -#define POWER_DEVICE_IDLE_POLICY_PERFORMANCE 0 -#define POWER_DEVICE_IDLE_POLICY_CONSERVATIVE 1 - -// AC/DC power source -// ------------------ -// - -// Specifies the power source for the system. consumers may register for -// notification when the power source changes and will be notified with -// one of 3 values: -// 0 - Indicates the system is being powered by an AC power source. -// 1 - Indicates the system is being powered by a DC power source. -// 2 - Indicates the system is being powered by a short-term DC power -// source. For example, this would be the case if the system is -// being powed by a short-term battery supply in a backing UPS -// system. When this value is recieved, the consumer should make -// preparations for either a system hibernate or system shutdown. -// -// { 5D3E9A59-E9D5-4B00-A6BD-FF34FF516548 } -DEFINE_GUID( GUID_ACDC_POWER_SOURCE, 0x5D3E9A59, 0xE9D5, 0x4B00, 0xA6, 0xBD, 0xFF, 0x34, 0xFF, 0x51, 0x65, 0x48 ); - -// Lid state changes -// ----------------- -// -// Specifies the current state of the lid (open or closed). The callback won't -// be called at all until a lid device is found and its current state is known. -// -// Values: -// -// 0 - closed -// 1 - opened -// -// { BA3E0F4D-B817-4094-A2D1-D56379E6A0F3 } -// - -DEFINE_GUID( GUID_LIDSWITCH_STATE_CHANGE, 0xBA3E0F4D, 0xB817, 0x4094, 0xA2, 0xD1, 0xD5, 0x63, 0x79, 0xE6, 0xA0, 0xF3 ); - -// Battery life remaining -// ---------------------- -// - -// Specifies the percentage of battery life remaining. The consumer -// may register for notification in order to track battery life in -// a fine-grained manner. -// -// Once registered, the consumer can expect to be notified as the battery -// life percentage changes. -// -// The consumer will recieve a value between 0 and 100 (inclusive) which -// indicates percent battery life remaining. -// -// { A7AD8041-B45A-4CAE-87A3-EECBB468A9E1 } -DEFINE_GUID( GUID_BATTERY_PERCENTAGE_REMAINING, 0xA7AD8041, 0xB45A, 0x4CAE, 0x87, 0xA3, 0xEE, 0xCB, 0xB4, 0x68, 0xA9, 0xE1 ); - - -// Notification to listeners that the system is fairly busy and won't be moving -// into an idle state any time soon. This can be used as a hint to listeners -// that now might be a good time to do background tasks. -// -DEFINE_GUID( GUID_IDLE_BACKGROUND_TASK, 0x515C31D8, 0xF734, 0x163D, 0xA0, 0xFD, 0x11, 0xA0, 0x8C, 0x91, 0xE8, 0xF1 ); - -// Notification to listeners that the system is fairly busy and won't be moving -// into an idle state any time soon. This can be used as a hint to listeners -// that now might be a good time to do background tasks. -// -// { CF23F240-2A54-48D8-B114-DE1518FF052E } -DEFINE_GUID( GUID_BACKGROUND_TASK_NOTIFICATION, 0xCF23F240, 0x2A54, 0x48D8, 0xB1, 0x14, 0xDE, 0x15, 0x18, 0xFF, 0x05, 0x2E ); - -// Define a GUID that will represent the action of a direct experience button -// on the platform. Users will register for this DPPE setting and recieve -// notification when the h/w button is pressed. -// -// { 1A689231-7399-4E9A-8F99-B71F999DB3FA } -// -DEFINE_GUID( GUID_APPLAUNCH_BUTTON, 0x1A689231, 0x7399, 0x4E9A, 0x8F, 0x99, 0xB7, 0x1F, 0x99, 0x9D, 0xB3, 0xFA ); - -// PCI Express power settings -// ------------------------ -// - -// Specifies the subgroup which will contain all of the PCI Express -// settings for a single policy. -// -// {501a4d13-42af-4429-9fd1-a8218c268e20} -// -DEFINE_GUID( GUID_PCIEXPRESS_SETTINGS_SUBGROUP, 0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20 ); - -// Specifies the PCI Express ASPM power policy. -// -// {ee12f906-d277-404b-b6da-e5fa1a576df5} -// -DEFINE_GUID( GUID_PCIEXPRESS_ASPM_POLICY, 0xee12f906, 0xd277, 0x404b, 0xb6, 0xda, 0xe5, 0xfa, 0x1a, 0x57, 0x6d, 0xf5 ); - -// POWER Shutdown settings -// ------------------------ -// - -// Specifies if forced shutdown should be used for all button and lid initiated -// shutdown actions. -// -// {833a6b62-dfa4-46d1-82f8-e09e34d029d6} -// - -DEFINE_GUID( GUID_ENABLE_SWITCH_FORCED_SHUTDOWN, 0x833a6b62, 0xdfa4, 0x46d1, 0x82, 0xf8, 0xe0, 0x9e, 0x34, 0xd0, 0x29, 0xd6 ); - -// end_winnt end_wdm end_ntminiport -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - - - - -#ifndef _NTPOAPI_ -#define _NTPOAPI_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Power Management user APIs -// - -// begin_ntminiport begin_wdm - -#ifndef _PO_DDK_ -#define _PO_DDK_ - -// begin_winnt - -typedef enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE; - -#define POWER_SYSTEM_MAXIMUM 7 - -typedef enum { - PowerActionNone = 0, - PowerActionReserved, - PowerActionSleep, - PowerActionHibernate, - PowerActionShutdown, - PowerActionShutdownReset, - PowerActionShutdownOff, - PowerActionWarmEject -} POWER_ACTION, *PPOWER_ACTION; - -typedef enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0, - PowerDeviceD1, - PowerDeviceD2, - PowerDeviceD3, - PowerDeviceMaximum -} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; - -typedef enum _MONITOR_DISPLAY_STATE { - PowerMonitorOff = 0, - PowerMonitorOn, - PowerMonitorDim -} MONITOR_DISPLAY_STATE, *PMONITOR_DISPLAY_STATE; - -// end_winnt - -typedef union _POWER_STATE { - SYSTEM_POWER_STATE SystemState; - DEVICE_POWER_STATE DeviceState; -} POWER_STATE, *PPOWER_STATE; - -typedef enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState -} POWER_STATE_TYPE, *PPOWER_STATE_TYPE; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _SYSTEM_POWER_STATE_CONTEXT { - union { - struct { - ULONG Reserved1 : 8; - ULONG TargetSystemState : 4; - ULONG EffectiveSystemState : 4; - ULONG CurrentSystemState : 4; - ULONG IgnoreHibernationPath : 1; - ULONG PseudoTransition : 1; - ULONG Reserved2 : 10; - } DUMMYSTRUCTNAME; - - ULONG ContextAsUlong; - } DUMMYUNIONNAME; -} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT; -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _COUNTED_REASON_CONTEXT { - ULONG Version; - ULONG Flags; - union { - struct { - UNICODE_STRING ResourceFileName; - USHORT ResourceReasonId; - ULONG StringCount; - PUNICODE_STRING __field_ecount(StringCount) ReasonStrings; - } DUMMYSTRUCTNAME; - - UNICODE_STRING SimpleString; - } DUMMYUNIONNAME; -} COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT; - -#endif // (NTDDI_VERSION >= NTDDI_WIN7) - -// -// Generic power related IOCTLs -// - -#define IOCTL_QUERY_DEVICE_POWER_STATE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x0, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_SET_DEVICE_WAKE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x1, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_CANCEL_DEVICE_WAKE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x2, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -// -// Defines for W32 interfaces -// - -// begin_winnt - -#define ES_SYSTEM_REQUIRED ((ULONG)0x00000001) -#define ES_DISPLAY_REQUIRED ((ULONG)0x00000002) -#define ES_USER_PRESENT ((ULONG)0x00000004) -#define ES_AWAYMODE_REQUIRED ((ULONG)0x00000040) -#define ES_CONTINUOUS ((ULONG)0x80000000) - -typedef ULONG EXECUTION_STATE, *PEXECUTION_STATE; - -typedef enum { - LT_DONT_CARE, - LT_LOWEST_LATENCY -} LATENCY_TIME; - -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - -#define DIAGNOSTIC_REASON_VERSION 0 - -#define DIAGNOSTIC_REASON_SIMPLE_STRING 0x00000001 -#define DIAGNOSTIC_REASON_DETAILED_STRING 0x00000002 -#define DIAGNOSTIC_REASON_NOT_SPECIFIED 0x80000000 -#define DIAGNOSTIC_REASON_INVALID_FLAGS (~0x80000003) - -#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - -// -// Defines for power request APIs -// - -#define POWER_REQUEST_CONTEXT_VERSION 0 - -#define POWER_REQUEST_CONTEXT_SIMPLE_STRING 0x00000001 -#define POWER_REQUEST_CONTEXT_DETAILED_STRING 0x00000002 - -// -// N.B. The maximum is a macro (rather than part of enum) for cgen to be able -// to parse power.h correctly. When a new power request type is added, the -// PowerRequestMaximum should be manually incremented. -// - -typedef enum _POWER_REQUEST_TYPE { - PowerRequestDisplayRequired, - PowerRequestSystemRequired, - PowerRequestAwayModeRequired -} POWER_REQUEST_TYPE, *PPOWER_REQUEST_TYPE; - -#define PowerRequestMaximum 3 - -// end_ntminiport - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -//----------------------------------------------------------------------------- -// Device Power Information -// Accessable via CM_Get_DevInst_Registry_Property_Ex(CM_DRP_DEVICE_POWER_DATA) -//----------------------------------------------------------------------------- - -#define PDCAP_D0_SUPPORTED 0x00000001 -#define PDCAP_D1_SUPPORTED 0x00000002 -#define PDCAP_D2_SUPPORTED 0x00000004 -#define PDCAP_D3_SUPPORTED 0x00000008 -#define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 -#define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 -#define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 -#define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 -#define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 - -typedef struct CM_Power_Data_s { - ULONG PD_Size; - DEVICE_POWER_STATE PD_MostRecentPowerState; - ULONG PD_Capabilities; - ULONG PD_D1Latency; - ULONG PD_D2Latency; - ULONG PD_D3Latency; - DEVICE_POWER_STATE PD_PowerStateMapping[POWER_SYSTEM_MAXIMUM]; - SYSTEM_POWER_STATE PD_DeepestSystemWake; -} CM_POWER_DATA, *PCM_POWER_DATA; - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -// begin_wdm - -typedef enum { - SystemPowerPolicyAc, - SystemPowerPolicyDc, - VerifySystemPolicyAc, - VerifySystemPolicyDc, - SystemPowerCapabilities, - SystemBatteryState, - SystemPowerStateHandler, - ProcessorStateHandler, - SystemPowerPolicyCurrent, - AdministratorPowerPolicy, - SystemReserveHiberFile, - ProcessorInformation, - SystemPowerInformation, - ProcessorStateHandler2, - LastWakeTime, // Compare with KeQueryInterruptTime() - LastSleepTime, // Compare with KeQueryInterruptTime() - SystemExecutionState, - SystemPowerStateNotifyHandler, - ProcessorPowerPolicyAc, - ProcessorPowerPolicyDc, - VerifyProcessorPowerPolicyAc, - VerifyProcessorPowerPolicyDc, - ProcessorPowerPolicyCurrent, - SystemPowerStateLogging, - SystemPowerLoggingEntry, - SetPowerSettingValue, - NotifyUserPowerSetting, - PowerInformationLevelUnused0, - PowerInformationLevelUnused1, - SystemVideoState, - TraceApplicationPowerMessage, - TraceApplicationPowerMessageEnd, - ProcessorPerfStates, - ProcessorIdleStates, - ProcessorCap, - SystemWakeSource, - SystemHiberFileInformation, - TraceServicePowerMessage, - ProcessorLoad, - PowerShutdownNotification, - MonitorCapabilities, - SessionPowerInit, - SessionDisplayState, - PowerRequestCreate, - PowerRequestAction, - GetPowerRequestList, - ProcessorInformationEx, - NotifyUserModeLegacyPowerEvent, - GroupPark, - ProcessorIdleDomains, - WakeTimerList, - SystemHiberFileSize, - PowerInformationLevelMaximum -} POWER_INFORMATION_LEVEL; - -// -// Power Setting definitions -// - -typedef enum { - PoAc, - PoDc, - PoHot, - PoConditionMaximum -} SYSTEM_POWER_CONDITION; - -typedef struct { - - // - // Version of this structure. Currently should be set to - // POWER_SETTING_VALUE_VERSION. - // - ULONG Version; - - - // - // GUID representing the power setting being applied. - // - GUID Guid; - - - // - // What power state should this setting be applied to? E.g. - // AC, DC, thermal, ... - // - SYSTEM_POWER_CONDITION PowerCondition; - - // - // Length (in bytes) of the 'Data' member. - // - ULONG DataLength; - - // - // Data which contains the actual setting value. - // - UCHAR Data[ANYSIZE_ARRAY]; -} SET_POWER_SETTING_VALUE, *PSET_POWER_SETTING_VALUE; - -#define POWER_SETTING_VALUE_VERSION (0x1) - -typedef struct { - GUID Guid; -} NOTIFY_USER_POWER_SETTING, *PNOTIFY_USER_POWER_SETTING; - -// -// Package definition for an experience button device notification. When -// someone registers for GUID_EXPERIENCE_BUTTON, this is the definition of -// the setting data they'll get. -// -typedef struct _APPLICATIONLAUNCH_SETTING_VALUE { - - // - // System time when the most recent button press ocurred. Note that this is - // specified in 100ns internvals since January 1, 1601. - // - LARGE_INTEGER ActivationTime; - - // - // Reserved for internal use. - // - ULONG Flags; - - // - // which instance of this device was pressed? - // - ULONG ButtonInstanceID; - - -} APPLICATIONLAUNCH_SETTING_VALUE, *PAPPLICATIONLAUNCH_SETTING_VALUE; - -// -// define platform roles -// - -typedef enum { - PlatformRoleUnspecified = 0, - PlatformRoleDesktop, - PlatformRoleMobile, - PlatformRoleWorkstation, - PlatformRoleEnterpriseServer, - PlatformRoleSOHOServer, - PlatformRoleAppliancePC, - PlatformRolePerformanceServer, - PlatformRoleMaximum -} POWER_PLATFORM_ROLE; - -// -// System power manager capabilities -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_) -typedef struct { - ULONG Granularity; - ULONG Capacity; -} BATTERY_REPORTING_SCALE, *PBATTERY_REPORTING_SCALE; -#endif // (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_) - -// end_winnt -#endif // !_PO_DDK_ -// end_wdm end_ntminiport -// begin_nthal - -#define POWER_PERF_SCALE 100 -#define PERF_LEVEL_TO_PERCENT(_x_) ((_x_ * 1000) / (POWER_PERF_SCALE * 10)) -#define PERCENT_TO_PERF_LEVEL(_x_) ((_x_ * POWER_PERF_SCALE * 10) / 1000) - -// -// Policy manager state handler interfaces -// - -// power state handlers - -typedef enum { - PowerStateSleeping1 = 0, - PowerStateSleeping2 = 1, - PowerStateSleeping3 = 2, - PowerStateSleeping4 = 3, - PowerStateShutdownOff = 4, - PowerStateShutdownReset = 5, - PowerStateSleeping4Firmware = 6, - PowerStateMaximum = 7 -} POWER_STATE_HANDLER_TYPE, *PPOWER_STATE_HANDLER_TYPE; - -#define POWER_STATE_HANDLER_TYPE_MAX 8 - -__drv_functionClass(ENTER_STATE_SYSTEM_HANDLER) -__drv_sameIRQL -typedef -NTSTATUS -(ENTER_STATE_SYSTEM_HANDLER)( - __in PVOID SystemContext - ); - -typedef ENTER_STATE_SYSTEM_HANDLER *PENTER_STATE_SYSTEM_HANDLER; - -__drv_functionClass(ENTER_STATE_HANDLER) -__drv_sameIRQL -typedef -NTSTATUS -(ENTER_STATE_HANDLER)( - __in_opt PVOID Context, - __in_opt PENTER_STATE_SYSTEM_HANDLER SystemHandler, - __in_opt PVOID SystemContext, - __in LONG NumberProcessors, - __in_opt LONG volatile *Number - ); - -typedef ENTER_STATE_HANDLER *PENTER_STATE_HANDLER; - -typedef struct { - POWER_STATE_HANDLER_TYPE Type; - BOOLEAN RtcWake; - UCHAR Spare[3]; - PENTER_STATE_HANDLER Handler; - PVOID Context; -} POWER_STATE_HANDLER, *PPOWER_STATE_HANDLER; - - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -__drv_functionClass(ENTER_STATE_NOTIFY_HANDLER) -__drv_sameIRQL -typedef -NTSTATUS -(ENTER_STATE_NOTIFY_HANDLER)( - __in POWER_STATE_HANDLER_TYPE State, - __in PVOID Context, - __in BOOLEAN Entering - ); - -typedef ENTER_STATE_NOTIFY_HANDLER *PENTER_STATE_NOTIFY_HANDLER; - -typedef struct { - PENTER_STATE_NOTIFY_HANDLER Handler; - PVOID Context; -} POWER_STATE_NOTIFY_HANDLER, *PPOWER_STATE_NOTIFY_HANDLER; - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtPowerInformation( - __in POWER_INFORMATION_LEVEL InformationLevel, - __in_bcount_opt(InputBufferLength) PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_bcount_opt(OutputBufferLength) PVOID OutputBuffer, - __in ULONG OutputBufferLength - ); - -// -// Processor Power Management external interface definitions / info. -// - -typedef struct { - ULONG64 StartTime; - ULONG64 EndTime; - ULONG Reserved[4]; -} PROCESSOR_IDLE_TIMES, *PPROCESSOR_IDLE_TIMES; - -__drv_functionClass(PROCESSOR_IDLE_HANDLER) -typedef -NTSTATUS -(FASTCALL PROCESSOR_IDLE_HANDLER) ( - __in ULONG_PTR Context, - __inout PPROCESSOR_IDLE_TIMES IdleTimes - ); - -typedef PROCESSOR_IDLE_HANDLER *PPROCESSOR_IDLE_HANDLER; - -// -// PROCESSOR_IDLE_STATE "StateFlags" definitions. -// - -#define IDLE_STATE_FLAGS_C1_HLT 0x01 // describes C1 only -#define IDLE_STATE_FLAGS_C1_IO_HLT 0x02 // describes C1 only -#define IDLE_STATE_FLAGS_IO 0x04 // describes C2 and C3 only -#define IDLE_STATE_FLAGS_MWAIT 0x08 // describes C1, C2, C3, C4, ... - -typedef struct _PROCESSOR_IDLE_STATE { - UCHAR StateType; - ULONG StateFlags; - ULONG HardwareLatency; - ULONG Power; - ULONG_PTR Context; - PPROCESSOR_IDLE_HANDLER Handler; -} PROCESSOR_IDLE_STATE, *PPROCESSOR_IDLE_STATE; - -typedef struct _PROCESSOR_IDLE_STATES { - ULONG Size; - ULONG Revision; - ULONG Count; - ULONG Type; - KAFFINITY TargetProcessors; - PROCESSOR_IDLE_STATE State[ANYSIZE_ARRAY]; -} PROCESSOR_IDLE_STATES, *PPROCESSOR_IDLE_STATES; - -// PPM Perf. - -#define PROCESSOR_STATE_TYPE_PERFORMANCE 0x1 -#define PROCESSOR_STATE_TYPE_THROTTLE 0x2 - - -// -// begin_winnt -// - -typedef struct { - ULONG Frequency; - ULONG Flags; - ULONG PercentFrequency; -} PPM_WMI_LEGACY_PERFSTATE, *PPPM_WMI_LEGACY_PERFSTATE; - -typedef struct { - ULONG Latency; - ULONG Power; - ULONG TimeCheck; - UCHAR PromotePercent; - UCHAR DemotePercent; - UCHAR StateType; - UCHAR Reserved; - ULONG StateFlags; - ULONG Context; - ULONG IdleHandler; - ULONG Reserved1; // reserved for future use -} PPM_WMI_IDLE_STATE, *PPPM_WMI_IDLE_STATE; - -typedef struct { - ULONG Type; - ULONG Count; - ULONG TargetState; // current idle state - ULONG OldState; // previous idle state - ULONG64 TargetProcessors; - PPM_WMI_IDLE_STATE State[ANYSIZE_ARRAY]; -} PPM_WMI_IDLE_STATES, *PPPM_WMI_IDLE_STATES; - -typedef struct { - ULONG Type; - ULONG Count; - ULONG TargetState; // current idle state - ULONG OldState; // previous idle state - PVOID TargetProcessors; - PPM_WMI_IDLE_STATE State[ANYSIZE_ARRAY]; -} PPM_WMI_IDLE_STATES_EX, *PPPM_WMI_IDLE_STATES_EX; - -typedef struct { - ULONG Frequency; // in Mhz - ULONG Power; // in milliwatts - UCHAR PercentFrequency; - UCHAR IncreaseLevel; // goto higher state - UCHAR DecreaseLevel; // goto lower state - UCHAR Type; // performance or throttle - ULONG IncreaseTime; // in tick counts - ULONG DecreaseTime; // in tick counts - ULONG64 Control; // control value - ULONG64 Status; // control value - ULONG HitCount; - ULONG Reserved1; // reserved for future use - ULONG64 Reserved2; - ULONG64 Reserved3; -} PPM_WMI_PERF_STATE, *PPPM_WMI_PERF_STATE; - -typedef struct { - ULONG Count; - ULONG MaxFrequency; - ULONG CurrentState; // current state - ULONG MaxPerfState; // fastest state considering policy restrictions - ULONG MinPerfState; // slowest state considering policy restrictions - ULONG LowestPerfState; // slowest perf state, fixed, aka the "knee" - ULONG ThermalConstraint; - UCHAR BusyAdjThreshold; - UCHAR PolicyType; // domain coordination - UCHAR Type; - UCHAR Reserved; - ULONG TimerInterval; - ULONG64 TargetProcessors; // domain affinity - ULONG PStateHandler; - ULONG PStateContext; - ULONG TStateHandler; - ULONG TStateContext; - ULONG FeedbackHandler; - ULONG Reserved1; - ULONG64 Reserved2; - PPM_WMI_PERF_STATE State[ANYSIZE_ARRAY]; -} PPM_WMI_PERF_STATES, *PPPM_WMI_PERF_STATES; - -typedef struct { - ULONG Count; - ULONG MaxFrequency; - ULONG CurrentState; // current state - ULONG MaxPerfState; // fastest state considering policy restrictions - ULONG MinPerfState; // slowest state considering policy restrictions - ULONG LowestPerfState; // slowest perf state, fixed, aka the "knee" - ULONG ThermalConstraint; - UCHAR BusyAdjThreshold; - UCHAR PolicyType; // domain coordination - UCHAR Type; - UCHAR Reserved; - ULONG TimerInterval; - PVOID TargetProcessors; // domain affinity - ULONG PStateHandler; - ULONG PStateContext; - ULONG TStateHandler; - ULONG TStateContext; - ULONG FeedbackHandler; - ULONG Reserved1; - ULONG64 Reserved2; - PPM_WMI_PERF_STATE State[ANYSIZE_ARRAY]; -} PPM_WMI_PERF_STATES_EX, *PPPM_WMI_PERF_STATES_EX; - -// -// Legacy processor idle accounting. -// - -#define PROC_IDLE_BUCKET_COUNT 6 - -typedef struct { - ULONG IdleTransitions; - ULONG FailedTransitions; - ULONG InvalidBucketIndex; - ULONG64 TotalTime; - ULONG IdleTimeBuckets[PROC_IDLE_BUCKET_COUNT]; -} PPM_IDLE_STATE_ACCOUNTING, *PPPM_IDLE_STATE_ACCOUNTING; - -typedef struct { - ULONG StateCount; - ULONG TotalTransitions; - ULONG ResetCount; - ULONG64 StartTime; - PPM_IDLE_STATE_ACCOUNTING State[ANYSIZE_ARRAY]; -} PPM_IDLE_ACCOUNTING, *PPPM_IDLE_ACCOUNTING; - -// -// Processor idle accounting. -// - -#define PROC_IDLE_BUCKET_COUNT_EX 16 - -typedef struct { - ULONG64 TotalTimeUs; - ULONG MinTimeUs; - ULONG MaxTimeUs; - ULONG Count; -} PPM_IDLE_STATE_BUCKET_EX, *PPPM_IDLE_STATE_BUCKET_EX; - -typedef struct { - ULONG64 TotalTime; - ULONG IdleTransitions; - ULONG FailedTransitions; - ULONG InvalidBucketIndex; - ULONG MinTimeUs; - ULONG MaxTimeUs; - PPM_IDLE_STATE_BUCKET_EX IdleTimeBuckets[PROC_IDLE_BUCKET_COUNT_EX]; -} PPM_IDLE_STATE_ACCOUNTING_EX, *PPPM_IDLE_STATE_ACCOUNTING_EX; - -typedef struct { - ULONG StateCount; - ULONG TotalTransitions; - ULONG ResetCount; - ULONG64 StartTime; - __field_ecount(StateCount) PPM_IDLE_STATE_ACCOUNTING_EX State[ANYSIZE_ARRAY]; -} PPM_IDLE_ACCOUNTING_EX, *PPPM_IDLE_ACCOUNTING_EX; - -// -// Definitions of coordination types for _PSD, _TSD, and _CSD BIOS objects from -// the Acpi 3.0 specification -// - -#define ACPI_PPM_SOFTWARE_ALL 0xFC -#define ACPI_PPM_SOFTWARE_ANY 0xFD -#define ACPI_PPM_HARDWARE_ALL 0xFE - -// -// Definition of Microsoft PPM coordination types. -// - -#define MS_PPM_SOFTWARE_ALL 0x1 - -// -// Processor firmware rundown feature bit definitions. -// - -#define PPM_FIRMWARE_ACPI1C2 0x00000001 -#define PPM_FIRMWARE_ACPI1C3 0x00000002 -#define PPM_FIRMWARE_ACPI1TSTATES 0x00000004 -#define PPM_FIRMWARE_CST 0x00000008 -#define PPM_FIRMWARE_CSD 0x00000010 -#define PPM_FIRMWARE_PCT 0x00000020 -#define PPM_FIRMWARE_PSS 0x00000040 -#define PPM_FIRMWARE_XPSS 0x00000080 -#define PPM_FIRMWARE_PPC 0x00000100 -#define PPM_FIRMWARE_PSD 0x00000200 -#define PPM_FIRMWARE_PTC 0x00000400 -#define PPM_FIRMWARE_TSS 0x00000800 -#define PPM_FIRMWARE_TPC 0x00001000 -#define PPM_FIRMWARE_TSD 0x00002000 -#define PPM_FIRMWARE_PCCH 0x00004000 -#define PPM_FIRMWARE_PCCP 0x00008000 - -// -// Processor Power Management WMI interface. -// - -// {A5B32DDD-7F39-4abc-B892-900E43B59EBB} -DEFINE_GUID(PPM_PERFSTATE_CHANGE_GUID, -0xa5b32ddd, 0x7f39, 0x4abc, 0xb8, 0x92, 0x90, 0xe, 0x43, 0xb5, 0x9e, 0xbb); - -// {995e6b7f-d653-497a-b978-36a30c29bf01} -DEFINE_GUID(PPM_PERFSTATE_DOMAIN_CHANGE_GUID, -0x995e6b7f, 0xd653, 0x497a, 0xb9, 0x78, 0x36, 0xa3, 0xc, 0x29, 0xbf, 0x1); - -// {4838fe4f-f71c-4e51-9ecc-8430a7ac4c6c} -DEFINE_GUID(PPM_IDLESTATE_CHANGE_GUID, -0x4838fe4f, 0xf71c, 0x4e51, 0x9e, 0xcc, 0x84, 0x30, 0xa7, 0xac, 0x4c, 0x6c); - -// {5708cc20-7d40-4bf4-b4aa-2b01338d0126} -DEFINE_GUID(PPM_PERFSTATES_DATA_GUID, -0x5708cc20, 0x7d40, 0x4bf4, 0xb4, 0xaa, 0x2b, 0x01, 0x33, 0x8d, 0x01, 0x26); - -// {ba138e10-e250-4ad7-8616-cf1a7ad410e7} -DEFINE_GUID(PPM_IDLESTATES_DATA_GUID, -0xba138e10, 0xe250, 0x4ad7, 0x86, 0x16, 0xcf, 0x1a, 0x7a, 0xd4, 0x10, 0xe7); - -// {e2a26f78-ae07-4ee0-a30f-ce354f5a94cd} -DEFINE_GUID(PPM_IDLE_ACCOUNTING_GUID, -0xe2a26f78, 0xae07, 0x4ee0, 0xa3, 0x0f, 0xce, 0x54, 0xf5, 0x5a, 0x94, 0xcd); - -// {d67abd39-81f8-4a5e-8152-72e31ec912ee} -DEFINE_GUID(PPM_IDLE_ACCOUNTING_EX_GUID, -0xd67abd39, 0x81f8, 0x4a5e, 0x81, 0x52, 0x72, 0xe3, 0x1e, 0xc9, 0x12, 0xee); - -// {a852c2c8-1a4c-423b-8c2c-f30d82931a88} -DEFINE_GUID(PPM_THERMALCONSTRAINT_GUID, -0xa852c2c8, 0x1a4c, 0x423b, 0x8c, 0x2c, 0xf3, 0x0d, 0x82, 0x93, 0x1a, 0x88); - -// {7fd18652-0cfe-40d2-b0a1-0b066a87759e} -DEFINE_GUID(PPM_PERFMON_PERFSTATE_GUID, -0x7fd18652, 0xcfe, 0x40d2, 0xb0, 0xa1, 0xb, 0x6, 0x6a, 0x87, 0x75, 0x9e); - -// {48f377b8-6880-4c7b-8bdc-380176c6654d} -DEFINE_GUID(PPM_THERMAL_POLICY_CHANGE_GUID, -0x48f377b8, 0x6880, 0x4c7b, 0x8b, 0xdc, 0x38, 0x1, 0x76, 0xc6, 0x65, 0x4d); - - -typedef struct { - ULONG State; - ULONG Status; - ULONG Latency; - ULONG Speed; - ULONG Processor; -} PPM_PERFSTATE_EVENT, *PPPM_PERFSTATE_EVENT; - -typedef struct { - ULONG State; - ULONG Latency; - ULONG Speed; - ULONG64 Processors; -} PPM_PERFSTATE_DOMAIN_EVENT, *PPPM_PERFSTATE_DOMAIN_EVENT; - -typedef struct { - ULONG NewState; - ULONG OldState; - ULONG64 Processors; -} PPM_IDLESTATE_EVENT, *PPPM_IDLESTATE_EVENT; - -typedef struct { - ULONG ThermalConstraint; - ULONG64 Processors; -} PPM_THERMALCHANGE_EVENT, *PPPM_THERMALCHANGE_EVENT; - -#pragma warning(push) -#pragma warning(disable:4121) - -typedef struct { - UCHAR Mode; - ULONG64 Processors; -} PPM_THERMAL_POLICY_EVENT, *PPPM_THERMAL_POLICY_EVENT; - -#pragma warning(pop) - -// Power Policy Management interfaces -// - -typedef struct { - POWER_ACTION Action; - ULONG Flags; - ULONG EventCode; -} POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY; - -// POWER_ACTION_POLICY->Flags: -#define POWER_ACTION_QUERY_ALLOWED 0x00000001 -#define POWER_ACTION_UI_ALLOWED 0x00000002 -#define POWER_ACTION_OVERRIDE_APPS 0x00000004 -#define POWER_ACTION_PSEUDO_TRANSITION 0x08000000 -#define POWER_ACTION_LIGHTEST_FIRST 0x10000000 -#define POWER_ACTION_LOCK_CONSOLE 0x20000000 -#define POWER_ACTION_DISABLE_WAKES 0x40000000 -#define POWER_ACTION_CRITICAL 0x80000000 - -// POWER_ACTION_POLICY->EventCode flags -#define POWER_LEVEL_USER_NOTIFY_TEXT 0x00000001 -#define POWER_LEVEL_USER_NOTIFY_SOUND 0x00000002 -#define POWER_LEVEL_USER_NOTIFY_EXEC 0x00000004 -#define POWER_USER_NOTIFY_BUTTON 0x00000008 -#define POWER_USER_NOTIFY_SHUTDOWN 0x00000010 -#define POWER_USER_NOTIFY_FORCED_SHUTDOWN 0x00000020 -#define POWER_FORCE_TRIGGER_RESET 0x80000000 - -// Note: for battery alarm EventCodes, the ID of the battery alarm << 16 is ORed -// into the flags. For example: DISCHARGE_POLICY_LOW << 16 - -// -// The GUID_BATTERY_DISCHARGE_FLAGS_x power settings use a subset of EventCode -// flags. The POWER_FORCE_TRIGGER_RESET flag doesn't make sense for a battery -// alarm so it is overloaded for other purposes (gerneral enable/disable). -#define BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK 0x00000007 -#define BATTERY_DISCHARGE_FLAGS_ENABLE 0x80000000 - -// system battery drain policies -typedef struct { - BOOLEAN Enable; - UCHAR Spare[3]; - ULONG BatteryLevel; - POWER_ACTION_POLICY PowerPolicy; - SYSTEM_POWER_STATE MinSystemState; -} SYSTEM_POWER_LEVEL, *PSYSTEM_POWER_LEVEL; - -// Discharge policy constants -#define NUM_DISCHARGE_POLICIES 4 -#define DISCHARGE_POLICY_CRITICAL 0 -#define DISCHARGE_POLICY_LOW 1 - - -// system power policies -typedef struct _SYSTEM_POWER_POLICY { - ULONG Revision; // 1 - - // events - POWER_ACTION_POLICY PowerButton; - POWER_ACTION_POLICY SleepButton; - POWER_ACTION_POLICY LidClose; - SYSTEM_POWER_STATE LidOpenWake; - ULONG Reserved; - - // "system idle" detection - POWER_ACTION_POLICY Idle; - ULONG IdleTimeout; - UCHAR IdleSensitivity; - - UCHAR DynamicThrottle; - UCHAR Spare2[2]; - - // meaning of power action "sleep" - SYSTEM_POWER_STATE MinSleep; - SYSTEM_POWER_STATE MaxSleep; - SYSTEM_POWER_STATE ReducedLatencySleep; - ULONG WinLogonFlags; - - ULONG Spare3; - - // parameters for dozing - // - ULONG DozeS4Timeout; - - // battery policies - ULONG BroadcastCapacityResolution; - SYSTEM_POWER_LEVEL DischargePolicy[NUM_DISCHARGE_POLICIES]; - - // video policies - ULONG VideoTimeout; - BOOLEAN VideoDimDisplay; - ULONG VideoReserved[3]; - - // hard disk policies - ULONG SpindownTimeout; - - // processor policies - BOOLEAN OptimizeForPower; - UCHAR FanThrottleTolerance; - UCHAR ForcedThrottle; - UCHAR MinThrottle; - POWER_ACTION_POLICY OverThrottled; - -} SYSTEM_POWER_POLICY, *PSYSTEM_POWER_POLICY; - - -// processor power policy state - -// -// Processor Idle State Policy. -// - -#define PROCESSOR_IDLESTATE_POLICY_COUNT 0x3 - -typedef struct { - ULONG TimeCheck; - UCHAR DemotePercent; - UCHAR PromotePercent; - UCHAR Spare[2]; -} PROCESSOR_IDLESTATE_INFO, *PPROCESSOR_IDLESTATE_INFO; - -typedef struct { - USHORT Revision; - union { - USHORT AsUSHORT; - struct { - USHORT AllowScaling : 1; - USHORT Disabled : 1; - USHORT Reserved : 14; - } DUMMYSTRUCTNAME; - } Flags; - - ULONG PolicyCount; - PROCESSOR_IDLESTATE_INFO Policy[PROCESSOR_IDLESTATE_POLICY_COUNT]; -} PROCESSOR_IDLESTATE_POLICY, *PPROCESSOR_IDLESTATE_POLICY; - -// -// Legacy Processor Policy. This is only provided to allow legacy -// applications to compile. New applications must use -// PROCESSOR_IDLESTATE_POLICY. -// - -#define PO_THROTTLE_NONE 0 -#define PO_THROTTLE_CONSTANT 1 -#define PO_THROTTLE_DEGRADE 2 -#define PO_THROTTLE_ADAPTIVE 3 -#define PO_THROTTLE_MAXIMUM 4 // not a policy, just a limit - - -typedef struct _PROCESSOR_POWER_POLICY_INFO { - - // Time based information (will be converted to kernel units) - ULONG TimeCheck; // in US - ULONG DemoteLimit; // in US - ULONG PromoteLimit; // in US - - // Percentage based information - UCHAR DemotePercent; - UCHAR PromotePercent; - UCHAR Spare[2]; - - // Flags - ULONG AllowDemotion:1; - ULONG AllowPromotion:1; - ULONG Reserved:30; - -} PROCESSOR_POWER_POLICY_INFO, *PPROCESSOR_POWER_POLICY_INFO; - -// processor power policy -typedef struct _PROCESSOR_POWER_POLICY { - ULONG Revision; // 1 - - // Dynamic Throttling Policy - UCHAR DynamicThrottle; - UCHAR Spare[3]; - - // Flags - ULONG DisableCStates:1; - ULONG Reserved:31; - - // System policy information - // The Array is last, in case it needs to be grown and the structure - // revision incremented. - ULONG PolicyCount; - PROCESSOR_POWER_POLICY_INFO Policy[3]; - -} PROCESSOR_POWER_POLICY, *PPROCESSOR_POWER_POLICY; - -// -// Processor Perf State Policy. -// - -typedef struct { - ULONG Revision; - UCHAR MaxThrottle; - UCHAR MinThrottle; - UCHAR BusyAdjThreshold; - union { - UCHAR Spare; - union { - UCHAR AsUCHAR; - struct { - UCHAR NoDomainAccounting : 1; - UCHAR IncreasePolicy: 2; - UCHAR DecreasePolicy: 2; - UCHAR Reserved : 3; - } DUMMYSTRUCTNAME; - } Flags; - } DUMMYUNIONNAME; - - ULONG TimeCheck; - ULONG IncreaseTime; - ULONG DecreaseTime; - ULONG IncreasePercent; - ULONG DecreasePercent; -} PROCESSOR_PERFSTATE_POLICY, *PPROCESSOR_PERFSTATE_POLICY; - -// administrator power policy overrides -typedef struct _ADMINISTRATOR_POWER_POLICY { - - // meaning of power action "sleep" - SYSTEM_POWER_STATE MinSleep; - SYSTEM_POWER_STATE MaxSleep; - - // video policies - ULONG MinVideoTimeout; - ULONG MaxVideoTimeout; - - // disk policies - ULONG MinSpindownTimeout; - ULONG MaxSpindownTimeout; -} ADMINISTRATOR_POWER_POLICY, *PADMINISTRATOR_POWER_POLICY; - -// end_winnt - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetThreadExecutionState( - __in EXECUTION_STATE NewFlags, // ES_xxx flags - __out PEXECUTION_STATE PreviousFlags - ); - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtInitiatePowerAction( - __in POWER_ACTION SystemAction, - __in SYSTEM_POWER_STATE LightestSystemState, - __in ULONG Flags, // POWER_ACTION_xxx flags - __in BOOLEAN Asynchronous - ); - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetSystemPowerState ( - __in POWER_ACTION SystemAction, - __in SYSTEM_POWER_STATE LightestSystemState, - __in ULONG Flags // POWER_ACTION_xxx flags - ); - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -NTSTATUS -NTAPI -NtGetDevicePowerState( - __in HANDLE Device, - __out PDEVICE_POWER_STATE State - ); - -__drv_maxIRQL(APC_LEVEL) -__kernel_entry NTSYSCALLAPI -BOOLEAN -NTAPI -NtIsSystemResumeAutomatic( - VOID - ); - -// WinLogonFlags: -#define WINLOGON_LOCK_ON_SLEEP 0x00000001 - -// begin_winnt - -typedef struct { - // Misc supported system features - BOOLEAN PowerButtonPresent; - BOOLEAN SleepButtonPresent; - BOOLEAN LidPresent; - BOOLEAN SystemS1; - BOOLEAN SystemS2; - BOOLEAN SystemS3; - BOOLEAN SystemS4; // hibernate - BOOLEAN SystemS5; // off - BOOLEAN HiberFilePresent; - BOOLEAN FullWake; - BOOLEAN VideoDimPresent; - BOOLEAN ApmPresent; - BOOLEAN UpsPresent; - - // Processors - BOOLEAN ThermalControl; - BOOLEAN ProcessorThrottle; - UCHAR ProcessorMinThrottle; - -#if (NTDDI_VERSION < NTDDI_WINXP) - UCHAR ProcessorThrottleScale; - UCHAR spare2[4]; -#else - UCHAR ProcessorMaxThrottle; - BOOLEAN FastSystemS4; - UCHAR spare2[3]; -#endif // (NTDDI_VERSION < NTDDI_WINXP) - - // Disk - BOOLEAN DiskSpinDown; - UCHAR spare3[8]; - - // System Battery - BOOLEAN SystemBatteriesPresent; - BOOLEAN BatteriesAreShortTerm; - BATTERY_REPORTING_SCALE BatteryScale[3]; - - // Wake - SYSTEM_POWER_STATE AcOnLineWake; - SYSTEM_POWER_STATE SoftLidWake; - SYSTEM_POWER_STATE RtcWake; - SYSTEM_POWER_STATE MinDeviceWakeState; // note this may change on driver load - SYSTEM_POWER_STATE DefaultLowLatencyWake; -} SYSTEM_POWER_CAPABILITIES, *PSYSTEM_POWER_CAPABILITIES; - -typedef struct { - BOOLEAN AcOnLine; - BOOLEAN BatteryPresent; - BOOLEAN Charging; - BOOLEAN Discharging; - BOOLEAN Spare1[4]; - - ULONG MaxCapacity; - ULONG RemainingCapacity; - ULONG Rate; - ULONG EstimatedTime; - - ULONG DefaultAlert1; - ULONG DefaultAlert2; -} SYSTEM_BATTERY_STATE, *PSYSTEM_BATTERY_STATE; - -// end_winnt - -// -// valid flags for SYSTEM_POWER_STATE_DISABLE_REASON.PowerReasonCode -// -#define SPSD_REASON_NONE 0x00000000 -#define SPSD_REASON_NOBIOSSUPPORT 0x00000001 -#define SPSD_REASON_BIOSINCOMPATIBLE 0x00000002 -#define SPSD_REASON_NOOSPM 0x00000003 -#define SPSD_REASON_LEGACYDRIVER 0x00000004 -#define SPSD_REASON_HIBERSTACK 0x00000005 -#define SPSD_REASON_HIBERFILE 0x00000006 -#define SPSD_REASON_POINTERNAL 0x00000007 -#define SPSD_REASON_MEMORYLIMIT 0x00000008 -#define SPSD_REASON_MPOVERRIDE 0x00000009 -#define SPSD_REASON_DRIVERDOWNGRADE 0x0000000A -#define SPSD_REASON_PREVIOUSATTEMPTFAILED 0x0000000B -#define SPSD_REASON_UNKNOWN 0x0000000C -#define SPSD_REASON_INTERNALLYDISABLED 0x0000000D -#define SPSD_REASON_DISABLEDBYPOLICY 0x0000000E -#define SPSD_REASON_UPGRADEINPROGRESS 0x0000000F - -__struct_bcount(sizeof(SYSTEM_POWER_STATE_DISABLE_REASON) + PowerReasonLength) -typedef struct _SYSTEM_POWER_STATE_DISABLE_REASON { - BOOLEAN AffectedState[POWER_STATE_HANDLER_TYPE_MAX]; - ULONG PowerReasonCode; - ULONG PowerReasonLength; - //UCHAR PowerReasonInfo[ANYSIZE_ARRAY]; -} SYSTEM_POWER_STATE_DISABLE_REASON, *PSYSTEM_POWER_STATE_DISABLE_REASON; - -// -// valid flags for SYSTEM_POWER_LOGGING_ENTRY.LoggingType -// -#define LOGGING_TYPE_SPSD 0x00000001 -#define LOGGING_TYPE_POWERTRANSITION 0x00000002 - -typedef struct _SYSTEM_POWER_LOGGING_ENTRY { - ULONG LoggingType; - PVOID LoggingEntry; -} SYSTEM_POWER_LOGGING_ENTRY, *PSYSTEM_POWER_LOGGING_ENTRY; - -#if (NTDDI_VERSION < NTDDI_WINXP) // win2k only - -// -// Power structure in each processors PRCB -// -struct _PROCESSOR_POWER_STATE; // forward ref - -__drv_functionClass(PROCESSOR_IDLE_FUNCTION) -typedef -VOID -(FASTCALL PROCESSOR_IDLE_FUNCTION) ( - __inout struct _PROCESSOR_POWER_STATE *PState - ); - -typedef PROCESSOR_IDLE_FUNCTION *PPROCESSOR_IDLE_FUNCTION; - -typedef struct _PROCESSOR_POWER_STATE { - PPROCESSOR_IDLE_FUNCTION IdleFunction; - ULONG Idle0KernelTimeLimit; - ULONG Idle0LastTime; - - PVOID IdleState; - ULONGLONG LastCheck; - PROCESSOR_IDLE_TIMES IdleTimes; - - ULONG IdleTime1; - ULONG PromotionCheck; - ULONG IdleTime2; - - UCHAR CurrentThrottle; // current throttle setting - UCHAR ThrottleLimit; // max available throttle setting - UCHAR Spare1[2]; - - ULONG SetMember; - PVOID AbortThrottle; - -// temp for debugging - ULONGLONG DebugDelta; - ULONG DebugCount; - - ULONG LastSysTime; - ULONG Spare2[10]; - - -} PROCESSOR_POWER_STATE, *PPROCESSOR_POWER_STATE; - -#endif // (NTDDI_VERSION < NTDDI_WINXP) - -typedef struct _PROCESSOR_POWER_INFORMATION { - ULONG Number; - ULONG MaxMhz; - ULONG CurrentMhz; - ULONG MhzLimit; - ULONG MaxIdleState; - ULONG CurrentIdleState; -} PROCESSOR_POWER_INFORMATION, *PPROCESSOR_POWER_INFORMATION; - -typedef struct _SYSTEM_POWER_INFORMATION { - ULONG MaxIdlenessAllowed; - ULONG Idleness; - ULONG TimeRemaining; - UCHAR CoolingMode; -} SYSTEM_POWER_INFORMATION, *PSYSTEM_POWER_INFORMATION; - -// end_nthal - -typedef struct _SYSTEM_HIBERFILE_INFORMATION { - ULONG NumberOfMcbPairs; - LARGE_INTEGER Mcb[1]; -} SYSTEM_HIBERFILE_INFORMATION, *PSYSTEM_HIBERFILE_INFORMATION; - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef enum _REQUESTER_TYPE { - KernelRequester, - UserProcessRequester, - UserSharedServiceRequester -} REQUESTER_TYPE, *PREQUESTER_TYPE; - -typedef struct _REASON_BUFFER { - ULONG Flags; - union { - struct { - SIZE_T ResourceFileNameOffset; - USHORT ResourceReasonId; - ULONG StringCount; - SIZE_T SubstitutionStringsOffset; - } DUMMYSTRUCTNAME; - - SIZE_T SimpleStringOffset; - } DUMMYUNIONNAME; -} REASON_BUFFER, *PREASON_BUFFER; - -typedef struct _DIAGNOSTIC_BUFFER { - SIZE_T Size; - REQUESTER_TYPE CallerType; - union { - struct { - SIZE_T ProcessImageNameOffset; - ULONG ProcessId; - ULONG ServiceTag; - } DUMMYSTRUCTNAME; - - struct { - SIZE_T DeviceDescriptionOffset; - SIZE_T DevicePathOffset; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - - SIZE_T ReasonOffset; -} DIAGNOSTIC_BUFFER, *PDIAGNOSTIC_BUFFER; - -typedef struct _WAKE_TIMER_INFO { - SIZE_T OffsetToNext; - ULARGE_INTEGER DueTime; - ULONG Period; - DIAGNOSTIC_BUFFER ReasonContext; -} WAKE_TIMER_INFO, *PWAKE_TIMER_INFO; - -#endif // (NTDDI_VERSION >= NTDDI_WIN7) - -// -// Wake source tracking -// - -typedef enum { - DeviceWakeSourceType, - FixedWakeSourceType, - TimerWakeSourceType -} PO_WAKE_SOURCE_TYPE, *PPO_WAKE_SOURCE_TYPE; - -typedef enum { - FixedWakeSourcePowerButton, - FixedWakeSourceSleepButton, - FixedWakeSourceRtc, - FixedWakeSourceDozeToHibernate -} PO_FIXED_WAKE_SOURCE_TYPE, *PPO_FIXED_WAKE_SOURCE_TYPE; - -typedef struct _PO_WAKE_SOURCE_HEADER { - PO_WAKE_SOURCE_TYPE Type; - ULONG Size; -} PO_WAKE_SOURCE_HEADER, *PPO_WAKE_SOURCE_HEADER; - -typedef struct _PO_WAKE_SOURCE_DEVICE { - PO_WAKE_SOURCE_HEADER Header; - WCHAR InstancePath[ANYSIZE_ARRAY]; -} PO_WAKE_SOURCE_DEVICE, *PPO_WAKE_SOURCE_DEVICE; - -typedef struct _PO_WAKE_SOURCE_FIXED { - PO_WAKE_SOURCE_HEADER Header; - PO_FIXED_WAKE_SOURCE_TYPE FixedWakeSourceType; -} PO_WAKE_SOURCE_FIXED, *PPO_WAKE_SOURCE_FIXED; - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _PO_WAKE_SOURCE_TIMER { - PO_WAKE_SOURCE_HEADER Header; - DIAGNOSTIC_BUFFER Reason; -} PO_WAKE_SOURCE_TIMER, *PPO_WAKE_SOURCE_TIMER; - -#endif // (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _PO_WAKE_SOURCE_INFO { - ULONG Count; - ULONG Offsets[ANYSIZE_ARRAY]; -} PO_WAKE_SOURCE_INFO, *PPO_WAKE_SOURCE_INFO; - -typedef struct _PO_WAKE_SOURCE_HISTORY { - ULONG Count; - ULONG Offsets[ANYSIZE_ARRAY]; -} PO_WAKE_SOURCE_HISTORY, *PPO_WAKE_SOURCE_HISTORY; - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#pragma warning(default:4214) -#endif - -#endif // _NTPOAPI_ - diff --git a/qt-correction-tool/pub/ddk/ntrxdef.h b/qt-correction-tool/pub/ddk/ntrxdef.h deleted file mode 100644 index 3686399..0000000 --- a/qt-correction-tool/pub/ddk/ntrxdef.h +++ /dev/null @@ -1,237 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - NtRxDef.h - -Abstract: - - This module defines a whole host of macros that orient the code towards NT - as opposed to Win9x. - -Author: ---*/ - -#ifndef _RX_NTDEFS_DEFINED_ -#define _RX_NTDEFS_DEFINED_ - -#define INLINE __inline - -// -// from winbase.h: -// - -#ifndef INVALID_HANDLE_VALUE -#define INVALID_HANDLE_VALUE ((HANDLE)-1) -#endif // ifndef INVALID_HANDLE_VALUE - -#define RxDeviceType(__xxx) ((DEVICE_TYPE)FILE_DEVICE_##__xxx) - -// -// this macro is used in various places to assist in defining sets of constants -// that can be used to set/clear/test specific bits in a flags-type field -// - -#define RX_DEFINE_FLAG(a,c,d) a = ((1<Fcb?" A: it is done this way to help with optimization. when you make -// the RxGetFcb() call, the Fcb will have to be reloaded from the RxContext if you have called any procs; however, -// it will not have to be reloaded with the capture technique. -// - -#ifndef MINIRDR__NAME -#define RxCaptureFcb PFCB __C_Fcb = (PFCB)(RxContext->pFcb) -#define RxCaptureFobx PFOBX __C_Fobx = (PFOBX)(RxContext->pFobx) -#else -#define RxCaptureFcb PMRX_FCB __C_Fcb = (RxContext->pFcb) -#define RxCaptureFobx PMRX_FOBX __C_Fobx = (RxContext->pFobx) -#endif - -#define RxCaptureRequestPacket PIRP __C_Irp = RxContext->CurrentIrp -#define RxCaptureParamBlock PIO_STACK_LOCATION __C_IrpSp = RxContext->CurrentIrpSp -#define RxCaptureFileObject PFILE_OBJECT __C_FileObject = __C_IrpSp-> FileObject - -// -// the "cap" prefix means "Captured from the RxContext....."; it's ok after you get used to it -// - -#define capFcb __C_Fcb -#define capFobx __C_Fobx -#define capPARAMS __C_IrpSp -#define capReqPacket __C_Irp -#define capFileObject __C_FileObject - -#define RxAllocatePool ExAllocatePool -#define RxAllocatePoolWithTag ExAllocatePoolWithTag -#define RxFreePool ExFreePool - - -extern -NTSTATUS -RxDuplicateString( - PUNICODE_STRING *Copy, - PUNICODE_STRING Original, - POOL_TYPE PoolType - ); - -#define RxIsResourceOwnershipStateExclusive(__r) (FlagOn((__r)->Flag, ResourceOwnedExclusive)) - -#define RxProtectMdlFromFree( Mdl ) {NOTHING;} -#define RxUnprotectMdlFromFree( Mdl ) {NOTHING;} -#define RxMdlIsProtected( Mdl ) (FALSE) -#define RxTakeOwnershipOfMdl( Mdl ) {NOTHING;} -#define RxDisownMdl( Mdl ) {NOTHING;} -#define RxMdlIsOwned( Mdl ) (TRUE) - -#define RxAllocateMdl( Buffer, BufferSize ) \ - IoAllocateMdl( Buffer, BufferSize, FALSE, FALSE, NULL ) - -#define RxMdlIsLocked( Mdl ) ((Mdl)->MdlFlags & MDL_PAGES_LOCKED) -#define RxMdlSourceIsNonPaged( Mdl ) ((Mdl)->MdlFlags & MDL_SOURCE_IS_NONPAGED_POOL) -#define RxMdlIsPartial( Mdl ) ((Mdl)->MdlFlags & MDL_PARTIAL) - -#undef RxProbeAndLockPages -#define RxProbeAndLockPages( Mdl, Mode, Access, Status ) \ - Status = STATUS_SUCCESS; \ - try { \ - MmProbeAndLockPages((Mdl), (Mode), (Access)); \ - } except (EXCEPTION_EXECUTE_HANDLER) { \ - Status = GetExceptionCode(); \ - } - -// -// Macros for dealing with network header MDLs -// - -// -// This is the amount of space we preallocate in front of the smb header to hold -// transport headers. This number came from the server. I suspect it is a worse case -// value for all the transports that support MDL_NETWORK_HEADER -// - -#define TRANSPORT_HEADER_SIZE 128 // IPX_HEADER_SIZE+MAC_HEADER_SIZE - -// -// Mdls that are marked with the MDL_NETWORK_HEADER flag have extra space allocated before -// the current start address that can be used for prepending lower-level headers. The idea -// is that when we want to prepend another header, we take the current mdl and adjust it to -// include this extra header at the front of the message. This is not strictly kosher and relies -// on the behavior that the page the current header is on, and the page that the prepended header -// is on, is the same page. The way the macros work is that if they are not on the same page, -// we don't set the NETWORK_HEADER flag, and the transport will use a second Mdl for the header. -// -// Note that the other wierd thing about this is that we don't use the true buffer sizes. The -// buffer address is really offset TRANSPORT_HEADER_SIZE into the buffer. The buffer size passed -// in the buffer size without the TRANSPORT_HEADER_SIZE included. Thus if the addition of the -// TRANSPORT_HEADER_SIZE would cause the Mdl to span an additonal page, this optimization won't -// work. -// - -#define RxInitializeHeaderMdl( Mdl, Va, Len ) { \ - MmInitializeMdl( Mdl, Va, Len ); \ - if (Mdl->ByteOffset >= TRANSPORT_HEADER_SIZE) { \ - Mdl->MdlFlags |= MDL_NETWORK_HEADER; \ - } \ - } - -#define RxAllocateHeaderMdl( Buffer, BufferSize, Mdl ) { \ - Mdl = RxAllocateMdl( Buffer, BufferSize ); \ - if ((Mdl) && (Mdl->ByteOffset >= TRANSPORT_HEADER_SIZE) ) { \ - SetFlag( Mdl->MdlFlags, MDL_NETWORK_HEADER ); \ - } \ - } - -#define RxMdlIsHeader( Mdl ) (FlagOn( Mdl )->MdlFlags, MDL_NETWORK_HEADER) - -#define RxBuildPartialHeaderMdl( SourceMdl, TargetMdl, Va, Len ) { \ - IoBuildPartialMdl( SourceMdl, TargetMdl, Va, Len ); \ - if (FlagOn(SourceMdl->MdlFlags, MDL_NETWORK_HEADER ) && \ - (TargetMdl->ByteOffset >= TRANSPORT_HEADER_SIZE)) { \ - SetFlag( TargetMdl->MdlFlags, MDL_NETWORK_HEADER ); \ - } \ -} - -#define RxBuildHeaderMdlForNonPagedPool( Mdl) MmBuildMdlForNonPagedPool( Mdl ) - -#define RxProbeAndLockHeaderPages( Mdl, Mode, Access, Status ) \ - RxProbeAndLockPages( Mdl, Mode, Access, Status ) - -#define RxUnlockHeaderPages( Mdl ) MmUnlockPages( Mdl ) - - -// -// the next set of macros defines the prototype and the argument list for the toplevel (Common) -// routines. these routines are just below the dispatch level and this is where the commonality -// between win9x and NT begins. In addition, the IN PRX_CONTEXT RxContext and accompanying capture macros -// could be platform specific as well. We must pass at least the RxContext; but on a RISC machine with -// lots of registers we could pass a lot more. An adjustment would have to be made in the -// RxFsdCommonDispatch in this case since the parameters are not yet captured at that point. -// - -// -// the reason why to say "RXSTATUS RxCommonRead (IN PRX_CONTEXT RxContext)" instead -// of "RxCommon(Read)" is so that the standard tags programs will work. "RxCommon(Read): -// doesn't look like a procedure definition -// - -#define RXCOMMON_SIGNATURE \ - PRX_CONTEXT RxContext - -#define RXCOMMON_ARGUMENTS \ - RxContext - -#define RxGetRequestorProcess( RXCONTEXT ) IoGetRequestorProcess( RXCONTEXT->CurrentIrp ) - -// -// RxGetRequestorProcess() returns what IoGetRequestorProcess() returns, which -// is a pointer to a process structure. Truncating this to 32 bits does -// not yield a value that is unique to the process. -// -// When a 32 bit value that is unique to the process is desired, -// RxGetRequestorProcessId() must be used instead. -// - -#define RxGetRequestorProcessId( RXCONTEXT ) IoGetRequestorProcessId( (RXCONTEXT)->CurrentIrp ) - -#define RxMarkContextPending( RXCONTEXT ) IoMarkIrpPending( (RXCONTEXT)->CurrentIrp ) - -#define RxSetCancelRoutine( Irp, CancelRoutine ) IoSetCancelRoutine( Irp, CancelRoutine ); - -// -// we do this as a macro because we may want to record that we did this adjustment so that -// people who QFI for standardinfo will be forced to the net to get the right answer and that would -// probably be better as a routine -// - -#define RxAdjustAllocationSizeforCC( FCB ) {\ - if ((FCB)->Header.FileSize.QuadPart > (FCB)->Header.AllocationSize.QuadPart) { \ - PMRX_NET_ROOT NetRoot = (FCB)->pNetRoot; \ - ULONGLONG ClusterSize = NetRoot->DiskParameters.ClusterSize; \ - ULONGLONG FileSize = (FCB)->Header.FileSize.QuadPart; \ - ASSERT(ClusterSize!=0); \ - (FCB)->Header.AllocationSize.QuadPart = (FileSize+ClusterSize)&~(ClusterSize-1); \ - } \ - ASSERT ( (FCB)->Header.ValidDataLength.QuadPart <= (FCB)->Header.FileSize.QuadPart ); \ - } - - -#endif // _RX_NTDEFS_DEFINED_ - diff --git a/qt-correction-tool/pub/ddk/ntsam.h b/qt-correction-tool/pub/ddk/ntsam.h deleted file mode 100644 index 532fe35..0000000 --- a/qt-correction-tool/pub/ddk/ntsam.h +++ /dev/null @@ -1,2381 +0,0 @@ -/*++ BUILD Version: 0006 // Increment this if a change has global effects - -Copyright (c) 1989-1999 Microsoft Corporation - -Module Name: - - ntsam.h - -Abstract: - - This module describes the data types and procedure prototypes - that make up the NT Security Accounts Manager. This includes - API's exported by SAM and related subsystems. - -Author: - ---*/ - -#ifndef _NTSAM_ -#define _NTSAM_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PPULONG -typedef PULONG *PPULONG; -#endif //PPULONG - -// -// An attempt to lookup more than this number of names or SIDs in -// a single call will be rejected with an INSUFFICIENT_RESOURCES -// status. -// - -#define SAM_MAXIMUM_LOOKUP_COUNT (1000) - - -// -// An attempt to pass names totalling more than the following number -// of bytes in length will be rejected with an INSUFFICIENT_RESOURCES -// status. -// - -#define SAM_MAXIMUM_LOOKUP_LENGTH (32000) - -// -// An attempt to set a password longer than this number of characters -// will fail. -// - -#define SAM_MAX_PASSWORD_LENGTH (256) - - -// -// Length of the salt used in the clear password encryption -// - -#define SAM_PASSWORD_ENCRYPTION_SALT_LEN (16) - - - - - - -#ifndef _NTSAM_SAM_HANDLE_ // ntsubauth -typedef PVOID SAM_HANDLE, *PSAM_HANDLE; // ntsubauth -#define _NTSAM_SAM_HANDLE_ // ntsubauth -#endif // ntsubauth - -typedef ULONG SAM_ENUMERATE_HANDLE, *PSAM_ENUMERATE_HANDLE; - -typedef struct _SAM_RID_ENUMERATION { - ULONG RelativeId; - UNICODE_STRING Name; -} SAM_RID_ENUMERATION, *PSAM_RID_ENUMERATION; - -typedef struct _SAM_SID_ENUMERATION { - PSID Sid; - UNICODE_STRING Name; -} SAM_SID_ENUMERATION, *PSAM_SID_ENUMERATION; - -#ifdef MIDL_PASS -#define SIZE_IS(x) [size_is(x)] -#define SWITCH_IS(x) [switch_is(x)] -#define SWITCH_TYPE(x) [switch_type(x)] -#define CASE(x) [case(x)] -#define RANGE(x,y) [range(x,y)] -#define VAR_SIZE_ARRAY -#else -#define SIZE_IS(x) -#define SWITCH_IS(x) -#define SWITCH_TYPE(x) -#define CASE(x) -#define RANGE(x,y) __in_range(x,y) -#define VAR_SIZE_ARRAY (1) -#endif - -typedef struct _SAM_BYTE_ARRAY { - - ULONG Size; - SIZE_IS( Size ) PUCHAR Data; - -} SAM_BYTE_ARRAY, *PSAM_BYTE_ARRAY; - -typedef struct _SAM_BYTE_ARRAY_32K { - - RANGE( 0, MAXSHORT ) ULONG Size; - SIZE_IS( Size ) PUCHAR Data; - -} SAM_BYTE_ARRAY_32K, *PSAM_BYTE_ARRAY_32K; - -typedef SAM_BYTE_ARRAY_32K SAM_SHELL_OBJECT_PROPERTIES, *PSAM_SHELL_OBJECT_PROPERTIES; - -///////////////////////////////////////////////////////////////////////////// -// // -// obsolete well-known account names. // -// These became obsolete with the flexadmin model. // -// These will be deleted shortly - DON'T USE THESE // -// // -///////////////////////////////////////////////////////////////////////////// - -#define DOMAIN_ADMIN_USER_NAME "ADMIN" -#define DOMAIN_ADMIN_NAME "D_ADMIN" -#define DOMAIN_ADMIN_NAMEW L"D_ADMIN" -#define DOMAIN_USERS_NAME "D_USERS" -#define DOMAIN_USERS_NAMEW L"D_USERS" -#define DOMAIN_GUESTS_NAME "D_GUESTS" -#define DOMAIN_ACCOUNT_OPERATORS_NAME "D_ACCOUN" -#define DOMAIN_ACCOUNT_OPERATORS_NAMEW L"D_ACCOUN" -#define DOMAIN_SERVER_OPERATORS_NAME "D_SERVER" -#define DOMAIN_SERVER_OPERATORS_NAMEW L"D_SERVER" -#define DOMAIN_PRINT_OPERATORS_NAME "D_PRINT" -#define DOMAIN_PRINT_OPERATORS_NAMEW L"D_PRINT" -#define DOMAIN_COMM_OPERATORS_NAME "D_COMM" -#define DOMAIN_COMM_OPERATORS_NAMEW L"D_COMM" -#define DOMAIN_BACKUP_OPERATORS_NAME "D_BACKUP" -#define DOMAIN_RESTORE_OPERATORS_NAME "D_RESTOR" - - - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Server Object Related Definitions // -// // -/////////////////////////////////////////////////////////////////////////////// - -// -// Access rights for server object -// - -#define SAM_SERVER_CONNECT 0x0001 -#define SAM_SERVER_SHUTDOWN 0x0002 -#define SAM_SERVER_INITIALIZE 0x0004 -#define SAM_SERVER_CREATE_DOMAIN 0x0008 -#define SAM_SERVER_ENUMERATE_DOMAINS 0x0010 -#define SAM_SERVER_LOOKUP_DOMAIN 0x0020 - - -#define SAM_SERVER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - SAM_SERVER_CONNECT |\ - SAM_SERVER_INITIALIZE |\ - SAM_SERVER_CREATE_DOMAIN |\ - SAM_SERVER_SHUTDOWN |\ - SAM_SERVER_ENUMERATE_DOMAINS |\ - SAM_SERVER_LOOKUP_DOMAIN) - -#define SAM_SERVER_READ (STANDARD_RIGHTS_READ |\ - SAM_SERVER_ENUMERATE_DOMAINS) - -#define SAM_SERVER_WRITE (STANDARD_RIGHTS_WRITE |\ - SAM_SERVER_INITIALIZE |\ - SAM_SERVER_CREATE_DOMAIN |\ - SAM_SERVER_SHUTDOWN) - -#define SAM_SERVER_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - SAM_SERVER_CONNECT |\ - SAM_SERVER_LOOKUP_DOMAIN) - - - - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Domain Object Related Definitions // -// // -/////////////////////////////////////////////////////////////////////////////// - - -// -// Access rights for domain object -// - -#define DOMAIN_READ_PASSWORD_PARAMETERS 0x0001 -#define DOMAIN_WRITE_PASSWORD_PARAMS 0x0002 -#define DOMAIN_READ_OTHER_PARAMETERS 0x0004 -#define DOMAIN_WRITE_OTHER_PARAMETERS 0x0008 -#define DOMAIN_CREATE_USER 0x0010 -#define DOMAIN_CREATE_GROUP 0x0020 -#define DOMAIN_CREATE_ALIAS 0x0040 -#define DOMAIN_GET_ALIAS_MEMBERSHIP 0x0080 -#define DOMAIN_LIST_ACCOUNTS 0x0100 -#define DOMAIN_LOOKUP 0x0200 -#define DOMAIN_ADMINISTER_SERVER 0x0400 - -#define DOMAIN_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - DOMAIN_READ_OTHER_PARAMETERS |\ - DOMAIN_WRITE_OTHER_PARAMETERS |\ - DOMAIN_WRITE_PASSWORD_PARAMS |\ - DOMAIN_CREATE_USER |\ - DOMAIN_CREATE_GROUP |\ - DOMAIN_CREATE_ALIAS |\ - DOMAIN_GET_ALIAS_MEMBERSHIP |\ - DOMAIN_LIST_ACCOUNTS |\ - DOMAIN_READ_PASSWORD_PARAMETERS |\ - DOMAIN_LOOKUP |\ - DOMAIN_ADMINISTER_SERVER) - -#define DOMAIN_READ (STANDARD_RIGHTS_READ |\ - DOMAIN_GET_ALIAS_MEMBERSHIP |\ - DOMAIN_READ_OTHER_PARAMETERS) - - -#define DOMAIN_WRITE (STANDARD_RIGHTS_WRITE |\ - DOMAIN_WRITE_OTHER_PARAMETERS |\ - DOMAIN_WRITE_PASSWORD_PARAMS |\ - DOMAIN_CREATE_USER |\ - DOMAIN_CREATE_GROUP |\ - DOMAIN_CREATE_ALIAS |\ - DOMAIN_ADMINISTER_SERVER) - -#define DOMAIN_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - DOMAIN_READ_PASSWORD_PARAMETERS |\ - DOMAIN_LIST_ACCOUNTS |\ - DOMAIN_LOOKUP) - - - -// -// Normal modifications cause a domain's ModifiedCount to be -// incremented by 1. Domain promotion to Primary domain controller -// cause the ModifiedCount to be incremented by the following -// amount. This causes the upper 24-bits of the ModifiedCount -// to be a promotion count and the lower 40-bits as a modification -// count. -// - -#define DOMAIN_PROMOTION_INCREMENT {0x0,0x10} -#define DOMAIN_PROMOTION_MASK {0x0,0xFFFFFFF0} - -// -// Domain information classes and their corresponding data structures -// - -typedef enum _DOMAIN_INFORMATION_CLASS { - DomainPasswordInformation = 1, - DomainGeneralInformation, - DomainLogoffInformation, - DomainOemInformation, - DomainNameInformation, - DomainReplicationInformation, - DomainServerRoleInformation, - DomainModifiedInformation, - DomainStateInformation, - DomainUasInformation, - DomainGeneralInformation2, - DomainLockoutInformation, - DomainModifiedInformation2 -} DOMAIN_INFORMATION_CLASS; - -typedef enum _DOMAIN_SERVER_ENABLE_STATE { - DomainServerEnabled = 1, - DomainServerDisabled -} DOMAIN_SERVER_ENABLE_STATE, *PDOMAIN_SERVER_ENABLE_STATE; - -typedef enum _DOMAIN_SERVER_ROLE { - DomainServerRoleBackup = 2, - DomainServerRolePrimary -} DOMAIN_SERVER_ROLE, *PDOMAIN_SERVER_ROLE; - -#include "pshpack4.h" -typedef struct _DOMAIN_GENERAL_INFORMATION { - LARGE_INTEGER ForceLogoff; - UNICODE_STRING OemInformation; - UNICODE_STRING DomainName; - UNICODE_STRING ReplicaSourceNodeName; - LARGE_INTEGER DomainModifiedCount; - DOMAIN_SERVER_ENABLE_STATE DomainServerState; - DOMAIN_SERVER_ROLE DomainServerRole; - BOOLEAN UasCompatibilityRequired; - ULONG UserCount; - ULONG GroupCount; - ULONG AliasCount; -} DOMAIN_GENERAL_INFORMATION, *PDOMAIN_GENERAL_INFORMATION; -#include "poppack.h" - -#include "pshpack4.h" -typedef struct _DOMAIN_GENERAL_INFORMATION2 { - - DOMAIN_GENERAL_INFORMATION I1; - - // - // New fields added for this structure (NT1.0A). - // - - LARGE_INTEGER LockoutDuration; //Must be a Delta time - LARGE_INTEGER LockoutObservationWindow; //Must be a Delta time - USHORT LockoutThreshold; -} DOMAIN_GENERAL_INFORMATION2, *PDOMAIN_GENERAL_INFORMATION2; -#include "poppack.h" - -typedef struct _DOMAIN_UAS_INFORMATION { - BOOLEAN UasCompatibilityRequired; -} DOMAIN_UAS_INFORMATION; - -// -// This needs to be guarded, because ntsecapi.h is a generated -// public file, and ntsam.h is an internal file, but people like -// to mix and match them anyway. -// - -// begin_ntsecapi -#ifndef _DOMAIN_PASSWORD_INFORMATION_DEFINED -#define _DOMAIN_PASSWORD_INFORMATION_DEFINED -typedef struct _DOMAIN_PASSWORD_INFORMATION { - USHORT MinPasswordLength; - USHORT PasswordHistoryLength; - ULONG PasswordProperties; -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER MaxPasswordAge; - OLD_LARGE_INTEGER MinPasswordAge; -#else - LARGE_INTEGER MaxPasswordAge; - LARGE_INTEGER MinPasswordAge; -#endif -} DOMAIN_PASSWORD_INFORMATION, *PDOMAIN_PASSWORD_INFORMATION; -#endif - -#if (_WIN32_WINNT >= 0x0501) -// -// PasswordProperties flags -// - -#define DOMAIN_PASSWORD_COMPLEX 0x00000001L -#define DOMAIN_PASSWORD_NO_ANON_CHANGE 0x00000002L -#define DOMAIN_PASSWORD_NO_CLEAR_CHANGE 0x00000004L -#define DOMAIN_LOCKOUT_ADMINS 0x00000008L -#define DOMAIN_PASSWORD_STORE_CLEARTEXT 0x00000010L -#define DOMAIN_REFUSE_PASSWORD_CHANGE 0x00000020L -#if(_WIN32_WINNT >= 0x0502) -#define DOMAIN_NO_LM_OWF_CHANGE 0x00000040L -#endif -#endif - -// end_ntsecapi - -typedef enum _DOMAIN_PASSWORD_CONSTRUCTION { - DomainPasswordSimple = 1, - DomainPasswordComplex -} DOMAIN_PASSWORD_CONSTRUCTION; - -typedef struct _DOMAIN_LOGOFF_INFORMATION { -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER ForceLogoff; -#else - LARGE_INTEGER ForceLogoff; -#endif -} DOMAIN_LOGOFF_INFORMATION, *PDOMAIN_LOGOFF_INFORMATION; - -typedef struct _DOMAIN_OEM_INFORMATION { - UNICODE_STRING OemInformation; -} DOMAIN_OEM_INFORMATION, *PDOMAIN_OEM_INFORMATION; - -typedef struct _DOMAIN_NAME_INFORMATION { - UNICODE_STRING DomainName; -} DOMAIN_NAME_INFORMATION, *PDOMAIN_NAME_INFORMATION; - -typedef struct _DOMAIN_SERVER_ROLE_INFORMATION { - DOMAIN_SERVER_ROLE DomainServerRole; -} DOMAIN_SERVER_ROLE_INFORMATION, *PDOMAIN_SERVER_ROLE_INFORMATION; - -typedef struct _DOMAIN_REPLICATION_INFORMATION { - UNICODE_STRING ReplicaSourceNodeName; -} DOMAIN_REPLICATION_INFORMATION, *PDOMAIN_REPLICATION_INFORMATION; - -typedef struct _DOMAIN_MODIFIED_INFORMATION { -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER DomainModifiedCount; - OLD_LARGE_INTEGER CreationTime; -#else - LARGE_INTEGER DomainModifiedCount; - LARGE_INTEGER CreationTime; -#endif -} DOMAIN_MODIFIED_INFORMATION, *PDOMAIN_MODIFIED_INFORMATION; - -typedef struct _DOMAIN_MODIFIED_INFORMATION2 { -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER DomainModifiedCount; - OLD_LARGE_INTEGER CreationTime; - OLD_LARGE_INTEGER ModifiedCountAtLastPromotion; -#else - LARGE_INTEGER DomainModifiedCount; - LARGE_INTEGER CreationTime; - LARGE_INTEGER ModifiedCountAtLastPromotion; -#endif -} DOMAIN_MODIFIED_INFORMATION2, *PDOMAIN_MODIFIED_INFORMATION2; - -typedef struct _DOMAIN_STATE_INFORMATION { - DOMAIN_SERVER_ENABLE_STATE DomainServerState; -} DOMAIN_STATE_INFORMATION, *PDOMAIN_STATE_INFORMATION; - -typedef struct _DOMAIN_LOCKOUT_INFORMATION { -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER LockoutDuration; //Must be a Delta time - OLD_LARGE_INTEGER LockoutObservationWindow; //Must be a Delta time -#else - LARGE_INTEGER LockoutDuration; //Must be a Delta time - LARGE_INTEGER LockoutObservationWindow; //Must be a Delta time -#endif - USHORT LockoutThreshold; //Zero means no lockout -} DOMAIN_LOCKOUT_INFORMATION, *PDOMAIN_LOCKOUT_INFORMATION; - - -// -// Types used by the SamQueryDisplayInformation API -// - -typedef enum _DOMAIN_DISPLAY_INFORMATION { - DomainDisplayUser = 1, - DomainDisplayMachine, - DomainDisplayGroup, // Added in NT1.0A - DomainDisplayOemUser, // Added in NT1.0A - DomainDisplayOemGroup, // Added in NT1.0A - DomainDisplayServer // Added in NT5 to support query of servers -} DOMAIN_DISPLAY_INFORMATION, *PDOMAIN_DISPLAY_INFORMATION; - - -typedef struct _DOMAIN_DISPLAY_USER { - ULONG Index; - ULONG Rid; - ULONG AccountControl; - UNICODE_STRING LogonName; - UNICODE_STRING AdminComment; - UNICODE_STRING FullName; -} DOMAIN_DISPLAY_USER, *PDOMAIN_DISPLAY_USER; - -typedef struct _DOMAIN_DISPLAY_MACHINE { - ULONG Index; - ULONG Rid; - ULONG AccountControl; - UNICODE_STRING Machine; - UNICODE_STRING Comment; -} DOMAIN_DISPLAY_MACHINE, *PDOMAIN_DISPLAY_MACHINE; - -typedef struct _DOMAIN_DISPLAY_GROUP { // Added in NT1.0A - ULONG Index; - ULONG Rid; - ULONG Attributes; - UNICODE_STRING Group; - UNICODE_STRING Comment; -} DOMAIN_DISPLAY_GROUP, *PDOMAIN_DISPLAY_GROUP; - -typedef struct _DOMAIN_DISPLAY_OEM_USER { // Added in NT1.0A - ULONG Index; - OEM_STRING User; -} DOMAIN_DISPLAY_OEM_USER, *PDOMAIN_DISPLAY_OEM_USER; - -typedef struct _DOMAIN_DISPLAY_OEM_GROUP { // Added in NT1.0A - ULONG Index; - OEM_STRING Group; -} DOMAIN_DISPLAY_OEM_GROUP, *PDOMAIN_DISPLAY_OEM_GROUP; - -// -// Types for SamQueryLocalizableAccountsInDomain -// - -typedef enum _DOMAIN_LOCALIZABLE_ACCOUNTS_INFORMATION { - DomainLocalizableAccountsBasic = 1, -} DOMAIN_LOCALIZABLE_ACCOUNTS_INFORMATION, *PDOMAIN_LOCALIZABLE_ACCOUNTS_INFORMATION; - -typedef struct _DOMAIN_LOCALIZABLE_ACCOUNTS_ENTRY { - ULONG Rid; - SID_NAME_USE Use; - UNICODE_STRING Name; - UNICODE_STRING AdminComment; -} DOMAIN_LOCALIZABLE_ACCOUNT_ENTRY, *PDOMAIN_LOCALIZABLE_ACCOUNT_ENTRY; - -typedef struct _DOMAIN_LOCALIZABLE_ACCOUNTS { - ULONG Count; -#ifdef MIDL_PASS - [size_is(Count)] -#endif - __ecount(Count) DOMAIN_LOCALIZABLE_ACCOUNT_ENTRY *Entries; -} DOMAIN_LOCALIZABLE_ACCOUNTS_BASIC, *PDOMAIN_LOCALIZABLE_ACCOUNTS_BASIC; - - -typedef -#ifdef MIDL_PASS - [switch_type(DOMAIN_LOCALIZABLE_ACCOUNTS_INFORMATION)] -#endif - union _DOMAIN_LOCALIZABLE_INFO_BUFFER { -#ifdef MIDL_PASS - [case(DomainLocalizableAccountsBasic)] -#endif - DOMAIN_LOCALIZABLE_ACCOUNTS_BASIC Basic; -} DOMAIN_LOCALIZABLE_ACCOUNTS_INFO_BUFFER, *PDOMAIN_LOCALIZABLE_ACCOUNTS_INFO_BUFFER; - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Group Object Related Definitions // -// // -/////////////////////////////////////////////////////////////////////////////// - - -// -// Access rights for group object -// - -#define GROUP_READ_INFORMATION 0x0001 -#define GROUP_WRITE_ACCOUNT 0x0002 -#define GROUP_ADD_MEMBER 0x0004 -#define GROUP_REMOVE_MEMBER 0x0008 -#define GROUP_LIST_MEMBERS 0x0010 - -#define GROUP_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - GROUP_LIST_MEMBERS |\ - GROUP_WRITE_ACCOUNT |\ - GROUP_ADD_MEMBER |\ - GROUP_REMOVE_MEMBER |\ - GROUP_READ_INFORMATION) - - -#define GROUP_READ (STANDARD_RIGHTS_READ |\ - GROUP_LIST_MEMBERS) - - -#define GROUP_WRITE (STANDARD_RIGHTS_WRITE |\ - GROUP_WRITE_ACCOUNT |\ - GROUP_ADD_MEMBER |\ - GROUP_REMOVE_MEMBER) - -#define GROUP_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - GROUP_READ_INFORMATION) - - -// -// Group object types -// - -typedef struct _GROUP_MEMBERSHIP { - ULONG RelativeId; - ULONG Attributes; -} GROUP_MEMBERSHIP, *PGROUP_MEMBERSHIP; - - -typedef enum _GROUP_INFORMATION_CLASS { - GroupGeneralInformation = 1, - GroupNameInformation, - GroupAttributeInformation, - GroupAdminCommentInformation, - GroupReplicationInformation -} GROUP_INFORMATION_CLASS; - -typedef struct _GROUP_GENERAL_INFORMATION { - UNICODE_STRING Name; - ULONG Attributes; - ULONG MemberCount; - UNICODE_STRING AdminComment; -} GROUP_GENERAL_INFORMATION, *PGROUP_GENERAL_INFORMATION; - -typedef struct _GROUP_NAME_INFORMATION { - UNICODE_STRING Name; -} GROUP_NAME_INFORMATION, *PGROUP_NAME_INFORMATION; - -typedef struct _GROUP_ATTRIBUTE_INFORMATION { - ULONG Attributes; -} GROUP_ATTRIBUTE_INFORMATION, *PGROUP_ATTRIBUTE_INFORMATION; - -typedef struct _GROUP_ADM_COMMENT_INFORMATION { - UNICODE_STRING AdminComment; -} GROUP_ADM_COMMENT_INFORMATION, *PGROUP_ADM_COMMENT_INFORMATION; - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// Alias Object Related Definitions // -// // -/////////////////////////////////////////////////////////////////////////////// - -// -// Access rights for alias object -// - -#define ALIAS_ADD_MEMBER 0x0001 -#define ALIAS_REMOVE_MEMBER 0x0002 -#define ALIAS_LIST_MEMBERS 0x0004 -#define ALIAS_READ_INFORMATION 0x0008 -#define ALIAS_WRITE_ACCOUNT 0x0010 - -#define ALIAS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - ALIAS_READ_INFORMATION |\ - ALIAS_WRITE_ACCOUNT |\ - ALIAS_LIST_MEMBERS |\ - ALIAS_ADD_MEMBER |\ - ALIAS_REMOVE_MEMBER) - - -#define ALIAS_READ (STANDARD_RIGHTS_READ |\ - ALIAS_LIST_MEMBERS) - - -#define ALIAS_WRITE (STANDARD_RIGHTS_WRITE |\ - ALIAS_WRITE_ACCOUNT |\ - ALIAS_ADD_MEMBER |\ - ALIAS_REMOVE_MEMBER) - -#define ALIAS_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - ALIAS_READ_INFORMATION) - -// -// Alias object types -// - -typedef enum _ALIAS_INFORMATION_CLASS { - AliasGeneralInformation = 1, - AliasNameInformation, - AliasAdminCommentInformation, - AliasReplicationInformation, - AliasExtendedInformation, -} ALIAS_INFORMATION_CLASS; - -typedef struct _ALIAS_GENERAL_INFORMATION { - UNICODE_STRING Name; - ULONG MemberCount; - UNICODE_STRING AdminComment; -} ALIAS_GENERAL_INFORMATION, *PALIAS_GENERAL_INFORMATION; - -typedef struct _ALIAS_NAME_INFORMATION { - UNICODE_STRING Name; -} ALIAS_NAME_INFORMATION, *PALIAS_NAME_INFORMATION; - -typedef struct _ALIAS_ADM_COMMENT_INFORMATION { - UNICODE_STRING AdminComment; -} ALIAS_ADM_COMMENT_INFORMATION, *PALIAS_ADM_COMMENT_INFORMATION; - -#define ALIAS_ALL_NAME (0x00000001L) -#define ALIAS_ALL_MEMBER_COUNT (0x00000002L) -#define ALIAS_ALL_ADMIN_COMMENT (0x00000004L) -#define ALIAS_ALL_SHELL_ADMIN_OBJECT_PROPERTIES (0x00000008L) - -typedef struct _ALIAS_EXTENDED_INFORMATION { - - ULONG WhichFields; - SAM_SHELL_OBJECT_PROPERTIES ShellAdminObjectProperties; - -} ALIAS_EXTENDED_INFORMATION, *PALIAS_EXTENDED_INFORMATION; - - -////////////////////////////////////////////////////////////////////////////// -// // -// NT5+ Limited Groups Related Definitions // -// // -////////////////////////////////////////////////////////////////////////////// - -// -// Group Flag Definitions to determine Type of Group -// - -#define GROUP_TYPE_BUILTIN_LOCAL_GROUP 0x00000001 -#define GROUP_TYPE_ACCOUNT_GROUP 0x00000002 -#define GROUP_TYPE_RESOURCE_GROUP 0x00000004 -#define GROUP_TYPE_UNIVERSAL_GROUP 0x00000008 -#define GROUP_TYPE_APP_BASIC_GROUP 0x00000010 -#define GROUP_TYPE_APP_QUERY_GROUP 0x00000020 -#define GROUP_TYPE_SECURITY_ENABLED 0x80000000 - - -#define GROUP_TYPE_RESOURCE_BEHAVOIR (GROUP_TYPE_RESOURCE_GROUP | \ - GROUP_TYPE_APP_BASIC_GROUP | \ - GROUP_TYPE_APP_QUERY_GROUP) - - - -/////////////////////////////////////////////////////////////////////////////// -// // -// User Object Related Definitions // -// // -/////////////////////////////////////////////////////////////////////////////// - - - -// -// Access rights for user object -// - -#define USER_READ_GENERAL 0x0001 -#define USER_READ_PREFERENCES 0x0002 -#define USER_WRITE_PREFERENCES 0x0004 -#define USER_READ_LOGON 0x0008 -#define USER_READ_ACCOUNT 0x0010 -#define USER_WRITE_ACCOUNT 0x0020 -#define USER_CHANGE_PASSWORD 0x0040 -#define USER_FORCE_PASSWORD_CHANGE 0x0080 -#define USER_LIST_GROUPS 0x0100 -#define USER_READ_GROUP_INFORMATION 0x0200 -#define USER_WRITE_GROUP_INFORMATION 0x0400 - -#define USER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - USER_READ_PREFERENCES |\ - USER_READ_LOGON |\ - USER_LIST_GROUPS |\ - USER_READ_GROUP_INFORMATION |\ - USER_WRITE_PREFERENCES |\ - USER_CHANGE_PASSWORD |\ - USER_FORCE_PASSWORD_CHANGE |\ - USER_READ_GENERAL |\ - USER_READ_ACCOUNT |\ - USER_WRITE_ACCOUNT |\ - USER_WRITE_GROUP_INFORMATION) - - - -#define USER_READ (STANDARD_RIGHTS_READ |\ - USER_READ_PREFERENCES |\ - USER_READ_LOGON |\ - USER_READ_ACCOUNT |\ - USER_LIST_GROUPS |\ - USER_READ_GROUP_INFORMATION) - - -#define USER_WRITE (STANDARD_RIGHTS_WRITE |\ - USER_WRITE_PREFERENCES |\ - USER_CHANGE_PASSWORD) - -#define USER_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - USER_READ_GENERAL |\ - USER_CHANGE_PASSWORD) - - -// -// User object types -// - -// begin_ntsubauth -#ifndef _NTSAM_USER_ACCOUNT_FLAGS_ - -// -// User account control flags... -// - -#define USER_ACCOUNT_DISABLED (0x00000001) -#define USER_HOME_DIRECTORY_REQUIRED (0x00000002) -#define USER_PASSWORD_NOT_REQUIRED (0x00000004) -#define USER_TEMP_DUPLICATE_ACCOUNT (0x00000008) -#define USER_NORMAL_ACCOUNT (0x00000010) -#define USER_MNS_LOGON_ACCOUNT (0x00000020) -#define USER_INTERDOMAIN_TRUST_ACCOUNT (0x00000040) -#define USER_WORKSTATION_TRUST_ACCOUNT (0x00000080) -#define USER_SERVER_TRUST_ACCOUNT (0x00000100) -#define USER_DONT_EXPIRE_PASSWORD (0x00000200) -#define USER_ACCOUNT_AUTO_LOCKED (0x00000400) -#define USER_ENCRYPTED_TEXT_PASSWORD_ALLOWED (0x00000800) -#define USER_SMARTCARD_REQUIRED (0x00001000) -#define USER_TRUSTED_FOR_DELEGATION (0x00002000) -#define USER_NOT_DELEGATED (0x00004000) -#define USER_USE_DES_KEY_ONLY (0x00008000) -#define USER_DONT_REQUIRE_PREAUTH (0x00010000) -#define USER_PASSWORD_EXPIRED (0x00020000) -#define USER_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION (0x00040000) -#define USER_NO_AUTH_DATA_REQUIRED (0x00080000) -#define USER_PARTIAL_SECRETS_ACCOUNT (0x00100000) -#define USER_USE_AES_KEYS (0x00200000) -// end_ntsubauth - -// -// The previous bit (USER_USE_AES_KEYS) is not used in the product. -// To be clearer, this bit is stored and retrieved but is never -// used by any component. -// We've shipped Vista with it, therefore we have to leave it behind. -// -// !!!! <<<<< DO NOT, AGAIN DO NOT INTRODUCE ANY NEW BITS >>>>> !!!! -// See Windows OS Bug 1962665 and Windows SE Bug 201918 -// -// Also see the use of begin_ntsubauth and end_ntsubauth which is used -// for generating ntsubauth.h file -// - -// begin_ntsubauth -#define NEXT_FREE_ACCOUNT_CONTROL_BIT (USER_USE_AES_KEYS << 1) - -#define USER_MACHINE_ACCOUNT_MASK \ - ( USER_INTERDOMAIN_TRUST_ACCOUNT |\ - USER_WORKSTATION_TRUST_ACCOUNT |\ - USER_SERVER_TRUST_ACCOUNT) - -#define USER_ACCOUNT_TYPE_MASK \ - ( USER_TEMP_DUPLICATE_ACCOUNT |\ - USER_NORMAL_ACCOUNT |\ - USER_MACHINE_ACCOUNT_MASK ) - -#define USER_COMPUTED_ACCOUNT_CONTROL_BITS \ - (USER_ACCOUNT_AUTO_LOCKED | \ - USER_PASSWORD_EXPIRED ) - - - -// -// Logon times may be expressed in day, hour, or minute granularity. -// -// Days per week = 7 -// Hours per week = 168 -// Minutes per week = 10080 -// - -#define SAM_DAYS_PER_WEEK (7) -#define SAM_HOURS_PER_WEEK (24 * SAM_DAYS_PER_WEEK) -#define SAM_MINUTES_PER_WEEK (60 * SAM_HOURS_PER_WEEK) - -typedef struct _LOGON_HOURS { - - USHORT UnitsPerWeek; - - // - // UnitsPerWeek is the number of equal length time units the week is - // divided into. This value is used to compute the length of the bit - // string in logon_hours. Must be less than or equal to - // SAM_UNITS_PER_WEEK (10080) for this release. - // - // LogonHours is a bit map of valid logon times. Each bit represents - // a unique division in a week. The largest bit map supported is 1260 - // bytes (10080 bits), which represents minutes per week. In this case - // the first bit (bit 0, byte 0) is Sunday, 00:00:00 - 00-00:59; bit 1, - // byte 0 is Sunday, 00:01:00 - 00:01:59, etc. A NULL pointer means - // DONT_CHANGE for SamSetInformationUser() calls. - // - - PUCHAR LogonHours; - -} LOGON_HOURS, *PLOGON_HOURS; - -typedef struct _SR_SECURITY_DESCRIPTOR { - ULONG Length; - PUCHAR SecurityDescriptor; -} SR_SECURITY_DESCRIPTOR, *PSR_SECURITY_DESCRIPTOR; - -#define _NTSAM_USER_ACCOUNT_FLAG_ -#endif -// end_ntsubauth - -typedef enum _USER_INFORMATION_CLASS { - UserGeneralInformation = 1, - UserPreferencesInformation, - UserLogonInformation, - UserLogonHoursInformation, - UserAccountInformation, - UserNameInformation, - UserAccountNameInformation, - UserFullNameInformation, - UserPrimaryGroupInformation, - UserHomeInformation, - UserScriptInformation, - UserProfileInformation, - UserAdminCommentInformation, - UserWorkStationsInformation, - UserSetPasswordInformation, - UserControlInformation, - UserExpiresInformation, - UserInternal1Information, - UserInternal2Information, - UserParametersInformation, - UserAllInformation, - UserInternal3Information, - UserInternal4Information, - UserInternal5Information, - UserInternal4InformationNew, - UserInternal5InformationNew, - UserInternal6Information, - UserExtendedInformation, - UserLogonUIInformation, -} USER_INFORMATION_CLASS, *PUSER_INFORMATION_CLASS; - -// begin_ntsubauth -#ifndef _NTSAM_USER_ALL_INFO_ -#include "pshpack4.h" -typedef struct _USER_ALL_INFORMATION { - LARGE_INTEGER LastLogon; - LARGE_INTEGER LastLogoff; - LARGE_INTEGER PasswordLastSet; - LARGE_INTEGER AccountExpires; - LARGE_INTEGER PasswordCanChange; - LARGE_INTEGER PasswordMustChange; - UNICODE_STRING UserName; - UNICODE_STRING FullName; - UNICODE_STRING HomeDirectory; - UNICODE_STRING HomeDirectoryDrive; - UNICODE_STRING ScriptPath; - UNICODE_STRING ProfilePath; - UNICODE_STRING AdminComment; - UNICODE_STRING WorkStations; - UNICODE_STRING UserComment; - UNICODE_STRING Parameters; - UNICODE_STRING LmPassword; - UNICODE_STRING NtPassword; - UNICODE_STRING PrivateData; - SR_SECURITY_DESCRIPTOR SecurityDescriptor; - ULONG UserId; - ULONG PrimaryGroupId; - ULONG UserAccountControl; - ULONG WhichFields; - LOGON_HOURS LogonHours; - USHORT BadPasswordCount; - USHORT LogonCount; - USHORT CountryCode; - USHORT CodePage; - BOOLEAN LmPasswordPresent; - BOOLEAN NtPasswordPresent; - BOOLEAN PasswordExpired; - BOOLEAN PrivateDataSensitive; -} USER_ALL_INFORMATION, *PUSER_ALL_INFORMATION; -#include "poppack.h" -#define _NTSAM_USER_ALL_INFO_ -#endif -// end_ntsubauth - -// -// Bits to be used in UserAllInformation's WhichFields field (to indicate -// which items were queried or set). -// - -#define USER_ALL_USERNAME 0x00000001 -#define USER_ALL_FULLNAME 0x00000002 -#define USER_ALL_USERID 0x00000004 -#define USER_ALL_PRIMARYGROUPID 0x00000008 -#define USER_ALL_ADMINCOMMENT 0x00000010 -#define USER_ALL_USERCOMMENT 0x00000020 -#define USER_ALL_HOMEDIRECTORY 0x00000040 -#define USER_ALL_HOMEDIRECTORYDRIVE 0x00000080 -#define USER_ALL_SCRIPTPATH 0x00000100 -#define USER_ALL_PROFILEPATH 0x00000200 -#define USER_ALL_WORKSTATIONS 0x00000400 -#define USER_ALL_LASTLOGON 0x00000800 -#define USER_ALL_LASTLOGOFF 0x00001000 -#define USER_ALL_LOGONHOURS 0x00002000 -#define USER_ALL_BADPASSWORDCOUNT 0x00004000 -#define USER_ALL_LOGONCOUNT 0x00008000 -#define USER_ALL_PASSWORDCANCHANGE 0x00010000 -#define USER_ALL_PASSWORDMUSTCHANGE 0x00020000 -#define USER_ALL_PASSWORDLASTSET 0x00040000 -#define USER_ALL_ACCOUNTEXPIRES 0x00080000 -#define USER_ALL_USERACCOUNTCONTROL 0x00100000 -#ifndef _NTSAM_SAM_USER_PARMS_ // ntsubauth -#define USER_ALL_PARAMETERS 0x00200000 // ntsubauth -#define _NTSAM_SAM_USER_PARMS_ // ntsubauth -#endif // ntsubauth -#define USER_ALL_COUNTRYCODE 0x00400000 -#define USER_ALL_CODEPAGE 0x00800000 -#define USER_ALL_NTPASSWORDPRESENT 0x01000000 // field AND boolean -#define USER_ALL_LMPASSWORDPRESENT 0x02000000 // field AND boolean -#define USER_ALL_PRIVATEDATA 0x04000000 // field AND boolean -#define USER_ALL_PASSWORDEXPIRED 0x08000000 -#define USER_ALL_SECURITYDESCRIPTOR 0x10000000 -#define USER_ALL_OWFPASSWORD 0x20000000 // boolean - -#define USER_ALL_UNDEFINED_MASK 0xC0000000 - -// -// Now define masks for fields that are accessed for read by the same -// access type. -// -// Fields that require READ_GENERAL access to read. -// - -#define USER_ALL_READ_GENERAL_MASK (USER_ALL_USERNAME | \ - USER_ALL_FULLNAME | \ - USER_ALL_USERID | \ - USER_ALL_PRIMARYGROUPID | \ - USER_ALL_ADMINCOMMENT | \ - USER_ALL_USERCOMMENT) - -// -// Fields that require READ_LOGON access to read. -// - -#define USER_ALL_READ_LOGON_MASK (USER_ALL_HOMEDIRECTORY | \ - USER_ALL_HOMEDIRECTORYDRIVE | \ - USER_ALL_SCRIPTPATH | \ - USER_ALL_PROFILEPATH | \ - USER_ALL_WORKSTATIONS | \ - USER_ALL_LASTLOGON | \ - USER_ALL_LASTLOGOFF | \ - USER_ALL_LOGONHOURS | \ - USER_ALL_BADPASSWORDCOUNT | \ - USER_ALL_LOGONCOUNT | \ - USER_ALL_PASSWORDCANCHANGE | \ - USER_ALL_PASSWORDMUSTCHANGE) - -// -// Fields that require READ_ACCOUNT access to read. -// - -#define USER_ALL_READ_ACCOUNT_MASK (USER_ALL_PASSWORDLASTSET | \ - USER_ALL_ACCOUNTEXPIRES | \ - USER_ALL_USERACCOUNTCONTROL | \ - USER_ALL_PARAMETERS) - -// -// Fields that require READ_PREFERENCES access to read. -// - -#define USER_ALL_READ_PREFERENCES_MASK (USER_ALL_COUNTRYCODE | \ - USER_ALL_CODEPAGE) - -// -// Fields that can only be read by trusted clients. -// - -#define USER_ALL_READ_TRUSTED_MASK (USER_ALL_NTPASSWORDPRESENT | \ - USER_ALL_LMPASSWORDPRESENT | \ - USER_ALL_PASSWORDEXPIRED | \ - USER_ALL_SECURITYDESCRIPTOR | \ - USER_ALL_PRIVATEDATA) - -// -// Fields that can't be read. -// - -#define USER_ALL_READ_CANT_MASK USER_ALL_UNDEFINED_MASK - - -// -// Now define masks for fields that are accessed for write by the same -// access type. -// -// Fields that require WRITE_ACCOUNT access to write. -// - -#define USER_ALL_WRITE_ACCOUNT_MASK (USER_ALL_USERNAME | \ - USER_ALL_FULLNAME | \ - USER_ALL_PRIMARYGROUPID | \ - USER_ALL_HOMEDIRECTORY | \ - USER_ALL_HOMEDIRECTORYDRIVE | \ - USER_ALL_SCRIPTPATH | \ - USER_ALL_PROFILEPATH | \ - USER_ALL_ADMINCOMMENT | \ - USER_ALL_WORKSTATIONS | \ - USER_ALL_LOGONHOURS | \ - USER_ALL_ACCOUNTEXPIRES | \ - USER_ALL_USERACCOUNTCONTROL | \ - USER_ALL_PARAMETERS) - -// -// Fields that require WRITE_PREFERENCES access to write. -// - -#define USER_ALL_WRITE_PREFERENCES_MASK (USER_ALL_USERCOMMENT | \ - USER_ALL_COUNTRYCODE | \ - USER_ALL_CODEPAGE) - -// -// Fields that require FORCE_PASSWORD_CHANGE access to write. -// -// Note that non-trusted clients only set the NT password as a -// UNICODE string. The wrapper will convert it to an LM password, -// OWF and encrypt both versions. Trusted clients can pass in OWF -// versions of either or both. -// - -#define USER_ALL_WRITE_FORCE_PASSWORD_CHANGE_MASK \ - (USER_ALL_NTPASSWORDPRESENT | \ - USER_ALL_LMPASSWORDPRESENT | \ - USER_ALL_PASSWORDEXPIRED) - -// -// Fields that can only be written by trusted clients. -// - -#define USER_ALL_WRITE_TRUSTED_MASK (USER_ALL_LASTLOGON | \ - USER_ALL_LASTLOGOFF | \ - USER_ALL_BADPASSWORDCOUNT | \ - USER_ALL_LOGONCOUNT | \ - USER_ALL_PASSWORDLASTSET | \ - USER_ALL_SECURITYDESCRIPTOR | \ - USER_ALL_PRIVATEDATA) - -// -// Fields that can't be written. -// - -#define USER_ALL_WRITE_CANT_MASK (USER_ALL_USERID | \ - USER_ALL_PASSWORDCANCHANGE | \ - USER_ALL_PASSWORDMUSTCHANGE | \ - USER_ALL_UNDEFINED_MASK) - - -typedef struct _USER_GENERAL_INFORMATION { - UNICODE_STRING UserName; - UNICODE_STRING FullName; - ULONG PrimaryGroupId; - UNICODE_STRING AdminComment; - UNICODE_STRING UserComment; -} USER_GENERAL_INFORMATION, *PUSER_GENERAL_INFORMATION; - -typedef struct _USER_PREFERENCES_INFORMATION { - UNICODE_STRING UserComment; - UNICODE_STRING Reserved1; - USHORT CountryCode; - USHORT CodePage; -} USER_PREFERENCES_INFORMATION, *PUSER_PREFERENCES_INFORMATION; - -typedef struct _USER_PARAMETERS_INFORMATION { - UNICODE_STRING Parameters; -} USER_PARAMETERS_INFORMATION, *PUSER_PARAMETERS_INFORMATION; - -#include "pshpack4.h" -typedef struct _USER_LOGON_INFORMATION { - UNICODE_STRING UserName; - UNICODE_STRING FullName; - ULONG UserId; - ULONG PrimaryGroupId; - UNICODE_STRING HomeDirectory; - UNICODE_STRING HomeDirectoryDrive; - UNICODE_STRING ScriptPath; - UNICODE_STRING ProfilePath; - UNICODE_STRING WorkStations; - LARGE_INTEGER LastLogon; - LARGE_INTEGER LastLogoff; - LARGE_INTEGER PasswordLastSet; - LARGE_INTEGER PasswordCanChange; - LARGE_INTEGER PasswordMustChange; - LOGON_HOURS LogonHours; - USHORT BadPasswordCount; - USHORT LogonCount; - ULONG UserAccountControl; -} USER_LOGON_INFORMATION, *PUSER_LOGON_INFORMATION; -#include "poppack.h" - -#include "pshpack4.h" -typedef struct _USER_ACCOUNT_INFORMATION { - UNICODE_STRING UserName; - UNICODE_STRING FullName; - ULONG UserId; - ULONG PrimaryGroupId; - UNICODE_STRING HomeDirectory; - UNICODE_STRING HomeDirectoryDrive; - UNICODE_STRING ScriptPath; - UNICODE_STRING ProfilePath; - UNICODE_STRING AdminComment; - UNICODE_STRING WorkStations; - LARGE_INTEGER LastLogon; - LARGE_INTEGER LastLogoff; - LOGON_HOURS LogonHours; - USHORT BadPasswordCount; - USHORT LogonCount; - LARGE_INTEGER PasswordLastSet; - LARGE_INTEGER AccountExpires; - ULONG UserAccountControl; -} USER_ACCOUNT_INFORMATION, *PUSER_ACCOUNT_INFORMATION; -#include "poppack.h" - -typedef struct _USER_ACCOUNT_NAME_INFORMATION { - UNICODE_STRING UserName; -} USER_ACCOUNT_NAME_INFORMATION, *PUSER_ACCOUNT_NAME_INFORMATION; - -typedef struct _USER_FULL_NAME_INFORMATION { - UNICODE_STRING FullName; -} USER_FULL_NAME_INFORMATION, *PUSER_FULL_NAME_INFORMATION; - -typedef struct _USER_NAME_INFORMATION { - UNICODE_STRING UserName; - UNICODE_STRING FullName; -} USER_NAME_INFORMATION, *PUSER_NAME_INFORMATION; - -typedef struct _USER_PRIMARY_GROUP_INFORMATION { - ULONG PrimaryGroupId; -} USER_PRIMARY_GROUP_INFORMATION, *PUSER_PRIMARY_GROUP_INFORMATION; - -typedef struct _USER_HOME_INFORMATION { - UNICODE_STRING HomeDirectory; - UNICODE_STRING HomeDirectoryDrive; -} USER_HOME_INFORMATION, *PUSER_HOME_INFORMATION; - -typedef struct _USER_SCRIPT_INFORMATION { - UNICODE_STRING ScriptPath; -} USER_SCRIPT_INFORMATION, *PUSER_SCRIPT_INFORMATION; - -typedef struct _USER_PROFILE_INFORMATION { - UNICODE_STRING ProfilePath; -} USER_PROFILE_INFORMATION, *PUSER_PROFILE_INFORMATION; - -typedef struct _USER_ADMIN_COMMENT_INFORMATION { - UNICODE_STRING AdminComment; -} USER_ADMIN_COMMENT_INFORMATION, *PUSER_ADMIN_COMMENT_INFORMATION; - -typedef struct _USER_WORKSTATIONS_INFORMATION { - UNICODE_STRING WorkStations; -} USER_WORKSTATIONS_INFORMATION, *PUSER_WORKSTATIONS_INFORMATION; - -typedef struct _USER_SET_PASSWORD_INFORMATION { - UNICODE_STRING Password; - BOOLEAN PasswordExpired; -} USER_SET_PASSWORD_INFORMATION, *PUSER_SET_PASSWORD_INFORMATION; - -typedef struct _USER_CONTROL_INFORMATION { - ULONG UserAccountControl; -} USER_CONTROL_INFORMATION, *PUSER_CONTROL_INFORMATION; - -typedef struct _USER_EXPIRES_INFORMATION { -#if defined(MIDL_PASS) - OLD_LARGE_INTEGER AccountExpires; -#else - LARGE_INTEGER AccountExpires; -#endif -} USER_EXPIRES_INFORMATION, *PUSER_EXPIRES_INFORMATION; - -typedef struct _USER_LOGON_HOURS_INFORMATION { - LOGON_HOURS LogonHours; -} USER_LOGON_HOURS_INFORMATION, *PUSER_LOGON_HOURS_INFORMATION; - -typedef SAM_BYTE_ARRAY_32K SAM_USER_TILE, *PSAM_USER_TILE; - -// 0xFF000FFF is reserved for internal callers and implementation - -#define USER_EXTENDED_FIELD_USER_TILE (0x00001000L) -#define USER_EXTENDED_FIELD_PASSWORD_HINT (0x00002000L) -#define USER_EXTENDED_FIELD_DONT_SHOW_IN_LOGON_UI (0x00004000L) -#define USER_EXTENDED_FIELD_SHELL_ADMIN_OBJECT_PROPERTIES (0x00008000L) - -typedef struct _USER_EXTENDED_INFORMATION { - - ULONG ExtendedWhichFields; - SAM_USER_TILE UserTile; - UNICODE_STRING PasswordHint; - BOOLEAN DontShowInLogonUI; - SAM_SHELL_OBJECT_PROPERTIES ShellAdminObjectProperties; - -} USER_EXTENDED_INFORMATION, *PUSER_EXTENDED_INFORMATION; - -// For local callers only -typedef struct _USER_LOGON_UI_INFORMATION { - - BOOLEAN PasswordIsBlank; - BOOLEAN AccountIsDisabled; - -} USER_LOGON_UI_INFORMATION, *PUSER_LOGON_UI_INFORMATION; - -/////////////////////////////////////////////////////////////////////////// -// // -// Data type used by SamChangePasswordUser3 for better error // -// reporting of password change change failures // -// // -// The field definitions are as follows: // -// // -// ExtendedFailureReason -- Indicates the reason // -// why the new password was not // -// accepted // -// // -// FilterModuleName -- If the password change was failed // -// by a password filter , the name of // -// of the filter DLL is returned in // -// here // -// // -// The following error codes are defined // -// // -// SAM_PWD_CHANGE_NO_ERROR // -// No error, cannot be returned alongwith a failure code for // -// password change // -// // -// SAM_PWD_CHANGE_PASSWORD_TOO_SHORT // -// // -// Supplied password did not meet password length policy // -// // -// SAM_PWD_CHANGE_PWD_IN_HISTORY // -// // -// History restrictions were not met // -// // -// SAM_PWD_CHANGE_USERNAME_IN_PASSWORD // -// Complexity check could not be met because the user // -// name was part of the password // -// // -// SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD // -// // -// Complexity check could not be met because the user's // -// full name was part of the password // -// // -// SAM_PWD_CHANGE_MACHINE_PASSWORD_NOT_DEFAULT // -// // -// The domain has the refuse password change setting // -// enabled. This disallows machine accounts from having // -// anything other than the default password // -// // -// SAM_PWD_CHANGE_FAILED_BY_FILTER // -// // -// The supplied new password failed by a password filter // -// the name of the filter DLL is indicated // -// // -// // -/////////////////////////////////////////////////////////////////////////// - -typedef struct _USER_PWD_CHANGE_FAILURE_INFORMATION { - ULONG ExtendedFailureReason; - UNICODE_STRING FilterModuleName; -} USER_PWD_CHANGE_FAILURE_INFORMATION,*PUSER_PWD_CHANGE_FAILURE_INFORMATION; - -// -// Currently defined values for ExtendedFailureReason are as follows -// - - -#define SAM_PWD_CHANGE_NO_ERROR 0 -#define SAM_PWD_CHANGE_PASSWORD_TOO_SHORT 1 -#define SAM_PWD_CHANGE_PWD_IN_HISTORY 2 -#define SAM_PWD_CHANGE_USERNAME_IN_PASSWORD 3 -#define SAM_PWD_CHANGE_FULLNAME_IN_PASSWORD 4 -#define SAM_PWD_CHANGE_NOT_COMPLEX 5 -#define SAM_PWD_CHANGE_MACHINE_PASSWORD_NOT_DEFAULT 6 -#define SAM_PWD_CHANGE_FAILED_BY_FILTER 7 -#define SAM_PWD_CHANGE_PASSWORD_TOO_LONG 8 -#define SAM_PWD_CHANGE_FAILURE_REASON_MAX 8 - - -///////////////////////////////////////////////////////////////////////////// -// // -// Data types used by SAM and Netlogon for database replication // -// // -///////////////////////////////////////////////////////////////////////////// - - -typedef enum _SECURITY_DB_DELTA_TYPE { - SecurityDbNew = 1, - SecurityDbRename, - SecurityDbDelete, - SecurityDbChangeMemberAdd, - SecurityDbChangeMemberSet, - SecurityDbChangeMemberDel, - SecurityDbChange, - SecurityDbChangePassword -} SECURITY_DB_DELTA_TYPE, *PSECURITY_DB_DELTA_TYPE; - -typedef enum _SECURITY_DB_OBJECT_TYPE { - SecurityDbObjectSamDomain = 1, - SecurityDbObjectSamUser, - SecurityDbObjectSamGroup, - SecurityDbObjectSamAlias, - SecurityDbObjectLsaPolicy, - SecurityDbObjectLsaTDomain, - SecurityDbObjectLsaAccount, - SecurityDbObjectLsaSecret -} SECURITY_DB_OBJECT_TYPE, *PSECURITY_DB_OBJECT_TYPE; - -// -// Account types -// -// Both enumerated types and flag definitions are provided. -// The flag definitions are used in places where more than -// one type of account may be specified together. -// - -typedef enum _SAM_ACCOUNT_TYPE { - SamObjectUser = 1, - SamObjectGroup , - SamObjectAlias -} SAM_ACCOUNT_TYPE, *PSAM_ACCOUNT_TYPE; - - -#define SAM_USER_ACCOUNT (0x00000001) -#define SAM_GLOBAL_GROUP_ACCOUNT (0x00000002) -#define SAM_LOCAL_GROUP_ACCOUNT (0x00000004) - - - -// -// Define the data type used to pass netlogon information on the account -// that was added or deleted from a group. -// - -typedef struct _SAM_GROUP_MEMBER_ID { - ULONG MemberRid; -} SAM_GROUP_MEMBER_ID, *PSAM_GROUP_MEMBER_ID; - - -// -// Define the data type used to pass netlogon information on the account -// that was added or deleted from an alias. -// - -typedef struct _SAM_ALIAS_MEMBER_ID { - PSID MemberSid; -} SAM_ALIAS_MEMBER_ID, *PSAM_ALIAS_MEMBER_ID; - - - - -// -// Define the data type used to pass netlogon information on a delta -// - -typedef union _SAM_DELTA_DATA { - - // - // Delta type ChangeMember{Add/Del/Set} and account type group - // - - SAM_GROUP_MEMBER_ID GroupMemberId; - - // - // Delta type ChangeMember{Add/Del/Set} and account type alias - // - - SAM_ALIAS_MEMBER_ID AliasMemberId; - - // - // Delta type AddOrChange and account type User - // - - ULONG AccountControl; - -} SAM_DELTA_DATA, *PSAM_DELTA_DATA; - - -// -// Prototype for delta notification routine. -// - -typedef NTSTATUS (*PSAM_DELTA_NOTIFICATION_ROUTINE) ( - __in PSID DomainSid, - __in SECURITY_DB_DELTA_TYPE DeltaType, - __in SECURITY_DB_OBJECT_TYPE ObjectType, - __in ULONG ObjectRid, - __in_opt PUNICODE_STRING ObjectName, - __in PLARGE_INTEGER ModifiedCount, - __in_opt PSAM_DELTA_DATA DeltaData - ); - -#define SAM_DELTA_NOTIFY_ROUTINE "DeltaNotify" - - -////////////////////////////////////////////////////////////////// -// // -// Structure and ProtoType for RAS User Parameters // -// // -////////////////////////////////////////////////////////////////// - -// Flags used by SAM UserParms Migration -// indicate UserParmsConvert is called during upgrade. - -#define SAM_USERPARMS_DURING_UPGRADE 0x00000001 - - -typedef struct _SAM_USERPARMS_ATTRVALS { - ULONG length; // length of the attribute. - __field_bcount(length) PVOID value; // pointer to the value. -} SAM_USERPARMS_ATTRVALS, *PSAM_USERPARMS_ATTRVALS; // describes one value of the attribute. - - -typedef enum _SAM_USERPARMS_ATTRSYNTAX { - Syntax_Attribute = 1, - Syntax_EncryptedAttribute -} SAM_USERPARMS_ATTRSYNTAX; // indicates whether attributes are encrypted or not. - - -typedef struct _SAM_USERPARMS_ATTR { - UNICODE_STRING AttributeIdentifier; // This will be the LDAP display name of the attribute. - // SAM will perform the translation to attribute ID. - // unless the specified syntax is type EncryptedAttribute, - // in which case it is packaged as part of supplemental - // credentials blob and the name identifes the package name. - // Encrypted attribute will be supplied in the clear ie decrypted. - SAM_USERPARMS_ATTRSYNTAX Syntax; - ULONG CountOfValues; // The count of values in the attribute. - __ecount(CountOfValues) SAM_USERPARMS_ATTRVALS * Values; - // pointer to an array of values representing the data - // values of the attribute. -} SAM_USERPARMS_ATTR, *PSAM_USERPARMS_ATTR; // describes an attribute and the set of values associated with it. - - -typedef struct _SAM_USERPARMS_ATTRBLOCK { - ULONG attCount; - __ecount(attCount) SAM_USERPARMS_ATTR * UserParmsAttr; -} SAM_USERPARMS_ATTRBLOCK, *PSAM_USERPARMS_ATTRBLOCK; // describes an array of attributes - - -typedef NTSTATUS (*PSAM_USERPARMS_CONVERT_NOTIFICATION_ROUTINE) ( - __in ULONG Flags, - __in PSID DomainSid, - __in ULONG ObjectRid, // identifies the object - __in ULONG UserParmsLengthOrig, - __in_bcount(UserParmsLengthOrig) PVOID UserParmsOrig, - __in ULONG UserParmsLengthNew, - __in_bcount(UserParmsLengthNew) PVOID UserParmsNew, - __deref_out PSAM_USERPARMS_ATTRBLOCK * UserParmsAttrBlock -); - -#define SAM_USERPARMS_CONVERT_NOTIFICATION_ROUTINE "UserParmsConvert" - - -typedef VOID (*PSAM_USERPARMS_ATTRBLOCK_FREE_ROUTINE) ( - IN PSAM_USERPARMS_ATTRBLOCK UserParmsAttrBlock -); - -#define SAM_USERPARMS_ATTRBLOCK_FREE_ROUTINE "UserParmsFree" - - -////////////////////////////////////////////////////////////////// -// // -// Return Values for Compatiblity Mode // -// // -////////////////////////////////////////////////////////////////// - -// All SAM attributes are accessible -#define SAM_SID_COMPATIBILITY_ALL 0 - -// Rid field can be returned to caller as 0 -// No writes to PrimaryGroupId allowed -#define SAM_SID_COMPATIBILITY_LAX 1 - -// NET API Information levels that ask for RID are to failed -// No writes to PrimaryGroupId allowed -#define SAM_SID_COMPATIBILITY_STRICT 2 - - -// -// ************************************* -// -// Internal Password Checking API structures -// -// ************************************* -// - -// -// What kind of password checking is to be performed? -// SamValidateAuthentication : Check if the authentication can be done -// SamValidatePasswordChange: Check if the password can be changed -// SamValidatePasswordReset: Reset the password to the given value -// -typedef enum _PASSWORD_POLICY_VALIDATION_TYPE{ - SamValidateAuthentication = 1, - SamValidatePasswordChange, - SamValidatePasswordReset -} PASSWORD_POLICY_VALIDATION_TYPE; - -// -// Structure to keep the password hash -// -typedef struct _SAM_VALIDATE_PASSWORD_HASH{ - ULONG Length; -#ifdef MIDL_PASS - [unique,size_is(Length)] -#endif - PUCHAR Hash; -} SAM_VALIDATE_PASSWORD_HASH, *PSAM_VALIDATE_PASSWORD_HASH; - - -// To be used with PresentFields member of SAM_VALIDATE_PERSISTED_FIELDS -#define SAM_VALIDATE_PASSWORD_LAST_SET 0x00000001 -#define SAM_VALIDATE_BAD_PASSWORD_TIME 0x00000002 -#define SAM_VALIDATE_LOCKOUT_TIME 0x00000004 -#define SAM_VALIDATE_BAD_PASSWORD_COUNT 0x00000008 -#define SAM_VALIDATE_PASSWORD_HISTORY_LENGTH 0x00000010 -#define SAM_VALIDATE_PASSWORD_HISTORY 0x00000020 - -// -// Structure to keep information about the password and related things. -// Present Fields: (used only in output args) which fields are changed. -// See the constants above. -// PasswordLastSet: When the password is last set. -// BadPasswordTime: When the password was incorrect for the last time. -// LockoutTime: When the account is locked out. If the account is not locked out -// it is 0. -// BadPasswordCount: How many times the password has given incorrectly in the -// Observation Window. -// PasswordHistoryLength: How many passwords are kept in the history -// PasswordHistory: Password hashes that are in the history -// -typedef struct _SAM_VALIDATE_PERSISTED_FIELDS{ - ULONG PresentFields; - LARGE_INTEGER PasswordLastSet; - LARGE_INTEGER BadPasswordTime; - LARGE_INTEGER LockoutTime; - ULONG BadPasswordCount; - ULONG PasswordHistoryLength; -#ifdef MIDL_PASS - [unique,size_is(PasswordHistoryLength)] -#endif - PSAM_VALIDATE_PASSWORD_HASH PasswordHistory; -} SAM_VALIDATE_PERSISTED_FIELDS, *PSAM_VALIDATE_PERSISTED_FIELDS; - -// -// Validation Status of the password check: -// Names are self-explaining so I think there is no need to explain them here. -// -typedef enum _SAM_VALIDATE_VALIDATION_STATUS{ - SamValidateSuccess = 0, - SamValidatePasswordMustChange, - SamValidateAccountLockedOut, - SamValidatePasswordExpired, - SamValidatePasswordIncorrect, - SamValidatePasswordIsInHistory, - SamValidatePasswordTooShort, - SamValidatePasswordTooLong, - SamValidatePasswordNotComplexEnough, - SamValidatePasswordTooRecent, - SamValidatePasswordFilterError -}SAM_VALIDATE_VALIDATION_STATUS, *PSAM_VALIDATE_VALIDATION_STATUS; - -// -// Output Arg -// ChangedPersistedFields: Any changes to the password related info -// ValidationStatus: Shows the result of the request -// -typedef struct _SAM_VALIDATE_STANDARD_OUTPUT_ARG{ - SAM_VALIDATE_PERSISTED_FIELDS ChangedPersistedFields; - SAM_VALIDATE_VALIDATION_STATUS ValidationStatus; -} SAM_VALIDATE_STANDARD_OUTPUT_ARG, *PSAM_VALIDATE_STANDARD_OUTPUT_ARG; - -// -// If authentication type of password check is to be made, -// this kind of input must be used -// -// InputPersistedFields: Information about the account to be logged into -// PasswordMatched: Indicates the result of the application's authentication of the supplied password - -typedef struct _SAM_VALIDATE_AUTHENTICATION_INPUT_ARG{ - SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; - BOOLEAN PasswordMatched; // indicates the result of the application's authentication of the supplied password -} SAM_VALIDATE_AUTHENTICATION_INPUT_ARG, *PSAM_VALIDATE_AUTHENTICATION_INPUT_ARG; - -// -// If password change type of check is to be made, -// this kind of input must be used -// -// InputPersistedFields: Information about the account to be logged into -// ClearPassword: The string which password is going to be -// UserAccountName: Name of the user account -// HashedPassword: Hash of the string that the password is going to be -// PasswordMatch: denotes if the old password supplied by user matched or not -// -typedef struct _SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG{ - SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; - UNICODE_STRING ClearPassword; - UNICODE_STRING UserAccountName; - SAM_VALIDATE_PASSWORD_HASH HashedPassword; - BOOLEAN PasswordMatch; // denotes if the old password supplied by user matched or not. -} SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG; - -// -// If password reset type of check is to be made, -// this kind of input must be used -// -// InputPersistedFields: Information about the account to be logged into -// ClearPassword: The string which password is going to be -// UserAccountName: Name of the user account -// HashedPassword: Hash of the string that the password is going to be -// PasswordMustChangeAtNextLogon: Password must change for the user to be logged in -// ClearLockout: If the account was locked out, this field can be used to clear lockout -// -typedef struct _SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG{ - SAM_VALIDATE_PERSISTED_FIELDS InputPersistedFields; - UNICODE_STRING ClearPassword; - UNICODE_STRING UserAccountName; - SAM_VALIDATE_PASSWORD_HASH HashedPassword; - BOOLEAN PasswordMustChangeAtNextLogon; // looked at only for password reset - BOOLEAN ClearLockout; // can be used clear user account lockout -- -}SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG, *PSAM_VALIDATE_PASSWORD_RESET_INPUT_ARG; - - -// -// A union to encapsulate all kinds of inputs -// -typedef -#ifdef MIDL_PASS - [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] -#endif - union _SAM_VALIDATE_INPUT_ARG{ -#ifdef MIDL_PASS - [case(SamValidateAuthentication)] -#endif - SAM_VALIDATE_AUTHENTICATION_INPUT_ARG ValidateAuthenticationInput; -#ifdef MIDL_PASS - [case(SamValidatePasswordChange)] -#endif - SAM_VALIDATE_PASSWORD_CHANGE_INPUT_ARG ValidatePasswordChangeInput; -#ifdef MIDL_PASS - [case(SamValidatePasswordReset)] -#endif - SAM_VALIDATE_PASSWORD_RESET_INPUT_ARG ValidatePasswordResetInput; -} SAM_VALIDATE_INPUT_ARG, *PSAM_VALIDATE_INPUT_ARG; - -// -// A union to encapsulate all kinds of outputs -// Actually, currently there is only one type of output, -// but this can be used when there is a need for another -// type of output. -// -typedef -#ifdef MIDL_PASS - [switch_type(PASSWORD_POLICY_VALIDATION_TYPE)] -#endif - union _SAM_VALIDATE_OUTPUT_ARG{ -#ifdef MIDL_PASS - [case(SamValidateAuthentication)] -#endif - SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidateAuthenticationOutput; -#ifdef MIDL_PASS - [case(SamValidatePasswordChange)] -#endif - SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordChangeOutput; -#ifdef MIDL_PASS - [case(SamValidatePasswordReset)] -#endif - SAM_VALIDATE_STANDARD_OUTPUT_ARG ValidatePasswordResetOutput; -} SAM_VALIDATE_OUTPUT_ARG, *PSAM_VALIDATE_OUTPUT_ARG; - -// -// Internal Password Checking API structures end here! -// - -// -// Generic operation API structures start here -// - -typedef enum _SAM_GENERIC_OPERATION_TYPE { - - SamObjectChangeNotificationOperation, - -} SAM_GENERIC_OPERATION_TYPE, *PSAM_GENERIC_OPERATION_TYPE; - -typedef struct _SAM_OPERATION_OBJCHG_INPUT { - - BOOLEAN Register; - ULONG64 EventHandle; - SECURITY_DB_OBJECT_TYPE ObjectType; - ULONG ProcessID; - -} SAM_OPERATION_OBJCHG_INPUT, *PSAM_OPERATION_OBJCHG_INPUT; - -typedef struct _SAM_OPERATION_OBJCHG_OUTPUT { - - ULONG Reserved; - -} SAM_OPERATION_OBJCHG_OUTPUT, *PSAM_OPERATION_OBJCHG_OUTPUT; - -typedef SWITCH_TYPE( SAM_GENERIC_OPERATION_TYPE ) union _SAM_GENERIC_OPERATION_INPUT { - - CASE( SamObjectChangeNotificationOperation ) SAM_OPERATION_OBJCHG_INPUT ObjChangeIn; - -} SAM_GENERIC_OPERATION_INPUT, *PSAM_GENERIC_OPERATION_INPUT; - -typedef SWITCH_TYPE( SAM_GENERIC_OPERATION_TYPE ) union _SAM_GENERIC_OPERATION_OUTPUT { - - CASE( SamObjectChangeNotificationOperation ) SAM_OPERATION_OBJCHG_OUTPUT ObjChangeOut; - -} SAM_GENERIC_OPERATION_OUTPUT, *PSAM_GENERIC_OPERATION_OUTPUT; - -// -// Generic operation API structures end here -// - - -/////////////////////////////////////////////////////////////////////////////// -// // -// APIs Exported By SAM // -// // -/////////////////////////////////////////////////////////////////////////////// - - -NTSTATUS -SamFreeMemory( - __in PVOID Buffer - ); - - -__checkReturn -NTSTATUS -SamSetSecurityObject( - __in SAM_HANDLE ObjectHandle, - __in SECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -__checkReturn -NTSTATUS -SamQuerySecurityObject( - __in SAM_HANDLE ObjectHandle, - __in SECURITY_INFORMATION SecurityInformation, - __deref_out PSECURITY_DESCRIPTOR *SecurityDescriptor - ); - -NTSTATUS -SamCloseHandle( - __in SAM_HANDLE SamHandle - ); - -__checkReturn -NTSTATUS -SamConnect( - __in_opt PUNICODE_STRING ServerName, - __out PSAM_HANDLE ServerHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); - -__checkReturn -NTSTATUS -SamShutdownSamServer( - __in SAM_HANDLE ServerHandle - ); - -__checkReturn -NTSTATUS -SamLookupDomainInSamServer( - __in SAM_HANDLE ServerHandle, - __in PUNICODE_STRING Name, - __deref_out PSID * DomainId - ); - -__checkReturn -NTSTATUS -SamEnumerateDomainsInSamServer( - __in SAM_HANDLE ServerHandle, - __inout PSAM_ENUMERATE_HANDLE EnumerationContext, - __deref_out PVOID *Buffer, - __in ULONG PreferedMaximumLength, - __out PULONG CountReturned - ); - -__checkReturn -NTSTATUS -SamOpenDomain( - __in SAM_HANDLE ServerHandle, - __in ACCESS_MASK DesiredAccess, - __in PSID DomainId, - __out PSAM_HANDLE DomainHandle - ); - -__checkReturn -NTSTATUS -SamQueryInformationDomain( - __in SAM_HANDLE DomainHandle, - __in DOMAIN_INFORMATION_CLASS DomainInformationClass, - __deref_out PVOID *Buffer - ); - -__checkReturn -NTSTATUS -SamSetInformationDomain( - __in SAM_HANDLE DomainHandle, - __in DOMAIN_INFORMATION_CLASS DomainInformationClass, - __in PVOID DomainInformation - ); - -__checkReturn -NTSTATUS -SamCreateGroupInDomain( - __in SAM_HANDLE DomainHandle, - __in PUNICODE_STRING AccountName, - __in ACCESS_MASK DesiredAccess, - __out PSAM_HANDLE GroupHandle, - __out PULONG RelativeId - ); - - -__checkReturn -NTSTATUS -SamEnumerateGroupsInDomain( - __in SAM_HANDLE DomainHandle, - __inout PSAM_ENUMERATE_HANDLE EnumerationContext, - __deref_out PVOID *Buffer, - __in ULONG PreferedMaximumLength, - __out PULONG CountReturned - ); - -__checkReturn -NTSTATUS -SamCreateUser2InDomain( - __in SAM_HANDLE DomainHandle, - __in PUNICODE_STRING AccountName, - __in ULONG AccountType, - __in ACCESS_MASK DesiredAccess, - __out PSAM_HANDLE UserHandle, - __out PULONG GrantedAccess, - __out PULONG RelativeId - ); - -__checkReturn -NTSTATUS -SamCreateUserInDomain( - __in SAM_HANDLE DomainHandle, - __in PUNICODE_STRING AccountName, - __in ACCESS_MASK DesiredAccess, - __out PSAM_HANDLE UserHandle, - __out PULONG RelativeId - ); - -__checkReturn -NTSTATUS -SamEnumerateUsersInDomain( - __in SAM_HANDLE DomainHandle, - __inout PSAM_ENUMERATE_HANDLE EnumerationContext, - __in ULONG UserAccountControl, - __deref_out PVOID *Buffer, - __in ULONG PreferedMaximumLength, - __out PULONG CountReturned - ); - -__checkReturn -NTSTATUS -SamCreateAliasInDomain( - __in SAM_HANDLE DomainHandle, - __in PUNICODE_STRING AccountName, - __in ACCESS_MASK DesiredAccess, - __out PSAM_HANDLE AliasHandle, - __out PULONG RelativeId - ); - -__checkReturn -NTSTATUS -SamEnumerateAliasesInDomain( - __in SAM_HANDLE DomainHandle, - __inout PSAM_ENUMERATE_HANDLE EnumerationContext, - __deref_out PVOID *Buffer, - __in ULONG PreferedMaximumLength, - __out PULONG CountReturned - ); - -__checkReturn -NTSTATUS -SamGetAliasMembership( - __in SAM_HANDLE DomainHandle, - __in ULONG PassedCount, - __in_ecount(PassedCount) PSID *Sids, - __out PULONG MembershipCount, - __deref_out_ecount(*MembershipCount) PULONG *Aliases - ); - -__checkReturn -NTSTATUS -SamLookupNamesInDomain( - __in SAM_HANDLE DomainHandle, - __in ULONG Count, - __in_ecount(Count) PUNICODE_STRING Names, - __deref_out_ecount(Count) PULONG *RelativeIds, - __deref_out_ecount(Count) PSID_NAME_USE *Use - ); - -__checkReturn -NTSTATUS -SamLookupIdsInDomain( - __in SAM_HANDLE DomainHandle, - __in ULONG Count, - __in_ecount(Count) PULONG RelativeIds, - __deref_out_ecount(Count) PUNICODE_STRING *Names, - __deref_opt_out_ecount(Count) PSID_NAME_USE *Use - ); - -__checkReturn -NTSTATUS -SamOpenGroup( - __in SAM_HANDLE DomainHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG GroupId, - __out PSAM_HANDLE GroupHandle - ); - -__checkReturn -NTSTATUS -SamQueryInformationGroup( - __in SAM_HANDLE GroupHandle, - __in GROUP_INFORMATION_CLASS GroupInformationClass, - __deref_out PVOID *Buffer - ); - -__checkReturn -NTSTATUS -SamSetInformationGroup( - __in SAM_HANDLE GroupHandle, - __in GROUP_INFORMATION_CLASS GroupInformationClass, - __in PVOID Buffer - ); - -__checkReturn -NTSTATUS -SamAddMemberToGroup( - __in SAM_HANDLE GroupHandle, - __in ULONG MemberId, - __in ULONG Attributes - ); - -__checkReturn -NTSTATUS -SamDeleteGroup( - __in SAM_HANDLE GroupHandle - ); - -__checkReturn -NTSTATUS -SamRemoveMemberFromGroup( - __in SAM_HANDLE GroupHandle, - __in ULONG MemberId - ); - -__checkReturn -NTSTATUS -SamGetMembersInGroup( - __in SAM_HANDLE GroupHandle, - __deref_out_ecount(*MemberCount) PULONG * MemberIds, - __deref_out_ecount(*MemberCount) PULONG * Attributes, - __out PULONG MemberCount - ); - -__checkReturn -NTSTATUS -SamSetMemberAttributesOfGroup( - __in SAM_HANDLE GroupHandle, - __in ULONG MemberId, - __in ULONG Attributes - ); - -__checkReturn -NTSTATUS -SamOpenAlias( - __in SAM_HANDLE DomainHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG AliasId, - __out PSAM_HANDLE AliasHandle - ); - -__checkReturn -NTSTATUS -SamQueryInformationAlias( - __in SAM_HANDLE AliasHandle, - __in ALIAS_INFORMATION_CLASS AliasInformationClass, - __deref_out PVOID *Buffer - ); - -__checkReturn -NTSTATUS -SamSetInformationAlias( - __in SAM_HANDLE AliasHandle, - __in ALIAS_INFORMATION_CLASS AliasInformationClass, - __in PVOID Buffer - ); - -__checkReturn -NTSTATUS -SamDeleteAlias( - __in SAM_HANDLE AliasHandle - ); - -__checkReturn -NTSTATUS -SamAddMemberToAlias( - __in SAM_HANDLE AliasHandle, - __in PSID MemberId - ); - -__checkReturn -NTSTATUS -SamAddMultipleMembersToAlias( - __in SAM_HANDLE AliasHandle, - __in_ecount(MemberCount) PSID *MemberIds, - __in ULONG MemberCount - ); - -__checkReturn -NTSTATUS -SamRemoveMemberFromAlias( - __in SAM_HANDLE AliasHandle, - __in PSID MemberId - ); - -__checkReturn -NTSTATUS -SamRemoveMultipleMembersFromAlias( - __in SAM_HANDLE AliasHandle, - __in_ecount(MemberCount) PSID *MemberIds, - __in ULONG MemberCount - ); - -__checkReturn -NTSTATUS -SamRemoveMemberFromForeignDomain( - __in SAM_HANDLE DomainHandle, - __in PSID MemberId - ); - -__checkReturn -NTSTATUS -SamGetMembersInAlias( - __in SAM_HANDLE AliasHandle, - __deref_out_ecount(*MemberCount) PSID **MemberIds, - __out PULONG MemberCount - ); - -__checkReturn -NTSTATUS -SamOpenUser( - __in SAM_HANDLE DomainHandle, - __in ACCESS_MASK DesiredAccess, - __in ULONG UserId, - __out PSAM_HANDLE UserHandle - ); - -__checkReturn -NTSTATUS -SamDeleteUser( - __in SAM_HANDLE UserHandle - ); - -__checkReturn -NTSTATUS -SamQueryInformationUser( - __in SAM_HANDLE UserHandle, - __in USER_INFORMATION_CLASS UserInformationClass, - __deref_out PVOID * Buffer - ); - -__checkReturn -NTSTATUS -SamSetInformationUser( - __in SAM_HANDLE UserHandle, - __in USER_INFORMATION_CLASS UserInformationClass, - __in PVOID Buffer - ); - -__checkReturn -NTSTATUS -SamChangePasswordUser( - __in SAM_HANDLE UserHandle, - __in PUNICODE_STRING OldPassword, - __in PUNICODE_STRING NewPassword - ); - -__checkReturn -NTSTATUS -SamChangePasswordUser2( - __in PUNICODE_STRING ServerName, - __in PUNICODE_STRING UserName, - __in PUNICODE_STRING OldPassword, - __in PUNICODE_STRING NewPassword - ); - - -__checkReturn -NTSTATUS -SamChangePasswordUser3( - __in PUNICODE_STRING ServerName, - __in PUNICODE_STRING UserName, - __in PUNICODE_STRING OldPassword, - __in PUNICODE_STRING NewPassword, - __deref_out PDOMAIN_PASSWORD_INFORMATION * EffectivePasswordPolicy, - __deref_out PUSER_PWD_CHANGE_FAILURE_INFORMATION *PasswordChangeFailureInfo - ); - - -__checkReturn -NTSTATUS -SamGetGroupsForUser( - __in SAM_HANDLE UserHandle, - __deref_out_ecount(*MembershipCount) PGROUP_MEMBERSHIP * Groups, - __out PULONG MembershipCount - ); - -__checkReturn -NTSTATUS -SamQueryDisplayInformation ( - __in SAM_HANDLE DomainHandle, - __in DOMAIN_DISPLAY_INFORMATION DisplayInformation, - __in ULONG Index, - __in ULONG EntryCount, - __in ULONG PreferredMaximumLength, - __in PULONG TotalAvailable, - __out PULONG TotalReturned, - __out PULONG ReturnedEntryCount, - __deref_out PVOID *SortedBuffer - ); - -__checkReturn -NTSTATUS -SamGetDisplayEnumerationIndex ( - __in SAM_HANDLE DomainHandle, - __in DOMAIN_DISPLAY_INFORMATION DisplayInformation, - __in PUNICODE_STRING Prefix, - __out PULONG Index - ); - -__checkReturn -NTSTATUS -SamRidToSid( - __in SAM_HANDLE ObjectHandle, - __in ULONG Rid, - __deref_out PSID* Sid - ); - -__checkReturn -NTSTATUS -SamGetCompatibilityMode( - __in SAM_HANDLE ObjectHandle, - __out ULONG* Mode - ); - -__checkReturn -NTSTATUS -SamValidatePassword( - __in_opt PUNICODE_STRING ServerName, - __in PASSWORD_POLICY_VALIDATION_TYPE ValidationType, - __in PSAM_VALIDATE_INPUT_ARG InputArg, - __out PSAM_VALIDATE_OUTPUT_ARG *OutputArg - ); - -__checkReturn -NTSTATUS -SamQueryLocalizableAccountsInDomain( - __in SAM_HANDLE Domain, - __in ULONG Flags, - __in ULONG LanguageId, - __in DOMAIN_LOCALIZABLE_ACCOUNTS_INFORMATION Class, - __deref_out PVOID *Buffer - ); - -__checkReturn -NTSTATUS -SamRegisterObjectChangeNotification( - __in SECURITY_DB_OBJECT_TYPE ObjectType, - __in HANDLE NotificationEventHandle - ); - -NTSTATUS -SamUnregisterObjectChangeNotification( - __in SECURITY_DB_OBJECT_TYPE ObjectType, - __in HANDLE NotificationEventHandle - ); - -__checkReturn -NTSTATUS -SamPerformGenericOperation( - __in_opt PWSTR ServerName, - __in SAM_GENERIC_OPERATION_TYPE OperationType, - __in PSAM_GENERIC_OPERATION_INPUT OperationIn, - __out PSAM_GENERIC_OPERATION_OUTPUT *OperationOut - ); - - -//////////////////////////////////////////////////////////////////////////// -// // -// Interface definitions of services provided by a password filter DLL // -// // -//////////////////////////////////////////////////////////////////////////// - - - - -// -// Routine names -// -// The routines provided by the DLL must be assigned the following names -// so that their addresses can be retrieved when the DLL is loaded. -// - - -// -// routine templates -// - - -// -// These guards are in place to allow ntsam.h and ntsecapi.h -// to be included in the same file. -// - -// begin_ntsecapi - -#ifndef _PASSWORD_NOTIFICATION_DEFINED -#define _PASSWORD_NOTIFICATION_DEFINED -typedef NTSTATUS (*PSAM_PASSWORD_NOTIFICATION_ROUTINE) ( - PUNICODE_STRING UserName, - ULONG RelativeId, - PUNICODE_STRING NewPassword -); - -#define SAM_PASSWORD_CHANGE_NOTIFY_ROUTINE "PasswordChangeNotify" - -typedef BOOLEAN (*PSAM_INIT_NOTIFICATION_ROUTINE) ( -); - -#define SAM_INIT_NOTIFICATION_ROUTINE "InitializeChangeNotify" - -#define SAM_PASSWORD_FILTER_ROUTINE "PasswordFilter" - -typedef BOOLEAN (*PSAM_PASSWORD_FILTER_ROUTINE) ( - __in PUNICODE_STRING AccountName, - __in PUNICODE_STRING FullName, - __in PUNICODE_STRING Password, - __in BOOLEAN SetOperation - ); - - -#endif // _PASSWORD_NOTIFICATION_DEFINED - -// end_ntsecapi - -// begin_ntsecpkg - -#ifndef _SAM_CREDENTIAL_UPDATE_DEFINED -#define _SAM_CREDENTIAL_UPDATE_DEFINED - -typedef NTSTATUS (*PSAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE) ( - __in PUNICODE_STRING ClearPassword, - __in_bcount(OldCredentialSize) PVOID OldCredentials, - __in ULONG OldCredentialSize, - __in ULONG UserAccountControl, - __in_opt PUNICODE_STRING UPN, - __in PUNICODE_STRING UserName, - __in PUNICODE_STRING NetbiosDomainName, - __in PUNICODE_STRING DnsDomainName, - __deref_out_bcount(*NewCredentialSize) PVOID * NewCredentials, - __out ULONG * NewCredentialSize - ); - -#define SAM_CREDENTIAL_UPDATE_NOTIFY_ROUTINE "CredentialUpdateNotify" - -typedef BOOLEAN (*PSAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE) ( - __out PUNICODE_STRING CredentialName - ); - -#define SAM_CREDENTIAL_UPDATE_REGISTER_ROUTINE "CredentialUpdateRegister" - -typedef VOID (*PSAM_CREDENTIAL_UPDATE_FREE_ROUTINE) ( - __in PVOID p - ); - -#define SAM_CREDENTIAL_UPDATE_FREE_ROUTINE "CredentialUpdateFree" - -typedef struct { - PSTR Original; - PSTR Mapped; - BOOLEAN Continuable; // only honored for some operations -} SAM_REGISTER_MAPPING_ELEMENT, *PSAM_REGISTER_MAPPING_ELEMENT; - -typedef struct { - ULONG Count; - __ecount(Count) PSAM_REGISTER_MAPPING_ELEMENT Elements; -} SAM_REGISTER_MAPPING_LIST, *PSAM_REGISTER_MAPPING_LIST; - -typedef struct { - ULONG Count; - __ecount(Count) PSAM_REGISTER_MAPPING_LIST Lists; -} SAM_REGISTER_MAPPING_TABLE, *PSAM_REGISTER_MAPPING_TABLE; - -typedef NTSTATUS (*PSAM_CREDENTIAL_UPDATE_REGISTER_MAPPED_ENTRYPOINTS_ROUTINE) ( - __out SAM_REGISTER_MAPPING_TABLE *Table - ); - -#define SAM_CREDENTIAL_UPDATE_REGISTER_MAPPED_ENTRYPOINTS_ROUTINE "RegisterMappedEntrypoints" - -#endif // _SAM_CREDENTIAL_UPDATE_DEFINED - -// end_ntsecpkg - -#undef SIZE_IS -#undef SWITCH_IS -#undef SWITCH_TYPE -#undef CASE -#undef VAR_SIZE_ARRAY -#undef RANGE - -#ifdef __cplusplus -} -#endif - -#endif // _NTSAM_ - diff --git a/qt-correction-tool/pub/ddk/ntstrsafe.h b/qt-correction-tool/pub/ddk/ntstrsafe.h deleted file mode 100644 index 1e84af3..0000000 --- a/qt-correction-tool/pub/ddk/ntstrsafe.h +++ /dev/null @@ -1,12594 +0,0 @@ -/****************************************************************** -* * -* ntstrsafe.h -- This module defines safer C library string * -* routine replacements for drivers. These are * -* meant to make C a bit more safe in reference * -* to security and robustness. A similar file, * -* strsafe.h, is available for applications. * -* * -* Copyright (c) Microsoft Corp. All rights reserved. * -* * -******************************************************************/ -#ifndef _NTSTRSAFE_H_INCLUDED_ -#define _NTSTRSAFE_H_INCLUDED_ -#if (_MSC_VER > 1000) -#pragma once -#endif - - -#include // for _vsnprintf, _vsnwprintf, getc, getwc -#include // for memset -#include // for va_start, etc. -#include // for __in, etc. - -#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS -#include // for UNICODE_STRING, etc. -#endif - -#if !defined(_W64) -#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && (_MSC_VER >= 1300) -#define _W64 __w64 -#else -#define _W64 -#endif -#endif - -#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) -#define ALIGNMENT_MACHINE -#define UNALIGNED __unaligned -#if defined(_WIN64) -#define UNALIGNED64 __unaligned -#else -#define UNALIGNED64 -#endif -#else -#undef ALIGNMENT_MACHINE -#define UNALIGNED -#define UNALIGNED64 -#endif - -// typedefs -#ifdef _WIN64 -typedef unsigned __int64 size_t; -#else -typedef _W64 unsigned int size_t; -#endif - -#ifndef _NTSTATUS_DEFINED -#define _NTSTATUS_DEFINED -typedef __success(return >= 0) long NTSTATUS; -#endif - -typedef unsigned long DWORD; - - -#ifndef SORTPP_PASS -// compiletime asserts (failure results in error C2118: negative subscript) -#define C_ASSERT(e) typedef char __C_ASSERT__[(e)?1:-1] -#else -#define C_ASSERT(e) -#endif - -#ifdef __cplusplus -#define EXTERN_C extern "C" -#else -#define EXTERN_C extern -#endif - -// use the new secure crt functions if available -#ifndef NTSTRSAFE_USE_SECURE_CRT -#if defined(__GOT_SECURE_LIB__) && (__GOT_SECURE_LIB__ >= 200402L) -#define NTSTRSAFE_USE_SECURE_CRT 0 -#else -#define NTSTRSAFE_USE_SECURE_CRT 0 -#endif -#endif // !NTSTRSAFE_USE_SECURE_CRT - -#ifdef _M_CEE_PURE -#define NTSTRSAFEDDI __inline NTSTATUS __clrcall -#else -#define NTSTRSAFEDDI __inline NTSTATUS __stdcall -#endif - -#if defined(NTSTRSAFE_LIB_IMPL) || defined(NTSTRSAFE_LIB) -#define NTSTRSAFEWORKERDDI EXTERN_C NTSTATUS __stdcall -#else -#define NTSTRSAFEWORKERDDI static NTSTRSAFEDDI -#endif - -// The following steps are *REQUIRED* if ntstrsafe.h is used for drivers on: -// Windows 2000 -// Windows Millennium Edition -// Windows 98 Second Edition -// Windows 98 -// -// 1. #define NTSTRSAFE_LIB before including the ntstrsafe.h header file. -// 2. Add ntstrsafe.lib to the TARGET_LIBS line in SOURCES -// -// Drivers running on XP and later can skip these steps to create a smaller -// driver by running the functions inline. -#if defined(NTSTRSAFE_LIB) -#pragma comment(lib, "ntstrsafe.lib") -#endif - -// The user can request no "Cb" or no "Cch" fuctions, but not both -#if defined(NTSTRSAFE_NO_CB_FUNCTIONS) && defined(NTSTRSAFE_NO_CCH_FUNCTIONS) -#error cannot specify both NTSTRSAFE_NO_CB_FUNCTIONS and NTSTRSAFE_NO_CCH_FUNCTIONS !! -#endif - -// The user may override NTSTRSAFE_MAX_CCH, but it must always be less than INT_MAX -#ifndef NTSTRSAFE_MAX_CCH -#define NTSTRSAFE_MAX_CCH 2147483647 // max buffer size, in characters, that we support (same as INT_MAX) -#endif -C_ASSERT(NTSTRSAFE_MAX_CCH <= 2147483647); -C_ASSERT(NTSTRSAFE_MAX_CCH > 1); - -#define NTSTRSAFE_MAX_LENGTH (NTSTRSAFE_MAX_CCH - 1) // max buffer length, in characters, that we support - -// The user may override NTSTRSAFE_UNICODE_STRING_MAX_CCH, but it must always be less than (USHORT_MAX / sizeof(wchar_t)) -#ifndef NTSTRSAFE_UNICODE_STRING_MAX_CCH -#define NTSTRSAFE_UNICODE_STRING_MAX_CCH (0xffff / sizeof(wchar_t)) // max buffer size, in characters, for a UNICODE_STRING -#endif -C_ASSERT(NTSTRSAFE_UNICODE_STRING_MAX_CCH <= (0xffff / sizeof(wchar_t))); -C_ASSERT(NTSTRSAFE_UNICODE_STRING_MAX_CCH > 1); - - -// Flags for controling the Ex functions -// -// STRSAFE_FILL_BYTE(0xFF) 0x000000FF // bottom byte specifies fill pattern -#define STRSAFE_IGNORE_NULLS 0x00000100 // treat null string pointers as TEXT("") -- don't fault on NULL buffers -#define STRSAFE_FILL_BEHIND_NULL 0x00000200 // on success, fill in extra space behind the null terminator with fill pattern -#define STRSAFE_FILL_ON_FAILURE 0x00000400 // on failure, overwrite pszDest with fill pattern and null terminate it -#define STRSAFE_NULL_ON_FAILURE 0x00000800 // on failure, set *pszDest = TEXT('\0') -#define STRSAFE_NO_TRUNCATION 0x00001000 // instead of returning a truncated result, copy/append nothing to pszDest and null terminate it - -// Flags for controling UNICODE_STRING Ex functions -// -// STRSAFE_FILL_BYTE(0xFF) 0x000000FF // bottom byte specifies fill pattern -// STRSAFE_IGNORE_NULLS 0x00000100 // don't fault on NULL UNICODE_STRING pointers, and treat null pszSrc as L"" -#define STRSAFE_FILL_BEHIND 0x00000200 // on success, fill in extra space at the end of the UNICODE_STRING Buffer with fill pattern -// STRSAFE_FILL_ON_FAILURE 0x00000400 // on failure, fill the UNICODE_STRING Buffer with fill pattern and set the Length to 0 -#define STRSAFE_ZERO_LENGTH_ON_FAILURE 0x00000800 // on failure, set the UNICODE_STRING Length to 0 -// STRSAFE_NO_TRUNCATION 0x00001000 // instead of returning a truncated result, copy/append nothing to UNICODE_STRING Buffer - - -#define STRSAFE_VALID_FLAGS (0x000000FF | STRSAFE_IGNORE_NULLS | STRSAFE_FILL_BEHIND_NULL | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE | STRSAFE_NO_TRUNCATION) -#define STRSAFE_UNICODE_STRING_VALID_FLAGS (0x000000FF | STRSAFE_IGNORE_NULLS | STRSAFE_FILL_BEHIND | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE | STRSAFE_NO_TRUNCATION) - -// helper macro to set the fill character and specify buffer filling -#define STRSAFE_FILL_BYTE(x) ((DWORD)((x & 0x000000FF) | STRSAFE_FILL_BEHIND_NULL)) -#define STRSAFE_FAILURE_BYTE(x) ((DWORD)((x & 0x000000FF) | STRSAFE_FILL_ON_FAILURE)) - -#define STRSAFE_GET_FILL_PATTERN(dwFlags) ((int)(dwFlags & 0x000000FF)) - - -// -// These typedefs are used in places where the string is guaranteed to -// be null terminated. -// -typedef __nullterminated char* NTSTRSAFE_PSTR; -typedef __nullterminated const char* NTSTRSAFE_PCSTR; -typedef __nullterminated wchar_t* NTSTRSAFE_PWSTR; -typedef __nullterminated const wchar_t* NTSTRSAFE_PCWSTR; -typedef __nullterminated const wchar_t UNALIGNED* NTSTRSAFE_PCUWSTR; - -// -// These typedefs are used in places where the string is NOT guaranteed to -// be null terminated. -// -typedef __possibly_notnullterminated const char* STRSAFE_PCNZCH; -typedef __possibly_notnullterminated const wchar_t* STRSAFE_PCNZWCH; -typedef __possibly_notnullterminated const wchar_t UNALIGNED* STRSAFE_PCUNZWCH; - - -// prototypes for the worker functions - -NTSTRSAFEWORKERDDI -RtlStringLengthWorkerA( - __in STRSAFE_PCNZCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength); - -NTSTRSAFEWORKERDDI -RtlStringLengthWorkerW( - __in STRSAFE_PCNZWCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength); - -#ifdef ALIGNMENT_MACHINE -NTSTRSAFEWORKERDDI -RtlUnalignedStringLengthWorkerW( - __in STRSAFE_PCUNZWCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength); -#endif // ALIGNMENT_MACHINE - -NTSTRSAFEWORKERDDI -RtlStringExValidateSrcA( - __deref_in_opt_out NTSTRSAFE_PCSTR* ppszSrc, - __inout_opt __deref_out_range(<, cchMax) size_t* pcchToRead, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExValidateSrcW( - __deref_in_opt_out NTSTRSAFE_PCWSTR* ppszSrc, - __inout_opt __deref_out_range(<, cchMax) size_t* pcchToRead, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringValidateDestA( - __in_ecount_opt(cchDest) STRSAFE_PCNZCH pszDest, - __in size_t cchDest, - __in const size_t cchMax); - -NTSTRSAFEWORKERDDI -RtlStringValidateDestAndLengthA( - __in_ecount_opt(cchDest) NTSTRSAFE_PCSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax); - -NTSTRSAFEWORKERDDI -RtlStringValidateDestW( - __in_ecount_opt(cchDest) STRSAFE_PCNZWCH pszDest, - __in size_t cchDest, - __in const size_t cchMax); - -NTSTRSAFEWORKERDDI -RtlStringValidateDestAndLengthW( - __in_ecount_opt(cchDest) NTSTRSAFE_PCWSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax); - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestA( - __in_ecount_opt(cchDest) STRSAFE_PCNZCH pszDest, - __in size_t cchDest, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestAndLengthA( - __in_ecount_opt(cchDest) NTSTRSAFE_PCSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestW( - __in_ecount_opt(cchDest) STRSAFE_PCNZWCH pszDest, - __in size_t cchDest, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestAndLengthW( - __in_ecount_opt(cchDest) NTSTRSAFE_PCWSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringCopyWorkerA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, (cchToCopy < cchDest) ? cchToCopy : cchDest - 1) size_t* pcchNewDestLength, - __in_xcount(cchToCopy) STRSAFE_PCNZCH pszSrc, - __in __in_range(<, NTSTRSAFE_MAX_CCH) size_t cchToCopy); - -NTSTRSAFEWORKERDDI -RtlStringCopyWorkerW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, (cchToCopy < cchDest) ? cchToCopy : cchDest - 1) size_t* pcchNewDestLength, - __in_xcount(cchToCopy) STRSAFE_PCNZWCH pszSrc, - __in __in_range(<, NTSTRSAFE_MAX_CCH) size_t cchToCopy); - -NTSTRSAFEWORKERDDI -RtlStringVPrintfWorkerA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, cchDest - 1) size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList); - -NTSTRSAFEWORKERDDI -RtlStringVPrintfWorkerW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, cchDest - 1) size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList); - -NTSTRSAFEWORKERDDI -RtlStringExHandleFillBehindNullA( - __inout_bcount(cbRemaining) NTSTRSAFE_PSTR pszDestEnd, - __in size_t cbRemaining, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExHandleFillBehindNullW( - __inout_bcount(cbRemaining) NTSTRSAFE_PWSTR pszDestEnd, - __in size_t cbRemaining, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExHandleOtherFlagsA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(sizeof(char), NTSTRSAFE_MAX_CCH * sizeof(char)) size_t cbDest, - __in __in_range(<, cbDest / sizeof(char)) size_t cchOriginalDestLength, - __deref_inout_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out __deref_out_range(<=, cbDest / sizeof(char)) size_t* pcchRemaining, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringExHandleOtherFlagsW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(sizeof(wchar_t), NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbDest, - __in __in_range(<, cbDest / sizeof(wchar_t)) size_t cchOriginalDestLength, - __deref_inout_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out __deref_out_range(<=, cbDest / sizeof(wchar_t)) size_t* pcchRemaining, - __in DWORD dwFlags); - -#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - -NTSTRSAFEWORKERDDI -RtlUnicodeStringInitWorker( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateWorker( - __in_opt PCUNICODE_STRING SourceString, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateSrcWorker( - __in PCUNICODE_STRING SourceString, - __deref_out_ecount(*pcchSrcLength) wchar_t** ppszSrc, - __out size_t* pcchSrcLength, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateDestWorker( - __in PCUNICODE_STRING DestinationString, - __deref_out_ecount(*pcchDest) wchar_t** ppszDest, - __out size_t* pcchDest, - __out_opt size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlStringCopyWideCharArrayWorker( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __out_opt size_t* pcchNewDestLength, - __in_ecount(cchSrcLength) const wchar_t* pszSrc, - __in size_t cchSrcLength); - -NTSTRSAFEWORKERDDI -RtlWideCharArrayCopyStringWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToCopy); - -NTSTRSAFEWORKERDDI -RtlWideCharArrayCopyWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in_ecount(cchSrcLength) const wchar_t* pszSrc, - __in size_t cchSrcLength); - -NTSTRSAFEWORKERDDI -RtlWideCharArrayVPrintfWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList); - -NTSTRSAFEWORKERDDI -RtlUnicodeStringExHandleFill( - __out_ecount(cchRemaining) wchar_t* pszDestEnd, - __in size_t cchRemaining, - __in DWORD dwFlags); - -NTSTRSAFEWORKERDDI -RtlUnicodeStringExHandleOtherFlags( - __inout_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __in size_t cchOriginalDestLength, - __out size_t* pcchNewDestLength, - __deref_out_ecount(*pcchRemaining) wchar_t** ppszDestEnd, - __out size_t* pcchRemaining, - __in DWORD dwFlags); - -#endif // !NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - - -// To allow this to stand alone. -#define __WARNING_CYCLOMATIC_COMPLEXITY 28734 -#define __WARNING_DEREF_NULL_PTR 6011 -#define __WARNING_INVALID_PARAM_VALUE_1 6387 -#define __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY 26015 -#define __WARNING_RETURNING_BAD_RESULT 28196 -#define __WARNING_BANNED_API_USAGE 28719 - -#pragma warning(push) -#if _MSC_VER <= 1400 -#pragma warning(disable: 4616) // turn off warning out of range so prefast pragmas won't show - // show up in build.wrn/build.err -#endif -#pragma warning(disable : 4996) // 'function': was declared deprecated -#pragma warning(disable : 4995) // name was marked as #pragma deprecated -#pragma warning(disable : 4793) // vararg causes native code generation -#pragma warning(disable : __WARNING_CYCLOMATIC_COMPLEXITY) - - -#ifndef NTSTRSAFE_LIB_IMPL - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCopy( - __out_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in LPCTSTR pszSrc - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This routine is not a replacement for strncpy. That function will pad the - destination string with extra null termination characters if the count is - greater than the length of the source string, and it will fail to null - terminate the destination string if the source string length is greater - than or equal to the count. You can not blindly use this instead of strncpy: - it is common for code to use it to "patch" strings and you would introduce - errors if the code started null terminating in the middle of the string. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation and null terminated, - otherwise it will return a failure code. In failure cases as much of - pszSrc will be copied to pszDest as possible, and pszDest will be null - terminated. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(src) + 1) to hold all of the - source including the null terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCchCopyEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCSTR pszSrc) -{ - NTSTATUS status; - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerA(pszDest, - cchDest, - NULL, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCopyW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerW(pszDest, - cchDest, - NULL, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCopy( - __out_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in LPCTSTR pszSrc - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy'. - The size of the destination buffer (in bytes) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This routine is not a replacement for strncpy. That function will pad the - destination string with extra null termination characters if the count is - greater than the length of the source string, and it will fail to null - terminate the destination string if the source string length is greater - than or equal to the count. You can not blindly use this instead of strncpy: - it is common for code to use it to "patch" strings and you would introduce - errors if the code started null terminating in the middle of the string. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation and null terminated, - otherwise it will return a failure code. In failure cases as much of pszSrc - will be copied to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be = ((_tcslen(src) + 1) * sizeof(TCHAR)) to - hold all of the source including the null terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCbCopyEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCSTR pszSrc) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerA(pszDest, - cchDest, - NULL, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCopyW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerW(pszDest, - cchDest, - NULL, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCopyEx( - __out_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __in LPCTSTR pszSrc OPTIONAL, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' with - some additional parameters. In addition to functionality provided by - RtlStringCchCopy, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszSrc) + 1) to hold all of - the source including the null terminator - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyExA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCSTR pszSrc, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDest, - cchDest, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCopyExW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCWSTR pszSrc, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDest, - cchDest, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCopyEx( - __out_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __in LPCTSTR pszSrc OPTIONAL, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' with - some additional parameters. In addition to functionality provided by - RtlStringCbCopy, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszSrc) + 1) * sizeof(TCHAR)) to - hold all of the source including the null terminator - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcbRemaining - pcbRemaining is non-null,the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyExA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCSTR pszSrc, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDest, - cchDest, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCopyExW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCWSTR pszSrc, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDest, - cchDest, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCopyN( - __out_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in LPCTSTR pszSrc, - __in size_t cchToCopy - ); - - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cchToCopy is greater than the length of pszSrc. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cchToCopy characters were copied - without truncation and the resultant destination string was null terminated, - otherwise it will return a failure code. In failure cases as much of pszSrc - will be copied to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(src) + 1) to hold all of the - source including the null terminator - - pszSrc - source string - - cchToCopy - maximum number of characters to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCchCopyNEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyNA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToCopy) STRSAFE_PCNZCH pszSrc, - __in size_t cchToCopy) -{ - NTSTATUS status; - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - if (cchToCopy > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - - *pszDest = '\0'; - } - else - { - status = RtlStringCopyWorkerA(pszDest, - cchDest, - NULL, - pszSrc, - cchToCopy); - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCopyNW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToCopy) STRSAFE_PCNZWCH pszSrc, - __in size_t cchToCopy) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - if (cchToCopy > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - - *pszDest = L'\0'; - } - else - { - status = RtlStringCopyWorkerW(pszDest, - cchDest, - NULL, - pszSrc, - cchToCopy); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCopyN( - __out_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in LPCTSTR pszSrc, - __in size_t cbToCopy - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy'. - The size of the destination buffer (in bytes) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cbToCopy is greater than the size of pszSrc. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cbToCopy characters were - copied without truncation and the resultant destination string was null - terminated, otherwise it will return a failure code. In failure cases as - much of pszSrc will be copied to pszDest as possible, and pszDest will be - null terminated. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be = ((_tcslen(src) + 1) * sizeof(TCHAR)) to - hold all of the source including the null terminator - - pszSrc - source string - - cbToCopy - maximum number of bytes to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCbCopyEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyNA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToCopy) STRSAFE_PCNZCH pszSrc, - __in size_t cbToCopy) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - size_t cchToCopy = cbToCopy / sizeof(char); - - if (cchToCopy > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - - *pszDest = '\0'; - } - else - { - status = RtlStringCopyWorkerA(pszDest, - cchDest, - NULL, - pszSrc, - cchToCopy); - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCopyNW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToCopy) STRSAFE_PCNZWCH pszSrc, - __in size_t cbToCopy) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - - if (cchToCopy > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - - // Suppress espx false positive - cchDest cannot be 0 here -#pragma warning(push) -#pragma warning(disable : __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY) - *pszDest = L'\0'; -#pragma warning(pop) - } - else - { - status = RtlStringCopyWorkerW(pszDest, - cchDest, - NULL, - pszSrc, - cchToCopy); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCopyNEx( - __out_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cchToCopy, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters. In addition to functionality provided by - RtlStringCchCopyN, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination - string including the null terminator. The flags parameter allows - additional controls. - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cchToCopy is greater than the length of pszSrc. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszSrc) + 1) to hold all of - the source including the null terminator - - pszSrc - source string - - cchToCopy - maximum number of characters to copy from the source - string - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyNExA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToCopy) STRSAFE_PCNZCH pszSrc, - __in size_t cchToCopy, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszSrc, &cchToCopy, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != '\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCopyNExW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToCopy) STRSAFE_PCNZWCH pszSrc, - __in size_t cchToCopy, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszSrc, &cchToCopy, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCopyNEx( - __out_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cbToCopy, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters. In addition to functionality provided by - RtlStringCbCopyN, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - - This routine is meant as a replacement for strncpy, but it does behave - differently. This function will not pad the destination buffer with extra - null termination characters if cbToCopy is greater than the size of pszSrc. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszSrc) + 1) * sizeof(TCHAR)) to - hold all of the source including the null terminator - - pszSrc - source string - - cbToCopy - maximum number of bytes to copy from source string - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcbRemaining - pcbRemaining is non-null,the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyNExA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToCopy) STRSAFE_PCNZCH pszSrc, - __in size_t cbToCopy, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchToCopy = cbToCopy / sizeof(char); - - status = RtlStringExValidateSrcA(&pszSrc, &cchToCopy, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != '\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCopyNExW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToCopy) STRSAFE_PCNZWCH pszSrc, - __in size_t cbToCopy, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - -#pragma warning(push) -#pragma warning(disable : __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY) - status = RtlStringExValidateSrcW(&pszSrc, &cchToCopy, NTSTRSAFE_MAX_CCH, dwFlags); -#pragma warning(pop) - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCat( - __inout_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in LPCTSTR pszSrc - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat'. - The size of the destination buffer (in characters) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was concatenated without truncation and null terminated, - otherwise it will return a failure code. In failure cases as much of pszSrc - will be appended to pszDest as possible, and pszDest will be null - terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be = (_tcslen(pszDest) + _tcslen(pszSrc) + 1) - to hold all of the combine string plus the null - terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCchCatEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCatA( - __inout_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCSTR pszSrc) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerA(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - NTSTRSAFE_MAX_CCH); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCatW( - __inout_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerW(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - NTSTRSAFE_MAX_CCH); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCat( - __inout_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in LPCTSTR pszSrc - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat'. - The size of the destination buffer (in bytes) is a parameter and this - function will not write past the end of this buffer and it will ALWAYS - null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was concatenated without truncation and null terminated, - otherwise it will return a failure code. In failure cases as much of pszSrc - will be appended to pszDest as possible, and pszDest will be null - terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be = ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCbCatEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error occurs, - the destination buffer is modified to contain a truncated - version of the ideal result and is null terminated. This - is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCatA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCSTR pszSrc) -{ - NTSTATUS status; - size_t cchDestLength; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerA(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - NTSTRSAFE_MAX_CCH); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCatW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - size_t cchDestLength; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWorkerW(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - NTSTRSAFE_MAX_CCH); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCatEx( - __inout_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __in LPCTSTR pszSrc OPTIONAL, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' with - some additional parameters. In addition to functionality provided by - RtlStringCchCat, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters - length must be (_tcslen(pszDest) + _tcslen(pszSrc) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcat - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCatExA( - __inout_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCSTR pszSrc, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcA(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCatExW( - __inout_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in NTSTRSAFE_PCWSTR pszSrc, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCatEx( - __inout_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __in LPCTSTR pszSrc OPTIONAL, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' with - some additional parameters. In addition to functionality provided by - RtlStringCbCat, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + _tcslen(pszSrc) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string which must be null terminated - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return - the number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcat - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated - and the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCatExA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCSTR pszSrc, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcA(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if (*pszSrc != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCatExW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in NTSTRSAFE_PCWSTR pszSrc, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - NTSTRSAFE_MAX_LENGTH); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCatN( - __inout_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in LPCTSTR pszSrc, - __in size_t cchToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat'. - The size of the destination buffer (in characters) is a parameter as well as - the maximum number of characters to append, excluding the null terminator. - This function will not write past the end of the destination buffer and it will - ALWAYS null terminate pszDest (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of pszSrc or the first cchToAppend characters were appended - to the destination string and it was null terminated, otherwise it will - return a failure code. In failure cases as much of pszSrc will be appended - to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be (_tcslen(pszDest) + min(cchToAppend, _tcslen(pszSrc)) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cchToAppend - maximum number of characters to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCchCatNEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cchToAppend characters - were concatenated to pszDest and the resultant dest - string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCatNA( - __inout_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToAppend) STRSAFE_PCNZCH pszSrc, - __in size_t cchToAppend) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - if (cchToAppend > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringCopyWorkerA(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - cchToAppend); - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCatNW( - __inout_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToAppend) STRSAFE_PCNZWCH pszSrc, - __in size_t cchToAppend) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - if (cchToAppend > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringCopyWorkerW(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - cchToAppend); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCatN( - __inout_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in LPCTSTR pszSrc, - __in size_t cbToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat'. - The size of the destination buffer (in bytes) is a parameter as well as - the maximum number of bytes to append, excluding the null terminator. - This function will not write past the end of the destination buffer and it will - ALWAYS null terminate pszDest (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of pszSrc or the first cbToAppend bytes were appended - to the destination string and it was null terminated, otherwise it will - return a failure code. In failure cases as much of pszSrc will be appended - to pszDest as possible, and pszDest will be null terminated. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + min(cbToAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cbToAppend - maximum number of bytes to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL. See RtlStringCbCatNEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cbToAppend bytes were - concatenated to pszDest and the resultant dest string - was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCatNA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToAppend) STRSAFE_PCNZCH pszSrc, - __in size_t cbToAppend) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - size_t cchToAppend = cbToAppend / sizeof(char); - - if (cchToAppend > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringCopyWorkerA(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - cchToAppend); - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCatNW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToAppend) STRSAFE_PCNZWCH pszSrc, - __in size_t cbToAppend) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - size_t cchDestLength; - - status = RtlStringValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - - if (cchToAppend > NTSTRSAFE_MAX_LENGTH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringCopyWorkerW(pszDest + cchDestLength, - cchDest - cchDestLength, - NULL, - pszSrc, - cchToAppend); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchCatNEx( - __inout_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cchToAppend, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters. In addition to functionality provided by - RtlStringCchCatN, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cchDest - size of destination buffer in characters. - length must be (_tcslen(pszDest) + min(cchToAppend, _tcslen(pszSrc)) + 1) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cchToAppend - maximum number of characters to append - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cchToAppend characters - were concatenated to pszDest and the resultant dest - string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchCatNExA( - __inout_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToAppend) STRSAFE_PCNZCH pszSrc, - __in size_t cchToAppend, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcA(&pszSrc, &cchToAppend, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != '\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchCatNExW( - __inout_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in_ecount(cchToAppend) STRSAFE_PCNZWCH pszSrc, - __in size_t cchToAppend, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - - status = RtlStringExValidateSrcW(&pszSrc, &cchToAppend, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbCatNEx( - __inout_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cbToAppend, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters. In addition to functionality provided by - RtlStringCbCatN, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string which must be null terminated - - cbDest - size of destination buffer in bytes. - length must be ((_tcslen(pszDest) + min(cbToAppend / sizeof(TCHAR), _tcslen(pszSrc)) + 1) * sizeof(TCHAR) - to hold all of the combine string plus the null - terminator. - - pszSrc - source string - - cbToAppend - maximum number of bytes to append - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function appended any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any pre-existing - or truncated string - - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any pre-existing or - truncated string - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cbToAppend bytes were - concatenated to pszDest and the resultant dest string - was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the operation - failed due to insufficient space. When this error - occurs, the destination buffer is modified to contain - a truncated version of the ideal result and is null - terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbCatNExA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToAppend) STRSAFE_PCNZCH pszSrc, - __in size_t cbToAppend, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthA(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchToAppend = cbToAppend / sizeof(char); - - status = RtlStringExValidateSrcA(&pszSrc, &cchToAppend, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != '\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerA(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbCatNExW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in_bcount(cbToAppend) STRSAFE_PCNZWCH pszSrc, - __in size_t cbToAppend, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - size_t cchDestLength; - - status = RtlStringExValidateDestAndLengthW(pszDest, - cchDest, - &cchDestLength, - NTSTRSAFE_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - -#pragma warning(push) -#pragma warning(disable : __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY) - status = RtlStringExValidateSrcW(&pszSrc, &cchToAppend, NTSTRSAFE_MAX_CCH, dwFlags); -#pragma warning(pop) - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining <= 1) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWorkerW(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - cchDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchVPrintf( - __out_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in __format_string LPCTSTR pszFormat, - __in va_list argList - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation and null terminated, - otherwise it will return a failure code. In failure cases it will return - a truncated version of the ideal result. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters - length must be sufficient to hold the resulting formatted - string, including the null terminator. - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL. See RtlStringCchVPrintfEx if you - require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string and it was null terminated. - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchVPrintfA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - NULL, - pszFormat, - argList); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchVPrintfW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - NULL, - pszFormat, - argList); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbVPrintf( - __out_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in __format_string LPCTSTR pszFormat, - __in va_list argList - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf'. - The size of the destination buffer (in bytes) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation and null terminated, - otherwise it will return a failure code. In failure cases it will return - a truncated version of the ideal result. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes - length must be sufficient to hold the resulting formatted - string, including the null terminator. - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL. See RtlStringCbVPrintfEx if you - require the handling of NULL values. - - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string and it was null terminated. - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbVPrintfA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - NULL, - pszFormat, - argList); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbVPrintfW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - NULL, - pszFormat, - argList); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef _M_CEE_PURE - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchPrintf( - __out_ecount(cchDest) LPTSTR pszDest, - __in size_t cchDest, - __in __format_string LPCTSTR pszFormat, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf'. - The size of the destination buffer (in characters) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation and null terminated, - otherwise it will return a failure code. In failure cases it will return - a truncated version of the ideal result. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters - length must be sufficient to hold the resulting formatted - string, including the null terminator. - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL. See RtlStringCchPrintfEx if you - require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string and it was null terminated. - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchPrintfA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - ...) -{ - NTSTATUS status; - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - NULL, - pszFormat, - argList); - - va_end(argList); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchPrintfW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - NULL, - pszFormat, - argList); - - va_end(argList); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbPrintf( - __out_bcount(cbDest) LPTSTR pszDest, - __in size_t cbDest, - __in __format_string LPCTSTR pszFormat, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf'. - The size of the destination buffer (in bytes) is a parameter and - this function will not write past the end of this buffer and it will - ALWAYS null terminate the destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation and null terminated, - otherwise it will return a failure code. In failure cases it will return - a truncated version of the ideal result. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes - length must be sufficient to hold the resulting formatted - string, including the null terminator. - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL. See RtlStringCbPrintfEx if you - require the handling of NULL values. - - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string and it was null terminated. - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbPrintfA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - ...) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - NULL, - pszFormat, - argList); - - va_end(argList); - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbPrintfW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH); - - if (NT_SUCCESS(status)) - { - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - NULL, - pszFormat, - argList); - - va_end(argList); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchPrintfEx( - __out_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags, - __in __format_string LPCTSTR pszFormat OPTIONAL, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf' with - some additional parameters. In addition to functionality provided by - RtlStringCchPrintf, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be sufficient to contain the resulting - formatted string plus the null terminator. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function printed any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return - the number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string and it was null terminated. - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchPrintfExA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - ...) -{ - NTSTATUS status; - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchPrintfExW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbPrintfEx( - __out_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags, - __in __format_string LPCTSTR pszFormat OPTIONAL, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf' with - some additional parameters. In addition to functionality provided by - RtlStringCbPrintf, this routine also returns a pointer to the end of the - destination string and the number of bytes left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be sufficient to contain the resulting - formatted string plus the null terminator. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function printed any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return - the number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbPrintfExA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - ...) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbPrintfExW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - va_list argList; - - va_start(argList, pszFormat); - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - -#endif // !_M_CEE_PURE - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchVPrintfEx( - __out_ecount(cchDest) LPTSTR pszDest OPTIONAL, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags, - __in __format_string LPCTSTR pszFormat OPTIONAL, - __in va_list argList - ); - - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf' with - some additional parameters. In addition to functionality provided by - RtlStringCchVPrintf, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be sufficient to contain the resulting - formatted string plus the null terminator. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function printed any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return - the number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCchVPrintfExA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = cchRemaining * sizeof(char); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(char) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbDest = cchDest * sizeof(char); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCchVPrintfExW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbVPrintfEx( - __out_bcount(cbDest) LPTSTR pszDest OPTIONAL, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) LPTSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags, - __in __format_string LPCTSTR pszFormat OPTIONAL, - __in va_list argList - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf' with - some additional parameters. In addition to functionality provided by - RtlStringCbVPrintf, this routine also returns a pointer to the end of the - destination string and the number of characters left in the destination string - including the null terminator. The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be sufficient to contain the resulting - formatted string plus the null terminator. - - ppszDestEnd - if ppszDestEnd is non-null, the function will return - a pointer to the end of the destination string. If the - function printed any data, the result will point to the - null termination character - - pcbRemaining - if pcbRemaining is non-null, the function will return - the number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")) - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - pszDest and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated and - the resultant dest string was null terminated - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlStringCbVPrintfExA( - __out_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(char); - - status = RtlStringExValidateDestA(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcA(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != '\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - - status = RtlStringVPrintfWorkerA(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - cbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullA(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = '\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsA(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(char) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbRemaining = (cchRemaining * sizeof(char)) + (cbDest % sizeof(char)); - } - } - } - - return status; -} - -NTSTRSAFEDDI -RtlStringCbVPrintfExW( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringExValidateDestW(pszDest, cchDest, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - NTSTRSAFE_PWSTR pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchNewDestLength = 0; - - status = RtlStringVPrintfWorkerW(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCchLength( - __in LPCTSTR psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength OPTIONAL - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strlen'. - It is used to make sure a string is not larger than a given length, and - it optionally returns the current length in characters not including - the null terminator. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string is non-null and the length including the null - terminator is less than or equal to cchMax characters. - -Arguments: - - psz - string to check the length of - - cchMax - maximum number of characters including the null terminator - that psz is allowed to contain - - pcch - if the function succeeds and pcch is non-null, the current length - in characters of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) - -Notes: - psz can be null but the function will fail - - cchMax should be greater than zero or the function will fail - -Return Value: - - STATUS_SUCCESS - psz is non-null and the length including the null - terminator is less than or equal to cchMax characters - - failure - the operation did not succeed - - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -__checkReturn -NTSTRSAFEDDI -RtlStringCchLengthA( - __in STRSAFE_PCNZCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringLengthWorkerA(psz, cchMax, pcchLength); - } - - if (!NT_SUCCESS(status) && pcchLength) - { - *pcchLength = 0; - } - - return status; -} - -__checkReturn -NTSTRSAFEDDI -RtlStringCchLengthW( - __in STRSAFE_PCNZWCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringLengthWorkerW(psz, cchMax, pcchLength); - } - - if (!NT_SUCCESS(status) && pcchLength) - { - *pcchLength = 0; - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlStringCbLength( - __in LPCTSTR psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH * sizeof(TCHAR)) size_t cbMax, - __out_opt __deref_out_range(<, cbMax) size_t* pcbLength OPTIONAL - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strlen'. - It is used to make sure a string is not larger than a given length, and - it optionally returns the current length in bytes not including - the null terminator. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string is non-null and the length including the null - terminator is less than or equal to cbMax bytes. - -Arguments: - - psz - string to check the length of - - cbMax - maximum number of bytes including the null terminator - that psz is allowed to contain - - pcb - if the function succeeds and pcb is non-null, the current length - in bytes of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) * sizeof(TCHAR) - -Notes: - psz can be null but the function will fail - - cbMax should be greater than or equal to sizeof(TCHAR) or the function will fail - -Return Value: - - STATUS_SUCCESS - psz is non-null and the length including the null - terminator is less than or equal to cbMax bytes - - failure - the operation did not succeed - - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -__checkReturn -NTSTRSAFEDDI -RtlStringCbLengthA( - __in STRSAFE_PCNZCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH * sizeof(char)) size_t cbMax, - __out_opt __deref_out_range(<, cbMax) size_t* pcbLength) -{ - NTSTATUS status; - size_t cchMax = cbMax / sizeof(char); - size_t cchLength = 0; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringLengthWorkerA(psz, cchMax, &cchLength); - } - - if (pcbLength) - { - if (NT_SUCCESS(status)) - { - // safe to multiply cchLength * sizeof(char) since cchLength < NTSTRSAFE_MAX_CCH and sizeof(char) is 1 - *pcbLength = cchLength * sizeof(char); - } - else - { - *pcbLength = 0; - } - } - - return status; -} - -__checkReturn -NTSTRSAFEDDI -RtlStringCbLengthW( - __in STRSAFE_PCNZWCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbMax, - __out_opt __deref_out_range(<, cbMax - 1) size_t* pcbLength) -{ - NTSTATUS status; - size_t cchMax = cbMax / sizeof(wchar_t); - size_t cchLength = 0; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlStringLengthWorkerW(psz, cchMax, &cchLength); - } - - if (pcbLength) - { - if (NT_SUCCESS(status)) - { - // safe to multiply cchLength * sizeof(wchar_t) since cchLength < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbLength = cchLength * sizeof(wchar_t); - } - else - { - *pcbLength = 0; - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnalignedStringCchLength( - __in LPCUTSTR psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength OPTIONAL - ); - -Routine Description: - - This routine is a version of RtlStringCchLength that accepts an unaligned string pointer. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string is non-null and the length including the null - terminator is less than or equal to cchMax characters. - -Arguments: - - psz - string to check the length of - - cchMax - maximum number of characters including the null terminator - that psz is allowed to contain - - pcch - if the function succeeds and pcch is non-null, the current length - in characters of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) - -Notes: - psz can be null but the function will fail - - cchMax should be greater than zero or the function will fail - -Return Value: - - STATUS_SUCCESS - psz is non-null and the length including the null - terminator is less than or equal to cchMax characters - - failure - the operation did not succeed - - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -#ifdef ALIGNMENT_MACHINE -__checkReturn -NTSTRSAFEDDI -RtlUnalignedStringCchLengthW( - __in STRSAFE_PCUNZWCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlUnalignedStringLengthWorkerW(psz, cchMax, pcchLength); - } - - if (!NT_SUCCESS(status) && pcchLength) - { - *pcchLength = 0; - } - - return status; -} -#else -#define RtlUnalignedStringCchLengthW RtlStringCchLengthW -#endif // !ALIGNMENT_MACHINE -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnalignedStringCbLength( - __in LPCUTSTR psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH * sizeof(TCHAR)) size_t cbMax, - __out_opt __deref_out_range(<, cbMax) size_t* pcbLength OPTIONAL - ); - -Routine Description: - - This routine is a version of RtlStringCbLength that accepts an unaligned string pointer. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string is non-null and the length including the null - terminator is less than or equal to cbMax bytes. - -Arguments: - - psz - string to check the length of - - cbMax - maximum number of bytes including the null terminator - that psz is allowed to contain - - pcb - if the function succeeds and pcb is non-null, the current length - in bytes of psz excluding the null terminator will be returned. - This out parameter is equivalent to the return value of strlen(psz) * sizeof(TCHAR) - -Notes: - psz can be null but the function will fail - - cbMax should be greater than or equal to sizeof(TCHAR) or the function will fail - -Return Value: - - STATUS_SUCCESS - psz is non-null and the length including the null - terminator is less than or equal to cbMax bytes - - failure - the operation did not succeed - - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -#ifdef ALIGNMENT_MACHINE -__checkReturn -NTSTRSAFEDDI -RtlUnalignedStringCbLengthW( - __in STRSAFE_PCUNZWCH psz, - __in __in_range(1, NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbMax, - __out_opt __deref_out_range(<, cbMax - 1) size_t* pcbLength) -{ - NTSTATUS status; - size_t cchMax = cbMax / sizeof(wchar_t); - size_t cchLength = 0; - - if ((psz == NULL) || (cchMax > NTSTRSAFE_MAX_CCH)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlUnalignedStringLengthWorkerW(psz, cchMax, &cchLength); - } - - if (pcbLength) - { - if (NT_SUCCESS(status)) - { - // safe to multiply cchLength * sizeof(wchar_t) since cchLength < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbLength = cchLength * sizeof(wchar_t); - } - else - { - *pcbLength = 0; - } - } - - return status; -} -#else -#define RtlUnalignedStringCbLengthW RtlStringCbLengthW -#endif // !ALIGNMENT_MACHINE -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - -#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - -/*++ - -NTSTATUS -RtlUnicodeStringInit( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc OPTIONAL - ); - -Routine Description: - - The RtlUnicodeStringInit function initializes a counted unicode string from - pszSrc. - - This function returns an NTSTATUS value. It returns STATUS_SUCCESS if the - counted unicode string was sucessfully initialized from pszSrc. In failure - cases the unicode string buffer will be set to NULL, and the Length and - MaximumLength members will be set to zero. - -Arguments: - - DestinationString - pointer to the counted unicode string to be initialized - - pszSrc - source string which must be null or null terminated - -Notes: - DestinationString should not be NULL. See RtlUnicodeStringInitEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - - - failure - the operation did not succeed - - STATUS_INVALID_PARAMETER - - this return value is an indication that the source string - was too large and DestinationString could not be initialized - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringInit( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc) -{ - return RtlUnicodeStringInitWorker(DestinationString, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); -} - - -/*++ - -NTSTATUS -RtlUnicodeStringInitEx( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - In addition to functionality provided by RtlUnicodeStringInit, this routine - includes the flags parameter allows additional controls. - - This function returns an NTSTATUS value. It returns STATUS_SUCCESS if the - counted unicode string was sucessfully initialized from pszSrc. In failure - cases the unicode string buffer will be set to NULL, and the Length and - MaximumLength members will be set to zero. - -Arguments: - - DestinationString - pointer to the counted unicode string to be initialized - - pszSrc - source string which must be null terminated - - dwFlags - controls some details of the initialization: - - STRSAFE_IGNORE_NULLS - do not fault on a NULL DestinationString pointer - -Return Value: - - STATUS_SUCCESS - - - failure - the operation did not succeed - - STATUS_INVALID_PARAMETER - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringInitEx( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc, - __in DWORD dwFlags) -{ - NTSTATUS status; - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlUnicodeStringInitWorker(DestinationString, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - } - - if (!NT_SUCCESS(status) && DestinationString) - { - DestinationString->Length = 0; - DestinationString->MaximumLength = 0; - DestinationString->Buffer = NULL; - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringValidate( - __in PCUNICODE_STRING SourceString - ); - -Routine Description: - - The RtlUnicodeStringValidate function checks the counted unicode string to make - sure that is is valid. - - This function returns an NTSTATUS value. It returns STATUS_SUCCESS if the - counted unicode string is valid. - -Arguments: - - SourceString - pointer to the counted unicode string to be checked - -Notes: - SourceString should not be NULL. See RtlUnicodeStringValidateEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - SourceString is a valid counted unicode string - - failure - the operation did not succeed - - STATUS_INVALID_PARAMETER - - this return value is an indication that SourceString is not a valid - counted unicode string - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringValidate( - __in PCUNICODE_STRING SourceString) -{ - return RtlUnicodeStringValidateWorker(SourceString, NTSTRSAFE_UNICODE_STRING_MAX_CCH, 0); -} - - -/*++ - -NTSTATUS -RtlUnicodeStringValidateEx( - __in PCUNICODE_STRING SourceString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - In addition to functionality provided by RtlUnicodeStringValidate, this routine - includes the flags parameter allows additional controls. - - This function returns an NTSTATUS value. It returns STATUS_SUCCESS if the - counted unicode string is valid. - -Arguments: - - SourceString - pointer to the counted unicode string to be checked - - dwFlags - controls some details of the validation: - - STRSAFE_IGNORE_NULLS - allows SourceString to be NULL (will return STATUS_SUCCESS for this case). - -Return Value: - - STATUS_SUCCESS - SourceString is a valid counted unicode string - - failure - the operation did not succeed - - STATUS_INVALID_PARAMETER - - this return value is an indication that the source string - is not a valide counted unicode string given the flags passed. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringValidateEx( - __in PCUNICODE_STRING SourceString, - __in DWORD dwFlags) -{ - NTSTATUS status; - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlUnicodeStringValidateWorker(SourceString, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlStringCchCopyUnicodeString( - __out_ecount(cchDest) PWSTR pszDest, - __in size_t cchDest, - __in PCUNICODE_STRING SourceString, - ); - -Routine Description: - - This routine copies a PUNICODE_STRING to a PWSTR. This function will not - write past the end of this buffer and it will ALWAYS null terminate the - destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation, otherwise it - will return a failure code. In failure cases as much of SourceString will be - copied to pszDest as possible. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = ((DestinationString->Length / sizeof(wchar_t)) + 1) - to hold all of the source and null terminate the string. - - SourceString - pointer to the counted unicode source string - -Notes: - Behavior is undefined if source and destination strings overlap. - - SourceString and pszDest should not be NULL. See RtlStringCchCopyUnicodeStringEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyUnicodeString( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in PCUNICODE_STRING SourceString) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, - cchDest, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWideCharArrayWorker(pszDest, - cchDest, - NULL, - pszSrc, - cchSrcLength); - } - else - { - *pszDest = L'\0'; - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlStringCbCopyUnicodeString( - __out_bcount(cbDest) PWSTR pszDest, - __in size_t cbDest, - __in PCUNICODE_STRING SourceString, - ); - -Routine Description: - - This routine copies a PUNICODE_STRING to a PWSTR. This function will not - write past the end of this buffer and it will ALWAYS null terminate the - destination buffer (unless it is zero length). - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation, otherwise it - will return a failure code. In failure cases as much of SourceString will be - copied to pszDest as possible. - -Arguments: - - pszDest - destination string - - cbDest - size of destination buffer in bytes. - length must be = (DestinationString->Length + sizeof(wchar_t)) - to hold all of the source and null terminate the string. - - SourceString - pointer to the counted unicode source string - -Notes: - Behavior is undefined if source and destination strings overlap. - - SourceString and pszDest should not be NULL. See RtlStringCbCopyUnicodeStringEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result and is - null terminated. This is useful for situations where - truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyUnicodeString( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in PCUNICODE_STRING SourceString) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringValidateDestW(pszDest, - cchDest, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - status = RtlStringCopyWideCharArrayWorker(pszDest, - cchDest, - NULL, - pszSrc, - cchSrcLength); - } - else - { - // Suppress espx false positive - cchDest cannot be 0 here -#pragma warning(push) -#pragma warning(disable : __WARNING_POTENTIAL_BUFFER_OVERFLOW_HIGH_PRIORITY) - *pszDest = L'\0'; -#pragma warning(pop) - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlStringCchCopyUnicodeStringEx( - __out_ecount(cchDest) PWSTR pszDest OPTIONAL, - __in size_t cchDest, - __in PCUNICODE_STRING SourceString OPTIONAL, - __deref_opt_out_ecount(*pcchRemaining) PWSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcchRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine copies a PUNICODE_STRING to a PWSTR. In addition to - functionality provided by RtlStringCchCopyUnicodeString, this routine also - returns a pointer to the end of the destination string and the number of - characters left in the destination string including the null terminator. - The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = ((DestinationString->Length / sizeof(wchar_t)) + 1) - to hold all of the source and null terminate the string. - - SourceString - pointer to the counted unicode source string - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcchRemaining - if pcchRemaining is non-null, the function will return the - number of characters left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCchCopyUnicodeStringEx( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __in PCUNICODE_STRING SourceString, - __deref_opt_out_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcchRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - - status = RtlStringExValidateDestW(pszDest, - cchDest, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (cchSrcLength != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWideCharArrayWorker(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchSrcLength); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND_NULL) && - (cchRemaining > 1)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cchDest != 0)) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcchRemaining) - { - *pcchRemaining = cchRemaining; - } - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlStringCbCopyUnicodeStringEx( - __out_bcount(cbDest) PWSTR pszDest OPTIONAL, - __in size_t cbDest, - __in PCUNICODE_STRING SourceString OPTIONAL, - __deref_opt_out_bcount(*pcbRemaining) PWSTR* ppszDestEnd OPTIONAL, - __out_opt size_t* pcbRemaining OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine copies a PUNICODE_STRING to a PWSTR. In addition to - functionality provided by RtlStringCbCopyUnicodeString, this routine also - returns a pointer to the end of the destination string and the number of - characters left in the destination string including the null terminator. - The flags parameter allows additional controls. - -Arguments: - - pszDest - destination string - - cchDest - size of destination buffer in characters. - length must be = ((DestinationString->Length / sizeof(wchar_t)) + 1) - to hold all of the source and null terminate the string. - - SourceString - pointer to the counted unicode source string - - ppszDestEnd - if ppszDestEnd is non-null, the function will return a - pointer to the end of the destination string. If the - function copied any data, the result will point to the - null termination character - - pcbRemaining - pcbRemaining is non-null,the function will return the - number of bytes left in the destination string, - including the null terminator - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND_NULL - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - behind the null terminator - - STRSAFE_IGNORE_NULLS - treat NULL string pointers like empty strings (TEXT("")). - this flag is useful for emulating functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer, and it will - be null terminated. This will overwrite any truncated - string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_NULL_ON_FAILURE - if the function fails, the destination buffer will be set - to the empty string. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied and the - resultant dest string was null terminated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlStringCbCopyUnicodeStringEx( - __out_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cbDest, - __in PCUNICODE_STRING SourceString, - __deref_opt_out_bcount(*pcbRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out_opt size_t* pcbRemaining, - __in DWORD dwFlags) -{ - NTSTATUS status; - size_t cchDest = cbDest / sizeof(wchar_t); - - status = RtlStringExValidateDestW(pszDest, - cchDest, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (cchSrcLength != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlStringCopyWideCharArrayWorker(pszDest, - cchDest, - &cchCopied, - pszSrc, - cchSrcLength); - - pszDestEnd = pszDest + cchCopied; - cchRemaining = cchDest - cchCopied; - - if (NT_SUCCESS(status) && (dwFlags & STRSAFE_FILL_BEHIND_NULL)) - { - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - - // handle the STRSAFE_FILL_BEHIND_NULL flag - RtlStringExHandleFillBehindNullW(pszDestEnd, cbRemaining, dwFlags); - } - } - } - else - { - if (cchDest != 0) - { - *pszDest = L'\0'; - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_NULL_ON_FAILURE)) && - (cbDest != 0)) - { - // handle the STRSAFE_FILL_ON_FAILURE, STRSAFE_NULL_ON_FAILURE, and STRSAFE_NO_TRUNCATION flags - RtlStringExHandleOtherFlagsW(pszDest, - cbDest, - 0, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (ppszDestEnd) - { - *ppszDestEnd = pszDestEnd; - } - - if (pcbRemaining) - { - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_MAX_CCH and sizeof(wchar_t) is 2 - *pcbRemaining = (cchRemaining * sizeof(wchar_t)) + (cbDest % sizeof(wchar_t)); - } - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCopyString( - __out PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' for - UNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation, otherwise it - will return a failure code. In failure cases as much of pszSrc will be - copied to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCopyStringEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCopyString( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchNewDestLength = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCopy( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' for - UNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was copied without truncation, otherwise it - will return a failure code. In failure cases as much of SourceString - will be copied to Dest as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL. See RtlUnicodeStringCopyEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCopy( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchSrcLength); - } - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCopyStringEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in LPCTSTR pszSrc OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' for - UNICODE_STRINGs with some additional parameters. In addition to the - functionality provided by RtlUnicodeStringCopyString, this routine also - returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string which must be null terminated - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored. - - Behavior is undefined if DestinationString and RemainingString are the same pointer. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCopyStringEx( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCopyEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcpy' for - UNICODE_STRINGs with some additional parameters. In addition to the - functionality provided by RtlUnicodeStringCopy, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored. - - Behavior is undefined if DestinationString and RemainingString are the same pointer. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCopyEx( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (cchSrcLength != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchSrcLength); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCopyStringN( - __out PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc, - __in size_t cchToCopy - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cchToCopy characters were - copied without truncation, otherwise it will return a failure code. In - failure cases as much of pszSrc will be copied to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cchToCopy - maximum number of characters to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCchCopyStringNEx if - you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCopyStringN( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToCopy) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchNewDestLength = 0; - - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - } - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCopyStringN( - __out PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc, - __in size_t cbToCopy - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cbToCopy bytes were - copied without truncation, otherwise it will return a failure code. In - failure cases as much of pszSrc will be copied to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cbToCopy - maximum number of bytes to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCopyCbStringEx if you require - the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCopyStringN( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cbToCopy) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchNewDestLength = 0; - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - } - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCopyN( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToCopy - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cchToCopy characters were - copied without truncation, otherwise it will return a failure code. In - failure cases as much of SourceString will be copied to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cchToCopy - maximum number of characters to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL. See RtlUnicodeStringCchCopyNEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCopyN( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToCopy) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToCopy) - { - cchToCopy = cchSrcLength; - } - - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - } - } - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCopyN( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToCopy - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the entire string or the first cbToCopy bytes were - copied without truncation, otherwise it will return a failure code. In - failure cases as much of SourceString will be copied to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cbToCopy - maximum number of bytes to copy from source string, - not including the null terminator. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL. See RtlUnicodeStringCbCopyNEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - - -NTSTRSAFEDDI -RtlUnicodeStringCbCopyN( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToCopy) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToCopy) - { - cchToCopy = cchSrcLength; - } - - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - } - } - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCopyStringNEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cchToCopy, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCchCopyStringN, this routine also - returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cchToCopy - maximum number of characters to copy from source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - pszDest and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both pszDest and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCopyStringNEx( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToCopy, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlStringExValidateSrcW(&pszSrc, &cchToCopy, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCopyStringNEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cbToCopy, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCbCopyStringN, this routine also - returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cbToCopy - maximum number of bytes to copy from source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCopyStringNEx( - __out PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cbToCopy, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - - status = RtlStringExValidateSrcW(&pszSrc, &cchToCopy, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if ((cchToCopy != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyStringWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCopyNEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __in size_t cchToCopy, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCchCopyN, this - routine also returns a PUNICODE_STRING which points to the end of the - destination string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cchToCopy - maximum number of characters to copy from source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL SourceString like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCopyNEx( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToCopy, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToCopy) - { - cchToCopy = cchSrcLength; - } - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (cchToCopy != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCopyNEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __in size_t cbToCopy, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncpy' with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCbCopyN, this - routine also returns a PUNICODE_STRING which points to the end of the - destination string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cbToCopy - maximum number of bytes to copy from source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL SourceString like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all copied - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the copy - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCopyNEx( - __out PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToCopy, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - size_t cchToCopy = cbToCopy / sizeof(wchar_t); - - if (cchToCopy > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToCopy) - { - cchToCopy = cchSrcLength; - } - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually src data to copy - if (cchToCopy != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayCopyWorker(pszDest, - cchDest, - &cchNewDestLength, - pszSrc, - cchToCopy); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -/*++ - -NTSTATUS -RtlUnicodeStringCatString( - __inout PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc - ); - - Routine Description: - - This routine is a safer version of the C built-in function 'strcat' for - UNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was concatenated without truncation, otherwise - it will return a failure code. In failure cases as much of pszSrc will be - appended to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string which must be null terminated - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCatStringEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCatString( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCat( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString - ); - - Routine Description: - - This routine is a safer version of the C built-in function 'strcat' for - UNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was concatenated without truncation, otherwise - it will return a failure code. In failure cases as much of SourceString will be - appended to DestinationString as possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCatEx - if you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function. - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCat( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - cchSrcLength); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCatStringEx( - __inout PUNICODE_STRING DestinationString OPTTONAL, - __in LPCTSTR pszSrc OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' for - PUNICODE_STRINGs with some additional parameters. In addition to the - functionality provided by RtlUnicodeStringCatString, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string which must be null terminated - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap or if - DestinationString and RemainingString are the same pointer. - - DestinationString and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCatStringEx( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - - status = RtlStringExValidateSrcW(&pszSrc, NULL, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if (*pszSrc != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - NTSTRSAFE_UNICODE_STRING_MAX_CCH); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringCatEx( - __inout PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strcat' for - PUNICODE_STRINGs with some additional parameters. In addition to the - functionality provided by RtlUnicodeStringCat, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap or if - DestinationString and RemainingString are the same pointer. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was source data and it was all concatenated - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCatEx( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if (cchSrcLength != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchSrcLength); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCatStringN( - __inout PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc, - __in size_t cchToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of pszSrc or the first cchToAppend characters were - appended to the destination string, otherwise it will return a failure - code. In failure cases as much of pszSrc will be appended to DestinationString as - possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cchToAppend - maximum number of characters to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCchCatStringNEx if - you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cchToAppend characters were - concatenated to DestinationString - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCatStringN( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToAppend) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - cchToAppend); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCatStringN( - __inout PUNICODE_STRING DestinationString, - __in LPCTSTR pszSrc, - __in size_t cbToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of pszSrc or the first cbToAppend bytes were - appended to the destination string, otherwise it will return a failure - code. In failure cases as much of pszSrc will be appended to DestinationString as - possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cbToAppend - maximum number of bytes to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL. See RtlUnicodeStringCbCatStringNEx if - you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cbToAppend bytes were - concatenated to pszDest - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCatStringN( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cbToAppend) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - cchToAppend); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCatN( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of SourceString or the first cchToAppend characters were - appended to the destination string, otherwise it will return a failure - code. In failure cases as much of SourceString will be appended to DestinationString as - possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cchToAppend - maximum number of characters to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL. See RtlUnicodeStringCchCatNEx if - you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of SourceString or the first cchToAppend characters were - concatenated to DestinationString - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCatN( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToAppend) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - size_t cchCopied = 0; - - if (cchSrcLength < cchToAppend) - { - cchToAppend = cchSrcLength; - } - - status = RtlWideCharArrayCopyWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - cchToAppend); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCatN( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToAppend - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if all of SourceString or the first cbToAppend bytes were - appended to the destination string, otherwise it will return a failure - code. In failure cases as much of SourceString will be appended to DestinationString as - possible. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cbToAppend - maximum number of bytes to append - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL. See RtlUnicodeStringCbCatNEx if - you require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if all of SourceString or the first cbToAppend bytes were - concatenated to pszDest - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCatN( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToAppend) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - size_t cchCopied = 0; - - if (cchSrcLength < cchToAppend) - { - cchToAppend = cchSrcLength; - } - - status = RtlWideCharArrayCopyWorker(pszDest + cchDestLength, - cchDest - cchDestLength, - &cchCopied, - pszSrc, - cchToAppend); - - // safe to multiply (cchDestLength + cchCopied) * sizeof(wchar_t) since (cchDestLength + cchCopied) < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)((cchDestLength + cchCopied) * sizeof(wchar_t)); - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCatStringNEx( - __inout PUNICODE_STRING DestinationString OPTIONAL, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cchToAppend, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCchCatStringN, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cchToAppend - maximum number of characters to append - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cchToAppend characters were - concatenated to DestinationString - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCatStringNEx( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToAppend, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - - status = RtlStringExValidateSrcW(&pszSrc, &cchToAppend, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCatStringNEx( - __inout PUNICODE_STRING DestinationString OPTIONAL, - __in LPCTSTR pszSrc OPTIONAL, - __in size_t cbToAppend, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCbCatStringN, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszSrc - source string - - cbToAppend - maximum number of bytes to append - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszSrc like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and pszSrc should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and pszSrc - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of pszSrc or the first cbToAppend bytes were - concatenated to pszDest - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCatStringNEx( - __inout PUNICODE_STRING DestinationString, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cbToAppend, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - - status = RtlStringExValidateSrcW(&pszSrc, &cchToAppend, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if ((cchToAppend != 0) && (*pszSrc != L'\0')) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CCH_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCchCatNEx( - __inout PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __in size_t cchToAppend, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCchCatN, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cchToAppend - maximum number of characters to append - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL SourceString like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of SourceString or the first cchToAppend characters were - concatenated to DestinationString - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCchCatNEx( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cchToAppend, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToAppend) - { - cchToAppend = cchSrcLength; - } - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if (cchToAppend != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyStringWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CCH_FUNCTIONS - - -#ifndef NTSTRSAFE_NO_CB_FUNCTIONS -/*++ - -NTSTATUS -RtlUnicodeStringCbCatNEx( - __inout PUNICODE_STRING DestinationString OPTIONAL, - __in PCUNICODE_STRING SourceString OPTIONAL, - __in size_t cbToAppend, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'strncat', with - some additional parameters and for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringCbCatN, this routine - also returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - SourceString - pointer to the counted unicode source string - - cbToAppend - maximum number of bytes to append - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL SourceString like - empty strings (L""). This flag is useful for emulating - functions like lstrcpy - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - STRSAFE_NO_TRUNCATION - if the function returns STATUS_BUFFER_OVERFLOW, pszDest - will not contain a truncated string, it will remain unchanged. - -Notes: - Behavior is undefined if source and destination strings overlap. - - DestinationString and SourceString should not be NULL unless the STRSAFE_IGNORE_NULLS flag - is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and SourceString - may be NULL. An error may still be returned even though NULLS are ignored - due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if all of SourceString or the first cbToAppend bytes were - concatenated to DestinationString - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. - This is useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringCbCatNEx( - __inout PUNICODE_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in size_t cbToAppend, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - size_t cchDestLength; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - &cchDestLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszSrc; - size_t cchSrcLength; - wchar_t* pszDestEnd = pszDest + cchDestLength; - size_t cchRemaining = cchDest - cchDestLength; - size_t cchNewDestLength = cchDestLength; - - status = RtlUnicodeStringValidateSrcWorker(SourceString, - &pszSrc, - &cchSrcLength, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - size_t cchToAppend = cbToAppend / sizeof(wchar_t); - - if (cchToAppend > NTSTRSAFE_UNICODE_STRING_MAX_CCH) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - if (cchSrcLength < cchToAppend) - { - cchToAppend = cchSrcLength; - } - - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchRemaining == 0) - { - // only fail if there was actually src data to append - if (cchToAppend != 0) - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - size_t cchCopied = 0; - - status = RtlWideCharArrayCopyWorker(pszDestEnd, - cchRemaining, - &cchCopied, - pszSrc, - cchToAppend); - - pszDestEnd = pszDestEnd + cchCopied; - cchRemaining = cchRemaining - cchCopied; - - cchNewDestLength = cchDestLength + cchCopied; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - cchDestLength, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} -#endif // !NTSTRSAFE_NO_CB_FUNCTIONS - - -/*++ - -NTSTATUS -RtlUnicodeStringVPrintf( - __out PUNICODE_STRING DestinationString, - __in __format_string PCWSTR pszFormat, - __in va_list argList - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation, otherwise it - will return a failure code. In failure cases it will return a truncated - version of the ideal result. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - DestinationString and pszFormat should not be NULL. See RtlUnicodeStringVPrintfEx if you - require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringVPrintf( - __out PUNICODE_STRING DestinationString, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - size_t cchNewDestLength = 0; - - status = RtlWideCharArrayVPrintfWorker(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringVPrintfEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags, - __in __format_string PCWSTR pszFormat OPTIONAL, - __in va_list argList - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'vsprintf' with - some additional parameters for PUNICODE_STRING. In addition to the - functionality provided by RtlUnicodeStringVPrintf, this routine also - returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszFormat like - empty strings (L""). - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - argList - va_list from the variable arguments according to the - stdarg.h convention - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - DestinationString and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringVPrintfEx( - __out PUNICODE_STRING DestinationString, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - status = RtlWideCharArrayVPrintfWorker(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - - -#ifndef _M_CEE_PURE - -/*++ - -NTSTATUS -RtlUnicodeStringPrintf( - __out PUNICODE_STRING DestinationString, - __in __format_string PCWSTR pszFormat, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf' for - PUNICODE_STRINGs. - - This function returns an NTSTATUS value, and not a pointer. It returns - STATUS_SUCCESS if the string was printed without truncation, otherwise it - will return a failure code. In failure cases it will return a truncated - version of the ideal result. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - DestinationString and pszFormat should not be NULL. See RtlUnicodeStringPrintfEx if you - require the handling of NULL values. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string - - failure - the operation did not succeed - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringPrintf( - __out PUNICODE_STRING DestinationString, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - 0); - - if (NT_SUCCESS(status)) - { - va_list argList; - size_t cchNewDestLength = 0; - - va_start(argList, pszFormat); - - status = RtlWideCharArrayVPrintfWorker(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - return status; -} - - -/*++ - -NTSTATUS -RtlUnicodeStringPrintfEx( - __out PUNICODE_STRING DestinationString OPTIONAL, - __out_opt PUNICODE_STRING RemainingString OPTIONAL, - __in DWORD dwFlags, - __in __format_string PCWSTR pszFormat OPTIONAL, - ... - ); - -Routine Description: - - This routine is a safer version of the C built-in function 'sprintf' with - some additional parameters for PUNICODE_STRINGs. In addition to the - functionality provided by RtlUnicodeStringPrintf, this routine also - returns a PUNICODE_STRING which points to the end of the destination - string. The flags parameter allows additional controls. - -Arguments: - - DestinationString - pointer to the counted unicode destination string - - RemainingString - if RemainingString is non-null, the function will format - the pointer with the remaining buffer and number of - bytes left in the destination string - - dwFlags - controls some details of the string copy: - - STRSAFE_FILL_BEHIND - if the function succeeds, the low byte of dwFlags will be - used to fill the uninitialize part of destination buffer - - STRSAFE_IGNORE_NULLS - do not fault if DestinationString is null and treat NULL pszFormat like - empty strings (L""). - - STRSAFE_FILL_ON_FAILURE - if the function fails, the low byte of dwFlags will be - used to fill all of the destination buffer. This will - overwrite any truncated string returned when the failure is - STATUS_BUFFER_OVERFLOW - - STRSAFE_NO_TRUNCATION / - STRSAFE_ZERO_LENGTH_ON_FAILURE - if the function fails, the destination Length will be set - to zero. This will overwrite any truncated string - returned when the failure is STATUS_BUFFER_OVERFLOW. - - pszFormat - format string which must be null terminated - - ... - additional parameters to be formatted according to - the format string - -Notes: - Behavior is undefined if destination, format strings or any arguments - strings overlap. - - DestinationString and pszFormat should not be NULL unless the STRSAFE_IGNORE_NULLS - flag is specified. If STRSAFE_IGNORE_NULLS is passed, both DestinationString and - pszFormat may be NULL. An error may still be returned even though NULLS - are ignored due to insufficient space. - -Return Value: - - STATUS_SUCCESS - if there was sufficient space in the dest buffer for - the resultant string - - failure - the operation did not succeed - - - STATUS_BUFFER_OVERFLOW - Note: This status has the severity class Warning - IRPs completed with this - status do have their data copied back to user mode - - this return value is an indication that the print - operation failed due to insufficient space. When this - error occurs, the destination buffer is modified to - contain a truncated version of the ideal result. This is - useful for situations where truncation is ok. - - It is strongly recommended to use the NT_SUCCESS() macro to test the - return value of this function - ---*/ - -NTSTRSAFEDDI -RtlUnicodeStringPrintfEx( - __out PUNICODE_STRING DestinationString, - __out_opt PUNICODE_STRING RemainingString, - __in DWORD dwFlags, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - ...) -{ - NTSTATUS status; - wchar_t* pszDest; - size_t cchDest; - - status = RtlUnicodeStringValidateDestWorker(DestinationString, - &pszDest, - &cchDest, - NULL, - NTSTRSAFE_UNICODE_STRING_MAX_CCH, - dwFlags); - - if (NT_SUCCESS(status)) - { - wchar_t* pszDestEnd = pszDest; - size_t cchRemaining = cchDest; - size_t cchNewDestLength = 0; - - status = RtlStringExValidateSrcW(&pszFormat, NULL, NTSTRSAFE_UNICODE_STRING_MAX_CCH, dwFlags); - - if (NT_SUCCESS(status)) - { - if (dwFlags & (~STRSAFE_UNICODE_STRING_VALID_FLAGS)) - { - status = STATUS_INVALID_PARAMETER; - } - else if (cchDest == 0) - { - // only fail if there was actually a non-empty format string - if (*pszFormat != L'\0') - { - if (pszDest == NULL) - { - status = STATUS_INVALID_PARAMETER; - } - else - { - status = STATUS_BUFFER_OVERFLOW; - } - } - } - else - { - va_list argList; - - va_start(argList, pszFormat); - - status = RtlWideCharArrayVPrintfWorker(pszDest, - cchDest, - &cchNewDestLength, - pszFormat, - argList); - - va_end(argList); - - pszDestEnd = pszDest + cchNewDestLength; - cchRemaining = cchDest - cchNewDestLength; - - if (NT_SUCCESS(status) && - (dwFlags & STRSAFE_FILL_BEHIND) && - (cchRemaining != 0)) - { - // handle the STRSAFE_FILL_BEHIND flag - RtlUnicodeStringExHandleFill(pszDestEnd, cchRemaining, dwFlags); - } - } - } - - if (!NT_SUCCESS(status) && - (dwFlags & (STRSAFE_NO_TRUNCATION | STRSAFE_FILL_ON_FAILURE | STRSAFE_ZERO_LENGTH_ON_FAILURE)) && - (cchDest != 0)) - { - // handle the STRSAFE_NO_TRUNCATION, STRSAFE_FILL_ON_FAILURE, and STRSAFE_ZERO_LENGTH_ON_FAILURE flags - RtlUnicodeStringExHandleOtherFlags(pszDest, - cchDest, - 0, - &cchNewDestLength, - &pszDestEnd, - &cchRemaining, - dwFlags); - } - - if (DestinationString) - { - // safe to multiply cchNewDestLength * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - DestinationString->Length = (USHORT)(cchNewDestLength * sizeof(wchar_t)); - } - - if (NT_SUCCESS(status) || (status == STATUS_BUFFER_OVERFLOW)) - { - if (RemainingString) - { - RemainingString->Length = 0; - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - RemainingString->MaximumLength = (USHORT)(cchRemaining * sizeof(wchar_t)); - RemainingString->Buffer = pszDestEnd; - } - } - } - - return status; -} - -#endif // !_M_CEE_PURE - -#endif // !NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - -#endif // !NTSTRSAFE_LIB_IMPL - - -// Below here are the worker functions that actually do the work - -#if defined(NTSTRSAFE_LIB_IMPL) || !defined(NTSTRSAFE_LIB) - -NTSTRSAFEWORKERDDI -RtlStringLengthWorkerA( - __in STRSAFE_PCNZCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchOriginalMax = cchMax; - - while (cchMax && (*psz != '\0')) - { - psz++; - cchMax--; - } - - if (cchMax == 0) - { - // the string is longer than cchMax - status = STATUS_INVALID_PARAMETER; - } - - if (pcchLength) - { - if (NT_SUCCESS(status)) - { - *pcchLength = cchOriginalMax - cchMax; - } - else - { - *pcchLength = 0; - } - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringLengthWorkerW( - __in STRSAFE_PCNZWCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchOriginalMax = cchMax; - - while (cchMax && (*psz != L'\0')) - { - psz++; - cchMax--; - } - - if (cchMax == 0) - { - // the string is longer than cchMax - status = STATUS_INVALID_PARAMETER; - } - - if (pcchLength) - { - if (NT_SUCCESS(status)) - { - *pcchLength = cchOriginalMax - cchMax; - } - else - { - *pcchLength = 0; - } - } - - return status; -} - -#ifdef ALIGNMENT_MACHINE -NTSTRSAFEWORKERDDI -RtlUnalignedStringLengthWorkerW( - __in STRSAFE_PCUNZWCH psz, - __in __in_range(<=, NTSTRSAFE_MAX_CCH) size_t cchMax, - __out_opt __deref_out_range(<, cchMax) size_t* pcchLength) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchOriginalMax = cchMax; - - while (cchMax && (*psz != L'\0')) - { - psz++; - cchMax--; - } - - if (cchMax == 0) - { - // the string is longer than cchMax - status = STATUS_INVALID_PARAMETER; - } - - if (pcchLength) - { - if (NT_SUCCESS(status)) - { - *pcchLength = cchOriginalMax - cchMax; - } - else - { - *pcchLength = 0; - } - } - - return status; -} -#endif // ALIGNMENT_MACHINE - -// Intentionally allow null deref when STRSAFE_IGNORE_NULLS is not present. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -#pragma warning(disable : __WARNING_RETURNING_BAD_RESULT) - -NTSTRSAFEWORKERDDI -RtlStringExValidateSrcA( - __deref_in_opt_out NTSTRSAFE_PCSTR* ppszSrc, - __inout_opt __deref_out_range(<, cchMax) size_t* pcchToRead, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (pcchToRead && (*pcchToRead >= cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - else if ((dwFlags & STRSAFE_IGNORE_NULLS) && (*ppszSrc == NULL)) - { - *ppszSrc = ""; - - if (pcchToRead) - { - *pcchToRead = 0; - } - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringExValidateSrcW( - __deref_in_opt_out NTSTRSAFE_PCWSTR* ppszSrc, - __inout_opt __deref_out_range(<, cchMax) size_t* pcchToRead, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (pcchToRead && (*pcchToRead >= cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - else if ((dwFlags & STRSAFE_IGNORE_NULLS) && (*ppszSrc == NULL)) - { - *ppszSrc = L""; - - if (pcchToRead) - { - *pcchToRead = 0; - } - } - - return status; -} - -#pragma warning(pop) // allow null deref - -#pragma warning(push) -#pragma warning(disable : 4100) // Unused parameter (pszDest) -NTSTRSAFEWORKERDDI -RtlStringValidateDestA( - __in_ecount_opt(cchDest) STRSAFE_PCNZCH pszDest, - __in size_t cchDest, - __in const size_t cchMax) -{ - NTSTATUS status = STATUS_SUCCESS; - - if ((cchDest == 0) || (cchDest > cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - - return status; -} -#pragma warning(pop) - -// Intentionally allow null deref when STRSAFE_IGNORE_NULLS is not present. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -NTSTRSAFEWORKERDDI -RtlStringValidateDestAndLengthA( - __in_ecount_opt(cchDest) NTSTRSAFE_PCSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax) -{ - NTSTATUS status; - - status = RtlStringValidateDestA(pszDest, cchDest, cchMax); - - if (NT_SUCCESS(status)) - { - status = RtlStringLengthWorkerA(pszDest, cchDest, pcchDestLength); - } - else - { - *pcchDestLength = 0; - } - - return status; -} -// End intentionally allow null deref. -#pragma warning(pop) - -#pragma warning(push) -#pragma warning(disable : 4100) // Unused parameter (pszDest) -NTSTRSAFEWORKERDDI -RtlStringValidateDestW( - __in_ecount_opt(cchDest) STRSAFE_PCNZWCH pszDest, - __in size_t cchDest, - __in const size_t cchMax) -{ - NTSTATUS status = STATUS_SUCCESS; - - if ((cchDest == 0) || (cchDest > cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - - return status; -} -#pragma warning(pop) - -// Intentionally allow null deref when STRSAFE_IGNORE_NULLS is not present. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -NTSTRSAFEWORKERDDI -RtlStringValidateDestAndLengthW( - __in_ecount_opt(cchDest) NTSTRSAFE_PCWSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax) -{ - NTSTATUS status; - - status = RtlStringValidateDestW(pszDest, cchDest, cchMax); - - if (NT_SUCCESS(status)) - { - status = RtlStringLengthWorkerW(pszDest, cchDest, pcchDestLength); - } - else - { - *pcchDestLength = 0; - } - - return status; -} -// End intentionally allow null deref. -#pragma warning(pop) - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestA( - __in_ecount_opt(cchDest) STRSAFE_PCNZCH pszDest, - __in size_t cchDest, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (((pszDest == NULL) && (cchDest != 0)) || - (cchDest > cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - } - else - { - status = RtlStringValidateDestA(pszDest, cchDest, cchMax); - } - - return status; -} - -// Intentionally allow null deref when STRSAFE_IGNORE_NULLS is not present. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -NTSTRSAFEWORKERDDI -RtlStringExValidateDestAndLengthA( - __in_ecount_opt(cchDest) NTSTRSAFE_PCSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - status = RtlStringExValidateDestA(pszDest, cchDest, cchMax, dwFlags); - - if (!NT_SUCCESS(status) || (cchDest == 0)) - { - *pcchDestLength = 0; - } - else - { - status = RtlStringLengthWorkerA(pszDest, cchDest, pcchDestLength); - } - } - else - { - status = RtlStringValidateDestAndLengthA(pszDest, - cchDest, - pcchDestLength, - cchMax); - } - - return status; -} -// End intentionally allow null deref. -#pragma warning(pop) - -NTSTRSAFEWORKERDDI -RtlStringExValidateDestW( - __in_ecount_opt(cchDest) STRSAFE_PCNZWCH pszDest, - __in size_t cchDest, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - if (((pszDest == NULL) && (cchDest != 0)) || - (cchDest > cchMax)) - { - status = STATUS_INVALID_PARAMETER; - } - } - else - { - status = RtlStringValidateDestW(pszDest, cchDest, cchMax); - } - - return status; -} - -// Intentionally allow null deref when STRSAFE_IGNORE_NULLS is not present. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -NTSTRSAFEWORKERDDI -RtlStringExValidateDestAndLengthW( - __in_ecount_opt(cchDest) NTSTRSAFE_PCWSTR pszDest, - __in size_t cchDest, - __out __deref_out_range(<, cchDest) size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status; - - if (dwFlags & STRSAFE_IGNORE_NULLS) - { - status = RtlStringExValidateDestW(pszDest, cchDest, cchMax, dwFlags); - - if (!NT_SUCCESS(status) || (cchDest == 0)) - { - *pcchDestLength = 0; - } - else - { - status = RtlStringLengthWorkerW(pszDest, cchDest, pcchDestLength); - } - } - else - { - status = RtlStringValidateDestAndLengthW(pszDest, - cchDest, - pcchDestLength, - cchMax); - } - - return status; -} -// End intentionally allow null deref. -#pragma warning(pop) - -NTSTRSAFEWORKERDDI -RtlStringCopyWorkerA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, (cchToCopy < cchDest) ? cchToCopy : cchDest - 1) size_t* pcchNewDestLength, - __in_xcount(cchToCopy) STRSAFE_PCNZCH pszSrc, - __in __in_range(<, NTSTRSAFE_MAX_CCH) size_t cchToCopy) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchNewDestLength = 0; - - // ASSERT(cchDest != 0); - - while (cchDest && cchToCopy && (*pszSrc != '\0')) - { - *pszDest++ = *pszSrc++; - cchDest--; - cchToCopy--; - - cchNewDestLength++; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - cchNewDestLength--; - - status = STATUS_BUFFER_OVERFLOW; - } - - *pszDest = '\0'; - - if (pcchNewDestLength) - { - *pcchNewDestLength = cchNewDestLength; - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringCopyWorkerW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, (cchToCopy < cchDest) ? cchToCopy : cchDest - 1) size_t* pcchNewDestLength, - __in_xcount(cchToCopy) STRSAFE_PCNZWCH pszSrc, - __in __in_range(<, NTSTRSAFE_MAX_CCH) size_t cchToCopy) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchNewDestLength = 0; - - // ASSERT(cchDest != 0); - - while (cchDest && cchToCopy && (*pszSrc != L'\0')) - { - *pszDest++ = *pszSrc++; - cchDest--; - cchToCopy--; - - cchNewDestLength++; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - cchNewDestLength--; - - status = STATUS_BUFFER_OVERFLOW; - } - - *pszDest = L'\0'; - - if (pcchNewDestLength) - { - *pcchNewDestLength = cchNewDestLength; - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringVPrintfWorkerA( - __out_ecount(cchDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, cchDest - 1) size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status = STATUS_SUCCESS; - int iRet; - size_t cchMax; - size_t cchNewDestLength = 0; - - // leave the last space for the null terminator - cchMax = cchDest - 1; - -#if (NTSTRSAFE_USE_SECURE_CRT == 1) && !defined(NTSTRSAFE_LIB_IMPL) - iRet = _vsnprintf_s(pszDest, cchDest, cchMax, pszFormat, argList); -#else - #pragma warning(push) - #pragma warning(disable: __WARNING_BANNED_API_USAGE)// "STRSAFE not included" - iRet = _vsnprintf(pszDest, cchMax, pszFormat, argList); - #pragma warning(pop) -#endif - // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); - - if ((iRet < 0) || (((size_t)iRet) > cchMax)) - { - // need to null terminate the string - pszDest += cchMax; - *pszDest = '\0'; - - cchNewDestLength = cchMax; - - // we have truncated pszDest - status = STATUS_BUFFER_OVERFLOW; - } - else if (((size_t)iRet) == cchMax) - { - // need to null terminate the string - pszDest += cchMax; - *pszDest = '\0'; - - cchNewDestLength = cchMax; - } - else - { - cchNewDestLength = (size_t)iRet; - } - - if (pcchNewDestLength) - { - *pcchNewDestLength = cchNewDestLength; - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringVPrintfWorkerW( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(1, NTSTRSAFE_MAX_CCH) size_t cchDest, - __out_opt __deref_out_range(<=, cchDest - 1) size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status = STATUS_SUCCESS; - int iRet; - size_t cchMax; - size_t cchNewDestLength = 0; - - // leave the last space for the null terminator - cchMax = cchDest - 1; - -#if (NTSTRSAFE_USE_SECURE_CRT == 1) && !defined(NTSTRSAFE_LIB_IMPL) - iRet = _vsnwprintf_s(pszDest, cchDest, cchMax, pszFormat, argList); -#else - #pragma warning(push) - #pragma warning(disable: __WARNING_BANNED_API_USAGE)// "STRSAFE not included" - iRet = _vsnwprintf(pszDest, cchMax, pszFormat, argList); - #pragma warning(pop) -#endif - // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); - - if ((iRet < 0) || (((size_t)iRet) > cchMax)) - { - // need to null terminate the string - pszDest += cchMax; - *pszDest = L'\0'; - - cchNewDestLength = cchMax; - - // we have truncated pszDest - status = STATUS_BUFFER_OVERFLOW; - } - else if (((size_t)iRet) == cchMax) - { - // need to null terminate the string - pszDest += cchMax; - *pszDest = L'\0'; - - cchNewDestLength = cchMax; - } - else - { - cchNewDestLength = (size_t)iRet; - } - - if (pcchNewDestLength) - { - *pcchNewDestLength = cchNewDestLength; - } - - return status; -} - - -NTSTRSAFEWORKERDDI -RtlStringExHandleFillBehindNullA( - __inout_bcount(cbRemaining) NTSTRSAFE_PSTR pszDestEnd, - __in size_t cbRemaining, - __in DWORD dwFlags) -{ - if (cbRemaining > sizeof(char)) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), cbRemaining - sizeof(char)); - } - - return STATUS_SUCCESS; -} - -NTSTRSAFEWORKERDDI -RtlStringExHandleFillBehindNullW( - __inout_bcount(cbRemaining) NTSTRSAFE_PWSTR pszDestEnd, - __in size_t cbRemaining, - __in DWORD dwFlags) -{ - if (cbRemaining > sizeof(wchar_t)) - { - memset(pszDestEnd + 1, STRSAFE_GET_FILL_PATTERN(dwFlags), cbRemaining - sizeof(wchar_t)); - } - - return STATUS_SUCCESS; -} - -NTSTRSAFEWORKERDDI -RtlStringExHandleOtherFlagsA( - __inout_bcount(cbDest) NTSTRSAFE_PSTR pszDest, - __in __in_range(sizeof(char), NTSTRSAFE_MAX_CCH * sizeof(char)) size_t cbDest, - __in __in_range(<, cbDest / sizeof(char)) size_t cchOriginalDestLength, - __deref_inout_ecount(*pcchRemaining) NTSTRSAFE_PSTR* ppszDestEnd, - __out __deref_out_range(<=, cbDest / sizeof(char)) size_t* pcchRemaining, - __in DWORD dwFlags) -{ - size_t cchDest = cbDest / sizeof(char); - - if ((cchDest > 0) && (dwFlags & STRSAFE_NO_TRUNCATION)) - { - char* pszOriginalDestEnd; - - pszOriginalDestEnd = pszDest + cchOriginalDestLength; - - *ppszDestEnd = pszOriginalDestEnd; - *pcchRemaining = cchDest - cchOriginalDestLength; - - // null terminate the end of the original string - *pszOriginalDestEnd = '\0'; - } - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - } - else if (cchDest > 0) - { - char* pszDestEnd; - - pszDestEnd = pszDest + cchDest - 1; - - *ppszDestEnd = pszDestEnd; - *pcchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if ((cchDest > 0) && (dwFlags & STRSAFE_NULL_ON_FAILURE)) - { - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDest = '\0'; - } - - return STATUS_SUCCESS; -} - -NTSTRSAFEWORKERDDI -RtlStringExHandleOtherFlagsW( - __inout_bcount(cbDest) NTSTRSAFE_PWSTR pszDest, - __in __in_range(sizeof(wchar_t), NTSTRSAFE_MAX_CCH * sizeof(wchar_t)) size_t cbDest, - __in __in_range(<, cbDest / sizeof(wchar_t)) size_t cchOriginalDestLength, - __deref_inout_ecount(*pcchRemaining) NTSTRSAFE_PWSTR* ppszDestEnd, - __out __deref_out_range(<=, cbDest / sizeof(wchar_t)) size_t* pcchRemaining, - __in DWORD dwFlags) -{ - size_t cchDest = cbDest / sizeof(wchar_t); - - if ((cchDest > 0) && (dwFlags & STRSAFE_NO_TRUNCATION)) - { - wchar_t* pszOriginalDestEnd; - - pszOriginalDestEnd = pszDest + cchOriginalDestLength; - - *ppszDestEnd = pszOriginalDestEnd; - *pcchRemaining = cchDest - cchOriginalDestLength; - - // null terminate the end of the original string - *pszOriginalDestEnd = L'\0'; - } - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - if (STRSAFE_GET_FILL_PATTERN(dwFlags) == 0) - { - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - } - else if (cchDest > 0) - { - wchar_t* pszDestEnd; - - pszDestEnd = pszDest + cchDest - 1; - - *ppszDestEnd = pszDestEnd; - *pcchRemaining = 1; - - // null terminate the end of the string - *pszDestEnd = L'\0'; - } - } - - if ((cchDest > 0) && (dwFlags & STRSAFE_NULL_ON_FAILURE)) - { - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - - // null terminate the beginning of the string - *pszDest = L'\0'; - } - - return STATUS_SUCCESS; -} - -#ifndef NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - -NTSTRSAFEWORKERDDI -RtlUnicodeStringInitWorker( - __out PUNICODE_STRING DestinationString, - __in_opt NTSTRSAFE_PCWSTR pszSrc, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (DestinationString || !(dwFlags & STRSAFE_IGNORE_NULLS)) - { - DestinationString->Length = 0; - DestinationString->MaximumLength = 0; - DestinationString->Buffer = NULL; - } - - if (pszSrc) - { - size_t cchSrcLength; - - status = RtlStringLengthWorkerW(pszSrc, cchMax, &cchSrcLength); - - if (NT_SUCCESS(status)) - { - if (DestinationString) - { - size_t cbLength; - - // safe to multiply cchSrcLength * sizeof(wchar_t) since cchSrcLength < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - cbLength = cchSrcLength * sizeof(wchar_t); - - DestinationString->Length = (USHORT)cbLength; - // safe to add cbLength + sizeof(wchar_t) since cchSrcLength < NTSTRSAFE_UNICODE_STRING_MAX_CCH - DestinationString->MaximumLength = (USHORT)(cbLength + sizeof(wchar_t)); - DestinationString->Buffer = (PWSTR)pszSrc; - } - else - { - status = STATUS_INVALID_PARAMETER; - } - } - } - - return status; -} - -// Intentionally allow null deref in error cases. -#pragma warning(push) -#pragma warning(disable : __WARNING_DEREF_NULL_PTR) -#pragma warning(disable : __WARNING_INVALID_PARAM_VALUE_1) -#pragma warning(disable : __WARNING_RETURNING_BAD_RESULT) - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateWorker( - __in_opt PCUNICODE_STRING SourceString, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status = STATUS_SUCCESS; - - if (SourceString || !(dwFlags & STRSAFE_IGNORE_NULLS)) - { - if (((SourceString->Length % sizeof(wchar_t)) != 0) || - ((SourceString->MaximumLength % sizeof(wchar_t)) != 0) || - (SourceString->Length > SourceString->MaximumLength) || - (SourceString->MaximumLength > (cchMax * sizeof(wchar_t)))) - { - status = STATUS_INVALID_PARAMETER; - } - else if ((SourceString->Buffer == NULL) && - ((SourceString->Length != 0) || (SourceString->MaximumLength != 0))) - { - status = STATUS_INVALID_PARAMETER; - } - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateSrcWorker( - __in PCUNICODE_STRING SourceString, - __deref_out_ecount(*pcchSrcLength) wchar_t** ppszSrc, - __out size_t* pcchSrcLength, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status; - - *ppszSrc = NULL; - *pcchSrcLength = 0; - - status = RtlUnicodeStringValidateWorker(SourceString, cchMax, dwFlags); - - if (NT_SUCCESS(status)) - { - if (SourceString) - { - *ppszSrc = SourceString->Buffer; - *pcchSrcLength = SourceString->Length / sizeof(wchar_t); - } - - if ((*ppszSrc == NULL) && (dwFlags & STRSAFE_IGNORE_NULLS)) - { - *ppszSrc = L""; - } - } - - return status; -} -// End intentionally allow null deref. -#pragma warning(pop) - -NTSTRSAFEWORKERDDI -RtlUnicodeStringValidateDestWorker( - __in PCUNICODE_STRING DestinationString, - __deref_out_ecount(*pcchDest) wchar_t** ppszDest, - __out size_t* pcchDest, - __out_opt size_t* pcchDestLength, - __in const size_t cchMax, - __in DWORD dwFlags) -{ - NTSTATUS status; - - *ppszDest = NULL; - *pcchDest = 0; - - if (pcchDestLength) - { - *pcchDestLength = 0; - } - - status = RtlUnicodeStringValidateWorker(DestinationString, cchMax, dwFlags); - - if (NT_SUCCESS(status) && DestinationString) - { - *ppszDest = DestinationString->Buffer; - *pcchDest = DestinationString->MaximumLength / sizeof(wchar_t); - - if (pcchDestLength) - { - *pcchDestLength = DestinationString->Length / sizeof(wchar_t); - } - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlStringCopyWideCharArrayWorker( - __out_ecount(cchDest) NTSTRSAFE_PWSTR pszDest, - __in size_t cchDest, - __out_opt size_t* pcchNewDestLength, - __in_ecount(cchSrcLength) const wchar_t* pszSrc, - __in size_t cchSrcLength) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchNewDestLength = 0; - - // ASSERT(cchDest != 0); - - while (cchDest && cchSrcLength) - { - *pszDest++ = *pszSrc++; - cchDest--; - cchSrcLength--; - - cchNewDestLength++; - } - - if (cchDest == 0) - { - // we are going to truncate pszDest - pszDest--; - cchNewDestLength--; - - status = STATUS_BUFFER_OVERFLOW; - } - - *pszDest = L'\0'; - - if (pcchNewDestLength) - { - *pcchNewDestLength = cchNewDestLength; - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlWideCharArrayCopyStringWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in NTSTRSAFE_PCWSTR pszSrc, - __in size_t cchToCopy) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchNewDestLength = 0; - - while (cchDest && cchToCopy && (*pszSrc != L'\0')) - { - *pszDest++ = *pszSrc++; - cchDest--; - cchToCopy--; - - cchNewDestLength++; - } - - if ((cchDest == 0) && (cchToCopy != 0) && (*pszSrc != L'\0')) - { - // we are going to truncate pszDest - status = STATUS_BUFFER_OVERFLOW; - } - - *pcchNewDestLength = cchNewDestLength; - - return status; -} - -NTSTRSAFEWORKERDDI -RtlWideCharArrayCopyWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in_ecount(cchSrcLength) const wchar_t* pszSrc, - __in size_t cchSrcLength) -{ - NTSTATUS status = STATUS_SUCCESS; - size_t cchNewDestLength = 0; - - while (cchDest && cchSrcLength) - { - *pszDest++ = *pszSrc++; - cchDest--; - cchSrcLength--; - - cchNewDestLength++; - } - - if ((cchDest == 0) && (cchSrcLength != 0)) - { - // we are going to truncate pszDest - status = STATUS_BUFFER_OVERFLOW; - } - - *pcchNewDestLength = cchNewDestLength; - - return status; -} - -NTSTRSAFEWORKERDDI -RtlWideCharArrayVPrintfWorker( - __out_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __out size_t* pcchNewDestLength, - __in __format_string NTSTRSAFE_PCWSTR pszFormat, - __in va_list argList) -{ - NTSTATUS status = STATUS_SUCCESS; - int iRet; - - #pragma warning(push) - #pragma warning(disable: __WARNING_BANNED_API_USAGE)// "STRSAFE not included" - iRet = _vsnwprintf(pszDest, cchDest, pszFormat, argList); - #pragma warning(pop) - // ASSERT((iRet < 0) || (((size_t)iRet) <= cchMax)); - - if ((iRet < 0) || (((size_t)iRet) > cchDest)) - { - *pcchNewDestLength = cchDest; - - // we have truncated pszDest - status = STATUS_BUFFER_OVERFLOW; - } - else - { - *pcchNewDestLength = (size_t)iRet; - } - - return status; -} - -NTSTRSAFEWORKERDDI -RtlUnicodeStringExHandleFill( - __out_ecount(cchRemaining) wchar_t* pszDestEnd, - __in size_t cchRemaining, - __in DWORD dwFlags) -{ - size_t cbRemaining; - - // safe to multiply cchRemaining * sizeof(wchar_t) since cchRemaining < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - cbRemaining = cchRemaining * sizeof(wchar_t); - - memset(pszDestEnd, STRSAFE_GET_FILL_PATTERN(dwFlags), cbRemaining); - - return STATUS_SUCCESS; -} - -NTSTRSAFEWORKERDDI -RtlUnicodeStringExHandleOtherFlags( - __inout_ecount(cchDest) wchar_t* pszDest, - __in size_t cchDest, - __in size_t cchOriginalDestLength, - __out size_t* pcchNewDestLength, - __deref_out_ecount(*pcchRemaining) wchar_t** ppszDestEnd, - __out size_t* pcchRemaining, - __in DWORD dwFlags) -{ - if (dwFlags & STRSAFE_NO_TRUNCATION) - { - *ppszDestEnd = pszDest + cchOriginalDestLength; - *pcchRemaining = cchDest - cchOriginalDestLength; - - *pcchNewDestLength = cchOriginalDestLength; - } - - if (dwFlags & STRSAFE_FILL_ON_FAILURE) - { - size_t cbDest; - - // safe to multiply cchDest * sizeof(wchar_t) since cchDest < NTSTRSAFE_UNICODE_STRING_MAX_CCH and sizeof(wchar_t) is 2 - cbDest = cchDest * sizeof(wchar_t); - - memset(pszDest, STRSAFE_GET_FILL_PATTERN(dwFlags), cbDest); - - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - - *pcchNewDestLength = 0; - } - - if (dwFlags & STRSAFE_ZERO_LENGTH_ON_FAILURE) - { - *ppszDestEnd = pszDest; - *pcchRemaining = cchDest; - - *pcchNewDestLength = 0; - } - - return STATUS_SUCCESS; -} - -#endif // !NTSTRSAFE_NO_UNICODE_STRING_FUNCTIONS - -#endif // defined(NTSTRSAFE_LIB_IMPL) || !defined(NTSTRSAFE_LIB) - - -// Do not call these functions, they are worker functions for internal use within this file -#ifdef DEPRECATE_SUPPORTED -#pragma deprecated(RtlStringLengthWorkerA) -#pragma deprecated(RtlStringLengthWorkerW) -#pragma deprecated(RtlUnalignedStringLengthWorkerW) -#pragma deprecated(RtlStringExValidateSrcA) -#pragma deprecated(RtlStringExValidateSrcW) -#pragma deprecated(RtlStringValidateDestA) -#pragma deprecated(RtlStringValidateDestAndLengthA) -#pragma deprecated(RtlStringValidateDestW) -#pragma deprecated(RtlStringValidateDestAndLengthW) -#pragma deprecated(RtlStringExValidateDestA) -#pragma deprecated(RtlStringExValidateDestAndLengthA) -#pragma deprecated(RtlStringExValidateDestW) -#pragma deprecated(RtlStringExValidateDestAndLengthW) -#pragma deprecated(RtlStringCopyWorkerA) -#pragma deprecated(RtlStringCopyWorkerW) -#pragma deprecated(RtlStringVPrintfWorkerA) -#pragma deprecated(RtlStringVPrintfWorkerW) -#pragma deprecated(RtlStringExHandleFillBehindNullA) -#pragma deprecated(RtlStringExHandleFillBehindNullW) -#pragma deprecated(RtlStringExHandleOtherFlagsA) -#pragma deprecated(RtlStringExHandleOtherFlagsW) -#pragma deprecated(RtlUnicodeStringInitWorker) -#pragma deprecated(RtlUnicodeStringValidateWorker) -#pragma deprecated(RtlUnicodeStringValidateSrcWorker) -#pragma deprecated(RtlUnicodeStringValidateDestWorker) -#pragma deprecated(RtlStringCopyWideCharArrayWorker) -#pragma deprecated(RtlWideCharArrayCopyStringWorker) -#pragma deprecated(RtlWideCharArrayCopyWorker) -#pragma deprecated(RtlWideCharArrayVPrintfWorker) -#pragma deprecated(RtlUnicodeStringExHandleFill) -#pragma deprecated(RtlUnicodeStringExHandleOtherFlags) -#else -#define RtlStringLengthWorkerA RtlStringLengthWorkerA_instead_use_StringCchLengthA_or_StringCbLengthA -#define RtlStringLengthWorkerW RtlStringLengthWorkerW_instead_use_StringCchLengthW_or_StringCbLengthW -#define RtlUnalignedStringLengthWorkerW RtlUnalignedStringLengthWorkerW_instead_use_UnalignedStringCchLengthW -#define RtlStringExValidateSrcA RtlStringExValidateSrcA_do_not_call_this_function -#define RtlStringExValidateSrcW RtlStringExValidateSrcW_do_not_call_this_function -#define RtlStringValidateDestA RtlStringValidateDestA_do_not_call_this_function -#define RtlStringValidateDestAndLengthA RtlStringValidateDestAndLengthA_do_not_call_this_function -#define RtlStringValidateDestW RtlStringValidateDestW_do_not_call_this_function -#define RtlStringValidateDestAndLengthW RtlStringValidateDestAndLengthW_do_not_call_this_function -#define RtlStringExValidateDestA RtlStringExValidateDestA_do_not_call_this_function -#define RtlStringExValidateDestAndLengthA RtlStringExValidateDestAndLengthA_do_not_call_this_function -#define RtlStringExValidateDestW RtlStringExValidateDestW_do_not_call_this_function -#define RtlStringExValidateDestAndLengthW RtlStringExValidateDestAndLengthW_do_not_call_this_function -#define RtlStringCopyWorkerA RtlStringCopyWorkerA_instead_use_StringCchCopyA_or_StringCbCopyA -#define RtlStringCopyWorkerW RtlStringCopyWorkerW_instead_use_StringCchCopyW_or_StringCbCopyW -#define RtlStringVPrintfWorkerA RtlStringVPrintfWorkerA_instead_use_StringCchVPrintfA_or_StringCbVPrintfA -#define RtlStringVPrintfWorkerW RtlStringVPrintfWorkerW_instead_use_StringCchVPrintfW_or_StringCbVPrintfW -#define RtlStringExHandleFillBehindNullA RtlStringExHandleFillBehindNullA_do_not_call_this_function -#define RtlStringExHandleFillBehindNullW RtlStringExHandleFillBehindNullW_do_not_call_this_function -#define RtlStringExHandleOtherFlagsA RtlStringExHandleOtherFlagsA_do_not_call_this_function -#define RtlStringExHandleOtherFlagsW RtlStringExHandleOtherFlagsW_do_not_call_this_function -#define RtlUnicodeStringInitWorker RtlUnicodeStringInitWorker_instead_use_RtlUnicodeStringInit_or_RtlUnicodeStringInitEx -#define RtlUnicodeStringValidateWorker RtlUnicodeStringValidateWorker_instead_use_RtlUnicodeStringValidate_or_RtlUnicodeStringValidateEx -#define RtlUnicodeStringValidateSrcWorker RtlUnicodeStringValidateSrcWorker_do_not_call_this_function -#define RtlUnicodeStringValidateDestWorker RtlUnicodeStringValidateDestWorker_do_not_call_this_function -#define RtlStringCopyWideCharArrayWorker RtlStringCopyWideCharArrayWorker_instead_use_RtlStringCchCopyUnicodeString_or_RtlStringCbCopyUnicodeString -#define RtlWideCharArrayCopyStringWorker RtlWideCharArrayCopyStringWorker_instead_use_RtlUnicodeStringCopyString_or_RtlUnicodeStringCopyStringEx -#define RtlWideCharArrayCopyWorker RtlWideCharArrayCopyWorker_instead_use_RtlUnicodeStringCopy_or_RtlUnicodeStringCopyEx -#define RtlWideCharArrayVPrintfWorker RtlWideCharArrayVPrintfWorker_instead_use_RtlUnicodeStringVPrintf_or_RtlUnicodeStringPrintf -#define RtlUnicodeStringExHandleFill RtlUnicodeStringExHandleFill_do_not_call_this_function -#define RtlUnicodeStringExHandleOtherFlags RtlUnicodeStringExHandleOtherFlags_do_not_call_this_function -#endif // !DEPRECATE_SUPPORTED - - -#ifndef NTSTRSAFE_NO_DEPRECATE -// Deprecate all of the unsafe functions to generate compiletime errors. If you do not want -// this then you can #define NTSTRSAFE_NO_DEPRECATE before including this file -#ifdef DEPRECATE_SUPPORTED - -#pragma deprecated(strcpy) -#pragma deprecated(wcscpy) -#pragma deprecated(strcat) -#pragma deprecated(wcscat) -#pragma deprecated(sprintf) -#pragma deprecated(swprintf) -#pragma deprecated(vsprintf) -#pragma deprecated(vswprintf) -#pragma deprecated(_snprintf) -#pragma deprecated(_snwprintf) -#pragma deprecated(_vsnprintf) -#pragma deprecated(_vsnwprintf) - -#else // DEPRECATE_SUPPORTED - -#undef strcpy -#define strcpy strcpy_instead_use_StringCchCopyA_or_StringCbCopyA; - -#undef wcscpy -#define wcscpy wcscpy_instead_use_StringCchCopyW_or_StringCbCopyW; - -#undef strcat -#define strcat strcat_instead_use_StringCchCatA_or_StringCbCatA; - -#undef wcscat -#define wcscat wcscat_instead_use_StringCchCatW_or_StringCbCatW; - -#undef sprintf -#define sprintf sprintf_instead_use_StringCchPrintfA_or_StringCbPrintfA; - -#undef swprintf -#define swprintf swprintf_instead_use_StringCchPrintfW_or_StringCbPrintfW; - -#undef vsprintf -#define vsprintf vsprintf_instead_use_StringCchVPrintfA_or_StringCbVPrintfA; - -#undef vswprintf -#define vswprintf vswprintf_instead_use_StringCchVPrintfW_or_StringCbVPrintfW; - -#undef _snprintf -#define _snprintf _snprintf_instead_use_StringCchPrintfA_or_StringCbPrintfA; - -#undef _snwprintf -#define _snwprintf _snwprintf_instead_use_StringCchPrintfW_or_StringCbPrintfW; - -#undef _vsnprintf -#define _vsnprintf _vsnprintf_instead_use_StringCchVPrintfA_or_StringCbVPrintfA; - -#undef _vsnwprintf -#define _vsnwprintf _vsnwprintf_instead_use_StringCchVPrintfW_or_StringCbVPrintfW; - -#endif // DEPRECATE_SUPPORTED -#endif // !NTSTRSAFE_NO_DEPRECATE - -#pragma warning(pop) - -#endif // _NTSTRSAFE_H_INCLUDED_ - diff --git a/qt-correction-tool/pub/ddk/offreg.h b/qt-correction-tool/pub/ddk/offreg.h deleted file mode 100644 index 36ef21d..0000000 --- a/qt-correction-tool/pub/ddk/offreg.h +++ /dev/null @@ -1,214 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation - -Module Name: - - offreg.h - -Abstract: - - This module contains the header file for the - offreg utility. - ---*/ - -#pragma once - -#ifndef __OFFREG_H__ -#define __OFFREG_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#if defined(OFFREG_DLL) -#define ORAPI _declspec(dllexport) __stdcall -#else -#define ORAPI _declspec(dllimport) __stdcall -#endif - -typedef PVOID ORHKEY; -typedef ORHKEY *PORHKEY; - -VOID -ORAPI -ORGetVersion( - __out PDWORD pdwMajorVersion, - __out PDWORD pdwMinorVersion - ); - -DWORD -ORAPI -OROpenHive ( - __in PCWSTR lpHivePath, - __out PORHKEY phkResult - ); - -DWORD -ORAPI -ORCreateHive ( - __out PORHKEY phkResult - ); - -DWORD -ORAPI -ORCloseHive ( - __in ORHKEY Handle - ); - -DWORD -ORAPI -ORSaveHive ( - __in ORHKEY Handle, - __in PCWSTR lpHivePath, - __in DWORD dwOsMajorVersion, - __in DWORD dwOsMinorVersion - ); - -DWORD -ORAPI -OROpenKey ( - __in ORHKEY Handle, - __in_opt PCWSTR lpSubKeyName, - __out PORHKEY phkResult - ); - -DWORD -ORAPI -ORCloseKey ( - __in ORHKEY Handle - ); - -DWORD -ORAPI -ORCreateKey ( - __in ORHKEY Handle, - __in PCWSTR lpSubKey, - __in_opt PWSTR lpClass, - __in_opt DWORD dwOptions, - __in_opt PSECURITY_DESCRIPTOR pSecurityDescriptor, - __out PORHKEY phkResult, - __out_opt PDWORD pdwDisposition - ); - -DWORD -ORAPI -ORDeleteKey ( - __in ORHKEY Handle, - __in_opt PCWSTR lpSubKey - ); - -DWORD -ORAPI -ORQueryInfoKey ( - __in ORHKEY Handle, - __out_ecount_opt(*lpcClass) PWSTR lpClass, - __inout_opt PDWORD lpcClass, - __out_opt PDWORD lpcSubKeys, - __out_opt PDWORD lpcMaxSubKeyLen, - __out_opt PDWORD lpcMaxClassLen, - __out_opt PDWORD lpcValues, - __out_opt PDWORD lpcMaxValueNameLen, - __out_opt PDWORD lpcMaxValueLen, - __out_opt PDWORD lpcbSecurityDescriptor, - __out_opt PFILETIME lpftLastWriteTime - ); - -DWORD -ORAPI -OREnumKey ( - __in ORHKEY Handle, - __in DWORD dwIndex, - __out_ecount(*lpcName) PWSTR lpName, - __inout PDWORD lpcName, - __out_ecount_opt(*lpcClass) PWSTR lpClass, - __inout_opt PDWORD lpcClass, - __out_opt PFILETIME lpftLastWriteTime - ); - -DWORD -ORAPI -ORGetKeySecurity ( - __in ORHKEY Handle, - __in SECURITY_INFORMATION SecurityInformation, - __out_opt PSECURITY_DESCRIPTOR pSecurityDescriptor, - __inout PDWORD lpcbSecurityDescriptor - ); - -DWORD -ORAPI -ORSetKeySecurity ( - __in ORHKEY Handle, - __in SECURITY_INFORMATION SecurityInformation, - __in PSECURITY_DESCRIPTOR pSecurityDescriptor - ); - -DWORD -ORAPI -ORGetVirtualFlags ( - __in ORHKEY Handle, - __out PDWORD pdwFlags - ); - -DWORD -ORAPI -ORSetVirtualFlags ( - __in ORHKEY Handle, - __in DWORD dwFlags - ); - -DWORD -ORAPI -ORDeleteValue ( - __in ORHKEY Handle, - __in_opt PCWSTR lpValueName - ); - -DWORD -ORAPI -ORGetValue ( - __in ORHKEY Handle, - __in_opt PCWSTR lpSubKey, - __in_opt PCWSTR lpValue, - __out_opt PDWORD pdwType, - __out_bcount_opt(*pcbData) PVOID pvData, - __inout_opt PDWORD pcbData - ); - -DWORD -ORAPI -ORSetValue ( - __in ORHKEY Handle, - __in_opt PCWSTR lpValueName, - __in DWORD dwType, - __in_bcount_opt(cbData) const BYTE * lpData, - __in DWORD cbData - ); - -DWORD -ORAPI -OREnumValue ( - __in ORHKEY Handle, - __in DWORD dwIndex, - __out_ecount(*lpcValueName) PWSTR lpValueName, - __inout PDWORD lpcValueName, - __out_opt PDWORD lpType, - __out_bcount_opt(*lpcbData) PBYTE lpData, - __inout_opt PDWORD lpcbData - ); - -VOID -ORShutdown ( - VOID - ); - - -#ifdef __cplusplus -} -#endif - -#endif //__OFFREG_H__ - diff --git a/qt-correction-tool/pub/ddk/oledberr.h b/qt-correction-tool/pub/ddk/oledberr.h deleted file mode 100644 index fbac962..0000000 --- a/qt-correction-tool/pub/ddk/oledberr.h +++ /dev/null @@ -1,1829 +0,0 @@ -//----------------------------------------------------------------------------- -// File: OledbErr.mc -// -// Copyright: Copyright (c) Microsoft Corporation -// -// Contents: -// -// Comments: -// -// -//----------------------------------------------------------------------------- -#ifndef _MSADERR_H_ -#define _MSADERR_H_ -#ifndef FACILITY_WINDOWS -// -// Values are 32 bit values laid out as follows: -// -// 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 -// 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 -// +---+-+-+-----------------------+-------------------------------+ -// |Sev|C|R| Facility | Code | -// +---+-+-+-----------------------+-------------------------------+ -// -// where -// -// Sev - is the severity code -// -// 00 - Success -// 01 - Informational -// 10 - Warning -// 11 - Error -// -// C - is the Customer code flag -// -// R - is a reserved bit -// -// Facility - is the facility code -// -// Code - is the facility's status code -// -// -// Define the facility codes -// -#define FACILITY_WINDOWS 0x8 -#define FACILITY_STORAGE 0x3 -#define FACILITY_ITF 0x4 - - -// -// Define the severity codes -// -#define STATUS_SEVERITY_SUCCESS 0x0 -#define STATUS_SEVERITY_COERROR 0x2 - - -// -// MessageId: DB_E_BOGUS -// -// MessageText: -// -// Dummy error - need this error so that mc puts the above defines -// inside the FACILITY_WINDOWS guard, instead of leaving it empty -// -#define DB_E_BOGUS ((HRESULT)0x80040EFFL) - -#endif // FACILITY_WINDOWS - -// -// Codes 0x0e00-0x0eff are reserved for the OLE DB group of -// interfaces. -// -// Free codes are: -// -// Error: -// -// -// Success: -// 0x0eea -// -// - - -// -// OLEDBVER -// OLE DB version number (0x0270); this can be overridden with an older -// version number if necessary -// - -// If OLEDBVER is not defined, assume version 2.7 -#ifndef OLEDBVER -#define OLEDBVER 0x0270 -#endif - -// -// MessageId: DB_E_BADACCESSORHANDLE -// -// MessageText: -// -// Accessor is invalid. -// -#define DB_E_BADACCESSORHANDLE ((HRESULT)0x80040E00L) - -// -// MessageId: DB_E_ROWLIMITEXCEEDED -// -// MessageText: -// -// Row could not be inserted into the rowset without exceeding provider's maximum number of active rows. -// -#define DB_E_ROWLIMITEXCEEDED ((HRESULT)0x80040E01L) - -// -// MessageId: DB_E_READONLYACCESSOR -// -// MessageText: -// -// Accessor is read-only. Operation failed. -// -#define DB_E_READONLYACCESSOR ((HRESULT)0x80040E02L) - -// -// MessageId: DB_E_SCHEMAVIOLATION -// -// MessageText: -// -// Values violate the database schema. -// -#define DB_E_SCHEMAVIOLATION ((HRESULT)0x80040E03L) - -// -// MessageId: DB_E_BADROWHANDLE -// -// MessageText: -// -// Row handle is invalid. -// -#define DB_E_BADROWHANDLE ((HRESULT)0x80040E04L) - -// -// MessageId: DB_E_OBJECTOPEN -// -// MessageText: -// -// Object was open. -// -#define DB_E_OBJECTOPEN ((HRESULT)0x80040E05L) - -//@@@+ V1.5 -#if( OLEDBVER >= 0x0150 ) -// -// MessageId: DB_E_BADCHAPTER -// -// MessageText: -// -// Chapter is invalid. -// -#define DB_E_BADCHAPTER ((HRESULT)0x80040E06L) - -#endif // OLEDBVER >= 0x0150 -//@@@- V1.5 - -// -// MessageId: DB_E_CANTCONVERTVALUE -// -// MessageText: -// -// Data or literal value could not be converted to the type of the column in the data source, and the provider was unable to determine which columns could not be converted. Data overflow or sign mismatch was not the cause. -// -#define DB_E_CANTCONVERTVALUE ((HRESULT)0x80040E07L) - -// -// MessageId: DB_E_BADBINDINFO -// -// MessageText: -// -// Binding information is invalid. -// -#define DB_E_BADBINDINFO ((HRESULT)0x80040E08L) - -// -// MessageId: DB_SEC_E_PERMISSIONDENIED -// -// MessageText: -// -// Permission denied. -// -#define DB_SEC_E_PERMISSIONDENIED ((HRESULT)0x80040E09L) - -// -// MessageId: DB_E_NOTAREFERENCECOLUMN -// -// MessageText: -// -// Column does not contain bookmarks or chapters. -// -#define DB_E_NOTAREFERENCECOLUMN ((HRESULT)0x80040E0AL) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_E_LIMITREJECTED -// -// MessageText: -// -// Cost limits were rejected. -// -#define DB_E_LIMITREJECTED ((HRESULT)0x80040E0BL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -// -// MessageId: DB_E_NOCOMMAND -// -// MessageText: -// -// Command text was not set for the command object. -// -#define DB_E_NOCOMMAND ((HRESULT)0x80040E0CL) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_E_COSTLIMIT -// -// MessageText: -// -// Query plan within the cost limit cannot be found. -// -#define DB_E_COSTLIMIT ((HRESULT)0x80040E0DL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -// -// MessageId: DB_E_BADBOOKMARK -// -// MessageText: -// -// Bookmark is invalid. -// -#define DB_E_BADBOOKMARK ((HRESULT)0x80040E0EL) - -// -// MessageId: DB_E_BADLOCKMODE -// -// MessageText: -// -// Lock mode is invalid. -// -#define DB_E_BADLOCKMODE ((HRESULT)0x80040E0FL) - -// -// MessageId: DB_E_PARAMNOTOPTIONAL -// -// MessageText: -// -// No value given for one or more required parameters. -// -#define DB_E_PARAMNOTOPTIONAL ((HRESULT)0x80040E10L) - -// -// MessageId: DB_E_BADCOLUMNID -// -// MessageText: -// -// Column ID is invalid. -// -#define DB_E_BADCOLUMNID ((HRESULT)0x80040E11L) - -// -// MessageId: DB_E_BADRATIO -// -// MessageText: -// -// Numerator was greater than denominator. Values must express ratio between zero and 1. -// -#define DB_E_BADRATIO ((HRESULT)0x80040E12L) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: DB_E_BADVALUES -// -// MessageText: -// -// Value is invalid. -// -#define DB_E_BADVALUES ((HRESULT)0x80040E13L) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 - -// -// MessageId: DB_E_ERRORSINCOMMAND -// -// MessageText: -// -// One or more errors occurred during processing of command. -// -#define DB_E_ERRORSINCOMMAND ((HRESULT)0x80040E14L) - -// -// MessageId: DB_E_CANTCANCEL -// -// MessageText: -// -// Command cannot be canceled. -// -#define DB_E_CANTCANCEL ((HRESULT)0x80040E15L) - -// -// MessageId: DB_E_DIALECTNOTSUPPORTED -// -// MessageText: -// -// Command dialect is not supported by this provider. -// -#define DB_E_DIALECTNOTSUPPORTED ((HRESULT)0x80040E16L) - -// -// MessageId: DB_E_DUPLICATEDATASOURCE -// -// MessageText: -// -// Data source object could not be created because the named data source already exists. -// -#define DB_E_DUPLICATEDATASOURCE ((HRESULT)0x80040E17L) - -// -// MessageId: DB_E_CANNOTRESTART -// -// MessageText: -// -// Rowset position cannot be restarted. -// -#define DB_E_CANNOTRESTART ((HRESULT)0x80040E18L) - -// -// MessageId: DB_E_NOTFOUND -// -// MessageText: -// -// Object or data matching the name, range, or selection criteria was not found within the scope of this operation. -// -#define DB_E_NOTFOUND ((HRESULT)0x80040E19L) - -// -// MessageId: DB_E_NEWLYINSERTED -// -// MessageText: -// -// Identity cannot be determined for newly inserted rows. -// -#define DB_E_NEWLYINSERTED ((HRESULT)0x80040E1BL) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_E_CANNOTFREE -// -// MessageText: -// -// Provider has ownership of this tree. -// -#define DB_E_CANNOTFREE ((HRESULT)0x80040E1AL) - -// -// MessageId: DB_E_GOALREJECTED -// -// MessageText: -// -// Goal was rejected because no nonzero weights were specified for any goals supported. Current goal was not changed. -// -#define DB_E_GOALREJECTED ((HRESULT)0x80040E1CL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -// -// MessageId: DB_E_UNSUPPORTEDCONVERSION -// -// MessageText: -// -// Requested conversion is not supported. -// -#define DB_E_UNSUPPORTEDCONVERSION ((HRESULT)0x80040E1DL) - -// -// MessageId: DB_E_BADSTARTPOSITION -// -// MessageText: -// -// No rows were returned because the offset value moves the position before the beginning or after the end of the rowset. -// -#define DB_E_BADSTARTPOSITION ((HRESULT)0x80040E1EL) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: DB_E_NOQUERY -// -// MessageText: -// -// Information was requested for a query and the query was not set. -// -#define DB_E_NOQUERY ((HRESULT)0x80040E1FL) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 - -// -// MessageId: DB_E_NOTREENTRANT -// -// MessageText: -// -// Consumer's event handler called a non-reentrant method in the provider. -// -#define DB_E_NOTREENTRANT ((HRESULT)0x80040E20L) - -// -// MessageId: DB_E_ERRORSOCCURRED -// -// MessageText: -// -// Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. -// -#define DB_E_ERRORSOCCURRED ((HRESULT)0x80040E21L) - -// -// MessageId: DB_E_NOAGGREGATION -// -// MessageText: -// -// Non-NULL controlling IUnknown was specified, and either the requested interface was not -// IUnknown, or the provider does not support COM aggregation. -// -#define DB_E_NOAGGREGATION ((HRESULT)0x80040E22L) - -// -// MessageId: DB_E_DELETEDROW -// -// MessageText: -// -// Row handle referred to a deleted row or a row marked for deletion. -// -#define DB_E_DELETEDROW ((HRESULT)0x80040E23L) - -// -// MessageId: DB_E_CANTFETCHBACKWARDS -// -// MessageText: -// -// Rowset does not support fetching backward. -// -#define DB_E_CANTFETCHBACKWARDS ((HRESULT)0x80040E24L) - -// -// MessageId: DB_E_ROWSNOTRELEASED -// -// MessageText: -// -// Row handles must all be released before new ones can be obtained. -// -#define DB_E_ROWSNOTRELEASED ((HRESULT)0x80040E25L) - -// -// MessageId: DB_E_BADSTORAGEFLAG -// -// MessageText: -// -// One or more storage flags are not supported. -// -#define DB_E_BADSTORAGEFLAG ((HRESULT)0x80040E26L) - -//@@@+ V1.5 -#if( OLEDBVER >= 0x0150 ) -// -// MessageId: DB_E_BADCOMPAREOP -// -// MessageText: -// -// Comparison operator is invalid. -// -#define DB_E_BADCOMPAREOP ((HRESULT)0x80040E27L) - -#endif // OLEDBVER >= 0x0150 -//@@@- V1.5 - -// -// MessageId: DB_E_BADSTATUSVALUE -// -// MessageText: -// -// Status flag was neither DBCOLUMNSTATUS_OK nor -// DBCOLUMNSTATUS_ISNULL. -// -#define DB_E_BADSTATUSVALUE ((HRESULT)0x80040E28L) - -// -// MessageId: DB_E_CANTSCROLLBACKWARDS -// -// MessageText: -// -// Rowset does not support scrolling backward. -// -#define DB_E_CANTSCROLLBACKWARDS ((HRESULT)0x80040E29L) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_E_BADREGIONHANDLE -// -// MessageText: -// -// Region handle is invalid. -// -#define DB_E_BADREGIONHANDLE ((HRESULT)0x80040E2AL) - -// -// MessageId: DB_E_NONCONTIGUOUSRANGE -// -// MessageText: -// -// Set of rows is not contiguous to, or does not overlap, the rows in the watch region. -// -#define DB_E_NONCONTIGUOUSRANGE ((HRESULT)0x80040E2BL) - -// -// MessageId: DB_E_INVALIDTRANSITION -// -// MessageText: -// -// Transition from ALL* to MOVE* or EXTEND* was specified. -// -#define DB_E_INVALIDTRANSITION ((HRESULT)0x80040E2CL) - -// -// MessageId: DB_E_NOTASUBREGION -// -// MessageText: -// -// Region is not a proper subregion of the region identified by the watch region handle. -// -#define DB_E_NOTASUBREGION ((HRESULT)0x80040E2DL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -// -// MessageId: DB_E_MULTIPLESTATEMENTS -// -// MessageText: -// -// Multiple-statement commands are not supported by this provider. -// -#define DB_E_MULTIPLESTATEMENTS ((HRESULT)0x80040E2EL) - -// -// MessageId: DB_E_INTEGRITYVIOLATION -// -// MessageText: -// -// Value violated the integrity constraints for a column or table. -// -#define DB_E_INTEGRITYVIOLATION ((HRESULT)0x80040E2FL) - -// -// MessageId: DB_E_BADTYPENAME -// -// MessageText: -// -// Type name is invalid. -// -#define DB_E_BADTYPENAME ((HRESULT)0x80040E30L) - -// -// MessageId: DB_E_ABORTLIMITREACHED -// -// MessageText: -// -// Execution stopped because a resource limit was reached. No results were returned. -// -#define DB_E_ABORTLIMITREACHED ((HRESULT)0x80040E31L) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: DB_E_ROWSETINCOMMAND -// -// MessageText: -// -// Command object whose command tree contains a rowset or rowsets cannot be cloned. -// -#define DB_E_ROWSETINCOMMAND ((HRESULT)0x80040E32L) - -// -// MessageId: DB_E_CANTTRANSLATE -// -// MessageText: -// -// Current tree cannot be represented as text. -// -#define DB_E_CANTTRANSLATE ((HRESULT)0x80040E33L) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 - -// -// MessageId: DB_E_DUPLICATEINDEXID -// -// MessageText: -// -// Index already exists. -// -#define DB_E_DUPLICATEINDEXID ((HRESULT)0x80040E34L) - -// -// MessageId: DB_E_NOINDEX -// -// MessageText: -// -// Index does not exist. -// -#define DB_E_NOINDEX ((HRESULT)0x80040E35L) - -// -// MessageId: DB_E_INDEXINUSE -// -// MessageText: -// -// Index is in use. -// -#define DB_E_INDEXINUSE ((HRESULT)0x80040E36L) - -// -// MessageId: DB_E_NOTABLE -// -// MessageText: -// -// Table does not exist. -// -#define DB_E_NOTABLE ((HRESULT)0x80040E37L) - -// -// MessageId: DB_E_CONCURRENCYVIOLATION -// -// MessageText: -// -// Rowset used optimistic concurrency and the value of a column has changed since it was last read. -// -#define DB_E_CONCURRENCYVIOLATION ((HRESULT)0x80040E38L) - -// -// MessageId: DB_E_BADCOPY -// -// MessageText: -// -// Errors detected during the copy. -// -#define DB_E_BADCOPY ((HRESULT)0x80040E39L) - -// -// MessageId: DB_E_BADPRECISION -// -// MessageText: -// -// Precision is invalid. -// -#define DB_E_BADPRECISION ((HRESULT)0x80040E3AL) - -// -// MessageId: DB_E_BADSCALE -// -// MessageText: -// -// Scale is invalid. -// -#define DB_E_BADSCALE ((HRESULT)0x80040E3BL) - -// -// MessageId: DB_E_BADTABLEID -// -// MessageText: -// -// Table ID is invalid. -// -#define DB_E_BADTABLEID ((HRESULT)0x80040E3CL) - -// DB_E_BADID is deprecated; use DB_E_BADTABLEID instead -#define DB_E_BADID DB_E_BADTABLEID - -// -// MessageId: DB_E_BADTYPE -// -// MessageText: -// -// Type is invalid. -// -#define DB_E_BADTYPE ((HRESULT)0x80040E3DL) - -// -// MessageId: DB_E_DUPLICATECOLUMNID -// -// MessageText: -// -// Column ID already exists or occurred more than once in the array of columns. -// -#define DB_E_DUPLICATECOLUMNID ((HRESULT)0x80040E3EL) - -// -// MessageId: DB_E_DUPLICATETABLEID -// -// MessageText: -// -// Table already exists. -// -#define DB_E_DUPLICATETABLEID ((HRESULT)0x80040E3FL) - -// -// MessageId: DB_E_TABLEINUSE -// -// MessageText: -// -// Table is in use. -// -#define DB_E_TABLEINUSE ((HRESULT)0x80040E40L) - -// -// MessageId: DB_E_NOLOCALE -// -// MessageText: -// -// Locale ID is not supported. -// -#define DB_E_NOLOCALE ((HRESULT)0x80040E41L) - -// -// MessageId: DB_E_BADRECORDNUM -// -// MessageText: -// -// Record number is invalid. -// -#define DB_E_BADRECORDNUM ((HRESULT)0x80040E42L) - -// -// MessageId: DB_E_BOOKMARKSKIPPED -// -// MessageText: -// -// Form of bookmark is valid, but no row was found to match it. -// -#define DB_E_BOOKMARKSKIPPED ((HRESULT)0x80040E43L) - -// -// MessageId: DB_E_BADPROPERTYVALUE -// -// MessageText: -// -// Property value is invalid. -// -#define DB_E_BADPROPERTYVALUE ((HRESULT)0x80040E44L) - -// -// MessageId: DB_E_INVALID -// -// MessageText: -// -// Rowset is not chaptered. -// -#define DB_E_INVALID ((HRESULT)0x80040E45L) - -// -// MessageId: DB_E_BADACCESSORFLAGS -// -// MessageText: -// -// One or more accessor flags were invalid. -// -#define DB_E_BADACCESSORFLAGS ((HRESULT)0x80040E46L) - -// -// MessageId: DB_E_BADSTORAGEFLAGS -// -// MessageText: -// -// One or more storage flags are invalid. -// -#define DB_E_BADSTORAGEFLAGS ((HRESULT)0x80040E47L) - -// -// MessageId: DB_E_BYREFACCESSORNOTSUPPORTED -// -// MessageText: -// -// Reference accessors are not supported by this provider. -// -#define DB_E_BYREFACCESSORNOTSUPPORTED ((HRESULT)0x80040E48L) - -// -// MessageId: DB_E_NULLACCESSORNOTSUPPORTED -// -// MessageText: -// -// Null accessors are not supported by this provider. -// -#define DB_E_NULLACCESSORNOTSUPPORTED ((HRESULT)0x80040E49L) - -// -// MessageId: DB_E_NOTPREPARED -// -// MessageText: -// -// Command was not prepared. -// -#define DB_E_NOTPREPARED ((HRESULT)0x80040E4AL) - -// -// MessageId: DB_E_BADACCESSORTYPE -// -// MessageText: -// -// Accessor is not a parameter accessor. -// -#define DB_E_BADACCESSORTYPE ((HRESULT)0x80040E4BL) - -// -// MessageId: DB_E_WRITEONLYACCESSOR -// -// MessageText: -// -// Accessor is write-only. -// -#define DB_E_WRITEONLYACCESSOR ((HRESULT)0x80040E4CL) - -// -// MessageId: DB_SEC_E_AUTH_FAILED -// -// MessageText: -// -// Authentication failed. -// -#define DB_SEC_E_AUTH_FAILED ((HRESULT)0x80040E4DL) - -// -// MessageId: DB_E_CANCELED -// -// MessageText: -// -// Operation was canceled. -// -#define DB_E_CANCELED ((HRESULT)0x80040E4EL) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: DB_E_CHAPTERNOTRELEASED -// -// MessageText: -// -// Rowset is single-chaptered. The chapter was not released. -// -#define DB_E_CHAPTERNOTRELEASED ((HRESULT)0x80040E4FL) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 - -// -// MessageId: DB_E_BADSOURCEHANDLE -// -// MessageText: -// -// Source handle is invalid. -// -#define DB_E_BADSOURCEHANDLE ((HRESULT)0x80040E50L) - -// -// MessageId: DB_E_PARAMUNAVAILABLE -// -// MessageText: -// -// Provider cannot derive parameter information and SetParameterInfo has not been called. -// -#define DB_E_PARAMUNAVAILABLE ((HRESULT)0x80040E51L) - -// -// MessageId: DB_E_ALREADYINITIALIZED -// -// MessageText: -// -// Data source object is already initialized. -// -#define DB_E_ALREADYINITIALIZED ((HRESULT)0x80040E52L) - -// -// MessageId: DB_E_NOTSUPPORTED -// -// MessageText: -// -// Method is not supported by this provider. -// -#define DB_E_NOTSUPPORTED ((HRESULT)0x80040E53L) - -// -// MessageId: DB_E_MAXPENDCHANGESEXCEEDED -// -// MessageText: -// -// Number of rows with pending changes exceeded the limit. -// -#define DB_E_MAXPENDCHANGESEXCEEDED ((HRESULT)0x80040E54L) - -// -// MessageId: DB_E_BADORDINAL -// -// MessageText: -// -// Column does not exist. -// -#define DB_E_BADORDINAL ((HRESULT)0x80040E55L) - -// -// MessageId: DB_E_PENDINGCHANGES -// -// MessageText: -// -// Pending changes exist on a row with a reference count of zero. -// -#define DB_E_PENDINGCHANGES ((HRESULT)0x80040E56L) - -// -// MessageId: DB_E_DATAOVERFLOW -// -// MessageText: -// -// Literal value in the command exceeded the range of the type of the associated column. -// -#define DB_E_DATAOVERFLOW ((HRESULT)0x80040E57L) - -// -// MessageId: DB_E_BADHRESULT -// -// MessageText: -// -// HRESULT is invalid. -// -#define DB_E_BADHRESULT ((HRESULT)0x80040E58L) - -// -// MessageId: DB_E_BADLOOKUPID -// -// MessageText: -// -// Lookup ID is invalid. -// -#define DB_E_BADLOOKUPID ((HRESULT)0x80040E59L) - -// -// MessageId: DB_E_BADDYNAMICERRORID -// -// MessageText: -// -// DynamicError ID is invalid. -// -#define DB_E_BADDYNAMICERRORID ((HRESULT)0x80040E5AL) - -// -// MessageId: DB_E_PENDINGINSERT -// -// MessageText: -// -// Most recent data for a newly inserted row could not be retrieved because the insert is pending. -// -#define DB_E_PENDINGINSERT ((HRESULT)0x80040E5BL) - -// -// MessageId: DB_E_BADCONVERTFLAG -// -// MessageText: -// -// Conversion flag is invalid. -// -#define DB_E_BADCONVERTFLAG ((HRESULT)0x80040E5CL) - -// -// MessageId: DB_E_BADPARAMETERNAME -// -// MessageText: -// -// Parameter name is unrecognized. -// -#define DB_E_BADPARAMETERNAME ((HRESULT)0x80040E5DL) - -// -// MessageId: DB_E_MULTIPLESTORAGE -// -// MessageText: -// -// Multiple storage objects cannot be open simultaneously. -// -#define DB_E_MULTIPLESTORAGE ((HRESULT)0x80040E5EL) - -// -// MessageId: DB_E_CANTFILTER -// -// MessageText: -// -// Filter cannot be opened. -// -#define DB_E_CANTFILTER ((HRESULT)0x80040E5FL) - -// -// MessageId: DB_E_CANTORDER -// -// MessageText: -// -// Order cannot be opened. -// -#define DB_E_CANTORDER ((HRESULT)0x80040E60L) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: MD_E_BADTUPLE -// -// MessageText: -// -// Tuple is invalid. -// -#define MD_E_BADTUPLE ((HRESULT)0x80040E61L) - -// -// MessageId: MD_E_BADCOORDINATE -// -// MessageText: -// -// Coordinate is invalid. -// -#define MD_E_BADCOORDINATE ((HRESULT)0x80040E62L) - -// -// MessageId: MD_E_INVALIDAXIS -// -// MessageText: -// -// Axis is invalid. -// -#define MD_E_INVALIDAXIS ((HRESULT)0x80040E63L) - -// -// MessageId: MD_E_INVALIDCELLRANGE -// -// MessageText: -// -// One or more cell ordinals is invalid. -// -#define MD_E_INVALIDCELLRANGE ((HRESULT)0x80040E64L) - -// -// MessageId: DB_E_NOCOLUMN -// -// MessageText: -// -// Column ID is invalid. -// -#define DB_E_NOCOLUMN ((HRESULT)0x80040E65L) - -// -// MessageId: DB_E_COMMANDNOTPERSISTED -// -// MessageText: -// -// Command does not have a DBID. -// -#define DB_E_COMMANDNOTPERSISTED ((HRESULT)0x80040E67L) - -// -// MessageId: DB_E_DUPLICATEID -// -// MessageText: -// -// DBID already exists. -// -#define DB_E_DUPLICATEID ((HRESULT)0x80040E68L) - -// -// MessageId: DB_E_OBJECTCREATIONLIMITREACHED -// -// MessageText: -// -// Session cannot be created because maximum number of active sessions was already reached. Consumer must release one or more sessions before creating a new session object. -// -#define DB_E_OBJECTCREATIONLIMITREACHED ((HRESULT)0x80040E69L) - -// -// MessageId: DB_E_BADINDEXID -// -// MessageText: -// -// Index ID is invalid. -// -#define DB_E_BADINDEXID ((HRESULT)0x80040E72L) - -// -// MessageId: DB_E_BADINITSTRING -// -// MessageText: -// -// Format of the initialization string does not conform to the OLE DB specification. -// -#define DB_E_BADINITSTRING ((HRESULT)0x80040E73L) - -// -// MessageId: DB_E_NOPROVIDERSREGISTERED -// -// MessageText: -// -// No OLE DB providers of this source type are registered. -// -#define DB_E_NOPROVIDERSREGISTERED ((HRESULT)0x80040E74L) - -// -// MessageId: DB_E_MISMATCHEDPROVIDER -// -// MessageText: -// -// Initialization string specifies a provider that does not match the active provider. -// -#define DB_E_MISMATCHEDPROVIDER ((HRESULT)0x80040E75L) - -// -// MessageId: DB_E_BADCOMMANDID -// -// MessageText: -// -// DBID is invalid. -// -#define DB_E_BADCOMMANDID ((HRESULT)0x80040E76L) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 -//@@@+ V2.1 -#if( OLEDBVER >= 0x0210 ) -#define SEC_E_PERMISSIONDENIED DB_SEC_E_PERMISSIONDENIED -// -// MessageId: SEC_E_BADTRUSTEEID -// -// MessageText: -// -// Trustee is invalid. -// -#define SEC_E_BADTRUSTEEID ((HRESULT)0x80040E6AL) - -// -// MessageId: SEC_E_NOTRUSTEEID -// -// MessageText: -// -// Trustee was not recognized for this data source. -// -#define SEC_E_NOTRUSTEEID ((HRESULT)0x80040E6BL) - -// -// MessageId: SEC_E_NOMEMBERSHIPSUPPORT -// -// MessageText: -// -// Trustee does not support memberships or collections. -// -#define SEC_E_NOMEMBERSHIPSUPPORT ((HRESULT)0x80040E6CL) - -// -// MessageId: SEC_E_INVALIDOBJECT -// -// MessageText: -// -// Object is invalid or unknown to the provider. -// -#define SEC_E_INVALIDOBJECT ((HRESULT)0x80040E6DL) - -// -// MessageId: SEC_E_NOOWNER -// -// MessageText: -// -// Object does not have an owner. -// -#define SEC_E_NOOWNER ((HRESULT)0x80040E6EL) - -// -// MessageId: SEC_E_INVALIDACCESSENTRYLIST -// -// MessageText: -// -// Access entry list is invalid. -// -#define SEC_E_INVALIDACCESSENTRYLIST ((HRESULT)0x80040E6FL) - -// -// MessageId: SEC_E_INVALIDOWNER -// -// MessageText: -// -// Trustee supplied as owner is invalid or unknown to the provider. -// -#define SEC_E_INVALIDOWNER ((HRESULT)0x80040E70L) - -// -// MessageId: SEC_E_INVALIDACCESSENTRY -// -// MessageText: -// -// Permission in the access entry list is invalid. -// -#define SEC_E_INVALIDACCESSENTRY ((HRESULT)0x80040E71L) - -// -// MessageId: DB_E_BADCONSTRAINTTYPE -// -// MessageText: -// -// ConstraintType is invalid or not supported by the provider. -// -#define DB_E_BADCONSTRAINTTYPE ((HRESULT)0x80040E77L) - -// -// MessageId: DB_E_BADCONSTRAINTFORM -// -// MessageText: -// -// ConstraintType is not DBCONSTRAINTTYPE_FOREIGNKEY and cForeignKeyColumns is not zero. -// -#define DB_E_BADCONSTRAINTFORM ((HRESULT)0x80040E78L) - -// -// MessageId: DB_E_BADDEFERRABILITY -// -// MessageText: -// -// Specified deferrability flag is invalid or not supported by the provider. -// -#define DB_E_BADDEFERRABILITY ((HRESULT)0x80040E79L) - -// -// MessageId: DB_E_BADMATCHTYPE -// -// MessageText: -// -// MatchType is invalid or the value is not supported by the provider. -// -#define DB_E_BADMATCHTYPE ((HRESULT)0x80040E80L) - -// -// MessageId: DB_E_BADUPDATEDELETERULE -// -// MessageText: -// -// Constraint update rule or delete rule is invalid. -// -#define DB_E_BADUPDATEDELETERULE ((HRESULT)0x80040E8AL) - -// -// MessageId: DB_E_BADCONSTRAINTID -// -// MessageText: -// -// Constraint ID is invalid. -// -#define DB_E_BADCONSTRAINTID ((HRESULT)0x80040E8BL) - -// -// MessageId: DB_E_BADCOMMANDFLAGS -// -// MessageText: -// -// Command persistence flag is invalid. -// -#define DB_E_BADCOMMANDFLAGS ((HRESULT)0x80040E8CL) - -// -// MessageId: DB_E_OBJECTMISMATCH -// -// MessageText: -// -// rguidColumnType points to a GUID that does not match the object type of this column, or this column was not set. -// -#define DB_E_OBJECTMISMATCH ((HRESULT)0x80040E8DL) - -// -// MessageId: DB_E_NOSOURCEOBJECT -// -// MessageText: -// -// Source row does not exist. -// -#define DB_E_NOSOURCEOBJECT ((HRESULT)0x80040E91L) - -// -// MessageId: DB_E_RESOURCELOCKED -// -// MessageText: -// -// OLE DB object represented by this URL is locked by one or more other processes. -// -#define DB_E_RESOURCELOCKED ((HRESULT)0x80040E92L) - -// -// MessageId: DB_E_NOTCOLLECTION -// -// MessageText: -// -// Client requested an object type that is valid only for a collection. -// -#define DB_E_NOTCOLLECTION ((HRESULT)0x80040E93L) - -// -// MessageId: DB_E_READONLY -// -// MessageText: -// -// Caller requested write access to a read-only object. -// -#define DB_E_READONLY ((HRESULT)0x80040E94L) - -// -// MessageId: DB_E_ASYNCNOTSUPPORTED -// -// MessageText: -// -// Asynchronous binding is not supported by this provider. -// -#define DB_E_ASYNCNOTSUPPORTED ((HRESULT)0x80040E95L) - -// -// MessageId: DB_E_CANNOTCONNECT -// -// MessageText: -// -// Connection to the server for this URL cannot be established. -// -#define DB_E_CANNOTCONNECT ((HRESULT)0x80040E96L) - -// -// MessageId: DB_E_TIMEOUT -// -// MessageText: -// -// Timeout occurred when attempting to bind to the object. -// -#define DB_E_TIMEOUT ((HRESULT)0x80040E97L) - -// -// MessageId: DB_E_RESOURCEEXISTS -// -// MessageText: -// -// Object cannot be created at this URL because an object named by this URL already exists. -// -#define DB_E_RESOURCEEXISTS ((HRESULT)0x80040E98L) - -// -// MessageId: DB_E_RESOURCEOUTOFSCOPE -// -// MessageText: -// -// URL is outside of scope. -// -#define DB_E_RESOURCEOUTOFSCOPE ((HRESULT)0x80040E8EL) - -// -// MessageId: DB_E_DROPRESTRICTED -// -// MessageText: -// -// Column or constraint could not be dropped because it is referenced by a dependent view or constraint. -// -#define DB_E_DROPRESTRICTED ((HRESULT)0x80040E90L) - -// -// MessageId: DB_E_DUPLICATECONSTRAINTID -// -// MessageText: -// -// Constraint already exists. -// -#define DB_E_DUPLICATECONSTRAINTID ((HRESULT)0x80040E99L) - -// -// MessageId: DB_E_OUTOFSPACE -// -// MessageText: -// -// Object cannot be created at this URL because the server is out of physical storage. -// -#define DB_E_OUTOFSPACE ((HRESULT)0x80040E9AL) - -#define SEC_E_PERMISSIONDENIED DB_SEC_E_PERMISSIONDENIED -#endif // OLEDBVER >= 0x0210 -//@@@- V2.1 -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_SEC_E_SAFEMODE_DENIED -// -// MessageText: -// -// Safety settings on this computer prohibit accessing a data source on another domain. -// -#define DB_SEC_E_SAFEMODE_DENIED ((HRESULT)0x80040E9BL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -//@@@+ V2.6 -#if( OLEDBVER >= 0x0260 ) -// -// MessageId: DB_E_NOSTATISTIC -// -// MessageText: -// -// The specified statistic does not exist in the current data source or did not apply to the specified table or it does not support a histogram. -// -#define DB_E_NOSTATISTIC ((HRESULT)0x80040E9CL) - -// -// MessageId: DB_E_ALTERRESTRICTED -// -// MessageText: -// -// Column or table could not be altered because it is referenced by a constraint. -// -#define DB_E_ALTERRESTRICTED ((HRESULT)0x80040E9DL) - -// -// MessageId: DB_E_RESOURCENOTSUPPORTED -// -// MessageText: -// -// Requested object type is not supported by the provider. -// -#define DB_E_RESOURCENOTSUPPORTED ((HRESULT)0x80040E9EL) - -// -// MessageId: DB_E_NOCONSTRAINT -// -// MessageText: -// -// Constraint does not exist. -// -#define DB_E_NOCONSTRAINT ((HRESULT)0x80040E9FL) - -// -// MessageId: DB_E_COLUMNUNAVAILABLE -// -// MessageText: -// -// Requested column is valid, but could not be retrieved. This could be due to a forward only cursor attempting to go backwards in a row. -// -#define DB_E_COLUMNUNAVAILABLE ((HRESULT)0x80040EA0L) - -#endif // OLEDBVER >= 0x0260 -//@@@- V2.6 -// -// MessageId: DB_S_ROWLIMITEXCEEDED -// -// MessageText: -// -// Fetching requested number of rows will exceed total number of active rows supported by the rowset. -// -#define DB_S_ROWLIMITEXCEEDED ((HRESULT)0x00040EC0L) - -// -// MessageId: DB_S_COLUMNTYPEMISMATCH -// -// MessageText: -// -// One or more column types are incompatible. Conversion errors will occur during copying. -// -#define DB_S_COLUMNTYPEMISMATCH ((HRESULT)0x00040EC1L) - -// -// MessageId: DB_S_TYPEINFOOVERRIDDEN -// -// MessageText: -// -// Parameter type information was overridden by caller. -// -#define DB_S_TYPEINFOOVERRIDDEN ((HRESULT)0x00040EC2L) - -// -// MessageId: DB_S_BOOKMARKSKIPPED -// -// MessageText: -// -// Bookmark was skipped for deleted or nonmember row. -// -#define DB_S_BOOKMARKSKIPPED ((HRESULT)0x00040EC3L) - -//@@@+ V2.0 -#if( OLEDBVER >= 0x0200 ) -// -// MessageId: DB_S_NONEXTROWSET -// -// MessageText: -// -// No more rowsets. -// -#define DB_S_NONEXTROWSET ((HRESULT)0x00040EC5L) - -#endif // OLEDBVER >= 0x0200 -//@@@- V2.0 - -// -// MessageId: DB_S_ENDOFROWSET -// -// MessageText: -// -// Start or end of rowset or chapter was reached. -// -#define DB_S_ENDOFROWSET ((HRESULT)0x00040EC6L) - -// -// MessageId: DB_S_COMMANDREEXECUTED -// -// MessageText: -// -// Command was reexecuted. -// -#define DB_S_COMMANDREEXECUTED ((HRESULT)0x00040EC7L) - -// -// MessageId: DB_S_BUFFERFULL -// -// MessageText: -// -// Operation succeeded, but status array or string buffer could not be allocated. -// -#define DB_S_BUFFERFULL ((HRESULT)0x00040EC8L) - -// -// MessageId: DB_S_NORESULT -// -// MessageText: -// -// No more results. -// -#define DB_S_NORESULT ((HRESULT)0x00040EC9L) - -// -// MessageId: DB_S_CANTRELEASE -// -// MessageText: -// -// Server cannot release or downgrade a lock until the end of the transaction. -// -#define DB_S_CANTRELEASE ((HRESULT)0x00040ECAL) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_S_GOALCHANGED -// -// MessageText: -// -// Weight is not supported or exceeded the supported limit, and was set to 0 or the supported limit. -// -#define DB_S_GOALCHANGED ((HRESULT)0x00040ECBL) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -//@@@+ V1.5 -#if( OLEDBVER >= 0x0150 ) -// -// MessageId: DB_S_UNWANTEDOPERATION -// -// MessageText: -// -// Consumer does not want to receive further notification calls for this operation. -// -#define DB_S_UNWANTEDOPERATION ((HRESULT)0x00040ECCL) - -#endif // OLEDBVER >= 0x0150 -//@@@- V1.5 - -// -// MessageId: DB_S_DIALECTIGNORED -// -// MessageText: -// -// Input dialect was ignored and command was processed using default dialect. -// -#define DB_S_DIALECTIGNORED ((HRESULT)0x00040ECDL) - -// -// MessageId: DB_S_UNWANTEDPHASE -// -// MessageText: -// -// Consumer does not want to receive further notification calls for this phase. -// -#define DB_S_UNWANTEDPHASE ((HRESULT)0x00040ECEL) - -// -// MessageId: DB_S_UNWANTEDREASON -// -// MessageText: -// -// Consumer does not want to receive further notification calls for this reason. -// -#define DB_S_UNWANTEDREASON ((HRESULT)0x00040ECFL) - -//@@@+ V1.5 -#if( OLEDBVER >= 0x0150 ) -// -// MessageId: DB_S_ASYNCHRONOUS -// -// MessageText: -// -// Operation is being processed asynchronously. -// -#define DB_S_ASYNCHRONOUS ((HRESULT)0x00040ED0L) - -#endif // OLEDBVER >= 0x0150 -//@@@- V1.5 - -// -// MessageId: DB_S_COLUMNSCHANGED -// -// MessageText: -// -// Command was executed to reposition to the start of the rowset. Either the order of the columns changed, or columns were added to or removed from the rowset. -// -#define DB_S_COLUMNSCHANGED ((HRESULT)0x00040ED1L) - -// -// MessageId: DB_S_ERRORSRETURNED -// -// MessageText: -// -// Method had some errors, which were returned in the error array. -// -#define DB_S_ERRORSRETURNED ((HRESULT)0x00040ED2L) - -// -// MessageId: DB_S_BADROWHANDLE -// -// MessageText: -// -// Row handle is invalid. -// -#define DB_S_BADROWHANDLE ((HRESULT)0x00040ED3L) - -// -// MessageId: DB_S_DELETEDROW -// -// MessageText: -// -// Row handle referred to a deleted row. -// -#define DB_S_DELETEDROW ((HRESULT)0x00040ED4L) - -//@@@+ V2.5 -#if( OLEDBVER >= 0x0250 ) -// -// MessageId: DB_S_TOOMANYCHANGES -// -// MessageText: -// -// Provider cannot keep track of all the changes. Client must refetch the data associated with the watch region by using another method. -// -#define DB_S_TOOMANYCHANGES ((HRESULT)0x00040ED5L) - -#endif // OLEDBVER >= 0x0250 -//@@@- V2.5 - -// -// MessageId: DB_S_STOPLIMITREACHED -// -// MessageText: -// -// Execution stopped because a resource limit was reached. Results obtained so far were returned, but execution cannot resume. -// -#define DB_S_STOPLIMITREACHED ((HRESULT)0x00040ED6L) - -// -// MessageId: DB_S_LOCKUPGRADED -// -// MessageText: -// -// Lock was upgraded from the value specified. -// -#define DB_S_LOCKUPGRADED ((HRESULT)0x00040ED8L) - -// -// MessageId: DB_S_PROPERTIESCHANGED -// -// MessageText: -// -// One or more properties were changed as allowed by provider. -// -#define DB_S_PROPERTIESCHANGED ((HRESULT)0x00040ED9L) - -// -// MessageId: DB_S_ERRORSOCCURRED -// -// MessageText: -// -// Multiple-step operation completed with one or more errors. Check each status value. -// -#define DB_S_ERRORSOCCURRED ((HRESULT)0x00040EDAL) - -// -// MessageId: DB_S_PARAMUNAVAILABLE -// -// MessageText: -// -// Parameter is invalid. -// -#define DB_S_PARAMUNAVAILABLE ((HRESULT)0x00040EDBL) - -// -// MessageId: DB_S_MULTIPLECHANGES -// -// MessageText: -// -// Updating a row caused more than one row to be updated in the data source. -// -#define DB_S_MULTIPLECHANGES ((HRESULT)0x00040EDCL) - -//@@@+ V2.1 -#if( OLEDBVER >= 0x0210 ) -// -// MessageId: DB_S_NOTSINGLETON -// -// MessageText: -// -// Row object was requested on a non-singleton result. First row was returned. -// -#define DB_S_NOTSINGLETON ((HRESULT)0x00040ED7L) - -// -// MessageId: DB_S_NOROWSPECIFICCOLUMNS -// -// MessageText: -// -// Row has no row-specific columns. -// -#define DB_S_NOROWSPECIFICCOLUMNS ((HRESULT)0x00040EDDL) - -#endif // OLEDBVER >= 0x0210 -//@@@- V2.1 -// To help DSL display more meaningful error message, we need to overwrite system error message -// in the following two cases. -#ifdef MESSAGESANDHEADERS -//(0x80030002L)STG_E_FILENOTFOUND -// -// MessageId: STG_E_FILENOTFOUND -// -// MessageText: -// -// The file could not be found. -// -#define STG_E_FILENOTFOUND ((HRESULT)0x80030002L) - -//(0x80030003L)STG_E_PATHNOTFOUND -// -// MessageId: STG_E_PATHNOTFOUND -// -// MessageText: -// -// The path could not be found. -// -#define STG_E_PATHNOTFOUND ((HRESULT)0x80030003L) - -//(0x80030050L)STG_E_FILEALREADYEXISTS -// -// MessageId: STG_E_FILEALREADYEXISTS -// -// MessageText: -// -// The file already exists. -// -#define STG_E_FILEALREADYEXISTS ((HRESULT)0x80030050L) - -//(0x800300fbL)STG_E_INVALIDHEADER -// -// MessageId: STG_E_INVALIDHEADER -// -// MessageText: -// -// The file is not a valid compound file. -// -#define STG_E_INVALIDHEADER ((HRESULT)0x800300FBL) - -//(0x800300fcL)STG_E_INVALIDNAME -// -// MessageId: STG_E_INVALIDNAME -// -// MessageText: -// -// The name is not valid. -// -#define STG_E_INVALIDNAME ((HRESULT)0x800300FCL) - -//(0x80030104L)STG_E_OLDFORMAT -// -// MessageId: STG_E_OLDFORMAT -// -// MessageText: -// -// The compound file was produced with an incompatible version of storage. -// -#define STG_E_OLDFORMAT ((HRESULT)0x80030104L) - -//(0x80030105L)STG_E_OLDDLL -// -// MessageId: STG_E_OLDDLL -// -// MessageText: -// -// The compound file was produced with an incompatible version of storage. -// -#define STG_E_OLDDLL ((HRESULT)0x80030105L) - -#endif //MESSAGESANDHEADERS -#endif // _OLEDBERR_H_ - diff --git a/qt-correction-tool/pub/ddk/oprghdlr.h b/qt-correction-tool/pub/ddk/oprghdlr.h deleted file mode 100644 index 93d7563..0000000 --- a/qt-correction-tool/pub/ddk/oprghdlr.h +++ /dev/null @@ -1,135 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - oprghdlr.h - -Abstract: - - This header file contains the shared structures for the ACPI op region - registration DLL. - -Author: - - Vincent Geglia 09-Feb-2000 - -Environment: - - Kernel mode - -Notes: - - -Revision History: - - ---*/ - -#include "wdm.h" - -// -// Make sure that we define the right calling convention -// - -#ifdef EXPORT - #undef EXPORT -#endif -#define EXPORT __cdecl - -// -// Op region handler and callback function prototypes -// - -__drv_functionClass(ACPI_OP_REGION_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -VOID -EXPORT -ACPI_OP_REGION_CALLBACK ( - ); - -typedef ACPI_OP_REGION_CALLBACK *PACPI_OP_REGION_CALLBACK; - -__drv_functionClass(ACPI_OP_REGION_HANDLER) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -EXPORT -ACPI_OP_REGION_HANDLER ( - ULONG AccessType, - PVOID OperationRegionObject, - ULONG Address, - ULONG Size, - PULONG Data, - ULONG_PTR Context, - PACPI_OP_REGION_CALLBACK CompletionHandler, - PVOID CompletionContext - ); - -typedef ACPI_OP_REGION_HANDLER *PACPI_OP_REGION_HANDLER; - -// -// Exposed function prototypes -// - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSTATUS -RegisterOpRegionHandler ( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG AccessType, - __in ULONG RegionSpace, - __in PACPI_OP_REGION_HANDLER Handler, - __in PVOID Context, - __in ULONG Flags, - __out PVOID *OperationRegionObject - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSTATUS -DeRegisterOpRegionHandler ( - __in PDEVICE_OBJECT DeviceObject, - __in PVOID OperationRegionObject - ); - -// -// Exposed definitions -// - -// -// Access types for OpRegions -// -#define ACPI_OPREGION_ACCESS_AS_RAW 0x1 -#define ACPI_OPREGION_ACCESS_AS_COOKED 0x2 - -// -// Allowable region spaces -// -#define ACPI_OPREGION_REGION_SPACE_MEMORY 0x0 -#define ACPI_OPREGION_REGION_SPACE_IO 0x1 -#define ACPI_OPREGION_REGION_SPACE_PCI_CONFIG 0x2 -#define ACPI_OPREGION_REGION_SPACE_EC 0x3 -#define ACPI_OPREGION_REGION_SPACE_SMB 0x4 -#define ACPI_OPREGION_REGION_SPACE_CMOS_CONFIG 0x5 -#define ACPI_OPREGION_REGION_SPACE_PCIBARTARGET 0x6 - -// -// Operation to perform on region -// -#define ACPI_OPREGION_READ 0x0 -#define ACPI_OPREGION_WRITE 0x1 - -// -// Flag definitions for op region registration -// - -#define ACPI_OPREGION_ACCESS_AT_HIGH_LEVEL 0x1 // Indicates the handler function can be called at HIGH_LEVEL IRQL - - diff --git a/qt-correction-tool/pub/ddk/parallel.h b/qt-correction-tool/pub/ddk/parallel.h deleted file mode 100644 index 9675e68..0000000 --- a/qt-correction-tool/pub/ddk/parallel.h +++ /dev/null @@ -1,755 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - parallel.h - -Abstract: - - This file defines the services supplied by the ParPort driver. - -Revision History: - ---*/ - -#ifndef _PARALLEL_ -#define _PARALLEL_ - -#include - -// -// Define the parallel port device name strings. -// - -#define DD_PARALLEL_PORT_BASE_NAME_U L"ParallelPort" - -// -// IEEE 1284.3 Daisy Chain (DC) Device ID's range from 0 to 3. Devices -// are identified based on their connection order in the daisy chain -// relative to the other 1284.3 DC devices. Device 0 is the 1284.3 DC -// device that is closest to host port. -// -#define IEEE_1284_3_DAISY_CHAIN_MAX_ID 3 - -// -// NtDeviceIoControlFile internal IoControlCode values for parallel device. -// - -// Legacy - acquires entire parallel "bus" -#define IOCTL_INTERNAL_PARALLEL_PORT_ALLOCATE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 11, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_GET_PARALLEL_PORT_INFO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 12, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 13, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 14, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_RELEASE_PARALLEL_PORT_INFO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 15, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 17, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// Saves current chipset mode - puts the chipset into Specified mode (implemented in filter) -#define IOCTL_INTERNAL_PARCHIP_CONNECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 18, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 19, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 20, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// New parport IOCTLs -#define IOCTL_INTERNAL_GET_PARALLEL_PNP_INFO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 21, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_INIT_1284_3_BUS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 22, METHOD_BUFFERED, FILE_ANY_ACCESS) -// Takes a flat namespace Id for the device, also acquires the port -#define IOCTL_INTERNAL_SELECT_DEVICE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 23, METHOD_BUFFERED, FILE_ANY_ACCESS) -// Takes a flat namespace Id for the device, also releases the port -#define IOCTL_INTERNAL_DESELECT_DEVICE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 24, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// New parclass IOCTLs -#if (NTDDI_VERSION >= NTDDI_WINXP) // Windows XP -#define IOCTL_INTERNAL_GET_PARPORT_FDO CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 29, METHOD_BUFFERED, FILE_ANY_ACCESS) -#endif -#define IOCTL_INTERNAL_PARCLASS_CONNECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 30, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARCLASS_DISCONNECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 31, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_DISCONNECT_IDLE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 32, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_LOCK_PORT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 37, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_UNLOCK_PORT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 38, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// IOCTL version of call to ParPort's FreePort function -#define IOCTL_INTERNAL_PARALLEL_PORT_FREE CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 40, METHOD_BUFFERED, FILE_ANY_ACCESS) - -// IOCTLs for IEEE1284.3 -#define IOCTL_INTERNAL_PARDOT3_CONNECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 41, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARDOT3_DISCONNECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 42, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARDOT3_RESET CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 43, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_PARDOT3_SIGNAL CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 44, METHOD_BUFFERED, FILE_ANY_ACCESS) - - -// -// IOCTLs for registering/unregistering for ParPort's RemovalRelations -// -// - A device object should register for removal relations with a -// parport device if the device is physically connected to the -// parallel port. -// -// - Parport will report all devices that have registered with it for -// removal relations in response to a PnP QUERY_DEVICE_RELATIONS of -// type RemovalRelations. This allows PnP to remove all device stacks -// that depend on the parport device prior to removing the parport -// device itself. -// -// - The single Input parameter is a PARPORT_REMOVAL_RELATIONS -// structure that is defined below -// -#define IOCTL_INTERNAL_REGISTER_FOR_REMOVAL_RELATIONS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 50, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_UNREGISTER_FOR_REMOVAL_RELATIONS CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 51, METHOD_BUFFERED, FILE_ANY_ACCESS) - -typedef struct _PARPORT_REMOVAL_RELATIONS { - PDEVICE_OBJECT DeviceObject; // device object that is registering w/Parport - ULONG Flags; // Flags - reserved - set to 0 for now - PUNICODE_STRING DeviceName; // DeviceName identifier of device registering for removal relations - used for debugging - // - printed in parport's debug spew - convention is to use same DeviceName that was passed to - // IoCreateDevice -} PARPORT_REMOVAL_RELATIONS, *PPARPORT_REMOVAL_RELATIONS; - -#if (NTDDI_VERSION >= NTDDI_WINXP) // Windows XP -#define IOCTL_INTERNAL_LOCK_PORT_NO_SELECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 52, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_UNLOCK_PORT_NO_DESELECT CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 53, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_DISABLE_END_OF_CHAIN_BUS_RESCAN CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 54, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_ENABLE_END_OF_CHAIN_BUS_RESCAN CTL_CODE(FILE_DEVICE_PARALLEL_PORT, 55, METHOD_BUFFERED, FILE_ANY_ACCESS) -#endif - - -// Define 1284.3 command qualifiers -#define MODE_LEN_1284_3 7 // # of magic sequence bytes -static UCHAR ModeQualifier[MODE_LEN_1284_3] = { 0xAA, 0x55, 0x00, 0xFF, 0x87, 0x78, 0xFF }; - -#define LEGACYZIP_MODE_LEN 3 -static UCHAR LegacyZipModeQualifier[LEGACYZIP_MODE_LEN] = { 0x00, 0x3c, 0x20 }; - -typedef enum { - P12843DL_OFF, - P12843DL_DOT3_DL, - P12843DL_MLC_DL, - P12843DL_DOT4_DL -} P12843_DL_MODES; - -// Define 1284.3 Commands -#define CPP_ASSIGN_ADDR 0x00 -#define CPP_SELECT 0xE0 -#define CPP_DESELECT 0x30 -#define CPP_QUERY_INT 0x08 -#define CPP_DISABLE_INT 0x40 -#define CPP_ENABLE_INT 0x48 -#define CPP_CLEAR_INT_LAT 0x50 -#define CPP_SET_INT_LAT 0x58 -#define CPP_COMMAND_FILTER 0xF8 - - -typedef -BOOLEAN -(*PPARALLEL_TRY_ALLOCATE_ROUTINE) ( - __in PVOID TryAllocateContext - ); - -typedef -VOID -(*PPARALLEL_FREE_ROUTINE) ( - __in PVOID FreeContext - ); - -typedef -ULONG -(*PPARALLEL_QUERY_WAITERS_ROUTINE) ( - __in PVOID QueryAllocsContext - ); - -typedef -NTSTATUS -(*PPARALLEL_SET_CHIP_MODE) ( - __in PVOID SetChipContext, - __in UCHAR ChipMode - ); - -typedef -NTSTATUS -(*PPARALLEL_CLEAR_CHIP_MODE) ( - __in PVOID ClearChipContext, - __in UCHAR ChipMode - ); - -typedef -NTSTATUS -(*PPARALLEL_TRY_SELECT_ROUTINE) ( - __in PVOID TrySelectContext, - __in PVOID TrySelectCommand - ); - -typedef -NTSTATUS -(*PPARALLEL_DESELECT_ROUTINE) ( - __in PVOID DeselectContext, - __in PVOID DeselectCommand - ); - -typedef -NTSTATUS -(*PPARCHIP_SET_CHIP_MODE) ( - __in PVOID SetChipContext, - __in UCHAR ChipMode - ); - -typedef -NTSTATUS -(*PPARCHIP_CLEAR_CHIP_MODE) ( - __in PVOID ClearChipContext, - __in UCHAR ChipMode - ); - -// -// Hardware Capabilities -// -#define PPT_NO_HARDWARE_PRESENT 0x00000000 -#define PPT_ECP_PRESENT 0x00000001 -#define PPT_EPP_PRESENT 0x00000002 -#define PPT_EPP_32_PRESENT 0x00000004 -#define PPT_BYTE_PRESENT 0x00000008 -#define PPT_BIDI_PRESENT 0x00000008 // deprecated - will be removed soon! dvdf -#define PPT_1284_3_PRESENT 0x00000010 - -// Added DVDR 10-6-98 - -// Structure passed to the ParChip Filter when calling it -// with the IOCTL_INTERNAL_CHIP_FILTER_CONNECT ioctl -typedef struct _PARALLEL_PARCHIP_INFO { - PUCHAR Controller; - PUCHAR EcrController; - ULONG HardwareModes; - PPARCHIP_SET_CHIP_MODE ParChipSetMode; - PPARCHIP_CLEAR_CHIP_MODE ParChipClearMode; - PVOID Context; - BOOLEAN success; -} PARALLEL_PARCHIP_INFO, *PPARALLEL_PARCHIP_INFO; - -// End Added by DVDR 10-6-1998 - - -typedef struct _PARALLEL_PORT_INFORMATION { - PHYSICAL_ADDRESS OriginalController; - PUCHAR Controller; - ULONG SpanOfController; - PPARALLEL_TRY_ALLOCATE_ROUTINE TryAllocatePort; // nonblocking callback to allocate port - PPARALLEL_FREE_ROUTINE FreePort; // callback to free port - PPARALLEL_QUERY_WAITERS_ROUTINE QueryNumWaiters; // callback to query number of waiters for port allocation - PVOID Context; // context for callbacks to ParPort device -} PARALLEL_PORT_INFORMATION, *PPARALLEL_PORT_INFORMATION; - -typedef struct _PARALLEL_PNP_INFORMATION { - PHYSICAL_ADDRESS OriginalEcpController; - PUCHAR EcpController; - ULONG SpanOfEcpController; - ULONG PortNumber; // deprecated - do not use - ULONG HardwareCapabilities; - PPARALLEL_SET_CHIP_MODE TrySetChipMode; - PPARALLEL_CLEAR_CHIP_MODE ClearChipMode; - ULONG FifoDepth; - ULONG FifoWidth; - PHYSICAL_ADDRESS EppControllerPhysicalAddress; - ULONG SpanOfEppController; - ULONG Ieee1284_3DeviceCount; // number of .3 daisy chain devices connected to this ParPort - PPARALLEL_TRY_SELECT_ROUTINE TrySelectDevice; - PPARALLEL_DESELECT_ROUTINE DeselectDevice; - PVOID Context; - ULONG CurrentMode; - PWSTR PortName; // symbolic link name for legacy device object -} PARALLEL_PNP_INFORMATION, *PPARALLEL_PNP_INFORMATION; - -// Start Added by DVDR 2-19-1998 - -// -// PARALLEL_1284_COMMAND CommandFlags -// - -// this flag is deprecated - use 1284.3 daisy chain ID == 4 to indicate End-Of-Chain device -#define PAR_END_OF_CHAIN_DEVICE ((ULONG)0x00000001) // The target device for this command - // is an End-Of-Chain device, the - // contents of the ID field are - // undefined and should be ignored - -#define PAR_HAVE_PORT_KEEP_PORT ((ULONG)0x00000002) // Indicates that the requesting driver - // has previously acquired the parallel port - // and does is not ready to release it yet. - // - // On a SELECT_DEVICE ParPort should NOT - // try to acquire the port before selecting - // the device. - // - // On a DESELECT_DEVICE ParPort should NOT - // free the port after deselecting the device. - -#define PAR_LEGACY_ZIP_DRIVE ((ULONG)0x00000004) // The target device for this command - // is a Legacy Iomega Zip drive, the - // contents of the ID field are - // undefined and should be ignored - - -#define PAR_LEGACY_ZIP_DRIVE_STD_MODE ((ULONG)0x00000010) // The target device for these commands -#define PAR_LEGACY_ZIP_DRIVE_EPP_MODE ((ULONG)0x00000020) // are a Legacy Iomega Zip drive, the - // contents of the ID field are - // undefined and should be ignored - // This will select the Zip into DISK or EPP Mode - -#define DOT3_END_OF_CHAIN_ID 4 // this ID used in a 1284.3 SELECT or DESELECT means the End-Of-Chain device -#define DOT3_LEGACY_ZIP_ID 5 // this ID used in a 1284.3 SELECT or DESELECT means Legacy Zip drive - -// -// The following structure is passed in on an -// IOCTL_INTERNAL_SELECT_DEVICE and on an -// IOCTL_INTERNAL_DESELECT_DEVICE -typedef struct _PARALLEL_1284_COMMAND { - UCHAR ID; // 0..3 for 1284.3 daisy chain device, 4 for End-Of-Chain device, 5 for Legacy Zip - UCHAR Port; // reserved ( set == 0 ) - ULONG CommandFlags; // see above -} PARALLEL_1284_COMMAND, *PPARALLEL_1284_COMMAND; - - -// -// Hardware Modes -// -#define INITIAL_MODE 0x00000000 - -// Disable Parchip and ECR arbitrator -// 0 - Parchip and ecr arbritrator is off -// 1 - Parchip and ecr arbitrator is on -#define PARCHIP_ECR_ARBITRATOR 1 - -// -// The following structure is passed in on an -// IOCTL_INTERNAL_PARALLEL_SET_CHIP_MODE and on an -// IOCTL_INTERNAL_PARALLEL_CLEAR_CHIP_MODE -// -typedef struct _PARALLEL_CHIP_MODE { - UCHAR ModeFlags; - BOOLEAN success; -} PARALLEL_CHIP_MODE, *PPARALLEL_CHIP_MODE; - -// End Added by DVDR 2-19-1998 - -// -// The following structure is passed in on an -// IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT and on an -// IOCTL_INTERNAL_PARALLEL_DISCONNECT_INTERRUPT request. -// - -typedef -VOID -(*PPARALLEL_DEFERRED_ROUTINE) ( - __in PVOID DeferredContext - ); - -typedef struct _PARALLEL_INTERRUPT_SERVICE_ROUTINE { - PKSERVICE_ROUTINE InterruptServiceRoutine; - PVOID InterruptServiceContext; - PPARALLEL_DEFERRED_ROUTINE DeferredPortCheckRoutine; /* OPTIONAL */ - PVOID DeferredPortCheckContext; /* OPTIONAL */ -} PARALLEL_INTERRUPT_SERVICE_ROUTINE, *PPARALLEL_INTERRUPT_SERVICE_ROUTINE; - -// -// The following structure is returned on an -// IOCTL_INTERNAL_PARALLEL_CONNECT_INTERRUPT request; -// - -typedef struct _PARALLEL_INTERRUPT_INFORMATION { - PKINTERRUPT InterruptObject; - PPARALLEL_TRY_ALLOCATE_ROUTINE TryAllocatePortAtInterruptLevel; - PPARALLEL_FREE_ROUTINE FreePortFromInterruptLevel; - PVOID Context; -} PARALLEL_INTERRUPT_INFORMATION, *PPARALLEL_INTERRUPT_INFORMATION; - -// -// The following structure is returned on an -// IOCTL_INTERNAL_GET_MORE_PARALLEL_PORT_INFO. -// - -typedef struct _MORE_PARALLEL_PORT_INFORMATION { - INTERFACE_TYPE InterfaceType; - ULONG BusNumber; - ULONG InterruptLevel; - ULONG InterruptVector; - KAFFINITY InterruptAffinity; - KINTERRUPT_MODE InterruptMode; -} MORE_PARALLEL_PORT_INFORMATION, *PMORE_PARALLEL_PORT_INFORMATION; - -typedef enum { - SAFE_MODE, - UNSAFE_MODE // Available only through kernel. Your driver - // will be humiliated if you choose UNSAFE_MODE and - // then "make a mistake". - dvrh (PCized by dvdf) -} PARALLEL_SAFETY; - -// -// The following structure is returned by -// IOCTL_INTERNAL_PARCLASS_CONNECT. -// - -typedef -USHORT -(*PDETERMINE_IEEE_MODES) ( - __in PVOID Context - ); - -#define OLD_PARCLASS 0 - -#if OLD_PARCLASS -typedef -NTSTATUS -(*PNEGOTIATE_IEEE_MODE) ( - __in PVOID Extension, - __in UCHAR Extensibility - ); -#else -typedef -NTSTATUS -(*PNEGOTIATE_IEEE_MODE) ( - __in PVOID Context, - __in USHORT ModeMaskFwd, - __in USHORT ModeMaskRev, - __in PARALLEL_SAFETY ModeSafety, - __in BOOLEAN IsForward - ); -#endif - -typedef -NTSTATUS -(*PTERMINATE_IEEE_MODE) ( - __in PVOID Context - ); - -typedef -NTSTATUS -(*PPARALLEL_IEEE_FWD_TO_REV)( - __in PVOID Context - ); - -typedef -NTSTATUS -(*PPARALLEL_IEEE_REV_TO_FWD)( - __in PVOID Context - ); - -typedef -NTSTATUS -(*PPARALLEL_READ) ( - __in PVOID Context, - __out_bcount_part(NumBytesToRead,*NumBytesRead) PVOID Buffer, - __in ULONG NumBytesToRead, - __out PULONG NumBytesRead, - __in UCHAR Channel - ); - -typedef -NTSTATUS -(*PPARALLEL_WRITE) ( - __in PVOID Context, - __in_bcount(NumBytesToWrite) PVOID Buffer, - __in ULONG NumBytesToWrite, - __out PULONG NumBytesWritten, - __in UCHAR Channel - ); - -typedef -NTSTATUS -(*PPARALLEL_TRYSELECT_DEVICE) ( - __in PVOID Context, - __in PARALLEL_1284_COMMAND Command - ); - -typedef -NTSTATUS -(*PPARALLEL_DESELECT_DEVICE) ( - __in PVOID Context, - __in PARALLEL_1284_COMMAND Command - ); - -typedef struct _PARCLASS_INFORMATION { - PUCHAR Controller; - PUCHAR EcrController; - ULONG SpanOfController; - PDETERMINE_IEEE_MODES DetermineIeeeModes; - PNEGOTIATE_IEEE_MODE NegotiateIeeeMode; - PTERMINATE_IEEE_MODE TerminateIeeeMode; - PPARALLEL_IEEE_FWD_TO_REV IeeeFwdToRevMode; - PPARALLEL_IEEE_REV_TO_FWD IeeeRevToFwdMode; - PPARALLEL_READ ParallelRead; - PPARALLEL_WRITE ParallelWrite; - PVOID ParclassContext; - ULONG HardwareCapabilities; - ULONG FifoDepth; - ULONG FifoWidth; - PPARALLEL_TRYSELECT_DEVICE ParallelTryselect; - PPARALLEL_DESELECT_DEVICE ParallelDeSelect; -} PARCLASS_INFORMATION, *PPARCLASS_INFORMATION; - -// -// Standard and ECP parallel port offsets. -// - -#define DATA_OFFSET 0 -#define OFFSET_ECP_AFIFO 0x0000 // ECP Mode Address FIFO -#define AFIFO_OFFSET OFFSET_ECP_AFIFO // ECP Mode Address FIFO -#define DSR_OFFSET 1 -#define DCR_OFFSET 2 -#define EPP_OFFSET 4 - -// default to the old defines - note that the old defines break on PCI cards -#ifndef DVRH_USE_PARPORT_ECP_ADDR - #define DVRH_USE_PARPORT_ECP_ADDR 0 -#endif - -// DVRH_USE_PARPORT_ECP_ADDR settings -// 0 - ECP registers are hardcoded to -// Controller + 0x400 -// 1 - ECP registers are pulled from -// Parport which hopefully got -// them from PnP. - -#if (0 == DVRH_USE_PARPORT_ECP_ADDR) -// ***Note: These do not hold for PCI parallel ports - #define ECP_OFFSET 0x400 - #define CNFGB_OFFSET 0x401 - #define ECR_OFFSET 0x402 -#else - #define ECP_OFFSET 0x0 - #define CNFGB_OFFSET 0x1 - #define ECR_OFFSET 0x2 -#endif - -#define FIFO_OFFSET ECP_OFFSET -#define CFIFO_OFFSET ECP_OFFSET -#define CNFGA_OFFSET ECP_OFFSET -#define ECP_DFIFO_OFFSET ECP_OFFSET // ECP Mode Data FIFO -#define TFIFO_OFFSET ECP_OFFSET -#define OFFSET_ECP_DFIFO ECP_OFFSET // ECP Mode Data FIFO -#define OFFSET_TFIFO ECP_OFFSET // Test FIFO -#define OFFSET_CFIFO ECP_OFFSET // Fast Centronics Data FIFO -#define OFFSET_ECR ECR_OFFSET // Extended Control Register - -#define OFFSET_PARALLEL_REGISTER_SPAN 0x0003 - -#define ECP_SPAN 3 -#define EPP_SPAN 4 - -// -// Bit definitions for the DSR. -// - -#define DSR_NOT_BUSY 0x80 -#define DSR_NOT_ACK 0x40 -#define DSR_PERROR 0x20 -#define DSR_SELECT 0x10 -#define DSR_NOT_FAULT 0x08 - -// -// More bit definitions for the DSR. -// - -#define DSR_NOT_PTR_BUSY 0x80 -#define DSR_NOT_PERIPH_ACK 0x80 -#define DSR_WAIT 0x80 -#define DSR_PTR_CLK 0x40 -#define DSR_PERIPH_CLK 0x40 -#define DSR_INTR 0x40 -#define DSR_ACK_DATA_REQ 0x20 -#define DSR_NOT_ACK_REVERSE 0x20 -#define DSR_XFLAG 0x10 -#define DSR_NOT_DATA_AVAIL 0x08 -#define DSR_NOT_PERIPH_REQUEST 0x08 - -// -// Bit definitions for the DCR. -// - -#define DCR_RESERVED 0xC0 -#define DCR_DIRECTION 0x20 -#define DCR_ACKINT_ENABLED 0x10 -#define DCR_SELECT_IN 0x08 -#define DCR_NOT_INIT 0x04 -#define DCR_AUTOFEED 0x02 -#define DCR_STROBE 0x01 - -// -// More bit definitions for the DCR. -// - -#define DCR_NOT_1284_ACTIVE 0x08 -#define DCR_ASTRB 0x08 -#define DCR_NOT_REVERSE_REQUEST 0x04 -#define DCR_NULL 0x04 -#define DCR_NOT_HOST_BUSY 0x02 -#define DCR_NOT_HOST_ACK 0x02 -#define DCR_DSTRB 0x02 -#define DCR_NOT_HOST_CLK 0x01 -#define DCR_WRITE 0x01 - -// -// Bit definitions for configuration register A. -// - -#define CNFGA_IMPID_MASK 0x70 -#define CNFGA_IMPID_16BIT 0x00 -#define CNFGA_IMPID_8BIT 0x10 -#define CNFGA_IMPID_32BIT 0x20 - -#define CNFGA_NO_TRANS_BYTE 0x04 - -//////////////////////////////////////////////////////////////////////////////// -// ECR values that establish basic hardware modes. In each case, the default -// is to disable error interrupts, DMA, and service interrupts. -//////////////////////////////////////////////////////////////////////////////// - -#if (0 == PARCHIP_ECR_ARBITRATOR) - #define DEFAULT_ECR_PS2 0x34 - #define DEFAULT_ECR_ECP 0x74 -#endif - -// -// Bit definitions for ECR register. -// - -#define ECR_ERRINT_DISABLED 0x10 -#define ECR_DMA_ENABLED 0x08 -#define ECR_SVC_INT_DISABLED 0x04 - -#define ECR_MODE_MASK 0x1F -#define ECR_SPP_MODE 0x00 -#define ECR_BYTE_MODE 0x20 // PS/2 -#define ECR_BYTE_PIO_MODE (ECR_BYTE_MODE | ECR_ERRINT_DISABLED | ECR_SVC_INT_DISABLED) - -#define ECR_FASTCENT_MODE 0x40 -#define ECR_ECP_MODE 0x60 -#define ECR_ECP_PIO_MODE (ECR_ECP_MODE | ECR_ERRINT_DISABLED | ECR_SVC_INT_DISABLED) - -#define ECR_EPP_MODE 0x80 -#define ECR_EPP_PIO_MODE (ECR_EPP_MODE | ECR_ERRINT_DISABLED | ECR_SVC_INT_DISABLED) - -#define ECR_RESERVED_MODE 0x10 -#define ECR_TEST_MODE 0xC0 -#define ECR_CONFIG_MODE 0xE0 - -#define DEFAULT_ECR_TEST 0xD4 -#define DEFAULT_ECR_COMPATIBILITY 0x14 - -#define DEFAULT_ECR_CONFIGURATION 0xF4 - -#define ECR_FIFO_MASK 0x03 // Mask to isolate FIFO bits -#define ECR_FIFO_FULL 0x02 // FIFO completely full -#define ECR_FIFO_EMPTY 0x01 // FIFO completely empty -#define ECR_FIFO_SOME_DATA 0x00 // FIFO has some data in it - -#define ECP_MAX_FIFO_DEPTH 4098 // Likely max for ECP HW FIFO size - -//------------------------------------------------------------------------ -// Mask and test values for extracting the Implementation ID from the -// ConfigA register -//------------------------------------------------------------------------ - -#define CNFGA_IMPID_MASK 0x70 -#define CNFGA_IMPID_SHIFT 4 - -#define FIFO_PWORD_8BIT 1 -#define FIFO_PWORD_16BIT 0 -#define FIFO_PWORD_32BIT 2 - - -#define TEST_ECR_FIFO(registerValue,testValue) \ - ( ( (registerValue) & ECR_FIFO_MASK ) == testValue ) - -////////////////////////////////////////////////////////////////////////////// -// The following BIT_x definitions provide a generic bit shift value -// based upon the bit's position in a hardware register or byte of -// memory. These constants are used by some of the macros that are -// defined below. -////////////////////////////////////////////////////////////////////////////// - -#define BIT_7 7 -#define BIT_6 6 -#define BIT_5 5 -#define BIT_4 4 -#define BIT_3 3 -#define BIT_2 2 -#define BIT_1 1 -#define BIT_0 0 - -#define BIT_7_SET 0x80 -#define BIT_6_SET 0x40 -#define BIT_5_SET 0x20 -#define BIT_4_SET 0x10 -#define BIT_3_SET 0x8 -#define BIT_2_SET 0x4 -#define BIT_1_SET 0x2 -#define BIT_0_SET 0x1 - -////////////////////////////////////////////////////////////////////////////// -// The following defines and macros may be used to set, test, and -// update the Device Control Register (DCR). -////////////////////////////////////////////////////////////////////////////// -#define DIR_READ 1 -#define DIR_WRITE 0 - -#define IRQEN_ENABLE 1 -#define IRQEN_DISABLE 0 - -#define ACTIVE 1 -#define INACTIVE 0 -#define DONT_CARE 2 - -#define DVRH_USE_FAST_MACROS 1 -#define DVRH_USE_NIBBLE_MACROS 1 -////////////////////////////////////////////////////////////////////////////// -// The following defines may be used generically in any of the SET_xxx, -// TEST_xxx, or UPDATE_xxx macros that follow. -////////////////////////////////////////////////////////////////////////////// -#if (1 == DVRH_USE_FAST_MACROS) - #define SET_DCR(b5,b4,b3,b2,b1,b0) \ - ((UCHAR)((b5==ACTIVE? BIT_5_SET : 0) | \ - (b4==ACTIVE? BIT_4_SET : 0) | \ - (b3==ACTIVE? 0 : BIT_3_SET) | \ - (b2==ACTIVE? BIT_2_SET : 0) | \ - (b1==ACTIVE? 0 : BIT_1_SET) | \ - (b0==ACTIVE? 0 : BIT_0_SET) ) ) -#else - #define SET_DCR(b5,b4,b3,b2,b1,b0) \ - ((UCHAR)(((b5==ACTIVE?1:0)<> 8) & 0xFF) -#define DevProp_PciDevice_32BitPrefetchable_MemoryBarCount(_PropertyData) (((_PropertyData) >> 16) & 0xFF) -#define DevProp_PciDevice_64BitPrefetchable_MemoryBarCount(_PropertyData) (((_PropertyData) >> 24) & 0xFF) - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_BarTypes, 16); - -// -// This property is a BOOLEAN indicating if AER capability is present on an -// endpoint. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_AERCapabilityPresent, 17); - -// -// This property indicates if a device is configured for a firmware first -// error handling. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_FirmwareErrorHandling, 18); - -// -// This property provides the uncorrectable error mask for an endpoint. This -// field is interpreted in accordance to its definition in the PCI Express -// Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_Uncorrectable_Error_Mask, 19); - -// -// This property provides the uncorrectable error severity for an endpoint. -// This field is interpreted in accordance to its definition in the PCI Express -// Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_Uncorrectable_Error_Severity, 20); - -// -// This property provides the correctable error mask for an endpoint. This -// field is interpreted in accordance to its definition in the PCI Express -// Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_Correctable_Error_Mask, 21); - -// -// This property indicates if a device is capable of ECRC generation and -// checking. This field is interpreted in according to the advanced error -// capabilities and control register value in the PCI Express Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_ECRC_Errors, 22); - -// -// This property indicates if an endpoint is enabled for reporting different -// types of error messages. This field is interpreted in accordance to the -// device control register value as described in the PCI Express Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_Error_Reporting, 23); - -// -// This property indicates if a root port is enabled for reporting different -// types of error messages. This field is interpreted in accordance to the -// root control register value as described in the PCI Express Base spec. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_RootError_Reporting, 24); - -// -// This property indicates if a device can wake up via PME while the system is -// in S0. Some platforms do not support runtime wakeup on some device types. -// - -DEFINE_PCI_DEVICE_DEVPKEY(DEVPKEY_PciDevice_S0WakeupSupported, 25); - -#endif - diff --git a/qt-correction-tool/pub/ddk/pfhook.h b/qt-correction-tool/pub/ddk/pfhook.h deleted file mode 100644 index 2e70c0f..0000000 --- a/qt-correction-tool/pub/ddk/pfhook.h +++ /dev/null @@ -1,70 +0,0 @@ -/*++ - -Copyright (c) 1999 Microsoft Corporation - -Module Name: - - pfhook.h - -Abstract: - - Header file for Packet Filter driver extension hook. - ---*/ - -#ifndef _PF_EXTEND_DEFS_H_ -#define _PF_EXTEND_DEFS_H_ - -#define INVALID_PF_IF_INDEX 0xffffffff -#define ZERO_PF_IP_ADDR 0 - -// -// Enumeration constants for values that may be returned by an extension -// routine. -// - -typedef enum _PF_FORWARD_ACTION -{ - PF_FORWARD = 0, - PF_DROP = 1, - PF_PASS = 2, - PF_ICMP_ON_DROP = 3 -} PF_FORWARD_ACTION; - -// -// Definiton for a filter routine callout. -// - -typedef PF_FORWARD_ACTION (*PacketFilterExtensionPtr)( - unsigned char *PacketHeader, - unsigned char *Packet, - unsigned int PacketLength, - unsigned int RecvInterfaceIndex, - unsigned int SendInterfaceIndex, - IPAddr RecvLinkNextHop, - IPAddr SendLinkNextHop - ); - - -// -// Structure to be passed to the IOCTL_PF_SET_EXTENSION_POINTER call -// - -typedef struct _PF_SET_EXTENSION_HOOK_INFO -{ - PacketFilterExtensionPtr ExtensionPointer; -} PF_SET_EXTENSION_HOOK_INFO, *PPF_SET_EXTENSION_HOOK_INFO; - - -#define DD_IPFLTRDRVR_DEVICE_NAME L"\\Device\\IPFILTERDRIVER" - -#define FSCTL_IPFLTRDRVR_BASE FILE_DEVICE_NETWORK - -#define _IPFLTRDRVR_CTL_CODE(function, method, access) \ - CTL_CODE(FSCTL_IPFLTRDRVR_BASE, function, method, access) - -#define IOCTL_PF_SET_EXTENSION_POINTER \ - _IPFLTRDRVR_CTL_CODE(22, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#endif // _PF_EXTEND_DEFS_H_ - diff --git a/qt-correction-tool/pub/ddk/poclass.h b/qt-correction-tool/pub/ddk/poclass.h deleted file mode 100644 index 0573df0..0000000 --- a/qt-correction-tool/pub/ddk/poclass.h +++ /dev/null @@ -1,589 +0,0 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - poclass.h - -Abstract: - - Defines power policy device driver interfaces. - - - -Revision History: - ---*/ - -// -// GUIDs are defined outside ifdef __POCLASS_ so that they can be instantiated -// easily using . -// - -// -// Custom device properties... -// - -#include - -// -// This is of type DEVPROP_TYPE_UINT32 and represents the NT processor -// number. -// - -DEFINE_DEVPROPKEY(PROCESSOR_NUMBER_PKEY, - 0x5724c81d, - 0xd5af, - 0x4c1f, - 0xa1, 0x03, 0xa0, 0x6e, 0x28, 0xf2, 0x04, 0xc6, - 1); - - -// -// Power management policy device GUIDs -// - -DEFINE_GUID( GUID_DEVICE_BATTERY, 0x72631e54L, 0x78A4, 0x11d0, 0xbc, 0xf7, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a ); -DEFINE_GUID( GUID_DEVICE_APPLICATIONLAUNCH_BUTTON, 0x629758eel, 0x986e, 0x4d9e, 0x8e, 0x47, 0xde, 0x27, 0xf8, 0xab, 0x05, 0x4d ); -DEFINE_GUID( GUID_DEVICE_SYS_BUTTON, 0x4AFA3D53L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57 ); -DEFINE_GUID( GUID_DEVICE_LID, 0x4AFA3D52L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57 ); -DEFINE_GUID( GUID_DEVICE_THERMAL_ZONE, 0x4AFA3D51L, 0x74A7, 0x11d0, 0xbe, 0x5e, 0x00, 0xA0, 0xC9, 0x06, 0x28, 0x57 ); -DEFINE_GUID( GUID_DEVICE_PROCESSOR, 0x97fadb10L, 0x4e33, 0x40ae, 0x35, 0x9c, 0x8b, 0xef, 0x02, 0x9d, 0xbd, 0xd0 ); -DEFINE_GUID( GUID_DEVICE_MEMORY, 0x3fd0f03dL, 0x92e0, 0x45fb, 0xb7, 0x5c, 0x5e, 0xd8, 0xff, 0xb0, 0x10, 0x21 ); -DEFINE_GUID( GUID_DEVICE_MESSAGE_INDICATOR, 0XCD48A365L, 0xfa94, 0x4ce2, 0xa2, 0x32, 0xa1, 0xb7, 0x64, 0xe5, 0xd8, 0xb4 ); -// copied from hidclass.h -DEFINE_GUID( GUID_CLASS_INPUT, 0x4D1E55B2L, 0xF16F, 0x11CF, 0x88, 0xCB, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30 ); - -#ifndef _POCLASS_ -#define _POCLASS_ - -// -// Battery driver interface (devices of registrying as GUID_DEVICE_BATTERY) -// - -typedef enum { - BatteryInformation, - BatteryGranularityInformation, - BatteryTemperature, - BatteryEstimatedTime, - BatteryDeviceName, - BatteryManufactureDate, - BatteryManufactureName, - BatteryUniqueID -} BATTERY_QUERY_INFORMATION_LEVEL; - -typedef struct _BATTERY_QUERY_INFORMATION { - ULONG BatteryTag; - BATTERY_QUERY_INFORMATION_LEVEL InformationLevel; - ULONG AtRate; -} BATTERY_QUERY_INFORMATION, *PBATTERY_QUERY_INFORMATION; - -typedef struct _BATTERY_INFORMATION { - ULONG Capabilities; - UCHAR Technology; - UCHAR Reserved[3]; - UCHAR Chemistry[4]; - ULONG DesignedCapacity; - ULONG FullChargedCapacity; - ULONG DefaultAlert1; - ULONG DefaultAlert2; - ULONG CriticalBias; - ULONG CycleCount; -} BATTERY_INFORMATION, *PBATTERY_INFORMATION; - -// BATTERY_INFORMATION.*Capacity constants -#define UNKNOWN_CAPACITY 0xFFFFFFFF - -// BATTERY_INFORMATION.Capabilities flags -#define BATTERY_SYSTEM_BATTERY 0x80000000 -#define BATTERY_CAPACITY_RELATIVE 0x40000000 -#define BATTERY_IS_SHORT_TERM 0x20000000 -#define BATTERY_SET_CHARGE_SUPPORTED 0x00000001 -#define BATTERY_SET_DISCHARGE_SUPPORTED 0x00000002 -#define BATTERY_SET_RESUME_SUPPORTED 0x00000004 - -typedef enum { - BatteryCriticalBias, - BatteryCharge, - BatteryDischarge -} BATTERY_SET_INFORMATION_LEVEL; - -typedef struct _BATTERY_SET_INFORMATION { - ULONG BatteryTag; - BATTERY_SET_INFORMATION_LEVEL InformationLevel; - UCHAR Buffer[1]; -} BATTERY_SET_INFORMATION, *PBATTERY_SET_INFORMATION; - -typedef struct _BATTERY_WAIT_STATUS { - ULONG BatteryTag; - ULONG Timeout; - ULONG PowerState; - ULONG LowCapacity; - ULONG HighCapacity; -} BATTERY_WAIT_STATUS, *PBATTERY_WAIT_STATUS; - -typedef struct _BATTERY_STATUS { - ULONG PowerState; - ULONG Capacity; - ULONG Voltage; - LONG Current; -} BATTERY_STATUS, *PBATTERY_STATUS; - -// Battery Status Constants -#define UNKNOWN_RATE 0xFFFFFFFF -#define UNKNOWN_VOLTAGE 0xFFFFFFFF - - -// PowerState flags - -#define BATTERY_POWER_ON_LINE 0x00000001 -#define BATTERY_DISCHARGING 0x00000002 -#define BATTERY_CHARGING 0x00000004 -#define BATTERY_CRITICAL 0x00000008 - -// Max battery driver BATTERY_QUERY_INFORMATION_LEVEL string storage -// size in bytes. -#define MAX_BATTERY_STRING_SIZE 128 - -// Struct for accessing the packed date format in BatteryManufactureDate. -typedef struct _BATTERY_MANUFACTURE_DATE -{ - UCHAR Day; - UCHAR Month; - USHORT Year; -} BATTERY_MANUFACTURE_DATE, *PBATTERY_MANUFACTURE_DATE; - -// battery - -#define IOCTL_BATTERY_QUERY_TAG \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x10, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_BATTERY_QUERY_INFORMATION \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x11, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_BATTERY_SET_INFORMATION \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x12, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_BATTERY_QUERY_STATUS \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x13, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define BATTERY_TAG_INVALID 0 - -#ifndef _WINDOWS_ - -// -// Battery Class-Miniport interfaces -// - -__drv_functionClass(BCLASS_QUERY_TAG_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_QUERY_TAG_CALLBACK)( - __in PVOID Context, - __out PULONG BatteryTag - ); - -typedef BCLASS_QUERY_TAG_CALLBACK *PBCLASS_QUERY_TAG_CALLBACK; - -__drv_functionClass(BCLASS_QUERY_INFORMATION_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_QUERY_INFORMATION_CALLBACK)( - __in PVOID Context, - __in ULONG BatteryTag, - __in BATTERY_QUERY_INFORMATION_LEVEL Level, - __in LONG AtRate, - __out_bcount_part(BufferLength, *ReturnedLength) PVOID Buffer, - __in ULONG BufferLength, - __out PULONG ReturnedLength - ); - -typedef BCLASS_QUERY_INFORMATION_CALLBACK *PBCLASS_QUERY_INFORMATION_CALLBACK; - - -__drv_functionClass(BCLASS_QUERY_STATUS_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_QUERY_STATUS_CALLBACK)( - __in PVOID Context, - __in ULONG BatteryTag, - __out PBATTERY_STATUS BatteryStatus - ); - -typedef BCLASS_QUERY_STATUS_CALLBACK *PBCLASS_QUERY_STATUS_CALLBACK; - -typedef struct { - ULONG PowerState; - ULONG LowCapacity; - ULONG HighCapacity; -} BATTERY_NOTIFY, *PBATTERY_NOTIFY; - -__drv_functionClass(BCLASS_SET_STATUS_NOTIFY_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_SET_STATUS_NOTIFY_CALLBACK)( - __in PVOID Context, - __in ULONG BatteryTag, - __in PBATTERY_NOTIFY BatteryNotify - ); - -typedef BCLASS_SET_STATUS_NOTIFY_CALLBACK *PBCLASS_SET_STATUS_NOTIFY_CALLBACK; - -__drv_functionClass(BCLASS_SET_INFORMATION_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_SET_INFORMATION_CALLBACK)( - __in PVOID Context, - __in ULONG BatteryTag, - __in BATTERY_SET_INFORMATION_LEVEL Level, - __in_opt PVOID Buffer - ); - -typedef BCLASS_SET_INFORMATION_CALLBACK *PBCLASS_SET_INFORMATION_CALLBACK; - - -__drv_functionClass(BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK) -__drv_sameIRQL -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -(BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK)( - __in PVOID Context - ); - -typedef BCLASS_DISABLE_STATUS_NOTIFY_CALLBACK - *PBCLASS_DISABLE_STATUS_NOTIFY_CALLBACK; - -typedef PBCLASS_QUERY_TAG_CALLBACK BCLASS_QUERY_TAG; -typedef PBCLASS_QUERY_INFORMATION_CALLBACK BCLASS_QUERY_INFORMATION; -typedef PBCLASS_QUERY_STATUS_CALLBACK BCLASS_QUERY_STATUS; -typedef PBCLASS_SET_STATUS_NOTIFY_CALLBACK BCLASS_SET_STATUS_NOTIFY; -typedef PBCLASS_SET_INFORMATION_CALLBACK BCLASS_SET_INFORMATION; -typedef PBCLASS_DISABLE_STATUS_NOTIFY_CALLBACK BCLASS_DISABLE_STATUS_NOTIFY; - -typedef struct { - USHORT MajorVersion; - USHORT MinorVersion; - - PVOID Context; // Miniport context - - BCLASS_QUERY_TAG QueryTag; - BCLASS_QUERY_INFORMATION QueryInformation; - BCLASS_SET_INFORMATION SetInformation; - BCLASS_QUERY_STATUS QueryStatus; - BCLASS_SET_STATUS_NOTIFY SetStatusNotify; - BCLASS_DISABLE_STATUS_NOTIFY DisableStatusNotify; - PDEVICE_OBJECT Pdo; - PUNICODE_STRING DeviceName; -} BATTERY_MINIPORT_INFO, *PBATTERY_MINIPORT_INFO; - - - -#define BATTERY_CLASS_MAJOR_VERSION 0x0001 -#define BATTERY_CLASS_MINOR_VERSION 0x0000 - - -// -// Battery class driver functions -// - -#if !defined(BATTERYCLASS) - #define BATTERYCLASSAPI DECLSPEC_IMPORT -#else - #define BATTERYCLASSAPI -#endif - - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSTATUS -BATTERYCLASSAPI -BatteryClassInitializeDevice ( - __in PBATTERY_MINIPORT_INFO MiniportInfo, - __out PVOID *ClassData - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -BATTERYCLASSAPI -BatteryClassUnload ( - __in PVOID ClassData - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSTATUS -BATTERYCLASSAPI -BatteryClassIoctl ( - __in PVOID ClassData, - __inout PIRP Irp - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -BATTERYCLASSAPI -BatteryClassStatusNotify ( - __in PVOID ClassData - ); - -#endif // _WINDOWS_ - -// -// Thermal Zone driver interface (devices of registrying as GUID_DEVICE_THERMAL_ZONE) -// - -#define MAX_ACTIVE_COOLING_LEVELS 10 - -// -// This structure has been depricated and the THERMAL_INFORMATION_EX -// structure should be used. THERMAL_INFORMATION has been left here for -// backward compatibility with the thermal WMI interface. -// -typedef struct _THERMAL_INFORMATION { - ULONG ThermalStamp; - ULONG ThermalConstant1; - ULONG ThermalConstant2; - KAFFINITY Processors; - ULONG SamplingPeriod; - ULONG CurrentTemperature; - ULONG PassiveTripPoint; - ULONG CriticalTripPoint; - UCHAR ActiveTripPointCount; - ULONG ActiveTripPoint[MAX_ACTIVE_COOLING_LEVELS]; -} THERMAL_INFORMATION, *PTHERMAL_INFORMATION; - -#define ACTIVE_COOLING 0x0 -#define PASSIVE_COOLING 0x1 - -// thermal - -#define IOCTL_THERMAL_QUERY_INFORMATION \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x20, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_THERMAL_SET_COOLING_POLICY\ - CTL_CODE(FILE_DEVICE_BATTERY, 0x21, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_RUN_ACTIVE_COOLING_METHOD\ - CTL_CODE(FILE_DEVICE_BATTERY, 0x22, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -// -// Lid class driver functions -// - -#define IOCTL_QUERY_LID\ - CTL_CODE(FILE_DEVICE_BATTERY, 0x30, METHOD_BUFFERED, FILE_READ_ACCESS) - -// -// Switch class driver functions -// - -#define IOCTL_NOTIFY_SWITCH_EVENT\ - CTL_CODE(FILE_DEVICE_BATTERY, 0x40, METHOD_BUFFERED, FILE_READ_ACCESS) - -// -// System button class driver functions -// - -#define IOCTL_GET_SYS_BUTTON_CAPS \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x50, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_GET_SYS_BUTTON_EVENT \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x51, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define SYS_BUTTON_POWER 0x00000001 -#define SYS_BUTTON_SLEEP 0x00000002 -#define SYS_BUTTON_LID 0x00000004 -#define SYS_BUTTON_WAKE 0x80000000 - -// -// Lid-specific state embedded in the button event irp. -// - -#define SYS_BUTTON_LID_STATE_MASK 0x00030000 -#define SYS_BUTTON_LID_OPEN 0x00010000 -#define SYS_BUTTON_LID_CLOSED 0x00020000 -#define SYS_BUTTON_LID_INITIAL 0x00040000 -#define SYS_BUTTON_LID_CHANGED 0x00080000 - -// -// Processor object class driver functions -// - -typedef struct { - ULONG PhysicalID; - ULONG PBlkAddress; - UCHAR PBlkLength; -} PROCESSOR_OBJECT_INFO, *PPROCESSOR_OBJECT_INFO; - -typedef struct { - ULONG PhysicalID; - ULONG PBlkAddress; - UCHAR PBlkLength; - ULONG InitialApicId; -} PROCESSOR_OBJECT_INFO_EX, *PPROCESSOR_OBJECT_INFO_EX; - - - -#define IOCTL_GET_PROCESSOR_OBJ_INFO \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x60, METHOD_BUFFERED, FILE_READ_ACCESS) - - -#ifndef _WINDOWS_ - -// -// PCC processor power management interface -// - -#pragma warning(push) -#pragma warning(disable:4201) // anonymous unions warning -#pragma warning(disable:4214) // bit field other than int -#pragma pack(push,1) - -typedef struct _PCC_HEADER { - ULONG Signature; - USHORT HeaderLength; - UCHAR MajorVersion; - UCHAR MinorVersion; - union { - struct { - ULONG SciDoorbell:1; // 0 - ULONG Reserved:31; // 31:1 - }; - - ULONG AsULong; - } SupportedFeatures; - - union { - struct { - USHORT CommandCode:8; // 7:0 - USHORT ReservedZ:7; // 14:8 - USHORT SciDoorbell:1; // 15 - }; - - USHORT AsUShort; - } Command; - - union { - struct { - USHORT CommandComplete:1; // 0 - USHORT SciReceived:1; // 1 - USHORT Error:1; // 2 - USHORT Reserved:13; // 15:3 - }; - - USHORT AsUShort; - } Status; - - ULONG Latency; - ULONG MinimumCommandInterval; - ULONG MaximumCommandInterval; - ULONG NominalFrequency; - ULONG MinimumFrequency; - ULONG MinimumUnthrottledFrequency; -} PCC_HEADER, *PPCC_HEADER; - -typedef struct _PCC_INPUT_BUFFER { - UCHAR ControlEnabled; - union { - struct { - UCHAR ReservedZ[3]; - } GetAverageFrequency; - - struct { - UCHAR DesiredFrequency; - UCHAR ReservedZ[2]; - } SetDesiredFrequency; - - }; -} PCC_INPUT_BUFFER, *PPCC_INPUT_BUFFER; - -typedef union _PCC_OUTPUT_BUFFER { - struct { - UCHAR AverageFrequency; - UCHAR FrequencyLimit; - UCHAR Reserved[2]; - } GetAverageFrequency; - - struct { - UCHAR Reserved[4]; - } SetDesiredFrequency; - -} PCC_OUTPUT_BUFFER, *PPCC_OUTPUT_BUFFER; - -#pragma pack(pop) -#pragma warning(pop) - -__drv_functionClass(PROCESSOR_PCC_DOORBELL_CALLBACK) -__drv_sameIRQL -typedef -VOID -(PROCESSOR_PCC_DOORBELL_CALLBACK)( - __in ULONG Status, - __in ULONG_PTR Context - ); - -typedef PROCESSOR_PCC_DOORBELL_CALLBACK *PPROCESSOR_PCC_DOORBELL_CALLBACK; - -#define PROCESSOR_PCC_COMMAND_GET_AVERAGE_FREQUENCY 0x00 -#define PROCESSOR_PCC_COMMAND_SET_DESIRED_FREQUENCY 0x01 - -__drv_functionClass(PROCESSOR_PCC_RING_DOORBELL) -__drv_sameIRQL -typedef -NTSTATUS -(PROCESSOR_PCC_RING_DOORBELL)( - __in UCHAR Command, - __in PPROCESSOR_PCC_DOORBELL_CALLBACK Callback, - __in ULONG_PTR Context - ); - -typedef PROCESSOR_PCC_RING_DOORBELL *PPROCESSOR_PCC_RING_DOORBELL; - -typedef struct _PROCESSOR_PCC_INTERFACE_STANDARD { - // - // Generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // PCC interfaces - // - PPROCESSOR_PCC_RING_DOORBELL PccRingDoorbell; - PPCC_HEADER PccHeader; - ULONG PccHeaderLength; - -} PROCESSOR_PCC_INTERFACE_STANDARD, *PPROCESSOR_PCC_INTERFACE_STANDARD; - -#define PROCESSOR_PCC_INTERFACE_STANDARD_VERSION 1 - -#endif // _WINDOWS_ - -// -// Message indicator class driver functions -// -#define IOCTL_SET_SYS_MESSAGE_INDICATOR \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x70, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#endif // _POCLASS_ - diff --git a/qt-correction-tool/pub/ddk/portabledevice.h b/qt-correction-tool/pub/ddk/portabledevice.h deleted file mode 100644 index 06b2c59..0000000 --- a/qt-correction-tool/pub/ddk/portabledevice.h +++ /dev/null @@ -1,4438 +0,0 @@ -/**************************************************************************** -* Copyright (c) Microsoft Corporation. All rights reserved. -****************************************************************************/ -#pragma once -// Windows XP SP2, Windows Vista, or later (excluding Windows Server 2003) -#if ((NTDDI_VERSION >= NTDDI_WINXPSP2 && NTDDI_VERSION < NTDDI_WS03) || (NTDDI_VERSION >= NTDDI_WINLH)) -#include "propkeydef.h" - -/**************************************************************************** -* This section declares WPD guids used in PnP -****************************************************************************/ -// -// GUID_DEVINTERFACE_WPD -// This GUID is used to identify devices / drivers that support the WPD DDI. -// The WPD Class Extension component enables this device interface for WPD Drivers that use it. Clients use this PnP interface when registering for PnP device arrival messages for WPD devices. -DEFINE_GUID(GUID_DEVINTERFACE_WPD, 0x6AC27878, 0xA6FA, 0x4155, 0xBA, 0x85, 0xF9, 0x8F, 0x49, 0x1D, 0x4F, 0x33 ); -// -// GUID_DEVINTERFACE_WPD_PRIVATE -// This GUID is used to identify devices / drivers that can be used only by a specialized WPD client and will not show up in normal WPD enumeration. -// Devices identified with this interface cannot be used with normal WPD applications. Generic WPD drivers and clients should not use this interface. -DEFINE_GUID(GUID_DEVINTERFACE_WPD_PRIVATE, 0xBA0C718F, 0x4DED, 0x49B7, 0xBD, 0xD3, 0xFA, 0xBE, 0x28, 0x66, 0x12, 0x11 ); -// -// GUID_DEVINTERFACE_WPD_SERVICE -// This GUID is used to identify services that support the WPD Services DDI. -// The WPD Class Extension component enables this device interface for WPD Services that use it. Clients use this PnP interface when registering for PnP device arrival messages for ALL WPD services. To register for specific categories of services, client should use the service category or service implements GUID. -DEFINE_GUID(GUID_DEVINTERFACE_WPD_SERVICE, 0x9EF44F80, 0x3D64, 0x4246, 0xA6, 0xAA, 0x20, 0x6F, 0x32, 0x8D, 0x1E, 0xDC ); - -/**************************************************************************** -* This section declares WPD defines -****************************************************************************/ -// WPD specific function number used to construct WPD I/O control codes. Drivers should not use this define directly. -// -#define WPD_CONTROL_FUNCTION_GENERIC_MESSAGE 0x42 - -// Defines WPD specific IOCTL number used by drivers to detect WPD requests that may require READ and WRITE access to the device. -// -#define IOCTL_WPD_MESSAGE_READWRITE_ACCESS CTL_CODE(FILE_DEVICE_WPD, WPD_CONTROL_FUNCTION_GENERIC_MESSAGE, METHOD_BUFFERED, (FILE_READ_ACCESS | FILE_WRITE_ACCESS)) - -// Defines WPD specific IOCTL number used by drivers to detect WPD requests that require READ-only access to the device. -// -#define IOCTL_WPD_MESSAGE_READ_ACCESS CTL_CODE(FILE_DEVICE_WPD, WPD_CONTROL_FUNCTION_GENERIC_MESSAGE, METHOD_BUFFERED, FILE_READ_ACCESS) - -// Drivers can use this macro to detect whether the incoming IOCTL is a WPD message or not. -// -#define IS_WPD_IOCTL(ControlCode) ((ControlCode == IOCTL_WPD_MESSAGE_READWRITE_ACCESS) || (ControlCode == IOCTL_WPD_MESSAGE_READ_ACCESS)) - -// Pre-defined ObjectID for the DEVICE object. -// -#define WPD_DEVICE_OBJECT_ID L"DEVICE" - -// Pre-defined IWMDMDevice for the IWMDRMDeviceApp license/metering APIs. -// -#define WMDRMDEVICEAPP_USE_WPD_DEVICE_PTR ((ULONG_PTR)-1) - -// Pre-defined name of a REG_DWORD value that defines the device type, used for representation purposes only. Functional characteristics of the device are decided through functional objects. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). See WPD_DEVICE_TYPES enumeration for possible values. -#define PORTABLE_DEVICE_TYPE L"PortableDeviceType" - -// Pre-defined name of a REG_SZ/REG_EXPAND_SZ/REG_MULTI_SZ value that indicates the location of the device icon file or device icon resource. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). This REG_SZ/REG_EXPAND_SZ/REG_MULTI_SZ value is either in the form "file.dll, resourceID" or a full file path to an icon file. e.g.: "x:\file.ico" -#define PORTABLE_DEVICE_ICON L"Icons" - -// Pre-defined name of a REG_DWORD value that indicates the amount of time in milliseconds the WPD Namespace Extension will keep its reference to the device open under idle conditions. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). -#define PORTABLE_DEVICE_NAMESPACE_TIMEOUT L"PortableDeviceNameSpaceTimeout" - -// Pre-defined name of a REG_DWORD value that is used as a flag to indicate whether the device should, or should not, be shown in the Explorer view. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). Meaning of values are: 0 = include, 1 = exclude. 0 is assumed if this value doesn't exist. -#define PORTABLE_DEVICE_NAMESPACE_EXCLUDE_FROM_SHELL L"PortableDeviceNameSpaceExcludeFromShell" - -// Pre-defined name of a REG_SZ or REG_MULTI_SZ value containing content type guids that are used indicate for what content types the portable device namespace should attempt to automatically generate a thumbnail when placing new content on the device. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). Values should be a string representation of a GUID, in the form '{00000000-0000-0000-0000-000000000000}'. By default the portable device namespace attempts to automatically generate thumbnails for WPD_CONTENT_TYPE_IMAGE, if a device does not want this behavior it can set this value to an empty string. -#define PORTABLE_DEVICE_NAMESPACE_THUMBNAIL_CONTENT_TYPES L"PortableDeviceNameSpaceThumbnailContentTypes" - -// Pre-defined name of a REG_DWORD value that indicates whether a Portable Device is a Mass Storage Class (MSC) device. This is used to avoid duplication of the device in certain views and scenarios that include both file system and Portable Devices. -// This value can be retrieved using IPortableDeviceManager::GetDeviceProperty(...). Meaning of values are: 0 = device is not mass storage, 1 = device is mass storage. 0 is assumed if this value doesn't exist. -#define PORTABLE_DEVICE_IS_MASS_STORAGE L"PortableDeviceIsMassStorage" - -// Pre-defined value identifying the "Windows Media Digital Rights Management 10 for Portable Devices" scheme for protecting content. -// This value can be used by drivers to indicate they support WMDRM10-PD. See WPD_DEVICE_SUPPORTED_DRM_SCHEMES. -#define PORTABLE_DEVICE_DRM_SCHEME_WMDRM10_PD L"WMDRM10-PD" - -// Pre-defined value identifying the "Portable Device Digital Rights Management" scheme for protecting content. -// This value can be used by drivers to indicate they support PDDRM. See WPD_DEVICE_SUPPORTED_DRM_SCHEMES. -#define PORTABLE_DEVICE_DRM_SCHEME_PDDRM L"PDDRM" - - -/**************************************************************************** -* This section defines flags used in API arguments -****************************************************************************/ - -// Indicates whether the delete request should recursively delete any children. -typedef enum tagDELETE_OBJECT_OPTIONS -{ - PORTABLE_DEVICE_DELETE_NO_RECURSION = 0, - PORTABLE_DEVICE_DELETE_WITH_RECURSION = 1 -} DELETE_OBJECT_OPTIONS; - -// Possible values for PORTABLE_DEVICE_TYPE registry value. -typedef enum tagWPD_DEVICE_TYPES -{ - WPD_DEVICE_TYPE_GENERIC = 0, - WPD_DEVICE_TYPE_CAMERA = 1, - WPD_DEVICE_TYPE_MEDIA_PLAYER = 2, - WPD_DEVICE_TYPE_PHONE = 3, - WPD_DEVICE_TYPE_VIDEO = 4, - WPD_DEVICE_TYPE_PERSONAL_INFORMATION_MANAGER = 5, - WPD_DEVICE_TYPE_AUDIO_RECORDER = 6 -} WPD_DEVICE_TYPES; - -// Possible values for WPD_PROPERTY_ATTRIBUTE_FORM -typedef enum tagWpdAttributeForm -{ - WPD_PROPERTY_ATTRIBUTE_FORM_UNSPECIFIED = 0, - WPD_PROPERTY_ATTRIBUTE_FORM_RANGE = 1, - WPD_PROPERTY_ATTRIBUTE_FORM_ENUMERATION = 2, - WPD_PROPERTY_ATTRIBUTE_FORM_REGULAR_EXPRESSION = 3, - WPD_PROPERTY_ATTRIBUTE_FORM_OBJECT_IDENTIFIER = 4 -} WpdAttributeForm; - -// Possible values for WPD_PARAMETER_ATTRIBUTE_FORM -typedef enum tagWpdParameterAttributeForm -{ - WPD_PARAMETER_ATTRIBUTE_FORM_UNSPECIFIED = 0, - WPD_PARAMETER_ATTRIBUTE_FORM_RANGE = 1, - WPD_PARAMETER_ATTRIBUTE_FORM_ENUMERATION = 2, - WPD_PARAMETER_ATTRIBUTE_FORM_REGULAR_EXPRESSION = 3, - WPD_PARAMETER_ATTRIBUTE_FORM_OBJECT_IDENTIFIER = 4 -} WpdParameterAttributeForm; - -// Possible values for WPD_DEVICE_TRANSPORT property. -typedef enum tagWPD_DEVICE_TRANSPORTS -{ - WPD_DEVICE_TRANSPORT_UNSPECIFIED = 0, - WPD_DEVICE_TRANSPORT_USB = 1, - WPD_DEVICE_TRANSPORT_IP = 2, - WPD_DEVICE_TRANSPORT_BLUETOOTH = 3 -} WPD_DEVICE_TRANSPORTS; - -// Indicates the type of storage. -typedef enum tagWPD_STORAGE_TYPE_VALUES -{ - WPD_STORAGE_TYPE_UNDEFINED = 0, - WPD_STORAGE_TYPE_FIXED_ROM = 1, - WPD_STORAGE_TYPE_REMOVABLE_ROM = 2, - WPD_STORAGE_TYPE_FIXED_RAM = 3, - WPD_STORAGE_TYPE_REMOVABLE_RAM = 4 -} WPD_STORAGE_TYPE_VALUES; - -// Indicates write-protection that globally affects the storage. -typedef enum tagWPD_STORAGE_ACCESS_CAPABILITY_VALUES -{ - WPD_STORAGE_ACCESS_CAPABILITY_READWRITE = 0, - WPD_STORAGE_ACCESS_CAPABILITY_READ_ONLY_WITHOUT_OBJECT_DELETION = 1, - WPD_STORAGE_ACCESS_CAPABILITY_READ_ONLY_WITH_OBJECT_DELETION = 2 -} WPD_STORAGE_ACCESS_CAPABILITY_VALUES; - -// Possible values for WPD_SMS_ENCODING -typedef enum tagWPD_SMS_ENCODING_TYPES -{ - SMS_ENCODING_7_BIT = 0, - SMS_ENCODING_8_BIT = 1, - SMS_ENCODING_UTF_16 = 2 -} WPD_SMS_ENCODING_TYPES; - -// Possible values for WPD_PROPERTY_SMS_MESSAGE_TYPE -typedef enum tagSMS_MESSAGE_TYPES -{ - SMS_TEXT_MESSAGE = 0, - SMS_BINARY_MESSAGE = 1 -} SMS_MESSAGE_TYPES; - -// Indicates whether the device is on battery power or external power. -typedef enum tagWPD_POWER_SOURCES -{ - WPD_POWER_SOURCE_BATTERY = 0, - WPD_POWER_SOURCE_EXTERNAL = 1 -} WPD_POWER_SOURCES; - -// Indicates the way the device weighs color channels. -typedef enum tagWPD_WHITE_BALANCE_SETTINGS -{ - WPD_WHITE_BALANCE_UNDEFINED = 0, - WPD_WHITE_BALANCE_MANUAL = 1, - WPD_WHITE_BALANCE_AUTOMATIC = 2, - WPD_WHITE_BALANCE_ONE_PUSH_AUTOMATIC = 3, - WPD_WHITE_BALANCE_DAYLIGHT = 4, - WPD_WHITE_BALANCE_FLORESCENT = 5, - WPD_WHITE_BALANCE_TUNGSTEN = 6, - WPD_WHITE_BALANCE_FLASH = 7 -} WPD_WHITE_BALANCE_SETTINGS; - -// Indicates the focus mode of the device. -typedef enum tagWPD_FOCUS_MODES -{ - WPD_FOCUS_UNDEFINED = 0, - WPD_FOCUS_MANUAL = 1, - WPD_FOCUS_AUTOMATIC = 2, - WPD_FOCUS_AUTOMATIC_MACRO = 3 -} WPD_FOCUS_MODES; - -// Indicates the metering mode of the device. -typedef enum tagWPD_EXPOSURE_METERING_MODES -{ - WPD_EXPOSURE_METERING_MODE_UNDEFINED = 0, - WPD_EXPOSURE_METERING_MODE_AVERAGE = 1, - WPD_EXPOSURE_METERING_MODE_CENTER_WEIGHTED_AVERAGE = 2, - WPD_EXPOSURE_METERING_MODE_MULTI_SPOT = 3, - WPD_EXPOSURE_METERING_MODE_CENTER_SPOT = 4 -} WPD_EXPOSURE_METERING_MODES; - -// Indicates the flash mode of the device. -typedef enum tagWPD_FLASH_MODES -{ - WPD_FLASH_MODE_UNDEFINED = 0, - WPD_FLASH_MODE_AUTO = 1, - WPD_FLASH_MODE_OFF = 2, - WPD_FLASH_MODE_FILL = 3, - WPD_FLASH_MODE_RED_EYE_AUTO = 4, - WPD_FLASH_MODE_RED_EYE_FILL = 5, - WPD_FLASH_MODE_EXTERNAL_SYNC = 6 -} WPD_FLASH_MODES; - -// Indicates the exposure program mode of the device. -typedef enum tagWPD_EXPOSURE_PROGRAM_MODES -{ - WPD_EXPOSURE_PROGRAM_MODE_UNDEFINED = 0, - WPD_EXPOSURE_PROGRAM_MODE_MANUAL = 1, - WPD_EXPOSURE_PROGRAM_MODE_AUTO = 2, - WPD_EXPOSURE_PROGRAM_MODE_APERTURE_PRIORITY = 3, - WPD_EXPOSURE_PROGRAM_MODE_SHUTTER_PRIORITY = 4, - WPD_EXPOSURE_PROGRAM_MODE_CREATIVE = 5, - WPD_EXPOSURE_PROGRAM_MODE_ACTION = 6, - WPD_EXPOSURE_PROGRAM_MODE_PORTRAIT = 7 -} WPD_EXPOSURE_PROGRAM_MODES; - -// Indicates the capture mode of the device. -typedef enum tagWPD_CAPTURE_MODES -{ - WPD_CAPTURE_MODE_UNDEFINED = 0, - WPD_CAPTURE_MODE_NORMAL = 1, - WPD_CAPTURE_MODE_BURST = 2, - WPD_CAPTURE_MODE_TIMELAPSE = 3 -} WPD_CAPTURE_MODES; - -// Indicates the effect mode of the capture device. -typedef enum tagWPD_EFFECT_MODES -{ - WPD_EFFECT_MODE_UNDEFINED = 0, - WPD_EFFECT_MODE_COLOR = 1, - WPD_EFFECT_MODE_BLACK_AND_WHITE = 2, - WPD_EFFECT_MODE_SEPIA = 3 -} WPD_EFFECT_MODES; - -// Indicates the metering mode of the capture device. -typedef enum tagWPD_FOCUS_METERING_MODES -{ - WPD_FOCUS_METERING_MODE_UNDEFINED = 0, - WPD_FOCUS_METERING_MODE_CENTER_SPOT = 1, - WPD_FOCUS_METERING_MODE_MULTI_SPOT = 2 -} WPD_FOCUS_METERING_MODES; - -// Indicates the type of bitrate for the audio/video data. -typedef enum tagWPD_BITRATE_TYPES -{ - WPD_BITRATE_TYPE_UNUSED = 0, - WPD_BITRATE_TYPE_DISCRETE = 1, - WPD_BITRATE_TYPE_VARIABLE = 2, - WPD_BITRATE_TYPE_FREE = 3 -} WPD_BITRATE_TYPES; - -// Qualifies the object data in a contextual way. -typedef enum tagWPD_META_GENRES -{ - WPD_META_GENRE_UNUSED = 0x0, - WPD_META_GENRE_GENERIC_MUSIC_AUDIO_FILE = 0x1, - WPD_META_GENRE_GENERIC_NON_MUSIC_AUDIO_FILE = 0x11, - WPD_META_GENRE_SPOKEN_WORD_AUDIO_BOOK_FILES = 0x12, - WPD_META_GENRE_SPOKEN_WORD_FILES_NON_AUDIO_BOOK = 0x13, - WPD_META_GENRE_SPOKEN_WORD_NEWS = 0x14, - WPD_META_GENRE_SPOKEN_WORD_TALK_SHOWS = 0x15, - WPD_META_GENRE_GENERIC_VIDEO_FILE = 0x21, - WPD_META_GENRE_NEWS_VIDEO_FILE = 0x22, - WPD_META_GENRE_MUSIC_VIDEO_FILE = 0x23, - WPD_META_GENRE_HOME_VIDEO_FILE = 0x24, - WPD_META_GENRE_FEATURE_FILM_VIDEO_FILE = 0x25, - WPD_META_GENRE_TELEVISION_VIDEO_FILE = 0x26, - WPD_META_GENRE_TRAINING_EDUCATIONAL_VIDEO_FILE = 0x27, - WPD_META_GENRE_PHOTO_MONTAGE_VIDEO_FILE = 0x28, - WPD_META_GENRE_GENERIC_NON_AUDIO_NON_VIDEO = 0x30, - WPD_META_GENRE_AUDIO_PODCAST = 0x40, - WPD_META_GENRE_VIDEO_PODCAST = 0x41, - WPD_META_GENRE_MIXED_PODCAST = 0x42 -} WPD_META_GENRES; - -// Indicates the cropped status of an image. -typedef enum tagWPD_CROPPED_STATUS_VALUES -{ - WPD_CROPPED_STATUS_NOT_CROPPED = 0, - WPD_CROPPED_STATUS_CROPPED = 1, - WPD_CROPPED_STATUS_SHOULD_NOT_BE_CROPPED = 2 -} WPD_CROPPED_STATUS_VALUES; - -// Indicates the color corrected status of an image. -typedef enum tagWPD_COLOR_CORRECTED_STATUS_VALUES -{ - WPD_COLOR_CORRECTED_STATUS_NOT_CORRECTED = 0, - WPD_COLOR_CORRECTED_STATUS_CORRECTED = 1, - WPD_COLOR_CORRECTED_STATUS_SHOULD_NOT_BE_CORRECTED = 2 -} WPD_COLOR_CORRECTED_STATUS_VALUES; - -// Identifies the video scan-type information. -typedef enum tagWPD_VIDEO_SCAN_TYPES -{ - WPD_VIDEO_SCAN_TYPE_UNUSED = 0, - WPD_VIDEO_SCAN_TYPE_PROGRESSIVE = 1, - WPD_VIDEO_SCAN_TYPE_FIELD_INTERLEAVED_UPPER_FIRST = 2, - WPD_VIDEO_SCAN_TYPE_FIELD_INTERLEAVED_LOWER_FIRST = 3, - WPD_VIDEO_SCAN_TYPE_FIELD_SINGLE_UPPER_FIRST = 4, - WPD_VIDEO_SCAN_TYPE_FIELD_SINGLE_LOWER_FIRST = 5, - WPD_VIDEO_SCAN_TYPE_MIXED_INTERLACE = 6, - WPD_VIDEO_SCAN_TYPE_MIXED_INTERLACE_AND_PROGRESSIVE = 7 -} WPD_VIDEO_SCAN_TYPES; - -// Indicates the current state of the operation in progress. -typedef enum tagWPD_OPERATION_STATES -{ - WPD_OPERATION_STATE_UNSPECIFIED = 0, - WPD_OPERATION_STATE_STARTED = 1, - WPD_OPERATION_STATE_RUNNING = 2, - WPD_OPERATION_STATE_PAUSED = 3, - WPD_OPERATION_STATE_CANCELLED = 4, - WPD_OPERATION_STATE_FINISHED = 5, - WPD_OPERATION_STATE_ABORTED = 6 -} WPD_OPERATION_STATES; - -// Indicates the units for a referenced section of data. -typedef enum tagWPD_SECTION_DATA_UNITS_VALUES -{ - WPD_SECTION_DATA_UNITS_BYTES = 0, - WPD_SECTION_DATA_UNITS_MILLISECONDS = 1 -} WPD_SECTION_DATA_UNITS_VALUES; - -// Indicates whether the rendering information profile entry corresponds to an Object or a Resource. -typedef enum tagWPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPES -{ - WPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPE_OBJECT = 0, - WPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPE_RESOURCE = 1 -} WPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPES; - -// Indicates the type of access the command requires. This is only used internally by the command access lookup table. There is no need to use these values directly. -typedef enum tagWPD_COMMAND_ACCESS_TYPES -{ - WPD_COMMAND_ACCESS_READ = 1, - WPD_COMMAND_ACCESS_READWRITE = 3, - WPD_COMMAND_ACCESS_FROM_PROPERTY_WITH_STGM_ACCESS = 4, - WPD_COMMAND_ACCESS_FROM_PROPERTY_WITH_FILE_ACCESS = 8, - WPD_COMMAND_ACCESS_FROM_ATTRIBUTE_WITH_METHOD_ACCESS = 16 -} WPD_COMMAND_ACCESS_TYPES; - -// Indicates the inheritance relationship to query for this service. -typedef enum tagWPD_SERVICE_INHERITANCE_TYPES -{ - WPD_SERVICE_INHERITANCE_IMPLEMENTATION = 0 -} WPD_SERVICE_INHERITANCE_TYPES; - -// Indicates the usage of a parameter. -typedef enum tagWPD_PARAMETER_USAGE_TYPES -{ - WPD_PARAMETER_USAGE_RETURN = 0, - WPD_PARAMETER_USAGE_IN = 1, - WPD_PARAMETER_USAGE_OUT = 2, - WPD_PARAMETER_USAGE_INOUT = 3 -} WPD_PARAMETER_USAGE_TYPES; - -/**************************************************************************** -* This section declares WPD specific Errors -****************************************************************************/ -#define FACILITY_WPD 42 - -#define E_WPD_DEVICE_ALREADY_OPENED MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 1 ) /* 0x802A0001 */ -#define E_WPD_DEVICE_NOT_OPEN MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 2 ) /* 0x802A0002 */ -#define E_WPD_OBJECT_ALREADY_ATTACHED_TO_DEVICE MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 3 ) /* 0x802A0003 */ -#define E_WPD_OBJECT_NOT_ATTACHED_TO_DEVICE MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 4 ) /* 0x802A0004 */ -#define E_WPD_OBJECT_NOT_COMMITED MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 5 ) /* 0x802A0005 */ -#define E_WPD_DEVICE_IS_HUNG MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 6 ) /* 0x802A0006 */ -#define E_WPD_SMS_INVALID_RECIPIENT MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 100 ) /* 0x802A0064 */ -#define E_WPD_SMS_INVALID_MESSAGE_BODY MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 101 ) /* 0x802A0065 */ -#define E_WPD_SMS_SERVICE_UNAVAILABLE MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 102 ) /* 0x802A0066 */ -#define E_WPD_SERVICE_ALREADY_OPENED MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 200 ) /* 0x802A00C8 */ -#define E_WPD_SERVICE_NOT_OPEN MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 201 ) /* 0x802A00C9 */ -#define E_WPD_OBJECT_ALREADY_ATTACHED_TO_SERVICE MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 202 ) /* 0x802A00CA */ -#define E_WPD_OBJECT_NOT_ATTACHED_TO_SERVICE MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 203 ) /* 0x802A00CB */ -#define E_WPD_SERVICE_BAD_PARAMETER_ORDER MAKE_HRESULT( SEVERITY_ERROR , FACILITY_WPD, 204 ) /* 0x802A00CC */ - -/**************************************************************************** -* This section defines all WPD Events -****************************************************************************/ -// -// WPD_EVENT_NOTIFICATION -// This GUID is used to identify all WPD driver events to the event sub-system. The driver uses this as the GUID identifier when it queues an event with IWdfDevice::PostEvent(). Applications never use this value. -DEFINE_GUID(WPD_EVENT_NOTIFICATION, 0x2BA2E40A, 0x6B4C, 0x4295, 0xBB, 0x43, 0x26, 0x32, 0x2B, 0x99, 0xAE, 0xB2 ); -// -// WPD_EVENT_OBJECT_ADDED -// This event is sent after a new object is available on the device. -DEFINE_GUID(WPD_EVENT_OBJECT_ADDED, 0xA726DA95, 0xE207, 0x4B02, 0x8D, 0x44, 0xBE, 0xF2, 0xE8, 0x6C, 0xBF, 0xFC ); -// -// WPD_EVENT_OBJECT_REMOVED -// This event is sent after a previously existing object has been removed from the device. -DEFINE_GUID(WPD_EVENT_OBJECT_REMOVED, 0xBE82AB88, 0xA52C, 0x4823, 0x96, 0xE5, 0xD0, 0x27, 0x26, 0x71, 0xFC, 0x38 ); -// -// WPD_EVENT_OBJECT_UPDATED -// This event is sent after an object has been updated such that any connected client should refresh its view of that object. -DEFINE_GUID(WPD_EVENT_OBJECT_UPDATED, 0x1445A759, 0x2E01, 0x485D, 0x9F, 0x27, 0xFF, 0x07, 0xDA, 0xE6, 0x97, 0xAB ); -// -// WPD_EVENT_DEVICE_RESET -// This event indicates that the device is about to be reset, and all connected clients should close their connection to the device. -DEFINE_GUID(WPD_EVENT_DEVICE_RESET, 0x7755CF53, 0xC1ED, 0x44F3, 0xB5, 0xA2, 0x45, 0x1E, 0x2C, 0x37, 0x6B, 0x27 ); -// -// WPD_EVENT_DEVICE_CAPABILITIES_UPDATED -// This event indicates that the device capabilities have changed. Clients should re-query the device if they have made any decisions based on device capabilities. -DEFINE_GUID(WPD_EVENT_DEVICE_CAPABILITIES_UPDATED, 0x36885AA1, 0xCD54, 0x4DAA, 0xB3, 0xD0, 0xAF, 0xB3, 0xE0, 0x3F, 0x59, 0x99 ); -// -// WPD_EVENT_STORAGE_FORMAT -// This event indicates the progress of a format operation on a storage object. -DEFINE_GUID(WPD_EVENT_STORAGE_FORMAT, 0x3782616B, 0x22BC, 0x4474, 0xA2, 0x51, 0x30, 0x70, 0xF8, 0xD3, 0x88, 0x57 ); -// -// WPD_EVENT_OBJECT_TRANSFER_REQUESTED -// This event is sent to request an application to transfer a particular object from the device. -DEFINE_GUID(WPD_EVENT_OBJECT_TRANSFER_REQUESTED, 0x8D16A0A1, 0xF2C6, 0x41DA, 0x8F, 0x19, 0x5E, 0x53, 0x72, 0x1A, 0xDB, 0xF2 ); -// -// WPD_EVENT_DEVICE_REMOVED -// This event is sent when a driver for a device is being unloaded. This is typically a result of the device being unplugged. -DEFINE_GUID(WPD_EVENT_DEVICE_REMOVED, 0xE4CBCA1B, 0x6918, 0x48B9,0x85, 0xEE, 0x02, 0xBE, 0x7C, 0x85, 0x0A, 0xF9 ); -// -// WPD_EVENT_SERVICE_METHOD_COMPLETE -// This event is sent when a driver has completed invoking a service method. This event must be sent even when the method fails. -DEFINE_GUID(WPD_EVENT_SERVICE_METHOD_COMPLETE, 0x8A33F5F8, 0x0ACC, 0x4D9B, 0x9C, 0xC4, 0x11, 0x2D, 0x35, 0x3B, 0x86, 0xCA ); - -/**************************************************************************** -* This section defines all WPD content types -****************************************************************************/ -// -// WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT -// Indicates this object represents a functional object, not content data on the device. -DEFINE_GUID(WPD_CONTENT_TYPE_FUNCTIONAL_OBJECT, 0x99ED0160, 0x17FF, 0x4C44, 0x9D, 0x98, 0x1D, 0x7A, 0x6F, 0x94, 0x19, 0x21 ); -// -// WPD_CONTENT_TYPE_FOLDER -// Indicates this object is a folder. -DEFINE_GUID(WPD_CONTENT_TYPE_FOLDER, 0x27E2E392, 0xA111, 0x48E0, 0xAB, 0x0C, 0xE1, 0x77, 0x05, 0xA0, 0x5F, 0x85 ); -// -// WPD_CONTENT_TYPE_IMAGE -// Indicates this object represents image data (e.g. a JPEG file) -DEFINE_GUID(WPD_CONTENT_TYPE_IMAGE, 0xef2107d5, 0xa52a, 0x4243, 0xa2, 0x6b, 0x62, 0xd4, 0x17, 0x6d, 0x76, 0x03 ); -// -// WPD_CONTENT_TYPE_DOCUMENT -// Indicates this object represents document data (e.g. a MS WORD file, TEXT file, etc.) -DEFINE_GUID(WPD_CONTENT_TYPE_DOCUMENT, 0x680ADF52, 0x950A, 0x4041, 0x9B, 0x41, 0x65, 0xE3, 0x93, 0x64, 0x81, 0x55 ); -// -// WPD_CONTENT_TYPE_CONTACT -// Indicates this object represents contact data (e.g. name/number, or a VCARD file) -DEFINE_GUID(WPD_CONTENT_TYPE_CONTACT, 0xEABA8313, 0x4525, 0x4707, 0x9F, 0x0E, 0x87, 0xC6, 0x80, 0x8E, 0x94, 0x35 ); -// -// WPD_CONTENT_TYPE_CONTACT_GROUP -// Indicates this object represents a group of contacts. -DEFINE_GUID(WPD_CONTENT_TYPE_CONTACT_GROUP, 0x346B8932, 0x4C36, 0x40D8, 0x94, 0x15, 0x18, 0x28, 0x29, 0x1F, 0x9D, 0xE9 ); -// -// WPD_CONTENT_TYPE_AUDIO -// Indicates this object represents audio data (e.g. a WMA or MP3 file) -DEFINE_GUID(WPD_CONTENT_TYPE_AUDIO, 0x4AD2C85E, 0x5E2D, 0x45E5, 0x88, 0x64, 0x4F, 0x22, 0x9E, 0x3C, 0x6C, 0xF0 ); -// -// WPD_CONTENT_TYPE_VIDEO -// Indicates this object represents video data (e.g. a WMV or AVI file) -DEFINE_GUID(WPD_CONTENT_TYPE_VIDEO, 0x9261B03C, 0x3D78, 0x4519, 0x85, 0xE3, 0x02, 0xC5, 0xE1, 0xF5, 0x0B, 0xB9 ); -// -// WPD_CONTENT_TYPE_TELEVISION -// Indicates this object represents a television recording. -DEFINE_GUID(WPD_CONTENT_TYPE_TELEVISION, 0x60A169CF, 0xF2AE, 0x4E21, 0x93, 0x75, 0x96, 0x77, 0xF1, 0x1C, 0x1C, 0x6E ); -// -// WPD_CONTENT_TYPE_PLAYLIST -// Indicates this object represents a playlist. -DEFINE_GUID(WPD_CONTENT_TYPE_PLAYLIST, 0x1A33F7E4, 0xAF13, 0x48F5, 0x99, 0x4E, 0x77, 0x36, 0x9D, 0xFE, 0x04, 0xA3 ); -// -// WPD_CONTENT_TYPE_MIXED_CONTENT_ALBUM -// Indicates this object represents an album, which may contain objects of different content types (typically, MUSIC, IMAGE and VIDEO). -DEFINE_GUID(WPD_CONTENT_TYPE_MIXED_CONTENT_ALBUM, 0x00F0C3AC, 0xA593, 0x49AC, 0x92, 0x19, 0x24, 0xAB, 0xCA, 0x5A, 0x25, 0x63 ); -// -// WPD_CONTENT_TYPE_AUDIO_ALBUM -// Indicates this object represents an audio album. -DEFINE_GUID(WPD_CONTENT_TYPE_AUDIO_ALBUM, 0xAA18737E, 0x5009, 0x48FA, 0xAE, 0x21, 0x85, 0xF2, 0x43, 0x83, 0xB4, 0xE6 ); -// -// WPD_CONTENT_TYPE_IMAGE_ALBUM -// Indicates this object represents an image album. -DEFINE_GUID(WPD_CONTENT_TYPE_IMAGE_ALBUM, 0x75793148, 0x15F5, 0x4A30, 0xA8, 0x13, 0x54, 0xED, 0x8A, 0x37, 0xE2, 0x26 ); -// -// WPD_CONTENT_TYPE_VIDEO_ALBUM -// Indicates this object represents a video album. -DEFINE_GUID(WPD_CONTENT_TYPE_VIDEO_ALBUM, 0x012B0DB7, 0xD4C1, 0x45D6, 0xB0, 0x81, 0x94, 0xB8, 0x77, 0x79, 0x61, 0x4F ); -// -// WPD_CONTENT_TYPE_MEMO -// Indicates this object represents memo data -DEFINE_GUID(WPD_CONTENT_TYPE_MEMO, 0x9CD20ECF, 0x3B50, 0x414F, 0xA6, 0x41, 0xE4, 0x73, 0xFF, 0xE4, 0x57, 0x51 ); -// -// WPD_CONTENT_TYPE_EMAIL -// Indicates this object represents e-mail data -DEFINE_GUID(WPD_CONTENT_TYPE_EMAIL, 0x8038044A, 0x7E51, 0x4F8F, 0x88, 0x3D, 0x1D, 0x06, 0x23, 0xD1, 0x45, 0x33 ); -// -// WPD_CONTENT_TYPE_APPOINTMENT -// Indicates this object represents an appointment in a calendar -DEFINE_GUID(WPD_CONTENT_TYPE_APPOINTMENT, 0x0FED060E, 0x8793, 0x4B1E, 0x90, 0xC9, 0x48, 0xAC, 0x38, 0x9A, 0xC6, 0x31 ); -// -// WPD_CONTENT_TYPE_TASK -// Indicates this object represents a task for tracking (e.g. a TODO list) -DEFINE_GUID(WPD_CONTENT_TYPE_TASK, 0x63252F2C, 0x887F, 0x4CB6, 0xB1, 0xAC, 0xD2, 0x98, 0x55, 0xDC, 0xEF, 0x6C ); -// -// WPD_CONTENT_TYPE_PROGRAM -// Indicates this object represents a file that can be run. This could be a script, executable and so on. -DEFINE_GUID(WPD_CONTENT_TYPE_PROGRAM, 0xD269F96A, 0x247C, 0x4BFF, 0x98, 0xFB, 0x97, 0xF3, 0xC4, 0x92, 0x20, 0xE6 ); -// -// WPD_CONTENT_TYPE_GENERIC_FILE -// Indicates this object represents a file that does not fall into any of the other predefined WPD types for files. -DEFINE_GUID(WPD_CONTENT_TYPE_GENERIC_FILE, 0x0085E0A6, 0x8D34, 0x45D7, 0xBC, 0x5C, 0x44, 0x7E, 0x59, 0xC7, 0x3D, 0x48 ); -// -// WPD_CONTENT_TYPE_CALENDAR -// Indicates this object represents a calender -DEFINE_GUID(WPD_CONTENT_TYPE_CALENDAR, 0xA1FD5967, 0x6023, 0x49A0, 0x9D, 0xF1, 0xF8, 0x06, 0x0B, 0xE7, 0x51, 0xB0 ); -// -// WPD_CONTENT_TYPE_GENERIC_MESSAGE -// Indicates this object represents a message (e.g. SMS message, E-Mail message, etc.) -DEFINE_GUID(WPD_CONTENT_TYPE_GENERIC_MESSAGE, 0xE80EAAF8, 0xB2DB, 0x4133, 0xB6, 0x7E, 0x1B, 0xEF, 0x4B, 0x4A, 0x6E, 0x5F ); -// -// WPD_CONTENT_TYPE_NETWORK_ASSOCIATION -// Indicates this object represents an association between a host and a device. -DEFINE_GUID(WPD_CONTENT_TYPE_NETWORK_ASSOCIATION, 0x031DA7EE, 0x18C8, 0x4205, 0x84, 0x7E, 0x89, 0xA1, 0x12, 0x61, 0xD0, 0xF3 ); -// -// WPD_CONTENT_TYPE_CERTIFICATE -// Indicates this object represents certificate used for authentication. -DEFINE_GUID(WPD_CONTENT_TYPE_CERTIFICATE, 0xDC3876E8, 0xA948, 0x4060, 0x90, 0x50, 0xCB, 0xD7, 0x7E, 0x8A, 0x3D, 0x87 ); -// -// WPD_CONTENT_TYPE_WIRELESS_PROFILE -// Indicates this object represents wireless network access information. -DEFINE_GUID(WPD_CONTENT_TYPE_WIRELESS_PROFILE, 0x0BAC070A, 0x9F5F, 0x4DA4, 0xA8, 0xF6, 0x3D, 0xE4, 0x4D, 0x68, 0xFD, 0x6C ); -// -// WPD_CONTENT_TYPE_MEDIA_CAST -// Indicates this object represents a media cast. A media cast object can be though of as a container object that groups related content, similar to how a playlist groups songs to play. Often, a media cast object is used to group media content originally published online. -DEFINE_GUID(WPD_CONTENT_TYPE_MEDIA_CAST, 0x5E88B3CC, 0x3E65, 0x4E62, 0xBF, 0xFF, 0x22, 0x94, 0x95, 0x25, 0x3A, 0xB0 ); -// -// WPD_CONTENT_TYPE_SECTION -// Indicates this object describes a section of data contained in another object. The WPD_OBJECT_REFERENCES property indicates which object contains the actual data. -DEFINE_GUID(WPD_CONTENT_TYPE_SECTION, 0x821089F5, 0x1D91, 0x4DC9, 0xBE, 0x3C, 0xBB, 0xB1, 0xB3, 0x5B, 0x18, 0xCE ); -// -// WPD_CONTENT_TYPE_UNSPECIFIED -// Indicates this object doesn't fall into the predefined WPD content types -DEFINE_GUID(WPD_CONTENT_TYPE_UNSPECIFIED, 0x28D8D31E, 0x249C, 0x454E, 0xAA, 0xBC, 0x34, 0x88, 0x31, 0x68, 0xE6, 0x34 ); -// -// WPD_CONTENT_TYPE_ALL -// This content type is only valid as a parameter to API functions and driver commands. It should not be reported as a supported content type by the driver. -DEFINE_GUID(WPD_CONTENT_TYPE_ALL, 0x80E170D2, 0x1055, 0x4A3E, 0xB9, 0x52, 0x82, 0xCC, 0x4F, 0x8A, 0x86, 0x89 ); - -/**************************************************************************** -* This section defines all WPD Functional Categories -****************************************************************************/ - -#ifndef WPD_SERVICES_STRICT -// -// WPD_FUNCTIONAL_CATEGORY_DEVICE -// Used for the device object, which is always the top-most object of the device. -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_DEVICE, 0x08EA466B, 0xE3A4, 0x4336, 0xA1, 0xF3, 0xA4, 0x4D, 0x2B, 0x5C, 0x43, 0x8C ); -// -// WPD_FUNCTIONAL_CATEGORY_STORAGE -// Indicates this object encapsulates storage functionality on the device (e.g. memory cards, internal memory) -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_STORAGE, 0x23F05BBC, 0x15DE, 0x4C2A, 0xA5, 0x5B, 0xA9, 0xAF, 0x5C, 0xE4, 0x12, 0xEF ); -// -// WPD_FUNCTIONAL_CATEGORY_STILL_IMAGE_CAPTURE -// Indicates this object encapsulates still image capture functionality on the device (e.g. camera or camera attachment) -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_STILL_IMAGE_CAPTURE, 0x613CA327, 0xAB93, 0x4900, 0xB4, 0xFA, 0x89, 0x5B, 0xB5, 0x87, 0x4B, 0x79 ); -// -// WPD_FUNCTIONAL_CATEGORY_AUDIO_CAPTURE -// Indicates this object encapsulates audio capture functionality on the device (e.g. voice recorder or other audio recording component) -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_AUDIO_CAPTURE, 0x3F2A1919, 0xC7C2, 0x4A00, 0x85, 0x5D, 0xF5, 0x7C, 0xF0, 0x6D, 0xEB, 0xBB ); -// -// WPD_FUNCTIONAL_CATEGORY_VIDEO_CAPTURE -// Indicates this object encapsulates video capture functionality on the device (e.g. video recorder or video recording component) -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_VIDEO_CAPTURE, 0xE23E5F6B, 0x7243, 0x43AA, 0x8D, 0xF1, 0x0E, 0xB3, 0xD9, 0x68, 0xA9, 0x18 ); -// -// WPD_FUNCTIONAL_CATEGORY_SMS -// Indicates this object encapsulates SMS sending functionality on the device (not the receiving or saved SMS messages since those are represented as content objects on the device) -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_SMS, 0x0044A0B1, 0xC1E9, 0x4AFD, 0xB3, 0x58, 0xA6, 0x2C, 0x61, 0x17, 0xC9, 0xCF ); -// -// WPD_FUNCTIONAL_CATEGORY_RENDERING_INFORMATION -// Indicates this object provides information about the rendering characteristics of the device. -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_RENDERING_INFORMATION, 0x08600BA4, 0xA7BA, 0x4A01, 0xAB, 0x0E, 0x00, 0x65, 0xD0, 0xA3, 0x56, 0xD3 ); -// -// WPD_FUNCTIONAL_CATEGORY_NETWORK_CONFIGURATION -// Indicates this object encapsulates network configuration functionality on the device (e.g. WiFi Profiles, Partnerships). -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_NETWORK_CONFIGURATION, 0x48F4DB72, 0x7C6A, 0x4AB0, 0x9E, 0x1A, 0x47, 0x0E, 0x3C, 0xDB, 0xF2, 0x6A ); -// -// WPD_FUNCTIONAL_CATEGORY_ALL -// This functional category is only valid as a parameter to API functions and driver commands. It should not be reported as a supported functional category by the driver. -DEFINE_GUID(WPD_FUNCTIONAL_CATEGORY_ALL, 0x2D8A6512, 0xA74C, 0x448E, 0xBA, 0x8A, 0xF4, 0xAC, 0x07, 0xC4, 0x93, 0x99 ); - -#endif // WPD_SERVICES_STRICT -/**************************************************************************** -* This section defines all WPD Formats -****************************************************************************/ - -#ifndef WPD_SERVICES_STRICT -// -// WPD_OBJECT_FORMAT_PROPERTIES_ONLY -// This object has no data stream and is completely specified by properties only. -DEFINE_GUID(WPD_OBJECT_FORMAT_PROPERTIES_ONLY, 0x30010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_UNSPECIFIED -// An undefined object format on the device (e.g. objects that can not be classified by the other defined WPD format codes) -DEFINE_GUID(WPD_OBJECT_FORMAT_UNSPECIFIED, 0x30000000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_SCRIPT -// A device model-specific script -DEFINE_GUID(WPD_OBJECT_FORMAT_SCRIPT, 0x30020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_EXECUTABLE -// A device model-specific binary executable -DEFINE_GUID(WPD_OBJECT_FORMAT_EXECUTABLE, 0x30030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_TEXT -// A text file -DEFINE_GUID(WPD_OBJECT_FORMAT_TEXT, 0x30040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_HTML -// A HyperText Markup Language file (text) -DEFINE_GUID(WPD_OBJECT_FORMAT_HTML, 0x30050000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_DPOF -// A Digital Print Order File (text) -DEFINE_GUID(WPD_OBJECT_FORMAT_DPOF, 0x30060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_AIFF -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_AIFF, 0x30070000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_WAVE -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_WAVE, 0x30080000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MP3 -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_MP3, 0x30090000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_AVI -// Video file format -DEFINE_GUID(WPD_OBJECT_FORMAT_AVI, 0x300A0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MPEG -// Video file format -DEFINE_GUID(WPD_OBJECT_FORMAT_MPEG, 0x300B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ASF -// Video file format (Microsoft Advanced Streaming Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_ASF, 0x300C0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_EXIF -// Image file format (Exchangeable File Format), JEIDA standard -DEFINE_GUID(WPD_OBJECT_FORMAT_EXIF, 0x38010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_TIFFEP -// Image file format (Tag Image File Format for Electronic Photography) -DEFINE_GUID(WPD_OBJECT_FORMAT_TIFFEP, 0x38020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_FLASHPIX -// Image file format (Structured Storage Image Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_FLASHPIX, 0x38030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_BMP -// Image file format (Microsoft Windows Bitmap file) -DEFINE_GUID(WPD_OBJECT_FORMAT_BMP, 0x38040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_CIFF -// Image file format (Canon Camera Image File Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_CIFF, 0x38050000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_GIF -// Image file format (Graphics Interchange Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_GIF, 0x38070000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_JFIF -// Image file format (JPEG Interchange Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_JFIF, 0x38080000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_PCD -// Image file format (PhotoCD Image Pac) -DEFINE_GUID(WPD_OBJECT_FORMAT_PCD, 0x38090000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_PICT -// Image file format (Quickdraw Image Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_PICT, 0x380A0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_PNG -// Image file format (Portable Network Graphics) -DEFINE_GUID(WPD_OBJECT_FORMAT_PNG, 0x380B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_TIFF -// Image file format (Tag Image File Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_TIFF, 0x380D0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_TIFFIT -// Image file format (Tag Image File Format for Informational Technology) Graphic Arts -DEFINE_GUID(WPD_OBJECT_FORMAT_TIFFIT, 0x380E0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_JP2 -// Image file format (JPEG2000 Baseline File Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_JP2, 0x380F0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_JPX -// Image file format (JPEG2000 Extended File Format) -DEFINE_GUID(WPD_OBJECT_FORMAT_JPX, 0x38100000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_WINDOWSIMAGEFORMAT -// Image file format -DEFINE_GUID(WPD_OBJECT_FORMAT_WINDOWSIMAGEFORMAT, 0xB8810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_WMA -// Audio file format (Windows Media Audio) -DEFINE_GUID(WPD_OBJECT_FORMAT_WMA, 0xB9010000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_WMV -// Video file format (Windows Media Video) -DEFINE_GUID(WPD_OBJECT_FORMAT_WMV, 0xB9810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_WPLPLAYLIST -// Playlist file format -DEFINE_GUID(WPD_OBJECT_FORMAT_WPLPLAYLIST, 0xBA100000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_M3UPLAYLIST -// Playlist file format -DEFINE_GUID(WPD_OBJECT_FORMAT_M3UPLAYLIST, 0xBA110000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MPLPLAYLIST -// Playlist file format -DEFINE_GUID(WPD_OBJECT_FORMAT_MPLPLAYLIST, 0xBA120000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ASXPLAYLIST -// Playlist file format -DEFINE_GUID(WPD_OBJECT_FORMAT_ASXPLAYLIST, 0xBA130000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_PLSPLAYLIST -// Playlist file format -DEFINE_GUID(WPD_OBJECT_FORMAT_PLSPLAYLIST, 0xBA140000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ABSTRACT_CONTACT_GROUP -// Generic format for contact group objects -DEFINE_GUID(WPD_OBJECT_FORMAT_ABSTRACT_CONTACT_GROUP, 0xBA060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ABSTRACT_MEDIA_CAST -// MediaCast file format -DEFINE_GUID(WPD_OBJECT_FORMAT_ABSTRACT_MEDIA_CAST, 0xBA0B0000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_VCALENDAR1 -// VCALENDAR file format (VCALENDAR Version 1) -DEFINE_GUID(WPD_OBJECT_FORMAT_VCALENDAR1, 0xBE020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ICALENDAR -// ICALENDAR file format (VCALENDAR Version 2) -DEFINE_GUID(WPD_OBJECT_FORMAT_ICALENDAR, 0xBE030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ABSTRACT_CONTACT -// Abstract contact file format -DEFINE_GUID(WPD_OBJECT_FORMAT_ABSTRACT_CONTACT, 0xBB810000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_VCARD2 -// VCARD file format (VCARD Version 2) -DEFINE_GUID(WPD_OBJECT_FORMAT_VCARD2, 0xBB820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_VCARD3 -// VCARD file format (VCARD Version 3) -DEFINE_GUID(WPD_OBJECT_FORMAT_VCARD3, 0xBB830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_ICON -// Standard Windows ICON format -DEFINE_GUID(WPD_OBJECT_FORMAT_ICON, 0x077232ED, 0x102C, 0x4638, 0x9C, 0x22, 0x83, 0xF1, 0x42, 0xBF, 0xC8, 0x22 ); -// -// WPD_OBJECT_FORMAT_XML -// XML file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_XML, 0xBA820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_AAC -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_AAC, 0xB9030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_AUDIBLE -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_AUDIBLE, 0xB9040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_FLAC -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_FLAC, 0xB9060000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_OGG -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_OGG, 0xB9020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MP4 -// Audio or Video file format -DEFINE_GUID(WPD_OBJECT_FORMAT_MP4, 0xB9820000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_M4A -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_M4A, 0x30ABA7AC, 0x6FFD, 0x4C23, 0xA3, 0x59, 0x3E, 0x9B, 0x52, 0xF3, 0xF1, 0xC8 ); -// -// WPD_OBJECT_FORMAT_MP2 -// Audio or Video file format -DEFINE_GUID(WPD_OBJECT_FORMAT_MP2, 0xB9830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MICROSOFT_WORD -// Microsoft Office Word Document file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_MICROSOFT_WORD, 0xBA830000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MHT_COMPILED_HTML -// MHT Compiled HTML Document file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_MHT_COMPILED_HTML, 0xBA840000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MICROSOFT_EXCEL -// Microsoft Office Excel Document file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_MICROSOFT_EXCEL, 0xBA850000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MICROSOFT_POWERPOINT -// Microsoft Office PowerPoint Document file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_MICROSOFT_POWERPOINT, 0xBA860000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_NETWORK_ASSOCIATION -// Network Association file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_NETWORK_ASSOCIATION, 0xB1020000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_X509V3CERTIFICATE -// X.509 V3 Certificate file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_X509V3CERTIFICATE, 0xB1030000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_MICROSOFT_WFC -// Windows Connect Now file format. -DEFINE_GUID(WPD_OBJECT_FORMAT_MICROSOFT_WFC, 0xB1040000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_3GP -// Audio or Video file format -DEFINE_GUID(WPD_OBJECT_FORMAT_3GP, 0xB9840000, 0xAE6C, 0x4804, 0x98, 0xBA, 0xC5, 0x7B, 0x46, 0x96, 0x5F, 0xE7 ); -// -// WPD_OBJECT_FORMAT_3GPA -// Audio file format -DEFINE_GUID(WPD_OBJECT_FORMAT_3GPA, 0xE5172730, 0xF971, 0x41EF, 0xA1, 0x0B, 0x22, 0x71, 0xA0, 0x01, 0x9D, 0x7A ); -#define WPD_OBJECT_FORMAT_VCALENDAR2 WPD_OBJECT_FORMAT_ICALENDAR - -#endif // WPD_SERVICES_STRICT - -// -// WPD_OBJECT_FORMAT_ALL -// This format is only valid as a parameter to API functions and driver commands. It should not be reported as a supported format by the driver. -DEFINE_GUID(WPD_OBJECT_FORMAT_ALL, 0xC1F62EB2, 0x4BB3, 0x479C, 0x9C, 0xFA, 0x05, 0xB5, 0xF3, 0xA5, 0x7B, 0x22 ); - -#ifndef WPD_SERVICES_STRICT -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_OBJECT_PROPERTIES_V1 -* -* This category is for all common object properties. -****************************************************************************/ -DEFINE_GUID( WPD_OBJECT_PROPERTIES_V1 , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C ); - -// -// WPD_OBJECT_ID -// [ VT_LPWSTR ] Uniquely identifies object on the Portable Device. -DEFINE_PROPERTYKEY( WPD_OBJECT_ID , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 2 ); -// -// WPD_OBJECT_PARENT_ID -// [ VT_LPWSTR ] Object identifier indicating the parent object. -DEFINE_PROPERTYKEY( WPD_OBJECT_PARENT_ID , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 3 ); -// -// WPD_OBJECT_NAME -// [ VT_LPWSTR ] The display name for this object. -DEFINE_PROPERTYKEY( WPD_OBJECT_NAME , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 4 ); -// -// WPD_OBJECT_PERSISTENT_UNIQUE_ID -// [ VT_LPWSTR ] Uniquely identifies the object on the Portable Device, similar to WPD_OBJECT_ID, but this ID will not change between sessions. -DEFINE_PROPERTYKEY( WPD_OBJECT_PERSISTENT_UNIQUE_ID , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 5 ); -// -// WPD_OBJECT_FORMAT -// [ VT_CLSID ] Indicates the format of the object's data. -DEFINE_PROPERTYKEY( WPD_OBJECT_FORMAT , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 6 ); - -#endif // WPD_SERVICES_STRICT -// -// WPD_OBJECT_CONTENT_TYPE -// [ VT_CLSID ] The abstract type for the object content, indicating the kinds of properties and data that may be supported on the object. -DEFINE_PROPERTYKEY( WPD_OBJECT_CONTENT_TYPE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 7 ); - -#ifndef WPD_SERVICES_STRICT -// -// WPD_OBJECT_ISHIDDEN -// [ VT_BOOL ] Indicates whether the object should be hidden. -DEFINE_PROPERTYKEY( WPD_OBJECT_ISHIDDEN , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 9 ); -// -// WPD_OBJECT_ISSYSTEM -// [ VT_BOOL ] Indicates whether the object represents system data. -DEFINE_PROPERTYKEY( WPD_OBJECT_ISSYSTEM , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 10 ); -// -// WPD_OBJECT_SIZE -// [ VT_UI8 ] The size of the object data. -DEFINE_PROPERTYKEY( WPD_OBJECT_SIZE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 11 ); -// -// WPD_OBJECT_ORIGINAL_FILE_NAME -// [ VT_LPWSTR ] Contains the name of the file this object represents. -DEFINE_PROPERTYKEY( WPD_OBJECT_ORIGINAL_FILE_NAME , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 12 ); -// -// WPD_OBJECT_NON_CONSUMABLE -// [ VT_BOOL ] This property determines whether or not this object is intended to be understood by the device, or whether it has been placed on the device just for storage. -DEFINE_PROPERTYKEY( WPD_OBJECT_NON_CONSUMABLE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 13 ); - -#endif // WPD_SERVICES_STRICT -// -// WPD_OBJECT_REFERENCES -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR indicating a list of ObjectIDs. -DEFINE_PROPERTYKEY( WPD_OBJECT_REFERENCES , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 14 ); - -#ifndef WPD_SERVICES_STRICT -// -// WPD_OBJECT_KEYWORDS -// [ VT_LPWSTR ] String containing a list of keywords associated with this object. -DEFINE_PROPERTYKEY( WPD_OBJECT_KEYWORDS , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 15 ); -// -// WPD_OBJECT_SYNC_ID -// [ VT_LPWSTR ] Opaque string set by client to retain state between sessions without retaining a catalogue of connected device content. -DEFINE_PROPERTYKEY( WPD_OBJECT_SYNC_ID , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 16 ); -// -// WPD_OBJECT_IS_DRM_PROTECTED -// [ VT_BOOL ] Indicates whether the media data is DRM protected. -DEFINE_PROPERTYKEY( WPD_OBJECT_IS_DRM_PROTECTED , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 17 ); -// -// WPD_OBJECT_DATE_CREATED -// [ VT_DATE ] Indicates the date and time the object was created on the device. -DEFINE_PROPERTYKEY( WPD_OBJECT_DATE_CREATED , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 18 ); -// -// WPD_OBJECT_DATE_MODIFIED -// [ VT_DATE ] Indicates the date and time the object was modified on the device. -DEFINE_PROPERTYKEY( WPD_OBJECT_DATE_MODIFIED , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 19 ); -// -// WPD_OBJECT_DATE_AUTHORED -// [ VT_DATE ] Indicates the date and time the object was authored (e.g. for music, this would be the date the music was recorded). -DEFINE_PROPERTYKEY( WPD_OBJECT_DATE_AUTHORED , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 20 ); -// -// WPD_OBJECT_BACK_REFERENCES -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR indicating a list of ObjectIDs. -DEFINE_PROPERTYKEY( WPD_OBJECT_BACK_REFERENCES , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 21 ); - -#endif // WPD_SERVICES_STRICT -// -// WPD_OBJECT_CONTAINER_FUNCTIONAL_OBJECT_ID -// [ VT_LPWSTR ] Indicates the Object ID of the closest functional object ancestor. For example, objects that represent files/folders under a Storage functional object, will have this property set to the object ID of the storage functional object. -DEFINE_PROPERTYKEY( WPD_OBJECT_CONTAINER_FUNCTIONAL_OBJECT_ID , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 23 ); - -#ifndef WPD_SERVICES_STRICT -// -// WPD_OBJECT_GENERATE_THUMBNAIL_FROM_RESOURCE -// [ VT_BOOL ] Indicates whether the thumbnail for this object should be generated from the default resource. -DEFINE_PROPERTYKEY( WPD_OBJECT_GENERATE_THUMBNAIL_FROM_RESOURCE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 24 ); -// -// WPD_OBJECT_HINT_LOCATION_DISPLAY_NAME -// [ VT_LPWSTR ] If this object appears as a hint location, this property indicates the hint-specific name to display instead of the object name. -DEFINE_PROPERTYKEY( WPD_OBJECT_HINT_LOCATION_DISPLAY_NAME , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 25 ); -// -// WPD_OBJECT_CAN_DELETE -// [ VT_BOOL ] Indicates whether the object can be deleted, or not. -DEFINE_PROPERTYKEY( WPD_OBJECT_CAN_DELETE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 26 ); -// -// WPD_OBJECT_LANGUAGE_LOCALE -// [ VT_LPWSTR ] Identifies the language of this object. If multiple languages are contained in this object, it should identify the primary language (if any). -DEFINE_PROPERTYKEY( WPD_OBJECT_LANGUAGE_LOCALE , 0xEF6B490D, 0x5CD8, 0x437A, 0xAF, 0xFC, 0xDA, 0x8B, 0x60, 0xEE, 0x4A, 0x3C , 27 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_FOLDER_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all folder objects. -****************************************************************************/ -DEFINE_GUID( WPD_FOLDER_OBJECT_PROPERTIES_V1 , 0x7E9A7ABF, 0xE568, 0x4B34, 0xAA, 0x2F, 0x13, 0xBB, 0x12, 0xAB, 0x17, 0x7D ); - -// -// WPD_FOLDER_CONTENT_TYPES_ALLOWED -// [ VT_UNKNOWN ] Indicates the subset of content types that can be created in this folder directly (i.e. children may have different restrictions). -DEFINE_PROPERTYKEY( WPD_FOLDER_CONTENT_TYPES_ALLOWED , 0x7E9A7ABF, 0xE568, 0x4B34, 0xAA, 0x2F, 0x13, 0xBB, 0x12, 0xAB, 0x17, 0x7D , 2 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_IMAGE_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all image objects. -****************************************************************************/ -DEFINE_GUID( WPD_IMAGE_OBJECT_PROPERTIES_V1 , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB ); - -// -// WPD_IMAGE_BITDEPTH -// [ VT_UI4 ] Indicates the bitdepth of an image -DEFINE_PROPERTYKEY( WPD_IMAGE_BITDEPTH , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 3 ); -// -// WPD_IMAGE_CROPPED_STATUS -// [ VT_UI4 ] Signals whether the file has been cropped. -DEFINE_PROPERTYKEY( WPD_IMAGE_CROPPED_STATUS , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 4 ); -// -// WPD_IMAGE_COLOR_CORRECTED_STATUS -// [ VT_UI4 ] Signals whether the file has been color corrected. -DEFINE_PROPERTYKEY( WPD_IMAGE_COLOR_CORRECTED_STATUS , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 5 ); -// -// WPD_IMAGE_FNUMBER -// [ VT_UI4 ] Identifies the aperture setting of the lens when this image was captured. -DEFINE_PROPERTYKEY( WPD_IMAGE_FNUMBER , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 6 ); -// -// WPD_IMAGE_EXPOSURE_TIME -// [ VT_UI4 ] Identifies the shutter speed of the device when this image was captured. -DEFINE_PROPERTYKEY( WPD_IMAGE_EXPOSURE_TIME , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 7 ); -// -// WPD_IMAGE_EXPOSURE_INDEX -// [ VT_UI4 ] Identifies the emulation of film speed settings when this image was captured. -DEFINE_PROPERTYKEY( WPD_IMAGE_EXPOSURE_INDEX , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 8 ); -// -// WPD_IMAGE_HORIZONTAL_RESOLUTION -// [ VT_R8 ] Indicates the horizontal resolution (DPI) of an image -DEFINE_PROPERTYKEY( WPD_IMAGE_HORIZONTAL_RESOLUTION , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 9 ); -// -// WPD_IMAGE_VERTICAL_RESOLUTION -// [ VT_R8 ] Indicates the vertical resolution (DPI) of an image -DEFINE_PROPERTYKEY( WPD_IMAGE_VERTICAL_RESOLUTION , 0x63D64908, 0x9FA1, 0x479F, 0x85, 0xBA, 0x99, 0x52, 0x21, 0x64, 0x47, 0xDB , 10 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_DOCUMENT_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all document objects. -****************************************************************************/ -DEFINE_GUID( WPD_DOCUMENT_OBJECT_PROPERTIES_V1 , 0x0B110203, 0xEB95, 0x4F02, 0x93, 0xE0, 0x97, 0xC6, 0x31, 0x49, 0x3A, 0xD5 ); - - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_MEDIA_PROPERTIES_V1 -* -* This category is for properties common to media objects (e.g. audio and video). -****************************************************************************/ -DEFINE_GUID( WPD_MEDIA_PROPERTIES_V1 , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 ); - -// -// WPD_MEDIA_TOTAL_BITRATE -// [ VT_UI4 ] The total number of bits that one second will consume. -DEFINE_PROPERTYKEY( WPD_MEDIA_TOTAL_BITRATE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 2 ); -// -// WPD_MEDIA_BITRATE_TYPE -// [ VT_UI4 ] Further qualifies the bitrate of audio or video data. -DEFINE_PROPERTYKEY( WPD_MEDIA_BITRATE_TYPE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 3 ); -// -// WPD_MEDIA_COPYRIGHT -// [ VT_LPWSTR ] Indicates the copyright information. -DEFINE_PROPERTYKEY( WPD_MEDIA_COPYRIGHT , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 4 ); -// -// WPD_MEDIA_SUBSCRIPTION_CONTENT_ID -// [ VT_LPWSTR ] Provides additional information to identify a piece of content relative to an online subscription service. -DEFINE_PROPERTYKEY( WPD_MEDIA_SUBSCRIPTION_CONTENT_ID , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 5 ); -// -// WPD_MEDIA_USE_COUNT -// [ VT_UI4 ] Indicates the total number of times this media has been played or viewed on the device. -DEFINE_PROPERTYKEY( WPD_MEDIA_USE_COUNT , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 6 ); -// -// WPD_MEDIA_SKIP_COUNT -// [ VT_UI4 ] Indicates the total number of times this media was setup to be played or viewed but was manually skipped by the user. -DEFINE_PROPERTYKEY( WPD_MEDIA_SKIP_COUNT , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 7 ); -// -// WPD_MEDIA_LAST_ACCESSED_TIME -// [ VT_DATE ] Indicates the date and time the media was last accessed on the device. -DEFINE_PROPERTYKEY( WPD_MEDIA_LAST_ACCESSED_TIME , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 8 ); -// -// WPD_MEDIA_PARENTAL_RATING -// [ VT_LPWSTR ] Indicates the parental rating of the media file. -DEFINE_PROPERTYKEY( WPD_MEDIA_PARENTAL_RATING , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 9 ); -// -// WPD_MEDIA_META_GENRE -// [ VT_UI4 ] Further qualifies a piece of media in a contextual way. -DEFINE_PROPERTYKEY( WPD_MEDIA_META_GENRE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 10 ); -// -// WPD_MEDIA_COMPOSER -// [ VT_LPWSTR ] Identifies the composer when the composer is not the artist who performed it. -DEFINE_PROPERTYKEY( WPD_MEDIA_COMPOSER , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 11 ); -// -// WPD_MEDIA_EFFECTIVE_RATING -// [ VT_UI4 ] Contains an assigned rating for media not set by the user, but is generated based upon usage statistics. -DEFINE_PROPERTYKEY( WPD_MEDIA_EFFECTIVE_RATING , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 12 ); -// -// WPD_MEDIA_SUB_TITLE -// [ VT_LPWSTR ] Further qualifies the title when the title is ambiguous or general. -DEFINE_PROPERTYKEY( WPD_MEDIA_SUB_TITLE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 13 ); -// -// WPD_MEDIA_RELEASE_DATE -// [ VT_DATE ] Indicates when the media was released. -DEFINE_PROPERTYKEY( WPD_MEDIA_RELEASE_DATE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 14 ); -// -// WPD_MEDIA_SAMPLE_RATE -// [ VT_UI4 ] Indicates the number of times media selection was sampled per second during encoding. -DEFINE_PROPERTYKEY( WPD_MEDIA_SAMPLE_RATE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 15 ); -// -// WPD_MEDIA_STAR_RATING -// [ VT_UI4 ] Indicates the star rating for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_STAR_RATING , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 16 ); -// -// WPD_MEDIA_USER_EFFECTIVE_RATING -// [ VT_UI4 ] Indicates the rating for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_USER_EFFECTIVE_RATING , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 17 ); -// -// WPD_MEDIA_TITLE -// [ VT_LPWSTR ] Indicates the title of this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_TITLE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 18 ); -// -// WPD_MEDIA_DURATION -// [ VT_UI8 ] Indicates the duration of this media in milliseconds. -DEFINE_PROPERTYKEY( WPD_MEDIA_DURATION , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 19 ); -// -// WPD_MEDIA_BUY_NOW -// [ VT_BOOL ] TBD -DEFINE_PROPERTYKEY( WPD_MEDIA_BUY_NOW , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 20 ); -// -// WPD_MEDIA_ENCODING_PROFILE -// [ VT_LPWSTR ] Media codecs may be encoded in accordance with a profile, which defines a particular encoding algorithm or optimization process. -DEFINE_PROPERTYKEY( WPD_MEDIA_ENCODING_PROFILE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 21 ); -// -// WPD_MEDIA_WIDTH -// [ VT_UI4 ] Indicates the width of an object in pixels -DEFINE_PROPERTYKEY( WPD_MEDIA_WIDTH , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 22 ); -// -// WPD_MEDIA_HEIGHT -// [ VT_UI4 ] Indicates the height of an object in pixels -DEFINE_PROPERTYKEY( WPD_MEDIA_HEIGHT , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 23 ); -// -// WPD_MEDIA_ARTIST -// [ VT_LPWSTR ] Indicates the artist for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_ARTIST , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 24 ); -// -// WPD_MEDIA_ALBUM_ARTIST -// [ VT_LPWSTR ] Indicates the artist of the entire album rather than for a particular track. -DEFINE_PROPERTYKEY( WPD_MEDIA_ALBUM_ARTIST , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 25 ); -// -// WPD_MEDIA_OWNER -// [ VT_LPWSTR ] Indicates the e-mail address of the owner for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_OWNER , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 26 ); -// -// WPD_MEDIA_MANAGING_EDITOR -// [ VT_LPWSTR ] Indicates the e-mail address of the managing editor for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_MANAGING_EDITOR , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 27 ); -// -// WPD_MEDIA_WEBMASTER -// [ VT_LPWSTR ] Indicates the e-mail address of the Webmaster for this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_WEBMASTER , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 28 ); -// -// WPD_MEDIA_SOURCE_URL -// [ VT_LPWSTR ] Identifies the source URL for this object. -DEFINE_PROPERTYKEY( WPD_MEDIA_SOURCE_URL , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 29 ); -// -// WPD_MEDIA_DESTINATION_URL -// [ VT_LPWSTR ] Identifies the URL that an object is linked to if a user clicks on it. -DEFINE_PROPERTYKEY( WPD_MEDIA_DESTINATION_URL , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 30 ); -// -// WPD_MEDIA_DESCRIPTION -// [ VT_LPWSTR ] Contains a description of the media content for this object. -DEFINE_PROPERTYKEY( WPD_MEDIA_DESCRIPTION , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 31 ); -// -// WPD_MEDIA_GENRE -// [ VT_LPWSTR ] A text field indicating the genre this media belongs to. -DEFINE_PROPERTYKEY( WPD_MEDIA_GENRE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 32 ); -// -// WPD_MEDIA_TIME_BOOKMARK -// [ VT_UI8 ] Indicates a bookmark (in milliseconds) of the last position played or viewed on media that have duration. -DEFINE_PROPERTYKEY( WPD_MEDIA_TIME_BOOKMARK , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 33 ); -// -// WPD_MEDIA_OBJECT_BOOKMARK -// [ VT_LPWSTR ] Indicates a WPD_OBJECT_ID of the last object viewed or played for those objects that refer to a list of objects (such as playlists or media casts). -DEFINE_PROPERTYKEY( WPD_MEDIA_OBJECT_BOOKMARK , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 34 ); -// -// WPD_MEDIA_LAST_BUILD_DATE -// [ VT_DATE ] Indicates the last time a series in a media cast was changed or edited. -DEFINE_PROPERTYKEY( WPD_MEDIA_LAST_BUILD_DATE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 35 ); -// -// WPD_MEDIA_BYTE_BOOKMARK -// [ VT_UI8 ] Indicates a bookmark (as a zero-based byte offset) of the last position played or viewed on this media object. -DEFINE_PROPERTYKEY( WPD_MEDIA_BYTE_BOOKMARK , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 36 ); -// -// WPD_MEDIA_TIME_TO_LIVE -// [ VT_UI8 ] It is the number of minutes that indicates how long a channel can be cached before refreshing from the source. Applies to WPD_CONTENT_TYPE_MEDIA_CAST objects. -DEFINE_PROPERTYKEY( WPD_MEDIA_TIME_TO_LIVE , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 37 ); -// -// WPD_MEDIA_GUID -// [ VT_LPWSTR ] A text field indicating the GUID of this media. -DEFINE_PROPERTYKEY( WPD_MEDIA_GUID , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 38 ); -// -// WPD_MEDIA_SUB_DESCRIPTION -// [ VT_LPWSTR ] Contains a sub description of the media content for this object. -DEFINE_PROPERTYKEY( WPD_MEDIA_SUB_DESCRIPTION , 0x2ED8BA05, 0x0AD3, 0x42DC, 0xB0, 0xD0, 0xBC, 0x95, 0xAC, 0x39, 0x6A, 0xC8 , 39 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CONTACT_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all contact objects. -****************************************************************************/ -DEFINE_GUID( WPD_CONTACT_OBJECT_PROPERTIES_V1 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B ); - -// -// WPD_CONTACT_DISPLAY_NAME -// [ VT_LPWSTR ] Indicates the display name of the contact (e.g "John Doe") -DEFINE_PROPERTYKEY( WPD_CONTACT_DISPLAY_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 2 ); -// -// WPD_CONTACT_FIRST_NAME -// [ VT_LPWSTR ] Indicates the first name of the contact (e.g. "John") -DEFINE_PROPERTYKEY( WPD_CONTACT_FIRST_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 3 ); -// -// WPD_CONTACT_MIDDLE_NAMES -// [ VT_LPWSTR ] Indicates the middle name of the contact -DEFINE_PROPERTYKEY( WPD_CONTACT_MIDDLE_NAMES , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 4 ); -// -// WPD_CONTACT_LAST_NAME -// [ VT_LPWSTR ] Indicates the last name of the contact (e.g. "Doe") -DEFINE_PROPERTYKEY( WPD_CONTACT_LAST_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 5 ); -// -// WPD_CONTACT_PREFIX -// [ VT_LPWSTR ] Indicates the prefix of the name of the contact (e.g. "Mr.") -DEFINE_PROPERTYKEY( WPD_CONTACT_PREFIX , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 6 ); -// -// WPD_CONTACT_SUFFIX -// [ VT_LPWSTR ] Indicates the suffix of the name of the contact (e.g. "Jr.") -DEFINE_PROPERTYKEY( WPD_CONTACT_SUFFIX , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 7 ); -// -// WPD_CONTACT_PHONETIC_FIRST_NAME -// [ VT_LPWSTR ] The phonetic guide for pronouncing the contact's first name. -DEFINE_PROPERTYKEY( WPD_CONTACT_PHONETIC_FIRST_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 8 ); -// -// WPD_CONTACT_PHONETIC_LAST_NAME -// [ VT_LPWSTR ] The phonetic guide for pronouncing the contact's last name. -DEFINE_PROPERTYKEY( WPD_CONTACT_PHONETIC_LAST_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 9 ); -// -// WPD_CONTACT_PERSONAL_FULL_POSTAL_ADDRESS -// [ VT_LPWSTR ] Indicates the full postal address of the contact (e.g. "555 Dial Drive, PhoneLand, WA 12345") -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_FULL_POSTAL_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 10 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_LINE1 -// [ VT_LPWSTR ] Indicates the first line of a postal address of the contact (e.g. "555 Dial Drive") -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_LINE1 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 11 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_LINE2 -// [ VT_LPWSTR ] Indicates the second line of a postal address of the contact -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_LINE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 12 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_CITY -// [ VT_LPWSTR ] Indicates the city of a postal address of the contact (e.g. "PhoneLand") -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_CITY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 13 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_REGION -// [ VT_LPWSTR ] Indicates the region of a postal address of the contact -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_REGION , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 14 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_POSTAL_CODE -// [ VT_LPWSTR ] Indicates the postal code of the address. -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_POSTAL_CODE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 15 ); -// -// WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_COUNTRY -// [ VT_LPWSTR ] -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_POSTAL_ADDRESS_COUNTRY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 16 ); -// -// WPD_CONTACT_BUSINESS_FULL_POSTAL_ADDRESS -// [ VT_LPWSTR ] Indicates the full postal address of the contact (e.g. "555 Dial Drive, PhoneLand, WA 12345") -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_FULL_POSTAL_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 17 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_LINE1 -// [ VT_LPWSTR ] Indicates the first line of a postal address of the contact (e.g. "555 Dial Drive") -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_LINE1 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 18 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_LINE2 -// [ VT_LPWSTR ] Indicates the second line of a postal address of the contact -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_LINE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 19 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_CITY -// [ VT_LPWSTR ] Indicates the city of a postal address of the contact (e.g. "PhoneLand") -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_CITY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 20 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_REGION -// [ VT_LPWSTR ] Indicates the region of a postal address of the contact -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_REGION , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 21 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_POSTAL_CODE -// [ VT_LPWSTR ] Indicates the postal code of the address. -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_POSTAL_CODE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 22 ); -// -// WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_COUNTRY -// [ VT_LPWSTR ] -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_POSTAL_ADDRESS_COUNTRY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 23 ); -// -// WPD_CONTACT_OTHER_FULL_POSTAL_ADDRESS -// [ VT_LPWSTR ] Indicates the full postal address of the contact (e.g. "555 Dial Drive, PhoneLand, WA 12345"). -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_FULL_POSTAL_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 24 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_LINE1 -// [ VT_LPWSTR ] Indicates the first line of a postal address of the contact (e.g. "555 Dial Drive"). -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_LINE1 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 25 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_LINE2 -// [ VT_LPWSTR ] Indicates the second line of a postal address of the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_LINE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 26 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_CITY -// [ VT_LPWSTR ] Indicates the city of a postal address of the contact (e.g. "PhoneLand"). -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_CITY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 27 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_REGION -// [ VT_LPWSTR ] Indicates the region of a postal address of the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_REGION , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 28 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_POSTAL_CODE -// [ VT_LPWSTR ] Indicates the postal code of the address. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_POSTAL_CODE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 29 ); -// -// WPD_CONTACT_OTHER_POSTAL_ADDRESS_POSTAL_COUNTRY -// [ VT_LPWSTR ] Indicates the country of the postal address. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_POSTAL_ADDRESS_POSTAL_COUNTRY , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 30 ); -// -// WPD_CONTACT_PRIMARY_EMAIL_ADDRESS -// [ VT_LPWSTR ] Indicates the primary email address for the contact e.g. "someone@example.com" -DEFINE_PROPERTYKEY( WPD_CONTACT_PRIMARY_EMAIL_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 31 ); -// -// WPD_CONTACT_PERSONAL_EMAIL -// [ VT_LPWSTR ] Indicates the personal email address for the contact e.g. "someone@example.com" -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_EMAIL , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 32 ); -// -// WPD_CONTACT_PERSONAL_EMAIL2 -// [ VT_LPWSTR ] Indicates an alternate personal email address for the contact e.g. "someone@example.com" -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_EMAIL2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 33 ); -// -// WPD_CONTACT_BUSINESS_EMAIL -// [ VT_LPWSTR ] Indicates the business email address for the contact e.g. "someone@example.com" -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_EMAIL , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 34 ); -// -// WPD_CONTACT_BUSINESS_EMAIL2 -// [ VT_LPWSTR ] Indicates an alternate business email address for the contact e.g. "someone@example.com" -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_EMAIL2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 35 ); -// -// WPD_CONTACT_OTHER_EMAILS -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of type VT_LPWSTR, where each element is an alternate email addresses for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_EMAILS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 36 ); -// -// WPD_CONTACT_PRIMARY_PHONE -// [ VT_LPWSTR ] Indicates the primary phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PRIMARY_PHONE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 37 ); -// -// WPD_CONTACT_PERSONAL_PHONE -// [ VT_LPWSTR ] Indicates the personal phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_PHONE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 38 ); -// -// WPD_CONTACT_PERSONAL_PHONE2 -// [ VT_LPWSTR ] Indicates an alternate personal phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_PHONE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 39 ); -// -// WPD_CONTACT_BUSINESS_PHONE -// [ VT_LPWSTR ] Indicates the business phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_PHONE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 40 ); -// -// WPD_CONTACT_BUSINESS_PHONE2 -// [ VT_LPWSTR ] Indicates an alternate business phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_PHONE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 41 ); -// -// WPD_CONTACT_MOBILE_PHONE -// [ VT_LPWSTR ] Indicates the mobile phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_MOBILE_PHONE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 42 ); -// -// WPD_CONTACT_MOBILE_PHONE2 -// [ VT_LPWSTR ] Indicates an alternate mobile phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_MOBILE_PHONE2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 43 ); -// -// WPD_CONTACT_PERSONAL_FAX -// [ VT_LPWSTR ] Indicates the personal fax number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_FAX , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 44 ); -// -// WPD_CONTACT_BUSINESS_FAX -// [ VT_LPWSTR ] Indicates the business fax number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_FAX , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 45 ); -// -// WPD_CONTACT_PAGER -// [ VT_LPWSTR ] Indicates the pager number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PAGER , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 46 ); -// -// WPD_CONTACT_OTHER_PHONES -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of type VT_LPWSTR, where each element is an alternate phone number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_OTHER_PHONES , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 47 ); -// -// WPD_CONTACT_PRIMARY_WEB_ADDRESS -// [ VT_LPWSTR ] Indicates the primary web address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PRIMARY_WEB_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 48 ); -// -// WPD_CONTACT_PERSONAL_WEB_ADDRESS -// [ VT_LPWSTR ] Indicates the personal web address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PERSONAL_WEB_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 49 ); -// -// WPD_CONTACT_BUSINESS_WEB_ADDRESS -// [ VT_LPWSTR ] Indicates the business web address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_BUSINESS_WEB_ADDRESS , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 50 ); -// -// WPD_CONTACT_INSTANT_MESSENGER -// [ VT_LPWSTR ] Indicates the instant messenger address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_INSTANT_MESSENGER , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 51 ); -// -// WPD_CONTACT_INSTANT_MESSENGER2 -// [ VT_LPWSTR ] Indicates an alternate instant messenger address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_INSTANT_MESSENGER2 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 52 ); -// -// WPD_CONTACT_INSTANT_MESSENGER3 -// [ VT_LPWSTR ] Indicates an alternate instant messenger address for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_INSTANT_MESSENGER3 , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 53 ); -// -// WPD_CONTACT_COMPANY_NAME -// [ VT_LPWSTR ] Indicates the company name for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_COMPANY_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 54 ); -// -// WPD_CONTACT_PHONETIC_COMPANY_NAME -// [ VT_LPWSTR ] The phonetic guide for pronouncing the contact's company name. -DEFINE_PROPERTYKEY( WPD_CONTACT_PHONETIC_COMPANY_NAME , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 55 ); -// -// WPD_CONTACT_ROLE -// [ VT_LPWSTR ] Indicates the role for the contact e.g. "Software Engineer". -DEFINE_PROPERTYKEY( WPD_CONTACT_ROLE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 56 ); -// -// WPD_CONTACT_BIRTHDATE -// [ VT_DATE ] Indicates the birthdate for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_BIRTHDATE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 57 ); -// -// WPD_CONTACT_PRIMARY_FAX -// [ VT_LPWSTR ] Indicates the primary fax number for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_PRIMARY_FAX , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 58 ); -// -// WPD_CONTACT_SPOUSE -// [ VT_LPWSTR ] Indicates the full name of the spouse/domestic partner for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_SPOUSE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 59 ); -// -// WPD_CONTACT_CHILDREN -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of type VT_LPWSTR, where each element is the full name of a child of the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_CHILDREN , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 60 ); -// -// WPD_CONTACT_ASSISTANT -// [ VT_LPWSTR ] Indicates the full name of the assistant for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_ASSISTANT , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 61 ); -// -// WPD_CONTACT_ANNIVERSARY_DATE -// [ VT_DATE ] Indicates the anniversary date for the contact. -DEFINE_PROPERTYKEY( WPD_CONTACT_ANNIVERSARY_DATE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 62 ); -// -// WPD_CONTACT_RINGTONE -// [ VT_LPWSTR ] Indicates an object id of a ringtone file on the device. -DEFINE_PROPERTYKEY( WPD_CONTACT_RINGTONE , 0xFBD4FDAB, 0x987D, 0x4777, 0xB3, 0xF9, 0x72, 0x61, 0x85, 0xA9, 0x31, 0x2B , 63 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_MUSIC_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all music objects. -****************************************************************************/ -DEFINE_GUID( WPD_MUSIC_OBJECT_PROPERTIES_V1 , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 ); - -// -// WPD_MUSIC_ALBUM -// [ VT_LPWSTR ] Indicates the album of the music file. -DEFINE_PROPERTYKEY( WPD_MUSIC_ALBUM , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 3 ); -// -// WPD_MUSIC_TRACK -// [ VT_UI4 ] Indicates the track number for the music file. -DEFINE_PROPERTYKEY( WPD_MUSIC_TRACK , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 4 ); -// -// WPD_MUSIC_LYRICS -// [ VT_LPWSTR ] Indicates the lyrics for the music file. -DEFINE_PROPERTYKEY( WPD_MUSIC_LYRICS , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 6 ); -// -// WPD_MUSIC_MOOD -// [ VT_LPWSTR ] Indicates the mood for the music file. -DEFINE_PROPERTYKEY( WPD_MUSIC_MOOD , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 8 ); -// -// WPD_AUDIO_BITRATE -// [ VT_UI4 ] Indicates the bit rate for the audio data, specified in bits per second. -DEFINE_PROPERTYKEY( WPD_AUDIO_BITRATE , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 9 ); -// -// WPD_AUDIO_CHANNEL_COUNT -// [ VT_R4 ] Indicates the number of channels in this audio file e.g. 1, 2, 5.1 etc. -DEFINE_PROPERTYKEY( WPD_AUDIO_CHANNEL_COUNT , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 10 ); -// -// WPD_AUDIO_FORMAT_CODE -// [ VT_UI4 ] Indicates the registered WAVE format code. -DEFINE_PROPERTYKEY( WPD_AUDIO_FORMAT_CODE , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 11 ); -// -// WPD_AUDIO_BIT_DEPTH -// [ VT_UI4 ] This property identifies the bit-depth of the audio. -DEFINE_PROPERTYKEY( WPD_AUDIO_BIT_DEPTH , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 12 ); -// -// WPD_AUDIO_BLOCK_ALIGNMENT -// [ VT_UI4 ] This property identifies the audio block alignment -DEFINE_PROPERTYKEY( WPD_AUDIO_BLOCK_ALIGNMENT , 0xB324F56A, 0xDC5D, 0x46E5, 0xB6, 0xDF, 0xD2, 0xEA, 0x41, 0x48, 0x88, 0xC6 , 13 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_VIDEO_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all video objects. -****************************************************************************/ -DEFINE_GUID( WPD_VIDEO_OBJECT_PROPERTIES_V1 , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A ); - -// -// WPD_VIDEO_AUTHOR -// [ VT_LPWSTR ] Indicates the author of the video file. -DEFINE_PROPERTYKEY( WPD_VIDEO_AUTHOR , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 2 ); -// -// WPD_VIDEO_RECORDEDTV_STATION_NAME -// [ VT_LPWSTR ] Indicates the TV station the video was recorded from. -DEFINE_PROPERTYKEY( WPD_VIDEO_RECORDEDTV_STATION_NAME , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 4 ); -// -// WPD_VIDEO_RECORDEDTV_CHANNEL_NUMBER -// [ VT_UI4 ] Indicates the TV channel number the video was recorded from. -DEFINE_PROPERTYKEY( WPD_VIDEO_RECORDEDTV_CHANNEL_NUMBER , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 5 ); -// -// WPD_VIDEO_RECORDEDTV_REPEAT -// [ VT_BOOL ] Indicates whether the recorded TV program was a repeat showing. -DEFINE_PROPERTYKEY( WPD_VIDEO_RECORDEDTV_REPEAT , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 7 ); -// -// WPD_VIDEO_BUFFER_SIZE -// [ VT_UI4 ] Indicates the video buffer size. -DEFINE_PROPERTYKEY( WPD_VIDEO_BUFFER_SIZE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 8 ); -// -// WPD_VIDEO_CREDITS -// [ VT_LPWSTR ] Indicates the credit text for the video file. -DEFINE_PROPERTYKEY( WPD_VIDEO_CREDITS , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 9 ); -// -// WPD_VIDEO_KEY_FRAME_DISTANCE -// [ VT_UI4 ] Indicates the interval between key frames in milliseconds. -DEFINE_PROPERTYKEY( WPD_VIDEO_KEY_FRAME_DISTANCE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 10 ); -// -// WPD_VIDEO_QUALITY_SETTING -// [ VT_UI4 ] Indicates the quality setting for the video file. -DEFINE_PROPERTYKEY( WPD_VIDEO_QUALITY_SETTING , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 11 ); -// -// WPD_VIDEO_SCAN_TYPE -// [ VT_UI4 ] This property identifies the video scan information. -DEFINE_PROPERTYKEY( WPD_VIDEO_SCAN_TYPE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 12 ); -// -// WPD_VIDEO_BITRATE -// [ VT_UI4 ] Indicates the bitrate for the video data. -DEFINE_PROPERTYKEY( WPD_VIDEO_BITRATE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 13 ); -// -// WPD_VIDEO_FOURCC_CODE -// [ VT_UI4 ] The registered FourCC code indicating the codec used for the video file. -DEFINE_PROPERTYKEY( WPD_VIDEO_FOURCC_CODE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 14 ); -// -// WPD_VIDEO_FRAMERATE -// [ VT_UI4 ] Indicates the frame rate for the video data. -DEFINE_PROPERTYKEY( WPD_VIDEO_FRAMERATE , 0x346F2163, 0xF998, 0x4146, 0x8B, 0x01, 0xD1, 0x9B, 0x4C, 0x00, 0xDE, 0x9A , 15 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_COMMON_INFORMATION_OBJECT_PROPERTIES_V1 -* -* This category is properties that pertain to informational objects such as appointments, tasks, memos and even documents. -****************************************************************************/ -DEFINE_GUID( WPD_COMMON_INFORMATION_OBJECT_PROPERTIES_V1 , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F ); - -// -// WPD_COMMON_INFORMATION_SUBJECT -// [ VT_LPWSTR ] Indicates the subject field of this object. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_SUBJECT , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 2 ); -// -// WPD_COMMON_INFORMATION_BODY_TEXT -// [ VT_LPWSTR ] This property contains the body text of an object, in plaintext or HTML format. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_BODY_TEXT , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 3 ); -// -// WPD_COMMON_INFORMATION_PRIORITY -// [ VT_UI4 ] Indicates the priority of this object. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_PRIORITY , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 4 ); -// -// WPD_COMMON_INFORMATION_START_DATETIME -// [ VT_DATE ] For appointments, tasks and similar objects, this indicates the date/time that this item is scheduled to start. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_START_DATETIME , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 5 ); -// -// WPD_COMMON_INFORMATION_END_DATETIME -// [ VT_DATE ] For appointments, tasks and similar objects, this indicates the date/time that this item is scheduled to end. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_END_DATETIME , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 6 ); -// -// WPD_COMMON_INFORMATION_NOTES -// [ VT_LPWSTR ] For appointments, tasks and similar objects, this indicates any notes for this object. -DEFINE_PROPERTYKEY( WPD_COMMON_INFORMATION_NOTES , 0xB28AE94B, 0x05A4, 0x4E8E, 0xBE, 0x01, 0x72, 0xCC, 0x7E, 0x09, 0x9D, 0x8F , 7); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_MEMO_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all memo objects. -****************************************************************************/ -DEFINE_GUID( WPD_MEMO_OBJECT_PROPERTIES_V1 , 0x5FFBFC7B, 0x7483, 0x41AD, 0xAF, 0xB9, 0xDA, 0x3F, 0x4E, 0x59, 0x2B, 0x8D ); - - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_EMAIL_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all email objects. -****************************************************************************/ -DEFINE_GUID( WPD_EMAIL_OBJECT_PROPERTIES_V1 , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 ); - -// -// WPD_EMAIL_TO_LINE -// [ VT_LPWSTR ] Indicates the normal recipients for the message. -DEFINE_PROPERTYKEY( WPD_EMAIL_TO_LINE , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 2 ); -// -// WPD_EMAIL_CC_LINE -// [ VT_LPWSTR ] Indicates the copied recipients for the message. -DEFINE_PROPERTYKEY( WPD_EMAIL_CC_LINE , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 3 ); -// -// WPD_EMAIL_BCC_LINE -// [ VT_LPWSTR ] Indicates the recipients for the message who receive a "blind copy". -DEFINE_PROPERTYKEY( WPD_EMAIL_BCC_LINE , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 4 ); -// -// WPD_EMAIL_HAS_BEEN_READ -// [ VT_BOOL ] Indicates whether the user has read this message. -DEFINE_PROPERTYKEY( WPD_EMAIL_HAS_BEEN_READ , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 7 ); -// -// WPD_EMAIL_RECEIVED_TIME -// [ VT_DATE ] Indicates at what time the message was received. -DEFINE_PROPERTYKEY( WPD_EMAIL_RECEIVED_TIME , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 8 ); -// -// WPD_EMAIL_HAS_ATTACHMENTS -// [ VT_BOOL ] Indicates whether this message has attachments. -DEFINE_PROPERTYKEY( WPD_EMAIL_HAS_ATTACHMENTS , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 9 ); -// -// WPD_EMAIL_SENDER_ADDRESS -// [ VT_LPWSTR ] Indicates who sent the message. -DEFINE_PROPERTYKEY( WPD_EMAIL_SENDER_ADDRESS , 0x41F8F65A, 0x5484, 0x4782, 0xB1, 0x3D, 0x47, 0x40, 0xDD, 0x7C, 0x37, 0xC5 , 10 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_APPOINTMENT_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all appointment objects. -****************************************************************************/ -DEFINE_GUID( WPD_APPOINTMENT_OBJECT_PROPERTIES_V1 , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 ); - -// -// WPD_APPOINTMENT_LOCATION -// [ VT_LPWSTR ] Indicates the location of the appointment e.g. "Building 5, Conf. room 7". -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_LOCATION , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 3 ); -// -// WPD_APPOINTMENT_TYPE -// [ VT_LPWSTR ] Indicates the type of appointment e.g. "Personal", "Business" etc. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_TYPE , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 7 ); -// -// WPD_APPOINTMENT_REQUIRED_ATTENDEES -// [ VT_LPWSTR ] Semi-colon separated list of required attendees. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_REQUIRED_ATTENDEES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 8 ); -// -// WPD_APPOINTMENT_OPTIONAL_ATTENDEES -// [ VT_LPWSTR ] Semi-colon separated list of optional attendees. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_OPTIONAL_ATTENDEES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 9 ); -// -// WPD_APPOINTMENT_ACCEPTED_ATTENDEES -// [ VT_LPWSTR ] Semi-colon separated list of attendees who have accepted the appointment. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_ACCEPTED_ATTENDEES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 10 ); -// -// WPD_APPOINTMENT_RESOURCES -// [ VT_LPWSTR ] Semi-colon separated list of resources needed for the appointment. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_RESOURCES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 11 ); -// -// WPD_APPOINTMENT_TENTATIVE_ATTENDEES -// [ VT_LPWSTR ] Semi-colon separated list of attendees who have tentatively accepted the appointment. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_TENTATIVE_ATTENDEES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 12 ); -// -// WPD_APPOINTMENT_DECLINED_ATTENDEES -// [ VT_LPWSTR ] Semi-colon separated list of attendees who have declined the appointment. -DEFINE_PROPERTYKEY( WPD_APPOINTMENT_DECLINED_ATTENDEES , 0xF99EFD03, 0x431D, 0x40D8, 0xA1, 0xC9, 0x4E, 0x22, 0x0D, 0x9C, 0x88, 0xD3 , 13 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_TASK_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all task objects. -****************************************************************************/ -DEFINE_GUID( WPD_TASK_OBJECT_PROPERTIES_V1 , 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7 ); - -// -// WPD_TASK_STATUS -// [ VT_LPWSTR ] Indicates the status of the task e.g. "In Progress". -DEFINE_PROPERTYKEY( WPD_TASK_STATUS , 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7 , 6 ); -// -// WPD_TASK_PERCENT_COMPLETE -// [ VT_UI4 ] Indicates how much of the task has been completed. -DEFINE_PROPERTYKEY( WPD_TASK_PERCENT_COMPLETE , 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7 , 8 ); -// -// WPD_TASK_REMINDER_DATE -// [ VT_DATE ] Indicates the date and time set for the reminder. If this value is 0, then it is assumed that this task has no reminder. -DEFINE_PROPERTYKEY( WPD_TASK_REMINDER_DATE , 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7 , 10 ); -// -// WPD_TASK_OWNER -// [ VT_LPWSTR ] Indicates the owner of the task. -DEFINE_PROPERTYKEY( WPD_TASK_OWNER , 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7 , 11 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_NETWORK_ASSOCIATION_PROPERTIES_V1 -* -* This category is for properties common to all network association objects. -****************************************************************************/ -DEFINE_GUID( WPD_NETWORK_ASSOCIATION_PROPERTIES_V1 , 0xE4C93C1F, 0xB203, 0x43F1, 0xA1, 0x00, 0x5A, 0x07, 0xD1, 0x1B, 0x02, 0x74 ); - -// -// WPD_NETWORK_ASSOCIATION_HOST_NETWORK_IDENTIFIERS -// [ VT_VECTOR | VT_UI1 ] The list of EUI-64 host identifiers valid for this association. -DEFINE_PROPERTYKEY( WPD_NETWORK_ASSOCIATION_HOST_NETWORK_IDENTIFIERS , 0xE4C93C1F, 0xB203, 0x43F1, 0xA1, 0x00, 0x5A, 0x07, 0xD1, 0x1B, 0x02, 0x74 , 2 ); -// -// WPD_NETWORK_ASSOCIATION_X509V3SEQUENCE -// [ VT_VECTOR | VT_UI1 ] The sequence of X.509 v3 certificates to be provided for TLS server authentication. -DEFINE_PROPERTYKEY( WPD_NETWORK_ASSOCIATION_X509V3SEQUENCE , 0xE4C93C1F, 0xB203, 0x43F1, 0xA1, 0x00, 0x5A, 0x07, 0xD1, 0x1B, 0x02, 0x74 , 3 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_STILL_IMAGE_CAPTURE_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all objects whose functional category is WPD_FUNCTIONAL_CATEGORY_STILL_IMAGE_CAPTURE -****************************************************************************/ -DEFINE_GUID( WPD_STILL_IMAGE_CAPTURE_OBJECT_PROPERTIES_V1 , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 ); - -// -// WPD_STILL_IMAGE_CAPTURE_RESOLUTION -// [ VT_LPWSTR ] Controls the size of the image dimensions to capture in pixel width and height. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAPTURE_RESOLUTION , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 2 ); -// -// WPD_STILL_IMAGE_CAPTURE_FORMAT -// [ VT_CLSID ] Controls the format of the image to capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAPTURE_FORMAT , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 3 ); -// -// WPD_STILL_IMAGE_COMPRESSION_SETTING -// [ VT_UI8 ] Controls the device-specific quality setting. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_COMPRESSION_SETTING , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 4 ); -// -// WPD_STILL_IMAGE_WHITE_BALANCE -// [ VT_UI4 ] Controls how the device weights color channels. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_WHITE_BALANCE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 5 ); -// -// WPD_STILL_IMAGE_RGB_GAIN -// [ VT_LPWSTR ] Controls the RGB gain. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_RGB_GAIN , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 6 ); -// -// WPD_STILL_IMAGE_FNUMBER -// [ VT_UI4 ] Controls the aperture of the lens. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FNUMBER , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 7 ); -// -// WPD_STILL_IMAGE_FOCAL_LENGTH -// [ VT_UI4 ] Controls the 35mm equivalent focal length. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FOCAL_LENGTH , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 8 ); -// -// WPD_STILL_IMAGE_FOCUS_DISTANCE -// [ VT_UI4 ] This property corresponds to the focus distance in millimeters -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FOCUS_DISTANCE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 9 ); -// -// WPD_STILL_IMAGE_FOCUS_MODE -// [ VT_UI4 ] Identifies the focusing mode used by the device for image capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FOCUS_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 10 ); -// -// WPD_STILL_IMAGE_EXPOSURE_METERING_MODE -// [ VT_UI4 ] Identifies the exposure metering mode used by the device for image capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EXPOSURE_METERING_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 11 ); -// -// WPD_STILL_IMAGE_FLASH_MODE -// [ VT_UI4 ] -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FLASH_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 12 ); -// -// WPD_STILL_IMAGE_EXPOSURE_TIME -// [ VT_UI4 ] Controls the shutter speed of the device. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EXPOSURE_TIME , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 13 ); -// -// WPD_STILL_IMAGE_EXPOSURE_PROGRAM_MODE -// [ VT_UI4 ] Controls the exposure program mode of the device. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EXPOSURE_PROGRAM_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 14 ); -// -// WPD_STILL_IMAGE_EXPOSURE_INDEX -// [ VT_UI4 ] Controls the emulation of film speed settings. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EXPOSURE_INDEX , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 15 ); -// -// WPD_STILL_IMAGE_EXPOSURE_BIAS_COMPENSATION -// [ VT_I4 ] Controls the adjustment of the auto exposure control. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EXPOSURE_BIAS_COMPENSATION , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 16 ); -// -// WPD_STILL_IMAGE_CAPTURE_DELAY -// [ VT_UI4 ] Controls the amount of time delay between the capture trigger and the actual data capture (in milliseconds). -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAPTURE_DELAY , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 17 ); -// -// WPD_STILL_IMAGE_CAPTURE_MODE -// [ VT_UI4 ] Controls the type of still image capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAPTURE_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 18 ); -// -// WPD_STILL_IMAGE_CONTRAST -// [ VT_UI4 ] Controls the perceived contrast of captured images. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CONTRAST , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 19 ); -// -// WPD_STILL_IMAGE_SHARPNESS -// [ VT_UI4 ] Controls the perceived sharpness of the captured image. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_SHARPNESS , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 20 ); -// -// WPD_STILL_IMAGE_DIGITAL_ZOOM -// [ VT_UI4 ] Controls the effective zoom ratio of a digital camera's acquired image scaled by a factor of 10. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_DIGITAL_ZOOM , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 21 ); -// -// WPD_STILL_IMAGE_EFFECT_MODE -// [ VT_UI4 ] Controls the special effect mode of the capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_EFFECT_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 22 ); -// -// WPD_STILL_IMAGE_BURST_NUMBER -// [ VT_UI4 ] Controls the number of images that the device will attempt to capture upon initiation of a burst operation. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_BURST_NUMBER , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 23 ); -// -// WPD_STILL_IMAGE_BURST_INTERVAL -// [ VT_UI4 ] Controls the time delay between captures upon initiation of a burst operation. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_BURST_INTERVAL , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 24 ); -// -// WPD_STILL_IMAGE_TIMELAPSE_NUMBER -// [ VT_UI4 ] Controls the number of images that the device will attempt to capture upon initiation of a time-lapse capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_TIMELAPSE_NUMBER , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 25 ); -// -// WPD_STILL_IMAGE_TIMELAPSE_INTERVAL -// [ VT_UI4 ] Controls the time delay between captures upon initiation of a time-lapse operation. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_TIMELAPSE_INTERVAL , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 26 ); -// -// WPD_STILL_IMAGE_FOCUS_METERING_MODE -// [ VT_UI4 ] Controls which automatic focus mechanism is used by the device. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_FOCUS_METERING_MODE , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 27 ); -// -// WPD_STILL_IMAGE_UPLOAD_URL -// [ VT_LPWSTR ] Used to describe the URL that the device may use to upload images upon capture. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_UPLOAD_URL , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 28 ); -// -// WPD_STILL_IMAGE_ARTIST -// [ VT_LPWSTR ] Contains the owner/user of the device, which may be inserted as meta-data into any images that are captured. -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_ARTIST , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 29 ); -// -// WPD_STILL_IMAGE_CAMERA_MODEL -// [ VT_LPWSTR ] Contains the model of the device -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAMERA_MODEL , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 30 ); -// -// WPD_STILL_IMAGE_CAMERA_MANUFACTURER -// [ VT_LPWSTR ] Contains the manufacturer of the device -DEFINE_PROPERTYKEY( WPD_STILL_IMAGE_CAMERA_MANUFACTURER , 0x58C571EC, 0x1BCB, 0x42A7, 0x8A, 0xC5, 0xBB, 0x29, 0x15, 0x73, 0xA2, 0x60 , 31 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_SMS_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all objects whose functional category is WPD_FUNCTIONAL_CATEGORY_SMS -****************************************************************************/ -DEFINE_GUID( WPD_SMS_OBJECT_PROPERTIES_V1 , 0x7E1074CC, 0x50FF, 0x4DD1, 0xA7, 0x42, 0x53, 0xBE, 0x6F, 0x09, 0x3A, 0x0D ); - -// -// WPD_SMS_PROVIDER -// [ VT_LPWSTR ] Indicates the service provider name. -DEFINE_PROPERTYKEY( WPD_SMS_PROVIDER , 0x7E1074CC, 0x50FF, 0x4DD1, 0xA7, 0x42, 0x53, 0xBE, 0x6F, 0x09, 0x3A, 0x0D , 2 ); -// -// WPD_SMS_TIMEOUT -// [ VT_UI4 ] Indicates the number of milliseconds until a timeout is returned. -DEFINE_PROPERTYKEY( WPD_SMS_TIMEOUT , 0x7E1074CC, 0x50FF, 0x4DD1, 0xA7, 0x42, 0x53, 0xBE, 0x6F, 0x09, 0x3A, 0x0D , 3 ); -// -// WPD_SMS_MAX_PAYLOAD -// [ VT_UI4 ] Indicates the maximum number of bytes that can be contained in a message. -DEFINE_PROPERTYKEY( WPD_SMS_MAX_PAYLOAD , 0x7E1074CC, 0x50FF, 0x4DD1, 0xA7, 0x42, 0x53, 0xBE, 0x6F, 0x09, 0x3A, 0x0D , 4 ); -// -// WPD_SMS_ENCODING -// [ VT_UI4 ] Indicates how the driver will encode the text message sent by the client. -DEFINE_PROPERTYKEY( WPD_SMS_ENCODING , 0x7E1074CC, 0x50FF, 0x4DD1, 0xA7, 0x42, 0x53, 0xBE, 0x6F, 0x09, 0x3A, 0x0D , 5 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_SECTION_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all objects whose content type is WPD_CONTENT_TYPE_SECTION -****************************************************************************/ -DEFINE_GUID( WPD_SECTION_OBJECT_PROPERTIES_V1 , 0x516AFD2B, 0xC64E, 0x44F0, 0x98, 0xDC, 0xBE, 0xE1, 0xC8, 0x8F, 0x7D, 0x66 ); - -// -// WPD_SECTION_DATA_OFFSET -// [ VT_UI8 ] Indicates the zero-based offset of the data for the referenced object. -DEFINE_PROPERTYKEY( WPD_SECTION_DATA_OFFSET , 0x516AFD2B, 0xC64E, 0x44F0, 0x98, 0xDC, 0xBE, 0xE1, 0xC8, 0x8F, 0x7D, 0x66 , 2 ); -// -// WPD_SECTION_DATA_LENGTH -// [ VT_UI8 ] Indicates the length of data for the referenced object. -DEFINE_PROPERTYKEY( WPD_SECTION_DATA_LENGTH , 0x516AFD2B, 0xC64E, 0x44F0, 0x98, 0xDC, 0xBE, 0xE1, 0xC8, 0x8F, 0x7D, 0x66 , 3 ); -// -// WPD_SECTION_DATA_UNITS -// [ VT_UI4 ] Indicates the units for WPD_SECTION_DATA_OFFSET and WPD_SECTION_DATA_LENGTH properties on this object (e.g. offset in bytes, offset in milliseconds etc.). -DEFINE_PROPERTYKEY( WPD_SECTION_DATA_UNITS , 0x516AFD2B, 0xC64E, 0x44F0, 0x98, 0xDC, 0xBE, 0xE1, 0xC8, 0x8F, 0x7D, 0x66 , 4 ); -// -// WPD_SECTION_DATA_REFERENCED_OBJECT_RESOURCE -// [ VT_UNKNOWN ] This is an IPortableDeviceKeyCollection containing a single value, which is the key identifying the resource on the referenced object which the WPD_SECTION_DATA_OFFSET and WPD_SECTION_DATA_LENGTH apply to. -DEFINE_PROPERTYKEY( WPD_SECTION_DATA_REFERENCED_OBJECT_RESOURCE , 0x516AFD2B, 0xC64E, 0x44F0, 0x98, 0xDC, 0xBE, 0xE1, 0xC8, 0x8F, 0x7D, 0x66 , 5 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_RENDERING_INFORMATION_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all objects whose functional category is WPD_FUNCTIONAL_CATEGORY_AUDIO_RENDERING_INFORMATION -****************************************************************************/ -DEFINE_GUID( WPD_RENDERING_INFORMATION_OBJECT_PROPERTIES_V1 , 0xC53D039F, 0xEE23, 0x4A31, 0x85, 0x90, 0x76, 0x39, 0x87, 0x98, 0x70, 0xB4 ); - -// -// WPD_RENDERING_INFORMATION_PROFILES -// [ VT_UNKNOWN ] IPortableDeviceValuesCollection, where each element indicates the property settings for a supported profile. -DEFINE_PROPERTYKEY( WPD_RENDERING_INFORMATION_PROFILES , 0xC53D039F, 0xEE23, 0x4A31, 0x85, 0x90, 0x76, 0x39, 0x87, 0x98, 0x70, 0xB4 , 2 ); -// -// WPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPE -// [ VT_UI4 ] Indicates whether a given entry (i.e. an IPortableDeviceValues) in WPD_RENDERING_INFORMATION_PROFILES relates to an Object or a Resource. -DEFINE_PROPERTYKEY( WPD_RENDERING_INFORMATION_PROFILE_ENTRY_TYPE , 0xC53D039F, 0xEE23, 0x4A31, 0x85, 0x90, 0x76, 0x39, 0x87, 0x98, 0x70, 0xB4 , 3 ); -// -// WPD_RENDERING_INFORMATION_PROFILE_ENTRY_CREATABLE_RESOURCES -// [ VT_UNKNOWN ] This is an IPortableDeviceKeyCollection identifying the resources that can be created on an object with this rendering profile. -DEFINE_PROPERTYKEY( WPD_RENDERING_INFORMATION_PROFILE_ENTRY_CREATABLE_RESOURCES , 0xC53D039F, 0xEE23, 0x4A31, 0x85, 0x90, 0x76, 0x39, 0x87, 0x98, 0x70, 0xB4 , 4 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_STORAGE -* -* This category is for commands and parameters for storage functional objects. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_STORAGE , 0xD8F907A6, 0x34CC, 0x45FA, 0x97, 0xFB, 0xD0, 0x07, 0xFA, 0x47, 0xEC, 0x94 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_STORAGE_FORMAT -// This command will format the storage. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_STORAGE_OBJECT_ID -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_STORAGE_FORMAT , 0xD8F907A6, 0x34CC, 0x45FA, 0x97, 0xFB, 0xD0, 0x07, 0xFA, 0x47, 0xEC, 0x94 , 2 ); -// -// WPD_COMMAND_STORAGE_EJECT -// This will eject the storage, if it is a removable store and is capable of being ejected by the device. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_STORAGE_OBJECT_ID -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_STORAGE_EJECT , 0xD8F907A6, 0x34CC, 0x45FA, 0x97, 0xFB, 0xD0, 0x07, 0xFA, 0x47, 0xEC, 0x94 , 4 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_STORAGE_OBJECT_ID -// [ VT_LPWSTR ] Indicates the object to format, move or eject. -DEFINE_PROPERTYKEY( WPD_PROPERTY_STORAGE_OBJECT_ID , 0xD8F907A6, 0x34CC, 0x45FA, 0x97, 0xFB, 0xD0, 0x07, 0xFA, 0x47, 0xEC, 0x94 , 1001 ); -// -// WPD_PROPERTY_STORAGE_DESTINATION_OBJECT_ID -// [ VT_LPWSTR ] Indicates the (folder) object destination for a move operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_STORAGE_DESTINATION_OBJECT_ID , 0xD8F907A6, 0x34CC, 0x45FA, 0x97, 0xFB, 0xD0, 0x07, 0xFA, 0x47, 0xEC, 0x94 , 1002 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_SMS -* -* The commands in this category relate to Short-Message-Service functionality, typically exposed on mobile phones. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_SMS , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_SMS_SEND -// This command is used to initiate the sending of an SMS message. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_COMMAND_TARGET -// [ Required ] WPD_PROPERTY_SMS_RECIPIENT -// [ Required ] WPD_PROPERTY_SMS_MESSAGE_TYPE -// [ Optional ] WPD_PROPERTY_SMS_TEXT_MESSAGE -// [ Optional ] WPD_PROPERTY_SMS_BINARY_MESSAGE -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_SMS_SEND , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 2 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_SMS_RECIPIENT -// [ VT_LPWSTR ] Indicates the recipient's address. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SMS_RECIPIENT , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 1001 ); -// -// WPD_PROPERTY_SMS_MESSAGE_TYPE -// [ VT_UI4 ] Indicates whether the message is binary or text. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SMS_MESSAGE_TYPE , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 1002 ); -// -// WPD_PROPERTY_SMS_TEXT_MESSAGE -// [ VT_LPWSTR ] if WPD_PROPERTY_SMS_MESSAGE_TYPE == SMS_TEXT_MESSAGE, then this will contain the message body. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SMS_TEXT_MESSAGE , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 1003 ); -// -// WPD_PROPERTY_SMS_BINARY_MESSAGE -// [ VT_VECTOR|VT_UI1 ] if WPD_PROPERTY_SMS_MESSAGE_TYPE == SMS_BINARY_MESSAGE, then this will contain the binary message body. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SMS_BINARY_MESSAGE , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 1004 ); - -// ======== Command Options ======== - -// -// WPD_OPTION_SMS_BINARY_MESSAGE_SUPPORTED -// [ VT_BOOL ] Indicates whether the driver can support binary messages as well as text messages. -DEFINE_PROPERTYKEY( WPD_OPTION_SMS_BINARY_MESSAGE_SUPPORTED , 0xAFC25D66, 0xFE0D, 0x4114, 0x90, 0x97, 0x97, 0x0C, 0x93, 0xE9, 0x20, 0xD1 , 5001 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_STILL_IMAGE_CAPTURE -* -* -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_STILL_IMAGE_CAPTURE , 0x4FCD6982, 0x22A2, 0x4B05, 0xA4, 0x8B, 0x62, 0xD3, 0x8B, 0xF2, 0x7B, 0x32 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE -// Initiates a still image capture. This is processed as a single command i.e. there is no start or stop required. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_COMMAND_TARGET -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE , 0x4FCD6982, 0x22A2, 0x4B05, 0xA4, 0x8B, 0x62, 0xD3, 0x8B, 0xF2, 0x7B, 0x32 , 2 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_MEDIA_CAPTURE -* -* -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_MEDIA_CAPTURE , 0x59B433BA, 0xFE44, 0x4D8D, 0x80, 0x8C, 0x6B, 0xCB, 0x9B, 0x0F, 0x15, 0xE8 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_MEDIA_CAPTURE_START -// Initiates a media capture operation that will only be ended by a subsequent WPD_COMMAND_MEDIA_CAPTURE_STOP command. Typically used to capture media streams such as audio and video. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_COMMAND_TARGET -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_MEDIA_CAPTURE_START , 0x59B433BA, 0xFE44, 0x4D8D, 0x80, 0x8C, 0x6B, 0xCB, 0x9B, 0x0F, 0x15, 0xE8 , 2 ); -// -// WPD_COMMAND_MEDIA_CAPTURE_STOP -// Ends a media capture operation started by a WPD_COMMAND_MEDIA_CAPTURE_START command. Typically used to end capture of media streams such as audio and video. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_COMMAND_TARGET -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_MEDIA_CAPTURE_STOP , 0x59B433BA, 0xFE44, 0x4D8D, 0x80, 0x8C, 0x6B, 0xCB, 0x9B, 0x0F, 0x15, 0xE8 , 3 ); -// -// WPD_COMMAND_MEDIA_CAPTURE_PAUSE -// Pauses a media capture operation started by a WPD_COMMAND_MEDIA_CAPTURE_START command. Typically used to pause capture of media streams such as audio and video. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_COMMAND_TARGET -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_MEDIA_CAPTURE_PAUSE , 0x59B433BA, 0xFE44, 0x4D8D, 0x80, 0x8C, 0x6B, 0xCB, 0x9B, 0x0F, 0x15, 0xE8 , 4 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_DEVICE_HINTS -* -* The commands in this category relate to hints that a device can provide to improve end-user experience. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_DEVICE_HINTS , 0x0D5FB92B, 0xCB46, 0x4C4F, 0x83, 0x43, 0x0B, 0xC3, 0xD3, 0xF1, 0x7C, 0x84 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_DEVICE_HINTS_GET_CONTENT_LOCATION -// This command is used to retrieve the ObjectIDs of folders that contain the specified content type. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_DEVICE_HINTS_CONTENT_TYPE -// Results: -// [ Required ] WPD_PROPERTY_DEVICE_HINTS_CONTENT_LOCATIONS -DEFINE_PROPERTYKEY( WPD_COMMAND_DEVICE_HINTS_GET_CONTENT_LOCATION , 0x0D5FB92B, 0xCB46, 0x4C4F, 0x83, 0x43, 0x0B, 0xC3, 0xD3, 0xF1, 0x7C, 0x84 , 2 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_DEVICE_HINTS_CONTENT_TYPE -// [ VT_CLSID ] Indicates the WPD content type that the caller is looking for. For example, to get the top-level folder objects that contain images, this parameter would be WPD_CONTENT_TYPE_IMAGE. -DEFINE_PROPERTYKEY( WPD_PROPERTY_DEVICE_HINTS_CONTENT_TYPE , 0x0D5FB92B, 0xCB46, 0x4C4F, 0x83, 0x43, 0x0B, 0xC3, 0xD3, 0xF1, 0x7C, 0x84 , 1001 ); -// -// WPD_PROPERTY_DEVICE_HINTS_CONTENT_LOCATIONS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR indicating a list of folder ObjectIDs. -DEFINE_PROPERTYKEY( WPD_PROPERTY_DEVICE_HINTS_CONTENT_LOCATIONS , 0x0D5FB92B, 0xCB46, 0x4C4F, 0x83, 0x43, 0x0B, 0xC3, 0xD3, 0xF1, 0x7C, 0x84 , 1002 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_NETWORK_CONFIGURATION -* -* The commands in this category are used for Network Association and WiFi Configuration. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_NETWORK_CONFIGURATION , 0x78F9C6FC, 0x79B8, 0x473C, 0x90, 0x60, 0x6B, 0xD2, 0x3D, 0xD0, 0x72, 0xC4 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_GENERATE_KEYPAIR -// Initiates the generation of a public/private key pair and returns the public key. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_PUBLIC_KEY -DEFINE_PROPERTYKEY( WPD_COMMAND_GENERATE_KEYPAIR , 0x78F9C6FC, 0x79B8, 0x473C, 0x90, 0x60, 0x6B, 0xD2, 0x3D, 0xD0, 0x72, 0xC4 , 2 ); -// -// WPD_COMMAND_COMMIT_KEYPAIR -// Commits a public/private key pair. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// None -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_COMMIT_KEYPAIR , 0x78F9C6FC, 0x79B8, 0x473C, 0x90, 0x60, 0x6B, 0xD2, 0x3D, 0xD0, 0x72, 0xC4 , 3 ); -// -// WPD_COMMAND_PROCESS_WIRELESS_PROFILE -// Initiates the processing of a Wireless Profile file. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_PROCESS_WIRELESS_PROFILE , 0x78F9C6FC, 0x79B8, 0x473C, 0x90, 0x60, 0x6B, 0xD2, 0x3D, 0xD0, 0x72, 0xC4 , 4 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_PUBLIC_KEY -// [ VT_VECTOR|VT_UI1 ] A public key generated for RSA key exchange. -DEFINE_PROPERTYKEY( WPD_PROPERTY_PUBLIC_KEY , 0x78F9C6FC, 0x79B8, 0x473C, 0x90, 0x60, 0x6B, 0xD2, 0x3D, 0xD0, 0x72, 0xC4 , 1001 ); - - -#endif // WPD_SERVICES_STRICT - -/**************************************************************************** -* This section defines all Resource keys. Resources are place-holders for -* binary data. -* -****************************************************************************/ -// -// WPD_RESOURCE_DEFAULT -// Represents the entire object's data. There can be only one default resource on an object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_DEFAULT , 0xE81E79BE, 0x34F0, 0x41BF, 0xB5, 0x3F, 0xF1, 0xA0, 0x6A, 0xE8, 0x78, 0x42 , 0 ); -// -// WPD_RESOURCE_CONTACT_PHOTO -// Represents the contact's photo data. -DEFINE_PROPERTYKEY( WPD_RESOURCE_CONTACT_PHOTO , 0x2C4D6803, 0x80EA, 0x4580, 0xAF, 0x9A, 0x5B, 0xE1, 0xA2, 0x3E, 0xDD, 0xCB , 0 ); -// -// WPD_RESOURCE_THUMBNAIL -// Represents the thumbnail data for an object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_THUMBNAIL , 0xC7C407BA, 0x98FA, 0x46B5, 0x99, 0x60, 0x23, 0xFE, 0xC1, 0x24, 0xCF, 0xDE , 0 ); -// -// WPD_RESOURCE_ICON -// Represents the icon data for an object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ICON , 0xF195FED8, 0xAA28, 0x4EE3, 0xB1, 0x53, 0xE1, 0x82, 0xDD, 0x5E, 0xDC, 0x39 , 0 ); -// -// WPD_RESOURCE_AUDIO_CLIP -// Represents an audio sample data for an object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_AUDIO_CLIP , 0x3BC13982, 0x85B1, 0x48E0, 0x95, 0xA6, 0x8D, 0x3A, 0xD0, 0x6B, 0xE1, 0x17 , 0 ); -// -// WPD_RESOURCE_ALBUM_ART -// Represents the album artwork this media originated from. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ALBUM_ART , 0xF02AA354, 0x2300, 0x4E2D, 0xA1, 0xB9, 0x3B, 0x67, 0x30, 0xF7, 0xFA, 0x21 , 0 ); -// -// WPD_RESOURCE_GENERIC -// Represents an arbitrary binary blob associated with this object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_GENERIC , 0xB9B9F515, 0xBA70, 0x4647, 0x94, 0xDC, 0xFA, 0x49, 0x25, 0xE9, 0x5A, 0x07 , 0 ); -// -// WPD_RESOURCE_VIDEO_CLIP -// Represents a video sample for an object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_VIDEO_CLIP , 0xB566EE42, 0x6368, 0x4290, 0x86, 0x62, 0x70, 0x18, 0x2F, 0xB7, 0x9F, 0x20 , 0 ); -// -// WPD_RESOURCE_BRANDING_ART -// Represents the product branding artwork or logo for an object. This resource is typically found on, but not limited to the device object. -DEFINE_PROPERTYKEY( WPD_RESOURCE_BRANDING_ART , 0xB633B1AE, 0x6CAF, 0x4A87, 0x95, 0x89, 0x22, 0xDE, 0xD6, 0xDD, 0x58, 0x99 , 0 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_NULL -* -* This category is used exclusively for the NULL property key define. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_NULL , 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ); - -// -// WPD_PROPERTY_NULL -// [ VT_EMPTY ] A NULL property key. -DEFINE_PROPERTYKEY( WPD_PROPERTY_NULL , 0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 , 0 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_FUNCTIONAL_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all functional objects. -****************************************************************************/ -DEFINE_GUID( WPD_FUNCTIONAL_OBJECT_PROPERTIES_V1 , 0x8F052D93, 0xABCA, 0x4FC5, 0xA5, 0xAC, 0xB0, 0x1D, 0xF4, 0xDB, 0xE5, 0x98 ); - -// -// WPD_FUNCTIONAL_OBJECT_CATEGORY -// [ VT_CLSID ] Indicates the object's functional category. -DEFINE_PROPERTYKEY( WPD_FUNCTIONAL_OBJECT_CATEGORY , 0x8F052D93, 0xABCA, 0x4FC5, 0xA5, 0xAC, 0xB0, 0x1D, 0xF4, 0xDB, 0xE5, 0x98 , 2 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_STORAGE_OBJECT_PROPERTIES_V1 -* -* This category is for properties common to all objects whose functional category is WPD_FUNCTIONAL_CATEGORY_STORAGE. -****************************************************************************/ -DEFINE_GUID( WPD_STORAGE_OBJECT_PROPERTIES_V1 , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A ); - -// -// WPD_STORAGE_TYPE -// [ VT_UI4 ] Indicates the type of storage e.g. fixed, removable etc. -DEFINE_PROPERTYKEY( WPD_STORAGE_TYPE , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 2 ); -// -// WPD_STORAGE_FILE_SYSTEM_TYPE -// [ VT_LPWSTR ] Indicates the file system type e.g. "FAT32" or "NTFS" or "My Special File System" -DEFINE_PROPERTYKEY( WPD_STORAGE_FILE_SYSTEM_TYPE , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 3 ); -// -// WPD_STORAGE_CAPACITY -// [ VT_UI8 ] Indicates the total storage capacity in bytes. -DEFINE_PROPERTYKEY( WPD_STORAGE_CAPACITY , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 4 ); -// -// WPD_STORAGE_FREE_SPACE_IN_BYTES -// [ VT_UI8 ] Indicates the available space in bytes. -DEFINE_PROPERTYKEY( WPD_STORAGE_FREE_SPACE_IN_BYTES , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 5 ); -// -// WPD_STORAGE_FREE_SPACE_IN_OBJECTS -// [ VT_UI8 ] Indicates the available space in objects e.g. available slots on a SIM card. -DEFINE_PROPERTYKEY( WPD_STORAGE_FREE_SPACE_IN_OBJECTS , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 6 ); -// -// WPD_STORAGE_DESCRIPTION -// [ VT_LPWSTR ] Contains a description of the storage. -DEFINE_PROPERTYKEY( WPD_STORAGE_DESCRIPTION , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 7 ); -// -// WPD_STORAGE_SERIAL_NUMBER -// [ VT_LPWSTR ] Contains the serial number of the storage. -DEFINE_PROPERTYKEY( WPD_STORAGE_SERIAL_NUMBER , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 8 ); -// -// WPD_STORAGE_MAX_OBJECT_SIZE -// [ VT_UI8 ] Specifies the maximum size of a single object (in bytes) that can be placed on this storage. -DEFINE_PROPERTYKEY( WPD_STORAGE_MAX_OBJECT_SIZE , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 9 ); -// -// WPD_STORAGE_CAPACITY_IN_OBJECTS -// [ VT_UI8 ] Indicates the total storage capacity in objects e.g. available slots on a SIM card. -DEFINE_PROPERTYKEY( WPD_STORAGE_CAPACITY_IN_OBJECTS , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 10 ); -// -// WPD_STORAGE_ACCESS_CAPABILITY -// [ VT_UI4 ] This property identifies any write-protection that globally affects this storage. This takes precedence over access specified on individual objects. -DEFINE_PROPERTYKEY( WPD_STORAGE_ACCESS_CAPABILITY , 0x01A3057A, 0x74D6, 0x4E80, 0xBE, 0xA7, 0xDC, 0x4C, 0x21, 0x2C, 0xE5, 0x0A , 11 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CLIENT_INFORMATION_PROPERTIES_V1 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_CLIENT_INFORMATION_PROPERTIES_V1 , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 ); - -// -// WPD_CLIENT_NAME -// [ VT_LPWSTR ] Specifies the name the client uses to identify itself. -DEFINE_PROPERTYKEY( WPD_CLIENT_NAME , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 2 ); -// -// WPD_CLIENT_MAJOR_VERSION -// [ VT_UI4 ] Specifies the major version of the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_MAJOR_VERSION , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 3 ); -// -// WPD_CLIENT_MINOR_VERSION -// [ VT_UI4 ] Specifies the major version of the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_MINOR_VERSION , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 4 ); -// -// WPD_CLIENT_REVISION -// [ VT_UI4 ] Specifies the revision (or build number) of the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_REVISION , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 5 ); -// -// WPD_CLIENT_WMDRM_APPLICATION_PRIVATE_KEY -// [ VT_VECTOR | VT_UI1 ] Specifies the Windows Media DRM application private key of the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_WMDRM_APPLICATION_PRIVATE_KEY , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 6 ); -// -// WPD_CLIENT_WMDRM_APPLICATION_CERTIFICATE -// [ VT_VECTOR | VT_UI1 ] Specifies the Windows Media DRM application certificate of the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_WMDRM_APPLICATION_CERTIFICATE , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 7 ); -// -// WPD_CLIENT_SECURITY_QUALITY_OF_SERVICE -// [ VT_UI4 ] Specifies the Security Quality of Service for the connection to the driver. This relates to the Security Quality of Service flags for CreateFile. For example, these allow or disallow a driver to impersonate the client. -DEFINE_PROPERTYKEY( WPD_CLIENT_SECURITY_QUALITY_OF_SERVICE , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 8 ); -// -// WPD_CLIENT_DESIRED_ACCESS -// [ VT_UI4 ] Specifies the desired access the client is requesting to this driver. The possible values are the same as for CreateFile (e.g. GENERIC_READ, GENERIC_WRITE etc.). -DEFINE_PROPERTYKEY( WPD_CLIENT_DESIRED_ACCESS , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 9 ); -// -// WPD_CLIENT_SHARE_MODE -// [ VT_UI4 ] Specifies the share mode the client is requesting to this driver. The possible values are the same as for CreateFile (e.g. FILE_SHARE_READ, FILE_SHARE_WRITE etc.). -DEFINE_PROPERTYKEY( WPD_CLIENT_SHARE_MODE , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 10 ); -// -// WPD_CLIENT_EVENT_COOKIE -// [ VT_LPWSTR ] Client supplied cookie returned by the driver in events posted as a direct result of operations issued by this client. -DEFINE_PROPERTYKEY( WPD_CLIENT_EVENT_COOKIE , 0x204D9F0C, 0x2292, 0x4080, 0x9F, 0x42, 0x40, 0x66, 0x4E, 0x70, 0xF8, 0x59 , 11 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_PROPERTY_ATTRIBUTES_V1 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_PROPERTY_ATTRIBUTES_V1 , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 ); - -// -// WPD_PROPERTY_ATTRIBUTE_FORM -// [ VT_UI4 ] Specifies the form of the valid values allowed for this property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_FORM , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 2 ); -// -// WPD_PROPERTY_ATTRIBUTE_CAN_READ -// [ VT_BOOL ] Indicates whether client applications have permission to Read the property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_CAN_READ , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 3 ); -// -// WPD_PROPERTY_ATTRIBUTE_CAN_WRITE -// [ VT_BOOL ] Indicates whether client applications have permission to Write the property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_CAN_WRITE , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 4 ); -// -// WPD_PROPERTY_ATTRIBUTE_CAN_DELETE -// [ VT_BOOL ] Indicates whether client applications have permission to Delete the property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_CAN_DELETE , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 5 ); -// -// WPD_PROPERTY_ATTRIBUTE_DEFAULT_VALUE -// [ VT_XXXX ] Specifies the default value for a write-able property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_DEFAULT_VALUE , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 6 ); -// -// WPD_PROPERTY_ATTRIBUTE_FAST_PROPERTY -// [ VT_BOOL ] If True, then this property belongs to the PORTABLE_DEVICE_FAST_PROPERTIES group. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_FAST_PROPERTY , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 7 ); -// -// WPD_PROPERTY_ATTRIBUTE_RANGE_MIN -// [ VT_XXXX ] The minimum value for a property whose form is of WPD_PROPERTY_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_RANGE_MIN , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 8 ); -// -// WPD_PROPERTY_ATTRIBUTE_RANGE_MAX -// [ VT_XXXX ] The maximum value for a property whose form is of WPD_PROPERTY_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_RANGE_MAX , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 9 ); -// -// WPD_PROPERTY_ATTRIBUTE_RANGE_STEP -// [ VT_XXXX ] The step value for a property whose form is of WPD_PROPERTY_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_RANGE_STEP , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 10 ); -// -// WPD_PROPERTY_ATTRIBUTE_ENUMERATION_ELEMENTS -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection containing the enumeration values. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_ENUMERATION_ELEMENTS , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 11 ); -// -// WPD_PROPERTY_ATTRIBUTE_REGULAR_EXPRESSION -// [ VT_LPWSTR ] A regular expression string indicating acceptable values for properties whose form is WPD_PROPERTY_ATTRIBUTE_FORM_REGULAR_EXPRESSION. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_REGULAR_EXPRESSION , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 12 ); -// -// WPD_PROPERTY_ATTRIBUTE_MAX_SIZE -// [ VT_UI8 ] This indicates the maximum size (in bytes) for the value of this property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_MAX_SIZE , 0xAB7943D8, 0x6332, 0x445F, 0xA0, 0x0D, 0x8D, 0x5E, 0xF1, 0xE9, 0x6F, 0x37 , 13 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_PROPERTY_ATTRIBUTES_V2 -* -* This category defines additional property attributes used by device services. -****************************************************************************/ -DEFINE_GUID( WPD_PROPERTY_ATTRIBUTES_V2 , 0x5D9DA160, 0x74AE, 0x43CC, 0x85, 0xA9, 0xFE, 0x55, 0x5A, 0x80, 0x79, 0x8E ); - -// -// WPD_PROPERTY_ATTRIBUTE_NAME -// [ VT_LPWSTR ] Contains the name of the property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_NAME , 0x5D9DA160, 0x74AE, 0x43CC, 0x85, 0xA9, 0xFE, 0x55, 0x5A, 0x80, 0x79, 0x8E , 2 ); -// -// WPD_PROPERTY_ATTRIBUTE_VARTYPE -// [ VT_UI4 ] Contains the VARTYPE of the property. -DEFINE_PROPERTYKEY( WPD_PROPERTY_ATTRIBUTE_VARTYPE , 0x5D9DA160, 0x74AE, 0x43CC, 0x85, 0xA9, 0xFE, 0x55, 0x5A, 0x80, 0x79, 0x8E , 3 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CLASS_EXTENSION_OPTIONS_V1 -* -* This category of properties relates to options used for the WPD device class extension -****************************************************************************/ -DEFINE_GUID( WPD_CLASS_EXTENSION_OPTIONS_V1 , 0x6309FFEF, 0xA87C, 0x4CA7, 0x84, 0x34, 0x79, 0x75, 0x76, 0xE4, 0x0A, 0x96 ); - -// -// WPD_CLASS_EXTENSION_OPTIONS_SUPPORTED_CONTENT_TYPES -// [ VT_UNKNOWN ] Indicates the (super-set) list of content types supported by the driver (similar to calling WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES on WPD_FUNCTIONAL_CATEGORY_ALL). -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_SUPPORTED_CONTENT_TYPES , 0x6309FFEF, 0xA87C, 0x4CA7, 0x84, 0x34, 0x79, 0x75, 0x76, 0xE4, 0x0A, 0x96 , 2 ); -// -// WPD_CLASS_EXTENSION_OPTIONS_DONT_REGISTER_WPD_DEVICE_INTERFACE -// [ VT_BOOL ] Indicates that the caller does not want the WPD class extension library to register the WPD Device Class interface. The caller will take responsibility for doing it. -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_DONT_REGISTER_WPD_DEVICE_INTERFACE , 0x6309FFEF, 0xA87C, 0x4CA7, 0x84, 0x34, 0x79, 0x75, 0x76, 0xE4, 0x0A, 0x96 , 3 ); -// -// WPD_CLASS_EXTENSION_OPTIONS_REGISTER_WPD_PRIVATE_DEVICE_INTERFACE -// [ VT_BOOL ] Indicates that the caller wants the WPD class extension library to register the private WPD Device Class interface. -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_REGISTER_WPD_PRIVATE_DEVICE_INTERFACE , 0x6309FFEF, 0xA87C, 0x4CA7, 0x84, 0x34, 0x79, 0x75, 0x76, 0xE4, 0x0A, 0x96 , 4 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CLASS_EXTENSION_OPTIONS_V2 -* -* This category of properties relates to options used for the WPD device class extension -****************************************************************************/ -DEFINE_GUID( WPD_CLASS_EXTENSION_OPTIONS_V2 , 0X3E3595DA, 0X4D71, 0X49FE, 0XA0, 0XB4, 0XD4, 0X40, 0X6C, 0X3A, 0XE9, 0X3F ); - -// -// WPD_CLASS_EXTENSION_OPTIONS_MULTITRANSPORT_MODE -// [ VT_BOOL ] Indicates that the caller wants the WPD class extension library to go into Multi-Transport mode (if TRUE). -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_MULTITRANSPORT_MODE , 0X3E3595DA, 0X4D71, 0X49FE, 0XA0, 0XB4, 0XD4, 0X40, 0X6C, 0X3A, 0XE9, 0X3F , 2 ); -// -// WPD_CLASS_EXTENSION_OPTIONS_DEVICE_IDENTIFICATION_VALUES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the device identification values (WPD_DEVICE_MANUFACTURER, WPD_DEVICE_MODEL, WPD_DEVICE_FIRMWARE_VERSION and WPD_DEVICE_FUNCTIONAL_UNIQUE_ID). Include this with other Class Extension options when initializing. -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_DEVICE_IDENTIFICATION_VALUES , 0X3E3595DA, 0X4D71, 0X49FE, 0XA0, 0XB4, 0XD4, 0X40, 0X6C, 0X3A, 0XE9, 0X3F , 3 ); -// -// WPD_CLASS_EXTENSION_OPTIONS_TRANSPORT_BANDWIDTH -// [ VT_UI4 ] Indicates the theoretical maximum bandwidth of the transport in kilobits per second. -DEFINE_PROPERTYKEY( WPD_CLASS_EXTENSION_OPTIONS_TRANSPORT_BANDWIDTH , 0X3E3595DA, 0X4D71, 0X49FE, 0XA0, 0XB4, 0XD4, 0X40, 0X6C, 0X3A, 0XE9, 0X3F , 4 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_RESOURCE_ATTRIBUTES_V1 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_RESOURCE_ATTRIBUTES_V1 , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 ); - -// -// WPD_RESOURCE_ATTRIBUTE_TOTAL_SIZE -// [ VT_UI8 ] Total size in bytes of the resource data. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_TOTAL_SIZE , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 2 ); -// -// WPD_RESOURCE_ATTRIBUTE_CAN_READ -// [ VT_BOOL ] Indicates whether client applications have permission to open the resource for Read access. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_CAN_READ , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 3 ); -// -// WPD_RESOURCE_ATTRIBUTE_CAN_WRITE -// [ VT_BOOL ] Indicates whether client applications have permission to open the resource for Write access. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_CAN_WRITE , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 4 ); -// -// WPD_RESOURCE_ATTRIBUTE_CAN_DELETE -// [ VT_BOOL ] Indicates whether client applications have permission to Delete a resource from the device. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_CAN_DELETE , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 5 ); -// -// WPD_RESOURCE_ATTRIBUTE_OPTIMAL_READ_BUFFER_SIZE -// [ VT_UI4 ] The recommended buffer size a caller should use when doing buffered reads on the resource. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_OPTIMAL_READ_BUFFER_SIZE , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 6 ); -// -// WPD_RESOURCE_ATTRIBUTE_OPTIMAL_WRITE_BUFFER_SIZE -// [ VT_UI4 ] The recommended buffer size a caller should use when doing buffered writes on the resource. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_OPTIMAL_WRITE_BUFFER_SIZE , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 7 ); -// -// WPD_RESOURCE_ATTRIBUTE_FORMAT -// [ VT_CLSID ] Indicates the format of the resource data. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_FORMAT , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 8 ); -// -// WPD_RESOURCE_ATTRIBUTE_RESOURCE_KEY -// [ VT_UNKNOWN ] This is an IPortableDeviceKeyCollection containing a single value, which is the key identifying the resource. -DEFINE_PROPERTYKEY( WPD_RESOURCE_ATTRIBUTE_RESOURCE_KEY , 0x1EB6F604, 0x9278, 0x429F, 0x93, 0xCC, 0x5B, 0xB8, 0xC0, 0x66, 0x56, 0xB6 , 9 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_DEVICE_PROPERTIES_V1 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_DEVICE_PROPERTIES_V1 , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC ); - -// -// WPD_DEVICE_SYNC_PARTNER -// [ VT_LPWSTR ] Indicates a human-readable description of a synchronization partner for the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_SYNC_PARTNER , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 2 ); -// -// WPD_DEVICE_FIRMWARE_VERSION -// [ VT_LPWSTR ] Indicates the firmware version for the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_FIRMWARE_VERSION , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 3 ); -// -// WPD_DEVICE_POWER_LEVEL -// [ VT_UI4 ] Indicates the power level of the device's battery. -DEFINE_PROPERTYKEY( WPD_DEVICE_POWER_LEVEL , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 4 ); -// -// WPD_DEVICE_POWER_SOURCE -// [ VT_UI4 ] Indicates the power source of the device e.g. whether it is battery or external. -DEFINE_PROPERTYKEY( WPD_DEVICE_POWER_SOURCE , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 5 ); -// -// WPD_DEVICE_PROTOCOL -// [ VT_LPWSTR ] Identifies the device protocol being used. -DEFINE_PROPERTYKEY( WPD_DEVICE_PROTOCOL , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 6 ); -// -// WPD_DEVICE_MANUFACTURER -// [ VT_LPWSTR ] Identifies the device manufacturer. -DEFINE_PROPERTYKEY( WPD_DEVICE_MANUFACTURER , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 7 ); -// -// WPD_DEVICE_MODEL -// [ VT_LPWSTR ] Identifies the device model. -DEFINE_PROPERTYKEY( WPD_DEVICE_MODEL , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 8 ); -// -// WPD_DEVICE_SERIAL_NUMBER -// [ VT_LPWSTR ] Identifies the serial number of the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_SERIAL_NUMBER , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 9 ); -// -// WPD_DEVICE_SUPPORTS_NON_CONSUMABLE -// [ VT_BOOL ] Indicates whether the device supports non-consumable objects. -DEFINE_PROPERTYKEY( WPD_DEVICE_SUPPORTS_NON_CONSUMABLE , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 10 ); -// -// WPD_DEVICE_DATETIME -// [ VT_DATE ] Represents the current date and time settings of the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_DATETIME , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 11 ); -// -// WPD_DEVICE_FRIENDLY_NAME -// [ VT_LPWSTR ] Represents the friendly name set by the user on the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_FRIENDLY_NAME , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 12 ); -// -// WPD_DEVICE_SUPPORTED_DRM_SCHEMES -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of VT_LPWSTR values indicating the Digital Rights Management schemes supported by the driver. -DEFINE_PROPERTYKEY( WPD_DEVICE_SUPPORTED_DRM_SCHEMES , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 13 ); -// -// WPD_DEVICE_SUPPORTED_FORMATS_ARE_ORDERED -// [ VT_BOOL ] Indicates whether the supported formats returned from the device are in a preferred order. (First format in the list is most preferred by the device, while the last is the least preferred.) -DEFINE_PROPERTYKEY( WPD_DEVICE_SUPPORTED_FORMATS_ARE_ORDERED , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 14 ); -// -// WPD_DEVICE_TYPE -// [ VT_UI4 ] Indicates the device type, used for representation purposes only. Functional characteristics of the device are decided through functional objects. -DEFINE_PROPERTYKEY( WPD_DEVICE_TYPE , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 15 ); -// -// WPD_DEVICE_NETWORK_IDENTIFIER -// [ VT_UI8 ] Indicates the EUI-64 network identifier of the device, used for out-of-band Network Association operations. -DEFINE_PROPERTYKEY( WPD_DEVICE_NETWORK_IDENTIFIER , 0x26D4979A, 0xE643, 0x4626, 0x9E, 0x2B, 0x73, 0x6D, 0xC0, 0xC9, 0x2F, 0xDC , 16 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_DEVICE_PROPERTIES_V2 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_DEVICE_PROPERTIES_V2 , 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99 ); - -// -// WPD_DEVICE_FUNCTIONAL_UNIQUE_ID -// [ VT_VECTOR | VT_UI1 ] Indicates a unique 16 byte identifier common across multiple transports supported by the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_FUNCTIONAL_UNIQUE_ID , 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99 , 2 ); -// -// WPD_DEVICE_MODEL_UNIQUE_ID -// [ VT_VECTOR | VT_UI1 ] Indicates a unique 16 byte identifier for cosmetic differentiation among different models of the device. -DEFINE_PROPERTYKEY( WPD_DEVICE_MODEL_UNIQUE_ID , 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99 , 3 ); -// -// WPD_DEVICE_TRANSPORT -// [ VT_UI4 ] Indicates the transport type (USB, IP, Bluetooth, etc.). -DEFINE_PROPERTYKEY( WPD_DEVICE_TRANSPORT , 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99 , 4 ); -// -// WPD_DEVICE_USE_DEVICE_STAGE -// [ VT_BOOL ] If this property exists and is set to TRUE, the device can be used with Device Stage. -DEFINE_PROPERTYKEY( WPD_DEVICE_USE_DEVICE_STAGE , 0x463DD662, 0x7FC4, 0x4291, 0x91, 0x1C, 0x7F, 0x4C, 0x9C, 0xCA, 0x97, 0x99 , 5 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_SERVICE_PROPERTIES_V1 -* -* -****************************************************************************/ -DEFINE_GUID( WPD_SERVICE_PROPERTIES_V1 , 0x7510698A, 0xCB54, 0x481C, 0xB8, 0xDB, 0x0D, 0x75, 0xC9, 0x3F, 0x1C, 0x06 ); - -// -// WPD_SERVICE_VERSION -// [ VT_LPWSTR ] Indicates the implementation version of a service. -DEFINE_PROPERTYKEY( WPD_SERVICE_VERSION , 0x7510698A, 0xCB54, 0x481C, 0xB8, 0xDB, 0x0D, 0x75, 0xC9, 0x3F, 0x1C, 0x06 , 2 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_EVENT_PROPERTIES_V1 -* -* The properties in this category are for properties that may be needed for event processing, but do not have object property equivalents (i.e. they are not exposed as object properties, but rather, used only as event parameters). -****************************************************************************/ -DEFINE_GUID( WPD_EVENT_PROPERTIES_V1 , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 ); - -// -// WPD_EVENT_PARAMETER_PNP_DEVICE_ID -// [ VT_LPWSTR ] Indicates the device that originated the event. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_PNP_DEVICE_ID , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 2 ); -// -// WPD_EVENT_PARAMETER_EVENT_ID -// [ VT_CLSID ] Indicates the event sent. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_EVENT_ID , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 3 ); -// -// WPD_EVENT_PARAMETER_OPERATION_STATE -// [ VT_UI4 ] Indicates the current state of the operation (e.g. started, running, stopped etc.). -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_OPERATION_STATE , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 4 ); -// -// WPD_EVENT_PARAMETER_OPERATION_PROGRESS -// [ VT_UI4 ] Indicates the progress of a currently executing operation. Value is from 0 to 100, with 100 indicating that the operation is complete. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_OPERATION_PROGRESS , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 5 ); -// -// WPD_EVENT_PARAMETER_OBJECT_PARENT_PERSISTENT_UNIQUE_ID -// [ VT_LPWSTR ] Uniquely identifies the parent object, similar to WPD_OBJECT_PARENT_ID, but this ID will not change between sessions. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_OBJECT_PARENT_PERSISTENT_UNIQUE_ID , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 6 ); -// -// WPD_EVENT_PARAMETER_OBJECT_CREATION_COOKIE -// [ VT_LPWSTR ] This is the cookie handed back to a client when it requested an object creation using the IPortableDeviceContent::CreateObjectWithPropertiesAndData method. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_OBJECT_CREATION_COOKIE , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 7 ); -// -// WPD_EVENT_PARAMETER_CHILD_HIERARCHY_CHANGED -// [ VT_BOOL ] Indicates that the child hiearchy for the object has changed. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_CHILD_HIERARCHY_CHANGED , 0x15AB1953, 0xF817, 0x4FEF, 0xA9, 0x21, 0x56, 0x76, 0xE8, 0x38, 0xF6, 0xE0 , 8 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_EVENT_PROPERTIES_V2 -* -* The properties in this category are for properties that may be needed for event processing, but do not have object property equivalents (i.e. they are not exposed as object properties, but rather, used only as event parameters). -****************************************************************************/ -DEFINE_GUID( WPD_EVENT_PROPERTIES_V2 , 0x52807B8A, 0x4914, 0x4323, 0x9B, 0x9A, 0x74, 0xF6, 0x54, 0xB2, 0xB8, 0x46 ); - -// -// WPD_EVENT_PARAMETER_SERVICE_METHOD_CONTEXT -// [ VT_LPWSTR ] Indicates the service method invocation context. -DEFINE_PROPERTYKEY( WPD_EVENT_PARAMETER_SERVICE_METHOD_CONTEXT , 0x52807B8A, 0x4914, 0x4323, 0x9B, 0x9A, 0x74, 0xF6, 0x54, 0xB2, 0xB8, 0x46 , 2 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_EVENT_OPTIONS_V1 -* -* The properties in this category describe event options. -****************************************************************************/ -DEFINE_GUID( WPD_EVENT_OPTIONS_V1 , 0xB3D8DAD7, 0xA361, 0x4B83, 0x8A, 0x48, 0x5B, 0x02, 0xCE, 0x10, 0x71, 0x3B ); - -// -// WPD_EVENT_OPTION_IS_BROADCAST_EVENT -// [ VT_BOOL ] Indicates that the event is broadcast to all clients. -DEFINE_PROPERTYKEY( WPD_EVENT_OPTION_IS_BROADCAST_EVENT , 0xB3D8DAD7, 0xA361, 0x4B83, 0x8A, 0x48, 0x5B, 0x02, 0xCE, 0x10, 0x71, 0x3B , 2 ); -// -// WPD_EVENT_OPTION_IS_AUTOPLAY_EVENT -// [ VT_BOOL ] Indicates that the event is sent to and handled by Autoplay. -DEFINE_PROPERTYKEY( WPD_EVENT_OPTION_IS_AUTOPLAY_EVENT , 0xB3D8DAD7, 0xA361, 0x4B83, 0x8A, 0x48, 0x5B, 0x02, 0xCE, 0x10, 0x71, 0x3B , 3 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_EVENT_ATTRIBUTES_V1 -* -* The properties in this category describe event attributes. -****************************************************************************/ -DEFINE_GUID( WPD_EVENT_ATTRIBUTES_V1 , 0x10C96578, 0x2E81, 0x4111, 0xAD, 0xDE, 0xE0, 0x8C, 0xA6, 0x13, 0x8F, 0x6D ); - -// -// WPD_EVENT_ATTRIBUTE_NAME -// [ VT_LPWSTR ] Contains the name of the event. -DEFINE_PROPERTYKEY( WPD_EVENT_ATTRIBUTE_NAME , 0x10C96578, 0x2E81, 0x4111, 0xAD, 0xDE, 0xE0, 0x8C, 0xA6, 0x13, 0x8F, 0x6D , 2 ); -// -// WPD_EVENT_ATTRIBUTE_PARAMETERS -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing the event parameters. -DEFINE_PROPERTYKEY( WPD_EVENT_ATTRIBUTE_PARAMETERS , 0x10C96578, 0x2E81, 0x4111, 0xAD, 0xDE, 0xE0, 0x8C, 0xA6, 0x13, 0x8F, 0x6D , 3 ); -// -// WPD_EVENT_ATTRIBUTE_OPTIONS -// [ VT_UNKNOWN ] IPortableDeviceValues containing the event options. -DEFINE_PROPERTYKEY( WPD_EVENT_ATTRIBUTE_OPTIONS , 0x10C96578, 0x2E81, 0x4111, 0xAD, 0xDE, 0xE0, 0x8C, 0xA6, 0x13, 0x8F, 0x6D , 4 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_API_OPTIONS_V1 -* -* The properties in this category describe API options. -****************************************************************************/ -DEFINE_GUID( WPD_API_OPTIONS_V1 , 0x10E54A3E, 0x052D, 0x4777, 0xA1, 0x3C, 0xDE, 0x76, 0x14, 0xBE, 0x2B, 0xC4 ); - -// -// WPD_API_OPTION_USE_CLEAR_DATA_STREAM -// [ VT_BOOL ] Indicates that the data stream created for data transfer will be clear only (i.e. No DRM will be involved). -DEFINE_PROPERTYKEY( WPD_API_OPTION_USE_CLEAR_DATA_STREAM , 0x10E54A3E, 0x052D, 0x4777, 0xA1, 0x3C, 0xDE, 0x76, 0x14, 0xBE, 0x2B, 0xC4 , 2 ); -// -// WPD_API_OPTION_IOCTL_ACCESS -// [ VT_UI4 ] An optional property that clients can add to the IN parameter set of IPortableDevice::SendCommand to specify the access required for the command. The Portable Device API uses this to identify whether the IOCTL sent to the driver is sent with FILE_READ_ACCESS or (FILE_READ_ACCESS | FILE_WRITE_ACCESS) access flags. -DEFINE_PROPERTYKEY( WPD_API_OPTION_IOCTL_ACCESS , 0x10E54A3E, 0x052D, 0x4777, 0xA1, 0x3C, 0xDE, 0x76, 0x14, 0xBE, 0x2B, 0xC4 , 3 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_FORMAT_ATTRIBUTES_V1 -* -* The properties in this category describe format attributes. -****************************************************************************/ -DEFINE_GUID( WPD_FORMAT_ATTRIBUTES_V1 , 0xA0A02000, 0xBCAF, 0x4BE8, 0xB3, 0xF5, 0x23, 0x3F, 0x23, 0x1C, 0xF5, 0x8F ); - -// -// WPD_FORMAT_ATTRIBUTE_NAME -// [ VT_LPWSTR ] Contains the name of the format. -DEFINE_PROPERTYKEY( WPD_FORMAT_ATTRIBUTE_NAME , 0xA0A02000, 0xBCAF, 0x4BE8, 0xB3, 0xF5, 0x23, 0x3F, 0x23, 0x1C, 0xF5, 0x8F , 2 ); -// -// WPD_FORMAT_ATTRIBUTE_MIMETYPE -// [ VT_LPWSTR ] Contains the MIME type of the format. -DEFINE_PROPERTYKEY( WPD_FORMAT_ATTRIBUTE_MIMETYPE , 0xA0A02000, 0xBCAF, 0x4BE8, 0xB3, 0xF5, 0x23, 0x3F, 0x23, 0x1C, 0xF5, 0x8F , 3 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_METHOD_ATTRIBUTES_V1 -* -* The properties in this category describe method attributes. -****************************************************************************/ -DEFINE_GUID( WPD_METHOD_ATTRIBUTES_V1 , 0xF17A5071, 0xF039, 0x44AF, 0x8E, 0xFE, 0x43, 0x2C, 0xF3, 0x2E, 0x43, 0x2A ); - -// -// WPD_METHOD_ATTRIBUTE_NAME -// [ VT_LPWSTR ] Contains the name of the method. -DEFINE_PROPERTYKEY( WPD_METHOD_ATTRIBUTE_NAME , 0xF17A5071, 0xF039, 0x44AF, 0x8E, 0xFE, 0x43, 0x2C, 0xF3, 0x2E, 0x43, 0x2A , 2 ); -// -// WPD_METHOD_ATTRIBUTE_ASSOCIATED_FORMAT -// [ VT_CLSID ] Contains the format this method applies to. This is GUID_NULL if the method does not apply to a format. -DEFINE_PROPERTYKEY( WPD_METHOD_ATTRIBUTE_ASSOCIATED_FORMAT , 0xF17A5071, 0xF039, 0x44AF, 0x8E, 0xFE, 0x43, 0x2C, 0xF3, 0x2E, 0x43, 0x2A , 3 ); -// -// WPD_METHOD_ATTRIBUTE_ACCESS -// [ VT_UI4 ] Indicates the required access for a method. -DEFINE_PROPERTYKEY( WPD_METHOD_ATTRIBUTE_ACCESS , 0xF17A5071, 0xF039, 0x44AF, 0x8E, 0xFE, 0x43, 0x2C, 0xF3, 0x2E, 0x43, 0x2A , 4 ); -// -// WPD_METHOD_ATTRIBUTE_PARAMETERS -// [ VT_UNKNOWN ] This is an IPortableDeviceKeyCollection containing the method parameters. -DEFINE_PROPERTYKEY( WPD_METHOD_ATTRIBUTE_PARAMETERS , 0xF17A5071, 0xF039, 0x44AF, 0x8E, 0xFE, 0x43, 0x2C, 0xF3, 0x2E, 0x43, 0x2A , 5 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_PARAMETER_ATTRIBUTES_V1 -* -* The properties in this category describe parameter attributes. -****************************************************************************/ -DEFINE_GUID( WPD_PARAMETER_ATTRIBUTES_V1 , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 ); - -// -// WPD_PARAMETER_ATTRIBUTE_ORDER -// [ VT_UI4 ] The order (starting from 0) of a method parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_ORDER , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 2 ); -// -// WPD_PARAMETER_ATTRIBUTE_USAGE -// [ VT_UI4 ] The usage of the method parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_USAGE , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 3 ); -// -// WPD_PARAMETER_ATTRIBUTE_FORM -// [ VT_UI4 ] Specifies the form of the valid values allowed for this parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_FORM , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 4 ); -// -// WPD_PARAMETER_ATTRIBUTE_DEFAULT_VALUE -// [ VT_XXXX ] Specifies the default value for this parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_DEFAULT_VALUE , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 5 ); -// -// WPD_PARAMETER_ATTRIBUTE_RANGE_MIN -// [ VT_XXXX ] The minimum value for a parameter whose form is of WPD_PARAMETER_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_RANGE_MIN , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 6 ); -// -// WPD_PARAMETER_ATTRIBUTE_RANGE_MAX -// [ VT_XXXX ] The maximum value for a parameter whose form is of WPD_PARAMETER_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_RANGE_MAX , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 7 ); -// -// WPD_PARAMETER_ATTRIBUTE_RANGE_STEP -// [ VT_XXXX ] The step value for a parameter whose form is of WPD_PARAMETER_ATTRIBUTE_FORM_RANGE. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_RANGE_STEP , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 8 ); -// -// WPD_PARAMETER_ATTRIBUTE_ENUMERATION_ELEMENTS -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection containing the enumeration values. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_ENUMERATION_ELEMENTS , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 9 ); -// -// WPD_PARAMETER_ATTRIBUTE_REGULAR_EXPRESSION -// [ VT_LPWSTR ] A regular expression string indicating acceptable values for parameters whose form is WPD_PARAMETER_ATTRIBUTE_FORM_REGULAR_EXPRESSION. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_REGULAR_EXPRESSION , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 10 ); -// -// WPD_PARAMETER_ATTRIBUTE_MAX_SIZE -// [ VT_UI8 ] This indicates the maximum size (in bytes) for the value of this parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_MAX_SIZE , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 11 ); -// -// WPD_PARAMETER_ATTRIBUTE_VARTYPE -// [ VT_UI4 ] Contains the VARTYPE of the parameter. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_VARTYPE , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 12 ); -// -// WPD_PARAMETER_ATTRIBUTE_NAME -// [ VT_LPWSTR ] Contains the parameter name. -DEFINE_PROPERTYKEY( WPD_PARAMETER_ATTRIBUTE_NAME , 0xE6864DD7, 0xF325, 0x45EA, 0xA1, 0xD5, 0x97, 0xCF, 0x73, 0xB6, 0xCA, 0x58 , 13 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_COMMON -* -* -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_COMMON , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A ); - -// ======== Commands ======== - -// -// WPD_COMMAND_COMMON_RESET_DEVICE -// This command is sent by clients to reset the device. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// None -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_COMMON_RESET_DEVICE , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 2 ); -// -// WPD_COMMAND_COMMON_GET_OBJECT_IDS_FROM_PERSISTENT_UNIQUE_IDS -// This command is sent when a client wants to get current ObjectIDs representing objects specified by previously acquired Persistent Unique IDs. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_PERSISTENT_UNIQUE_IDS -// Results: -// [ Required ] WPD_PROPERTY_COMMON_OBJECT_IDS -DEFINE_PROPERTYKEY( WPD_COMMAND_COMMON_GET_OBJECT_IDS_FROM_PERSISTENT_UNIQUE_IDS , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 3 ); -// -// WPD_COMMAND_COMMON_SAVE_CLIENT_INFORMATION -// This command is sent when a client first connects to a device. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_COMMON_CLIENT_INFORMATION -// Results: -// [ Optional ] WPD_PROPERTY_COMMON_CLIENT_INFORMATION_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_COMMON_SAVE_CLIENT_INFORMATION , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 4 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_COMMON_COMMAND_CATEGORY -// [ VT_CLSID ] Specifies the command Category (i.e. the GUID portion of the PROPERTYKEY indicating the command). -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_COMMAND_CATEGORY , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1001 ); -// -// WPD_PROPERTY_COMMON_COMMAND_ID -// [ VT_UI4 ] Specifies the command ID, which is the PID portion of the PROPERTYKEY indicating the command. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_COMMAND_ID , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1002 ); -// -// WPD_PROPERTY_COMMON_HRESULT -// [ VT_ERROR ] The driver sets this to be the HRESULT of the requested operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_HRESULT , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1003 ); -// -// WPD_PROPERTY_COMMON_DRIVER_ERROR_CODE -// [ VT_UI4 ] Special driver specific code which driver may return on error. Typically only for use with diagnostic tools or vertical solutions. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_DRIVER_ERROR_CODE , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1004 ); -// -// WPD_PROPERTY_COMMON_COMMAND_TARGET -// [ VT_LPWSTR ] Identifies the object which the command is intended for. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_COMMAND_TARGET , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1006 ); -// -// WPD_PROPERTY_COMMON_PERSISTENT_UNIQUE_IDS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR specifying list of Persistent Unique IDs. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_PERSISTENT_UNIQUE_IDS , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1007 ); -// -// WPD_PROPERTY_COMMON_OBJECT_IDS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR specifying list of Objects IDs. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_OBJECT_IDS , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1008 ); -// -// WPD_PROPERTY_COMMON_CLIENT_INFORMATION -// [ VT_UNKNOWN ] IPortableDeviceValues used to identify itself to the driver. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_CLIENT_INFORMATION , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1009 ); -// -// WPD_PROPERTY_COMMON_CLIENT_INFORMATION_CONTEXT -// [ VT_LPWSTR ] Driver specified context which will be sent for the particular client on all subsequent operations. -DEFINE_PROPERTYKEY( WPD_PROPERTY_COMMON_CLIENT_INFORMATION_CONTEXT , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 1010 ); - -// ======== Command Options ======== - -// -// WPD_OPTION_VALID_OBJECT_IDS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR specifying list of Objects IDs of the objects that support the command. -DEFINE_PROPERTYKEY( WPD_OPTION_VALID_OBJECT_IDS , 0xF0422A9C, 0x5DC8, 0x4440, 0xB5, 0xBD, 0x5D, 0xF2, 0x88, 0x35, 0x65, 0x8A , 5001 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_OBJECT_ENUMERATION -* -* The commands in this category are used for basic object enumeration. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_OBJECT_ENUMERATION , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC ); - -// ======== Commands ======== - -// -// WPD_COMMAND_OBJECT_ENUMERATION_START_FIND -// The driver receives this command when a client wishes to start enumeration. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_PARENT_ID -// [ Optional ] WPD_PROPERTY_OBJECT_ENUMERATION_FILTER -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_ENUMERATION_START_FIND , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 2 ); -// -// WPD_COMMAND_OBJECT_ENUMERATION_FIND_NEXT -// This command is used when the client requests the next batch of ObjectIDs during enumeration. Only objects that match the constraints set up in WPD_COMMAND_OBJECT_ENUMERATION_START_FIND should be returned. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_NUM_OBJECTS_REQUESTED -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_OBJECT_IDS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_ENUMERATION_FIND_NEXT , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 3 ); -// -// WPD_COMMAND_OBJECT_ENUMERATION_END_FIND -// The driver should destroy any resources associated with this enumeration context. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_ENUMERATION_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_ENUMERATION_END_FIND , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 4 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_OBJECT_ENUMERATION_PARENT_ID -// [ VT_LPWSTR ] The ObjectID specifying the parent object where enumeration should start. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_ENUMERATION_PARENT_ID , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 1001 ); -// -// WPD_PROPERTY_OBJECT_ENUMERATION_FILTER -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which specifies the properties used to filter on. If the caller does not want filtering, then this value will not be set. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_ENUMERATION_FILTER , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 1002 ); -// -// WPD_PROPERTY_OBJECT_ENUMERATION_OBJECT_IDS -// [ VT_UNKNOWN ] This is an IPortableDevicePropVariantCollection of ObjectIDs (of type VT_LPWSTR). If 0 objects are returned, this should be an empty collection, not NULL. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_ENUMERATION_OBJECT_IDS , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 1003 ); -// -// WPD_PROPERTY_OBJECT_ENUMERATION_CONTEXT -// [ VT_LPWSTR ] This is a driver-specified identifier for the context associated with this enumeration. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_ENUMERATION_CONTEXT , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 1004 ); -// -// WPD_PROPERTY_OBJECT_ENUMERATION_NUM_OBJECTS_REQUESTED -// [ VT_UI4 ] The maximum number of ObjectIDs to return back to the client. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_ENUMERATION_NUM_OBJECTS_REQUESTED , 0xB7474E91, 0xE7F8, 0x4AD9, 0xB4, 0x00, 0xAD, 0x1A, 0x4B, 0x58, 0xEE, 0xEC , 1005 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_OBJECT_PROPERTIES -* -* This category of commands is used to perform basic property operations such as Reading/Writing values, listing supported values and so on. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_OBJECT_PROPERTIES , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_OBJECT_PROPERTIES_GET_SUPPORTED -// This command is used when the client requests the list of properties supported by the specified object. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_GET_SUPPORTED , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 2 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_GET_ATTRIBUTES -// This command is used when the client requests the property attributes for the specified object properties. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_GET_ATTRIBUTES , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 3 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_GET -// This command is used when the client requests a set of property values for the specified object. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_VALUES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_GET , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 4 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_SET -// This command is used when the client requests to write a set of property values on the specified object. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_VALUES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_WRITE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_SET , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 5 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_GET_ALL -// This command is used when the client requests all property values for the specified object. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_VALUES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_GET_ALL , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 6 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_DELETE -// This command is sent when the caller wants to delete properties from the specified object. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS -// Results: -// [ Optional ] WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_DELETE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_DELETE , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 7 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID -// [ VT_LPWSTR ] The ObjectID specifying the object whose properties are being queried/manipulated. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_OBJECT_ID , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1001 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS -// [ VT_UNKNOWN ] An IPortableDeviceKeyCollection identifying which specific property values we are querying/manipulating. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_KEYS , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1002 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_ATTRIBUTES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the attributes for each property requested. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_ATTRIBUTES , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1003 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_VALUES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the values read. For any property whose value could not be read, the type must be set to VT_ERROR, and the 'scode' field must contain the failure HRESULT. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_VALUES , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1004 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_WRITE_RESULTS -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the result of each property write operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_WRITE_RESULTS , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1005 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_DELETE_RESULTS -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the result of each property delete operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_PROPERTY_DELETE_RESULTS , 0x9E5582E4, 0x0814, 0x44E6, 0x98, 0x1A, 0xB2, 0x99, 0x8D, 0x58, 0x38, 0x04 , 1006 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_OBJECT_PROPERTIES_BULK -* -* This category contains commands and properties for property operations across multiple objects. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_OBJECT_PROPERTIES_BULK , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E ); - -// ======== Commands ======== - -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_START -// Initializes the operation to get the property values for all caller-specified objects. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_IDS -// [ Optional ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_START , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 2 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_NEXT -// Get the next set of property values. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_VALUES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_NEXT , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 3 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_END -// Ends the bulk property operation for getting property values by object list. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_END , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 4 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_START -// Initializes the operation to get the property values for objects of the specified format -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_FORMAT -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PARENT_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_DEPTH -// [ Optional ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_START , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 5 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_NEXT -// Get the next set of property values. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_VALUES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_NEXT , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 6 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_END -// Ends the bulk property operation for getting property values by object format. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_END , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 7 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_START -// Initializes the operation to set the property values for specified objects. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_VALUES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_START , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 8 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_NEXT -// Set the next set of property values. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_WRITE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_NEXT , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 9 ); -// -// WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_END -// Ends the bulk property operation for setting property values by object list. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_END , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 10 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_IDS -// [ VT_UNKNOWN ] A collection of ObjectIDs for which supported property list must be returned. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_IDS , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1001 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT -// [ VT_LPWSTR ] The driver-specified context identifying this particular bulk operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_CONTEXT , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1002 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_VALUES -// [ VT_UNKNOWN ] Contains an IPortableDeviceValuesCollection specifying the next set of IPortableDeviceValues elements. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_VALUES , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1003 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PROPERTY_KEYS -// [ VT_UNKNOWN ] Contains an IPortableDeviceKeyCollection specifying which properties the caller wants to return. May not exist, which indicates caller wants ALL properties. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PROPERTY_KEYS , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1004 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_DEPTH -// [ VT_UI4 ] Contains a value specifying the hierarchical depth from the parent to include in this operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_DEPTH , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1005 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PARENT_OBJECT_ID -// [ VT_LPWSTR ] Contains the ObjectID of the object to start the operation from. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_PARENT_OBJECT_ID , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1006 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_FORMAT -// [ VT_CLSID ] Specifies the object format the client is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_OBJECT_FORMAT , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1007 ); -// -// WPD_PROPERTY_OBJECT_PROPERTIES_BULK_WRITE_RESULTS -// [ VT_UNKNOWN ] Contains an IPortableDeviceValuesCollection specifying the set of IPortableDeviceValues elements indicating the write results for each property set. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_PROPERTIES_BULK_WRITE_RESULTS , 0x11C824DD, 0x04CD, 0x4E4E, 0x8C, 0x7B, 0xF6, 0xEF, 0xB7, 0x94, 0xD8, 0x4E , 1008 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_OBJECT_RESOURCES -* -* The commands in this category are used for basic object resource enumeration and transfer. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_OBJECT_RESOURCES , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A ); - -// ======== Commands ======== - -// -// WPD_COMMAND_OBJECT_RESOURCES_GET_SUPPORTED -// This command is sent when a client wants to get the list of resources supported on a particular object. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_GET_SUPPORTED , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 2 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_GET_ATTRIBUTES -// This command is used when the client requests the attributes for the specified object resource. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_GET_ATTRIBUTES , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 3 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_OPEN -// This command is sent when a client wants to use a particular resource on an object. -// Access: -// Dependent on the value of WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE. STGM_READ will indicate FILE_READ_ACCESS for the command, anything else will indicate (FILE_READ_ACCESS | FILE_WRITE_ACCESS). -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OPTIMAL_TRANSFER_BUFFER_SIZE -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_OPEN , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 4 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_READ -// This command is sent when a client wants to read the next band of data from a previously opened object resource. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_READ -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_DATA -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_READ -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_DATA -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_READ , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 5 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_WRITE -// This command is sent when a client wants to write the next band of data to a previously opened object resource. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_WRITE -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_DATA -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_WRITTEN -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_WRITE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 6 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_CLOSE -// This command is sent when a client is finished transferring data to a previously opened object resource. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_CLOSE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 7 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_DELETE -// This command is sent when the client wants to delete the data associated with the specified resources from the specified object. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_DELETE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 8 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE -// This command is sent when a client wants to create a new object resource on the device. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_ATTRIBUTES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_OPTIMAL_TRANSFER_BUFFER_SIZE -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 9 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_REVERT -// This command is sent when a client wants to cancel the resource creation request that is currently still in progress. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_REVERT , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 10 ); -// -// WPD_COMMAND_OBJECT_RESOURCES_SEEK -// This command is sent when a client wants to seek to a specific offset in the data stream. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_SEEK_OFFSET -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_SEEK_ORIGIN_FLAG -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_RESOURCES_POSITION_FROM_START -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_RESOURCES_SEEK , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 11 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID -// [ VT_LPWSTR ] -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_OBJECT_ID , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1001 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE -// [ VT_UI4 ] Specifies the type of access the client is requesting for the resource. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1002 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS -// [ VT_UNKNOWN ] -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_KEYS , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1003 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_ATTRIBUTES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the attributes for the resource requested. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_RESOURCE_ATTRIBUTES , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1004 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT -// [ VT_LPWSTR] This is a driver-specified identifier for the context associated with the resource operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_CONTEXT , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1005 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_READ -// [ VT_UI4 ] Specifies the number of bytes the client is requesting to read. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_READ , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1006 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_READ -// [ VT_UI4 ] Specifies the number of bytes actually read from the resource. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_READ , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1007 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_WRITE -// [ VT_UI4 ] Specifies the number of bytes the client is requesting to write. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_TO_WRITE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1008 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_WRITTEN -// [ VT_UI4 ] Driver sets this to let caller know how many bytes were actually written. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_NUM_BYTES_WRITTEN , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1009 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_DATA -// [ VT_VECTOR|VT_UI1 ] -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_DATA , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1010 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_OPTIMAL_TRANSFER_BUFFER_SIZE -// [ VT_UI4 ] Indicates the optimal transfer buffer size (in bytes) that clients should use when reading/writing this resource. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_OPTIMAL_TRANSFER_BUFFER_SIZE , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1011 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_SEEK_OFFSET -// [ VT_I8 ] Displacement to be added to the location indicated by the WPD_PROPERTY_OBJECT_RESOURCES_SEEK_ORIGIN_FLAG parameter. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_SEEK_OFFSET , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1012 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_SEEK_ORIGIN_FLAG -// [ VT_UI4 ] Specifies the origin of the displacement for the seek operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_SEEK_ORIGIN_FLAG , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1013 ); -// -// WPD_PROPERTY_OBJECT_RESOURCES_POSITION_FROM_START -// [ VT_UI8 ] Value of the new seek pointer from the beginning of the data stream. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_RESOURCES_POSITION_FROM_START , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 1014 ); - -// ======== Command Options ======== - -// -// WPD_OPTION_OBJECT_RESOURCES_SEEK_ON_READ_SUPPORTED -// [ VT_BOOL ] Indicates whether the driver can Seek on a resource opened for Read access. -DEFINE_PROPERTYKEY( WPD_OPTION_OBJECT_RESOURCES_SEEK_ON_READ_SUPPORTED , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 5001 ); -// -// WPD_OPTION_OBJECT_RESOURCES_SEEK_ON_WRITE_SUPPORTED -// [ VT_BOOL ] Indicates whether the driver can Seek on a resource opened for Write access. -DEFINE_PROPERTYKEY( WPD_OPTION_OBJECT_RESOURCES_SEEK_ON_WRITE_SUPPORTED , 0xB3A2B22D, 0xA595, 0x4108, 0xBE, 0x0A, 0xFC, 0x3C, 0x96, 0x5F, 0x3D, 0x4A , 5002 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_OBJECT_MANAGEMENT -* -* The commands specified in this category are used to Create/Delete objects on the device. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_OBJECT_MANAGEMENT , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_ONLY -// This command is sent when a client wants to create a new object on the device, specified only by properties. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CREATION_PROPERTIES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_ID -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_ONLY , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 2 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_AND_DATA -// This command is sent when a client wants to create a new object on the device, specified by properties and data. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CREATION_PROPERTIES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_AND_DATA , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 3 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_WRITE_OBJECT_DATA -// This command is sent when a client wants to write the next band of data to a newly created object or an object being updated. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_TO_WRITE -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_DATA -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_WRITTEN -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_WRITE_OBJECT_DATA , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 4 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_COMMIT_OBJECT -// This command is sent when a client has finished sending all the data associated with an object creation or update request, and wishes to ensure that the object is saved to the device. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_ID -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_COMMIT_OBJECT , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 5 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_REVERT_OBJECT -// This command is sent when a client wants to cancel the object creation or update request that is currently still in progress. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_REVERT_OBJECT , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 6 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_DELETE_OBJECTS -// This command is sent when the client wishes to remove a set of objects from the device. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_OPTIONS -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_IDS -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_DELETE_OBJECTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 7 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_MOVE_OBJECTS -// This command will move the specified objects to the destination folder. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_IDS -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_DESTINATION_FOLDER_OBJECT_ID -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_MOVE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_MOVE_OBJECTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 8 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_COPY_OBJECTS -// This command will copy the specified objects to the destination folder. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_IDS -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_DESTINATION_FOLDER_OBJECT_ID -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_COPY_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_COPY_OBJECTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 9 ); -// -// WPD_COMMAND_OBJECT_MANAGEMENT_UPDATE_OBJECT_WITH_PROPERTIES_AND_DATA -// This command is sent when a client wants to update the object's data and dependent properties simultaneously. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_ID -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_UPDATE_PROPERTIES -// Results: -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -// [ Required ] WPD_PROPERTY_OBJECT_MANAGEMENT_OPTIMAL_TRANSFER_BUFFER_SIZE -DEFINE_PROPERTYKEY( WPD_COMMAND_OBJECT_MANAGEMENT_UPDATE_OBJECT_WITH_PROPERTIES_AND_DATA , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 10 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_CREATION_PROPERTIES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which specifies the properties used to create the new object. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_CREATION_PROPERTIES , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1001 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT -// [ VT_LPWSTR ] This is a driver-specified identifier for the context associated with this 'create object' operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_CONTEXT , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1002 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_TO_WRITE -// [ VT_UI4 ] Specifies the number of bytes the client is requesting to write. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_TO_WRITE , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1003 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_WRITTEN -// [ VT_UI4 ] Indicates the number of bytes written for the object. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_NUM_BYTES_WRITTEN , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1004 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_DATA -// [ VT_VECTOR|VT_UI1 ] Indicates binary data of the object being created on the device. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_DATA , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1005 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_ID -// [ VT_LPWSTR ] Identifies a newly created object on the device. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_ID , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1006 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_OPTIONS -// [ VT_UI4 ] Indicates if the delete operation should be recursive or not. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_OPTIONS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1007 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_OPTIMAL_TRANSFER_BUFFER_SIZE -// [ VT_UI4 ] Indicates the optimal transfer buffer size (in bytes) that clients should use when writing this object's data. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_OPTIMAL_TRANSFER_BUFFER_SIZE , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1008 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_IDS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_LPWSTR, containing the ObjectIDs to delete. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_IDS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1009 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_RESULTS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_ERROR, where each element is the HRESULT indicating the success or failure of the operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_DELETE_RESULTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1010 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_DESTINATION_FOLDER_OBJECT_ID -// [ VT_LPWSTR ] Indicates the destination folder for the move operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_DESTINATION_FOLDER_OBJECT_ID , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1011 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_MOVE_RESULTS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_ERROR, where each element is the HRESULT indicating the success or failure of the operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_MOVE_RESULTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1012 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_COPY_RESULTS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of type VT_ERROR, where each element is the HRESULT indicating the success or failure of the operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_COPY_RESULTS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1013 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_UPDATE_PROPERTIES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the object properties to update. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_UPDATE_PROPERTIES , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1014 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_PROPERTY_KEYS -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing the property keys required to update this object. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_PROPERTY_KEYS , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1015 ); -// -// WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_FORMAT -// [ VT_CLSID ] Indicates the object format the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_OBJECT_MANAGEMENT_OBJECT_FORMAT , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 1016 ); - -// ======== Command Options ======== - -// -// WPD_OPTION_OBJECT_MANAGEMENT_RECURSIVE_DELETE_SUPPORTED -// [ VT_BOOL ] Indicates whether the driver supports recursive deletion. -DEFINE_PROPERTYKEY( WPD_OPTION_OBJECT_MANAGEMENT_RECURSIVE_DELETE_SUPPORTED , 0xEF1E43DD, 0xA9ED, 0x4341, 0x8B, 0xCC, 0x18, 0x61, 0x92, 0xAE, 0xA0, 0x89 , 5001 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_CAPABILITIES -* -* This command category is used to query capabilities of the device. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_CAPABILITIES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS -// Return all commands supported by this driver. This includes custom commands, if any. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_SUPPORTED_COMMANDS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 2 ); -// -// WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONS -// Returns the supported options for the specified command. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_COMMAND -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_COMMAND_OPTIONS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 3 ); -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIES -// This command is used by clients to query the functional categories supported by the driver. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORIES -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 4 ); -// -// WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTS -// Retrieves the ObjectIDs of the objects belonging to the specified functional category. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORY -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_OBJECTS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 5 ); -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES -// Retrieves the list of content types supported by this driver for the specified functional category. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORY -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_CONTENT_TYPES -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 6 ); -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATS -// This command is used to query the possible formats supported by the specified content type (e.g. for image objects, the driver may choose to support JPEG and BMP files). -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_CONTENT_TYPE -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FORMATS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 7 ); -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES -// Get the list of properties that an object of the given format supports. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FORMAT -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_PROPERTY_KEYS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 8 ); -// -// WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTES -// Returns the property attributes that are the same for all objects of the given format. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_FORMAT -// [ Required ] WPD_PROPERTY_CAPABILITIES_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_PROPERTY_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 9 ); -// -// WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTS -// Return all events supported by this driver. This includes custom events, if any. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_SUPPORTED_EVENTS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 10 ); -// -// WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONS -// Return extra information about a specified event, such as whether the event is for notification or action purposes. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_CAPABILITIES_EVENT -// Results: -// [ Required ] WPD_PROPERTY_CAPABILITIES_EVENT_OPTIONS -DEFINE_PROPERTYKEY( WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 11 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_CAPABILITIES_SUPPORTED_COMMANDS -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing all commands a driver supports. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_SUPPORTED_COMMANDS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1001 ); -// -// WPD_PROPERTY_CAPABILITIES_COMMAND -// [ VT_UNKNOWN ] Indicates the command whose options the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_COMMAND , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1002 ); -// -// WPD_PROPERTY_CAPABILITIES_COMMAND_OPTIONS -// [ VT_UNKNOWN ] Contains an IPortableDeviceValues with the relevant command options. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_COMMAND_OPTIONS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1003 ); -// -// WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORIES -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of type VT_CLSID which indicates the functional categories supported by the driver. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORIES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1004 ); -// -// WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORY -// [ VT_CLSID ] The category the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_CATEGORY , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1005 ); -// -// WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_OBJECTS -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection (of type VT_LPWSTR) containing the ObjectIDs of the functional objects who belong to the specified functional category. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_FUNCTIONAL_OBJECTS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1006 ); -// -// WPD_PROPERTY_CAPABILITIES_CONTENT_TYPES -// [ VT_UNKNOWN ] Indicates list of content types supported for the specified functional category. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_CONTENT_TYPES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1007 ); -// -// WPD_PROPERTY_CAPABILITIES_CONTENT_TYPE -// [ VT_CLSID ] Indicates the content type whose formats the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_CONTENT_TYPE , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1008 ); -// -// WPD_PROPERTY_CAPABILITIES_FORMATS -// [ VT_UNKNOWN ] An IPortableDevicePropVariantCollection of VT_CLSID values indicating the formats supported for the specified content type. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_FORMATS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1009 ); -// -// WPD_PROPERTY_CAPABILITIES_FORMAT -// [ VT_CLSID ] Specifies the format the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_FORMAT , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1010 ); -// -// WPD_PROPERTY_CAPABILITIES_PROPERTY_KEYS -// [ VT_UNKNOWN ] An IPortableDeviceKeyCollection containing the property keys. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_PROPERTY_KEYS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1011 ); -// -// WPD_PROPERTY_CAPABILITIES_PROPERTY_ATTRIBUTES -// [ VT_UNKNOWN ] An IPortableDeviceValues containing the property attributes. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_PROPERTY_ATTRIBUTES , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1012 ); -// -// WPD_PROPERTY_CAPABILITIES_SUPPORTED_EVENTS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection of VT_CLSID values containing all events a driver supports. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_SUPPORTED_EVENTS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1013 ); -// -// WPD_PROPERTY_CAPABILITIES_EVENT -// [ VT_CLSID ] Indicates the event the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_EVENT , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1014 ); -// -// WPD_PROPERTY_CAPABILITIES_EVENT_OPTIONS -// [ VT_UNKNOWN ] Contains an IPortableDeviceValues with the relevant event options. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CAPABILITIES_EVENT_OPTIONS , 0x0CABEC78, 0x6B74, 0x41C6, 0x92, 0x16, 0x26, 0x39, 0xD1, 0xFC, 0xE3, 0x56 , 1015 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CLASS_EXTENSION_V1 -* -* The commands in this category relate to the WPD device class extension. -****************************************************************************/ -DEFINE_GUID( WPD_CLASS_EXTENSION_V1 , 0x33FB0D11, 0x64A3, 0x4FAC, 0xB4, 0xC7, 0x3D, 0xFE, 0xAA, 0x99, 0xB0, 0x51 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_CLASS_EXTENSION_WRITE_DEVICE_INFORMATION -// This command is used to update the a cache of device-specific information. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_VALUES -// Results: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_WRITE_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_CLASS_EXTENSION_WRITE_DEVICE_INFORMATION , 0x33FB0D11, 0x64A3, 0x4FAC, 0xB4, 0xC7, 0x3D, 0xFE, 0xAA, 0x99, 0xB0, 0x51 , 2 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_VALUES -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the values. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_VALUES , 0x33FB0D11, 0x64A3, 0x4FAC, 0xB4, 0xC7, 0x3D, 0xFE, 0xAA, 0x99, 0xB0, 0x51 , 1001 ); -// -// WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_WRITE_RESULTS -// [ VT_UNKNOWN ] This is an IPortableDeviceValues which contains the result of each value write operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CLASS_EXTENSION_DEVICE_INFORMATION_WRITE_RESULTS , 0x33FB0D11, 0x64A3, 0x4FAC, 0xB4, 0xC7, 0x3D, 0xFE, 0xAA, 0x99, 0xB0, 0x51 , 1002 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CLASS_EXTENSION_V2 -* -* The commands in this category relate to the WPD device class extension. -****************************************************************************/ -DEFINE_GUID( WPD_CLASS_EXTENSION_V2 , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_CLASS_EXTENSION_REGISTER_SERVICE_INTERFACES -// This command is used to register a service's Plug and Play interfaces. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_OBJECT_ID -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_INTERFACES -// Results: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_REGISTRATION_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_CLASS_EXTENSION_REGISTER_SERVICE_INTERFACES , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 , 2 ); -// -// WPD_COMMAND_CLASS_EXTENSION_UNREGISTER_SERVICE_INTERFACES -// This command is used to unregister a service's Plug and Play interfaces. -// Access: -// (FILE_READ_ACCESS | FILE_WRITE_ACCESS) -// Parameters: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_OBJECT_ID -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_INTERFACES -// Results: -// [ Required ] WPD_PROPERTY_CLASS_EXTENSION_SERVICE_REGISTRATION_RESULTS -DEFINE_PROPERTYKEY( WPD_COMMAND_CLASS_EXTENSION_UNREGISTER_SERVICE_INTERFACES , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 , 3 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_CLASS_EXTENSION_SERVICE_OBJECT_ID -// [ VT_LPWSTR ] The Object ID of the service. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CLASS_EXTENSION_SERVICE_OBJECT_ID , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 , 1001 ); -// -// WPD_PROPERTY_CLASS_EXTENSION_SERVICE_INTERFACES -// [ VT_UNKNOWN ] This is an IPortablePropVariantCollection of type VT_CLSID which contains the interface GUIDs that this service implements, including the service type GUID. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CLASS_EXTENSION_SERVICE_INTERFACES , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 , 1002 ); -// -// WPD_PROPERTY_CLASS_EXTENSION_SERVICE_REGISTRATION_RESULTS -// [ VT_UNKNOWN ] This is an IPortablePropVariantCollection of type VT_ERROR, where each element is the HRESULT indicating the success or failure of the operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_CLASS_EXTENSION_SERVICE_REGISTRATION_RESULTS , 0x7F0779B5, 0xFA2B, 0x4766, 0x9C, 0xB2, 0xF7, 0x3B, 0xA3, 0x0B, 0x67, 0x58 , 1003 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_SERVICE_COMMON -* -* The commands in this category relate to a device service. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_SERVICE_COMMON , 0x322F071D, 0x36EF, 0x477F, 0xB4, 0xB5, 0x6F, 0x52, 0xD7, 0x34, 0xBA, 0xEE ); - -// ======== Commands ======== - -// -// WPD_COMMAND_SERVICE_COMMON_GET_SERVICE_OBJECT_ID -// This command is used to get the service object identifier. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_OBJECT_ID -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_COMMON_GET_SERVICE_OBJECT_ID , 0x322F071D, 0x36EF, 0x477F, 0xB4, 0xB5, 0x6F, 0x52, 0xD7, 0x34, 0xBA, 0xEE , 2 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_SERVICE_OBJECT_ID -// [ VT_LPWSTR ] Contains the service object identifier. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_OBJECT_ID , 0x322F071D, 0x36EF, 0x477F, 0xB4, 0xB5, 0x6F, 0x52, 0xD7, 0x34, 0xBA, 0xEE , 1001 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_SERVICE_CAPABILITIES -* -* The commands in this category relate to capabilities of a device service. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_SERVICE_CAPABILITIES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 ); - -// ======== Commands ======== - -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS -// This command is used to get the methods that apply to a service. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_METHODS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 2 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS_BY_FORMAT -// This command is used to get the methods that apply to a format of a service. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_METHODS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS_BY_FORMAT , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 3 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_ATTRIBUTES -// This command is used to get the attributes of a method. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 4 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_PARAMETER_ATTRIBUTES -// This command is used to get the attributes of a parameter used in a method. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_PARAMETER_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 5 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATS -// This command is used to get formats supported by this service. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMATS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 6 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_ATTRIBUTES -// This command is used to get attributes of a format, such as the format name. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 7 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES -// This command is used to get supported properties of a format. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_KEYS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 8 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_PROPERTY_ATTRIBUTES -// This command is used to get the property attributes that are same for all objects of a given format on the service. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_KEYS -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_PROPERTY_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 9 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_EVENTS -// This command is used to get the supported events of the service. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_EVENTS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_EVENTS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 10 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_ATTRIBUTES -// This command is used to get the attributes of an event. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 11 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_PARAMETER_ATTRIBUTES -// This command is used to get the attributes of a parameter used in an event. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER_ATTRIBUTES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_PARAMETER_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 12 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_INHERITED_SERVICES -// This command is used to get the inherited services. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITANCE_TYPE -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITED_SERVICES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_INHERITED_SERVICES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 13 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_RENDERING_PROFILES -// This command is used to get the resource rendering profiles for a format. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_RENDERING_PROFILES -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_RENDERING_PROFILES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 14 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_COMMANDS -// Return all commands supported by this driver for a service. This includes custom commands, if any. -// Access: -// FILE_READ_ACCESS -// Parameters: -// None -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_COMMANDS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_COMMANDS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 15 ); -// -// WPD_COMMAND_SERVICE_CAPABILITIES_GET_COMMAND_OPTIONS -// Returns the supported options for the specified command. -// Access: -// FILE_READ_ACCESS -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND_OPTIONS -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_COMMAND_OPTIONS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 16 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_METHODS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection (of type VT_CLSID) containing methods that apply to a service. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_METHODS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1001 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT -// [ VT_CLSID ] Indicates the format the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1002 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD -// [ VT_CLSID ] Indicates the method the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1003 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD_ATTRIBUTES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the method attributes. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_METHOD_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1004 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing the parameter the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1005 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER_ATTRIBUTES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the parameter attributes. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_PARAMETER_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1006 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_FORMATS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection (of type VT_CLSID) containing the formats. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_FORMATS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1007 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT_ATTRIBUTES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the format attributes, such as the format name and MIME Type. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_FORMAT_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1008 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_KEYS -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing the supported property keys. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_KEYS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1009 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_ATTRIBUTES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the property attributes. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_PROPERTY_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1010 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_EVENTS -// [ VT_UNKNOWN ] IPortableDevicePropVariantCollection (of type VT_CLSID) containing all events supported by the service. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_EVENTS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1011 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT -// [ VT_CLSID ] Indicates the event the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1012 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT_ATTRIBUTES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the event attributes. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_EVENT_ATTRIBUTES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1013 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITANCE_TYPE -// [ VT_UI4 ] Indicates the inheritance type the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITANCE_TYPE , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1014 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITED_SERVICES -// [ VT_UNKNOWN ] Contains the list of inherited services. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_INHERITED_SERVICES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1015 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_RENDERING_PROFILES -// [ VT_UNKNOWN ] Contains the list of format rendering profiles. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_RENDERING_PROFILES , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1016 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_COMMANDS -// [ VT_UNKNOWN ] IPortableDeviceKeyCollection containing all commands a driver supports for a service. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_SUPPORTED_COMMANDS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1017 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND -// [ VT_UNKNOWN ] Indicates the command whose options the caller is interested in. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1018 ); -// -// WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND_OPTIONS -// [ VT_UNKNOWN ] Contains an IPortableDeviceValues with the relevant command options. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_CAPABILITIES_COMMAND_OPTIONS , 0x24457E74, 0x2E9F, 0x44F9, 0x8C, 0x57, 0x1D, 0x1B, 0xCB, 0x17, 0x0B, 0x89 , 1019 ); - -/**************************************************************************** -* This section defines all Commands, Parameters and Options associated with: -* WPD_CATEGORY_SERVICE_METHODS -* -* The commands in this category relate to methods of a device service. -****************************************************************************/ -DEFINE_GUID( WPD_CATEGORY_SERVICE_METHODS , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC ); - -// ======== Commands ======== - -// -// WPD_COMMAND_SERVICE_METHODS_START_INVOKE -// Invokes a service method. -// Access: -// Dependent on the value of WPD_METHOD_ATTRIBUTE_ACCESS. -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_METHOD -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_PARAMETER_VALUES -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_CONTEXT -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_METHODS_START_INVOKE , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 2 ); -// -// WPD_COMMAND_SERVICE_METHODS_CANCEL_INVOKE -// This command is sent when a client wants to cancel a method that is currently still in progress. -// Access: -// Dependent on the value of WPD_METHOD_ATTRIBUTE_ACCESS. -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_CONTEXT -// Results: -// None -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_METHODS_CANCEL_INVOKE , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 3 ); -// -// WPD_COMMAND_SERVICE_METHODS_END_INVOKE -// This command is sent in response to a WPD_EVENT_SERVICE_METHOD_COMPLETE event from the driver to retrieve the method results. -// Access: -// Dependent on the value of WPD_METHOD_ATTRIBUTE_ACCESS. -// Parameters: -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_CONTEXT -// Results: -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_RESULT_VALUES -// [ Required ] WPD_PROPERTY_SERVICE_METHOD_HRESULT -DEFINE_PROPERTYKEY( WPD_COMMAND_SERVICE_METHODS_END_INVOKE , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 4 ); - -// ======== Command Parameters ======== - -// -// WPD_PROPERTY_SERVICE_METHOD -// [ VT_CLSID ] Indicates the method to invoke. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_METHOD , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 1001 ); -// -// WPD_PROPERTY_SERVICE_METHOD_PARAMETER_VALUES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the method parameters. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_METHOD_PARAMETER_VALUES , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 1002 ); -// -// WPD_PROPERTY_SERVICE_METHOD_RESULT_VALUES -// [ VT_UNKNOWN ] IPortableDeviceValues containing the method results. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_METHOD_RESULT_VALUES , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 1003 ); -// -// WPD_PROPERTY_SERVICE_METHOD_CONTEXT -// [ VT_LPWSTR ] The unique context identifying this method operation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_METHOD_CONTEXT , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 1004 ); -// -// WPD_PROPERTY_SERVICE_METHOD_HRESULT -// [ VT_ERROR ] Contains the status HRESULT of this method invocation. -DEFINE_PROPERTYKEY( WPD_PROPERTY_SERVICE_METHOD_HRESULT , 0x2D521CA8,0xC1B0, 0x4268, 0xA3, 0x42, 0xCF, 0x19, 0x32, 0x15, 0x69, 0xBC , 1005 ); - -/**************************************************************************** -* This section defines Structures and Macros used by driver writers to -* simplify Wpd Command Access checks. -* Sample Usage: -* -* - Add table used to lookup the Access required for Wpd Commands -* BEGIN_WPD_COMMAND_ACCESS_MAP(g_WpdCommandAccessMap) -* DECLARE_WPD_STANDARD_COMMAND_ACCESS_ENTRIES -* - Add any custom commands here e.g. -* WPD_COMMAND_ACCESS_ENTRY(MyCustomCommand, WPD_COMMAND_ACCESS_READWRITE) -* END_WPD_COMMAND_ACCESS_MAP -* - This enables the driver to use VERIFY_WPD_COMMAND_ACCESS to check command access function for us. -* DECLARE_VERIFY_WPD_COMMAND_ACCESS; -* ... -* - When the driver receives a WPD IOCTL, it can check that the IOCTL specified matches -* the command payload with: -* hr = VERIFY_WPD_COMMAND_ACCESS(ControlCode, pParams, g_WpdCommandAccessMap); -****************************************************************************/ - -// Structure used as an entry in the Command / Access lookup table. -typedef struct tagWPD_COMMAND_ACCESS_LOOKUP_ENTRY -{ - PROPERTYKEY Command; - DWORD AccessType; - PROPERTYKEY AccessProperty; -} WPD_COMMAND_ACCESS_LOOKUP_ENTRY; - -// Used to start a declaration of a WPD Command Access Lookup Map. This macro is usually followed by: -// DECLARE_WPD_STANDARD_COMMAND_ACCESS_ENTRIES -// Zero or more WPD_COMMAND_ACCESS_ENTRY or WPD_COMMAND_ACCESS_PROPERTY_ENTRY macros (one for every custom command). -// The Map is ended with END_WPD_COMMAND_ACCESS_MAP. -#define BEGIN_WPD_COMMAND_ACCESS_MAP(x) static WPD_COMMAND_ACCESS_LOOKUP_ENTRY x[] = { - -// Ends a WPD Command Access Lookup Map started with BEGIN_WPD_COMMAND_ACCESS_MAP -#define END_WPD_COMMAND_ACCESS_MAP { WPD_PROPERTY_NULL, 0, WPD_PROPERTY_NULL }, }; - -// Adds a custom entry to a WPD Command Access Lookup Map started with BEGIN_WPD_COMMAND_ACCESS_MAP -#define WPD_COMMAND_ACCESS_ENTRY(WpdCommand, WpdCommandAccessType) { WpdCommand, WpdCommandAccessType, WPD_PROPERTY_NULL }, - -// Adds a custom entry to a WPD Command Access Lookup Map started with BEGIN_WPD_COMMAND_ACCESS_MAP -#define WPD_COMMAND_ACCESS_PROPERTY_ENTRY(WpdCommand, WpdCommandAccessType, WpdAccessProperty) { WpdCommand, WpdCommandAccessType, WpdAccessProperty }, - -#ifdef WPD_SERVICES_STRICT -#define DECLARE_WPD_LEGACY_COMMAND_ACCESS_ENTRIES -#else -#define DECLARE_WPD_LEGACY_COMMAND_ACCESS_ENTRIES \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_STORAGE_FORMAT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_STORAGE_EJECT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SMS_SEND, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_MEDIA_CAPTURE_START, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_MEDIA_CAPTURE_STOP, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_MEDIA_CAPTURE_PAUSE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_DEVICE_HINTS_GET_CONTENT_LOCATION, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_GENERATE_KEYPAIR, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_COMMIT_KEYPAIR, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_PROCESS_WIRELESS_PROFILE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - -#endif // WPD_SERVICES_STRICT - -// Declares entries for all the WPD Commands contained in this header file. Used after BEGIN_WPD_COMMAND_ACCESS_MAP. -#define DECLARE_WPD_STANDARD_COMMAND_ACCESS_ENTRIES \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_COMMON_RESET_DEVICE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_COMMON_GET_OBJECT_IDS_FROM_PERSISTENT_UNIQUE_IDS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_COMMON_SAVE_CLIENT_INFORMATION, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_ENUMERATION_START_FIND, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_ENUMERATION_FIND_NEXT, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_ENUMERATION_END_FIND, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_GET_SUPPORTED, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_GET_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_GET, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_SET, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_GET_ALL, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_DELETE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_START, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_NEXT, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_LIST_END, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_START, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_NEXT, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_GET_VALUES_BY_OBJECT_FORMAT_END, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_START, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_NEXT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_PROPERTIES_BULK_SET_VALUES_BY_OBJECT_LIST_END, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_GET_SUPPORTED, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_GET_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_OPEN, WPD_COMMAND_ACCESS_FROM_PROPERTY_WITH_STGM_ACCESS, WPD_PROPERTY_OBJECT_RESOURCES_ACCESS_MODE ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_READ, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_WRITE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_CLOSE, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_DELETE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_CREATE_RESOURCE, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_REVERT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_RESOURCES_SEEK, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_ONLY, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_CREATE_OBJECT_WITH_PROPERTIES_AND_DATA, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_WRITE_OBJECT_DATA, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_COMMIT_OBJECT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_REVERT_OBJECT, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_DELETE_OBJECTS, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_MOVE_OBJECTS, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_COPY_OBJECTS, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_OBJECT_MANAGEMENT_UPDATE_OBJECT_WITH_PROPERTIES_AND_DATA, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_COMMAND_OPTIONS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FUNCTIONAL_CATEGORIES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_FUNCTIONAL_OBJECTS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_CONTENT_TYPES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMATS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_FIXED_PROPERTY_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_EVENTS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CAPABILITIES_GET_EVENT_OPTIONS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CLASS_EXTENSION_WRITE_DEVICE_INFORMATION, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CLASS_EXTENSION_REGISTER_SERVICE_INTERFACES, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_CLASS_EXTENSION_UNREGISTER_SERVICE_INTERFACES, WPD_COMMAND_ACCESS_READWRITE, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_COMMON_GET_SERVICE_OBJECT_ID, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_METHODS_BY_FORMAT, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_METHOD_PARAMETER_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMATS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_FORMAT_PROPERTIES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_PROPERTY_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_EVENTS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_EVENT_PARAMETER_ATTRIBUTES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_INHERITED_SERVICES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_FORMAT_RENDERING_PROFILES, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_SUPPORTED_COMMANDS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_CAPABILITIES_GET_COMMAND_OPTIONS, WPD_COMMAND_ACCESS_READ, WPD_PROPERTY_NULL ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_METHODS_START_INVOKE, WPD_COMMAND_ACCESS_FROM_ATTRIBUTE_WITH_METHOD_ACCESS, WPD_METHOD_ATTRIBUTE_ACCESS ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_METHODS_CANCEL_INVOKE, WPD_COMMAND_ACCESS_FROM_ATTRIBUTE_WITH_METHOD_ACCESS, WPD_METHOD_ATTRIBUTE_ACCESS ) \ - WPD_COMMAND_ACCESS_PROPERTY_ENTRY( WPD_COMMAND_SERVICE_METHODS_END_INVOKE, WPD_COMMAND_ACCESS_FROM_ATTRIBUTE_WITH_METHOD_ACCESS, WPD_METHOD_ATTRIBUTE_ACCESS ) \ - DECLARE_WPD_LEGACY_COMMAND_ACCESS_ENTRIES - - -// Declares an instance of the function used to check whether a WPD Command is in the driver's WPD Command Access Map. -// Driver writers should not call this function directly, but should instead use the IS_COMMAND_IN_WPD_COMMAND_ACCESS_MAP alias. -#define DECLARE_IS_COMMAND_IN_WPD_COMMAND_ACCESS_MAP() \ -BOOL IsCommandInWpdCommandAccessMap( \ - REFPROPERTYKEY WpdCommand, \ - __in WPD_COMMAND_ACCESS_LOOKUP_ENTRY *pCommandAccessLookupMap) \ -{ \ - BOOL bRet = FALSE; \ - if(pCommandParams == NULL) \ - { \ - return E_POINTER; \ - } \ - while(pCommandAccessLookupMap[dwMapIndex++].Command != WPD_PROPERTY_NULL) \ - { \ - if(IsEqualPropertyKey(pCommandAccessLookupMap[dwMapIndex].Command), WpdCommand) \ - { \ - bRet = TRUE; \ - break; \ - } \ - dwMapIndex++; \ - } \ - return bRet; \ -}; - -// This macro is an alias for the function used to check whether a WPD Command is in the driver's WPD Command Access Map (see BEGIN_WPD_COMMAND_ACCESS_MAP) -#define IS_COMMAND_IN_WPD_COMMAND_ACCESS_MAP IsCommandInWpdCommandAccessMap - - -// Declares an instance of the function used to verify that WPD Commands are sent with the appropriate Access Flags in the IOCTL. -// Driver writers should not call this function directly, but should instead use the VERIFY_WPD_COMMAND_ACCESS alias. -#define DECLARE_VERIFY_WPD_COMMAND_ACCESS \ -HRESULT VerifyWpdCommandAccessFromMap( \ - const DWORD ControlCode, \ - __in IPortableDeviceValues *pCommandParams, \ - __in WPD_COMMAND_ACCESS_LOOKUP_ENTRY *pCommandAccessLookupMap) \ -{ \ - HRESULT hr = S_OK; \ - DWORD dwMapIndex = 0; \ - PROPERTYKEY WpdCommand = WPD_PROPERTY_NULL; \ - DWORD dwExpectedControlCode = IOCTL_WPD_MESSAGE_READWRITE_ACCESS; \ - if((pCommandParams == NULL) || (pCommandAccessLookupMap == NULL)) \ - { \ - return E_POINTER; \ - } \ - if(ControlCode == IOCTL_WPD_MESSAGE_READWRITE_ACCESS) \ - { \ - return S_OK; \ - } \ - hr = pCommandParams->GetGuidValue(WPD_PROPERTY_COMMON_COMMAND_CATEGORY, &WpdCommand.fmtid); \ - if(SUCCEEDED(hr)) \ - { \ - hr = pCommandParams->GetUnsignedIntegerValue(WPD_PROPERTY_COMMON_COMMAND_ID, &WpdCommand.pid); \ - if(SUCCEEDED(hr)) \ - { \ - while(!IsEqualPropertyKey(pCommandAccessLookupMap[dwMapIndex].Command, WPD_PROPERTY_NULL)) \ - { \ - if(IsEqualPropertyKey(pCommandAccessLookupMap[dwMapIndex].Command, WpdCommand)) \ - { \ - switch(pCommandAccessLookupMap[dwMapIndex].AccessType) \ - { \ - case WPD_COMMAND_ACCESS_READ: \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READ_ACCESS; \ - } \ - break; \ - case WPD_COMMAND_ACCESS_READWRITE: \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READWRITE_ACCESS; \ - } \ - break; \ - case WPD_COMMAND_ACCESS_FROM_PROPERTY_WITH_STGM_ACCESS: \ - { \ - DWORD dwAccessPropVal = STGM_READWRITE; \ - HRESULT hrTemp = S_OK; \ - hrTemp = pCommandParams->GetUnsignedIntegerValue(pCommandAccessLookupMap[dwMapIndex].AccessProperty, &dwAccessPropVal); \ - if(dwAccessPropVal == STGM_READ) \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READ_ACCESS; \ - } \ - else \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READWRITE_ACCESS; \ - } \ - } \ - break; \ - case WPD_COMMAND_ACCESS_FROM_PROPERTY_WITH_FILE_ACCESS: \ - { \ - DWORD dwAccessPropVal = FILE_READ_ACCESS; \ - HRESULT hrTemp = S_OK; \ - hrTemp = pCommandParams->GetUnsignedIntegerValue(pCommandAccessLookupMap[dwMapIndex].AccessProperty, &dwAccessPropVal); \ - if(dwAccessPropVal == FILE_READ_ACCESS) \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READ_ACCESS; \ - } \ - else \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READWRITE_ACCESS; \ - } \ - } \ - break; \ - default: \ - { \ - dwExpectedControlCode = IOCTL_WPD_MESSAGE_READWRITE_ACCESS; \ - } \ - break; \ - } \ - break; \ - } \ - dwMapIndex++; \ - } \ - } \ - } \ - if(SUCCEEDED(hr)) \ - { \ - if(ControlCode != dwExpectedControlCode) \ - { \ - return E_INVALIDARG; \ - } \ - } \ - return hr; \ -}; - -// This macro is an alias for the function used to verify that WPD Commands are sent with the appropriate Access Flags in the IOCTL -#define VERIFY_WPD_COMMAND_ACCESS VerifyWpdCommandAccessFromMap - -/**************************************************************************** -* This section defines the inline helper functions -****************************************************************************/ - -// This function can be used after IPortableDeviceManager::GetDevices(..) and IPortableDeviceServiceManager::GetDeviceServices(..) -// to free the elements of the pPnPIDs array. The caller is responsible for freeing pPnPIDs when this function completes. -inline void FreePortableDevicePnPIDs(__in_ecount(cPnPIDs) LPWSTR* pPnPIDs, DWORD cPnPIDs) -{ - if (pPnPIDs != NULL) - { - for (DWORD i=0; i= NTDDI_WINXPSP2 && NTDDI_VERSION < NTDDI_WS03) || (NTDDI_VERSION >= NTDDI_WINLH)) - diff --git a/qt-correction-tool/pub/ddk/portabledeviceclassextension.h b/qt-correction-tool/pub/ddk/portabledeviceclassextension.h deleted file mode 100644 index 7cdc320..0000000 --- a/qt-correction-tool/pub/ddk/portabledeviceclassextension.h +++ /dev/null @@ -1,229 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for PortableDeviceClassExtension.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __PortableDeviceClassExtension_h__ -#define __PortableDeviceClassExtension_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IPortableDeviceClassExtension_FWD_DEFINED__ -#define __IPortableDeviceClassExtension_FWD_DEFINED__ -typedef interface IPortableDeviceClassExtension IPortableDeviceClassExtension; -#endif /* __IPortableDeviceClassExtension_FWD_DEFINED__ */ - - -#ifndef __PortableDeviceClassExtension_FWD_DEFINED__ -#define __PortableDeviceClassExtension_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PortableDeviceClassExtension PortableDeviceClassExtension; -#else -typedef struct PortableDeviceClassExtension PortableDeviceClassExtension; -#endif /* __cplusplus */ - -#endif /* __PortableDeviceClassExtension_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "propidl.h" -#include "PortableDeviceTypes.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_PortableDeviceClassExtension_0000_0000 */ -/* [local] */ - -#if (_WIN32_WINNT >= 0x0501) // XP and later - - -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceClassExtension_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceClassExtension_0000_0000_v0_0_s_ifspec; - -#ifndef __IPortableDeviceClassExtension_INTERFACE_DEFINED__ -#define __IPortableDeviceClassExtension_INTERFACE_DEFINED__ - -/* interface IPortableDeviceClassExtension */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPortableDeviceClassExtension; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("bc08386a-9952-40cd-ba50-9541d64a4b4e") - IPortableDeviceClassExtension : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Initialize( - __RPC__in_opt IUnknown *pWdfDeviceUnknown, - __RPC__in_opt IPortableDeviceValues *pOptions) = 0; - - virtual HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ProcessLibraryMessage( - __RPC__in_opt IPortableDeviceValues *pParams, - __RPC__in_opt IPortableDeviceValues *pResults) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPortableDeviceClassExtensionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IPortableDeviceClassExtension * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IPortableDeviceClassExtension * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IPortableDeviceClassExtension * This); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - __RPC__in IPortableDeviceClassExtension * This, - __RPC__in_opt IUnknown *pWdfDeviceUnknown, - __RPC__in_opt IPortableDeviceValues *pOptions); - - HRESULT ( STDMETHODCALLTYPE *Uninitialize )( - __RPC__in IPortableDeviceClassExtension * This); - - HRESULT ( STDMETHODCALLTYPE *ProcessLibraryMessage )( - __RPC__in IPortableDeviceClassExtension * This, - __RPC__in_opt IPortableDeviceValues *pParams, - __RPC__in_opt IPortableDeviceValues *pResults); - - END_INTERFACE - } IPortableDeviceClassExtensionVtbl; - - interface IPortableDeviceClassExtension - { - CONST_VTBL struct IPortableDeviceClassExtensionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPortableDeviceClassExtension_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPortableDeviceClassExtension_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPortableDeviceClassExtension_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPortableDeviceClassExtension_Initialize(This,pWdfDeviceUnknown,pOptions) \ - ( (This)->lpVtbl -> Initialize(This,pWdfDeviceUnknown,pOptions) ) - -#define IPortableDeviceClassExtension_Uninitialize(This) \ - ( (This)->lpVtbl -> Uninitialize(This) ) - -#define IPortableDeviceClassExtension_ProcessLibraryMessage(This,pParams,pResults) \ - ( (This)->lpVtbl -> ProcessLibraryMessage(This,pParams,pResults) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPortableDeviceClassExtension_INTERFACE_DEFINED__ */ - - - -#ifndef __PortableDeviceClassExtension_LIBRARY_DEFINED__ -#define __PortableDeviceClassExtension_LIBRARY_DEFINED__ - -/* library PortableDeviceClassExtension */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_PortableDeviceClassExtension; - -EXTERN_C const CLSID CLSID_PortableDeviceClassExtension; - -#ifdef __cplusplus - -class DECLSPEC_UUID("4cadfae1-5512-456a-9d65-5b5e7e9ca9a3") -PortableDeviceClassExtension; -#endif -#endif /* __PortableDeviceClassExtension_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_PortableDeviceClassExtension_0000_0001 */ -/* [local] */ - -#endif // (_WIN32_WINNT >= 0x0501) - - -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceClassExtension_0000_0001_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceClassExtension_0000_0001_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/portabledeviceclassextension.idl b/qt-correction-tool/pub/ddk/portabledeviceclassextension.idl deleted file mode 100644 index 8df8eaf..0000000 --- a/qt-correction-tool/pub/ddk/portabledeviceclassextension.idl +++ /dev/null @@ -1,66 +0,0 @@ -//----------------------------------------------------------------------------- -// -// @module PortableDeviceClassExtension.idl -// -// @abstract This file contains help interface desc for drivers installed under -// the Portable Device Class. -// -// @copyright (C) COPYRIGHT MICROSOFT CORPORATION -// -//----------------------------------------------------------------------------- - -cpp_quote("#if (_WIN32_WINNT >= 0x0501) // XP and later") - -import "oaidl.idl"; -import "ocidl.idl"; -import "propidl.idl"; -import "wtypes.idl"; - -import "PortableDeviceTypes.idl"; - -/////////////////////////////////////////////////////////// -// IWpdSerializer -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - object, - uuid(bc08386a-9952-40cd-ba50-9541d64a4b4e), - helpstring("IPortableDeviceDriverLibrary Interface"), - pointer_default(unique) -] -interface IPortableDeviceClassExtension : IUnknown -{ - HRESULT Initialize(IUnknown* pWdfDeviceUnknown, IPortableDeviceValues* pOptions); - HRESULT Uninitialize(); - HRESULT ProcessLibraryMessage(IPortableDeviceValues* pParams, IPortableDeviceValues* pResults); -}; - -/////////////////////////////////////////////////////////// -// PortableDeviceClassExtension -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - uuid(c0ffa723-ff4c-4983-8565-66d78e73036e), - version(1.0), - helpstring("PortableDeviceClassExtension 1.0 Type Library") -] -library PortableDeviceClassExtension -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(4cadfae1-5512-456a-9d65-5b5e7e9ca9a3), - helpstring("PortableDeviceClassExtension Class") - ] - coclass PortableDeviceClassExtension - { - [default] interface IPortableDeviceClassExtension; - }; - -}; - -cpp_quote("#endif // (_WIN32_WINNT >= 0x0501)") - diff --git a/qt-correction-tool/pub/ddk/portabledevicetypes.h b/qt-correction-tool/pub/ddk/portabledevicetypes.h deleted file mode 100644 index afdb66b..0000000 --- a/qt-correction-tool/pub/ddk/portabledevicetypes.h +++ /dev/null @@ -1,1301 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for PortableDeviceTypes.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __PortableDeviceTypes_h__ -#define __PortableDeviceTypes_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IWpdSerializer_FWD_DEFINED__ -#define __IWpdSerializer_FWD_DEFINED__ -typedef interface IWpdSerializer IWpdSerializer; -#endif /* __IWpdSerializer_FWD_DEFINED__ */ - - -#ifndef __IPortableDeviceValues_FWD_DEFINED__ -#define __IPortableDeviceValues_FWD_DEFINED__ -typedef interface IPortableDeviceValues IPortableDeviceValues; -#endif /* __IPortableDeviceValues_FWD_DEFINED__ */ - - -#ifndef __IPortableDeviceKeyCollection_FWD_DEFINED__ -#define __IPortableDeviceKeyCollection_FWD_DEFINED__ -typedef interface IPortableDeviceKeyCollection IPortableDeviceKeyCollection; -#endif /* __IPortableDeviceKeyCollection_FWD_DEFINED__ */ - - -#ifndef __IPortableDevicePropVariantCollection_FWD_DEFINED__ -#define __IPortableDevicePropVariantCollection_FWD_DEFINED__ -typedef interface IPortableDevicePropVariantCollection IPortableDevicePropVariantCollection; -#endif /* __IPortableDevicePropVariantCollection_FWD_DEFINED__ */ - - -#ifndef __IPortableDeviceValuesCollection_FWD_DEFINED__ -#define __IPortableDeviceValuesCollection_FWD_DEFINED__ -typedef interface IPortableDeviceValuesCollection IPortableDeviceValuesCollection; -#endif /* __IPortableDeviceValuesCollection_FWD_DEFINED__ */ - - -#ifndef __WpdSerializer_FWD_DEFINED__ -#define __WpdSerializer_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WpdSerializer WpdSerializer; -#else -typedef struct WpdSerializer WpdSerializer; -#endif /* __cplusplus */ - -#endif /* __WpdSerializer_FWD_DEFINED__ */ - - -#ifndef __PortableDeviceValues_FWD_DEFINED__ -#define __PortableDeviceValues_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PortableDeviceValues PortableDeviceValues; -#else -typedef struct PortableDeviceValues PortableDeviceValues; -#endif /* __cplusplus */ - -#endif /* __PortableDeviceValues_FWD_DEFINED__ */ - - -#ifndef __PortableDeviceKeyCollection_FWD_DEFINED__ -#define __PortableDeviceKeyCollection_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PortableDeviceKeyCollection PortableDeviceKeyCollection; -#else -typedef struct PortableDeviceKeyCollection PortableDeviceKeyCollection; -#endif /* __cplusplus */ - -#endif /* __PortableDeviceKeyCollection_FWD_DEFINED__ */ - - -#ifndef __PortableDevicePropVariantCollection_FWD_DEFINED__ -#define __PortableDevicePropVariantCollection_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PortableDevicePropVariantCollection PortableDevicePropVariantCollection; -#else -typedef struct PortableDevicePropVariantCollection PortableDevicePropVariantCollection; -#endif /* __cplusplus */ - -#endif /* __PortableDevicePropVariantCollection_FWD_DEFINED__ */ - - -#ifndef __PortableDeviceValuesCollection_FWD_DEFINED__ -#define __PortableDeviceValuesCollection_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class PortableDeviceValuesCollection PortableDeviceValuesCollection; -#else -typedef struct PortableDeviceValuesCollection PortableDeviceValuesCollection; -#endif /* __cplusplus */ - -#endif /* __PortableDeviceValuesCollection_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "oaidl.h" -#include "ocidl.h" -#include "propsys.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_PortableDeviceTypes_0000_0000 */ -/* [local] */ - -#if (_WIN32_WINNT >= 0x0501) // XP and later - - - - - - - -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceTypes_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceTypes_0000_0000_v0_0_s_ifspec; - -#ifndef __IWpdSerializer_INTERFACE_DEFINED__ -#define __IWpdSerializer_INTERFACE_DEFINED__ - -/* interface IWpdSerializer */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWpdSerializer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("b32f4002-bb27-45ff-af4f-06631c1e8dad") - IWpdSerializer : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetIPortableDeviceValuesFromBuffer( - /* [size_is][in] */ __RPC__in_ecount_full(dwInputBufferLength) BYTE *pBuffer, - /* [in] */ DWORD dwInputBufferLength, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppParams) = 0; - - virtual HRESULT STDMETHODCALLTYPE WriteIPortableDeviceValuesToBuffer( - /* [in] */ DWORD dwOutputBufferLength, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pResults, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutputBufferLength, *pdwBytesWritten) BYTE *pBuffer, - /* [out] */ __RPC__out DWORD *pdwBytesWritten) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBufferFromIPortableDeviceValues( - /* [in] */ __RPC__in_opt IPortableDeviceValues *pSource, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pdwBufferSize) BYTE **ppBuffer, - /* [out] */ __RPC__out DWORD *pdwBufferSize) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSerializedSize( - /* [in] */ __RPC__in_opt IPortableDeviceValues *pSource, - /* [out] */ __RPC__out DWORD *pdwSize) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWpdSerializerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWpdSerializer * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWpdSerializer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWpdSerializer * This); - - HRESULT ( STDMETHODCALLTYPE *GetIPortableDeviceValuesFromBuffer )( - __RPC__in IWpdSerializer * This, - /* [size_is][in] */ __RPC__in_ecount_full(dwInputBufferLength) BYTE *pBuffer, - /* [in] */ DWORD dwInputBufferLength, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppParams); - - HRESULT ( STDMETHODCALLTYPE *WriteIPortableDeviceValuesToBuffer )( - __RPC__in IWpdSerializer * This, - /* [in] */ DWORD dwOutputBufferLength, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pResults, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutputBufferLength, *pdwBytesWritten) BYTE *pBuffer, - /* [out] */ __RPC__out DWORD *pdwBytesWritten); - - HRESULT ( STDMETHODCALLTYPE *GetBufferFromIPortableDeviceValues )( - __RPC__in IWpdSerializer * This, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pSource, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pdwBufferSize) BYTE **ppBuffer, - /* [out] */ __RPC__out DWORD *pdwBufferSize); - - HRESULT ( STDMETHODCALLTYPE *GetSerializedSize )( - __RPC__in IWpdSerializer * This, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pSource, - /* [out] */ __RPC__out DWORD *pdwSize); - - END_INTERFACE - } IWpdSerializerVtbl; - - interface IWpdSerializer - { - CONST_VTBL struct IWpdSerializerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWpdSerializer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWpdSerializer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWpdSerializer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWpdSerializer_GetIPortableDeviceValuesFromBuffer(This,pBuffer,dwInputBufferLength,ppParams) \ - ( (This)->lpVtbl -> GetIPortableDeviceValuesFromBuffer(This,pBuffer,dwInputBufferLength,ppParams) ) - -#define IWpdSerializer_WriteIPortableDeviceValuesToBuffer(This,dwOutputBufferLength,pResults,pBuffer,pdwBytesWritten) \ - ( (This)->lpVtbl -> WriteIPortableDeviceValuesToBuffer(This,dwOutputBufferLength,pResults,pBuffer,pdwBytesWritten) ) - -#define IWpdSerializer_GetBufferFromIPortableDeviceValues(This,pSource,ppBuffer,pdwBufferSize) \ - ( (This)->lpVtbl -> GetBufferFromIPortableDeviceValues(This,pSource,ppBuffer,pdwBufferSize) ) - -#define IWpdSerializer_GetSerializedSize(This,pSource,pdwSize) \ - ( (This)->lpVtbl -> GetSerializedSize(This,pSource,pdwSize) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWpdSerializer_INTERFACE_DEFINED__ */ - - -#ifndef __IPortableDeviceValues_INTERFACE_DEFINED__ -#define __IPortableDeviceValues_INTERFACE_DEFINED__ - -/* interface IPortableDeviceValues */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPortableDeviceValues; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6848f6f2-3155-4f86-b6f5-263eeeab3143") - IPortableDeviceValues : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCount( - /* [in] */ __RPC__in DWORD *pcelt) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAt( - /* [in] */ const DWORD index, - /* [unique][out][in] */ __RPC__inout_opt PROPERTYKEY *pKey, - /* [unique][out][in] */ __RPC__inout_opt PROPVARIANT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in const PROPVARIANT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out PROPVARIANT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetStringValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in LPCWSTR Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetStringValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt LPWSTR *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetUnsignedIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const ULONG Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUnsignedIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out ULONG *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSignedIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const LONG Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSignedIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out LONG *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetUnsignedLargeIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const ULONGLONG Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetUnsignedLargeIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out ULONGLONG *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetSignedLargeIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const LONGLONG Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetSignedLargeIntegerValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out LONGLONG *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetFloatValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const FLOAT Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFloatValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out FLOAT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetErrorValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const HRESULT Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetErrorValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out HRESULT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetKeyValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in REFPROPERTYKEY Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetKeyValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out PROPERTYKEY *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBoolValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const BOOL Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBoolValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out BOOL *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIUnknownValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IUnknown *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIUnknownValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IUnknown **ppValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetGuidValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in REFGUID Value) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetGuidValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out GUID *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetBufferValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [size_is][in] */ __RPC__in_ecount_full(cbValue) BYTE *pValue, - /* [in] */ DWORD cbValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetBufferValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcbValue) BYTE **ppValue, - /* [out] */ __RPC__out DWORD *pcbValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIPortableDeviceValuesValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIPortableDeviceValuesValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIPortableDevicePropVariantCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDevicePropVariantCollection *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIPortableDevicePropVariantCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDevicePropVariantCollection **ppValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIPortableDeviceKeyCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIPortableDeviceKeyCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetIPortableDeviceValuesCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceValuesCollection *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetIPortableDeviceValuesCollectionValue( - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValuesCollection **ppValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveValue( - /* [in] */ __RPC__in REFPROPERTYKEY key) = 0; - - virtual HRESULT STDMETHODCALLTYPE CopyValuesFromPropertyStore( - /* [in] */ __RPC__in_opt IPropertyStore *pStore) = 0; - - virtual HRESULT STDMETHODCALLTYPE CopyValuesToPropertyStore( - /* [in] */ __RPC__in_opt IPropertyStore *pStore) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPortableDeviceValuesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IPortableDeviceValues * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IPortableDeviceValues * This); - - HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in DWORD *pcelt); - - HRESULT ( STDMETHODCALLTYPE *GetAt )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ const DWORD index, - /* [unique][out][in] */ __RPC__inout_opt PROPERTYKEY *pKey, - /* [unique][out][in] */ __RPC__inout_opt PROPVARIANT *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in const PROPVARIANT *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out PROPVARIANT *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetStringValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in LPCWSTR Value); - - HRESULT ( STDMETHODCALLTYPE *GetStringValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt LPWSTR *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetUnsignedIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const ULONG Value); - - HRESULT ( STDMETHODCALLTYPE *GetUnsignedIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out ULONG *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetSignedIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const LONG Value); - - HRESULT ( STDMETHODCALLTYPE *GetSignedIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out LONG *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetUnsignedLargeIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const ULONGLONG Value); - - HRESULT ( STDMETHODCALLTYPE *GetUnsignedLargeIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out ULONGLONG *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetSignedLargeIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const LONGLONG Value); - - HRESULT ( STDMETHODCALLTYPE *GetSignedLargeIntegerValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out LONGLONG *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetFloatValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const FLOAT Value); - - HRESULT ( STDMETHODCALLTYPE *GetFloatValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out FLOAT *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetErrorValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const HRESULT Value); - - HRESULT ( STDMETHODCALLTYPE *GetErrorValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out HRESULT *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetKeyValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in REFPROPERTYKEY Value); - - HRESULT ( STDMETHODCALLTYPE *GetKeyValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out PROPERTYKEY *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetBoolValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ const BOOL Value); - - HRESULT ( STDMETHODCALLTYPE *GetBoolValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out BOOL *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetIUnknownValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IUnknown *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetIUnknownValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IUnknown **ppValue); - - HRESULT ( STDMETHODCALLTYPE *SetGuidValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in REFGUID Value); - - HRESULT ( STDMETHODCALLTYPE *GetGuidValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__out GUID *pValue); - - HRESULT ( STDMETHODCALLTYPE *SetBufferValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [size_is][in] */ __RPC__in_ecount_full(cbValue) BYTE *pValue, - /* [in] */ DWORD cbValue); - - HRESULT ( STDMETHODCALLTYPE *GetBufferValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcbValue) BYTE **ppValue, - /* [out] */ __RPC__out DWORD *pcbValue); - - HRESULT ( STDMETHODCALLTYPE *SetIPortableDeviceValuesValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetIPortableDeviceValuesValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppValue); - - HRESULT ( STDMETHODCALLTYPE *SetIPortableDevicePropVariantCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDevicePropVariantCollection *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetIPortableDevicePropVariantCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDevicePropVariantCollection **ppValue); - - HRESULT ( STDMETHODCALLTYPE *SetIPortableDeviceKeyCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetIPortableDeviceKeyCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppValue); - - HRESULT ( STDMETHODCALLTYPE *SetIPortableDeviceValuesCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [in] */ __RPC__in_opt IPortableDeviceValuesCollection *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetIPortableDeviceValuesCollectionValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValuesCollection **ppValue); - - HRESULT ( STDMETHODCALLTYPE *RemoveValue )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in REFPROPERTYKEY key); - - HRESULT ( STDMETHODCALLTYPE *CopyValuesFromPropertyStore )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in_opt IPropertyStore *pStore); - - HRESULT ( STDMETHODCALLTYPE *CopyValuesToPropertyStore )( - __RPC__in IPortableDeviceValues * This, - /* [in] */ __RPC__in_opt IPropertyStore *pStore); - - HRESULT ( STDMETHODCALLTYPE *Clear )( - __RPC__in IPortableDeviceValues * This); - - END_INTERFACE - } IPortableDeviceValuesVtbl; - - interface IPortableDeviceValues - { - CONST_VTBL struct IPortableDeviceValuesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPortableDeviceValues_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPortableDeviceValues_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPortableDeviceValues_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPortableDeviceValues_GetCount(This,pcelt) \ - ( (This)->lpVtbl -> GetCount(This,pcelt) ) - -#define IPortableDeviceValues_GetAt(This,index,pKey,pValue) \ - ( (This)->lpVtbl -> GetAt(This,index,pKey,pValue) ) - -#define IPortableDeviceValues_SetValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetStringValue(This,key,Value) \ - ( (This)->lpVtbl -> SetStringValue(This,key,Value) ) - -#define IPortableDeviceValues_GetStringValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetStringValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetUnsignedIntegerValue(This,key,Value) \ - ( (This)->lpVtbl -> SetUnsignedIntegerValue(This,key,Value) ) - -#define IPortableDeviceValues_GetUnsignedIntegerValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetUnsignedIntegerValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetSignedIntegerValue(This,key,Value) \ - ( (This)->lpVtbl -> SetSignedIntegerValue(This,key,Value) ) - -#define IPortableDeviceValues_GetSignedIntegerValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetSignedIntegerValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetUnsignedLargeIntegerValue(This,key,Value) \ - ( (This)->lpVtbl -> SetUnsignedLargeIntegerValue(This,key,Value) ) - -#define IPortableDeviceValues_GetUnsignedLargeIntegerValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetUnsignedLargeIntegerValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetSignedLargeIntegerValue(This,key,Value) \ - ( (This)->lpVtbl -> SetSignedLargeIntegerValue(This,key,Value) ) - -#define IPortableDeviceValues_GetSignedLargeIntegerValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetSignedLargeIntegerValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetFloatValue(This,key,Value) \ - ( (This)->lpVtbl -> SetFloatValue(This,key,Value) ) - -#define IPortableDeviceValues_GetFloatValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetFloatValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetErrorValue(This,key,Value) \ - ( (This)->lpVtbl -> SetErrorValue(This,key,Value) ) - -#define IPortableDeviceValues_GetErrorValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetErrorValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetKeyValue(This,key,Value) \ - ( (This)->lpVtbl -> SetKeyValue(This,key,Value) ) - -#define IPortableDeviceValues_GetKeyValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetKeyValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetBoolValue(This,key,Value) \ - ( (This)->lpVtbl -> SetBoolValue(This,key,Value) ) - -#define IPortableDeviceValues_GetBoolValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetBoolValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetIUnknownValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetIUnknownValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetIUnknownValue(This,key,ppValue) \ - ( (This)->lpVtbl -> GetIUnknownValue(This,key,ppValue) ) - -#define IPortableDeviceValues_SetGuidValue(This,key,Value) \ - ( (This)->lpVtbl -> SetGuidValue(This,key,Value) ) - -#define IPortableDeviceValues_GetGuidValue(This,key,pValue) \ - ( (This)->lpVtbl -> GetGuidValue(This,key,pValue) ) - -#define IPortableDeviceValues_SetBufferValue(This,key,pValue,cbValue) \ - ( (This)->lpVtbl -> SetBufferValue(This,key,pValue,cbValue) ) - -#define IPortableDeviceValues_GetBufferValue(This,key,ppValue,pcbValue) \ - ( (This)->lpVtbl -> GetBufferValue(This,key,ppValue,pcbValue) ) - -#define IPortableDeviceValues_SetIPortableDeviceValuesValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetIPortableDeviceValuesValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetIPortableDeviceValuesValue(This,key,ppValue) \ - ( (This)->lpVtbl -> GetIPortableDeviceValuesValue(This,key,ppValue) ) - -#define IPortableDeviceValues_SetIPortableDevicePropVariantCollectionValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetIPortableDevicePropVariantCollectionValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetIPortableDevicePropVariantCollectionValue(This,key,ppValue) \ - ( (This)->lpVtbl -> GetIPortableDevicePropVariantCollectionValue(This,key,ppValue) ) - -#define IPortableDeviceValues_SetIPortableDeviceKeyCollectionValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetIPortableDeviceKeyCollectionValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetIPortableDeviceKeyCollectionValue(This,key,ppValue) \ - ( (This)->lpVtbl -> GetIPortableDeviceKeyCollectionValue(This,key,ppValue) ) - -#define IPortableDeviceValues_SetIPortableDeviceValuesCollectionValue(This,key,pValue) \ - ( (This)->lpVtbl -> SetIPortableDeviceValuesCollectionValue(This,key,pValue) ) - -#define IPortableDeviceValues_GetIPortableDeviceValuesCollectionValue(This,key,ppValue) \ - ( (This)->lpVtbl -> GetIPortableDeviceValuesCollectionValue(This,key,ppValue) ) - -#define IPortableDeviceValues_RemoveValue(This,key) \ - ( (This)->lpVtbl -> RemoveValue(This,key) ) - -#define IPortableDeviceValues_CopyValuesFromPropertyStore(This,pStore) \ - ( (This)->lpVtbl -> CopyValuesFromPropertyStore(This,pStore) ) - -#define IPortableDeviceValues_CopyValuesToPropertyStore(This,pStore) \ - ( (This)->lpVtbl -> CopyValuesToPropertyStore(This,pStore) ) - -#define IPortableDeviceValues_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPortableDeviceValues_INTERFACE_DEFINED__ */ - - -#ifndef __IPortableDeviceKeyCollection_INTERFACE_DEFINED__ -#define __IPortableDeviceKeyCollection_INTERFACE_DEFINED__ - -/* interface IPortableDeviceKeyCollection */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPortableDeviceKeyCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("dada2357-e0ad-492e-98db-dd61c53ba353") - IPortableDeviceKeyCollection : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCount( - /* [in] */ __RPC__in DWORD *pcElems) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAt( - /* [in] */ const DWORD dwIndex, - /* [in] */ __RPC__in PROPERTYKEY *pKey) = 0; - - virtual HRESULT STDMETHODCALLTYPE Add( - /* [in] */ __RPC__in REFPROPERTYKEY Key) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveAt( - /* [in] */ const DWORD dwIndex) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPortableDeviceKeyCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IPortableDeviceKeyCollection * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IPortableDeviceKeyCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IPortableDeviceKeyCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IPortableDeviceKeyCollection * This, - /* [in] */ __RPC__in DWORD *pcElems); - - HRESULT ( STDMETHODCALLTYPE *GetAt )( - __RPC__in IPortableDeviceKeyCollection * This, - /* [in] */ const DWORD dwIndex, - /* [in] */ __RPC__in PROPERTYKEY *pKey); - - HRESULT ( STDMETHODCALLTYPE *Add )( - __RPC__in IPortableDeviceKeyCollection * This, - /* [in] */ __RPC__in REFPROPERTYKEY Key); - - HRESULT ( STDMETHODCALLTYPE *Clear )( - __RPC__in IPortableDeviceKeyCollection * This); - - HRESULT ( STDMETHODCALLTYPE *RemoveAt )( - __RPC__in IPortableDeviceKeyCollection * This, - /* [in] */ const DWORD dwIndex); - - END_INTERFACE - } IPortableDeviceKeyCollectionVtbl; - - interface IPortableDeviceKeyCollection - { - CONST_VTBL struct IPortableDeviceKeyCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPortableDeviceKeyCollection_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPortableDeviceKeyCollection_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPortableDeviceKeyCollection_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPortableDeviceKeyCollection_GetCount(This,pcElems) \ - ( (This)->lpVtbl -> GetCount(This,pcElems) ) - -#define IPortableDeviceKeyCollection_GetAt(This,dwIndex,pKey) \ - ( (This)->lpVtbl -> GetAt(This,dwIndex,pKey) ) - -#define IPortableDeviceKeyCollection_Add(This,Key) \ - ( (This)->lpVtbl -> Add(This,Key) ) - -#define IPortableDeviceKeyCollection_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#define IPortableDeviceKeyCollection_RemoveAt(This,dwIndex) \ - ( (This)->lpVtbl -> RemoveAt(This,dwIndex) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPortableDeviceKeyCollection_INTERFACE_DEFINED__ */ - - -#ifndef __IPortableDevicePropVariantCollection_INTERFACE_DEFINED__ -#define __IPortableDevicePropVariantCollection_INTERFACE_DEFINED__ - -/* interface IPortableDevicePropVariantCollection */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPortableDevicePropVariantCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("89b2e422-4f1b-4316-bcef-a44afea83eb3") - IPortableDevicePropVariantCollection : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCount( - /* [in] */ __RPC__in DWORD *pcElems) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAt( - /* [in] */ const DWORD dwIndex, - /* [in] */ __RPC__in PROPVARIANT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE Add( - /* [in] */ __RPC__in const PROPVARIANT *pValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetType( - /* [out] */ __RPC__out VARTYPE *pvt) = 0; - - virtual HRESULT STDMETHODCALLTYPE ChangeType( - /* [in] */ const VARTYPE vt) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveAt( - /* [in] */ const DWORD dwIndex) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPortableDevicePropVariantCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IPortableDevicePropVariantCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IPortableDevicePropVariantCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ __RPC__in DWORD *pcElems); - - HRESULT ( STDMETHODCALLTYPE *GetAt )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ const DWORD dwIndex, - /* [in] */ __RPC__in PROPVARIANT *pValue); - - HRESULT ( STDMETHODCALLTYPE *Add )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ __RPC__in const PROPVARIANT *pValue); - - HRESULT ( STDMETHODCALLTYPE *GetType )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [out] */ __RPC__out VARTYPE *pvt); - - HRESULT ( STDMETHODCALLTYPE *ChangeType )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ const VARTYPE vt); - - HRESULT ( STDMETHODCALLTYPE *Clear )( - __RPC__in IPortableDevicePropVariantCollection * This); - - HRESULT ( STDMETHODCALLTYPE *RemoveAt )( - __RPC__in IPortableDevicePropVariantCollection * This, - /* [in] */ const DWORD dwIndex); - - END_INTERFACE - } IPortableDevicePropVariantCollectionVtbl; - - interface IPortableDevicePropVariantCollection - { - CONST_VTBL struct IPortableDevicePropVariantCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPortableDevicePropVariantCollection_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPortableDevicePropVariantCollection_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPortableDevicePropVariantCollection_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPortableDevicePropVariantCollection_GetCount(This,pcElems) \ - ( (This)->lpVtbl -> GetCount(This,pcElems) ) - -#define IPortableDevicePropVariantCollection_GetAt(This,dwIndex,pValue) \ - ( (This)->lpVtbl -> GetAt(This,dwIndex,pValue) ) - -#define IPortableDevicePropVariantCollection_Add(This,pValue) \ - ( (This)->lpVtbl -> Add(This,pValue) ) - -#define IPortableDevicePropVariantCollection_GetType(This,pvt) \ - ( (This)->lpVtbl -> GetType(This,pvt) ) - -#define IPortableDevicePropVariantCollection_ChangeType(This,vt) \ - ( (This)->lpVtbl -> ChangeType(This,vt) ) - -#define IPortableDevicePropVariantCollection_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#define IPortableDevicePropVariantCollection_RemoveAt(This,dwIndex) \ - ( (This)->lpVtbl -> RemoveAt(This,dwIndex) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPortableDevicePropVariantCollection_INTERFACE_DEFINED__ */ - - -#ifndef __IPortableDeviceValuesCollection_INTERFACE_DEFINED__ -#define __IPortableDeviceValuesCollection_INTERFACE_DEFINED__ - -/* interface IPortableDeviceValuesCollection */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IPortableDeviceValuesCollection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6e3f2d79-4e07-48c4-8208-d8c2e5af4a99") - IPortableDeviceValuesCollection : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetCount( - /* [in] */ __RPC__in DWORD *pcElems) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetAt( - /* [in] */ const DWORD dwIndex, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppValues) = 0; - - virtual HRESULT STDMETHODCALLTYPE Add( - /* [in] */ __RPC__in_opt IPortableDeviceValues *pValues) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveAt( - /* [in] */ const DWORD dwIndex) = 0; - - }; - -#else /* C style interface */ - - typedef struct IPortableDeviceValuesCollectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IPortableDeviceValuesCollection * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IPortableDeviceValuesCollection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IPortableDeviceValuesCollection * This); - - HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IPortableDeviceValuesCollection * This, - /* [in] */ __RPC__in DWORD *pcElems); - - HRESULT ( STDMETHODCALLTYPE *GetAt )( - __RPC__in IPortableDeviceValuesCollection * This, - /* [in] */ const DWORD dwIndex, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppValues); - - HRESULT ( STDMETHODCALLTYPE *Add )( - __RPC__in IPortableDeviceValuesCollection * This, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pValues); - - HRESULT ( STDMETHODCALLTYPE *Clear )( - __RPC__in IPortableDeviceValuesCollection * This); - - HRESULT ( STDMETHODCALLTYPE *RemoveAt )( - __RPC__in IPortableDeviceValuesCollection * This, - /* [in] */ const DWORD dwIndex); - - END_INTERFACE - } IPortableDeviceValuesCollectionVtbl; - - interface IPortableDeviceValuesCollection - { - CONST_VTBL struct IPortableDeviceValuesCollectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IPortableDeviceValuesCollection_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IPortableDeviceValuesCollection_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IPortableDeviceValuesCollection_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IPortableDeviceValuesCollection_GetCount(This,pcElems) \ - ( (This)->lpVtbl -> GetCount(This,pcElems) ) - -#define IPortableDeviceValuesCollection_GetAt(This,dwIndex,ppValues) \ - ( (This)->lpVtbl -> GetAt(This,dwIndex,ppValues) ) - -#define IPortableDeviceValuesCollection_Add(This,pValues) \ - ( (This)->lpVtbl -> Add(This,pValues) ) - -#define IPortableDeviceValuesCollection_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#define IPortableDeviceValuesCollection_RemoveAt(This,dwIndex) \ - ( (This)->lpVtbl -> RemoveAt(This,dwIndex) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IPortableDeviceValuesCollection_INTERFACE_DEFINED__ */ - - - -#ifndef __PortableDeviceTypesLib_LIBRARY_DEFINED__ -#define __PortableDeviceTypesLib_LIBRARY_DEFINED__ - -/* library PortableDeviceTypesLib */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_PortableDeviceTypesLib; - -EXTERN_C const CLSID CLSID_WpdSerializer; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0b91a74b-ad7c-4a9d-b563-29eef9167172") -WpdSerializer; -#endif - -EXTERN_C const CLSID CLSID_PortableDeviceValues; - -#ifdef __cplusplus - -class DECLSPEC_UUID("0c15d503-d017-47ce-9016-7b3f978721cc") -PortableDeviceValues; -#endif - -EXTERN_C const CLSID CLSID_PortableDeviceKeyCollection; - -#ifdef __cplusplus - -class DECLSPEC_UUID("de2d022d-2480-43be-97f0-d1fa2cf98f4f") -PortableDeviceKeyCollection; -#endif - -EXTERN_C const CLSID CLSID_PortableDevicePropVariantCollection; - -#ifdef __cplusplus - -class DECLSPEC_UUID("08a99e2f-6d6d-4b80-af5a-baf2bcbe4cb9") -PortableDevicePropVariantCollection; -#endif - -EXTERN_C const CLSID CLSID_PortableDeviceValuesCollection; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3882134d-14cf-4220-9cb4-435f86d83f60") -PortableDeviceValuesCollection; -#endif -#endif /* __PortableDeviceTypesLib_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_PortableDeviceTypes_0000_0005 */ -/* [local] */ - -#endif // (_WIN32_WINNT >= 0x0501) - - -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceTypes_0000_0005_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_PortableDeviceTypes_0000_0005_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree64( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/portabledevicetypes.idl b/qt-correction-tool/pub/ddk/portabledevicetypes.idl deleted file mode 100644 index 9a3ddd0..0000000 --- a/qt-correction-tool/pub/ddk/portabledevicetypes.idl +++ /dev/null @@ -1,400 +0,0 @@ -//----------------------------------------------------------------------------- -// -// @module PortableDeviceTypes.idl -// -// @abstract This file contains interface desc for interfaces used in passing -// parameters between applications and drivers. -// -// @copyright (C) COPYRIGHT MICROSOFT CORPORATION -// -//----------------------------------------------------------------------------- - -cpp_quote("#if (_WIN32_WINNT >= 0x0501) // XP and later") - -import "oaidl.idl"; -import "ocidl.idl"; -import "propsys.idl"; -import "wtypes.idl"; - -// -// We are defining VARIANT_FALSE/TRUE here because they are not defined in any -// public .idl that we can import. -// - -#define VARIANT_FALSE ( (VARIANT_BOOL) 0 ) -#define VARIANT_TRUE ( (VARIANT_BOOL) -1 ) - -interface IWpdSerializer; -interface IPortableDeviceValues; -interface IPortableDeviceKeyCollection; -interface IPortableDevicePropVariantCollection; -interface IPortableDeviceValuesCollection; - -/////////////////////////////////////////////////////////// -// IWpdSerializer -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - object, - uuid(b32f4002-bb27-45ff-af4f-06631c1e8dad), - helpstring("IWpdSerializer Interface"), - pointer_default(unique) -] -interface IWpdSerializer : IUnknown -{ - HRESULT GetIPortableDeviceValuesFromBuffer( - [in, size_is(dwInputBufferLength)] - BYTE* pBuffer, - [in] DWORD dwInputBufferLength, - [out] IPortableDeviceValues** ppParams); - - HRESULT WriteIPortableDeviceValuesToBuffer( - [in] DWORD dwOutputBufferLength, - [in] IPortableDeviceValues* pResults, - [out, size_is(dwOutputBufferLength), length_is(*pdwBytesWritten)] - BYTE* pBuffer, - [out] DWORD* pdwBytesWritten); - - HRESULT GetBufferFromIPortableDeviceValues( - [in] IPortableDeviceValues* pSource, - [out, size_is(, *pdwBufferSize)] - BYTE** ppBuffer, - [out] DWORD* pdwBufferSize); - - HRESULT GetSerializedSize( - [in] IPortableDeviceValues* pSource, - [out] DWORD* pdwSize); -}; - -/////////////////////////////////////////////////////////// -// IPortableDeviceValues -//--------------------------------------------------------- -// A collection of property/value pairs. Used to get/set -// properties. -//--------------------------------------------------------- -// -[ - object, - uuid(6848f6f2-3155-4f86-b6f5-263eeeab3143), - helpstring("IPortableDeviceValues Interface"), - pointer_default(unique) -] -interface IPortableDeviceValues : IUnknown -{ - HRESULT GetCount( - [in] DWORD* pcelt); - - HRESULT GetAt( - [in] const DWORD index, - [in, out, unique] PROPERTYKEY* pKey, - [in, out, unique] PROPVARIANT* pValue); - - HRESULT SetValue( - [in] REFPROPERTYKEY key, - [in] const PROPVARIANT* pValue); - - HRESULT GetValue( - [in] REFPROPERTYKEY key, - [out] PROPVARIANT* pValue); - - HRESULT SetStringValue( - [in] REFPROPERTYKEY key, - [in] LPCWSTR Value); - - HRESULT GetStringValue( - [in] REFPROPERTYKEY key, - [out] LPWSTR* pValue); - - HRESULT SetUnsignedIntegerValue( - [in] REFPROPERTYKEY key, - [in] const ULONG Value); - - HRESULT GetUnsignedIntegerValue( - [in] REFPROPERTYKEY key, - [out] ULONG* pValue); - - HRESULT SetSignedIntegerValue( - [in] REFPROPERTYKEY key, - [in] const LONG Value); - - HRESULT GetSignedIntegerValue( - [in] REFPROPERTYKEY key, - [out] LONG* pValue); - - HRESULT SetUnsignedLargeIntegerValue( - [in] REFPROPERTYKEY key, - [in] const ULONGLONG Value); - - HRESULT GetUnsignedLargeIntegerValue( - [in] REFPROPERTYKEY key, - [out] ULONGLONG* pValue); - - HRESULT SetSignedLargeIntegerValue( - [in] REFPROPERTYKEY key, - [in] const LONGLONG Value); - - HRESULT GetSignedLargeIntegerValue( - [in] REFPROPERTYKEY key, - [out] LONGLONG* pValue); - - HRESULT SetFloatValue( - [in] REFPROPERTYKEY key, - [in] const FLOAT Value); - - HRESULT GetFloatValue( - [in] REFPROPERTYKEY key, - [out] FLOAT* pValue); - - HRESULT SetErrorValue( - [in] REFPROPERTYKEY key, - [in] const HRESULT Value); - - HRESULT GetErrorValue( - [in] REFPROPERTYKEY key, - [out] HRESULT* pValue); - - HRESULT SetKeyValue( - [in] REFPROPERTYKEY key, - [in] REFPROPERTYKEY Value); - - HRESULT GetKeyValue( - [in] REFPROPERTYKEY key, - [out] PROPERTYKEY* pValue); - - HRESULT SetBoolValue( - [in] REFPROPERTYKEY key, - [in] const BOOL Value); - - HRESULT GetBoolValue( - [in] REFPROPERTYKEY key, - [out] BOOL* pValue); - - HRESULT SetIUnknownValue( - [in] REFPROPERTYKEY key, - [in] IUnknown* pValue); - - HRESULT GetIUnknownValue( - [in] REFPROPERTYKEY key, - [out] IUnknown** ppValue); - - HRESULT SetGuidValue( - [in] REFPROPERTYKEY key, - [in] REFGUID Value); - - HRESULT GetGuidValue( - [in] REFPROPERTYKEY key, - [out] GUID* pValue); - - HRESULT SetBufferValue( - [in] REFPROPERTYKEY key, - [in, size_is(cbValue)] - BYTE* pValue, - [in] DWORD cbValue); - - HRESULT GetBufferValue( - [in] REFPROPERTYKEY key, - [out, size_is(, *pcbValue)] - BYTE** ppValue, - [out] DWORD* pcbValue); - - HRESULT SetIPortableDeviceValuesValue( - [in] REFPROPERTYKEY key, - [in] IPortableDeviceValues* pValue); - - HRESULT GetIPortableDeviceValuesValue( - [in] REFPROPERTYKEY key, - [out] IPortableDeviceValues** ppValue); - - HRESULT SetIPortableDevicePropVariantCollectionValue( - [in] REFPROPERTYKEY key, - [in] IPortableDevicePropVariantCollection* pValue); - - HRESULT GetIPortableDevicePropVariantCollectionValue( - [in] REFPROPERTYKEY key, - [out] IPortableDevicePropVariantCollection** ppValue); - - HRESULT SetIPortableDeviceKeyCollectionValue( - [in] REFPROPERTYKEY key, - [in] IPortableDeviceKeyCollection* pValue); - - HRESULT GetIPortableDeviceKeyCollectionValue( - [in] REFPROPERTYKEY key, - [out] IPortableDeviceKeyCollection** ppValue); - - HRESULT SetIPortableDeviceValuesCollectionValue( - [in] REFPROPERTYKEY key, - [in] IPortableDeviceValuesCollection* pValue); - - HRESULT GetIPortableDeviceValuesCollectionValue( - [in] REFPROPERTYKEY key, - [out] IPortableDeviceValuesCollection** ppValue); - - HRESULT RemoveValue( - [in] REFPROPERTYKEY key); - - HRESULT CopyValuesFromPropertyStore( - [in] IPropertyStore* pStore); - - HRESULT CopyValuesToPropertyStore( - [in] IPropertyStore* pStore); - - HRESULT Clear(); -}; - -/////////////////////////////////////////////////////////// -// IPortableDeviceKeyCollection -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - object, - uuid(dada2357-e0ad-492e-98db-dd61c53ba353), - helpstring("IPortableDeviceKeyCollection Interface"), - pointer_default(unique) -] -interface IPortableDeviceKeyCollection : IUnknown -{ - HRESULT GetCount( - [in] DWORD* pcElems); - - HRESULT GetAt( - [in] const DWORD dwIndex, - [in] PROPERTYKEY* pKey); - - HRESULT Add( - [in] REFPROPERTYKEY Key); - - HRESULT Clear(); - - HRESULT RemoveAt( - [in] const DWORD dwIndex); -}; - -/////////////////////////////////////////////////////////// -// IPortableDevicePropVariantCollection -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - object, - uuid(89b2e422-4f1b-4316-bcef-a44afea83eb3), - helpstring("IPortableDevicePropVariantCollection Interface"), - pointer_default(unique) -] -interface IPortableDevicePropVariantCollection : IUnknown -{ - HRESULT GetCount( - [in] DWORD* pcElems); - - HRESULT GetAt( - [in] const DWORD dwIndex, - [in] PROPVARIANT* pValue); - - HRESULT Add( - [in] const PROPVARIANT* pValue); - - HRESULT GetType( - [out] VARTYPE* pvt); - - HRESULT ChangeType( - [in] const VARTYPE vt); - - HRESULT Clear(); - - HRESULT RemoveAt( - [in] const DWORD dwIndex); -}; - -/////////////////////////////////////////////////////////// -// IPortableDeviceValuesCollection -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - object, - uuid(6e3f2d79-4e07-48c4-8208-d8c2e5af4a99), - helpstring("IPortableDeviceValuesCollection Interface"), - pointer_default(unique) -] -interface IPortableDeviceValuesCollection : IUnknown -{ - HRESULT GetCount( - [in] DWORD* pcElems); - - HRESULT GetAt( - [in] const DWORD dwIndex, - [out] IPortableDeviceValues** ppValues); - - HRESULT Add( - [in] IPortableDeviceValues* pValues); - - HRESULT Clear(); - - HRESULT RemoveAt( - [in] const DWORD dwIndex); -}; - -/////////////////////////////////////////////////////////// -// PortableDeviceTypesLib -//--------------------------------------------------------- -//--------------------------------------------------------- -// -[ - uuid(2B00BA2F-E750-4beb-9235-97142EDE1D3E), - version(1.0), - helpstring("PortableDeviceTypes 1.0 Type Library") -] -library PortableDeviceTypesLib -{ - importlib("stdole32.tlb"); - importlib("stdole2.tlb"); - - [ - uuid(0b91a74b-ad7c-4a9d-b563-29eef9167172), - helpstring("WpdSerializer Class") - ] - coclass WpdSerializer - { - [default] interface IWpdSerializer; - }; - - [ - uuid(0c15d503-d017-47ce-9016-7b3f978721cc), - helpstring("Portable Device Values Class") - ] - coclass PortableDeviceValues - { - [default] interface IPortableDeviceValues; - }; - - [ - uuid(de2d022d-2480-43be-97f0-d1fa2cf98f4f), - helpstring("Portable Device PROPERTYKEY collection") - ] - coclass PortableDeviceKeyCollection - { - [default] interface IPortableDeviceKeyCollection; - }; - - [ - uuid(08a99e2f-6d6d-4b80-af5a-baf2bcbe4cb9), - helpstring("Portable Device PROPVARIANT collection") - ] - coclass PortableDevicePropVariantCollection - { - [default] interface IPortableDevicePropVariantCollection; - }; - - [ - uuid(3882134d-14cf-4220-9cb4-435f86d83f60), - helpstring("Portable Device Values collection") - ] - coclass PortableDeviceValuesCollection - { - [default] interface IPortableDeviceValuesCollection; - }; -}; - -cpp_quote("#endif // (_WIN32_WINNT >= 0x0501)") - diff --git a/qt-correction-tool/pub/ddk/portcls.h b/qt-correction-tool/pub/ddk/portcls.h deleted file mode 100644 index 7c3ee7b..0000000 --- a/qt-correction-tool/pub/ddk/portcls.h +++ /dev/null @@ -1,3555 +0,0 @@ -/***************************************************************************** - * portcls.h - WDM Streaming port class driver - ***************************************************************************** - * Copyright (c) Microsoft Corporation. All rights reserved. - */ - -#ifndef _PORTCLS_H_ -#define _PORTCLS_H_ - -#ifdef __cplusplus -// WDM.H does not play well with C++. -extern "C" -{ -#include -} -#else -#include -#endif - -#ifndef IRP_MN_FILTER_RESOURCE_REQUIREMENTS -#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D -#endif - -#include -#define NOBITMAP -#include -#undef NOBITMAP -#include -#include -#include - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#include -#endif - -#if defined(PC_NO_IMPORTS) -#define PORTCLASSAPI EXTERN_C -#else -#define PORTCLASSAPI EXTERN_C __declspec(dllimport) -#endif - -#define _100NS_UNITS_PER_SECOND 10000000L -#define PORT_CLASS_DEVICE_EXTENSION_SIZE (64*sizeof(ULONG_PTR)) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -// -// N.B.: If you are having problems building your driver, -// #define PC_OLD_NAMES in your sources file. -// This flag is no longer turned on by default. -// -//#ifndef PC_NEW_NAMES -//#define PC_OLD_NAMES -//#endif -#elif (NTDDI_VERSION >= NTDDI_WIN2K) -#ifndef PC_NEW_NAMES -#define PC_OLD_NAMES -#endif -#endif - -#define IID_IAdapterPowerManagment IID_IAdapterPowerManagement -#define IID_IAdapterPowerManagment2 IID_IAdapterPowerManagement2 -#define PADAPTERPOWERMANAGMENT PADAPTERPOWERMANAGEMENT -#define PADAPTERPOWERMANAGMENT2 PADAPTERPOWERMANAGEMENT2 - -/***************************************************************************** - * Interface identifiers. - */ - -DEFINE_GUID(IID_IMiniport, -0xb4c90a24L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IPort, -0xb4c90a25L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IResourceList, -0x22C6AC60L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DEFINE_GUID(IID_IMusicTechnology, -0x80396C3CL, 0xCBCB, 0x409B, 0x9F, 0x65, 0x4F, 0x1E, 0x74, 0x67, 0xCD, 0xAF); -#endif - -DEFINE_GUID(IID_IDmaChannel, -0x22C6AC61L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); - -// -// Take out IDmaChannelSlave for compilations. -// -#if (NTDDI_VERSION < NTDDI_VISTA) -DEFINE_GUID(IID_IDmaChannelSlave, -0x22C6AC62L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); -#endif - -DEFINE_GUID(IID_IInterruptSync, -0x22C6AC63L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); -DEFINE_GUID(IID_IServiceSink, -0x22C6AC64L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); -DEFINE_GUID(IID_IServiceGroup, -0x22C6AC65L, 0x851B, 0x11D0, 0x9A, 0x7F, 0x00, 0xAA, 0x00, 0x38, 0xAC, 0xFE); -DEFINE_GUID(IID_IRegistryKey, -0xE8DA4302l, 0xF304, 0x11D0, 0x95, 0x8B, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3); -DEFINE_GUID(IID_IPortMidi, -0xb4c90a40L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportMidi, -0xb4c90a41L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportMidiStream, -0xb4c90a42L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IPortTopology, -0xb4c90a30L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportTopology, -0xb4c90a31L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IPortWaveCyclic, -0xb4c90a26L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportWaveCyclic, -0xb4c90a27L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportWaveCyclicStream, -0xb4c90a28L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IPortWavePci, -0xb4c90a50L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IPortWavePciStream, -0xb4c90a51L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportWavePci, -0xb4c90a52L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(IID_IMiniportWavePciStream, -0xb4c90a53L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DEFINE_GUID(IID_IPortWaveRT, -0x339ff909, 0x68a9, 0x4310, 0xb0, 0x9b, 0x27, 0x4e, 0x96, 0xee, 0x4c, 0xbd); -DEFINE_GUID(IID_IPortWaveRTStream, -0x1809ce5a, 0x64bc, 0x4e62, 0xbd, 0x7d, 0x95, 0xbc, 0xe4, 0x3d, 0xe3, 0x93); -DEFINE_GUID(IID_IMiniportWaveRT, -0xf9fc4d6, 0x6061, 0x4f3c, 0xb1, 0xfc, 0x7, 0x5e, 0x35, 0xf7, 0x96, 0xa); -DEFINE_GUID(IID_IMiniportWaveRTStream, -0xac9ab, 0xfaab, 0x4f3d, 0x94, 0x55, 0x6f, 0xf8, 0x30, 0x6a, 0x74, 0xa0); -DEFINE_GUID(IID_IMiniportWaveRTStreamNotification, -0x23759128, 0x96f1, 0x423b, 0xab, 0x4d, 0x81, 0x63, 0x5b, 0xcf, 0x8c, 0xa1); - -// Need compile only for post vista case -// Not sure what NTDDI_xxxx for Windows 7 -DEFINE_GUID(IID_IPortWMIRegistration, -0xd80b18e7, 0x804c, 0x4e1e, 0x82, 0xd3, 0x24, 0x61, 0xec, 0x6, 0xe7, 0xc7); - -// {C3D5E80C-7F55-40c5-88B2-6210D0CB2B59} -DEFINE_GUID(IID_IPortClsSubdeviceEx, -0xc3d5e80c, 0x7f55, 0x40c5, 0x88, 0xb2, 0x62, 0x10, 0xd0, 0xcb, 0x2b, 0x59); - -// {47BA0351-BC4B-4869-8134-B74FE17852D8} -DEFINE_GUID(IID_IPortClsPower, -0x47ba0351, 0xbc4b, 0x4869, 0x81, 0x34, 0xb7, 0x4f, 0xe1, 0x78, 0x52, 0xd8); - - - -// {29CC9AB1-E89D-413c-B6B2-F6D50005D063} -DEFINE_GUID(IID_IPinName, -0x29cc9ab1, 0xe89d, 0x413c, 0xb6, 0xb2, 0xf6, 0xd5, 0x0, 0x5, 0xd0, 0x63); - - -#endif - -DEFINE_GUID(IID_IAdapterPowerManagement, -0x793417D0L, 0x35FE, 0x11D1, 0xAD, 0x08, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0xB0); -DEFINE_GUID(IID_IAdapterPowerManagement2, -0xE0F92E5DL, 0x67F5, 0x48EE, 0xB5, 0x7A, 0x7D, 0x1E, 0x90, 0xC5, 0xF4, 0x3D); -DEFINE_GUID(IID_IPowerNotify, -0x3DD648B8L, 0x969F, 0x11D1, 0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3); -DEFINE_GUID(IID_IWaveCyclicClock, -0xdec1ec78L, 0x419a, 0x11d1, 0xad, 0x09, 0x00, 0xc0, 0x4f, 0xb9, 0x1b, 0xc4); -DEFINE_GUID(IID_IWavePciClock, -0xd5d7a256L, 0x5d10, 0x11d1, 0xad, 0xae, 0x00, 0xc0, 0x4f, 0xb9, 0x1b, 0xc4); -DEFINE_GUID(IID_IPortEvents, -0xA80F29C4L, 0x5498, 0x11D2, 0x95, 0xD9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DEFINE_GUID(IID_IDrmPort, -0x286D3DF8L, 0xCA22, 0x4E2E, 0xB9, 0xBC, 0x20, 0xB4, 0xF0, 0xE2, 0x01, 0xCE); -DEFINE_GUID(IID_IDrmPort2, -0x1ACCE59CL, 0x7311, 0x4B6B, 0x9F, 0xBA, 0xCC, 0x3B, 0xA5, 0x9A, 0xCD, 0xCE); -DEFINE_GUID(IID_IPortClsVersion, -0x7D89A7BBL, 0x869B, 0x4567, 0x8D, 0xBE, 0x1E, 0x16, 0x8C, 0xC8, 0x53, 0xDE); -DEFINE_GUID(IID_IPinCount, -0x5dadb7dcL, 0xa2cb, 0x4540, 0xa4, 0xa8, 0x42, 0x5e, 0xe4, 0xae, 0x90, 0x51); -DEFINE_GUID(IID_IPreFetchOffset, -0x7000f480L, 0xed44, 0x4e8b, 0xb3, 0x8a, 0x41, 0x2f, 0x8d, 0x7a, 0x50, 0x4d); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2003) -DEFINE_GUID(IID_IUnregisterSubdevice, -0x16738177L, 0xe199, 0x41f9, 0x9a, 0x87, 0xab, 0xb2, 0xa5, 0x43, 0x2f, 0x21); -DEFINE_GUID(IID_IUnregisterPhysicalConnection, -0x6c38e231L, 0x2a0d, 0x428d, 0x81, 0xf8, 0x07, 0xcc, 0x42, 0x8b, 0xb9, 0xa4); -#endif - - -/***************************************************************************** - * Class identifiers. - */ - -DEFINE_GUID(CLSID_PortMidi, -0xb4c90a43L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(CLSID_PortTopology, -0xb4c90a32L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(CLSID_PortWaveCyclic, -0xb4c90a2aL, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(CLSID_PortWavePci, -0xb4c90a54L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DEFINE_GUID(CLSID_PortWaveRT, -0xcc9be57a, 0xeb9e, 0x42b4, 0x94, 0xfc, 0xc, 0xad, 0x3d, 0xbc, 0xe7, 0xfa); -#endif - -DEFINE_GUID(CLSID_MiniportDriverFmSynth, -0xb4c90ae0L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(CLSID_MiniportDriverUart, -0xb4c90ae1L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44); -DEFINE_GUID(CLSID_MiniportDriverFmSynthWithVol, -0xe5a3c139L, 0xf0f2, 0x11d1, 0x81, 0xaf, 0x00, 0x60, 0x08, 0x33, 0x16, 0xc1); - - -/***************************************************************************** - * Interfaces - */ - -#if !defined(DEFINE_ABSTRACT_UNKNOWN) - -#define DEFINE_ABSTRACT_UNKNOWN() \ - STDMETHOD_(NTSTATUS, QueryInterface)(THIS_ \ - REFIID InterfaceId, \ - PVOID* Interface \ - ) PURE; \ - STDMETHOD_(ULONG,AddRef)(THIS) PURE; \ - STDMETHOD_(ULONG,Release)(THIS) PURE; - -#endif //!defined(DEFINE_ABSTRACT_UNKNOWN) - -#if !defined(DEFINE_ABSTRACT_PORT) - -#ifdef PC_OLD_NAMES - -#define DEFINE_ABSTRACT_PORT() \ - STDMETHOD_(NTSTATUS,Init) \ - ( THIS_ \ - __in PVOID DeviceObject, \ - __in_opt PVOID Irp, \ - __in PUNKNOWN UnknownMiniport, \ - __in_opt PUNKNOWN UnknownAdapter, \ - __in PRESOURCELIST ResourceList \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetDeviceProperty) \ - ( THIS_ \ - __in DEVICE_REGISTRY_PROPERTY DeviceProperty, \ - __in ULONG BufferLength, \ - __out PVOID PropertyBuffer, \ - __out PULONG ResultLength \ - ) PURE; \ - STDMETHOD_(NTSTATUS,NewRegistryKey) \ - ( THIS_ \ - __out PREGISTRYKEY * OutRegistryKey, \ - __in_opt PUNKNOWN OuterUnknown, \ - __in ULONG RegistryKeyType, \ - __in ACCESS_MASK DesiredAccess, \ - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, \ - __in_opt ULONG CreateOptions, \ - __out_opt PULONG Disposition \ - ) PURE; - -#else // !PC_OLD_NAMES - -#define DEFINE_ABSTRACT_PORT() \ - STDMETHOD_(NTSTATUS,Init) \ - ( THIS_ \ - __in PDEVICE_OBJECT DeviceObject, \ - __in_opt PIRP Irp, \ - __in PUNKNOWN UnknownMiniport, \ - __in_opt PUNKNOWN UnknownAdapter, \ - __in PRESOURCELIST ResourceList \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetDeviceProperty) \ - ( THIS_ \ - __in DEVICE_REGISTRY_PROPERTY DeviceProperty, \ - __in ULONG BufferLength, \ - __out PVOID PropertyBuffer, \ - __out PULONG ResultLength \ - ) PURE; \ - STDMETHOD_(NTSTATUS,NewRegistryKey) \ - ( THIS_ \ - __out PREGISTRYKEY * OutRegistryKey, \ - __in_opt PUNKNOWN OuterUnknown, \ - __in ULONG RegistryKeyType, \ - __in ACCESS_MASK DesiredAccess, \ - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, \ - __in_opt ULONG CreateOptions, \ - __out_opt PULONG Disposition \ - ) PURE; - -#endif // !PC_OLD_NAMES - -#endif //!defined(DEFINE_ABSTRACT_PORT) - - -#if !defined(DEFINE_ABSTRACT_MINIPORT) - -#define DEFINE_ABSTRACT_MINIPORT() \ - STDMETHOD_(NTSTATUS,GetDescription) \ - ( THIS_ \ - __out PPCFILTER_DESCRIPTOR * Description \ - ) PURE; \ - STDMETHOD_(NTSTATUS,DataRangeIntersection) \ - ( THIS_ \ - __in ULONG PinId, \ - __in PKSDATARANGE DataRange, \ - __in PKSDATARANGE MatchingDataRange, \ - __in ULONG OutputBufferLength, \ - __out_opt PVOID ResultantFormat, \ - __out PULONG ResultantFormatLength \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_MINIPORT) - -#if !defined(DEFINE_ABSTRACT_DMACHANNEL) - -#define DEFINE_ABSTRACT_DMACHANNEL() \ - STDMETHOD_(NTSTATUS,AllocateBuffer) \ - ( THIS_ \ - __in ULONG BufferSize, \ - __in_opt PPHYSICAL_ADDRESS PhysicalAddressConstraint \ - ) PURE; \ - STDMETHOD_(void,FreeBuffer) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(ULONG,TransferCount) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(ULONG,MaximumBufferSize) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(ULONG,AllocatedBufferSize) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(ULONG,BufferSize) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(void,SetBufferSize) \ - ( THIS_ \ - __in ULONG BufferSize \ - ) PURE; \ - STDMETHOD_(PVOID,SystemAddress) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(PHYSICAL_ADDRESS,PhysicalAddress) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(PADAPTER_OBJECT,GetAdapterObject) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(void,CopyTo) \ - ( THIS_ \ - __inout_bcount(ByteCount) PVOID Destination, \ - __in PVOID Source, \ - __in ULONG ByteCount \ - ) PURE; \ - STDMETHOD_(void,CopyFrom) \ - ( THIS_ \ - __inout_bcount(ByteCount) PVOID Destination, \ - __in PVOID Source, \ - __in ULONG ByteCount \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_DMACHANNEL) - -// -// Take out definitions of IDmaChannelSlave. -// -#if (NTDDI_VERSION < NTDDI_VISTA) -#if !defined(DEFINE_ABSTRACT_DMACHANNELSLAVE) - -#define DEFINE_ABSTRACT_DMACHANNELSLAVE() \ - STDMETHOD_(NTSTATUS,Start) \ - ( THIS_ \ - __in ULONG MapSize, \ - __in BOOLEAN WriteToDevice \ - ) PURE; \ - STDMETHOD_(NTSTATUS,Stop) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(ULONG,ReadCounter) \ - ( THIS \ - ) PURE; \ - STDMETHOD_(NTSTATUS,WaitForTC) \ - ( THIS_ \ - ULONG Timeout \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_DMACHANNELSLAVE) -#endif - -#if !defined(DEFINE_ABSTRACT_DRMPORT) - -#define DEFINE_ABSTRACT_DRMPORT() \ - STDMETHOD_(NTSTATUS,CreateContentMixed) \ - ( THIS_ \ - __in PULONG paContentId, \ - __in ULONG cContentId, \ - __out PULONG pMixedContentId \ - ) PURE; \ - STDMETHOD_(NTSTATUS,DestroyContent) \ - ( THIS_ \ - __in ULONG ContentId \ - ) PURE; \ - STDMETHOD_(NTSTATUS,ForwardContentToFileObject) \ - ( THIS_ \ - __in ULONG ContentId, \ - __in PFILE_OBJECT FileObject \ - ) PURE; \ - STDMETHOD_(NTSTATUS,ForwardContentToInterface) \ - ( THIS_ \ - __in ULONG ContentId, \ - __in PUNKNOWN pUnknown, \ - __in ULONG NumMethods \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetContentRights) \ - ( THIS_ \ - __in ULONG ContentId, \ - __out PDRMRIGHTS DrmRights \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_DRMPORT) - -#if !defined(DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM) - -#define DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM() \ - STDMETHOD_(NTSTATUS,SetFormat) \ - ( THIS_ \ - __in PKSDATAFORMAT DataFormat \ - ) PURE; \ - STDMETHOD_(NTSTATUS,SetState) \ - ( THIS_ \ - __in KSSTATE State \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetPosition) \ - ( THIS_ \ - __out PKSAUDIO_POSITION Position \ - ) PURE; \ - STDMETHOD_(NTSTATUS,AllocateAudioBuffer) \ - ( THIS_ \ - __in ULONG RequestedSize, \ - __out PMDL *AudioBufferMdl, \ - __out ULONG *ActualSize, \ - __out ULONG *OffsetFromFirstPage, \ - __out MEMORY_CACHING_TYPE *CacheType \ - ) PURE; \ - STDMETHOD_(VOID,FreeAudioBuffer) \ - ( THIS_ \ - __in_opt PMDL AudioBufferMdl, \ - __in ULONG BufferSize \ - ) PURE; \ - STDMETHOD_(VOID,GetHWLatency) \ - ( THIS_ \ - __out KSRTAUDIO_HWLATENCY *hwLatency \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetPositionRegister) \ - ( THIS_ \ - __out KSRTAUDIO_HWREGISTER *Register \ - ) PURE; \ - STDMETHOD_(NTSTATUS,GetClockRegister) \ - ( THIS_ \ - __out KSRTAUDIO_HWREGISTER *Register \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM) - -#if !defined(DEFINE_ABSTRACT_ADAPTERPOWERMANAGEMENT) - -#define DEFINE_ABSTRACT_ADAPTERPOWERMANAGEMENT() \ - STDMETHOD_(void,PowerChangeState) \ - ( THIS_ \ - __in POWER_STATE NewState \ - ) PURE; \ - STDMETHOD_(NTSTATUS,QueryPowerChangeState) \ - ( THIS_ \ - __in POWER_STATE NewStateQuery \ - ) PURE; \ - STDMETHOD_(NTSTATUS,QueryDeviceCapabilities) \ - ( THIS_ \ - __in PDEVICE_CAPABILITIES PowerDeviceCaps \ - ) PURE; - -#endif //!defined(DEFINE_ABSTRACT_ADAPTERPOWERMANAGEMENT) - -/***************************************************************************** - * IResourceList - ***************************************************************************** - * List of resources. - */ -DECLARE_INTERFACE_(IResourceList,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(ULONG,NumberOfEntries) - ( THIS - ) PURE; - - STDMETHOD_(ULONG,NumberOfEntriesOfType) - ( THIS_ - __in CM_RESOURCE_TYPE Type - ) PURE; - - STDMETHOD_(PCM_PARTIAL_RESOURCE_DESCRIPTOR,FindTranslatedEntry) - ( THIS_ - __in CM_RESOURCE_TYPE Type, - __in ULONG Index - ) PURE; - - STDMETHOD_(PCM_PARTIAL_RESOURCE_DESCRIPTOR,FindUntranslatedEntry) - ( THIS_ - __in CM_RESOURCE_TYPE Type, - __in ULONG Index - ) PURE; - - STDMETHOD_(NTSTATUS,AddEntry) - ( THIS_ - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated, - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated - ) PURE; - - STDMETHOD_(NTSTATUS,AddEntryFromParent) - ( THIS_ - __in struct IResourceList * Parent, - __in CM_RESOURCE_TYPE Type, - __in ULONG Index - ) PURE; - - STDMETHOD_(PCM_RESOURCE_LIST,TranslatedList) - ( THIS - ) PURE; - - STDMETHOD_(PCM_RESOURCE_LIST,UntranslatedList) - ( THIS - ) PURE; -}; - -typedef IResourceList *PRESOURCELIST; - -#ifdef PC_IMPLEMENTATION -#define IMP_IResourceList\ - STDMETHODIMP_(ULONG)NumberOfEntries\ - ( void\ - );\ - STDMETHODIMP_(ULONG) NumberOfEntriesOfType\ - ( __in CM_RESOURCE_TYPE Type\ - );\ - STDMETHODIMP_(PCM_PARTIAL_RESOURCE_DESCRIPTOR) FindTranslatedEntry\ - ( __in CM_RESOURCE_TYPE Type,\ - __in ULONG Index\ - );\ - STDMETHODIMP_(PCM_PARTIAL_RESOURCE_DESCRIPTOR) FindUntranslatedEntry\ - ( __in CM_RESOURCE_TYPE Type,\ - __in ULONG Index\ - );\ - STDMETHODIMP_(NTSTATUS) AddEntry\ - ( __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated,\ - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated\ - );\ - STDMETHODIMP_(NTSTATUS) AddEntryFromParent\ - ( __in struct IResourceList * Parent,\ - __in CM_RESOURCE_TYPE Type,\ - __in ULONG Index\ - );\ - STDMETHODIMP_(PCM_RESOURCE_LIST) TranslatedList\ - ( void\ - );\ - STDMETHODIMP_(PCM_RESOURCE_LIST) UntranslatedList\ - ( void\ - ) -#endif - - -#define NumberOfPorts() NumberOfEntriesOfType(CmResourceTypePort) -#define FindTranslatedPort(n) FindTranslatedEntry(CmResourceTypePort,(n)) -#define FindUntranslatedPort(n) FindUntranslatedEntry(CmResourceTypePort,(n)) -#define AddPortFromParent(p,n) AddEntryFromParent((p),CmResourceTypePort,(n)) - -#define NumberOfInterrupts() NumberOfEntriesOfType(CmResourceTypeInterrupt) -#define FindTranslatedInterrupt(n) FindTranslatedEntry(CmResourceTypeInterrupt,(n)) -#define FindUntranslatedInterrupt(n) FindUntranslatedEntry(CmResourceTypeInterrupt,(n)) -#define AddInterruptFromParent(p,n) AddEntryFromParent((p),CmResourceTypeInterrupt,(n)) - -#define NumberOfMemories() NumberOfEntriesOfType(CmResourceTypeMemory) -#define FindTranslatedMemory(n) FindTranslatedEntry(CmResourceTypeMemory,(n)) -#define FindUntranslatedMemory(n) FindUntranslatedEntry(CmResourceTypeMemory,(n)) -#define AddMemoryFromParent(p,n) AddEntryFromParent((p),CmResourceTypeMemory,(n)) - -#define NumberOfDmas() NumberOfEntriesOfType(CmResourceTypeDma) -#define FindTranslatedDma(n) FindTranslatedEntry(CmResourceTypeDma,(n)) -#define FindUntranslatedDma(n) FindUntranslatedEntry(CmResourceTypeDma,(n)) -#define AddDmaFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDma,(n)) - -#define NumberOfDeviceSpecifics() NumberOfEntriesOfType(CmResourceTypeDeviceSpecific) -#define FindTranslatedDeviceSpecific(n) FindTranslatedEntry(CmResourceTypeDeviceSpecific,(n)) -#define FindUntranslatedDeviceSpecific(n) FindUntranslatedEntry(CmResourceTypeDeviceSpecific,(n)) -#define AddDeviceSpecificFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDeviceSpecific,(n)) - -#define NumberOfBusNumbers() NumberOfEntriesOfType(CmResourceTypeBusNumber) -#define FindTranslatedBusNumber(n) FindTranslatedEntry(CmResourceTypeBusNumber,(n)) -#define FindUntranslatedBusNumber(n) FindUntranslatedEntry(CmResourceTypeBusNumber,(n)) -#define AddBusNumberFromParent(p,n) AddEntryFromParent((p),CmResourceTypeBusNumber,(n)) - -#define NumberOfDevicePrivates() NumberOfEntriesOfType(CmResourceTypeDevicePrivate) -#define FindTranslatedDevicePrivate(n) FindTranslatedEntry(CmResourceTypeDevicePrivate,(n)) -#define FindUntranslatedDevicePrivate(n) FindUntranslatedEntry(CmResourceTypeDevicePrivate,(n)) -#define AddDevicePrivateFromParent(p,n) AddEntryFromParent((p),CmResourceTypeDevicePrivate,(n)) - -#define NumberOfAssignedResources() NumberOfEntriesOfType(CmResourceTypeAssignedResource) -#define FindTranslatedAssignedResource(n) FindTranslatedEntry(CmResourceTypeAssignedResource,(n)) -#define FindUntranslatedAssignedResource(n) FindUntranslatedEntry(CmResourceTypeAssignedResource,(n)) -#define AddAssignedResourceFromParent(p,n) AddEntryFromParent((p),CmResourceTypeAssignedResource,(n)) - -#define NumberOfSubAllocateFroms() NumberOfEntriesOfType(CmResourceTypeSubAllocateFrom) -#define FindTranslatedSubAllocateFrom(n) FindTranslatedEntry(CmResourceTypeSubAllocateFrom,(n)) -#define FindUntranslatedSubAllocateFrom(n) FindUntranslatedEntry(CmResourceTypeSubAllocateFrom,(n)) -#define AddSubAllocateFromFromParent(p,n) AddEntryFromParent((p),CmResourceTypeSubAllocateFrom,(n)) - -/***************************************************************************** - * IDmaChannel - ***************************************************************************** - * Interface for DMA channel. - */ -DECLARE_INTERFACE_(IDmaChannel,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_DMACHANNEL() // For IDmaChannel -}; - -typedef IDmaChannel *PDMACHANNEL; - -#ifdef PC_IMPLEMENTATION -#define IMP_IDmaChannel\ - STDMETHODIMP_(NTSTATUS) AllocateBuffer\ - ( __in ULONG BufferSize,\ - __in_opt PPHYSICAL_ADDRESS PhysicalAddressConstraint\ - );\ - STDMETHODIMP_(void) FreeBuffer\ - ( void\ - );\ - STDMETHODIMP_(ULONG) TransferCount\ - ( void\ - );\ - STDMETHODIMP_(ULONG) MaximumBufferSize\ - ( void\ - );\ - STDMETHODIMP_(ULONG) AllocatedBufferSize\ - ( void\ - );\ - STDMETHODIMP_(ULONG) BufferSize\ - ( void\ - );\ - STDMETHODIMP_(void) SetBufferSize\ - ( __in ULONG BufferSize\ - );\ - STDMETHODIMP_(PVOID) SystemAddress\ - ( void\ - );\ - STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress\ - ( void\ - );\ - STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject\ - ( void\ - );\ - STDMETHODIMP_(void) CopyTo\ - ( __inout_bcount(ByteCount) PVOID Destination,\ - __in PVOID Source,\ - __in ULONG ByteCount\ - );\ - STDMETHODIMP_(void) CopyFrom\ - ( __inout_bcount(ByteCount) PVOID Destination,\ - __in PVOID Source,\ - __in ULONG ByteCount\ - ) -#endif - -// -// For Longhorn we don't support DMA channel slave functions, but we need -// to define PDMACHANNELSLAVE so that we can compile NewSlaveDmaChannel -// which we need for forward compatibility. -// -#if (NTDDI_VERSION < NTDDI_VISTA) -/***************************************************************************** - * IDmaChannelSlave - ***************************************************************************** - * Interface for slave DMA channel. - */ -DECLARE_INTERFACE_(IDmaChannelSlave,IDmaChannel) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_DMACHANNEL() // For IDmaChannel - - DEFINE_ABSTRACT_DMACHANNELSLAVE() // For IDmaChannelSlave -}; - -typedef IDmaChannelSlave *PDMACHANNELSLAVE; - -#ifdef PC_IMPLEMENTATION -#define IMP_IDmaChannelSlave\ - IMP_IDmaChannel;\ - STDMETHODIMP_(NTSTATUS) Start\ - ( __in ULONG MapSize,\ - __in BOOLEAN WriteToDevice\ - );\ - STDMETHODIMP_(NTSTATUS) Stop\ - ( void\ - );\ - STDMETHODIMP_(ULONG) ReadCounter\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) WaitForTC\ - ( ULONG Timeout\ - ) -#endif -#else // NTDDI_VERSION < NTDDI_VISTA -// -// This is a dummy definition for PDMACHANNELSLAVE. -// -typedef PVOID PDMACHANNELSLAVE; -#endif // NTDDI_VERSION < NTDDI_VISTA - -/***************************************************************************** - * INTERRUPTSYNCMODE - ***************************************************************************** - * Interrupt sync mode of operation. - */ -typedef enum -{ - InterruptSyncModeNormal = 1, // One pass, stop when successful. - InterruptSyncModeAll, // One pass regardless of success. - InterruptSyncModeRepeat // Repeat until all return unsuccessful. -} INTERRUPTSYNCMODE; - -/***************************************************************************** - * PINTERRUPTSYNCROUTINE - ***************************************************************************** - * Pointer to an interrupt synchronization routine. Both interrupt service - * routines and routines that are synchronized with ISRs use this type. - */ -typedef NTSTATUS -(*PINTERRUPTSYNCROUTINE) -( - __in struct IInterruptSync * InterruptSync, - __in PVOID DynamicContext -); - -/***************************************************************************** - * IInterruptSync - ***************************************************************************** - * Interface for objects providing access synchronization with interrupts. - */ -DECLARE_INTERFACE_(IInterruptSync,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,CallSynchronizedRoutine) - ( THIS_ - __in PINTERRUPTSYNCROUTINE Routine, - __in PVOID DynamicContext - ) PURE; - STDMETHOD_(PKINTERRUPT,GetKInterrupt) - ( THIS - ) PURE; - STDMETHOD_(NTSTATUS,Connect) - ( THIS - ) PURE; - STDMETHOD_(void,Disconnect) - ( THIS - ) PURE; - STDMETHOD_(NTSTATUS,RegisterServiceRoutine) - ( THIS_ - __in PINTERRUPTSYNCROUTINE Routine, - __in PVOID DynamicContext, - __in BOOLEAN First - ) PURE; -}; - -typedef IInterruptSync *PINTERRUPTSYNC; - -#ifdef PC_IMPLEMENTATION -#define IMP_IInterruptSync\ - STDMETHODIMP_(NTSTATUS) CallSynchronizedRoutine\ - ( __in PINTERRUPTSYNCROUTINE Routine,\ - __in PVOID DynamicContext\ - );\ - STDMETHODIMP_(PKINTERRUPT) GetKInterrupt\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) Connect\ - ( void\ - );\ - STDMETHODIMP_(void) Disconnect\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) RegisterServiceRoutine\ - ( __in PINTERRUPTSYNCROUTINE Routine,\ - __in PVOID DynamicContext,\ - __in BOOLEAN First\ - ) -#endif - -/***************************************************************************** - * IServiceSink - ***************************************************************************** - * Interface for notification sinks for service groups. - */ -DECLARE_INTERFACE_(IServiceSink,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // For IServiceSink - STDMETHOD_(void,RequestService) - ( THIS - ) PURE; -}; - -typedef IServiceSink *PSERVICESINK; - -#ifdef PC_IMPLEMENTATION -#define IMP_IServiceSink\ - STDMETHODIMP_(void) RequestService\ - ( void\ - ) -#endif - -/***************************************************************************** - * IServiceGroup - ***************************************************************************** - * Interface for objects representing a group that is serviced collectively. - */ -DECLARE_INTERFACE_(IServiceGroup,IServiceSink) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // For IServiceSink - STDMETHOD_(void,RequestService) - ( THIS - ) PURE; - - // For IServiceGroup - STDMETHOD_(NTSTATUS,AddMember) - ( THIS_ - __in PSERVICESINK pServiceSink - ) PURE; - - STDMETHOD_(void,RemoveMember) - ( THIS_ - __in PSERVICESINK pServiceSink - ) PURE; - - STDMETHOD_(void,SupportDelayedService) - ( THIS - ) PURE; - - STDMETHOD_(void,RequestDelayedService) - ( THIS_ - __in ULONGLONG ullDelay - ) PURE; - - STDMETHOD_(void,CancelDelayedService) - ( THIS - ) PURE; -}; - -typedef IServiceGroup *PSERVICEGROUP; - -#ifdef PC_IMPLEMENTATION -#define IMP_IServiceGroup\ - IMP_IServiceSink;\ - STDMETHODIMP_(NTSTATUS) AddMember\ - ( __in PSERVICESINK pServiceSink\ - );\ - STDMETHODIMP_(void) RemoveMember\ - ( __in PSERVICESINK pServiceSink\ - );\ - STDMETHODIMP_(void) SupportDelayedService\ - ( void\ - );\ - STDMETHODIMP_(void) RequestDelayedService\ - ( __in ULONGLONG ullDelay\ - );\ - STDMETHODIMP_(void) CancelDelayedService\ - ( void\ - ) -#endif - -/***************************************************************************** - * IRegistryKey - ***************************************************************************** - * Interface for objects providing access to a registry key. - */ -DECLARE_INTERFACE_(IRegistryKey,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,QueryKey) - ( THIS_ - __in KEY_INFORMATION_CLASS KeyInformationClass, - __out PVOID KeyInformation, - __in ULONG Length, - __out PULONG ResultLength - ) PURE; - - STDMETHOD_(NTSTATUS,EnumerateKey) - ( THIS_ - __in ULONG Index, - __in KEY_INFORMATION_CLASS KeyInformationClass, - __out PVOID KeyInformation, - __in ULONG Length, - __out PULONG ResultLength - ) PURE; - - STDMETHOD_(NTSTATUS,QueryValueKey) - ( THIS_ - __in PUNICODE_STRING ValueName, - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - __out PVOID KeyValueInformation, - __in ULONG Length, - __out PULONG ResultLength - ) PURE; - - STDMETHOD_(NTSTATUS,EnumerateValueKey) - ( THIS_ - __in ULONG Index, - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - __out PVOID KeyValueInformation, - __in ULONG Length, - __out PULONG ResultLength - ) PURE; - - STDMETHOD_(NTSTATUS,SetValueKey) - ( THIS_ - __in_opt PUNICODE_STRING ValueName, - __in ULONG Type, - __in PVOID Data, - __in ULONG DataSize - ) PURE; - - STDMETHOD_(NTSTATUS,QueryRegistryValues) - ( THIS_ - __in PRTL_QUERY_REGISTRY_TABLE QueryTable, - __in_opt PVOID Context - ) PURE; - - STDMETHOD_(NTSTATUS,NewSubKey) - ( THIS_ - __out IRegistryKey ** RegistrySubKey, - __in PUNKNOWN OuterUnknown, - __in ACCESS_MASK DesiredAccess, - __in PUNICODE_STRING SubKeyName, - __in ULONG CreateOptions, - __out_opt PULONG Disposition - ) PURE; - - STDMETHOD_(NTSTATUS,DeleteKey) - ( THIS - ) PURE; -}; - -typedef IRegistryKey *PREGISTRYKEY; - -#ifdef PC_IMPLEMENTATION -#define IMP_IRegistryKey\ - STDMETHODIMP_(NTSTATUS) QueryKey\ - ( __in KEY_INFORMATION_CLASS KeyInformationClass,\ - __out PVOID KeyInformation,\ - __in ULONG Length,\ - __out PULONG ResultLength\ - );\ - STDMETHODIMP_(NTSTATUS) EnumerateKey\ - ( __in ULONG Index,\ - __in KEY_INFORMATION_CLASS KeyInformationClass,\ - __out PVOID KeyInformation,\ - __in ULONG Length,\ - __out PULONG ResultLength\ - );\ - STDMETHODIMP_(NTSTATUS) QueryValueKey\ - ( __in PUNICODE_STRING ValueName,\ - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,\ - __out PVOID KeyValueInformation,\ - __in ULONG Length,\ - __out PULONG ResultLength\ - );\ - STDMETHODIMP_(NTSTATUS) EnumerateValueKey\ - ( __in ULONG Index,\ - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,\ - __out PVOID KeyValueInformation,\ - __in ULONG Length,\ - __out PULONG ResultLength\ - );\ - STDMETHODIMP_(NTSTATUS) SetValueKey\ - ( __in_opt PUNICODE_STRING ValueName,\ - __in ULONG Type,\ - __in PVOID Data,\ - __in ULONG DataSize\ - );\ - STDMETHODIMP_(NTSTATUS) QueryRegistryValues\ - ( __in PRTL_QUERY_REGISTRY_TABLE QueryTable,\ - __in_opt PVOID Context\ - );\ - STDMETHODIMP_(NTSTATUS) NewSubKey\ - ( __out IRegistryKey ** RegistrySubKey,\ - __in PUNKNOWN OuterUnknown,\ - __in ACCESS_MASK DesiredAccess,\ - __in PUNICODE_STRING SubKeyName,\ - __in ULONG CreateOptions,\ - __out_opt PULONG Disposition\ - );\ - STDMETHODIMP_(NTSTATUS) DeleteKey\ - ( void\ - ) -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -/***************************************************************************** - * IMusicTechnology - ***************************************************************************** - * Interface for setting MusicTechnology. - */ -DECLARE_INTERFACE_(IMusicTechnology,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // For IMusicTechnology - STDMETHOD_(NTSTATUS,SetTechnology) - ( THIS_ - __in const GUID * Technology - ) PURE; -}; - -typedef IMusicTechnology *PMUSICTECHNOLOGY; - -#define IMP_IMusicTechnology\ - STDMETHODIMP_(NTSTATUS) SetTechnology\ - ( __in const GUID * Technology\ - ) -#endif - -typedef struct _PCPROPERTY_REQUEST PCPROPERTY_REQUEST, *PPCPROPERTY_REQUEST; -typedef struct _PCMETHOD_REQUEST PCMETHOD_REQUEST, *PPCMETHOD_REQUEST; -typedef struct _PCEVENT_REQUEST PCEVENT_REQUEST, *PPCEVENT_REQUEST; - -/***************************************************************************** - * PCPFNPROPERTY_HANDLER - ***************************************************************************** - * Property handler function prototype. - * - * All property accesses and support queries for a given property on a given - * filter, pin or node are routed to a single handler. The parameter contains - * complete information regarding the request. The handler may return - * STATUS_PENDING, in which case it must eventually call - * PcCompletePendingPropertyRequest() to complete the request. - */ -typedef -NTSTATUS -(*PCPFNPROPERTY_HANDLER) -( - __in PPCPROPERTY_REQUEST PropertyRequest -); - -/***************************************************************************** - * PCPFNMETHOD_HANDLER - ***************************************************************************** - * Method handler function prototype. - * - * All method calls and support queries for a given method on a given filter, - * pin or node are routed to a single handler. The parameter contains - * complete information regarding the request. The handler may return - * STATUS_PENDING, in which case it must eventually call - * PcCompletePendingMethodRequest() to complete the request. - */ -typedef -NTSTATUS -(*PCPFNMETHOD_HANDLER) -( - __in PPCMETHOD_REQUEST MethodRequest -); - -/***************************************************************************** - * PCPFNEVENT_HANDLER - ***************************************************************************** - * Event handler function prototype. - * - * All event add and remove requests and all event support queries for a - * given event on a given filter, pin or node are routed to a single handler. - * The parameter contains complete information regarding the request. The - * handler may return STATUS_PENDING, in which case it must eventually call - * PcCompletePendingEventRequest() to complete the request. - */ -typedef -NTSTATUS -(*PCPFNEVENT_HANDLER) -( - __in PPCEVENT_REQUEST EventRequest -); - -/***************************************************************************** - * PCPROPERTY_ITEM - ***************************************************************************** - * Property table entry. - * - * A property item describes a property supported by a given filter, pin or - * node. The flags indicate what operations regarding the property are - * supported and specify selected options with respect to the port's handling - * of property requests. - */ -typedef struct -{ - const GUID * Set; - ULONG Id; - ULONG Flags; -#define PCPROPERTY_ITEM_FLAG_GET KSPROPERTY_TYPE_GET -#define PCPROPERTY_ITEM_FLAG_SET KSPROPERTY_TYPE_SET -#define PCPROPERTY_ITEM_FLAG_BASICSUPPORT KSPROPERTY_TYPE_BASICSUPPORT -//not supported #define PCPROPERTY_ITEM_FLAG_RELATIONS KSPROPERTY_TYPE_RELATIONS -#define PCPROPERTY_ITEM_FLAG_SERIALIZERAW KSPROPERTY_TYPE_SERIALIZERAW -#define PCPROPERTY_ITEM_FLAG_UNSERIALIZERAW KSPROPERTY_TYPE_UNSERIALIZERAW -#define PCPROPERTY_ITEM_FLAG_SERIALIZESIZE KSPROPERTY_TYPE_SERIALIZESIZE -#define PCPROPERTY_ITEM_FLAG_SERIALIZE\ - (PCPROPERTY_ITEM_FLAG_SERIALIZERAW\ - |PCPROPERTY_ITEM_FLAG_UNSERIALIZERAW\ - |PCPROPERTY_ITEM_FLAG_SERIALIZESIZE\ - ) -#define PCPROPERTY_ITEM_FLAG_DEFAULTVALUES KSPROPERTY_TYPE_DEFAULTVALUES - PCPFNPROPERTY_HANDLER Handler; -} -PCPROPERTY_ITEM, *PPCPROPERTY_ITEM; - -/***************************************************************************** - * PCMETHOD_ITEM - ***************************************************************************** - * Method table entry. - * - * A method item describes a method supported by a given filter, pin or node. - * The flags indicate what operations regarding the method are supported and - * specify selected options with respect to the port's handling of method - * requests. - */ -typedef struct -{ - const GUID * Set; - ULONG Id; - ULONG Flags; -#define PCMETHOD_ITEM_FLAG_NONE KSMETHOD_TYPE_NONE -#define PCMETHOD_ITEM_FLAG_READ KSMETHOD_TYPE_READ -#define PCMETHOD_ITEM_FLAG_WRITE KSMETHOD_TYPE_WRITE -#define PCMETHOD_ITEM_FLAG_MODIFY KSMETHOD_TYPE_MODIFY -#define PCMETHOD_ITEM_FLAG_SOURCE KSMETHOD_TYPE_SOURCE -#define PCMETHOD_ITEM_FLAG_BASICSUPPORT KSMETHOD_TYPE_BASICSUPPORT - PCPFNMETHOD_HANDLER Handler; -} -PCMETHOD_ITEM, *PPCMETHOD_ITEM; - -/***************************************************************************** - * PCEVENT_ITEM - ***************************************************************************** - * Event table entry. - * - * An event item describes an event supported by a given filter, pin or node. - * The flags indicate what operations regarding the event are supported and - * specify selected options with respect to the port's handling of event - * requests. - */ -typedef struct -{ - const GUID * Set; - ULONG Id; - ULONG Flags; -#define PCEVENT_ITEM_FLAG_ENABLE KSEVENT_TYPE_ENABLE -#define PCEVENT_ITEM_FLAG_ONESHOT KSEVENT_TYPE_ONESHOT -#define PCEVENT_ITEM_FLAG_BASICSUPPORT KSEVENT_TYPE_BASICSUPPORT - PCPFNEVENT_HANDLER Handler; -} -PCEVENT_ITEM, *PPCEVENT_ITEM; - -/***************************************************************************** - * PCPROPERTY_REQUEST - ***************************************************************************** - * Property request submitted to a property handler. - * - * This is the form that a property request takes. Although the major target - * is generic, in the case of miniports, it will be a pointer to the miniport - * object. Likewise, the minor target is the stream or voice if the request - * is specific to a stream or voice. Otherwise, the minor target is NULL. - * If the request is targeted at a node, the Node parameter will specify which - * one, otherwise it will be ULONG(-1). If the target is a node, the minor - * target may be specified to indicate the stream or voice with which the - * targeted node instance is associated. - */ -typedef struct _PCPROPERTY_REQUEST -{ - PUNKNOWN MajorTarget; - PUNKNOWN MinorTarget; - ULONG Node; - const PCPROPERTY_ITEM * PropertyItem; - ULONG Verb; - ULONG InstanceSize; - PVOID Instance; - ULONG ValueSize; - PVOID Value; - PIRP Irp; -} -PCPROPERTY_REQUEST, *PPCPROPERTY_REQUEST; - -/***************************************************************************** - * PCMETHOD_REQUEST - ***************************************************************************** - * Method request submitted to a property handler. - * - * Comments in the description of PCPROPERTY_REQUEST regarding the target - * fields apply to this structure as well. - */ -typedef struct _PCMETHOD_REQUEST -{ - PUNKNOWN MajorTarget; - PUNKNOWN MinorTarget; - ULONG Node; - const PCMETHOD_ITEM * MethodItem; - ULONG Verb; - // TODO -} -PCMETHOD_REQUEST, *PPCMETHOD_REQUEST; - -/***************************************************************************** - * PCEVENT_REQUEST - ***************************************************************************** - * Event request submitted to a property handler. - * - * Comments in the description of PCPROPERTY_REQUEST regarding the target - * fields apply to this structure as well. - */ -typedef struct _PCEVENT_REQUEST -{ - PUNKNOWN MajorTarget; - PUNKNOWN MinorTarget; - ULONG Node; - const PCEVENT_ITEM * EventItem; - PKSEVENT_ENTRY EventEntry; - ULONG Verb; - PIRP Irp; -} -PCEVENT_REQUEST, *PPCEVENT_REQUEST; - -#define PCEVENT_VERB_NONE 0 -#define PCEVENT_VERB_ADD 1 -#define PCEVENT_VERB_REMOVE 2 -#define PCEVENT_VERB_SUPPORT 4 - -/***************************************************************************** - * PCAUTOMATION_TABLE - ***************************************************************************** - * Master table of properties, methods and events. - * - * Any of the item pointers may be NULL, in which case, corresponding counts - * must be zero. For item tables that are not zero length, the item size must - * not be smaller than the size of the item structure defined by port class. - * The item size may be larger, in which case the port class item structure is - * assumed to be followed by private data. Item sizes must be a multiple of - * 8. - */ -typedef struct -{ - ULONG PropertyItemSize; - ULONG PropertyCount; - const PCPROPERTY_ITEM * Properties; - ULONG MethodItemSize; - ULONG MethodCount; - const PCMETHOD_ITEM * Methods; - ULONG EventItemSize; - ULONG EventCount; - const PCEVENT_ITEM * Events; - ULONG Reserved; -} -PCAUTOMATION_TABLE, *PPCAUTOMATION_TABLE; - -#define DEFINE_PCAUTOMATION_TABLE_PROP(AutomationTable,PropertyTable)\ -const PCAUTOMATION_TABLE AutomationTable =\ -{\ - sizeof(PropertyTable[0]),\ - SIZEOF_ARRAY(PropertyTable),\ - (const PCPROPERTY_ITEM *) PropertyTable,\ - 0,0,NULL,\ - 0,0,NULL,\ - 0\ -} - -#define DEFINE_PCAUTOMATION_TABLE_PROP_EVENT(AutomationTable,PropertyTable,EventTable)\ -const PCAUTOMATION_TABLE AutomationTable =\ -{\ - sizeof(PropertyTable[0]),\ - SIZEOF_ARRAY(PropertyTable),\ - (const PCPROPERTY_ITEM *) PropertyTable,\ - 0,0,NULL,\ - sizeof(EventTable[0]),\ - SIZEOF_ARRAY(EventTable),\ - (const PCEVENT_ITEM *) EventTable,\ - 0\ -} - -#define DEFINE_PCAUTOMATION_TABLE_EVENT(AutomationTable,EventTable)\ -const PCAUTOMATION_TABLE AutomationTable =\ -{\ - 0,0,NULL,\ - 0,0,NULL,\ - sizeof(EventTable[0]),\ - SIZEOF_ARRAY(EventTable),\ - (const PCEVENT_ITEM *) EventTable,\ - 0\ -} - -/***************************************************************************** - * PCPIN_DESCRIPTOR for IMiniport::GetDescription() - ***************************************************************************** - * Description of a pin on the filter implemented by the miniport. - * - * MaxGlobalInstanceCount and MaxFilterInstanceCount may be zero to indicate - * that the pin may not be instantiated, ULONG(-1) to indicate the pin may be - * allocated any number of times, or any other value to indicate a specific - * number of times the pin may be allocated. MinFilterInstanceCount may not - * be ULONG(-1) because it specifies a definite lower bound on the number of - * instances of a pin that must exist in order for a filter to function. - * - * The KS pin descriptor may have zero interfaces and zero mediums. The list - * of interfaces is ignored in all cases. The medium list will default to - * a list containing only the standard medium (device I/O). - * - * The automation table pointer may be NULL indicating that no automation is - * supported. - */ -typedef struct -{ - ULONG MaxGlobalInstanceCount; - ULONG MaxFilterInstanceCount; - ULONG MinFilterInstanceCount; - const PCAUTOMATION_TABLE * AutomationTable; - KSPIN_DESCRIPTOR KsPinDescriptor; -} -PCPIN_DESCRIPTOR, *PPCPIN_DESCRIPTOR; - -/***************************************************************************** - * PCNODE_DESCRIPTOR for IMiniport::GetDescription() - ***************************************************************************** - * Description of a node in the filter implemented by the miniport. - * - * The automation table pointer may be NULL indicating that no automation is - * supported. The name GUID pointer may be NULL indicating that the type GUID - * should be used to determine the node name. - */ -typedef struct -{ - ULONG Flags; - const PCAUTOMATION_TABLE * AutomationTable; - const GUID * Type; - const GUID * Name; -} -PCNODE_DESCRIPTOR, *PPCNODE_DESCRIPTOR; - -/***************************************************************************** - * PCCONNECTION_DESCRIPTOR for IMiniport::GetDescription() - ***************************************************************************** - * Description of a node connection in the topology of the filter implemented - * by the miniport. - */ -typedef KSTOPOLOGY_CONNECTION -PCCONNECTION_DESCRIPTOR, *PPCCONNECTION_DESCRIPTOR; - -/***************************************************************************** - * PCFILTER_DESCRIPTOR for IMiniport::GetDescription() - ***************************************************************************** - * Description of the of the filter implemented by a miniport, including - * pins, nodes, connections and properties. - * - * The version number should be zero. - */ -typedef struct -{ - ULONG Version; - const PCAUTOMATION_TABLE * AutomationTable; - ULONG PinSize; - ULONG PinCount; - const PCPIN_DESCRIPTOR * Pins; - ULONG NodeSize; - ULONG NodeCount; - const PCNODE_DESCRIPTOR * Nodes; - ULONG ConnectionCount; - const PCCONNECTION_DESCRIPTOR * Connections; - ULONG CategoryCount; - const GUID * Categories; -} -PCFILTER_DESCRIPTOR, *PPCFILTER_DESCRIPTOR; - -/***************************************************************************** - * PCFILTER_NODE for IMiniport::GetTopology() - ***************************************************************************** - * The placeholder for the FromNode or ToNode fields in connections which - * describe connections to the filter's pins. - */ -#define PCFILTER_NODE KSFILTER_NODE - -/***************************************************************************** - * IMiniport - ***************************************************************************** - * Interface common to all miniports. - */ -DECLARE_INTERFACE_(IMiniport,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport -}; - -typedef IMiniport *PMINIPORT; - -#define IMP_IMiniport\ - STDMETHODIMP_(NTSTATUS) GetDescription\ - ( __out PPCFILTER_DESCRIPTOR * Description\ - );\ - STDMETHODIMP_(NTSTATUS) DataRangeIntersection\ - ( __in ULONG PinId,\ - __in PKSDATARANGE DataRange,\ - __in PKSDATARANGE MatchingDataRange,\ - __in ULONG OutputBufferLength,\ - __out_opt PVOID ResultantFormat,\ - __out PULONG ResultantFormatLength\ - ) - -/***************************************************************************** - * IPort - ***************************************************************************** - * Interface common to all port lower edges. - */ -DECLARE_INTERFACE_(IPort,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort -}; - -typedef IPort *PPORT; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPort\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PDEVICE_OBJECT DeviceObject,\ - __in_opt PIRP Irp,\ - __in PUNKNOWN UnknownMiniport,\ - __in_opt PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList\ - );\ - STDMETHODIMP_(NTSTATUS) GetDeviceProperty\ - ( __in DEVICE_REGISTRY_PROPERTY DeviceProperty,\ - __in ULONG BufferLength,\ - __out PVOID PropertyBuffer,\ - __out PULONG ResultLength\ - );\ - STDMETHODIMP_(NTSTATUS) NewRegistryKey\ - ( __out PREGISTRYKEY * OutRegistryKey,\ - __in_opt PUNKNOWN OuterUnknown,\ - __in ULONG RegistryKeyType,\ - __in ACCESS_MASK DesiredAccess,\ - __in_opt POBJECT_ATTRIBUTES ObjectAttributes,\ - __in_opt ULONG CreateOptions,\ - __out_opt PULONG Disposition\ - ) -#endif - -/***************************************************************************** - * IPortMidi - ***************************************************************************** - * Interface for MIDI port lower edge. - */ -DECLARE_INTERFACE_(IPortMidi,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort - - // For IPortMidi - STDMETHOD_(void,Notify) - ( THIS_ - __in_opt PSERVICEGROUP ServiceGroup - ) PURE; - - STDMETHOD_(void,RegisterServiceGroup) - ( THIS_ - __in PSERVICEGROUP ServiceGroup - ) PURE; -}; - -typedef IPortMidi *PPORTMIDI; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortMidi\ - IMP_IPort;\ - STDMETHODIMP_(void) Notify\ - ( __in_opt PSERVICEGROUP ServiceGroup\ - );\ - STDMETHODIMP_(void) RegisterServiceGroup\ - ( __in PSERVICEGROUP ServiceGroup\ - ) -#endif - -/***************************************************************************** - * IMiniportMidiStream - ***************************************************************************** - * Interface for MIDI miniport streams. - */ -DECLARE_INTERFACE_(IMiniportMidiStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,SetFormat) - ( THIS_ - __in PKSDATAFORMAT DataFormat - ) PURE; - - STDMETHOD_(NTSTATUS,SetState) - ( THIS_ - __in KSSTATE State - ) PURE; - - STDMETHOD_(NTSTATUS,Read) - ( THIS_ - __in PVOID BufferAddress, - __in ULONG BufferLength, - __out PULONG BytesRead - ) PURE; - - STDMETHOD_(NTSTATUS,Write) - ( THIS_ - __in PVOID BufferAddress, - __in ULONG BytesToWrite, - __out PULONG BytesWritten - ) PURE; -}; - -typedef IMiniportMidiStream *PMINIPORTMIDISTREAM; - -#define IMP_IMiniportMidiStream\ - STDMETHODIMP_(NTSTATUS) SetFormat\ - ( __in PKSDATAFORMAT DataFormat\ - );\ - STDMETHODIMP_(NTSTATUS) SetState\ - ( __in KSSTATE State\ - );\ - STDMETHODIMP_(NTSTATUS) Read\ - ( __in PVOID BufferAddress,\ - __in ULONG BufferLength,\ - __out PULONG BytesRead\ - );\ - STDMETHODIMP_(NTSTATUS) Write\ - ( __in PVOID BufferAddress,\ - __in ULONG BytesToWrite,\ - __out PULONG BytesWritten\ - ) - -/***************************************************************************** - * IMiniportMidi - ***************************************************************************** - * Interface for MIDI miniports. - */ -DECLARE_INTERFACE_(IMiniportMidi,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportMidi - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTMIDI Port, - __out PSERVICEGROUP * ServiceGroup - ) PURE; - - STDMETHOD_(void,Service) - ( THIS - ) PURE; - - STDMETHOD_(NTSTATUS,NewStream) - ( THIS_ - __out PMINIPORTMIDISTREAM * Stream, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in ULONG Pin, - __in BOOLEAN Capture, - __in PKSDATAFORMAT DataFormat, - __out PSERVICEGROUP * ServiceGroup - ) PURE; -}; - -typedef IMiniportMidi *PMINIPORTMIDI; - -#define IMP_IMiniportMidi\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTMIDI Port,\ - __out PSERVICEGROUP * ServiceGroup\ - );\ - STDMETHODIMP_(void) Service\ - ( void\ - );\ - STDMETHODIMP_(NTSTATUS) NewStream\ - ( __out PMINIPORTMIDISTREAM * Stream,\ - __in_opt PUNKNOWN OuterUnknown,\ - __in POOL_TYPE PoolType,\ - __in ULONG Pin,\ - __in BOOLEAN Capture,\ - __in PKSDATAFORMAT DataFormat,\ - __out PSERVICEGROUP * ServiceGroup\ - ) - -/***************************************************************************** - * IPortDMus - ***************************************************************************** - * See DMusicKS.h - */ - -/***************************************************************************** - * IMXF - ***************************************************************************** - * See DMusicKS.h - */ - -/***************************************************************************** - * IAllocatorMXF - ***************************************************************************** - * See DMusicKS.h - */ - -/***************************************************************************** - * IMiniportDMus - ***************************************************************************** - * See DMusicKS.h - */ - - -/***************************************************************************** - * IPortTopology - ***************************************************************************** - * Interface for topology port lower edge. - */ -DECLARE_INTERFACE_(IPortTopology,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort -}; - -typedef IPortTopology *PPORTTOPOLOGY; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortTopology IMP_IPort -#endif - -/***************************************************************************** - * IMiniportTopology - ***************************************************************************** - * Interface for topology miniports. - */ -DECLARE_INTERFACE_(IMiniportTopology,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportTopology - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTTOPOLOGY Port - ) PURE; -}; - -typedef IMiniportTopology *PMINIPORTTOPOLOGY; - -#define IMP_IMiniportTopology\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTTOPOLOGY Port\ - ) - -/***************************************************************************** - * IPortWaveCyclic - ***************************************************************************** - * Interface for cyclic wave port lower edge. - */ -DECLARE_INTERFACE_(IPortWaveCyclic,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort - - // For IPortWaveCyclic - STDMETHOD_(void,Notify) - ( THIS_ - __in PSERVICEGROUP ServiceGroup - ) PURE; - - STDMETHOD_(NTSTATUS,NewSlaveDmaChannel) - ( THIS_ - __out PDMACHANNELSLAVE * DmaChannel, - __in PUNKNOWN OuterUnknown, - __in PRESOURCELIST ResourceList, - __in ULONG DmaIndex, - __in ULONG MaximumLength, - __in BOOLEAN DemandMode, - __in DMA_SPEED DmaSpeed - ) PURE; - - STDMETHOD_(NTSTATUS,NewMasterDmaChannel) - ( THIS_ - __out PDMACHANNEL * DmaChannel, - __in PUNKNOWN OuterUnknown, - __in_opt PRESOURCELIST ResourceList, - __in ULONG MaximumLength, - __in BOOLEAN Dma32BitAddresses, - __in BOOLEAN Dma64BitAddresses, - __in DMA_WIDTH DmaWidth, - __in DMA_SPEED DmaSpeed - ) PURE; -}; - -typedef IPortWaveCyclic *PPORTWAVECYCLIC; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortWaveCyclic\ - IMP_IPort;\ - STDMETHODIMP_(void) Notify\ - ( __in PSERVICEGROUP ServiceGroup\ - );\ - STDMETHODIMP_(NTSTATUS) NewSlaveDmaChannel\ - ( __out PDMACHANNELSLAVE * DmaChannel,\ - __in PUNKNOWN OuterUnknown,\ - __in PRESOURCELIST ResourceList,\ - __in ULONG DmaIndex,\ - __in ULONG MaximumLength,\ - __in BOOLEAN DemandMode,\ - __in DMA_SPEED DmaSpeed\ - );\ - STDMETHODIMP_(NTSTATUS) NewMasterDmaChannel\ - ( __out PDMACHANNEL * DmaChannel,\ - __in PUNKNOWN OuterUnknown,\ - __in_opt PRESOURCELIST ResourceList,\ - __in ULONG MaximumLength,\ - __in BOOLEAN Dma32BitAddresses,\ - __in BOOLEAN Dma64BitAddresses,\ - __in DMA_WIDTH DmaWidth,\ - __in DMA_SPEED DmaSpeed\ - ) -#endif - -/***************************************************************************** - * IMiniportWaveCyclicStream - ***************************************************************************** - * Interface for cyclic wave miniport streams. - */ -DECLARE_INTERFACE_(IMiniportWaveCyclicStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,SetFormat) - ( THIS_ - __in PKSDATAFORMAT DataFormat - ) PURE; - - STDMETHOD_(ULONG,SetNotificationFreq) - ( THIS_ - __in ULONG Interval, - __out PULONG FrameSize - ) PURE; - - STDMETHOD_(NTSTATUS,SetState) - ( THIS_ - __in KSSTATE State - ) PURE; - - STDMETHOD_(NTSTATUS,GetPosition) - ( THIS_ - __out PULONG Position - ) PURE; - - STDMETHOD_(NTSTATUS,NormalizePhysicalPosition) - ( THIS_ - __inout PLONGLONG PhysicalPosition - ) PURE; - - STDMETHOD_(void,Silence) - ( THIS_ - __in PVOID Buffer, - __in ULONG ByteCount - ) PURE; -}; - -typedef IMiniportWaveCyclicStream *PMINIPORTWAVECYCLICSTREAM; - -#define IMP_IMiniportWaveCyclicStream\ - STDMETHODIMP_(NTSTATUS) SetFormat\ - ( __in PKSDATAFORMAT DataFormat\ - );\ - STDMETHODIMP_(ULONG) SetNotificationFreq\ - ( __in ULONG Interval,\ - __out PULONG FrameSize\ - );\ - STDMETHODIMP_(NTSTATUS) SetState\ - ( __in KSSTATE State\ - );\ - STDMETHODIMP_(NTSTATUS) GetPosition\ - ( __out PULONG Position\ - );\ - STDMETHODIMP_(NTSTATUS) NormalizePhysicalPosition\ - ( __inout PLONGLONG PhysicalPosition\ - );\ - STDMETHODIMP_(void) Silence\ - ( __in PVOID Buffer,\ - __in ULONG ByteCount\ - ) - -/***************************************************************************** - * IMiniportWaveCyclic - ***************************************************************************** - * Interface for cyclic wave miniports. - */ -DECLARE_INTERFACE_(IMiniportWaveCyclic,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportWaveCyclic - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTWAVECYCLIC Port - ) PURE; - - STDMETHOD_(NTSTATUS,NewStream) - ( THIS_ - __out PMINIPORTWAVECYCLICSTREAM * Stream, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in ULONG Pin, - __in BOOLEAN Capture, - __in PKSDATAFORMAT DataFormat, - __out PDMACHANNEL * DmaChannel, - __out PSERVICEGROUP * ServiceGroup - ) PURE; -}; - -typedef IMiniportWaveCyclic *PMINIPORTWAVECYCLIC; - -#define IMP_IMiniportWaveCyclic\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTWAVECYCLIC Port\ - );\ - STDMETHODIMP_(NTSTATUS) NewStream\ - ( __out PMINIPORTWAVECYCLICSTREAM * Stream,\ - __in_opt PUNKNOWN OuterUnknown,\ - __in POOL_TYPE PoolType,\ - __in ULONG Pin,\ - __in BOOLEAN Capture,\ - __in PKSDATAFORMAT DataFormat,\ - __out PDMACHANNEL * DmaChannel,\ - __out PSERVICEGROUP * ServiceGroup\ - ) - -/***************************************************************************** - * IPortWavePci - ***************************************************************************** - * Interface for PCI wave port lower edge. - */ -DECLARE_INTERFACE_(IPortWavePci,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort - - // For IPortWavePci - STDMETHOD_(void,Notify) - ( THIS_ - __in PSERVICEGROUP ServiceGroup - ) PURE; - - STDMETHOD_(NTSTATUS,NewMasterDmaChannel) - ( THIS_ - __out PDMACHANNEL * OutDmaChannel, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in_opt PRESOURCELIST ResourceList, - __in BOOLEAN ScatterGather, - __in BOOLEAN Dma32BitAddresses, - __in BOOLEAN Dma64BitAddresses, - __in BOOLEAN IgnoreCount, - __in DMA_WIDTH DmaWidth, - __in DMA_SPEED DmaSpeed, - __in ULONG MaximumLength, - __in ULONG DmaPort - ) PURE; -}; - -typedef IPortWavePci *PPORTWAVEPCI; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortWavePci\ - IMP_IPort;\ - STDMETHODIMP_(void) Notify\ - ( __in PSERVICEGROUP ServiceGroup\ - );\ - STDMETHODIMP_(NTSTATUS) NewMasterDmaChannel\ - ( __out PDMACHANNEL * OutDmaChannel,\ - __in_opt PUNKNOWN OuterUnknown,\ - __in POOL_TYPE PoolType,\ - __in_opt PRESOURCELIST ResourceList,\ - __in BOOLEAN ScatterGather,\ - __in BOOLEAN Dma32BitAddresses,\ - __in BOOLEAN Dma64BitAddresses,\ - __in BOOLEAN IgnoreCount,\ - __in DMA_WIDTH DmaWidth,\ - __in DMA_SPEED DmaSpeed,\ - __in ULONG MaximumLength,\ - __in ULONG DmaPort\ - ) -#endif - -/***************************************************************************** - * IPortWavePciStream - ***************************************************************************** - * Interface for PCI wave port pin lower edge. - */ -DECLARE_INTERFACE_(IPortWavePciStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,GetMapping) - ( THIS_ - __in PVOID Tag, - __out PPHYSICAL_ADDRESS PhysicalAddress, - __out PVOID * VirtualAddress, - __out PULONG ByteCount, - __out PULONG Flags - ) PURE; - - STDMETHOD_(NTSTATUS,ReleaseMapping) - ( THIS_ - __in PVOID Tag - ) PURE; - - STDMETHOD_(NTSTATUS,TerminatePacket) - ( THIS - ) PURE; -}; - -typedef IPortWavePciStream *PPORTWAVEPCISTREAM; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortWavePciStream\ - STDMETHODIMP_(NTSTATUS) GetMapping\ - ( __in PVOID Tag,\ - __out PPHYSICAL_ADDRESS PhysicalAddress,\ - __out PVOID * VirtualAddress,\ - __out PULONG ByteCount,\ - __out PULONG Flags\ - );\ - STDMETHODIMP_(NTSTATUS) ReleaseMapping\ - ( __in PVOID Tag\ - );\ - STDMETHODIMP_(NTSTATUS) TerminatePacket\ - ( void\ - ) -#endif - -/***************************************************************************** - * IMiniportWavePciStream - ***************************************************************************** - * Interface for PCI wave miniport streams. - */ -DECLARE_INTERFACE_(IMiniportWavePciStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,SetFormat) - ( THIS_ - __in PKSDATAFORMAT DataFormat - ) PURE; - - STDMETHOD_(NTSTATUS,SetState) - ( THIS_ - __in KSSTATE State - ) PURE; - - STDMETHOD_(NTSTATUS,GetPosition) - ( THIS_ - __out PULONGLONG Position - ) PURE; - - STDMETHOD_(NTSTATUS,NormalizePhysicalPosition) - ( - THIS_ - __inout PLONGLONG PhysicalPosition - ) PURE; - - STDMETHOD_(NTSTATUS,GetAllocatorFraming) - ( - THIS_ - __out PKSALLOCATOR_FRAMING AllocatorFraming - ) PURE; - - STDMETHOD_(NTSTATUS,RevokeMappings) - ( THIS_ - __in PVOID FirstTag, - __in PVOID LastTag, - __out PULONG MappingsRevoked - ) PURE; - - STDMETHOD_(void,MappingAvailable) - ( THIS - ) PURE; - - STDMETHOD_(void,Service) - ( THIS - ) PURE; -}; - -typedef IMiniportWavePciStream *PMINIPORTWAVEPCISTREAM; - -#define IMP_IMiniportWavePciStream\ - STDMETHODIMP_(NTSTATUS) SetFormat\ - ( __in PKSDATAFORMAT DataFormat\ - );\ - STDMETHODIMP_(NTSTATUS) SetState\ - ( __in KSSTATE State\ - );\ - STDMETHODIMP_(NTSTATUS) GetPosition\ - ( __out PULONGLONG Position\ - );\ - STDMETHODIMP_(NTSTATUS) NormalizePhysicalPosition\ - ( __inout PLONGLONG PhysicalPosition\ - );\ - STDMETHODIMP_(NTSTATUS) GetAllocatorFraming\ - ( __out PKSALLOCATOR_FRAMING AllocatorFraming\ - );\ - STDMETHODIMP_(NTSTATUS) RevokeMappings\ - ( __in PVOID FirstTag,\ - __in PVOID LastTag,\ - __out PULONG MappingsRevoked\ - );\ - STDMETHODIMP_(void) MappingAvailable\ - ( void\ - );\ - STDMETHODIMP_(void) Service\ - ( void\ - ) - -/***************************************************************************** - * IMiniportWavePci - ***************************************************************************** - * Interface for PCI wave miniports. - */ -DECLARE_INTERFACE_(IMiniportWavePci,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportWavePci - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTWAVEPCI Port, - __out PSERVICEGROUP * ServiceGroup - ) PURE; - - STDMETHOD_(NTSTATUS,NewStream) - ( THIS_ - __out PMINIPORTWAVEPCISTREAM * Stream, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in PPORTWAVEPCISTREAM PortStream, - __in ULONG Pin, - __in BOOLEAN Capture, - __in PKSDATAFORMAT DataFormat, - __out PDMACHANNEL * DmaChannel, - __out PSERVICEGROUP * ServiceGroup - ) PURE; - - STDMETHOD_(void,Service) - ( THIS - ) PURE; -}; - -typedef IMiniportWavePci *PMINIPORTWAVEPCI; - -#define IMP_IMiniportWavePci\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTWAVEPCI Port,\ - __out PSERVICEGROUP * ServiceGroup\ - );\ - STDMETHODIMP_(NTSTATUS) NewStream\ - ( __out PMINIPORTWAVEPCISTREAM * Stream,\ - __in_opt PUNKNOWN OuterUnknown,\ - __in POOL_TYPE PoolType,\ - __in PPORTWAVEPCISTREAM PortStream,\ - __in ULONG Pin,\ - __in BOOLEAN Capture,\ - __in PKSDATAFORMAT DataFormat,\ - __out PDMACHANNEL * DmaChannel,\ - __out PSERVICEGROUP * ServiceGroup\ - );\ - STDMETHODIMP_(void) Service\ - ( void\ - ) - -#if (NTDDI_VERSION >= NTDDI_VISTA) -/***************************************************************************** - * IPortWaveRT - ***************************************************************************** - * Interface for WaveRT port lower edge. - */ -DECLARE_INTERFACE_(IPortWaveRT,IPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_PORT() // For IPort -}; - -typedef IPortWaveRT *PPORTWAVERT; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortWaveRT\ - IMP_IPort -#endif - -/***************************************************************************** - * IPortWaveRTStream - ***************************************************************************** - * Interface for WaveRT stream port lower edge. - */ -DECLARE_INTERFACE_(IPortWaveRTStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(PMDL, AllocatePagesForMdl) - ( THIS_ - __in PHYSICAL_ADDRESS HighAddress, - __in SIZE_T TotalBytes - ) PURE; - - STDMETHOD_(PMDL, AllocateContiguousPagesForMdl) - ( THIS_ - __in PHYSICAL_ADDRESS LowAddress, - __in PHYSICAL_ADDRESS HighAddress, - __in SIZE_T TotalBytes - ) PURE; - - STDMETHOD_(PVOID, MapAllocatedPages) - ( THIS_ - __in PMDL MemoryDescriptorList, - __in MEMORY_CACHING_TYPE CacheType - ) PURE; - - STDMETHOD_(VOID, UnmapAllocatedPages) - ( THIS_ - __in PVOID BaseAddress, - __in PMDL MemoryDescriptorList - ) PURE; - - STDMETHOD_(VOID, FreePagesFromMdl) - ( THIS_ - __in PMDL MemoryDescriptorList - ) PURE; - - STDMETHOD_(ULONG, GetPhysicalPagesCount) - ( THIS_ - __in PMDL MemoryDescriptorList - ) PURE; - - STDMETHOD_(PHYSICAL_ADDRESS, GetPhysicalPageAddress) - ( THIS_ - __in PMDL MemoryDescriptorList, - __in ULONG Index - ) PURE; -}; - -typedef IPortWaveRTStream *PPORTWAVERTSTREAM; - -#ifdef PC_IMPLEMENTATION -#define IMP_IPortWaveRTStream\ - STDMETHODIMP_(PMDL) AllocatePagesForMdl\ - (\ - __in PHYSICAL_ADDRESS HighAddress,\ - __in SIZE_T TotalBytes\ - );\ - STDMETHODIMP_(PMDL) AllocateContiguousPagesForMdl\ - (\ - __in PHYSICAL_ADDRESS LowAddress,\ - __in PHYSICAL_ADDRESS HighAddress,\ - __in SIZE_T TotalBytes\ - );\ - STDMETHODIMP_(PVOID) MapAllocatedPages\ - (\ - __in PMDL MemoryDescriptorList,\ - __in MEMORY_CACHING_TYPE CacheType\ - );\ - STDMETHODIMP_(VOID) UnmapAllocatedPages\ - (\ - __in PVOID BaseAddress,\ - __in PMDL MemoryDescriptorList\ - );\ - STDMETHODIMP_(VOID) FreePagesFromMdl\ - (\ - __in PMDL MemoryDescriptorList\ - );\ - STDMETHODIMP_(ULONG) GetPhysicalPagesCount\ - (\ - __in PMDL MemoryDescriptorList\ - );\ - STDMETHODIMP_(PHYSICAL_ADDRESS) GetPhysicalPageAddress\ - (\ - __in PMDL MemoryDescriptorList,\ - __in ULONG Index\ - ) -#endif - -/***************************************************************************** - * IMiniportWaveRTStream - ***************************************************************************** - * Interface for WaveRT miniport stream. - */ -DECLARE_INTERFACE_(IMiniportWaveRTStream,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM() // For IMiniportWaveRTStream -}; - -typedef IMiniportWaveRTStream *PMINIPORTWAVERTSTREAM; - -#define IMP_IMiniportWaveRTStream\ - STDMETHODIMP_(NTSTATUS) SetFormat\ - ( __in PKSDATAFORMAT DataFormat\ - );\ - STDMETHODIMP_(NTSTATUS) SetState\ - ( __in KSSTATE State\ - );\ - STDMETHODIMP_(NTSTATUS) GetPosition\ - ( __out PKSAUDIO_POSITION Position\ - );\ - STDMETHODIMP_(NTSTATUS) AllocateAudioBuffer\ - (\ - __in ULONG RequestedSize,\ - __out PMDL *AudioBufferMdl,\ - __out ULONG *ActualSize,\ - __out ULONG *OffsetFromFirstPage,\ - __out MEMORY_CACHING_TYPE *CacheType\ - );\ - STDMETHODIMP_(VOID) FreeAudioBuffer\ - (\ - __in_opt PMDL AudioBufferMdl,\ - __in ULONG BufferSize\ - );\ - STDMETHODIMP_(VOID) GetHWLatency\ - (\ - __out KSRTAUDIO_HWLATENCY *hwLatency\ - );\ - STDMETHODIMP_(NTSTATUS) GetPositionRegister\ - (\ - __out KSRTAUDIO_HWREGISTER *Register\ - );\ - STDMETHODIMP_(NTSTATUS) GetClockRegister\ - (\ - __out KSRTAUDIO_HWREGISTER *Register\ - ) - - -/***************************************************************************** - * IMiniportWaveRTStreamNotification - ***************************************************************************** - * Interface for WaveRT miniport stream buffer notification extensions. - */ -DECLARE_INTERFACE_(IMiniportWaveRTStreamNotification,IMiniportWaveRTStream) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORTWAVERTSTREAM() // For IMiniportWaveRTStream - - STDMETHOD_(NTSTATUS,AllocateBufferWithNotification) - ( THIS_ - __in ULONG NotificationCount, - __in ULONG RequestedSize, - __out PMDL *AudioBufferMdl, - __out ULONG *ActualSize, - __out ULONG *OffsetFromFirstPage, - __out MEMORY_CACHING_TYPE *CacheType - ) PURE; - - STDMETHOD_(VOID,FreeBufferWithNotification) - ( THIS_ - __in PMDL AudioBufferMdl, - __in ULONG BufferSize - ) PURE; - - STDMETHOD_(NTSTATUS,RegisterNotificationEvent) - ( THIS_ - __in PKEVENT NotificationEvent - ) PURE; - - STDMETHOD_(NTSTATUS,UnregisterNotificationEvent) - ( THIS_ - __in PKEVENT NotificationEvent - ) PURE; -}; - -typedef IMiniportWaveRTStreamNotification *PMINIPORTWAVERTSTREAMNOTIFICATION; - -#define IMP_IMiniportWaveRTStreamNotification\ - STDMETHODIMP_(NTSTATUS) AllocateBufferWithNotification\ - (\ - __in ULONG NotificationCount,\ - __in ULONG RequestedSize,\ - __out PMDL *AudioBufferMdl,\ - __out ULONG *ActualSize,\ - __out ULONG *OffsetFromFirstPage,\ - __out MEMORY_CACHING_TYPE *CacheType\ - );\ - STDMETHODIMP_(VOID) FreeBufferWithNotification\ - (\ - __in PMDL AudioBufferMdl,\ - __in ULONG BufferSize\ - );\ - STDMETHODIMP_(NTSTATUS) RegisterNotificationEvent\ - (\ - __in PKEVENT NotificationEvent\ - );\ - STDMETHODIMP_(NTSTATUS) UnregisterNotificationEvent\ - (\ - __in PKEVENT NotificationEvent\ - ) - -/***************************************************************************** - * IMiniportWaveRT - ***************************************************************************** - * Interface for WaveRT miniports. - */ -DECLARE_INTERFACE_(IMiniportWaveRT,IMiniport) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_MINIPORT() // For IMiniport - - // For IMiniportWaveRT - STDMETHOD_(NTSTATUS,Init) - ( THIS_ - __in PUNKNOWN UnknownAdapter, - __in PRESOURCELIST ResourceList, - __in PPORTWAVERT Port - ) PURE; - - STDMETHOD_(NTSTATUS,NewStream) - ( THIS_ - __out PMINIPORTWAVERTSTREAM * Stream, - __in PPORTWAVERTSTREAM PortStream, - __in ULONG Pin, - __in BOOLEAN Capture, - __in PKSDATAFORMAT DataFormat - ) PURE; - - STDMETHOD_(NTSTATUS,GetDeviceDescription) - ( THIS_ - __out PDEVICE_DESCRIPTION DeviceDescription - ) PURE; -}; - -typedef IMiniportWaveRT *PMINIPORTWAVERT; - -#define IMP_IMiniportWaveRT\ - IMP_IMiniport;\ - STDMETHODIMP_(NTSTATUS) Init\ - ( __in PUNKNOWN UnknownAdapter,\ - __in PRESOURCELIST ResourceList,\ - __in PPORTWAVERT Port\ - );\ - STDMETHODIMP_(NTSTATUS) NewStream\ - ( __out PMINIPORTWAVERTSTREAM * Stream,\ - __in PPORTWAVERTSTREAM PortStream,\ - __in ULONG Pin,\ - __in BOOLEAN Capture,\ - __in PKSDATAFORMAT DataFormat\ - );\ - STDMETHODIMP_(NTSTATUS) GetDeviceDescription\ - ( __out PDEVICE_DESCRIPTION DeviceDescription\ - ) -#endif - -/***************************************************************************** - * IAdapterPowerManagement - ***************************************************************************** - * An interface that adapters should implement and - * register if they want power management messages. - * Register this interface with PortCls via the - * PcRegisterAdapterPowerManagement() call. - * - * NOTE: If you want to fill in the caps struct - * for your device, register the interface - * with PortCls in or before your AddDevice() - * function. The OS queries devices before - * StartDevice() gets called. - */ -DECLARE_INTERFACE_(IAdapterPowerManagement,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // Called by PortCls to tell the device - // to change to the new power state. - // - STDMETHOD_(void,PowerChangeState) - ( THIS_ - __in POWER_STATE NewState - ) PURE; - - // Called by PortCls to ask whether the device - // can change to the requested power state. - // - STDMETHOD_(NTSTATUS,QueryPowerChangeState) - ( THIS_ - __in POWER_STATE NewStateQuery - ) PURE; - - // Called by PortCls to get the power management - // capabilities of the device. See ACPI documentation - // for data about the DEVICE_CAPABILITIES struct. - // - STDMETHOD_(NTSTATUS,QueryDeviceCapabilities) - ( THIS_ - __in PDEVICE_CAPABILITIES PowerDeviceCaps - ) PURE; -}; - -typedef IAdapterPowerManagement *PADAPTERPOWERMANAGEMENT; - -#define IMP_IAdapterPowerManagement\ - STDMETHODIMP_(void) PowerChangeState\ - ( __in POWER_STATE NewState\ - );\ - STDMETHODIMP_(NTSTATUS) QueryPowerChangeState\ - ( __in POWER_STATE NewStateQuery\ - );\ - STDMETHODIMP_(NTSTATUS) QueryDeviceCapabilities\ - ( __in PDEVICE_CAPABILITIES PowerDeviceCaps\ - ) - -/***************************************************************************** - * IAdapterPowerManagement2 - ***************************************************************************** - * An interface that adapters should implement and - * register if they want power management messages. - * Register this interface with PortCls via the - * PcRegisterAdapterPowerManagement() call. - * - * NOTE: If you want to fill in the caps struct - * for your device, register the interface - * with PortCls in or before your AddDevice() - * function. The OS queries devices before - * StartDevice() gets called. - */ -DECLARE_INTERFACE_(IAdapterPowerManagement2,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - DEFINE_ABSTRACT_ADAPTERPOWERMANAGEMENT() - - // Called by PortCls to tell the device - // to change to the new power state. - // - STDMETHOD_(void,PowerChangeState2) - ( THIS_ - __in DEVICE_POWER_STATE NewDeviceState, - __in SYSTEM_POWER_STATE NewSystemState - ) PURE; -}; - -typedef IAdapterPowerManagement2 *PADAPTERPOWERMANAGEMENT2; - -#define IMP_IAdapterPowerManagement2\ - IMP_IAdapterPowerManagement;\ - STDMETHODIMP_(void) PowerChangeState2\ - ( __in DEVICE_POWER_STATE NewDeviceState,\ - __in SYSTEM_POWER_STATE NewSystemState\ - );\ - -/***************************************************************************** - * IPowerNotify - ***************************************************************************** - * An OPTIONAL interface for miniports and pins to implement to - * enable them to get device power state change notifications. - */ -DECLARE_INTERFACE_(IPowerNotify,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // Called by the port to notify registered miniports - // and pins of device power state changes, so that - // appropriate context save/restore can take place. - // - STDMETHOD_(void,PowerChangeNotify) - ( THIS_ - __in POWER_STATE PowerState - ) PURE; -}; - -typedef IPowerNotify *PPOWERNOTIFY; - -#define IMP_IPowerNotify\ - STDMETHODIMP_(void) PowerChangeNotify\ - ( __in POWER_STATE PowerState\ - ) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -/***************************************************************************** - * IPinCount - ***************************************************************************** - * An OPTIONAL interface for miniports to implement to - * enable them to get pin count queries, for dynamic pin counts. - */ -DECLARE_INTERFACE_(IPinCount,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // Called by the port to notify registered miniports - // of pin count queries, so that appropriate pin - // count manipulation can take place. - // - STDMETHOD_(void,PinCount) - ( THIS_ - __in ULONG PinId, - __inout PULONG FilterNecessary, - __inout PULONG FilterCurrent, - __inout PULONG FilterPossible, - __inout PULONG GlobalCurrent, - __inout PULONG GlobalPossible - ) PURE; -}; - -typedef IPinCount *PPINCOUNT; - -#define IMP_IPinCount \ - STDMETHODIMP_(void) PinCount \ - ( __in ULONG PinId, \ - __inout PULONG FilterNecessary, \ - __inout PULONG FilterCurrent, \ - __inout PULONG FilterPossible, \ - __inout PULONG GlobalCurrent, \ - __inout PULONG GlobalPossible \ - ) -#endif - -/***************************************************************************** - * IPortEvents - ***************************************************************************** - * An interface implemented by ports to provide - * notification event helpers to miniports. - */ -DECLARE_INTERFACE_(IPortEvents,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(void,AddEventToEventList) - ( THIS_ - __in PKSEVENT_ENTRY EventEntry - ) PURE; - STDMETHOD_(void,GenerateEventList) - ( THIS_ - __in_opt GUID* Set, - __in ULONG EventId, - __in BOOL PinEvent, - __in ULONG PinId, - __in BOOL NodeEvent, - __in ULONG NodeId - ) PURE; -}; - -typedef IPortEvents *PPORTEVENTS; - -#define IMP_IPortEvents\ - STDMETHODIMP_(void) AddEventToEventList\ - ( __in PKSEVENT_ENTRY EventEntry\ - );\ - STDMETHODIMP_(void) GenerateEventList\ - ( __in_opt GUID* Set,\ - __in ULONG EventId,\ - __in BOOL PinEvent,\ - __in ULONG PinId,\ - __in BOOL NodeEvent,\ - __in ULONG NodeId\ - ) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -/***************************************************************************** - * IDrmPort - ***************************************************************************** - * An optional interface implemented by ports - * to provide DRM functionality to miniports. - */ -DECLARE_INTERFACE_(IDrmPort,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_DRMPORT() // For IDrmPort -}; - -typedef IDrmPort *PDRMPORT; - -#define IMP_IDrmPort\ - STDMETHODIMP_(NTSTATUS) CreateContentMixed \ - ( __in PULONG paContentId, \ - __in ULONG cContentId, \ - __out PULONG pMixedContentId \ - ); \ - STDMETHODIMP_(NTSTATUS) DestroyContent \ - ( __in ULONG ContentId \ - ); \ - STDMETHODIMP_(NTSTATUS) ForwardContentToFileObject \ - ( __in ULONG ContentId, \ - __in PFILE_OBJECT FileObject \ - ); \ - STDMETHODIMP_(NTSTATUS) ForwardContentToInterface \ - ( __in ULONG ContentId, \ - __in PUNKNOWN pUnknown, \ - __in ULONG NumMethods \ - ); \ - STDMETHODIMP_(NTSTATUS) GetContentRights \ - ( __in ULONG ContentId, \ - __out PDRMRIGHTS DrmRights \ - ) - -/***************************************************************************** - * IDrmPort2 - ***************************************************************************** - * An optional interface implemented by ports - * to provide DRM functionality to miniports. - * This is identical to IDrmPort with the - * addition of two new routines. - */ -DECLARE_INTERFACE_(IDrmPort2,IDrmPort) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - DEFINE_ABSTRACT_DRMPORT() // For IDrmPort - - STDMETHOD_(NTSTATUS,AddContentHandlers) - ( THIS_ - __in ULONG ContentId, - __in PVOID * paHandlers, - __in ULONG NumHandlers - ) PURE; - STDMETHOD_(NTSTATUS,ForwardContentToDeviceObject) - ( THIS_ - __in ULONG ContentId, - __in PVOID Reserved, - __in PCDRMFORWARD DrmForward - ) PURE; -}; - -typedef IDrmPort2 *PDRMPORT2; - -#define IMP_IDrmPort2 \ - IMP_IDrmPort; \ - STDMETHODIMP_(NTSTATUS) AddContentHandlers \ - ( __in ULONG ContentId, \ - __in PVOID * paHandlers, \ - __in ULONG NumHandlers \ - ); \ - STDMETHODIMP_(NTSTATUS) ForwardContentToDeviceObject\ - ( __in ULONG ContentId, \ - __in PVOID Reserved, \ - __in PCDRMFORWARD DrmForward \ - ) - -/***************************************************************************** - * IPortClsVersion - ***************************************************************************** - * What version of PortCls is this? - */ -DECLARE_INTERFACE_(IPortClsVersion,IUnknown) -{ - STDMETHOD_(DWORD,GetVersion) - ( THIS - ) PURE; -}; - -typedef IPortClsVersion *PPORTCLSVERSION; - - -/***************************************************************************** - * IPortClsSubdeviceEx - ***************************************************************************** - * Provide access to new subdevice registration APIs - * PcRegisterSubdeviceEx and PcEnableSubDeviceInterfaces - */ -DECLARE_INTERFACE_(IPortClsSubdeviceEx,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS, UpdatePinDescriptor) - ( - __in ULONG _ulPinId, - __in ULONG _ulFlags, - __in PPCPIN_DESCRIPTOR _pPinDescriptor - ) PURE; -}; - -#define PCUPDATE_PIN_DESC_FLAG_DATARANGES 0x00000001 - -typedef IPortClsSubdeviceEx *PPORTCLSSubdeviceEx; - -/***************************************************************************** - * IPortClsPower - ***************************************************************************** - * Used to access the adapter power management functions. - */ -DECLARE_INTERFACE_(IPortClsPower,IUnknown) -{ - STDMETHOD_(NTSTATUS,RegisterAdapterPowerManagement) - ( - __in PUNKNOWN _pUnknown, - __in PDEVICE_OBJECT _DeviceObject - ) PURE; - STDMETHOD_(NTSTATUS,UnregisterAdapterPowerManagement) - ( - __in PDEVICE_OBJECT _DeviceObject - ) PURE; - STDMETHOD_(NTSTATUS,SetIdlePowerManagement) - ( - __in PDEVICE_OBJECT _DeviceObject, - __in BOOLEAN _bEnabled - ) PURE; -}; - -typedef IPortClsPower *PPORTCLSPOWER; - -// DO NOT ASSUME THAT EACH SUCCESSIVE ENUM IMPLIES A FEATURE SUPERSET! -// Example: Win2K has more audio features than Win98SE_QFE2. -// -enum -{ - kVersionInvalid = -1, - - kVersionWin98, // IPortClsVersion is unsupported - kVersionWin98SE, // IPortClsVersion is unsupported - kVersionWin2K, // IPortClsVersion is unsupported - - kVersionWin98SE_QFE2, // IPortClsVersion is unsupported - // Hotfix Package 269601 (contains 242937 and 247565) - - kVersionWin2K_SP2, // IPortClsVersion is supported - - kVersionWinME, // IPortClsVersion is unsupported - - kVersionWin98SE_QFE3, // IPortClsVersion is supported - // Hotfix Package (not yet released, as of 6/15/2001) - - kVersionWinME_QFE1, // IPortClsVersion is supported - // Hotfix Package (not yet released, as of 6/15/2001) - - kVersionWinXP, // IPortClsVersion is supported - kVersionWinXPSP1, // IPortClsVersion is supported - - kVersionWinServer2003,// IPortClsVersion is supported - - kVersionWin2K_UAAQFE, // IPortClsVersion is supported - kVersionWinXP_UAAQFE, // IPortClsVersion is supported - kVersionWinServer2003_UAAQFE, // IPortClsVersion is supported - - kVersionWindowsLonghorn // IPortClsVersion is supported - - // Additional enum values will be added here, in - // *roughly* chronological (not feature set) order. -}; - -/***************************************************************************** - * IPortWMIRegistration - *****************************************************************************/ -DECLARE_INTERFACE_(IPortWMIRegistration,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,RegisterWMIProvider) - ( THIS_ - PDEVICE_OBJECT, - PVOID - ) PURE; - STDMETHOD_(NTSTATUS,UnregisterWMIProvider) - ( - THIS_ - PDEVICE_OBJECT - ) PURE; -}; - -typedef IPortWMIRegistration *PPORTWMIREGISTRATION; - -/***************************************************************************** - * IPreFetchOffset - ***************************************************************************** - * An interface implemented by the pin to implement prefetch characteristics - * of bus master hardware - to specify the hardware queue size, determining - * the pad between play cursor and write cursor. - */ -DECLARE_INTERFACE_(IPreFetchOffset,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(VOID,SetPreFetchOffset) - ( THIS_ - __in ULONG PreFetchOffset - ) PURE; -}; - -typedef IPreFetchOffset *PPREFETCHOFFSET; - -#define IMP_IPreFetchOffset\ - STDMETHODIMP_(VOID) SetPreFetchOffset\ - (\ - __in ULONG PreFetchOffset\ - ) -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2003) -/***************************************************************************** - * IUnregisterSubdevice - ***************************************************************************** - * An interface implemented by the port to implement a method to remove the - * registered subdevice. - */ -DECLARE_INTERFACE_(IUnregisterSubdevice,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,UnregisterSubdevice) - ( THIS_ - __in PDEVICE_OBJECT DeviceObject, - __in PUNKNOWN Unknown - ) PURE; -}; - -typedef IUnregisterSubdevice *PUNREGISTERSUBDEVICE; - -#define IMP_IUnregisterSubdevice\ - STDMETHODIMP_(NTSTATUS) UnregisterSubdevice\ - (\ - __in PDEVICE_OBJECT DeviceObject,\ - __in PUNKNOWN Unknown\ - ) - -/***************************************************************************** - * IUnregisterPhysicalConnection - ***************************************************************************** - * An interface implemented by the port to implement a method to remove the - * registered physical connections. - */ -DECLARE_INTERFACE_(IUnregisterPhysicalConnection,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - STDMETHOD_(NTSTATUS,UnregisterPhysicalConnection) - ( THIS_ - __in PDEVICE_OBJECT DeviceObject, - __in PUNKNOWN FromUnknown, - __in ULONG FromPin, - __in PUNKNOWN ToUnknown, - __in ULONG ToPin - ) PURE; - - STDMETHOD_(NTSTATUS,UnregisterPhysicalConnectionToExternal) - ( THIS_ - __in PDEVICE_OBJECT DeviceObject, - __in PUNKNOWN FromUnknown, - __in ULONG FromPin, - __in PUNICODE_STRING ToString, - __in ULONG ToPin - ) PURE; - - STDMETHOD_(NTSTATUS,UnregisterPhysicalConnectionFromExternal) - ( THIS_ - __in PDEVICE_OBJECT DeviceObject, - __in PUNICODE_STRING FromString, - __in ULONG FromPin, - __in PUNKNOWN ToUnknown, - __in ULONG ToPin - ) PURE; -}; - -typedef IUnregisterPhysicalConnection *PUNREGISTERPHYSICALCONNECTION; - -#define IMP_IUnregisterPhysicalConnection\ - STDMETHODIMP_(NTSTATUS) UnregisterPhysicalConnection\ - (\ - __in PDEVICE_OBJECT DeviceObject,\ - __in PUNKNOWN FromUnknown,\ - __in ULONG FromPin,\ - __in PUNKNOWN ToUnknown,\ - __in ULONG ToPin\ - );\ - STDMETHODIMP_(NTSTATUS) UnregisterPhysicalConnectionToExternal\ - (\ - __in PDEVICE_OBJECT DeviceObject,\ - __in PUNKNOWN FromUnknown,\ - __in ULONG FromPin,\ - __in PUNICODE_STRING ToString,\ - __in ULONG ToPin\ - );\ - STDMETHODIMP_(NTSTATUS) UnregisterPhysicalConnectionFromExternal\ - (\ - __in PDEVICE_OBJECT DeviceObject,\ - __in PUNICODE_STRING FromString,\ - __in ULONG FromPin,\ - __in PUNKNOWN ToUnknown,\ - __in ULONG ToPin\ - ) -#endif - - -/***************************************************************************** - * IPinName, - ***************************************************************************** - * An OPTIONAL interface for miniports to implement to - * enable them to get pin name from miniport driver - */ -DECLARE_INTERFACE_(IPinName,IUnknown) -{ - DEFINE_ABSTRACT_UNKNOWN() // For IUnknown - - // Called by the port to notify registered miniports - // for servicing verndor defined pin property - // - STDMETHOD_(NTSTATUS,GetPinName) - ( THIS_ - __in PIRP Irp, - __in PKSP_PIN Pin, - __out PVOID Data - ) PURE; -}; - -typedef IPinName *PIPINNAME; - -#define IMP_IPinName \ - STDMETHODIMP_(NTSTATUS) GetPinName \ - ( __in PIRP Irp, \ - __in PKSP_PIN Pin, \ - __out PVOID Data \ - ); - - -/***************************************************************************** - * Functions. - */ - -/***************************************************************************** - * PCPFNSTARTDEVICE - ***************************************************************************** - * Type for start device callback. - */ -typedef -NTSTATUS -(*PCPFNSTARTDEVICE) -( -#ifdef PC_OLD_NAMES - __in PVOID DeviceObject, - __in PVOID Irp, -#else - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, -#endif - __in PRESOURCELIST ResourceList -); - -#if (NTDDI_VERSION < NTDDI_WINXP) -/***************************************************************************** - * PCPFNIRPHANDLER - ***************************************************************************** - * Type for IRP handlers. - */ -typedef -NTSTATUS -(*PCPFNIRPHANDLER) -( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __out PULONG Action -#define IRP_HANDLER_ACTION_DEFAULT 0 -#define IRP_HANDLER_ACTION_FINISH 1 -#define IRP_HANDLER_ACTION_FORWARD 2 -); -#endif - -/***************************************************************************** - * PcInitializeAdapterDriver() - ***************************************************************************** - * Initializes an adapter driver. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcInitializeAdapterDriver -( - __in PDRIVER_OBJECT DriverObject, - __in PUNICODE_STRING RegistryPathName, - __in PDRIVER_ADD_DEVICE AddDevice -); - -/***************************************************************************** - * PcDispatchIrp() - ***************************************************************************** - * Dispatch an IRP. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcDispatchIrp -( - __in PDEVICE_OBJECT pDeviceObject, - __in PIRP pIrp -); - -/***************************************************************************** - * PcAddAdapterDevice() - ***************************************************************************** - * Adds an adapter device. DeviceExtensionSize may be zero for default size. - */ -PORTCLASSAPI -NTSTATUS -__drv_fun(__drv_clearDoInit(yes)) -NTAPI -PcAddAdapterDevice -( - __in PDRIVER_OBJECT DriverObject, - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in PCPFNSTARTDEVICE StartDevice, - __in ULONG MaxObjects, - __in ULONG DeviceExtensionSize -); - -/***************************************************************************** - * PcCompleteIrp() - ***************************************************************************** - * Complete an IRP unless status is STATUS_PENDING. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcCompleteIrp -( - __in PDEVICE_OBJECT pDeviceObject, - __in PIRP pIrp, - __in NTSTATUS ntStatus -); - -/***************************************************************************** - * PcForwardIrpSynchronous() - ***************************************************************************** - * Forward a PnP IRP to the PDO. The IRP is not completed at this level, - * this function does not return until the lower driver has completed the IRP, - * and DecrementPendingIrpCount() is not called. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcForwardIrpSynchronous -( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp -); - -/***************************************************************************** - * PcRegisterSubdevice() - ***************************************************************************** - * Registers a subdevice. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterSubdevice -( - __in PDEVICE_OBJECT DeviceObject, - __in PWSTR Name, - __in PUNKNOWN Unknown -); - -/***************************************************************************** - * PcRegisterPhysicalConnection() - ***************************************************************************** - * Registers a physical connection between subdevices. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterPhysicalConnection -( - __in PDEVICE_OBJECT DeviceObject, - __in PUNKNOWN FromUnknown, - __in ULONG FromPin, - __in PUNKNOWN ToUnknown, - __in ULONG ToPin -); - -/***************************************************************************** - * PcRegisterPhysicalConnectionToExternal() - ***************************************************************************** - * Registers a physical connection from a subdevice to an external device. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterPhysicalConnectionToExternal -( - __in PDEVICE_OBJECT DeviceObject, - __in PUNKNOWN FromUnknown, - __in ULONG FromPin, - __in PUNICODE_STRING ToString, - __in ULONG ToPin -); - -/***************************************************************************** - * PcRegisterPhysicalConnectionFromExternal() - ***************************************************************************** - * Registers a physical connection to a subdevice from an external device. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterPhysicalConnectionFromExternal -( - __in PDEVICE_OBJECT DeviceObject, - __in PUNICODE_STRING FromString, - __in ULONG FromPin, - __in PUNKNOWN ToUnknown, - __in ULONG ToPin -); - -/***************************************************************************** - * PcNewPort() - ***************************************************************************** - * Creates an instance of a port driver. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewPort -( - __out PPORT * OutPort, - __in REFCLSID ClassID -); - -/***************************************************************************** - * PcNewMiniport() - ***************************************************************************** - * Creates an instance of a system-supplied miniport driver. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewMiniport -( - __out PMINIPORT * OutMiniPort, - __in REFCLSID ClassID -); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -/***************************************************************************** - * PcNewDmaChannel() - ***************************************************************************** - * Creates a DMA channel. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewDmaChannel -( - __out PDMACHANNEL * OutDmaChannel, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in PDEVICE_DESCRIPTION DeviceDescription, - __in PDEVICE_OBJECT DeviceObject -); -#endif - -/***************************************************************************** - * PcCompletePendingPropertyRequest() - ***************************************************************************** - * Completes a pending property request. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcCompletePendingPropertyRequest -( - __in PPCPROPERTY_REQUEST PropertyRequest, - __in NTSTATUS NtStatus -); - -/***************************************************************************** - * PcGetTimeInterval - ***************************************************************************** - * Gets the system time interval - */ -PORTCLASSAPI -ULONGLONG -NTAPI -PcGetTimeInterval -( - __in ULONGLONG Since -); - -#define GTI_SECONDS(t) (ULONGLONG(t)*10000000) -#define GTI_MILLISECONDS(t) (ULONGLONG(t)*10000) -#define GTI_MICROSECONDS(t) (ULONGLONG(t)*10) - -/***************************************************************************** - * PcNewResourceList() - ***************************************************************************** - * Creates and initializes a resource list. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewResourceList -( - __out PRESOURCELIST * OutResourceList, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in PCM_RESOURCE_LIST TranslatedResources, - __in PCM_RESOURCE_LIST UntranslatedResources -); - -/***************************************************************************** - * PcNewResourceSublist() - ***************************************************************************** - * Creates and initializes an empty resource list derived from another - * resource list. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewResourceSublist -( - __out PRESOURCELIST * OutResourceList, - __in_opt PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType, - __in PRESOURCELIST ParentList, - __in ULONG MaximumEntries -); - -/***************************************************************************** - * PcNewInterruptSync() - ***************************************************************************** - * Creates and initializes an interrupt-level synchronization object. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewInterruptSync -( - __out PINTERRUPTSYNC * OutInterruptSync, - __in_opt PUNKNOWN OuterUnknown, - __in PRESOURCELIST ResourceList, - __in ULONG ResourceIndex, - __in INTERRUPTSYNCMODE Mode -); - -/***************************************************************************** - * PcNewServiceGroup() - ***************************************************************************** - * Creates and initializes a service group object. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewServiceGroup -( - __out PSERVICEGROUP * OutServiceGroup, - __in_opt PUNKNOWN OuterUnknown -); - -/***************************************************************************** - * PcNewRegistryKey() - ***************************************************************************** - * Creates and initializes a registry key object. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcNewRegistryKey -( - __out PREGISTRYKEY * OutRegistryKey, - __in_opt PUNKNOWN OuterUnknown, - __in ULONG RegistryKeyType, - __in ACCESS_MASK DesiredAccess, - __in_opt PVOID DeviceObject, - __in_opt PVOID SubDevice, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt ULONG CreateOptions, - __out_opt PULONG Disposition -); - -/***************************************************************************** - * RegistryKeyType for NewRegistryKey() - ***************************************************************************** - * Enumeration of key types. - */ -enum -{ - GeneralRegistryKey, // ObjectAttributes and CreateOptions are req'd. - DeviceRegistryKey, // Device Object is required - DriverRegistryKey, // Device Object is required - HwProfileRegistryKey, // Device Object is required - DeviceInterfaceRegistryKey // Device Object and SubDevice are required -}; - -/***************************************************************************** - * PcGetDeviceProperty() - ***************************************************************************** - * This returns the requested device property from the registry. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcGetDeviceProperty -( - __in PVOID DeviceObject, - __in DEVICE_REGISTRY_PROPERTY DeviceProperty, - __in ULONG BufferLength, - __out PVOID PropertyBuffer, - __out PULONG ResultLength -); - -/***************************************************************************** - * PcRegisterAdapterPowerManagement() - ***************************************************************************** - * Register the adapter's power management interface with PortCls. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterAdapterPowerManagement -( - __in PUNKNOWN Unknown, - __in PVOID pvContext1 -); - -/***************************************************************************** - * PcUnregisterAdapterPowerManagement() - ***************************************************************************** - * Unregister the adapter's power management interface with PortCls. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcUnregisterAdapterPowerManagement -( - __in PDEVICE_OBJECT pDeviceObject -); - -/***************************************************************************** - * PcRequestNewPowerState() - ***************************************************************************** - * This routine is used to request a new power state for the device. It is - * normally not needed by adapter drivers but is exported in order to - * support unusual circumstances. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcRequestNewPowerState -( - __in PDEVICE_OBJECT pDeviceObject, - __in DEVICE_POWER_STATE RequestedNewState -); - -/***************************************************************************** - * PcRegisterIoTimeout() - ***************************************************************************** - * This routine registers a driver-supplied callback associated with a given - * device object (see IoInitializeTimer in the DDK). This callback that will - * be called approximately once per second while the device is active (see - * IoStartTimer, and IoStopTimer in the DDK - these are called upon device - * START and STOP). - * - * This routine must be called at PASSIVE_LEVEL. - * pTimerRoutine can and will be called at DISPATCH_LEVEL; it must be non-paged. - * - */ -__drv_maxIRQL(PASSIVE_LEVEL) -PORTCLASSAPI -NTSTATUS -NTAPI -PcRegisterIoTimeout -( - __in PDEVICE_OBJECT pDeviceObject, - __in PIO_TIMER_ROUTINE pTimerRoutine, - __in PVOID pContext -); - -/***************************************************************************** - * PcUnregisterIoTimeout() - ***************************************************************************** - * This routine unregisters a driver-supplied callback associated with a given - * device object. This callback must have been previously registered with - * PcRegisterIoTimeout (with the same device object, timer routine and context). - * - * This routine must be called at PASSIVE_LEVEL. - * pTimerRoutine can and will be called at DISPATCH_LEVEL; it must be non-paged. - * - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcUnregisterIoTimeout -( - __in PDEVICE_OBJECT pDeviceObject, - __in PIO_TIMER_ROUTINE pTimerRoutine, - __in PVOID pContext -); - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -/***************************************************************************** - * Pc DRM functions - ***************************************************************************** - * These functions link directly to the kernel-mode Digital Rights Management - * module. They all must be called at PASSIVE_LEVEL. - */ -PORTCLASSAPI -NTSTATUS -NTAPI -PcAddContentHandlers -( - __in ULONG ContentId, - __in PVOID * paHandlers, - __in ULONG NumHandlers -); - -PORTCLASSAPI -NTSTATUS -NTAPI -PcCreateContentMixed -( - __in PULONG paContentId, - __in ULONG cContentId, - __out PULONG pMixedContentId -); - -PORTCLASSAPI -NTSTATUS -NTAPI -PcDestroyContent -( - __in ULONG ContentId -); - -PORTCLASSAPI -NTSTATUS -NTAPI -PcForwardContentToDeviceObject -( - __in ULONG ContentId, - __in PVOID Reserved, - __in PCDRMFORWARD DrmForward -); - -__drv_preferredFunction("DrmForwardContentToDeviceObject", "Obsolete") -PORTCLASSAPI -NTSTATUS -NTAPI -PcForwardContentToFileObject -( - __in ULONG ContentId, - __in PFILE_OBJECT FileObject -); - -PORTCLASSAPI -NTSTATUS -NTAPI -PcForwardContentToInterface -( - __in ULONG ContentId, - __in PUNKNOWN pUnknown, - __in ULONG NumMethods -); - -PORTCLASSAPI -NTSTATUS -NTAPI -PcGetContentRights -( - __in ULONG ContentId, - __out PDRMRIGHTS DrmRights -); -#endif - -#ifdef PC_OLD_NAMES - -#define InitializeAdapterDriver(c1,c2,a) \ - PcInitializeAdapterDriver(PDRIVER_OBJECT(c1),PUNICODE_STRING(c2),PDRIVER_ADD_DEVICE(a)) -#define AddAdapterDevice(c1,c2,s,m) \ - PcAddAdapterDevice(PDRIVER_OBJECT(c1),PDEVICE_OBJECT(c2),s,m,0) -#define RegisterSubdevice(c1,c2,n,u) \ - PcRegisterSubdevice(PDEVICE_OBJECT(c1),n,u) -#define RegisterPhysicalConnection(c1,c2,fs,fp,ts,tp) \ - PcRegisterPhysicalConnection(PDEVICE_OBJECT(c1),fs,fp,ts,tp) -#define RegisterPhysicalConnectionToExternal(c1,c2,fs,fp,ts,tp) \ - PcRegisterPhysicalConnectionToExternal(PDEVICE_OBJECT(c1),fs,fp,ts,tp) -#define RegisterPhysicalConnectionFromExternal(c1,c2,fs,fp,ts,tp) \ - PcRegisterPhysicalConnectionFromExternal(PDEVICE_OBJECT(c1),fs,fp,ts,tp) - -#define NewPort PcNewPort -#define NewMiniport PcNewMiniport -#define CompletePendingPropertyRequest PcCompletePendingPropertyRequest - -#if (NTDDI_VERSION < NTDDI_WINXP) -#define NewIrpStreamVirtual PcNewIrpStreamVirtual -#define NewIrpStreamPhysical PcNewIrpStreamPhysical -#endif - -#define NewResourceList PcNewResourceList -#define NewResourceSublist PcNewResourceSublist -#define NewDmaChannel PcNewDmaChannel -#define NewServiceGroup PcNewServiceGroup -#define GetTimeInterval PcGetTimeInterval - -#define WIN95COMPAT_ReadPortUChar(Port) READ_PORT_UCHAR(Port) -#define WIN95COMPAT_WritePortUChar(Port,Value) WRITE_PORT_UCHAR(Port,Value) -#define WIN95COMPAT_ReadPortUShort(Port) READ_PORT_USHORT(Port) -#define WIN95COMPAT_WritePortUShort(Port,Value) WRITE_PORT_USHORT(Port,Value) - -#endif //PC_OLD_NAMES - - - -#endif //_PORTCLS_H_ - diff --git a/qt-correction-tool/pub/ddk/prefix.h b/qt-correction-tool/pub/ddk/prefix.h deleted file mode 100644 index 0a93024..0000000 --- a/qt-correction-tool/pub/ddk/prefix.h +++ /dev/null @@ -1,305 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - prefix.h - -Abstract: - - This module defines the data structures that enable the RDBSS to use the prefix package - to catalog its server and netroot names. For the moment, file/directory names use the same stuff. - -Author: -Revision History: - ---*/ - -#ifndef _RXPREFIX_ -#define _RXPREFIX_ - -// this stuff is implemented in prefix.c - -/* - The current implementation uses a table that has as components: - - 1) a prefix table - 2) a queue - 3) a version - 4) a lock - - You use the lock in the normal way: shared to lookup; eclusive to change. the version changes - eith each change. The reason that we have the queue is that the prefix table package allows - caller to be enumerating at a time..... the Q/version approach allows multiple guys at a time. - The Q could be used as a faster lookup for filenames but the prefix table is definitely the - right thing for netroots. - -*/ - -typedef struct _RX_CONNECTION_ID { - union { - ULONG SessionID; - LUID Luid; - }; -} RX_CONNECTION_ID, *PRX_CONNECTION_ID; - -ULONG -RxTableComputeHashValue ( - IN PUNICODE_STRING Name - ); - -PVOID -RxPrefixTableLookupName ( - IN PRX_PREFIX_TABLE ThisTable, - IN PUNICODE_STRING CanonicalName, - OUT PUNICODE_STRING RemainingName, - IN PRX_CONNECTION_ID ConnectionId - ); - -PRX_PREFIX_ENTRY -RxPrefixTableInsertName ( - IN OUT PRX_PREFIX_TABLE ThisTable, - IN OUT PRX_PREFIX_ENTRY ThisEntry, - IN PVOID Container, - IN PULONG ContainerRefCount, - IN USHORT CaseInsensitiveLength, - IN PRX_CONNECTION_ID ConnectionId - ); - -VOID -RxRemovePrefixTableEntry ( - IN OUT PRX_PREFIX_TABLE ThisTable, - IN OUT PRX_PREFIX_ENTRY Entry - ); - -VOID -RxDereferenceEntryContainer ( - IN OUT PRX_PREFIX_ENTRY Entry, - IN PRX_PREFIX_TABLE PrefixTable - ); - -BOOLEAN -RxIsNameTableEmpty ( - IN PRX_PREFIX_TABLE ThisTable - ); - -VOID -RxInitializePrefixTable ( - IN OUT PRX_PREFIX_TABLE ThisTable, - IN ULONG TableSize OPTIONAL, - IN BOOLEAN CaseInsensitiveMatch - ); - -VOID -RxFinalizePrefixTable ( - IN OUT PRX_PREFIX_TABLE ThisTable - ); - -// -// Rx form of a table entry. -// - -typedef struct _RX_PREFIX_ENTRY { - - // - // Normal Header for Refcounted Structure - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // the initial part of the name that is always case insensitive - // - - USHORT CaseInsensitiveLength; - USHORT Spare1; - - ULONG SavedHashValue; - LIST_ENTRY HashLinks; - - // - // queue of the set members - // - - LIST_ENTRY MemberQLinks; - - // - // Name of the entry - // - - UNICODE_STRING Prefix; - - // - // Pointer to the reference count of the container - // - - PULONG ContainerRefCount; - - // - // don't know the parent type...nor do all callers! - // thus, i need this backptr. - // - - PVOID ContainingRecord; - - // - // some space that alternate table routines can use - // - - PVOID Context; - - // - // Used for controlled multiplexing - // - - RX_CONNECTION_ID ConnectionId; - -} RX_PREFIX_ENTRY, *PRX_PREFIX_ENTRY; - -// -// Rx form of name table. wraps in a lock and a queue. Originally, this implementation used the prefix tables -// in Rtl which don't allow an empty string entry. so, we special case this. -// - -#define RX_PREFIX_TABLE_DEFAULT_LENGTH 32 - -typedef -PVOID -(*PRX_TABLE_LOOKUPNAME) ( - IN PRX_PREFIX_TABLE ThisTable, - IN PUNICODE_STRING CanonicalName, - OUT PUNICODE_STRING RemainingName - ); - -typedef -PRX_PREFIX_ENTRY -(*PRX_TABLE_INSERTENTRY) ( - IN OUT PRX_PREFIX_TABLE ThisTable, - IN OUT PRX_PREFIX_ENTRY ThisEntry - ); - -typedef -VOID -(*PRX_TABLE_REMOVEENTRY) ( - IN OUT PRX_PREFIX_TABLE ThisTable, - IN OUT PRX_PREFIX_ENTRY Entry - ); - -typedef struct _RX_PREFIX_TABLE { - - // - // Normal Header - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // version stamp changes on each insertion/removal - // - - ULONG Version; - - // - // queue of the inserted names - // - - LIST_ENTRY MemberQueue; - - // - // Resource used to control table access - // - - ERESOURCE TableLock; - - // - // PrefixEntry for the Null string - // - - PRX_PREFIX_ENTRY TableEntryForNull; - - BOOLEAN CaseInsensitiveMatch; - - // - // we may act differently for this....esp for debug! - // - - BOOLEAN IsNetNameTable; - ULONG TableSize; - -#if DBG - ULONG Lookups; - ULONG FailedLookups; - ULONG Considers; - ULONG Compares; -#endif - - LIST_ENTRY HashBuckets[RX_PREFIX_TABLE_DEFAULT_LENGTH]; - -} RX_PREFIX_TABLE, *PRX_PREFIX_TABLE; - - -#if 0 - -#define RxAcquirePrefixTableLockShared(PrefixTable,Wait) \ - RxpAcquirePrefixTableLockShared((PrefixTable),(Wait),TRUE, __FILE__,__LINE__ ) - -#define RxAcquirePrefixTableLockExclusive(PrefixTable,Wait) \ - RxpAcquirePrefixTableLockExclusive((PrefixTable),(Wait),TRUE, __FILE__,__LINE__ ) - -#define RxReleasePrefixTableLock(PrefixTable) \ - RxpReleasePrefixTableLock((PrefixTable),TRUE, __FILE__,__LINE__ ) - -extern -BOOLEAN -RxpAcquirePrefixTableLockShared ( - PRX_PREFIX_TABLE pTable, - BOOLEAN Wait, - BOOLEAN ProcessBufferingStateChangeRequests, - PSZ FileName, - ULONG LineNumber ); - -extern -BOOLEAN -RxpAcquirePrefixTableLockExclusive ( - PRX_PREFIX_TABLE pTable, - BOOLEAN Wait, - BOOLEAN ProcessBufferingStateChangeRequests, - PSZ FileName, - ULONG LineNumber - ); - -extern -VOID -RxpReleasePrefixTableLock ( - PRX_PREFIX_TABLE pTable, - BOOLEAN ProcessBufferingStateChangeRequests, - PSZ FileName, - ULONG LineNumber - ); - -#else - -#define RxAcquirePrefixTableLockShared(TABLE,WAIT) ExAcquireResourceSharedLite( &(TABLE)->TableLock, (WAIT) ) -#define RxAcquirePrefixTableLockExclusive(TABLE,WAIT) ExAcquireResourceExclusiveLite( &(TABLE)->TableLock, (WAIT) ) -#define RxReleasePrefixTableLock(TABLE) ExReleaseResourceLite( &(TABLE)->TableLock ) - - -#endif - -extern -VOID -RxExclusivePrefixTableLockToShared ( - PRX_PREFIX_TABLE Table - ); - -#define RxIsPrefixTableLockExclusive(TABLE) ExIsResourceAcquiredExclusiveLite(&(TABLE)->TableLock) -#define RxIsPrefixTableLockAcquired(TABLE) ( ExIsResourceAcquiredSharedLite(&(TABLE)->TableLock) || \ - ExIsResourceAcquiredExclusiveLite(&(TABLE)->TableLock) ) - - - -#endif // _RXPREFIX_ - diff --git a/qt-correction-tool/pub/ddk/prnasnot.h b/qt-correction-tool/pub/ddk/prnasnot.h deleted file mode 100644 index 4446363..0000000 --- a/qt-correction-tool/pub/ddk/prnasnot.h +++ /dev/null @@ -1,232 +0,0 @@ -/*++ - -Copyright (c) 2001 Microsoft Corporation - -Module Name: - - prnasnot.h - -Abstract: - - Header file for Print APIs - -Revision History: - ---*/ -#ifndef _PRINTASYNCNOTIFY_H_ -#define _PRINTASYNCNOTIFY_H_ - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -#include "initguid.h" -#include - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif - -DEFINE_GUID(IID_IPrintAsyncNotifyChannel, 0x4a5031b1, 0x1f3f, 0x4db0, 0xa4, 0x62, 0x45, 0x30, 0xed, 0x8b, 0x04, 0x51); -DEFINE_GUID(IID_IPrintAsyncNotifyCallback, 0x7def34c1, 0x9d92, 0x4c99, 0xb3, 0xb3, 0xdb, 0x94, 0xa9, 0xd4, 0x19, 0x1b); -DEFINE_GUID(IID_IPrintAsyncNotifyDataObject, 0x77cf513e, 0x5d49, 0x4789, 0x9f, 0x30, 0xd0, 0x82, 0x2b, 0x33, 0x5c, 0x0d); - -DEFINE_GUID(NOTIFICATION_RELEASE, 0xba9a5027, 0xa70e, 0x4ae7, 0x9b, 0x7d, 0xeb, 0x3e, 0x06, 0xad, 0x41, 0x57); - -// -// Global Application Bidi Notification Channel -// All Apps interested in Bidi Notifications from the Print subsystem should register for -// notifications on this Channel GUID -// -// {2ABAD223-B994-4aca-82FC-4571B1B585AC} -DEFINE_GUID(PRINT_APP_BIDI_NOTIFY_CHANNEL, 0x2ABAD223, 0xB994, 0x4aca, 0x82, 0xFC, 0x45, 0x71, 0xB1, 0xB5, 0x85, 0xAC); - -// -// Global Port Monitor Bidi Notification Channel -// This is the Global Channel GUID that all Bidi enabled Port Monitor should open to send -// Bidi Schema notifications up -// -// {25DF3B0E-74A9-47f5-80CE-79B4B1EB5C58} -DEFINE_GUID(PRINT_PORT_MONITOR_NOTIFY_CHANNEL, 0x25df3b0e, 0x74a9, 0x47f5, 0x80, 0xce, 0x79, 0xb4, 0xb1, 0xeb, 0x5c, 0x58); - -#ifdef __cplusplus -extern "C" { -#endif - -typedef enum -{ - kPerUser, - kAllUsers, - -} PrintAsyncNotifyUserFilter; - -typedef enum -{ - kBiDirectional, - kUniDirectional - -} PrintAsyncNotifyConversationStyle; - -typedef GUID PrintAsyncNotificationType; - -//#undef IUnknown - -#undef INTERFACE -#define INTERFACE IPrintAsyncNotifyDataObject -DECLARE_INTERFACE_(IPrintAsyncNotifyDataObject, IUnknown) -{ - STDMETHOD(QueryInterface)( - THIS_ - __in REFIID riid, - __deref_out void **ppvObj - ) PURE; - - STDMETHOD_(ULONG, AddRef)( - THIS - ) PURE; - - STDMETHOD_(ULONG, Release)( - THIS - ) PURE; - - STDMETHOD(AcquireData)( - THIS_ - __deref_out_ecount_opt(*pSize) BYTE **ppNotificationData, - __out_opt ULONG *pSize, - __deref_out_opt PrintAsyncNotificationType **ppSchema - ) PURE; - - STDMETHOD(ReleaseData)( - THIS - ) PURE; -}; - -typedef interface IPrintAsyncNotifyCallback IPrintAsyncNotifyCallback; - -#undef INTERFACE -#define INTERFACE IPrintAsyncNotifyChannel -DECLARE_INTERFACE_(IPrintAsyncNotifyChannel, IUnknown) -{ - STDMETHOD(QueryInterface)( - THIS_ - __in REFIID riid, - __deref_out void **ppvObj - ) PURE; - - STDMETHOD_(ULONG, AddRef)( - THIS - ) PURE; - - STDMETHOD_(ULONG, Release)( - THIS - ) PURE; - - STDMETHOD(SendNotification)( - THIS_ - __in IPrintAsyncNotifyDataObject *pData - ) PURE; - - STDMETHOD(CloseChannel)( - THIS_ - __in IPrintAsyncNotifyDataObject *pData - ) PURE; -}; - - -#undef INTERFACE -#define INTERFACE IPrintAsyncNotifyCallback -DECLARE_INTERFACE_(IPrintAsyncNotifyCallback, IUnknown) -{ - STDMETHOD(QueryInterface)( - THIS_ - __in REFIID riid, - __deref_out void **ppvObj - ) PURE; - - STDMETHOD_(ULONG, AddRef)( - THIS - ) PURE; - - STDMETHOD_(ULONG, Release)( - THIS - ) PURE; - - STDMETHOD(OnEventNotify)( - THIS_ - __in IPrintAsyncNotifyChannel *pChannel, - __in IPrintAsyncNotifyDataObject *pData - ) PURE; - - STDMETHOD(ChannelClosed)( - THIS_ - __in IPrintAsyncNotifyChannel *pChannel, - __in IPrintAsyncNotifyDataObject *pData - ) PURE; -}; - -#undef INTERFACE - -HRESULT -WINAPI -RegisterForPrintAsyncNotifications( - __in_opt PCWSTR pszName, - __in PrintAsyncNotificationType* pNotificationType, - PrintAsyncNotifyUserFilter eUserFilter, - PrintAsyncNotifyConversationStyle eConversationStyle, - __in IPrintAsyncNotifyCallback* pCallback, - __out HANDLE* phNotify - ); - -HRESULT -WINAPI -UnRegisterForPrintAsyncNotifications( - __in HANDLE - ); - -HRESULT -WINAPI -CreatePrintAsyncNotifyChannel( - __in_opt PCWSTR pszName, - __in PrintAsyncNotificationType* pNotificationType, - PrintAsyncNotifyUserFilter eUserFilter, - PrintAsyncNotifyConversationStyle eConversationStyle, - __in_opt IPrintAsyncNotifyCallback* pCallback, - __out IPrintAsyncNotifyChannel** ppIAsynchNotification - ); - -typedef enum -{ - CHANNEL_CLOSED_BY_SERVER = 0x01, - CHANNEL_CLOSED_BY_ANOTHER_LISTENER = 0x02, - CHANNEL_CLOSED_BY_SAME_LISTENER = 0x03, - CHANNEL_RELEASED_BY_LISTENER = 0x04, - UNIRECTIONAL_NOTIFICATION_LOST = 0x05, - ASYNC_NOTIFICATION_FAILURE = 0x06, - NO_LISTENERS = 0x07, - CHANNEL_ALREADY_CLOSED = 0x08, - CHANNEL_ALREADY_OPENED = 0x09, - CHANNEL_WAITING_FOR_CLIENT_NOTIFICATION = 0x0a, - CHANNEL_NOT_OPENED = 0x0b, - ASYNC_CALL_ALREADY_PARKED = 0x0c, - NOT_REGISTERED = 0x0d, - ALREADY_UNREGISTERED = 0x0e, - ALREADY_REGISTERED = 0x0f, - CHANNEL_ACQUIRED = 0x10, - ASYNC_CALL_IN_PROGRESS = 0x11, - MAX_NOTIFICATION_SIZE_EXCEEDED = 0x12, - INTERNAL_NOTIFICATION_QUEUE_IS_FULL = 0x13, - INVALID_NOTIFICATION_TYPE = 0x14, - MAX_REGISTRATION_COUNT_EXCEEDED = 0x15, - MAX_CHANNEL_COUNT_EXCEEDED = 0x16, - LOCAL_ONLY_REGISTRATION = 0x17, - REMOTE_ONLY_REGISTRATION = 0x18, - -} PrintAsyncNotifyError; - -#ifdef __cplusplus -} -#endif - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#endif // _PRINTASYNCNOTIFY_H_ - diff --git a/qt-correction-tool/pub/ddk/procgrp.h b/qt-correction-tool/pub/ddk/procgrp.h deleted file mode 100644 index ae69328..0000000 --- a/qt-correction-tool/pub/ddk/procgrp.h +++ /dev/null @@ -1,240 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - procgrp.h - -Abstract: - - This header exposes the new kernel APIs to device drivers in a - manner that makes it possible for drivers referencing these new - APIs to run on downlevel systems. - ---*/ - -#ifndef _WDMLIB_PROCGRP_H_ -#define _WDMLIB_PROCGRP_H_ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Initialization function of the compatibility library. This function -// must be called at PASSIVE_LEVEL prior to calling any of the APIs in -// this library. -// - -VOID -WdmlibProcgrpInitialize ( - VOID - ); - -// -// Supply an overrideable library implementation of -// KeGetCurrentProcessorNumberEx. See DDK documentation for more details -// on this API. -// - -#undef KeGetCurrentProcessorNumberEx -#define KeGetCurrentProcessorNumberEx WdmlibKeGetCurrentProcessorNumberEx - -ULONG -WdmlibKeGetCurrentProcessorNumberEx ( - __out_opt PPROCESSOR_NUMBER ProcNumber - ); - -// -// Supply an overrideable library implementation of -// KeQueryActiveProcessorCountEx. See DDK documentation for more details -// on this API. -// - -#undef KeQueryActiveProcessorCountEx -#define KeQueryActiveProcessorCountEx WdmlibKeQueryActiveProcessorCountEx - -ULONG -WdmlibKeQueryActiveProcessorCountEx ( - __in USHORT GroupNumber - ); - -// -// Supply an overrideable library implementation of -// KeQueryMaximumProcessorCountEx. See DDK documentation for more details -// on this API. -// - -#undef KeQueryMaximumProcessorCountEx -#define KeQueryMaximumProcessorCountEx WdmlibKeQueryMaximumProcessorCountEx - -ULONG -WdmlibKeQueryMaximumProcessorCountEx ( - __in USHORT GroupNumber - ); - -// -// Supply an overrideable library implementation of -// KeQueryMaximumProcessorCount. See DDK documentation for more details -// on this API. -// - -#undef KeQueryMaximumProcessorCount -#define KeQueryMaximumProcessorCount WdmlibKeQueryMaximumProcessorCount - -ULONG -WdmlibKeQueryMaximumProcessorCount ( - VOID - ); - -// -// Supply an overrideable library implementation of KeQueryGroupAffinity. -// See DDK documentation for more details on this API. -// - -#undef KeQueryGroupAffinity -#define KeQueryGroupAffinity WdmlibKeQueryGroupAffinity - -KAFFINITY -WdmlibKeQueryGroupAffinity ( - __in USHORT GroupNumber - ); - -// -// Supply an overrideable library implementation of -// KeQueryActiveGroupCount. See DDK documentation for more details -// on this API. -// - -#undef KeQueryActiveGroupCount -#define KeQueryActiveGroupCount WdmlibKeQueryActiveGroupCount - -USHORT -WdmlibKeQueryActiveGroupCount ( - VOID - ); - -// -// Supply an overrideable library implementation of -// KeQueryMaximumGroupCount. See DDK documentation for more details -// on this API. -// - -#undef KeQueryMaximumGroupCount -#define KeQueryMaximumGroupCount WdmlibKeQueryMaximumGroupCount - -USHORT -WdmlibKeQueryMaximumGroupCount ( - VOID - ); - -// -// Supply an overrideable library implementation of -// KeGetProcessorNumberFromIndex. See DDK documentation for more details -// on this API. -// - -#undef KeGetProcessorNumberFromIndex -#define KeGetProcessorNumberFromIndex WdmlibKeGetProcessorNumberFromIndex - -NTSTATUS -WdmlibKeGetProcessorNumberFromIndex ( - __in ULONG ProcIndex, - __out PPROCESSOR_NUMBER ProcNumber - ); - -// -// Supply an overrideable library implementation of -// KeGetProcessorIndexFromNumber. See DDK documentation for more details -// on this API. -// - -#undef KeGetProcessorIndexFromNumber -#define KeGetProcessorIndexFromNumber WdmlibKeGetProcessorIndexFromNumber - -ULONG -WdmlibKeGetProcessorIndexFromNumber ( - __in PPROCESSOR_NUMBER ProcNumber - ); - -// -// Supply an overrideable library implementation of -// KeSetSystemAffinityThreadEx. See DDK documentation for more details -// on this API. -// - -#undef KeSetSystemAffinityThreadEx -#define KeSetSystemAffinityThreadEx WdmlibKeSetSystemAffinityThreadEx - -KAFFINITY -WdmlibKeSetSystemAffinityThreadEx ( - __in KAFFINITY Affinity - ); - -// -// Supply an overrideable library implementation of -// KeSetSystemGroupAffinityThread. See DDK documentation for more details -// on this API. -// - -#undef KeSetSystemGroupAffinityThread -#define KeSetSystemGroupAffinityThread WdmlibKeSetSystemGroupAffinityThread - -VOID -WdmlibKeSetSystemGroupAffinityThread ( - __in PGROUP_AFFINITY NewAffinity, - __out_opt PGROUP_AFFINITY PreviousAffinity - ); - -// -// Supply an overrideable library implementation of -// KeRevertToUserAffinityThreadEx. See DDK documentation for more details -// on this API. -// - -#undef KeRevertToUserAffinityThreadEx -#define KeRevertToUserAffinityThreadEx WdmlibKeRevertToUserAffinityThreadEx - -VOID -WdmlibKeRevertToUserAffinityThreadEx ( - __in KAFFINITY Affinity - ); - -// -// Supply an overrideable library implementation of -// KeRevertToUserGroupAffinityThread. See DDK documentation for more details -// on this API. -// - -#undef KeRevertToUserGroupAffinityThread -#define KeRevertToUserGroupAffinityThread \ - WdmlibKeRevertToUserGroupAffinityThread - -VOID -WdmlibKeRevertToUserGroupAffinityThread ( - __in PGROUP_AFFINITY PreviousAffinity - ); - -// -// Supply an overrideable library implementation of -// KeSetTargetProcessorDpcEx. See DDK documentation for more details -// on this API. -// - -#undef KeSetTargetProcessorDpcEx -#define KeSetTargetProcessorDpcEx WdmlibKeSetTargetProcessorDpcEx - -NTSTATUS -WdmlibKeSetTargetProcessorDpcEx ( - __inout PKDPC Dpc, - __in PPROCESSOR_NUMBER ProcNumber - ); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // !defined(_WDMLIB_PROCGRP_H_) - diff --git a/qt-correction-tool/pub/ddk/ptpusd.h b/qt-correction-tool/pub/ddk/ptpusd.h deleted file mode 100644 index 0ef9f3c..0000000 --- a/qt-correction-tool/pub/ddk/ptpusd.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -* -* (C) COPYRIGHT 2000, MICROSOFT CORP. -* -* FILE: ptpusd.h -* -* VERSION: 1.0 -* -* DATE: 12/12/2000 -* -* AUTHOR: Dave Parsons -* -* DESCRIPTION: -* Structures and constants needed to issue vendor-specific Picture -* Transfer Protocol (PIMA 15740 - digital still camera command -* protocol) commands through the WIA PTP driver. -* -*****************************************************************************/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -// -// Pass this value in the dwEscapeCode argument of IWiaItemExtras::Escape -// to execute a PTP vendor command -// -const DWORD ESCAPE_PTP_CLEAR_STALLS = 0x0200; -const DWORD ESCAPE_PTP_VENDOR_COMMAND = 0x0100; -const DWORD ESCAPE_PTP_ADD_OBJ_CMD = 0x0010; -const DWORD ESCAPE_PTP_REM_OBJ_CMD = 0x0020; -const DWORD ESCAPE_PTP_ADD_OBJ_RESP = 0x0040; -const DWORD ESCAPE_PTP_REM_OBJ_RESP = 0x0080; -const DWORD ESCAPE_PTP_ADDREM_PARM1 = 0x0000; -const DWORD ESCAPE_PTP_ADDREM_PARM2 = 0x0001; -const DWORD ESCAPE_PTP_ADDREM_PARM3 = 0x0002; -const DWORD ESCAPE_PTP_ADDREM_PARM4 = 0x0003; -const DWORD ESCAPE_PTP_ADDREM_PARM5 = 0x0004; - -// -// PTP command request -// -const DWORD PTP_MAX_PARAMS = 5; - -#pragma pack(push, Old, 1) - -typedef struct _PTP_VENDOR_DATA_IN -{ - WORD OpCode; // Opcode - DWORD SessionId; // Session id - DWORD TransactionId; // Transaction id - DWORD Params[PTP_MAX_PARAMS]; // Parameters to the command - DWORD NumParams; // Number of parameters passed in - DWORD NextPhase; // Indicates whether to read data, - BYTE VendorWriteData[1]; // Optional first byte of data to - // write to the device - -} PTP_VENDOR_DATA_IN, *PPTP_VENDOR_DATA_IN; - -// -// PTP response block -// -typedef struct _PTP_VENDOR_DATA_OUT -{ - WORD ResponseCode; // Response code - DWORD SessionId; // Session id - DWORD TransactionId; // Transaction id - DWORD Params[PTP_MAX_PARAMS]; // Parameters of the response - BYTE VendorReadData[1]; // Optional first byte of data to - // read from the device - -} PTP_VENDOR_DATA_OUT, *PPTP_VENDOR_DATA_OUT; - -#pragma pack(pop, Old) - -// -// Handy structure size constants -// -const DWORD SIZEOF_REQUIRED_VENDOR_DATA_IN = sizeof(PTP_VENDOR_DATA_IN) - 1; -const DWORD SIZEOF_REQUIRED_VENDOR_DATA_OUT = sizeof(PTP_VENDOR_DATA_OUT) - 1; - -// -// NextPhase constants -// -const DWORD PTP_NEXTPHASE_READ_DATA = 3; -const DWORD PTP_NEXTPHASE_WRITE_DATA = 4; -const DWORD PTP_NEXTPHASE_NO_DATA = 5; - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - - diff --git a/qt-correction-tool/pub/ddk/punknown.h b/qt-correction-tool/pub/ddk/punknown.h deleted file mode 100644 index c12e4e9..0000000 --- a/qt-correction-tool/pub/ddk/punknown.h +++ /dev/null @@ -1,76 +0,0 @@ -/***************************************************************************** - * punknown.h - IUnknown definitions - ***************************************************************************** - * Copyright (c) Microsoft Corporation. All rights reserved. - */ - -#ifndef _UNKNOWN_H_ -#define _UNKNOWN_H_ - -#ifdef __cplusplus -extern "C" { -#include -} -#else -#include -#endif - -#include -#define COM_NO_WINDOWS_H -#include -#ifdef PUT_GUIDS_HERE -#include -#endif - - -DEFINE_GUID(IID_IUnknown, -0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x46); - -/***************************************************************************** - * IUnknown - ***************************************************************************** - * Base interface for otherwise unknown objects. - */ -#undef INTERFACE -#define INTERFACE IUnknown -DECLARE_INTERFACE(IUnknown) -{ - STDMETHOD_(NTSTATUS,QueryInterface) - ( THIS_ - __in REFIID, - __out PVOID * - ) PURE; - - STDMETHOD_(ULONG,AddRef) - ( THIS - ) PURE; - - STDMETHOD_(ULONG,Release) - ( THIS - ) PURE; -}; -#undef INTERFACE - -typedef IUnknown *PUNKNOWN; - -/***************************************************************************** - * PFNCREATEINSTANCE - ***************************************************************************** - * Type for object create function. - */ -typedef -HRESULT -(*PFNCREATEINSTANCE) -( - __out PUNKNOWN * Unknown, - __in REFCLSID ClassId, - __in PUNKNOWN OuterUnknown, - __in POOL_TYPE PoolType -); - - - - - -#endif - diff --git a/qt-correction-tool/pub/ddk/richedit.h b/qt-correction-tool/pub/ddk/richedit.h deleted file mode 100644 index 40fcf68..0000000 --- a/qt-correction-tool/pub/ddk/richedit.h +++ /dev/null @@ -1,1311 +0,0 @@ -/* - * RICHEDIT.H - * - * Purpose: - * RICHEDIT v2.0/3.0/4.0 public definitions - * functionality available for v2.0 and 3.0 that is not in the original - * Windows 95 release. - * - * Copyright (c) Microsoft Corporation. All rights reserved. - */ - -#ifndef _RICHEDIT_ -#define _RICHEDIT_ -#pragma once - -#ifdef _WIN32 -#include -#elif !defined(RC_INVOKED) -#pragma pack(4) -#endif - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// To mimic older RichEdit behavior, set _RICHEDIT_VER to appropriate value -// Version 1.0 0x0100 -// Version 2.0 0x0200 -// Version 2.1 0x0210 -#ifndef _RICHEDIT_VER -#define _RICHEDIT_VER 0x0300 -#endif - -#define cchTextLimitDefault 32767 - -#define MSFTEDIT_CLASS L"RICHEDIT50W" -// NOTE: MSFTEDIT.DLL only registers MSFTEDIT_CLASS. If an application wants -// to use the following Richedit classes, it needs to load the riched20.dll. -// Otherwise, CreateWindow with RICHEDIT_CLASS would fail. -// This also applies to any dialog that uses RICHEDIT_CLASS, - -// RichEdit 2.0 Window Class -// On Windows CE, avoid possible conflicts on Win95 -#define CERICHEDIT_CLASSA "RichEditCEA" -#define CERICHEDIT_CLASSW L"RichEditCEW" - -#define RICHEDIT_CLASSA "RichEdit20A" -#define RICHEDIT_CLASS10A "RICHEDIT" // Richedit 1.0 - -#ifndef MACPORT -#define RICHEDIT_CLASSW L"RichEdit20W" -#else //----------------------MACPORT -#define RICHEDIT_CLASSW TEXT("RichEdit20W") // MACPORT change -#endif // MACPORT - -#if (_RICHEDIT_VER >= 0x0200 ) -#ifdef UNICODE -#define RICHEDIT_CLASS RICHEDIT_CLASSW -#else -#define RICHEDIT_CLASS RICHEDIT_CLASSA -#endif // UNICODE -#else -#define RICHEDIT_CLASS RICHEDIT_CLASS10A -#endif // _RICHEDIT_VER >= 0x0200 - -// RichEdit messages - -#ifndef WM_CONTEXTMENU -#define WM_CONTEXTMENU 0x007B -#endif - -#ifndef WM_UNICHAR -#define WM_UNICHAR 0x0109 -#endif - -#ifndef WM_PRINTCLIENT -#define WM_PRINTCLIENT 0x0318 -#endif - -#ifndef EM_GETLIMITTEXT -#define EM_GETLIMITTEXT (WM_USER + 37) -#endif - -#ifndef EM_POSFROMCHAR -#define EM_POSFROMCHAR (WM_USER + 38) -#define EM_CHARFROMPOS (WM_USER + 39) -#endif - -#ifndef EM_SCROLLCARET -#define EM_SCROLLCARET (WM_USER + 49) -#endif -#define EM_CANPASTE (WM_USER + 50) -#define EM_DISPLAYBAND (WM_USER + 51) -#define EM_EXGETSEL (WM_USER + 52) -#define EM_EXLIMITTEXT (WM_USER + 53) -#define EM_EXLINEFROMCHAR (WM_USER + 54) -#define EM_EXSETSEL (WM_USER + 55) -#define EM_FINDTEXT (WM_USER + 56) -#define EM_FORMATRANGE (WM_USER + 57) -#define EM_GETCHARFORMAT (WM_USER + 58) -#define EM_GETEVENTMASK (WM_USER + 59) -#define EM_GETOLEINTERFACE (WM_USER + 60) -#define EM_GETPARAFORMAT (WM_USER + 61) -#define EM_GETSELTEXT (WM_USER + 62) -#define EM_HIDESELECTION (WM_USER + 63) -#define EM_PASTESPECIAL (WM_USER + 64) -#define EM_REQUESTRESIZE (WM_USER + 65) -#define EM_SELECTIONTYPE (WM_USER + 66) -#define EM_SETBKGNDCOLOR (WM_USER + 67) -#define EM_SETCHARFORMAT (WM_USER + 68) -#define EM_SETEVENTMASK (WM_USER + 69) -#define EM_SETOLECALLBACK (WM_USER + 70) -#define EM_SETPARAFORMAT (WM_USER + 71) -#define EM_SETTARGETDEVICE (WM_USER + 72) -#define EM_STREAMIN (WM_USER + 73) -#define EM_STREAMOUT (WM_USER + 74) -#define EM_GETTEXTRANGE (WM_USER + 75) -#define EM_FINDWORDBREAK (WM_USER + 76) -#define EM_SETOPTIONS (WM_USER + 77) -#define EM_GETOPTIONS (WM_USER + 78) -#define EM_FINDTEXTEX (WM_USER + 79) -#ifdef _WIN32 -#define EM_GETWORDBREAKPROCEX (WM_USER + 80) -#define EM_SETWORDBREAKPROCEX (WM_USER + 81) -#endif - -// RichEdit 2.0 messages -#define EM_SETUNDOLIMIT (WM_USER + 82) -#define EM_REDO (WM_USER + 84) -#define EM_CANREDO (WM_USER + 85) -#define EM_GETUNDONAME (WM_USER + 86) -#define EM_GETREDONAME (WM_USER + 87) -#define EM_STOPGROUPTYPING (WM_USER + 88) - -#define EM_SETTEXTMODE (WM_USER + 89) -#define EM_GETTEXTMODE (WM_USER + 90) - -// enum for use with EM_GET/SETTEXTMODE -typedef enum tagTextMode -{ - TM_PLAINTEXT = 1, - TM_RICHTEXT = 2, // Default behavior - TM_SINGLELEVELUNDO = 4, - TM_MULTILEVELUNDO = 8, // Default behavior - TM_SINGLECODEPAGE = 16, - TM_MULTICODEPAGE = 32 // Default behavior -} TEXTMODE; - -#define EM_AUTOURLDETECT (WM_USER + 91) -#define EM_GETAUTOURLDETECT (WM_USER + 92) -#define EM_SETPALETTE (WM_USER + 93) -#define EM_GETTEXTEX (WM_USER + 94) -#define EM_GETTEXTLENGTHEX (WM_USER + 95) -#define EM_SHOWSCROLLBAR (WM_USER + 96) -#define EM_SETTEXTEX (WM_USER + 97) - -// East Asia specific messages -#define EM_SETPUNCTUATION (WM_USER + 100) -#define EM_GETPUNCTUATION (WM_USER + 101) -#define EM_SETWORDWRAPMODE (WM_USER + 102) -#define EM_GETWORDWRAPMODE (WM_USER + 103) -#define EM_SETIMECOLOR (WM_USER + 104) -#define EM_GETIMECOLOR (WM_USER + 105) -#define EM_SETIMEOPTIONS (WM_USER + 106) -#define EM_GETIMEOPTIONS (WM_USER + 107) -#define EM_CONVPOSITION (WM_USER + 108) - -#define EM_SETLANGOPTIONS (WM_USER + 120) -#define EM_GETLANGOPTIONS (WM_USER + 121) -#define EM_GETIMECOMPMODE (WM_USER + 122) - -#define EM_FINDTEXTW (WM_USER + 123) -#define EM_FINDTEXTEXW (WM_USER + 124) - -// RE3.0 FE messages -#define EM_RECONVERSION (WM_USER + 125) -#define EM_SETIMEMODEBIAS (WM_USER + 126) -#define EM_GETIMEMODEBIAS (WM_USER + 127) - -// BiDi specific messages -#define EM_SETBIDIOPTIONS (WM_USER + 200) -#define EM_GETBIDIOPTIONS (WM_USER + 201) - -#define EM_SETTYPOGRAPHYOPTIONS (WM_USER + 202) -#define EM_GETTYPOGRAPHYOPTIONS (WM_USER + 203) - -// Extended edit style specific messages -#define EM_SETEDITSTYLE (WM_USER + 204) -#define EM_GETEDITSTYLE (WM_USER + 205) - -// Extended edit style masks -#define SES_EMULATESYSEDIT 1 -#define SES_BEEPONMAXTEXT 2 -#define SES_EXTENDBACKCOLOR 4 -#define SES_MAPCPS 8 // (obsolete) -#define SES_EMULATE10 16 // (obsolete) -#define SES_USECRLF 32 // (obsolete) -#define SES_NOXLTSYMBOLRANGE 32 -#define SES_USEAIMM 64 -#define SES_NOIME 128 - -#define SES_ALLOWBEEPS 256 -#define SES_UPPERCASE 512 -#define SES_LOWERCASE 1024 -#define SES_NOINPUTSEQUENCECHK 2048 -#define SES_BIDI 4096 -#define SES_SCROLLONKILLFOCUS 8192 -#define SES_XLTCRCRLFTOCR 16384 -#define SES_DRAFTMODE 32768 - -#define SES_USECTF 0x0010000 -#define SES_HIDEGRIDLINES 0x0020000 -#define SES_USEATFONT 0x0040000 -#define SES_CUSTOMLOOK 0x0080000 -#define SES_LBSCROLLNOTIFY 0x0100000 -#define SES_CTFALLOWEMBED 0x0200000 -#define SES_CTFALLOWSMARTTAG 0x0400000 -#define SES_CTFALLOWPROOFING 0x0800000 - -// Options for EM_SETLANGOPTIONS and EM_GETLANGOPTIONS -#define IMF_AUTOKEYBOARD 0x0001 -#define IMF_AUTOFONT 0x0002 -#define IMF_IMECANCELCOMPLETE 0x0004 // High completes comp string when aborting, low cancels -#define IMF_IMEALWAYSSENDNOTIFY 0x0008 -#define IMF_AUTOFONTSIZEADJUST 0x0010 -#define IMF_UIFONTS 0x0020 -#define IMF_DUALFONT 0x0080 -#define IMF_NORTFFONTSUBSTITUTE 0x0400 - - -// Values for EM_GETIMECOMPMODE -#define ICM_NOTOPEN 0x0000 -#define ICM_LEVEL3 0x0001 -#define ICM_LEVEL2 0x0002 -#define ICM_LEVEL2_5 0x0003 -#define ICM_LEVEL2_SUI 0x0004 -#define ICM_CTF 0x0005 - -// Options for EM_SETTYPOGRAPHYOPTIONS -#define TO_ADVANCEDTYPOGRAPHY 1 -#define TO_SIMPLELINEBREAK 2 -#define TO_DISABLECUSTOMTEXTOUT 4 -#define TO_ADVANCEDLAYOUT 8 - -// Pegasus outline mode messages (RE 3.0) - -// Outline mode message -#define EM_OUTLINE (WM_USER + 220) -// Message for getting and restoring scroll pos -#define EM_GETSCROLLPOS (WM_USER + 221) -#define EM_SETSCROLLPOS (WM_USER + 222) -// Change fontsize in current selection by wParam -#define EM_SETFONTSIZE (WM_USER + 223) -#define EM_GETZOOM (WM_USER + 224) -#define EM_SETZOOM (WM_USER + 225) -#define EM_GETVIEWKIND (WM_USER + 226) -#define EM_SETVIEWKIND (WM_USER + 227) - -// RichEdit 4.0 messages -#define EM_GETPAGE (WM_USER + 228) -#define EM_SETPAGE (WM_USER + 229) -#define EM_GETHYPHENATEINFO (WM_USER + 230) -#define EM_SETHYPHENATEINFO (WM_USER + 231) -#define EM_GETPAGEROTATE (WM_USER + 235) -#define EM_SETPAGEROTATE (WM_USER + 236) -#define EM_GETCTFMODEBIAS (WM_USER + 237) -#define EM_SETCTFMODEBIAS (WM_USER + 238) -#define EM_GETCTFOPENSTATUS (WM_USER + 240) -#define EM_SETCTFOPENSTATUS (WM_USER + 241) -#define EM_GETIMECOMPTEXT (WM_USER + 242) -#define EM_ISIME (WM_USER + 243) -#define EM_GETIMEPROPERTY (WM_USER + 244) - -// These messages control what rich edit does when it comes accross -// OLE objects during RTF stream in. Normally rich edit queries the client -// application only after OleLoad has been called. With these messages it is possible to -// set the rich edit control to a mode where it will query the client application before -// OleLoad is called -#define EM_GETQUERYRTFOBJ (WM_USER + 269) -#define EM_SETQUERYRTFOBJ (WM_USER + 270) - -// EM_SETPAGEROTATE wparam values -#define EPR_0 0 // Text flows left to right and top to bottom -#define EPR_270 1 // Text flows top to bottom and right to left -#define EPR_180 2 // Text flows right to left and bottom to top -#define EPR_90 3 // Text flows bottom to top and left to right - -// EM_SETCTFMODEBIAS wparam values -#define CTFMODEBIAS_DEFAULT 0x0000 -#define CTFMODEBIAS_FILENAME 0x0001 -#define CTFMODEBIAS_NAME 0x0002 -#define CTFMODEBIAS_READING 0x0003 -#define CTFMODEBIAS_DATETIME 0x0004 -#define CTFMODEBIAS_CONVERSATION 0x0005 -#define CTFMODEBIAS_NUMERIC 0x0006 -#define CTFMODEBIAS_HIRAGANA 0x0007 -#define CTFMODEBIAS_KATAKANA 0x0008 -#define CTFMODEBIAS_HANGUL 0x0009 -#define CTFMODEBIAS_HALFWIDTHKATAKANA 0x000A -#define CTFMODEBIAS_FULLWIDTHALPHANUMERIC 0x000B -#define CTFMODEBIAS_HALFWIDTHALPHANUMERIC 0x000C - -// EM_SETIMEMODEBIAS lparam values -#define IMF_SMODE_PLAURALCLAUSE 0x0001 -#define IMF_SMODE_NONE 0x0002 - -// EM_GETIMECOMPTEXT wparam structure -typedef struct _imecomptext { - LONG cb; // count of bytes in the output buffer. - DWORD flags; // value specifying the composition string type. - // Currently only support ICT_RESULTREADSTR -} IMECOMPTEXT; -#define ICT_RESULTREADSTR 1 - -// Outline mode wparam values -#define EMO_EXIT 0 // Enter normal mode, lparam ignored -#define EMO_ENTER 1 // Enter outline mode, lparam ignored -#define EMO_PROMOTE 2 // LOWORD(lparam) == 0 ==> - // promote to body-text - // LOWORD(lparam) != 0 ==> - // promote/demote current selection - // by indicated number of levels -#define EMO_EXPAND 3 // HIWORD(lparam) = EMO_EXPANDSELECTION - // -> expands selection to level - // indicated in LOWORD(lparam) - // LOWORD(lparam) = -1/+1 corresponds - // to collapse/expand button presses - // in winword (other values are - // equivalent to having pressed these - // buttons more than once) - // HIWORD(lparam) = EMO_EXPANDDOCUMENT - // -> expands whole document to - // indicated level -#define EMO_MOVESELECTION 4 // LOWORD(lparam) != 0 -> move current - // selection up/down by indicated amount -#define EMO_GETVIEWMODE 5 // Returns VM_NORMAL or VM_OUTLINE - -// EMO_EXPAND options -#define EMO_EXPANDSELECTION 0 -#define EMO_EXPANDDOCUMENT 1 - -#define VM_NORMAL 4 // Agrees with RTF \viewkindN -#define VM_OUTLINE 2 -#define VM_PAGE 9 // Screen page view (not print layout) - -// New notifications -#define EN_MSGFILTER 0x0700 -#define EN_REQUESTRESIZE 0x0701 -#define EN_SELCHANGE 0x0702 -#define EN_DROPFILES 0x0703 -#define EN_PROTECTED 0x0704 -#define EN_CORRECTTEXT 0x0705 // PenWin specific -#define EN_STOPNOUNDO 0x0706 -#define EN_IMECHANGE 0x0707 // East Asia specific -#define EN_SAVECLIPBOARD 0x0708 -#define EN_OLEOPFAILED 0x0709 -#define EN_OBJECTPOSITIONS 0x070a -#define EN_LINK 0x070b -#define EN_DRAGDROPDONE 0x070c -#define EN_PARAGRAPHEXPANDED 0x070d -#define EN_PAGECHANGE 0x070e -#define EN_LOWFIRTF 0x070f -#define EN_ALIGNLTR 0x0710 // BiDi specific notification -#define EN_ALIGNRTL 0x0711 // BiDi specific notification - -// Event notification masks -#define ENM_NONE 0x00000000 -#define ENM_CHANGE 0x00000001 -#define ENM_UPDATE 0x00000002 -#define ENM_SCROLL 0x00000004 -#define ENM_SCROLLEVENTS 0x00000008 -#define ENM_DRAGDROPDONE 0x00000010 -#define ENM_PARAGRAPHEXPANDED 0x00000020 -#define ENM_PAGECHANGE 0x00000040 -#define ENM_KEYEVENTS 0x00010000 -#define ENM_MOUSEEVENTS 0x00020000 -#define ENM_REQUESTRESIZE 0x00040000 -#define ENM_SELCHANGE 0x00080000 -#define ENM_DROPFILES 0x00100000 -#define ENM_PROTECTED 0x00200000 -#define ENM_CORRECTTEXT 0x00400000 // PenWin specific -#define ENM_IMECHANGE 0x00800000 // Used by RE1.0 compatibility -#define ENM_LANGCHANGE 0x01000000 -#define ENM_OBJECTPOSITIONS 0x02000000 -#define ENM_LINK 0x04000000 -#define ENM_LOWFIRTF 0x08000000 - - -// New edit control styles -#define ES_SAVESEL 0x00008000 -#define ES_SUNKEN 0x00004000 -#define ES_DISABLENOSCROLL 0x00002000 -// Same as WS_MAXIMIZE, but that doesn't make sense so we re-use the value -#define ES_SELECTIONBAR 0x01000000 -// Same as ES_UPPERCASE, but re-used to completely disable OLE drag'n'drop -#define ES_NOOLEDRAGDROP 0x00000008 - -// New edit control extended style -#if (_WIN32_WINNT > 0x0400) || (WINVER > 0x0400) -#define ES_EX_NOCALLOLEINIT 0x00000000 // Not supported in RE 2.0/3.0 -#else -#ifdef _WIN32 -#define ES_EX_NOCALLOLEINIT 0x01000000 -#endif -#endif - -// These flags are used in FE Windows -#define ES_VERTICAL 0x00400000 // Not supported in RE 2.0/3.0 -#define ES_NOIME 0x00080000 -#define ES_SELFIME 0x00040000 - -// Edit control options -#define ECO_AUTOWORDSELECTION 0x00000001 -#define ECO_AUTOVSCROLL 0x00000040 -#define ECO_AUTOHSCROLL 0x00000080 -#define ECO_NOHIDESEL 0x00000100 -#define ECO_READONLY 0x00000800 -#define ECO_WANTRETURN 0x00001000 -#define ECO_SAVESEL 0x00008000 -#define ECO_SELECTIONBAR 0x01000000 -#define ECO_VERTICAL 0x00400000 // FE specific - - -// ECO operations -#define ECOOP_SET 0x0001 -#define ECOOP_OR 0x0002 -#define ECOOP_AND 0x0003 -#define ECOOP_XOR 0x0004 - -// New word break function actions -#define WB_CLASSIFY 3 -#define WB_MOVEWORDLEFT 4 -#define WB_MOVEWORDRIGHT 5 -#define WB_LEFTBREAK 6 -#define WB_RIGHTBREAK 7 - -// East Asia specific flags -#define WB_MOVEWORDPREV 4 -#define WB_MOVEWORDNEXT 5 -#define WB_PREVBREAK 6 -#define WB_NEXTBREAK 7 - -#define PC_FOLLOWING 1 -#define PC_LEADING 2 -#define PC_OVERFLOW 3 -#define PC_DELIMITER 4 -#define WBF_WORDWRAP 0x010 -#define WBF_WORDBREAK 0x020 -#define WBF_OVERFLOW 0x040 -#define WBF_LEVEL1 0x080 -#define WBF_LEVEL2 0x100 -#define WBF_CUSTOM 0x200 - -// East Asia specific flags -#define IMF_FORCENONE 0x0001 -#define IMF_FORCEENABLE 0x0002 -#define IMF_FORCEDISABLE 0x0004 -#define IMF_CLOSESTATUSWINDOW 0x0008 -#define IMF_VERTICAL 0x0020 -#define IMF_FORCEACTIVE 0x0040 -#define IMF_FORCEINACTIVE 0x0080 -#define IMF_FORCEREMEMBER 0x0100 -#define IMF_MULTIPLEEDIT 0x0400 - -// Word break flags (used with WB_CLASSIFY) -#define WBF_CLASS ((BYTE) 0x0F) -#define WBF_ISWHITE ((BYTE) 0x10) -#define WBF_BREAKLINE ((BYTE) 0x20) -#define WBF_BREAKAFTER ((BYTE) 0x40) - - -// Data types - -#ifdef _WIN32 -// Extended edit word break proc (character set aware) -typedef LONG (*EDITWORDBREAKPROCEX)(char *pchText, LONG cchText, BYTE bCharSet, INT action); -#endif - -// All character format measurements are in twips -typedef struct _charformat -{ - UINT cbSize; - DWORD dwMask; - DWORD dwEffects; - LONG yHeight; - LONG yOffset; - COLORREF crTextColor; - BYTE bCharSet; - BYTE bPitchAndFamily; - char szFaceName[LF_FACESIZE]; -} CHARFORMATA; - -typedef struct _charformatw -{ - UINT cbSize; - DWORD dwMask; - DWORD dwEffects; - LONG yHeight; - LONG yOffset; - COLORREF crTextColor; - BYTE bCharSet; - BYTE bPitchAndFamily; - WCHAR szFaceName[LF_FACESIZE]; -} CHARFORMATW; - -#if (_RICHEDIT_VER >= 0x0200) -#ifdef UNICODE -#define CHARFORMAT CHARFORMATW -#else -#define CHARFORMAT CHARFORMATA -#endif // UNICODE -#else -#define CHARFORMAT CHARFORMATA -#endif // _RICHEDIT_VER >= 0x0200 - -// CHARFORMAT2 structure - -#ifdef __cplusplus - -struct CHARFORMAT2W : _charformatw -{ - WORD wWeight; // Font weight (LOGFONT value) - SHORT sSpacing; // Amount to space between letters - COLORREF crBackColor; // Background color - LCID lcid; // Locale ID - DWORD dwReserved; // Reserved. Must be 0 - SHORT sStyle; // Style handle - WORD wKerning; // Twip size above which to kern char pair - BYTE bUnderlineType; // Underline type - BYTE bAnimation; // Animated text like marching ants - BYTE bRevAuthor; // Revision author index -}; - -struct CHARFORMAT2A : _charformat -{ - WORD wWeight; // Font weight (LOGFONT value) - SHORT sSpacing; // Amount to space between letters - COLORREF crBackColor; // Background color - LCID lcid; // Locale ID - DWORD dwReserved; // Reserved. Must be 0 - SHORT sStyle; // Style handle - WORD wKerning; // Twip size above which to kern char pair - BYTE bUnderlineType; // Underline type - BYTE bAnimation; // Animated text like marching ants - BYTE bRevAuthor; // Revision author index -}; - -#else // regular C-style - -typedef struct _charformat2w -{ - UINT cbSize; - DWORD dwMask; - DWORD dwEffects; - LONG yHeight; - LONG yOffset; // > 0 for superscript, < 0 for subscript - COLORREF crTextColor; - BYTE bCharSet; - BYTE bPitchAndFamily; - WCHAR szFaceName[LF_FACESIZE]; - WORD wWeight; // Font weight (LOGFONT value) - SHORT sSpacing; // Amount to space between letters - COLORREF crBackColor; // Background color - LCID lcid; // Locale ID - DWORD dwReserved; // Reserved. Must be 0 - SHORT sStyle; // Style handle - WORD wKerning; // Twip size above which to kern char pair - BYTE bUnderlineType; // Underline type - BYTE bAnimation; // Animated text like marching ants - BYTE bRevAuthor; // Revision author index - BYTE bReserved1; -} CHARFORMAT2W; - -typedef struct _charformat2a -{ - UINT cbSize; - DWORD dwMask; - DWORD dwEffects; - LONG yHeight; - LONG yOffset; // > 0 for superscript, < 0 for subscript - COLORREF crTextColor; - BYTE bCharSet; - BYTE bPitchAndFamily; - char szFaceName[LF_FACESIZE]; - WORD wWeight; // Font weight (LOGFONT value) - SHORT sSpacing; // Amount to space between letters - COLORREF crBackColor; // Background color - LCID lcid; // Locale ID - DWORD dwReserved; // Reserved. Must be 0 - SHORT sStyle; // Style handle - WORD wKerning; // Twip size above which to kern char pair - BYTE bUnderlineType; // Underline type - BYTE bAnimation; // Animated text like marching ants - BYTE bRevAuthor; // Revision author index -} CHARFORMAT2A; - -#endif // C++ - -#ifdef UNICODE -#define CHARFORMAT2 CHARFORMAT2W -#else -#define CHARFORMAT2 CHARFORMAT2A -#endif - -#define CHARFORMATDELTA (sizeof(CHARFORMAT2) - sizeof(CHARFORMAT)) - - -// CFM_COLOR mirrors CFE_AUTOCOLOR, a little hack to easily deal with autocolor - -// CHARFORMAT masks -#define CFM_BOLD 0x00000001 -#define CFM_ITALIC 0x00000002 -#define CFM_UNDERLINE 0x00000004 -#define CFM_STRIKEOUT 0x00000008 -#define CFM_PROTECTED 0x00000010 -#define CFM_LINK 0x00000020 // Exchange hyperlink extension -#define CFM_SIZE 0x80000000 -#define CFM_COLOR 0x40000000 -#define CFM_FACE 0x20000000 -#define CFM_OFFSET 0x10000000 -#define CFM_CHARSET 0x08000000 - -// CHARFORMAT effects -#define CFE_BOLD 0x0001 -#define CFE_ITALIC 0x0002 -#define CFE_UNDERLINE 0x0004 -#define CFE_STRIKEOUT 0x0008 -#define CFE_PROTECTED 0x0010 -#define CFE_LINK 0x0020 -#define CFE_AUTOCOLOR 0x40000000 // NOTE: this corresponds to - // CFM_COLOR, which controls it -// Masks and effects defined for CHARFORMAT2 -- an (*) indicates -// that the data is stored by RichEdit 2.0/3.0, but not displayed -#define CFM_SMALLCAPS 0x0040 // (*) -#define CFM_ALLCAPS 0x0080 // Displayed by 3.0 -#define CFM_HIDDEN 0x0100 // Hidden by 3.0 -#define CFM_OUTLINE 0x0200 // (*) -#define CFM_SHADOW 0x0400 // (*) -#define CFM_EMBOSS 0x0800 // (*) -#define CFM_IMPRINT 0x1000 // (*) -#define CFM_DISABLED 0x2000 -#define CFM_REVISED 0x4000 - -#define CFM_BACKCOLOR 0x04000000 -#define CFM_LCID 0x02000000 -#define CFM_UNDERLINETYPE 0x00800000 // Many displayed by 3.0 -#define CFM_WEIGHT 0x00400000 -#define CFM_SPACING 0x00200000 // Displayed by 3.0 -#define CFM_KERNING 0x00100000 // (*) -#define CFM_STYLE 0x00080000 // (*) -#define CFM_ANIMATION 0x00040000 // (*) -#define CFM_REVAUTHOR 0x00008000 - -#define CFE_SUBSCRIPT 0x00010000 // Superscript and subscript are -#define CFE_SUPERSCRIPT 0x00020000 // mutually exclusive - -#define CFM_SUBSCRIPT (CFE_SUBSCRIPT | CFE_SUPERSCRIPT) -#define CFM_SUPERSCRIPT CFM_SUBSCRIPT - -// CHARFORMAT "ALL" masks -#define CFM_EFFECTS (CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_COLOR | \ - CFM_STRIKEOUT | CFE_PROTECTED | CFM_LINK) -#define CFM_ALL (CFM_EFFECTS | CFM_SIZE | CFM_FACE | CFM_OFFSET | CFM_CHARSET) - -#define CFM_EFFECTS2 (CFM_EFFECTS | CFM_DISABLED | CFM_SMALLCAPS | CFM_ALLCAPS \ - | CFM_HIDDEN | CFM_OUTLINE | CFM_SHADOW | CFM_EMBOSS \ - | CFM_IMPRINT | CFM_DISABLED | CFM_REVISED \ - | CFM_SUBSCRIPT | CFM_SUPERSCRIPT | CFM_BACKCOLOR) - -#define CFM_ALL2 (CFM_ALL | CFM_EFFECTS2 | CFM_BACKCOLOR | CFM_LCID \ - | CFM_UNDERLINETYPE | CFM_WEIGHT | CFM_REVAUTHOR \ - | CFM_SPACING | CFM_KERNING | CFM_STYLE | CFM_ANIMATION) - -#define CFE_SMALLCAPS CFM_SMALLCAPS -#define CFE_ALLCAPS CFM_ALLCAPS -#define CFE_HIDDEN CFM_HIDDEN -#define CFE_OUTLINE CFM_OUTLINE -#define CFE_SHADOW CFM_SHADOW -#define CFE_EMBOSS CFM_EMBOSS -#define CFE_IMPRINT CFM_IMPRINT -#define CFE_DISABLED CFM_DISABLED -#define CFE_REVISED CFM_REVISED - -// CFE_AUTOCOLOR and CFE_AUTOBACKCOLOR correspond to CFM_COLOR and -// CFM_BACKCOLOR, respectively, which control them -#define CFE_AUTOBACKCOLOR CFM_BACKCOLOR - -// Underline types. RE 1.0 displays only CFU_UNDERLINE -#define CFU_CF1UNDERLINE 0xFF // Map charformat's bit underline to CF2 -#define CFU_INVERT 0xFE // For IME composition fake a selection -#define CFU_UNDERLINETHICKLONGDASH 18 // (*) display as dash -#define CFU_UNDERLINETHICKDOTTED 17 // (*) display as dot -#define CFU_UNDERLINETHICKDASHDOTDOT 16 // (*) display as dash dot dot -#define CFU_UNDERLINETHICKDASHDOT 15 // (*) display as dash dot -#define CFU_UNDERLINETHICKDASH 14 // (*) display as dash -#define CFU_UNDERLINELONGDASH 13 // (*) display as dash -#define CFU_UNDERLINEHEAVYWAVE 12 // (*) display as wave -#define CFU_UNDERLINEDOUBLEWAVE 11 // (*) display as wave -#define CFU_UNDERLINEHAIRLINE 10 // (*) display as single -#define CFU_UNDERLINETHICK 9 -#define CFU_UNDERLINEWAVE 8 -#define CFU_UNDERLINEDASHDOTDOT 7 -#define CFU_UNDERLINEDASHDOT 6 -#define CFU_UNDERLINEDASH 5 -#define CFU_UNDERLINEDOTTED 4 -#define CFU_UNDERLINEDOUBLE 3 // (*) display as single -#define CFU_UNDERLINEWORD 2 // (*) display as single -#define CFU_UNDERLINE 1 -#define CFU_UNDERLINENONE 0 - -#define yHeightCharPtsMost 1638 - -// EM_SETCHARFORMAT wParam masks -#define SCF_SELECTION 0x0001 -#define SCF_WORD 0x0002 -#define SCF_DEFAULT 0x0000 // Set default charformat or paraformat -#define SCF_ALL 0x0004 // Not valid with SCF_SELECTION or SCF_WORD -#define SCF_USEUIRULES 0x0008 // Modifier for SCF_SELECTION; says that - // format came from a toolbar, etc., and - // hence UI formatting rules should be - // used instead of literal formatting -#define SCF_ASSOCIATEFONT 0x0010 // Associate fontname with bCharSet (one - // possible for each of Western, ME, FE, - // Thai) -#define SCF_NOKBUPDATE 0x0020 // Do not update KB layput for this change - // even if autokeyboard is on -#define SCF_ASSOCIATEFONT2 0x0040 // Associate plane-2 (surrogate) font - -typedef struct _charrange -{ - LONG cpMin; - LONG cpMax; -} CHARRANGE; - -typedef struct _textrange -{ - CHARRANGE chrg; - LPSTR lpstrText; // Allocated by caller, zero terminated by RichEdit -} TEXTRANGEA; - -typedef struct _textrangew -{ - CHARRANGE chrg; - LPWSTR lpstrText; // Allocated by caller, zero terminated by RichEdit -} TEXTRANGEW; - -#if (_RICHEDIT_VER >= 0x0200) -#ifdef UNICODE -#define TEXTRANGE TEXTRANGEW -#else -#define TEXTRANGE TEXTRANGEA -#endif // UNICODE -#else -#define TEXTRANGE TEXTRANGEA -#endif // _RICHEDIT_VER >= 0x0200 - -typedef DWORD (CALLBACK *EDITSTREAMCALLBACK)(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb); - -typedef struct _editstream -{ - DWORD_PTR dwCookie; // User value passed to callback as first parameter - DWORD dwError; // Last error - EDITSTREAMCALLBACK pfnCallback; -} EDITSTREAM; - -// Stream formats. Flags are all in low word, since high word -// gives possible codepage choice. -#define SF_TEXT 0x0001 -#define SF_RTF 0x0002 -#define SF_RTFNOOBJS 0x0003 // Write only -#define SF_TEXTIZED 0x0004 // Write only - -#define SF_UNICODE 0x0010 // Unicode file (UCS2 little endian) -#define SF_USECODEPAGE 0x0020 // CodePage given by high word -#define SF_NCRFORNONASCII 0x40 // Output /uN for nonASCII -#define SFF_WRITEXTRAPAR 0x80 // Output \par at end - -// Flag telling stream operations to operate on selection only -// EM_STREAMIN replaces current selection -// EM_STREAMOUT streams out current selection -#define SFF_SELECTION 0x8000 - -// Flag telling stream operations to ignore some FE control words -// having to do with FE word breaking and horiz vs vertical text. -// Not used in RichEdit 2.0 and later -#define SFF_PLAINRTF 0x4000 - -// Flag telling file stream output (SFF_SELECTION flag not set) to persist -// \viewscaleN control word. -#define SFF_PERSISTVIEWSCALE 0x2000 - -// Flag telling file stream input with SFF_SELECTION flag not set not to -// close the document -#define SFF_KEEPDOCINFO 0x1000 - -// Flag telling stream operations to output in Pocket Word format -#define SFF_PWD 0x0800 - -// 3-bit field specifying the value of N - 1 to use for \rtfN or \pwdN -#define SF_RTFVAL 0x0700 - -typedef struct _findtext -{ - CHARRANGE chrg; - LPCSTR lpstrText; -} FINDTEXTA; - -typedef struct _findtextw -{ - CHARRANGE chrg; - LPCWSTR lpstrText; -} FINDTEXTW; - -#if (_RICHEDIT_VER >= 0x0200) -#ifdef UNICODE -#define FINDTEXT FINDTEXTW -#else -#define FINDTEXT FINDTEXTA -#endif // UNICODE -#else -#define FINDTEXT FINDTEXTA -#endif // _RICHEDIT_VER >= 0x0200 - -typedef struct _findtextexa -{ - CHARRANGE chrg; - LPCSTR lpstrText; - CHARRANGE chrgText; -} FINDTEXTEXA; - -typedef struct _findtextexw -{ - CHARRANGE chrg; - LPCWSTR lpstrText; - CHARRANGE chrgText; -} FINDTEXTEXW; - -#if (_RICHEDIT_VER >= 0x0200) -#ifdef UNICODE -#define FINDTEXTEX FINDTEXTEXW -#else -#define FINDTEXTEX FINDTEXTEXA -#endif // UNICODE -#else -#define FINDTEXTEX FINDTEXTEXA -#endif // _RICHEDIT_VER >= 0x0200 - - -typedef struct _formatrange -{ - HDC hdc; - HDC hdcTarget; - RECT rc; - RECT rcPage; - CHARRANGE chrg; -} FORMATRANGE; - -// All paragraph measurements are in twips - -#define MAX_TAB_STOPS 32 -#define lDefaultTab 720 -#define MAX_TABLE_CELLS 63 - -typedef struct _paraformat -{ - UINT cbSize; - DWORD dwMask; - WORD wNumbering; - WORD wEffects; - LONG dxStartIndent; - LONG dxRightIndent; - LONG dxOffset; - WORD wAlignment; - SHORT cTabCount; - LONG rgxTabs[MAX_TAB_STOPS]; -} PARAFORMAT; - -#ifdef __cplusplus -struct PARAFORMAT2 : _paraformat -{ - LONG dySpaceBefore; // Vertical spacing before para - LONG dySpaceAfter; // Vertical spacing after para - LONG dyLineSpacing; // Line spacing depending on Rule - SHORT sStyle; // Style handle - BYTE bLineSpacingRule; // Rule for line spacing (see tom.doc) - BYTE bOutlineLevel; // Outline level - WORD wShadingWeight; // Shading in hundredths of a per cent - WORD wShadingStyle; // Nibble 0: style, 1: cfpat, 2: cbpat - WORD wNumberingStart; // Starting value for numbering - WORD wNumberingStyle; // Alignment, roman/arabic, (), ), ., etc. - WORD wNumberingTab; // Space bet FirstIndent & 1st-line text - WORD wBorderSpace; // Border-text spaces (nbl/bdr in pts) - WORD wBorderWidth; // Pen widths (nbl/bdr in half pts) - WORD wBorders; // Border styles (nibble/border) -}; - -#else // Regular C-style - -typedef struct _paraformat2 -{ - UINT cbSize; - DWORD dwMask; - WORD wNumbering; - WORD wReserved; - LONG dxStartIndent; - LONG dxRightIndent; - LONG dxOffset; - WORD wAlignment; - SHORT cTabCount; - LONG rgxTabs[MAX_TAB_STOPS]; - LONG dySpaceBefore; // Vertical spacing before para - LONG dySpaceAfter; // Vertical spacing after para - LONG dyLineSpacing; // Line spacing depending on Rule - SHORT sStyle; // Style handle - BYTE bLineSpacingRule; // Rule for line spacing (see tom.doc) - BYTE bOutlineLevel; // Outline Level - WORD wShadingWeight; // Shading in hundredths of a per cent - WORD wShadingStyle; // Byte 0: style, nib 2: cfpat, 3: cbpat - WORD wNumberingStart; // Starting value for numbering - WORD wNumberingStyle; // Alignment, Roman/Arabic, (), ), ., etc. - WORD wNumberingTab; // Space bet 1st indent and 1st-line text - WORD wBorderSpace; // Border-text spaces (nbl/bdr in pts) - WORD wBorderWidth; // Pen widths (nbl/bdr in half twips) - WORD wBorders; // Border styles (nibble/border) -} PARAFORMAT2; - -#endif // C++ - - -// PARAFORMAT mask values -#define PFM_STARTINDENT 0x00000001 -#define PFM_RIGHTINDENT 0x00000002 -#define PFM_OFFSET 0x00000004 -#define PFM_ALIGNMENT 0x00000008 -#define PFM_TABSTOPS 0x00000010 -#define PFM_NUMBERING 0x00000020 -#define PFM_OFFSETINDENT 0x80000000 - -// PARAFORMAT 2.0 masks and effects -#define PFM_SPACEBEFORE 0x00000040 -#define PFM_SPACEAFTER 0x00000080 -#define PFM_LINESPACING 0x00000100 -#define PFM_STYLE 0x00000400 -#define PFM_BORDER 0x00000800 // (*) -#define PFM_SHADING 0x00001000 // (*) -#define PFM_NUMBERINGSTYLE 0x00002000 // RE 3.0 -#define PFM_NUMBERINGTAB 0x00004000 // RE 3.0 -#define PFM_NUMBERINGSTART 0x00008000 // RE 3.0 - -#define PFM_RTLPARA 0x00010000 -#define PFM_KEEP 0x00020000 // (*) -#define PFM_KEEPNEXT 0x00040000 // (*) -#define PFM_PAGEBREAKBEFORE 0x00080000 // (*) -#define PFM_NOLINENUMBER 0x00100000 // (*) -#define PFM_NOWIDOWCONTROL 0x00200000 // (*) -#define PFM_DONOTHYPHEN 0x00400000 // (*) -#define PFM_SIDEBYSIDE 0x00800000 // (*) -#define PFM_TABLE 0x40000000 // RE 3.0 -#define PFM_TEXTWRAPPINGBREAK 0x20000000 // RE 3.0 -#define PFM_TABLEROWDELIMITER 0x10000000 // RE 4.0 - -// The following three properties are read only -#define PFM_COLLAPSED 0x01000000 // RE 3.0 -#define PFM_OUTLINELEVEL 0x02000000 // RE 3.0 -#define PFM_BOX 0x04000000 // RE 3.0 -#define PFM_RESERVED2 0x08000000 // RE 4.0 - - -// PARAFORMAT "ALL" masks -#define PFM_ALL (PFM_STARTINDENT | PFM_RIGHTINDENT | PFM_OFFSET | \ - PFM_ALIGNMENT | PFM_TABSTOPS | PFM_NUMBERING | \ - PFM_OFFSETINDENT| PFM_RTLPARA) - -// Note: PARAFORMAT has no effects (BiDi RichEdit 1.0 does have PFE_RTLPARA) -#define PFM_EFFECTS (PFM_RTLPARA | PFM_KEEP | PFM_KEEPNEXT | PFM_TABLE \ - | PFM_PAGEBREAKBEFORE | PFM_NOLINENUMBER \ - | PFM_NOWIDOWCONTROL | PFM_DONOTHYPHEN | PFM_SIDEBYSIDE \ - | PFM_TABLE | PFM_TABLEROWDELIMITER) - -#define PFM_ALL2 (PFM_ALL | PFM_EFFECTS | PFM_SPACEBEFORE | PFM_SPACEAFTER \ - | PFM_LINESPACING | PFM_STYLE | PFM_SHADING | PFM_BORDER \ - | PFM_NUMBERINGTAB | PFM_NUMBERINGSTART | PFM_NUMBERINGSTYLE) - -#define PFE_RTLPARA (PFM_RTLPARA >> 16) -#define PFE_KEEP (PFM_KEEP >> 16) // (*) -#define PFE_KEEPNEXT (PFM_KEEPNEXT >> 16) // (*) -#define PFE_PAGEBREAKBEFORE (PFM_PAGEBREAKBEFORE >> 16) // (*) -#define PFE_NOLINENUMBER (PFM_NOLINENUMBER >> 16) // (*) -#define PFE_NOWIDOWCONTROL (PFM_NOWIDOWCONTROL >> 16) // (*) -#define PFE_DONOTHYPHEN (PFM_DONOTHYPHEN >> 16) // (*) -#define PFE_SIDEBYSIDE (PFM_SIDEBYSIDE >> 16) // (*) -#define PFE_TEXTWRAPPINGBREAK (PFM_TEXTWRAPPINGBREAK>>16) // (*) - -// The following four effects are read only -#define PFE_COLLAPSED (PFM_COLLAPSED >> 16) // (+) -#define PFE_BOX (PFM_BOX >> 16) // (+) -#define PFE_TABLE (PFM_TABLE >> 16) // Inside table row. RE 3.0 -#define PFE_TABLEROWDELIMITER (PFM_TABLEROWDELIMITER>>16) // Table row start. RE 4.0 - -// PARAFORMAT numbering options -#define PFN_BULLET 1 // tomListBullet - -// PARAFORMAT2 wNumbering options -#define PFN_ARABIC 2 // tomListNumberAsArabic: 0, 1, 2, ... -#define PFN_LCLETTER 3 // tomListNumberAsLCLetter: a, b, c, ... -#define PFN_UCLETTER 4 // tomListNumberAsUCLetter: A, B, C, ... -#define PFN_LCROMAN 5 // tomListNumberAsLCRoman: i, ii, iii, ... -#define PFN_UCROMAN 6 // tomListNumberAsUCRoman: I, II, III, ... - -// PARAFORMAT2 wNumberingStyle options -#define PFNS_PAREN 0x000 // default, e.g., 1) -#define PFNS_PARENS 0x100 // tomListParentheses/256, e.g., (1) -#define PFNS_PERIOD 0x200 // tomListPeriod/256, e.g., 1. -#define PFNS_PLAIN 0x300 // tomListPlain/256, e.g., 1 -#define PFNS_NONUMBER 0x400 // Used for continuation w/o number - -#define PFNS_NEWNUMBER 0x8000 // Start new number with wNumberingStart - // (can be combined with other PFNS_xxx) -// PARAFORMAT alignment options -#define PFA_LEFT 1 -#define PFA_RIGHT 2 -#define PFA_CENTER 3 - -// PARAFORMAT2 alignment options -#define PFA_JUSTIFY 4 // New paragraph-alignment option 2.0 (*) -#define PFA_FULL_INTERWORD 4 // These are supported in 3.0 with advanced -#define PFA_FULL_INTERLETTER 5 // typography enabled -#define PFA_FULL_SCALED 6 -#define PFA_FULL_GLYPHS 7 -#define PFA_SNAP_GRID 8 - - -// Notification structures -#ifndef WM_NOTIFY -#define WM_NOTIFY 0x004E - -typedef struct _nmhdr -{ - HWND hwndFrom; - UINT idFrom; - UINT code; -} NMHDR; -#endif // !WM_NOTIFY - -typedef struct _msgfilter -{ - NMHDR nmhdr; - UINT msg; - WPARAM wParam; - LPARAM lParam; -} MSGFILTER; - -typedef struct _reqresize -{ - NMHDR nmhdr; - RECT rc; -} REQRESIZE; - -typedef struct _selchange -{ - NMHDR nmhdr; - CHARRANGE chrg; - WORD seltyp; -} SELCHANGE; - - -#define SEL_EMPTY 0x0000 -#define SEL_TEXT 0x0001 -#define SEL_OBJECT 0x0002 -#define SEL_MULTICHAR 0x0004 -#define SEL_MULTIOBJECT 0x0008 - -// Used with IRichEditOleCallback::GetContextMenu, this flag will be -// passed as a "selection type". It indicates that a context menu for -// a right-mouse drag drop should be generated. The IOleObject parameter -// will really be the IDataObject for the drop -#define GCM_RIGHTMOUSEDROP 0x8000 - -typedef struct _endropfiles -{ - NMHDR nmhdr; - HANDLE hDrop; - LONG cp; - BOOL fProtected; -} ENDROPFILES; - -typedef struct _enprotected -{ - NMHDR nmhdr; - UINT msg; - WPARAM wParam; - LPARAM lParam; - CHARRANGE chrg; -} ENPROTECTED; - -typedef struct _ensaveclipboard -{ - NMHDR nmhdr; - LONG cObjectCount; - LONG cch; -} ENSAVECLIPBOARD; - -#ifndef MACPORT -typedef struct _enoleopfailed -{ - NMHDR nmhdr; - LONG iob; - LONG lOper; - HRESULT hr; -} ENOLEOPFAILED; -#endif - -#define OLEOP_DOVERB 1 - -typedef struct _objectpositions -{ - NMHDR nmhdr; - LONG cObjectCount; - LONG *pcpPositions; -} OBJECTPOSITIONS; - -typedef struct _enlink -{ - NMHDR nmhdr; - UINT msg; - WPARAM wParam; - LPARAM lParam; - CHARRANGE chrg; -} ENLINK; - -typedef struct _enlowfirtf -{ - NMHDR nmhdr; - char *szControl; -} ENLOWFIRTF; - -// PenWin specific -typedef struct _encorrecttext -{ - NMHDR nmhdr; - CHARRANGE chrg; - WORD seltyp; -} ENCORRECTTEXT; - -// East Asia specific -typedef struct _punctuation -{ - UINT iSize; - LPSTR szPunctuation; -} PUNCTUATION; - -// East Asia specific -typedef struct _compcolor -{ - COLORREF crText; - COLORREF crBackground; - DWORD dwEffects; -}COMPCOLOR; - - -// Clipboard formats - use as parameter to RegisterClipboardFormat() -#define CF_RTF TEXT("Rich Text Format") -#define CF_RTFNOOBJS TEXT("Rich Text Format Without Objects") -#define CF_RETEXTOBJ TEXT("RichEdit Text and Objects") - -// Paste Special -typedef struct _repastespecial -{ - DWORD dwAspect; - DWORD_PTR dwParam; -} REPASTESPECIAL; - -// UndoName info -typedef enum _undonameid -{ - UID_UNKNOWN = 0, - UID_TYPING = 1, - UID_DELETE = 2, - UID_DRAGDROP = 3, - UID_CUT = 4, - UID_PASTE = 5, - UID_AUTOCORRECT = 6 -} UNDONAMEID; - -// Flags for the SETEXTEX data structure -#define ST_DEFAULT 0 -#define ST_KEEPUNDO 1 -#define ST_SELECTION 2 -#define ST_NEWCHARS 4 - -// EM_SETTEXTEX info; this struct is passed in the wparam of the message -typedef struct _settextex -{ - DWORD flags; // Flags (see the ST_XXX defines) - UINT codepage; // Code page for translation (CP_ACP for sys default, - // 1200 for Unicode, -1 for control default) -} SETTEXTEX; - -// Flags for the GETEXTEX data structure -#define GT_DEFAULT 0 -#define GT_USECRLF 1 -#define GT_SELECTION 2 -#define GT_RAWTEXT 4 -#define GT_NOHIDDENTEXT 8 - -// EM_GETTEXTEX info; this struct is passed in the wparam of the message -typedef struct _gettextex -{ - DWORD cb; // Count of bytes in the string - DWORD flags; // Flags (see the GT_XXX defines - UINT codepage; // Code page for translation (CP_ACP for sys default, - // 1200 for Unicode, -1 for control default) - LPCSTR lpDefaultChar; // Replacement for unmappable chars - LPBOOL lpUsedDefChar; // Pointer to flag set when def char used -} GETTEXTEX; - -// Flags for the GETTEXTLENGTHEX data structure -#define GTL_DEFAULT 0 // Do default (return # of chars) -#define GTL_USECRLF 1 // Compute answer using CRLFs for paragraphs -#define GTL_PRECISE 2 // Compute a precise answer -#define GTL_CLOSE 4 // Fast computation of a "close" answer -#define GTL_NUMCHARS 8 // Return number of characters -#define GTL_NUMBYTES 16 // Return number of _bytes_ - -// EM_GETTEXTLENGTHEX info; this struct is passed in the wparam of the msg -typedef struct _gettextlengthex -{ - DWORD flags; // Flags (see GTL_XXX defines) - UINT codepage; // Code page for translation (CP_ACP for default, - // 1200 for Unicode) -} GETTEXTLENGTHEX; - -// BiDi specific features -typedef struct _bidioptions -{ - UINT cbSize; - WORD wMask; - WORD wEffects; -} BIDIOPTIONS; - -// BIDIOPTIONS masks -#if (_RICHEDIT_VER == 0x0100) -#define BOM_DEFPARADIR 0x0001 // Default paragraph direction (implies alignment) (obsolete) -#define BOM_PLAINTEXT 0x0002 // Use plain text layout (obsolete) -#endif // _RICHEDIT_VER == 0x0100 -#define BOM_NEUTRALOVERRIDE 0x0004 // Override neutral layout (obsolete) -#define BOM_CONTEXTREADING 0x0008 // Context reading order -#define BOM_CONTEXTALIGNMENT 0x0010 // Context alignment -#define BOM_LEGACYBIDICLASS 0x0040 // Legacy Bidi classification - -// BIDIOPTIONS effects -#if (_RICHEDIT_VER == 0x0100) -#define BOE_RTLDIR 0x0001 // Default paragraph direction (implies alignment) (obsolete) -#define BOE_PLAINTEXT 0x0002 // Use plain text layout (obsolete) -#endif // _RICHEDIT_VER == 0x0100 -#define BOE_NEUTRALOVERRIDE 0x0004 // Override neutral layout (obsolete) -#define BOE_CONTEXTREADING 0x0008 // Context reading order -#define BOE_CONTEXTALIGNMENT 0x0010 // Context alignment -#define BOE_LEGACYBIDICLASS 0x0040 // Legacy Bidi classification - -// Additional EM_FINDTEXT[EX] flags -#define FR_MATCHDIAC 0x20000000 -#define FR_MATCHKASHIDA 0x40000000 -#define FR_MATCHALEFHAMZA 0x80000000 - -// UNICODE embedding character -#ifndef WCH_EMBEDDING -#define WCH_EMBEDDING (WCHAR)0xFFFC -#endif // WCH_EMBEDDING - -// khyph - Kind of hyphenation -typedef enum tagKHYPH -{ - khyphNil, // No Hyphenation - khyphNormal, // Normal Hyphenation - khyphAddBefore, // Add letter before hyphen - khyphChangeBefore, // Change letter before hyphen - khyphDeleteBefore, // Delete letter before hyphen - khyphChangeAfter, // Change letter after hyphen - khyphDelAndChange // Delete letter before hyphen and change - // letter preceding hyphen -} KHYPH; - -typedef struct hyphresult -{ - KHYPH khyph; // Kind of hyphenation - long ichHyph; // Character which was hyphenated - WCHAR chHyph; // Depending on hyphenation type, character added, changed, etc. -} HYPHRESULT; - -void WINAPI HyphenateProc(__in WCHAR *pszWord, LANGID langid, long ichExceed, HYPHRESULT *phyphresult); -typedef struct tagHyphenateInfo -{ - SHORT cbSize; // Size of HYPHENATEINFO structure - SHORT dxHyphenateZone; // If a space character is closer to the margin - // than this value, don't hyphenate (in TWIPs) - void (WINAPI* pfnHyphenate)(WCHAR*, LANGID, long, HYPHRESULT*); -} HYPHENATEINFO; - -#ifdef _WIN32 -#include -#elif !defined(RC_INVOKED) -#pragma pack() -#endif - -#ifdef __cplusplus -} -#endif // __cplusplus - -#endif // !_RICHEDIT_ - diff --git a/qt-correction-tool/pub/ddk/richole.h b/qt-correction-tool/pub/ddk/richole.h deleted file mode 100644 index 9301e14..0000000 --- a/qt-correction-tool/pub/ddk/richole.h +++ /dev/null @@ -1,165 +0,0 @@ -#ifndef _RICHOLE_ -#define _RICHOLE_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -/* - * RICHOLE.H - * - * Purpose: - * OLE Extensions to the Rich Text Editor - * - * Copyright (c) 1985-1999, Microsoft Corporation - */ - -// Structure passed to GetObject and InsertObject -typedef struct _reobject -{ - DWORD cbStruct; // Size of structure - LONG cp; // Character position of object - CLSID clsid; // Class ID of object - LPOLEOBJECT poleobj; // OLE object interface - LPSTORAGE pstg; // Associated storage interface - LPOLECLIENTSITE polesite; // Associated client site interface - SIZEL sizel; // Size of object (may be 0,0) - DWORD dvaspect; // Display aspect to use - DWORD dwFlags; // Object status flags - DWORD dwUser; // Dword for user's use -} REOBJECT; - -// Flags to specify which interfaces should be returned in the structure above -#define REO_GETOBJ_NO_INTERFACES (0x00000000L) -#define REO_GETOBJ_POLEOBJ (0x00000001L) -#define REO_GETOBJ_PSTG (0x00000002L) -#define REO_GETOBJ_POLESITE (0x00000004L) -#define REO_GETOBJ_ALL_INTERFACES (0x00000007L) - -// Place object at selection -#define REO_CP_SELECTION ((ULONG) -1L) - -// Use character position to specify object instead of index -#define REO_IOB_SELECTION ((ULONG) -1L) -#define REO_IOB_USE_CP ((ULONG) -2L) - -// Object flags -#define REO_NULL (0x00000000L) // No flags -#define REO_READWRITEMASK (0x0000003FL) // Mask out RO bits -#define REO_DONTNEEDPALETTE (0x00000020L) // Object doesn't need palette -#define REO_BLANK (0x00000010L) // Object is blank -#define REO_DYNAMICSIZE (0x00000008L) // Object defines size always -#define REO_INVERTEDSELECT (0x00000004L) // Object drawn all inverted if sel -#define REO_BELOWBASELINE (0x00000002L) // Object sits below the baseline -#define REO_RESIZABLE (0x00000001L) // Object may be resized -#define REO_LINK (0x80000000L) // Object is a link (RO) -#define REO_STATIC (0x40000000L) // Object is static (RO) -#define REO_SELECTED (0x08000000L) // Object selected (RO) -#define REO_OPEN (0x04000000L) // Object open in its server (RO) -#define REO_INPLACEACTIVE (0x02000000L) // Object in place active (RO) -#define REO_HILITED (0x01000000L) // Object is to be hilited (RO) -#define REO_LINKAVAILABLE (0x00800000L) // Link believed available (RO) -#define REO_GETMETAFILE (0x00400000L) // Object requires metafile (RO) - -// flags for IRichEditOle::GetClipboardData(), -// IRichEditOleCallback::GetClipboardData() and -// IRichEditOleCallback::QueryAcceptData() -#define RECO_PASTE (0x00000000L) // paste from clipboard -#define RECO_DROP (0x00000001L) // drop -#define RECO_COPY (0x00000002L) // copy to the clipboard -#define RECO_CUT (0x00000003L) // cut to the clipboard -#define RECO_DRAG (0x00000004L) // drag - -/* - * IRichEditOle - * - * Purpose: - * Interface used by the client of RichEdit to perform OLE-related - * operations. - * - * //$ REVIEW: - * The methods herein may just want to be regular Windows messages. - */ -#undef INTERFACE -#define INTERFACE IRichEditOle - -DECLARE_INTERFACE_(IRichEditOle, IUnknown) -{ - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // *** IRichEditOle methods *** - STDMETHOD(GetClientSite) (THIS_ LPOLECLIENTSITE FAR * lplpolesite) PURE; - STDMETHOD_(LONG,GetObjectCount) (THIS) PURE; - STDMETHOD_(LONG,GetLinkCount) (THIS) PURE; - STDMETHOD(GetObject) (THIS_ LONG iob, REOBJECT FAR * lpreobject, - DWORD dwFlags) PURE; - STDMETHOD(InsertObject) (THIS_ REOBJECT FAR * lpreobject) PURE; - STDMETHOD(ConvertObject) (THIS_ LONG iob, REFCLSID rclsidNew, - LPCSTR lpstrUserTypeNew) PURE; - STDMETHOD(ActivateAs) (THIS_ REFCLSID rclsid, REFCLSID rclsidAs) PURE; - STDMETHOD(SetHostNames) (THIS_ LPCSTR lpstrContainerApp, - LPCSTR lpstrContainerObj) PURE; - STDMETHOD(SetLinkAvailable) (THIS_ LONG iob, BOOL fAvailable) PURE; - STDMETHOD(SetDvaspect) (THIS_ LONG iob, DWORD dvaspect) PURE; - STDMETHOD(HandsOffStorage) (THIS_ LONG iob) PURE; - STDMETHOD(SaveCompleted) (THIS_ LONG iob, LPSTORAGE lpstg) PURE; - STDMETHOD(InPlaceDeactivate) (THIS) PURE; - STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE; - STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco, - LPDATAOBJECT FAR * lplpdataobj) PURE; - STDMETHOD(ImportDataObject) (THIS_ LPDATAOBJECT lpdataobj, - CLIPFORMAT cf, HGLOBAL hMetaPict) PURE; -}; -typedef IRichEditOle FAR * LPRICHEDITOLE; - -/* - * IRichEditOleCallback - * - * Purpose: - * Interface used by the RichEdit to get OLE-related stuff from the - * application using RichEdit. - */ -#undef INTERFACE -#define INTERFACE IRichEditOleCallback - -DECLARE_INTERFACE_(IRichEditOleCallback, IUnknown) -{ - // *** IUnknown methods *** - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * lplpObj) PURE; - STDMETHOD_(ULONG,AddRef) (THIS) PURE; - STDMETHOD_(ULONG,Release) (THIS) PURE; - - // *** IRichEditOleCallback methods *** - STDMETHOD(GetNewStorage) (THIS_ LPSTORAGE FAR * lplpstg) PURE; - STDMETHOD(GetInPlaceContext) (THIS_ LPOLEINPLACEFRAME FAR * lplpFrame, - LPOLEINPLACEUIWINDOW FAR * lplpDoc, - LPOLEINPLACEFRAMEINFO lpFrameInfo) PURE; - STDMETHOD(ShowContainerUI) (THIS_ BOOL fShow) PURE; - STDMETHOD(QueryInsertObject) (THIS_ LPCLSID lpclsid, LPSTORAGE lpstg, - LONG cp) PURE; - STDMETHOD(DeleteObject) (THIS_ LPOLEOBJECT lpoleobj) PURE; - STDMETHOD(QueryAcceptData) (THIS_ LPDATAOBJECT lpdataobj, - CLIPFORMAT FAR * lpcfFormat, DWORD reco, - BOOL fReally, HGLOBAL hMetaPict) PURE; - STDMETHOD(ContextSensitiveHelp) (THIS_ BOOL fEnterMode) PURE; - STDMETHOD(GetClipboardData) (THIS_ CHARRANGE FAR * lpchrg, DWORD reco, - LPDATAOBJECT FAR * lplpdataobj) PURE; - STDMETHOD(GetDragDropEffect) (THIS_ BOOL fDrag, DWORD grfKeyState, - LPDWORD pdwEffect) PURE; - STDMETHOD(GetContextMenu) (THIS_ WORD seltype, LPOLEOBJECT lpoleobj, - CHARRANGE FAR * lpchrg, - HMENU FAR * lphmenu) PURE; -}; -typedef IRichEditOleCallback FAR * LPRICHEDITOLECALLBACK; - -#ifndef MAC -// RichEdit interface GUIDs -DEFINE_GUID(IID_IRichEditOle, 0x00020D00, 0, 0, 0xC0,0,0,0,0,0,0,0x46); -DEFINE_GUID(IID_IRichEditOleCallback, 0x00020D03, 0, 0, 0xC0,0,0,0,0,0,0,0x46); -#endif // !MAC - -#endif // _RICHOLE_ - diff --git a/qt-correction-tool/pub/ddk/ringtonedeviceservice.h b/qt-correction-tool/pub/ddk/ringtonedeviceservice.h deleted file mode 100644 index 80f783d..0000000 --- a/qt-correction-tool/pub/ddk/ringtonedeviceservice.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * RingtoneDeviceService.h - * - * Contains declarations for the Ringtone Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _RINGTONEDEVICESERVICE_H_ -#define _RINGTONEDEVICESERVICE_H_ - -#include -#include - - -/*****************************************************************************/ -/* Ringtone Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Ringtones, - 0xd0eace0e, 0x707d, 0x4106, 0x8d, 0x38, 0x4f, 0x56, 0xe, 0x6a, 0x9f, 0x8e); - -#define NAME_RingtonesSvc L"Ringtones" -#define TYPE_RingtonesSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Ringtone Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_RingtonesSvc, - 0x7d05d925, 0x32e6, 0x4790, 0x92, 0x05, 0x54, 0x76, 0x4b, 0xb3, 0xcb, 0x74); - -/* PKEY_RingtonesSvc_DefaultRingtone - * - * Indicates the objectID of the default ringtone for incoming calls - * - * Type: UInt32 - * Form: ObjectID - */ - -DEFINE_DEVSVCPROPKEY(PKEY_RingtonesSvc_DefaultRingtone, - 0x7d05d925, 0x32e6, 0x4790, 0x92, 0x05, 0x54, 0x76, 0x4b, 0xb3, 0xcb, 0x74, - 2); - -#define NAME_RingtonesSvc_DefaultRingtone L"DefaultRingtone" - - -/*****************************************************************************/ -/* Ringtone Service Object Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_RingtonesObj, - 0x8d943c78, 0x2c7d, 0x4c74, 0x94, 0x5a, 0x42, 0xd8, 0x3c, 0xb5, 0x8b, 0x5a); - -#endif /* _RINGTONEDEVICESERVICE_H_ */ - - - diff --git a/qt-correction-tool/pub/ddk/rx.h b/qt-correction-tool/pub/ddk/rx.h deleted file mode 100644 index e6a98a9..0000000 --- a/qt-correction-tool/pub/ddk/rx.h +++ /dev/null @@ -1,107 +0,0 @@ -/*++ BUILD Version: 0009 // Increment this if a change has global effects -Copyright (c) 1987-1993 Microsoft Corporation - -Module Name: - - rx.h - -Abstract: - - This module is the overall h-file-wrapper for RDBSS. - -Revision History: -Notes: - - ---*/ - -#ifndef _RX_H_ -#define _RX_H_ - -#include "rxovride.h" // common compile environment -#include "ntifs.h" // NT file system driver include file. - -#ifdef RX_PRIVATE_BUILD - -// -// no one should be using these -// - -#ifdef IoGetTopLevelIrp -#error IoGetTopLevelIrp is deffed -#else -#define IoGetTopLevelIrp() IoxxxxxxGetTopLevelIrp() -#endif -#ifdef IoSetTopLevelIrp -#error IoSetTopLevelIrp is deffed -#else -#define IoSetTopLevelIrp(irp) IoxxxxxxSetTopLevelIrp(irp) -#endif -#endif // ifdef RX_PRIVATE_BUILD - - -// -// These macros sugarcoat flag manipulation just a bit -// - -#ifndef BooleanFlagOn -#define BooleanFlagOn(Flags,SingleFlag) ((BOOLEAN)((((Flags) & (SingleFlag)) != 0))) -#endif - -#ifndef SetFlag -#define SetFlag(Flags,SetOfFlags) { \ - (Flags) |= (SetOfFlags); \ -} -#endif - -#ifndef FlagOn - -// -// This macro returns TRUE if a flag in a set of flags is on and FALSE -// otherwise -// - -#define FlagOn(Flags,SingleFlag) ((Flags) & (SingleFlag)) -#endif - -#ifndef ClearFlag -#define ClearFlag(Flags,SetOfFlags) { \ - (Flags) &= ~(SetOfFlags); \ -} -#endif - -#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I))) - -// -// define INLINE to be the appropriate keyword for ANSI C -// - -#define INLINE __inline - -#include "rxtypes.h" - -#ifndef MINIRDR__NAME -#include "rxpooltg.h" // RX pool tag macros -#endif - -#include "ntrxdef.h" -#include "rxce.h" // RxCe functions -#include "rxcehdlr.h" // RxCe event handler specifications -#include "fcbtable.h" // FCB table data structures -#include "midatlax.h" // mid atlas structures -#include "mrxfcb.h" -#include "namcache.h" // structs and func defs for name cache routines -#include "rxworkq.h" -#include "rxprocs.h" -#include "rxexcept.h" - -#ifndef MINIRDR__NAME -#include "rxdata.h" -#include "buffring.h" -#endif - -#define MAKE_RESOURCE_OWNER(X) (((ERESOURCE_THREAD)(X)) | 0x3) -#define RESOURCE_OWNER_SET(X) (((X) & 0x3) == 0x3) - -#endif // #ifdef _RX_H_ - diff --git a/qt-correction-tool/pub/ddk/rxce.h b/qt-correction-tool/pub/ddk/rxce.h deleted file mode 100644 index c44086b..0000000 --- a/qt-correction-tool/pub/ddk/rxce.h +++ /dev/null @@ -1,387 +0,0 @@ -/*++ BUILD Version: 0009 // Increment this if a change has global effects -Copyright (c) 1987-1993 Microsoft Corporation - -Module Name: - - rxce.h - -Abstract: - - This is the include file that defines all constants and types for - accessing the redirector file system connection engine. - -Revision History: -Notes: - - The Connection engine is designed to map and emulate the TDI specs. as closely - as possible. This implies that on NT we will have a very efficient mechanism - which fully exploits the underlying TDI implementation. - - There are four important data structures that are created/manipulated by the - various functions associated with the connection engine. Thesr are - RXCE_TRANSPORT,RXCE_ADDRESS,RXCE_CONNECTION and RXCE_VC. - - The mini redirector writers can embed these data structures in the corresponding - definitions and invoke the two routines provided for each type to build and - tear down the connection engine portions. These routines do not allocate/free - the memory associated with these instances. This provides a flexible mechanism - for the mini redirector writers to manage instances. - ---*/ - -#ifndef _RXCE_H_ -#define _RXCE_H_ - -#include -#include // TDI related definitions. -#include -// -// The connection engine deals with three kinds of entities, transports, transport -// addresses and transport connections. The transports are bindings to the various -// transport service providers on any system. The transport addresses are the -// local connection end points. The connections are transport connections between -// endpoints. Each connection encapsulates a number of virtual circuits -// ( typically 1 ). -// - -// All the four node types are tagged with the following signature which is used -// extensively in validating them - -typedef struct _RXCE_SIGNATURE_ { - union { - struct { - USHORT Type; - CSHORT Size; - }; - - ULONG Signature; - }; -} RXCE_SIGNATURE, *PRXCE_SIGNATURE; - -// -// RXCE_TRANSPORT encapsulates all the parameters w.r.t. a TRANSPORT -// as regards the connection engine. -// - -#ifdef __cplusplus -typedef struct _RXCE_TRANSPORT_ : public RXCE_SIGNATURE { -#else // !__cplusplus -typedef struct _RXCE_TRANSPORT_ { - RXCE_SIGNATURE; -#endif // __cplusplus - - UNICODE_STRING Name; - - PDEVICE_OBJECT pDeviceObject; // Device object for transport - HANDLE ControlChannel; // Control Channel - PFILE_OBJECT pControlChannelFileObject; // File object for the control channel - - PRXCE_TRANSPORT_PROVIDER_INFO pProviderInfo; // Transport Provider Information. - - LONG ConnectionCount; // Number of connections on xport. - LONG VirtualCircuitCount; // no. of connections - ULONG QualityOfService; // quality of service provided. -} RXCE_TRANSPORT; - -#define RXCE_TRANSPORT_SIGNATURE ((sizeof(RXCE_TRANSPORT) << 16) | RDBSS_NTC_RXCE_TRANSPORT) - -#define RxCeIsTransportValid(pTransport) \ - ((pTransport)->Signature == RXCE_TRANSPORT_SIGNATURE) - -extern NTSTATUS -NTAPI -RxCeBuildTransport( - IN PRXCE_TRANSPORT pRxCeTransport, - IN PUNICODE_STRING pTransportName, - IN ULONG QualityOfService); - -extern NTSTATUS -NTAPI -RxCeTearDownTransport( - IN PRXCE_TRANSPORT pTransport); - -extern NTSTATUS -RxCeQueryAdapterStatus( - PRXCE_TRANSPORT pTransport, - struct _ADAPTER_STATUS *pAdapterStatus); - -extern NTSTATUS -RxCeQueryTransportInformation( - PRXCE_TRANSPORT pTransport, - PRXCE_TRANSPORT_INFORMATION pTransportInformation); - -// -// RXCE_ADDRESS encapsulates all the parameters w.r.t. a local transport address -// as regards the connection engine. -// - -#ifdef __cplusplus -typedef struct _RXCE_ADDRESS_ : public RXCE_SIGNATURE { -#else // !__cplusplus -typedef struct _RXCE_ADDRESS_ { - RXCE_SIGNATURE; -#endif // __cplusplus - - PRXCE_TRANSPORT pTransport; // the transport handle - PTRANSPORT_ADDRESS pTransportAddress; // the transport address - PVOID pContext; // the context used in event dispatch - PRXCE_ADDRESS_EVENT_HANDLER pHandler; // the address event handler - PMDL pReceiveMdl; // the MDL for handling Receives Supplied by client - HANDLE hAddress; // handle to the address object - PFILE_OBJECT pFileObject; // the file object for the address - LONG ConnectionCount; // no. of connections - LONG VirtualCircuitCount; // no. of vcs -} RXCE_ADDRESS; - -#define RXCE_ADDRESS_SIGNATURE ((sizeof(RXCE_ADDRESS) << 16) | RDBSS_NTC_RXCE_ADDRESS) - -#define RxCeIsAddressValid(pAddress) \ - ((pAddress)->Signature == RXCE_ADDRESS_SIGNATURE) - -extern NTSTATUS -NTAPI -RxCeBuildAddress( - IN OUT PRXCE_ADDRESS pAddress, - IN PRXCE_TRANSPORT pTransport, - IN PTRANSPORT_ADDRESS pTransportAddress, - IN PRXCE_ADDRESS_EVENT_HANDLER pHandler, - IN PVOID pEventContext); - -extern NTSTATUS -NTAPI -RxCeTearDownAddress( - IN PRXCE_ADDRESS pAddress); - -// -// RxCe Connection Establishment methods .... -// -// -// RXCE_CONNECTION encapsulates all the information w.r.t. a connection -// as regards the connection engine. -// - -#ifdef __cplusplus -typedef struct _RXCE_CONNECTION_ : public RXCE_SIGNATURE { -#else // !__cplusplus -typedef struct _RXCE_CONNECTION_ { - RXCE_SIGNATURE; -#endif // __cplusplus - - PRXCE_ADDRESS pAddress; // the local address for this connection - ULONG VirtualCircuitCount; // the number of virtual circuits associated with the connection - PVOID pContext; // the context used in event dispatch - PRXCE_CONNECTION_EVENT_HANDLER pHandler; // the event handler for the connection - PRXCE_CONNECTION_INFORMATION pConnectionInformation; // the remote address ... -} RXCE_CONNECTION; - -#define RXCE_CONNECTION_SIGNATURE ((sizeof(RXCE_CONNECTION) << 16) | RDBSS_NTC_RXCE_CONNECTION) - -#define RxCeIsConnectionValid(pConnection) \ - ((pConnection)->Signature == RXCE_CONNECTION_SIGNATURE) - -// -// The following enumerated type defines the various choices presented for -// selecting the transport over which a connection should be established -// - -typedef enum _RXCE_CONNECTION_CREATE_OPTIONS_ { - RxCeSelectFirstSuccessfulTransport, - RxCeSelectBestSuccessfulTransport, - RxCeSelectAllSuccessfulTransports -} RXCE_CONNECTION_CREATE_OPTIONS, - *PRXCE_CONNECTION_CREATE_OPTIONS; - -typedef struct _RXCE_CONNECTION_COMPLETION_CONTEXT_ { - NTSTATUS Status; - ULONG AddressIndex; - PRXCE_CONNECTION pConnection; - PRXCE_VC pVc; - RX_WORK_QUEUE_ITEM WorkQueueItem; - - // This is used to pass the UNICODE DNS name returned back from TDI - PRXCE_CONNECTION_INFORMATION pConnectionInformation; -} RXCE_CONNECTION_COMPLETION_CONTEXT, - *PRXCE_CONNECTION_COMPLETION_CONTEXT; - -typedef -NTSTATUS -(*PRXCE_CONNECTION_COMPLETION_ROUTINE)( - PRXCE_CONNECTION_COMPLETION_CONTEXT pCompletionContext); - -extern NTSTATUS -NTAPI -RxCeBuildConnection( - IN PRXCE_ADDRESS pLocalAddress, - IN PRXCE_CONNECTION_INFORMATION pConnectionInformation, - IN PRXCE_CONNECTION_EVENT_HANDLER pHandler, - IN PVOID pEventContext, - IN OUT PRXCE_CONNECTION pConnection, - IN OUT PRXCE_VC pVc); - -extern NTSTATUS -NTAPI -RxCeBuildConnectionOverMultipleTransports( - IN OUT PRDBSS_DEVICE_OBJECT pMiniRedirectorDeviceObject, - IN RXCE_CONNECTION_CREATE_OPTIONS CreateOption, - IN ULONG NumberOfAddresses, - IN PRXCE_ADDRESS *pLocalAddressPointers, - IN PUNICODE_STRING pServerName, - IN PRXCE_CONNECTION_INFORMATION pConnectionInformation, - IN PRXCE_CONNECTION_EVENT_HANDLER pHandler, - IN PVOID pEventContext, - IN PRXCE_CONNECTION_COMPLETION_ROUTINE pCompletionRoutine, - IN OUT PRXCE_CONNECTION_COMPLETION_CONTEXT pCompletionContext); - -extern NTSTATUS -NTAPI -RxCeTearDownConnection( - IN PRXCE_CONNECTION pConnection); - - -extern NTSTATUS -NTAPI -RxCeCancelConnectRequest( - IN PRXCE_ADDRESS pLocalAddress, - IN PUNICODE_STRING pServerName, - IN PRXCE_CONNECTION_INFORMATION pConnectionInformation); - - -// -// RXCE_VC encapsulates all the information w.r.t a virtual circuit (VC) -// connection to a particular server as regards the connection engine. -// -// Typically one VC is associated with a connection. However, there are instances in -// which more than one VC can be associated with a connection. In order to efficiently -// handle the common case well and at the same time provide an extensible mechanism we -// define a collection data structure ( a list ) which subsumes the allocation for -// one virtual circuit. It is also imperative that we restrict the knowledge of -// how this collection is organized to as few methods as possible in order to -// enable optimization/restructuring of this data structure at a later time. -// - -#define RXCE_VC_ACTIVE ((LONG)0xaa) -#define RXCE_VC_DISCONNECTED ((LONG)0xdd) -#define RXCE_VC_TEARDOWN ((LONG)0xbb) - -#ifdef __cplusplus -typedef struct _RXCE_VC_ : public RXCE_SIGNATURE { -#else // !__cplusplus -typedef struct _RXCE_VC_ { - RXCE_SIGNATURE; -#endif // __cplusplus - - PRXCE_CONNECTION pConnection; // the referenced connection instance - HANDLE hEndpoint; // local endpoint for the connection - PFILE_OBJECT pEndpointFileObject; // the end point file object. - __volatile LONG State; // status of the Vc. - CONNECTION_CONTEXT ConnectionId; // local endpoint for the connection. - PMDL pReceiveMdl; // the MDl for handling receives. - PKEVENT pCleanUpEvent; // sychronize event for clean up transports -} RXCE_VC; - -#define RXCE_VC_SIGNATURE ((sizeof(RXCE_VC) << 16) | RDBSS_NTC_RXCE_VC) - -#define RxCeIsVcValid(pVc) \ - ((pVc)->Signature == RXCE_VC_SIGNATURE) - -extern NTSTATUS -NTAPI -RxCeBuildVC( - IN OUT PRXCE_VC pVc, - IN PRXCE_CONNECTION Connection); - -extern NTSTATUS -NTAPI -RxCeTearDownVC( - IN PRXCE_VC pVc); - -extern NTSTATUS -NTAPI -RxCeInitiateVCDisconnect( - IN PRXCE_VC pVc); - -extern NTSTATUS -NTAPI -RxCeQueryInformation( - IN PRXCE_VC pVc, - IN RXCE_CONNECTION_INFORMATION_CLASS InformationClass, - OUT PVOID pInformation, - IN ULONG Length); - -// -// RxCe Data transmission methods -// - -// -// Send options -// -// The following flags are equivalent to the TDI flags. In addition -// there are RXCE specific flags which are defined from the other end of -// a dword. -// - -#define RXCE_SEND_EXPEDITED TDI_SEND_EXPEDITED -#define RXCE_SEND_NO_RESPONSE_EXPECTED TDI_SEND_NO_RESPONSE_EXPECTED -#define RXCE_SEND_NON_BLOCKING TDI_SEND_NON_BLOCKING - -// -// The ASYNCHRONOUS and SYNCHRONOUS option available RxCeSend and RxCeSendDatagram -// distinguish between two situations. In the asynchronous case control returns to -// the caller once the request has been successfully submitted to the underlying -// transport. The results for any given request are communicated back using the -// SendCompletion callback routine. The pCompletionContext parameter in RxCeSend and -// RxCeSendDatagram is passed back in the callback routine to assist the caller in -// disambiguating the requests. -// -// In the synchronous case the request is submitted to the underlying transport and the -// control does not return to the caller till the request completes. -// -// Note that in the synchrnous case the pCompletionContext parameter is ignored and the -// status that is returned correpsonds to the completion status of the operations. -// -// The benefit of ASYNCHRONOUS and SYNCHRONOUS options depends on the underlying -// transport. In a Virtual Circuit environment a SYNCHRONOUS option implies that the -// control does not return till the data reaches the server. On the other hand -// for datagram oriented transports there is very little difference between the two. -// - -#define RXCE_FLAGS_MASK (0xff000000) - -#define RXCE_SEND_SYNCHRONOUS (0x10000000) - -// The following bit signifies if an RX_MEM_DESC(MDL) is to be sent in its entirety -// or only portions of it need to be sent. - -#define RXCE_SEND_PARTIAL (0x20000000) - -extern NTSTATUS -NTAPI -RxCeSend( - IN PRXCE_VC pVc, - IN ULONG SendOptions, - IN PMDL pMdl, - IN ULONG SendLength, - IN PVOID pCompletionContext); - -extern NTSTATUS -NTAPI -RxCeSendDatagram( - IN PRXCE_ADDRESS hAddress, - IN PRXCE_CONNECTION_INFORMATION pConnectionInformation, - IN ULONG SendOptions, - IN PMDL pMdl, - IN ULONG SendLength, - IN PVOID pCompletionContext); - -extern PIRP -RxCeAllocateIrpWithMDL( - IN CCHAR StackSize, - IN BOOLEAN ChargeQuota, - IN PMDL Buffer); - -extern VOID -RxCeFreeIrp(PIRP pIrp); - - -#endif // _RXCE_H_ - diff --git a/qt-correction-tool/pub/ddk/rxcehdlr.h b/qt-correction-tool/pub/ddk/rxcehdlr.h deleted file mode 100644 index 12bb2c6..0000000 --- a/qt-correction-tool/pub/ddk/rxcehdlr.h +++ /dev/null @@ -1,309 +0,0 @@ -/*++ BUILD Version: 0009 // Increment this if a change has global effects -Copyright (c) 1987-1993 Microsoft Corporation - -Module Name: - - rxcehdlr.h - -Abstract: - - This is the include file that defines all constants and types for - accessing the redirector file system connection engine. - -Revision History: -Notes: - - The Connection engine is designed to map and emulate the TDI specs. as closely - as possible. This implies that on NT we will have a very efficient mechanism - which fully exploits the underlying TDI implementation. - - All the necessary types can be redefined in terms of the types defined in - \nt\private\inc\tdi.h in the case of NT. For Win95 we will provide the - appropriate definitions. - ---*/ - -#ifndef _RXCEHDLR_H_ -#define _RXCEHDLR_H_ - -#include "tdi.h" - -typedef TDI_PROVIDER_INFO RXCE_TRANSPORT_PROVIDER_INFO; -typedef RXCE_TRANSPORT_PROVIDER_INFO* PRXCE_TRANSPORT_PROVIDER_INFO; - -typedef TDI_CONNECTION_INFORMATION RXCE_CONNECTION_INFORMATION; -typedef RXCE_CONNECTION_INFORMATION* PRXCE_CONNECTION_INFORMATION; - -typedef TDI_CONNECTION_INFORMATION RXCE_CONNECTION_INFORMATION; -typedef RXCE_CONNECTION_INFORMATION* PRXCE_CONNECTION_INFORMATION; - -typedef TDI_CONNECTION_INFO RXCE_CONNECTION_INFO; -typedef RXCE_CONNECTION_INFO* PRXCE_CONNECTION_INFO; - -#ifdef __cplusplus -typedef struct _RXCE_TRANSPORT_INFORMATION_ : public RXCE_TRANSPORT_PROVIDER_INFO { -#else // !__cplusplus -typedef struct _RXCE_TRANSPORT_INFORMATION_ { - RXCE_TRANSPORT_PROVIDER_INFO; -#endif // __cplusplus - - ULONG ConnectionCount; - ULONG QualityOfService; -} RXCE_TRANSPORT_INFORMATION, *PRXCE_TRANSPORT_INFORMATION; - -typedef enum _RXCE_CONNECTION_INFORMATION_CLASS_ { - RxCeTransportProviderInformation = 1, - RxCeConnectionInformation, - RxCeConnectionEndpointInformation, - RxCeRemoteAddressInformation -} RXCE_CONNECTION_INFORMATION_CLASS, - *PRXCE_CONNECTION_INFORMATION_CLASS; - -typedef struct _RXCE_VC_ *PRXCE_VC; -typedef struct _RXCE_CONNECTION_ *PRXCE_CONNECTION; -typedef struct _RXCE_ADDRESS_ *PRXCE_ADDRESS; -typedef struct _RXCE_TRANSPORT_ *PRXCE_TRANSPORT; - -// -// Disconnection indication prototype. This is invoked when a connection is -// being disconnected for a reason other than the user requesting it. -// - -typedef -NTSTATUS -(*PRXCE_IND_DISCONNECT)( - IN PVOID pRxCeEventContext, - IN PRXCE_VC pVc, - IN int DisconnectDataLength, - IN PVOID DisconnectData, - IN int DisconnectInformationLength, - IN PVOID DisconnectInformation, - IN ULONG DisconnectFlags - ); - -// -// A protocol error has occurred when this indication happens. This indication -// occurs only for errors of the worst type; the address this indication is -// delivered to is no longer usable for protocol-related operations, and -// should not be used for operations henceforth. All connections associated -// it are invalid. -// - -typedef -NTSTATUS -(*PRXCE_IND_ENDPOINT_ERROR)( - IN PVOID pRxCeEventContext, // the event context. - IN NTSTATUS Status // status code indicating error type. - ); - - -typedef -NTSTATUS -(*PRXCE_IND_CONNECTION_ERROR)( - IN PVOID pRxCeEventContext, // the event context. - PRXCE_VC pVc, // the associated VC handle - IN NTSTATUS Status // status code indicating error type. - ); - -// -// RXCE_IND_RECEIVE indication handler definition. This client routine is -// called by the transport provider when a connection-oriented TSDU is received -// that should be presented to the client. -// -// A Receive event handler can return one of three distinguished error codes to -// initiate a different course of action in the connection engine. -// -// STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that -// was taken is indicated in the parameter BytesTaken. -// -// STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the -// data should be copied. This is typically the case when BytesAvailable is greater than -// BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer -// that is specified. Note that when this status code is returned from the client it is -// conceivable that the client can demand more data than is available to be copied into -// the buffer. In such cases the subsequent indications till this criterion is met is not -// passed back to the user till the copy is completed. On completion of this copy the -// RxCe notifies the client by invoking the RxCeDataReadyEventHandler. -// -// STATUS_DATA_NOT_ACCEPTED - The client has refused the data. -// - -typedef -NTSTATUS -(*PRXCE_IND_RECEIVE)( - IN PVOID pRxCeEventContext, // the context provided during registration - IN PRXCE_VC pVc, // the associated VC handle - IN ULONG ReceiveFlags, // the receive flags - IN ULONG BytesIndicated, // the number of received bytes indicated - IN ULONG BytesAvailable, // the total number of bytes available - OUT ULONG *BytesTaken, // return indication of the bytes consumed - IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - OUT PMDL *pDataBufferPointer, // the buffer for copying the bytes not indicated. - OUT PULONG pDataBufferSize // amount of data to copy - ); - - -// -// RXCE_IND_RECEIVE_DATAGRAM indication handler definition. This client routine -// is called by the transport provider when a connectionless TSDU is received -// that should be presented to the client. -// -// A Receive event handler can return one of three distinguished error codes to -// initiate a different course of action in the connection engine. -// -// STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that -// was taken is indicated in the parameter BytesTaken. -// -// STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the -// data should be copied. This is typically the case when BytesAvailable is greater than -// BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer -// that is specified. Note that when this status code is returned from the client it is -// conceivable that the client can demand more data than is available to be copied into -// the buffer. In such cases the subsequent indications till this criterion is met is not -// passed back to the user till the copy is completed. On completion of this copy the -// RxCe notifies the client by invoking the RxCeDataReadyEventHandler. -// -// STATUS_DATA_NOT_ACCEPTED - The client has refused the data. -// -// - -typedef -NTSTATUS -(*PRXCE_IND_RECEIVE_DATAGRAM)( - IN PVOID pRxCeEventContext, // the event context - IN int SourceAddressLength, // length of the originator of the datagram - IN PVOID SourceAddress, // string describing the originator of the datagram - IN int OptionsLength, // options for the receive - IN PVOID Options, // - IN ULONG ReceiveDatagramFlags, // - IN ULONG BytesIndicated, // number of bytes this indication - IN ULONG BytesAvailable, // number of bytes in complete Tsdu - OUT ULONG *BytesTaken, // number of bytes used - IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - OUT PMDL *pDataBufferPointer, // the buffer in which data is to be copied. - OUT PULONG pDataBufferSize // amount of data to copy - ); - -// -// This indication is delivered if expedited data is received on the connection. -// This will only occur in providers that support expedited data. -// -// A Receive event handler can return one of three distinguished error codes to -// initiate a different course of action in the connection engine. -// -// STATUS_SUCCESS -- Data was copied directly from the TSDU. The amout of data that -// was taken is indicated in the parameter BytesTaken. -// -// STATUS_MORE_PROCESSING_REQUIRED -- The client has returned a buffer into which the -// data should be copied. This is typically the case when BytesAvailable is greater than -// BytesIndicated. In such cases the RxCe will copy the remaining data into the buffer -// that is specified. Note that when this status code is returned from the client it is -// conceivable that the client can demand more data than is available to be copied into -// the buffer. In such cases the subsequent indications till this criterion is met is not -// passed back to the user till the copy is completed. On completion of this copy the -// RxCe notifies the client by invoking the RxCeDataReadyEventHandler. -// -// STATUS_DATA_NOT_ACCEPTED - The client has refused the data. -// - -typedef -NTSTATUS -(*PRXCE_IND_RECEIVE_EXPEDITED)( - IN PVOID pRxCeEventContext, // the context provided during registration - IN PRXCE_VC pVc, // the associated VC handle - IN ULONG ReceiveFlags, // - IN ULONG BytesIndicated, // number of bytes in this indication - IN ULONG BytesAvailable, // number of bytes in complete Tsdu - OUT ULONG *BytesTaken, // number of bytes used by indication routine - IN PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - OUT PMDL *pDataBufferPointer, // the buffer in which data is to be copied. - OUT PULONG pDataBufferSize // amount of data to copy - ); - -// -// This indication is delivered if there is room for a send in the buffer of -// a buffering protocol. -// - -typedef -NTSTATUS -(*PRXCE_IND_SEND_POSSIBLE)( - IN PVOID pRxCeEventContext, - IN PRXCE_VC pVc, - IN ULONG BytesAvailable); - -// -// RxCeDataReadyEventHandler -- This is invoked when the desired data is available -// for client consumption. This always follows a receive indication in which the -// client returns a buffer for copying the remaining data -// - -typedef -NTSTATUS -(*PRXCE_IND_DATA_READY)( - IN PVOID pEventContext, - IN PMDL pBuffer, - IN ULONG CopiedDataSize, - IN NTSTATUS CopyDataStatus); - - -// -// RxCeSendCompleteEventHandler -- This is invoked when the send has been successfully completed -// The buffer and the length sent are passed in as parameters -// - -typedef -NTSTATUS -(*PRXCE_IND_SEND_COMPLETE)( - IN PVOID pEventContext, - IN PVOID pCompletionContext, - IN NTSTATUS Status); - - -typedef -NTSTATUS -(*PRXCE_IND_CONNECTION_SEND_COMPLETE)( - IN PVOID pEventContext, - IN PRXCE_VC pVc, - IN PVOID pCompletionContext, - IN NTSTATUS Status); - -// -// RxCeSendSubmittedEventHandler -- This is invoked when the send has been successfully -// submitted to the transport. -// - -typedef -NTSTATUS -(*PRXCE_IND_CONNECTION_SEND_SUBMITTED)( - IN PVOID pEventContext, - IN PRXCE_VC pVc, - IN PVOID pCompletionContext, - IN NTSTATUS Status); - -// -// Event Handler Dispatch Vector definitions .... -// - -typedef struct _RXCE_ADDRESS_EVENT_HANDLER_ { - PRXCE_IND_ENDPOINT_ERROR RxCeErrorEventHandler; - PRXCE_IND_RECEIVE_DATAGRAM RxCeReceiveDatagramEventHandler; - PRXCE_IND_DATA_READY RxCeDataReadyEventHandler; - PRXCE_IND_SEND_POSSIBLE RxCeSendPossibleEventHandler; - PRXCE_IND_SEND_COMPLETE RxCeSendCompleteEventHandler; -} RXCE_ADDRESS_EVENT_HANDLER, *PRXCE_ADDRESS_EVENT_HANDLER; - -typedef struct _RXCE_CONNECTION_EVENT_HANDLER_ { - PRXCE_IND_DISCONNECT RxCeDisconnectEventHandler; - PRXCE_IND_CONNECTION_ERROR RxCeErrorEventHandler; - PRXCE_IND_RECEIVE RxCeReceiveEventHandler; - PRXCE_IND_RECEIVE_DATAGRAM RxCeReceiveDatagramEventHandler; - PRXCE_IND_RECEIVE_EXPEDITED RxCeReceiveExpeditedEventHandler; - PRXCE_IND_SEND_POSSIBLE RxCeSendPossibleEventHandler; - PRXCE_IND_DATA_READY RxCeDataReadyEventHandler; - PRXCE_IND_CONNECTION_SEND_COMPLETE RxCeSendCompleteEventHandler; - PRXCE_IND_CONNECTION_SEND_SUBMITTED RxCeSendSubmittedEventHandler; -} RXCE_CONNECTION_EVENT_HANDLER, *PRXCE_CONNECTION_EVENT_HANDLER; - -#endif // _RXCEHDLR_H_ - diff --git a/qt-correction-tool/pub/ddk/rxcontx.h b/qt-correction-tool/pub/ddk/rxcontx.h deleted file mode 100644 index 5f7256a..0000000 --- a/qt-correction-tool/pub/ddk/rxcontx.h +++ /dev/null @@ -1,826 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - RxContx.h - -Abstract: - - This module defines RxContext data structure. This structure is used to - describe an Irp whil it is being processed and contains state information - that allows global resources to be released as the irp is completed. - -Author: -Notes: - - The RX_CONTEXT is a data structure to which additional information provided - by the various mini redirectors need to be attached. This can be done in one - of the following three ways - - 1) Allow for context pointers to be defined as part of the RX_CONTEXT which - the mini redirectors can use to squirrel away their information. This - implies that every time an RX_CONTEXT is allocated/destroyed the mini - redirector has to perform an associated allocation/destruction. - - Since RX_CONTEXT's are created/destroyed in great numbers, this is not an - acceptable solution. - - 2) The second approach consists of over allocating RX_CONTEXT's by a - prespecified amount for each mini redirector which is then reserved for - use by the mini redirector. Such an approach avoids the additional - allocation/destruction but complicates the RX_CONTEXT management code in - the wrapper. - - 3) The third approach ( the one that is implemented ) consists of allocating - a prespecfied area which is the same for all mini redirectors as part of - each RX_CONTEXT. This is an unformatted area on top of which any desired - structure can be imposed by the various mini redirectors. Such an approach - overcomes the disadvantages associated with (1) and (2). - - All mini redirector writers must try and define the associated mini redirector - contexts to fit into this area. Those mini redirectors who violate this - rule will incur a significant performance penalty. - ---*/ - -#ifndef _RX_CONTEXT_STRUCT_DEFINED_ -#define _RX_CONTEXT_STRUCT_DEFINED_ -#ifndef RDBSS_TRACKER -#error tracker must be defined right now -#endif - -#define RX_TOPLEVELIRP_CONTEXT_SIGNATURE ('LTxR') -typedef struct _RX_TOPLEVELIRP_CONTEXT { - union { -#ifndef __cplusplus - LIST_ENTRY; -#endif // __cplusplus - LIST_ENTRY ListEntry; - }; - ULONG Signature; - PRDBSS_DEVICE_OBJECT RxDeviceObject; - PRX_CONTEXT RxContext; - PIRP Irp; - ULONG Flags; - PVOID Previous; - PETHREAD Thread; -} RX_TOPLEVELIRP_CONTEXT, *PRX_TOPLEVELIRP_CONTEXT; - -BOOLEAN -RxTryToBecomeTheTopLevelIrp ( - IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext, - IN PIRP Irp, - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN BOOLEAN ForceTopLevel - ); - -VOID -__RxInitializeTopLevelIrpContext ( - IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext, - IN PIRP Irp, - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN ULONG Flags - ); -#define RxInitializeTopLevelIrpContext(a,b,c) {__RxInitializeTopLevelIrpContext(a,b,c,0);} - -PIRP -RxGetTopIrpIfRdbssIrp ( - VOID - ); - -PRDBSS_DEVICE_OBJECT -RxGetTopDeviceObjectIfRdbssIrp ( - VOID - ); - -VOID -RxUnwindTopLevelIrp ( - IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext - ); - -BOOLEAN -RxIsThisTheTopLevelIrp ( - IN PIRP Irp - ); - -#ifdef RDBSS_TRACKER -typedef struct _RX_FCBTRACKER_CALLINFO { - ULONG AcquireRelease; - USHORT SavedTrackerValue; - USHORT LineNumber; - PSZ FileName; - ULONG Flags; -} RX_FCBTRACKER_CALLINFO, *PRX_FCBTRACKER_CALLINFO; -#define RDBSS_TRACKER_HISTORY_SIZE 32 -#endif - -#define MRX_CONTEXT_FIELD_COUNT 4 -#define MRX_CONTEXT_SIZE (sizeof(PVOID) * MRX_CONTEXT_FIELD_COUNT) - -// -// Define rxdriver dispatch routine type....almost all of the important routine -// will have this type. -// - -typedef -NTSTATUS -(NTAPI *PRX_DISPATCH) ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -// -// predeclare dfs types -// - -typedef struct _DFS_NAME_CONTEXT_ *PDFS_NAME_CONTEXT; - -typedef struct _NT_CREATE_PARAMETERS { - ACCESS_MASK DesiredAccess; - LARGE_INTEGER AllocationSize; - ULONG FileAttributes; - ULONG ShareAccess; - ULONG Disposition; - ULONG CreateOptions; - PIO_SECURITY_CONTEXT SecurityContext; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - PVOID DfsContext; - PDFS_NAME_CONTEXT DfsNameContext; -} NT_CREATE_PARAMETERS, *PNT_CREATE_PARAMETERS; - -typedef struct _RX_CONTEXT { - - // - // the node type, size and reference count, aka standard header - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - __volatile ULONG ReferenceCount; - - // - // the list entry to wire the context to the list of active contexts - // - - LIST_ENTRY ContextListEntry; - - // - // Major and minor function of the IRP associated with the context - // - - UCHAR MajorFunction; - UCHAR MinorFunction; - - // - // this is similar to the same field in Irps; it - // allows callback routines for async operations - // to know whether to do asynchronous work or not - // - - BOOLEAN PendingReturned; - - // - // indicates if the associated request is to be posted to a RDBSS worker thread. - // - - BOOLEAN PostRequest; - - // - // Originating Device (required for workque algorithms) - // not currently used but could be used for local minis - // - - PDEVICE_OBJECT RealDevice; - - // - // ptr to the originating Irp - // - - PIRP CurrentIrp; - - // - // ptr to the IRP stack location - // - - PIO_STACK_LOCATION CurrentIrpSp; - - // - // ptr to the FCB and FOBX, derived from the context pointers in the - // file object associated with the IRP - // - - PMRX_FCB pFcb; - PMRX_FOBX pFobx; - PMRX_SRV_OPEN pRelevantSrvOpen; - PNON_PAGED_FCB NonPagedFcb; - - // - // device object calldown (not irpsp.....) - // - - PRDBSS_DEVICE_OBJECT RxDeviceObject; - - // - // The original thread in which the request was initiated and the last - // thread in which some processing associated with the context was done - // - - PETHREAD OriginalThread; - PETHREAD LastExecutionThread; - - __volatile PVOID LockManagerContext; - - // - // One word of the context is given to rdbss for dbg information - // - - PVOID RdbssDbgExtension; - - RX_SCAVENGER_ENTRY ScavengerEntry; - - // - // global serial number for this operation - // - - ULONG SerialNumber; - - // - // used by minirdrs to see if multiple calls are part - // of the same larger operation and (therefore) more cacheable - // - - ULONG FobxSerialNumber; - - ULONG Flags; - - BOOLEAN FcbResourceAcquired; - BOOLEAN FcbPagingIoResourceAcquired; - UCHAR MustSucceedDescriptorNumber; - - // - // mostly you want the individual components...sometimes it's nice as a pair - // used to record the status when you can't just return it; e.g., when - // RXSTATUS is not an appropriate return type or if the consumer of the - // status didn't call directly (lowiocompletions). minirdrs will not need - // to set the information directly - // - - union { - struct { - union { - NTSTATUS StoredStatus; - PVOID StoredStatusAlignment; - }; - ULONG_PTR InformationToReturn; - }; - IO_STATUS_BLOCK IoStatusBlock; - }; - - // - // the context fields provided for use by the mini redirectors - // this is defined as a union to force longlong alignment - // - - union { - ULONGLONG ForceLonglongAligmentDummyField; - PVOID MRxContext[MRX_CONTEXT_FIELD_COUNT]; - }; - - // - // The following field is included to fix the problem related to write only - // opens. This introduces a new field for the mini redirector to squirrel - // some state. This is redundant and should be removed after Windows 2000. - // Having a unique field reduces the impact of the change that we are making - // to the specific code path. It will be ideal to use one of the MRXContext - // fields defined above - // - - PVOID WriteOnlyOpenRetryContext; - - // - // the cancellation routine to be invoked, set by the mini redirector - // - - PMRX_CALLDOWN MRxCancelRoutine; - - // - // private dispatch, if any. used in fspdisp - // - - PRX_DISPATCH ResumeRoutine; - - // - // for posting to worker threads - // the minirdr can use this for posting within the minirdr - // a potential problem can arise if the minirdr relies on this both - // for queueing async stuff and for queueing cancel stuff - // - - // - // The OverflowListEntry is used for queueing items to the overflow queue. - // This is seperate now to allow us to distinguish between an item in the overflow - // queue and one in the active work queue (for cancellation logic) - // - - RX_WORK_QUEUE_ITEM WorkQueueItem; - LIST_ENTRY OverflowListEntry; - - // - // this event is used for synchronous operations - // that have to i/f with an underlying async service. it can be used - // by the minirdr with the following provisions: - // 1) on entering the minirdr through lowio, it is set to the - // nonsignaled state (but a wise user will reset it before using - // it....particularly if it's used multiple times. - // 2) if you are returning STATUS_PENDING on a sync operation, you must - // return with it set to the nonsignaled state; that is, either - // you don't use it or you reset it in this case - // - - KEVENT SyncEvent; - - // - // this is a list head of operations that are to be released on completion - // - - LIST_ENTRY BlockedOperations; - - // - // this is the mutex that controls serialization of the blocked operations - // - - PFAST_MUTEX BlockedOpsMutex; - - // - // these links are used to serialize pipe operations on a - // per-file-object basis AND FOR LOTS OF OTHER STUFF - // - - LIST_ENTRY RxContextSerializationQLinks; - - union { - struct { - union { - FS_INFORMATION_CLASS FsInformationClass; - FILE_INFORMATION_CLASS FileInformationClass; - }; - PVOID Buffer; - union { - LONG Length; - LONG LengthRemaining; - }; - BOOLEAN ReplaceIfExists; - BOOLEAN AdvanceOnly; - } Info; - - struct { - UNICODE_STRING SuppliedPathName; - NET_ROOT_TYPE NetRootType; - PIO_SECURITY_CONTEXT pSecurityContext; - } PrefixClaim; - }; - - // - // THIS UNION MUST BE LAST....AT SOME POINT, WE MAY START ALLOCATING - // SMALLER PER OPERATION! - // - - union{ - struct { - NT_CREATE_PARAMETERS NtCreateParameters; // a copy of the createparameters - ULONG ReturnedCreateInformation; - PWCH CanonicalNameBuffer; // if the canonical name is larger than available buffer - PRX_PREFIX_ENTRY NetNamePrefixEntry; // the entry returned by the lookup....for dereferencing - - PMRX_SRV_CALL pSrvCall; // Server Call being used - PMRX_NET_ROOT pNetRoot; // Net Root being used - PMRX_V_NET_ROOT pVNetRoot; // Virtual Net Root - //PMRX_SRV_OPEN pSrvOpen; // Server Open - - PVOID EaBuffer; - ULONG EaLength; - - ULONG SdLength; - - ULONG PipeType; - ULONG PipeReadMode; - ULONG PipeCompletionMode; - - USHORT Flags; - NET_ROOT_TYPE Type; // Type of Net Root(Pipe/File/Mailslot..) - UCHAR RdrFlags; // Flags for use by the RDR while processing the request. - - BOOLEAN FcbAcquired; - BOOLEAN TryForScavengingOnSharingViolation; - BOOLEAN ScavengingAlreadyTried; - - BOOLEAN ThisIsATreeConnectOpen; - BOOLEAN TreeConnectOpenDeferred; - UNICODE_STRING TransportName; - UNICODE_STRING UserName; - UNICODE_STRING Password; - UNICODE_STRING UserDomainName; - } Create; - struct { - ULONG FileIndex; - BOOLEAN RestartScan; - BOOLEAN ReturnSingleEntry; - BOOLEAN IndexSpecified; - BOOLEAN InitialQuery; - } QueryDirectory; - struct { - PMRX_V_NET_ROOT pVNetRoot; - } NotifyChangeDirectory; - struct { - PUCHAR UserEaList; - ULONG UserEaListLength; - ULONG UserEaIndex; - BOOLEAN RestartScan; - BOOLEAN ReturnSingleEntry; - BOOLEAN IndexSpecified; - } QueryEa; - struct { - SECURITY_INFORMATION SecurityInformation; - ULONG Length; - } QuerySecurity; - struct { - SECURITY_INFORMATION SecurityInformation; - PSECURITY_DESCRIPTOR SecurityDescriptor; - } SetSecurity; - struct { - ULONG Length; - PSID StartSid; - PFILE_GET_QUOTA_INFORMATION SidList; - ULONG SidListLength; - BOOLEAN RestartScan; - BOOLEAN ReturnSingleEntry; - BOOLEAN IndexSpecified; - } QueryQuota; - struct { - ULONG Length; - - } SetQuota; - struct { - PV_NET_ROOT VNetRoot; - PSRV_CALL SrvCall; - PNET_ROOT NetRoot; - } DosVolumeFunction; - struct { - ULONG FlagsForLowIo; - LOWIO_CONTEXT LowIoContext; // the LOWIO parameters - }; // no name here.... - LUID FsdUid; - } ; - - // - // CODE.IMPROVEMENT remove this to wrapperdbgprivates - // - - PWCH AlsoCanonicalNameBuffer; // if the canonical name is larger than available buffer - PUNICODE_STRING LoudCompletionString; - -#ifdef RDBSS_TRACKER - __volatile LONG AcquireReleaseFcbTrackerX; - __volatile ULONG TrackerHistoryPointer; - RX_FCBTRACKER_CALLINFO TrackerHistory[RDBSS_TRACKER_HISTORY_SIZE]; -#endif - -#if DBG - ULONG ShadowCritOwner; -#endif - -} RX_CONTEXT, *PRX_CONTEXT; - -typedef enum { - RX_CONTEXT_FLAG_FROM_POOL = 0x00000001, - RX_CONTEXT_FLAG_WAIT = 0x00000002, - RX_CONTEXT_FLAG_WRITE_THROUGH = 0x00000004, - RX_CONTEXT_FLAG_FLOPPY = 0x00000008, - RX_CONTEXT_FLAG_RECURSIVE_CALL = 0x00000010, - RX_CONTEXT_FLAG_THIS_DEVICE_TOP_LEVEL = 0x00000020, - RX_CONTEXT_FLAG_DEFERRED_WRITE = 0x00000040, - RX_CONTEXT_FLAG_VERIFY_READ = 0x00000080, - RX_CONTEXT_FLAG_STACK_IO_CONTEZT = 0x00000100, - RX_CONTEXT_FLAG_IN_FSP = 0x00000200, - RX_CONTEXT_FLAG_CREATE_MAILSLOT = 0x00000400, - RX_CONTEXT_FLAG_MAILSLOT_REPARSE = 0x00000800, - RX_CONTEXT_FLAG_ASYNC_OPERATION = 0x00001000, - RX_CONTEXT_FLAG_NO_COMPLETE_FROM_FSP = 0x00002000, - RX_CONTEXT_FLAG_POST_ON_STABLE_CONDITION = 0x00004000, - RX_CONTEXT_FLAG_FSP_DELAYED_OVERFLOW_QUEUE = 0x00008000, - RX_CONTEXT_FLAG_FSP_CRITICAL_OVERFLOW_QUEUE = 0x00010000, - RX_CONTEXT_FLAG_MINIRDR_INVOKED = 0x00020000, - RX_CONTEXT_FLAG_WAITING_FOR_RESOURCE = 0x00040000, - RX_CONTEXT_FLAG_CANCELLED = 0x00080000, - RX_CONTEXT_FLAG_SYNC_EVENT_WAITERS = 0x00100000, - RX_CONTEXT_FLAG_NO_PREPOSTING_NEEDED = 0x00200000, - RX_CONTEXT_FLAG_BYPASS_VALIDOP_CHECK = 0x00400000, - RX_CONTEXT_FLAG_BLOCKED_PIPE_RESUME = 0x00800000, - RX_CONTEXT_FLAG_IN_SERIALIZATION_QUEUE = 0x01000000, - RX_CONTEXT_FLAG_NO_EXCEPTION_BREAKPOINT = 0x02000000, - RX_CONTEXT_FLAG_NEEDRECONNECT = 0x04000000, - RX_CONTEXT_FLAG_MUST_SUCCEED = 0x08000000, - RX_CONTEXT_FLAG_MUST_SUCCEED_NONBLOCKING = 0x10000000, - RX_CONTEXT_FLAG_MUST_SUCCEED_ALLOCATED = 0x20000000, - RX_CONTEXT_FLAG_MINIRDR_INITIATED = 0x80000000, -} RX_CONTEXT_FLAGS; - -#define RX_CONTEXT_PRESERVED_FLAGS (RX_CONTEXT_FLAG_FROM_POOL | \ - RX_CONTEXT_FLAG_MUST_SUCCEED_ALLOCATED | \ - RX_CONTEXT_FLAG_IN_FSP) - -#define RX_CONTEXT_INITIALIZATION_FLAGS (RX_CONTEXT_FLAG_WAIT | \ - RX_CONTEXT_FLAG_MUST_SUCCEED | \ - RX_CONTEXT_FLAG_MUST_SUCCEED_NONBLOCKING) - -typedef enum { - RX_CONTEXT_CREATE_FLAG_UNC_NAME = 0x1, - RX_CONTEXT_CREATE_FLAG_STRIPPED_TRAILING_BACKSLASH = 0x2, - RX_CONTEXT_CREATE_FLAG_ADDEDBACKSLASH = 0x4, - RX_CONTEXT_CREATE_FLAG_REPARSE = 0x8, - RX_CONTEXT_CREATE_FLAG_SPECIAL_PATH = 0x10, -} RX_CONTEXT_CREATE_FLAGS; - -typedef enum { - RXCONTEXT_FLAG4LOWIO_PIPE_OPERATION = 0x1, - RXCONTEXT_FLAG4LOWIO_PIPE_SYNC_OPERATION = 0x2, - RXCONTEXT_FLAG4LOWIO_READAHEAD = 0x4, - RXCONTEXT_FLAG4LOWIO_THIS_READ_ENLARGED = 0x8, - RXCONTEXT_FLAG4LOWIO_THIS_IO_BUFFERED = 0x10, - RXCONTEXT_FLAG4LOWIO_LOCK_FCB_RESOURCE_HELD = 0x20, - RXCONTEXT_FLAG4LOWIO_LOCK_WAS_QUEUED_IN_LOCKMANAGER = 0x40, - RXCONTEXT_FLAG4LOWIO_THIS_IO_FAST = 0x80, - RXCONTEXT_FLAG4LOWIO_LOCK_OPERATION_COMPLETED = 0x100, - RXCONTEXT_FLAG4LOWIO_LOCK_BUFFERED_ON_ENTRY = 0x200 - -#ifdef __cplusplus -} RX_CONTEXT_LOWIO_FLAGS; -#else // !__cplusplus -} RX_CONTEXT_CREATE_FLAGS; -#endif // __cplusplus - -// -// Macros used to control whether the wrapper breakpoints on an exception -// - -#if DBG -#define RxSaveAndSetExceptionNoBreakpointFlag( RXCONTEXT,OLDFLAG ) { \ - OLDFLAG = FlagOn( RxContext->Flags, RX_CONTEXT_FLAG_NO_EXCEPTION_BREAKPOINT );\ - SetFlag( RxContext->Flags, RX_CONTEXT_FLAG_NO_EXCEPTION_BREAKPOINT ); \ -} -#define RxRestoreExceptionNoBreakpointFlag( RXCONTEXT,OLDFLAG ) { \ - ClearFlag( RxContext->Flags, RX_CONTEXT_FLAG_NO_EXCEPTION_BREAKPOINT ); \ - SetFlag( RxContext->Flags, OLDFLAG ); \ -} -#else -#define RxSaveAndSetExceptionNoBreakpointFlag(RXCONTEXT,OLDFLAG) -#define RxRestoreExceptionNoBreakpointFlag(RXCONTEXT,OLDFLAG) -#endif - -// -// a macro used to ensure that a context hasn't been freed during a wait -// - -#if DBG -VOID -__RxItsTheSameContext( - __in PRX_CONTEXT RxContext, - __in ULONG CapturedRxContextSerialNumber, - __in ULONG Line, - __in PCSTR File - ); -#define RxItsTheSameContext() {__RxItsTheSameContext(RxContext,CapturedRxContextSerialNumber,__LINE__,__FILE__);} -#else -#define RxItsTheSameContext() {NOTHING;} -#endif - -extern NPAGED_LOOKASIDE_LIST RxContextLookasideList; - -// -// Macros used in the RDBSS to wrap mini rdr calldowns -// - -#define MINIRDR_CALL_THROUGH(STATUS,DISPATCH,FUNC,ARGLIST) \ - { \ - ASSERT(DISPATCH); \ - ASSERT( NodeType(DISPATCH) == RDBSS_NTC_MINIRDR_DISPATCH ); \ - if (DISPATCH->FUNC == NULL) { \ - STATUS = STATUS_NOT_IMPLEMENTED; \ - } else { \ - RxDbgTrace(0, Dbg, ("MiniRdr Calldown - %s\n",#FUNC)); \ - STATUS = DISPATCH->FUNC ARGLIST; \ - } \ - } - -#define MINIRDR_CALL(STATUS,CONTEXT,DISPATCH,FUNC,ARGLIST) \ - { \ - ASSERT(DISPATCH); \ - ASSERT( NodeType(DISPATCH) == RDBSS_NTC_MINIRDR_DISPATCH ); \ - if ( DISPATCH->FUNC == NULL) { \ - STATUS = STATUS_NOT_IMPLEMENTED; \ - } else { \ - if (!BooleanFlagOn((CONTEXT)->Flags,RX_CONTEXT_FLAG_CANCELLED)) { \ - RxDbgTrace(0, Dbg, ("MiniRdr Calldown - %s\n",#FUNC)); \ - RtlZeroMemory(&((CONTEXT)->MRxContext[0]), \ - sizeof((CONTEXT)->MRxContext)); \ - STATUS = DISPATCH->FUNC ARGLIST; \ - } else { \ - STATUS = STATUS_CANCELLED; \ - } \ - } \ - } - - -// -// VOID -// RxWaitSync ( -// IN PRX_CONTEXT RxContext -// ) -// - -#define RxWaitSync( RxContext ) \ - RxDbgTrace(+1, Dbg, ("RxWaitSync, RxContext = %08lx\n", (RxContext))); \ - (RxContext)->Flags |= RX_CONTEXT_FLAG_SYNC_EVENT_WAITERS; \ - KeWaitForSingleObject( &(RxContext)->SyncEvent, \ - Executive, KernelMode, FALSE, NULL ); \ - RxDbgTrace(-1, Dbg, ("RxWaitSync -> VOID\n", 0 )) - -// -// VOID -// RxSignalSynchronousWaiter ( -// IN PRX_CONTEXT RxContext -// ) -// - -#define RxSignalSynchronousWaiter( RxContext ) \ - (RxContext)->Flags &= ~RX_CONTEXT_FLAG_SYNC_EVENT_WAITERS; \ - KeSetEvent( &(RxContext)->SyncEvent, 0, FALSE ) - - -#define RxInsertContextInSerializationQueue( SerializationQueue, RxContext ) \ - (RxContext)->Flags |= RX_CONTEXT_FLAG_IN_SERIALIZATION_QUEUE; \ - InsertTailList( SerializationQueue, &((RxContext)->RxContextSerializationQLinks )) - -INLINE -PRX_CONTEXT -RxRemoveFirstContextFromSerializationQueue ( - PLIST_ENTRY SerializationQueue - ) -{ - if (IsListEmpty( SerializationQueue )) { - return NULL; - } else { - PRX_CONTEXT Context = (PRX_CONTEXT)(CONTAINING_RECORD( SerializationQueue->Flink, - RX_CONTEXT, - RxContextSerializationQLinks )); - - RemoveEntryList( SerializationQueue->Flink ); - - Context->RxContextSerializationQLinks.Flink = NULL; - Context->RxContextSerializationQLinks.Blink = NULL; - return Context; - } -} - -// -// The following macros provide a mechanism for doing an en masse transfer -// from one list onto another. This provides a powerful paradigm for dealing -// with DPC level processing of lists. -// - -#define RxTransferList( Destination, Source ) \ - if (IsListEmpty( (Source) )) { \ - InitializeListHead( (Destination) ); \ - } else { \ - *(Destination) = *(Source); \ - (Destination)->Flink->Blink = (Destination); \ - (Destination)->Blink->Flink = (Destination); \ - InitializeListHead( (Source) ); \ - } - -#define RxTransferListWithMutex( Destination, Source, Mutex ) \ - { \ - ExAcquireFastMutex( Mutex ); \ - RxTransferList( Destination, Source ); \ - ExReleaseFastMutex( Mutex ); \ - } - - -VOID -RxInitializeRxContexter ( - VOID - ); - -VOID -RxUninitializeRxContexter ( - VOID - ); - -NTSTATUS -RxCancelNotifyChangeDirectoryRequestsForVNetRoot ( - PV_NET_ROOT VNetRoot, - BOOLEAN ForceFilesClosed - ); - -VOID -RxCancelNotifyChangeDirectoryRequestsForFobx ( - PFOBX Fobx - ); - -NTSTATUS -NTAPI -RxSetMinirdrCancelRoutine ( - IN OUT PRX_CONTEXT RxContext, - IN PMRX_CALLDOWN MRxCancelRoutine - ); - -VOID -NTAPI -RxInitializeContext ( - IN PIRP Irp, - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN ULONG InitialContextFlags, - IN OUT PRX_CONTEXT RxContext - ); - -PRX_CONTEXT -NTAPI -RxCreateRxContext ( - IN PIRP Irp, - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN ULONG InitialContextFlags - ); - -VOID -NTAPI -RxPrepareContextForReuse ( - IN OUT PRX_CONTEXT RxContext - ); - -VOID -NTAPI -RxDereferenceAndDeleteRxContext_Real ( - IN PRX_CONTEXT RxContext - ); - -VOID -NTAPI -RxReinitializeContext ( - IN OUT PRX_CONTEXT RxContext - ); - -#if DBG -#define RxDereferenceAndDeleteRxContext(RXCONTEXT) { \ - RxDereferenceAndDeleteRxContext_Real((RXCONTEXT)); \ - (RXCONTEXT) = NULL; \ -} -#else -#define RxDereferenceAndDeleteRxContext(RXCONTEXT) { \ - RxDereferenceAndDeleteRxContext_Real((RXCONTEXT)); \ -} -#endif // - -extern FAST_MUTEX RxContextPerFileSerializationMutex; - -NTSTATUS -NTAPI -__RxSynchronizeBlockingOperations ( - IN OUT PRX_CONTEXT RxContext, - IN PFCB Fcb, - IN OUT PLIST_ENTRY BlockingIoQ, - IN BOOLEAN DropFcbLock - ); -#define RxSynchronizeBlockingOperationsAndDropFcbLock(RXCONTEXT,FCB,IOQUEUE) \ - __RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE,TRUE) -#define RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE) \ - __RxSynchronizeBlockingOperations(RXCONTEXT,FCB,IOQUEUE,FALSE) - -VOID -NTAPI -RxResumeBlockedOperations_Serially ( - IN OUT PRX_CONTEXT RxContext, - IN OUT PLIST_ENTRY BlockingIoQ - ); - -VOID -RxResumeBlockedOperations_ALL ( - IN OUT PRX_CONTEXT RxContext - ); - - -VOID -RxCancelBlockingOperation ( - IN OUT PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -VOID -RxRemoveOperationFromBlockingQueue ( - IN OUT PRX_CONTEXT RxContext - ); - -#endif // _RX_CONTEXT_STRUCT_DEFINED_ - - diff --git a/qt-correction-tool/pub/ddk/rxdata.h b/qt-correction-tool/pub/ddk/rxdata.h deleted file mode 100644 index e0c284e..0000000 --- a/qt-correction-tool/pub/ddk/rxdata.h +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - RxData.h - -Abstract: - - This module declares the global data used by the RDBSS file system. - -Author: -Revision History: - ---*/ - -#ifndef _RDBSSDATA_ -#define _RDBSSDATA_ - -// - -#ifndef MONOLITHIC_MINIRDR -extern PIO_WORKITEM RxIoWorkItem; -#endif - -extern RX_DISPATCHER RxDispatcher; -extern RX_WORK_QUEUE_DISPATCHER RxDispatcherWorkQueues; - -//this constants are the same as the versions in ntexapi.h -// but drivers are not supposed to import that! - -#define RX_PROCESSOR_ARCHITECTURE_INTEL 0 -#define RX_PROCESSOR_ARCHITECTURE_MIPS 1 -#define RX_PROCESSOR_ARCHITECTURE_ALPHA 2 -#define RX_PROCESSOR_ARCHITECTURE_PPC 3 -#define RX_PROCESSOR_ARCHITECTURE_UNKNOWN 0xffff - -// RX_CONTEXT serialization - -extern KMUTEX RxSerializationMutex; - -#define RxAcquireSerializationMutex() \ - KeWaitForSingleObject(&RxSerializationMutex,Executive,KernelMode,FALSE,NULL) - -#define RxReleaseSerializationMutex() \ - KeReleaseMutex(&RxSerializationMutex,FALSE) - -// -// The global fsd data record, and global large integer constants -// - -extern ULONG RxElapsedSecondsSinceStart; -extern NTSTATUS RxStubStatus; - -extern PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject; - -extern LARGE_INTEGER RxLargeZero; -extern LARGE_INTEGER RxMaxLarge; -extern LARGE_INTEGER Rx30Milliseconds; -extern LARGE_INTEGER RxOneSecond; -extern LARGE_INTEGER RxOneDay; -extern LARGE_INTEGER RxJanOne1980; -extern LARGE_INTEGER RxDecThirtyOne1979; - -// -// The status actually returned by the FsdDispatchStub.....usually not implemented -// - -extern NTSTATUS RxStubStatus; - -// -// The FCB for opens that refer to the device object directly or -// for file objects that reference nonFcbs (like treecons) -// - -extern FCB RxDeviceFCB; - - -#if 0 -// -// Define maximum number of parallel Reads or Writes that will be generated -// per one request. -// - -#define RDBSS_MAX_IO_RUNS_ON_STACK ((ULONG) 5) - -// -// Define the maximum number of delayed closes. -// - -#define RDBSS_MAX_DELAYED_CLOSES ((ULONG)16) - -extern ULONG RxMaxDelayedCloseCount; - -#endif //0 - -#if DBG - -// -// The following variables are used to keep track of the total amount -// of requests processed by the file system, and the number of requests -// that end up being processed by the Fsp thread. The first variable -// is incremented whenever an Irp context is created (which is always -// at the start of an Fsd entry point) and the second is incremented -// by read request. -// - -extern ULONG RxFsdEntryCount; -//extern ULONG RxFspEntryCount; -//extern ULONG RxIoCallDriverCount; -//extern ULONG RxTotalTicks[]; -extern ULONG RxIrpCodeCount[]; - - -#endif - - -// The list of active RxContexts being processed by the RDBSS - -extern LIST_ENTRY RxSrvCalldownList; -extern LIST_ENTRY RxActiveContexts; -__volatile extern LONG RxNumberOfActiveFcbs; - - -extern UNICODE_STRING s_PipeShareName; -extern UNICODE_STRING s_MailSlotShareName; -extern UNICODE_STRING s_MailSlotServerPrefix; -extern UNICODE_STRING s_IpcShareName; - -extern UNICODE_STRING s_PrimaryDomainName; - -// -// To allow NFS to run RDBSS on W2K, we now look up the kenel routine -// FsRtlTeardownPerStreamContexts dynamically at run time. -// This is the global variable that contains the function pointer or NULL -// if the routine could not be found (as on W2K. -// - -extern VOID (*RxTeardownPerStreamContexts)(IN PFSRTL_ADVANCED_FCB_HEADER AdvancedHeader); - -#endif // _RDBSSDATA_ - - diff --git a/qt-correction-tool/pub/ddk/rxexcept.h b/qt-correction-tool/pub/ddk/rxexcept.h deleted file mode 100644 index af5e071..0000000 --- a/qt-correction-tool/pub/ddk/rxexcept.h +++ /dev/null @@ -1,140 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - Except.h - -Abstract: - - This module prototypes the macros and routines used for exception handling. - -Author: -Revision History: - ---*/ - -#ifndef _EXCEPTION_STUFF_DEFINED_ -#define _EXCEPTION_STUFF_DEFINED_ - - -// -// The following two macro are used by the Fsd/Fsp exception handlers to -// process an exception. The first macro is the exception filter used in the -// Fsd/Fsp to decide if an exception should be handled at this level. -// The second macro decides if the exception is to be finished off by -// completing the IRP, and cleaning up the Irp Context, or if we should -// bugcheck. Exception values such as RxStatus(FILE_INVALID) (raised by -// VerfySup.c) cause us to complete the Irp and cleanup, while exceptions -// such as accvio cause us to bugcheck. -// -// The basic structure for fsd/fsp exception handling is as follows: -// -// RxFsdXxx(...) -// { -// try { -// -// ... -// -// } except(RxExceptionFilter( RxContext, GetExceptionCode() )) { -// -// Status = RxProcessException( RxContext, GetExceptionCode() ); -// } -// -// Return Status; -// } -// -// To explicitly raise an exception that we expect, such as -// RxStatus(FILE_INVALID), use the below macro RxRaiseStatus(). To raise a -// status from an unknown origin (such as CcFlushCache()), use the macro -// RxNormalizeAndRaiseStatus. This will raise the status if it is expected, -// or raise RxStatus(UNEXPECTED_IO_ERROR) if it is not. -// -// Note that when using these two macros, the original status is placed in -// RxContext->ExceptionStatus, signaling RxExceptionFilter and -// RxProcessException that the status we actually raise is by definition -// expected. -// - -LONG -RxExceptionFilter ( - IN PRX_CONTEXT RxContext, - IN PEXCEPTION_POINTERS ExceptionPointer - ); - -NTSTATUS -RxProcessException ( - IN PRX_CONTEXT RxContext, - IN NTSTATUS ExceptionCode - ); - -#define CATCH_EXPECTED_EXCEPTIONS (FsRtlIsNtstatusExpected(GetExceptionCode()) ? \ - EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH ) - - -// -// VOID -// RxRaiseStatus ( -// IN PRIP_CONTEXT RxContext, -// IN NT_STATUS Status -// ); -// -// - -#define RxRaiseStatus(RXCONTEXT,STATUS) { \ - ASSERT((RXCONTEXT)!=NULL); \ - if (RxContext!=NULL) {(RXCONTEXT)->StoredStatus = (STATUS); } \ - ExRaiseStatus( (STATUS) ); \ -} - -// -// VOID -// RxNormalAndRaiseStatus ( -// IN PRIP_CONTEXT RxContext, -// IN NT_STATUS Status -// ); -// - -#define RxNormalizeAndRaiseStatus(RXCONTEXT,STATUS) { \ - ASSERT((RXCONTEXT)!=NULL); \ - if (RxContext!=NULL) {(RXCONTEXT)->StoredStatus = (STATUS); } \ - if ((STATUS) == (STATUS_VERIFY_REQUIRED)) { ExRaiseStatus((STATUS)); } \ - ExRaiseStatus(FsRtlNormalizeNtstatus((STATUS),(STATUS_UNEXPECTED_IO_ERROR))); \ -} - - -// -// The following macros are used to establish the semantics needed -// to do a return from within a try-finally clause. As a rule every -// try clause must end with a label call try_exit. For example, -// -// try { -// : -// : -// -// try_exit: NOTHING; -// } finally { -// -// : -// : -// } -// -// Every return statement executed inside of a try clause should use the -// try_return macro. If the compiler fully supports the try-finally construct -// then the macro should be -// -// #define try_return(S) { return(S); } -// -// If the compiler does not support the try-finally construct then the macro -// should be -// -// #define try_return(S) { S; goto try_exit; } -// - -#define try_return(S) { S; goto try_exit; } - - - -#endif // _EXCEPTION_STUFF_DEFINED_ - diff --git a/qt-correction-tool/pub/ddk/rxlog.h b/qt-correction-tool/pub/ddk/rxlog.h deleted file mode 100644 index 87c964f..0000000 --- a/qt-correction-tool/pub/ddk/rxlog.h +++ /dev/null @@ -1,141 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - RxLog.h - -Abstract: - - This module declares the prototypes and global data used by the RDBSS debug logging facilities. - -Author: -Notes: - - The log records are stored in a circular buffer. Each record is bounded on either side by - a record descriptor. This record descriptor is four bytes long. - ---*/ - -#ifndef _RDBSSLOG_INCLUDED_ -#define _RDBSSLOG_INCLUDED_ - - -typedef enum { - RX_LOG_UNINITIALIZED, - RX_LOG_ENABLED, - RX_LOG_DISABLED, - RX_LOG_ERROR -} RX_LOGGING_STATE; - -typedef struct RX_LOG_ENTRY_HEADER { - PCHAR Buffer; -} RX_LOG_ENTRY_HEADER, *PRX_LOG_ENTRY_HEADER; - - -typedef struct RX_LOG { - RX_SPIN_LOCK SpinLock; - RX_LOGGING_STATE State; - PRX_LOG_ENTRY_HEADER CurrentEntry; - PRX_LOG_ENTRY_HEADER BaseEntry; - PRX_LOG_ENTRY_HEADER EntryLimit; - ULONG LogBufferSizeInEntries; - ULONG NumberOfEntriesIgnored; - ULONG NumberOfLogWriteAttempts; - ULONG NumberOfLogWraps; -} RX_LOG, *PRX_LOG; - - -//the logging facilities are always present. what RDBSSLOG does is to enable generation -//of the calls! on checked builds, you even get the calls unless NO_RDBSSLOG is set. - -//extern -//VOID -//RxLogInterlockedAddUlong( -// PULONG Result, -// PULONG Counter, -// ULONG Addend); - -extern -VOID -RxDebugControlCommand ( - __in PSTR ControlString - ); - -extern -NTSTATUS -RxInitializeLog(void); - -extern -VOID -RxUninitializeLog(void); - -extern -VOID -_RxPrintLog(IN ULONG EntriesToPrint OPTIONAL); - -extern -VOID -_RxPauseLog(void); - -extern -VOID -_RxResumeLog (void); - -extern -VOID -_RxLog(PCSTR format, ...); - - -#define MAX_RX_LOG_ENTRY_SIZE (48) - -#define RDBSSLOG_ASYNC_NAME_PREFIX "[nowait]" -#define RXCONTX_OPERATION_NAME(MajorFunction,Wait) \ - (RxContxOperationNames[(MajorFunction)]+((Wait)?(sizeof(RDBSSLOG_ASYNC_NAME_PREFIX)-1):0)) -extern PUCHAR RxContxOperationNames[]; - -#ifdef RDBSSLOG - - // -// The arguments to RxLog must be enclosed with an additional pair of parenthesis to enable -// transalation into a null call when logging should be turned off. -// e.g. RxLog(("%s %d", FILE, LINE)) -#if DBG -#define RxLog(Args) _RxLog##Args -#define RxLogRetail(Args) _RxLog##Args -#else -#define RxLogRetail(Args) _RxLog##Args -#define RxLog(Args) {NOTHING;} -#endif - -#define RxPauseLog() _RxPauseLog() -#define RxResumeLog() _RxResumeLog() - -#else //if notdef RDBSSLOG - -#define RxLog(Args) {NOTHING;} -#define RxLogRetail(Args) {NOTHING;} -#define RxPauseLog() {NOTHING;} -#define RxResumeLog() {NOTHING;} - -#endif - -#if DBG -#define RxDbgPrint(Args) DbgPrint##Args -#else -#define RxDbgPrint(Args) NOTHING -#endif - -extern LIST_ENTRY RxIrpsList; -extern KSPIN_LOCK RxIrpsListSpinLock; - -typedef struct _RX_IRP_LIST_ITEM { - LIST_ENTRY IrpsList; - PIRP pIrp; - PMDL CopyDataBuffer; - ULONG Completed; -} RX_IRP_LIST_ITEM, *PRX_IRP_LIST_ITEM; - -#endif // _RDBSSLOG_INCLUDED_ - diff --git a/qt-correction-tool/pub/ddk/rxovride.h b/qt-correction-tool/pub/ddk/rxovride.h deleted file mode 100644 index bf7587c..0000000 --- a/qt-correction-tool/pub/ddk/rxovride.h +++ /dev/null @@ -1,73 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - rxovride.h - -Abstract: - - This file has two purposes. First, things that are absolutely global are included here; a macro - NO_RXOVRIDE_GLOBAL maybe defined to get only the second behaviour. - - Second, this file is used as a shortterm expedient to ensure that the logging version of the wrapper, - smbmini and rdr2kd is built irrespective of the build environment. indeed, all of the debugging issues - can be enabled disabled from here instead of juggling all of the sources files. to override what it says - in this file...define RX_BUILD_FREE_ANYWAY. - -Author: -Revision History: - -Notes: - - - ---*/ -#ifndef NO_RXOVRIDE_GLOBAL - -// define pointer types for all of the important structures.......... -#include // RDBSS related definitions - -#endif //ifndef NO_RXOVRIDE_GLOBAL - - -//control the debugging state of the built components -#define RDBSS_TRACKER 1 - -#if !DBG -#define RX_ORIGINAL_DBG 0 -#else -#define RX_ORIGINAL_DBG 1 -#endif - -#if 0 -#ifndef RDBSSTRACE -#define RDBSSTRACE 1 -#endif //ifndef RDBSSTRACE -#endif - -#ifndef RX_POOL_WRAPPER -#define RX_POOL_WRAPPER 1 -#endif //ifndef RX_POOL_WRAPPER - -#ifndef RDBSS_ASSERTS -#define RDBSS_ASSERTS 1 -#endif //ifndef RDBSS_ASSERTS - -#if DBG - -#ifndef RDBSSLOG -#define RDBSSLOG 1 -#endif //ifndef RDBSSLOG - -#else // DBG - -#if PRERELEASE -#ifndef RDBSSLOG -#define RDBSSLOG 1 -#endif //ifndef RDBSSLOG -#endif // if PRERELEASE - -#endif // if DBG - diff --git a/qt-correction-tool/pub/ddk/rxprocs.h b/qt-correction-tool/pub/ddk/rxprocs.h deleted file mode 100644 index 32f15fa..0000000 --- a/qt-correction-tool/pub/ddk/rxprocs.h +++ /dev/null @@ -1,1541 +0,0 @@ - -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - RxProcs.h - -Abstract: - - This module defines all of the globally used procedures in the RDBSS - file system. - -Author: -Revision History: - ---*/ - -#ifndef _RDBSSPROCS_ -#define _RDBSSPROCS_ - -#include "rx.h" -#include "backpack.h" -#include "RxTypes.h" -#include "RxLog.h" -#include "RxTrace.h" -#include "RxTimer.h" -#include "RxStruc.h" - -extern PVOID RxNull; - -// -// The following macro is for all people who compile with the DBG switch -// set, not just rdbss dbg users -// - -#if DBG - -#define DbgDoit(X) {X;} -#define DebugDoit(X) {X;} -#define DEBUG_ONLY_DECL(X) X - -#else - -#define DbgDoit(X) {NOTHING;} -#define DebugDoit(X) {NOTHING;} -#define DEBUG_ONLY_DECL(X) - -#endif // DBG - - -// -// utilities -// - - -// -// Routines for writing error log entries. -// - -/*++ - - RxLogFailure, RxLogFailureWithBuffer can be used to record an event in - the log. The RxLogFailure, RxLogFailureWithBuffer captures the line - number alongwith the supplied information and writes it to the log. This - is useful in debugging. RxLogFailureDirect, RxLogBufferDirect do not - capture the line number - - RxlogEvent is useful for writing events into the log. - ---*/ -#define RxLogFailure( _DeviceObject, _OriginatorId, _EventId, _Status ) \ - RxLogEventDirect( _DeviceObject, _OriginatorId, _EventId, _Status, __LINE__ ) - -#define RxLogFailureWithBuffer( _DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length ) \ - RxLogEventWithBufferDirect( _DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length, __LINE__ ) - -#define RxLogEvent( _DeviceObject, _OriginatorId, _EventId, _Status) \ - RxLogEventDirect(_DeviceObject, _OriginatorId, _EventId, _Status, __LINE__) - -VOID -RxLogEventDirect ( - IN PRDBSS_DEVICE_OBJECT DeviceObject, - IN PUNICODE_STRING OriginatorId, - IN ULONG EventId, - IN NTSTATUS Status, - IN ULONG Line - ); - -VOID -RxLogEventWithBufferDirect ( - IN PVOID DeviceOrDriverObject, - IN PUNICODE_STRING OriginatorId, - IN ULONG EventId, - IN NTSTATUS Status, - IN PVOID DataBuffer, - IN USHORT DataBufferLength, - IN ULONG LineNumber - ); - -VOID -RxLogEventWithAnnotation ( - IN PRDBSS_DEVICE_OBJECT DeviceObject, - IN ULONG EventId, - IN NTSTATUS Status, - IN PVOID DataBuffer, - IN USHORT DataBufferLength, - IN PUNICODE_STRING Annotation, - IN ULONG AnnotationCount - ); - -BOOLEAN -RxCcLogError ( - IN PDEVICE_OBJECT DeviceObject, - IN PUNICODE_STRING FileName, - IN NTSTATUS Error, - IN NTSTATUS DeviceError, - IN UCHAR IrpMajorCode, - IN PVOID Context - ); - -// -// in create.c -// - -NTSTATUS -RxPrefixClaim ( - IN PRX_CONTEXT RxContext - ); - -VOID -RxpPrepareCreateContextForReuse ( - PRX_CONTEXT RxContext - ); - -// -// in devfcb.c -// - -LUID -RxGetUid ( - IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext - ); - -ULONG -RxGetSessionId ( - IN PIO_STACK_LOCATION IrpSp - ); - -NTSTATUS -RxFindOrCreateConnections ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PUNICODE_STRING CanonicalName, - IN NET_ROOT_TYPE NetRootType, - IN BOOLEAN TreeConnect, - OUT PUNICODE_STRING LocalNetRootName, - OUT PUNICODE_STRING FilePathName, - IN OUT PLOCK_HOLDING_STATE LockHoldingState, - IN PRX_CONNECTION_ID RxConnectionId - ); - -NTSTATUS -RxFindOrCreateVNetRoot ( - PRX_CONTEXT RxContext, - PUNICODE_STRING CanonicalName, - NET_ROOT_TYPE NetRootType, - PV_NET_ROOT *VirtualNetRootPointer, - PLOCK_HOLDING_STATE *LockHoldingState - ); - -// -// in fileinfo.c -// - -typedef enum _RX_NAME_CONJURING_METHODS { - VNetRoot_As_Prefix, - VNetRoot_As_UNC_Name, - VNetRoot_As_DriveLetter -} RX_NAME_CONJURING_METHODS; - - -VOID -RxConjureOriginalName ( - __inout PFCB Fcb, - __inout PFOBX Fobx, - __out PULONG ActualNameLength, - __out_bcount( *LengthRemaining) PWCHAR OriginalName, - __inout PLONG LengthRemaining, - __in RX_NAME_CONJURING_METHODS NameConjuringMethod - ); - -// -// A function that returns finished denotes if it was able to complete the -// operation (TRUE) or could not complete the operation (FALSE) because the -// wait value stored in the irp context was false and we would have had -// to block for a resource or I/O -// - -// -// Buffer control routines for data caching, implemented in CacheSup.c -// - -BOOLEAN -RxZeroData ( - IN PRX_CONTEXT RxContext, - IN PVCB Vcb, - IN PFILE_OBJECT FileObject, - IN ULONG StartingZero, - IN ULONG ByteCount - ); - -NTSTATUS -RxCompleteMdl ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - - -VOID -RxSyncUninitializeCacheMap ( - IN PRX_CONTEXT RxContext, - IN PFILE_OBJECT FileObject - ); - -VOID -RxLockUserBuffer ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN LOCK_OPERATION Operation, - IN ULONG BufferLength - ); - -PVOID -RxMapSystemBuffer ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -PVOID -RxMapUserBuffer ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -#define RxUpcaseEaName(RXCONTEXT,NAME,UPCASEDNAME) \ - RtlUpperString( UPCASEDNAME, NAME ) - - -#ifdef RDBSS_TRACKER -#define RX_FCBTRACKER_PARAMS ,ULONG LineNumber,PSZ FileName,ULONG SerialNumber -#else -#define RX_FCBTRACKER_PARAMS -#endif - -#define FCB_MODE_EXCLUSIVE (1) -#define FCB_MODE_SHARED (2) -#define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE (3) -#define FCB_MODE_SHARED_STARVE_EXCLUSIVE (4) - -#define CHANGE_BUFFERING_STATE_CONTEXT ((PRX_CONTEXT)IntToPtr(0xffffffff)) -#define CHANGE_BUFFERING_STATE_CONTEXT_WAIT ((PRX_CONTEXT)IntToPtr(0xfffffffe)) - -// -// NOTE: even though the following routine pass a serial number, this parameter is not used -// - -NTSTATUS -__RxAcquireFcb( - __inout PFCB Fcb, - __inout_opt PRX_CONTEXT RxContext OPTIONAL, - __in ULONG Mode - -#ifdef RDBSS_TRACKER - , - __in ULONG LineNumber, - __in PCSTR FileName, - __in ULONG SerialNumber -#endif - - ); - - -#ifdef RDBSS_TRACKER -#define RxAcquireExclusiveFcb(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_EXCLUSIVE,__LINE__,__FILE__,0) -#else -#define RxAcquireExclusiveFcb(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_EXCLUSIVE) -#endif - -#define RX_GET_MRX_FCB(FCB) ((PMRX_FCB)((FCB))) - -#ifdef RDBSS_TRACKER -#define RxAcquireSharedFcb(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED,__LINE__,__FILE__,0) -#else -#define RxAcquireSharedFcb(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED) -#endif - -#ifdef RDBSS_TRACKER -#define RxAcquireSharedFcbWaitForEx(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE,__LINE__,__FILE__,0) -#else -#define RxAcquireSharedFcbWaitForEx(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE) -#endif - -#ifdef RDBSS_TRACKER -#define RxAcquireSharedFcbStarveEx(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_STARVE_EXCLUSIVE,__LINE__,__FILE__,0) -#else -#define RxAcquireSharedFcbStarveEx(RXCONTEXT,FCB) \ - __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_STARVE_EXCLUSIVE) -#endif - -VOID -__RxReleaseFcb( - __inout_opt PRX_CONTEXT RxContext, - __inout PMRX_FCB MrxFcb - -#ifdef RDBSS_TRACKER - , - __in ULONG LineNumber, - __in PCSTR FileName, - __in ULONG SerialNumber -#endif - - ); - -#ifdef RDBSS_TRACKER -#define RxReleaseFcb(RXCONTEXT,FCB) \ - __RxReleaseFcb((RXCONTEXT),RX_GET_MRX_FCB(FCB),__LINE__,__FILE__,0) -#else -#define RxReleaseFcb(RXCONTEXT,FCB) \ - __RxReleaseFcb((RXCONTEXT),RX_GET_MRX_FCB(FCB)) -#endif - - -VOID -__RxReleaseFcbForThread( - __inout_opt PRX_CONTEXT RxContext, - __inout PMRX_FCB MrxFcb, - __in ERESOURCE_THREAD ResourceThreadId - -#ifdef RDBSS_TRACKER - , - __in ULONG LineNumber, - __in PCSTR FileName, - __in ULONG SerialNumber -#endif - - ); - -#ifdef RDBSS_TRACKER -#define RxReleaseFcbForThread(RXCONTEXT,FCB,THREAD) \ - __RxReleaseFcbForThread((RXCONTEXT),RX_GET_MRX_FCB(FCB),(THREAD),__LINE__,__FILE__,0) -#else -#define RxReleaseFcbForThread(RXCONTEXT,FCB,THREAD) \ - __RxReleaseFcbForThread((RXCONTEXT),RX_GET_MRX_FCB(FCB),(THREAD)) -#endif - - -#ifdef RDBSS_TRACKER -VOID RxTrackerUpdateHistory ( - __inout_opt PRX_CONTEXT RxContext, - __inout PMRX_FCB MrxFcb, - __in ULONG Operation, - __in ULONG LineNumber, - __in PCSTR FileName, - __in ULONG SerialNumber - ); -#else -#define RxTrackerUpdateHistory(xRXCONTEXT,xFCB,xOPERATION,xLINENUM,xFILENAME,xSERIALNUMBER) {NOTHING;} -#endif - -VOID -RxTrackPagingIoResource ( - __inout PVOID Instance, - __in ULONG Type, - __in ULONG Line, - __in PCSTR File - ); - -// -// this definition is old......i don't like the format -// - -#define RxFcbAcquiredShared( RXCONTEXT, FCB ) ( \ - ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) \ -) - -#define RxIsFcbAcquiredShared( FCB ) ( \ - ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) \ -) - -#define RxIsFcbAcquiredExclusive( FCB ) ( \ - ExIsResourceAcquiredExclusiveLite( (FCB)->Header.Resource ) \ -) - -#define RxIsFcbAcquired( FCB) ( \ - ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) | \ - ExIsResourceAcquiredExclusiveLite( (FCB)->Header.Resource ) \ -) - -#define RxAcquirePagingIoResource( RXCONTEXT, FCB ) \ - ExAcquireResourceExclusiveLite( (FCB)->Header.PagingIoResource, TRUE ); \ - if (RXCONTEXT) { \ - ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = TRUE; \ - } \ - RxTrackPagingIoResource( FCB, 1, __LINE__, __FILE__ ) \ - -#define RxAcquirePagingIoResourceShared( RXCONTEXT, FCB, FLAG ) \ - ExAcquireResourceSharedLite( (FCB)->Header.PagingIoResource, FLAG ); \ - if (AcquiredFile) { \ - if (RXCONTEXT) { \ - ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = TRUE; \ - } \ - RxTrackPagingIoResource( FCB, 2, __LINE__, __FILE__ ); \ - } - -#define RxReleasePagingIoResource( RXCONTEXT, FCB ) \ - RxTrackPagingIoResource( FCB, 3, __LINE__, __FILE__ ); \ - if (RXCONTEXT) { \ - ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = FALSE; \ - } \ - ExReleaseResourceLite( (FCB)->Header.PagingIoResource ) - -#define RxReleasePagingIoResourceForThread( RXCONTEXT, FCB, THREAD ) \ - RxTrackPagingIoResource( FCB, 3, __LINE__, __FILE__ ); \ - if (RXCONTEXT) { \ - ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = FALSE; \ - } \ - ExReleaseResourceForThreadLite( (FCB)->Header.PagingIoResource, (THREAD) ) - - -// The following are cache manager call backs - -BOOLEAN -RxAcquireFcbForLazyWrite ( - IN PVOID Null, - IN BOOLEAN Wait - ); - -VOID -RxReleaseFcbFromLazyWrite ( - IN PVOID Null - ); - -BOOLEAN -RxAcquireFcbForReadAhead ( - IN PVOID Null, - IN BOOLEAN Wait - ); - -VOID -RxReleaseFcbFromReadAhead ( - IN PVOID Null - ); - -BOOLEAN -RxNoOpAcquire ( - IN PVOID Fcb, - IN BOOLEAN Wait - ); - -VOID -RxNoOpRelease ( - IN PVOID Fcb - ); - -NTSTATUS -RxAcquireForCcFlush ( - IN PFILE_OBJECT FileObject, - IN PDEVICE_OBJECT DeviceObject - ); - -NTSTATUS -RxReleaseForCcFlush ( - IN PFILE_OBJECT FileObject, - IN PDEVICE_OBJECT DeviceObject - ); - -// -// VOID -// RxConvertToSharedFcb ( -// IN PRX_CONTEXT RxContext, -// IN PFCB Fcb -// ); -// - -#define RxConvertToSharedFcb(RXCONTEXT,FCB) { \ - ExConvertExclusiveToSharedLite( RX_GET_MRX_FCB(FCB)->Header.Resource ); \ - } - -VOID -RxVerifyOperationIsLegal ( - IN PRX_CONTEXT RxContext - ); - -// -// Work queue routines for posting and retrieving an Irp, implemented in -// workque.c -// - -VOID -RxPrePostIrp ( - IN PVOID Context, - IN PIRP Irp - ); - -VOID -RxAddToWorkque ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -NTSTATUS -RxFsdPostRequest ( - IN PRX_CONTEXT RxContext - ); - -#define RxFsdPostRequestWithResume(RXCONTEXT,RESUMEROUTINE) \ - (((RXCONTEXT)->ResumeRoutine = (RESUMEROUTINE)), \ - RxFsdPostRequest( (RXCONTEXT) ) \ - ) - -VOID -RxInitializeMRxCalldownContext ( - PMRX_CALLDOWN_CONTEXT Context, - PRDBSS_DEVICE_OBJECT MRxDeviceObject, - PMRX_CALLDOWN_ROUTINE Routine, - PVOID Parameter - ); - -NTSTATUS -RxCalldownMiniRedirectors ( - LONG NumberOfMiniRdrs, - PMRX_CALLDOWN_CONTEXT CalldownContext, - BOOLEAN PostCalldowns - ); - -// -// This macro takes a ulong and returns its rounded up word value -// - -#define WordAlign(Val) ( \ - ALIGN_UP( Val, WORD ) \ - ) - -// -// This macro takes a pointer and returns a ULONG_PTR representation of -// its rounded up word value -// - -#define WordAlignPtr(Ptr) ( \ - ALIGN_UP_POINTER( Ptr, WORD ) \ - ) - -// -// This macro takes a ulong and returns its rounded up longword value -// - -#define LongAlign(Val) ( \ - ALIGN_UP( Val, LONG ) \ - ) - -// -// This macro takes a pointer and returns a ULONG_PTR representation of -// its rounded up word value -// - -#define LongAlignPtr(Ptr) ( \ - ALIGN_UP_POINTER( Ptr, LONG ) \ - ) - -// -// This macro takes a ulong and returns its rounded up quadword -// value -// - -#define QuadAlign(Val) ( \ - ALIGN_UP( Val, ULONGLONG ) \ - ) - -// -// This macro takes a pointer and returns a ULONG_PTR representation of -// its rounded up quadword value -// - -#define QuadAlignPtr(Ptr) ( \ - ALIGN_UP_POINTER( Ptr, ULONGLONG ) \ - ) - -// -// This macro takes a pointer and returns whether it's quadword-aligned -// - -#define IsPtrQuadAligned(Ptr) ( \ - QuadAlignPtr(Ptr) == (PVOID)(Ptr) \ - ) - -// -// The following types and macros are used to help unpack the packed and -// misaligned fields found in the Bios parameter block -// - -typedef union _UCHAR1 { - UCHAR Uchar[1]; - UCHAR ForceAlignment; -} UCHAR1, *PUCHAR1; - -typedef union _UCHAR2 { - UCHAR Uchar[2]; - USHORT ForceAlignment; -} UCHAR2, *PUCHAR2; - -typedef union _UCHAR4 { - UCHAR Uchar[4]; - ULONG ForceAlignment; -} UCHAR4, *PUCHAR4; - -// -// This macro copies an unaligned src byte to an aligned dst byte -// - -#define CopyUchar1(Dst,Src) { \ - *((UCHAR1 *)(Dst)) = *((UNALIGNED UCHAR1 *)(Src)); \ - } - -// -// This macro copies an unaligned src word to an aligned dst word -// - -#define CopyUchar2(Dst,Src) { \ - *((UCHAR2 *)(Dst)) = *((UNALIGNED UCHAR2 *)(Src)); \ - } - -// -// This macro copies an unaligned src longword to an aligned dsr longword -// - -#define CopyUchar4(Dst,Src) { \ - *((UCHAR4 *)(Dst)) = *((UNALIGNED UCHAR4 *)(Src)); \ - } - -#define CopyU4char(Dst,Src) { \ - *((UNALIGNED UCHAR4 *)(Dst)) = *((UCHAR4 *)(Src)); \ - } - -// -// the wrapper doesn't yet implement notify and oplock. rather than remove the code -// we define the calls in such a way as to Noop the effects so that we'll have a head -// start on putting it back later... -// - - -/* this is a macro definition we'll reenable when we implement oplocks and notifies -// -// VOID -// RxNotifyReportChange ( -// IN PRX_CONTEXT RxContext, -// IN PVCB Vcb, -// IN PFCB Fcb, -// IN ULONG Filter, -// IN ULONG Action -// ); -// - -#define RxNotifyReportChange(I,V,F,FL,A) { \ - if ((F)->FullFileName.Buffer == NULL) { \ - RxSetFullFileNameInFcb((I),(F)); \ - } \ - FsRtlNotifyFullReportChange( (V)->NotifySync, \ - &(V)->DirNotifyList, \ - (PSTRING)&(F)->FullFileName, \ - (USHORT) ((F)->FullFileName.Length - \ - (F)->FinalNameLength), \ - (PSTRING)NULL, \ - (PSTRING)NULL, \ - (ULONG)FL, \ - (ULONG)A, \ - (PVOID)NULL ); \ -} -*/ -#define RxNotifyReportChange(I,V,F,FL,A) \ - RxDbgTrace(0, Dbg, ("RxNotifyReportChange PRETENDING Fcb %08lx %wZ Filter/Action = %08lx/%08lx\n", \ - (F),&((F)->FcbTableEntry.Path),(FL),(A))) - -#if 0 -#define FsRtlNotifyFullChangeDirectory(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) \ - RxDbgTrace(0, Dbg, ("FsRtlNotifyFullReportChange PRETENDING ............\n",0)) -#endif - -#define FsRtlCheckOplock(A1,A2,A3,A4,A5) \ - (STATUS_SUCCESS) - -#define FsRtlOplockIsFastIoPossible(__a) (TRUE) - -// -// The following procedure is used by the FSP and FSD routines to complete -// an IRP. -// -// Note that this macro allows either the Irp or the RxContext to be -// null, however the only legal order to do this in is: -// -// RxCompleteRequest_OLD( NULL, Irp, Status ); // completes Irp & preserves context -// ... -// RxCompleteRequest_OLD( RxContext, NULL, DontCare ); // deallocates context -// -// This would typically be done in order to pass a "naked" RxContext off to -// the Fsp for post processing, such as read ahead. -// -// The new way is to pass just the RxContext.......... -// - -VOID -RxCompleteRequest_Real ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN NTSTATUS Status - ); - -#if DBG -#define RxCompleteRequest_OLD(RXCONTEXT,IRP,STATUS) { \ - RxCompleteRequest_Real( RXCONTEXT, IRP, STATUS); \ - (IRP) = NULL; \ - (RXCONTEXT) = NULL; \ -} -#else -#define RxCompleteRequest_OLD(RXCONTEXT,IRP,STATUS ) { \ - RxCompleteRequest_Real( RXCONTEXT, IRP, STATUS ); \ -} -#endif - -NTSTATUS -RxCompleteRequest( - PRX_CONTEXT pContext, - NTSTATUS Status); - -#define RxCompleteAsynchronousRequest(RXCONTEXT,STATUS) \ - RxCompleteRequest(RXCONTEXT,STATUS) - -#define RxCompleteContextAndReturn(STATUS) { \ - NTSTATUS __sss = (STATUS); \ - RxCompleteRequest(RxContext,__sss); \ - return(__sss);} -#define RxCompleteContext(STATUS) { \ - NTSTATUS __sss = (STATUS); \ - RxCompleteRequest(RxContext,__sss);} \ - -// -// The Following routine makes a popup -// - -VOID -RxPopUpFileCorrupt ( - IN PRX_CONTEXT RxContext, - IN PFCB Fcb - ); - -NTSTATUS -RxConstructSrvCall ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PSRV_CALL SrvCall, - OUT PLOCK_HOLDING_STATE LockHoldingState - ); - -NTSTATUS -RxSetSrvCallDomainName ( - IN PMRX_SRV_CALL SrvCall, - IN PUNICODE_STRING DomainName - ); - -NTSTATUS -RxConstructNetRoot ( - IN PRX_CONTEXT RxContext, - IN PSRV_CALL SrvCall, - IN PNET_ROOT NetRoot, - IN PV_NET_ROOT VirtualNetRoot, - OUT PLOCK_HOLDING_STATE LockHoldingState - ); - -NTSTATUS -RxConstructVirtualNetRoot ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PUNICODE_STRING CanonicalName, - IN NET_ROOT_TYPE NetRootType, - IN BOOLEAN TreeConnect, - OUT PV_NET_ROOT *VirtualNetRootPointer, - OUT PLOCK_HOLDING_STATE LockHoldingState, - OUT PRX_CONNECTION_ID RxConnectionId - ); - -NTSTATUS -RxFindOrConstructVirtualNetRoot ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PUNICODE_STRING CanonicalName, - IN NET_ROOT_TYPE NetRootType, - IN PUNICODE_STRING RemainingName - ); - -NTSTATUS -RxLowIoFsCtlShell ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PFCB Fcb, - IN PFOBX Fobx - ); - -NTSTATUS -RxLowIoFsCtlShellCompletion ( - IN PRX_CONTEXT RxContext - ); - - -NTSTATUS -RxLowIoLockControlShell ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PFCB Fcb - ); - -NTSTATUS -RxShadowLowIo ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp, - IN PFCB Fcb - ); - -NTSTATUS -RxShadowFastLowIo ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -NTSTATUS -RxChangeBufferingState ( - PSRV_OPEN SrvOpen, - PVOID Context, - BOOLEAN ComputeNewState - ); - -VOID -RxAssociateSrvOpenKey ( - PMRX_SRV_OPEN MRxSrvOpen, - PVOID SrvOpenKey - ); - -VOID -RxIndicateChangeOfBufferingState ( - PMRX_SRV_CALL SrvCall, - PVOID SrvOpenKey, - PVOID Context - ); - -VOID -RxIndicateChangeOfBufferingStateForSrvOpen ( - PMRX_SRV_CALL SrvCall, - PMRX_SRV_OPEN SrvOpen, - PVOID SrvOpenKey, - PVOID Context - ); - -NTSTATUS -RxPrepareToReparseSymbolicLink ( - PRX_CONTEXT RxContext, - BOOLEAN SymbolicLinkEmbeddedInOldPath, - PUNICODE_STRING NewPath, - BOOLEAN NewPathIsAbsolute, - PBOOLEAN ReparseRequired - ); - -BOOLEAN -RxLockEnumerator ( - IN OUT PMRX_SRV_OPEN SrvOpen, - IN OUT PVOID *ContinuationHandle, - OUT PLARGE_INTEGER FileOffset, - OUT PLARGE_INTEGER LockRange, - OUT PBOOLEAN IsLockExclusive - ); - -// -// Routines for transitioning data structures to stable states. -// - -VOID -RxReference ( - IN OUT PVOID Instance - ); - -VOID -RxDereference ( - IN OUT PVOID Instance, - IN LOCK_HOLDING_STATE LockHoldingState - ); - -VOID -RxWaitForStableCondition ( - IN PRX_BLOCK_CONDITION Condition, - IN OUT PLIST_ENTRY TransitionWaitList, - IN OUT PRX_CONTEXT RxContext, - OUT NTSTATUS *AsyncStatus OPTIONAL - ); - -VOID -RxUpdateCondition ( - IN RX_BLOCK_CONDITION NewConditionValue, - OUT PRX_BLOCK_CONDITION Condition, - IN OUT PLIST_ENTRY TransitionWaitList - ); - -VOID -RxFinalizeNetTable ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN BOOLEAN ForceFinalization - ); - -#define RxForceNetTableFinalization(RxDeviceObject) RxFinalizeNetTable( RxDeviceObject, TRUE ) - -NTSTATUS -RxCloseAssociatedSrvOpen ( - IN PRX_CONTEXT RxContext OPTIONAL, - IN PFOBX Fobx - ); - -NTSTATUS -RxFinalizeConnection ( - IN OUT PNET_ROOT NetRoot, - IN OUT PV_NET_ROOT VNetRoot OPTIONAL, - IN LOGICAL ForceFilesClosed - ); - -// -// routines for manipulating the user's view and the server's view of SHARE_ACCESS. -// the user's view is supported by routines exported by Io...the wrappers just allow -// us to get a msg. the server's view is supported by routines that are essential just -// copies of the Io routines EXCEPT that the Io routines work directly on fileobjects and -// as such cannot be used directly. the routines mentioned are implemented in create.c -// - -#if DBG -VOID -RxDumpWantedAccess ( - PSZ where1, - PSZ where2, - PSZ wherelogtag, - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess - ); - -VOID -RxDumpCurrentAccess ( - PSZ where1, - PSZ where2, - PSZ wherelogtag, - PSHARE_ACCESS ShareAccess - ); - -#else -#define RxDumpWantedAccess(w1,w2,wlt,DA,DSA) {NOTHING;} -#define RxDumpCurrentAccess(w1,w2,wlt,SA) {NOTHING;} -#endif - -NTSTATUS -RxCheckShareAccessPerSrvOpens ( - IN PFCB Fcb, - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess - ); - - -VOID -RxUpdateShareAccessPerSrvOpens ( - IN PSRV_OPEN SrvOpen - ); - -VOID -RxRemoveShareAccessPerSrvOpens ( - IN OUT PSRV_OPEN SrvOpen - ); - -VOID -RxRemoveShareAccessPerSrvOpens ( - IN OUT PSRV_OPEN SrvOpen - ); - - -#if DBG -NTSTATUS -RxCheckShareAccess ( - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess, - IN OUT PFILE_OBJECT FileObject, - IN OUT PSHARE_ACCESS ShareAccess, - IN BOOLEAN Update, - IN PSZ where, - IN PSZ wherelogtag - ); - -VOID -RxRemoveShareAccess ( - IN PFILE_OBJECT FileObject, - IN OUT PSHARE_ACCESS ShareAccess, - IN PSZ where, - IN PSZ wherelogtag - ); - -VOID -RxSetShareAccess ( - IN ACCESS_MASK DesiredAccess, - IN ULONG DesiredShareAccess, - IN OUT PFILE_OBJECT FileObject, - OUT PSHARE_ACCESS ShareAccess, - IN PSZ where, - IN PSZ wherelogtag - ); - -VOID -RxUpdateShareAccess ( - IN PFILE_OBJECT FileObject, - IN OUT PSHARE_ACCESS ShareAccess, - IN PSZ where, - IN PSZ wherelogtag - ); -#else -#define RxCheckShareAccess(a1,a2,a3,a4,a5,a6,a7) \ - IoCheckShareAccess(a1,a2,a3,a4,a5) - -#define RxRemoveShareAccess(a1,a2,a3,a4) \ - IoRemoveShareAccess(a1,a2) - -#define RxSetShareAccess(a1,a2,a3,a4,a5,a6) \ - IoSetShareAccess(a1,a2,a3,a4) - -#define RxUpdateShareAccess(a1,a2,a3,a4) \ - IoUpdateShareAccess(a1,a2) -#endif - -// -// LoadUnload -// - -NTSTATUS -RxDriverEntry ( - IN PDRIVER_OBJECT DriverObject, - IN PUNICODE_STRING RegistryPath - ); - -VOID -RxUnload ( - IN PDRIVER_OBJECT DriverObject - ); - -// -// minirdr support -// - -VOID -RxInitializeMinirdrDispatchTable ( - IN PDRIVER_OBJECT DriverObject - ); - -ULONG -RxGetNetworkProviderPriority( - PUNICODE_STRING DeviceName - ); - -VOID -RxExtractServerName( - IN PUNICODE_STRING FilePathName, - OUT PUNICODE_STRING SrvCallName, - OUT PUNICODE_STRING RestOfName - ); - -VOID -RxCreateNetRootCallBack ( - IN PMRX_CREATENETROOT_CONTEXT CreateNetRootContext - ); - -NTSTATUS -DuplicateTransportAddress ( - PTRANSPORT_ADDRESS *Copy, - PTRANSPORT_ADDRESS Original, - POOL_TYPE PoolType); - -NTSTATUS -RxCepInitializeVC ( - PRXCE_VC Vc, - PRXCE_CONNECTION Connection - ); - -NTSTATUS -DuplicateConnectionInformation ( - PRXCE_CONNECTION_INFORMATION *Copy, - PRXCE_CONNECTION_INFORMATION Original, - POOL_TYPE PoolType - ); - -NTSTATUS -RxCepInitializeConnection ( - IN OUT PRXCE_CONNECTION Connection, - IN PRXCE_ADDRESS Address, - IN PRXCE_CONNECTION_INFORMATION ConnectionInformation, - IN PRXCE_CONNECTION_EVENT_HANDLER Handler, - IN PVOID EventContext - ); - -typedef struct _RX_CALLOUT_PARAMETERS_BLOCK_ * PRX_CALLOUT_PARAMETERS_BLOCK; -typedef struct _RX_CREATE_CONNECTION_CALLOUT_CONTEXT_ *PRX_CREATE_CONNECTION_CALLOUT_CONTEXT; - -NTSTATUS -RxCeInitiateConnectRequest ( - IN PRX_CALLOUT_PARAMETERS_BLOCK ParameterBlock - ); - -VOID -RxCeCleanupConnectCallOutContext ( - PRX_CREATE_CONNECTION_CALLOUT_CONTEXT CreateConnectionContext - ); - -PVOID -RxAllocateObject ( - NODE_TYPE_CODE NodeType, - PMINIRDR_DISPATCH MRxDispatch, - ULONG NameLength - ); - -VOID -RxFreeObject ( - PVOID pObject - ); - -NTSTATUS -RxInitializeSrvCallParameters ( - IN PRX_CONTEXT RxContext, - IN OUT PSRV_CALL SrvCall - ); - -VOID -RxAddVirtualNetRootToNetRoot ( - PNET_ROOT NetRoot, - PV_NET_ROOT VNetRoot - ); - -VOID -RxRemoveVirtualNetRootFromNetRoot ( - PNET_ROOT NetRoot, - PV_NET_ROOT VNetRoot - ); - -VOID -RxOrphanFcbsFromThisVNetRoot ( - IN PV_NET_ROOT ThisVNetRoot - ); - -PVOID -RxAllocateFcbObject ( - PRDBSS_DEVICE_OBJECT RxDeviceObject, - NODE_TYPE_CODE NodeType, - POOL_TYPE PoolType, - ULONG NameSize, - PVOID AlreadyAllocatedObject - ); - -VOID -RxFreeFcbObject ( - PVOID Object - ); - -VOID -RxPurgeFcb ( - IN PFCB Fcb - ); - -BOOLEAN -RxFinalizeNetFcb ( - OUT PFCB ThisFcb, - IN BOOLEAN RecursiveFinalize, - IN BOOLEAN ForceFinalize, - IN LONG ReferenceCount - ); - -BOOLEAN -RxIsThisACscAgentOpen ( - IN PRX_CONTEXT RxContext - ); - -VOID -RxCheckFcbStructuresForAlignment ( - VOID - ); - -VOID -RxpPrepareCreateContextForReuse ( - PRX_CONTEXT RxContext - ); - -NTSTATUS -RxLowIoSubmitRETRY ( - IN PRX_CONTEXT RxContext, - IN PIRP Irp - ); - -NTSTATUS -RxLowIoCompletionTail ( - IN PRX_CONTEXT RxContext - ); - -VOID -RxRecurrentTimerWorkItemDispatcher ( - IN PVOID Context - ); - -NTSTATUS -RxInitializeWorkQueueDispatcher ( - PRX_WORK_QUEUE_DISPATCHER Dispatcher - ); - -VOID -RxInitializeWorkQueue ( - PRX_WORK_QUEUE WorkQueue, - WORK_QUEUE_TYPE WorkQueueType, - ULONG MaximumNumberOfWorkerThreads, - ULONG MinimumNumberOfWorkerThreads - ); - -VOID -RxTearDownWorkQueueDispatcher ( - PRX_WORK_QUEUE_DISPATCHER Dispatcher - ); - -VOID -RxTearDownWorkQueue ( - PRX_WORK_QUEUE WorkQueue - ); - -NTSTATUS -RxSpinUpWorkerThread ( - PRX_WORK_QUEUE WorkQueue, - PRX_WORKERTHREAD_ROUTINE Routine, - PVOID Parameter - ); - -VOID -RxSpinUpWorkerThreads ( - PRX_WORK_QUEUE WorkQueue - ); - -VOID -RxSpinUpRequestsDispatcher ( - PRX_DISPATCHER Dispatcher - ); - -VOID -RxpSpinUpWorkerThreads ( - PRX_WORK_QUEUE WorkQueue - ); - -VOID -RxpWorkerThreadDispatcher ( - IN PRX_WORK_QUEUE WorkQueue, - IN PLARGE_INTEGER WaitInterval - ); - -VOID -RxBootstrapWorkerThreadDispatcher ( - IN PRX_WORK_QUEUE WorkQueue - ); - -VOID -RxWorkerThreadDispatcher ( - IN PRX_WORK_QUEUE WorkQueue - ); - -VOID -RxWorkItemDispatcher ( - PVOID Context - ); - -BOOLEAN -RxIsPrefixTableEmpty ( - IN PRX_PREFIX_TABLE ThisTable - ); - -PRX_PREFIX_ENTRY -RxTableLookupName_ExactLengthMatch ( - IN PRX_PREFIX_TABLE ThisTable, - IN PUNICODE_STRING Name, - IN ULONG HashValue, - IN PRX_CONNECTION_ID OPTIONAL RxConnectionId - ); - -PVOID -RxTableLookupName ( - IN PRX_PREFIX_TABLE ThisTable, - IN PUNICODE_STRING Name, - OUT PUNICODE_STRING RemainingName, - IN PRX_CONNECTION_ID OPTIONAL RxConnectionId - ); - -VOID -RxAcquireFileForNtCreateSection ( - IN PFILE_OBJECT FileObject - ); - -VOID -RxReleaseFileForNtCreateSection ( - IN PFILE_OBJECT FileObject - ); - -NTSTATUS -RxPrepareRequestForHandling ( - PCHANGE_BUFFERING_STATE_REQUEST Request - ); - -VOID -RxPrepareRequestForReuse ( - PCHANGE_BUFFERING_STATE_REQUEST Request - ); - -VOID -RxpDiscardChangeBufferingStateRequests ( - IN OUT PLIST_ENTRY DiscardedRequests - ); - -VOID -RxGatherRequestsForSrvOpen ( - IN OUT PSRV_CALL SrvCall, - IN PSRV_OPEN SrvOpen, - IN OUT PLIST_ENTRY RequestsListHead - ); - -NTSTATUS -RxpLookupSrvOpenForRequestLite ( - IN PSRV_CALL SrvCall, - IN OUT PCHANGE_BUFFERING_STATE_REQUEST Request - ); - -BOOLEAN -RxContextCheckToFailThisAttempt ( - IN PIRP Irp, - IN OUT PULONG InitialContextFlags - ); - -ULONG -RxAssignMustSucceedContext ( - IN PIRP Irp, - IN ULONG InitialContextFlags - ); - -PRX_CONTEXT -RxAllocateMustSucceedContext ( - PIRP Irp, - IN PRDBSS_DEVICE_OBJECT RxDeviceObject, - IN ULONG InitialContextFlags, - OUT PUCHAR MustSucceedDescriptorNumber - ); - -VOID -RxFreeMustSucceedContext ( - PRX_CONTEXT RxContext - ); - -PRX_LOG_ENTRY_HEADER -RxGetNextLogEntry ( - VOID - ); - -VOID -RxPrintLog ( - IN ULONG EntriesToPrint OPTIONAL - ); - -VOID -RxProcessChangeBufferingStateRequestsForSrvOpen ( - PSRV_OPEN SrvOpen - ); - -NTSTATUS -RxPurgeFobxFromCache ( - PFOBX FobxToBePurged - ); - -BOOLEAN -RxPurgeFobx ( - PFOBX pFobx - ); - -VOID -RxPurgeAllFobxs ( - PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -VOID -RxUndoScavengerFinalizationMarking ( - PVOID Instance - ); - -VOID -RxScavengeAllFobxs ( - PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -ULONG -RxTableComputePathHashValue ( - IN PUNICODE_STRING Name - ); - -VOID -RxExtractServerName ( - IN PUNICODE_STRING FilePathName, - OUT PUNICODE_STRING SrvCallName, - OUT PUNICODE_STRING RestOfName - ); - -VOID -RxCreateNetRootCallBack ( - IN PMRX_CREATENETROOT_CONTEXT CreateNetRootContext - ); - -VOID -RxSpinDownOutstandingAsynchronousRequests ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -NTSTATUS -RxRegisterAsynchronousRequest ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -VOID -RxDeregisterAsynchronousRequest ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -BOOLEAN -RxCancelOperationInOverflowQueue ( - IN PRX_CONTEXT RxContext - ); - -VOID -RxOrphanSrvOpens ( - IN PV_NET_ROOT ThisVNetRoot - ); - -VOID -RxOrphanThisFcb ( - PFCB Fcb - ); - -VOID -RxOrphanSrvOpensForThisFcb ( - IN PFCB Fcb, - IN PV_NET_ROOT ThisVNetRoot, - IN BOOLEAN OrphanAll - ); - -VOID -RxForceFinalizeAllVNetRoots ( - PNET_ROOT NetRoot - ); - -#define RxEqualConnectionId( P1, P2 ) RtlEqualMemory( P1, P2, sizeof( RX_CONNECTION_ID ) ) - - -// -// FsRtl lock package callbacks referenced in fcbstruc.c -// - -NTSTATUS -RxLockOperationCompletion ( - IN PVOID Context, - IN PIRP Irp - ); - -VOID -RxUnlockOperation ( - IN PVOID Context, - IN PFILE_LOCK_INFO LockInfo - ); - -// -// some read routines that need headers -// - -VOID -RxStackOverflowRead ( - IN PVOID Context, - IN PKEVENT Event - ); - -NTSTATUS -RxPostStackOverflowRead ( - IN PRX_CONTEXT RxContext, - IN PFCB Fcb - ); - -// -// the cancel routine -// - -VOID -RxCancelRoutine ( - PDEVICE_OBJECT DeviceObject, - PIRP Irp - ); - - -INLINE -TYPE_OF_OPEN -RxDecodeFileObject ( - IN PFILE_OBJECT FileObject, - OUT PFCB *Fcb, - OUT PFOBX *Fobx - ) { - - if (FileObject) { - *Fcb = (PFCB)FileObject->FsContext; - *Fobx = (PFOBX)FileObject->FsContext2; - - return NodeType( *Fcb ); - } else { - - *Fcb = NULL; - *Fobx = NULL; - return RDBSS_NTC_STORAGE_TYPE_UNKNOWN; - } -} - - -#endif // _RDBSSPROCS_ - - - - diff --git a/qt-correction-tool/pub/ddk/rxstruc.h b/qt-correction-tool/pub/ddk/rxstruc.h deleted file mode 100644 index 68edcc0..0000000 --- a/qt-correction-tool/pub/ddk/rxstruc.h +++ /dev/null @@ -1,369 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - RxStruc.h - -Abstract: - - This module defines the data structures that make up the major internal - part of the Rx file system. - -Author: ---*/ - -#ifndef _RDBSSSTRUC_ -#define _RDBSSSTRUC_ - -#include "prefix.h" -#include "lowio.h" -#include "scavengr.h" // scavenger related definitions. -#include "RxContx.h" -#include "mrx.h" -#include "Fcb.h" - -// -// define our byte offsets to be the full 64 bits -// - -typedef LONGLONG RXVBO; - -#if 0 - -// -// Define who many freed structures we are willing to keep around -// - -#define FREE_FOBX_SIZE (8) -#define FREE_FCB_SIZE (8) -#define FREE_NON_PAGED_FCB_SIZE (8) - -#define FREE_128_BYTE_SIZE (16) -#define FREE_256_BYTE_SIZE (16) -#define FREE_512_BYTE_SIZE (16) - -#endif // 0 - - -// -// We will use both a common and private dispatch tables on a per FCB basis to (a) get -// some encapsulation and (b) [less important] go a little faster. The driver table then gets -// optimized for the most common case. Right now we just use the common dispatch...later and -// Eventually, all the FCBs will have pointers to optimized dispatch tables. -// - -// -// used to synchronize access to rxcontxs and structures -// - -extern RX_SPIN_LOCK RxStrucSupSpinLock; - -typedef struct _RDBSS_EXPORTS { - PRX_SPIN_LOCK pRxStrucSupSpinLock; - PLONG pRxDebugTraceIndent; -} RDBSS_EXPORTS, *PRDBSS_EXPORTS; - -extern RDBSS_EXPORTS RxExports; - -// -// this type is used with table locks to track whether or not the lock -// should be released -// - -typedef enum _LOCK_HOLDING_STATE { - LHS_LockNotHeld, - LHS_SharedLockHeld, - LHS_ExclusiveLockHeld -} LOCK_HOLDING_STATE, *PLOCK_HOLDING_STATE; - -// -// The RDBSS_DATA record is the top record in the Rx file system in-memory -// data structure. This structure must be allocated from non-paged pool. -// - -typedef struct _RDBSS_DATA { - - // - // The type and size of this record (must be RDBSS_NTC_DATA_HEADER) - // - - NODE_TYPE_CODE NodeTypeCode; - NODE_BYTE_SIZE NodeByteSize; - - // - // The Driver object we were initialized with - // - - PDRIVER_OBJECT DriverObject; - - // - // Mini Rdr registration related fields - // - - __volatile LONG NumberOfMinirdrsStarted; - - FAST_MUTEX MinirdrRegistrationMutex; - LIST_ENTRY RegisteredMiniRdrs; //protected by the mutex - LONG NumberOfMinirdrsRegistered; //protected by the mutex - - // - // A pointer to our EPROCESS struct, which is a required input to the - // Cache Management subsystem. - // - - PEPROCESS OurProcess; - - // - // Cache manager call back structures, which must be passed on each call - // to CcInitializeCacheMap. - // - - CACHE_MANAGER_CALLBACKS CacheManagerCallbacks; - - // - // To control access to the global Rx data record - // - - ERESOURCE Resource; - -} RDBSS_DATA; -typedef RDBSS_DATA *PRDBSS_DATA; - -extern RDBSS_DATA RxData; - -PEPROCESS -RxGetRDBSSProcess ( - VOID - ); - -// -// Note: A Strategy needs to be in place to deal with requests for stopping the -// RDBSS when requests are active. -// - -typedef enum _RX_RDBSS_STATE_ { - RDBSS_STARTABLE = 0, - RDBSS_STARTED, - RDBSS_STOP_IN_PROGRESS - - // - // this state deleted with cause! RDBSS_STOPPED - // - -} RX_RDBSS_STATE, *PRX_RDBSS_STATE; - -typedef struct _RDBSS_STARTSTOP_CONTEXT_ { - - RX_RDBSS_STATE State; - ULONG Version; - PRX_CONTEXT pStopContext; - -} RDBSS_STARTSTOP_CONTEXT, *PRDBSS_STARTSTOP_CONTEXT; - -typedef struct _MRX_CALLDOWN_COMPLETION_CONTEXT_ { - - LONG WaitCount; - KEVENT Event; - -} MRX_CALLDOWN_COMPLETION_CONTEXT, *PMRX_CALLDOWN_COMPLETION_CONTEXT; - -typedef -NTSTATUS -(NTAPI *PMRX_CALLDOWN_ROUTINE) ( - IN OUT PVOID CalldownParameter - ); - - -typedef struct _MRX_CALLDOWN_CONTEXT_ { - - RX_WORK_QUEUE_ITEM WorkQueueItem; - PRDBSS_DEVICE_OBJECT pMRxDeviceObject; - PMRX_CALLDOWN_COMPLETION_CONTEXT pCompletionContext; - PMRX_CALLDOWN_ROUTINE pRoutine; - NTSTATUS CompletionStatus; - PVOID pParameter; - -} MRX_CALLDOWN_CONTEXT, *PMRX_CALLDOWN_CONTEXT; - -typedef struct _RX_DISPATCHER_CONTEXT_ { - - __volatile LONG NumberOfWorkerThreads; - __volatile PKEVENT pTearDownEvent; - -} RX_DISPATCHER_CONTEXT, *PRX_DISPATCHER_CONTEXT; - -#define RxSetRdbssState(RxDeviceObject,NewState) \ - { \ - KIRQL SavedIrql; \ - KeAcquireSpinLock( &RxStrucSupSpinLock,&SavedIrql ); \ - RxDeviceObject->StartStopContext.State = (NewState); \ - KeReleaseSpinLock( &RxStrucSupSpinLock, SavedIrql ); \ - } - -#define RxGetRdbssState(RxDeviceObject) \ - (RxDeviceObject)->StartStopContext.State - -BOOLEAN -RxIsOperationCompatibleWithRdbssState ( - PIRP Irp - ); - -// -// The RDBSS Device Object is an I/O system device object with additions for -// the various structures needed by each minirdr: the dispatch, export-to-minirdr -// structure, MUP call characteristics, list of active operations, etc. -// - -typedef struct _RDBSS_DEVICE_OBJECT { - - union { - DEVICE_OBJECT DeviceObject; -#ifndef __cplusplus - DEVICE_OBJECT; -#endif // __cplusplus - }; - - ULONG RegistrationControls; - - // - // stuff that the minirdr needs to know - // - - PRDBSS_EXPORTS RdbssExports; - - // - // set to NULL if monolithic - // - - PDEVICE_OBJECT RDBSSDeviceObject; - - // - // the mini rdr dispatch vector - // - - PMINIRDR_DISPATCH Dispatch; - UNICODE_STRING DeviceName; - - ULONG NetworkProviderPriority; - - HANDLE MupHandle; - - BOOLEAN RegisterUncProvider; - BOOLEAN RegisterMailSlotProvider; - BOOLEAN RegisteredAsFileSystem; - BOOLEAN Unused; - - LIST_ENTRY MiniRdrListLinks; - - __volatile ULONG NumberOfActiveFcbs; - __volatile ULONG NumberOfActiveContexts; - - struct { - - LARGE_INTEGER PagingReadBytesRequested; - LARGE_INTEGER NonPagingReadBytesRequested; - LARGE_INTEGER CacheReadBytesRequested; - LARGE_INTEGER FastReadBytesRequested; - LARGE_INTEGER NetworkReadBytesRequested; - __volatile ULONG ReadOperations; - ULONG FastReadOperations; - __volatile ULONG RandomReadOperations; - - LARGE_INTEGER PagingWriteBytesRequested; - LARGE_INTEGER NonPagingWriteBytesRequested; - LARGE_INTEGER CacheWriteBytesRequested; - LARGE_INTEGER FastWriteBytesRequested; - LARGE_INTEGER NetworkWriteBytesRequested; - __volatile ULONG WriteOperations; - ULONG FastWriteOperations; - __volatile ULONG RandomWriteOperations; - }; - - // - // The following field tells how many requests for this volume have - // either been enqueued to ExWorker threads or are currently being - // serviced by ExWorker threads. If the number goes above - // a certain threshold, put the request on the overflow queue to be - // executed later. - // - - __deref_volatile LONG PostedRequestCount[MaximumWorkQueue]; - - // - // The following field indicates the number of IRP's waiting - // to be serviced in the overflow queue. - // - - LONG OverflowQueueCount[MaximumWorkQueue]; - - // - // The following field contains the queue header of the overflow queue. - // The Overflow queue is a list of IRP's linked via the IRP's ListEntry - // field. - // - - LIST_ENTRY OverflowQueue[MaximumWorkQueue]; - - // - // The following spinlock protects access to all the above fields. - // - - RX_SPIN_LOCK OverflowQueueSpinLock; - - // - // The following fields are required for synchronization with async. - // requests issued by the RDBSS on behalf of this mini redirector on - // on shutdown. - // - - LONG AsynchronousRequestsPending; - - PKEVENT pAsynchronousRequestsCompletionEvent; - - RDBSS_STARTSTOP_CONTEXT StartStopContext; - - RX_DISPATCHER_CONTEXT DispatcherContext; - - // - // some guys may want to share - // - - PRX_PREFIX_TABLE pRxNetNameTable; - RX_PREFIX_TABLE RxNetNameTableInDeviceObject; - - - // - // for sharing - // - - PRDBSS_SCAVENGER pRdbssScavenger; - RDBSS_SCAVENGER RdbssScavengerInDeviceObject; - -} RDBSS_DEVICE_OBJECT, *PRDBSS_DEVICE_OBJECT; - -INLINE -VOID -NTAPI -RxUnregisterMinirdr ( - IN PRDBSS_DEVICE_OBJECT RxDeviceObject - ) -{ - PDEVICE_OBJECT RDBSSDeviceObject; - - RDBSSDeviceObject = RxDeviceObject->RDBSSDeviceObject; - - RxpUnregisterMinirdr( RxDeviceObject ); - - if (RDBSSDeviceObject != NULL) { - ObDereferenceObject( RDBSSDeviceObject ); - } -} - -extern FAST_MUTEX RxMinirdrRegistrationMutex; -extern LIST_ENTRY RxRegisteredMiniRdrs; -extern ULONG RxNumberOfMinirdrs; - -#endif // _RDBSSSTRUC_ - diff --git a/qt-correction-tool/pub/ddk/rxtimer.h b/qt-correction-tool/pub/ddk/rxtimer.h deleted file mode 100644 index be09ee6..0000000 --- a/qt-correction-tool/pub/ddk/rxtimer.h +++ /dev/null @@ -1,75 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - RxTimer.h - -Abstract: - - This module defines the prototypes and structures for the timer on the rdbss architecture. - What is provided is a 55ms timer...that is, if you register a routine then you get a call - every 55ms. On NT, you're at DPC level. - - Also contained here are the routines for posting to a thread from DPC level. - - -Author: ---*/ - -#ifndef _RXTIMER_H_ -#define _RXTIMER_H_ - -// -// The RX_WORK_ITEM encapsulates the context for posting to a worker thread as well as -// a timer routine to be triggered after a specific interval. -// - -typedef struct _RX_WORK_ITEM_ { - RX_WORK_QUEUE_ITEM WorkQueueItem; - ULONG LastTick; - ULONG Options; -} RX_WORK_ITEM, *PRX_WORK_ITEM; - -extern NTSTATUS -NTAPI -RxPostOneShotTimerRequest( - IN PRDBSS_DEVICE_OBJECT pDeviceObject, - IN PRX_WORK_ITEM pWorkItem, - IN PRX_WORKERTHREAD_ROUTINE Routine, - IN PVOID pContext, - IN LARGE_INTEGER TimeInterval); - -extern NTSTATUS -NTAPI -RxPostRecurrentTimerRequest( - IN PRDBSS_DEVICE_OBJECT pDeviceObject, - IN PRX_WORKERTHREAD_ROUTINE Routine, - IN PVOID pContext, - IN LARGE_INTEGER TimeInterval); - - -extern NTSTATUS -NTAPI -RxCancelTimerRequest( - IN PRDBSS_DEVICE_OBJECT pDeviceObject, - IN PRX_WORKERTHREAD_ROUTINE Routine, - IN PVOID pContext - ); - - -// -// Routines for initializing and tearing down the timer service in RDBSS -// - -extern NTSTATUS -NTAPI -RxInitializeRxTimer(); - -extern VOID -NTAPI -RxTearDownRxTimer(void); - -#endif // _RXTIMER_STUFF_DEFINED_ - diff --git a/qt-correction-tool/pub/ddk/rxtrace.h b/qt-correction-tool/pub/ddk/rxtrace.h deleted file mode 100644 index 8675960..0000000 --- a/qt-correction-tool/pub/ddk/rxtrace.h +++ /dev/null @@ -1,292 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - rxtrace.h - -Abstract: - - This module defines the macros which provide debugging support ( tracing ). - -Author: -Revision History: - ---*/ - -#ifndef _RDBSSTRACE_INCLUDED_ -#define _RDBSSTRACE_INCLUDED_ - -#if !DBG -#undef RDBSSTRACE -#endif // !DBG - -typedef struct _DEBUG_TRACE_CONTROLPOINT{ - ULONG ControlPointNumber; - PSZ Name; -} DEBUG_TRACE_CONTROLPOINT, *PDEBUG_TRACE_CONTROLPOINT; - -typedef struct { - LONG PrintLevel; - ULONG BreakMask; - PSZ Name; -} RX_DEBUG_TRACE_CONTROL, *PRX_DEBUG_TRACE_CONTROL; - - -#ifdef RDBSSTRACE - -//define so that &RX_DEBUG_TRACE_CONTROL is NULL -typedef struct { - RX_DEBUG_TRACE_CONTROL Junk; -} rxrxrx_AlwaysHelper; - - -#define RX_DEBUG_TRACE_ALWAYS (((rxrxrx_AlwaysHelper*)0)->Junk) - -// The following macros provide fine grained control for selectively enabling -// and disabling tracing. - -#define RXDT_Extern(__x) extern DEBUG_TRACE_CONTROLPOINT RX_DEBUG_TRACE_##__x -#define RXDT_DeclareCategory(__x) extern DEBUG_TRACE_CONTROLPOINT RX_DEBUG_TRACE_##__x -#define RXDT_DefineCategory(__x) DEBUG_TRACE_CONTROLPOINT RX_DEBUG_TRACE_##__x = {0,#__x} - -RXDT_Extern(ERROR); -RXDT_Extern(HOOKS); -RXDT_Extern(CATCH_EXCEPTIONS); -RXDT_Extern(UNWIND); -RXDT_Extern(CLEANUP); -RXDT_Extern(CLOSE); -RXDT_Extern(CREATE); -RXDT_Extern(DIRCTRL); -RXDT_Extern(EA); -RXDT_Extern(FILEINFO); -RXDT_Extern(FSCTRL); -RXDT_Extern(LOCKCTRL); -RXDT_Extern(READ); -RXDT_Extern(VOLINFO); -RXDT_Extern(WRITE); -RXDT_Extern(FLUSH); -RXDT_Extern(DEVCTRL); -RXDT_Extern(SHUTDOWN); -RXDT_Extern(PREFIX); -RXDT_Extern(DEVFCB); -RXDT_Extern(ACCHKSUP); -RXDT_Extern(ALLOCSUP); -RXDT_Extern(DIRSUP); -RXDT_Extern(FILOBSUP); -RXDT_Extern(NAMESUP); -RXDT_Extern(VERFYSUP); -RXDT_Extern(CACHESUP); -RXDT_Extern(SPLAYSUP); -RXDT_Extern(DEVIOSUP); -RXDT_Extern(FCBSTRUCTS); -RXDT_Extern(STRUCSUP); -RXDT_Extern(FSP_DISPATCHER); -RXDT_Extern(FSP_DUMP); -RXDT_Extern(RXCONTX); -RXDT_Extern(DISPATCH); -RXDT_Extern(NTFASTIO); -RXDT_Extern(LOWIO); -RXDT_Extern(MINIRDR); -RXDT_Extern(DISCCODE); //for the browser interface stuff -RXDT_Extern(BROWSER); -RXDT_Extern(CONNECT); -RXDT_Extern(NTTIMER); -RXDT_Extern(SCAVTHRD); -RXDT_Extern(SCAVENGER); -RXDT_Extern(SHAREACCESS); -RXDT_Extern(NAMECACHE); - -//connection engines categories - -RXDT_Extern(RXCEBINDING); -RXDT_Extern(RXCEDBIMPLEMENTATION); -RXDT_Extern(RXCEMANAGEMENT); -RXDT_Extern(RXCEXMIT); -RXDT_Extern(RXCEPOOL); -RXDT_Extern(RXCETDI); - -#else //RDBSSTRACE - -#define RXDT_Extern(__x) -#define RXDT_DeclareCategory(__x) -#define RXDT_DefineCategory(__x) - -#endif //RDBSSTRACE - -#ifdef RDBSSTRACE -extern BOOLEAN RxGlobalTraceSuppress, RxNextGlobalTraceSuppress; -extern ULONG RxGlobalTraceIrpCount; -VOID RxInitializeDebugTrace(void); -#define RxDbgTraceDoit(___x) ___x - -#ifndef MINIRDR__NAME -extern LONG RxDebugTraceIndent; -#else -#define RxDebugTraceIndent (*(*___MINIRDR_IMPORTS_NAME).pRxDebugTraceIndent) -#endif - -#else - -#define RxInitializeDebugTrace() -#define RxDbgTraceDoit(___x) - -#endif //RDBSSTRACE - - - -#if DBG - -#define RxDT_INDENT_EXCESS 16 //this is the offset for excess-n for the indent -#define RxDT_INDENT_SHIFT 20 -#define RxDT_INDENT_MASK 0x3f -#define RxDT_LEVEL_MASK ((1<BreakMask & (1<<((MASKBIT)-1)) )) { \ - DbgBreakPoint(); \ - } \ -} - -#define DebugUnwind(X) { \ - if (AbnormalTermination()) { \ - RxDbgTrace(0, (DEBUG_TRACE_UNWIND), ( #X ", Abnormal termination.\n", 0)); \ - } \ -} - -#ifdef RX_PERFPORMANCE_TIMER -extern LONG RxPerformanceTimerLevel; - -#define TimerStart(LEVEL) { \ - LARGE_INTEGER TStart, TEnd; \ - LARGE_INTEGER TElapsed; \ - TStart = KeQueryPerformanceCounter( NULL ); \ - -#define TimerStop(LEVEL,s) \ - TEnd = KeQueryPerformanceCounter( NULL ); \ - TElapsed.QuadPart = TEnd.QuadPart - TStart.QuadPart; \ - RxTotalTicks[RxLogOf(LEVEL)] += TElapsed.LowPart; \ - if (FlagOn( RxPerformanceTimerLevel, (LEVEL))) { \ - DbgPrint("Time of %s %ld\n", (s), TElapsed.LowPart ); \ - } \ -} -#endif //RX_PERFPORMANCE_TIMER - -#else // RDBSSTRACE - -#define RxDbgTraceLV__norx_reverseaction(INDENT,CONTROLPOINT,LEVEL,Z) {NOTHING;} -#define RxDbgTraceLV(INDENT,CONTROLPOINTNUM,LEVEL,Z) {NOTHING;} -#define RxDbgTraceLVUnIndent(INDENT,CONTROLPOINTNUM,LEVEL) {NOTHING;} -#define RxDbgTrace(INDENT,CONTROLPOINTNUM,Z) {NOTHING;} -#define RxDbgTraceUnIndent(INDENT,CONTROLPOINTNUM) {NOTHING;} -#define DebugBreakPoint(CONTROLPOINTNUM,MASKBIT) {NOTHING;} -#define DebugUnwind(X) {NOTHING;} -#define RxDbgTraceDisableGlobally() FALSE -#define RxDbgTraceEnableGlobally(f) {NOTHING;} - -#ifdef RX_PERFPORMANCE_TIMER -#define TimerStart(LEVEL) -#define TimerStop(LEVEL,s) -#endif - -#endif // RDBSSTRACE - - -#endif // _RDBSSTRACE_INCLUDED_ - - diff --git a/qt-correction-tool/pub/ddk/rxtypes.h b/qt-correction-tool/pub/ddk/rxtypes.h deleted file mode 100644 index f4a6d3c..0000000 --- a/qt-correction-tool/pub/ddk/rxtypes.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef _RXTYPES_INCL -#define _RXTYPES_INCL - -#include "nodetype.h" - -typedef PVOID RX_HANDLE, *PRX_HANDLE; -typedef KSPIN_LOCK RX_SPIN_LOCK; -typedef PKSPIN_LOCK PRX_SPIN_LOCK; - - -// String definitions -// The RX_STRING type corresponds to a UNICODE_STRING and all the Rtl functions that are -// available to manipulate Unicode strings can be used to manipulate the strings -// - -typedef struct _BINDING_HANDLE { - RX_HANDLE pTdiEmulationContext; // Win9X net structure - RX_HANDLE pTransportInformation; // tdi transport information. -} RX_BINDING_HANDLE, *PRX_BINDING_HANDLE; - -typedef UNICODE_STRING UNICODE_STRING; -typedef UNICODE_STRING* PUNICODE_STRING; - - -// This structure is transient. Most fields in this structure allow us to -// move through the bind/addname part of activating a net. Runtime info -// for the rxce and long term context is kept elsewhere. - -typedef struct _RX_BINDING_CONTEXT { - PUNICODE_STRING pTransportName; // Transport Name (unicode string). - ULONG QualityOfService; // Requested QOS. - // Common fields. - PRX_BINDING_HANDLE pBindHandle; // Handle to transport bind info. - } RX_BINDING_CONTEXT, *PRX_BINDING_CONTEXT; -#endif // _RXTYPES_INCL - - diff --git a/qt-correction-tool/pub/ddk/rxworkq.h b/qt-correction-tool/pub/ddk/rxworkq.h deleted file mode 100644 index 171f062..0000000 --- a/qt-correction-tool/pub/ddk/rxworkq.h +++ /dev/null @@ -1,249 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - rxworkq.h - -Abstract: - - This module defines the data structures required to implement the dispatching - mechanism in RDBSS for use by RDBSS as well as all the mini redirectors. - -Author: ---*/ - -#ifndef _RXWORKQ_H_ -#define _RXWORKQ_H_ - -// -// The worker thread routine prototype definition. -// - -typedef -VOID -(NTAPI *PRX_WORKERTHREAD_ROUTINE) ( - IN PVOID Context - ); - -// -// The RDBSS needs to keep track of the work items on a per device object basis. -// This enables the race conditions associated with loading/unloading as well as -// a mechanism for preventing a single mini redirector from unfairly hogging all -// the resources. -// - -#ifdef __cplusplus -typedef struct _RX_WORK_QUEUE_ITEM_ : public WORK_QUEUE_ITEM { - // the work queue item as defined in NTOS -#else // !__cplusplus -typedef struct _RX_WORK_QUEUE_ITEM_ { - WORK_QUEUE_ITEM; // the work queue item as defined in NTOS -#endif // __cplusplus - - PRDBSS_DEVICE_OBJECT pDeviceObject; -} RX_WORK_QUEUE_ITEM, *PRX_WORK_QUEUE_ITEM; - -// -// There are certain scenarios in which dispatching of work items is inevitable. -// In such instance the WORK_QUEUE_ITEM is allocated as part of another data -// structure to avoid frequent allocation/freeing. In other scenarios where -// dispatching is rare it pays to avoid the allocation of the memory till it -// is rquired. The RDBSS work queue implementations provide for both these -// scenarios in the form of dispatching and posting work queue requests. In -// the case of dispatching no memory for the WORK_QUEUE_ITEM need be allocated -// by the caller while for posting the memory for WORK_QUEUE_ITEM needs to be -// allocated by the caller. -// - -typedef struct _RX_WORK_DISPATCH_ITEM_ { - RX_WORK_QUEUE_ITEM WorkQueueItem; - PRX_WORKERTHREAD_ROUTINE DispatchRoutine; - PVOID DispatchRoutineParameter; -} RX_WORK_DISPATCH_ITEM, *PRX_WORK_DISPATCH_ITEM; - -// -// The work queues typically come up in a active state and continue till either -// a non recoverable situation is encountered ( lack of system resources ) when -// it transitions to the Inactive state. When a rundown is initiated it transitions -// to the rundown in progress state. -// - -typedef enum _RX_WORK_QUEUE_STATE_ { - RxWorkQueueActive, - RxWorkQueueInactive, - RxWorkQueueRundownInProgress -} RX_WORK_QUEUE_STATE, *PRX_WORK_QUEUE_STATE; - -// -// The rundown of work queues is not complete when the threads have been spun down. -// The termination of the threads needs to be ensured before the data structures -// can be torn down. The work queue implementation follows a protocol in which -// each of the threads being spundown stashes a reference to the thread object -// in the rundown context. The rundown issuing thread ( which does not belong to -// the work queue ) waits for the completion of all the threads spundown before -// tearing down the data structures. -// - -typedef struct _RX_WORK_QUEUE_RUNDOWN_CONTEXT_ { - KEVENT RundownCompletionEvent; - LONG NumberOfThreadsSpunDown; - PETHREAD *ThreadPointers; -} RX_WORK_QUEUE_RUNDOWN_CONTEXT, *PRX_WORK_QUEUE_RUNDOWN_CONTEXT; - -// -// The work queue implementation is built around a KQUEUE implementation. The -// additional support involves the regulation of number of threads that are -// actively waiting for the work items. Each work queue data structure is -// allocated in nonpaged pool and has its own synchronization mechanism ( spinlock). -// -// In addition to the bookkeeing information, i.e., state, type etc. it also includes -// statistics that are gathered over the lifetime of the queue. This will -// provide valuable information in tuning a work queue instance. The number of items -// that have been processed , the number of items that have to be processed and -// the cumulative queue length is recorded. The cumulative queue length is the -// intersiting metric, it is the sum of the number of items awaiting to be processed -// each time an additional work item was queued. The cumulative queue length -// divided by the sum of the total number of items processed and the anumber of -// items to be processed gives an indication of the average length of the -// queue. A value much greater than one signifies that the minimum number of -// worker threads associated with the work queue can be increased. A value much -// less than one signifies that the maximum number of work threads associated -// with the queue can be decreased. -// - -typedef struct _RX_WORK_QUEUE_ { - USHORT State; - BOOLEAN SpinUpRequestPending; - UCHAR Type; - - KSPIN_LOCK SpinLock; - - PRX_WORK_QUEUE_RUNDOWN_CONTEXT pRundownContext; - - __volatile LONG NumberOfWorkItemsDispatched; - __volatile LONG NumberOfWorkItemsToBeDispatched; - LONG CumulativeQueueLength; - - LONG NumberOfSpinUpRequests; - LONG MaximumNumberOfWorkerThreads; - LONG MinimumNumberOfWorkerThreads; - __volatile LONG NumberOfActiveWorkerThreads; - __volatile LONG NumberOfIdleWorkerThreads; - LONG NumberOfFailedSpinUpRequests; - __volatile LONG WorkQueueItemForSpinUpWorkerThreadInUse; - - RX_WORK_QUEUE_ITEM WorkQueueItemForTearDownWorkQueue; - RX_WORK_QUEUE_ITEM WorkQueueItemForSpinUpWorkerThread; - RX_WORK_QUEUE_ITEM WorkQueueItemForSpinDownWorkerThread; - - KQUEUE Queue; - - // The next field is for debugging purposes and will be removed from the - // FREE build. - PETHREAD *ThreadPointers; - -} RX_WORK_QUEUE, *PRX_WORK_QUEUE; - -// -// The dispatching mechanism in RDBSS provides for multiple levels of work queues -// on a per processor basis. There are three levels of work queues currently -// supported, Critical,Delayed and HyperCritical. The distinction between Critical -// and delayed is one of priority where as HyperCritical iss different from the -// other two in that the routines should not block, i.e., wait for any resource. -// This requirement cannot be enforced hence the effectiveness of the dispatching -// mechanism relies on the implicit cooperation of the clients. -// - -typedef struct _RX_WORK_QUEUE_DISPATCHER_ { - RX_WORK_QUEUE WorkQueue[MaximumWorkQueue]; -} RX_WORK_QUEUE_DISPATCHER, *PRX_WORK_QUEUE_DISPATCHER; - -// -// The dispatcher typically come up in a active state and continue till either -// a non recoverable situation is encountered ( lack of system resources ) when -// it transitions to the Inactive state. When a rundown is initiated it transitions -// to the rundown in progress state. -// - -typedef enum _RX_DISPATCHER_STATE_ { - RxDispatcherActive, - RxDispatcherInactive -} RX_DISPATCHER_STATE, *PRX_DISPATCHER_STATE; - - -// -// The RDBSS dispatching mechanism on any machine is an array of the dispatchers -// associated with each processor. When a work queue item is queued a best effort -// is made to contain the work emanating from a processor onto the same processor. -// This ensures that processor affinities setup by the NT dispatcher are not -// destroyed by the RDBSS dispatching mechanism as this could lead to excessive -// sloshing. When the work needs to be moved there are two metrics that will be -// useful in making the decision, teh amount of delay that will be experienced -// by the work item in the current queue and the effort involved in moving the -// work item to the other queue. It is very easy to quantify the former but very -// difficult to quantify the later. -// - -typedef struct _RX_DISPATCHER_ { - LONG NumberOfProcessors; - PEPROCESS OwnerProcess; - PRX_WORK_QUEUE_DISPATCHER pWorkQueueDispatcher; - - RX_DISPATCHER_STATE State; - - LIST_ENTRY SpinUpRequests; - KSPIN_LOCK SpinUpRequestsLock; - KEVENT SpinUpRequestsEvent; - KEVENT SpinUpRequestsTearDownEvent; -} RX_DISPATCHER, *PRX_DISPATCHER; - -// -// The function prototypes used for dispatching/posting work queue items -// - -extern NTSTATUS -NTAPI -RxPostToWorkerThread ( - IN PRDBSS_DEVICE_OBJECT pMRxDeviceObject, - IN WORK_QUEUE_TYPE WorkQueueType, - IN PRX_WORK_QUEUE_ITEM pWorkQueueItem, - IN PRX_WORKERTHREAD_ROUTINE Routine, - IN PVOID pContext - ); - -extern NTSTATUS -NTAPI -RxDispatchToWorkerThread( - IN PRDBSS_DEVICE_OBJECT pMRxDeviceObject, - IN WORK_QUEUE_TYPE WorkQueueType, - IN PRX_WORKERTHREAD_ROUTINE Routine, - IN PVOID pContext); - -extern BOOLEAN //should only be called from raised IRQL -NTAPI -RxIsWorkItemQueued( - IN OUT PWORK_QUEUE_ITEM WorkItem - ); - -// -// The routines for initializing/tearing down the dispatching mechanism -// - -extern NTSTATUS -RxInitializeDispatcher(); - -extern NTSTATUS -RxTearDownDispatcher(); - -extern NTSTATUS -RxInitializeMRxDispatcher( - IN OUT PRDBSS_DEVICE_OBJECT pMRxDeviceObject); - -extern NTSTATUS -RxSpinDownMRxDispatcher( - IN OUT PRDBSS_DEVICE_OBJECT pMRxDeviceObject); - -#endif _RXWORKQ_H_ - diff --git a/qt-correction-tool/pub/ddk/scavengr.h b/qt-correction-tool/pub/ddk/scavengr.h deleted file mode 100644 index 15a7b3a..0000000 --- a/qt-correction-tool/pub/ddk/scavengr.h +++ /dev/null @@ -1,276 +0,0 @@ -/*++ - -Copyright (c) 1994 Microsoft Corporation - -Module Name: - - scavengr.h - -Abstract: - - This module defines data structures related to scavenging in the RDBSS - -Author: -Revision History: - - -Notes: - - The dormant file limit must be made configurable on a per server basis - ---*/ - -#ifndef _SCAVENGR_H_ -#define _SCAVENGR_H_ - -// -// currently, only a single scavengermutex is across all scavenging operations -// for all underlying deviceobjects -// - -extern KMUTEX RxScavengerMutex; - -// -// by default the scavenger will run once every 10 seconds -// -#define RX_SCAVENGER_FINALIZATION_TIME_INTERVAL (10 * 1000 * 1000 * 10) - -// -// scavenger must run at least once every 2 minutes -// -#define RX_MAX_SCAVENGER_TIME_INTERVAL 120 - - -// -// An instance of this data structure is embedded as part of those data structures -// that are scavenged, i.e., FCB, RX_CONTEXT, etc. -// - -#define RX_SCAVENGER_ENTRY_TYPE_MARKER (0x0001) -#define RX_SCAVENGER_ENTRY_TYPE_FCB (0x0002) - -#define RX_SCAVENGER_OP_PURGE (0x0001) -#define RX_SCAVENGER_OP_CLOSE (0x0002) - -#define RX_SCAVENGER_INITIATED_OPERATION (0x0001) - -typedef enum _RX_SCAVENGER_ENTRY_STATE { - RX_SCAVENGING_INACTIVE, - RX_SCAVENGING_PENDING, - RX_SCAVENGING_IN_PROGRESS, - RX_SCAVENGING_AWAITING_RESPONSE -} RX_SCAVENGER_ENTRY_STATE, *PRX_SCAVENGER_ENTRY_STATE; - -typedef struct _RX_SCAVENGER_ENTRY { - - // - // List of related items to be scavenged - // - - LIST_ENTRY List; - - UCHAR Type; - UCHAR Operation; - UCHAR State; - UCHAR Flags; - - struct _RX_SCAVENGER_ENTRY *pContinuationEntry; - -} RX_SCAVENGER_ENTRY, *PRX_SCAVENGER_ENTRY; - - -#define RxInitializeScavengerEntry(ScavengerEntry) \ - (ScavengerEntry)->State = 0; \ - (ScavengerEntry)->Flags = 0; \ - (ScavengerEntry)->Type = 0; \ - (ScavengerEntry)->Operation = 0; \ - InitializeListHead(&(ScavengerEntry)->List); \ - (ScavengerEntry)->pContinuationEntry = NULL - -#define RX_SCAVENGER_MUTEX_ACQUIRED (1) - -typedef enum _RDBSS_SCAVENGER_STATE { - RDBSS_SCAVENGER_INACTIVE, - RDBSS_SCAVENGER_DORMANT, - RDBSS_SCAVENGER_ACTIVE, - RDBSS_SCAVENGER_SUSPENDED -} RDBSS_SCAVENGER_STATE, *PRDBSS_SCAVENGER_STATE; - -typedef struct _RDBSS_SCAVENGER { - - RDBSS_SCAVENGER_STATE State; - - LONG MaximumNumberOfDormantFiles; - __volatile LONG NumberOfDormantFiles; - - LARGE_INTEGER TimeLimit; - - ULONG SrvCallsToBeFinalized; - ULONG NetRootsToBeFinalized; - ULONG VNetRootsToBeFinalized; - ULONG FcbsToBeFinalized; - ULONG SrvOpensToBeFinalized; - ULONG FobxsToBeFinalized; - - LIST_ENTRY SrvCallFinalizationList; - LIST_ENTRY NetRootFinalizationList; - LIST_ENTRY VNetRootFinalizationList; - LIST_ENTRY FcbFinalizationList; - LIST_ENTRY SrvOpenFinalizationList; - LIST_ENTRY FobxFinalizationList; - - LIST_ENTRY ClosePendingFobxsList; - - RX_WORK_ITEM WorkItem; - KEVENT SyncEvent; - KEVENT ScavengeEvent; - - PETHREAD CurrentScavengerThread; - PNET_ROOT CurrentNetRootForClosePendingProcessing; - PFCB CurrentFcbForClosePendingProcessing; - KEVENT ClosePendingProcessingSyncEvent; - -} RDBSS_SCAVENGER, *PRDBSS_SCAVENGER; - -#define RxInitializeRdbssScavenger(Scavenger, ScavengerTimeLimit) \ - (Scavenger)->State = RDBSS_SCAVENGER_INACTIVE; \ - (Scavenger)->SrvCallsToBeFinalized = 0; \ - (Scavenger)->NetRootsToBeFinalized = 0; \ - (Scavenger)->VNetRootsToBeFinalized = 0; \ - (Scavenger)->FcbsToBeFinalized = 0; \ - (Scavenger)->SrvOpensToBeFinalized = 0; \ - (Scavenger)->FobxsToBeFinalized = 0; \ - (Scavenger)->NumberOfDormantFiles = 0; \ - (Scavenger)->MaximumNumberOfDormantFiles = 50; \ - (Scavenger)->CurrentFcbForClosePendingProcessing = NULL; \ - (Scavenger)->CurrentNetRootForClosePendingProcessing = NULL; \ - if( (ScavengerTimeLimit).QuadPart == 0 ) { \ - (Scavenger)->TimeLimit.QuadPart = RX_SCAVENGER_FINALIZATION_TIME_INTERVAL; \ - } else { \ - (Scavenger)->TimeLimit.QuadPart = (ScavengerTimeLimit).QuadPart; \ - } \ - KeInitializeEvent(&((Scavenger)->SyncEvent),NotificationEvent,FALSE); \ - KeInitializeEvent(&((Scavenger)->ScavengeEvent),SynchronizationEvent,TRUE); \ - KeInitializeEvent(&((Scavenger)->ClosePendingProcessingSyncEvent),NotificationEvent,FALSE); \ - InitializeListHead(&(Scavenger)->SrvCallFinalizationList); \ - InitializeListHead(&(Scavenger)->NetRootFinalizationList); \ - InitializeListHead(&(Scavenger)->VNetRootFinalizationList); \ - InitializeListHead(&(Scavenger)->SrvOpenFinalizationList); \ - InitializeListHead(&(Scavenger)->FcbFinalizationList); \ - InitializeListHead(&(Scavenger)->FobxFinalizationList); \ - InitializeListHead(&(Scavenger)->ClosePendingFobxsList) - - -#define RxAcquireScavengerMutex() \ - KeWaitForSingleObject( &RxScavengerMutex, Executive, KernelMode, FALSE, NULL ) - -#define RxReleaseScavengerMutex() \ - KeReleaseMutex( &RxScavengerMutex, FALSE ) - -NTSTATUS -RxMarkFcbForScavengingAtCleanup ( - PFCB Fcb - ); - -NTSTATUS -RxMarkFcbForScavengingAtClose ( - PFCB - Fcb - ); - -VOID -RxUpdateScavengerOnCloseCompletion ( - PFCB - Fcb - ); - -VOID -RxMarkFobxOnCleanup ( - PFOBX pFobx, - PBOOLEAN NeedPurge - ); - -VOID -RxMarkFobxOnClose ( - PFOBX Fobx - ); - -NTSTATUS -RxPurgeRelatedFobxs ( - PNET_ROOT NetRoot, - PRX_CONTEXT RxContext, - BOOLEAN AttemptFinalization, - PFCB PurgingFcb - ); - -#define DONT_ATTEMPT_FINALIZE_ON_PURGE FALSE -#define ATTEMPT_FINALIZE_ON_PURGE TRUE - -// -// the purge_sync context is used to synchronize contexts that are attempting to purge... -// notatbly creates and dirctrls. these are planted in various structures because various minirdrs -// require different granularity of purge operations -// - - -typedef struct _PURGE_SYNCHRONIZATION_CONTEXT { - - // - // the list of purge requests active for this netroot. - // - - LIST_ENTRY ContextsAwaitingPurgeCompletion; - BOOLEAN PurgeInProgress; -} PURGE_SYNCHRONIZATION_CONTEXT, *PPURGE_SYNCHRONIZATION_CONTEXT; - -VOID -RxInitializePurgeSyncronizationContext ( - PPURGE_SYNCHRONIZATION_CONTEXT PurgeSyncronizationContext - ); - -NTSTATUS -RxScavengeRelatedFcbs ( - PRX_CONTEXT RxContext - ); - -BOOLEAN -RxScavengeRelatedFobxs ( - PFCB Fcb - ); - -VOID -RxScavengeFobxsForNetRoot ( - PNET_ROOT NetRoot, - PFCB PurgingFcb, - BOOLEAN SynchronizeWithScavenger - ); - -VOID -RxpMarkInstanceForScavengedFinalization ( - PVOID Instance - ); - -VOID -RxpUndoScavengerFinalizationMarking ( - PVOID Instance - ); - -VOID -RxTerminateScavenging ( - PRX_CONTEXT RxContext - ); - -BOOLEAN -RxScavengeVNetRoots ( - PRDBSS_DEVICE_OBJECT RxDeviceObject - ); - -VOID -RxSynchronizeWithScavenger ( - IN PRX_CONTEXT RxContext, - IN PFCB Fcb - ); - -#endif // _SCAVENGR_H_ - - diff --git a/qt-correction-tool/pub/ddk/scsi.h b/qt-correction-tool/pub/ddk/scsi.h deleted file mode 100644 index 9c0657b..0000000 --- a/qt-correction-tool/pub/ddk/scsi.h +++ /dev/null @@ -1,3666 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - scsi.h - -Abstract: - - These are the structures and defines that are used in the - SCSI port and class drivers. - -Authors: - -Revision History: - ---*/ -#ifndef _NTSCSI_ -#define _NTSCSI_ - -#ifndef _NTSCSI_USER_MODE_ - #include "srb.h" -#endif // !defined _NTSCSI_USER_MODE_ - - -#pragma warning(push) -#pragma warning(disable:4200) // array[0] is not a warning for this file -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int - -#pragma pack(push, _scsi_) -// begin_ntminitape - -// begin_storport - -// -// Command Descriptor Block. Passed by SCSI controller chip over the SCSI bus -// - -#pragma pack(push, cdb, 1) -typedef union _CDB { - - // - // Generic 6-Byte CDB - // - - struct _CDB6GENERIC { - UCHAR OperationCode; - UCHAR Immediate : 1; - UCHAR CommandUniqueBits : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR CommandUniqueBytes[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } CDB6GENERIC; - - // - // Standard 6-byte CDB - // - - struct _CDB6READWRITE { - UCHAR OperationCode; // 0x08, 0x0A - SCSIOP_READ, SCSIOP_WRITE - UCHAR LogicalBlockMsb1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockMsb0; - UCHAR LogicalBlockLsb; - UCHAR TransferBlocks; - UCHAR Control; - } CDB6READWRITE; - - // - // SCSI-1 Inquiry CDB - // - - struct _CDB6INQUIRY { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode; - UCHAR IReserved; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY; - - // - // SCSI-3 Inquiry CDB - // - - struct _CDB6INQUIRY3 { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR EnableVitalProductData : 1; - UCHAR CommandSupportData : 1; - UCHAR Reserved1 : 6; - UCHAR PageCode; - UCHAR Reserved2; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY3; - - struct _CDB6VERIFY { - UCHAR OperationCode; // 0x13 - SCSIOP_VERIFY - UCHAR Fixed : 1; - UCHAR ByteCompare : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR VerificationLength[3]; - UCHAR Control; - } CDB6VERIFY; - - // - // SCSI Format CDB - // - - struct _CDB6FORMAT { - UCHAR OperationCode; // 0x04 - SCSIOP_FORMAT_UNIT - UCHAR FormatControl : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR FReserved1; - UCHAR InterleaveMsb; - UCHAR InterleaveLsb; - UCHAR FReserved2; - } CDB6FORMAT; - - // - // Standard 10-byte CDB - - struct _CDB10 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved2; - UCHAR TransferBlocksMsb; - UCHAR TransferBlocksLsb; - UCHAR Control; - } CDB10; - - // - // Standard 12-byte CDB - // - - struct _CDB12 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB12; - - - - // - // Standard 16-byte CDB - // - - struct _CDB16 { - UCHAR OperationCode; - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR Protection : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB16; - - - // - // CD Rom Audio CDBs - // - - struct _PAUSE_RESUME { - UCHAR OperationCode; // 0x4B - SCSIOP_PAUSE_RESUME - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[6]; - UCHAR Action; - UCHAR Control; - } PAUSE_RESUME; - - // - // Read Table of Contents - // - - struct _READ_TOC { - UCHAR OperationCode; // 0x43 - SCSIOP_READ_TOC - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Format2 : 4; - UCHAR Reserved2 : 4; - UCHAR Reserved3[3]; - UCHAR StartingTrack; - UCHAR AllocationLength[2]; - UCHAR Control : 6; - UCHAR Format : 2; - } READ_TOC; - - struct _READ_DISK_INFORMATION { - UCHAR OperationCode; // 0x51 - SCSIOP_READ_DISC_INFORMATION - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_DISK_INFORMATION, READ_DISC_INFORMATION; - - struct _READ_TRACK_INFORMATION { - UCHAR OperationCode; // 0x52 - SCSIOP_READ_TRACK_INFORMATION - UCHAR Track : 2; - UCHAR Reserved4 : 3; - UCHAR Lun : 3; - UCHAR BlockAddress[4]; // or Track Number - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_TRACK_INFORMATION; - - struct _RESERVE_TRACK_RZONE { - UCHAR OperationCode; // 0x53 - SCSIOP_RESERVE_TRACK_RZONE - UCHAR Reserved1[4]; - UCHAR ReservationSize[4]; - UCHAR Control; - } RESERVE_TRACK_RZONE; - - struct _SEND_OPC_INFORMATION { - UCHAR OperationCode; // 0x54 - SCSIOP_SEND_OPC_INFORMATION - UCHAR DoOpc : 1; // perform OPC - UCHAR Reserved1 : 7; - UCHAR Exclude0 : 1; // exclude layer 0 - UCHAR Exclude1 : 1; // exclude layer 1 - UCHAR Reserved2 : 6; - UCHAR Reserved3[4]; - UCHAR ParameterListLength[2]; - UCHAR Reserved4; - } SEND_OPC_INFORMATION; - - struct _REPAIR_TRACK { - UCHAR OperationCode; // 0x58 - SCSIOP_REPAIR_TRACK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[2]; - UCHAR TrackNumber[2]; - UCHAR Reserved3[3]; - UCHAR Control; - } REPAIR_TRACK; - - struct _CLOSE_TRACK { - UCHAR OperationCode; // 0x5B - SCSIOP_CLOSE_TRACK_SESSION - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Track : 1; - UCHAR Session : 1; - UCHAR Reserved2 : 6; - UCHAR Reserved3; - UCHAR TrackNumber[2]; - UCHAR Reserved4[3]; - UCHAR Control; - } CLOSE_TRACK; - - struct _READ_BUFFER_CAPACITY { - UCHAR OperationCode; // 0x5C - SCSIOP_READ_BUFFER_CAPACITY - UCHAR BlockInfo : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_BUFFER_CAPACITY; - - struct _SEND_CUE_SHEET { - UCHAR OperationCode; // 0x5D - SCSIOP_SEND_CUE_SHEET - UCHAR Reserved[5]; - UCHAR CueSheetSize[3]; - UCHAR Control; - } SEND_CUE_SHEET; - - struct _READ_HEADER { - UCHAR OperationCode; // 0x44 - SCSIOP_READ_HEADER - UCHAR Reserved1 : 1; - UCHAR Msf : 1; - UCHAR Reserved2 : 3; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_HEADER; - - struct _PLAY_AUDIO { - UCHAR OperationCode; // 0x45 - SCSIOP_PLAY_AUDIO - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingBlockAddress[4]; - UCHAR Reserved2; - UCHAR PlayLength[2]; - UCHAR Control; - } PLAY_AUDIO; - - struct _PLAY_AUDIO_MSF { - UCHAR OperationCode; // 0x47 - SCSIOP_PLAY_AUDIO_MSF - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Control; - } PLAY_AUDIO_MSF; - - struct _BLANK_MEDIA { - UCHAR OperationCode; // 0xA1 - SCSIOP_BLANK - UCHAR BlankType : 3; - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 3; - UCHAR AddressOrTrack[4]; - UCHAR Reserved3[5]; - UCHAR Control; - } BLANK_MEDIA; - - struct _PLAY_CD { - UCHAR OperationCode; // 0xBC - SCSIOP_PLAY_CD - UCHAR Reserved1 : 1; - UCHAR CMSF : 1; // LBA = 0, MSF = 1 - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - - union { - struct _LBA { - UCHAR StartingBlockAddress[4]; - UCHAR PlayLength[4]; - } LBA; - - struct _MSF { - UCHAR Reserved1; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved2; - } MSF; - }; - - UCHAR Audio : 1; - UCHAR Composite : 1; - UCHAR Port1 : 1; - UCHAR Port2 : 1; - UCHAR Reserved2 : 3; - UCHAR Speed : 1; - UCHAR Control; - } PLAY_CD; - - struct _SCAN_CD { - UCHAR OperationCode; // 0xBA - SCSIOP_SCAN_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 3; - UCHAR Direct : 1; - UCHAR Lun : 3; - UCHAR StartingAddress[4]; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 6; - UCHAR Type : 2; - UCHAR Reserved4; - UCHAR Control; - } SCAN_CD; - - struct _STOP_PLAY_SCAN { - UCHAR OperationCode; // 0x4E - SCSIOP_STOP_PLAY_SCAN - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[7]; - UCHAR Control; - } STOP_PLAY_SCAN; - - - // - // Read SubChannel Data - // - - struct _SUBCHANNEL { - UCHAR OperationCode; // 0x42 - SCSIOP_READ_SUB_CHANNEL - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2 : 6; - UCHAR SubQ : 1; - UCHAR Reserved3 : 1; - UCHAR Format; - UCHAR Reserved4[2]; - UCHAR TrackNumber; - UCHAR AllocationLength[2]; - UCHAR Control; - } SUBCHANNEL; - - // - // Read CD. Used by Atapi for raw sector reads. - // - - struct _READ_CD { - UCHAR OperationCode; // 0xBE - SCSIOP_READ_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved0 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR StartingLBA[4]; - UCHAR TransferBlocks[3]; - UCHAR Reserved2 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved3 : 5; - UCHAR Control; - } READ_CD; - - struct _READ_CD_MSF { - UCHAR OperationCode; // 0xB9 - SCSIOP_READ_CD_MSF - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved4 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved5 : 5; - UCHAR Control; - } READ_CD_MSF; - - // - // Plextor Read CD-DA - // - - struct _PLXTR_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0 : 5; - UCHAR LogicalUnitNumber :3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR TransferBlockByte2; - UCHAR TransferBlockByte3; - UCHAR SubCode; - UCHAR Control; - } PLXTR_READ_CDDA; - - // - // NEC Read CD-DA - // - - struct _NEC_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved1; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR Control; - } NEC_READ_CDDA; - - // - // Mode sense - // - - struct _MODE_SENSE { - UCHAR OperationCode; // 0x1A - SCSIOP_MODE_SENSE - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3; - UCHAR AllocationLength; - UCHAR Control; - } MODE_SENSE; - - struct _MODE_SENSE10 { - UCHAR OperationCode; // 0x5A - SCSIOP_MODE_SENSE10 - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3[4]; - UCHAR AllocationLength[2]; - UCHAR Control; - } MODE_SENSE10; - - // - // Mode select - // - - struct _MODE_SELECT { - UCHAR OperationCode; // 0x15 - SCSIOP_MODE_SELECT - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR ParameterListLength; - UCHAR Control; - } MODE_SELECT; - - struct _MODE_SELECT10 { - UCHAR OperationCode; // 0x55 - SCSIOP_MODE_SELECT10 - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[5]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } MODE_SELECT10; - - struct _LOCATE { - UCHAR OperationCode; // 0x2B - SCSIOP_LOCATE - UCHAR Immediate : 1; - UCHAR CPBit : 1; - UCHAR BTBit : 1; - UCHAR Reserved1 : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved4; - UCHAR Partition; - UCHAR Control; - } LOCATE; - - struct _LOGSENSE { - UCHAR OperationCode; // 0x4D - SCSIOP_LOG_SENSE - UCHAR SPBit : 1; - UCHAR PPCBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR PCBit : 2; - UCHAR Reserved2; - UCHAR Reserved3; - UCHAR ParameterPointer[2]; - UCHAR AllocationLength[2]; - UCHAR Control; - } LOGSENSE; - - struct _LOGSELECT { - UCHAR OperationCode; // 0x4C - SCSIOP_LOG_SELECT - UCHAR SPBit : 1; - UCHAR PCRBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved : 6; - UCHAR PCBit : 2; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } LOGSELECT; - - struct _PRINT { - UCHAR OperationCode; // 0x0A - SCSIOP_PRINT - UCHAR Reserved : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } PRINT; - - struct _SEEK { - UCHAR OperationCode; // 0x2B - SCSIOP_SEEK - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved2[3]; - UCHAR Control; - } SEEK; - - struct _ERASE { - UCHAR OperationCode; // 0x19 - SCSIOP_ERASE - UCHAR Long : 1; - UCHAR Immediate : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[3]; - UCHAR Control; - } ERASE; - - struct _START_STOP { - UCHAR OperationCode; // 0x1B - SCSIOP_START_STOP_UNIT - UCHAR Immediate: 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } START_STOP; - - struct _MEDIA_REMOVAL { - UCHAR OperationCode; // 0x1E - SCSIOP_MEDIUM_REMOVAL - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - - UCHAR Prevent : 1; - UCHAR Persistant : 1; - UCHAR Reserved3 : 6; - - UCHAR Control; - } MEDIA_REMOVAL; - - // - // Tape CDBs - // - - struct _SEEK_BLOCK { - UCHAR OperationCode; // 0x0C - SCSIOP_SEEK_BLOCK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR BlockAddress[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } SEEK_BLOCK; - - struct _REQUEST_BLOCK_ADDRESS { - UCHAR OperationCode; // 0x02 - SCSIOP_REQUEST_BLOCK_ADDR - UCHAR Reserved1[3]; - UCHAR AllocationLength; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } REQUEST_BLOCK_ADDRESS; - - struct _PARTITION { - UCHAR OperationCode; // 0x0D - SCSIOP_PARTITION - UCHAR Immediate : 1; - UCHAR Sel: 1; - UCHAR PartitionSelect : 6; - UCHAR Reserved1[3]; - UCHAR Control; - } PARTITION; - - struct _WRITE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Immediate : 1; - UCHAR WriteSetMarks: 1; - UCHAR Reserved : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } WRITE_TAPE_MARKS; - - struct _SPACE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Code : 3; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR NumMarksMSB ; - UCHAR NumMarks; - UCHAR NumMarksLSB; - union { - UCHAR value; - struct { - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } Fields; - } Byte6; - } SPACE_TAPE_MARKS; - - // - // Read tape position - // - - struct _READ_POSITION { - UCHAR Operation; // 0x43 - SCSIOP_READ_POSITION - UCHAR BlockType:1; - UCHAR Reserved1:4; - UCHAR Lun:3; - UCHAR Reserved2[7]; - UCHAR Control; - } READ_POSITION; - - // - // ReadWrite for Tape - // - - struct _CDB6READWRITETAPE { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR VendorSpecific : 5; - UCHAR Reserved : 3; - UCHAR TransferLenMSB; - UCHAR TransferLen; - UCHAR TransferLenLSB; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved1 : 4; - UCHAR VendorUnique : 2; - } CDB6READWRITETAPE; - - // - // Medium changer CDB's - // - - struct _INIT_ELEMENT_STATUS { - UCHAR OperationCode; // 0x07 - SCSIOP_INIT_ELEMENT_STATUS - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNubmer : 3; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 7; - UCHAR NoBarCode : 1; - } INIT_ELEMENT_STATUS; - - struct _INITIALIZE_ELEMENT_RANGE { - UCHAR OperationCode; // 0xE7 - SCSIOP_INIT_ELEMENT_RANGE - UCHAR Range : 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNubmer : 3; - UCHAR FirstElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved3; - UCHAR Reserved4 : 7; - UCHAR NoBarCode : 1; - } INITIALIZE_ELEMENT_RANGE; - - struct _POSITION_TO_ELEMENT { - UCHAR OperationCode; // 0x2B - SCSIOP_POSITION_TO_ELEMENT - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } POSITION_TO_ELEMENT; - - struct _MOVE_MEDIUM { - UCHAR OperationCode; // 0xA5 - SCSIOP_MOVE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } MOVE_MEDIUM; - - struct _EXCHANGE_MEDIUM { - UCHAR OperationCode; // 0xA6 - SCSIOP_EXCHANGE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR Destination1ElementAddress[2]; - UCHAR Destination2ElementAddress[2]; - UCHAR Flip1 : 1; - UCHAR Flip2 : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } EXCHANGE_MEDIUM; - - struct _READ_ELEMENT_STATUS { - UCHAR OperationCode; // 0xB8 - SCSIOP_READ_ELEMENT_STATUS - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } READ_ELEMENT_STATUS; - - struct _SEND_VOLUME_TAG { - UCHAR OperationCode; // 0xB6 - SCSIOP_SEND_VOLUME_TAG - UCHAR ElementType : 4; - UCHAR Reserved1 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR Reserved2; - UCHAR ActionCode : 5; - UCHAR Reserved3 : 3; - UCHAR Reserved4[2]; - UCHAR ParameterListLength[2]; - UCHAR Reserved5; - UCHAR Control; - } SEND_VOLUME_TAG; - - struct _REQUEST_VOLUME_ELEMENT_ADDRESS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } REQUEST_VOLUME_ELEMENT_ADDRESS; - - // - // Atapi 2.5 Changer 12-byte CDBs - // - - struct _LOAD_UNLOAD { - UCHAR OperationCode; // 0xA6 - SCSIOP_LOAD_UNLOAD_SLOT - UCHAR Immediate : 1; - UCHAR Reserved1 : 4; - UCHAR Lun : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3: 6; - UCHAR Reserved4[3]; - UCHAR Slot; - UCHAR Reserved5[3]; - } LOAD_UNLOAD; - - struct _MECH_STATUS { - UCHAR OperationCode; // 0xBD - SCSIOP_MECHANISM_STATUS - UCHAR Reserved : 5; - UCHAR Lun : 3; - UCHAR Reserved1[6]; - UCHAR AllocationLength[2]; - UCHAR Reserved2[1]; - UCHAR Control; - } MECH_STATUS; - - // - // C/DVD 0.9 CDBs - // - - struct _SYNCHRONIZE_CACHE10 { - - UCHAR OperationCode; // 0x35 - SCSIOP_SYNCHRONIZE_CACHE - - UCHAR RelAddr : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 3; - UCHAR Lun : 3; - - UCHAR LogicalBlockAddress[4]; // Unused - set to zero - UCHAR Reserved2; - UCHAR BlockCount[2]; // Unused - set to zero - UCHAR Control; - } SYNCHRONIZE_CACHE10; - - struct _GET_EVENT_STATUS_NOTIFICATION { - UCHAR OperationCode; // 0x4A - SCSIOP_GET_EVENT_STATUS_NOTIFICATION - - UCHAR Immediate : 1; - UCHAR Reserved : 4; - UCHAR Lun : 3; - - UCHAR Reserved2[2]; - UCHAR NotificationClassRequest; - UCHAR Reserved3[2]; - UCHAR EventListLength[2]; - - UCHAR Control; - } GET_EVENT_STATUS_NOTIFICATION; - - struct _GET_PERFORMANCE { - UCHAR OperationCode; // 0xAC - SCSIOP_GET_PERFORMANCE - UCHAR Except : 2; - UCHAR Write : 1; - UCHAR Tolerance : 2; - UCHAR Reserved0 : 3; - UCHAR StartingLBA[4]; - UCHAR Reserved1[2]; - UCHAR MaximumNumberOfDescriptors[2]; - UCHAR Type; - UCHAR Control; - } GET_PERFORMANCE; - - struct _READ_DVD_STRUCTURE { - UCHAR OperationCode; // 0xAD - SCSIOP_READ_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR RMDBlockNumber[4]; - UCHAR LayerNumber; - UCHAR Format; - UCHAR AllocationLength[2]; - UCHAR Reserved3 : 6; - UCHAR AGID : 2; - UCHAR Control; - } READ_DVD_STRUCTURE; - - struct _SET_STREAMING { - UCHAR OperationCode; // 0xB6 - SCSIOP_SET_STREAMING - UCHAR Reserved[8]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } SET_STREAMING; - - struct _SEND_DVD_STRUCTURE { - UCHAR OperationCode; // 0xBF - SCSIOP_SEND_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR Format; - UCHAR ParameterListLength[2]; - UCHAR Reserved3; - UCHAR Control; - } SEND_DVD_STRUCTURE; - - struct _SEND_KEY { - UCHAR OperationCode; // 0xA3 - SCSIOP_SEND_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[6]; - UCHAR ParameterListLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } SEND_KEY; - - struct _REPORT_KEY { - UCHAR OperationCode; // 0xA4 - SCSIOP_REPORT_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; // for title key - UCHAR Reserved2[2]; - UCHAR AllocationLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } REPORT_KEY; - - struct _SET_READ_AHEAD { - UCHAR OperationCode; // 0xA7 - SCSIOP_SET_READ_AHEAD - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR TriggerLBA[4]; - UCHAR ReadAheadLBA[4]; - UCHAR Reserved2; - UCHAR Control; - } SET_READ_AHEAD; - - struct _READ_FORMATTED_CAPACITIES { - UCHAR OperationCode; // 0x23 - SCSIOP_READ_FORMATTED_CAPACITY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_FORMATTED_CAPACITIES; - - // - // SCSI-3 - // - - struct _REPORT_LUNS { - UCHAR OperationCode; // 0xA0 - SCSIOP_REPORT_LUNS - UCHAR Reserved1[5]; - UCHAR AllocationLength[4]; - UCHAR Reserved2[1]; - UCHAR Control; - } REPORT_LUNS; - - struct _PERSISTENT_RESERVE_IN { - UCHAR OperationCode; // 0x5E - SCSIOP_PERSISTENT_RESERVE_IN - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } PERSISTENT_RESERVE_IN; - - struct _PERSISTENT_RESERVE_OUT { - UCHAR OperationCode; // 0x5F - SCSIOP_PERSISTENT_RESERVE_OUT - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; // 0x18 - UCHAR Control; - } PERSISTENT_RESERVE_OUT; - - // - // MMC / SFF-8090 commands - // - - struct _GET_CONFIGURATION { - UCHAR OperationCode; // 0x46 - SCSIOP_GET_CONFIGURATION - UCHAR RequestType : 2; // SCSI_GET_CONFIGURATION_REQUEST_TYPE_* - UCHAR Reserved1 : 6; // includes obsolete LUN field - UCHAR StartingFeature[2]; - UCHAR Reserved2[3]; - UCHAR AllocationLength[2]; - UCHAR Control; - } GET_CONFIGURATION; - - struct _SET_CD_SPEED { - UCHAR OperationCode; // 0xB8 - SCSIOP_SET_CD_SPEED - union { - UCHAR Reserved1; - struct { - UCHAR RotationControl : 2; - UCHAR Reserved3 : 6; - }; - }; - UCHAR ReadSpeed[2]; // 1x == (75 * 2352) - UCHAR WriteSpeed[2]; // 1x == (75 * 2352) - UCHAR Reserved2[5]; - UCHAR Control; - } SET_CD_SPEED; - - struct _READ12 { - UCHAR OperationCode; // 0xA8 - SCSIOP_READ12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ12; - - struct _WRITE12 { - UCHAR OperationCode; // 0xAA - SCSIOP_WRITE12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR EBP : 1; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE12; - - // - // 16-byte CDBs - // - - struct _READ16 { - UCHAR OperationCode; // 0x88 - SCSIOP_READ16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR ReadProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ16; - - struct _WRITE16 { - UCHAR OperationCode; // 0x8A - SCSIOP_WRITE16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR WriteProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE16; - - struct _VERIFY16 { - UCHAR OperationCode; // 0x8F - SCSIOP_VERIFY16 - UCHAR Reserved1 : 1; - UCHAR ByteCheck : 1; - UCHAR BlockVerify : 1; - UCHAR Reserved2 : 1; - UCHAR DisablePageOut : 1; - UCHAR VerifyProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR VerificationLength[4]; - UCHAR Reserved3 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } VERIFY16; - - struct _SYNCHRONIZE_CACHE16 { - UCHAR OperationCode; // 0x91 - SCSIOP_SYNCHRONIZE_CACHE16 - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 6; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR Reserved3; - UCHAR Control; - } SYNCHRONIZE_CACHE16; - - struct _READ_CAPACITY16 { - UCHAR OperationCode; // 0x9E - SCSIOP_READ_CAPACITY16 - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR PMI : 1; - UCHAR Reserved2 : 7; - UCHAR Control; - } READ_CAPACITY16; - - ULONG AsUlong[4]; - UCHAR AsByte[16]; - -} CDB, *PCDB; -#pragma pack(pop, cdb) - -//////////////////////////////////////////////////////////////////////////////// -// -// GET_EVENT_STATUS_NOTIFICATION -// - - -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_MASK 0x02 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_MASK 0x04 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_MASK 0x08 -#define NOTIFICATION_MEDIA_STATUS_CLASS_MASK 0x10 -#define NOTIFICATION_MULTI_HOST_CLASS_MASK 0x20 -#define NOTIFICATION_DEVICE_BUSY_CLASS_MASK 0x40 - - -#define NOTIFICATION_NO_CLASS_EVENTS 0x0 -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_EVENTS 0x1 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_EVENTS 0x2 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_EVENTS 0x3 -#define NOTIFICATION_MEDIA_STATUS_CLASS_EVENTS 0x4 -#define NOTIFICATION_MULTI_HOST_CLASS_EVENTS 0x5 -#define NOTIFICATION_DEVICE_BUSY_CLASS_EVENTS 0x6 - -#pragma pack(push, not_header, 1) -typedef struct _NOTIFICATION_EVENT_STATUS_HEADER { - UCHAR EventDataLength[2]; - - UCHAR NotificationClass : 3; - UCHAR Reserved : 4; - UCHAR NEA : 1; - - UCHAR SupportedEventClasses; -#if !defined(__midl) - UCHAR ClassEventData[0]; -#endif -} NOTIFICATION_EVENT_STATUS_HEADER, *PNOTIFICATION_EVENT_STATUS_HEADER; -#pragma pack(pop, not_header) - -#define NOTIFICATION_OPERATIONAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_REQUESTED 0x1 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_OCCURRED 0x2 - -#define NOTIFICATION_OPERATIONAL_STATUS_AVAILABLE 0x0 -#define NOTIFICATION_OPERATIONAL_STATUS_TEMPORARY_BUSY 0x1 -#define NOTIFICATION_OPERATIONAL_STATUS_EXTENDED_BUSY 0x2 - -#define NOTIFICATION_OPERATIONAL_OPCODE_NONE 0x0 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_CHANGE 0x1 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_ADDED 0x2 -#define NOTIFICATION_OPERATIONAL_OPCODE_UNIT_RESET 0x3 -#define NOTIFICATION_OPERATIONAL_OPCODE_FIRMWARE_CHANGED 0x4 -#define NOTIFICATION_OPERATIONAL_OPCODE_INQUIRY_CHANGED 0x5 - -// -// Class event data may be one (or none) of the following: -// - -#pragma pack(push, not_op, 1) -typedef struct _NOTIFICATION_OPERATIONAL_STATUS { // event class == 0x1 - UCHAR OperationalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR OperationalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Operation[2]; -} NOTIFICATION_OPERATIONAL_STATUS, *PNOTIFICATION_OPERATIONAL_STATUS; -#pragma pack(pop, not_op) - - -#define NOTIFICATION_POWER_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_POWER_EVENT_CHANGE_SUCCEEDED 0x1 -#define NOTIFICATION_POWER_EVENT_CHANGE_FAILED 0x2 - -#define NOTIFICATION_POWER_STATUS_ACTIVE 0x1 -#define NOTIFICATION_POWER_STATUS_IDLE 0x2 -#define NOTIFICATION_POWER_STATUS_STANDBY 0x3 -#define NOTIFICATION_POWER_STATUS_SLEEP 0x4 - -#pragma pack(push, not_power, 1) -typedef struct _NOTIFICATION_POWER_STATUS { // event class == 0x2 - UCHAR PowerEvent : 4; - UCHAR Reserved : 4; - UCHAR PowerStatus; - UCHAR Reserved2[2]; -} NOTIFICATION_POWER_STATUS, *PNOTIFICATION_POWER_STATUS; -#pragma pack(pop, not_power) - -#define NOTIFICATION_MEDIA_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_DOWN 0x1 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_UP 0x2 -#define NOTIFICATION_EXTERNAL_EVENT_EXTERNAL 0x3 // respond with GET_CONFIGURATION? - -#define NOTIFICATION_EXTERNAL_STATUS_READY 0x0 -#define NOTIFICATION_EXTERNAL_STATUS_PREVENT 0x1 - -#define NOTIFICATION_EXTERNAL_REQUEST_NONE 0x0000 -#define NOTIFICATION_EXTERNAL_REQUEST_QUEUE_OVERRUN 0x0001 -#define NOTIFICATION_EXTERNAL_REQUEST_PLAY 0x0101 -#define NOTIFICATION_EXTERNAL_REQUEST_REWIND_BACK 0x0102 -#define NOTIFICATION_EXTERNAL_REQUEST_FAST_FORWARD 0x0103 -#define NOTIFICATION_EXTERNAL_REQUEST_PAUSE 0x0104 -#define NOTIFICATION_EXTERNAL_REQUEST_STOP 0x0106 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_LOW 0x0200 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_HIGH 0x02ff - -#pragma pack(push, not_extern, 1) -typedef struct _NOTIFICATION_EXTERNAL_STATUS { // event class == 0x3 - UCHAR ExternalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR ExternalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Request[2]; -} NOTIFICATION_EXTERNAL_STATUS, *PNOTIFICATION_EXTERNAL_STATUS; -#pragma pack(pop, not_extern) - -#define NOTIFICATION_MEDIA_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MEDIA_EVENT_EJECT_REQUEST 0x1 -#define NOTIFICATION_MEDIA_EVENT_NEW_MEDIA 0x2 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_REMOVAL 0x3 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_CHANGE 0x4 - -#pragma pack(push, not_media, 1) -typedef struct _NOTIFICATION_MEDIA_STATUS { // event class == 0x4 - UCHAR MediaEvent : 4; - UCHAR Reserved : 4; - - union { - UCHAR PowerStatus; // OBSOLETE -- was improperly named in NT5 headers - UCHAR MediaStatus; // Use this for currently reserved fields - struct { - UCHAR DoorTrayOpen : 1; - UCHAR MediaPresent : 1; - UCHAR ReservedX : 6; // do not reference this directly! - }; - }; - UCHAR StartSlot; - UCHAR EndSlot; -} NOTIFICATION_MEDIA_STATUS, *PNOTIFICATION_MEDIA_STATUS; -#pragma pack(pop, not_media) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_REQUEST 0x1 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_GRANT 0x2 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_RELEASE 0x3 - -#define NOTIFICATION_MULTI_HOST_STATUS_READY 0x0 -#define NOTIFICATION_MULTI_HOST_STATUS_PREVENT 0x1 - -#define NOTIFICATION_MULTI_HOST_PRIORITY_NO_REQUESTS 0x0 -#define NOTIFICATION_MULTI_HOST_PRIORITY_LOW 0x1 -#define NOTIFICATION_MULTI_HOST_PRIORITY_MEDIUM 0x2 -#define NOTIFICATION_MULTI_HOST_PRIORITY_HIGH 0x3 - -#pragma pack(push, not_multi, 1) -typedef struct _NOTIFICATION_MULTI_HOST_STATUS { // event class == 0x5 - UCHAR MultiHostEvent : 4; - UCHAR Reserved1 : 4; - UCHAR MultiHostStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Priority[2]; -} NOTIFICATION_MULTI_HOST_STATUS, *PNOTIFICATION_MULTI_HOST_STATUS; -#pragma pack(pop, not_multi) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_BUSY_EVENT_BUSY 0x1 - -#define NOTIFICATION_BUSY_STATUS_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_STATUS_POWER 0x1 -#define NOTIFICATION_BUSY_STATUS_IMMEDIATE 0x2 -#define NOTIFICATION_BUSY_STATUS_DEFERRED 0x3 - -#pragma pack(push, not_busy, 1) -typedef struct _NOTIFICATION_BUSY_STATUS { // event class == 0x6 - UCHAR DeviceBusyEvent : 4; - UCHAR Reserved : 4; - - UCHAR DeviceBusyStatus; - UCHAR Time[2]; -} NOTIFICATION_BUSY_STATUS, *PNOTIFICATION_BUSY_STATUS; -#pragma pack(pop, not_busy) - -//////////////////////////////////////////////////////////////////////////////// - -// -// Read DVD Structure Definitions and Constants -// - -#define DVD_FORMAT_LEAD_IN 0x00 -#define DVD_FORMAT_COPYRIGHT 0x01 -#define DVD_FORMAT_DISK_KEY 0x02 -#define DVD_FORMAT_BCA 0x03 -#define DVD_FORMAT_MANUFACTURING 0x04 - -#pragma pack(push, dvd_struct_header, 1) -typedef struct _READ_DVD_STRUCTURES_HEADER { - UCHAR Length[2]; - UCHAR Reserved[2]; - -#if !defined(__midl) - UCHAR Data[0]; -#endif -} READ_DVD_STRUCTURES_HEADER, *PREAD_DVD_STRUCTURES_HEADER; -#pragma pack(pop, dvd_struct_header) - -// -// DiskKey, BCA & Manufacturer information will provide byte arrays as their -// data. -// - -// -// CDVD 0.9 Send & Report Key Definitions and Structures -// - -#define DVD_REPORT_AGID 0x00 -#define DVD_CHALLENGE_KEY 0x01 -#define DVD_KEY_1 0x02 -#define DVD_KEY_2 0x03 -#define DVD_TITLE_KEY 0x04 -#define DVD_REPORT_ASF 0x05 -#define DVD_INVALIDATE_AGID 0x3F - -#pragma pack(push, dvdstuff, 1) -typedef struct _CDVD_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved[2]; -#if !defined(__midl) - UCHAR Data[0]; -#endif -} CDVD_KEY_HEADER, *PCDVD_KEY_HEADER; - -typedef struct _CDVD_REPORT_AGID_DATA { - UCHAR Reserved1[3]; - UCHAR Reserved2 : 6; - UCHAR AGID : 2; -} CDVD_REPORT_AGID_DATA, *PCDVD_REPORT_AGID_DATA; - -typedef struct _CDVD_CHALLENGE_KEY_DATA { - UCHAR ChallengeKeyValue[10]; - UCHAR Reserved[2]; -} CDVD_CHALLENGE_KEY_DATA, *PCDVD_CHALLENGE_KEY_DATA; - -typedef struct _CDVD_KEY_DATA { - UCHAR Key[5]; - UCHAR Reserved[3]; -} CDVD_KEY_DATA, *PCDVD_KEY_DATA; - -typedef struct _CDVD_REPORT_ASF_DATA { - UCHAR Reserved1[3]; - UCHAR Success : 1; - UCHAR Reserved2 : 7; -} CDVD_REPORT_ASF_DATA, *PCDVD_REPORT_ASF_DATA; - -typedef struct _CDVD_TITLE_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved1[1]; - UCHAR Reserved2 : 3; - UCHAR CGMS : 2; - UCHAR CP_SEC : 1; - UCHAR CPM : 1; - UCHAR Zero : 1; - CDVD_KEY_DATA TitleKey; -} CDVD_TITLE_KEY_HEADER, *PCDVD_TITLE_KEY_HEADER; -#pragma pack(pop, dvdstuff) - - -// -// Format Unit Data definitions and structures -// - -#pragma pack(push, format_unit, 1) -typedef struct _FORMAT_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR FormatSubType : 2; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMAT_DESCRIPTOR, *PFORMAT_DESCRIPTOR; - -typedef struct _FORMAT_LIST_HEADER { - UCHAR Reserved; - UCHAR VendorSpecific : 1; - UCHAR Immediate : 1; - UCHAR TryOut : 1; - UCHAR IP : 1; - UCHAR STPF : 1; - UCHAR DCRT : 1; - UCHAR DPRY : 1; - UCHAR FOV : 1; - UCHAR FormatDescriptorLength[2]; -#if !defined(__midl) - FORMAT_DESCRIPTOR Descriptors[0]; -#endif -} FORMAT_LIST_HEADER, *PFORMAT_LIST_HEADER; -#pragma pack(pop, format_unit) - -// -// Read Formatted Capacity Data - returned in Big Endian Format -// - - -#pragma pack(push, formatted_capacity, 1) -typedef struct _FORMATTED_CAPACITY_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR Maximum : 1; - UCHAR Valid : 1; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMATTED_CAPACITY_DESCRIPTOR, *PFORMATTED_CAPACITY_DESCRIPTOR; - -typedef struct _FORMATTED_CAPACITY_LIST { - UCHAR Reserved[3]; - UCHAR CapacityListLength; -#if !defined(__midl) - FORMATTED_CAPACITY_DESCRIPTOR Descriptors[0]; -#endif -} FORMATTED_CAPACITY_LIST, *PFORMATTED_CAPACITY_LIST; -#pragma pack(pop, formatted_capacity) - -// -// BLANK command blanking type codes -// - -#define BLANK_FULL 0x0 -#define BLANK_MINIMAL 0x1 -#define BLANK_TRACK 0x2 -#define BLANK_UNRESERVE_TRACK 0x3 -#define BLANK_TAIL 0x4 -#define BLANK_UNCLOSE_SESSION 0x5 -#define BLANK_SESSION 0x6 - -// -// PLAY_CD definitions and constants -// - -#define CD_EXPECTED_SECTOR_ANY 0x0 -#define CD_EXPECTED_SECTOR_CDDA 0x1 -#define CD_EXPECTED_SECTOR_MODE1 0x2 -#define CD_EXPECTED_SECTOR_MODE2 0x3 -#define CD_EXPECTED_SECTOR_MODE2_FORM1 0x4 -#define CD_EXPECTED_SECTOR_MODE2_FORM2 0x5 - -// -// Read Disk Information Definitions and Capabilities -// - -#define DISK_STATUS_EMPTY 0x00 -#define DISK_STATUS_INCOMPLETE 0x01 -#define DISK_STATUS_COMPLETE 0x02 -#define DISK_STATUS_OTHERS 0x03 - -#define LAST_SESSION_EMPTY 0x00 -#define LAST_SESSION_INCOMPLETE 0x01 -#define LAST_SESSION_RESERVED_DAMAGED 0x02 -#define LAST_SESSION_COMPLETE 0x03 - -#define DISK_TYPE_CDDA 0x00 -#define DISK_TYPE_CDI 0x10 -#define DISK_TYPE_XA 0x20 -#define DISK_TYPE_UNDEFINED 0xFF - -// -// Values for MrwStatus field. -// - -#define DISC_BGFORMAT_STATE_NONE 0x0 -#define DISC_BGFORMAT_STATE_INCOMPLETE 0x1 -#define DISC_BGFORMAT_STATE_RUNNING 0x2 -#define DISC_BGFORMAT_STATE_COMPLETE 0x3 - - -#pragma pack(push, discinfo, 1) -typedef struct _OPC_TABLE_ENTRY { - UCHAR Speed[2]; - UCHAR OPCValue[6]; -} OPC_TABLE_ENTRY, *POPC_TABLE_ENTRY; - -typedef struct _DISC_INFORMATION { - - UCHAR Length[2]; - UCHAR DiscStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - UCHAR FirstTrackNumber; - - UCHAR NumberOfSessionsLsb; - UCHAR LastSessionFirstTrackLsb; - UCHAR LastSessionLastTrackLsb; - UCHAR MrwStatus : 2; - UCHAR MrwDirtyBit : 1; - UCHAR Reserved2 : 2; - UCHAR URU : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiscType; - UCHAR NumberOfSessionsMsb; - UCHAR LastSessionFirstTrackMsb; - UCHAR LastSessionLastTrackMsb; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // HMSF - UCHAR LastPossibleLeadOutStartTime[4]; // HMSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; - OPC_TABLE_ENTRY OPCTable[ 1 ]; // can be many of these here.... - -} DISC_INFORMATION, *PDISC_INFORMATION; - -// TODO: Deprecate DISK_INFORMATION -//#if PRAGMA_DEPRECATED_DDK -//#pragma deprecated(_DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated( DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated(PDISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#endif - -typedef struct _DISK_INFORMATION { - UCHAR Length[2]; - - UCHAR DiskStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - - UCHAR FirstTrackNumber; - UCHAR NumberOfSessions; - UCHAR LastSessionFirstTrack; - UCHAR LastSessionLastTrack; - - UCHAR Reserved2 : 5; - UCHAR GEN : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiskType; - UCHAR Reserved3[3]; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // MSF - UCHAR LastPossibleStartTime[4]; // MSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; -#if !defined(__midl) - OPC_TABLE_ENTRY OPCTable[0]; -#endif -} DISK_INFORMATION, *PDISK_INFORMATION; -#pragma pack(pop, discinfo) - - -// -// Read Header definitions and structures -// -#pragma pack(push, cdheader, 1) -typedef struct _DATA_BLOCK_HEADER { - UCHAR DataMode; - UCHAR Reserved[4]; - union { - UCHAR LogicalBlockAddress[4]; - struct { - UCHAR Reserved; - UCHAR M; - UCHAR S; - UCHAR F; - } MSF; - }; -} DATA_BLOCK_HEADER, *PDATA_BLOCK_HEADER; -#pragma pack(pop, cdheader) - - -#define DATA_BLOCK_MODE0 0x0 -#define DATA_BLOCK_MODE1 0x1 -#define DATA_BLOCK_MODE2 0x2 - -// -// Read TOC Format Codes -// - -#define READ_TOC_FORMAT_TOC 0x00 -#define READ_TOC_FORMAT_SESSION 0x01 -#define READ_TOC_FORMAT_FULL_TOC 0x02 -#define READ_TOC_FORMAT_PMA 0x03 -#define READ_TOC_FORMAT_ATIP 0x04 - -// TODO: Deprecate TRACK_INFORMATION structure, use TRACK_INFORMATION2 instead -#pragma pack(push, track_info, 1) -typedef struct _TRACK_INFORMATION { - UCHAR Length[2]; - UCHAR TrackNumber; - UCHAR SessionNumber; - UCHAR Reserved1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved2 : 2; - UCHAR DataMode : 4; - UCHAR FP : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR RT : 1; - UCHAR NWA_V : 1; - UCHAR Reserved3 : 7; - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; -} TRACK_INFORMATION, *PTRACK_INFORMATION; - -// Second Revision Modifies: -// * Longer names for some fields -// * LSB to track/session number fields -// * LRA_V bit -// Second Revision Adds: -// * TrackSize -// * LastRecordedAddress -// * MSB to track/session -// * Two reserved bytes -// Total structure size increased by 12 (0x0C) bytes -typedef struct _TRACK_INFORMATION2 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - -} TRACK_INFORMATION2, *PTRACK_INFORMATION2; - -// Third Revision Adds -// * ReadCompatibilityLBA -// Total structure size increased by 4 bytes -typedef struct _TRACK_INFORMATION3 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - UCHAR ReadCompatibilityLba[4]; - -} TRACK_INFORMATION3, *PTRACK_INFORMATION3; - -#pragma pack(pop, track_info) - -#pragma pack(push, perf_descriptor, 1) -typedef struct _PERFORMANCE_DESCRIPTOR { - - UCHAR RandomAccess : 1; - UCHAR Exact : 1; - UCHAR RestoreDefaults : 1; - UCHAR WriteRotationControl : 2; - UCHAR Reserved1 : 3; - - UCHAR Reserved[3]; - UCHAR StartLba[4]; - UCHAR EndLba[4]; - UCHAR ReadSize[4]; - UCHAR ReadTime[4]; - UCHAR WriteSize[4]; - UCHAR WriteTime[4]; - -} PERFORMANCE_DESCRIPTOR, *PPERFORMANCE_DESCRIPTOR; -#pragma pack(pop, perf_descriptor) - -// -// Command Descriptor Block constants. -// - -#define CDB6GENERIC_LENGTH 6 -#define CDB10GENERIC_LENGTH 10 -#define CDB12GENERIC_LENGTH 12 - -#define SETBITON 1 -#define SETBITOFF 0 - -// -// Mode Sense/Select page constants. -// - -#define MODE_PAGE_VENDOR_SPECIFIC 0x00 -#define MODE_PAGE_ERROR_RECOVERY 0x01 -#define MODE_PAGE_DISCONNECT 0x02 -#define MODE_PAGE_FORMAT_DEVICE 0x03 // disk -#define MODE_PAGE_MRW 0x03 // cdrom -#define MODE_PAGE_RIGID_GEOMETRY 0x04 -#define MODE_PAGE_FLEXIBILE 0x05 // disk -#define MODE_PAGE_WRITE_PARAMETERS 0x05 // cdrom -#define MODE_PAGE_VERIFY_ERROR 0x07 -#define MODE_PAGE_CACHING 0x08 -#define MODE_PAGE_PERIPHERAL 0x09 -#define MODE_PAGE_CONTROL 0x0A -#define MODE_PAGE_MEDIUM_TYPES 0x0B -#define MODE_PAGE_NOTCH_PARTITION 0x0C -#define MODE_PAGE_CD_AUDIO_CONTROL 0x0E -#define MODE_PAGE_DATA_COMPRESS 0x0F -#define MODE_PAGE_DEVICE_CONFIG 0x10 -#define MODE_PAGE_XOR_CONTROL 0x10 // disk -#define MODE_PAGE_MEDIUM_PARTITION 0x11 -#define MODE_PAGE_ENCLOSURE_SERVICES_MANAGEMENT 0x14 -#define MODE_PAGE_EXTENDED 0x15 -#define MODE_PAGE_EXTENDED_DEVICE_SPECIFIC 0x16 -#define MODE_PAGE_CDVD_FEATURE_SET 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_LUN 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_PORT 0x19 -#define MODE_PAGE_POWER_CONDITION 0x1A -#define MODE_PAGE_LUN_MAPPING 0x1B -#define MODE_PAGE_FAULT_REPORTING 0x1C -#define MODE_PAGE_CDVD_INACTIVITY 0x1D // cdrom -#define MODE_PAGE_ELEMENT_ADDRESS 0x1D -#define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E -#define MODE_PAGE_DEVICE_CAPABILITIES 0x1F -#define MODE_PAGE_CAPABILITIES 0x2A // cdrom - -#define MODE_SENSE_RETURN_ALL 0x3f - -#define MODE_SENSE_CURRENT_VALUES 0x00 -#define MODE_SENSE_CHANGEABLE_VALUES 0x40 -#define MODE_SENSE_DEFAULT_VAULES 0x80 -#define MODE_SENSE_SAVED_VALUES 0xc0 - - -// -// SCSI CDB operation codes -// - -// 6-byte commands: -#define SCSIOP_TEST_UNIT_READY 0x00 -#define SCSIOP_REZERO_UNIT 0x01 -#define SCSIOP_REWIND 0x01 -#define SCSIOP_REQUEST_BLOCK_ADDR 0x02 -#define SCSIOP_REQUEST_SENSE 0x03 -#define SCSIOP_FORMAT_UNIT 0x04 -#define SCSIOP_READ_BLOCK_LIMITS 0x05 -#define SCSIOP_REASSIGN_BLOCKS 0x07 -#define SCSIOP_INIT_ELEMENT_STATUS 0x07 -#define SCSIOP_READ6 0x08 -#define SCSIOP_RECEIVE 0x08 -#define SCSIOP_WRITE6 0x0A -#define SCSIOP_PRINT 0x0A -#define SCSIOP_SEND 0x0A -#define SCSIOP_SEEK6 0x0B -#define SCSIOP_TRACK_SELECT 0x0B -#define SCSIOP_SLEW_PRINT 0x0B -#define SCSIOP_SET_CAPACITY 0x0B // tape -#define SCSIOP_SEEK_BLOCK 0x0C -#define SCSIOP_PARTITION 0x0D -#define SCSIOP_READ_REVERSE 0x0F -#define SCSIOP_WRITE_FILEMARKS 0x10 -#define SCSIOP_FLUSH_BUFFER 0x10 -#define SCSIOP_SPACE 0x11 -#define SCSIOP_INQUIRY 0x12 -#define SCSIOP_VERIFY6 0x13 -#define SCSIOP_RECOVER_BUF_DATA 0x14 -#define SCSIOP_MODE_SELECT 0x15 -#define SCSIOP_RESERVE_UNIT 0x16 -#define SCSIOP_RELEASE_UNIT 0x17 -#define SCSIOP_COPY 0x18 -#define SCSIOP_ERASE 0x19 -#define SCSIOP_MODE_SENSE 0x1A -#define SCSIOP_START_STOP_UNIT 0x1B -#define SCSIOP_STOP_PRINT 0x1B -#define SCSIOP_LOAD_UNLOAD 0x1B -#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C -#define SCSIOP_SEND_DIAGNOSTIC 0x1D -#define SCSIOP_MEDIUM_REMOVAL 0x1E - -// 10-byte commands -#define SCSIOP_READ_FORMATTED_CAPACITY 0x23 -#define SCSIOP_READ_CAPACITY 0x25 -#define SCSIOP_READ 0x28 -#define SCSIOP_WRITE 0x2A -#define SCSIOP_SEEK 0x2B -#define SCSIOP_LOCATE 0x2B -#define SCSIOP_POSITION_TO_ELEMENT 0x2B -#define SCSIOP_WRITE_VERIFY 0x2E -#define SCSIOP_VERIFY 0x2F -#define SCSIOP_SEARCH_DATA_HIGH 0x30 -#define SCSIOP_SEARCH_DATA_EQUAL 0x31 -#define SCSIOP_SEARCH_DATA_LOW 0x32 -#define SCSIOP_SET_LIMITS 0x33 -#define SCSIOP_READ_POSITION 0x34 -#define SCSIOP_SYNCHRONIZE_CACHE 0x35 -#define SCSIOP_COMPARE 0x39 -#define SCSIOP_COPY_COMPARE 0x3A -#define SCSIOP_WRITE_DATA_BUFF 0x3B -#define SCSIOP_READ_DATA_BUFF 0x3C -#define SCSIOP_WRITE_LONG 0x3F -#define SCSIOP_CHANGE_DEFINITION 0x40 -#define SCSIOP_WRITE_SAME 0x41 -#define SCSIOP_READ_SUB_CHANNEL 0x42 -#define SCSIOP_READ_TOC 0x43 -#define SCSIOP_READ_HEADER 0x44 -#define SCSIOP_REPORT_DENSITY_SUPPORT 0x44 // tape -#define SCSIOP_PLAY_AUDIO 0x45 -#define SCSIOP_GET_CONFIGURATION 0x46 -#define SCSIOP_PLAY_AUDIO_MSF 0x47 -#define SCSIOP_PLAY_TRACK_INDEX 0x48 -#define SCSIOP_PLAY_TRACK_RELATIVE 0x49 -#define SCSIOP_GET_EVENT_STATUS 0x4A -#define SCSIOP_PAUSE_RESUME 0x4B -#define SCSIOP_LOG_SELECT 0x4C -#define SCSIOP_LOG_SENSE 0x4D -#define SCSIOP_STOP_PLAY_SCAN 0x4E -#define SCSIOP_XDWRITE 0x50 -#define SCSIOP_XPWRITE 0x51 -#define SCSIOP_READ_DISK_INFORMATION 0x51 -#define SCSIOP_READ_DISC_INFORMATION 0x51 // proper use of disc over disk -#define SCSIOP_READ_TRACK_INFORMATION 0x52 -#define SCSIOP_XDWRITE_READ 0x53 -#define SCSIOP_RESERVE_TRACK_RZONE 0x53 -#define SCSIOP_SEND_OPC_INFORMATION 0x54 // optimum power calibration -#define SCSIOP_MODE_SELECT10 0x55 -#define SCSIOP_RESERVE_UNIT10 0x56 -#define SCSIOP_RESERVE_ELEMENT 0x56 -#define SCSIOP_RELEASE_UNIT10 0x57 -#define SCSIOP_RELEASE_ELEMENT 0x57 -#define SCSIOP_REPAIR_TRACK 0x58 -#define SCSIOP_MODE_SENSE10 0x5A -#define SCSIOP_CLOSE_TRACK_SESSION 0x5B -#define SCSIOP_READ_BUFFER_CAPACITY 0x5C -#define SCSIOP_SEND_CUE_SHEET 0x5D -#define SCSIOP_PERSISTENT_RESERVE_IN 0x5E -#define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F - -// 12-byte commands -#define SCSIOP_REPORT_LUNS 0xA0 -#define SCSIOP_BLANK 0xA1 -#define SCSIOP_ATA_PASSTHROUGH12 0xA1 -#define SCSIOP_SEND_EVENT 0xA2 -#define SCSIOP_SEND_KEY 0xA3 -#define SCSIOP_MAINTENANCE_IN 0xA3 -#define SCSIOP_REPORT_KEY 0xA4 -#define SCSIOP_MAINTENANCE_OUT 0xA4 -#define SCSIOP_MOVE_MEDIUM 0xA5 -#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6 -#define SCSIOP_EXCHANGE_MEDIUM 0xA6 -#define SCSIOP_SET_READ_AHEAD 0xA7 -#define SCSIOP_MOVE_MEDIUM_ATTACHED 0xA7 -#define SCSIOP_READ12 0xA8 -#define SCSIOP_GET_MESSAGE 0xA8 -#define SCSIOP_SERVICE_ACTION_OUT12 0xA9 -#define SCSIOP_WRITE12 0xAA -#define SCSIOP_SEND_MESSAGE 0xAB -#define SCSIOP_SERVICE_ACTION_IN12 0xAB -#define SCSIOP_GET_PERFORMANCE 0xAC -#define SCSIOP_READ_DVD_STRUCTURE 0xAD -#define SCSIOP_WRITE_VERIFY12 0xAE -#define SCSIOP_VERIFY12 0xAF -#define SCSIOP_SEARCH_DATA_HIGH12 0xB0 -#define SCSIOP_SEARCH_DATA_EQUAL12 0xB1 -#define SCSIOP_SEARCH_DATA_LOW12 0xB2 -#define SCSIOP_SET_LIMITS12 0xB3 -#define SCSIOP_READ_ELEMENT_STATUS_ATTACHED 0xB4 -#define SCSIOP_REQUEST_VOL_ELEMENT 0xB5 -#define SCSIOP_SEND_VOLUME_TAG 0xB6 -#define SCSIOP_SET_STREAMING 0xB6 // C/DVD -#define SCSIOP_READ_DEFECT_DATA 0xB7 -#define SCSIOP_READ_ELEMENT_STATUS 0xB8 -#define SCSIOP_READ_CD_MSF 0xB9 -#define SCSIOP_SCAN_CD 0xBA -#define SCSIOP_REDUNDANCY_GROUP_IN 0xBA -#define SCSIOP_SET_CD_SPEED 0xBB -#define SCSIOP_REDUNDANCY_GROUP_OUT 0xBB -#define SCSIOP_PLAY_CD 0xBC -#define SCSIOP_SPARE_IN 0xBC -#define SCSIOP_MECHANISM_STATUS 0xBD -#define SCSIOP_SPARE_OUT 0xBD -#define SCSIOP_READ_CD 0xBE -#define SCSIOP_VOLUME_SET_IN 0xBE -#define SCSIOP_SEND_DVD_STRUCTURE 0xBF -#define SCSIOP_VOLUME_SET_OUT 0xBF -#define SCSIOP_INIT_ELEMENT_RANGE 0xE7 - -// 16-byte commands -#define SCSIOP_XDWRITE_EXTENDED16 0x80 // disk -#define SCSIOP_WRITE_FILEMARKS16 0x80 // tape -#define SCSIOP_REBUILD16 0x81 // disk -#define SCSIOP_READ_REVERSE16 0x81 // tape -#define SCSIOP_REGENERATE16 0x82 // disk -#define SCSIOP_EXTENDED_COPY 0x83 -#define SCSIOP_RECEIVE_COPY_RESULTS 0x84 -#define SCSIOP_ATA_PASSTHROUGH16 0x85 -#define SCSIOP_ACCESS_CONTROL_IN 0x86 -#define SCSIOP_ACCESS_CONTROL_OUT 0x87 -#define SCSIOP_READ16 0x88 -#define SCSIOP_WRITE16 0x8A -#define SCSIOP_READ_ATTRIBUTES 0x8C -#define SCSIOP_WRITE_ATTRIBUTES 0x8D -#define SCSIOP_WRITE_VERIFY16 0x8E -#define SCSIOP_VERIFY16 0x8F -#define SCSIOP_PREFETCH16 0x90 -#define SCSIOP_SYNCHRONIZE_CACHE16 0x91 -#define SCSIOP_SPACE16 0x91 // tape -#define SCSIOP_LOCK_UNLOCK_CACHE16 0x92 -#define SCSIOP_LOCATE16 0x92 // tape -#define SCSIOP_WRITE_SAME16 0x93 -#define SCSIOP_ERASE16 0x93 // tape -#define SCSIOP_READ_CAPACITY16 0x9E -#define SCSIOP_SERVICE_ACTION_IN16 0x9E -#define SCSIOP_SERVICE_ACTION_OUT16 0x9F - - -// -// If the IMMED bit is 1, status is returned as soon -// as the operation is initiated. If the IMMED bit -// is 0, status is not returned until the operation -// is completed. -// - -#define CDB_RETURN_ON_COMPLETION 0 -#define CDB_RETURN_IMMEDIATE 1 - -// end_ntminitape - -// -// CDB Force media access used in extended read and write commands. -// - -#define CDB_FORCE_MEDIA_ACCESS 0x08 - -// -// Denon CD ROM operation codes -// - -#define SCSIOP_DENON_EJECT_DISC 0xE6 -#define SCSIOP_DENON_STOP_AUDIO 0xE7 -#define SCSIOP_DENON_PLAY_AUDIO 0xE8 -#define SCSIOP_DENON_READ_TOC 0xE9 -#define SCSIOP_DENON_READ_SUBCODE 0xEB - -// -// SCSI Bus Messages -// - -#define SCSIMESS_ABORT 0x06 -#define SCSIMESS_ABORT_WITH_TAG 0x0D -#define SCSIMESS_BUS_DEVICE_RESET 0X0C -#define SCSIMESS_CLEAR_QUEUE 0X0E -#define SCSIMESS_COMMAND_COMPLETE 0X00 -#define SCSIMESS_DISCONNECT 0X04 -#define SCSIMESS_EXTENDED_MESSAGE 0X01 -#define SCSIMESS_IDENTIFY 0X80 -#define SCSIMESS_IDENTIFY_WITH_DISCON 0XC0 -#define SCSIMESS_IGNORE_WIDE_RESIDUE 0X23 -#define SCSIMESS_INITIATE_RECOVERY 0X0F -#define SCSIMESS_INIT_DETECTED_ERROR 0X05 -#define SCSIMESS_LINK_CMD_COMP 0X0A -#define SCSIMESS_LINK_CMD_COMP_W_FLAG 0X0B -#define SCSIMESS_MESS_PARITY_ERROR 0X09 -#define SCSIMESS_MESSAGE_REJECT 0X07 -#define SCSIMESS_NO_OPERATION 0X08 -#define SCSIMESS_HEAD_OF_QUEUE_TAG 0X21 -#define SCSIMESS_ORDERED_QUEUE_TAG 0X22 -#define SCSIMESS_SIMPLE_QUEUE_TAG 0X20 -#define SCSIMESS_RELEASE_RECOVERY 0X10 -#define SCSIMESS_RESTORE_POINTERS 0X03 -#define SCSIMESS_SAVE_DATA_POINTER 0X02 -#define SCSIMESS_TERMINATE_IO_PROCESS 0X11 - -// -// SCSI Extended Message operation codes -// - -#define SCSIMESS_MODIFY_DATA_POINTER 0X00 -#define SCSIMESS_SYNCHRONOUS_DATA_REQ 0X01 -#define SCSIMESS_WIDE_DATA_REQUEST 0X03 - -// -// SCSI Extended Message Lengths -// - -#define SCSIMESS_MODIFY_DATA_LENGTH 5 -#define SCSIMESS_SYNCH_DATA_LENGTH 3 -#define SCSIMESS_WIDE_DATA_LENGTH 2 - -// -// SCSI extended message structure -// - -#pragma pack(push, scsi_mess, 1) -typedef struct _SCSI_EXTENDED_MESSAGE { - UCHAR InitialMessageCode; - UCHAR MessageLength; - UCHAR MessageType; - union _EXTENDED_ARGUMENTS { - - struct { - UCHAR Modifier[4]; - } Modify; - - struct { - UCHAR TransferPeriod; - UCHAR ReqAckOffset; - } Synchronous; - - struct{ - UCHAR Width; - } Wide; - }ExtendedArguments; -}SCSI_EXTENDED_MESSAGE, *PSCSI_EXTENDED_MESSAGE; -#pragma pack(pop, scsi_mess) - -// -// SCSI bus status codes. -// - -#define SCSISTAT_GOOD 0x00 -#define SCSISTAT_CHECK_CONDITION 0x02 -#define SCSISTAT_CONDITION_MET 0x04 -#define SCSISTAT_BUSY 0x08 -#define SCSISTAT_INTERMEDIATE 0x10 -#define SCSISTAT_INTERMEDIATE_COND_MET 0x14 -#define SCSISTAT_RESERVATION_CONFLICT 0x18 -#define SCSISTAT_COMMAND_TERMINATED 0x22 -#define SCSISTAT_QUEUE_FULL 0x28 - -// -// Enable Vital Product Data Flag (EVPD) -// used with INQUIRY command. -// - -#define CDB_INQUIRY_EVPD 0x01 - -// -// Defines for format CDB -// - -#define LUN0_FORMAT_SAVING_DEFECT_LIST 0 -#define USE_DEFAULTMSB 0 -#define USE_DEFAULTLSB 0 - -#define START_UNIT_CODE 0x01 -#define STOP_UNIT_CODE 0x00 - -// begin_ntminitape - -// -// Inquiry buffer structure. This is the data returned from the target -// after it receives an inquiry. -// -// This structure may be extended by the number of bytes specified -// in the field AdditionalLength. The defined size constant only -// includes fields through ProductRevisionLevel. -// -// The NT SCSI drivers are only interested in the first 36 bytes of data. -// - -#define INQUIRYDATABUFFERSIZE 36 - -#if (NTDDI_VERSION < NTDDI_WINXP) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - UCHAR Versions; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR ReservedBit : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved[2]; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR Reserved2 : 1; - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; - UCHAR Wide16Bit : 1; - UCHAR Wide32Bit : 1; - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#else -#pragma pack(push, inquiry, 1) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - union { - UCHAR Versions; - struct { - UCHAR ANSIVersion : 3; - UCHAR ECMAVersion : 3; - UCHAR ISOVersion : 2; - }; - }; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR TerminateTask : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved; - UCHAR Addr16 : 1; // defined only for SIP devices. - UCHAR Addr32 : 1; // defined only for SIP devices. - UCHAR AckReqQ: 1; // defined only for SIP devices. - UCHAR MediumChanger : 1; - UCHAR MultiPort : 1; - UCHAR ReservedBit2 : 1; - UCHAR EnclosureServices : 1; - UCHAR ReservedBit3 : 1; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR TransferDisable : 1; // defined only for SIP devices. - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; // defined only for SIP devices. - UCHAR Wide16Bit : 1; // defined only for SIP devices. - UCHAR Wide32Bit : 1; // defined only for SIP devices. - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#pragma pack(pop, inquiry) -#endif - -// -// Inquiry defines. Used to interpret data returned from target as result -// of inquiry command. -// -// DeviceType field -// - -#define DIRECT_ACCESS_DEVICE 0x00 // disks -#define SEQUENTIAL_ACCESS_DEVICE 0x01 // tapes -#define PRINTER_DEVICE 0x02 // printers -#define PROCESSOR_DEVICE 0x03 // scanners, printers, etc -#define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04 // worms -#define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05 // cdroms -#define SCANNER_DEVICE 0x06 // scanners -#define OPTICAL_DEVICE 0x07 // optical disks -#define MEDIUM_CHANGER 0x08 // jukebox -#define COMMUNICATION_DEVICE 0x09 // network -// 0xA and 0xB are obsolete -#define ARRAY_CONTROLLER_DEVICE 0x0C -#define SCSI_ENCLOSURE_DEVICE 0x0D -#define REDUCED_BLOCK_DEVICE 0x0E // e.g., 1394 disk -#define OPTICAL_CARD_READER_WRITER_DEVICE 0x0F -#define BRIDGE_CONTROLLER_DEVICE 0x10 -#define OBJECT_BASED_STORAGE_DEVICE 0x11 // OSD -#define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F - -#define DEVICE_QUALIFIER_ACTIVE 0x00 -#define DEVICE_QUALIFIER_NOT_ACTIVE 0x01 -#define DEVICE_QUALIFIER_NOT_SUPPORTED 0x03 - -// -// DeviceTypeQualifier field -// - -#define DEVICE_CONNECTED 0x00 - -// -// Vital Product Data Pages -// - -// -// Unit Serial Number Page (page code 0x80) -// -// Provides a product serial number for the target or the logical unit. -// -#pragma pack(push, vpd_media_sn, 1) -typedef struct _VPD_MEDIA_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_MEDIA_SERIAL_NUMBER_PAGE, *PVPD_MEDIA_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_media_sn) - -#pragma pack(push, vpd_sn, 1) -typedef struct _VPD_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_SERIAL_NUMBER_PAGE, *PVPD_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_sn) - -// -// Device Identification Page (page code 0x83) -// Provides the means to retrieve zero or more identification descriptors -// applying to the logical unit. -// - -#pragma pack(push, vpd_stuff, 1) -typedef enum _VPD_CODE_SET { - VpdCodeSetReserved = 0, - VpdCodeSetBinary = 1, - VpdCodeSetAscii = 2, - VpdCodeSetUTF8 = 3 -} VPD_CODE_SET, *PVPD_CODE_SET; - -typedef enum _VPD_ASSOCIATION { - VpdAssocDevice = 0, - VpdAssocPort = 1, - VpdAssocTarget = 2, - VpdAssocReserved1 = 3, - VpdAssocReserved2 = 4 // bogus, only two bits -} VPD_ASSOCIATION, *PVPD_ASSOCIATION; - -typedef enum _VPD_IDENTIFIER_TYPE { - VpdIdentifierTypeVendorSpecific = 0, - VpdIdentifierTypeVendorId = 1, - VpdIdentifierTypeEUI64 = 2, - VpdIdentifierTypeFCPHName = 3, - VpdIdentifierTypePortRelative = 4, - VpdIdentifierTypeTargetPortGroup = 5, - VpdIdentifierTypeLogicalUnitGroup = 6, - VpdIdentifierTypeMD5LogicalUnitId = 7, - VpdIdentifierTypeSCSINameString = 8 -} VPD_IDENTIFIER_TYPE, *PVPD_IDENTIFIER_TYPE; - -typedef struct _VPD_IDENTIFICATION_DESCRIPTOR { - UCHAR CodeSet : 4; // VPD_CODE_SET - UCHAR Reserved : 4; - UCHAR IdentifierType : 4; // VPD_IDENTIFIER_TYPE - UCHAR Association : 2; - UCHAR Reserved2 : 2; - UCHAR Reserved3; - UCHAR IdentifierLength; -#if !defined(__midl) - UCHAR Identifier[0]; -#endif -} VPD_IDENTIFICATION_DESCRIPTOR, *PVPD_IDENTIFICATION_DESCRIPTOR; - -typedef struct _VPD_IDENTIFICATION_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; - - - // - // The following field is actually a variable length array of identification - // descriptors. Unfortunately there's no C notation for an array of - // variable length structures so we're forced to just pretend. - // - -#if !defined(__midl) - // VPD_IDENTIFICATION_DESCRIPTOR Descriptors[0]; - UCHAR Descriptors[0]; -#endif -} VPD_IDENTIFICATION_PAGE, *PVPD_IDENTIFICATION_PAGE; - -// -// Supported Vital Product Data Pages Page (page code 0x00) -// Contains a list of the vital product data page cods supported by the target -// or logical unit. -// - -typedef struct _VPD_SUPPORTED_PAGES_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SupportedPageList[0]; -#endif -} VPD_SUPPORTED_PAGES_PAGE, *PVPD_SUPPORTED_PAGES_PAGE; -#pragma pack(pop, vpd_stuff) - - -#define VPD_MAX_BUFFER_SIZE 0xff - -#define VPD_SUPPORTED_PAGES 0x00 -#define VPD_SERIAL_NUMBER 0x80 -#define VPD_DEVICE_IDENTIFIERS 0x83 -#define VPD_MEDIA_SERIAL_NUMBER 0x84 -#define VPD_SOFTWARE_INTERFACE_IDENTIFIERS 0x84 -#define VPD_NETWORK_MANAGEMENT_ADDRESSES 0x85 -#define VPD_EXTENDED_INQUIRY_DATA 0x86 -#define VPD_MODE_PAGE_POLICY 0x87 -#define VPD_SCSI_PORTS 0x88 - - -// -// Persistent Reservation Definitions. -// - -// -// PERSISTENT_RESERVE_* definitions -// - -#define RESERVATION_ACTION_READ_KEYS 0x00 -#define RESERVATION_ACTION_READ_RESERVATIONS 0x01 - -#define RESERVATION_ACTION_REGISTER 0x00 -#define RESERVATION_ACTION_RESERVE 0x01 -#define RESERVATION_ACTION_RELEASE 0x02 -#define RESERVATION_ACTION_CLEAR 0x03 -#define RESERVATION_ACTION_PREEMPT 0x04 -#define RESERVATION_ACTION_PREEMPT_ABORT 0x05 -#define RESERVATION_ACTION_REGISTER_IGNORE_EXISTING 0x06 - -#define RESERVATION_SCOPE_LU 0x00 -#define RESERVATION_SCOPE_ELEMENT 0x02 - -#define RESERVATION_TYPE_WRITE_EXCLUSIVE 0x01 -#define RESERVATION_TYPE_EXCLUSIVE 0x03 -#define RESERVATION_TYPE_WRITE_EXCLUSIVE_REGISTRANTS 0x05 -#define RESERVATION_TYPE_EXCLUSIVE_REGISTRANTS 0x06 - -// -// Structures for reserve in command. -// - -#pragma pack(push, reserve_in_stuff, 1) -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - UCHAR ReservationKeyList[0][8]; -#endif -} PRI_REGISTRATION_LIST, *PPRI_REGISTRATION_LIST; - -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR Reserved; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Obsolete[2]; -} PRI_RESERVATION_DESCRIPTOR, *PPRI_RESERVATION_DESCRIPTOR; - -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - PRI_RESERVATION_DESCRIPTOR Reservations[0]; -#endif -} PRI_RESERVATION_LIST, *PPRI_RESERVATION_LIST; -#pragma pack(pop, reserve_in_stuff) - -// -// Structures for reserve out command. -// - -#pragma pack(push, reserve_out_stuff, 1) -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ServiceActionReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR ActivatePersistThroughPowerLoss : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2; - UCHAR Obsolete[2]; -} PRO_PARAMETER_LIST, *PPRO_PARAMETER_LIST; -#pragma pack(pop, reserve_out_stuff) - - -// -// Sense Data Format -// - -#pragma pack(push, sensedata, 1) -typedef struct _SENSE_DATA { - UCHAR ErrorCode:7; - UCHAR Valid:1; - UCHAR SegmentNumber; - UCHAR SenseKey:4; - UCHAR Reserved:1; - UCHAR IncorrectLength:1; - UCHAR EndOfMedia:1; - UCHAR FileMark:1; - UCHAR Information[4]; - UCHAR AdditionalSenseLength; - UCHAR CommandSpecificInformation[4]; - UCHAR AdditionalSenseCode; - UCHAR AdditionalSenseCodeQualifier; - UCHAR FieldReplaceableUnitCode; - UCHAR SenseKeySpecific[3]; -} SENSE_DATA, *PSENSE_DATA; -#pragma pack(pop, sensedata) - -// -// Default request sense buffer size -// - -#define SENSE_BUFFER_SIZE 18 - -// -// Maximum request sense buffer size -// - -#define MAX_SENSE_BUFFER_SIZE 255 - -// -// Maximum number of additional sense bytes. -// - -#define MAX_ADDITIONAL_SENSE_BYTES (MAX_SENSE_BUFFER_SIZE - SENSE_BUFFER_SIZE) - -// -// Sense codes -// - -#define SCSI_SENSE_NO_SENSE 0x00 -#define SCSI_SENSE_RECOVERED_ERROR 0x01 -#define SCSI_SENSE_NOT_READY 0x02 -#define SCSI_SENSE_MEDIUM_ERROR 0x03 -#define SCSI_SENSE_HARDWARE_ERROR 0x04 -#define SCSI_SENSE_ILLEGAL_REQUEST 0x05 -#define SCSI_SENSE_UNIT_ATTENTION 0x06 -#define SCSI_SENSE_DATA_PROTECT 0x07 -#define SCSI_SENSE_BLANK_CHECK 0x08 -#define SCSI_SENSE_UNIQUE 0x09 -#define SCSI_SENSE_COPY_ABORTED 0x0A -#define SCSI_SENSE_ABORTED_COMMAND 0x0B -#define SCSI_SENSE_EQUAL 0x0C -#define SCSI_SENSE_VOL_OVERFLOW 0x0D -#define SCSI_SENSE_MISCOMPARE 0x0E -#define SCSI_SENSE_RESERVED 0x0F - -// -// Additional tape bit -// - -#define SCSI_ILLEGAL_LENGTH 0x20 -#define SCSI_EOM 0x40 -#define SCSI_FILE_MARK 0x80 - -// -// Additional Sense codes -// - -#define SCSI_ADSENSE_NO_SENSE 0x00 -#define SCSI_ADSENSE_NO_SEEK_COMPLETE 0x02 -#define SCSI_ADSENSE_LUN_NOT_READY 0x04 -#define SCSI_ADSENSE_LUN_COMMUNICATION 0x08 -#define SCSI_ADSENSE_WRITE_ERROR 0x0C -#define SCSI_ADSENSE_TRACK_ERROR 0x14 -#define SCSI_ADSENSE_SEEK_ERROR 0x15 -#define SCSI_ADSENSE_REC_DATA_NOECC 0x17 -#define SCSI_ADSENSE_REC_DATA_ECC 0x18 -#define SCSI_ADSENSE_PARAMETER_LIST_LENGTH 0x1A -#define SCSI_ADSENSE_ILLEGAL_COMMAND 0x20 -#define SCSI_ADSENSE_ILLEGAL_BLOCK 0x21 -#define SCSI_ADSENSE_INVALID_CDB 0x24 -#define SCSI_ADSENSE_INVALID_LUN 0x25 -#define SCSI_ADSENSE_INVALID_FIELD_PARAMETER_LIST 0x26 -#define SCSI_ADSENSE_WRITE_PROTECT 0x27 -#define SCSI_ADSENSE_MEDIUM_CHANGED 0x28 -#define SCSI_ADSENSE_BUS_RESET 0x29 -#define SCSI_ADSENSE_PARAMETERS_CHANGED 0x2A -#define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION 0x2E -#define SCSI_ADSENSE_INVALID_MEDIA 0x30 -#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE 0x3a -#define SCSI_ADSENSE_POSITION_ERROR 0x3b -#define SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED 0x3f -#define SCSI_ADSENSE_OPERATOR_REQUEST 0x5a // see below -#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED 0x5d -#define SCSI_ADSENSE_ILLEGAL_MODE_FOR_THIS_TRACK 0x64 -#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE 0x6f -#define SCSI_ADSENSE_POWER_CALIBRATION_ERROR 0x73 -#define SCSI_ADSENSE_VENDOR_UNIQUE 0x80 // and higher -#define SCSI_ADSENSE_MUSIC_AREA 0xA0 -#define SCSI_ADSENSE_DATA_AREA 0xA1 -#define SCSI_ADSENSE_VOLUME_OVERFLOW 0xA7 - -// for legacy apps: -#define SCSI_ADWRITE_PROTECT SCSI_ADSENSE_WRITE_PROTECT -#define SCSI_FAILURE_PREDICTION_THRESHOLD_EXCEEDED SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED - - -// -// SCSI_ADSENSE_LUN_NOT_READY (0x04) qualifiers -// - -#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE 0x00 -#define SCSI_SENSEQ_BECOMING_READY 0x01 -#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED 0x02 -#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED 0x03 -#define SCSI_SENSEQ_FORMAT_IN_PROGRESS 0x04 -#define SCSI_SENSEQ_REBUILD_IN_PROGRESS 0x05 -#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS 0x06 -#define SCSI_SENSEQ_OPERATION_IN_PROGRESS 0x07 -#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS 0x08 - -// -// SCSI_ADSENSE_LUN_COMMUNICATION (0x08) qualifiers -// - -#define SCSI_SENSEQ_COMM_FAILURE 0x00 -#define SCSI_SENSEQ_COMM_TIMEOUT 0x01 -#define SCSI_SENSEQ_COMM_PARITY_ERROR 0x02 -#define SCSI_SESNEQ_COMM_CRC_ERROR 0x03 -#define SCSI_SENSEQ_UNREACHABLE_TARGET 0x04 - -// -// SCSI_ADSENSE_WRITE_ERROR (0x0C) qualifiers -// -#define SCSI_SENSEQ_LOSS_OF_STREAMING 0x09 -#define SCSI_SENSEQ_PADDING_BLOCKS_ADDED 0x0A - - -// -// SCSI_ADSENSE_NO_SENSE (0x00) qualifiers -// - -#define SCSI_SENSEQ_FILEMARK_DETECTED 0x01 -#define SCSI_SENSEQ_END_OF_MEDIA_DETECTED 0x02 -#define SCSI_SENSEQ_SETMARK_DETECTED 0x03 -#define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED 0x04 - -// -// SCSI_ADSENSE_ILLEGAL_BLOCK (0x21) qualifiers -// - -#define SCSI_SENSEQ_ILLEGAL_ELEMENT_ADDR 0x01 - -// -// SCSI_ADSENSE_POSITION_ERROR (0x3b) qualifiers -// - -#define SCSI_SENSEQ_DESTINATION_FULL 0x0d -#define SCSI_SENSEQ_SOURCE_EMPTY 0x0e - -// -// SCSI_ADSENSE_INVALID_MEDIA (0x30) qualifiers -// - -#define SCSI_SENSEQ_INCOMPATIBLE_MEDIA_INSTALLED 0x00 -#define SCSI_SENSEQ_UNKNOWN_FORMAT 0x01 -#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT 0x02 -#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED 0x03 - - -// -// SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED (0x3f) qualifiers -// - -#define SCSI_SENSEQ_TARGET_OPERATING_CONDITIONS_CHANGED 0x00 -#define SCSI_SENSEQ_MICROCODE_CHANGED 0x01 -#define SCSI_SENSEQ_OPERATING_DEFINITION_CHANGED 0x02 -#define SCSI_SENSEQ_INQUIRY_DATA_CHANGED 0x03 -#define SCSI_SENSEQ_COMPONENT_DEVICE_ATTACHED 0x04 -#define SCSI_SENSEQ_DEVICE_IDENTIFIER_CHANGED 0x05 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_MODIFIED 0x06 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_DELETED 0x07 -#define SCSI_SENSEQ_SPARE_MODIFIED 0x08 -#define SCSI_SENSEQ_SPARE_DELETED 0x09 -#define SCSI_SENSEQ_VOLUME_SET_MODIFIED 0x0A -#define SCSI_SENSEQ_VOLUME_SET_DELETED 0x0B -#define SCSI_SENSEQ_VOLUME_SET_DEASSIGNED 0x0C -#define SCSI_SENSEQ_VOLUME_SET_REASSIGNED 0x0D -#define SCSI_SENSEQ_REPORTED_LUNS_DATA_CHANGED 0x0E -#define SCSI_SENSEQ_ECHO_BUFFER_OVERWRITTEN 0x0F -#define SCSI_SENSEQ_MEDIUM_LOADABLE 0x10 -#define SCSI_SENSEQ_MEDIUM_AUXILIARY_MEMORY_ACCESSIBLE 0x11 - - -// -// SCSI_ADSENSE_OPERATOR_REQUEST (0x5a) qualifiers -// - -#define SCSI_SENSEQ_STATE_CHANGE_INPUT 0x00 // generic request -#define SCSI_SENSEQ_MEDIUM_REMOVAL 0x01 -#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE 0x02 -#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE 0x03 - -// -// SCSI_ADSENSE_COPY_PROTECTION_FAILURE (0x6f) qualifiers -// -#define SCSI_SENSEQ_AUTHENTICATION_FAILURE 0x00 -#define SCSI_SENSEQ_KEY_NOT_PRESENT 0x01 -#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED 0x02 -#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION 0x03 -#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT 0x04 -#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR 0x05 - -// -// SCSI_ADSENSE_POWER_CALIBRATION_ERROR (0x73) qualifiers -// - -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ALMOST_FULL 0x01 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_FULL 0x02 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ERROR 0x03 -#define SCSI_SENSEQ_PMA_RMA_UPDATE_FAILURE 0x04 -#define SCSI_SENSEQ_PMA_RMA_IS_FULL 0x05 -#define SCSI_SENSEQ_PMA_RMA_ALMOST_FULL 0x06 - - -// end_ntminitape - -// -// SCSI IO Device Control Codes -// - -#define FILE_DEVICE_SCSI 0x0000001b - -#define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011) -#define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012) -#define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013) - -// -// SMART support in atapi -// - -#define IOCTL_SCSI_MINIPORT_SMART_VERSION ((FILE_DEVICE_SCSI << 16) + 0x0500) -#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501) -#define IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS ((FILE_DEVICE_SCSI << 16) + 0x0502) -#define IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS ((FILE_DEVICE_SCSI << 16) + 0x0503) -#define IOCTL_SCSI_MINIPORT_ENABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0504) -#define IOCTL_SCSI_MINIPORT_DISABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0505) -#define IOCTL_SCSI_MINIPORT_RETURN_STATUS ((FILE_DEVICE_SCSI << 16) + 0x0506) -#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE ((FILE_DEVICE_SCSI << 16) + 0x0507) -#define IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES ((FILE_DEVICE_SCSI << 16) + 0x0508) -#define IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS ((FILE_DEVICE_SCSI << 16) + 0x0509) -#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE ((FILE_DEVICE_SCSI << 16) + 0x050a) -#define IOCTL_SCSI_MINIPORT_READ_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050b) -#define IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050c) - -// -// CLUSTER support -// deliberately skipped some values to allow for expansion above. -// -#define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0520) -#define IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0521) - - -// begin_ntminitape - -// -// Read Capacity Data - returned in Big Endian format -// - -#pragma pack(push, read_capacity, 1) -typedef struct _READ_CAPACITY_DATA { - ULONG LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA; -#pragma pack(pop, read_capacity) - - -#pragma pack(push, read_capacity_ex, 1) -typedef struct _READ_CAPACITY_DATA_EX { - LARGE_INTEGER LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA_EX, *PREAD_CAPACITY_DATA_EX; -#pragma pack(pop, read_capacity_ex) - - -// -// Read Block Limits Data - returned in Big Endian format -// This structure returns the maximum and minimum block -// size for a TAPE device. -// - -#pragma pack(push, read_block_limits, 1) -typedef struct _READ_BLOCK_LIMITS { - UCHAR Reserved; - UCHAR BlockMaximumSize[3]; - UCHAR BlockMinimumSize[2]; -} READ_BLOCK_LIMITS_DATA, *PREAD_BLOCK_LIMITS_DATA; -#pragma pack(pop, read_block_limits) - -#pragma pack(push, read_buffer_capacity, 1) -typedef struct _READ_BUFFER_CAPACITY_DATA { - UCHAR DataLength[2]; - UCHAR Reserved1; - UCHAR BlockDataReturned : 1; - UCHAR Reserved4 : 7; - UCHAR TotalBufferSize[4]; - UCHAR AvailableBufferSize[4]; -} READ_BUFFER_CAPACITY_DATA, *PREAD_BUFFER_CAPACITY_DATA; -#pragma pack(pop, read_buffer_capacity) - -// -// Mode data structures. -// - -// -// Define Mode parameter header. -// - -#pragma pack(push, mode_params, 1) -typedef struct _MODE_PARAMETER_HEADER { - UCHAR ModeDataLength; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR BlockDescriptorLength; -}MODE_PARAMETER_HEADER, *PMODE_PARAMETER_HEADER; - -typedef struct _MODE_PARAMETER_HEADER10 { - UCHAR ModeDataLength[2]; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR Reserved[2]; - UCHAR BlockDescriptorLength[2]; -}MODE_PARAMETER_HEADER10, *PMODE_PARAMETER_HEADER10; -#pragma pack(pop, mode_params) - -#define MODE_FD_SINGLE_SIDE 0x01 -#define MODE_FD_DOUBLE_SIDE 0x02 -#define MODE_FD_MAXIMUM_TYPE 0x1E -#define MODE_DSP_FUA_SUPPORTED 0x10 -#define MODE_DSP_WRITE_PROTECT 0x80 - -// -// Define the mode parameter block. -// - -#pragma pack(push, mode_params_block, 1) -typedef struct _MODE_PARAMETER_BLOCK { - UCHAR DensityCode; - UCHAR NumberOfBlocks[3]; - UCHAR Reserved; - UCHAR BlockLength[3]; -}MODE_PARAMETER_BLOCK, *PMODE_PARAMETER_BLOCK; -#pragma pack(pop, mode_params_block) - -// -// Define Disconnect-Reconnect page. -// - - -#pragma pack(push, mode_page_disconnect, 1) -typedef struct _MODE_DISCONNECT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR BufferFullRatio; - UCHAR BufferEmptyRatio; - UCHAR BusInactivityLimit[2]; - UCHAR BusDisconnectTime[2]; - UCHAR BusConnectTime[2]; - UCHAR MaximumBurstSize[2]; - UCHAR DataTransferDisconnect : 2; - UCHAR Reserved2[3]; -}MODE_DISCONNECT_PAGE, *PMODE_DISCONNECT_PAGE; -#pragma pack(pop, mode_page_disconnect) - -// -// Define mode caching page. -// - -#pragma pack(push, mode_page_caching, 1) -typedef struct _MODE_CACHING_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR ReadDisableCache : 1; - UCHAR MultiplicationFactor : 1; - UCHAR WriteCacheEnable : 1; - UCHAR Reserved2 : 5; - UCHAR WriteRetensionPriority : 4; - UCHAR ReadRetensionPriority : 4; - UCHAR DisablePrefetchTransfer[2]; - UCHAR MinimumPrefetch[2]; - UCHAR MaximumPrefetch[2]; - UCHAR MaximumPrefetchCeiling[2]; -}MODE_CACHING_PAGE, *PMODE_CACHING_PAGE; -#pragma pack(pop, mode_page_caching) - -// -// Define write parameters cdrom page -// -#pragma pack(push, mode_page_wp2, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE2 { - UCHAR PageCode : 6; // 0x05 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR MediaCatalogNumber[16]; - UCHAR ISRC[16]; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE2, *PMODE_CDROM_WRITE_PARAMETERS_PAGE2; -#pragma pack(pop, mode_page_wp2) - -#ifndef DEPRECATE_DDK_FUNCTIONS -// this structure is being retired due to missing fields and overly -// complex data definitions for the MCN and ISRC. -#pragma pack(push, mode_page_wp, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE { - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR Reserved7 : 7; - UCHAR MediaCatalogNumberValid : 1; - UCHAR MediaCatalogNumber[13]; - UCHAR MediaCatalogNumberZero; - UCHAR MediaCatalogNumberAFrame; - UCHAR Reserved8 : 7; - UCHAR ISRCValid : 1; - UCHAR ISRCCountry[2]; - UCHAR ISRCOwner[3]; - UCHAR ISRCRecordingYear[2]; - UCHAR ISRCSerialNumber[5]; - UCHAR ISRCZero; - UCHAR ISRCAFrame; - UCHAR ISRCReserved; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE, *PMODE_CDROM_WRITE_PARAMETERS_PAGE; -#pragma pack(pop, mode_page_wp) -#endif //ifndef DEPRECATE_DDK_FUNCTIONS - -// -// Define the MRW mode page for CDROM device types -// -#pragma pack(push, mode_page_mrw, 1) -typedef struct _MODE_MRW_PAGE { - UCHAR PageCode : 6; // 0x03 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; //0x06 - UCHAR Reserved1; - UCHAR LbaSpace : 1; - UCHAR Reserved2 : 7; - UCHAR Reserved3[4]; -} MODE_MRW_PAGE, *PMODE_MRW_PAGE; -#pragma pack(pop, mode_page_mrw) - -// -// Define mode flexible disk page. -// - -#pragma pack(push, mode_page_flex, 1) -typedef struct _MODE_FLEXIBLE_DISK_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TransferRate[2]; - UCHAR NumberOfHeads; - UCHAR SectorsPerTrack; - UCHAR BytesPerSector[2]; - UCHAR NumberOfCylinders[2]; - UCHAR StartWritePrecom[2]; - UCHAR StartReducedCurrent[2]; - UCHAR StepRate[2]; - UCHAR StepPluseWidth; - UCHAR HeadSettleDelay[2]; - UCHAR MotorOnDelay; - UCHAR MotorOffDelay; - UCHAR Reserved2 : 5; - UCHAR MotorOnAsserted : 1; - UCHAR StartSectorNumber : 1; - UCHAR TrueReadySignal : 1; - UCHAR StepPlusePerCyclynder : 4; - UCHAR Reserved3 : 4; - UCHAR WriteCompenstation; - UCHAR HeadLoadDelay; - UCHAR HeadUnloadDelay; - UCHAR Pin2Usage : 4; - UCHAR Pin34Usage : 4; - UCHAR Pin1Usage : 4; - UCHAR Pin4Usage : 4; - UCHAR MediumRotationRate[2]; - UCHAR Reserved4[2]; -} MODE_FLEXIBLE_DISK_PAGE, *PMODE_FLEXIBLE_DISK_PAGE; -#pragma pack(pop, mode_page_flex) - -// -// Define mode format page. -// - -#pragma pack(push, mode_page_format, 1) -typedef struct _MODE_FORMAT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TracksPerZone[2]; - UCHAR AlternateSectorsPerZone[2]; - UCHAR AlternateTracksPerZone[2]; - UCHAR AlternateTracksPerLogicalUnit[2]; - UCHAR SectorsPerTrack[2]; - UCHAR BytesPerPhysicalSector[2]; - UCHAR Interleave[2]; - UCHAR TrackSkewFactor[2]; - UCHAR CylinderSkewFactor[2]; - UCHAR Reserved2 : 4; - UCHAR SurfaceFirst : 1; - UCHAR RemovableMedia : 1; - UCHAR HardSectorFormating : 1; - UCHAR SoftSectorFormating : 1; - UCHAR Reserved3[3]; -} MODE_FORMAT_PAGE, *PMODE_FORMAT_PAGE; -#pragma pack(pop, mode_page_format) - -// -// Define rigid disk driver geometry page. -// - -#pragma pack(push, mode_page_geometry, 1) -typedef struct _MODE_RIGID_GEOMETRY_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR NumberOfCylinders[3]; - UCHAR NumberOfHeads; - UCHAR StartWritePrecom[3]; - UCHAR StartReducedCurrent[3]; - UCHAR DriveStepRate[2]; - UCHAR LandZoneCyclinder[3]; - UCHAR RotationalPositionLock : 2; - UCHAR Reserved2 : 6; - UCHAR RotationOffset; - UCHAR Reserved3; - UCHAR RoataionRate[2]; - UCHAR Reserved4[2]; -}MODE_RIGID_GEOMETRY_PAGE, *PMODE_RIGID_GEOMETRY_PAGE; -#pragma pack(pop, mode_page_geometry) - -// -// Define read write recovery page -// - -#pragma pack(push, mode_page_rw_recovery, 1) -typedef struct _MODE_READ_WRITE_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR EERBit : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR ARRE : 1; - UCHAR AWRE : 1; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - UCHAR WriteRetryCount; - UCHAR Reserved5[3]; - -} MODE_READ_WRITE_RECOVERY_PAGE, *PMODE_READ_WRITE_RECOVERY_PAGE; -#pragma pack(pop, mode_page_rw_recovery) - -// -// Define read recovery page - cdrom -// - -#pragma pack(push, mode_page_r_recovery, 1) -typedef struct _MODE_READ_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR Reserved2 : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR Reserved3 : 2; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - -} MODE_READ_RECOVERY_PAGE, *PMODE_READ_RECOVERY_PAGE; -#pragma pack(pop, mode_page_r_recovery) - - -// -// Define Informational Exception Control Page. Used for failure prediction -// - -#pragma pack(push, mode_page_xcpt, 1) -typedef struct _MODE_INFO_EXCEPTIONS -{ - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; - - union - { - UCHAR Flags; - struct - { - UCHAR LogErr : 1; - UCHAR Reserved2 : 1; - UCHAR Test : 1; - UCHAR Dexcpt : 1; - UCHAR Reserved3 : 3; - UCHAR Perf : 1; - }; - }; - - UCHAR ReportMethod : 4; - UCHAR Reserved4 : 4; - - UCHAR IntervalTimer[4]; - UCHAR ReportCount[4]; - -} MODE_INFO_EXCEPTIONS, *PMODE_INFO_EXCEPTIONS; -#pragma pack(pop, mode_page_xcpt) - -// -// Begin C/DVD 0.9 definitions -// - -// -// Power Condition Mode Page Format -// - -#pragma pack(push, mode_page_power, 1) -typedef struct _POWER_CONDITION_PAGE { - UCHAR PageCode : 6; // 0x1A - UCHAR Reserved : 1; - UCHAR PSBit : 1; - UCHAR PageLength; // 0x0A - UCHAR Reserved2; - - UCHAR Standby : 1; - UCHAR Idle : 1; - UCHAR Reserved3 : 6; - - UCHAR IdleTimer[4]; - UCHAR StandbyTimer[4]; -} POWER_CONDITION_PAGE, *PPOWER_CONDITION_PAGE; -#pragma pack(pop, mode_page_power) - -// -// CD-Audio Control Mode Page Format -// - -#pragma pack(push, mode_page_cdaudio, 1) -typedef struct _CDDA_OUTPUT_PORT { - UCHAR ChannelSelection : 4; - UCHAR Reserved : 4; - UCHAR Volume; -} CDDA_OUTPUT_PORT, *PCDDA_OUTPUT_PORT; - -typedef struct _CDAUDIO_CONTROL_PAGE { - UCHAR PageCode : 6; // 0x0E - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x0E - - UCHAR Reserved2 : 1; - UCHAR StopOnTrackCrossing : 1; // Default 0 - UCHAR Immediate : 1; // Always 1 - UCHAR Reserved3 : 5; - - UCHAR Reserved4[3]; - UCHAR Obsolete[2]; - - CDDA_OUTPUT_PORT CDDAOutputPorts[4]; - -} CDAUDIO_CONTROL_PAGE, *PCDAUDIO_CONTROL_PAGE; -#pragma pack(pop, mode_page_cdaudio) - -#define CDDA_CHANNEL_MUTED 0x0 -#define CDDA_CHANNEL_ZERO 0x1 -#define CDDA_CHANNEL_ONE 0x2 -#define CDDA_CHANNEL_TWO 0x4 -#define CDDA_CHANNEL_THREE 0x8 - -// -// C/DVD Feature Set Support & Version Page -// - -#pragma pack(push, mode_page_features, 1) -typedef struct _CDVD_FEATURE_SET_PAGE { - UCHAR PageCode : 6; // 0x18 - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x16 - - UCHAR CDAudio[2]; - UCHAR EmbeddedChanger[2]; - UCHAR PacketSMART[2]; - UCHAR PersistantPrevent[2]; - UCHAR EventStatusNotification[2]; - UCHAR DigitalOutput[2]; - UCHAR CDSequentialRecordable[2]; - UCHAR DVDSequentialRecordable[2]; - UCHAR RandomRecordable[2]; - UCHAR KeyExchange[2]; - UCHAR Reserved2[2]; -} CDVD_FEATURE_SET_PAGE, *PCDVD_FEATURE_SET_PAGE; -#pragma pack(pop, mode_page_features) - -// -// CDVD Inactivity Time-out Page Format -// - -#pragma pack(push, mode_page_timeout, 1) -typedef struct _CDVD_INACTIVITY_TIMEOUT_PAGE { - UCHAR PageCode : 6; // 0x1D - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x08 - UCHAR Reserved2[2]; - - UCHAR SWPP : 1; - UCHAR DISP : 1; - UCHAR Reserved3 : 6; - - UCHAR Reserved4; - UCHAR GroupOneMinimumTimeout[2]; - UCHAR GroupTwoMinimumTimeout[2]; -} CDVD_INACTIVITY_TIMEOUT_PAGE, *PCDVD_INACTIVITY_TIMEOUT_PAGE; -#pragma pack(pop, mode_page_timeout) - -// -// CDVD Capabilities & Mechanism Status Page -// - -#define CDVD_LMT_CADDY 0 -#define CDVD_LMT_TRAY 1 -#define CDVD_LMT_POPUP 2 -#define CDVD_LMT_RESERVED1 3 -#define CDVD_LMT_CHANGER_INDIVIDUAL 4 -#define CDVD_LMT_CHANGER_CARTRIDGE 5 -#define CDVD_LMT_RESERVED2 6 -#define CDVD_LMT_RESERVED3 7 - - -#pragma pack(push, mode_page_capabilities, 1) -typedef struct _CDVD_CAPABILITIES_PAGE { - UCHAR PageCode : 6; // 0x2A - UCHAR Reserved : 1; - UCHAR PSBit : 1; // offset 0 - - UCHAR PageLength; // >= 0x18 // offset 1 - - UCHAR CDRRead : 1; - UCHAR CDERead : 1; - UCHAR Method2 : 1; - UCHAR DVDROMRead : 1; - UCHAR DVDRRead : 1; - UCHAR DVDRAMRead : 1; - UCHAR Reserved2 : 2; // offset 2 - - UCHAR CDRWrite : 1; - UCHAR CDEWrite : 1; - UCHAR TestWrite : 1; - UCHAR Reserved3 : 1; - UCHAR DVDRWrite : 1; - UCHAR DVDRAMWrite : 1; - UCHAR Reserved4 : 2; // offset 3 - - UCHAR AudioPlay : 1; - UCHAR Composite : 1; - UCHAR DigitalPortOne : 1; - UCHAR DigitalPortTwo : 1; - UCHAR Mode2Form1 : 1; - UCHAR Mode2Form2 : 1; - UCHAR MultiSession : 1; - UCHAR BufferUnderrunFree : 1; // offset 4 - - UCHAR CDDA : 1; - UCHAR CDDAAccurate : 1; - UCHAR RWSupported : 1; - UCHAR RWDeinterleaved : 1; - UCHAR C2Pointers : 1; - UCHAR ISRC : 1; - UCHAR UPC : 1; - UCHAR ReadBarCodeCapable : 1; // offset 5 - - UCHAR Lock : 1; - UCHAR LockState : 1; - UCHAR PreventJumper : 1; - UCHAR Eject : 1; - UCHAR Reserved6 : 1; - UCHAR LoadingMechanismType : 3; // offset 6 - - UCHAR SeparateVolume : 1; - UCHAR SeperateChannelMute : 1; - UCHAR SupportsDiskPresent : 1; - UCHAR SWSlotSelection : 1; - UCHAR SideChangeCapable : 1; - UCHAR RWInLeadInReadable : 1; - UCHAR Reserved7 : 2; // offset 7 - - union { - UCHAR ReadSpeedMaximum[2]; - UCHAR ObsoleteReserved[2]; // offset 8 - }; - - UCHAR NumberVolumeLevels[2]; // offset 10 - UCHAR BufferSize[2]; // offset 12 - - union { - UCHAR ReadSpeedCurrent[2]; - UCHAR ObsoleteReserved2[2]; // offset 14 - }; - UCHAR ObsoleteReserved3; // offset 16 - - UCHAR Reserved8 : 1; - UCHAR BCK : 1; - UCHAR RCK : 1; - UCHAR LSBF : 1; - UCHAR Length : 2; - UCHAR Reserved9 : 2; // offset 17 - - union { - UCHAR WriteSpeedMaximum[2]; - UCHAR ObsoleteReserved4[2]; // offset 18 - }; - union { - UCHAR WriteSpeedCurrent[2]; - UCHAR ObsoleteReserved11[2]; // offset 20 - }; - - // - // NOTE: This mode page is two bytes too small in the release - // version of the Windows2000 DDK. it also incorrectly - // put the CopyManagementRevision at offset 20 instead - // of offset 22, so fix that with a nameless union (for - // backwards-compatibility with those who "fixed" it on - // their own by looking at Reserved10[]). - // - - union { - UCHAR CopyManagementRevision[2]; // offset 22 - UCHAR Reserved10[2]; - }; - //UCHAR Reserved12[2]; // offset 24 - -} CDVD_CAPABILITIES_PAGE, *PCDVD_CAPABILITIES_PAGE; -#pragma pack(pop, mode_page_capabilities) - -#pragma pack(push, lun_list, 1) -typedef struct _LUN_LIST { - UCHAR LunListLength[4]; // sizeof LunSize * 8 - UCHAR Reserved[4]; -#if !defined(__midl) - UCHAR Lun[0][8]; // 4 level of addressing. 2 bytes each. -#endif -} LUN_LIST, *PLUN_LIST; -#pragma pack(pop, lun_list) - - -#define LOADING_MECHANISM_CADDY 0x00 -#define LOADING_MECHANISM_TRAY 0x01 -#define LOADING_MECHANISM_POPUP 0x02 -#define LOADING_MECHANISM_INDIVIDUAL_CHANGER 0x04 -#define LOADING_MECHANISM_CARTRIDGE_CHANGER 0x05 - -// -// end C/DVD 0.9 mode page definitions - -// -// Mode parameter list block descriptor - -// set the block length for reading/writing -// -// - -#define MODE_BLOCK_DESC_LENGTH 8 -#define MODE_HEADER_LENGTH 4 -#define MODE_HEADER_LENGTH10 8 - -#pragma pack(push, mode_parm_rw, 1) -typedef struct _MODE_PARM_READ_WRITE { - - MODE_PARAMETER_HEADER ParameterListHeader; // List Header Format - MODE_PARAMETER_BLOCK ParameterListBlock; // List Block Descriptor - -} MODE_PARM_READ_WRITE_DATA, *PMODE_PARM_READ_WRITE_DATA; -#pragma pack(pop, mode_parm_rw) - -// end_ntminitape - -// -// CDROM audio control (0x0E) -// - -#define CDB_AUDIO_PAUSE 0 -#define CDB_AUDIO_RESUME 1 - -#define CDB_DEVICE_START 0x11 -#define CDB_DEVICE_STOP 0x10 - -#define CDB_EJECT_MEDIA 0x10 -#define CDB_LOAD_MEDIA 0x01 - -#define CDB_SUBCHANNEL_HEADER 0x00 -#define CDB_SUBCHANNEL_BLOCK 0x01 - -#define CDROM_AUDIO_CONTROL_PAGE 0x0E -#define MODE_SELECT_IMMEDIATE 0x04 -#define MODE_SELECT_PFBIT 0x10 - -#define CDB_USE_MSF 0x01 - -#pragma pack(push, audio_output, 1) -typedef struct _PORT_OUTPUT { - UCHAR ChannelSelection; - UCHAR Volume; -} PORT_OUTPUT, *PPORT_OUTPUT; - -typedef struct _AUDIO_OUTPUT { - UCHAR CodePage; - UCHAR ParameterLength; - UCHAR Immediate; - UCHAR Reserved[2]; - UCHAR LbaFormat; - UCHAR LogicalBlocksPerSecond[2]; - PORT_OUTPUT PortOutput[4]; -} AUDIO_OUTPUT, *PAUDIO_OUTPUT; -#pragma pack(pop, audio_output) - -// -// Multisession CDROM -// - -#define GET_LAST_SESSION 0x01 -#define GET_SESSION_DATA 0x02; - -// -// Atapi 2.5 changer -// - -#pragma pack(push, chgr_stuff, 1) -typedef struct _MECHANICAL_STATUS_INFORMATION_HEADER { - UCHAR CurrentSlot : 5; - UCHAR ChangerState : 2; - UCHAR Fault : 1; - UCHAR Reserved : 5; - UCHAR MechanismState : 3; - UCHAR CurrentLogicalBlockAddress[3]; - UCHAR NumberAvailableSlots; - UCHAR SlotTableLength[2]; -} MECHANICAL_STATUS_INFORMATION_HEADER, *PMECHANICAL_STATUS_INFORMATION_HEADER; - -typedef struct _SLOT_TABLE_INFORMATION { - UCHAR DiscChanged : 1; - UCHAR Reserved : 6; - UCHAR DiscPresent : 1; - UCHAR Reserved2[3]; -} SLOT_TABLE_INFORMATION, *PSLOT_TABLE_INFORMATION; - -typedef struct _MECHANICAL_STATUS { - MECHANICAL_STATUS_INFORMATION_HEADER MechanicalStatusHeader; - SLOT_TABLE_INFORMATION SlotTableInfo[1]; -} MECHANICAL_STATUS, *PMECHANICAL_STATUS; -#pragma pack(pop, chgr_stuff) - - -// begin_ntminitape - -// -// Tape definitions -// - -#pragma pack(push, tape_position, 1) -typedef struct _TAPE_POSITION_DATA { - UCHAR Reserved1:2; - UCHAR BlockPositionUnsupported:1; - UCHAR Reserved2:3; - UCHAR EndOfPartition:1; - UCHAR BeginningOfPartition:1; - UCHAR PartitionNumber; - USHORT Reserved3; - UCHAR FirstBlock[4]; - UCHAR LastBlock[4]; - UCHAR Reserved4; - UCHAR NumberOfBlocks[3]; - UCHAR NumberOfBytes[4]; -} TAPE_POSITION_DATA, *PTAPE_POSITION_DATA; -#pragma pack(pop, tape_position) - -// -// This structure is used to convert little endian -// ULONGs to SCSI CDB big endians values. -// - -#pragma pack(push, byte_stuff, 1) -typedef union _EIGHT_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - UCHAR Byte4; - UCHAR Byte5; - UCHAR Byte6; - UCHAR Byte7; - }; - - ULONGLONG AsULongLong; -} EIGHT_BYTE, *PEIGHT_BYTE; - -typedef union _FOUR_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - }; - - ULONG AsULong; -} FOUR_BYTE, *PFOUR_BYTE; - -typedef union _TWO_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - }; - - USHORT AsUShort; -} TWO_BYTE, *PTWO_BYTE; -#pragma pack(pop, byte_stuff) - -// -// Byte reversing macro for converting -// between big- and little-endian formats -// - -#define REVERSE_BYTES_QUAD(Destination, Source) { \ - PEIGHT_BYTE d = (PEIGHT_BYTE)(Destination); \ - PEIGHT_BYTE s = (PEIGHT_BYTE)(Source); \ - d->Byte7 = s->Byte0; \ - d->Byte6 = s->Byte1; \ - d->Byte5 = s->Byte2; \ - d->Byte4 = s->Byte3; \ - d->Byte3 = s->Byte4; \ - d->Byte2 = s->Byte5; \ - d->Byte1 = s->Byte6; \ - d->Byte0 = s->Byte7; \ -} - -#define REVERSE_BYTES(Destination, Source) { \ - PFOUR_BYTE d = (PFOUR_BYTE)(Destination); \ - PFOUR_BYTE s = (PFOUR_BYTE)(Source); \ - d->Byte3 = s->Byte0; \ - d->Byte2 = s->Byte1; \ - d->Byte1 = s->Byte2; \ - d->Byte0 = s->Byte3; \ -} - -#define REVERSE_BYTES_SHORT(Destination, Source) { \ - PTWO_BYTE d = (PTWO_BYTE)(Destination); \ - PTWO_BYTE s = (PTWO_BYTE)(Source); \ - d->Byte1 = s->Byte0; \ - d->Byte0 = s->Byte1; \ -} - -// -// Byte reversing macro for converting -// USHORTS from big to little endian in place -// - -#define REVERSE_SHORT(Short) { \ - UCHAR tmp; \ - PTWO_BYTE w = (PTWO_BYTE)(Short); \ - tmp = w->Byte0; \ - w->Byte0 = w->Byte1; \ - w->Byte1 = tmp; \ - } - -// -// Byte reversing macro for convering -// ULONGS between big & little endian in place -// - -#define REVERSE_LONG(Long) { \ - UCHAR tmp; \ - PFOUR_BYTE l = (PFOUR_BYTE)(Long); \ - tmp = l->Byte3; \ - l->Byte3 = l->Byte0; \ - l->Byte0 = tmp; \ - tmp = l->Byte2; \ - l->Byte2 = l->Byte1; \ - l->Byte1 = tmp; \ - } - -// -// This macro has the effect of Bit = log2(Data) -// - -#define WHICH_BIT(Data, Bit) { \ - UCHAR tmp; \ - for (tmp = 0; tmp < 32; tmp++) { \ - if (((Data) >> tmp) == 1) { \ - break; \ - } \ - } \ - ASSERT(tmp != 32); \ - (Bit) = tmp; \ -} - -// end_storport - -// end_ntminitape - -#pragma pack(pop, _scsi_) // restore original packing level - -#pragma warning(pop) // un-sets any local warning changes - -#endif // !defined _NTSCSI_ - diff --git a/qt-correction-tool/pub/ddk/scsiscan.h b/qt-correction-tool/pub/ddk/scsiscan.h deleted file mode 100644 index 6c49a57..0000000 --- a/qt-correction-tool/pub/ddk/scsiscan.h +++ /dev/null @@ -1,112 +0,0 @@ -/**************************************************************************** -* -* (C) COPYRIGHT 1996-2000, MICROSOFT CORP. -* -* FILE: scsiscan.h -* -* VERSION: 1.0 -* -* DATE: 2/11/1997 -* -* DESCRIPTION: -* IOCTL definitions for the SCSI scanner device driver. -* -*****************************************************************************/ - -// -// Turns off [] -// -#pragma warning(disable : 4200) - -#ifndef _SCSISCAN_H_ -#define _SCSISCAN_H_ - -// SCSISCAN_CMD.SrbFlags - -#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 -#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 -#define SRB_FLAGS_DATA_IN 0x00000040 -#define SRB_FLAGS_DATA_OUT 0x00000080 -#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 - -// SCSISCAN_CMD.SrbStatus definitions - -#define SRB_STATUS_PENDING 0x00 -#define SRB_STATUS_SUCCESS 0x01 -#define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 -#define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 -#define SRB_STATUS_INVALID_REQUEST 0x06 -#define SRB_STATUS_INVALID_PATH_ID 0x07 -#define SRB_STATUS_NO_DEVICE 0x08 -#define SRB_STATUS_TIMEOUT 0x09 -#define SRB_STATUS_SELECTION_TIMEOUT 0x0A -#define SRB_STATUS_COMMAND_TIMEOUT 0x0B -#define SRB_STATUS_MESSAGE_REJECTED 0x0D -#define SRB_STATUS_BUS_RESET 0x0E -#define SRB_STATUS_PARITY_ERROR 0x0F -#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 -#define SRB_STATUS_NO_HBA 0x11 -#define SRB_STATUS_DATA_OVERRUN 0x12 -#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 -#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 -#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 -#define SRB_STATUS_REQUEST_FLUSHED 0x16 -#define SRB_STATUS_INVALID_LUN 0x20 -#define SRB_STATUS_INVALID_TARGET_ID 0x21 -#define SRB_STATUS_BAD_FUNCTION 0x22 -#define SRB_STATUS_ERROR_RECOVERY 0x23 - -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - -#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) - -typedef struct _SCSISCAN_CMD { - ULONG Reserved1; - ULONG Size; - ULONG SrbFlags; - UCHAR CdbLength; - UCHAR SenseLength; - UCHAR Reserved2; - UCHAR Reserved3; - ULONG TransferLength; - UCHAR Cdb[16]; - PUCHAR pSrbStatus; - PUCHAR pSenseBuffer; -} SCSISCAN_CMD, *PSCSISCAN_CMD; - -// Temporarily set to 128. Should be determined by other definition. -#define MAX_STRING 128 - -typedef struct _SCSISCAN_INFO{ - ULONG Size; - ULONG Flags; - UCHAR PortNumber; - UCHAR PathId; - UCHAR TargetId; - UCHAR Lun; - UCHAR AdapterName[MAX_STRING]; - ULONG Reserved; -} SCSISCAN_INFO, *PSCSISCAN_INFO; - -#define SCSISCAN_RESERVED 0x000 -#define SCSISCAN_CMD_CODE 0x004 -#define SCSISCAN_LOCKDEVICE 0x005 -#define SCSISCAN_UNLOCKDEVICE 0x006 -#define SCSISCAN_SET_TIMEOUT 0x007 -#define SCSISCAN_GET_INFO 0x008 - -//--------------------------------------------------------------------------- -// IOCTL definitions. -// Use these definitions when calling DeviceIoControl -//--------------------------------------------------------------------------- -#define IOCTL_SCSISCAN_CMD CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_CMD_CODE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_SCSISCAN_LOCKDEVICE CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_LOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_SCSISCAN_UNLOCKDEVICE CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_UNLOCKDEVICE, METHOD_OUT_DIRECT, FILE_ANY_ACCESS) -#define IOCTL_SCSISCAN_SET_TIMEOUT CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_SET_TIMEOUT, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SCSISCAN_GET_INFO CTL_CODE(FILE_DEVICE_SCANNER, SCSISCAN_GET_INFO , METHOD_OUT_DIRECT, FILE_ANY_ACCESS) - -#endif - diff --git a/qt-correction-tool/pub/ddk/scsiwmi.h b/qt-correction-tool/pub/ddk/scsiwmi.h deleted file mode 100644 index 8c19770..0000000 --- a/qt-correction-tool/pub/ddk/scsiwmi.h +++ /dev/null @@ -1,782 +0,0 @@ -/*++ BUILD Version: 0000 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - scsiwmi.h - -Abstract: - - This module contains the internal structure definitions and APIs used by - the SCSI WMILIB helper functions - - -Revision History: - - ---*/ - -#ifndef _SCSIWMI_ -#define _SCSIWMI_ - -#if defined (_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// This is a per-request context buffer that is needed for every wmi srb. -// The request context must remain valid throughout the entire processing -// of the srb, at least until ScsiPortWmiPostProcess returns with the -// final srb return status and buffer size. If the srb can -// pend then memory for this buffer should be allocated from the SRB -// extension. If not then the memory can be allocated from a stack frame that -// does not go out of scope. -// -typedef struct -{ - PVOID UserContext; // Available for miniport use - - ULONG BufferSize; // Reserved for SCSIWMI use - PUCHAR Buffer; // Reserved for SCSIWMI use - UCHAR MinorFunction;// Reserved for SCSIWMI use - - UCHAR ReturnStatus; // Available to miniport after ScsiPortWmiPostProcess - ULONG ReturnSize; // Available to miniport after ScsiPortWmiPostProcess - -} SCSIWMI_REQUEST_CONTEXT, *PSCSIWMI_REQUEST_CONTEXT; - - -#define ScsiPortWmiGetReturnStatus(RequestContext) ((RequestContext)->ReturnStatus) -#define ScsiPortWmiGetReturnSize(RequestContext) ((RequestContext)->ReturnSize) - -// -// This defines a guid to be registered with WMI. -// -typedef struct -{ - LPCGUID Guid; // Guid representing data block - ULONG InstanceCount; // Count of Instances of Datablock. If - // this count is 0xffffffff then the guid - // is assumed to be dynamic instance names - ULONG Flags; // Additional flags (see WMIREGINFO in wmistr.h) -} SCSIWMIGUIDREGINFO, *PSCSIWMIGUIDREGINFO; - -// -// If this is set then the guid is registered as having dynamic -// instance names. -// -#define WMIREG_FLAG_CALL_BY_NAME 0x40000000 - -typedef -__checkReturn -UCHAR -(*PSCSIWMI_QUERY_REGINFO) ( - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __out PWCHAR *MofResourceName - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to retrieve information about - the guids being registered. - - This callback is synchronous and may not be pended. Also - ScsiPortWmiPostProcess should not be called from within this callback. - -Arguments: - - DeviceContext is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - MofResourceName returns with a pointer to a WCHAR string with name of - the MOF resource attached to the miniport binary image file. If - the driver does not have a mof resource attached then this can - be returned as NULL. - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -typedef -__checkReturn -BOOLEAN -(*PSCSIWMI_QUERY_DATABLOCK) ( - __in PVOID Context, - __in PSCSIWMI_REQUEST_CONTEXT DispatchContext, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG InstanceCount, - __inout PULONG InstanceLengthArray, - __in ULONG BufferAvail, - __out_bcount(BufferAvail) PUCHAR Buffer - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to query for the contents of - one or more instances of a data block. This callback may be called with - an output buffer that is too small to return all of the data queried. - In this case the callback is responsible to report the correct output - buffer size needed. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and - FALSE returned. - - If the request cannot be completed within this callback then TRUE should - be returned. Once the pending operations are finished the miniport should - call ScsiPortWmiPostProcess and then complete the srb. - -Arguments: - - DeviceContext is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - GuidIndex is the index into the list of guids provided when the - miniport registered - - InstanceIndex is the index that denotes first instance of the data block - is being queried. - - InstanceCount is the number of instances expected to be returned for - the data block. - - InstanceLengthArray is a pointer to an array of ULONG that returns the - lengths of each instance of the data block. This may be NULL when - there is not enough space in the output buffer to fufill the request. - In this case the miniport should call ScsiPortWmiPostProcess with - a status of SRB_STATUS_DATA_OVERRUN and the size of the output buffer - needed to fufill the request. - - BufferAvail on entry has the maximum size available to write the data - blocks in the output buffer. If the output buffer is not large enough - to return all of the data blocks then the miniport should call - ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN - and the size of the output buffer needed to fufill the request. - - Buffer on return is filled with the returned data blocks. Note that each - instance of the data block must be aligned on a 8 byte boundry. This - may be NULL when there is not enough space in the output buffer to - fufill the request. In this case the miniport should call - ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN and - the size of the output buffer needed to fufill the request. - - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -typedef -__checkReturn -BOOLEAN -(*PSCSIWMI_SET_DATABLOCK) ( - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to set the contents of an - entire instance of a data block. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and - FALSE returned. - - If the request cannot be completed within this callback then TRUE should - be returned. Once the pending operations are finished the miniport should - call ScsiPortWmiPostProcess and then complete the srb. - -Arguments: - - DeviceContext is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - GuidIndex is the index into the list of guids provided when the - miniport registered - - InstanceIndex is the index that denotes which instance of the data block - is being set. - - BufferSize has the size of the data block passed - - Buffer has the new values for the data block - - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -typedef -__checkReturn -BOOLEAN -(*PSCSIWMI_SET_DATAITEM) ( - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG DataItemId, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to set a single data item - in a single instance of a data block. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and - FALSE returned. - - If the request cannot be completed within this callback then TRUE should - be returned. Once the pending operations are finished the miniport should - call ScsiPortWmiPostProcess and then complete the srb. - -Arguments: - - DeviceContext is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - GuidIndex is the index into the list of guids provided when the - miniport registered - - InstanceIndex is the index that denotes which instance of the data block - is being set. - - DataItemId has the id of the data item being set - - BufferSize has the size of the data item passed - - Buffer has the new values for the data item - - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -typedef -__checkReturn -BOOLEAN -(*PSCSIWMI_EXECUTE_METHOD) ( - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG MethodId, - __in ULONG InBufferSize, - __in ULONG OutBufferSize, - __inout_bcount_part(InBufferSize, OutBufferSize) PUCHAR Buffer - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to execute a method. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and - FALSE returned. - - If the request cannot be completed within this callback then TRUE should - be returned. Once the pending operations are finished the miniport should - call ScsiPortWmiPostProcess and then complete the srb. - -Arguments: - - Context is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - GuidIndex is the index into the list of guids provided when the - miniport registered - - InstanceIndex is the index that denotes which instance of the data block - is being called. - - MethodId has the id of the method being called - - InBufferSize has the size of the data block passed in as the input to - the method. - - OutBufferSize on entry has the maximum size available to write the - returned data block. If the output buffer is not large enough - to return all of the data blocks then the miniport should call - ScsiPortWmiPostProcess with a status of SRB_STATUS_DATA_OVERRUN - and the size of the output buffer needed to fufill the request. - It is important to check that there is sufficient room in the - output buffer before performing any operations that may have - side effects. - - Buffer on entry has the input data block and on return has the output - output data block. - - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -typedef enum -{ - ScsiWmiEventControl, // Enable or disable an event - ScsiWmiDataBlockControl // Enable or disable data block collection -} SCSIWMI_ENABLE_DISABLE_CONTROL; - -typedef -__checkReturn -BOOLEAN -(*PSCSIWMI_FUNCTION_CONTROL) ( - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG GuidIndex, - __in SCSIWMI_ENABLE_DISABLE_CONTROL Function, - __in BOOLEAN Enable - ); -/*++ - -Routine Description: - - This routine is a callback into the miniport to enabled or disable event - generation or data block collection. Since WMI manages reference counting - for each of the data blocks or events, a miniport should only expect a - single enable followed by a single disable. Data blocks will only - receive collection enable/disable if they were registered as requiring - it, that is include the WMIREG_FLAG_EXPENSIVE flag. - - If the request can be completed immediately without pending, - ScsiPortWmiPostProcess should be called from within this callback and - FALSE returned. - - If the request cannot be completed within this callback then TRUE should - be returned. Once the pending operations are finished the miniport should - call ScsiPortWmiPostProcess and then complete the srb. - -Arguments: - - DeviceContext is a caller specified context value originally passed to - ScsiPortWmiDispatchFunction. - - RequestContext is a context associated with the srb being processed. - - Function specifies which functionality is being enabled or disabled - - Enable is TRUE then the function is being enabled else disabled - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -// -// This structure supplies context information for SCSIWMILIB to process the -// WMI srbs. -// -typedef struct _SCSIWMILIB_CONTEXT -{ - // - // WMI data block guid registration info - ULONG GuidCount; - PSCSIWMIGUIDREGINFO GuidList; - - // - // WMI functionality callbacks - PSCSIWMI_QUERY_REGINFO QueryWmiRegInfo; - PSCSIWMI_QUERY_DATABLOCK QueryWmiDataBlock; - PSCSIWMI_SET_DATABLOCK SetWmiDataBlock; - PSCSIWMI_SET_DATAITEM SetWmiDataItem; - PSCSIWMI_EXECUTE_METHOD ExecuteWmiMethod; - PSCSIWMI_FUNCTION_CONTROL WmiFunctionControl; -} SCSI_WMILIB_CONTEXT, *PSCSI_WMILIB_CONTEXT; - -VOID -ScsiPortWmiPostProcess( - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in UCHAR SrbStatus, - __in ULONG BufferUsed - ); -/*++ - -Routine Description: - - - This routine will do the work of post-processing a WMI srb. - -Arguments: - - RequestContext is a context associated with the srb being processed. After - this api returns the ReturnStatus and ReturnSize fields are updated. - - SrbStatus has the return status code for the srb. If a query or method - callback was passed an output buffer that was not large enough - then SrbStatus should be SRB_STATUS_DATA_OVERRUN and BufferUsed - should be the number of bytes needed in the output buffer. - - BufferUsed has the number of bytes required by the miniport to return the - data requested in the WMI srb. If SRB_STATUS_DATA_OVERRUN was passed - in SrbStatus then BufferUsed has the number of needed in the output - buffer. If SRB_STATUS_SUCCESS is passed in SrbStatus then BufferUsed - has the actual number of bytes used in the output buffer. - -Return Value: - - ---*/ - -__checkReturn -BOOLEAN -ScsiPortWmiDispatchFunction( - __in PSCSI_WMILIB_CONTEXT WmiLibInfo, - __in UCHAR MinorFunction, - __in PVOID DeviceContext, - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in PVOID DataPath, - __in ULONG BufferSize, - __in PVOID Buffer - ); -/*++ - -Routine Description: - - Dispatch helper routine for WMI srb requests. Based on the Minor - function passed the WMI request is processed and this routine - invokes the appropriate callback in the WMILIB structure. - -Arguments: - - WmiLibInfo has the SCSI WMILIB information control block associated - with the adapter or logical unit - - DeviceContext is miniport defined context value passed on to the callbacks - invoked by this api. - - RequestContext is a pointer to a context structure that maintains - information about this WMI srb. This request context must remain - valid throughout the entire processing of the srb, at least until - ScsiPortWmiPostProcess returns with the final srb return status and - buffer size. If the srb can pend then memory for this buffer should - be allocated from the SRB extension. If not then the memory can be - allocated from a stack frame that does not go out of scope, perhaps - that of the caller to this api. - - DataPath is value passed in wmi request - - BufferSize is value passed in wmi request - - Buffer is value passed in wmi request - -Return Value: - - TRUE if request is pending else FALSE - ---*/ - -#define ScsiPortWmiFireAdapterEvent( \ - HwDeviceExtension, \ - Guid, \ - InstanceIndex, \ - EventDataSize, \ - EventData \ - ) \ - ScsiPortWmiFireLogicalUnitEvent(\ - HwDeviceExtension, \ - 0xff, \ - 0, \ - 0, \ - Guid, \ - InstanceIndex, \ - EventDataSize, \ - EventData) -/*++ - -Routine Description: - - This routine will fire a WMI event associated with an adapter using - the data buffer passed. This routine may be called at or below DPC level. - -Arguments: - - HwDeviceExtension is the adapter device extension - - Guid is pointer to the GUID that represents the event - - InstanceIndex is the index of the instance of the event - - EventDataSize is the number of bytes of data that is being fired with - with the event. This size specifies the size of the event data only - and does NOT include the 0x40 bytes of preceeding padding. - - EventData is the data that is fired with the events. There must be exactly - 0x40 bytes of padding preceeding the event data. - -Return Value: - ---*/ - -VOID -ScsiPortWmiFireLogicalUnitEvent( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in LPGUID Guid, - __in ULONG InstanceIndex, - __in ULONG EventDataSize, - __in PVOID EventData - ); -/*++ - -Routine Description: - - This routine will fire a WMI event using the data buffer passed. This - routine may be called at or below DPC level - -Arguments: - - HwDeviceExtension is the adapter device extension - - PathId identifies the SCSI bus if a logical unit is firing the event - or is 0xff if the adapter is firing the event. - - TargetId identifies the target controller or device on the bus - - Lun identifies the logical unit number of the target device - - Guid is pointer to the GUID that represents the event - - InstanceIndex is the index of the instance of the event - - EventDataSize is the number of bytes of data that is being fired with - with the event. This size specifies the size of the event data only - and does NOT include the 0x40 bytes of preceeding padding. - - EventData is the data that is fired with the events. There must be exactly - 0x40 bytes of padding preceeding the event data. - -Return Value: - ---*/ - -#if (NTDDI_VERSION >= NTDDI_WS03) -// -// This macro determines if the WMI request is a QueryAllData request -// or a different request -// -#define ScsiPortWmiIsQueryAllData(RequestContext) \ - ( (RequestContext)->MinorFunction == WMI_GET_ALL_DATA ) - -__checkReturn -PWCHAR ScsiPortWmiGetInstanceName( - __in PSCSIWMI_REQUEST_CONTEXT RequestContext - ); -/*++ - -Routine Description: - - This routine will return a pointer to the instance name that was - used to pass the request. If the request type is one that does not - use an instance name then NULL is retuened. The instance name is a - counted string. - -Arguments: - - RequestContext is a pointer to a context structure that maintains - information about this WMI srb. This request context must remain - valid throughout the entire processing of the srb, at least until - ScsiPortWmiPostProcess returns with the final srb return status and - buffer size. If the srb can pend then memory for this buffer should - be allocated from the SRB extension. If not then the memory can be - allocated from a stack frame that does not go out of scope, perhaps - that of the caller to this api. - -Return Value: - - Pointer to instance name or NULL if no instance name is available - ---*/ - -__checkReturn -BOOLEAN ScsiPortWmiSetInstanceCount( - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG InstanceCount, - __out PULONG BufferAvail, - __out PULONG SizeNeeded - ); -/*++ - -Routine Description: - - This routine will update the wnode to indicate the number of - instances that will be returned by the driver. Note that the values - for BufferAvail may change after this call. This routine - may only be called for a WNODE_ALL_DATA. This routine must be - called before calling ScsiPortWmiSetInstanceName or - ScsiPortWmiSetData - -Arguments: - - RequestContext is a pointer to a context structure that maintains - information about this WMI srb. This request context must remain - valid throughout the entire processing of the srb, at least until - ScsiPortWmiPostProcess returns with the final srb return status and - buffer size. If the srb can pend then memory for this buffer should - be allocated from the SRB extension. If not then the memory can be - allocated from a stack frame that does not go out of scope, perhaps - that of the caller to this api. - - InstanceCount is the number of instances to be returned by the - driver. - - *BufferAvail returns with the number of bytes available for - instance names and data in the buffer. This may be 0 if there - is not enough room for all instances. - - *SizeNeeded returns with the number of bytes that are needed so far - to build the output wnode - -Return Value: - - TRUE if successful else FALSE. If FALSE wnode is not a - WNODE_ALL_DATA or does not have dynamic instance names. - ---*/ - -__checkReturn -PWCHAR ScsiPortWmiSetInstanceName( - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG InstanceIndex, - __in ULONG InstanceNameLength, - __out PULONG BufferAvail, - __inout PULONG SizeNeeded - ); -/*++ - -Routine Description: - - This routine will update the wnode header to include the position where an - instance name is to be written. Note that the values - for BufferAvail may change after this call. This routine - may only be called for a WNODE_ALL_DATA. - -Arguments: - - RequestContext is a pointer to a context structure that maintains - information about this WMI srb. This request context must remain - valid throughout the entire processing of the srb, at least until - ScsiPortWmiPostProcess returns with the final srb return status and - buffer size. If the srb can pend then memory for this buffer should - be allocated from the SRB extension. If not then the memory can be - allocated from a stack frame that does not go out of scope, perhaps - that of the caller to this api. - - InstanceIndex is the index to the instance name being filled in - - InstanceNameLength is the number of bytes (including count) needed - to write the instance name. - - *BufferAvail returns with the number of bytes available for - instance names and data in the buffer. This may be 0 if there - is not enough room for the instance name. - - *SizeNeeded on entry has the number of bytes needed so far to build - the WNODE and on return has the number of bytes needed to build - the wnode after including the instance name - -Return Value: - - pointer to where the instance name should be filled in. If NULL - then the wnode is not a WNODE_ALL_DATA or does not have dynamic - instance names - ---*/ - -__checkReturn -PVOID ScsiPortWmiSetData( - __in PSCSIWMI_REQUEST_CONTEXT RequestContext, - __in ULONG InstanceIndex, - __in ULONG DataLength, - __out PULONG BufferAvail, - __inout PULONG SizeNeeded - ); -/*++ - -Routine Description: - - This routine will update the wnode to indicate the position of the - data for an instance that will be returned by the driver. Note that - the values for BufferAvail may change after this call. This routine - may only be called for a WNODE_ALL_DATA. - -Arguments: - - RequestContext is a pointer to a context structure that maintains - information about this WMI srb. This request context must remain - valid throughout the entire processing of the srb, at least until - ScsiPortWmiPostProcess returns with the final srb return status and - buffer size. If the srb can pend then memory for this buffer should - be allocated from the SRB extension. If not then the memory can be - allocated from a stack frame that does not go out of scope, perhaps - that of the caller to this api. - - InstanceIndex is the index to the instance name being filled in - - DataLength is the number of bytes needed to write the data. - - *BufferAvail returns with the number of bytes available for - instance names and data in the buffer. This may be 0 if there - is not enough room for the data. - - *SizeNeeded on entry has the number of bytes needed so far to build - the WNODE and on return has the number of bytes needed to build - the wnode after including the data - -Return Value: - - pointer to where the data should be filled in. If NULL - then the wnode is not a WNODE_ALL_DATA or does not have dynamic - instance names - ---*/ -#endif - - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/qt-correction-tool/pub/ddk/sddef.h b/qt-correction-tool/pub/ddk/sddef.h deleted file mode 100644 index 8e99bf8..0000000 --- a/qt-correction-tool/pub/ddk/sddef.h +++ /dev/null @@ -1,226 +0,0 @@ -/*++ - -Copyright (c) 2003 Microsoft Corporation - -Module Name: - - sddef.h - -Abstract: - - This is the include file that defines the basic types used - in the SD (Secure Digital) driver stack interface. These types - are used in conjuction with header files NTDDSD.H or SFFDISK.H. - ---*/ - -#ifndef _SDDEFH_ -#define _SDDEFH_ - -#if _MSC_VER > 1000 -#pragma once -#endif - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -// -// Disable warning: nonstandard extension used : bit field types other than int -// - -#pragma warning(disable:4214) - -#ifdef __cplusplus -extern "C" { -#endif - - -// -// SD device commands codes either refer to the standard command -// set (0-63), or to the "App Cmd" set, which have the same value range, -// but are preceded by the app_cmd escape (55). -// - -typedef UCHAR SD_COMMAND_CODE; - -typedef enum { - SDCC_STANDARD = 0, - SDCC_APP_CMD -} SD_COMMAND_CLASS; -// -// SDTD_READ indicates data transfer from the SD device to the host -// SDTD_WRITE indicates data transfer from the SD host to the device -// - -typedef enum { - SDTD_UNSPECIFIED = 0, - SDTD_READ, - SDTD_WRITE -} SD_TRANSFER_DIRECTION; - - -// -// Transfer type refers to the style of data transfer of the SD data -// lines. Note that a command may have a response, but still not use -// the data lines (no_data). -// - -typedef enum { - SDTT_UNSPECIFIED = 0, - SDTT_CMD_ONLY, - SDTT_SINGLE_BLOCK, - SDTT_MULTI_BLOCK, - SDTT_MULTI_BLOCK_NO_CMD12 -} SD_TRANSFER_TYPE; - - -// -// SD transfer responses are defined in the SD spec. A given command -// will only exhibit one of these responses. But because the interface -// allows function drivers to issue undefined commands, the transfer -// response may also need to be specified. -// - -typedef enum { - SDRT_UNSPECIFIED = 0, - SDRT_NONE, - SDRT_1, - SDRT_1B, - SDRT_2, - SDRT_3, - SDRT_4, - SDRT_5, - SDRT_5B, - SDRT_6 -} SD_RESPONSE_TYPE; - -// -// Response structures are mapped into the response data field in the -// request packet -// - -typedef struct _SDRESP_TYPE3 { - ULONG Reserved1:4; - ULONG VoltageProfile:20; - ULONG Reserved2:7; - ULONG PowerState:1; -} SDRESP_TYPE3, *PSDRESP_TYPE3; - -// -// OCR Register structure for Physical Specification Version 2.00 or higher -// -typedef struct _OCR_REGISTER_V2 { - ULONG Reserved1:7; - ULONG VoltageProfile1:1; - ULONG Reserved2:7; - ULONG VoltageProfile2:9; - ULONG Reserved3:6; - ULONG CardCapacityStatus:1; - ULONG PowerState:1; -} OCR_REGISTER_V2, *POCR_REGISTER_V2; - -// -// This structure defines a specific SD device command. Function drivers -// must build this structure to pass as a parameter to the DeviceCommand request. -// -// Cmd - SD device code -// CmdClass - specifies whether the command is a standard or APP command -// TransferDirection - direction of data on SD data lines -// TransferType - 3 types of commands: CmdOnly, SingleBlock or MultiBlock -// ResponseType - SD response type -// -// For example, a driver can issue single byte (direct) I/O reads -// to an SDIO function by first defining the following structure: -// -// const SDCMD_DESCRIPTOR ReadIoDirectDesc = -// {SDCMD_IO_RW_DIRECT, SDTD_STANDARD, SDTD_READ, SDTT_CMD_ONLY, SDRT_5}; -// -// Then, before the call to SdbusSubmitRequest(), copy this structure -// and the argument of the command to the request packet: -// -// sdrp->RequestFunction = SDRF_DEVICE_COMMAND; -// sdrp->Parameters.DeviceCommand.CmdDesc = ReadIoDirectDesc; -// sdrp->Parameters.DeviceCommand.Argument = argument; -// status = SdBusSubmitRequest(interfaceContext, sdrp); -// -// - -typedef struct _SDCMD_DESCRIPTOR { - - SD_COMMAND_CODE Cmd; - SD_COMMAND_CLASS CmdClass; - - SD_TRANSFER_DIRECTION TransferDirection; - SD_TRANSFER_TYPE TransferType; - SD_RESPONSE_TYPE ResponseType; - -} SDCMD_DESCRIPTOR, *PSDCMD_DESCRIPTOR; - - -// -// Class-neutral SD device definitions -// -// Note that the SDIO arguments may be validated by the bus driver. For -// example, the bus driver will reject attempts to write into the function -// space of a different function on an SD combo card. -// - -typedef struct _SD_RW_DIRECT_ARGUMENT { - - union { - struct { - ULONG Data:8; - ULONG Reserved1:1; - ULONG Address:17; - ULONG Reserved2:1; - ULONG ReadAfterWrite:1; - ULONG Function:3; - ULONG WriteToDevice:1; - } bits; - - ULONG AsULONG; - } u; - -} SD_RW_DIRECT_ARGUMENT, *PSD_RW_DIRECT_ARGUMENT; - -typedef struct _SD_RW_EXTENDED_ARGUMENT { - - union { - struct { - ULONG Count:9; - ULONG Address:17; - ULONG OpCode:1; - ULONG BlockMode:1; - ULONG Function:3; - ULONG WriteToDevice:1; - } bits; - - ULONG AsULONG; - } u; - -} SD_RW_EXTENDED_ARGUMENT, *PSD_RW_EXTENDED_ARGUMENT; - - -// -// Class-neutral SD codes -// -// provided here are SD command codes that are not class specific. -// Typically other codes are defined in the class driver for the -// respective device class. -// - -#define SDCMD_IO_RW_DIRECT 52 -#define SDCMD_IO_RW_EXTENDED 53 - - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#endif - diff --git a/qt-correction-tool/pub/ddk/sdplib.h b/qt-correction-tool/pub/ddk/sdplib.h deleted file mode 100644 index 2c17323..0000000 --- a/qt-correction-tool/pub/ddk/sdplib.h +++ /dev/null @@ -1,366 +0,0 @@ -#ifndef __SDPLIB_H__ -#define __SDPLIB_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "sdpnode.h" - -#ifndef NTSTATUS -typedef LONG NTSTATUS; -#endif - -#ifdef _NTDDK_ -#define SDPLIB_KERNEL -#endif - -#ifdef SDPLIB_KERNEL -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_TREE_ROOT_NODE -SdpCreateNodeTree( - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeNil( - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUInt128( - __in PSDP_ULARGE_INTEGER_16 puli16Val, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUInt64( - __in ULONGLONG ullVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUInt32( - __in ULONG ulVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUInt16( - __in USHORT usVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUInt8( - __in UCHAR ucVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeInt128( - __in PSDP_LARGE_INTEGER_16 uil16Val, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeInt64( - __in LONGLONG llVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeInt32( - __in LONG lVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeInt16( - __in SHORT sVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeInt8( - __in CHAR cVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUUID128( - __in const GUID *uuid, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUUID32( - __in ULONG uuidVal4, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUUID16( - __in USHORT uuidVal2, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeBoolean( - __in SDP_BOOLEAN bVal, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeSequence( - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeAlternative( - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeUrl( - __in_bcount(UrlLength) PCHAR url, - __in_bound ULONG urlLength, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -NTSTATUS -SdpAddAttributeToTree( - __in PSDP_TREE_ROOT_NODE Tree, - __in USHORT AttribId, - __in __drv_when(return==0, __drv_aliasesMem) PSDP_NODE AttribValue, - __in ULONG tag - ); - -__checkReturn -__drv_sameIRQL -__drv_when(return!=0, __drv_allocatesMem(Mem)) -PSDP_NODE -SdpCreateNodeString( - __in_bcount(StringLength) PCHAR string, - __in_bound ULONG stringLength, - __in ULONG tag - ); - -#else //SDPLIB_KERNEL - -__checkReturn -PSDP_TREE_ROOT_NODE -SdpCreateNodeTree(); - -__checkReturn -PSDP_NODE -SdpCreateNodeNil(); - -__checkReturn -PSDP_NODE -SdpCreateNodeUInt128( - __in PSDP_ULARGE_INTEGER_16 puli16Val - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUInt64( - __in ULONGLONG ullVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUInt32( - __in ULONG ulVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUInt16( - __in USHORT usVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUInt8( - __in UCHAR ucVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeInt128( - __in PSDP_LARGE_INTEGER_16 uil16Val - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeInt64( - __in LONGLONG llVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeInt32( - __in LONG lVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeInt16( - __in SHORT sVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeInt8( - __in CHAR cVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUUID128( - __in const GUID *uuid - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUUID32( - __in ULONG uuidVal4 - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeUUID16( - __in USHORT uuidVal2 - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeBoolean( - __in SDP_BOOLEAN bVal - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeSequence(); - -__checkReturn -PSDP_NODE -SdpCreateNodeAlternative(); - -__checkReturn -PSDP_NODE -SdpCreateNodeUrl( - __in_bcount(UrlLength) PCHAR url, - __in_bound ULONG urlLength - ); - -__checkReturn -NTSTATUS -SdpAddAttributeToTree( - __in PSDP_TREE_ROOT_NODE Tree, - __in USHORT AttribId, - __in PSDP_NODE AttribValue - ); - -__checkReturn -PSDP_NODE -SdpCreateNodeString( - __in_bcount(StringLength) PCHAR string, - __in_bound ULONG stringLength - ); - -#endif //SDPLIB_KERNEL - -__drv_sameIRQL -__success(TRUE) -NTSTATUS -SdpFreeTree( - __in __drv_freesMem(Mem) PSDP_TREE_ROOT_NODE Tree - ); - -#define SdpCreateNodeUUID SdpCreateNodeUUID128 - -__checkReturn -__drv_sameIRQL -NTSTATUS -SdpAppendNodeToContainerNode( - __in PSDP_NODE Parent, - __in __drv_aliasesMem PSDP_NODE Node - ); - -__checkReturn -__drv_sameIRQL -NTSTATUS -SdpFindAttributeInTree( - __in PSDP_TREE_ROOT_NODE Tree, - __in USHORT AttribId, - __out PSDP_NODE *Attribute - ); - -#ifdef __cplusplus -}; -#endif - - -#endif - - diff --git a/qt-correction-tool/pub/ddk/sdpnode.h b/qt-correction-tool/pub/ddk/sdpnode.h deleted file mode 100644 index dac397b..0000000 --- a/qt-correction-tool/pub/ddk/sdpnode.h +++ /dev/null @@ -1,114 +0,0 @@ -#ifndef __SDPNODE_H__ -#define __SDPNODE_H__ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4201) // nameless struct/union - -#if (NTDDI_VERSION >= NTDDI_VISTA) - - -#ifdef __cplusplus -extern "C" { -#endif - - - typedef UCHAR SDP_BOOLEAN; - -typedef struct ISdpNodeContainer ISdpNodeContainer; - -typedef struct _SDP_NODE_HEADER { - LIST_ENTRY Link; - USHORT Type; - USHORT SpecificType; -} SDP_NODE_HEADER, *PSDP_NODE_HEADER; - -typedef union _SDP_NODE_DATA { - // the nil type contains no data, so no storage is necessary - - // 16 byte integers - // - // ISSUE is there a better way to represent a 16 byte int??? - // - SDP_LARGE_INTEGER_16 int128; - SDP_ULARGE_INTEGER_16 uint128; - - // UUID - GUID uuid128; - ULONG uuid32; - USHORT uuid16; - - // 8 byte integers - LONGLONG int64; - ULONGLONG uint64; - - // 4 byte integers - LONG int32; - ULONG uint32; - - // 2 byte integers - SHORT int16; - USHORT uint16; - - // 1 bytes integers - CHAR int8; - UCHAR uint8; - - // Boolean - SDP_BOOLEAN boolean; - - // string - PCHAR string; - - // URL - PCHAR url; - - // Sequence - SDP_NODE_HEADER sequence; - - // Alt list - SDP_NODE_HEADER alternative; - - ISdpNodeContainer *container; - - struct { - PUCHAR stream; - ULONG streamLength; - }; - -} SDP_NODE_DATA, *PSDP_NODE_DATA; - -typedef struct _SDP_NODE { - SDP_NODE_HEADER hdr; - - ULONG DataSize; - - SDP_NODE_DATA u; - - PVOID Reserved; -} SDP_NODE, *PSDP_NODE; - -typedef struct _SDP_TREE_ROOT_NODE { - SDP_NODE RootNode; -} SDP_TREE_ROOT_NODE, *PSDP_TREE_ROOT_NODE; - - - - - -#ifdef __cplusplus -} - -#endif -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4201) -#endif - -#endif // __SDPNODE_H__ - - diff --git a/qt-correction-tool/pub/ddk/sdv_driverspecs.h b/qt-correction-tool/pub/ddk/sdv_driverspecs.h deleted file mode 100644 index ca61caa..0000000 --- a/qt-correction-tool/pub/ddk/sdv_driverspecs.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef SDV -// general purpose save -//----------------------- -#define __sdv_save_request(r) -// general purpose retrieve -//----------------------- -#define __sdv_retrieve_request(r) - -// NDIS AdapterContext save -//----------------------- -#define __sdv_save_adapter_context(c) - -#else -// general purpose save -//----------------------- -//#define __sdv_save sdv_save -//void sdv_save(void *r){;} -// general purpose retrieve macros -//----------------------- -//#define __sdv_retrieve sdv_retrieve -//void sdv_retrieve(void *r){;} -#endif - diff --git a/qt-correction-tool/pub/ddk/sensorsclassextension.h b/qt-correction-tool/pub/ddk/sensorsclassextension.h deleted file mode 100644 index 3f6aa10..0000000 --- a/qt-correction-tool/pub/ddk/sensorsclassextension.h +++ /dev/null @@ -1,516 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for windowssensorclassextension.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __windowssensorclassextension_h__ -#define __windowssensorclassextension_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ISensorDriver_FWD_DEFINED__ -#define __ISensorDriver_FWD_DEFINED__ -typedef interface ISensorDriver ISensorDriver; -#endif /* __ISensorDriver_FWD_DEFINED__ */ - - -#ifndef __ISensorClassExtension_FWD_DEFINED__ -#define __ISensorClassExtension_FWD_DEFINED__ -typedef interface ISensorClassExtension ISensorClassExtension; -#endif /* __ISensorClassExtension_FWD_DEFINED__ */ - - -#ifndef __SensorClassExtension_FWD_DEFINED__ -#define __SensorClassExtension_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SensorClassExtension SensorClassExtension; -#else -typedef struct SensorClassExtension SensorClassExtension; -#endif /* __cplusplus */ - -#endif /* __SensorClassExtension_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "propidl.h" -#include "wudfddi.h" -#include "PortableDeviceTypes.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_windowssensorclassextension_0000_0000 */ -/* [local] */ - -#if (_WIN32_WINNT >= 0x0600) // Windows Vista and later -typedef /* [public][public] */ -enum __MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0001 - { SENSOR_STATE_MIN = 0, - SENSOR_STATE_READY = SENSOR_STATE_MIN, - SENSOR_STATE_NOT_AVAILABLE = ( SENSOR_STATE_READY + 1 ) , - SENSOR_STATE_NO_DATA = ( SENSOR_STATE_NOT_AVAILABLE + 1 ) , - SENSOR_STATE_INITIALIZING = ( SENSOR_STATE_NO_DATA + 1 ) , - SENSOR_STATE_ACCESS_DENIED = ( SENSOR_STATE_INITIALIZING + 1 ) , - SENSOR_STATE_ERROR = ( SENSOR_STATE_ACCESS_DENIED + 1 ) , - SENSOR_STATE_MAX = SENSOR_STATE_ERROR - } SensorState; - -typedef /* [public] */ -enum __MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0002 - { SENSOR_CONNECTION_TYPE_PC_INTEGRATED = 0, - SENSOR_CONNECTION_TYPE_PC_ATTACHED = ( SENSOR_CONNECTION_TYPE_PC_INTEGRATED + 1 ) , - SENSOR_CONNECTION_TYPE_PC_EXTERNAL = ( SENSOR_CONNECTION_TYPE_PC_ATTACHED + 1 ) - } SensorConnectionType; - -typedef -enum LOCATION_DESIRED_ACCURACY - { LOCATION_DESIRED_ACCURACY_DEFAULT = 0, - LOCATION_DESIRED_ACCURACY_HIGH = ( LOCATION_DESIRED_ACCURACY_DEFAULT + 1 ) - } LOCATION_DESIRED_ACCURACY; - - - -extern RPC_IF_HANDLE __MIDL_itf_windowssensorclassextension_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_windowssensorclassextension_0000_0000_v0_0_s_ifspec; - -#ifndef __ISensorDriver_INTERFACE_DEFINED__ -#define __ISensorDriver_INTERFACE_DEFINED__ - -/* interface ISensorDriver */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISensorDriver; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("D262B6BA-87CC-495D-B639-939EF853BD3B") - ISensorDriver : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnGetSupportedSensorObjects( - /* [out] */ __RPC__deref_out_opt IPortableDeviceValuesCollection **ppSensorObjectCollection) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetSupportedProperties( - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppSupportedProperties) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetSupportedDataFields( - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppSupportedDataFields) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetSupportedEvents( - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pulEventCount) GUID **ppSupportedEvents, - /* [out] */ __RPC__out ULONG *pulEventCount) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetProperties( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pProperties, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppPropertyValues) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetDataFields( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pDataFields, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppDataValues) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetProperties( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pPropertiesToSet, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppResults) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnClientConnect( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnClientDisconnect( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnClientSubscribeToEvents( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnClientUnsubscribeFromEvents( - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnProcessWpdMessage( - /* [in] */ __RPC__in_opt IUnknown *pUnkPortableDeviceValuesParams, - /* [in] */ __RPC__in_opt IUnknown *pUnkPortableDeviceValuesResults) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISensorDriverVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISensorDriver * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISensorDriver * This); - - HRESULT ( STDMETHODCALLTYPE *OnGetSupportedSensorObjects )( - __RPC__in ISensorDriver * This, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValuesCollection **ppSensorObjectCollection); - - HRESULT ( STDMETHODCALLTYPE *OnGetSupportedProperties )( - __RPC__in ISensorDriver * This, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppSupportedProperties); - - HRESULT ( STDMETHODCALLTYPE *OnGetSupportedDataFields )( - __RPC__in ISensorDriver * This, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [out] */ __RPC__deref_out_opt IPortableDeviceKeyCollection **ppSupportedDataFields); - - HRESULT ( STDMETHODCALLTYPE *OnGetSupportedEvents )( - __RPC__in ISensorDriver * This, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pulEventCount) GUID **ppSupportedEvents, - /* [out] */ __RPC__out ULONG *pulEventCount); - - HRESULT ( STDMETHODCALLTYPE *OnGetProperties )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pProperties, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppPropertyValues); - - HRESULT ( STDMETHODCALLTYPE *OnGetDataFields )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceKeyCollection *pDataFields, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppDataValues); - - HRESULT ( STDMETHODCALLTYPE *OnSetProperties )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceValues *pPropertiesToSet, - /* [out] */ __RPC__deref_out_opt IPortableDeviceValues **ppResults); - - HRESULT ( STDMETHODCALLTYPE *OnClientConnect )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID); - - HRESULT ( STDMETHODCALLTYPE *OnClientDisconnect )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID); - - HRESULT ( STDMETHODCALLTYPE *OnClientSubscribeToEvents )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID); - - HRESULT ( STDMETHODCALLTYPE *OnClientUnsubscribeFromEvents )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IWDFFile *pClientFile, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID); - - HRESULT ( STDMETHODCALLTYPE *OnProcessWpdMessage )( - __RPC__in ISensorDriver * This, - /* [in] */ __RPC__in_opt IUnknown *pUnkPortableDeviceValuesParams, - /* [in] */ __RPC__in_opt IUnknown *pUnkPortableDeviceValuesResults); - - END_INTERFACE - } ISensorDriverVtbl; - - interface ISensorDriver - { - CONST_VTBL struct ISensorDriverVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISensorDriver_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISensorDriver_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISensorDriver_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISensorDriver_OnGetSupportedSensorObjects(This,ppSensorObjectCollection) \ - ( (This)->lpVtbl -> OnGetSupportedSensorObjects(This,ppSensorObjectCollection) ) - -#define ISensorDriver_OnGetSupportedProperties(This,pwszSensorID,ppSupportedProperties) \ - ( (This)->lpVtbl -> OnGetSupportedProperties(This,pwszSensorID,ppSupportedProperties) ) - -#define ISensorDriver_OnGetSupportedDataFields(This,pwszSensorID,ppSupportedDataFields) \ - ( (This)->lpVtbl -> OnGetSupportedDataFields(This,pwszSensorID,ppSupportedDataFields) ) - -#define ISensorDriver_OnGetSupportedEvents(This,pwszSensorID,ppSupportedEvents,pulEventCount) \ - ( (This)->lpVtbl -> OnGetSupportedEvents(This,pwszSensorID,ppSupportedEvents,pulEventCount) ) - -#define ISensorDriver_OnGetProperties(This,pClientFile,pwszSensorID,pProperties,ppPropertyValues) \ - ( (This)->lpVtbl -> OnGetProperties(This,pClientFile,pwszSensorID,pProperties,ppPropertyValues) ) - -#define ISensorDriver_OnGetDataFields(This,pClientFile,pwszSensorID,pDataFields,ppDataValues) \ - ( (This)->lpVtbl -> OnGetDataFields(This,pClientFile,pwszSensorID,pDataFields,ppDataValues) ) - -#define ISensorDriver_OnSetProperties(This,pClientFile,pwszSensorID,pPropertiesToSet,ppResults) \ - ( (This)->lpVtbl -> OnSetProperties(This,pClientFile,pwszSensorID,pPropertiesToSet,ppResults) ) - -#define ISensorDriver_OnClientConnect(This,pClientFile,pwszSensorID) \ - ( (This)->lpVtbl -> OnClientConnect(This,pClientFile,pwszSensorID) ) - -#define ISensorDriver_OnClientDisconnect(This,pClientFile,pwszSensorID) \ - ( (This)->lpVtbl -> OnClientDisconnect(This,pClientFile,pwszSensorID) ) - -#define ISensorDriver_OnClientSubscribeToEvents(This,pClientFile,pwszSensorID) \ - ( (This)->lpVtbl -> OnClientSubscribeToEvents(This,pClientFile,pwszSensorID) ) - -#define ISensorDriver_OnClientUnsubscribeFromEvents(This,pClientFile,pwszSensorID) \ - ( (This)->lpVtbl -> OnClientUnsubscribeFromEvents(This,pClientFile,pwszSensorID) ) - -#define ISensorDriver_OnProcessWpdMessage(This,pUnkPortableDeviceValuesParams,pUnkPortableDeviceValuesResults) \ - ( (This)->lpVtbl -> OnProcessWpdMessage(This,pUnkPortableDeviceValuesParams,pUnkPortableDeviceValuesResults) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISensorDriver_INTERFACE_DEFINED__ */ - - -#ifndef __ISensorClassExtension_INTERFACE_DEFINED__ -#define __ISensorClassExtension_INTERFACE_DEFINED__ - -/* interface ISensorClassExtension */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISensorClassExtension; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A31253BA-6F73-4BC9-ABAA-26C8833C58FF") - ISensorClassExtension : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Initialize( - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSensorDriverUnknown) = 0; - - virtual HRESULT STDMETHODCALLTYPE Uninitialize( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE ProcessIoControl( - /* [in] */ __RPC__in_opt IWDFIoRequest *pRequest) = 0; - - virtual HRESULT STDMETHODCALLTYPE PostEvent( - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceValuesCollection *pEventCollection) = 0; - - virtual HRESULT STDMETHODCALLTYPE PostStateChange( - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ SensorState state) = 0; - - virtual HRESULT STDMETHODCALLTYPE CleanupFile( - /* [in] */ __RPC__in_opt IWDFFile *pWdfFile) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISensorClassExtensionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISensorClassExtension * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISensorClassExtension * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISensorClassExtension * This); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - __RPC__in ISensorClassExtension * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSensorDriverUnknown); - - HRESULT ( STDMETHODCALLTYPE *Uninitialize )( - __RPC__in ISensorClassExtension * This); - - HRESULT ( STDMETHODCALLTYPE *ProcessIoControl )( - __RPC__in ISensorClassExtension * This, - /* [in] */ __RPC__in_opt IWDFIoRequest *pRequest); - - HRESULT ( STDMETHODCALLTYPE *PostEvent )( - __RPC__in ISensorClassExtension * This, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ __RPC__in_opt IPortableDeviceValuesCollection *pEventCollection); - - HRESULT ( STDMETHODCALLTYPE *PostStateChange )( - __RPC__in ISensorClassExtension * This, - /* [in][string] */ __RPC__in_string LPWSTR pwszSensorID, - /* [in] */ SensorState state); - - HRESULT ( STDMETHODCALLTYPE *CleanupFile )( - __RPC__in ISensorClassExtension * This, - /* [in] */ __RPC__in_opt IWDFFile *pWdfFile); - - END_INTERFACE - } ISensorClassExtensionVtbl; - - interface ISensorClassExtension - { - CONST_VTBL struct ISensorClassExtensionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISensorClassExtension_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISensorClassExtension_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISensorClassExtension_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISensorClassExtension_Initialize(This,pWdfDeviceUnknown,pSensorDriverUnknown) \ - ( (This)->lpVtbl -> Initialize(This,pWdfDeviceUnknown,pSensorDriverUnknown) ) - -#define ISensorClassExtension_Uninitialize(This) \ - ( (This)->lpVtbl -> Uninitialize(This) ) - -#define ISensorClassExtension_ProcessIoControl(This,pRequest) \ - ( (This)->lpVtbl -> ProcessIoControl(This,pRequest) ) - -#define ISensorClassExtension_PostEvent(This,pwszSensorID,pEventCollection) \ - ( (This)->lpVtbl -> PostEvent(This,pwszSensorID,pEventCollection) ) - -#define ISensorClassExtension_PostStateChange(This,pwszSensorID,state) \ - ( (This)->lpVtbl -> PostStateChange(This,pwszSensorID,state) ) - -#define ISensorClassExtension_CleanupFile(This,pWdfFile) \ - ( (This)->lpVtbl -> CleanupFile(This,pWdfFile) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISensorClassExtension_INTERFACE_DEFINED__ */ - - - -#ifndef __WindowsSensorClassExtensionLibrary_LIBRARY_DEFINED__ -#define __WindowsSensorClassExtensionLibrary_LIBRARY_DEFINED__ - -/* library WindowsSensorClassExtensionLibrary */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_WindowsSensorClassExtensionLibrary; - -EXTERN_C const CLSID CLSID_SensorClassExtension; - -#ifdef __cplusplus - -class DECLSPEC_UUID("6101F767-998E-452B-B54A-E836DD486BAD") -SensorClassExtension; -#endif -#endif /* __WindowsSensorClassExtensionLibrary_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_windowssensorclassextension_0000_0002 */ -/* [local] */ - -#endif // (_WIN32_WINNT >= 0x0600) - - -extern RPC_IF_HANDLE __MIDL_itf_windowssensorclassextension_0000_0002_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_windowssensorclassextension_0000_0002_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/sffdisk.h b/qt-correction-tool/pub/ddk/sffdisk.h deleted file mode 100644 index 5239670..0000000 --- a/qt-correction-tool/pub/ddk/sffdisk.h +++ /dev/null @@ -1,202 +0,0 @@ -/*++ - -Copyright (c) 1993-2003 Microsoft Corporation - -Module Name: - - sffdisk.h - -Abstract: - - This header file defines constants and types for accessing functionality - specific to SFF (Small Form Factor) storage devices. - - ---*/ - -#ifndef _SFFDISK_H_ -#define _SFFDISK_H_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4200) // array[0] is not a warning for this file - - -// -// IOCTL codes. -// - -#define IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL \ - CTL_CODE( FILE_DEVICE_DISK, 0x7a0, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_SFFDISK_DEVICE_COMMAND \ - CTL_CODE( FILE_DEVICE_DISK, 0x7a1, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_SFFDISK_DEVICE_PASSWORD \ - CTL_CODE( FILE_DEVICE_DISK, 0x7a2, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -// -// Protocol GUIDs that are returned in SFFDISK_QUERY_DEVICE_PROTOCOL_DATA structure -// -#define GUID_SFF_PROTOCOL_SD { 0xAD7536A8, 0xD055, 0x4c40, { 0xAA, 0x4D, 0x96, 0x31, 0x2D, 0xDB, 0x6B, 0x38 } } - -#define GUID_SFF_PROTOCOL_MMC { 0x77274D3F, 0x2365, 0x4491, { 0xA0, 0x30, 0x8B, 0xB4, 0x4A, 0xE6, 0x00, 0x97 } } - -// -// Structures -// - - -// -// Structure used in IOCTL_SFFDISK_QUERY_DEVICE_PROTOCOL -// - -typedef struct _SFFDISK_QUERY_DEVICE_PROTOCOL_DATA { - // - // size of this structure in bytes to be filled in by the caller - // - USHORT Size; - USHORT Reserved; - - // - // This GUID is returned by the protocol which uniquely identifies it. - // - - GUID ProtocolGUID; - -} SFFDISK_QUERY_DEVICE_PROTOCOL_DATA, *PSFFDISK_QUERY_DEVICE_PROTOCOL_DATA; - - -// -// Structure used in IOCTL_SFFDISK_DEVICE_COMMAND -// The layout of the buffer passed to this IOCTL is as follows: -// -// +-----------------------------+ -// | header (this structure) | -// +-----------------------------+ -// | protocol arguments | -// +-----------------------------+ -// | device data buffer | -// +-----------------------------+ -// -// The actual layout of the protocol arguments depends on the protocol of -// the target device. So as an example, if the target device an SD (Secure Digital) -// storage device, then the protocol arguments would consist of an SDCMD_DESCRIPTOR, -// which is defined in SDDEF.H. The SD argument for the command should be stored -// in the "Information" field of this structure. In that case, ProtocolArgumentSize -// would be sizeof(SDCMD_DESCRIPTOR). -// -// The three size fields in the structure (HeaderSize, ProtocolArgumentSize, -// DeviceDataBufferSize) each hold the length in bytes of each respective area as -// described by the diagram above. Thus, the entire length of the buffer must be -// at least as large as the sum of these three fields. -// - - -typedef enum { - SFFDISK_DC_GET_VERSION = 0, - SFFDISK_DC_LOCK_CHANNEL, - SFFDISK_DC_UNLOCK_CHANNEL, - SFFDISK_DC_DEVICE_COMMAND, -} SFFDISK_DCMD; - - -typedef struct _SFFDISK_DEVICE_COMMAND_DATA { - - // - // size of this structure in bytes to be filled in by the caller. - // This size does not include any data concatenated at the end. - // - USHORT HeaderSize; - - USHORT Reserved; - - // - // command defines the type of operation - // - - SFFDISK_DCMD Command; - - // - // ProtocolArgumentSize is the length in bytes of the device command - // arguments specific to the protocol of the device. This data is appended - // to the structure after the field member "Data". - // - USHORT ProtocolArgumentSize; - - // - // DeviceDataBufferSize defines the length of data being sent to, or received - // from the device. - // - - ULONG DeviceDataBufferSize; - - // - // Information is a parameter or return value for the operation - // - - ULONG_PTR Information; - - // - // Beginning of data. - // - - UCHAR Data[0]; - -} SFFDISK_DEVICE_COMMAND_DATA, *PSFFDISK_DEVICE_COMMAND_DATA; - - - - -// -// Structure used in IOCTL_SFFDISK_DEVICE_PASSWORD -// - -typedef enum { - SFFDISK_DP_IS_SUPPORTED = 0, - SFFDISK_DP_SET_PASSWORD, - SFFDISK_DP_LOCK_DEVICE, - SFFDISK_DP_UNLOCK_DEVICE, - SFFDISK_DP_RESET_DEVICE_ALL_DATA -} SFFDISK_DPCMD; - -typedef struct _SFFDISK_DEVICE_PASSWORD_DATA { - // - // size of this structure in bytes to be filled in by the caller - // - USHORT Size; - USHORT Reserved; - - // - // command defines the type of operation - // - - SFFDISK_DPCMD Command; - - // - // Information is a parameter or return value for the operation - // - - ULONG_PTR Information; - - // - // Password length and data supplied depend on the operation - // - - UCHAR PasswordLength; - UCHAR NewPasswordLength; - UCHAR Data[0]; - -} SFFDISK_DEVICE_PASSWORD_DATA, *PSFFDISK_DEVICE_PASSWORD_DATA; - - - -#if _MSC_VER >= 1200 -#pragma warning(pop) // un-sets any local warning changes -#endif -#pragma warning(default:4200) // array[0] is not a warning for this file - - -#endif // _SFFDISK_H_ - diff --git a/qt-correction-tool/pub/ddk/sffprtcl.h b/qt-correction-tool/pub/ddk/sffprtcl.h deleted file mode 100644 index 3a3a2d0..0000000 --- a/qt-correction-tool/pub/ddk/sffprtcl.h +++ /dev/null @@ -1,144 +0,0 @@ -/*++ - -Copyright (c) 1991 - 1993 Microsoft Corporation - -Module Name: - - sffprtcl.h - -Abstract: - - Definition for Small Form Factor disk (SFFDISK) protocol layer interface - - -Notes: - - ---*/ - -#ifndef _SFFPRTCL_H_ -#define _SFFPRTCL_H_ - - -DEFINE_GUID(GUID_SFF_PROTOCOL_INTERFACE_STANDARD, 0xc7ec8da0L, 0xdbe3, 0x43fd, 0xa9, 0xeb, 0x7e, 0x4c, 0x70, 0x7c, 0x35, 0xac); - -#define SFF_PROTOCOL_INTERFACE_VERSION 0x0102 - -// -// Property types used in SFFPROT_Get/Set_Property -// - -typedef enum { - SFFP_PROP_MEDIA_CAPACITY, - SFFP_PROP_PARTITION_SIZE, - SFFP_PROP_WRITE_PROTECTED, - SFFP_PROP_MEDIA_STATE, - SFFP_PROP_MEDIA_CHANGECOUNT, - SFFP_PROP_MEDIA_ID, - SFFP_PROP_PROTOCOL_GUID, - SFFP_PROP_VERIFY_STATE, - SFFP_PROP_PARTITION_START_OFFSET -} SFFPROT_PROPERTY; - -// -// Media states defined for SFFP_PROP_MEDIA_STATE -// - -typedef enum { - SFFMS_NO_MEDIA = 0, - SFFMS_MEDIA_PRESENT -} SFFPROT_MEDIA_STATE; - -// -// Media states defined for SFFP_PROP_MEDIA_STATE -// - -typedef enum { - SFFVS_VERIFY_REQUIRED = 0, // the bus interface layer has noticed the media changed - SFFVS_VERIFY_ACKNOWLEDGED // the file system has started the verify -} SFFPROT_VERIFY_STATE; - -// -// types used in DeviceControl -// - -typedef enum { - SFFDC_DEVICE_COMMAND, - SFFDC_DEVICE_PASSWORD -} SFFPROT_DCTYPE; - -// -// Prototypes for the get/set property calls -// - -typedef -NTSTATUS -(*PSFFPROT_GET_PROPERTY)( - IN PVOID Context, - IN SFFPROT_PROPERTY Property, - IN ULONG BufferLength, - OUT PVOID PropertyBuffer, - OUT PULONG ResultLength - ); - -typedef -NTSTATUS -(*PSFFPROT_SET_PROPERTY)( - IN PVOID Context, - IN SFFPROT_PROPERTY Property, - IN ULONG BufferLength, - IN PVOID PropertyBuffer - ); - -typedef -NTSTATUS -(*PSFFPROT_DEVICE_CONTROL)( - IN PVOID Context, - IN SFFPROT_DCTYPE Type, - IN PVOID Buffer, - IN ULONG Length, - OUT PULONG LengthReturned - ); - -typedef -NTSTATUS -(*PSFFPROT_READ)( - IN PVOID Context, - IN PMDL Mdl, - IN ULONGLONG Offset, - IN ULONG Length, - OUT PULONG LengthReturned - ); - -typedef -NTSTATUS -(*PSFFPROT_WRITE)( - IN PVOID Context, - IN PMDL Mdl, - IN ULONGLONG Offset, - IN ULONG Length, - OUT PULONG LengthReturned - ); - -// -// This typedef defines the interface structure to be returned by -// the pnp QUERY_INTERFACE call. -// - - -typedef struct _SFF_PROTOCOL_INTERFACE_STANDARD { - USHORT Size; - USHORT Version; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - PVOID Context; - PSFFPROT_GET_PROPERTY GetProperty; - PSFFPROT_SET_PROPERTY SetProperty; - PSFFPROT_READ Read; - PSFFPROT_WRITE Write; - PSFFPROT_DEVICE_CONTROL DeviceControl; -} SFF_PROTOCOL_INTERFACE_STANDARD, *PSFF_PROTOCOL_INTERFACE_STANDARD; - - -#endif // _SFFPRTCL_H_ - diff --git a/qt-correction-tool/pub/ddk/softehciif.h b/qt-correction-tool/pub/ddk/softehciif.h deleted file mode 100644 index 01985a8..0000000 --- a/qt-correction-tool/pub/ddk/softehciif.h +++ /dev/null @@ -1,972 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for softehciif.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __softehciif_h__ -#define __softehciif_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ISoftEHCI_FWD_DEFINED__ -#define __ISoftEHCI_FWD_DEFINED__ -typedef interface ISoftEHCI ISoftEHCI; -#endif /* __ISoftEHCI_FWD_DEFINED__ */ - - -#ifndef __SoftEHCI_FWD_DEFINED__ -#define __SoftEHCI_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftEHCI SoftEHCI; -#else -typedef struct SoftEHCI SoftEHCI; -#endif /* __cplusplus */ - -#endif /* __SoftEHCI_FWD_DEFINED__ */ - - -#ifndef __ISoftEHCICtrlr_FWD_DEFINED__ -#define __ISoftEHCICtrlr_FWD_DEFINED__ -typedef interface ISoftEHCICtrlr ISoftEHCICtrlr; -#endif /* __ISoftEHCICtrlr_FWD_DEFINED__ */ - - -#ifndef __SoftEHCICtrlr_FWD_DEFINED__ -#define __SoftEHCICtrlr_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftEHCICtrlr SoftEHCICtrlr; -#else -typedef struct SoftEHCICtrlr SoftEHCICtrlr; -#endif /* __cplusplus */ - -#endif /* __SoftEHCICtrlr_FWD_DEFINED__ */ - - -#ifndef __ISoftEHCIRootHubPorts_FWD_DEFINED__ -#define __ISoftEHCIRootHubPorts_FWD_DEFINED__ -typedef interface ISoftEHCIRootHubPorts ISoftEHCIRootHubPorts; -#endif /* __ISoftEHCIRootHubPorts_FWD_DEFINED__ */ - - -#ifndef __SoftEHCIRootHubPorts_FWD_DEFINED__ -#define __SoftEHCIRootHubPorts_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftEHCIRootHubPorts SoftEHCIRootHubPorts; -#else -typedef struct SoftEHCIRootHubPorts SoftEHCIRootHubPorts; -#endif /* __cplusplus */ - -#endif /* __SoftEHCIRootHubPorts_FWD_DEFINED__ */ - - -#ifndef __ISoftEHCIRootHubPort_FWD_DEFINED__ -#define __ISoftEHCIRootHubPort_FWD_DEFINED__ -typedef interface ISoftEHCIRootHubPort ISoftEHCIRootHubPort; -#endif /* __ISoftEHCIRootHubPort_FWD_DEFINED__ */ - - -#ifndef __SoftEHCIRootHubPort_FWD_DEFINED__ -#define __SoftEHCIRootHubPort_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftEHCIRootHubPort SoftEHCIRootHubPort; -#else -typedef struct SoftEHCIRootHubPort SoftEHCIRootHubPort; -#endif /* __cplusplus */ - -#endif /* __SoftEHCIRootHubPort_FWD_DEFINED__ */ - - -#ifdef __cplusplus -extern "C"{ -#endif - - - -#ifndef __SoftEHCI_LIBRARY_DEFINED__ -#define __SoftEHCI_LIBRARY_DEFINED__ - -/* library SoftEHCI */ -/* [helpstringcontext][helpcontext][helpstring][version][lcid][uuid] */ - - - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("01647E9C-2B10-4620-BE92-758093F3C31A") -enum EHCIRootHubIndicator - { EHCIRootHubOff = 0, - EHCIRootHubAmber = 1, - EHCIRootHubGreen = 2, - EHCIRootHubUndefined = 3 - } EHCIRootHubIndicator; - - -EXTERN_C const IID LIBID_SoftEHCI; - -#ifndef __ISoftEHCI_INTERFACE_DEFINED__ -#define __ISoftEHCI_INTERFACE_DEFINED__ - -/* interface ISoftEHCI */ -/* [object][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftEHCI; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E99BC1D0-088B-4bd2-AE94-6DA3F2861FA2") - ISoftEHCI : public IDispatch - { - public: - }; - -#else /* C style interface */ - - typedef struct ISoftEHCIVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftEHCI * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftEHCI * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftEHCI * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftEHCI * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftEHCI * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftEHCI * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftEHCI * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - END_INTERFACE - } ISoftEHCIVtbl; - - interface ISoftEHCI - { - CONST_VTBL struct ISoftEHCIVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftEHCI_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftEHCI_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftEHCI_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftEHCI_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftEHCI_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftEHCI_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftEHCI_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftEHCI_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftEHCI; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3676BB7A-1618-4bfc-855C-63C92FD54ACD") -SoftEHCI; -#endif - -#ifndef __ISoftEHCICtrlr_INTERFACE_DEFINED__ -#define __ISoftEHCICtrlr_INTERFACE_DEFINED__ - -/* interface ISoftEHCICtrlr */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftEHCICtrlr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("16017C34-A2BA-480B-8DE8-CD08756AD1F8") - ISoftEHCICtrlr : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Ports( - /* [retval][out] */ __RPC__deref_out_opt SoftEHCIRootHubPorts **ppPorts) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftEHCICtrlrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftEHCICtrlr * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftEHCICtrlr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftEHCICtrlr * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftEHCICtrlr * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftEHCICtrlr * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftEHCICtrlr * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftEHCICtrlr * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Ports )( - __RPC__in ISoftEHCICtrlr * This, - /* [retval][out] */ __RPC__deref_out_opt SoftEHCIRootHubPorts **ppPorts); - - END_INTERFACE - } ISoftEHCICtrlrVtbl; - - interface ISoftEHCICtrlr - { - CONST_VTBL struct ISoftEHCICtrlrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftEHCICtrlr_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftEHCICtrlr_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftEHCICtrlr_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftEHCICtrlr_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftEHCICtrlr_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftEHCICtrlr_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftEHCICtrlr_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftEHCICtrlr_get_Ports(This,ppPorts) \ - ( (This)->lpVtbl -> get_Ports(This,ppPorts) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftEHCICtrlr_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftEHCICtrlr; - -#ifdef __cplusplus - -class DECLSPEC_UUID("C2B7819E-632F-4ADD-A450-62E6F324DC70") -SoftEHCICtrlr; -#endif - -#ifndef __ISoftEHCIRootHubPorts_INTERFACE_DEFINED__ -#define __ISoftEHCIRootHubPorts_INTERFACE_DEFINED__ - -/* interface ISoftEHCIRootHubPorts */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftEHCIRootHubPorts; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("8202B252-20C9-47A1-9448-B8621D985CA1") - ISoftEHCIRootHubPorts : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftEHCIRootHubPort **ppSoftEHCIRootHubPort) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftEHCIRootHubPortsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftEHCIRootHubPorts * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftEHCIRootHubPorts * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftEHCIRootHubPorts * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftEHCIRootHubPort **ppSoftEHCIRootHubPort); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftEHCIRootHubPorts * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - END_INTERFACE - } ISoftEHCIRootHubPortsVtbl; - - interface ISoftEHCIRootHubPorts - { - CONST_VTBL struct ISoftEHCIRootHubPortsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftEHCIRootHubPorts_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftEHCIRootHubPorts_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftEHCIRootHubPorts_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftEHCIRootHubPorts_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftEHCIRootHubPorts_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftEHCIRootHubPorts_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftEHCIRootHubPorts_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftEHCIRootHubPorts_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftEHCIRootHubPorts_get_Item(This,Index,ppSoftEHCIRootHubPort) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSoftEHCIRootHubPort) ) - -#define ISoftEHCIRootHubPorts_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftEHCIRootHubPorts_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftEHCIRootHubPorts; - -#ifdef __cplusplus - -class DECLSPEC_UUID("00DC66FB-A2E1-4BF9-9E6C-C3A1A60130EC") -SoftEHCIRootHubPorts; -#endif - -#ifndef __ISoftEHCIRootHubPort_INTERFACE_DEFINED__ -#define __ISoftEHCIRootHubPort_INTERFACE_DEFINED__ - -/* interface ISoftEHCIRootHubPort */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftEHCIRootHubPort; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9A80EBED-8173-4417-9830-405EF2F0167A") - ISoftEHCIRootHubPort : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeOnOverCurrentEnable( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeOnDisconnectEnable( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_WakeOnConnectEnable( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_TestCtrl( - /* [retval][out] */ __RPC__out BYTE *pbTestCtrl) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Indicator( - /* [retval][out] */ __RPC__out EHCIRootHubIndicator *pIndicator) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Owner( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOwner) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Power( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPower) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Power( - /* [in] */ VARIANT_BOOL fvarPower) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LineStatus( - /* [retval][out] */ __RPC__out BYTE *pbLineStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LineStatus( - /* [in] */ BYTE bLineStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reset( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarReset) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Suspend( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspend) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Suspend( - /* [in] */ VARIANT_BOOL fvarSuspend) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ForcePortResume( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarForcePortResume) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ForcePortResume( - /* [in] */ VARIANT_BOOL fvarForcePortResume) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrentChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrentChange( - /* [in] */ VARIANT_BOOL fvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrent( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrent( - /* [in] */ VARIANT_BOOL fvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_EnableChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnableChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_EnableChange( - /* [in] */ VARIANT_BOOL fvarEnableChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Enabled( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Enabled( - /* [in] */ VARIANT_BOOL fvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ConnectStatusChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarConnectStatusChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ConnectStatusChange( - /* [in] */ VARIANT_BOOL fvarConnectStatusChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_CurrentConnectStatus( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Status( - /* [retval][out] */ __RPC__out long *plStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Device( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall HotPlug( - /* [in] */ __RPC__in /* external definition not present */ DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Unplug( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftEHCIRootHubPortVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftEHCIRootHubPort * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftEHCIRootHubPort * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftEHCIRootHubPort * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeOnOverCurrentEnable )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeOnDisconnectEnable )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_WakeOnConnectEnable )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarWake); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_TestCtrl )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out BYTE *pbTestCtrl); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Indicator )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out EHCIRootHubIndicator *pIndicator); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Owner )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOwner); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Power )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPower); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Power )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarPower); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LineStatus )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out BYTE *pbLineStatus); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LineStatus )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ BYTE bLineStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reset )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarReset); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Suspend )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspend); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Suspend )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarSuspend); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ForcePortResume )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarForcePortResume); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ForcePortResume )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarForcePortResume); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrentChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrentChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrent )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrent )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_EnableChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnableChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_EnableChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarEnableChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Enabled )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Enabled )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ConnectStatusChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarConnectStatusChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ConnectStatusChange )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ VARIANT_BOOL fvarConnectStatusChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_CurrentConnectStatus )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Status )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__out long *plStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Device )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *HotPlug )( - __RPC__in ISoftEHCIRootHubPort * This, - /* [in] */ __RPC__in /* external definition not present */ DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Unplug )( - __RPC__in ISoftEHCIRootHubPort * This); - - END_INTERFACE - } ISoftEHCIRootHubPortVtbl; - - interface ISoftEHCIRootHubPort - { - CONST_VTBL struct ISoftEHCIRootHubPortVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftEHCIRootHubPort_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftEHCIRootHubPort_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftEHCIRootHubPort_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftEHCIRootHubPort_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftEHCIRootHubPort_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftEHCIRootHubPort_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftEHCIRootHubPort_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftEHCIRootHubPort_get_WakeOnOverCurrentEnable(This,pfvarWake) \ - ( (This)->lpVtbl -> get_WakeOnOverCurrentEnable(This,pfvarWake) ) - -#define ISoftEHCIRootHubPort_get_WakeOnDisconnectEnable(This,pfvarWake) \ - ( (This)->lpVtbl -> get_WakeOnDisconnectEnable(This,pfvarWake) ) - -#define ISoftEHCIRootHubPort_get_WakeOnConnectEnable(This,pfvarWake) \ - ( (This)->lpVtbl -> get_WakeOnConnectEnable(This,pfvarWake) ) - -#define ISoftEHCIRootHubPort_get_TestCtrl(This,pbTestCtrl) \ - ( (This)->lpVtbl -> get_TestCtrl(This,pbTestCtrl) ) - -#define ISoftEHCIRootHubPort_get_Indicator(This,pIndicator) \ - ( (This)->lpVtbl -> get_Indicator(This,pIndicator) ) - -#define ISoftEHCIRootHubPort_get_Owner(This,pfvarOwner) \ - ( (This)->lpVtbl -> get_Owner(This,pfvarOwner) ) - -#define ISoftEHCIRootHubPort_get_Power(This,pfvarPower) \ - ( (This)->lpVtbl -> get_Power(This,pfvarPower) ) - -#define ISoftEHCIRootHubPort_put_Power(This,fvarPower) \ - ( (This)->lpVtbl -> put_Power(This,fvarPower) ) - -#define ISoftEHCIRootHubPort_get_LineStatus(This,pbLineStatus) \ - ( (This)->lpVtbl -> get_LineStatus(This,pbLineStatus) ) - -#define ISoftEHCIRootHubPort_put_LineStatus(This,bLineStatus) \ - ( (This)->lpVtbl -> put_LineStatus(This,bLineStatus) ) - -#define ISoftEHCIRootHubPort_get_Reset(This,pfvarReset) \ - ( (This)->lpVtbl -> get_Reset(This,pfvarReset) ) - -#define ISoftEHCIRootHubPort_get_Suspend(This,pfvarSuspend) \ - ( (This)->lpVtbl -> get_Suspend(This,pfvarSuspend) ) - -#define ISoftEHCIRootHubPort_put_Suspend(This,fvarSuspend) \ - ( (This)->lpVtbl -> put_Suspend(This,fvarSuspend) ) - -#define ISoftEHCIRootHubPort_get_ForcePortResume(This,pfvarForcePortResume) \ - ( (This)->lpVtbl -> get_ForcePortResume(This,pfvarForcePortResume) ) - -#define ISoftEHCIRootHubPort_put_ForcePortResume(This,fvarForcePortResume) \ - ( (This)->lpVtbl -> put_ForcePortResume(This,fvarForcePortResume) ) - -#define ISoftEHCIRootHubPort_get_OverCurrentChange(This,pfvarOverCurrentChange) \ - ( (This)->lpVtbl -> get_OverCurrentChange(This,pfvarOverCurrentChange) ) - -#define ISoftEHCIRootHubPort_put_OverCurrentChange(This,fvarOverCurrentChange) \ - ( (This)->lpVtbl -> put_OverCurrentChange(This,fvarOverCurrentChange) ) - -#define ISoftEHCIRootHubPort_get_OverCurrent(This,pfvarOverCurrent) \ - ( (This)->lpVtbl -> get_OverCurrent(This,pfvarOverCurrent) ) - -#define ISoftEHCIRootHubPort_put_OverCurrent(This,fvarOverCurrent) \ - ( (This)->lpVtbl -> put_OverCurrent(This,fvarOverCurrent) ) - -#define ISoftEHCIRootHubPort_get_EnableChange(This,pfvarEnableChange) \ - ( (This)->lpVtbl -> get_EnableChange(This,pfvarEnableChange) ) - -#define ISoftEHCIRootHubPort_put_EnableChange(This,fvarEnableChange) \ - ( (This)->lpVtbl -> put_EnableChange(This,fvarEnableChange) ) - -#define ISoftEHCIRootHubPort_get_Enabled(This,pfvarEnabled) \ - ( (This)->lpVtbl -> get_Enabled(This,pfvarEnabled) ) - -#define ISoftEHCIRootHubPort_put_Enabled(This,fvarEnabled) \ - ( (This)->lpVtbl -> put_Enabled(This,fvarEnabled) ) - -#define ISoftEHCIRootHubPort_get_ConnectStatusChange(This,pfvarConnectStatusChange) \ - ( (This)->lpVtbl -> get_ConnectStatusChange(This,pfvarConnectStatusChange) ) - -#define ISoftEHCIRootHubPort_put_ConnectStatusChange(This,fvarConnectStatusChange) \ - ( (This)->lpVtbl -> put_ConnectStatusChange(This,fvarConnectStatusChange) ) - -#define ISoftEHCIRootHubPort_get_CurrentConnectStatus(This,pfvarStatus) \ - ( (This)->lpVtbl -> get_CurrentConnectStatus(This,pfvarStatus) ) - -#define ISoftEHCIRootHubPort_get_Status(This,plStatus) \ - ( (This)->lpVtbl -> get_Status(This,plStatus) ) - -#define ISoftEHCIRootHubPort_get_Device(This,ppDSFDevice) \ - ( (This)->lpVtbl -> get_Device(This,ppDSFDevice) ) - -#define ISoftEHCIRootHubPort_HotPlug(This,pDSFDevice) \ - ( (This)->lpVtbl -> HotPlug(This,pDSFDevice) ) - -#define ISoftEHCIRootHubPort_Unplug(This) \ - ( (This)->lpVtbl -> Unplug(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftEHCIRootHubPort_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftEHCIRootHubPort; - -#ifdef __cplusplus - -class DECLSPEC_UUID("6FD5902A-DC5A-4AB4-B9B0-B44D70930C9B") -SoftEHCIRootHubPort; -#endif -#endif /* __SoftEHCI_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/softhidusbif.h b/qt-correction-tool/pub/ddk/softhidusbif.h deleted file mode 100644 index 39e5e54..0000000 --- a/qt-correction-tool/pub/ddk/softhidusbif.h +++ /dev/null @@ -1,2246 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for softhidusbkif.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __softhidusbkif_h__ -#define __softhidusbkif_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ISoftHIDProtocolXlator_FWD_DEFINED__ -#define __ISoftHIDProtocolXlator_FWD_DEFINED__ -typedef interface ISoftHIDProtocolXlator ISoftHIDProtocolXlator; -#endif /* __ISoftHIDProtocolXlator_FWD_DEFINED__ */ - - -#ifndef __ISoftHidUsbDevice_FWD_DEFINED__ -#define __ISoftHidUsbDevice_FWD_DEFINED__ -typedef interface ISoftHidUsbDevice ISoftHidUsbDevice; -#endif /* __ISoftHidUsbDevice_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBHidDescriptor_FWD_DEFINED__ -#define __ISoftUSBHidDescriptor_FWD_DEFINED__ -typedef interface ISoftUSBHidDescriptor ISoftUSBHidDescriptor; -#endif /* __ISoftUSBHidDescriptor_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptorSet0 ISoftUSBPhysicalDescriptorSet0; -#endif /* __ISoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSet_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSet_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptorSet ISoftUSBPhysicalDescriptorSet; -#endif /* __ISoftUSBPhysicalDescriptorSet_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorItem_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptorItem_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptorItem ISoftUSBPhysicalDescriptorItem; -#endif /* __ISoftUSBPhysicalDescriptorItem_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptor_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptor_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptor ISoftUSBPhysicalDescriptor; -#endif /* __ISoftUSBPhysicalDescriptor_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptorSetList ISoftUSBPhysicalDescriptorSetList; -#endif /* __ISoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ -#define __ISoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ -typedef interface ISoftUSBPhysicalDescriptorItemList ISoftUSBPhysicalDescriptorItemList; -#endif /* __ISoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBHidFaultInjection_FWD_DEFINED__ -#define __ISoftUSBHidFaultInjection_FWD_DEFINED__ -typedef interface ISoftUSBHidFaultInjection ISoftUSBHidFaultInjection; -#endif /* __ISoftUSBHidFaultInjection_FWD_DEFINED__ */ - - -#ifndef __SoftHIDProtocolXlator_FWD_DEFINED__ -#define __SoftHIDProtocolXlator_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftHIDProtocolXlator SoftHIDProtocolXlator; -#else -typedef struct SoftHIDProtocolXlator SoftHIDProtocolXlator; -#endif /* __cplusplus */ - -#endif /* __SoftHIDProtocolXlator_FWD_DEFINED__ */ - - -#ifndef __SoftHidUsbDevice_FWD_DEFINED__ -#define __SoftHidUsbDevice_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftHidUsbDevice SoftHidUsbDevice; -#else -typedef struct SoftHidUsbDevice SoftHidUsbDevice; -#endif /* __cplusplus */ - -#endif /* __SoftHidUsbDevice_FWD_DEFINED__ */ - - -#ifndef __SoftUSBHidDescriptor_FWD_DEFINED__ -#define __SoftUSBHidDescriptor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBHidDescriptor SoftUSBHidDescriptor; -#else -typedef struct SoftUSBHidDescriptor SoftUSBHidDescriptor; -#endif /* __cplusplus */ - -#endif /* __SoftUSBHidDescriptor_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptor_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptor_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptor SoftUSBPhysicalDescriptor; -#else -typedef struct SoftUSBPhysicalDescriptor SoftUSBPhysicalDescriptor; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptor_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptorSet0 SoftUSBPhysicalDescriptorSet0; -#else -typedef struct SoftUSBPhysicalDescriptorSet0 SoftUSBPhysicalDescriptorSet0; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptorSet0_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptorSet_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptorSet_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptorSet SoftUSBPhysicalDescriptorSet; -#else -typedef struct SoftUSBPhysicalDescriptorSet SoftUSBPhysicalDescriptorSet; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptorSet_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptorItem_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptorItem_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptorItem SoftUSBPhysicalDescriptorItem; -#else -typedef struct SoftUSBPhysicalDescriptorItem SoftUSBPhysicalDescriptorItem; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptorItem_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptorSetList SoftUSBPhysicalDescriptorSetList; -#else -typedef struct SoftUSBPhysicalDescriptorSetList SoftUSBPhysicalDescriptorSetList; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptorSetList_FWD_DEFINED__ */ - - -#ifndef __SoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ -#define __SoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBPhysicalDescriptorItemList SoftUSBPhysicalDescriptorItemList; -#else -typedef struct SoftUSBPhysicalDescriptorItemList SoftUSBPhysicalDescriptorItemList; -#endif /* __cplusplus */ - -#endif /* __SoftUSBPhysicalDescriptorItemList_FWD_DEFINED__ */ - - -#ifndef __SoftUSBHidFaultInjection_FWD_DEFINED__ -#define __SoftUSBHidFaultInjection_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBHidFaultInjection SoftUSBHidFaultInjection; -#else -typedef struct SoftUSBHidFaultInjection SoftUSBHidFaultInjection; -#endif /* __cplusplus */ - -#endif /* __SoftUSBHidFaultInjection_FWD_DEFINED__ */ - - -#ifdef __cplusplus -extern "C"{ -#endif - - - -#ifndef __SOFTHIDUSBK_LIBRARY_DEFINED__ -#define __SOFTHIDUSBK_LIBRARY_DEFINED__ - -/* library SOFTHIDUSBK */ -/* [helpstringcontext][helpcontext][helpstring][helpstringdll][helpfile][version][lcid][uuid] */ - - - - - - - - - - - - - - - - - - - - - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("1E4B562C-9C5D-4506-8FFA-F87CC84CF588") -enum HID_DEVICETYPE - { DEVICE_TYPE_NONE = 0, - DEVICE_TYPE_KEYBOARD = 1, - DEVICE_TYPE_MOUSE = 2 - } HID_DEVICETYPE; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("4486D19F-E669-4C26-8F30-30584B071AF1") -enum HID_PHYSICAL_BIAS - { BIAS_NA = 0, - RIGHT_HAND = 1, - LEFT_HAND = 2, - BOTH_HANDS = 3, - EITHER_HAND = 4 - } HID_PHYSICAL_BIAS; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("5B428086-ACA1-4051-A41A-F4768BDFF6D6") -enum HID_PHYSICAL_DESIGNATOR - { NONE = 0, - HAND = 0x1, - EYEBALL = 0x2, - EYEBROW = 0x3, - EYELID = 0x4, - EAR = 0x5, - NOSE = 0x6, - MOUTH = 0x7, - UPPER_LIP = 0x8, - LOWER_LIP = 0x9, - JAW = 0xa, - NECK = 0xb, - UPPER_ARM = 0xc, - ELBOW = 0xd, - FOREARM = 0xe, - WRIST = 0xf, - PALM = 0x10, - THUMB = 0x11, - INDEX_FINGER = 0x12, - MIDDLE_FINGER = 0x13, - RING_FINGER = 0x14, - LITTLE_FINGER = 0x15, - HEAD = 0x16, - SHOULDER = 0x17, - HIP = 0x18, - WAIST = 0x19, - THIGH = 0x1a, - KNEE = 0x1b, - CALF = 0x1c, - ANKLE = 0x1d, - FOOT = 0x1e, - HEEL = 0x1f, - BALL_OF_FOOT = 0x20, - BIG_TOE = 0x21, - SECOND_TOE = 0x22, - THIRD_TOE = 0x23, - FOURTH_TOE = 0x24, - LITTLE_TOE = 0x25, - BROW = 0x26, - CHEEK = 0x27 - } HID_PHYSICAL_DESIGNATOR; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("4531738B-4AAC-48E2-9B8E-F97A98AA2967") -enum HID_PHYSICAL_QUALIFIER - { QUALIFIER_NA = 0, - RIGHT = 1, - LEFT = 2, - BOTH = 3, - EITHER = 4, - CENTER = 5 - } HID_PHYSICAL_QUALIFIER; - - -EXTERN_C const IID LIBID_SOFTHIDUSBK; - -#ifndef __ISoftHIDProtocolXlator_INTERFACE_DEFINED__ -#define __ISoftHIDProtocolXlator_INTERFACE_DEFINED__ - -/* interface ISoftHIDProtocolXlator */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftHIDProtocolXlator; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("78C6932B-1B53-469F-9DE3-38114BE3B41E") - ISoftHIDProtocolXlator : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceType( - /* [retval][out] */ __RPC__out HID_DEVICETYPE *pDevType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceType( - /* [in] */ HID_DEVICETYPE DevType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DSFDevice( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ IDSFDevice **ppiDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HIDDescriptor( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBHidDescriptor **ppSoftUSBHIDDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HIDDescriptor( - /* [in] */ __RPC__in_opt ISoftUSBHidDescriptor *pSoftUSBHIDDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_HIDDescriptor( - /* [in] */ __RPC__in_opt ISoftUSBHidDescriptor *pSoftUSBHIDDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall WriteReportDescriptor( - /* [in] */ __RPC__in SAFEARRAY * psaReportDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall ReadOutputReport( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaOutputReport) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall WriteInputReport( - /* [in] */ __RPC__in SAFEARRAY * psaInputReport) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall WriteFeatureReport( - /* [in] */ __RPC__in SAFEARRAY * psaFeatureReport) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftHIDProtocolXlatorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftHIDProtocolXlator * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftHIDProtocolXlator * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftHIDProtocolXlator * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceType )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [retval][out] */ __RPC__out HID_DEVICETYPE *pDevType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceType )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ HID_DEVICETYPE DevType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DSFDevice )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ IDSFDevice **ppiDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HIDDescriptor )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBHidDescriptor **ppSoftUSBHIDDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HIDDescriptor )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in_opt ISoftUSBHidDescriptor *pSoftUSBHIDDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_HIDDescriptor )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in_opt ISoftUSBHidDescriptor *pSoftUSBHIDDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *WriteReportDescriptor )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in SAFEARRAY * psaReportDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *ReadOutputReport )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaOutputReport); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *WriteInputReport )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in SAFEARRAY * psaInputReport); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *WriteFeatureReport )( - __RPC__in ISoftHIDProtocolXlator * This, - /* [in] */ __RPC__in SAFEARRAY * psaFeatureReport); - - END_INTERFACE - } ISoftHIDProtocolXlatorVtbl; - - interface ISoftHIDProtocolXlator - { - CONST_VTBL struct ISoftHIDProtocolXlatorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftHIDProtocolXlator_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftHIDProtocolXlator_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftHIDProtocolXlator_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftHIDProtocolXlator_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftHIDProtocolXlator_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftHIDProtocolXlator_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftHIDProtocolXlator_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftHIDProtocolXlator_get_DeviceType(This,pDevType) \ - ( (This)->lpVtbl -> get_DeviceType(This,pDevType) ) - -#define ISoftHIDProtocolXlator_put_DeviceType(This,DevType) \ - ( (This)->lpVtbl -> put_DeviceType(This,DevType) ) - -#define ISoftHIDProtocolXlator_get_DSFDevice(This,ppiDSFDevice) \ - ( (This)->lpVtbl -> get_DSFDevice(This,ppiDSFDevice) ) - -#define ISoftHIDProtocolXlator_get_HIDDescriptor(This,ppSoftUSBHIDDescriptor) \ - ( (This)->lpVtbl -> get_HIDDescriptor(This,ppSoftUSBHIDDescriptor) ) - -#define ISoftHIDProtocolXlator_put_HIDDescriptor(This,pSoftUSBHIDDescriptor) \ - ( (This)->lpVtbl -> put_HIDDescriptor(This,pSoftUSBHIDDescriptor) ) - -#define ISoftHIDProtocolXlator_putref_HIDDescriptor(This,pSoftUSBHIDDescriptor) \ - ( (This)->lpVtbl -> putref_HIDDescriptor(This,pSoftUSBHIDDescriptor) ) - -#define ISoftHIDProtocolXlator_WriteReportDescriptor(This,psaReportDescriptor) \ - ( (This)->lpVtbl -> WriteReportDescriptor(This,psaReportDescriptor) ) - -#define ISoftHIDProtocolXlator_ReadOutputReport(This,ppsaOutputReport) \ - ( (This)->lpVtbl -> ReadOutputReport(This,ppsaOutputReport) ) - -#define ISoftHIDProtocolXlator_WriteInputReport(This,psaInputReport) \ - ( (This)->lpVtbl -> WriteInputReport(This,psaInputReport) ) - -#define ISoftHIDProtocolXlator_WriteFeatureReport(This,psaFeatureReport) \ - ( (This)->lpVtbl -> WriteFeatureReport(This,psaFeatureReport) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftHIDProtocolXlator_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftHidUsbDevice_INTERFACE_DEFINED__ -#define __ISoftHidUsbDevice_INTERFACE_DEFINED__ - -/* interface ISoftHidUsbDevice */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftHidUsbDevice; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("45332C25-A9E0-457B-AA5D-897A36B92ACB") - ISoftHidUsbDevice : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PhysicalDescriptor( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptor **ppSoftUSBPhyDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_PhysicalDescriptor( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptor *pSoftUSBPhyDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_PhysicalDescriptor( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptor *pSoftUSBPhyDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ReportDescriptor( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaSoftUSBReportDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ReportDescriptor( - /* [in] */ __RPC__in SAFEARRAY * psaSoftUSBReportDescriptor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall QueueInputReport( - /* [in] */ ULONG cbData, - /* [in] */ __RPC__in BYTE *pbData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall DequeueOutputReport( - /* [out] */ __RPC__out ULONG *pcbData, - /* [out] */ __RPC__deref_out_opt BYTE **ppbData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall QueueFeatureReport( - /* [in] */ ULONG cbData, - /* [in] */ __RPC__in BYTE *pbData) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftHidUsbDeviceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftHidUsbDevice * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftHidUsbDevice * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftHidUsbDevice * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftHidUsbDevice * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PhysicalDescriptor )( - __RPC__in ISoftHidUsbDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptor **ppSoftUSBPhyDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_PhysicalDescriptor )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptor *pSoftUSBPhyDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_PhysicalDescriptor )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptor *pSoftUSBPhyDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ReportDescriptor )( - __RPC__in ISoftHidUsbDevice * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaSoftUSBReportDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ReportDescriptor )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ __RPC__in SAFEARRAY * psaSoftUSBReportDescriptor); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *QueueInputReport )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ ULONG cbData, - /* [in] */ __RPC__in BYTE *pbData); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *DequeueOutputReport )( - __RPC__in ISoftHidUsbDevice * This, - /* [out] */ __RPC__out ULONG *pcbData, - /* [out] */ __RPC__deref_out_opt BYTE **ppbData); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *QueueFeatureReport )( - __RPC__in ISoftHidUsbDevice * This, - /* [in] */ ULONG cbData, - /* [in] */ __RPC__in BYTE *pbData); - - END_INTERFACE - } ISoftHidUsbDeviceVtbl; - - interface ISoftHidUsbDevice - { - CONST_VTBL struct ISoftHidUsbDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftHidUsbDevice_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftHidUsbDevice_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftHidUsbDevice_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftHidUsbDevice_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftHidUsbDevice_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftHidUsbDevice_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftHidUsbDevice_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftHidUsbDevice_get_PhysicalDescriptor(This,ppSoftUSBPhyDescriptor) \ - ( (This)->lpVtbl -> get_PhysicalDescriptor(This,ppSoftUSBPhyDescriptor) ) - -#define ISoftHidUsbDevice_put_PhysicalDescriptor(This,pSoftUSBPhyDescriptor) \ - ( (This)->lpVtbl -> put_PhysicalDescriptor(This,pSoftUSBPhyDescriptor) ) - -#define ISoftHidUsbDevice_putref_PhysicalDescriptor(This,pSoftUSBPhyDescriptor) \ - ( (This)->lpVtbl -> putref_PhysicalDescriptor(This,pSoftUSBPhyDescriptor) ) - -#define ISoftHidUsbDevice_get_ReportDescriptor(This,ppsaSoftUSBReportDescriptor) \ - ( (This)->lpVtbl -> get_ReportDescriptor(This,ppsaSoftUSBReportDescriptor) ) - -#define ISoftHidUsbDevice_put_ReportDescriptor(This,psaSoftUSBReportDescriptor) \ - ( (This)->lpVtbl -> put_ReportDescriptor(This,psaSoftUSBReportDescriptor) ) - -#define ISoftHidUsbDevice_QueueInputReport(This,cbData,pbData) \ - ( (This)->lpVtbl -> QueueInputReport(This,cbData,pbData) ) - -#define ISoftHidUsbDevice_DequeueOutputReport(This,pcbData,ppbData) \ - ( (This)->lpVtbl -> DequeueOutputReport(This,pcbData,ppbData) ) - -#define ISoftHidUsbDevice_QueueFeatureReport(This,cbData,pbData) \ - ( (This)->lpVtbl -> QueueFeatureReport(This,cbData,pbData) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftHidUsbDevice_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBHidDescriptor_INTERFACE_DEFINED__ -#define __ISoftUSBHidDescriptor_INTERFACE_DEFINED__ - -/* interface ISoftUSBHidDescriptor */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBHidDescriptor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7E4BAE25-09D9-4DB8-8CEC-6D089D87F5EE") - ISoftUSBHidDescriptor : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbyLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbyDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HID( - /* [retval][out] */ __RPC__out SHORT *psHID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HID( - /* [in] */ SHORT sHID) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_CountryCode( - /* [retval][out] */ __RPC__out BYTE *pbyCountryCode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_CountryCode( - /* [in] */ BYTE byCountryCode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NumDescriptors( - /* [retval][out] */ __RPC__out BYTE *pbyNumDescriptors) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_NumDescriptors( - /* [in] */ BYTE byNumDescriptors) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ClassDescriptorType( - /* [in] */ BYTE byIndex, - /* [retval][out] */ __RPC__out BYTE *pbyClassDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ClassDescriptorType( - /* [in] */ BYTE byIndex, - /* [in] */ BYTE byClassDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorLength( - /* [in] */ BYTE byIndex, - /* [retval][out] */ __RPC__out SHORT *psDescriptorLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorLength( - /* [in] */ BYTE byIndex, - /* [in] */ SHORT sDescriptorLength) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBHidDescriptorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBHidDescriptor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBHidDescriptor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBHidDescriptor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [retval][out] */ __RPC__out BYTE *pbyLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [retval][out] */ __RPC__out BYTE *pbyDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HID )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [retval][out] */ __RPC__out SHORT *psHID); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HID )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ SHORT sHID); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_CountryCode )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [retval][out] */ __RPC__out BYTE *pbyCountryCode); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_CountryCode )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byCountryCode); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NumDescriptors )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [retval][out] */ __RPC__out BYTE *pbyNumDescriptors); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_NumDescriptors )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byNumDescriptors); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ClassDescriptorType )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byIndex, - /* [retval][out] */ __RPC__out BYTE *pbyClassDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ClassDescriptorType )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byIndex, - /* [in] */ BYTE byClassDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorLength )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byIndex, - /* [retval][out] */ __RPC__out SHORT *psDescriptorLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorLength )( - __RPC__in ISoftUSBHidDescriptor * This, - /* [in] */ BYTE byIndex, - /* [in] */ SHORT sDescriptorLength); - - END_INTERFACE - } ISoftUSBHidDescriptorVtbl; - - interface ISoftUSBHidDescriptor - { - CONST_VTBL struct ISoftUSBHidDescriptorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBHidDescriptor_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBHidDescriptor_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBHidDescriptor_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBHidDescriptor_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBHidDescriptor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBHidDescriptor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBHidDescriptor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBHidDescriptor_get_Length(This,pbyLength) \ - ( (This)->lpVtbl -> get_Length(This,pbyLength) ) - -#define ISoftUSBHidDescriptor_get_DescriptorType(This,pbyDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbyDescriptorType) ) - -#define ISoftUSBHidDescriptor_get_HID(This,psHID) \ - ( (This)->lpVtbl -> get_HID(This,psHID) ) - -#define ISoftUSBHidDescriptor_put_HID(This,sHID) \ - ( (This)->lpVtbl -> put_HID(This,sHID) ) - -#define ISoftUSBHidDescriptor_get_CountryCode(This,pbyCountryCode) \ - ( (This)->lpVtbl -> get_CountryCode(This,pbyCountryCode) ) - -#define ISoftUSBHidDescriptor_put_CountryCode(This,byCountryCode) \ - ( (This)->lpVtbl -> put_CountryCode(This,byCountryCode) ) - -#define ISoftUSBHidDescriptor_get_NumDescriptors(This,pbyNumDescriptors) \ - ( (This)->lpVtbl -> get_NumDescriptors(This,pbyNumDescriptors) ) - -#define ISoftUSBHidDescriptor_put_NumDescriptors(This,byNumDescriptors) \ - ( (This)->lpVtbl -> put_NumDescriptors(This,byNumDescriptors) ) - -#define ISoftUSBHidDescriptor_get_ClassDescriptorType(This,byIndex,pbyClassDescriptorType) \ - ( (This)->lpVtbl -> get_ClassDescriptorType(This,byIndex,pbyClassDescriptorType) ) - -#define ISoftUSBHidDescriptor_put_ClassDescriptorType(This,byIndex,byClassDescriptorType) \ - ( (This)->lpVtbl -> put_ClassDescriptorType(This,byIndex,byClassDescriptorType) ) - -#define ISoftUSBHidDescriptor_get_DescriptorLength(This,byIndex,psDescriptorLength) \ - ( (This)->lpVtbl -> get_DescriptorLength(This,byIndex,psDescriptorLength) ) - -#define ISoftUSBHidDescriptor_put_DescriptorLength(This,byIndex,sDescriptorLength) \ - ( (This)->lpVtbl -> put_DescriptorLength(This,byIndex,sDescriptorLength) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBHidDescriptor_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSet0_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSet0_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptorSet0 */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptorSet0; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("F9573761-15AA-46D1-9FE0-16254E001F4C") - ISoftUSBPhysicalDescriptorSet0 : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Number( - /* [retval][out] */ __RPC__out BYTE *pNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Number( - /* [in] */ BYTE Number) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE Length) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorSet0Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Number )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [retval][out] */ __RPC__out BYTE *pNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Number )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ BYTE Number); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [retval][out] */ __RPC__out BYTE *pLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBPhysicalDescriptorSet0 * This, - /* [in] */ BYTE Length); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorSet0Vtbl; - - interface ISoftUSBPhysicalDescriptorSet0 - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorSet0Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptorSet0_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptorSet0_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptorSet0_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptorSet0_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptorSet0_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptorSet0_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptorSet0_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptorSet0_get_Number(This,pNumber) \ - ( (This)->lpVtbl -> get_Number(This,pNumber) ) - -#define ISoftUSBPhysicalDescriptorSet0_put_Number(This,Number) \ - ( (This)->lpVtbl -> put_Number(This,Number) ) - -#define ISoftUSBPhysicalDescriptorSet0_get_Length(This,pLength) \ - ( (This)->lpVtbl -> get_Length(This,pLength) ) - -#define ISoftUSBPhysicalDescriptorSet0_put_Length(This,Length) \ - ( (This)->lpVtbl -> put_Length(This,Length) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptorSet0_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSet_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSet_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptorSet */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptorSet; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1FB119F2-5613-4D6E-AE93-87584F8C4401") - ISoftUSBPhysicalDescriptorSet : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Bias( - /* [retval][out] */ __RPC__out HID_PHYSICAL_BIAS *pBias) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Bias( - /* [in] */ HID_PHYSICAL_BIAS Bias) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Preference( - /* [retval][out] */ __RPC__out BYTE *pPreference) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Preference( - /* [in] */ BYTE Preference) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Items( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorItemList **ppItems) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorSetVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Bias )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [retval][out] */ __RPC__out HID_PHYSICAL_BIAS *pBias); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Bias )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ HID_PHYSICAL_BIAS Bias); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Preference )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [retval][out] */ __RPC__out BYTE *pPreference); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Preference )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [in] */ BYTE Preference); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Items )( - __RPC__in ISoftUSBPhysicalDescriptorSet * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorItemList **ppItems); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorSetVtbl; - - interface ISoftUSBPhysicalDescriptorSet - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorSetVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptorSet_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptorSet_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptorSet_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptorSet_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptorSet_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptorSet_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptorSet_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptorSet_get_Bias(This,pBias) \ - ( (This)->lpVtbl -> get_Bias(This,pBias) ) - -#define ISoftUSBPhysicalDescriptorSet_put_Bias(This,Bias) \ - ( (This)->lpVtbl -> put_Bias(This,Bias) ) - -#define ISoftUSBPhysicalDescriptorSet_get_Preference(This,pPreference) \ - ( (This)->lpVtbl -> get_Preference(This,pPreference) ) - -#define ISoftUSBPhysicalDescriptorSet_put_Preference(This,Preference) \ - ( (This)->lpVtbl -> put_Preference(This,Preference) ) - -#define ISoftUSBPhysicalDescriptorSet_get_Items(This,ppItems) \ - ( (This)->lpVtbl -> get_Items(This,ppItems) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptorSet_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorItem_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptorItem_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptorItem */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptorItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("904F9501-5208-409E-9F6C-67416876964A") - ISoftUSBPhysicalDescriptorItem : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Designator( - /* [retval][out] */ __RPC__out HID_PHYSICAL_DESIGNATOR *pDesignator) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Designator( - /* [in] */ HID_PHYSICAL_DESIGNATOR Designator) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Flags( - /* [retval][out] */ __RPC__out BYTE *pFlags) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Flags( - /* [in] */ BYTE Flags) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Qualifier( - /* [retval][out] */ __RPC__out HID_PHYSICAL_QUALIFIER *pQualifier) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Qualifier( - /* [in] */ HID_PHYSICAL_QUALIFIER Qualifier) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Effort( - /* [retval][out] */ __RPC__out BYTE *pEffort) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Effort( - /* [in] */ BYTE Effort) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Designator )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [retval][out] */ __RPC__out HID_PHYSICAL_DESIGNATOR *pDesignator); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Designator )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ HID_PHYSICAL_DESIGNATOR Designator); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Flags )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [retval][out] */ __RPC__out BYTE *pFlags); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Flags )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ BYTE Flags); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Qualifier )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [retval][out] */ __RPC__out HID_PHYSICAL_QUALIFIER *pQualifier); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Qualifier )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ HID_PHYSICAL_QUALIFIER Qualifier); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Effort )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [retval][out] */ __RPC__out BYTE *pEffort); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Effort )( - __RPC__in ISoftUSBPhysicalDescriptorItem * This, - /* [in] */ BYTE Effort); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorItemVtbl; - - interface ISoftUSBPhysicalDescriptorItem - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptorItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptorItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptorItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptorItem_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptorItem_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptorItem_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptorItem_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptorItem_get_Designator(This,pDesignator) \ - ( (This)->lpVtbl -> get_Designator(This,pDesignator) ) - -#define ISoftUSBPhysicalDescriptorItem_put_Designator(This,Designator) \ - ( (This)->lpVtbl -> put_Designator(This,Designator) ) - -#define ISoftUSBPhysicalDescriptorItem_get_Flags(This,pFlags) \ - ( (This)->lpVtbl -> get_Flags(This,pFlags) ) - -#define ISoftUSBPhysicalDescriptorItem_put_Flags(This,Flags) \ - ( (This)->lpVtbl -> put_Flags(This,Flags) ) - -#define ISoftUSBPhysicalDescriptorItem_get_Qualifier(This,pQualifier) \ - ( (This)->lpVtbl -> get_Qualifier(This,pQualifier) ) - -#define ISoftUSBPhysicalDescriptorItem_put_Qualifier(This,Qualifier) \ - ( (This)->lpVtbl -> put_Qualifier(This,Qualifier) ) - -#define ISoftUSBPhysicalDescriptorItem_get_Effort(This,pEffort) \ - ( (This)->lpVtbl -> get_Effort(This,pEffort) ) - -#define ISoftUSBPhysicalDescriptorItem_put_Effort(This,Effort) \ - ( (This)->lpVtbl -> put_Effort(This,Effort) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptorItem_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptor_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptor_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptor */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptor; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0C192F43-ACC3-4CF7-A823-B14FCFF082A1") - ISoftUSBPhysicalDescriptor : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Set0( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSet0 **ppSet0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Set0( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet0 *pSet0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_Set0( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet0 *pSet0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Sets( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSetList **ppSets) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptor * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptor * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptor * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Set0 )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSet0 **ppSet0); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Set0 )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet0 *pSet0); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_Set0 )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet0 *pSet0); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Sets )( - __RPC__in ISoftUSBPhysicalDescriptor * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSetList **ppSets); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorVtbl; - - interface ISoftUSBPhysicalDescriptor - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptor_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptor_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptor_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptor_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptor_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptor_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptor_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptor_get_Set0(This,ppSet0) \ - ( (This)->lpVtbl -> get_Set0(This,ppSet0) ) - -#define ISoftUSBPhysicalDescriptor_put_Set0(This,pSet0) \ - ( (This)->lpVtbl -> put_Set0(This,pSet0) ) - -#define ISoftUSBPhysicalDescriptor_putref_Set0(This,pSet0) \ - ( (This)->lpVtbl -> putref_Set0(This,pSet0) ) - -#define ISoftUSBPhysicalDescriptor_get_Sets(This,ppSets) \ - ( (This)->lpVtbl -> get_Sets(This,ppSets) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptor_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorSetList_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptorSetList_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptorSetList */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptorSetList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4CC5D8E4-49F4-4C34-ADA7-B81B4BC5C4D6") - ISoftUSBPhysicalDescriptorSetList : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSet **ppSet) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet *pSet, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorSetListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorSet **ppSet); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorSet *pSet, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBPhysicalDescriptorSetList * This); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorSetListVtbl; - - interface ISoftUSBPhysicalDescriptorSetList - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorSetListVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptorSetList_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptorSetList_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptorSetList_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptorSetList_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptorSetList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptorSetList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptorSetList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptorSetList_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBPhysicalDescriptorSetList_get_Item(This,Index,ppSet) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSet) ) - -#define ISoftUSBPhysicalDescriptorSetList_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBPhysicalDescriptorSetList_Add(This,pSet,Index) \ - ( (This)->lpVtbl -> Add(This,pSet,Index) ) - -#define ISoftUSBPhysicalDescriptorSetList_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBPhysicalDescriptorSetList_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptorSetList_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBPhysicalDescriptorItemList_INTERFACE_DEFINED__ -#define __ISoftUSBPhysicalDescriptorItemList_INTERFACE_DEFINED__ - -/* interface ISoftUSBPhysicalDescriptorItemList */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBPhysicalDescriptorItemList; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("24939051-5A21-432B-BF7C-D05037C116A4") - ISoftUSBPhysicalDescriptorItemList : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorItem **ppItem) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorItem *pItem, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBPhysicalDescriptorItemListVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBPhysicalDescriptorItem **ppItem); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ __RPC__in_opt ISoftUSBPhysicalDescriptorItem *pItem, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBPhysicalDescriptorItemList * This); - - END_INTERFACE - } ISoftUSBPhysicalDescriptorItemListVtbl; - - interface ISoftUSBPhysicalDescriptorItemList - { - CONST_VTBL struct ISoftUSBPhysicalDescriptorItemListVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBPhysicalDescriptorItemList_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBPhysicalDescriptorItemList_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBPhysicalDescriptorItemList_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBPhysicalDescriptorItemList_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBPhysicalDescriptorItemList_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBPhysicalDescriptorItemList_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBPhysicalDescriptorItemList_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBPhysicalDescriptorItemList_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBPhysicalDescriptorItemList_get_Item(This,Index,ppItem) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppItem) ) - -#define ISoftUSBPhysicalDescriptorItemList_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBPhysicalDescriptorItemList_Add(This,pItem,Index) \ - ( (This)->lpVtbl -> Add(This,pItem,Index) ) - -#define ISoftUSBPhysicalDescriptorItemList_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBPhysicalDescriptorItemList_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBPhysicalDescriptorItemList_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBHidFaultInjection_INTERFACE_DEFINED__ -#define __ISoftUSBHidFaultInjection_INTERFACE_DEFINED__ - -/* interface ISoftUSBHidFaultInjection */ -/* [object][helpstringcontext][helpcontext][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBHidFaultInjection; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("36D2CC56-B545-4F13-BAEF-425F87E5BB37") - ISoftUSBHidFaultInjection : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall StartFaultInjection( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall StopFaultInjection( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall FaultNextNRequests( - /* [in] */ BYTE bRequests, - /* [in] */ ULONG nTimesToFail) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall FaultNextNIOPackets( - /* [in] */ BYTE bEpNumber, - /* [in] */ BYTE bFlag, - /* [in] */ ULONG nTimesToFail) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall ChangeNextNIOPackets( - /* [in] */ BYTE bEpNumber, - /* [in] */ BYTE bFlags, - /* [in] */ SHORT wOffset, - /* [in] */ __RPC__in BYTE *pBuffer, - /* [in] */ SHORT wSize, - /* [in] */ BYTE bMask, - /* [in] */ ULONG nTimesToFail) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBHidFaultInjectionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBHidFaultInjection * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBHidFaultInjection * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBHidFaultInjection * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *StartFaultInjection )( - __RPC__in ISoftUSBHidFaultInjection * This); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *StopFaultInjection )( - __RPC__in ISoftUSBHidFaultInjection * This); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *FaultNextNRequests )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ BYTE bRequests, - /* [in] */ ULONG nTimesToFail); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *FaultNextNIOPackets )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ BYTE bEpNumber, - /* [in] */ BYTE bFlag, - /* [in] */ ULONG nTimesToFail); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *ChangeNextNIOPackets )( - __RPC__in ISoftUSBHidFaultInjection * This, - /* [in] */ BYTE bEpNumber, - /* [in] */ BYTE bFlags, - /* [in] */ SHORT wOffset, - /* [in] */ __RPC__in BYTE *pBuffer, - /* [in] */ SHORT wSize, - /* [in] */ BYTE bMask, - /* [in] */ ULONG nTimesToFail); - - END_INTERFACE - } ISoftUSBHidFaultInjectionVtbl; - - interface ISoftUSBHidFaultInjection - { - CONST_VTBL struct ISoftUSBHidFaultInjectionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBHidFaultInjection_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBHidFaultInjection_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBHidFaultInjection_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBHidFaultInjection_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBHidFaultInjection_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBHidFaultInjection_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBHidFaultInjection_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBHidFaultInjection_StartFaultInjection(This) \ - ( (This)->lpVtbl -> StartFaultInjection(This) ) - -#define ISoftUSBHidFaultInjection_StopFaultInjection(This) \ - ( (This)->lpVtbl -> StopFaultInjection(This) ) - -#define ISoftUSBHidFaultInjection_FaultNextNRequests(This,bRequests,nTimesToFail) \ - ( (This)->lpVtbl -> FaultNextNRequests(This,bRequests,nTimesToFail) ) - -#define ISoftUSBHidFaultInjection_FaultNextNIOPackets(This,bEpNumber,bFlag,nTimesToFail) \ - ( (This)->lpVtbl -> FaultNextNIOPackets(This,bEpNumber,bFlag,nTimesToFail) ) - -#define ISoftUSBHidFaultInjection_ChangeNextNIOPackets(This,bEpNumber,bFlags,wOffset,pBuffer,wSize,bMask,nTimesToFail) \ - ( (This)->lpVtbl -> ChangeNextNIOPackets(This,bEpNumber,bFlags,wOffset,pBuffer,wSize,bMask,nTimesToFail) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBHidFaultInjection_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftHIDProtocolXlator; - -#ifdef __cplusplus - -class DECLSPEC_UUID("887C935C-84F7-4252-BFE3-33CBC16F3D47") -SoftHIDProtocolXlator; -#endif - -EXTERN_C const CLSID CLSID_SoftHidUsbDevice; - -#ifdef __cplusplus - -class DECLSPEC_UUID("56545816-6EFE-45D0-BA2E-AC4426878CD5") -SoftHidUsbDevice; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBHidDescriptor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("3FB17F94-282C-4091-BCAA-EAA0AC104946") -SoftUSBHidDescriptor; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptor; - -#ifdef __cplusplus - -class DECLSPEC_UUID("D5DF9D05-B55C-45EC-BDC2-A9CC318CBBAB") -SoftUSBPhysicalDescriptor; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptorSet0; - -#ifdef __cplusplus - -class DECLSPEC_UUID("921F4757-CD5A-4935-BB3E-616ABFE18BEA") -SoftUSBPhysicalDescriptorSet0; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptorSet; - -#ifdef __cplusplus - -class DECLSPEC_UUID("EF7BF7AD-83D0-4160-9C07-39AD92A08A8D") -SoftUSBPhysicalDescriptorSet; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptorItem; - -#ifdef __cplusplus - -class DECLSPEC_UUID("18217BCD-1DC8-4737-A0A3-95EC3432DBFE") -SoftUSBPhysicalDescriptorItem; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptorSetList; - -#ifdef __cplusplus - -class DECLSPEC_UUID("E280E977-BD59-48A0-9B91-10D312157393") -SoftUSBPhysicalDescriptorSetList; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBPhysicalDescriptorItemList; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8F779698-A4E3-47FE-8542-C312FE1F748A") -SoftUSBPhysicalDescriptorItemList; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBHidFaultInjection; - -#ifdef __cplusplus - -class DECLSPEC_UUID("D775D2E8-F328-43F4-B680-80DF4AE0CB6A") -SoftUSBHidFaultInjection; -#endif -#endif /* __SOFTHIDUSBK_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/softusbif.h b/qt-correction-tool/pub/ddk/softusbif.h deleted file mode 100644 index 72b3f94..0000000 --- a/qt-correction-tool/pub/ddk/softusbif.h +++ /dev/null @@ -1,4424 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for softusbif.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - - -#ifndef __softusbif_h__ -#define __softusbif_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ISoftUSBConfigurations_FWD_DEFINED__ -#define __ISoftUSBConfigurations_FWD_DEFINED__ -typedef interface ISoftUSBConfigurations ISoftUSBConfigurations; -#endif /* __ISoftUSBConfigurations_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBConfiguration_FWD_DEFINED__ -#define __ISoftUSBConfiguration_FWD_DEFINED__ -typedef interface ISoftUSBConfiguration ISoftUSBConfiguration; -#endif /* __ISoftUSBConfiguration_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBInterface_FWD_DEFINED__ -#define __ISoftUSBInterface_FWD_DEFINED__ -typedef interface ISoftUSBInterface ISoftUSBInterface; -#endif /* __ISoftUSBInterface_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBEndpoint_FWD_DEFINED__ -#define __ISoftUSBEndpoint_FWD_DEFINED__ -typedef interface ISoftUSBEndpoint ISoftUSBEndpoint; -#endif /* __ISoftUSBEndpoint_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBDeviceQualifier_FWD_DEFINED__ -#define __ISoftUSBDeviceQualifier_FWD_DEFINED__ -typedef interface ISoftUSBDeviceQualifier ISoftUSBDeviceQualifier; -#endif /* __ISoftUSBDeviceQualifier_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBEndpointEvents_FWD_DEFINED__ -#define __ISoftUSBEndpointEvents_FWD_DEFINED__ -typedef interface ISoftUSBEndpointEvents ISoftUSBEndpointEvents; -#endif /* __ISoftUSBEndpointEvents_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBStrings_FWD_DEFINED__ -#define __ISoftUSBStrings_FWD_DEFINED__ -typedef interface ISoftUSBStrings ISoftUSBStrings; -#endif /* __ISoftUSBStrings_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBInterfaces_FWD_DEFINED__ -#define __ISoftUSBInterfaces_FWD_DEFINED__ -typedef interface ISoftUSBInterfaces ISoftUSBInterfaces; -#endif /* __ISoftUSBInterfaces_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBEndpoints_FWD_DEFINED__ -#define __ISoftUSBEndpoints_FWD_DEFINED__ -typedef interface ISoftUSBEndpoints ISoftUSBEndpoints; -#endif /* __ISoftUSBEndpoints_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBHub_FWD_DEFINED__ -#define __ISoftUSBHub_FWD_DEFINED__ -typedef interface ISoftUSBHub ISoftUSBHub; -#endif /* __ISoftUSBHub_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBHubPorts_FWD_DEFINED__ -#define __ISoftUSBHubPorts_FWD_DEFINED__ -typedef interface ISoftUSBHubPorts ISoftUSBHubPorts; -#endif /* __ISoftUSBHubPorts_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBHubPort_FWD_DEFINED__ -#define __ISoftUSBHubPort_FWD_DEFINED__ -typedef interface ISoftUSBHubPort ISoftUSBHubPort; -#endif /* __ISoftUSBHubPort_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBDevice_FWD_DEFINED__ -#define __ISoftUSBDevice_FWD_DEFINED__ -typedef interface ISoftUSBDevice ISoftUSBDevice; -#endif /* __ISoftUSBDevice_FWD_DEFINED__ */ - - -#ifndef __SoftUSBDevice_FWD_DEFINED__ -#define __SoftUSBDevice_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBDevice SoftUSBDevice; -#else -typedef struct SoftUSBDevice SoftUSBDevice; -#endif /* __cplusplus */ - -#endif /* __SoftUSBDevice_FWD_DEFINED__ */ - - -#ifndef __SoftUSBDeviceQualifier_FWD_DEFINED__ -#define __SoftUSBDeviceQualifier_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBDeviceQualifier SoftUSBDeviceQualifier; -#else -typedef struct SoftUSBDeviceQualifier SoftUSBDeviceQualifier; -#endif /* __cplusplus */ - -#endif /* __SoftUSBDeviceQualifier_FWD_DEFINED__ */ - - -#ifndef __SoftUSBConfiguration_FWD_DEFINED__ -#define __SoftUSBConfiguration_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBConfiguration SoftUSBConfiguration; -#else -typedef struct SoftUSBConfiguration SoftUSBConfiguration; -#endif /* __cplusplus */ - -#endif /* __SoftUSBConfiguration_FWD_DEFINED__ */ - - -#ifndef __SoftUSBInterface_FWD_DEFINED__ -#define __SoftUSBInterface_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBInterface SoftUSBInterface; -#else -typedef struct SoftUSBInterface SoftUSBInterface; -#endif /* __cplusplus */ - -#endif /* __SoftUSBInterface_FWD_DEFINED__ */ - - -#ifndef __SoftUSBEndpoint_FWD_DEFINED__ -#define __SoftUSBEndpoint_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBEndpoint SoftUSBEndpoint; -#else -typedef struct SoftUSBEndpoint SoftUSBEndpoint; -#endif /* __cplusplus */ - -#endif /* __SoftUSBEndpoint_FWD_DEFINED__ */ - - -#ifndef __SoftUSBConfigurations_FWD_DEFINED__ -#define __SoftUSBConfigurations_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBConfigurations SoftUSBConfigurations; -#else -typedef struct SoftUSBConfigurations SoftUSBConfigurations; -#endif /* __cplusplus */ - -#endif /* __SoftUSBConfigurations_FWD_DEFINED__ */ - - -#ifndef __SoftUSBInterfaces_FWD_DEFINED__ -#define __SoftUSBInterfaces_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBInterfaces SoftUSBInterfaces; -#else -typedef struct SoftUSBInterfaces SoftUSBInterfaces; -#endif /* __cplusplus */ - -#endif /* __SoftUSBInterfaces_FWD_DEFINED__ */ - - -#ifndef __SoftUSBEndpoints_FWD_DEFINED__ -#define __SoftUSBEndpoints_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBEndpoints SoftUSBEndpoints; -#else -typedef struct SoftUSBEndpoints SoftUSBEndpoints; -#endif /* __cplusplus */ - -#endif /* __SoftUSBEndpoints_FWD_DEFINED__ */ - - -#ifndef __SoftUSBStrings_FWD_DEFINED__ -#define __SoftUSBStrings_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBStrings SoftUSBStrings; -#else -typedef struct SoftUSBStrings SoftUSBStrings; -#endif /* __cplusplus */ - -#endif /* __SoftUSBStrings_FWD_DEFINED__ */ - - -#ifndef __ISoftUSBString_FWD_DEFINED__ -#define __ISoftUSBString_FWD_DEFINED__ -typedef interface ISoftUSBString ISoftUSBString; -#endif /* __ISoftUSBString_FWD_DEFINED__ */ - - -#ifndef __SoftUSBString_FWD_DEFINED__ -#define __SoftUSBString_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBString SoftUSBString; -#else -typedef struct SoftUSBString SoftUSBString; -#endif /* __cplusplus */ - -#endif /* __SoftUSBString_FWD_DEFINED__ */ - - -#ifndef __SoftUSBHub_FWD_DEFINED__ -#define __SoftUSBHub_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBHub SoftUSBHub; -#else -typedef struct SoftUSBHub SoftUSBHub; -#endif /* __cplusplus */ - -#endif /* __SoftUSBHub_FWD_DEFINED__ */ - - -#ifndef __SoftUSBHubPorts_FWD_DEFINED__ -#define __SoftUSBHubPorts_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBHubPorts SoftUSBHubPorts; -#else -typedef struct SoftUSBHubPorts SoftUSBHubPorts; -#endif /* __cplusplus */ - -#endif /* __SoftUSBHubPorts_FWD_DEFINED__ */ - - -#ifndef __SoftUSBHubPort_FWD_DEFINED__ -#define __SoftUSBHubPort_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SoftUSBHubPort SoftUSBHubPort; -#else -typedef struct SoftUSBHubPort SoftUSBHubPort; -#endif /* __cplusplus */ - -#endif /* __SoftUSBHubPort_FWD_DEFINED__ */ - - -#ifdef __cplusplus -extern "C"{ -#endif - - - -#ifndef __SOFTUSB_LIBRARY_DEFINED__ -#define __SOFTUSB_LIBRARY_DEFINED__ - -/* library SOFTUSB */ -/* [helpstringcontext][helpcontext][helpstring][helpstringdll][helpfile][version][lcid][uuid] */ - - - - - - - - - - - - - - - - -#if defined (MIDL_PASS) -typedef struct LIST_ENTRY - { - struct LIST_ENTRY *Flink; - struct LIST_ENTRY *Blink; - } LIST_ENTRY; - -#endif -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("A0E64F57-5D2D-4EE2-A257-227A575ACC60") struct SOFTUSB_OUT_TRANSFER - { - BYTE bStatus; - BYTE DataToggle; - ULONG cbData; - ULARGE_INTEGER uliQueuedTime; - LIST_ENTRY NextTransfer; - BYTE Data[ 1 ]; - } SOFTUSB_OUT_TRANSFER; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("17C3648C-CE1B-41EE-86CE-C681264A8336") -enum RequestMatchOpts - { MatchExactLength = 0, - MatchAnyLength = 1 - } RequestMatchOpts; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("550F7244-399C-4155-ADF0-2CCD83BB00F0") -enum SoftUSBHubPowerSwitchingMode - { GangedPowerSwitching = 0, - IndividualPowerSwitching = 1, - NoPowerSwitching = 2 - } SoftUSBHubPowerSwitchingMode; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("5BEA0626-9743-4517-8283-ECFAD924F4DB") -enum SoftUSBHubOverCurrentProtectionMode - { GlobalOverCurrentProtection = 0, - IndividualOverCurrentProtection = 1, - NoOverCurrentProtection = 2 - } SoftUSBHubOverCurrentProtectionMode; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("2A3C8E65-6335-4920-AFEA-DF6ED9B02760") -enum SoftUSBHubSpeed - { SoftUSBHubSpeedLow = 0, - SoftUSBHubSpeedFull = 1, - SoftUSBHubSpeedHigh = 2, - SoftUSBHubNotConnected = 3 - } SoftUSBHubSpeed; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("07B2373A-6942-491E-9BF7-CACF68A454F5") -enum SoftUSBHubIndicator - { SoftUSBHubOff = 0, - SoftUSBHubAmber = 1, - SoftUSBHubGreen = 2, - SoftUSBHubBlinkingOffGreen = 3, - SoftUSBHubBlinkingOffAmber = 4, - SoftUSBHubBlinkingGreenAmber = 5 - } SoftUSBHubIndicator; - -typedef /* [helpstringcontext][helpcontext][helpstring][uuid] */ DECLSPEC_UUID("2A3A45AE-3650-4922-8502-BA5960186974") -enum SoftUSBDeviceState - { SoftUSBDeviceStateDetached = 0, - SoftUSBDeviceStateAttached = 1, - SoftUSBDeviceStatePowered = 2, - SoftUSBDeviceStateDefault = 3, - SoftWUSBDeviceStateUnconnected = 4, - SoftWUSBDeviceStateUnauthenticated = 5, - SoftUSBDeviceStateAddress = 6, - SoftUSBDeviceStateConfigured = 7, - SoftUSBDeviceStateSuspended = 8 - } SoftUSBDeviceState; - -#define SOFTUSB_FOREVER ( ( ULONG )-1 ) - -#define SOFTUSB_ALL ( ( ULONG )-1 ) - -#define SOFTUSBENDPOINT_OBJECTFLAGS ( 100 ) - -#define SOFTUSBENDPOINT_DONOTTRACETRANSFERS ( 0 ) - -#define SOFTUSBENDPOINT_TRACETRANSFERINPUT ( 0x1 ) - -#define SOFTUSBENDPOINT_TRACETRANSFEROUPUT ( 0x2 ) - -#define SOFTUSBENDPOINT_TRACETRANSFERINPUTANDOUPUT ( 0x3 ) - -#define SOFTUSBENDPOINT_TRACEOUTLISTOVERFLOW ( 0x20 ) - - -EXTERN_C const IID LIBID_SOFTUSB; - -#ifndef __ISoftUSBConfigurations_INTERFACE_DEFINED__ -#define __ISoftUSBConfigurations_INTERFACE_DEFINED__ - -/* interface ISoftUSBConfigurations */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBConfigurations; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("15482CE8-BA91-4CEC-9D42-62C8390C3EAC") - ISoftUSBConfigurations : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBConfiguration **ppSOFTUSBConfig) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in SoftUSBConfiguration *ppSOFTUSBConfig, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBConfigurationsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBConfigurations * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBConfigurations * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBConfigurations * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBConfigurations * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBConfigurations * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBConfiguration **ppSOFTUSBConfig); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBConfigurations * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ __RPC__in SoftUSBConfiguration *ppSOFTUSBConfig, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBConfigurations * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBConfigurations * This); - - END_INTERFACE - } ISoftUSBConfigurationsVtbl; - - interface ISoftUSBConfigurations - { - CONST_VTBL struct ISoftUSBConfigurationsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBConfigurations_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBConfigurations_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBConfigurations_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBConfigurations_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBConfigurations_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBConfigurations_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBConfigurations_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBConfigurations_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBConfigurations_get_Item(This,Index,ppSOFTUSBConfig) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSOFTUSBConfig) ) - -#define ISoftUSBConfigurations_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBConfigurations_Add(This,ppSOFTUSBConfig,Index) \ - ( (This)->lpVtbl -> Add(This,ppSOFTUSBConfig,Index) ) - -#define ISoftUSBConfigurations_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBConfigurations_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBConfigurations_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBConfiguration_INTERFACE_DEFINED__ -#define __ISoftUSBConfiguration_INTERFACE_DEFINED__ - -/* interface ISoftUSBConfiguration */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBConfiguration; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2043f5a3-28de-4618-a5a6-519cefe62d96") - ISoftUSBConfiguration : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_TotalLength( - /* [retval][out] */ __RPC__out SHORT *psTotalLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NumInterfaces( - /* [retval][out] */ __RPC__out BYTE *pbNumInterfaces) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ConfigurationValue( - /* [retval][out] */ __RPC__out BYTE *pbConfigValue) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ConfigurationValue( - /* [in] */ BYTE bConfigValue) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Configuration( - /* [retval][out] */ __RPC__out BYTE *pbConfig) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Configuration( - /* [in] */ BYTE bConfig) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Attributes( - /* [retval][out] */ __RPC__out BYTE *pbAttributes) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Attributes( - /* [in] */ BYTE bAttributes) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_MaxPower( - /* [retval][out] */ __RPC__out BYTE *pbMaxPower) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_MaxPower( - /* [in] */ BYTE bMaxPower) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Interfaces( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBInterfaces **ppiInterfaces) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_AlternateForInterface( - /* [in] */ BYTE bInterface, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBInterface **ppiInterface) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceSpecificDescriptor( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceSpecificDescriptor( - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Context( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBConfigurationVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBConfiguration * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBConfiguration * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBConfiguration * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBConfiguration * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_TotalLength )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out SHORT *psTotalLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NumInterfaces )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbNumInterfaces); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ConfigurationValue )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbConfigValue); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ConfigurationValue )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bConfigValue); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Configuration )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbConfig); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Configuration )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bConfig); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Attributes )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbAttributes); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Attributes )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bAttributes); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_MaxPower )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__out BYTE *pbMaxPower); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_MaxPower )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bMaxPower); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Interfaces )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBInterfaces **ppiInterfaces); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_AlternateForInterface )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ BYTE bInterface, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBInterface **ppiInterface); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBConfiguration * This, - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Context )( - __RPC__in ISoftUSBConfiguration * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext); - - END_INTERFACE - } ISoftUSBConfigurationVtbl; - - interface ISoftUSBConfiguration - { - CONST_VTBL struct ISoftUSBConfigurationVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBConfiguration_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBConfiguration_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBConfiguration_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBConfiguration_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBConfiguration_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBConfiguration_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBConfiguration_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBConfiguration_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBConfiguration_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBConfiguration_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBConfiguration_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#define ISoftUSBConfiguration_get_TotalLength(This,psTotalLength) \ - ( (This)->lpVtbl -> get_TotalLength(This,psTotalLength) ) - -#define ISoftUSBConfiguration_get_NumInterfaces(This,pbNumInterfaces) \ - ( (This)->lpVtbl -> get_NumInterfaces(This,pbNumInterfaces) ) - -#define ISoftUSBConfiguration_get_ConfigurationValue(This,pbConfigValue) \ - ( (This)->lpVtbl -> get_ConfigurationValue(This,pbConfigValue) ) - -#define ISoftUSBConfiguration_put_ConfigurationValue(This,bConfigValue) \ - ( (This)->lpVtbl -> put_ConfigurationValue(This,bConfigValue) ) - -#define ISoftUSBConfiguration_get_Configuration(This,pbConfig) \ - ( (This)->lpVtbl -> get_Configuration(This,pbConfig) ) - -#define ISoftUSBConfiguration_put_Configuration(This,bConfig) \ - ( (This)->lpVtbl -> put_Configuration(This,bConfig) ) - -#define ISoftUSBConfiguration_get_Attributes(This,pbAttributes) \ - ( (This)->lpVtbl -> get_Attributes(This,pbAttributes) ) - -#define ISoftUSBConfiguration_put_Attributes(This,bAttributes) \ - ( (This)->lpVtbl -> put_Attributes(This,bAttributes) ) - -#define ISoftUSBConfiguration_get_MaxPower(This,pbMaxPower) \ - ( (This)->lpVtbl -> get_MaxPower(This,pbMaxPower) ) - -#define ISoftUSBConfiguration_put_MaxPower(This,bMaxPower) \ - ( (This)->lpVtbl -> put_MaxPower(This,bMaxPower) ) - -#define ISoftUSBConfiguration_get_Interfaces(This,ppiInterfaces) \ - ( (This)->lpVtbl -> get_Interfaces(This,ppiInterfaces) ) - -#define ISoftUSBConfiguration_get_AlternateForInterface(This,bInterface,ppiInterface) \ - ( (This)->lpVtbl -> get_AlternateForInterface(This,bInterface,ppiInterface) ) - -#define ISoftUSBConfiguration_get_DeviceSpecificDescriptor(This,ppsaDevSpecData) \ - ( (This)->lpVtbl -> get_DeviceSpecificDescriptor(This,ppsaDevSpecData) ) - -#define ISoftUSBConfiguration_put_DeviceSpecificDescriptor(This,psaDevSpecData) \ - ( (This)->lpVtbl -> put_DeviceSpecificDescriptor(This,psaDevSpecData) ) - -#define ISoftUSBConfiguration_get_Context(This,ppContext) \ - ( (This)->lpVtbl -> get_Context(This,ppContext) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBConfiguration_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBInterface_INTERFACE_DEFINED__ -#define __ISoftUSBInterface_INTERFACE_DEFINED__ - -/* interface ISoftUSBInterface */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBInterface; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("62bb9c16-8608-4f32-8f8a-ace032f38628") - ISoftUSBInterface : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InterfaceNumber( - /* [retval][out] */ __RPC__out BYTE *pbInterfaceNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InterfaceNumber( - /* [in] */ BYTE bInterfaceNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_AlternateSetting( - /* [retval][out] */ __RPC__out BYTE *pbAlternateSetting) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_AlternateSetting( - /* [in] */ BYTE bAlternateSetting) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NumEndpoints( - /* [retval][out] */ __RPC__out BYTE *pbNumEndpoints) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InterfaceClass( - /* [retval][out] */ __RPC__out BYTE *pbClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InterfaceClass( - /* [in] */ BYTE bClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InterfaceSubClass( - /* [retval][out] */ __RPC__out BYTE *pbSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InterfaceSubClass( - /* [in] */ BYTE bSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InterfaceProtocol( - /* [retval][out] */ __RPC__out BYTE *pbProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_InterfaceProtocol( - /* [in] */ BYTE bProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Interface( - /* [retval][out] */ __RPC__out BYTE *pbInterface) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Interface( - /* [in] */ BYTE bInterface) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Endpoints( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoints **ppiEndPoints) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceSpecificDescriptor( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceSpecificDescriptor( - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Context( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBInterfaceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBInterface * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBInterface * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBInterface * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBInterface * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InterfaceNumber )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbInterfaceNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InterfaceNumber )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bInterfaceNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_AlternateSetting )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbAlternateSetting); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_AlternateSetting )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bAlternateSetting); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NumEndpoints )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbNumEndpoints); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InterfaceClass )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InterfaceClass )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InterfaceSubClass )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InterfaceSubClass )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InterfaceProtocol )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_InterfaceProtocol )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Interface )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__out BYTE *pbInterface); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Interface )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ BYTE bInterface); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Endpoints )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoints **ppiEndPoints); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBInterface * This, - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Context )( - __RPC__in ISoftUSBInterface * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext); - - END_INTERFACE - } ISoftUSBInterfaceVtbl; - - interface ISoftUSBInterface - { - CONST_VTBL struct ISoftUSBInterfaceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBInterface_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBInterface_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBInterface_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBInterface_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBInterface_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBInterface_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBInterface_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBInterface_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBInterface_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBInterface_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBInterface_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#define ISoftUSBInterface_get_InterfaceNumber(This,pbInterfaceNumber) \ - ( (This)->lpVtbl -> get_InterfaceNumber(This,pbInterfaceNumber) ) - -#define ISoftUSBInterface_put_InterfaceNumber(This,bInterfaceNumber) \ - ( (This)->lpVtbl -> put_InterfaceNumber(This,bInterfaceNumber) ) - -#define ISoftUSBInterface_get_AlternateSetting(This,pbAlternateSetting) \ - ( (This)->lpVtbl -> get_AlternateSetting(This,pbAlternateSetting) ) - -#define ISoftUSBInterface_put_AlternateSetting(This,bAlternateSetting) \ - ( (This)->lpVtbl -> put_AlternateSetting(This,bAlternateSetting) ) - -#define ISoftUSBInterface_get_NumEndpoints(This,pbNumEndpoints) \ - ( (This)->lpVtbl -> get_NumEndpoints(This,pbNumEndpoints) ) - -#define ISoftUSBInterface_get_InterfaceClass(This,pbClass) \ - ( (This)->lpVtbl -> get_InterfaceClass(This,pbClass) ) - -#define ISoftUSBInterface_put_InterfaceClass(This,bClass) \ - ( (This)->lpVtbl -> put_InterfaceClass(This,bClass) ) - -#define ISoftUSBInterface_get_InterfaceSubClass(This,pbSubClass) \ - ( (This)->lpVtbl -> get_InterfaceSubClass(This,pbSubClass) ) - -#define ISoftUSBInterface_put_InterfaceSubClass(This,bSubClass) \ - ( (This)->lpVtbl -> put_InterfaceSubClass(This,bSubClass) ) - -#define ISoftUSBInterface_get_InterfaceProtocol(This,pbProtocol) \ - ( (This)->lpVtbl -> get_InterfaceProtocol(This,pbProtocol) ) - -#define ISoftUSBInterface_put_InterfaceProtocol(This,bProtocol) \ - ( (This)->lpVtbl -> put_InterfaceProtocol(This,bProtocol) ) - -#define ISoftUSBInterface_get_Interface(This,pbInterface) \ - ( (This)->lpVtbl -> get_Interface(This,pbInterface) ) - -#define ISoftUSBInterface_put_Interface(This,bInterface) \ - ( (This)->lpVtbl -> put_Interface(This,bInterface) ) - -#define ISoftUSBInterface_get_Endpoints(This,ppiEndPoints) \ - ( (This)->lpVtbl -> get_Endpoints(This,ppiEndPoints) ) - -#define ISoftUSBInterface_get_DeviceSpecificDescriptor(This,ppsaDevSpecData) \ - ( (This)->lpVtbl -> get_DeviceSpecificDescriptor(This,ppsaDevSpecData) ) - -#define ISoftUSBInterface_put_DeviceSpecificDescriptor(This,psaDevSpecData) \ - ( (This)->lpVtbl -> put_DeviceSpecificDescriptor(This,psaDevSpecData) ) - -#define ISoftUSBInterface_get_Context(This,ppContext) \ - ( (This)->lpVtbl -> get_Context(This,ppContext) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBInterface_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBEndpoint_INTERFACE_DEFINED__ -#define __ISoftUSBEndpoint_INTERFACE_DEFINED__ - -/* interface ISoftUSBEndpoint */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][dual][nonextensible][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBEndpoint; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("fd6ea833-81cb-4065-a219-8528bdcdc2e6") - ISoftUSBEndpoint : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_EndpointAddress( - /* [retval][out] */ __RPC__out BYTE *pbAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_EndpointAddress( - /* [in] */ BYTE bAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Attributes( - /* [retval][out] */ __RPC__out BYTE *pbAttributes) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Attributes( - /* [in] */ BYTE bAttributes) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_MaxPacketSize( - /* [retval][out] */ __RPC__out SHORT *psMaxPacket) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_MaxPacketSize( - /* [in] */ SHORT sMaxPacketSize) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Interval( - /* [retval][out] */ __RPC__out BYTE *pbInterval) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Interval( - /* [in] */ BYTE bInterval) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Halted( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pHalted) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Halted( - /* [in] */ VARIANT_BOOL Halted) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_MarshalEvents( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pMarshalEvents) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_MarshalEvents( - /* [in] */ VARIANT_BOOL MarshalEvents) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OutQueueSize( - /* [retval][out] */ __RPC__out long *plOutQueueSize) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OutQueueSize( - /* [in] */ long lOutQueueSize) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LoopbackEndpoint( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoint **ppiSoftUSBEndpoint) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LoopbackEndpoint( - /* [in] */ __RPC__in_opt ISoftUSBEndpoint *piSoftUSBEndpoint) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_LoopbackEndpoint( - /* [in] */ __RPC__in_opt ISoftUSBEndpoint *piSoftUSBEndpoint) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HandleStdDeviceRequests( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pHandleStdRequests) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HandleStdDeviceRequests( - /* [in] */ VARIANT_BOOL HandleStdRequests) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceSpecificDescriptor( - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceSpecificDescriptor( - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Context( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring] */ HRESULT __stdcall QueueINData( - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [in] */ BYTE bStatus, - /* [in] */ ULONG ulTimeToLive) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall DrainOUTQueue( - /* [in] */ ULONG cMaxTransfers, - /* [out] */ __RPC__out ULONG *pcTransfersRemaining, - /* [out] */ __RPC__deref_out_opt SOFTUSB_OUT_TRANSFER **ppTransfers) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ void __stdcall FreeOUTQueue( - /* [in] */ __RPC__in void *pTransfers) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall QueueDeviceRequestResponse( - /* [in] */ __RPC__in USBSETUPREQUEST *pRequest, - /* [in] */ RequestMatchOpts MatchOpt, - /* [in] */ __RPC__in BYTE *pbResponseData, - /* [in] */ ULONG cbResponseData, - /* [in] */ BYTE FinalRequestStatus, - /* [in] */ ULONG ulTimeToLive) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall PurgeINQueue( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall PurgeOUTQueue( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall PurgeOUTQueueOlderThan( - /* [in] */ ULONG ulOlderThan) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_InQueueLength( - /* [retval][out] */ __RPC__out long *plInQueueLength) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBEndpointVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBEndpoint * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBEndpoint * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBEndpoint * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBEndpoint * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ BYTE bDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_EndpointAddress )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out BYTE *pbAddress); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_EndpointAddress )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ BYTE bAddress); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Attributes )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out BYTE *pbAttributes); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Attributes )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ BYTE bAttributes); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_MaxPacketSize )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out SHORT *psMaxPacket); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_MaxPacketSize )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ SHORT sMaxPacketSize); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Interval )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out BYTE *pbInterval); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Interval )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ BYTE bInterval); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Halted )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pHalted); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Halted )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ VARIANT_BOOL Halted); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_MarshalEvents )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pMarshalEvents); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_MarshalEvents )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ VARIANT_BOOL MarshalEvents); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OutQueueSize )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out long *plOutQueueSize); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OutQueueSize )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ long lOutQueueSize); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LoopbackEndpoint )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoint **ppiSoftUSBEndpoint); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LoopbackEndpoint )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in_opt ISoftUSBEndpoint *piSoftUSBEndpoint); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_LoopbackEndpoint )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in_opt ISoftUSBEndpoint *piSoftUSBEndpoint); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HandleStdDeviceRequests )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pHandleStdRequests); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HandleStdDeviceRequests )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ VARIANT_BOOL HandleStdRequests); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__deref_out_opt SAFEARRAY * *ppsaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceSpecificDescriptor )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in SAFEARRAY * psaDevSpecData); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Context )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext); - - /* [helpstringcontext][helpcontext][helpstring] */ HRESULT ( __stdcall *QueueINData )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [in] */ BYTE bStatus, - /* [in] */ ULONG ulTimeToLive); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *DrainOUTQueue )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ ULONG cMaxTransfers, - /* [out] */ __RPC__out ULONG *pcTransfersRemaining, - /* [out] */ __RPC__deref_out_opt SOFTUSB_OUT_TRANSFER **ppTransfers); - - /* [helpstringcontext][helpcontext][helpstring][id] */ void ( __stdcall *FreeOUTQueue )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in void *pTransfers); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *QueueDeviceRequestResponse )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ __RPC__in USBSETUPREQUEST *pRequest, - /* [in] */ RequestMatchOpts MatchOpt, - /* [in] */ __RPC__in BYTE *pbResponseData, - /* [in] */ ULONG cbResponseData, - /* [in] */ BYTE FinalRequestStatus, - /* [in] */ ULONG ulTimeToLive); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *PurgeINQueue )( - __RPC__in ISoftUSBEndpoint * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *PurgeOUTQueue )( - __RPC__in ISoftUSBEndpoint * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *PurgeOUTQueueOlderThan )( - __RPC__in ISoftUSBEndpoint * This, - /* [in] */ ULONG ulOlderThan); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_InQueueLength )( - __RPC__in ISoftUSBEndpoint * This, - /* [retval][out] */ __RPC__out long *plInQueueLength); - - END_INTERFACE - } ISoftUSBEndpointVtbl; - - interface ISoftUSBEndpoint - { - CONST_VTBL struct ISoftUSBEndpointVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBEndpoint_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBEndpoint_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBEndpoint_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBEndpoint_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBEndpoint_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBEndpoint_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBEndpoint_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBEndpoint_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBEndpoint_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBEndpoint_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBEndpoint_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#define ISoftUSBEndpoint_get_EndpointAddress(This,pbAddress) \ - ( (This)->lpVtbl -> get_EndpointAddress(This,pbAddress) ) - -#define ISoftUSBEndpoint_put_EndpointAddress(This,bAddress) \ - ( (This)->lpVtbl -> put_EndpointAddress(This,bAddress) ) - -#define ISoftUSBEndpoint_get_Attributes(This,pbAttributes) \ - ( (This)->lpVtbl -> get_Attributes(This,pbAttributes) ) - -#define ISoftUSBEndpoint_put_Attributes(This,bAttributes) \ - ( (This)->lpVtbl -> put_Attributes(This,bAttributes) ) - -#define ISoftUSBEndpoint_get_MaxPacketSize(This,psMaxPacket) \ - ( (This)->lpVtbl -> get_MaxPacketSize(This,psMaxPacket) ) - -#define ISoftUSBEndpoint_put_MaxPacketSize(This,sMaxPacketSize) \ - ( (This)->lpVtbl -> put_MaxPacketSize(This,sMaxPacketSize) ) - -#define ISoftUSBEndpoint_get_Interval(This,pbInterval) \ - ( (This)->lpVtbl -> get_Interval(This,pbInterval) ) - -#define ISoftUSBEndpoint_put_Interval(This,bInterval) \ - ( (This)->lpVtbl -> put_Interval(This,bInterval) ) - -#define ISoftUSBEndpoint_get_Halted(This,pHalted) \ - ( (This)->lpVtbl -> get_Halted(This,pHalted) ) - -#define ISoftUSBEndpoint_put_Halted(This,Halted) \ - ( (This)->lpVtbl -> put_Halted(This,Halted) ) - -#define ISoftUSBEndpoint_get_MarshalEvents(This,pMarshalEvents) \ - ( (This)->lpVtbl -> get_MarshalEvents(This,pMarshalEvents) ) - -#define ISoftUSBEndpoint_put_MarshalEvents(This,MarshalEvents) \ - ( (This)->lpVtbl -> put_MarshalEvents(This,MarshalEvents) ) - -#define ISoftUSBEndpoint_get_OutQueueSize(This,plOutQueueSize) \ - ( (This)->lpVtbl -> get_OutQueueSize(This,plOutQueueSize) ) - -#define ISoftUSBEndpoint_put_OutQueueSize(This,lOutQueueSize) \ - ( (This)->lpVtbl -> put_OutQueueSize(This,lOutQueueSize) ) - -#define ISoftUSBEndpoint_get_LoopbackEndpoint(This,ppiSoftUSBEndpoint) \ - ( (This)->lpVtbl -> get_LoopbackEndpoint(This,ppiSoftUSBEndpoint) ) - -#define ISoftUSBEndpoint_put_LoopbackEndpoint(This,piSoftUSBEndpoint) \ - ( (This)->lpVtbl -> put_LoopbackEndpoint(This,piSoftUSBEndpoint) ) - -#define ISoftUSBEndpoint_putref_LoopbackEndpoint(This,piSoftUSBEndpoint) \ - ( (This)->lpVtbl -> putref_LoopbackEndpoint(This,piSoftUSBEndpoint) ) - -#define ISoftUSBEndpoint_get_HandleStdDeviceRequests(This,pHandleStdRequests) \ - ( (This)->lpVtbl -> get_HandleStdDeviceRequests(This,pHandleStdRequests) ) - -#define ISoftUSBEndpoint_put_HandleStdDeviceRequests(This,HandleStdRequests) \ - ( (This)->lpVtbl -> put_HandleStdDeviceRequests(This,HandleStdRequests) ) - -#define ISoftUSBEndpoint_get_DeviceSpecificDescriptor(This,ppsaDevSpecData) \ - ( (This)->lpVtbl -> get_DeviceSpecificDescriptor(This,ppsaDevSpecData) ) - -#define ISoftUSBEndpoint_put_DeviceSpecificDescriptor(This,psaDevSpecData) \ - ( (This)->lpVtbl -> put_DeviceSpecificDescriptor(This,psaDevSpecData) ) - -#define ISoftUSBEndpoint_get_Context(This,ppContext) \ - ( (This)->lpVtbl -> get_Context(This,ppContext) ) - -#define ISoftUSBEndpoint_QueueINData(This,pbDataBuffer,cbDataBuffer,bStatus,ulTimeToLive) \ - ( (This)->lpVtbl -> QueueINData(This,pbDataBuffer,cbDataBuffer,bStatus,ulTimeToLive) ) - -#define ISoftUSBEndpoint_DrainOUTQueue(This,cMaxTransfers,pcTransfersRemaining,ppTransfers) \ - ( (This)->lpVtbl -> DrainOUTQueue(This,cMaxTransfers,pcTransfersRemaining,ppTransfers) ) - -#define ISoftUSBEndpoint_FreeOUTQueue(This,pTransfers) \ - ( (This)->lpVtbl -> FreeOUTQueue(This,pTransfers) ) - -#define ISoftUSBEndpoint_QueueDeviceRequestResponse(This,pRequest,MatchOpt,pbResponseData,cbResponseData,FinalRequestStatus,ulTimeToLive) \ - ( (This)->lpVtbl -> QueueDeviceRequestResponse(This,pRequest,MatchOpt,pbResponseData,cbResponseData,FinalRequestStatus,ulTimeToLive) ) - -#define ISoftUSBEndpoint_PurgeINQueue(This) \ - ( (This)->lpVtbl -> PurgeINQueue(This) ) - -#define ISoftUSBEndpoint_PurgeOUTQueue(This) \ - ( (This)->lpVtbl -> PurgeOUTQueue(This) ) - -#define ISoftUSBEndpoint_PurgeOUTQueueOlderThan(This,ulOlderThan) \ - ( (This)->lpVtbl -> PurgeOUTQueueOlderThan(This,ulOlderThan) ) - -#define ISoftUSBEndpoint_get_InQueueLength(This,plInQueueLength) \ - ( (This)->lpVtbl -> get_InQueueLength(This,plInQueueLength) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBEndpoint_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBDeviceQualifier_INTERFACE_DEFINED__ -#define __ISoftUSBDeviceQualifier_INTERFACE_DEFINED__ - -/* interface ISoftUSBDeviceQualifier */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBDeviceQualifier; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a445e2cb-401f-4ac7-850f-579185d65140") - ISoftUSBDeviceQualifier : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_USB( - /* [retval][out] */ __RPC__out SHORT *psUSB) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_USB( - /* [in] */ SHORT sUSB) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceClass( - /* [retval][out] */ __RPC__out BYTE *pbDeviceClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceClass( - /* [in] */ BYTE bDeviceClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceSubClass( - /* [retval][out] */ __RPC__out BYTE *pbDeviceSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceSubClass( - /* [in] */ BYTE bDeviceSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceProtocol( - /* [retval][out] */ __RPC__out BYTE *pbProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceProtocol( - /* [in] */ BYTE bProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_MaxPacketSize0( - /* [retval][out] */ __RPC__out BYTE *pbMaxPacket) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_MaxPacketSize0( - /* [in] */ BYTE bMaxPacket) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NumConfigurations( - /* [retval][out] */ __RPC__out BYTE *pbNumConfigs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_NumConfigurations( - /* [in] */ BYTE bNumConfigs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reserved( - /* [retval][out] */ __RPC__out BYTE *pbReserved) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Reserved( - /* [in] */ BYTE bReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBDeviceQualifierVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBDeviceQualifier * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBDeviceQualifier * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBDeviceQualifier * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_USB )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out SHORT *psUSB); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_USB )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ SHORT sUSB); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceClass )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbDeviceClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceClass )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bDeviceClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceSubClass )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbDeviceSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceSubClass )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bDeviceSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceProtocol )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceProtocol )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_MaxPacketSize0 )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbMaxPacket); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_MaxPacketSize0 )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bMaxPacket); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NumConfigurations )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbNumConfigs); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_NumConfigurations )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bNumConfigs); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reserved )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [retval][out] */ __RPC__out BYTE *pbReserved); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Reserved )( - __RPC__in ISoftUSBDeviceQualifier * This, - /* [in] */ BYTE bReserved); - - END_INTERFACE - } ISoftUSBDeviceQualifierVtbl; - - interface ISoftUSBDeviceQualifier - { - CONST_VTBL struct ISoftUSBDeviceQualifierVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBDeviceQualifier_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBDeviceQualifier_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBDeviceQualifier_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBDeviceQualifier_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBDeviceQualifier_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBDeviceQualifier_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBDeviceQualifier_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBDeviceQualifier_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBDeviceQualifier_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBDeviceQualifier_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBDeviceQualifier_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#define ISoftUSBDeviceQualifier_get_USB(This,psUSB) \ - ( (This)->lpVtbl -> get_USB(This,psUSB) ) - -#define ISoftUSBDeviceQualifier_put_USB(This,sUSB) \ - ( (This)->lpVtbl -> put_USB(This,sUSB) ) - -#define ISoftUSBDeviceQualifier_get_DeviceClass(This,pbDeviceClass) \ - ( (This)->lpVtbl -> get_DeviceClass(This,pbDeviceClass) ) - -#define ISoftUSBDeviceQualifier_put_DeviceClass(This,bDeviceClass) \ - ( (This)->lpVtbl -> put_DeviceClass(This,bDeviceClass) ) - -#define ISoftUSBDeviceQualifier_get_DeviceSubClass(This,pbDeviceSubClass) \ - ( (This)->lpVtbl -> get_DeviceSubClass(This,pbDeviceSubClass) ) - -#define ISoftUSBDeviceQualifier_put_DeviceSubClass(This,bDeviceSubClass) \ - ( (This)->lpVtbl -> put_DeviceSubClass(This,bDeviceSubClass) ) - -#define ISoftUSBDeviceQualifier_get_DeviceProtocol(This,pbProtocol) \ - ( (This)->lpVtbl -> get_DeviceProtocol(This,pbProtocol) ) - -#define ISoftUSBDeviceQualifier_put_DeviceProtocol(This,bProtocol) \ - ( (This)->lpVtbl -> put_DeviceProtocol(This,bProtocol) ) - -#define ISoftUSBDeviceQualifier_get_MaxPacketSize0(This,pbMaxPacket) \ - ( (This)->lpVtbl -> get_MaxPacketSize0(This,pbMaxPacket) ) - -#define ISoftUSBDeviceQualifier_put_MaxPacketSize0(This,bMaxPacket) \ - ( (This)->lpVtbl -> put_MaxPacketSize0(This,bMaxPacket) ) - -#define ISoftUSBDeviceQualifier_get_NumConfigurations(This,pbNumConfigs) \ - ( (This)->lpVtbl -> get_NumConfigurations(This,pbNumConfigs) ) - -#define ISoftUSBDeviceQualifier_put_NumConfigurations(This,bNumConfigs) \ - ( (This)->lpVtbl -> put_NumConfigurations(This,bNumConfigs) ) - -#define ISoftUSBDeviceQualifier_get_Reserved(This,pbReserved) \ - ( (This)->lpVtbl -> get_Reserved(This,pbReserved) ) - -#define ISoftUSBDeviceQualifier_put_Reserved(This,bReserved) \ - ( (This)->lpVtbl -> put_Reserved(This,bReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBDeviceQualifier_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBEndpointEvents_INTERFACE_DEFINED__ -#define __ISoftUSBEndpointEvents_INTERFACE_DEFINED__ - -/* interface ISoftUSBEndpointEvents */ -/* [helpstringcontext][helpcontext][helpstring][object][nonextensible][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBEndpointEvents; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E6000897-6A14-4C06-A950-D069B8667091") - ISoftUSBEndpointEvents : public IUnknown - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OnSetupTransfer( - /* [in] */ BYTE DataToggle, - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out BYTE *pbStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OnWriteTransfer( - /* [in] */ BYTE DataToggle, - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out BYTE *pbStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OnReadTransfer( - /* [in] */ BYTE DataToggle, - /* [out] */ __RPC__out BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out ULONG *cbDataWritten, - /* [out] */ __RPC__out BYTE *pbStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OnDeviceRequest( - /* [in] */ __RPC__in USBSETUPREQUEST *pSetupRequest, - /* [out] */ __RPC__out ULONG *RequestHandle, - /* [in] */ __RPC__in BYTE *pbRequestData, - /* [in] */ ULONG cbRequestData, - /* [out] */ __RPC__deref_out_opt BYTE **ppbResponseData, - /* [out] */ __RPC__out ULONG *pcbResponseData, - /* [out] */ __RPC__out BYTE *pbSetupStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall OnDeviceRequestComplete( - /* [in] */ ULONG RequestHandle, - /* [out] */ __RPC__out BYTE *pbFinalRequestStatus) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBEndpointEventsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBEndpointEvents * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBEndpointEvents * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OnSetupTransfer )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ BYTE DataToggle, - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out BYTE *pbStatus); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OnWriteTransfer )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ BYTE DataToggle, - /* [in] */ __RPC__in BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out BYTE *pbStatus); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OnReadTransfer )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ BYTE DataToggle, - /* [out] */ __RPC__out BYTE *pbDataBuffer, - /* [in] */ ULONG cbDataBuffer, - /* [out] */ __RPC__out ULONG *cbDataWritten, - /* [out] */ __RPC__out BYTE *pbStatus); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OnDeviceRequest )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ __RPC__in USBSETUPREQUEST *pSetupRequest, - /* [out] */ __RPC__out ULONG *RequestHandle, - /* [in] */ __RPC__in BYTE *pbRequestData, - /* [in] */ ULONG cbRequestData, - /* [out] */ __RPC__deref_out_opt BYTE **ppbResponseData, - /* [out] */ __RPC__out ULONG *pcbResponseData, - /* [out] */ __RPC__out BYTE *pbSetupStatus); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *OnDeviceRequestComplete )( - __RPC__in ISoftUSBEndpointEvents * This, - /* [in] */ ULONG RequestHandle, - /* [out] */ __RPC__out BYTE *pbFinalRequestStatus); - - END_INTERFACE - } ISoftUSBEndpointEventsVtbl; - - interface ISoftUSBEndpointEvents - { - CONST_VTBL struct ISoftUSBEndpointEventsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBEndpointEvents_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBEndpointEvents_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBEndpointEvents_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBEndpointEvents_OnSetupTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,pbStatus) \ - ( (This)->lpVtbl -> OnSetupTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,pbStatus) ) - -#define ISoftUSBEndpointEvents_OnWriteTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,pbStatus) \ - ( (This)->lpVtbl -> OnWriteTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,pbStatus) ) - -#define ISoftUSBEndpointEvents_OnReadTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,cbDataWritten,pbStatus) \ - ( (This)->lpVtbl -> OnReadTransfer(This,DataToggle,pbDataBuffer,cbDataBuffer,cbDataWritten,pbStatus) ) - -#define ISoftUSBEndpointEvents_OnDeviceRequest(This,pSetupRequest,RequestHandle,pbRequestData,cbRequestData,ppbResponseData,pcbResponseData,pbSetupStatus) \ - ( (This)->lpVtbl -> OnDeviceRequest(This,pSetupRequest,RequestHandle,pbRequestData,cbRequestData,ppbResponseData,pcbResponseData,pbSetupStatus) ) - -#define ISoftUSBEndpointEvents_OnDeviceRequestComplete(This,RequestHandle,pbFinalRequestStatus) \ - ( (This)->lpVtbl -> OnDeviceRequestComplete(This,RequestHandle,pbFinalRequestStatus) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBEndpointEvents_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBStrings_INTERFACE_DEFINED__ -#define __ISoftUSBStrings_INTERFACE_DEFINED__ - -/* interface ISoftUSBStrings */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBStrings; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("B8714568-8ED3-4FE9-ADED-82EAA467956A") - ISoftUSBStrings : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBString **ppSOFTUSBString) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in SoftUSBString *pSOFTUSBString, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBStringsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBStrings * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBStrings * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBStrings * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBStrings * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBStrings * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBString **ppSOFTUSBString); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBStrings * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ __RPC__in SoftUSBString *pSOFTUSBString, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBStrings * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBStrings * This); - - END_INTERFACE - } ISoftUSBStringsVtbl; - - interface ISoftUSBStrings - { - CONST_VTBL struct ISoftUSBStringsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBStrings_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBStrings_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBStrings_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBStrings_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBStrings_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBStrings_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBStrings_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBStrings_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBStrings_get_Item(This,Index,ppSOFTUSBString) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSOFTUSBString) ) - -#define ISoftUSBStrings_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBStrings_Add(This,pSOFTUSBString,Index) \ - ( (This)->lpVtbl -> Add(This,pSOFTUSBString,Index) ) - -#define ISoftUSBStrings_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBStrings_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBStrings_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBInterfaces_INTERFACE_DEFINED__ -#define __ISoftUSBInterfaces_INTERFACE_DEFINED__ - -/* interface ISoftUSBInterfaces */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBInterfaces; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("450274FA-92A8-4FB1-A447-2CD3A45465A8") - ISoftUSBInterfaces : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBInterface **ppSOFTUSBInterface) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in SoftUSBInterface *ppSOFTUSBInterface, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBInterfacesVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBInterfaces * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBInterfaces * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBInterfaces * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBInterfaces * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBInterfaces * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBInterface **ppSOFTUSBInterface); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBInterfaces * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ __RPC__in SoftUSBInterface *ppSOFTUSBInterface, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBInterfaces * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBInterfaces * This); - - END_INTERFACE - } ISoftUSBInterfacesVtbl; - - interface ISoftUSBInterfaces - { - CONST_VTBL struct ISoftUSBInterfacesVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBInterfaces_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBInterfaces_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBInterfaces_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBInterfaces_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBInterfaces_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBInterfaces_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBInterfaces_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBInterfaces_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBInterfaces_get_Item(This,Index,ppSOFTUSBInterface) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSOFTUSBInterface) ) - -#define ISoftUSBInterfaces_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBInterfaces_Add(This,ppSOFTUSBInterface,Index) \ - ( (This)->lpVtbl -> Add(This,ppSOFTUSBInterface,Index) ) - -#define ISoftUSBInterfaces_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBInterfaces_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBInterfaces_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBEndpoints_INTERFACE_DEFINED__ -#define __ISoftUSBEndpoints_INTERFACE_DEFINED__ - -/* interface ISoftUSBEndpoints */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBEndpoints; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("797C784C-C45E-4DDD-9F21-5CBE273FA778") - ISoftUSBEndpoints : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBEndpoint **ppSOFTUSBEndpoint) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Add( - /* [in] */ __RPC__in SoftUSBEndpoint *ppSOFTUSBEndpoint, - /* [optional][in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Remove( - /* [in] */ VARIANT Index) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBEndpointsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBEndpoints * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBEndpoints * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBEndpoints * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBEndpoints * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBEndpoints * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBEndpoint **ppSOFTUSBEndpoint); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBEndpoints * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Add )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ __RPC__in SoftUSBEndpoint *ppSOFTUSBEndpoint, - /* [optional][in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Remove )( - __RPC__in ISoftUSBEndpoints * This, - /* [in] */ VARIANT Index); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Clear )( - __RPC__in ISoftUSBEndpoints * This); - - END_INTERFACE - } ISoftUSBEndpointsVtbl; - - interface ISoftUSBEndpoints - { - CONST_VTBL struct ISoftUSBEndpointsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBEndpoints_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBEndpoints_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBEndpoints_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBEndpoints_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBEndpoints_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBEndpoints_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBEndpoints_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBEndpoints_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBEndpoints_get_Item(This,Index,ppSOFTUSBEndpoint) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSOFTUSBEndpoint) ) - -#define ISoftUSBEndpoints_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#define ISoftUSBEndpoints_Add(This,ppSOFTUSBEndpoint,Index) \ - ( (This)->lpVtbl -> Add(This,ppSOFTUSBEndpoint,Index) ) - -#define ISoftUSBEndpoints_Remove(This,Index) \ - ( (This)->lpVtbl -> Remove(This,Index) ) - -#define ISoftUSBEndpoints_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBEndpoints_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBHub_INTERFACE_DEFINED__ -#define __ISoftUSBHub_INTERFACE_DEFINED__ - -/* interface ISoftUSBHub */ -/* [object][helpstringcontext][helpcontext][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBHub; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0442b742-2bd3-4b07-99d8-65b6395bcdb0") - ISoftUSBHub : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NbrPorts( - /* [retval][out] */ __RPC__out BYTE *pbPorts) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_NbrPorts( - /* [in] */ BYTE bPorts) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LogicalPowerSwitchingMode( - /* [retval][out] */ __RPC__out SoftUSBHubPowerSwitchingMode *pMode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LogicalPowerSwitchingMode( - /* [in] */ SoftUSBHubPowerSwitchingMode Mode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_CompoundDevice( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarCompound) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_CompoundDevice( - /* [in] */ VARIANT_BOOL fvarCompound) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrentProtectMode( - /* [retval][out] */ __RPC__out SoftUSBHubOverCurrentProtectionMode *pMode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrentProtectMode( - /* [in] */ SoftUSBHubOverCurrentProtectionMode Mode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_TTThinkTime( - /* [retval][out] */ __RPC__out BYTE *pbThinkTime) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_TTThinkTime( - /* [in] */ BYTE bThinkTime) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PortIndicatorsSupported( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_PortIndicatorsSupported( - /* [in] */ VARIANT_BOOL fvarSupported) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PwrOn2PwrGood( - /* [retval][out] */ __RPC__out BYTE *pbTime2PwrGood) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_PwrOn2PwrGood( - /* [in] */ BYTE bTime2PwrGood) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ContrCurrent( - /* [retval][out] */ __RPC__out BYTE *pbContrCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ContrCurrent( - /* [in] */ BYTE bContrCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_LocalPowerSourceChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_LocalPowerSourceChange( - /* [in] */ VARIANT_BOOL fvarChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrent( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrent( - /* [in] */ VARIANT_BOOL fvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrentChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrentChange( - /* [in] */ VARIANT_BOOL fvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Status( - /* [retval][out] */ __RPC__out long *plStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_RootHubPortNumber( - /* [retval][out] */ __RPC__out BYTE *pbPort) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SoftUSBDevice( - /* [retval][out] */ __RPC__deref_out_opt SoftUSBDevice **ppSoftUSBDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Ports( - /* [retval][out] */ __RPC__deref_out_opt SoftUSBHubPorts **ppPorts) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Destroy( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBHubVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBHub * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBHub * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBHub * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBHub * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBHub * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBHub * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBHub * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NbrPorts )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out BYTE *pbPorts); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_NbrPorts )( - __RPC__in ISoftUSBHub * This, - /* [in] */ BYTE bPorts); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LogicalPowerSwitchingMode )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out SoftUSBHubPowerSwitchingMode *pMode); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LogicalPowerSwitchingMode )( - __RPC__in ISoftUSBHub * This, - /* [in] */ SoftUSBHubPowerSwitchingMode Mode); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_CompoundDevice )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarCompound); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_CompoundDevice )( - __RPC__in ISoftUSBHub * This, - /* [in] */ VARIANT_BOOL fvarCompound); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrentProtectMode )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out SoftUSBHubOverCurrentProtectionMode *pMode); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrentProtectMode )( - __RPC__in ISoftUSBHub * This, - /* [in] */ SoftUSBHubOverCurrentProtectionMode Mode); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_TTThinkTime )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out BYTE *pbThinkTime); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_TTThinkTime )( - __RPC__in ISoftUSBHub * This, - /* [in] */ BYTE bThinkTime); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PortIndicatorsSupported )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSupported); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_PortIndicatorsSupported )( - __RPC__in ISoftUSBHub * This, - /* [in] */ VARIANT_BOOL fvarSupported); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PwrOn2PwrGood )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out BYTE *pbTime2PwrGood); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_PwrOn2PwrGood )( - __RPC__in ISoftUSBHub * This, - /* [in] */ BYTE bTime2PwrGood); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ContrCurrent )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out BYTE *pbContrCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ContrCurrent )( - __RPC__in ISoftUSBHub * This, - /* [in] */ BYTE bContrCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_LocalPowerSourceChange )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_LocalPowerSourceChange )( - __RPC__in ISoftUSBHub * This, - /* [in] */ VARIANT_BOOL fvarChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrent )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrent )( - __RPC__in ISoftUSBHub * This, - /* [in] */ VARIANT_BOOL fvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrentChange )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrentChange )( - __RPC__in ISoftUSBHub * This, - /* [in] */ VARIANT_BOOL fvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Status )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out long *plStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_RootHubPortNumber )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__out BYTE *pbPort); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SoftUSBDevice )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBDevice **ppSoftUSBDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Ports )( - __RPC__in ISoftUSBHub * This, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBHubPorts **ppPorts); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Destroy )( - __RPC__in ISoftUSBHub * This); - - END_INTERFACE - } ISoftUSBHubVtbl; - - interface ISoftUSBHub - { - CONST_VTBL struct ISoftUSBHubVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBHub_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBHub_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBHub_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBHub_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBHub_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBHub_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBHub_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBHub_get_NbrPorts(This,pbPorts) \ - ( (This)->lpVtbl -> get_NbrPorts(This,pbPorts) ) - -#define ISoftUSBHub_put_NbrPorts(This,bPorts) \ - ( (This)->lpVtbl -> put_NbrPorts(This,bPorts) ) - -#define ISoftUSBHub_get_LogicalPowerSwitchingMode(This,pMode) \ - ( (This)->lpVtbl -> get_LogicalPowerSwitchingMode(This,pMode) ) - -#define ISoftUSBHub_put_LogicalPowerSwitchingMode(This,Mode) \ - ( (This)->lpVtbl -> put_LogicalPowerSwitchingMode(This,Mode) ) - -#define ISoftUSBHub_get_CompoundDevice(This,pfvarCompound) \ - ( (This)->lpVtbl -> get_CompoundDevice(This,pfvarCompound) ) - -#define ISoftUSBHub_put_CompoundDevice(This,fvarCompound) \ - ( (This)->lpVtbl -> put_CompoundDevice(This,fvarCompound) ) - -#define ISoftUSBHub_get_OverCurrentProtectMode(This,pMode) \ - ( (This)->lpVtbl -> get_OverCurrentProtectMode(This,pMode) ) - -#define ISoftUSBHub_put_OverCurrentProtectMode(This,Mode) \ - ( (This)->lpVtbl -> put_OverCurrentProtectMode(This,Mode) ) - -#define ISoftUSBHub_get_TTThinkTime(This,pbThinkTime) \ - ( (This)->lpVtbl -> get_TTThinkTime(This,pbThinkTime) ) - -#define ISoftUSBHub_put_TTThinkTime(This,bThinkTime) \ - ( (This)->lpVtbl -> put_TTThinkTime(This,bThinkTime) ) - -#define ISoftUSBHub_get_PortIndicatorsSupported(This,pfvarSupported) \ - ( (This)->lpVtbl -> get_PortIndicatorsSupported(This,pfvarSupported) ) - -#define ISoftUSBHub_put_PortIndicatorsSupported(This,fvarSupported) \ - ( (This)->lpVtbl -> put_PortIndicatorsSupported(This,fvarSupported) ) - -#define ISoftUSBHub_get_PwrOn2PwrGood(This,pbTime2PwrGood) \ - ( (This)->lpVtbl -> get_PwrOn2PwrGood(This,pbTime2PwrGood) ) - -#define ISoftUSBHub_put_PwrOn2PwrGood(This,bTime2PwrGood) \ - ( (This)->lpVtbl -> put_PwrOn2PwrGood(This,bTime2PwrGood) ) - -#define ISoftUSBHub_get_ContrCurrent(This,pbContrCurrent) \ - ( (This)->lpVtbl -> get_ContrCurrent(This,pbContrCurrent) ) - -#define ISoftUSBHub_put_ContrCurrent(This,bContrCurrent) \ - ( (This)->lpVtbl -> put_ContrCurrent(This,bContrCurrent) ) - -#define ISoftUSBHub_get_LocalPowerSourceChange(This,pfvarChange) \ - ( (This)->lpVtbl -> get_LocalPowerSourceChange(This,pfvarChange) ) - -#define ISoftUSBHub_put_LocalPowerSourceChange(This,fvarChange) \ - ( (This)->lpVtbl -> put_LocalPowerSourceChange(This,fvarChange) ) - -#define ISoftUSBHub_get_OverCurrent(This,pfvarOverCurrent) \ - ( (This)->lpVtbl -> get_OverCurrent(This,pfvarOverCurrent) ) - -#define ISoftUSBHub_put_OverCurrent(This,fvarOverCurrent) \ - ( (This)->lpVtbl -> put_OverCurrent(This,fvarOverCurrent) ) - -#define ISoftUSBHub_get_OverCurrentChange(This,pfvarOverCurrentChange) \ - ( (This)->lpVtbl -> get_OverCurrentChange(This,pfvarOverCurrentChange) ) - -#define ISoftUSBHub_put_OverCurrentChange(This,fvarOverCurrentChange) \ - ( (This)->lpVtbl -> put_OverCurrentChange(This,fvarOverCurrentChange) ) - -#define ISoftUSBHub_get_Status(This,plStatus) \ - ( (This)->lpVtbl -> get_Status(This,plStatus) ) - -#define ISoftUSBHub_get_RootHubPortNumber(This,pbPort) \ - ( (This)->lpVtbl -> get_RootHubPortNumber(This,pbPort) ) - -#define ISoftUSBHub_get_SoftUSBDevice(This,ppSoftUSBDevice) \ - ( (This)->lpVtbl -> get_SoftUSBDevice(This,ppSoftUSBDevice) ) - -#define ISoftUSBHub_get_Ports(This,ppPorts) \ - ( (This)->lpVtbl -> get_Ports(This,ppPorts) ) - -#define ISoftUSBHub_Destroy(This) \ - ( (This)->lpVtbl -> Destroy(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBHub_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBHubPorts_INTERFACE_DEFINED__ -#define __ISoftUSBHubPorts_INTERFACE_DEFINED__ - -/* interface ISoftUSBHubPorts */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBHubPorts; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("DBC9054B-5F42-459C-96EE-182073F8BD3E") - ISoftUSBHubPorts : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Count( - /* [retval][out] */ __RPC__out long *plCount) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Item( - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBHubPort **ppSoftUSBHubPort) = 0; - - virtual /* [hidden][propget][id] */ HRESULT __stdcall get__NewEnum( - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBHubPortsVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBHubPorts * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBHubPorts * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBHubPorts * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBHubPorts * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBHubPorts * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBHubPorts * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBHubPorts * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Count )( - __RPC__in ISoftUSBHubPorts * This, - /* [retval][out] */ __RPC__out long *plCount); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Item )( - __RPC__in ISoftUSBHubPorts * This, - /* [in] */ VARIANT Index, - /* [retval][out] */ __RPC__deref_out_opt SoftUSBHubPort **ppSoftUSBHubPort); - - /* [hidden][propget][id] */ HRESULT ( __stdcall *get__NewEnum )( - __RPC__in ISoftUSBHubPorts * This, - /* [retval][out] */ __RPC__deref_out_opt IUnknown **ppunkEnum); - - END_INTERFACE - } ISoftUSBHubPortsVtbl; - - interface ISoftUSBHubPorts - { - CONST_VTBL struct ISoftUSBHubPortsVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBHubPorts_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBHubPorts_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBHubPorts_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBHubPorts_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBHubPorts_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBHubPorts_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBHubPorts_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBHubPorts_get_Count(This,plCount) \ - ( (This)->lpVtbl -> get_Count(This,plCount) ) - -#define ISoftUSBHubPorts_get_Item(This,Index,ppSoftUSBHubPort) \ - ( (This)->lpVtbl -> get_Item(This,Index,ppSoftUSBHubPort) ) - -#define ISoftUSBHubPorts_get__NewEnum(This,ppunkEnum) \ - ( (This)->lpVtbl -> get__NewEnum(This,ppunkEnum) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBHubPorts_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBHubPort_INTERFACE_DEFINED__ -#define __ISoftUSBHubPort_INTERFACE_DEFINED__ - -/* interface ISoftUSBHubPort */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBHubPort; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("11AE2FF8-4F47-4A14-85CA-0D13AC9F4A5A") - ISoftUSBHubPort : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceRemovable( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRemovable) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceRemovable( - /* [in] */ VARIANT_BOOL fvarRemovable) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_PwrCtrl( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPwrCtrl) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_PwrCtrl( - /* [in] */ VARIANT_BOOL fvarPwrCtrl) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_CurrentConnectStatus( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Enabled( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Enabled( - /* [in] */ VARIANT_BOOL fvarEnabled) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Suspend( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspend) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Suspend( - /* [in] */ VARIANT_BOOL fvarSuspend) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrent( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrent( - /* [in] */ VARIANT_BOOL fvarOverCurrent) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Reset( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarReset) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Power( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPower) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_AttachedDeviceSpeed( - /* [retval][out] */ __RPC__out SoftUSBHubSpeed *pSpeed) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_TestMode( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarTestMode) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_IndicatorControl( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarIndicatorControl) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Indicator( - /* [retval][out] */ __RPC__out SoftUSBHubIndicator *pIndicator) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ConnectStatusChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarConnectStatusChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ConnectStatusChange( - /* [in] */ VARIANT_BOOL fvarConnectStatusChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_EnableChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnableChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_EnableChange( - /* [in] */ VARIANT_BOOL fvarEnableChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SuspendChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspendChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_SuspendChange( - /* [in] */ VARIANT_BOOL fvarSuspendChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OverCurrentChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_OverCurrentChange( - /* [in] */ VARIANT_BOOL fvarOverCurrentChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ResetChange( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarResetChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ResetChange( - /* [in] */ VARIANT_BOOL fvarResetChange) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Status( - /* [retval][out] */ __RPC__out long *plStatus) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Device( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall HotPlug( - /* [in] */ __RPC__in /* external definition not present */ DSFDevice *pDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Unplug( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBHubPortVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBHubPort * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBHubPort * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBHubPort * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBHubPort * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceRemovable )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarRemovable); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceRemovable )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarRemovable); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_PwrCtrl )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPwrCtrl); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_PwrCtrl )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarPwrCtrl); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_CurrentConnectStatus )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Enabled )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Enabled )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarEnabled); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Suspend )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspend); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Suspend )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarSuspend); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrent )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrent )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarOverCurrent); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Reset )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarReset); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Power )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPower); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_AttachedDeviceSpeed )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out SoftUSBHubSpeed *pSpeed); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_TestMode )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarTestMode); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_IndicatorControl )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarIndicatorControl); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Indicator )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out SoftUSBHubIndicator *pIndicator); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ConnectStatusChange )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarConnectStatusChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ConnectStatusChange )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarConnectStatusChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_EnableChange )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarEnableChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_EnableChange )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarEnableChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SuspendChange )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarSuspendChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_SuspendChange )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarSuspendChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OverCurrentChange )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_OverCurrentChange )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarOverCurrentChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ResetChange )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarResetChange); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ResetChange )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ VARIANT_BOOL fvarResetChange); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Status )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__out long *plStatus); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Device )( - __RPC__in ISoftUSBHubPort * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *HotPlug )( - __RPC__in ISoftUSBHubPort * This, - /* [in] */ __RPC__in /* external definition not present */ DSFDevice *pDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Unplug )( - __RPC__in ISoftUSBHubPort * This); - - END_INTERFACE - } ISoftUSBHubPortVtbl; - - interface ISoftUSBHubPort - { - CONST_VTBL struct ISoftUSBHubPortVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBHubPort_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBHubPort_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBHubPort_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBHubPort_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBHubPort_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBHubPort_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBHubPort_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBHubPort_get_DeviceRemovable(This,pfvarRemovable) \ - ( (This)->lpVtbl -> get_DeviceRemovable(This,pfvarRemovable) ) - -#define ISoftUSBHubPort_put_DeviceRemovable(This,fvarRemovable) \ - ( (This)->lpVtbl -> put_DeviceRemovable(This,fvarRemovable) ) - -#define ISoftUSBHubPort_get_PwrCtrl(This,pfvarPwrCtrl) \ - ( (This)->lpVtbl -> get_PwrCtrl(This,pfvarPwrCtrl) ) - -#define ISoftUSBHubPort_put_PwrCtrl(This,fvarPwrCtrl) \ - ( (This)->lpVtbl -> put_PwrCtrl(This,fvarPwrCtrl) ) - -#define ISoftUSBHubPort_get_CurrentConnectStatus(This,pfvarStatus) \ - ( (This)->lpVtbl -> get_CurrentConnectStatus(This,pfvarStatus) ) - -#define ISoftUSBHubPort_get_Enabled(This,pfvarEnabled) \ - ( (This)->lpVtbl -> get_Enabled(This,pfvarEnabled) ) - -#define ISoftUSBHubPort_put_Enabled(This,fvarEnabled) \ - ( (This)->lpVtbl -> put_Enabled(This,fvarEnabled) ) - -#define ISoftUSBHubPort_get_Suspend(This,pfvarSuspend) \ - ( (This)->lpVtbl -> get_Suspend(This,pfvarSuspend) ) - -#define ISoftUSBHubPort_put_Suspend(This,fvarSuspend) \ - ( (This)->lpVtbl -> put_Suspend(This,fvarSuspend) ) - -#define ISoftUSBHubPort_get_OverCurrent(This,pfvarOverCurrent) \ - ( (This)->lpVtbl -> get_OverCurrent(This,pfvarOverCurrent) ) - -#define ISoftUSBHubPort_put_OverCurrent(This,fvarOverCurrent) \ - ( (This)->lpVtbl -> put_OverCurrent(This,fvarOverCurrent) ) - -#define ISoftUSBHubPort_get_Reset(This,pfvarReset) \ - ( (This)->lpVtbl -> get_Reset(This,pfvarReset) ) - -#define ISoftUSBHubPort_get_Power(This,pfvarPower) \ - ( (This)->lpVtbl -> get_Power(This,pfvarPower) ) - -#define ISoftUSBHubPort_get_AttachedDeviceSpeed(This,pSpeed) \ - ( (This)->lpVtbl -> get_AttachedDeviceSpeed(This,pSpeed) ) - -#define ISoftUSBHubPort_get_TestMode(This,pfvarTestMode) \ - ( (This)->lpVtbl -> get_TestMode(This,pfvarTestMode) ) - -#define ISoftUSBHubPort_get_IndicatorControl(This,pfvarIndicatorControl) \ - ( (This)->lpVtbl -> get_IndicatorControl(This,pfvarIndicatorControl) ) - -#define ISoftUSBHubPort_get_Indicator(This,pIndicator) \ - ( (This)->lpVtbl -> get_Indicator(This,pIndicator) ) - -#define ISoftUSBHubPort_get_ConnectStatusChange(This,pfvarConnectStatusChange) \ - ( (This)->lpVtbl -> get_ConnectStatusChange(This,pfvarConnectStatusChange) ) - -#define ISoftUSBHubPort_put_ConnectStatusChange(This,fvarConnectStatusChange) \ - ( (This)->lpVtbl -> put_ConnectStatusChange(This,fvarConnectStatusChange) ) - -#define ISoftUSBHubPort_get_EnableChange(This,pfvarEnableChange) \ - ( (This)->lpVtbl -> get_EnableChange(This,pfvarEnableChange) ) - -#define ISoftUSBHubPort_put_EnableChange(This,fvarEnableChange) \ - ( (This)->lpVtbl -> put_EnableChange(This,fvarEnableChange) ) - -#define ISoftUSBHubPort_get_SuspendChange(This,pfvarSuspendChange) \ - ( (This)->lpVtbl -> get_SuspendChange(This,pfvarSuspendChange) ) - -#define ISoftUSBHubPort_put_SuspendChange(This,fvarSuspendChange) \ - ( (This)->lpVtbl -> put_SuspendChange(This,fvarSuspendChange) ) - -#define ISoftUSBHubPort_get_OverCurrentChange(This,pfvarOverCurrentChange) \ - ( (This)->lpVtbl -> get_OverCurrentChange(This,pfvarOverCurrentChange) ) - -#define ISoftUSBHubPort_put_OverCurrentChange(This,fvarOverCurrentChange) \ - ( (This)->lpVtbl -> put_OverCurrentChange(This,fvarOverCurrentChange) ) - -#define ISoftUSBHubPort_get_ResetChange(This,pfvarResetChange) \ - ( (This)->lpVtbl -> get_ResetChange(This,pfvarResetChange) ) - -#define ISoftUSBHubPort_put_ResetChange(This,fvarResetChange) \ - ( (This)->lpVtbl -> put_ResetChange(This,fvarResetChange) ) - -#define ISoftUSBHubPort_get_Status(This,plStatus) \ - ( (This)->lpVtbl -> get_Status(This,plStatus) ) - -#define ISoftUSBHubPort_get_Device(This,ppDSFDevice) \ - ( (This)->lpVtbl -> get_Device(This,ppDSFDevice) ) - -#define ISoftUSBHubPort_HotPlug(This,pDSFDevice) \ - ( (This)->lpVtbl -> HotPlug(This,pDSFDevice) ) - -#define ISoftUSBHubPort_Unplug(This) \ - ( (This)->lpVtbl -> Unplug(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBHubPort_INTERFACE_DEFINED__ */ - - -#ifndef __ISoftUSBDevice_INTERFACE_DEFINED__ -#define __ISoftUSBDevice_INTERFACE_DEFINED__ - -/* interface ISoftUSBDevice */ -/* [helpstringcontext][helpcontext][helpstring][object][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBDevice; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9ac61697-81ae-459a-8629-bf5d5a838519") - ISoftUSBDevice : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Endpoint0( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoint **ppiEndpoint0) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_USB( - /* [retval][out] */ __RPC__out SHORT *psUSB) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_USB( - /* [in] */ SHORT sUSB) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceClass( - /* [retval][out] */ __RPC__out BYTE *pbDeviceClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceClass( - /* [in] */ BYTE bDeviceClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceSubClass( - /* [retval][out] */ __RPC__out BYTE *pbDeviceSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceSubClass( - /* [in] */ BYTE bDeviceSubClass) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceProtocol( - /* [retval][out] */ __RPC__out BYTE *pbProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceProtocol( - /* [in] */ BYTE bProtocol) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_MaxPacketSize0( - /* [retval][out] */ __RPC__out BYTE *pbMaxPacket) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_MaxPacketSize0( - /* [in] */ BYTE bMaxPacket) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Vendor( - /* [retval][out] */ __RPC__out SHORT *psVendor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Vendor( - /* [in] */ SHORT sVendor) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Product( - /* [retval][out] */ __RPC__out SHORT *psProduct) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Product( - /* [in] */ SHORT sProduct) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Device( - /* [retval][out] */ __RPC__out SHORT *psDeviceNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Device( - /* [in] */ SHORT sDeviceNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Manufacturer( - /* [retval][out] */ __RPC__out BYTE *pbManufacturer) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Manufacturer( - /* [in] */ BYTE bManufacturer) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_ProductDesc( - /* [retval][out] */ __RPC__out BYTE *pbProductDesc) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_ProductDesc( - /* [in] */ BYTE bProductDesc) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_SerialNumber( - /* [retval][out] */ __RPC__out BYTE *pbSerialNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_SerialNumber( - /* [in] */ BYTE bSerialNumber) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_NumConfigurations( - /* [retval][out] */ __RPC__out BYTE *pbNumConfigs) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DeviceQualifier( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBDeviceQualifier **ppiDeviceQualifier) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DeviceQualifier( - /* [in] */ __RPC__in_opt ISoftUSBDeviceQualifier *piDeviceQualifier) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT __stdcall putref_DeviceQualifier( - /* [in] */ __RPC__in_opt ISoftUSBDeviceQualifier *piDeviceQualifier) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Configurations( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBConfigurations **ppiConfigurations) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_USB1xConfigurations( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBConfigurations **ppiUSB1xConfigurations) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_RemoteWakeup( - /* [in] */ VARIANT_BOOL RemoteWakeup) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_RemoteWakeup( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pRemoteWakeup) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Address( - /* [retval][out] */ __RPC__out BYTE *pbAddress) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_HasExternalPower( - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPowered) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_HasExternalPower( - /* [in] */ VARIANT_BOOL fvarPowered) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_OperatingSpeed( - /* [retval][out] */ __RPC__out SoftUSBHubSpeed *pSpeed) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Configuration( - /* [retval][out] */ __RPC__out BYTE *pbConfig) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Strings( - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBStrings **ppiStrings) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DSFDevice( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Context( - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_State( - /* [retval][out] */ __RPC__out SoftUSBDeviceState *pState) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Resume( void) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT __stdcall Destroy( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBDeviceVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBDevice * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBDevice * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBDevice * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBDevice * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Endpoint0 )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBEndpoint **ppiEndpoint0); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_USB )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SHORT *psUSB); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_USB )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ SHORT sUSB); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceClass )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbDeviceClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceClass )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bDeviceClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceSubClass )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbDeviceSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceSubClass )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bDeviceSubClass); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceProtocol )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceProtocol )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bProtocol); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_MaxPacketSize0 )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbMaxPacket); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_MaxPacketSize0 )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bMaxPacket); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Vendor )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SHORT *psVendor); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Vendor )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ SHORT sVendor); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Product )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SHORT *psProduct); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Product )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ SHORT sProduct); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Device )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SHORT *psDeviceNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Device )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ SHORT sDeviceNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Manufacturer )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbManufacturer); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Manufacturer )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bManufacturer); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_ProductDesc )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbProductDesc); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_ProductDesc )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bProductDesc); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_SerialNumber )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbSerialNumber); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_SerialNumber )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ BYTE bSerialNumber); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_NumConfigurations )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbNumConfigs); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DeviceQualifier )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBDeviceQualifier **ppiDeviceQualifier); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DeviceQualifier )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ __RPC__in_opt ISoftUSBDeviceQualifier *piDeviceQualifier); - - /* [helpstringcontext][helpcontext][helpstring][propputref][id] */ HRESULT ( __stdcall *putref_DeviceQualifier )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ __RPC__in_opt ISoftUSBDeviceQualifier *piDeviceQualifier); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Configurations )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBConfigurations **ppiConfigurations); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_USB1xConfigurations )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBConfigurations **ppiUSB1xConfigurations); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_RemoteWakeup )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ VARIANT_BOOL RemoteWakeup); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_RemoteWakeup )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pRemoteWakeup); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Address )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbAddress); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_HasExternalPower )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out VARIANT_BOOL *pfvarPowered); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_HasExternalPower )( - __RPC__in ISoftUSBDevice * This, - /* [in] */ VARIANT_BOOL fvarPowered); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_OperatingSpeed )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SoftUSBHubSpeed *pSpeed); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Configuration )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out BYTE *pbConfig); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Strings )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt ISoftUSBStrings **ppiStrings); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DSFDevice )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFDevice **ppDSFDevice); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Context )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__deref_out_opt /* external definition not present */ DSFPropertyBag **ppContext); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_State )( - __RPC__in ISoftUSBDevice * This, - /* [retval][out] */ __RPC__out SoftUSBDeviceState *pState); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Resume )( - __RPC__in ISoftUSBDevice * This); - - /* [helpstringcontext][helpcontext][helpstring][id] */ HRESULT ( __stdcall *Destroy )( - __RPC__in ISoftUSBDevice * This); - - END_INTERFACE - } ISoftUSBDeviceVtbl; - - interface ISoftUSBDevice - { - CONST_VTBL struct ISoftUSBDeviceVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBDevice_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBDevice_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBDevice_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBDevice_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBDevice_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBDevice_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBDevice_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBDevice_get_Endpoint0(This,ppiEndpoint0) \ - ( (This)->lpVtbl -> get_Endpoint0(This,ppiEndpoint0) ) - -#define ISoftUSBDevice_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBDevice_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBDevice_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBDevice_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#define ISoftUSBDevice_get_USB(This,psUSB) \ - ( (This)->lpVtbl -> get_USB(This,psUSB) ) - -#define ISoftUSBDevice_put_USB(This,sUSB) \ - ( (This)->lpVtbl -> put_USB(This,sUSB) ) - -#define ISoftUSBDevice_get_DeviceClass(This,pbDeviceClass) \ - ( (This)->lpVtbl -> get_DeviceClass(This,pbDeviceClass) ) - -#define ISoftUSBDevice_put_DeviceClass(This,bDeviceClass) \ - ( (This)->lpVtbl -> put_DeviceClass(This,bDeviceClass) ) - -#define ISoftUSBDevice_get_DeviceSubClass(This,pbDeviceSubClass) \ - ( (This)->lpVtbl -> get_DeviceSubClass(This,pbDeviceSubClass) ) - -#define ISoftUSBDevice_put_DeviceSubClass(This,bDeviceSubClass) \ - ( (This)->lpVtbl -> put_DeviceSubClass(This,bDeviceSubClass) ) - -#define ISoftUSBDevice_get_DeviceProtocol(This,pbProtocol) \ - ( (This)->lpVtbl -> get_DeviceProtocol(This,pbProtocol) ) - -#define ISoftUSBDevice_put_DeviceProtocol(This,bProtocol) \ - ( (This)->lpVtbl -> put_DeviceProtocol(This,bProtocol) ) - -#define ISoftUSBDevice_get_MaxPacketSize0(This,pbMaxPacket) \ - ( (This)->lpVtbl -> get_MaxPacketSize0(This,pbMaxPacket) ) - -#define ISoftUSBDevice_put_MaxPacketSize0(This,bMaxPacket) \ - ( (This)->lpVtbl -> put_MaxPacketSize0(This,bMaxPacket) ) - -#define ISoftUSBDevice_get_Vendor(This,psVendor) \ - ( (This)->lpVtbl -> get_Vendor(This,psVendor) ) - -#define ISoftUSBDevice_put_Vendor(This,sVendor) \ - ( (This)->lpVtbl -> put_Vendor(This,sVendor) ) - -#define ISoftUSBDevice_get_Product(This,psProduct) \ - ( (This)->lpVtbl -> get_Product(This,psProduct) ) - -#define ISoftUSBDevice_put_Product(This,sProduct) \ - ( (This)->lpVtbl -> put_Product(This,sProduct) ) - -#define ISoftUSBDevice_get_Device(This,psDeviceNumber) \ - ( (This)->lpVtbl -> get_Device(This,psDeviceNumber) ) - -#define ISoftUSBDevice_put_Device(This,sDeviceNumber) \ - ( (This)->lpVtbl -> put_Device(This,sDeviceNumber) ) - -#define ISoftUSBDevice_get_Manufacturer(This,pbManufacturer) \ - ( (This)->lpVtbl -> get_Manufacturer(This,pbManufacturer) ) - -#define ISoftUSBDevice_put_Manufacturer(This,bManufacturer) \ - ( (This)->lpVtbl -> put_Manufacturer(This,bManufacturer) ) - -#define ISoftUSBDevice_get_ProductDesc(This,pbProductDesc) \ - ( (This)->lpVtbl -> get_ProductDesc(This,pbProductDesc) ) - -#define ISoftUSBDevice_put_ProductDesc(This,bProductDesc) \ - ( (This)->lpVtbl -> put_ProductDesc(This,bProductDesc) ) - -#define ISoftUSBDevice_get_SerialNumber(This,pbSerialNumber) \ - ( (This)->lpVtbl -> get_SerialNumber(This,pbSerialNumber) ) - -#define ISoftUSBDevice_put_SerialNumber(This,bSerialNumber) \ - ( (This)->lpVtbl -> put_SerialNumber(This,bSerialNumber) ) - -#define ISoftUSBDevice_get_NumConfigurations(This,pbNumConfigs) \ - ( (This)->lpVtbl -> get_NumConfigurations(This,pbNumConfigs) ) - -#define ISoftUSBDevice_get_DeviceQualifier(This,ppiDeviceQualifier) \ - ( (This)->lpVtbl -> get_DeviceQualifier(This,ppiDeviceQualifier) ) - -#define ISoftUSBDevice_put_DeviceQualifier(This,piDeviceQualifier) \ - ( (This)->lpVtbl -> put_DeviceQualifier(This,piDeviceQualifier) ) - -#define ISoftUSBDevice_putref_DeviceQualifier(This,piDeviceQualifier) \ - ( (This)->lpVtbl -> putref_DeviceQualifier(This,piDeviceQualifier) ) - -#define ISoftUSBDevice_get_Configurations(This,ppiConfigurations) \ - ( (This)->lpVtbl -> get_Configurations(This,ppiConfigurations) ) - -#define ISoftUSBDevice_get_USB1xConfigurations(This,ppiUSB1xConfigurations) \ - ( (This)->lpVtbl -> get_USB1xConfigurations(This,ppiUSB1xConfigurations) ) - -#define ISoftUSBDevice_put_RemoteWakeup(This,RemoteWakeup) \ - ( (This)->lpVtbl -> put_RemoteWakeup(This,RemoteWakeup) ) - -#define ISoftUSBDevice_get_RemoteWakeup(This,pRemoteWakeup) \ - ( (This)->lpVtbl -> get_RemoteWakeup(This,pRemoteWakeup) ) - -#define ISoftUSBDevice_get_Address(This,pbAddress) \ - ( (This)->lpVtbl -> get_Address(This,pbAddress) ) - -#define ISoftUSBDevice_get_HasExternalPower(This,pfvarPowered) \ - ( (This)->lpVtbl -> get_HasExternalPower(This,pfvarPowered) ) - -#define ISoftUSBDevice_put_HasExternalPower(This,fvarPowered) \ - ( (This)->lpVtbl -> put_HasExternalPower(This,fvarPowered) ) - -#define ISoftUSBDevice_get_OperatingSpeed(This,pSpeed) \ - ( (This)->lpVtbl -> get_OperatingSpeed(This,pSpeed) ) - -#define ISoftUSBDevice_get_Configuration(This,pbConfig) \ - ( (This)->lpVtbl -> get_Configuration(This,pbConfig) ) - -#define ISoftUSBDevice_get_Strings(This,ppiStrings) \ - ( (This)->lpVtbl -> get_Strings(This,ppiStrings) ) - -#define ISoftUSBDevice_get_DSFDevice(This,ppDSFDevice) \ - ( (This)->lpVtbl -> get_DSFDevice(This,ppDSFDevice) ) - -#define ISoftUSBDevice_get_Context(This,ppContext) \ - ( (This)->lpVtbl -> get_Context(This,ppContext) ) - -#define ISoftUSBDevice_get_State(This,pState) \ - ( (This)->lpVtbl -> get_State(This,pState) ) - -#define ISoftUSBDevice_Resume(This) \ - ( (This)->lpVtbl -> Resume(This) ) - -#define ISoftUSBDevice_Destroy(This) \ - ( (This)->lpVtbl -> Destroy(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBDevice_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftUSBDevice; - -#ifdef __cplusplus - -class DECLSPEC_UUID("23f4a589-a546-4ed4-b18b-fa427cde2ac5") -SoftUSBDevice; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBDeviceQualifier; - -#ifdef __cplusplus - -class DECLSPEC_UUID("97353e3a-cb00-4242-aaa7-b5efae55aab0") -SoftUSBDeviceQualifier; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBConfiguration; - -#ifdef __cplusplus - -class DECLSPEC_UUID("92cf5e08-ac7b-4100-8ef8-4f2487fc8b90") -SoftUSBConfiguration; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBInterface; - -#ifdef __cplusplus - -class DECLSPEC_UUID("e9b15f26-b117-4f4c-9489-26cf8041bf4d") -SoftUSBInterface; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBEndpoint; - -#ifdef __cplusplus - -class DECLSPEC_UUID("56D58287-C835-48A4-86A9-A0CBF8A8384A") -SoftUSBEndpoint; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBConfigurations; - -#ifdef __cplusplus - -class DECLSPEC_UUID("89D25542-A41B-49E1-9B80-2D3D28656541") -SoftUSBConfigurations; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBInterfaces; - -#ifdef __cplusplus - -class DECLSPEC_UUID("8BACAC01-DD39-4D96-88DC-25411C409E86") -SoftUSBInterfaces; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBEndpoints; - -#ifdef __cplusplus - -class DECLSPEC_UUID("5B538872-325E-48E6-8F83-EA5F1273A38E") -SoftUSBEndpoints; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBStrings; - -#ifdef __cplusplus - -class DECLSPEC_UUID("BA8EDA13-3019-4F40-8AEB-83051C28F313") -SoftUSBStrings; -#endif - -#ifndef __ISoftUSBString_INTERFACE_DEFINED__ -#define __ISoftUSBString_INTERFACE_DEFINED__ - -/* interface ISoftUSBString */ -/* [object][helpstringcontext][helpcontext][helpstring][hidden][nonextensible][oleautomation][dual][uuid] */ - - -EXTERN_C const IID IID_ISoftUSBString; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("3D6CC2C8-7EF0-40DD-9999-3071A7D3E6E0") - ISoftUSBString : public IDispatch - { - public: - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Value( - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrString) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Value( - /* [in] */ __RPC__in BSTR bstrString) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_Length( - /* [retval][out] */ __RPC__out BYTE *pbLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_Length( - /* [in] */ BYTE bLength) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT __stdcall get_DescriptorType( - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType) = 0; - - virtual /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT __stdcall put_DescriptorType( - /* [in] */ BYTE bDescriptorType) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISoftUSBStringVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISoftUSBString * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISoftUSBString * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISoftUSBString * This); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfoCount )( - __RPC__in ISoftUSBString * This, - /* [out] */ __RPC__out UINT *pctinfo); - - HRESULT ( STDMETHODCALLTYPE *GetTypeInfo )( - __RPC__in ISoftUSBString * This, - /* [in] */ UINT iTInfo, - /* [in] */ LCID lcid, - /* [out] */ __RPC__deref_out_opt ITypeInfo **ppTInfo); - - HRESULT ( STDMETHODCALLTYPE *GetIDsOfNames )( - __RPC__in ISoftUSBString * This, - /* [in] */ __RPC__in REFIID riid, - /* [size_is][in] */ __RPC__in_ecount_full(cNames) LPOLESTR *rgszNames, - /* [range][in] */ __RPC__in_range(0,16384) UINT cNames, - /* [in] */ LCID lcid, - /* [size_is][out] */ __RPC__out_ecount_full(cNames) DISPID *rgDispId); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Invoke )( - ISoftUSBString * This, - /* [in] */ DISPID dispIdMember, - /* [in] */ REFIID riid, - /* [in] */ LCID lcid, - /* [in] */ WORD wFlags, - /* [out][in] */ DISPPARAMS *pDispParams, - /* [out] */ VARIANT *pVarResult, - /* [out] */ EXCEPINFO *pExcepInfo, - /* [out] */ UINT *puArgErr); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Value )( - __RPC__in ISoftUSBString * This, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrString); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Value )( - __RPC__in ISoftUSBString * This, - /* [in] */ __RPC__in BSTR bstrString); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_Length )( - __RPC__in ISoftUSBString * This, - /* [retval][out] */ __RPC__out BYTE *pbLength); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_Length )( - __RPC__in ISoftUSBString * This, - /* [in] */ BYTE bLength); - - /* [helpstringcontext][helpcontext][helpstring][propget][id] */ HRESULT ( __stdcall *get_DescriptorType )( - __RPC__in ISoftUSBString * This, - /* [retval][out] */ __RPC__out BYTE *pbDescriptorType); - - /* [helpstringcontext][helpcontext][helpstring][propput][id] */ HRESULT ( __stdcall *put_DescriptorType )( - __RPC__in ISoftUSBString * This, - /* [in] */ BYTE bDescriptorType); - - END_INTERFACE - } ISoftUSBStringVtbl; - - interface ISoftUSBString - { - CONST_VTBL struct ISoftUSBStringVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISoftUSBString_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISoftUSBString_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISoftUSBString_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISoftUSBString_GetTypeInfoCount(This,pctinfo) \ - ( (This)->lpVtbl -> GetTypeInfoCount(This,pctinfo) ) - -#define ISoftUSBString_GetTypeInfo(This,iTInfo,lcid,ppTInfo) \ - ( (This)->lpVtbl -> GetTypeInfo(This,iTInfo,lcid,ppTInfo) ) - -#define ISoftUSBString_GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) \ - ( (This)->lpVtbl -> GetIDsOfNames(This,riid,rgszNames,cNames,lcid,rgDispId) ) - -#define ISoftUSBString_Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) \ - ( (This)->lpVtbl -> Invoke(This,dispIdMember,riid,lcid,wFlags,pDispParams,pVarResult,pExcepInfo,puArgErr) ) - - -#define ISoftUSBString_get_Value(This,pbstrString) \ - ( (This)->lpVtbl -> get_Value(This,pbstrString) ) - -#define ISoftUSBString_put_Value(This,bstrString) \ - ( (This)->lpVtbl -> put_Value(This,bstrString) ) - -#define ISoftUSBString_get_Length(This,pbLength) \ - ( (This)->lpVtbl -> get_Length(This,pbLength) ) - -#define ISoftUSBString_put_Length(This,bLength) \ - ( (This)->lpVtbl -> put_Length(This,bLength) ) - -#define ISoftUSBString_get_DescriptorType(This,pbDescriptorType) \ - ( (This)->lpVtbl -> get_DescriptorType(This,pbDescriptorType) ) - -#define ISoftUSBString_put_DescriptorType(This,bDescriptorType) \ - ( (This)->lpVtbl -> put_DescriptorType(This,bDescriptorType) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISoftUSBString_INTERFACE_DEFINED__ */ - - -EXTERN_C const CLSID CLSID_SoftUSBString; - -#ifdef __cplusplus - -class DECLSPEC_UUID("4D45AEA4-6FBE-4D81-B600-7511648520C7") -SoftUSBString; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBHub; - -#ifdef __cplusplus - -class DECLSPEC_UUID("4195454B-4ACE-44CD-B4B9-30CEE8D8951B") -SoftUSBHub; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBHubPorts; - -#ifdef __cplusplus - -class DECLSPEC_UUID("364C8DB9-665B-428A-840B-1D0CE777F05F") -SoftUSBHubPorts; -#endif - -EXTERN_C const CLSID CLSID_SoftUSBHubPort; - -#ifdef __cplusplus - -class DECLSPEC_UUID("736CD631-7F9D-4625-B693-F278E119FAD8") -SoftUSBHubPort; -#endif -#endif /* __SOFTUSB_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/srb.h b/qt-correction-tool/pub/ddk/srb.h deleted file mode 100644 index c0473d2..0000000 --- a/qt-correction-tool/pub/ddk/srb.h +++ /dev/null @@ -1,1521 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - srb.h - -Abstract: - - This file defines the interface between SCSI mini-port drivers and the - SCSI port driver. It is also used by SCSI class drivers to talk to the - SCSI port driver. - -Revision History: - ---*/ - -#ifndef _NTSRB_ -#define _NTSRB_ - -#pragma warning(push) -#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union - -#if DBG -#define DebugPrint(x) ScsiDebugPrint x -#else -#define DebugPrint(x) -#endif - -// begin_storport - -// -// Define SCSI maximum configuration parameters. -// - -#define SCSI_MAXIMUM_LOGICAL_UNITS 8 -#define SCSI_MAXIMUM_TARGETS_PER_BUS 128 -#define SCSI_MAXIMUM_LUNS_PER_TARGET 255 -#define SCSI_MAXIMUM_BUSES 8 -#define SCSI_MINIMUM_PHYSICAL_BREAKS 16 -#define SCSI_MAXIMUM_PHYSICAL_BREAKS 255 - -#define SCSI_COMBINE_BUS_TARGET( Bus, Target ) ( \ - ((((UCHAR) (Target)) & ~(0x20 - 1)) << 8) | \ - (((UCHAR) (Bus)) << 5) | \ - (((UCHAR) (Target)) & (0x20 - 1))) - -#define SCSI_DECODE_BUS_TARGET( Value, Bus, Target ) ( \ - Bus = (UCHAR) ((Value) >> 5), \ - Target = (UCHAR) ((((Value) >> 8) & ~(0x20 - 1)) | ((Value) & (0x20 - 1)))) - -// -// This constant is for backward compatibility. -// This use to be the maximum number of targets supported. -// - -#define SCSI_MAXIMUM_TARGETS 8 - -//end_storport - -typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS, *PSCSI_PHYSICAL_ADDRESS; - -typedef struct _ACCESS_RANGE { - SCSI_PHYSICAL_ADDRESS RangeStart; - ULONG RangeLength; - BOOLEAN RangeInMemory; -}ACCESS_RANGE, *PACCESS_RANGE; - -// -// Configuration information structure. Contains the information necessary -// to initialize the adapter. NOTE: This structure's must be a multiple of -// quadwords. -// - -typedef struct _PORT_CONFIGURATION_INFORMATION { - - // - // Length of port configuation information strucuture. - // - - ULONG Length; - - // - // IO bus number (0 for machines that have only 1 IO bus - // - - ULONG SystemIoBusNumber; - - // - // EISA, MCA or ISA - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Interrupt request level for device - // - - ULONG BusInterruptLevel; - - // - // Bus interrupt vector used with hardware buses which use as vector as - // well as level, such as internal buses. - // - - ULONG BusInterruptVector; - - // - // Interrupt mode (level-sensitive or edge-triggered) - // - - KINTERRUPT_MODE InterruptMode; - - // - // Maximum number of bytes that can be transferred in a single SRB - // - - ULONG MaximumTransferLength; - - // - // Number of contiguous blocks of physical memory - // - - ULONG NumberOfPhysicalBreaks; - - // - // DMA channel for devices using system DMA - // - - ULONG DmaChannel; - ULONG DmaPort; - DMA_WIDTH DmaWidth; - DMA_SPEED DmaSpeed; - - // - // Alignment masked required by the adapter for data transfers. - // - - ULONG AlignmentMask; - - // - // Number of access range elements which have been allocated. - // - - ULONG NumberOfAccessRanges; - - // - // Pointer to array of access range elements. - // - - ACCESS_RANGE (*AccessRanges)[]; - - // - // Reserved field. - // - - PVOID Reserved; - - // - // Number of SCSI buses attached to the adapter. - // - - UCHAR NumberOfBuses; - - // - // SCSI bus ID for adapter - // - - UCHAR InitiatorBusId[8]; - - // - // Indicates that the adapter does scatter/gather - // - - BOOLEAN ScatterGather; - - // - // Indicates that the adapter is a bus master - // - - BOOLEAN Master; - - // - // Host caches data or state. - // - - BOOLEAN CachesData; - - // - // Host adapter scans down for bios devices. - // - - BOOLEAN AdapterScansDown; - - // - // Primary at disk address (0x1F0) claimed. - // - - BOOLEAN AtdiskPrimaryClaimed; - - // - // Secondary at disk address (0x170) claimed. - // - - BOOLEAN AtdiskSecondaryClaimed; - - // - // The master uses 32-bit DMA addresses. - // - - BOOLEAN Dma32BitAddresses; - - // - // Use Demand Mode DMA rather than Single Request. - // - - BOOLEAN DemandMode; - - // - // Data buffers must be mapped into virtual address space. - // - - BOOLEAN MapBuffers; - - // - // The driver will need to tranlate virtual to physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Supports tagged queuing - // - - BOOLEAN TaggedQueuing; - - // - // Supports auto request sense. - // - - BOOLEAN AutoRequestSense; - - // - // Supports multiple requests per logical unit. - // - - BOOLEAN MultipleRequestPerLu; - - // - // Support receive event function. - // - - BOOLEAN ReceiveEvent; - - // - // Indicates the real-mode driver has initialized the card. - // - - BOOLEAN RealModeInitialized; - - // - // Indicate that the miniport will not touch the data buffers directly. - // - - BOOLEAN BufferAccessScsiPortControlled; - - // - // Indicator for wide scsi. - // - - UCHAR MaximumNumberOfTargets; - - // - // Ensure quadword alignment. - // - - UCHAR ReservedUchars[2]; - - // - // Adapter slot number - // - - ULONG SlotNumber; - - // - // Interrupt information for a second IRQ. - // - - ULONG BusInterruptLevel2; - ULONG BusInterruptVector2; - KINTERRUPT_MODE InterruptMode2; - - // - // DMA information for a second channel. - // - - ULONG DmaChannel2; - ULONG DmaPort2; - DMA_WIDTH DmaWidth2; - DMA_SPEED DmaSpeed2; - - // - // Fields added to allow for the miniport - // to update these sizes based on requirements - // for large transfers ( > 64K); - // - - ULONG DeviceExtensionSize; - ULONG SpecificLuExtensionSize; - ULONG SrbExtensionSize; - - // - // Used to determine whether the system and/or the miniport support - // 64-bit physical addresses. See SCSI_DMA64_* flags below. - // - - UCHAR Dma64BitAddresses; /* New */ - - // - // Indicates that the miniport can accept a SRB_FUNCTION_RESET_DEVICE - // to clear all requests to a particular LUN. - // - - BOOLEAN ResetTargetSupported; /* New */ - - // - // Indicates that the miniport can support more than 8 logical units per - // target (maximum LUN number is one less than this field). - // - - UCHAR MaximumNumberOfLogicalUnits; /* New */ - - // - // Supports WMI? - // - - BOOLEAN WmiDataProvider; - -} PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION; - -// -// Version control for ConfigInfo structure. -// - -#define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION) - - -// -// Flags for controlling 64-bit DMA use (PORT_CONFIGURATION_INFORMATION field -// Dma64BitAddresses) -// - -// -// Set by scsiport on entering HwFindAdapter if the system can support 64-bit -// physical addresses. The miniport can use this information before calling -// ScsiPortGetUncachedExtension to modify the DeviceExtensionSize, -// SpecificLuExtensionSize & SrbExtensionSize fields to account for the extra -// size of the scatter gather list. -// - -#define SCSI_DMA64_SYSTEM_SUPPORTED 0x80 - -// -// Set by the miniport before calling ScsiPortGetUncachedExtension to indicate -// that scsiport should provide it with 64-bit physical addresses. If the -// system does not support 64-bit PA's then this bit will be ignored. -// - -#define SCSI_DMA64_MINIPORT_SUPPORTED 0x01 - -#if (NTDDI_VERSION > NTDDI_WS03SP1) -// -// Set by the miniport before calling ScsiPortGetUncachedExtension to indicate -// that scsiport should provide it with 64-bit physical addresses. -// In addition to I/O requests being handled with > 4GB physical addresses, -// the uncached extension, SenseInof and Srb Extension may all lie above 4GB. -// If the system does not support 64-bit PA's then this bit will be ignored. -// - -#define SCSI_DMA64_MINIPORT_FULL64BIT_SUPPORTED 0x02 -#endif - - -// -// Command type (and parameter) definition(s) for AdapterControl requests. -// - -typedef enum _SCSI_ADAPTER_CONTROL_TYPE { - ScsiQuerySupportedControlTypes = 0, - ScsiStopAdapter, - ScsiRestartAdapter, - ScsiSetBootConfig, - ScsiSetRunningConfig, - ScsiAdapterControlMax, - MakeAdapterControlTypeSizeOfUlong = 0xffffffff -} SCSI_ADAPTER_CONTROL_TYPE, *PSCSI_ADAPTER_CONTROL_TYPE; - -// -// Adapter control status values -// - -typedef enum _SCSI_ADAPTER_CONTROL_STATUS { - ScsiAdapterControlSuccess = 0, - ScsiAdapterControlUnsuccessful -} SCSI_ADAPTER_CONTROL_STATUS, *PSCSI_ADAPTER_CONTROL_STATUS; - -// -// Parameters for Adapter Control Functions: -// - -// -// ScsiQuerySupportedControlTypes: -// - -#pragma warning(disable:4200) -typedef struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST { - - // - // Specifies the number of entries in the adapter control type list. - // - - IN ULONG MaxControlType; - - // - // The miniport will set TRUE for each control type it supports. - // The number of entries in this array is defined by MaxAdapterControlType - // - the miniport must not attempt to set any AC types beyond the maximum - // value specified. - // - - OUT BOOLEAN SupportedTypeList[0]; - -} SCSI_SUPPORTED_CONTROL_TYPE_LIST, *PSCSI_SUPPORTED_CONTROL_TYPE_LIST; -#pragma warning(default:4200) - -// begin_storport - -// -// Uninitialized flag value. -// - -#define SP_UNINITIALIZED_VALUE ((ULONG) ~0) -#define SP_UNTAGGED ((UCHAR) ~0) - -// -// Set asynchronous events. -// - -#define SRBEV_BUS_RESET 0x0001 -#define SRBEV_SCSI_ASYNC_NOTIFICATION 0x0002 - -// begin_ntminitape - -#define MAXIMUM_CDB_SIZE 12 - -// -// SCSI I/O Request Block -// - -typedef struct _SCSI_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR ScsiStatus; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - UCHAR QueueTag; // offset 8 - UCHAR QueueAction; // offset 9 - UCHAR CdbLength; // offset a - UCHAR SenseInfoBufferLength; // offset b - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - __field_bcount(DataTransferLength) \ - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - union { - ULONG InternalStatus; // offset 2c - ULONG QueueSortKey; // offset 2c - ULONG LinkTimeoutValue; // offset 2c - }; - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Cdb[16]; // offset 30 -} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK; - -#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK) - -// -// SCSI I/O Request Block for WMI Requests -// - -typedef struct _SCSI_WMI_REQUEST_BLOCK { - USHORT Length; - UCHAR Function; // SRB_FUNCTION_WMI - UCHAR SrbStatus; - UCHAR WMISubFunction; - UCHAR PathId; // If SRB_WMI_FLAGS_ADAPTER_REQUEST is set in - UCHAR TargetId; // WMIFlags then PathId, TargetId and Lun are - UCHAR Lun; // reserved fields. - UCHAR Reserved1; - UCHAR WMIFlags; - UCHAR Reserved2[2]; - ULONG SrbFlags; - ULONG DataTransferLength; - ULONG TimeOutValue; - PVOID DataBuffer; - PVOID DataPath; - PVOID Reserved3; - PVOID OriginalRequest; - PVOID SrbExtension; - ULONG Reserved4; - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved6; - -#endif -#endif - - UCHAR Reserved5[16]; -} SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK; - -typedef enum _STOR_DEVICE_POWER_STATE { - StorPowerDeviceUnspecified = 0, - StorPowerDeviceD0, - StorPowerDeviceD1, - StorPowerDeviceD2, - StorPowerDeviceD3, - StorPowerDeviceMaximum -} STOR_DEVICE_POWER_STATE, *PSTOR_DEVICE_POWER_STATE; - -typedef enum { - StorPowerActionNone = 0, - StorPowerActionReserved, - StorPowerActionSleep, - StorPowerActionHibernate, - StorPowerActionShutdown, - StorPowerActionShutdownReset, - StorPowerActionShutdownOff, - StorPowerActionWarmEject -} STOR_POWER_ACTION, *PSTOR_POWER_ACTION; - -typedef struct _SCSI_POWER_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR SrbPowerFlags; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_DEVICE_POWER_STATE DevicePowerState; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - STOR_POWER_ACTION PowerAction; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Reserved5[16]; // offset 30 -} SCSI_POWER_REQUEST_BLOCK, *PSCSI_POWER_REQUEST_BLOCK; - -// -// PNP minor function codes. -// -typedef enum { - StorStartDevice = 0x0, - StorRemoveDevice = 0x2, - StorStopDevice = 0x4, - StorQueryCapabilities = 0x9, - StorQueryResourceRequirements = 0xB, - StorFilterResourceRequirements = 0xD, - StorSurpriseRemoval = 0x17 -} STOR_PNP_ACTION, *PSTOR_PNP_ACTION; - -typedef struct _STOR_DEVICE_CAPABILITIES { - USHORT Version; - ULONG DeviceD1:1; - ULONG DeviceD2:1; - ULONG LockSupported:1; - ULONG EjectSupported:1; - ULONG Removable:1; - ULONG DockDevice:1; - ULONG UniqueID:1; - ULONG SilentInstall:1; - ULONG SurpriseRemovalOK:1; - ULONG NoDisplayInUI:1; - -} STOR_DEVICE_CAPABILITIES, *PSTOR_DEVICE_CAPABILITIES; - -typedef struct _SCSI_PNP_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR PnPSubFunction; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_PNP_ACTION PnPAction; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - ULONG SrbPnPFlags; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - UCHAR Reserved4[16]; // offset 30 -} SCSI_PNP_REQUEST_BLOCK, *PSCSI_PNP_REQUEST_BLOCK; - - -// -// SRB Functions -// - -#define SRB_FUNCTION_EXECUTE_SCSI 0x00 -#define SRB_FUNCTION_CLAIM_DEVICE 0x01 -#define SRB_FUNCTION_IO_CONTROL 0x02 -#define SRB_FUNCTION_RECEIVE_EVENT 0x03 -#define SRB_FUNCTION_RELEASE_QUEUE 0x04 -#define SRB_FUNCTION_ATTACH_DEVICE 0x05 -#define SRB_FUNCTION_RELEASE_DEVICE 0x06 -#define SRB_FUNCTION_SHUTDOWN 0x07 -#define SRB_FUNCTION_FLUSH 0x08 -#define SRB_FUNCTION_ABORT_COMMAND 0x10 -#define SRB_FUNCTION_RELEASE_RECOVERY 0x11 -#define SRB_FUNCTION_RESET_BUS 0x12 -#define SRB_FUNCTION_RESET_DEVICE 0x13 -#define SRB_FUNCTION_TERMINATE_IO 0x14 -#define SRB_FUNCTION_FLUSH_QUEUE 0x15 -#define SRB_FUNCTION_REMOVE_DEVICE 0x16 -#define SRB_FUNCTION_WMI 0x17 -#define SRB_FUNCTION_LOCK_QUEUE 0x18 -#define SRB_FUNCTION_UNLOCK_QUEUE 0x19 -#define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20 -#define SRB_FUNCTION_SET_LINK_TIMEOUT 0x21 -#define SRB_FUNCTION_LINK_TIMEOUT_OCCURRED 0x22 -#define SRB_FUNCTION_LINK_TIMEOUT_COMPLETE 0x23 -#define SRB_FUNCTION_POWER 0x24 -#define SRB_FUNCTION_PNP 0x25 -#define SRB_FUNCTION_DUMP_POINTERS 0x26 -// -// SRB Status -// - -#define SRB_STATUS_PENDING 0x00 -#define SRB_STATUS_SUCCESS 0x01 -#define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 -#define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 -#define SRB_STATUS_INVALID_REQUEST 0x06 -#define SRB_STATUS_INVALID_PATH_ID 0x07 -#define SRB_STATUS_NO_DEVICE 0x08 -#define SRB_STATUS_TIMEOUT 0x09 -#define SRB_STATUS_SELECTION_TIMEOUT 0x0A -#define SRB_STATUS_COMMAND_TIMEOUT 0x0B -#define SRB_STATUS_MESSAGE_REJECTED 0x0D -#define SRB_STATUS_BUS_RESET 0x0E -#define SRB_STATUS_PARITY_ERROR 0x0F -#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 -#define SRB_STATUS_NO_HBA 0x11 -#define SRB_STATUS_DATA_OVERRUN 0x12 -#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 -#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 -#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 -#define SRB_STATUS_REQUEST_FLUSHED 0x16 -#define SRB_STATUS_INVALID_LUN 0x20 -#define SRB_STATUS_INVALID_TARGET_ID 0x21 -#define SRB_STATUS_BAD_FUNCTION 0x22 -#define SRB_STATUS_ERROR_RECOVERY 0x23 -#define SRB_STATUS_NOT_POWERED 0x24 -#define SRB_STATUS_LINK_DOWN 0x25 - -// -// This value is used by the port driver to indicate that a non-scsi-related -// error occured. Miniports must never return this status. -// - -#define SRB_STATUS_INTERNAL_ERROR 0x30 - -// -// Srb status values 0x38 through 0x3f are reserved for internal port driver -// use. -// - - - -// -// SRB Status Masks -// - -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - -#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) - -// -// SRB Flag Bits -// - -#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002 -#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004 -#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 - -#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010 -#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 -#define SRB_FLAGS_DATA_IN 0x00000040 -#define SRB_FLAGS_DATA_OUT 0x00000080 -#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 -#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT) - -#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100 -#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200 -#define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400 - -#define SRB_FLAGS_IS_ACTIVE 0x00010000 -#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000 -#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000 -#define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000 - -#define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000 -#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000 - -#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000 -#define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000 - -#define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000 -#define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000 - -#if DBG==1 -// -// A signature used to validate the scsi port number -// at the end of a sense buffer. -// -#define SCSI_PORT_SIGNATURE 0x54524f50 -#endif - -// -// Queue Action -// - -#define SRB_SIMPLE_TAG_REQUEST 0x20 -#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21 -#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22 - -#define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_POWER_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_PNP_FLAGS_ADAPTER_REQUEST 0x01 - -// end_ntminitape - -// end_storport - -// -// SCSI Adapter Dependent Routines -// - -typedef -__checkReturn -BOOLEAN -(*PHW_INITIALIZE) ( - __in PVOID DeviceExtension - ); - -typedef -__checkReturn -BOOLEAN -(*PHW_STARTIO) ( - __in PVOID DeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb - ); - -typedef -__checkReturn -BOOLEAN -(*PHW_INTERRUPT) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_TIMER) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_DMA_STARTED) ( - __in PVOID DeviceExtension - ); - -typedef -__checkReturn -ULONG -(*PHW_FIND_ADAPTER) ( - __in PVOID DeviceExtension, - __in PVOID HwContext, - __in PVOID BusInformation, - __in PCHAR ArgumentString, - __inout PPORT_CONFIGURATION_INFORMATION ConfigInfo, - __out PBOOLEAN Again - ); - -typedef -__checkReturn -BOOLEAN -(*PHW_RESET_BUS) ( - __in PVOID DeviceExtension, - __in ULONG PathId - ); - -typedef -__checkReturn -BOOLEAN -(*PHW_ADAPTER_STATE) ( - __in PVOID DeviceExtension, - __in PVOID Context, - __in BOOLEAN SaveState - ); - -typedef -__checkReturn -SCSI_ADAPTER_CONTROL_STATUS -(*PHW_ADAPTER_CONTROL) ( - __in PVOID DeviceExtension, - __in SCSI_ADAPTER_CONTROL_TYPE ControlType, - __in PVOID Parameters - ); - -// -// Port driver error codes -// - -#define SP_BUS_PARITY_ERROR 0x0001 -#define SP_UNEXPECTED_DISCONNECT 0x0002 -#define SP_INVALID_RESELECTION 0x0003 -#define SP_BUS_TIME_OUT 0x0004 -#define SP_PROTOCOL_ERROR 0x0005 -#define SP_INTERNAL_ADAPTER_ERROR 0x0006 -#define SP_REQUEST_TIMEOUT 0x0007 -#define SP_IRQ_NOT_RESPONDING 0x0008 -#define SP_BAD_FW_WARNING 0x0009 -#define SP_BAD_FW_ERROR 0x000a -#define SP_LOST_WMI_MINIPORT_REQUEST 0x000b - -// -// Port driver version flags -// -#define SP_VER_TRACE_SUPPORT 0x0010 - -// -// Return values for SCSI_HW_FIND_ADAPTER. -// - -#define SP_RETURN_NOT_FOUND 0 -#define SP_RETURN_FOUND 1 -#define SP_RETURN_ERROR 2 -#define SP_RETURN_BAD_CONFIG 3 - -// -// Notification Event Types -// - -typedef enum _SCSI_NOTIFICATION_TYPE { - RequestComplete, - NextRequest, - NextLuRequest, - ResetDetected, - CallDisableInterrupts, - CallEnableInterrupts, - RequestTimerCall, - BusChangeDetected, /* New */ - WMIEvent, - WMIReregister, - LinkUp, - LinkDown, - QueryTickCount, - BufferOverrunDetected, - TraceNotification /* New */ -} SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE; - -// -// Structure passed between miniport initialization -// and SCSI port initialization -// - -typedef struct _HW_INITIALIZATION_DATA { - - ULONG HwInitializationDataSize; - - // - // Adapter interface type: - // - // Internal - // Isa - // Eisa - // MicroChannel - // TurboChannel - // PCIBus - // VMEBus - // NuBus - // PCMCIABus - // CBus - // MPIBus - // MPSABus - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Miniport driver routines - // - - PHW_INITIALIZE HwInitialize; - - PHW_STARTIO HwStartIo; - - PHW_INTERRUPT HwInterrupt; - - PHW_FIND_ADAPTER HwFindAdapter; - - PHW_RESET_BUS HwResetBus; - - PHW_DMA_STARTED HwDmaStarted; - - PHW_ADAPTER_STATE HwAdapterState; - - // - // Miniport driver resources - // - - ULONG DeviceExtensionSize; - - ULONG SpecificLuExtensionSize; - - ULONG SrbExtensionSize; - - ULONG NumberOfAccessRanges; - - PVOID Reserved; - - // - // Data buffers must be mapped into virtual address space. - // - - BOOLEAN MapBuffers; - - // - // The driver will need to tranlate virtual to physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Supports tagged queuing - // - - BOOLEAN TaggedQueuing; - - // - // Supports auto request sense. - // - - BOOLEAN AutoRequestSense; - - // - // Supports multiple requests per logical unit. - // - - BOOLEAN MultipleRequestPerLu; - - // - // Support receive event function. - // - - BOOLEAN ReceiveEvent; - - // - // Vendor identification length - // - - USHORT VendorIdLength; - - // - // Vendor identification - // - - PVOID VendorId; - - // - // Pad for alignment and future use. - // - - union { - - USHORT ReservedUshort; - - // - // Flags to indicate supported features - // - USHORT PortVersionFlags; - }; - - // - // Device identification length - // - - USHORT DeviceIdLength; - - // - // Device identification - // - - PVOID DeviceId; - - // - // Stop adapter routine. - // - - PHW_ADAPTER_CONTROL HwAdapterControl; - -} HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA; - -// begin_ntminitape - -#ifndef _NTDDK_ -#define SCSIPORT_API DECLSPEC_IMPORT -#else -#define SCSIPORT_API -#endif - -// end_ntminitape - -// -// Port driver routines called by miniport driver -// - -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -SCSIPORT_API -ULONG -ScsiPortInitialize( - __in PVOID Argument1, - __in PVOID Argument2, - __in struct _HW_INITIALIZATION_DATA *HwInitializationData, - __in PVOID HwContext - ); - -SCSIPORT_API -VOID -ScsiPortFreeDeviceBase( - __in PVOID HwDeviceExtension, - __in PVOID MappedAddress - ); - -__checkReturn -SCSIPORT_API -ULONG -ScsiPortGetBusData( - __in PVOID DeviceExtension, - __in ULONG BusDataType, - __in ULONG SystemIoBusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length - ); - -__checkReturn -SCSIPORT_API -ULONG -ScsiPortSetBusDataByOffset( - __in PVOID DeviceExtension, - __in ULONG BusDataType, - __in ULONG SystemIoBusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -__checkReturn -SCSIPORT_API -PVOID -ScsiPortGetDeviceBase( - __in PVOID HwDeviceExtension, - __in INTERFACE_TYPE BusType, - __in ULONG SystemIoBusNumber, - __in SCSI_PHYSICAL_ADDRESS IoAddress, - __in ULONG NumberOfBytes, - __in BOOLEAN InIoSpace - ); - -__checkReturn -SCSIPORT_API -PVOID -ScsiPortGetLogicalUnit( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun - ); - -__checkReturn -SCSIPORT_API -PSCSI_REQUEST_BLOCK -ScsiPortGetSrb( - __in PVOID DeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in LONG QueueTag - ); - -__checkReturn -SCSIPORT_API -SCSI_PHYSICAL_ADDRESS -ScsiPortGetPhysicalAddress( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __in PVOID VirtualAddress, - __out ULONG *Length - ); - -__checkReturn -SCSIPORT_API -PVOID -ScsiPortGetVirtualAddress( - __in PVOID HwDeviceExtension, - __in SCSI_PHYSICAL_ADDRESS PhysicalAddress - ); - -__checkReturn -SCSIPORT_API -PVOID -ScsiPortGetUncachedExtension( - __in PVOID HwDeviceExtension, - __in PPORT_CONFIGURATION_INFORMATION ConfigInfo, - __in ULONG NumberOfBytes - ); - -SCSIPORT_API -VOID -ScsiPortFlushDma( - __in PVOID DeviceExtension - ); - -SCSIPORT_API -VOID -ScsiPortIoMapTransfer( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __in PVOID LogicalAddress, - __in ULONG Length - ); - -SCSIPORT_API -VOID -ScsiPortNotification( - __in SCSI_NOTIFICATION_TYPE NotificationType, - __in PVOID HwDeviceExtension, - ... - ); - -SCSIPORT_API -VOID -ScsiPortLogError( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb OPTIONAL, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG ErrorCode, - __in ULONG UniqueId - ); - -SCSIPORT_API -VOID -ScsiPortCompleteRequest( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in UCHAR SrbStatus - ); - -SCSIPORT_API -VOID -ScsiPortStallExecution( - __in ULONG Delay - ); - -#if defined(_M_AMD64) - -#define ScsiPortReadPortUchar READ_PORT_UCHAR -#define ScsiPortReadPortUshort READ_PORT_USHORT -#define ScsiPortReadPortUlong READ_PORT_ULONG - -#define ScsiPortReadPortBufferUchar READ_PORT_BUFFER_UCHAR -#define ScsiPortReadPortBufferUshort READ_PORT_BUFFER_USHORT -#define ScsiPortReadPortBufferUlong READ_PORT_BUFFER_ULONG - -#define ScsiPortReadRegisterUchar READ_REGISTER_UCHAR -#define ScsiPortReadRegisterUshort READ_REGISTER_USHORT -#define ScsiPortReadRegisterUlong READ_REGISTER_ULONG - -#define ScsiPortReadRegisterBufferUchar READ_REGISTER_BUFFER_UCHAR -#define ScsiPortReadRegisterBufferUshort READ_REGISTER_BUFFER_USHORT -#define ScsiPortReadRegisterBufferUlong READ_REGISTER_BUFFER_ULONG - -#define ScsiPortWritePortUchar WRITE_PORT_UCHAR -#define ScsiPortWritePortUshort WRITE_PORT_USHORT -#define ScsiPortWritePortUlong WRITE_PORT_ULONG - -#define ScsiPortWritePortBufferUchar WRITE_PORT_BUFFER_UCHAR -#define ScsiPortWritePortBufferUshort WRITE_PORT_BUFFER_USHORT -#define ScsiPortWritePortBufferUlong WRITE_PORT_BUFFER_ULONG - -#define ScsiPortWriteRegisterUchar WRITE_REGISTER_UCHAR -#define ScsiPortWriteRegisterUshort WRITE_REGISTER_USHORT -#define ScsiPortWriteRegisterUlong WRITE_REGISTER_ULONG - -#define ScsiPortWriteRegisterBufferUchar WRITE_REGISTER_BUFFER_UCHAR -#define ScsiPortWriteRegisterBufferUshort WRITE_REGISTER_BUFFER_USHORT -#define ScsiPortWriteRegisterBufferUlong WRITE_REGISTER_BUFFER_ULONG - -#define ScsiPortMoveMemory memmove - -#else - -__checkReturn -SCSIPORT_API -UCHAR -ScsiPortReadPortUchar( - __in PUCHAR Port - ); - -__checkReturn -SCSIPORT_API -USHORT -ScsiPortReadPortUshort( - __in PUSHORT Port - ); - -__checkReturn -SCSIPORT_API -ULONG -ScsiPortReadPortUlong( - __in PULONG Port - ); - -SCSIPORT_API -VOID -ScsiPortReadPortBufferUchar( - __in PUCHAR Port, - __in PUCHAR Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortReadPortBufferUshort( - __in PUSHORT Port, - __in PUSHORT Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortReadPortBufferUlong( - __in PULONG Port, - __in PULONG Buffer, - __in ULONG Count - ); - -__checkReturn -SCSIPORT_API -UCHAR -ScsiPortReadRegisterUchar( - __in PUCHAR Register - ); - -__checkReturn -SCSIPORT_API -USHORT -ScsiPortReadRegisterUshort( - __in PUSHORT Register - ); - -__checkReturn -SCSIPORT_API -ULONG -ScsiPortReadRegisterUlong( - __in PULONG Register - ); - -SCSIPORT_API -VOID -ScsiPortReadRegisterBufferUchar( - __in PUCHAR Register, - __in PUCHAR Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortReadRegisterBufferUshort( - __in PUSHORT Register, - __in PUSHORT Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortReadRegisterBufferUlong( - __in PULONG Register, - __in PULONG Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWritePortUchar( - __in PUCHAR Port, - __in UCHAR Value - ); - -SCSIPORT_API -VOID -ScsiPortWritePortUshort( - __in PUSHORT Port, - __in USHORT Value - ); - -SCSIPORT_API -VOID -ScsiPortWritePortUlong( - __in PULONG Port, - __in ULONG Value - ); - -SCSIPORT_API -VOID -ScsiPortWritePortBufferUchar( - __in PUCHAR Port, - __in PUCHAR Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWritePortBufferUshort( - __in PUSHORT Port, - __in PUSHORT Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWritePortBufferUlong( - __in PULONG Port, - __in PULONG Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterUchar( - __in PUCHAR Register, - __in UCHAR Value - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterUshort( - __in PUSHORT Register, - __in USHORT Value - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterUlong( - __in PULONG Register, - __in ULONG Value - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterBufferUchar( - __in PUCHAR Register, - __in PUCHAR Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterBufferUshort( - __in PUSHORT Register, - __in PUSHORT Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortWriteRegisterBufferUlong( - __in PULONG Register, - __in PULONG Buffer, - __in ULONG Count - ); - -SCSIPORT_API -VOID -ScsiPortMoveMemory( - __in PVOID WriteBuffer, - __in PVOID ReadBuffer, - __in ULONG Length - ); - -#endif - -__checkReturn -SCSIPORT_API -SCSI_PHYSICAL_ADDRESS -ScsiPortConvertUlongToPhysicalAddress( - __in ULONG_PTR UlongAddress - ); - -__checkReturn -SCSIPORT_API -ULONG -ScsiPortConvertPhysicalAddressToUlong( - __in SCSI_PHYSICAL_ADDRESS Address - ); - -SCSIPORT_API -VOID -ScsiPortQuerySystemTime( - __out PLARGE_INTEGER CurrentTime - ); - -#define ScsiPortConvertPhysicalAddressToUlong(Address) ((Address).LowPart) - -// -// Sundown Note: -// For now, ScsiPortConvertPhysicalAddressToULongPtr() exists only as a macro. -// - -#define ScsiPortConvertPhysicalAddressToULongPtr(Address) ((ULONG_PTR)((Address).QuadPart)) - -__checkReturn -SCSIPORT_API -BOOLEAN -ScsiPortValidateRange( - __in PVOID HwDeviceExtension, - __in INTERFACE_TYPE BusType, - __in ULONG SystemIoBusNumber, - __in SCSI_PHYSICAL_ADDRESS IoAddress, - __in ULONG NumberOfBytes, - __in BOOLEAN InIoSpace - ); - -// begin_ntminitape - -SCSIPORT_API -VOID -ScsiDebugPrint( - ULONG DebugPrintLevel, - PCCHAR DebugMessage, - ... - ); - -// end_ntminitape - -#pragma warning(pop) // un-sets any local warning changes - -#endif // - diff --git a/qt-correction-tool/pub/ddk/statusdeviceservice.h b/qt-correction-tool/pub/ddk/statusdeviceservice.h deleted file mode 100644 index ffe0dc5..0000000 --- a/qt-correction-tool/pub/ddk/statusdeviceservice.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - * StatusDeviceService.h - * - * Contains definitions of the Status Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _STATUSDEVICESERVICE_H_ -#define _STATUSDEVICESERVICE_H_ - -#include - -/*****************************************************************************/ -/* Status Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Status, - 0x0B9F1048, 0xB94B, 0xDC9A, 0x4e, 0xd7, 0xfe, 0x4f, 0xed, 0x3a, 0x0d, 0xeb); - -#define NAME_StatusSvc L"Status" -#define TYPE_StatusSvc DEVSVCTYPE_DEFAULT - -/*****************************************************************************/ -/* Status Service Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_StatusSvc, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13); - - -/* PKEY_StatusSvc_SignalStrength - * - * Signal strength in "bars" from 0 (no signal) to 4 (excellent signal) - * - * Type: UInt8 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_SignalStrength, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 2); - -#define NAME_StatusSvc_SignalStrength L"SignalStrength" - -#define RANGEMIN_StatusSvc_SignalStrength 0 -#define RANGEMAX_StatusSvc_SignalStrength 4 -#define RANGESTEP_StatusSvc_SignalStrength 1 - -/* PKEY_StatusSvc_TextMessages - * - * Number of unread text messages (255 max) - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_TextMessages, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 3); - -#define NAME_StatusSvc_TextMessages L"TextMessages" -#define RANGEMAX_StatusSvc_TextMessages 255 - -/* PKEY_StatusSvc_NewPictures - * - * Number of "new" pictures on the device (65535 max) - * - * Type: UInt16 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_NewPictures, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 4); - -#define NAME_StatusSvc_NewPictures L"NewPictures" -#define RANGEMAX_StatusSvc_NewPictures 65535 - -/* PKEY_StatusSvc_MissedCalls - * - * Number of missed calls on the device (255 max) - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_MissedCalls, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 5); - -#define NAME_StatusSvc_MissedCalls L"MissedCalls" -#define RANGEMAX_StatusSvc_MissedCalls 255 - - -/* PKEY_StatusSvc_VoiceMail - * - * Number of "available" voice mail messages (255 max) - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_VoiceMail, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 6); - -#define NAME_StatusSvc_VoiceMail L"VoiceMail" -#define RANGEMAX_StatusSvc_VoiceMail 255 - - -/* PKEY_StatusSvc_NetworkName - * - * Network provider network name - * - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_NetworkName, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 7); - -#define NAME_StatusSvc_NetworkName L"NetworkName" - - -/* PKEY_StatusSvc_NetworkType - * - * Network "type" (e.g. GPRS, EDGE, UMTS, 1xRTT, EVDO, or operator branded) - * - * Type: String - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_NetworkType, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 8); - -#define NAME_StatusSvc_NetworkType L"NetworkType" - - -/* PKEY_StatusSvc_Roaming - * - * Current network roaming state - * - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_Roaming, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 9); - -#define NAME_StatusSvc_Roaming L"Roaming" - -#define ENUM_StatusSvc_RoamingInactive 0x00 -#define ENUM_StatusSvc_RoamingActive 0x01 -#define ENUM_StatusSvc_RoamingUnknown 0x02 - - -/* PKEY_StatusSvc_BatteryLife - * - * Remaining battery life on the device as a percentage between 100 and 0. - * - * Type: UInt8 - * Form: Range - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_BatteryLife, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 10); - -#define NAME_StatusSvc_BatteryLife L"BatteryLife" - -#define RANGEMIN_StatusSvc_BatteryLife 0 -#define RANGEMAX_StatusSvc_BatteryLife 100 -#define RANGESTEP_StatusSvc_BatteryLife 1 - - -/* PKEY_StatusSvc_ChargingState - * - * Current charging state of the device - * - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_ChargingState, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 11); - -#define NAME_StatusSvc_ChargingState L"ChargingState" - -#define ENUM_StatusSvc_ChargingInactive 0x00 -#define ENUM_StatusSvc_ChargingActive 0x01 -#define ENUM_StatusSvc_ChargingUnknown 0x02 - - -/* PKEY_StatusSvc_StorageCapacity - * - * Total storage capacity on the device (across all storages) - * - * Type: UInt64 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_StorageCapacity, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 12); - -#define NAME_StatusSvc_StorageCapacity L"StorageCapacity" - - -/* PKEY_StatusSvc_StorageFreeSpace - * - * Total free storage capacity on the device (across all storages) - * - * Type: UInt64 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_StatusSvc_StorageFreeSpace, - 0x49cd1f76, 0x5626, 0x4b17, 0xa4, 0xe8, 0x18, 0xb4, 0xaa, 0x1a, 0x22, 0x13, - 13); - -#define NAME_StatusSvc_StorageFreeSpace L"StorageFreeSpace" - -#endif /* _STATUSDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/stdcall.inc b/qt-correction-tool/pub/ddk/stdcall.inc deleted file mode 100644 index 31d4702..0000000 --- a/qt-correction-tool/pub/ddk/stdcall.inc +++ /dev/null @@ -1,366 +0,0 @@ -;****************************Public Macro************************************ -; -; ComposeInst Inst,p1,p2,p3,p4,p5,p6,p7,p8,p9 -; -; This macro simply concatenates all arguments into one string. -; -; -;**************************************************************************** - -ComposeInst macro Inst,p1,p2,p3,p4,p5,p6,p7,p8,p9 - &Inst &p1&p2&p3&p4&p5&p6&p7&p8&p9 -endm - -;****************************Public Macro************************************ -; -; CountArg cCount,ArgList -; -; This macro count the number of arguments in the ArgList and returns -; the value in cCount. -; -; History: -; Thu 15-Aug-1991 16:21:14 -by- Viroon Touranachun [viroont] -; Created -; -;**************************************************************************** - -CountArg macro cCount,ArgList - - cCount = 0 - - irp arg, - cCount = cCount+1 - endm -endm - -;****************************Public Macro************************************ -; -; RevPush ArgList,cCount -; -; This macro pushes the arguments in ArgList in the reverse order -; and returns the number of arguments in cCount. -; -; History: -; Thu 15-Aug-1991 16:21:14 -by- Viroon Touranachun [viroont] -; Created -; -;**************************************************************************** - -RevPush macro ArgList,cCount - Local index,x - - CountArg cCount, - - index = cCount - rept cCount - x = 0 - irp arg, - x = x+1 - ife index-x - push arg - exitm - endif - endm - index = index-1 - endm -endm - -;****************************Public Macro************************************ -; -; The following sections contain calling-convention related macros for: -; -; PUBLICP Func,N -; to define a public label -; -; EXTRNP Func,N -; to define a external near label -; -; LABELP Func,N -; to label an address as a routine entry point -; -; cProc Func,N,ArgList -; to declare a routine header -; -; ProcName Name,Func,N -; to rename a function Func to Name. Using it in conjunction with -; normal function declaration (with the new name) will solve an error -; caused by a long parameter list routine that exhausts page width. -; -; cRet Func -; to return from Func routines (declared with cProc or ProcName.) -; -; endProc Func -; to declare the end of routine (declared with cProc or ProcName.) -; -; endMod Func -; to declare the end of module with an entry point at Func (declared -; with cProc or ProcName.) -; -; cCall Func,ArgList -; to call to a routine--Func--with the arguments pushed on the stack -; -; ptrCall Func,ArgList -; to call through a pointer with the arguments pushed on the stack -; -; MovAddr dest,Func,n -; to move the address of the routine--Func--into dest. -; -; Note that for the standard calling convention all the function names, -; Func, are automatically converted to Func@N where N is the number of -; bytes in the argument list. -; -; History: -; Thu 15-Aug-1991 16:21:14 -by- Viroon Touranachun [viroont] -; Created -; -;**************************************************************************** - -IFNDEF DOS_PLATFORM -IFNDEF STD_CALL - -;**************************************************************************** -; -; This section is used exclusively for C calling convention. -; -;**************************************************************************** - -PUBLICP macro Func,N - - public &Func -endm - -EXTRNP macro Func,N - - extrn &Func:NEAR -endm - -LABELP macro Func,N - - &Func LABEL NEAR -endm - -ProcName macro Name,Func,N - - &Name EQU <&Func> -endm - -cProc macro Func,N,ArgList - - ProcName xxx&Func,Func,N - - xxx&Func proc &ArgList -endm - -cRet macro Func - - ret -endm - -endProc macro Func - - xxx&Func endp -endm - -endMod macro Func - -end xxx&Func - -endm - -ptrCall macro Func,ArgList - Local Bytes - - RevPush ,Bytes - Bytes = Bytes*4 - - call &Func - - if Bytes GT 0 - add esp,Bytes - endif -endm - -cCall macro Func,ArgList - Local Bytes - - RevPush ,Bytes - Bytes = Bytes*4 - - call &Func - - if Bytes GT 0 - add esp,Bytes - endif - -endm - -MovAddr macro dest,addr,n - - mov dest,offset FLAT:&addr -endm - -ENDIF ; STD_CALL - -ELSE - -IFNDEF STD_CALL - -;**************************************************************************** -; -; This section is used exclusively for Pascal calling convention. -; -;**************************************************************************** - -PUBLICP macro Func,N - - public &Func -endm - -EXTRNP macro Func,N - - extrn &Func:NEAR -endm - -LABELP macro Func,N - - &Func LABEL NEAR -endm - -ProcName macro Name,Func,N - - &Name EQU <&Func> -endm - -cProc macro Func,N,ArgList - - ProcName xxx&Func,Func,N - - xxx&Func proc &ArgList -endm - -cRet macro Func - - ret -endm - -endProc macro Func - - xxx&Func endp -endm - -endMod macro Func - -end xxx&Func - -endm - -cCall macro Func,ArgList - irp arg, - push arg - endm - - call &Func -endm - -MovAddr macro dest,addr,n - - mov dest,offset FLAT:&addr -endm - -ENDIF : ~STD_CALL -ENDIF ; DOS_PLATFORM - -IFDEF STD_CALL -;**************************************************************************** -; -; This section is used exclusively for the standard calling convention. -; -;**************************************************************************** - -PUBLICP macro Func,N - - ifb - public &Func&@0 - else - public &Func&@&N - endif -endm - -EXTRNP macro Func,N - - ifb - extrn &Func&@0:NEAR - else - extrn &Func&@&N:NEAR - endif -endm - -LABELP macro Func,N - - ifb - &Func&@0 LABEL NEAR - else - &Func&@&N LABEL NEAR - endif -endm - -ProcName macro Name,Func,N - - ifb - cByte&Func EQU 0 - &Name EQU <&Func&@0> - else - cByte&Func EQU N - &Name EQU <&Func&@&N> - endif -endm - -cProc macro Func,N,ArgList - - ProcName xxx&Func,Func,N - - xxx&Func proc &ArgList -endm - -cRet macro Func - - ret cByte&Func - -endm - - -endProc macro Func - - xxx&Func endp - -endm - -endMod macro Func - -end xxx&Func - -endm - -ptrCall macro Func,ArgList - Local Bytes - - RevPush ,Bytes - call &Func -endm - -cCall macro Func,ArgList - Local Bytes - - RevPush ,Bytes - Bytes = Bytes*4 - - ComposeInst ,&Func,<@>,%(Bytes) -endm - -MovAddr macro dest,addr,n - - ComposeInst ,dest,<,offset FLAT:>,addr,<@>,n -endm - -ENDIF ;STD_CALL - diff --git a/qt-correction-tool/pub/ddk/stdunk.h b/qt-correction-tool/pub/ddk/stdunk.h deleted file mode 100644 index 12d0099..0000000 --- a/qt-correction-tool/pub/ddk/stdunk.h +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************** - * stdunk.h - standard IUnknown implementaton definitions - ***************************************************************************** - * Copyright (c) Microsoft Corporation. All rights reserved. - */ - -#ifndef _STDUNK_H_ -#define _STDUNK_H_ - -#include "punknown.h" - - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -/***************************************************************************** - * Interfaces - */ - -/***************************************************************************** - * INonDelegatingUnknown - ***************************************************************************** - * Non-delegating unknown interface. - */ -DECLARE_INTERFACE(INonDelegatingUnknown) -{ - STDMETHOD_(NTSTATUS,NonDelegatingQueryInterface) - ( THIS_ - __in REFIID, - __out PVOID * - ) PURE; - - STDMETHOD_(ULONG,NonDelegatingAddRef) - ( THIS - ) PURE; - - STDMETHOD_(ULONG,NonDelegatingRelease) - ( THIS - ) PURE; -}; - -typedef INonDelegatingUnknown *PNONDELEGATINGUNKNOWN; - - - - - -/***************************************************************************** - * Classes - */ - -/***************************************************************************** - * CUnknown - ***************************************************************************** - * Base INonDelegatingUnknown implementation. - */ -class CUnknown : public INonDelegatingUnknown -{ -private: - - LONG m_lRefCount; // Reference count. - PUNKNOWN m_pUnknownOuter; // Outer IUnknown. - -public: - - /************************************************************************* - * CUnknown methods. - */ - CUnknown(PUNKNOWN pUnknownOuter); - virtual ~CUnknown(void); - PUNKNOWN GetOuterUnknown(void) - { - return m_pUnknownOuter; - } - - /************************************************************************* - * INonDelegatingUnknown methods. - */ - STDMETHODIMP_(ULONG) NonDelegatingAddRef - ( void - ); - STDMETHODIMP_(ULONG) NonDelegatingRelease - ( void - ); - STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface - ( - __in REFIID rIID, - __out PVOID * ppVoid - ); -}; - - - - - -/***************************************************************************** - * Macros - */ - -/***************************************************************************** - * DECLARE_STD_UNKNOWN - ***************************************************************************** - * Various declarations for standard objects based on CUnknown. - */ -#define DECLARE_STD_UNKNOWN() \ - STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface \ - ( \ - __in REFIID iid, \ - __out PVOID * ppvObject \ - ); \ - STDMETHODIMP_(NTSTATUS) QueryInterface(REFIID riid, void **ppv) \ - { \ - return GetOuterUnknown()->QueryInterface(riid,ppv); \ - }; \ - STDMETHODIMP_(ULONG) AddRef() \ - { \ - return GetOuterUnknown()->AddRef(); \ - }; \ - STDMETHODIMP_(ULONG) Release() \ - { \ - return GetOuterUnknown()->Release(); \ - }; - -#define DEFINE_STD_CONSTRUCTOR(Class) \ - Class(PUNKNOWN pUnknownOuter) \ - : CUnknown(pUnknownOuter) \ - { \ - } - -#define QICAST(Type) \ - PVOID((Type)(this)) - -#define QICASTUNKNOWN(Type) \ - PVOID(PUNKNOWN((Type)(this))) - -#define STD_CREATE_BODY_WITH_TAG_(Class,ppUnknown,pUnknownOuter,poolType,tag,base) \ - NTSTATUS ntStatus; \ - Class *p = new(poolType,tag) Class(pUnknownOuter); \ - if (p) \ - { \ - *ppUnknown = PUNKNOWN((base)(p)); \ - (*ppUnknown)->AddRef(); \ - ntStatus = STATUS_SUCCESS; \ - } \ - else \ - { \ - ntStatus = STATUS_INSUFFICIENT_RESOURCES; \ - } \ - return ntStatus - -#define STD_CREATE_BODY_WITH_TAG(Class,ppUnknown,pUnknownOuter,poolType,tag) \ - STD_CREATE_BODY_WITH_TAG_(Class,ppUnknown,pUnknownOuter,poolType,tag,PUNKNOWN) - -#define STD_CREATE_BODY_(Class,ppUnknown,pUnknownOuter,poolType,base) \ - STD_CREATE_BODY_WITH_TAG_(Class,ppUnknown,pUnknownOuter,poolType,'rCcP',base) - -#define STD_CREATE_BODY(Class,ppUnknown,pUnknownOuter,poolType) \ - STD_CREATE_BODY_(Class,ppUnknown,pUnknownOuter,poolType,PUNKNOWN) - - - - - - -/***************************************************************************** - * Functions - */ -#ifndef PC_KDEXT // this is not needed for the KD extensions. -#ifndef _NEW_DELETE_OPERATORS_ -#define _NEW_DELETE_OPERATORS_ - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified allocation tag. - */ -inline PVOID operator new -( - size_t iSize, - POOL_TYPE poolType -) -{ - PVOID result = ExAllocatePoolWithTag(poolType,iSize,'wNcP'); - - if (result) - { - RtlZeroMemory(result,iSize); - } - - return result; -} - -/***************************************************************************** - * ::new() - ***************************************************************************** - * New function for creating objects with a specified allocation tag. - */ -inline PVOID operator new -( - size_t iSize, - POOL_TYPE poolType, - ULONG tag -) -{ - PVOID result = ExAllocatePoolWithTag(poolType,iSize,tag); - - if (result) - { - RtlZeroMemory(result,iSize); - } - - return result; -} - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Delete function. - */ -inline void __cdecl operator delete -( - PVOID pVoid -) -{ - if (pVoid) - { - ExFreePool(pVoid); - } -} - -/***************************************************************************** - * ::delete() - ***************************************************************************** - * Delete function. - */ -inline void __cdecl operator delete -( - PVOID pVoid, - ULONG tag -) -{ - if (pVoid) - { - ExFreePoolWithTag(pVoid,tag); - } -} - -#endif //!_NEW_DELETE_OPERATORS_ - -#endif // PC_KDEXT - - -#endif // NTDDI -#endif - diff --git a/qt-correction-tool/pub/ddk/stiusd.h b/qt-correction-tool/pub/ddk/stiusd.h deleted file mode 100644 index f51cee6..0000000 --- a/qt-correction-tool/pub/ddk/stiusd.h +++ /dev/null @@ -1,222 +0,0 @@ -/*++ - -Copyright (c) 1986-1997 Microsoft Corporation - -Module Name: - - stiusd.h - -Abstract: - - Definitions file for creating STI User-mode Still-image Drivers ( USD). - -Author: - - -Revision History: - - ---*/ - -#ifndef _STIUSD_ -#define _STIUSD_ - -// Include COM definitions -#define COM_NO_WINDOWS_H - -// -#pragma intrinsic(memcmp,memset) - -// -// Include COM definitions -// -#ifndef _NO_COM -#include -#endif - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Class IID's - */ - - -/* - * Interface IID's - */ -#if defined( _WIN32 ) && !defined( _NO_COM) - -// {0C9BB460-51AC-11D0-90EA-00AA0060F86C} -DEFINE_GUID(IID_IStiUSD, 0x0C9BB460L, 0x51AC, 0x11D0, 0x90, 0xEA, 0x00, 0xAA, 0x00, 0x60, 0xF8, 0x6C); - -// {128A9860-52DC-11D0-9EDF-444553540000} -DEFINE_GUID(IID_IStiDeviceControl, 0x128A9860L, 0x52DC, 0x11D0, 0x9E, 0xDF, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00); - -#endif - -/* - * Data structures - */ - -typedef struct _STI_USD_CAPS { - - DWORD dwVersion; // STI version used to build this USD - - DWORD dwGenericCaps; - -} STI_USD_CAPS,*PSTI_USD_CAPS; - - -// -// Claims to support device notifications asyncronously ( without polling) -// -#define STI_USD_GENCAP_NATIVE_PUSHSUPPORT STI_GENCAP_NOTIFICATIONS - -// -// Asks to open device automatically ( not implemented now) -// -// #define STI_USD_GENCAP_OPEN_DEVICE_FOR_ME 0x00000002 - -typedef DWORD USD_CONTROL_CODE; - -/* - * Generic constants and definitions - */ - -// -// Internally used flags for open device mode. - -// USD receives this bit only when associated device instance is created by monitor process -// -#define STI_DEVICE_CREATE_FOR_MONITOR 0x01000000 - - -#ifdef __cplusplus - -struct IStiUSD; -struct IStiDeviceControl; - -#endif - -typedef struct IStiUSD *PSTIUSD; -typedef struct IStiDeviceControl *PSTIDEVICECONTROL; - - -/* - * IStiDeviceControl interface - * - * Instance of object supporting this interface is passed to USD at the moment - * of device object initialization. - */ -#undef INTERFACE -#define INTERFACE IStiDeviceControl -DECLARE_INTERFACE_(IStiDeviceControl, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - - /*** IStiDeviceControl methods ***/ - STDMETHOD(Initialize) (THIS_ DWORD dwDeviceType,DWORD dwMode,LPCWSTR pwszPortName,DWORD dwFlags )PURE; - STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawDeviceControl)(THIS_ USD_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ; - STDMETHOD(GetLastError)(THIS_ LPDWORD lpdwLastError) PURE; - STDMETHOD(GetMyDevicePortName)(THIS_ __out_ecount(cwDevicePathSize) LPWSTR lpszDevicePath, DWORD cwDevicePathSize ) PURE; - STDMETHOD(GetMyDeviceHandle)(THIS_ LPHANDLE lph) PURE; - STDMETHOD(GetMyDeviceOpenMode)(THIS_ LPDWORD pdwOpenMode ) PURE; - STDMETHOD(WriteToErrorLog)(THIS_ DWORD dwMessageType,LPCWSTR pszMessage,DWORD dwErrorCode) PURE; -} ; - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IStiDeviceControl_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IStiDeviceControl_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IStiDeviceControl_Release(p) (p)->lpVtbl->Release(p) -#define IStiDeviceControl_Initialize(p,a,b,c,d) (p)->lpVtbl->Initialize(p,a,b,c,d) - -#define IStiDeviceControl_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c) -#define IStiDeviceControl_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c) -#define IStiDeviceControl_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c) -#define IStiDeviceControl_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c) -#define IStiDeviceControl_RawDeviceControl(p,a,b,c,d,e,f) (p)->lpVtbl->RawDeviceControl(p,a,b,c,d,e,f) -#define IStiDeviceControl_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a) -#define IStiDeviceControl_GetMyDevicePortName(p,a,b) (p)->lpVtbl->GetMyDevicePortName(p,a,b) -#define IStiDeviceControl_GetMyDeviceHandle(p,a) (p)->lpVtbl->GetMyDeviceHandle(p,a) -#define IStiDeviceControl_GetMyDeviceOpenMode(p,a) (p)->lpVtbl->GetMyDeviceOpenMode(p,a) -#define IStiDeviceControl_WriteToErrorLog(p,a,b,c) (p)->lpVtbl->WriteToErrorLog(p,a,b,c) - -#endif - -/* - * IStiUSD interface - */ -#undef INTERFACE -#define INTERFACE IStiUSD -DECLARE_INTERFACE_(IStiUSD, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID* ppvObj) PURE; - STDMETHOD_(ULONG, AddRef) (THIS) PURE; - STDMETHOD_(ULONG, Release) (THIS) PURE; - - /*** IStiUSD methods ***/ - STDMETHOD(Initialize) (THIS_ PSTIDEVICECONTROL pHelDcb,DWORD dwStiVersion,HKEY hParametersKey) PURE; - STDMETHOD(GetCapabilities) (THIS_ PSTI_USD_CAPS pDevCaps) PURE; - STDMETHOD(GetStatus) (THIS_ PSTI_DEVICE_STATUS pDevStatus) PURE; - STDMETHOD(DeviceReset)(THIS ) PURE; - STDMETHOD(Diagnostic)(THIS_ LPSTI_DIAG pBuffer) PURE; - STDMETHOD(Escape)(THIS_ STI_RAW_CONTROL_CODE EscapeFunction,LPVOID lpInData,DWORD cbInDataSize,LPVOID pOutData,DWORD dwOutDataSize,LPDWORD pdwActualData) PURE ; - STDMETHOD(GetLastError) (THIS_ LPDWORD pdwLastDeviceError) PURE; - STDMETHOD(LockDevice) (THIS ) PURE; - STDMETHOD(UnLockDevice) (THIS ) PURE; - STDMETHOD(RawReadData)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawWriteData)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawReadCommand)(THIS_ LPVOID lpBuffer,LPDWORD lpdwNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(RawWriteCommand)(THIS_ LPVOID lpBuffer,DWORD nNumberOfBytes,LPOVERLAPPED lpOverlapped) PURE; - STDMETHOD(SetNotificationHandle)(THIS_ HANDLE hEvent) PURE; - STDMETHOD(GetNotificationData)(THIS_ LPSTINOTIFY lpNotify) PURE; - STDMETHOD(GetLastErrorInfo) (THIS_ STI_ERROR_INFO *pLastErrorInfo) PURE; -} ; - -#if !defined(__cplusplus) || defined(CINTERFACE) - -#define IStiUSD_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IStiUSD_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IStiUSD_Release(p) (p)->lpVtbl->Release(p) -#define IStiUSD_Initialize(p,a,b,c) (p)->lpVtbl->Initialize(p,a,b,c) -#define IStiUSD_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IStiUSD_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a) -#define IStiUSD_DeviceReset(p) (p)->lpVtbl->DeviceReset(p) -#define IStiUSD_Diagnostic(p,a) (p)->lpVtbl->Diagnostic(p,a) -#define IStiUSD_Escape(p,a,b,c,d,e,f) (p)->lpVtbl->Escape(p,a,b,c,d,e,f) -#define IStiUSD_GetLastError(p,a) (p)->lpVtbl->GetLastError(p,a) -#define IStiUSD_LockDevice(p) (p)->lpVtbl->LockDevice(p) -#define IStiUSD_UnLockDevice(p) (p)->lpVtbl->UnLockDevice(p) -#define IStiUSD_RawReadData(p,a,b,c) (p)->lpVtbl->RawReadData(p,a,b,c) -#define IStiUSD_RawWriteData(p,a,b,c) (p)->lpVtbl->RawWriteData(p,a,b,c) -#define IStiUSD_RawReadCommand(p,a,b,c) (p)->lpVtbl->RawReadCommand(p,a,b,c) -#define IStiUSD_RawWriteCommand(p,a,b,c) (p)->lpVtbl->RawWriteCommand(p,a,b,c) -#define IStiUSD_SetNotificationHandle(p,a) (p)->lpVtbl->SetNotificationHandle(p,a) -#define IStiUSD_GetNotificationData(p,a) (p)->lpVtbl->GetNotificationData(p,a) -#define IStiUSD_GetLastErrorInfo(p,a) (p)->lpVtbl->GetLastErrorInfo(p,a) - -#endif - -#ifdef __cplusplus -}; -#endif - -#endif // _STIUSD_ - - - - diff --git a/qt-correction-tool/pub/ddk/storduid.h b/qt-correction-tool/pub/ddk/storduid.h deleted file mode 100644 index d774c03..0000000 --- a/qt-correction-tool/pub/ddk/storduid.h +++ /dev/null @@ -1,409 +0,0 @@ -/*++ BUILD Version: 0001 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - storduid.h - -Abstract: - - This is the include file that defines all common constants and types - for accessing storage device unique identification. - -Revision History: - ---*/ - -#ifndef __STORDUID_H__ -#define __STORDUID_H__ - - -// -// Storage device unique identification. -// - -typedef enum _DUID_MATCH_STATUS { - DuidExactMatch = 0, - DuidSubIdMatch, - DuidNoMatch, - DuidErrorGeneral = 100, - DuidErrorMissingDuid, - DuidErrorVersionMismatch, - DuidErrorInvalidDuid, - DuidErrorInvalidDeviceIdDescSize, - DuidErrorInvalidDeviceDescSize, - DuidErrorInvalidLayoutSigSize, - DuidErrorInvalidLayoutSigVersion, - DuidErrorMaximum -} DUID_MATCH_STATUS; - - -// -// Use a version number to help identify the DUID. -// Future versions may not be compatible, and the compare -// routine may need to know the version to accurately -// compare DUIDS. -// - -#define DUID_VERSION_1 1 - -#define DUID_HARDWARE_IDS_ONLY 0 -#define DUID_INCLUDE_SOFTWARE_IDS 1 - -#define DUID_MATCH_ERROR( _duid_status ) ( ( _duid_status ) >= DuidErrorGeneral ? TRUE : FALSE ) -#define DUID_MATCH_SUCCESS( _duid_status ) ( ( _duid_status ) < DuidErrorGeneral ? TRUE : FALSE ) - -typedef struct _STORAGE_DEVICE_UNIQUE_IDENTIFIER { - - // - // DUID version. - // - - ULONG Version; - - // - // Total size of the identifier header including the space - // for all ids. - // - - ULONG Size; - - // - // Byte offset to the STORAGE_DEVICE_ID_DESCRIPTOR. - // - - ULONG StorageDeviceIdOffset; - - // - // Byte offset to the STORAGE_DEVICE_DESCRIPTOR. - // - - ULONG StorageDeviceOffset; - - // - // Byte offset to the STORAGE_DEVICE_LAYOUT_SIGNATURE. - // - // Only included if the first byte of the input STORAGE_PROPERTY_QUERY - // AdditionalParameters is equal to DUID_INCLUDE_SOFTWARE_IDS. - // - - ULONG DriveLayoutSignatureOffset; - -} STORAGE_DEVICE_UNIQUE_IDENTIFIER, *PSTORAGE_DEVICE_UNIQUE_IDENTIFIER; - - -typedef struct _STORAGE_DEVICE_LAYOUT_SIGNATURE { - - // - // DUID version. - // - - ULONG Version; - - // - // Total size of this structure. - // - - ULONG Size; - - // - // Flag indicating whether signature is MBR or GPT format. - // - - BOOLEAN Mbr; - - union { - ULONG MbrSignature; - GUID GptDiskId; - } DeviceSpecific; - -} STORAGE_DEVICE_LAYOUT_SIGNATURE, *PSTORAGE_DEVICE_LAYOUT_SIGNATURE; - -__inline -DUID_MATCH_STATUS -CompareStorageDuids( - __in PSTORAGE_DEVICE_UNIQUE_IDENTIFIER Duid1, - __in PSTORAGE_DEVICE_UNIQUE_IDENTIFIER Duid2 - ); - -__inline -DUID_MATCH_STATUS -CompareStorageDuids( - __in PSTORAGE_DEVICE_UNIQUE_IDENTIFIER Duid1, - __in PSTORAGE_DEVICE_UNIQUE_IDENTIFIER Duid2 - ) -{ - // - // Initial parameter checking. - // - - if ( !Duid1 || !Duid2 ) { - - return DuidErrorMissingDuid; - } - - if ( Duid1->Size < sizeof(STORAGE_DEVICE_UNIQUE_IDENTIFIER) || - Duid2->Size < sizeof(STORAGE_DEVICE_UNIQUE_IDENTIFIER) ) { - - return DuidErrorGeneral; - } - - if ( Duid1->Version != DUID_VERSION_1 || - Duid2->Version != DUID_VERSION_1 ) { - - return DuidErrorVersionMismatch; - } - - // - // Something besides the header must exist. - // - - if ( Duid1->StorageDeviceIdOffset == 0 && - Duid1->StorageDeviceOffset == 0 && - Duid1->DriveLayoutSignatureOffset == 0 ) { - - return DuidErrorInvalidDuid; - } - - if ( Duid2->StorageDeviceIdOffset == 0 && - Duid2->StorageDeviceOffset == 0 && - Duid2->DriveLayoutSignatureOffset == 0 ) { - - return DuidErrorInvalidDuid; - } - - // - // If both DUIDs are the same size and match exactly, we are done. - // - - if ( Duid1->Size == Duid2->Size ) { - - if ( memcmp( Duid1, Duid2, Duid1->Size ) == 0 ) { - - return DuidExactMatch; - } - } - - // - // Check STORAGE_DEVICE_ID_DESCRIPTOR - // - - if ( Duid1->StorageDeviceIdOffset && Duid2->StorageDeviceIdOffset ) { - - PSTORAGE_DEVICE_ID_DESCRIPTOR idDesc1; - PSTORAGE_DEVICE_ID_DESCRIPTOR idDesc2; - - PSTORAGE_IDENTIFIER ident1; - PSTORAGE_IDENTIFIER ident2; - - ULONG idx1; - ULONG idx2; - - idDesc1 = (PSTORAGE_DEVICE_ID_DESCRIPTOR)((PUCHAR)Duid1 + Duid1->StorageDeviceIdOffset); - idDesc2 = (PSTORAGE_DEVICE_ID_DESCRIPTOR)((PUCHAR)Duid2 + Duid2->StorageDeviceIdOffset); - - // - // Insure reasonable size. - // - - if ( idDesc1->Size < sizeof(STORAGE_DEVICE_ID_DESCRIPTOR) || - idDesc2->Size < sizeof(STORAGE_DEVICE_ID_DESCRIPTOR) ) { - - return DuidErrorInvalidDeviceIdDescSize; - } - - // - // If substructures are the same, check for a match. - // - - if ( idDesc1->Size == idDesc2->Size ) { - - if ( memcmp( idDesc1, idDesc2, idDesc1->Size ) == 0 ) { - - return DuidSubIdMatch; - } - } - - // - // Walk through the identifiers and find unique values that match. - // For each unique ID in Duid1, check if it exists in Duid2. If so, - // these are likely the same device. - // - // This search is not optimized. - // - - // - // Loop through identifiers in Duid1. - // - - ident1 = (PSTORAGE_IDENTIFIER)(idDesc1->Identifiers); - - for ( idx1 = 0; idx1 < idDesc1->NumberOfIdentifiers; idx1++ ) { - - // - // Find identifier in Duid1 that is unique. - // - - if ( ( ident1->Type == StorageIdTypeScsiNameString || - ident1->Type == StorageIdTypeFCPHName || - ident1->Type == StorageIdTypeEUI64 || - ident1->Type == StorageIdTypeVendorId ) && - ( ident1->Association == StorageIdAssocPort ) && - ( ident1->CodeSet == StorageIdCodeSetUtf8 || - ident1->CodeSet == StorageIdCodeSetAscii || - ident1->CodeSet == StorageIdCodeSetBinary ) ) { - - // - // Found a unique ID in Duid1. Look for the same identifier in - // Duid2. - // - - ident2 = (PSTORAGE_IDENTIFIER)(idDesc2->Identifiers); - - for ( idx2 = 0; idx2 < idDesc2->NumberOfIdentifiers; idx2++ ) { - - if ( ident1->Type == ident2->Type && - ident1->Association == ident2->Association && - ident1->CodeSet == ident2->CodeSet && - ident1->IdentifierSize == ident2->IdentifierSize && - ( memcmp( ident1->Identifier, - ident2->Identifier, - ident1->IdentifierSize ) == 0 ) ) { - - return DuidSubIdMatch; - } - - ident2 = (PSTORAGE_IDENTIFIER)((PUCHAR)ident2 + ident2->NextOffset); - } - } - - ident1 = (PSTORAGE_IDENTIFIER)((PUCHAR)ident1 + ident1->NextOffset); - } - - } - - // - // Check STORAGE_DEVICE_DESCRIPTOR - // - - if ( Duid1->StorageDeviceOffset && Duid2->StorageDeviceOffset ) { - - PSTORAGE_DEVICE_DESCRIPTOR desc1; - PSTORAGE_DEVICE_DESCRIPTOR desc2; - - desc1 = (PSTORAGE_DEVICE_DESCRIPTOR)((PUCHAR)Duid1 + Duid1->StorageDeviceOffset); - desc2 = (PSTORAGE_DEVICE_DESCRIPTOR)((PUCHAR)Duid2 + Duid2->StorageDeviceOffset); - - // - // Insure reasonable size. - // - - if ( desc1->Size < sizeof(STORAGE_DEVICE_DESCRIPTOR) || - desc2->Size < sizeof(STORAGE_DEVICE_DESCRIPTOR) ) { - - return DuidErrorInvalidDeviceDescSize; - } - - // - // If substructures are the same, check for a match. - // - - if ( desc1->Size == desc2->Size ) { - - if ( memcmp( desc1, desc2, desc1->Size ) == 0 ) { - - return DuidSubIdMatch; - } - } - - // - // Have to have SerialNumber. If SerialNumbers match, then - // VendorId and ProductId must match (if they exist). - // - - if ( desc1->SerialNumberOffset && - desc2->SerialNumberOffset ) { - - const char * string1; - const char * string2; - - // - // All strings are supposed to be NULL terminated. - // - - string1 = (const char *)((PUCHAR)desc1 + desc1->SerialNumberOffset); - string2 = (const char *)((PUCHAR)desc2 + desc2->SerialNumberOffset); - - if ( strcmp( string1, string2 ) == 0 ) { - - if ( desc1->VendorIdOffset && - desc2->VendorIdOffset ) { - - string1 = (const char *)((PUCHAR)desc1 + desc1->VendorIdOffset); - string2 = (const char *)((PUCHAR)desc2 + desc2->VendorIdOffset); - - if ( strcmp( string1, string2 ) != 0 ) { - - return DuidNoMatch; - } - } - - if ( desc1->ProductIdOffset && - desc2->ProductIdOffset ) { - - string1 = (const char *)((PUCHAR)desc1 + desc1->ProductIdOffset); - string2 = (const char *)((PUCHAR)desc2 + desc2->ProductIdOffset); - - if ( strcmp( string1, string2 ) != 0 ) { - - return DuidNoMatch; - } - } - - return DuidSubIdMatch; - } - } - } - - // - // Check STORAGE_DEVICE_LAYOUT_SIGNATURE - // - - if ( Duid1->DriveLayoutSignatureOffset && Duid2->DriveLayoutSignatureOffset ) { - - PSTORAGE_DEVICE_LAYOUT_SIGNATURE sig1; - PSTORAGE_DEVICE_LAYOUT_SIGNATURE sig2; - - sig1 = (PSTORAGE_DEVICE_LAYOUT_SIGNATURE)((PUCHAR)Duid1 + Duid1->DriveLayoutSignatureOffset); - sig2 = (PSTORAGE_DEVICE_LAYOUT_SIGNATURE)((PUCHAR)Duid2 + Duid2->DriveLayoutSignatureOffset); - - if ( sig1->Version != DUID_VERSION_1 && - sig2->Version != DUID_VERSION_1 ) { - - return DuidErrorInvalidLayoutSigVersion; - } - - if ( sig1->Size < sizeof(STORAGE_DEVICE_LAYOUT_SIGNATURE) || - sig2->Size < sizeof(STORAGE_DEVICE_LAYOUT_SIGNATURE) ) { - - return DuidErrorInvalidLayoutSigSize; - } - - if ( memcmp( sig1, sig2, sizeof(STORAGE_DEVICE_LAYOUT_SIGNATURE) ) == 0 ) { - - return DuidSubIdMatch; - } - } - - // - // If we get here, we found no unique IDs that match. - // - - return DuidNoMatch; -} - - -#endif // __STORDUID_H__ - - diff --git a/qt-correction-tool/pub/ddk/storport.h b/qt-correction-tool/pub/ddk/storport.h deleted file mode 100644 index 5f83e68..0000000 --- a/qt-correction-tool/pub/ddk/storport.h +++ /dev/null @@ -1,6540 +0,0 @@ - -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - storport.h - -Abstract: - - These are the structures and defines that are included by STORPORT miniport - drivers. - -Authors: - -Revision History: - ---*/ - -#ifdef _NTSCSI_ -#error "STORPORT.H must be included instead of SCSI.H" -#endif - -#ifdef _NTSRB_ -#error "STORPORT.H must be included instead of SRB.H" -#endif - -#ifndef _NTSTORPORT_ -#define _NTSTORPORT_ - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4200) // array[0] is not a warning for this file -#pragma warning(disable:4201) // nonstandard extension used : nameless struct/union -#pragma warning(disable:4214) // nonstandard extension used : bit field types other than int - -#if DBG -#define DebugPrint(x) StorPortDebugPrint x -#else -#define DebugPrint(x) -#endif - - -// -// Define SCSI maximum configuration parameters. -// - -#define SCSI_MAXIMUM_LOGICAL_UNITS 8 -#define SCSI_MAXIMUM_TARGETS_PER_BUS 128 -#define SCSI_MAXIMUM_LUNS_PER_TARGET 255 -#define SCSI_MAXIMUM_BUSES 8 -#define SCSI_MINIMUM_PHYSICAL_BREAKS 16 -#define SCSI_MAXIMUM_PHYSICAL_BREAKS 255 - -#define SCSI_COMBINE_BUS_TARGET( Bus, Target ) ( \ - ((((UCHAR) (Target)) & ~(0x20 - 1)) << 8) | \ - (((UCHAR) (Bus)) << 5) | \ - (((UCHAR) (Target)) & (0x20 - 1))) - -#define SCSI_DECODE_BUS_TARGET( Value, Bus, Target ) ( \ - Bus = (UCHAR) ((Value) >> 5), \ - Target = (UCHAR) ((((Value) >> 8) & ~(0x20 - 1)) | ((Value) & (0x20 - 1)))) - -// -// This constant is for backward compatibility. -// This use to be the maximum number of targets supported. -// - -#define SCSI_MAXIMUM_TARGETS 8 - - -// -// Uninitialized flag value. -// - -#define SP_UNINITIALIZED_VALUE ((ULONG) ~0) -#define SP_UNTAGGED ((UCHAR) ~0) - -// -// Set asynchronous events. -// - -#define SRBEV_BUS_RESET 0x0001 -#define SRBEV_SCSI_ASYNC_NOTIFICATION 0x0002 - -// begin_ntminitape - -#define MAXIMUM_CDB_SIZE 12 - -// -// SCSI I/O Request Block -// - -typedef struct _SCSI_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR ScsiStatus; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - UCHAR QueueTag; // offset 8 - UCHAR QueueAction; // offset 9 - UCHAR CdbLength; // offset a - UCHAR SenseInfoBufferLength; // offset b - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - __field_bcount(DataTransferLength) \ - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - union { - ULONG InternalStatus; // offset 2c - ULONG QueueSortKey; // offset 2c - ULONG LinkTimeoutValue; // offset 2c - }; - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Cdb[16]; // offset 30 -} SCSI_REQUEST_BLOCK, *PSCSI_REQUEST_BLOCK; - -#define SCSI_REQUEST_BLOCK_SIZE sizeof(SCSI_REQUEST_BLOCK) - -// -// SCSI I/O Request Block for WMI Requests -// - -typedef struct _SCSI_WMI_REQUEST_BLOCK { - USHORT Length; - UCHAR Function; // SRB_FUNCTION_WMI - UCHAR SrbStatus; - UCHAR WMISubFunction; - UCHAR PathId; // If SRB_WMI_FLAGS_ADAPTER_REQUEST is set in - UCHAR TargetId; // WMIFlags then PathId, TargetId and Lun are - UCHAR Lun; // reserved fields. - UCHAR Reserved1; - UCHAR WMIFlags; - UCHAR Reserved2[2]; - ULONG SrbFlags; - ULONG DataTransferLength; - ULONG TimeOutValue; - PVOID DataBuffer; - PVOID DataPath; - PVOID Reserved3; - PVOID OriginalRequest; - PVOID SrbExtension; - ULONG Reserved4; - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved6; - -#endif -#endif - - UCHAR Reserved5[16]; -} SCSI_WMI_REQUEST_BLOCK, *PSCSI_WMI_REQUEST_BLOCK; - -typedef enum _STOR_DEVICE_POWER_STATE { - StorPowerDeviceUnspecified = 0, - StorPowerDeviceD0, - StorPowerDeviceD1, - StorPowerDeviceD2, - StorPowerDeviceD3, - StorPowerDeviceMaximum -} STOR_DEVICE_POWER_STATE, *PSTOR_DEVICE_POWER_STATE; - -typedef enum { - StorPowerActionNone = 0, - StorPowerActionReserved, - StorPowerActionSleep, - StorPowerActionHibernate, - StorPowerActionShutdown, - StorPowerActionShutdownReset, - StorPowerActionShutdownOff, - StorPowerActionWarmEject -} STOR_POWER_ACTION, *PSTOR_POWER_ACTION; - -typedef struct _SCSI_POWER_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR SrbPowerFlags; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_DEVICE_POWER_STATE DevicePowerState; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - STOR_POWER_ACTION PowerAction; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - - UCHAR Reserved5[16]; // offset 30 -} SCSI_POWER_REQUEST_BLOCK, *PSCSI_POWER_REQUEST_BLOCK; - -// -// PNP minor function codes. -// -typedef enum { - StorStartDevice = 0x0, - StorRemoveDevice = 0x2, - StorStopDevice = 0x4, - StorQueryCapabilities = 0x9, - StorQueryResourceRequirements = 0xB, - StorFilterResourceRequirements = 0xD, - StorSurpriseRemoval = 0x17 -} STOR_PNP_ACTION, *PSTOR_PNP_ACTION; - -typedef struct _STOR_DEVICE_CAPABILITIES { - USHORT Version; - ULONG DeviceD1:1; - ULONG DeviceD2:1; - ULONG LockSupported:1; - ULONG EjectSupported:1; - ULONG Removable:1; - ULONG DockDevice:1; - ULONG UniqueID:1; - ULONG SilentInstall:1; - ULONG SurpriseRemovalOK:1; - ULONG NoDisplayInUI:1; - -} STOR_DEVICE_CAPABILITIES, *PSTOR_DEVICE_CAPABILITIES; - -typedef struct _SCSI_PNP_REQUEST_BLOCK { - USHORT Length; // offset 0 - UCHAR Function; // offset 2 - UCHAR SrbStatus; // offset 3 - UCHAR PnPSubFunction; // offset 4 - UCHAR PathId; // offset 5 - UCHAR TargetId; // offset 6 - UCHAR Lun; // offset 7 - STOR_PNP_ACTION PnPAction; // offset 8 - ULONG SrbFlags; // offset c - ULONG DataTransferLength; // offset 10 - ULONG TimeOutValue; // offset 14 - PVOID DataBuffer; // offset 18 - PVOID SenseInfoBuffer; // offset 1c - struct _SCSI_REQUEST_BLOCK *NextSrb; // offset 20 - PVOID OriginalRequest; // offset 24 - PVOID SrbExtension; // offset 28 - ULONG SrbPnPFlags; // offset 2c - -#if defined(_WIN64) - - // - // Force PVOID alignment of Cdb - // - - ULONG Reserved; - -#endif - UCHAR Reserved4[16]; // offset 30 -} SCSI_PNP_REQUEST_BLOCK, *PSCSI_PNP_REQUEST_BLOCK; - - -// -// SRB Functions -// - -#define SRB_FUNCTION_EXECUTE_SCSI 0x00 -#define SRB_FUNCTION_CLAIM_DEVICE 0x01 -#define SRB_FUNCTION_IO_CONTROL 0x02 -#define SRB_FUNCTION_RECEIVE_EVENT 0x03 -#define SRB_FUNCTION_RELEASE_QUEUE 0x04 -#define SRB_FUNCTION_ATTACH_DEVICE 0x05 -#define SRB_FUNCTION_RELEASE_DEVICE 0x06 -#define SRB_FUNCTION_SHUTDOWN 0x07 -#define SRB_FUNCTION_FLUSH 0x08 -#define SRB_FUNCTION_ABORT_COMMAND 0x10 -#define SRB_FUNCTION_RELEASE_RECOVERY 0x11 -#define SRB_FUNCTION_RESET_BUS 0x12 -#define SRB_FUNCTION_RESET_DEVICE 0x13 -#define SRB_FUNCTION_TERMINATE_IO 0x14 -#define SRB_FUNCTION_FLUSH_QUEUE 0x15 -#define SRB_FUNCTION_REMOVE_DEVICE 0x16 -#define SRB_FUNCTION_WMI 0x17 -#define SRB_FUNCTION_LOCK_QUEUE 0x18 -#define SRB_FUNCTION_UNLOCK_QUEUE 0x19 -#define SRB_FUNCTION_RESET_LOGICAL_UNIT 0x20 -#define SRB_FUNCTION_SET_LINK_TIMEOUT 0x21 -#define SRB_FUNCTION_LINK_TIMEOUT_OCCURRED 0x22 -#define SRB_FUNCTION_LINK_TIMEOUT_COMPLETE 0x23 -#define SRB_FUNCTION_POWER 0x24 -#define SRB_FUNCTION_PNP 0x25 -#define SRB_FUNCTION_DUMP_POINTERS 0x26 -// -// SRB Status -// - -#define SRB_STATUS_PENDING 0x00 -#define SRB_STATUS_SUCCESS 0x01 -#define SRB_STATUS_ABORTED 0x02 -#define SRB_STATUS_ABORT_FAILED 0x03 -#define SRB_STATUS_ERROR 0x04 -#define SRB_STATUS_BUSY 0x05 -#define SRB_STATUS_INVALID_REQUEST 0x06 -#define SRB_STATUS_INVALID_PATH_ID 0x07 -#define SRB_STATUS_NO_DEVICE 0x08 -#define SRB_STATUS_TIMEOUT 0x09 -#define SRB_STATUS_SELECTION_TIMEOUT 0x0A -#define SRB_STATUS_COMMAND_TIMEOUT 0x0B -#define SRB_STATUS_MESSAGE_REJECTED 0x0D -#define SRB_STATUS_BUS_RESET 0x0E -#define SRB_STATUS_PARITY_ERROR 0x0F -#define SRB_STATUS_REQUEST_SENSE_FAILED 0x10 -#define SRB_STATUS_NO_HBA 0x11 -#define SRB_STATUS_DATA_OVERRUN 0x12 -#define SRB_STATUS_UNEXPECTED_BUS_FREE 0x13 -#define SRB_STATUS_PHASE_SEQUENCE_FAILURE 0x14 -#define SRB_STATUS_BAD_SRB_BLOCK_LENGTH 0x15 -#define SRB_STATUS_REQUEST_FLUSHED 0x16 -#define SRB_STATUS_INVALID_LUN 0x20 -#define SRB_STATUS_INVALID_TARGET_ID 0x21 -#define SRB_STATUS_BAD_FUNCTION 0x22 -#define SRB_STATUS_ERROR_RECOVERY 0x23 -#define SRB_STATUS_NOT_POWERED 0x24 -#define SRB_STATUS_LINK_DOWN 0x25 - -// -// This value is used by the port driver to indicate that a non-scsi-related -// error occured. Miniports must never return this status. -// - -#define SRB_STATUS_INTERNAL_ERROR 0x30 - -// -// Srb status values 0x38 through 0x3f are reserved for internal port driver -// use. -// - - - -// -// SRB Status Masks -// - -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - -#define SRB_STATUS(Status) (Status & ~(SRB_STATUS_AUTOSENSE_VALID | SRB_STATUS_QUEUE_FROZEN)) - -// -// SRB Flag Bits -// - -#define SRB_FLAGS_QUEUE_ACTION_ENABLE 0x00000002 -#define SRB_FLAGS_DISABLE_DISCONNECT 0x00000004 -#define SRB_FLAGS_DISABLE_SYNCH_TRANSFER 0x00000008 - -#define SRB_FLAGS_BYPASS_FROZEN_QUEUE 0x00000010 -#define SRB_FLAGS_DISABLE_AUTOSENSE 0x00000020 -#define SRB_FLAGS_DATA_IN 0x00000040 -#define SRB_FLAGS_DATA_OUT 0x00000080 -#define SRB_FLAGS_NO_DATA_TRANSFER 0x00000000 -#define SRB_FLAGS_UNSPECIFIED_DIRECTION (SRB_FLAGS_DATA_IN | SRB_FLAGS_DATA_OUT) - -#define SRB_FLAGS_NO_QUEUE_FREEZE 0x00000100 -#define SRB_FLAGS_ADAPTER_CACHE_ENABLE 0x00000200 -#define SRB_FLAGS_FREE_SENSE_BUFFER 0x00000400 - -#define SRB_FLAGS_IS_ACTIVE 0x00010000 -#define SRB_FLAGS_ALLOCATED_FROM_ZONE 0x00020000 -#define SRB_FLAGS_SGLIST_FROM_POOL 0x00040000 -#define SRB_FLAGS_BYPASS_LOCKED_QUEUE 0x00080000 - -#define SRB_FLAGS_NO_KEEP_AWAKE 0x00100000 -#define SRB_FLAGS_PORT_DRIVER_ALLOCSENSE 0x00200000 - -#define SRB_FLAGS_PORT_DRIVER_SENSEHASPORT 0x00400000 -#define SRB_FLAGS_DONT_START_NEXT_PACKET 0x00800000 - -#define SRB_FLAGS_PORT_DRIVER_RESERVED 0x0F000000 -#define SRB_FLAGS_CLASS_DRIVER_RESERVED 0xF0000000 - -#if DBG==1 -// -// A signature used to validate the scsi port number -// at the end of a sense buffer. -// -#define SCSI_PORT_SIGNATURE 0x54524f50 -#endif - -// -// Queue Action -// - -#define SRB_SIMPLE_TAG_REQUEST 0x20 -#define SRB_HEAD_OF_QUEUE_TAG_REQUEST 0x21 -#define SRB_ORDERED_QUEUE_TAG_REQUEST 0x22 - -#define SRB_WMI_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_POWER_FLAGS_ADAPTER_REQUEST 0x01 -#define SRB_PNP_FLAGS_ADAPTER_REQUEST 0x01 - -// end_ntminitape - - -// -// Command Descriptor Block. Passed by SCSI controller chip over the SCSI bus -// - -#pragma pack(push, cdb, 1) -typedef union _CDB { - - // - // Generic 6-Byte CDB - // - - struct _CDB6GENERIC { - UCHAR OperationCode; - UCHAR Immediate : 1; - UCHAR CommandUniqueBits : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR CommandUniqueBytes[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } CDB6GENERIC; - - // - // Standard 6-byte CDB - // - - struct _CDB6READWRITE { - UCHAR OperationCode; // 0x08, 0x0A - SCSIOP_READ, SCSIOP_WRITE - UCHAR LogicalBlockMsb1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockMsb0; - UCHAR LogicalBlockLsb; - UCHAR TransferBlocks; - UCHAR Control; - } CDB6READWRITE; - - // - // SCSI-1 Inquiry CDB - // - - struct _CDB6INQUIRY { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode; - UCHAR IReserved; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY; - - // - // SCSI-3 Inquiry CDB - // - - struct _CDB6INQUIRY3 { - UCHAR OperationCode; // 0x12 - SCSIOP_INQUIRY - UCHAR EnableVitalProductData : 1; - UCHAR CommandSupportData : 1; - UCHAR Reserved1 : 6; - UCHAR PageCode; - UCHAR Reserved2; - UCHAR AllocationLength; - UCHAR Control; - } CDB6INQUIRY3; - - struct _CDB6VERIFY { - UCHAR OperationCode; // 0x13 - SCSIOP_VERIFY - UCHAR Fixed : 1; - UCHAR ByteCompare : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR VerificationLength[3]; - UCHAR Control; - } CDB6VERIFY; - - // - // SCSI Format CDB - // - - struct _CDB6FORMAT { - UCHAR OperationCode; // 0x04 - SCSIOP_FORMAT_UNIT - UCHAR FormatControl : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR FReserved1; - UCHAR InterleaveMsb; - UCHAR InterleaveLsb; - UCHAR FReserved2; - } CDB6FORMAT; - - // - // Standard 10-byte CDB - - struct _CDB10 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved2; - UCHAR TransferBlocksMsb; - UCHAR TransferBlocksLsb; - UCHAR Control; - } CDB10; - - // - // Standard 12-byte CDB - // - - struct _CDB12 { - UCHAR OperationCode; - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB12; - - - - // - // Standard 16-byte CDB - // - - struct _CDB16 { - UCHAR OperationCode; - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR Protection : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2; - UCHAR Control; - } CDB16; - - - // - // CD Rom Audio CDBs - // - - struct _PAUSE_RESUME { - UCHAR OperationCode; // 0x4B - SCSIOP_PAUSE_RESUME - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[6]; - UCHAR Action; - UCHAR Control; - } PAUSE_RESUME; - - // - // Read Table of Contents - // - - struct _READ_TOC { - UCHAR OperationCode; // 0x43 - SCSIOP_READ_TOC - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Format2 : 4; - UCHAR Reserved2 : 4; - UCHAR Reserved3[3]; - UCHAR StartingTrack; - UCHAR AllocationLength[2]; - UCHAR Control : 6; - UCHAR Format : 2; - } READ_TOC; - - struct _READ_DISK_INFORMATION { - UCHAR OperationCode; // 0x51 - SCSIOP_READ_DISC_INFORMATION - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_DISK_INFORMATION, READ_DISC_INFORMATION; - - struct _READ_TRACK_INFORMATION { - UCHAR OperationCode; // 0x52 - SCSIOP_READ_TRACK_INFORMATION - UCHAR Track : 2; - UCHAR Reserved4 : 3; - UCHAR Lun : 3; - UCHAR BlockAddress[4]; // or Track Number - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_TRACK_INFORMATION; - - struct _RESERVE_TRACK_RZONE { - UCHAR OperationCode; // 0x53 - SCSIOP_RESERVE_TRACK_RZONE - UCHAR Reserved1[4]; - UCHAR ReservationSize[4]; - UCHAR Control; - } RESERVE_TRACK_RZONE; - - struct _SEND_OPC_INFORMATION { - UCHAR OperationCode; // 0x54 - SCSIOP_SEND_OPC_INFORMATION - UCHAR DoOpc : 1; // perform OPC - UCHAR Reserved1 : 7; - UCHAR Exclude0 : 1; // exclude layer 0 - UCHAR Exclude1 : 1; // exclude layer 1 - UCHAR Reserved2 : 6; - UCHAR Reserved3[4]; - UCHAR ParameterListLength[2]; - UCHAR Reserved4; - } SEND_OPC_INFORMATION; - - struct _REPAIR_TRACK { - UCHAR OperationCode; // 0x58 - SCSIOP_REPAIR_TRACK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[2]; - UCHAR TrackNumber[2]; - UCHAR Reserved3[3]; - UCHAR Control; - } REPAIR_TRACK; - - struct _CLOSE_TRACK { - UCHAR OperationCode; // 0x5B - SCSIOP_CLOSE_TRACK_SESSION - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR Track : 1; - UCHAR Session : 1; - UCHAR Reserved2 : 6; - UCHAR Reserved3; - UCHAR TrackNumber[2]; - UCHAR Reserved4[3]; - UCHAR Control; - } CLOSE_TRACK; - - struct _READ_BUFFER_CAPACITY { - UCHAR OperationCode; // 0x5C - SCSIOP_READ_BUFFER_CAPACITY - UCHAR BlockInfo : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_BUFFER_CAPACITY; - - struct _SEND_CUE_SHEET { - UCHAR OperationCode; // 0x5D - SCSIOP_SEND_CUE_SHEET - UCHAR Reserved[5]; - UCHAR CueSheetSize[3]; - UCHAR Control; - } SEND_CUE_SHEET; - - struct _READ_HEADER { - UCHAR OperationCode; // 0x44 - SCSIOP_READ_HEADER - UCHAR Reserved1 : 1; - UCHAR Msf : 1; - UCHAR Reserved2 : 3; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved3; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_HEADER; - - struct _PLAY_AUDIO { - UCHAR OperationCode; // 0x45 - SCSIOP_PLAY_AUDIO - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingBlockAddress[4]; - UCHAR Reserved2; - UCHAR PlayLength[2]; - UCHAR Control; - } PLAY_AUDIO; - - struct _PLAY_AUDIO_MSF { - UCHAR OperationCode; // 0x47 - SCSIOP_PLAY_AUDIO_MSF - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Control; - } PLAY_AUDIO_MSF; - - struct _BLANK_MEDIA { - UCHAR OperationCode; // 0xA1 - SCSIOP_BLANK - UCHAR BlankType : 3; - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 3; - UCHAR AddressOrTrack[4]; - UCHAR Reserved3[5]; - UCHAR Control; - } BLANK_MEDIA; - - struct _PLAY_CD { - UCHAR OperationCode; // 0xBC - SCSIOP_PLAY_CD - UCHAR Reserved1 : 1; - UCHAR CMSF : 1; // LBA = 0, MSF = 1 - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - - union { - struct _LBA { - UCHAR StartingBlockAddress[4]; - UCHAR PlayLength[4]; - } LBA; - - struct _MSF { - UCHAR Reserved1; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved2; - } MSF; - }; - - UCHAR Audio : 1; - UCHAR Composite : 1; - UCHAR Port1 : 1; - UCHAR Port2 : 1; - UCHAR Reserved2 : 3; - UCHAR Speed : 1; - UCHAR Control; - } PLAY_CD; - - struct _SCAN_CD { - UCHAR OperationCode; // 0xBA - SCSIOP_SCAN_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 3; - UCHAR Direct : 1; - UCHAR Lun : 3; - UCHAR StartingAddress[4]; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 6; - UCHAR Type : 2; - UCHAR Reserved4; - UCHAR Control; - } SCAN_CD; - - struct _STOP_PLAY_SCAN { - UCHAR OperationCode; // 0x4E - SCSIOP_STOP_PLAY_SCAN - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[7]; - UCHAR Control; - } STOP_PLAY_SCAN; - - - // - // Read SubChannel Data - // - - struct _SUBCHANNEL { - UCHAR OperationCode; // 0x42 - SCSIOP_READ_SUB_CHANNEL - UCHAR Reserved0 : 1; - UCHAR Msf : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2 : 6; - UCHAR SubQ : 1; - UCHAR Reserved3 : 1; - UCHAR Format; - UCHAR Reserved4[2]; - UCHAR TrackNumber; - UCHAR AllocationLength[2]; - UCHAR Control; - } SUBCHANNEL; - - // - // Read CD. Used by Atapi for raw sector reads. - // - - struct _READ_CD { - UCHAR OperationCode; // 0xBE - SCSIOP_READ_CD - UCHAR RelativeAddress : 1; - UCHAR Reserved0 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR StartingLBA[4]; - UCHAR TransferBlocks[3]; - UCHAR Reserved2 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved3 : 5; - UCHAR Control; - } READ_CD; - - struct _READ_CD_MSF { - UCHAR OperationCode; // 0xB9 - SCSIOP_READ_CD_MSF - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR ExpectedSectorType : 3; - UCHAR Lun : 3; - UCHAR Reserved2; - UCHAR StartingM; - UCHAR StartingS; - UCHAR StartingF; - UCHAR EndingM; - UCHAR EndingS; - UCHAR EndingF; - UCHAR Reserved4 : 1; - UCHAR ErrorFlags : 2; - UCHAR IncludeEDC : 1; - UCHAR IncludeUserData : 1; - UCHAR HeaderCode : 2; - UCHAR IncludeSyncData : 1; - UCHAR SubChannelSelection : 3; - UCHAR Reserved5 : 5; - UCHAR Control; - } READ_CD_MSF; - - // - // Plextor Read CD-DA - // - - struct _PLXTR_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0 : 5; - UCHAR LogicalUnitNumber :3; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR TransferBlockByte2; - UCHAR TransferBlockByte3; - UCHAR SubCode; - UCHAR Control; - } PLXTR_READ_CDDA; - - // - // NEC Read CD-DA - // - - struct _NEC_READ_CDDA { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Reserved0; - UCHAR LogicalBlockByte0; - UCHAR LogicalBlockByte1; - UCHAR LogicalBlockByte2; - UCHAR LogicalBlockByte3; - UCHAR Reserved1; - UCHAR TransferBlockByte0; - UCHAR TransferBlockByte1; - UCHAR Control; - } NEC_READ_CDDA; - - // - // Mode sense - // - - struct _MODE_SENSE { - UCHAR OperationCode; // 0x1A - SCSIOP_MODE_SENSE - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3; - UCHAR AllocationLength; - UCHAR Control; - } MODE_SENSE; - - struct _MODE_SENSE10 { - UCHAR OperationCode; // 0x5A - SCSIOP_MODE_SENSE10 - UCHAR Reserved1 : 3; - UCHAR Dbd : 1; - UCHAR Reserved2 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR Pc : 2; - UCHAR Reserved3[4]; - UCHAR AllocationLength[2]; - UCHAR Control; - } MODE_SENSE10; - - // - // Mode select - // - - struct _MODE_SELECT { - UCHAR OperationCode; // 0x15 - SCSIOP_MODE_SELECT - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR ParameterListLength; - UCHAR Control; - } MODE_SELECT; - - struct _MODE_SELECT10 { - UCHAR OperationCode; // 0x55 - SCSIOP_MODE_SELECT10 - UCHAR SPBit : 1; - UCHAR Reserved1 : 3; - UCHAR PFBit : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[5]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } MODE_SELECT10; - - struct _LOCATE { - UCHAR OperationCode; // 0x2B - SCSIOP_LOCATE - UCHAR Immediate : 1; - UCHAR CPBit : 1; - UCHAR BTBit : 1; - UCHAR Reserved1 : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved4; - UCHAR Partition; - UCHAR Control; - } LOCATE; - - struct _LOGSENSE { - UCHAR OperationCode; // 0x4D - SCSIOP_LOG_SENSE - UCHAR SPBit : 1; - UCHAR PPCBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR PageCode : 6; - UCHAR PCBit : 2; - UCHAR Reserved2; - UCHAR Reserved3; - UCHAR ParameterPointer[2]; - UCHAR AllocationLength[2]; - UCHAR Control; - } LOGSENSE; - - struct _LOGSELECT { - UCHAR OperationCode; // 0x4C - SCSIOP_LOG_SELECT - UCHAR SPBit : 1; - UCHAR PCRBit : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved : 6; - UCHAR PCBit : 2; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } LOGSELECT; - - struct _PRINT { - UCHAR OperationCode; // 0x0A - SCSIOP_PRINT - UCHAR Reserved : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } PRINT; - - struct _SEEK { - UCHAR OperationCode; // 0x2B - SCSIOP_SEEK - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlockAddress[4]; - UCHAR Reserved2[3]; - UCHAR Control; - } SEEK; - - struct _ERASE { - UCHAR OperationCode; // 0x19 - SCSIOP_ERASE - UCHAR Long : 1; - UCHAR Immediate : 1; - UCHAR Reserved1 : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[3]; - UCHAR Control; - } ERASE; - - struct _START_STOP { - UCHAR OperationCode; // 0x1B - SCSIOP_START_STOP_UNIT - UCHAR Immediate: 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } START_STOP; - - struct _MEDIA_REMOVAL { - UCHAR OperationCode; // 0x1E - SCSIOP_MEDIUM_REMOVAL - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR Reserved2[2]; - - UCHAR Prevent : 1; - UCHAR Persistant : 1; - UCHAR Reserved3 : 6; - - UCHAR Control; - } MEDIA_REMOVAL; - - // - // Tape CDBs - // - - struct _SEEK_BLOCK { - UCHAR OperationCode; // 0x0C - SCSIOP_SEEK_BLOCK - UCHAR Immediate : 1; - UCHAR Reserved1 : 7; - UCHAR BlockAddress[3]; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } SEEK_BLOCK; - - struct _REQUEST_BLOCK_ADDRESS { - UCHAR OperationCode; // 0x02 - SCSIOP_REQUEST_BLOCK_ADDR - UCHAR Reserved1[3]; - UCHAR AllocationLength; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved2 : 4; - UCHAR VendorUnique : 2; - } REQUEST_BLOCK_ADDRESS; - - struct _PARTITION { - UCHAR OperationCode; // 0x0D - SCSIOP_PARTITION - UCHAR Immediate : 1; - UCHAR Sel: 1; - UCHAR PartitionSelect : 6; - UCHAR Reserved1[3]; - UCHAR Control; - } PARTITION; - - struct _WRITE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Immediate : 1; - UCHAR WriteSetMarks: 1; - UCHAR Reserved : 3; - UCHAR LogicalUnitNumber : 3; - UCHAR TransferLength[3]; - UCHAR Control; - } WRITE_TAPE_MARKS; - - struct _SPACE_TAPE_MARKS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR Code : 3; - UCHAR Reserved : 2; - UCHAR LogicalUnitNumber : 3; - UCHAR NumMarksMSB ; - UCHAR NumMarks; - UCHAR NumMarksLSB; - union { - UCHAR value; - struct { - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved : 4; - UCHAR VendorUnique : 2; - } Fields; - } Byte6; - } SPACE_TAPE_MARKS; - - // - // Read tape position - // - - struct _READ_POSITION { - UCHAR Operation; // 0x43 - SCSIOP_READ_POSITION - UCHAR BlockType:1; - UCHAR Reserved1:4; - UCHAR Lun:3; - UCHAR Reserved2[7]; - UCHAR Control; - } READ_POSITION; - - // - // ReadWrite for Tape - // - - struct _CDB6READWRITETAPE { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR VendorSpecific : 5; - UCHAR Reserved : 3; - UCHAR TransferLenMSB; - UCHAR TransferLen; - UCHAR TransferLenLSB; - UCHAR Link : 1; - UCHAR Flag : 1; - UCHAR Reserved1 : 4; - UCHAR VendorUnique : 2; - } CDB6READWRITETAPE; - - // - // Medium changer CDB's - // - - struct _INIT_ELEMENT_STATUS { - UCHAR OperationCode; // 0x07 - SCSIOP_INIT_ELEMENT_STATUS - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNubmer : 3; - UCHAR Reserved2[3]; - UCHAR Reserved3 : 7; - UCHAR NoBarCode : 1; - } INIT_ELEMENT_STATUS; - - struct _INITIALIZE_ELEMENT_RANGE { - UCHAR OperationCode; // 0xE7 - SCSIOP_INIT_ELEMENT_RANGE - UCHAR Range : 1; - UCHAR Reserved1 : 4; - UCHAR LogicalUnitNubmer : 3; - UCHAR FirstElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved3; - UCHAR Reserved4 : 7; - UCHAR NoBarCode : 1; - } INITIALIZE_ELEMENT_RANGE; - - struct _POSITION_TO_ELEMENT { - UCHAR OperationCode; // 0x2B - SCSIOP_POSITION_TO_ELEMENT - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } POSITION_TO_ELEMENT; - - struct _MOVE_MEDIUM { - UCHAR OperationCode; // 0xA5 - SCSIOP_MOVE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR DestinationElementAddress[2]; - UCHAR Reserved2[2]; - UCHAR Flip : 1; - UCHAR Reserved3 : 7; - UCHAR Control; - } MOVE_MEDIUM; - - struct _EXCHANGE_MEDIUM { - UCHAR OperationCode; // 0xA6 - SCSIOP_EXCHANGE_MEDIUM - UCHAR Reserved1 : 5; - UCHAR LogicalUnitNumber : 3; - UCHAR TransportElementAddress[2]; - UCHAR SourceElementAddress[2]; - UCHAR Destination1ElementAddress[2]; - UCHAR Destination2ElementAddress[2]; - UCHAR Flip1 : 1; - UCHAR Flip2 : 1; - UCHAR Reserved3 : 6; - UCHAR Control; - } EXCHANGE_MEDIUM; - - struct _READ_ELEMENT_STATUS { - UCHAR OperationCode; // 0xB8 - SCSIOP_READ_ELEMENT_STATUS - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberOfElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } READ_ELEMENT_STATUS; - - struct _SEND_VOLUME_TAG { - UCHAR OperationCode; // 0xB6 - SCSIOP_SEND_VOLUME_TAG - UCHAR ElementType : 4; - UCHAR Reserved1 : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR Reserved2; - UCHAR ActionCode : 5; - UCHAR Reserved3 : 3; - UCHAR Reserved4[2]; - UCHAR ParameterListLength[2]; - UCHAR Reserved5; - UCHAR Control; - } SEND_VOLUME_TAG; - - struct _REQUEST_VOLUME_ELEMENT_ADDRESS { - UCHAR OperationCode; // Unknown -- vendor-unique? - UCHAR ElementType : 4; - UCHAR VolTag : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR StartingElementAddress[2]; - UCHAR NumberElements[2]; - UCHAR Reserved1; - UCHAR AllocationLength[3]; - UCHAR Reserved2; - UCHAR Control; - } REQUEST_VOLUME_ELEMENT_ADDRESS; - - // - // Atapi 2.5 Changer 12-byte CDBs - // - - struct _LOAD_UNLOAD { - UCHAR OperationCode; // 0xA6 - SCSIOP_LOAD_UNLOAD_SLOT - UCHAR Immediate : 1; - UCHAR Reserved1 : 4; - UCHAR Lun : 3; - UCHAR Reserved2[2]; - UCHAR Start : 1; - UCHAR LoadEject : 1; - UCHAR Reserved3: 6; - UCHAR Reserved4[3]; - UCHAR Slot; - UCHAR Reserved5[3]; - } LOAD_UNLOAD; - - struct _MECH_STATUS { - UCHAR OperationCode; // 0xBD - SCSIOP_MECHANISM_STATUS - UCHAR Reserved : 5; - UCHAR Lun : 3; - UCHAR Reserved1[6]; - UCHAR AllocationLength[2]; - UCHAR Reserved2[1]; - UCHAR Control; - } MECH_STATUS; - - // - // C/DVD 0.9 CDBs - // - - struct _SYNCHRONIZE_CACHE10 { - - UCHAR OperationCode; // 0x35 - SCSIOP_SYNCHRONIZE_CACHE - - UCHAR RelAddr : 1; - UCHAR Immediate : 1; - UCHAR Reserved : 3; - UCHAR Lun : 3; - - UCHAR LogicalBlockAddress[4]; // Unused - set to zero - UCHAR Reserved2; - UCHAR BlockCount[2]; // Unused - set to zero - UCHAR Control; - } SYNCHRONIZE_CACHE10; - - struct _GET_EVENT_STATUS_NOTIFICATION { - UCHAR OperationCode; // 0x4A - SCSIOP_GET_EVENT_STATUS_NOTIFICATION - - UCHAR Immediate : 1; - UCHAR Reserved : 4; - UCHAR Lun : 3; - - UCHAR Reserved2[2]; - UCHAR NotificationClassRequest; - UCHAR Reserved3[2]; - UCHAR EventListLength[2]; - - UCHAR Control; - } GET_EVENT_STATUS_NOTIFICATION; - - struct _GET_PERFORMANCE { - UCHAR OperationCode; // 0xAC - SCSIOP_GET_PERFORMANCE - UCHAR Except : 2; - UCHAR Write : 1; - UCHAR Tolerance : 2; - UCHAR Reserved0 : 3; - UCHAR StartingLBA[4]; - UCHAR Reserved1[2]; - UCHAR MaximumNumberOfDescriptors[2]; - UCHAR Type; - UCHAR Control; - } GET_PERFORMANCE; - - struct _READ_DVD_STRUCTURE { - UCHAR OperationCode; // 0xAD - SCSIOP_READ_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR RMDBlockNumber[4]; - UCHAR LayerNumber; - UCHAR Format; - UCHAR AllocationLength[2]; - UCHAR Reserved3 : 6; - UCHAR AGID : 2; - UCHAR Control; - } READ_DVD_STRUCTURE; - - struct _SET_STREAMING { - UCHAR OperationCode; // 0xB6 - SCSIOP_SET_STREAMING - UCHAR Reserved[8]; - UCHAR ParameterListLength[2]; - UCHAR Control; - } SET_STREAMING; - - struct _SEND_DVD_STRUCTURE { - UCHAR OperationCode; // 0xBF - SCSIOP_SEND_DVD_STRUCTURE - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR Format; - UCHAR ParameterListLength[2]; - UCHAR Reserved3; - UCHAR Control; - } SEND_DVD_STRUCTURE; - - struct _SEND_KEY { - UCHAR OperationCode; // 0xA3 - SCSIOP_SEND_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[6]; - UCHAR ParameterListLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } SEND_KEY; - - struct _REPORT_KEY { - UCHAR OperationCode; // 0xA4 - SCSIOP_REPORT_KEY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR LogicalBlockAddress[4]; // for title key - UCHAR Reserved2[2]; - UCHAR AllocationLength[2]; - UCHAR KeyFormat : 6; - UCHAR AGID : 2; - UCHAR Control; - } REPORT_KEY; - - struct _SET_READ_AHEAD { - UCHAR OperationCode; // 0xA7 - SCSIOP_SET_READ_AHEAD - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR TriggerLBA[4]; - UCHAR ReadAheadLBA[4]; - UCHAR Reserved2; - UCHAR Control; - } SET_READ_AHEAD; - - struct _READ_FORMATTED_CAPACITIES { - UCHAR OperationCode; // 0x23 - SCSIOP_READ_FORMATTED_CAPACITY - UCHAR Reserved1 : 5; - UCHAR Lun : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } READ_FORMATTED_CAPACITIES; - - // - // SCSI-3 - // - - struct _REPORT_LUNS { - UCHAR OperationCode; // 0xA0 - SCSIOP_REPORT_LUNS - UCHAR Reserved1[5]; - UCHAR AllocationLength[4]; - UCHAR Reserved2[1]; - UCHAR Control; - } REPORT_LUNS; - - struct _PERSISTENT_RESERVE_IN { - UCHAR OperationCode; // 0x5E - SCSIOP_PERSISTENT_RESERVE_IN - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Reserved2[5]; - UCHAR AllocationLength[2]; - UCHAR Control; - } PERSISTENT_RESERVE_IN; - - struct _PERSISTENT_RESERVE_OUT { - UCHAR OperationCode; // 0x5F - SCSIOP_PERSISTENT_RESERVE_OUT - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Reserved2[4]; - UCHAR ParameterListLength[2]; // 0x18 - UCHAR Control; - } PERSISTENT_RESERVE_OUT; - - // - // MMC / SFF-8090 commands - // - - struct _GET_CONFIGURATION { - UCHAR OperationCode; // 0x46 - SCSIOP_GET_CONFIGURATION - UCHAR RequestType : 2; // SCSI_GET_CONFIGURATION_REQUEST_TYPE_* - UCHAR Reserved1 : 6; // includes obsolete LUN field - UCHAR StartingFeature[2]; - UCHAR Reserved2[3]; - UCHAR AllocationLength[2]; - UCHAR Control; - } GET_CONFIGURATION; - - struct _SET_CD_SPEED { - UCHAR OperationCode; // 0xB8 - SCSIOP_SET_CD_SPEED - union { - UCHAR Reserved1; - struct { - UCHAR RotationControl : 2; - UCHAR Reserved3 : 6; - }; - }; - UCHAR ReadSpeed[2]; // 1x == (75 * 2352) - UCHAR WriteSpeed[2]; // 1x == (75 * 2352) - UCHAR Reserved2[5]; - UCHAR Control; - } SET_CD_SPEED; - - struct _READ12 { - UCHAR OperationCode; // 0xA8 - SCSIOP_READ12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 2; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ12; - - struct _WRITE12 { - UCHAR OperationCode; // 0xAA - SCSIOP_WRITE12 - UCHAR RelativeAddress : 1; - UCHAR Reserved1 : 1; - UCHAR EBP : 1; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR LogicalUnitNumber : 3; - UCHAR LogicalBlock[4]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE12; - - // - // 16-byte CDBs - // - - struct _READ16 { - UCHAR OperationCode; // 0x88 - SCSIOP_READ16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR ReadProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } READ16; - - struct _WRITE16 { - UCHAR OperationCode; // 0x8A - SCSIOP_WRITE16 - UCHAR Reserved1 : 3; - UCHAR ForceUnitAccess : 1; - UCHAR DisablePageOut : 1; - UCHAR WriteProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR TransferLength[4]; - UCHAR Reserved2 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } WRITE16; - - struct _VERIFY16 { - UCHAR OperationCode; // 0x8F - SCSIOP_VERIFY16 - UCHAR Reserved1 : 1; - UCHAR ByteCheck : 1; - UCHAR BlockVerify : 1; - UCHAR Reserved2 : 1; - UCHAR DisablePageOut : 1; - UCHAR VerifyProtect : 3; - UCHAR LogicalBlock[8]; - UCHAR VerificationLength[4]; - UCHAR Reserved3 : 7; - UCHAR Streaming : 1; - UCHAR Control; - } VERIFY16; - - struct _SYNCHRONIZE_CACHE16 { - UCHAR OperationCode; // 0x91 - SCSIOP_SYNCHRONIZE_CACHE16 - UCHAR Reserved1 : 1; - UCHAR Immediate : 1; - UCHAR Reserved2 : 6; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR Reserved3; - UCHAR Control; - } SYNCHRONIZE_CACHE16; - - struct _READ_CAPACITY16 { - UCHAR OperationCode; // 0x9E - SCSIOP_READ_CAPACITY16 - UCHAR ServiceAction : 5; - UCHAR Reserved1 : 3; - UCHAR LogicalBlock[8]; - UCHAR BlockCount[4]; - UCHAR PMI : 1; - UCHAR Reserved2 : 7; - UCHAR Control; - } READ_CAPACITY16; - - ULONG AsUlong[4]; - UCHAR AsByte[16]; - -} CDB, *PCDB; -#pragma pack(pop, cdb) - -//////////////////////////////////////////////////////////////////////////////// -// -// GET_EVENT_STATUS_NOTIFICATION -// - - -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_MASK 0x02 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_MASK 0x04 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_MASK 0x08 -#define NOTIFICATION_MEDIA_STATUS_CLASS_MASK 0x10 -#define NOTIFICATION_MULTI_HOST_CLASS_MASK 0x20 -#define NOTIFICATION_DEVICE_BUSY_CLASS_MASK 0x40 - - -#define NOTIFICATION_NO_CLASS_EVENTS 0x0 -#define NOTIFICATION_OPERATIONAL_CHANGE_CLASS_EVENTS 0x1 -#define NOTIFICATION_POWER_MANAGEMENT_CLASS_EVENTS 0x2 -#define NOTIFICATION_EXTERNAL_REQUEST_CLASS_EVENTS 0x3 -#define NOTIFICATION_MEDIA_STATUS_CLASS_EVENTS 0x4 -#define NOTIFICATION_MULTI_HOST_CLASS_EVENTS 0x5 -#define NOTIFICATION_DEVICE_BUSY_CLASS_EVENTS 0x6 - -#pragma pack(push, not_header, 1) -typedef struct _NOTIFICATION_EVENT_STATUS_HEADER { - UCHAR EventDataLength[2]; - - UCHAR NotificationClass : 3; - UCHAR Reserved : 4; - UCHAR NEA : 1; - - UCHAR SupportedEventClasses; -#if !defined(__midl) - UCHAR ClassEventData[0]; -#endif -} NOTIFICATION_EVENT_STATUS_HEADER, *PNOTIFICATION_EVENT_STATUS_HEADER; -#pragma pack(pop, not_header) - -#define NOTIFICATION_OPERATIONAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_REQUESTED 0x1 -#define NOTIFICATION_OPERATIONAL_EVENT_CHANGE_OCCURRED 0x2 - -#define NOTIFICATION_OPERATIONAL_STATUS_AVAILABLE 0x0 -#define NOTIFICATION_OPERATIONAL_STATUS_TEMPORARY_BUSY 0x1 -#define NOTIFICATION_OPERATIONAL_STATUS_EXTENDED_BUSY 0x2 - -#define NOTIFICATION_OPERATIONAL_OPCODE_NONE 0x0 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_CHANGE 0x1 -#define NOTIFICATION_OPERATIONAL_OPCODE_FEATURE_ADDED 0x2 -#define NOTIFICATION_OPERATIONAL_OPCODE_UNIT_RESET 0x3 -#define NOTIFICATION_OPERATIONAL_OPCODE_FIRMWARE_CHANGED 0x4 -#define NOTIFICATION_OPERATIONAL_OPCODE_INQUIRY_CHANGED 0x5 - -// -// Class event data may be one (or none) of the following: -// - -#pragma pack(push, not_op, 1) -typedef struct _NOTIFICATION_OPERATIONAL_STATUS { // event class == 0x1 - UCHAR OperationalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR OperationalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Operation[2]; -} NOTIFICATION_OPERATIONAL_STATUS, *PNOTIFICATION_OPERATIONAL_STATUS; -#pragma pack(pop, not_op) - - -#define NOTIFICATION_POWER_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_POWER_EVENT_CHANGE_SUCCEEDED 0x1 -#define NOTIFICATION_POWER_EVENT_CHANGE_FAILED 0x2 - -#define NOTIFICATION_POWER_STATUS_ACTIVE 0x1 -#define NOTIFICATION_POWER_STATUS_IDLE 0x2 -#define NOTIFICATION_POWER_STATUS_STANDBY 0x3 -#define NOTIFICATION_POWER_STATUS_SLEEP 0x4 - -#pragma pack(push, not_power, 1) -typedef struct _NOTIFICATION_POWER_STATUS { // event class == 0x2 - UCHAR PowerEvent : 4; - UCHAR Reserved : 4; - UCHAR PowerStatus; - UCHAR Reserved2[2]; -} NOTIFICATION_POWER_STATUS, *PNOTIFICATION_POWER_STATUS; -#pragma pack(pop, not_power) - -#define NOTIFICATION_MEDIA_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_DOWN 0x1 -#define NOTIFICATION_EXTERNAL_EVENT_BUTTON_UP 0x2 -#define NOTIFICATION_EXTERNAL_EVENT_EXTERNAL 0x3 // respond with GET_CONFIGURATION? - -#define NOTIFICATION_EXTERNAL_STATUS_READY 0x0 -#define NOTIFICATION_EXTERNAL_STATUS_PREVENT 0x1 - -#define NOTIFICATION_EXTERNAL_REQUEST_NONE 0x0000 -#define NOTIFICATION_EXTERNAL_REQUEST_QUEUE_OVERRUN 0x0001 -#define NOTIFICATION_EXTERNAL_REQUEST_PLAY 0x0101 -#define NOTIFICATION_EXTERNAL_REQUEST_REWIND_BACK 0x0102 -#define NOTIFICATION_EXTERNAL_REQUEST_FAST_FORWARD 0x0103 -#define NOTIFICATION_EXTERNAL_REQUEST_PAUSE 0x0104 -#define NOTIFICATION_EXTERNAL_REQUEST_STOP 0x0106 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_LOW 0x0200 -#define NOTIFICATION_EXTERNAL_REQUEST_ASCII_HIGH 0x02ff - -#pragma pack(push, not_extern, 1) -typedef struct _NOTIFICATION_EXTERNAL_STATUS { // event class == 0x3 - UCHAR ExternalEvent : 4; - UCHAR Reserved1 : 4; - UCHAR ExternalStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Request[2]; -} NOTIFICATION_EXTERNAL_STATUS, *PNOTIFICATION_EXTERNAL_STATUS; -#pragma pack(pop, not_extern) - -#define NOTIFICATION_MEDIA_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MEDIA_EVENT_EJECT_REQUEST 0x1 -#define NOTIFICATION_MEDIA_EVENT_NEW_MEDIA 0x2 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_REMOVAL 0x3 -#define NOTIFICATION_MEDIA_EVENT_MEDIA_CHANGE 0x4 - -#pragma pack(push, not_media, 1) -typedef struct _NOTIFICATION_MEDIA_STATUS { // event class == 0x4 - UCHAR MediaEvent : 4; - UCHAR Reserved : 4; - - union { - UCHAR PowerStatus; // OBSOLETE -- was improperly named in NT5 headers - UCHAR MediaStatus; // Use this for currently reserved fields - struct { - UCHAR DoorTrayOpen : 1; - UCHAR MediaPresent : 1; - UCHAR ReservedX : 6; // do not reference this directly! - }; - }; - UCHAR StartSlot; - UCHAR EndSlot; -} NOTIFICATION_MEDIA_STATUS, *PNOTIFICATION_MEDIA_STATUS; -#pragma pack(pop, not_media) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_REQUEST 0x1 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_GRANT 0x2 -#define NOTIFICATION_MULTI_HOST_EVENT_CONTROL_RELEASE 0x3 - -#define NOTIFICATION_MULTI_HOST_STATUS_READY 0x0 -#define NOTIFICATION_MULTI_HOST_STATUS_PREVENT 0x1 - -#define NOTIFICATION_MULTI_HOST_PRIORITY_NO_REQUESTS 0x0 -#define NOTIFICATION_MULTI_HOST_PRIORITY_LOW 0x1 -#define NOTIFICATION_MULTI_HOST_PRIORITY_MEDIUM 0x2 -#define NOTIFICATION_MULTI_HOST_PRIORITY_HIGH 0x3 - -#pragma pack(push, not_multi, 1) -typedef struct _NOTIFICATION_MULTI_HOST_STATUS { // event class == 0x5 - UCHAR MultiHostEvent : 4; - UCHAR Reserved1 : 4; - UCHAR MultiHostStatus : 4; - UCHAR Reserved2 : 3; - UCHAR PersistentPrevented : 1; - UCHAR Priority[2]; -} NOTIFICATION_MULTI_HOST_STATUS, *PNOTIFICATION_MULTI_HOST_STATUS; -#pragma pack(pop, not_multi) - -#define NOTIFICATION_BUSY_EVENT_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_EVENT_NO_CHANGE 0x0 -#define NOTIFICATION_BUSY_EVENT_BUSY 0x1 - -#define NOTIFICATION_BUSY_STATUS_NO_EVENT 0x0 -#define NOTIFICATION_BUSY_STATUS_POWER 0x1 -#define NOTIFICATION_BUSY_STATUS_IMMEDIATE 0x2 -#define NOTIFICATION_BUSY_STATUS_DEFERRED 0x3 - -#pragma pack(push, not_busy, 1) -typedef struct _NOTIFICATION_BUSY_STATUS { // event class == 0x6 - UCHAR DeviceBusyEvent : 4; - UCHAR Reserved : 4; - - UCHAR DeviceBusyStatus; - UCHAR Time[2]; -} NOTIFICATION_BUSY_STATUS, *PNOTIFICATION_BUSY_STATUS; -#pragma pack(pop, not_busy) - -//////////////////////////////////////////////////////////////////////////////// - -// -// Read DVD Structure Definitions and Constants -// - -#define DVD_FORMAT_LEAD_IN 0x00 -#define DVD_FORMAT_COPYRIGHT 0x01 -#define DVD_FORMAT_DISK_KEY 0x02 -#define DVD_FORMAT_BCA 0x03 -#define DVD_FORMAT_MANUFACTURING 0x04 - -#pragma pack(push, dvd_struct_header, 1) -typedef struct _READ_DVD_STRUCTURES_HEADER { - UCHAR Length[2]; - UCHAR Reserved[2]; - -#if !defined(__midl) - UCHAR Data[0]; -#endif -} READ_DVD_STRUCTURES_HEADER, *PREAD_DVD_STRUCTURES_HEADER; -#pragma pack(pop, dvd_struct_header) - -// -// DiskKey, BCA & Manufacturer information will provide byte arrays as their -// data. -// - -// -// CDVD 0.9 Send & Report Key Definitions and Structures -// - -#define DVD_REPORT_AGID 0x00 -#define DVD_CHALLENGE_KEY 0x01 -#define DVD_KEY_1 0x02 -#define DVD_KEY_2 0x03 -#define DVD_TITLE_KEY 0x04 -#define DVD_REPORT_ASF 0x05 -#define DVD_INVALIDATE_AGID 0x3F - -#pragma pack(push, dvdstuff, 1) -typedef struct _CDVD_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved[2]; -#if !defined(__midl) - UCHAR Data[0]; -#endif -} CDVD_KEY_HEADER, *PCDVD_KEY_HEADER; - -typedef struct _CDVD_REPORT_AGID_DATA { - UCHAR Reserved1[3]; - UCHAR Reserved2 : 6; - UCHAR AGID : 2; -} CDVD_REPORT_AGID_DATA, *PCDVD_REPORT_AGID_DATA; - -typedef struct _CDVD_CHALLENGE_KEY_DATA { - UCHAR ChallengeKeyValue[10]; - UCHAR Reserved[2]; -} CDVD_CHALLENGE_KEY_DATA, *PCDVD_CHALLENGE_KEY_DATA; - -typedef struct _CDVD_KEY_DATA { - UCHAR Key[5]; - UCHAR Reserved[3]; -} CDVD_KEY_DATA, *PCDVD_KEY_DATA; - -typedef struct _CDVD_REPORT_ASF_DATA { - UCHAR Reserved1[3]; - UCHAR Success : 1; - UCHAR Reserved2 : 7; -} CDVD_REPORT_ASF_DATA, *PCDVD_REPORT_ASF_DATA; - -typedef struct _CDVD_TITLE_KEY_HEADER { - UCHAR DataLength[2]; - UCHAR Reserved1[1]; - UCHAR Reserved2 : 3; - UCHAR CGMS : 2; - UCHAR CP_SEC : 1; - UCHAR CPM : 1; - UCHAR Zero : 1; - CDVD_KEY_DATA TitleKey; -} CDVD_TITLE_KEY_HEADER, *PCDVD_TITLE_KEY_HEADER; -#pragma pack(pop, dvdstuff) - - -// -// Format Unit Data definitions and structures -// - -#pragma pack(push, format_unit, 1) -typedef struct _FORMAT_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR FormatSubType : 2; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMAT_DESCRIPTOR, *PFORMAT_DESCRIPTOR; - -typedef struct _FORMAT_LIST_HEADER { - UCHAR Reserved; - UCHAR VendorSpecific : 1; - UCHAR Immediate : 1; - UCHAR TryOut : 1; - UCHAR IP : 1; - UCHAR STPF : 1; - UCHAR DCRT : 1; - UCHAR DPRY : 1; - UCHAR FOV : 1; - UCHAR FormatDescriptorLength[2]; -#if !defined(__midl) - FORMAT_DESCRIPTOR Descriptors[0]; -#endif -} FORMAT_LIST_HEADER, *PFORMAT_LIST_HEADER; -#pragma pack(pop, format_unit) - -// -// Read Formatted Capacity Data - returned in Big Endian Format -// - - -#pragma pack(push, formatted_capacity, 1) -typedef struct _FORMATTED_CAPACITY_DESCRIPTOR { - UCHAR NumberOfBlocks[4]; - UCHAR Maximum : 1; - UCHAR Valid : 1; - UCHAR FormatType : 6; - UCHAR BlockLength[3]; -} FORMATTED_CAPACITY_DESCRIPTOR, *PFORMATTED_CAPACITY_DESCRIPTOR; - -typedef struct _FORMATTED_CAPACITY_LIST { - UCHAR Reserved[3]; - UCHAR CapacityListLength; -#if !defined(__midl) - FORMATTED_CAPACITY_DESCRIPTOR Descriptors[0]; -#endif -} FORMATTED_CAPACITY_LIST, *PFORMATTED_CAPACITY_LIST; -#pragma pack(pop, formatted_capacity) - -// -// BLANK command blanking type codes -// - -#define BLANK_FULL 0x0 -#define BLANK_MINIMAL 0x1 -#define BLANK_TRACK 0x2 -#define BLANK_UNRESERVE_TRACK 0x3 -#define BLANK_TAIL 0x4 -#define BLANK_UNCLOSE_SESSION 0x5 -#define BLANK_SESSION 0x6 - -// -// PLAY_CD definitions and constants -// - -#define CD_EXPECTED_SECTOR_ANY 0x0 -#define CD_EXPECTED_SECTOR_CDDA 0x1 -#define CD_EXPECTED_SECTOR_MODE1 0x2 -#define CD_EXPECTED_SECTOR_MODE2 0x3 -#define CD_EXPECTED_SECTOR_MODE2_FORM1 0x4 -#define CD_EXPECTED_SECTOR_MODE2_FORM2 0x5 - -// -// Read Disk Information Definitions and Capabilities -// - -#define DISK_STATUS_EMPTY 0x00 -#define DISK_STATUS_INCOMPLETE 0x01 -#define DISK_STATUS_COMPLETE 0x02 -#define DISK_STATUS_OTHERS 0x03 - -#define LAST_SESSION_EMPTY 0x00 -#define LAST_SESSION_INCOMPLETE 0x01 -#define LAST_SESSION_RESERVED_DAMAGED 0x02 -#define LAST_SESSION_COMPLETE 0x03 - -#define DISK_TYPE_CDDA 0x00 -#define DISK_TYPE_CDI 0x10 -#define DISK_TYPE_XA 0x20 -#define DISK_TYPE_UNDEFINED 0xFF - -// -// Values for MrwStatus field. -// - -#define DISC_BGFORMAT_STATE_NONE 0x0 -#define DISC_BGFORMAT_STATE_INCOMPLETE 0x1 -#define DISC_BGFORMAT_STATE_RUNNING 0x2 -#define DISC_BGFORMAT_STATE_COMPLETE 0x3 - - -#pragma pack(push, discinfo, 1) -typedef struct _OPC_TABLE_ENTRY { - UCHAR Speed[2]; - UCHAR OPCValue[6]; -} OPC_TABLE_ENTRY, *POPC_TABLE_ENTRY; - -typedef struct _DISC_INFORMATION { - - UCHAR Length[2]; - UCHAR DiscStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - UCHAR FirstTrackNumber; - - UCHAR NumberOfSessionsLsb; - UCHAR LastSessionFirstTrackLsb; - UCHAR LastSessionLastTrackLsb; - UCHAR MrwStatus : 2; - UCHAR MrwDirtyBit : 1; - UCHAR Reserved2 : 2; - UCHAR URU : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiscType; - UCHAR NumberOfSessionsMsb; - UCHAR LastSessionFirstTrackMsb; - UCHAR LastSessionLastTrackMsb; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // HMSF - UCHAR LastPossibleLeadOutStartTime[4]; // HMSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; - OPC_TABLE_ENTRY OPCTable[ 1 ]; // can be many of these here.... - -} DISC_INFORMATION, *PDISC_INFORMATION; - -// TODO: Deprecate DISK_INFORMATION -//#if PRAGMA_DEPRECATED_DDK -//#pragma deprecated(_DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated( DISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#pragma deprecated(PDISK_INFORMATION) // Use DISC_INFORMATION, note size change -//#endif - -typedef struct _DISK_INFORMATION { - UCHAR Length[2]; - - UCHAR DiskStatus : 2; - UCHAR LastSessionStatus : 2; - UCHAR Erasable : 1; - UCHAR Reserved1 : 3; - - UCHAR FirstTrackNumber; - UCHAR NumberOfSessions; - UCHAR LastSessionFirstTrack; - UCHAR LastSessionLastTrack; - - UCHAR Reserved2 : 5; - UCHAR GEN : 1; - UCHAR DBC_V : 1; - UCHAR DID_V : 1; - - UCHAR DiskType; - UCHAR Reserved3[3]; - - UCHAR DiskIdentification[4]; - UCHAR LastSessionLeadIn[4]; // MSF - UCHAR LastPossibleStartTime[4]; // MSF - UCHAR DiskBarCode[8]; - - UCHAR Reserved4; - UCHAR NumberOPCEntries; -#if !defined(__midl) - OPC_TABLE_ENTRY OPCTable[0]; -#endif -} DISK_INFORMATION, *PDISK_INFORMATION; -#pragma pack(pop, discinfo) - - -// -// Read Header definitions and structures -// -#pragma pack(push, cdheader, 1) -typedef struct _DATA_BLOCK_HEADER { - UCHAR DataMode; - UCHAR Reserved[4]; - union { - UCHAR LogicalBlockAddress[4]; - struct { - UCHAR Reserved; - UCHAR M; - UCHAR S; - UCHAR F; - } MSF; - }; -} DATA_BLOCK_HEADER, *PDATA_BLOCK_HEADER; -#pragma pack(pop, cdheader) - - -#define DATA_BLOCK_MODE0 0x0 -#define DATA_BLOCK_MODE1 0x1 -#define DATA_BLOCK_MODE2 0x2 - -// -// Read TOC Format Codes -// - -#define READ_TOC_FORMAT_TOC 0x00 -#define READ_TOC_FORMAT_SESSION 0x01 -#define READ_TOC_FORMAT_FULL_TOC 0x02 -#define READ_TOC_FORMAT_PMA 0x03 -#define READ_TOC_FORMAT_ATIP 0x04 - -// TODO: Deprecate TRACK_INFORMATION structure, use TRACK_INFORMATION2 instead -#pragma pack(push, track_info, 1) -typedef struct _TRACK_INFORMATION { - UCHAR Length[2]; - UCHAR TrackNumber; - UCHAR SessionNumber; - UCHAR Reserved1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved2 : 2; - UCHAR DataMode : 4; - UCHAR FP : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR RT : 1; - UCHAR NWA_V : 1; - UCHAR Reserved3 : 7; - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; -} TRACK_INFORMATION, *PTRACK_INFORMATION; - -// Second Revision Modifies: -// * Longer names for some fields -// * LSB to track/session number fields -// * LRA_V bit -// Second Revision Adds: -// * TrackSize -// * LastRecordedAddress -// * MSB to track/session -// * Two reserved bytes -// Total structure size increased by 12 (0x0C) bytes -typedef struct _TRACK_INFORMATION2 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - -} TRACK_INFORMATION2, *PTRACK_INFORMATION2; - -// Third Revision Adds -// * ReadCompatibilityLBA -// Total structure size increased by 4 bytes -typedef struct _TRACK_INFORMATION3 { - - UCHAR Length[2]; - UCHAR TrackNumberLsb; - UCHAR SessionNumberLsb; - - UCHAR Reserved4; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR Damage : 1; - UCHAR Reserved5 : 2; - UCHAR DataMode : 4; - UCHAR FixedPacket : 1; - UCHAR Packet : 1; - UCHAR Blank : 1; - UCHAR ReservedTrack : 1; - UCHAR NWA_V : 1; - UCHAR LRA_V : 1; - UCHAR Reserved6 : 6; - - UCHAR TrackStartAddress[4]; - UCHAR NextWritableAddress[4]; - UCHAR FreeBlocks[4]; - UCHAR FixedPacketSize[4]; // blocking factor - UCHAR TrackSize[4]; - UCHAR LastRecordedAddress[4]; - - UCHAR TrackNumberMsb; - UCHAR SessionNumberMsb; - UCHAR Reserved7[2]; - UCHAR ReadCompatibilityLba[4]; - -} TRACK_INFORMATION3, *PTRACK_INFORMATION3; - -#pragma pack(pop, track_info) - -#pragma pack(push, perf_descriptor, 1) -typedef struct _PERFORMANCE_DESCRIPTOR { - - UCHAR RandomAccess : 1; - UCHAR Exact : 1; - UCHAR RestoreDefaults : 1; - UCHAR WriteRotationControl : 2; - UCHAR Reserved1 : 3; - - UCHAR Reserved[3]; - UCHAR StartLba[4]; - UCHAR EndLba[4]; - UCHAR ReadSize[4]; - UCHAR ReadTime[4]; - UCHAR WriteSize[4]; - UCHAR WriteTime[4]; - -} PERFORMANCE_DESCRIPTOR, *PPERFORMANCE_DESCRIPTOR; -#pragma pack(pop, perf_descriptor) - -// -// Command Descriptor Block constants. -// - -#define CDB6GENERIC_LENGTH 6 -#define CDB10GENERIC_LENGTH 10 -#define CDB12GENERIC_LENGTH 12 - -#define SETBITON 1 -#define SETBITOFF 0 - -// -// Mode Sense/Select page constants. -// - -#define MODE_PAGE_VENDOR_SPECIFIC 0x00 -#define MODE_PAGE_ERROR_RECOVERY 0x01 -#define MODE_PAGE_DISCONNECT 0x02 -#define MODE_PAGE_FORMAT_DEVICE 0x03 // disk -#define MODE_PAGE_MRW 0x03 // cdrom -#define MODE_PAGE_RIGID_GEOMETRY 0x04 -#define MODE_PAGE_FLEXIBILE 0x05 // disk -#define MODE_PAGE_WRITE_PARAMETERS 0x05 // cdrom -#define MODE_PAGE_VERIFY_ERROR 0x07 -#define MODE_PAGE_CACHING 0x08 -#define MODE_PAGE_PERIPHERAL 0x09 -#define MODE_PAGE_CONTROL 0x0A -#define MODE_PAGE_MEDIUM_TYPES 0x0B -#define MODE_PAGE_NOTCH_PARTITION 0x0C -#define MODE_PAGE_CD_AUDIO_CONTROL 0x0E -#define MODE_PAGE_DATA_COMPRESS 0x0F -#define MODE_PAGE_DEVICE_CONFIG 0x10 -#define MODE_PAGE_XOR_CONTROL 0x10 // disk -#define MODE_PAGE_MEDIUM_PARTITION 0x11 -#define MODE_PAGE_ENCLOSURE_SERVICES_MANAGEMENT 0x14 -#define MODE_PAGE_EXTENDED 0x15 -#define MODE_PAGE_EXTENDED_DEVICE_SPECIFIC 0x16 -#define MODE_PAGE_CDVD_FEATURE_SET 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_LUN 0x18 -#define MODE_PAGE_PROTOCOL_SPECIFIC_PORT 0x19 -#define MODE_PAGE_POWER_CONDITION 0x1A -#define MODE_PAGE_LUN_MAPPING 0x1B -#define MODE_PAGE_FAULT_REPORTING 0x1C -#define MODE_PAGE_CDVD_INACTIVITY 0x1D // cdrom -#define MODE_PAGE_ELEMENT_ADDRESS 0x1D -#define MODE_PAGE_TRANSPORT_GEOMETRY 0x1E -#define MODE_PAGE_DEVICE_CAPABILITIES 0x1F -#define MODE_PAGE_CAPABILITIES 0x2A // cdrom - -#define MODE_SENSE_RETURN_ALL 0x3f - -#define MODE_SENSE_CURRENT_VALUES 0x00 -#define MODE_SENSE_CHANGEABLE_VALUES 0x40 -#define MODE_SENSE_DEFAULT_VAULES 0x80 -#define MODE_SENSE_SAVED_VALUES 0xc0 - - -// -// SCSI CDB operation codes -// - -// 6-byte commands: -#define SCSIOP_TEST_UNIT_READY 0x00 -#define SCSIOP_REZERO_UNIT 0x01 -#define SCSIOP_REWIND 0x01 -#define SCSIOP_REQUEST_BLOCK_ADDR 0x02 -#define SCSIOP_REQUEST_SENSE 0x03 -#define SCSIOP_FORMAT_UNIT 0x04 -#define SCSIOP_READ_BLOCK_LIMITS 0x05 -#define SCSIOP_REASSIGN_BLOCKS 0x07 -#define SCSIOP_INIT_ELEMENT_STATUS 0x07 -#define SCSIOP_READ6 0x08 -#define SCSIOP_RECEIVE 0x08 -#define SCSIOP_WRITE6 0x0A -#define SCSIOP_PRINT 0x0A -#define SCSIOP_SEND 0x0A -#define SCSIOP_SEEK6 0x0B -#define SCSIOP_TRACK_SELECT 0x0B -#define SCSIOP_SLEW_PRINT 0x0B -#define SCSIOP_SET_CAPACITY 0x0B // tape -#define SCSIOP_SEEK_BLOCK 0x0C -#define SCSIOP_PARTITION 0x0D -#define SCSIOP_READ_REVERSE 0x0F -#define SCSIOP_WRITE_FILEMARKS 0x10 -#define SCSIOP_FLUSH_BUFFER 0x10 -#define SCSIOP_SPACE 0x11 -#define SCSIOP_INQUIRY 0x12 -#define SCSIOP_VERIFY6 0x13 -#define SCSIOP_RECOVER_BUF_DATA 0x14 -#define SCSIOP_MODE_SELECT 0x15 -#define SCSIOP_RESERVE_UNIT 0x16 -#define SCSIOP_RELEASE_UNIT 0x17 -#define SCSIOP_COPY 0x18 -#define SCSIOP_ERASE 0x19 -#define SCSIOP_MODE_SENSE 0x1A -#define SCSIOP_START_STOP_UNIT 0x1B -#define SCSIOP_STOP_PRINT 0x1B -#define SCSIOP_LOAD_UNLOAD 0x1B -#define SCSIOP_RECEIVE_DIAGNOSTIC 0x1C -#define SCSIOP_SEND_DIAGNOSTIC 0x1D -#define SCSIOP_MEDIUM_REMOVAL 0x1E - -// 10-byte commands -#define SCSIOP_READ_FORMATTED_CAPACITY 0x23 -#define SCSIOP_READ_CAPACITY 0x25 -#define SCSIOP_READ 0x28 -#define SCSIOP_WRITE 0x2A -#define SCSIOP_SEEK 0x2B -#define SCSIOP_LOCATE 0x2B -#define SCSIOP_POSITION_TO_ELEMENT 0x2B -#define SCSIOP_WRITE_VERIFY 0x2E -#define SCSIOP_VERIFY 0x2F -#define SCSIOP_SEARCH_DATA_HIGH 0x30 -#define SCSIOP_SEARCH_DATA_EQUAL 0x31 -#define SCSIOP_SEARCH_DATA_LOW 0x32 -#define SCSIOP_SET_LIMITS 0x33 -#define SCSIOP_READ_POSITION 0x34 -#define SCSIOP_SYNCHRONIZE_CACHE 0x35 -#define SCSIOP_COMPARE 0x39 -#define SCSIOP_COPY_COMPARE 0x3A -#define SCSIOP_WRITE_DATA_BUFF 0x3B -#define SCSIOP_READ_DATA_BUFF 0x3C -#define SCSIOP_WRITE_LONG 0x3F -#define SCSIOP_CHANGE_DEFINITION 0x40 -#define SCSIOP_WRITE_SAME 0x41 -#define SCSIOP_READ_SUB_CHANNEL 0x42 -#define SCSIOP_READ_TOC 0x43 -#define SCSIOP_READ_HEADER 0x44 -#define SCSIOP_REPORT_DENSITY_SUPPORT 0x44 // tape -#define SCSIOP_PLAY_AUDIO 0x45 -#define SCSIOP_GET_CONFIGURATION 0x46 -#define SCSIOP_PLAY_AUDIO_MSF 0x47 -#define SCSIOP_PLAY_TRACK_INDEX 0x48 -#define SCSIOP_PLAY_TRACK_RELATIVE 0x49 -#define SCSIOP_GET_EVENT_STATUS 0x4A -#define SCSIOP_PAUSE_RESUME 0x4B -#define SCSIOP_LOG_SELECT 0x4C -#define SCSIOP_LOG_SENSE 0x4D -#define SCSIOP_STOP_PLAY_SCAN 0x4E -#define SCSIOP_XDWRITE 0x50 -#define SCSIOP_XPWRITE 0x51 -#define SCSIOP_READ_DISK_INFORMATION 0x51 -#define SCSIOP_READ_DISC_INFORMATION 0x51 // proper use of disc over disk -#define SCSIOP_READ_TRACK_INFORMATION 0x52 -#define SCSIOP_XDWRITE_READ 0x53 -#define SCSIOP_RESERVE_TRACK_RZONE 0x53 -#define SCSIOP_SEND_OPC_INFORMATION 0x54 // optimum power calibration -#define SCSIOP_MODE_SELECT10 0x55 -#define SCSIOP_RESERVE_UNIT10 0x56 -#define SCSIOP_RESERVE_ELEMENT 0x56 -#define SCSIOP_RELEASE_UNIT10 0x57 -#define SCSIOP_RELEASE_ELEMENT 0x57 -#define SCSIOP_REPAIR_TRACK 0x58 -#define SCSIOP_MODE_SENSE10 0x5A -#define SCSIOP_CLOSE_TRACK_SESSION 0x5B -#define SCSIOP_READ_BUFFER_CAPACITY 0x5C -#define SCSIOP_SEND_CUE_SHEET 0x5D -#define SCSIOP_PERSISTENT_RESERVE_IN 0x5E -#define SCSIOP_PERSISTENT_RESERVE_OUT 0x5F - -// 12-byte commands -#define SCSIOP_REPORT_LUNS 0xA0 -#define SCSIOP_BLANK 0xA1 -#define SCSIOP_ATA_PASSTHROUGH12 0xA1 -#define SCSIOP_SEND_EVENT 0xA2 -#define SCSIOP_SEND_KEY 0xA3 -#define SCSIOP_MAINTENANCE_IN 0xA3 -#define SCSIOP_REPORT_KEY 0xA4 -#define SCSIOP_MAINTENANCE_OUT 0xA4 -#define SCSIOP_MOVE_MEDIUM 0xA5 -#define SCSIOP_LOAD_UNLOAD_SLOT 0xA6 -#define SCSIOP_EXCHANGE_MEDIUM 0xA6 -#define SCSIOP_SET_READ_AHEAD 0xA7 -#define SCSIOP_MOVE_MEDIUM_ATTACHED 0xA7 -#define SCSIOP_READ12 0xA8 -#define SCSIOP_GET_MESSAGE 0xA8 -#define SCSIOP_SERVICE_ACTION_OUT12 0xA9 -#define SCSIOP_WRITE12 0xAA -#define SCSIOP_SEND_MESSAGE 0xAB -#define SCSIOP_SERVICE_ACTION_IN12 0xAB -#define SCSIOP_GET_PERFORMANCE 0xAC -#define SCSIOP_READ_DVD_STRUCTURE 0xAD -#define SCSIOP_WRITE_VERIFY12 0xAE -#define SCSIOP_VERIFY12 0xAF -#define SCSIOP_SEARCH_DATA_HIGH12 0xB0 -#define SCSIOP_SEARCH_DATA_EQUAL12 0xB1 -#define SCSIOP_SEARCH_DATA_LOW12 0xB2 -#define SCSIOP_SET_LIMITS12 0xB3 -#define SCSIOP_READ_ELEMENT_STATUS_ATTACHED 0xB4 -#define SCSIOP_REQUEST_VOL_ELEMENT 0xB5 -#define SCSIOP_SEND_VOLUME_TAG 0xB6 -#define SCSIOP_SET_STREAMING 0xB6 // C/DVD -#define SCSIOP_READ_DEFECT_DATA 0xB7 -#define SCSIOP_READ_ELEMENT_STATUS 0xB8 -#define SCSIOP_READ_CD_MSF 0xB9 -#define SCSIOP_SCAN_CD 0xBA -#define SCSIOP_REDUNDANCY_GROUP_IN 0xBA -#define SCSIOP_SET_CD_SPEED 0xBB -#define SCSIOP_REDUNDANCY_GROUP_OUT 0xBB -#define SCSIOP_PLAY_CD 0xBC -#define SCSIOP_SPARE_IN 0xBC -#define SCSIOP_MECHANISM_STATUS 0xBD -#define SCSIOP_SPARE_OUT 0xBD -#define SCSIOP_READ_CD 0xBE -#define SCSIOP_VOLUME_SET_IN 0xBE -#define SCSIOP_SEND_DVD_STRUCTURE 0xBF -#define SCSIOP_VOLUME_SET_OUT 0xBF -#define SCSIOP_INIT_ELEMENT_RANGE 0xE7 - -// 16-byte commands -#define SCSIOP_XDWRITE_EXTENDED16 0x80 // disk -#define SCSIOP_WRITE_FILEMARKS16 0x80 // tape -#define SCSIOP_REBUILD16 0x81 // disk -#define SCSIOP_READ_REVERSE16 0x81 // tape -#define SCSIOP_REGENERATE16 0x82 // disk -#define SCSIOP_EXTENDED_COPY 0x83 -#define SCSIOP_RECEIVE_COPY_RESULTS 0x84 -#define SCSIOP_ATA_PASSTHROUGH16 0x85 -#define SCSIOP_ACCESS_CONTROL_IN 0x86 -#define SCSIOP_ACCESS_CONTROL_OUT 0x87 -#define SCSIOP_READ16 0x88 -#define SCSIOP_WRITE16 0x8A -#define SCSIOP_READ_ATTRIBUTES 0x8C -#define SCSIOP_WRITE_ATTRIBUTES 0x8D -#define SCSIOP_WRITE_VERIFY16 0x8E -#define SCSIOP_VERIFY16 0x8F -#define SCSIOP_PREFETCH16 0x90 -#define SCSIOP_SYNCHRONIZE_CACHE16 0x91 -#define SCSIOP_SPACE16 0x91 // tape -#define SCSIOP_LOCK_UNLOCK_CACHE16 0x92 -#define SCSIOP_LOCATE16 0x92 // tape -#define SCSIOP_WRITE_SAME16 0x93 -#define SCSIOP_ERASE16 0x93 // tape -#define SCSIOP_READ_CAPACITY16 0x9E -#define SCSIOP_SERVICE_ACTION_IN16 0x9E -#define SCSIOP_SERVICE_ACTION_OUT16 0x9F - - -// -// If the IMMED bit is 1, status is returned as soon -// as the operation is initiated. If the IMMED bit -// is 0, status is not returned until the operation -// is completed. -// - -#define CDB_RETURN_ON_COMPLETION 0 -#define CDB_RETURN_IMMEDIATE 1 - -// end_ntminitape - -// -// CDB Force media access used in extended read and write commands. -// - -#define CDB_FORCE_MEDIA_ACCESS 0x08 - -// -// Denon CD ROM operation codes -// - -#define SCSIOP_DENON_EJECT_DISC 0xE6 -#define SCSIOP_DENON_STOP_AUDIO 0xE7 -#define SCSIOP_DENON_PLAY_AUDIO 0xE8 -#define SCSIOP_DENON_READ_TOC 0xE9 -#define SCSIOP_DENON_READ_SUBCODE 0xEB - -// -// SCSI Bus Messages -// - -#define SCSIMESS_ABORT 0x06 -#define SCSIMESS_ABORT_WITH_TAG 0x0D -#define SCSIMESS_BUS_DEVICE_RESET 0X0C -#define SCSIMESS_CLEAR_QUEUE 0X0E -#define SCSIMESS_COMMAND_COMPLETE 0X00 -#define SCSIMESS_DISCONNECT 0X04 -#define SCSIMESS_EXTENDED_MESSAGE 0X01 -#define SCSIMESS_IDENTIFY 0X80 -#define SCSIMESS_IDENTIFY_WITH_DISCON 0XC0 -#define SCSIMESS_IGNORE_WIDE_RESIDUE 0X23 -#define SCSIMESS_INITIATE_RECOVERY 0X0F -#define SCSIMESS_INIT_DETECTED_ERROR 0X05 -#define SCSIMESS_LINK_CMD_COMP 0X0A -#define SCSIMESS_LINK_CMD_COMP_W_FLAG 0X0B -#define SCSIMESS_MESS_PARITY_ERROR 0X09 -#define SCSIMESS_MESSAGE_REJECT 0X07 -#define SCSIMESS_NO_OPERATION 0X08 -#define SCSIMESS_HEAD_OF_QUEUE_TAG 0X21 -#define SCSIMESS_ORDERED_QUEUE_TAG 0X22 -#define SCSIMESS_SIMPLE_QUEUE_TAG 0X20 -#define SCSIMESS_RELEASE_RECOVERY 0X10 -#define SCSIMESS_RESTORE_POINTERS 0X03 -#define SCSIMESS_SAVE_DATA_POINTER 0X02 -#define SCSIMESS_TERMINATE_IO_PROCESS 0X11 - -// -// SCSI Extended Message operation codes -// - -#define SCSIMESS_MODIFY_DATA_POINTER 0X00 -#define SCSIMESS_SYNCHRONOUS_DATA_REQ 0X01 -#define SCSIMESS_WIDE_DATA_REQUEST 0X03 - -// -// SCSI Extended Message Lengths -// - -#define SCSIMESS_MODIFY_DATA_LENGTH 5 -#define SCSIMESS_SYNCH_DATA_LENGTH 3 -#define SCSIMESS_WIDE_DATA_LENGTH 2 - -// -// SCSI extended message structure -// - -#pragma pack(push, scsi_mess, 1) -typedef struct _SCSI_EXTENDED_MESSAGE { - UCHAR InitialMessageCode; - UCHAR MessageLength; - UCHAR MessageType; - union _EXTENDED_ARGUMENTS { - - struct { - UCHAR Modifier[4]; - } Modify; - - struct { - UCHAR TransferPeriod; - UCHAR ReqAckOffset; - } Synchronous; - - struct{ - UCHAR Width; - } Wide; - }ExtendedArguments; -}SCSI_EXTENDED_MESSAGE, *PSCSI_EXTENDED_MESSAGE; -#pragma pack(pop, scsi_mess) - -// -// SCSI bus status codes. -// - -#define SCSISTAT_GOOD 0x00 -#define SCSISTAT_CHECK_CONDITION 0x02 -#define SCSISTAT_CONDITION_MET 0x04 -#define SCSISTAT_BUSY 0x08 -#define SCSISTAT_INTERMEDIATE 0x10 -#define SCSISTAT_INTERMEDIATE_COND_MET 0x14 -#define SCSISTAT_RESERVATION_CONFLICT 0x18 -#define SCSISTAT_COMMAND_TERMINATED 0x22 -#define SCSISTAT_QUEUE_FULL 0x28 - -// -// Enable Vital Product Data Flag (EVPD) -// used with INQUIRY command. -// - -#define CDB_INQUIRY_EVPD 0x01 - -// -// Defines for format CDB -// - -#define LUN0_FORMAT_SAVING_DEFECT_LIST 0 -#define USE_DEFAULTMSB 0 -#define USE_DEFAULTLSB 0 - -#define START_UNIT_CODE 0x01 -#define STOP_UNIT_CODE 0x00 - -// begin_ntminitape - -// -// Inquiry buffer structure. This is the data returned from the target -// after it receives an inquiry. -// -// This structure may be extended by the number of bytes specified -// in the field AdditionalLength. The defined size constant only -// includes fields through ProductRevisionLevel. -// -// The NT SCSI drivers are only interested in the first 36 bytes of data. -// - -#define INQUIRYDATABUFFERSIZE 36 - -#if (NTDDI_VERSION < NTDDI_WINXP) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - UCHAR Versions; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR ReservedBit : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved[2]; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR Reserved2 : 1; - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; - UCHAR Wide16Bit : 1; - UCHAR Wide32Bit : 1; - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#else -#pragma pack(push, inquiry, 1) -typedef struct _INQUIRYDATA { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR DeviceTypeModifier : 7; - UCHAR RemovableMedia : 1; - union { - UCHAR Versions; - struct { - UCHAR ANSIVersion : 3; - UCHAR ECMAVersion : 3; - UCHAR ISOVersion : 2; - }; - }; - UCHAR ResponseDataFormat : 4; - UCHAR HiSupport : 1; - UCHAR NormACA : 1; - UCHAR TerminateTask : 1; - UCHAR AERC : 1; - UCHAR AdditionalLength; - UCHAR Reserved; - UCHAR Addr16 : 1; // defined only for SIP devices. - UCHAR Addr32 : 1; // defined only for SIP devices. - UCHAR AckReqQ: 1; // defined only for SIP devices. - UCHAR MediumChanger : 1; - UCHAR MultiPort : 1; - UCHAR ReservedBit2 : 1; - UCHAR EnclosureServices : 1; - UCHAR ReservedBit3 : 1; - UCHAR SoftReset : 1; - UCHAR CommandQueue : 1; - UCHAR TransferDisable : 1; // defined only for SIP devices. - UCHAR LinkedCommands : 1; - UCHAR Synchronous : 1; // defined only for SIP devices. - UCHAR Wide16Bit : 1; // defined only for SIP devices. - UCHAR Wide32Bit : 1; // defined only for SIP devices. - UCHAR RelativeAddressing : 1; - UCHAR VendorId[8]; - UCHAR ProductId[16]; - UCHAR ProductRevisionLevel[4]; - UCHAR VendorSpecific[20]; - UCHAR Reserved3[40]; -} INQUIRYDATA, *PINQUIRYDATA; -#pragma pack(pop, inquiry) -#endif - -// -// Inquiry defines. Used to interpret data returned from target as result -// of inquiry command. -// -// DeviceType field -// - -#define DIRECT_ACCESS_DEVICE 0x00 // disks -#define SEQUENTIAL_ACCESS_DEVICE 0x01 // tapes -#define PRINTER_DEVICE 0x02 // printers -#define PROCESSOR_DEVICE 0x03 // scanners, printers, etc -#define WRITE_ONCE_READ_MULTIPLE_DEVICE 0x04 // worms -#define READ_ONLY_DIRECT_ACCESS_DEVICE 0x05 // cdroms -#define SCANNER_DEVICE 0x06 // scanners -#define OPTICAL_DEVICE 0x07 // optical disks -#define MEDIUM_CHANGER 0x08 // jukebox -#define COMMUNICATION_DEVICE 0x09 // network -// 0xA and 0xB are obsolete -#define ARRAY_CONTROLLER_DEVICE 0x0C -#define SCSI_ENCLOSURE_DEVICE 0x0D -#define REDUCED_BLOCK_DEVICE 0x0E // e.g., 1394 disk -#define OPTICAL_CARD_READER_WRITER_DEVICE 0x0F -#define BRIDGE_CONTROLLER_DEVICE 0x10 -#define OBJECT_BASED_STORAGE_DEVICE 0x11 // OSD -#define LOGICAL_UNIT_NOT_PRESENT_DEVICE 0x7F - -#define DEVICE_QUALIFIER_ACTIVE 0x00 -#define DEVICE_QUALIFIER_NOT_ACTIVE 0x01 -#define DEVICE_QUALIFIER_NOT_SUPPORTED 0x03 - -// -// DeviceTypeQualifier field -// - -#define DEVICE_CONNECTED 0x00 - -// -// Vital Product Data Pages -// - -// -// Unit Serial Number Page (page code 0x80) -// -// Provides a product serial number for the target or the logical unit. -// -#pragma pack(push, vpd_media_sn, 1) -typedef struct _VPD_MEDIA_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_MEDIA_SERIAL_NUMBER_PAGE, *PVPD_MEDIA_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_media_sn) - -#pragma pack(push, vpd_sn, 1) -typedef struct _VPD_SERIAL_NUMBER_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SerialNumber[0]; -#endif -} VPD_SERIAL_NUMBER_PAGE, *PVPD_SERIAL_NUMBER_PAGE; -#pragma pack(pop, vpd_sn) - -// -// Device Identification Page (page code 0x83) -// Provides the means to retrieve zero or more identification descriptors -// applying to the logical unit. -// - -#pragma pack(push, vpd_stuff, 1) -typedef enum _VPD_CODE_SET { - VpdCodeSetReserved = 0, - VpdCodeSetBinary = 1, - VpdCodeSetAscii = 2, - VpdCodeSetUTF8 = 3 -} VPD_CODE_SET, *PVPD_CODE_SET; - -typedef enum _VPD_ASSOCIATION { - VpdAssocDevice = 0, - VpdAssocPort = 1, - VpdAssocTarget = 2, - VpdAssocReserved1 = 3, - VpdAssocReserved2 = 4 // bogus, only two bits -} VPD_ASSOCIATION, *PVPD_ASSOCIATION; - -typedef enum _VPD_IDENTIFIER_TYPE { - VpdIdentifierTypeVendorSpecific = 0, - VpdIdentifierTypeVendorId = 1, - VpdIdentifierTypeEUI64 = 2, - VpdIdentifierTypeFCPHName = 3, - VpdIdentifierTypePortRelative = 4, - VpdIdentifierTypeTargetPortGroup = 5, - VpdIdentifierTypeLogicalUnitGroup = 6, - VpdIdentifierTypeMD5LogicalUnitId = 7, - VpdIdentifierTypeSCSINameString = 8 -} VPD_IDENTIFIER_TYPE, *PVPD_IDENTIFIER_TYPE; - -typedef struct _VPD_IDENTIFICATION_DESCRIPTOR { - UCHAR CodeSet : 4; // VPD_CODE_SET - UCHAR Reserved : 4; - UCHAR IdentifierType : 4; // VPD_IDENTIFIER_TYPE - UCHAR Association : 2; - UCHAR Reserved2 : 2; - UCHAR Reserved3; - UCHAR IdentifierLength; -#if !defined(__midl) - UCHAR Identifier[0]; -#endif -} VPD_IDENTIFICATION_DESCRIPTOR, *PVPD_IDENTIFICATION_DESCRIPTOR; - -typedef struct _VPD_IDENTIFICATION_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; - - - // - // The following field is actually a variable length array of identification - // descriptors. Unfortunately there's no C notation for an array of - // variable length structures so we're forced to just pretend. - // - -#if !defined(__midl) - // VPD_IDENTIFICATION_DESCRIPTOR Descriptors[0]; - UCHAR Descriptors[0]; -#endif -} VPD_IDENTIFICATION_PAGE, *PVPD_IDENTIFICATION_PAGE; - -// -// Supported Vital Product Data Pages Page (page code 0x00) -// Contains a list of the vital product data page cods supported by the target -// or logical unit. -// - -typedef struct _VPD_SUPPORTED_PAGES_PAGE { - UCHAR DeviceType : 5; - UCHAR DeviceTypeQualifier : 3; - UCHAR PageCode; - UCHAR Reserved; - UCHAR PageLength; -#if !defined(__midl) - UCHAR SupportedPageList[0]; -#endif -} VPD_SUPPORTED_PAGES_PAGE, *PVPD_SUPPORTED_PAGES_PAGE; -#pragma pack(pop, vpd_stuff) - - -#define VPD_MAX_BUFFER_SIZE 0xff - -#define VPD_SUPPORTED_PAGES 0x00 -#define VPD_SERIAL_NUMBER 0x80 -#define VPD_DEVICE_IDENTIFIERS 0x83 -#define VPD_MEDIA_SERIAL_NUMBER 0x84 -#define VPD_SOFTWARE_INTERFACE_IDENTIFIERS 0x84 -#define VPD_NETWORK_MANAGEMENT_ADDRESSES 0x85 -#define VPD_EXTENDED_INQUIRY_DATA 0x86 -#define VPD_MODE_PAGE_POLICY 0x87 -#define VPD_SCSI_PORTS 0x88 - - -// -// Persistent Reservation Definitions. -// - -// -// PERSISTENT_RESERVE_* definitions -// - -#define RESERVATION_ACTION_READ_KEYS 0x00 -#define RESERVATION_ACTION_READ_RESERVATIONS 0x01 - -#define RESERVATION_ACTION_REGISTER 0x00 -#define RESERVATION_ACTION_RESERVE 0x01 -#define RESERVATION_ACTION_RELEASE 0x02 -#define RESERVATION_ACTION_CLEAR 0x03 -#define RESERVATION_ACTION_PREEMPT 0x04 -#define RESERVATION_ACTION_PREEMPT_ABORT 0x05 -#define RESERVATION_ACTION_REGISTER_IGNORE_EXISTING 0x06 - -#define RESERVATION_SCOPE_LU 0x00 -#define RESERVATION_SCOPE_ELEMENT 0x02 - -#define RESERVATION_TYPE_WRITE_EXCLUSIVE 0x01 -#define RESERVATION_TYPE_EXCLUSIVE 0x03 -#define RESERVATION_TYPE_WRITE_EXCLUSIVE_REGISTRANTS 0x05 -#define RESERVATION_TYPE_EXCLUSIVE_REGISTRANTS 0x06 - -// -// Structures for reserve in command. -// - -#pragma pack(push, reserve_in_stuff, 1) -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - UCHAR ReservationKeyList[0][8]; -#endif -} PRI_REGISTRATION_LIST, *PPRI_REGISTRATION_LIST; - -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR Reserved; - UCHAR Type : 4; - UCHAR Scope : 4; - UCHAR Obsolete[2]; -} PRI_RESERVATION_DESCRIPTOR, *PPRI_RESERVATION_DESCRIPTOR; - -typedef struct { - UCHAR Generation[4]; - UCHAR AdditionalLength[4]; -#if !defined(__midl) - PRI_RESERVATION_DESCRIPTOR Reservations[0]; -#endif -} PRI_RESERVATION_LIST, *PPRI_RESERVATION_LIST; -#pragma pack(pop, reserve_in_stuff) - -// -// Structures for reserve out command. -// - -#pragma pack(push, reserve_out_stuff, 1) -typedef struct { - UCHAR ReservationKey[8]; - UCHAR ServiceActionReservationKey[8]; - UCHAR ScopeSpecificAddress[4]; - UCHAR ActivatePersistThroughPowerLoss : 1; - UCHAR Reserved1 : 7; - UCHAR Reserved2; - UCHAR Obsolete[2]; -} PRO_PARAMETER_LIST, *PPRO_PARAMETER_LIST; -#pragma pack(pop, reserve_out_stuff) - - -// -// Sense Data Format -// - -#pragma pack(push, sensedata, 1) -typedef struct _SENSE_DATA { - UCHAR ErrorCode:7; - UCHAR Valid:1; - UCHAR SegmentNumber; - UCHAR SenseKey:4; - UCHAR Reserved:1; - UCHAR IncorrectLength:1; - UCHAR EndOfMedia:1; - UCHAR FileMark:1; - UCHAR Information[4]; - UCHAR AdditionalSenseLength; - UCHAR CommandSpecificInformation[4]; - UCHAR AdditionalSenseCode; - UCHAR AdditionalSenseCodeQualifier; - UCHAR FieldReplaceableUnitCode; - UCHAR SenseKeySpecific[3]; -} SENSE_DATA, *PSENSE_DATA; -#pragma pack(pop, sensedata) - -// -// Default request sense buffer size -// - -#define SENSE_BUFFER_SIZE 18 - -// -// Maximum request sense buffer size -// - -#define MAX_SENSE_BUFFER_SIZE 255 - -// -// Maximum number of additional sense bytes. -// - -#define MAX_ADDITIONAL_SENSE_BYTES (MAX_SENSE_BUFFER_SIZE - SENSE_BUFFER_SIZE) - -// -// Sense codes -// - -#define SCSI_SENSE_NO_SENSE 0x00 -#define SCSI_SENSE_RECOVERED_ERROR 0x01 -#define SCSI_SENSE_NOT_READY 0x02 -#define SCSI_SENSE_MEDIUM_ERROR 0x03 -#define SCSI_SENSE_HARDWARE_ERROR 0x04 -#define SCSI_SENSE_ILLEGAL_REQUEST 0x05 -#define SCSI_SENSE_UNIT_ATTENTION 0x06 -#define SCSI_SENSE_DATA_PROTECT 0x07 -#define SCSI_SENSE_BLANK_CHECK 0x08 -#define SCSI_SENSE_UNIQUE 0x09 -#define SCSI_SENSE_COPY_ABORTED 0x0A -#define SCSI_SENSE_ABORTED_COMMAND 0x0B -#define SCSI_SENSE_EQUAL 0x0C -#define SCSI_SENSE_VOL_OVERFLOW 0x0D -#define SCSI_SENSE_MISCOMPARE 0x0E -#define SCSI_SENSE_RESERVED 0x0F - -// -// Additional tape bit -// - -#define SCSI_ILLEGAL_LENGTH 0x20 -#define SCSI_EOM 0x40 -#define SCSI_FILE_MARK 0x80 - -// -// Additional Sense codes -// - -#define SCSI_ADSENSE_NO_SENSE 0x00 -#define SCSI_ADSENSE_NO_SEEK_COMPLETE 0x02 -#define SCSI_ADSENSE_LUN_NOT_READY 0x04 -#define SCSI_ADSENSE_LUN_COMMUNICATION 0x08 -#define SCSI_ADSENSE_WRITE_ERROR 0x0C -#define SCSI_ADSENSE_TRACK_ERROR 0x14 -#define SCSI_ADSENSE_SEEK_ERROR 0x15 -#define SCSI_ADSENSE_REC_DATA_NOECC 0x17 -#define SCSI_ADSENSE_REC_DATA_ECC 0x18 -#define SCSI_ADSENSE_PARAMETER_LIST_LENGTH 0x1A -#define SCSI_ADSENSE_ILLEGAL_COMMAND 0x20 -#define SCSI_ADSENSE_ILLEGAL_BLOCK 0x21 -#define SCSI_ADSENSE_INVALID_CDB 0x24 -#define SCSI_ADSENSE_INVALID_LUN 0x25 -#define SCSI_ADSENSE_INVALID_FIELD_PARAMETER_LIST 0x26 -#define SCSI_ADSENSE_WRITE_PROTECT 0x27 -#define SCSI_ADSENSE_MEDIUM_CHANGED 0x28 -#define SCSI_ADSENSE_BUS_RESET 0x29 -#define SCSI_ADSENSE_PARAMETERS_CHANGED 0x2A -#define SCSI_ADSENSE_INSUFFICIENT_TIME_FOR_OPERATION 0x2E -#define SCSI_ADSENSE_INVALID_MEDIA 0x30 -#define SCSI_ADSENSE_NO_MEDIA_IN_DEVICE 0x3a -#define SCSI_ADSENSE_POSITION_ERROR 0x3b -#define SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED 0x3f -#define SCSI_ADSENSE_OPERATOR_REQUEST 0x5a // see below -#define SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED 0x5d -#define SCSI_ADSENSE_ILLEGAL_MODE_FOR_THIS_TRACK 0x64 -#define SCSI_ADSENSE_COPY_PROTECTION_FAILURE 0x6f -#define SCSI_ADSENSE_POWER_CALIBRATION_ERROR 0x73 -#define SCSI_ADSENSE_VENDOR_UNIQUE 0x80 // and higher -#define SCSI_ADSENSE_MUSIC_AREA 0xA0 -#define SCSI_ADSENSE_DATA_AREA 0xA1 -#define SCSI_ADSENSE_VOLUME_OVERFLOW 0xA7 - -// for legacy apps: -#define SCSI_ADWRITE_PROTECT SCSI_ADSENSE_WRITE_PROTECT -#define SCSI_FAILURE_PREDICTION_THRESHOLD_EXCEEDED SCSI_ADSENSE_FAILURE_PREDICTION_THRESHOLD_EXCEEDED - - -// -// SCSI_ADSENSE_LUN_NOT_READY (0x04) qualifiers -// - -#define SCSI_SENSEQ_CAUSE_NOT_REPORTABLE 0x00 -#define SCSI_SENSEQ_BECOMING_READY 0x01 -#define SCSI_SENSEQ_INIT_COMMAND_REQUIRED 0x02 -#define SCSI_SENSEQ_MANUAL_INTERVENTION_REQUIRED 0x03 -#define SCSI_SENSEQ_FORMAT_IN_PROGRESS 0x04 -#define SCSI_SENSEQ_REBUILD_IN_PROGRESS 0x05 -#define SCSI_SENSEQ_RECALCULATION_IN_PROGRESS 0x06 -#define SCSI_SENSEQ_OPERATION_IN_PROGRESS 0x07 -#define SCSI_SENSEQ_LONG_WRITE_IN_PROGRESS 0x08 - -// -// SCSI_ADSENSE_LUN_COMMUNICATION (0x08) qualifiers -// - -#define SCSI_SENSEQ_COMM_FAILURE 0x00 -#define SCSI_SENSEQ_COMM_TIMEOUT 0x01 -#define SCSI_SENSEQ_COMM_PARITY_ERROR 0x02 -#define SCSI_SESNEQ_COMM_CRC_ERROR 0x03 -#define SCSI_SENSEQ_UNREACHABLE_TARGET 0x04 - -// -// SCSI_ADSENSE_WRITE_ERROR (0x0C) qualifiers -// -#define SCSI_SENSEQ_LOSS_OF_STREAMING 0x09 -#define SCSI_SENSEQ_PADDING_BLOCKS_ADDED 0x0A - - -// -// SCSI_ADSENSE_NO_SENSE (0x00) qualifiers -// - -#define SCSI_SENSEQ_FILEMARK_DETECTED 0x01 -#define SCSI_SENSEQ_END_OF_MEDIA_DETECTED 0x02 -#define SCSI_SENSEQ_SETMARK_DETECTED 0x03 -#define SCSI_SENSEQ_BEGINNING_OF_MEDIA_DETECTED 0x04 - -// -// SCSI_ADSENSE_ILLEGAL_BLOCK (0x21) qualifiers -// - -#define SCSI_SENSEQ_ILLEGAL_ELEMENT_ADDR 0x01 - -// -// SCSI_ADSENSE_POSITION_ERROR (0x3b) qualifiers -// - -#define SCSI_SENSEQ_DESTINATION_FULL 0x0d -#define SCSI_SENSEQ_SOURCE_EMPTY 0x0e - -// -// SCSI_ADSENSE_INVALID_MEDIA (0x30) qualifiers -// - -#define SCSI_SENSEQ_INCOMPATIBLE_MEDIA_INSTALLED 0x00 -#define SCSI_SENSEQ_UNKNOWN_FORMAT 0x01 -#define SCSI_SENSEQ_INCOMPATIBLE_FORMAT 0x02 -#define SCSI_SENSEQ_CLEANING_CARTRIDGE_INSTALLED 0x03 - - -// -// SCSI_ADSENSE_OPERATING_CONDITIONS_CHANGED (0x3f) qualifiers -// - -#define SCSI_SENSEQ_TARGET_OPERATING_CONDITIONS_CHANGED 0x00 -#define SCSI_SENSEQ_MICROCODE_CHANGED 0x01 -#define SCSI_SENSEQ_OPERATING_DEFINITION_CHANGED 0x02 -#define SCSI_SENSEQ_INQUIRY_DATA_CHANGED 0x03 -#define SCSI_SENSEQ_COMPONENT_DEVICE_ATTACHED 0x04 -#define SCSI_SENSEQ_DEVICE_IDENTIFIER_CHANGED 0x05 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_MODIFIED 0x06 -#define SCSI_SENSEQ_REDUNDANCY_GROUP_DELETED 0x07 -#define SCSI_SENSEQ_SPARE_MODIFIED 0x08 -#define SCSI_SENSEQ_SPARE_DELETED 0x09 -#define SCSI_SENSEQ_VOLUME_SET_MODIFIED 0x0A -#define SCSI_SENSEQ_VOLUME_SET_DELETED 0x0B -#define SCSI_SENSEQ_VOLUME_SET_DEASSIGNED 0x0C -#define SCSI_SENSEQ_VOLUME_SET_REASSIGNED 0x0D -#define SCSI_SENSEQ_REPORTED_LUNS_DATA_CHANGED 0x0E -#define SCSI_SENSEQ_ECHO_BUFFER_OVERWRITTEN 0x0F -#define SCSI_SENSEQ_MEDIUM_LOADABLE 0x10 -#define SCSI_SENSEQ_MEDIUM_AUXILIARY_MEMORY_ACCESSIBLE 0x11 - - -// -// SCSI_ADSENSE_OPERATOR_REQUEST (0x5a) qualifiers -// - -#define SCSI_SENSEQ_STATE_CHANGE_INPUT 0x00 // generic request -#define SCSI_SENSEQ_MEDIUM_REMOVAL 0x01 -#define SCSI_SENSEQ_WRITE_PROTECT_ENABLE 0x02 -#define SCSI_SENSEQ_WRITE_PROTECT_DISABLE 0x03 - -// -// SCSI_ADSENSE_COPY_PROTECTION_FAILURE (0x6f) qualifiers -// -#define SCSI_SENSEQ_AUTHENTICATION_FAILURE 0x00 -#define SCSI_SENSEQ_KEY_NOT_PRESENT 0x01 -#define SCSI_SENSEQ_KEY_NOT_ESTABLISHED 0x02 -#define SCSI_SENSEQ_READ_OF_SCRAMBLED_SECTOR_WITHOUT_AUTHENTICATION 0x03 -#define SCSI_SENSEQ_MEDIA_CODE_MISMATCHED_TO_LOGICAL_UNIT 0x04 -#define SCSI_SENSEQ_LOGICAL_UNIT_RESET_COUNT_ERROR 0x05 - -// -// SCSI_ADSENSE_POWER_CALIBRATION_ERROR (0x73) qualifiers -// - -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ALMOST_FULL 0x01 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_FULL 0x02 -#define SCSI_SENSEQ_POWER_CALIBRATION_AREA_ERROR 0x03 -#define SCSI_SENSEQ_PMA_RMA_UPDATE_FAILURE 0x04 -#define SCSI_SENSEQ_PMA_RMA_IS_FULL 0x05 -#define SCSI_SENSEQ_PMA_RMA_ALMOST_FULL 0x06 - - -// end_ntminitape - -// -// SCSI IO Device Control Codes -// - -#define FILE_DEVICE_SCSI 0x0000001b - -#define IOCTL_SCSI_EXECUTE_IN ((FILE_DEVICE_SCSI << 16) + 0x0011) -#define IOCTL_SCSI_EXECUTE_OUT ((FILE_DEVICE_SCSI << 16) + 0x0012) -#define IOCTL_SCSI_EXECUTE_NONE ((FILE_DEVICE_SCSI << 16) + 0x0013) - -// -// SMART support in atapi -// - -#define IOCTL_SCSI_MINIPORT_SMART_VERSION ((FILE_DEVICE_SCSI << 16) + 0x0500) -#define IOCTL_SCSI_MINIPORT_IDENTIFY ((FILE_DEVICE_SCSI << 16) + 0x0501) -#define IOCTL_SCSI_MINIPORT_READ_SMART_ATTRIBS ((FILE_DEVICE_SCSI << 16) + 0x0502) -#define IOCTL_SCSI_MINIPORT_READ_SMART_THRESHOLDS ((FILE_DEVICE_SCSI << 16) + 0x0503) -#define IOCTL_SCSI_MINIPORT_ENABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0504) -#define IOCTL_SCSI_MINIPORT_DISABLE_SMART ((FILE_DEVICE_SCSI << 16) + 0x0505) -#define IOCTL_SCSI_MINIPORT_RETURN_STATUS ((FILE_DEVICE_SCSI << 16) + 0x0506) -#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTOSAVE ((FILE_DEVICE_SCSI << 16) + 0x0507) -#define IOCTL_SCSI_MINIPORT_SAVE_ATTRIBUTE_VALUES ((FILE_DEVICE_SCSI << 16) + 0x0508) -#define IOCTL_SCSI_MINIPORT_EXECUTE_OFFLINE_DIAGS ((FILE_DEVICE_SCSI << 16) + 0x0509) -#define IOCTL_SCSI_MINIPORT_ENABLE_DISABLE_AUTO_OFFLINE ((FILE_DEVICE_SCSI << 16) + 0x050a) -#define IOCTL_SCSI_MINIPORT_READ_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050b) -#define IOCTL_SCSI_MINIPORT_WRITE_SMART_LOG ((FILE_DEVICE_SCSI << 16) + 0x050c) - -// -// CLUSTER support -// deliberately skipped some values to allow for expansion above. -// -#define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0520) -#define IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0521) - - -// begin_ntminitape - -// -// Read Capacity Data - returned in Big Endian format -// - -#pragma pack(push, read_capacity, 1) -typedef struct _READ_CAPACITY_DATA { - ULONG LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA, *PREAD_CAPACITY_DATA; -#pragma pack(pop, read_capacity) - - -#pragma pack(push, read_capacity_ex, 1) -typedef struct _READ_CAPACITY_DATA_EX { - LARGE_INTEGER LogicalBlockAddress; - ULONG BytesPerBlock; -} READ_CAPACITY_DATA_EX, *PREAD_CAPACITY_DATA_EX; -#pragma pack(pop, read_capacity_ex) - - -// -// Read Block Limits Data - returned in Big Endian format -// This structure returns the maximum and minimum block -// size for a TAPE device. -// - -#pragma pack(push, read_block_limits, 1) -typedef struct _READ_BLOCK_LIMITS { - UCHAR Reserved; - UCHAR BlockMaximumSize[3]; - UCHAR BlockMinimumSize[2]; -} READ_BLOCK_LIMITS_DATA, *PREAD_BLOCK_LIMITS_DATA; -#pragma pack(pop, read_block_limits) - -#pragma pack(push, read_buffer_capacity, 1) -typedef struct _READ_BUFFER_CAPACITY_DATA { - UCHAR DataLength[2]; - UCHAR Reserved1; - UCHAR BlockDataReturned : 1; - UCHAR Reserved4 : 7; - UCHAR TotalBufferSize[4]; - UCHAR AvailableBufferSize[4]; -} READ_BUFFER_CAPACITY_DATA, *PREAD_BUFFER_CAPACITY_DATA; -#pragma pack(pop, read_buffer_capacity) - -// -// Mode data structures. -// - -// -// Define Mode parameter header. -// - -#pragma pack(push, mode_params, 1) -typedef struct _MODE_PARAMETER_HEADER { - UCHAR ModeDataLength; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR BlockDescriptorLength; -}MODE_PARAMETER_HEADER, *PMODE_PARAMETER_HEADER; - -typedef struct _MODE_PARAMETER_HEADER10 { - UCHAR ModeDataLength[2]; - UCHAR MediumType; - UCHAR DeviceSpecificParameter; - UCHAR Reserved[2]; - UCHAR BlockDescriptorLength[2]; -}MODE_PARAMETER_HEADER10, *PMODE_PARAMETER_HEADER10; -#pragma pack(pop, mode_params) - -#define MODE_FD_SINGLE_SIDE 0x01 -#define MODE_FD_DOUBLE_SIDE 0x02 -#define MODE_FD_MAXIMUM_TYPE 0x1E -#define MODE_DSP_FUA_SUPPORTED 0x10 -#define MODE_DSP_WRITE_PROTECT 0x80 - -// -// Define the mode parameter block. -// - -#pragma pack(push, mode_params_block, 1) -typedef struct _MODE_PARAMETER_BLOCK { - UCHAR DensityCode; - UCHAR NumberOfBlocks[3]; - UCHAR Reserved; - UCHAR BlockLength[3]; -}MODE_PARAMETER_BLOCK, *PMODE_PARAMETER_BLOCK; -#pragma pack(pop, mode_params_block) - -// -// Define Disconnect-Reconnect page. -// - - -#pragma pack(push, mode_page_disconnect, 1) -typedef struct _MODE_DISCONNECT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR BufferFullRatio; - UCHAR BufferEmptyRatio; - UCHAR BusInactivityLimit[2]; - UCHAR BusDisconnectTime[2]; - UCHAR BusConnectTime[2]; - UCHAR MaximumBurstSize[2]; - UCHAR DataTransferDisconnect : 2; - UCHAR Reserved2[3]; -}MODE_DISCONNECT_PAGE, *PMODE_DISCONNECT_PAGE; -#pragma pack(pop, mode_page_disconnect) - -// -// Define mode caching page. -// - -#pragma pack(push, mode_page_caching, 1) -typedef struct _MODE_CACHING_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR ReadDisableCache : 1; - UCHAR MultiplicationFactor : 1; - UCHAR WriteCacheEnable : 1; - UCHAR Reserved2 : 5; - UCHAR WriteRetensionPriority : 4; - UCHAR ReadRetensionPriority : 4; - UCHAR DisablePrefetchTransfer[2]; - UCHAR MinimumPrefetch[2]; - UCHAR MaximumPrefetch[2]; - UCHAR MaximumPrefetchCeiling[2]; -}MODE_CACHING_PAGE, *PMODE_CACHING_PAGE; -#pragma pack(pop, mode_page_caching) - -// -// Define write parameters cdrom page -// -#pragma pack(push, mode_page_wp2, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE2 { - UCHAR PageCode : 6; // 0x05 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR MediaCatalogNumber[16]; - UCHAR ISRC[16]; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE2, *PMODE_CDROM_WRITE_PARAMETERS_PAGE2; -#pragma pack(pop, mode_page_wp2) - -#ifndef DEPRECATE_DDK_FUNCTIONS -// this structure is being retired due to missing fields and overly -// complex data definitions for the MCN and ISRC. -#pragma pack(push, mode_page_wp, 1) -typedef struct _MODE_CDROM_WRITE_PARAMETERS_PAGE { - UCHAR PageLength; // 0x32 ?? - UCHAR WriteType : 4; - UCHAR TestWrite : 1; - UCHAR LinkSizeValid : 1; - UCHAR BufferUnderrunFreeEnabled : 1; - UCHAR Reserved2 : 1; - UCHAR TrackMode : 4; - UCHAR Copy : 1; - UCHAR FixedPacket : 1; - UCHAR MultiSession : 2; - UCHAR DataBlockType : 4; - UCHAR Reserved3 : 4; - UCHAR LinkSize; - UCHAR Reserved4; - UCHAR HostApplicationCode : 6; - UCHAR Reserved5 : 2; - UCHAR SessionFormat; - UCHAR Reserved6; - UCHAR PacketSize[4]; - UCHAR AudioPauseLength[2]; - UCHAR Reserved7 : 7; - UCHAR MediaCatalogNumberValid : 1; - UCHAR MediaCatalogNumber[13]; - UCHAR MediaCatalogNumberZero; - UCHAR MediaCatalogNumberAFrame; - UCHAR Reserved8 : 7; - UCHAR ISRCValid : 1; - UCHAR ISRCCountry[2]; - UCHAR ISRCOwner[3]; - UCHAR ISRCRecordingYear[2]; - UCHAR ISRCSerialNumber[5]; - UCHAR ISRCZero; - UCHAR ISRCAFrame; - UCHAR ISRCReserved; - UCHAR SubHeaderData[4]; -} MODE_CDROM_WRITE_PARAMETERS_PAGE, *PMODE_CDROM_WRITE_PARAMETERS_PAGE; -#pragma pack(pop, mode_page_wp) -#endif //ifndef DEPRECATE_DDK_FUNCTIONS - -// -// Define the MRW mode page for CDROM device types -// -#pragma pack(push, mode_page_mrw, 1) -typedef struct _MODE_MRW_PAGE { - UCHAR PageCode : 6; // 0x03 - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; //0x06 - UCHAR Reserved1; - UCHAR LbaSpace : 1; - UCHAR Reserved2 : 7; - UCHAR Reserved3[4]; -} MODE_MRW_PAGE, *PMODE_MRW_PAGE; -#pragma pack(pop, mode_page_mrw) - -// -// Define mode flexible disk page. -// - -#pragma pack(push, mode_page_flex, 1) -typedef struct _MODE_FLEXIBLE_DISK_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TransferRate[2]; - UCHAR NumberOfHeads; - UCHAR SectorsPerTrack; - UCHAR BytesPerSector[2]; - UCHAR NumberOfCylinders[2]; - UCHAR StartWritePrecom[2]; - UCHAR StartReducedCurrent[2]; - UCHAR StepRate[2]; - UCHAR StepPluseWidth; - UCHAR HeadSettleDelay[2]; - UCHAR MotorOnDelay; - UCHAR MotorOffDelay; - UCHAR Reserved2 : 5; - UCHAR MotorOnAsserted : 1; - UCHAR StartSectorNumber : 1; - UCHAR TrueReadySignal : 1; - UCHAR StepPlusePerCyclynder : 4; - UCHAR Reserved3 : 4; - UCHAR WriteCompenstation; - UCHAR HeadLoadDelay; - UCHAR HeadUnloadDelay; - UCHAR Pin2Usage : 4; - UCHAR Pin34Usage : 4; - UCHAR Pin1Usage : 4; - UCHAR Pin4Usage : 4; - UCHAR MediumRotationRate[2]; - UCHAR Reserved4[2]; -} MODE_FLEXIBLE_DISK_PAGE, *PMODE_FLEXIBLE_DISK_PAGE; -#pragma pack(pop, mode_page_flex) - -// -// Define mode format page. -// - -#pragma pack(push, mode_page_format, 1) -typedef struct _MODE_FORMAT_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR TracksPerZone[2]; - UCHAR AlternateSectorsPerZone[2]; - UCHAR AlternateTracksPerZone[2]; - UCHAR AlternateTracksPerLogicalUnit[2]; - UCHAR SectorsPerTrack[2]; - UCHAR BytesPerPhysicalSector[2]; - UCHAR Interleave[2]; - UCHAR TrackSkewFactor[2]; - UCHAR CylinderSkewFactor[2]; - UCHAR Reserved2 : 4; - UCHAR SurfaceFirst : 1; - UCHAR RemovableMedia : 1; - UCHAR HardSectorFormating : 1; - UCHAR SoftSectorFormating : 1; - UCHAR Reserved3[3]; -} MODE_FORMAT_PAGE, *PMODE_FORMAT_PAGE; -#pragma pack(pop, mode_page_format) - -// -// Define rigid disk driver geometry page. -// - -#pragma pack(push, mode_page_geometry, 1) -typedef struct _MODE_RIGID_GEOMETRY_PAGE { - UCHAR PageCode : 6; - UCHAR Reserved : 1; - UCHAR PageSavable : 1; - UCHAR PageLength; - UCHAR NumberOfCylinders[3]; - UCHAR NumberOfHeads; - UCHAR StartWritePrecom[3]; - UCHAR StartReducedCurrent[3]; - UCHAR DriveStepRate[2]; - UCHAR LandZoneCyclinder[3]; - UCHAR RotationalPositionLock : 2; - UCHAR Reserved2 : 6; - UCHAR RotationOffset; - UCHAR Reserved3; - UCHAR RoataionRate[2]; - UCHAR Reserved4[2]; -}MODE_RIGID_GEOMETRY_PAGE, *PMODE_RIGID_GEOMETRY_PAGE; -#pragma pack(pop, mode_page_geometry) - -// -// Define read write recovery page -// - -#pragma pack(push, mode_page_rw_recovery, 1) -typedef struct _MODE_READ_WRITE_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR EERBit : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR ARRE : 1; - UCHAR AWRE : 1; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - UCHAR WriteRetryCount; - UCHAR Reserved5[3]; - -} MODE_READ_WRITE_RECOVERY_PAGE, *PMODE_READ_WRITE_RECOVERY_PAGE; -#pragma pack(pop, mode_page_rw_recovery) - -// -// Define read recovery page - cdrom -// - -#pragma pack(push, mode_page_r_recovery, 1) -typedef struct _MODE_READ_RECOVERY_PAGE { - - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - UCHAR PageLength; - UCHAR DCRBit : 1; - UCHAR DTEBit : 1; - UCHAR PERBit : 1; - UCHAR Reserved2 : 1; - UCHAR RCBit : 1; - UCHAR TBBit : 1; - UCHAR Reserved3 : 2; - UCHAR ReadRetryCount; - UCHAR Reserved4[4]; - -} MODE_READ_RECOVERY_PAGE, *PMODE_READ_RECOVERY_PAGE; -#pragma pack(pop, mode_page_r_recovery) - - -// -// Define Informational Exception Control Page. Used for failure prediction -// - -#pragma pack(push, mode_page_xcpt, 1) -typedef struct _MODE_INFO_EXCEPTIONS -{ - UCHAR PageCode : 6; - UCHAR Reserved1 : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; - - union - { - UCHAR Flags; - struct - { - UCHAR LogErr : 1; - UCHAR Reserved2 : 1; - UCHAR Test : 1; - UCHAR Dexcpt : 1; - UCHAR Reserved3 : 3; - UCHAR Perf : 1; - }; - }; - - UCHAR ReportMethod : 4; - UCHAR Reserved4 : 4; - - UCHAR IntervalTimer[4]; - UCHAR ReportCount[4]; - -} MODE_INFO_EXCEPTIONS, *PMODE_INFO_EXCEPTIONS; -#pragma pack(pop, mode_page_xcpt) - -// -// Begin C/DVD 0.9 definitions -// - -// -// Power Condition Mode Page Format -// - -#pragma pack(push, mode_page_power, 1) -typedef struct _POWER_CONDITION_PAGE { - UCHAR PageCode : 6; // 0x1A - UCHAR Reserved : 1; - UCHAR PSBit : 1; - UCHAR PageLength; // 0x0A - UCHAR Reserved2; - - UCHAR Standby : 1; - UCHAR Idle : 1; - UCHAR Reserved3 : 6; - - UCHAR IdleTimer[4]; - UCHAR StandbyTimer[4]; -} POWER_CONDITION_PAGE, *PPOWER_CONDITION_PAGE; -#pragma pack(pop, mode_page_power) - -// -// CD-Audio Control Mode Page Format -// - -#pragma pack(push, mode_page_cdaudio, 1) -typedef struct _CDDA_OUTPUT_PORT { - UCHAR ChannelSelection : 4; - UCHAR Reserved : 4; - UCHAR Volume; -} CDDA_OUTPUT_PORT, *PCDDA_OUTPUT_PORT; - -typedef struct _CDAUDIO_CONTROL_PAGE { - UCHAR PageCode : 6; // 0x0E - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x0E - - UCHAR Reserved2 : 1; - UCHAR StopOnTrackCrossing : 1; // Default 0 - UCHAR Immediate : 1; // Always 1 - UCHAR Reserved3 : 5; - - UCHAR Reserved4[3]; - UCHAR Obsolete[2]; - - CDDA_OUTPUT_PORT CDDAOutputPorts[4]; - -} CDAUDIO_CONTROL_PAGE, *PCDAUDIO_CONTROL_PAGE; -#pragma pack(pop, mode_page_cdaudio) - -#define CDDA_CHANNEL_MUTED 0x0 -#define CDDA_CHANNEL_ZERO 0x1 -#define CDDA_CHANNEL_ONE 0x2 -#define CDDA_CHANNEL_TWO 0x4 -#define CDDA_CHANNEL_THREE 0x8 - -// -// C/DVD Feature Set Support & Version Page -// - -#pragma pack(push, mode_page_features, 1) -typedef struct _CDVD_FEATURE_SET_PAGE { - UCHAR PageCode : 6; // 0x18 - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x16 - - UCHAR CDAudio[2]; - UCHAR EmbeddedChanger[2]; - UCHAR PacketSMART[2]; - UCHAR PersistantPrevent[2]; - UCHAR EventStatusNotification[2]; - UCHAR DigitalOutput[2]; - UCHAR CDSequentialRecordable[2]; - UCHAR DVDSequentialRecordable[2]; - UCHAR RandomRecordable[2]; - UCHAR KeyExchange[2]; - UCHAR Reserved2[2]; -} CDVD_FEATURE_SET_PAGE, *PCDVD_FEATURE_SET_PAGE; -#pragma pack(pop, mode_page_features) - -// -// CDVD Inactivity Time-out Page Format -// - -#pragma pack(push, mode_page_timeout, 1) -typedef struct _CDVD_INACTIVITY_TIMEOUT_PAGE { - UCHAR PageCode : 6; // 0x1D - UCHAR Reserved : 1; - UCHAR PSBit : 1; - - UCHAR PageLength; // 0x08 - UCHAR Reserved2[2]; - - UCHAR SWPP : 1; - UCHAR DISP : 1; - UCHAR Reserved3 : 6; - - UCHAR Reserved4; - UCHAR GroupOneMinimumTimeout[2]; - UCHAR GroupTwoMinimumTimeout[2]; -} CDVD_INACTIVITY_TIMEOUT_PAGE, *PCDVD_INACTIVITY_TIMEOUT_PAGE; -#pragma pack(pop, mode_page_timeout) - -// -// CDVD Capabilities & Mechanism Status Page -// - -#define CDVD_LMT_CADDY 0 -#define CDVD_LMT_TRAY 1 -#define CDVD_LMT_POPUP 2 -#define CDVD_LMT_RESERVED1 3 -#define CDVD_LMT_CHANGER_INDIVIDUAL 4 -#define CDVD_LMT_CHANGER_CARTRIDGE 5 -#define CDVD_LMT_RESERVED2 6 -#define CDVD_LMT_RESERVED3 7 - - -#pragma pack(push, mode_page_capabilities, 1) -typedef struct _CDVD_CAPABILITIES_PAGE { - UCHAR PageCode : 6; // 0x2A - UCHAR Reserved : 1; - UCHAR PSBit : 1; // offset 0 - - UCHAR PageLength; // >= 0x18 // offset 1 - - UCHAR CDRRead : 1; - UCHAR CDERead : 1; - UCHAR Method2 : 1; - UCHAR DVDROMRead : 1; - UCHAR DVDRRead : 1; - UCHAR DVDRAMRead : 1; - UCHAR Reserved2 : 2; // offset 2 - - UCHAR CDRWrite : 1; - UCHAR CDEWrite : 1; - UCHAR TestWrite : 1; - UCHAR Reserved3 : 1; - UCHAR DVDRWrite : 1; - UCHAR DVDRAMWrite : 1; - UCHAR Reserved4 : 2; // offset 3 - - UCHAR AudioPlay : 1; - UCHAR Composite : 1; - UCHAR DigitalPortOne : 1; - UCHAR DigitalPortTwo : 1; - UCHAR Mode2Form1 : 1; - UCHAR Mode2Form2 : 1; - UCHAR MultiSession : 1; - UCHAR BufferUnderrunFree : 1; // offset 4 - - UCHAR CDDA : 1; - UCHAR CDDAAccurate : 1; - UCHAR RWSupported : 1; - UCHAR RWDeinterleaved : 1; - UCHAR C2Pointers : 1; - UCHAR ISRC : 1; - UCHAR UPC : 1; - UCHAR ReadBarCodeCapable : 1; // offset 5 - - UCHAR Lock : 1; - UCHAR LockState : 1; - UCHAR PreventJumper : 1; - UCHAR Eject : 1; - UCHAR Reserved6 : 1; - UCHAR LoadingMechanismType : 3; // offset 6 - - UCHAR SeparateVolume : 1; - UCHAR SeperateChannelMute : 1; - UCHAR SupportsDiskPresent : 1; - UCHAR SWSlotSelection : 1; - UCHAR SideChangeCapable : 1; - UCHAR RWInLeadInReadable : 1; - UCHAR Reserved7 : 2; // offset 7 - - union { - UCHAR ReadSpeedMaximum[2]; - UCHAR ObsoleteReserved[2]; // offset 8 - }; - - UCHAR NumberVolumeLevels[2]; // offset 10 - UCHAR BufferSize[2]; // offset 12 - - union { - UCHAR ReadSpeedCurrent[2]; - UCHAR ObsoleteReserved2[2]; // offset 14 - }; - UCHAR ObsoleteReserved3; // offset 16 - - UCHAR Reserved8 : 1; - UCHAR BCK : 1; - UCHAR RCK : 1; - UCHAR LSBF : 1; - UCHAR Length : 2; - UCHAR Reserved9 : 2; // offset 17 - - union { - UCHAR WriteSpeedMaximum[2]; - UCHAR ObsoleteReserved4[2]; // offset 18 - }; - union { - UCHAR WriteSpeedCurrent[2]; - UCHAR ObsoleteReserved11[2]; // offset 20 - }; - - // - // NOTE: This mode page is two bytes too small in the release - // version of the Windows2000 DDK. it also incorrectly - // put the CopyManagementRevision at offset 20 instead - // of offset 22, so fix that with a nameless union (for - // backwards-compatibility with those who "fixed" it on - // their own by looking at Reserved10[]). - // - - union { - UCHAR CopyManagementRevision[2]; // offset 22 - UCHAR Reserved10[2]; - }; - //UCHAR Reserved12[2]; // offset 24 - -} CDVD_CAPABILITIES_PAGE, *PCDVD_CAPABILITIES_PAGE; -#pragma pack(pop, mode_page_capabilities) - -#pragma pack(push, lun_list, 1) -typedef struct _LUN_LIST { - UCHAR LunListLength[4]; // sizeof LunSize * 8 - UCHAR Reserved[4]; -#if !defined(__midl) - UCHAR Lun[0][8]; // 4 level of addressing. 2 bytes each. -#endif -} LUN_LIST, *PLUN_LIST; -#pragma pack(pop, lun_list) - - -#define LOADING_MECHANISM_CADDY 0x00 -#define LOADING_MECHANISM_TRAY 0x01 -#define LOADING_MECHANISM_POPUP 0x02 -#define LOADING_MECHANISM_INDIVIDUAL_CHANGER 0x04 -#define LOADING_MECHANISM_CARTRIDGE_CHANGER 0x05 - -// -// end C/DVD 0.9 mode page definitions - -// -// Mode parameter list block descriptor - -// set the block length for reading/writing -// -// - -#define MODE_BLOCK_DESC_LENGTH 8 -#define MODE_HEADER_LENGTH 4 -#define MODE_HEADER_LENGTH10 8 - -#pragma pack(push, mode_parm_rw, 1) -typedef struct _MODE_PARM_READ_WRITE { - - MODE_PARAMETER_HEADER ParameterListHeader; // List Header Format - MODE_PARAMETER_BLOCK ParameterListBlock; // List Block Descriptor - -} MODE_PARM_READ_WRITE_DATA, *PMODE_PARM_READ_WRITE_DATA; -#pragma pack(pop, mode_parm_rw) - -// end_ntminitape - -// -// CDROM audio control (0x0E) -// - -#define CDB_AUDIO_PAUSE 0 -#define CDB_AUDIO_RESUME 1 - -#define CDB_DEVICE_START 0x11 -#define CDB_DEVICE_STOP 0x10 - -#define CDB_EJECT_MEDIA 0x10 -#define CDB_LOAD_MEDIA 0x01 - -#define CDB_SUBCHANNEL_HEADER 0x00 -#define CDB_SUBCHANNEL_BLOCK 0x01 - -#define CDROM_AUDIO_CONTROL_PAGE 0x0E -#define MODE_SELECT_IMMEDIATE 0x04 -#define MODE_SELECT_PFBIT 0x10 - -#define CDB_USE_MSF 0x01 - -#pragma pack(push, audio_output, 1) -typedef struct _PORT_OUTPUT { - UCHAR ChannelSelection; - UCHAR Volume; -} PORT_OUTPUT, *PPORT_OUTPUT; - -typedef struct _AUDIO_OUTPUT { - UCHAR CodePage; - UCHAR ParameterLength; - UCHAR Immediate; - UCHAR Reserved[2]; - UCHAR LbaFormat; - UCHAR LogicalBlocksPerSecond[2]; - PORT_OUTPUT PortOutput[4]; -} AUDIO_OUTPUT, *PAUDIO_OUTPUT; -#pragma pack(pop, audio_output) - -// -// Multisession CDROM -// - -#define GET_LAST_SESSION 0x01 -#define GET_SESSION_DATA 0x02; - -// -// Atapi 2.5 changer -// - -#pragma pack(push, chgr_stuff, 1) -typedef struct _MECHANICAL_STATUS_INFORMATION_HEADER { - UCHAR CurrentSlot : 5; - UCHAR ChangerState : 2; - UCHAR Fault : 1; - UCHAR Reserved : 5; - UCHAR MechanismState : 3; - UCHAR CurrentLogicalBlockAddress[3]; - UCHAR NumberAvailableSlots; - UCHAR SlotTableLength[2]; -} MECHANICAL_STATUS_INFORMATION_HEADER, *PMECHANICAL_STATUS_INFORMATION_HEADER; - -typedef struct _SLOT_TABLE_INFORMATION { - UCHAR DiscChanged : 1; - UCHAR Reserved : 6; - UCHAR DiscPresent : 1; - UCHAR Reserved2[3]; -} SLOT_TABLE_INFORMATION, *PSLOT_TABLE_INFORMATION; - -typedef struct _MECHANICAL_STATUS { - MECHANICAL_STATUS_INFORMATION_HEADER MechanicalStatusHeader; - SLOT_TABLE_INFORMATION SlotTableInfo[1]; -} MECHANICAL_STATUS, *PMECHANICAL_STATUS; -#pragma pack(pop, chgr_stuff) - - -// begin_ntminitape - -// -// Tape definitions -// - -#pragma pack(push, tape_position, 1) -typedef struct _TAPE_POSITION_DATA { - UCHAR Reserved1:2; - UCHAR BlockPositionUnsupported:1; - UCHAR Reserved2:3; - UCHAR EndOfPartition:1; - UCHAR BeginningOfPartition:1; - UCHAR PartitionNumber; - USHORT Reserved3; - UCHAR FirstBlock[4]; - UCHAR LastBlock[4]; - UCHAR Reserved4; - UCHAR NumberOfBlocks[3]; - UCHAR NumberOfBytes[4]; -} TAPE_POSITION_DATA, *PTAPE_POSITION_DATA; -#pragma pack(pop, tape_position) - -// -// This structure is used to convert little endian -// ULONGs to SCSI CDB big endians values. -// - -#pragma pack(push, byte_stuff, 1) -typedef union _EIGHT_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - UCHAR Byte4; - UCHAR Byte5; - UCHAR Byte6; - UCHAR Byte7; - }; - - ULONGLONG AsULongLong; -} EIGHT_BYTE, *PEIGHT_BYTE; - -typedef union _FOUR_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - UCHAR Byte2; - UCHAR Byte3; - }; - - ULONG AsULong; -} FOUR_BYTE, *PFOUR_BYTE; - -typedef union _TWO_BYTE { - - struct { - UCHAR Byte0; - UCHAR Byte1; - }; - - USHORT AsUShort; -} TWO_BYTE, *PTWO_BYTE; -#pragma pack(pop, byte_stuff) - -// -// Byte reversing macro for converting -// between big- and little-endian formats -// - -#define REVERSE_BYTES_QUAD(Destination, Source) { \ - PEIGHT_BYTE d = (PEIGHT_BYTE)(Destination); \ - PEIGHT_BYTE s = (PEIGHT_BYTE)(Source); \ - d->Byte7 = s->Byte0; \ - d->Byte6 = s->Byte1; \ - d->Byte5 = s->Byte2; \ - d->Byte4 = s->Byte3; \ - d->Byte3 = s->Byte4; \ - d->Byte2 = s->Byte5; \ - d->Byte1 = s->Byte6; \ - d->Byte0 = s->Byte7; \ -} - -#define REVERSE_BYTES(Destination, Source) { \ - PFOUR_BYTE d = (PFOUR_BYTE)(Destination); \ - PFOUR_BYTE s = (PFOUR_BYTE)(Source); \ - d->Byte3 = s->Byte0; \ - d->Byte2 = s->Byte1; \ - d->Byte1 = s->Byte2; \ - d->Byte0 = s->Byte3; \ -} - -#define REVERSE_BYTES_SHORT(Destination, Source) { \ - PTWO_BYTE d = (PTWO_BYTE)(Destination); \ - PTWO_BYTE s = (PTWO_BYTE)(Source); \ - d->Byte1 = s->Byte0; \ - d->Byte0 = s->Byte1; \ -} - -// -// Byte reversing macro for converting -// USHORTS from big to little endian in place -// - -#define REVERSE_SHORT(Short) { \ - UCHAR tmp; \ - PTWO_BYTE w = (PTWO_BYTE)(Short); \ - tmp = w->Byte0; \ - w->Byte0 = w->Byte1; \ - w->Byte1 = tmp; \ - } - -// -// Byte reversing macro for convering -// ULONGS between big & little endian in place -// - -#define REVERSE_LONG(Long) { \ - UCHAR tmp; \ - PFOUR_BYTE l = (PFOUR_BYTE)(Long); \ - tmp = l->Byte3; \ - l->Byte3 = l->Byte0; \ - l->Byte0 = tmp; \ - tmp = l->Byte2; \ - l->Byte2 = l->Byte1; \ - l->Byte1 = tmp; \ - } - -// -// This macro has the effect of Bit = log2(Data) -// - -#define WHICH_BIT(Data, Bit) { \ - UCHAR tmp; \ - for (tmp = 0; tmp < 32; tmp++) { \ - if (((Data) >> tmp) == 1) { \ - break; \ - } \ - } \ - ASSERT(tmp != 32); \ - (Bit) = tmp; \ -} - - -// -// For backwards compatability, use SCSIPORT definitions. -// - -typedef PHYSICAL_ADDRESS STOR_PHYSICAL_ADDRESS, *PSTOR_PHYSICAL_ADDRESS; - -typedef struct _ACCESS_RANGE { - STOR_PHYSICAL_ADDRESS RangeStart; - ULONG RangeLength; - BOOLEAN RangeInMemory; -} ACCESS_RANGE, *PACCESS_RANGE; - -// -// _MEMORY_REGION represents a region of physical contiguous memory. -// Generally, this is used for DMA common buffer regions. -// - -typedef struct _MEMORY_REGION { - - // - // Beginning virtual address of the region. - // - - PUCHAR VirtualBase; - - // - // Beginning physical address of the region. - // - - PHYSICAL_ADDRESS PhysicalBase; - - // - // Length of the region - // - // - - ULONG Length; - -} MEMORY_REGION, *PMEMORY_REGION; - - -typedef enum _STOR_SYNCHRONIZATION_MODEL { - StorSynchronizeHalfDuplex, - StorSynchronizeFullDuplex -} STOR_SYNCHRONIZATION_MODEL; - -typedef enum _INTERRUPT_SYNCHRONIZATION_MODE { - InterruptSupportNone, - InterruptSynchronizeAll, - InterruptSynchronizePerMessage -} INTERRUPT_SYNCHRONIZATION_MODE; - -typedef -BOOLEAN -(*PHW_MESSAGE_SIGNALED_INTERRUPT_ROUTINE) ( - IN PVOID HwDeviceExtension, - IN ULONG MessageId - ); - -// -// Message signalled interrupts support. -// - -typedef struct _MESSAGE_INTERRUPT_INFORMATION { - ULONG MessageId; - ULONG MessageData; - STOR_PHYSICAL_ADDRESS MessageAddress; - ULONG InterruptVector; - ULONG InterruptLevel; - KINTERRUPT_MODE InterruptMode; -} MESSAGE_INTERRUPT_INFORMATION, *PMESSAGE_INTERRUPT_INFORMATION; - - -BOOLEAN -StorPortGetMessageInterruptInformation( - __in PVOID HwDeviceExtension, - __in ULONG MessageId, - __out PMESSAGE_INTERRUPT_INFORMATION InterruptInfo - ); -#define STOR_MAP_NO_BUFFERS (0) -#define STOR_MAP_ALL_BUFFERS (1) -#define STOR_MAP_NON_READ_WRITE_BUFFERS (2) - -// ExtendedFlags1 flags - -#define EXTENDED_FLAG_POWER 0x00000001 -// -// Configuration information structure. Contains the information necessary -// to initialize the adapter. NOTE: This structure must be a multiple of -// quadwords. -// - -typedef struct _PORT_CONFIGURATION_INFORMATION { - - // - // Length of port configuation information strucuture. - // - - ULONG Length; - - // - // IO bus number (0 for machines that have only 1 IO bus - // - - ULONG SystemIoBusNumber; - - // - // EISA, MCA or ISA - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Interrupt request level for device - // - - ULONG BusInterruptLevel; - - // - // Bus interrupt vector used with hardware buses which use as vector as - // well as level, such as internal buses. - // - - ULONG BusInterruptVector; - - // - // Interrupt mode (level-sensitive or edge-triggered) - // - - KINTERRUPT_MODE InterruptMode; - - // - // Maximum number of bytes that can be transferred in a single SRB - // - - ULONG MaximumTransferLength; - - // - // Number of contiguous blocks of physical memory - // - - ULONG NumberOfPhysicalBreaks; - - // - // DMA channel for devices using system DMA - // - - ULONG DmaChannel; - ULONG DmaPort; - DMA_WIDTH DmaWidth; - DMA_SPEED DmaSpeed; - - // - // Alignment masked required by the adapter for data transfers. - // - - ULONG AlignmentMask; - - // - // Number of access range elements which have been allocated. - // - - ULONG NumberOfAccessRanges; - - // - // Pointer to array of access range elements. - // - - ACCESS_RANGE (*AccessRanges)[]; - - // - // Reserved field. - // - - PVOID Reserved; - - // - // Number of SCSI buses attached to the adapter. - // - - UCHAR NumberOfBuses; - - // - // SCSI bus ID for adapter - // - - CCHAR InitiatorBusId[8]; - - // - // Indicates that the adapter does scatter/gather - // - - BOOLEAN ScatterGather; - - // - // Indicates that the adapter is a bus master - // - - BOOLEAN Master; - - // - // Host caches data or state. - // - - BOOLEAN CachesData; - - // - // Host adapter scans down for bios devices. - // - - BOOLEAN AdapterScansDown; - - // - // Primary at disk address (0x1F0) claimed. - // - - BOOLEAN AtdiskPrimaryClaimed; - - // - // Secondary at disk address (0x170) claimed. - // - - BOOLEAN AtdiskSecondaryClaimed; - - // - // The master uses 32-bit DMA addresses. - // - - BOOLEAN Dma32BitAddresses; - - // - // Use Demand Mode DMA rather than Single Request. - // - - BOOLEAN DemandMode; - - // - // Data buffers must be mapped into virtual address space. - // - - UCHAR MapBuffers; - - // - // The driver will need to tranlate virtual to physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Supports tagged queuing - // - - BOOLEAN TaggedQueuing; - - // - // Supports auto request sense. - // - - BOOLEAN AutoRequestSense; - - // - // Supports multiple requests per logical unit. - // - - BOOLEAN MultipleRequestPerLu; - - // - // Support receive event function. - // - - BOOLEAN ReceiveEvent; - - // - // Indicates the real-mode driver has initialized the card. - // - - BOOLEAN RealModeInitialized; - - // - // Indicate that the miniport will not touch the data buffers directly. - // - - BOOLEAN BufferAccessScsiPortControlled; - - // - // Indicator for wide scsi. - // - - UCHAR MaximumNumberOfTargets; - - // - // Ensure quadword alignment. - // - - UCHAR ReservedUchars[2]; - - // - // Adapter slot number - // - - ULONG SlotNumber; - - // - // Interrupt information for a second IRQ. - // - - ULONG BusInterruptLevel2; - ULONG BusInterruptVector2; - KINTERRUPT_MODE InterruptMode2; - - // - // DMA information for a second channel. - // - - ULONG DmaChannel2; - ULONG DmaPort2; - DMA_WIDTH DmaWidth2; - DMA_SPEED DmaSpeed2; - - // - // Fields added to allow for the miniport - // to update these sizes based on requirements - // for large transfers ( > 64K); - // - - ULONG DeviceExtensionSize; - ULONG SpecificLuExtensionSize; - ULONG SrbExtensionSize; - - // - // Used to determine whether the system and/or the miniport support - // 64-bit physical addresses. See SCSI_DMA64_* flags below. - // - - UCHAR Dma64BitAddresses; /* New */ - - // - // Indicates that the miniport can accept a SRB_FUNCTION_RESET_DEVICE - // to clear all requests to a particular LUN. - // - - BOOLEAN ResetTargetSupported; /* New */ - - // - // Indicates that the miniport can support more than 8 logical units per - // target (maximum LUN number is one less than this field). - // - - UCHAR MaximumNumberOfLogicalUnits; /* New */ - - // - // Supports WMI? - // - - BOOLEAN WmiDataProvider; - - // - // STORPORT synchronization model, either half or full duplex - // depending on whether the driver supports async-with-interrupt - // model or not. - // - - STOR_SYNCHRONIZATION_MODEL SynchronizationModel; // STORPORT New - - PHW_MESSAGE_SIGNALED_INTERRUPT_ROUTINE HwMSInterruptRoutine; - - INTERRUPT_SYNCHRONIZATION_MODE InterruptSynchronizationMode; - - MEMORY_REGION DumpRegion; - - ULONG RequestedDumpBufferSize; - - BOOLEAN VirtualDevice; - - ULONG ExtendedFlags1; - - ULONG MaxNumberOfIO; - - -} PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION; - - -// -// Scatter/gather lists -// - -typedef struct _STOR_SCATTER_GATHER_ELEMENT { - STOR_PHYSICAL_ADDRESS PhysicalAddress; - ULONG Length; - ULONG_PTR Reserved; -} STOR_SCATTER_GATHER_ELEMENT, *PSTOR_SCATTER_GATHER_ELEMENT; - -typedef struct _STOR_SCATTER_GATHER_LIST { - ULONG NumberOfElements; - ULONG_PTR Reserved; - STOR_SCATTER_GATHER_ELEMENT List[]; -} STOR_SCATTER_GATHER_LIST, *PSTOR_SCATTER_GATHER_LIST; - - -typedef enum _GETSGSTATUS{ - SG_ALLOCATED = 0, - SG_BUFFER_TOO_SMALL -} GETSGSTATUS, *PGETSGSTATUS; - -// -// Version control for ConfigInfo structure. -// - -#define CONFIG_INFO_VERSION_2 sizeof(PORT_CONFIGURATION_INFORMATION) - - -// -// Flags for controlling 64-bit DMA use (PORT_CONFIGURATION_INFORMATION field -// Dma64BitAddresses) -// - -// -// Set by scsiport on entering HwFindAdapter if the system can support 64-bit -// physical addresses. The miniport can use this information before calling -// ScsiPortGetUncachedExtension to modify the DeviceExtensionSize, -// SpecificLuExtensionSize & SrbExtensionSize fields to account for the extra -// size of the scatter gather list. -// - -#define SCSI_DMA64_SYSTEM_SUPPORTED 0x80 - -// -// Set by the miniport before returning from HwFindAdapter to tell the port -// driver that we support 64-bit physical addresses on I/O transfers. The -// port driver will still allocate Uncached Extension, SenseInfo and Srb -// Extension below 4GB, but I/O transfers will not be remapped. -// - - -#define SCSI_DMA64_MINIPORT_SUPPORTED 0x01 - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -// -// Set by the miniport before returning from HwFindAdpater to tell the port -// driver that we support full 64-bit addressing. This means I/O requests -// may be handled with > 4GB physical addresses, and uncached extension, -// SenseInof and Srb Extension may all lie above 4GB. -// - -#define SCSI_DMA64_MINIPORT_FULL64BIT_SUPPORTED 0x02 -#endif - -// -// Command type (and parameter) definition(s) for AdapterControl requests. -// - -typedef enum _SCSI_ADAPTER_CONTROL_TYPE { - ScsiQuerySupportedControlTypes = 0, - ScsiStopAdapter, - ScsiRestartAdapter, - ScsiSetBootConfig, - ScsiSetRunningConfig, - ScsiAdapterControlMax, - MakeAdapterControlTypeSizeOfUlong = 0xffffffff -} SCSI_ADAPTER_CONTROL_TYPE, *PSCSI_ADAPTER_CONTROL_TYPE; - -// -// Adapter control status values -// - -typedef enum _SCSI_ADAPTER_CONTROL_STATUS { - ScsiAdapterControlSuccess = 0, - ScsiAdapterControlUnsuccessful -} SCSI_ADAPTER_CONTROL_STATUS, *PSCSI_ADAPTER_CONTROL_STATUS; - -// -// Parameters for Adapter Control Functions: -// - -// -// ScsiQuerySupportedControlTypes: -// - -typedef struct _SCSI_SUPPORTED_CONTROL_TYPE_LIST { - - // - // Specifies the number of entries in the adapter control type list. - // - - ULONG MaxControlType; - - // - // The miniport will set TRUE for each control type it supports. - // The number of entries in this array is defined by MaxAdapterControlType - // - the miniport must not attempt to set any AC types beyond the maximum - // value specified. - // - - BOOLEAN SupportedTypeList[0]; - -} SCSI_SUPPORTED_CONTROL_TYPE_LIST, *PSCSI_SUPPORTED_CONTROL_TYPE_LIST; - -// -// DPC Data Structure -// - -typedef struct _DPC_BUFFER { - CSHORT Type; - UCHAR Number; - UCHAR Importance; - struct { - PVOID F; - PVOID B; - }; - PVOID DeferredRoutine; - PVOID DeferredContext; - PVOID SystemArgument1; - PVOID SystemArgument2; - PVOID DpcData; -} DPC_BUFFER; - -#define STOR_DPC_BUFFER_SIZE (sizeof (DPC_BUFFER)) - -typedef struct _STOR_DPC { - DPC_BUFFER Dpc; - ULONG_PTR Lock; -} STOR_DPC, *PSTOR_DPC; - -typedef enum _STOR_SPINLOCK { - DpcLock = 1, - StartIoLock, - InterruptLock -} STOR_SPINLOCK; - -typedef struct _STOR_LOCK_HANDLE { - STOR_SPINLOCK Lock; - struct { - struct { - PVOID Next; - PVOID Lock; - } LockQueue; - KIRQL OldIrql; - } Context; -} STOR_LOCK_HANDLE, *PSTOR_LOCK_HANDLE; - -#define STOR_PERF_DPC_REDIRECTION 0x00000001 -#define STOR_PERF_CONCURRENT_CHANNELS 0x00000002 -#define STOR_PERF_INTERRUPT_MESSAGE_RANGES 0x00000004 -#define STOR_PERF_ADV_CONFIG_LOCALITY 0x00000008 -#define STOR_PERF_OPTIMIZE_FOR_COMPLETION_DURING_STARTIO 0x00000010 - -#define STOR_PERF_VERSION 0x00000003 - -typedef struct _PERF_CONFIGURATION_DATA { - ULONG Version; - ULONG Size; - ULONG Flags; - ULONG ConcurrentChannels; - ULONG FirstRedirectionMessageNumber, LastRedirectionMessageNumber; - ULONG DeviceNode; - ULONG Reserved; - PGROUP_AFFINITY MessageTargets; -} PERF_CONFIGURATION_DATA, *PPERF_CONFIGURATION_DATA; - -typedef struct _STARTIO_PERFORMANCE_PARAMETERS { - ULONG Version; - ULONG Size; - ULONG MessageNumber; - ULONG ChannelNumber; -} STARTIO_PERFORMANCE_PARAMETERS, *PSTARTIO_PERFORMANCE_PARAMETERS; - -// -// SCSI Adapter Dependent Routines -// - -typedef -BOOLEAN -(*PHW_INITIALIZE) ( - __in PVOID DeviceExtension - ); - -typedef -BOOLEAN -(*PHW_BUILDIO) ( - __in PVOID DeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb - ); - -typedef -BOOLEAN -(*PHW_STARTIO) ( - __in PVOID DeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb - ); - -typedef -BOOLEAN -(*PHW_INTERRUPT) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_TIMER) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_DMA_STARTED) ( - __in PVOID DeviceExtension - ); - -typedef -ULONG -(*PHW_FIND_ADAPTER) ( - __in PVOID DeviceExtension, - __in PVOID HwContext, - __in PVOID BusInformation, - __in PCHAR ArgumentString, - __inout PPORT_CONFIGURATION_INFORMATION ConfigInfo, - __out PBOOLEAN Again - ); - -typedef -BOOLEAN -(*PHW_RESET_BUS) ( - __in PVOID DeviceExtension, - __in ULONG PathId - ); - -typedef -BOOLEAN -(*PHW_ADAPTER_STATE) ( - __in PVOID DeviceExtension, - __in PVOID Context, - __in BOOLEAN SaveState - ); - -typedef -SCSI_ADAPTER_CONTROL_STATUS -(*PHW_ADAPTER_CONTROL) ( - __in PVOID DeviceExtension, - __in SCSI_ADAPTER_CONTROL_TYPE ControlType, - __in PVOID Parameters - ); - -typedef -BOOLEAN -(*PHW_PASSIVE_INITIALIZE_ROUTINE)( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_DPC_ROUTINE)( - __in PSTOR_DPC Dpc, - __in PVOID HwDeviceExtension, - __in PVOID SystemArgument1, - __in PVOID SystemArgument2 - ); - -typedef -BOOLEAN -(*PStorPortGetMessageInterruptInformation)( - __in PVOID HwDeviceExtension, - __in ULONG MessageId, - __out PMESSAGE_INTERRUPT_INFORMATION InterruptInfo - ); -typedef -VOID -(*PStorPortPutScatterGatherList) ( - __in PVOID HwDeviceExtension, - __in PSTOR_SCATTER_GATHER_LIST ScatterGatherList, - __in BOOLEAN WriteToDevice - ); -typedef -VOID - (*PpostScaterGatherExecute)( - __in PVOID *DeviceObject, - __in PVOID *Irp, - __in PSTOR_SCATTER_GATHER_LIST ScatterGather, - __in PVOID Context - ); - -typedef -GETSGSTATUS -(*PStorPortBuildScatterGatherList) ( - __in PVOID HwDeviceExtension, - __in PVOID Mdl, - __in_bcount(Length) PVOID CurrentVa, - __in ULONG Length, - __in PpostScaterGatherExecute ExecutionRoutine, - __in PVOID Context, - __in BOOLEAN WriteToDevice, - __inout_bcount(ScatterGatherBufferLength) PVOID ScatterGatherBuffer, - __in ULONG ScatterGatherBufferLength - ); -typedef - -VOID -(*PStorPortFreePool)( - __in __drv_freesMem(Mem) PVOID PMemory, - __in PVOID HwDeviceExtension, - __in_opt __drv_freesMem(Mem) PVOID PMdl - ); -typedef - -__drv_allocatesMem(Mem) -__bcount(NumberOfBytes) -PVOID -(*PStorPortAllocatePool)( - __in ULONG NumberOfBytes, - __in ULONG Tag, - __in PVOID HwDeviceExtension, - __out __deref __drv_when(return==0, __drv_valueIs(==0)) - __deref __drv_when(return!=0, __drv_aliasesMem __drv_allocatesMem(Mem) __drv_valueIs(!=0)) - PVOID *PMdl - ); - -typedef -PVOID -(*PStorPortGetSystemAddress)( - __in PSCSI_REQUEST_BLOCK Srb - ); - -typedef -ULONG -(*PStorPortAcquireMSISpinLock)( - __in PVOID HwDeviceExtension, - __in ULONG MessageID - ); -typedef -VOID -(*PStorPortReleaseMSISpinLock)( - __in PVOID HwDeviceExtension, - __in ULONG MessageID, - __in ULONG OldIrql - ); - -typedef -VOID -(*PStorPortCompleteServiceIrp)( - __in PVOID HwDeviceExtension, - __in PVOID Irp - ); -typedef -PVOID -(*PStorPortGetOriginalMdl)( - __in PSCSI_REQUEST_BLOCK Srb - ); - -typedef struct _STORPORT_EXTENDED_FUNCTIONS { - - ULONG Version; - - // Port extended services - PStorPortGetMessageInterruptInformation GetMessageInterruptInformation; - PStorPortPutScatterGatherList PutScatterGatherList; - PStorPortBuildScatterGatherList BuildScatterGatherList; - PStorPortFreePool FreePool; - PStorPortAllocatePool AllocatePool; - PStorPortGetSystemAddress GetSystemAddress; - PStorPortAcquireMSISpinLock AcquireMSISpinLock; - PStorPortReleaseMSISpinLock ReleaseMSISpinLock; - PStorPortCompleteServiceIrp CompleteServiceIrp; - PStorPortGetOriginalMdl GetOriginalMdl; -} STORPORT_EXTENDED_FUNCTIONS, *PSTORPORT_EXTENDED_FUNCTIONS; - - -typedef enum _STORPORT_FUNCTION_CODE { - ExtFunctionAllocatePool, - ExtFunctionFreePool, - ExtFunctionAllocateMdl, - ExtFunctionFreeMdl, - ExtFunctionBuildMdlForNonPagedPool, - ExtFunctionGetSystemAddress, - ExtFunctionGetOriginalMdl, - ExtFunctionCompleteServiceIrp, - ExtFunctionGetDeviceObjects, - ExtFunctionBuildScatterGatherList, - ExtFunctionPutScatterGatherList, - ExtFunctionAcquireMSISpinLock, - ExtFunctionReleaseMSISpinLock, - ExtFunctionGetMessageInterruptInformation, - ExtFunctionInitializePerformanceOptimizations, - ExtFunctionGetStartIoPerformanceParameters, - ExtFunctionLogSystemEvent, - ExtFunctionGetCurrentProcessorNumber, - ExtFunctionGetActiveGroupCount, - ExtFunctionGetGroupAffinity, - ExtFunctionGetActiveNodeCount, - ExtFunctionGetNodeAffinity, - ExtFunctionGetHighestNodeNumber, - ExtFunctionGetLogicalProcessorRelationship, - ExtFunctionAllocateContiguousMemorySpecifyCacheNode, - ExtFunctionFreeContiguousMemorySpecifyCache -} STORPORT_FUNCTION_CODE, *PSTORPORT_FUNCTION_CODE; - - -// -// Storage port driver status codes -// This is the storage equivalent of NTSTATUS -// - -#define STOR_STATUS_SUCCESS (0x00000000L) -#define STOR_STATUS_UNSUCCESSFUL (0xC1000001L) -#define STOR_STATUS_NOT_IMPLEMENTED (0xC1000002L) -#define STOR_STATUS_INSUFFICIENT_RESOURCES (0xC1000003L) -#define STOR_STATUS_BUFFER_TOO_SMALL (0xC1000004L) -#define STOR_STATUS_ACCESS_DENIED (0xC1000005L) -#define STOR_STATUS_INVALID_PARAMETER (0xC1000006L) -#define STOR_STATUS_INVALID_DEVICE_REQUEST (0xC1000007L) -#define STOR_STATUS_INVALID_IRQL (0xC1000008L) -#define STOR_STATUS_INVALID_DEVICE_STATE (0xC1000009L) -#define STOR_STATUS_INVALID_BUFFER_SIZE (0xC100000AL) -#define STOR_STATUS_UNSUPPORTED_VERSION (0xC100000BL) - -// -// Port driver error codes -// - -#define SP_BUS_PARITY_ERROR 0x0001 -#define SP_UNEXPECTED_DISCONNECT 0x0002 -#define SP_INVALID_RESELECTION 0x0003 -#define SP_BUS_TIME_OUT 0x0004 -#define SP_PROTOCOL_ERROR 0x0005 -#define SP_INTERNAL_ADAPTER_ERROR 0x0006 -#define SP_REQUEST_TIMEOUT 0x0007 -#define SP_IRQ_NOT_RESPONDING 0x0008 -#define SP_BAD_FW_WARNING 0x0009 -#define SP_BAD_FW_ERROR 0x000a -#define SP_LOST_WMI_MINIPORT_REQUEST 0x000b - -// -// Port driver version flags -// -#define SP_VER_TRACE_SUPPORT 0x0010 - -// -// Return values for SCSI_HW_FIND_ADAPTER. -// - -#define SP_RETURN_NOT_FOUND 0 -#define SP_RETURN_FOUND 1 -#define SP_RETURN_ERROR 2 -#define SP_RETURN_BAD_CONFIG 3 - -// -// Notification Event Types -// - -typedef enum _SCSI_NOTIFICATION_TYPE { - RequestComplete, - NextRequest, - NextLuRequest, - ResetDetected, - _obsolete1, // STORPORT: CallDisableInterrupts has been removed - _obsolete2, // STORPORT: CallEnableInterrupts has been removed - RequestTimerCall, - BusChangeDetected, - WMIEvent, - WMIReregister, - LinkUp, - LinkDown, - QueryTickCount, - BufferOverrunDetected, - TraceNotification, - GetExtendedFunctionTable, - - EnablePassiveInitialization = 0x1000, - InitializeDpc, - IssueDpc, - AcquireSpinLock, - ReleaseSpinLock - -} SCSI_NOTIFICATION_TYPE, *PSCSI_NOTIFICATION_TYPE; - -// -// Structure passed between miniport initialization -// and SCSI port initialization -// - -typedef struct _HW_INITIALIZATION_DATA { - - ULONG HwInitializationDataSize; - - // - // Adapter interface type: - // - // Internal - // Isa - // Eisa - // MicroChannel - // TurboChannel - // PCIBus - // VMEBus - // NuBus - // PCMCIABus - // CBus - // MPIBus - // MPSABus - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Miniport driver routines - // - - PHW_INITIALIZE HwInitialize; - - PHW_STARTIO HwStartIo; - - PHW_INTERRUPT HwInterrupt; - - PHW_FIND_ADAPTER HwFindAdapter; - - PHW_RESET_BUS HwResetBus; - - PHW_DMA_STARTED HwDmaStarted; - - PHW_ADAPTER_STATE HwAdapterState; - - // - // Miniport driver resources - // - - ULONG DeviceExtensionSize; - - ULONG SpecificLuExtensionSize; - - ULONG SrbExtensionSize; - - ULONG NumberOfAccessRanges; - - PVOID Reserved; - - // - // Data buffers must be mapped into virtual address space. - // - - UCHAR MapBuffers; - - // - // The driver will need to tranlate virtual to physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Supports tagged queuing - // - - BOOLEAN TaggedQueuing; - - // - // Supports auto request sense. - // - - BOOLEAN AutoRequestSense; - - // - // Supports multiple requests per logical unit. - // - - BOOLEAN MultipleRequestPerLu; - - // - // Support receive event function. - // - - BOOLEAN ReceiveEvent; - - // - // Vendor identification length - // - - USHORT VendorIdLength; - - // - // Vendor identification - // - - PVOID VendorId; - - // - // Pad for alignment and future use. - // - - union { - - USHORT ReservedUshort; - - // - // Flags to indicate supported features - // - USHORT PortVersionFlags; - }; - - // - // Device identification length - // - - USHORT DeviceIdLength; - - // - // Device identification - // - - PVOID DeviceId; - - // - // Stop adapter routine. - // - - PHW_ADAPTER_CONTROL HwAdapterControl; - - // - // Initialize to the Build IO routine if one is supported, otherwise - // should be NULL. - // - - PHW_BUILDIO HwBuildIo; // STORPORT New - -} HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA; - - -// Virtual driver HW_INIT_DATA -typedef -VOID -(*PHW_FREE_ADAPTER_RESOURCES) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_PROCESS_SERVICE_REQUEST) ( - __in PVOID DeviceExtension, - __in PVOID Irp - ); - -typedef -VOID -(*PHW_COMPLETE_SERVICE_IRP) ( - __in PVOID DeviceExtension - ); - -typedef -VOID -(*PHW_INITIALIZE_TRACING) ( - __in PVOID Arg1, - __in PVOID Arg2 - ); - -typedef -VOID -(*PHW_CLEANUP_TRACING) ( - __in PVOID Arg1 - ); -typedef -ULONG -(*PVIRTUAL_HW_FIND_ADAPTER) ( - __in PVOID DeviceExtension, - __in PVOID HwContext, - __in PVOID BusInformation, - __in PVOID LowerDevice, - __in PCHAR ArgumentString, - __inout PPORT_CONFIGURATION_INFORMATION ConfigInfo, - __out PBOOLEAN Again - ); - -typedef struct _VIRTUAL_HW_INITIALIZATION_DATA { - - ULONG HwInitializationDataSize; - - // - // Adapter interface type: - // - // Internal - // Isa - // Eisa - // MicroChannel - // TurboChannel - // PCIBus - // VMEBus - // NuBus - // PCMCIABus - // CBus - // MPIBus - // MPSABus - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Miniport driver routines - // - - PHW_INITIALIZE HwInitialize; - - PHW_STARTIO HwStartIo; - - PHW_INTERRUPT HwInterrupt; - - PVIRTUAL_HW_FIND_ADAPTER HwFindAdapter; - - PHW_RESET_BUS HwResetBus; - - PHW_DMA_STARTED HwDmaStarted; - - PHW_ADAPTER_STATE HwAdapterState; - - // - // Miniport driver resources - // - - ULONG DeviceExtensionSize; - - ULONG SpecificLuExtensionSize; - - ULONG SrbExtensionSize; - - ULONG NumberOfAccessRanges; - - PVOID Reserved; - - // - // Data buffers must be mapped into virtual address space. - // - - UCHAR MapBuffers; - - // - // The driver will need to tranlate virtual to physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Supports tagged queuing - // - - BOOLEAN TaggedQueuing; - - // - // Supports auto request sense. - // - - BOOLEAN AutoRequestSense; - - // - // Supports multiple requests per logical unit. - // - - BOOLEAN MultipleRequestPerLu; - - // - // Support receive event function. - // - - BOOLEAN ReceiveEvent; - - // - // Vendor identification length - // - - USHORT VendorIdLength; - - // - // Vendor identification - // - - PVOID VendorId; - - // - // Pad for alignment and future use. - // - - union { - - USHORT ReservedUshort; - - // - // Flags to indicate supported features - // - USHORT PortVersionFlags; - }; - - // - // Device identification length - // - - USHORT DeviceIdLength; - - // - // Device identification - // - - PVOID DeviceId; - - // - // Stop adapter routine. - // - - PHW_ADAPTER_CONTROL HwAdapterControl; - - // - // Initialize to the Build IO routine if one is supported, otherwise - // should be NULL. - // - - PHW_BUILDIO HwBuildIo; // STORPORT New - - PHW_FREE_ADAPTER_RESOURCES HwFreeAdapterResources; - - PHW_PROCESS_SERVICE_REQUEST HwProcessServiceRequest; - - PHW_COMPLETE_SERVICE_IRP HwCompleteServiceIrp; - - // - // Functions for enabling tracing in miniport - // - PHW_INITIALIZE_TRACING HwInitializeTracing; - PHW_CLEANUP_TRACING HwCleanupTracing; - - - -} VIRTUAL_HW_INITIALIZATION_DATA, *PVIRTUAL_HW_INITIALIZATION_DATA; - -#define DUMP_MINIPORT_VERSION_1 0x0100 -#define DUMP_MINIPORT_VERSION 0x0200 -#define DUMP_MINIPORT_NAME_LENGTH 15 - -typedef struct _MINIPORT_MAPPINGS { - - // - // Structure version - // - USHORT Version; - - // Pointer to iBF Table - // - PVOID IBFTable; - - // - // Pointer to Nic0 memory map. - // - PVOID Nic0Map; - - // - // Pointer to Nic1 memory map. - // - PVOID Nic1Map; - - // - // Number of additional NICs. - // - ULONG NumberOfAdditionalNic; - - // - // Pointer to memory Map for additional NICs bounded by the number in - // NumberOfAdditionalNic; - // - PVOID NicMap[]; - -} MINIPORT_MAPPINGS, *PMINIPORT_MAPPINGS; - - - - -typedef struct _MINIPORT_DUMP_POINTERS { - - // - // Structure version - // - USHORT Version; - - // - // Structure size - // - USHORT Size; - - // - // Dump miniport name - // - WCHAR DriverName[DUMP_MINIPORT_NAME_LENGTH]; - - // - // Pointer to the DMA adapter object - // - - struct _ADAPTER_OBJECT *AdapterObject; - - // - // Register base - // - PVOID MappedRegisterBase; - - // - // Common buffer size, must be <= 64KB - // - ULONG CommonBufferSize; - - // - // Pointer which is passed to dump driver through port configuration. - // - PVOID MiniportPrivateDumpData; - - // - // The following members are part of the - // PORT_CONFIGURATION_INFORMATION structure - // - - ULONG SystemIoBusNumber; - - INTERFACE_TYPE AdapterInterfaceType; - - ULONG MaximumTransferLength; - - ULONG NumberOfPhysicalBreaks; - - ULONG AlignmentMask; - - ULONG NumberOfAccessRanges; - - ACCESS_RANGE (*AccessRanges)[]; - - UCHAR NumberOfBuses; - - BOOLEAN Master; - - BOOLEAN MapBuffers; - - UCHAR MaximumNumberOfTargets; - -} MINIPORT_DUMP_POINTERS, *PMINIPORT_DUMP_POINTERS; - - - -// -// Structure used with StorPortLogSystemEvent -// (and related definitions) -// -// The structure should be zeroed before use to enable future expansion -// and backward compatability. The low byte of the interface revision is used to distinguish -// between minor changes in the interface that are still backward compatible. -// - -#define STOR_CURRENT_LOG_INTERFACE_REVISION 0x0100 - -typedef enum _STOR_EVENT_ASSOCIATION_ENUM { - StorEventAdapterAssociation = 0, // Event is associated with the adapter - StorEventLunAssociation, // Event is associated with the LUN - StorEventTargetAssociation, // Event is associated with the target - StorEventInvalidAssociation // Marks end of valid enumeration range -} STOR_EVENT_ASSOCIATION_ENUM; - -typedef struct _STOR_LOG_EVENT_DETAILS { - ULONG InterfaceRevision; // Revision of this interface (use STOR_CURRENT_LOG_INTERFACE_REVISION) - ULONG Size; // Size of this structure (fill in before passing to Storport) - ULONG Flags; // Special flags to control this interface (none currently defined) - STOR_EVENT_ASSOCIATION_ENUM EventAssociation; // See STOR_EVENT_ASSOCIATION_ENUM enumeration - ULONG PathId; // Path portion of SCSI address - ULONG TargetId; // Target portion of SCSI address - ULONG LunId; // LUN portion of SCSI address - BOOLEAN StorportSpecificErrorCode; // TRUE if error code is specific to Storport (SP_xxx) - ULONG ErrorCode; // Error code, either SP_xxx or standard NTSTATUS code - ULONG UniqueId; // Often used to indicate the location of the error - ULONG DumpDataSize; // Size in bytes of private data block - PVOID DumpData; // Private data block - ULONG StringCount; // Count of NUL-terminated Unicode strings - PWSTR * StringList; // Unicode strings used for substitution within log messages (%2, %3, %4...) -} STOR_LOG_EVENT_DETAILS, *PSTOR_LOG_EVENT_DETAILS; - - - -typedef -BOOLEAN -(*PSTOR_SYNCHRONIZED_ACCESS)( - __in PVOID HwDeviceExtension, - __in PVOID Context - ); - - -#ifndef _NTDDK_ -#define STORPORT_API DECLSPEC_IMPORT -#else -#define STORPORT_API -#endif - -// -// Port driver routines called by miniport driver -// - -STORPORT_API -ULONG -StorPortInitialize( - __in PVOID Argument1, - __in PVOID Argument2, - __in struct _HW_INITIALIZATION_DATA *HwInitializationData, - __in_opt PVOID HwContext - ); - -STORPORT_API -VOID -StorPortFreeDeviceBase( - __in PVOID HwDeviceExtension, - __in PVOID MappedAddress - ); - -STORPORT_API -ULONG -StorPortGetBusData( - __in PVOID DeviceExtension, - __in ULONG BusDataType, - __in ULONG SystemIoBusNumber, - __in ULONG SlotNumber, - __inout __drv_when(Length!=0, __bcount(Length)) - PVOID Buffer, - __in ULONG Length - ); - -STORPORT_API -ULONG -StorPortSetBusDataByOffset( - __in PVOID DeviceExtension, - __in ULONG BusDataType, - __in ULONG SystemIoBusNumber, - __in ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -STORPORT_API -PVOID -StorPortGetDeviceBase( - __in PVOID HwDeviceExtension, - __in INTERFACE_TYPE BusType, - __in ULONG SystemIoBusNumber, - __in STOR_PHYSICAL_ADDRESS IoAddress, - __in ULONG NumberOfBytes, - __in BOOLEAN InIoSpace - ); - -STORPORT_API -PVOID -StorPortGetLogicalUnit( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun - ); - -STORPORT_API -PSTOR_SCATTER_GATHER_LIST -StorPortGetScatterGatherList( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb - ); - -STORPORT_API -STOR_PHYSICAL_ADDRESS -StorPortGetPhysicalAddress( - __in PVOID HwDeviceExtension, - __in_opt PSCSI_REQUEST_BLOCK Srb, - __in PVOID VirtualAddress, - __out ULONG *Length - ); - -STORPORT_API -PVOID -StorPortGetVirtualAddress( - __in PVOID HwDeviceExtension, - __in STOR_PHYSICAL_ADDRESS PhysicalAddress - ); - -STORPORT_API -PVOID -StorPortGetUncachedExtension( - __in PVOID HwDeviceExtension, - __in PPORT_CONFIGURATION_INFORMATION ConfigInfo, - __in ULONG NumberOfBytes - ); - -STORPORT_API -BOOLEAN -StorPortPauseDevice( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG Timeout - ); - -STORPORT_API -BOOLEAN -StorPortResumeDevice( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun - ); - -STORPORT_API -BOOLEAN -StorPortPause( - __in PVOID HwDeviceExtension, - __in ULONG Timeout - ); - -STORPORT_API -BOOLEAN -StorPortResume( - __in PVOID HwDeviceExtension - ); - -STORPORT_API -BOOLEAN -StorPortDeviceBusy( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG RequestsToComplete - ); - -STORPORT_API -BOOLEAN -StorPortDeviceReady( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun - ); - -STORPORT_API -BOOLEAN -StorPortBusy( - __in PVOID HwDeviceExtension, - __in ULONG RequestsToComplete - ); - -STORPORT_API -BOOLEAN -StorPortReady( - __in PVOID HwDeviceExtension - ); - -STORPORT_API -BOOLEAN -StorPortSetDeviceQueueDepth( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG Depth - ); - -STORPORT_API -VOID -StorPortNotification( - __in SCSI_NOTIFICATION_TYPE NotificationType, - __in PVOID HwDeviceExtension, - ... - ); - -STORPORT_API -VOID -StorPortLogError( - __in PVOID HwDeviceExtension, - __in_opt PSCSI_REQUEST_BLOCK Srb, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in ULONG ErrorCode, - __in ULONG UniqueId - ); - -STORPORT_API -VOID -StorPortCompleteRequest( - __in PVOID HwDeviceExtension, - __in UCHAR PathId, - __in UCHAR TargetId, - __in UCHAR Lun, - __in UCHAR SrbStatus - ); - -STORPORT_API -VOID -StorPortStallExecution( - __in ULONG Delay - ); - -STORPORT_API -BOOLEAN -StorPortSynchronizeAccess( - __in PVOID HwDeviceExtension, - __in PSTOR_SYNCHRONIZED_ACCESS SynchronizedAccessRoutine, - __in_opt PVOID Context - ); - -#if defined(_M_AMD64) - -#define StorPortReadPortUchar(h, p) READ_PORT_UCHAR(p) -#define StorPortReadPortUshort(h, p) READ_PORT_USHORT(p) -#define StorPortReadPortUlong(h, p) READ_PORT_ULONG(p) - -#define StorPortReadPortBufferUchar(h, p, b, c) READ_PORT_BUFFER_UCHAR(p, b, c) -#define StorPortReadPortBufferUshort(h, p, b, c) READ_PORT_BUFFER_USHORT(p, b, c) -#define StorPortReadPortBufferUlong(h, p, b, c) READ_PORT_BUFFER_ULONG(p, b, c) - -#define StorPortReadRegisterUchar(h, r) READ_REGISTER_UCHAR(r) -#define StorPortReadRegisterUshort(h, r) READ_REGISTER_USHORT(r) -#define StorPortReadRegisterUlong(h, r) READ_REGISTER_ULONG(r) - -#define StorPortReadRegisterBufferUchar(h, r, b, c) READ_REGISTER_BUFFER_UCHAR(r, b, c) -#define StorPortReadRegisterBufferUshort(h, r, b, c) READ_REGISTER_BUFFER_USHORT(r, b, c) -#define StorPortReadRegisterBufferUlong(h, r, b, c) READ_REGISTER_BUFFER_ULONG(r, b, c) - -#define StorPortWritePortUchar(h, p, v) WRITE_PORT_UCHAR(p, v) -#define StorPortWritePortUshort(h, p, v) WRITE_PORT_USHORT(p, v) -#define StorPortWritePortUlong(h, p, v) WRITE_PORT_ULONG(p, v) - -#define StorPortWritePortBufferUchar(h, p, b, c) WRITE_PORT_BUFFER_UCHAR(p, b, c) -#define StorPortWritePortBufferUshort(h, p, b, c) WRITE_PORT_BUFFER_USHORT(p, b, c) -#define StorPortWritePortBufferUlong(h, p, b, c) WRITE_PORT_BUFFER_ULONG(p, b, c) - -#define StorPortWriteRegisterUchar(h, r, v) WRITE_REGISTER_UCHAR(r, v) -#define StorPortWriteRegisterUshort(h, r, v) WRITE_REGISTER_USHORT(r, v) -#define StorPortWriteRegisterUlong(h, r, v) WRITE_REGISTER_ULONG(r, v) - -#define StorPortWriteRegisterBufferUchar(h, r, b, c) WRITE_REGISTER_BUFFER_UCHAR(r, b, c) -#define StorPortWriteRegisterBufferUshort(h, r, b, c) WRITE_REGISTER_BUFFER_USHORT(r, b, c) -#define StorPortWriteRegisterBufferUlong(h, r, b, c) WRITE_REGISTER_BUFFER_ULONG(r, b, c) - -#define StorPortMoveMemory memmove - -#else - -STORPORT_API -UCHAR -StorPortReadPortUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Port - ); - -STORPORT_API -USHORT -StorPortReadPortUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Port - ); - -STORPORT_API -ULONG -StorPortReadPortUlong( - __in PVOID HwDeviceExtension, - __in PULONG Port - ); - -STORPORT_API -VOID -StorPortReadPortBufferUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortReadPortBufferUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortReadPortBufferUlong( - __in PVOID HwDeviceExtension, - __in PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -STORPORT_API -UCHAR -StorPortReadRegisterUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Register - ); - -STORPORT_API -USHORT -StorPortReadRegisterUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Register - ); - -STORPORT_API -ULONG -StorPortReadRegisterUlong( - __in PVOID HwDeviceExtension, - __in PULONG Register - ); - -STORPORT_API -VOID -StorPortReadRegisterBufferUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortReadRegisterBufferUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortReadRegisterBufferUlong( - __in PVOID HwDeviceExtension, - __in PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWritePortUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Port, - __in UCHAR Value - ); - -STORPORT_API -VOID -StorPortWritePortUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Port, - __in USHORT Value - ); - -STORPORT_API -VOID -StorPortWritePortUlong( - __in PVOID HwDeviceExtension, - __in PULONG Port, - __in ULONG Value - ); - -STORPORT_API -VOID -StorPortWritePortBufferUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWritePortBufferUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWritePortBufferUlong( - __in PVOID HwDeviceExtension, - __in PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWriteRegisterUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Register, - __in UCHAR Value - ); - -STORPORT_API -VOID -StorPortWriteRegisterUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Register, - __in USHORT Value - ); - -STORPORT_API -VOID -StorPortWriteRegisterUlong( - __in PVOID HwDeviceExtension, - __in PULONG Register, - __in ULONG Value - ); - -STORPORT_API -VOID -StorPortWriteRegisterBufferUchar( - __in PVOID HwDeviceExtension, - __in PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWriteRegisterBufferUshort( - __in PVOID HwDeviceExtension, - __in PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortWriteRegisterBufferUlong( - __in PVOID HwDeviceExtension, - __in PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -STORPORT_API -VOID -StorPortMoveMemory( - __in_bcount(Length) PVOID WriteBuffer, - __in_bcount(Length) PVOID ReadBuffer, - __in ULONG Length - ); - - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -#pragma intrinsic (memcpy) - -#define StorPortCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length)) -#endif - -STORPORT_API -STOR_PHYSICAL_ADDRESS -StorPortConvertUlongToPhysicalAddress( - __in ULONG_PTR UlongAddress - ); - -STORPORT_API -ULONG -StorPortConvertPhysicalAddressToUlong( - __in STOR_PHYSICAL_ADDRESS Address - ); - -STORPORT_API -VOID -StorPortQuerySystemTime( - __out PLARGE_INTEGER CurrentTime - ); - -#define StorPortConvertPhysicalAddressToUlong(Address) ((Address).LowPart) -#define StorPortConvertPhysicalAddressToULong64(Address) ((Address).QuadPart) - -#define MINIPORT_REG_SZ 1 -#define MINIPORT_REG_BINARY 3 -#define MINIPORT_REG_DWORD 4 - -__drv_allocatesMem(Mem) -__bcount(Length) -STORPORT_API -PUCHAR -StorPortAllocateRegistryBuffer( - __in PVOID HwDeviceExtension, - __in PULONG Length - ); - - -STORPORT_API -VOID -StorPortFreeRegistryBuffer( - __in PVOID HwDeviceExtension, - __in __drv_freesMem(Mem) PUCHAR Buffer - ); - -BOOLEAN -StorPortRegistryRead( - __in PVOID HwDeviceExtension, - __in PUCHAR ValueName, - __in ULONG Global, - __in ULONG Type, - __out PUCHAR Buffer, - __inout PULONG BufferLength - ); - -STORPORT_API -BOOLEAN -StorPortRegistryWrite( - __in PVOID HwDeviceExtension, - __in PUCHAR ValueName, - __in ULONG Global, - __in ULONG Type, - __in_bcount(BufferLength) PUCHAR Buffer, - __in ULONG BufferLength - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -STORPORT_API -BOOLEAN -StorPortValidateRange( - __in PVOID HwDeviceExtension, - __in INTERFACE_TYPE BusType, - __in ULONG SystemIoBusNumber, - __in STOR_PHYSICAL_ADDRESS IoAddress, - __in ULONG NumberOfBytes, - __in BOOLEAN InIoSpace - ); - -STORPORT_API -VOID -StorPortDebugPrint( - __in ULONG DebugPrintLevel, - __in PCCHAR DebugMessage, - ... - ); - -BOOLEAN -FORCEINLINE -StorPortEnablePassiveInitialization( - __in PVOID DeviceExtension, - __in PHW_PASSIVE_INITIALIZE_ROUTINE HwPassiveInitializeRoutine - ) -{ - LONG Succ; - - Succ = FALSE; - StorPortNotification (EnablePassiveInitialization, - DeviceExtension, - HwPassiveInitializeRoutine, - &Succ); - - return (BOOLEAN)Succ; -} - -VOID -FORCEINLINE -StorPortInitializeDpc( - __in PVOID DeviceExtension, - __out PSTOR_DPC Dpc, - __in PHW_DPC_ROUTINE HwDpcRoutine - ) -{ - StorPortNotification (InitializeDpc, - DeviceExtension, - Dpc, - HwDpcRoutine); -} - -BOOLEAN -FORCEINLINE -StorPortIssueDpc( - __in PVOID DeviceExtension, - __in PSTOR_DPC Dpc, - __in PVOID SystemArgument1, - __in PVOID SystemArgument2 - ) -{ - LONG Succ; - - Succ = FALSE; - StorPortNotification (IssueDpc, - DeviceExtension, - Dpc, - SystemArgument1, - SystemArgument2, - &Succ); - return (BOOLEAN)Succ; -} - -// StorPortNotification is a polymorphic function that handles many different types of requests, -// making it difficult to annotate in a manner that would cover all possible uses. -// Because StorPortNotification returns VOID, the scanning engine should assume the LockHandle was acquired as asked. -// This assumption requires the suppressing the PFD warning generated (28104). -VOID -FORCEINLINE -StorPortAcquireSpinLock( - __in PVOID DeviceExtension, - __in STOR_SPINLOCK SpinLock, - __in PVOID LockContext, - __inout __deref __drv_acquiresExclusiveResource(LockHandle) - PSTOR_LOCK_HANDLE LockHandle - ) -#pragma warning (suppress: 28104) -{ - StorPortNotification (AcquireSpinLock, - DeviceExtension, - SpinLock, - LockContext, - LockHandle); -} - -VOID -FORCEINLINE -StorPortReleaseSpinLock( - __in PVOID DeviceExtension, - __inout __deref __drv_releasesExclusiveResource(LockHandle) - PSTOR_LOCK_HANDLE LockHandle - ) -{ - StorPortNotification (ReleaseSpinLock, - DeviceExtension, - LockHandle); -} - -STORPORT_API -ULONG -StorPortExtendedFunction( - __in STORPORT_FUNCTION_CODE FunctionCode, - __in PVOID HwDeviceExtension, - ... - ); - -ULONG -FORCEINLINE -StorPortAllocatePool( - __in PVOID HwDeviceExtension, - __in ULONG NumberOfBytes, - __in ULONG Tag, - __out __deref __drv_when(return!=0, __drv_valueIs(==0)) - __deref __drv_when(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) __drv_valueIs(!=0) - __bcount(NumberOfBytes)) - PVOID *BufferPointer - ) -{ - return StorPortExtendedFunction(ExtFunctionAllocatePool, - HwDeviceExtension, - NumberOfBytes, - Tag, - BufferPointer); -} - -ULONG -FORCEINLINE -StorPortFreePool( - __in PVOID HwDeviceExtension, - __in __drv_freesMem(Mem) PVOID BufferPointer - ) -{ - return StorPortExtendedFunction(ExtFunctionFreePool, - HwDeviceExtension, - BufferPointer); -} - -ULONG -FORCEINLINE -StorPortAllocateMdl( - __in PVOID HwDeviceExtension, - __in_bcount(NumberOfBytes) PVOID BufferPointer, - __in ULONG NumberOfBytes, - __out __deref __drv_when(return!=0, __drv_valueIs(==0)) - __deref __drv_when(return==0, __drv_aliasesMem __drv_allocatesMem(Mem) __drv_valueIs(!=0)) - PVOID *Mdl - ) -{ - return StorPortExtendedFunction(ExtFunctionAllocateMdl, - HwDeviceExtension, - BufferPointer, - NumberOfBytes, - Mdl); -} - -ULONG -FORCEINLINE -StorPortFreeMdl( - __in PVOID HwDeviceExtension, - __in __drv_freesMem(Mem) PVOID Mdl - ) -{ - return StorPortExtendedFunction(ExtFunctionFreeMdl, - HwDeviceExtension, - Mdl); -} - -ULONG -FORCEINLINE -StorPortBuildMdlForNonPagedPool( - __in PVOID HwDeviceExtension, - __inout PVOID Mdl - ) -{ - return StorPortExtendedFunction(ExtFunctionBuildMdlForNonPagedPool, - HwDeviceExtension, - Mdl); -} - -ULONG -FORCEINLINE -StorPortGetSystemAddress( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __deref_out PVOID *SystemAddress - ) -{ - return StorPortExtendedFunction(ExtFunctionGetSystemAddress, - HwDeviceExtension, - Srb, - SystemAddress); -} - -ULONG -FORCEINLINE -StorPortGetOriginalMdl( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __deref_out PVOID *Mdl - ) -{ - return StorPortExtendedFunction(ExtFunctionGetOriginalMdl, - HwDeviceExtension, - Srb, - Mdl); -} - -ULONG -FORCEINLINE -StorPortCompleteServiceIrp( - __in PVOID HwDeviceExtension, - __in PVOID Irp - ) -{ - return StorPortExtendedFunction(ExtFunctionCompleteServiceIrp, - HwDeviceExtension, - Irp); -} - -ULONG -FORCEINLINE -StorPortGetDeviceObjects( - __in PVOID HwDeviceExtension, - __deref_out PVOID *AdapterDeviceObject, - __deref_out PVOID *PhysicalDeviceObject, - __deref_out PVOID *LowerDeviceObject - ) -{ - return StorPortExtendedFunction(ExtFunctionGetDeviceObjects, - HwDeviceExtension, - AdapterDeviceObject, - PhysicalDeviceObject, - LowerDeviceObject); -} - -ULONG -FORCEINLINE -StorPortBuildScatterGatherList( - __in PVOID HwDeviceExtension, - __in PVOID Mdl, - __in_bcount(Length) PVOID CurrentVa, - __in ULONG Length, - __in PpostScaterGatherExecute ExecutionRoutine, - __in PVOID Context, - __in BOOLEAN WriteToDevice, - __inout_bcount(ScatterGatherBufferLength) PVOID ScatterGatherBuffer, - __in ULONG ScatterGatherBufferLength - ) -{ - return StorPortExtendedFunction(ExtFunctionBuildScatterGatherList, - HwDeviceExtension, - Mdl, - CurrentVa, - Length, - ExecutionRoutine, - Context, - WriteToDevice, - ScatterGatherBuffer, - ScatterGatherBufferLength); -} - -ULONG -FORCEINLINE -StorPortPutScatterGatherList( - __in PVOID HwDeviceExtension, - __in PSTOR_SCATTER_GATHER_LIST ScatterGatherList, - __in BOOLEAN WriteToDevice - ) -{ - return StorPortExtendedFunction(ExtFunctionPutScatterGatherList, - HwDeviceExtension, - ScatterGatherList, - WriteToDevice); -} - -ULONG -FORCEINLINE -StorPortAcquireMSISpinLock( - __in PVOID HwDeviceExtension, - __in ULONG MessageId, - __in PULONG OldIrql - ) -{ - return StorPortExtendedFunction(ExtFunctionAcquireMSISpinLock, - HwDeviceExtension, - MessageId, - OldIrql); -} - -ULONG -FORCEINLINE -StorPortReleaseMSISpinLock( - __in PVOID HwDeviceExtension, - __in ULONG MessageId, - __in ULONG OldIrql - ) -{ - return StorPortExtendedFunction(ExtFunctionReleaseMSISpinLock, - HwDeviceExtension, - MessageId, - OldIrql); -} - -ULONG -FORCEINLINE -StorPortGetMSIInfo( - __in PVOID HwDeviceExtension, - __in ULONG MessageId, - __out PMESSAGE_INTERRUPT_INFORMATION InterruptInfo - ) -{ - return StorPortExtendedFunction(ExtFunctionGetMessageInterruptInformation, - HwDeviceExtension, - MessageId, - InterruptInfo); -} - -ULONG -FORCEINLINE -StorPortInitializePerfOpts( - __in PVOID HwDeviceExtension, - __in BOOLEAN Query, - __inout PPERF_CONFIGURATION_DATA PerfConfigData - ) -{ - return StorPortExtendedFunction(ExtFunctionInitializePerformanceOptimizations, - HwDeviceExtension, - Query, - PerfConfigData); -} - -ULONG -FORCEINLINE -StorPortGetStartIoPerfParams( - __in PVOID HwDeviceExtension, - __in PSCSI_REQUEST_BLOCK Srb, - __inout PSTARTIO_PERFORMANCE_PARAMETERS StartIoPerfParams - ) -{ - return StorPortExtendedFunction(ExtFunctionGetStartIoPerformanceParameters, - HwDeviceExtension, - Srb, - StartIoPerfParams); -} - -ULONG -FORCEINLINE -StorPortLogSystemEvent( - __in PVOID HwDeviceExtension, - __inout PSTOR_LOG_EVENT_DETAILS LogDetails, - __inout PULONG MaximumSize - ) -{ - return StorPortExtendedFunction(ExtFunctionLogSystemEvent, - HwDeviceExtension, - LogDetails, - MaximumSize); -} - -ULONG -FORCEINLINE -StorPortGetCurrentProcessorNumber ( - __in PVOID HwDeviceExtension, - __out PPROCESSOR_NUMBER ProcNumber - ) -{ - return StorPortExtendedFunction(ExtFunctionGetCurrentProcessorNumber, - HwDeviceExtension, - ProcNumber); -} - -ULONG -FORCEINLINE -StorPortGetGroupAffinity ( - __in PVOID HwDeviceExtension, - __in USHORT GroupNumber, - __out PKAFFINITY GroupAffinityMask - ) -{ - return StorPortExtendedFunction(ExtFunctionGetGroupAffinity, - HwDeviceExtension, - GroupNumber, - GroupAffinityMask); -} - -ULONG -FORCEINLINE -StorPortGetActiveGroupCount ( - __in PVOID HwDeviceExtension, - __out PUSHORT NumberGroups - ) -{ - return StorPortExtendedFunction(ExtFunctionGetActiveGroupCount, - HwDeviceExtension, - NumberGroups); -} - -ULONG -FORCEINLINE -StorPortGetNodeAffinity ( - __in PVOID HwDeviceExtension, - __in ULONG NodeNumber, - __out PGROUP_AFFINITY NodeAffinityMask - ) -{ - return StorPortExtendedFunction(ExtFunctionGetNodeAffinity, - HwDeviceExtension, - NodeNumber, - NodeAffinityMask); -} - -ULONG -FORCEINLINE -StorPortGetActiveNodeCount ( - __in PVOID HwDeviceExtension, - __out PULONG NumberNodes - ) -{ - return StorPortExtendedFunction(ExtFunctionGetActiveNodeCount, - HwDeviceExtension, - NumberNodes); -} - -ULONG -FORCEINLINE -StorPortGetHighestNodeNumber ( - __in PVOID HwDeviceExtension, - __out PULONG HighestNode - ) -{ - return StorPortExtendedFunction(ExtFunctionGetHighestNodeNumber, - HwDeviceExtension, - HighestNode); -} - -__drv_maxIRQL(DISPATCH_LEVEL) -ULONG -FORCEINLINE -StorPortGetLogicalProcessorRelationship ( - __in PVOID HwDeviceExtension, - __in_opt PPROCESSOR_NUMBER ProcessorNumber, - __in LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, - __out_bcount(*Length) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information, - __inout PULONG Length - ) -{ - return StorPortExtendedFunction(ExtFunctionGetLogicalProcessorRelationship, - HwDeviceExtension, - ProcessorNumber, - RelationshipType, - Information, - Length); -} - -__drv_maxIRQL(DISPATCH_LEVEL) -ULONG -FORCEINLINE -StorPortAllocateContiguousMemorySpecifyCacheNode ( - __in PVOID HwDeviceExtension, - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS LowestAcceptableAddress, - __in PHYSICAL_ADDRESS HighestAcceptableAddress, - __in_opt PHYSICAL_ADDRESS BoundaryAddressMultiple, - __in MEMORY_CACHING_TYPE CacheType, - __in NODE_REQUIREMENT PreferredNode, - __out PVOID* BufferPointer - ) -{ - return StorPortExtendedFunction(ExtFunctionAllocateContiguousMemorySpecifyCacheNode, - HwDeviceExtension, - NumberOfBytes, - LowestAcceptableAddress, - HighestAcceptableAddress, - BoundaryAddressMultiple, - CacheType, - PreferredNode, - BufferPointer); -} - -ULONG -FORCEINLINE -StorPortFreeContiguousMemorySpecifyCache ( - __in PVOID HwDeviceExtension, - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes, - __in MEMORY_CACHING_TYPE CacheType - ) -{ - return StorPortExtendedFunction(ExtFunctionFreeContiguousMemorySpecifyCache, - HwDeviceExtension, - BaseAddress, - NumberOfBytes, - CacheType); -} - -// -// Include SCSIPORT definitions for backwards compatability. -// - -#if defined (STOR_USE_SCSI_ALIASES) - -#define ScsiPortInitialize StorPortInitialize -#define ScsiPortFreeDeviceBase StorPortFreeDeviceBase -#define ScsiPortGetBusData StorPortGetBusData -#define ScsiPortSetBusDataByOffset StorPortSetBusDataByOffset -#define ScsiPortGetDeviceBase StorPortGetDeviceBase -#define ScsiPortGetLogicalUnit StorPortGetLogicalUnit -#define ScsiPortGetSrb StorPortGetSrb -#define ScsiPortGetPhysicalAddress StorPortGetPhysicalAddress -#define ScsiPortGetVirtualAddress StorPortGetVirtualAddress -#define ScsiPortGetUncachedExtension StorPortGetUncachedExtension -#define ScsiPortFlushDma StorPortFlushDma -#define ScsiPortIoMapTransfer StorPortIoMapTransfer -#define ScsiPortNotification StorPortNotification -#define ScsiPortLogError StorPortLogError -#define ScsiPortCompleteRequest StorPortCompleteRequest -#define ScsiPortMoveMemory StorPortMoveMemory -#define ScsiPortReadPortUchar(Port) StorPortReadPortUchar(NULL, Port) -#define ScsiPortReadPortUshort(Port) StorPortReadPortUshort(NULL, Port) -#define ScsiPortReadPortUlong(Port) StorPortReadPortUlong(NULL, Port) -#define ScsiPortReadPortBufferUchar(Port, Buffer, Count) StorPortReadPortBufferUchar(NULL, Port, Buffer, Count) -#define ScsiPortReadPortBufferUshort(Port, Buffer, Count) StorPortReadPortBufferUshort(NULL, Port, Buffer, Count) -#define ScsiPortReadPortBufferUlong(Port, Buffer, Count) StorPortReadPortBufferUlong(NULL, Port, Buffer, Count) -#define ScsiPortReadRegisterUchar(Register) StorPortReadRegisterUchar(NULL, Register) -#define ScsiPortReadRegisterUshort(Register) StorPortReadRegisterUshort(NULL, Register) -#define ScsiPortReadRegisterUlong(Register) StorPortReadRegisterUlong(NULL, Register) -#define ScsiPortReadRegisterBufferUchar(Register, Buffer, Count) StorPortReadRegisterBufferUchar(NULL, Register, Buffer, Count) -#define ScsiPortReadRegisterBufferUshort(Register, Buffer, Count) StorPortReadRegisterBufferUshort(NULL, Register, Buffer, Count) -#define ScsiPortReadRegisterBufferUlong(Register, Buffer, Count) StorPortReadRegisterBufferUlong(NULL, Register, Buffer, Count) -#define ScsiPortStallExecution StorPortStallExecution -#define ScsiPortWritePortUchar(Port, Value) StorPortWritePortUchar(NULL, Port, Value) -#define ScsiPortWritePortUshort(Port, Value) StorPortWritePortUshort(NULL, Port, Value) -#define ScsiPortWritePortUlong(Port, Value) StorPortWritePortUlong(NULL, Port, Value) -#define ScsiPortWritePortBufferUchar(Port, Buffer, Count) StorPortWritePortBufferUchar(NULL, Port, Buffer, Count) -#define ScsiPortWritePortBufferUshort(Port, Buffer, Count) StorPortWritePortBufferUshort(NULL, Port, Buffer, Count) -#define ScsiPortWritePortBufferUlong(Port, Buffer, Count) StorPortWritePortBufferUlong(NULL, Port, Buffer, Count) -#define ScsiPortWriteRegisterUchar(Register, Value) StorPortWriteRegisterUchar(NULL, Register, Value) -#define ScsiPortWriteRegisterUshort(Register, Value) StorPortWriteRegisterUshort(NULL, Register, Value) -#define ScsiPortWriteRegisterUlong(Register, Value) StorPortWriteRegisterUlong(NULL, Register, Value) -#define ScsiPortWriteRegisterBufferUchar(Register, Buffer, Count) StorPortWriteRegisterBufferUchar(NULL, Register, Buffer, Count) -#define ScsiPortWriteRegisterBufferUshort(Register, Buffer, Count) StorPortWriteRegisterBufferUshort(NULL, Register, Buffer, Count) -#define ScsiPortWriteRegisterBufferUlong(Register, Buffer, Count) StorPortWriteRegisterBufferUlong(NULL, Register, Buffer, Count) -#define ScsiPortConvertUlongToPhysicalAddress StorPortConvertUlongToPhysicalAddress -#define ScsiPortConvertPhysicalAddressToUlong StorPortConvertPhysicalAddressToUlong -#define ScsiPortQuerySystemTime StorPortQuerySystemTime -#define ScsiPortValidateRange StorPortValidateRange -#define ScsiDebugPrint StorPortDebugPrint - -typedef PHYSICAL_ADDRESS SCSI_PHYSICAL_ADDRESS, *PSCSI_PHYSICAL_ADDRESS; - -#endif // STOR_USE_SCSI_ALIASES - - -#if _MSC_VER >= 1200 -#pragma warning(pop) // un-sets any local warning changes -#else -#pragma warning(default:4200) // array[0] is not a warning for this file -#pragma warning(default:4201) // nonstandard extension used : nameless struct/union -#pragma warning(default:4214) // nonstandard extension used : bit field types other than int -#endif - -#endif // !defined _NTSTORPORT_ - diff --git a/qt-correction-tool/pub/ddk/storswtr.h b/qt-correction-tool/pub/ddk/storswtr.h deleted file mode 100644 index 3c1e7d5..0000000 --- a/qt-correction-tool/pub/ddk/storswtr.h +++ /dev/null @@ -1,199 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - -Module Name: - - storswtr.h - -Abstract: - - Software Tracing for Storage Drivers - -Environment: - - Kernel mode - - ---*/ - -#ifndef _stortrce_h_ -#define _stortrce_h_ - -#include - -// -// Ensure error level constants are defined correctly -// -#ifdef TRACE_LEVEL_FATAL -#undef TRACE_LEVEL_FATAL -#endif - -#ifdef TRACE_LEVEL_ERROR -#undef TRACE_LEVEL_ERROR -#endif - -#ifdef TRACE_LEVEL_WARNING -#undef TRACE_LEVEL_WARNING -#endif - -#ifdef TRACE_LEVEL_INFORMATION -#undef TRACE_LEVEL_INFORMATION -#endif - -#ifdef TRACE_LEVEL_VERBOSE -#undef TRACE_LEVEL_VERBOSE -#endif - -// -// Error level codes -// -#define TRACE_LEVEL_FATAL 1 -#define TRACE_LEVEL_ERROR 2 -#define TRACE_LEVEL_WARNING 3 -#define TRACE_LEVEL_INFORMATION 4 -#define TRACE_LEVEL_VERBOSE 5 - -// -// DEBUG_USE_KDPRINT: if defined, uses KdPrint instead of WMI tracing -// -#ifndef DEBUG_USE_KDPRINT - -// -// Defines standard flag bits for all storage drivers -// -#define WPP_NORMAL_FLAGS WPP_DEFINE_BIT(TRACE_FLAG_GENERAL) \ - WPP_DEFINE_BIT(TRACE_FLAG_PNP) \ - WPP_DEFINE_BIT(TRACE_FLAG_POWER) \ - WPP_DEFINE_BIT(TRACE_FLAG_RW) \ - WPP_DEFINE_BIT(TRACE_FLAG_IOCTL) \ - WPP_DEFINE_BIT(TRACE_FLAG_QUEUE) \ - WPP_DEFINE_BIT(TRACE_FLAG_WMI) \ - WPP_DEFINE_BIT(TRACE_FLAG_TIMER) \ - WPP_DEFINE_BIT(TRACE_FLAG_INIT) \ - WPP_DEFINE_BIT(TRACE_FLAG_LOCK) \ - WPP_DEFINE_BIT(TRACE_FLAG_DEBUG1) \ - WPP_DEFINE_BIT(TRACE_FLAG_DEBUG2) \ - WPP_DEFINE_BIT(TRACE_FLAG_MCN) \ - WPP_DEFINE_BIT(TRACE_FLAG_ISR) \ - WPP_DEFINE_BIT(TRACE_FLAG_ENUM) \ - WPP_DEFINE_BIT(TRACE_FLAG_LOGOTEST) - -// -// Allows source file to specify only the GUID to enable WMI tracing -// -#define WPP_CONTROL_GUIDS_NORMAL_FLAGS(_GUID) \ - WPP_DEFINE_CONTROL_GUID(wppCtlGuid, _GUID, WPP_NORMAL_FLAGS) - -// -// Overrides of default functions to allow us to specify both flags and error levels with error messages -// -#define WPP_LEVEL_FLAGS_ENABLED(lvl, flags) (WPP_LEVEL_ENABLED(flags) && WPP_CONTROL(WPP_BIT_ ## flags).Level >= lvl) -#define WPP_LEVEL_FLAGS_LOGGER(lvl,flags) WPP_LEVEL_LOGGER(flags) - -// -// Used in the source to selectively include the '.tmh' file as well as define the GUID -// -#define DEBUG_USE_WPP - -// -// Use KdPrint instead of WMI tracing -// -#else - -// -// Used in the source file to ensure the '.tmh' file is not included -// -#ifdef DEBUG_USE_WPP -#undef DEBUG_USE_WPP -#endif - -// -// Ensure both WPP_INIT_TRACING and WPP_CLEANUP are not defined, and replace with NOOPS -// These macros are only used when performing WMI tracing, which we are not -// -#ifdef WPP_INIT_TRACING -#undef WPP_INIT_TRACING -#endif - -#ifdef WPP_CLEANUP -#undef WPP_CLEANUP -#endif - -#define WPP_INIT_TRACING(_DRIVER, _REGISTRY) -#define WPP_CLEANUP(_DRIVER) - -// -// Initialize debug flags enumeration as it is not declared -// -typedef enum _DEBUG_FLAGS { - TRACE_FLAG_GENERAL = 0, - TRACE_FLAG_PNP, - TRACE_FLAG_POWER, - TRACE_FLAG_RW, - TRACE_FLAG_IOCTL, - TRACE_FLAG_QUEUE, - TRACE_FLAG_WMI, - TRACE_FLAG_TIMER, - TRACE_FLAG_INIT, - TRACE_FLAG_LOCK, - TRACE_FLAG_DEBUG1, - TRACE_FLAG_DEBUG2, - TRACE_FLAG_MCN, - TRACE_FLAG_ISR, - TRACE_FLAG_ENUM, - TRACE_FLAG_LOGOTEST -} DEBUG_FLAGS, *PDEBUG_FLAGS; - -// -// Redirect WMI tracing calls to the DbgPrint function. We are forced to drop the flags argument as -// DbgPrintEx does not use it. We only want one function definition when linked togethor, so -// we must define -// -// If we're on pre-XP, vDbgPrintEx doesn't exist, and there is no good replacement. In that situation, -// well ensure that TracePrint is a no-op when set to redirect traces to DbgPrint. -// - - -#if DBG && (NTDDI_VERSION >= NTDDI_WINXP) - -#define TracePrint(x) StorDebugPrint x - -#if DEBUG_MAIN_SOURCE - -void StorDebugPrint(int DebugPrintLevel, DEBUG_FLAGS DebugPrintFlags, PCCHAR DebugMessage, ...) { - va_list ap; - - UNREFERENCED_PARAMETER(DebugPrintFlags); - - va_start(ap, DebugMessage); - - vDbgPrintEx(DEBUG_COMP_ID, DebugPrintLevel, DebugMessage, ap); - - va_end(ap); -} - -#else - -void StorDebugPrint(int DebugPrintLevel, DEBUG_FLAGS DebugPrintFlags, PCCHAR DebugMessage, ...); - -#endif // DEBUG_MAIN_SOURCE - -#else - -#define TracePrint(x) - -#endif // DBG && (NTDDI_VERSION >= NTDDI_WINXP) - -#endif // DEBUG_USE_KDPRINT - -#endif // _stortrce_h_ - - - - diff --git a/qt-correction-tool/pub/ddk/stortrce.h b/qt-correction-tool/pub/ddk/stortrce.h deleted file mode 100644 index b255d0b..0000000 --- a/qt-correction-tool/pub/ddk/stortrce.h +++ /dev/null @@ -1,680 +0,0 @@ -/*++ - -Copyright (c) 2004 Microsoft Corporation - -Module Name: - - stortrce.w - -Abstract: - - These are the structures and definitions used for tracing - in storage miniports. - -Authors: - -Revision History: - ---*/ - -// -// Add a little bit of no-op header versioning so that the header-versioning detection -// tool is happy. We'll add real header versioning later if we eventually need it. -// - -#if NTDDI_VERSION >= NTDDI_WINXP -#endif - -#include - -#ifndef _NTSTORTRCE_ -#define _NTSTORTRCE_ - -#define INLINE __inline - -// -// Determine the right PortNotification call for the miniport -// -#ifndef _PortTraceNotification - -// -// Storport miniport -// -#ifdef _NTSTORPORT_ -#define _PortTraceNotification StorPortNotification -#endif - -// -// Scsi miniport -// -#ifdef _NTSRB_ -#undef _PortTraceNotification -#define _PortTraceNotification ScsiPortNotification -#endif - -// -// Ata miniport -// -#ifdef _NTIRB_ -#undef _PortTraceNotification -#define _PortTraceNotification AtaPortTraceNotification -#endif - -#ifndef _PortTraceNotification -#error "PortNotification not defined. Include scsi.h or storport.h or irb.h" -#endif - -#endif //#ifndef _PortTraceNotification - -#ifndef StorMoveMemory - -#ifdef _NTSTORPORT_ -#define StorMoveMemory StorPortMoveMemory -#endif - -#ifdef _NTSRB_ -#undef StorMoveMemory -#define StorMoveMemory ScsiPortMoveMemory -#endif - -#ifdef _NTIRB_ -#undef StorMoveMemory -#define StorMoveMemory AtaPortMoveMemory -#endif - -#ifndef StorMoveMemory -#error "StorMoveMemory not defined. Include scsi.h or storport.h or irb.h" -#endif - -#endif //#ifndef StorMoveMemory - -typedef PVOID STORAGE_TRACE_CONTEXT; - -// -// Prototype for the cleanup routine -// -typedef -VOID -(*STOR_CLEANUP_TRACING) ( - __in PVOID Arg1 - ); - -// -// This structure is used to initializing the storage tracing library. -// -typedef struct _STORAGE_TRACE_INIT_INFO { - // - // The size, in bytes, of this structure. - // - ULONG Size; - - // - // The number of diagnostic contexts the caller wants pre-allocated for - // diagnostic events. By pre-allocating contexts, the caller will be - // able to generate diagnostic events at any IRQL. - // - ULONG NumDiagEventRecords; - - // - // The size, in bytes, of the user-defined data space to be allocated in - // each pre-allocated diagnostic context. - // - ULONG DiagEventRecordUserDataSize; - - // - // The number of error log records the caller wants pre-allocated. - // - ULONG NumErrorLogRecords; - - // - // The trace GUID of the caller uniquely identifies the component as a - // diagnostic event source. - // - GUID TraceGuid; - - // - // Callback to cleanup tracing - // - STOR_CLEANUP_TRACING TraceCleanupRoutine; - - // - // A pointer to the caller's driver object. - // - PVOID DriverObject; - - // - // OUT : TraceContext to be used for error/diag support - // - PVOID TraceContext; - -} STORAGE_TRACE_INIT_INFO, *PSTORAGE_TRACE_INIT_INFO; - - -// -// This structure is used to hold the user data that is attached to a -// diagnostic event. -// -typedef struct _STORAGE_DIAG_EVENT_RECORD { - - // - // The size, in bytes of this structure. This value includes the - // size of the information. - // - ULONG Size; - - // - // Reserved. - // - ULONG Reserved; - - // - // Additional information to be sent with the diagnostic event. - // - UCHAR Info[1]; -} STORAGE_DIAG_EVENT_RECORD, *PSTORAGE_DIAG_EVENT_RECORD; - - -// -// This structure holds information about a diagnostic trace event. -// -typedef struct _STORAGE_TRACE_DPS_INFO { - // - // The event ID uniquely identifies a diagnostic event. Applications - // can use the value to identify certain and take specific actions - // accordingly. - // - GUID EventId; - - // - // The flags field is used to control how the tracing library sends a - // diagnostic trace event. - // - ULONG Flags; - - // - // The status of the attempt to log the diagnostic event is recorded in - // the status field. - // - ULONG Status; - - // - // This field specifies the number of TRACE_CONTEXT records the caller is - // supplying in the Contexts array. - // - ULONG NumContexts; - - // - // An array of TRACE_CONTEXT structures. To be sent with the diagnostic - // event. - // - PVOID Contexts; - - // - // Specifies the size of the user data area. - // - ULONG UserDataSize; - -} STORAGE_TRACE_DPS_INFO, *PSTORAGE_TRACE_DPS_INFO; - -// -// This structure holds the error log from the miniport -// -typedef struct _STORAGE_ERRORLOG_PACKET { - UCHAR MajorFunctionCode; - UCHAR RetryCount; - USHORT DumpDataSize; - USHORT NumberOfStrings; - USHORT StringOffset; - USHORT EventCategory; - ULONG ErrorCode; - ULONG UniqueErrorValue; - ULONG FinalStatus; - ULONG SequenceNumber; - ULONG IoControlCode; - LARGE_INTEGER DeviceOffset; - ULONG DumpData[1]; -} STORAGE_ERRORLOG_PACKET, *PSTORAGE_ERRORLOG_PACKET; - -// -// Tracing related notification types -// -typedef enum _STORAGE_TRACE_NOTIFY_TYPE { - // - // Initialization and cleanup - // - InitTracing = 1000, // 0x3E8 (1000) - CleanupTracing, // 0x3E9 (1001) - - // - // WPP support - // - TraceMessage = 2000, // 0x7D0 (2000) - InitGlobalLogger, // 0x7D1 (2001) - WMIRegistrationControl, // 0x7E2 (2002) - WmiQueryTraceInfo, // 0x7E3 (2003) - InitUnicodeString, // 0x7E4 (2004) - TraceDebugPrint, // 0x7E5 (2005) - - // - // WDI support - // - AllocDiagEvent = 3000, // 0xBB8 (3000) - FreeDiagEvent, // 0xBB9 (3001) - LogDiagEvent, // 0xBBA (3002) - - // - // Error log support - // - WriteErrorLogRecord = 4000, // 0xFA0 (4000) - AllocErrorLog, - FreeErrorLog - -} STORAGE_TRACE_NOTIFY_TYPE, *PSTORAGE_TRACE_NOTIFY_TYPE; - - -// -// StorDebugPrint -// - -typedef struct _STOR_DEBUGPRINT_ARGS { - PCHAR Message; - va_list ArgList; -} STOR_DEBUGPRINT_ARGS, *PSTOR_DEBUGPRINT_ARGS; - -// -// StorInitTracing -// - -typedef struct _STOR_INIT_TRACING_ARGS { - PVOID InitInfo; - ULONG Result; -} STOR_INIT_TRACING_ARGS, *PSTOR_INIT_TRACING_ARGS; - - -// -// StorCleanupTracing -// - -typedef struct _STOR_CLEANUP_TRACING_ARGS { - PVOID TraceContext; -} STOR_CLEANUP_TRACING_ARGS, *PSTOR_CLEANUP_TRACING_ARGS; - -// -// WriteErrorLogEntry -// - -typedef struct _STOR_WRITE_EL_RECORD_ARGS { - PVOID TraceContext; - PVOID ErrorLogPacket; -} STOR_WRITE_EL_RECORD_ARGS, *PSTOR_WRITE_EL_RECORD_ARGS; - -// -// AllocateErrorLogEntry -// - -typedef struct _STOR_ALLOC_EL_RECORD_ARGS { - PVOID TraceContext; - ULONG Size; - PSTORAGE_ERRORLOG_PACKET Result; -} STOR_ALLOC_EL_RECORD_ARGS, *PSTOR_ALLOC_EL_RECORD_ARGS; - -// -// FreeErrorLogEntry -// - -typedef struct _STOR_FREE_EL_RECORD_ARGS { - PVOID TraceContext; - PSTORAGE_ERRORLOG_PACKET ErrorLogPacket; -} STOR_FREE_EL_RECORD_ARGS, *PSTOR_FREE_EL_RECORD_ARGS; - - -// -// TraceDriverLogEvent -// - -typedef struct _STOR_LOG_DIAG_EVENT_ARGS { - PVOID TraceContext; - PVOID ContextEvent; - ULONG result; -} STOR_LOG_DIAG_EVENT_ARGS, *PSTOR_LOG_DIAG_EVENT_ARGS; - - -// -// TraceDriverAllocEvent -// - -typedef struct _STOR_ALLOC_DIAG_EVENT_ARGS { - PVOID TraceContext; - ULONG UserDataSize; - BOOLEAN Allocate; - PVOID result; -} STOR_ALLOC_DIAG_EVENT_ARGS, *PSTOR_ALLOC_DIAG_EVENT_ARGS; - - -// -// TraceDriverFreeEvent -// - -typedef struct _STOR_FREE_DIAG_EVENT_ARGS { - PVOID TraceContext; - PVOID EventRecord; -} STOR_FREE_DIAG_EVENT_ARGS, *PSTOR_FREE_DIAG_EVENT_ARGS; - - -// -// WmiTraceMessage -// - -typedef struct _STOR_WMI_TRACE_MESSAGE_ARGS { - ULONG64 TraceHandle; - ULONG MessageFlags; - LPCGUID MessageGuid; - USHORT MessageNumber; - va_list Args; - ULONG result; -} STOR_WMI_TRACE_MESSAGE_ARGS, *PSTOR_WMI_TRACE_MESSAGE_ARGS; - -// -// RtlInitUnicodeString -// - -typedef struct _STOR_INIT_UNICODE_STRING_ARGS { - PVOID DestinationString; - PCWSTR SourceString; -} STOR_INIT_UNICODE_STRING_ARGS, *PSTOR_INIT_UNICODE_STRING_ARGS; - - -// -// IoWMIRegistrationControl -// - -typedef struct _STOR_WMI_REGCONTROL_ARGS { - PVOID DeviceObject; - ULONG Action; - ULONG result; -} STOR_WMI_REGCONTROL_ARGS, *PSTOR_WMI_REGCONTROL_ARGS; - - -// -// IoWMIRegistrationControl -// - -typedef struct _STOR_WMI_QUERYTRACEINFO_ARGS { - ULONG TraceInformationClass; - PVOID TraceInformation; - ULONG TraceInformationLength; - PULONG RequiredLength; - PVOID Buffer; - ULONG result; -} STOR_WMI_QUERYTRACEINFO_ARGS, *PSTOR_WMI_QUERYTRACEINFO_ARGS; - - -// -// WppInitGlobalLogger -// - -typedef struct _STOR_INITGLOBALLOGGER_ARGS { - LPCGUID ControlGuid; - PVOID Logger; - PVOID Flags; - PVOID Level; -} STOR_INITGLOBALLOGGER_ARGS, *PSTOR_INITGLOBALLOGGER_ARGS; - -// -// memset -// -#define StorMemSet(dst, val, count) \ -{ \ - ULONG _i = count; \ - while (_i) { \ - *((char *)dst+_i-1) = (char)val; \ - _i--; \ - } \ -} - -// -// StorInitTracing -// - -ULONG -__inline -StorInitTracing( - __in PVOID InitInfo - ) -{ - STOR_INIT_TRACING_ARGS args = {InitInfo, 0xC00000BB}; - _PortTraceNotification(TraceNotification, NULL, InitTracing, &args); - - return args.Result; -} - -// -// StorCleanupTracing -// - -VOID -__inline -StorCleanupTracing( - __in PVOID TraceContext - ) -{ - STOR_CLEANUP_TRACING_ARGS args = {TraceContext}; - _PortTraceNotification(TraceNotification, NULL, CleanupTracing, &args); -} - -// -// TraceDriverLogEvent -// - -ULONG -__inline -StorTraceDiagLogEvent( - __in PVOID DeviceExtension, - __in STORAGE_TRACE_CONTEXT TraceContext, - __in PVOID Event - ) -{ - STOR_LOG_DIAG_EVENT_ARGS args = {TraceContext, Event}; - _PortTraceNotification(TraceNotification, DeviceExtension, LogDiagEvent, &args); - return args.result; -} - -// -// TraceDriverAllocEvent -// - -PVOID -__inline -StorTraceDiagAllocEvent( - __in PVOID DeviceExtension, - __in STORAGE_TRACE_CONTEXT TraceContext, - __in ULONG DataSize, - __in BOOLEAN Allocate - ) -{ - STOR_ALLOC_DIAG_EVENT_ARGS args = {TraceContext, DataSize, Allocate}; - _PortTraceNotification(TraceNotification, DeviceExtension, AllocDiagEvent, &args); - - return args.result; -} - -// -// TraceDriverFreeEvent -// - -VOID -__inline -StorTraceDiagFreeEvent( - __in PVOID DeviceExtension, - __in STORAGE_TRACE_CONTEXT TraceContext, - __in PVOID Event - ) -{ - STOR_FREE_DIAG_EVENT_ARGS args = {TraceContext, Event}; - _PortTraceNotification(TraceNotification, DeviceExtension, FreeDiagEvent, &args); -} - -// -// WriteErrorLogEntry -// - -VOID -__inline -StorTraceErrorWriteRecord( - __in PVOID DeviceExtension, - __in PVOID Arg1, - __in PVOID Arg2 - ) -{ - STOR_WRITE_EL_RECORD_ARGS args = {Arg1, Arg2}; - _PortTraceNotification(TraceNotification, DeviceExtension, WriteErrorLogRecord, &args); -} - -// -// AllocateErrorLogEntry -// - -PSTORAGE_ERRORLOG_PACKET -__inline -StorTraceErrorAllocRecord( - __in PVOID DeviceExtension, - __in STORAGE_TRACE_CONTEXT TraceContext, - __in ULONG Size - ) -{ - STOR_ALLOC_EL_RECORD_ARGS args = {TraceContext, Size}; - _PortTraceNotification(TraceNotification, DeviceExtension, AllocErrorLog, &args); - return args.Result; -} - -// -// FreeErrorLogEntry -// - -VOID -__inline -StorTraceErrorFreeRecord( - __in PVOID DeviceExtension, - __in STORAGE_TRACE_CONTEXT TraceContext, - __in PSTORAGE_ERRORLOG_PACKET ErrorLogPacket - ) -{ - STOR_FREE_EL_RECORD_ARGS args = {TraceContext, ErrorLogPacket}; - _PortTraceNotification(TraceNotification, DeviceExtension, FreeErrorLog, &args); -} - -// -// WmiTraceMessage -// - -ULONG -__inline -StorWmiTraceMessage( - __in ULONG64 Arg1, - __in ULONG Arg2, - __in LPCGUID Arg3, - __in USHORT Arg4, - ... - ) -{ - STOR_WMI_TRACE_MESSAGE_ARGS args = {Arg1, Arg2, Arg3, Arg4, }; - va_list ap; - va_start(ap, Arg4); - args.Args = ap; - - _PortTraceNotification(TraceNotification, NULL, TraceMessage, &args); - return args.result; -} - -// -// RtlInitUnicodeString -// - -VOID -__inline -StorRtlInitUnicodeString( - __inout PVOID Arg1, - __in PCWSTR Arg2 - ) -{ - STOR_INIT_UNICODE_STRING_ARGS args = {Arg1, Arg2}; - _PortTraceNotification(TraceNotification, NULL, InitUnicodeString, &args); -} - -// -// WppInitGlobalLogger -// - -VOID -__inline -StorWppInitGlobalLogger( - __in LPCGUID Arg1, - __in PVOID Arg2, - __in PVOID Arg3, - __in PVOID Arg4 - ) -{ - STOR_INITGLOBALLOGGER_ARGS args = {Arg1, Arg2, Arg3, Arg4}; - _PortTraceNotification(TraceNotification, NULL, InitGlobalLogger, &args); -} - -// -// IoWMIRegistrationControl -// - -ULONG -__inline -StorIoWMIRegistrationControl( - __in PVOID Arg1, - __in ULONG Arg2 - ) -{ - STOR_WMI_REGCONTROL_ARGS args = {Arg1, Arg2}; - _PortTraceNotification(TraceNotification, NULL, WMIRegistrationControl, &args); - return args.result; -} - -// -// WmiQueryTraceInformation -// - -ULONG -__inline -StorWmiQueryTraceInformation( - __in ULONG Arg1, - __out PVOID Arg2, - __in ULONG Arg3, - __out PULONG Arg4, - __in PVOID Arg5 - ) -{ - STOR_WMI_QUERYTRACEINFO_ARGS args = {Arg1, Arg2, Arg3, Arg4, Arg5}; - _PortTraceNotification(TraceNotification, NULL, WmiQueryTraceInfo, &args); - return args.result; -} - - -/* -// -// DebugPrint -// - -VOID -__inline -StorDebugPrint( - __in PCHAR Arg1, - __in va_list Arg2 - ) -{ - STOR_DEBUGPRINT_ARGS args = {Arg1, Arg2}; - _PortTraceNotification(TraceNotification, NULL, TraceDebugPrint, &args); -} - - -#ifdef DO_DBGPRINT -#define WPP_DEBUG(A) StorDebugPrint A -#endif -*/ - -#endif - diff --git a/qt-correction-tool/pub/ddk/strmini.h b/qt-correction-tool/pub/ddk/strmini.h deleted file mode 100644 index 402e9f4..0000000 --- a/qt-correction-tool/pub/ddk/strmini.h +++ /dev/null @@ -1,1381 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - STRMINI.H - -Abstract: - - This file defines streaming minidriver structures and class/minidriver - interfaces. - -Author: - - Bill Parry - -Environment: - - Kernel mode only - -Revision History: - ---*/ - -#ifndef _STREAM_H -#define _STREAM_H - -#include -#include -#include -#include "ks.h" - -#define STREAMAPI __stdcall - -typedef unsigned __int64 STREAM_SYSTEM_TIME, - *PSTREAM_SYSTEM_TIME; -typedef unsigned __int64 STREAM_TIMESTAMP, - *PSTREAM_TIMESTAMP; -#define STREAM_SYSTEM_TIME_MASK ((STREAM_SYSTEM_TIME)0x00000001FFFFFFFF) -// -// debug print level values -// - -typedef enum { // Use the given level to indicate: - DebugLevelFatal = 0, // * imminent nonrecoverable system failure - DebugLevelError, // * serious error, though recoverable - DebugLevelWarning, // * warnings of unusual occurances - DebugLevelInfo, // * status and other information - normal - // though - // perhaps unusual events. System MUST remain - // responsive. - DebugLevelTrace, // * trace information - normal events - // system need not ramain responsive - DebugLevelVerbose, // * verbose trace information - // system need not remain responsive - DebugLevelMaximum -} STREAM_DEBUG_LEVEL; - -#define DebugLevelAlways DebugLevelFatal - -#if DBG - -// -// macro for printing debug information -// -#define DebugPrint(x) StreamClassDebugPrint x - -// -// macro for doing INT 3 (or non-x86 equivalent) -// - -#if WIN95_BUILD - -#define DEBUG_BREAKPOINT() _asm int 3; - -#else - -#define DEBUG_BREAKPOINT() DbgBreakPoint() - -#endif - -// -// macro for asserting (stops if not = TRUE) -// - -#define DEBUG_ASSERT(exp) \ - if ( !(exp) ) { \ - StreamClassDebugAssert( __FILE__, __LINE__, #exp, exp); \ - } - -#else - -#define DebugPrint(x) -#define DEBUG_BREAKPOINT() -#define DEBUG_ASSERT(exp) - -#endif - -// -// Uninitialized flag value. -// - -#define MP_UNINITIALIZED_VALUE ((ULONG) ~0) - -// -// define physical address formats -// - -typedef PHYSICAL_ADDRESS STREAM_PHYSICAL_ADDRESS, - *PSTREAM_PHYSICAL_ADDRESS; - - -// -// functions for the time context structure below -// - -typedef enum { - - TIME_GET_STREAM_TIME, - TIME_READ_ONBOARD_CLOCK, - TIME_SET_ONBOARD_CLOCK -} TIME_FUNCTION; - -// -// define the time context structure -// - -typedef struct _HW_TIME_CONTEXT { - - struct _HW_DEVICE_EXTENSION *HwDeviceExtension; - struct _HW_STREAM_OBJECT *HwStreamObject; - TIME_FUNCTION Function; - ULONGLONG Time; - ULONGLONG SystemTime; -} HW_TIME_CONTEXT, *PHW_TIME_CONTEXT; - -// -// define the event descriptor for enabling/disabling events. -// - -typedef struct _HW_EVENT_DESCRIPTOR { - BOOLEAN Enable; // TRUE means this is an enable, FALSE means disable - PKSEVENT_ENTRY EventEntry; // event structure - PKSEVENTDATA EventData; // data representing this event - union { - struct _HW_STREAM_OBJECT * StreamObject; // stream object for the event - struct _HW_DEVICE_EXTENSION *DeviceExtension; - }; - ULONG EnableEventSetIndex; // gives the index of the event set for ENABLE - // field has no meaning for DISABLE - -#if (NTDDI_VERSION >= NTDDI_WINXP) - PVOID HwInstanceExtension; - ULONG Reserved; -#else - ULONG Reserved[2]; // Reserved for future use -#endif - -} HW_EVENT_DESCRIPTOR, *PHW_EVENT_DESCRIPTOR; - -// -// function prototypes for stream object functions -// - -#pragma warning( disable : 4115) -typedef VOID - (STREAMAPI * PHW_RECEIVE_STREAM_DATA_SRB) ( // HwReceiveDataPacket - IN struct _HW_STREAM_REQUEST_BLOCK * SRB -); - -typedef VOID - (STREAMAPI * PHW_RECEIVE_STREAM_CONTROL_SRB) ( // HwReceiveControlPacket - IN struct _HW_STREAM_REQUEST_BLOCK * SRB -); - -typedef NTSTATUS - (STREAMAPI * PHW_EVENT_ROUTINE) ( // HwEventRoutine - IN PHW_EVENT_DESCRIPTOR EventDescriptor -); -#pragma warning( default : 4115) -typedef VOID - (STREAMAPI * PHW_CLOCK_FUNCTION) ( // HwClockFunction - IN PHW_TIME_CONTEXT HwTimeContext -); - -// -// define the clock object -// - -typedef struct _HW_CLOCK_OBJECT { - - // - // pointer to the minidriver's clock function - // - - PHW_CLOCK_FUNCTION HwClockFunction; - - // - // support flags as defined below - // - - ULONG ClockSupportFlags; - - ULONG Reserved[2]; // Reserved for future use -} HW_CLOCK_OBJECT, *PHW_CLOCK_OBJECT; - -// -// clock object support flags defined as follows -// - -// -// indicates that the minidriver's clock for this stream is tunable -// via TIME_SET_ONBOARD_CLOCK -// - -#define CLOCK_SUPPORT_CAN_SET_ONBOARD_CLOCK 0x00000001 - -// -// indicates that the minidriver's clock for this stream is raw readable -// via TIME_READ_ONBOARD_CLOCK -// - -#define CLOCK_SUPPORT_CAN_READ_ONBOARD_CLOCK 0x00000002 - -// -// indicates that the minidriver can return the current stream time for this -// stream via TIME_GET_STREAM_TIME -// - -#define CLOCK_SUPPORT_CAN_RETURN_STREAM_TIME 0x00000004 - -// -// stream object definition -// - -typedef struct _HW_STREAM_OBJECT { - ULONG SizeOfThisPacket; // size of this structure - ULONG StreamNumber; // number of this stream - PVOID HwStreamExtension; // minidriver's stream extension - PHW_RECEIVE_STREAM_DATA_SRB ReceiveDataPacket; // receive data packet routine - PHW_RECEIVE_STREAM_CONTROL_SRB ReceiveControlPacket; // receive control packet routine - HW_CLOCK_OBJECT HwClockObject; // clock object to be filled in by - // minidriver - BOOLEAN Dma; // device uses busmaster DMA - // for this stream - BOOLEAN Pio; // device uses PIO for this - PVOID HwDeviceExtension; // minidriver's device ext. - - ULONG StreamHeaderMediaSpecific; // Size of media specific per - // stream header expansion. - ULONG StreamHeaderWorkspace; // Size of per-stream header workspace. - BOOLEAN Allocator; // Set to TRUE if allocator is needed for this stream. - - // - // the following routine receives ENABLE and DISABLE notification of - // KS synchronization events for this stream. - // - - PHW_EVENT_ROUTINE HwEventRoutine; - - ULONG Reserved[2]; // Reserved for future use - -} HW_STREAM_OBJECT, *PHW_STREAM_OBJECT; - -// -// the following structures are used to report which stream types and properties -// are supported by the minidriver. the HW_STREAM_HEADER structure is followed -// in memory by one or more HW_STREAM_INFORMATION structures. See the -// HW_STREAM_DESCRIPTOR structure below. -// - -typedef struct _HW_STREAM_HEADER { - - // - // indicates the number of HW_STREAM_INFORMATION structures follow this - // structure. - // - - ULONG NumberOfStreams; - - // - // size of the HW_STREAM_INFORMATION structure below (filled in by the - // minidriver) - // - - ULONG SizeOfHwStreamInformation; - - // - // indicates the number of property sets supported by the device itself. - // - - ULONG NumDevPropArrayEntries; - - // - // pointer to the array of device property sets. - // - - PKSPROPERTY_SET DevicePropertiesArray; - - // - // indicates the number of event sets supported by the device itself. - // - - ULONG NumDevEventArrayEntries; - - // - // pointer to the array of device property sets. - // - - PKSEVENT_SET DeviceEventsArray; - - // - // pointer to the topology structure - // - - PKSTOPOLOGY Topology; - - // - // event routine for processing device events, if any. - // - - PHW_EVENT_ROUTINE DeviceEventRoutine; - -#if (NTDDI_VERSION >= NTDDI_WINXP) - LONG NumDevMethodArrayEntries; - PKSMETHOD_SET DeviceMethodsArray; -#else - ULONG Reserved[2]; // Reserved for future use -#endif - -} HW_STREAM_HEADER, *PHW_STREAM_HEADER; - -// -// the HW_STREAM_INFORMATION structure(s) indicate what streams are supported -// - -typedef struct _HW_STREAM_INFORMATION { - - // - // number of possible instances of this stream that can be opened at once - // - - ULONG NumberOfPossibleInstances; - - // - // Indicates the direction of data flow of this stream - // - - KSPIN_DATAFLOW DataFlow; - - // - // Indicates whether the data is "seen" by the host processor. If the - // data is not visible to the processor (such as an NTSC output port) - // this boolean is set to false. - // - - BOOLEAN DataAccessible; - - // - // Number of formats supported by this stream. Indicates the number of - // elements pointed to by StreamFormatsArray below. - // - - ULONG NumberOfFormatArrayEntries; - - // - // pointer to an array of elements indicating what types of data are - // supported with this stream. - // - - __field_ecount(NumberOfFormatArrayEntries) - PKSDATAFORMAT* StreamFormatsArray; - - // - // reserved for future use. - // - - PVOID ClassReserved[4]; - - // - // number of property sets supported by this stream - // - - ULONG NumStreamPropArrayEntries; - - // - // pointer to an array of property set descriptors for this stream - // - - __field_ecount(NumStreamPropArrayEntries) - PKSPROPERTY_SET StreamPropertiesArray; - - // - // number of event sets supported by this stream - // - - ULONG NumStreamEventArrayEntries; - - // - // pointer to an array of event set descriptors for this stream - // - - __field_ecount(NumStreamEventArrayEntries) - PKSEVENT_SET StreamEventsArray; - - // - // pointer to guid representing catagory of stream. (optional) - // - - GUID* Category; - - // - // pointer to guid representing name of stream. (optional) - // - - GUID* Name; - - // - // count of media supported (optional) - // - - ULONG MediumsCount; - - // - // pointer to array of media (optional) - // - - __field_ecount(MediumsCount) - const KSPIN_MEDIUM* Mediums; - - // - // indicates that this stream is a bridge stream (COMMUNICATIONS BRIDGE) - // this field should be set to FALSE by most minidrivers. - // - - BOOLEAN BridgeStream; - ULONG Reserved[2]; // Reserved for future use - -} HW_STREAM_INFORMATION, *PHW_STREAM_INFORMATION; - - -typedef struct _HW_STREAM_DESCRIPTOR { - - // - // header as defined above - // - - HW_STREAM_HEADER StreamHeader; - - // - // one or more of the following, as indicated by NumberOfStreams in the - // header. - // - - HW_STREAM_INFORMATION StreamInfo; - -} HW_STREAM_DESCRIPTOR, *PHW_STREAM_DESCRIPTOR; - -// -// STREAM Time Reference structure -// - -typedef struct _STREAM_TIME_REFERENCE { - STREAM_TIMESTAMP CurrentOnboardClockValue; // current value of adapter - // clock - LARGE_INTEGER OnboardClockFrequency; // frequency of adapter clock - LARGE_INTEGER CurrentSystemTime; // KeQueryPeformanceCounter time - ULONG Reserved[2]; // Reserved for future use -} STREAM_TIME_REFERENCE, *PSTREAM_TIME_REFERENCE; - -// -// data intersection structure. this structure is point to by the -// Srb->CommandData.IntersectInfo field of the SRB on an -// SRB_GET_DATA_INTERSECTION operation. -// - -typedef struct _STREAM_DATA_INTERSECT_INFO { - - // - // stream number to check - // - - ULONG StreamNumber; - - // - // pointer to the input data range to verify. - // - - PKSDATARANGE DataRange; - - // - // pointer to buffer which receives the format block if successful - // - - __field_bcount(SizeOfDataFormatBuffer) - PVOID DataFormatBuffer; - - // - // size of the above buffer. set to sizeof(ULONG) if the caller just - // wants to know what size is needed. - // - - ULONG SizeOfDataFormatBuffer; - -} STREAM_DATA_INTERSECT_INFO, *PSTREAM_DATA_INTERSECT_INFO; - -// -// stream property descriptor structure. this descriptor is referenced in -// Srb->CommandData.PropertyInfo field of the SRB on an SRB_GET or -// SRB_SET_PROPERTY operation. -// - -typedef struct _STREAM_PROPERTY_DESCRIPTOR { - - // - // pointer to the property GUID and ID - // - - PKSPROPERTY Property; - - // - // zero-based ID of the property, which is an index into the array of - // property sets filled in by the minidriver. - // - - ULONG PropertySetID; - - // - // pointer to the information about the property (or the space to return - // the information) passed in by the client - // - - PVOID PropertyInfo; - - // - // size of the client's input buffer - // - - ULONG PropertyInputSize; - - // - // size of the client's output buffer - // - - ULONG PropertyOutputSize; -} STREAM_PROPERTY_DESCRIPTOR, *PSTREAM_PROPERTY_DESCRIPTOR; - - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -typedef struct _STREAM_METHOD_DESCRIPTOR { - ULONG MethodSetID; - PKSMETHOD Method; - PVOID MethodInfo; - LONG MethodInputSize; - LONG MethodOutputSize; -} STREAM_METHOD_DESCRIPTOR, *PSTREAM_METHOD_DESCRIPTOR; - -#endif - -// -// STREAM I/O Request Block (SRB) structures and functions -// - -#define STREAM_REQUEST_BLOCK_SIZE sizeof(STREAM_REQUEST_BLOCK) - -// -// SRB command codes -// - -typedef enum _SRB_COMMAND { - - // - // stream specific codes follow - // - - SRB_READ_DATA, // read data from hardware - SRB_WRITE_DATA, // write data to the hardware - SRB_GET_STREAM_STATE, // get the state of the stream - SRB_SET_STREAM_STATE, // set the state of the stream - SRB_SET_STREAM_PROPERTY, // set a property of the stream - SRB_GET_STREAM_PROPERTY, // get a property value for the stream - SRB_OPEN_MASTER_CLOCK, // indicates that the master clock is on this - // stream - SRB_INDICATE_MASTER_CLOCK, // supplies the handle to the master clock - SRB_UNKNOWN_STREAM_COMMAND, // IRP function is unknown to class driver - SRB_SET_STREAM_RATE, // set the rate at which the stream should run - SRB_PROPOSE_DATA_FORMAT, // propose a new format, DOES NOT CHANGE IT! - SRB_CLOSE_MASTER_CLOCK, // indicates that the master clock is closed - SRB_PROPOSE_STREAM_RATE, // propose a new rate, DOES NOT CHANGE IT! - SRB_SET_DATA_FORMAT, // sets a new data format - SRB_GET_DATA_FORMAT, // returns the current data format - SRB_BEGIN_FLUSH, // beginning flush state - SRB_END_FLUSH, // ending flush state - - // - // device/instance specific codes follow - // - - SRB_GET_STREAM_INFO = 0x100,// get the stream information structure - SRB_OPEN_STREAM, // open the specified stream - SRB_CLOSE_STREAM, // close the specified stream - SRB_OPEN_DEVICE_INSTANCE, // open an instance of the device - SRB_CLOSE_DEVICE_INSTANCE, // close an instance of the device - SRB_GET_DEVICE_PROPERTY, // get a property of the device - SRB_SET_DEVICE_PROPERTY, // set a property for the device - SRB_INITIALIZE_DEVICE, // initialize the device - SRB_CHANGE_POWER_STATE, // change power state - SRB_UNINITIALIZE_DEVICE, // uninitialize the device - SRB_UNKNOWN_DEVICE_COMMAND, // IRP function is unknown to class driver - SRB_PAGING_OUT_DRIVER, // indicates that the driver is to be paged out - // only sent if enabled in registry. board ints - // should be disabled & STATUS_SUCCESS returned. - SRB_GET_DATA_INTERSECTION, // returns stream data intersection - SRB_INITIALIZATION_COMPLETE,// indicates init sequence has completed - SRB_SURPRISE_REMOVAL // indicates surprise removal of HW has occurred - -#if (NTDDI_VERSION >= NTDDI_WINXP) - - , SRB_DEVICE_METHOD - , SRB_STREAM_METHOD - -#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1) - - , SRB_NOTIFY_IDLE_STATE // called on first open and last close - -#endif - -#endif - -} SRB_COMMAND; - -// -// definition for scatter/gather -// - -typedef struct { - PHYSICAL_ADDRESS PhysicalAddress; - ULONG Length; -} KSSCATTER_GATHER, *PKSSCATTER_GATHER; - - -typedef struct _HW_STREAM_REQUEST_BLOCK { - ULONG SizeOfThisPacket; // sizeof STREAM_REQUEST_BLOCK - // (version check) - SRB_COMMAND Command; // SRB command, see SRB_COMMAND enumeration - NTSTATUS Status; // SRB completion status - PHW_STREAM_OBJECT StreamObject; - // minidriver's stream object for this request - PVOID HwDeviceExtension; // minidriver's device ext. - PVOID SRBExtension; // per-request workspace for the - // minidriver - - // - // the following union passes in the information needed for the various - // SRB - // functions. - // - - union _CommandData { - - // - // pointer to the data descriptor for SRB_READ or SRB_WRITE_DATA - // - __field_ecount(NumberOfBuffers) - PKSSTREAM_HEADER DataBufferArray; - - // - // pointer to the stream descriptor for SRB_GET_STREAM_INFO - // - - PHW_STREAM_DESCRIPTOR StreamBuffer; - - // - // pointer to the state for SRB_GET or SRB_SET_DEVICE_STATE - // - - KSSTATE StreamState; - - // - // pointer to the time structure for SRB_GET and - // SRB_SET_ONBOARD_CLOCK - // - - PSTREAM_TIME_REFERENCE TimeReference; - - // - // pointer to the property descriptor for SRB_GET and - // SRB_SET_PROPERTY - // - - PSTREAM_PROPERTY_DESCRIPTOR PropertyInfo; - - // - // pointer to the requested format for SRB_OPEN_STREAM and - // SRB_PROPOSE_DATA_FORMAT - // - - PKSDATAFORMAT OpenFormat; - - // - // pointer to the PORT_CONFIGURATION_INFORMATION struct for - // SRB_INITIALIZE_DEVICE - // - - struct _PORT_CONFIGURATION_INFORMATION *ConfigInfo; - - // - // handle to the master clock. - // - - HANDLE MasterClockHandle; - - // - // power state - // - - DEVICE_POWER_STATE DeviceState; - - // - // data intersection info - // - - PSTREAM_DATA_INTERSECT_INFO IntersectInfo; - -#if (NTDDI_VERSION >= NTDDI_WINXP) - - PVOID MethodInfo; - - // - // Filter type index for OPEN_DEVICE_INSTANCE - // - LONG FilterTypeIndex; - -#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1) - - // - // Indicates whether an SRB_NOTIFY_IDLE_STATE is calling to inform - // that the device is idle -- no more handles to the device are - // open (TRUE) -- or to inform that the device is no longer idle -- - // a handle to the device has been opened (FALSE). - // - BOOLEAN Idle; - -#endif - -#endif - - } CommandData;// union for command data - - // - // field for indicating the number of KSSTREM_HEADER elements pointed to - // by the DataBufferArray field above. - // - - ULONG NumberOfBuffers; - - // - // the following fields are used to time the request. The class driver - // will set both of these fields to a nonzero value when the request - // is received by the minidriver, and then begin counting down the - // TimeoutCounter field until it reaches zero. When it reaches zero, - // the minidriver's timeout handler will be called. If the minidriver - // queues a request for a long time, it should set the TimeoutCounter to - // zero to turn off the timer, and once the request is dequeued should - // set the TimeoutCounter field to the value in TimeoutOriginal. - // - - ULONG TimeoutCounter; // timer countdown value in seconds - ULONG TimeoutOriginal; // original timeout value in seconds - struct _HW_STREAM_REQUEST_BLOCK *NextSRB; - // link field available to minidriver for queuing - PIRP Irp; // pointer to original IRP, usually not - // needed. - ULONG Flags; // flags defined below. - - // - // To indicate the filter instance extension - // - PVOID HwInstanceExtension; - - // pointer to the instance extension - // - // the following union is used to indicate to the minidriver the amount - // of data to transfer, and used by the minidriver to report the amount - // of data it was actually able to transfer. - // - - union { - ULONG NumberOfBytesToTransfer; - ULONG ActualBytesTransferred; - }; - - __field_ecount(NumberOfScatterGatherElements) - PKSSCATTER_GATHER ScatterGatherBuffer; // buffer pointing to array - // of s/g elements - ULONG NumberOfPhysicalPages; // # of physical pages in request - - ULONG NumberOfScatterGatherElements; - // # of physical elements pointed - // to by ScatterGatherBuffer - - ULONG Reserved[1]; // Reserved for future use - -} HW_STREAM_REQUEST_BLOCK, *PHW_STREAM_REQUEST_BLOCK; - -// -// flags definitions for CRB -// - -// -// this flag indicates that the request is either an SRB_READ_DATA or -// SRB_WRITE_DATA request, as opposed to a non-data request. -// - -#define SRB_HW_FLAGS_DATA_TRANSFER 0x00000001 - -// -// this flag indicates that the request is for a stream, as opposed to being -// for the device. -// - -#define SRB_HW_FLAGS_STREAM_REQUEST 0x00000002 - -// -// Structure defining the buffer types for StreamClassGetPhysicalAddress. -// - -typedef enum { - PerRequestExtension, // indicates the phys address of the SRB - // extension - DmaBuffer, // indicates the phys address of the DMA - // buffer - SRBDataBuffer // indicates the phys address of a data - // buffer -} STREAM_BUFFER_TYPE; - -// -// Structure for I/O and Memory address ranges -// - -typedef struct _ACCESS_RANGE { - __field_bcount(RangeLength) - STREAM_PHYSICAL_ADDRESS RangeStart; // start of the range - ULONG RangeLength;// length of the range - BOOLEAN RangeInMemory; // FALSE if a port address - ULONG Reserved; // -} ACCESS_RANGE, *PACCESS_RANGE; - - -// -// Configuration information structure. Contains the information necessary -// to initialize the adapter. -// - -typedef struct _PORT_CONFIGURATION_INFORMATION { - ULONG SizeOfThisPacket; // Size of this structure, used as - // version check - PVOID HwDeviceExtension; // minidriver's device extension - - // - // the below field supplies a pointer to the device's functional - // device object, which is created by stream class. - // Most minidrivers will not need to use this. - // - - PDEVICE_OBJECT ClassDeviceObject; // class driver's FDO - - // - // the below field supplies a pointer to the device's "attached" physical - // device object, which is returned from IoAttachDeviceToDeviceStack. - // Most minidrivers will not need to use this. - // This PDO must be used for calls to IoCallDriver. See the note below - // for the RealPhysicalDeviceObject, and also see WDM documentation. - // - - PDEVICE_OBJECT PhysicalDeviceObject; // attached physical device object - - ULONG SystemIoBusNumber; // IO bus number (0 for machines that - // have - // only 1 IO bus) - - INTERFACE_TYPE AdapterInterfaceType; // Adapter interface type - // supported by HBA: - // Internal - // Isa - // Eisa - // MicroChannel - // TurboChannel - // PCIBus - // VMEBus - // NuBus - // PCMCIABus - // CBus - // MPIBus - // MPSABus - - ULONG BusInterruptLevel; // interrupt level - ULONG BusInterruptVector; // interrupt vector - KINTERRUPT_MODE InterruptMode; // interrupt mode (latched, level) - - ULONG DmaChannel; // DMA channel - - // - // Specifies the number of AccessRanges elements in the array, - // described next. The OS-specific class driver always sets this - // member to the value passed in the HW_INITIALIZATION_DATA - // structure when the minidriver driver called CodecXXXInitialize. - // - - ULONG NumberOfAccessRanges; // Number of access ranges - // allocated - - // - // Points to the first element of an array of ACCESS_RANGE-type elements. - // The given NumberOfAccessRanges determines how many elements must be - // configured with bus-relative range values. The AccessRanges - // pointer must be NULL if NumberOfAccessRanges is zero. - // - __field_ecount(NumberOfAccessRanges) - PACCESS_RANGE AccessRanges; // Pointer to array of access range - // elements - - // - // the following field is filled in by the minidriver to indicate the - // size of the buffer needed to build the HW_STREAM_DESCRIPTOR structure - // and all of its substructures. - // - - ULONG StreamDescriptorSize; // size of the stream descriptor - - PIRP Irp; // IRP for PNP start function, normally - // not used by the minidriver. - - // - // the following field indicates the interrupt object for the adapter - // if nonzero. This field is normally not used by the minidriver. - // - - PKINTERRUPT InterruptObject; - - // - // the following field indicates the DMA adapter object for the adapter - // if nonzero. This field is normally not used by the minidriver. - // - - PADAPTER_OBJECT DmaAdapterObject; - - // - // the below field supplies a pointer to the device's "real" physical - // device object, which is supplied on the AddDevice call. Most - // minidrivers will not need to use this. - // This PDO must be used for registry access, etc. See the note above - // for the PhysicalDeviceObject, and also see WDM documentation. - // - - PDEVICE_OBJECT RealPhysicalDeviceObject; // real physical device object - - ULONG Reserved[1]; // Reserved for future use - -} PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION; - -// -// Function prototypes for minidriver routines called by the class driver -// - - -typedef VOID - (STREAMAPI * PHW_RECEIVE_DEVICE_SRB) ( // HwReceivePacket - // routine - IN PHW_STREAM_REQUEST_BLOCK SRB -); - -typedef VOID - (STREAMAPI * PHW_CANCEL_SRB) ( // HwCancelPacket routine - IN PHW_STREAM_REQUEST_BLOCK SRB -); - -typedef VOID - (STREAMAPI * PHW_REQUEST_TIMEOUT_HANDLER) ( // HwRequestTimeoutHandle - // - // r routine - IN PHW_STREAM_REQUEST_BLOCK SRB -); - -typedef BOOLEAN - (STREAMAPI * PHW_INTERRUPT) ( // HwInterrupt routine - IN PVOID DeviceExtension -); - -typedef VOID - (STREAMAPI * PHW_TIMER_ROUTINE) ( // timer callback routine - IN PVOID Context -); - -typedef VOID - (STREAMAPI * PHW_PRIORITY_ROUTINE) ( // change priority - // callback routine - IN PVOID Context -); - -typedef VOID - (STREAMAPI * PHW_QUERY_CLOCK_ROUTINE) ( // query clock - // callback routine - IN PHW_TIME_CONTEXT TimeContext -); - - -typedef BOOLEAN - (STREAMAPI * PHW_RESET_ADAPTER) ( // HwResetAdapter routine - IN PVOID DeviceExtension -); - - -// -// Minidriver stream notification types passed in to StreamClassStreamNotification -// follow. -// - -typedef enum _STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE { - - // - // indicates that the minidriver is ready for the next stream data - // request - // - - ReadyForNextStreamDataRequest, - - // - // indicates that the minidriver is ready for the next stream control - // request - // - - ReadyForNextStreamControlRequest, - - // - // indicates that the hardware is starved for data - // - - HardwareStarved, - - // - // indicates that the specified STREAM SRB has completed - // - - StreamRequestComplete, - SignalMultipleStreamEvents, - SignalStreamEvent, - DeleteStreamEvent, - StreamNotificationMaximum -} STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE, *PSTREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE; - -// -// Minidriver device notification types passed in to StreamClassDeviceNotification -// follow. -// - -// notes for SignalMultipleDeviceEvents and SignalMultipleDeviceInstanceEvents: -// -// SignalMultipleDeviceEvents: should only be used by single instance legacy drivers -// SignalMultipleDeviceInstanceEvents: this should be used by multiple instance drivers -// These types are used by StreamClassDeviceNotification(). -// -// When SignalMultipleDeviceEvents is used the function should be called -// as StreamClassDeviceNotification( SignalMultipleDeviceEvents, -// pHwDeviceExtension, -// pEventGUID, -// EventItem); -// -// When SignalMultipleDeviceInstanceEvents is used the function should be passed in -// as StreamClassDeviceNotification( SignalMultipleDeviceInstanceEvents, -// pHwDeviceExtension, -// pHwInstanceExtesnion, -// pEventGUID, -// EventItem); -// -typedef enum _STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE { - - // - // indicates that the minidriver is ready for the next device request - // - - ReadyForNextDeviceRequest, - - // - // indicates that the specified DEVICE SRB has completed - // - - DeviceRequestComplete, - SignalMultipleDeviceEvents, - SignalDeviceEvent, - DeleteDeviceEvent, -#if (NTDDI_VERSION >= NTDDI_WINXP) - SignalMultipleDeviceInstanceEvents, -#endif - DeviceNotificationMaximum -} STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE, *PSTREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE; - -// -// Structure passed between minidriver initialization -// and STREAM class initialization -// - -typedef struct _HW_INITIALIZATION_DATA { -#if (NTDDI_VERSION >= NTDDI_WINXP) - union { - - // - // This first 4 bytes was used as a field for the size of this structure. - // We split this field into 2 ushorts to contain the size of this packet - // and a version number which stream class driver uses to recognize that - // the last two fields, NumNameExtensions and NameExtensionArray are valid - // information instead of uninitialized ramdom values. We hereby designate - // the StreamClassVersion to be 0x0200. - // - #define STREAM_CLASS_VERSION_20 0x0200 - ULONG HwInitializationDataSize; // Size of this structure, - struct { - USHORT SizeOfThisPacket; // Size of this packet. - USHORT StreamClassVersion; // Must be 0x0200 - }; - }; -#else - ULONG HwInitializationDataSize; // Size of this structure, - // used as version check. -#endif - - // - // minidriver routines follow - // - - PHW_INTERRUPT HwInterrupt;// minidriver's interrupt routine - PHW_RECEIVE_DEVICE_SRB HwReceivePacket; - // minidriver's request routine - PHW_CANCEL_SRB HwCancelPacket; - // minidriver's cancel routine - - PHW_REQUEST_TIMEOUT_HANDLER HwRequestTimeoutHandler; - // minidriver's timeout handler routine - - // - // minidriver resources follow - // - - ULONG DeviceExtensionSize; // size in bytes of the - // minidrivers - // per-adapter device extension data - ULONG PerRequestExtensionSize; // size of per-request - // workspace - ULONG PerStreamExtensionSize; // size of per-stream workspace - ULONG FilterInstanceExtensionSize; // size of the filter - // instance extension - - BOOLEAN BusMasterDMA; // Adapter uses bus master DMA for - // one or more streams - BOOLEAN Dma24BitAddresses; // TRUE indicates 24 bit DMA only - // (ISA) - ULONG BufferAlignment; // buffer alignment mask - - // - // the following BOOLEAN should be set to FALSE unless the minidriver - // can deal with multiprocessor reentrancy issues! - // - - BOOLEAN TurnOffSynchronization; - - // - // size of DMA buffer needed by minidriver. The minidriver may obtain - // its DMA buffer by calling StreamClassGetDmaBuffer while or after - // SRB_INITIALIZE_DEVICE is received. - // - - ULONG DmaBufferSize; - -#if (NTDDI_VERSION >= NTDDI_WINXP) - // - // A version 20 mini driver must specify the following two fields. - // It specifies a name for each type. The names will be used to create - // symbolic links for clients to open them. - // The names can be any wide char strings that the driver chooses. At - // OPEN_DEVICE_INSTANCE, a filter type index and the filter instance extension - // are specified. Consequent Srbs will contain the filter extension for the - // target filter instance. NameExtensionArray is a pointer to a constant array - // of pointers which point to constant wide char strings. - // - ULONG NumNameExtensions; - __field_ecount(NumNameExtensions) - PWCHAR *NameExtensionArray; -#else - ULONG Reserved[2]; // Reserved for future use -#endif - -} HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA; - -// -// Execution Priorities passed in to the StreamClassChangePriority function -// - -typedef enum _STREAM_PRIORITY { - High, // highest priority, IRQL equal to the - // adapter's ISR - Dispatch, // medium priority, IRQL equal to DISPATCH - // level - Low, // lowest priority, IRQL equal to PASSIVE or - // APC level - LowToHigh // go from low priority to high priority -} STREAM_PRIORITY, *PSTREAM_PRIORITY; - - -// -// the following are prototypes for services provided by the class driver -// - -VOID STREAMAPI - StreamClassScheduleTimer( - __in_opt PHW_STREAM_OBJECT StreamObject, - __in PVOID HwDeviceExtension, - __in ULONG NumberOfMicroseconds, - __in PHW_TIMER_ROUTINE TimerRoutine, - __in PVOID Context -); - -VOID STREAMAPI - StreamClassCallAtNewPriority( - __in_opt PHW_STREAM_OBJECT StreamObject, - __in PVOID HwDeviceExtension, - __in STREAM_PRIORITY Priority, - __in PHW_PRIORITY_ROUTINE PriorityRoutine, - __in PVOID Context -); - -VOID __cdecl - StreamClassStreamNotification( - __in STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE NotificationType, - __in PHW_STREAM_OBJECT StreamObject, - ... -); - -VOID __cdecl - StreamClassDeviceNotification( - __in STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE NotificationType, - __in PVOID HwDeviceExtension, - ... -); - -STREAM_PHYSICAL_ADDRESS STREAMAPI - StreamClassGetPhysicalAddress( - __in PVOID HwDeviceExtension, - __in_opt PHW_STREAM_REQUEST_BLOCK HwSRB, - __in PVOID VirtualAddress, - __in STREAM_BUFFER_TYPE Type, - __out ULONG * Length -); - - -PVOID STREAMAPI - StreamClassGetDmaBuffer( - __in PVOID HwDeviceExtension -); - - -VOID __cdecl - StreamClassDebugPrint( - __in STREAM_DEBUG_LEVEL DebugPrintLevel, - __in PCCHAR DebugMessage, - ... -); - -VOID STREAMAPI - StreamClassDebugAssert( - __in IN PCHAR File, - __in IN ULONG Line, - __in IN PCHAR AssertText, - __in IN ULONG AssertValue -); -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS STREAMAPI - StreamClassRegisterAdapter( - __in PVOID Argument1, - __in PVOID Argument2, - __in PHW_INITIALIZATION_DATA HwInitializationData -); - -#define StreamClassRegisterMinidriver StreamClassRegisterAdapter - -VOID -StreamClassAbortOutstandingRequests( - __in PVOID HwDeviceExtension, - __in_opt PHW_STREAM_OBJECT HwStreamObject, - __in NTSTATUS Status -); - -VOID -StreamClassQueryMasterClock( - __in PHW_STREAM_OBJECT HwStreamObject, - __in HANDLE MasterClockHandle, - __in TIME_FUNCTION TimeFunction, - __in PHW_QUERY_CLOCK_ROUTINE ClockCallbackRoutine -); - -// -// The 1st parameter was PVOID HwDeviceExtension. It MUST be HwInstanceExtension -// for multi-instance and multi-filter types ( version 20 ) drivers. Legacy -// single instance drivers can continue to specify HwDeviceExtensionin as the -// 1st parameter. It can also specify HwInstanceExtension. -// -PKSEVENT_ENTRY -StreamClassGetNextEvent( - __in_opt PVOID HwInstanceExtension_OR_HwDeviceExtension, - __in_opt PHW_STREAM_OBJECT HwStreamObject, - __in_opt GUID * EventGuid, - __in ULONG EventItem, - __in_opt PKSEVENT_ENTRY CurrentEvent -); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -StreamClassRegisterFilterWithNoKSPins( - __in PDEVICE_OBJECT DeviceObject, - __in const GUID * InterfaceClassGUID, - __in ULONG PinCount, - __in_ecount(PinCount) BOOL * PinDirection, - __in_ecount(PinCount) KSPIN_MEDIUM * MediumList, - __in_ecount_opt(PinCount) GUID * CategoryList -); -__drv_maxIRQL(PASSIVE_LEVEL) -BOOLEAN STREAMAPI -StreamClassReadWriteConfig( - __in PVOID HwDeviceExtension, - __in BOOLEAN Read, - __inout_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length -); - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID STREAMAPI -StreamClassQueryMasterClockSync( - __in HANDLE MasterClockHandle, - __inout PHW_TIME_CONTEXT TimeContext -); - -VOID STREAMAPI -StreamClassCompleteRequestAndMarkQueueReady( - __in PHW_STREAM_REQUEST_BLOCK Srb -); - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DECLSPEC_DEPRECATED_DDK -#endif -VOID STREAMAPI -StreamClassReenumerateStreams( - __in PVOID HwDeviceExtension, - __in ULONG StreamDescriptorSize -); - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -// -// A version 2.0 stream class mini driver must use this function -// in stead of StreamClassReenumerateStreams() -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DECLSPEC_DEPRECATED_DDK -#endif -VOID STREAMAPI -StreamClassFilterReenumerateStreams( - __in PVOID HwInstanceExtension, - - __in ULONG StreamDescriptorSize -); - -#endif - -#endif //_STREAM_H - - - - diff --git a/qt-correction-tool/pub/ddk/struchdr.h b/qt-correction-tool/pub/ddk/struchdr.h deleted file mode 100644 index d18c358..0000000 --- a/qt-correction-tool/pub/ddk/struchdr.h +++ /dev/null @@ -1,62 +0,0 @@ -/*++ - -Copyright (c) 1989 Microsoft Corporation - -Module Name: - - StrucHdr.h - -Abstract: - - This module predefines the structures for important data structures so that we can always talk about them.... - even though they're not defined yet. - -Author: -Revision History: - ---*/ - -#ifndef _RDBSSSTRUCHDR_ -#define _RDBSSSTRUCHDR_ - -#define IMPORTANT_STRUCTURE(x) struct _##x; typedef struct _##x *P##x - -typedef struct _NODE_TYPE_CODE_AND_SIZE *PNODE_TYPE_CODE_AND_SIZE; - -typedef struct _RX_PREFIX_ENTRY *PRX_PREFIX_ENTRY; -typedef struct _RX_PREFIX_TABLE *PRX_PREFIX_TABLE; - -typedef struct _RX_FSD_DISPATCH_VECTOR *PRX_FSD_DISPATCH_VECTOR; -typedef struct _RDBSS_DATA *PRDBSS_DATA; -typedef struct _RDBSS_EXPORTS *PRDBSS_EXPORTS; -typedef struct _VCB *PVCB; -typedef struct _RDBSS_DEVICE_OBJECT *PRDBSS_DEVICE_OBJECT; - -typedef struct _FILE_NAME_NODE *PFILE_NAME_NODE; -typedef struct _REPINNED_BCBS *PREPINNED_BCBS; -typedef struct _RDBSS_IO_CONTEXT *PRDBSS_IO_CONTEXT; -typedef struct _IO_RUNS *PIO_RUNS; -typedef struct _DELETE_CONTEXT *PDELETE_CONTEXT; -typedef struct _CLOSE_CONTEXT *PCLOSE_CONTEXT; -typedef struct _CLEAN_AND_DIRTY_VOLUME_PACKET *PCLEAN_AND_DIRTY_VOLUME_PACKET; - -typedef struct _SRV_CALL *PSRV_CALL; -typedef struct _NET_ROOT *PNET_ROOT; -typedef struct _V_NET_ROOT *PV_NET_ROOT; -typedef struct _NON_PAGED_FCB *PNON_PAGED_FCB; -typedef struct _FCB *PFCB; -typedef struct _SRV_OPEN *PSRV_OPEN; -typedef struct _FOBX *PFOBX; -typedef struct _RX_CONTEXT *PRX_CONTEXT; -typedef struct _LOWIO_CONTEXT *PLOWIO_CONTEXT; - -typedef struct _EA_RANGE *PEA_RANGE; - -typedef struct _MINIRDR_DISPATCH *PMINIRDR_DISPATCH; -typedef struct _RDBSS_EXPORTS *PRDBSS_EXPORTS; -typedef struct _MRX_SRVCALL_CALLBACK_CONTEXT *PMRX_SRVCALL_CALLBACK_CONTEXT; -typedef struct _MRX_SRVCALLDOWN_STRUCTURE *PMRX_SRVCALLDOWN_STRUCTURE; -typedef struct _MRX_CREATENETROOT_CONTEXT *PMRX_CREATENETROOT_CONTEXT; - -#endif // _RDBSSSTRUCHDR_ - diff --git a/qt-correction-tool/pub/ddk/swenum.h b/qt-correction-tool/pub/ddk/swenum.h deleted file mode 100644 index 82226e5..0000000 --- a/qt-correction-tool/pub/ddk/swenum.h +++ /dev/null @@ -1,212 +0,0 @@ -/*++ - - Copyright (c) 1997 Microsoft Corporation - -Module Name: - - swenum.h - -Abstract: - Public header file and bus interface definition for the - software device enumerator. - ---*/ - -#if !defined( _SWENUM_ ) - -#define _SWENUM_ - -// Io controls - -#define IOCTL_SWENUM_INSTALL_INTERFACE CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x000, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SWENUM_REMOVE_INTERFACE CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x001, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_SWENUM_GET_BUS_ID CTL_CODE(FILE_DEVICE_BUS_EXTENDER, 0x002, METHOD_NEITHER, FILE_READ_ACCESS) - -// -// Io control related structures -// - -typedef struct _SWENUM_INSTALL_INTERFACE { - GUID DeviceId; - GUID InterfaceId; - WCHAR ReferenceString[1]; - -} SWENUM_INSTALL_INTERFACE, *PSWENUM_INSTALL_INTERFACE; - -#if defined( _KS_ ) - -#define STATIC_BUSID_SoftwareDeviceEnumerator STATIC_KSMEDIUMSETID_Standard -#define BUSID_SoftwareDeviceEnumerator KSMEDIUMSETID_Standard - -#else // !_KS_ - -#define STATIC_BUSID_SoftwareDeviceEnumerator \ - 0x4747B320L, 0x62CE, 0x11CF, 0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00 -#if defined(__cplusplus) && _MSC_VER >= 1100 -struct __declspec(uuid("4747B320-62CE-11CF-A5D6-28DB04C10000")) BUSID_SoftwareDeviceEnumerator; -#define BUSID_SoftwareDeviceEnumerator __uuidof(struct BUSID_SoftwareDeviceEnumerator) -#else -DEFINE_GUIDEX(BUSID_SoftwareDeviceEnumerator); -#endif // !(defined(__cplusplus) && _MSC_VER >= 1100) - -#endif // !_KS_ - -#if defined( _NTDDK_ ) - -typedef -VOID -(*PFNREFERENCEDEVICEOBJECT)( - __in PVOID Context - ); - -typedef -VOID -(*PFNDEREFERENCEDEVICEOBJECT)( - __in PVOID Context - ); - -typedef -NTSTATUS -(*PFNQUERYREFERENCESTRING)( - __in PVOID Context, - __inout PWCHAR *String - ); - -#define BUS_INTERFACE_SWENUM_VERSION 0x100 - -typedef struct _BUS_INTERFACE_SWENUM { - // - // Standard interface header - // - - INTERFACE Interface; - - // - // SWENUM bus interfaces - // - - PFNREFERENCEDEVICEOBJECT ReferenceDeviceObject; - PFNDEREFERENCEDEVICEOBJECT DereferenceDeviceObject; - PFNQUERYREFERENCESTRING QueryReferenceString; - -} BUS_INTERFACE_SWENUM, *PBUS_INTERFACE_SWENUM; - -#if defined(__cplusplus) -extern "C" { -#endif // defined(__cplusplus) - -#if defined( _KS_ ) - -KSDDKAPI -NTSTATUS -NTAPI -KsQuerySoftwareBusInterface( - __in PDEVICE_OBJECT PnpDeviceObject, - __out PBUS_INTERFACE_SWENUM BusInterface - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsReferenceSoftwareBusObject( - __in KSDEVICE_HEADER Header - ); - -KSDDKAPI -VOID -NTAPI -KsDereferenceSoftwareBusObject( - __in KSDEVICE_HEADER Header - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsCreateBusEnumObject( - __in PWSTR BusIdentifier, - __in PDEVICE_OBJECT BusDeviceObject, - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in_opt PDEVICE_OBJECT PnpDeviceObject, - __in_opt REFGUID InterfaceGuid, - __in_opt PWSTR ServiceRelativePath - ); - -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumIdentifier( - __inout PIRP Irp - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumPnpDeviceObject( - __in PDEVICE_OBJECT DeviceObject, - __out PDEVICE_OBJECT *PnpDeviceObject - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsInstallBusEnumInterface( - __in PIRP Irp - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsIsBusEnumChildDevice( - __in PDEVICE_OBJECT DeviceObject, - __out PBOOLEAN ChildDevice - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsRemoveBusEnumInterface( - __in PIRP Irp - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsServiceBusEnumPnpRequest( - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsServiceBusEnumCreateRequest( - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -KSDDKAPI -NTSTATUS -NTAPI -KsGetBusEnumParentFDOFromChildPDO( - __in PDEVICE_OBJECT DeviceObject, - __out PDEVICE_OBJECT *FunctionalDeviceObject - ); - -#endif // _KS_ - -#if defined(__cplusplus) -} -#endif // defined(__cplusplus) - -#endif // _NTDDK_ - -#endif // !_SWENUM_ - diff --git a/qt-correction-tool/pub/ddk/syncdeviceservice.h b/qt-correction-tool/pub/ddk/syncdeviceservice.h deleted file mode 100644 index 89f8f6d..0000000 --- a/qt-correction-tool/pub/ddk/syncdeviceservice.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - * SyncDeviceService.h - * - * Contains definitions for the general sync properties and formats - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _SYNCDEVICESERVICE_H_ -#define _SYNCDEVICESERVICE_H_ - -/*****************************************************************************/ -/* Sync Service Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_SyncSvc, - 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16); - - -/* PKEY_SyncSvc_SyncFormat - * - * Indicates the format GUID for the object format that is to be used in the - * sync operation. - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_SyncFormat, - 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, - 2); - -#define NAME_SyncSvc_SyncFormat L"SyncFormat" - - -/* PKEY_SyncSvc_LocalOnlyDelete - * - * Boolean flag indicating whether deletes of objects on the service host - * should be treated as "local only" and not propogated to other sync - * participants. The alternative is "true sync" in which deletes on the - * service host are propogated to all other sync participants. - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_LocalOnlyDelete, - 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, - 3); - -#define NAME_SyncSvc_LocalOnlyDelete L"LocalOnlyDelete" - - -/* PKEY_SyncSvc_FilterType - * - * Value describing type of the filter - * - * Type: UInt8 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_FilterType, - 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, - 4); - -#define NAME_SyncSvc_FilterType L"FilterType" - -#define SYNCSVC_FILTER_NONE 0 -#define SYNCSVC_FILTER_CONTACTS_WITH_PHONE 1 -#define SYNCSVC_FILTER_TASK_ACTIVE 2 -#define SYNCSVC_FILTER_CALENDAR_WINDOW_WITH_RECURRENCE 3 - - -/* PKEY_SyncSvc_SyncObjectReferences - * - * Value describing whether object references should be included as part of - * the sync process or not - * - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_SyncSvc_SyncObjectReferences, - 0x703d392c, 0x532c, 0x4607, 0x91, 0x58, 0x9c, 0xea, 0x74, 0x2f, 0x3a, 0x16, - 5); - -#define NAME_SyncSvc_SyncObjectReferences L"SyncObjectReferences" - -#define ENUM_SyncSvc_SyncObjectReferencesDisabled 0x00 -#define ENUM_SyncSvc_SyncObjectReferencesEnabled 0xff - - -/*****************************************************************************/ -/* Sync Service Object Properties */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_SyncObj, - 0x37364f58, 0x2f74, 0x4981, 0x99, 0xa5, 0x7a, 0xe2, 0x8a, 0xee, 0xe3, 0x19); - -/* PKEY_SyncObj_LastAuthorProxyID - * - * Contains a GUID inidcating the proxy ID of the last proxy to author the - * object - * - * Type: UInt128 - * Form: None - */ - -DEFINE_DEVSVCPROPKEY(PKEY_SyncObj_LastAuthorProxyID, - 0x37364f58, 0x2f74, 0x4981, 0x99, 0xa5, 0x7a, 0xe2, 0x8a, 0xee, 0xe3, 0x19, - 2); - -#define NAME_SyncObj_LastAuthorProxyID L"LastAuthorProxyID" - -/*****************************************************************************/ -/* Sync Service Methods */ -/*****************************************************************************/ - -/* METHOD_SyncSvc_BeginSync - */ - -DEFINE_DEVSVCGUID(METHOD_SyncSvc_BeginSync, - 0x63803e07, 0xc713, 0x45d3, 0x81, 0x19, 0x34, 0x79, 0xb3, 0x1d, 0x35, 0x92); - -#define NAME_SyncSvc_BeginSync L"BeginSync" - -/* METHOD_SyncSvc_EndSync - */ - -DEFINE_DEVSVCGUID(METHOD_SyncSvc_EndSync, - 0x40f3f0f7, 0xa539, 0x422e, 0x98, 0xdd, 0xfd, 0x8d, 0x38, 0x5c, 0x88, 0x49); - -#define NAME_SyncSvc_EndSync L"EndSync" - -#endif /* _SYNCDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/taskdeviceservice.h b/qt-correction-tool/pub/ddk/taskdeviceservice.h deleted file mode 100644 index 356533b..0000000 --- a/qt-correction-tool/pub/ddk/taskdeviceservice.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * TaskDeviceService.h - * - * Contains declarations for the Task Device Service - * - * Copyright (c) Microsoft Corporation, All Rights Reserved. - * - */ - -#ifndef _TASKDEVICESERVICE_H_ -#define _TASKDEVICESERVICE_H_ - -#include -#include -#include - - -/*****************************************************************************/ -/* Task Service Info */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(SERVICE_Tasks, - 0xBB340C54, 0xB5C6, 0x491D, 0x88, 0x27, 0x28, 0xD0, 0xE7, 0x63, 0x19, 0x03); - -#define NAME_TasksSvc L"Tasks" -#define TYPE_TasksSvc DEVSVCTYPE_DEFAULT - - -/*****************************************************************************/ -/* Task Service Properties */ -/*****************************************************************************/ - -#define PKEY_TasksSvc_SyncActiveOnly PKEY_SyncSvc_FilterType - - -/*****************************************************************************/ -/* Task Service Object Formats */ -/*****************************************************************************/ - -/* FORMAT_AbstractTask - */ - -DEFINE_DEVSVCGUID(FORMAT_AbstractTask, - 0x522979c0, 0x74cf, 0x44ab, 0x97, 0x54, 0x55, 0xbc, 0x59, 0x6a, 0x67, 0xdf); - -#define NAME_AbstractTask L"AbstractTask" - - -/*****************************************************************************/ -/* Task Service Object Property Keys */ -/*****************************************************************************/ - -DEFINE_DEVSVCGUID(NAMESPACE_TaskObj, - 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7); - -/* PKEY_TaskObj_ReminderDateTime - * - * Type: String - * Form: DateTime - */ - -DEFINE_DEVSVCPROPKEY(PKEY_TaskObj_ReminderDateTime, - 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7, - 13); - -#define NAME_TaskObj_ReminderDateTime L"ReminderDateTime" - - -/* PKEY_TaskObj_Complete - * - * Type: UInt8 - * Form: Enum - */ - -DEFINE_DEVSVCPROPKEY(PKEY_TaskObj_Complete, - 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7, - 14); - -#define NAME_TaskObj_Complete L"Complete" - -#define ENUM_TaskObj_CompleteFalse 0x00 -#define ENUM_TaskObj_CompleteTrue 0xff - - -/* TaskObj.BeginDate - * - * Contains the date that the task should start- the date is assumed to - * be relative to the current device time zone - * - * Type: String - * Form: ISO8601 Date - */ - -DEFINE_DEVSVCPROPKEY(PKEY_TaskObj_BeginDate, - 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7, - 15); - -#define NAME_TaskObj_BeginDate L"BeginDate" - - -/* TaskObj.EndDate - * - * Contains the date that the task should end- the date is assumed to be - * relative to the current device time zone - * - * Type: String - * Form: ISO8601 Date - */ - -DEFINE_DEVSVCPROPKEY(PKEY_TaskObj_EndDate, - 0xE354E95E, 0xD8A0, 0x4637, 0xA0, 0x3A, 0x0C, 0xB2, 0x68, 0x38, 0xDB, 0xC7, - 16); - -#define NAME_TaskObj_EndDate L"EndDate" - -#endif /* _TASKDEVICESERVICE_H_ */ - - diff --git a/qt-correction-tool/pub/ddk/tdikrnl.h b/qt-correction-tool/pub/ddk/tdikrnl.h deleted file mode 100644 index a20f980..0000000 --- a/qt-correction-tool/pub/ddk/tdikrnl.h +++ /dev/null @@ -1,1473 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - tdikrnl.h - -Abstract: - - This header file contains interface definitions for NT transport - providers running in kernel mode. This interface is documented in the - NT Transport Driver Interface (TDI) Specification, Version 2. - -Revision History: - ---*/ - -#ifndef _TDI_KRNL_ -#define _TDI_KRNL_ - -#pragma once - -#include // get the user mode includes -#include - -#pragma warning(push) -#pragma warning(disable:4201) // nameless struct/union - -// -// In this TDI, a kernel mode client calls TDI using IoCallDriver with the -// current Irp stack pointer set to 16 bytes of pointers to other structures. -// each of the supported NtDeviceIoControlFile analogs has a somehat different -// structure, laid out below. -// -// The IrpSP information passed by kernel mode clients looks like: -// - -typedef struct _TDI_REQUEST_KERNEL { - ULONG_PTR RequestFlags; - PTDI_CONNECTION_INFORMATION RequestConnectionInformation; - PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; - PVOID RequestSpecific; -} TDI_REQUEST_KERNEL, *PTDI_REQUEST_KERNEL; - -// -// defined request codes for the kernel clients. We make these the same -// as the IOCTL codes mostly for convenience; either can be used with -// the same results. -// - -#define TDI_ASSOCIATE_ADDRESS (0x01) -#define TDI_DISASSOCIATE_ADDRESS (0x02) -#define TDI_CONNECT (0x03) -#define TDI_LISTEN (0x04) -#define TDI_ACCEPT (0x05) -#define TDI_DISCONNECT (0x06) -#define TDI_SEND (0x07) -#define TDI_RECEIVE (0x08) -#define TDI_SEND_DATAGRAM (0x09) -#define TDI_RECEIVE_DATAGRAM (0x0A) -#define TDI_SET_EVENT_HANDLER (0x0B) -#define TDI_QUERY_INFORMATION (0x0C) -#define TDI_SET_INFORMATION (0x0D) -#define TDI_ACTION (0x0E) - -#define TDI_DIRECT_SEND (0x27) -#define TDI_DIRECT_SEND_DATAGRAM (0x29) -#define TDI_DIRECT_ACCEPT (0x2A) - -// -// TdiOpenAddress (Not Used) -// TdiCloseAddress (Not Used) -// TdiOpenConnection (Not Used) -// TdiCloseConnection (Not Used) -// - -// -// some useful constants for comparison when determining the file type; -// not required. -// - -#define TDI_TRANSPORT_ADDRESS_FILE 1 -#define TDI_CONNECTION_FILE 2 -#define TDI_CONTROL_CHANNEL_FILE 3 - -// -// Internal TDI IOCTLS -// - -#define IOCTL_TDI_QUERY_DIRECT_SEND_HANDLER _TDI_CONTROL_CODE( 0x80, METHOD_NEITHER ) -#define IOCTL_TDI_QUERY_DIRECT_SENDDG_HANDLER _TDI_CONTROL_CODE( 0x81, METHOD_NEITHER ) - -// -// TdiAssociateAddress -// - -typedef struct _TDI_REQUEST_KERNEL_ASSOCIATE { - HANDLE AddressHandle; -} TDI_REQUEST_KERNEL_ASSOCIATE, *PTDI_REQUEST_KERNEL_ASSOCIATE; - -// -// TdiDisassociateAddress -- None supplied -// - -typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISASSOCIATE, - *PTDI_REQUEST_KERNEL_DISASSOCIATE; - -// -// TdiConnect uses the structure given above (TDI_REQUEST_KERNEL); it's -// defined again below for convenience -// - -typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_CONNECT, - *PTDI_REQUEST_KERNEL_CONNECT; - -// -// TdiDisconnect uses the structure given above (TDI_REQUEST_KERNEL); it's -// defined again below for convenience -// - -typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_DISCONNECT, - *PTDI_REQUEST_KERNEL_DISCONNECT; - -// -// TdiListen uses the structure given above (TDI_REQUEST_KERNEL); it's -// defined again below for convenience -// - -typedef TDI_REQUEST_KERNEL TDI_REQUEST_KERNEL_LISTEN, - *PTDI_REQUEST_KERNEL_LISTEN; - -// -// TdiAccept -// - -typedef struct _TDI_REQUEST_KERNEL_ACCEPT { - PTDI_CONNECTION_INFORMATION RequestConnectionInformation; - PTDI_CONNECTION_INFORMATION ReturnConnectionInformation; -} TDI_REQUEST_KERNEL_ACCEPT, *PTDI_REQUEST_KERNEL_ACCEPT; - -// -// TdiSend -// - -typedef struct _TDI_REQUEST_KERNEL_SEND { - ULONG SendLength; - ULONG SendFlags; -} TDI_REQUEST_KERNEL_SEND, *PTDI_REQUEST_KERNEL_SEND; - -// -// TdiReceive -// - -typedef struct _TDI_REQUEST_KERNEL_RECEIVE { - ULONG ReceiveLength; - ULONG ReceiveFlags; -} TDI_REQUEST_KERNEL_RECEIVE, *PTDI_REQUEST_KERNEL_RECEIVE; - -// -// TdiSendDatagram -// - -typedef struct _TDI_REQUEST_KERNEL_SENDDG { - ULONG SendLength; - __field_bcount(SendLength) PTDI_CONNECTION_INFORMATION SendDatagramInformation; -} TDI_REQUEST_KERNEL_SENDDG, *PTDI_REQUEST_KERNEL_SENDDG; - -// -// TdiReceiveDatagram -// - -typedef struct _TDI_REQUEST_KERNEL_RECEIVEDG { - ULONG ReceiveLength; - PTDI_CONNECTION_INFORMATION ReceiveDatagramInformation; - PTDI_CONNECTION_INFORMATION ReturnDatagramInformation; - ULONG ReceiveFlags; -} TDI_REQUEST_KERNEL_RECEIVEDG, *PTDI_REQUEST_KERNEL_RECEIVEDG; - -// -// TdiSetEventHandler -// - -typedef struct _TDI_REQUEST_KERNEL_SET_EVENT { - LONG EventType; - PVOID EventHandler; - PVOID EventContext; -} TDI_REQUEST_KERNEL_SET_EVENT, *PTDI_REQUEST_KERNEL_SET_EVENT; - -// -// TdiQueryInformation -// - -typedef struct _TDI_REQUEST_KERNEL_QUERY_INFO { - LONG QueryType; - PTDI_CONNECTION_INFORMATION RequestConnectionInformation; -} TDI_REQUEST_KERNEL_QUERY_INFORMATION, *PTDI_REQUEST_KERNEL_QUERY_INFORMATION; - -// -// TdiSetInformation -// - -typedef struct _TDI_REQUEST_KERNEL_SET_INFO { - LONG SetType; - PTDI_CONNECTION_INFORMATION RequestConnectionInformation; -} TDI_REQUEST_KERNEL_SET_INFORMATION, *PTDI_REQUEST_KERNEL_SET_INFORMATION; - -// -// Event types that are known -// - -#define TDI_EVENT_CONNECT ((USHORT)0) // TDI_IND_CONNECT event handler. -#define TDI_EVENT_DISCONNECT ((USHORT)1) // TDI_IND_DISCONNECT event handler. -#define TDI_EVENT_ERROR ((USHORT)2) // TDI_IND_ERROR event handler. -#define TDI_EVENT_RECEIVE ((USHORT)3) // TDI_IND_RECEIVE event handler. -#define TDI_EVENT_RECEIVE_DATAGRAM ((USHORT)4) // TDI_IND_RECEIVE_DATAGRAM event handler. -#define TDI_EVENT_RECEIVE_EXPEDITED ((USHORT)5) // TDI_IND_RECEIVE_EXPEDITED event handler. -#define TDI_EVENT_SEND_POSSIBLE ((USHORT)6) // TDI_IND_SEND_POSSIBLE event handler -#define TDI_EVENT_CHAINED_RECEIVE ((USHORT)7) // TDI_IND_CHAINED_RECEIVE event handler. -#define TDI_EVENT_CHAINED_RECEIVE_DATAGRAM ((USHORT)8) // TDI_IND_CHAINED_RECEIVE_DATAGRAM event handler. -#define TDI_EVENT_CHAINED_RECEIVE_EXPEDITED ((USHORT)9) // TDI_IND_CHAINED_RECEIVE_EXPEDITED event handler. -#define TDI_EVENT_ERROR_EX ((USHORT)10) // TDI_IND_UNREACH_ERROR event handler. - - -// -// indicate connection event prototype. This is invoked when a request for -// connection has been received by the provider and the user wishes to either -// accept or reject that request. -// - -typedef -NTSTATUS -(*PTDI_IND_CONNECT)( - __in_opt PVOID TdiEventContext, - __in LONG RemoteAddressLength, - __in_bcount(RemoteAddressLength) PVOID RemoteAddress, - __in LONG UserDataLength, - __in_bcount_opt(UserDataLength) PVOID UserData, - __in LONG OptionsLength, - __in_bcount_opt(OptionsLength) PVOID Options, - __out CONNECTION_CONTEXT *ConnectionContext, - __out PIRP *AcceptIrp - ); - -NTSTATUS -TdiDefaultConnectHandler ( - __in_opt PVOID TdiEventContext, - __in LONG RemoteAddressLength, - __in_bcount(RemoteAddressLength) PVOID RemoteAddress, - __in LONG UserDataLength, - __in_bcount_opt(UserDataLength) PVOID UserData, - __in LONG OptionsLength, - __in_bcount_opt(OptionsLength) PVOID Options, - __out CONNECTION_CONTEXT *ConnectionContext, - __out PIRP *AcceptIrp - ); - -// -// Disconnection indication prototype. This is invoked when a connection is -// being disconnected for a reason other than the user requesting it. Note that -// this is a change from TDI V1, which indicated only when the remote caused -// a disconnection. Any non-directed disconnection will cause this indication. -// - -typedef -NTSTATUS -(*PTDI_IND_DISCONNECT)( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in LONG DisconnectDataLength, - __in_bcount_opt(DisconnectDataLength) PVOID DisconnectData, - __in LONG DisconnectInformationLength, - __in_bcount_opt(DisconnectInformationLength) PVOID DisconnectInformation, - __in ULONG DisconnectFlags - ); - -NTSTATUS -TdiDefaultDisconnectHandler ( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in LONG DisconnectDataLength, - __in_bcount_opt(DisconnectDataLength) PVOID DisconnectData, - __in LONG DisconnectInformationLength, - __in_bcount_opt(DisconnectInformationLength) PVOID DisconnectInformation, - __in ULONG DisconnectFlags - ); - -// -// A protocol error has occurred when this indication happens. This indication -// occurs only for errors of the worst type; the address this indication is -// delivered to is no longer usable for protocol-related operations, and -// should not be used for operations henceforth. All connections associated -// it are invalid. -// For NetBIOS-type providers, this indication is also delivered when a name -// in conflict or duplicate name occurs. -// - -typedef -NTSTATUS -(*PTDI_IND_ERROR)( - __in_opt PVOID TdiEventContext, // the endpoint's file object. - __in NTSTATUS Status // status code indicating error type. - ); - - - -typedef -NTSTATUS -(*PTDI_IND_ERROR_EX)( - __in_opt PVOID TdiEventContext, // the endpoint's file object. - __in NTSTATUS Status, // status code indicating error type. - __in PVOID Buffer - ); - - -NTSTATUS -TdiDefaultErrorHandler ( - __in_opt PVOID TdiEventContext, // the endpoint's file object. - __in NTSTATUS Status // status code indicating error type. - ); - -// -// TDI_IND_RECEIVE indication handler definition. This client routine is -// called by the transport provider when a connection-oriented TSDU is received -// that should be presented to the client. -// - -typedef -NTSTATUS -(*PTDI_IND_RECEIVE)( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG BytesIndicated, - __in ULONG BytesAvailable, - __out ULONG *BytesTaken, - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -NTSTATUS -TdiDefaultReceiveHandler ( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG BytesIndicated, - __in ULONG BytesAvailable, - __out ULONG *BytesTaken, - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -// -// TDI_IND_RECEIVE_DATAGRAM indication handler definition. This client routine -// is called by the transport provider when a connectionless TSDU is received -// that should be presented to the client. -// - -typedef -NTSTATUS -(*PTDI_IND_RECEIVE_DATAGRAM)( - __in_opt PVOID TdiEventContext, // the event context - __in LONG SourceAddressLength, // length of the originator of the datagram - __in_bcount(SourceAddressLength) PVOID SourceAddress, // originator of the datagram - __in LONG OptionsLength, // options for the receive - __in_bcount_opt(OptionsLength) PVOID Options, // - __in ULONG ReceiveDatagramFlags, // - __in ULONG BytesIndicated, // number of bytes this indication - __in ULONG BytesAvailable, // number of bytes in complete Tsdu - __out ULONG *BytesTaken, // number of bytes used - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -NTSTATUS -TdiDefaultRcvDatagramHandler ( - __in_opt PVOID TdiEventContext, // the event context - __in LONG SourceAddressLength, // length of the originator of the datagram - __in_bcount(SourceAddressLength) PVOID SourceAddress, // originator of the datagram - __in LONG OptionsLength, // options for the receive - __in_bcount_opt(OptionsLength) PVOID Options, // - __in ULONG ReceiveDatagramFlags, // - __in ULONG BytesIndicated, // number of bytes this indication - __in ULONG BytesAvailable, // number of bytes in complete Tsdu - __out ULONG *BytesTaken, // number of bytes used - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -// -// This indication is delivered if expedited data is received on the connection. -// This will only occur in providers that support expedited data. -// - -typedef -NTSTATUS -(*PTDI_IND_RECEIVE_EXPEDITED)( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, // - __in ULONG BytesIndicated, // number of bytes in this indication - __in ULONG BytesAvailable, // number of bytes in complete Tsdu - __out ULONG *BytesTaken, // number of bytes used by indication routine - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -NTSTATUS -TdiDefaultRcvExpeditedHandler ( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, // - __in ULONG BytesIndicated, // number of bytes in this indication - __in ULONG BytesAvailable, // number of bytes in complete Tsdu - __out ULONG *BytesTaken, // number of bytes used by indication routine - __in PVOID Tsdu, // pointer describing this TSDU, typically a lump of bytes - __out_opt PIRP *IoRequestPacket // TdiReceive IRP if MORE_PROCESSING_REQUIRED. - ); - -// -// TDI_IND_CHAINED_RECEIVE indication handler definition. This client routine -// is called by the transport provider when a connection-oriented TSDU is -// received that should be presented to the client. The TSDU is stored in an -// MDL chain. The client may take ownership of the TSDU and return it at a -// later time. -// - -typedef -NTSTATUS -(*PTDI_IND_CHAINED_RECEIVE)( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG ReceiveLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor // for call to TdiReturnChainedReceives - ); - -NTSTATUS -TdiDefaultChainedReceiveHandler ( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG ReceiveLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor // for call to TdiReturnChainedReceives - ); - -// -// TDI_IND_CHAINED_RECEIVE_DATAGRAM indication handler definition. This client -// routine is called by the transport provider when a connectionless TSDU is -// received that should be presented to the client. The TSDU is stored in an -// MDL chain. The client may take ownership of the TSDU and return it at a -// later time. -// - -typedef -NTSTATUS -(*PTDI_IND_CHAINED_RECEIVE_DATAGRAM)( - __in_opt PVOID TdiEventContext, // the event context - __in LONG SourceAddressLength, // length of the originator of the datagram - __in_bcount(SourceAddressLength) PVOID SourceAddress, // originator of the datagram - __in LONG OptionsLength, // options for the receive - __in_bcount_opt(OptionsLength) PVOID Options, // - __in ULONG ReceiveDatagramFlags, // - __in ULONG ReceiveDatagramLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor // for call to TdiReturnChainedReceives - ); - -NTSTATUS -TdiDefaultChainedRcvDatagramHandler ( - __in_opt PVOID TdiEventContext, // the event context - __in LONG SourceAddressLength, // length of the originator of the datagram - __in_bcount(SourceAddressLength) PVOID SourceAddress, // originator of the datagram - __in LONG OptionsLength, // options for the receive - __in_bcount_opt(OptionsLength) PVOID Options, // - __in ULONG ReceiveDatagramFlags, // - __in ULONG ReceiveDatagramLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor // for call to TdiReturnChainedReceives - ); - -// -// This indication is delivered if expedited data is received on the connection. -// This will only occur in providers that support expedited data. The TSDU is -// stored in an MDL chain. The client may take ownership of the TSDU and -// return it at a later time. -// - -typedef -NTSTATUS -(*PTDI_IND_CHAINED_RECEIVE_EXPEDITED)( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG ReceiveLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor// for call to TdiReturnChainedReceives - ); - -NTSTATUS -TdiDefaultChainedRcvExpeditedHandler ( - __in_opt PVOID TdiEventContext, - __in_opt CONNECTION_CONTEXT ConnectionContext, - __in ULONG ReceiveFlags, - __in ULONG ReceiveLength, // length of client data in TSDU - __in ULONG StartingOffset, // offset of start of client data in TSDU - __in PMDL Tsdu, // TSDU data chain - __in PVOID TsduDescriptor// for call to TdiReturnChainedReceives - ); - -// -// This indication is delivered if there is room for a send in the buffer of -// a buffering protocol. -// - -typedef -NTSTATUS -(*PTDI_IND_SEND_POSSIBLE)( - __in_opt PVOID TdiEventContext, - __in_opt PVOID ConnectionContext, - __in ULONG BytesAvailable); - -NTSTATUS -TdiDefaultSendPossibleHandler ( - __in_opt PVOID TdiEventContext, - __in_opt PVOID ConnectionContext, - __in ULONG BytesAvailable); - -// -// defined MACROS to allow the kernel mode client to easily build an IRP for -// any function. -// - -#define TdiBuildAssociateAddress(Irp, DevObj, FileObj, CompRoutine, Contxt, AddrHandle) \ - { \ - PTDI_REQUEST_KERNEL_ASSOCIATE p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_ASSOCIATE_ADDRESS; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_ASSOCIATE)&_IRPSP->Parameters; \ - p->AddressHandle = (HANDLE)(AddrHandle); \ - } - -#define TdiBuildDisassociateAddress(Irp, DevObj, FileObj, CompRoutine, Contxt) \ - { \ - PTDI_REQUEST_KERNEL_DISASSOCIATE p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_DISASSOCIATE_ADDRESS; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_DISASSOCIATE)&_IRPSP->Parameters; \ - } - -#define TdiBuildConnect(Irp, DevObj, FileObj, CompRoutine, Contxt, Time, RequestConnectionInfo, ReturnConnectionInfo)\ - { \ - PTDI_REQUEST_KERNEL p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_CONNECT; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL)&_IRPSP->Parameters; \ - p->RequestConnectionInformation = RequestConnectionInfo; \ - p->ReturnConnectionInformation = ReturnConnectionInfo; \ - p->RequestSpecific = (PVOID)Time; \ - } - -#define TdiBuildListen(Irp, DevObj, FileObj, CompRoutine, Contxt, Flags, RequestConnectionInfo, ReturnConnectionInfo)\ - { \ - PTDI_REQUEST_KERNEL p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_LISTEN; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL)&_IRPSP->Parameters; \ - p->RequestFlags = Flags; \ - p->RequestConnectionInformation = RequestConnectionInfo; \ - p->ReturnConnectionInformation = ReturnConnectionInfo; \ - } - -#define TdiBuildAccept(Irp, DevObj, FileObj, CompRoutine, Contxt, RequestConnectionInfo, ReturnConnectionInfo)\ - { \ - PTDI_REQUEST_KERNEL_ACCEPT p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_ACCEPT; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_ACCEPT)&_IRPSP->Parameters; \ - p->RequestConnectionInformation = RequestConnectionInfo; \ - p->ReturnConnectionInformation = ReturnConnectionInfo; \ - } - -#if (NTDDI_VERSION < NTDDI_WINXP) -#define TdiBuildDirectAccept(Irp, DevObj, FileObj, CompRoutine, Contxt, RequestConnectionInfo, ReturnConnectionInfo)\ - { \ - PTDI_REQUEST_KERNEL_ACCEPT p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_DIRECT_ACCEPT; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_ACCEPT)&_IRPSP->Parameters; \ - p->RequestConnectionInformation = RequestConnectionInfo; \ - p->ReturnConnectionInformation = ReturnConnectionInfo; \ - } -#endif - -#define TdiBuildDisconnect(Irp, DevObj, FileObj, CompRoutine, Contxt, Time, Flags, RequestConnectionInfo, ReturnConnectionInfo)\ - { \ - PTDI_REQUEST_KERNEL p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_DISCONNECT; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL)&_IRPSP->Parameters; \ - p->RequestFlags = Flags; \ - p->RequestConnectionInformation = RequestConnectionInfo; \ - p->ReturnConnectionInformation = ReturnConnectionInfo; \ - p->RequestSpecific = (PVOID)Time; \ - } - -#define TdiBuildReceive(Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, InFlags, ReceiveLen)\ - { \ - PTDI_REQUEST_KERNEL_RECEIVE p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_RECEIVE; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_RECEIVE)&_IRPSP->Parameters; \ - p->ReceiveFlags = InFlags; \ - p->ReceiveLength = ReceiveLen; \ - Irp->MdlAddress = MdlAddr; \ - } - -#define TdiBuildSend(Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, InFlags, SendLen)\ - { \ - PTDI_REQUEST_KERNEL_SEND p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_SEND; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_SEND)&_IRPSP->Parameters; \ - p->SendFlags = InFlags; \ - p->SendLength = SendLen; \ - Irp->MdlAddress = MdlAddr; \ - } - -#define TdiBuildSendDatagram(Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, SendLen, SendDatagramInfo)\ - { \ - PTDI_REQUEST_KERNEL_SENDDG p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_SEND_DATAGRAM; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_SENDDG)&_IRPSP->Parameters; \ - p->SendLength = SendLen; \ - p->SendDatagramInformation = SendDatagramInfo; \ - Irp->MdlAddress = MdlAddr; \ - } - -#define TdiBuildReceiveDatagram(Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr, ReceiveLen, ReceiveDatagramInfo, ReturnInfo, InFlags)\ - { \ - PTDI_REQUEST_KERNEL_RECEIVEDG p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_RECEIVE_DATAGRAM; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_RECEIVEDG)&_IRPSP->Parameters; \ - p->ReceiveLength = ReceiveLen; \ - p->ReceiveDatagramInformation = ReceiveDatagramInfo; \ - p->ReturnDatagramInformation = ReturnInfo; \ - p->ReceiveFlags = InFlags; \ - Irp->MdlAddress = MdlAddr; \ - } - -#define TdiBuildSetEventHandler(Irp, DevObj, FileObj, CompRoutine, Contxt, InEventType, InEventHandler, InEventContext) \ - { \ - PTDI_REQUEST_KERNEL_SET_EVENT p; \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_SET_EVENT_HANDLER; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_SET_EVENT)&_IRPSP->Parameters; \ - p->EventType = InEventType; \ - p->EventHandler = (PVOID)InEventHandler; \ - p->EventContext = (PVOID)InEventContext; \ - } - -#define TdiBuildQueryInformationEx(Irp, DevObj, FileObj, CompRoutine, Contxt, QType, MdlAddr, ConnInfo)\ - { \ - PTDI_REQUEST_KERNEL_QUERY_INFORMATION p; \ - PIO_STACK_LOCATION _IRPSP; \ - Irp->MdlAddress = MdlAddr; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_QUERY_INFORMATION; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_QUERY_INFORMATION)&_IRPSP->Parameters; \ - p->QueryType = (ULONG)QType; \ - p->RequestConnectionInformation = ConnInfo; \ - } - - -#define TdiBuildQueryInformation(Irp, DevObj, FileObj, CompRoutine, Contxt, QType, MdlAddr)\ - TdiBuildQueryInformationEx(Irp, DevObj, FileObj, CompRoutine, Contxt, QType, MdlAddr, NULL); - - -#define TdiBuildSetInformation(Irp, DevObj, FileObj, CompRoutine, Contxt, SType, MdlAddr)\ - { \ - PTDI_REQUEST_KERNEL_SET_INFORMATION p; \ - PIO_STACK_LOCATION _IRPSP; \ - Irp->MdlAddress = MdlAddr; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_SET_INFORMATION; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - p = (PTDI_REQUEST_KERNEL_SET_INFORMATION)&_IRPSP->Parameters; \ - p->SetType = (ULONG)SType; \ - p->RequestConnectionInformation = NULL; \ - } - -#define TdiBuildAction(Irp, DevObj, FileObj, CompRoutine, Contxt, MdlAddr)\ - { \ - PIO_STACK_LOCATION _IRPSP; \ - if ( CompRoutine != NULL) { \ - IoSetCompletionRoutine( Irp, CompRoutine, Contxt, TRUE, TRUE, TRUE);\ - } else { \ - IoSetCompletionRoutine( Irp, NULL, NULL, FALSE, FALSE, FALSE); \ - } \ - _IRPSP = IoGetNextIrpStackLocation (Irp); \ - _IRPSP->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL; \ - _IRPSP->MinorFunction = TDI_ACTION; \ - _IRPSP->DeviceObject = DevObj; \ - _IRPSP->FileObject = FileObj; \ - Irp->MdlAddress = MdlAddr; \ - } - -// -// definitions for the helper routines for TDI compliant transports and clients -// -// Note that the IOCTL used here for the Irp Function is not real; it is used -// to avoid this IO routine having to map buffers (which we don't want). -// -//PIRP -//TdiBuildInternalDeviceControlIrp ( -// IN CCHAR IrpSubFunction, -// IN PDEVICE_OBJECT DeviceObject, -// IN PFILE_OBJECT FileObject, -// IN PKEVENT Event, -// IN PIO_STATUS_BLOCK IoStatusBlock -// ); - -#define TdiBuildInternalDeviceControlIrp(IrpSubFunction,DeviceObject,FileObject,Event,IoStatusBlock) \ - IoBuildDeviceIoControlRequest (\ - 0x00000003,\ - DeviceObject, \ - NULL, \ - 0, \ - NULL, \ - 0, \ - TRUE, \ - Event, \ - IoStatusBlock) - - -// -// VOID -// TdiCopyLookaheadData( -// IN PVOID Destination, -// IN PVOID Source, -// IN ULONG Length, -// IN ULONG ReceiveFlags -// ); -// - -#ifdef _M_IX86 -#define TdiCopyLookaheadData(_Destination,_Source,_Length,_ReceiveFlags) \ - RtlCopyMemory(_Destination,_Source,_Length) -#else -#define TdiCopyLookaheadData(_Destination,_Source,_Length,_ReceiveFlags) { \ - if ((_ReceiveFlags) & TDI_RECEIVE_COPY_LOOKAHEAD) { \ - RtlCopyMemory(_Destination,_Source,_Length); \ - } else { \ - PUCHAR _Src = (PUCHAR)(_Source); \ - PUCHAR _Dest = (PUCHAR)(_Destination); \ - PUCHAR _End = _Dest + (_Length); \ - while (_Dest < _End) { \ - *_Dest++ = *_Src++; \ - } \ - } \ -} -#endif - - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -TdiMapUserRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in PIO_STACK_LOCATION IrpSp - ); - -#if (NTDDI_VERSION < NTDDI_WINXP) -__drv_preferredFunction("(see documentation)", "Obsolete") -VOID -TdiMapBuffer ( - __in PMDL MdlChain - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VOID -TdiUnmapBuffer ( - __in PMDL MdlChain - ); -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -TdiCopyBufferToMdl ( - __in PVOID SourceBuffer, - __in ULONG SourceOffset, - __in ULONG SourceBytesToCopy, - __in PMDL DestinationMdlChain, - __in ULONG DestinationOffset, - __out PULONG BytesCopied - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -TdiCopyMdlToBuffer( - __in PMDL SourceMdlChain, - __in ULONG SourceOffset, - __out_bcount(DestinationBufferSize) PVOID DestinationBuffer, - __in ULONG DestinationOffset, - __in ULONG DestinationBufferSize, - __out PULONG BytesCopied - ); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSTATUS -TdiCopyMdlChainToMdlChain( - __in PMDL SourceMdlChain, - __in ULONG SourceOffset, - __in PMDL DestinationMdlChain, - __in ULONG DestinationOffset, - __out PULONG BytesCopied - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -VOID -TdiCopyBufferToMdlWithReservedMappingAtDpcLevel( - __in PVOID SourceBuffer, - __in PMDL DestinationMdl, - __in ULONG DestinationOffset, - __in ULONG BytesToCopy - ); - -__inline -VOID -TdiCopyBufferToMdlWithReservedMapping( - __in PVOID SourceBuffer, - __in PMDL DestinationMdl, - __in ULONG DestinationOffset, - __in ULONG BytesToCopy - ) -{ - KIRQL OldIrql; - KeRaiseIrql(DISPATCH_LEVEL, &OldIrql); - TdiCopyBufferToMdlWithReservedMappingAtDpcLevel(SourceBuffer, - DestinationMdl, - DestinationOffset, - BytesToCopy); - KeLowerIrql(OldIrql); -} -#endif - -VOID -TdiBuildNetbiosAddress ( - __in PUCHAR NetbiosName, - __in BOOLEAN IsGroupName, - __inout PTA_NETBIOS_ADDRESS NetworkName - ); - -NTSTATUS -TdiBuildNetbiosAddressEa ( - __out PUCHAR Buffer, - __in BOOLEAN IsGroupName, - __in PUCHAR NetbiosName - ); - -//++ -// -// VOID -// TdiCompleteRequest ( -// IN PIRP Irp, -// IN NTSTATUS Status -// ); -// -// Routine Description: -// -// This routine is used to complete an IRP with the indicated -// status. -// -// Arguments: -// -// Irp - Supplies a pointer to the Irp to complete -// -// Status - Supplies the completion status for the Irp -// -// Return Value: -// -// None. -// -//-- - -#define TdiCompleteRequest(IRP,STATUS) { \ - (IRP)->IoStatus.Status = (STATUS); \ - IoCompleteRequest( (IRP), IO_NETWORK_INCREMENT ); \ -} - - -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -TdiReturnChainedReceives( - __in PVOID *TsduDescriptors, - __in ULONG NumberOfTsdus - ); - - -// The type definition for a TDI Bind handler callout. This callout is -// called when a new transport device arrives. - -typedef VOID -(*TDI_BIND_HANDLER)( - __in PUNICODE_STRING DeviceName - ); - -typedef VOID -(*TDI_UNBIND_HANDLER)( - __in PUNICODE_STRING DeviceName - ); - -// The type definition for a TDI address handler callout. -// This is typedefed defined at the end (with the others) - -typedef VOID -(*TDI_ADD_ADDRESS_HANDLER)( - __in PTA_ADDRESS Address - ); - -typedef VOID -(*TDI_DEL_ADDRESS_HANDLER)( - __in PTA_ADDRESS Address - ); - -typedef VOID -(* TDI_NET_READY_HANDLER)( - __in NTSTATUS ProviderStatus - ); - -typedef VOID -(* ProviderPnPPowerComplete)( - __in PNET_PNP_EVENT NetEvent, - __in NTSTATUS ProviderStatus - ); - - -__drv_preferredFunction("TdiRegisterPnPHandlers", "Obsolete") -NTSTATUS -TdiRegisterAddressChangeHandler( - __in TDI_ADD_ADDRESS_HANDLER AddHandler, - __in TDI_DEL_ADDRESS_HANDLER DeleteHandler, - __out HANDLE *BindingHandle - ); - -__drv_preferredFunction("TdiDeregisterPnPHandlers", "Obsolete") -NTSTATUS -TdiDeregisterAddressChangeHandler( - __in HANDLE BindingHandle -); - -__drv_preferredFunction("TdiRegisterPnPHandlers", "Obsolete") -NTSTATUS -TdiRegisterNotificationHandler( - __in TDI_BIND_HANDLER BindHandler, - __in TDI_UNBIND_HANDLER UnbindHandler, - __out HANDLE *BindingHandle -); - -__drv_preferredFunction("TdiDeregisterPnPHandlers", "Obsolete") -NTSTATUS -TdiDeregisterNotificationHandler( - __in HANDLE BindingHandle -); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiRegisterDeviceObject( - __in PUNICODE_STRING DeviceName, - __out HANDLE *RegistrationHandle -); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiDeregisterDeviceObject( - __in HANDLE RegistrationHandle -); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiDeregisterNetAddress( - __in HANDLE RegistrationHandle -); - -__drv_maxIRQL(PASSIVE_LEVEL) -VOID -TdiInitialize( - VOID -); - - -// PnP extensions to TDI. Spec : TdiPnp.doc : MunilS - -typedef enum _TDI_PNP_OPCODE { - TDI_PNP_OP_MIN, - TDI_PNP_OP_ADD, - TDI_PNP_OP_DEL, - TDI_PNP_OP_UPDATE, - TDI_PNP_OP_PROVIDERREADY, - TDI_PNP_OP_NETREADY, - TDI_PNP_OP_ADD_IGNORE_BINDING, - TDI_PNP_OP_DELETE_IGNORE_BINDING, - TDI_PNP_OP_MAX, -} TDI_PNP_OPCODE; - -typedef struct _TDI_PNP_CONTEXT_WIN2K { - USHORT ContextSize; - USHORT ContextType; - UCHAR POINTER_ALIGNMENT ContextData[1]; -} TDI_PNP_CONTEXT_WIN2K, *PTDI_PNP_CONTEXT_WIN2K; - -typedef struct _TDI_PNP_CONTEXT_XP { - USHORT ContextSize; - USHORT ContextType; - UCHAR POINTER_ALIGNMENT ContextData[1]; -} TDI_PNP_CONTEXT_XP, *PTDI_PNP_CONTEXT_XP; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef TDI_PNP_CONTEXT_XP TDI_PNP_CONTEXT; -#else -typedef TDI_PNP_CONTEXT_WIN2K TDI_PNP_CONTEXT; -#endif - -typedef TDI_PNP_CONTEXT* PTDI_PNP_CONTEXT; - -typedef VOID -(*TDI_BINDING_HANDLER)( - __in TDI_PNP_OPCODE PnPOpcode, - __in PUNICODE_STRING DeviceName, - __in PWSTR MultiSZBindList - ); - -typedef VOID -(*TDI_ADD_ADDRESS_HANDLER_V2)( - __in PTA_ADDRESS Address, - __in PUNICODE_STRING DeviceName, - __in PTDI_PNP_CONTEXT Context - ); - -typedef VOID -(*TDI_DEL_ADDRESS_HANDLER_V2)( - __in PTA_ADDRESS Address, - __in PUNICODE_STRING DeviceName, - __in PTDI_PNP_CONTEXT Context - ); - -typedef NTSTATUS -(*TDI_PNP_POWER_HANDLER)( - __in PUNICODE_STRING DeviceName, - __in PNET_PNP_EVENT PowerEvent, - __in PTDI_PNP_CONTEXT Context1, - __in PTDI_PNP_CONTEXT Context2 - ); - -// When the user makes changes using the NCPA, a TdiMakeNCPAChanges request -// is generated through NDIS. The following structure is used to communicate -// these changes. - -typedef struct _TDI_NCPA_BINDING_INFO { - PUNICODE_STRING TdiClientName; - PUNICODE_STRING TdiProviderName; - PUNICODE_STRING BindList; - PVOID ReconfigBuffer; - unsigned int ReconfigBufferSize; - TDI_PNP_OPCODE PnpOpcode; -} TDI_NCPA_BINDING_INFO, *PTDI_NCPA_BINDING_INFO; - -// -// The following structure makes it easy for consistency/integrity checking -// -typedef struct _TDI_VERSION_ { - union { - struct { - UCHAR MajorTdiVersion; - UCHAR MinorTdiVersion; - }; - USHORT TdiVersion; - }; -} TDI_VERSION, *PTDI_VERSION; - -#define TDI20 -typedef struct _TDI20_CLIENT_INTERFACE_INFO { - union { - struct { - UCHAR MajorTdiVersion; - UCHAR MinorTdiVersion; - }; - USHORT TdiVersion; - }; - - //TDI_VERSION TdiVersion; - USHORT Unused; - PUNICODE_STRING ClientName; - TDI_PNP_POWER_HANDLER PnPPowerHandler; - - union { - - TDI_BINDING_HANDLER BindingHandler; - - struct { - // - // Putting these back in for backward compatibility. - // - - TDI_BIND_HANDLER BindHandler; - TDI_UNBIND_HANDLER UnBindHandler; - - }; - }; - - - union { - struct { - - TDI_ADD_ADDRESS_HANDLER_V2 AddAddressHandlerV2; - TDI_DEL_ADDRESS_HANDLER_V2 DelAddressHandlerV2; - - }; - struct { - - // - // Putting these back in for backward compatibility. - // - - TDI_ADD_ADDRESS_HANDLER AddAddressHandler; - TDI_DEL_ADDRESS_HANDLER DelAddressHandler; - - }; - - }; - -// TDI_NET_READY_HANDLER NetReadyHandler; - -} TDI20_CLIENT_INTERFACE_INFO, *PTDI20_CLIENT_INTERFACE_INFO; - - -#ifdef TDI20 - -#define TDI_CURRENT_MAJOR_VERSION (2) -#define TDI_CURRENT_MINOR_VERSION (0) - -typedef TDI20_CLIENT_INTERFACE_INFO TDI_CLIENT_INTERFACE_INFO; - -#define TDI_CURRENT_VERSION ((TDI_CURRENT_MINOR_VERSION) << 8 | \ - (TDI_CURRENT_MAJOR_VERSION)) - -#endif // TDI20 - -#define TDI_VERSION_ONE 0x0001 - -typedef TDI_CLIENT_INTERFACE_INFO *PTDI_CLIENT_INTERFACE_INFO; - - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiRegisterPnPHandlers( - __in_bcount(InterfaceInfoSize) PTDI_CLIENT_INTERFACE_INFO ClientInterfaceInfo, - __in ULONG InterfaceInfoSize, - __out HANDLE *BindingHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiDeregisterPnPHandlers( - __in HANDLE BindingHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiPnPPowerRequest( - __in PUNICODE_STRING DeviceName, - __in PNET_PNP_EVENT PowerEvent, - __in PTDI_PNP_CONTEXT Context1, - __in PTDI_PNP_CONTEXT Context2, - __in ProviderPnPPowerComplete ProtocolCompletionHandler - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -TdiPnPPowerComplete( - __in HANDLE BindingHandle, - __in PNET_PNP_EVENT PowerEvent, - __in NTSTATUS Status - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiRegisterNetAddress( - __in PTA_ADDRESS Address, - __in PUNICODE_STRING DeviceName, - __in PTDI_PNP_CONTEXT Context, - __out HANDLE *RegistrationHandle - ); - -NTSTATUS -TdiMakeNCPAChanges( - __in TDI_NCPA_BINDING_INFO NcpaBindingInfo - ); - -// -// Enumerate all TDI addresses for a client -// -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiEnumerateAddresses( - __in HANDLE BindingHandle - ); - -// -// Introducing the concept of Transport provider. -// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiRegisterProvider( - __in PUNICODE_STRING ProviderName, - __out HANDLE *ProviderHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiProviderReady( - __in HANDLE ProviderHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -TdiDeregisterProvider( - __in HANDLE ProviderHandle - ); - -BOOLEAN -TdiMatchPdoWithChainedReceiveContext( - __in PVOID TsduDescriptor, - __in PVOID PDO - ); - - - -#define TDI_STATUS_BAD_VERSION 0xC0010004L // same as NDIS, is that OK? -#define TDI_STATUS_BAD_CHARACTERISTICS 0xC0010005L // ,, - - -// -// PNP context types -// -#define TDI_PNP_CONTEXT_TYPE_IF_NAME 0x1 -#define TDI_PNP_CONTEXT_TYPE_IF_ADDR 0x2 -#define TDI_PNP_CONTEXT_TYPE_PDO 0x3 -#define TDI_PNP_CONTEXT_TYPE_FIRST_OR_LAST_IF 0x4 - -// The following structures and macros are for handlers that support returning -// ancillary data via a control structure -// - -// -// Layout of ancillary data objects in the control buffer -// -typedef struct _TDI_CMSGHDR_XP { - SIZE_T cmsg_len; - LONG cmsg_level; - LONG cmsg_type; - /* followed by UCHAR cmsg_data[] */ -} TDI_CMSGHDR_XP, *PTDI_CMSGHDR_XP; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef TDI_CMSGHDR_XP TDI_CMSGHDR; -typedef TDI_CMSGHDR* PTDI_CMSGHDR; -#endif - -// -// Alignment macros for header and data members of -// the control buffer. -// -#define TDI_CMSGHDR_ALIGN(length) \ - ( ((length) + TYPE_ALIGNMENT(TDI_CMSGHDR)-1) & \ - (~(TYPE_ALIGNMENT(TDI_CMSGHDR)-1)) ) \ - -#define TDI_CMSGDATA_ALIGN(length) \ - ( ((length) + MAX_NATURAL_ALIGNMENT-1) & \ - (~(MAX_NATURAL_ALIGNMENT-1)) ) - - - -// Returns a pointer to the first byte of data (what is referred -// to as the cmsg_data member though it is not defined in -// the structure). -// -// UCHAR * -// TDI_CMSG_DATA ( -// PTDI_CMSGHDR pcmsg -// ); -// -#define TDI_CMSG_DATA(cmsg) \ - ( (UCHAR *)(cmsg) + TDI_CMSGDATA_ALIGN(sizeof(TDI_CMSGHDR)) ) - -// -// Returns total size of an ancillary data object given -// the amount of data. Used to allocate the correct amount -// of space. -// -// SIZE_T -// TDI_CMSG_SPACE ( -// SIZE_T length -// ); -// -#define TDI_CMSG_SPACE(length) \ - (TDI_CMSGDATA_ALIGN(sizeof(TDI_CMSGHDR) + TDI_CMSGHDR_ALIGN(length))) - -// Returns the value to store in cmsg_len given the amount of data. -// -// SIZE_T -// TDI_CMSG_LEN ( -// SIZE_T length -// ); -// -#define TDI_CMSG_LEN(length) \ - (TDI_CMSGDATA_ALIGN(sizeof(TDI_CMSGHDR)) + length) - - -// Initializes the members of a TDI_CMSGHDR structure -// -// VOID -// TDI_INIT_CMSGHDR ( -// PTDI_CMSGHDR cmsg, -// INT level, -// INT type, -// SIZE_T length, -// ); -// -#define TDI_INIT_CMSGHDR(cmsg, level, type, length) { \ - ((TDI_CMSGHDR *) cmsg)->cmsg_level = level; \ - ((TDI_CMSGHDR *) cmsg)->cmsg_type = type; \ - ((TDI_CMSGHDR *) cmsg)->cmsg_len = TDI_CMSG_LEN(length); \ - } - -#pragma warning(pop) -#endif // _TDI_KRNL_ - diff --git a/qt-correction-tool/pub/ddk/tdistat.h b/qt-correction-tool/pub/ddk/tdistat.h deleted file mode 100644 index ad04981..0000000 --- a/qt-correction-tool/pub/ddk/tdistat.h +++ /dev/null @@ -1,110 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - tdistat.h - -Abstract: - - This file contains the TDI status code definitions. - -Revision History: - ---*/ - -#pragma once - -#ifndef NT - -#define TDI_SUCCESS 0 // Success -#define TDI_NO_RESOURCES 1 // No resources. -#define TDI_ADDR_IN_USE 2 // Address already in use. -#define TDI_BAD_ADDR 3 // Address given is bad. -#define TDI_NO_FREE_ADDR 4 // No addresses available. -#define TDI_ADDR_INVALID 6 // Address object is invalid. -#define TDI_ADDR_DELETED 7 // Address object was deleted. -#define TDI_BUFFER_OVERFLOW 9 // Buffer overflowed. -#define TDI_BAD_EVENT_TYPE 10 // Bad event type. -#define TDI_BAD_OPTION 11 // Bad option or length. -#define TDI_CONN_REFUSED 14 // Connection was refused. -#define TDI_INVALID_CONNECTION 15 // Invalid connection. -#define TDI_ALREADY_ASSOCIATED 16 // Connection already associated. -#define TDI_NOT_ASSOCIATED 17 // Connection not associated. -#define TDI_CONNECTION_ACTIVE 18 // Connection is still active. -#define TDI_CONNECTION_ABORTED 19 // Connection was aborted. -#define TDI_CONNECTION_RESET 20 // Connection was reset. -#define TDI_TIMED_OUT 21 // Connection timed out. -#define TDI_GRACEFUL_DISC 22 // Received a graceful disconnect. -#define TDI_NOT_ACCEPTED 23 // Data not accepted. -#define TDI_MORE_PROCESSING 24 // More processing required. -#define TDI_INVALID_STATE 25 // TCB in an invalid state. -#define TDI_INVALID_PARAMETER 26 // An invalid parameter. -#define TDI_DEST_NET_UNREACH 27 // Destination net is unreachable. -#define TDI_DEST_HOST_UNREACH 28 // Dest. host is unreachable. -#define TDI_DEST_UNREACHABLE TDI_DEST_HOST_UNREACH -#define TDI_DEST_PROT_UNREACH 29 // Destination protocol is - // unreachable. -#define TDI_DEST_PORT_UNREACH 30 // Dest. port is unreachable. -#define TDI_INVALID_QUERY 31 // Invalid query type specified. -#define TDI_REQ_ABORTED 32 // Request was aborted for some - // reason. -#define TDI_BUFFER_TOO_SMALL 33 // Buffer was too small. -#define TDI_CANCELLED 34 // The request was cancelled. -#define TDI_BUFFER_TOO_BIG 35 // Send buffer was too big. -#define TDI_ITEM_NOT_FOUND 36 // Item not found. -#define TDI_INVALID_REQUEST 0xfe // Invalid request. -#define TDI_PENDING 0xff // Pending - -#else - -// -// Map to NT STATUS codes. -// -#define TDI_SUCCESS STATUS_SUCCESS -#define TDI_NO_RESOURCES STATUS_INSUFFICIENT_RESOURCES -#define TDI_ADDR_IN_USE STATUS_ADDRESS_ALREADY_EXISTS -#define TDI_BAD_ADDR STATUS_INVALID_ADDRESS_COMPONENT -#define TDI_NO_FREE_ADDR STATUS_TOO_MANY_ADDRESSES -#define TDI_ADDR_INVALID STATUS_INVALID_ADDRESS -#define TDI_ADDR_DELETED STATUS_ADDRESS_CLOSED -#define TDI_BUFFER_OVERFLOW STATUS_BUFFER_OVERFLOW -#define TDI_BAD_EVENT_TYPE STATUS_INVALID_PARAMETER -#define TDI_BAD_OPTION STATUS_INVALID_PARAMETER -#define TDI_CONN_REFUSED STATUS_CONNECTION_REFUSED -#define TDI_INVALID_CONNECTION STATUS_CONNECTION_INVALID -#define TDI_ALREADY_ASSOCIATED STATUS_ADDRESS_ALREADY_ASSOCIATED -#define TDI_NOT_ASSOCIATED STATUS_ADDRESS_NOT_ASSOCIATED -#define TDI_CONNECTION_ACTIVE STATUS_CONNECTION_ACTIVE -#define TDI_CONNECTION_ABORTED STATUS_CONNECTION_ABORTED -#define TDI_CONNECTION_RESET STATUS_CONNECTION_RESET -#define TDI_TIMED_OUT STATUS_IO_TIMEOUT -#define TDI_GRACEFUL_DISC STATUS_GRACEFUL_DISCONNECT -#define TDI_NOT_ACCEPTED STATUS_DATA_NOT_ACCEPTED -#define TDI_MORE_PROCESSING STATUS_MORE_PROCESSING_REQUIRED -#define TDI_INVALID_STATE STATUS_INVALID_DEVICE_STATE -#define TDI_INVALID_PARAMETER STATUS_INVALID_PARAMETER -#define TDI_DEST_NET_UNREACH STATUS_NETWORK_UNREACHABLE -#define TDI_DEST_HOST_UNREACH STATUS_HOST_UNREACHABLE -#define TDI_DEST_UNREACHABLE TDI_DEST_HOST_UNREACH -#define TDI_DEST_PROT_UNREACH STATUS_PROTOCOL_UNREACHABLE -#define TDI_DEST_PORT_UNREACH STATUS_PORT_UNREACHABLE -#define TDI_INVALID_QUERY STATUS_INVALID_DEVICE_REQUEST -#define TDI_REQ_ABORTED STATUS_REQUEST_ABORTED -#define TDI_BUFFER_TOO_SMALL STATUS_BUFFER_TOO_SMALL -#define TDI_CANCELLED STATUS_CANCELLED -#define TDI_BUFFER_TOO_BIG STATUS_INVALID_BUFFER_SIZE -#define TDI_INVALID_REQUEST STATUS_INVALID_DEVICE_REQUEST -#define TDI_PENDING STATUS_PENDING -#define TDI_ITEM_NOT_FOUND STATUS_OBJECT_NAME_NOT_FOUND - - -#endif // NT - -#define TDI_OPTION_EOL 0 - -#define TDI_ADDRESS_OPTION_REUSE 1 -#define TDI_ADDRESS_OPTION_DHCP 2 -#define TDI_ADDRESS_OPTION_RAW 3 - diff --git a/qt-correction-tool/pub/ddk/upssvc.h b/qt-correction-tool/pub/ddk/upssvc.h deleted file mode 100644 index e0fd8f0..0000000 --- a/qt-correction-tool/pub/ddk/upssvc.h +++ /dev/null @@ -1,198 +0,0 @@ -/*++ - -Copyright (c) 2000 Microsoft Corporation. All rights reserved. - -Module Name: - - upssvc.h - -Abstract: - - This file defines the interface to the serial UPS service in - Windows 2000. Please see the UPS documentation in the DDK - for more information. - - ---*/ - -#ifndef _INC_UPS_DRIVER_H_ -#define _INC_UPS_DRIVER_H_ - -#if ((NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)) - -// -// values that represent the state of the -// UPS system - these values are used in the -// UPSGetState and UPSWaitForStateChange functions -// -#define UPS_ONLINE 1 -#define UPS_ONBATTERY 2 -#define UPS_LOWBATTERY 4 -#define UPS_NOCOMM 8 -#define UPS_CRITICAL 16 - - -// -// possible error codes returned from UPSInit -// -#define UPS_INITUNKNOWNERROR 0 -#define UPS_INITOK 1 -#define UPS_INITNOSUCHDRIVER 2 -#define UPS_INITBADINTERFACE 3 -#define UPS_INITREGISTRYERROR 4 -#define UPS_INITCOMMOPENERROR 5 -#define UPS_INITCOMMSETUPERROR 6 - - -/** -* UPSInit -* -* Description: -* -* The UPSInit function must be called before any -* other function in this file -* -* Parameters: -* None -* -* Returns: -* UPS_INITOK: Initalization was successful -* UPS_INITNOSUCHDRIVER: The configured driver DLL can't be opened -* UPS_INITBADINTERFACE: The configured driver DLL doesn't support -* the UPS driver interface -* UPS_INITREGISTRYERROR: The 'Options' registry value is corrupt -* UPS_INITCOMMOPENERROR: The comm port could not be opened -* UPS_INITCOMMSETUPERROR: The comm port could not be configured -* UPS_INITUNKNOWNERROR: Undefined error has occurred -* -*/ -__checkReturn -DWORD -UPSInit( - void - ); - - -/** -* UPSStop -* -* Description: -* After a call to UPSStop, only the UPSInit -* function is valid. This call will unload the -* UPS driver interface and stop monitoring of the -* UPS system -* -* Parameters: -* None -* -* Returns: -* None -* -*/ -void -UPSStop( - void - ); - - -/** -* UPSWaitForStateChange -* -* Description: -* Blocks until the state of the UPS differs -* from the value passed in via aCurrentState or -* anInterval milliseconds has expired. If -* anInterval has a value of INFINITE this -* function will never timeout -* -* Parameters: -* aState: defines the state to wait for a change from, -* possible values: -* UPS_ONLINE -* UPS_ONBATTERY -* UPS_LOWBATTERY -* UPS_NOCOMM -* -* anInterval: timeout in milliseconds, or INFINITE for -* no timeout interval -* -* Returns: -* None -* -*/ -void -UPSWaitForStateChange( - __in DWORD aCurrentState, - __in DWORD anInterval - ); - - -/** -* UPSGetState -* -* Description: -* returns the current state of the UPS -* -* Parameters: -* None -* -* Returns: -* possible values: -* UPS_ONLINE -* UPS_ONBATTERY -* UPS_LOWBATTERY -* UPS_NOCOMM -* -*/ -DWORD -UPSGetState( - void - ); - - -/** -* UPSCancelWait -* -* Description: -* interrupts pending calls to UPSWaitForStateChange -* without regard to timout or state change -* -* Parameters: -* None -* -* Returns: -* None -* -*/ -void -UPSCancelWait( - void - ); - - -/** -* UPSTurnOff -* -* Description: -* Attempts to turn off the outlets on the UPS -* after the specified delay. This call must -* return immediately. Any work, such as a timer, -* must be performed on a another thread. -* -* Parameters: -* aTurnOffDelay: the minimum amount of time to wait before -* turning off the outlets on the UPS -* -* Returns: -* None -* -*/ -void -UPSTurnOff( - __in DWORD aTurnOffDelay - ); - -#endif // ((NTDDI_VERSION >= NTDDI_WINXP) && (NTDDI_VERSION < NTDDI_VISTA)) - -#endif - diff --git a/qt-correction-tool/pub/ddk/usbbusif.h b/qt-correction-tool/pub/ddk/usbbusif.h deleted file mode 100644 index a097c97..0000000 --- a/qt-correction-tool/pub/ddk/usbbusif.h +++ /dev/null @@ -1,494 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - usbbusif.h - -Abstract: - -Environment: - - Kernel mode - -Revision History: - - 6-20-99 : created - ---*/ - -#ifndef __USBBUSIF_H__ -#define __USBBUSIF_H__ - -/* - Bus interfaces are supported for Windows XP and later only -*/ -#ifndef USB_BUSIFFN -#define USB_BUSIFFN __stdcall -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -typedef PVOID PUSB_DEVICE_HANDLE; - - -/**************************************************************************** - Bus interface for USB FUNCTION DRIVERS -*****************************************************************************/ - - -/* - The following bus interface is defined for USB function drivers - as an alternative to linking directly with USBD.SYS - - It provides irp-less interfaces that may be called at Raised IRQL. -*/ - - -/* - -NTSTATUS -USBPORT_SubmitIsoOutUrb( - IN PVOID BusContext, - IN PURB Urb - ); - -Routine Description: - - Returns STATUS_NOT_SUPPORTED. - -Arguments: - -*/ - -typedef __checkReturn NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB) ( - __in PVOID, - __in PURB - ); - - -/* -VOID -USBPORT_GetUSBDIVersion( - IN PVOID BusContext, - IN OUT PUSBD_VERSION_INFORMATION VersionInformation, - IN OUT PULONG HcdCapabilities - ); - -Routine Description: - - Service Returns the Highest USBDI Interface Version supported - by the port driver. - - Released Interface Vesrions are: - - Win98Gold,usbd 0x00000102 - Win98SE,usbd 0x00000200 - Win2K,usbd 0x00000300 - Win98M (Millenium),usbd 0x00000400 - - Usbport 0x00000500 - - IRQL = ANY - -Arguments: - - VersionInformation - Ptr to USBD_VERSION_INFORMATION - HcdCapabilities - Ptr to ULONG that will be filled in with - the Host controller (port) driver capability flags. -*/ - -/* - Host Controller 'Port' driver capabilities flags -*/ - -#define USB_HCD_CAPS_SUPPORTS_RT_THREADS 0x00000001 - - -typedef VOID - (USB_BUSIFFN *PUSB_BUSIFFN_GETUSBDI_VERSION) ( - __in PVOID, - __out_opt PUSBD_VERSION_INFORMATION, - __out_opt PULONG - ); - -/* -NTSTATUS -USBPORT_QueryBusTime( - IN PVOID BusContext, - IN OUT PULONG CurrentUsbFrame - ); - -Routine Description: - - Returns the current 32 bit USB frame number. The function - replaces the USBD_QueryBusTime Service. - - IRQL = ANY - -Arguments: - - -*/ - - -typedef __checkReturn NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME) ( - __in PVOID, - __out_opt PULONG - ); - -/* -NTSTATUS -USBPORT_BusEnumLogEntry( - PVOID BusContext, - ULONG DriverTag, - ULONG EnumTag, - ULONG P1, - ULONG P2 - ); - -Routine Description: - - IRQL = ANY - -Arguments: - - -*/ - - -typedef NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_ENUM_LOG_ENTRY) ( - __in PVOID, - __in ULONG, - __in ULONG, - __in ULONG, - __in ULONG - ); - - - -/* -NTSTATUS -USBPORT_QueryBusInformation( - IN PVOID BusContext, - IN ULONG Level, - IN OUT PVOID BusInformationBuffer, - IN OUT PULONG BusInformationBufferLength, - OUT PULONG BusInformationActualLength - ); - -Routine Description: - - IRQL = ANY - -Arguments: - - -*/ - -typedef struct _USB_BUS_INFORMATION_LEVEL_0 { - - /* bandwidth in bits/sec */ - ULONG TotalBandwidth; - /* mean bandwidth consumed in bits/sec */ - ULONG ConsumedBandwidth; - -} USB_BUS_INFORMATION_LEVEL_0, *PUSB_BUS_INFORMATION_LEVEL_0; - - -typedef struct _USB_BUS_INFORMATION_LEVEL_1 { - - /* bandwidth in bits/sec */ - ULONG TotalBandwidth; - /* mean bandwidth consumed in bits/sec */ - ULONG ConsumedBandwidth; - - /* - controller 'unicode' symbolic name - */ - - ULONG ControllerNameLength; - WCHAR ControllerNameUnicodeString[1]; - -} USB_BUS_INFORMATION_LEVEL_1, *PUSB_BUS_INFORMATION_LEVEL_1; - - -typedef __checkReturn NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_INFORMATION) ( - __in PVOID, - __in ULONG, - __inout PVOID, - __out PULONG, - __out_opt PULONG - ); - - -/* -BOOLEAN -USBPORT_IsDeviceHighSpeed( - IN PVOID BusContext - ); - -Routine Description: - - Returns true if device is operating at high speed - - IRQL = ANY - -Arguments: - - -*/ - -typedef __checkReturn BOOLEAN - (USB_BUSIFFN *PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED) ( - __in_opt PVOID - ); - -#define USB_BUSIF_USBDI_VERSION_0 0x0000 -#define USB_BUSIF_USBDI_VERSION_1 0x0001 -#define USB_BUSIF_USBDI_VERSION_2 0x0002 -#define USB_BUSIF_USBDI_VERSION_3 0x0003 - -// {B1A96A13-3DE0-4574-9B01-C08FEAB318D6} -DEFINE_GUID(USB_BUS_INTERFACE_USBDI_GUID, -0xb1a96a13, 0x3de0, 0x4574, 0x9b, 0x1, 0xc0, 0x8f, 0xea, 0xb3, 0x18, 0xd6); - - -/* - Note: that this version must remain unchanged, this is the - version that is supported by USBD in Win2k and WinMe -*/ -typedef struct _USB_BUS_INTERFACE_USBDI_V0 { - - USHORT Size; - USHORT Version; - - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // the following functions must be callable at high IRQL, - // (ie higher than DISPATCH_LEVEL) - - PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; - PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; - PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; - PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; - -} USB_BUS_INTERFACE_USBDI_V0, *PUSB_BUS_INTERFACE_USBDI_V0; - -/* - New extensions for Windows XP -*/ -typedef struct _USB_BUS_INTERFACE_USBDI_V1 { - - USHORT Size; - USHORT Version; - - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // the following functions must be callable at high IRQL, - // (ie higher than DISPATCH_LEVEL) - - PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; - PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; - PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; - PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; - PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; - -} USB_BUS_INTERFACE_USBDI_V1, *PUSB_BUS_INTERFACE_USBDI_V1; - - -/* - New extensions for Windows XP -*/ -typedef struct _USB_BUS_INTERFACE_USBDI_V2 { - - USHORT Size; - USHORT Version; - - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // the following functions must be callable at high IRQL, - // (ie higher than DISPATCH_LEVEL) - - PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; - PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; - PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; - PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; - PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; - - PUSB_BUSIFFN_ENUM_LOG_ENTRY EnumLogEntry; - -} USB_BUS_INTERFACE_USBDI_V2, *PUSB_BUS_INTERFACE_USBDI_V2; - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -/* -NTSTATUS -USBPORT_QueryBusTimeEx( - IN PVOID BusContext, - OUT PULONG HighSpeedFrameCounter - ); -*/ - -typedef __checkReturn NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_BUS_TIME_EX) ( - __in_opt PVOID, - __out_opt PULONG - ); - -/* - - -/* -NTSTATUS -USBPORTBUSIF_UsbdQueryControllerType( - __in_opt PVOID BusContext, - __out_opt PULONG HcdiOptionFlags, - __out_opt PUSHORT PciVendorId, - __out_opt PUSHORT PciDeviceId, - __out_opt PUCHAR PciClass, - __out_opt PUCHAR PciSubClass, - __out_opt PUCHAR PciRevisionId, - __out_opt PUCHAR PciProgIf - ); -*/ - -typedef __checkReturn NTSTATUS - (USB_BUSIFFN *PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE) ( - __in_opt PVOID, - __out_opt PULONG, - __out_opt PUSHORT, - __out_opt PUSHORT, - __out_opt PUCHAR, - __out_opt PUCHAR, - __out_opt PUCHAR, - __out_opt PUCHAR - ); - - -// version 3 Vista and later - -typedef struct _USB_BUS_INTERFACE_USBDI_V3 { - - USHORT Size; - USHORT Version; - - PVOID BusContext; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - // interface specific entries go here - - // the following functions must be callable at high IRQL, - // (ie higher than DISPATCH_LEVEL) - - PUSB_BUSIFFN_GETUSBDI_VERSION GetUSBDIVersion; - PUSB_BUSIFFN_QUERY_BUS_TIME QueryBusTime; - PUSB_BUSIFFN_SUBMIT_ISO_OUT_URB SubmitIsoOutUrb; - PUSB_BUSIFFN_QUERY_BUS_INFORMATION QueryBusInformation; - PUSB_BUSIFFN_IS_DEVICE_HIGH_SPEED IsDeviceHighSpeed; - PUSB_BUSIFFN_ENUM_LOG_ENTRY EnumLogEntry; - - PUSB_BUSIFFN_QUERY_BUS_TIME_EX QueryBusTimeEx; - PUSB_BUSIFFN_QUERY_CONTROLLER_TYPE QueryControllerType; - -} USB_BUS_INTERFACE_USBDI_V3, *PUSB_BUS_INTERFACE_USBDI_V3; - - -// -// USBCCGP.SYS filter driver bus interfaces supported for Windows Longhorn and later. -// These are callback functions that the usbccgp.sys driver will invoke to allow -// a filter driver to customize the device. The filter driver must export the interface. -// - -// {893B6A96-0B7F-4d4d-BDB4-BBD4CEEBB31C} -DEFINE_GUID(USB_BUS_INTERFACE_USBC_CONFIGURATION_GUID, -0x893b6a96, 0xb7f, 0x4d4d, 0xbd, 0xb4, 0xbb, 0xd4, 0xce, 0xeb, 0xb3, 0x1c); - -#define USBC_FUNCTION_FLAG_APPEND_ID 0x1 - -typedef struct _USBC_FUNCTION_DESCRIPTOR{ - // The 0-based index of the function described - UCHAR FunctionNumber; - - // The number of interfaces contained in this function - UCHAR NumberOfInterfaces; - - // A callee allocated array of pointers into the config desc buffer passed as an input - PUSB_INTERFACE_DESCRIPTOR *InterfaceDescriptorList; - - // Callee allocated PNP IDs for this PDO - UNICODE_STRING HardwareId; - UNICODE_STRING CompatibleId; - UNICODE_STRING FunctionDescription; - - // Custom Flags - ULONG FunctionFlags; - PVOID Reserved; -} USBC_FUNCTION_DESCRIPTOR, *PUSBC_FUNCTION_DESCRIPTOR; - -// -// Callback invoked during START to customize PDO interface groupings and PNP ids. -// - -typedef __checkReturn -NTSTATUS -(USB_BUSIFFN *USBC_START_DEVICE_CALLBACK)( - __in PUSB_DEVICE_DESCRIPTOR DeviceDescriptor, - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __deref_out_bcount_opt(*FunctionDescriptorBufferLength) PUSBC_FUNCTION_DESCRIPTOR *FunctionDescriptorBuffer, - __out PULONG FunctionDescriptorBufferLength, - __in PDEVICE_OBJECT FdoDeviceObject, - __in PDEVICE_OBJECT PdoDeviceObject - ); - -typedef __checkReturn -BOOLEAN -(USB_BUSIFFN *USBC_PDO_ENABLE_CALLBACK)( - __in PVOID Context, - __in USHORT FirstInterfaceNumber, - __in USHORT NumberOfInterfaces, - __in UCHAR FunctionClass, - __in UCHAR FunctionSubClass, - __in UCHAR FunctionProtocol - ); - - -#define USBC_DEVICE_CONFIGURATION_INTERFACE_VERSION_1 0x0001 - -typedef struct _USBC_DEVICE_CONFIGURATION_INTERFACE_V1 { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - USBC_START_DEVICE_CALLBACK StartDeviceCallback; - USBC_PDO_ENABLE_CALLBACK PdoEnableCallback; - - PVOID Reserved[7]; -} USBC_DEVICE_CONFIGURATION_INTERFACE_V1, *PUSBC_DEVICE_CONFIGURATION_INTERFACE_V1; - -#endif - -#endif /* __USBBUSIF_H */ - diff --git a/qt-correction-tool/pub/ddk/usbdlib.h b/qt-correction-tool/pub/ddk/usbdlib.h deleted file mode 100644 index e3aede5..0000000 --- a/qt-correction-tool/pub/ddk/usbdlib.h +++ /dev/null @@ -1,576 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - USBDLIB.H - -Abstract: - - Services exported by USBD. - -Environment: - - Kernel & user mode - -Revision History: - - 06-10-96 : created - ---*/ - -#ifndef __USBDLIB_H__ -#define __USBDLIB_H__ - -#ifdef OSR21_COMPAT -#pragma message("WARNING: OSR21_COMPAT SWITCH NOT SUPPORTED") -#endif - -typedef struct _USBD_INTERFACE_LIST_ENTRY { - PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor; - PUSBD_INTERFACE_INFORMATION Interface; -} USBD_INTERFACE_LIST_ENTRY, *PUSBD_INTERFACE_LIST_ENTRY; - - -// -// Macros for building URB requests -// - -#define UsbBuildInterruptOrBulkTransferRequest(urb, \ - length, \ - pipeHandle, \ - transferBuffer, \ - transferBufferMDL, \ - transferBufferLength, \ - transferFlags, \ - link) { \ - (urb)->UrbHeader.Function = URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbBulkOrInterruptTransfer.PipeHandle = (pipeHandle); \ - (urb)->UrbBulkOrInterruptTransfer.TransferBufferLength = (transferBufferLength); \ - (urb)->UrbBulkOrInterruptTransfer.TransferBufferMDL = (transferBufferMDL); \ - (urb)->UrbBulkOrInterruptTransfer.TransferBuffer = (transferBuffer); \ - (urb)->UrbBulkOrInterruptTransfer.TransferFlags = (transferFlags); \ - (urb)->UrbBulkOrInterruptTransfer.UrbLink = (link); } - - -#define UsbBuildGetDescriptorRequest(urb, \ - length, \ - descriptorType, \ - descriptorIndex, \ - languageId, \ - transferBuffer, \ - transferBufferMDL, \ - transferBufferLength, \ - link) { \ - (urb)->UrbHeader.Function = URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbControlDescriptorRequest.TransferBufferLength = (transferBufferLength); \ - (urb)->UrbControlDescriptorRequest.TransferBufferMDL = (transferBufferMDL); \ - (urb)->UrbControlDescriptorRequest.TransferBuffer = (transferBuffer); \ - (urb)->UrbControlDescriptorRequest.DescriptorType = (descriptorType); \ - (urb)->UrbControlDescriptorRequest.Index = (descriptorIndex); \ - (urb)->UrbControlDescriptorRequest.LanguageId = (languageId); \ - (urb)->UrbControlDescriptorRequest.UrbLink = (link); } - - - -#define UsbBuildGetStatusRequest(urb, \ - op, \ - index, \ - transferBuffer, \ - transferBufferMDL, \ - link) { \ - (urb)->UrbHeader.Function = (op); \ - (urb)->UrbHeader.Length = sizeof(struct _URB_CONTROL_GET_STATUS_REQUEST); \ - (urb)->UrbControlGetStatusRequest.TransferBufferLength = sizeof(USHORT); \ - (urb)->UrbControlGetStatusRequest.TransferBufferMDL = (transferBufferMDL); \ - (urb)->UrbControlGetStatusRequest.TransferBuffer = (transferBuffer); \ - (urb)->UrbControlGetStatusRequest.Index = (index); \ - (urb)->UrbControlGetStatusRequest.UrbLink = (link); } - - -#define UsbBuildFeatureRequest(urb, \ - op, \ - featureSelector, \ - index, \ - link) { \ - (urb)->UrbHeader.Function = (op); \ - (urb)->UrbHeader.Length = sizeof(struct _URB_CONTROL_FEATURE_REQUEST); \ - (urb)->UrbControlFeatureRequest.FeatureSelector = (featureSelector); \ - (urb)->UrbControlFeatureRequest.Index = (index); \ - (urb)->UrbControlFeatureRequest.UrbLink = (link); } - - - -#define UsbBuildSelectConfigurationRequest(urb, \ - length, \ - configurationDescriptor) { \ - (urb)->UrbHeader.Function = URB_FUNCTION_SELECT_CONFIGURATION; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbSelectConfiguration.ConfigurationDescriptor = (configurationDescriptor); } - -#define UsbBuildSelectInterfaceRequest(urb, \ - length, \ - configurationHandle, \ - interfaceNumber, \ - alternateSetting) { \ - (urb)->UrbHeader.Function = URB_FUNCTION_SELECT_INTERFACE; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbSelectInterface.Interface.AlternateSetting = (alternateSetting); \ - (urb)->UrbSelectInterface.Interface.InterfaceNumber = (interfaceNumber); \ - (urb)->UrbSelectInterface.Interface.Length = (length - sizeof(struct _URB_HEADER) - sizeof(USBD_CONFIGURATION_HANDLE)); \ - (urb)->UrbSelectInterface.ConfigurationHandle = (configurationHandle); } - - -#define UsbBuildVendorRequest(urb, \ - cmd, \ - length, \ - transferFlags, \ - reservedbits, \ - request, \ - value, \ - index, \ - transferBuffer, \ - transferBufferMDL, \ - transferBufferLength, \ - link) { \ - (urb)->UrbHeader.Function = cmd; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbControlVendorClassRequest.TransferBufferLength = (transferBufferLength); \ - (urb)->UrbControlVendorClassRequest.TransferBufferMDL = (transferBufferMDL); \ - (urb)->UrbControlVendorClassRequest.TransferBuffer = (transferBuffer); \ - (urb)->UrbControlVendorClassRequest.RequestTypeReservedBits = (reservedbits); \ - (urb)->UrbControlVendorClassRequest.Request = (request); \ - (urb)->UrbControlVendorClassRequest.Value = (value); \ - (urb)->UrbControlVendorClassRequest.Index = (index); \ - (urb)->UrbControlVendorClassRequest.TransferFlags = (transferFlags); \ - (urb)->UrbControlVendorClassRequest.UrbLink = (link); } - - -// This is just a special vendor class request. -// Defined for windows XP and later - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -#define UsbBuildOsFeatureDescriptorRequest(urb, \ - length, \ - interface, \ - index, \ - transferBuffer, \ - transferBufferMDL, \ - transferBufferLength, \ - link) { \ - (urb)->UrbHeader.Function = URB_FUNCTION_GET_MS_FEATURE_DESCRIPTOR; \ - (urb)->UrbHeader.Length = (length); \ - (urb)->UrbOSFeatureDescriptorRequest.TransferBufferLength = (transferBufferLength); \ - (urb)->UrbOSFeatureDescriptorRequest.TransferBufferMDL = (transferBufferMDL); \ - (urb)->UrbOSFeatureDescriptorRequest.TransferBuffer = (transferBuffer); \ - (urb)->UrbOSFeatureDescriptorRequest.InterfaceNumber = (interface); \ - (urb)->UrbOSFeatureDescriptorRequest.MS_FeatureDescriptorIndex = (index); \ - (urb)->UrbOSFeatureDescriptorRequest.UrbLink = (link); } - -#endif - -// -// Get the USB status code -// - -#define URB_STATUS(urb) ((urb)->UrbHeader.Status) - -// -// Macros used for select interface and select configuration requests -// - -// -// Calculates the size needed for a SELECT_CONFIGURATION URB request given -// the number of interfaces and the total number of pipes in all interfaces -// selected. -// - - -#define GET_SELECT_CONFIGURATION_REQUEST_SIZE(totalInterfaces, totalPipes) \ - (sizeof(struct _URB_SELECT_CONFIGURATION) + \ - ((totalInterfaces-1) * sizeof(USBD_INTERFACE_INFORMATION)) + \ - ((totalPipes-totalInterfaces)*sizeof(USBD_PIPE_INFORMATION))) - -// -// Calculates the size needed for a SELECT_INTERFACE URB request given -// the number of pipes in the alternate interface selected. -// - -#define GET_SELECT_INTERFACE_REQUEST_SIZE(totalPipes) \ - (sizeof(struct _URB_SELECT_INTERFACE) + \ - ((totalPipes-1)*sizeof(USBD_PIPE_INFORMATION))) - -// -// Calculates the size of the interface information structure needed to describe -// a give interface based on the number of endpoints. -// - - -#define GET_USBD_INTERFACE_SIZE(numEndpoints) (sizeof(USBD_INTERFACE_INFORMATION) + \ - (sizeof(USBD_PIPE_INFORMATION)*(numEndpoints)) \ - - sizeof(USBD_PIPE_INFORMATION)) - -// -// Calculates the size of an iso urb request given the number of packets -// - -#define GET_ISO_URB_SIZE(n) (sizeof(struct _URB_ISOCH_TRANSFER)+\ - sizeof(USBD_ISO_PACKET_DESCRIPTOR)*n) - - -#ifndef _USBD_ - -__drv_maxIRQL(DISPATCH_LEVEL) -DECLSPEC_IMPORT -VOID -USBD_GetUSBDIVersion( - __out PUSBD_VERSION_INFORMATION VersionInformation - ); - - -__drv_preferredFunction("USBD_ParseConfigurationDescriptorEx", "Obsolete") -DECLSPEC_IMPORT -PUSB_INTERFACE_DESCRIPTOR -USBD_ParseConfigurationDescriptor( - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __in UCHAR InterfaceNumber, - __in UCHAR AlternateSetting - ); -/*++ - -Routine Description: - - This function is replaced by USBD_ParseConfigurationDescriptorEx - -Arguments: - -Return Value: - - ---*/ - - -__drv_preferredFunction("USBD_CreateConfigurationRequestEx", "Obsolete") -DECLSPEC_IMPORT -PURB -USBD_CreateConfigurationRequest( - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __out PUSHORT Siz - ); -/*++ - -Routine Description: - - This function is replaced by USBD_CreateConfigurationRequestEx - -Arguments: - - -Return Value: - - ---*/ - - -// -// These APIS replace USBD_CreateConfigurationRequest, -// USBD_ParseConfigurationDescriptor -// - -__drv_maxIRQL(APC_LEVEL) -DECLSPEC_IMPORT -PUSB_COMMON_DESCRIPTOR -USBD_ParseDescriptors( - __in PVOID DescriptorBuffer, - __in ULONG TotalLength, - __in PVOID StartPosition, - __in LONG DescriptorType - ); -/*++ - -Routine Description: - - Parses a group of standard USB configuration descriptors (returned from a device) for - a specific descriptor type. - -Arguments: - - DescriptorBuffer - pointer to a block of contiguous USB desscriptors - TotalLength - size in bytes of the Descriptor buffer - StartPosition - starting position in the buffer to begin parsing, - this must point to the begining of a USB descriptor. - DescriptorType - USB descritor type to locate. - - -Return Value: - - pointer to a usb descriptor with a DescriptorType field matching the - input parameter or NULL if not found. - ---*/ - - -__drv_maxIRQL(APC_LEVEL) -DECLSPEC_IMPORT -PUSB_INTERFACE_DESCRIPTOR -USBD_ParseConfigurationDescriptorEx( - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __in PVOID StartPosition, - __in LONG InterfaceNumber, - __in LONG AlternateSetting, - __in LONG InterfaceClass, - __in LONG InterfaceSubClass, - __in LONG InterfaceProtocol - ); -/*++ - -Routine Description: - - Parses a standard USB configuration descriptor (returned from a device) for - a specific interface, alternate setting class subclass or protocol codes - -Arguments: - - ConfigurationDescriptor - pointer to USB configuration descriptor, returned - from a device (includes all interface and endpoint - descriptors). - StartPosition - pointer to starting position within the configuration - descrptor to begin parsing -- this must be a valid usb - descriptor. - InterfaceNumber - interface number to find, (-1) match any - AlternateSetting - alt setting number to find, (-1) match any - InterfaceClass - class to find, (-1) match any - InterfaceSubClass - subclass to find, (-1) match any - InterfaceProtocol - protocol to find, (-1) match any - -Return Value: - - returns a pointer to the first interface descriptor matching the parameters - passed in (starting from startposition) or NULL if no match is found. - ---*/ - -__drv_maxIRQL(DISPATCH_LEVEL) -DECLSPEC_IMPORT -PURB -USBD_CreateConfigurationRequestEx( - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __in PUSBD_INTERFACE_LIST_ENTRY InterfaceList - ); -/*++ - -Routine Description: - - Allocates and initilaizes a urb of sufficient size to configure a device - based on the list of interfaces passed in. - - The interface list is a contiguous array of USBD_INTERFACE_LIST_ENTRIES - each pointing to a specific interface descriptor to be incorporated in - the request, the list is terminated by a list entry with an - InterfaceDescriptor pointer of NULL. - - On return the interface field of each list entry is filled in with a pointer - to the USBD_INTERFACE_INFORMATION structure within the URB corrisponding to - the same interface descriptor. - -Arguments: - - ConfigurationDescriptor - pointer to USB configuration descriptor, returned - from a device (includes all interface and endpoint - descriptors). - - InterfaceList - list of interfaces we are interested in. - -Return Value: - - Pointer to initailized select_configuration urb. - ---*/ - -__drv_maxIRQL(PASSIVE_LEVEL) -__declspec(dllexport) -ULONG -USBD_GetInterfaceLength( - __in PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor, - __in PUCHAR BufferEnd - ); -/*++ - -Routine Description: - - Returns the length (in bytes) of a given interface descriptor - including all endpoint and class descriptors - - -Arguments: - - InterfaceDescriptor - - BufferEnd - Pointer to the end of the buffer containing the descriptors - -Return Value: - - length of descriptors - ---*/ - - -__drv_maxIRQL(PASSIVE_LEVEL) -__declspec(dllexport) -VOID -USBD_RegisterHcFilter( - __in PDEVICE_OBJECT DeviceObject, - __in PDEVICE_OBJECT FilterDeviceObject - ); - -/*++ - -Routine Description: - - Called by an HC filter driver after it attaches to the top - of the host controller driver stack. - -Arguments: - - DeviceObject - current top of stack - - FilterDeviceObject - device object for the filter driver - -Return Value: - - none - ---*/ - -__drv_maxIRQL(APC_LEVEL) -__drv_preferredFunction("(see documentation)", "Obsolete") -__declspec(dllexport) -NTSTATUS -USBD_GetPdoRegistryParameter( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __inout_bcount(ParameterLength) PVOID Parameter, - __in ULONG ParameterLength, - __in_bcount(KeyNameLength) PWSTR KeyName, - __in ULONG KeyNameLength - ); -/*++ - -Routine Description: - -Arguments: - -Return Value: - ---*/ - -__drv_preferredFunction("(see documentation)", "Obsolete") -__declspec(dllexport) -NTSTATUS -USBD_QueryBusTime( - __in PDEVICE_OBJECT RootHubPdo, - __out PULONG CurrentFrame - ); -/*++ - -Routine Description: - - Returns the current frame, callable at any IRQL - -Arguments: - -Return Value: - ---*/ - -/* - Defined for Windows XP and later -*/ - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_preferredFunction("(see documentation)", "Obsolete") -DECLSPEC_IMPORT -ULONG -USBD_CalculateUsbBandwidth( - __in ULONG MaxPacketSize, - __in UCHAR EndpointType, - __in BOOLEAN LowSpeed - ); -/*++ - -Routine Description: - - Returns bus bw consumed based on the endpoint type and - packet size - -Arguments: - -Return Value: - ---*/ -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -__drv_maxIRQL(DISPATCH_LEVEL) -DECLSPEC_IMPORT -USBD_STATUS -USBD_ValidateConfigurationDescriptor( - __in_bcount(BufferLength) PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc, - __in ULONG BufferLength, - __in USHORT Level, - __out PUCHAR *Offset, - __in_opt ULONG Tag); -/*++ - -Routine Description: - - Validates a USB Configuration Descriptor - -Arguments: - - ConfigDesc: Pointer to the USB Configuration descriptor to be validated - - BufferLength: Known size of buffer pointed to by ConfigDesc (NOT NECESSARILY wTotalLength) - - Level: Level of checking desired: - 1: Basic Config Descriptor header check only - - 2: Full pass-through of the config descriptor checking for the following: - - a) Unique endpoint addresses and interface numbers - c) Number of interfaces contained in the descriptor - d) Ensures the bLength values of the USB descriptors do not - exceed the length of the buffer. - c) Basic validation of information in a USB_INTERFACE_ASSOCIATION_DESCRIPTOR - - 3: Includes all of the validation for levels 1-2 plus the following: - - a) Validation of the number of endpoints in each interface - b) Enforcement of the USB spec descriptor bLength sizes. - c) Check to see if all interface numbers are in - sequential(not necessarily consecutive) order. - - - Offset: if the USBD_STATUS returned is not USBD_STATUS_SUCCESS, offet will - be set to the address within the ConfigDesc buffer where the failure occured. - - Tag: Driver-defined heap pool tag to be used by usbdlib. - - Return Value: - - One of the USBD_STATUS codes declared in usb.h - ---*/ - -#endif /* (NTDDI_VERSION >= NTDDI_VISTA) */ - -#endif /* _USBD_ */ - -#endif /* __USBDLIB_H__ */ - diff --git a/qt-correction-tool/pub/ddk/usbdrivr.h b/qt-correction-tool/pub/ddk/usbdrivr.h deleted file mode 100644 index e24410a..0000000 --- a/qt-correction-tool/pub/ddk/usbdrivr.h +++ /dev/null @@ -1,35 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - USBDRIVR.H - -Abstract: - - This file defined USB header files of interest to a driver. - -Environment: - - Kernel mode - -Revision History: - ---*/ - -#ifndef __USBDRIVR_H__ -#define __USBDRIVR_H__ - -#define USB_KERNEL_IOCTL -#include "usbioctl.h" -#undef USB_KERNEL_IOCTL - -#include "usb.h" -#include "usbdlib.h" -#include "usbbusif.h" - - -#endif // __USBDRIVR_H__ - - diff --git a/qt-correction-tool/pub/ddk/usbkern.h b/qt-correction-tool/pub/ddk/usbkern.h deleted file mode 100644 index 0b61e4e..0000000 --- a/qt-correction-tool/pub/ddk/usbkern.h +++ /dev/null @@ -1,35 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - USBKERN.H - -Abstract: - - This file contains KERNEL Mode IOCTLS supported by - the HCD (PORT) drivers ROOT HUB PDO. - - OBSOLETE header file. Use usbioctl.h instead. - -Environment: - - kernel mode - -Revision History: - - 4/2003: Header obsolete - - ---*/ - -#ifndef __USBKERN_H__ -#define __USBKERN_H__ - - -#include "usbioctl.h" - -#endif //__USBKERN_H__ - - diff --git a/qt-correction-tool/pub/ddk/usbprint.h b/qt-correction-tool/pub/ddk/usbprint.h deleted file mode 100644 index bc5d807..0000000 --- a/qt-correction-tool/pub/ddk/usbprint.h +++ /dev/null @@ -1,49 +0,0 @@ -/*++ - -Copyright (c) 1998 - 2000 Microsoft Corporation - -Module Name: - - ioctl.h - -Abstract: - - - -Environment: - - Kernel & user mode - -Revision History: - - ---*/ - -#define USBPRINT_IOCTL_INDEX 0x0000 - - -#define IOCTL_USBPRINT_GET_LPT_STATUS CTL_CODE(FILE_DEVICE_UNKNOWN, \ - USBPRINT_IOCTL_INDEX+12,\ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - -#define IOCTL_USBPRINT_GET_1284_ID CTL_CODE(FILE_DEVICE_UNKNOWN, \ - USBPRINT_IOCTL_INDEX+13,\ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - -#define IOCTL_USBPRINT_VENDOR_SET_COMMAND CTL_CODE(FILE_DEVICE_UNKNOWN, \ - USBPRINT_IOCTL_INDEX+14,\ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - -#define IOCTL_USBPRINT_VENDOR_GET_COMMAND CTL_CODE(FILE_DEVICE_UNKNOWN, \ - USBPRINT_IOCTL_INDEX+15,\ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - -#define IOCTL_USBPRINT_SOFT_RESET CTL_CODE(FILE_DEVICE_UNKNOWN, \ - USBPRINT_IOCTL_INDEX+16,\ - METHOD_BUFFERED, \ - FILE_ANY_ACCESS) - diff --git a/qt-correction-tool/pub/ddk/usbscan.h b/qt-correction-tool/pub/ddk/usbscan.h deleted file mode 100644 index 4ebe14d..0000000 --- a/qt-correction-tool/pub/ddk/usbscan.h +++ /dev/null @@ -1,157 +0,0 @@ -/*++ - -Copyright (C) 1997, Logitech Inc. - -Module Name: - UsbScan.h - -Abstract: - Interface with UsbScan kernel driver - -Environment: - User and kernel mode use - -Notes: - Interface definition for USB still image driver. - ---*/ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#ifndef _USBSCAN_H_ -#define _USBSCAN_H_ -#pragma pack(push,8) - -#ifndef MAX_NUM_PIPES - #define MAX_NUM_PIPES 8 -#endif - -#define BULKIN_FLAG 0x80 - -typedef struct _DRV_VERSION { - __out unsigned major; - __out unsigned minor; - __out unsigned internal; -} DRV_VERSION, *PDRV_VERSION; - -typedef struct _IO_BLOCK { - __in unsigned uOffset; - __in unsigned uLength; - __inout_bcount(uLength) PUCHAR pbyData; - __in unsigned uIndex; -} IO_BLOCK, *PIO_BLOCK; - -typedef struct _IO_BLOCK_EX { - __in unsigned uOffset; - __in unsigned uLength; - __inout_bcount(uLength) PUCHAR pbyData; - __in unsigned uIndex; - - // - // Following two fields are described in sec. 9.3.1,2 USB specification - // - __in UCHAR bRequest; // Specific request - __in UCHAR bmRequestType; // Bitmap - charateristics of request - __in UCHAR fTransferDirectionIn; // TRUE - Device-->Host; FALSE - Host-->Device - -} IO_BLOCK_EX, *PIO_BLOCK_EX; - - -typedef struct _CHANNEL_INFO { - __out unsigned EventChannelSize; - __out unsigned uReadDataAlignment; - __out unsigned uWriteDataAlignment; -} CHANNEL_INFO, *PCHANNEL_INFO; - -typedef enum { - EVENT_PIPE, - READ_DATA_PIPE, - WRITE_DATA_PIPE, - ALL_PIPE -} PIPE_TYPE; - - -typedef struct _USBSCAN_GET_DESCRIPTOR { - __in UCHAR DescriptorType; // high byte of wValue field in USB spec. - __in UCHAR Index; // low byte of wValue field in USB spec. - __in USHORT LanguageId; // wIndex field in USB spec. -} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR; - - -// -// The device descriptor structure reports information define in the hardware. -// If there is enough space to copy the strings, it will be done otherwise -// only the three first fields: -// -// USHORT usVendorId; -// USHORT usProductId; -// USHORT usBcdDevice; -// -// will contain valid data. Remember: The strings are UNICODE format. -// - -typedef struct _DEVICE_DESCRIPTOR { - __out USHORT usVendorId; - __out USHORT usProductId; - __out USHORT usBcdDevice; - __out USHORT usLanguageId; -} DEVICE_DESCRIPTOR, *PDEVICE_DESCRIPTOR; - -typedef enum _RAW_PIPE_TYPE { - USBSCAN_PIPE_CONTROL, - USBSCAN_PIPE_ISOCHRONOUS, - USBSCAN_PIPE_BULK, - USBSCAN_PIPE_INTERRUPT -} RAW_PIPE_TYPE; - -typedef struct _USBSCAN_PIPE_INFORMATION { - USHORT MaximumPacketSize; // Maximum packet size for this pipe - UCHAR EndpointAddress; // 8 bit USB endpoint address (includes direction) - UCHAR Interval; // Polling interval in ms if interrupt pipe - RAW_PIPE_TYPE PipeType; // PipeType identifies type of transfer valid for this pipe -} USBSCAN_PIPE_INFORMATION, *PUSBSCAN_PIPE_INFORMATION; - -typedef struct _USBSCAN_PIPE_CONFIGURATION { - __out ULONG NumberOfPipes; - __out_ecount(NumberOfPipes) USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES]; -} USBSCAN_PIPE_CONFIGURATION, *PUSBSCAN_PIPE_CONFIGURATION; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -typedef struct _USBSCAN_TIMEOUT { - ULONG TimeoutRead; - ULONG TimeoutWrite; - ULONG TimeoutEvent; -} USBSCAN_TIMEOUT, *PUSBSCAN_TIMEOUT; -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -#define FILE_DEVICE_USB_SCAN 0x8000 -#define IOCTL_INDEX 0x0800 - -#define IOCTL_GET_VERSION CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_CANCEL_IO CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+1, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_WAIT_ON_DEVICE_EVENT CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+2, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_READ_REGISTERS CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+3, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_WRITE_REGISTERS CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+4, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_GET_CHANNEL_ALIGN_RQST CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+5, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_GET_DEVICE_DESCRIPTOR CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+6, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_RESET_PIPE CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+7, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_GET_USB_DESCRIPTOR CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+8, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_SEND_USB_REQUEST CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+9, METHOD_BUFFERED,FILE_ANY_ACCESS) -#define IOCTL_GET_PIPE_CONFIGURATION CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+10,METHOD_BUFFERED,FILE_ANY_ACCESS) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#define IOCTL_SET_TIMEOUT CTL_CODE(FILE_DEVICE_USB_SCAN,IOCTL_INDEX+11,METHOD_BUFFERED,FILE_ANY_ACCESS) -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -// -// Temporary to avoid breaking LOGISCAN code -// -#define ALL ALL_PIPE -#define IOCTL_ABORT_PIPE IOCTL_CANCEL_IO -// -// -#pragma pack(pop) -#endif // _USBSCAN_H_ - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - diff --git a/qt-correction-tool/pub/ddk/usbstorioctl.h b/qt-correction-tool/pub/ddk/usbstorioctl.h deleted file mode 100644 index d3ecfe9..0000000 --- a/qt-correction-tool/pub/ddk/usbstorioctl.h +++ /dev/null @@ -1,103 +0,0 @@ -/*++ - -Copyright (c) 1996-2007 Microsoft Corporation - -Module Name: - - USBStorIoctl.h - -Abstract: - - Header file for USBSTOR IOCTLs - -Environment: - - kernel mode - -Revision History: - - 05-01-07 : Created - ---*/ - -#pragma once - -#ifndef MAX_PATH -#define MAX_PATH 260 -#endif - -typedef struct tagACT_AUTHZ_STATE -{ - UCHAR ACT; - BOOLEAN fAuthorized; -} ACT_AUTHZ_STATE, *PACT_AUTHZ_STATE; - -typedef struct tagSILO_COMMAND -{ - UCHAR SiloIndex; - UCHAR Command; - ULONG cbCommandBuffer; - UCHAR rgbCommandBuffer[ANYSIZE_ARRAY]; -} SILO_COMMAND, *PSILO_COMMAND; - -// Enumeration -typedef enum _PDO_TYPE -{ - PDO_TYPE_UNDEFINED = 0, - - // Types either enumerated or provided as filter parameter to IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS - PDO_TYPE_DISK, - PDO_TYPE_CONTROL, - PDO_TYPE_SILO, - - // This type is never enumerated, only provided as a filter parameter to IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS - PDO_TYPE_THIS = 256 -} PDO_TYPE; - -// Enumeration -typedef enum _PDO_STATE -{ - PDO_STATE_UNDEFINED = 0, - PDO_STATE_STARTED, - PDO_STATE_NOT_STARTED -} PDO_STATE; - -// Bit-mask -typedef enum _PDO_CAPS -{ - PDO_CAPABILITY_UNDEFINED = 0, - PDO_CAPABILITY_INC512_SET = 1, - PDO_CAPABILITY_INC512_CLEAR = 2 -} PDO_CAPS; - -typedef struct _ENUM_PDO_ENTRY -{ - UCHAR type; - UCHAR state; - UCHAR capabilities; - ULONG ulSTID; - UCHAR bSpecificationMajor; - UCHAR bSpecificationMinor; - UCHAR bImplementationMajor; - UCHAR bImplementationMinor; - WCHAR wszDeviceInstancePath[(2 * MAX_PATH) + 1]; -} ENUM_PDO_ENTRY, *PENUM_PDO_ENTRY; - -typedef struct _ENUM_PDO_RESULTS -{ - ULONG cEntries; - ENUM_PDO_ENTRY rgEntries[ANYSIZE_ARRAY]; - -} ENUM_PDO_RESULTS, *PENUM_PDO_RESULTS; - -#define SIZE_ENUM_PDO_RESULTS_HEADER (sizeof(ENUM_PDO_RESULTS) - sizeof(ENUM_PDO_ENTRY)) - -#define IOCTL_EHSTOR_DEVICE_SET_AUTHZ_STATE CTL_CODE(IOCTL_STORAGE_BASE, 0x501, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_EHSTOR_DEVICE_GET_AUTHZ_STATE CTL_CODE(IOCTL_STORAGE_BASE, 0x502, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_EHSTOR_DEVICE_SILO_COMMAND CTL_CODE(IOCTL_STORAGE_BASE, 0x503, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS CTL_CODE(IOCTL_STORAGE_BASE, 0x504, METHOD_BUFFERED, FILE_ANY_ACCESS) - -DEFINE_GUID(GUID_USBSTOR_EHSTOR_SILO_INTERFACE, 0x7c2bcf57, 0x2bea, 0x46da, 0xad, 0x26, 0x78, 0xfd, 0xc8, 0x3c, 0xee, 0x46); -DEFINE_GUID(GUID_USBSTOR_EHSTOR_CONTROL_INTERFACE, 0x4f40006f, 0xb933, 0x4550, 0xb5, 0x32, 0x2b, 0x58, 0xce, 0xe6, 0x14, 0xd3); - - diff --git a/qt-correction-tool/pub/ddk/vcclr.h b/qt-correction-tool/pub/ddk/vcclr.h deleted file mode 100644 index f10e642..0000000 --- a/qt-correction-tool/pub/ddk/vcclr.h +++ /dev/null @@ -1,60 +0,0 @@ -// -// vcclr.h - helper code for using the managed extensions to C++ -// -// Copyright (C) Microsoft Corporation -// All rights reserved. -// - -#if _MSC_VER > 1000 -#pragma once -#endif - -#if !defined(_INC_VCCLR) -#define _INC_VCCLR - -#include - -#pragma warning(push) -#pragma warning(disable:4400) - -#ifdef __cplusplus_cli -typedef cli::interior_ptr __const_Char_ptr; -typedef cli::interior_ptr __const_Byte_ptr; -typedef cli::interior_ptr _Byte_ptr; -typedef const System::String^ __const_String_handle; -#define _NULLPTR nullptr -#else -typedef const System::Char* __const_Char_ptr; -typedef const System::Byte* __const_Byte_ptr; -typedef System::Byte* _Byte_ptr; -typedef const System::String* __const_String_handle; -#define _NULLPTR 0 -#endif - - -// -// get an interior gc pointer to the first character contained in a System::String object -// -inline -__const_Char_ptr -#ifdef __cplusplus_cli -__clrcall -#endif -PtrToStringChars( - __const_String_handle s - ) -{ - _Byte_ptr bp = const_cast<_Byte_ptr>(reinterpret_cast<__const_Byte_ptr>(s)); - if( bp != _NULLPTR ) { - unsigned offset = System::Runtime::CompilerServices::RuntimeHelpers::OffsetToStringData; - bp += offset; - } - return reinterpret_cast<__const_Char_ptr>(bp); -} - -#pragma warning(pop) - -#undef _NULLPTR - -#endif //_INC_VCCLR - diff --git a/qt-correction-tool/pub/ddk/vfwext.h b/qt-correction-tool/pub/ddk/vfwext.h deleted file mode 100644 index 080c926..0000000 --- a/qt-correction-tool/pub/ddk/vfwext.h +++ /dev/null @@ -1,73 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - VfWExt.h - -Abstract: - - Constants and function prototypes needed to create IHV's extension DLL - and constants used to programatically open a target capture device. - - ---*/ - -#include - -#define VFW_HIDE_SETTINGS_PAGE 0x00000001 -#define VFW_HIDE_VIDEOSRC_PAGE 0x00000002 -#define VFW_HIDE_CAMERACONTROL_PAGE 0x00000004 -#define VFW_HIDE_ALL_PAGES (VFW_HIDE_SETTINGS_PAGE |\ - VFW_HIDE_VIDEOSRC_PAGE |\ - VFW_HIDE_CAMERACONTROL_PAGE) -#define VFW_OEM_ADD_PAGE 0x80000000 // If OEM has added any page - - -#define VFW_USE_DEVICE_HANDLE 0x00000001 -#define VFW_USE_STREAM_HANDLE 0x00000002 -#define VFW_QUERY_DEV_CHANGED 0x00000100 // if selected_dev == streaming_dev - - -// -// This is the function pointer that vfwwdm mapper calls to add an page -// -typedef -DWORD (CALLBACK FAR * VFWWDMExtensionProc)( - LPVOID pfnDeviceIoControl, - LPFNADDPROPSHEETPAGE pfnAddPropertyPage, - LPARAM lParam); - -// -// This is the function pointer that you can call to make DeviceIoControl() calls. -// -typedef -BOOL (CALLBACK FAR * LPFNEXTDEVIO)( - LPARAM lParam, - DWORD dwFlags, - DWORD dwIoControlCode, - LPVOID lpInBuffer, - DWORD nInBufferSize, - LPVOID lpOutBuffer, - DWORD nOutBufferSize, - LPDWORD lpBytesReturned, - LPOVERLAPPED lpOverlapped); - - -// -// HLM\System\CurrentControlSet\Control\MediaResources\msvideo\MSVideo.VFWWDM -// -// Registry values used to allow a VfW client application to programatically -// open a target capture device. The first is the FriendlyName of the capture -// device; and the 2nd flag if set, vfwwdm mapper will open only; if failed, -// no attempt will be made by VfWWDM mapper to open other WDM capture device. -// -// Both registry value should be clear after capDriverConnect(). VfWWDM mapper -// will not clear them unless video source dialog box is chosen. -// -#define TARGET_DEVICE_FRIENDLY_NAME "TargetDeviceFriendlyName" // REG_SZ -#define TARGET_DEVICE_OPEN_EXCLUSIVELY "TargetDeviceOpenExclusively" // REG_DWORD - - - diff --git a/qt-correction-tool/pub/ddk/video.h b/qt-correction-tool/pub/ddk/video.h deleted file mode 100644 index 1041d94..0000000 --- a/qt-correction-tool/pub/ddk/video.h +++ /dev/null @@ -1,2783 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - video.h - -Abstract: - - Contains all structure and routine definitions common to the video port - driver and the video miniport drivers. - -Notes: - -Revision History: - ---*/ - -#ifndef __VIDEO_H__ -#define __VIDEO_H__ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define port driver status code. -// The values for these are the Win32 error codes -// - -typedef LONG VP_STATUS; -typedef VP_STATUS *PVP_STATUS; - -// -// Defines for registry information and synchronization. -// - -typedef enum VIDEO_SYNCHRONIZE_PRIORITY { - VpLowPriority, - VpMediumPriority, - VpHighPriority -} VIDEO_SYNCHRONIZE_PRIORITY, *PVIDEO_SYNCHRONIZE_PRIORITY; - -typedef struct _VIDEO_PORT_SPIN_LOCK *PSPIN_LOCK; - -// -// Type of information requested with GetDeviceData -// - -typedef enum _VIDEO_DEVICE_DATA_TYPE { - VpMachineData, - VpCmosData, - VpBusData, - VpControllerData, - VpMonitorData -} VIDEO_DEVICE_DATA_TYPE, *PVIDEO_DEVICE_DATA_TYPE; - -typedef enum _VP_POOL_TYPE { - VpNonPagedPool, - VpPagedPool, - VpNonPagedPoolCacheAligned = 4, - VpPagedPoolCacheAligned -} VP_POOL_TYPE, *PVP_POOL_TYPE; - -// -// Data returned with VpControllerData -// - -typedef struct _VIDEO_HARDWARE_CONFIGURATION_DATA { - INTERFACE_TYPE InterfaceType; - ULONG BusNumber; - USHORT Version; - USHORT Revision; - USHORT Irql; - USHORT Vector; - ULONG ControlBase; - ULONG ControlSize; - ULONG CursorBase; - ULONG CursorSize; - ULONG FrameBase; - ULONG FrameSize; -} VIDEO_HARDWARE_CONFIGURATION_DATA, *PVIDEO_HARDWARE_CONFIGURATION_DATA; - -// -// Define structure used to call the BIOS int 10 function -// - -typedef struct _VIDEO_X86_BIOS_ARGUMENTS { - ULONG Eax; - ULONG Ebx; - ULONG Ecx; - ULONG Edx; - ULONG Esi; - ULONG Edi; - ULONG Ebp; -} VIDEO_X86_BIOS_ARGUMENTS, *PVIDEO_X86_BIOS_ARGUMENTS; - -typedef struct _INT10_BIOS_ARGUMENTS { - ULONG Eax; - ULONG Ebx; - ULONG Ecx; - ULONG Edx; - ULONG Esi; - ULONG Edi; - ULONG Ebp; - USHORT SegDs; - USHORT SegEs; -} INT10_BIOS_ARGUMENTS, *PINT10_BIOS_ARGUMENTS; - -// -// Debugging statements. This will remove all the debug information from the -// "free" version. -// - -#if DBG -#define VideoDebugPrint(arg) VideoPortDebugPrint arg -#else -#define VideoDebugPrint(arg) -#endif - -typedef enum VIDEO_DEBUG_LEVEL { - Error = 0, - Warn, - Trace, - Info -} VIDEO_DEBUG_LEVEL, *PVIDEO_DEBUG_LEVEL; - -// -// Allows us to remove lots of unused code. -// - - -#ifndef _NTOSDEF_ - -//don't pickup ntosp version -#ifdef PAGED_CODE -#undef PAGED_CODE -#endif - -#define ALLOC_PRAGMA 1 -#define VIDEOPORT_API __declspec(dllimport) - -#if DBG -#define PAGED_CODE() \ - if (VideoPortGetCurrentIrql() > 1 /*APC_LEVEL*/) { \ - VideoPortDebugPrint(0, "Video: Pageable code called at IRQL %d\n", VideoPortGetCurrentIrql() ); \ - ASSERT(FALSE); \ - } - -#else -#define PAGED_CODE() -#endif - -ULONG -DriverEntry( - PVOID Context1, - PVOID Context2 - ); - -#else -#define VIDEOPORT_API -#endif - -#ifndef _NTOS_ - -// -// These are the various function prototypes of the routines that are -// provided by the kernel driver to hook out access to io ports. -// - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_UCHAR ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PUCHAR Data - ); - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_UCHAR_STRING ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PUCHAR Data, - ULONG DataLength - ); - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_USHORT ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PUSHORT Data - ); - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_USHORT_STRING ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PUSHORT Data, - ULONG DataLength // number of words - ); - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_ULONG ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PULONG Data - ); - -typedef -VP_STATUS -(*PDRIVER_IO_PORT_ULONG_STRING ) ( - ULONG_PTR Context, - ULONG Port, - UCHAR AccessMode, - PULONG Data, - ULONG DataLength // number of dwords - ); - -#endif // _NTOS_ - - -// -// Definition of the request packet sent from the port driver to the -// miniport driver. It reflects the parameters passed from the -// DeviceIOControl call made by the windows display driver. -// -// N.B. The definition of the STATUS_BLOCK must be the same as the -// the definition of IO_STATUS_BLOCK defined in ntioapi.h. -// - -typedef struct _STATUS_BLOCK { - - // - // Contains the status code of the operation. - // This value in one of the Win32 error codes that are defined for use - // in the video miniport drivers. - // - - union { - VP_STATUS Status; - PVOID Pointer; - }; - - // - // Information returned to the callee. - // The meaning of the information varies from function to function. It - // is generally used to return the minimum size for the input buffer if - // the function takes an input buffer, or the amount of data transfered - // back to the caller if the operation returns output. - // - - ULONG_PTR Information; - -} STATUS_BLOCK, *PSTATUS_BLOCK; - -typedef struct _VIDEO_REQUEST_PACKET { - - // - // The IO control code passed to the DeviceIoControl function by the - // caller. - // - - ULONG IoControlCode; - - // - // Pointer to a status block provided by the caller. This should be - // filled out by the callee with the appropriate information. - // - - PSTATUS_BLOCK StatusBlock; - - // - // Pointer to an input buffer which contains the information passed in - // by the caller. - // - - PVOID InputBuffer; - - // - // Size of the input buffer - // - - ULONG InputBufferLength; - - // - // Pointer to an output buffer into which the data returned to the caller - // should be stored. - // - - PVOID OutputBuffer; - - // - // Length of the output buffer. This buffer can not be grown by the - // callee. - // - - ULONG OutputBufferLength; - -} VIDEO_REQUEST_PACKET, *PVIDEO_REQUEST_PACKET; - -// -// typedef for scattergather array available via GET_VIDEO_SCATTERGATHER(). -// - -typedef struct __VRB_SG { - __int64 PhysicalAddress; - ULONG Length; - } VRB_SG, *PVRB_SG; - -// -// Opaque type for dma handle -// - -typedef struct __DMA_PARAMETERS * PDMA; - -// -// The following macro returns in Address the 32 bit physical address of -// the VirtualAddress lying within the InputBuffer passed into EngDevIo -// - -#define GET_VIDEO_PHYSICAL_ADDRESS(scatterList, VirtualAddress, InputBuffer, pLength, Address) \ - \ - do { \ - ULONG_PTR byteOffset; \ - \ - byteOffset = (PCHAR) VirtualAddress - (PCHAR)InputBuffer; \ - \ - while (byteOffset >= scatterList->Length) { \ - \ - byteOffset -= scatterList->Length; \ - scatterList++; \ - } \ - \ - *pLength = scatterList->Length - byteOffset; \ - \ - Address = (ULONG_PTR) (scatterList->PhysicalAddress + byteOffset); \ - \ - } while (0) - - -#define GET_VIDEO_SCATTERGATHER(ppDma) (**(PVRB_SG **)ppDma) - -// -// Opaque type for PVP_DMA_ADAPTER -// - -typedef struct __VP_DMA_ADAPTER *PVP_DMA_ADAPTER; - -typedef enum _VP_LOCK_OPERATION { - VpReadAccess, - VpWriteAccess, - VpModifyAccess - } VP_LOCK_OPERATION; - -typedef struct _VP_DEVICE_DESCRIPTION { - BOOLEAN ScatterGather; - BOOLEAN Dma32BitAddresses; - BOOLEAN Dma64BitAddresses; - ULONG MaximumLength; -} VP_DEVICE_DESCRIPTION, *PVP_DEVICE_DESCRIPTION; - -typedef struct _VP_SCATTER_GATHER_ELEMENT { - PHYSICAL_ADDRESS Address; - ULONG Length; - ULONG_PTR Reserved; - } VP_SCATTER_GATHER_ELEMENT, *PVP_SCATTER_GATHER_ELEMENT; - -#pragma warning(disable:4200) -typedef struct _VP_SCATTER_GATHER_LIST { - ULONG NumberOfElements; - ULONG_PTR Reserved; - VP_SCATTER_GATHER_ELEMENT Elements[]; - } VP_SCATTER_GATHER_LIST, *PVP_SCATTER_GATHER_LIST; -#pragma warning(default:4200) - -#define VIDEO_RANGE_PASSIVE_DECODE 0x1 -#define VIDEO_RANGE_10_BIT_DECODE 0x2 - - -// -// The following structure is used to define access ranges. The ranges are -// used to indicate which ports and memory adresses are being used by the -// card. -// - -typedef struct _VIDEO_ACCESS_RANGE { - - // - // Indicates the starting memory address or port number of the range. - // This values should be stored before being transformed by - // VideoPortGetDeviceBase() which returns the logical address that must - // be used by the miniport driver when referencing physical addresses. - // - - PHYSICAL_ADDRESS RangeStart; - - // - // Indicates the length in bytes, or number of ports in the range. This - // value should indicate the range actually decoded by the adapter. For - // example, if the adapter uses 7 registers but responds to eight, the - // RangeLength should be set to 8. - - ULONG RangeLength; - - // - // Indicates if the range is in IO space (TRUE) or in memory space (FALSE). - // - - UCHAR RangeInIoSpace; - - // - // Indicates if the range should be visible by the Windows display driver. - // This is done so that a Windows display driver can access certain - // video ports directly. This will only be allowed if the caller has the - // required privileges (is a trusted subsystem) to access the range. - // - // Synchronization of access to ports or memory in the range must be - // done explicitly by the miniport driver and the user mode process so - // that they both don't try to program the device simultaneously. - // - // Non visible ranges should include video memory, ROM addresses, etc. - // which are not required to program the device for output purposes. - // - // - - UCHAR RangeVisible; - - // - // This field determines if the range can be shared with another device. - // The rule should be applied as follow. - // - // - If the range of memory or IO ports should be "owned" by this driver, - // and that any other driver trying to access this range may cause - // a problem, FALSE should be returned. - // - // - If the range can be shared with another co-operating device driver, - // then the share field should be set to TRUE. - // - // As a guideline, the VGA miniport driver will claim all of its resources - // as shareable so that it can be used as a VGA compatible device with - // any other driver (such as an S3 or XGA. - // - // Super VGA miniport drivers that implement all the VGA functionality - // (declared in the Registry as VGACOMPATIBLE=1) should claim the range - // as non-shareable since they don't want the VGA to run at the same time. - // - // Miniports for cards such as an S3 or XGA that have an XGA on the board - // but do not implement the VGA functionality will run with the VGA - // miniport loaded and should therefore claim all the resources shared - // with the VGA as shareable. - // - // Miniports for cards that work with a pass-through and that can be - // connected to any VGA/SVGA card should not be using any VGA ports or - // memory ranges ! ... but if they do they should not claim those - // resources since they will cause a conflict in the system because the - // SVGA cards will have claimed them as non-shareable ... - // - - UCHAR RangeShareable; - - // - // Indicates that the range is decoded by the hardware, but that the - // driver will never access this port. - // - - UCHAR RangePassive; - -} VIDEO_ACCESS_RANGE, *PVIDEO_ACCESS_RANGE; - - -typedef -PVOID -(*PVIDEO_PORT_GET_PROC_ADDRESS)( - IN PVOID HwDeviceExtension, - IN PUCHAR FunctionName - ); - -// -// This structure contains the specific configuration information about the -// device. The information is initialized by the port driver and it should -// be completed by the miniport driver. -// The information is used to setup the device, as weel as providing -// information to the port driver so it can perform some of the requests on -// behalf of the miniport driver. -// - -typedef struct _VIDEO_PORT_CONFIG_INFO { - - // - // Specifies the length of the PVIDEO_PORT_CONFIG_INFO structure as - // returned by sizeof(). Since this structure may grow in later - // releases, the miniport driver should check that the length of the - // structure is greater than or equal to the length it expects (since - // it is guaranteed that defined fields will not change). - // - // This field is always initialized by the port driver. - // - - ULONG Length; - - // - // Specifies which IO bus is tp be scanned. This field is used as a - // parameter to some VideoPortXXX calls. - // - // This field is always initialized by the port driver. - // - - ULONG SystemIoBusNumber; - - // - // Specifies the type of bus being scanned. This field is equal to the - // value being passed into VideoPortInitialize in the - // VIDEO_HW_INITIALIZATION_DATA structure. - // - // This field is always initialized by the port driver. - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Specifies the bus interrupt request level. This level corresponds to - // the IRQL on ISA and MCA buses. - // This value is only used if the device supports interrupts, which is - // determined by the presence of an interrupt service routine in the - // VIDEO_HW_INITIALIZATION_DATA structure. - // - // The preset default value for this field is zero. Otherwise, it is the - // value found in the device configuration information. - // - - ULONG BusInterruptLevel; - - // - // Specifies the bus vector returned by the adapter. This is used for - // systems which have IO buses that use interrupt vectors. For ISA, MCA - // and EISA buses, this field is unused. - // - // The preset default value for this field is zero. - // - - ULONG BusInterruptVector; - - // - // Specifies whether this adapter uses latched or edge-triggered type - // interrupts. - // - // This field is always initialized by the port driver. - // - - KINTERRUPT_MODE InterruptMode; - - // - // Specifies the number of emulator access entries that the adapter - // uses. It indicates the number of array elements in the following field. - // - // This field can be reinitialized with the number of entries in the - // EmulatorAccessEntries structure if the structure is statically - // defined in the miniport driver. The EmulatorAccessEntries fields - // should also be updated. - // - - ULONG NumEmulatorAccessEntries; - - // - // Supplies a pointer to an array of EMULATOR_ACCESS_ENTRY structures. - // The number of elements in the array is indicated by the - // NumEmulatorAccessEntries field. The driver should fill out each entry - // for the adapter. - // - // The uninitialized value for the structure is NULL. - // EmulatorAccessEntries will be NULL if NumEmulatorAccessEntries is - // zero. - // - // A poiner to an array of emulator access entries can be passed back - // if such a structure is defined statically in the miniport driver. The - // NumEmulatorAccessEntries field should also be updated. - // - - PEMULATOR_ACCESS_ENTRY EmulatorAccessEntries; - - // - // This is a context values that is passed with each call to the - // emulator/validator functions defined in the EmulatorAccessEntries - // defined above. - // This parameter should in general be a pointer to the miniports - // device extension or other such storage location. - // - // This pointer will allow the miniport to save some state temporarily - // to allow for the batching of IO requests. - // - - ULONG_PTR EmulatorAccessEntriesContext; - - // - // Physical address of the video memory that must be mapped into a VDM's - // address space for proper BIOS support - // - - PHYSICAL_ADDRESS VdmPhysicalVideoMemoryAddress; - - // - // Length of the video memory that must be mapped into a VDM's addres - // space for proper BIOS support. - // - - ULONG VdmPhysicalVideoMemoryLength; - - // - // Determines the minimum size required to store the hardware state - // information returned by IOCTL_VIDEO_SAVE_HARDWARE_STATE. - // - // The uninitialized value for this field is zero. - // - // If the field is left to zero, SAVE_HARDWARE_STATE will return an - // ERROR_INVALID_FUNCTION status code. - // - - ULONG HardwareStateSize; - - // - // New for version 3.5 - // - - // - // Optional DMA channel, if required by the device. - // 0 for the Channel and Port indicates DMA is not used by the device. - // - - ULONG DmaChannel; - - // - // Optional DMA channel, if required by the device. - // 0 for the Channel and Port indicates DMA is not used by the device. - // - - ULONG DmaPort; - - // - // Set to 1 if the DMA channel can be shared with another device. - // Set to 0 if the DMA channel must be owned exclusively by the driver. - // - - UCHAR DmaShareable; - - // - // Set to 1 if the interrupt can be shared with another device. - // Set to 0 if the interrupt must be owned exclusively by the driver. - // - - UCHAR InterruptShareable; - - // - // Start new dma stuff - // - - // - // Set to TRUE if the DMA device is a busmaster, FALSE otherwise. - // - - BOOLEAN Master; - - // - // Set to number of bits wide. Consistent with DEVICE_DESCRIPTION. - // See ntioapi.h - // - - DMA_WIDTH DmaWidth; - - // - // Set to speed so miniport can set DEVICE_DESCRIPTION field. - // See ntioapi.h - // - - DMA_SPEED DmaSpeed; - - // - // Set to TRUE if the DMA device requires mapped buffers. Also - // a DEVICE_DESCRIPTION field. - // - - BOOLEAN bMapBuffers; - - // - // Set to TRUE if the DMA device requires physical addresses. - // - - BOOLEAN NeedPhysicalAddresses; - - // - // Set to TRUE if the DMA device supports demand mode, FALSE otherwise. - // Also DEVICE_DESCRIPTION support. - // - - BOOLEAN DemandMode; - - // - // Set to max transfer length the DMA device supports. - // - - ULONG MaximumTransferLength; - - // - // Set to max number of Physical breaks the DMA device supports. - // - - ULONG NumberOfPhysicalBreaks; - - // - // Set to TRUE if the DMA device supports scatter gather, FALSE otherwise. - // - - BOOLEAN ScatterGather; - - // - // Maximal Length in PVRB_SG returned measured in bytes. If the device - // has no maximum size, zero should be entered. - // - - ULONG MaximumScatterGatherChunkSize; - - // - // Allow for 4.0/5.0 compatibilty - // - - PVIDEO_PORT_GET_PROC_ADDRESS VideoPortGetProcAddress; - - // - // Provide a pointer to the device's registry path - // - - PWSTR DriverRegistryPath; - - // - // Indicates to a driver the amount of physical memory in the system - // - - ULONGLONG SystemMemorySize; - -} VIDEO_PORT_CONFIG_INFO, *PVIDEO_PORT_CONFIG_INFO; - -#define SIZE_OF_NT4_VIDEO_PORT_CONFIG_INFO FIELD_OFFSET(VIDEO_PORT_CONFIG_INFO, Master) -#define SIZE_OF_WXP_VIDEO_PORT_CONFIG_INFO sizeof(VIDEO_PORT_CONFIG_INFO) - -// -// Video Adapter Dependent Routines. -// - -typedef -VP_STATUS -(*PVIDEO_HW_FIND_ADAPTER) ( - PVOID HwDeviceExtension, - PVOID HwContext, - PWSTR ArgumentString, - PVIDEO_PORT_CONFIG_INFO ConfigInfo, - PUCHAR Again - ); - -typedef -BOOLEAN -(*PVIDEO_HW_INITIALIZE) ( - PVOID HwDeviceExtension - ); - -typedef -BOOLEAN -(*PVIDEO_HW_INTERRUPT) ( - PVOID HwDeviceExtension - ); - -typedef -VOID -(*PVIDEO_HW_LEGACYRESOURCES) ( - IN ULONG VendorId, - IN ULONG DeviceId, - IN OUT PVIDEO_ACCESS_RANGE *LegacyResourceList, - IN OUT PULONG LegacyResourceCount - ); - -// -// type to be returned by HwStartDma(). -// - -typedef enum _HW_DMA_RETURN { - DmaAsyncReturn, - DmaSyncReturn - } HW_DMA_RETURN, *PHW_DMA_RETURN; - - -typedef -HW_DMA_RETURN -(*PVIDEO_HW_START_DMA) ( - PVOID HwDeviceExtension, - PDMA pDma - ); - -typedef -VOID -(*PEXECUTE_DMA)( - PVOID HwDeviceExtension, - PVP_DMA_ADAPTER VpDmaAdapter, - PVP_SCATTER_GATHER_LIST SGList, - PVOID Context - ); - - -// -// Flags to be passed into VideoPortLockPages() or VideoPortDoDma(). -// - -// -// The flag VideoPortUnlockAfterDma tells the video port to unlock the pages -// after the miniport signals that the dma is complete via the -// pDmaCompletionEvent in HwStartDma. Failure to set this event at -// dma completion may cause the memory to be unlocked at randon times. -// This flag is best used when one wants to do one dma transfer which -// occurs infrequently. It allows locking, dmaing and unlocking to be performed -// in the context of 1 IOCTL. -// - -// -// The flag VideoPortKeepPagesLocked tells the video port to leave the pages -// locked if possible. -// - -// -// The flag VideoPortDmaInitOnly tells the Video Port to lock the pages, but don't -// call HwStartDma. Not applicable to VideoPortDoDma(). -// - - -typedef enum { - VideoPortUnlockAfterDma = 1, - VideoPortKeepPagesLocked, - VideoPortDmaInitOnly - } DMA_FLAGS; - -// -// Event flags -// - -typedef ULONG DMA_EVENT_FLAGS; - -#define SET_USER_EVENT 0x01 -#define SET_DISPLAY_EVENT 0x02 - -#define EVENT_TYPE_MASK 1 -#define SYNCHRONIZATION_EVENT 0 -#define NOTIFICATION_EVENT 1 - -#define INITIAL_EVENT_STATE_MASK 2 -#define INITIAL_EVENT_NOT_SIGNALED 0 -#define INITIAL_EVENT_SIGNALED 2 - -// -// Child Enumeration structure passed in to the PVIDEO_HW_GET_CHILD_DESCRIPTOR -// function. -// -// All these parameters are input parameters and must not be modified by the -// callee -// -// Size - Size of the structure. It can be used by the calle for versioning. -// -// ChildDescriptorSize - Size of the pChildDescriptor buffer passed in as the -// third parameter to PVIDEO_HW_GET_CHILD_DESCRIPTOR. -// -// ChildIndex - Index of the device to be enumerated. This field should be -// used to enumerate devices not enumerated by ACPI or other operating -// system components. If this field is set to 0 it indicates the ACPIHwId -// field. -// -// ACPIHwId - ID returned by the ACPI BIOS that represent the device being -// queried. The ACPIHwId returned by the firmware must match the HwIds -// returned by the driver. The System BIOS manufacturer and the graphics -// IHV must synchronize these IDs. -// -// ChildHwDeviceExtension - Pointer to a device extension specific to this -// child device. This field will only be filled in if the miniport driver -// filled the ChildHwDeviceExtensionSize to be non-NULL. -// - -typedef struct _VIDEO_CHILD_ENUM_INFO { - ULONG Size; - ULONG ChildDescriptorSize; - ULONG ChildIndex; - ULONG ACPIHwId; - PVOID ChildHwDeviceExtension; -} VIDEO_CHILD_ENUM_INFO, *PVIDEO_CHILD_ENUM_INFO; - -// -// VIDEO_CHILD_TYPE enum: -// -// 'Monitor' identifies a device which may have a DDC2 compliant EDID data -// structure. If the video miniport detects such a device, it is to extract -// the edid from the monitor and put that in the paged buffer provided by -// videoprt.sys in the callback to PVIDEO_HW_GET_CHILD_DESCRIPTOR and return -// this type in the the OUT PVIDEO_CHILD_TYPE parameter of that call. This -// EDID, if available, will be written to the registry. If the EDID is not -// available, nothing should be put in the buffer. -// -// 'NonPrimaryChip' identifies another VGA chip on the video board which -// is not the primary VGA chip. This type is to be used if and only if the -// miniport detects more than one VGA chip on the board. Such an identifier -// will cause the videoprt to create another DEVICE_EXTENSION and associated -// HW_DEVICE_EXTENSION to be associated with the chip so identified. -// -// 'Other' identifies some other video device attached to the video card. If -// the miniport detects such a device, it is to put a wide char string -// (WSTR) into the paged buffer provided by the videoprt.sys which is the -// PNP hardware identifier of the device. This string will be used to create -// a value of that name in the registry. -// - -typedef enum { - Monitor = 1, - NonPrimaryChip, - VideoChip, - Other -} VIDEO_CHILD_TYPE, *PVIDEO_CHILD_TYPE; - -// -// define a constant that represents the display adapter self query. -// - -#define DISPLAY_ADAPTER_HW_ID 0xFFFFFFFF - -// -// Define invalid child device id (needed for failure return value). -// - -#define VIDEO_INVALID_CHILD_ID 0xFFFFFFFF - -typedef struct _VIDEO_CHILD_STATE { - ULONG Id; - ULONG State; -} VIDEO_CHILD_STATE, *PVIDEO_CHILD_STATE; - -typedef struct _VIDEO_CHILD_STATE_CONFIGURATION { - ULONG Count; - VIDEO_CHILD_STATE ChildStateArray[ANYSIZE_ARRAY]; -} VIDEO_CHILD_STATE_CONFIGURATION, *PVIDEO_CHILD_STATE_CONFIGURATION; - -// -// The following routine should return TRUE if successful. It should: -// 1) put the type of the child device in VideoChildType. -// 2) put the information from the device in Buffer. This -// buffer is of size 256 bytes. If the type returned in -// PVideoChildType is Monitor, this buffer must contain the -// EDID of the monitor if readable. If the type returned in -// PVideoChildType is Other, a wide character string representing -// the PNP Device Id must be put in the buffer. This string will -// be used to create a key for the device if the buffer contains -// an EDID. Otherwise, it is used to obtain a PNP ID for the -// device. -// 3) Put a miniport determined HANDLE in HwId. This value will be -// passed back to the miniport for Power management operations, -// as well as other operations. This allows the miniport to define -// the contract between the system and the miniport which defines a -// particular device. -// -// It should only return FALSE if there are no devices attached to that -// display adapter connector. -// - -typedef -VP_STATUS -(*PVIDEO_HW_GET_CHILD_DESCRIPTOR) ( - IN PVOID HwDeviceExtension, - IN PVIDEO_CHILD_ENUM_INFO ChildEnumInfo, - OUT PVIDEO_CHILD_TYPE VideoChildType, - OUT PUCHAR pChildDescriptor, - OUT PULONG UId, - OUT PULONG pUnused - ); - - -// -// This routine is used to set the power on the graphics devices. -// These include all the Children enumerated by GET_CHILD_DESCRIPTOR callback -// as well as the graphics adapter itself. -// -// The HwDevice extension represent the adapter instance of the device. -// -// The HwId parameter is the unique ID as returned by the enumeration routine. -// The miniport will only be called to set the power on the devices it -// enumerated, as well as the graphics adapter itself. A HwId of 0xFFFFFFFF -// will be passed in to identify the graphics adapter itself. -// The miniport driver should never turn off the power to the graphics adapter -// unless specifically request to. -// -// The VideoPowerControl is the level to which the device shold be set. -// The videoport driver will manage these states. -// - -typedef -VP_STATUS -(*PVIDEO_HW_POWER_SET) ( - PVOID HwDeviceExtension, - ULONG HwId, - PVIDEO_POWER_MANAGEMENT VideoPowerControl - ); - -// -// This routine simply returns whether or not the device can support the -// requested state. -// -// See HW_POWER_SET for a description of the parameters. -// - -typedef -VP_STATUS -(*PVIDEO_HW_POWER_GET) ( - PVOID HwDeviceExtension, - ULONG HwId, - PVIDEO_POWER_MANAGEMENT VideoPowerControl - ); - -// -// This structure should match the QueryInterface struct defined -// in io.h. -// - -typedef struct _QUERY_INTERFACE { - CONST GUID *InterfaceType; - USHORT Size; - USHORT Version; - PINTERFACE Interface; - PVOID InterfaceSpecificData; -} QUERY_INTERFACE, *PQUERY_INTERFACE; - -typedef -VP_STATUS -(*PVIDEO_HW_QUERY_INTERFACE) ( - PVOID HwDeviceExtension, - PQUERY_INTERFACE QueryInterface - ); - -typedef -VP_STATUS -(*PVIDEO_HW_CHILD_CALLBACK) ( - PVOID HwDeviceExtension, - PVOID ChildDeviceExtension - ); - -// -// Entry point for all IOCTL calls made to the miniport driver. -// - -typedef -BOOLEAN -(*PVIDEO_HW_START_IO) ( - PVOID HwDeviceExtension, - PVIDEO_REQUEST_PACKET RequestPacket - ); - -// -// The return value determines if the mode was completely programmed (TRUE) -// or if an int10 should be done by the HAL to complete the modeset (FALSE). -// - -typedef -BOOLEAN -(*PVIDEO_HW_RESET_HW) ( - PVOID HwDeviceExtension, - ULONG Columns, - ULONG Rows - ); - -// -// Timer routine called every second. -// - -typedef -VOID -(*PVIDEO_HW_TIMER) ( - PVOID HwDeviceExtension - ); - -// -// Structure passed by the miniport entry point to the video port -// initialization routine. -// - -typedef struct _VIDEO_HW_INITIALIZATION_DATA { - - // - // Supplies the size of the structure in bytes as determined by sizeof(). - // - - ULONG HwInitDataSize; - - // - // Indicates the bus type the adapter works with, such as Eisa, Isa, MCA. - // - - INTERFACE_TYPE AdapterInterfaceType; - - // - // Supplies a pointer to the miniport driver's find adapter routine. - // - - PVIDEO_HW_FIND_ADAPTER HwFindAdapter; - - // - // Supplies a pointer to the miniport driver's initialization routine. - // - - PVIDEO_HW_INITIALIZE HwInitialize; - - // - // Supplies a pointer to the miniport driver's interrupt service routine. - // - - PVIDEO_HW_INTERRUPT HwInterrupt; - - // - // Supplies a pointer to the miniport driver's start io routine. - // - - PVIDEO_HW_START_IO HwStartIO; - - // - // Supplies the size in bytes required for the miniport driver's private - // device extension. This storage is used by the miniport driver to hold - // per-adapter information. A pointer to this storage is provided with - // every call made to the miniport driver. This data storage is - // initialized to zero by the port driver. - // - - ULONG HwDeviceExtensionSize; - - // - // Supplies the number with which device numbering should be started. - // The device numbering is used to determine which \DeviceX entry under - // the \Parameters section in the registry should be used for parameters - // to the miniport driver. - // The number is *automatically* incremented when the miniport is called - // back in it's FindAdapter routine due to an appropriate _Again_ - // parameter. - // - - ULONG StartingDeviceNumber; - - - // - // New for version 3.5 - // - - // - // Supplies a pointer to the miniport driver's HwResetHw routine. - // - // This function is called when the machine needs to bugchecks (go back - // to the blue screen). - // - // This function should reset the video adapter to a character mode, - // or at least to a state from which an int 10 can reset the card to - // a character mode. - // - // This routine CAN NOT call int10. - // It can only call Read\Write Port\Register functions from the port driver. - // - // The function must also be completely in non-paged pool since the IO\MM - // subsystems may have crashed. - // - - PVIDEO_HW_RESET_HW HwResetHw; - - // - // Pointer to a timer routine to be called every second. - // - - PVIDEO_HW_TIMER HwTimer; - - // - // Start of 5.0 stuff. - // - - // - // Supplies a pointer to the miniport driver's start dma routine. This routine must - // return a HW_DMA_RETURN consistent with it's return behavior. - // - - PVIDEO_HW_START_DMA HwStartDma; - - // - // HW dependent Power management routines. - // - - PVIDEO_HW_POWER_SET HwSetPowerState; - PVIDEO_HW_POWER_GET HwGetPowerState; - - // - // Supplies a pointer to a miniport driver routine which can be called to - // enumerate devices physically attached to the graphics adapter. - // - - PVIDEO_HW_GET_CHILD_DESCRIPTOR HwGetVideoChildDescriptor; - - // - // Supplies a pointer to a miniport driver routine which can be called to - // query external programming interfaces supported in the miniport - // driver. - // - - PVIDEO_HW_QUERY_INTERFACE HwQueryInterface; - - // - // Obselete. Don't set it. - // - - ULONG HwChildDeviceExtensionSize; - - // - // Allows the device to report legacy resources that should be - // associated with the Plug and Play device. - // - - PVIDEO_ACCESS_RANGE HwLegacyResourceList; - - // - // Number of elements in the legacy resource list. - // - - ULONG HwLegacyResourceCount; - - // - // Call this routine to allow a driver to specify it's - // legacy resources based on its device/vendor id. - // - - PVIDEO_HW_LEGACYRESOURCES HwGetLegacyResources; - - // - // Can HwGetVideoChildDescriptor be called before HwInitialize? - // - - BOOLEAN AllowEarlyEnumeration; - - // - // Start of 5.1 stuff. - // - - ULONG Reserved; - -} VIDEO_HW_INITIALIZATION_DATA, *PVIDEO_HW_INITIALIZATION_DATA; - -#define SIZE_OF_NT4_VIDEO_HW_INITIALIZATION_DATA FIELD_OFFSET(VIDEO_HW_INITIALIZATION_DATA, HwStartDma) -#define SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA FIELD_OFFSET(VIDEO_HW_INITIALIZATION_DATA, Reserved) -#define SIZE_OF_WXP_VIDEO_HW_INITIALIZATION_DATA (SIZE_OF_W2K_VIDEO_HW_INITIALIZATION_DATA + sizeof(ULONG)) - -// -// DDC help routines. -// - -typedef -VOID -(*PVIDEO_WRITE_CLOCK_LINE)( - PVOID HwDeviceExtension, - UCHAR Data - ); - -typedef -VOID -(*PVIDEO_WRITE_DATA_LINE)( - PVOID HwDeviceExtension, - UCHAR Data - ); - -typedef -BOOLEAN -(*PVIDEO_READ_CLOCK_LINE)( - PVOID HwDeviceExtension - ); - -typedef -BOOLEAN -(*PVIDEO_READ_DATA_LINE)( - PVOID HwDeviceExtension - ); - -typedef -VOID -(*PVIDEO_WAIT_VSYNC_ACTIVE)( - PVOID HwDeviceExtension - ); - -// -// Data structures used I2C and DDC helper functions. -// - -typedef struct _I2C_FNC_TABLE -{ - IN ULONG Size; - IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine; - IN PVIDEO_WRITE_DATA_LINE WriteDataLine; - IN PVIDEO_READ_CLOCK_LINE ReadClockLine; - IN PVIDEO_READ_DATA_LINE ReadDataLine; - IN PVIDEO_WAIT_VSYNC_ACTIVE WaitVsync; - PVOID Reserved; -} I2C_FNC_TABLE, *PI2C_FNC_TABLE; - -typedef struct _I2C_CALLBACKS -{ - IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine; - IN PVIDEO_WRITE_DATA_LINE WriteDataLine; - IN PVIDEO_READ_CLOCK_LINE ReadClockLine; - IN PVIDEO_READ_DATA_LINE ReadDataLine; -} I2C_CALLBACKS, *PI2C_CALLBACKS; - -typedef struct _DDC_CONTROL -{ - IN ULONG Size; - IN I2C_CALLBACKS I2CCallbacks; - IN UCHAR EdidSegment; -} DDC_CONTROL, *PDDC_CONTROL; - -typedef struct _VIDEO_I2C_CONTROL -{ - IN PVIDEO_WRITE_CLOCK_LINE WriteClockLine; - IN PVIDEO_WRITE_DATA_LINE WriteDataLine; - IN PVIDEO_READ_CLOCK_LINE ReadClockLine; - IN PVIDEO_READ_DATA_LINE ReadDataLine; - IN ULONG I2CDelay; // 100ns units -} VIDEO_I2C_CONTROL, *PVIDEO_I2C_CONTROL; - -// -// Types of services exported by the VideoPortQueryServices(). -// - -typedef enum -{ - VideoPortServicesAGP = 1, - VideoPortServicesI2C, - VideoPortServicesHeadless, - VideoPortServicesInt10, - VideoPortServicesDebugReport, - VideoPortServicesWCMemoryProtection -} VIDEO_PORT_SERVICES; - -// -// AGP services interface. -// - -#define VIDEO_PORT_AGP_INTERFACE_VERSION_1 1 - -typedef struct _VIDEO_PORT_AGP_INTERFACE -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PAGP_RESERVE_PHYSICAL AgpReservePhysical; - OUT PAGP_RELEASE_PHYSICAL AgpReleasePhysical; - OUT PAGP_COMMIT_PHYSICAL AgpCommitPhysical; - OUT PAGP_FREE_PHYSICAL AgpFreePhysical; - OUT PAGP_RESERVE_VIRTUAL AgpReserveVirtual; - OUT PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; - OUT PAGP_COMMIT_VIRTUAL AgpCommitVirtual; - OUT PAGP_FREE_VIRTUAL AgpFreeVirtual; - OUT ULONGLONG AgpAllocationLimit; -} VIDEO_PORT_AGP_INTERFACE, *PVIDEO_PORT_AGP_INTERFACE; - -#define VIDEO_PORT_AGP_INTERFACE_VERSION_2 2 - -typedef struct _VIDEO_PORT_AGP_INTERFACE_2 -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PAGP_RESERVE_PHYSICAL AgpReservePhysical; - OUT PAGP_RELEASE_PHYSICAL AgpReleasePhysical; - OUT PAGP_COMMIT_PHYSICAL AgpCommitPhysical; - OUT PAGP_FREE_PHYSICAL AgpFreePhysical; - OUT PAGP_RESERVE_VIRTUAL AgpReserveVirtual; - OUT PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; - OUT PAGP_COMMIT_VIRTUAL AgpCommitVirtual; - OUT PAGP_FREE_VIRTUAL AgpFreeVirtual; - OUT ULONGLONG AgpAllocationLimit; - OUT PAGP_SET_RATE AgpSetRate; -} VIDEO_PORT_AGP_INTERFACE_2, *PVIDEO_PORT_AGP_INTERFACE_2; - -// -// I2C helper routines exported via VideoPortQueryServices(). -// - -typedef -BOOLEAN -(*PI2C_START)( - IN PVOID HwDeviceExtension, - IN PI2C_CALLBACKS I2CCallbacks - ); - -typedef -BOOLEAN -(*PI2C_STOP)( - IN PVOID HwDeviceExtension, - IN PI2C_CALLBACKS I2CCallbacks - ); - -typedef -BOOLEAN -(*PI2C_WRITE)( - IN PVOID HwDeviceExtension, - IN PI2C_CALLBACKS I2CCallbacks, - IN PUCHAR Buffer, - IN ULONG Length - ); - -typedef -BOOLEAN -(*PI2C_READ)( - IN PVOID HwDeviceExtension, - IN PI2C_CALLBACKS I2CCallbacks, - OUT PUCHAR Buffer, - IN ULONG Length - ); - -// -// I2C services interface. -// - -#define VIDEO_PORT_I2C_INTERFACE_VERSION_1 1 - -typedef struct _VIDEO_PORT_I2C_INTERFACE -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PI2C_START I2CStart; - OUT PI2C_STOP I2CStop; - OUT PI2C_WRITE I2CWrite; - OUT PI2C_READ I2CRead; -} VIDEO_PORT_I2C_INTERFACE, *PVIDEO_PORT_I2C_INTERFACE; - -// -// I2C helper routines exported via VideoPortQueryServices() -// for I2C interface version 2. -// - -typedef -BOOLEAN -(*PI2C_START_2)( - IN PVOID HwDeviceExtension, - IN PVIDEO_I2C_CONTROL I2CControl - ); - -typedef -BOOLEAN -(*PI2C_STOP_2)( - IN PVOID HwDeviceExtension, - IN PVIDEO_I2C_CONTROL I2CControl - ); - -typedef -BOOLEAN -(*PI2C_WRITE_2)( - IN PVOID HwDeviceExtension, - IN PVIDEO_I2C_CONTROL I2CControl, - IN PUCHAR Buffer, - IN ULONG Length - ); - -typedef -BOOLEAN -(*PI2C_READ_2)( - IN PVOID HwDeviceExtension, - IN PVIDEO_I2C_CONTROL I2CControl, - OUT PUCHAR Buffer, - IN ULONG Length, - IN BOOLEAN EndOfRead - ); - -// -// I2C services interface version 2. -// - -#define VIDEO_PORT_I2C_INTERFACE_VERSION_2 2 - -typedef struct _VIDEO_PORT_I2C_INTERFACE_2 -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PI2C_START_2 I2CStart; - OUT PI2C_STOP_2 I2CStop; - OUT PI2C_WRITE_2 I2CWrite; - OUT PI2C_READ_2 I2CRead; -} VIDEO_PORT_I2C_INTERFACE_2, *PVIDEO_PORT_I2C_INTERFACE_2; - -typedef -VP_STATUS -(*PINT10_ALLOCATE_BUFFER)( - IN PVOID Context, - OUT PUSHORT Seg, - OUT PUSHORT Off, - IN OUT PULONG Length - ); - -typedef -VP_STATUS -(*PINT10_FREE_BUFFER)( - IN PVOID Context, - IN USHORT Seg, - IN USHORT Off - ); - -typedef -VP_STATUS -(*PINT10_READ_MEMORY)( - IN PVOID Context, - IN USHORT Seg, - IN USHORT Off, - OUT PVOID Buffer, - IN ULONG Length - ); - -typedef -VP_STATUS -(*PINT10_WRITE_MEMORY)( - IN PVOID Context, - IN USHORT Seg, - IN USHORT Off, - IN PVOID Buffer, - IN ULONG Length - ); - -typedef -VP_STATUS -(*PINT10_CALL_BIOS)( - PVOID Context, - PINT10_BIOS_ARGUMENTS BiosArguments - ); - -#define VIDEO_PORT_INT10_INTERFACE_VERSION_1 1 - -typedef struct _VIDEO_PORT_INT10_INTERFACE -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PINT10_ALLOCATE_BUFFER Int10AllocateBuffer; - OUT PINT10_FREE_BUFFER Int10FreeBuffer; - OUT PINT10_READ_MEMORY Int10ReadMemory; - OUT PINT10_WRITE_MEMORY Int10WriteMemory; - OUT PINT10_CALL_BIOS Int10CallBios; -} VIDEO_PORT_INT10_INTERFACE, *PVIDEO_PORT_INT10_INTERFACE; - -// -// WCMemoryProtection services interface. -// - -typedef -VP_STATUS -(*PROTECT_WC_MEMORY)( - IN PVOID Context, - IN PVOID HwDeviceExtension - ); - -typedef -VP_STATUS -(*RESTORE_WC_MEMORY)( - IN PVOID Context, - IN PVOID HwDeviceExtension - ); - -#define VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE_VERSION_1 1 - -typedef struct _VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - OUT PROTECT_WC_MEMORY VideoPortProtectWCMemory; - OUT RESTORE_WC_MEMORY VideoPortRestoreWCMemory; -} VIDEO_PORT_WCMEMORYPROTECTION_INTERFACE, *PVIDEO_PORT_WCMEMORYPROTECTION_INTERFACE; - - -typedef struct _VPOSVERSIONINFO -{ - IN ULONG Size; - OUT ULONG MajorVersion; - OUT ULONG MinorVersion; - OUT ULONG BuildNumber; - OUT USHORT ServicePackMajor; - OUT USHORT ServicePackMinor; -} VPOSVERSIONINFO, *PVPOSVERSIONINFO; - -// -// Flags that can be passed to VideoPortGetDeviceBase or VideoPortMapMemory. -// - -#define VIDEO_MEMORY_SPACE_MEMORY 0x00 // Should not be set by display driver -#define VIDEO_MEMORY_SPACE_IO 0x01 // Should not be set by display driver -#define VIDEO_MEMORY_SPACE_USER_MODE 0x02 // Memory pointer for application use -#define VIDEO_MEMORY_SPACE_DENSE 0x04 // Mapped dense, linearly (ALPHA) -#define VIDEO_MEMORY_SPACE_P6CACHE 0x08 // P6 MTRR caching (kernel and user) - -// -// Define status codes returned by HwGetVideoChildDescriptor() -// miniport enumaration routine. -// -// Note: For backword compatibility reasons these values match -// existing WINERROR codes. -// - -// -// Call again (ACPI and non-ACPI devices will be enumerated). -// - -#define VIDEO_ENUM_MORE_DEVICES ERROR_CONTINUE - -// -// Stop enumeration. -// - -#define VIDEO_ENUM_NO_MORE_DEVICES ERROR_NO_MORE_DEVICES - -// -// Call again, device could not be enumerated. -// - -#define VIDEO_ENUM_INVALID_DEVICE ERROR_INVALID_NAME - -// -// Define the bits in VgaStatus. -// - -#define DEVICE_VGA_ENABLED 1 - -// -// Port driver routines called by miniport driver and callbacks. -// - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortAllocatePool", "Obsolete") -VIDEOPORT_API -VP_STATUS -VideoPortAllocateBuffer( - IN PVOID HwDeviceExtension, - IN ULONG Size, - OUT PVOID *Buffer - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VOID -VideoPortAcquireDeviceLock( - IN PVOID HwDeviceExtension - ); - -VIDEOPORT_API -ULONG -VideoPortCompareMemory( - PVOID Source1, - PVOID Source2, - SIZE_T Length - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -BOOLEAN -VideoPortDDCMonitorHelper( - IN PVOID HwDeviceExtension, - IN PVOID DDCControl, - IN OUT __inout_bcount(EdidBufferSize) PUCHAR EdidBuffer, - IN ULONG EdidBufferSize - ); - -VIDEOPORT_API -VOID -VideoPortDebugPrint( - VIDEO_DEBUG_LEVEL DebugPrintLevel, - __in PSTR DebugMessage, - ... - ); - -VIDEOPORT_API -VP_STATUS -VideoPortDisableInterrupt( - PVOID HwDeviceExtension - ); - -VIDEOPORT_API -VP_STATUS -VideoPortEnableInterrupt( - PVOID HwDeviceExtension - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortEnumerateChildren( - IN PVOID HwDeviceExtension, - IN __reserved PVOID Reserved - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VOID -VideoPortFreeDeviceBase( - PVOID HwDeviceExtension, - PVOID MappedAddress - ); - -typedef -VP_STATUS -(*PMINIPORT_QUERY_DEVICE_ROUTINE)( - PVOID HwDeviceExtension, - PVOID Context, - VIDEO_DEVICE_DATA_TYPE DeviceDataType, - PVOID Identifier, - ULONG IdentiferLength, - PVOID ConfigurationData, - ULONG ConfigurationDataLength, - PVOID ComponentInformation, - ULONG ComponentInformationLength - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortGetAccessRanges( - PVOID HwDeviceExtension, - ULONG NumRequestedResources, - __in_ecount_opt(NumRequestedResources) PIO_RESOURCE_DESCRIPTOR RequestedResources OPTIONAL, - ULONG NumAccessRanges, - __out_ecount(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges, - PVOID VendorId, - PVOID DeviceId, - PULONG Slot - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -PVOID -VideoPortGetAssociatedDeviceExtension( - IN PVOID DeviceObject - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -ULONG -VideoPortGetBusData( - PVOID HwDeviceExtension, - BUS_DATA_TYPE BusDataType, - ULONG SlotNumber, - __out_bcount(Length) PVOID Buffer, - ULONG Offset, - ULONG Length - ); - -VIDEOPORT_API -UCHAR -VideoPortGetCurrentIrql(); - -VIDEOPORT_API -PVOID -VideoPortGetDeviceBase( - PVOID HwDeviceExtension, - PHYSICAL_ADDRESS IoAddress, - ULONG NumberOfUchars, - UCHAR InIoSpace - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortGetDeviceData( - PVOID HwDeviceExtension, - VIDEO_DEVICE_DATA_TYPE DeviceDataType, - PMINIPORT_QUERY_DEVICE_ROUTINE CallbackRoutine, - PVOID Context - ); - -typedef -VP_STATUS -(*PMINIPORT_GET_REGISTRY_ROUTINE)( - PVOID HwDeviceExtension, - PVOID Context, - PWSTR ValueName, - PVOID ValueData, - ULONG ValueLength - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortGetRegistryParameters( - PVOID HwDeviceExtension, - __in PWSTR ParameterName, - UCHAR IsParameterFileName, - PMINIPORT_GET_REGISTRY_ROUTINE GetRegistryRoutine, - PVOID Context - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -__out_bcount_opt(Length) PVOID -VideoPortGetRomImage( - IN PVOID HwDeviceExtension, - IN __reserved PVOID Unused1, - IN __reserved ULONG Unused2, - IN ULONG Length - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortGetVgaStatus( - PVOID HwDeviceExtension, - OUT PULONG VgaStatus - ); - -VIDEOPORT_API -LONG -FASTCALL -VideoPortInterlockedDecrement( - IN PLONG Addend - ); - -VIDEOPORT_API -LONG -FASTCALL -VideoPortInterlockedIncrement( - IN PLONG Addend - ); - -VIDEOPORT_API -LONG -FASTCALL -VideoPortInterlockedExchange( - IN OUT PLONG Target, - IN LONG Value - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -ULONG -VideoPortInitialize( - PVOID Argument1, - PVOID Argument2, - PVIDEO_HW_INITIALIZATION_DATA HwInitializationData, - PVOID HwContext - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortInt10( - PVOID HwDeviceExtension, - PVIDEO_X86_BIOS_ARGUMENTS BiosArguments - ); - -__drv_maxIRQL(HIGH_LEVEL) -VIDEOPORT_API -VOID -VideoPortLogError( - PVOID HwDeviceExtension, - PVIDEO_REQUEST_PACKET Vrp OPTIONAL, - VP_STATUS ErrorCode, - ULONG UniqueId - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortMapMemory", "Obsolete") -VIDEOPORT_API -VP_STATUS -VideoPortMapBankedMemory( - PVOID HwDeviceExtension, - PHYSICAL_ADDRESS PhysicalAddress, - PULONG Length, - PULONG InIoSpace, - PVOID *VirtualAddress, - ULONG BankLength, - UCHAR ReadWriteBank, - PBANKED_SECTION_ROUTINE BankRoutine, - PVOID Context - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortMapMemory( - PVOID HwDeviceExtension, - PHYSICAL_ADDRESS PhysicalAddress, - PULONG Length, - PULONG InIoSpace, - PVOID *VirtualAddress - ); - -VIDEOPORT_API -VOID -VideoPortMoveMemory( - __inout_bcount(Length) PVOID Destination, - __inout_bcount(Length) PVOID Source, - ULONG Length - ); - -VIDEOPORT_API -LONGLONG -VideoPortQueryPerformanceCounter( - IN PVOID HwDeviceExtension, - OUT PLONGLONG PerformanceFrequency OPTIONAL - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortQueryServices( - IN PVOID HwDeviceExtension, - IN VIDEO_PORT_SERVICES ServicesType, - IN OUT PINTERFACE Interface - ); - -typedef -VOID -(*PMINIPORT_DPC_ROUTINE)( - IN PVOID HwDeviceExtension, - IN PVOID Context - ); - -__drv_maxIRQL(HIGH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -BOOLEAN -VideoPortQueueDpc( - IN PVOID HwDeviceExtension, - IN PMINIPORT_DPC_ROUTINE CallbackRoutine, - IN PVOID Context - ); - -VIDEOPORT_API -UCHAR -VideoPortReadPortUchar( - PUCHAR Port - ); - -VIDEOPORT_API -USHORT -VideoPortReadPortUshort( - PUSHORT Port - ); - -VIDEOPORT_API -ULONG -VideoPortReadPortUlong( - PULONG Port - ); - -VIDEOPORT_API -VOID -VideoPortReadPortBufferUchar( - PUCHAR Port, - __out_ecount(Count) PUCHAR Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortReadPortBufferUshort( - PUSHORT Port, - __out_ecount(Count) PUSHORT Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortReadPortBufferUlong( - PULONG Port, - __out_ecount(Count) PULONG Buffer, - ULONG Count - ); - -VIDEOPORT_API -UCHAR -VideoPortReadRegisterUchar( - PUCHAR Register - ); - -VIDEOPORT_API -USHORT -VideoPortReadRegisterUshort( - PUSHORT Register - ); - -VIDEOPORT_API -ULONG -VideoPortReadRegisterUlong( - PULONG Register - ); - -VIDEOPORT_API -VOID -VideoPortReadRegisterBufferUchar( - PUCHAR Register, - __out_ecount(Count) PUCHAR Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortReadRegisterBufferUshort( - PUSHORT Register, - __out_ecount(Count) PUSHORT Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortReadRegisterBufferUlong( - PULONG Register, - __out_ecount(Count) PULONG Buffer, - ULONG Count - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortFreePool", "Obsolete") -VIDEOPORT_API -VOID -VideoPortReleaseBuffer( - IN PVOID HwDeviceExtension, - IN PVOID Buffer - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VOID -VideoPortReleaseDeviceLock( - IN PVOID HwDeviceExtension - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -BOOLEAN -VideoPortScanRom( - PVOID HwDeviceExtension, - PUCHAR RomBase, - ULONG RomLength, - PUCHAR String - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -ULONG -VideoPortSetBusData( - PVOID HwDeviceExtension, - BUS_DATA_TYPE BusDataType, - ULONG SlotNumber, - __in_bcount(Length) PVOID Buffer, - ULONG Offset, - ULONG Length - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortSetRegistryParameters( - PVOID HwDeviceExtension, - __in PWSTR ValueName, - __in_bcount(ValueLength) PVOID ValueData, - ULONG ValueLength - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortSetTrappedEmulatorPorts( - PVOID HwDeviceExtension, - ULONG NumAccessRanges, - __in_ecount(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRange - ); - -VIDEOPORT_API -VOID -VideoPortStallExecution( - ULONG Microseconds - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortStartTimer( - PVOID HwDeviceExtension - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortStopTimer( - PVOID HwDeviceExtension - ); - -typedef -BOOLEAN -(*PMINIPORT_SYNCHRONIZE_ROUTINE)( - PVOID Context - ); - -__drv_maxIRQL(HIGH_LEVEL) -BOOLEAN -VIDEOPORT_API -VideoPortSynchronizeExecution( - PVOID HwDeviceExtension, - VIDEO_SYNCHRONIZE_PRIORITY Priority, - PMINIPORT_SYNCHRONIZE_ROUTINE SynchronizeRoutine, - PVOID Context - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortUnmapMemory( - PVOID HwDeviceExtension, - PVOID VirtualAddress, - HANDLE ProcessHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortVerifyAccessRanges( - PVOID HwDeviceExtension, - ULONG NumAccessRanges, - __in_ecount_opt(NumAccessRanges) PVIDEO_ACCESS_RANGE AccessRanges - ); - -VIDEOPORT_API -VOID -VideoPortWritePortUchar( - PUCHAR Port, - UCHAR Value - ); - -VIDEOPORT_API -VOID -VideoPortWritePortUshort( - PUSHORT Port, - USHORT Value - ); - -VIDEOPORT_API -VOID -VideoPortWritePortUlong( - PULONG Port, - ULONG Value - ); - -VIDEOPORT_API -VOID -VideoPortWritePortBufferUchar( - PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortWritePortBufferUshort( - PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortWritePortBufferUlong( - PULONG Port, - __in_ecount(Count) PULONG Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterUchar( - PUCHAR Register, - UCHAR Value - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterUshort( - PUSHORT Register, - USHORT Value - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterUlong( - PULONG Register, - ULONG Value - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterBufferUchar( - PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterBufferUshort( - PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortWriteRegisterBufferUlong( - PULONG Register, - __in_ecount(Count) PULONG Buffer, - ULONG Count - ); - -VIDEOPORT_API -VOID -VideoPortZeroDeviceMemory( - PVOID Destination, - ULONG Length - ); - -VIDEOPORT_API -VOID -VideoPortZeroMemory( - __out_bcount(Length) PVOID Destination, - ULONG Length - ); - -// -// DMA support. -// TODO: Move to the separate module -- will be obsolete. -// - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortAllocateCommonBuffer", "Obsolete") -VIDEOPORT_API -PVOID -VideoPortAllocateContiguousMemory( - IN PVOID HwDeviceExtension, - IN ULONG NumberOfBytes, - IN PHYSICAL_ADDRESS HighestAcceptableAddress - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortAllocateCommonBuffer", "Obsolete") -VIDEOPORT_API -PVOID -VideoPortGetCommonBuffer( - IN PVOID HwDeviceExtension, - IN ULONG DesiredLength, - IN ULONG Alignment, - OUT PPHYSICAL_ADDRESS LogicalAddress, - OUT PULONG pActualLength, - IN BOOLEAN CacheEnabled - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortReleaseCommonBuffer", "Obsolete") -VIDEOPORT_API -VOID -VideoPortFreeCommonBuffer( - IN PVOID HwDeviceExtension, - IN ULONG Length, - IN PVOID VirtualAddress, - IN PHYSICAL_ADDRESS LogicalAddress, - IN BOOLEAN CacheEnabled - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -PDMA -VideoPortDoDma( - IN PVOID HwDeviceExtension, - IN PDMA pDma, - IN DMA_FLAGS DmaFlags - ); - -__drv_preferredFunction("VideoPortLockBuffer", "Obsolete") -VIDEOPORT_API -BOOLEAN -VideoPortLockPages( - IN PVOID HwDeviceExtension, - IN OUT PVIDEO_REQUEST_PACKET pVrp, - IN PEVENT pUEvent, - IN PEVENT pDisplayEvent, - IN DMA_FLAGS DmaFlags - ); - -__drv_preferredFunction("VideoPortUnlockBuffer", "Obsolete") -VIDEOPORT_API -BOOLEAN -VideoPortUnlockPages( - PVOID hwDeviceExtension, - PDMA pDma - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -BOOLEAN -VideoPortSignalDmaComplete( - IN PVOID HwDeviceExtension, - IN PDMA pDmaHandle - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -PVOID -VideoPortGetMdl( - IN PVOID HwDeviceExtension, - IN PDMA pDma - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -PVOID -VideoPortGetDmaContext( - IN PVOID HwDeviceExtension, - IN PDMA pDma - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -VOID -VideoPortSetDmaContext( - IN PVOID HwDeviceExtension, - OUT PDMA pDma, - IN PVOID InstanceContext - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -ULONG -VideoPortGetBytesUsed( - IN PVOID HwDeviceExtension, - IN PDMA pDma - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -VOID -VideoPortSetBytesUsed( - IN PVOID HwDeviceExtension, - IN OUT PDMA pDma, - IN ULONG BytesUsed - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -PDMA -VideoPortAssociateEventsWithDmaHandle( - IN PVOID HwDeviceExtension, - IN OUT PVIDEO_REQUEST_PACKET pVrp, - IN PVOID MappedUserEvent, - IN PVOID DisplayDriverEvent - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -PDMA -VideoPortMapDmaMemory( - IN PVOID HwDeviceExtension, - IN PVIDEO_REQUEST_PACKET pVrp, - IN PHYSICAL_ADDRESS BoardAddress, - IN PULONG Length, - IN PULONG InIoSpace, - IN PVOID MappedUserEvent, - IN PVOID DisplayDriverEvent, - IN OUT PVOID * VirtualAddress - ); - -__drv_preferredFunction("(see documentation)", "Obsolete") -VIDEOPORT_API -BOOLEAN -VideoPortUnmapDmaMemory( - PVOID HwDeviceExtension, - PVOID VirtualAddress, - HANDLE ProcessHandle, - PDMA BoardMemoryHandle - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortCreateSecondaryDisplay( - IN PVOID HwDeviceExtension, - IN OUT PVOID *SecondaryDeviceExtension, - IN ULONG ulFlag - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -PVP_DMA_ADAPTER -VideoPortGetDmaAdapter( - IN PVOID HwDeviceExtension, - IN PVP_DEVICE_DESCRIPTION VpDeviceDescription - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VOID -VideoPortPutDmaAdapter( - IN PVOID HwDeviceExtension, - IN PVP_DMA_ADAPTER VpDmaAdapter - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -PVOID -VideoPortAllocateCommonBuffer( - IN PVOID HwDeviceExtension, - IN PVP_DMA_ADAPTER VpDmaAdapter, - IN ULONG DesiredLength, - OUT PPHYSICAL_ADDRESS LogicalAddress, - IN BOOLEAN CacheEnabled, - OUT PVOID Reserved - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VOID -VideoPortReleaseCommonBuffer( - IN PVOID HwDeviceExtension, - IN PVP_DMA_ADAPTER VpDmaAdapter, - IN ULONG Length, - IN PHYSICAL_ADDRESS LogicalAddress, - IN PVOID VirtualAddress, - IN BOOLEAN CacheEnabled - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -PVOID -VideoPortLockBuffer( - IN PVOID HwDeviceExtension, - IN PVOID BaseAddress, - IN ULONG Length, - IN VP_LOCK_OPERATION Operation - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortUnlockBuffer( - IN PVOID HwDeviceExtension, - IN PVOID Mdl - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortStartDma( - IN PVOID HwDeviceExtension, - IN PVP_DMA_ADAPTER VpDmaAdapter, - IN PVOID Mdl, - IN ULONG Offset, - IN OUT PULONG pLength, - IN PEXECUTE_DMA ExecuteDmaRoutine, - IN PVOID Context, - IN BOOLEAN WriteToDevice - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortCompleteDma( - IN PVOID HwDeviceExtension, - IN PVP_DMA_ADAPTER VpDmaAdapter, - IN PVP_SCATTER_GATHER_LIST VpScatterGather, - IN BOOLEAN WriteToDevice - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortCreateEvent( - IN PVOID HwDeviceExtension, - IN ULONG EventFlag, - IN PVOID Unused, - OUT PEVENT *ppEvent - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortDeleteEvent( - IN PVOID HwDeviceExtension, - IN PEVENT pEvent - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -LONG -VideoPortSetEvent( - IN PVOID HwDeviceExtension, - IN PEVENT pEvent - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortClearEvent( - IN PVOID HwDeviceExtension, - IN PEVENT pEvent -); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -LONG -VideoPortReadStateEvent( - IN PVOID HwDeviceExtension, - IN PEVENT pEvent - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortWaitForSingleObject( - IN PVOID HwDeviceExtension, - IN PVOID Object, - IN PLARGE_INTEGER Timeout - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -PVOID -VideoPortAllocatePool( - IN PVOID HwDeviceExtension, - IN VP_POOL_TYPE PoolType, - IN SIZE_T NumberOfBytes, - IN ULONG Tag - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortFreePool( - IN PVOID HwDeviceExtension, - IN PVOID Ptr - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortCreateSpinLock( - IN PVOID HwDeviceExtension, - OUT PSPIN_LOCK *SpinLock - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortDeleteSpinLock( - IN PVOID HwDeviceExtension, - IN PSPIN_LOCK SpinLock - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_setsIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortAcquireSpinLock( - __inout __deref __drv_acquiresExclusiveResource(VideoPortSpinLock) - PVOID HwDeviceExtension, - __in PSPIN_LOCK SpinLock, - __out __deref __drv_savesIRQL PUCHAR OldIrql - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortAcquireSpinLockAtDpcLevel( - __inout __deref __drv_acquiresExclusiveResource(VideoPortSpinLock) - PVOID HwDeviceExtension, - __in PSPIN_LOCK SpinLock - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortReleaseSpinLock( - __in PVOID HwDeviceExtension, - __inout __deref __drv_releasesExclusiveResource(VideoPortSpinLock) - PSPIN_LOCK SpinLock, - __in __drv_restoresIRQL UCHAR NewIrql - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -VIDEOPORT_API -VOID -VideoPortReleaseSpinLockFromDpcLevel( - __in PVOID HwDeviceExtension, - __inout __deref __drv_releasesExclusiveResource(VideoPortSpinLock) - PSPIN_LOCK SpinLock - ); - -VIDEOPORT_API -VOID -VideoPortQuerySystemTime( - OUT PLARGE_INTEGER CurrentTime - ); - -#define CDE_USE_SUBSYSTEM_IDS 0x00000001 -#define CDE_USE_REVISION 0x00000002 - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -BOOLEAN -VideoPortCheckForDeviceExistence( - IN PVOID HwDeviceExtension, - IN USHORT VendorId, - IN USHORT DeviceId, - IN UCHAR RevisionId, - IN USHORT SubVendorId, - IN USHORT SubSystemId, - IN ULONG Flags - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -ULONG -VideoPortGetAssociatedDeviceID( - IN PVOID DeviceObject - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortFlushRegistry( - PVOID HwDeviceExtension - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortGetVersion( - IN PVOID HwDeviceExtension, - IN OUT PVPOSVERSIONINFO pVpOsVersionInfo - ); - -VIDEOPORT_API -BOOLEAN -VideoPortIsNoVesa( - VOID - ); - -// -// TODO: End of move block. -// - -// -// Support for bugcheck reason callbacks -// - -#define BUGCHECK_DATA_SIZE_RESERVED 48 - -typedef -VOID -(*PVIDEO_BUGCHECK_CALLBACK) ( - IN PVOID HwDeviceExtension, - IN ULONG BugcheckCode, - IN PUCHAR Buffer, - IN ULONG BufferSize - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -VIDEOPORT_API -VP_STATUS -VideoPortRegisterBugcheckCallback( - IN PVOID HwDeviceExtension, - IN ULONG BugcheckCode, - IN PVIDEO_BUGCHECK_CALLBACK Callback, - IN ULONG BugcheckDataSize - ); - -// -// Video Debug Report API provides ability for IHV to report non fatal -// failures via Microsoft OCA servers -// - -#define VIDEO_DEBUG_REPORT_MAX_SIZE 0x8000 - -typedef struct _VIDEO_DEBUG_REPORT *PVIDEO_DEBUG_REPORT; - -VIDEOPORT_API -PVIDEO_DEBUG_REPORT -VideoPortDbgReportCreate( - IN PVOID HwDeviceExtension, - IN ULONG ulCode, - IN ULONG_PTR ulpArg1, - IN ULONG_PTR ulpArg2, - IN ULONG_PTR ulpArg3, - IN ULONG_PTR ulpArg4 - ); - -VIDEOPORT_API -BOOLEAN -VideoPortDbgReportSecondaryData( - IN OUT PVIDEO_DEBUG_REPORT pReport, - IN __in_bcount(ulDataSize) PVOID pvData, - IN ULONG ulDataSize - ); - -VIDEOPORT_API -VOID -VideoPortDbgReportComplete( - IN OUT PVIDEO_DEBUG_REPORT pReport - ); - -// -// Debug Report API interface -// - -#define VIDEO_PORT_DEBUG_REPORT_INTERFACE_VERSION_1 1 - -typedef struct _VIDEO_PORT_DEBUG_REPORT_INTERFACE -{ - IN USHORT Size; - IN USHORT Version; - OUT PVOID Context; - OUT PINTERFACE_REFERENCE InterfaceReference; - OUT PINTERFACE_DEREFERENCE InterfaceDereference; - - OUT - PVIDEO_DEBUG_REPORT - (*DbgReportCreate)( - IN PVOID HwDeviceExtension, - IN ULONG ulCode, - IN ULONG_PTR ulpArg1, - IN ULONG_PTR ulpArg2, - IN ULONG_PTR ulpArg3, - IN ULONG_PTR ulpArg4 - ); - - OUT - BOOLEAN - (*DbgReportSecondaryData)( - IN OUT PVIDEO_DEBUG_REPORT pReport, - IN PVOID pvData, - IN ULONG ulDataSize - ); - - OUT - VOID - (*DbgReportComplete)( - IN OUT PVIDEO_DEBUG_REPORT pReport - ); -} VIDEO_PORT_DEBUG_REPORT_INTERFACE, *PVIDEO_PORT_DEBUG_REPORT_INTERFACE; - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // ifndef __VIDEO_H__ - diff --git a/qt-correction-tool/pub/ddk/videoagp.h b/qt-correction-tool/pub/ddk/videoagp.h deleted file mode 100644 index 1070fd5..0000000 --- a/qt-correction-tool/pub/ddk/videoagp.h +++ /dev/null @@ -1,133 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - videoagp.h - -Abstract: - Video miniport AGP support. - -Notes: - -Revision History: - ---*/ - -#ifndef __VIDEOAGP_H__ -#define __VIDEOAGP_H__ - -#define VIDEO_AGP_RATE_1X 1 -#define VIDEO_AGP_RATE_2X 2 -#define VIDEO_AGP_RATE_4X 4 -#define VIDEO_AGP_RATE_8X 8 - -typedef enum -{ - VpNonCached = 0, - VpWriteCombined, - VpCached -} VIDEO_PORT_CACHE_TYPE; - -typedef -PHYSICAL_ADDRESS -(STDAPICALLTYPE *PAGP_RESERVE_PHYSICAL)( - IN PVOID HwDeviceExtension, - IN ULONG Pages, - IN VIDEO_PORT_CACHE_TYPE Caching, - OUT PVOID *PhysicalReserveContext - ); - -typedef -VOID -(STDAPICALLTYPE *PAGP_RELEASE_PHYSICAL)( - IN PVOID HwDeviceExtension, - IN PVOID PhysicalReserveContext - ); - -typedef -BOOLEAN -(STDAPICALLTYPE *PAGP_COMMIT_PHYSICAL)( - IN PVOID HwDeviceExtension, - IN PVOID PhysicalReserveContext, - IN ULONG Pages, - IN ULONG Offset - ); - -typedef -VOID -(STDAPICALLTYPE *PAGP_FREE_PHYSICAL)( - IN PVOID HwDeviceExtension, - IN PVOID PhysicalReserveContext, - IN ULONG Pages, - IN ULONG Offset - ); - -typedef -PVOID -(STDAPICALLTYPE *PAGP_RESERVE_VIRTUAL)( - IN PVOID HwDeviceExtension, - IN HANDLE ProcessHandle, - IN PVOID PhysicalReserveContext, - OUT PVOID *VirtualReserveContext - ); - -typedef -VOID -(STDAPICALLTYPE *PAGP_RELEASE_VIRTUAL)( - IN PVOID HwDeviceExtension, - IN PVOID VirtualReserveContext - ); - -typedef -PVOID -(STDAPICALLTYPE *PAGP_COMMIT_VIRTUAL)( - IN PVOID HwDeviceExtension, - IN PVOID VirtualReserveContext, - IN ULONG Pages, - IN ULONG Offset - ); - -typedef -VOID -(STDAPICALLTYPE *PAGP_FREE_VIRTUAL)( - IN PVOID HwDeviceExtension, - IN PVOID VirtualReserveContext, - IN ULONG Pages, - IN ULONG Offset - ); - -typedef -BOOLEAN -(STDAPICALLTYPE *PAGP_SET_RATE)( - IN PVOID HwDeviceExtension, - IN ULONG AgpRate - ); - -typedef struct _VIDEO_PORT_AGP_SERVICES -{ - PAGP_RESERVE_PHYSICAL AgpReservePhysical; - PAGP_RELEASE_PHYSICAL AgpReleasePhysical; - PAGP_COMMIT_PHYSICAL AgpCommitPhysical; - PAGP_FREE_PHYSICAL AgpFreePhysical; - - PAGP_RESERVE_VIRTUAL AgpReserveVirtual; - PAGP_RELEASE_VIRTUAL AgpReleaseVirtual; - PAGP_COMMIT_VIRTUAL AgpCommitVirtual; - PAGP_FREE_VIRTUAL AgpFreeVirtual; - ULONGLONG AllocationLimit; - -} VIDEO_PORT_AGP_SERVICES, *PVIDEO_PORT_AGP_SERVICES; - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("VideoPortQueryServices", "Obsolete") -BOOLEAN -STDAPICALLTYPE -VideoPortGetAgpServices( - IN PVOID HwDeviceExtension, - IN PVIDEO_PORT_AGP_SERVICES AgpServices - ); - -#endif // ifndef __VIDEOAGP_H__ - diff --git a/qt-correction-tool/pub/ddk/wdm.h b/qt-correction-tool/pub/ddk/wdm.h deleted file mode 100644 index b9ca41a..0000000 --- a/qt-correction-tool/pub/ddk/wdm.h +++ /dev/null @@ -1,32429 +0,0 @@ -/*++ BUILD Version: 0162 // Increment this if a change has global effects - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wdm.h - -Abstract: - - This module defines the WDM types, constants, and functions that are - exposed to device drivers. - -Revision History: - ---*/ - -#ifndef _WDMDDK_ -#define _WDMDDK_ - -#ifndef _NTDDK_ -#define _WDM_INCLUDED_ -#define _DDK_DRIVER_ - -// -// Use 9x compat Interlocked functions by default when including wdm.h -// - -#define NO_INTERLOCKED_INTRINSICS - -#endif - -#define _NTDDK_ -#define _STRSAFE_USE_SECURE_CRT 0 - -#ifndef RC_INVOKED -#if _MSC_VER < 1300 -#error Compiler version not supported by Windows DDK -#endif -#endif // RC_INVOKED - -#define NT_INCLUDED -#define _CTYPE_DISABLE_MACROS - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif - -#pragma warning(disable:4115) // named type definition in parentheses -#pragma warning(disable:4201) // nameless struct/union -#pragma warning(disable:4214) // bit field types other than int - -#include -#include -#include -#include -#include - -__internal_kernel_driver -__drv_Mode_impl(WDM_INCLUDED) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define types that are not exported. -// - -typedef struct _ACCESS_STATE *PACCESS_STATE; -typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; -#if defined(_NTHAL_INCLUDED_) -typedef struct _KPROCESS *PEPROCESS; -typedef struct _ETHREAD *PETHREAD; -#elif defined(_NTIFS_INCLUDED_) -typedef struct _KPROCESS *PEPROCESS; -typedef struct _KTHREAD *PETHREAD; -#else -typedef struct _EPROCESS *PEPROCESS; -typedef struct _ETHREAD *PETHREAD; -#endif -typedef struct _IO_TIMER *PIO_TIMER; -typedef struct _KINTERRUPT *PKINTERRUPT; -typedef struct _KTHREAD *PKTHREAD, *PRKTHREAD; -typedef struct _KPROCESS *PKPROCESS, *PRKPROCESS; -typedef struct _OBJECT_TYPE *POBJECT_TYPE; -typedef struct _SECURITY_QUALITY_OF_SERVICE *PSECURITY_QUALITY_OF_SERVICE; - - -// -// Declare empty structure definitions so that they may be referenced by -// routines before they are defined -// -typedef struct _CONTEXT *PCONTEXT; -typedef struct _IO_STACK_LOCATION *PIO_STACK_LOCATION; -typedef struct _VPB *PVPB; -typedef struct _FILE_GET_QUOTA_INFORMATION *PFILE_GET_QUOTA_INFORMATION; - - -#if defined(_M_AMD64) - -ULONG64 -__readgsqword ( - IN ULONG Offset - ); - -#pragma intrinsic(__readgsqword) - -__forceinline -PKTHREAD -KeGetCurrentThread ( - VOID - ) - -{ - return (struct _KTHREAD *)__readgsqword(0x188); -} - -#endif // defined(_M_AMD64) - -#if defined(_M_IX86) || defined(_M_IA64) - -NTSYSAPI -PKTHREAD -NTAPI -KeGetCurrentThread( - VOID - ); - -#endif // defined(_M_IX86) || defined(_M_IA64) - -// -// Define base address for kernel and user space -// - -#ifndef _WIN64 - -#define KADDRESS_BASE 0 - -#define UADDRESS_BASE 0 - -#endif // !_WIN64 - - -#if defined(_M_IA64) && !defined(_NTHAL_) - -// -// Define Address of Processor Control Registers. -// - -#define KIPCR ((ULONG_PTR)(KADDRESS_BASE + 0xFFFF0000)) // kernel address of first PCR - -// -// Define Pointer to Processor Control Registers. -// - -#define PCR ((volatile KPCR * const)KIPCR) - -#endif // defined(_M_IA64) && !defined(_NTHAL_) - -#include - -#ifndef FAR -#define FAR -#endif - -#define PsGetCurrentProcess IoGetCurrentProcess - -#if (NTDDI_VERSION >= NTDDI_VISTA) -extern NTSYSAPI volatile CCHAR KeNumberProcessors; -#elif (NTDDI_VERSION >= NTDDI_WINXP) -extern NTSYSAPI CCHAR KeNumberProcessors; -#else -extern PCCHAR KeNumberProcessors; -#endif -#if defined(_X86_) -// -// Interrupt Request Level definitions -// - -#define PASSIVE_LEVEL 0 // Passive release level -#define LOW_LEVEL 0 // Lowest interrupt level -#define APC_LEVEL 1 // APC interrupt level -#define DISPATCH_LEVEL 2 // Dispatcher level -#define CMCI_LEVEL 5 // CMCI handler level - -#define PROFILE_LEVEL 27 // timer used for profiling. -#define CLOCK1_LEVEL 28 // Interval clock 1 level - Not used on x86 -#define CLOCK2_LEVEL 28 // Interval clock 2 level -#define IPI_LEVEL 29 // Interprocessor interrupt level -#define POWER_LEVEL 30 // Power failure level -#define HIGH_LEVEL 31 // Highest interrupt level - -#define CLOCK_LEVEL (CLOCK2_LEVEL) - -#endif -#if defined(_AMD64_) -// -// Interrupt Request Level definitions -// - -#define PASSIVE_LEVEL 0 // Passive release level -#define LOW_LEVEL 0 // Lowest interrupt level -#define APC_LEVEL 1 // APC interrupt level -#define DISPATCH_LEVEL 2 // Dispatcher level -#define CMCI_LEVEL 5 // CMCI handler level - -#define CLOCK_LEVEL 13 // Interval clock level -#define IPI_LEVEL 14 // Interprocessor interrupt level -#define DRS_LEVEL 14 // Deferred Recovery Service level -#define POWER_LEVEL 14 // Power failure level -#define PROFILE_LEVEL 15 // timer used for profiling. -#define HIGH_LEVEL 15 // Highest interrupt level - -#endif -#if defined(_IA64_) -// -// Define Interrupt Request Levels. -// - -#define PASSIVE_LEVEL 0 // Passive release level -#define LOW_LEVEL 0 // Lowest interrupt level -#define APC_LEVEL 1 // APC interrupt level -#define DISPATCH_LEVEL 2 // Dispatcher level -#define CMC_LEVEL 3 // Correctable machine check level -#define DEVICE_LEVEL_BASE 4 // 4 - 11 - Device IRQLs -#define PC_LEVEL 12 // Performance Counter IRQL -#define IPI_LEVEL 14 // IPI IRQL -#define DRS_LEVEL 14 // Deferred Recovery Service level -#define CLOCK_LEVEL 13 // Clock Timer IRQL -#define POWER_LEVEL 15 // Power failure level -#define PROFILE_LEVEL 15 // Profiling level -#define HIGH_LEVEL 15 // Highest interrupt level - -#endif - -#define LOW_PRIORITY 0 // Lowest thread priority level -#define LOW_REALTIME_PRIORITY 16 // Lowest realtime priority level -#define HIGH_PRIORITY 31 // Highest thread priority level -#define MAXIMUM_PRIORITY 32 // Number of thread priority levels - -#define MAXIMUM_WAIT_OBJECTS 64 // Maximum number of wait objects - -#define MAXIMUM_SUSPEND_COUNT MAXCHAR // Maximum times thread can be suspended - - -// -// Define system time structure. -// - -typedef struct _KSYSTEM_TIME { - ULONG LowPart; - LONG High1Time; - LONG High2Time; -} KSYSTEM_TIME, *PKSYSTEM_TIME; - -// -// Thread priority -// - -typedef LONG KPRIORITY; - -// -// Spin Lock -// - - - -typedef ULONG_PTR KSPIN_LOCK; -typedef KSPIN_LOCK *PKSPIN_LOCK; - - -// -// Define per processor lock queue structure. -// -// N.B. The lock field of the spin lock queue structure contains the address -// of the associated kernel spin lock, an owner bit, and a lock bit. Bit -// 0 of the spin lock address is the wait bit and bit 1 is the owner bit. -// The use of this field is such that the bits can be set and cleared -// noninterlocked, however, the back pointer must be preserved. -// -// The lock wait bit is set when a processor enqueues itself on the lock -// queue and it is not the only entry in the queue. The processor will -// spin on this bit waiting for the lock to be granted. -// -// The owner bit is set when the processor owns the respective lock. -// -// The next field of the spin lock queue structure is used to line the -// queued lock structures together in fifo order. It also can set set and -// cleared noninterlocked. -// - -#define LOCK_QUEUE_WAIT 1 -#define LOCK_QUEUE_WAIT_BIT 0 - -#define LOCK_QUEUE_OWNER 2 -#define LOCK_QUEUE_OWNER_BIT 1 - -#if defined(_AMD64_) - -typedef ULONG64 KSPIN_LOCK_QUEUE_NUMBER; - -#define LockQueueUnusedSpare0 0 -#define LockQueueExpansionLock 1 -#define LockQueueUnusedSpare2 2 -#define LockQueueSystemSpaceLock 3 -#define LockQueueVacbLock 4 -#define LockQueueMasterLock 5 -#define LockQueueNonPagedPoolLock 6 -#define LockQueueIoCancelLock 7 -#define LockQueueWorkQueueLock 8 -#define LockQueueIoVpbLock 9 -#define LockQueueIoDatabaseLock 10 -#define LockQueueIoCompletionLock 11 -#define LockQueueNtfsStructLock 12 -#define LockQueueAfdWorkQueueLock 13 -#define LockQueueBcbLock 14 -#define LockQueueMmNonPagedPoolLock 15 -#define LockQueueUnusedSpare16 16 -#define LockQueueMaximumLock (LockQueueUnusedSpare16 + 1) - -#else - -typedef enum _KSPIN_LOCK_QUEUE_NUMBER { - LockQueueUnusedSpare0, - LockQueueExpansionLock, - LockQueueUnusedSpare2, - LockQueueSystemSpaceLock, - LockQueueVacbLock, - LockQueueMasterLock, - LockQueueNonPagedPoolLock, - LockQueueIoCancelLock, - LockQueueWorkQueueLock, - LockQueueIoVpbLock, - LockQueueIoDatabaseLock, - LockQueueIoCompletionLock, - LockQueueNtfsStructLock, - LockQueueAfdWorkQueueLock, - LockQueueBcbLock, - LockQueueMmNonPagedPoolLock, - LockQueueUnusedSpare16, - LockQueueMaximumLock = LockQueueUnusedSpare16 + 1 -} KSPIN_LOCK_QUEUE_NUMBER, *PKSPIN_LOCK_QUEUE_NUMBER; - -#endif - -typedef struct _KSPIN_LOCK_QUEUE { - struct _KSPIN_LOCK_QUEUE * volatile Next; - PKSPIN_LOCK volatile Lock; -} KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE; - -typedef struct _KLOCK_QUEUE_HANDLE { - KSPIN_LOCK_QUEUE LockQueue; - KIRQL OldIrql; -} KLOCK_QUEUE_HANDLE, *PKLOCK_QUEUE_HANDLE; - - -// -// Interrupt routine (first level dispatch) -// - -typedef -__drv_functionClass(KINTERRUPT_ROUTINE) -__drv_sameIRQL -VOID -KINTERRUPT_ROUTINE ( - VOID - ); - -typedef KINTERRUPT_ROUTINE *PKINTERRUPT_ROUTINE; - -// -// Profile source types -// -typedef enum _KPROFILE_SOURCE { - ProfileTime, - ProfileAlignmentFixup, - ProfileTotalIssues, - ProfilePipelineDry, - ProfileLoadInstructions, - ProfilePipelineFrozen, - ProfileBranchInstructions, - ProfileTotalNonissues, - ProfileDcacheMisses, - ProfileIcacheMisses, - ProfileCacheMisses, - ProfileBranchMispredictions, - ProfileStoreInstructions, - ProfileFpInstructions, - ProfileIntegerInstructions, - Profile2Issue, - Profile3Issue, - Profile4Issue, - ProfileSpecialInstructions, - ProfileTotalCycles, - ProfileIcacheIssues, - ProfileDcacheAccesses, - ProfileMemoryBarrierCycles, - ProfileLoadLinkedIssues, - ProfileMaximum -} KPROFILE_SOURCE; - - -// -// Define 128-bit 16-byte aligned xmm register type. -// - -typedef struct DECLSPEC_ALIGN(16) _M128A { - ULONGLONG Low; - LONGLONG High; -} M128A, *PM128A; - -// -// Format of data for (F)XSAVE/(F)XRSTOR instruction -// - -typedef struct DECLSPEC_ALIGN(16) _XSAVE_FORMAT { - USHORT ControlWord; - USHORT StatusWord; - UCHAR TagWord; - UCHAR Reserved1; - USHORT ErrorOpcode; - ULONG ErrorOffset; - USHORT ErrorSelector; - USHORT Reserved2; - ULONG DataOffset; - USHORT DataSelector; - USHORT Reserved3; - ULONG MxCsr; - ULONG MxCsr_Mask; - M128A FloatRegisters[8]; - -#if defined(_WIN64) - - M128A XmmRegisters[16]; - UCHAR Reserved4[96]; - -#else - - M128A XmmRegisters[8]; - UCHAR Reserved4[192]; - - // - // The fields below are not part of XSAVE/XRSTOR format. - // They are written by the OS which is relying on a fact that - // neither (FX)SAVE nor (F)XSTOR used this area. - // - - ULONG StackControl[7]; // KERNEL_STACK_CONTROL structure actualy - ULONG Cr0NpxState; - -#endif - -} XSAVE_FORMAT, *PXSAVE_FORMAT; - -typedef struct DECLSPEC_ALIGN(8) _XSAVE_AREA_HEADER { - ULONG64 Mask; - ULONG64 Reserved[7]; -} XSAVE_AREA_HEADER, *PXSAVE_AREA_HEADER; - -typedef struct DECLSPEC_ALIGN(16) _XSAVE_AREA { - XSAVE_FORMAT LegacyState; - XSAVE_AREA_HEADER Header; -} XSAVE_AREA, *PXSAVE_AREA; - -typedef struct _XSTATE_CONTEXT { - ULONG64 Mask; - ULONG Length; - ULONG Reserved1; - __field_bcount_opt(Length) PXSAVE_AREA Area; - -#if defined(_X86_) - ULONG Reserved2; -#endif - - PVOID Buffer; - -#if defined(_X86_) - ULONG Reserved3; -#endif - -} XSTATE_CONTEXT, *PXSTATE_CONTEXT; - - -#define XSAVE_ALIGN 64 -#define MINIMAL_XSTATE_AREA_LENGTH sizeof(XSAVE_AREA) - - -// -// This structure specifies an offset (from the beginning of CONTEXT_EX -// structure) and size of a single chunk of an extended context structure. -// -// N.B. Offset may be negative. -// - -typedef struct _CONTEXT_CHUNK { - LONG Offset; - ULONG Length; -} CONTEXT_CHUNK, *PCONTEXT_CHUNK; - -// -// CONTEXT_EX structure is an extension to CONTEXT structure. It defines -// a context record as a set of disjoint variable-sized buffers (chunks) -// each containing a portion of processor state. Currently there are only -// two buffers (chunks) are defined: -// -// - Legacy, that stores traditional CONTEXT structure; -// - XState, that stores XSAVE save area buffer starting from -// XSAVE_AREA_HEADER, i.e. without the first 512 bytes. -// -// There a few assumptions exists that simplify conversion of PCONTEXT -// pointer to PCONTEXT_EX pointer. -// -// 1. APIs that work with PCONTEXT pointers assume that CONTEXT_EX is -// stored right after the CONTEXT structure. It is also assumed that -// CONTEXT_EX is present if and only if corresponding CONTEXT_XXX -// flags are set in CONTEXT.ContextFlags. -// -// 2. CONTEXT_EX.Legacy is always present if CONTEXT_EX structure is -// present. All other chunks are optional. -// -// 3. CONTEXT.ContextFlags unambigiously define which chunks are -// present. I.e. if CONTEXT_XSTATE is set CONTEXT_EX.XState is valid. -// - -typedef struct _CONTEXT_EX { - - // - // The total length of the structure starting from the chunk with - // the smallest offset. N.B. that the offset may be negative. - // - - CONTEXT_CHUNK All; - - // - // Wrapper for the traditional CONTEXT structure. N.B. the size of - // the chunk may be less than sizeof(CONTEXT) is some cases (when - // CONTEXT_EXTENDED_REGISTERS is not set on x86 for instance). - // - - CONTEXT_CHUNK Legacy; - - // - // CONTEXT_XSTATE: Extended processor state chunk. The state is - // stored in the same format XSAVE operation strores it with - // exception of the first 512 bytes, i.e. staring from - // XSAVE_AREA_HEADER. The lower two bits corresponding FP and - // SSE state must be zero. - // - - CONTEXT_CHUNK XState; - -} CONTEXT_EX, *PCONTEXT_EX; - -#define CONTEXT_EX_LENGTH ALIGN_UP_BY(sizeof(CONTEXT_EX), STACK_ALIGN) - -// -// These macros make context chunks manupulations easier. -// - -#define RTL_CONTEXT_EX_OFFSET(ContextEx, Chunk) \ - ((ContextEx)->Chunk.Offset) - -#define RTL_CONTEXT_EX_LENGTH(ContextEx, Chunk) \ - ((ContextEx)->Chunk.Length) - -#define RTL_CONTEXT_EX_CHUNK(Base, Layout, Chunk) \ - ((PVOID)((PCHAR)(Base) + RTL_CONTEXT_EX_OFFSET(Layout, Chunk))) - -#define RTL_CONTEXT_OFFSET(Context, Chunk) \ - RTL_CONTEXT_EX_OFFSET((PCONTEXT_EX)(Context + 1), Chunk) - -#define RTL_CONTEXT_LENGTH(Context, Chunk) \ - RTL_CONTEXT_EX_LENGTH((PCONTEXT_EX)(Context + 1), Chunk) - -#define RTL_CONTEXT_CHUNK(Context, Chunk) \ - RTL_CONTEXT_EX_CHUNK((PCONTEXT_EX)(Context + 1), \ - (PCONTEXT_EX)(Context + 1), \ - Chunk) - - -#if !defined(__midl) && !defined(MIDL_PASS) - -// -// XSAVE/XRSTOR save area should be aligned on 64 byte boundary -// - -C_ASSERT((sizeof(XSAVE_FORMAT) & (XSAVE_ALIGN - 1)) == 0); -C_ASSERT((FIELD_OFFSET(XSAVE_AREA, Header) & (XSAVE_ALIGN - 1)) == 0); - -// XSAVE_AREA structure must be sized uniformly on all architectures -C_ASSERT(MINIMAL_XSTATE_AREA_LENGTH == 512 + 64); - -#endif - - -#ifdef _X86_ - -// -// Disable these two pragmas that evaluate to "sti" "cli" on x86 so that driver -// writers to not leave them inadvertantly in their code. -// - -#if !defined(MIDL_PASS) -#if !defined(RC_INVOKED) - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4164) // disable C4164 warning so that apps that - // build with /Od don't get weird errors ! -#ifdef _M_IX86 -#pragma function(_enable) -#pragma function(_disable) -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4164) // reenable C4164 warning -#endif - -#endif -#endif - - -#if defined(_M_IX86) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#ifdef __cplusplus -extern "C" { -#endif - - - -#if (_MSC_FULL_VER >= 14000101) - - -// -// Define bit test intrinsics. -// - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset -#define InterlockedBitTestAndSet _interlockedbittestandset -#define InterlockedBitTestAndReset _interlockedbittestandreset - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandreset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) -#pragma intrinsic(_interlockedbittestandset) -#pragma intrinsic(_interlockedbittestandreset) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse - -__success(return != 0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return != 0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) - -#else - -#pragma warning(push) -#pragma warning(disable:4035 4793) - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndSet ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock bts [ecx], eax - setc al - }; -} - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndReset ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock btr [ecx], eax - setc al - }; -} -#pragma warning(pop) - -#endif /* _MSC_FULL_VER >= 14000101 */ - -// -// [pfx_parse] - guard against PREfix intrinsic error -// -#if (_MSC_FULL_VER >= 140040816) || (defined(_PREFAST_) && (_MSC_VER >= 1400)) - -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 -#define InterlockedOr16 _InterlockedOr16 - -SHORT -_InterlockedAnd16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -_InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -SHORT -_InterlockedOr16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -#pragma intrinsic(_InterlockedAnd16) -#pragma intrinsic(_InterlockedCompareExchange16) -#pragma intrinsic(_InterlockedOr16) - -#endif /* _MSC_FULL_VER >= 140040816 */ - -#if !defined(_M_CEE_PURE) -#pragma warning(push) -#pragma warning(disable:4035 4793) - -FORCEINLINE -BOOLEAN -InterlockedBitTestAndComplement ( - __inout_bcount((Bit+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - __asm { - mov eax, Bit - mov ecx, Base - lock btc [ecx], eax - setc al - }; -} -#pragma warning(pop) -#endif /* _M_CEE_PURE */ - -// -// [pfx_parse] -// guard against __readfsbyte parsing error -// -#if (_MSC_FULL_VER >= 13012035) || defined(_PREFIX_) || defined(_PREFAST_) - -// -// Define FS referencing intrinsics -// - -UCHAR -__readfsbyte ( - __in ULONG Offset - ); - -USHORT -__readfsword ( - __in ULONG Offset - ); - -ULONG -__readfsdword ( - __in ULONG Offset - ); - -VOID -__writefsbyte ( - __in ULONG Offset, - __in UCHAR Data - ); - -VOID -__writefsword ( - __in ULONG Offset, - __in USHORT Data - ); - -VOID -__writefsdword ( - __in ULONG Offset, - __in ULONG Data - ); - -#pragma intrinsic(__readfsbyte) -#pragma intrinsic(__readfsword) -#pragma intrinsic(__readfsdword) -#pragma intrinsic(__writefsbyte) -#pragma intrinsic(__writefsword) -#pragma intrinsic(__writefsdword) - -#endif /* _MSC_FULL_VER >= 13012035 */ - -#if (_MSC_FULL_VER >= 140050727) || defined(_PREFIX_) || defined(_PREFAST_) - -#if !defined(_MANAGED) - -VOID -__incfsbyte ( - __in ULONG Offset - ); - -VOID -__addfsbyte ( - __in ULONG Offset, - __in UCHAR Value - ); - -VOID -__incfsword ( - __in ULONG Offset - ); - -VOID -__addfsword ( - __in ULONG Offset, - __in USHORT Value - ); - -VOID -__incfsdword ( - __in ULONG Offset - ); - -VOID -__addfsdword ( - __in ULONG Offset, - __in ULONG Value - ); - -#pragma intrinsic(__incfsbyte) -#pragma intrinsic(__addfsbyte) -#pragma intrinsic(__incfsword) -#pragma intrinsic(__addfsword) -#pragma intrinsic(__incfsdword) -#pragma intrinsic(__addfsdword) - -#endif - -#endif /* _MSC_FULL_VER >= 140050727 */ - -#if (_MSC_FULL_VER >= 140041204) || defined(_PREFIX_) || defined(_PREFAST_) - -VOID -_mm_pause ( - VOID - ); - -#pragma intrinsic(_mm_pause) - -#define YieldProcessor _mm_pause - -#else - -#if !defined(_M_CEE_PURE) -#define YieldProcessor() __asm { rep nop } -#endif // !defined(_M_CEE_PURE) - -#endif // (_MSC_FULL_VER >= 140041204) - -#ifdef __cplusplus -} -#endif - -#endif /* !defined(MIDL_PASS) || defined(_M_IX86) */ - - -#if defined(_X86_) && defined(_M_IX86) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#if _MSC_FULL_VER >= 140030222 - -VOID -__int2c ( - VOID - ); - -#pragma intrinsic(__int2c) - -__analysis_noreturn -FORCEINLINE -VOID -DbgRaiseAssertionFailure ( - VOID - ) - -{ - __int2c(); -} - -#else -#pragma warning( push ) -#pragma warning( disable : 4793 ) - -__analysis_noreturn -FORCEINLINE -VOID -DbgRaiseAssertionFailure ( - VOID - ) - -{ - __asm int 0x2c -} - -#pragma warning( pop ) - -#endif - -#endif - - -#define MAXIMUM_SUPPORTED_EXTENSION 512 - -#if !defined(__midl) && !defined(MIDL_PASS) - -C_ASSERT(sizeof(XSAVE_FORMAT) == MAXIMUM_SUPPORTED_EXTENSION); - -#endif - -#endif // _X86_ - -#ifdef _AMD64_ - - -#if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -// -// Define bit test intrinsics. -// - -#ifdef __cplusplus -extern "C" { -#endif - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset -#define InterlockedBitTestAndSet _interlockedbittestandset -#define InterlockedBitTestAndReset _interlockedbittestandreset - -#define BitTest64 _bittest64 -#define BitTestAndComplement64 _bittestandcomplement64 -#define BitTestAndSet64 _bittestandset64 -#define BitTestAndReset64 _bittestandreset64 -#define InterlockedBitTestAndSet64 _interlockedbittestandset64 -#define InterlockedBitTestAndReset64 _interlockedbittestandreset64 - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_interlockedbittestandreset ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG volatile *Base, - __in LONG Offset - ); - -BOOLEAN -_bittest64 ( - __in_bcount((Offset+7)/8) LONG64 const *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandcomplement64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandreset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_interlockedbittestandset64 ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG64 volatile *Base, - __in LONG64 Offset - ); - -BOOLEAN -_interlockedbittestandreset64 ( - __inout_bcount((Offset+7)/8) __drv_interlocked LONG64 volatile *Base, - __in LONG64 Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) -#pragma intrinsic(_interlockedbittestandset) -#pragma intrinsic(_interlockedbittestandreset) - -#pragma intrinsic(_bittest64) -#pragma intrinsic(_bittestandcomplement64) -#pragma intrinsic(_bittestandset64) -#pragma intrinsic(_bittestandreset64) -#pragma intrinsic(_interlockedbittestandset64) -#pragma intrinsic(_interlockedbittestandreset64) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse -#define BitScanForward64 _BitScanForward64 -#define BitScanReverse64 _BitScanReverse64 - -__success(return!=0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanForward64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) - -// -// Interlocked intrinsic functions. -// - -#define InterlockedIncrement16 _InterlockedIncrement16 -#define InterlockedDecrement16 _InterlockedDecrement16 -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 - -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAcquire _InterlockedAnd -#define InterlockedAndRelease _InterlockedAnd -#define InterlockedOr _InterlockedOr -#define InterlockedOrAcquire _InterlockedOr -#define InterlockedOrRelease _InterlockedOr -#define InterlockedXor _InterlockedXor -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedIncrementAcquire InterlockedIncrement -#define InterlockedIncrementRelease InterlockedIncrement -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedDecrementAcquire InterlockedDecrement -#define InterlockedDecrementRelease InterlockedDecrement -#define InterlockedAdd _InterlockedAdd -#define InterlockedExchange _InterlockedExchange -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire InterlockedCompareExchange -#define InterlockedCompareExchangeRelease InterlockedCompareExchange - -#define InterlockedAnd64 _InterlockedAnd64 -#define InterlockedAnd64Acquire _InterlockedAnd64 -#define InterlockedAnd64Release _InterlockedAnd64 -#define InterlockedAndAffinity InterlockedAnd64 -#define InterlockedOr64 _InterlockedOr64 -#define InterlockedOr64Acquire _InterlockedOr64 -#define InterlockedOr64Release _InterlockedOr64 -#define InterlockedOrAffinity InterlockedOr64 -#define InterlockedXor64 _InterlockedXor64 -#define InterlockedIncrement64 _InterlockedIncrement64 -#define InterlockedDecrement64 _InterlockedDecrement64 -#define InterlockedAdd64 _InterlockedAdd64 -#define InterlockedExchange64 _InterlockedExchange64 -#define InterlockedExchangeAcquire64 InterlockedExchange64 -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 -#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 - -#define InterlockedExchangePointer _InterlockedExchangePointer -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a) - -SHORT -InterlockedIncrement16 ( - __inout __drv_interlocked SHORT volatile *Addend - ); - -SHORT -InterlockedDecrement16 ( - __inout __drv_interlocked SHORT volatile *Addend - ); - -SHORT -InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -LONG -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -InterlockedXor ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG64 -InterlockedAnd64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG64 -InterlockedOr64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG64 -InterlockedXor64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 Value - ); - -LONG -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -#if !defined(_X86AMD64_) - -__forceinline -LONG -InterlockedAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ) - -{ - return InterlockedExchangeAdd(Addend, Value) + Value; -} - -#endif - -LONG -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - -LONG64 -InterlockedIncrement64( - __inout __drv_interlocked LONG64 volatile *Addend - ); - -LONG64 -InterlockedDecrement64( - __inout __drv_interlocked LONG64 volatile *Addend - ); - -LONG64 -InterlockedExchange64( - __inout __drv_interlocked LONG64 volatile *Target, - __in LONG64 Value - ); - -LONG64 -InterlockedExchangeAdd64( - __inout __drv_interlocked LONG64 volatile *Addend, - __in LONG64 Value - ); - -#if !defined(_X86AMD64_) - -__forceinline -LONG64 -InterlockedAdd64( - __inout __drv_interlocked LONG64 volatile *Addend, - __in LONG64 Value - ) - -{ - return InterlockedExchangeAdd64(Addend, Value) + Value; -} - -#endif - -LONG64 -InterlockedCompareExchange64 ( - __inout __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExChange, - __in LONG64 Comperand - ); - -PVOID -InterlockedCompareExchangePointer ( - __inout __drv_interlocked PVOID volatile *Destination, - __in_opt PVOID Exchange, - __in_opt PVOID Comperand - ); - -PVOID -InterlockedExchangePointer( - __inout __drv_interlocked PVOID volatile *Target, - __in_opt PVOID Value - ); - -#pragma intrinsic(_InterlockedIncrement16) -#pragma intrinsic(_InterlockedDecrement16) -#pragma intrinsic(_InterlockedCompareExchange16) -#pragma intrinsic(_InterlockedAnd) -#pragma intrinsic(_InterlockedOr) -#pragma intrinsic(_InterlockedXor) -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedAnd64) -#pragma intrinsic(_InterlockedOr64) -#pragma intrinsic(_InterlockedXor64) -#pragma intrinsic(_InterlockedIncrement64) -#pragma intrinsic(_InterlockedDecrement64) -#pragma intrinsic(_InterlockedExchange64) -#pragma intrinsic(_InterlockedExchangeAdd64) -#pragma intrinsic(_InterlockedCompareExchange64) -#pragma intrinsic(_InterlockedExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer) - -#if _MSC_FULL_VER >= 140041204 - -#define InterlockedAnd8 _InterlockedAnd8 -#define InterlockedOr8 _InterlockedOr8 -#define InterlockedXor8 _InterlockedXor8 -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedOr16 _InterlockedOr16 -#define InterlockedXor16 _InterlockedXor16 - -char -InterlockedAnd8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -char -InterlockedOr8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -char -InterlockedXor8 ( - __inout __drv_interlocked char volatile *Destination, - __in char Value - ); - -SHORT -InterlockedAnd16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -InterlockedOr16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -InterlockedXor16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -#pragma intrinsic (_InterlockedAnd8) -#pragma intrinsic (_InterlockedOr8) -#pragma intrinsic (_InterlockedXor8) -#pragma intrinsic (_InterlockedAnd16) -#pragma intrinsic (_InterlockedOr16) -#pragma intrinsic (_InterlockedXor16) - -#endif - -// -// Define function to flush a cache line. -// - -#define CacheLineFlush(Address) _mm_clflush(Address) - -VOID -_mm_clflush ( - __in VOID const *Address - ); - -#pragma intrinsic(_mm_clflush) - -VOID -_ReadWriteBarrier ( - VOID - ); - -#pragma intrinsic(_ReadWriteBarrier) - -// -// Define memory fence intrinsics -// - -#define FastFence __faststorefence -#define LoadFence _mm_lfence -#define MemoryFence _mm_mfence -#define StoreFence _mm_sfence - -VOID -__faststorefence ( - VOID - ); - -VOID -_mm_lfence ( - VOID - ); - -VOID -_mm_mfence ( - VOID - ); - -VOID -_mm_sfence ( - VOID - ); - -VOID -_mm_pause ( - VOID - ); - -VOID -_mm_prefetch ( - __in CHAR CONST *a, - __in int sel - ); - -VOID -_m_prefetchw ( - __in volatile CONST VOID *Source - ); - -// -// Define constants for use with _mm_prefetch. -// - -#define _MM_HINT_T0 1 -#define _MM_HINT_T1 2 -#define _MM_HINT_T2 3 -#define _MM_HINT_NTA 0 - -#pragma intrinsic(__faststorefence) -#pragma intrinsic(_mm_pause) -#pragma intrinsic(_mm_prefetch) -#pragma intrinsic(_mm_lfence) -#pragma intrinsic(_mm_mfence) -#pragma intrinsic(_mm_sfence) -#pragma intrinsic(_m_prefetchw) - -#define YieldProcessor _mm_pause -#define MemoryBarrier __faststorefence -#define PreFetchCacheLine(l, a) _mm_prefetch((CHAR CONST *) a, l) -#define PrefetchForWrite(p) _m_prefetchw(p) -#define ReadForWriteAccess(p) (_m_prefetchw(p), *(p)) - -// -// PreFetchCacheLine level defines. -// - -#define PF_TEMPORAL_LEVEL_1 _MM_HINT_T0 -#define PF_TEMPORAL_LEVEL_2 _MM_HINT_T1 -#define PF_TEMPORAL_LEVEL_3 _MM_HINT_T2 -#define PF_NON_TEMPORAL_LEVEL_ALL _MM_HINT_NTA - -// -// Define get/set MXCSR intrinsics. -// - -#define ReadMxCsr _mm_getcsr -#define WriteMxCsr _mm_setcsr - -unsigned int -_mm_getcsr ( - VOID - ); - -VOID -_mm_setcsr ( - __in unsigned int MxCsr - ); - -#pragma intrinsic(_mm_getcsr) -#pragma intrinsic(_mm_setcsr) - -// -// Assert exception. -// - -VOID -__int2c ( - VOID - ); - -#pragma intrinsic(__int2c) - -__analysis_noreturn -FORCEINLINE -VOID -DbgRaiseAssertionFailure ( - VOID - ) - -{ - __int2c(); -} - -// -// Define function to get the caller's EFLAGs value. -// - -#define GetCallersEflags() __getcallerseflags() - -unsigned __int32 -__getcallerseflags ( - VOID - ); - -#pragma intrinsic(__getcallerseflags) - -// -// Define function to get segment limit. -// - -#define GetSegmentLimit __segmentlimit - -ULONG -__segmentlimit ( - __in ULONG Selector - ); - -#pragma intrinsic(__segmentlimit) - -// -// Define function to read the value of a performance counter. -// - -#define ReadPMC __readpmc - -ULONG64 -__readpmc ( - __in ULONG Counter - ); - -#pragma intrinsic(__readpmc) - -// -// Define function to read the value of the time stamp counter -// - -#define ReadTimeStampCounter() __rdtsc() - -ULONG64 -__rdtsc ( - VOID - ); - -#pragma intrinsic(__rdtsc) - -// -// Define functions to move strings as bytes, words, dwords, and qwords. -// - -VOID -__movsb ( - __out_ecount_full(Count) PUCHAR Destination, - __in_ecount(Count) UCHAR const *Source, - __in SIZE_T Count - ); - -VOID -__movsw ( - __out_ecount_full(Count) PUSHORT Destination, - __in_ecount(Count) USHORT const *Source, - __in SIZE_T Count - ); - -VOID -__movsd ( - __out_ecount_full(Count) PULONG Destination, - __in_ecount(Count) ULONG const *Source, - __in SIZE_T Count - ); - -VOID -__movsq ( - __out_ecount_full(Count) PULONG64 Destination, - __in_ecount(Count) ULONG64 const *Source, - __in SIZE_T Count - ); - -#pragma intrinsic(__movsb) -#pragma intrinsic(__movsw) -#pragma intrinsic(__movsd) -#pragma intrinsic(__movsq) - -// -// Define functions to store strings as bytes, words, dwords, and qwords. -// - -VOID -__stosb ( - __out_ecount_full(Count) PUCHAR Destination, - __in UCHAR Value, - __in SIZE_T Count - ); - -VOID -__stosw ( - __out_ecount_full(Count) PUSHORT Destination, - __in USHORT Value, - __in SIZE_T Count - ); - -VOID -__stosd ( - __out_ecount_full(Count) PULONG Destination, - __in ULONG Value, - __in SIZE_T Count - ); - -VOID -__stosq ( - __out_ecount_full(Count) PULONG64 Destination, - __in ULONG64 Value, - __in SIZE_T Count - ); - -#pragma intrinsic(__stosb) -#pragma intrinsic(__stosw) -#pragma intrinsic(__stosd) -#pragma intrinsic(__stosq) - -// -// Define functions to capture the high 64-bits of a 128-bit multiply. -// - -#define MultiplyHigh __mulh -#define UnsignedMultiplyHigh __umulh - -LONGLONG -MultiplyHigh ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand - ); - -ULONGLONG -UnsignedMultiplyHigh ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand - ); - -#pragma intrinsic(__mulh) -#pragma intrinsic(__umulh) - -// -// Define functions to perform 128-bit shifts -// - -#define ShiftLeft128 __shiftleft128 -#define ShiftRight128 __shiftright128 - -ULONG64 -ShiftLeft128 ( - __in ULONG64 LowPart, - __in ULONG64 HighPart, - __in UCHAR Shift - ); - -ULONG64 -ShiftRight128 ( - __in ULONG64 LowPart, - __in ULONG64 HighPart, - __in UCHAR Shift - ); - -#pragma intrinsic(__shiftleft128) -#pragma intrinsic(__shiftright128) - -// -// Define functions to perform 128-bit multiplies. -// - -#define Multiply128 _mul128 - -LONG64 -Multiply128 ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand, - __out LONG64 *HighProduct - ); - -#pragma intrinsic(_mul128) - -#ifndef UnsignedMultiply128 - -#define UnsignedMultiply128 _umul128 - -ULONG64 -UnsignedMultiply128 ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand, - __out ULONG64 *HighProduct - ); - -#pragma intrinsic(_umul128) - -#endif - -__forceinline -LONG64 -MultiplyExtract128 ( - __in LONG64 Multiplier, - __in LONG64 Multiplicand, - __in UCHAR Shift - ) - -{ - - LONG64 extractedProduct; - LONG64 highProduct; - LONG64 lowProduct; - BOOLEAN negate; - ULONG64 uhighProduct; - ULONG64 ulowProduct; - - lowProduct = Multiply128(Multiplier, Multiplicand, &highProduct); - negate = FALSE; - uhighProduct = (ULONG64)highProduct; - ulowProduct = (ULONG64)lowProduct; - if (highProduct < 0) { - negate = TRUE; - uhighProduct = (ULONG64)(-highProduct); - ulowProduct = (ULONG64)(-lowProduct); - if (ulowProduct != 0) { - uhighProduct -= 1; - } - } - - extractedProduct = (LONG64)ShiftRight128(ulowProduct, uhighProduct, Shift); - if (negate != FALSE) { - extractedProduct = -extractedProduct; - } - - return extractedProduct; -} - -__forceinline -ULONG64 -UnsignedMultiplyExtract128 ( - __in ULONG64 Multiplier, - __in ULONG64 Multiplicand, - __in UCHAR Shift - ) - -{ - - ULONG64 extractedProduct; - ULONG64 highProduct; - ULONG64 lowProduct; - - lowProduct = UnsignedMultiply128(Multiplier, Multiplicand, &highProduct); - extractedProduct = ShiftRight128(lowProduct, highProduct, Shift); - return extractedProduct; -} - -// -// Define functions to read and write the uer TEB and the system PCR/PRCB. -// - -UCHAR -__readgsbyte ( - __in ULONG Offset - ); - -USHORT -__readgsword ( - __in ULONG Offset - ); - -ULONG -__readgsdword ( - __in ULONG Offset - ); - -ULONG64 -__readgsqword ( - __in ULONG Offset - ); - -VOID -__writegsbyte ( - __in ULONG Offset, - __in UCHAR Data - ); - -VOID -__writegsword ( - __in ULONG Offset, - __in USHORT Data - ); - -VOID -__writegsdword ( - __in ULONG Offset, - __in ULONG Data - ); - -VOID -__writegsqword ( - __in ULONG Offset, - __in ULONG64 Data - ); - -#pragma intrinsic(__readgsbyte) -#pragma intrinsic(__readgsword) -#pragma intrinsic(__readgsdword) -#pragma intrinsic(__readgsqword) -#pragma intrinsic(__writegsbyte) -#pragma intrinsic(__writegsword) -#pragma intrinsic(__writegsdword) -#pragma intrinsic(__writegsqword) - -#if !defined(_MANAGED) - -VOID -__incgsbyte ( - __in ULONG Offset - ); - -VOID -__addgsbyte ( - __in ULONG Offset, - __in UCHAR Value - ); - -VOID -__incgsword ( - __in ULONG Offset - ); - -VOID -__addgsword ( - __in ULONG Offset, - __in USHORT Value - ); - -VOID -__incgsdword ( - __in ULONG Offset - ); - -VOID -__addgsdword ( - __in ULONG Offset, - __in ULONG Value - ); - -VOID -__incgsqword ( - __in ULONG Offset - ); - -VOID -__addgsqword ( - __in ULONG Offset, - __in ULONG64 Value - ); - -#if 0 -#pragma intrinsic(__incgsbyte) -#pragma intrinsic(__addgsbyte) -#pragma intrinsic(__incgsword) -#pragma intrinsic(__addgsword) -#pragma intrinsic(__incgsdword) -#pragma intrinsic(__addgsdword) -#pragma intrinsic(__incgsqword) -#pragma intrinsic(__addgsqword) -#endif - -#endif - -#ifdef __cplusplus -} -#endif - -#endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - - -typedef XSAVE_FORMAT XMM_SAVE_AREA32, *PXMM_SAVE_AREA32; - - -#endif // _AMD64_ - - -#ifdef _IA64_ - - -#if defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define bit test intrinsics. -// - -#define BitTest _bittest -#define BitTestAndComplement _bittestandcomplement -#define BitTestAndSet _bittestandset -#define BitTestAndReset _bittestandreset - -#define BitTest64 _bittest64 -#define BitTestAndComplement64 _bittestandcomplement64 -#define BitTestAndSet64 _bittestandset64 -#define BitTestAndReset64 _bittestandreset64 - -__checkReturn -BOOLEAN -_bittest ( - __in_bcount((Offset+7)/8) LONG const *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandcomplement ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -BOOLEAN -_bittestandreset ( - __inout_bcount((Offset+7)/8) LONG *Base, - __in LONG Offset - ); - -__checkReturn -BOOLEAN -_bittest64 ( - __in_bcount((Offset+7)/8) LONG64 const *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandcomplement64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -BOOLEAN -_bittestandreset64 ( - __inout_bcount((Offset+7)/8) LONG64 *Base, - __in LONG64 Offset - ); - -#pragma intrinsic(_bittest) -#pragma intrinsic(_bittestandcomplement) -#pragma intrinsic(_bittestandset) -#pragma intrinsic(_bittestandreset) - -#pragma intrinsic(_bittest64) -#pragma intrinsic(_bittestandcomplement64) -#pragma intrinsic(_bittestandset64) -#pragma intrinsic(_bittestandreset64) - -// -// Define bit scan intrinsics. -// - -#define BitScanForward _BitScanForward -#define BitScanReverse _BitScanReverse -#define BitScanForward64 _BitScanForward64 -#define BitScanReverse64 _BitScanReverse64 - -__success(return!=0) -BOOLEAN -_BitScanForward ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse ( - __out ULONG *Index, - __in ULONG Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanForward64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -__success(return!=0) -BOOLEAN -_BitScanReverse64 ( - __out ULONG *Index, - __in ULONG64 Mask - ); - -#pragma intrinsic(_BitScanForward) -#pragma intrinsic(_BitScanReverse) -#pragma intrinsic(_BitScanForward64) -#pragma intrinsic(_BitScanReverse64) - -#define InterlockedCompareExchange16 _InterlockedCompareExchange16 - -SHORT -_InterlockedCompareExchange16 ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT ExChange, - __in SHORT Comperand - ); - -#pragma intrinsic(_InterlockedCompareExchange16) - -#ifdef __cplusplus -} -#endif - -#define InterlockedAdd _InterlockedAdd -#define InterlockedAddAcquire _InterlockedAdd_acq -#define InterlockedAddRelease _InterlockedAdd_rel - -#define InterlockedIncrement _InterlockedIncrement -#define InterlockedIncrementAcquire _InterlockedIncrement_acq -#define InterlockedIncrementRelease _InterlockedIncrement_rel - -#define InterlockedDecrement _InterlockedDecrement -#define InterlockedDecrementAcquire _InterlockedDecrement_acq -#define InterlockedDecrementRelease _InterlockedDecrement_rel - -#define InterlockedExchange _InterlockedExchange -#define InterlockedExchangeAcquire _InterlockedExchange_acq - -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#define InterlockedExchangeAddAcquire _InterlockedExchangeAdd_acq -#define InterlockedExchangeAddRelease _InterlockedExchangeAdd_rel - -#define InterlockedAdd64 _InterlockedAdd64 -#define InterlockedAddAcquire64 _InterlockedAdd64_acq -#define InterlockedAddRelease64 _InterlockedAdd64_rel - -#define InterlockedIncrement64 _InterlockedIncrement64 -#define InterlockedIncrementAcquire64 _InterlockedIncrement64_acq -#define InterlockedIncrementRelease64 _InterlockedIncrement64_rel - -#define InterlockedDecrement64 _InterlockedDecrement64 -#define InterlockedDecrementAcquire64 _InterlockedDecrement64_acq -#define InterlockedDecrementRelease64 _InterlockedDecrement64_rel - -#define InterlockedExchange64 _InterlockedExchange64 -#define InterlockedExchangeAcquire64 _InterlockedExchange64_acq - -#define InterlockedExchangeAdd64 _InterlockedExchangeAdd64 -#define InterlockedExchangeAddAcquire64 _InterlockedExchangeAdd64_acq -#define InterlockedExchangeAddRelease64 _InterlockedExchangeAdd64_rel - -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 -#define InterlockedCompareExchangeAcquire64 _InterlockedCompareExchange64_acq -#define InterlockedCompareExchangeRelease64 _InterlockedCompareExchange64_rel - -#define InterlockedCompare64Exchange128 _InterlockedCompare64Exchange128 -#define InterlockedCompare64ExchangeAcquire128 _InterlockedCompare64Exchange128_acq -#define InterlockedCompare64ExchangeRelease128 _InterlockedCompare64Exchange128_rel - -#define InterlockedCompareExchange _InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire _InterlockedCompareExchange_acq -#define InterlockedCompareExchangeRelease _InterlockedCompareExchange_rel - -#define InterlockedExchangePointer _InterlockedExchangePointer -#define InterlockedExchangePointerAcquire _InterlockedExchangePointer_acq - -#define InterlockedCompareExchangePointer _InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease _InterlockedCompareExchangePointer_rel -#define InterlockedCompareExchangePointerAcquire _InterlockedCompareExchangePointer_acq - - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd64((LONG64 *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement64((LONG64 *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement64((LONG64 *)a) - -#define InterlockedOr _InterlockedOr -#define InterlockedOrAcquire _InterlockedOr_acq -#define InterlockedOrRelease _InterlockedOr_rel -#define InterlockedOr8 _InterlockedOr8 -#define InterlockedOr8Acquire _InterlockedOr8_acq -#define InterlockedOr8Release _InterlockedOr8_rel -#define InterlockedOr16 _InterlockedOr16 -#define InterlockedOr16Acquire _InterlockedOr16_acq -#define InterlockedOr16Release _InterlockedOr16_rel -#define InterlockedOr64 _InterlockedOr64 -#define InterlockedOr64Acquire _InterlockedOr64_acq -#define InterlockedOr64Release _InterlockedOr64_rel -#define InterlockedXor _InterlockedXor -#define InterlockedXorAcquire _InterlockedXor_acq -#define InterlockedXorRelease _InterlockedXor_rel -#define InterlockedXor8 _InterlockedXor8 -#define InterlockedXor8Acquire _InterlockedXor8_acq -#define InterlockedXor8Release _InterlockedXor8_rel -#define InterlockedXor16 _InterlockedXor16 -#define InterlockedXor16Acquire _InterlockedXor16_acq -#define InterlockedXor16Release _InterlockedXor16_rel -#define InterlockedXor64 _InterlockedXor64 -#define InterlockedXor64Acquire _InterlockedXor64_acq -#define InterlockedXor64Release _InterlockedXor64_rel -#define InterlockedAnd _InterlockedAnd -#define InterlockedAndAcquire _InterlockedAnd_acq -#define InterlockedAndRelease _InterlockedAnd_rel -#define InterlockedAnd8 _InterlockedAnd8 -#define InterlockedAnd8Acquire _InterlockedAnd8_acq -#define InterlockedAnd8Release _InterlockedAnd8_rel -#define InterlockedAnd16 _InterlockedAnd16 -#define InterlockedAnd16Acquire _InterlockedAnd16_acq -#define InterlockedAnd16Release _InterlockedAnd16_rel -#define InterlockedAnd64 _InterlockedAnd64 -#define InterlockedAnd64Acquire _InterlockedAnd64_acq -#define InterlockedAnd64Release _InterlockedAnd64_rel - -#ifdef __cplusplus -extern "C" { -#endif - -LONG -__cdecl -InterlockedAdd ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddAcquire ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAddRelease ( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONGLONG -__cdecl -InterlockedAdd64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAddAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - - -LONGLONG -__cdecl -InterlockedAddRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementAcquire( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedIncrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedDecrementRelease( - __inout __drv_interlocked LONG volatile *Addend - ); - -LONG -__cdecl -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAcquire( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddAcquire( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedExchangeAddRelease( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Value - ); - -LONG -__cdecl -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONG -__cdecl -InterlockedCompareExchangeAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - - -LONGLONG -__cdecl -InterlockedIncrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedIncrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrement64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedDecrementRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend - ); - -LONGLONG -__cdecl -InterlockedExchange64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAcquire64( - __inout __drv_interlocked LONGLONG volatile *Target, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAdd64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddAcquire64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedExchangeAddRelease64( - __inout __drv_interlocked LONGLONG volatile *Addend, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeAcquire64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONGLONG -__cdecl -InterlockedCompareExchangeRelease64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64Exchange128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeAcquire128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -LONG64 -__cdecl -InterlockedCompare64ExchangeRelease128( - __inout_bcount(16) __drv_interlocked LONG64 volatile *Destination, - __in LONG64 ExchangeHigh, - __in LONG64 ExchangeLow, - __in LONG64 Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointer ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerAcquire ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedCompareExchangePointerRelease ( - __inout __drv_interlocked PVOID volatile *Destination, - __in PVOID Exchange, - __in PVOID Comperand - ); - -PVOID -__cdecl -InterlockedExchangePointer( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -PVOID -__cdecl -InterlockedExchangePointerAcquire( - __inout __drv_interlocked PVOID volatile *Target, - __in PVOID Value - ); - -LONG -__cdecl -InterlockedOr ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedOrRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedOr8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedOr8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedOr16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedOr16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedOr64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedOr64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedXor ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedXorRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedXor8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedXor8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedXor16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedXor16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedXor64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedXor64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONG -__cdecl -InterlockedAnd ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndAcquire ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -LONG -__cdecl -InterlockedAndRelease ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Value - ); - -CHAR -__cdecl -InterlockedAnd8 ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Acquire ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -CHAR -__cdecl -InterlockedAnd8Release ( - __inout __drv_interlocked CHAR volatile *Destination, - __in CHAR Value - ); - -SHORT -__cdecl -InterlockedAnd16( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Acquire ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -SHORT -__cdecl -InterlockedAnd16Release ( - __inout __drv_interlocked SHORT volatile *Destination, - __in SHORT Value - ); - -LONGLONG -__cdecl -InterlockedAnd64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Acquire ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -LONGLONG -__cdecl -InterlockedAnd64Release ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ); - -#pragma intrinsic(_InterlockedAdd) -#pragma intrinsic(_InterlockedIncrement) -#pragma intrinsic(_InterlockedIncrement_acq) -#pragma intrinsic(_InterlockedIncrement_rel) -#pragma intrinsic(_InterlockedDecrement) -#pragma intrinsic(_InterlockedDecrement_acq) -#pragma intrinsic(_InterlockedDecrement_rel) -#pragma intrinsic(_InterlockedExchange) -#pragma intrinsic(_InterlockedCompareExchange) -#pragma intrinsic(_InterlockedCompareExchange_acq) -#pragma intrinsic(_InterlockedCompareExchange_rel) -#pragma intrinsic(_InterlockedExchangeAdd) -#pragma intrinsic(_InterlockedAdd64) -#pragma intrinsic(_InterlockedIncrement64) -#pragma intrinsic(_InterlockedDecrement64) -#pragma intrinsic(_InterlockedExchange64) -#pragma intrinsic(_InterlockedExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64) -#pragma intrinsic(_InterlockedCompareExchange64_acq) -#pragma intrinsic(_InterlockedCompareExchange64_rel) -#pragma intrinsic(_InterlockedCompare64Exchange128) -#pragma intrinsic(_InterlockedCompare64Exchange128_acq) -#pragma intrinsic(_InterlockedCompare64Exchange128_rel) -#pragma intrinsic(_InterlockedExchangeAdd64) -#pragma intrinsic(_InterlockedExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer) -#pragma intrinsic(_InterlockedCompareExchangePointer_acq) -#pragma intrinsic(_InterlockedCompareExchangePointer_rel) -#pragma intrinsic(_InterlockedAdd_acq) -#pragma intrinsic(_InterlockedAdd_rel) -#pragma intrinsic(_InterlockedExchange_acq) -#pragma intrinsic(_InterlockedExchangeAdd_acq) -#pragma intrinsic(_InterlockedExchangeAdd_rel) -#pragma intrinsic(_InterlockedAdd64_acq) -#pragma intrinsic(_InterlockedAdd64_rel) -#pragma intrinsic(_InterlockedIncrement64_acq) -#pragma intrinsic(_InterlockedIncrement64_rel) -#pragma intrinsic(_InterlockedDecrement64_acq) -#pragma intrinsic(_InterlockedDecrement64_rel) -#pragma intrinsic(_InterlockedExchangeAdd64_acq) -#pragma intrinsic(_InterlockedExchangeAdd64_rel) -#pragma intrinsic(_InterlockedExchangePointer_acq) -#pragma intrinsic (_InterlockedOr) -#pragma intrinsic (_InterlockedOr_acq) -#pragma intrinsic (_InterlockedOr_rel) -#pragma intrinsic (_InterlockedOr8) -#pragma intrinsic (_InterlockedOr8_acq) -#pragma intrinsic (_InterlockedOr8_rel) -#pragma intrinsic (_InterlockedOr16) -#pragma intrinsic (_InterlockedOr16_acq) -#pragma intrinsic (_InterlockedOr16_rel) -#pragma intrinsic (_InterlockedOr64) -#pragma intrinsic (_InterlockedOr64_acq) -#pragma intrinsic (_InterlockedOr64_rel) -#pragma intrinsic (_InterlockedXor) -#pragma intrinsic (_InterlockedXor_acq) -#pragma intrinsic (_InterlockedXor_rel) -#pragma intrinsic (_InterlockedXor8) -#pragma intrinsic (_InterlockedXor8_acq) -#pragma intrinsic (_InterlockedXor8_rel) -#pragma intrinsic (_InterlockedXor16) -#pragma intrinsic (_InterlockedXor16_acq) -#pragma intrinsic (_InterlockedXor16_rel) -#pragma intrinsic (_InterlockedXor64) -#pragma intrinsic (_InterlockedXor64_acq) -#pragma intrinsic (_InterlockedXor64_rel) -#pragma intrinsic (_InterlockedAnd) -#pragma intrinsic (_InterlockedAnd_acq) -#pragma intrinsic (_InterlockedAnd_rel) -#pragma intrinsic (_InterlockedAnd8) -#pragma intrinsic (_InterlockedAnd8_acq) -#pragma intrinsic (_InterlockedAnd8_rel) -#pragma intrinsic (_InterlockedAnd16) -#pragma intrinsic (_InterlockedAnd16_acq) -#pragma intrinsic (_InterlockedAnd16_rel) -#pragma intrinsic (_InterlockedAnd64) -#pragma intrinsic (_InterlockedAnd64_acq) -#pragma intrinsic (_InterlockedAnd64_rel) - -#if !defined (InterlockedAnd64) - -#define InterlockedAnd64 InterlockedAnd64_Inline - -LONGLONG -FORCEINLINE -InterlockedAnd64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old & Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedAndAffinity InterlockedAnd64 - -#if !defined (InterlockedOr64) - -#define InterlockedOr64 InterlockedOr64_Inline - -LONGLONG -FORCEINLINE -InterlockedOr64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old | Value, - Old) != Old); - - return Old; -} - -#endif - -#define InterlockedOrAffinity InterlockedOr64 - -#if !defined (InterlockedXor64) - -#define InterlockedXor64 InterlockedXor64_Inline - -LONGLONG -FORCEINLINE -InterlockedXor64_Inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG Value - ) -{ - LONGLONG Old; - - do { - Old = *Destination; - } while (InterlockedCompareExchange64(Destination, - Old ^ Value, - Old) != Old); - - return Old; -} - -#endif - -#if !defined (InterlockedBitTestAndSet) - -#define InterlockedBitTestAndSet InterlockedBitTestAndSet_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset) - -#define InterlockedBitTestAndReset InterlockedBitTestAndReset_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndSet64) - -#define InterlockedBitTestAndSet64 InterlockedBitTestAndSet64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndSet64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedOr64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndReset64) - -#define InterlockedBitTestAndReset64 InterlockedBitTestAndReset64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndReset64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedAnd64 (&Base[Bit/(sizeof (*Base)*8)], ~tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement) - -#define InterlockedBitTestAndComplement InterlockedBitTestAndComplement_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement_Inline ( - __inout __drv_interlocked LONG volatile *Base, - __in LONG Bit - ) -{ - LONG tBit; - - tBit = 1<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#if !defined (InterlockedBitTestAndComplement64) - -#define InterlockedBitTestAndComplement64 InterlockedBitTestAndComplement64_Inline - -BOOLEAN -FORCEINLINE -InterlockedBitTestAndComplement64_Inline ( - __inout __drv_interlocked LONG64 volatile *Base, - __in LONG64 Bit - ) -{ - LONG64 tBit; - - tBit = 1i64<<(Bit & (sizeof (*Base)*8-1)); - return (BOOLEAN) ((InterlockedXor64 (&Base[Bit/(sizeof (*Base)*8)], tBit)&tBit) != 0); -} - -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) */ - - -#if defined(_IA64_) && defined(_M_IA64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -void -__break( - __in int StIIM - ); - -#pragma intrinsic (__break) - -#define BREAK_DEBUG_BASE 0x080000 -#define ASSERT_BREAKPOINT (BREAK_DEBUG_BASE+3) // Cause a STATUS_ASSERTION_FAILURE exception to be raised. - -__analysis_noreturn -FORCEINLINE -VOID -DbgRaiseAssertionFailure ( - VOID - ) - -{ - __break(ASSERT_BREAKPOINT); -} - -#endif - -#endif // _IA64_ -// -// Define an access token from a programmer's viewpoint. The structure is -// completely opaque and the programer is only allowed to have pointers -// to tokens. -// - -typedef PVOID PACCESS_TOKEN; - -// -// Pointer to a SECURITY_DESCRIPTOR opaque data type. -// - -typedef PVOID PSECURITY_DESCRIPTOR; - -// -// Define a pointer to the Security ID data type (an opaque data type) -// - -typedef PVOID PSID; - -typedef ULONG ACCESS_MASK; -typedef ACCESS_MASK *PACCESS_MASK; - - -// -// The following are masks for the predefined standard access types -// - -#define DELETE (0x00010000L) -#define READ_CONTROL (0x00020000L) -#define WRITE_DAC (0x00040000L) -#define WRITE_OWNER (0x00080000L) -#define SYNCHRONIZE (0x00100000L) - -#define STANDARD_RIGHTS_REQUIRED (0x000F0000L) - -#define STANDARD_RIGHTS_READ (READ_CONTROL) -#define STANDARD_RIGHTS_WRITE (READ_CONTROL) -#define STANDARD_RIGHTS_EXECUTE (READ_CONTROL) - -#define STANDARD_RIGHTS_ALL (0x001F0000L) - -#define SPECIFIC_RIGHTS_ALL (0x0000FFFFL) - -// -// AccessSystemAcl access type -// - -#define ACCESS_SYSTEM_SECURITY (0x01000000L) - -// -// MaximumAllowed access type -// - -#define MAXIMUM_ALLOWED (0x02000000L) - -// -// These are the generic rights. -// - -#define GENERIC_READ (0x80000000L) -#define GENERIC_WRITE (0x40000000L) -#define GENERIC_EXECUTE (0x20000000L) -#define GENERIC_ALL (0x10000000L) - - -// -// Define the generic mapping array. This is used to denote the -// mapping of each generic access right to a specific access mask. -// - -typedef struct _GENERIC_MAPPING { - ACCESS_MASK GenericRead; - ACCESS_MASK GenericWrite; - ACCESS_MASK GenericExecute; - ACCESS_MASK GenericAll; -} GENERIC_MAPPING; -typedef GENERIC_MAPPING *PGENERIC_MAPPING; - - - -//////////////////////////////////////////////////////////////////////// -// // -// LUID_AND_ATTRIBUTES // -// // -//////////////////////////////////////////////////////////////////////// -// -// - - -#include - -typedef struct _LUID_AND_ATTRIBUTES { - LUID Luid; - ULONG Attributes; - } LUID_AND_ATTRIBUTES, * PLUID_AND_ATTRIBUTES; -typedef LUID_AND_ATTRIBUTES LUID_AND_ATTRIBUTES_ARRAY[ANYSIZE_ARRAY]; -typedef LUID_AND_ATTRIBUTES_ARRAY *PLUID_AND_ATTRIBUTES_ARRAY; - -#include - -// This is the *current* ACL revision - -#define ACL_REVISION (2) -#define ACL_REVISION_DS (4) - -// This is the history of ACL revisions. Add a new one whenever -// ACL_REVISION is updated - -#define ACL_REVISION1 (1) -#define MIN_ACL_REVISION ACL_REVISION2 -#define ACL_REVISION2 (2) -#define ACL_REVISION3 (3) -#define ACL_REVISION4 (4) -#define MAX_ACL_REVISION ACL_REVISION4 - -typedef struct _ACL { - UCHAR AclRevision; - UCHAR Sbz1; - USHORT AclSize; - USHORT AceCount; - USHORT Sbz2; -} ACL; -typedef ACL *PACL; - -// -// Current security descriptor revision value -// - -#define SECURITY_DESCRIPTOR_REVISION (1) -#define SECURITY_DESCRIPTOR_REVISION1 (1) - -// -// Privilege attributes -// - -#define SE_PRIVILEGE_ENABLED_BY_DEFAULT (0x00000001L) -#define SE_PRIVILEGE_ENABLED (0x00000002L) -#define SE_PRIVILEGE_REMOVED (0X00000004L) -#define SE_PRIVILEGE_USED_FOR_ACCESS (0x80000000L) - -#define SE_PRIVILEGE_VALID_ATTRIBUTES (SE_PRIVILEGE_ENABLED_BY_DEFAULT | \ - SE_PRIVILEGE_ENABLED | \ - SE_PRIVILEGE_REMOVED | \ - SE_PRIVILEGE_USED_FOR_ACCESS) - - -// -// Privilege Set Control flags -// - -#define PRIVILEGE_SET_ALL_NECESSARY (1) - -// -// Privilege Set - This is defined for a privilege set of one. -// If more than one privilege is needed, then this structure -// will need to be allocated with more space. -// -// Note: don't change this structure without fixing the INITIAL_PRIVILEGE_SET -// structure (defined in se.h) -// - -typedef struct _PRIVILEGE_SET { - ULONG PrivilegeCount; - ULONG Control; - LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY]; - } PRIVILEGE_SET, * PPRIVILEGE_SET; - - -// -// These must be converted to LUIDs before use. -// - -#define SE_MIN_WELL_KNOWN_PRIVILEGE (2L) -#define SE_CREATE_TOKEN_PRIVILEGE (2L) -#define SE_ASSIGNPRIMARYTOKEN_PRIVILEGE (3L) -#define SE_LOCK_MEMORY_PRIVILEGE (4L) -#define SE_INCREASE_QUOTA_PRIVILEGE (5L) - -#define SE_MACHINE_ACCOUNT_PRIVILEGE (6L) -#define SE_TCB_PRIVILEGE (7L) -#define SE_SECURITY_PRIVILEGE (8L) -#define SE_TAKE_OWNERSHIP_PRIVILEGE (9L) -#define SE_LOAD_DRIVER_PRIVILEGE (10L) -#define SE_SYSTEM_PROFILE_PRIVILEGE (11L) -#define SE_SYSTEMTIME_PRIVILEGE (12L) -#define SE_PROF_SINGLE_PROCESS_PRIVILEGE (13L) -#define SE_INC_BASE_PRIORITY_PRIVILEGE (14L) -#define SE_CREATE_PAGEFILE_PRIVILEGE (15L) -#define SE_CREATE_PERMANENT_PRIVILEGE (16L) -#define SE_BACKUP_PRIVILEGE (17L) -#define SE_RESTORE_PRIVILEGE (18L) -#define SE_SHUTDOWN_PRIVILEGE (19L) -#define SE_DEBUG_PRIVILEGE (20L) -#define SE_AUDIT_PRIVILEGE (21L) -#define SE_SYSTEM_ENVIRONMENT_PRIVILEGE (22L) -#define SE_CHANGE_NOTIFY_PRIVILEGE (23L) -#define SE_REMOTE_SHUTDOWN_PRIVILEGE (24L) -#define SE_UNDOCK_PRIVILEGE (25L) -#define SE_SYNC_AGENT_PRIVILEGE (26L) -#define SE_ENABLE_DELEGATION_PRIVILEGE (27L) -#define SE_MANAGE_VOLUME_PRIVILEGE (28L) -#define SE_IMPERSONATE_PRIVILEGE (29L) -#define SE_CREATE_GLOBAL_PRIVILEGE (30L) -#define SE_TRUSTED_CREDMAN_ACCESS_PRIVILEGE (31L) -#define SE_RELABEL_PRIVILEGE (32L) -#define SE_INC_WORKING_SET_PRIVILEGE (33L) -#define SE_TIME_ZONE_PRIVILEGE (34L) -#define SE_CREATE_SYMBOLIC_LINK_PRIVILEGE (35L) -#define SE_MAX_WELL_KNOWN_PRIVILEGE (SE_CREATE_SYMBOLIC_LINK_PRIVILEGE) - -// -// Impersonation Level -// -// Impersonation level is represented by a pair of bits in Windows. -// If a new impersonation level is added or lowest value is changed from -// 0 to something else, fix the Windows CreateFile call. -// - -typedef enum _SECURITY_IMPERSONATION_LEVEL { - SecurityAnonymous, - SecurityIdentification, - SecurityImpersonation, - SecurityDelegation - } SECURITY_IMPERSONATION_LEVEL, * PSECURITY_IMPERSONATION_LEVEL; - -#define SECURITY_MAX_IMPERSONATION_LEVEL SecurityDelegation -#define SECURITY_MIN_IMPERSONATION_LEVEL SecurityAnonymous -#define DEFAULT_IMPERSONATION_LEVEL SecurityImpersonation -#define VALID_IMPERSONATION_LEVEL(L) (((L) >= SECURITY_MIN_IMPERSONATION_LEVEL) && ((L) <= SECURITY_MAX_IMPERSONATION_LEVEL)) -// -// Security Tracking Mode -// - -#define SECURITY_DYNAMIC_TRACKING (TRUE) -#define SECURITY_STATIC_TRACKING (FALSE) - -typedef BOOLEAN SECURITY_CONTEXT_TRACKING_MODE, - * PSECURITY_CONTEXT_TRACKING_MODE; - - - -// -// Quality Of Service -// - -typedef struct _SECURITY_QUALITY_OF_SERVICE { - ULONG Length; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - SECURITY_CONTEXT_TRACKING_MODE ContextTrackingMode; - BOOLEAN EffectiveOnly; - } SECURITY_QUALITY_OF_SERVICE, * PSECURITY_QUALITY_OF_SERVICE; - - -// -// Used to represent information related to a thread impersonation -// - -typedef struct _SE_IMPERSONATION_STATE { - PACCESS_TOKEN Token; - BOOLEAN CopyOnOpen; - BOOLEAN EffectiveOnly; - SECURITY_IMPERSONATION_LEVEL Level; -} SE_IMPERSONATION_STATE, *PSE_IMPERSONATION_STATE; - - -typedef ULONG SECURITY_INFORMATION, *PSECURITY_INFORMATION; - -#define OWNER_SECURITY_INFORMATION (0x00000001L) -#define GROUP_SECURITY_INFORMATION (0x00000002L) -#define DACL_SECURITY_INFORMATION (0x00000004L) -#define SACL_SECURITY_INFORMATION (0x00000008L) -#define LABEL_SECURITY_INFORMATION (0x00000010L) - -#define PROTECTED_DACL_SECURITY_INFORMATION (0x80000000L) -#define PROTECTED_SACL_SECURITY_INFORMATION (0x40000000L) -#define UNPROTECTED_DACL_SECURITY_INFORMATION (0x20000000L) -#define UNPROTECTED_SACL_SECURITY_INFORMATION (0x10000000L) - - -#ifndef _NTLSA_IFS_ - - -// -// All of this stuff (between the Ifndef _NTLSA_AUDIT_ and its endif) were not -// present in NTIFS prior to Windows Server 2003 SP1. All of the definitions however -// exist down to windows 2000 (except for the few exceptions noted in the code). -// - -#ifndef _NTLSA_AUDIT_ -#define _NTLSA_AUDIT_ - -///////////////////////////////////////////////////////////////////////// -// // -// Data types related to Auditing // -// // -///////////////////////////////////////////////////////////////////////// - - -// -// The following enumerated type is used between the reference monitor and -// LSA in the generation of audit messages. It is used to indicate the -// type of data being passed as a parameter from the reference monitor -// to LSA. LSA is responsible for transforming the specified data type -// into a set of unicode strings that are added to the event record in -// the audit log. -// - -typedef enum _SE_ADT_PARAMETER_TYPE { - - SeAdtParmTypeNone = 0, //Produces 1 parameter - //Received value: - // - // None. - // - //Results in: - // - // a unicode string containing "-". - // - //Note: This is typically used to - // indicate that a parameter value - // was not available. - // - - SeAdtParmTypeString, //Produces 1 parameter. - //Received Value: - // - // Unicode String (variable length) - // - //Results in: - // - // No transformation. The string - // entered into the event record as - // received. - // - // The Address value of the audit info - // should be a pointer to a UNICODE_STRING - // structure. - - - - SeAdtParmTypeFileSpec, //Produces 1 parameter. - //Received value: - // - // Unicode string containing a file or - // directory name. - // - //Results in: - // - // Unicode string with the prefix of the - // file's path replaced by a drive letter - // if possible. - // - - - - - SeAdtParmTypeUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value. - - - SeAdtParmTypeSid, //Produces 1 parameter. - //Received value: - // - // SID (variable length) - // - //Results in: - // - // String representation of SID - // - - - - - SeAdtParmTypeLogonId, //Produces 4 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Sid string - // param 2: Username string - // param 3: domain name string - // param 4: Logon ID (Luid) string - - - SeAdtParmTypeNoLogonId, //Produces 3 parameters. - //Received value: - // - // None. - // - //Results in: - // - // param 1: "-" - // param 2: "-" - // param 3: "-" - // param 4: "-" - // - //Note: - // - // This type is used when a logon ID - // is needed, but one is not available - // to pass. For example, if an - // impersonation logon ID is expected - // but the subject is not impersonating - // anyone. - // - - SeAdtParmTypeAccessMask, //Produces 1 parameter with formatting. - //Received value: - // - // ACCESS_MASK followed by - // a Unicode string. The unicode - // string contains the name of the - // type of object the access mask - // applies to. The event's source - // further qualifies the object type. - // - //Results in: - // - // formatted unicode string built to - // take advantage of the specified - // source's parameter message file. - // - //Note: - // - // An access mask containing three - // access types for a Widget object - // type (defined by the Foozle source) - // might end up looking like: - // - // %%1062\n\t\t%1066\n\t\t%%601 - // - // The %%numbers are signals to the - // event viewer to perform parameter - // substitution before display. - // - - - - SeAdtParmTypePrivs, //Produces 1 parameter with formatting. - //Received value: - // - //Results in: - // - // formatted unicode string similar to - // that for access types. Each priv - // will be formatted to be displayed - // on its own line. E.g., - // - // %%642\n\t\t%%651\n\t\t%%655 - // - - SeAdtParmTypeObjectTypes, //Produces 10 parameters with formatting. - //Received value: - // - // Produces a list a stringized GUIDS along - // with information similar to that for - // an access mask. - - SeAdtParmTypeHexUlong, //Produces 1 parameter - //Received value: - // - // Ulong - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// In W2k this value did not exist, it was ParmTypeLUID - - SeAdtParmTypePtr, //Produces 1 parameter - //Received value: - // - // pointer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - -// -// Everything below exists only in Windows XP and greater -// - - SeAdtParmTypeTime, //Produces 2 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time. - - // - SeAdtParmTypeGuid, //Produces 1 parameter - //Received value: - // - // GUID pointer - // - //Results in: - // - // Unicode string representation of GUID - // {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} - // - -// -// Everything below exists only in Windows Server 2003 and Greater -// - - SeAdtParmTypeLuid, // - //Produces 1 parameter - //Received value: - // - // LUID - // - //Results in: - // - // Hex LUID - // - - SeAdtParmTypeHexInt64, //Produces 1 parameter - //Received value: - // - // 64 bit integer - // - //Results in: - // - // Unicode string representation of - // unsigned integer value in hexadecimal. - - SeAdtParmTypeStringList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_STRING_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the strings in the list - - SeAdtParmTypeSidList, //Produces 1 parameter - //Received value: - // - // ptr to LSAP_ADT_SID_LIST - // - //Results in: - // - // Unicode string representation of - // concatenation of the SIDs in the list - - SeAdtParmTypeDuration, //Produces 1 parameters - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // a duration. - - SeAdtParmTypeUserAccountControl,//Produces 3 parameters - //Received value: - // - // old and new UserAccountControl values - // - //Results in: - // - // Unicode string representations of - // the flags in UserAccountControl. - // 1 - old value in hex - // 2 - new value in hex - // 3 - difference as strings - - SeAdtParmTypeNoUac, //Produces 3 parameters - //Received value: - // - // none - // - //Results in: - // - // Three dashes ('-') as unicode strings. - - SeAdtParmTypeMessage, //Produces 1 Parameter - //Received value: - // - // ULONG (MessageNo from msobjs.mc) - // - //Results in: - // - // Unicode string representation of - // %%MessageNo which the event viewer - // will replace with the message string - // from msobjs.mc - - SeAdtParmTypeDateTime, //Produces 1 Parameter - //Received value: - // - // LARGE_INTEGER - // - //Results in: - // - // Unicode string representation of - // date and time (in _one_ string). - - SeAdtParmTypeSockAddr, // Produces 2 parameters - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IP address string - // param 2: Port number string - // - -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeSD, // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure - // - // Results in: - // - // SDDL string representation of SD - // - - SeAdtParmTypeLogonHours, // Produces 1 parameters - // - // Received value: - // - // pointer to LOGON_HOURS - // structure - // - // Results in: - // - // String representation of allowed logon hours - // - - SeAdtParmTypeLogonIdNoSid, //Produces 3 parameters. - //Received Value: - // - // LUID (fixed length) - // - //Results in: - // - // param 1: Username string - // param 2: domain name string - // param 3: Logon ID (Luid) string - - SeAdtParmTypeUlongNoConv, // Produces 1 parameter. - // Received Value: - // Ulong - // - //Results in: - // Not converted to string - // - - SeAdtParmTypeSockAddrNoPort, // Produces 1 parameter - // - // Received value: - // - // pointer to SOCKADDR_IN/SOCKADDR_IN6 - // structure - // - // Results in: - // - // param 1: IPv4/IPv6 address string - // -// -// Everything below this exists only in Windows Server 2008 and greater -// - - SeAdtParmTypeAccessReason // Produces 1 parameters - // - // Received value: - // - // pointer to SECURITY_DESCRIPTOR - // structure followed by the reason code. - // The reason code could be the index - // of the ACE in the SD or privilege ID or - // other reason codes. - // - // Results in: - // - // String representation of the access reason. - // - -} SE_ADT_PARAMETER_TYPE, *PSE_ADT_PARAMETER_TYPE; - -#ifndef GUID_DEFINED -#include -#endif /* GUID_DEFINED */ - -typedef struct _SE_ADT_OBJECT_TYPE { - GUID ObjectType; - USHORT Flags; -#define SE_ADT_OBJECT_ONLY 0x1 - USHORT Level; - ACCESS_MASK AccessMask; -} SE_ADT_OBJECT_TYPE, *PSE_ADT_OBJECT_TYPE; - -typedef struct _SE_ADT_PARAMETER_ARRAY_ENTRY { - - SE_ADT_PARAMETER_TYPE Type; - ULONG Length; - ULONG_PTR Data[2]; - PVOID Address; - -} SE_ADT_PARAMETER_ARRAY_ENTRY, *PSE_ADT_PARAMETER_ARRAY_ENTRY; - - -typedef struct _SE_ADT_ACCESS_REASON{ - ACCESS_MASK AccessMask; - ULONG AccessReasons[32]; - ULONG ObjectTypeIndex; - ULONG AccessGranted; - PSECURITY_DESCRIPTOR SecurityDescriptor; // multple SDs may be stored here in self-relative way. -} SE_ADT_ACCESS_REASON, *PSE_ADT_ACCESS_REASON; - - - -// -// Structure that will be passed between the Reference Monitor and LSA -// to transmit auditing information. -// - -#define SE_MAX_AUDIT_PARAMETERS 32 -#define SE_MAX_GENERIC_AUDIT_PARAMETERS 28 - -typedef struct _SE_ADT_PARAMETER_ARRAY { - - ULONG CategoryId; - ULONG AuditId; - ULONG ParameterCount; - ULONG Length; - USHORT FlatSubCategoryId; - USHORT Type; - ULONG Flags; - SE_ADT_PARAMETER_ARRAY_ENTRY Parameters[ SE_MAX_AUDIT_PARAMETERS ]; - -} SE_ADT_PARAMETER_ARRAY, *PSE_ADT_PARAMETER_ARRAY; - - -#define SE_ADT_PARAMETERS_SELF_RELATIVE 0x00000001 -#define SE_ADT_PARAMETERS_SEND_TO_LSA 0x00000002 -#define SE_ADT_PARAMETER_EXTENSIBLE_AUDIT 0x00000004 -#define SE_ADT_PARAMETER_GENERIC_AUDIT 0x00000008 -#define SE_ADT_PARAMETER_WRITE_SYNCHRONOUS 0x00000010 - - -// -// This macro only existed in Windows Server 2008 and after -// - -#define LSAP_SE_ADT_PARAMETER_ARRAY_TRUE_SIZE(AuditParameters) \ - ( sizeof(SE_ADT_PARAMETER_ARRAY) - \ - sizeof(SE_ADT_PARAMETER_ARRAY_ENTRY) * \ - (SE_MAX_AUDIT_PARAMETERS - AuditParameters->ParameterCount) ) - -#endif // _NTLSA_AUDIT_ - - -#endif // _NTLSA_IFS_ - -// -// Define the various device type values. Note that values used by Microsoft -// Corporation are in the range 0-32767, and 32768-65535 are reserved for use -// by customers. -// - -#define DEVICE_TYPE ULONG - -#define FILE_DEVICE_BEEP 0x00000001 -#define FILE_DEVICE_CD_ROM 0x00000002 -#define FILE_DEVICE_CD_ROM_FILE_SYSTEM 0x00000003 -#define FILE_DEVICE_CONTROLLER 0x00000004 -#define FILE_DEVICE_DATALINK 0x00000005 -#define FILE_DEVICE_DFS 0x00000006 -#define FILE_DEVICE_DISK 0x00000007 -#define FILE_DEVICE_DISK_FILE_SYSTEM 0x00000008 -#define FILE_DEVICE_FILE_SYSTEM 0x00000009 -#define FILE_DEVICE_INPORT_PORT 0x0000000a -#define FILE_DEVICE_KEYBOARD 0x0000000b -#define FILE_DEVICE_MAILSLOT 0x0000000c -#define FILE_DEVICE_MIDI_IN 0x0000000d -#define FILE_DEVICE_MIDI_OUT 0x0000000e -#define FILE_DEVICE_MOUSE 0x0000000f -#define FILE_DEVICE_MULTI_UNC_PROVIDER 0x00000010 -#define FILE_DEVICE_NAMED_PIPE 0x00000011 -#define FILE_DEVICE_NETWORK 0x00000012 -#define FILE_DEVICE_NETWORK_BROWSER 0x00000013 -#define FILE_DEVICE_NETWORK_FILE_SYSTEM 0x00000014 -#define FILE_DEVICE_NULL 0x00000015 -#define FILE_DEVICE_PARALLEL_PORT 0x00000016 -#define FILE_DEVICE_PHYSICAL_NETCARD 0x00000017 -#define FILE_DEVICE_PRINTER 0x00000018 -#define FILE_DEVICE_SCANNER 0x00000019 -#define FILE_DEVICE_SERIAL_MOUSE_PORT 0x0000001a -#define FILE_DEVICE_SERIAL_PORT 0x0000001b -#define FILE_DEVICE_SCREEN 0x0000001c -#define FILE_DEVICE_SOUND 0x0000001d -#define FILE_DEVICE_STREAMS 0x0000001e -#define FILE_DEVICE_TAPE 0x0000001f -#define FILE_DEVICE_TAPE_FILE_SYSTEM 0x00000020 -#define FILE_DEVICE_TRANSPORT 0x00000021 -#define FILE_DEVICE_UNKNOWN 0x00000022 -#define FILE_DEVICE_VIDEO 0x00000023 -#define FILE_DEVICE_VIRTUAL_DISK 0x00000024 -#define FILE_DEVICE_WAVE_IN 0x00000025 -#define FILE_DEVICE_WAVE_OUT 0x00000026 -#define FILE_DEVICE_8042_PORT 0x00000027 -#define FILE_DEVICE_NETWORK_REDIRECTOR 0x00000028 -#define FILE_DEVICE_BATTERY 0x00000029 -#define FILE_DEVICE_BUS_EXTENDER 0x0000002a -#define FILE_DEVICE_MODEM 0x0000002b -#define FILE_DEVICE_VDM 0x0000002c -#define FILE_DEVICE_MASS_STORAGE 0x0000002d -#define FILE_DEVICE_SMB 0x0000002e -#define FILE_DEVICE_KS 0x0000002f -#define FILE_DEVICE_CHANGER 0x00000030 -#define FILE_DEVICE_SMARTCARD 0x00000031 -#define FILE_DEVICE_ACPI 0x00000032 -#define FILE_DEVICE_DVD 0x00000033 -#define FILE_DEVICE_FULLSCREEN_VIDEO 0x00000034 -#define FILE_DEVICE_DFS_FILE_SYSTEM 0x00000035 -#define FILE_DEVICE_DFS_VOLUME 0x00000036 -#define FILE_DEVICE_SERENUM 0x00000037 -#define FILE_DEVICE_TERMSRV 0x00000038 -#define FILE_DEVICE_KSEC 0x00000039 -#define FILE_DEVICE_FIPS 0x0000003A -#define FILE_DEVICE_INFINIBAND 0x0000003B -#define FILE_DEVICE_VMBUS 0x0000003E -#define FILE_DEVICE_CRYPT_PROVIDER 0x0000003F -#define FILE_DEVICE_WPD 0x00000040 -#define FILE_DEVICE_BLUETOOTH 0x00000041 -#define FILE_DEVICE_MT_COMPOSITE 0x00000042 -#define FILE_DEVICE_MT_TRANSPORT 0x00000043 -#define FILE_DEVICE_BIOMETRIC 0x00000044 -#define FILE_DEVICE_PMI 0x00000045 - -// -// Macro definition for defining IOCTL and FSCTL function control codes. Note -// that function codes 0-2047 are reserved for Microsoft Corporation, and -// 2048-4095 are reserved for customers. -// - -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ - ((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ -) - -// -// Macro to extract device type out of the device io control code -// -#define DEVICE_TYPE_FROM_CTL_CODE(ctrlCode) (((ULONG)(ctrlCode & 0xffff0000)) >> 16) - -// -// Macro to extract buffering method out of the device io control code -// -#define METHOD_FROM_CTL_CODE(ctrlCode) ((ULONG)(ctrlCode & 3)) - -// -// Define the method codes for how buffers are passed for I/O and FS controls -// - -#define METHOD_BUFFERED 0 -#define METHOD_IN_DIRECT 1 -#define METHOD_OUT_DIRECT 2 -#define METHOD_NEITHER 3 - -// -// Define some easier to comprehend aliases: -// METHOD_DIRECT_TO_HARDWARE (writes, aka METHOD_IN_DIRECT) -// METHOD_DIRECT_FROM_HARDWARE (reads, aka METHOD_OUT_DIRECT) -// - -#define METHOD_DIRECT_TO_HARDWARE METHOD_IN_DIRECT -#define METHOD_DIRECT_FROM_HARDWARE METHOD_OUT_DIRECT - -// -// Define the access check value for any access -// -// -// The FILE_READ_ACCESS and FILE_WRITE_ACCESS constants are also defined in -// ntioapi.h as FILE_READ_DATA and FILE_WRITE_DATA. The values for these -// constants *MUST* always be in sync. -// -// -// FILE_SPECIAL_ACCESS is checked by the NT I/O system the same as FILE_ANY_ACCESS. -// The file systems, however, may add additional access checks for I/O and FS controls -// that use this value. -// - - -#define FILE_ANY_ACCESS 0 -#define FILE_SPECIAL_ACCESS (FILE_ANY_ACCESS) -#define FILE_READ_ACCESS ( 0x0001 ) // file & pipe -#define FILE_WRITE_ACCESS ( 0x0002 ) // file & pipe - - - -// -// Define access rights to files and directories -// - -// -// The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in -// devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these -// constants *MUST* always be in sync. -// The values are redefined in devioctl.h because they must be available to -// both DOS and NT. -// - -#define FILE_READ_DATA ( 0x0001 ) // file & pipe -#define FILE_LIST_DIRECTORY ( 0x0001 ) // directory - -#define FILE_WRITE_DATA ( 0x0002 ) // file & pipe -#define FILE_ADD_FILE ( 0x0002 ) // directory - -#define FILE_APPEND_DATA ( 0x0004 ) // file -#define FILE_ADD_SUBDIRECTORY ( 0x0004 ) // directory -#define FILE_CREATE_PIPE_INSTANCE ( 0x0004 ) // named pipe - - -#define FILE_READ_EA ( 0x0008 ) // file & directory - -#define FILE_WRITE_EA ( 0x0010 ) // file & directory - -#define FILE_EXECUTE ( 0x0020 ) // file -#define FILE_TRAVERSE ( 0x0020 ) // directory - -#define FILE_DELETE_CHILD ( 0x0040 ) // directory - -#define FILE_READ_ATTRIBUTES ( 0x0080 ) // all - -#define FILE_WRITE_ATTRIBUTES ( 0x0100 ) // all - -#define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF) - -#define FILE_GENERIC_READ (STANDARD_RIGHTS_READ |\ - FILE_READ_DATA |\ - FILE_READ_ATTRIBUTES |\ - FILE_READ_EA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - FILE_WRITE_DATA |\ - FILE_WRITE_ATTRIBUTES |\ - FILE_WRITE_EA |\ - FILE_APPEND_DATA |\ - SYNCHRONIZE) - - -#define FILE_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - FILE_READ_ATTRIBUTES |\ - FILE_EXECUTE |\ - SYNCHRONIZE) - - - - -// -// Define share access rights to files and directories -// - -#define FILE_SHARE_READ 0x00000001 -#define FILE_SHARE_WRITE 0x00000002 -#define FILE_SHARE_DELETE 0x00000004 -#define FILE_SHARE_VALID_FLAGS 0x00000007 - -// -// Define the file attributes values -// -// Note: 0x00000008 is reserved for use for the old DOS VOLID (volume ID) -// and is therefore not considered valid in NT. -// -// Note: Note also that the order of these flags is set to allow both the -// FAT and the Pinball File Systems to directly set the attributes -// flags in attributes words without having to pick each flag out -// individually. The order of these flags should not be changed! -// - -#define FILE_ATTRIBUTE_READONLY 0x00000001 -#define FILE_ATTRIBUTE_HIDDEN 0x00000002 -#define FILE_ATTRIBUTE_SYSTEM 0x00000004 -//OLD DOS VOLID 0x00000008 - -#define FILE_ATTRIBUTE_DIRECTORY 0x00000010 -#define FILE_ATTRIBUTE_ARCHIVE 0x00000020 -#define FILE_ATTRIBUTE_DEVICE 0x00000040 -#define FILE_ATTRIBUTE_NORMAL 0x00000080 - -#define FILE_ATTRIBUTE_TEMPORARY 0x00000100 -#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200 -#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 -#define FILE_ATTRIBUTE_COMPRESSED 0x00000800 - -#define FILE_ATTRIBUTE_OFFLINE 0x00001000 -#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000 -#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000 - -#define FILE_ATTRIBUTE_VIRTUAL 0x00010000 - -#define FILE_ATTRIBUTE_VALID_FLAGS 0x00007fb7 -#define FILE_ATTRIBUTE_VALID_SET_FLAGS 0x000031a7 - -// -// Define the create disposition values -// - -#define FILE_SUPERSEDE 0x00000000 -#define FILE_OPEN 0x00000001 -#define FILE_CREATE 0x00000002 -#define FILE_OPEN_IF 0x00000003 -#define FILE_OVERWRITE 0x00000004 -#define FILE_OVERWRITE_IF 0x00000005 -#define FILE_MAXIMUM_DISPOSITION 0x00000005 - -// -// Define the create/open option flags -// - -#define FILE_DIRECTORY_FILE 0x00000001 -#define FILE_WRITE_THROUGH 0x00000002 -#define FILE_SEQUENTIAL_ONLY 0x00000004 -#define FILE_NO_INTERMEDIATE_BUFFERING 0x00000008 - -#define FILE_SYNCHRONOUS_IO_ALERT 0x00000010 -#define FILE_SYNCHRONOUS_IO_NONALERT 0x00000020 -#define FILE_NON_DIRECTORY_FILE 0x00000040 -#define FILE_CREATE_TREE_CONNECTION 0x00000080 - -#define FILE_COMPLETE_IF_OPLOCKED 0x00000100 -#define FILE_NO_EA_KNOWLEDGE 0x00000200 -#define FILE_OPEN_REMOTE_INSTANCE 0x00000400 -#define FILE_RANDOM_ACCESS 0x00000800 - -#define FILE_DELETE_ON_CLOSE 0x00001000 -#define FILE_OPEN_BY_FILE_ID 0x00002000 -#define FILE_OPEN_FOR_BACKUP_INTENT 0x00004000 -#define FILE_NO_COMPRESSION 0x00008000 - -#if (NTDDI_VERSION >= NTDDI_WIN7) -#define FILE_OPEN_REQUIRING_OPLOCK 0x00010000 -#define FILE_DISALLOW_EXCLUSIVE 0x00020000 -#endif /* NTDDI_VERSION >= NTDDI_WIN7 */ - -#define FILE_RESERVE_OPFILTER 0x00100000 -#define FILE_OPEN_REPARSE_POINT 0x00200000 -#define FILE_OPEN_NO_RECALL 0x00400000 -#define FILE_OPEN_FOR_FREE_SPACE_QUERY 0x00800000 - - -#define FILE_VALID_OPTION_FLAGS 0x00ffffff -#define FILE_VALID_PIPE_OPTION_FLAGS 0x00000032 -#define FILE_VALID_MAILSLOT_OPTION_FLAGS 0x00000032 -#define FILE_VALID_SET_FLAGS 0x00000036 - -// -// Define the I/O status information return values for NtCreateFile/NtOpenFile -// - -#define FILE_SUPERSEDED 0x00000000 -#define FILE_OPENED 0x00000001 -#define FILE_CREATED 0x00000002 -#define FILE_OVERWRITTEN 0x00000003 -#define FILE_EXISTS 0x00000004 -#define FILE_DOES_NOT_EXIST 0x00000005 - -// -// Define special ByteOffset parameters for read and write operations -// - -#define FILE_WRITE_TO_END_OF_FILE 0xffffffff -#define FILE_USE_FILE_POINTER_POSITION 0xfffffffe - -// -// Define alignment requirement values -// - -#define FILE_BYTE_ALIGNMENT 0x00000000 -#define FILE_WORD_ALIGNMENT 0x00000001 -#define FILE_LONG_ALIGNMENT 0x00000003 -#define FILE_QUAD_ALIGNMENT 0x00000007 -#define FILE_OCTA_ALIGNMENT 0x0000000f -#define FILE_32_BYTE_ALIGNMENT 0x0000001f -#define FILE_64_BYTE_ALIGNMENT 0x0000003f -#define FILE_128_BYTE_ALIGNMENT 0x0000007f -#define FILE_256_BYTE_ALIGNMENT 0x000000ff -#define FILE_512_BYTE_ALIGNMENT 0x000001ff - -// -// Define the maximum length of a filename string -// - -#define MAXIMUM_FILENAME_LENGTH 256 - -// -// Define the various device characteristics flags -// - -#define FILE_REMOVABLE_MEDIA 0x00000001 -#define FILE_READ_ONLY_DEVICE 0x00000002 -#define FILE_FLOPPY_DISKETTE 0x00000004 -#define FILE_WRITE_ONCE_MEDIA 0x00000008 -#define FILE_REMOTE_DEVICE 0x00000010 -#define FILE_DEVICE_IS_MOUNTED 0x00000020 -#define FILE_VIRTUAL_VOLUME 0x00000040 -#define FILE_AUTOGENERATED_DEVICE_NAME 0x00000080 -#define FILE_DEVICE_SECURE_OPEN 0x00000100 -#define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800 -#define FILE_CHARACTERISTIC_TS_DEVICE 0x00001000 -#define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000 - -// -// Define the base asynchronous I/O argument types -// - -typedef struct _IO_STATUS_BLOCK { - union { - NTSTATUS Status; - PVOID Pointer; - } DUMMYUNIONNAME; - - ULONG_PTR Information; -} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; - -#if defined(_WIN64) - -typedef struct _IO_STATUS_BLOCK32 { - NTSTATUS Status; - ULONG Information; -} IO_STATUS_BLOCK32, *PIO_STATUS_BLOCK32; - -#endif - -// -// Define an Asynchronous Procedure Call from I/O viewpoint -// - -typedef -VOID -(NTAPI *PIO_APC_ROUTINE) ( - __in PVOID ApcContext, - __in PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG Reserved - ); - -#define PIO_APC_ROUTINE_DEFINED - -// -// Define the session states and events -// -typedef enum _IO_SESSION_EVENT { - IoSessionEventIgnore = 0, - IoSessionEventCreated, // 1 - IoSessionEventTerminated, // 2 - IoSessionEventConnected, // 3 - IoSessionEventDisconnected, // 4 - IoSessionEventLogon, // 5 - IoSessionEventLogoff, // 6 - IoSessionEventMax -} IO_SESSION_EVENT, *PIO_SESSION_EVENT; - -typedef enum _IO_SESSION_STATE { - IoSessionStateCreated = 1, - IoSessionStateInitialized, // 2 - IoSessionStateConnected, // 3 - IoSessionStateDisconnected, // 4 - IoSessionStateDisconnectedLoggedOn, // 5 - IoSessionStateLoggedOn, // 6 - IoSessionStateLoggedOff, // 7 - IoSessionStateTerminated, // 8 - IoSessionStateMax -} IO_SESSION_STATE, *PIO_SESSION_STATE; - -// -// Define masks that determine which events a driver that registers for -// callbacks care about -// - -#define IO_SESSION_STATE_ALL_EVENTS 0xffffffff -#define IO_SESSION_STATE_CREATION_EVENT 0x00000001 -#define IO_SESSION_STATE_TERMINATION_EVENT 0x00000002 -#define IO_SESSION_STATE_CONNECT_EVENT 0x00000004 -#define IO_SESSION_STATE_DISCONNECT_EVENT 0x00000008 -#define IO_SESSION_STATE_LOGON_EVENT 0x00000010 -#define IO_SESSION_STATE_LOGOFF_EVENT 0x00000020 - -#define IO_SESSION_STATE_VALID_EVENT_MASK 0x0000003f - -#define IO_SESSION_MAX_PAYLOAD_SIZE 256L - -// -// Payload structures -// - -// IoSessionEventConnected -typedef struct _IO_SESSION_CONNECT_INFO { - ULONG SessionId; - BOOLEAN LocalSession; -} IO_SESSION_CONNECT_INFO, *PIO_SESSION_CONNECT_INFO; - - -// -// Define the file information class values -// -// WARNING: The order of the following values are assumed by the I/O system. -// Any changes made here should be reflected there as well. -// - -typedef enum _FILE_INFORMATION_CLASS { - FileDirectoryInformation = 1, - FileFullDirectoryInformation, // 2 - FileBothDirectoryInformation, // 3 - FileBasicInformation, // 4 - FileStandardInformation, // 5 - FileInternalInformation, // 6 - FileEaInformation, // 7 - FileAccessInformation, // 8 - FileNameInformation, // 9 - FileRenameInformation, // 10 - FileLinkInformation, // 11 - FileNamesInformation, // 12 - FileDispositionInformation, // 13 - FilePositionInformation, // 14 - FileFullEaInformation, // 15 - FileModeInformation, // 16 - FileAlignmentInformation, // 17 - FileAllInformation, // 18 - FileAllocationInformation, // 19 - FileEndOfFileInformation, // 20 - FileAlternateNameInformation, // 21 - FileStreamInformation, // 22 - FilePipeInformation, // 23 - FilePipeLocalInformation, // 24 - FilePipeRemoteInformation, // 25 - FileMailslotQueryInformation, // 26 - FileMailslotSetInformation, // 27 - FileCompressionInformation, // 28 - FileObjectIdInformation, // 29 - FileCompletionInformation, // 30 - FileMoveClusterInformation, // 31 - FileQuotaInformation, // 32 - FileReparsePointInformation, // 33 - FileNetworkOpenInformation, // 34 - FileAttributeTagInformation, // 35 - FileTrackingInformation, // 36 - FileIdBothDirectoryInformation, // 37 - FileIdFullDirectoryInformation, // 38 - FileValidDataLengthInformation, // 39 - FileShortNameInformation, // 40 - FileIoCompletionNotificationInformation, // 41 - FileIoStatusBlockRangeInformation, // 42 - FileIoPriorityHintInformation, // 43 - FileSfioReserveInformation, // 44 - FileSfioVolumeInformation, // 45 - FileHardLinkInformation, // 46 - FileProcessIdsUsingFileInformation, // 47 - FileNormalizedNameInformation, // 48 - FileNetworkPhysicalNameInformation, // 49 - FileIdGlobalTxDirectoryInformation, // 50 - FileIsRemoteDeviceInformation, // 51 - FileAttributeCacheInformation, // 52 - FileNumaNodeInformation, // 53 - FileStandardLinkInformation, // 54 - FileRemoteProtocolInformation, // 55 - FileMaximumInformation -} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; - -// -// Define the various structures which are returned on query operations -// - -typedef struct _FILE_BASIC_INFORMATION { - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - ULONG FileAttributes; -} FILE_BASIC_INFORMATION, *PFILE_BASIC_INFORMATION; - -typedef struct _FILE_STANDARD_INFORMATION { - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG NumberOfLinks; - BOOLEAN DeletePending; - BOOLEAN Directory; -} FILE_STANDARD_INFORMATION, *PFILE_STANDARD_INFORMATION; - - -typedef struct _FILE_POSITION_INFORMATION { - LARGE_INTEGER CurrentByteOffset; -} FILE_POSITION_INFORMATION, *PFILE_POSITION_INFORMATION; - - -typedef struct _FILE_NETWORK_OPEN_INFORMATION { - LARGE_INTEGER CreationTime; - LARGE_INTEGER LastAccessTime; - LARGE_INTEGER LastWriteTime; - LARGE_INTEGER ChangeTime; - LARGE_INTEGER AllocationSize; - LARGE_INTEGER EndOfFile; - ULONG FileAttributes; -} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION; - - - - - -typedef struct _FILE_FULL_EA_INFORMATION { - ULONG NextEntryOffset; - UCHAR Flags; - UCHAR EaNameLength; - USHORT EaValueLength; - CHAR EaName[1]; -} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION; - - -// -// Support to reserve bandwidth for a file handle. -// - -typedef struct _FILE_SFIO_RESERVE_INFORMATION { - ULONG RequestsPerPeriod; - ULONG Period; - BOOLEAN RetryFailures; - BOOLEAN Discardable; - ULONG RequestSize; - ULONG NumOutstandingRequests; -} FILE_SFIO_RESERVE_INFORMATION, *PFILE_SFIO_RESERVE_INFORMATION; - -// -// Support to query bandwidth properties of a volume. -// - -typedef struct _FILE_SFIO_VOLUME_INFORMATION { - ULONG MaximumRequestsPerPeriod; - ULONG MinimumPeriod; - ULONG MinimumTransferSize; -} FILE_SFIO_VOLUME_INFORMATION, *PFILE_SFIO_VOLUME_INFORMATION; - -// -// Support to set priority hints on a filehandle. -// - -typedef enum _IO_PRIORITY_HINT { - IoPriorityVeryLow = 0, // Defragging, content indexing and other background I/Os - IoPriorityLow, // Prefetching for applications. - IoPriorityNormal, // Normal I/Os - IoPriorityHigh, // Used by filesystems for checkpoint I/O - IoPriorityCritical, // Used by memory manager. Not available for applications. - MaxIoPriorityTypes -} IO_PRIORITY_HINT; - -typedef struct _FILE_IO_PRIORITY_HINT_INFORMATION { - IO_PRIORITY_HINT PriorityHint; -} FILE_IO_PRIORITY_HINT_INFORMATION, *PFILE_IO_PRIORITY_HINT_INFORMATION; - -// -// Don't queue an entry to an associated completion port if returning success -// synchronously. -// -#define FILE_SKIP_COMPLETION_PORT_ON_SUCCESS 0x1 - -// -// Don't set the file handle event on IO completion. -// -#define FILE_SKIP_SET_EVENT_ON_HANDLE 0x2 - -// -// Don't set user supplied event on successful fast-path IO completion. -// -#define FILE_SKIP_SET_USER_EVENT_ON_FAST_IO 0x4 - -typedef struct _FILE_IO_COMPLETION_NOTIFICATION_INFORMATION { - ULONG Flags; -} FILE_IO_COMPLETION_NOTIFICATION_INFORMATION, *PFILE_IO_COMPLETION_NOTIFICATION_INFORMATION; - -typedef struct _FILE_PROCESS_IDS_USING_FILE_INFORMATION { - ULONG NumberOfProcessIdsInList; - ULONG_PTR ProcessIdList[1]; -} FILE_PROCESS_IDS_USING_FILE_INFORMATION, *PFILE_PROCESS_IDS_USING_FILE_INFORMATION; - -typedef struct _FILE_IS_REMOTE_DEVICE_INFORMATION { - BOOLEAN IsRemote; -} FILE_IS_REMOTE_DEVICE_INFORMATION, *PFILE_IS_REMOTE_DEVICE_INFORMATION; - -typedef struct _FILE_NUMA_NODE_INFORMATION { - USHORT NodeNumber; -} FILE_NUMA_NODE_INFORMATION, *PFILE_NUMA_NODE_INFORMATION; - -// -// Set an range of IOSBs on a file handle. -// - -typedef struct _FILE_IOSTATUSBLOCK_RANGE_INFORMATION { - PUCHAR IoStatusBlockRange; - ULONG Length; -} FILE_IOSTATUSBLOCK_RANGE_INFORMATION, *PFILE_IOSTATUSBLOCK_RANGE_INFORMATION; - -// -// Define the file system information class values -// -// WARNING: The order of the following values are assumed by the I/O system. -// Any changes made here should be reflected there as well. - -typedef enum _FSINFOCLASS { - FileFsVolumeInformation = 1, - FileFsLabelInformation, // 2 - FileFsSizeInformation, // 3 - FileFsDeviceInformation, // 4 - FileFsAttributeInformation, // 5 - FileFsControlInformation, // 6 - FileFsFullSizeInformation, // 7 - FileFsObjectIdInformation, // 8 - FileFsDriverPathInformation, // 9 - FileFsVolumeFlagsInformation,// 10 - FileFsMaximumInformation -} FS_INFORMATION_CLASS, *PFS_INFORMATION_CLASS; - - -typedef struct _FILE_FS_DEVICE_INFORMATION { - DEVICE_TYPE DeviceType; - ULONG Characteristics; -} FILE_FS_DEVICE_INFORMATION, *PFILE_FS_DEVICE_INFORMATION; - -// -// Define the I/O bus interface types. -// - -typedef enum _INTERFACE_TYPE { - InterfaceTypeUndefined = -1, - Internal, - Isa, - Eisa, - MicroChannel, - TurboChannel, - PCIBus, - VMEBus, - NuBus, - PCMCIABus, - CBus, - MPIBus, - MPSABus, - ProcessorInternal, - InternalPowerBus, - PNPISABus, - PNPBus, - Vmcs, - MaximumInterfaceType -}INTERFACE_TYPE, *PINTERFACE_TYPE; - -// -// Define the DMA transfer widths. -// - -typedef enum _DMA_WIDTH { - Width8Bits, - Width16Bits, - Width32Bits, - MaximumDmaWidth -}DMA_WIDTH, *PDMA_WIDTH; - -// -// Define DMA transfer speeds. -// - -typedef enum _DMA_SPEED { - Compatible, - TypeA, - TypeB, - TypeC, - TypeF, - MaximumDmaSpeed -}DMA_SPEED, *PDMA_SPEED; - -// -// Define Interface reference/dereference routines for -// Interfaces exported by IRP_MN_QUERY_INTERFACE -// - -typedef VOID (*PINTERFACE_REFERENCE)(PVOID Context); -typedef VOID (*PINTERFACE_DEREFERENCE)(PVOID Context); - -// -// Define I/O Driver error log packet structure. This structure is filled in -// by the driver. -// - -typedef struct _IO_ERROR_LOG_PACKET { - UCHAR MajorFunctionCode; - UCHAR RetryCount; - USHORT DumpDataSize; - USHORT NumberOfStrings; - USHORT StringOffset; - USHORT EventCategory; - NTSTATUS ErrorCode; - ULONG UniqueErrorValue; - NTSTATUS FinalStatus; - ULONG SequenceNumber; - ULONG IoControlCode; - LARGE_INTEGER DeviceOffset; - ULONG DumpData[1]; -}IO_ERROR_LOG_PACKET, *PIO_ERROR_LOG_PACKET; - -// -// Define the I/O error log message. This message is sent by the error log -// thread over the lpc port. -// - -typedef struct _IO_ERROR_LOG_MESSAGE { - USHORT Type; - USHORT Size; - USHORT DriverNameLength; - LARGE_INTEGER TimeStamp; - ULONG DriverNameOffset; - IO_ERROR_LOG_PACKET EntryData; -}IO_ERROR_LOG_MESSAGE, *PIO_ERROR_LOG_MESSAGE; - -// -// Define the maximum message size that will be sent over the LPC to the -// application reading the error log entries. -// - -// -// Regardless of LPC size restrictions, ERROR_LOG_MAXIMUM_SIZE must remain -// a value that can fit in a UCHAR. -// - -#define ERROR_LOG_LIMIT_SIZE (256-16) - -// -// This limit, exclusive of IO_ERROR_LOG_MESSAGE_HEADER_LENGTH, also applies -// to IO_ERROR_LOG_MESSAGE_LENGTH -// - -#define IO_ERROR_LOG_MESSAGE_HEADER_LENGTH (sizeof(IO_ERROR_LOG_MESSAGE) - \ - sizeof(IO_ERROR_LOG_PACKET) + \ - (sizeof(WCHAR) * 40)) - -#define ERROR_LOG_MESSAGE_LIMIT_SIZE \ - (ERROR_LOG_LIMIT_SIZE + IO_ERROR_LOG_MESSAGE_HEADER_LENGTH) - -// -// IO_ERROR_LOG_MESSAGE_LENGTH is -// min(PORT_MAXIMUM_MESSAGE_LENGTH, ERROR_LOG_MESSAGE_LIMIT_SIZE) -// - -#define IO_ERROR_LOG_MESSAGE_LENGTH \ - ((PORT_MAXIMUM_MESSAGE_LENGTH > ERROR_LOG_MESSAGE_LIMIT_SIZE) ? \ - ERROR_LOG_MESSAGE_LIMIT_SIZE : \ - PORT_MAXIMUM_MESSAGE_LENGTH) - -// -// Define the maximum packet size a driver can allocate. -// - -#define ERROR_LOG_MAXIMUM_SIZE (IO_ERROR_LOG_MESSAGE_LENGTH - \ - IO_ERROR_LOG_MESSAGE_HEADER_LENGTH) - - -#ifdef _WIN64 -#define PORT_MAXIMUM_MESSAGE_LENGTH 512 -#else -#define PORT_MAXIMUM_MESSAGE_LENGTH 256 -#endif - -// -// Registry Specific Access Rights. -// - -#define KEY_QUERY_VALUE (0x0001) -#define KEY_SET_VALUE (0x0002) -#define KEY_CREATE_SUB_KEY (0x0004) -#define KEY_ENUMERATE_SUB_KEYS (0x0008) -#define KEY_NOTIFY (0x0010) -#define KEY_CREATE_LINK (0x0020) -#define KEY_WOW64_32KEY (0x0200) -#define KEY_WOW64_64KEY (0x0100) -#define KEY_WOW64_RES (0x0300) - -#define KEY_READ ((STANDARD_RIGHTS_READ |\ - KEY_QUERY_VALUE |\ - KEY_ENUMERATE_SUB_KEYS |\ - KEY_NOTIFY) \ - & \ - (~SYNCHRONIZE)) - - -#define KEY_WRITE ((STANDARD_RIGHTS_WRITE |\ - KEY_SET_VALUE |\ - KEY_CREATE_SUB_KEY) \ - & \ - (~SYNCHRONIZE)) - -#define KEY_EXECUTE ((KEY_READ) \ - & \ - (~SYNCHRONIZE)) - -#define KEY_ALL_ACCESS ((STANDARD_RIGHTS_ALL |\ - KEY_QUERY_VALUE |\ - KEY_SET_VALUE |\ - KEY_CREATE_SUB_KEY |\ - KEY_ENUMERATE_SUB_KEYS |\ - KEY_NOTIFY |\ - KEY_CREATE_LINK) \ - & \ - (~SYNCHRONIZE)) - -// -// Open/Create Options -// - -#define REG_OPTION_RESERVED (0x00000000L) // Parameter is reserved - -#define REG_OPTION_NON_VOLATILE (0x00000000L) // Key is preserved - // when system is rebooted - -#define REG_OPTION_VOLATILE (0x00000001L) // Key is not preserved - // when system is rebooted - -#define REG_OPTION_CREATE_LINK (0x00000002L) // Created key is a - // symbolic link - -#define REG_OPTION_BACKUP_RESTORE (0x00000004L) // open for backup or restore - // special access rules - // privilege required - -#define REG_OPTION_OPEN_LINK (0x00000008L) // Open symbolic link - -#define REG_LEGAL_OPTION \ - (REG_OPTION_RESERVED |\ - REG_OPTION_NON_VOLATILE |\ - REG_OPTION_VOLATILE |\ - REG_OPTION_CREATE_LINK |\ - REG_OPTION_BACKUP_RESTORE |\ - REG_OPTION_OPEN_LINK) - -#define REG_OPEN_LEGAL_OPTION \ - (REG_OPTION_RESERVED |\ - REG_OPTION_BACKUP_RESTORE |\ - REG_OPTION_OPEN_LINK) - -// -// Key creation/open disposition -// - -#define REG_CREATED_NEW_KEY (0x00000001L) // New Registry Key created -#define REG_OPENED_EXISTING_KEY (0x00000002L) // Existing Key opened - -// -// hive format to be used by Reg(Nt)SaveKeyEx -// -#define REG_STANDARD_FORMAT 1 -#define REG_LATEST_FORMAT 2 -#define REG_NO_COMPRESSION 4 - -// -// Key restore & hive load flags -// - -#define REG_WHOLE_HIVE_VOLATILE (0x00000001L) // Restore whole hive volatile -#define REG_REFRESH_HIVE (0x00000002L) // Unwind changes to last flush -#define REG_NO_LAZY_FLUSH (0x00000004L) // Never lazy flush this hive -#define REG_FORCE_RESTORE (0x00000008L) // Force the restore process even when we have open handles on subkeys -#define REG_APP_HIVE (0x00000010L) // Loads the hive visible to the calling process -#define REG_PROCESS_PRIVATE (0x00000020L) // Hive cannot be mounted by any other process while in use -#define REG_START_JOURNAL (0x00000040L) // Starts Hive Journal -#define REG_HIVE_EXACT_FILE_GROWTH (0x00000080L) // Grow hive file in exact 4k increments -#define REG_HIVE_NO_RM (0x00000100L) // No RM is started for this hive (no transactions) -#define REG_HIVE_SINGLE_LOG (0x00000200L) // Legacy single logging is used for this hive -#define REG_BOOT_HIVE (0x00000400L) // This hive might be used by the OS loader - -// -// Unload Flags -// -#define REG_FORCE_UNLOAD 1 - -// -// Notify filter values -// - -#define REG_NOTIFY_CHANGE_NAME (0x00000001L) // Create or delete (child) -#define REG_NOTIFY_CHANGE_ATTRIBUTES (0x00000002L) -#define REG_NOTIFY_CHANGE_LAST_SET (0x00000004L) // time stamp -#define REG_NOTIFY_CHANGE_SECURITY (0x00000008L) - -#define REG_LEGAL_CHANGE_FILTER \ - (REG_NOTIFY_CHANGE_NAME |\ - REG_NOTIFY_CHANGE_ATTRIBUTES |\ - REG_NOTIFY_CHANGE_LAST_SET |\ - REG_NOTIFY_CHANGE_SECURITY) - -// -// Key query structures -// - -typedef struct _KEY_BASIC_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG NameLength; - WCHAR Name[1]; // Variable length string -} KEY_BASIC_INFORMATION, *PKEY_BASIC_INFORMATION; - -typedef struct _KEY_NODE_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG ClassOffset; - ULONG ClassLength; - ULONG NameLength; - WCHAR Name[1]; // Variable length string -// Class[1]; // Variable length string not declared -} KEY_NODE_INFORMATION, *PKEY_NODE_INFORMATION; - -typedef struct _KEY_FULL_INFORMATION { - LARGE_INTEGER LastWriteTime; - ULONG TitleIndex; - ULONG ClassOffset; - ULONG ClassLength; - ULONG SubKeys; - ULONG MaxNameLen; - ULONG MaxClassLen; - ULONG Values; - ULONG MaxValueNameLen; - ULONG MaxValueDataLen; - WCHAR Class[1]; // Variable length -} KEY_FULL_INFORMATION, *PKEY_FULL_INFORMATION; - -typedef enum _KEY_INFORMATION_CLASS { - KeyBasicInformation, - KeyNodeInformation, - KeyFullInformation, - KeyNameInformation, - KeyCachedInformation, - KeyFlagsInformation, - KeyVirtualizationInformation, - KeyHandleTagsInformation, - MaxKeyInfoClass // MaxKeyInfoClass should always be the last enum -} KEY_INFORMATION_CLASS; - -typedef struct _KEY_WRITE_TIME_INFORMATION { - LARGE_INTEGER LastWriteTime; -} KEY_WRITE_TIME_INFORMATION, *PKEY_WRITE_TIME_INFORMATION; - -typedef struct _KEY_WOW64_FLAGS_INFORMATION { - ULONG UserFlags; -} KEY_WOW64_FLAGS_INFORMATION, *PKEY_WOW64_FLAGS_INFORMATION; - -typedef struct _KEY_HANDLE_TAGS_INFORMATION { - ULONG HandleTags; -} KEY_HANDLE_TAGS_INFORMATION, *PKEY_HANDLE_TAGS_INFORMATION; - -typedef struct _KEY_CONTROL_FLAGS_INFORMATION { - ULONG ControlFlags; -} KEY_CONTROL_FLAGS_INFORMATION, *PKEY_CONTROL_FLAGS_INFORMATION; - -typedef struct _KEY_SET_VIRTUALIZATION_INFORMATION { - ULONG VirtualTarget : 1; // Tells if the key is a virtual target key. - ULONG VirtualStore : 1; // Tells if the key is a virtual store key. - ULONG VirtualSource : 1; // Tells if the key has been virtualized at least one (virtual hint) - ULONG Reserved : 29; -} KEY_SET_VIRTUALIZATION_INFORMATION, *PKEY_SET_VIRTUALIZATION_INFORMATION; - -typedef enum _KEY_SET_INFORMATION_CLASS { - KeyWriteTimeInformation, - KeyWow64FlagsInformation, - KeyControlFlagsInformation, - KeySetVirtualizationInformation, - KeySetDebugInformation, - KeySetHandleTagsInformation, - MaxKeySetInfoClass // MaxKeySetInfoClass should always be the last enum -} KEY_SET_INFORMATION_CLASS; - -// -// Value entry query structures -// - -typedef struct _KEY_VALUE_BASIC_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG NameLength; - WCHAR Name[1]; // Variable size -} KEY_VALUE_BASIC_INFORMATION, *PKEY_VALUE_BASIC_INFORMATION; - -typedef struct _KEY_VALUE_FULL_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG DataOffset; - ULONG DataLength; - ULONG NameLength; - WCHAR Name[1]; // Variable size -// Data[1]; // Variable size data not declared -} KEY_VALUE_FULL_INFORMATION, *PKEY_VALUE_FULL_INFORMATION; - -typedef struct _KEY_VALUE_PARTIAL_INFORMATION { - ULONG TitleIndex; - ULONG Type; - ULONG DataLength; - UCHAR Data[1]; // Variable size -} KEY_VALUE_PARTIAL_INFORMATION, *PKEY_VALUE_PARTIAL_INFORMATION; - -typedef struct _KEY_VALUE_PARTIAL_INFORMATION_ALIGN64 { - ULONG Type; - ULONG DataLength; - UCHAR Data[1]; // Variable size -} KEY_VALUE_PARTIAL_INFORMATION_ALIGN64, *PKEY_VALUE_PARTIAL_INFORMATION_ALIGN64; - -typedef struct _KEY_VALUE_ENTRY { - PUNICODE_STRING ValueName; - ULONG DataLength; - ULONG DataOffset; - ULONG Type; -} KEY_VALUE_ENTRY, *PKEY_VALUE_ENTRY; - -typedef enum _KEY_VALUE_INFORMATION_CLASS { - KeyValueBasicInformation, - KeyValueFullInformation, - KeyValuePartialInformation, - KeyValueFullInformationAlign64, - KeyValuePartialInformationAlign64, - MaxKeyValueInfoClass // MaxKeyValueInfoClass should always be the last enum -} KEY_VALUE_INFORMATION_CLASS; - - - -#define OBJ_NAME_PATH_SEPARATOR ((WCHAR)L'\\') - - -// -// Object Manager Object Type Specific Access Rights. -// - -#define OBJECT_TYPE_CREATE (0x0001) - -#define OBJECT_TYPE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) - -// -// Object Manager Directory Specific Access Rights. -// - -#define DIRECTORY_QUERY (0x0001) -#define DIRECTORY_TRAVERSE (0x0002) -#define DIRECTORY_CREATE_OBJECT (0x0004) -#define DIRECTORY_CREATE_SUBDIRECTORY (0x0008) - -#define DIRECTORY_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0xF) - -//begin_winnt - -// -// Object Manager Symbolic Link Specific Access Rights. -// - -//end_winnt - -#define SYMBOLIC_LINK_QUERY (0x0001) - -#define SYMBOLIC_LINK_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | 0x1) - -typedef struct _OBJECT_NAME_INFORMATION { - UNICODE_STRING Name; -} OBJECT_NAME_INFORMATION, *POBJECT_NAME_INFORMATION; - -#define DUPLICATE_CLOSE_SOURCE 0x00000001 -#define DUPLICATE_SAME_ACCESS 0x00000002 -#define DUPLICATE_SAME_ATTRIBUTES 0x00000004 - -// -// Section Information Structures. -// - -typedef enum _SECTION_INHERIT { - ViewShare = 1, - ViewUnmap = 2 -} SECTION_INHERIT; - -// -// Section Access Rights. -// - - -#define SECTION_QUERY 0x0001 -#define SECTION_MAP_WRITE 0x0002 -#define SECTION_MAP_READ 0x0004 -#define SECTION_MAP_EXECUTE 0x0008 -#define SECTION_EXTEND_SIZE 0x0010 -#define SECTION_MAP_EXECUTE_EXPLICIT 0x0020 // not included in SECTION_ALL_ACCESS - -#define SECTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SECTION_QUERY|\ - SECTION_MAP_WRITE | \ - SECTION_MAP_READ | \ - SECTION_MAP_EXECUTE | \ - SECTION_EXTEND_SIZE) - -#define SESSION_QUERY_ACCESS 0x0001 -#define SESSION_MODIFY_ACCESS 0x0002 - -#define SESSION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | \ - SESSION_QUERY_ACCESS | \ - SESSION_MODIFY_ACCESS) - - - -#define SEGMENT_ALL_ACCESS SECTION_ALL_ACCESS - -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_GUARD 0x100 -#define PAGE_NOCACHE 0x200 -#define PAGE_WRITECOMBINE 0x400 - -#define MEM_COMMIT 0x1000 -#define MEM_RESERVE 0x2000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_FREE 0x10000 -#define MEM_PRIVATE 0x20000 -#define MEM_MAPPED 0x40000 -#define MEM_RESET 0x80000 -#define MEM_TOP_DOWN 0x100000 -#define MEM_LARGE_PAGES 0x20000000 -#define MEM_4MB_PAGES 0x80000000 -#define SEC_RESERVE 0x4000000 -#define SEC_COMMIT 0x8000000 -#define SEC_LARGE_PAGES 0x80000000 -#define PROCESS_DUP_HANDLE (0x0040) -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0xFFFF) -#else -#define PROCESS_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0xFFF) -#endif - -#if defined(_WIN64) - -#define MAXIMUM_PROC_PER_GROUP 64 - -#else - -#define MAXIMUM_PROC_PER_GROUP 32 - -#endif - -#define MAXIMUM_PROCESSORS MAXIMUM_PROC_PER_GROUP - - -// -// Thread Specific Access Rights -// - -#define THREAD_TERMINATE (0x0001) -#define THREAD_SUSPEND_RESUME (0x0002) -#define THREAD_ALERT (0x0004) -#define THREAD_GET_CONTEXT (0x0008) -#define THREAD_SET_CONTEXT (0x0010) -#define THREAD_SET_INFORMATION (0x0020) -#define THREAD_SET_LIMITED_INFORMATION (0x0400) -#define THREAD_QUERY_LIMITED_INFORMATION (0x0800) -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0xFFFF) -#else -#define THREAD_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | \ - 0x3FF) -#endif -// -// ClientId -// - -typedef struct _CLIENT_ID { - HANDLE UniqueProcess; - HANDLE UniqueThread; -} CLIENT_ID; -typedef CLIENT_ID *PCLIENT_ID; - -#define NtCurrentProcess() ( (HANDLE)(LONG_PTR) -1 ) -#define ZwCurrentProcess() NtCurrentProcess() -#define NtCurrentThread() ( (HANDLE)(LONG_PTR) -2 ) -#define ZwCurrentThread() NtCurrentThread() - -// -// ========================================= -// Define GUIDs which represent well-known power schemes -// ========================================= -// - -// -// Maximum Power Savings - indicates that very aggressive power savings measures will be used to help -// stretch battery life. -// -// {a1841308-3541-4fab-bc81-f71556f20b4a} -// -DEFINE_GUID( GUID_MAX_POWER_SAVINGS, 0xA1841308, 0x3541, 0x4FAB, 0xBC, 0x81, 0xF7, 0x15, 0x56, 0xF2, 0x0B, 0x4A ); - -// -// No Power Savings - indicates that almost no power savings measures will be used. -// -// {8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c} -// -DEFINE_GUID( GUID_MIN_POWER_SAVINGS, 0x8C5E7FDA, 0xE8BF, 0x4A96, 0x9A, 0x85, 0xA6, 0xE2, 0x3A, 0x8C, 0x63, 0x5C ); - -// -// Typical Power Savings - indicates that fairly aggressive power savings measures will be used. -// -// {381b4222-f694-41f0-9685-ff5bb260df2e} -// -DEFINE_GUID( GUID_TYPICAL_POWER_SAVINGS, 0x381B4222, 0xF694, 0x41F0, 0x96, 0x85, 0xFF, 0x5B, 0xB2, 0x60, 0xDF, 0x2E ); - -// -// This is a special GUID that represents "no subgroup" of settings. That is, it indicates -// that settings that are in the root of the power policy hierarchy as opposed to settings -// that are buried under a subgroup of settings. This should be used when querying for -// power settings that may not fall into a subgroup. -// -DEFINE_GUID( NO_SUBGROUP_GUID, 0xFEA3413E, 0x7E05, 0x4911, 0x9A, 0x71, 0x70, 0x03, 0x31, 0xF1, 0xC2, 0x94 ); - -// -// This is a special GUID that represents "every power scheme". That is, it indicates -// that any write to this power scheme should be reflected to every scheme present. -// This allows users to write a single setting once and have it apply to all schemes. They -// can then apply custom settings to specific power schemes that they care about. -// -DEFINE_GUID( ALL_POWERSCHEMES_GUID, 0x68A1E95E, 0x13EA, 0x41E1, 0x80, 0x11, 0x0C, 0x49, 0x6C, 0xA4, 0x90, 0xB0 ); - -// -// This is a special GUID that represents a 'personality' that each power scheme will have. -// In other words, each power scheme will have this key indicating "I'm most like *this* base -// power scheme." This individual setting will have one of three settings: -// GUID_MAX_POWER_SAVINGS -// GUID_MIN_POWER_SAVINGS -// GUID_TYPICAL_POWER_SAVINGS -// -// This allows several features: -// 1. Drivers and applications can register for notification of this GUID. So when this power -// scheme is activiated, this GUID's setting will be sent across the system and drivers/applications -// can see "GUID_MAX_POWER_SAVINGS" which will tell them in a generic fashion "get real aggressive -// about conserving power". -// 2. UserB may install a driver or application which creates power settings, and UserB may modify -// those power settings. Now UserA logs in. How does he see those settings? They simply don't -// exist in his private power key. Well they do exist over in the system power key. When we -// enumerate all the power settings in this system power key and don't find a corresponding entry -// in the user's private power key, then we can go look at this "personality" key in the users -// power scheme. We can then go get a default value for the power setting, depending on which -// "personality" power scheme is being operated on. Here's an example: -// A. UserB installs an application that creates a power setting Seetting1 -// B. UserB changes Setting1 to have a value of 50 because that's one of the possible settings -// available for setting1. -// C. UserB logs out -// D. UserA logs in and his active power scheme is some custom scheme that was derived from -// the GUID_TYPICAL_POWER_SAVINGS. But remember that UserA has no setting1 in his -// private power key. -// E. When activating UserA's selected power scheme, all power settings in the system power key will -// be enumerated (including Setting1). -// F. The power manager will see that UserA has no Setting1 power setting in his private power scheme. -// G. The power manager will query UserA's power scheme for its personality and retrieve -// GUID_TYPICAL_POWER_SAVINGS. -// H. The power manager then looks in Setting1 in the system power key and looks in its set of default -// values for the corresponding value for GUID_TYPICAL_POWER_SAVINGS power schemes. -// I. This derived power setting is applied. -DEFINE_GUID( GUID_POWERSCHEME_PERSONALITY, 0x245D8541, 0x3943, 0x4422, 0xB0, 0x25, 0x13, 0xA7, 0x84, 0xF6, 0x79, 0xB7 ); - -// -// Define a special GUID which will be used to define the active power scheme. -// User will register for this power setting GUID, and when the active power -// scheme changes, they'll get a callback where the payload is the GUID -// representing the active powerscheme. -// ( 31F9F286-5084-42FE-B720-2B0264993763 } -// -DEFINE_GUID( GUID_ACTIVE_POWERSCHEME, 0x31F9F286, 0x5084, 0x42FE, 0xB7, 0x20, 0x2B, 0x02, 0x64, 0x99, 0x37, 0x63 ); - -// -// ========================================= -// Define GUIDs which represent well-known power settings -// ========================================= -// - -// Video settings -// -------------- -// -// Specifies the subgroup which will contain all of the video -// settings for a single policy. -// -DEFINE_GUID( GUID_VIDEO_SUBGROUP, 0x7516B95F, 0xF776, 0x4464, 0x8C, 0x53, 0x06, 0x16, 0x7F, 0x40, 0xCC, 0x99 ); - -// -// Specifies (in seconds) how long we wait after the last user input has been -// recieved before we power off the video. -// -DEFINE_GUID( GUID_VIDEO_POWERDOWN_TIMEOUT, 0x3C0BC021, 0xC8A8, 0x4E07, 0xA9, 0x73, 0x6B, 0x14, 0xCB, 0xCB, 0x2B, 0x7E ); - -// -// Specifies whether adaptive display dimming is turned on or off. -// 82DBCF2D-CD67-40C5-BFDC-9F1A5CCD4663 -// -DEFINE_GUID( GUID_VIDEO_ANNOYANCE_TIMEOUT, 0x82DBCF2D, 0xCD67, 0x40C5, 0xBF, 0xDC, 0x9F, 0x1A, 0x5C, 0xCD, 0x46, 0x63 ); - -// -// Specifies how much adaptive dim time out will be increased by. -// EED904DF-B142-4183-B10B-5A1197A37864 -// -DEFINE_GUID( GUID_VIDEO_ADAPTIVE_PERCENT_INCREASE, 0xEED904DF, 0xB142, 0x4183, 0xB1, 0x0B, 0x5A, 0x11, 0x97, 0xA3, 0x78, 0x64 ); - -// -// Specifies (in seconds) how long we wait after the last user input has been -// recieved before we dim the video. -// -DEFINE_GUID( GUID_VIDEO_DIM_TIMEOUT, 0x17aaa29b, 0x8b43, 0x4b94, 0xaa, 0xfe, 0x35, 0xf6, 0x4d, 0xaa, 0xf1, 0xee); - -// -// Specifies if the operating system should use adaptive timers (based on -// previous behavior) to power down the video, -// -DEFINE_GUID( GUID_VIDEO_ADAPTIVE_POWERDOWN, 0x90959D22, 0xD6A1, 0x49B9, 0xAF, 0x93, 0xBC, 0xE8, 0x85, 0xAD, 0x33, 0x5B ); - -// -// Specifies if the monitor is currently being powered or not. -// 02731015-4510-4526-99E6-E5A17EBD1AEA -// -DEFINE_GUID( GUID_MONITOR_POWER_ON, 0x02731015, 0x4510, 0x4526, 0x99, 0xE6, 0xE5, 0xA1, 0x7E, 0xBD, 0x1A, 0xEA ); - -// -// Monitor brightness policy when in normal state -// {aded5e82-b909-4619-9949-f5d71dac0bcb} -DEFINE_GUID(GUID_DEVICE_POWER_POLICY_VIDEO_BRIGHTNESS, 0xaded5e82L, 0xb909, 0x4619, 0x99, 0x49, 0xf5, 0xd7, 0x1d, 0xac, 0x0b, 0xcb); - -// -// -// Monitor brightness policy when in dim state -// {f1fbfde2-a960-4165-9f88-50667911ce96} -DEFINE_GUID(GUID_DEVICE_POWER_POLICY_VIDEO_DIM_BRIGHTNESS, 0xf1fbfde2, 0xa960, 0x4165, 0x9f, 0x88, 0x50, 0x66, 0x79, 0x11, 0xce, 0x96); - -// -// Current Monitor brightness -// {8ffee2c6-2d01-46be-adb9-398addc5b4ff} -DEFINE_GUID(GUID_VIDEO_CURRENT_MONITOR_BRIGHTNESS, 0x8ffee2c6, 0x2d01, 0x46be, 0xad, 0xb9, 0x39, 0x8a, 0xdd, 0xc5, 0xb4, 0xff); - - -// -// Specifies if the operating system should use ambient light sensor to change -// disply brightness adatively. -// {FBD9AA66-9553-4097-BA44-ED6E9D65EAB8} -DEFINE_GUID(GUID_VIDEO_ADAPTIVE_DISPLAY_BRIGHTNESS, 0xFBD9AA66, 0x9553, 0x4097, 0xBA, 0x44, 0xED, 0x6E, 0x9D, 0x65, 0xEA, 0xB8); - -// -// Specifies a change in the session's display state. -// 73A5E93A-5BB1-4F93-895B-DBD0DA855967 -// -// N.B. This is a session-specific notification, sent only to interactive -// session registrants. Session 0 and kernel mode consumers do not receive -// this notification. -DEFINE_GUID( GUID_SESSION_DISPLAY_STATE, 0x73A5E93A, 0x5BB1, 0x4F93, 0x89, 0x5B, 0xDB, 0xD0, 0xDA, 0x85, 0x59, 0x67 ); - -// -// Specifies a change in the current monitor's display state. -// 6fe69556-704a-47a0-8f24-c28d936fda47 -// -DEFINE_GUID(GUID_CONSOLE_DISPLAY_STATE, 0x6fe69556, 0x704a, 0x47a0, 0x8f, 0x24, 0xc2, 0x8d, 0x93, 0x6f, 0xda, 0x47); - -// -// Defines a guid for enabling/disabling the ability to create display required -// power requests. -// -// {A9CEB8DA-CD46-44FB-A98B-02AF69DE4623} -// -DEFINE_GUID( GUID_ALLOW_DISPLAY_REQUIRED, 0xA9CEB8DA, 0xCD46, 0x44FB, 0xA9, 0x8B, 0x02, 0xAF, 0x69, 0xDE, 0x46, 0x23 ); - -// Harddisk settings -// ----------------- -// -// Specifies the subgroup which will contain all of the harddisk -// settings for a single policy. -// -DEFINE_GUID( GUID_DISK_SUBGROUP, 0x0012EE47, 0x9041, 0x4B5D, 0x9B, 0x77, 0x53, 0x5F, 0xBA, 0x8B, 0x14, 0x42 ); - -// -// Specifies (in seconds) how long we wait after the last disk access -// before we power off the disk. -// -DEFINE_GUID( GUID_DISK_POWERDOWN_TIMEOUT, 0x6738E2C4, 0xE8A5, 0x4A42, 0xB1, 0x6A, 0xE0, 0x40, 0xE7, 0x69, 0x75, 0x6E ); - -// -// Specifies the amount of contiguous disk activity time to ignore when -// calculating disk idleness. -// -// 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 -// - -DEFINE_GUID( GUID_DISK_BURST_IGNORE_THRESHOLD, 0x80e3c60e, 0xbb94, 0x4ad8, 0xbb, 0xe0, 0x0d, 0x31, 0x95, 0xef, 0xc6, 0x63 ); - -// -// Specifies if the operating system should use adaptive timers (based on -// previous behavior) to power down the disk, -// -DEFINE_GUID( GUID_DISK_ADAPTIVE_POWERDOWN, 0x396A32E1, 0x499A, 0x40B2, 0x91, 0x24, 0xA9, 0x6A, 0xFE, 0x70, 0x76, 0x67 ); - -// System sleep settings -// --------------------- -// -// Specifies the subgroup which will contain all of the sleep -// settings for a single policy. -// { 238C9FA8-0AAD-41ED-83F4-97BE242C8F20 } -// -DEFINE_GUID( GUID_SLEEP_SUBGROUP, 0x238C9FA8, 0x0AAD, 0x41ED, 0x83, 0xF4, 0x97, 0xBE, 0x24, 0x2C, 0x8F, 0x20 ); - -// -// Specifies an idle treshold percentage (0-100). The system must be this idle -// over a period of time in order to idle to sleep. -// -// N.B. DEPRECATED IN WINDOWS 6.1 -// -DEFINE_GUID( GUID_SLEEP_IDLE_THRESHOLD, 0x81cd32e0, 0x7833, 0x44f3, 0x87, 0x37, 0x70, 0x81, 0xf3, 0x8d, 0x1f, 0x70 ); - -// -// Specifies (in seconds) how long we wait after the system is deemed -// "idle" before moving to standby (S1, S2 or S3). -// -DEFINE_GUID( GUID_STANDBY_TIMEOUT, 0x29F6C1DB, 0x86DA, 0x48C5, 0x9F, 0xDB, 0xF2, 0xB6, 0x7B, 0x1F, 0x44, 0xDA ); - -// -// Specifies (in seconds) how long the system should go back to sleep after -// waking unattended. 0 indicates that the standard standby/hibernate idle -// policy should be used instead. -// -// {7bc4a2f9-d8fc-4469-b07b-33eb785aaca0} -// -DEFINE_GUID( GUID_UNATTEND_SLEEP_TIMEOUT, 0x7bc4a2f9, 0xd8fc, 0x4469, 0xb0, 0x7b, 0x33, 0xeb, 0x78, 0x5a, 0xac, 0xa0 ); - -// -// Specifies (in seconds) how long we wait after the system is deemed -// "idle" before moving to hibernate (S4). -// -DEFINE_GUID( GUID_HIBERNATE_TIMEOUT, 0x9D7815A6, 0x7EE4, 0x497E, 0x88, 0x88, 0x51, 0x5A, 0x05, 0xF0, 0x23, 0x64 ); - -// -// Specifies whether or not Fast S4 should be enabled if the system supports it -// 94AC6D29-73CE-41A6-809F-6363BA21B47E -// -DEFINE_GUID( GUID_HIBERNATE_FASTS4_POLICY, 0x94AC6D29, 0x73CE, 0x41A6, 0x80, 0x9F, 0x63, 0x63, 0xBA, 0x21, 0xB4, 0x7E ); - -// -// Define a GUID for controlling the criticality of sleep state transitions. -// Critical sleep transitions do not query applications, services or drivers -// before transitioning the platform to a sleep state. -// -// {B7A27025-E569-46c2-A504-2B96CAD225A1} -// -DEFINE_GUID( GUID_CRITICAL_POWER_TRANSITION, 0xB7A27025, 0xE569, 0x46c2, 0xA5, 0x04, 0x2B, 0x96, 0xCA, 0xD2, 0x25, 0xA1); - -// -// Specifies if the system is entering or exiting 'away mode'. -// 98A7F580-01F7-48AA-9C0F-44352C29E5C0 -// -DEFINE_GUID( GUID_SYSTEM_AWAYMODE, 0x98A7F580, 0x01F7, 0x48AA, 0x9C, 0x0F, 0x44, 0x35, 0x2C, 0x29, 0xE5, 0xC0 ); - -// Specify whether away mode is allowed -// -// {25DFA149-5DD1-4736-B5AB-E8A37B5B8187} -// -DEFINE_GUID( GUID_ALLOW_AWAYMODE, 0x25dfa149, 0x5dd1, 0x4736, 0xb5, 0xab, 0xe8, 0xa3, 0x7b, 0x5b, 0x81, 0x87 ); - -// -// Defines a guid for enabling/disabling standby (S1-S3) states. This does not -// affect hibernation (S4). -// -// {abfc2519-3608-4c2a-94ea-171b0ed546ab} -// -DEFINE_GUID( GUID_ALLOW_STANDBY_STATES, 0xabfc2519, 0x3608, 0x4c2a, 0x94, 0xea, 0x17, 0x1b, 0x0e, 0xd5, 0x46, 0xab ); - -// -// Defines a guid for enabling/disabling the ability to wake via RTC. -// -// {BD3B718A-0680-4D9D-8AB2-E1D2B4AC806D} -// -DEFINE_GUID( GUID_ALLOW_RTC_WAKE, 0xBD3B718A, 0x0680, 0x4D9D, 0x8A, 0xB2, 0xE1, 0xD2, 0xB4, 0xAC, 0x80, 0x6D ); - -// -// Defines a guid for enabling/disabling the ability to create system required -// power requests. -// -// {A4B195F5-8225-47D8-8012-9D41369786E2} -// -DEFINE_GUID( GUID_ALLOW_SYSTEM_REQUIRED, 0xA4B195F5, 0x8225, 0x47D8, 0x80, 0x12, 0x9D, 0x41, 0x36, 0x97, 0x86, 0xE2 ); - -// System button actions -// --------------------- -// -// -// Specifies the subgroup which will contain all of the system button -// settings for a single policy. -// -DEFINE_GUID( GUID_SYSTEM_BUTTON_SUBGROUP, 0x4F971E89, 0xEEBD, 0x4455, 0xA8, 0xDE, 0x9E, 0x59, 0x04, 0x0E, 0x73, 0x47 ); - -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system power button is pressed. -// -DEFINE_GUID( GUID_POWERBUTTON_ACTION, 0x7648EFA3, 0xDD9C, 0x4E3E, 0xB5, 0x66, 0x50, 0xF9, 0x29, 0x38, 0x62, 0x80 ); -DEFINE_GUID( GUID_POWERBUTTON_ACTION_FLAGS, 0x857E7FAC, 0x034B, 0x4704, 0xAB, 0xB1, 0xBC, 0xA5, 0x4A, 0xA3, 0x14, 0x78 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system sleep button is pressed. -// -DEFINE_GUID( GUID_SLEEPBUTTON_ACTION, 0x96996BC0, 0xAD50, 0x47EC, 0x92, 0x3B, 0x6F, 0x41, 0x87, 0x4D, 0xD9, 0xEB ); -DEFINE_GUID( GUID_SLEEPBUTTON_ACTION_FLAGS, 0x2A160AB1, 0xB69D, 0x4743, 0xB7, 0x18, 0xBF, 0x14, 0x41, 0xD5, 0xE4, 0x93 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system sleep button is pressed. -// { A7066653-8D6C-40A8-910E-A1F54B84C7E5 } -// -DEFINE_GUID( GUID_USERINTERFACEBUTTON_ACTION, 0xA7066653, 0x8D6C, 0x40A8, 0x91, 0x0E, 0xA1, 0xF5, 0x4B, 0x84, 0xC7, 0xE5 ); - -// -// Specifies (in a POWER_ACTION_POLICY structure) the appropriate action to -// take when the system lid is closed. -// -DEFINE_GUID( GUID_LIDCLOSE_ACTION, 0x5CA83367, 0x6E45, 0x459F, 0xA2, 0x7B, 0x47, 0x6B, 0x1D, 0x01, 0xC9, 0x36 ); -DEFINE_GUID( GUID_LIDCLOSE_ACTION_FLAGS, 0x97E969AC, 0x0D6C, 0x4D08, 0x92, 0x7C, 0xD7, 0xBD, 0x7A, 0xD7, 0x85, 0x7B ); -DEFINE_GUID( GUID_LIDOPEN_POWERSTATE, 0x99FF10E7, 0x23B1, 0x4C07, 0xA9, 0xD1, 0x5C, 0x32, 0x06, 0xD7, 0x41, 0xB4 ); - - -// Battery Discharge Settings -// -------------------------- -// -// Specifies the subgroup which will contain all of the battery discharge -// settings for a single policy. -// -DEFINE_GUID( GUID_BATTERY_SUBGROUP, 0xE73A048D, 0xBF27, 0x4F12, 0x97, 0x31, 0x8B, 0x20, 0x76, 0xE8, 0x89, 0x1F ); - -// -// 4 battery discharge alarm settings. -// -// GUID_BATTERY_DISCHARGE_ACTION_x - This is the action to take. It is a value -// of type POWER_ACTION -// GUID_BATTERY_DISCHARGE_LEVEL_x - This is the battery level (%) -// GUID_BATTERY_DISCHARGE_FLAGS_x - Flags defined below: -// POWER_ACTION_POLICY->EventCode flags -// BATTERY_DISCHARGE_FLAGS_EVENTCODE_MASK -// BATTERY_DISCHARGE_FLAGS_ENABLE -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_0, 0x637EA02F, 0xBBCB, 0x4015, 0x8E, 0x2C, 0xA1, 0xC7, 0xB9, 0xC0, 0xB5, 0x46 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_0, 0x9A66D8D7, 0x4FF7, 0x4EF9, 0xB5, 0xA2, 0x5A, 0x32, 0x6C, 0xA2, 0xA4, 0x69 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_0, 0x5dbb7c9f, 0x38e9, 0x40d2, 0x97, 0x49, 0x4f, 0x8a, 0x0e, 0x9f, 0x64, 0x0f ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_1, 0xD8742DCB, 0x3E6A, 0x4B3C, 0xB3, 0xFE, 0x37, 0x46, 0x23, 0xCD, 0xCF, 0x06 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_1, 0x8183BA9A, 0xE910, 0x48DA, 0x87, 0x69, 0x14, 0xAE, 0x6D, 0xC1, 0x17, 0x0A ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_1, 0xbcded951, 0x187b, 0x4d05, 0xbc, 0xcc, 0xf7, 0xe5, 0x19, 0x60, 0xc2, 0x58 ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_2, 0x421CBA38, 0x1A8E, 0x4881, 0xAC, 0x89, 0xE3, 0x3A, 0x8B, 0x04, 0xEC, 0xE4 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_2, 0x07A07CA2, 0xADAF, 0x40D7, 0xB0, 0x77, 0x53, 0x3A, 0xAD, 0xED, 0x1B, 0xFA ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_2, 0x7fd2f0c4, 0xfeb7, 0x4da3, 0x81, 0x17, 0xe3, 0xfb, 0xed, 0xc4, 0x65, 0x82 ); - -DEFINE_GUID( GUID_BATTERY_DISCHARGE_ACTION_3, 0x80472613, 0x9780, 0x455E, 0xB3, 0x08, 0x72, 0xD3, 0x00, 0x3C, 0xF2, 0xF8 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_LEVEL_3, 0x58AFD5A6, 0xC2DD, 0x47D2, 0x9F, 0xBF, 0xEF, 0x70, 0xCC, 0x5C, 0x59, 0x65 ); -DEFINE_GUID( GUID_BATTERY_DISCHARGE_FLAGS_3, 0x73613ccf, 0xdbfa, 0x4279, 0x83, 0x56, 0x49, 0x35, 0xf6, 0xbf, 0x62, 0xf3 ); - -// Processor power settings -// ------------------------ -// - -// Specifies the subgroup which will contain all of the processor -// settings for a single policy. -// -DEFINE_GUID( GUID_PROCESSOR_SETTINGS_SUBGROUP, 0x54533251, 0x82BE, 0x4824, 0x96, 0xC1, 0x47, 0xB6, 0x0B, 0x74, 0x0D, 0x00 ); - -// -// Specifies various attributes that control processor performance/throttle -// states. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_POLICY, 0x57027304, 0x4AF6, 0x4104, 0x92, 0x60, 0xE3, 0xD9, 0x52, 0x48, 0xFC, 0x36 ); - -#define PERFSTATE_POLICY_CHANGE_IDEAL 0 -#define PERFSTATE_POLICY_CHANGE_SINGLE 1 -#define PERFSTATE_POLICY_CHANGE_ROCKET 2 -#define PERFSTATE_POLICY_CHANGE_MAX PERFSTATE_POLICY_CHANGE_ROCKET - -// -// Specifies a percentage (between 0 and 100) that the processor frequency -// should never go above. For example, if this value is set to 80, then -// the processor frequency will never be throttled above 80 percent of its -// maximum frequency by the system. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_MAXIMUM, 0xBC5038F7, 0x23E0, 0x4960, 0x96, 0xDA, 0x33, 0xAB, 0xAF, 0x59, 0x35, 0xEC ); - -// -// Specifies a percentage (between 0 and 100) that the processor frequency -// should not drop below. For example, if this value is set to 50, then the -// processor frequency will never be throttled below 50 percent of its -// maximum frequency by the system. -// -DEFINE_GUID( GUID_PROCESSOR_THROTTLE_MINIMUM, 0x893DEE8E, 0x2BEF, 0x41E0, 0x89, 0xC6, 0xB5, 0x5D, 0x09, 0x29, 0x96, 0x4C ); - -// -// Specifies whether throttle states are allowed to be used even when -// performance states are available. -// -// {3b04d4fd-1cc7-4f23-ab1c-d1337819c4bb} -// -DEFINE_GUID( GUID_PROCESSOR_ALLOW_THROTTLING, 0x3b04d4fd, 0x1cc7, 0x4f23, 0xab, 0x1c, 0xd1, 0x33, 0x78, 0x19, 0xc4, 0xbb ); - -// -// Specifies processor power settings for CState policy data -// {68F262A7-F621-4069-B9A5-4874169BE23C} -// -DEFINE_GUID( GUID_PROCESSOR_IDLESTATE_POLICY, 0x68f262a7, 0xf621, 0x4069, 0xb9, 0xa5, 0x48, 0x74, 0x16, 0x9b, 0xe2, 0x3c); - -// -// Specifies processor power settings for PerfState policy data -// {BBDC3814-18E9-4463-8A55-D197327C45C0} -// -DEFINE_GUID( GUID_PROCESSOR_PERFSTATE_POLICY, 0xBBDC3814, 0x18E9, 0x4463, 0x8A, 0x55, 0xD1, 0x97, 0x32, 0x7C, 0x45, 0xC0); - -// -// Specifies the increase busy percentage threshold that must be met before -// increasing the processor performance state. -// -// {06cadf0e-64ed-448a-8927-ce7bf90eb35d} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_THRESHOLD, 0x06cadf0e, 0x64ed, 0x448a, 0x89, 0x27, 0xce, 0x7b, 0xf9, 0x0e, 0xb3, 0x5d ); - -// -// Specifies the decrease busy percentage threshold that must be met before -// decreasing the processor performance state. -// -// {12a0ab44-fe28-4fa9-b3bd-4b64f44960a6} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_THRESHOLD, 0x12a0ab44, 0xfe28, 0x4fa9, 0xb3, 0xbd, 0x4b, 0x64, 0xf4, 0x49, 0x60, 0xa6 ); - -// -// Specifies, either as ideal, single or rocket, how aggressive performance -// states should be selected when increasing the processor performance state. -// -// {465E1F50-B610-473a-AB58-00D1077DC418} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_POLICY, 0x465e1f50, 0xb610, 0x473a, 0xab, 0x58, 0x0, 0xd1, 0x7, 0x7d, 0xc4, 0x18); - -// -// Specifies, either as ideal, single or rocket, how aggressive performance -// states should be selected when decreasing the processor performance state. -// -// {40FBEFC7-2E9D-4d25-A185-0CFD8574BAC6} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_POLICY, 0x40fbefc7, 0x2e9d, 0x4d25, 0xa1, 0x85, 0xc, 0xfd, 0x85, 0x74, 0xba, 0xc6); - -// -// Specifies, in milliseconds, the minimum amount of time that must elapse after -// the last processor performance state change before increasing the processor -// performance state. -// -// {984CF492-3BED-4488-A8F9-4286C97BF5AA} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_INCREASE_TIME, 0x984cf492, 0x3bed, 0x4488, 0xa8, 0xf9, 0x42, 0x86, 0xc9, 0x7b, 0xf5, 0xaa); - -// -// Specifies, in milliseconds, the minimum amount of time that must elapse after -// the last processor performance state change before increasing the processor -// performance state. -// -// {D8EDEB9B-95CF-4f95-A73C-B061973693C8} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_DECREASE_TIME, 0xd8edeb9b, 0x95cf, 0x4f95, 0xa7, 0x3c, 0xb0, 0x61, 0x97, 0x36, 0x93, 0xc8); - -// -// Specifies the time, in milliseconds, that must expire before considering -// a change in the processor performance states or parked core set. -// -// {4D2B0152-7D5C-498b-88E2-34345392A2C5} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_TIME_CHECK, 0x4d2b0152, 0x7d5c, 0x498b, 0x88, 0xe2, 0x34, 0x34, 0x53, 0x92, 0xa2, 0xc5); - -// -// Specifies whether a processor may opportunistically increase frequency above -// the maximum when operating contitions allow it to do so safely. -// -// {45BCC044-D885-43e2-8605-EE0EC6E96B59} -// -DEFINE_GUID(GUID_PROCESSOR_PERF_BOOST_POLICY, -0x45bcc044, 0xd885, 0x43e2, 0x86, 0x5, 0xee, 0xe, 0xc6, 0xe9, 0x6b, 0x59); - -#define PROCESSOR_PERF_BOOST_POLICY_DISABLED 0 -#define PROCESSOR_PERF_BOOST_POLICY_MAX 100 - -// -// Specifies if idle state promotion and demotion values should be scaled based -// on the current peformance state. -// -// {6C2993B0-8F48-481f-BCC6-00DD2742AA06} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_ALLOW_SCALING, 0x6c2993b0, 0x8f48, 0x481f, 0xbc, 0xc6, 0x0, 0xdd, 0x27, 0x42, 0xaa, 0x6); - -// -// Specifies if idle states should be disabled. -// -// {5D76A2CA-E8C0-402f-A133-2158492D58AD} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_DISABLE, 0x5d76a2ca, 0xe8c0, 0x402f, 0xa1, 0x33, 0x21, 0x58, 0x49, 0x2d, 0x58, 0xad); - -// -// Specifies the time that elapsed since the last idle state promotion or -// demotion before idle states may be promoted or demoted again (in -// microseconds). -// -// {C4581C31-89AB-4597-8E2B-9C9CAB440E6B} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_TIME_CHECK, 0xc4581c31, 0x89ab, 0x4597, 0x8e, 0x2b, 0x9c, 0x9c, 0xab, 0x44, 0xe, 0x6b); - - -// -// Specifies the upper busy threshold that must be met before demoting the -// processor to a lighter idle state (in percentage). -// -// {4B92D758-5A24-4851-A470-815D78AEE119} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_DEMOTE_THRESHOLD, 0x4b92d758, 0x5a24, 0x4851, 0xa4, 0x70, 0x81, 0x5d, 0x78, 0xae, 0xe1, 0x19); - -// -// Specifies the lower busy threshold that must be met before promoting the -// processor to a deeper idle state (in percentage). -// -// {7B224883-B3CC-4d79-819F-8374152CBE7C} -// -DEFINE_GUID( GUID_PROCESSOR_IDLE_PROMOTE_THRESHOLD, 0x7b224883, 0xb3cc, 0x4d79, 0x81, 0x9f, 0x83, 0x74, 0x15, 0x2c, 0xbe, 0x7c); - -// -// Specifies the utilization threshold in percent that must be crossed in order to un-park cores. -// -// {df142941-20f3-4edf-9a4a-9c83d3d717d1} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_THRESHOLD, 0xdf142941, 0x20f3, 0x4edf, 0x9a, 0x4a, 0x9c, 0x83, 0xd3, 0xd7, 0x17, 0xd1 ); - -// -// Specifies the utilization threshold in percent that must be crossed in order to park cores. -// -// {68dd2f27-a4ce-4e11-8487-3794e4135dfa} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_THRESHOLD, 0x68dd2f27, 0xa4ce, 0x4e11, 0x84, 0x87, 0x37, 0x94, 0xe4, 0x13, 0x5d, 0xfa); - -// -// Specifies, either as ideal, single or rocket, how aggressive core parking is when cores must be unparked. -// -// {c7be0679-2817-4d69-9d02-519a537ed0c6} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_POLICY, 0xc7be0679, 0x2817, 0x4d69, 0x9d, 0x02, 0x51, 0x9a, 0x53, 0x7e, 0xd0, 0xc6); - -#define CORE_PARKING_POLICY_CHANGE_IDEAL 0 -#define CORE_PARKING_POLICY_CHANGE_SINGLE 1 -#define CORE_PARKING_POLICY_CHANGE_ROCKET 2 -#define CORE_PARKING_POLICY_CHANGE_MAX CORE_PARKING_POLICY_CHANGE_ROCKET - -// -// Specifies, either as ideal, single or rocket, how aggressive core parking is when cores must be parked. -// -// {71021b41-c749-4d21-be74-a00f335d582b} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_POLICY, 0x71021b41, 0xc749, 0x4d21, 0xbe, 0x74, 0xa0, 0x0f, 0x33, 0x5d, 0x58, 0x2b); - -// -// Specifies, on a per processor group basis, the maximum number of cores that can be kept unparked. -// -// {ea062031-0e34-4ff1-9b6d-eb1059334028} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_MAX_CORES, 0xea062031, 0x0e34, 0x4ff1, 0x9b, 0x6d, 0xeb, 0x10, 0x59, 0x33, 0x40, 0x28); - -// -// Specifies, on a per processor group basis, the minimum number of cores that must be kept unparked. -// -// {0cc5b647-c1df-4637-891a-dec35c318583} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_MIN_CORES, 0x0cc5b647, 0xc1df, 0x4637, 0x89, 0x1a, 0xde, 0xc3, 0x5c, 0x31, 0x85, 0x83); - -// -// Specifies, in milliseconds, the minimum amount of time a core must be parked before it can be unparked. -// -// {2ddd5a84-5a71-437e-912a-db0b8c788732} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_INCREASE_TIME, 0x2ddd5a84, 0x5a71, 0x437e, 0x91, 0x2a, 0xdb, 0x0b, 0x8c, 0x78, 0x87, 0x32); - -// -// Specifies, in milliseconds, the minimum amount of time a core must be unparked before it can be parked. -// -// {dfd10d17-d5eb-45dd-877a-9a34ddd15c82} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_DECREASE_TIME, 0xdfd10d17, 0xd5eb, 0x45dd, 0x87, 0x7a, 0x9a, 0x34, 0xdd, 0xd1, 0x5c, 0x82); - -// -// Specifies the factor by which to decrease affinity history on each core after each check. -// -// {8f7b45e3-c393-480a-878c-f67ac3d07082} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_DECREASE_FACTOR, 0x8f7b45e3, 0xc393, 0x480a, 0x87, 0x8c, 0xf6, 0x7a, 0xc3, 0xd0, 0x70, 0x82); - -// -// Specifies the threshold above which a core is considered to have had significant affinitized work scheduled to it while parked. -// -// {5b33697b-e89d-4d38-aa46-9e7dfb7cd2f9} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_HISTORY_THRESHOLD, 0x5b33697b, 0xe89d, 0x4d38, 0xaa, 0x46, 0x9e, 0x7d, 0xfb, 0x7c, 0xd2, 0xf9); - -// -// Specifies the weighting given to each occurence where affinitized work was scheduled to a parked core. -// -// {e70867f1-fa2f-4f4e-aea1-4d8a0ba23b20} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_AFFINITY_WEIGHTING, 0xe70867f1, 0xfa2f, 0x4f4e, 0xae, 0xa1, 0x4d, 0x8a, 0x0b, 0xa2, 0x3b, 0x20); - -// -// Specifies the factor by which to decrease the over utilization history on each core after the current performance check. -// -// {1299023c-bc28-4f0a-81ec-d3295a8d815d} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_DECREASE_FACTOR, 0x1299023c, 0xbc28, 0x4f0a, 0x81, 0xec, 0xd3, 0x29, 0x5a, 0x8d, 0x81, 0x5d); - -// -// Specifies the threshold above which a core is considered to have been recently over utilized while parked. -// -// {9ac18e92-aa3c-4e27-b307-01ae37307129} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_HISTORY_THRESHOLD, 0x9ac18e92, 0xaa3c, 0x4e27, 0xb3, 0x07, 0x01, 0xae, 0x37, 0x30, 0x71, 0x29); - -// -// Specifies the weighting given to each occurence where a parked core is found to be over utilized. -// -// {8809c2d8-b155-42d4-bcda-0d345651b1db} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_WEIGHTING, 0x8809c2d8, 0xb155, 0x42d4, 0xbc, 0xda, 0x0d, 0x34, 0x56, 0x51, 0xb1, 0xdb); - -// -// Specifies, in percentage, the busy threshold that must be met before a parked core is considered over utilized. -// -// {943c8cb6-6f93-4227-ad87-e9a3feec08d1} -// -DEFINE_GUID( GUID_PROCESSOR_CORE_PARKING_OVER_UTILIZATION_THRESHOLD, 0x943c8cb6, 0x6f93, 0x4227, 0xad, 0x87, 0xe9, 0xa3, 0xfe, 0xec, 0x08, 0xd1); - -// -// Specifies if at least one processor per core should always remain unparked. -// -// {a55612aa-f624-42c6-a443-7397d064c04f} -// - -DEFINE_GUID( GUID_PROCESSOR_PARKING_CORE_OVERRIDE, 0xa55612aa, 0xf624, 0x42c6, 0xa4, 0x43, 0x73, 0x97, 0xd0, 0x64, 0xc0, 0x4f); - -// -// Specifies what performance state a processor should enter when first parked. -// -// {447235c7-6a8d-4cc0-8e24-9eaf70b96e2b} -// - -DEFINE_GUID( GUID_PROCESSOR_PARKING_PERF_STATE, 0x447235c7, 0x6a8d, 0x4cc0, 0x8e, 0x24, 0x9e, 0xaf, 0x70, 0xb9, 0x6e, 0x2b); - -// -// Specifies the number of perf time check intervals to average utility over. -// -// {7d24baa7-0b84-480f-840c-1b0743c00f5f} -// -DEFINE_GUID( GUID_PROCESSOR_PERF_HISTORY, 0x7d24baa7, 0x0b84, 0x480f, 0x84, 0x0c, 0x1b, 0x07, 0x43, 0xc0, 0x0f, 0x5f); - -// -// Specifies active vs passive cooling. Although not directly related to -// processor settings, it is the processor that gets throttled if we're doing -// passive cooling, so it is fairly strongly related. -// {94D3A615-A899-4AC5-AE2B-E4D8F634367F} -// -DEFINE_GUID( GUID_SYSTEM_COOLING_POLICY, 0x94D3A615, 0xA899, 0x4AC5, 0xAE, 0x2B, 0xE4, 0xD8, 0xF6, 0x34, 0x36, 0x7F); - -// Lock Console on Wake -// -------------------- -// - -// Specifies the behavior of the system when we wake from standby or -// hibernate. If this is set, then we will cause the console to lock -// after we resume. -// -DEFINE_GUID( GUID_LOCK_CONSOLE_ON_WAKE, 0x0E796BDB, 0x100D, 0x47D6, 0xA2, 0xD5, 0xF7, 0xD2, 0xDA, 0xA5, 0x1F, 0x51 ); - -// Device idle characteristics -// --------------------------- -// -// Specifies whether to use the "performance" or "conservative" timeouts for -// device idle management. -// -// 4faab71a-92e5-4726-b531-224559672d19 -// -DEFINE_GUID( GUID_DEVICE_IDLE_POLICY, 0x4faab71a, 0x92e5, 0x4726, 0xb5, 0x31, 0x22, 0x45, 0x59, 0x67, 0x2d, 0x19 ); - -#define POWER_DEVICE_IDLE_POLICY_PERFORMANCE 0 -#define POWER_DEVICE_IDLE_POLICY_CONSERVATIVE 1 - -// AC/DC power source -// ------------------ -// - -// Specifies the power source for the system. consumers may register for -// notification when the power source changes and will be notified with -// one of 3 values: -// 0 - Indicates the system is being powered by an AC power source. -// 1 - Indicates the system is being powered by a DC power source. -// 2 - Indicates the system is being powered by a short-term DC power -// source. For example, this would be the case if the system is -// being powed by a short-term battery supply in a backing UPS -// system. When this value is recieved, the consumer should make -// preparations for either a system hibernate or system shutdown. -// -// { 5D3E9A59-E9D5-4B00-A6BD-FF34FF516548 } -DEFINE_GUID( GUID_ACDC_POWER_SOURCE, 0x5D3E9A59, 0xE9D5, 0x4B00, 0xA6, 0xBD, 0xFF, 0x34, 0xFF, 0x51, 0x65, 0x48 ); - -// Lid state changes -// ----------------- -// -// Specifies the current state of the lid (open or closed). The callback won't -// be called at all until a lid device is found and its current state is known. -// -// Values: -// -// 0 - closed -// 1 - opened -// -// { BA3E0F4D-B817-4094-A2D1-D56379E6A0F3 } -// - -DEFINE_GUID( GUID_LIDSWITCH_STATE_CHANGE, 0xBA3E0F4D, 0xB817, 0x4094, 0xA2, 0xD1, 0xD5, 0x63, 0x79, 0xE6, 0xA0, 0xF3 ); - -// Battery life remaining -// ---------------------- -// - -// Specifies the percentage of battery life remaining. The consumer -// may register for notification in order to track battery life in -// a fine-grained manner. -// -// Once registered, the consumer can expect to be notified as the battery -// life percentage changes. -// -// The consumer will recieve a value between 0 and 100 (inclusive) which -// indicates percent battery life remaining. -// -// { A7AD8041-B45A-4CAE-87A3-EECBB468A9E1 } -DEFINE_GUID( GUID_BATTERY_PERCENTAGE_REMAINING, 0xA7AD8041, 0xB45A, 0x4CAE, 0x87, 0xA3, 0xEE, 0xCB, 0xB4, 0x68, 0xA9, 0xE1 ); - - -// Notification to listeners that the system is fairly busy and won't be moving -// into an idle state any time soon. This can be used as a hint to listeners -// that now might be a good time to do background tasks. -// -DEFINE_GUID( GUID_IDLE_BACKGROUND_TASK, 0x515C31D8, 0xF734, 0x163D, 0xA0, 0xFD, 0x11, 0xA0, 0x8C, 0x91, 0xE8, 0xF1 ); - -// Notification to listeners that the system is fairly busy and won't be moving -// into an idle state any time soon. This can be used as a hint to listeners -// that now might be a good time to do background tasks. -// -// { CF23F240-2A54-48D8-B114-DE1518FF052E } -DEFINE_GUID( GUID_BACKGROUND_TASK_NOTIFICATION, 0xCF23F240, 0x2A54, 0x48D8, 0xB1, 0x14, 0xDE, 0x15, 0x18, 0xFF, 0x05, 0x2E ); - -// Define a GUID that will represent the action of a direct experience button -// on the platform. Users will register for this DPPE setting and recieve -// notification when the h/w button is pressed. -// -// { 1A689231-7399-4E9A-8F99-B71F999DB3FA } -// -DEFINE_GUID( GUID_APPLAUNCH_BUTTON, 0x1A689231, 0x7399, 0x4E9A, 0x8F, 0x99, 0xB7, 0x1F, 0x99, 0x9D, 0xB3, 0xFA ); - -// PCI Express power settings -// ------------------------ -// - -// Specifies the subgroup which will contain all of the PCI Express -// settings for a single policy. -// -// {501a4d13-42af-4429-9fd1-a8218c268e20} -// -DEFINE_GUID( GUID_PCIEXPRESS_SETTINGS_SUBGROUP, 0x501a4d13, 0x42af,0x4429, 0x9f, 0xd1, 0xa8, 0x21, 0x8c, 0x26, 0x8e, 0x20 ); - -// Specifies the PCI Express ASPM power policy. -// -// {ee12f906-d277-404b-b6da-e5fa1a576df5} -// -DEFINE_GUID( GUID_PCIEXPRESS_ASPM_POLICY, 0xee12f906, 0xd277, 0x404b, 0xb6, 0xda, 0xe5, 0xfa, 0x1a, 0x57, 0x6d, 0xf5 ); - -// POWER Shutdown settings -// ------------------------ -// - -// Specifies if forced shutdown should be used for all button and lid initiated -// shutdown actions. -// -// {833a6b62-dfa4-46d1-82f8-e09e34d029d6} -// - -DEFINE_GUID( GUID_ENABLE_SWITCH_FORCED_SHUTDOWN, 0x833a6b62, 0xdfa4, 0x46d1, 0x82, 0xf8, 0xe0, 0x9e, 0x34, 0xd0, 0x29, 0xd6 ); - - -#ifndef _PO_DDK_ -#define _PO_DDK_ - - - -typedef enum _SYSTEM_POWER_STATE { - PowerSystemUnspecified = 0, - PowerSystemWorking = 1, - PowerSystemSleeping1 = 2, - PowerSystemSleeping2 = 3, - PowerSystemSleeping3 = 4, - PowerSystemHibernate = 5, - PowerSystemShutdown = 6, - PowerSystemMaximum = 7 -} SYSTEM_POWER_STATE, *PSYSTEM_POWER_STATE; - -#define POWER_SYSTEM_MAXIMUM 7 - -typedef enum { - PowerActionNone = 0, - PowerActionReserved, - PowerActionSleep, - PowerActionHibernate, - PowerActionShutdown, - PowerActionShutdownReset, - PowerActionShutdownOff, - PowerActionWarmEject -} POWER_ACTION, *PPOWER_ACTION; - -typedef enum _DEVICE_POWER_STATE { - PowerDeviceUnspecified = 0, - PowerDeviceD0, - PowerDeviceD1, - PowerDeviceD2, - PowerDeviceD3, - PowerDeviceMaximum -} DEVICE_POWER_STATE, *PDEVICE_POWER_STATE; - -typedef enum _MONITOR_DISPLAY_STATE { - PowerMonitorOff = 0, - PowerMonitorOn, - PowerMonitorDim -} MONITOR_DISPLAY_STATE, *PMONITOR_DISPLAY_STATE; - - - -typedef union _POWER_STATE { - SYSTEM_POWER_STATE SystemState; - DEVICE_POWER_STATE DeviceState; -} POWER_STATE, *PPOWER_STATE; - -typedef enum _POWER_STATE_TYPE { - SystemPowerState = 0, - DevicePowerState -} POWER_STATE_TYPE, *PPOWER_STATE_TYPE; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _SYSTEM_POWER_STATE_CONTEXT { - union { - struct { - ULONG Reserved1 : 8; - ULONG TargetSystemState : 4; - ULONG EffectiveSystemState : 4; - ULONG CurrentSystemState : 4; - ULONG IgnoreHibernationPath : 1; - ULONG PseudoTransition : 1; - ULONG Reserved2 : 10; - } DUMMYSTRUCTNAME; - - ULONG ContextAsUlong; - } DUMMYUNIONNAME; -} SYSTEM_POWER_STATE_CONTEXT, *PSYSTEM_POWER_STATE_CONTEXT; -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef struct _COUNTED_REASON_CONTEXT { - ULONG Version; - ULONG Flags; - union { - struct { - UNICODE_STRING ResourceFileName; - USHORT ResourceReasonId; - ULONG StringCount; - PUNICODE_STRING __field_ecount(StringCount) ReasonStrings; - } DUMMYSTRUCTNAME; - - UNICODE_STRING SimpleString; - } DUMMYUNIONNAME; -} COUNTED_REASON_CONTEXT, *PCOUNTED_REASON_CONTEXT; - -#endif // (NTDDI_VERSION >= NTDDI_WIN7) - -// -// Generic power related IOCTLs -// - -#define IOCTL_QUERY_DEVICE_POWER_STATE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x0, METHOD_BUFFERED, FILE_READ_ACCESS) - -#define IOCTL_SET_DEVICE_WAKE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x1, METHOD_BUFFERED, FILE_WRITE_ACCESS) - -#define IOCTL_CANCEL_DEVICE_WAKE \ - CTL_CODE(FILE_DEVICE_BATTERY, 0x2, METHOD_BUFFERED, FILE_WRITE_ACCESS) - - -// -// Defines for W32 interfaces -// - - - -#define ES_SYSTEM_REQUIRED ((ULONG)0x00000001) -#define ES_DISPLAY_REQUIRED ((ULONG)0x00000002) -#define ES_USER_PRESENT ((ULONG)0x00000004) -#define ES_AWAYMODE_REQUIRED ((ULONG)0x00000040) -#define ES_CONTINUOUS ((ULONG)0x80000000) - -typedef ULONG EXECUTION_STATE, *PEXECUTION_STATE; - -typedef enum { - LT_DONT_CARE, - LT_LOWEST_LATENCY -} LATENCY_TIME; - -#if (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - -#define DIAGNOSTIC_REASON_VERSION 0 - -#define DIAGNOSTIC_REASON_SIMPLE_STRING 0x00000001 -#define DIAGNOSTIC_REASON_DETAILED_STRING 0x00000002 -#define DIAGNOSTIC_REASON_NOT_SPECIFIED 0x80000000 -#define DIAGNOSTIC_REASON_INVALID_FLAGS (~0x80000003) - -#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN7) - -// -// Defines for power request APIs -// - -#define POWER_REQUEST_CONTEXT_VERSION 0 - -#define POWER_REQUEST_CONTEXT_SIMPLE_STRING 0x00000001 -#define POWER_REQUEST_CONTEXT_DETAILED_STRING 0x00000002 - -// -// N.B. The maximum is a macro (rather than part of enum) for cgen to be able -// to parse power.h correctly. When a new power request type is added, the -// PowerRequestMaximum should be manually incremented. -// - -typedef enum _POWER_REQUEST_TYPE { - PowerRequestDisplayRequired, - PowerRequestSystemRequired, - PowerRequestAwayModeRequired -} POWER_REQUEST_TYPE, *PPOWER_REQUEST_TYPE; - -#define PowerRequestMaximum 3 - - - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -//----------------------------------------------------------------------------- -// Device Power Information -// Accessable via CM_Get_DevInst_Registry_Property_Ex(CM_DRP_DEVICE_POWER_DATA) -//----------------------------------------------------------------------------- - -#define PDCAP_D0_SUPPORTED 0x00000001 -#define PDCAP_D1_SUPPORTED 0x00000002 -#define PDCAP_D2_SUPPORTED 0x00000004 -#define PDCAP_D3_SUPPORTED 0x00000008 -#define PDCAP_WAKE_FROM_D0_SUPPORTED 0x00000010 -#define PDCAP_WAKE_FROM_D1_SUPPORTED 0x00000020 -#define PDCAP_WAKE_FROM_D2_SUPPORTED 0x00000040 -#define PDCAP_WAKE_FROM_D3_SUPPORTED 0x00000080 -#define PDCAP_WARM_EJECT_SUPPORTED 0x00000100 - -typedef struct CM_Power_Data_s { - ULONG PD_Size; - DEVICE_POWER_STATE PD_MostRecentPowerState; - ULONG PD_Capabilities; - ULONG PD_D1Latency; - ULONG PD_D2Latency; - ULONG PD_D3Latency; - DEVICE_POWER_STATE PD_PowerStateMapping[POWER_SYSTEM_MAXIMUM]; - SYSTEM_POWER_STATE PD_DeepestSystemWake; -} CM_POWER_DATA, *PCM_POWER_DATA; - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - - - -typedef enum { - SystemPowerPolicyAc, - SystemPowerPolicyDc, - VerifySystemPolicyAc, - VerifySystemPolicyDc, - SystemPowerCapabilities, - SystemBatteryState, - SystemPowerStateHandler, - ProcessorStateHandler, - SystemPowerPolicyCurrent, - AdministratorPowerPolicy, - SystemReserveHiberFile, - ProcessorInformation, - SystemPowerInformation, - ProcessorStateHandler2, - LastWakeTime, // Compare with KeQueryInterruptTime() - LastSleepTime, // Compare with KeQueryInterruptTime() - SystemExecutionState, - SystemPowerStateNotifyHandler, - ProcessorPowerPolicyAc, - ProcessorPowerPolicyDc, - VerifyProcessorPowerPolicyAc, - VerifyProcessorPowerPolicyDc, - ProcessorPowerPolicyCurrent, - SystemPowerStateLogging, - SystemPowerLoggingEntry, - SetPowerSettingValue, - NotifyUserPowerSetting, - PowerInformationLevelUnused0, - PowerInformationLevelUnused1, - SystemVideoState, - TraceApplicationPowerMessage, - TraceApplicationPowerMessageEnd, - ProcessorPerfStates, - ProcessorIdleStates, - ProcessorCap, - SystemWakeSource, - SystemHiberFileInformation, - TraceServicePowerMessage, - ProcessorLoad, - PowerShutdownNotification, - MonitorCapabilities, - SessionPowerInit, - SessionDisplayState, - PowerRequestCreate, - PowerRequestAction, - GetPowerRequestList, - ProcessorInformationEx, - NotifyUserModeLegacyPowerEvent, - GroupPark, - ProcessorIdleDomains, - WakeTimerList, - SystemHiberFileSize, - PowerInformationLevelMaximum -} POWER_INFORMATION_LEVEL; - -// -// Power Setting definitions -// - -typedef enum { - PoAc, - PoDc, - PoHot, - PoConditionMaximum -} SYSTEM_POWER_CONDITION; - -typedef struct { - - // - // Version of this structure. Currently should be set to - // POWER_SETTING_VALUE_VERSION. - // - ULONG Version; - - - // - // GUID representing the power setting being applied. - // - GUID Guid; - - - // - // What power state should this setting be applied to? E.g. - // AC, DC, thermal, ... - // - SYSTEM_POWER_CONDITION PowerCondition; - - // - // Length (in bytes) of the 'Data' member. - // - ULONG DataLength; - - // - // Data which contains the actual setting value. - // - UCHAR Data[ANYSIZE_ARRAY]; -} SET_POWER_SETTING_VALUE, *PSET_POWER_SETTING_VALUE; - -#define POWER_SETTING_VALUE_VERSION (0x1) - -typedef struct { - GUID Guid; -} NOTIFY_USER_POWER_SETTING, *PNOTIFY_USER_POWER_SETTING; - -// -// Package definition for an experience button device notification. When -// someone registers for GUID_EXPERIENCE_BUTTON, this is the definition of -// the setting data they'll get. -// -typedef struct _APPLICATIONLAUNCH_SETTING_VALUE { - - // - // System time when the most recent button press ocurred. Note that this is - // specified in 100ns internvals since January 1, 1601. - // - LARGE_INTEGER ActivationTime; - - // - // Reserved for internal use. - // - ULONG Flags; - - // - // which instance of this device was pressed? - // - ULONG ButtonInstanceID; - - -} APPLICATIONLAUNCH_SETTING_VALUE, *PAPPLICATIONLAUNCH_SETTING_VALUE; - -// -// define platform roles -// - -typedef enum { - PlatformRoleUnspecified = 0, - PlatformRoleDesktop, - PlatformRoleMobile, - PlatformRoleWorkstation, - PlatformRoleEnterpriseServer, - PlatformRoleSOHOServer, - PlatformRoleAppliancePC, - PlatformRolePerformanceServer, - PlatformRoleMaximum -} POWER_PLATFORM_ROLE; - -// -// System power manager capabilities -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_) -typedef struct { - ULONG Granularity; - ULONG Capacity; -} BATTERY_REPORTING_SCALE, *PBATTERY_REPORTING_SCALE; -#endif // (NTDDI_VERSION >= NTDDI_WINXP) || !defined(_BATCLASS_) - - -#endif // !_PO_DDK_ - -// -// Predefined Value Types. -// - -#define REG_NONE ( 0 ) // No value type -#define REG_SZ ( 1 ) // Unicode nul terminated string -#define REG_EXPAND_SZ ( 2 ) // Unicode nul terminated string - // (with environment variable references) -#define REG_BINARY ( 3 ) // Free form binary -#define REG_DWORD ( 4 ) // 32-bit number -#define REG_DWORD_LITTLE_ENDIAN ( 4 ) // 32-bit number (same as REG_DWORD) -#define REG_DWORD_BIG_ENDIAN ( 5 ) // 32-bit number -#define REG_LINK ( 6 ) // Symbolic Link (unicode) -#define REG_MULTI_SZ ( 7 ) // Multiple Unicode strings -#define REG_RESOURCE_LIST ( 8 ) // Resource list in the resource map -#define REG_FULL_RESOURCE_DESCRIPTOR ( 9 ) // Resource list in the hardware description -#define REG_RESOURCE_REQUIREMENTS_LIST ( 10 ) -#define REG_QWORD ( 11 ) // 64-bit number -#define REG_QWORD_LITTLE_ENDIAN ( 11 ) // 64-bit number (same as REG_QWORD) - -// -// Service Types (Bit Mask) -// -#define SERVICE_KERNEL_DRIVER 0x00000001 -#define SERVICE_FILE_SYSTEM_DRIVER 0x00000002 -#define SERVICE_ADAPTER 0x00000004 -#define SERVICE_RECOGNIZER_DRIVER 0x00000008 - -#define SERVICE_DRIVER (SERVICE_KERNEL_DRIVER | \ - SERVICE_FILE_SYSTEM_DRIVER | \ - SERVICE_RECOGNIZER_DRIVER) - -#define SERVICE_WIN32_OWN_PROCESS 0x00000010 -#define SERVICE_WIN32_SHARE_PROCESS 0x00000020 -#define SERVICE_WIN32 (SERVICE_WIN32_OWN_PROCESS | \ - SERVICE_WIN32_SHARE_PROCESS) - -#define SERVICE_INTERACTIVE_PROCESS 0x00000100 - -#define SERVICE_TYPE_ALL (SERVICE_WIN32 | \ - SERVICE_ADAPTER | \ - SERVICE_DRIVER | \ - SERVICE_INTERACTIVE_PROCESS) - -// -// Start Type -// - -#define SERVICE_BOOT_START 0x00000000 -#define SERVICE_SYSTEM_START 0x00000001 -#define SERVICE_AUTO_START 0x00000002 -#define SERVICE_DEMAND_START 0x00000003 -#define SERVICE_DISABLED 0x00000004 - -// -// Error control type -// -#define SERVICE_ERROR_IGNORE 0x00000000 -#define SERVICE_ERROR_NORMAL 0x00000001 -#define SERVICE_ERROR_SEVERE 0x00000002 -#define SERVICE_ERROR_CRITICAL 0x00000003 - -// -// -// Define the registry driver node enumerations -// - -typedef enum _CM_SERVICE_NODE_TYPE { - DriverType = SERVICE_KERNEL_DRIVER, - FileSystemType = SERVICE_FILE_SYSTEM_DRIVER, - Win32ServiceOwnProcess = SERVICE_WIN32_OWN_PROCESS, - Win32ServiceShareProcess = SERVICE_WIN32_SHARE_PROCESS, - AdapterType = SERVICE_ADAPTER, - RecognizerType = SERVICE_RECOGNIZER_DRIVER -} SERVICE_NODE_TYPE; - -typedef enum _CM_SERVICE_LOAD_TYPE { - BootLoad = SERVICE_BOOT_START, - SystemLoad = SERVICE_SYSTEM_START, - AutoLoad = SERVICE_AUTO_START, - DemandLoad = SERVICE_DEMAND_START, - DisableLoad = SERVICE_DISABLED -} SERVICE_LOAD_TYPE; - -typedef enum _CM_ERROR_CONTROL_TYPE { - IgnoreError = SERVICE_ERROR_IGNORE, - NormalError = SERVICE_ERROR_NORMAL, - SevereError = SERVICE_ERROR_SEVERE, - CriticalError = SERVICE_ERROR_CRITICAL -} SERVICE_ERROR_TYPE; - -// -// Service node Flags. These flags are used by the OS loader to promote -// a driver's start type to boot start if the system is booting using -// the specified mechanism. The flags should be set in the driver's -// registry configuration. -// -// CM_SERVICE_NETWORK_BOOT_LOAD - Specified if a driver should be -// promoted on network boot. -// -// CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD - Specified if a driver should be -// promoted on booting from a VHD. -// -// CM_SERVICE_USB_DISK_BOOT_LOAD - Specified if a driver should be promoted -// while booting from a USB disk. -// - -#define CM_SERVICE_NETWORK_BOOT_LOAD 0x00000001 -#define CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD 0x00000002 -#define CM_SERVICE_USB_DISK_BOOT_LOAD 0x00000004 - -// -// Mask defining the legal promotion flag values. -// - -#define CM_SERVICE_VALID_PROMOTION_MASK (CM_SERVICE_NETWORK_BOOT_LOAD | \ - CM_SERVICE_VIRTUAL_DISK_BOOT_LOAD | \ - CM_SERVICE_USB_DISK_BOOT_LOAD) - - - -// -// Resource List definitions -// - - - -// -// Defines the Type in the RESOURCE_DESCRIPTOR -// -// NOTE: For all CM_RESOURCE_TYPE values, there must be a -// corresponding ResType value in the 32-bit ConfigMgr headerfile -// (cfgmgr32.h). Values in the range [0x6,0x80) use the same values -// as their ConfigMgr counterparts. CM_RESOURCE_TYPE values with -// the high bit set (i.e., in the range [0x80,0xFF]), are -// non-arbitrated resources. These correspond to the same values -// in cfgmgr32.h that have their high bit set (however, since -// cfgmgr32.h uses 16 bits for ResType values, these values are in -// the range [0x8000,0x807F). Note that ConfigMgr ResType values -// cannot be in the range [0x8080,0xFFFF), because they would not -// be able to map into CM_RESOURCE_TYPE values. (0xFFFF itself is -// a special value, because it maps to CmResourceTypeDeviceSpecific.) -// - -typedef int CM_RESOURCE_TYPE; - -// CmResourceTypeNull is reserved - -#define CmResourceTypeNull 0 // ResType_All or ResType_None (0x0000) -#define CmResourceTypePort 1 // ResType_IO (0x0002) -#define CmResourceTypeInterrupt 2 // ResType_IRQ (0x0004) -#define CmResourceTypeMemory 3 // ResType_Mem (0x0001) -#define CmResourceTypeDma 4 // ResType_DMA (0x0003) -#define CmResourceTypeDeviceSpecific 5 // ResType_ClassSpecific (0xFFFF) -#define CmResourceTypeBusNumber 6 // ResType_BusNumber (0x0006) -#define CmResourceTypeMemoryLarge 7 // ResType_MemLarge (0x0007) -#define CmResourceTypeNonArbitrated 128 // Not arbitrated if 0x80 bit set -#define CmResourceTypeConfigData 128 // ResType_Reserved (0x8000) -#define CmResourceTypeDevicePrivate 129 // ResType_DevicePrivate (0x8001) -#define CmResourceTypePcCardConfig 130 // ResType_PcCardConfig (0x8002) -#define CmResourceTypeMfCardConfig 131 // ResType_MfCardConfig (0x8003) - -// -// Defines the ShareDisposition in the RESOURCE_DESCRIPTOR -// - -typedef enum _CM_SHARE_DISPOSITION { - CmResourceShareUndetermined = 0, // Reserved - CmResourceShareDeviceExclusive, - CmResourceShareDriverExclusive, - CmResourceShareShared -} CM_SHARE_DISPOSITION; - -// -// Define the bit masks for Flags when type is CmResourceTypeInterrupt -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE 0 -#define CM_RESOURCE_INTERRUPT_LATCHED 1 -#define CM_RESOURCE_INTERRUPT_MESSAGE 2 -#define CM_RESOURCE_INTERRUPT_POLICY_INCLUDED 4 - -// -// A bitmask defining the bits in a resource or requirements descriptor -// flags field that corresponds to the latch mode or a level triggered -// interrupt. -// - -#define CM_RESOURCE_INTERRUPT_LEVEL_LATCHED_BITS 0x0001 - -// -// Define the token value used for an interrupt vector to mean that the vector -// is message signaled. This value is used in the MaximumVector field. -// - -#define CM_RESOURCE_INTERRUPT_MESSAGE_TOKEN ((ULONG)-2) - -// -// Define the bit masks for Flags when type is CmResourceTypeMemory -// or CmResourceTypeMemoryLarge -// - -#define CM_RESOURCE_MEMORY_READ_WRITE 0x0000 -#define CM_RESOURCE_MEMORY_READ_ONLY 0x0001 -#define CM_RESOURCE_MEMORY_WRITE_ONLY 0x0002 -#define CM_RESOURCE_MEMORY_WRITEABILITY_MASK 0x0003 -#define CM_RESOURCE_MEMORY_PREFETCHABLE 0x0004 - -#define CM_RESOURCE_MEMORY_COMBINEDWRITE 0x0008 -#define CM_RESOURCE_MEMORY_24 0x0010 -#define CM_RESOURCE_MEMORY_CACHEABLE 0x0020 -#define CM_RESOURCE_MEMORY_WINDOW_DECODE 0x0040 -#define CM_RESOURCE_MEMORY_BAR 0x0080 - -#define CM_RESOURCE_MEMORY_COMPAT_FOR_INACCESSIBLE_RANGE 0x0100 - -// -// Define the bit masks exclusive to type CmResourceTypeMemoryLarge. -// - -#define CM_RESOURCE_MEMORY_LARGE 0x0E00 -#define CM_RESOURCE_MEMORY_LARGE_40 0x0200 -#define CM_RESOURCE_MEMORY_LARGE_48 0x0400 -#define CM_RESOURCE_MEMORY_LARGE_64 0x0800 - -// -// Define limits for large memory resources -// - -#define CM_RESOURCE_MEMORY_LARGE_40_MAXLEN 0x000000FFFFFFFF00 -#define CM_RESOURCE_MEMORY_LARGE_48_MAXLEN 0x0000FFFFFFFF0000 -#define CM_RESOURCE_MEMORY_LARGE_64_MAXLEN 0xFFFFFFFF00000000 - -// -// Define the bit masks for Flags when type is CmResourceTypePort -// - -#define CM_RESOURCE_PORT_MEMORY 0x0000 -#define CM_RESOURCE_PORT_IO 0x0001 -#define CM_RESOURCE_PORT_10_BIT_DECODE 0x0004 -#define CM_RESOURCE_PORT_12_BIT_DECODE 0x0008 -#define CM_RESOURCE_PORT_16_BIT_DECODE 0x0010 -#define CM_RESOURCE_PORT_POSITIVE_DECODE 0x0020 -#define CM_RESOURCE_PORT_PASSIVE_DECODE 0x0040 -#define CM_RESOURCE_PORT_WINDOW_DECODE 0x0080 -#define CM_RESOURCE_PORT_BAR 0x0100 - -// -// Define the bit masks for Flags when type is CmResourceTypeDma -// - -#define CM_RESOURCE_DMA_8 0x0000 -#define CM_RESOURCE_DMA_16 0x0001 -#define CM_RESOURCE_DMA_32 0x0002 -#define CM_RESOURCE_DMA_8_AND_16 0x0004 -#define CM_RESOURCE_DMA_BUS_MASTER 0x0008 -#define CM_RESOURCE_DMA_TYPE_A 0x0010 -#define CM_RESOURCE_DMA_TYPE_B 0x0020 -#define CM_RESOURCE_DMA_TYPE_F 0x0040 - - - -// -// This structure defines one type of resource used by a driver. -// -// There can only be *1* DeviceSpecificData block. It must be located at -// the end of all resource descriptors in a full descriptor block. -// - -// -// Make sure alignment is made properly by compiler; otherwise move -// flags back to the top of the structure (common to all members of the -// union). -// - - -#include "pshpack4.h" -typedef struct _CM_PARTIAL_RESOURCE_DESCRIPTOR { - UCHAR Type; - UCHAR ShareDisposition; - USHORT Flags; - union { - - // - // Range of resources, inclusive. These are physical, bus relative. - // It is known that Port and Memory below have the exact same layout - // as Generic. - // - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Generic; - - // - // - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length; - } Port; - - // - // - - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Level; - USHORT Group; -#else - ULONG Level; -#endif - ULONG Vector; - KAFFINITY Affinity; - } Interrupt; - - // - // Values for message signaled interrupts are distinct in the - // raw and translated cases. - // - - struct { - union { - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Group; -#else - USHORT Reserved; -#endif - USHORT MessageCount; - ULONG Vector; - KAFFINITY Affinity; - } Raw; - - struct { -#if defined(NT_PROCESSOR_GROUPS) - USHORT Level; - USHORT Group; -#else - ULONG Level; -#endif - ULONG Vector; - KAFFINITY Affinity; - } Translated; - } DUMMYUNIONNAME; - } MessageInterrupt; - - // - // Range of memory addresses, inclusive. These are physical, bus - // relative. The value should be the same as the one passed to - // HalTranslateBusAddress(). - // - - struct { - PHYSICAL_ADDRESS Start; // 64 bit physical addresses. - ULONG Length; - } Memory; - - // - // Physical DMA channel. - // - - struct { - ULONG Channel; - ULONG Port; - ULONG Reserved1; - } Dma; - - // - // Device driver private data, usually used to help it figure - // what the resource assignments decisions that were made. - // - - struct { - ULONG Data[3]; - } DevicePrivate; - - // - // Bus Number information. - // - - struct { - ULONG Start; - ULONG Length; - ULONG Reserved; - } BusNumber; - - // - // Device Specific information defined by the driver. - // The DataSize field indicates the size of the data in bytes. The - // data is located immediately after the DeviceSpecificData field in - // the structure. - // - - struct { - ULONG DataSize; - ULONG Reserved1; - ULONG Reserved2; - } DeviceSpecificData; - - // The following structures provide support for memory-mapped - // IO resources greater than MAXULONG - struct { - PHYSICAL_ADDRESS Start; - ULONG Length40; - } Memory40; - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length48; - } Memory48; - - struct { - PHYSICAL_ADDRESS Start; - ULONG Length64; - } Memory64; - - - } u; -} CM_PARTIAL_RESOURCE_DESCRIPTOR, *PCM_PARTIAL_RESOURCE_DESCRIPTOR; -#include "poppack.h" - -// -// A Partial Resource List is what can be found in the ARC firmware -// or will be generated by ntdetect.com. -// The configuration manager will transform this structure into a Full -// resource descriptor when it is about to store it in the regsitry. -// -// Note: There must a be a convention to the order of fields of same type, -// (defined on a device by device basis) so that the fields can make sense -// to a driver (i.e. when multiple memory ranges are necessary). -// - -typedef struct _CM_PARTIAL_RESOURCE_LIST { - USHORT Version; - USHORT Revision; - ULONG Count; - CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]; -} CM_PARTIAL_RESOURCE_LIST, *PCM_PARTIAL_RESOURCE_LIST; - -// -// A Full Resource Descriptor is what can be found in the registry. -// This is what will be returned to a driver when it queries the registry -// to get device information; it will be stored under a key in the hardware -// description tree. -// -// Note: There must a be a convention to the order of fields of same type, -// (defined on a device by device basis) so that the fields can make sense -// to a driver (i.e. when multiple memory ranges are necessary). -// - -typedef struct _CM_FULL_RESOURCE_DESCRIPTOR { - INTERFACE_TYPE InterfaceType; // unused for WDM - ULONG BusNumber; // unused for WDM - CM_PARTIAL_RESOURCE_LIST PartialResourceList; -} CM_FULL_RESOURCE_DESCRIPTOR, *PCM_FULL_RESOURCE_DESCRIPTOR; - -// -// The Resource list is what will be stored by the drivers into the -// resource map via the IO API. -// - -typedef struct _CM_RESOURCE_LIST { - ULONG Count; - CM_FULL_RESOURCE_DESCRIPTOR List[1]; -} CM_RESOURCE_LIST, *PCM_RESOURCE_LIST; - - -// -// Define the structures used to interpret configuration data of -// \\Registry\machine\hardware\description tree. -// Basically, these structures are used to interpret component -// sepcific data. -// - -// -// Define DEVICE_FLAGS -// - -typedef struct _DEVICE_FLAGS { - ULONG Failed : 1; - ULONG ReadOnly : 1; - ULONG Removable : 1; - ULONG ConsoleIn : 1; - ULONG ConsoleOut : 1; - ULONG Input : 1; - ULONG Output : 1; -} DEVICE_FLAGS, *PDEVICE_FLAGS; - -// -// Define Component Information structure -// - -typedef struct _CM_COMPONENT_INFORMATION { - DEVICE_FLAGS Flags; - ULONG Version; - ULONG Key; - KAFFINITY AffinityMask; -} CM_COMPONENT_INFORMATION, *PCM_COMPONENT_INFORMATION; - -// -// The following structures are used to interpret x86 -// DeviceSpecificData of CM_PARTIAL_RESOURCE_DESCRIPTOR. -// (Most of the structures are defined by BIOS. They are -// not aligned on word (or dword) boundary. -// - -// -// Define the Rom Block structure -// - -typedef struct _CM_ROM_BLOCK { - ULONG Address; - ULONG Size; -} CM_ROM_BLOCK, *PCM_ROM_BLOCK; - - - -#include "pshpack1.h" - - - -// -// Define INT13 driver parameter block -// - -typedef struct _CM_INT13_DRIVE_PARAMETER { - USHORT DriveSelect; - ULONG MaxCylinders; - USHORT SectorsPerTrack; - USHORT MaxHeads; - USHORT NumberDrives; -} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER; - - - -// -// Define Mca POS data block for slot -// - -typedef struct _CM_MCA_POS_DATA { - USHORT AdapterId; - UCHAR PosData1; - UCHAR PosData2; - UCHAR PosData3; - UCHAR PosData4; -} CM_MCA_POS_DATA, *PCM_MCA_POS_DATA; - -// -// Memory configuration of eisa data block structure -// - -typedef struct _EISA_MEMORY_TYPE { - UCHAR ReadWrite: 1; - UCHAR Cached : 1; - UCHAR Reserved0 :1; - UCHAR Type:2; - UCHAR Shared:1; - UCHAR Reserved1 :1; - UCHAR MoreEntries : 1; -} EISA_MEMORY_TYPE, *PEISA_MEMORY_TYPE; - -typedef struct _EISA_MEMORY_CONFIGURATION { - EISA_MEMORY_TYPE ConfigurationByte; - UCHAR DataSize; - USHORT AddressLowWord; - UCHAR AddressHighByte; - USHORT MemorySize; -} EISA_MEMORY_CONFIGURATION, *PEISA_MEMORY_CONFIGURATION; - - -// -// Interrupt configurationn of eisa data block structure -// - -typedef struct _EISA_IRQ_DESCRIPTOR { - UCHAR Interrupt : 4; - UCHAR Reserved :1; - UCHAR LevelTriggered :1; - UCHAR Shared : 1; - UCHAR MoreEntries : 1; -} EISA_IRQ_DESCRIPTOR, *PEISA_IRQ_DESCRIPTOR; - -typedef struct _EISA_IRQ_CONFIGURATION { - EISA_IRQ_DESCRIPTOR ConfigurationByte; - UCHAR Reserved; -} EISA_IRQ_CONFIGURATION, *PEISA_IRQ_CONFIGURATION; - - -// -// DMA description of eisa data block structure -// - -typedef struct _DMA_CONFIGURATION_BYTE0 { - UCHAR Channel : 3; - UCHAR Reserved : 3; - UCHAR Shared :1; - UCHAR MoreEntries :1; -} DMA_CONFIGURATION_BYTE0; - -typedef struct _DMA_CONFIGURATION_BYTE1 { - UCHAR Reserved0 : 2; - UCHAR TransferSize : 2; - UCHAR Timing : 2; - UCHAR Reserved1 : 2; -} DMA_CONFIGURATION_BYTE1; - -typedef struct _EISA_DMA_CONFIGURATION { - DMA_CONFIGURATION_BYTE0 ConfigurationByte0; - DMA_CONFIGURATION_BYTE1 ConfigurationByte1; -} EISA_DMA_CONFIGURATION, *PEISA_DMA_CONFIGURATION; - - -// -// Port description of eisa data block structure -// - -typedef struct _EISA_PORT_DESCRIPTOR { - UCHAR NumberPorts : 5; - UCHAR Reserved :1; - UCHAR Shared :1; - UCHAR MoreEntries : 1; -} EISA_PORT_DESCRIPTOR, *PEISA_PORT_DESCRIPTOR; - -typedef struct _EISA_PORT_CONFIGURATION { - EISA_PORT_DESCRIPTOR Configuration; - USHORT PortAddress; -} EISA_PORT_CONFIGURATION, *PEISA_PORT_CONFIGURATION; - - -// -// Eisa slot information definition -// N.B. This structure is different from the one defined -// in ARC eisa addendum. -// - -typedef struct _CM_EISA_SLOT_INFORMATION { - UCHAR ReturnCode; - UCHAR ReturnFlags; - UCHAR MajorRevision; - UCHAR MinorRevision; - USHORT Checksum; - UCHAR NumberFunctions; - UCHAR FunctionInformation; - ULONG CompressedId; -} CM_EISA_SLOT_INFORMATION, *PCM_EISA_SLOT_INFORMATION; - - -// -// Eisa function information definition -// - -typedef struct _CM_EISA_FUNCTION_INFORMATION { - ULONG CompressedId; - UCHAR IdSlotFlags1; - UCHAR IdSlotFlags2; - UCHAR MinorRevision; - UCHAR MajorRevision; - UCHAR Selections[26]; - UCHAR FunctionFlags; - UCHAR TypeString[80]; - EISA_MEMORY_CONFIGURATION EisaMemory[9]; - EISA_IRQ_CONFIGURATION EisaIrq[7]; - EISA_DMA_CONFIGURATION EisaDma[4]; - EISA_PORT_CONFIGURATION EisaPort[20]; - UCHAR InitializationData[60]; -} CM_EISA_FUNCTION_INFORMATION, *PCM_EISA_FUNCTION_INFORMATION; - -// -// The following defines the way pnp bios information is stored in -// the registry \\HKEY_LOCAL_MACHINE\HARDWARE\Description\System\MultifunctionAdapter\x -// key, where x is an integer number indicating adapter instance. The -// "Identifier" of the key must equal to "PNP BIOS" and the -// "ConfigurationData" is organized as follow: -// -// CM_PNP_BIOS_INSTALLATION_CHECK + -// CM_PNP_BIOS_DEVICE_NODE for device 1 + -// CM_PNP_BIOS_DEVICE_NODE for device 2 + -// ... -// CM_PNP_BIOS_DEVICE_NODE for device n -// - -// -// Pnp BIOS device node structure -// - -typedef struct _CM_PNP_BIOS_DEVICE_NODE { - USHORT Size; - UCHAR Node; - ULONG ProductId; - UCHAR DeviceType[3]; - USHORT DeviceAttributes; - // followed by AllocatedResourceBlock, PossibleResourceBlock - // and CompatibleDeviceId -} CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE; - -// -// Pnp BIOS Installation check -// - -typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK { - UCHAR Signature[4]; // $PnP (ascii) - UCHAR Revision; - UCHAR Length; - USHORT ControlField; - UCHAR Checksum; - ULONG EventFlagAddress; // Physical address - USHORT RealModeEntryOffset; - USHORT RealModeEntrySegment; - USHORT ProtectedModeEntryOffset; - ULONG ProtectedModeCodeBaseAddress; - ULONG OemDeviceId; - USHORT RealModeDataBaseAddress; - ULONG ProtectedModeDataBaseAddress; -} CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK; - -#include "poppack.h" - -// -// Masks for EISA function information -// - -#define EISA_FUNCTION_ENABLED 0x80 -#define EISA_FREE_FORM_DATA 0x40 -#define EISA_HAS_PORT_INIT_ENTRY 0x20 -#define EISA_HAS_PORT_RANGE 0x10 -#define EISA_HAS_DMA_ENTRY 0x08 -#define EISA_HAS_IRQ_ENTRY 0x04 -#define EISA_HAS_MEMORY_ENTRY 0x02 -#define EISA_HAS_TYPE_ENTRY 0x01 -#define EISA_HAS_INFORMATION EISA_HAS_PORT_RANGE + \ - EISA_HAS_DMA_ENTRY + \ - EISA_HAS_IRQ_ENTRY + \ - EISA_HAS_MEMORY_ENTRY + \ - EISA_HAS_TYPE_ENTRY - -// -// Masks for EISA memory configuration -// - -#define EISA_MORE_ENTRIES 0x80 -#define EISA_SYSTEM_MEMORY 0x00 -#define EISA_MEMORY_TYPE_RAM 0x01 - -// -// Returned error code for EISA bios call -// - -#define EISA_INVALID_SLOT 0x80 -#define EISA_INVALID_FUNCTION 0x81 -#define EISA_INVALID_CONFIGURATION 0x82 -#define EISA_EMPTY_SLOT 0x83 -#define EISA_INVALID_BIOS_CALL 0x86 - - - -// -// The following structures are used to interpret mips -// DeviceSpecificData of CM_PARTIAL_RESOURCE_DESCRIPTOR. -// - -// -// Device data records for adapters. -// - -// -// The device data record for the Emulex SCSI controller. -// - -typedef struct _CM_SCSI_DEVICE_DATA { - USHORT Version; - USHORT Revision; - UCHAR HostIdentifier; -} CM_SCSI_DEVICE_DATA, *PCM_SCSI_DEVICE_DATA; - -// -// Device data records for controllers. -// - -// -// The device data record for the Video controller. -// - -typedef struct _CM_VIDEO_DEVICE_DATA { - USHORT Version; - USHORT Revision; - ULONG VideoClock; -} CM_VIDEO_DEVICE_DATA, *PCM_VIDEO_DEVICE_DATA; - -// -// The device data record for the SONIC network controller. -// - -typedef struct _CM_SONIC_DEVICE_DATA { - USHORT Version; - USHORT Revision; - USHORT DataConfigurationRegister; - UCHAR EthernetAddress[8]; -} CM_SONIC_DEVICE_DATA, *PCM_SONIC_DEVICE_DATA; - -// -// The device data record for the serial controller. -// - -typedef struct _CM_SERIAL_DEVICE_DATA { - USHORT Version; - USHORT Revision; - ULONG BaudClock; -} CM_SERIAL_DEVICE_DATA, *PCM_SERIAL_DEVICE_DATA; - -// -// Device data records for peripherals. -// - -// -// The device data record for the Monitor peripheral. -// - -typedef struct _CM_MONITOR_DEVICE_DATA { - USHORT Version; - USHORT Revision; - USHORT HorizontalScreenSize; - USHORT VerticalScreenSize; - USHORT HorizontalResolution; - USHORT VerticalResolution; - USHORT HorizontalDisplayTimeLow; - USHORT HorizontalDisplayTime; - USHORT HorizontalDisplayTimeHigh; - USHORT HorizontalBackPorchLow; - USHORT HorizontalBackPorch; - USHORT HorizontalBackPorchHigh; - USHORT HorizontalFrontPorchLow; - USHORT HorizontalFrontPorch; - USHORT HorizontalFrontPorchHigh; - USHORT HorizontalSyncLow; - USHORT HorizontalSync; - USHORT HorizontalSyncHigh; - USHORT VerticalBackPorchLow; - USHORT VerticalBackPorch; - USHORT VerticalBackPorchHigh; - USHORT VerticalFrontPorchLow; - USHORT VerticalFrontPorch; - USHORT VerticalFrontPorchHigh; - USHORT VerticalSyncLow; - USHORT VerticalSync; - USHORT VerticalSyncHigh; -} CM_MONITOR_DEVICE_DATA, *PCM_MONITOR_DEVICE_DATA; - -// -// The device data record for the Floppy peripheral. -// - -typedef struct _CM_FLOPPY_DEVICE_DATA { - USHORT Version; - USHORT Revision; - CHAR Size[8]; - ULONG MaxDensity; - ULONG MountDensity; - // - // New data fields for version >= 2.0 - // - UCHAR StepRateHeadUnloadTime; - UCHAR HeadLoadTime; - UCHAR MotorOffTime; - UCHAR SectorLengthCode; - UCHAR SectorPerTrack; - UCHAR ReadWriteGapLength; - UCHAR DataTransferLength; - UCHAR FormatGapLength; - UCHAR FormatFillCharacter; - UCHAR HeadSettleTime; - UCHAR MotorSettleTime; - UCHAR MaximumTrackValue; - UCHAR DataTransferRate; -} CM_FLOPPY_DEVICE_DATA, *PCM_FLOPPY_DEVICE_DATA; - -// -// The device data record for the Keyboard peripheral. -// The KeyboardFlags is defined (by x86 BIOS INT 16h, function 02) as: -// bit 7 : Insert on -// bit 6 : Caps Lock on -// bit 5 : Num Lock on -// bit 4 : Scroll Lock on -// bit 3 : Alt Key is down -// bit 2 : Ctrl Key is down -// bit 1 : Left shift key is down -// bit 0 : Right shift key is down -// - -typedef struct _CM_KEYBOARD_DEVICE_DATA { - USHORT Version; - USHORT Revision; - UCHAR Type; - UCHAR Subtype; - USHORT KeyboardFlags; -} CM_KEYBOARD_DEVICE_DATA, *PCM_KEYBOARD_DEVICE_DATA; - -// -// Declaration of the structure for disk geometries -// - -typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA { - ULONG BytesPerSector; - ULONG NumberOfCylinders; - ULONG SectorsPerTrack; - ULONG NumberOfHeads; -} CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA; - - - -// -// Define the bitmasks for resource options -// - -#define IO_RESOURCE_PREFERRED 0x01 -#define IO_RESOURCE_DEFAULT 0x02 -#define IO_RESOURCE_ALTERNATIVE 0x08 - -// -// Define interrupt affinity policy values -// - -#if defined(NT_PROCESSOR_GROUPS) - -typedef USHORT IRQ_DEVICE_POLICY, *PIRQ_DEVICE_POLICY; -typedef enum _IRQ_DEVICE_POLICY_USHORT { - IrqPolicyMachineDefault = 0, - IrqPolicyAllCloseProcessors = 1, - IrqPolicyOneCloseProcessor = 2, - IrqPolicyAllProcessorsInMachine = 3, - IrqPolicyAllProcessorsInGroup = 3, - IrqPolicySpecifiedProcessors = 4, - IrqPolicySpreadMessagesAcrossAllProcessors = 5 -}; - -#else - -typedef enum _IRQ_DEVICE_POLICY { - IrqPolicyMachineDefault = 0, - IrqPolicyAllCloseProcessors, - IrqPolicyOneCloseProcessor, - IrqPolicyAllProcessorsInMachine, - IrqPolicySpecifiedProcessors, - IrqPolicySpreadMessagesAcrossAllProcessors -} IRQ_DEVICE_POLICY, *PIRQ_DEVICE_POLICY; - -#endif - -// -// Define interrupt priority policy values -// - -typedef enum _IRQ_PRIORITY { - IrqPriorityUndefined = 0, - IrqPriorityLow, - IrqPriorityNormal, - IrqPriorityHigh -} IRQ_PRIORITY, *PIRQ_PRIORITY; - -// -// Define interrupt group affinity policy -// - -typedef enum _IRQ_GROUP_POLICY { - GroupAffinityAllGroupZero = 0, - GroupAffinityDontCare -} IRQ_GROUP_POLICY, *PIRQ_GROUP_POLICY; - -// -// This structure defines one type of resource requested by the driver -// - -typedef struct _IO_RESOURCE_DESCRIPTOR { - UCHAR Option; - UCHAR Type; // use CM_RESOURCE_TYPE - UCHAR ShareDisposition; // use CM_SHARE_DISPOSITION - UCHAR Spare1; - USHORT Flags; // use CM resource flag defines - USHORT Spare2; // align - - union { - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Port; - - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory; - - struct { - ULONG MinimumVector; - ULONG MaximumVector; -#if defined(NT_PROCESSOR_GROUPS) - IRQ_DEVICE_POLICY AffinityPolicy; - USHORT Group; -#else - IRQ_DEVICE_POLICY AffinityPolicy; -#endif - IRQ_PRIORITY PriorityPolicy; - KAFFINITY TargetedProcessors; - } Interrupt; - - struct { - ULONG MinimumChannel; - ULONG MaximumChannel; - } Dma; - - struct { - ULONG Length; - ULONG Alignment; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Generic; - - struct { - ULONG Data[3]; - } DevicePrivate; - - // - // Bus Number information. - // - - struct { - ULONG Length; - ULONG MinBusNumber; - ULONG MaxBusNumber; - ULONG Reserved; - } BusNumber; - - struct { - ULONG Priority; // use LCPRI_Xxx values in cfg.h - ULONG Reserved1; - ULONG Reserved2; - } ConfigData; - - // - // The following structures provide descriptions - // for memory resource requirement greater than MAXULONG - // - - struct { - ULONG Length40; - ULONG Alignment40; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory40; - - struct { - ULONG Length48; - ULONG Alignment48; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory48; - - struct { - ULONG Length64; - ULONG Alignment64; - PHYSICAL_ADDRESS MinimumAddress; - PHYSICAL_ADDRESS MaximumAddress; - } Memory64; - - - } u; - -} IO_RESOURCE_DESCRIPTOR, *PIO_RESOURCE_DESCRIPTOR; - - - - -typedef struct _IO_RESOURCE_LIST { - USHORT Version; - USHORT Revision; - - ULONG Count; - IO_RESOURCE_DESCRIPTOR Descriptors[1]; -} IO_RESOURCE_LIST, *PIO_RESOURCE_LIST; - - -typedef struct _IO_RESOURCE_REQUIREMENTS_LIST { - ULONG ListSize; - INTERFACE_TYPE InterfaceType; // unused for WDM - ULONG BusNumber; // unused for WDM - ULONG SlotNumber; - ULONG Reserved[3]; - ULONG AlternativeLists; - IO_RESOURCE_LIST List[1]; -} IO_RESOURCE_REQUIREMENTS_LIST, *PIO_RESOURCE_REQUIREMENTS_LIST; - -// -// for move macros -// -#ifdef _MAC -#ifndef _INC_STRING -#include -#endif /* _INC_STRING */ -#else -#include -#endif // _MAC - - -#ifndef _SLIST_HEADER_ -#define _SLIST_HEADER_ - -#if defined(_WIN64) - -// -// The type SINGLE_LIST_ENTRY is not suitable for use with SLISTs. For -// WIN64, an entry on an SLIST is required to be 16-byte aligned, while a -// SINGLE_LIST_ENTRY structure has only 8 byte alignment. -// -// Therefore, all SLIST code should use the SLIST_ENTRY type instead of the -// SINGLE_LIST_ENTRY type. -// - -#pragma warning(push) -#pragma warning(disable:4324) // structure padded due to align() -typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY *PSLIST_ENTRY; -typedef struct DECLSPEC_ALIGN(16) _SLIST_ENTRY { - PSLIST_ENTRY Next; -} SLIST_ENTRY; -#pragma warning(pop) - -typedef struct _SLIST_ENTRY32 { - ULONG Next; -} SLIST_ENTRY32, *PSLIST_ENTRY32; - -#else - -#define SLIST_ENTRY SINGLE_LIST_ENTRY -#define _SLIST_ENTRY _SINGLE_LIST_ENTRY -#define PSLIST_ENTRY PSINGLE_LIST_ENTRY - -typedef SLIST_ENTRY SLIST_ENTRY32, *PSLIST_ENTRY32; - -#endif // _WIN64 - -#if defined(_WIN64) - -typedef union DECLSPEC_ALIGN(16) _SLIST_HEADER { - struct { // original struct - ULONGLONG Alignment; - ULONGLONG Region; - } DUMMYSTRUCTNAME; - struct { // 8-byte header - ULONGLONG Depth:16; - ULONGLONG Sequence:9; - ULONGLONG NextEntry:39; - ULONGLONG HeaderType:1; // 0: 8-byte; 1: 16-byte - ULONGLONG Init:1; // 0: uninitialized; 1: initialized - ULONGLONG Reserved:59; - ULONGLONG Region:3; - } Header8; - struct { // ia64 16-byte header - ULONGLONG Depth:16; - ULONGLONG Sequence:48; - ULONGLONG HeaderType:1; // 0: 8-byte; 1: 16-byte - ULONGLONG Init:1; // 0: uninitialized; 1: initialized - ULONGLONG Reserved:2; - ULONGLONG NextEntry:60; // last 4 bits are always 0's - } Header16; - struct { // x64 16-byte header - ULONGLONG Depth:16; - ULONGLONG Sequence:48; - ULONGLONG HeaderType:1; // 0: 8-byte; 1: 16-byte - ULONGLONG Reserved:3; - ULONGLONG NextEntry:60; // last 4 bits are always 0's - } HeaderX64; -} SLIST_HEADER, *PSLIST_HEADER; - -typedef union _SLIST_HEADER32{ - ULONGLONG Alignment; - struct { - SLIST_ENTRY32 Next; - USHORT Depth; - USHORT Sequence; - } DUMMYSTRUCTNAME; -} SLIST_HEADER32, *PSLIST_HEADER32; - -#else - -typedef union _SLIST_HEADER { - ULONGLONG Alignment; - struct { - SLIST_ENTRY Next; - USHORT Depth; - USHORT Sequence; - } DUMMYSTRUCTNAME; -} SLIST_HEADER, *PSLIST_HEADER; - -typedef SLIST_HEADER SLIST_HEADER32, *PSLIST_HEADER32; - -#endif // _WIN64 - -#endif // _SLIST_HEADER_ - -// -// If debugging support enabled, define an ASSERT macro that works. Otherwise -// define the ASSERT macro to expand to an empty expression. -// -// The ASSERT macro has been updated to be an expression instead of a statement. -// - -NTSYSAPI -VOID -NTAPI -RtlAssert( - __in PVOID VoidFailedAssertion, - __in PVOID VoidFileName, - __in ULONG LineNumber, - __in_opt PSTR MutableMessage - ); - -#if DBG - -#define ASSERT( exp ) \ - ((!(exp)) ? \ - (RtlAssert( #exp, __FILE__, __LINE__, NULL ),FALSE) : \ - TRUE) - -#define ASSERTMSG( msg, exp ) \ - ((!(exp)) ? \ - (RtlAssert( #exp, __FILE__, __LINE__, msg ),FALSE) : \ - TRUE) - -#define RTL_SOFT_ASSERT(_exp) \ - ((!(_exp)) ? \ - (DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n", __FILE__, __LINE__, #_exp),FALSE) : \ - TRUE) - -#define RTL_SOFT_ASSERTMSG(_msg, _exp) \ - ((!(_exp)) ? \ - (DbgPrint("%s(%d): Soft assertion failed\n Expression: %s\n Message: %s\n", __FILE__, __LINE__, #_exp, (_msg)),FALSE) : \ - TRUE) - -#if _MSC_VER >= 1300 - -#define NT_ASSERT(_exp) \ - ((!(_exp)) ? \ - (__annotation(L"Debug", L"AssertFail", L#_exp), \ - DbgRaiseAssertionFailure(), FALSE) : \ - TRUE) - -#define NT_ASSERTMSG(_msg, _exp) \ - ((!(_exp)) ? \ - (__annotation(L"Debug", L"AssertFail", L##_msg), \ - DbgRaiseAssertionFailure(), FALSE) : \ - TRUE) - -#define NT_ASSERTMSGW(_msg, _exp) \ - ((!(_exp)) ? \ - (__annotation(L"Debug", L"AssertFail", _msg), \ - DbgRaiseAssertionFailure(), FALSE) : \ - TRUE) - -#define NT_VERIFY NT_ASSERT -#define NT_VERIFYMSG NT_ASSERTMSG -#define NT_VERIFYMSGW NT_ASSERTMSGW - -#endif // #if _MSC_VER >= 1300 - -#define RTL_VERIFY ASSERT -#define RTL_VERIFYMSG ASSERTMSG - -#define RTL_SOFT_VERIFY RTL_SOFT_ASSERT -#define RTL_SOFT_VERIFYMSG RTL_SOFT_ASSERTMSG - -#else -#define ASSERT( exp ) ((void) 0) -#define ASSERTMSG( msg, exp ) ((void) 0) - -#if _MSC_VER >= 1300 - -#define NT_ASSERT(_exp) ((void) 0) -#define NT_ASSERTMSG(_msg, _exp) ((void) 0) -#define NT_ASSERTMSGW(_msg, _exp) ((void) 0) - -#define NT_VERIFY(_exp) ((_exp) ? TRUE : FALSE) -#define NT_VERIFYMSG(_msg, _exp ) ((_exp) ? TRUE : FALSE) -#define NT_VERIFYMSGW(_msg, _exp) ((_exp) ? TRUE : FALSE) - -#endif // #if _MSC_VER >= 1300 - -#define RTL_SOFT_ASSERT(_exp) ((void) 0) -#define RTL_SOFT_ASSERTMSG(_msg, _exp) ((void) 0) - -#define RTL_VERIFY( exp ) ((exp) ? TRUE : FALSE) -#define RTL_VERIFYMSG( msg, exp ) ((exp) ? TRUE : FALSE) - -#define RTL_SOFT_VERIFY(_exp) ((_exp) ? TRUE : FALSE) -#define RTL_SOFT_VERIFYMSG(msg, _exp) ((_exp) ? TRUE : FALSE) - -#endif // DBG - -// -// Doubly-linked list manipulation routines. -// - - -// -// VOID -// InitializeListHead32( -// PLIST_ENTRY32 ListHead -// ); -// - -#define InitializeListHead32(ListHead) (\ - (ListHead)->Flink = (ListHead)->Blink = PtrToUlong((ListHead))) - -#if !defined(MIDL_PASS) && !defined(SORTPP_PASS) - -#define RTL_STATIC_LIST_HEAD(x) LIST_ENTRY x = { &x, &x } - -FORCEINLINE -VOID -InitializeListHead( - __out PLIST_ENTRY ListHead - ) -{ - ListHead->Flink = ListHead->Blink = ListHead; -} - -__checkReturn -BOOLEAN -FORCEINLINE -IsListEmpty( - __in const LIST_ENTRY * ListHead - ) -{ - return (BOOLEAN)(ListHead->Flink == ListHead); -} - -FORCEINLINE -BOOLEAN -RemoveEntryList( - __in PLIST_ENTRY Entry - ) -{ - PLIST_ENTRY Blink; - PLIST_ENTRY Flink; - - Flink = Entry->Flink; - Blink = Entry->Blink; - Blink->Flink = Flink; - Flink->Blink = Blink; - return (BOOLEAN)(Flink == Blink); -} - -FORCEINLINE -PLIST_ENTRY -RemoveHeadList( - __inout PLIST_ENTRY ListHead - ) -{ - PLIST_ENTRY Flink; - PLIST_ENTRY Entry; - - Entry = ListHead->Flink; - Flink = Entry->Flink; - ListHead->Flink = Flink; - Flink->Blink = ListHead; - return Entry; -} - - - -FORCEINLINE -PLIST_ENTRY -RemoveTailList( - __inout PLIST_ENTRY ListHead - ) -{ - PLIST_ENTRY Blink; - PLIST_ENTRY Entry; - - Entry = ListHead->Blink; - Blink = Entry->Blink; - ListHead->Blink = Blink; - Blink->Flink = ListHead; - return Entry; -} - - -FORCEINLINE -VOID -InsertTailList( - __inout PLIST_ENTRY ListHead, - __inout __drv_aliasesMem PLIST_ENTRY Entry - ) -{ - PLIST_ENTRY Blink; - - Blink = ListHead->Blink; - Entry->Flink = ListHead; - Entry->Blink = Blink; - Blink->Flink = Entry; - ListHead->Blink = Entry; -} - - -FORCEINLINE -VOID -InsertHeadList( - __inout PLIST_ENTRY ListHead, - __inout __drv_aliasesMem PLIST_ENTRY Entry - ) -{ - PLIST_ENTRY Flink; - - Flink = ListHead->Flink; - Entry->Flink = Flink; - Entry->Blink = ListHead; - Flink->Blink = Entry; - ListHead->Flink = Entry; -} - -FORCEINLINE -VOID -AppendTailList( - __inout PLIST_ENTRY ListHead, - __inout PLIST_ENTRY ListToAppend - ) -{ - PLIST_ENTRY ListEnd = ListHead->Blink; - - ListHead->Blink->Flink = ListToAppend; - ListHead->Blink = ListToAppend->Blink; - ListToAppend->Blink->Flink = ListHead; - ListToAppend->Blink = ListEnd; -} - -FORCEINLINE -PSINGLE_LIST_ENTRY -PopEntryList( - __inout PSINGLE_LIST_ENTRY ListHead - ) -{ - PSINGLE_LIST_ENTRY FirstEntry; - FirstEntry = ListHead->Next; - if (FirstEntry != NULL) { - ListHead->Next = FirstEntry->Next; - } - - return FirstEntry; -} - - -FORCEINLINE -VOID -PushEntryList( - __inout PSINGLE_LIST_ENTRY ListHead, - __inout __drv_aliasesMem PSINGLE_LIST_ENTRY Entry - ) -{ - Entry->Next = ListHead->Next; - ListHead->Next = Entry; -} - -#endif // !MIDL_PASS - -// -// Subroutines for dealing with the Registry -// - -typedef -__drv_functionClass(RTL_QUERY_REGISTRY_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -NTSTATUS -NTAPI -RTL_QUERY_REGISTRY_ROUTINE( - __in_z PWSTR ValueName, - __in ULONG ValueType, - __in_bcount_opt(ValueLength) PVOID ValueData, - __in ULONG ValueLength, - __in_opt PVOID Context, - __in_opt PVOID EntryContext - ); -typedef RTL_QUERY_REGISTRY_ROUTINE *PRTL_QUERY_REGISTRY_ROUTINE; - -typedef struct _RTL_QUERY_REGISTRY_TABLE { - PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine; - ULONG Flags; - PWSTR Name; - PVOID EntryContext; - ULONG DefaultType; - PVOID DefaultData; - ULONG DefaultLength; - -} RTL_QUERY_REGISTRY_TABLE, *PRTL_QUERY_REGISTRY_TABLE; - - -// -// The following flags specify how the Name field of a RTL_QUERY_REGISTRY_TABLE -// entry is interpreted. A NULL name indicates the end of the table. -// - -#define RTL_QUERY_REGISTRY_SUBKEY 0x00000001 // Name is a subkey and remainder of - // table or until next subkey are value - // names for that subkey to look at. - -#define RTL_QUERY_REGISTRY_TOPKEY 0x00000002 // Reset current key to original key for - // this and all following table entries. - -#define RTL_QUERY_REGISTRY_REQUIRED 0x00000004 // Fail if no match found for this table - // entry. - -#define RTL_QUERY_REGISTRY_NOVALUE 0x00000008 // Used to mark a table entry that has no - // value name, just wants a call out, not - // an enumeration of all values. - -#define RTL_QUERY_REGISTRY_NOEXPAND 0x00000010 // Used to suppress the expansion of - // REG_MULTI_SZ into multiple callouts or - // to prevent the expansion of environment - // variable values in REG_EXPAND_SZ - -#define RTL_QUERY_REGISTRY_DIRECT 0x00000020 // QueryRoutine field ignored. EntryContext - // field points to location to store value. - // For null terminated strings, EntryContext - // points to UNICODE_STRING structure that - // that describes maximum size of buffer. - // If .Buffer field is NULL then a buffer is - // allocated. - // - -#define RTL_QUERY_REGISTRY_DELETE 0x00000040 // Used to delete value keys after they - // are queried. - -#define RTL_QUERY_REGISTRY_NOSTRING 0x00000080 // Used with RTL_QUERY_REGISTRY_DIRECT in - // cases where the caller expects a - // non-string value. Otherwise, the - // assumption that EntryContext points to - // a UNICODE_STRING structure can overrun - // the caller's buffer. - // - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlQueryRegistryValues( - __in ULONG RelativeTo, - __in PCWSTR Path, - __inout __drv_at(*(*QueryTable).EntryContext, __out) - PRTL_QUERY_REGISTRY_TABLE QueryTable, - __in_opt PVOID Context, - __in_opt PVOID Environment - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlWriteRegistryValue( - __in ULONG RelativeTo, - __in PCWSTR Path, - __in_z PCWSTR ValueName, - __in ULONG ValueType, - __in_bcount_opt(ValueLength) PVOID ValueData, - __in ULONG ValueLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlDeleteRegistryValue( - __in ULONG RelativeTo, - __in PCWSTR Path, - __in_z PCWSTR ValueName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateRegistryKey( - __in ULONG RelativeTo, - __in PWSTR Path - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlCheckRegistryKey( - __in ULONG RelativeTo, - __in PWSTR Path - ); -#endif - -// -// The following values for the RelativeTo parameter determine what the -// Path parameter to RtlQueryRegistryValues is relative to. -// - -#define RTL_REGISTRY_ABSOLUTE 0 // Path is a full path -#define RTL_REGISTRY_SERVICES 1 // \Registry\Machine\System\CurrentControlSet\Services -#define RTL_REGISTRY_CONTROL 2 // \Registry\Machine\System\CurrentControlSet\Control -#define RTL_REGISTRY_WINDOWS_NT 3 // \Registry\Machine\Software\Microsoft\Windows NT\CurrentVersion -#define RTL_REGISTRY_DEVICEMAP 4 // \Registry\Machine\Hardware\DeviceMap -#define RTL_REGISTRY_USER 5 // \Registry\User\CurrentUser -#define RTL_REGISTRY_MAXIMUM 6 -#define RTL_REGISTRY_HANDLE 0x40000000 // Low order bits are registry handle -#define RTL_REGISTRY_OPTIONAL 0x80000000 // Indicates the key node is optional - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlIntegerToUnicodeString ( - __in ULONG Value, - __in_opt ULONG Base, - __inout PUNICODE_STRING String - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlInt64ToUnicodeString ( - __in ULONGLONG Value, - __in_opt ULONG Base, - __inout PUNICODE_STRING String - ); -#endif - -#ifdef _WIN64 -#define RtlIntPtrToUnicodeString(Value, Base, String) RtlInt64ToUnicodeString(Value, Base, String) -#else -#define RtlIntPtrToUnicodeString(Value, Base, String) RtlIntegerToUnicodeString(Value, Base, String) -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeStringToInteger ( - __in PCUNICODE_STRING String, - __in_opt ULONG Base, - __out PULONG Value - ); -#endif - -// -// String manipulation routines -// - -#ifdef _NTSYSTEM_ - -#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag -#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag - -#else - -#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) -#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) - -#endif // _NTSYSTEM_ - -extern BOOLEAN NLS_MB_CODE_PAGE_TAG; // TRUE -> Multibyte CP, FALSE -> Singlebyte -extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; // TRUE -> Multibyte CP, FALSE -> Singlebyte - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitString( - __out PSTRING DestinationString, - __in_z_opt __drv_aliasesMem PCSZ SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitAnsiString( - __out PANSI_STRING DestinationString, - __in_z_opt __drv_aliasesMem PCSZ SourceString - ); -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitUnicodeString( - __out PUNICODE_STRING DestinationString, - __in_z_opt __drv_aliasesMem PCWSTR SourceString - ); - -#if !defined(MIDL_PASS) -FORCEINLINE -VOID -RtlInitEmptyUnicodeString( - __out PUNICODE_STRING UnicodeString, - __bcount_opt(BufferSize) __drv_aliasesMem PWCHAR Buffer, - __in USHORT BufferSize - ) -{ - UnicodeString->Length = 0; - UnicodeString->MaximumLength = BufferSize; - UnicodeString->Buffer = Buffer; -} - -FORCEINLINE -VOID -RtlInitEmptyAnsiString( - __out PANSI_STRING AnsiString, - __bcount_opt(BufferSize) __drv_aliasesMem PCHAR Buffer, - __in USHORT BufferSize - ) -{ - AnsiString->Length = 0; - AnsiString->MaximumLength = BufferSize; - AnsiString->Buffer = Buffer; -} -#endif // !defined(MIDL_PASS) - -// -// NLS String functions -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlAnsiStringToUnicodeString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PUNICODE_STRING DestinationString, - __in PCANSI_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(AllocateDestinationString, __checkReturn) -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeStringToAnsiString( - __drv_when(AllocateDestinationString, __out __drv_at(DestinationString->Buffer, __drv_allocatesMem(Mem))) - __drv_when(!AllocateDestinationString, __inout) - PANSI_STRING DestinationString, - __in PCUNICODE_STRING SourceString, - __in BOOLEAN AllocateDestinationString - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -LONG -NTAPI -RtlCompareUnicodeStrings( - __in_ecount(String1Length) PCWCH String1, - __in SIZE_T String1Length, - __in_ecount(String2Length) PCWCH String2, - __in SIZE_T String2Length, - __in BOOLEAN CaseInSensitive - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -LONG -NTAPI -RtlCompareUnicodeString( - __in PCUNICODE_STRING String1, - __in PCUNICODE_STRING String2, - __in BOOLEAN CaseInSensitive - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlEqualUnicodeString( - __in PCUNICODE_STRING String1, - __in PCUNICODE_STRING String2, - __in BOOLEAN CaseInSensitive - ); -#endif - -#define HASH_STRING_ALGORITHM_DEFAULT (0) -#define HASH_STRING_ALGORITHM_X65599 (1) -#define HASH_STRING_ALGORITHM_INVALID (0xffffffff) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlHashUnicodeString( - __in PCUNICODE_STRING String, - __in BOOLEAN CaseInSensitive, - __in ULONG HashAlgorithm, - __out PULONG HashValue - ); - -#endif // NTDDI_VERSION >= NTDDI_WINXP - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlCopyUnicodeString( - __inout PUNICODE_STRING DestinationString, - __in_opt PCUNICODE_STRING SourceString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -NTSTATUS -NTAPI -RtlAppendUnicodeStringToString ( - __inout PUNICODE_STRING Destination, - __in PCUNICODE_STRING Source - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -NTSTATUS -NTAPI -RtlAppendUnicodeToString ( - __inout PUNICODE_STRING Destination, - __in_z_opt PCWSTR Source - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -WCHAR -NTAPI -RtlUpcaseUnicodeChar( - __in WCHAR SourceCharacter - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -WCHAR -NTAPI -RtlDowncaseUnicodeChar( - __in WCHAR SourceCharacter - ); -#endif - -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlFreeUnicodeString( - __inout __drv_at(UnicodeString->Buffer, __drv_freesMem(Mem)) - PUNICODE_STRING UnicodeString - ); - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlFreeAnsiString( - __inout __drv_at(AnsiString->Buffer, __drv_freesMem(Mem)) - PANSI_STRING AnsiString - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlxUnicodeStringToAnsiSize( - __in PCUNICODE_STRING UnicodeString - ); -#endif - -// -// NTSYSAPI -// ULONG -// NTAPI -// RtlUnicodeStringToAnsiSize( -// PUNICODE_STRING UnicodeString -// ); -// - -#define RtlUnicodeStringToAnsiSize(STRING) ( \ - NLS_MB_CODE_PAGE_TAG ? \ - RtlxUnicodeStringToAnsiSize(STRING) : \ - ((STRING)->Length + sizeof(UNICODE_NULL)) / sizeof(WCHAR) \ -) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlxAnsiStringToUnicodeSize( - __in PCANSI_STRING AnsiString - ); -#endif - -// -// NTSYSAPI -// ULONG -// NTAPI -// RtlAnsiStringToUnicodeSize( -// PANSI_STRING AnsiString -// ); -// - -#define RtlAnsiStringToUnicodeSize(STRING) ( \ - NLS_MB_CODE_PAGE_TAG ? \ - RtlxAnsiStringToUnicodeSize(STRING) : \ - ((STRING)->Length + sizeof(ANSI_NULL)) * sizeof(WCHAR) \ -) - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUnicodeToUTF8N( - __out_bcount_part(UTF8StringMaxByteCount, *UTF8StringActualByteCount) PCHAR UTF8StringDestination, - __in ULONG UTF8StringMaxByteCount, - __out PULONG UTF8StringActualByteCount, - __in_bcount(UnicodeStringByteCount) PCWCH UnicodeStringSource, - __in ULONG UnicodeStringByteCount - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlUTF8ToUnicodeN( - __out_bcount_part(UnicodeStringMaxByteCount, *UnicodeStringActualByteCount) PWSTR UnicodeStringDestination, - __in ULONG UnicodeStringMaxByteCount, - __out PULONG UnicodeStringActualByteCount, - __in_bcount(UTF8StringByteCount) PCCH UTF8StringSource, - __in ULONG UTF8StringByteCount - ); -#endif - - - -#include - - - -#ifndef DEFINE_GUIDEX - #define DEFINE_GUIDEX(name) EXTERN_C const CDECL GUID name -#endif // !defined(DEFINE_GUIDEX) - -#ifndef STATICGUIDOF - #define STATICGUIDOF(guid) STATIC_##guid -#endif // !defined(STATICGUIDOF) - -#ifndef __IID_ALIGNED__ - #define __IID_ALIGNED__ - #ifdef __cplusplus - inline int IsEqualGUIDAligned(REFGUID guid1, REFGUID guid2) - { - return ((*(PLONGLONG)(&guid1) == *(PLONGLONG)(&guid2)) && (*((PLONGLONG)(&guid1) + 1) == *((PLONGLONG)(&guid2) + 1))); - } - #else // !__cplusplus - #define IsEqualGUIDAligned(guid1, guid2) \ - ((*(PLONGLONG)(guid1) == *(PLONGLONG)(guid2)) && (*((PLONGLONG)(guid1) + 1) == *((PLONGLONG)(guid2) + 1))) - #endif // !__cplusplus -#endif // !__IID_ALIGNED__ - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlStringFromGUID( - __in REFGUID Guid, - __out __drv_at(GuidString->Buffer, __drv_allocatesMem(Mem)) - PUNICODE_STRING GuidString - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTSYSAPI -NTSTATUS -NTAPI -RtlGUIDFromString( - __in PCUNICODE_STRING GuidString, - __out GUID* Guid - ); - -// -// Fast primitives to compare, move, and zero memory -// - - - -#if _DBG_MEMCPY_INLINE_ && !defined(MIDL_PASS) && !defined(_MEMCPY_INLINE_) && !defined(_CRTBLD) -#define _MEMCPY_INLINE_ -FORCEINLINE -PVOID -__cdecl -memcpy_inline ( - __out_bcount_full(size) void *dst, - __in_bcount(size) const void *src, - __in size_t size - ) -{ - // - // Make sure the source and destination do not overlap such that the - // move destroys the destination. - // - if (((char *)dst > (char *)src) && - ((char *)dst < ((char *)src + size))) { - __debugbreak(); - } - return memcpy(dst, src, size); -} -#define memcpy memcpy_inline -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -SIZE_T -NTAPI -RtlCompareMemory ( - __in const VOID *Source1, - __in const VOID *Source2, - __in SIZE_T Length - ); - -#endif - -#define RtlEqualMemory(Destination,Source,Length) (!memcmp((Destination),(Source),(Length))) -#define RtlMoveMemory(Destination,Source,Length) memmove((Destination),(Source),(Length)) -#define RtlCopyMemory(Destination,Source,Length) memcpy((Destination),(Source),(Length)) -#define RtlFillMemory(Destination,Length,Fill) memset((Destination),(Fill),(Length)) -#define RtlZeroMemory(Destination,Length) memset((Destination),0,(Length)) - - -#if !defined(MIDL_PASS) - -FORCEINLINE -PVOID -RtlSecureZeroMemory( - __out_bcount_full(cnt) PVOID ptr, - __in SIZE_T cnt - ) -{ - volatile char *vptr = (volatile char *)ptr; - -#if defined(_M_AMD64) - - __stosb((PUCHAR)((ULONG64)vptr), 0, cnt); - -#else - - while (cnt) { - *vptr = 0; - vptr++; - cnt--; - } - -#endif - - return ptr; -} - -#endif - - - -#define RtlCopyBytes RtlCopyMemory -#define RtlZeroBytes RtlZeroMemory -#define RtlFillBytes RtlFillMemory - -#if defined(_M_AMD64) - -NTSYSAPI -VOID -NTAPI -RtlCopyMemoryNonTemporal ( - __out_bcount_full(Length) VOID UNALIGNED *Destination, - __in_bcount(Length) CONST VOID UNALIGNED *Source, - __in SIZE_T Length - ); - -#else - -#define RtlCopyMemoryNonTemporal RtlCopyMemory - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2KSP3) -NTSYSAPI -VOID -FASTCALL -RtlPrefetchMemoryNonTemporal( - __in PVOID Source, - __in SIZE_T Length - ); - -#endif - -// -// Define kernel debugger print prototypes and macros. -// -// N.B. The following function cannot be directly imported because there are -// a few places in the source tree where this function is redefined. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#if (_MSC_FULL_VER >= 150030729) && !defined(IMPORT_NATIVE_DBG_BREAK) - -#define DbgBreakPoint __debugbreak - -#else - -__analysis_noreturn -VOID -NTAPI -DbgBreakPoint( - VOID - ); - -#endif - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__analysis_noreturn -NTSYSAPI -VOID -NTAPI -DbgBreakPointWithStatus( - __in ULONG Status - ); -#endif - -#define DBG_STATUS_CONTROL_C 1 -#define DBG_STATUS_SYSRQ 2 -#define DBG_STATUS_BUGCHECK_FIRST 3 -#define DBG_STATUS_BUGCHECK_SECOND 4 -#define DBG_STATUS_FATAL 5 -#define DBG_STATUS_DEBUG_CONTROL 6 -#define DBG_STATUS_WORKER 7 - -#if DBG - -#define KdPrint(_x_) DbgPrint _x_ -#define KdPrintEx(_x_) DbgPrintEx _x_ -#define vKdPrintEx(_x_) vDbgPrintEx _x_ -#define vKdPrintExWithPrefix(_x_) vDbgPrintExWithPrefix _x_ -#define KdBreakPoint() DbgBreakPoint() - -#define KdBreakPointWithStatus(s) DbgBreakPointWithStatus(s) - -#else - -#define KdPrint(_x_) -#define KdPrintEx(_x_) -#define vKdPrintEx(_x_) -#define vKdPrintExWithPrefix(_x_) -#define KdBreakPoint() - -#define KdBreakPointWithStatus(s) - -#endif // DBG - -#ifndef _DBGNT_ - -ULONG -__cdecl -DbgPrint ( - __in_z __drv_formatString(printf) PCSTR Format, - ... - ); - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -ULONG -__cdecl -DbgPrintEx ( - __in ULONG ComponentId, - __in ULONG Level, - __in_z __drv_formatString(printf) PCSTR Format, - ... - ); -#endif - -#ifdef _VA_LIST_DEFINED - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -ULONG -NTAPI -vDbgPrintEx( - __in ULONG ComponentId, - __in ULONG Level, - __in_z PCCH Format, - __in va_list arglist - ); - -NTSYSAPI -ULONG -NTAPI -vDbgPrintExWithPrefix ( - __in_z PCCH Prefix, - __in ULONG ComponentId, - __in ULONG Level, - __in_z PCCH Format, - __in va_list arglist - ); - -#endif - -#endif // _VA_LIST_DEFINED - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -__cdecl -DbgPrintReturnControlC ( - __in_z __drv_formatString(printf) PCCH Format, - ... - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -NTSTATUS -NTAPI -DbgQueryDebugFilterState ( - __in ULONG ComponentId, - __in ULONG Level - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -NTSTATUS -NTAPI -DbgSetDebugFilterState ( - __in ULONG ComponentId, - __in ULONG Level, - __in BOOLEAN State - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef -VOID -(*PDEBUG_PRINT_CALLBACK) ( - __in PSTRING Output, - __in ULONG ComponentId, - __in ULONG Level - ); - -NTSYSAPI -NTSTATUS -NTAPI -DbgSetDebugPrintCallback ( - __in PDEBUG_PRINT_CALLBACK DebugPrintCallback, - __in BOOLEAN Enable - ); -#endif - -#endif // _DBGNT_ - -// -// Large integer arithmetic routines. -// - -// -// Large integer add - 64-bits + 64-bits -> 64-bits -// - - -#if !defined(MIDL_PASS) - - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerAdd ( - __in LARGE_INTEGER Addend1, - __in LARGE_INTEGER Addend2 - ) -{ - LARGE_INTEGER Sum; - - Sum.QuadPart = Addend1.QuadPart + Addend2.QuadPart; - return Sum; -} - -// -// Enlarged integer multiply - 32-bits * 32-bits -> 64-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlEnlargedIntegerMultiply ( - __in LONG Multiplicand, - __in LONG Multiplier - ) -{ - LARGE_INTEGER Product; - - Product.QuadPart = (LONGLONG)Multiplicand * (ULONGLONG)Multiplier; - return Product; -} - -// -// Unsigned enlarged integer multiply - 32-bits * 32-bits -> 64-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlEnlargedUnsignedMultiply ( - __in ULONG Multiplicand, - __in ULONG Multiplier - ) -{ - LARGE_INTEGER Product; - - Product.QuadPart = (ULONGLONG)Multiplicand * (ULONGLONG)Multiplier; - return Product; -} - -// -// Enlarged integer divide - 64-bits / 32-bits > 32-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -ULONG -NTAPI_INLINE -RtlEnlargedUnsignedDivide ( - __in ULARGE_INTEGER Dividend, - __in ULONG Divisor, - __out_opt PULONG Remainder - ) -{ - ULONG Quotient; - - Quotient = (ULONG)(Dividend.QuadPart / Divisor); - if (ARGUMENT_PRESENT(Remainder)) { - *Remainder = (ULONG)(Dividend.QuadPart % Divisor); - } - - return Quotient; -} - -// -// Large integer negation - -(64-bits) -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerNegate ( - __in LARGE_INTEGER Subtrahend - ) -{ - LARGE_INTEGER Difference; - - Difference.QuadPart = -Subtrahend.QuadPart; - return Difference; -} - -// -// Large integer subtract - 64-bits - 64-bits -> 64-bits. -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerSubtract ( - __in LARGE_INTEGER Minuend, - __in LARGE_INTEGER Subtrahend - ) -{ - LARGE_INTEGER Difference; - - Difference.QuadPart = Minuend.QuadPart - Subtrahend.QuadPart; - return Difference; -} - -// -// Extended large integer magic divide - 64-bits / 32-bits -> 64-bits -// - -#if defined(_AMD64_) - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlExtendedMagicDivide ( - __in LARGE_INTEGER Dividend, - __in LARGE_INTEGER MagicDivisor, - __in CCHAR ShiftCount - ) - -{ - - LARGE_INTEGER Quotient; - - if (Dividend.QuadPart >= 0) { - Quotient.QuadPart = UnsignedMultiplyHigh(Dividend.QuadPart, - (ULONG64)MagicDivisor.QuadPart); - - } else { - Quotient.QuadPart = UnsignedMultiplyHigh(-Dividend.QuadPart, - (ULONG64)MagicDivisor.QuadPart); - } - - Quotient.QuadPart = (ULONG64)Quotient.QuadPart >> ShiftCount; - if (Dividend.QuadPart < 0) { - Quotient.QuadPart = - Quotient.QuadPart; - } - - return Quotient; -} - -#endif // defined(_AMD64_) - -#if defined(_X86_) || defined(_IA64_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -NTSYSAPI -LARGE_INTEGER -NTAPI -RtlExtendedMagicDivide ( - __in LARGE_INTEGER Dividend, - __in LARGE_INTEGER MagicDivisor, - __in CCHAR ShiftCount - ); -#endif - -#endif // defined(_X86_) || defined(_IA64_) - - -#if defined(_AMD64_) || defined(_IA64_) - - -// -// Large Integer divide - 64-bits / 32-bits -> 64-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlExtendedLargeIntegerDivide ( - __in LARGE_INTEGER Dividend, - __in ULONG Divisor, - __out_opt PULONG Remainder - ) -{ - LARGE_INTEGER Quotient; - - Quotient.QuadPart = (ULONG64)Dividend.QuadPart / Divisor; - if (ARGUMENT_PRESENT(Remainder)) { - *Remainder = (ULONG)(Dividend.QuadPart % Divisor); - } - - return Quotient; -} - -// -// Extended integer multiply - 32-bits * 64-bits -> 64-bits -// - -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlExtendedIntegerMultiply ( - __in LARGE_INTEGER Multiplicand, - __in LONG Multiplier - ) -{ - LARGE_INTEGER Product; - - Product.QuadPart = Multiplicand.QuadPart * Multiplier; - return Product; -} - - -#else - - -// -// Large Integer divide - 64-bits / 32-bits -> 64-bits -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -NTSYSAPI -LARGE_INTEGER -NTAPI -RtlExtendedLargeIntegerDivide ( - __in LARGE_INTEGER Dividend, - __in ULONG Divisor, - __out_opt PULONG Remainder - ); -#endif - -// -// Extended integer multiply - 32-bits * 64-bits -> 64-bits -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -NTSYSAPI -LARGE_INTEGER -NTAPI -RtlExtendedIntegerMultiply ( - __in LARGE_INTEGER Multiplicand, - __in LONG Multiplier - ); -#endif - - -#endif // defined(_AMD64_) || defined(_IA64_) - - -// -// Large integer and - 64-bite & 64-bits -> 64-bits. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(RtlLargeIntegerAnd) // Use native __int64 math -#endif -#define RtlLargeIntegerAnd(Result, Source, Mask) \ - Result.QuadPart = Source.QuadPart & Mask.QuadPart - -// -// Convert signed integer to large integer. -// - -DECLSPEC_DEPRECATED_DDK_WINXP // Use native __int64 math -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlConvertLongToLargeInteger ( - __in LONG SignedInteger - ) -{ - LARGE_INTEGER Result; - - Result.QuadPart = SignedInteger; - return Result; -} - -// -// Convert unsigned integer to large integer. -// - -DECLSPEC_DEPRECATED_DDK_WINXP // Use native __int64 math -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlConvertUlongToLargeInteger ( - __in ULONG UnsignedInteger - ) -{ - LARGE_INTEGER Result; - - Result.QuadPart = UnsignedInteger; - return Result; -} - -// -// Large integer shift routines. -// - -DECLSPEC_DEPRECATED_DDK_WINXP // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerShiftLeft ( - __in LARGE_INTEGER LargeInteger, - __in CCHAR ShiftCount - ) -{ - LARGE_INTEGER Result; - - Result.QuadPart = LargeInteger.QuadPart << ShiftCount; - return Result; -} - -DECLSPEC_DEPRECATED_DDK_WINXP // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerShiftRight ( - __in LARGE_INTEGER LargeInteger, - __in CCHAR ShiftCount - ) -{ - LARGE_INTEGER Result; - - Result.QuadPart = (ULONG64)LargeInteger.QuadPart >> ShiftCount; - return Result; -} - -DECLSPEC_DEPRECATED_DDK_WINXP // Use native __int64 math -__drv_preferredFunction("compiler support for 64 bit", "Obsolete") -__inline -LARGE_INTEGER -NTAPI_INLINE -RtlLargeIntegerArithmeticShift ( - __in LARGE_INTEGER LargeInteger, - __in CCHAR ShiftCount - ) -{ - LARGE_INTEGER Result; - - Result.QuadPart = LargeInteger.QuadPart >> ShiftCount; - return Result; -} - - -// -// Large integer comparison routines. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(RtlLargeIntegerGreaterThan) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerGreaterThanOrEqualTo) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerEqualTo) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerNotEqualTo) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerLessThan) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerLessThanOrEqualTo) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerGreaterThanZero) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerGreaterOrEqualToZero) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerEqualToZero) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerNotEqualToZero) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerLessThanZero) // Use native __int64 math -#pragma deprecated(RtlLargeIntegerLessOrEqualToZero) // Use native __int64 math -#endif - -#define RtlLargeIntegerGreaterThan(X,Y) ( \ - (((X).HighPart == (Y).HighPart) && ((X).LowPart > (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart) \ -) - -#define RtlLargeIntegerGreaterThanOrEqualTo(X,Y) ( \ - (((X).HighPart == (Y).HighPart) && ((X).LowPart >= (Y).LowPart)) || \ - ((X).HighPart > (Y).HighPart) \ -) - -#define RtlLargeIntegerEqualTo(X,Y) ( \ - !(((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \ -) - -#define RtlLargeIntegerNotEqualTo(X,Y) ( \ - (((X).LowPart ^ (Y).LowPart) | ((X).HighPart ^ (Y).HighPart)) \ -) - -#define RtlLargeIntegerLessThan(X,Y) ( \ - (((X).HighPart == (Y).HighPart) && ((X).LowPart < (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart) \ -) - -#define RtlLargeIntegerLessThanOrEqualTo(X,Y) ( \ - (((X).HighPart == (Y).HighPart) && ((X).LowPart <= (Y).LowPart)) || \ - ((X).HighPart < (Y).HighPart) \ -) - -#define RtlLargeIntegerGreaterThanZero(X) ( \ - (((X).HighPart == 0) && ((X).LowPart > 0)) || \ - ((X).HighPart > 0 ) \ -) - -#define RtlLargeIntegerGreaterOrEqualToZero(X) ( \ - (X).HighPart >= 0 \ -) - -#define RtlLargeIntegerEqualToZero(X) ( \ - !((X).LowPart | (X).HighPart) \ -) - -#define RtlLargeIntegerNotEqualToZero(X) ( \ - ((X).LowPart | (X).HighPart) \ -) - -#define RtlLargeIntegerLessThanZero(X) ( \ - ((X).HighPart < 0) \ -) - -#define RtlLargeIntegerLessOrEqualToZero(X) ( \ - ((X).HighPart < 0) || !((X).LowPart | (X).HighPart) \ -) - - -#endif // !defined(MIDL_PASS) - - -// -// Time conversion routines -// - -typedef struct _TIME_FIELDS { - CSHORT Year; // range [1601...] - CSHORT Month; // range [1..12] - CSHORT Day; // range [1..31] - CSHORT Hour; // range [0..23] - CSHORT Minute; // range [0..59] - CSHORT Second; // range [0..59] - CSHORT Milliseconds;// range [0..999] - CSHORT Weekday; // range [0..6] == [Sunday..Saturday] -} TIME_FIELDS; -typedef TIME_FIELDS *PTIME_FIELDS; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlTimeToTimeFields ( - __in PLARGE_INTEGER Time, - __out PTIME_FIELDS TimeFields - ); -#endif - -// -// A time field record (Weekday ignored) -> 64 bit Time value -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != 0) -NTSYSAPI -BOOLEAN -NTAPI -RtlTimeFieldsToTime ( - __in PTIME_FIELDS TimeFields, - __out PLARGE_INTEGER Time - ); -#endif - -// -// The following macros store and retrieve USHORTS and ULONGS from potentially -// unaligned addresses, avoiding alignment faults. they should probably be -// rewritten in assembler -// - -#define SHORT_SIZE (sizeof(USHORT)) -#define SHORT_MASK (SHORT_SIZE - 1) -#define LONG_SIZE (sizeof(LONG)) -#define LONGLONG_SIZE (sizeof(LONGLONG)) -#define LONG_MASK (LONG_SIZE - 1) -#define LONGLONG_MASK (LONGLONG_SIZE - 1) -#define LOWBYTE_MASK 0x00FF - -#define FIRSTBYTE(VALUE) ((VALUE) & LOWBYTE_MASK) -#define SECONDBYTE(VALUE) (((VALUE) >> 8) & LOWBYTE_MASK) -#define THIRDBYTE(VALUE) (((VALUE) >> 16) & LOWBYTE_MASK) -#define FOURTHBYTE(VALUE) (((VALUE) >> 24) & LOWBYTE_MASK) - -// -// if MIPS Big Endian, order of bytes is reversed. -// - -#define SHORT_LEAST_SIGNIFICANT_BIT 0 -#define SHORT_MOST_SIGNIFICANT_BIT 1 - -#define LONG_LEAST_SIGNIFICANT_BIT 0 -#define LONG_3RD_MOST_SIGNIFICANT_BIT 1 -#define LONG_2ND_MOST_SIGNIFICANT_BIT 2 -#define LONG_MOST_SIGNIFICANT_BIT 3 - -//++ -// -// VOID -// RtlStoreUshort ( -// PUSHORT ADDRESS -// USHORT VALUE -// ) -// -// Routine Description: -// -// This macro stores a USHORT value in at a particular address, avoiding -// alignment faults. -// -// Arguments: -// -// ADDRESS - where to store USHORT value -// VALUE - USHORT to store -// -// Return Value: -// -// none. -// -//-- - -#if defined(_AMD64_) - -#define RtlStoreUshort(ADDRESS,VALUE) \ - *(USHORT UNALIGNED *)(ADDRESS) = (VALUE) - -#else - -#define RtlStoreUshort(ADDRESS,VALUE) \ - if ((ULONG_PTR)(ADDRESS) & SHORT_MASK) { \ - ((PUCHAR) (ADDRESS))[SHORT_LEAST_SIGNIFICANT_BIT] = (UCHAR)(FIRSTBYTE(VALUE)); \ - ((PUCHAR) (ADDRESS))[SHORT_MOST_SIGNIFICANT_BIT ] = (UCHAR)(SECONDBYTE(VALUE)); \ - } \ - else { \ - *((PUSHORT) (ADDRESS)) = (USHORT) VALUE; \ - } - -#endif - -//++ -// -// VOID -// RtlStoreUlong ( -// PULONG ADDRESS -// ULONG VALUE -// ) -// -// Routine Description: -// -// This macro stores a ULONG value in at a particular address, avoiding -// alignment faults. -// -// Arguments: -// -// ADDRESS - where to store ULONG value -// VALUE - ULONG to store -// -// Return Value: -// -// none. -// -// Note: -// Depending on the machine, we might want to call storeushort in the -// unaligned case. -// -//-- - - -#if defined(_AMD64_) - -#define RtlStoreUlong(ADDRESS,VALUE) \ - *(ULONG UNALIGNED *)(ADDRESS) = (VALUE) - -#else - -#define RtlStoreUlong(ADDRESS,VALUE) \ - if ((ULONG_PTR)(ADDRESS) & LONG_MASK) { \ - ((PUCHAR) (ADDRESS))[LONG_LEAST_SIGNIFICANT_BIT ] = (UCHAR)(FIRSTBYTE(VALUE)); \ - ((PUCHAR) (ADDRESS))[LONG_3RD_MOST_SIGNIFICANT_BIT ] = (UCHAR)(SECONDBYTE(VALUE)); \ - ((PUCHAR) (ADDRESS))[LONG_2ND_MOST_SIGNIFICANT_BIT ] = (UCHAR)(THIRDBYTE(VALUE)); \ - ((PUCHAR) (ADDRESS))[LONG_MOST_SIGNIFICANT_BIT ] = (UCHAR)(FOURTHBYTE(VALUE)); \ - } \ - else { \ - *((PULONG) (ADDRESS)) = (ULONG) (VALUE); \ - } - -#endif - -//++ -// -// VOID -// RtlStoreUlonglong ( -// PULONGLONG ADDRESS -// ULONG VALUE -// ) -// -// Routine Description: -// -// This macro stores a ULONGLONG value in at a particular address, avoiding -// alignment faults. -// -// Arguments: -// -// ADDRESS - where to store ULONGLONG value -// VALUE - ULONGLONG to store -// -// Return Value: -// -// none. -// -//-- - -#if defined(_AMD64_) - -#define RtlStoreUlonglong(ADDRESS,VALUE) \ - *(ULONGLONG UNALIGNED *)(ADDRESS) = (VALUE) - -#else - -#define RtlStoreUlonglong(ADDRESS,VALUE) \ - if ((ULONG_PTR)(ADDRESS) & LONGLONG_MASK) { \ - RtlStoreUlong((ULONG_PTR)(ADDRESS), \ - (ULONGLONG)(VALUE) & 0xFFFFFFFF); \ - RtlStoreUlong((ULONG_PTR)(ADDRESS)+sizeof(ULONG), \ - (ULONGLONG)(VALUE) >> 32); \ - } else { \ - *((PULONGLONG)(ADDRESS)) = (ULONGLONG)(VALUE); \ - } - -#endif - -//++ -// -// VOID -// RtlStoreUlongPtr ( -// PULONG_PTR ADDRESS -// ULONG_PTR VALUE -// ) -// -// Routine Description: -// -// This macro stores a ULONG_PTR value in at a particular address, avoiding -// alignment faults. -// -// Arguments: -// -// ADDRESS - where to store ULONG_PTR value -// VALUE - ULONG_PTR to store -// -// Return Value: -// -// none. -// -//-- - -#ifdef _WIN64 - -#define RtlStoreUlongPtr(ADDRESS,VALUE) \ - RtlStoreUlonglong(ADDRESS,VALUE) - -#else - -#define RtlStoreUlongPtr(ADDRESS,VALUE) \ - RtlStoreUlong(ADDRESS,VALUE) - -#endif - -//++ -// -// VOID -// RtlRetrieveUshort ( -// PUSHORT DESTINATION_ADDRESS -// PUSHORT SOURCE_ADDRESS -// ) -// -// Routine Description: -// -// This macro retrieves a USHORT value from the SOURCE address, avoiding -// alignment faults. The DESTINATION address is assumed to be aligned. -// -// Arguments: -// -// DESTINATION_ADDRESS - where to store USHORT value -// SOURCE_ADDRESS - where to retrieve USHORT value from -// -// Return Value: -// -// none. -// -//-- - -#if defined(_AMD64_) - -#define RtlRetrieveUshort(DEST_ADDRESS,SRC_ADDRESS) \ - *(USHORT UNALIGNED *)(DEST_ADDRESS) = *(PUSHORT)(SRC_ADDRESS) - -#else - -#define RtlRetrieveUshort(DEST_ADDRESS,SRC_ADDRESS) \ - if ((ULONG_PTR)SRC_ADDRESS & SHORT_MASK) { \ - ((PUCHAR) (DEST_ADDRESS))[0] = ((PUCHAR) (SRC_ADDRESS))[0]; \ - ((PUCHAR) (DEST_ADDRESS))[1] = ((PUCHAR) (SRC_ADDRESS))[1]; \ - } \ - else { \ - *((PUSHORT) DEST_ADDRESS) = *((PUSHORT) SRC_ADDRESS); \ - } \ - -#endif - -//++ -// -// VOID -// RtlRetrieveUlong ( -// PULONG DESTINATION_ADDRESS -// PULONG SOURCE_ADDRESS -// ) -// -// Routine Description: -// -// This macro retrieves a ULONG value from the SOURCE address, avoiding -// alignment faults. The DESTINATION address is assumed to be aligned. -// -// Arguments: -// -// DESTINATION_ADDRESS - where to store ULONG value -// SOURCE_ADDRESS - where to retrieve ULONG value from -// -// Return Value: -// -// none. -// -// Note: -// Depending on the machine, we might want to call retrieveushort in the -// unaligned case. -// -//-- - -#if defined(_AMD64_) - -#define RtlRetrieveUlong(DEST_ADDRESS,SRC_ADDRESS) \ - *(ULONG UNALIGNED *)(DEST_ADDRESS) = *(PULONG)(SRC_ADDRESS) - -#else - -#define RtlRetrieveUlong(DEST_ADDRESS,SRC_ADDRESS) \ - if ((ULONG_PTR)SRC_ADDRESS & LONG_MASK) { \ - ((PUCHAR) (DEST_ADDRESS))[0] = ((PUCHAR) (SRC_ADDRESS))[0]; \ - ((PUCHAR) (DEST_ADDRESS))[1] = ((PUCHAR) (SRC_ADDRESS))[1]; \ - ((PUCHAR) (DEST_ADDRESS))[2] = ((PUCHAR) (SRC_ADDRESS))[2]; \ - ((PUCHAR) (DEST_ADDRESS))[3] = ((PUCHAR) (SRC_ADDRESS))[3]; \ - } \ - else { \ - *((PULONG) DEST_ADDRESS) = *((PULONG) SRC_ADDRESS); \ - } - -#endif - -// -// BitMap routines. The following structure, routines, and macros are -// for manipulating bitmaps. The user is responsible for allocating a bitmap -// structure (which is really a header) and a buffer (which must be longword -// aligned and multiple longwords in size). -// - -typedef struct _RTL_BITMAP { - ULONG SizeOfBitMap; // Number of bits in bit map - PULONG Buffer; // Pointer to the bit map itself -} RTL_BITMAP; -typedef RTL_BITMAP *PRTL_BITMAP; - -// -// The following routine initializes a new bitmap. It does not alter the -// data currently in the bitmap. This routine must be called before -// any other bitmap routine/macro. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -VOID -NTAPI -RtlInitializeBitMap ( - __out PRTL_BITMAP BitMapHeader, - __in __drv_aliasesMem PULONG BitMapBuffer, - __in ULONG SizeOfBitMap - ); -#endif - -// -// The following three routines clear, set, and test the state of a -// single bit in a bitmap. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -VOID -NTAPI -RtlClearBit ( - __in PRTL_BITMAP BitMapHeader, - __in_range(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTSYSAPI -VOID -NTAPI -RtlSetBit ( - __in PRTL_BITMAP BitMapHeader, - __in_range(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlTestBit ( - __in PRTL_BITMAP BitMapHeader, - __in_range(<, BitMapHeader->SizeOfBitMap) ULONG BitNumber - ); -#endif - -// -// The following two routines either clear or set all of the bits -// in a bitmap. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlClearAllBits ( - __in PRTL_BITMAP BitMapHeader - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlSetAllBits ( - __in PRTL_BITMAP BitMapHeader - ); -#endif - -// -// The following two routines locate a contiguous region of either -// clear or set bits within the bitmap. The region will be at least -// as large as the number specified, and the search of the bitmap will -// begin at the specified hint index (which is a bit index within the -// bitmap, zero based). The return value is the bit index of the located -// region (zero based) or -1 (i.e., 0xffffffff) if such a region cannot -// be located -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -__checkReturn -NTSYSAPI -ULONG -NTAPI -RtlFindClearBits ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG NumberToFind, - __in ULONG HintIndex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -__checkReturn -NTSYSAPI -ULONG -NTAPI -RtlFindSetBits ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG NumberToFind, - __in ULONG HintIndex - ); -#endif - -// -// The following two routines locate a contiguous region of either -// clear or set bits within the bitmap and either set or clear the bits -// within the located region. The region will be as large as the number -// specified, and the search for the region will begin at the specified -// hint index (which is a bit index within the bitmap, zero based). The -// return value is the bit index of the located region (zero based) or -// -1 (i.e., 0xffffffff) if such a region cannot be located. If a region -// cannot be located then the setting/clearing of the bitmap is not performed. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -NTSYSAPI -ULONG -NTAPI -RtlFindClearBitsAndSet ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG NumberToFind, - __in ULONG HintIndex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -NTSYSAPI -ULONG -NTAPI -RtlFindSetBitsAndClear ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG NumberToFind, - __in ULONG HintIndex - ); -#endif - -// -// The following two routines clear or set bits within a specified region -// of the bitmap. The starting index is zero based. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlClearBits ( - __in PRTL_BITMAP BitMapHeader, - __in_range(0, BitMapHeader->SizeOfBitMap - NumberToClear) ULONG StartingIndex, - __in_range(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToClear - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -VOID -NTAPI -RtlSetBits ( - __in PRTL_BITMAP BitMapHeader, - __in_range(0, BitMapHeader->SizeOfBitMap - NumberToSet) ULONG StartingIndex, - __in_range(0, BitMapHeader->SizeOfBitMap - StartingIndex) ULONG NumberToSet - ); -#endif - -// -// The following routine locates a set of contiguous regions of clear -// bits within the bitmap. The caller specifies whether to return the -// longest runs or just the first found lcoated. The following structure is -// used to denote a contiguous run of bits. The two routines return an array -// of this structure, one for each run located. -// - -typedef struct _RTL_BITMAP_RUN { - - ULONG StartingIndex; - ULONG NumberOfBits; - -} RTL_BITMAP_RUN; -typedef RTL_BITMAP_RUN *PRTL_BITMAP_RUN; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlFindClearRuns ( - __in PRTL_BITMAP BitMapHeader, - __out_ecount_part(SizeOfRunArray, return) PRTL_BITMAP_RUN RunArray, - __in_range(>, 0) ULONG SizeOfRunArray, - __in BOOLEAN LocateLongestRuns - ); -#endif - -// -// The following routine locates the longest contiguous region of -// clear bits within the bitmap. The returned starting index value -// denotes the first contiguous region located satisfying our requirements -// The return value is the length (in bits) of the longest region found. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlFindLongestRunClear ( - __in PRTL_BITMAP BitMapHeader, - __out PULONG StartingIndex - ); -#endif - -// -// The following routine locates the first contiguous region of -// clear bits within the bitmap. The returned starting index value -// denotes the first contiguous region located satisfying our requirements -// The return value is the length (in bits) of the region found. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlFindFirstRunClear ( - __in PRTL_BITMAP BitMapHeader, - __out PULONG StartingIndex - ); -#endif - -// -// The following macro returns the value of the bit stored within the -// bitmap at the specified location. If the bit is set a value of 1 is -// returned otherwise a value of 0 is returned. -// -// ULONG -// RtlCheckBit ( -// PRTL_BITMAP BitMapHeader, -// ULONG BitPosition -// ); -// -// -// To implement CheckBit the macro retrieves the longword containing the -// bit in question, shifts the longword to get the bit in question into the -// low order bit position and masks out all other bits. -// - -#if defined(_M_AMD64) && !defined(MIDL_PASS) - -__checkReturn -FORCEINLINE -BOOLEAN -RtlCheckBit ( - __in PRTL_BITMAP BitMapHeader, - __in_range(<, BitMapHeader->SizeOfBitMap) ULONG BitPosition - ) - -{ - return BitTest64((LONG64 const *)BitMapHeader->Buffer, (LONG64)BitPosition); -} - -#else - -#define RtlCheckBit(BMH,BP) (((((PLONG)(BMH)->Buffer)[(BP) / 32]) >> ((BP) % 32)) & 0x1) - -#endif - -// -// The following two procedures return to the caller the total number of -// clear or set bits within the specified bitmap. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlNumberOfClearBits ( - __in PRTL_BITMAP BitMapHeader - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlNumberOfSetBits ( - __in PRTL_BITMAP BitMapHeader - ); -#endif - -// -// The following two procedures return to the caller a boolean value -// indicating if the specified range of bits are all clear or set. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlAreBitsClear ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG StartingIndex, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlAreBitsSet ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG StartingIndex, - __in ULONG Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlFindNextForwardRunClear ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG FromIndex, - __out PULONG StartingRunIndex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -NTAPI -RtlFindLastBackwardRunClear ( - __in PRTL_BITMAP BitMapHeader, - __in ULONG FromIndex, - __out PULONG StartingRunIndex - ); -#endif - -// -// The following two procedures return to the caller a value indicating -// the position within a ULONGLONG of the most or least significant non-zero -// bit. A value of zero results in a return value of -1. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -__checkReturn -NTSYSAPI -CCHAR -NTAPI -RtlFindLeastSignificantBit ( - __in ULONGLONG Set - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__success(return != -1) -__checkReturn -NTSYSAPI -CCHAR -NTAPI -RtlFindMostSignificantBit ( - __in ULONGLONG Set - ); -#endif - -// -// The following procedure finds the number of set bits within a ULONG_PTR -// value. -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -ULONG -NTAPI -RtlNumberOfSetBitsUlongPtr ( - __in ULONG_PTR Target - ); -#endif - - -// -// BOOLEAN -// RtlEqualLuid( -// PLUID L1, -// PLUID L2 -// ); - -#define RtlEqualLuid(L1, L2) (((L1)->LowPart == (L2)->LowPart) && \ - ((L1)->HighPart == (L2)->HighPart)) - -// -// BOOLEAN -// RtlIsZeroLuid( -// PLUID L1 -// ); -// -#define RtlIsZeroLuid(L1) ((BOOLEAN) (((L1)->LowPart | (L1)->HighPart) == 0)) - -// -// SecurityDescriptor RTL routine definitions -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlCreateSecurityDescriptor ( - __out PSECURITY_DESCRIPTOR SecurityDescriptor, - __in ULONG Revision - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlValidSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -ULONG -NTAPI -RtlLengthSecurityDescriptor ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__checkReturn -NTSYSAPI -BOOLEAN -NTAPI -RtlValidRelativeSecurityDescriptor ( - __in_bcount(SecurityDescriptorLength) PSECURITY_DESCRIPTOR SecurityDescriptorInput, - __in ULONG SecurityDescriptorLength, - __in SECURITY_INFORMATION RequiredInformation - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -RtlSetDaclSecurityDescriptor ( - __inout PSECURITY_DESCRIPTOR SecurityDescriptor, - __in BOOLEAN DaclPresent, - __in_opt PACL Dacl, - __in_opt BOOLEAN DaclDefaulted - ); -#endif - - -// -// Byte swap routines. These are used to convert from little-endian to -// big-endian and vice-versa. -// - -#if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || ((defined(_M_AMD64) || defined(_M_IA64)) && (_MSC_FULL_VER > 13009175)) -#ifdef __cplusplus -extern "C" { -#endif -unsigned short __cdecl _byteswap_ushort(unsigned short); -unsigned long __cdecl _byteswap_ulong (unsigned long); -unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64); -#ifdef __cplusplus -} -#endif -#pragma intrinsic(_byteswap_ushort) -#pragma intrinsic(_byteswap_ulong) -#pragma intrinsic(_byteswap_uint64) - -#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x)) -#define RtlUlongByteSwap(_x) _byteswap_ulong((_x)) -#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x)) -#else - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -USHORT -FASTCALL -RtlUshortByteSwap( - __in USHORT Source - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONG -FASTCALL -RtlUlongByteSwap( - __in ULONG Source - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTSYSAPI -ULONGLONG -FASTCALL -RtlUlonglongByteSwap( - __in ULONGLONG Source - ); -#endif - -#endif - - -#define RTLVERLIB_DDI(x) Wdmlib##x - -typedef BOOLEAN (*PFN_RTL_IS_NTDDI_VERSION_AVAILABLE)( - __in ULONG Version - ); - -typedef BOOLEAN (*PFN_RTL_IS_SERVICE_PACK_VERSION_INSTALLED)( - __in ULONG Version - ); - -BOOLEAN -RTLVERLIB_DDI(RtlIsNtDdiVersionAvailable)( - __in ULONG Version - ); - -BOOLEAN -RTLVERLIB_DDI(RtlIsServicePackVersionInstalled)( - __in ULONG Version - ); - -#ifndef RtlIsNtDdiVersionAvailable -#define RtlIsNtDdiVersionAvailable WdmlibRtlIsNtDdiVersionAvailable -#endif - -#ifndef RtlIsServicePackVersionInstalled -#define RtlIsServicePackVersionInstalled WdmlibRtlIsServicePackVersionInstalled -#endif - -// -// Interlocked bit manipulation interfaces -// - -#define RtlInterlockedSetBits(Flags, Flag) \ - InterlockedOr((PLONG)(Flags), Flag) - -#define RtlInterlockedAndBits(Flags, Flag) \ - InterlockedAnd((PLONG)(Flags), Flag) - -#define RtlInterlockedClearBits(Flags, Flag) \ - RtlInterlockedAndBits(Flags, ~(Flag)) - -#define RtlInterlockedXorBits(Flags, Flag) \ - InterlockedXor(Flags, Flag) - -#define RtlInterlockedSetBitsDiscardReturn(Flags, Flag) \ - (VOID) RtlInterlockedSetBits(Flags, Flag) - -#define RtlInterlockedAndBitsDiscardReturn(Flags, Flag) \ - (VOID) RtlInterlockedAndBits(Flags, Flag) - -#define RtlInterlockedClearBitsDiscardReturn(Flags, Flag) \ - RtlInterlockedAndBitsDiscardReturn(Flags, ~(Flag)) - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#include -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlIoEncodeMemIoResource ( - __in PIO_RESOURCE_DESCRIPTOR Descriptor, - __in UCHAR Type, - __in ULONGLONG Length, - __in ULONGLONG Alignment, - __in ULONGLONG MinimumAddress, - __in ULONGLONG MaximumAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlCmEncodeMemIoResource ( - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, - __in UCHAR Type, - __in ULONGLONG Length, - __in ULONGLONG Start - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -ULONGLONG -NTAPI -RtlIoDecodeMemIoResource ( - __in PIO_RESOURCE_DESCRIPTOR Descriptor, - __out_opt PULONGLONG Alignment, - __out_opt PULONGLONG MinimumAddress, - __out_opt PULONGLONG MaximumAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -ULONGLONG -NTAPI -RtlCmDecodeMemIoResource ( - __in PCM_PARTIAL_RESOURCE_DESCRIPTOR Descriptor, - __out_opt PULONGLONG Start - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSAPI -NTSTATUS -NTAPI -RtlFindClosestEncodableLength ( - __in ULONGLONG SourceLength, - __out PULONGLONG TargetLength - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -NTSYSAPI -ULONG64 -NTAPI -RtlGetEnabledExtendedFeatures ( - __in ULONG64 FeatureMask - ); - -#endif - -#ifndef _NTTMAPI_ -#define _NTTMAPI_ - - -#ifdef __cplusplus -extern "C" { -#endif - - -#include - -// -// Types for Nt level TM calls -// - -// -// KTM Tm object rights -// -#define TRANSACTIONMANAGER_QUERY_INFORMATION ( 0x0001 ) -#define TRANSACTIONMANAGER_SET_INFORMATION ( 0x0002 ) -#define TRANSACTIONMANAGER_RECOVER ( 0x0004 ) -#define TRANSACTIONMANAGER_RENAME ( 0x0008 ) -#define TRANSACTIONMANAGER_CREATE_RM ( 0x0010 ) - -// The following right is intended for DTC's use only; it will be -// deprecated, and no one else should take a dependency on it. -#define TRANSACTIONMANAGER_BIND_TRANSACTION ( 0x0020 ) - -// -// Generic mappings for transaction manager rights. -// - -#define TRANSACTIONMANAGER_GENERIC_READ (STANDARD_RIGHTS_READ |\ - TRANSACTIONMANAGER_QUERY_INFORMATION) - -#define TRANSACTIONMANAGER_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - TRANSACTIONMANAGER_SET_INFORMATION |\ - TRANSACTIONMANAGER_RECOVER |\ - TRANSACTIONMANAGER_RENAME |\ - TRANSACTIONMANAGER_CREATE_RM) - -#define TRANSACTIONMANAGER_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE) - -#define TRANSACTIONMANAGER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - TRANSACTIONMANAGER_GENERIC_READ |\ - TRANSACTIONMANAGER_GENERIC_WRITE |\ - TRANSACTIONMANAGER_GENERIC_EXECUTE |\ - TRANSACTIONMANAGER_BIND_TRANSACTION) - - -// -// KTM transaction object rights. -// -#define TRANSACTION_QUERY_INFORMATION ( 0x0001 ) -#define TRANSACTION_SET_INFORMATION ( 0x0002 ) -#define TRANSACTION_ENLIST ( 0x0004 ) -#define TRANSACTION_COMMIT ( 0x0008 ) -#define TRANSACTION_ROLLBACK ( 0x0010 ) -#define TRANSACTION_PROPAGATE ( 0x0020 ) -#define TRANSACTION_RIGHT_RESERVED1 ( 0x0040 ) - -// -// Generic mappings for transaction rights. -// Resource managers, when enlisting, should generally use the macro -// TRANSACTION_RESOURCE_MANAGER_RIGHTS when opening a transaction. -// It's the same as generic read and write except that it does not allow -// a commit decision to be made. -// - -#define TRANSACTION_GENERIC_READ (STANDARD_RIGHTS_READ |\ - TRANSACTION_QUERY_INFORMATION |\ - SYNCHRONIZE) - -#define TRANSACTION_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - TRANSACTION_SET_INFORMATION |\ - TRANSACTION_COMMIT |\ - TRANSACTION_ENLIST |\ - TRANSACTION_ROLLBACK |\ - TRANSACTION_PROPAGATE |\ - SYNCHRONIZE) - -#define TRANSACTION_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - TRANSACTION_COMMIT |\ - TRANSACTION_ROLLBACK |\ - SYNCHRONIZE) - -#define TRANSACTION_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - TRANSACTION_GENERIC_READ |\ - TRANSACTION_GENERIC_WRITE |\ - TRANSACTION_GENERIC_EXECUTE) - -#define TRANSACTION_RESOURCE_MANAGER_RIGHTS (TRANSACTION_GENERIC_READ |\ - STANDARD_RIGHTS_WRITE |\ - TRANSACTION_SET_INFORMATION |\ - TRANSACTION_ENLIST |\ - TRANSACTION_ROLLBACK |\ - TRANSACTION_PROPAGATE |\ - SYNCHRONIZE) - -// -// KTM resource manager object rights. -// -#define RESOURCEMANAGER_QUERY_INFORMATION ( 0x0001 ) -#define RESOURCEMANAGER_SET_INFORMATION ( 0x0002 ) -#define RESOURCEMANAGER_RECOVER ( 0x0004 ) -#define RESOURCEMANAGER_ENLIST ( 0x0008 ) -#define RESOURCEMANAGER_GET_NOTIFICATION ( 0x0010 ) -#define RESOURCEMANAGER_REGISTER_PROTOCOL ( 0x0020 ) -#define RESOURCEMANAGER_COMPLETE_PROPAGATION ( 0x0040 ) - -// -// Generic mappings for resource manager rights. -// -#define RESOURCEMANAGER_GENERIC_READ (STANDARD_RIGHTS_READ |\ - RESOURCEMANAGER_QUERY_INFORMATION |\ - SYNCHRONIZE) - -#define RESOURCEMANAGER_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - RESOURCEMANAGER_SET_INFORMATION |\ - RESOURCEMANAGER_RECOVER |\ - RESOURCEMANAGER_ENLIST |\ - RESOURCEMANAGER_GET_NOTIFICATION |\ - RESOURCEMANAGER_REGISTER_PROTOCOL |\ - RESOURCEMANAGER_COMPLETE_PROPAGATION |\ - SYNCHRONIZE) - -#define RESOURCEMANAGER_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - RESOURCEMANAGER_RECOVER |\ - RESOURCEMANAGER_ENLIST |\ - RESOURCEMANAGER_GET_NOTIFICATION |\ - RESOURCEMANAGER_COMPLETE_PROPAGATION |\ - SYNCHRONIZE) - -#define RESOURCEMANAGER_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - RESOURCEMANAGER_GENERIC_READ |\ - RESOURCEMANAGER_GENERIC_WRITE |\ - RESOURCEMANAGER_GENERIC_EXECUTE) - - -// -// KTM enlistment object rights. -// -#define ENLISTMENT_QUERY_INFORMATION ( 0x0001 ) -#define ENLISTMENT_SET_INFORMATION ( 0x0002 ) -#define ENLISTMENT_RECOVER ( 0x0004 ) -#define ENLISTMENT_SUBORDINATE_RIGHTS ( 0x0008 ) -#define ENLISTMENT_SUPERIOR_RIGHTS ( 0x0010 ) - -// -// Generic mappings for enlistment rights. -// -#define ENLISTMENT_GENERIC_READ (STANDARD_RIGHTS_READ |\ - ENLISTMENT_QUERY_INFORMATION) - -#define ENLISTMENT_GENERIC_WRITE (STANDARD_RIGHTS_WRITE |\ - ENLISTMENT_SET_INFORMATION |\ - ENLISTMENT_RECOVER |\ - ENLISTMENT_SUBORDINATE_RIGHTS |\ - ENLISTMENT_SUPERIOR_RIGHTS) - -#define ENLISTMENT_GENERIC_EXECUTE (STANDARD_RIGHTS_EXECUTE |\ - ENLISTMENT_RECOVER |\ - ENLISTMENT_SUBORDINATE_RIGHTS |\ - ENLISTMENT_SUPERIOR_RIGHTS) - -#define ENLISTMENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED |\ - ENLISTMENT_GENERIC_READ |\ - ENLISTMENT_GENERIC_WRITE |\ - ENLISTMENT_GENERIC_EXECUTE) - - -// -// Transaction outcomes. -// -// TODO: warning, must match values in KTRANSACTION_OUTCOME duplicated def -// in tm.h. -// - -typedef enum _TRANSACTION_OUTCOME { - TransactionOutcomeUndetermined = 1, - TransactionOutcomeCommitted, - TransactionOutcomeAborted, -} TRANSACTION_OUTCOME; - - -typedef enum _TRANSACTION_STATE { - TransactionStateNormal = 1, - TransactionStateIndoubt, - TransactionStateCommittedNotify, -} TRANSACTION_STATE; - - -typedef struct _TRANSACTION_BASIC_INFORMATION { - GUID TransactionId; - ULONG State; - ULONG Outcome; -} TRANSACTION_BASIC_INFORMATION, *PTRANSACTION_BASIC_INFORMATION; - -typedef struct _TRANSACTIONMANAGER_BASIC_INFORMATION { - GUID TmIdentity; - LARGE_INTEGER VirtualClock; -} TRANSACTIONMANAGER_BASIC_INFORMATION, *PTRANSACTIONMANAGER_BASIC_INFORMATION; - -typedef struct _TRANSACTIONMANAGER_LOG_INFORMATION { - GUID LogIdentity; -} TRANSACTIONMANAGER_LOG_INFORMATION, *PTRANSACTIONMANAGER_LOG_INFORMATION; - -typedef struct _TRANSACTIONMANAGER_LOGPATH_INFORMATION { - ULONG LogPathLength; - __field_ecount(LogPathLength) WCHAR LogPath[1]; // Variable size -// Data[1]; // Variable size data not declared -} TRANSACTIONMANAGER_LOGPATH_INFORMATION, *PTRANSACTIONMANAGER_LOGPATH_INFORMATION; - -typedef struct _TRANSACTIONMANAGER_RECOVERY_INFORMATION { - ULONGLONG LastRecoveredLsn; -} TRANSACTIONMANAGER_RECOVERY_INFORMATION, *PTRANSACTIONMANAGER_RECOVERY_INFORMATION; - - - - -typedef struct _TRANSACTION_PROPERTIES_INFORMATION { - ULONG IsolationLevel; - ULONG IsolationFlags; - LARGE_INTEGER Timeout; - ULONG Outcome; - ULONG DescriptionLength; - WCHAR Description[1]; // Variable size -// Data[1]; // Variable size data not declared -} TRANSACTION_PROPERTIES_INFORMATION, *PTRANSACTION_PROPERTIES_INFORMATION; - -// The following info-class is intended for DTC's use only; it will be -// deprecated, and no one else should take a dependency on it. -typedef struct _TRANSACTION_BIND_INFORMATION { - HANDLE TmHandle; -} TRANSACTION_BIND_INFORMATION, *PTRANSACTION_BIND_INFORMATION; - -typedef struct _TRANSACTION_ENLISTMENT_PAIR { - GUID EnlistmentId; - GUID ResourceManagerId; -} TRANSACTION_ENLISTMENT_PAIR, *PTRANSACTION_ENLISTMENT_PAIR; - -typedef struct _TRANSACTION_ENLISTMENTS_INFORMATION { - ULONG NumberOfEnlistments; - TRANSACTION_ENLISTMENT_PAIR EnlistmentPair[1]; // Variable size -} TRANSACTION_ENLISTMENTS_INFORMATION, *PTRANSACTION_ENLISTMENTS_INFORMATION; - -typedef struct _TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION { - TRANSACTION_ENLISTMENT_PAIR SuperiorEnlistmentPair; -} TRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION, *PTRANSACTION_SUPERIOR_ENLISTMENT_INFORMATION; - - -typedef struct _RESOURCEMANAGER_BASIC_INFORMATION { - GUID ResourceManagerId; - ULONG DescriptionLength; - WCHAR Description[1]; // Variable size -} RESOURCEMANAGER_BASIC_INFORMATION, *PRESOURCEMANAGER_BASIC_INFORMATION; - -typedef struct _RESOURCEMANAGER_COMPLETION_INFORMATION { - HANDLE IoCompletionPortHandle; - ULONG_PTR CompletionKey; -} RESOURCEMANAGER_COMPLETION_INFORMATION, *PRESOURCEMANAGER_COMPLETION_INFORMATION; - -typedef enum _TRANSACTION_INFORMATION_CLASS { - TransactionBasicInformation, - TransactionPropertiesInformation, - TransactionEnlistmentInformation, - TransactionSuperiorEnlistmentInformation -} TRANSACTION_INFORMATION_CLASS; - - -typedef enum _TRANSACTIONMANAGER_INFORMATION_CLASS { - TransactionManagerBasicInformation, - TransactionManagerLogInformation, - TransactionManagerLogPathInformation, - TransactionManagerRecoveryInformation = 4 - -} TRANSACTIONMANAGER_INFORMATION_CLASS; - - - -typedef enum _RESOURCEMANAGER_INFORMATION_CLASS { - ResourceManagerBasicInformation, - ResourceManagerCompletionInformation, -} RESOURCEMANAGER_INFORMATION_CLASS; - - -typedef struct _ENLISTMENT_BASIC_INFORMATION { - GUID EnlistmentId; - GUID TransactionId; - GUID ResourceManagerId; -} ENLISTMENT_BASIC_INFORMATION, *PENLISTMENT_BASIC_INFORMATION; - -typedef struct _ENLISTMENT_CRM_INFORMATION { - GUID CrmTransactionManagerId; - GUID CrmResourceManagerId; - GUID CrmEnlistmentId; -} ENLISTMENT_CRM_INFORMATION, *PENLISTMENT_CRM_INFORMATION; - - - -typedef enum _ENLISTMENT_INFORMATION_CLASS { - EnlistmentBasicInformation, - EnlistmentRecoveryInformation, - EnlistmentCrmInformation -} ENLISTMENT_INFORMATION_CLASS; - -typedef struct _TRANSACTION_LIST_ENTRY { - UOW UOW; -} TRANSACTION_LIST_ENTRY, *PTRANSACTION_LIST_ENTRY; - -typedef struct _TRANSACTION_LIST_INFORMATION { - ULONG NumberOfTransactions; - TRANSACTION_LIST_ENTRY TransactionInformation[1]; // Var size -} TRANSACTION_LIST_INFORMATION, *PTRANSACTION_LIST_INFORMATION; - - -// -// Types of objects known to the kernel transaction manager. -// - -typedef enum _KTMOBJECT_TYPE { - - KTMOBJECT_TRANSACTION, - KTMOBJECT_TRANSACTION_MANAGER, - KTMOBJECT_RESOURCE_MANAGER, - KTMOBJECT_ENLISTMENT, - KTMOBJECT_INVALID - -} KTMOBJECT_TYPE, *PKTMOBJECT_TYPE; - - -// -// KTMOBJECT_CURSOR -// -// Used by NtEnumerateTransactionObject to enumerate a transaction -// object namespace (e.g. enlistments in a resource manager). -// - -typedef struct _KTMOBJECT_CURSOR { - - // - // The last GUID enumerated; zero if beginning enumeration. - // - - GUID LastQuery; - - // - // A count of GUIDs filled in by this last enumeration. - // - - ULONG ObjectIdCount; - - // - // ObjectIdCount GUIDs from the namespace specified. - // - - GUID ObjectIds[1]; - -} KTMOBJECT_CURSOR, *PKTMOBJECT_CURSOR; - - - -// -// Nt level transaction manager API calls -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateTransactionManager ( - __out PHANDLE TmHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PUNICODE_STRING LogFileName, - __in_opt ULONG CreateOptions, - __in_opt ULONG CommitStrength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenTransactionManager ( - __out PHANDLE TmHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PUNICODE_STRING LogFileName, - __in_opt LPGUID TmIdentity, - __in_opt ULONG OpenOptions - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRenameTransactionManager ( - __in PUNICODE_STRING LogFileName, - __in LPGUID ExistingTransactionManagerGuid - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRollforwardTransactionManager ( - __in HANDLE TransactionManagerHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRecoverTransactionManager ( - __in HANDLE TransactionManagerHandle - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationTransactionManager ( - __in HANDLE TransactionManagerHandle, - __in TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, - __out_bcount(TransactionManagerInformationLength) PVOID TransactionManagerInformation, - __in ULONG TransactionManagerInformationLength, - __out PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationTransactionManager ( - __in_opt HANDLE TmHandle, - __in TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, - __in_bcount(TransactionManagerInformationLength) PVOID TransactionManagerInformation, - __in ULONG TransactionManagerInformationLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtEnumerateTransactionObject ( - __in_opt HANDLE RootObjectHandle, - __in KTMOBJECT_TYPE QueryType, - __inout_bcount(ObjectCursorLength) PKTMOBJECT_CURSOR ObjectCursor, - __in ULONG ObjectCursorLength, - __out PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI * PFN_NT_CREATE_TRANSACTION)( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt LPGUID Uow, - __in_opt HANDLE TmHandle, - __in_opt ULONG CreateOptions, - __in_opt ULONG IsolationLevel, - __in_opt ULONG IsolationFlags, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PUNICODE_STRING Description - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateTransaction ( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt LPGUID Uow, - __in_opt HANDLE TmHandle, - __in_opt ULONG CreateOptions, - __in_opt ULONG IsolationLevel, - __in_opt ULONG IsolationFlags, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PUNICODE_STRING Description - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI *PFN_NT_OPEN_TRANSACTION)( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt LPGUID Uow, - __in_opt HANDLE TmHandle - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenTransaction ( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in LPGUID Uow, - __in_opt HANDLE TmHandle - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI * PFN_NT_QUERY_INFORMATION_TRANSACTION)( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __out_bcount(TransactionInformationLength) PVOID TransactionInformation, - __in ULONG TransactionInformationLength, - __out_opt PULONG ReturnLength - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationTransaction ( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __out_bcount(TransactionInformationLength) PVOID TransactionInformation, - __in ULONG TransactionInformationLength, - __out_opt PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI * PFN_NT_SET_INFORMATION_TRANSACTION)( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __in PVOID TransactionInformation, - __in ULONG TransactionInformationLength - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationTransaction ( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __in_bcount(TransactionInformationLength) PVOID TransactionInformation, - __in ULONG TransactionInformationLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI * PFN_NT_COMMIT_TRANSACTION)( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCommitTransaction ( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -typedef NTSTATUS (NTAPI * PFN_NT_ROLLBACK_TRANSACTION)( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRollbackTransaction ( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateEnlistment ( - __out PHANDLE EnlistmentHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE ResourceManagerHandle, - __in HANDLE TransactionHandle, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt ULONG CreateOptions, - __in NOTIFICATION_MASK NotificationMask, - __in_opt PVOID EnlistmentKey - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenEnlistment ( - __out PHANDLE EnlistmentHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE ResourceManagerHandle, - __in LPGUID EnlistmentGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationEnlistment ( - __in HANDLE EnlistmentHandle, - __in ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, - __out_bcount(EnlistmentInformationLength) PVOID EnlistmentInformation, - __in ULONG EnlistmentInformationLength, - __out PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationEnlistment ( - __in_opt HANDLE EnlistmentHandle, - __in ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, - __in_bcount(EnlistmentInformationLength) PVOID EnlistmentInformation, - __in ULONG EnlistmentInformationLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRecoverEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PVOID EnlistmentKey - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrePrepareEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrepareEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCommitEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRollbackEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrePrepareComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPrepareComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCommitComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtReadOnlyEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRollbackComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtSinglePhaseReject ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtCreateResourceManager ( - __out PHANDLE ResourceManagerHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE TmHandle, - __in LPGUID RmGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt ULONG CreateOptions, - __in_opt PUNICODE_STRING Description - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtOpenResourceManager ( - __out PHANDLE ResourceManagerHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE TmHandle, - __in_opt LPGUID ResourceManagerGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRecoverResourceManager ( - __in HANDLE ResourceManagerHandle - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtGetNotificationResourceManager ( - __in HANDLE ResourceManagerHandle, - __out PTRANSACTION_NOTIFICATION TransactionNotification, - __in ULONG NotificationLength, - __in_opt PLARGE_INTEGER Timeout, - __out_opt PULONG ReturnLength, - __in ULONG Asynchronous, - __in_opt ULONG_PTR AsynchronousContext - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtQueryInformationResourceManager ( - __in HANDLE ResourceManagerHandle, - __in RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, - __out_bcount(ResourceManagerInformationLength) PVOID ResourceManagerInformation, - __in ULONG ResourceManagerInformationLength, - __out_opt PULONG ReturnLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtSetInformationResourceManager ( - __in HANDLE ResourceManagerHandle, - __in RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, - __in_bcount(ResourceManagerInformationLength) PVOID ResourceManagerInformation, - __in ULONG ResourceManagerInformationLength - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtRegisterProtocolAddressInformation( - __in HANDLE ResourceManager, - __in PCRM_PROTOCOL_ID ProtocolId, - __in ULONG ProtocolInformationSize, - __in PVOID ProtocolInformation, - __in_opt ULONG CreateOptions - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPropagationComplete( - __in HANDLE ResourceManagerHandle, - __in ULONG RequestCookie, - __in ULONG BufferLength, - __in PVOID Buffer - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -NtPropagationFailed( - __in HANDLE ResourceManagerHandle, - __in ULONG RequestCookie, - __in NTSTATUS PropStatus - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - - -#ifdef __cplusplus -} -#endif - -#endif // _NTTMAPI_ - - -// -// Define alignment macros to align structure sizes and pointers up and down. -// - -#undef ALIGN_DOWN_BY -#undef ALIGN_UP_BY -#undef ALIGN_DOWN_POINTER_BY -#undef ALIGN_UP_POINTER_BY -#undef ALIGN_DOWN -#undef ALIGN_UP -#undef ALIGN_DOWN_POINTER -#undef ALIGN_UP_POINTER - -#define ALIGN_DOWN_BY(length, alignment) \ - ((ULONG_PTR)(length) & ~(alignment - 1)) - -#define ALIGN_UP_BY(length, alignment) \ - (ALIGN_DOWN_BY(((ULONG_PTR)(length) + alignment - 1), alignment)) - -#define ALIGN_DOWN_POINTER_BY(address, alignment) \ - ((PVOID)((ULONG_PTR)(address) & ~((ULONG_PTR)alignment - 1))) - -#define ALIGN_UP_POINTER_BY(address, alignment) \ - (ALIGN_DOWN_POINTER_BY(((ULONG_PTR)(address) + alignment - 1), alignment)) - -#define ALIGN_DOWN(length, type) \ - ALIGN_DOWN_BY(length, sizeof(type)) - -#define ALIGN_UP(length, type) \ - ALIGN_UP_BY(length, sizeof(type)) - -#define ALIGN_DOWN_POINTER(address, type) \ - ALIGN_DOWN_POINTER_BY(address, sizeof(type)) - -#define ALIGN_UP_POINTER(address, type) \ - ALIGN_UP_POINTER_BY(address, sizeof(type)) - -// -// Calculate the byte offset of a field in a structure of type type. -// - -#ifndef FIELD_OFFSET -#define FIELD_OFFSET(type, field) ((ULONG)&(((type *)0)->field)) -#endif - -#ifndef FIELD_SIZE -#define FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) -#endif - -#define POOL_TAGGING 1 - -#if DBG - -#define IF_DEBUG if (TRUE) - -#else - -#define IF_DEBUG if (FALSE) - -#endif - -#if DEVL - - -extern ULONG NtGlobalFlag; - -#define IF_NTOS_DEBUG(FlagName) \ - if (NtGlobalFlag & (FLG_ ## FlagName)) - -#else - -#define IF_NTOS_DEBUG(FlagName) if(FALSE) - -#endif - - - -// -// Define General Lookaside and supporting types here -// - -typedef enum _POOL_TYPE POOL_TYPE; - -typedef -__drv_sameIRQL -__drv_functionClass(ALLOCATE_FUNCTION) -PVOID -ALLOCATE_FUNCTION ( - __in POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag - ); -typedef ALLOCATE_FUNCTION *PALLOCATE_FUNCTION; - -typedef -__drv_sameIRQL -__drv_functionClass(FREE_FUNCTION) -VOID -FREE_FUNCTION ( - __in PVOID Buffer - ); -typedef FREE_FUNCTION *PFREE_FUNCTION; - -typedef struct _LOOKASIDE_LIST_EX *PLOOKASIDE_LIST_EX; - -typedef -__drv_sameIRQL -__drv_functionClass(ALLOCATE_FUNCTION_EX) -PVOID -ALLOCATE_FUNCTION_EX ( - __in POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag, - __inout PLOOKASIDE_LIST_EX Lookaside - ); -typedef ALLOCATE_FUNCTION_EX *PALLOCATE_FUNCTION_EX; - -typedef -__drv_sameIRQL -__drv_functionClass(FREE_FUNCTION_EX) -VOID -FREE_FUNCTION_EX ( - __in PVOID Buffer, - __inout PLOOKASIDE_LIST_EX Lookaside - ); -typedef FREE_FUNCTION_EX *PFREE_FUNCTION_EX; - -#if !defined(_WIN64) && (defined(_NTDDK_) || defined(_NTIFS_) || defined(_NDIS_)) - -#define LOOKASIDE_ALIGN - -#else - -#define LOOKASIDE_ALIGN DECLSPEC_CACHEALIGN - -#endif - - -// -// The goal here is to end up with two structure types that are identical except -// for the fact that one (GENERAL_LOOKASIDE) is cache aligned, and the other -// (GENERAL_LOOKASIDE_POOL) is merely naturally aligned. -// -// An anonymous structure element would do the trick except that C++ can't handle -// such complex syntax, so we're stuck with this macro technique. -// - -#define GENERAL_LOOKASIDE_LAYOUT \ - union { \ - SLIST_HEADER ListHead; \ - SINGLE_LIST_ENTRY SingleListHead; \ - } DUMMYUNIONNAME; \ - USHORT Depth; \ - USHORT MaximumDepth; \ - ULONG TotalAllocates; \ - union { \ - ULONG AllocateMisses; \ - ULONG AllocateHits; \ - } DUMMYUNIONNAME2; \ - \ - ULONG TotalFrees; \ - union { \ - ULONG FreeMisses; \ - ULONG FreeHits; \ - } DUMMYUNIONNAME3; \ - \ - POOL_TYPE Type; \ - ULONG Tag; \ - ULONG Size; \ - union { \ - PALLOCATE_FUNCTION_EX AllocateEx; \ - PALLOCATE_FUNCTION Allocate; \ - } DUMMYUNIONNAME4; \ - \ - union { \ - PFREE_FUNCTION_EX FreeEx; \ - PFREE_FUNCTION Free; \ - } DUMMYUNIONNAME5; \ - \ - LIST_ENTRY ListEntry; \ - ULONG LastTotalAllocates; \ - union { \ - ULONG LastAllocateMisses; \ - ULONG LastAllocateHits; \ - } DUMMYUNIONNAME6; \ - ULONG Future[2]; - -// -// GENERAL_LOOKASIDE is a cache aligned type, typically shared between -// multiple processors -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#pragma warning(disable:4324) // structure was padded due to __declspec(align()) -#endif - -typedef struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE { - GENERAL_LOOKASIDE_LAYOUT -} GENERAL_LOOKASIDE; - -typedef GENERAL_LOOKASIDE *PGENERAL_LOOKASIDE; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - - - -// -// GENERAL_LOOKASIDE_POOL is the same layout as GENERAL_LOOKASIDE but is -// not cacheblock aligned, for use in cases where access is limited to a -// single processor -// - -typedef struct _GENERAL_LOOKASIDE_POOL { - GENERAL_LOOKASIDE_LAYOUT -} GENERAL_LOOKASIDE_POOL, *PGENERAL_LOOKASIDE_POOL; - -// -// The above two structures should have identical layouts. A few spot-checks -// just to make sure. -// - -#define LOOKASIDE_CHECK(f) \ - C_ASSERT(FIELD_OFFSET(GENERAL_LOOKASIDE,f)==FIELD_OFFSET(GENERAL_LOOKASIDE_POOL,f)) - -LOOKASIDE_CHECK(TotalFrees); -LOOKASIDE_CHECK(Tag); -LOOKASIDE_CHECK(Future); - -// -// Kernel definitions that need to be here for forward reference purposes -// - - -// -// Processor modes. -// - -typedef CCHAR KPROCESSOR_MODE; - -typedef enum _MODE { - KernelMode, - UserMode, - MaximumMode -} MODE; - - -// -// APC function types -// - -// -// Put in an empty definition for the KAPC so that the -// routines can reference it before it is declared. -// - -struct _KAPC; - -typedef -__drv_functionClass(KNORMAL_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -VOID -KNORMAL_ROUTINE ( - __in_opt PVOID NormalContext, - __in_opt PVOID SystemArgument1, - __in_opt PVOID SystemArgument2 - ); -typedef KNORMAL_ROUTINE *PKNORMAL_ROUTINE; - -typedef -__drv_functionClass(KKERNEL_ROUTINE) -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(APC_LEVEL) -__drv_requiresIRQL(APC_LEVEL) -__drv_sameIRQL -VOID -KKERNEL_ROUTINE ( - __in struct _KAPC *Apc, - __deref_inout_opt PKNORMAL_ROUTINE *NormalRoutine, - __deref_inout_opt PVOID *NormalContext, - __deref_inout_opt PVOID *SystemArgument1, - __deref_inout_opt PVOID *SystemArgument2 - ); -typedef KKERNEL_ROUTINE *PKKERNEL_ROUTINE; - -typedef -__drv_functionClass(KRUNDOWN_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -VOID -KRUNDOWN_ROUTINE ( - __in struct _KAPC *Apc - ); -typedef KRUNDOWN_ROUTINE *PKRUNDOWN_ROUTINE; - -typedef -__drv_functionClass(KSYNCHRONIZE_ROUTINE) -__drv_sameIRQL -BOOLEAN -KSYNCHRONIZE_ROUTINE ( - __in PVOID SynchronizeContext - ); -typedef KSYNCHRONIZE_ROUTINE *PKSYNCHRONIZE_ROUTINE; - -// -// Asynchronous Procedure Call (APC) object -// -// N.B. The size of this structure cannot change since it has been exported. -// - -#define ASSERT_APC(E) NT_ASSERT((E)->Type == ApcObject) - -typedef struct _KAPC { - UCHAR Type; - UCHAR SpareByte0; - UCHAR Size; - UCHAR SpareByte1; - ULONG SpareLong0; - struct _KTHREAD *Thread; - LIST_ENTRY ApcListEntry; - PKKERNEL_ROUTINE KernelRoutine; - PKRUNDOWN_ROUTINE RundownRoutine; - PKNORMAL_ROUTINE NormalRoutine; - PVOID NormalContext; - - // - // N.B. The following two members MUST be together. - // - - PVOID SystemArgument1; - PVOID SystemArgument2; - CCHAR ApcStateIndex; - KPROCESSOR_MODE ApcMode; - BOOLEAN Inserted; -} KAPC, *PKAPC, *PRKAPC; - -#define KAPC_OFFSET_TO_SPARE_BYTE0 FIELD_OFFSET(KAPC, SpareByte0) -#define KAPC_OFFSET_TO_SPARE_BYTE1 FIELD_OFFSET(KAPC, SpareByte1) -#define KAPC_OFFSET_TO_SPARE_LONG FIELD_OFFSET(KAPC, SpareLong0) -#define KAPC_OFFSET_TO_SYSTEMARGUMENT1 FIELD_OFFSET(KAPC, SystemArgument1) -#define KAPC_OFFSET_TO_SYSTEMARGUMENT2 FIELD_OFFSET(KAPC, SystemArgument2) -#define KAPC_OFFSET_TO_APCSTATEINDEX FIELD_OFFSET(KAPC, ApcStateIndex) -#define KAPC_ACTUAL_LENGTH (FIELD_OFFSET(KAPC, Inserted) + sizeof(BOOLEAN)) - - -// -// DPC routine -// - -struct _KDPC; - -__drv_functionClass(KDEFERRED_ROUTINE) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -__drv_requiresIRQL(DISPATCH_LEVEL) -__drv_sameIRQL -typedef -VOID -KDEFERRED_ROUTINE ( - __in struct _KDPC *Dpc, - __in_opt PVOID DeferredContext, - __in_opt PVOID SystemArgument1, - __in_opt PVOID SystemArgument2 - ); - -typedef KDEFERRED_ROUTINE *PKDEFERRED_ROUTINE; - -// -// Define DPC importance. -// -// LowImportance - Queue DPC at end of target DPC queue. -// MediumImportance - Queue DPC at end of target DPC queue. -// MediumHighImportance - Queue DPC at end of target DPC queue. -// HighImportance - Queue DPC at front of target DPC DPC queue. -// -// If there is currently a DPC active on the target processor, or a DPC -// interrupt has already been requested on the target processor when a -// DPC is queued, then no further action is necessary. The DPC will be -// executed on the target processor when its queue entry is processed. -// -// If there is not a DPC active on the target processor and a DPC interrupt -// has not been requested on the target processor, then the exact treatment -// of the DPC is dependent on whether the host system is a UP system or an -// MP system. -// -// UP system. -// -// If the DPC is not of low importance, the current DPC queue depth -// is greater than the maximum target depth, or current DPC request rate is -// less the minimum target rate, then a DPC interrupt is requested on the -// host processor and the DPC will be processed when the interrupt occurs. -// Otherwise, no DPC interupt is requested and the DPC execution will be -// delayed until the DPC queue depth is greater that the target depth or the -// minimum DPC rate is less than the target rate. -// -// MP system. -// -// If the DPC is being queued to another processor and the depth of the DPC -// queue on the target processor is greater than the maximum target depth or -// the DPC is of medium high or high importance, then a DPC interrupt is -// requested on the target processor and the DPC will be processed when the -// Interrupt occurs. Otherwise, the DPC execution will be delayed on the target -// processor until the DPC queue depth on the target processor is greater that -// the maximum target depth or the minimum DPC rate on the target processor is -// less than the target mimimum rate. -// -// If the DPC is being queued to the current processor and the DPC is not of -// low importance, the current DPC queue depth is greater than the maximum -// target depth, or the minimum DPC rate is less than the minimum target rate, -// then a DPC interrupt is request on the current processor and the DPV will -// be processed when the interrupt occurs. Otherwise, no DPC interupt is -// requested and the DPC execution will be delayed until the DPC queue depth -// is greater that the target depth or the minimum DPC rate is less than the -// target rate. -// - -typedef enum _KDPC_IMPORTANCE { - LowImportance, - MediumImportance, - HighImportance, - MediumHighImportance -} KDPC_IMPORTANCE; - -// -// Define DPC type indicies. -// - -#define DPC_NORMAL 0 -#define DPC_THREADED 1 - -// -// Deferred Procedure Call (DPC) object -// - -#define ASSERT_DPC(Object) \ - ASSERT(((Object)->Type == 0) || \ - ((Object)->Type == DpcObject) || \ - ((Object)->Type == ThreadedDpcObject)) - -typedef struct _KDPC { - UCHAR Type; - UCHAR Importance; - volatile USHORT Number; - LIST_ENTRY DpcListEntry; - PKDEFERRED_ROUTINE DeferredRoutine; - PVOID DeferredContext; - PVOID SystemArgument1; - PVOID SystemArgument2; - __volatile PVOID DpcData; -} KDPC, *PKDPC, *PRKDPC; - -// -// Interprocessor interrupt worker routine function prototype. -// - -typedef PVOID PKIPI_CONTEXT; - -typedef -__drv_functionClass(KIPI_WORKER) -__drv_sameIRQL -VOID -KIPI_WORKER ( - __inout PKIPI_CONTEXT PacketContext, - __in_opt PVOID Parameter1, - __in_opt PVOID Parameter2, - __in_opt PVOID Parameter3 - ); - -typedef KIPI_WORKER *PKIPI_WORKER; - -// -// Define interprocessor interrupt performance counters. -// - -typedef struct _KIPI_COUNTS { - ULONG Freeze; - ULONG Packet; - ULONG DPC; - ULONG APC; - ULONG FlushSingleTb; - ULONG FlushMultipleTb; - ULONG FlushEntireTb; - ULONG GenericCall; - ULONG ChangeColor; - ULONG SweepDcache; - ULONG SweepIcache; - ULONG SweepIcacheRange; - ULONG FlushIoBuffers; - ULONG GratuitousDPC; -} KIPI_COUNTS, *PKIPI_COUNTS; - - -// -// I/O system definitions. -// -// Define a Memory Descriptor List (MDL) -// -// An MDL describes pages in a virtual buffer in terms of physical pages. The -// pages associated with the buffer are described in an array that is allocated -// just after the MDL header structure itself. -// -// One simply calculates the base of the array by adding one to the base -// MDL pointer: -// -// Pages = (PPFN_NUMBER) (Mdl + 1); -// -// Notice that while in the context of the subject thread, the base virtual -// address of a buffer mapped by an MDL may be referenced using the following: -// -// Mdl->StartVa | Mdl->ByteOffset -// - -typedef __struct_bcount(Size) struct _MDL { - struct _MDL *Next; - CSHORT Size; - CSHORT MdlFlags; - struct _EPROCESS *Process; - PVOID MappedSystemVa; - PVOID StartVa; - ULONG ByteCount; - ULONG ByteOffset; -} MDL, *PMDL; - -typedef __inexpressible_readableTo(polymorphism) MDL *PMDLX; - -#define MDL_MAPPED_TO_SYSTEM_VA 0x0001 -#define MDL_PAGES_LOCKED 0x0002 -#define MDL_SOURCE_IS_NONPAGED_POOL 0x0004 -#define MDL_ALLOCATED_FIXED_SIZE 0x0008 -#define MDL_PARTIAL 0x0010 -#define MDL_PARTIAL_HAS_BEEN_MAPPED 0x0020 -#define MDL_IO_PAGE_READ 0x0040 -#define MDL_WRITE_OPERATION 0x0080 -#define MDL_PARENT_MAPPED_SYSTEM_VA 0x0100 -#define MDL_FREE_EXTRA_PTES 0x0200 -#define MDL_DESCRIBES_AWE 0x0400 -#define MDL_IO_SPACE 0x0800 -#define MDL_NETWORK_HEADER 0x1000 -#define MDL_MAPPING_CAN_FAIL 0x2000 -#define MDL_ALLOCATED_MUST_SUCCEED 0x4000 -#define MDL_INTERNAL 0x8000 - -#define MDL_MAPPING_FLAGS (MDL_MAPPED_TO_SYSTEM_VA | \ - MDL_PAGES_LOCKED | \ - MDL_SOURCE_IS_NONPAGED_POOL | \ - MDL_PARTIAL_HAS_BEEN_MAPPED | \ - MDL_PARENT_MAPPED_SYSTEM_VA | \ - MDL_SYSTEM_VA | \ - MDL_IO_SPACE ) - - -// -// switch to PREFast or DBG when appropriate -// - -#if defined(_PREFAST_) - -void __PREfastPagedCode(void); -void __PREfastPagedCodeLocked(void); -#define PAGED_CODE() __PREfastPagedCode(); -#define PAGED_CODE_LOCKED() __PREfastPagedCodeLocked(); - -#elif DBG - -#if (NTDDI_VERSION >= NTDDI_VISTA) -#define PAGED_ASSERT( exp ) NT_ASSERT( exp ) -#else -#define PAGED_ASSERT( exp ) ASSERT( exp ) -#endif - -#define PAGED_CODE() { \ - if (KeGetCurrentIrql() > APC_LEVEL) { \ - KdPrint(("EX: Pageable code called at IRQL %d\n", KeGetCurrentIrql())); \ - PAGED_ASSERT(FALSE); \ - } \ -} - -#define PAGED_CODE_LOCKED() NOP_FUNCTION; - -#else - -#define PAGED_CODE() NOP_FUNCTION; -#define PAGED_CODE_LOCKED() NOP_FUNCTION; - -#endif - -#define NTKERNELAPI DECLSPEC_IMPORT - -#if defined(_X86_) && !defined(_NTHAL_) - -#define _DECL_HAL_KE_IMPORT DECLSPEC_IMPORT - -#elif defined(_X86_) - -#define _DECL_HAL_KE_IMPORT - -#else - -#define _DECL_HAL_KE_IMPORT NTKERNELAPI - -#endif - - -#if !defined(_NTHALDLL_) && !defined(_BLDR_) - -#define NTHALAPI DECLSPEC_IMPORT - -#else - -#define NTHALAPI - -#endif - -// -// Common dispatcher object header -// -// N.B. The size field contains the number of dwords in the structure. -// - -#define TIMER_EXPIRED_INDEX_BITS 6 -#define TIMER_PROCESSOR_INDEX_BITS 5 - -typedef struct _DISPATCHER_HEADER { - union { - struct { - UCHAR Type; // All (accessible via KOBJECT_TYPE) - - union { - union { // Timer - UCHAR TimerControlFlags; - struct { - UCHAR Absolute : 1; - UCHAR Coalescable : 1; - UCHAR KeepShifting : 1; // Periodic timer - UCHAR EncodedTolerableDelay : 5; // Periodic timer - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - - UCHAR Abandoned; // Queue - BOOLEAN Signalling; // Gate/Events - } DUMMYUNIONNAME; - - union { - union { - UCHAR ThreadControlFlags; // Thread - struct { - UCHAR CpuThrottled : 1; - UCHAR CycleProfiling : 1; - UCHAR CounterProfiling : 1; - UCHAR Reserved : 5; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - UCHAR Hand; // Timer - UCHAR Size; // All other objects - } DUMMYUNIONNAME2; - - union { - union { // Timer - UCHAR TimerMiscFlags; - struct { - -#if !defined(_X86_) - - UCHAR Index : TIMER_EXPIRED_INDEX_BITS; - -#else - - UCHAR Index : 1; - UCHAR Processor : TIMER_PROCESSOR_INDEX_BITS; - -#endif - - UCHAR Inserted : 1; - volatile UCHAR Expired : 1; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - union { // Thread - BOOLEAN DebugActive; - struct { - BOOLEAN ActiveDR7 : 1; - BOOLEAN Instrumented : 1; - BOOLEAN Reserved2 : 4; - BOOLEAN UmsScheduled : 1; - BOOLEAN UmsPrimary : 1; - } DUMMYSTRUCTNAME; - } DUMMYUNIONNAME; - BOOLEAN DpcActive; // Mutant - } DUMMYUNIONNAME3; - } DUMMYSTRUCTNAME; - - volatile LONG Lock; // Interlocked - } DUMMYUNIONNAME; - - LONG SignalState; // Object lock - LIST_ENTRY WaitListHead; // Object lock -} DISPATCHER_HEADER; - - - -// -// Event object -// - -#define ASSERT_EVENT(E) \ - NT_ASSERT((KOBJECT_TYPE(E) == NotificationEvent) || \ - (KOBJECT_TYPE(E) == SynchronizationEvent)) - -typedef struct _KEVENT { - DISPATCHER_HEADER Header; -} KEVENT, *PKEVENT, *PRKEVENT; - -// -// Gate object -// -// N.B. Gate object services allow the specification of synchronization -// events. This allows fast mutex to be transparently replaced with -// gates. -// - -#define ASSERT_GATE(object) \ - NT_ASSERT((KOBJECT_TYPE(object) == GateObject) || \ - (KOBJECT_TYPE(object) == EventSynchronizationObject)) - -typedef struct _KGATE { - DISPATCHER_HEADER Header; -} KGATE, *PKGATE; - -// -// Timer object -// -// N.B. The period field must be the last member of this structure. -// - -#define ASSERT_TIMER(E) \ - NT_ASSERT((KOBJECT_TYPE(E) == TimerNotificationObject) || \ - (KOBJECT_TYPE(E) == TimerSynchronizationObject)) - -typedef struct _KTIMER { - DISPATCHER_HEADER Header; - ULARGE_INTEGER DueTime; - LIST_ENTRY TimerListEntry; - struct _KDPC *Dpc; - -#if !defined(_X86_) - - ULONG Processor; - -#endif - - ULONG Period; -} KTIMER, *PKTIMER, *PRKTIMER; - -#define KTIMER_ACTUAL_LENGTH \ - (FIELD_OFFSET(KTIMER, Period) + sizeof(LONG)) - -typedef enum _LOCK_OPERATION { - IoReadAccess, - IoWriteAccess, - IoModifyAccess -} LOCK_OPERATION; - - -#if defined(_X86_) - - -// -// Types to use to contain PFNs and their counts. -// - -typedef ULONG PFN_COUNT; - -typedef LONG SPFN_NUMBER, *PSPFN_NUMBER; -typedef ULONG PFN_NUMBER, *PPFN_NUMBER; - -// -// Define maximum size of flush multiple TB request. -// - -#define FLUSH_MULTIPLE_MAXIMUM 32 - -// -// Indicate that the i386 compiler supports the pragma textout construct. -// - -#define ALLOC_PRAGMA 1 -// -// Indicate that the i386 compiler supports the DATA_SEG("INIT") and -// DATA_SEG("PAGE") pragmas -// - -#define ALLOC_DATA_PRAGMA 1 - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(HIGH_LEVEL) -_DECL_HAL_KE_IMPORT -VOID -FASTCALL -KfLowerIrql ( - __in __drv_restoresIRQL __drv_nonConstant KIRQL NewIrql - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(HIGH_LEVEL) -__drv_raisesIRQL(NewIrql) -__drv_savesIRQL -_DECL_HAL_KE_IMPORT -KIRQL -FASTCALL -KfRaiseIrql ( - __in KIRQL NewIrql - ); -#endif - -#define KeLowerIrql(a) KfLowerIrql(a) -#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -KIRQL -KeRaiseIrqlToDpcLevel ( - VOID - ); -#endif - - -// -// I/O space read and write macros. -// -// These have to be actual functions on the 386, because we need -// to use assembler, but cannot return a value if we inline it. -// -// The READ/WRITE_REGISTER_* calls manipulate I/O registers in MEMORY space. -// (Use x86 move instructions, with LOCK prefix to force correct behavior -// w.r.t. caches and write buffers.) -// -// The READ/WRITE_PORT_* calls manipulate I/O registers in PORT space. -// (Use x86 in/out instructions.) -// - -NTKERNELAPI -UCHAR -NTAPI -READ_REGISTER_UCHAR( - __in __drv_nonConstant PUCHAR Register - ); - -NTKERNELAPI -USHORT -NTAPI -READ_REGISTER_USHORT( - __in __drv_nonConstant PUSHORT Register - ); - -NTKERNELAPI -ULONG -NTAPI -READ_REGISTER_ULONG( - __in __drv_nonConstant PULONG Register - ); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_UCHAR( - __in __drv_nonConstant PUCHAR Register, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_USHORT( - __in __drv_nonConstant PUSHORT Register, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ); - -NTKERNELAPI -VOID -NTAPI -READ_REGISTER_BUFFER_ULONG( - __in __drv_nonConstant PULONG Register, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ); - - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_UCHAR( - __in __drv_nonConstant PUCHAR Register, - __in UCHAR Value - ); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_USHORT( - __in __drv_nonConstant PUSHORT Register, - __in USHORT Value - ); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_ULONG( - __in __drv_nonConstant PULONG Register, - __in ULONG Value - ); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_UCHAR( - __in __drv_nonConstant PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_USHORT( - __in __drv_nonConstant PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -NTKERNELAPI -VOID -NTAPI -WRITE_REGISTER_BUFFER_ULONG( - __in __drv_nonConstant PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -NTHALAPI -UCHAR -NTAPI -READ_PORT_UCHAR( - __in __drv_nonConstant PUCHAR Port - ); - -NTHALAPI -USHORT -NTAPI -READ_PORT_USHORT( - __in __drv_nonConstant PUSHORT Port - ); - -NTHALAPI -ULONG -NTAPI -READ_PORT_ULONG( - __in __drv_nonConstant PULONG Port - ); - -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_UCHAR( - __in __drv_nonConstant PUCHAR Port, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ); - -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_USHORT( - __in __drv_nonConstant PUSHORT Port, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ); - -NTHALAPI -VOID -NTAPI -READ_PORT_BUFFER_ULONG( - __in __drv_nonConstant PULONG Port, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_UCHAR( - __in __drv_nonConstant PUCHAR Port, - __in UCHAR Value - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_USHORT( - __in __drv_nonConstant PUSHORT Port, - __in USHORT Value - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_ULONG( - __in __drv_nonConstant PULONG Port, - __in ULONG Value - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_UCHAR( - __in __drv_nonConstant PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_USHORT( - __in __drv_nonConstant PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -NTHALAPI -VOID -NTAPI -WRITE_PORT_BUFFER_ULONG( - __in __drv_nonConstant PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - - -// -// Get data cache fill size. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(KeGetDcacheFillSize) // Use GetDmaAlignment -#endif - -#define KeGetDcacheFillSize() 1L - - -#define KeFlushIoBuffers(Mdl, ReadOperation, DmaOperation) - - -#define ExAcquireSpinLock(Lock, OldIrql) KeAcquireSpinLock((Lock), (OldIrql)) -#define ExReleaseSpinLock(Lock, OldIrql) KeReleaseSpinLock((Lock), (OldIrql)) -#define ExAcquireSpinLockAtDpcLevel(Lock) KeAcquireSpinLockAtDpcLevel(Lock) -#define ExReleaseSpinLockFromDpcLevel(Lock) KeReleaseSpinLockFromDpcLevel(Lock) - - -#define KeQueryTickCount(CurrentCount) { \ - KSYSTEM_TIME volatile *_TickCount = *((PKSYSTEM_TIME *)(&KeTickCount)); \ - for (;;) { \ - (CurrentCount)->HighPart = _TickCount->High1Time; \ - (CurrentCount)->LowPart = _TickCount->LowPart; \ - if ((CurrentCount)->HighPart == _TickCount->High2Time) break; \ - YieldProcessor(); \ - } \ -} - -// -// The non-volatile 387 state -// - -typedef struct _KFLOATING_SAVE { - ULONG ControlWord; - ULONG StatusWord; - ULONG ErrorOffset; - ULONG ErrorSelector; - ULONG DataOffset; // Not used in wdm - ULONG DataSelector; - ULONG Cr0NpxState; - ULONG Spare1; // Not used in wdm -} KFLOATING_SAVE, *PKFLOATING_SAVE; - -// -// Structure of AMD cache information returned by CPUID instruction -// - -typedef union _AMD_L1_CACHE_INFO { - ULONG Ulong; - struct { - UCHAR LineSize; - UCHAR LinesPerTag; - UCHAR Associativity; - UCHAR Size; - }; -} AMD_L1_CACHE_INFO, *PAMD_L1_CACHE_INFO; - -typedef union _AMD_L2_CACHE_INFO { - ULONG Ulong; - struct { - UCHAR LineSize; - UCHAR LinesPerTag : 4; - UCHAR Associativity : 4; - USHORT Size; - }; -} AMD_L2_CACHE_INFO, *PAMD_L2_CACHE_INFO; - -typedef union _AMD_L3_CACHE_INFO { - ULONG Ulong; - struct { - UCHAR LineSize; - UCHAR LinesPerTag : 4; - UCHAR Associativity : 4; - USHORT Reserved : 2; - USHORT Size : 14; - }; -} AMD_L3_CACHE_INFO, *PAMD_L3_CACHE_INFO; - -// -// Structure of Intel deterministic cache information returned by -// CPUID instruction -// - -typedef enum _INTEL_CACHE_TYPE { - IntelCacheNull, - IntelCacheData, - IntelCacheInstruction, - IntelCacheUnified, - IntelCacheRam, - IntelCacheTrace -} INTEL_CACHE_TYPE; - -typedef union INTEL_CACHE_INFO_EAX { - ULONG Ulong; - struct { - INTEL_CACHE_TYPE Type : 5; - ULONG Level : 3; - ULONG SelfInitializing : 1; - ULONG FullyAssociative : 1; - ULONG Reserved : 4; - ULONG ThreadsSharing : 12; - ULONG ProcessorCores : 6; - }; -} INTEL_CACHE_INFO_EAX, *PINTEL_CACHE_INFO_EAX; - -typedef union INTEL_CACHE_INFO_EBX { - ULONG Ulong; - struct { - ULONG LineSize : 12; - ULONG Partitions : 10; - ULONG Associativity : 10; - }; -} INTEL_CACHE_INFO_EBX, *PINTEL_CACHE_INFO_EBX; - -// -// i386 Specific portions of mm component -// - -// -// Define the page size for the Intel 386 as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - - -#define MmGetProcedureAddress(Address) (Address) -#define MmLockPagableCodeSection(Address) MmLockPagableDataSection(Address) - -#define KIP0PCRADDRESS 0xffdff000 - -#define KI_USER_SHARED_DATA 0xffdf0000 -#define SharedUserData ((KUSER_SHARED_DATA * const) KI_USER_SHARED_DATA) - -// -// Result type definition for i386. (Machine specific enumerate type -// which is return type for portable exinterlockedincrement/decrement -// procedures.) In general, you should use the enumerated type defined -// in ex.h instead of directly referencing these constants. -// - -// Flags loaded into AH by LAHF instruction - -#define EFLAG_SIGN 0x8000 -#define EFLAG_ZERO 0x4000 -#define EFLAG_SELECT (EFLAG_SIGN | EFLAG_ZERO) - -#define RESULT_NEGATIVE ((EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) -#define RESULT_ZERO ((~EFLAG_SIGN & EFLAG_ZERO) & EFLAG_SELECT) -#define RESULT_POSITIVE ((~EFLAG_SIGN & ~EFLAG_ZERO) & EFLAG_SELECT) - -// -// Convert various portable ExInterlock APIs into their architectural -// equivalents. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInterlockedIncrementLong) // Use InterlockedIncrement -#pragma deprecated(ExInterlockedDecrementLong) // Use InterlockedDecrement -#pragma deprecated(ExInterlockedExchangeUlong) // Use InterlockedExchange -#endif - -#define ExInterlockedIncrementLong(Addend,Lock) \ - Exfi386InterlockedIncrementLong(Addend) - -#define ExInterlockedDecrementLong(Addend,Lock) \ - Exfi386InterlockedDecrementLong(Addend) - -#define ExInterlockedExchangeUlong(Target,Value,Lock) \ - Exfi386InterlockedExchangeUlong(Target,Value) - -#define ExInterlockedAddUlong ExfInterlockedAddUlong -#define ExInterlockedInsertHeadList ExfInterlockedInsertHeadList -#define ExInterlockedInsertTailList ExfInterlockedInsertTailList -#define ExInterlockedRemoveHeadList ExfInterlockedRemoveHeadList -#define ExInterlockedPopEntryList ExfInterlockedPopEntryList -#define ExInterlockedPushEntryList ExfInterlockedPushEntryList - -#if !defined(MIDL_PASS) -#if defined(NO_INTERLOCKED_INTRINSICS) || defined(_CROSS_PLATFORM_) - -NTKERNELAPI -LONG -FASTCALL -InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -NTKERNELAPI -LONG -FASTCALL -InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -NTKERNELAPI -LONG -FASTCALL -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -LONG -FASTCALL -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Increment - ); - -NTKERNELAPI -LONG -FASTCALL -InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - -#define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) \ - (PVOID)InterlockedCompareExchange((PLONG)Destination, (LONG)ExChange, (LONG)Comperand) - -NTKERNELAPI -LONGLONG -FASTCALL -ExfInterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in PLONGLONG ExChange, - __in PLONGLONG Comperand - ); - -FORCEINLINE -LONGLONG -InterlockedCompareExchange64_inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ) -{ - return ExfInterlockedCompareExchange64(Destination, &ExChange, &Comperand); -} - -#define InterlockedCompareExchange64 InterlockedCompareExchange64_inline - -#else // NO_INTERLOCKED_INTRINSICS || _CROSS_PLATFORM_ - -#if (_MSC_FULL_VER > 13009037) -LONG -__cdecl -_InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ); - -#pragma intrinsic(_InterlockedExchange) -#define InterlockedExchange _InterlockedExchange -#else -FORCEINLINE -LONG -FASTCALL -InterlockedExchange( - __inout __drv_interlocked LONG volatile *Target, - __in LONG Value - ) -{ - __asm { - mov eax, Value - mov ecx, Target - xchg [ecx], eax - } -} -#endif - -#if (_MSC_FULL_VER > 13009037) -LONG -__cdecl -_InterlockedIncrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -#pragma intrinsic(_InterlockedIncrement) -#define InterlockedIncrement _InterlockedIncrement -#else -#define InterlockedIncrement(Addend) (InterlockedExchangeAdd (Addend, 1)+1) -#endif - -#if (_MSC_FULL_VER > 13009037) -LONG -__cdecl -_InterlockedDecrement( - __inout __drv_interlocked LONG volatile *Addend - ); - -#pragma intrinsic(_InterlockedDecrement) -#define InterlockedDecrement _InterlockedDecrement -#else -#define InterlockedDecrement(Addend) (InterlockedExchangeAdd (Addend, -1)-1) -#endif - -#if (_MSC_FULL_VER > 13009037) -LONG -__cdecl -_InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Increment - ); - -#pragma intrinsic(_InterlockedExchangeAdd) -#define InterlockedExchangeAdd _InterlockedExchangeAdd -#else - -FORCEINLINE -LONG -FASTCALL -InterlockedExchangeAdd( - __inout __drv_interlocked LONG volatile *Addend, - __in LONG Increment - ) -{ - __asm { - mov eax, Increment - mov ecx, Addend - lock xadd [ecx], eax - } -} - -#endif - -#if (_MSC_FULL_VER > 13009037) -LONG -__cdecl -_InterlockedCompareExchange ( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG ExChange, - __in LONG Comperand - ); - -#pragma intrinsic(_InterlockedCompareExchange) -#define InterlockedCompareExchange (LONG)_InterlockedCompareExchange -#else -FORCEINLINE -LONG -FASTCALL -InterlockedCompareExchange( - __inout __drv_interlocked LONG volatile *Destination, - __in LONG Exchange, - __in LONG Comperand - ) -{ - __asm { - mov eax, Comperand - mov ecx, Destination - mov edx, Exchange - lock cmpxchg [ecx], edx - } -} -#endif - -#define InterlockedCompareExchangePointer(Destination, ExChange, Comperand) \ - (PVOID)InterlockedCompareExchange((PLONG)Destination, (LONG)ExChange, (LONG)Comperand) - -NTKERNELAPI -LONGLONG -FASTCALL -ExfInterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in PLONGLONG ExChange, - __in PLONGLONG Comperand - ); - -LONGLONG -FORCEINLINE -InterlockedCompareExchange64_inline ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ) -{ - return ExfInterlockedCompareExchange64(Destination, &ExChange, &Comperand); -} - -#if (_MSC_FULL_VER >= 140031008) - -LONGLONG -__cdecl -_InterlockedCompareExchange64 ( - __inout __drv_interlocked LONGLONG volatile *Destination, - __in LONGLONG ExChange, - __in LONGLONG Comperand - ); - -#pragma intrinsic(_InterlockedCompareExchange64) -#define InterlockedCompareExchange64 _InterlockedCompareExchange64 - -#else - -#define InterlockedCompareExchange64 InterlockedCompareExchange64_inline - -#endif // _MSC_FULL_VER > 140031008 - -#endif // INTERLOCKED_INTRINSICS || _CROSS_PLATFORM_ - -#define InterlockedExchangePointer(Target, Value) \ - (PVOID)InterlockedExchange((PLONG)Target, (LONG)Value) - -#endif // MIDL_PASS - -#define InterlockedIncrementAcquire InterlockedIncrement -#define InterlockedIncrementRelease InterlockedIncrement -#define InterlockedDecrementAcquire InterlockedDecrement -#define InterlockedDecrementRelease InterlockedDecrement -#define InterlockedExchangeAcquire64 InterlockedExchange64 -#define InterlockedCompareExchangeAcquire InterlockedCompareExchange -#define InterlockedCompareExchangeRelease InterlockedCompareExchange -#define InterlockedCompareExchangeAcquire64 InterlockedCompareExchange64 -#define InterlockedCompareExchangeRelease64 InterlockedCompareExchange64 -#define InterlockedCompareExchangePointerAcquire InterlockedCompareExchangePointer -#define InterlockedCompareExchangePointerRelease InterlockedCompareExchangePointer - -#define InterlockedExchangeAddSizeT(a, b) InterlockedExchangeAdd((LONG *)a, b) -#define InterlockedIncrementSizeT(a) InterlockedIncrement((LONG *)a) -#define InterlockedDecrementSizeT(a) InterlockedDecrement((LONG *)a) - - -#if !defined(MIDL_PASS) && defined(_M_IX86) - -// -// i386 function definitions -// - - -// -// Get current IRQL. -// -// On x86 this function resides in the HAL -// - -__drv_maxIRQL(HIGH_LEVEL) -__drv_savesIRQL -NTHALAPI -KIRQL -NTAPI -KeGetCurrentIrql( - VOID - ); - -#endif // !defined(MIDL_PASS) && defined(_M_IX86) - - -//++ -// -// VOID -// KeMemoryBarrier ( -// VOID -// ) -// -// VOID -// KeMemoryBarrierWithoutFence ( -// VOID -// ) -// -// -// Routine Description: -// -// These functions order memory accesses as seen by other processors. -// -// Arguments: -// -// None. -// -// Return Value: -// -// None. -// -//-- - -#ifdef __cplusplus -extern "C" { -#endif - -// -// Define function to flush a cache line. -// - -#define CacheLineFlush(Address) _mm_clflush(Address) - -VOID -_mm_clflush ( - VOID const *Address - ); - -#pragma intrinsic(_mm_clflush) - -VOID -_ReadWriteBarrier( - VOID - ); - -#ifdef __cplusplus -} -#endif - -#pragma intrinsic(_ReadWriteBarrier) - -#pragma warning( push ) -#pragma warning( disable : 4793 ) - -FORCEINLINE -VOID -KeMemoryBarrier ( - VOID - ) -{ - LONG Barrier; - __asm { - xchg Barrier, eax - } -} - -#pragma warning( pop ) - -#define KeMemoryBarrierWithoutFence() _ReadWriteBarrier() - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(<0;==0) -__drv_when(return==0, __drv_floatSaved) -NTKERNELAPI -NTSTATUS -NTAPI -KeSaveFloatingPointState ( - __out __deref __drv_neverHold(FloatState) - __drv_when(return==0, __deref __drv_acquiresResource(FloatState)) - PKFLOATING_SAVE FloatSave - ); - -__drv_valueIs(==0) -__drv_floatRestored -NTKERNELAPI -NTSTATUS -NTAPI -KeRestoreFloatingPointState ( - __in __deref __drv_releasesExclusiveResource(FloatState) - PKFLOATING_SAVE FloatSave - ); - - -#endif // defined(_X86_) - - - -#if defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - -// -// Define intrinsic function to do in's and out's. -// - -#ifdef __cplusplus -extern "C" { -#endif - -UCHAR -__inbyte ( - __in USHORT Port - ); - -USHORT -__inword ( - __in USHORT Port - ); - -ULONG -__indword ( - __in USHORT Port - ); - -VOID -__outbyte ( - __in USHORT Port, - __in UCHAR Data - ); - -VOID -__outword ( - __in USHORT Port, - __in USHORT Data - ); - -VOID -__outdword ( - __in USHORT Port, - __in ULONG Data - ); - -VOID -__inbytestring ( - __in USHORT Port, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -__inwordstring ( - __in USHORT Port, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -__indwordstring ( - __in USHORT Port, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ); - -VOID -__outbytestring ( - __in USHORT Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ); - -VOID -__outwordstring ( - __in USHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ); - -VOID -__outdwordstring ( - __in USHORT Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ); - -#pragma intrinsic(__inbyte) -#pragma intrinsic(__inword) -#pragma intrinsic(__indword) -#pragma intrinsic(__outbyte) -#pragma intrinsic(__outword) -#pragma intrinsic(__outdword) -#pragma intrinsic(__inbytestring) -#pragma intrinsic(__inwordstring) -#pragma intrinsic(__indwordstring) -#pragma intrinsic(__outbytestring) -#pragma intrinsic(__outwordstring) -#pragma intrinsic(__outdwordstring) - -#ifdef __cplusplus -} -#endif - -#endif // defined(_M_AMD64) && !defined(RC_INVOKED) && !defined(MIDL_PASS) - - -#if defined(_AMD64_) // ntddk nthal irqls -// -// Types to use to contain PFNs and their counts. -// - -typedef ULONG PFN_COUNT; -typedef LONG64 SPFN_NUMBER, *PSPFN_NUMBER; -typedef ULONG64 PFN_NUMBER, *PPFN_NUMBER; - -// -// Define maximum size of flush multiple TB request. -// - -#define FLUSH_MULTIPLE_MAXIMUM 19 - -// -// Indicate that the AMD64 compiler supports the allocate pragmas. -// - -#define ALLOC_PRAGMA 1 -#define ALLOC_DATA_PRAGMA 1 - -// -// Define functions to read and write CR8. -// -// CR8 is the APIC TPR register. -// - -#ifdef __cplusplus -extern "C" { -#endif - -#define ReadCR8() __readcr8() - -__drv_maxIRQL(HIGH_LEVEL) -__drv_savesIRQL -ULONG64 -__readcr8 ( - VOID - ); - -#define WriteCR8(Data) __writecr8(Data) - -__drv_maxIRQL(HIGH_LEVEL) -__drv_setsIRQL(Data) -VOID -__writecr8 ( - __in ULONG64 Data - ); - -#pragma intrinsic(__readcr8) -#pragma intrinsic(__writecr8) - -#ifdef __cplusplus -} -#endif - - - - -#if defined(_AMD64_) && !defined(DSF_DRIVER) - -// -// I/O space read and write macros. -// -// The READ/WRITE_REGISTER_* calls manipulate I/O registers in MEMORY space. -// -// The READ/WRITE_PORT_* calls manipulate I/O registers in PORT space. -// - -#ifdef __cplusplus -extern "C" { -#endif - -__forceinline -UCHAR -READ_REGISTER_UCHAR ( - __in __drv_nonConstant volatile UCHAR *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -USHORT -READ_REGISTER_USHORT ( - __in __drv_nonConstant volatile USHORT *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -ULONG -READ_REGISTER_ULONG ( - __in __drv_nonConstant volatile ULONG *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -ULONG64 -READ_REGISTER_ULONG64 ( - __in __drv_nonConstant volatile ULONG64 *Register - ) -{ - _ReadWriteBarrier(); - return *Register; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Register, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsb(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Register, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsw(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Register, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsd(Buffer, Register, Count); - return; -} - -__forceinline -VOID -READ_REGISTER_BUFFER_ULONG64 ( - __in __drv_nonConstant PULONG64 Register, - __out_ecount_full(Count) PULONG64 Buffer, - __in ULONG Count - ) -{ - _ReadWriteBarrier(); - __movsq(Buffer, Register, Count); - return; -} - -__forceinline -VOID -WRITE_REGISTER_UCHAR ( - __in __drv_nonConstant volatile UCHAR *Register, - __in UCHAR Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_USHORT ( - __in __drv_nonConstant volatile USHORT *Register, - __in USHORT Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_ULONG ( - __in __drv_nonConstant volatile ULONG *Register, - __in ULONG Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_ULONG64 ( - __in __drv_nonConstant volatile ULONG64 *Register, - __in ULONG64 Value - ) -{ - - *Register = Value; - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Register, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ) -{ - - __movsb(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Register, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ) -{ - - __movsw(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Register, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ) -{ - - __movsd(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -VOID -WRITE_REGISTER_BUFFER_ULONG64 ( - __in __drv_nonConstant PULONG64 Register, - __in_ecount(Count) PULONG64 Buffer, - __in ULONG Count - ) -{ - - __movsq(Register, Buffer, Count); - FastFence(); - return; -} - -__forceinline -UCHAR -READ_PORT_UCHAR ( - __in __drv_nonConstant PUCHAR Port - ) - -{ - UCHAR Result; - - _ReadWriteBarrier(); - Result = __inbyte((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - -__forceinline -USHORT -READ_PORT_USHORT ( - __in __drv_nonConstant PUSHORT Port - ) - -{ - USHORT Result; - - _ReadWriteBarrier(); - Result = __inword((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - -__forceinline -ULONG -READ_PORT_ULONG ( - __in __drv_nonConstant PULONG Port - ) - -{ - ULONG Result; - - _ReadWriteBarrier(); - Result = __indword((USHORT)((ULONG_PTR)Port)); - _ReadWriteBarrier(); - return Result; -} - - -__forceinline -VOID -READ_PORT_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __out_ecount_full(Count) PUCHAR Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __inbytestring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -READ_PORT_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __out_ecount_full(Count) PUSHORT Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __inwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -READ_PORT_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Port, - __out_ecount_full(Count) PULONG Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __indwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __in UCHAR Value - ) - -{ - _ReadWriteBarrier(); - __outbyte((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __in USHORT Value - ) - -{ - _ReadWriteBarrier(); - __outword((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_ULONG ( - __in __drv_nonConstant PULONG Port, - __in ULONG Value - ) - -{ - _ReadWriteBarrier(); - __outdword((USHORT)((ULONG_PTR)Port), Value); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_UCHAR ( - __in __drv_nonConstant PUCHAR Port, - __in_ecount(Count) PUCHAR Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outbytestring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_USHORT ( - __in __drv_nonConstant PUSHORT Port, - __in_ecount(Count) PUSHORT Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -__forceinline -VOID -WRITE_PORT_BUFFER_ULONG ( - __in __drv_nonConstant PULONG Port, - __in_ecount(Count) PULONG Buffer, - __in ULONG Count - ) - -{ - _ReadWriteBarrier(); - __outdwordstring((USHORT)((ULONG_PTR)Port), Buffer, Count); - _ReadWriteBarrier(); - return; -} - -#ifdef __cplusplus -} -#endif - -#elif defined(_AMD64_) && defined(DSF_DRIVER) -#include -#endif - - - - -// -// Get data cache fill size. -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(KeGetDcacheFillSize) // Use GetDmaAlignment -#endif - -#define KeGetDcacheFillSize() 1L - - -#define KeFlushIoBuffers(Mdl, ReadOperation, DmaOperation) - - -#define ExAcquireSpinLock(Lock, OldIrql) KeAcquireSpinLock((Lock), (OldIrql)) -#define ExReleaseSpinLock(Lock, OldIrql) KeReleaseSpinLock((Lock), (OldIrql)) -#define ExAcquireSpinLockAtDpcLevel(Lock) KeAcquireSpinLockAtDpcLevel(Lock) -#define ExReleaseSpinLockFromDpcLevel(Lock) KeReleaseSpinLockFromDpcLevel(Lock) - - -#define KI_USER_SHARED_DATA 0xFFFFF78000000000UI64 - -#define SharedUserData ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA) - -#define SharedInterruptTime (KI_USER_SHARED_DATA + 0x8) -#define SharedSystemTime (KI_USER_SHARED_DATA + 0x14) -#define SharedTickCount (KI_USER_SHARED_DATA + 0x320) - -#define KeQueryInterruptTime() *((volatile ULONG64 *)(SharedInterruptTime)) - -#define KeQuerySystemTime(CurrentCount) \ - *((PULONG64)(CurrentCount)) = *((volatile ULONG64 *)(SharedSystemTime)) - -#define KeQueryTickCount(CurrentCount) \ - *((PULONG64)(CurrentCount)) = *((volatile ULONG64 *)(SharedTickCount)) - -// -// Dummy nonvolatile floating state structure. -// - -typedef struct _KFLOATING_SAVE { - ULONG Dummy; -} KFLOATING_SAVE, *PKFLOATING_SAVE; - -// -// AMD64 Specific portions of mm component. -// -// Define the page size for the AMD64 as 4096 (0x1000). -// - -#define PAGE_SIZE 0x1000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 12L - - -#define MmGetProcedureAddress(Address) (Address) -#define MmLockPagableCodeSection(Address) MmLockPagableDataSection(Address) - - -// -// Define macro to perform a load fence after a lock acquisition. -// - -#define LFENCE_ACQUIRE() LoadFence() - -#if !defined(_CROSS_PLATFORM_) - -FORCEINLINE -VOID -KeMemoryBarrier ( - VOID - ) - -/*++ - -Routine Description: - - This function orders memory accesses as seen by other processors. - -Arguments: - - None. - -Return Value: - - None. - ---*/ - -{ - - FastFence(); - LFENCE_ACQUIRE(); - return; -} - -//++ -// -// VOID -// KeMemoryBarrierWithoutFence ( -// VOID -// ) -// -// -// Routine Description: -// -// This function instructs the compiler not to reorder loads and stores -// across the function invocation. -// -// Arguments: -// -// None. -// -// Return Value: -// -// None. -// -//-- - -#define KeMemoryBarrierWithoutFence() _ReadWriteBarrier() - -#else - -#define KeMemoryBarrier() -#define KeMemoryBarrierWithoutFence() - -#endif - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(<0;==0) -__drv_when(return==0, __drv_floatSaved) -__forceinline -NTSTATUS -KeSaveFloatingPointState ( - __out __deref __drv_neverHold(FloatState) - __drv_when(return==0, __deref __drv_acquiresResource(FloatState)) - PVOID FloatingState - ) - -#pragma warning (suppress:28104 28161) // PFD can't recognize the implementation -{ - - UNREFERENCED_PARAMETER(FloatingState); - - return STATUS_SUCCESS; -} - -__drv_valueIs(==0) -__drv_floatRestored -__forceinline -NTSTATUS -KeRestoreFloatingPointState ( - __in __deref __drv_releasesExclusiveResource(FloatState) PVOID FloatingState - ) - -#pragma warning (suppress:28103 28162) // PFD can't recognize the implementation -{ - - UNREFERENCED_PARAMETER(FloatingState); - - return STATUS_SUCCESS; -} - - -#endif // defined(_AMD64_) - - -// -// Platform specific kernel fucntions to raise and lower IRQL. -// - - -#if defined(_AMD64_) && !defined(MIDL_PASS) - - -__drv_maxIRQL(HIGH_LEVEL) -__drv_savesIRQL -__forceinline -KIRQL -KeGetCurrentIrql ( - VOID - ) - -/*++ - -Routine Description: - - This function return the current IRQL. - -Arguments: - - None. - -Return Value: - - The current IRQL is returned as the function value. - ---*/ - -{ - - return (KIRQL)ReadCR8(); -} - -__drv_maxIRQL(HIGH_LEVEL) -__forceinline -VOID -KeLowerIrql ( - __in __drv_nonConstant __drv_restoresIRQL KIRQL NewIrql - ) - -/*++ - -Routine Description: - - This function lowers the IRQL to the specified value. - -Arguments: - - NewIrql - Supplies the new IRQL value. - -Return Value: - - None. - ---*/ - -{ - - NT_ASSERT(KeGetCurrentIrql() >= NewIrql); - - WriteCR8(NewIrql); - return; -} - -#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a) - -__drv_maxIRQL(HIGH_LEVEL) -__drv_raisesIRQL(NewIrql) -__drv_savesIRQL -__forceinline -KIRQL -KfRaiseIrql ( - __in KIRQL NewIrql - ) - -/*++ - -Routine Description: - - This function raises the current IRQL to the specified value and returns - the previous IRQL. - -Arguments: - - NewIrql (cl) - Supplies the new IRQL value. - -Return Value: - - The previous IRQL is retured as the function value. - ---*/ - -{ - - KIRQL OldIrql; - - OldIrql = KeGetCurrentIrql(); - - NT_ASSERT(OldIrql <= NewIrql); - - WriteCR8(NewIrql); - return OldIrql; -} - -#endif // defined(_AMD64_) && !defined(MIDL_PASS) - - -#if defined(_IA64_) - -// -// Types to use to contain PFNs and their counts. -// - -typedef ULONG PFN_COUNT; - -typedef LONG_PTR SPFN_NUMBER, *PSPFN_NUMBER; -typedef ULONG_PTR PFN_NUMBER, *PPFN_NUMBER; - -// -// Indicate that the IA64 compiler supports the pragma textout construct. -// - -#define ALLOC_PRAGMA 1 - -// -// Define intrinsic calls and their prototypes -// - -#include "ia64reg.h" - -#ifdef __cplusplus -extern "C" { -#endif - -unsigned __int64 __getReg (int); -void __setReg (int, unsigned __int64); -void __isrlz (void); -void __dsrlz (void); -void __fwb (void); -void __mf (void); -void __mfa (void); -void __synci (void); -__int64 __thash (__int64); -__int64 __ttag (__int64); -void __ptcl (__int64, __int64); -void __ptcg (__int64, __int64); -void __ptcga (__int64, __int64); -void __ptri (__int64, __int64); -void __ptrd (__int64, __int64); -void __invalat (void); -void __break (int); -void __fc (__int64); -void __fci (__int64); -void __sum (int); -void __rsm (int); -void _ReleaseSpinLock( unsigned __int64 *); -void __yield(); -void __lfetch(int, volatile void const *); -void __lfetchfault(int, volatile void const *); -void __lfetch_excl(int, volatile void const *); -void __lfetchfault_excl(int, volatile void const *); -#ifdef _M_IA64 -#pragma intrinsic (__getReg) -#pragma intrinsic (__setReg) -#pragma intrinsic (__isrlz) -#pragma intrinsic (__dsrlz) -#pragma intrinsic (__fwb) -#pragma intrinsic (__mf) -#pragma intrinsic (__mfa) -#pragma intrinsic (__synci) -#pragma intrinsic (__thash) -#pragma intrinsic (__ttag) -#pragma intrinsic (__ptcl) -#pragma intrinsic (__ptcg) -#pragma intrinsic (__ptcga) -#pragma intrinsic (__ptri) -#pragma intrinsic (__ptrd) -#pragma intrinsic (__invalat) -#pragma intrinsic (__break) -#pragma intrinsic (__fc) -#pragma intrinsic (__fci) -#pragma intrinsic (__sum) -#pragma intrinsic (__rsm) -#pragma intrinsic (_ReleaseSpinLock) -#pragma intrinsic (__yield) -#pragma intrinsic (__lfetch) -#pragma intrinsic (__lfetchfault) -#pragma intrinsic (__lfetchfault_excl) -#pragma intrinsic (__lfetch_excl) -#endif // _M_IA64 - -#ifdef __cplusplus -} -#endif - - - -// -// Define length of interrupt vector table. -// - -#define MAXIMUM_VECTOR 256 - -// -// Begin of a block of definitions that must be synchronized with kxia64.h. - -#define KI_USER_SHARED_DATA ((ULONG_PTR)(KADDRESS_BASE + 0xFFFE0000)) -#define SharedUserData ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA) - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(<0;==0) -__drv_when(return==0, __drv_floatSaved) -__forceinline -NTSTATUS -KeSaveFloatingPointState ( - __out __deref __drv_neverHold(FloatState) - __drv_when(return==0, __deref __drv_acquiresResource(FloatState)) - PVOID FloatingState - ) -#pragma warning (suppress:28104 28161) // PFD can't recognize the implementation -{ - - UNREFERENCED_PARAMETER(FloatingState); - - return STATUS_SUCCESS; -} - -__drv_valueIs(==0) -__drv_floatRestored -__forceinline -NTSTATUS -KeRestoreFloatingPointState ( - __in __deref __drv_releasesExclusiveResource(FloatState) PVOID FloatingState - ) - -#pragma warning (suppress:28103 28162) // PFD can't recognize the implementation -{ - - UNREFERENCED_PARAMETER(FloatingState); - - return STATUS_SUCCESS; -} - - - -// -// -// VOID -// KeMemoryBarrierWithoutFence ( -// VOID -// ) -// -// -// Routine Description: -// -// This function cases ordering of memory acceses generated by the compiler. -// -// -// Arguments: -// -// None. -// -// Return Value: -// -// None. -//-- - -#ifdef __cplusplus -extern "C" { -#endif - -VOID -_ReadWriteBarrier ( - VOID - ); - -#ifdef __cplusplus -} -#endif - -#pragma intrinsic(_ReadWriteBarrier) - -#define KeMemoryBarrierWithoutFence() _ReadWriteBarrier() - -//++ -// -// -// VOID -// KeMemoryBarrier ( -// VOID -// ) -// -// -// Routine Description: -// -// This function cases ordering of memory acceses as generated by the compiler and -// as seen by other processors. -// -// -// Arguments: -// -// None. -// -// Return Value: -// -// None. -//-- - -#define KE_MEMORY_BARRIER_REQUIRED - -#define KeMemoryBarrier() __mf() - -// -// Define the page size -// - -#define PAGE_SIZE 0x2000 - -// -// Define the number of trailing zeroes in a page aligned virtual address. -// This is used as the shift count when shifting virtual addresses to -// virtual page numbers. -// - -#define PAGE_SHIFT 13L - -// -// Cache and write buffer flush functions. -// - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeFlushIoBuffers ( - __in PMDL Mdl, - __in BOOLEAN ReadOperation, - __in BOOLEAN DmaOperation - ); - - -// -// Kernel breakin breakpoint -// - -VOID -KeBreakinBreakpoint ( - VOID - ); - - -#define ExAcquireSpinLock(Lock, OldIrql) KeAcquireSpinLock((Lock), (OldIrql)) -#define ExReleaseSpinLock(Lock, OldIrql) KeReleaseSpinLock((Lock), (OldIrql)) -#define ExAcquireSpinLockAtDpcLevel(Lock) KeAcquireSpinLockAtDpcLevel(Lock) -#define ExReleaseSpinLockFromDpcLevel(Lock) KeReleaseSpinLockFromDpcLevel(Lock) - - -#if defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) - -#define KeQueryTickCount(CurrentCount ) \ - *(PULONGLONG)(CurrentCount) = **((volatile ULONGLONG **)(&KeTickCount)); - -#else - -NTKERNELAPI -VOID -KeQueryTickCount ( - __out PLARGE_INTEGER CurrentCount - ); - -#endif // defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) - -// -// I/O space read and write macros. -// - -NTHALAPI -UCHAR -READ_PORT_UCHAR ( - __drv_nonConstant PUCHAR RegisterAddress - ); - -NTHALAPI -USHORT -READ_PORT_USHORT ( - __drv_nonConstant PUSHORT RegisterAddress - ); - -NTHALAPI -ULONG -READ_PORT_ULONG ( - __drv_nonConstant PULONG RegisterAddress - ); - -NTHALAPI -VOID -READ_PORT_BUFFER_UCHAR ( - __drv_nonConstant PUCHAR portAddress, - PUCHAR readBuffer, - ULONG readCount - ); - -NTHALAPI -VOID -READ_PORT_BUFFER_USHORT ( - __drv_nonConstant PUSHORT portAddress, - PUSHORT readBuffer, - ULONG readCount - ); - -NTHALAPI -VOID -READ_PORT_BUFFER_ULONG ( - __drv_nonConstant PULONG portAddress, - PULONG readBuffer, - ULONG readCount - ); - -NTHALAPI -VOID -WRITE_PORT_UCHAR ( - __drv_nonConstant PUCHAR portAddress, - UCHAR Data - ); - -NTHALAPI -VOID -WRITE_PORT_USHORT ( - __drv_nonConstant PUSHORT portAddress, - USHORT Data - ); - -NTHALAPI -VOID -WRITE_PORT_ULONG ( - __drv_nonConstant PULONG portAddress, - ULONG Data - ); - -NTHALAPI -VOID -WRITE_PORT_BUFFER_UCHAR ( - __drv_nonConstant PUCHAR portAddress, - PUCHAR writeBuffer, - ULONG writeCount - ); - -NTHALAPI -VOID -WRITE_PORT_BUFFER_USHORT ( - __drv_nonConstant PUSHORT portAddress, - PUSHORT writeBuffer, - ULONG writeCount - ); - -NTHALAPI -VOID -WRITE_PORT_BUFFER_ULONG ( - __drv_nonConstant PULONG portAddress, - PULONG writeBuffer, - ULONG writeCount - ); - - -#define READ_REGISTER_UCHAR(x) \ - (__mf(), *(volatile UCHAR * const)(x)) - -#define READ_REGISTER_USHORT(x) \ - (__mf(), *(volatile USHORT * const)(x)) - -#define READ_REGISTER_ULONG(x) \ - (__mf(), *(volatile ULONG * const)(x)) - -#define READ_REGISTER_ULONG64(x) \ - (__mf(), *(volatile ULONG64 * const)(x)) - -#define READ_REGISTER_BUFFER_UCHAR(x, y, z) { \ - PUCHAR registerBuffer = x; \ - PUCHAR readBuffer = y; \ - ULONG readCount; \ - __mf(); \ - for (readCount = z; readCount--; readBuffer++, registerBuffer++) { \ - *readBuffer = *(volatile UCHAR * const)(registerBuffer); \ - } \ -} - -#define READ_REGISTER_BUFFER_USHORT(x, y, z) { \ - PUSHORT registerBuffer = x; \ - PUSHORT readBuffer = y; \ - ULONG readCount; \ - __mf(); \ - for (readCount = z; readCount--; readBuffer++, registerBuffer++) { \ - *readBuffer = *(volatile USHORT * const)(registerBuffer); \ - } \ -} - -#define READ_REGISTER_BUFFER_ULONG(x, y, z) { \ - PULONG registerBuffer = x; \ - PULONG readBuffer = y; \ - ULONG readCount; \ - __mf(); \ - for (readCount = z; readCount--; readBuffer++, registerBuffer++) { \ - *readBuffer = *(volatile ULONG * const)(registerBuffer); \ - } \ -} - -#define READ_REGISTER_BUFFER_ULONG64(x, y, z) { \ - PULONG64 registerBuffer = x; \ - PULONG64 readBuffer = y; \ - ULONG readCount; \ - __mf(); \ - for (readCount = z; readCount--; readBuffer++, registerBuffer++) { \ - *readBuffer = *(volatile ULONG64 * const)(registerBuffer); \ - } \ -} - -#define WRITE_REGISTER_UCHAR(x, y) { \ - *(volatile UCHAR * const)(x) = y; \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_USHORT(x, y) { \ - *(volatile USHORT * const)(x) = y; \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_ULONG(x, y) { \ - *(volatile ULONG * const)(x) = y; \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_ULONG64(x, y) { \ - *(volatile ULONG64 * const)(x) = y; \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_BUFFER_UCHAR(x, y, z) { \ - PUCHAR registerBuffer = x; \ - PUCHAR writeBuffer = y; \ - ULONG writeCount; \ - for (writeCount = z; writeCount--; writeBuffer++, registerBuffer++) { \ - *(volatile UCHAR * const)(registerBuffer) = *writeBuffer; \ - } \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_BUFFER_USHORT(x, y, z) { \ - PUSHORT registerBuffer = x; \ - PUSHORT writeBuffer = y; \ - ULONG writeCount; \ - for (writeCount = z; writeCount--; writeBuffer++, registerBuffer++) { \ - *(volatile USHORT * const)(registerBuffer) = *writeBuffer; \ - } \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_BUFFER_ULONG(x, y, z) { \ - PULONG registerBuffer = x; \ - PULONG writeBuffer = y; \ - ULONG writeCount; \ - for (writeCount = z; writeCount--; writeBuffer++, registerBuffer++) { \ - *(volatile ULONG * const)(registerBuffer) = *writeBuffer; \ - } \ - KeFlushWriteBuffer(); \ -} - -#define WRITE_REGISTER_BUFFER_ULONG64(x, y, z) { \ - PULONG64 registerBuffer = x; \ - PULONG64 writeBuffer = y; \ - ULONG writeCount; \ - for (writeCount = z; writeCount--; writeBuffer++, registerBuffer++) { \ - *(volatile ULONG64 * const)(registerBuffer) = *writeBuffer; \ - } \ - KeFlushWriteBuffer(); \ -} - - -// -// Non-volatile floating point state -// - -typedef struct _KFLOATING_SAVE { - ULONG Reserved; -} KFLOATING_SAVE, *PKFLOATING_SAVE; - - -__drv_maxIRQL(HIGH_LEVEL) -__drv_savesIRQL -NTKERNELAPI -KIRQL -KeGetCurrentIrql( - VOID - ); - -__drv_maxIRQL(HIGH_LEVEL) -NTKERNELAPI -VOID -KeLowerIrql ( - __in __drv_nonConstant __drv_restoresIRQL KIRQL NewIrql - ); - -__drv_maxIRQL(HIGH_LEVEL) -__drv_raisesIRQL(NewIrql) -NTKERNELAPI -VOID -KeRaiseIrql ( - __in KIRQL NewIrql, - __out __deref __drv_savesIRQL PKIRQL OldIrql - ); - - -#define MmGetProcedureAddress(Address) (Address) -#define MmLockPagableCodeSection(PLabelAddress) \ - MmLockPagableDataSection((PVOID)(*((PULONGLONG)PLabelAddress))) - -#define VRN_MASK 0xE000000000000000UI64 // Virtual Region Number mask - -// -// The lowest address for system space. -// - -#define MM_LOWEST_SYSTEM_ADDRESS ((PVOID)((ULONG_PTR)(KADDRESS_BASE + 0xC0C00000))) -#endif // defined(_IA64_) - -// -// Event Specific Access Rights. -// - -#define EVENT_QUERY_STATE 0x0001 -#define EVENT_MODIFY_STATE 0x0002 -#define EVENT_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) - - -// -// Semaphore Specific Access Rights. -// - -#define SEMAPHORE_QUERY_STATE 0x0001 -#define SEMAPHORE_MODIFY_STATE 0x0002 - -#define SEMAPHORE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3) - - -typedef enum _LOGICAL_PROCESSOR_RELATIONSHIP { - RelationProcessorCore, - RelationNumaNode, - RelationCache, - RelationProcessorPackage, - RelationGroup, - RelationAll = 0xffff -} LOGICAL_PROCESSOR_RELATIONSHIP; - -#define LTP_PC_SMT 0x1 - -typedef enum _PROCESSOR_CACHE_TYPE { - CacheUnified, - CacheInstruction, - CacheData, - CacheTrace -} PROCESSOR_CACHE_TYPE; - -#define CACHE_FULLY_ASSOCIATIVE 0xFF - -typedef struct _CACHE_DESCRIPTOR { - UCHAR Level; - UCHAR Associativity; - USHORT LineSize; - ULONG Size; - PROCESSOR_CACHE_TYPE Type; -} CACHE_DESCRIPTOR, *PCACHE_DESCRIPTOR; - -typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION { - ULONG_PTR ProcessorMask; - LOGICAL_PROCESSOR_RELATIONSHIP Relationship; - union { - struct { - UCHAR Flags; - } ProcessorCore; - struct { - ULONG NodeNumber; - } NumaNode; - CACHE_DESCRIPTOR Cache; - ULONGLONG Reserved[2]; - } DUMMYUNIONNAME; -} SYSTEM_LOGICAL_PROCESSOR_INFORMATION, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION; - -typedef struct _PROCESSOR_RELATIONSHIP { - UCHAR Flags; - UCHAR Reserved[21]; - USHORT GroupCount; - __field_ecount(GroupCount) GROUP_AFFINITY GroupMask[ANYSIZE_ARRAY]; -} PROCESSOR_RELATIONSHIP, *PPROCESSOR_RELATIONSHIP; - -typedef struct _NUMA_NODE_RELATIONSHIP { - ULONG NodeNumber; - UCHAR Reserved[20]; - GROUP_AFFINITY GroupMask; -} NUMA_NODE_RELATIONSHIP, *PNUMA_NODE_RELATIONSHIP; - -typedef struct _CACHE_RELATIONSHIP { - UCHAR Level; - UCHAR Associativity; - USHORT LineSize; - ULONG CacheSize; - PROCESSOR_CACHE_TYPE Type; - UCHAR Reserved[20]; - GROUP_AFFINITY GroupMask; -} CACHE_RELATIONSHIP, *PCACHE_RELATIONSHIP; - -typedef struct _PROCESSOR_GROUP_INFO { - UCHAR MaximumProcessorCount; - UCHAR ActiveProcessorCount; - UCHAR Reserved[38]; - KAFFINITY ActiveProcessorMask; -} PROCESSOR_GROUP_INFO, *PPROCESSOR_GROUP_INFO; - -typedef struct _GROUP_RELATIONSHIP { - USHORT MaximumGroupCount; - USHORT ActiveGroupCount; - UCHAR Reserved[20]; - PROCESSOR_GROUP_INFO GroupInfo[ANYSIZE_ARRAY]; -} GROUP_RELATIONSHIP, *PGROUP_RELATIONSHIP; - -__struct_bcount(Size) struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX { - LOGICAL_PROCESSOR_RELATIONSHIP Relationship; - ULONG Size; - union { - PROCESSOR_RELATIONSHIP Processor; - NUMA_NODE_RELATIONSHIP NumaNode; - CACHE_RELATIONSHIP Cache; - GROUP_RELATIONSHIP Group; - } DUMMYUNIONNAME; -}; - -typedef struct _SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX, *PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX; - - -// -// Defined processor features -// - -#define PF_FLOATING_POINT_PRECISION_ERRATA 0 -#define PF_FLOATING_POINT_EMULATED 1 -#define PF_COMPARE_EXCHANGE_DOUBLE 2 -#define PF_MMX_INSTRUCTIONS_AVAILABLE 3 -#define PF_PPC_MOVEMEM_64BIT_OK 4 -#define PF_ALPHA_BYTE_INSTRUCTIONS 5 -#define PF_XMMI_INSTRUCTIONS_AVAILABLE 6 -#define PF_3DNOW_INSTRUCTIONS_AVAILABLE 7 -#define PF_RDTSC_INSTRUCTION_AVAILABLE 8 -#define PF_PAE_ENABLED 9 -#define PF_XMMI64_INSTRUCTIONS_AVAILABLE 10 -#define PF_SSE_DAZ_MODE_AVAILABLE 11 -#define PF_NX_ENABLED 12 -#define PF_SSE3_INSTRUCTIONS_AVAILABLE 13 -#define PF_COMPARE_EXCHANGE128 14 -#define PF_COMPARE64_EXCHANGE128 15 -#define PF_CHANNELS_ENABLED 16 -#define PF_XSAVE_ENABLED 17 - -typedef enum _ALTERNATIVE_ARCHITECTURE_TYPE { - StandardDesign, // None == 0 == standard design - NEC98x86, // NEC PC98xx series on X86 - EndAlternatives // past end of known alternatives -} ALTERNATIVE_ARCHITECTURE_TYPE; - -// correctly define these run-time definitions for non X86 machines - -#ifndef _X86_ - -#ifndef IsNEC_98 -#define IsNEC_98 (FALSE) -#endif - -#ifndef IsNotNEC_98 -#define IsNotNEC_98 (TRUE) -#endif - -#ifndef SetNEC_98 -#define SetNEC_98 -#endif - -#ifndef SetNotNEC_98 -#define SetNotNEC_98 -#endif - -#endif // _X86_ - -#define PROCESSOR_FEATURE_MAX 64 - -// -// Exception flag definitions. -// - - -#define EXCEPTION_NONCONTINUABLE 0x1 // Noncontinuable exception - - -// -// Define maximum number of exception parameters. -// - - -#define EXCEPTION_MAXIMUM_PARAMETERS 15 // maximum number of exception parameters - -// -// Exception record definition. -// - -typedef struct _EXCEPTION_RECORD { - NTSTATUS ExceptionCode; - ULONG ExceptionFlags; - struct _EXCEPTION_RECORD *ExceptionRecord; - PVOID ExceptionAddress; - ULONG NumberParameters; - ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; - } EXCEPTION_RECORD; - -typedef EXCEPTION_RECORD *PEXCEPTION_RECORD; - -typedef struct _EXCEPTION_RECORD32 { - NTSTATUS ExceptionCode; - ULONG ExceptionFlags; - ULONG ExceptionRecord; - ULONG ExceptionAddress; - ULONG NumberParameters; - ULONG ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD32, *PEXCEPTION_RECORD32; - -typedef struct _EXCEPTION_RECORD64 { - NTSTATUS ExceptionCode; - ULONG ExceptionFlags; - ULONG64 ExceptionRecord; - ULONG64 ExceptionAddress; - ULONG NumberParameters; - ULONG __unusedAlignment; - ULONG64 ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]; -} EXCEPTION_RECORD64, *PEXCEPTION_RECORD64; - -// -// Typedef for pointer returned by exception_info() -// - -typedef struct _EXCEPTION_POINTERS { - PEXCEPTION_RECORD ExceptionRecord; - PCONTEXT ContextRecord; -} EXCEPTION_POINTERS, *PEXCEPTION_POINTERS; - - -#define THREAD_WAIT_OBJECTS 3 // Builtin usable wait blocks - - - -// -// Several routines have an architecture specific implementation. Generate -// an error if a supported target is not defined. -// - -#if !(defined(_X86_) || defined(_AMD64_) || defined(_IA64_)) - -#error "No target architecture defined" - -#endif - -#if (NTDDI_VERSION < NTDDI_WIN7) || defined(_X86_) || !defined(NT_PROCESSOR_GROUPS) - -#define SINGLE_GROUP_LEGACY_API 1 - -#endif - - - - -// -// Interrupt modes. -// - -typedef enum _KINTERRUPT_MODE { - LevelSensitive, - Latched -} KINTERRUPT_MODE; - -typedef enum _KINTERRUPT_POLARITY { - InterruptPolarityUnknown, - InterruptActiveHigh, - InterruptActiveLow -} KINTERRUPT_POLARITY, *PKINTERRUPT_POLARITY; - - -// -// Wait reasons -// - -typedef enum _KWAIT_REASON { - Executive, - FreePage, - PageIn, - PoolAllocation, - DelayExecution, - Suspended, - UserRequest, - WrExecutive, - WrFreePage, - WrPageIn, - WrPoolAllocation, - WrDelayExecution, - WrSuspended, - WrUserRequest, - WrEventPair, - WrQueue, - WrLpcReceive, - WrLpcReply, - WrVirtualMemory, - WrPageOut, - WrRendezvous, - WrKeyedEvent, - WrTerminated, - WrProcessInSwap, - WrCpuRateControl, - WrCalloutStack, - WrKernel, - WrResource, - WrPushLock, - WrMutex, - WrQuantumEnd, - WrDispatchInt, - WrPreempted, - WrYieldExecution, - WrFastMutex, - WrGuardedMutex, - WrRundown, - MaximumWaitReason -} KWAIT_REASON; - - -typedef struct _KWAIT_BLOCK { - LIST_ENTRY WaitListEntry; - struct _KTHREAD *Thread; - PVOID Object; - struct _KWAIT_BLOCK *NextWaitBlock; - USHORT WaitKey; - UCHAR WaitType; - volatile UCHAR BlockState; - -#if defined(_WIN64) - - LONG SpareLong; - -#endif - -} KWAIT_BLOCK, *PKWAIT_BLOCK, *PRKWAIT_BLOCK; - -// -// Thread start function -// - -typedef -__drv_sameIRQL -__drv_functionClass(KSTART_ROUTINE) -VOID -KSTART_ROUTINE ( - __in PVOID StartContext - ); -typedef KSTART_ROUTINE *PKSTART_ROUTINE; - -// -// Kernel object structure definitions -// - -// -// Device Queue object and entry -// - -#define ASSERT_DEVICE_QUEUE(E) NT_ASSERT((E)->Type == DeviceQueueObject) - -typedef struct _KDEVICE_QUEUE { - CSHORT Type; - CSHORT Size; - LIST_ENTRY DeviceListHead; - KSPIN_LOCK Lock; - -#if defined(_AMD64_) - - union { - BOOLEAN Busy; - struct { - LONG64 Reserved : 8; - LONG64 Hint : 56; - }; - }; - -#else - - BOOLEAN Busy; - -#endif - -} KDEVICE_QUEUE, *PKDEVICE_QUEUE, *PRKDEVICE_QUEUE; - -typedef struct _KDEVICE_QUEUE_ENTRY { - LIST_ENTRY DeviceListEntry; - ULONG SortKey; - BOOLEAN Inserted; -} KDEVICE_QUEUE_ENTRY, *PKDEVICE_QUEUE_ENTRY, *PRKDEVICE_QUEUE_ENTRY; - -// -// Define the interrupt service function type and the empty struct -// type. -// - -__drv_functionClass(KSERVICE_ROUTINE) -__drv_requiresIRQL(HIGH_LEVEL) -__drv_sameIRQL -typedef -BOOLEAN -KSERVICE_ROUTINE ( - __in struct _KINTERRUPT *Interrupt, - __in PVOID ServiceContext - ); - -typedef KSERVICE_ROUTINE *PKSERVICE_ROUTINE; - -__drv_functionClass(KMESSAGE_SERVICE_ROUTINE) -__drv_sameIRQL -typedef -BOOLEAN -KMESSAGE_SERVICE_ROUTINE ( - __in struct _KINTERRUPT *Interrupt, - __in PVOID ServiceContext, - __in ULONG MessageID - ); - -typedef KMESSAGE_SERVICE_ROUTINE *PKMESSAGE_SERVICE_ROUTINE; - -// -// Mutant object -// - -#define ASSERT_MUTANT(E) NT_ASSERT(KOBJECT_TYPE(E) == MutantObject) - -typedef struct _KMUTANT { - DISPATCHER_HEADER Header; - LIST_ENTRY MutantListEntry; - struct _KTHREAD *OwnerThread; - BOOLEAN Abandoned; - UCHAR ApcDisable; -} KMUTANT, *PKMUTANT, *PRKMUTANT, KMUTEX, *PKMUTEX, *PRKMUTEX; - -// -// -// Semaphore object -// -// N.B. The limit field must be the last member of this structure. -// - -#define ASSERT_SEMAPHORE(E) NT_ASSERT(KOBJECT_TYPE(E) == SemaphoreObject) - -typedef struct _KSEMAPHORE { - DISPATCHER_HEADER Header; - LONG Limit; -} KSEMAPHORE, *PKSEMAPHORE, *PRKSEMAPHORE; - -#define KSEMAPHORE_ACTUAL_LENGTH \ - (FIELD_OFFSET(KSEMAPHORE, Limit) + sizeof(LONG)) - -// -// DPC object -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeInitializeDpc ( - __out __drv_aliasesMem PRKDPC Dpc, - __in PKDEFERRED_ROUTINE DeferredRoutine, - __in_opt __drv_aliasesMem PVOID DeferredContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -VOID -KeInitializeThreadedDpc ( - __out PRKDPC Dpc, - __in PKDEFERRED_ROUTINE DeferredRoutine, - __in_opt PVOID DeferredContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -BOOLEAN -KeInsertQueueDpc ( - __inout PRKDPC Dpc, - __in_opt PVOID SystemArgument1, - __in_opt PVOID SystemArgument2 - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(HIGH_LEVEL) -NTKERNELAPI -BOOLEAN -KeRemoveQueueDpc ( - __inout PRKDPC Dpc - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeSetImportanceDpc ( - __inout PRKDPC Dpc, - __in KDPC_IMPORTANCE Importance - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -VOID -KeSetTargetProcessorDpc ( - __inout PRKDPC Dpc, - __in CCHAR Number - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WINXPSP2) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeFlushQueuedDpcs ( - VOID - ); -#endif - -// -// Device queue object -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeInitializeDeviceQueue ( - __out PKDEVICE_QUEUE DeviceQueue - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeInsertDeviceQueue ( - __inout PKDEVICE_QUEUE DeviceQueue, - __inout PKDEVICE_QUEUE_ENTRY DeviceQueueEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeInsertByKeyDeviceQueue ( - __inout PKDEVICE_QUEUE DeviceQueue, - __inout PKDEVICE_QUEUE_ENTRY DeviceQueueEntry, - __in ULONG SortKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PKDEVICE_QUEUE_ENTRY -KeRemoveDeviceQueue ( - __inout PKDEVICE_QUEUE DeviceQueue - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PKDEVICE_QUEUE_ENTRY -KeRemoveByKeyDeviceQueue ( - __inout PKDEVICE_QUEUE DeviceQueue, - __in ULONG SortKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PKDEVICE_QUEUE_ENTRY -KeRemoveByKeyDeviceQueueIfBusy ( - __inout PKDEVICE_QUEUE DeviceQueue, - __in ULONG SortKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeRemoveEntryDeviceQueue ( - __inout PKDEVICE_QUEUE DeviceQueue, - __inout PKDEVICE_QUEUE_ENTRY DeviceQueueEntry - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(HIGH_LEVEL) -NTKERNELAPI -BOOLEAN -KeSynchronizeExecution ( - __inout PKINTERRUPT Interrupt, - __in PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, - __in_opt __drv_aliasesMem PVOID SynchronizeContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(HIGH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(HIGH_LEVEL) -NTKERNELAPI -KIRQL -KeAcquireInterruptSpinLock ( - __inout __deref __drv_acquiresExclusiveResource(InterruptSpinLock) - PKINTERRUPT Interrupt - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_requiresIRQL(HIGH_LEVEL) -NTKERNELAPI -VOID -KeReleaseInterruptSpinLock ( - __inout __deref __drv_releasesExclusiveResource(InterruptSpinLock) - PKINTERRUPT Interrupt, - __in __drv_restoresIRQL KIRQL OldIrql - ); -#endif - -// -// Kernel dispatcher object functions -// -// Event Object -// - -NTKERNELAPI -VOID -KeInitializeEvent ( - __out PRKEVENT Event, - __in EVENT_TYPE Type, - __in BOOLEAN State - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeClearEvent ( - __inout PRKEVENT Event - ); - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeReadStateEvent ( - __in PRKEVENT Event - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeResetEvent ( - __inout PRKEVENT Event - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(Wait==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(Wait==1, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Wait==1, __drv_reportError("Caution: 'Wait' argument does not provide" - " any synchronization guarantees, only a hint" - " to the system that the thread will immediately" - " issue a wait operation")) -NTKERNELAPI -LONG -KeSetEvent ( - __inout PRKEVENT Event, - __in KPRIORITY Increment, - __in __drv_constant BOOLEAN Wait - ); -#endif - -// -// Mutex object -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeInitializeMutex ( - __out PRKMUTEX Mutex, - __in ULONG Level - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeReadStateMutex ( - __in PRKMUTEX Mutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(Wait==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(Wait==1, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Wait==1, __drv_reportError("Caution: 'Wait' argument does not provide" - " any synchronization guarantees, only a hint" - " to the system that the thread will immediately" - " issue a wait operation")) -NTKERNELAPI -LONG -KeReleaseMutex ( - __inout PRKMUTEX Mutex, - __in BOOLEAN Wait - ); -#endif - -// -// Semaphore object -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -KeInitializeSemaphore ( - __out PRKSEMAPHORE Semaphore, - __in LONG Count, - __in LONG Limit - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG -KeReadStateSemaphore ( - __in PRKSEMAPHORE Semaphore - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_when(Wait==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(Wait==1, __drv_maxIRQL(APC_LEVEL)) -__drv_when(Wait==1, __drv_reportError("Caution: 'Wait' argument does not provide" - " any synchronization guarantees, only a hint" - " to the system that the thread will immediately" - " issue a wait operation")) -NTKERNELAPI -LONG -KeReleaseSemaphore ( - __inout PRKSEMAPHORE Semaphore, - __in KPRIORITY Increment, - __in LONG Adjustment, - __in __drv_constant BOOLEAN Wait - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -ULONG64 -KeQueryTotalCycleTimeProcess ( - __inout PKPROCESS Process, - __out PULONG64 CycleTimeStamp - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -KeDelayExecutionThread ( - __in KPROCESSOR_MODE WaitMode, - __in BOOLEAN Alertable, - __in PLARGE_INTEGER Interval - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -KPRIORITY -KeQueryPriorityThread ( - __in PKTHREAD Thread - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -ULONG -KeQueryRuntimeThread ( - __in PKTHREAD Thread, - __out PULONG UserTime - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -ULONG64 -KeQueryTotalCycleTimeThread ( - __inout PKTHREAD Thread, - __out PULONG64 CycleTimeStamp - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -NTKERNELAPI -NTSTATUS -KeSetTargetProcessorDpcEx ( - __inout PKDPC Dpc, - __in PPROCESSOR_NUMBER ProcNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeRevertToUserAffinityThread ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeSetSystemAffinityThread ( - __in KAFFINITY Affinity - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) && defined(SINGLE_GROUP_LEGACY_API) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeRevertToUserAffinityThreadEx ( - __in KAFFINITY Affinity - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeSetSystemGroupAffinityThread ( - __in PGROUP_AFFINITY Affinity, - __out_opt PGROUP_AFFINITY PreviousAffinity - ); - -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeRevertToUserGroupAffinityThread ( - __in PGROUP_AFFINITY PreviousAffinity - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_LONGHORN) && defined(SINGLE_GROUP_LEGACY_API) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -KAFFINITY -KeSetSystemAffinityThreadEx ( - __in KAFFINITY Affinity - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -KPRIORITY -KeSetPriorityThread ( - __inout PKTHREAD Thread, - __in KPRIORITY Priority - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_neverHoldCriticalRegion -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeEnterCriticalRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeLeaveCriticalRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_neverHoldCriticalRegion -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeEnterGuardedRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -KeLeaveGuardedRegion ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -BOOLEAN -KeAreApcsDisabled ( - VOID - ); -#endif - - - -// -// Timer object -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeInitializeTimer ( - __out PKTIMER Timer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeInitializeTimerEx ( - __out PKTIMER Timer, - __in TIMER_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeCancelTimer ( - __inout PKTIMER - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeReadStateTimer ( - __in PKTIMER Timer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeSetTimer ( - __inout PKTIMER Timer, - __in LARGE_INTEGER DueTime, - __in_opt PKDPC Dpc - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeSetTimerEx ( - __inout PKTIMER Timer, - __in LARGE_INTEGER DueTime, - __in LONG Period, - __in_opt PKDPC Dpc - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -KeSetCoalescableTimer ( - __inout PKTIMER Timer, - __in LARGE_INTEGER DueTime, - __in ULONG Period, - __in ULONG TolerableDelay, - __in_opt PKDPC Dpc - ); -#endif - - -#define KeWaitForMutexObject KeWaitForSingleObject - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_when((Timeout==NULL || *Timeout!=0), __drv_maxIRQL(APC_LEVEL)) -__drv_when((Timeout!=NULL && *Timeout==0), __drv_maxIRQL(DISPATCH_LEVEL)) -NTKERNELAPI -NTSTATUS -KeWaitForMultipleObjects ( - __in ULONG Count, - __in_ecount(Count) PVOID Object[], - __in __drv_strictTypeMatch(__drv_typeConst) WAIT_TYPE WaitType, - __in __drv_strictTypeMatch(__drv_typeCond) KWAIT_REASON WaitReason, - __in __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) - KPROCESSOR_MODE WaitMode, - __in BOOLEAN Alertable, - __in_opt PLARGE_INTEGER Timeout, - __out_opt PKWAIT_BLOCK WaitBlockArray - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_when((Timeout==NULL || *Timeout!=0), __drv_maxIRQL(APC_LEVEL)) -__drv_when((Timeout!=NULL && *Timeout==0), __drv_maxIRQL(DISPATCH_LEVEL)) -NTKERNELAPI -NTSTATUS -KeWaitForSingleObject ( - __in __deref __drv_notPointer PVOID Object, - __in __drv_strictTypeMatch(__drv_typeCond) KWAIT_REASON WaitReason, - __in __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) - KPROCESSOR_MODE WaitMode, - __in BOOLEAN Alertable, - __in_opt PLARGE_INTEGER Timeout - ); -#endif - -// -// Define interprocess interrupt generic call types. -// - -typedef -__drv_sameIRQL -__drv_functionClass(KIPI_BROADCAST_WORKER) -__drv_requiresIRQL(IPI_LEVEL) -ULONG_PTR -KIPI_BROADCAST_WORKER ( - __in ULONG_PTR Argument - ); - -typedef KIPI_BROADCAST_WORKER *PKIPI_BROADCAST_WORKER; - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_minIRQL(PASSIVE_LEVEL) -__drv_maxIRQL(IPI_LEVEL-1) -NTKERNELAPI -ULONG_PTR -KeIpiGenericCall ( - __in PKIPI_BROADCAST_WORKER BroadcastFunction, - __in ULONG_PTR Context - ); -#endif - -// -// spin lock functions -// - -#if defined(_X86_) && (defined(_WDM_INCLUDED_) || defined(WIN9X_COMPAT_SPINLOCK)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -VOID -NTAPI -KeInitializeSpinLock ( - __out PKSPIN_LOCK SpinLock - ); - -#endif - -#else - -FORCEINLINE -VOID -NTAPI -KeInitializeSpinLock ( - __out PKSPIN_LOCK SpinLock - ) - -/*++ - -Routine Description: - - This function initializes a spinlock. - -Arguments: - - SpinLock - Supplies a pointer to a spinlock. - -Return Value: - - None. - ---*/ - -{ - - *SpinLock = 0; - return; -} - -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WS03) -__checkReturn -NTKERNELAPI -BOOLEAN -FASTCALL -KeTestSpinLock ( - __in PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__checkReturn -__drv_minIRQL(DISPATCH_LEVEL) -__drv_valueIs(==1;==0) -NTKERNELAPI -BOOLEAN -FASTCALL -KeTryToAcquireSpinLockAtDpcLevel ( - __inout __deref __drv_neverHold(KeSpinLockType) - __drv_when(return!=0, __deref __drv_acquiresResource(KeSpinLockType)) - PKSPIN_LOCK SpinLock - ); -#endif - -#if defined(_X86_) // ntifs - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KefAcquireSpinLockAtDpcLevel ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KefReleaseSpinLockFromDpcLevel ( - __inout __deref __drv_releasesExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#define KeAcquireSpinLockAtDpcLevel(a) KefAcquireSpinLockAtDpcLevel(a) -#define KeReleaseSpinLockFromDpcLevel(a) KefReleaseSpinLockFromDpcLevel(a) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -KIRQL -FASTCALL -KfAcquireSpinLock ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -VOID -FASTCALL -KfReleaseSpinLock ( - __inout __deref __drv_releasesExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock, - __in __drv_restoresIRQL KIRQL NewIrql - ); -#endif - - -#define KeAcquireSpinLock(a,b) *(b) = KfAcquireSpinLock(a) -#define KeReleaseSpinLock(a,b) KfReleaseSpinLock(a,b) - -#else // ntifs - -// -// These functions are imported for IA64, ntddk, ntifs, nthal, ntosp, and wdm. -// They can be inlined for the system on AMD64. -// - -#define KeAcquireSpinLock(SpinLock, OldIrql) \ - *(OldIrql) = KeAcquireSpinLockRaiseToDpc(SpinLock) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeAcquireSpinLockAtDpcLevel ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -__drv_setsIRQL(DISPATCH_LEVEL) -NTKERNELAPI -KIRQL -KeAcquireSpinLockRaiseToDpc ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeReleaseSpinLock ( - __inout __deref __drv_releasesExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock, - __in __drv_restoresIRQL KIRQL NewIrql - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -KeReleaseSpinLockFromDpcLevel ( - __inout __deref __drv_releasesExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#endif // ntifs - - - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQL -NTKERNELAPI -KIRQL -FASTCALL -KeAcquireSpinLockForDpc ( - __inout __deref __drv_acquiresExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeReleaseSpinLockForDpc ( - __inout __deref __drv_releasesExclusiveResource(KeSpinLockType) - PKSPIN_LOCK SpinLock, - __in __drv_restoresIRQL KIRQL OldIrql - ); -#endif - - - -// -// Queued spin lock functions for "in stack" lock handles. -// -// The following three functions RAISE and LOWER IRQL when a queued -// in stack spin lock is acquired or released using these routines. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQLGlobal(QueuedSpinLock,LockHandle) -__drv_setsIRQL(DISPATCH_LEVEL) -_DECL_HAL_KE_IMPORT -VOID -FASTCALL -KeAcquireInStackQueuedSpinLock ( - __inout PKSPIN_LOCK SpinLock, - __out __deref __drv_acquiresExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_requiresIRQL(DISPATCH_LEVEL) -__drv_restoresIRQLGlobal(QueuedSpinLock,LockHandle) -_DECL_HAL_KE_IMPORT -VOID -FASTCALL -KeReleaseInStackQueuedSpinLock ( - __in __deref __drv_releasesExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -// -// The following two functions do NOT raise or lower IRQL when a queued -// in stack spin lock is acquired or released using these functions. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockAtDpcLevel ( - __inout PKSPIN_LOCK SpinLock, - __out __deref __drv_acquiresExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeReleaseInStackQueuedSpinLockFromDpcLevel ( - __in __deref __drv_releasesExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -// -// The following two functions conditionally raise or lower IRQL when a -// queued in-stack spin lock is acquired or released using these functions. -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_savesIRQLGlobal(QueuedSpinLock,LockHandle) -NTKERNELAPI -VOID -FASTCALL -KeAcquireInStackQueuedSpinLockForDpc ( - __inout PKSPIN_LOCK SpinLock, - __out __deref __drv_acquiresExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_requiresIRQL(DISPATCH_LEVEL) -__drv_restoresIRQLGlobal(QueuedSpinLock,LockHandle) -NTKERNELAPI -VOID -FASTCALL -KeReleaseInStackQueuedSpinLockForDpc ( - __in __deref __drv_releasesExclusiveResource(KeQueuedSpinLockType) - PKLOCK_QUEUE_HANDLE LockHandle - ); -#endif - -// -// Miscellaneous kernel functions -// - -typedef struct _KDPC_WATCHDOG_INFORMATION { - ULONG DpcTimeLimit; - ULONG DpcTimeCount; - ULONG DpcWatchdogLimit; - ULONG DpcWatchdogCount; - ULONG Reserved; -} KDPC_WATCHDOG_INFORMATION, *PKDPC_WATCHDOG_INFORMATION; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_requiresIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -KeQueryDpcWatchdogInformation ( - __out PKDPC_WATCHDOG_INFORMATION WatchdogInformation - ); -#endif - -typedef enum _KBUGCHECK_BUFFER_DUMP_STATE { - BufferEmpty, - BufferInserted, - BufferStarted, - BufferFinished, - BufferIncomplete -} KBUGCHECK_BUFFER_DUMP_STATE; - -typedef -__drv_functionClass(KBUGCHECK_CALLBACK_ROUTINE) -__drv_sameIRQL -VOID -KBUGCHECK_CALLBACK_ROUTINE ( - IN PVOID Buffer, - IN ULONG Length - ); -typedef KBUGCHECK_CALLBACK_ROUTINE *PKBUGCHECK_CALLBACK_ROUTINE; - -typedef struct _KBUGCHECK_CALLBACK_RECORD { - LIST_ENTRY Entry; - PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine; - __field_bcount_opt(Length) PVOID Buffer; - ULONG Length; - PUCHAR Component; - ULONG_PTR Checksum; - UCHAR State; -} KBUGCHECK_CALLBACK_RECORD, *PKBUGCHECK_CALLBACK_RECORD; - -#define KeInitializeCallbackRecord(CallbackRecord) \ - (CallbackRecord)->State = BufferEmpty - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTKERNELAPI -BOOLEAN -KeDeregisterBugCheckCallback ( - __inout PKBUGCHECK_CALLBACK_RECORD CallbackRecord - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -NTKERNELAPI -BOOLEAN -KeRegisterBugCheckCallback ( - __out PKBUGCHECK_CALLBACK_RECORD CallbackRecord, - __in PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, - __in_bcount_opt(Length) PVOID Buffer, - __in ULONG Length, - __in PUCHAR Component - ); -#endif - -typedef enum _KBUGCHECK_CALLBACK_REASON { - KbCallbackInvalid, - KbCallbackReserved1, - KbCallbackSecondaryDumpData, - KbCallbackDumpIo, - KbCallbackAddPages -} KBUGCHECK_CALLBACK_REASON; - -typedef -__drv_functionClass(KBUGCHECK_REASON_CALLBACK_ROUTINE) -__drv_sameIRQL -VOID -KBUGCHECK_REASON_CALLBACK_ROUTINE ( - __in KBUGCHECK_CALLBACK_REASON Reason, - __in struct _KBUGCHECK_REASON_CALLBACK_RECORD* Record, - __inout PVOID ReasonSpecificData, - __in ULONG ReasonSpecificDataLength - ); -typedef KBUGCHECK_REASON_CALLBACK_ROUTINE *PKBUGCHECK_REASON_CALLBACK_ROUTINE; - -typedef struct _KBUGCHECK_REASON_CALLBACK_RECORD { - LIST_ENTRY Entry; - PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine; - PUCHAR Component; - ULONG_PTR Checksum; - KBUGCHECK_CALLBACK_REASON Reason; - UCHAR State; -} KBUGCHECK_REASON_CALLBACK_RECORD, *PKBUGCHECK_REASON_CALLBACK_RECORD; - -typedef struct _KBUGCHECK_SECONDARY_DUMP_DATA { - IN PVOID InBuffer; - IN ULONG InBufferLength; - IN ULONG MaximumAllowed; - OUT GUID Guid; - OUT PVOID OutBuffer; - OUT ULONG OutBufferLength; -} KBUGCHECK_SECONDARY_DUMP_DATA, *PKBUGCHECK_SECONDARY_DUMP_DATA; - -typedef enum _KBUGCHECK_DUMP_IO_TYPE { - KbDumpIoInvalid, - KbDumpIoHeader, - KbDumpIoBody, - KbDumpIoSecondaryData, - KbDumpIoComplete -} KBUGCHECK_DUMP_IO_TYPE; - -typedef struct _KBUGCHECK_DUMP_IO { - IN ULONG64 Offset; - IN PVOID Buffer; - IN ULONG BufferLength; - IN KBUGCHECK_DUMP_IO_TYPE Type; -} KBUGCHECK_DUMP_IO, *PKBUGCHECK_DUMP_IO; - -#define KB_ADD_PAGES_FLAG_VIRTUAL_ADDRESS 0x00000001UL -#define KB_ADD_PAGES_FLAG_PHYSICAL_ADDRESS 0x00000002UL -#define KB_ADD_PAGES_FLAG_ADDITIONAL_RANGES_EXIST 0x80000000UL - -typedef struct _KBUGCHECK_ADD_PAGES { - __inout PVOID Context; // Private context for callback use - __inout ULONG Flags; // Zero initialized on input - __in ULONG BugCheckCode; - __out ULONG_PTR Address; - __out ULONG_PTR Count; -} KBUGCHECK_ADD_PAGES, *PKBUGCHECK_ADD_PAGES; - -// -// Equates for exceptions which cause system fatal error -// - -#define EXCEPTION_DIVIDED_BY_ZERO 0 -#define EXCEPTION_DEBUG 1 -#define EXCEPTION_NMI 2 -#define EXCEPTION_INT3 3 -#define EXCEPTION_BOUND_CHECK 5 -#define EXCEPTION_INVALID_OPCODE 6 -#define EXCEPTION_NPX_NOT_AVAILABLE 7 -#define EXCEPTION_DOUBLE_FAULT 8 -#define EXCEPTION_NPX_OVERRUN 9 -#define EXCEPTION_INVALID_TSS 0x0A -#define EXCEPTION_SEGMENT_NOT_PRESENT 0x0B -#define EXCEPTION_STACK_FAULT 0x0C -#define EXCEPTION_GP_FAULT 0x0D -#define EXCEPTION_RESERVED_TRAP 0x0F -#define EXCEPTION_NPX_ERROR 0x010 -#define EXCEPTION_ALIGNMENT_CHECK 0x011 - -#if (NTDDI_VERSION >= NTDDI_WINXPSP1) -__checkReturn -NTKERNELAPI -BOOLEAN -KeDeregisterBugCheckReasonCallback ( - __inout PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXPSP1) -__checkReturn -NTKERNELAPI -BOOLEAN -KeRegisterBugCheckReasonCallback ( - __out PKBUGCHECK_REASON_CALLBACK_RECORD CallbackRecord, - __in PKBUGCHECK_REASON_CALLBACK_ROUTINE CallbackRoutine, - __in KBUGCHECK_CALLBACK_REASON Reason, - __in PUCHAR Component - ); -#endif - -typedef -__drv_functionClass(NMI_CALLBACK) -__drv_sameIRQL -BOOLEAN -NMI_CALLBACK( - __in_opt PVOID Context, - __in BOOLEAN Handled - ); -typedef NMI_CALLBACK *PNMI_CALLBACK; - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -KeRegisterNmiCallback ( - __in PNMI_CALLBACK CallbackRoutine, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -KeDeregisterNmiCallback ( - __in PVOID Handle - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_preferredFunction("error logging or driver shutdown", - "Whenever possible, all kernel-mode components should log an error and " - "continue to run, rather than calling KeBugCheckEx") -NTKERNELAPI -DECLSPEC_NORETURN -VOID -NTAPI -KeBugCheckEx( - __in ULONG BugCheckCode, - __in ULONG_PTR BugCheckParameter1, - __in ULONG_PTR BugCheckParameter2, - __in ULONG_PTR BugCheckParameter3, - __in ULONG_PTR BugCheckParameter4 - ); -#endif - -#if !defined(_AMD64_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -ULONGLONG -KeQueryInterruptTime ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -KeQuerySystemTime ( - __out PLARGE_INTEGER CurrentTime - ); -#endif - -#endif // !_AMD64_ - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -ULONG -KeQueryTimeIncrement ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONGLONG -KeQueryUnbiasedInterruptTime ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -ULONG -KeGetRecommendedSharedDataAlignment ( - VOID - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -KAFFINITY -KeQueryActiveProcessors ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -ULONG -KeQueryActiveProcessorCount ( - __out_opt PKAFFINITY ActiveProcessors - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeQueryActiveProcessorCountEx ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_LONGHORN) && defined(SINGLE_GROUP_LEGACY_API) -NTKERNELAPI -ULONG -KeQueryMaximumProcessorCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeQueryMaximumProcessorCountEx ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryActiveGroupCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryMaximumGroupCount ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -KAFFINITY -KeQueryGroupAffinity ( - __in USHORT GroupNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -ULONG -KeGetCurrentProcessorNumberEx ( - __out_opt PPROCESSOR_NUMBER ProcNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -KeQueryNodeActiveAffinity ( - __in USHORT NodeNumber, - __out_opt PGROUP_AFFINITY Affinity, - __out_opt PUSHORT Count - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryNodeMaximumProcessorCount ( - __in USHORT NodeNumber - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeQueryHighestNodeNumber ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -USHORT -KeGetCurrentNodeNumber ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -KeQueryLogicalProcessorRelationship ( - __in_opt PPROCESSOR_NUMBER ProcessorNumber, - __in LOGICAL_PROCESSOR_RELATIONSHIP RelationshipType, - __out_bcount_opt(*Length) PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Information, - __inout PULONG Length - ); -#endif - - -#if defined(_IA64_) - -extern volatile LARGE_INTEGER KeTickCount; - -#elif defined(_X86_) - -extern volatile KSYSTEM_TIME KeTickCount; - -#endif - - - -typedef enum _MEMORY_CACHING_TYPE_ORIG { - MmFrameBufferCached = 2 -} MEMORY_CACHING_TYPE_ORIG; - -typedef enum _MEMORY_CACHING_TYPE { - MmNonCached = FALSE, - MmCached = TRUE, - MmWriteCombined = MmFrameBufferCached, - MmHardwareCoherentCached, - MmNonCachedUnordered, // IA64 - MmUSWCCached, - MmMaximumCacheType -} MEMORY_CACHING_TYPE; - - - -#define GM_LOCK_BIT 0x1 // Actual lock bit, 0 = Unlocked, 1 = Locked -#define GM_LOCK_BIT_V 0x0 // Lock bit as a bit number -#define GM_LOCK_WAITER_WOKEN 0x2 // A single waiter has been woken to acquire this lock -#define GM_LOCK_WAITER_INC 0x4 // Increment value to change the waiters count - -typedef struct _KGUARDED_MUTEX { - volatile LONG Count; - PKTHREAD Owner; - ULONG Contention; - KGATE Gate; - union { - struct { - SHORT KernelApcDisable; - SHORT SpecialApcDisable; - }; - - ULONG CombinedApcDisable; - }; - -} KGUARDED_MUTEX, *PKGUARDED_MUTEX; - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -KeAreAllApcsDisabled ( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeInitializeGuardedMutex ( - __out PKGUARDED_MUTEX Mutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_neverHoldCriticalRegion -__drv_acquiresCriticalRegion -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeAcquireGuardedMutex ( - __inout __deref __drv_neverHold(GuardedMutex) __deref __drv_acquiresResource(GuardedMutex) - PKGUARDED_MUTEX Mutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_mustHoldCriticalRegion -__drv_releasesCriticalRegion -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeReleaseGuardedMutex ( - __inout __deref __drv_releasesExclusiveResource(GuardedMutex) - PKGUARDED_MUTEX Mutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -__drv_valueIs(==1;==0) -NTKERNELAPI -BOOLEAN -FASTCALL -KeTryToAcquireGuardedMutex ( - __inout __deref __drv_neverHold(GuardedMutex) - __deref __drv_when(return==1, __drv_acquiresResource(GuardedMutex)) - PKGUARDED_MUTEX Mutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -__drv_minIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeAcquireGuardedMutexUnsafe ( - __inout __deref __drv_neverHold(KeFastMutex) __deref __drv_acquiresResource(KeFastMutex) - PKGUARDED_MUTEX FastMutex - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -FASTCALL -KeReleaseGuardedMutexUnsafe ( - __inout __deref __drv_releasesExclusiveResource(KeFastMutex) - __inout PKGUARDED_MUTEX FastMutex - ); -#endif - - -// -// Define dynamic processor add types. -// - -typedef enum { - KeProcessorAddStartNotify = 0, - KeProcessorAddCompleteNotify, - KeProcessorAddFailureNotify -} KE_PROCESSOR_CHANGE_NOTIFY_STATE; - -typedef struct _KE_PROCESSOR_CHANGE_NOTIFY_CONTEXT { - KE_PROCESSOR_CHANGE_NOTIFY_STATE State; - ULONG NtNumber; - NTSTATUS Status; - -#if (NTDDI_VERSION >= NTDDI_WIN7) - - PROCESSOR_NUMBER ProcNumber; - -#endif - - -} KE_PROCESSOR_CHANGE_NOTIFY_CONTEXT, *PKE_PROCESSOR_CHANGE_NOTIFY_CONTEXT; - -typedef -__drv_sameIRQL -__drv_functionClass(PROCESSOR_CALLBACK_FUNCTION) -VOID -PROCESSOR_CALLBACK_FUNCTION ( - __in PVOID CallbackContext, - __in PKE_PROCESSOR_CHANGE_NOTIFY_CONTEXT ChangeContext, - __inout PNTSTATUS OperationStatus - ); - -typedef PROCESSOR_CALLBACK_FUNCTION *PPROCESSOR_CALLBACK_FUNCTION; - -#define KE_PROCESSOR_CHANGE_ADD_EXISTING 1 - -#if (NTDDI_VERSION >= NTDDI_WS08) -__drv_maxIRQL(APC_LEVEL) -PVOID -KeRegisterProcessorChangeCallback ( - __in PPROCESSOR_CALLBACK_FUNCTION CallbackFunction, - __in_opt PVOID CallbackContext, - __in ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS08) -__drv_maxIRQL(APC_LEVEL) -VOID -KeDeregisterProcessorChangeCallback ( - __in PVOID CallbackHandle - ); -#endif - - -#define INVALID_PROCESSOR_INDEX 0xffffffff - -NTSTATUS -KeGetProcessorNumberFromIndex ( - __in ULONG ProcIndex, - __out PPROCESSOR_NUMBER ProcNumber - ); - -ULONG -KeGetProcessorIndexFromNumber ( - __in PPROCESSOR_NUMBER ProcNumber - ); - - -typedef struct _XSTATE_SAVE { - -#if defined(_AMD64_) - - struct _XSTATE_SAVE* Prev; - struct _KTHREAD* Thread; - UCHAR Level; - XSTATE_CONTEXT XStateContext; - -#elif defined(_IA64_) - - ULONG Dummy; - -#elif defined(_X86_) - - union { - struct { - LONG64 Reserved1; - ULONG Reserved2; - - struct _XSTATE_SAVE* Prev; - - PXSAVE_AREA Reserved3; - - struct _KTHREAD* Thread; - - PVOID Reserved4; - - UCHAR Level; - }; - - XSTATE_CONTEXT XStateContext; - }; - -#endif -} XSTATE_SAVE, *PXSTATE_SAVE; - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(<0;==0) -__drv_when(return==0, __drv_floatSaved) -NTKERNELAPI -NTSTATUS -NTAPI -KeSaveExtendedProcessorState ( - __in ULONG64 Mask, - __out __deref __drv_neverHold(XStateSave) - __drv_when(return==0, __deref __drv_acquiresResource(XStateSave)) - PXSTATE_SAVE XStateSave - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_floatRestored -NTKERNELAPI -VOID -NTAPI -KeRestoreExtendedProcessorState ( - __in __deref __drv_releasesExclusiveResource(XStateSave) - PXSTATE_SAVE XStateSave - ); -#endif - -// -// Define external data. -// - -#if defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_WDMDDK_) || defined(_NTOSP_) - -extern PBOOLEAN KdDebuggerNotPresent; -extern PBOOLEAN KdDebuggerEnabled; -#define KD_DEBUGGER_ENABLED *KdDebuggerEnabled -#define KD_DEBUGGER_NOT_PRESENT *KdDebuggerNotPresent - -#else - -extern BOOLEAN KdDebuggerNotPresent; -extern BOOLEAN KdDebuggerEnabled; -#define KD_DEBUGGER_ENABLED KdDebuggerEnabled -#define KD_DEBUGGER_NOT_PRESENT KdDebuggerNotPresent - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -KdDisableDebugger( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -KdEnableDebugger( - VOID - ); -#endif - -// -// KdRefreshDebuggerPresent attempts to communicate with -// the debugger host machine to refresh the state of -// KdDebuggerNotPresent. It returns the state of -// KdDebuggerNotPresent while the kd locks are held. -// KdDebuggerNotPresent may immediately change state -// after the kd locks are released so it may not -// match the return value. -// - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -BOOLEAN -KdRefreshDebuggerNotPresent( - VOID - ); -#endif - -typedef enum _KD_OPTION { - KD_OPTION_SET_BLOCK_ENABLE, -} KD_OPTION; - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -NTSTATUS -KdChangeOption( - __in KD_OPTION Option, - __in ULONG InBufferBytes OPTIONAL, - __in PVOID InBuffer, - __in ULONG OutBufferBytes OPTIONAL, - __out PVOID OutBuffer, - __out PULONG OutBufferNeeded OPTIONAL - ); -#endif - - -// -// Pool Allocation routines (in pool.c) -// - -typedef enum _POOL_TYPE { - NonPagedPool, - PagedPool, - NonPagedPoolMustSucceed, - DontUseThisType, - NonPagedPoolCacheAligned, - PagedPoolCacheAligned, - NonPagedPoolCacheAlignedMustS, - MaxPoolType, - - // - // Note these per session types are carefully chosen so that the appropriate - // masking still applies as well as MaxPoolType above. - // - - NonPagedPoolSession = 32, - PagedPoolSession = NonPagedPoolSession + 1, - NonPagedPoolMustSucceedSession = PagedPoolSession + 1, - DontUseThisTypeSession = NonPagedPoolMustSucceedSession + 1, - NonPagedPoolCacheAlignedSession = DontUseThisTypeSession + 1, - PagedPoolCacheAlignedSession = NonPagedPoolCacheAlignedSession + 1, - NonPagedPoolCacheAlignedMustSSession = PagedPoolCacheAlignedSession + 1, -} POOL_TYPE; - -#define POOL_COLD_ALLOCATION 256 // Note this cannot encode into the header. - - -#define POOL_QUOTA_FAIL_INSTEAD_OF_RAISE 8 -#define POOL_RAISE_IF_ALLOCATION_FAILURE 16 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DECLSPEC_DEPRECATED_DDK // Use ExAllocatePoolWithTag -__drv_preferredFunction("ExAllocatePoolWithTag", - "No tag interferes with debugging.") -__drv_allocatesMem(Mem) -__drv_when(((PoolType&0x1))!=0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(((PoolType&0x1))==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(((PoolType&0x2))!=0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))==0, - __post __maybenull __checkReturn) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))!=0, - __post __notnull) -__bcount(NumberOfBytes) -NTKERNELAPI -PVOID -ExAllocatePool( - __drv_strictTypeMatch(__drv_typeExpr) __in POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DECLSPEC_DEPRECATED_DDK // Use ExAllocatePoolWithQuotaTag -__drv_preferredFunction("ExAllocatePoolWithQuotaTag", - "No tag interferes with debugging.") -__drv_allocatesMem(Mem) -__drv_when(((PoolType&0x1))!=0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(((PoolType&0x1))==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(((PoolType&0x2))!=0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) -__drv_when(((PoolType&POOL_QUOTA_FAIL_INSTEAD_OF_RAISE))!=0, - __post __maybenull __checkReturn) -__drv_when(((PoolType&POOL_QUOTA_FAIL_INSTEAD_OF_RAISE))==0, - __post __notnull) -__bcount(NumberOfBytes) -NTKERNELAPI -PVOID -ExAllocatePoolWithQuota( - __drv_strictTypeMatch(__drv_typeExpr) __in POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_allocatesMem(Mem) -__drv_when(((PoolType&0x1))!=0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(((PoolType&0x1))==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(((PoolType&0x2))!=0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))==0, - __post __maybenull __checkReturn) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))!=0, - __post __notnull) -__bcount(NumberOfBytes) -NTKERNELAPI -PVOID -NTAPI -ExAllocatePoolWithTag( - __in __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag - ); - -#endif - -// -// _EX_POOL_PRIORITY_ provides a method for the system to handle requests -// intelligently in low resource conditions. -// -// LowPoolPriority should be used when it is acceptable to the driver for the -// mapping request to fail if the system is low on resources. An example of -// this could be for a non-critical network connection where the driver can -// handle the failure case when system resources are close to being depleted. -// -// NormalPoolPriority should be used when it is acceptable to the driver for the -// mapping request to fail if the system is very low on resources. An example -// of this could be for a non-critical local filesystem request. -// -// HighPoolPriority should be used when it is unacceptable to the driver for the -// mapping request to fail unless the system is completely out of resources. -// An example of this would be the paging file path in a driver. -// -// SpecialPool can be specified to bound the allocation at a page end (or -// beginning). This should only be done on systems being debugged as the -// memory cost is expensive. -// -// N.B. These values are very carefully chosen so that the pool allocation -// code can quickly crack the priority request. -// - -typedef enum _EX_POOL_PRIORITY { - LowPoolPriority, - LowPoolPrioritySpecialPoolOverrun = 8, - LowPoolPrioritySpecialPoolUnderrun = 9, - NormalPoolPriority = 16, - NormalPoolPrioritySpecialPoolOverrun = 24, - NormalPoolPrioritySpecialPoolUnderrun = 25, - HighPoolPriority = 32, - HighPoolPrioritySpecialPoolOverrun = 40, - HighPoolPrioritySpecialPoolUnderrun = 41 -} EX_POOL_PRIORITY; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_allocatesMem(Mem) -__drv_when(((PoolType&0x1))!=0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(((PoolType&0x1))==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(((PoolType&0x2))!=0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))==0, - __post __maybenull __checkReturn) -__drv_when(((PoolType&(0x2|POOL_RAISE_IF_ALLOCATION_FAILURE)))!=0, - __post __notnull) -__bcount(NumberOfBytes) -NTKERNELAPI -PVOID -NTAPI -ExAllocatePoolWithTagPriority( - __in __drv_strictTypeMatch(__drv_typeCond) POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag, - __in __drv_strictTypeMatch(__drv_typeExpr) EX_POOL_PRIORITY Priority - ); - -#endif - -#ifndef POOL_TAGGING -#define ExAllocatePoolWithTag(a,b,c) ExAllocatePool(a,b) -#endif //POOL_TAGGING - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_allocatesMem(Mem) -__drv_when(((PoolType&0x1))!=0, __drv_maxIRQL(APC_LEVEL)) -__drv_when(((PoolType&0x1))==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(((PoolType&0x2))!=0, - __drv_reportError("Must succeed pool allocations are forbidden. " - "Allocation failures cause a system crash")) -__drv_when(((PoolType&POOL_QUOTA_FAIL_INSTEAD_OF_RAISE))!=0, - __post __maybenull __checkReturn) -__drv_when(((PoolType&POOL_QUOTA_FAIL_INSTEAD_OF_RAISE))==0, - __post __notnull) -__bcount(NumberOfBytes) -NTKERNELAPI -PVOID -ExAllocatePoolWithQuotaTag( - __in __drv_strictTypeMatch(__drv_typeExpr) POOL_TYPE PoolType, - __in SIZE_T NumberOfBytes, - __in ULONG Tag - ); - -#endif - -#ifndef POOL_TAGGING -#define ExAllocatePoolWithQuotaTag(a,b,c) ExAllocatePoolWithQuota(a,b) -#endif //POOL_TAGGING - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -NTAPI -ExFreePool( - __in __drv_freesMem(Mem) PVOID P - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExFreePoolWithTag( - __in __drv_freesMem(Mem) PVOID P, - __in ULONG Tag - ); - -#endif - - -// -// Routines to support fast mutexes. -// - -typedef struct _FAST_MUTEX { - -#define FM_LOCK_BIT 0x1 // Actual lock bit, 1 = Unlocked, 0 = Locked -#define FM_LOCK_BIT_V 0x0 // Lock bit as a bit number -#define FM_LOCK_WAITER_WOKEN 0x2 // A single waiter has been woken to acquire this lock -#define FM_LOCK_WAITER_INC 0x4 // Increment value to change the waiters count - - volatile LONG Count; - PKTHREAD Owner; - ULONG Contention; - KEVENT Event; - ULONG OldIrql; -} FAST_MUTEX, *PFAST_MUTEX; - -FORCEINLINE -VOID -ExInitializeFastMutex( - __out PFAST_MUTEX FastMutex - ) - -/*++ - -Routine Description: - - This function initializes a fast mutex object. - -Arguments: - - FastMutex - Supplies a pointer to a fast mutex object. - -Return Value: - - None. - ---*/ - -{ - - FastMutex->Count = FM_LOCK_BIT; - FastMutex->Owner = NULL; - FastMutex->Contention = 0; - KeInitializeEvent(&FastMutex->Event, SynchronizationEvent, FALSE); - return; -} - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -NTKERNELAPI -VOID -FASTCALL -ExAcquireFastMutexUnsafe( - __inout __deref __drv_acquiresExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -NTKERNELAPI -VOID -FASTCALL -ExReleaseFastMutexUnsafe( - __inout __deref __drv_releasesExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#endif - - -#if defined(_NTHAL_) && defined(_X86_) - -__drv_raisesIRQL(APC_LEVEL) -__drv_savesIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -VOID -FASTCALL -ExiAcquireFastMutex( - __inout __deref __drv_acquiresExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -__drv_requiresIRQL(APC_LEVEL) -__drv_restoresIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -VOID -FASTCALL -ExiReleaseFastMutex( - __inout __deref __drv_releasesExclusiveResource(FastMutexType) - __inout PFAST_MUTEX FastMutex - ); - -__checkReturn -__success(return!=FALSE) -__drv_raisesIRQL(APC_LEVEL) -__drv_savesIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -BOOLEAN -FASTCALL -ExiTryToAcquireFastMutex( - __inout __deref __drv_acquiresExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#define ExAcquireFastMutex(FastMutex) ExiAcquireFastMutex(FastMutex) -#define ExReleaseFastMutex(FastMutex) ExiReleaseFastMutex(FastMutex) -#define ExTryToAcquireFastMutex(FastMutex) ExiTryToAcquireFastMutex(FastMutex) - -#else - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_raisesIRQL(APC_LEVEL) -__drv_savesIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -VOID -FASTCALL -ExAcquireFastMutex ( - __inout __deref __drv_acquiresExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_requiresIRQL(APC_LEVEL) -__drv_restoresIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -VOID -FASTCALL -ExReleaseFastMutex ( - __inout __deref __drv_releasesExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__checkReturn -__success(return!=FALSE) -__drv_raisesIRQL(APC_LEVEL) -__drv_savesIRQLGlobal(OldIrql, FastMutex) -NTKERNELAPI -BOOLEAN -FASTCALL -ExTryToAcquireFastMutex ( - __inout __deref __drv_acquiresExclusiveResource(FastMutexType) - PFAST_MUTEX FastMutex - ); - -#endif - -#endif // _NTHAL_ && _X86_ - - -// - -#if defined(_WIN64) - -#define ExInterlockedAddLargeStatistic(Addend, Increment) \ - (VOID)InterlockedAdd64(&(Addend)->QuadPart, Increment) - -#else - -#ifdef __cplusplus -extern "C" { -#endif - -LONG -__cdecl -_InterlockedAddLargeStatistic ( - __inout LONGLONG volatile *Addend, - __in ULONG Increment - ); - -#ifdef __cplusplus -} -#endif - -#pragma intrinsic(_InterlockedAddLargeStatistic) - -#define ExInterlockedAddLargeStatistic(Addend, Increment) \ - (VOID)_InterlockedAddLargeStatistic((PLONGLONG)&(Addend)->QuadPart, Increment) - -#endif // defined(_WIN64) - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -LARGE_INTEGER -ExInterlockedAddLargeInteger ( - __inout PLARGE_INTEGER Addend, - __in LARGE_INTEGER Increment, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -ULONG -FASTCALL -ExInterlockedAddUlong ( - __inout PULONG Addend, - __in ULONG Increment, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif // NTDDI_VERSION >= NTDDI_WIN2K - - -#if defined(_AMD64_) || defined(_IA64_) - -#define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \ - InterlockedCompareExchange64(Destination, *(Exchange), *(Comperand)) - -#else - -#define ExInterlockedCompareExchange64(Destination, Exchange, Comperand, Lock) \ - ExfInterlockedCompareExchange64(Destination, Exchange, Comperand) - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExInterlockedInsertHeadList ( - __inout PLIST_ENTRY ListHead, - __inout __drv_aliasesMem PLIST_ENTRY ListEntry, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExInterlockedInsertTailList ( - __inout PLIST_ENTRY ListHead, - __inout __drv_aliasesMem PLIST_ENTRY ListEntry, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -PLIST_ENTRY -FASTCALL -ExInterlockedRemoveHeadList ( - __inout PLIST_ENTRY ListHead, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -PSINGLE_LIST_ENTRY -FASTCALL -ExInterlockedPopEntryList ( - __inout PSINGLE_LIST_ENTRY ListHead, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -PSINGLE_LIST_ENTRY -FASTCALL -ExInterlockedPushEntryList ( - __inout PSINGLE_LIST_ENTRY ListHead, - __inout __drv_aliasesMem PSINGLE_LIST_ENTRY ListEntry, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#endif - - -// -// Define interlocked sequenced listhead functions. -// -// A sequenced interlocked list is a singly linked list with a header that -// contains the current depth and a sequence number. Each time an entry is -// inserted or removed from the list the depth is updated and the sequence -// number is incremented. This enables AMD64, IA64, and Pentium and later -// machines to insert and remove from the list without the use of spinlocks. -// - -#if !defined(_WINBASE_) - -#if defined(_WIN64) && (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_NTOSP_)) - -NTKERNELAPI -VOID -InitializeSListHead ( - __out PSLIST_HEADER SListHead - ); - -#else - -// -// Since the following function will be compiled inline for user code, the -// initialization changes for IA64 will only take effect if the user code -// is recompiled with this new header. For those binaries that are recompiled -// with this new code, it will not have to go through an extra step of header -// initialization on its first push or pop operation. Note that the SLIST code -// will still work perfectly even without the changes in this initialization -// function. -// - -__inline -VOID -InitializeSListHead ( - __out PSLIST_HEADER SListHead - ) - -/*++ - -Routine Description: - - This function initializes a sequenced singly linked listhead. - -Arguments: - - SListHead - Supplies a pointer to a sequenced singly linked listhead. - -Return Value: - - None. - ---*/ - -{ - -#if defined(_IA64_) - - ULONG64 FeatureBits; - -#endif - - // - // Slist headers must be 16 byte aligned. - // - -#if defined(_WIN64) - - if (((ULONG_PTR)SListHead & 0xf) != 0) { - RtlRaiseStatus(STATUS_DATATYPE_MISALIGNMENT); - } - -#endif - - RtlZeroMemory(SListHead, sizeof(SLIST_HEADER)); - - // - // Check feature bits to determine if 16-byte atomic operations are - // supported. - // - -#if defined(_IA64_) - - FeatureBits = __getReg(CV_IA64_CPUID4); - if ((FeatureBits & KF_16BYTE_INSTR) != 0) { - - // - // Initialize 16-byte header. - // - // NB: For the 8-byte header, all elements in the list must reside in - // the same Region, but not necessarily the same as the Header. At this - // point there is no information to where will the items reside, so - // defer the actual initialization of 8-byte header to the first Push - // operation. - // - - SListHead->Header16.HeaderType = 1; - SListHead->Header16.Init = 1; - } - -#endif - - return; -} - -#endif - -#endif // !defined(_WINBASE_) - -#define ExInitializeSListHead InitializeSListHead - -PSLIST_ENTRY -FirstEntrySList ( - __in PSLIST_HEADER SListHead - ); - -#if defined(_WIN64) - -#if (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_) || defined(_NTOSP_)) - -NTKERNELAPI -USHORT -ExQueryDepthSList ( - __in PSLIST_HEADER SListHead - ); - -#else - -__inline -USHORT -ExQueryDepthSList ( - __in PSLIST_HEADER SListHead - ) - -/*++ - -Routine Description: - - This function queries the current number of entries contained in a - sequenced single linked list. - -Arguments: - - SListHead - Supplies a pointer to the sequenced listhead which is - be queried. - -Return Value: - - The current number of entries in the sequenced singly linked list is - returned as the function value. - ---*/ - -{ - - return (USHORT)(SListHead->Alignment & 0xffff); -} - -#endif - -#else - -#define ExQueryDepthSList(_listhead_) (_listhead_)->Depth - -#endif - -#if defined(_WIN64) - -#define ExInterlockedPopEntrySList(Head, Lock) \ - ExpInterlockedPopEntrySList(Head) - -#define ExInterlockedPushEntrySList(Head, Entry, Lock) \ - ExpInterlockedPushEntrySList(Head, Entry) - -#define ExInterlockedFlushSList(Head) \ - ExpInterlockedFlushSList(Head) - -#if !defined(_WINBASE_) - -#define InterlockedPopEntrySList(Head) \ - ExpInterlockedPopEntrySList(Head) - -#define InterlockedPushEntrySList(Head, Entry) \ - ExpInterlockedPushEntrySList(Head, Entry) - -#define InterlockedFlushSList(Head) \ - ExpInterlockedFlushSList(Head) - -#define QueryDepthSList(Head) \ - ExQueryDepthSList(Head) - -#endif // !defined(_WINBASE_) - -NTKERNELAPI -PSLIST_ENTRY -ExpInterlockedPopEntrySList ( - __inout PSLIST_HEADER ListHead - ); - -NTKERNELAPI -PSLIST_ENTRY -ExpInterlockedPushEntrySList ( - __inout PSLIST_HEADER ListHead, - __inout __drv_aliasesMem PSLIST_ENTRY ListEntry - ); - -NTKERNELAPI -PSLIST_ENTRY -ExpInterlockedFlushSList ( - __inout PSLIST_HEADER ListHead - ); - -#else - -#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) - -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -ExInterlockedPopEntrySList ( - __inout PSLIST_HEADER ListHead, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -ExInterlockedPushEntrySList ( - __inout PSLIST_HEADER ListHead, - __inout __drv_aliasesMem PSLIST_ENTRY ListEntry, - __inout __deref __drv_neverHold(KeSpinLockType) PKSPIN_LOCK Lock - ); - -#else - -#define ExInterlockedPopEntrySList(ListHead, Lock) \ - InterlockedPopEntrySList(ListHead) - -#define ExInterlockedPushEntrySList(ListHead, ListEntry, Lock) \ - InterlockedPushEntrySList(ListHead, ListEntry) - -#endif - -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -ExInterlockedFlushSList ( - __inout PSLIST_HEADER ListHead - ); - -#if !defined(_WINBASE_) - -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -InterlockedPopEntrySList ( - __inout PSLIST_HEADER ListHead - ); - -NTKERNELAPI -PSLIST_ENTRY -FASTCALL -InterlockedPushEntrySList ( - __inout PSLIST_HEADER ListHead, - __inout __drv_aliasesMem PSLIST_ENTRY ListEntry - ); - -#define InterlockedFlushSList(Head) \ - ExInterlockedFlushSList(Head) - -#define QueryDepthSList(Head) \ - ExQueryDepthSList(Head) - -#endif // !defined(_WINBASE_) - -#endif // defined(_WIN64) - - -#define LOOKASIDE_MINIMUM_BLOCK_SIZE (RTL_SIZEOF_THROUGH_FIELD (SLIST_ENTRY, Next)) - -// -// N.B. Note that this structure is not cache aligned to enable its use -// in a larger containing structure. -// - -typedef struct _LOOKASIDE_LIST_EX { - GENERAL_LOOKASIDE_POOL L; -} LOOKASIDE_LIST_EX, *PLOOKASIDE_LIST_EX; - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -#define EX_LOOKASIDE_LIST_EX_FLAGS_RAISE_ON_FAIL 0x00000001UL -#define EX_LOOKASIDE_LIST_EX_FLAGS_FAIL_NO_RAISE 0x00000002UL - -#define EX_MAXIMUM_LOOKASIDE_DEPTH_BASE 256 // Base maximum depth -#define EX_MAXIMUM_LOOKASIDE_DEPTH_LIMIT 1024 // Upper limit maximum depth - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ExInitializeLookasideListEx ( - __out PLOOKASIDE_LIST_EX Lookaside, - __in_opt PALLOCATE_FUNCTION_EX Allocate, - __in_opt PFREE_FUNCTION_EX Free, - __in POOL_TYPE PoolType, - __in ULONG Flags, - __in SIZE_T Size, - __in ULONG Tag, - __in USHORT Depth - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExDeleteLookasideListEx ( - __inout PLOOKASIDE_LIST_EX Lookaside - ); - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExFlushLookasideListEx ( - __inout PLOOKASIDE_LIST_EX Lookaside - ); - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -PVOID -ExAllocateFromLookasideListEx ( - __inout PLOOKASIDE_LIST_EX Lookaside - ) - -/*++ - -Routine Description: - - This function removes (pops) the first entry from the specified - lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a LOOKASIDE_LIST_EX structure. - -Return Value: - - If an entry is removed from the specified lookaside list, then the - address of the entry is returned as the function value. Otherwise, - NULL is returned. - ---*/ - -{ - - PVOID Entry; - - Lookaside->L.TotalAllocates += 1; - Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); - if (Entry == NULL) { - Lookaside->L.AllocateMisses += 1; - Entry = (Lookaside->L.AllocateEx)(Lookaside->L.Type, - Lookaside->L.Size, - Lookaside->L.Tag, - Lookaside); - } - - return Entry; -} - -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -VOID -ExFreeToLookasideListEx ( - __inout PLOOKASIDE_LIST_EX Lookaside, - __in PVOID Entry - ) - -/*++ - -Routine Description: - - This function inserts (pushes) the specified entry into the specified - lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a LOOKASIDE_LIST_EX structure. - - Entry - Supples a pointer to the entry that is inserted in the - lookaside list. - -Return Value: - - None. - ---*/ - -{ - - Lookaside->L.TotalFrees += 1; - if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { - Lookaside->L.FreeMisses += 1; - (Lookaside->L.FreeEx)(Entry, Lookaside); - - } else { - InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); - } - - return; -} - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - -typedef struct LOOKASIDE_ALIGN _NPAGED_LOOKASIDE_LIST { - - GENERAL_LOOKASIDE L; - -#if !defined(_AMD64_) && !defined(_IA64_) - - KSPIN_LOCK Lock__ObsoleteButDoNotDelete; - -#endif - -} NPAGED_LOOKASIDE_LIST, *PNPAGED_LOOKASIDE_LIST; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExInitializeNPagedLookasideList ( - __out PNPAGED_LOOKASIDE_LIST Lookaside, - __in_opt PALLOCATE_FUNCTION Allocate, - __in_opt PFREE_FUNCTION Free, - __in ULONG Flags, - __in SIZE_T Size, - __in ULONG Tag, - __in USHORT Depth - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExDeleteNPagedLookasideList ( - __inout PNPAGED_LOOKASIDE_LIST Lookaside - ); - -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -__inline -PVOID -ExAllocateFromNPagedLookasideList ( - __inout PNPAGED_LOOKASIDE_LIST Lookaside - ) - -/*++ - -Routine Description: - - This function removes (pops) the first entry from the specified - nonpaged lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a nonpaged lookaside list structure. - -Return Value: - - If an entry is removed from the specified lookaside list, then the - address of the entry is returned as the function value. Otherwise, - NULL is returned. - ---*/ - -{ - - PVOID Entry; - - Lookaside->L.TotalAllocates += 1; - -#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) - - Entry = ExInterlockedPopEntrySList(&Lookaside->L.ListHead, - &Lookaside->Lock__ObsoleteButDoNotDelete); - -#else - - Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); - -#endif - - if (Entry == NULL) { - Lookaside->L.AllocateMisses += 1; - Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, - Lookaside->L.Size, - Lookaside->L.Tag); - } - - return Entry; -} - -__drv_maxIRQL(DISPATCH_LEVEL) -__inline -VOID -ExFreeToNPagedLookasideList ( - __inout PNPAGED_LOOKASIDE_LIST Lookaside, - __in PVOID Entry - ) - -/*++ - -Routine Description: - - This function inserts (pushes) the specified entry into the specified - nonpaged lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a nonpaged lookaside list structure. - - Entry - Supples a pointer to the entry that is inserted in the - lookaside list. - -Return Value: - - None. - ---*/ - -{ - - Lookaside->L.TotalFrees += 1; - if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { - Lookaside->L.FreeMisses += 1; - (Lookaside->L.Free)(Entry); - - } else { - -#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) - - ExInterlockedPushEntrySList(&Lookaside->L.ListHead, - (PSLIST_ENTRY)Entry, - &Lookaside->Lock__ObsoleteButDoNotDelete); - -#else - - InterlockedPushEntrySList(&Lookaside->L.ListHead, (PSLIST_ENTRY)Entry); - -#endif - - } - - return; -} - - - -typedef struct LOOKASIDE_ALIGN _PAGED_LOOKASIDE_LIST { - - GENERAL_LOOKASIDE L; - -#if !defined(_AMD64_) && !defined(_IA64_) - - FAST_MUTEX Lock__ObsoleteButDoNotDelete; - -#endif - -} PAGED_LOOKASIDE_LIST, *PPAGED_LOOKASIDE_LIST; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExInitializePagedLookasideList ( - __out PPAGED_LOOKASIDE_LIST Lookaside, - __in_opt PALLOCATE_FUNCTION Allocate, - __in_opt PFREE_FUNCTION Free, - __in ULONG Flags, - __in SIZE_T Size, - __in ULONG Tag, - __in USHORT Depth - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExDeletePagedLookasideList ( - __inout PPAGED_LOOKASIDE_LIST Lookaside - ); - -#endif - -#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -ExAllocateFromPagedLookasideList ( - __inout PPAGED_LOOKASIDE_LIST Lookaside - ); - -#else - -__drv_maxIRQL(APC_LEVEL) -__inline -PVOID -ExAllocateFromPagedLookasideList ( - __inout PPAGED_LOOKASIDE_LIST Lookaside - ) - -/*++ - -Routine Description: - - This function removes (pops) the first entry from the specified - paged lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a paged lookaside list structure. - -Return Value: - - If an entry is removed from the specified lookaside list, then the - address of the entry is returned as the function value. Otherwise, - NULL is returned. - ---*/ - -{ - - PVOID Entry; - - Lookaside->L.TotalAllocates += 1; - Entry = InterlockedPopEntrySList(&Lookaside->L.ListHead); - if (Entry == NULL) { - Lookaside->L.AllocateMisses += 1; - Entry = (Lookaside->L.Allocate)(Lookaside->L.Type, - Lookaside->L.Size, - Lookaside->L.Tag); - } - - return Entry; -} - -#endif - -#if defined(_WIN2K_COMPAT_SLIST_USAGE) && defined(_X86_) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExFreeToPagedLookasideList ( - __inout PPAGED_LOOKASIDE_LIST Lookaside, - __in PVOID Entry - ); - -#else - -__drv_maxIRQL(APC_LEVEL) -__inline -VOID -ExFreeToPagedLookasideList ( - __inout PPAGED_LOOKASIDE_LIST Lookaside, - __in PVOID Entry - ) - -/*++ - -Routine Description: - - This function inserts (pushes) the specified entry into the specified - paged lookaside list. - -Arguments: - - Lookaside - Supplies a pointer to a nonpaged lookaside list structure. - - Entry - Supples a pointer to the entry that is inserted in the - lookaside list. - -Return Value: - - None. - ---*/ - -{ - - Lookaside->L.TotalFrees += 1; - if (ExQueryDepthSList(&Lookaside->L.ListHead) >= Lookaside->L.Depth) { - Lookaside->L.FreeMisses += 1; - (Lookaside->L.Free)(Entry); - - } else { - InterlockedPushEntrySList(&Lookaside->L.ListHead, - (PSLIST_ENTRY)Entry); - } - - return; -} - -#endif - - -#if defined(_NTDDK_) || defined(_NTIFS_) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_inTry -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -NTAPI -ProbeForRead ( - __in_data_source(USER_MODE) __out_validated(MEMORY) __in_bcount(Length) - PVOID Address, - __in SIZE_T Length, - __in ULONG Alignment - ); - -#endif - -#endif - -// -// Raise status from kernel mode. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -DECLSPEC_NORETURN -VOID -NTAPI -ExRaiseStatus ( - __in NTSTATUS Status - ); - -#endif - - - -// -// Common probe for write functions. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_inTry -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -NTAPI -ProbeForWrite ( - __in_data_source(USER_MODE) __out_validated(MEMORY) __inout_bcount(Length) - PVOID Address, - __in SIZE_T Length, - __in ULONG Alignment - ); - -#endif - -// -// Worker Thread -// - -typedef enum _WORK_QUEUE_TYPE { - CriticalWorkQueue, - DelayedWorkQueue, - HyperCriticalWorkQueue, - MaximumWorkQueue -} WORK_QUEUE_TYPE; - -typedef -__drv_sameIRQL -__drv_functionClass(WORKER_THREAD_ROUTINE) -VOID -WORKER_THREAD_ROUTINE ( - __in PVOID Parameter - ); - -typedef WORKER_THREAD_ROUTINE *PWORKER_THREAD_ROUTINE; - -typedef struct _WORK_QUEUE_ITEM { - LIST_ENTRY List; - PWORKER_THREAD_ROUTINE WorkerRoutine; - __volatile PVOID Parameter; -} WORK_QUEUE_ITEM, *PWORK_QUEUE_ITEM; - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExInitializeWorkItem) // Use IoAllocateWorkItem -#endif - -#define ExInitializeWorkItem(Item, Routine, Context) \ - (Item)->WorkerRoutine = (Routine); \ - (Item)->Parameter = (Context); \ - (Item)->List.Flink = NULL; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#ifdef _NTDDK_ - -__drv_when( (!__drv_defined(_DRIVER_TYPE_FILESYSTEM) - && !__drv_defined(_DRIVER_TYPE_FILESYSTEM_FILTER)) - || NTDDI_VERSION >= NTDDI_VISTA, - __drv_preferredFunction("IoQueueWorkItem[Ex]", - "Obsolete in all drivers for Vista. Obsolete downlevel except for limited " - "use in IFS. See the documentation")) - -#endif - -__drv_maxIRQL(DISPATCH_LEVEL) -DECLSPEC_DEPRECATED_DDK // Use IoQueueWorkItem -NTKERNELAPI -VOID -ExQueueWorkItem( - __inout __drv_aliasesMem PWORK_QUEUE_ITEM WorkItem, - __drv_strictTypeMatch(__drv_typeExpr) __in WORK_QUEUE_TYPE QueueType - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("nothing", - "Drivers should not be dependent on processor features") -NTKERNELAPI -BOOLEAN -ExIsProcessorFeaturePresent( - __in ULONG ProcessorFeature - ); - -#endif - - -// -// Define executive resource data structures. -// - -typedef ULONG_PTR ERESOURCE_THREAD; -typedef ERESOURCE_THREAD *PERESOURCE_THREAD; - -typedef struct _OWNER_ENTRY { - ERESOURCE_THREAD OwnerThread; - union { - struct { - ULONG IoPriorityBoosted : 1; - ULONG OwnerReferenced : 1; - ULONG OwnerCount : 30; - }; - ULONG TableSize; - }; - -} OWNER_ENTRY, *POWNER_ENTRY; - -typedef struct _ERESOURCE { - LIST_ENTRY SystemResourcesList; - POWNER_ENTRY OwnerTable; - - // - // ActiveEntries is the true, 32-bit count. Existing code - // checks for ActiveCount == 0, so this toggles between - // 0 and 1 and back as ActiveEntries goes from 0 to - // non-zero and back. - // - - SHORT ActiveCount; - USHORT Flag; - __volatile PKSEMAPHORE SharedWaiters; - __volatile PKEVENT ExclusiveWaiters; - - // - // If the resource is owned exclusive, OwnerEntry contains the - // resource owner. - // - // If the resource is owned shared, OwnerEntry may contain one - // of the shared owners. - // - - OWNER_ENTRY OwnerEntry; - ULONG ActiveEntries; - ULONG ContentionCount; - ULONG NumberOfSharedWaiters; - ULONG NumberOfExclusiveWaiters; - -#if defined(_WIN64) - - PVOID Reserved2; - -#endif - - union { - PVOID Address; - ULONG_PTR CreatorBackTraceIndex; - }; - - KSPIN_LOCK SpinLock; -} ERESOURCE, *PERESOURCE; -// -// Values for ERESOURCE.Flag -// - -#define ResourceNeverExclusive 0x10 -#define ResourceReleaseByOtherThread 0x20 -#define ResourceOwnedExclusive 0x80 - -#define RESOURCE_HASH_TABLE_SIZE 64 - -typedef struct _RESOURCE_HASH_ENTRY { - LIST_ENTRY ListEntry; - PVOID Address; - ULONG ContentionCount; - ULONG Number; -} RESOURCE_HASH_ENTRY, *PRESOURCE_HASH_ENTRY; - -typedef struct _RESOURCE_PERFORMANCE_DATA { - ULONG ActiveResourceCount; - ULONG TotalResourceCount; - ULONG ExclusiveAcquire; - ULONG SharedFirstLevel; - ULONG SharedSecondLevel; - ULONG StarveFirstLevel; - ULONG StarveSecondLevel; - ULONG WaitForExclusive; - ULONG OwnerTableExpands; - ULONG MaximumTableExpand; - LIST_ENTRY HashTable[RESOURCE_HASH_TABLE_SIZE]; -} RESOURCE_PERFORMANCE_DATA, *PRESOURCE_PERFORMANCE_DATA; - -// -// Define executive resource function prototypes. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ExInitializeResourceLite ( - __out PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ExReinitializeResourceLite ( - __inout PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -__drv_when(Wait!=0, __drv_valueIs(==1)) -__drv_when(Wait==0, __drv_valueIs(==0;==1) __checkReturn) -NTKERNELAPI -BOOLEAN -ExAcquireResourceSharedLite ( - __inout __deref __drv_neverHold(ExResourceType) - __deref __drv_when(return==1, __drv_acquiresResource(ExResourceType)) - PERESOURCE Resource, - __in BOOLEAN Wait - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA || NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -__drv_acquiresCriticalRegion -NTKERNELAPI -PVOID -ExEnterCriticalRegionAndAcquireResourceShared ( - __inout __deref __drv_acquiresExclusiveResource(ExResourceType) - PERESOURCE Resource - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -__drv_when(Wait!=0, __drv_valueIs(==1)) -__drv_when(Wait==0, __drv_valueIs(==0;==1) __checkReturn) -NTKERNELAPI -BOOLEAN -ExAcquireResourceExclusiveLite ( - __inout __deref __drv_neverHold(ExResourceType) - __deref __drv_when(return==1, __drv_acquiresResource(ExResourceType)) - PERESOURCE Resource, - __in __drv_constant BOOLEAN Wait - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA || NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -__drv_acquiresCriticalRegion -NTKERNELAPI -PVOID -ExEnterCriticalRegionAndAcquireResourceExclusive ( - __inout __deref __drv_acquiresExclusiveResource(ExResourceType) - PERESOURCE Resource - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -__drv_when(Wait!=0, __drv_valueIs(==1)) -__drv_when(Wait==0, __drv_valueIs(==0;==1) __checkReturn) -NTKERNELAPI -BOOLEAN -ExAcquireSharedStarveExclusive( - __inout __deref __drv_neverHold(ExResourceType) - __deref __drv_when(return!=0, __drv_acquiresResource(ExResourceType)) - PERESOURCE Resource, - __in BOOLEAN Wait - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -__drv_mustHoldCriticalRegion -__drv_when(Wait!=0, __drv_valueIs(==1)) -__drv_when(Wait==0, __drv_valueIs(==0;==1) __checkReturn) -NTKERNELAPI -BOOLEAN -ExAcquireSharedWaitForExclusive( - __inout __deref __drv_neverHold(ExResourceType) - __deref __drv_when(return!=0, __drv_acquiresResource(ExResourceType)) - PERESOURCE Resource, - __in BOOLEAN Wait - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA || NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -__drv_acquiresCriticalRegion -NTKERNELAPI -PVOID -ExEnterCriticalRegionAndAcquireSharedWaitForExclusive ( - __inout __deref __drv_acquiresExclusiveResource(ExResourceType) - PERESOURCE Resource - ); - -#endif - -// -// VOID -// ExReleaseResource( -// IN PERESOURCE Resource -// ); -// - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(ExReleaseResource) // Use ExReleaseResourceLite -#endif - -#define ExReleaseResource(R) (ExReleaseResourceLite(R)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_mustHoldCriticalRegion -NTKERNELAPI -VOID -FASTCALL -ExReleaseResourceLite( - __inout __deref __drv_releasesExclusiveResource(ExResourceType) - PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA || NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_releasesCriticalRegion -NTKERNELAPI -VOID -FASTCALL -ExReleaseResourceAndLeaveCriticalRegion( - __inout __deref __drv_releasesExclusiveResource(ExResourceType) - PERESOURCE Resource - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_mustHoldCriticalRegion -NTKERNELAPI -VOID -ExReleaseResourceForThreadLite( - __inout __deref __drv_releasesExclusiveResource(ExResourceType) - PERESOURCE Resource, - __in ERESOURCE_THREAD ResourceThreadId - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExSetResourceOwnerPointer( - __inout PERESOURCE Resource, - __in PVOID OwnerPointer - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExSetResourceOwnerPointerEx( - __inout PERESOURCE Resource, - __in PVOID OwnerPointer, - __in ULONG Flags - ); - -#define FLAG_OWNER_POINTER_IS_THREAD 0x1 - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExConvertExclusiveToSharedLite( - __inout __deref __drv_mustHold(ExResourceType) PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ExDeleteResourceLite ( - __inout PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -ULONG -ExGetExclusiveWaiterCount ( - __in PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -ULONG -ExGetSharedWaiterCount ( - __in PERESOURCE Resource - ); - -#endif - - -// -// ERESOURCE_THREAD -// ExGetCurrentResourceThread( -// VOID -// ); -// - -#define ExGetCurrentResourceThread() ((ULONG_PTR)PsGetCurrentThread()) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -ExIsResourceAcquiredExclusiveLite ( - __in PERESOURCE Resource - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -ULONG -ExIsResourceAcquiredSharedLite ( - __in PERESOURCE Resource - ); - -#endif - -// -// An acquired resource is always owned shared, as shared ownership is a subset -// of exclusive ownership. -// - -#define ExIsResourceAcquiredLite ExIsResourceAcquiredSharedLite - - -// -// Rundown protection structure -// - -typedef struct _EX_RUNDOWN_REF { - -#define EX_RUNDOWN_ACTIVE 0x1 -#define EX_RUNDOWN_COUNT_SHIFT 0x1 -#define EX_RUNDOWN_COUNT_INC (1<= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -KPROCESSOR_MODE -ExGetPreviousMode( - VOID - ); - -#endif - - -// -// Set timer resolution. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -ULONG -ExSetTimerResolution ( - __in ULONG DesiredTime, - __in BOOLEAN SetResolution - ); - -#endif - -// -// Subtract time zone bias from system time to get local time. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -VOID -ExSystemTimeToLocalTime ( - __in PLARGE_INTEGER SystemTime, - __out PLARGE_INTEGER LocalTime - ); - -#endif - -// -// Add time zone bias to local time to get system time. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -NTKERNELAPI -VOID -ExLocalTimeToSystemTime ( - __in PLARGE_INTEGER LocalTime, - __out PLARGE_INTEGER SystemTime - ); - -#endif - - -// -// Define the type for Callback function. -// - -typedef struct _CALLBACK_OBJECT *PCALLBACK_OBJECT; - -typedef -__drv_sameIRQL -__drv_functionClass(CALLBACK_FUNCTION) -VOID -CALLBACK_FUNCTION ( - __in_opt PVOID CallbackContext, - __in_opt PVOID Argument1, - __in_opt PVOID Argument2 - ); - -typedef CALLBACK_FUNCTION *PCALLBACK_FUNCTION; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -ExCreateCallback ( - __deref_out PCALLBACK_OBJECT *CallbackObject, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in BOOLEAN Create, - __in BOOLEAN AllowMultipleCallbacks - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -ExRegisterCallback ( - __inout PCALLBACK_OBJECT CallbackObject, - __in PCALLBACK_FUNCTION CallbackFunction, - __in_opt PVOID CallbackContext - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExUnregisterCallback ( - __inout PVOID CallbackRegistration - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -ExNotifyCallback ( - __in PVOID CallbackObject, - __in_opt PVOID Argument1, - __in_opt PVOID Argument2 - ); - -#endif - - -// -// suite support -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -BOOLEAN -ExVerifySuite( - __drv_strictTypeMatch(__drv_typeExpr) __in SUITE_TYPE SuiteType - ); - -#endif - - -// -// Rundown Locks -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -VOID -FASTCALL -ExInitializeRundownProtection ( - __out PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -VOID -FASTCALL -ExReInitializeRundownProtection ( - __inout PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -__checkReturn -__drv_valueIs(==0;==1) -NTKERNELAPI -BOOLEAN -FASTCALL -ExAcquireRundownProtection ( - __inout PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXPSP2 || NTDDI_VERSION >= NTDDI_WS03) - -__checkReturn -__drv_valueIs(==0;==1) -NTKERNELAPI -BOOLEAN -FASTCALL -ExAcquireRundownProtectionEx ( - __inout PEX_RUNDOWN_REF RunRef, - __in ULONG Count - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -VOID -FASTCALL -ExReleaseRundownProtection ( - __inout PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXPSP2 || NTDDI_VERSION >= NTDDI_WS03) - -NTKERNELAPI -VOID -FASTCALL -ExReleaseRundownProtectionEx ( - __inout PEX_RUNDOWN_REF RunRef, - __in ULONG Count - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -VOID -FASTCALL -ExRundownCompleted ( - __out PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) - -NTKERNELAPI -VOID -FASTCALL -ExWaitForRundownProtectionRelease ( - __inout PEX_RUNDOWN_REF RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PEX_RUNDOWN_REF_CACHE_AWARE -ExAllocateCacheAwareRundownProtection( - __drv_strictTypeMatch(__drv_typeExpr) __in POOL_TYPE PoolType, - __in ULONG PoolTag - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -SIZE_T -ExSizeOfRundownProtectionCacheAware( - VOID - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExInitializeRundownProtectionCacheAware( - __out PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, - __in SIZE_T RunRefSize - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ExFreeCacheAwareRundownProtection( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__checkReturn -__drv_valueIs(==0;==1) -NTKERNELAPI -BOOLEAN -FASTCALL -ExAcquireRundownProtectionCacheAware ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -NTKERNELAPI -VOID -FASTCALL -ExReleaseRundownProtectionCacheAware ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -__checkReturn -__drv_valueIs(==0;==1) -NTKERNELAPI -BOOLEAN -FASTCALL -ExAcquireRundownProtectionCacheAwareEx ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware, - __in ULONG Count - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -NTKERNELAPI -VOID -FASTCALL -ExReleaseRundownProtectionCacheAwareEx ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRef, - __in ULONG Count - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -NTKERNELAPI -VOID -FASTCALL -ExWaitForRundownProtectionReleaseCacheAware ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRef - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -NTKERNELAPI -VOID -FASTCALL -ExReInitializeRundownProtectionCacheAware ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware - ); - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) - -NTKERNELAPI -VOID -FASTCALL -ExRundownCompletedCacheAware ( - __inout PEX_RUNDOWN_REF_CACHE_AWARE RunRefCacheAware - ); - -#endif - - -// -// Define a block to hold the actual routine registration. -// - -typedef -__drv_sameIRQL -__drv_functionClass(EX_CALLBACK_FUNCTION) -NTSTATUS -EX_CALLBACK_FUNCTION ( - __in PVOID CallbackContext, - __in_opt PVOID Argument1, - __in_opt PVOID Argument2 - ); - -typedef EX_CALLBACK_FUNCTION *PEX_CALLBACK_FUNCTION; - - - -// -// Registry kernel mode callbacks -// - -// -// Hook selector -// -typedef enum _REG_NOTIFY_CLASS { - RegNtDeleteKey, - RegNtPreDeleteKey = RegNtDeleteKey, - RegNtSetValueKey, - RegNtPreSetValueKey = RegNtSetValueKey, - RegNtDeleteValueKey, - RegNtPreDeleteValueKey = RegNtDeleteValueKey, - RegNtSetInformationKey, - RegNtPreSetInformationKey = RegNtSetInformationKey, - RegNtRenameKey, - RegNtPreRenameKey = RegNtRenameKey, - RegNtEnumerateKey, - RegNtPreEnumerateKey = RegNtEnumerateKey, - RegNtEnumerateValueKey, - RegNtPreEnumerateValueKey = RegNtEnumerateValueKey, - RegNtQueryKey, - RegNtPreQueryKey = RegNtQueryKey, - RegNtQueryValueKey, - RegNtPreQueryValueKey = RegNtQueryValueKey, - RegNtQueryMultipleValueKey, - RegNtPreQueryMultipleValueKey = RegNtQueryMultipleValueKey, - RegNtPreCreateKey, - RegNtPostCreateKey, - RegNtPreOpenKey, - RegNtPostOpenKey, - RegNtKeyHandleClose, - RegNtPreKeyHandleClose = RegNtKeyHandleClose, - // - // .Net only - // - RegNtPostDeleteKey, - RegNtPostSetValueKey, - RegNtPostDeleteValueKey, - RegNtPostSetInformationKey, - RegNtPostRenameKey, - RegNtPostEnumerateKey, - RegNtPostEnumerateValueKey, - RegNtPostQueryKey, - RegNtPostQueryValueKey, - RegNtPostQueryMultipleValueKey, - RegNtPostKeyHandleClose, - RegNtPreCreateKeyEx, - RegNtPostCreateKeyEx, - RegNtPreOpenKeyEx, - RegNtPostOpenKeyEx, - // - // new to Windows Vista - // - RegNtPreFlushKey, - RegNtPostFlushKey, - RegNtPreLoadKey, - RegNtPostLoadKey, - RegNtPreUnLoadKey, - RegNtPostUnLoadKey, - RegNtPreQueryKeySecurity, - RegNtPostQueryKeySecurity, - RegNtPreSetKeySecurity, - RegNtPostSetKeySecurity, - // - // per-object context cleanup - // - RegNtCallbackObjectContextCleanup, - // - // new in Vista SP2 - // - RegNtPreRestoreKey, - RegNtPostRestoreKey, - RegNtPreSaveKey, - RegNtPostSaveKey, - RegNtPreReplaceKey, - RegNtPostReplaceKey, - - MaxRegNtNotifyClass //should always be the last enum -} REG_NOTIFY_CLASS; - -// -// Parameter description for each notify class -// -typedef struct _REG_DELETE_KEY_INFORMATION { - PVOID Object; // IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_DELETE_KEY_INFORMATION, *PREG_DELETE_KEY_INFORMATION -#if (NTDDI_VERSION >= NTDDI_VISTA) -, REG_FLUSH_KEY_INFORMATION, *PREG_FLUSH_KEY_INFORMATION -#endif // NTDDI_VERSION >= NTDDI_VISTA -; - -typedef struct _REG_SET_VALUE_KEY_INFORMATION { - PVOID Object; // IN - PUNICODE_STRING ValueName; // IN - ULONG TitleIndex; // IN - ULONG Type; // IN - PVOID Data; // IN - ULONG DataSize; // IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_SET_VALUE_KEY_INFORMATION, *PREG_SET_VALUE_KEY_INFORMATION; - -typedef struct _REG_DELETE_VALUE_KEY_INFORMATION { - PVOID Object; // IN - PUNICODE_STRING ValueName; // IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_DELETE_VALUE_KEY_INFORMATION, *PREG_DELETE_VALUE_KEY_INFORMATION; - -typedef struct _REG_SET_INFORMATION_KEY_INFORMATION { - PVOID Object; // IN - KEY_SET_INFORMATION_CLASS KeySetInformationClass; // IN - PVOID KeySetInformation; // IN - ULONG KeySetInformationLength;// IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_SET_INFORMATION_KEY_INFORMATION, *PREG_SET_INFORMATION_KEY_INFORMATION; - -typedef struct _REG_ENUMERATE_KEY_INFORMATION { - PVOID Object; // IN - ULONG Index; // IN - KEY_INFORMATION_CLASS KeyInformationClass; // IN - PVOID KeyInformation; // IN - ULONG Length; // IN - PULONG ResultLength; // OUT - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_ENUMERATE_KEY_INFORMATION, *PREG_ENUMERATE_KEY_INFORMATION; - -typedef struct _REG_ENUMERATE_VALUE_KEY_INFORMATION { - PVOID Object; // IN - ULONG Index; // IN - KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass; // IN - PVOID KeyValueInformation; // IN - ULONG Length; // IN - PULONG ResultLength; // OUT - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_ENUMERATE_VALUE_KEY_INFORMATION, *PREG_ENUMERATE_VALUE_KEY_INFORMATION; - -typedef struct _REG_QUERY_KEY_INFORMATION { - PVOID Object; // IN - KEY_INFORMATION_CLASS KeyInformationClass; // IN - PVOID KeyInformation; // IN - ULONG Length; // IN - PULONG ResultLength; // OUT - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_QUERY_KEY_INFORMATION, *PREG_QUERY_KEY_INFORMATION; - -typedef struct _REG_QUERY_VALUE_KEY_INFORMATION { - PVOID Object; // IN - PUNICODE_STRING ValueName; // IN - KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass; // IN - PVOID KeyValueInformation; // IN - ULONG Length; // IN - PULONG ResultLength; // OUT - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_QUERY_VALUE_KEY_INFORMATION, *PREG_QUERY_VALUE_KEY_INFORMATION; - -typedef struct _REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION { - PVOID Object; // IN - PKEY_VALUE_ENTRY ValueEntries; // IN - ULONG EntryCount; // IN - PVOID ValueBuffer; // IN - PULONG BufferLength; // IN OUT - PULONG RequiredBufferLength; // OUT - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION, *PREG_QUERY_MULTIPLE_VALUE_KEY_INFORMATION; - -typedef struct _REG_RENAME_KEY_INFORMATION { - PVOID Object; // IN - PUNICODE_STRING NewName; // IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_RENAME_KEY_INFORMATION, *PREG_RENAME_KEY_INFORMATION; - - -typedef struct _REG_KEY_HANDLE_CLOSE_INFORMATION { - PVOID Object; // IN - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext;// new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_KEY_HANDLE_CLOSE_INFORMATION, *PREG_KEY_HANDLE_CLOSE_INFORMATION; - -/* .Net Only */ -typedef struct _REG_CREATE_KEY_INFORMATION { - PUNICODE_STRING CompleteName; // IN - PVOID RootObject; // IN - PVOID ObjectType; // new to Windows Vista - ULONG CreateOptions;// new to Windows Vista - PUNICODE_STRING Class; // new to Windows Vista - PVOID SecurityDescriptor;// new to Windows Vista - PVOID SecurityQualityOfService;// new to Windows Vista - ACCESS_MASK DesiredAccess;// new to Windows Vista - ACCESS_MASK GrantedAccess;// new to Windows Vista - // to be filled in by callbacks - // when bypassing native code - PULONG Disposition; // new to Windows Vista - // on pass through, callback should fill - // in disposition - PVOID *ResultObject;// new to Windows Vista - // on pass through, callback should return - // object to be used for the return handle - PVOID CallContext; // new to Windows Vista - PVOID RootObjectContext; // new to Windows Vista - PVOID Transaction; // new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_CREATE_KEY_INFORMATION, REG_OPEN_KEY_INFORMATION,*PREG_CREATE_KEY_INFORMATION, *PREG_OPEN_KEY_INFORMATION; - -typedef struct _REG_CREATE_KEY_INFORMATION_V1 { - PUNICODE_STRING CompleteName; // IN - PVOID RootObject; // IN - PVOID ObjectType; // new to Windows Vista - ULONG Options; // new to Windows Vista - PUNICODE_STRING Class; // new to Windows Vista - PVOID SecurityDescriptor;// new to Windows Vista - PVOID SecurityQualityOfService;// new to Windows Vista - ACCESS_MASK DesiredAccess;// new to Windows Vista - ACCESS_MASK GrantedAccess;// new to Windows Vista - // to be filled in by callbacks - // when bypassing native code - PULONG Disposition; // new to Windows Vista - // on pass through, callback should fill - // in disposition - PVOID *ResultObject;// new to Windows Vista - // on pass through, callback should return - // object to be used for the return handle - PVOID CallContext; // new to Windows Vista - PVOID RootObjectContext; // new to Windows Vista - PVOID Transaction; // new to Windows Vista - - ULONG_PTR Version; // following is new to Windows 7 - PUNICODE_STRING RemainingName;// the true path left to parse - ULONG Wow64Flags; // Wow64 specific flags gotten from DesiredAccess input - ULONG Attributes; // ObjectAttributes->Attributes - KPROCESSOR_MODE CheckAccessMode; // mode used for the securiry checks -} REG_CREATE_KEY_INFORMATION_V1, REG_OPEN_KEY_INFORMATION_V1,*PREG_CREATE_KEY_INFORMATION_V1, *PREG_OPEN_KEY_INFORMATION_V1; - - - -typedef struct _REG_POST_OPERATION_INFORMATION { - PVOID Object; // IN - NTSTATUS Status; // IN - PVOID PreInformation; // new to Windows Vista; identical with the pre information that was sent - // in the pre notification - NTSTATUS ReturnStatus; // new to Windows Vista; callback can now change the outcome of the operation - // during post by returning the new staus here - PVOID CallContext; // new to Windows Vista - PVOID ObjectContext; // new to Windows Vista - PVOID Reserved; // new to Windows Vista -} REG_POST_OPERATION_INFORMATION,*PREG_POST_OPERATION_INFORMATION; -/* end .Net Only */ - -/* XP only */ -typedef struct _REG_PRE_CREATE_KEY_INFORMATION { - PUNICODE_STRING CompleteName; // IN -} REG_PRE_CREATE_KEY_INFORMATION, REG_PRE_OPEN_KEY_INFORMATION,*PREG_PRE_CREATE_KEY_INFORMATION, *PREG_PRE_OPEN_KEY_INFORMATION;; - -typedef struct _REG_POST_CREATE_KEY_INFORMATION { - PUNICODE_STRING CompleteName; // IN - PVOID Object; // IN - NTSTATUS Status; // IN -} REG_POST_CREATE_KEY_INFORMATION,REG_POST_OPEN_KEY_INFORMATION, *PREG_POST_CREATE_KEY_INFORMATION, *PREG_POST_OPEN_KEY_INFORMATION; -/* end XP only */ - -/* new to Windows Vista */ -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _REG_LOAD_KEY_INFORMATION { - PVOID Object; - PUNICODE_STRING KeyName; - PUNICODE_STRING SourceFile; - ULONG Flags; - PVOID TrustClassObject; - PVOID UserEvent; - ACCESS_MASK DesiredAccess; - PHANDLE RootHandle; - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_LOAD_KEY_INFORMATION, *PREG_LOAD_KEY_INFORMATION; - -typedef struct _REG_UNLOAD_KEY_INFORMATION { - PVOID Object; - PVOID UserEvent; - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_UNLOAD_KEY_INFORMATION, *PREG_UNLOAD_KEY_INFORMATION; - -typedef struct _REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION { - PVOID Object; - PVOID ObjectContext; - PVOID Reserved; -} REG_CALLBACK_CONTEXT_CLEANUP_INFORMATION, *PREG_CALLBACK_CONTEXT_CLEANUP_INFORMATION; - -typedef struct _REG_QUERY_KEY_SECURITY_INFORMATION { - PVOID Object; - PSECURITY_INFORMATION SecurityInformation; // IN - PSECURITY_DESCRIPTOR SecurityDescriptor; // INOUT - PULONG Length; // INOUT - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_QUERY_KEY_SECURITY_INFORMATION, *PREG_QUERY_KEY_SECURITY_INFORMATION; - -typedef struct _REG_SET_KEY_SECURITY_INFORMATION { - PVOID Object; - PSECURITY_INFORMATION SecurityInformation; // IN - PSECURITY_DESCRIPTOR SecurityDescriptor; // IN - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_SET_KEY_SECURITY_INFORMATION, *PREG_SET_KEY_SECURITY_INFORMATION; - -/* new in Vista SP2 - Restore, Save, Replace */ -typedef struct _REG_RESTORE_KEY_INFORMATION { - PVOID Object; - HANDLE FileHandle; - ULONG Flags; - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_RESTORE_KEY_INFORMATION, *PREG_RESTORE_KEY_INFORMATION; - -typedef struct _REG_SAVE_KEY_INFORMATION { - PVOID Object; - HANDLE FileHandle; - ULONG Format; - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_SAVE_KEY_INFORMATION, *PREG_SAVE_KEY_INFORMATION; - -typedef struct _REG_REPLACE_KEY_INFORMATION { - PVOID Object; - PUNICODE_STRING OldFileName; - PUNICODE_STRING NewFileName; - PVOID CallContext; - PVOID ObjectContext; - PVOID Reserved; -} REG_REPLACE_KEY_INFORMATION, *PREG_REPLACE_KEY_INFORMATION; -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -CmRegisterCallback(__in PEX_CALLBACK_FUNCTION Function, - __in_opt PVOID Context, - __out PLARGE_INTEGER Cookie - ); -NTKERNELAPI -NTSTATUS -__drv_maxIRQL(APC_LEVEL) -CmUnRegisterCallback(__in LARGE_INTEGER Cookie); - -#endif // NTDDI_VERSION >= NTDDI_WINXP - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -CmRegisterCallbackEx ( __in PEX_CALLBACK_FUNCTION Function, - __in PCUNICODE_STRING Altitude, - __in PVOID Driver, //PDRIVER_OBJECT - __in_opt PVOID Context, - __out PLARGE_INTEGER Cookie, - __reserved PVOID Reserved - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -CmGetCallbackVersion ( __out_opt PULONG Major, - __out_opt PULONG Minor - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -CmSetCallbackObjectContext (__inout PVOID Object, - __in PLARGE_INTEGER Cookie, - __in PVOID NewContext, - __out_opt PVOID *OldContext - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -CmCallbackGetKeyObjectID ( __in PLARGE_INTEGER Cookie, - __in PVOID Object, - __out_opt PULONG_PTR ObjectID, - __deref_opt_out PCUNICODE_STRING *ObjectName - ); - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -CmGetBoundTransaction(__in PLARGE_INTEGER Cookie, - __in PVOID Object ); - -#endif // NTDDI_VERSION >= NTDDI_VISTA - -// -// Priority increment definitions. The comment for each definition gives -// the names of the system services that use the definition when satisfying -// a wait. -// - -// -// Priority increment used when satisfying a wait on an executive event -// (NtPulseEvent and NtSetEvent) -// - -#define EVENT_INCREMENT 1 - -// -// Priority increment when no I/O has been done. This is used by device -// and file system drivers when completing an IRP (IoCompleteRequest). -// - -#define IO_NO_INCREMENT 0 - - -// -// Priority increment for completing CD-ROM I/O. This is used by CD-ROM device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_CD_ROM_INCREMENT 1 - -// -// Priority increment for completing disk I/O. This is used by disk device -// and file system drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_DISK_INCREMENT 1 - - - -// -// Priority increment for completing keyboard I/O. This is used by keyboard -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_KEYBOARD_INCREMENT 6 - - -// -// Priority increment for completing mailslot I/O. This is used by the mail- -// slot file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_MAILSLOT_INCREMENT 2 - - -// -// Priority increment for completing mouse I/O. This is used by mouse device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_MOUSE_INCREMENT 6 - - -// -// Priority increment for completing named pipe I/O. This is used by the -// named pipe file system driver when completing an IRP (IoCompleteRequest). -// - -#define IO_NAMED_PIPE_INCREMENT 2 - -// -// Priority increment for completing network I/O. This is used by network -// device and network file system drivers when completing an IRP -// (IoCompleteRequest). -// - -#define IO_NETWORK_INCREMENT 2 - - -// -// Priority increment for completing parallel I/O. This is used by parallel -// device drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_PARALLEL_INCREMENT 1 - -// -// Priority increment for completing serial I/O. This is used by serial device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SERIAL_INCREMENT 2 - -// -// Priority increment for completing sound I/O. This is used by sound device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_SOUND_INCREMENT 8 - -// -// Priority increment for completing video I/O. This is used by video device -// drivers when completing an IRP (IoCompleteRequest) -// - -#define IO_VIDEO_INCREMENT 1 - -// -// Priority increment used when satisfying a wait on an executive semaphore -// (NtReleaseSemaphore) -// - -#define SEMAPHORE_INCREMENT 1 - -// -// Indicates the system may do I/O to physical addresses above 4 GB. -// - -extern PBOOLEAN Mm64BitPhysicalAddress; - - -// -// Provides a known bad pointer address which always bugchecks if -// acccessed. This gives drivers a way to find pointer bugs by -// initializing invalid pointers to this value. -// - -extern PVOID MmBadPointer; - -// -// Define the old maximum disk transfer size to be used by MM and Cache -// Manager. Current transfer sizes can typically be much larger. -// - -#define MM_MAXIMUM_DISK_IO_SIZE (0x10000) - -//++ -// -// ULONG_PTR -// ROUND_TO_PAGES ( -// __in ULONG_PTR Size -// ) -// -// Routine Description: -// -// The ROUND_TO_PAGES macro takes a size in bytes and rounds it up to a -// multiple of the page size. -// -// NOTE: This macro fails for values 0xFFFFFFFF - (PAGE_SIZE - 1). -// -// Arguments: -// -// Size - Size in bytes to round up to a page multiple. -// -// Return Value: -// -// Returns the size rounded up to a multiple of the page size. -// -//-- - -#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1)) - -//++ -// -// ULONG -// BYTES_TO_PAGES ( -// __in ULONG Size -// ) -// -// Routine Description: -// -// The BYTES_TO_PAGES macro takes the size in bytes and calculates the -// number of pages required to contain the bytes. -// -// Arguments: -// -// Size - Size in bytes. -// -// Return Value: -// -// Returns the number of pages required to contain the specified size. -// -//-- - -#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + \ - (((Size) & (PAGE_SIZE - 1)) != 0)) - -//++ -// -// ULONG -// BYTE_OFFSET ( -// __in PVOID Va -// ) -// -// Routine Description: -// -// The BYTE_OFFSET macro takes a virtual address and returns the byte offset -// of that address within the page. -// -// Arguments: -// -// Va - Virtual address. -// -// Return Value: -// -// Returns the byte offset portion of the virtual address. -// -//-- - -#define BYTE_OFFSET(Va) ((ULONG)((LONG_PTR)(Va) & (PAGE_SIZE - 1))) - -//++ -// -// PVOID -// PAGE_ALIGN ( -// __in PVOID Va -// ) -// -// Routine Description: -// -// The PAGE_ALIGN macro takes a virtual address and returns a page-aligned -// virtual address for that page. -// -// Arguments: -// -// Va - Virtual address. -// -// Return Value: -// -// Returns the page aligned virtual address. -// -//-- - -#define PAGE_ALIGN(Va) ((PVOID)((ULONG_PTR)(Va) & ~(PAGE_SIZE - 1))) - -//++ -// -// ULONG -// ADDRESS_AND_SIZE_TO_SPAN_PAGES ( -// __in PVOID Va, -// __in ULONG Size -// ) -// -// Routine Description: -// -// The ADDRESS_AND_SIZE_TO_SPAN_PAGES macro takes a virtual address and -// size and returns the number of pages spanned by the size. -// -// Arguments: -// -// Va - Virtual address. -// -// Size - Size in bytes. -// -// Return Value: -// -// Returns the number of pages spanned by the size. -// -//-- - -#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va,Size) \ - ((ULONG)((((ULONG_PTR)(Size)) >> PAGE_SHIFT) + ((BYTE_OFFSET (Va) + BYTE_OFFSET (Size) + PAGE_SIZE - 1) >> PAGE_SHIFT))) - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(COMPUTE_PAGES_SPANNED) // Use ADDRESS_AND_SIZE_TO_SPAN_PAGES -#endif - -#define COMPUTE_PAGES_SPANNED(Va, Size) ADDRESS_AND_SIZE_TO_SPAN_PAGES(Va,Size) - - -//++ -// PPFN_NUMBER -// MmGetMdlPfnArray ( -// __in PMDL Mdl -// ) -// -// Routine Description: -// -// The MmGetMdlPfnArray routine returns the virtual address of the -// first element of the array of physical page numbers associated with -// the MDL. -// -// Arguments: -// -// Mdl - Pointer to an MDL. -// -// Return Value: -// -// Returns the virtual address of the first element of the array of -// physical page numbers associated with the MDL. -// -//-- - -#define MmGetMdlPfnArray(Mdl) ((PPFN_NUMBER)(Mdl + 1)) - -//++ -// -// PVOID -// MmGetMdlVirtualAddress ( -// __in PMDL Mdl -// ) -// -// Routine Description: -// -// The MmGetMdlVirtualAddress returns the virtual address of the buffer -// described by the Mdl. -// -// Arguments: -// -// Mdl - Pointer to an MDL. -// -// Return Value: -// -// Returns the virtual address of the buffer described by the Mdl -// -//-- - -#define MmGetMdlVirtualAddress(Mdl) \ - ((PVOID) ((PCHAR) ((Mdl)->StartVa) + (Mdl)->ByteOffset)) - -//++ -// -// ULONG -// MmGetMdlByteCount ( -// __in PMDL Mdl -// ) -// -// Routine Description: -// -// The MmGetMdlByteCount returns the length in bytes of the buffer -// described by the Mdl. -// -// Arguments: -// -// Mdl - Pointer to an MDL. -// -// Return Value: -// -// Returns the byte count of the buffer described by the Mdl -// -//-- - -#define MmGetMdlByteCount(Mdl) ((Mdl)->ByteCount) - -//++ -// -// ULONG -// MmGetMdlByteOffset ( -// __in PMDL Mdl -// ) -// -// Routine Description: -// -// The MmGetMdlByteOffset returns the byte offset within the page -// of the buffer described by the Mdl. -// -// Arguments: -// -// Mdl - Pointer to an MDL. -// -// Return Value: -// -// Returns the byte offset within the page of the buffer described by the Mdl -// -//-- - -#define MmGetMdlByteOffset(Mdl) ((Mdl)->ByteOffset) - -//++ -// -// PVOID -// MmGetMdlStartVa ( -// __in PMDL Mdl -// ) -// -// Routine Description: -// -// The MmGetMdlBaseVa returns the virtual address of the buffer -// described by the Mdl rounded down to the nearest page. -// -// Arguments: -// -// Mdl - Pointer to an MDL. -// -// Return Value: -// -// Returns the returns the starting virtual address of the MDL. -// -// -//-- - -#define MmGetMdlBaseVa(Mdl) ((Mdl)->StartVa) - -typedef enum _MM_SYSTEM_SIZE { - MmSmallSystem, - MmMediumSystem, - MmLargeSystem -} MM_SYSTEMSIZE; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -MM_SYSTEMSIZE -MmQuerySystemSize ( - VOID - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmIsVerifierEnabled ( - __out PULONG VerifierFlags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -MmAddVerifierThunks ( - __in_bcount (ThunkBufferSize) PVOID ThunkBuffer, - __in ULONG ThunkBufferSize - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -VOID -MmProbeAndLockProcessPages ( - __inout PMDL MemoryDescriptorList, - __in PEPROCESS Process, - __in KPROCESSOR_MODE AccessMode, - __in LOCK_OPERATION Operation - ); -#endif - -// -// I/O support routines. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmProbeAndLockPages ( - __inout PMDLX MemoryDescriptorList, - __in KPROCESSOR_MODE AccessMode, - __in LOCK_OPERATION Operation - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmUnlockPages ( - __inout PMDLX MemoryDescriptorList - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmBuildMdlForNonPagedPool ( - __inout PMDLX MemoryDescriptorList - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_preferredFunction("MmMapLockedPagesSpecifyCache", - "Obsolete except on Windows 98. Use MmGetSystemAddressForMdlSafe if this " - "is a call to MmGetSystemAddressForMdl.") -__drv_when(AccessMode==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(AccessMode==1, __drv_inTry __drv_maxIRQL(APC_LEVEL)) -DECLSPEC_DEPRECATED_DDK -NTKERNELAPI -PVOID -MmMapLockedPages ( - __in PMDL MemoryDescriptorList, - __in __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) - KPROCESSOR_MODE AccessMode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -__drv_maxIRQL (DISPATCH_LEVEL) -NTKERNELAPI -LOGICAL -MmIsIoSpaceActive ( - __in PHYSICAL_ADDRESS StartAddress, - __in SIZE_T NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PVOID -MmGetSystemRoutineAddress ( - __in PUNICODE_STRING SystemRoutineName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -MmAdvanceMdl ( - __inout PMDLX Mdl, - __in ULONG NumberOfBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -MmProtectMdlSystemAddress ( - __in PMDLX MemoryDescriptorList, - __in ULONG NewProtect - ); -#endif - -// -// _MM_PAGE_PRIORITY_ provides a method for the system to handle requests -// intelligently in low resource conditions. -// -// LowPagePriority should be used when it is acceptable to the driver for the -// mapping request to fail if the system is low on resources. An example of -// this could be for a non-critical network connection where the driver can -// handle the failure case when system resources are close to being depleted. -// -// NormalPagePriority should be used when it is acceptable to the driver for the -// mapping request to fail if the system is very low on resources. An example -// of this could be for a non-critical local filesystem request. -// -// HighPagePriority should be used when it is unacceptable to the driver for the -// mapping request to fail unless the system is completely out of resources. -// An example of this would be the paging file path in a driver. -// - - - -typedef enum _MM_PAGE_PRIORITY { - LowPagePriority, - NormalPagePriority = 16, - HighPagePriority = 32 -} MM_PAGE_PRIORITY; - - - -// -// Note: This function is not available in WDM 1.0 -// -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_when(AccessMode==0, __drv_maxIRQL(DISPATCH_LEVEL)) -__drv_when(AccessMode==1, __drv_inTry __drv_maxIRQL(APC_LEVEL)) -NTKERNELAPI -PVOID -MmMapLockedPagesSpecifyCache ( - __in PMDLX MemoryDescriptorList, - __in __drv_strictType(KPROCESSOR_MODE/enum _MODE,__drv_typeConst) - KPROCESSOR_MODE AccessMode, - __in __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType, - __in_opt PVOID BaseAddress, - __in ULONG BugCheckOnFailure, - __in __drv_strictTypeMatch(__drv_typeCond) MM_PAGE_PRIORITY Priority - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmUnmapLockedPages ( - __in PVOID BaseAddress, - __in PMDL MemoryDescriptorList - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateMappingAddress ( - __in SIZE_T NumberOfBytes, - __in ULONG PoolTag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -MmFreeMappingAddress ( - __in PVOID BaseAddress, - __in ULONG PoolTag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PVOID -MmMapLockedPagesWithReservedMapping ( - __in PVOID MappingAddress, - __in ULONG PoolTag, - __in PMDLX MemoryDescriptorList, - __in __drv_strictTypeMatch(__drv_typeCond) MEMORY_CACHING_TYPE CacheType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmUnmapReservedMapping ( - __in PVOID BaseAddress, - __in ULONG PoolTag, - __in PMDLX MemoryDescriptorList - ); -#endif - - -#define MM_DONT_ZERO_ALLOCATION 0x00000001 -#define MM_ALLOCATE_FROM_LOCAL_NODE_ONLY 0x00000002 -#define MM_ALLOCATE_FULLY_REQUIRED 0x00000004 -#define MM_ALLOCATE_NO_WAIT 0x00000008 -#define MM_ALLOCATE_PREFER_CONTIGUOUS 0x00000010 -#define MM_ALLOCATE_REQUIRE_CONTIGUOUS_CHUNKS 0x00000020 - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -__checkReturn -__drv_maxIRQL (DISPATCH_LEVEL) -NTKERNELAPI -PMDL -MmAllocatePagesForMdlEx ( - __in PHYSICAL_ADDRESS LowAddress, - __in PHYSICAL_ADDRESS HighAddress, - __in PHYSICAL_ADDRESS SkipBytes, - __in SIZE_T TotalBytes, - __in MEMORY_CACHING_TYPE CacheType, - __in ULONG Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PMDL -MmAllocatePagesForMdl ( - __in PHYSICAL_ADDRESS LowAddress, - __in PHYSICAL_ADDRESS HighAddress, - __in PHYSICAL_ADDRESS SkipBytes, - __in SIZE_T TotalBytes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmFreePagesFromMdl ( - __in PMDLX MemoryDescriptorList - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) -PVOID -MmMapIoSpace ( - __in PHYSICAL_ADDRESS PhysicalAddress, - __in SIZE_T NumberOfBytes, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmUnmapIoSpace ( - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__bcount (NumberOfBytes) PVOID -MmAllocateContiguousMemory ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS HighestAcceptableAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateContiguousMemorySpecifyCache ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS LowestAcceptableAddress, - __in PHYSICAL_ADDRESS HighestAcceptableAddress, - __in_opt PHYSICAL_ADDRESS BoundaryAddressMultiple, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - - - -typedef ULONG NODE_REQUIREMENT; - -#define MM_ANY_NODE_OK 0x80000000 - - - -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__out_bcount_opt (NumberOfBytes) PVOID -MmAllocateContiguousMemorySpecifyCacheNode ( - __in SIZE_T NumberOfBytes, - __in PHYSICAL_ADDRESS LowestAcceptableAddress, - __in PHYSICAL_ADDRESS HighestAcceptableAddress, - __in_opt PHYSICAL_ADDRESS BoundaryAddressMultiple, - __in MEMORY_CACHING_TYPE CacheType, - __in NODE_REQUIREMENT PreferredNode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmFreeContiguousMemory ( - __in PVOID BaseAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL (DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmFreeContiguousMemorySpecifyCache ( - __in_bcount (NumberOfBytes) PVOID BaseAddress, - __in SIZE_T NumberOfBytes, - __in MEMORY_CACHING_TYPE CacheType - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -SIZE_T -MmSizeOfMdl ( - __in_bcount_opt (Length) PVOID Base, - __in SIZE_T Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DECLSPEC_DEPRECATED_DDK // Use IoAllocateMdl -__drv_preferredFunction("IoAllocateMdl","Obsolete") -NTKERNELAPI -PMDL -MmCreateMdl ( - __in_opt PMDL MemoryDescriptorList, - __in_bcount_opt (Length) PVOID Base, - __in SIZE_T Length - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -MmLockPagableDataSection ( - __in PVOID AddressWithinSection - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -MmResetDriverPaging ( - __in PVOID AddressWithinSection - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -MmPageEntireDriver ( - __in PVOID AddressWithinSection - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -MmUnlockPagableImageSection ( - __in PVOID ImageSectionHandle - ); -#endif - - -//++ -// -// VOID -// MmInitializeMdl ( -// __in PMDL MemoryDescriptorList, -// __in PVOID BaseVa, -// __in SIZE_T Length -// ) -// -// Routine Description: -// -// This routine initializes the header of a Memory Descriptor List (MDL). -// -// Arguments: -// -// MemoryDescriptorList - Pointer to the MDL to initialize. -// -// BaseVa - Base virtual address mapped by the MDL. -// -// Length - Length, in bytes, of the buffer mapped by the MDL. -// -// Return Value: -// -// None. -// -//-- - -#define MmInitializeMdl(MemoryDescriptorList, BaseVa, Length) { \ - (MemoryDescriptorList)->Next = (PMDL) NULL; \ - (MemoryDescriptorList)->Size = (CSHORT)(sizeof(MDL) + \ - (sizeof(PFN_NUMBER) * ADDRESS_AND_SIZE_TO_SPAN_PAGES((BaseVa), (Length)))); \ - (MemoryDescriptorList)->MdlFlags = 0; \ - (MemoryDescriptorList)->StartVa = (PVOID) PAGE_ALIGN((BaseVa)); \ - (MemoryDescriptorList)->ByteOffset = BYTE_OFFSET((BaseVa)); \ - (MemoryDescriptorList)->ByteCount = (ULONG)(Length); \ - } - -//++ -// -// PVOID -// MmGetSystemAddressForMdlSafe ( -// __in PMDL MDL, -// __in MM_PAGE_PRIORITY PRIORITY -// ) -// -// Routine Description: -// -// This routine returns the mapped address of an MDL. If the -// Mdl is not already mapped or a system address, it is mapped. -// -// Arguments: -// -// MemoryDescriptorList - Pointer to the MDL to map. -// -// Priority - Supplies an indication as to how important it is that this -// request succeed under low available PTE conditions. -// -// Return Value: -// -// Returns the base address where the pages are mapped. The base address -// has the same offset as the virtual address in the MDL. -// -// Unlike MmGetSystemAddressForMdl, Safe guarantees that it will always -// return NULL on failure instead of bugchecking the system. -// -// This macro is not usable by WDM 1.0 drivers as 1.0 did not include -// MmMapLockedPagesSpecifyCache. The solution for WDM 1.0 drivers is to -// provide synchronization and set/reset the MDL_MAPPING_CAN_FAIL bit. -// -//-- - -#define MmGetSystemAddressForMdlSafe(MDL, PRIORITY) \ - (((MDL)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | \ - MDL_SOURCE_IS_NONPAGED_POOL)) ? \ - ((MDL)->MappedSystemVa) : \ - (MmMapLockedPagesSpecifyCache((MDL), \ - KernelMode, \ - MmCached, \ - NULL, \ - FALSE, \ - (PRIORITY)))) - -//++ -// -// PVOID -// MmGetSystemAddressForMdl ( -// __in PMDL MDL -// ) -// -// Routine Description: -// -// This routine returns the mapped address of an MDL, if the -// Mdl is not already mapped or a system address, it is mapped. -// -// Arguments: -// -// MemoryDescriptorList - Pointer to the MDL to map. -// -// Return Value: -// -// Returns the base address where the pages are mapped. The base address -// has the same offset as the virtual address in the MDL. -// -//-- - -//#define MmGetSystemAddressForMdl(MDL) -// (((MDL)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA)) ? -// ((MDL)->MappedSystemVa) : -// ((((MDL)->MdlFlags & (MDL_SOURCE_IS_NONPAGED_POOL)) ? -// ((PVOID)((ULONG)(MDL)->StartVa | (MDL)->ByteOffset)) : -// (MmMapLockedPages((MDL),KernelMode))))) - -#if PRAGMA_DEPRECATED_DDK -#pragma deprecated(MmGetSystemAddressForMdl) // Use MmGetSystemAddressForMdlSafe -#endif - -#define MmGetSystemAddressForMdl(MDL) \ - (((MDL)->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | \ - MDL_SOURCE_IS_NONPAGED_POOL)) ? \ - ((MDL)->MappedSystemVa) : \ - (MmMapLockedPages((MDL),KernelMode))) - -//++ -// -// VOID -// MmPrepareMdlForReuse ( -// __in PMDL MDL -// ) -// -// Routine Description: -// -// This routine will take all of the steps necessary to allow an MDL to be -// re-used. -// -// Arguments: -// -// MemoryDescriptorList - Pointer to the MDL that will be re-used. -// -// Return Value: -// -// None. -// -//-- - -#define MmPrepareMdlForReuse(MDL) \ - if (((MDL)->MdlFlags & MDL_PARTIAL_HAS_BEEN_MAPPED) != 0) { \ - ASSERT(((MDL)->MdlFlags & MDL_PARTIAL) != 0); \ - MmUnmapLockedPages( (MDL)->MappedSystemVa, (MDL) ); \ - } else if (((MDL)->MdlFlags & MDL_PARTIAL) == 0) { \ - ASSERT(((MDL)->MdlFlags & MDL_MAPPED_TO_SYSTEM_VA) == 0); \ - } - -typedef NTSTATUS (*PMM_DLL_INITIALIZE) ( - __in PUNICODE_STRING RegistryPath - ); - -typedef NTSTATUS (*PMM_DLL_UNLOAD) ( - VOID - ); - - - -// -// Define an empty typedef for the _DRIVER_OBJECT structure so it may be -// referenced by function types before it is actually defined. -// -struct _DRIVER_OBJECT; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -LOGICAL -MmIsDriverVerifying ( - __in struct _DRIVER_OBJECT *DriverObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -LOGICAL -MmIsDriverVerifyingByAddress ( - __in PVOID AddressWithinSection - ); -#endif - -// -// Security operation codes -// - -typedef enum _SECURITY_OPERATION_CODE { - SetSecurityDescriptor, - QuerySecurityDescriptor, - DeleteSecurityDescriptor, - AssignSecurityDescriptor - } SECURITY_OPERATION_CODE, *PSECURITY_OPERATION_CODE; - -// -// Data structure used to capture subject security context -// for access validations and auditing. -// -// THE FIELDS OF THIS DATA STRUCTURE SHOULD BE CONSIDERED OPAQUE -// BY ALL EXCEPT THE SECURITY ROUTINES. -// - -typedef struct _SECURITY_SUBJECT_CONTEXT { - PACCESS_TOKEN ClientToken; - SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; - PACCESS_TOKEN PrimaryToken; - PVOID ProcessAuditId; - } SECURITY_SUBJECT_CONTEXT, *PSECURITY_SUBJECT_CONTEXT; - -/////////////////////////////////////////////////////////////////////////////// -// // -// ACCESS_STATE and related structures // -// // -/////////////////////////////////////////////////////////////////////////////// - -// -// Initial Privilege Set - Room for three privileges, which should -// be enough for most applications. This structure exists so that -// it can be imbedded in an ACCESS_STATE structure. Use PRIVILEGE_SET -// for all other references to Privilege sets. -// - -#define INITIAL_PRIVILEGE_COUNT 3 - -typedef struct _INITIAL_PRIVILEGE_SET { - ULONG PrivilegeCount; - ULONG Control; - LUID_AND_ATTRIBUTES Privilege[INITIAL_PRIVILEGE_COUNT]; - } INITIAL_PRIVILEGE_SET, * PINITIAL_PRIVILEGE_SET; - - - -// -// Combine the information that describes the state -// of an access-in-progress into a single structure -// - - -typedef struct _ACCESS_STATE { - LUID OperationID; // Currently unused, replaced by TransactionId in AUX_ACCESS_DATA - BOOLEAN SecurityEvaluated; - BOOLEAN GenerateAudit; - BOOLEAN GenerateOnClose; - BOOLEAN PrivilegesAllocated; - ULONG Flags; - ACCESS_MASK RemainingDesiredAccess; - ACCESS_MASK PreviouslyGrantedAccess; - ACCESS_MASK OriginalDesiredAccess; - SECURITY_SUBJECT_CONTEXT SubjectSecurityContext; - PSECURITY_DESCRIPTOR SecurityDescriptor; // it stores SD supplied by caller when creating a new object. - PVOID AuxData; - union { - INITIAL_PRIVILEGE_SET InitialPrivilegeSet; - PRIVILEGE_SET PrivilegeSet; - } Privileges; - - BOOLEAN AuditPrivileges; - UNICODE_STRING ObjectName; - UNICODE_STRING ObjectTypeName; - - } ACCESS_STATE, *PACCESS_STATE; - - -typedef VOID -(*PNTFS_DEREF_EXPORTED_SECURITY_DESCRIPTOR)( - __in PVOID Vcb, - __in PSECURITY_DESCRIPTOR SecurityDescriptor); - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeCaptureSubjectContext ( - __out PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeLockSubjectContext( - __in PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeUnlockSubjectContext( - __in PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -SeReleaseSubjectContext ( - __inout PSECURITY_SUBJECT_CONTEXT SubjectContext - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -SeAssignSecurity ( - __in_opt PSECURITY_DESCRIPTOR ParentDescriptor, - __in_opt PSECURITY_DESCRIPTOR ExplicitDescriptor, - __out PSECURITY_DESCRIPTOR *NewDescriptor, - __in BOOLEAN IsDirectoryObject, - __in PSECURITY_SUBJECT_CONTEXT SubjectContext, - __in PGENERIC_MAPPING GenericMapping, - __in POOL_TYPE PoolType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -ULONG -SeComputeAutoInheritByObjectType( - __in PVOID ObjectType, - __in_opt PSECURITY_DESCRIPTOR SecurityDescriptor, - __in_opt PSECURITY_DESCRIPTOR ParentSecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -SeAssignSecurityEx ( - __in_opt PSECURITY_DESCRIPTOR ParentDescriptor, - __in_opt PSECURITY_DESCRIPTOR ExplicitDescriptor, - __out PSECURITY_DESCRIPTOR *NewDescriptor, - __in_opt GUID *ObjectType, - __in BOOLEAN IsDirectoryObject, - __in ULONG AutoInheritFlags, - __in PSECURITY_SUBJECT_CONTEXT SubjectContext, - __in PGENERIC_MAPPING GenericMapping, - __in POOL_TYPE PoolType - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -SeDeassignSecurity ( - __deref_inout PSECURITY_DESCRIPTOR *SecurityDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -ULONG -SeObjectCreateSaclAccessBits( - __in PSECURITY_DESCRIPTOR SecurityDescriptor - ); - -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -SeAccessCheck ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext, - __in BOOLEAN SubjectContextLocked, - __in ACCESS_MASK DesiredAccess, - __in ACCESS_MASK PreviouslyGrantedAccess, - __deref_opt_out PPRIVILEGE_SET *Privileges, - __in PGENERIC_MAPPING GenericMapping, - __in KPROCESSOR_MODE AccessMode, - __out PACCESS_MASK GrantedAccess, - __out PNTSTATUS AccessStatus - ); -#endif - - -#ifdef SE_NTFS_WORLD_CACHE - -#if (NTDDI_VERSION >= NTDDI_VISTA) -VOID -SeGetWorldRights ( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in PGENERIC_MAPPING GenericMapping, - __out PACCESS_MASK GrantedAccess - ); -#endif - -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -NTSTATUS -SeSetAuditParameter( - __inout PSE_ADT_PARAMETER_ARRAY AuditParameters, - __in SE_ADT_PARAMETER_TYPE Type, - __in ULONG Index, - __in PVOID Data - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -NTSTATUS -SeReportSecurityEvent( - __in ULONG Flags, - __in PUNICODE_STRING SourceName, - __in_opt PSID UserSid, - __in PSE_ADT_PARAMETER_ARRAY AuditParameters - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -BOOLEAN -SeValidSecurityDescriptor( - __in ULONG Length, - __in_bcount(Length) PSECURITY_DESCRIPTOR SecurityDescriptor - ); -#endif - - -#if !defined(_PSGETCURRENTTHREAD_) - -#define _PSGETCURRENTTHREAD_ - -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -PETHREAD -PsGetCurrentThread ( - VOID - ) - -/*++ - -Routine Description: - - This function returns a pointer to the current executive thread object. - -Arguments: - - None. - -Return Value: - - A pointer to the current executive thread object. - ---*/ - -{ - - return (PETHREAD)KeGetCurrentThread(); -} - -#endif - -// -// System Thread and Process Creation and Termination -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_valueIs(==0;<0) -NTKERNELAPI -__checkReturn -NTSTATUS -PsCreateSystemThread( - __out PHANDLE ThreadHandle, - __in ULONG DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt HANDLE ProcessHandle, - __out_opt PCLIENT_ID ClientId, - __in PKSTART_ROUTINE StartRoutine, - __in_opt __drv_when(return==0, __drv_aliasesMem) PVOID StartContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -PsTerminateSystemThread( - __in NTSTATUS ExitStatus - ); -#endif - -NTKERNELAPI -NTSTATUS -PsWrapApcWow64Thread ( - __inout PVOID *ApcContext, - __inout PVOID *ApcRoutine); - - -// -// Define I/O system data structure type codes. Each major data structure in -// the I/O system has a type code The type field in each structure is at the -// same offset. The following values can be used to determine which type of -// data structure a pointer refers to. -// - -#define IO_TYPE_ADAPTER 0x00000001 -#define IO_TYPE_CONTROLLER 0x00000002 -#define IO_TYPE_DEVICE 0x00000003 -#define IO_TYPE_DRIVER 0x00000004 -#define IO_TYPE_FILE 0x00000005 -#define IO_TYPE_IRP 0x00000006 -#define IO_TYPE_MASTER_ADAPTER 0x00000007 -#define IO_TYPE_OPEN_PACKET 0x00000008 -#define IO_TYPE_TIMER 0x00000009 -#define IO_TYPE_VPB 0x0000000a -#define IO_TYPE_ERROR_LOG 0x0000000b -#define IO_TYPE_ERROR_MESSAGE 0x0000000c -#define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0000000d - - -// -// Define the major function codes for IRPs. -// - - -#define IRP_MJ_CREATE 0x00 -#define IRP_MJ_CREATE_NAMED_PIPE 0x01 -#define IRP_MJ_CLOSE 0x02 -#define IRP_MJ_READ 0x03 -#define IRP_MJ_WRITE 0x04 -#define IRP_MJ_QUERY_INFORMATION 0x05 -#define IRP_MJ_SET_INFORMATION 0x06 -#define IRP_MJ_QUERY_EA 0x07 -#define IRP_MJ_SET_EA 0x08 -#define IRP_MJ_FLUSH_BUFFERS 0x09 -#define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a -#define IRP_MJ_SET_VOLUME_INFORMATION 0x0b -#define IRP_MJ_DIRECTORY_CONTROL 0x0c -#define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d -#define IRP_MJ_DEVICE_CONTROL 0x0e -#define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f -#define IRP_MJ_SHUTDOWN 0x10 -#define IRP_MJ_LOCK_CONTROL 0x11 -#define IRP_MJ_CLEANUP 0x12 -#define IRP_MJ_CREATE_MAILSLOT 0x13 -#define IRP_MJ_QUERY_SECURITY 0x14 -#define IRP_MJ_SET_SECURITY 0x15 -#define IRP_MJ_POWER 0x16 -#define IRP_MJ_SYSTEM_CONTROL 0x17 -#define IRP_MJ_DEVICE_CHANGE 0x18 -#define IRP_MJ_QUERY_QUOTA 0x19 -#define IRP_MJ_SET_QUOTA 0x1a -#define IRP_MJ_PNP 0x1b -#define IRP_MJ_PNP_POWER IRP_MJ_PNP // Obsolete.... -#define IRP_MJ_MAXIMUM_FUNCTION 0x1b - -// -// Make the Scsi major code the same as internal device control. -// - -#define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL - -// -// Define the minor function codes for IRPs. The lower 128 codes, from 0x00 to -// 0x7f are reserved to Microsoft. The upper 128 codes, from 0x80 to 0xff, are -// reserved to customers of Microsoft. -// - -// -// Device Control Request minor function codes for SCSI support. Note that -// user requests are assumed to be zero. -// - -#define IRP_MN_SCSI_CLASS 0x01 - -// -// PNP minor function codes. -// - -#define IRP_MN_START_DEVICE 0x00 -#define IRP_MN_QUERY_REMOVE_DEVICE 0x01 -#define IRP_MN_REMOVE_DEVICE 0x02 -#define IRP_MN_CANCEL_REMOVE_DEVICE 0x03 -#define IRP_MN_STOP_DEVICE 0x04 -#define IRP_MN_QUERY_STOP_DEVICE 0x05 -#define IRP_MN_CANCEL_STOP_DEVICE 0x06 - -#define IRP_MN_QUERY_DEVICE_RELATIONS 0x07 -#define IRP_MN_QUERY_INTERFACE 0x08 -#define IRP_MN_QUERY_CAPABILITIES 0x09 -#define IRP_MN_QUERY_RESOURCES 0x0A -#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B -#define IRP_MN_QUERY_DEVICE_TEXT 0x0C -#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D - -#define IRP_MN_READ_CONFIG 0x0F -#define IRP_MN_WRITE_CONFIG 0x10 -#define IRP_MN_EJECT 0x11 -#define IRP_MN_SET_LOCK 0x12 -#define IRP_MN_QUERY_ID 0x13 -#define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14 -#define IRP_MN_QUERY_BUS_INFORMATION 0x15 -#define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16 -#define IRP_MN_SURPRISE_REMOVAL 0x17 - -#if (NTDDI_VERSION >= NTDDI_WIN7) -#define IRP_MN_DEVICE_ENUMERATED 0x19 -#endif - - -// -// POWER minor function codes -// -#define IRP_MN_WAIT_WAKE 0x00 -#define IRP_MN_POWER_SEQUENCE 0x01 -#define IRP_MN_SET_POWER 0x02 -#define IRP_MN_QUERY_POWER 0x03 - - -// -// WMI minor function codes under IRP_MJ_SYSTEM_CONTROL -// - -#define IRP_MN_QUERY_ALL_DATA 0x00 -#define IRP_MN_QUERY_SINGLE_INSTANCE 0x01 -#define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02 -#define IRP_MN_CHANGE_SINGLE_ITEM 0x03 -#define IRP_MN_ENABLE_EVENTS 0x04 -#define IRP_MN_DISABLE_EVENTS 0x05 -#define IRP_MN_ENABLE_COLLECTION 0x06 -#define IRP_MN_DISABLE_COLLECTION 0x07 -#define IRP_MN_REGINFO 0x08 -#define IRP_MN_EXECUTE_METHOD 0x09 -// Minor code 0x0a is reserved -#define IRP_MN_REGINFO_EX 0x0b -// Minor code 0x0c is reserved - - - -// -// Define option flags for IoCreateFile. Note that these values must be -// exactly the same as the SL_... flags for a create function. Note also -// that there are flags that may be passed to IoCreateFile that are not -// placed in the stack location for the create IRP. These flags start in -// the next byte. -// - -#define IO_FORCE_ACCESS_CHECK 0x0001 -#define IO_NO_PARAMETER_CHECKING 0x0100 - -// -// Define Information fields for whether or not a REPARSE or a REMOUNT has -// occurred in the file system. -// - -#define IO_REPARSE 0x0 -#define IO_REMOUNT 0x1 - -// -// Define the objects that can be created by IoCreateFile. -// - -typedef enum _CREATE_FILE_TYPE { - CreateFileTypeNone, - CreateFileTypeNamedPipe, - CreateFileTypeMailslot -} CREATE_FILE_TYPE; - -// -// Define the structures used by the I/O system -// - -// -// Define empty typedefs for the _IRP, _DEVICE_OBJECT, and _DRIVER_OBJECT -// structures so they may be referenced by function types before they are -// actually defined. -// -struct _DEVICE_DESCRIPTION; -struct _DEVICE_OBJECT; -struct _DMA_ADAPTER; -struct _DRIVER_OBJECT; -struct _DRIVE_LAYOUT_INFORMATION; -struct _DISK_PARTITION; - -struct _FILE_OBJECT; - -#if defined(_WIN64) -#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8) -#else -#define POINTER_ALIGNMENT -#endif - -struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) _IRP; -struct _SCSI_REQUEST_BLOCK; -struct _SCATTER_GATHER_LIST; - -// -// Define the I/O version of a DPC routine. -// - -__drv_functionClass(IO_DPC_ROUTINE) -__drv_minFunctionIRQL(DISPATCH_LEVEL) -__drv_requiresIRQL(DISPATCH_LEVEL) -__drv_sameIRQL -typedef -VOID -IO_DPC_ROUTINE ( - __in PKDPC Dpc, - __in struct _DEVICE_OBJECT *DeviceObject, - __inout struct _IRP *Irp, - __in_opt PVOID Context - ); - -typedef IO_DPC_ROUTINE *PIO_DPC_ROUTINE; - -// -// Define driver timer routine type. -// - -__drv_functionClass(IO_TIMER_ROUTINE) -__drv_sameIRQL -typedef -VOID -IO_TIMER_ROUTINE ( - __in struct _DEVICE_OBJECT *DeviceObject, - __in_opt PVOID Context - ); - -typedef IO_TIMER_ROUTINE *PIO_TIMER_ROUTINE; - -// -// Define driver initialization routine type. -// -__drv_functionClass(DRIVER_INITIALIZE) -__drv_sameIRQL -typedef -NTSTATUS -DRIVER_INITIALIZE ( - __in struct _DRIVER_OBJECT *DriverObject, - __in PUNICODE_STRING RegistryPath - ); - -typedef DRIVER_INITIALIZE *PDRIVER_INITIALIZE; - -// -// Define driver cancel routine type. -// - -__drv_functionClass(DRIVER_CANCEL) -__drv_mustHoldCancelSpinLock -__drv_releasesCancelSpinLock -__drv_minFunctionIRQL(DISPATCH_LEVEL) -__drv_requiresIRQL(DISPATCH_LEVEL) -typedef -VOID -DRIVER_CANCEL ( - __inout struct _DEVICE_OBJECT *DeviceObject, - __inout __drv_useCancelIRQL struct _IRP *Irp - ); - -typedef DRIVER_CANCEL *PDRIVER_CANCEL; - -// -// Define driver dispatch routine type. -// - -__drv_functionClass(DRIVER_DISPATCH) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef -NTSTATUS -DRIVER_DISPATCH ( - __in struct _DEVICE_OBJECT *DeviceObject, - __inout struct _IRP *Irp - ); - -typedef DRIVER_DISPATCH *PDRIVER_DISPATCH; - -// -// Define driver start I/O routine type. -// - -__drv_functionClass(DRIVER_STARTIO) -__drv_minFunctionIRQL(DISPATCH_LEVEL) -__drv_requiresIRQL(DISPATCH_LEVEL) -__drv_sameIRQL -typedef -VOID -DRIVER_STARTIO ( - __inout struct _DEVICE_OBJECT *DeviceObject, - __inout struct _IRP *Irp - ); - -typedef DRIVER_STARTIO *PDRIVER_STARTIO; - -// -// Define driver unload routine type. -// -__drv_functionClass(DRIVER_UNLOAD) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef -VOID -DRIVER_UNLOAD ( - __in struct _DRIVER_OBJECT *DriverObject - ); - -typedef DRIVER_UNLOAD *PDRIVER_UNLOAD; - -// -// Define driver AddDevice routine type. -// - -__drv_functionClass(DRIVER_ADD_DEVICE) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -__drv_when(return>=0, __drv_clearDoInit(yes)) -typedef -NTSTATUS -DRIVER_ADD_DEVICE ( - __in struct _DRIVER_OBJECT *DriverObject, - __in struct _DEVICE_OBJECT *PhysicalDeviceObject - ); - -typedef DRIVER_ADD_DEVICE *PDRIVER_ADD_DEVICE; - - -// -// Define fast I/O procedure prototypes. -// -// Fast I/O read and write procedures. -// - -__drv_functionClass(FAST_IO_CHECK_IF_POSSIBLE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_CHECK_IF_POSSIBLE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in ULONG LockKey, - __in BOOLEAN CheckForReadOperation, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_CHECK_IF_POSSIBLE *PFAST_IO_CHECK_IF_POSSIBLE; - -__drv_functionClass(FAST_IO_READ) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_READ ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in ULONG LockKey, - __out PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_READ *PFAST_IO_READ; - -__drv_functionClass(FAST_IO_WRITE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_WRITE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in BOOLEAN Wait, - __in ULONG LockKey, - __in PVOID Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_WRITE *PFAST_IO_WRITE; - -// -// Fast I/O query basic and standard information procedures. -// - -__drv_functionClass(FAST_IO_QUERY_BASIC_INFO) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_QUERY_BASIC_INFO ( - __in struct _FILE_OBJECT *FileObject, - __in BOOLEAN Wait, - __out PFILE_BASIC_INFORMATION Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_QUERY_BASIC_INFO *PFAST_IO_QUERY_BASIC_INFO; - -__drv_functionClass(FAST_IO_QUERY_STANDARD_INFO) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_QUERY_STANDARD_INFO ( - __in struct _FILE_OBJECT *FileObject, - __in BOOLEAN Wait, - __out PFILE_STANDARD_INFORMATION Buffer, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_QUERY_STANDARD_INFO *PFAST_IO_QUERY_STANDARD_INFO; - -// -// Fast I/O lock and unlock procedures. -// - -__drv_functionClass(FAST_IO_LOCK) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_LOCK ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in PLARGE_INTEGER Length, - __in PEPROCESS ProcessId, - __in ULONG Key, - __in BOOLEAN FailImmediately, - __in BOOLEAN ExclusiveLock, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_LOCK *PFAST_IO_LOCK; - -__drv_functionClass(FAST_IO_UNLOCK_SINGLE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_UNLOCK_SINGLE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in PLARGE_INTEGER Length, - __in PEPROCESS ProcessId, - __in ULONG Key, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_UNLOCK_SINGLE *PFAST_IO_UNLOCK_SINGLE; - -__drv_functionClass(FAST_IO_UNLOCK_ALL) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_UNLOCK_ALL ( - __in struct _FILE_OBJECT *FileObject, - __in PEPROCESS ProcessId, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_UNLOCK_ALL *PFAST_IO_UNLOCK_ALL; - -__drv_functionClass(FAST_IO_UNLOCK_ALL_BY_KEY) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_UNLOCK_ALL_BY_KEY ( - __in struct _FILE_OBJECT *FileObject, - __in PVOID ProcessId, - __in ULONG Key, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_UNLOCK_ALL_BY_KEY *PFAST_IO_UNLOCK_ALL_BY_KEY; - -// -// Fast I/O device control procedure. -// - -__drv_functionClass(FAST_IO_DEVICE_CONTROL) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_DEVICE_CONTROL ( - __in struct _FILE_OBJECT *FileObject, - __in BOOLEAN Wait, - __in_opt PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_opt PVOID OutputBuffer, - __in ULONG OutputBufferLength, - __in ULONG IoControlCode, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_DEVICE_CONTROL *PFAST_IO_DEVICE_CONTROL; - -// -// Define callbacks for NtCreateSection to synchronize correctly with -// the file system. It pre-acquires the resources that will be needed -// when calling to query and set file/allocation size in the file system. -// - -__drv_functionClass(FAST_IO_ACQUIRE_FILE) -__drv_sameIRQL -typedef -VOID -FAST_IO_ACQUIRE_FILE ( - __in struct _FILE_OBJECT *FileObject - ); - -typedef FAST_IO_ACQUIRE_FILE *PFAST_IO_ACQUIRE_FILE; - -__drv_functionClass(FAST_IO_RELEASE_FILE) -__drv_sameIRQL -typedef -VOID -FAST_IO_RELEASE_FILE ( - __in struct _FILE_OBJECT *FileObject - ); - -typedef FAST_IO_RELEASE_FILE *PFAST_IO_RELEASE_FILE; - -// -// Define callback for drivers that have device objects attached to lower- -// level drivers' device objects. This callback is made when the lower-level -// driver is deleting its device object. -// - -__drv_functionClass(FAST_IO_DETACH_DEVICE) -__drv_sameIRQL -typedef -VOID -FAST_IO_DETACH_DEVICE ( - __in struct _DEVICE_OBJECT *SourceDevice, - __in struct _DEVICE_OBJECT *TargetDevice - ); - -typedef FAST_IO_DETACH_DEVICE *PFAST_IO_DETACH_DEVICE; - -// -// This structure is used by the server to quickly get the information needed -// to service a server open call. It is takes what would be two fast io calls -// one for basic information and the other for standard information and makes -// it into one call. -// - -__drv_functionClass(FAST_IO_QUERY_NETWORK_OPEN_INFO) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_QUERY_NETWORK_OPEN_INFO ( - __in struct _FILE_OBJECT *FileObject, - __in BOOLEAN Wait, - __out struct _FILE_NETWORK_OPEN_INFORMATION *Buffer, - __out struct _IO_STATUS_BLOCK *IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_QUERY_NETWORK_OPEN_INFO *PFAST_IO_QUERY_NETWORK_OPEN_INFO; - -// -// Define Mdl-based routines for the server to call -// - -__drv_functionClass(FAST_IO_MDL_READ) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_MDL_READ ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_MDL_READ *PFAST_IO_MDL_READ; - -__drv_functionClass(FAST_IO_MDL_READ_COMPLETE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_MDL_READ_COMPLETE ( - __in struct _FILE_OBJECT *FileObject, - __in PMDL MdlChain, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_MDL_READ_COMPLETE *PFAST_IO_MDL_READ_COMPLETE; - -__drv_functionClass(FAST_IO_PREPARE_MDL_WRITE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_PREPARE_MDL_WRITE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_PREPARE_MDL_WRITE *PFAST_IO_PREPARE_MDL_WRITE; - -__drv_functionClass(FAST_IO_MDL_WRITE_COMPLETE) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_MDL_WRITE_COMPLETE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in PMDL MdlChain, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_MDL_WRITE_COMPLETE *PFAST_IO_MDL_WRITE_COMPLETE; - -// -// If this routine is present, it will be called by FsRtl -// to acquire the file for the mapped page writer. -// - -__drv_functionClass(FAST_IO_ACQUIRE_FOR_MOD_WRITE) -__drv_sameIRQL -typedef -NTSTATUS -FAST_IO_ACQUIRE_FOR_MOD_WRITE ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER EndingOffset, - __out struct _ERESOURCE **ResourceToRelease, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_ACQUIRE_FOR_MOD_WRITE *PFAST_IO_ACQUIRE_FOR_MOD_WRITE; - -__drv_functionClass(FAST_IO_RELEASE_FOR_MOD_WRITE) -__drv_sameIRQL -typedef -NTSTATUS -FAST_IO_RELEASE_FOR_MOD_WRITE ( - __in struct _FILE_OBJECT *FileObject, - __in struct _ERESOURCE *ResourceToRelease, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_RELEASE_FOR_MOD_WRITE *PFAST_IO_RELEASE_FOR_MOD_WRITE; - -// -// If this routine is present, it will be called by FsRtl -// to acquire the file for the mapped page writer. -// - -__drv_functionClass(FAST_IO_ACQUIRE_FOR_CCFLUSH) -__drv_sameIRQL -typedef -NTSTATUS -FAST_IO_ACQUIRE_FOR_CCFLUSH ( - __in struct _FILE_OBJECT *FileObject, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_ACQUIRE_FOR_CCFLUSH *PFAST_IO_ACQUIRE_FOR_CCFLUSH; - -__drv_functionClass(FAST_IO_RELEASE_FOR_CCFLUSH) -__drv_sameIRQL -typedef -NTSTATUS -FAST_IO_RELEASE_FOR_CCFLUSH ( - __in struct _FILE_OBJECT *FileObject, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_RELEASE_FOR_CCFLUSH *PFAST_IO_RELEASE_FOR_CCFLUSH; - -__drv_functionClass(FAST_IO_READ_COMPRESSED) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_READ_COMPRESSED ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __out PVOID Buffer, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __out struct _COMPRESSED_DATA_INFO *CompressedDataInfo, - __in ULONG CompressedDataInfoLength, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_READ_COMPRESSED *PFAST_IO_READ_COMPRESSED; - -__drv_functionClass(FAST_IO_WRITE_COMPRESSED) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_WRITE_COMPRESSED ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in ULONG Length, - __in ULONG LockKey, - __in PVOID Buffer, - __out PMDL *MdlChain, - __out PIO_STATUS_BLOCK IoStatus, - __in struct _COMPRESSED_DATA_INFO *CompressedDataInfo, - __in ULONG CompressedDataInfoLength, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_WRITE_COMPRESSED *PFAST_IO_WRITE_COMPRESSED; - -__drv_functionClass(FAST_IO_MDL_READ_COMPLETE_COMPRESSED) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_MDL_READ_COMPLETE_COMPRESSED ( - __in struct _FILE_OBJECT *FileObject, - __in PMDL MdlChain, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_MDL_READ_COMPLETE_COMPRESSED *PFAST_IO_MDL_READ_COMPLETE_COMPRESSED; - -__drv_functionClass(FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED ( - __in struct _FILE_OBJECT *FileObject, - __in PLARGE_INTEGER FileOffset, - __in PMDL MdlChain, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_MDL_WRITE_COMPLETE_COMPRESSED *PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED; - -__drv_functionClass(FAST_IO_QUERY_OPEN) -__drv_sameIRQL -typedef -BOOLEAN -FAST_IO_QUERY_OPEN ( - __inout struct _IRP *Irp, - __out PFILE_NETWORK_OPEN_INFORMATION NetworkInformation, - __in struct _DEVICE_OBJECT *DeviceObject - ); - -typedef FAST_IO_QUERY_OPEN *PFAST_IO_QUERY_OPEN; - -// -// Define the structure to describe the Fast I/O dispatch routines. Any -// additions made to this structure MUST be added monotonically to the end -// of the structure, and fields CANNOT be removed from the middle. -// - -typedef struct _FAST_IO_DISPATCH { - ULONG SizeOfFastIoDispatch; - PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible; - PFAST_IO_READ FastIoRead; - PFAST_IO_WRITE FastIoWrite; - PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo; - PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo; - PFAST_IO_LOCK FastIoLock; - PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle; - PFAST_IO_UNLOCK_ALL FastIoUnlockAll; - PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey; - PFAST_IO_DEVICE_CONTROL FastIoDeviceControl; - PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection; - PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection; - PFAST_IO_DETACH_DEVICE FastIoDetachDevice; - PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo; - PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite; - PFAST_IO_MDL_READ MdlRead; - PFAST_IO_MDL_READ_COMPLETE MdlReadComplete; - PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite; - PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete; - PFAST_IO_READ_COMPRESSED FastIoReadCompressed; - PFAST_IO_WRITE_COMPRESSED FastIoWriteCompressed; - PFAST_IO_MDL_READ_COMPLETE_COMPRESSED MdlReadCompleteCompressed; - PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED MdlWriteCompleteCompressed; - PFAST_IO_QUERY_OPEN FastIoQueryOpen; - PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite; - PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush; - PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush; -} FAST_IO_DISPATCH, *PFAST_IO_DISPATCH; - -// -// Define the actions that a driver execution routine may request of the -// adapter/controller allocation routines upon return. -// - -typedef enum _IO_ALLOCATION_ACTION { - KeepObject = 1, - DeallocateObject, - DeallocateObjectKeepRegisters -} IO_ALLOCATION_ACTION, *PIO_ALLOCATION_ACTION; - -// -// Define device driver adapter/controller execution routine. -// - -typedef -__drv_functionClass(DRIVER_CONTROL) -__drv_sameIRQL -IO_ALLOCATION_ACTION -DRIVER_CONTROL ( - __in struct _DEVICE_OBJECT *DeviceObject, - __inout struct _IRP *Irp, - __in PVOID MapRegisterBase, - __in PVOID Context - ); -typedef DRIVER_CONTROL *PDRIVER_CONTROL; - -// -// Define the I/O system's security context type for use by file system's -// when checking access to volumes, files, and directories. -// - -typedef struct _IO_SECURITY_CONTEXT { - PSECURITY_QUALITY_OF_SERVICE SecurityQos; - PACCESS_STATE AccessState; - ACCESS_MASK DesiredAccess; - ULONG FullCreateOptions; -} IO_SECURITY_CONTEXT, *PIO_SECURITY_CONTEXT; - -// -// Define Volume Parameter Block (VPB) flags. -// - -#define VPB_MOUNTED 0x00000001 -#define VPB_LOCKED 0x00000002 -#define VPB_PERSISTENT 0x00000004 -#define VPB_REMOVE_PENDING 0x00000008 -#define VPB_RAW_MOUNT 0x00000010 -#define VPB_DIRECT_WRITES_ALLOWED 0x00000020 - - -// -// Volume Parameter Block (VPB) -// - -#define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) // 32 characters - -typedef struct _VPB { - CSHORT Type; - CSHORT Size; - USHORT Flags; - USHORT VolumeLabelLength; // in bytes - struct _DEVICE_OBJECT *DeviceObject; - struct _DEVICE_OBJECT *RealDevice; - ULONG SerialNumber; - ULONG ReferenceCount; - WCHAR VolumeLabel[MAXIMUM_VOLUME_LABEL_LENGTH / sizeof(WCHAR)]; -} VPB, *PVPB; - - -#if defined(_WIN64) - -// -// Use __inline DMA macros (hal.h) -// -#ifndef USE_DMA_MACROS -#define USE_DMA_MACROS -#endif - -// -// Only PnP drivers! -// -#ifndef NO_LEGACY_DRIVERS -#define NO_LEGACY_DRIVERS -#endif - -#endif // _WIN64 - - -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && ( defined(_NTDDK_) || defined(_NTDRIVER_) || defined(_NTOSP_)) - -// -// Define object type specific fields of various objects used by the I/O system -// - -typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; - -#elif defined(_WDM_INCLUDED_) - -typedef struct _DMA_ADAPTER *PADAPTER_OBJECT; - -#else - -// -// Define object type specific fields of various objects used by the I/O system -// - -typedef struct _ADAPTER_OBJECT *PADAPTER_OBJECT; - -#endif // USE_DMA_MACROS && (_NTDDK_ || _NTDRIVER_ || _NTOSP_) - -// -// Define Wait Context Block (WCB) -// - -typedef struct _WAIT_CONTEXT_BLOCK { - KDEVICE_QUEUE_ENTRY WaitQueueEntry; - PDRIVER_CONTROL DeviceRoutine; - PVOID DeviceContext; - ULONG NumberOfMapRegisters; - PVOID DeviceObject; - PVOID CurrentIrp; - PKDPC BufferChainingDpc; -} WAIT_CONTEXT_BLOCK, *PWAIT_CONTEXT_BLOCK; - -// -// Define Device Object (DO) flags -// -#define DO_VERIFY_VOLUME 0x00000002 -#define DO_BUFFERED_IO 0x00000004 -#define DO_EXCLUSIVE 0x00000008 -#define DO_DIRECT_IO 0x00000010 -#define DO_MAP_IO_BUFFER 0x00000020 -#define DO_DEVICE_INITIALIZING 0x00000080 -#define DO_SHUTDOWN_REGISTERED 0x00000800 -#define DO_BUS_ENUMERATED_DEVICE 0x00001000 -#define DO_POWER_PAGABLE 0x00002000 -#define DO_POWER_INRUSH 0x00004000 -// -// Device Object structure definition -// - -#if _MSC_VER >= 1200 -#pragma warning(push) -#pragma warning(disable:4324) // structure was padded due to __declspec(align()) -#endif - -typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) _DEVICE_OBJECT { - CSHORT Type; - USHORT Size; - LONG ReferenceCount; - struct _DRIVER_OBJECT *DriverObject; - struct _DEVICE_OBJECT *NextDevice; - struct _DEVICE_OBJECT *AttachedDevice; - struct _IRP *CurrentIrp; - PIO_TIMER Timer; - ULONG Flags; // See above: DO_... - ULONG Characteristics; // See ntioapi: FILE_... - __volatile PVPB Vpb; - PVOID DeviceExtension; - DEVICE_TYPE DeviceType; - CCHAR StackSize; - union { - LIST_ENTRY ListEntry; - WAIT_CONTEXT_BLOCK Wcb; - } Queue; - ULONG AlignmentRequirement; - KDEVICE_QUEUE DeviceQueue; - KDPC Dpc; - - // - // The following field is for exclusive use by the filesystem to keep - // track of the number of Fsp threads currently using the device - // - - ULONG ActiveThreadCount; - PSECURITY_DESCRIPTOR SecurityDescriptor; - KEVENT DeviceLock; - - USHORT SectorSize; - USHORT Spare1; - - struct _DEVOBJ_EXTENSION *DeviceObjectExtension; - PVOID Reserved; - -} DEVICE_OBJECT; - -typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - - -struct _DEVICE_OBJECT_POWER_EXTENSION; - -typedef struct _DEVOBJ_EXTENSION { - - CSHORT Type; - USHORT Size; - - // - // Public part of the DeviceObjectExtension structure - // - - PDEVICE_OBJECT DeviceObject; // owning device object - - -} DEVOBJ_EXTENSION, *PDEVOBJ_EXTENSION; - -// -// Define Driver Object (DRVO) flags -// - -#define DRVO_UNLOAD_INVOKED 0x00000001 -#define DRVO_LEGACY_DRIVER 0x00000002 -#define DRVO_BUILTIN_DRIVER 0x00000004 // Driver objects for Hal, PnP Mgr - -typedef struct _DRIVER_EXTENSION { - - // - // Back pointer to Driver Object - // - - struct _DRIVER_OBJECT *DriverObject; - - // - // The AddDevice entry point is called by the Plug & Play manager - // to inform the driver when a new device instance arrives that this - // driver must control. - // - - PDRIVER_ADD_DEVICE AddDevice; - - // - // The count field is used to count the number of times the driver has - // had its registered reinitialization routine invoked. - // - - ULONG Count; - - // - // The service name field is used by the pnp manager to determine - // where the driver related info is stored in the registry. - // - - UNICODE_STRING ServiceKeyName; - - // - // Note: any new shared fields get added here. - // - - -} DRIVER_EXTENSION, *PDRIVER_EXTENSION; - -typedef struct _DRIVER_OBJECT { - CSHORT Type; - CSHORT Size; - - // - // The following links all of the devices created by a single driver - // together on a list, and the Flags word provides an extensible flag - // location for driver objects. - // - - PDEVICE_OBJECT DeviceObject; - ULONG Flags; - - // - // The following section describes where the driver is loaded. The count - // field is used to count the number of times the driver has had its - // registered reinitialization routine invoked. - // - - PVOID DriverStart; - ULONG DriverSize; - PVOID DriverSection; - PDRIVER_EXTENSION DriverExtension; - - // - // The driver name field is used by the error log thread - // determine the name of the driver that an I/O request is/was bound. - // - - UNICODE_STRING DriverName; - - // - // The following section is for registry support. Thise is a pointer - // to the path to the hardware information in the registry - // - - PUNICODE_STRING HardwareDatabase; - - // - // The following section contains the optional pointer to an array of - // alternate entry points to a driver for "fast I/O" support. Fast I/O - // is performed by invoking the driver routine directly with separate - // parameters, rather than using the standard IRP call mechanism. Note - // that these functions may only be used for synchronous I/O, and when - // the file is cached. - // - - PFAST_IO_DISPATCH FastIoDispatch; - - // - // The following section describes the entry points to this particular - // driver. Note that the major function dispatch table must be the last - // field in the object so that it remains extensible. - // - - PDRIVER_INITIALIZE DriverInit; - PDRIVER_STARTIO DriverStartIo; - PDRIVER_UNLOAD DriverUnload; - PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION + 1]; - -} DRIVER_OBJECT; -typedef struct _DRIVER_OBJECT *PDRIVER_OBJECT; - - - -// -// The following structure is pointed to by the SectionObject pointer field -// of a file object, and is allocated by the various NT file systems. -// - -typedef struct _SECTION_OBJECT_POINTERS { - PVOID DataSectionObject; - PVOID SharedCacheMap; - PVOID ImageSectionObject; -} SECTION_OBJECT_POINTERS; -typedef SECTION_OBJECT_POINTERS *PSECTION_OBJECT_POINTERS; - -// -// Define the format of a completion message. -// - -typedef struct _IO_COMPLETION_CONTEXT { - PVOID Port; - PVOID Key; -} IO_COMPLETION_CONTEXT, *PIO_COMPLETION_CONTEXT; - -// -// Define File Object (FO) flags -// - -#define FO_FILE_OPEN 0x00000001 -#define FO_SYNCHRONOUS_IO 0x00000002 -#define FO_ALERTABLE_IO 0x00000004 -#define FO_NO_INTERMEDIATE_BUFFERING 0x00000008 -#define FO_WRITE_THROUGH 0x00000010 -#define FO_SEQUENTIAL_ONLY 0x00000020 -#define FO_CACHE_SUPPORTED 0x00000040 -#define FO_NAMED_PIPE 0x00000080 -#define FO_STREAM_FILE 0x00000100 -#define FO_MAILSLOT 0x00000200 -#define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400 -#define FO_QUEUE_IRP_TO_THREAD FO_GENERATE_AUDIT_ON_CLOSE -#define FO_DIRECT_DEVICE_OPEN 0x00000800 -#define FO_FILE_MODIFIED 0x00001000 -#define FO_FILE_SIZE_CHANGED 0x00002000 -#define FO_CLEANUP_COMPLETE 0x00004000 -#define FO_TEMPORARY_FILE 0x00008000 -#define FO_DELETE_ON_CLOSE 0x00010000 -#define FO_OPENED_CASE_SENSITIVE 0x00020000 -#define FO_HANDLE_CREATED 0x00040000 -#define FO_FILE_FAST_IO_READ 0x00080000 -#define FO_RANDOM_ACCESS 0x00100000 -#define FO_FILE_OPEN_CANCELLED 0x00200000 -#define FO_VOLUME_OPEN 0x00400000 -#define FO_REMOTE_ORIGIN 0x01000000 -#define FO_DISALLOW_EXCLUSIVE 0x02000000 -#define FO_SKIP_COMPLETION_PORT FO_DISALLOW_EXCLUSIVE -#define FO_SKIP_SET_EVENT 0x04000000 -#define FO_SKIP_SET_FAST_IO 0x08000000 - -// -// This mask allows us to re-use flags that are not present during a create -// operation for uses that are only valid for the duration of the create. -// -#define FO_FLAGS_VALID_ONLY_DURING_CREATE FO_DISALLOW_EXCLUSIVE - -typedef struct _FILE_OBJECT { - CSHORT Type; - CSHORT Size; - PDEVICE_OBJECT DeviceObject; - PVPB Vpb; - PVOID FsContext; - PVOID FsContext2; - PSECTION_OBJECT_POINTERS SectionObjectPointer; - PVOID PrivateCacheMap; - NTSTATUS FinalStatus; - struct _FILE_OBJECT *RelatedFileObject; - BOOLEAN LockOperation; - BOOLEAN DeletePending; - BOOLEAN ReadAccess; - BOOLEAN WriteAccess; - BOOLEAN DeleteAccess; - BOOLEAN SharedRead; - BOOLEAN SharedWrite; - BOOLEAN SharedDelete; - ULONG Flags; - UNICODE_STRING FileName; - LARGE_INTEGER CurrentByteOffset; - __volatile ULONG Waiters; - __volatile ULONG Busy; - PVOID LastLock; - KEVENT Lock; - KEVENT Event; - __volatile PIO_COMPLETION_CONTEXT CompletionContext; - KSPIN_LOCK IrpListLock; - LIST_ENTRY IrpList; - __volatile PVOID FileObjectExtension; -} FILE_OBJECT; -typedef struct _FILE_OBJECT *PFILE_OBJECT; - -// -// Define I/O Request Packet (IRP) flags -// - -#define IRP_NOCACHE 0x00000001 -#define IRP_PAGING_IO 0x00000002 -#define IRP_MOUNT_COMPLETION 0x00000002 -#define IRP_SYNCHRONOUS_API 0x00000004 -#define IRP_ASSOCIATED_IRP 0x00000008 -#define IRP_BUFFERED_IO 0x00000010 -#define IRP_DEALLOCATE_BUFFER 0x00000020 -#define IRP_INPUT_OPERATION 0x00000040 -#define IRP_SYNCHRONOUS_PAGING_IO 0x00000040 -#define IRP_CREATE_OPERATION 0x00000080 -#define IRP_READ_OPERATION 0x00000100 -#define IRP_WRITE_OPERATION 0x00000200 -#define IRP_CLOSE_OPERATION 0x00000400 -#define IRP_DEFER_IO_COMPLETION 0x00000800 -#define IRP_OB_QUERY_NAME 0x00001000 -#define IRP_HOLD_DEVICE_QUEUE 0x00002000 - -// -// Define I/O request packet (IRP) alternate flags for allocation control. -// - -#define IRP_QUOTA_CHARGED 0x01 -#define IRP_ALLOCATED_MUST_SUCCEED 0x02 -#define IRP_ALLOCATED_FIXED_SIZE 0x04 -#define IRP_LOOKASIDE_ALLOCATION 0x08 - - - -// -// I/O Request Packet (IRP) definition -// - -typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATION_ALIGNMENT) _IRP { - CSHORT Type; - USHORT Size; - - // - // Define the common fields used to control the IRP. - // - - // - // Define a pointer to the Memory Descriptor List (MDL) for this I/O - // request. This field is only used if the I/O is "direct I/O". - // - - PMDL MdlAddress; - - // - // Flags word - used to remember various flags. - // - - ULONG Flags; - - // - // The following union is used for one of three purposes: - // - // 1. This IRP is an associated IRP. The field is a pointer to a master - // IRP. - // - // 2. This is the master IRP. The field is the count of the number of - // IRPs which must complete (associated IRPs) before the master can - // complete. - // - // 3. This operation is being buffered and the field is the address of - // the system space buffer. - // - - union { - struct _IRP *MasterIrp; - __volatile LONG IrpCount; - PVOID SystemBuffer; - } AssociatedIrp; - - // - // Thread list entry - allows queueing the IRP to the thread pending I/O - // request packet list. - // - - LIST_ENTRY ThreadListEntry; - - // - // I/O status - final status of operation. - // - - IO_STATUS_BLOCK IoStatus; - - // - // Requestor mode - mode of the original requestor of this operation. - // - - KPROCESSOR_MODE RequestorMode; - - // - // Pending returned - TRUE if pending was initially returned as the - // status for this packet. - // - - BOOLEAN PendingReturned; - - // - // Stack state information. - // - - CHAR StackCount; - CHAR CurrentLocation; - - // - // Cancel - packet has been canceled. - // - - BOOLEAN Cancel; - - // - // Cancel Irql - Irql at which the cancel spinlock was acquired. - // - - KIRQL CancelIrql; - - // - // ApcEnvironment - Used to save the APC environment at the time that the - // packet was initialized. - // - - CCHAR ApcEnvironment; - - // - // Allocation control flags. - // - - UCHAR AllocationFlags; - - // - // User parameters. - // - - PIO_STATUS_BLOCK UserIosb; - PKEVENT UserEvent; - union { - struct { - union { - PIO_APC_ROUTINE UserApcRoutine; - PVOID IssuingProcess; - }; - PVOID UserApcContext; - } AsynchronousParameters; - LARGE_INTEGER AllocationSize; - } Overlay; - - // - // CancelRoutine - Used to contain the address of a cancel routine supplied - // by a device driver when the IRP is in a cancelable state. - // - - __volatile PDRIVER_CANCEL CancelRoutine; - - // - // Note that the UserBuffer parameter is outside of the stack so that I/O - // completion can copy data back into the user's address space without - // having to know exactly which service was being invoked. The length - // of the copy is stored in the second half of the I/O status block. If - // the UserBuffer field is NULL, then no copy is performed. - // - - PVOID UserBuffer; - - // - // Kernel structures - // - // The following section contains kernel structures which the IRP needs - // in order to place various work information in kernel controller system - // queues. Because the size and alignment cannot be controlled, they are - // placed here at the end so they just hang off and do not affect the - // alignment of other fields in the IRP. - // - - union { - - struct { - - union { - - // - // DeviceQueueEntry - The device queue entry field is used to - // queue the IRP to the device driver device queue. - // - - KDEVICE_QUEUE_ENTRY DeviceQueueEntry; - - struct { - - // - // The following are available to the driver to use in - // whatever manner is desired, while the driver owns the - // packet. - // - - PVOID DriverContext[4]; - - } ; - - } ; - - // - // Thread - pointer to caller's Thread Control Block. - // - - PETHREAD Thread; - - // - // Auxiliary buffer - pointer to any auxiliary buffer that is - // required to pass information to a driver that is not contained - // in a normal buffer. - // - - PCHAR AuxiliaryBuffer; - - // - // The following unnamed structure must be exactly identical - // to the unnamed structure used in the minipacket header used - // for completion queue entries. - // - - struct { - - // - // List entry - used to queue the packet to completion queue, among - // others. - // - - LIST_ENTRY ListEntry; - - union { - - // - // Current stack location - contains a pointer to the current - // IO_STACK_LOCATION structure in the IRP stack. This field - // should never be directly accessed by drivers. They should - // use the standard functions. - // - - struct _IO_STACK_LOCATION *CurrentStackLocation; - - // - // Minipacket type. - // - - ULONG PacketType; - }; - }; - - // - // Original file object - pointer to the original file object - // that was used to open the file. This field is owned by the - // I/O system and should not be used by any other drivers. - // - - PFILE_OBJECT OriginalFileObject; - - } Overlay; - - // - // APC - This APC control block is used for the special kernel APC as - // well as for the caller's APC, if one was specified in the original - // argument list. If so, then the APC is reused for the normal APC for - // whatever mode the caller was in and the "special" routine that is - // invoked before the APC gets control simply deallocates the IRP. - // - - KAPC Apc; - - // - // CompletionKey - This is the key that is used to distinguish - // individual I/O operations initiated on a single file handle. - // - - PVOID CompletionKey; - - } Tail; - -} IRP; - -typedef IRP *PIRP; - -// -// Define completion routine types for use in stack locations in an IRP -// - -__drv_functionClass(IO_COMPLETION_ROUTINE) -__drv_sameIRQL -typedef -NTSTATUS -IO_COMPLETION_ROUTINE ( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in_xcount_opt("varies") PVOID Context - ); - -typedef IO_COMPLETION_ROUTINE *PIO_COMPLETION_ROUTINE; - -// -// Define stack location control flags -// - -#define SL_PENDING_RETURNED 0x01 -#define SL_ERROR_RETURNED 0x02 -#define SL_INVOKE_ON_CANCEL 0x20 -#define SL_INVOKE_ON_SUCCESS 0x40 -#define SL_INVOKE_ON_ERROR 0x80 - -// -// Define flags for various functions -// - -// -// Create / Create Named Pipe -// -// The following flags must exactly match those in the IoCreateFile call's -// options. The case sensitive flag is added in later, by the parse routine, -// and is not an actual option to open. Rather, it is part of the object -// manager's attributes structure. -// - -#define SL_FORCE_ACCESS_CHECK 0x01 -#define SL_OPEN_PAGING_FILE 0x02 -#define SL_OPEN_TARGET_DIRECTORY 0x04 -#define SL_STOP_ON_SYMLINK 0x08 - - -#define SL_CASE_SENSITIVE 0x80 - -// -// Read / Write -// - -#define SL_KEY_SPECIFIED 0x01 -#define SL_OVERRIDE_VERIFY_VOLUME 0x02 -#define SL_WRITE_THROUGH 0x04 -#define SL_FT_SEQUENTIAL_WRITE 0x08 -#define SL_FORCE_DIRECT_WRITE 0x10 -#define SL_REALTIME_STREAM 0x20 - -// -// Device I/O Control -// -// -// Same SL_OVERRIDE_VERIFY_VOLUME as for read/write above. -// - -#define SL_READ_ACCESS_GRANTED 0x01 -#define SL_WRITE_ACCESS_GRANTED 0x04 // Gap for SL_OVERRIDE_VERIFY_VOLUME - -// -// Lock -// - -#define SL_FAIL_IMMEDIATELY 0x01 -#define SL_EXCLUSIVE_LOCK 0x02 - -// -// QueryDirectory / QueryEa / QueryQuota -// - -#define SL_RESTART_SCAN 0x01 -#define SL_RETURN_SINGLE_ENTRY 0x02 -#define SL_INDEX_SPECIFIED 0x04 - -// -// NotifyDirectory -// - -#define SL_WATCH_TREE 0x01 - -// -// FileSystemControl -// -// minor: mount/verify volume -// - -#define SL_ALLOW_RAW_MOUNT 0x01 - -// -// Define PNP/POWER types required by IRP_MJ_PNP/IRP_MJ_POWER. -// - -typedef enum _DEVICE_RELATION_TYPE { - BusRelations, - EjectionRelations, - PowerRelations, - RemovalRelations, - TargetDeviceRelation, - SingleBusRelations, - TransportRelations -} DEVICE_RELATION_TYPE, *PDEVICE_RELATION_TYPE; - -typedef struct _DEVICE_RELATIONS { - ULONG Count; - PDEVICE_OBJECT Objects[1]; // variable length -} DEVICE_RELATIONS, *PDEVICE_RELATIONS; - -typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE { - DeviceUsageTypeUndefined, - DeviceUsageTypePaging, - DeviceUsageTypeHibernation, - DeviceUsageTypeDumpFile -} DEVICE_USAGE_NOTIFICATION_TYPE; - - - -// workaround overloaded definition (rpc generated headers all define INTERFACE -// to match the class name). -#undef INTERFACE - -typedef struct _INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // interface specific entries go here -} INTERFACE, *PINTERFACE; - - - -typedef __struct_bcount(Size) struct _DEVICE_CAPABILITIES { - USHORT Size; - USHORT Version; // the version documented here is version 1 - ULONG DeviceD1:1; - ULONG DeviceD2:1; - ULONG LockSupported:1; - ULONG EjectSupported:1; // Ejectable in S0 - ULONG Removable:1; - ULONG DockDevice:1; - ULONG UniqueID:1; - ULONG SilentInstall:1; - ULONG RawDeviceOK:1; - ULONG SurpriseRemovalOK:1; - ULONG WakeFromD0:1; - ULONG WakeFromD1:1; - ULONG WakeFromD2:1; - ULONG WakeFromD3:1; - ULONG HardwareDisabled:1; - ULONG NonDynamic:1; - ULONG WarmEjectSupported:1; - ULONG NoDisplayInUI:1; - ULONG Reserved1:1; - ULONG Reserved:13; - - ULONG Address; - ULONG UINumber; - - DEVICE_POWER_STATE DeviceState[POWER_SYSTEM_MAXIMUM]; - SYSTEM_POWER_STATE SystemWake; - DEVICE_POWER_STATE DeviceWake; - ULONG D1Latency; - ULONG D2Latency; - ULONG D3Latency; -} DEVICE_CAPABILITIES, *PDEVICE_CAPABILITIES; - -typedef struct _POWER_SEQUENCE { - ULONG SequenceD1; - ULONG SequenceD2; - ULONG SequenceD3; -} POWER_SEQUENCE, *PPOWER_SEQUENCE; - -typedef enum { - BusQueryDeviceID = 0, // \ - BusQueryHardwareIDs = 1, // Hardware ids - BusQueryCompatibleIDs = 2, // compatible device ids - BusQueryInstanceID = 3, // persistent id for this instance of the device - BusQueryDeviceSerialNumber = 4, // serial number for this device - BusQueryContainerID = 5 // unique id of the device's physical container -} BUS_QUERY_ID_TYPE, *PBUS_QUERY_ID_TYPE; - -typedef ULONG PNP_DEVICE_STATE, *PPNP_DEVICE_STATE; - -#define PNP_DEVICE_DISABLED 0x00000001 -#define PNP_DEVICE_DONT_DISPLAY_IN_UI 0x00000002 -#define PNP_DEVICE_FAILED 0x00000004 -#define PNP_DEVICE_REMOVED 0x00000008 -#define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010 -#define PNP_DEVICE_NOT_DISABLEABLE 0x00000020 - -typedef enum { - DeviceTextDescription = 0, // DeviceDesc property - DeviceTextLocationInformation = 1 // DeviceLocation property -} DEVICE_TEXT_TYPE, *PDEVICE_TEXT_TYPE; - -// -// Define I/O Request Packet (IRP) stack locations -// - -#if !defined(_AMD64_) && !defined(_IA64_) -#include "pshpack4.h" -#endif - - - -#if defined(_WIN64) -#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8) -#else -#define POINTER_ALIGNMENT -#endif - - - -#if _MSC_VER >= 1200 -#pragma warning(push) -#pragma warning(disable:4324) // structure was padded due to __declspec(align()) -#endif - -typedef struct _IO_STACK_LOCATION { - UCHAR MajorFunction; - UCHAR MinorFunction; - UCHAR Flags; - UCHAR Control; - - // - // The following user parameters are based on the service that is being - // invoked. Drivers and file systems can determine which set to use based - // on the above major and minor function codes. - // - - union { - - // - // System service parameters for: NtCreateFile - // - - struct { - PIO_SECURITY_CONTEXT SecurityContext; - ULONG Options; - USHORT POINTER_ALIGNMENT FileAttributes; - USHORT ShareAccess; - ULONG POINTER_ALIGNMENT EaLength; - } Create; - - - // - // System service parameters for: NtReadFile - // - - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - } Read; - - // - // System service parameters for: NtWriteFile - // - - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - } Write; - - // - // System service parameters for: NtQueryDirectoryFile - // - - struct { - ULONG Length; - PUNICODE_STRING FileName; - FILE_INFORMATION_CLASS FileInformationClass; - ULONG POINTER_ALIGNMENT FileIndex; - } QueryDirectory; - - // - // System service parameters for: NtNotifyChangeDirectoryFile - // - - struct { - ULONG Length; - ULONG POINTER_ALIGNMENT CompletionFilter; - } NotifyDirectory; - - // - // System service parameters for: NtQueryInformationFile - // - - struct { - ULONG Length; - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; - } QueryFile; - - // - // System service parameters for: NtSetInformationFile - // - - struct { - ULONG Length; - FILE_INFORMATION_CLASS POINTER_ALIGNMENT FileInformationClass; - PFILE_OBJECT FileObject; - union { - struct { - BOOLEAN ReplaceIfExists; - BOOLEAN AdvanceOnly; - }; - ULONG ClusterCount; - HANDLE DeleteHandle; - }; - } SetFile; - - - - // - // System service parameters for: NtQueryEaFile - // - - struct { - ULONG Length; - PVOID EaList; - ULONG EaListLength; - ULONG POINTER_ALIGNMENT EaIndex; - } QueryEa; - - // - // System service parameters for: NtSetEaFile - // - - struct { - ULONG Length; - } SetEa; - - - - // - // System service parameters for: NtQueryVolumeInformationFile - // - - struct { - ULONG Length; - FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; - } QueryVolume; - - - - // - // System service parameters for: NtSetVolumeInformationFile - // - - struct { - ULONG Length; - FS_INFORMATION_CLASS POINTER_ALIGNMENT FsInformationClass; - } SetVolume; - - // - // System service parameters for: NtFsControlFile - // - // Note that the user's output buffer is stored in the UserBuffer field - // and the user's input buffer is stored in the SystemBuffer field. - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT FsControlCode; - PVOID Type3InputBuffer; - } FileSystemControl; - // - // System service parameters for: NtLockFile/NtUnlockFile - // - - struct { - PLARGE_INTEGER Length; - ULONG POINTER_ALIGNMENT Key; - LARGE_INTEGER ByteOffset; - } LockControl; - - // - // System service parameters for: NtFlushBuffersFile - // - // No extra user-supplied parameters. - // - - - - // - // System service parameters for: NtCancelIoFile - // - // No extra user-supplied parameters. - // - - - - // - // System service parameters for: NtDeviceIoControlFile - // - // Note that the user's output buffer is stored in the UserBuffer field - // and the user's input buffer is stored in the SystemBuffer field. - // - - struct { - ULONG OutputBufferLength; - ULONG POINTER_ALIGNMENT InputBufferLength; - ULONG POINTER_ALIGNMENT IoControlCode; - PVOID Type3InputBuffer; - } DeviceIoControl; - - // - // System service parameters for: NtQuerySecurityObject - // - - struct { - SECURITY_INFORMATION SecurityInformation; - ULONG POINTER_ALIGNMENT Length; - } QuerySecurity; - - // - // System service parameters for: NtSetSecurityObject - // - - struct { - SECURITY_INFORMATION SecurityInformation; - PSECURITY_DESCRIPTOR SecurityDescriptor; - } SetSecurity; - - // - // Non-system service parameters. - // - // Parameters for MountVolume - // - - struct { - PVPB Vpb; - PDEVICE_OBJECT DeviceObject; - } MountVolume; - - // - // Parameters for VerifyVolume - // - - struct { - PVPB Vpb; - PDEVICE_OBJECT DeviceObject; - } VerifyVolume; - - // - // Parameters for Scsi with internal device contorl. - // - - struct { - struct _SCSI_REQUEST_BLOCK *Srb; - } Scsi; - - - - // - // System service parameters for: NtQueryQuotaInformationFile - // - - struct { - ULONG Length; - PSID StartSid; - PFILE_GET_QUOTA_INFORMATION SidList; - ULONG SidListLength; - } QueryQuota; - - // - // System service parameters for: NtSetQuotaInformationFile - // - - struct { - ULONG Length; - } SetQuota; - - - - // - // Parameters for IRP_MN_QUERY_DEVICE_RELATIONS - // - - struct { - DEVICE_RELATION_TYPE Type; - } QueryDeviceRelations; - - // - // Parameters for IRP_MN_QUERY_INTERFACE - // - - struct { - CONST GUID *InterfaceType; - USHORT Size; - USHORT Version; - PINTERFACE Interface; - PVOID InterfaceSpecificData; - } QueryInterface; - - // - // Parameters for IRP_MN_QUERY_CAPABILITIES - // - - struct { - PDEVICE_CAPABILITIES Capabilities; - } DeviceCapabilities; - - // - // Parameters for IRP_MN_FILTER_RESOURCE_REQUIREMENTS - // - - struct { - PIO_RESOURCE_REQUIREMENTS_LIST IoResourceRequirementList; - } FilterResourceRequirements; - - // - // Parameters for IRP_MN_READ_CONFIG and IRP_MN_WRITE_CONFIG - // - - struct { - ULONG WhichSpace; - PVOID Buffer; - ULONG Offset; - ULONG POINTER_ALIGNMENT Length; - } ReadWriteConfig; - - // - // Parameters for IRP_MN_SET_LOCK - // - - struct { - BOOLEAN Lock; - } SetLock; - - // - // Parameters for IRP_MN_QUERY_ID - // - - struct { - BUS_QUERY_ID_TYPE IdType; - } QueryId; - - // - // Parameters for IRP_MN_QUERY_DEVICE_TEXT - // - - struct { - DEVICE_TEXT_TYPE DeviceTextType; - LCID POINTER_ALIGNMENT LocaleId; - } QueryDeviceText; - - // - // Parameters for IRP_MN_DEVICE_USAGE_NOTIFICATION - // - - struct { - BOOLEAN InPath; - BOOLEAN Reserved[3]; - DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type; - } UsageNotification; - - // - // Parameters for IRP_MN_WAIT_WAKE - // - - struct { - SYSTEM_POWER_STATE PowerState; - } WaitWake; - - // - // Parameter for IRP_MN_POWER_SEQUENCE - // - - struct { - PPOWER_SEQUENCE PowerSequence; - } PowerSequence; - - // - // Parameters for IRP_MN_SET_POWER and IRP_MN_QUERY_POWER - // - -#if (NTDDI_VERSION >= NTDDI_VISTA) - struct { - union { - ULONG SystemContext; - SYSTEM_POWER_STATE_CONTEXT SystemPowerStateContext; - }; - POWER_STATE_TYPE POINTER_ALIGNMENT Type; - POWER_STATE POINTER_ALIGNMENT State; - POWER_ACTION POINTER_ALIGNMENT ShutdownType; - } Power; -#else - struct { - ULONG SystemContext; - POWER_STATE_TYPE POINTER_ALIGNMENT Type; - POWER_STATE POINTER_ALIGNMENT State; - POWER_ACTION POINTER_ALIGNMENT ShutdownType; - } Power; -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - - // - // Parameters for StartDevice - // - - struct { - PCM_RESOURCE_LIST AllocatedResources; - PCM_RESOURCE_LIST AllocatedResourcesTranslated; - } StartDevice; - - // - // Parameters for Cleanup - // - // No extra parameters supplied - // - - // - // WMI Irps - // - - struct { - ULONG_PTR ProviderId; - PVOID DataPath; - ULONG BufferSize; - PVOID Buffer; - } WMI; - - // - // Others - driver-specific - // - - struct { - PVOID Argument1; - PVOID Argument2; - PVOID Argument3; - PVOID Argument4; - } Others; - - } Parameters; - - // - // Save a pointer to this device driver's device object for this request - // so it can be passed to the completion routine if needed. - // - - PDEVICE_OBJECT DeviceObject; - - // - // The following location contains a pointer to the file object for this - // request. - // - - PFILE_OBJECT FileObject; - - // - // The following routine is invoked depending on the flags in the above - // flags field. - // - - PIO_COMPLETION_ROUTINE CompletionRoutine; - - // - // The following is used to store the address of the context parameter - // that should be passed to the CompletionRoutine. - // - - PVOID Context; - -} IO_STACK_LOCATION, *PIO_STACK_LOCATION; - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#endif - -#if !defined(_AMD64_) && !defined(_IA64_) -#include "poppack.h" -#endif - -// -// Define the share access structure used by file systems to determine -// whether or not another accessor may open the file. -// - -typedef struct _SHARE_ACCESS { - ULONG OpenCount; - ULONG Readers; - ULONG Writers; - ULONG Deleters; - ULONG SharedRead; - ULONG SharedWrite; - ULONG SharedDelete; -} SHARE_ACCESS, *PSHARE_ACCESS; - -// -// Public I/O routine definitions -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_acquiresCancelSpinLock -__drv_neverHoldCancelSpinLock -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_setsIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoAcquireCancelSpinLock( - __out __deref __drv_savesIRQL PKIRQL Irql - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(<0;==0) -NTKERNELAPI -NTSTATUS -IoAllocateDriverObjectExtension( - __in PDRIVER_OBJECT DriverObject, - __in PVOID ClientIdentificationAddress, - __in ULONG DriverObjectExtensionSize, - // When successful, this always allocates already-aliased memory. - __post __deref __drv_when(return==0, - __out __drv_aliasesMem __drv_allocatesMem(Mem) __drv_valueIs(!=0)) - PVOID *DriverObjectExtension - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PVOID -IoAllocateErrorLogEntry( - __in PVOID IoObject, - __in UCHAR EntrySize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PIRP -IoAllocateIrp( - __in CCHAR StackSize, - __in BOOLEAN ChargeQuota - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PMDL -IoAllocateMdl( - __in_opt __drv_aliasesMem PVOID VirtualAddress, - __in ULONG Length, - __in BOOLEAN SecondaryBuffer, - __in BOOLEAN ChargeQuota, - __inout_opt PIRP Irp - ); -#endif - -typedef enum _IO_PAGING_PRIORITY { - IoPagingPriorityInvalid, // Returned if a non-paging IO IRP is passed. - IoPagingPriorityNormal, // For regular paging IO - IoPagingPriorityHigh, // For high priority paging IO - IoPagingPriorityReserved1, // Reserved for future use. - IoPagingPriorityReserved2 // Reserved for future use. -} IO_PAGING_PRIORITY; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_valueIs(==0;<0) -NTKERNELAPI -NTSTATUS -IoAttachDevice( - __in __drv_mustHold(Memory) __drv_when(return==0, __drv_aliasesMem) - PDEVICE_OBJECT SourceDevice, - __in PUNICODE_STRING TargetDevice, - __out PDEVICE_OBJECT *AttachedDevice - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_valueIs(!=0;==0) -NTKERNELAPI -PDEVICE_OBJECT -IoAttachDeviceToDeviceStack( - __in __drv_mustHold(Memory) __drv_when(return!=0, __drv_aliasesMem) - PDEVICE_OBJECT SourceDevice, - __in PDEVICE_OBJECT TargetDevice - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_aliasesMem -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PIRP -IoBuildAsynchronousFsdRequest( - __in ULONG MajorFunction, - __in PDEVICE_OBJECT DeviceObject, - __inout_opt PVOID Buffer, - __in_opt ULONG Length, - __in_opt PLARGE_INTEGER StartingOffset, - __in_opt PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_aliasesMem -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PIRP -IoBuildDeviceIoControlRequest( - __in ULONG IoControlCode, - __in PDEVICE_OBJECT DeviceObject, - __in_opt PVOID InputBuffer, - __in ULONG InputBufferLength, - __out_opt PVOID OutputBuffer, - __in ULONG OutputBufferLength, - __in BOOLEAN InternalDeviceIoControl, - __in PKEVENT Event, - __out PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoBuildPartialMdl( - __in PMDL SourceMdl, - __inout PMDL TargetMdl, - __in PVOID VirtualAddress, - __in ULONG Length - ); -#endif - -typedef struct _BOOTDISK_INFORMATION { - LONGLONG BootPartitionOffset; - LONGLONG SystemPartitionOffset; - ULONG BootDeviceSignature; - ULONG SystemDeviceSignature; -} BOOTDISK_INFORMATION, *PBOOTDISK_INFORMATION; - -// -// This structure should follow the previous structure field for field. -// -typedef struct _BOOTDISK_INFORMATION_EX { - LONGLONG BootPartitionOffset; - LONGLONG SystemPartitionOffset; - ULONG BootDeviceSignature; - ULONG SystemDeviceSignature; - GUID BootDeviceGuid; - GUID SystemDeviceGuid; - BOOLEAN BootDeviceIsGpt; - BOOLEAN SystemDeviceIsGpt; -} BOOTDISK_INFORMATION_EX, *PBOOTDISK_INFORMATION_EX; - -#if (NTDDI_VERSION >= NTDDI_WIN7) -typedef struct _LOADER_PARTITION_INFORMATION_EX { - ULONG PartitionStyle; - ULONG PartitionNumber; - union { - ULONG Signature; - GUID DeviceId; - }; - ULONG Flags; -} LOADER_PARTITION_INFORMATION_EX, *PLOADER_PARTITION_INFORMATION_EX; - -typedef struct _BOOTDISK_INFORMATION_LITE { - ULONG NumberEntries; - LOADER_PARTITION_INFORMATION_EX Entries[1]; -} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; -#else - -#if (NTDDI_VERSION >= NTDDI_VISTA) -typedef struct _BOOTDISK_INFORMATION_LITE { - ULONG BootDeviceSignature; - ULONG SystemDeviceSignature; - GUID BootDeviceGuid; - GUID SystemDeviceGuid; - BOOLEAN BootDeviceIsGpt; - BOOLEAN SystemDeviceIsGpt; -} BOOTDISK_INFORMATION_LITE, *PBOOTDISK_INFORMATION_LITE; -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoGetBootDiskInformation( - __inout PBOOTDISK_INFORMATION BootDiskInformation, - __in ULONG Size - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -IoGetBootDiskInformationLite( - __deref_out PBOOTDISK_INFORMATION_LITE *BootDiskInformation - ); - -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_aliasesMem -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PIRP -IoBuildSynchronousFsdRequest( - __in ULONG MajorFunction, - __in PDEVICE_OBJECT DeviceObject, - __inout_opt PVOID Buffer, - __in_opt ULONG Length, - __in_opt PLARGE_INTEGER StartingOffset, - __in PKEVENT Event, - __out PIO_STATUS_BLOCK IoStatusBlock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__success(TRUE) -NTKERNELAPI -NTSTATUS -FASTCALL -IofCallDriver( - __in PDEVICE_OBJECT DeviceObject, - __inout __drv_aliasesMem PIRP Irp - ); -#endif - -#define IoCallDriver(a,b) \ - IofCallDriver(a,b) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -IoCancelIrp( - __in PIRP Irp - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoCheckShareAccess( - __in ACCESS_MASK DesiredAccess, - __in ULONG DesiredShareAccess, - __inout PFILE_OBJECT FileObject, - __inout PSHARE_ACCESS ShareAccess, - __in BOOLEAN Update - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -IoCheckShareAccessEx( - __in ACCESS_MASK DesiredAccess, - __in ULONG DesiredShareAccess, - __inout PFILE_OBJECT FileObject, - __inout PSHARE_ACCESS ShareAccess, - __in BOOLEAN Update, - __in PBOOLEAN WritePermission - ); -#endif - -// -// This value should be returned from completion routines to continue -// completing the IRP upwards. Otherwise, STATUS_MORE_PROCESSING_REQUIRED -// should be returned. -// -#define STATUS_CONTINUE_COMPLETION STATUS_SUCCESS - -// -// Completion routines can also use this enumeration in place of status codes. -// -typedef enum _IO_COMPLETION_ROUTINE_RESULT { - - ContinueCompletion = STATUS_CONTINUE_COMPLETION, - StopCompletion = STATUS_MORE_PROCESSING_REQUIRED - -} IO_COMPLETION_ROUTINE_RESULT, *PIO_COMPLETION_ROUTINE_RESULT; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_neverHold(KeSpinLockType) -NTKERNELAPI -VOID -FASTCALL -IofCompleteRequest( - __in PIRP Irp, - __in CCHAR PriorityBoost - ); -#endif - -#define IoCompleteRequest(a,b) \ - IofCompleteRequest(a,b) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoConnectInterrupt( - __out PKINTERRUPT *InterruptObject, - __in PKSERVICE_ROUTINE ServiceRoutine, - __in_opt PVOID ServiceContext, - __in_opt PKSPIN_LOCK SpinLock, - __in ULONG Vector, - __in KIRQL Irql, - __in KIRQL SynchronizeIrql, - __in KINTERRUPT_MODE InterruptMode, - __in BOOLEAN ShareVector, - __in KAFFINITY ProcessorEnableMask, - __in BOOLEAN FloatingSave - ); -#endif - -// -// Interrupt message information table entry definition -// - -typedef struct _IO_INTERRUPT_MESSAGE_INFO_ENTRY { - - // - // Message address - indicates the address the device should use to - // generate this message signaled interrupt. - // - - PHYSICAL_ADDRESS MessageAddress; - - // - // Target processor set - indicates the set of processors that this - // message in allowed to interrupt. - // - - KAFFINITY TargetProcessorSet; - - // - // Interrupt object - holds a pointer to the interrupt object associated - // with this interrupt message. This structure is opaque to drivers. - // - - PKINTERRUPT InterruptObject; - - // - // Message data - supplies the value that the device should write to the - // message address in order to generate this interrupt message. - // - - ULONG MessageData; - - // - // The remaining fields indicate the system interrupt vector, IRQL, - // trigger mode, and interrupt polarity associated with this interrupt - // message. These first three values are suitable for use in a fully - // specified connection parameter structure in a call to - // IoConnectInterruptEx. - // - - ULONG Vector; - KIRQL Irql; - KINTERRUPT_MODE Mode; - KINTERRUPT_POLARITY Polarity; - -} IO_INTERRUPT_MESSAGE_INFO_ENTRY, *PIO_INTERRUPT_MESSAGE_INFO_ENTRY; - -// -// Interrupt message information table definition -// - -typedef struct _IO_INTERRUPT_MESSAGE_INFO { - - // - // Unified IRQL - indicates the IRQL that will be used when calling a - // message service routine associated with any of the interrupt messages - // in this table. Such a unified IRQL will only exist in cases where 1) a - // driver provides a spinlock to IoConnectInterruptEx with the intent of - // serializing delivery of all of the messages listed in this table or 2) - // the driver provides a synchronization IRQL, and no spinlock, with the - // intent of blocking any message service routine associated with this - // table from directly preempting another one. If neither of these cases - // applies, then the different messages in this table are allowed to be - // delivered in parallel and at different IRQLs. In this case this field - // will be set to zero. - // - - KIRQL UnifiedIrql; - - // - // Message count - indicates the number of entries contained in this - // message information table. - // - - ULONG MessageCount; - - // - // Message info - lies at the start of a variable size array of - // information table entries, with the size of the array dictated by the - // message count associated with this table. Each entry describes a - // different interrupt message that has been allocated to this device. - // - - IO_INTERRUPT_MESSAGE_INFO_ENTRY MessageInfo[1]; - -} IO_INTERRUPT_MESSAGE_INFO, *PIO_INTERRUPT_MESSAGE_INFO; - -// -// Define the connection parameters associated with a fully specified -// interrupt connection request. -// - -typedef struct _IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS { - - // - // PhysicalDeviceObject - Supplies the physical device object associated - // with the interrupt being connected. This is normally the physical - // device object associated with the device that generates the given - // interrupt. - // - - __in PDEVICE_OBJECT PhysicalDeviceObject; - - // - // InterruptObject - Supplies a pointer to the location that will be used - // to return a pointer to the interrupt object allocated in - // association with the interrupt being connected. - // - - __out PKINTERRUPT *InterruptObject; - - // - // ServiceRoutine - Supplies the address of the interrupt service routine - // (ISR) that should be executed when the interrupt occurs. - // - - __in PKSERVICE_ROUTINE ServiceRoutine; - - // - // ServiceContext - Supplies an opaque pointer to the driver context - // information that should be passed to the ISR. - // - - __in PVOID ServiceContext; - - // - // SpinLock - Supplies an optional pointer to a spin lock that will be - // acquired before every call to the ISR. After providing a spin - // lock, the driver can synchronize with the ISR by acquiring the spin - // lock at the synchronization IRQL associated with the interrupt. If - // this parameter is not provided, then an internal spin lock will be - // acquired before each call to the ISR. The driver can use - // KeSynchronizeExecution to acquire this internal spin lock at the - // appropriate IRQL and thus synchronize with the ISR. - // - - __in_opt PKSPIN_LOCK SpinLock; - - // - // SynchronizeIrql - Supplies the IRQL at which the interrupt spin lock - // should be acquired and at which the ISR should be executed. This - // parameter must be greater than or equal to the IRQL associated with - // the interrupt. This parameter is most often used in conjunction - // with a caller provided spin lock to serialize ISR execution across - // multiple interrupts, however it can also be used without a spin - // lock to block this ISR from directly preempting or being directly - // preempted by some other ISR. - // - - __in KIRQL SynchronizeIrql; - - // - // FloatingSave - Supplies an indication of whether or not the machine's - // floating point state should be saved before invoking the ISR. - // - - __in BOOLEAN FloatingSave; - - // - // ShareVector - Supplies an indication of whether this interrupt vector - // can be shared with other interrupt objects. This value is usually - // passed to a driver as part of the translated resources sent along - // with IRP_MN_START_DEVICE. - // - - __in BOOLEAN ShareVector; - - // - // Vector - Supplies the system interrupt vector associated with the - // interrupt being connected. This value is usually passed to a - // driver as part of the translated resources sent along with - // IRP_MN_START_DEVICE. - // - - __in ULONG Vector; - - // - // Irql - Supplies the IRQL associated with the interrupt being connected. - // This value is usually passed to a driver as part of its translated - // resources sent along with IRP_MN_START_DEVICE. - // - - __in KIRQL Irql; - - // - // InterruptMode - Supplies the trigger mode of the interrupt being - // connected. This parameter must be LevelSensitive for level - // triggered interrupts and Latched for edge triggered interrupts. - // This value is usually passed to a driver as part of its translated - // resources sent along with IRP_MN_START_DEVICE. - // - - __in KINTERRUPT_MODE InterruptMode; - - // - // ProcessorEnableMask - Supplies an affinity mask indicating the set of - // processors on which delivery of the interrupt should be allowed. - // This value is usually passed to a driver as part of its translated - // resources sent along with IRP_MN_START_DEVICE. - // - - __in KAFFINITY ProcessorEnableMask; - - // - // Group - Supplies a group number indicating the group of the processors - // on which delivery of the interrupt should be allowed. This value - // is usually passed to a driver as part of its translated resources - // sent along with IRP_MN_START_DEVICE. This value is ignored if the - // the version CONNECT_FULLY_SPECIFIED is used, in which case the - // group number is always 0. - // - - __in USHORT Group; - -} IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS, - *PIO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS; - -// -// Define the connection parameters associated with a line based interrupt -// connection request. -// - -typedef struct _IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS { - - // - // PhysicalDeviceObject - Supplies the physical device object associated - // with the line based interrupt being connected. In order to - // correctly determine the interrupt to connect, this is generally - // required to be the physical device object associated with the - // device that generates the interrupt of interest. - // - - __in PDEVICE_OBJECT PhysicalDeviceObject; - - // - // InterruptObject - Supplies a pointer to the location that will be used - // to return a pointer to the interrupt object allocated in - // association with the interrupt being connected. - // - - __out PKINTERRUPT *InterruptObject; - - // - // ServiceRoutine - Supplies the address of the interrupt service routine - // (ISR) that should be executed when the interrupt occurs. - // - - __in PKSERVICE_ROUTINE ServiceRoutine; - - // - // ServiceContext - Supplies an opaque pointer to the driver context - // information that should be passed to the ISR. - // - - __in PVOID ServiceContext; - - // - // SpinLock - Supplies an optional pointer to a spin lock that will be - // acquired before every call to the ISR. After providing a spin - // lock, the driver can synchronize with the ISR by acquiring the spin - // lock at the synchronization IRQL associated with the interrupt. If - // this parameter is not provided, then an internal spin lock will be - // acquired before each call to the ISR. The driver can use - // KeSynchronizeExecution to acquire this internal spin lock at the - // appropriate IRQL and thus synchronize with the ISR. - // - - __in_opt PKSPIN_LOCK SpinLock; - - // - // SynchronizeIrql - Supplies an optional IRQL at which the interrupt spin - // lock should be acquired and at which the ISR should be executed. - // If a nonzero value is provided for this parameter, it must be - // greater than or equal to the IRQL associated with the interrupt. - // This parameter is most often used in conjunction with a caller - // provided spin lock to serialize ISR execution across multiple - // interrupts, however it can also be used without a spin lock to - // block this ISR from directly preempting or being directly preempted - // by some other ISR. If this parameter is omitted then the IRQL of - // the interrupt being connected is used as the sychronization IRQL, - // both in the case where the caller provides a spin lock and in the - // case where the spin lock is omitted. - // - - __in_opt KIRQL SynchronizeIrql; - - // - // FloatingSave - Supplies an indication of whether or not the machine's - // floating point state should be saved before invoking the ISR. - // - - __in BOOLEAN FloatingSave; - -} IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS, - *PIO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS; - -// -// Define the connection parameters associated with a message signaled -// interrupt connection request. -// - -typedef struct _IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS { - - // - // PhysicalDeviceObject - Supplies the physical device object associated - // with the interrupt messages being connected. In order to correctly - // determine the set of messages to connect, this is generally - // required to be the physical device object associated with the - // device that generates the interrupt messages of interest. - // - - __in PDEVICE_OBJECT PhysicalDeviceObject; - - // - // ConnectionContext - Supplies a union containing a pointer to the - // location that will be used to return the interrupt connection - // context to the caller. If message based interrupt connection is - // successful, then the connection context is a pointer to the - // associated interrupt message information table. If connection - // succeeds only after falling back on the associated line based - // interrupt, then the connection context is a pointer to the - // associated interrupt object. - // - - union { - __out PVOID *Generic; - __out PIO_INTERRUPT_MESSAGE_INFO *InterruptMessageTable; - __out PKINTERRUPT *InterruptObject; - } ConnectionContext; - - // - // MessageServiceRoutine - Supplies the interrupt message service routine - // (IMSR) that should be executed every time any one of the interrupt - // messages being connected is signaled. - // - - __in PKMESSAGE_SERVICE_ROUTINE MessageServiceRoutine; - - // - // ServiceContext - Supplies an opaque pointer to the driver context - // information that should be passed to the IMSR. - // - - __in PVOID ServiceContext; - - // - // SpinLock - Supplies an optional pointer to a spin lock that will be - // acquired before every call to the IMSR. After providing a spin - // lock, the driver can synchronize with the IMSR by acquiring the - // spin lock at the synchronization IRQL associated with the IMSR. - // Note that providing a spin lock will serialize processing of all of - // the interrupt messages being connected. In other words, providing - // a spin lock implies that no two interrupt messages out of the set - // being connected can ever be serviced in parallel by the IMSR. - // - // If this parameter is not provided, then an internal spin lock will - // be acquired before each call to the IMSR. This internal spin lock - // is associated with the interrupt object corresponding to the actual - // message that caused us to execute the IMSR, meaning that the IMSR - // can run on multiple processors and potentially at multiple IRQLs in - // this case. KeSynchronizeExecution can be used to acquire this - // internal spin lock at the appropriate IRQL, thus synchronizing with - // IMSR execution associated with a specific interrupt message while - // still allowing all other messages to be serviced as they are - // signaled. - // - - __in_opt PKSPIN_LOCK SpinLock; - - // - // SynchronizeIrql - Supplies an optional IRQL at which the interrupt spin - // lock should be acquired and at which the IMSR should be executed. - // If a nonzero value is provided for this parameter, it must be - // greater than or equal to the maximum IRQL associated with any of - // the interrupt messages being connected. - // - // This parameter is most often used in conjunction with a caller - // provided spin lock to serialize IMSR execution across multiple - // messages. If a spin lock is provided and this parameter is - // omitted, then the synchronization IRQL will be set to the maximum - // IRQL associated with any of the interrupt messages. - // - // This parameter can be used without a spin lock to block this IMSR - // from directly preempting or being directly preempted by itself, - // some other IMSR, or some other line based interrupt service - // routine. If this parameter is omitted and the spin lock is also - // omitted, then the IMSR will be executed at the IRQL associated with - // the individual message being serviced. In this case it is possible - // for the IMSR to preempt itself if it is connected to multiple - // messages with different associated IRQLs. - // - - __in_opt KIRQL SynchronizeIrql; - - // - // FloatingSave - Supplies an indication of whether or not the machine's - // floating point state should be saved before invoking the IMSR. - // - - __in BOOLEAN FloatingSave; - - // - // FallBackServiceRoutine - Supplies an optional address of an interrupt - // service routine (ISR) that should be executed when the line based - // interrupt associated with this device is signaled. This parameter - // will only be used when connection to this device's interrupt - // messages fails, which most commonly occurs when no interrupt - // messages are available for this device. - // - // Connection to the fall back service routine is functionally - // identical to a normal line based interrupt connection operation, - // the only difference being that in this case the service context, - // spin lock, synchronization IRQL, and floating save parameters given - // for the IMSR are reused when connecting the ISR. - // - - __in_opt PKSERVICE_ROUTINE FallBackServiceRoutine; - -} IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS, - *PIO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS; - -// -// Define the different interrupt connection types that can be requested -// through IoConnectInterruptEx -// - -#define CONNECT_FULLY_SPECIFIED 0x1 -#define CONNECT_LINE_BASED 0x2 -#define CONNECT_MESSAGE_BASED 0x3 -#define CONNECT_FULLY_SPECIFIED_GROUP 0x4 -#define CONNECT_CURRENT_VERSION 0x4 - -// -// Interrupt connection parameter structure definition -// - -typedef struct _IO_CONNECT_INTERRUPT_PARAMETERS { - - // - // Version - Supplies the type of interrupt connection requested by this - // structure. This field must hold one of the following values. - // - // CONNECT_FULLY_SPECIFIED - Indicates that an attempt should be - // made to connect to the precise interrupt described by this - // structure. This vector can be either line based or message - // signaled. - // - // CONNECT_LINE_BASED - Indicates that an attempt should be made - // to connect to the line based interrupt associated with this - // device. - // - // CONNECT_MESSAGE_BASED - Indicates that an attempt should be - // made to connect to the interrupt messages that have been - // allocated for this device, optionally falling back on the - // device's line based interrupt if interrupt messages aren't - // available. - // - // CONNECT_FULLY_SPECIFIED_GROUP - Same as CONNECT_FULLY_SPECIFIED, - // except that a group number is also specified to indicate - // the group of processors on which the interrupt is allowed to - // be delivered. - // - // After successfully connecting an interrupt, this field is filled on - // output with the type of connection that was performed. This will - // always be the connection type given by the caller except in the - // case of a message based connection attempt that falls back to - // connection to the associated line based interrupt. - // - // If the caller passes an unsupported connection type, this field is - // filled on output with the maximum connection type supported by the - // interrupt connection routine. - // - - __inout ULONG Version; - - // - // Define a union to overlay the connection parameter structures - // associated with the different connection types on top of one another. - // - - union { - IO_CONNECT_INTERRUPT_FULLY_SPECIFIED_PARAMETERS FullySpecified; - IO_CONNECT_INTERRUPT_LINE_BASED_PARAMETERS LineBased; - IO_CONNECT_INTERRUPT_MESSAGE_BASED_PARAMETERS MessageBased; - }; - -} IO_CONNECT_INTERRUPT_PARAMETERS, *PIO_CONNECT_INTERRUPT_PARAMETERS; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -NTSTATUS -IoConnectInterruptEx ( - __inout PIO_CONNECT_INTERRUPT_PARAMETERS Parameters - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_valueIs(==0;<0) -NTKERNELAPI -NTSTATUS -IoCreateDevice( - __in PDRIVER_OBJECT DriverObject, - __in ULONG DeviceExtensionSize, - __in_opt PUNICODE_STRING DeviceName, - __in DEVICE_TYPE DeviceType, - __in ULONG DeviceCharacteristics, - __in BOOLEAN Exclusive, - __out - __drv_out_deref( - __drv_allocatesMem(Mem) - __drv_when((((inFunctionClass$("DRIVER_INITIALIZE")) - ||(inFunctionClass$("DRIVER_DISPATCH")))), - __drv_aliasesMem) - __on_failure(__null)) - PDEVICE_OBJECT *DeviceObject - ); -#endif - -#define WDM_MAJORVERSION 0x06 -#define WDM_MINORVERSION 0x00 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_preferredFunction("RtlIsNtDdiVersionAvailable","Preferred") -NTKERNELAPI -BOOLEAN -IoIsWdmVersionAvailable( - __drv_when(MajorVersion!=1&&MajorVersion!=6, - __in __drv_reportError("MajorVersion must be 1 or 6")) UCHAR MajorVersion, - __in __drv_when(MinorVersion!=0 && MinorVersion!=5 && MinorVersion!=16 - && MinorVersion!=32 && MinorVersion!=48, - __drv_reportError("MinorVersion must be 0, 0x5, 0x10, 0x20, or 0x30")) - UCHAR MinorVersion - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoCreateFile( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG Disposition, - __in ULONG CreateOptions, - __in_opt PVOID EaBuffer, - __in ULONG EaLength, - __in CREATE_FILE_TYPE CreateFileType, - __in_opt PVOID InternalParameters, - __in ULONG Options - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PKEVENT -IoCreateNotificationEvent( - __in PUNICODE_STRING EventName, - __out PHANDLE EventHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoCreateSymbolicLink( - __in PUNICODE_STRING SymbolicLinkName, - __in PUNICODE_STRING DeviceName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -PKEVENT -IoCreateSynchronizationEvent( - __in PUNICODE_STRING EventName, - __out PHANDLE EventHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoCreateUnprotectedSymbolicLink( - __in PUNICODE_STRING SymbolicLinkName, - __in PUNICODE_STRING DeviceName - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -__drv_clearDoInit(__yes) -NTKERNELAPI -VOID -IoDeleteDevice( - __in __drv_mustHold(Memory) __drv_freesMem(Mem) PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoDeleteSymbolicLink( - __in PUNICODE_STRING SymbolicLinkName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoDetachDevice( - __inout PDEVICE_OBJECT TargetDevice - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoDisconnectInterrupt( - __in PKINTERRUPT InterruptObject - ); -#endif - -// -// Interrupt disconnection parameter structure definition -// - -typedef struct _IO_DISCONNECT_INTERRUPT_PARAMETERS { - - // - // Version - Supplies the type of interrupt disconnection operation - // requested by this structure. This field must match the connection - // type returned by a corresponding successful call to - // IoConnectInterruptEx. - // - - __in ULONG Version; - - // - // ConnectionContext - Supplies a union containing the connection context - // associated with the interrupt being disconnected. When - // disconnecting fully specified or line based interrupts, this - // parameter supplies the interrupt object pointer that was returned - // when the interrupt was initially connected. When disconnecting a - // set of interrupt messages, this parameter supplies the interrupt - // message information table pointer that was returned when the - // interrupt messages were initially connected. - // - - union { - __in PVOID Generic; - __in PKINTERRUPT InterruptObject; - __in PIO_INTERRUPT_MESSAGE_INFO InterruptMessageTable; - } ConnectionContext; - -} IO_DISCONNECT_INTERRUPT_PARAMETERS, *PIO_DISCONNECT_INTERRUPT_PARAMETERS; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -IoDisconnectInterruptEx ( - __in PIO_DISCONNECT_INTERRUPT_PARAMETERS Parameters - ); -#endif // NTDDI_VERSION >= NTDDI_VISTA - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -NTSTATUS -IoGetAffinityInterrupt ( - __in PKINTERRUPT InterruptObject, - __out PGROUP_AFFINITY GroupAffinity - ); -#endif // NTDDI_VERSION >= NTDDI_WIN7 - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_freesMem(Mem) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoFreeIrp( - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoFreeMdl( - PMDL Mdl - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PDEVICE_OBJECT -__drv_maxIRQL(DISPATCH_LEVEL) -IoGetAttachedDeviceReference( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - - -FORCEINLINE -__drv_aliasesMem -PIO_STACK_LOCATION -IoGetCurrentIrpStackLocation( - __in PIRP Irp -) -/*-- - -Routine Description: - - This routine is invoked to return a pointer to the current stack location - in an I/O Request Packet (IRP). - -Arguments: - - Irp - Pointer to the I/O Request Packet. - -Return Value: - - The function value is a pointer to the current stack location in the - packet. - ---*/ -{ - ASSERT(Irp->CurrentLocation <= Irp->StackCount + 1); - return Irp->Tail.Overlay.CurrentStackLocation; -} - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_aliasesMem -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PVOID -IoGetDriverObjectExtension( - __in PDRIVER_OBJECT DriverObject, - __in PVOID ClientIdentificationAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PEPROCESS -IoGetCurrentProcess( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoGetDeviceObjectPointer( - __in PUNICODE_STRING ObjectName, - __in ACCESS_MASK DesiredAccess, - __out PFILE_OBJECT *FileObject, - __out PDEVICE_OBJECT *DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_valueIs(!=0;==0) -NTKERNELAPI -struct _DMA_ADAPTER * -IoGetDmaAdapter( - __in_opt PDEVICE_OBJECT PhysicalDeviceObject, // required for PnP drivers - __in struct _DEVICE_DESCRIPTION *DeviceDescription, - __out __drv_when(return!=0, __drv_IoGetDmaAdapter __deref __checkReturn) - PULONG NumberOfMapRegisters - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -BOOLEAN -IoForwardIrpSynchronously( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp - ); - -#define IoForwardAndCatchIrp IoForwardIrpSynchronously - -#endif - - -//++ -// -// ULONG -// IoGetFunctionCodeFromCtlCode( -// __in ULONG ControlCode -// ) -// -// Routine Description: -// -// This routine extracts the function code from IOCTL and FSCTL function -// control codes. -// This routine should only be used by kernel mode code. -// -// Arguments: -// -// ControlCode - A function control code (IOCTL or FSCTL) from which the -// function code must be extracted. -// -// Return Value: -// -// The extracted function code. -// -// Note: -// -// The CTL_CODE macro, used to create IOCTL and FSCTL function control -// codes, is defined in ntioapi.h -// -//-- - -#define IoGetFunctionCodeFromCtlCode( ControlCode ) (\ - ( ControlCode >> 2) & 0x00000FFF ) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -IoGetInitialStack( - VOID - ); -#endif - -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -IoGetStackLimits ( - __out PULONG_PTR LowLimit, - __out PULONG_PTR HighLimit - ); - -#if (NTDDI_VERSION >= NTDDI_VISTA) -LOGICAL -IoWithinStackLimits( - __in ULONG_PTR RegionStart, - __in SIZE_T RegionSize - ); -#endif - - -#define IoCallDriverStackSafeDefault(a, b) IoCallDriver(a, b) - -// -// The following function is used to tell the caller how much stack is available -// - -__drv_maxIRQL(APC_LEVEL) -FORCEINLINE -ULONG_PTR -IoGetRemainingStackSize ( - VOID - ) -{ - ULONG_PTR Top; - ULONG_PTR Bottom; - - IoGetStackLimits( &Bottom, &Top ); - return((ULONG_PTR)(&Top) - Bottom ); -} - -FORCEINLINE -__drv_aliasesMem -PIO_STACK_LOCATION -IoGetNextIrpStackLocation( - __in PIRP Irp - ) -/*++ -Routine Description: - - This routine is invoked to return a pointer to the next stack location - in an I/O Request Packet (IRP). - -Arguments: - - Irp - Pointer to the I/O Request Packet. - -Return Value: - - The function value is a pointer to the next stack location in the packet. - ---*/ -{ - ASSERT(Irp->CurrentLocation > 0); - - return ((Irp)->Tail.Overlay.CurrentStackLocation - 1 ); -} - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PDEVICE_OBJECT -IoGetRelatedDeviceObject( - __in PFILE_OBJECT FileObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -PIRP -IoGetTopLevelIrp( - VOID - ); -#endif - - - -VOID -FORCEINLINE -IoInitializeDpcRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIO_DPC_ROUTINE DpcRoutine - ) -/*++ - -Routine Description: - - This routine is invoked to initialize the DPC in a device object for a - device driver during its initialization routine. The DPC is used later - when the driver interrupt service routine requests that a DPC routine - be queued for later execution. - -Arguments: - - DeviceObject - Pointer to the device object that the request is for. - - DpcRoutine - Address of the driver's DPC routine to be executed when - the DPC is dequeued for processing. - -Return Value: - - None. - ---*/ -{ - KeInitializeDpc( &DeviceObject->Dpc, -#pragma warning (suppress: 28165) // implementation of the required way - (PKDEFERRED_ROUTINE) DpcRoutine, - DeviceObject ); -} - -#if (NTDDI_VERSION >= NTDDI_WS03) -VOID -FORCEINLINE -IoInitializeThreadedDpcRequest( - __in PDEVICE_OBJECT DeviceObject, - __in PIO_DPC_ROUTINE DpcRoutine - ) -/*++ - -Routine Description: - - This routine is invoked to initialize the DPC in a device object for a - device driver during its initialization routine. The DPC is used later - when the driver interrupt service routine requests that a DPC routine - be queued for later execution. - - This initializes the DPC as a threaded DPC. - -Arguments: - - DeviceObject - Pointer to the device object that the request is for. - - DpcRoutine - Address of the driver's DPC routine to be executed when - the DPC is dequeued for processing. - -Return Value: - - None. - ---*/ -{ -#pragma warning (suppress: 28128) // implementation of the required way - KeInitializeThreadedDpc( &DeviceObject->Dpc, -#pragma warning (suppress: 28165) // implementation of the required way - (PKDEFERRED_ROUTINE) DpcRoutine, - DeviceObject ); -} -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoInitializeIrp( - __inout PIRP Irp, - __in USHORT PacketSize, - __in CCHAR StackSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoInitializeTimer( - __in PDEVICE_OBJECT DeviceObject, - __in PIO_TIMER_ROUTINE TimerRoutine, - __in_opt __drv_aliasesMem PVOID Context - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoReuseIrp( - __inout PIRP Irp, - __in NTSTATUS Iostatus - ); -#endif - - -//++ -// -// BOOLEAN -// IoIsErrorUserInduced( -// __in NTSTATUS Status -// ) -// -// Routine Description: -// -// This routine is invoked to determine if an error was as a -// result of user actions. Typically these error are related -// to removable media and will result in a pop-up. -// -// Arguments: -// -// Status - The status value to check. -// -// Return Value: -// The function value is TRUE if the user induced the error, -// otherwise FALSE is returned. -// -//-- -#define IoIsErrorUserInduced( Status ) ((BOOLEAN) \ - (((Status) == STATUS_DEVICE_NOT_READY) || \ - ((Status) == STATUS_IO_TIMEOUT) || \ - ((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \ - ((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \ - ((Status) == STATUS_VERIFY_REQUIRED) || \ - ((Status) == STATUS_UNRECOGNIZED_MEDIA) || \ - ((Status) == STATUS_WRONG_VOLUME))) - - - - -FORCEINLINE -VOID -IoMarkIrpPending( - __inout PIRP Irp -) -/*++ -Routine Description: - - This routine marks the specified I/O Request Packet (IRP) to indicate - that an initial status of STATUS_PENDING was returned to the caller. - This is used so that I/O completion can determine whether or not to - fully complete the I/O operation requested by the packet. - -Arguments: - - Irp - Pointer to the I/O Request Packet to be marked pending. - -Return Value: - - None. - ---*/ -{ - IoGetCurrentIrpStackLocation( (Irp) )->Control |= SL_PENDING_RETURNED; -} - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoRegisterShutdownNotification( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoRegisterLastChanceShutdownNotification( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_mustHoldCancelSpinLock -__drv_releasesCancelSpinLock -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoReleaseCancelSpinLock( - __in __drv_restoresIRQL __drv_useCancelIRQL KIRQL Irql - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoRemoveShareAccess( - __in PFILE_OBJECT FileObject, - __inout PSHARE_ACCESS ShareAccess - ); -#endif - - -//++ -// -// VOID -// IoRequestDpc( -// __in PDEVICE_OBJECT DeviceObject, -// __in PIRP Irp, -// __in PVOID Context -// ) -// -// Routine Description: -// -// This routine is invoked by the device driver's interrupt service routine -// to request that a DPC routine be queued for later execution at a lower -// IRQL. -// -// Arguments: -// -// DeviceObject - Device object for which the request is being processed. -// -// Irp - Pointer to the current I/O Request Packet (IRP) for the specified -// device. -// -// Context - Provides a general context parameter to be passed to the -// DPC routine. -// -// Return Value: -// -// None. -// -//-- - -#define IoRequestDpc( DeviceObject, Irp, Context ) ( \ - KeInsertQueueDpc( &(DeviceObject)->Dpc, (Irp), (Context) ) ) - -//++ -// -// PDRIVER_CANCEL -// IoSetCancelRoutine( -// __in PIRP Irp, -// __in PDRIVER_CANCEL CancelRoutine -// ) -// -// Routine Description: -// -// This routine is invoked to set the address of a cancel routine which -// is to be invoked when an I/O packet has been canceled. -// -// Arguments: -// -// Irp - Pointer to the I/O Request Packet itself. -// -// CancelRoutine - Address of the cancel routine that is to be invoked -// if the IRP is cancelled. -// -// Return Value: -// -// Previous value of CancelRoutine field in the IRP. -// -//-- - -#define IoSetCancelRoutine( Irp, NewCancelRoutine ) ( \ - (PDRIVER_CANCEL) (ULONG_PTR) InterlockedExchangePointer( (PVOID *) &(Irp)->CancelRoutine, (PVOID) (ULONG_PTR)(NewCancelRoutine) ) ) - -__drv_maxIRQL(DISPATCH_LEVEL) -FORCEINLINE -VOID -IoSetCompletionRoutine( - __in PIRP Irp, - __in_opt PIO_COMPLETION_ROUTINE CompletionRoutine, - __in_opt __drv_aliasesMem PVOID Context, - __in BOOLEAN InvokeOnSuccess, - __in BOOLEAN InvokeOnError, - __in BOOLEAN InvokeOnCancel - ) -//++ -// -// Routine Description: -// -// This routine is invoked to set the address of a completion routine which -// is to be invoked when an I/O packet has been completed by a lower-level -// driver. -// -// Arguments: -// -// Irp - Pointer to the I/O Request Packet itself. -// -// CompletionRoutine - Address of the completion routine that is to be -// invoked once the next level driver completes the packet. -// -// Context - Specifies a context parameter to be passed to the completion -// routine. -// -// InvokeOnSuccess - Specifies that the completion routine is invoked when the -// operation is successfully completed. -// -// InvokeOnError - Specifies that the completion routine is invoked when the -// operation completes with an error status. -// -// InvokeOnCancel - Specifies that the completion routine is invoked when the -// operation is being canceled. -// -// Return Value: -// -// None. -// -//-- -{ - PIO_STACK_LOCATION irpSp; - ASSERT( (InvokeOnSuccess || InvokeOnError || InvokeOnCancel) ? (CompletionRoutine != NULL) : TRUE ); - irpSp = IoGetNextIrpStackLocation(Irp); - irpSp->CompletionRoutine = CompletionRoutine; - irpSp->Context = Context; - irpSp->Control = 0; - - if (InvokeOnSuccess) { - irpSp->Control = SL_INVOKE_ON_SUCCESS; - } - - if (InvokeOnError) { - irpSp->Control |= SL_INVOKE_ON_ERROR; - } - - if (InvokeOnCancel) { - irpSp->Control |= SL_INVOKE_ON_CANCEL; - } -} - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -__checkReturn -NTSTATUS -IoSetCompletionRoutineEx( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in PIO_COMPLETION_ROUTINE CompletionRoutine, - __in_opt PVOID Context, - __in BOOLEAN InvokeOnSuccess, - __in BOOLEAN InvokeOnError, - __in BOOLEAN InvokeOnCancel - ); -#endif - - -FORCEINLINE -VOID -IoSetNextIrpStackLocation ( - __inout PIRP Irp - ) -/*-- - -Routine Description: - - This routine is invoked to set the current IRP stack location to - the next stack location, i.e. it "pushes" the stack. - -Arguments: - - Irp - Pointer to the I/O Request Packet (IRP). - -Return Value: - - None. - ---*/ -{ - ASSERT(Irp->CurrentLocation > 0); - Irp->CurrentLocation--; - Irp->Tail.Overlay.CurrentStackLocation--; -} - -FORCEINLINE -VOID -IoCopyCurrentIrpStackLocationToNext( - __inout PIRP Irp -) -/*-- - -Routine Description: - - This routine is invoked to copy the IRP stack arguments and file - pointer from the current IrpStackLocation to the next - in an I/O Request Packet (IRP). - - If the caller wants to call IoCallDriver with a completion routine - but does not wish to change the arguments otherwise, - the caller first calls IoCopyCurrentIrpStackLocationToNext, - then IoSetCompletionRoutine, then IoCallDriver. - -Arguments: - - Irp - Pointer to the I/O Request Packet. - -Return Value: - - None. - ---*/ -{ - PIO_STACK_LOCATION irpSp; - PIO_STACK_LOCATION nextIrpSp; - irpSp = IoGetCurrentIrpStackLocation(Irp); - nextIrpSp = IoGetNextIrpStackLocation(Irp); - RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); - nextIrpSp->Control = 0; -} - -FORCEINLINE -VOID -IoSkipCurrentIrpStackLocation ( - __inout PIRP Irp -) -/*-- -Routine Description: - - This routine is invoked to increment the current stack location of - a given IRP. - - If the caller wishes to call the next driver in a stack, and does not - wish to change the arguments, nor does he wish to set a completion - routine, then the caller first calls IoSkipCurrentIrpStackLocation - and the calls IoCallDriver. - -Arguments: - - Irp - Pointer to the I/O Request Packet. - -Return Value: - - None ---*/ -{ - ASSERT(Irp->CurrentLocation <= Irp->StackCount); - Irp->CurrentLocation++; - Irp->Tail.Overlay.CurrentStackLocation++; -} - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoSetShareAccess( - __in ACCESS_MASK DesiredAccess, - __in ULONG DesiredShareAccess, - __inout PFILE_OBJECT FileObject, - __out PSHARE_ACCESS ShareAccess - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -IoSetShareAccessEx( - __in ACCESS_MASK DesiredAccess, - __in ULONG DesiredShareAccess, - __inout PFILE_OBJECT FileObject, - __out PSHARE_ACCESS ShareAccess, - __in PBOOLEAN WritePermission - ); -#endif - - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoSetTopLevelIrp( - __in_opt PIRP Irp - ); -#endif - - - - - -typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK * PIO_REMOVE_LOCK_TRACKING_BLOCK; - -typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK { - BOOLEAN Removed; - BOOLEAN Reserved [3]; - __volatile LONG IoCount; - KEVENT RemoveEvent; - -} IO_REMOVE_LOCK_COMMON_BLOCK; - -typedef struct _IO_REMOVE_LOCK_DBG_BLOCK { - LONG Signature; - ULONG HighWatermark; - LONGLONG MaxLockedTicks; - LONG AllocateTag; - LIST_ENTRY LockList; - KSPIN_LOCK Spin; - __volatile LONG LowMemoryCount; - ULONG Reserved1[4]; - PVOID Reserved2; - PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks; -} IO_REMOVE_LOCK_DBG_BLOCK; - -typedef struct _IO_REMOVE_LOCK { - IO_REMOVE_LOCK_COMMON_BLOCK Common; -#if DBG - IO_REMOVE_LOCK_DBG_BLOCK Dbg; -#endif -} IO_REMOVE_LOCK, *PIO_REMOVE_LOCK; - -#define IoInitializeRemoveLock(Lock, Tag, Maxmin, HighWater) \ - IoInitializeRemoveLockEx (Lock, Tag, Maxmin, HighWater, sizeof (IO_REMOVE_LOCK)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -NTAPI -IoInitializeRemoveLockEx( - __in PIO_REMOVE_LOCK Lock, - __in ULONG AllocateTag, // Used only on checked kernels - __in ULONG MaxLockedMinutes, // Used only on checked kernels - __in ULONG HighWatermark, // Used only on checked kernels - __in ULONG RemlockSize // are we checked or free - ); -#endif - -// -// Initialize a remove lock. -// -// Note: Allocation for remove locks needs to be within the device extension, -// so that the memory for this structure stays allocated until such time as the -// device object itself is deallocated. -// - -#if DBG -#define IoAcquireRemoveLock(RemoveLock, Tag) \ - IoAcquireRemoveLockEx(RemoveLock, Tag, __FILE__, __LINE__, sizeof (IO_REMOVE_LOCK)) -#else -#define IoAcquireRemoveLock(RemoveLock, Tag) \ - IoAcquireRemoveLockEx(RemoveLock, Tag, "", 1, sizeof (IO_REMOVE_LOCK)) -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -IoAcquireRemoveLockEx ( - __in PIO_REMOVE_LOCK RemoveLock, - __in_opt PVOID Tag, // Optional - __in PCSTR File, - __in ULONG Line, - __in ULONG RemlockSize // are we checked or free - ); -#endif - -// -// Routine Description: -// -// This routine is called to acquire the remove lock for a device object. -// While the lock is held, the caller can assume that no pending pnp REMOVE -// requests will be completed. -// -// The lock should be acquired immediately upon entering a dispatch routine. -// It should also be acquired before creating any new reference to the -// device object if there's a chance of releasing the reference before the -// new one is done, in addition to references to the driver code itself, -// which is removed from memory when the last device object goes. -// -// Arguments: -// -// RemoveLock - A pointer to an initialized REMOVE_LOCK structure. -// -// Tag - Used for tracking lock allocation and release. The same tag -// specified when acquiring the lock must be used to release the lock. -// Tags are only checked in checked versions of the driver. -// -// File - set to __FILE__ as the location in the code where the lock was taken. -// -// Line - set to __LINE__. -// -// Return Value: -// -// Returns whether or not the remove lock was obtained. -// If successful the caller should continue with work calling -// IoReleaseRemoveLock when finished. -// -// If not successful the lock was not obtained. The caller should abort the -// work but not call IoReleaseRemoveLock. -// - -#define IoReleaseRemoveLock(RemoveLock, Tag) \ - IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof (IO_REMOVE_LOCK)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -NTAPI -IoReleaseRemoveLockEx( - __in PIO_REMOVE_LOCK RemoveLock, - __in_opt PVOID Tag, // Optional - __in ULONG RemlockSize // are we checked or free - ); -#endif - -// -// -// Routine Description: -// -// This routine is called to release the remove lock on the device object. It -// must be called when finished using a previously locked reference to the -// device object. If an Tag was specified when acquiring the lock then the -// same Tag must be specified when releasing the lock. -// -// When the lock count reduces to zero, this routine will signal the waiting -// event to release the waiting thread deleting the device object protected -// by this lock. -// -// Arguments: -// -// DeviceObject - the device object to lock -// -// Tag - The TAG (if any) specified when acquiring the lock. This is used -// for lock tracking purposes -// -// Return Value: -// -// none -// - -#define IoReleaseRemoveLockAndWait(RemoveLock, Tag) \ - IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof (IO_REMOVE_LOCK)) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -NTAPI -IoReleaseRemoveLockAndWaitEx( - __in PIO_REMOVE_LOCK RemoveLock, - __in_opt PVOID Tag, - __in ULONG RemlockSize // are we checked or free - ); -#endif - -// -// -// Routine Description: -// -// This routine is called when the client would like to delete the -// remove-locked resource. This routine will block until all the remove -// locks have released. -// -// This routine MUST be called after acquiring the lock. -// -// Arguments: -// -// RemoveLock -// -// Return Value: -// -// none -// - - -//++ -// -// USHORT -// IoSizeOfIrp( -// __in CCHAR StackSize -// ) -// -// Routine Description: -// -// Determines the size of an IRP given the number of stack locations -// the IRP will have. -// -// Arguments: -// -// StackSize - Number of stack locations for the IRP. -// -// Return Value: -// -// Size in bytes of the IRP. -// -//-- - -#define IoSizeOfIrp( StackSize ) \ - ((USHORT) (sizeof( IRP ) + ((StackSize) * (sizeof( IO_STACK_LOCATION ))))) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) __drv_minIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartNextPacket( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN Cancelable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartNextPacketByKey( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN Cancelable, - __in ULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartPacket( - __in PDEVICE_OBJECT DeviceObject, - __in PIRP Irp, - __in_opt PULONG Key, - __in_opt PDRIVER_CANCEL CancelFunction - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -VOID -IoSetStartIoAttributes( - __in PDEVICE_OBJECT DeviceObject, - __in BOOLEAN DeferredStartIo, - __in BOOLEAN NonCancelable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStartTimer( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoStopTimer( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoUnregisterShutdownNotification( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -VOID -IoUpdateShareAccess( - __in PFILE_OBJECT FileObject, - __inout PSHARE_ACCESS ShareAccess - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -__drv_maxIRQL(DISPATCH_LEVEL) -IoWriteErrorLogEntry( - __in PVOID ElEntry - ); -#endif - -typedef struct _IO_WORKITEM *PIO_WORKITEM; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -ULONG -IoSizeofWorkItem( - VOID - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -VOID -IoInitializeWorkItem( - __in PVOID IoObject, - __in PIO_WORKITEM IoWorkItem - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -VOID -IoUninitializeWorkItem( - __in PIO_WORKITEM IoWorkItem - ); -#endif - -__drv_functionClass(IO_WORKITEM_ROUTINE) -__drv_requiresIRQL(PASSIVE_LEVEL) -__drv_sameIRQL -typedef -VOID -IO_WORKITEM_ROUTINE ( - __in PDEVICE_OBJECT DeviceObject, - __in_opt PVOID Context - ); - -typedef IO_WORKITEM_ROUTINE *PIO_WORKITEM_ROUTINE; - -typedef -VOID -IO_WORKITEM_ROUTINE_EX ( - __in PVOID IoObject, - __in_opt PVOID Context, - __in PIO_WORKITEM IoWorkItem - ); - -typedef IO_WORKITEM_ROUTINE_EX *PIO_WORKITEM_ROUTINE_EX; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -PIO_WORKITEM -IoAllocateWorkItem( - __in PDEVICE_OBJECT DeviceObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -VOID -IoFreeWorkItem( - __in PIO_WORKITEM IoWorkItem - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoQueueWorkItem( - __in PIO_WORKITEM IoWorkItem, - __in PIO_WORKITEM_ROUTINE WorkerRoutine, - __in WORK_QUEUE_TYPE QueueType, - __in_opt __drv_aliasesMem PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -IoQueueWorkItemEx( - __in PIO_WORKITEM IoWorkItem, - __in PIO_WORKITEM_ROUTINE_EX WorkerRoutine, - __in WORK_QUEUE_TYPE QueueType, - __in_opt __drv_aliasesMem PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoWMIRegistrationControl( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG Action -); -#endif - -// -// Action code for IoWMIRegistrationControl api -// - -#define WMIREG_ACTION_REGISTER 1 -#define WMIREG_ACTION_DEREGISTER 2 -#define WMIREG_ACTION_REREGISTER 3 -#define WMIREG_ACTION_UPDATE_GUIDS 4 -#define WMIREG_ACTION_BLOCK_IRPS 5 - -// -// Code passed in IRP_MN_REGINFO WMI irp -// - -#define WMIREGISTER 0 -#define WMIUPDATE 1 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoWMIAllocateInstanceIds( - __in GUID *Guid, - __in ULONG InstanceCount, - __out ULONG *FirstInstanceId - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoWMISuggestInstanceName( - __in_opt PDEVICE_OBJECT PhysicalDeviceObject, - __in_opt PUNICODE_STRING SymbolicLinkName, - __in BOOLEAN CombineNames, - __out PUNICODE_STRING SuggestedInstanceName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__checkReturn -__drv_maxIRQL(APC_LEVEL) -__drv_valueIs(==0;<0) -NTKERNELAPI -NTSTATUS -IoWMIWriteEvent( - __inout __drv_when(return==0, __drv_aliasesMem) PVOID WnodeEventItem - ); -#endif - -#if defined(_WIN64) -NTKERNELAPI -ULONG -IoWMIDeviceObjectToProviderId( - __in PDEVICE_OBJECT DeviceObject - ); -#else -#define IoWMIDeviceObjectToProviderId(DeviceObject) ((ULONG)(DeviceObject)) -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIOpenBlock( - __in GUID *DataBlockGuid, - __in ULONG DesiredAccess, - __out PVOID *DataBlockObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIQueryAllData( - __in PVOID DataBlockObject, - __inout ULONG *InOutBufferSize, - __out_bcount_opt(*InOutBufferSize) /* non paged */ PVOID OutBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIQueryAllDataMultiple( - __in_ecount(ObjectCount) PVOID *DataBlockObjectList, - __in ULONG ObjectCount, - __inout ULONG *InOutBufferSize, - __out_bcount_opt(*InOutBufferSize) /* non paged */ PVOID OutBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIQuerySingleInstance( - __in PVOID DataBlockObject, - __in PUNICODE_STRING InstanceName, - __inout ULONG *InOutBufferSize, - __out_bcount_opt(*InOutBufferSize) /* non paged */ PVOID OutBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTKERNELAPI -NTSTATUS -IoWMIQuerySingleInstanceMultiple( - __in_ecount(ObjectCount) PVOID *DataBlockObjectList, - __in_ecount(ObjectCount) PUNICODE_STRING InstanceNames, - __in ULONG ObjectCount, - __inout ULONG *InOutBufferSize, - __out_bcount_opt(*InOutBufferSize) /* non paged */ PVOID OutBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMISetSingleInstance( - __in PVOID DataBlockObject, - __in PUNICODE_STRING InstanceName, - __in ULONG Version, - __in ULONG ValueBufferSize, - __in_bcount(ValueBufferSize) PVOID ValueBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMISetSingleItem( - __in PVOID DataBlockObject, - __in PUNICODE_STRING InstanceName, - __in ULONG DataItemId, - __in ULONG Version, - __in ULONG ValueBufferSize, - __in_bcount(ValueBufferSize) PVOID ValueBuffer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIExecuteMethod( - __in PVOID DataBlockObject, - __in PUNICODE_STRING InstanceName, - __in ULONG MethodId, - __in ULONG InBufferSize, - __inout PULONG OutBufferSize, - __inout_bcount_part_opt(*OutBufferSize, InBufferSize) PUCHAR InOutBuffer - ); -#endif - -typedef -__drv_functionClass(WMI_NOTIFICATION_CALLBACK) -__drv_sameIRQL -VOID FWMI_NOTIFICATION_CALLBACK ( - PVOID Wnode, - PVOID Context - ); -typedef FWMI_NOTIFICATION_CALLBACK *WMI_NOTIFICATION_CALLBACK; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMISetNotificationCallback( - __inout PVOID Object, - __in WMI_NOTIFICATION_CALLBACK Callback, - __in_opt PVOID Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIHandleToInstanceName( - __in PVOID DataBlockObject, - __in HANDLE FileHandle, - __out PUNICODE_STRING InstanceName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoWMIDeviceObjectToInstanceName( - __in PVOID DataBlockObject, - __in PDEVICE_OBJECT DeviceObject, - __out PUNICODE_STRING InstanceName - ); -#endif - - -#if defined(_WIN64) - -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -IoIs32bitProcess( - __in_opt PIRP Irp - ); - -#endif - - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -IoFreeErrorLogEntry( - __in PVOID ElEntry - ); -#endif - -// Cancel SAFE API set start -// -// The following APIs are to help ease the pain of writing queue packages that -// handle the cancellation race well. The idea of this set of APIs is to not -// force a single queue data structure but allow the cancel logic to be hidden -// from the drivers. A driver implements a queue and as part of its header -// includes the IO_CSQ structure. In its initialization routine it calls -// IoInitializeCsq. Then in the dispatch routine when the driver wants to -// insert an IRP into the queue it calls IoCsqInsertIrp. When the driver wants -// to remove something from the queue it calls IoCsqRemoveIrp. Note that Insert -// can fail if the IRP was cancelled in the meantime. Remove can also fail if -// the IRP was already cancelled. -// -// There are typically two modes where drivers queue IRPs. These two modes are -// covered by the cancel safe queue API set. -// -// Mode 1: -// One is where the driver queues the IRP and at some later -// point in time dequeues an IRP and issues the IO request. -// For this mode the driver should use IoCsqInsertIrp and IoCsqRemoveNextIrp. -// The driver in this case is expected to pass NULL to the irp context -// parameter in IoInsertIrp. -// -// Mode 2: -// In this the driver queues theIRP, issues the IO request (like issuing a DMA -// request or writing to a register) and when the IO request completes (either -// using a DPC or timer) the driver dequeues the IRP and completes it. For this -// mode the driver should use IoCsqInsertIrp and IoCsqRemoveIrp. In this case -// the driver should allocate an IRP context and pass it in to IoCsqInsertIrp. -// The cancel API code creates an association between the IRP and the context -// and thus ensures that when the time comes to remove the IRP it can ascertain -// correctly. -// -// Note that the cancel API set assumes that the field DriverContext[3] is -// always available for use and that the driver does not use it. -// - - -// -// Bookkeeping structure. This should be opaque to drivers. -// Drivers typically include this as part of their queue headers. -// Given a CSQ pointer the driver should be able to get its -// queue header using CONTAINING_RECORD macro -// - -typedef struct _IO_CSQ IO_CSQ, *PIO_CSQ; - -#define IO_TYPE_CSQ_IRP_CONTEXT 1 -#define IO_TYPE_CSQ 2 -#define IO_TYPE_CSQ_EX 3 - -// -// IRP context structure. This structure is necessary if the driver is using -// the second mode. -// - -typedef struct _IO_CSQ_IRP_CONTEXT { - ULONG Type; - PIRP Irp; - PIO_CSQ Csq; -} IO_CSQ_IRP_CONTEXT, *PIO_CSQ_IRP_CONTEXT; - -// -// Routines that insert/remove IRP -// - -typedef VOID -IO_CSQ_INSERT_IRP ( - __in struct _IO_CSQ *Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_INSERT_IRP *PIO_CSQ_INSERT_IRP; - -typedef NTSTATUS -IO_CSQ_INSERT_IRP_EX ( - __in struct _IO_CSQ *Csq, - __in PIRP Irp, - __in PVOID InsertContext - ); - -typedef IO_CSQ_INSERT_IRP_EX *PIO_CSQ_INSERT_IRP_EX; - -typedef VOID -IO_CSQ_REMOVE_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_REMOVE_IRP *PIO_CSQ_REMOVE_IRP; - -// -// Retrieves next entry after Irp from the queue. -// Returns NULL if there are no entries in the queue. -// If Irp is NUL, returns the entry in the head of the queue. -// This routine does not remove the IRP from the queue. -// - - -typedef PIRP -IO_CSQ_PEEK_NEXT_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in PVOID PeekContext - ); - -typedef IO_CSQ_PEEK_NEXT_IRP *PIO_CSQ_PEEK_NEXT_IRP; - -// -// Lock routine that protects the cancel safe queue. -// - -typedef VOID -IO_CSQ_ACQUIRE_LOCK ( - __in PIO_CSQ Csq, - __out PKIRQL Irql - ); - -typedef IO_CSQ_ACQUIRE_LOCK *PIO_CSQ_ACQUIRE_LOCK; - -typedef VOID -IO_CSQ_RELEASE_LOCK ( - __in PIO_CSQ Csq, - __in KIRQL Irql - ); - -typedef IO_CSQ_RELEASE_LOCK *PIO_CSQ_RELEASE_LOCK; - -// -// Completes the IRP with STATUS_CANCELLED. IRP is guaranteed to be valid -// In most cases this routine just calls IoCompleteRequest(Irp, STATUS_CANCELLED); -// - -typedef VOID -IO_CSQ_COMPLETE_CANCELED_IRP ( - __in PIO_CSQ Csq, - __in PIRP Irp - ); - -typedef IO_CSQ_COMPLETE_CANCELED_IRP *PIO_CSQ_COMPLETE_CANCELED_IRP; - -// -// Bookkeeping structure. This should be opaque to drivers. -// Drivers typically include this as part of their queue headers. -// Given a CSQ pointer the driver should be able to get its -// queue header using CONTAINING_RECORD macro -// - -typedef struct _IO_CSQ { - ULONG Type; - PIO_CSQ_INSERT_IRP CsqInsertIrp; - PIO_CSQ_REMOVE_IRP CsqRemoveIrp; - PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp; - PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock; - PIO_CSQ_RELEASE_LOCK CsqReleaseLock; - PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp; - PVOID ReservePointer; // Future expansion -} IO_CSQ, *PIO_CSQ; - -// -// Initializes the cancel queue structure. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -NTSTATUS -IoCsqInitialize( - __in PIO_CSQ Csq, - __in PIO_CSQ_INSERT_IRP CsqInsertIrp, - __in PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - __in PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - __in PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - __in PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - __in PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -NTSTATUS -IoCsqInitializeEx( - __in PIO_CSQ Csq, - __in PIO_CSQ_INSERT_IRP_EX CsqInsertIrp, - __in PIO_CSQ_REMOVE_IRP CsqRemoveIrp, - __in PIO_CSQ_PEEK_NEXT_IRP CsqPeekNextIrp, - __in PIO_CSQ_ACQUIRE_LOCK CsqAcquireLock, - __in PIO_CSQ_RELEASE_LOCK CsqReleaseLock, - __in PIO_CSQ_COMPLETE_CANCELED_IRP CsqCompleteCanceledIrp - ); -#endif - -// -// The caller calls this routine to insert the IRP and return STATUS_PENDING. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -VOID -IoCsqInsertIrp( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in_opt PIO_CSQ_IRP_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03) -NTKERNELAPI -NTSTATUS -IoCsqInsertIrpEx( - __in PIO_CSQ Csq, - __in PIRP Irp, - __in_opt PIO_CSQ_IRP_CONTEXT Context, - __in_opt PVOID InsertContext - ); -#endif - -// -// Returns an IRP if one can be found. NULL otherwise. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -PIRP -IoCsqRemoveNextIrp( - __in PIO_CSQ Csq, - __in_opt PVOID PeekContext - ); -#endif - -// -// This routine is called from timeout or DPCs. -// The context is presumably part of the DPC or timer context. -// If succesfull returns the IRP associated with context. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -NTKERNELAPI -PIRP -IoCsqRemoveIrp( - __in PIO_CSQ Csq, - __in PIO_CSQ_IRP_CONTEXT Context - ); -#endif - -// Cancel SAFE API set end - - -#if (NTDDI_VERSION >= NTDDI_WINXPSP1) -NTKERNELAPI -NTSTATUS -IoValidateDeviceIoControlAccess( - __in PIRP Irp, - __in ULONG RequiredAccess - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -IO_PRIORITY_HINT -IoGetIoPriorityHint( - __in PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSTATUS -IoSetIoPriorityHint( - __in PIRP Irp, - __in IO_PRIORITY_HINT PriorityHint - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSTATUS -IoAllocateSfioStreamIdentifier( - __in PFILE_OBJECT FileObject, - __in ULONG Length, - __in PVOID Signature, - __out PVOID *StreamIdentifier - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -PVOID -IoGetSfioStreamIdentifier( - __in PFILE_OBJECT FileObject, - __in PVOID Signature - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSTATUS -IoFreeSfioStreamIdentifier( - __in PFILE_OBJECT FileObject, - __in PVOID Signature - ); -#endif - -typedef enum _IO_ACCESS_TYPE { - - // - // Indicates that the Io will - // be comprised solely of reads - // - ReadAccess, - - // - // Indicates that the Io will - // be comprised solely of writes - // - WriteAccess, - - // - // Indicates that the Io will be - // comprised of reads and writes - // - ModifyAccess - -} IO_ACCESS_TYPE; - -typedef enum _IO_ACCESS_MODE { - - // - // Indicates that the Io will be - // sent down in a sequential order - // - SequentialAccess, - - // - // Indicates that the Io might - // not be in a predictable order - // - RandomAccess - -} IO_ACCESS_MODE; - -typedef enum _IO_CONTAINER_NOTIFICATION_CLASS { - IoSessionStateNotification, // 0 - Session State Notifications - IoMaxContainerNotificationClass -} IO_CONTAINER_NOTIFICATION_CLASS; - -typedef struct _IO_SESSION_STATE_NOTIFICATION { - ULONG Size; - ULONG Flags; - PVOID IoObject; - ULONG EventMask; - PVOID Context; -} IO_SESSION_STATE_NOTIFICATION, *PIO_SESSION_STATE_NOTIFICATION; - -typedef enum _IO_CONTAINER_INFORMATION_CLASS { - IoSessionStateInformation, // 0 - Session State Information - IoMaxContainerInformationClass -} IO_CONTAINER_INFORMATION_CLASS; - -typedef struct _IO_SESSION_STATE_INFORMATION { - ULONG SessionId; - IO_SESSION_STATE SessionState; - BOOLEAN LocalSession; -} IO_SESSION_STATE_INFORMATION, *PIO_SESSION_STATE_INFORMATION; - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSTATUS -IoGetContainerInformation ( - __in IO_CONTAINER_INFORMATION_CLASS InformationClass, - __in_opt PVOID ContainerObject, - __inout_bcount_opt(BufferLength) PVOID Buffer, - __in ULONG BufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef NTSTATUS (*PIO_CONTAINER_NOTIFICATION_FUNCTION)(); - -typedef -NTSTATUS -IO_SESSION_NOTIFICATION_FUNCTION ( - __in PVOID SessionObject, - __in PVOID IoObject, - __in ULONG Event, - __in PVOID Context, - __in_bcount_opt(PayloadLength) PVOID NotificationPayload, - __in ULONG PayloadLength - ); - -typedef IO_SESSION_NOTIFICATION_FUNCTION *PIO_SESSION_NOTIFICATION_FUNCTION; -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTSTATUS -IoRegisterContainerNotification( - __in IO_CONTAINER_NOTIFICATION_CLASS NotificationClass, - __in PIO_CONTAINER_NOTIFICATION_FUNCTION CallbackFunction, - __in_bcount_opt(NotificationInformationLength) PVOID NotificationInformation, - __in ULONG NotificationInformationLength, - __out PVOID CallbackRegistration - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -VOID -IoUnregisterContainerNotification( - __in PVOID CallbackRegistration - ); -#endif - - -#ifdef RUN_WPP - -#include -#include - -#endif // #ifdef RUN_WPP - - - -#ifndef _TRACEHANDLE_DEFINED -#define _TRACEHANDLE_DEFINED -typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE; -#endif - -// -// Trace Provider APIs -// - -#ifdef RUN_WPP - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(HIGH_LEVEL) -NTKERNELAPI -NTSTATUS -WmiTraceMessage( - __in TRACEHANDLE LoggerHandle, - __in ULONG MessageFlags, - __in LPCGUID MessageGuid, - __in USHORT MessageNumber, - ... - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(HIGH_LEVEL) -NTKERNELAPI -NTSTATUS -WmiTraceMessageVa( - __in TRACEHANDLE LoggerHandle, - __in ULONG MessageFlags, - __in LPCGUID MessageGuid, - __in USHORT MessageNumber, - __in va_list MessageArgList - ); -#endif - -#endif // #ifdef RUN_WPP - -#ifndef TRACE_INFORMATION_CLASS_DEFINE - -typedef struct _ETW_TRACE_SESSION_SETTINGS { - ULONG Version; - ULONG BufferSize; - ULONG MinimumBuffers; - ULONG MaximumBuffers; - ULONG LoggerMode; - ULONG FlushTimer; - ULONG FlushThreshold; - ULONG ClockType; -} ETW_TRACE_SESSION_SETTINGS, *PETW_TRACE_SESSION_SETTINGS; - -typedef enum _TRACE_INFORMATION_CLASS { - TraceIdClass, - TraceHandleClass, - TraceEnableFlagsClass, - TraceEnableLevelClass, - GlobalLoggerHandleClass, - EventLoggerHandleClass, - AllLoggerHandlesClass, - TraceHandleByNameClass, - LoggerEventsLostClass, - TraceSessionSettingsClass, - LoggerEventsLoggedClass, - MaxTraceInformationClass -} TRACE_INFORMATION_CLASS; - -#if (NTDDI_VERSION >= NTDDI_WINXP) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -WmiQueryTraceInformation( - __in TRACE_INFORMATION_CLASS TraceInformationClass, - __out_bcount(TraceInformationLength) PVOID TraceInformation, - __in ULONG TraceInformationLength, - __out_opt PULONG RequiredLength, - __in_opt PVOID Buffer - ); -#endif - -#define TRACE_INFORMATION_CLASS_DEFINE -#endif // TRACE_INFOPRMATION_CLASS_DEFINE - - -#ifndef _ETW_KM_ -#define _ETW_KM_ -#endif - -#include - - -// -// Optional callback function that users provide. -// - -__drv_sameIRQL -typedef -VOID -(NTAPI *PETWENABLECALLBACK) ( - __in LPCGUID SourceId, - __in ULONG ControlCode, - __in UCHAR Level, - __in ULONGLONG MatchAnyKeyword, - __in ULONGLONG MatchAllKeyword, - __in_opt PEVENT_FILTER_DESCRIPTOR FilterData, - __inout_opt PVOID CallbackContext - ); - -// -// Kernel Mode Registration APIs. -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTKERNELAPI -EtwRegister( - __in LPCGUID ProviderId, - __in_opt PETWENABLECALLBACK EnableCallback, - __in_opt PVOID CallbackContext, - __out PREGHANDLE RegHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -NTKERNELAPI -EtwUnregister( - __in REGHANDLE RegHandle - ); -#endif - -// -// Kernel Mode Control (Is Enabled) APIs -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(HIGH_LEVEL) -BOOLEAN -NTKERNELAPI -EtwEventEnabled( - __in REGHANDLE RegHandle, - __in PCEVENT_DESCRIPTOR EventDescriptor - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(HIGH_LEVEL) -BOOLEAN -NTKERNELAPI -EtwProviderEnabled( - __in REGHANDLE RegHandle, - __in UCHAR Level, - __in ULONGLONG Keyword - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_when(ControlCode==EVENT_ACTIVITY_CTRL_CREATE_ID, __drv_maxIRQL(HIGH_LEVEL)) -__drv_when(ControlCode!=EVENT_ACTIVITY_CTRL_CREATE_ID, __drv_maxIRQL(APC_LEVEL)) -NTSTATUS -NTKERNELAPI -EtwActivityIdControl( - __in ULONG ControlCode, - __inout_bcount(sizeof(GUID))LPGUID ActivityId - ); -#endif - -// -// Kernel Mode Writing (Publishing/Logging) APIs -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(HIGH_LEVEL) -NTSTATUS -NTKERNELAPI -EtwWrite( - __in REGHANDLE RegHandle, - __in PCEVENT_DESCRIPTOR EventDescriptor, - __in_opt LPCGUID ActivityId, - __in ULONG UserDataCount, - __in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(HIGH_LEVEL) -NTSTATUS -NTKERNELAPI -EtwWriteTransfer( - __in REGHANDLE RegHandle, - __in PCEVENT_DESCRIPTOR EventDescriptor, - __in_opt LPCGUID ActivityId, - __in_opt LPCGUID RelatedActivityId, - __in ULONG UserDataCount, - __in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(HIGH_LEVEL) -NTSTATUS -NTKERNELAPI -EtwWriteString( - __in REGHANDLE RegHandle, - __in UCHAR Level, - __in ULONGLONG Keyword, - __in_opt LPCGUID ActivityId, - __in PCWSTR String - ); -#endif - -#define EVENT_WRITE_FLAG_NO_FAULTING 0x00000001 - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(HIGH_LEVEL) -NTSTATUS -NTKERNELAPI -EtwWriteEx( - __in REGHANDLE RegHandle, - __in PCEVENT_DESCRIPTOR EventDescriptor, - __in ULONG64 Filter, - __in ULONG Flags, - __in_opt LPCGUID ActivityId, - __in_opt LPCGUID RelatedActivityId, - __in ULONG UserDataCount, - __in_ecount_opt(UserDataCount) PEVENT_DATA_DESCRIPTOR UserData - ); -#endif - - -// -// Define PnP Device Property for IoGetDeviceProperty -// - -#ifdef _PREFAST_ -#define __string_type 0x1000 -#define __guid_type 0x2000 -#define __multiString_type 0x4000 -#else -#define __string_type 0 -#define __guid_type 0 -#define __multiString_type 0 -#endif - -typedef enum { - DevicePropertyDeviceDescription = 0x0 | __string_type, - DevicePropertyHardwareID = 0x1 | __multiString_type, - DevicePropertyCompatibleIDs = 0x2 | __multiString_type, - DevicePropertyBootConfiguration = 0x3, - DevicePropertyBootConfigurationTranslated = 0x4, - DevicePropertyClassName = 0x5 | __string_type, - DevicePropertyClassGuid = 0x6 | __string_type, - DevicePropertyDriverKeyName = 0x7 | __string_type, - DevicePropertyManufacturer = 0x8 | __string_type, - DevicePropertyFriendlyName = 0x9 | __string_type, - DevicePropertyLocationInformation = 0xa | __string_type, - DevicePropertyPhysicalDeviceObjectName = 0xb | __string_type, - DevicePropertyBusTypeGuid = 0xc | __guid_type, - DevicePropertyLegacyBusType = 0xd, - DevicePropertyBusNumber = 0xe, - DevicePropertyEnumeratorName = 0xf | __string_type, - DevicePropertyAddress = 0x10, - DevicePropertyUINumber = 0x11, - DevicePropertyInstallState = 0x12, - DevicePropertyRemovalPolicy = 0x13, - DevicePropertyResourceRequirements = 0x14, - DevicePropertyAllocatedResources = 0x15, - DevicePropertyContainerID = 0x16 | __string_type -} DEVICE_REGISTRY_PROPERTY; - -typedef -__drv_functionClass(TRANSLATE_BUS_ADDRESS) -__drv_sameIRQL -BOOLEAN TRANSLATE_BUS_ADDRESS( - __inout_opt PVOID Context, - __in PHYSICAL_ADDRESS BusAddress, - __in ULONG Length, - __out PULONG AddressSpace, - __out PPHYSICAL_ADDRESS TranslatedAddress - ); -typedef TRANSLATE_BUS_ADDRESS *PTRANSLATE_BUS_ADDRESS; - -typedef -__drv_functionClass(GET_DMA_ADAPTER) -__drv_sameIRQL -struct _DMA_ADAPTER *GET_DMA_ADAPTER( - __inout_opt PVOID Context, - __in struct _DEVICE_DESCRIPTION *DeviceDescriptor, - __out PULONG NumberOfMapRegisters - ); -typedef GET_DMA_ADAPTER *PGET_DMA_ADAPTER; - -typedef -__drv_functionClass(GET_SET_DEVICE_DATA) -__drv_sameIRQL -ULONG GET_SET_DEVICE_DATA ( - __inout_opt PVOID Context, - __in ULONG DataType, - __inout_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); -typedef GET_SET_DEVICE_DATA *PGET_SET_DEVICE_DATA; - -typedef enum _DEVICE_INSTALL_STATE { - InstallStateInstalled, - InstallStateNeedsReinstall, - InstallStateFailedInstall, - InstallStateFinishInstall -} DEVICE_INSTALL_STATE, *PDEVICE_INSTALL_STATE; - -// -// Define structure returned in response to IRP_MN_QUERY_BUS_INFORMATION by a -// PDO indicating the type of bus the device exists on. -// - -typedef struct _PNP_BUS_INFORMATION { - GUID BusTypeGuid; - INTERFACE_TYPE LegacyBusType; - ULONG BusNumber; -} PNP_BUS_INFORMATION, *PPNP_BUS_INFORMATION; - -// -// Define structure returned in response to IRP_MN_QUERY_LEGACY_BUS_INFORMATION -// by an FDO indicating the type of bus it is. This is normally the same bus -// type as the device's children (i.e., as retrieved from the child PDO's via -// IRP_MN_QUERY_BUS_INFORMATION) except for cases like CardBus, which can -// support both 16-bit (PCMCIABus) and 32-bit (PCIBus) cards. -// - -typedef struct _LEGACY_BUS_INFORMATION { - GUID BusTypeGuid; - INTERFACE_TYPE LegacyBusType; - ULONG BusNumber; -} LEGACY_BUS_INFORMATION, *PLEGACY_BUS_INFORMATION; - -// -// Defines for IoGetDeviceProperty(DevicePropertyRemovalPolicy). -// -typedef enum _DEVICE_REMOVAL_POLICY { - - RemovalPolicyExpectNoRemoval = 1, - RemovalPolicyExpectOrderlyRemoval = 2, - RemovalPolicyExpectSurpriseRemoval = 3 - -} DEVICE_REMOVAL_POLICY, *PDEVICE_REMOVAL_POLICY; - - - -typedef struct _BUS_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // standard bus interfaces - // - PTRANSLATE_BUS_ADDRESS TranslateBusAddress; - PGET_DMA_ADAPTER GetDmaAdapter; - PGET_SET_DEVICE_DATA SetBusData; - PGET_SET_DEVICE_DATA GetBusData; - -} BUS_INTERFACE_STANDARD, *PBUS_INTERFACE_STANDARD; - -typedef -VOID -(*PREENUMERATE_SELF)( - __in PVOID Context - ); - -typedef struct _REENUMERATE_SELF_INTERFACE_STANDARD { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // Self-reenumeration interface - // - PREENUMERATE_SELF SurpriseRemoveAndReenumerateSelf; -} REENUMERATE_SELF_INTERFACE_STANDARD, *PREENUMERATE_SELF_INTERFACE_STANDARD; - - -// -// The following definitions are used in ACPI QueryInterface -// -typedef BOOLEAN (* PGPE_SERVICE_ROUTINE) ( - PVOID, - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PGPE_CONNECT_VECTOR) ( - PDEVICE_OBJECT, - ULONG, - KINTERRUPT_MODE, - BOOLEAN, - PGPE_SERVICE_ROUTINE, - PVOID, - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PGPE_DISCONNECT_VECTOR) ( - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PGPE_ENABLE_EVENT) ( - PDEVICE_OBJECT, - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PGPE_DISABLE_EVENT) ( - PDEVICE_OBJECT, - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PGPE_CLEAR_STATUS) ( - PDEVICE_OBJECT, - PVOID); - -typedef -VOID (* PDEVICE_NOTIFY_CALLBACK) ( - PVOID, - ULONG); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS (* PREGISTER_FOR_DEVICE_NOTIFICATIONS) ( - PDEVICE_OBJECT, - PDEVICE_NOTIFY_CALLBACK, - PVOID); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -void (* PUNREGISTER_FOR_DEVICE_NOTIFICATIONS) ( - PDEVICE_OBJECT, - PDEVICE_NOTIFY_CALLBACK); - -typedef struct _ACPI_INTERFACE_STANDARD { - // - // Generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // ACPI interfaces - // - PGPE_CONNECT_VECTOR GpeConnectVector; - PGPE_DISCONNECT_VECTOR GpeDisconnectVector; - PGPE_ENABLE_EVENT GpeEnableEvent; - PGPE_DISABLE_EVENT GpeDisableEvent; - PGPE_CLEAR_STATUS GpeClearStatus; - PREGISTER_FOR_DEVICE_NOTIFICATIONS RegisterForDeviceNotifications; - PUNREGISTER_FOR_DEVICE_NOTIFICATIONS UnregisterForDeviceNotifications; - -} ACPI_INTERFACE_STANDARD, *PACPI_INTERFACE_STANDARD; - -// -// The following definitions are used in GUID_ACPI_INTERFACE_STANDARD2, -// The first version (above) passes in DEVICE_OBJECs, where this one -// is based on Contexts. -// - -typedef -BOOLEAN -(*PGPE_SERVICE_ROUTINE2) ( - PVOID ObjectContext, - PVOID ServiceContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PGPE_CONNECT_VECTOR2) ( - PVOID Context, - ULONG GpeNumber, - KINTERRUPT_MODE Mode, - BOOLEAN Shareable, - PGPE_SERVICE_ROUTINE ServiceRoutine, - PVOID ServiceContext, - PVOID *ObjectContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PGPE_DISCONNECT_VECTOR2) ( - PVOID Context, - PVOID ObjectContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PGPE_ENABLE_EVENT2) ( - PVOID Context, - PVOID ObjectContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PGPE_DISABLE_EVENT2) ( - PVOID Context, - PVOID ObjectContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PGPE_CLEAR_STATUS2) ( - PVOID Context, - PVOID ObjectContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(*PDEVICE_NOTIFY_CALLBACK2) ( - PVOID NotificationContext, - ULONG NotifyCode - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -(*PREGISTER_FOR_DEVICE_NOTIFICATIONS2) ( - PVOID Context, - PDEVICE_NOTIFY_CALLBACK2 NotificationHandler, - PVOID NotificationContext - ); - -typedef -__drv_maxIRQL(DISPATCH_LEVEL) -VOID -(*PUNREGISTER_FOR_DEVICE_NOTIFICATIONS2) ( - PVOID Context - ); - -typedef struct { - // - // Generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // ACPI interfaces - // - PGPE_CONNECT_VECTOR2 GpeConnectVector; - PGPE_DISCONNECT_VECTOR2 GpeDisconnectVector; - PGPE_ENABLE_EVENT2 GpeEnableEvent; - PGPE_DISABLE_EVENT2 GpeDisableEvent; - PGPE_CLEAR_STATUS2 GpeClearStatus; - PREGISTER_FOR_DEVICE_NOTIFICATIONS2 RegisterForDeviceNotifications; - PUNREGISTER_FOR_DEVICE_NOTIFICATIONS2 UnregisterForDeviceNotifications; - -} ACPI_INTERFACE_STANDARD2, *PACPI_INTERFACE_STANDARD2; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoInvalidateDeviceRelations( - __in PDEVICE_OBJECT DeviceObject, - __in DEVICE_RELATION_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoRequestDeviceEject( - __in PDEVICE_OBJECT PhysicalDeviceObject - ); -#endif - -typedef VOID (*PIO_DEVICE_EJECT_CALLBACK)( - __in NTSTATUS Status, - __inout_opt PVOID Context - ); - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoRequestDeviceEjectEx( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in_opt PIO_DEVICE_EJECT_CALLBACK Callback, - __in_opt PVOID Context, - __in_opt PDRIVER_OBJECT DriverObject - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when((DeviceProperty & __string_type), - __drv_at(PropertyBuffer, - __post __nullterminated) - ) -__drv_when((DeviceProperty & __multiString_type), - __drv_at(PropertyBuffer, - __post __nullnullterminated) - ) -NTKERNELAPI -NTSTATUS -IoGetDeviceProperty( - __in PDEVICE_OBJECT DeviceObject, - __in DEVICE_REGISTRY_PROPERTY DeviceProperty, - __in ULONG BufferLength, - __out_bcount_opt(BufferLength) PVOID PropertyBuffer, - __out PULONG ResultLength - ); -#endif - -// -// The following definitions are used in IoOpenDeviceRegistryKey -// - -#define PLUGPLAY_REGKEY_DEVICE 1 -#define PLUGPLAY_REGKEY_DRIVER 2 -#define PLUGPLAY_REGKEY_CURRENT_HWPROFILE 4 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoOpenDeviceRegistryKey( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG DevInstKeyType, - __in ACCESS_MASK DesiredAccess, - __out PHANDLE DevInstRegKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -NTAPI -IoRegisterDeviceInterface( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in CONST GUID *InterfaceClassGuid, - __in_opt PUNICODE_STRING ReferenceString, - __out __drv_when(return==0, - __drv_at(SymbolicLinkName->Buffer, __drv_allocatesMem(Mem))) - PUNICODE_STRING SymbolicLinkName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoOpenDeviceInterfaceRegistryKey( - __in PUNICODE_STRING SymbolicLinkName, - __in ACCESS_MASK DesiredAccess, - __out PHANDLE DeviceInterfaceKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) __drv_valueIs(>=0;<0) -__checkReturn -NTKERNELAPI -NTSTATUS -IoSetDeviceInterfaceState( - __in PUNICODE_STRING SymbolicLinkName, - __in BOOLEAN Enable - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceInterfaces( - __in CONST GUID *InterfaceClassGuid, - __in_opt PDEVICE_OBJECT PhysicalDeviceObject, - __in ULONG Flags, - __deref_out - __drv_deref( - __drv_when(return==0, __drv_allocatesMem(Mem) __drv_valueIs(!=0)) - __drv_when(return<0, __drv_valueIs(==0))) - PWSTR *SymbolicLinkList - ); -#endif - -#define DEVICE_INTERFACE_INCLUDE_NONACTIVE 0x00000001 - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -NTAPI -IoGetDeviceInterfaceAlias( - __in PUNICODE_STRING SymbolicLinkName, - __in CONST GUID *AliasInterfaceClassGuid, - __out - __drv_when(return==0, - __drv_at(AliasSymbolicLinkName->Buffer, __drv_allocatesMem(Mem))) - PUNICODE_STRING AliasSymbolicLinkName - ); -#endif - -// -// Define PnP notification event categories -// - -typedef enum _IO_NOTIFICATION_EVENT_CATEGORY { - EventCategoryReserved, - EventCategoryHardwareProfileChange, - EventCategoryDeviceInterfaceChange, - EventCategoryTargetDeviceChange -} IO_NOTIFICATION_EVENT_CATEGORY; - -// -// Define flags that modify the behavior of IoRegisterPlugPlayNotification -// for the various event categories... -// - -#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES 0x00000001 - -typedef -__drv_functionClass(DRIVER_NOTIFICATION_CALLBACK_ROUTINE) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSTATUS -DRIVER_NOTIFICATION_CALLBACK_ROUTINE ( - __in PVOID NotificationStructure, - __inout_opt PVOID Context -); -typedef DRIVER_NOTIFICATION_CALLBACK_ROUTINE - *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoRegisterPlugPlayNotification( - __in IO_NOTIFICATION_EVENT_CATEGORY EventCategory, - __in ULONG EventCategoryFlags, - __in_opt PVOID EventCategoryData, - __in PDRIVER_OBJECT DriverObject, - __in PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, - __inout_opt __drv_aliasesMem PVOID Context, - __deref_out - __drv_deref( - __drv_when(return==0, __drv_allocatesMem(Mem) __drv_valueIs(!=0)) - __drv_when(return<0, __drv_valueIs(==0))) - PVOID *NotificationEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_freesMem(Pool) -NTKERNELAPI -NTSTATUS -IoUnregisterPlugPlayNotification( - __in PVOID NotificationEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_freesMem(Pool) -NTKERNELAPI -NTSTATUS -IoUnregisterPlugPlayNotificationEx( - __in PVOID NotificationEntry - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTKERNELAPI -NTSTATUS -IoReportTargetDeviceChange( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in PVOID NotificationStructure // always begins with a PLUGPLAY_NOTIFICATION_HEADER - ); -#endif - -typedef -__drv_functionClass(DEVICE_CHANGE_COMPLETE_CALLBACK) -__drv_sameIRQL -VOID -DEVICE_CHANGE_COMPLETE_CALLBACK( - __inout_opt PVOID Context - ); -typedef DEVICE_CHANGE_COMPLETE_CALLBACK *PDEVICE_CHANGE_COMPLETE_CALLBACK; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -IoInvalidateDeviceState( - __in PDEVICE_OBJECT PhysicalDeviceObject - ); -#endif - -#define IoAdjustPagingPathCount(_count_,_paging_) { \ - if (_paging_) { \ - InterlockedIncrement(_count_); \ - } else { \ - InterlockedDecrement(_count_); \ - } \ -} - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -IoReportTargetDeviceChangeAsynchronous( - __in PDEVICE_OBJECT PhysicalDeviceObject, - __in PVOID NotificationStructure, // always begins with a PLUGPLAY_NOTIFICATION_HEADER - __in_opt PDEVICE_CHANGE_COMPLETE_CALLBACK Callback, - __inout_opt PVOID Context - ); -#endif - - -// -// Header structure for all Plug&Play notification events... -// - -typedef struct _PLUGPLAY_NOTIFICATION_HEADER { - USHORT Version; // presently at version 1. - USHORT Size; // size (in bytes) of header + event-specific data. - GUID Event; - // - // Event-specific stuff starts here. - // -} PLUGPLAY_NOTIFICATION_HEADER, *PPLUGPLAY_NOTIFICATION_HEADER; - -// -// Notification structure for all EventCategoryHardwareProfileChange events... -// - -typedef struct _HWPROFILE_CHANGE_NOTIFICATION { - USHORT Version; - USHORT Size; - GUID Event; - // - // (No event-specific data) - // -} HWPROFILE_CHANGE_NOTIFICATION, *PHWPROFILE_CHANGE_NOTIFICATION; - - -// -// Notification structure for all EventCategoryDeviceInterfaceChange events... -// - -typedef struct _DEVICE_INTERFACE_CHANGE_NOTIFICATION { - USHORT Version; - USHORT Size; - GUID Event; - // - // Event-specific data - // - GUID InterfaceClassGuid; - PUNICODE_STRING SymbolicLinkName; -} DEVICE_INTERFACE_CHANGE_NOTIFICATION, *PDEVICE_INTERFACE_CHANGE_NOTIFICATION; - - -// -// Notification structures for EventCategoryTargetDeviceChange... -// - -// -// The following structure is used for TargetDeviceQueryRemove, -// TargetDeviceRemoveCancelled, and TargetDeviceRemoveComplete: -// -typedef struct _TARGET_DEVICE_REMOVAL_NOTIFICATION { - USHORT Version; - USHORT Size; - GUID Event; - // - // Event-specific data - // - PFILE_OBJECT FileObject; -} TARGET_DEVICE_REMOVAL_NOTIFICATION, *PTARGET_DEVICE_REMOVAL_NOTIFICATION; - -// -// The following structure header is used for all other (i.e., 3rd-party) -// target device change events. The structure accommodates both a -// variable-length binary data buffer, and a variable-length unicode text -// buffer. The header must indicate where the text buffer begins, so that -// the data can be delivered in the appropriate format (ANSI or Unicode) -// to user-mode recipients (i.e., that have registered for handle-based -// notification via RegisterDeviceNotification). -// - -typedef struct _TARGET_DEVICE_CUSTOM_NOTIFICATION { - USHORT Version; - USHORT Size; - GUID Event; - // - // Event-specific data - // - PFILE_OBJECT FileObject; // This field must be set to NULL by callers of - // IoReportTargetDeviceChange. Clients that - // have registered for target device change - // notification on the affected PDO will be - // called with this field set to the file object - // they specified during registration. - // - LONG NameBufferOffset; // offset (in bytes) from beginning of - // CustomDataBuffer where text begins (-1 if none) - // - UCHAR CustomDataBuffer[1]; // variable-length buffer, containing (optionally) - // a binary data at the start of the buffer, - // followed by an optional unicode text buffer - // (word-aligned). - // -} TARGET_DEVICE_CUSTOM_NOTIFICATION, *PTARGET_DEVICE_CUSTOM_NOTIFICATION; - -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Custom device properties... -// - -#include - -// -// Definitions of property flags. -// - -#define PLUGPLAY_PROPERTY_PERSISTENT 0x00000001 - -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoSetDevicePropertyData ( - __in PDEVICE_OBJECT Pdo, - __in CONST DEVPROPKEY *PropertyKey, - __in LCID Lcid, - __in ULONG Flags, - __in DEVPROPTYPE Type, - __in ULONG Size, - __in_opt PVOID Data - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoGetDevicePropertyData ( - __in PDEVICE_OBJECT Pdo, - __in CONST DEVPROPKEY *PropertyKey, - __in LCID Lcid, - __reserved ULONG Flags, - __in ULONG Size, - __out PVOID Data, - __out PULONG RequiredSize, - __out PDEVPROPTYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -IoGetDeviceNumaNode ( - __in PDEVICE_OBJECT Pdo, - __out PUSHORT NodeNumber - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WS08) -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -NTKERNELAPI -NTSTATUS -NTAPI -IoReplacePartitionUnit ( - __in PDEVICE_OBJECT TargetPdo, - __in PDEVICE_OBJECT SparePdo, - __in ULONG Flags - ); -#endif - - -// -// Define replace driver entrypoint. -// - -typedef struct _PNP_REPLACE_DRIVER_INTERFACE *PPNP_REPLACE_DRIVER_INTERFACE; - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_DRIVER_INIT) ( - __inout PPNP_REPLACE_DRIVER_INTERFACE Interface, - __in PVOID Unused - ); - -// -// Define parameters to replace driver. -// - -#define PNP_REPLACE_NO_MAP MAXLONGLONG - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_MAP_MEMORY) ( - __in PHYSICAL_ADDRESS TargetPhysicalAddress, - __in PHYSICAL_ADDRESS SparePhysicalAddress, - __inout PLARGE_INTEGER NumberOfBytes, - __deref_out PVOID *TargetAddress, - __deref_out PVOID *SpareAddress - ); - -typedef struct _PNP_REPLACE_MEMORY_LIST { - - ULONG AllocatedCount; - ULONG Count; - ULONGLONG TotalLength; - struct { - PHYSICAL_ADDRESS Address; - ULONGLONG Length; - } Ranges[ANYSIZE_ARRAY]; - -} PNP_REPLACE_MEMORY_LIST, *PPNP_REPLACE_MEMORY_LIST; - -typedef struct _PNP_REPLACE_PROCESSOR_LIST { - - PKAFFINITY Affinity; - ULONG GroupCount; - ULONG AllocatedCount; - ULONG Count; - ULONG ApicIds[ANYSIZE_ARRAY]; - -} PNP_REPLACE_PROCESSOR_LIST, *PPNP_REPLACE_PROCESSOR_LIST; - -typedef struct _PNP_REPLACE_PROCESSOR_LIST_V1 { - - KAFFINITY AffinityMask; - ULONG AllocatedCount; - ULONG Count; - ULONG ApicIds[ANYSIZE_ARRAY]; - -} PNP_REPLACE_PROCESSOR_LIST_V1, *PPNP_REPLACE_PROCESSOR_LIST_V1; - -#define PNP_REPLACE_PARAMETERS_VERSION 2 - -typedef struct _PNP_REPLACE_PARAMETERS { - - ULONG Size; - ULONG Version; - - ULONG64 Target; - ULONG64 Spare; - PPNP_REPLACE_PROCESSOR_LIST TargetProcessors; - PPNP_REPLACE_PROCESSOR_LIST SpareProcessors; - PPNP_REPLACE_MEMORY_LIST TargetMemory; - PPNP_REPLACE_MEMORY_LIST SpareMemory; - - PREPLACE_MAP_MEMORY MapMemory; - -} PNP_REPLACE_PARAMETERS, *PPNP_REPLACE_PARAMETERS; - -// -// Define replace driver interface. -// - -typedef -VOID -(*PREPLACE_UNLOAD) ( - VOID - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_BEGIN) ( - __in PPNP_REPLACE_PARAMETERS Parameters, - __deref_out PVOID *Context -); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_END) ( - __in PVOID Context - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_MIRROR_PHYSICAL_MEMORY) ( - __in PVOID Context, - __in PHYSICAL_ADDRESS PhysicalAddress, - __in LARGE_INTEGER ByteCount - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_SET_PROCESSOR_ID) ( - __in PVOID Context, - __in ULONG ApicId, - __in BOOLEAN Target - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_SWAP) ( - __in PVOID Context - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_INITIATE_HARDWARE_MIRROR) ( - __in PVOID Context - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_MIRROR_PLATFORM_MEMORY) ( - __in PVOID Context - ); - -typedef -__checkReturn -NTSTATUS -(*PREPLACE_GET_MEMORY_DESTINATION) ( - __in PVOID Context, - __in PHYSICAL_ADDRESS SourceAddress, - __out PPHYSICAL_ADDRESS DestinationAddress - ); - -typedef -__checkReturn NTSTATUS -(*PREPLACE_ENABLE_DISABLE_HARDWARE_QUIESCE) ( - __in PVOID Context, - __in BOOLEAN Enable - ); - -#define PNP_REPLACE_DRIVER_INTERFACE_VERSION 1 -#define PNP_REPLACE_DRIVER_INTERFACE_MINIMUM_SIZE \ - FIELD_OFFSET(PNP_REPLACE_DRIVER_INTERFACE, InitiateHardwareMirror) - -#define PNP_REPLACE_MEMORY_SUPPORTED 0x0001 -#define PNP_REPLACE_PROCESSOR_SUPPORTED 0x0002 -#define PNP_REPLACE_HARDWARE_MEMORY_MIRRORING 0x0004 -#define PNP_REPLACE_HARDWARE_PAGE_COPY 0x0008 -#define PNP_REPLACE_HARDWARE_QUIESCE 0x0010 - -// -// Define interface structure. -// - -typedef struct _PNP_REPLACE_DRIVER_INTERFACE { - - ULONG Size; - ULONG Version; - - ULONG Flags; - PREPLACE_UNLOAD Unload; - PREPLACE_BEGIN BeginReplace; - PREPLACE_END EndReplace; - PREPLACE_MIRROR_PHYSICAL_MEMORY MirrorPhysicalMemory; - PREPLACE_SET_PROCESSOR_ID SetProcessorId; - PREPLACE_SWAP Swap; - PREPLACE_INITIATE_HARDWARE_MIRROR InitiateHardwareMirror; - PREPLACE_MIRROR_PLATFORM_MEMORY MirrorPlatformMemory; - PREPLACE_GET_MEMORY_DESTINATION GetMemoryDestination; - PREPLACE_ENABLE_DISABLE_HARDWARE_QUIESCE EnableDisableHardwareQuiesce; - -} PNP_REPLACE_DRIVER_INTERFACE, *PPNP_REPLACE_DRIVER_INTERFACE; - -// -// Define the device description structure. -// - -typedef struct _DEVICE_DESCRIPTION { - ULONG Version; - BOOLEAN Master; - BOOLEAN ScatterGather; - BOOLEAN DemandMode; - BOOLEAN AutoInitialize; - BOOLEAN Dma32BitAddresses; - BOOLEAN IgnoreCount; - BOOLEAN Reserved1; // must be false - BOOLEAN Dma64BitAddresses; - ULONG BusNumber; // unused for WDM - ULONG DmaChannel; - INTERFACE_TYPE InterfaceType; - DMA_WIDTH DmaWidth; - DMA_SPEED DmaSpeed; - ULONG MaximumLength; - ULONG DmaPort; -} DEVICE_DESCRIPTION, *PDEVICE_DESCRIPTION; - -// -// Define the supported version numbers for the device description structure. -// - -#define DEVICE_DESCRIPTION_VERSION 0 -#define DEVICE_DESCRIPTION_VERSION1 1 -#define DEVICE_DESCRIPTION_VERSION2 2 - - - -#if defined(_IA64_) -FORCEINLINE -VOID -KeFlushWriteBuffer ( - VOID - ) -{ - __mf (); - return; -} - -#else -NTHALAPI -VOID -KeFlushWriteBuffer ( - VOID - ); - -#endif - -// -// Performance counter function. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTHALAPI -LARGE_INTEGER -KeQueryPerformanceCounter ( - __out_opt PLARGE_INTEGER PerformanceFrequency - ); -#endif - - -// -// Stall processor execution function. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -NTHALAPI -VOID -KeStallExecutionProcessor ( - __in ULONG MicroSeconds - ); -#endif - - -typedef struct _SCATTER_GATHER_ELEMENT { - PHYSICAL_ADDRESS Address; - ULONG Length; - ULONG_PTR Reserved; -} SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT; - -#if defined(_MSC_EXTENSIONS) - -#if _MSC_VER >= 1200 -#pragma warning(push) -#endif -#pragma warning(disable:4200) -typedef struct _SCATTER_GATHER_LIST { - ULONG NumberOfElements; - ULONG_PTR Reserved; - SCATTER_GATHER_ELEMENT Elements[]; -} SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST; -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4200) -#endif - -#else - -struct _SCATTER_GATHER_LIST; -typedef struct _SCATTER_GATHER_LIST SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST; - -#endif - - - -typedef struct _DMA_OPERATIONS *PDMA_OPERATIONS; - -typedef struct _DMA_ADAPTER { - USHORT Version; - USHORT Size; - PDMA_OPERATIONS DmaOperations; - // Private Bus Device Driver data follows, -} DMA_ADAPTER, *PDMA_ADAPTER; - - - -typedef VOID (*PPUT_DMA_ADAPTER)( - PDMA_ADAPTER DmaAdapter - ); - -typedef PVOID (*PALLOCATE_COMMON_BUFFER)( - __in PDMA_ADAPTER DmaAdapter, - __in ULONG Length, - __out PPHYSICAL_ADDRESS LogicalAddress, - __in BOOLEAN CacheEnabled - ); - -typedef VOID (*PFREE_COMMON_BUFFER)( - __in PDMA_ADAPTER DmaAdapter, - __in ULONG Length, - __in PHYSICAL_ADDRESS LogicalAddress, - __in PVOID VirtualAddress, - __in BOOLEAN CacheEnabled - ); - -typedef NTSTATUS (*PALLOCATE_ADAPTER_CHANNEL)( - __in PDMA_ADAPTER DmaAdapter, - __in PDEVICE_OBJECT DeviceObject, - __in ULONG NumberOfMapRegisters, - __in PDRIVER_CONTROL ExecutionRoutine, - __in PVOID Context - ); - -typedef BOOLEAN (*PFLUSH_ADAPTER_BUFFERS)( - __in PDMA_ADAPTER DmaAdapter, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __in ULONG Length, - __in BOOLEAN WriteToDevice - ); - -typedef VOID (*PFREE_ADAPTER_CHANNEL)( - __in PDMA_ADAPTER DmaAdapter - ); - -typedef VOID (*PFREE_MAP_REGISTERS)( - __in PDMA_ADAPTER DmaAdapter, - PVOID MapRegisterBase, - ULONG NumberOfMapRegisters - ); - -typedef PHYSICAL_ADDRESS (*PMAP_TRANSFER)( - __in PDMA_ADAPTER DmaAdapter, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __inout PULONG Length, - __in BOOLEAN WriteToDevice - ); - -typedef ULONG (*PGET_DMA_ALIGNMENT)( - __in PDMA_ADAPTER DmaAdapter - ); - -typedef ULONG (*PREAD_DMA_COUNTER)( - __in PDMA_ADAPTER DmaAdapter - ); - -typedef -__drv_functionClass(DRIVER_LIST_CONTROL) -__drv_sameIRQL -VOID -DRIVER_LIST_CONTROL( - __in struct _DEVICE_OBJECT *DeviceObject, - __in struct _IRP *Irp, - __in PSCATTER_GATHER_LIST ScatterGather, - __in PVOID Context - ); -typedef DRIVER_LIST_CONTROL *PDRIVER_LIST_CONTROL; - -typedef NTSTATUS -(*PGET_SCATTER_GATHER_LIST)( - __in PDMA_ADAPTER DmaAdapter, - __in PDEVICE_OBJECT DeviceObject, - __in PMDL Mdl, - __in PVOID CurrentVa, - __in ULONG Length, - __in PDRIVER_LIST_CONTROL ExecutionRoutine, - __in PVOID Context, - __in BOOLEAN WriteToDevice - ); - -typedef VOID -(*PPUT_SCATTER_GATHER_LIST)( - __in PDMA_ADAPTER DmaAdapter, - __in PSCATTER_GATHER_LIST ScatterGather, - __in BOOLEAN WriteToDevice - ); - -typedef NTSTATUS -(*PCALCULATE_SCATTER_GATHER_LIST_SIZE)( - __in PDMA_ADAPTER DmaAdapter, - __in OPTIONAL PMDL Mdl, - __in PVOID CurrentVa, - __in ULONG Length, - __out PULONG ScatterGatherListSize, - __out OPTIONAL PULONG pNumberOfMapRegisters - ); - -typedef NTSTATUS -(*PBUILD_SCATTER_GATHER_LIST)( - __in PDMA_ADAPTER DmaAdapter, - __in PDEVICE_OBJECT DeviceObject, - __in PMDL Mdl, - __in PVOID CurrentVa, - __in ULONG Length, - __in PDRIVER_LIST_CONTROL ExecutionRoutine, - __in PVOID Context, - __in BOOLEAN WriteToDevice, - __in PVOID ScatterGatherBuffer, - __in ULONG ScatterGatherLength - ); - -typedef NTSTATUS -(*PBUILD_MDL_FROM_SCATTER_GATHER_LIST)( - __in PDMA_ADAPTER DmaAdapter, - __in PSCATTER_GATHER_LIST ScatterGather, - __in PMDL OriginalMdl, - __out PMDL *TargetMdl - ); - - -typedef struct _DMA_OPERATIONS { - ULONG Size; - PPUT_DMA_ADAPTER PutDmaAdapter; - PALLOCATE_COMMON_BUFFER AllocateCommonBuffer; - PFREE_COMMON_BUFFER FreeCommonBuffer; - PALLOCATE_ADAPTER_CHANNEL AllocateAdapterChannel; - PFLUSH_ADAPTER_BUFFERS FlushAdapterBuffers; - PFREE_ADAPTER_CHANNEL FreeAdapterChannel; - PFREE_MAP_REGISTERS FreeMapRegisters; - PMAP_TRANSFER MapTransfer; - PGET_DMA_ALIGNMENT GetDmaAlignment; - PREAD_DMA_COUNTER ReadDmaCounter; - PGET_SCATTER_GATHER_LIST GetScatterGatherList; - PPUT_SCATTER_GATHER_LIST PutScatterGatherList; - PCALCULATE_SCATTER_GATHER_LIST_SIZE CalculateScatterGatherList; - PBUILD_SCATTER_GATHER_LIST BuildScatterGatherList; - PBUILD_MDL_FROM_SCATTER_GATHER_LIST BuildMdlFromScatterGatherList; -} DMA_OPERATIONS; - - - -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) // ntddk - -DECLSPEC_DEPRECATED_DDK // Use AllocateCommonBuffer -__drv_preferredFunction("AllocateCommonBuffer","Obsolete") -FORCEINLINE -PVOID -HalAllocateCommonBuffer( - __in PDMA_ADAPTER DmaAdapter, - __in ULONG Length, - __out PPHYSICAL_ADDRESS LogicalAddress, - __in BOOLEAN CacheEnabled - ){ - - PALLOCATE_COMMON_BUFFER allocateCommonBuffer; - PVOID commonBuffer; - - allocateCommonBuffer = *(DmaAdapter)->DmaOperations->AllocateCommonBuffer; - ASSERT( allocateCommonBuffer != NULL ); - - commonBuffer = allocateCommonBuffer( DmaAdapter, - Length, - LogicalAddress, - CacheEnabled ); - - return commonBuffer; -} - -DECLSPEC_DEPRECATED_DDK // Use FreeCommonBuffer -__drv_preferredFunction("FreeCommonBuffer","Obsolete") -FORCEINLINE -VOID -HalFreeCommonBuffer( - __in PDMA_ADAPTER DmaAdapter, - __in ULONG Length, - __in PHYSICAL_ADDRESS LogicalAddress, - __in PVOID VirtualAddress, - __in BOOLEAN CacheEnabled - ){ - - PFREE_COMMON_BUFFER freeCommonBuffer; - - freeCommonBuffer = *(DmaAdapter)->DmaOperations->FreeCommonBuffer; - ASSERT( freeCommonBuffer != NULL ); - - freeCommonBuffer( DmaAdapter, - Length, - LogicalAddress, - VirtualAddress, - CacheEnabled ); -} - -DECLSPEC_DEPRECATED_DDK // Use AllocateAdapterChannel -__drv_maxIRQL(DISPATCH_LEVEL) -__drv_minIRQL(DISPATCH_LEVEL) -__drv_preferredFunction("AllocateAdapterChannel","obsolete") -FORCEINLINE -NTSTATUS -IoAllocateAdapterChannel( - __in PDMA_ADAPTER DmaAdapter, - __in PDEVICE_OBJECT DeviceObject, - __in ULONG NumberOfMapRegisters, - __in PDRIVER_CONTROL ExecutionRoutine, - __in PVOID Context - ){ - - PALLOCATE_ADAPTER_CHANNEL allocateAdapterChannel; - NTSTATUS status; - - allocateAdapterChannel = - *(DmaAdapter)->DmaOperations->AllocateAdapterChannel; - - ASSERT( allocateAdapterChannel != NULL ); - - status = allocateAdapterChannel( DmaAdapter, - DeviceObject, - NumberOfMapRegisters, - ExecutionRoutine, - Context ); - - return status; -} - -DECLSPEC_DEPRECATED_DDK // Use FlushAdapterBuffers -__drv_preferredFunction("FlushAdapterBuffers","Obsolete") -FORCEINLINE -BOOLEAN -IoFlushAdapterBuffers( - __in PDMA_ADAPTER DmaAdapter, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __in ULONG Length, - __in BOOLEAN WriteToDevice - ){ - - PFLUSH_ADAPTER_BUFFERS flushAdapterBuffers; - BOOLEAN result; - - flushAdapterBuffers = *(DmaAdapter)->DmaOperations->FlushAdapterBuffers; - ASSERT( flushAdapterBuffers != NULL ); - - result = flushAdapterBuffers( DmaAdapter, - Mdl, - MapRegisterBase, - CurrentVa, - Length, - WriteToDevice ); - return result; -} - -DECLSPEC_DEPRECATED_DDK // Use FreeAdapterChannel -__drv_preferredFunction("FreeAdapterChannel","Obsolete") -FORCEINLINE -VOID -IoFreeAdapterChannel( - __in PDMA_ADAPTER DmaAdapter - ){ - - PFREE_ADAPTER_CHANNEL freeAdapterChannel; - - freeAdapterChannel = *(DmaAdapter)->DmaOperations->FreeAdapterChannel; - ASSERT( freeAdapterChannel != NULL ); - - freeAdapterChannel( DmaAdapter ); -} - -DECLSPEC_DEPRECATED_DDK // Use FreeMapRegisters -__drv_preferredFunction("FreeMapRegisters","Obsolete") -FORCEINLINE -VOID -IoFreeMapRegisters( - __in PDMA_ADAPTER DmaAdapter, - __in PVOID MapRegisterBase, - __in ULONG NumberOfMapRegisters - ){ - - PFREE_MAP_REGISTERS freeMapRegisters; - - freeMapRegisters = *(DmaAdapter)->DmaOperations->FreeMapRegisters; - ASSERT( freeMapRegisters != NULL ); - - freeMapRegisters( DmaAdapter, - MapRegisterBase, - NumberOfMapRegisters ); -} - - -DECLSPEC_DEPRECATED_DDK // Use MapTransfer -__drv_preferredFunction("MapTransfer","Obsolete") -FORCEINLINE -PHYSICAL_ADDRESS -IoMapTransfer( - __in PDMA_ADAPTER DmaAdapter, - __in PMDL Mdl, - __in PVOID MapRegisterBase, - __in PVOID CurrentVa, - __inout PULONG Length, - __in BOOLEAN WriteToDevice - ){ - - PHYSICAL_ADDRESS physicalAddress; - PMAP_TRANSFER mapTransfer; - - mapTransfer = *(DmaAdapter)->DmaOperations->MapTransfer; - ASSERT( mapTransfer != NULL ); - - physicalAddress = mapTransfer( DmaAdapter, - Mdl, - MapRegisterBase, - CurrentVa, - Length, - WriteToDevice ); - - return physicalAddress; -} - -DECLSPEC_DEPRECATED_DDK // Use GetDmaAlignment -FORCEINLINE -ULONG -HalGetDmaAlignment( - __in PDMA_ADAPTER DmaAdapter - ) -{ - PGET_DMA_ALIGNMENT getDmaAlignment; - ULONG alignment; - - getDmaAlignment = *(DmaAdapter)->DmaOperations->GetDmaAlignment; - ASSERT( getDmaAlignment != NULL ); - - alignment = getDmaAlignment( DmaAdapter ); - return alignment; -} - -DECLSPEC_DEPRECATED_DDK // Use ReadDmaCounter -__drv_preferredFunction("ReadDmaCounter","Obsolete") -FORCEINLINE -ULONG -HalReadDmaCounter( - __in PDMA_ADAPTER DmaAdapter - ) -{ - PREAD_DMA_COUNTER readDmaCounter; - ULONG counter; - - readDmaCounter = *(DmaAdapter)->DmaOperations->ReadDmaCounter; - ASSERT( readDmaCounter != NULL ); - - counter = readDmaCounter( DmaAdapter ); - return counter; -} - -#endif // USE_DMA_MACROS && (_NTDDK_ || _NTDRIVER_) - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -PoSetSystemState ( - __in EXECUTION_STATE Flags - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PVOID -PoRegisterSystemState ( - __inout_opt PVOID StateHandle, - __in EXECUTION_STATE Flags - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoCreatePowerRequest ( - __deref_out PVOID *PowerRequest, - __in PDEVICE_OBJECT DeviceObject, - __in PCOUNTED_REASON_CONTEXT Context - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoSetPowerRequest ( - __inout PVOID PowerRequest, - __in POWER_REQUEST_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoClearPowerRequest ( - __inout PVOID PowerRequest, - __in POWER_REQUEST_TYPE Type - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PoDeletePowerRequest ( - __inout PVOID PowerRequest - ); -#endif - - -typedef -__drv_functionClass(REQUEST_POWER_COMPLETE) -__drv_sameIRQL -VOID -REQUEST_POWER_COMPLETE ( - __in PDEVICE_OBJECT DeviceObject, - __in UCHAR MinorFunction, - __in POWER_STATE PowerState, - __in_opt PVOID Context, - __in PIO_STATUS_BLOCK IoStatus - ); - -typedef REQUEST_POWER_COMPLETE *PREQUEST_POWER_COMPLETE; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoRequestPowerIrp ( - __in PDEVICE_OBJECT DeviceObject, - __in UCHAR MinorFunction, - __in POWER_STATE PowerState, - __in_opt PREQUEST_POWER_COMPLETE CompletionFunction, - __in_opt __drv_aliasesMem PVOID Context, - __deref_opt_out PIRP *Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -PoSetSystemWake ( - __inout PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -PoGetSystemWake ( - __in PIRP Irp - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -PoUnregisterSystemState ( - __inout PVOID StateHandle - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -POWER_STATE -PoSetPowerState ( - __in PDEVICE_OBJECT DeviceObject, - __in POWER_STATE_TYPE Type, - __in POWER_STATE State - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -PoCallDriver ( - __in PDEVICE_OBJECT DeviceObject, - __inout __drv_aliasesMem PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -VOID -PoStartNextPowerIrp( - __inout PIRP Irp - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -PULONG -PoRegisterDeviceForIdleDetection ( - __in PDEVICE_OBJECT DeviceObject, - __in ULONG ConservationIdleTime, - __in ULONG PerformanceIdleTime, - __in DEVICE_POWER_STATE State - ); -#endif - -#define PoSetDeviceBusy(IdlePointer) \ - *IdlePointer = 0 - -#if (NTDDI_VERSION >= NTDDI_WIN6SP1) -NTKERNELAPI -VOID -PoSetDeviceBusyEx ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -PoStartDeviceBusy ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -PoEndDeviceBusy ( - __inout PULONG IdlePointer - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -BOOLEAN -PoQueryWatchdogTime ( - __in PDEVICE_OBJECT Pdo, - __out PULONG SecondsRemaining - ); -#endif - -typedef -__drv_functionClass(POWER_SETTING_CALLBACK) -__drv_sameIRQL -NTSTATUS -POWER_SETTING_CALLBACK ( - __in LPCGUID SettingGuid, - __in_bcount(ValueLength) PVOID Value, - __in ULONG ValueLength, - __inout_opt PVOID Context -); - -typedef POWER_SETTING_CALLBACK *PPOWER_SETTING_CALLBACK; - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoRegisterPowerSettingCallback ( - __in_opt PDEVICE_OBJECT DeviceObject, - __in LPCGUID SettingGuid, - __in PPOWER_SETTING_CALLBACK Callback, - __in_opt PVOID Context, - __deref_opt_out PVOID *Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -PoUnregisterPowerSettingCallback ( - __inout PVOID Handle - ); -#endif - -// -// \Callback\PowerState values -// - -#define PO_CB_SYSTEM_POWER_POLICY 0 -#define PO_CB_AC_STATUS 1 -#define PO_CB_BUTTON_COLLISION 2 // deprecated -#define PO_CB_SYSTEM_STATE_LOCK 3 -#define PO_CB_LID_SWITCH_STATE 4 -#define PO_CB_PROCESSOR_POWER_POLICY 5 // deprecated - -// -// Object Manager types -// - -typedef struct _OBJECT_HANDLE_INFORMATION { - ULONG HandleAttributes; - ACCESS_MASK GrantedAccess; -} OBJECT_HANDLE_INFORMATION, *POBJECT_HANDLE_INFORMATION; - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -ObReferenceObjectByHandle( - __in HANDLE Handle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode, - __out PVOID *Object, - __out_opt POBJECT_HANDLE_INFORMATION HandleInformation - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -ObReferenceObjectByHandleWithTag( - __in HANDLE Handle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode, - __in ULONG Tag, - __out PVOID *Object, - __out_opt POBJECT_HANDLE_INFORMATION HandleInformation - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -#define ObDereferenceObject(a) \ - ObfDereferenceObject(a) - -#define ObReferenceObject(Object) ObfReferenceObject(Object) - -#define ObDereferenceObjectWithTag(a, t) \ - ObfDereferenceObjectWithTag(a, t) - -#define ObReferenceObjectWithTag(Object, Tag) ObfReferenceObjectWithTag(Object, Tag) - -#else - -#define ObDereferenceObject(a) \ - ObfDereferenceObject(a) - -#define ObReferenceObject(Object) ObfReferenceObject(Object) - -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG_PTR -FASTCALL -ObfReferenceObject( - __in PVOID Object - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG_PTR -FASTCALL -ObfReferenceObjectWithTag( - __in PVOID Object, - __in ULONG Tag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ObReferenceObjectByPointer( - __in PVOID Object, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -NTSTATUS -ObReferenceObjectByPointerWithTag( - __in PVOID Object, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_TYPE ObjectType, - __in KPROCESSOR_MODE AccessMode, - __in ULONG Tag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG_PTR -FASTCALL -ObfDereferenceObject( - __in PVOID Object - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(DISPATCH_LEVEL) -NTKERNELAPI -LONG_PTR -FASTCALL -ObfDereferenceObjectWithTag( - __in PVOID Object, - __in ULONG Tag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTKERNELAPI -VOID -ObDereferenceObjectDeferDelete( - __in PVOID Object - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -NTKERNELAPI -VOID -ObDereferenceObjectDeferDeleteWithTag( - __in PVOID Object, - __in ULONG Tag - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -NTSTATUS -ObGetObjectSecurity( - __in PVOID Object, - __out PSECURITY_DESCRIPTOR *SecurityDescriptor, - __out PBOOLEAN MemoryAllocated - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTKERNELAPI -VOID -ObReleaseObjectSecurity( - __in PSECURITY_DESCRIPTOR SecurityDescriptor, - __in BOOLEAN MemoryAllocated - ); -#endif - - -// -// Registration version for Vista SP1 and Windows Server 2007 -// -#define OB_FLT_REGISTRATION_VERSION_0100 0x0100 - -// -// This value should be used by filters for registration -// -#define OB_FLT_REGISTRATION_VERSION OB_FLT_REGISTRATION_VERSION_0100 - -typedef ULONG OB_OPERATION; - -#define OB_OPERATION_HANDLE_CREATE 0x00000001 -#define OB_OPERATION_HANDLE_DUPLICATE 0x00000002 - -typedef struct _OB_PRE_CREATE_HANDLE_INFORMATION { - __inout ACCESS_MASK DesiredAccess; - __in ACCESS_MASK OriginalDesiredAccess; -} OB_PRE_CREATE_HANDLE_INFORMATION, *POB_PRE_CREATE_HANDLE_INFORMATION; - -typedef struct _OB_PRE_DUPLICATE_HANDLE_INFORMATION { - __inout ACCESS_MASK DesiredAccess; - __in ACCESS_MASK OriginalDesiredAccess; - __in PVOID SourceProcess; - __in PVOID TargetProcess; -} OB_PRE_DUPLICATE_HANDLE_INFORMATION, * POB_PRE_DUPLICATE_HANDLE_INFORMATION; - -typedef union _OB_PRE_OPERATION_PARAMETERS { - __inout OB_PRE_CREATE_HANDLE_INFORMATION CreateHandleInformation; - __inout OB_PRE_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation; -} OB_PRE_OPERATION_PARAMETERS, *POB_PRE_OPERATION_PARAMETERS; - -typedef struct _OB_PRE_OPERATION_INFORMATION { - __in OB_OPERATION Operation; - union { - __in ULONG Flags; - struct { - __in ULONG KernelHandle:1; - __in ULONG Reserved:31; - }; - }; - __in PVOID Object; - __in POBJECT_TYPE ObjectType; - __out PVOID CallContext; - __in POB_PRE_OPERATION_PARAMETERS Parameters; -} OB_PRE_OPERATION_INFORMATION, *POB_PRE_OPERATION_INFORMATION; - -typedef struct _OB_POST_CREATE_HANDLE_INFORMATION { - __in ACCESS_MASK GrantedAccess; -} OB_POST_CREATE_HANDLE_INFORMATION, *POB_POST_CREATE_HANDLE_INFORMATION; - -typedef struct _OB_POST_DUPLICATE_HANDLE_INFORMATION { - __in ACCESS_MASK GrantedAccess; -} OB_POST_DUPLICATE_HANDLE_INFORMATION, * POB_POST_DUPLICATE_HANDLE_INFORMATION; - -typedef union _OB_POST_OPERATION_PARAMETERS { - __in OB_POST_CREATE_HANDLE_INFORMATION CreateHandleInformation; - __in OB_POST_DUPLICATE_HANDLE_INFORMATION DuplicateHandleInformation; -} OB_POST_OPERATION_PARAMETERS, *POB_POST_OPERATION_PARAMETERS; - -typedef struct _OB_POST_OPERATION_INFORMATION { - __in OB_OPERATION Operation; - union { - __in ULONG Flags; - struct { - __in ULONG KernelHandle:1; - __in ULONG Reserved:31; - }; - }; - __in PVOID Object; - __in POBJECT_TYPE ObjectType; - __in PVOID CallContext; - __in NTSTATUS ReturnStatus; - __in POB_POST_OPERATION_PARAMETERS Parameters; -} OB_POST_OPERATION_INFORMATION,*POB_POST_OPERATION_INFORMATION; - -typedef enum _OB_PREOP_CALLBACK_STATUS { - OB_PREOP_SUCCESS -} OB_PREOP_CALLBACK_STATUS, *POB_PREOP_CALLBACK_STATUS; - -typedef OB_PREOP_CALLBACK_STATUS -(*POB_PRE_OPERATION_CALLBACK) ( - __in PVOID RegistrationContext, - __inout POB_PRE_OPERATION_INFORMATION OperationInformation - ); - -typedef VOID -(*POB_POST_OPERATION_CALLBACK) ( - __in PVOID RegistrationContext, - __in POB_POST_OPERATION_INFORMATION OperationInformation - ); - -typedef struct _OB_OPERATION_REGISTRATION { - __in POBJECT_TYPE *ObjectType; - __in OB_OPERATION Operations; - __in POB_PRE_OPERATION_CALLBACK PreOperation; - __in POB_POST_OPERATION_CALLBACK PostOperation; -} OB_OPERATION_REGISTRATION, *POB_OPERATION_REGISTRATION; - -typedef struct _OB_CALLBACK_REGISTRATION { - __in USHORT Version; - __in USHORT OperationRegistrationCount; - __in UNICODE_STRING Altitude; - __in PVOID RegistrationContext; - __in OB_OPERATION_REGISTRATION *OperationRegistration; -} OB_CALLBACK_REGISTRATION, *POB_CALLBACK_REGISTRATION; - -#if (NTDDI_VERSION >= NTDDI_VISTASP1) -NTKERNELAPI -NTSTATUS -ObRegisterCallbacks ( - __in POB_CALLBACK_REGISTRATION CallbackRegistration, - __deref_out PVOID *RegistrationHandle - ); - -NTKERNELAPI -VOID -ObUnRegisterCallbacks ( - __in PVOID RegistrationHandle - ); - -NTKERNELAPI -USHORT -ObGetFilterVersion (); -#endif - -#ifndef _PCI_X_ -#define _PCI_X_ - -// -// A PCI driver can read the complete 256 bytes of configuration -// information for any PCI device by calling: -// -// ULONG -// HalGetBusData ( -// __in BUS_DATA_TYPE PCIConfiguration, -// __in ULONG PciBusNumber, -// __in PCI_SLOT_NUMBER VirtualSlotNumber, -// __in PPCI_COMMON_CONFIG &PCIDeviceConfig, -// __in ULONG sizeof (PCIDeviceConfig) -// ); -// -// A return value of 0 means that the specified PCI bus does not exist. -// -// A return value of 2, with a VendorID of PCI_INVALID_VENDORID means -// that the PCI bus does exist, but there is no device at the specified -// VirtualSlotNumber (PCI Device/Function number). -// -// - - - -typedef struct _PCI_SLOT_NUMBER { - union { - struct { - ULONG DeviceNumber:5; - ULONG FunctionNumber:3; - ULONG Reserved:24; - } bits; - ULONG AsULONG; - } u; -} PCI_SLOT_NUMBER, *PPCI_SLOT_NUMBER; - - -#define PCI_TYPE0_ADDRESSES 6 -#define PCI_TYPE1_ADDRESSES 2 -#define PCI_TYPE2_ADDRESSES 5 - -typedef struct _PCI_COMMON_HEADER { - USHORT VendorID; // (ro) - USHORT DeviceID; // (ro) - USHORT Command; // Device control - USHORT Status; - UCHAR RevisionID; // (ro) - UCHAR ProgIf; // (ro) - UCHAR SubClass; // (ro) - UCHAR BaseClass; // (ro) - UCHAR CacheLineSize; // (ro+) - UCHAR LatencyTimer; // (ro+) - UCHAR HeaderType; // (ro) - UCHAR BIST; // Built in self test - - union { - struct _PCI_HEADER_TYPE_0 { - ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; - ULONG CIS; - USHORT SubVendorID; - USHORT SubSystemID; - ULONG ROMBaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved1[3]; - ULONG Reserved2; - UCHAR InterruptLine; // - UCHAR InterruptPin; // (ro) - UCHAR MinimumGrant; // (ro) - UCHAR MaximumLatency; // (ro) - } type0; - - - - // - // PCI to PCI Bridge - // - - struct _PCI_HEADER_TYPE_1 { - ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; - UCHAR PrimaryBus; - UCHAR SecondaryBus; - UCHAR SubordinateBus; - UCHAR SecondaryLatency; - UCHAR IOBase; - UCHAR IOLimit; - USHORT SecondaryStatus; - USHORT MemoryBase; - USHORT MemoryLimit; - USHORT PrefetchBase; - USHORT PrefetchLimit; - ULONG PrefetchBaseUpper32; - ULONG PrefetchLimitUpper32; - USHORT IOBaseUpper16; - USHORT IOLimitUpper16; - UCHAR CapabilitiesPtr; - UCHAR Reserved1[3]; - ULONG ROMBaseAddress; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - } type1; - - // - // PCI to CARDBUS Bridge - // - - struct _PCI_HEADER_TYPE_2 { - ULONG SocketRegistersBaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved; - USHORT SecondaryStatus; - UCHAR PrimaryBus; - UCHAR SecondaryBus; - UCHAR SubordinateBus; - UCHAR SecondaryLatency; - struct { - ULONG Base; - ULONG Limit; - } Range[PCI_TYPE2_ADDRESSES-1]; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - } type2; - - - - } u; - -} PCI_COMMON_HEADER, *PPCI_COMMON_HEADER; - -#ifdef __cplusplus - -typedef struct _PCI_COMMON_CONFIG : PCI_COMMON_HEADER { - UCHAR DeviceSpecific[192]; -} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - -#else - -typedef struct _PCI_COMMON_CONFIG { - PCI_COMMON_HEADER DUMMYSTRUCTNAME; - UCHAR DeviceSpecific[192]; -} PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - -#endif - -#define PCI_COMMON_HDR_LENGTH (FIELD_OFFSET (PCI_COMMON_CONFIG, DeviceSpecific)) -#define PCI_EXTENDED_CONFIG_LENGTH 0x1000 - -#define PCI_MAX_DEVICES 32 -#define PCI_MAX_FUNCTION 8 -#define PCI_MAX_BRIDGE_NUMBER 0xFF - -#define PCI_INVALID_VENDORID 0xFFFF - -// -// Bit encodings for PCI_COMMON_CONFIG.HeaderType -// - -#define PCI_MULTIFUNCTION 0x80 -#define PCI_DEVICE_TYPE 0x00 -#define PCI_BRIDGE_TYPE 0x01 -#define PCI_CARDBUS_BRIDGE_TYPE 0x02 - -#define PCI_CONFIGURATION_TYPE(PciData) \ - (((PPCI_COMMON_CONFIG)(PciData))->HeaderType & ~PCI_MULTIFUNCTION) - -#define PCI_MULTIFUNCTION_DEVICE(PciData) \ - ((((PPCI_COMMON_CONFIG)(PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) - -// -// Bit encodings for PCI_COMMON_CONFIG.Command -// - -#define PCI_ENABLE_IO_SPACE 0x0001 -#define PCI_ENABLE_MEMORY_SPACE 0x0002 -#define PCI_ENABLE_BUS_MASTER 0x0004 -#define PCI_ENABLE_SPECIAL_CYCLES 0x0008 -#define PCI_ENABLE_WRITE_AND_INVALIDATE 0x0010 -#define PCI_ENABLE_VGA_COMPATIBLE_PALETTE 0x0020 -#define PCI_ENABLE_PARITY 0x0040 // (ro+) -#define PCI_ENABLE_WAIT_CYCLE 0x0080 // (ro+) -#define PCI_ENABLE_SERR 0x0100 // (ro+) -#define PCI_ENABLE_FAST_BACK_TO_BACK 0x0200 // (ro) -#define PCI_DISABLE_LEVEL_INTERRUPT 0x0400 - -// -// Bit encodings for PCI_COMMON_CONFIG.Status -// - -#define PCI_STATUS_INTERRUPT_PENDING 0x0008 -#define PCI_STATUS_CAPABILITIES_LIST 0x0010 // (ro) -#define PCI_STATUS_66MHZ_CAPABLE 0x0020 // (ro) -#define PCI_STATUS_UDF_SUPPORTED 0x0040 // (ro) -#define PCI_STATUS_FAST_BACK_TO_BACK 0x0080 // (ro) -#define PCI_STATUS_DATA_PARITY_DETECTED 0x0100 -#define PCI_STATUS_DEVSEL 0x0600 // 2 bits wide -#define PCI_STATUS_SIGNALED_TARGET_ABORT 0x0800 -#define PCI_STATUS_RECEIVED_TARGET_ABORT 0x1000 -#define PCI_STATUS_RECEIVED_MASTER_ABORT 0x2000 -#define PCI_STATUS_SIGNALED_SYSTEM_ERROR 0x4000 -#define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 - -// -// The NT PCI Driver uses a WhichSpace parameter on its CONFIG_READ/WRITE -// routines. The following values are defined- -// - -#define PCI_WHICHSPACE_CONFIG 0x0 -#define PCI_WHICHSPACE_ROM 0x52696350 - -// -// PCI Capability IDs -// - -#define PCI_CAPABILITY_ID_POWER_MANAGEMENT 0x01 -#define PCI_CAPABILITY_ID_AGP 0x02 -#define PCI_CAPABILITY_ID_VPD 0x03 -#define PCI_CAPABILITY_ID_SLOT_ID 0x04 -#define PCI_CAPABILITY_ID_MSI 0x05 -#define PCI_CAPABILITY_ID_CPCI_HOTSWAP 0x06 -#define PCI_CAPABILITY_ID_PCIX 0x07 -#define PCI_CAPABILITY_ID_HYPERTRANSPORT 0x08 -#define PCI_CAPABILITY_ID_VENDOR_SPECIFIC 0x09 -#define PCI_CAPABILITY_ID_DEBUG_PORT 0x0A -#define PCI_CAPABILITY_ID_CPCI_RES_CTRL 0x0B -#define PCI_CAPABILITY_ID_SHPC 0x0C -#define PCI_CAPABILITY_ID_P2P_SSID 0x0D -#define PCI_CAPABILITY_ID_AGP_TARGET 0x0E -#define PCI_CAPABILITY_ID_SECURE 0x0F -#define PCI_CAPABILITY_ID_PCI_EXPRESS 0x10 -#define PCI_CAPABILITY_ID_MSIX 0x11 - -// -// All PCI Capability structures have the following header. -// -// CapabilityID is used to identify the type of the structure (is -// one of the PCI_CAPABILITY_ID values above. -// -// Next is the offset in PCI Configuration space (0x40 - 0xfc) of the -// next capability structure in the list, or 0x00 if there are no more -// entries. -// -typedef struct _PCI_CAPABILITIES_HEADER { - UCHAR CapabilityID; - UCHAR Next; -} PCI_CAPABILITIES_HEADER, *PPCI_CAPABILITIES_HEADER; - -// -// Power Management Capability -// - -typedef struct _PCI_PMC { - UCHAR Version:3; - UCHAR PMEClock:1; - UCHAR Rsvd1:1; - UCHAR DeviceSpecificInitialization:1; - UCHAR Rsvd2:2; - struct _PM_SUPPORT { - UCHAR Rsvd2:1; - UCHAR D1:1; - UCHAR D2:1; - UCHAR PMED0:1; - UCHAR PMED1:1; - UCHAR PMED2:1; - UCHAR PMED3Hot:1; - UCHAR PMED3Cold:1; - } Support; -} PCI_PMC, *PPCI_PMC; - -typedef struct _PCI_PMCSR { - USHORT PowerState:2; - USHORT Rsvd1:6; - USHORT PMEEnable:1; - USHORT DataSelect:4; - USHORT DataScale:2; - USHORT PMEStatus:1; -} PCI_PMCSR, *PPCI_PMCSR; - - -typedef struct _PCI_PMCSR_BSE { - UCHAR Rsvd1:6; - UCHAR D3HotSupportsStopClock:1; // B2_B3# - UCHAR BusPowerClockControlEnabled:1; // BPCC_EN -} PCI_PMCSR_BSE, *PPCI_PMCSR_BSE; - - -typedef struct _PCI_PM_CAPABILITY { - - PCI_CAPABILITIES_HEADER Header; - - // - // Power Management Capabilities (Offset = 2) - // - - union { - PCI_PMC Capabilities; - USHORT AsUSHORT; - } PMC; - - // - // Power Management Control/Status (Offset = 4) - // - - union { - PCI_PMCSR ControlStatus; - USHORT AsUSHORT; - } PMCSR; - - // - // PMCSR PCI-PCI Bridge Support Extensions - // - - union { - PCI_PMCSR_BSE BridgeSupport; - UCHAR AsUCHAR; - } PMCSR_BSE; - - // - // Optional read only 8 bit Data register. Contents controlled by - // DataSelect and DataScale in ControlStatus. - // - - UCHAR Data; - -} PCI_PM_CAPABILITY, *PPCI_PM_CAPABILITY; - - -// -// PCI-X Capability -// - -typedef struct { - - PCI_CAPABILITIES_HEADER Header; - - union { - struct { - USHORT DataParityErrorRecoveryEnable:1; - USHORT EnableRelaxedOrdering:1; - USHORT MaxMemoryReadByteCount:2; - USHORT MaxOutstandingSplitTransactions:3; - USHORT Reserved:9; - } bits; - USHORT AsUSHORT; - } Command; - - union { - struct { - ULONG FunctionNumber:3; - ULONG DeviceNumber:5; - ULONG BusNumber:8; - ULONG Device64Bit:1; - ULONG Capable133MHz:1; - ULONG SplitCompletionDiscarded:1; - ULONG UnexpectedSplitCompletion:1; - ULONG DeviceComplexity:1; - ULONG DesignedMaxMemoryReadByteCount:2; - ULONG DesignedMaxOutstandingSplitTransactions:3; - ULONG DesignedMaxCumulativeReadSize:3; - ULONG ReceivedSplitCompletionErrorMessage:1; - ULONG CapablePCIX266:1; - ULONG CapablePCIX533:1; - } bits; - ULONG AsULONG; - } Status; -} PCI_X_CAPABILITY, *PPCI_X_CAPABILITY; - - -// -// PCI Express Extended Capabilities. -// - -#define PCI_EXPRESS_ADVANCED_ERROR_REPORTING_CAP_ID 0x0001 -#define PCI_EXPRESS_VIRTUAL_CHANNEL_CAP_ID 0x0002 -#define PCI_EXPRESS_DEVICE_SERIAL_NUMBER_CAP_ID 0x0003 -#define PCI_EXPRESS_POWER_BUDGETING_CAP_ID 0x0004 -#define PCI_EXPRESS_RC_LINK_DECLARATION_CAP_ID 0x0005 -#define PCI_EXPRESS_RC_INTERNAL_LINK_CONTROL_CAP_ID 0x0006 -#define PCI_EXPRESS_RC_EVENT_COLLECTOR_ENDPOINT_ASSOCIATION_CAP_ID 0x0007 -#define PCI_EXPRESS_MFVC_CAP_ID 0x0008 -#define PCI_EXPRESS_VC_AND_MFVC_CAP_ID 0x0009 -#define PCI_EXPRESS_RCRB_HEADER_CAP_ID 0x000A -#define PCI_EXPRESS_SINGLE_ROOT_IO_VIRTUALIZATION_CAP_ID 0x0010 - -// -// All Enhanced capabilities have the following header. -// - -typedef struct _PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER { - - USHORT CapabilityID; - USHORT Version:4; - USHORT Next:12; - -} PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER, *PPCI_EXPRESS_ENHANCED_CAPABILITY_HEADER; - -// -// Serial Number Capability. -// - -typedef struct _PCI_EXPRESS_SERIAL_NUMBER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - ULONG LowSerialNumber; - ULONG HighSerialNumber; - -} PCI_EXPRESS_SERIAL_NUMBER_CAPABILITY, *PPCI_EXPRESS_SERIAL_NUMBER_CAPABILITY; - -// -// PCI Express Advanced Error Reporting structures. -// - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY { - - struct { - ULONG Undefined:1; - ULONG Reserved1:3; - ULONG DataLinkProtocolError:1; - ULONG SurpriseDownError:1; - ULONG Reserved2:6; - ULONG PoisonedTLP:1; - ULONG FlowControlProtocolError:1; - ULONG CompletionTimeout:1; - ULONG CompleterAbort:1; - ULONG UnexpectedCompletion:1; - ULONG ReceiverOverflow:1; - ULONG MalformedTLP:1; - ULONG ECRCError:1; - ULONG UnsupportedRequestError:1; - ULONG Reserved3:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY, *PPCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY; - -typedef union _PCI_EXPRESS_CORRECTABLE_ERROR_STATUS { - - struct { - ULONG ReceiverError:1; - ULONG Reserved1:5; - ULONG BadTLP:1; - ULONG BadDLLP:1; - ULONG ReplayNumRollover:1; - ULONG Reserved2:3; - ULONG ReplayTimerTimeout:1; - ULONG AdvisoryNonFatalError:1; - ULONG Reserved3:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_CORRECTABLE_ERROR_STATUS, *PPCI_CORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_CORRECTABLE_ERROR_MASK { - - struct { - ULONG ReceiverError:1; - ULONG Reserved1:5; - ULONG BadTLP:1; - ULONG BadDLLP:1; - ULONG ReplayNumRollover:1; - ULONG Reserved2:3; - ULONG ReplayTimerTimeout:1; - ULONG AdvisoryNonFatalError:1; - ULONG Reserved3:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_CORRECTABLE_ERROR_MASK, *PPCI_CORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_AER_CAPABILITIES { - - struct { - ULONG FirstErrorPointer:5; - ULONG ECRCGenerationCapable:1; - ULONG ECRCGenerationEnable:1; - ULONG ECRCCheckCapable:1; - ULONG ECRCCheckEnable:1; - ULONG Reserved:23; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_AER_CAPABILITIES, *PPCI_EXPRESS_AER_CAPABILITIES; - -typedef union _PCI_EXPRESS_ROOT_ERROR_COMMAND { - - struct { - ULONG CorrectableErrorReportingEnable:1; - ULONG NonFatalErrorReportingEnable:1; - ULONG FatalErrorReportingEnable:1; - ULONG Reserved:29; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_ERROR_COMMAND, *PPCI_EXPRESS_ROOT_ERROR_COMMAND; - -typedef union _PCI_EXPRESS_ROOT_ERROR_STATUS { - - struct { - ULONG CorrectableErrorReceived:1; - ULONG MultipleCorrectableErrorsReceived:1; - ULONG UncorrectableErrorReceived:1; - ULONG MultipleUncorrectableErrorsReceived:1; - ULONG FirstUncorrectableFatal:1; - ULONG NonFatalErrorMessagesReceived:1; - ULONG FatalErrorMessagesReceived:1; - ULONG Reserved:20; - ULONG AdvancedErrorInterruptMessageNumber:5; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ROOT_ERROR_STATUS, *PPCI_EXPRESS_ROOT_ERROR_STATUS; - -typedef union _PCI_EXPRESS_ERROR_SOURCE_ID { - - struct { - USHORT CorrectableSourceIdFun:3; - USHORT CorrectableSourceIdDev:5; - USHORT CorrectableSourceIdBus:8; - USHORT UncorrectableSourceIdFun:3; - USHORT UncorrectableSourceIdDev:5; - USHORT UncorrectableSourceIdBus:8; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_ERROR_SOURCE_ID, *PPCI_EXPRESS_ERROR_SOURCE_ID; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK; - -typedef union _PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY { - - struct { - ULONG TargetAbortOnSplitCompletion:1; - ULONG MasterAbortOnSplitCompletion:1; - ULONG ReceivedTargetAbort:1; - ULONG ReceivedMasterAbort:1; - ULONG RsvdZ:1; - ULONG UnexpectedSplitCompletionError:1; - ULONG UncorrectableSplitCompletion:1; - ULONG UncorrectableDataError:1; - ULONG UncorrectableAttributeError:1; - ULONG UncorrectableAddressError:1; - ULONG DelayedTransactionDiscardTimerExpired:1; - ULONG PERRAsserted:1; - ULONG SERRAsserted:1; - ULONG InternalBridgeError:1; - ULONG Reserved:18; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY, - *PPCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY; - -typedef union _PCI_EXPRESS_SEC_AER_CAPABILITIES { - - struct { - ULONG SecondaryUncorrectableFirstErrorPtr:5; - ULONG Reserved:27; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SEC_AER_CAPABILITIES, *PPCI_EXPRESS_SEC_AER_CAPABILITIES; - -#define ROOT_CMD_ENABLE_CORRECTABLE_ERROR_REPORTING 0x00000001 -#define ROOT_CMD_ENABLE_NONFATAL_ERROR_REPORTING 0x00000002 -#define ROOT_CMD_ENABLE_FATAL_ERROR_REPORTING 0x00000004 - -#define ROOT_CMD_ERROR_REPORTING_ENABLE_MASK \ - (ROOT_CMD_ENABLE_FATAL_ERROR_REPORTING | \ - ROOT_CMD_ENABLE_NONFATAL_ERROR_REPORTING | \ - ROOT_CMD_ENABLE_CORRECTABLE_ERROR_REPORTING) - -// -// Advanced Error Reporting Capability structure. -// - -typedef struct _PCI_EXPRESS_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS SecUncorrectableErrorStatus; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK SecUncorrectableErrorMask; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY SecUncorrectableErrorSeverity; - PCI_EXPRESS_SEC_AER_CAPABILITIES SecCapabilitiesAndControl; - ULONG SecHeaderLog[4]; - -} PCI_EXPRESS_AER_CAPABILITY, *PPCI_EXPRESS_AER_CAPABILITY; - -// -// Advanced Error Reporting Capability structure for root port. -// - -typedef struct _PCI_EXPRESS_ROOTPORT_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_ROOT_ERROR_COMMAND RootErrorCommand; - PCI_EXPRESS_ROOT_ERROR_STATUS RootErrorStatus; - PCI_EXPRESS_ERROR_SOURCE_ID ErrorSourceId; - -} PCI_EXPRESS_ROOTPORT_AER_CAPABILITY, *PPCI_EXPRESS_ROOTPORT_AER_CAPABILITY; - -// -// Advanced Error Reporting Capability structure for root port. -// - -typedef struct _PCI_EXPRESS_BRIDGE_AER_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_UNCORRECTABLE_ERROR_STATUS UncorrectableErrorStatus; - PCI_EXPRESS_UNCORRECTABLE_ERROR_MASK UncorrectableErrorMask; - PCI_EXPRESS_UNCORRECTABLE_ERROR_SEVERITY UncorrectableErrorSeverity; - PCI_EXPRESS_CORRECTABLE_ERROR_STATUS CorrectableErrorStatus; - PCI_EXPRESS_CORRECTABLE_ERROR_MASK CorrectableErrorMask; - PCI_EXPRESS_AER_CAPABILITIES CapabilitiesAndControl; - ULONG HeaderLog[4]; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_STATUS SecUncorrectableErrorStatus; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_MASK SecUncorrectableErrorMask; - PCI_EXPRESS_SEC_UNCORRECTABLE_ERROR_SEVERITY SecUncorrectableErrorSeverity; - PCI_EXPRESS_SEC_AER_CAPABILITIES SecCapabilitiesAndControl; - ULONG SecHeaderLog[4]; - -} PCI_EXPRESS_BRIDGE_AER_CAPABILITY, *PPCI_EXPRESS_BRIDGE_AER_CAPABILITY; - -// -// Single-Root I/O Virtualization Capability structure for endpoints -// - -typedef union _PCI_EXPRESS_SRIOV_CAPS { - - struct { - ULONG VFMigrationCapable:1; - ULONG Reserved1:20; - ULONG VFMigrationInterruptNumber:11; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SRIOV_CAPS, *PPCI_EXPRESS_SRIOV_CAPS; - -typedef union _PCI_EXPRESS_SRIOV_CONTROL { - - struct { - USHORT VFEnable:1; - USHORT VFMigrationEnable:1; - USHORT VFMigrationInterruptEnable:1; - USHORT VFMemorySpaceEnable:1; - USHORT ARICapableHierarchy:1; - USHORT Reserved1:11; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SRIOV_CONTROL, *PPCI_EXPRESS_SRIOV_CONTROL; - -typedef union _PCI_EXPRESS_SRIOV_STATUS { - - struct { - USHORT VFMigrationStatus:1; - USHORT Reserved1:15; - } DUMMYSTRUCTNAME; - - USHORT AsUSHORT; - -} PCI_EXPRESS_SRIOV_STATUS, *PPCI_EXPRESS_SRIOV_STATUS; - -typedef union _PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY { - - struct { - ULONG VFMigrationStateBIR:3; - ULONG VFMigrationStateOffset:29; - } DUMMYSTRUCTNAME; - - ULONG AsULONG; - -} PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY, *PPCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY; - -typedef struct _PCI_EXPRESS_SRIOV_CAPABILITY { - - PCI_EXPRESS_ENHANCED_CAPABILITY_HEADER Header; - - PCI_EXPRESS_SRIOV_CAPS SRIOVCapabilities; - PCI_EXPRESS_SRIOV_CONTROL SRIOVControl; - PCI_EXPRESS_SRIOV_STATUS SRIOVStatus; - USHORT InitialVFs; - USHORT TotalVFs; - USHORT NumVFs; - UCHAR FunctionDependencyLink; - UCHAR RsvdP1; - USHORT FirstVFOffset; - USHORT VFStride; - USHORT RsvdP2; - USHORT VFDeviceId; - ULONG SupportedPageSizes; - ULONG SystemPageSize; - ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; - PCI_EXPRESS_SRIOV_MIGRATION_STATE_ARRAY VFMigrationStateArrayOffset; - -} PCI_EXPRESS_SRIOV_CAPABILITY, *PPCI_EXPRESS_SRIOV_CAPABILITY; - -// -// Base Class Code encodings for Base Class (from PCI spec rev 2.1). -// - -#define PCI_CLASS_PRE_20 0x00 -#define PCI_CLASS_MASS_STORAGE_CTLR 0x01 -#define PCI_CLASS_NETWORK_CTLR 0x02 -#define PCI_CLASS_DISPLAY_CTLR 0x03 -#define PCI_CLASS_MULTIMEDIA_DEV 0x04 -#define PCI_CLASS_MEMORY_CTLR 0x05 -#define PCI_CLASS_BRIDGE_DEV 0x06 -#define PCI_CLASS_SIMPLE_COMMS_CTLR 0x07 -#define PCI_CLASS_BASE_SYSTEM_DEV 0x08 -#define PCI_CLASS_INPUT_DEV 0x09 -#define PCI_CLASS_DOCKING_STATION 0x0a -#define PCI_CLASS_PROCESSOR 0x0b -#define PCI_CLASS_SERIAL_BUS_CTLR 0x0c -#define PCI_CLASS_WIRELESS_CTLR 0x0d -#define PCI_CLASS_INTELLIGENT_IO_CTLR 0x0e -#define PCI_CLASS_SATELLITE_COMMS_CTLR 0x0f -#define PCI_CLASS_ENCRYPTION_DECRYPTION 0x10 -#define PCI_CLASS_DATA_ACQ_SIGNAL_PROC 0x11 - -// 0d thru fe reserved - -#define PCI_CLASS_NOT_DEFINED 0xff - -// -// Sub Class Code encodings (PCI rev 2.1). -// - -// Class 00 - PCI_CLASS_PRE_20 - -#define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 -#define PCI_SUBCLASS_PRE_20_VGA 0x01 - -// Class 01 - PCI_CLASS_MASS_STORAGE_CTLR - -#define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 -#define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 -#define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 -#define PCI_SUBCLASS_MSC_IPI_CTLR 0x03 -#define PCI_SUBCLASS_MSC_RAID_CTLR 0x04 -#define PCI_SUBCLASS_MSC_OTHER 0x80 - -// Class 02 - PCI_CLASS_NETWORK_CTLR - -#define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 -#define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 -#define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 -#define PCI_SUBCLASS_NET_ATM_CTLR 0x03 -#define PCI_SUBCLASS_NET_ISDN_CTLR 0x04 -#define PCI_SUBCLASS_NET_OTHER 0x80 - -// Class 03 - PCI_CLASS_DISPLAY_CTLR - -// N.B. Sub Class 00 could be VGA or 8514 depending on Interface byte - -#define PCI_SUBCLASS_VID_VGA_CTLR 0x00 -#define PCI_SUBCLASS_VID_XGA_CTLR 0x01 -#define PCI_SUBLCASS_VID_3D_CTLR 0x02 -#define PCI_SUBCLASS_VID_OTHER 0x80 - -// Class 04 - PCI_CLASS_MULTIMEDIA_DEV - -#define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 -#define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 -#define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 -#define PCI_SUBCLASS_MM_OTHER 0x80 - -// Class 05 - PCI_CLASS_MEMORY_CTLR - -#define PCI_SUBCLASS_MEM_RAM 0x00 -#define PCI_SUBCLASS_MEM_FLASH 0x01 -#define PCI_SUBCLASS_MEM_OTHER 0x80 - -// Class 06 - PCI_CLASS_BRIDGE_DEV - -#define PCI_SUBCLASS_BR_HOST 0x00 -#define PCI_SUBCLASS_BR_ISA 0x01 -#define PCI_SUBCLASS_BR_EISA 0x02 -#define PCI_SUBCLASS_BR_MCA 0x03 -#define PCI_SUBCLASS_BR_PCI_TO_PCI 0x04 -#define PCI_SUBCLASS_BR_PCMCIA 0x05 -#define PCI_SUBCLASS_BR_NUBUS 0x06 -#define PCI_SUBCLASS_BR_CARDBUS 0x07 -#define PCI_SUBCLASS_BR_RACEWAY 0x08 -#define PCI_SUBCLASS_BR_OTHER 0x80 - -// Class 07 - PCI_CLASS_SIMPLE_COMMS_CTLR - -// N.B. Sub Class 00 and 01 additional info in Interface byte - -#define PCI_SUBCLASS_COM_SERIAL 0x00 -#define PCI_SUBCLASS_COM_PARALLEL 0x01 -#define PCI_SUBCLASS_COM_MULTIPORT 0x02 -#define PCI_SUBCLASS_COM_MODEM 0x03 -#define PCI_SUBCLASS_COM_OTHER 0x80 - -// Class 08 - PCI_CLASS_BASE_SYSTEM_DEV - -// N.B. See Interface byte for additional info. - -#define PCI_SUBCLASS_SYS_INTERRUPT_CTLR 0x00 -#define PCI_SUBCLASS_SYS_DMA_CTLR 0x01 -#define PCI_SUBCLASS_SYS_SYSTEM_TIMER 0x02 -#define PCI_SUBCLASS_SYS_REAL_TIME_CLOCK 0x03 -#define PCI_SUBCLASS_SYS_GEN_HOTPLUG_CTLR 0x04 -#define PCI_SUBCLASS_SYS_SDIO_CTRL 0x05 -#define PCI_SUBCLASS_SYS_OTHER 0x80 - -// Class 09 - PCI_CLASS_INPUT_DEV - -#define PCI_SUBCLASS_INP_KEYBOARD 0x00 -#define PCI_SUBCLASS_INP_DIGITIZER 0x01 -#define PCI_SUBCLASS_INP_MOUSE 0x02 -#define PCI_SUBCLASS_INP_SCANNER 0x03 -#define PCI_SUBCLASS_INP_GAMEPORT 0x04 -#define PCI_SUBCLASS_INP_OTHER 0x80 - -// Class 0a - PCI_CLASS_DOCKING_STATION - -#define PCI_SUBCLASS_DOC_GENERIC 0x00 -#define PCI_SUBCLASS_DOC_OTHER 0x80 - -// Class 0b - PCI_CLASS_PROCESSOR - -#define PCI_SUBCLASS_PROC_386 0x00 -#define PCI_SUBCLASS_PROC_486 0x01 -#define PCI_SUBCLASS_PROC_PENTIUM 0x02 -#define PCI_SUBCLASS_PROC_ALPHA 0x10 -#define PCI_SUBCLASS_PROC_POWERPC 0x20 -#define PCI_SUBCLASS_PROC_COPROCESSOR 0x40 - -// Class 0c - PCI_CLASS_SERIAL_BUS_CTLR - -#define PCI_SUBCLASS_SB_IEEE1394 0x00 -#define PCI_SUBCLASS_SB_ACCESS 0x01 -#define PCI_SUBCLASS_SB_SSA 0x02 -#define PCI_SUBCLASS_SB_USB 0x03 -#define PCI_SUBCLASS_SB_FIBRE_CHANNEL 0x04 -#define PCI_SUBCLASS_SB_SMBUS 0x05 - -// Class 0d - PCI_CLASS_WIRELESS_CTLR - -#define PCI_SUBCLASS_WIRELESS_IRDA 0x00 -#define PCI_SUBCLASS_WIRELESS_CON_IR 0x01 -#define PCI_SUBCLASS_WIRELESS_RF 0x10 -#define PCI_SUBCLASS_WIRELESS_OTHER 0x80 - -// Class 0e - PCI_CLASS_INTELLIGENT_IO_CTLR - -#define PCI_SUBCLASS_INTIO_I2O 0x00 - -// Class 0f - PCI_CLASS_SATELLITE_CTLR - -#define PCI_SUBCLASS_SAT_TV 0x01 -#define PCI_SUBCLASS_SAT_AUDIO 0x02 -#define PCI_SUBCLASS_SAT_VOICE 0x03 -#define PCI_SUBCLASS_SAT_DATA 0x04 - -// Class 10 - PCI_CLASS_ENCRYPTION_DECRYPTION - -#define PCI_SUBCLASS_CRYPTO_NET_COMP 0x00 -#define PCI_SUBCLASS_CRYPTO_ENTERTAINMENT 0x10 -#define PCI_SUBCLASS_CRYPTO_OTHER 0x80 - -// Class 11 - PCI_CLASS_DATA_ACQ_SIGNAL_PROC - -#define PCI_SUBCLASS_DASP_DPIO 0x00 -#define PCI_SUBCLASS_DASP_OTHER 0x80 - - - -// -// Bit encodes for PCI_COMMON_CONFIG.u.type0.BaseAddresses -// - -#define PCI_ADDRESS_IO_SPACE 0x00000001 // (ro) -#define PCI_ADDRESS_MEMORY_TYPE_MASK 0x00000006 // (ro) -#define PCI_ADDRESS_MEMORY_PREFETCHABLE 0x00000008 // (ro) - -#define PCI_ADDRESS_IO_ADDRESS_MASK 0xfffffffc -#define PCI_ADDRESS_MEMORY_ADDRESS_MASK 0xfffffff0 -#define PCI_ADDRESS_ROM_ADDRESS_MASK 0xfffff800 - -#define PCI_TYPE_32BIT 0 -#define PCI_TYPE_20BIT 2 -#define PCI_TYPE_64BIT 4 - -// -// Bit encodes for PCI_COMMON_CONFIG.u.type0.ROMBaseAddresses -// - -#define PCI_ROMADDRESS_ENABLED 0x00000001 - - -// -// Reference notes for PCI configuration fields: -// -// ro these field are read only. changes to these fields are ignored -// -// ro+ these field are intended to be read only and should be initialized -// by the system to their proper values. However, driver may change -// these settings. -// -// --- -// -// All resources comsumed by a PCI device start as unitialized -// under NT. An uninitialized memory or I/O base address can be -// determined by checking it's corrisponding enabled bit in the -// PCI_COMMON_CONFIG.Command value. An InterruptLine is unitialized -// if it contains the value of -1. -// - - -#endif // _PCI_X_ - - -// -// Device Presence interface -// -#define PCI_DEVICE_PRESENT_INTERFACE_VERSION 1 - -// -// Flags for PCI_DEVICE_PRESENCE_PARAMETERS -// -#define PCI_USE_SUBSYSTEM_IDS 0x00000001 -#define PCI_USE_REVISION 0x00000002 -// The following flags are only valid for IsDevicePresentEx -#define PCI_USE_VENDEV_IDS 0x00000004 -#define PCI_USE_CLASS_SUBCLASS 0x00000008 -#define PCI_USE_PROGIF 0x00000010 -#define PCI_USE_LOCAL_BUS 0x00000020 -#define PCI_USE_LOCAL_DEVICE 0x00000040 - -// -// Search parameters structure for IsDevicePresentEx -// -typedef struct _PCI_DEVICE_PRESENCE_PARAMETERS { - - ULONG Size; - ULONG Flags; - - USHORT VendorID; - USHORT DeviceID; - UCHAR RevisionID; - USHORT SubVendorID; - USHORT SubSystemID; - UCHAR BaseClass; - UCHAR SubClass; - UCHAR ProgIf; - -} PCI_DEVICE_PRESENCE_PARAMETERS, *PPCI_DEVICE_PRESENCE_PARAMETERS; - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -BOOLEAN -PCI_IS_DEVICE_PRESENT ( - __in USHORT VendorID, - __in USHORT DeviceID, - __in UCHAR RevisionID, - __in USHORT SubVendorID, - __in USHORT SubSystemID, - __in ULONG Flags -); - -typedef PCI_IS_DEVICE_PRESENT *PPCI_IS_DEVICE_PRESENT; - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -BOOLEAN -PCI_IS_DEVICE_PRESENT_EX ( - __in PVOID Context, - __in PPCI_DEVICE_PRESENCE_PARAMETERS Parameters - ); - -typedef PCI_IS_DEVICE_PRESENT_EX *PPCI_IS_DEVICE_PRESENT_EX; - -typedef struct _PCI_DEVICE_PRESENT_INTERFACE { - // - // generic interface header - // - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - // - // pci device info - // - PPCI_IS_DEVICE_PRESENT IsDevicePresent; - - PPCI_IS_DEVICE_PRESENT_EX IsDevicePresentEx; - -} PCI_DEVICE_PRESENT_INTERFACE, *PPCI_DEVICE_PRESENT_INTERFACE; - -// -// Pci Express Link Quiesce Interface -// - -#define PCI_EXPRESS_LINK_QUIESCENT_INTERFACE_VERSION 1 - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -PCI_EXPRESS_ENTER_LINK_QUIESCENT_MODE ( - __inout PVOID Context - ); - -typedef PCI_EXPRESS_ENTER_LINK_QUIESCENT_MODE *PPCI_EXPRESS_ENTER_LINK_QUIESCENT_MODE; - -__drv_maxIRQL(PASSIVE_LEVEL) -__checkReturn -typedef -NTSTATUS -PCI_EXPRESS_EXIT_LINK_QUIESCENT_MODE ( - __inout PVOID Context - ); - -typedef PCI_EXPRESS_EXIT_LINK_QUIESCENT_MODE *PPCI_EXPRESS_EXIT_LINK_QUIESCENT_MODE; - -typedef struct _PCI_EXPRESS_LINK_QUIESCENT_INTERFACE { - - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - PPCI_EXPRESS_ENTER_LINK_QUIESCENT_MODE PciExpressEnterLinkQuiescentMode; - PPCI_EXPRESS_EXIT_LINK_QUIESCENT_MODE PciExpressExitLinkQuiescentMode; - -} PCI_EXPRESS_LINK_QUIESCENT_INTERFACE, *PPCI_EXPRESS_LINK_QUIESCENT_INTERFACE; - -// -// Pci Express Root Port Access Interface -// - -#define PCI_EXPRESS_ROOT_PORT_INTERFACE_VERSION 1 - -typedef -ULONG -(*PPCI_EXPRESS_ROOT_PORT_READ_CONFIG_SPACE) ( - __in PVOID Context, - __out_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -typedef -ULONG -(*PPCI_EXPRESS_ROOT_PORT_WRITE_CONFIG_SPACE) ( - __in PVOID Context, - __in_bcount(Length) PVOID Buffer, - __in ULONG Offset, - __in ULONG Length - ); - -typedef struct _PCI_EXPRESS_ROOT_PORT_INTERFACE { - - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - PPCI_EXPRESS_ROOT_PORT_READ_CONFIG_SPACE ReadConfigSpace; - PPCI_EXPRESS_ROOT_PORT_WRITE_CONFIG_SPACE WriteConfigSpace; - -} PCI_EXPRESS_ROOT_PORT_INTERFACE, *PPCI_EXPRESS_ROOT_PORT_INTERFACE; - -// -// MSI-X interrupt table configuration interface -// - -#define PCI_MSIX_TABLE_CONFIG_INTERFACE_VERSION 1 - -__checkReturn -typedef -NTSTATUS -PCI_MSIX_SET_ENTRY ( - __in PVOID Context, - __in ULONG TableEntry, - __in ULONG MessageNumber - ); - -typedef PCI_MSIX_SET_ENTRY *PPCI_MSIX_SET_ENTRY; - -__checkReturn -typedef -NTSTATUS -PCI_MSIX_MASKUNMASK_ENTRY ( - __in PVOID Context, - __in ULONG TableEntry - ); - -typedef PCI_MSIX_MASKUNMASK_ENTRY *PPCI_MSIX_MASKUNMASK_ENTRY; - -__checkReturn -typedef -NTSTATUS -PCI_MSIX_GET_ENTRY ( - __in PVOID Context, - __in ULONG TableEntry, - __out PULONG MessageNumber, - __out PBOOLEAN Masked - ); - -typedef PCI_MSIX_GET_ENTRY *PPCI_MSIX_GET_ENTRY; - -__checkReturn -typedef -NTSTATUS -PCI_MSIX_GET_TABLE_SIZE ( - __in PVOID Context, - __out PULONG TableSize - ); - -typedef PCI_MSIX_GET_TABLE_SIZE *PPCI_MSIX_GET_TABLE_SIZE; - -typedef struct _PCI_MSIX_TABLE_CONFIG_INTERFACE { - USHORT Size; - USHORT Version; - PVOID Context; - PINTERFACE_REFERENCE InterfaceReference; - PINTERFACE_DEREFERENCE InterfaceDereference; - - PPCI_MSIX_SET_ENTRY SetTableEntry; - PPCI_MSIX_MASKUNMASK_ENTRY MaskTableEntry; - PPCI_MSIX_MASKUNMASK_ENTRY UnmaskTableEntry; - PPCI_MSIX_GET_ENTRY GetTableEntry; - PPCI_MSIX_GET_TABLE_SIZE GetTableSize; -} PCI_MSIX_TABLE_CONFIG_INTERFACE, *PPCI_MSIX_TABLE_CONFIG_INTERFACE; - -#define PCI_MSIX_TABLE_CONFIG_MINIMUM_SIZE \ - RTL_SIZEOF_THROUGH_FIELD(PCI_MSIX_TABLE_CONFIG_INTERFACE, UnmaskTableEntry) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwCreateFile( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_opt PLARGE_INTEGER AllocationSize, - __in ULONG FileAttributes, - __in ULONG ShareAccess, - __in ULONG CreateDisposition, - __in ULONG CreateOptions, - __in_bcount_opt(EaLength) PVOID EaBuffer, - __in ULONG EaLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenFile( - __out PHANDLE FileHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG ShareAccess, - __in ULONG OpenOptions - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwLoadDriver( - __in PUNICODE_STRING DriverServiceName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwUnloadDriver( - __in PUNICODE_STRING DriverServiceName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetInformationFile( - __in HANDLE FileHandle, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID FileInformation, - __in ULONG Length, - __in FILE_INFORMATION_CLASS FileInformationClass - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwReadFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __out_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in_opt PLARGE_INTEGER ByteOffset, - __in_opt PULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwWriteFile( - __in HANDLE FileHandle, - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in_bcount(Length) PVOID Buffer, - __in ULONG Length, - __in_opt PLARGE_INTEGER ByteOffset, - __in_opt PULONG Key - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwClose( - __in HANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwCreateDirectoryObject( - __out PHANDLE DirectoryHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwMakeTemporaryObject( - __in HANDLE Handle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(APC_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwCreateSection ( - __out PHANDLE SectionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PLARGE_INTEGER MaximumSize, - __in ULONG SectionPageProtection, - __in ULONG AllocationAttributes, - __in_opt HANDLE FileHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenSection( - __out PHANDLE SectionHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwMapViewOfSection( - __in HANDLE SectionHandle, - __in HANDLE ProcessHandle, - __inout PVOID *BaseAddress, - __in ULONG_PTR ZeroBits, - __in SIZE_T CommitSize, - __inout_opt PLARGE_INTEGER SectionOffset, - __inout PSIZE_T ViewSize, - __in SECTION_INHERIT InheritDisposition, - __in ULONG AllocationType, - __in ULONG Win32Protect - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwUnmapViewOfSection( - __in HANDLE ProcessHandle, - __in_opt PVOID BaseAddress - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwCreateKey( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __reserved ULONG TitleIndex, - __in_opt PUNICODE_STRING Class, - __in ULONG CreateOptions, - __out_opt PULONG Disposition - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -ZwCreateKeyTransacted( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __reserved ULONG TitleIndex, - __in_opt PUNICODE_STRING Class, - __in ULONG CreateOptions, - __in HANDLE TransactionHandle, - __out_opt PULONG Disposition - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenKey( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenKeyEx( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in ULONG OpenOptions - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenKeyTransacted( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in HANDLE TransactionHandle - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenKeyTransactedEx( - __out PHANDLE KeyHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in ULONG OpenOptions, - __in HANDLE TransactionHandle - ); -#endif - - - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDeleteKey( - __in HANDLE KeyHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwDeleteValueKey( - __in HANDLE KeyHandle, - __in PUNICODE_STRING ValueName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(Length==0, __drv_valueIs(<0)) -__drv_when(Length>0, __drv_valueIs(<0;==0)) -NTSYSAPI -NTSTATUS -NTAPI -ZwEnumerateKey( - __in HANDLE KeyHandle, - __in ULONG Index, - __in KEY_INFORMATION_CLASS KeyInformationClass, - __out_bcount_opt(Length) PVOID KeyInformation, - __in ULONG Length, - __out PULONG ResultLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(Length==0, __drv_valueIs(<0)) -__drv_when(Length>0, __drv_valueIs(<0;==0)) -NTSYSAPI -NTSTATUS -NTAPI -ZwEnumerateValueKey( - __in HANDLE KeyHandle, - __in ULONG Index, - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - __out_bcount_opt(Length) PVOID KeyValueInformation, - __in ULONG Length, - __out PULONG ResultLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwFlushKey( - __in HANDLE KeyHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwNotifyChangeMultipleKeys( - __in HANDLE MasterKeyHandle, - __in_opt ULONG Count, - __in_ecount_opt(Count) OBJECT_ATTRIBUTES SubordinateObjects[], - __in_opt HANDLE Event, - __in_opt PIO_APC_ROUTINE ApcRoutine, - __in_opt PVOID ApcContext, - __out PIO_STATUS_BLOCK IoStatusBlock, - __in ULONG CompletionFilter, - __in BOOLEAN WatchTree, - __out_bcount_opt(BufferSize) PVOID Buffer, - __in ULONG BufferSize, - __in BOOLEAN Asynchronous - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryMultipleValueKey( - __in HANDLE KeyHandle, - __inout_ecount(EntryCount) PKEY_VALUE_ENTRY ValueEntries, - __in ULONG EntryCount, - __out_bcount(*BufferLength) PVOID ValueBuffer, - __inout PULONG BufferLength, - __out_opt PULONG RequiredBufferLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(Length==0, __drv_valueIs(<0)) -__drv_when(Length>0, __drv_valueIs(<0;==0)) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryKey( - __in HANDLE KeyHandle, - __in KEY_INFORMATION_CLASS KeyInformationClass, - __out_bcount_opt(Length) PVOID KeyInformation, - __in ULONG Length, - __out PULONG ResultLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_when(Length==0, __drv_valueIs(<0)) -__drv_when(Length>0, __drv_valueIs(<0;==0)) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryValueKey( - __in HANDLE KeyHandle, - __in PUNICODE_STRING ValueName, - __in KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass, - __out_bcount_opt(Length) PVOID KeyValueInformation, - __in ULONG Length, - __out PULONG ResultLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwRenameKey( - __in HANDLE KeyHandle, - __in PUNICODE_STRING NewName - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetInformationKey( - __in HANDLE KeyHandle, - __in KEY_SET_INFORMATION_CLASS KeySetInformationClass, - __in_bcount(KeySetInformationLength) PVOID KeySetInformation, - __in ULONG KeySetInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwSetValueKey( - __in HANDLE KeyHandle, - __in PUNICODE_STRING ValueName, - __in_opt ULONG TitleIndex, - __in ULONG Type, - __in_bcount_opt(DataSize) PVOID Data, - __in ULONG DataSize - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwOpenSymbolicLinkObject( - __out PHANDLE LinkHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQuerySymbolicLinkObject( - __in HANDLE LinkHandle, - __inout PUNICODE_STRING LinkTarget, - __out_opt PULONG ReturnedLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCreateTransactionManager ( - __out PHANDLE TmHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PUNICODE_STRING LogFileName, - __in_opt ULONG CreateOptions, - __in_opt ULONG CommitStrength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwOpenTransactionManager ( - __out PHANDLE TmHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt PUNICODE_STRING LogFileName, - __in_opt LPGUID TmIdentity, - __in_opt ULONG OpenOptions - ); -#endif - - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRollforwardTransactionManager ( - __in HANDLE TransactionManagerHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRecoverTransactionManager ( - __in HANDLE TransactionManagerHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwQueryInformationTransactionManager ( - __in HANDLE TransactionManagerHandle, - __in TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, - __out_bcount(TransactionManagerInformationLength) PVOID TransactionManagerInformation, - __in ULONG TransactionManagerInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwSetInformationTransactionManager ( - __in HANDLE TmHandle, - __in TRANSACTIONMANAGER_INFORMATION_CLASS TransactionManagerInformationClass, - __in PVOID TransactionManagerInformation, - __in ULONG TransactionManagerInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwEnumerateTransactionObject ( - __in_opt HANDLE RootObjectHandle, - __in KTMOBJECT_TYPE QueryType, - __inout_bcount(ObjectCursorLength) PKTMOBJECT_CURSOR ObjectCursor, - __in ULONG ObjectCursorLength, - __out PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCreateTransaction ( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt LPGUID Uow, - __in_opt HANDLE TmHandle, - __in_opt ULONG CreateOptions, - __in_opt ULONG IsolationLevel, - __in_opt ULONG IsolationFlags, - __in_opt PLARGE_INTEGER Timeout, - __in_opt PUNICODE_STRING Description - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwOpenTransaction ( - __out PHANDLE TransactionHandle, - __in ACCESS_MASK DesiredAccess, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in LPGUID Uow, - __in_opt HANDLE TmHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwQueryInformationTransaction ( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __out_bcount(TransactionInformationLength) PVOID TransactionInformation, - __in ULONG TransactionInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwSetInformationTransaction ( - __in HANDLE TransactionHandle, - __in TRANSACTION_INFORMATION_CLASS TransactionInformationClass, - __in PVOID TransactionInformation, - __in ULONG TransactionInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCommitTransaction ( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRollbackTransaction ( - __in HANDLE TransactionHandle, - __in BOOLEAN Wait - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCreateResourceManager ( - __out PHANDLE ResourceManagerHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE TmHandle, - __in_opt LPGUID ResourceManagerGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt ULONG CreateOptions, - __in_opt PUNICODE_STRING Description - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwOpenResourceManager ( - __out PHANDLE ResourceManagerHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE TmHandle, - __in LPGUID ResourceManagerGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRecoverResourceManager ( - __in HANDLE ResourceManagerHandle - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwGetNotificationResourceManager ( - __in HANDLE ResourceManagerHandle, - __out PTRANSACTION_NOTIFICATION TransactionNotification, - __in ULONG NotificationLength, - __in PLARGE_INTEGER Timeout, - __out_opt PULONG ReturnLength, - __in ULONG Asynchronous, - __in_opt ULONG_PTR AsynchronousContext - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwQueryInformationResourceManager ( - __in HANDLE ResourceManagerHandle, - __in RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, - __out_bcount(ResourceManagerInformationLength) PVOID ResourceManagerInformation, - __in ULONG ResourceManagerInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwSetInformationResourceManager ( - __in HANDLE ResourceManagerHandle, - __in RESOURCEMANAGER_INFORMATION_CLASS ResourceManagerInformationClass, - __in_bcount(ResourceManagerInformationLength) PVOID ResourceManagerInformation, - __in ULONG ResourceManagerInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCreateEnlistment ( - __out PHANDLE EnlistmentHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE ResourceManagerHandle, - __in HANDLE TransactionHandle, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes, - __in_opt ULONG CreateOptions, - __in NOTIFICATION_MASK NotificationMask, - __in_opt PVOID EnlistmentKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwOpenEnlistment ( - __out PHANDLE EnlistmentHandle, - __in ACCESS_MASK DesiredAccess, - __in HANDLE RmHandle, - __in LPGUID EnlistmentGuid, - __in_opt POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwQueryInformationEnlistment ( - __in HANDLE EnlistmentHandle, - __in ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, - __out_bcount(EnlistmentInformationLength) PVOID EnlistmentInformation, - __in ULONG EnlistmentInformationLength, - __out_opt PULONG ReturnLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwSetInformationEnlistment ( - __in HANDLE EnlistmentHandle, - __in ENLISTMENT_INFORMATION_CLASS EnlistmentInformationClass, - __in_bcount(EnlistmentInformationLength) PVOID EnlistmentInformation, - __in ULONG EnlistmentInformationLength - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRecoverEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PVOID EnlistmentKey - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwPrePrepareEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwPrepareEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCommitEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRollbackEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwPrePrepareComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwPrepareComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwCommitComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwReadOnlyEnlistment ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwRollbackComplete ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwSinglePhaseReject ( - __in HANDLE EnlistmentHandle, - __in_opt PLARGE_INTEGER TmVirtualClock - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2003) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSCALLAPI -NTSTATUS -NTAPI -ZwOpenEvent ( - __out PHANDLE EventHandle, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -NTSYSAPI -NTSTATUS -NTAPI -ZwQueryFullAttributesFile( - __in POBJECT_ATTRIBUTES ObjectAttributes, - __out PFILE_NETWORK_OPEN_INFORMATION FileInformation - ); -#endif - - - -// -// Enum for state of a EM rule -// -typedef -enum { - STATE_FALSE, - STATE_UNKNOWN, - STATE_TRUE -} EM_RULE_STATE, *PEM_RULE_STATE; - -// -// Define the entry data structure -// - -typedef struct _EM_ENTRY_DATA { - PVOID Data; - ULONG DataLength; -} EM_ENTRY_DATA, *PEM_ENTRY_DATA; - -// -// Define the Callback function pointer declaration -// - -__drv_functionClass(EM_CALLBACK_ROUTINE) -__drv_maxIRQL(APC_LEVEL) -__drv_sameIRQL -typedef -EM_RULE_STATE -(EM_CALLBACK_ROUTINE) ( - __in_ecount_opt(NumberofEntries) EM_ENTRY_DATA **InputEntries, - __in ULONG NumberofEntries, - __in_ecount_opt(NumberofStrings) LPCSTR *InputStrings, - __in ULONG NumberofStrings, - __in_ecount_opt(NumberofNumerics) PULONG InputNumerics, - __in ULONG NumberofNumerics, - __in_opt PVOID Context - ); - -typedef EM_CALLBACK_ROUTINE *PEM_CALLBACK_ROUTINE; -typedef PEM_CALLBACK_ROUTINE EM_CALLBACK_FUNC; - -// -// Define the lazy entry registration callback function -// - -__drv_functionClass(EM_LAZYENTRY_CALLBACK_ROUTINE) -__drv_maxIRQL(APC_LEVEL) -__drv_sameIRQL -typedef -VOID -(EM_LAZYENTRY_CALLBACK_ROUTINE) ( - __in LPCGUID EntryGuid, - __in_opt PVOID Context - ); - -typedef EM_LAZYENTRY_CALLBACK_ROUTINE *PEM_LAZYENTRY_CALLBACK_ROUTINE; -typedef PEM_LAZYENTRY_CALLBACK_ROUTINE EM_LAZYENTRY_CALLBACK; - - -// -// Define the Lazy Registration Structure -// - -typedef struct _EM_ENTRY_REGISTRATION { - LPCGUID EntryGuid; - - // - // If LazyEntryCallback is provided, the Entry will be considered lazy - // - - EM_LAZYENTRY_CALLBACK LazyEntryCallback; - PVOID LazyCallbackContext; -} EM_ENTRY_REGISTRATION, *PEM_ENTRY_REGISTRATION; - -// -// Define the Callback registration structure -// - -typedef struct _EM_CALLBACK_REGISTRATION { - LPCGUID CallbackGuid; - EM_CALLBACK_FUNC CallbackFunction; - PVOID Context; -} EM_CALLBACK_REGISTRATION, *PEM_CALLBACK_REGISTRATION; - - -// -// Define client rule notification function -// - -__drv_functionClass(EM_RULE_STATE_NOTIFY_ROUTINE) -__drv_maxIRQL(APC_LEVEL) -__drv_sameIRQL -typedef -VOID -(EM_RULE_STATE_NOTIFY_ROUTINE) ( - __in EM_RULE_STATE State, - __in LPCGUID RuleId, - __in_opt PVOID Context - ); - -typedef EM_RULE_STATE_NOTIFY_ROUTINE *PEM_RULE_STATE_NOTIFY_ROUTINE; -typedef PEM_RULE_STATE_NOTIFY_ROUTINE EM_RULE_STATE_NOTIFY; - - - - -// -// Define client rule notification registration structure -// - -typedef struct _EM_CLIENT_NOTIFICATION_REGISTRATION { - LPCGUID RuleId; - EM_RULE_STATE_NOTIFY RuleNotifyCallback; - PVOID Context; -} EM_CLIENT_NOTIFICATION_REGISTRATION, *PEM_CLIENT_NOTIFICATION_REGISTRATION; - -// -// Em Provider APIs -// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -EmProviderRegister( - __in PDRIVER_OBJECT DriverObject, - __in_ecount_opt(NumberOfEntry) PEM_ENTRY_REGISTRATION EntryRegistration, - __in ULONG NumberOfEntry, - __in_ecount_opt(NumberOfCallback) PEM_CALLBACK_REGISTRATION CallbackRegistration, - __in ULONG NumberOfCallback, - __out PVOID *ProviderHandle - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -EmProviderDeregister( - __in PVOID ProviderHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -EmProviderRegisterEntry( - __in PVOID ProviderHandle, - __in LPCGUID EntryId, - __in PEM_ENTRY_DATA EntryData, - __out PVOID *EntryHandle - ); - - -__drv_maxIRQL(APC_LEVEL) -VOID -EmProviderDeregisterEntry( - __in PVOID EntryHandle - ); - -// -// Em Client APIs -// - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -EmClientRuleEvaluate( - __in LPCGUID RuleId, - __in_ecount(NumberOfEntries) EM_ENTRY_DATA **InputEntries, - __in ULONG NumberOfEntries, - __out PEM_RULE_STATE State - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -EmClientRuleRegisterNotification( - __in PDRIVER_OBJECT DriverObject, - __in_ecount(NumberOfNotificatoinRegistration) PEM_CLIENT_NOTIFICATION_REGISTRATION RuleNotificationsRegistration, - __in ULONG NumberOfNotificatoinRegistration, - __out PVOID *NotificationHandle - ); - -__drv_maxIRQL(APC_LEVEL) -VOID -EmClientRuleDeregisterNotification( - __in PVOID NotificationHandle - ); - -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -EmClientQueryRuleState( - __in LPCGUID RuleId, - __out PEM_RULE_STATE State - ); - -#ifndef _CLFS_PUBLIC_H_ -#define _CLFS_PUBLIC_H_ -#define CLFSUSER_API - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// FILE_ATTRIBUTE_DEDICATED is defined as FILE_ATTRIBUTE_TEMPORARY. -// - -#define FILE_ATTRIBUTE_DEDICATED FILE_ATTRIBUTE_TEMPORARY - -// -// Container name and container size extended attribute entry names. -// - -#define EA_CONTAINER_NAME "ContainerName" -#define EA_CONTAINER_SIZE "ContainerSize" - -// -// Base log file name 3-letter extension. -// - -#define CLFS_BASELOG_EXTENSION L".blf" - -// -// Common log file system public flags and constants. -// - -#define CLFS_FLAG_NO_FLAGS 0x00000000 // No flags. -#define CLFS_FLAG_FORCE_APPEND 0x00000001 // Flag to force an append to log queue -#define CLFS_FLAG_FORCE_FLUSH 0x00000002 // Flag to force a log flush -#define CLFS_FLAG_USE_RESERVATION 0x00000004 // Flag to charge a data append to reservation -#define CLFS_FLAG_REENTRANT_FILE_SYSTEM 0x00000008 // Kernel mode create flag indicating a re-entrant file system. -#define CLFS_FLAG_NON_REENTRANT_FILTER 0x00000010 // Kernel mode create flag indicating non-reentrant filter. -#define CLFS_FLAG_REENTRANT_FILTER 0x00000020 // Kernel mode create flag indicating reentrant filter. -#define CLFS_FLAG_IGNORE_SHARE_ACCESS 0x00000040 // Kernel mode create flag indicating IO_IGNORE_SHARE_ACCESS_CHECK semantics. -#define CLFS_FLAG_READ_IN_PROGRESS 0x00000080 // Flag indicating read in progress and not completed. -#define CLFS_FLAG_MINIFILTER_LEVEL 0x00000100 // Kernel mode create flag indicating mini-filter target. -#define CLFS_FLAG_HIDDEN_SYSTEM_LOG 0x00000200 // Kernel mode create flag indicating the log and containers should be marked hidden & system. - - -// -// Flag indicating all CLFS I/O will be targeted to an intermediate level of the I/O stack -// - -#define CLFS_FLAG_FILTER_INTERMEDIATE_LEVEL CLFS_FLAG_NON_REENTRANT_FILTER - -// -// Flag indicating all CLFS I/O will be targeted to the top level of the I/O stack -// - -#define CLFS_FLAG_FILTER_TOP_LEVEL CLFS_FLAG_REENTRANT_FILTER - -// -// CLFS_CONTAINER_INDEX -// -// Index into the container table. -// - -typedef ULONG CLFS_CONTAINER_ID; -typedef CLFS_CONTAINER_ID *PCLFS_CONTAINER_ID; -typedef CLFS_CONTAINER_ID **PPCLFS_CONTAINER_ID; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __CLFS_PRIVATE_LSN__ - -#include - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLS_LSN -// - -typedef struct _CLS_LSN -{ - - ULONGLONG Internal; - -} CLS_LSN, *PCLS_LSN, **PPCLS_LSN; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* __CLFS_PRIVATE_LSN__ */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// Alias CLS prefixed types with CLFS prefixes. -// - -typedef CLS_LSN CLFS_LSN; -typedef CLFS_LSN *PCLFS_LSN, **PPCLFS_LSN; - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -extern __declspec(dllimport) const CLFS_LSN CLFS_LSN_INVALID; -extern __declspec(dllimport) const CLFS_LSN CLFS_LSN_NULL; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLS_RECORD_TYPE -// -// Definition of record types. -// - -#ifdef __cplusplus - -const UCHAR ClfsNullRecord = 0x00; // Null record type. -const UCHAR ClfsDataRecord = 0x01; // Client data record. -const UCHAR ClfsRestartRecord = 0x02; // Restart record. - - -// Valid client records are restart and data records. - -const UCHAR ClfsClientRecord = 0x03; - -#else - -#define ClfsNullRecord 0x00 // Null record type. -#define ClfsDataRecord 0x01 // Client data record. -#define ClfsRestartRecord 0x02 // Restart record. - - -// Valid client records are restart and data records. - -#define ClfsClientRecord (ClfsDataRecord|ClfsRestartRecord) - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Log container path prefix indicating the log container's location is -// actually a stream inside of the BLF. -// - -#ifdef _cplusplus - -const LPCWSTR CLFS_CONTAINER_STREAM_PREFIX = L"%BLF%:" - -#else - -#define CLFS_CONTAINER_STREAM_PREFIX L"%BLF%:" - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Log container path prefix indicating the log container's location is -// relative to the base log file (BLF) and not an absolute path. -// Paths which do not being with said prefix are absolute paths. -// - -#ifdef _cplusplus - -const LPCWSTR CLFS_CONTAINER_RELATIVE_PREFIX = L"%BLF%\\" - -#else - -#define CLFS_CONTAINER_RELATIVE_PREFIX L"%BLF%\\" - -#endif /* _cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias CLS prefix with CLFS prefixes. -// - -typedef UCHAR CLS_RECORD_TYPE, *PCLS_RECORD_TYPE, **PPCLS_RECORD_TYPE; -typedef CLS_RECORD_TYPE CLFS_RECORD_TYPE, *PCLFS_RECORD_TYPE, **PPCLFS_RECORD_TYPE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTEXT_MODE -// -// The context mode specifies the dirction and access methods used to scan the -// log file. -// - -typedef enum _CLS_CONTEXT_MODE -{ - ClsContextNone = 0x00, - ClsContextUndoNext, - ClsContextPrevious, - ClsContextForward - -} CLS_CONTEXT_MODE, *PCLS_CONTEXT_MODE, **PPCLS_CONTEXT_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef enum _CLFS_CONTEXT_MODE -{ - ClfsContextNone = 0x00, - ClfsContextUndoNext, - ClfsContextPrevious, - ClfsContextForward - -} CLFS_CONTEXT_MODE, *PCLFS_CONTEXT_MODE, **PPCLFS_CONTEXT_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFSD_NODE_ID -// -// Common log file system node identifier. Every CLFS file system -// structure has a node identity and type. The node type is a signature -// field while the size is used in for consistency checking. -// - -typedef struct _CLFS_NODE_ID -{ - ULONG cType; // CLFS node type. - ULONG cbNode; // CLFS node size. - -} CLFS_NODE_ID, *PCLFS_NODE_ID; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_WRITE_ENTRY -// -// Write entry specifying the contents of a user buffer and length that are -// marshalled in the space reservation and append interface of the CLS API. -// - -typedef struct _CLS_WRITE_ENTRY -{ - PVOID Buffer; - ULONG ByteLength; -} CLS_WRITE_ENTRY, *PCLS_WRITE_ENTRY, **PPCLS_WRITE_ENTRY; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_WRITE_ENTRY CLFS_WRITE_ENTRY; -typedef CLFS_WRITE_ENTRY *PCLFS_WRITE_ENTRY, **PPCLFS_WRITE_ENTRY; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_ID -// -// A log identifier is a GUID that describes uniquely a physical log file. -// - -typedef GUID CLFS_LOG_ID; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_INFORMATION -// -// Logical log file information structure describing either virtual or physical log -// file data, depending on the type of information queried. -// - -typedef struct _CLS_INFORMATION -{ - LONGLONG TotalAvailable; // Total log data space available. - LONGLONG CurrentAvailable; // Useable space in the log file. - LONGLONG TotalReservation; // Space reserved for UNDO's (aggregate for physical log) - ULONGLONG BaseFileSize; // Size of the base log file. - ULONGLONG ContainerSize; // Uniform size of log containers. - ULONG TotalContainers; // Total number of containers. - ULONG FreeContainers; // Number of containers not in active log. - ULONG TotalClients; // Total number of clients. - ULONG Attributes; // Log file attributes. - ULONG FlushThreshold; // Log file flush threshold. - ULONG SectorSize; // Underlying container sector size. - CLS_LSN MinArchiveTailLsn; // Marks the global archive tail. - CLS_LSN BaseLsn; // Start of the active log region. - CLS_LSN LastFlushedLsn; // Last flushed LSN in active log. - CLS_LSN LastLsn; // End of active log region. - CLS_LSN RestartLsn; // Location of restart record. - GUID Identity; // Unique identifier for the log. -} CLS_INFORMATION, *PCLS_INFORMATION, *PPCLS_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias CLS prefixes with CLS prefixes. -// - -typedef CLS_INFORMATION CLFS_INFORMATION; -typedef CLFS_INFORMATION *PCLFS_INFORMATION, *PPCLFS_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ -/* -// -// CLFS_CLIENT_INFORMATION -// -// The client information structure maintains client-based log metadata. -// - -typedef struct _CLS_CLIENT_INFORMATION -{ - CLS_INFORMATION ClfsInfo; // Contains base log file information. - ULONG ClientAttributes; // Virtual log file attributes. - LONGLONG ClientUndoCommitment; // Max. undo commitment for client. - CLS_LSN ClientArchiveTailLsn; // Marks the client archive tail. - CLS_LSN ClientBaseLsn; // Min. client LSN in active log region. - CLS_LSN ClientLastLsn; // Max. client LSN in active log region. - CLS_LSN ClientRestartLsn; // Location of restart record. - -} CLS_CLIENT_INFORMATION, *PCLS_CLIENT_INFORMATION, **PPCLS_CLIENT_INFORMATION; - -// -// Alias CLS prefixes with CLS prefixes. -// - -typedef CLS_CLIENT_INFORMATION CLFS_CLIENT_INFORMATION; -typedef CLFS_CLIENT_INFORMATION *PCLFS_CLIENT_INFORMATION, *PPCLFS_CLIENT_INFORMATION; -*/ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_NAME_INFORMATION -// -// The client information structure stores the name of a log. It is used -// to communicate ClfsLogNameInformation and ClfsLogPhysicalNameInformation. -// - -typedef struct _CLFS_LOG_NAME_INFORMATION -{ - - USHORT NameLengthInBytes; - WCHAR Name[1]; - -} CLFS_LOG_NAME_INFORMATION, *PCLFS_LOG_NAME_INFORMATION, **PPCLFS_LOG_NAME_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_STREAM_ID_INFORMATION -// -// The client information structure provides a permanent identifier unique -// to the log for the stream in question. -// - -typedef struct _CLFS_STREAM_ID_INFORMATION -{ - - UCHAR StreamIdentifier; - -} CLFS_STREAM_ID_INFORMATION, *PCLFS_STREAM_ID_INFORMATION, **PPCLFS_STREAM_ID_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) -// -// CLFS_PHYSICAL_LSN_INFORMATION -// -// An information structure that describes a virtual:physical LSN pairing -// for the stream identified in the structure. -// -#pragma pack(push,8) -typedef struct _CLFS_PHYSICAL_LSN_INFORMATION -{ - UCHAR StreamIdentifier; - CLFS_LSN VirtualLsn; - CLFS_LSN PhysicalLsn; - -} CLFS_PHYSICAL_LSN_INFORMATION, *PCLFS_PHYSICAL_LSN_INFORMATION; -#pragma pack(pop) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTAINER_STATE -// -// At any point in time a container could be inactive or unitialized, active, -// pending deletion from the list of free containers, pending archival, or -// pending deletion while waiting to be archived. -// - -typedef UINT32 CLS_CONTAINER_STATE, *PCLS_CONTAINER_STATE, *PPCLS_CONTAINER_STATE; -typedef CLS_CONTAINER_STATE CLFS_CONTAINER_STATE, *PCLFS_CONTAINER_STATE, *PPCLFS_CONTAINER_STATE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#ifdef __cplusplus - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -const CLFS_CONTAINER_STATE ClsContainerInitializing = 0x01; -const CLFS_CONTAINER_STATE ClsContainerInactive = 0x02; -const CLFS_CONTAINER_STATE ClsContainerActive = 0x04; -const CLFS_CONTAINER_STATE ClsContainerActivePendingDelete = 0x08; -const CLFS_CONTAINER_STATE ClsContainerPendingArchive = 0x10; -const CLFS_CONTAINER_STATE ClsContainerPendingArchiveAndDelete = 0x20; - -const CLFS_CONTAINER_STATE ClfsContainerInitializing = 0x01; -const CLFS_CONTAINER_STATE ClfsContainerInactive = 0x02; -const CLFS_CONTAINER_STATE ClfsContainerActive = 0x04; -const CLFS_CONTAINER_STATE ClfsContainerActivePendingDelete = 0x08; -const CLFS_CONTAINER_STATE ClfsContainerPendingArchive = 0x10; -const CLFS_CONTAINER_STATE ClfsContainerPendingArchiveAndDelete= 0x20; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#else - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -#define ClsContainerInitializing 0x01 -#define ClsContainerInactive 0x02 -#define ClsContainerActive 0x04 -#define ClsContainerActivePendingDelete 0x08 -#define ClsContainerPendingArchive 0x10 -#define ClsContainerPendingArchiveAndDelete 0x20 - -#define ClfsContainerInitializing 0x01 -#define ClfsContainerInactive 0x02 -#define ClfsContainerActive 0x04 -#define ClfsContainerActivePendingDelete 0x08 -#define ClfsContainerPendingArchive 0x10 -#define ClfsContainerPendingArchiveAndDelete 0x20 -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MAX_CONTAINER_INFO -// -// The maximum length, in bytes, of the FileName field in the CLFS -// container information structure. -// - -#ifdef __cplusplus - -const ULONG CLFS_MAX_CONTAINER_INFO = (256); - -#else - -#define CLFS_MAX_CONTAINER_INFO (256) - -#endif /* __cplusplus */ - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_CONTAINER_INFORMATION -// -// This structure defines a container descriptor. The descriptor specifies the -// container's creation and access times, size, file system name, file system -// attributes, state, minimum, and maximum LSNs. -// - -typedef struct _CLS_CONTAINER_INFORMATION -{ - ULONG FileAttributes; // File system attribute flag. - ULONGLONG CreationTime; // File creation time. - ULONGLONG LastAccessTime; // Last time container was read/written. - ULONGLONG LastWriteTime; // Last time container was written. - LONGLONG ContainerSize; // Size of container in bytes. - ULONG FileNameActualLength; // Length of the actual file name. - ULONG FileNameLength; // Length of file name in buffer - WCHAR FileName [CLFS_MAX_CONTAINER_INFO];// File system name for container. - CLFS_CONTAINER_STATE State; // Current state of the container. - CLFS_CONTAINER_ID PhysicalContainerId; // Physical container identifier. - CLFS_CONTAINER_ID LogicalContainerId; // Logical container identifier. - -} CLS_CONTAINER_INFORMATION, *PCLS_CONTAINER_INFORMATION, **PPCLS_CONTAINER_INFORMATION; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_CONTAINER_INFORMATION CLFS_CONTAINER_INFORMATION; -typedef CLFS_CONTAINER_INFORMATION *PCLFS_CONTAINER_INFORMATION, **PPCLFS_CONTAINER_INFORMATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_INFORMATION_CLASS -// -// The information class specifies the kind of information a caller -// wishes to query or set on a log file. -// - -typedef enum _CLS_LOG_INFORMATION_CLASS -{ - - ClfsLogBasicInformation = 0x00, // For virtual or physical logs, indicates the respective basic information. - ClfsLogBasicInformationPhysical, // Always indicates physical log basic information. - ClfsLogPhysicalNameInformation, // Always indicates physical name information. - ClfsLogStreamIdentifierInformation, // Virtual/physical log agnostic. -#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) - ClfsLogSystemMarkingInformation, // Count of system marking references. - ClfsLogPhysicalLsnInformation // Maps virtual LSNs to physical LSNs; only valid for physical logs. -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -} CLS_LOG_INFORMATION_CLASS, *PCLS_LOG_INFORMATION_CLASS, **PPCLS_LOG_INFORMATION_CLASS; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_LOG_INFORMATION_CLASS CLFS_LOG_INFORMATION_CLASS; -typedef CLFS_LOG_INFORMATION_CLASS *PCLFS_LOG_INFORMATION_CLASS, **PPCLFS_LOG_INFORMATION_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_IOSTATS_CLASS -// -// Enumerated type defining the class of I/O statistics. -// - -typedef enum _CLS_IOSTATS_CLASS -{ - ClsIoStatsDefault = 0x0000, - ClsIoStatsMax = 0xFFFF - -} CLS_IOSTATS_CLASS, *PCLS_IOSTATS_CLASS, **PPCLS_IOSTATS_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_IOSTATS_CLASS -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef enum _CLFS_IOSTATS_CLASS -{ - ClfsIoStatsDefault = 0x0000, - ClfsIoStatsMax = 0xFFFF - -} CLFS_IOSTATS_CLASS, *PCLFS_IOSTATS_CLASS, **PPCLFS_IOSTATS_CLASS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLS_IO_STATISTICS -// -// This structure defines I/O performance counters particular to a log file. It consists -// of a header followed by the I/O statistics counters. The header is being ignored for -// now. -// - -typedef struct _CLS_IO_STATISTICS_HEADER -{ - UCHAR ubMajorVersion; // Major version of the statistics buffer. - UCHAR ubMinorVersion; // Minor version of the statistics buffer. - CLFS_IOSTATS_CLASS eStatsClass; // I/O statistics class. - USHORT cbLength; // Length of the statistics buffer. - ULONG coffData; // Offset of statistics counters. - -} CLS_IO_STATISTICS_HEADER, *PCLS_IO_STATISTICS_HEADER, **PPCLS_IO_STATISTICS_HEADER; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_IO_STATISTICS_HEADER CLFS_IO_STATISTICS_HEADER; -typedef CLFS_IO_STATISTICS_HEADER *PCLFS_IO_STATISTICS_HEADER, **PPCLFS_IO_STATISTICS_HEADER; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -typedef struct _CLS_IO_STATISTICS -{ - CLS_IO_STATISTICS_HEADER hdrIoStats; // Statistics buffer header. - ULONGLONG cFlush; // Flush count. - ULONGLONG cbFlush; // Cumulative number of bytes flushed. - ULONGLONG cMetaFlush; // Metadata flush count. - ULONGLONG cbMetaFlush; // Cumulative number of metadata bytes flushed. - -} CLS_IO_STATISTICS, *PCLS_IO_STATISTICS, **PPCLS_IO_STATISTICS; - -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_IO_STATISTICS CLFS_IO_STATISTICS; -typedef CLFS_IO_STATISTICS *PCLFS_IO_STATISTICS, **PPCLFS_IO_STATISTICS; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_SCAN_MODE -// -// Container scan mode flags. -// - -#ifdef __cplusplus - -const UCHAR CLFS_SCAN_INIT = 0x01; -const UCHAR CLFS_SCAN_FORWARD = 0x02; -const UCHAR CLFS_SCAN_BACKWARD = 0x04; -const UCHAR CLFS_SCAN_CLOSE = 0x08; -const UCHAR CLFS_SCAN_INITIALIZED = 0x10; -const UCHAR CLFS_SCAN_BUFFERED = 0x20; - -#else - -#define CLFS_SCAN_INIT 0x01 -#define CLFS_SCAN_FORWARD 0x02 -#define CLFS_SCAN_BACKWARD 0x04 -#define CLFS_SCAN_CLOSE 0x08 -#define CLFS_SCAN_INITIALIZED 0x10 -#define CLFS_SCAN_BUFFERED 0x20 - -#endif - -typedef UCHAR CLFS_SCAN_MODE, *PCLFS_SCAN_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) - -// -// CLFS_SCAN_CONTEXT -// -// Container scan context for scanning all containers in a given physical log -// file. -// - -// -// The log file object wraps an NT file object and the size of the structure. -// The log file object may be modified in the near future and there should be no -// dependencies on the size of the structure itself. -// - -typedef FILE_OBJECT LOG_FILE_OBJECT, *PLOG_FILE_OBJECT, **PPLOG_FILE_OBJECT; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(push) -#pragma warning(disable:4324) // structure padded due to __declspec(align()) -#endif -#endif - -typedef struct _CLS_SCAN_CONTEXT -{ - CLFS_NODE_ID cidNode; - PLOG_FILE_OBJECT plfoLog; - __declspec(align(8)) ULONG cIndex; - __declspec(align(8)) ULONG cContainers; - __declspec(align(8)) ULONG cContainersReturned; - __declspec(align(8)) CLFS_SCAN_MODE eScanMode; - __declspec(align(8)) PCLS_CONTAINER_INFORMATION pinfoContainer; - -} CLS_SCAN_CONTEXT, *PCLS_SCAN_CONTEXT, **PPCLS_SCAN_CONTEXT; - -#if defined(_MSC_VER) -#if (_MSC_VER >= 1200) -#pragma warning(pop) -#endif -#endif - -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Alias all CLS prefixes with CLFS prefixes. -// - -typedef CLS_SCAN_CONTEXT CLFS_SCAN_CONTEXT; -typedef CLFS_SCAN_CONTEXT *PCLFS_SCAN_CONTEXT, **PPCLFS_SCAN_CONTEXT; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_ARCHIVE_DESCRIPTOR -// -// Log archive descriptors describe the set of discrete but logically -// contiguous disk extents comprising a snapshot of the active log when -// preparing for archival. Log archive descriptors specify enough information -// for log archive clients directly access the relevant contents of containers -// for archiving and restoring a snapshot of the log. -// - -typedef struct _CLS_ARCHIVE_DESCRIPTOR -{ - ULONGLONG coffLow; - ULONGLONG coffHigh; - CLS_CONTAINER_INFORMATION infoContainer; - -} CLS_ARCHIVE_DESCRIPTOR, *PCLS_ARCHIVE_DESCRIPTOR, **PPCLS_ARCHIVE_DESCRIPTOR; - -// -// Alias CLS prefixes with CLFS prefixes. -// - -typedef CLS_ARCHIVE_DESCRIPTOR CLFS_ARCHIVE_DESCRIPTOR; -typedef CLFS_ARCHIVE_DESCRIPTOR *PCLFS_ARCHIVE_DESCRIPTOR, **PPCLFS_ARCHIVE_DESCRIPTOR; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_ALLOCATION_ROUTINE -// -// Allocate a blocks for marshalled reads or writes -// - -typedef PVOID (* CLFS_BLOCK_ALLOCATION) (ULONG cbBufferLength, PVOID pvUserContext); - -// -// CLFS_DEALLOCATION_ROUTINE -// -// Deallocate buffers allocated by the CLFS_ALLOCATION_ROUTINE. -// - -typedef void (* CLFS_BLOCK_DEALLOCATION) (PVOID pvBuffer, PVOID pvUserContext); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_LOG_ARCHIVE_MODE -// -// Describes the archive support behavior for the log. -// - -typedef enum _CLFS_LOG_ARCHIVE_MODE -{ - - ClfsLogArchiveEnabled = 0x01, - ClfsLogArchiveDisabled = 0x02 - -} CLFS_LOG_ARCHIVE_MODE, *PCLFS_LOG_ARCHIVE_MODE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -//----------------------------------------------------------------------------- -// LSN OPERATORS -//----------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" -{ -#endif - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnEqual -// -// Method Description: -// -// Check for the equivalence of LSNs. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN values are equivalent and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnEqual -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnLess -// -// Method Description: -// -// Check if LSN1 is less than LSN2. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN1 is less than LSN2 and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnLess -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnGreater -// -// Method Description: -// -// Check if LSN1 is greater than LSN2. -// -// Arguments: -// -// plsn1 -- first LSN comparator -// plsn2 -- second LSN comparator -// -// -// Return Value: -// -// TRUE if LSN1 is greater than LSN2 and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnGreater -( - __in const CLFS_LSN* plsn1, - __in const CLFS_LSN* plsn2 -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnNull (Inline) -// -// Method Description: -// -// Check whether or not an LSN is CLFS_LSN_NULL. -// -// Arguments: -// -// plsn -- reference to LSN tested against the NULL value. -// -// -// Return Value: -// -// TRUE if and only if an LSN is equivalent to CLFS_LSN_NULL. -// LSNs with the value CLFS_LSN_INVALID will return FALSE. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnNull -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnContainer (Inline) -// -// Routine Description: -// -// Extract the container identifier from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the container identifier for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_CONTAINER_ID NTAPI -ClfsLsnContainer -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnCreate (Inline) -// -// Routine Description: -// -// Create an LSN given a log identifier, a container identifier, a block -// offset and a bucket identifier. Caller must test for invalid LSN after -// making this call. -// -// Arguments: -// -// cidContainer -- container identifier -// offBlock -- block offset -// cRecord -- ordinal number of the record in block -// -// Return Value: -// -// Returns a valid LSN if successful, otherwise it returns -// CLFS_LSN_INVALID -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_LSN NTAPI -ClfsLsnCreate -( - __in CLFS_CONTAINER_ID cidContainer, - __in ULONG offBlock, - __in ULONG cRecord -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnBlockOffset (Inline) -// -// Routine Description: -// -// Extract the block offset from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the block offset for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API ULONG NTAPI -ClfsLsnBlockOffset -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnRecordSequence (Inline) -// -// Routine Description: -// -// Extract the bucket identifier from the LSN. -// -// Arguments: -// -// plsn -- get block offset from this LSN -// -// Return Value: -// -// Returns the bucket identifier for the LSN. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API ULONG NTAPI -ClfsLsnRecordSequence -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnInvalid -// -// Method Description: -// -// Check whether or not an LSN is CLFS_LSN_INVALID. -// -// Arguments: -// -// plsn -- reference to LSN tested against CLFS_LSN_INVALID. -// -// -// Return Value: -// -// TRUE if and only if an LSN is equivalent to CLFS_LSN_INVALID. -// LSNs with the value CLFS_LSN_NULL will return FALSE. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API BOOLEAN NTAPI -ClfsLsnInvalid -( - __in const CLFS_LSN* plsn -); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -//----------------------------------------------------------------------------- -// ClfsLsnIncrement -// -// Method Description: -// -// Increment and LSN by 1 -// -// Arguments: -// -// plsn -- LSN to be incremented. -// -// -// Return Value: -// -// A valid LSN next in sequence to the input LSN, if successful. -// Otherwise, this function returns CLFS_LSN_INVALID. -// -//----------------------------------------------------------------------------- - -CLFSUSER_API CLFS_LSN NTAPI -ClfsLsnIncrement (__in PCLFS_LSN plsn); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#ifdef __cplusplus -} -#endif - -#ifdef __cplusplus - -#ifdef CLFS_OPERATORS - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// LSN arithmetic increment operator. -// - -inline CLFS_LSN -operator++ -( - __inout CLFS_LSN& refLsn -) -{ - // - // Prefix increment operator. - // - - refLsn = ClfsLsnIncrement (&refLsn); - return refLsn; -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// BOOLEAN LSN operators. -// - -inline BOOLEAN -operator< -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnLess ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator> -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnGreater ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator== -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (ClfsLsnEqual ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator!= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnEqual ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator<= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnGreater ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -inline BOOLEAN -operator>= -( - __in const CLFS_LSN& refLsn1, - __in const CLFS_LSN& refLsn2 -) -{ - return (!ClfsLsnLess ((PCLFS_LSN) &refLsn1, (PCLFS_LSN) &refLsn2)); -} -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#endif /* CLFS_OPERATORS */ - -#endif /* __cplusplus */ - -#endif /* _CLFS_PUBLIC_H_ */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// We start with the information that is shared -// between user and kernel mode. -// - -typedef enum _CLFS_MGMT_POLICY_TYPE { - - ClfsMgmtPolicyMaximumSize = 0x0, - ClfsMgmtPolicyMinimumSize, - ClfsMgmtPolicyNewContainerSize, - ClfsMgmtPolicyGrowthRate, - ClfsMgmtPolicyLogTail, - ClfsMgmtPolicyAutoShrink, - ClfsMgmtPolicyAutoGrow, - ClfsMgmtPolicyNewContainerPrefix, - ClfsMgmtPolicyNewContainerSuffix, - ClfsMgmtPolicyNewContainerExtension, - - ClfsMgmtPolicyInvalid - -} CLFS_MGMT_POLICY_TYPE, *PCLFS_MGMT_POLICY_TYPE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -#define CLFS_MGMT_NUM_POLICIES ((ULONG)ClfsMgmtPolicyInvalid) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Relative sizes used when explicitly setting log size. -// -#define CLFS_LOG_SIZE_MINIMUM ((ULONGLONG)(0)) -#define CLFS_LOG_SIZE_MAXIMUM ((ULONGLONG)(-1)) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// The version of a given policy structure. See CLFS_MGMT_POLICY. -// -#define CLFS_MGMT_POLICY_VERSION (0x01) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// Log policy flags. -// -// LOG_POLICY_OVERWRITE: If set when adding a log policy, the previous -// policy of given type will be replaced. -// -// LOG_POLICY_PERSIST: If set when adding a log policy, the policy -// will be persisted with the log metadata. -// -#define LOG_POLICY_OVERWRITE (0x01) -#define LOG_POLICY_PERSIST (0x02) -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MGMT_POLICY -// -// This structure describes one particular policy that -// may be present on a log file. These are installed -// via InstallLogPolicy (Win32) or ClfsMgmtInstallPolicy (kernel). -// -typedef struct _CLFS_MGMT_POLICY { - - // - // Version of the structure. Should be CLFS_MGMT_POLICY_VERSION. - // - ULONG Version; - - // - // The entire length of the structure. - // - ULONG LengthInBytes; - - // - // Flags which apply to all policies, such as LOG_POLICY_OVERWRITE - // and LOG_POLICY_PERSIST. - // - ULONG PolicyFlags; - - // - // Determines how PolicyParameters union is interpreted. - // - CLFS_MGMT_POLICY_TYPE PolicyType; - - // - // The way to interpret the PolicyParameters union is - // determined by the value of PolicyType -- if it is - // ClfsMgmtPolicyMaximumSize, for instance, then the - // MaximumSize structure is the relevant one. - // - - union { - - struct { - ULONG Containers; - } MaximumSize; - - struct { - ULONG Containers; - } MinimumSize; - - struct { - ULONG SizeInBytes; - } NewContainerSize; - - struct { - ULONG AbsoluteGrowthInContainers; - ULONG RelativeGrowthPercentage; - } GrowthRate; - - struct { - ULONG MinimumAvailablePercentage; - ULONG MinimumAvailableContainers; - } LogTail; - - struct { - ULONG Percentage; - } AutoShrink; - - struct { - ULONG Enabled; - } AutoGrow; - - struct { - USHORT PrefixLengthInBytes; - WCHAR PrefixString[1]; // dynamic in length depending on PrefixLength - } NewContainerPrefix; - - struct { - ULONGLONG NextContainerSuffix; - } NewContainerSuffix; - - struct { - USHORT ExtensionLengthInBytes; - WCHAR ExtensionString[1]; // dynamic in length depending on ExtensionLengthInBytes - } NewContainerExtension; - - } PolicyParameters; - - // - // Nothing will be added down here since the structure above - // can be of dynamic length. - // - -} CLFS_MGMT_POLICY, *PCLFS_MGMT_POLICY; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MGMT_NOTIFICATION_TYPE -// -// The types of notifications given to either the callback proxy -// or to readers of notifications. -// - -typedef enum _CLFS_MGMT_NOTIFICATION_TYPE -{ - - // - // Notification to advance base LSN. - // - - ClfsMgmtAdvanceTailNotification = 0, - - // - // Notification that a request to handle log full condition - // has completed. - // - - ClfsMgmtLogFullHandlerNotification, - - // - // Notification that a previously pinned log is now considered - // unpinned. - // - - ClfsMgmtLogUnpinnedNotification, - - // - // Notification that a non-zero number of bytes has been written - // to the log. - // - - ClfsMgmtLogWriteNotification - -} CLFS_MGMT_NOTIFICATION_TYPE, *PCLFS_MGMT_NOTIFICATION_TYPE; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MGMT_NOTIFICATION -// -// A notification and associated parameters. -// - -typedef struct _CLFS_MGMT_NOTIFICATION -{ - - // - // Nature of the notification. - // - - CLFS_MGMT_NOTIFICATION_TYPE Notification; - - // - // Target LSN for base LSN advancement if the - // notification type is ClfsMgmtAdvanceTailNotification. - // - - CLFS_LSN Lsn; - - // - // TRUE if the log is pinned, FALSE otherwise. - // Especially meaningful when receiving an error - // status for ClfsMgmtLogFullHandlerNotification. - // - - USHORT LogIsPinned; - -} CLFS_MGMT_NOTIFICATION, *PCLFS_MGMT_NOTIFICATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -// -// Kernel interface described below. -// - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// The advance tail callback is required when log clients -// register for management. It is invoked whenever the -// management library decides that this client needs to -// advance the tail of its log. Only minimal processing is -// allowed. -// -typedef -NTSTATUS -(*PCLFS_CLIENT_ADVANCE_TAIL_CALLBACK) ( - __in PLOG_FILE_OBJECT LogFile, - __in PCLFS_LSN TargetLsn, - __in PVOID ClientData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// The log file full handler complete callback is invoked upon -// completion of a log growth request (that is, via a call -// to ClfsMgmtHandleLogFileFull). -// -typedef -VOID -(*PCLFS_CLIENT_LFF_HANDLER_COMPLETE_CALLBACK) ( - __in PLOG_FILE_OBJECT LogFile, - __in NTSTATUS OperationStatus, - __in BOOLEAN LogIsPinned, - __in PVOID ClientData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// The log pinned callback is invoked when log space is freed up -// after a log file full handler completion callback indicates an -// NT_ERROR status code and LogIsPinned = TRUE. -// - -typedef -VOID -(*PCLFS_CLIENT_LOG_UNPINNED_CALLBACK) ( - __in PLOG_FILE_OBJECT LogFile, - __in PVOID ClientData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// The log size complete callback is invoked whenever -// ClfsMgmtSetLogFileSize operation which returned -// STATUS_PENDING is completed. -// - -typedef -VOID -(*PCLFS_SET_LOG_SIZE_COMPLETE_CALLBACK) ( - __in PLOG_FILE_OBJECT LogFile, - __in NTSTATUS OperationStatus, - __in PVOID ClientData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MGMT_CLIENT_REGISTRATION -// -// This structure is given to the CLFS management infrastructure -// by clients who wish to be managed (via ClfsMgmtRegisterManagedClient). -// The CLFS_MGMT_CLIENT_REGISTRATION_VERSION value must be stored -// in the 'Version' field of the structure. -// - -#define CLFS_MGMT_CLIENT_REGISTRATION_VERSION (0x1) - -typedef struct _CLFS_MGMT_CLIENT_REGISTRATION { - - // - // Initialize Version to CLFS_MGMT_CLIENT_REGISTRATION_VERSION. - // - - ULONG Version; - - PCLFS_CLIENT_ADVANCE_TAIL_CALLBACK AdvanceTailCallback; - PVOID AdvanceTailCallbackData; - - PCLFS_CLIENT_LFF_HANDLER_COMPLETE_CALLBACK LogGrowthCompleteCallback; - PVOID LogGrowthCompleteCallbackData; - - PCLFS_CLIENT_LOG_UNPINNED_CALLBACK LogUnpinnedCallback; - PVOID LogUnpinnedCallbackData; - -} CLFS_MGMT_CLIENT_REGISTRATION, *PCLFS_MGMT_CLIENT_REGISTRATION; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -// -// CLFS_MGMT_CLIENT -// -// This is the cookie that clients are given when registering and -// must give back to the management infrastructure whenever -// performing an operation. -// -typedef PVOID CLFS_MGMT_CLIENT, *PCLFS_MGMT_CLIENT; -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtRegisterManagedClient( - __in PLOG_FILE_OBJECT LogFile, - __in PCLFS_MGMT_CLIENT_REGISTRATION RegistrationData, - __out PCLFS_MGMT_CLIENT ClientCookie - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtDeregisterManagedClient( - __in CLFS_MGMT_CLIENT ClientCookie - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtTailAdvanceFailure( - __in CLFS_MGMT_CLIENT Client, - __in NTSTATUS Reason - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtHandleLogFileFull( - __in CLFS_MGMT_CLIENT Client - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtInstallPolicy( - __in PLOG_FILE_OBJECT LogFile, - __in_bcount(PolicyLength) PCLFS_MGMT_POLICY Policy, - __in ULONG PolicyLength - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtQueryPolicy( - __in PLOG_FILE_OBJECT LogFile, - __in CLFS_MGMT_POLICY_TYPE PolicyType, - __out_bcount(*PolicyLength) PCLFS_MGMT_POLICY Policy, - __out PULONG PolicyLength - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtRemovePolicy( - __in PLOG_FILE_OBJECT LogFile, - __in CLFS_MGMT_POLICY_TYPE PolicyType - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) || (_WIN32_WINNT >= _WIN32_WINNT_WS03) -NTSTATUS -ClfsMgmtSetLogFileSize( - __in PLOG_FILE_OBJECT LogFile, - __in PULONGLONG NewSizeInContainers, - __out_opt PULONGLONG ResultingSizeInContainers, - __in_opt PCLFS_SET_LOG_SIZE_COMPLETE_CALLBACK CompletionRoutine, - __in_opt PVOID CompletionRoutineData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#if (NTDDI_VERSION >= NTDDI_VISTA) || (_WIN32_WINNT >= _WIN32_WINNT_LONGHORN) -NTSTATUS -ClfsMgmtSetLogFileSizeAsClient( - __in PLOG_FILE_OBJECT LogFile, - __in_opt PCLFS_MGMT_CLIENT ClientCookie, - __in PULONGLONG NewSizeInContainers, - __out_opt PULONGLONG ResultingSizeInContainers, - __in_opt PCLFS_SET_LOG_SIZE_COMPLETE_CALLBACK CompletionRoutine, - __in_opt PVOID CompletionRoutineData - ); -#endif /* NTDDI_VERSION || _WIN32_WINNT */ - - -#ifdef __cplusplus -} // extern "C" -#endif - -#ifndef __CLFSPROC_H__ -#define __CLFSPROC_H__ - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsInitialize -// -// Utility to initialize CLFS global resources, lookaside lists, and memory. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsInitialize (void); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsFinalize -// -// Utility to cleanup CLFS global resources, lookaside lists, and memory. -//------------------------------------------------------------------------------ - -void ClfsFinalize (void); -#endif /* NTDDI_VERSION */ - - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsCreateLogFile -// -// Entry point to create a physical log file consisting of uniformly sized -// containers lying in a given directory path. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsCreateLogFile ( - __out PPLOG_FILE_OBJECT pplfoLog, - __in PUNICODE_STRING puszLogFileName, - __in ACCESS_MASK fDesiredAccess, - __in ULONG dwShareMode, - __in_opt PSECURITY_DESCRIPTOR psdLogFile, - __in ULONG fCreateDisposition, - __in ULONG fCreateOptions, - __in ULONG fFlagsAndAttributes, - __in ULONG fLogOptionFlag, - __in_bcount_opt(cbContext) PVOID pvContext, - __in ULONG cbContext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsDeleteLogByPointer -// -// Entry point to delete a physical log file and its underlying container -// storage referencing a log file object. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsDeleteLogByPointer (__in PLOG_FILE_OBJECT plfoLog); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsDeleteLogFile -// -// Entry point to delete a physical log file and its underlying container -// storage by name. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsDeleteLogFile ( - __in PUNICODE_STRING puszLogFileName, - __in_opt PVOID pvReserved, - __in ULONG fLogOptionFlag, - __in_bcount_opt(cbContext) PVOID pvContext, - __in ULONG cbContext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsAddLogContainer -// -// Adds a log container to a given physical file identified by the log -// file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsAddLogContainer ( - __in PLOG_FILE_OBJECT plfoLog, - __in PULONGLONG pcbContainer, - __in PUNICODE_STRING puszContainerPath - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsAddLogContainerSet -// -// Adds a set of log containers to a given physical file identified by the log -// file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsAddLogContainerSet ( - __in PLOG_FILE_OBJECT plfoLog, - __in USHORT cContainers, - __in_opt PULONGLONG pcbContainer, - __in_ecount(cContainers) PUNICODE_STRING rguszContainerPath - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsRemoveLogContainer -// -// Removes a log container from a physical log file identified by -// the log file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsRemoveLogContainer ( - __in PLOG_FILE_OBJECT plfoLog, - __in PUNICODE_STRING puszContainerPath, - __in BOOLEAN fForce - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsRemoveLogContainerSet -// -// Removes a set of log containers from a physical log file identified by -// the log file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsRemoveLogContainerSet ( - __in PLOG_FILE_OBJECT plfoLog, - __in USHORT cContainers, - __in_ecount(cContainers) PUNICODE_STRING rgwszContainerPath, - __in BOOLEAN fForce - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsSetArchiveTail -// -// Sets the archive tail for either a client or physical log file -// depending on the type of the log handle. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsSetArchiveTail ( - __in PLOG_FILE_OBJECT plfoLog, - __in PCLFS_LSN plsnArchiveTail - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsSetEndOfLog -// -// Sets the end of log for either a client or physical log file -// depending on the type of the log handle. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsSetEndOfLog ( - __in PLOG_FILE_OBJECT plfoLog, - __in PCLFS_LSN plsnEnd - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsCreateScanContext -// -// Create a scan context to enumerate scan descriptors for storage containers -// that back the physical log file object. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsCreateScanContext ( - __in PLOG_FILE_OBJECT plfoLog, - __in ULONG cFromContainer, - __in ULONG cContainers, - __in CLFS_SCAN_MODE eScanMode, - __inout PCLFS_SCAN_CONTEXT pcxScan - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsScanLogContainers -// -// Scan descriptors for storage containers backing the physical -// log file stream. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsScanLogContainers ( - __inout PCLFS_SCAN_CONTEXT pcxScan, - __in CLFS_SCAN_MODE eScanMode - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsGetContainerName -// -// ClfsGetContainerName gets the full path name of a container given its logical -// container identifier. -// -//------------------------------------------------------------------------------ - -NTSTATUS ClfsGetContainerName ( - __in PLOG_FILE_OBJECT plfoLog, - __in CLFS_CONTAINER_ID cidLogicalContainer, - __out PUNICODE_STRING puszContainerName, - __out_opt PULONG pcActualLenContainerName - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsGetLogFileInformation -// -// Get log file information for a physical log and client stream -// specific to the log file object pointer. -// -// Deprecated. Use ClfsQueryLogFileInformation instead (it is equivalent -// to this call if ClfsLogBasicInformation is used as information class). -// -//------------------------------------------------------------------------------ - -NTSTATUS ClfsGetLogFileInformation ( - __in PLOG_FILE_OBJECT plfoLog, - __out_bcount_part(*pcbInfoBuffer, *pcbInfoBuffer) PCLFS_INFORMATION pinfoBuffer, - __inout PULONG pcbInfoBuffer - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_VISTA) -//------------------------------------------------------------------------------ -// ClfsQueryLogFileInformation -// -// Get log file information for a physical log and client stream -// specific to the log file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsQueryLogFileInformation ( - __in PLOG_FILE_OBJECT plfoLog, - __in CLFS_LOG_INFORMATION_CLASS eInformationClass, - __in_bcount_opt(cbinfoInputBuffer) PVOID pinfoInputBuffer, - __in_opt ULONG cbinfoInputBuffer, - __out_bcount(*pcbInfoBuffer) PVOID pinfoBuffer, - __inout PULONG pcbInfoBuffer - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsSetLogFileInformation -// -// Sets log file information for a physical log and client stream -// specific to the log file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsSetLogFileInformation ( - __in PLOG_FILE_OBJECT plfoLog, - __in CLFS_LOG_INFORMATION_CLASS eInformationClass, - __in_bcount(cbBuffer) PVOID pinfoBuffer, - __in ULONG cbBuffer - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReadRestartArea -// -// Read the last restart area successfully written to a physical or -// client log stream given a marshalling context. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReadRestartArea ( - __inout PVOID pvMarshalContext, - __deref_out_bcount(*pcbRestartBuffer) PVOID *ppvRestartBuffer, - __out PULONG pcbRestartBuffer, - __out PCLFS_LSN plsn, - __deref_out PVOID *ppvReadContext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReadPreviousRestartArea -// -// Read the previous restart area successfully written to a physical or -// client log stream given the read context created by the a call to -// ClfsReadRestartArea. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReadPreviousRestartArea ( - __in PVOID pvReadContext, - __deref_out_bcount(*pcbRestartBuffer) PVOID *ppvRestartBuffer, - __out PULONG pcbRestartBuffer, - __out PCLFS_LSN plsnRestart - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsWriteRestartArea -// -// Write a new restart area to a physical or client log stream given a -// a marshalling context. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsWriteRestartArea ( - __inout PVOID pvMarshalContext, - __in_bcount(cbRestartBuffer) PVOID pvRestartBuffer, - __in ULONG cbRestartBuffer, - __in_opt PCLFS_LSN plsnBase, - __in ULONG fFlags, - __out_opt PULONG pcbWritten, - __out_opt PCLFS_LSN plsnNext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsAdvanceLogBase -// -// Set a new log base LSN without writing a restart record. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsAdvanceLogBase ( - __inout PVOID pvMarshalContext, - __in PCLFS_LSN plsnBase, - __in ULONG fFlags - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsCloseAndResetLogFile -// -// Orderly shutdown of a physical or client log file stream given the log file -// object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsCloseAndResetLogFile (__in PLOG_FILE_OBJECT plfoLog); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsCloseLogFileObject -// -// Close a log file object without the orderly shutdown of the log. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsCloseLogFileObject (__in PLOG_FILE_OBJECT plfoLog); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsCreateMarshallingArea -// -// Initalize a marshalling area for a physical or client log -// file stream given log file object pointer. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsCreateMarshallingArea ( - __in PLOG_FILE_OBJECT plfoLog, - __in POOL_TYPE ePoolType, - __in_opt PALLOCATE_FUNCTION pfnAllocBuffer, - __in_opt PFREE_FUNCTION pfnFreeBuffer, - __in ULONG cbMarshallingBuffer, - __in ULONG cMaxWriteBuffers, - __in ULONG cMaxReadBuffers, - __deref_out PVOID *ppvMarshalContext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsDeleteMarshallingArea -// -// Delete a marshalling area for a physical or client log -// file stream. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsDeleteMarshallingArea (__in PVOID pvMarshalContext); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReserveAndAppendLog -// -// Reserve space and append log buffers to a physical or client -// log stream. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReserveAndAppendLog ( - __in PVOID pvMarshalContext, - __in_ecount_opt(cWriteEntries) PCLFS_WRITE_ENTRY rgWriteEntries, - __in ULONG cWriteEntries, - __in_opt PCLFS_LSN plsnUndoNext, - __in_opt PCLFS_LSN plsnPrevious, - __in ULONG cReserveRecords, - __inout_ecount_opt(cReserveRecords) PLONGLONG rgcbReservation, - __in ULONG fFlags, - __out_opt PCLFS_LSN plsn - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReserveAndAppendLogAligned -// -// Reserve space and append log buffers to a physical or client -// log stream, aligning each of the write entries according to -// the alignment specified. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReserveAndAppendLogAligned ( - __in PVOID pvMarshalContext, - __in_ecount_opt(cWriteEntries) PCLFS_WRITE_ENTRY rgWriteEntries, - __in ULONG cWriteEntries, - __in ULONG cbEntryAlignment, - __in_opt PCLFS_LSN plsnUndoNext, - __in_opt PCLFS_LSN plsnPrevious, - __in ULONG cReserveRecords, - __inout_ecount_opt(cReserveRecords) PLONGLONG rgcbReservation, - __in ULONG fFlags, - __out_opt PCLFS_LSN plsn - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsAlignReservedLog -// -// Given a valid marshalling context, allocate an aggregate number of reserved -// records and bytes. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsAlignReservedLog ( - __in PVOID pvMarshalContext, - __in ULONG cRecords, - __in_ecount(cRecords) LONGLONG rgcbReservation [], - __out PLONGLONG pcbAlignReservation - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsAllocReservedLog -// -// Given a valid marshalling context, allocate an aggregate number of reserved -// records and bytes. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsAllocReservedLog ( - __in PVOID pvMarshalContext, - __in ULONG cRecords, - __in_ecount(cRecords) PLONGLONG pcbAdjustment - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsFreeReservedLog -// -// Set the reserved log space to a new size or specify a delta -// for the reserved space given log file. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsFreeReservedLog ( - __in PVOID pvMarshalContext, - __in ULONG cRecords, - __in_ecount(cRecords) PLONGLONG pcbAdjustment - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsFlushBuffers -// -// Append all buffers in the marshalling area up to the flush queue and flush -// all buffers up to the disk. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsFlushBuffers (__in PVOID pvMarshalContext); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsFlushToLsn -// -// Flush all buffers in the marshalling area up to a target LSN to the flush -// queue and flush all buffers up to the target LSN to the disk. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsFlushToLsn ( - __in PVOID pvMarshalContext, - __in PCLFS_LSN plsnFlush, - __out_opt PCLFS_LSN plsnLastFlushed - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReadLogRecord -// -// Read a log record from a physical or client log stream given -// a starting LSN. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReadLogRecord ( - __in PVOID pvMarshalContext, - __inout PCLFS_LSN plsnFirst, - __in CLFS_CONTEXT_MODE peContextMode, - __deref_out_bcount(*pcbReadBuffer) PVOID *ppvReadBuffer, - __out PULONG pcbReadBuffer, - __out PCLFS_RECORD_TYPE peRecordType, - __out PCLFS_LSN plsnUndoNext, - __out PCLFS_LSN plsnPrevious, - __deref_out PVOID* ppvReadContext - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsReadNextLogRecord -// -// Read the next log record from a given marshalling context. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsReadNextLogRecord ( - __inout PVOID pvReadContext, - __deref_out_bcount(*pcbBuffer) PVOID *ppvBuffer, - __out PULONG pcbBuffer, - __inout PCLFS_RECORD_TYPE peRecordType, - __in_opt PCLFS_LSN plsnUser, - __out PCLFS_LSN plsnUndoNext, - __out PCLFS_LSN plsnPrevious, - __out PCLFS_LSN plsnRecord - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsTerminateReadLog -// -// Terminate the read context. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsTerminateReadLog (__in PVOID pvCursorContext); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsGetLastLsn -// -// Get the last used LSN. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsGetLastLsn ( - __in PLOG_FILE_OBJECT plfoLog, - __out PCLFS_LSN plsnLast - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//------------------------------------------------------------------------------ -// ClfsGetIoStatistics -// -// Get I/O statistics on the CLFS log file. -//------------------------------------------------------------------------------ - -NTSTATUS ClfsGetIoStatistics ( - __in PLOG_FILE_OBJECT plfoLog, - __inout_bcount(cbStatsBuffer) PVOID pvStatsBuffer, - __in ULONG cbStatsBuffer, - __in CLFS_IOSTATS_CLASS eStatsClass, - __out_opt PULONG pcbStatsWritten - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//----------------------------------------------------------------------------- -// ClfsLaterLsn -// -// Method Description: -// -// Increment an LSN by 1 -// -// Arguments: -// -// plsn -- LSN to be incremented. -// -// -// Return Value: -// -// A valid LSN next in sequence to the input LSN, if successful. -// Otherwise, this function returns CLFS_LSN_INVALID. -// -//----------------------------------------------------------------------------- - -CLFS_LSN -ClfsLaterLsn (__in PCLFS_LSN plsn); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//----------------------------------------------------------------------------- -// ClfsEarlierLsn -// -// Method Description: -// -// Decrement an LSN by 1 -// -// Arguments: -// -// plsn -- LSN to be decremented. -// -// -// Return Value: -// -// A valid LSN next in sequence to the input LSN, if successful. -// Otherwise, this function returns CLFS_LSN_INVALID. -// -//----------------------------------------------------------------------------- - -CLFS_LSN -ClfsEarlierLsn (__in PCLFS_LSN plsn); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_WS03SP1) -//---------------------------------------------------------------------------- -// ClfsLsnDifference -// -// Method Description: -// -// Find the approximate number of bytes between two LSNs. -// -// Arguments: -// -// plsnStart -- LSN start of the log file range -// plsnFinish -- LSN finish of the log file range -// cbContainer -- size of a container -// cbMaxBlock -- maximum size of an I/O block -// pcbDifference -- approximate number of bytes between two LSNs. -// -// -// -// Return Value: -// -// STATUS_SUCCESS if difference is succeeds and an error status -// otherwise. -// -//----------------------------------------------------------------------------- - -NTSTATUS -ClfsLsnDifference ( - __in PCLFS_LSN plsnStart, - __in PCLFS_LSN plsnFinish, - __in ULONG cbContainer, - __in ULONG cbMaxBlock, - __out PLONGLONG pcbDifference - ); -#endif /* NTDDI_VERSION */ - -#if (NTDDI_VERSION >= NTDDI_VISTA) -//---------------------------------------------------------------------------- -// ClfsValidTopLevelContext -// -// Method Description: -// -// Check that the current top level context is a common log (CLFS) -// context. -// -// Arguments: -// -// pirp -- reference to top of top-level context stack -// -// Return Value: -// -// TRUE if this is a valid CLFS top-level context and FALSE otherwise. -// -//----------------------------------------------------------------------------- - -BOOLEAN -ClfsValidTopLevelContext (__in PIRP pirpTopLevelContext); -#endif /* NTDDI_VERSION */ - - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* __CLFSPROC_H__ */ - -typedef struct _KTRANSACTION KTRANSACTION, *PKTRANSACTION, *RESTRICTED_POINTER PRKTRANSACTION; -typedef struct _KENLISTMENT KENLISTMENT, *PKENLISTMENT, *RESTRICTED_POINTER PRKENLISTMENT; -typedef struct _KRESOURCEMANAGER KRESOURCEMANAGER, *PKRESOURCEMANAGER, *RESTRICTED_POINTER PRKRESOURCEMANAGER; -typedef struct _KTM KTM, *PKTM, *RESTRICTED_POINTER PRKTM; - -typedef GUID UOW, *PUOW; -typedef GUID *PGUID; - -// -// Define ResourceManager Notification routine type. -// - -typedef -NTSTATUS -(NTAPI *PTM_RM_NOTIFICATION) ( - __in PKENLISTMENT EnlistmentObject, - __in PVOID RMContext, - __in PVOID TransactionContext, - __in ULONG TransactionNotification, - __inout PLARGE_INTEGER TmVirtualClock, - __in ULONG ArgumentLength, - __in PVOID Argument - ); - -// -// CRM Protocol object -// - -typedef GUID KCRM_PROTOCOL_ID, *PKCRM_PROTOCOL_ID; - -typedef -NTSTATUS -(NTAPI *PTM_PROPAGATE_ROUTINE) ( - __in PVOID PropagationCookie, - __in PVOID CallbackData, - __in NTSTATUS PropagationStatus, - __in GUID TransactionGuid - ); - -// -// Tm-level Transaction APIs -// - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmInitializeTransactionManager ( - __in PRKTM TransactionManager, - __in PCUNICODE_STRING LogFileName, - __in PGUID TmId, - __in_opt ULONG CreateOptions - ); - - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRenameTransactionManager ( - __in PUNICODE_STRING LogFileName, - __in LPGUID ExistingTransactionManagerGuid - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRecoverTransactionManager ( - __in PKTM Tm, - __in PLARGE_INTEGER TargetVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmCommitTransaction ( - __in PKTRANSACTION Transaction, - __in BOOLEAN Wait - ); - - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRollbackTransaction ( - __in PKTRANSACTION Transaction, - __in BOOLEAN Wait - ); - - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmCreateEnlistment ( - __out PHANDLE EnlistmentHandle, - __in KPROCESSOR_MODE PreviousMode, - __in ACCESS_MASK DesiredAccess, - __in POBJECT_ATTRIBUTES ObjectAttributes, - __in PRKRESOURCEMANAGER ResourceManager, - __in PKTRANSACTION Transaction, - __in_opt ULONG CreateOptions, - __in NOTIFICATION_MASK NotificationMask, - __in_opt PVOID EnlistmentKey - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRecoverEnlistment ( - __in PKENLISTMENT Enlistment, - __in PVOID EnlistmentKey - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPrePrepareEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPrepareEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmCommitEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRollbackEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPrePrepareComplete ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPrepareComplete ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmReadOnlyEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmCommitComplete ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRollbackComplete ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmReferenceEnlistmentKey ( - __in PKENLISTMENT Enlistment, - __out PVOID *Key - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmDereferenceEnlistmentKey ( - __in PKENLISTMENT Enlistment, - __out_opt PBOOLEAN LastReference - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmSinglePhaseReject ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRequestOutcomeEnlistment ( - __in PKENLISTMENT Enlistment, - __in PLARGE_INTEGER TmVirtualClock - ); - - -// -// ResourceManager APIs -// - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmEnableCallbacks ( - __in PKRESOURCEMANAGER ResourceManager, - __in PTM_RM_NOTIFICATION CallbackRoutine, - __in_opt PVOID RMKey - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRecoverResourceManager ( - __in PKRESOURCEMANAGER ResourceManager - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmRegisterProtocolAddressInformation( - __in PKRESOURCEMANAGER ResourceManager, - __in PKCRM_PROTOCOL_ID ProtocolId, - __in ULONG ProtocolInformationSize, - __in PVOID ProtocolInformation - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPropagationComplete( - __in PKRESOURCEMANAGER ResourceManager, - __in ULONG RequestCookie, - __in ULONG BufferLength, - __in PVOID Buffer - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -NTSTATUS -NTAPI -TmPropagationFailed( - __in PKRESOURCEMANAGER ResourceManager, - __in ULONG RequestCookie, - __in NTSTATUS Status - ); - -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -VOID -NTAPI -TmGetTransactionId( - __in PKTRANSACTION Transaction, - __out PUOW TransactionId - ); - -__checkReturn -__drv_maxIRQL (APC_LEVEL) -NTKERNELAPI -BOOLEAN -NTAPI -TmIsTransactionActive ( - __in PKTRANSACTION Transaction - ); - - -#define PCW_VERSION_1 0x0100 -#define PCW_CURRENT_VERSION PCW_VERSION_1 - -typedef struct _PCW_INSTANCE *PPCW_INSTANCE; -typedef struct _PCW_REGISTRATION *PPCW_REGISTRATION; -typedef struct _PCW_BUFFER *PPCW_BUFFER; - -typedef struct _PCW_COUNTER_DESCRIPTOR { - USHORT Id; - USHORT StructIndex; - USHORT Offset; - USHORT Size; -} PCW_COUNTER_DESCRIPTOR, *PPCW_COUNTER_DESCRIPTOR; - -typedef struct _PCW_DATA { - __in_bcount(Size) const VOID *Data; - __in ULONG Size; -} PCW_DATA, *PPCW_DATA; - -typedef struct _PCW_COUNTER_INFORMATION { - ULONG64 CounterMask; - PCUNICODE_STRING InstanceMask; -} PCW_COUNTER_INFORMATION, *PPCW_COUNTER_INFORMATION; - -typedef struct _PCW_MASK_INFORMATION { - ULONG64 CounterMask; - PCUNICODE_STRING InstanceMask; - ULONG InstanceId; - BOOLEAN CollectMultiple; - PPCW_BUFFER Buffer; - PKEVENT CancelEvent; -} PCW_MASK_INFORMATION, *PPCW_MASK_INFORMATION; - -typedef union _PCW_CALLBACK_INFORMATION { - PCW_COUNTER_INFORMATION AddCounter; - PCW_COUNTER_INFORMATION RemoveCounter; - PCW_MASK_INFORMATION EnumerateInstances; - PCW_MASK_INFORMATION CollectData; -} PCW_CALLBACK_INFORMATION, *PPCW_CALLBACK_INFORMATION; - -typedef enum _PCW_CALLBACK_TYPE { - PcwCallbackAddCounter = 0, - PcwCallbackRemoveCounter, - PcwCallbackEnumerateInstances, - PcwCallbackCollectData, -} PCW_CALLBACK_TYPE, *PPCW_CALLBACK_TYPE; - -typedef -NTSTATUS NTAPI -PCW_CALLBACK( - __in PCW_CALLBACK_TYPE Type, - __in PPCW_CALLBACK_INFORMATION Info, - __in_opt PVOID Context - ); - -typedef PCW_CALLBACK *PPCW_CALLBACK; - -typedef struct _PCW_REGISTRATION_INFORMATION { - __in ULONG Version; - __in PCUNICODE_STRING Name; - __in ULONG CounterCount; - __in_ecount(CounterCount) PPCW_COUNTER_DESCRIPTOR Counters; - __in_opt PPCW_CALLBACK Callback; - __in_opt PVOID CallbackContext; -} PCW_REGISTRATION_INFORMATION, *PPCW_REGISTRATION_INFORMATION; - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -NTAPI -PcwRegister( - __deref_out PPCW_REGISTRATION *Registration, - __in PPCW_REGISTRATION_INFORMATION Info - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -VOID -NTAPI -PcwUnregister( - __in PPCW_REGISTRATION Registration - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -NTAPI -PcwCreateInstance( - __deref_out PPCW_INSTANCE *Instance, - __in PPCW_REGISTRATION Registration, - __in PCUNICODE_STRING Name, - __in ULONG Count, - __in_ecount(Count) PPCW_DATA Data - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -VOID -NTAPI -PcwCloseInstance( - __in PPCW_INSTANCE Instance - ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -__drv_maxIRQL(APC_LEVEL) -NTSTATUS -NTAPI -PcwAddInstance( - __in PPCW_BUFFER Buffer, - __in PCUNICODE_STRING Name, - __in ULONG Id, - __in ULONG Count, - __in_ecount(Count) PPCW_DATA Data - ); -#endif - - - -extern POBJECT_TYPE *CmKeyObjectType; -extern POBJECT_TYPE *IoFileObjectType; -extern POBJECT_TYPE *ExEventObjectType; -extern POBJECT_TYPE *ExSemaphoreObjectType; -extern POBJECT_TYPE *TmTransactionManagerObjectType; -extern POBJECT_TYPE *TmResourceManagerObjectType; -extern POBJECT_TYPE *TmEnlistmentObjectType; -extern POBJECT_TYPE *TmTransactionObjectType; -extern POBJECT_TYPE *PsProcessType; -extern POBJECT_TYPE *PsThreadType; -extern POBJECT_TYPE *SeTokenObjectType; - -#ifdef __cplusplus -} -#endif - -#if _MSC_VER >= 1200 -#pragma warning(pop) -#else -#pragma warning(default:4115) -#pragma warning(default:4201) -#pragma warning(default:4214) -#endif - -#endif // _WDMDDK_ - diff --git a/qt-correction-tool/pub/ddk/wdmguid.h b/qt-correction-tool/pub/ddk/wdmguid.h deleted file mode 100644 index d06c511..0000000 --- a/qt-correction-tool/pub/ddk/wdmguid.h +++ /dev/null @@ -1,136 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wdmguid.h - -Abstract: - - Defines GUIDs for function device classes and device events used in - Plug & Play. - -Revision History: - ---*/ - -#ifndef FAR -#define FAR -#endif - -// -// Device events that can be broadcasted to drivers and user-mode apps. -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DEFINE_GUID( GUID_HWPROFILE_QUERY_CHANGE, 0xcb3a4001L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_HWPROFILE_CHANGE_CANCELLED, 0xcb3a4002L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_HWPROFILE_CHANGE_COMPLETE, 0xcb3a4003L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_DEVICE_INTERFACE_ARRIVAL, 0xcb3a4004L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_DEVICE_INTERFACE_REMOVAL, 0xcb3a4005L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_TARGET_DEVICE_QUERY_REMOVE, 0xcb3a4006L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_CANCELLED, 0xcb3a4007L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_TARGET_DEVICE_REMOVE_COMPLETE, 0xcb3a4008L, 0x46f0, 0x11d0, 0xb0, 0x8f, 0x00, 0x60, 0x97, 0x13, 0x05, 0x3f ); -DEFINE_GUID( GUID_PNP_CUSTOM_NOTIFICATION, 0xACA73F8EL, 0x8D23, 0x11D1, 0xAC, 0x7D, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 ); -DEFINE_GUID( GUID_PNP_POWER_NOTIFICATION, 0xC2CF0660L, 0xEB7A, 0x11D1, 0xBD, 0x7F, 0x00, 0x00, 0xF8, 0x75, 0x71, 0xD0 ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DEFINE_GUID( GUID_PNP_POWER_SETTING_CHANGE, 0x29C69B3EL, 0xC79A, 0x43BF, 0xBB, 0xDE, 0xA9, 0x32, 0xFA, 0x1B, 0xEA, 0x7E ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -DEFINE_GUID( GUID_TARGET_DEVICE_TRANSPORT_RELATIONS_CHANGED, 0xfcf528f6, 0xa82f, 0x47b1, 0xad, 0x3a, 0x80, 0x50, 0x59, 0x4c, 0xad, 0x28 ); -#endif - -// -// Interface GUIDs used for IRP_MN_QUERY_INTERFACE -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DEFINE_GUID( GUID_BUS_INTERFACE_STANDARD, 0x496B8280L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F ); -DEFINE_GUID( GUID_PCI_BUS_INTERFACE_STANDARD, 0x496B8281L, 0x6F25, 0x11D0, 0xBE, 0xAF, 0x08, 0x00, 0x2B, 0xE2, 0x09, 0x2F ); -DEFINE_GUID( GUID_ARBITER_INTERFACE_STANDARD, 0xe644f185L, 0x8c0e, 0x11d0, 0xbe, 0xcf, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f ); -DEFINE_GUID( GUID_TRANSLATOR_INTERFACE_STANDARD, 0x6c154a92L, 0xaacf, 0x11d0, 0x8d, 0x2a, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44 ); -DEFINE_GUID( GUID_ACPI_INTERFACE_STANDARD, 0xb091a08aL, 0xba97, 0x11d0, 0xbd, 0x14, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a ); -DEFINE_GUID( GUID_INT_ROUTE_INTERFACE_STANDARD, 0x70941bf4L, 0x0073, 0x11d1, 0xa0, 0x9e, 0x00, 0xc0, 0x4f, 0xc3, 0x40, 0xb1 ); -DEFINE_GUID( GUID_PCMCIA_BUS_INTERFACE_STANDARD, 0x76173af0L, 0xc504, 0x11d1, 0x94, 0x7f, 0x00, 0xc0, 0x4f, 0xb9, 0x60, 0xee ); -DEFINE_GUID( GUID_ACPI_REGS_INTERFACE_STANDARD, 0x06141966L, 0x7245, 0x6369, 0x46, 0x2e, 0x4e, 0x65, 0x6c, 0x73, 0x6f, 0x6e ); -DEFINE_GUID( GUID_LEGACY_DEVICE_DETECTION_STANDARD, 0x50feb0deL, 0x596a, 0x11d2, 0xa5, 0xb8, 0x00, 0x00, 0xf8, 0x1a, 0x46, 0x19 ); -DEFINE_GUID( GUID_PCI_DEVICE_PRESENT_INTERFACE, 0xd1b82c26L, 0xbf49, 0x45ef, 0xb2, 0x16, 0x71, 0xcb, 0xd7, 0x88, 0x9b, 0x57 ); -DEFINE_GUID( GUID_MF_ENUMERATION_INTERFACE, 0xaeb895f0L, 0x5586, 0x11d1, 0x8d, 0x84, 0x00, 0xa0, 0xc9, 0x06, 0xb2, 0x44 ); -DEFINE_GUID( GUID_REENUMERATE_SELF_INTERFACE_STANDARD, 0x2aeb0243, 0x6a6e, 0x486b, 0x82, 0xfc, 0xd8, 0x15, 0xf6, 0xb9, 0x70, 0x06 ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DEFINE_GUID( GUID_AGP_TARGET_BUS_INTERFACE_STANDARD, 0xB15CFCE8L, 0x06D1, 0x4D37, 0x9D, 0x4C, 0xBE, 0xDD, 0xE0, 0xC2, 0xA6, 0xFF ); -DEFINE_GUID( GUID_ACPI_CMOS_INTERFACE_STANDARD, 0x3a8d0384L, 0x6505, 0x40ca, 0xbc, 0x39, 0x56, 0xc1, 0x5f, 0x8c, 0x5f, 0xed ); -DEFINE_GUID( GUID_ACPI_PORT_RANGES_INTERFACE_STANDARD, 0xf14f609bL, 0xcbbd, 0x4957, 0xa6, 0x74, 0xbc, 0x0, 0x21, 0x3f, 0x1c, 0x97 ); -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DEFINE_GUID( GUID_ACPI_INTERFACE_STANDARD2, 0xe8695f63L, 0x1831, 0x4870, 0xa8, 0xcf, 0x9c, 0x2f, 0x03, 0xf9, 0xdc, 0xb5 ); -DEFINE_GUID( GUID_PNP_LOCATION_INTERFACE, 0x70211b0e, 0x0afb, 0x47db, 0xaf, 0xc1, 0x41, 0x0b, 0xf8, 0x42, 0x49, 0x7a ); -DEFINE_GUID( GUID_PCI_EXPRESS_LINK_QUIESCENT_INTERFACE, 0x146cd41cL, 0xdae3, 0x4437, 0x8a, 0xff, 0x2a, 0xf3, 0xf0, 0x38, 0x09, 0x9b ); -DEFINE_GUID( GUID_PCI_EXPRESS_ROOT_PORT_INTERFACE, 0x83a7734aL, 0x84c7, 0x4161, 0x9a, 0x98, 0x60, 0x00, 0xed, 0x0c, 0x4a, 0x33 ); -DEFINE_GUID( GUID_MSIX_TABLE_CONFIG_INTERFACE, 0x1a6a460b, 0x194f, 0x455d, 0xb3, 0x4b, 0xb8, 0x4c, 0x5b, 0x05, 0x71, 0x2b ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WIN7) -DEFINE_GUID( GUID_PROCESSOR_PCC_INTERFACE_STANDARD, 0x37b17e9a, 0xc21c, 0x4296, 0x97, 0x2d, 0x11, 0xc4, 0xb3, 0x2b, 0x28, 0xf0); -#endif - -// -// Bus type GUIDs -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DEFINE_GUID( GUID_BUS_TYPE_INTERNAL, 0x1530ea73L, 0x086b, 0x11d1, 0xa0, 0x9f, 0x00, 0xc0, 0x4f, 0xc3, 0x40, 0xb1 ); -DEFINE_GUID( GUID_BUS_TYPE_PCMCIA, 0x09343630L, 0xaf9f, 0x11d0, 0x92, 0xE9, 0x00, 0x00, 0xf8, 0x1e, 0x1b, 0x30 ); -DEFINE_GUID( GUID_BUS_TYPE_PCI, 0xc8ebdfb0L, 0xb510, 0x11d0, 0x80, 0xe5, 0x00, 0xa0, 0xc9, 0x25, 0x42, 0xe3 ); -DEFINE_GUID( GUID_BUS_TYPE_ISAPNP, 0xe676f854L, 0xd87d, 0x11d0, 0x92, 0xb2, 0x00, 0xa0, 0xc9, 0x05, 0x5f, 0xc5 ); -DEFINE_GUID( GUID_BUS_TYPE_EISA, 0xddc35509L, 0xf3fc, 0x11d0, 0xa5, 0x37, 0x00, 0x00, 0xf8, 0x75, 0x3e, 0xd1 ); -DEFINE_GUID( GUID_BUS_TYPE_MCA, 0x1c75997aL, 0xdc33, 0x11d0, 0x92, 0xb2, 0x00, 0xa0, 0xc9, 0x05, 0x5f, 0xc5 ); -DEFINE_GUID( GUID_BUS_TYPE_SERENUM, 0x77114a87L, 0x8944, 0x11d1, 0xbd, 0x90, 0x00, 0xa0, 0xc9, 0x06, 0xbe, 0x2d ); -DEFINE_GUID( GUID_BUS_TYPE_USB, 0x9d7debbcL, 0xc85d, 0x11d1, 0x9e, 0xb4, 0x00, 0x60, 0x08, 0xc3, 0xa1, 0x9a ); -#endif - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DEFINE_GUID( GUID_BUS_TYPE_LPTENUM, 0xc4ca1000L, 0x2ddc, 0x11d5, 0xa1, 0x7a, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d ); -DEFINE_GUID( GUID_BUS_TYPE_USBPRINT, 0x441ee000L, 0x4342, 0x11d5, 0xa1, 0x84, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d ); -DEFINE_GUID( GUID_BUS_TYPE_DOT4PRT, 0x441ee001L, 0x4342, 0x11d5, 0xa1, 0x84, 0x00, 0xc0, 0x4f, 0x60, 0x52, 0x4d ); -DEFINE_GUID( GUID_BUS_TYPE_1394, 0xf74e73ebL, 0x9ac5, 0x45eb, 0xbe, 0x4d, 0x77, 0x2c, 0xc7, 0x1d, 0xdf, 0xb3 ); -DEFINE_GUID( GUID_BUS_TYPE_HID, 0xeeaf37d0L, 0x1963, 0x47c4, 0xaa, 0x48, 0x72, 0x47, 0x6d, 0xb7, 0xcf, 0x49 ); -DEFINE_GUID( GUID_BUS_TYPE_AVC, 0xc06ff265L, 0xae09, 0x48f0, 0x81, 0x2c, 0x16, 0x75, 0x3d, 0x7c, 0xba, 0x83 ); -DEFINE_GUID( GUID_BUS_TYPE_IRDA, 0x7ae17dc1L, 0xc944, 0x44d6, 0x88, 0x1f, 0x4c, 0x2e, 0x61, 0x05, 0x3b, 0xc1 ); -DEFINE_GUID( GUID_BUS_TYPE_SD, 0xe700cc04L, 0x4036, 0x4e89, 0x95, 0x79, 0x89, 0xeb, 0xf4, 0x5f, 0x00, 0xcd ); -#endif - -// -// Power management WMI guids for device control -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -DEFINE_GUID( GUID_POWER_DEVICE_ENABLE, 0x827c0a6fL, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a ); -DEFINE_GUID( GUID_POWER_DEVICE_TIMEOUTS, 0xa45da735L, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a ); -DEFINE_GUID( GUID_POWER_DEVICE_WAKE_ENABLE, 0xa9546a82L, 0xfeb0, 0x11d0, 0xbd, 0x26, 0x00, 0xaa, 0x00, 0xb7, 0xb3, 0x2a ); -#endif - -// -// User-Mode Driver Framework device events for detecting driver host crashes. -// - -#if (NTDDI_VERSION >= NTDDI_WINXP) -DEFINE_GUID( GUID_WUDF_DEVICE_HOST_PROBLEM, 0xc43d25bdL, 0x9346, 0x40ee, 0xa2, 0xd2, 0xd7, 0x0c, 0x15, 0xf8, 0xb7, 0x5b ); -#endif - -// -// Dynamic partitioning replace interface. -// - -#if (NTDDI_VERSION >= NTDDI_VISTA) -DEFINE_GUID(GUID_PARTITION_UNIT_INTERFACE_STANDARD, 0x52363f5bL, 0xd891, 0x429b, 0x81, 0x95, 0xae, 0xc5, 0xfe, 0xf6, 0x85, 0x3c); -#endif - - diff --git a/qt-correction-tool/pub/ddk/wdmsec.h b/qt-correction-tool/pub/ddk/wdmsec.h deleted file mode 100644 index 51e9307..0000000 --- a/qt-correction-tool/pub/ddk/wdmsec.h +++ /dev/null @@ -1,446 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wdmsec.h - -Abstract: - - This header exposes secuity routines to drivers that need them. - -Revision History: - ---*/ - -#ifndef _WDMSEC_H_ -#define _WDMSEC_H_ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -// -// SDDL_DEVOBJ_KERNEL_ONLY is an "empty" ACL. User mode code (including -// processes running as system) cannot open the device. -// -// This could be used by a driver creating a raw WDM PDO. The INF would specify -// lighter security settings. Until the INF was processed, the device would -// be nonopenable by user mode code. -// -// Similarly, a legacy driver might use this ACL, and let its install app open -// the device up at runtime to individual users. The install app would update -// the class key with a very target ACL and reload the driver. The empty ACL -// would only kick in only if the driver was loaded without the appropriate -// security applied by the install app. -// -// In all of these cases, the default is strong security, lightened as -// necessary (just like chemistry, where the rule is "add acid to water, -// never water to acid"). -// -// Example usage: -// IoCreateDeviceSecure(..., &SDDL_DEVOBJ_KERNEL_ONLY, &Guid, ...); -// - -/* -DECLARE_CONST_UNICODE_STRING(SDDL_DEVOBJ_KERNEL_ONLY, L"D:P"); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_KERNEL_ONLY; - -// -// IoCreateDeviceSecure can be used to create a WDM PDO that initially can be -// opened only by kernel mode, at least until an INF is supplied. Note that -// IoCreateDeviceSecure should *never* be used for an FDO!!! -// -#define SDDL_DEVOBJ_INF_SUPPLIED SDDL_DEVOBJ_KERNEL_ONLY - -// -// SDDL_DEVOBJ_SYS_ALL is similar to SDDL_DEVOBJ_KERNEL_ONLY, except that in -// addition to kernel code, user mode code running as *SYSTEM* is also allowed -// to open the device for any access. -// -// A legacy driver might use this ACL to start with tight security settings, -// and let its service open the device up at runtime to individual users via -// SetFileSecurity API. In this case, the service would have to be running as -// system. -// -// (Note that the DEVOBJ SDDL strings in this file don't specify any -// inheritance. This is because inheritance isn't a valid concept for things -// behind a device object, like a file. As such, these SDDL strings would have -// to be modified with inheritance tokens like "OICI" to be used for things -// like registry keys or file. See the SDK's documentation on SDDL strings for -// more information.) -// - -/* -DECLARE_CONST_UNICODE_STRING(SDDL_DEVOBJ_SYS_ALL, L"D:P(A;;GA;;;SY)"); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_ALL allows the kernel, system, and admin complete -// control over the device. No other users may access the device -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_ALL, - L"D:P(A;;GA;;;SY)(A;;GA;;;BA)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_ALL; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_RX allows the kernel and system complete control -// over the device. By default the admin can only read from the device (the -// admin can of course override this manually). -// -// The X refers to traversal, meaning the access to the namespace *beneath* a -// device object. This only has an effect on storage stacks today. To lock down -// the namespace behind a device (for example, if the device doesn't _have_ a -// namespace), see the documentation on FILE_DEVICE_SECURE_OPEN flag to -// IoCreateDevice{Secure}. -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RX, - L"D:P(A;;GA;;;SY)(A;;GRGX;;;BA)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RX; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R allows the kernel and system complete -// control over the device. By default the admin can access the entire device, -// but cannot change the ACL (the admin must take control of the device first) -// -// Everyone (the WORLD SID) is given read access. "Untrusted" code *cannot* -// access the device (untrusted code might be code launched via the Run-As -// option in Explorer. By default, World does not cover Restricted code.) -// -// Also note that traversal access is not granted to normal users. As such, -// this might not be an appropriate descriptor for a storage device with a -// namespace. -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R, - L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GR;;;WD)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R_RES_R allows the kernel and system -// complete control over the device. By default the admin can access the entire -// device, but cannot change the ACL (the admin must take control of the device -// first) -// -// Everyone (the WORLD SID) is given read access. In addition, "restricted" or -// "untrusted" code (the RES SID) is also allowed to access code. Untrusted -// code might be code launched via the Run-As option in Explorer. By default, -// World does not cover Restricted code. -// -// (Odd implementation detail: Due to the mechanics of restricting SIDs, the -// RES SID in an ACL should never exist outside the World SID). -// -// Also note that traversal access is not granted to normal users. As such, -// this might not be an appropriate descriptor for a storage device with a -// namespace. -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R_RES_R, - L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GR;;;WD)(A;;GR;;;RC)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_R_RES_R; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R allows the kernel and system -// complete control over the device. By default the admin can access the entire -// device, but cannot change the ACL (the admin must take control of the device -// first) -// -// Everyone (the WORLD SID) can read or write to the device. However, -// "restricted" or "untrusted" code (the RES SID) can only read from the device. -// -// Also note that normal users are not given traversal accesss. It is probably -// unnecessary anyway, as most devices don't manage a seperate namespace -// (ie, they set FILE_DEVICE_SECURE_OPEN). -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R, - L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGW;;;WD)(A;;GR;;;RC)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RW_RES_R; - - -// -// SDDL_DEVOBJ_SYS_ALL_WORLD_RWX_RES_RWX allows the kernel and system complete -// control over the device. By default the admin can access the entire device, -// but cannot change the ACL (the admin must take control of the device first) -// -// Everyone else, including "restricted" or "untrusted" code can read or write -// to the device. Traversal beneath the device is also granted (removing it -// would only effect storage devices, except if the "bypass-traversal" -// privilege was revoked). -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX, - L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;GRGWGX;;;WD)(A;;GRGWGX;;;RC)" - ); -*/ -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_RWX_RES_RWX; - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_A is listed for completeness. This allows the -// kernel and system complete control over the device. By default the admin -// can access the entire device, but cannot change the ACL (the admin must take -// control of the device first) -// -// Everyone (the WORLD SID) can *append* data to the device. "Restricted" or -// "untrusted" code (the RES SID) cannot access the device. See ntioapi.h for -// the individual bit definitions of device rights. -// -// Note also that normal users can send neither read nor write IOCTLs (The read -// device data right is bit 0, the write device data right is bit 1 - neither -// bits are set below). -// - -/* -DECLARE_CONST_UNICODE_STRING( - SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_A, - L"D:P(A;;GA;;;SY)(A;;GRGWGX;;;BA)(A;;0x0004;;;WD)" - ); - -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_RWX_WORLD_A; -*/ - - -// -// SDDL_DEVOBJ_SYS_ALL_ADM_ALL_WORLD_ALL_RES_ALL is listed for completeness. -// This ACL would give *any* user *total* access to the device, including the -// ability to change the ACL, locking out other users!!!!! -// -// As this ACL is really a *very* bad idea, it isn't exported by this library. -// Don't make an ACL like this! -// - -/* -DECLARE_CONST_UNICODE_STING( - SDDL_DEVOBJ_SYS_ALL_ADM_ALL_WORLD_ALL_RES_ALL, - "D:P(A;;GA;;;SY)(A;;GA;;;BA)(A;;GA;;;WD)(A;;GA;;;RC)" - ); - -extern const UNICODE_STRING SDDL_DEVOBJ_SYS_ALL_ADM_ALL_WORLD_ALL_RES_ALL; -*/ - -/* - - The following SIDs represent *accounts* on the local machine: - ------------------------------------------------------------- - - System ("SY", S-1-5-18, SECURITY_NT_AUTHORITY:SECURITY_LOCAL_SYSTEM_RID) - The OS itself (including its user mode components.) - - Local Service ("LS", S-1-5-19, SECURITY_NT_AUTHORITY:SECURITY_LOCAL_SERVICE_RID) - A predefined account for services that presents user credentials for local - resources and annonymous credentials for network access. - Available on XP and later. - - Network Service ("NS", S-1-5-20, SECURITY_NT_AUTHORITY:SECURITY_NETWORK_SERVICE_RID) - A predefined account for services that presents user credentials for local - resources and the machine ID for network access. - Available on XP and later. - - (A local *account* for a guest and a default administrator also exist, but - the corresponding SDDL abbreviations are not supported by this library. - Use the corresponding group SIDs instead.) - - - - The following SIDs represent *groups* on the local machine: - ----------------------------------------------------------- - - Administrators ("BA", S-1-5-32-544, SECURITY_NT_AUTHORITY:SECURITY_BUILTIN_DOMAIN_RID:DOMAIN_ALIAS_RID_ADMINS) - The builtin administrators group on the machine. This is not the same - as the builtin Administrator *account*. - - Builtin users group ("BU", S-1-5-32-545, SECURITY_NT_AUTHORITY:SECURITY_BUILTIN_DOMAIN_RID:DOMAIN_ALIAS_RID_USERS) - Group covering all local user accounts, and users on the domain. - - Builtin guests group ("BG", S-1-5-32-546, SECURITY_NT_AUTHORITY:SECURITY_BUILTIN_DOMAIN_RID:DOMAIN_ALIAS_RID_GUESTS) - Group covering users logging in using the local or domain guest account. - This is not the same as the builtin Guest *account*. - - - - The below SIDs describe the authenticity of the user's identity: - ---------------------------------------------------------------- - - Authenticated Users ("AU", S-1-5-11, SECURITY_NT_AUTHORITY:SECURITY_AUTHENTICATED_USER_RID) - Any user recognized by the local machine or by a domain. Note that - users logged in using the Builtin Guest account are not authenticated. - However, members of the Guests group with individual accounts on the - machine or domain are authenticated. - - Anonymous Logged-on User ("AN", S-1-5-7, SECURITY_NT_AUTHORITY:SECURITY_ANONYMOUS_LOGON_RID) - Any user logged on without an identity, for instance via an anonymous - network session. Note that users logged in using the Builtin Guest - account are neither authenticated nor anonymous. Available on XP and - later. - - World ("WD", S-1-1-0, SECURITY_WORLD_SID_AUTHORITY:SECURITY_WORLD_RID) - Prior to Windows XP, this SID covers every session: authenticated, - anonymous, and the Builtin Guest account. - - For Windows XP and later, this SID does not cover anonymous logon - sessions - only authenticated and the Builtin Guest account. - - Note that untrusted or "restricted" code is also not covered by the - World SID. See the Restricted Code SID description for more - information. - - - - The below SIDs describe how the user logged into the machine: - ------------------------------------------------------------- - - Interactive Users ("IU", S-1-5-4, SECURITY_NT_AUTHORITY:SECURITY_INTERACTIVE_RID) - Users who initally logged onto the machine "interactively", such as - local logons and Remote Desktops logons. - - Network Logon User ("NU", S-1-5-2, SECURITY_NT_AUTHORITY:SECURITY_NETWORK_RID) - Users accessing the machine remotely, without interactive desktop - access (ie, file sharing or RPC calls). - - Terminal Server Users (---, S-1-5-14, SECURITY_NT_AUTHORITY:SECURITY_TERMINAL_SERVER_RID) - Interactive Users who *initially* logged onto the machine specifically - via Terminal Services or Remote Desktop. - (NOTE: There is currently no SDDL token for this SID. Furthermore, the - presence of the SID doesn't take into account fast user switching - either.) - - - - The below SID deserves special mention: - --------------------------------------- - - Restricted Code ("RC", S-1-5-12, SECURITY_NT_AUTHORITY:SECURITY_RESTRICTED_CODE_RID) - This SID is used to control access by untrusted code. - - ACL validation against tokens with RC go through *two* checks, one - against the token's normal list of SIDs (containing WD for instance), - and one against a second list (typically containing RC and a subset of - the original token SIDs). Only if both tests pass is access granted. - As such, RC actually works in *combination* with other SIDs. - - When RC is paired with WD in an ACL, a *superset* of Everyone - _including_ untrusted code is described. RC is thus rarely seen in - ACL's without the WD token. - -*/ - - - - -// -// Supply overrideable library implementation of IoCreateDeviceSecure. -// This function is similar to IoCreateDevice, except that it only creates -// named device objects. This function would be used to create raw PnP PDOs and -// legacy device objects. The DefaultSDDLString specifies security while the -// ClassGuid allows the administrator to override the defaults. Every driver -// should pass in a ClassGuid (if no relevant Guid exists, just invent a new -// one with guidgen.exe). The classguid parameter is crucial as it allows the -// admin to tighten security (for instance, the admin might deny access to a -// specific user). -// -// Note: This function should *not* be used to create a WDM FDO or Filter. The -// only type of device object in a WDM stack that can be created using -// IoCreateDeviceSecure is a PDO! -// -// See DDK documentation for more details. -// -#undef IoCreateDeviceSecure -#define IoCreateDeviceSecure WdmlibIoCreateDeviceSecure - -__drv_maxIRQL(PASSIVE_LEVEL) -__drv_valueIs(==0;<0) -NTSTATUS -WdmlibIoCreateDeviceSecure( - __in PDRIVER_OBJECT DriverObject, - __in ULONG DeviceExtensionSize, - __in_opt PUNICODE_STRING DeviceName, - __in DEVICE_TYPE DeviceType, - __in ULONG DeviceCharacteristics, - __in BOOLEAN Exclusive, - __in PCUNICODE_STRING DefaultSDDLString, - __in_opt LPCGUID DeviceClassGuid, - __out - __drv_out_deref( - __drv_allocatesMem(Mem) - __drv_when((((inFunctionClass$("DRIVER_INITIALIZE")) - ||(inFunctionClass$("DRIVER_DISPATCH")))), - __drv_aliasesMem) - __on_failure(__null)) - PDEVICE_OBJECT *DeviceObject - ); - -// -// Supply library internal implementation of RtlInitUnicodeStringEx -// This function is similar to RtlInitUnicodeString, except that it handles the -// case where a string exceeds UNICODE_STRING_MAX_CHARS (it does not probe or -// check alignments though). -// -// See DDK documentation for more details. -// -#undef RtlInitUnicodeStringEx -#define RtlInitUnicodeStringEx WdmlibRtlInitUnicodeStringEx - -NTSTATUS -WdmlibRtlInitUnicodeStringEx( - __out PUNICODE_STRING DestinationString, - __in_opt PCWSTR SourceString - ); - -// -// Supply overrideable library implementation of IoValidateDeviceIoControlAccess -// This function allows a driver running on Server 2003 to process -// FILE_ANY_ACCESS IOCTLs as if they were FILE_READ_ACCESS, FILE_WRITE_ACCESS, -// or both. -// -// See DDK documentation for more details. -// -#undef IoValidateDeviceIoControlAccess -#define IoValidateDeviceIoControlAccess WdmlibIoValidateDeviceIoControlAccess - -NTSTATUS -WdmlibIoValidateDeviceIoControlAccess( - __in PIRP Irp, - __in ULONG RequiredAccess - ); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif // _WDMSEC_H_ - - diff --git a/qt-correction-tool/pub/ddk/wdmwarn4.h b/qt-correction-tool/pub/ddk/wdmwarn4.h deleted file mode 100644 index b0f0ad5..0000000 --- a/qt-correction-tool/pub/ddk/wdmwarn4.h +++ /dev/null @@ -1,17 +0,0 @@ -/* -Include before wdm.h to be able to compile at warning level 4 -*/ - -/* -4214 nonstandard extension used : bit field types other than int -4201 nonstandard extension using nameless struct/union -4115 nonstandard extension used : named type definition in parens -4200 nonstandard extension used : zero-sized array in struct/union -4514 unreferenced inline function -**4100 unreferenced formal parameter -4057 -4127 condition expression is constant -*/ - -#pragma warning(disable:4214 4201 4115 4200 4100 4514 4057 4127) - diff --git a/qt-correction-tool/pub/ddk/wheaevents.h b/qt-correction-tool/pub/ddk/wheaevents.h deleted file mode 100644 index e103bfe..0000000 --- a/qt-correction-tool/pub/ddk/wheaevents.h +++ /dev/null @@ -1,61 +0,0 @@ -//**********************************************************************` -//* This is an include file generated by Message Compiler. *` -//* *` -//* Copyright (c) Microsoft Corporation. All Rights Reserved. *` -//**********************************************************************` -#pragma once -//+ -// Provider Microsoft-Windows-Kernel-WHEA Event Count 21 -//+ -EXTERN_C __declspec(selectany) const GUID WHEA_ETW_PROVIDER = {0x7b563579, 0x53c8, 0x44e7, {0x82, 0x36, 0x0f, 0x87, 0xb9, 0xfe, 0x65, 0x94}}; - -// -// Channel -// -#define WHEA_ETW_PROVIDER_CHANNEL_systemChannel 0x8 -#define WHEA_CHANNEL 0x10 -#define WHEA_INIT_CHANNEL 0x11 -// -// Keyword -// -#define WHEA_ERROR_KEYWORD 0x800 - -// -// Event Descriptors -// -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR EVENT_WHEA_INIT_OP = {0x5, 0x0, 0x11, 0x4, 0x0, 0x0, 0x2000000000000000}; -#define EVENT_WHEA_INIT_OP_value 0x5 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR EVENT_WHEA_ERROR = {0x14, 0x0, 0x10, 0x4, 0x0, 0x0, 0x4000000000000800}; -#define EVENT_WHEA_ERROR_value 0x14 -EXTERN_C __declspec(selectany) const EVENT_DESCRIPTOR EVENT_WHEA_MEMORY_OFFLINE = {0x1f, 0x0, 0x10, 0x4, 0x0, 0x0, 0x4000000000000800}; -#define EVENT_WHEA_MEMORY_OFFLINE_value 0x1f -#define MSG_CorrectedError_EventMessage 0x00000001L -#define MSG_UncorrectedError_EventMessage 0x00000002L -#define MSG_MCAMemHierarchyErr_EventMessage 0x00000006L -#define MSG_MCATLBErr_EventMessage 0x00000008L -#define MSG_MCABusErr_EventMessage 0x0000000AL -#define MSG_MCABusTOErr_EventMessage 0x0000000CL -#define MSG_MCAWDTOErr_EventMessage 0x0000000EL -#define MSG_MCAExternalErr_EventMessage 0x00000010L -#define MSG_MCAFRCErr_EventMessage 0x00000011L -#define MSG_PCIeErr_EventMessage 0x00000012L -#define MSG_WHEA_ERROR_KEYWORD_KeywordMessage 0x1000000CL -#define MSG_eventProviderName 0x90000001L -#define MSG_Init_EventMessage 0xB0000005L -#define MSG_MCAMemHierarchyWrn_EventMessage 0xB0000007L -#define MSG_MCATLBWrn_EventMessage 0xB0000009L -#define MSG_MCABusWrn_EventMessage 0xB000000BL -#define MSG_MCABusTOWrn_EventMessage 0xB000000DL -#define MSG_MCAROMParityErr_EventMessage 0xB000000FL -#define MSG_PCIeWrn_EventMessage 0xB0000013L -#define MSG_WHEA_EventMessage 0xB0000014L -#define MSG_MemoryOffline_EventMessage 0xB000001FL -#define MSG_mapWHEAPending_No 0xD0000001L -#define MSG_mapWHEAPending_Yes 0xD0000002L -#define MSG_mapWHEAPlatformDirected_No 0xD0000003L -#define MSG_mapWHEAPlatformDirected_Yes 0xD0000004L -#define MSG_mapWHEAUncorrected_No 0xD0000005L -#define MSG_mapWHEAUncorrected_Yes 0xD0000006L -#define MSG_mapWHEAPersisted_No 0xD0000007L -#define MSG_mapWHEAPersisted_Yes 0xD0000008L - diff --git a/qt-correction-tool/pub/ddk/wia_lh.h b/qt-correction-tool/pub/ddk/wia_lh.h deleted file mode 100644 index fc7fb19..0000000 --- a/qt-correction-tool/pub/ddk/wia_lh.h +++ /dev/null @@ -1,4755 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for wia_lh.idl, wia_lh.acf: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __wia_lh_h__ -#define __wia_lh_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IWiaDevMgr_FWD_DEFINED__ -#define __IWiaDevMgr_FWD_DEFINED__ -typedef interface IWiaDevMgr IWiaDevMgr; -#endif /* __IWiaDevMgr_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_INFO_FWD_DEFINED__ -#define __IEnumWIA_DEV_INFO_FWD_DEFINED__ -typedef interface IEnumWIA_DEV_INFO IEnumWIA_DEV_INFO; -#endif /* __IEnumWIA_DEV_INFO_FWD_DEFINED__ */ - - -#ifndef __IWiaEventCallback_FWD_DEFINED__ -#define __IWiaEventCallback_FWD_DEFINED__ -typedef interface IWiaEventCallback IWiaEventCallback; -#endif /* __IWiaEventCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaDataCallback_FWD_DEFINED__ -#define __IWiaDataCallback_FWD_DEFINED__ -typedef interface IWiaDataCallback IWiaDataCallback; -#endif /* __IWiaDataCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaDataTransfer_FWD_DEFINED__ -#define __IWiaDataTransfer_FWD_DEFINED__ -typedef interface IWiaDataTransfer IWiaDataTransfer; -#endif /* __IWiaDataTransfer_FWD_DEFINED__ */ - - -#ifndef __IWiaItem_FWD_DEFINED__ -#define __IWiaItem_FWD_DEFINED__ -typedef interface IWiaItem IWiaItem; -#endif /* __IWiaItem_FWD_DEFINED__ */ - - -#ifndef __IWiaPropertyStorage_FWD_DEFINED__ -#define __IWiaPropertyStorage_FWD_DEFINED__ -typedef interface IWiaPropertyStorage IWiaPropertyStorage; -#endif /* __IWiaPropertyStorage_FWD_DEFINED__ */ - - -#ifndef __IEnumWiaItem_FWD_DEFINED__ -#define __IEnumWiaItem_FWD_DEFINED__ -typedef interface IEnumWiaItem IEnumWiaItem; -#endif /* __IEnumWiaItem_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_CAPS_FWD_DEFINED__ -#define __IEnumWIA_DEV_CAPS_FWD_DEFINED__ -typedef interface IEnumWIA_DEV_CAPS IEnumWIA_DEV_CAPS; -#endif /* __IEnumWIA_DEV_CAPS_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ -#define __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ -typedef interface IEnumWIA_FORMAT_INFO IEnumWIA_FORMAT_INFO; -#endif /* __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ */ - - -#ifndef __IWiaLog_FWD_DEFINED__ -#define __IWiaLog_FWD_DEFINED__ -typedef interface IWiaLog IWiaLog; -#endif /* __IWiaLog_FWD_DEFINED__ */ - - -#ifndef __IWiaLogEx_FWD_DEFINED__ -#define __IWiaLogEx_FWD_DEFINED__ -typedef interface IWiaLogEx IWiaLogEx; -#endif /* __IWiaLogEx_FWD_DEFINED__ */ - - -#ifndef __IWiaNotifyDevMgr_FWD_DEFINED__ -#define __IWiaNotifyDevMgr_FWD_DEFINED__ -typedef interface IWiaNotifyDevMgr IWiaNotifyDevMgr; -#endif /* __IWiaNotifyDevMgr_FWD_DEFINED__ */ - - -#ifndef __IWiaItemExtras_FWD_DEFINED__ -#define __IWiaItemExtras_FWD_DEFINED__ -typedef interface IWiaItemExtras IWiaItemExtras; -#endif /* __IWiaItemExtras_FWD_DEFINED__ */ - - -#ifndef __IWiaAppErrorHandler_FWD_DEFINED__ -#define __IWiaAppErrorHandler_FWD_DEFINED__ -typedef interface IWiaAppErrorHandler IWiaAppErrorHandler; -#endif /* __IWiaAppErrorHandler_FWD_DEFINED__ */ - - -#ifndef __IWiaErrorHandler_FWD_DEFINED__ -#define __IWiaErrorHandler_FWD_DEFINED__ -typedef interface IWiaErrorHandler IWiaErrorHandler; -#endif /* __IWiaErrorHandler_FWD_DEFINED__ */ - - -#ifndef __IWiaTransfer_FWD_DEFINED__ -#define __IWiaTransfer_FWD_DEFINED__ -typedef interface IWiaTransfer IWiaTransfer; -#endif /* __IWiaTransfer_FWD_DEFINED__ */ - - -#ifndef __IWiaTransferCallback_FWD_DEFINED__ -#define __IWiaTransferCallback_FWD_DEFINED__ -typedef interface IWiaTransferCallback IWiaTransferCallback; -#endif /* __IWiaTransferCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaSegmentationFilter_FWD_DEFINED__ -#define __IWiaSegmentationFilter_FWD_DEFINED__ -typedef interface IWiaSegmentationFilter IWiaSegmentationFilter; -#endif /* __IWiaSegmentationFilter_FWD_DEFINED__ */ - - -#ifndef __IWiaImageFilter_FWD_DEFINED__ -#define __IWiaImageFilter_FWD_DEFINED__ -typedef interface IWiaImageFilter IWiaImageFilter; -#endif /* __IWiaImageFilter_FWD_DEFINED__ */ - - -#ifndef __IWiaPreview_FWD_DEFINED__ -#define __IWiaPreview_FWD_DEFINED__ -typedef interface IWiaPreview IWiaPreview; -#endif /* __IWiaPreview_FWD_DEFINED__ */ - - -#ifndef __IEnumWiaItem2_FWD_DEFINED__ -#define __IEnumWiaItem2_FWD_DEFINED__ -typedef interface IEnumWiaItem2 IEnumWiaItem2; -#endif /* __IEnumWiaItem2_FWD_DEFINED__ */ - - -#ifndef __IWiaItem2_FWD_DEFINED__ -#define __IWiaItem2_FWD_DEFINED__ -typedef interface IWiaItem2 IWiaItem2; -#endif /* __IWiaItem2_FWD_DEFINED__ */ - - -#ifndef __IWiaDevMgr2_FWD_DEFINED__ -#define __IWiaDevMgr2_FWD_DEFINED__ -typedef interface IWiaDevMgr2 IWiaDevMgr2; -#endif /* __IWiaDevMgr2_FWD_DEFINED__ */ - - -#ifndef __WiaDevMgr_FWD_DEFINED__ -#define __WiaDevMgr_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WiaDevMgr WiaDevMgr; -#else -typedef struct WiaDevMgr WiaDevMgr; -#endif /* __cplusplus */ - -#endif /* __WiaDevMgr_FWD_DEFINED__ */ - - -#ifndef __WiaDevMgr2_FWD_DEFINED__ -#define __WiaDevMgr2_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WiaDevMgr2 WiaDevMgr2; -#else -typedef struct WiaDevMgr2 WiaDevMgr2; -#endif /* __cplusplus */ - -#endif /* __WiaDevMgr2_FWD_DEFINED__ */ - - -#ifndef __WiaLog_FWD_DEFINED__ -#define __WiaLog_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WiaLog WiaLog; -#else -typedef struct WiaLog WiaLog; -#endif /* __cplusplus */ - -#endif /* __WiaLog_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "oaidl.h" -#include "propidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_wia_lh_0000_0000 */ -/* [local] */ - - - - - - - - - - - - - - - - - - -typedef struct _WIA_DITHER_PATTERN_DATA - { - LONG lSize; - BSTR bstrPatternName; - LONG lPatternWidth; - LONG lPatternLength; - LONG cbPattern; - BYTE *pbPattern; - } WIA_DITHER_PATTERN_DATA; - -typedef struct _WIA_DITHER_PATTERN_DATA *PWIA_DITHER_PATTERN_DATA; - -typedef struct _WIA_PROPID_TO_NAME - { - PROPID propid; - LPOLESTR pszName; - } WIA_PROPID_TO_NAME; - -typedef struct _WIA_PROPID_TO_NAME *PWIA_PROPID_TO_NAME; - -typedef struct _WIA_FORMAT_INFO - { - GUID guidFormatID; - LONG lTymed; - } WIA_FORMAT_INFO; - -typedef struct _WIA_FORMAT_INFO *PWIA_FORMAT_INFO; - -#include "wiadef.h" - - -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0000_v0_0_s_ifspec; - -#ifndef __IWiaDevMgr_INTERFACE_DEFINED__ -#define __IWiaDevMgr_INTERFACE_DEFINED__ - -/* interface IWiaDevMgr */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDevMgr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5eb2502a-8cf1-11d1-bf92-0060081ed811") - IWiaDevMgr : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceInfo( - /* [in] */ LONG lFlag, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE CreateDevice( - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlgID( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetImageDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackProgram( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackInterface( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackCLSID( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddDeviceDlg( - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDevMgrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDevMgr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDevMgr * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceInfo )( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlag, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *CreateDevice )( - IWiaDevMgr * This, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlg )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlgID )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetImageDlg )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackProgram )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackInterface )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackCLSID )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddDeviceDlg )( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags); - - END_INTERFACE - } IWiaDevMgrVtbl; - - interface IWiaDevMgr - { - CONST_VTBL struct IWiaDevMgrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDevMgr_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDevMgr_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDevMgr_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDevMgr_EnumDeviceInfo(This,lFlag,ppIEnum) \ - ( (This)->lpVtbl -> EnumDeviceInfo(This,lFlag,ppIEnum) ) - -#define IWiaDevMgr_CreateDevice(This,bstrDeviceID,ppWiaItemRoot) \ - ( (This)->lpVtbl -> CreateDevice(This,bstrDeviceID,ppWiaItemRoot) ) - -#define IWiaDevMgr_SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) \ - ( (This)->lpVtbl -> SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) ) - -#define IWiaDevMgr_SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) \ - ( (This)->lpVtbl -> SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) ) - -#define IWiaDevMgr_GetImageDlg(This,hwndParent,lDeviceType,lFlags,lIntent,pItemRoot,bstrFilename,pguidFormat) \ - ( (This)->lpVtbl -> GetImageDlg(This,hwndParent,lDeviceType,lFlags,lIntent,pItemRoot,bstrFilename,pguidFormat) ) - -#define IWiaDevMgr_RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrCommandline,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrCommandline,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr_RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) \ - ( (This)->lpVtbl -> RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) ) - -#define IWiaDevMgr_RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr_AddDeviceDlg(This,hwndParent,lFlags) \ - ( (This)->lpVtbl -> AddDeviceDlg(This,hwndParent,lFlags) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalCreateDevice_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppWiaItemRoot); - - -void __RPC_STUB IWiaDevMgr_LocalCreateDevice_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalSelectDeviceDlg_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem **ppItemRoot); - - -void __RPC_STUB IWiaDevMgr_LocalSelectDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalSelectDeviceDlgID_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - - -void __RPC_STUB IWiaDevMgr_LocalSelectDeviceDlgID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalGetImageDlg_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ __RPC__in_opt IWiaItem *pItemRoot, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out][in] */ __RPC__inout GUID *pguidFormat); - - -void __RPC_STUB IWiaDevMgr_LocalGetImageDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackProgram_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrCommandline, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackProgram_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackInterface_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackCLSID_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDevMgr_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ -#define __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ - -/* interface IEnumWIA_DEV_INFO */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_DEV_INFO; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5e38b83c-8cf1-11d1-bf92-0060081ed811") - IEnumWIA_DEV_INFO : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *celt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_DEV_INFOVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_DEV_INFO * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_DEV_INFO * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_DEV_INFO * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [out] */ __RPC__out ULONG *celt); - - END_INTERFACE - } IEnumWIA_DEV_INFOVtbl; - - interface IEnumWIA_DEV_INFO - { - CONST_VTBL struct IEnumWIA_DEV_INFOVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_DEV_INFO_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_DEV_INFO_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_DEV_INFO_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_DEV_INFO_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_DEV_INFO_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_DEV_INFO_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_DEV_INFO_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_DEV_INFO_GetCount(This,celt) \ - ( (This)->lpVtbl -> GetCount(This,celt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_RemoteNext_Proxy( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_DEV_INFO_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaEventCallback_INTERFACE_DEFINED__ -#define __IWiaEventCallback_INTERFACE_DEFINED__ - -/* interface IWiaEventCallback */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaEventCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ae6287b0-0084-11d2-973b-00a0c9068f2e") - IWiaEventCallback : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ImageEventCallback( - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrEventDescription, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrDeviceDescription, - /* [in] */ DWORD dwDeviceType, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out][in] */ __RPC__inout ULONG *pulEventType, - /* [in] */ ULONG ulReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaEventCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaEventCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaEventCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaEventCallback * This); - - HRESULT ( STDMETHODCALLTYPE *ImageEventCallback )( - __RPC__in IWiaEventCallback * This, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrEventDescription, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrDeviceDescription, - /* [in] */ DWORD dwDeviceType, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out][in] */ __RPC__inout ULONG *pulEventType, - /* [in] */ ULONG ulReserved); - - END_INTERFACE - } IWiaEventCallbackVtbl; - - interface IWiaEventCallback - { - CONST_VTBL struct IWiaEventCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaEventCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaEventCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaEventCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaEventCallback_ImageEventCallback(This,pEventGUID,bstrEventDescription,bstrDeviceID,bstrDeviceDescription,dwDeviceType,bstrFullItemName,pulEventType,ulReserved) \ - ( (This)->lpVtbl -> ImageEventCallback(This,pEventGUID,bstrEventDescription,bstrDeviceID,bstrDeviceDescription,dwDeviceType,bstrFullItemName,pulEventType,ulReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaEventCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_lh_0000_0003 */ -/* [local] */ - -typedef struct _WIA_DATA_CALLBACK_HEADER - { - LONG lSize; - GUID guidFormatID; - LONG lBufferSize; - LONG lPageCount; - } WIA_DATA_CALLBACK_HEADER; - -typedef struct _WIA_DATA_CALLBACK_HEADER *PWIA_DATA_CALLBACK_HEADER; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0003_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0003_v0_0_s_ifspec; - -#ifndef __IWiaDataCallback_INTERFACE_DEFINED__ -#define __IWiaDataCallback_INTERFACE_DEFINED__ - -/* interface IWiaDataCallback */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDataCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a558a866-a5b0-11d2-a08f-00c04f72dc3c") - IWiaDataCallback : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE BandedDataCallback( - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDataCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDataCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDataCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDataCallback * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *BandedDataCallback )( - IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer); - - END_INTERFACE - } IWiaDataCallbackVtbl; - - interface IWiaDataCallback - { - CONST_VTBL struct IWiaDataCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDataCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDataCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDataCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDataCallback_BandedDataCallback(This,lMessage,lStatus,lPercentComplete,lOffset,lLength,lReserved,lResLength,pbBuffer) \ - ( (This)->lpVtbl -> BandedDataCallback(This,lMessage,lStatus,lPercentComplete,lOffset,lLength,lReserved,lResLength,pbBuffer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_RemoteBandedDataCallback_Proxy( - __RPC__in IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [unique][size_is][in] */ __RPC__in_ecount_full_opt(lResLength) BYTE *pbBuffer); - - -void __RPC_STUB IWiaDataCallback_RemoteBandedDataCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDataCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_lh_0000_0004 */ -/* [local] */ - -typedef struct _WIA_DATA_TRANSFER_INFO - { - ULONG ulSize; - ULONG ulSection; - ULONG ulBufferSize; - BOOL bDoubleBuffer; - ULONG ulReserved1; - ULONG ulReserved2; - ULONG ulReserved3; - } WIA_DATA_TRANSFER_INFO; - -typedef struct _WIA_DATA_TRANSFER_INFO *PWIA_DATA_TRANSFER_INFO; - -typedef struct _WIA_EXTENDED_TRANSFER_INFO - { - ULONG ulSize; - ULONG ulMinBufferSize; - ULONG ulOptimalBufferSize; - ULONG ulMaxBufferSize; - ULONG ulNumBuffers; - } WIA_EXTENDED_TRANSFER_INFO; - -typedef struct _WIA_EXTENDED_TRANSFER_INFO *PWIA_EXTENDED_TRANSFER_INFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0004_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0004_v0_0_s_ifspec; - -#ifndef __IWiaDataTransfer_INTERFACE_DEFINED__ -#define __IWiaDataTransfer_INTERFACE_DEFINED__ - -/* interface IWiaDataTransfer */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDataTransfer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a6cef998-a5b0-11d2-a08f-00c04f72dc3c") - IWiaDataTransfer : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE idtGetData( - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE idtGetBandedData( - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtQueryGetData( - /* [unique][in] */ __RPC__in_opt WIA_FORMAT_INFO *pfe) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtEnumWIA_FORMAT_INFO( - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtGetExtendedTransferInfo( - /* [out] */ __RPC__out PWIA_EXTENDED_TRANSFER_INFO pExtendedTransferInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDataTransferVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDataTransfer * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDataTransfer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDataTransfer * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *idtGetData )( - IWiaDataTransfer * This, - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *idtGetBandedData )( - IWiaDataTransfer * This, - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtQueryGetData )( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt WIA_FORMAT_INFO *pfe); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtEnumWIA_FORMAT_INFO )( - __RPC__in IWiaDataTransfer * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtGetExtendedTransferInfo )( - __RPC__in IWiaDataTransfer * This, - /* [out] */ __RPC__out PWIA_EXTENDED_TRANSFER_INFO pExtendedTransferInfo); - - END_INTERFACE - } IWiaDataTransferVtbl; - - interface IWiaDataTransfer - { - CONST_VTBL struct IWiaDataTransferVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDataTransfer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDataTransfer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDataTransfer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDataTransfer_idtGetData(This,pMedium,pIWiaDataCallback) \ - ( (This)->lpVtbl -> idtGetData(This,pMedium,pIWiaDataCallback) ) - -#define IWiaDataTransfer_idtGetBandedData(This,pWiaDataTransInfo,pIWiaDataCallback) \ - ( (This)->lpVtbl -> idtGetBandedData(This,pWiaDataTransInfo,pIWiaDataCallback) ) - -#define IWiaDataTransfer_idtQueryGetData(This,pfe) \ - ( (This)->lpVtbl -> idtQueryGetData(This,pfe) ) - -#define IWiaDataTransfer_idtEnumWIA_FORMAT_INFO(This,ppEnum) \ - ( (This)->lpVtbl -> idtEnumWIA_FORMAT_INFO(This,ppEnum) ) - -#define IWiaDataTransfer_idtGetExtendedTransferInfo(This,pExtendedTransferInfo) \ - ( (This)->lpVtbl -> idtGetExtendedTransferInfo(This,pExtendedTransferInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetDataEx_Proxy( - __RPC__in IWiaDataTransfer * This, - /* [out][in] */ __RPC__inout LPSTGMEDIUM pMedium, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - - -void __RPC_STUB IWiaDataTransfer_idtGetDataEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedDataEx_Proxy( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - - -void __RPC_STUB IWiaDataTransfer_idtGetBandedDataEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDataTransfer_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaItem_INTERFACE_DEFINED__ -#define __IWiaItem_INTERFACE_DEFINED__ - -/* interface IWiaItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4db1ad10-3391-11d2-9a33-00c04fa36145") - IWiaItem : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetItemType( - /* [out] */ __RPC__out LONG *pItemType) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AnalyzeItem( - /* [in] */ LONG lFlags) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumChildItems( - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnumWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeleteItem( - /* [in] */ LONG lFlags) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateChildItem( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumRegisterEventInfo( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindItemByName( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE DeviceDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeviceCommand( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem **pIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRootItem( - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceCapabilities( - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpDrvItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpTreeItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Diagnostic( - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaItem * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetItemType )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__out LONG *pItemType); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AnalyzeItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumChildItems )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnumWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateChildItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumRegisterEventInfo )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FindItemByName )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *DeviceDlg )( - IWiaItem * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeviceCommand )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem **pIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRootItem )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceCapabilities )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpDrvItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpTreeItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Diagnostic )( - __RPC__in IWiaItem * This, - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer); - - END_INTERFACE - } IWiaItemVtbl; - - interface IWiaItem - { - CONST_VTBL struct IWiaItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaItem_GetItemType(This,pItemType) \ - ( (This)->lpVtbl -> GetItemType(This,pItemType) ) - -#define IWiaItem_AnalyzeItem(This,lFlags) \ - ( (This)->lpVtbl -> AnalyzeItem(This,lFlags) ) - -#define IWiaItem_EnumChildItems(This,ppIEnumWiaItem) \ - ( (This)->lpVtbl -> EnumChildItems(This,ppIEnumWiaItem) ) - -#define IWiaItem_DeleteItem(This,lFlags) \ - ( (This)->lpVtbl -> DeleteItem(This,lFlags) ) - -#define IWiaItem_CreateChildItem(This,lFlags,bstrItemName,bstrFullItemName,ppIWiaItem) \ - ( (This)->lpVtbl -> CreateChildItem(This,lFlags,bstrItemName,bstrFullItemName,ppIWiaItem) ) - -#define IWiaItem_EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) \ - ( (This)->lpVtbl -> EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) ) - -#define IWiaItem_FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem) \ - ( (This)->lpVtbl -> FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem) ) - -#define IWiaItem_DeviceDlg(This,hwndParent,lFlags,lIntent,plItemCount,ppIWiaItem) \ - ( (This)->lpVtbl -> DeviceDlg(This,hwndParent,lFlags,lIntent,plItemCount,ppIWiaItem) ) - -#define IWiaItem_DeviceCommand(This,lFlags,pCmdGUID,pIWiaItem) \ - ( (This)->lpVtbl -> DeviceCommand(This,lFlags,pCmdGUID,pIWiaItem) ) - -#define IWiaItem_GetRootItem(This,ppIWiaItem) \ - ( (This)->lpVtbl -> GetRootItem(This,ppIWiaItem) ) - -#define IWiaItem_EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) \ - ( (This)->lpVtbl -> EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) ) - -#define IWiaItem_DumpItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpItemData(This,bstrData) ) - -#define IWiaItem_DumpDrvItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpDrvItemData(This,bstrData) ) - -#define IWiaItem_DumpTreeItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpTreeItemData(This,bstrData) ) - -#define IWiaItem_Diagnostic(This,ulSize,pBuffer) \ - ( (This)->lpVtbl -> Diagnostic(This,ulSize,pBuffer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem_LocalDeviceDlg_Proxy( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ __RPC__out LONG *plItemCount, - /* [out] */ __RPC__deref_out_opt IWiaItem ***pIWiaItem); - - -void __RPC_STUB IWiaItem_LocalDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaItem_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaPropertyStorage_INTERFACE_DEFINED__ -#define __IWiaPropertyStorage_INTERFACE_DEFINED__ - -/* interface IWiaPropertyStorage */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaPropertyStorage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("98B5E8A0-29CC-491a-AAC0-E6DB4FDCCEB6") - IWiaPropertyStorage : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ReadMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE WriteMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeleteMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReadPropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE WritePropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeletePropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( - /* [in] */ DWORD grfCommitFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Enum( - /* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTimes( - /* [in] */ __RPC__in const FILETIME *pctime, - /* [in] */ __RPC__in const FILETIME *patime, - /* [in] */ __RPC__in const FILETIME *pmtime) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetClass( - /* [in] */ __RPC__in REFCLSID clsid) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stat( - /* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertyAttributes( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) ULONG rgflags[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pulNumProps) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertyStream( - /* [out] */ __RPC__out GUID *pCompatibilityId, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetPropertyStream( - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaPropertyStorageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaPropertyStorage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaPropertyStorage * This); - - HRESULT ( STDMETHODCALLTYPE *ReadMultiple )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *WriteMultiple )( - IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst); - - HRESULT ( STDMETHODCALLTYPE *DeleteMultiple )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]); - - HRESULT ( STDMETHODCALLTYPE *ReadPropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]); - - HRESULT ( STDMETHODCALLTYPE *WritePropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]); - - HRESULT ( STDMETHODCALLTYPE *DeletePropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ DWORD grfCommitFlags); - - HRESULT ( STDMETHODCALLTYPE *Revert )( - __RPC__in IWiaPropertyStorage * This); - - HRESULT ( STDMETHODCALLTYPE *Enum )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum); - - HRESULT ( STDMETHODCALLTYPE *SetTimes )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in const FILETIME *pctime, - /* [in] */ __RPC__in const FILETIME *patime, - /* [in] */ __RPC__in const FILETIME *pmtime); - - HRESULT ( STDMETHODCALLTYPE *SetClass )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in REFCLSID clsid); - - HRESULT ( STDMETHODCALLTYPE *Stat )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyAttributes )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) ULONG rgflags[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out ULONG *pulNumProps); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyStream )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out GUID *pCompatibilityId, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SetPropertyStream )( - IWiaPropertyStorage * This, - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream); - - END_INTERFACE - } IWiaPropertyStorageVtbl; - - interface IWiaPropertyStorage - { - CONST_VTBL struct IWiaPropertyStorageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaPropertyStorage_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaPropertyStorage_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaPropertyStorage_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaPropertyStorage_ReadMultiple(This,cpspec,rgpspec,rgpropvar) \ - ( (This)->lpVtbl -> ReadMultiple(This,cpspec,rgpspec,rgpropvar) ) - -#define IWiaPropertyStorage_WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) \ - ( (This)->lpVtbl -> WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) ) - -#define IWiaPropertyStorage_DeleteMultiple(This,cpspec,rgpspec) \ - ( (This)->lpVtbl -> DeleteMultiple(This,cpspec,rgpspec) ) - -#define IWiaPropertyStorage_ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) \ - ( (This)->lpVtbl -> ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) ) - -#define IWiaPropertyStorage_WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) \ - ( (This)->lpVtbl -> WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) ) - -#define IWiaPropertyStorage_DeletePropertyNames(This,cpropid,rgpropid) \ - ( (This)->lpVtbl -> DeletePropertyNames(This,cpropid,rgpropid) ) - -#define IWiaPropertyStorage_Commit(This,grfCommitFlags) \ - ( (This)->lpVtbl -> Commit(This,grfCommitFlags) ) - -#define IWiaPropertyStorage_Revert(This) \ - ( (This)->lpVtbl -> Revert(This) ) - -#define IWiaPropertyStorage_Enum(This,ppenum) \ - ( (This)->lpVtbl -> Enum(This,ppenum) ) - -#define IWiaPropertyStorage_SetTimes(This,pctime,patime,pmtime) \ - ( (This)->lpVtbl -> SetTimes(This,pctime,patime,pmtime) ) - -#define IWiaPropertyStorage_SetClass(This,clsid) \ - ( (This)->lpVtbl -> SetClass(This,clsid) ) - -#define IWiaPropertyStorage_Stat(This,pstatpsstg) \ - ( (This)->lpVtbl -> Stat(This,pstatpsstg) ) - -#define IWiaPropertyStorage_GetPropertyAttributes(This,cpspec,rgpspec,rgflags,rgpropvar) \ - ( (This)->lpVtbl -> GetPropertyAttributes(This,cpspec,rgpspec,rgflags,rgpropvar) ) - -#define IWiaPropertyStorage_GetCount(This,pulNumProps) \ - ( (This)->lpVtbl -> GetCount(This,pulNumProps) ) - -#define IWiaPropertyStorage_GetPropertyStream(This,pCompatibilityId,ppIStream) \ - ( (This)->lpVtbl -> GetPropertyStream(This,pCompatibilityId,ppIStream) ) - -#define IWiaPropertyStorage_SetPropertyStream(This,pCompatibilityId,pIStream) \ - ( (This)->lpVtbl -> SetPropertyStream(This,pCompatibilityId,pIStream) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_RemoteWriteMultiple_Proxy( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC *rgpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT *rgpropvar, - /* [in] */ PROPID propidNameFirst); - - -void __RPC_STUB IWiaPropertyStorage_RemoteWriteMultiple_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_RemoteSetPropertyStream_Proxy( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in GUID *pCompatibilityId, - /* [unique][in] */ __RPC__in_opt IStream *pIStream); - - -void __RPC_STUB IWiaPropertyStorage_RemoteSetPropertyStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaPropertyStorage_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWiaItem_INTERFACE_DEFINED__ -#define __IEnumWiaItem_INTERFACE_DEFINED__ - -/* interface IEnumWiaItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWiaItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5e8383fc-3391-11d2-9a33-00c04fa36145") - IEnumWiaItem : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *celt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWiaItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWiaItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWiaItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWiaItem * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWiaItem * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWiaItem * This, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWiaItem * This, - /* [out] */ __RPC__out ULONG *celt); - - END_INTERFACE - } IEnumWiaItemVtbl; - - interface IEnumWiaItem - { - CONST_VTBL struct IEnumWiaItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWiaItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWiaItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWiaItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWiaItem_Next(This,celt,ppIWiaItem,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,ppIWiaItem,pceltFetched) ) - -#define IEnumWiaItem_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWiaItem_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWiaItem_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWiaItem_GetCount(This,celt) \ - ( (This)->lpVtbl -> GetCount(This,celt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_RemoteNext_Proxy( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaItem **ppIWiaItem, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWiaItem_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWiaItem_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_lh_0000_0008 */ -/* [local] */ - -typedef struct _WIA_DEV_CAP - { - GUID guid; - ULONG ulFlags; - BSTR bstrName; - BSTR bstrDescription; - BSTR bstrIcon; - BSTR bstrCommandline; - } WIA_DEV_CAP; - -typedef struct _WIA_DEV_CAP *PWIA_DEV_CAP; - -typedef struct _WIA_DEV_CAP WIA_EVENT_HANDLER; - -typedef struct _WIA_DEV_CAP *PWIA_EVENT_HANDLER; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0008_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0008_v0_0_s_ifspec; - -#ifndef __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ -#define __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ - -/* interface IEnumWIA_DEV_CAPS */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_DEV_CAPS; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1fcc4287-aca6-11d2-a093-00c04f72dc3c") - IEnumWIA_DEV_CAPS : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pcelt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_DEV_CAPSVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [out] */ __RPC__out ULONG *pcelt); - - END_INTERFACE - } IEnumWIA_DEV_CAPSVtbl; - - interface IEnumWIA_DEV_CAPS - { - CONST_VTBL struct IEnumWIA_DEV_CAPSVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_DEV_CAPS_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_DEV_CAPS_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_DEV_CAPS_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_DEV_CAPS_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_DEV_CAPS_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_DEV_CAPS_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_DEV_CAPS_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_DEV_CAPS_GetCount(This,pcelt) \ - ( (This)->lpVtbl -> GetCount(This,pcelt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_RemoteNext_Proxy( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_DEV_CAPS_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ -#define __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ - -/* interface IEnumWIA_FORMAT_INFO */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_FORMAT_INFO; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("81BEFC5B-656D-44f1-B24C-D41D51B4DC81") - IEnumWIA_FORMAT_INFO : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pcelt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_FORMAT_INFOVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [out] */ __RPC__out ULONG *pcelt); - - END_INTERFACE - } IEnumWIA_FORMAT_INFOVtbl; - - interface IEnumWIA_FORMAT_INFO - { - CONST_VTBL struct IEnumWIA_FORMAT_INFOVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_FORMAT_INFO_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_FORMAT_INFO_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_FORMAT_INFO_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_FORMAT_INFO_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_FORMAT_INFO_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_FORMAT_INFO_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_FORMAT_INFO_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_FORMAT_INFO_GetCount(This,pcelt) \ - ( (This)->lpVtbl -> GetCount(This,pcelt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_RemoteNext_Proxy( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_FORMAT_INFO_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaLog_INTERFACE_DEFINED__ -#define __IWiaLog_INTERFACE_DEFINED__ - -/* interface IWiaLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A00C10B6-82A1-452f-8B6C-86062AAD6890") - IWiaLog : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InitializeLog( - /* [in] */ LONG hInstance) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResult( - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Log( - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaLog * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InitializeLog )( - __RPC__in IWiaLog * This, - /* [in] */ LONG hInstance); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResult )( - __RPC__in IWiaLog * This, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Log )( - __RPC__in IWiaLog * This, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - END_INTERFACE - } IWiaLogVtbl; - - interface IWiaLog - { - CONST_VTBL struct IWiaLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaLog_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaLog_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaLog_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaLog_InitializeLog(This,hInstance) \ - ( (This)->lpVtbl -> InitializeLog(This,hInstance) ) - -#define IWiaLog_hResult(This,hResult) \ - ( (This)->lpVtbl -> hResult(This,hResult) ) - -#define IWiaLog_Log(This,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> Log(This,lFlags,lResID,lDetail,bstrText) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaLog_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaLogEx_INTERFACE_DEFINED__ -#define __IWiaLogEx_INTERFACE_DEFINED__ - -/* interface IWiaLogEx */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaLogEx; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AF1F22AC-7A40-4787-B421-AEb47A1FBD0B") - IWiaLogEx : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InitializeLogEx( - /* [in] */ __RPC__in BYTE *hInstance) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResult( - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Log( - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResultEx( - /* [in] */ LONG lMethodId, - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogEx( - /* [in] */ LONG lMethodId, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaLogExVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaLogEx * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaLogEx * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaLogEx * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InitializeLogEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ __RPC__in BYTE *hInstance); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResult )( - __RPC__in IWiaLogEx * This, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Log )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResultEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lMethodId, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lMethodId, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - END_INTERFACE - } IWiaLogExVtbl; - - interface IWiaLogEx - { - CONST_VTBL struct IWiaLogExVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaLogEx_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaLogEx_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaLogEx_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaLogEx_InitializeLogEx(This,hInstance) \ - ( (This)->lpVtbl -> InitializeLogEx(This,hInstance) ) - -#define IWiaLogEx_hResult(This,hResult) \ - ( (This)->lpVtbl -> hResult(This,hResult) ) - -#define IWiaLogEx_Log(This,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> Log(This,lFlags,lResID,lDetail,bstrText) ) - -#define IWiaLogEx_hResultEx(This,lMethodId,hResult) \ - ( (This)->lpVtbl -> hResultEx(This,lMethodId,hResult) ) - -#define IWiaLogEx_LogEx(This,lMethodId,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> LogEx(This,lMethodId,lFlags,lResID,lDetail,bstrText) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaLogEx_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaNotifyDevMgr_INTERFACE_DEFINED__ -#define __IWiaNotifyDevMgr_INTERFACE_DEFINED__ - -/* interface IWiaNotifyDevMgr */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaNotifyDevMgr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("70681EA0-E7BF-4291-9FB1-4E8813A3F78E") - IWiaNotifyDevMgr : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE NewDeviceArrival( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaNotifyDevMgrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaNotifyDevMgr * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaNotifyDevMgr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaNotifyDevMgr * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *NewDeviceArrival )( - __RPC__in IWiaNotifyDevMgr * This); - - END_INTERFACE - } IWiaNotifyDevMgrVtbl; - - interface IWiaNotifyDevMgr - { - CONST_VTBL struct IWiaNotifyDevMgrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaNotifyDevMgr_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaNotifyDevMgr_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaNotifyDevMgr_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaNotifyDevMgr_NewDeviceArrival(This) \ - ( (This)->lpVtbl -> NewDeviceArrival(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaNotifyDevMgr_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaItemExtras_INTERFACE_DEFINED__ -#define __IWiaItemExtras_INTERFACE_DEFINED__ - -/* interface IWiaItemExtras */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaItemExtras; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6291ef2c-36ef-4532-876a-8e132593778d") - IWiaItemExtras : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetExtendedErrorInfo( - /* [out] */ __RPC__deref_out_opt BSTR *bstrErrorText) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Escape( - /* [in] */ DWORD dwEscapeCode, - /* [size_is][in] */ __RPC__in_ecount_full(cbInDataSize) BYTE *lpInData, - /* [in] */ DWORD cbInDataSize, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutDataSize, pdwActualDataSize ? *pdwActualDataSize : dwOutDataSize) BYTE *pOutData, - /* [in] */ DWORD dwOutDataSize, - /* [out] */ __RPC__out DWORD *pdwActualDataSize) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CancelPendingIO( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaItemExtrasVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaItemExtras * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaItemExtras * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaItemExtras * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetExtendedErrorInfo )( - __RPC__in IWiaItemExtras * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrErrorText); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Escape )( - __RPC__in IWiaItemExtras * This, - /* [in] */ DWORD dwEscapeCode, - /* [size_is][in] */ __RPC__in_ecount_full(cbInDataSize) BYTE *lpInData, - /* [in] */ DWORD cbInDataSize, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutDataSize, pdwActualDataSize ? *pdwActualDataSize : dwOutDataSize) BYTE *pOutData, - /* [in] */ DWORD dwOutDataSize, - /* [out] */ __RPC__out DWORD *pdwActualDataSize); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CancelPendingIO )( - __RPC__in IWiaItemExtras * This); - - END_INTERFACE - } IWiaItemExtrasVtbl; - - interface IWiaItemExtras - { - CONST_VTBL struct IWiaItemExtrasVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaItemExtras_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaItemExtras_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaItemExtras_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaItemExtras_GetExtendedErrorInfo(This,bstrErrorText) \ - ( (This)->lpVtbl -> GetExtendedErrorInfo(This,bstrErrorText) ) - -#define IWiaItemExtras_Escape(This,dwEscapeCode,lpInData,cbInDataSize,pOutData,dwOutDataSize,pdwActualDataSize) \ - ( (This)->lpVtbl -> Escape(This,dwEscapeCode,lpInData,cbInDataSize,pOutData,dwOutDataSize,pdwActualDataSize) ) - -#define IWiaItemExtras_CancelPendingIO(This) \ - ( (This)->lpVtbl -> CancelPendingIO(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaItemExtras_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaAppErrorHandler_INTERFACE_DEFINED__ -#define __IWiaAppErrorHandler_INTERFACE_DEFINED__ - -/* interface IWiaAppErrorHandler */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaAppErrorHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6C16186C-D0A6-400c-80F4-D26986A0E734") - IWiaAppErrorHandler : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetWindow( - /* [out] */ __RPC__deref_out_opt HWND *phwnd) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ReportStatus( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [in] */ LONG lPercentComplete) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaAppErrorHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaAppErrorHandler * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaAppErrorHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaAppErrorHandler * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetWindow )( - __RPC__in IWiaAppErrorHandler * This, - /* [out] */ __RPC__deref_out_opt HWND *phwnd); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ReportStatus )( - __RPC__in IWiaAppErrorHandler * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [in] */ LONG lPercentComplete); - - END_INTERFACE - } IWiaAppErrorHandlerVtbl; - - interface IWiaAppErrorHandler - { - CONST_VTBL struct IWiaAppErrorHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaAppErrorHandler_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaAppErrorHandler_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaAppErrorHandler_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaAppErrorHandler_GetWindow(This,phwnd) \ - ( (This)->lpVtbl -> GetWindow(This,phwnd) ) - -#define IWiaAppErrorHandler_ReportStatus(This,lFlags,pWiaItem2,hrStatus,lPercentComplete) \ - ( (This)->lpVtbl -> ReportStatus(This,lFlags,pWiaItem2,hrStatus,lPercentComplete) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaAppErrorHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaErrorHandler_INTERFACE_DEFINED__ -#define __IWiaErrorHandler_INTERFACE_DEFINED__ - -/* interface IWiaErrorHandler */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaErrorHandler; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("0e4a51b1-bc1f-443d-a835-72e890759ef3") - IWiaErrorHandler : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE ReportStatus( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [in] */ LONG lPercentComplete) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetStatusDescription( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [out] */ __RPC__deref_out_opt BSTR *pbstrDescription) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaErrorHandlerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaErrorHandler * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaErrorHandler * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaErrorHandler * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *ReportStatus )( - __RPC__in IWiaErrorHandler * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [in] */ LONG lPercentComplete); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetStatusDescription )( - __RPC__in IWiaErrorHandler * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ HRESULT hrStatus, - /* [out] */ __RPC__deref_out_opt BSTR *pbstrDescription); - - END_INTERFACE - } IWiaErrorHandlerVtbl; - - interface IWiaErrorHandler - { - CONST_VTBL struct IWiaErrorHandlerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaErrorHandler_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaErrorHandler_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaErrorHandler_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaErrorHandler_ReportStatus(This,lFlags,hwndParent,pWiaItem2,hrStatus,lPercentComplete) \ - ( (This)->lpVtbl -> ReportStatus(This,lFlags,hwndParent,pWiaItem2,hrStatus,lPercentComplete) ) - -#define IWiaErrorHandler_GetStatusDescription(This,lFlags,pWiaItem2,hrStatus,pbstrDescription) \ - ( (This)->lpVtbl -> GetStatusDescription(This,lFlags,pWiaItem2,hrStatus,pbstrDescription) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaErrorHandler_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaTransfer_INTERFACE_DEFINED__ -#define __IWiaTransfer_INTERFACE_DEFINED__ - -/* interface IWiaTransfer */ -/* [helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaTransfer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("c39d6942-2f4e-4d04-92fe-4ef4d3a1de5a") - IWiaTransfer : public IUnknown - { - public: - virtual /* [helpstring][local] */ HRESULT STDMETHODCALLTYPE Download( - /* [in] */ LONG lFlags, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback) = 0; - - virtual /* [helpstring][local] */ HRESULT STDMETHODCALLTYPE Upload( - /* [in] */ LONG lFlags, - /* [in] */ IStream *pSource, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Cancel( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumWIA_FORMAT_INFO( - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaTransferVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaTransfer * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaTransfer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaTransfer * This); - - /* [helpstring][local] */ HRESULT ( STDMETHODCALLTYPE *Download )( - IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback); - - /* [helpstring][local] */ HRESULT ( STDMETHODCALLTYPE *Upload )( - IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ IStream *pSource, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Cancel )( - __RPC__in IWiaTransfer * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumWIA_FORMAT_INFO )( - __RPC__in IWiaTransfer * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum); - - END_INTERFACE - } IWiaTransferVtbl; - - interface IWiaTransfer - { - CONST_VTBL struct IWiaTransferVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaTransfer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaTransfer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaTransfer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaTransfer_Download(This,lFlags,pIWiaTransferCallback) \ - ( (This)->lpVtbl -> Download(This,lFlags,pIWiaTransferCallback) ) - -#define IWiaTransfer_Upload(This,lFlags,pSource,pIWiaTransferCallback) \ - ( (This)->lpVtbl -> Upload(This,lFlags,pSource,pIWiaTransferCallback) ) - -#define IWiaTransfer_Cancel(This) \ - ( (This)->lpVtbl -> Cancel(This) ) - -#define IWiaTransfer_EnumWIA_FORMAT_INFO(This,ppEnum) \ - ( (This)->lpVtbl -> EnumWIA_FORMAT_INFO(This,ppEnum) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_RemoteDownload_Proxy( - __RPC__in IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pIWiaTransferCallback); - - -void __RPC_STUB IWiaTransfer_RemoteDownload_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_RemoteUpload_Proxy( - __RPC__in IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IStream *pSource, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pIWiaTransferCallback); - - -void __RPC_STUB IWiaTransfer_RemoteUpload_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaTransfer_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_lh_0000_0017 */ -/* [local] */ - -typedef struct _WiaTransferParams - { - LONG lMessage; - LONG lPercentComplete; - ULONG64 ulTransferredBytes; - HRESULT hrErrorStatus; - } WiaTransferParams; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0017_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_lh_0000_0017_v0_0_s_ifspec; - -#ifndef __IWiaTransferCallback_INTERFACE_DEFINED__ -#define __IWiaTransferCallback_INTERFACE_DEFINED__ - -/* interface IWiaTransferCallback */ -/* [helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaTransferCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("27d4eaaf-28a6-4ca5-9aab-e678168b9527") - IWiaTransferCallback : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE TransferCallback( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in WiaTransferParams *pWiaTransferParams) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextStream( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IStream **ppDestination) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaTransferCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaTransferCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaTransferCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaTransferCallback * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *TransferCallback )( - __RPC__in IWiaTransferCallback * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in WiaTransferParams *pWiaTransferParams); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextStream )( - __RPC__in IWiaTransferCallback * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IStream **ppDestination); - - END_INTERFACE - } IWiaTransferCallbackVtbl; - - interface IWiaTransferCallback - { - CONST_VTBL struct IWiaTransferCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaTransferCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaTransferCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaTransferCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaTransferCallback_TransferCallback(This,lFlags,pWiaTransferParams) \ - ( (This)->lpVtbl -> TransferCallback(This,lFlags,pWiaTransferParams) ) - -#define IWiaTransferCallback_GetNextStream(This,lFlags,bstrItemName,bstrFullItemName,ppDestination) \ - ( (This)->lpVtbl -> GetNextStream(This,lFlags,bstrItemName,bstrFullItemName,ppDestination) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaTransferCallback_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaSegmentationFilter_INTERFACE_DEFINED__ -#define __IWiaSegmentationFilter_INTERFACE_DEFINED__ - -/* interface IWiaSegmentationFilter */ -/* [helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaSegmentationFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("EC46A697-AC04-4447-8F65-FF63D5154B21") - IWiaSegmentationFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE DetectRegions( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IStream *pInputStream, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaSegmentationFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaSegmentationFilter * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaSegmentationFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaSegmentationFilter * This); - - HRESULT ( STDMETHODCALLTYPE *DetectRegions )( - __RPC__in IWiaSegmentationFilter * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IStream *pInputStream, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2); - - END_INTERFACE - } IWiaSegmentationFilterVtbl; - - interface IWiaSegmentationFilter - { - CONST_VTBL struct IWiaSegmentationFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaSegmentationFilter_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaSegmentationFilter_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaSegmentationFilter_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaSegmentationFilter_DetectRegions(This,lFlags,pInputStream,pWiaItem2) \ - ( (This)->lpVtbl -> DetectRegions(This,lFlags,pInputStream,pWiaItem2) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaSegmentationFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaImageFilter_INTERFACE_DEFINED__ -#define __IWiaImageFilter_INTERFACE_DEFINED__ - -/* interface IWiaImageFilter */ -/* [helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaImageFilter; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A8A79FFA-450B-41f1-8F87-849CCD94EBF6") - IWiaImageFilter : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE InitializeFilter( - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetNewCallback( - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE FilterPreviewImage( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaChildItem2, - /* [in] */ RECT InputImageExtents, - /* [in] */ __RPC__in_opt IStream *pInputStream) = 0; - - virtual HRESULT STDMETHODCALLTYPE ApplyProperties( - /* [in] */ __RPC__in_opt IWiaPropertyStorage *pWiaPropertyStorage) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaImageFilterVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaImageFilter * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaImageFilter * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaImageFilter * This); - - HRESULT ( STDMETHODCALLTYPE *InitializeFilter )( - __RPC__in IWiaImageFilter * This, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback); - - HRESULT ( STDMETHODCALLTYPE *SetNewCallback )( - __RPC__in IWiaImageFilter * This, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback); - - HRESULT ( STDMETHODCALLTYPE *FilterPreviewImage )( - __RPC__in IWiaImageFilter * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaChildItem2, - /* [in] */ RECT InputImageExtents, - /* [in] */ __RPC__in_opt IStream *pInputStream); - - HRESULT ( STDMETHODCALLTYPE *ApplyProperties )( - __RPC__in IWiaImageFilter * This, - /* [in] */ __RPC__in_opt IWiaPropertyStorage *pWiaPropertyStorage); - - END_INTERFACE - } IWiaImageFilterVtbl; - - interface IWiaImageFilter - { - CONST_VTBL struct IWiaImageFilterVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaImageFilter_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaImageFilter_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaImageFilter_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaImageFilter_InitializeFilter(This,pWiaItem2,pWiaTransferCallback) \ - ( (This)->lpVtbl -> InitializeFilter(This,pWiaItem2,pWiaTransferCallback) ) - -#define IWiaImageFilter_SetNewCallback(This,pWiaTransferCallback) \ - ( (This)->lpVtbl -> SetNewCallback(This,pWiaTransferCallback) ) - -#define IWiaImageFilter_FilterPreviewImage(This,lFlags,pWiaChildItem2,InputImageExtents,pInputStream) \ - ( (This)->lpVtbl -> FilterPreviewImage(This,lFlags,pWiaChildItem2,InputImageExtents,pInputStream) ) - -#define IWiaImageFilter_ApplyProperties(This,pWiaPropertyStorage) \ - ( (This)->lpVtbl -> ApplyProperties(This,pWiaPropertyStorage) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaImageFilter_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaPreview_INTERFACE_DEFINED__ -#define __IWiaPreview_INTERFACE_DEFINED__ - -/* interface IWiaPreview */ -/* [helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaPreview; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("95C2B4FD-33F2-4d86-AD40-9431F0DF08F7") - IWiaPreview : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetNewPreview( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE UpdatePreview( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pChildWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback) = 0; - - virtual HRESULT STDMETHODCALLTYPE DetectRegions( - /* [in] */ LONG lFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Clear( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaPreviewVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaPreview * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaPreview * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaPreview * This); - - HRESULT ( STDMETHODCALLTYPE *GetNewPreview )( - __RPC__in IWiaPreview * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback); - - HRESULT ( STDMETHODCALLTYPE *UpdatePreview )( - __RPC__in IWiaPreview * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaItem2 *pChildWiaItem2, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pWiaTransferCallback); - - HRESULT ( STDMETHODCALLTYPE *DetectRegions )( - __RPC__in IWiaPreview * This, - /* [in] */ LONG lFlags); - - HRESULT ( STDMETHODCALLTYPE *Clear )( - __RPC__in IWiaPreview * This); - - END_INTERFACE - } IWiaPreviewVtbl; - - interface IWiaPreview - { - CONST_VTBL struct IWiaPreviewVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaPreview_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaPreview_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaPreview_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaPreview_GetNewPreview(This,lFlags,pWiaItem2,pWiaTransferCallback) \ - ( (This)->lpVtbl -> GetNewPreview(This,lFlags,pWiaItem2,pWiaTransferCallback) ) - -#define IWiaPreview_UpdatePreview(This,lFlags,pChildWiaItem2,pWiaTransferCallback) \ - ( (This)->lpVtbl -> UpdatePreview(This,lFlags,pChildWiaItem2,pWiaTransferCallback) ) - -#define IWiaPreview_DetectRegions(This,lFlags) \ - ( (This)->lpVtbl -> DetectRegions(This,lFlags) ) - -#define IWiaPreview_Clear(This) \ - ( (This)->lpVtbl -> Clear(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaPreview_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWiaItem2_INTERFACE_DEFINED__ -#define __IEnumWiaItem2_INTERFACE_DEFINED__ - -/* interface IEnumWiaItem2 */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWiaItem2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("59970AF4-CD0D-44d9-AB24-52295630E582") - IEnumWiaItem2 : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG cElt, - /* [length_is][size_is][out] */ IWiaItem2 **ppIWiaItem2, - /* [unique][out][in] */ ULONG *pcEltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG cElt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWiaItem2 **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *cElt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWiaItem2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWiaItem2 * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWiaItem2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWiaItem2 * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWiaItem2 * This, - /* [in] */ ULONG cElt, - /* [length_is][size_is][out] */ IWiaItem2 **ppIWiaItem2, - /* [unique][out][in] */ ULONG *pcEltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWiaItem2 * This, - /* [in] */ ULONG cElt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWiaItem2 * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWiaItem2 * This, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem2 **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWiaItem2 * This, - /* [out] */ __RPC__out ULONG *cElt); - - END_INTERFACE - } IEnumWiaItem2Vtbl; - - interface IEnumWiaItem2 - { - CONST_VTBL struct IEnumWiaItem2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWiaItem2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWiaItem2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWiaItem2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWiaItem2_Next(This,cElt,ppIWiaItem2,pcEltFetched) \ - ( (This)->lpVtbl -> Next(This,cElt,ppIWiaItem2,pcEltFetched) ) - -#define IEnumWiaItem2_Skip(This,cElt) \ - ( (This)->lpVtbl -> Skip(This,cElt) ) - -#define IEnumWiaItem2_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWiaItem2_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWiaItem2_GetCount(This,cElt) \ - ( (This)->lpVtbl -> GetCount(This,cElt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem2_RemoteNext_Proxy( - __RPC__in IEnumWiaItem2 * This, - /* [in] */ ULONG cElt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(cElt, *pcEltFetched) IWiaItem2 **ppIWiaItem2, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pcEltFetched); - - -void __RPC_STUB IEnumWiaItem2_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWiaItem2_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaItem2_INTERFACE_DEFINED__ -#define __IWiaItem2_INTERFACE_DEFINED__ - -/* interface IWiaItem2 */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaItem2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6CBA0075-1287-407d-9B77-CF0E030435CC") - IWiaItem2 : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateChildItem( - /* [in] */ LONG lItemFlags, - /* [in] */ LONG lCreationFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeleteItem( - /* [in] */ LONG lFlags) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumChildItems( - /* [unique][in] */ __RPC__in_opt const GUID *pCategoryGUID, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem2 **ppIEnumWiaItem2) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindItemByName( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetItemCategory( - /* [out] */ __RPC__out GUID *pItemCategoryGUID) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetItemType( - /* [out] */ __RPC__out LONG *pItemType) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE DeviceDlg( - /* [annotation][in] */ - __in LONG lFlags, - /* [annotation][in] */ - __in HWND hwndParent, - /* [annotation][in] */ - __in BSTR bstrFolderName, - /* [annotation][in] */ - __in BSTR bstrFilename, - /* [annotation][out] */ - __out LONG *plNumFiles, - /* [annotation][size_is][size_is][out] */ - __deref_out_ecount(*plNumFiles) BSTR **ppbstrFilePaths, - /* [annotation][out][in] */ - __out_opt IWiaItem2 **ppItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeviceCommand( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppIWiaItem2) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceCapabilities( - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE CheckExtension( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [out] */ BOOL *pbExtensionExists) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetExtension( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [iid_is][out] */ void **ppOut) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetParentItem( - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRootItem( - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetPreviewComponent( - /* [in] */ LONG lFlags, - /* [out] */ IWiaPreview **ppWiaPreview) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumRegisterEventInfo( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Diagnostic( - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaItem2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaItem2 * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaItem2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaItem2 * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateChildItem )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lItemFlags, - /* [in] */ LONG lCreationFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumChildItems )( - __RPC__in IWiaItem2 * This, - /* [unique][in] */ __RPC__in_opt const GUID *pCategoryGUID, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem2 **ppIEnumWiaItem2); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FindItemByName )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetItemCategory )( - __RPC__in IWiaItem2 * This, - /* [out] */ __RPC__out GUID *pItemCategoryGUID); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetItemType )( - __RPC__in IWiaItem2 * This, - /* [out] */ __RPC__out LONG *pItemType); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *DeviceDlg )( - IWiaItem2 * This, - /* [annotation][in] */ - __in LONG lFlags, - /* [annotation][in] */ - __in HWND hwndParent, - /* [annotation][in] */ - __in BSTR bstrFolderName, - /* [annotation][in] */ - __in BSTR bstrFilename, - /* [annotation][out] */ - __out LONG *plNumFiles, - /* [annotation][size_is][size_is][out] */ - __deref_out_ecount(*plNumFiles) BSTR **ppbstrFilePaths, - /* [annotation][out][in] */ - __out_opt IWiaItem2 **ppItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeviceCommand )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppIWiaItem2); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceCapabilities )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *CheckExtension )( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [out] */ BOOL *pbExtensionExists); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetExtension )( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [iid_is][out] */ void **ppOut); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetParentItem )( - __RPC__in IWiaItem2 * This, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRootItem )( - __RPC__in IWiaItem2 * This, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppIWiaItem2); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetPreviewComponent )( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [out] */ IWiaPreview **ppWiaPreview); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumRegisterEventInfo )( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Diagnostic )( - __RPC__in IWiaItem2 * This, - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer); - - END_INTERFACE - } IWiaItem2Vtbl; - - interface IWiaItem2 - { - CONST_VTBL struct IWiaItem2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaItem2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaItem2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaItem2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaItem2_CreateChildItem(This,lItemFlags,lCreationFlags,bstrItemName,ppIWiaItem2) \ - ( (This)->lpVtbl -> CreateChildItem(This,lItemFlags,lCreationFlags,bstrItemName,ppIWiaItem2) ) - -#define IWiaItem2_DeleteItem(This,lFlags) \ - ( (This)->lpVtbl -> DeleteItem(This,lFlags) ) - -#define IWiaItem2_EnumChildItems(This,pCategoryGUID,ppIEnumWiaItem2) \ - ( (This)->lpVtbl -> EnumChildItems(This,pCategoryGUID,ppIEnumWiaItem2) ) - -#define IWiaItem2_FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem2) \ - ( (This)->lpVtbl -> FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem2) ) - -#define IWiaItem2_GetItemCategory(This,pItemCategoryGUID) \ - ( (This)->lpVtbl -> GetItemCategory(This,pItemCategoryGUID) ) - -#define IWiaItem2_GetItemType(This,pItemType) \ - ( (This)->lpVtbl -> GetItemType(This,pItemType) ) - -#define IWiaItem2_DeviceDlg(This,lFlags,hwndParent,bstrFolderName,bstrFilename,plNumFiles,ppbstrFilePaths,ppItem) \ - ( (This)->lpVtbl -> DeviceDlg(This,lFlags,hwndParent,bstrFolderName,bstrFilename,plNumFiles,ppbstrFilePaths,ppItem) ) - -#define IWiaItem2_DeviceCommand(This,lFlags,pCmdGUID,ppIWiaItem2) \ - ( (This)->lpVtbl -> DeviceCommand(This,lFlags,pCmdGUID,ppIWiaItem2) ) - -#define IWiaItem2_EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) \ - ( (This)->lpVtbl -> EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) ) - -#define IWiaItem2_CheckExtension(This,lFlags,bstrName,riidExtensionInterface,pbExtensionExists) \ - ( (This)->lpVtbl -> CheckExtension(This,lFlags,bstrName,riidExtensionInterface,pbExtensionExists) ) - -#define IWiaItem2_GetExtension(This,lFlags,bstrName,riidExtensionInterface,ppOut) \ - ( (This)->lpVtbl -> GetExtension(This,lFlags,bstrName,riidExtensionInterface,ppOut) ) - -#define IWiaItem2_GetParentItem(This,ppIWiaItem2) \ - ( (This)->lpVtbl -> GetParentItem(This,ppIWiaItem2) ) - -#define IWiaItem2_GetRootItem(This,ppIWiaItem2) \ - ( (This)->lpVtbl -> GetRootItem(This,ppIWiaItem2) ) - -#define IWiaItem2_GetPreviewComponent(This,lFlags,ppWiaPreview) \ - ( (This)->lpVtbl -> GetPreviewComponent(This,lFlags,ppWiaPreview) ) - -#define IWiaItem2_EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) \ - ( (This)->lpVtbl -> EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) ) - -#define IWiaItem2_Diagnostic(This,ulSize,pBuffer) \ - ( (This)->lpVtbl -> Diagnostic(This,ulSize,pBuffer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_LocalDeviceDlg_Proxy( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in BSTR bstrFolderName, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out] */ __RPC__out LONG *plNumFiles, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*plNumFiles) BSTR **ppbstrFilePaths, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppItem); - - -void __RPC_STUB IWiaItem2_LocalDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_RemoteCheckExtension_Proxy( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in REFIID riidExtensionInterface, - /* [out] */ __RPC__out BOOL *pbExtensionExists); - - -void __RPC_STUB IWiaItem2_RemoteCheckExtension_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_RemoteGetExtension_Proxy( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in REFIID riidExtensionInterface, - /* [iid_is][out] */ __RPC__deref_out_opt void **ppOut); - - -void __RPC_STUB IWiaItem2_RemoteGetExtension_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_RemoteGetPreviewComponent_Proxy( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IWiaPreview **ppWiaPreview); - - -void __RPC_STUB IWiaItem2_RemoteGetPreviewComponent_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaItem2_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaDevMgr2_INTERFACE_DEFINED__ -#define __IWiaDevMgr2_INTERFACE_DEFINED__ - -/* interface IWiaDevMgr2 */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDevMgr2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("79C07CF1-CBDD-41ee-8EC3-F00080CADA7A") - IWiaDevMgr2 : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceInfo( - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE CreateDevice( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem2 **ppWiaItem2Root) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem2 **ppItemRoot) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlgID( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackInterface( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackProgram( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrFullAppName, - /* [in] */ BSTR bstrCommandLineArg, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackCLSID( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetImageDlg( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ HWND hwndParent, - /* [in] */ BSTR bstrFolderName, - /* [in] */ BSTR bstrFilename, - /* [out] */ LONG *plNumFiles, - /* [size_is][size_is][out] */ BSTR **ppbstrFilePaths, - /* [out][in] */ IWiaItem2 **ppItem) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDevMgr2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDevMgr2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDevMgr2 * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceInfo )( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *CreateDevice )( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem2 **ppWiaItem2Root); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlg )( - IWiaDevMgr2 * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem2 **ppItemRoot); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlgID )( - IWiaDevMgr2 * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackInterface )( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackProgram )( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrFullAppName, - /* [in] */ BSTR bstrCommandLineArg, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackCLSID )( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetImageDlg )( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ HWND hwndParent, - /* [in] */ BSTR bstrFolderName, - /* [in] */ BSTR bstrFilename, - /* [out] */ LONG *plNumFiles, - /* [size_is][size_is][out] */ BSTR **ppbstrFilePaths, - /* [out][in] */ IWiaItem2 **ppItem); - - END_INTERFACE - } IWiaDevMgr2Vtbl; - - interface IWiaDevMgr2 - { - CONST_VTBL struct IWiaDevMgr2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDevMgr2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDevMgr2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDevMgr2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDevMgr2_EnumDeviceInfo(This,lFlags,ppIEnum) \ - ( (This)->lpVtbl -> EnumDeviceInfo(This,lFlags,ppIEnum) ) - -#define IWiaDevMgr2_CreateDevice(This,lFlags,bstrDeviceID,ppWiaItem2Root) \ - ( (This)->lpVtbl -> CreateDevice(This,lFlags,bstrDeviceID,ppWiaItem2Root) ) - -#define IWiaDevMgr2_SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) \ - ( (This)->lpVtbl -> SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) ) - -#define IWiaDevMgr2_SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) \ - ( (This)->lpVtbl -> SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) ) - -#define IWiaDevMgr2_RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) \ - ( (This)->lpVtbl -> RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) ) - -#define IWiaDevMgr2_RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrFullAppName,bstrCommandLineArg,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrFullAppName,bstrCommandLineArg,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr2_RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr2_GetImageDlg(This,lFlags,bstrDeviceID,hwndParent,bstrFolderName,bstrFilename,plNumFiles,ppbstrFilePaths,ppItem) \ - ( (This)->lpVtbl -> GetImageDlg(This,lFlags,bstrDeviceID,hwndParent,bstrFolderName,bstrFilename,plNumFiles,ppbstrFilePaths,ppItem) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalCreateDevice_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppWiaItem2Root); - - -void __RPC_STUB IWiaDevMgr2_LocalCreateDevice_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalSelectDeviceDlg_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem2 **ppItemRoot); - - -void __RPC_STUB IWiaDevMgr2_LocalSelectDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalSelectDeviceDlgID_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - - -void __RPC_STUB IWiaDevMgr2_LocalSelectDeviceDlgID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalRegisterEventCallbackInterface_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - - -void __RPC_STUB IWiaDevMgr2_LocalRegisterEventCallbackInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalRegisterEventCallbackProgram_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrFullAppName, - /* [in] */ __RPC__in BSTR bstrCommandLineArg, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr2_LocalRegisterEventCallbackProgram_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalRegisterEventCallbackCLSID_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr2_LocalRegisterEventCallbackCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_LocalGetImageDlg_Proxy( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in BSTR bstrFolderName, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out] */ __RPC__out LONG *plNumFiles, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*plNumFiles) BSTR **ppbstrFilePaths, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppItem); - - -void __RPC_STUB IWiaDevMgr2_LocalGetImageDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDevMgr2_INTERFACE_DEFINED__ */ - - - -#ifndef __WiaDevMgr_LIBRARY_DEFINED__ -#define __WiaDevMgr_LIBRARY_DEFINED__ - -/* library WiaDevMgr */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_WiaDevMgr; - -EXTERN_C const CLSID CLSID_WiaDevMgr; - -#ifdef __cplusplus - -class DECLSPEC_UUID("a1f4e726-8cf1-11d1-bf92-0060081ed811") -WiaDevMgr; -#endif - -EXTERN_C const CLSID CLSID_WiaDevMgr2; - -#ifdef __cplusplus - -class DECLSPEC_UUID("B6C292BC-7C88-41ee-8B54-8EC92617E599") -WiaDevMgr2; -#endif - -EXTERN_C const CLSID CLSID_WiaLog; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A1E75357-881A-419e-83E2-BB16DB197C68") -WiaLog; -#endif -#endif /* __WiaDevMgr_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER HWND_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HWND * ); -void __RPC_USER HWND_UserFree( __RPC__in unsigned long *, __RPC__in HWND * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER STGMEDIUM_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out STGMEDIUM * ); -void __RPC_USER STGMEDIUM_UserFree( __RPC__in unsigned long *, __RPC__in STGMEDIUM * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER HWND_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HWND * ); -void __RPC_USER HWND_UserFree64( __RPC__in unsigned long *, __RPC__in HWND * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree64( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER STGMEDIUM_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out STGMEDIUM * ); -void __RPC_USER STGMEDIUM_UserFree64( __RPC__in unsigned long *, __RPC__in STGMEDIUM * ); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_CreateDevice_Proxy( - IWiaDevMgr * This, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_CreateDevice_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppWiaItemRoot); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlg_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlg_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem **ppItemRoot); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlgID_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlgID_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_GetImageDlg_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_GetImageDlg_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ __RPC__in_opt IWiaItem *pItemRoot, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out][in] */ __RPC__inout GUID *pguidFormat); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackProgram_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackProgram_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrCommandline, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackInterface_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackInterface_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackCLSID_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackCLSID_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_Next_Proxy( - IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_Next_Stub( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_BandedDataCallback_Proxy( - IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_BandedDataCallback_Stub( - __RPC__in IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [unique][size_is][in] */ __RPC__in_ecount_full_opt(lResLength) BYTE *pbBuffer); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetData_Proxy( - IWiaDataTransfer * This, - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetData_Stub( - __RPC__in IWiaDataTransfer * This, - /* [out][in] */ __RPC__inout LPSTGMEDIUM pMedium, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedData_Proxy( - IWiaDataTransfer * This, - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedData_Stub( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem_DeviceDlg_Proxy( - IWiaItem * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem_DeviceDlg_Stub( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ __RPC__out LONG *plItemCount, - /* [out] */ __RPC__deref_out_opt IWiaItem ***pIWiaItem); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_WriteMultiple_Proxy( - IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_WriteMultiple_Stub( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC *rgpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT *rgpropvar, - /* [in] */ PROPID propidNameFirst); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_SetPropertyStream_Proxy( - IWiaPropertyStorage * This, - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_SetPropertyStream_Stub( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in GUID *pCompatibilityId, - /* [unique][in] */ __RPC__in_opt IStream *pIStream); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_Next_Proxy( - IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_Next_Stub( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaItem **ppIWiaItem, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_Next_Proxy( - IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_Next_Stub( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_Next_Proxy( - IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_Next_Stub( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [helpstring][local] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_Download_Proxy( - IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_Download_Stub( - __RPC__in IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pIWiaTransferCallback); - -/* [helpstring][local] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_Upload_Proxy( - IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ IStream *pSource, - /* [in] */ IWiaTransferCallback *pIWiaTransferCallback); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaTransfer_Upload_Stub( - __RPC__in IWiaTransfer * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in_opt IStream *pSource, - /* [in] */ __RPC__in_opt IWiaTransferCallback *pIWiaTransferCallback); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem2_Next_Proxy( - IEnumWiaItem2 * This, - /* [in] */ ULONG cElt, - /* [length_is][size_is][out] */ IWiaItem2 **ppIWiaItem2, - /* [unique][out][in] */ ULONG *pcEltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem2_Next_Stub( - __RPC__in IEnumWiaItem2 * This, - /* [in] */ ULONG cElt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(cElt, *pcEltFetched) IWiaItem2 **ppIWiaItem2, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pcEltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem2_DeviceDlg_Proxy( - IWiaItem2 * This, - /* [annotation][in] */ - __in LONG lFlags, - /* [annotation][in] */ - __in HWND hwndParent, - /* [annotation][in] */ - __in BSTR bstrFolderName, - /* [annotation][in] */ - __in BSTR bstrFilename, - /* [annotation][out] */ - __out LONG *plNumFiles, - /* [annotation][size_is][size_is][out] */ - __deref_out_ecount(*plNumFiles) BSTR **ppbstrFilePaths, - /* [annotation][out][in] */ - __out_opt IWiaItem2 **ppItem); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_DeviceDlg_Stub( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in BSTR bstrFolderName, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out] */ __RPC__out LONG *plNumFiles, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*plNumFiles) BSTR **ppbstrFilePaths, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppItem); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem2_CheckExtension_Proxy( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [out] */ BOOL *pbExtensionExists); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_CheckExtension_Stub( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in REFIID riidExtensionInterface, - /* [out] */ __RPC__out BOOL *pbExtensionExists); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem2_GetExtension_Proxy( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrName, - /* [in] */ REFIID riidExtensionInterface, - /* [iid_is][out] */ void **ppOut); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_GetExtension_Stub( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in REFIID riidExtensionInterface, - /* [iid_is][out] */ __RPC__deref_out_opt void **ppOut); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem2_GetPreviewComponent_Proxy( - IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [out] */ IWiaPreview **ppWiaPreview); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem2_GetPreviewComponent_Stub( - __RPC__in IWiaItem2 * This, - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IWiaPreview **ppWiaPreview); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_CreateDevice_Proxy( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem2 **ppWiaItem2Root); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_CreateDevice_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem2 **ppWiaItem2Root); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_SelectDeviceDlg_Proxy( - IWiaDevMgr2 * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem2 **ppItemRoot); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_SelectDeviceDlg_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem2 **ppItemRoot); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_SelectDeviceDlgID_Proxy( - IWiaDevMgr2 * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_SelectDeviceDlgID_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackInterface_Proxy( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackInterface_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackProgram_Proxy( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrFullAppName, - /* [in] */ BSTR bstrCommandLineArg, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackProgram_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrFullAppName, - /* [in] */ __RPC__in BSTR bstrCommandLineArg, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackCLSID_Proxy( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_RegisterEventCallbackCLSID_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_GetImageDlg_Proxy( - IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ HWND hwndParent, - /* [in] */ BSTR bstrFolderName, - /* [in] */ BSTR bstrFilename, - /* [out] */ LONG *plNumFiles, - /* [size_is][size_is][out] */ BSTR **ppbstrFilePaths, - /* [out][in] */ IWiaItem2 **ppItem); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr2_GetImageDlg_Stub( - __RPC__in IWiaDevMgr2 * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ __RPC__in BSTR bstrFolderName, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out] */ __RPC__out LONG *plNumFiles, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*plNumFiles) BSTR **ppbstrFilePaths, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem2 **ppItem); - - - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/wia_xp.h b/qt-correction-tool/pub/ddk/wia_xp.h deleted file mode 100644 index 54a786e..0000000 --- a/qt-correction-tool/pub/ddk/wia_xp.h +++ /dev/null @@ -1,2844 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for wia_xp.idl, wia_xp.acf: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __wia_xp_h__ -#define __wia_xp_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IWiaDevMgr_FWD_DEFINED__ -#define __IWiaDevMgr_FWD_DEFINED__ -typedef interface IWiaDevMgr IWiaDevMgr; -#endif /* __IWiaDevMgr_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_INFO_FWD_DEFINED__ -#define __IEnumWIA_DEV_INFO_FWD_DEFINED__ -typedef interface IEnumWIA_DEV_INFO IEnumWIA_DEV_INFO; -#endif /* __IEnumWIA_DEV_INFO_FWD_DEFINED__ */ - - -#ifndef __IWiaEventCallback_FWD_DEFINED__ -#define __IWiaEventCallback_FWD_DEFINED__ -typedef interface IWiaEventCallback IWiaEventCallback; -#endif /* __IWiaEventCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaDataCallback_FWD_DEFINED__ -#define __IWiaDataCallback_FWD_DEFINED__ -typedef interface IWiaDataCallback IWiaDataCallback; -#endif /* __IWiaDataCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaDataTransfer_FWD_DEFINED__ -#define __IWiaDataTransfer_FWD_DEFINED__ -typedef interface IWiaDataTransfer IWiaDataTransfer; -#endif /* __IWiaDataTransfer_FWD_DEFINED__ */ - - -#ifndef __IWiaItem_FWD_DEFINED__ -#define __IWiaItem_FWD_DEFINED__ -typedef interface IWiaItem IWiaItem; -#endif /* __IWiaItem_FWD_DEFINED__ */ - - -#ifndef __IWiaPropertyStorage_FWD_DEFINED__ -#define __IWiaPropertyStorage_FWD_DEFINED__ -typedef interface IWiaPropertyStorage IWiaPropertyStorage; -#endif /* __IWiaPropertyStorage_FWD_DEFINED__ */ - - -#ifndef __IEnumWiaItem_FWD_DEFINED__ -#define __IEnumWiaItem_FWD_DEFINED__ -typedef interface IEnumWiaItem IEnumWiaItem; -#endif /* __IEnumWiaItem_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_CAPS_FWD_DEFINED__ -#define __IEnumWIA_DEV_CAPS_FWD_DEFINED__ -typedef interface IEnumWIA_DEV_CAPS IEnumWIA_DEV_CAPS; -#endif /* __IEnumWIA_DEV_CAPS_FWD_DEFINED__ */ - - -#ifndef __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ -#define __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ -typedef interface IEnumWIA_FORMAT_INFO IEnumWIA_FORMAT_INFO; -#endif /* __IEnumWIA_FORMAT_INFO_FWD_DEFINED__ */ - - -#ifndef __IWiaLog_FWD_DEFINED__ -#define __IWiaLog_FWD_DEFINED__ -typedef interface IWiaLog IWiaLog; -#endif /* __IWiaLog_FWD_DEFINED__ */ - - -#ifndef __IWiaLogEx_FWD_DEFINED__ -#define __IWiaLogEx_FWD_DEFINED__ -typedef interface IWiaLogEx IWiaLogEx; -#endif /* __IWiaLogEx_FWD_DEFINED__ */ - - -#ifndef __IWiaNotifyDevMgr_FWD_DEFINED__ -#define __IWiaNotifyDevMgr_FWD_DEFINED__ -typedef interface IWiaNotifyDevMgr IWiaNotifyDevMgr; -#endif /* __IWiaNotifyDevMgr_FWD_DEFINED__ */ - - -#ifndef __IWiaItemExtras_FWD_DEFINED__ -#define __IWiaItemExtras_FWD_DEFINED__ -typedef interface IWiaItemExtras IWiaItemExtras; -#endif /* __IWiaItemExtras_FWD_DEFINED__ */ - - -#ifndef __WiaDevMgr_FWD_DEFINED__ -#define __WiaDevMgr_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WiaDevMgr WiaDevMgr; -#else -typedef struct WiaDevMgr WiaDevMgr; -#endif /* __cplusplus */ - -#endif /* __WiaDevMgr_FWD_DEFINED__ */ - - -#ifndef __WiaLog_FWD_DEFINED__ -#define __WiaLog_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class WiaLog WiaLog; -#else -typedef struct WiaLog WiaLog; -#endif /* __cplusplus */ - -#endif /* __WiaLog_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "oaidl.h" -#include "propidl.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_wia_xp_0000_0000 */ -/* [local] */ - - - - - - - - - - - -typedef struct _WIA_DITHER_PATTERN_DATA - { - LONG lSize; - BSTR bstrPatternName; - LONG lPatternWidth; - LONG lPatternLength; - LONG cbPattern; - BYTE *pbPattern; - } WIA_DITHER_PATTERN_DATA; - -typedef struct _WIA_DITHER_PATTERN_DATA *PWIA_DITHER_PATTERN_DATA; - -typedef struct _WIA_PROPID_TO_NAME - { - PROPID propid; - LPOLESTR pszName; - } WIA_PROPID_TO_NAME; - -typedef struct _WIA_PROPID_TO_NAME *PWIA_PROPID_TO_NAME; - -typedef struct _WIA_FORMAT_INFO - { - GUID guidFormatID; - LONG lTymed; - } WIA_FORMAT_INFO; - -typedef struct _WIA_FORMAT_INFO *PWIA_FORMAT_INFO; - -#include "wiadef.h" - - -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0000_v0_0_s_ifspec; - -#ifndef __IWiaDevMgr_INTERFACE_DEFINED__ -#define __IWiaDevMgr_INTERFACE_DEFINED__ - -/* interface IWiaDevMgr */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDevMgr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5eb2502a-8cf1-11d1-bf92-0060081ed811") - IWiaDevMgr : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceInfo( - /* [in] */ LONG lFlag, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE CreateDevice( - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SelectDeviceDlgID( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE GetImageDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackProgram( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackInterface( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE RegisterEventCallbackCLSID( - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AddDeviceDlg( - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDevMgrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDevMgr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDevMgr * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceInfo )( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlag, - /* [retval][out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *CreateDevice )( - IWiaDevMgr * This, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlg )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SelectDeviceDlgID )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *GetImageDlg )( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackProgram )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackInterface )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *RegisterEventCallbackCLSID )( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AddDeviceDlg )( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags); - - END_INTERFACE - } IWiaDevMgrVtbl; - - interface IWiaDevMgr - { - CONST_VTBL struct IWiaDevMgrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDevMgr_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDevMgr_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDevMgr_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDevMgr_EnumDeviceInfo(This,lFlag,ppIEnum) \ - ( (This)->lpVtbl -> EnumDeviceInfo(This,lFlag,ppIEnum) ) - -#define IWiaDevMgr_CreateDevice(This,bstrDeviceID,ppWiaItemRoot) \ - ( (This)->lpVtbl -> CreateDevice(This,bstrDeviceID,ppWiaItemRoot) ) - -#define IWiaDevMgr_SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) \ - ( (This)->lpVtbl -> SelectDeviceDlg(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID,ppItemRoot) ) - -#define IWiaDevMgr_SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) \ - ( (This)->lpVtbl -> SelectDeviceDlgID(This,hwndParent,lDeviceType,lFlags,pbstrDeviceID) ) - -#define IWiaDevMgr_GetImageDlg(This,hwndParent,lDeviceType,lFlags,lIntent,pItemRoot,bstrFilename,pguidFormat) \ - ( (This)->lpVtbl -> GetImageDlg(This,hwndParent,lDeviceType,lFlags,lIntent,pItemRoot,bstrFilename,pguidFormat) ) - -#define IWiaDevMgr_RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrCommandline,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackProgram(This,lFlags,bstrDeviceID,pEventGUID,bstrCommandline,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr_RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) \ - ( (This)->lpVtbl -> RegisterEventCallbackInterface(This,lFlags,bstrDeviceID,pEventGUID,pIWiaEventCallback,pEventObject) ) - -#define IWiaDevMgr_RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) \ - ( (This)->lpVtbl -> RegisterEventCallbackCLSID(This,lFlags,bstrDeviceID,pEventGUID,pClsID,bstrName,bstrDescription,bstrIcon) ) - -#define IWiaDevMgr_AddDeviceDlg(This,hwndParent,lFlags) \ - ( (This)->lpVtbl -> AddDeviceDlg(This,hwndParent,lFlags) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalCreateDevice_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppWiaItemRoot); - - -void __RPC_STUB IWiaDevMgr_LocalCreateDevice_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalSelectDeviceDlg_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem **ppItemRoot); - - -void __RPC_STUB IWiaDevMgr_LocalSelectDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalSelectDeviceDlgID_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - - -void __RPC_STUB IWiaDevMgr_LocalSelectDeviceDlgID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalGetImageDlg_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ __RPC__in_opt IWiaItem *pItemRoot, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out][in] */ __RPC__inout GUID *pguidFormat); - - -void __RPC_STUB IWiaDevMgr_LocalGetImageDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackProgram_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrCommandline, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackProgram_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackInterface_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackInterface_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_LocalRegisterEventCallbackCLSID_Proxy( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - - -void __RPC_STUB IWiaDevMgr_LocalRegisterEventCallbackCLSID_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDevMgr_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ -#define __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ - -/* interface IEnumWIA_DEV_INFO */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_DEV_INFO; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5e38b83c-8cf1-11d1-bf92-0060081ed811") - IEnumWIA_DEV_INFO : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *celt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_DEV_INFOVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_DEV_INFO * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_DEV_INFO * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_DEV_INFO * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_INFO **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [out] */ __RPC__out ULONG *celt); - - END_INTERFACE - } IEnumWIA_DEV_INFOVtbl; - - interface IEnumWIA_DEV_INFO - { - CONST_VTBL struct IEnumWIA_DEV_INFOVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_DEV_INFO_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_DEV_INFO_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_DEV_INFO_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_DEV_INFO_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_DEV_INFO_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_DEV_INFO_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_DEV_INFO_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_DEV_INFO_GetCount(This,celt) \ - ( (This)->lpVtbl -> GetCount(This,celt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_RemoteNext_Proxy( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_DEV_INFO_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_DEV_INFO_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaEventCallback_INTERFACE_DEFINED__ -#define __IWiaEventCallback_INTERFACE_DEFINED__ - -/* interface IWiaEventCallback */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaEventCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("ae6287b0-0084-11d2-973b-00a0c9068f2e") - IWiaEventCallback : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ImageEventCallback( - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrEventDescription, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrDeviceDescription, - /* [in] */ DWORD dwDeviceType, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out][in] */ __RPC__inout ULONG *pulEventType, - /* [in] */ ULONG ulReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaEventCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaEventCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaEventCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaEventCallback * This); - - HRESULT ( STDMETHODCALLTYPE *ImageEventCallback )( - __RPC__in IWiaEventCallback * This, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrEventDescription, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in BSTR bstrDeviceDescription, - /* [in] */ DWORD dwDeviceType, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out][in] */ __RPC__inout ULONG *pulEventType, - /* [in] */ ULONG ulReserved); - - END_INTERFACE - } IWiaEventCallbackVtbl; - - interface IWiaEventCallback - { - CONST_VTBL struct IWiaEventCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaEventCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaEventCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaEventCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaEventCallback_ImageEventCallback(This,pEventGUID,bstrEventDescription,bstrDeviceID,bstrDeviceDescription,dwDeviceType,bstrFullItemName,pulEventType,ulReserved) \ - ( (This)->lpVtbl -> ImageEventCallback(This,pEventGUID,bstrEventDescription,bstrDeviceID,bstrDeviceDescription,dwDeviceType,bstrFullItemName,pulEventType,ulReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaEventCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_xp_0000_0003 */ -/* [local] */ - -typedef struct _WIA_DATA_CALLBACK_HEADER - { - LONG lSize; - GUID guidFormatID; - LONG lBufferSize; - LONG lPageCount; - } WIA_DATA_CALLBACK_HEADER; - -typedef struct _WIA_DATA_CALLBACK_HEADER *PWIA_DATA_CALLBACK_HEADER; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0003_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0003_v0_0_s_ifspec; - -#ifndef __IWiaDataCallback_INTERFACE_DEFINED__ -#define __IWiaDataCallback_INTERFACE_DEFINED__ - -/* interface IWiaDataCallback */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDataCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a558a866-a5b0-11d2-a08f-00c04f72dc3c") - IWiaDataCallback : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE BandedDataCallback( - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDataCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDataCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDataCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDataCallback * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *BandedDataCallback )( - IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer); - - END_INTERFACE - } IWiaDataCallbackVtbl; - - interface IWiaDataCallback - { - CONST_VTBL struct IWiaDataCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDataCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDataCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDataCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDataCallback_BandedDataCallback(This,lMessage,lStatus,lPercentComplete,lOffset,lLength,lReserved,lResLength,pbBuffer) \ - ( (This)->lpVtbl -> BandedDataCallback(This,lMessage,lStatus,lPercentComplete,lOffset,lLength,lReserved,lResLength,pbBuffer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_RemoteBandedDataCallback_Proxy( - __RPC__in IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [unique][size_is][in] */ __RPC__in_ecount_full_opt(lResLength) BYTE *pbBuffer); - - -void __RPC_STUB IWiaDataCallback_RemoteBandedDataCallback_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDataCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_xp_0000_0004 */ -/* [local] */ - -typedef struct _WIA_DATA_TRANSFER_INFO - { - ULONG ulSize; - ULONG ulSection; - ULONG ulBufferSize; - BOOL bDoubleBuffer; - ULONG ulReserved1; - ULONG ulReserved2; - ULONG ulReserved3; - } WIA_DATA_TRANSFER_INFO; - -typedef struct _WIA_DATA_TRANSFER_INFO *PWIA_DATA_TRANSFER_INFO; - -typedef struct _WIA_EXTENDED_TRANSFER_INFO - { - ULONG ulSize; - ULONG ulMinBufferSize; - ULONG ulOptimalBufferSize; - ULONG ulMaxBufferSize; - ULONG ulNumBuffers; - } WIA_EXTENDED_TRANSFER_INFO; - -typedef struct _WIA_EXTENDED_TRANSFER_INFO *PWIA_EXTENDED_TRANSFER_INFO; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0004_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0004_v0_0_s_ifspec; - -#ifndef __IWiaDataTransfer_INTERFACE_DEFINED__ -#define __IWiaDataTransfer_INTERFACE_DEFINED__ - -/* interface IWiaDataTransfer */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDataTransfer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a6cef998-a5b0-11d2-a08f-00c04f72dc3c") - IWiaDataTransfer : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE idtGetData( - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE idtGetBandedData( - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtQueryGetData( - /* [unique][in] */ __RPC__in_opt WIA_FORMAT_INFO *pfe) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtEnumWIA_FORMAT_INFO( - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE idtGetExtendedTransferInfo( - /* [out] */ __RPC__out PWIA_EXTENDED_TRANSFER_INFO pExtendedTransferInfo) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDataTransferVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDataTransfer * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDataTransfer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDataTransfer * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *idtGetData )( - IWiaDataTransfer * This, - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *idtGetBandedData )( - IWiaDataTransfer * This, - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtQueryGetData )( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt WIA_FORMAT_INFO *pfe); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtEnumWIA_FORMAT_INFO )( - __RPC__in IWiaDataTransfer * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *idtGetExtendedTransferInfo )( - __RPC__in IWiaDataTransfer * This, - /* [out] */ __RPC__out PWIA_EXTENDED_TRANSFER_INFO pExtendedTransferInfo); - - END_INTERFACE - } IWiaDataTransferVtbl; - - interface IWiaDataTransfer - { - CONST_VTBL struct IWiaDataTransferVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDataTransfer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDataTransfer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDataTransfer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDataTransfer_idtGetData(This,pMedium,pIWiaDataCallback) \ - ( (This)->lpVtbl -> idtGetData(This,pMedium,pIWiaDataCallback) ) - -#define IWiaDataTransfer_idtGetBandedData(This,pWiaDataTransInfo,pIWiaDataCallback) \ - ( (This)->lpVtbl -> idtGetBandedData(This,pWiaDataTransInfo,pIWiaDataCallback) ) - -#define IWiaDataTransfer_idtQueryGetData(This,pfe) \ - ( (This)->lpVtbl -> idtQueryGetData(This,pfe) ) - -#define IWiaDataTransfer_idtEnumWIA_FORMAT_INFO(This,ppEnum) \ - ( (This)->lpVtbl -> idtEnumWIA_FORMAT_INFO(This,ppEnum) ) - -#define IWiaDataTransfer_idtGetExtendedTransferInfo(This,pExtendedTransferInfo) \ - ( (This)->lpVtbl -> idtGetExtendedTransferInfo(This,pExtendedTransferInfo) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetDataEx_Proxy( - __RPC__in IWiaDataTransfer * This, - /* [out][in] */ __RPC__inout LPSTGMEDIUM pMedium, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - - -void __RPC_STUB IWiaDataTransfer_idtGetDataEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedDataEx_Proxy( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - - -void __RPC_STUB IWiaDataTransfer_idtGetBandedDataEx_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaDataTransfer_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaItem_INTERFACE_DEFINED__ -#define __IWiaItem_INTERFACE_DEFINED__ - -/* interface IWiaItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("4db1ad10-3391-11d2-9a33-00c04fa36145") - IWiaItem : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetItemType( - /* [out] */ __RPC__out LONG *pItemType) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE AnalyzeItem( - /* [in] */ LONG lFlags) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumChildItems( - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnumWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeleteItem( - /* [in] */ LONG lFlags) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateChildItem( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumRegisterEventInfo( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE FindItemByName( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE DeviceDlg( - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DeviceCommand( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem **pIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetRootItem( - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE EnumDeviceCapabilities( - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpDrvItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE DumpTreeItemData( - /* [out] */ __RPC__deref_out_opt BSTR *bstrData) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Diagnostic( - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaItem * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetItemType )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__out LONG *pItemType); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *AnalyzeItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumChildItems )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnumWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeleteItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateChildItem )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumRegisterEventInfo )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *FindItemByName )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *DeviceDlg )( - IWiaItem * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DeviceCommand )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in const GUID *pCmdGUID, - /* [out][in] */ __RPC__deref_inout_opt IWiaItem **pIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetRootItem )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppIWiaItem); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *EnumDeviceCapabilities )( - __RPC__in IWiaItem * This, - /* [in] */ LONG lFlags, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnumWIA_DEV_CAPS); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpDrvItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *DumpTreeItemData )( - __RPC__in IWiaItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrData); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Diagnostic )( - __RPC__in IWiaItem * This, - /* [in] */ ULONG ulSize, - /* [size_is][in] */ __RPC__in_ecount_full(ulSize) BYTE *pBuffer); - - END_INTERFACE - } IWiaItemVtbl; - - interface IWiaItem - { - CONST_VTBL struct IWiaItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaItem_GetItemType(This,pItemType) \ - ( (This)->lpVtbl -> GetItemType(This,pItemType) ) - -#define IWiaItem_AnalyzeItem(This,lFlags) \ - ( (This)->lpVtbl -> AnalyzeItem(This,lFlags) ) - -#define IWiaItem_EnumChildItems(This,ppIEnumWiaItem) \ - ( (This)->lpVtbl -> EnumChildItems(This,ppIEnumWiaItem) ) - -#define IWiaItem_DeleteItem(This,lFlags) \ - ( (This)->lpVtbl -> DeleteItem(This,lFlags) ) - -#define IWiaItem_CreateChildItem(This,lFlags,bstrItemName,bstrFullItemName,ppIWiaItem) \ - ( (This)->lpVtbl -> CreateChildItem(This,lFlags,bstrItemName,bstrFullItemName,ppIWiaItem) ) - -#define IWiaItem_EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) \ - ( (This)->lpVtbl -> EnumRegisterEventInfo(This,lFlags,pEventGUID,ppIEnum) ) - -#define IWiaItem_FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem) \ - ( (This)->lpVtbl -> FindItemByName(This,lFlags,bstrFullItemName,ppIWiaItem) ) - -#define IWiaItem_DeviceDlg(This,hwndParent,lFlags,lIntent,plItemCount,ppIWiaItem) \ - ( (This)->lpVtbl -> DeviceDlg(This,hwndParent,lFlags,lIntent,plItemCount,ppIWiaItem) ) - -#define IWiaItem_DeviceCommand(This,lFlags,pCmdGUID,pIWiaItem) \ - ( (This)->lpVtbl -> DeviceCommand(This,lFlags,pCmdGUID,pIWiaItem) ) - -#define IWiaItem_GetRootItem(This,ppIWiaItem) \ - ( (This)->lpVtbl -> GetRootItem(This,ppIWiaItem) ) - -#define IWiaItem_EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) \ - ( (This)->lpVtbl -> EnumDeviceCapabilities(This,lFlags,ppIEnumWIA_DEV_CAPS) ) - -#define IWiaItem_DumpItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpItemData(This,bstrData) ) - -#define IWiaItem_DumpDrvItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpDrvItemData(This,bstrData) ) - -#define IWiaItem_DumpTreeItemData(This,bstrData) \ - ( (This)->lpVtbl -> DumpTreeItemData(This,bstrData) ) - -#define IWiaItem_Diagnostic(This,ulSize,pBuffer) \ - ( (This)->lpVtbl -> Diagnostic(This,ulSize,pBuffer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem_LocalDeviceDlg_Proxy( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ __RPC__out LONG *plItemCount, - /* [out] */ __RPC__deref_out_opt IWiaItem ***pIWiaItem); - - -void __RPC_STUB IWiaItem_LocalDeviceDlg_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaItem_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaPropertyStorage_INTERFACE_DEFINED__ -#define __IWiaPropertyStorage_INTERFACE_DEFINED__ - -/* interface IWiaPropertyStorage */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaPropertyStorage; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("98B5E8A0-29CC-491a-AAC0-E6DB4FDCCEB6") - IWiaPropertyStorage : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE ReadMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE WriteMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeleteMultiple( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE ReadPropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE WritePropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE DeletePropertyNames( - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]) = 0; - - virtual HRESULT STDMETHODCALLTYPE Commit( - /* [in] */ DWORD grfCommitFlags) = 0; - - virtual HRESULT STDMETHODCALLTYPE Revert( void) = 0; - - virtual HRESULT STDMETHODCALLTYPE Enum( - /* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetTimes( - /* [in] */ __RPC__in const FILETIME *pctime, - /* [in] */ __RPC__in const FILETIME *patime, - /* [in] */ __RPC__in const FILETIME *pmtime) = 0; - - virtual HRESULT STDMETHODCALLTYPE SetClass( - /* [in] */ __RPC__in REFCLSID clsid) = 0; - - virtual HRESULT STDMETHODCALLTYPE Stat( - /* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertyAttributes( - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) ULONG rgflags[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pulNumProps) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetPropertyStream( - /* [out] */ __RPC__out GUID *pCompatibilityId, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream) = 0; - - virtual /* [local] */ HRESULT STDMETHODCALLTYPE SetPropertyStream( - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaPropertyStorageVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaPropertyStorage * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaPropertyStorage * This); - - HRESULT ( STDMETHODCALLTYPE *ReadMultiple )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *WriteMultiple )( - IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst); - - HRESULT ( STDMETHODCALLTYPE *DeleteMultiple )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC rgpspec[ ]); - - HRESULT ( STDMETHODCALLTYPE *ReadPropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpropid) LPOLESTR rglpwstrName[ ]); - - HRESULT ( STDMETHODCALLTYPE *WritePropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ], - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const LPOLESTR rglpwstrName[ ]); - - HRESULT ( STDMETHODCALLTYPE *DeletePropertyNames )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpropid, - /* [size_is][in] */ __RPC__in_ecount_full(cpropid) const PROPID rgpropid[ ]); - - HRESULT ( STDMETHODCALLTYPE *Commit )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ DWORD grfCommitFlags); - - HRESULT ( STDMETHODCALLTYPE *Revert )( - __RPC__in IWiaPropertyStorage * This); - - HRESULT ( STDMETHODCALLTYPE *Enum )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__deref_out_opt IEnumSTATPROPSTG **ppenum); - - HRESULT ( STDMETHODCALLTYPE *SetTimes )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in const FILETIME *pctime, - /* [in] */ __RPC__in const FILETIME *patime, - /* [in] */ __RPC__in const FILETIME *pmtime); - - HRESULT ( STDMETHODCALLTYPE *SetClass )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in REFCLSID clsid); - - HRESULT ( STDMETHODCALLTYPE *Stat )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out STATPROPSETSTG *pstatpsstg); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyAttributes )( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) PROPSPEC rgpspec[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) ULONG rgflags[ ], - /* [size_is][out] */ __RPC__out_ecount_full(cpspec) PROPVARIANT rgpropvar[ ]); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out ULONG *pulNumProps); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetPropertyStream )( - __RPC__in IWiaPropertyStorage * This, - /* [out] */ __RPC__out GUID *pCompatibilityId, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *SetPropertyStream )( - IWiaPropertyStorage * This, - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream); - - END_INTERFACE - } IWiaPropertyStorageVtbl; - - interface IWiaPropertyStorage - { - CONST_VTBL struct IWiaPropertyStorageVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaPropertyStorage_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaPropertyStorage_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaPropertyStorage_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaPropertyStorage_ReadMultiple(This,cpspec,rgpspec,rgpropvar) \ - ( (This)->lpVtbl -> ReadMultiple(This,cpspec,rgpspec,rgpropvar) ) - -#define IWiaPropertyStorage_WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) \ - ( (This)->lpVtbl -> WriteMultiple(This,cpspec,rgpspec,rgpropvar,propidNameFirst) ) - -#define IWiaPropertyStorage_DeleteMultiple(This,cpspec,rgpspec) \ - ( (This)->lpVtbl -> DeleteMultiple(This,cpspec,rgpspec) ) - -#define IWiaPropertyStorage_ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) \ - ( (This)->lpVtbl -> ReadPropertyNames(This,cpropid,rgpropid,rglpwstrName) ) - -#define IWiaPropertyStorage_WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) \ - ( (This)->lpVtbl -> WritePropertyNames(This,cpropid,rgpropid,rglpwstrName) ) - -#define IWiaPropertyStorage_DeletePropertyNames(This,cpropid,rgpropid) \ - ( (This)->lpVtbl -> DeletePropertyNames(This,cpropid,rgpropid) ) - -#define IWiaPropertyStorage_Commit(This,grfCommitFlags) \ - ( (This)->lpVtbl -> Commit(This,grfCommitFlags) ) - -#define IWiaPropertyStorage_Revert(This) \ - ( (This)->lpVtbl -> Revert(This) ) - -#define IWiaPropertyStorage_Enum(This,ppenum) \ - ( (This)->lpVtbl -> Enum(This,ppenum) ) - -#define IWiaPropertyStorage_SetTimes(This,pctime,patime,pmtime) \ - ( (This)->lpVtbl -> SetTimes(This,pctime,patime,pmtime) ) - -#define IWiaPropertyStorage_SetClass(This,clsid) \ - ( (This)->lpVtbl -> SetClass(This,clsid) ) - -#define IWiaPropertyStorage_Stat(This,pstatpsstg) \ - ( (This)->lpVtbl -> Stat(This,pstatpsstg) ) - -#define IWiaPropertyStorage_GetPropertyAttributes(This,cpspec,rgpspec,rgflags,rgpropvar) \ - ( (This)->lpVtbl -> GetPropertyAttributes(This,cpspec,rgpspec,rgflags,rgpropvar) ) - -#define IWiaPropertyStorage_GetCount(This,pulNumProps) \ - ( (This)->lpVtbl -> GetCount(This,pulNumProps) ) - -#define IWiaPropertyStorage_GetPropertyStream(This,pCompatibilityId,ppIStream) \ - ( (This)->lpVtbl -> GetPropertyStream(This,pCompatibilityId,ppIStream) ) - -#define IWiaPropertyStorage_SetPropertyStream(This,pCompatibilityId,pIStream) \ - ( (This)->lpVtbl -> SetPropertyStream(This,pCompatibilityId,pIStream) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_RemoteWriteMultiple_Proxy( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC *rgpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT *rgpropvar, - /* [in] */ PROPID propidNameFirst); - - -void __RPC_STUB IWiaPropertyStorage_RemoteWriteMultiple_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_RemoteSetPropertyStream_Proxy( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in GUID *pCompatibilityId, - /* [unique][in] */ __RPC__in_opt IStream *pIStream); - - -void __RPC_STUB IWiaPropertyStorage_RemoteSetPropertyStream_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IWiaPropertyStorage_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWiaItem_INTERFACE_DEFINED__ -#define __IEnumWiaItem_INTERFACE_DEFINED__ - -/* interface IEnumWiaItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWiaItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("5e8383fc-3391-11d2-9a33-00c04fa36145") - IEnumWiaItem : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *celt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWiaItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWiaItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWiaItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWiaItem * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWiaItem * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWiaItem * This, - /* [out] */ __RPC__deref_out_opt IEnumWiaItem **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWiaItem * This, - /* [out] */ __RPC__out ULONG *celt); - - END_INTERFACE - } IEnumWiaItemVtbl; - - interface IEnumWiaItem - { - CONST_VTBL struct IEnumWiaItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWiaItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWiaItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWiaItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWiaItem_Next(This,celt,ppIWiaItem,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,ppIWiaItem,pceltFetched) ) - -#define IEnumWiaItem_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWiaItem_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWiaItem_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWiaItem_GetCount(This,celt) \ - ( (This)->lpVtbl -> GetCount(This,celt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_RemoteNext_Proxy( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaItem **ppIWiaItem, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWiaItem_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWiaItem_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wia_xp_0000_0008 */ -/* [local] */ - -typedef struct _WIA_DEV_CAP - { - GUID guid; - ULONG ulFlags; - BSTR bstrName; - BSTR bstrDescription; - BSTR bstrIcon; - BSTR bstrCommandline; - } WIA_DEV_CAP; - -typedef struct _WIA_DEV_CAP *PWIA_DEV_CAP; - -typedef struct _WIA_DEV_CAP WIA_EVENT_HANDLER; - -typedef struct _WIA_DEV_CAP *PWIA_EVENT_HANDLER; - - - -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0008_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wia_xp_0000_0008_v0_0_s_ifspec; - -#ifndef __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ -#define __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ - -/* interface IEnumWIA_DEV_CAPS */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_DEV_CAPS; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1fcc4287-aca6-11d2-a093-00c04f72dc3c") - IEnumWIA_DEV_CAPS : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pcelt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_DEV_CAPSVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_DEV_CAPS * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_DEV_CAPS **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [out] */ __RPC__out ULONG *pcelt); - - END_INTERFACE - } IEnumWIA_DEV_CAPSVtbl; - - interface IEnumWIA_DEV_CAPS - { - CONST_VTBL struct IEnumWIA_DEV_CAPSVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_DEV_CAPS_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_DEV_CAPS_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_DEV_CAPS_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_DEV_CAPS_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_DEV_CAPS_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_DEV_CAPS_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_DEV_CAPS_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_DEV_CAPS_GetCount(This,pcelt) \ - ( (This)->lpVtbl -> GetCount(This,pcelt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_RemoteNext_Proxy( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_DEV_CAPS_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_DEV_CAPS_INTERFACE_DEFINED__ */ - - -#ifndef __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ -#define __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ - -/* interface IEnumWIA_FORMAT_INFO */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IEnumWIA_FORMAT_INFO; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("81BEFC5B-656D-44f1-B24C-D41D51B4DC81") - IEnumWIA_FORMAT_INFO : public IUnknown - { - public: - virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Skip( - /* [in] */ ULONG celt) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Reset( void) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Clone( - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppIEnum) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetCount( - /* [out] */ __RPC__out ULONG *pcelt) = 0; - - }; - -#else /* C style interface */ - - typedef struct IEnumWIA_FORMAT_INFOVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - /* [local] */ HRESULT ( STDMETHODCALLTYPE *Next )( - IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Skip )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Reset )( - __RPC__in IEnumWIA_FORMAT_INFO * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Clone )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [out] */ __RPC__deref_out_opt IEnumWIA_FORMAT_INFO **ppIEnum); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetCount )( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [out] */ __RPC__out ULONG *pcelt); - - END_INTERFACE - } IEnumWIA_FORMAT_INFOVtbl; - - interface IEnumWIA_FORMAT_INFO - { - CONST_VTBL struct IEnumWIA_FORMAT_INFOVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IEnumWIA_FORMAT_INFO_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IEnumWIA_FORMAT_INFO_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IEnumWIA_FORMAT_INFO_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IEnumWIA_FORMAT_INFO_Next(This,celt,rgelt,pceltFetched) \ - ( (This)->lpVtbl -> Next(This,celt,rgelt,pceltFetched) ) - -#define IEnumWIA_FORMAT_INFO_Skip(This,celt) \ - ( (This)->lpVtbl -> Skip(This,celt) ) - -#define IEnumWIA_FORMAT_INFO_Reset(This) \ - ( (This)->lpVtbl -> Reset(This) ) - -#define IEnumWIA_FORMAT_INFO_Clone(This,ppIEnum) \ - ( (This)->lpVtbl -> Clone(This,ppIEnum) ) - -#define IEnumWIA_FORMAT_INFO_GetCount(This,pcelt) \ - ( (This)->lpVtbl -> GetCount(This,pcelt) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_RemoteNext_Proxy( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - -void __RPC_STUB IEnumWIA_FORMAT_INFO_RemoteNext_Stub( - IRpcStubBuffer *This, - IRpcChannelBuffer *_pRpcChannelBuffer, - PRPC_MESSAGE _pRpcMessage, - DWORD *_pdwStubPhase); - - - -#endif /* __IEnumWIA_FORMAT_INFO_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaLog_INTERFACE_DEFINED__ -#define __IWiaLog_INTERFACE_DEFINED__ - -/* interface IWiaLog */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaLog; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("A00C10B6-82A1-452f-8B6C-86062AAD6890") - IWiaLog : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InitializeLog( - /* [in] */ LONG hInstance) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResult( - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Log( - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaLogVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaLog * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaLog * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaLog * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InitializeLog )( - __RPC__in IWiaLog * This, - /* [in] */ LONG hInstance); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResult )( - __RPC__in IWiaLog * This, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Log )( - __RPC__in IWiaLog * This, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - END_INTERFACE - } IWiaLogVtbl; - - interface IWiaLog - { - CONST_VTBL struct IWiaLogVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaLog_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaLog_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaLog_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaLog_InitializeLog(This,hInstance) \ - ( (This)->lpVtbl -> InitializeLog(This,hInstance) ) - -#define IWiaLog_hResult(This,hResult) \ - ( (This)->lpVtbl -> hResult(This,hResult) ) - -#define IWiaLog_Log(This,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> Log(This,lFlags,lResID,lDetail,bstrText) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaLog_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaLogEx_INTERFACE_DEFINED__ -#define __IWiaLogEx_INTERFACE_DEFINED__ - -/* interface IWiaLogEx */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaLogEx; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("AF1F22AC-7A40-4787-B421-AEb47A1FBD0B") - IWiaLogEx : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE InitializeLogEx( - /* [in] */ __RPC__in BYTE *hInstance) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResult( - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Log( - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE hResultEx( - /* [in] */ LONG lMethodId, - /* [in] */ HRESULT hResult) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE LogEx( - /* [in] */ LONG lMethodId, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaLogExVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaLogEx * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaLogEx * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaLogEx * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *InitializeLogEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ __RPC__in BYTE *hInstance); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResult )( - __RPC__in IWiaLogEx * This, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Log )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *hResultEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lMethodId, - /* [in] */ HRESULT hResult); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *LogEx )( - __RPC__in IWiaLogEx * This, - /* [in] */ LONG lMethodId, - /* [in] */ LONG lFlags, - /* [in] */ LONG lResID, - /* [in] */ LONG lDetail, - /* [in] */ __RPC__in BSTR bstrText); - - END_INTERFACE - } IWiaLogExVtbl; - - interface IWiaLogEx - { - CONST_VTBL struct IWiaLogExVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaLogEx_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaLogEx_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaLogEx_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaLogEx_InitializeLogEx(This,hInstance) \ - ( (This)->lpVtbl -> InitializeLogEx(This,hInstance) ) - -#define IWiaLogEx_hResult(This,hResult) \ - ( (This)->lpVtbl -> hResult(This,hResult) ) - -#define IWiaLogEx_Log(This,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> Log(This,lFlags,lResID,lDetail,bstrText) ) - -#define IWiaLogEx_hResultEx(This,lMethodId,hResult) \ - ( (This)->lpVtbl -> hResultEx(This,lMethodId,hResult) ) - -#define IWiaLogEx_LogEx(This,lMethodId,lFlags,lResID,lDetail,bstrText) \ - ( (This)->lpVtbl -> LogEx(This,lMethodId,lFlags,lResID,lDetail,bstrText) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaLogEx_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaNotifyDevMgr_INTERFACE_DEFINED__ -#define __IWiaNotifyDevMgr_INTERFACE_DEFINED__ - -/* interface IWiaNotifyDevMgr */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaNotifyDevMgr; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("70681EA0-E7BF-4291-9FB1-4E8813A3F78E") - IWiaNotifyDevMgr : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE NewDeviceArrival( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaNotifyDevMgrVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaNotifyDevMgr * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaNotifyDevMgr * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaNotifyDevMgr * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *NewDeviceArrival )( - __RPC__in IWiaNotifyDevMgr * This); - - END_INTERFACE - } IWiaNotifyDevMgrVtbl; - - interface IWiaNotifyDevMgr - { - CONST_VTBL struct IWiaNotifyDevMgrVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaNotifyDevMgr_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaNotifyDevMgr_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaNotifyDevMgr_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaNotifyDevMgr_NewDeviceArrival(This) \ - ( (This)->lpVtbl -> NewDeviceArrival(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaNotifyDevMgr_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaItemExtras_INTERFACE_DEFINED__ -#define __IWiaItemExtras_INTERFACE_DEFINED__ - -/* interface IWiaItemExtras */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaItemExtras; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("6291ef2c-36ef-4532-876a-8e132593778d") - IWiaItemExtras : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetExtendedErrorInfo( - /* [out] */ __RPC__deref_out_opt BSTR *bstrErrorText) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Escape( - /* [in] */ DWORD dwEscapeCode, - /* [size_is][in] */ __RPC__in_ecount_full(cbInDataSize) BYTE *lpInData, - /* [in] */ DWORD cbInDataSize, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutDataSize, pdwActualDataSize ? *pdwActualDataSize : dwOutDataSize) BYTE *pOutData, - /* [in] */ DWORD dwOutDataSize, - /* [out] */ __RPC__out DWORD *pdwActualDataSize) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CancelPendingIO( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaItemExtrasVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaItemExtras * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaItemExtras * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaItemExtras * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetExtendedErrorInfo )( - __RPC__in IWiaItemExtras * This, - /* [out] */ __RPC__deref_out_opt BSTR *bstrErrorText); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Escape )( - __RPC__in IWiaItemExtras * This, - /* [in] */ DWORD dwEscapeCode, - /* [size_is][in] */ __RPC__in_ecount_full(cbInDataSize) BYTE *lpInData, - /* [in] */ DWORD cbInDataSize, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(dwOutDataSize, pdwActualDataSize ? *pdwActualDataSize : dwOutDataSize) BYTE *pOutData, - /* [in] */ DWORD dwOutDataSize, - /* [out] */ __RPC__out DWORD *pdwActualDataSize); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CancelPendingIO )( - __RPC__in IWiaItemExtras * This); - - END_INTERFACE - } IWiaItemExtrasVtbl; - - interface IWiaItemExtras - { - CONST_VTBL struct IWiaItemExtrasVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaItemExtras_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaItemExtras_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaItemExtras_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaItemExtras_GetExtendedErrorInfo(This,bstrErrorText) \ - ( (This)->lpVtbl -> GetExtendedErrorInfo(This,bstrErrorText) ) - -#define IWiaItemExtras_Escape(This,dwEscapeCode,lpInData,cbInDataSize,pOutData,dwOutDataSize,pdwActualDataSize) \ - ( (This)->lpVtbl -> Escape(This,dwEscapeCode,lpInData,cbInDataSize,pOutData,dwOutDataSize,pdwActualDataSize) ) - -#define IWiaItemExtras_CancelPendingIO(This) \ - ( (This)->lpVtbl -> CancelPendingIO(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaItemExtras_INTERFACE_DEFINED__ */ - - - -#ifndef __WiaDevMgr_LIBRARY_DEFINED__ -#define __WiaDevMgr_LIBRARY_DEFINED__ - -/* library WiaDevMgr */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_WiaDevMgr; - -EXTERN_C const CLSID CLSID_WiaDevMgr; - -#ifdef __cplusplus - -class DECLSPEC_UUID("a1f4e726-8cf1-11d1-bf92-0060081ed811") -WiaDevMgr; -#endif - -EXTERN_C const CLSID CLSID_WiaLog; - -#ifdef __cplusplus - -class DECLSPEC_UUID("A1E75357-881A-419e-83E2-BB16DB197C68") -WiaLog; -#endif -#endif /* __WiaDevMgr_LIBRARY_DEFINED__ */ - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER HWND_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HWND * ); -void __RPC_USER HWND_UserFree( __RPC__in unsigned long *, __RPC__in HWND * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER STGMEDIUM_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out STGMEDIUM * ); -void __RPC_USER STGMEDIUM_UserFree( __RPC__in unsigned long *, __RPC__in STGMEDIUM * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER HWND_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in HWND * ); -unsigned char * __RPC_USER HWND_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out HWND * ); -void __RPC_USER HWND_UserFree64( __RPC__in unsigned long *, __RPC__in HWND * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree64( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER STGMEDIUM_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in STGMEDIUM * ); -unsigned char * __RPC_USER STGMEDIUM_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out STGMEDIUM * ); -void __RPC_USER STGMEDIUM_UserFree64( __RPC__in unsigned long *, __RPC__in STGMEDIUM * ); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_CreateDevice_Proxy( - IWiaDevMgr * This, - /* [in] */ BSTR bstrDeviceID, - /* [out] */ IWiaItem **ppWiaItemRoot); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_CreateDevice_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [out] */ __RPC__deref_out_opt IWiaItem **ppWiaItemRoot); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlg_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ BSTR *pbstrDeviceID, - /* [retval][out] */ IWiaItem **ppItemRoot); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlg_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [out][in] */ __RPC__deref_inout_opt BSTR *pbstrDeviceID, - /* [retval][out] */ __RPC__deref_out_opt IWiaItem **ppItemRoot); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlgID_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ BSTR *pbstrDeviceID); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_SelectDeviceDlgID_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [retval][out] */ __RPC__deref_out_opt BSTR *pbstrDeviceID); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_GetImageDlg_Proxy( - IWiaDevMgr * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ IWiaItem *pItemRoot, - /* [in] */ BSTR bstrFilename, - /* [out][in] */ GUID *pguidFormat); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_GetImageDlg_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lDeviceType, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [in] */ __RPC__in_opt IWiaItem *pItemRoot, - /* [in] */ __RPC__in BSTR bstrFilename, - /* [out][in] */ __RPC__inout GUID *pguidFormat); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackProgram_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [in] */ BSTR bstrCommandline, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackProgram_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrCommandline, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackInterface_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ IWiaEventCallback *pIWiaEventCallback, - /* [out] */ IUnknown **pEventObject); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackInterface_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt IWiaEventCallback *pIWiaEventCallback, - /* [out] */ __RPC__deref_out_opt IUnknown **pEventObject); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackCLSID_Proxy( - IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ BSTR bstrDeviceID, - /* [in] */ const GUID *pEventGUID, - /* [unique][in] */ const GUID *pClsID, - /* [in] */ BSTR bstrName, - /* [in] */ BSTR bstrDescription, - /* [in] */ BSTR bstrIcon); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDevMgr_RegisterEventCallbackCLSID_Stub( - __RPC__in IWiaDevMgr * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [unique][in] */ __RPC__in_opt const GUID *pClsID, - /* [in] */ __RPC__in BSTR bstrName, - /* [in] */ __RPC__in BSTR bstrDescription, - /* [in] */ __RPC__in BSTR bstrIcon); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_Next_Proxy( - IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_INFO_Next_Stub( - __RPC__in IEnumWIA_DEV_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaPropertyStorage **rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_BandedDataCallback_Proxy( - IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [size_is][in] */ BYTE *pbBuffer); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataCallback_BandedDataCallback_Stub( - __RPC__in IWiaDataCallback * This, - /* [in] */ LONG lMessage, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ LONG lReserved, - /* [in] */ LONG lResLength, - /* [unique][size_is][in] */ __RPC__in_ecount_full_opt(lResLength) BYTE *pbBuffer); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetData_Proxy( - IWiaDataTransfer * This, - /* [out][in] */ LPSTGMEDIUM pMedium, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetData_Stub( - __RPC__in IWiaDataTransfer * This, - /* [out][in] */ __RPC__inout LPSTGMEDIUM pMedium, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedData_Proxy( - IWiaDataTransfer * This, - /* [unique][in] */ PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ IWiaDataCallback *pIWiaDataCallback); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaDataTransfer_idtGetBandedData_Stub( - __RPC__in IWiaDataTransfer * This, - /* [unique][in] */ __RPC__in_opt PWIA_DATA_TRANSFER_INFO pWiaDataTransInfo, - /* [unique][in] */ __RPC__in_opt IWiaDataCallback *pIWiaDataCallback); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaItem_DeviceDlg_Proxy( - IWiaItem * This, - /* [in] */ HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ LONG *plItemCount, - /* [out] */ IWiaItem ***ppIWiaItem); - - -/* [nocode][helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaItem_DeviceDlg_Stub( - __RPC__in IWiaItem * This, - /* [in] */ __RPC__in HWND hwndParent, - /* [in] */ LONG lFlags, - /* [in] */ LONG lIntent, - /* [out] */ __RPC__out LONG *plItemCount, - /* [out] */ __RPC__deref_out_opt IWiaItem ***pIWiaItem); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_WriteMultiple_Proxy( - IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ const PROPSPEC rgpspec[ ], - /* [size_is][in] */ const PROPVARIANT rgpropvar[ ], - /* [in] */ PROPID propidNameFirst); - - -/* [call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_WriteMultiple_Stub( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ ULONG cpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPSPEC *rgpspec, - /* [size_is][in] */ __RPC__in_ecount_full(cpspec) const PROPVARIANT *rgpropvar, - /* [in] */ PROPID propidNameFirst); - -/* [local] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_SetPropertyStream_Proxy( - IWiaPropertyStorage * This, - /* [in] */ GUID *pCompatibilityId, - /* [unique][in] */ IStream *pIStream); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IWiaPropertyStorage_SetPropertyStream_Stub( - __RPC__in IWiaPropertyStorage * This, - /* [in] */ __RPC__in GUID *pCompatibilityId, - /* [unique][in] */ __RPC__in_opt IStream *pIStream); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_Next_Proxy( - IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ IWiaItem **ppIWiaItem, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWiaItem_Next_Stub( - __RPC__in IEnumWiaItem * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) IWiaItem **ppIWiaItem, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_Next_Proxy( - IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_DEV_CAPS_Next_Stub( - __RPC__in IEnumWIA_DEV_CAPS * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_DEV_CAP *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - -/* [local] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_Next_Proxy( - IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ ULONG *pceltFetched); - - -/* [helpstring][call_as] */ HRESULT STDMETHODCALLTYPE IEnumWIA_FORMAT_INFO_Next_Stub( - __RPC__in IEnumWIA_FORMAT_INFO * This, - /* [in] */ ULONG celt, - /* [length_is][size_is][out] */ __RPC__out_ecount_part(celt, *pceltFetched) WIA_FORMAT_INFO *rgelt, - /* [unique][out][in] */ __RPC__inout_opt ULONG *pceltFetched); - - - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/wiaintfc.h b/qt-correction-tool/pub/ddk/wiaintfc.h deleted file mode 100644 index aa2a8c4..0000000 --- a/qt-correction-tool/pub/ddk/wiaintfc.h +++ /dev/null @@ -1,39 +0,0 @@ -/*++ - -Copyright (c) 1986-2003 Microsoft Corporation - -Module Name: - - wiaintfc.h - -Abstract: - - This module contains interface class GUID for WIA. - -Revision History: - - ---*/ - -#if (_WIN32_WINNT >= 0x0501) // Windows XP and later - -#ifndef _WIAINTFC_H_ -#define _WIAINTFC_H_ - -// -// Set packing -// - -#include -#include - -// -// GUID for Image class device interface. -// - -DEFINE_GUID(GUID_DEVINTERFACE_IMAGE, 0x6bdd1fc6L, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f); - -#endif // _WIAINTFC_H_ - -#endif //#if (_WIN32_WINNT >= 0x0501) - diff --git a/qt-correction-tool/pub/ddk/wiamdef.h b/qt-correction-tool/pub/ddk/wiamdef.h deleted file mode 100644 index 05f3424..0000000 --- a/qt-correction-tool/pub/ddk/wiamdef.h +++ /dev/null @@ -1,326 +0,0 @@ -/****************************************************************************** -* -* (C) COPYRIGHT MICROSOFT CORP., 1998-1999 -* -* TITLE: wiamdef.h -* -* VERSION: 2.0 -* -* DATE: 28 July, 1999 -* -* DESCRIPTION: -* Header file used to define WIA constants and globals. -* Note: This header was introduced first in Windows XP -* -******************************************************************************/ - -#ifndef _WIAMDEF_H_ -#define _WIAMDEF_H_ - -#if (NTDDI_VERSION >= NTDDI_WINXP) -#pragma once - -#define STRSAFE_NO_DEPRECATE -#include - -// -// The following array of PROPIDs identifies properties that are ALWAYS -// present in a WIA_PROPERTY_CONTEXT. Drivers can specify additional -// properties when creating a property context with wiasCreatePropContext. -// - -#ifdef STD_PROPS_IN_CONTEXT - -#define NUM_STD_PROPS_IN_CONTEXT 13 -PROPID WIA_StdPropsInContext[NUM_STD_PROPS_IN_CONTEXT] = { - WIA_IPA_DATATYPE, - WIA_IPA_DEPTH, - WIA_IPS_XRES, - WIA_IPS_XPOS, - WIA_IPS_XEXTENT, - WIA_IPA_PIXELS_PER_LINE, - WIA_IPS_YRES, - WIA_IPS_YPOS, - WIA_IPS_YEXTENT, - WIA_IPA_NUMBER_OF_LINES, - WIA_IPS_CUR_INTENT, - WIA_IPA_TYMED, - WIA_IPA_FORMAT, - }; -#endif - -#if (NTDDI_VERSION >= NTDDI_VISTA) -// -// drvAcquireItemData flags -// -#define WIA_MINIDRV_TRANSFER_ACQUIRE_CHILDREN 0x00000001 -#define WIA_MINIDRV_TRANSFER_DOWNLOAD 0x00000002 -#define WIA_MINIDRV_TRANSFER_UPLOAD 0x00000004 -#endif //#if (NTDDI_VERSION >= NTDDI_VISTA) - -//************************************************************************** -// -// WIA Service prototypes -// -// -// History: -// -// 4/27/1999 - Initial Version -// -//************************************************************************** - -// Flag used by wiasGetImageInformation. - -#define WIAS_INIT_CONTEXT 1 - -// Flag used by wiasDownSampleBuffer - -#define WIAS_GET_DOWNSAMPLED_SIZE_ONLY 0x1 - -// -// IWiaMiniDrvService methods -// - -#ifdef __cplusplus -extern "C" { -#endif - -HRESULT _stdcall wiasCreateDrvItem(LONG lObjectFlags, BSTR bstrItemName, BSTR bstrFullItemName, - __inout IWiaMiniDrv *pIMiniDrv, LONG cbDevSpecContext, - __deref_out_bcount_opt(cbDevSpecContext) BYTE **ppDevSpecContext, __out IWiaDrvItem **ppIWiaDrvItem); - -HRESULT _stdcall wiasReadMultiple(__in BYTE *pWiasContext, ULONG ulCount, - __in_ecount(ulCount) const PROPSPEC *ps, __out_ecount(ulCount) PROPVARIANT *pv, - __out_ecount_opt(ulCount) PROPVARIANT *pvOld); - -HRESULT _stdcall wiasWriteMultiple(__in BYTE *pWiasContext, ULONG ulCount, - __in_ecount(ulCount) const PROPSPEC *ps, const PROPVARIANT *pv); - -HRESULT _stdcall wiasWritePropBin(__in BYTE *pWiasContext, PROPID propid, LONG cbVal, - __in_bcount(cbVal) BYTE *pbVal); - -HRESULT _stdcall wiasGetPropertyAttributes(__in BYTE *pWiasContext, LONG cPropSpec, - __in_ecount(cPropSpec) PROPSPEC *pPropSpec, ULONG *pulAccessFlags, - __out_ecount(cPropSpec) PROPVARIANT *pPropVar); - -HRESULT _stdcall wiasSetPropertyAttributes(__in BYTE *pWiasContext, LONG cPropSpec, - __in_ecount(cPropSpec) PROPSPEC *pPropSpec, __in ULONG *pulAccessFlags, - __out_ecount(cPropSpec) PROPVARIANT *pPropVar); - -HRESULT _stdcall wiasValidateItemProperties(__in BYTE *pWiasContext, ULONG nPropSpec, - __in_ecount(nPropSpec) const PROPSPEC *pPropSpec); - -HRESULT _stdcall wiasCreatePropContext(ULONG cPropSpec, __in_ecount(cPropSpec) PROPSPEC *pPropSpec, - ULONG cProps, __in_ecount_opt(cProps) PROPID *pProps, __in WIA_PROPERTY_CONTEXT *pContext); - -HRESULT _stdcall wiasGetImageInformation(__in BYTE *pWiasContext, LONG lFlags, - __inout PMINIDRV_TRANSFER_CONTEXT pmdtc); - -HRESULT _stdcall wiasWritePageBufToFile(__in PMINIDRV_TRANSFER_CONTEXT pmdtc); -HRESULT _stdcall wiasWritePageBufToStream(__in PMINIDRV_TRANSFER_CONTEXT pmdtc, __in IStream * pstream); -HRESULT _stdcall wiasWriteBufToFile(LONG lFlags, __in PMINIDRV_TRANSFER_CONTEXT pmdtc); - -HRESULT _stdcall wiasReadPropStr(__in BYTE *pWiasContext, PROPID propid, - __out BSTR *pbstr, __out_opt BSTR *pbstrOld, BOOL bMustExist); -HRESULT _stdcall wiasReadPropLong(__in BYTE *pWiasContext, PROPID propid, - __out LONG *plVal, __out_opt LONG *plValOld, BOOL bMustExist); -HRESULT _stdcall wiasReadPropFloat(__in BYTE *pWiasContext, PROPID propid, - __out FLOAT *pfVal, __out_opt FLOAT *pfValOld, BOOL bMustExist); -HRESULT _stdcall wiasReadPropGuid(__in BYTE *pWiasContext, PROPID propid, - __out GUID *pguidVal, __out_opt GUID *pguidValOld, BOOL bMustExist); -HRESULT _stdcall wiasReadPropBin(__in BYTE *pWiasContext, PROPID propid, - __out BYTE **ppbVal, __out_opt BYTE **ppbValOld, BOOL bMustExist); - -HRESULT _stdcall wiasWritePropStr(__in BYTE *pWiasContext, PROPID propid, __in_opt BSTR bstr); -HRESULT _stdcall wiasWritePropLong(__in BYTE *pWiasContext, PROPID propid, LONG lVal); -HRESULT _stdcall wiasWritePropFloat(__in BYTE *pWiasContext, PROPID propid, float fVal); -HRESULT _stdcall wiasWritePropGuid(__in BYTE *pWiasContext, PROPID propid, GUID guidVal); - -HRESULT _stdcall wiasSetItemPropNames(__in BYTE *pWiasContext, LONG cItemProps, - __inout_ecount(cItemProps) PROPID *ppId, __inout_ecount(cItemProps) LPOLESTR *ppszNames); -HRESULT _stdcall wiasSetItemPropAttribs(__in BYTE *pWiasContext, LONG cPropSpec, - __in_ecount(cPropSpec) PROPSPEC *pPropSpec, __in_ecount(cPropSpec) PWIA_PROPERTY_INFO pwpi); - -HRESULT _stdcall wiasSendEndOfPage(__in BYTE *pWiasContext, - LONG lPageCount, __inout PMINIDRV_TRANSFER_CONTEXT pmdtc); - -HRESULT _stdcall wiasGetItemType(__in BYTE *pWiasContext, __out LONG *plType); - -HRESULT _stdcall wiasGetDrvItem(__in BYTE *pWiasContext, __out IWiaDrvItem **ppIWiaDrvItem); -HRESULT _stdcall wiasGetRootItem(__in BYTE *pWiasContext, __out BYTE **ppWiasContext); - -HRESULT _stdcall wiasSetValidFlag(__in BYTE* pWiasContext, PROPID propid, ULONG ulNom, ULONG ulValidBits); -HRESULT _stdcall wiasSetValidRangeLong(__in BYTE* pWiasContext, PROPID propid, LONG lMin, LONG lNom, LONG lMax, LONG lStep); -HRESULT _stdcall wiasSetValidRangeFloat(__in BYTE* pWiasContext, PROPID propid, FLOAT fMin, FLOAT fNom, FLOAT fMax, FLOAT fStep); -HRESULT _stdcall wiasSetValidListLong(__in BYTE *pWiasContext, PROPID propid, ULONG ulCount, LONG lNom, LONG *plValues); -HRESULT _stdcall wiasSetValidListFloat(__in BYTE *pWiasContext, PROPID propid, ULONG ulCount, FLOAT fNom, __in_ecount(ulCount) FLOAT *pfValues); -HRESULT _stdcall wiasSetValidListGuid(__in BYTE *pWiasContext, PROPID propid, ULONG ulCount, GUID guidNom, __in_ecount(ulCount) GUID *pguidValues); -HRESULT _stdcall wiasSetValidListStr(__in BYTE *pWiasContext, PROPID propid, ULONG ulCount, BSTR bstrNom, __in_ecount(ulCount) BSTR *bstrValues); - -HRESULT _stdcall wiasFreePropContext(__inout WIA_PROPERTY_CONTEXT *pContext); -HRESULT _stdcall wiasIsPropChanged(PROPID propid, __in WIA_PROPERTY_CONTEXT *pContext, __out BOOL *pbChanged); -HRESULT _stdcall wiasSetPropChanged(PROPID propid, __in WIA_PROPERTY_CONTEXT *pContext, BOOL bChanged); -HRESULT _stdcall wiasGetChangedValueLong(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, - BOOL bNoValidation, PROPID propID, __out WIAS_CHANGED_VALUE_INFO *pInfo); -HRESULT _stdcall wiasGetChangedValueFloat(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, - BOOL bNoValidation, PROPID propID, __out WIAS_CHANGED_VALUE_INFO *pInfo); -HRESULT _stdcall wiasGetChangedValueGuid(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, - BOOL bNoValidation, PROPID propID, __out WIAS_CHANGED_VALUE_INFO *pInfo); -HRESULT _stdcall wiasGetChangedValueStr(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, - BOOL bNoValidation, PROPID propID, __out WIAS_CHANGED_VALUE_INFO *pInfo); - -HRESULT _stdcall wiasGetContextFromName(__in BYTE *pWiasContext, LONG lFlags, __in BSTR bstrName, __out BYTE **ppWiasContext); - -HRESULT _stdcall wiasUpdateScanRect(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, LONG lWidth, LONG lHeight); -HRESULT _stdcall wiasUpdateValidFormat(__in BYTE *pWiasContext, __in WIA_PROPERTY_CONTEXT *pContext, __in IWiaMiniDrv *pIMiniDrv); - -HRESULT _stdcall wiasGetChildrenContexts(__in BYTE *pParentContext, __out ULONG *pulNumChildren, - __out_ecount(*pulNumChildren) BYTE ***pppChildren); - -HRESULT _stdcall wiasQueueEvent(__in BSTR bstrDeviceId, __in const GUID *pEventGUID, __in_opt BSTR bstrFullItemName); - -VOID __cdecl wiasDebugTrace(__in HINSTANCE hInstance, __in LPCSTR pszFormat, ... ); -VOID __cdecl wiasDebugError(__in HINSTANCE hInstance, __in LPCSTR pszFormat, ... ); -VOID __stdcall wiasPrintDebugHResult(__in HINSTANCE hInstance, HRESULT hr ); - -BSTR __cdecl wiasFormatArgs(__in LPCSTR lpszFormat, ...); - -HRESULT _stdcall wiasCreateChildAppItem(__in BYTE *pParentWiasContext, LONG lFlags, - __in BSTR bstrItemName, __in BSTR bstrFullItemName, __out BYTE **ppWiasChildContext); - -HRESULT _stdcall wiasCreateLogInstance(__in BYTE *pModuleHandle, __out IWiaLogEx **ppIWiaLogEx); -HRESULT _stdcall wiasDownSampleBuffer(LONG lFlags, __inout WIAS_DOWN_SAMPLE_INFO *pInfo); -HRESULT _stdcall wiasParseEndorserString(__in BYTE *pWiasContext, LONG lFlags, - __out_opt WIAS_ENDORSER_INFO *pInfo, __out BSTR *pOutputString); - -#ifndef WIA_MAP_OLD_DEBUG - -#if defined(_DEBUG) || defined(DBG) || defined(WIA_DEBUG) - -#define WIAS_TRACE(x) wiasDebugTrace x -#define WIAS_ERROR(x) wiasDebugError x -#define WIAS_HRESULT(x) wiasPrintDebugHResult x -#define WIAS_ASSERT(x, y) \ - if (!(y)) { \ - WIAS_ERROR((x, (char*) TEXT("ASSERTION FAILED: %hs(%d): %hs"), __FILE__,__LINE__,#x)); \ - DebugBreak(); \ - } - -#else - -#define WIAS_TRACE(x) -#define WIAS_ERROR(x) -#define WIAS_HRESULT(x) -#define WIAS_ASSERT(x, y) - -#endif - -#define WIAS_LTRACE(pILog,ResID,Detail,Args) \ - { if ( pILog ) \ - pILog->Log(WIALOG_TRACE, ResID, Detail, wiasFormatArgs Args);\ - }; -#define WIAS_LERROR(pILog,ResID,Args) \ - {if ( pILog )\ - pILog->Log(WIALOG_ERROR, ResID, WIALOG_NO_LEVEL, wiasFormatArgs Args);\ - }; -#define WIAS_LWARNING(pILog,ResID,Args) \ - {if ( pILog )\ - pILog->Log(WIALOG_WARNING, ResID, WIALOG_NO_LEVEL, wiasFormatArgs Args);\ - }; -#define WIAS_LHRESULT(pILog,hr) \ - {if ( pILog )\ - pILog->hResult(hr);\ - }; - -// -// IWiaLog Defines -// - -// Type of logging -#define WIALOG_TRACE 0x00000001 -#define WIALOG_WARNING 0x00000002 -#define WIALOG_ERROR 0x00000004 - -// level of detail for TRACE logging -#define WIALOG_LEVEL1 1 // Entry and Exit point of each function/method -#define WIALOG_LEVEL2 2 // LEVEL 1, + traces within the function/method -#define WIALOG_LEVEL3 3 // LEVEL 1, LEVEL 2, and any extra debugging information -#define WIALOG_LEVEL4 4 // USER DEFINED data + all LEVELS of tracing - -#define WIALOG_NO_RESOURCE_ID 0 -#define WIALOG_NO_LEVEL 0 - -// -// Entering / Leaving class -// - -class CWiaLogProc { -private: - CHAR m_szMessage[MAX_PATH]; - IWiaLog *m_pIWiaLog; - INT m_DetailLevel; - INT m_ResourceID; - -public: - inline CWiaLogProc(IWiaLog *pIWiaLog, INT ResourceID, INT DetailLevel, __in __nullterminated CHAR *pszMsg) { - ZeroMemory(m_szMessage, sizeof(m_szMessage)); - StringCchCopyA(m_szMessage, ARRAYSIZE(m_szMessage), pszMsg); - m_pIWiaLog = pIWiaLog; - m_DetailLevel = DetailLevel; - m_ResourceID = ResourceID; - WIAS_LTRACE(pIWiaLog, - ResourceID, - DetailLevel, - ("%s, entering",m_szMessage)); - } - - inline ~CWiaLogProc() { - WIAS_LTRACE(m_pIWiaLog, - m_ResourceID, - m_DetailLevel, - ("%s, leaving",m_szMessage)); - } -}; - -class CWiaLogProcEx { -private: - CHAR m_szMessage[MAX_PATH]; - IWiaLogEx *m_pIWiaLog; - INT m_DetailLevel; - INT m_ResourceID; - -public: - inline CWiaLogProcEx(IWiaLogEx *pIWiaLog, INT ResourceID, INT DetailLevel, __in __nullterminated CHAR *pszMsg, LONG lMethodId = 0) { - UNREFERENCED_PARAMETER(lMethodId); - - ZeroMemory(m_szMessage, sizeof(m_szMessage)); - StringCchCopyA(m_szMessage, ARRAYSIZE(m_szMessage), pszMsg); - m_pIWiaLog = pIWiaLog; - m_DetailLevel = DetailLevel; - m_ResourceID = ResourceID; - WIAS_LTRACE(pIWiaLog, - ResourceID, - DetailLevel, - ("%s, entering",m_szMessage)); - } - - inline ~CWiaLogProcEx() { - WIAS_LTRACE(m_pIWiaLog, - m_ResourceID, - m_DetailLevel, - ("%s, leaving",m_szMessage)); - } -}; - -#endif // WIA_MAP_OLD_DEBUG - - -#ifdef __cplusplus -} - -#endif -#endif //#ifdef (NTDDI_VERSION >= NTDDI_WINXP) - -#endif // _WIAMDEF_H_ - - diff --git a/qt-correction-tool/pub/ddk/wiamicro.h b/qt-correction-tool/pub/ddk/wiamicro.h deleted file mode 100644 index 03db54e..0000000 --- a/qt-correction-tool/pub/ddk/wiamicro.h +++ /dev/null @@ -1,221 +0,0 @@ -/**************************************************************************** -* -* (C) COPYRIGHT 1999-2000, MICROSOFT CORP. -* -* FILE: wiamicro.h -* -* VERSION: 3.0 -* -* DESCRIPTION: -* Definitions to support WIA scanner and camera microdrivers. -* -*****************************************************************************/ - -#if (_WIN32_WINNT >= 0x0501) // Windows XP and later - -#pragma once - -#include - -#define WIAMICRO_API __declspec(dllexport) - -#include - -/****************************************************************************\ -* Scanner microdriver definitions -\****************************************************************************/ - -// -// Private #defines -// - -#define MAX_IO_HANDLES 16 -#define MAX_RESERVED 4 -#define MAX_ANSI_CHAR 255 - -// -// Common BUS types -// - -#define BUS_TYPE_SCSI 200 -#define BUS_TYPE_USB 201 -#define BUS_TYPE_PARALLEL 202 -#define BUS_TYPE_FIREWIRE 203 - -// -// command list -// - -#define SCAN_FIRST 10 -#define SCAN_NEXT 20 -#define SCAN_FINISHED 30 - -#define SCANMODE_FINALSCAN 0 -#define SCANMODE_PREVIEWSCAN 1 - -#define CMD_INITIALIZE 100 -#define CMD_UNINITIALIZE 101 -#define CMD_SETXRESOLUTION 102 -#define CMD_SETYRESOLUTION 103 -#define CMD_SETCONTRAST 104 -#define CMD_SETINTENSITY 105 -#define CMD_SETDATATYPE 106 -#define CMD_SETDITHER 107 -#define CMD_SETMIRROR 108 -#define CMD_SETNEGATIVE 109 -#define CMD_SETTONEMAP 110 -#define CMD_SETCOLORDITHER 111 -#define CMD_SETMATRIX 112 -#define CMD_SETSPEED 113 -#define CMD_SETFILTER 114 -#define CMD_LOAD_ADF 115 -#define CMD_UNLOAD_ADF 116 -#define CMD_GETADFAVAILABLE 117 -#define CMD_GETADFOPEN 118 -#define CMD_GETADFREADY 119 -#define CMD_GETADFHASPAPER 120 -#define CMD_GETADFSTATUS 121 -#define CMD_GETADFUNLOADREADY 122 -#define CMD_GETTPAAVAILABLE 123 -#define CMD_GETTPAOPENED 124 -#define CMD_TPAREADY 125 -#define CMD_SETLAMP 126 -#define CMD_SENDSCSICOMMAND 127 -#define CMD_STI_DEVICERESET 128 -#define CMD_STI_GETSTATUS 129 -#define CMD_STI_DIAGNOSTIC 130 -#define CMD_RESETSCANNER 131 -#define CMD_GETCAPABILITIES 132 -#define CMD_GET_INTERRUPT_EVENT 133 -#define CMD_SETGSDNAME 134 -#define CMD_SETSCANMODE 135 -#define CMD_SETSTIDEVICEHKEY 136 -#define CMD_GETSUPPORTEDFILEFORMATS 138 -#define CMD_GETSUPPORTEDMEMORYFORMATS 139 -#define CMD_SETFORMAT 140 - -#define SUPPORT_COLOR 0x00000001 -#define SUPPORT_BW 0x00000002 -#define SUPPORT_GRAYSCALE 0x00000004 - -// -// Error Codes -// - -#define MCRO_ERROR_GENERAL_ERROR 0 // All lVal values are initialized to '0' -#define MCRO_STATUS_OK 1 // General success status return -#define MCRO_ERROR_PAPER_JAM 2 // ADF has a paper Jam -#define MCRO_ERROR_PAPER_PROBLEM 3 // ADF has a paper problem -#define MCRO_ERROR_PAPER_EMPTY 4 // ADF has no paper -#define MCRO_ERROR_OFFLINE 5 // ADF or Device is offline -#define MCRO_ERROR_USER_INTERVENTION 6 // User needs to interact with the physical device - -// -// WIA compatible #defines -// - -#define WIA_PACKED_PIXEL 0 -#define WIA_PLANAR 1 - -#define WIA_ORDER_RGB 0 -#define WIA_ORDER_BGR 1 - -#define WIA_DATA_THRESHOLD 0 -#define WIA_DATA_DITHER 1 -#define WIA_DATA_GRAYSCALE 2 -#define WIA_DATA_COLOR 3 -#define WIA_DATA_COLOR_THRESHOLD 4 -#define WIA_DATA_COLOR_DITHER 5 - -// -// structure definitions -// - -typedef struct _RANGEVALUE { - LONG lMin; // minimum value - LONG lMax; // maximum value - LONG lStep; // increment/step value -} RANGEVALUE, *PRANGEVALUE; - -typedef struct _SCANWINDOW { - LONG xPos; // X position (left) - LONG yPos; // Y position (top) - LONG xExtent; // X extent (right) - LONG yExtent; // Y extent (bottom) -} SCANWINDOW, *PSCANWINDOW; - -typedef struct _SCANINFO { - // Common Scanner specs - LONG ADF; // (0 - no support, 1 - supported, 2 - supported and It can duplex) - LONG TPA; // (0 - no support, 1 - supported) - LONG Endorser; // (0 - no endorser, 1 - supported) - LONG OpticalXResolution; // (dpi setting of optics) - LONG OpticalYResolution; // (dpi setting of optics) - LONG BedWidth; // (bed width in 1000's of an inch) - LONG BedHeight; // (bed height in 1000's of an inch) - RANGEVALUE IntensityRange; // (Intensity/Brightness ranges) - RANGEVALUE ContrastRange; // (Contrast ranges) - LONG SupportedCompressionType; // (mask of supported compression types, 0 - None) - LONG SupportedDataTypes; // (mask of supported types, (ie. SUPPORT_COLOR|SUPPORT_BW...)) - // Current Image Info - LONG WidthPixels; // (width of image, using current scanner settings in pixels) - LONG WidthBytes; // (width of image, using current scanner settings in bytes) - LONG Lines; // (height of image, using current scanner settings in pixles) - LONG DataType; // (current data type set) - LONG PixelBits; // (current bit depth setting) - // Current Scanner settings - LONG Intensity; // (current Intensity/Brightness setting) - LONG Contrast; // (current contrast setting) - LONG Xresolution; // (current X Resolution) - LONG Yresolution; // (current Y Resolution - SCANWINDOW Window; // (current scanner window settings) - // Scanner options - LONG DitherPattern; - LONG Negative; // (0 - off, 1 - Negative is on) - LONG Mirror; // (0 - off, 1 - Mirror is on) - LONG AutoBack; // (0 - off, 1 - AutoBack is on) - LONG ColorDitherPattern; // (dither pattern??) - LONG ToneMap; // (tone map ??) - LONG Compression; // (0 - off, 1 - Compression is on) - LONG RawDataFormat; // (0 - Packed data 1 - Planar data) - LONG RawPixelOrder; // (0 - RGB, 1 - BGR) - LONG bNeedDataAlignment; // (0 - FALSE, 1 - TRUE) - LONG DelayBetweenRead; // delay between WIA Scan() calls requesting data (milliseconds) - LONG MaxBufferSize; // maximum buffer size in scanner - HANDLE DeviceIOHandles[MAX_IO_HANDLES]; // Device IO handles needed for device communication - LONG lReserved[MAX_RESERVED]; // (silly reserved bits) - VOID *pMicroDriverContext; // private data for Micro driver's only. - // The Micro Driver is responsible for allocating and freeing. - // CMD_INITIALIZE - allocate, CMD_UNINITIALIZE - free -}SCANINFO, *PSCANINFO; - -typedef struct VAL { - LONG lVal; // long value - double dblVal; // float/double value - GUID *pGuid; // GUID pointer - PSCANINFO pScanInfo; // pointer to the shared ScanInfo struct - HGLOBAL handle; // handle value - WCHAR **ppButtonNames; // pointer to button names array - HANDLE *pHandle; // pointer to a Handle value - LONG lReserved; // lone value - CHAR szVal[MAX_ANSI_CHAR]; // ANSI string -}VAL, *PVAL; - -// -// Micro driver entry points -// - -WIAMICRO_API HRESULT MicroEntry(LONG lCommand, __inout PVAL pValue); -WIAMICRO_API HRESULT Scan(__inout PSCANINFO pScanInfo, LONG lPhase, __out_bcount(lLength) PBYTE pBuffer, LONG lLength, __out LONG *plReceived); -WIAMICRO_API HRESULT SetPixelWindow(__inout PSCANINFO pScanInfo, LONG x, LONG y, LONG xExtent, LONG yExtent); - -// -// optional debug trace -// - -VOID Trace(__in LPCTSTR Format, ...); - -#include - -#endif //#if (_WIN32_WINNT >= 0x0501) - diff --git a/qt-correction-tool/pub/ddk/wiamindr.h b/qt-correction-tool/pub/ddk/wiamindr.h deleted file mode 100644 index ee2aeac..0000000 --- a/qt-correction-tool/pub/ddk/wiamindr.h +++ /dev/null @@ -1,6 +0,0 @@ -#if (NTDDI_VERSION >= NTDDI_VISTA) -#include -#elif (NTDDI_VERSION >= NTDDI_WINXP) -#include -#endif - diff --git a/qt-correction-tool/pub/ddk/wiamindr_lh.h b/qt-correction-tool/pub/ddk/wiamindr_lh.h deleted file mode 100644 index c73c4d0..0000000 --- a/qt-correction-tool/pub/ddk/wiamindr_lh.h +++ /dev/null @@ -1,1032 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for wiamindr_lh.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __wiamindr_lh_h__ -#define __wiamindr_lh_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IWiaMiniDrv_FWD_DEFINED__ -#define __IWiaMiniDrv_FWD_DEFINED__ -typedef interface IWiaMiniDrv IWiaMiniDrv; -#endif /* __IWiaMiniDrv_FWD_DEFINED__ */ - - -#ifndef __IWiaMiniDrvCallBack_FWD_DEFINED__ -#define __IWiaMiniDrvCallBack_FWD_DEFINED__ -typedef interface IWiaMiniDrvCallBack IWiaMiniDrvCallBack; -#endif /* __IWiaMiniDrvCallBack_FWD_DEFINED__ */ - - -#ifndef __IWiaMiniDrvTransferCallback_FWD_DEFINED__ -#define __IWiaMiniDrvTransferCallback_FWD_DEFINED__ -typedef interface IWiaMiniDrvTransferCallback IWiaMiniDrvTransferCallback; -#endif /* __IWiaMiniDrvTransferCallback_FWD_DEFINED__ */ - - -#ifndef __IWiaDrvItem_FWD_DEFINED__ -#define __IWiaDrvItem_FWD_DEFINED__ -typedef interface IWiaDrvItem IWiaDrvItem; -#endif /* __IWiaDrvItem_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "oaidl.h" -#include "propidl.h" -#include "wia_lh.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_wiamindr_lh_0000_0000 */ -/* [local] */ - - - - - - - -typedef struct _MINIDRV_TRANSFER_CONTEXT - { - LONG lSize; - LONG lWidthInPixels; - LONG lLines; - LONG lDepth; - LONG lXRes; - LONG lYRes; - LONG lCompression; - GUID guidFormatID; - LONG tymed; - LONG_PTR hFile; - LONG cbOffset; - LONG lBufferSize; - LONG lActiveBuffer; - LONG lNumBuffers; - BYTE *pBaseBuffer; - BYTE *pTransferBuffer; - BOOL bTransferDataCB; - BOOL bClassDrvAllocBuf; - LONG_PTR lClientAddress; - IWiaMiniDrvCallBack *pIWiaMiniDrvCallBack; - LONG lImageSize; - LONG lHeaderSize; - LONG lItemSize; - LONG cbWidthInBytes; - LONG lPage; - LONG lCurIfdOffset; - LONG lPrevIfdOffset; - } MINIDRV_TRANSFER_CONTEXT; - -typedef struct _MINIDRV_TRANSFER_CONTEXT *PMINIDRV_TRANSFER_CONTEXT; - -typedef struct _WIA_DEV_CAP_DRV - { - GUID *guid; - ULONG ulFlags; - LPOLESTR wszName; - LPOLESTR wszDescription; - LPOLESTR wszIcon; - } WIA_DEV_CAP_DRV; - -typedef struct _WIA_DEV_CAP_DRV *PWIA_DEV_CAP_DRV; - - - -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_lh_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_lh_0000_0000_v0_0_s_ifspec; - -#ifndef __IWiaMiniDrv_INTERFACE_DEFINED__ -#define __IWiaMiniDrv_INTERFACE_DEFINED__ - -/* interface IWiaMiniDrv */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaMiniDrv; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d8cdee14-3c6c-11d2-9a35-00c04fa36145") - IWiaMiniDrv : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvInitializeWia( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0000, - /* [in] */ LONG __MIDL__IWiaMiniDrv0001, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0002, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0003, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0004, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0005, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0006, - /* [out] */ __RPC__deref_out_opt IUnknown **__MIDL__IWiaMiniDrv0007, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0008) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvAcquireItemData( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0009, - /* [in] */ LONG __MIDL__IWiaMiniDrv0010, - /* [out][in] */ __RPC__inout PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0011, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0012) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvInitItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0013, - /* [in] */ LONG __MIDL__IWiaMiniDrv0014, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0015) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvValidateItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0016, - /* [in] */ LONG __MIDL__IWiaMiniDrv0017, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0018, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0019, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0020) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvWriteItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0021, - /* [in] */ LONG __MIDL__IWiaMiniDrv0022, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0023, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0024) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvReadItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0025, - /* [in] */ LONG __MIDL__IWiaMiniDrv0026, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0027, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0028, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0029) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvLockWiaDevice( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0030, - /* [in] */ LONG __MIDL__IWiaMiniDrv0031, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0032) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvUnLockWiaDevice( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0033, - /* [in] */ LONG __MIDL__IWiaMiniDrv0034, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0035) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvAnalyzeItem( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0036, - /* [in] */ LONG __MIDL__IWiaMiniDrv0037, - /* [in] */ __RPC__in LONG *__MIDL__IWiaMiniDrv0038) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetDeviceErrorStr( - /* [in] */ LONG __MIDL__IWiaMiniDrv0039, - /* [in] */ LONG __MIDL__IWiaMiniDrv0040, - /* [string][out] */ __RPC__deref_out_opt_string LPOLESTR *__MIDL__IWiaMiniDrv0041, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0042) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvDeviceCommand( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0043, - /* [in] */ LONG __MIDL__IWiaMiniDrv0044, - /* [in] */ __RPC__in const GUID *__MIDL__IWiaMiniDrv0045, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0046, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0047) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetCapabilities( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0048, - /* [in] */ LONG __MIDL__IWiaMiniDrv0049, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0050, - /* [out] */ __RPC__deref_out_opt WIA_DEV_CAP_DRV **__MIDL__IWiaMiniDrv0051, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0052) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvDeleteItem( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0053, - /* [in] */ LONG __MIDL__IWiaMiniDrv0054, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0055) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvFreeDrvItemContext( - /* [in] */ LONG __MIDL__IWiaMiniDrv0056, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0057, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0058) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetWiaFormatInfo( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0059, - /* [in] */ LONG __MIDL__IWiaMiniDrv0060, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0061, - /* [out] */ __RPC__deref_out_opt WIA_FORMAT_INFO **__MIDL__IWiaMiniDrv0062, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0063) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvNotifyPnpEvent( - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ ULONG ulReserved) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvUnInitializeWia( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0064) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaMiniDrvVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaMiniDrv * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaMiniDrv * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvInitializeWia )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0000, - /* [in] */ LONG __MIDL__IWiaMiniDrv0001, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0002, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0003, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0004, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0005, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0006, - /* [out] */ __RPC__deref_out_opt IUnknown **__MIDL__IWiaMiniDrv0007, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0008); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvAcquireItemData )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0009, - /* [in] */ LONG __MIDL__IWiaMiniDrv0010, - /* [out][in] */ __RPC__inout PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0011, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0012); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvInitItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0013, - /* [in] */ LONG __MIDL__IWiaMiniDrv0014, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0015); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvValidateItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0016, - /* [in] */ LONG __MIDL__IWiaMiniDrv0017, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0018, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0019, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0020); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvWriteItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0021, - /* [in] */ LONG __MIDL__IWiaMiniDrv0022, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0023, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0024); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvReadItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0025, - /* [in] */ LONG __MIDL__IWiaMiniDrv0026, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0027, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0028, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0029); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvLockWiaDevice )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0030, - /* [in] */ LONG __MIDL__IWiaMiniDrv0031, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0032); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvUnLockWiaDevice )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0033, - /* [in] */ LONG __MIDL__IWiaMiniDrv0034, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0035); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvAnalyzeItem )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0036, - /* [in] */ LONG __MIDL__IWiaMiniDrv0037, - /* [in] */ __RPC__in LONG *__MIDL__IWiaMiniDrv0038); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetDeviceErrorStr )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ LONG __MIDL__IWiaMiniDrv0039, - /* [in] */ LONG __MIDL__IWiaMiniDrv0040, - /* [string][out] */ __RPC__deref_out_opt_string LPOLESTR *__MIDL__IWiaMiniDrv0041, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0042); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvDeviceCommand )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0043, - /* [in] */ LONG __MIDL__IWiaMiniDrv0044, - /* [in] */ __RPC__in const GUID *__MIDL__IWiaMiniDrv0045, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0046, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0047); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetCapabilities )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0048, - /* [in] */ LONG __MIDL__IWiaMiniDrv0049, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0050, - /* [out] */ __RPC__deref_out_opt WIA_DEV_CAP_DRV **__MIDL__IWiaMiniDrv0051, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0052); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvDeleteItem )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0053, - /* [in] */ LONG __MIDL__IWiaMiniDrv0054, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0055); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvFreeDrvItemContext )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ LONG __MIDL__IWiaMiniDrv0056, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0057, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0058); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetWiaFormatInfo )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0059, - /* [in] */ LONG __MIDL__IWiaMiniDrv0060, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0061, - /* [out] */ __RPC__deref_out_opt WIA_FORMAT_INFO **__MIDL__IWiaMiniDrv0062, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0063); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvNotifyPnpEvent )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ ULONG ulReserved); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvUnInitializeWia )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0064); - - END_INTERFACE - } IWiaMiniDrvVtbl; - - interface IWiaMiniDrv - { - CONST_VTBL struct IWiaMiniDrvVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaMiniDrv_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaMiniDrv_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaMiniDrv_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaMiniDrv_drvInitializeWia(This,__MIDL__IWiaMiniDrv0000,__MIDL__IWiaMiniDrv0001,__MIDL__IWiaMiniDrv0002,__MIDL__IWiaMiniDrv0003,__MIDL__IWiaMiniDrv0004,__MIDL__IWiaMiniDrv0005,__MIDL__IWiaMiniDrv0006,__MIDL__IWiaMiniDrv0007,__MIDL__IWiaMiniDrv0008) \ - ( (This)->lpVtbl -> drvInitializeWia(This,__MIDL__IWiaMiniDrv0000,__MIDL__IWiaMiniDrv0001,__MIDL__IWiaMiniDrv0002,__MIDL__IWiaMiniDrv0003,__MIDL__IWiaMiniDrv0004,__MIDL__IWiaMiniDrv0005,__MIDL__IWiaMiniDrv0006,__MIDL__IWiaMiniDrv0007,__MIDL__IWiaMiniDrv0008) ) - -#define IWiaMiniDrv_drvAcquireItemData(This,__MIDL__IWiaMiniDrv0009,__MIDL__IWiaMiniDrv0010,__MIDL__IWiaMiniDrv0011,__MIDL__IWiaMiniDrv0012) \ - ( (This)->lpVtbl -> drvAcquireItemData(This,__MIDL__IWiaMiniDrv0009,__MIDL__IWiaMiniDrv0010,__MIDL__IWiaMiniDrv0011,__MIDL__IWiaMiniDrv0012) ) - -#define IWiaMiniDrv_drvInitItemProperties(This,__MIDL__IWiaMiniDrv0013,__MIDL__IWiaMiniDrv0014,__MIDL__IWiaMiniDrv0015) \ - ( (This)->lpVtbl -> drvInitItemProperties(This,__MIDL__IWiaMiniDrv0013,__MIDL__IWiaMiniDrv0014,__MIDL__IWiaMiniDrv0015) ) - -#define IWiaMiniDrv_drvValidateItemProperties(This,__MIDL__IWiaMiniDrv0016,__MIDL__IWiaMiniDrv0017,__MIDL__IWiaMiniDrv0018,__MIDL__IWiaMiniDrv0019,__MIDL__IWiaMiniDrv0020) \ - ( (This)->lpVtbl -> drvValidateItemProperties(This,__MIDL__IWiaMiniDrv0016,__MIDL__IWiaMiniDrv0017,__MIDL__IWiaMiniDrv0018,__MIDL__IWiaMiniDrv0019,__MIDL__IWiaMiniDrv0020) ) - -#define IWiaMiniDrv_drvWriteItemProperties(This,__MIDL__IWiaMiniDrv0021,__MIDL__IWiaMiniDrv0022,__MIDL__IWiaMiniDrv0023,__MIDL__IWiaMiniDrv0024) \ - ( (This)->lpVtbl -> drvWriteItemProperties(This,__MIDL__IWiaMiniDrv0021,__MIDL__IWiaMiniDrv0022,__MIDL__IWiaMiniDrv0023,__MIDL__IWiaMiniDrv0024) ) - -#define IWiaMiniDrv_drvReadItemProperties(This,__MIDL__IWiaMiniDrv0025,__MIDL__IWiaMiniDrv0026,__MIDL__IWiaMiniDrv0027,__MIDL__IWiaMiniDrv0028,__MIDL__IWiaMiniDrv0029) \ - ( (This)->lpVtbl -> drvReadItemProperties(This,__MIDL__IWiaMiniDrv0025,__MIDL__IWiaMiniDrv0026,__MIDL__IWiaMiniDrv0027,__MIDL__IWiaMiniDrv0028,__MIDL__IWiaMiniDrv0029) ) - -#define IWiaMiniDrv_drvLockWiaDevice(This,__MIDL__IWiaMiniDrv0030,__MIDL__IWiaMiniDrv0031,__MIDL__IWiaMiniDrv0032) \ - ( (This)->lpVtbl -> drvLockWiaDevice(This,__MIDL__IWiaMiniDrv0030,__MIDL__IWiaMiniDrv0031,__MIDL__IWiaMiniDrv0032) ) - -#define IWiaMiniDrv_drvUnLockWiaDevice(This,__MIDL__IWiaMiniDrv0033,__MIDL__IWiaMiniDrv0034,__MIDL__IWiaMiniDrv0035) \ - ( (This)->lpVtbl -> drvUnLockWiaDevice(This,__MIDL__IWiaMiniDrv0033,__MIDL__IWiaMiniDrv0034,__MIDL__IWiaMiniDrv0035) ) - -#define IWiaMiniDrv_drvAnalyzeItem(This,__MIDL__IWiaMiniDrv0036,__MIDL__IWiaMiniDrv0037,__MIDL__IWiaMiniDrv0038) \ - ( (This)->lpVtbl -> drvAnalyzeItem(This,__MIDL__IWiaMiniDrv0036,__MIDL__IWiaMiniDrv0037,__MIDL__IWiaMiniDrv0038) ) - -#define IWiaMiniDrv_drvGetDeviceErrorStr(This,__MIDL__IWiaMiniDrv0039,__MIDL__IWiaMiniDrv0040,__MIDL__IWiaMiniDrv0041,__MIDL__IWiaMiniDrv0042) \ - ( (This)->lpVtbl -> drvGetDeviceErrorStr(This,__MIDL__IWiaMiniDrv0039,__MIDL__IWiaMiniDrv0040,__MIDL__IWiaMiniDrv0041,__MIDL__IWiaMiniDrv0042) ) - -#define IWiaMiniDrv_drvDeviceCommand(This,__MIDL__IWiaMiniDrv0043,__MIDL__IWiaMiniDrv0044,__MIDL__IWiaMiniDrv0045,__MIDL__IWiaMiniDrv0046,__MIDL__IWiaMiniDrv0047) \ - ( (This)->lpVtbl -> drvDeviceCommand(This,__MIDL__IWiaMiniDrv0043,__MIDL__IWiaMiniDrv0044,__MIDL__IWiaMiniDrv0045,__MIDL__IWiaMiniDrv0046,__MIDL__IWiaMiniDrv0047) ) - -#define IWiaMiniDrv_drvGetCapabilities(This,__MIDL__IWiaMiniDrv0048,__MIDL__IWiaMiniDrv0049,__MIDL__IWiaMiniDrv0050,__MIDL__IWiaMiniDrv0051,__MIDL__IWiaMiniDrv0052) \ - ( (This)->lpVtbl -> drvGetCapabilities(This,__MIDL__IWiaMiniDrv0048,__MIDL__IWiaMiniDrv0049,__MIDL__IWiaMiniDrv0050,__MIDL__IWiaMiniDrv0051,__MIDL__IWiaMiniDrv0052) ) - -#define IWiaMiniDrv_drvDeleteItem(This,__MIDL__IWiaMiniDrv0053,__MIDL__IWiaMiniDrv0054,__MIDL__IWiaMiniDrv0055) \ - ( (This)->lpVtbl -> drvDeleteItem(This,__MIDL__IWiaMiniDrv0053,__MIDL__IWiaMiniDrv0054,__MIDL__IWiaMiniDrv0055) ) - -#define IWiaMiniDrv_drvFreeDrvItemContext(This,__MIDL__IWiaMiniDrv0056,__MIDL__IWiaMiniDrv0057,__MIDL__IWiaMiniDrv0058) \ - ( (This)->lpVtbl -> drvFreeDrvItemContext(This,__MIDL__IWiaMiniDrv0056,__MIDL__IWiaMiniDrv0057,__MIDL__IWiaMiniDrv0058) ) - -#define IWiaMiniDrv_drvGetWiaFormatInfo(This,__MIDL__IWiaMiniDrv0059,__MIDL__IWiaMiniDrv0060,__MIDL__IWiaMiniDrv0061,__MIDL__IWiaMiniDrv0062,__MIDL__IWiaMiniDrv0063) \ - ( (This)->lpVtbl -> drvGetWiaFormatInfo(This,__MIDL__IWiaMiniDrv0059,__MIDL__IWiaMiniDrv0060,__MIDL__IWiaMiniDrv0061,__MIDL__IWiaMiniDrv0062,__MIDL__IWiaMiniDrv0063) ) - -#define IWiaMiniDrv_drvNotifyPnpEvent(This,pEventGUID,bstrDeviceID,ulReserved) \ - ( (This)->lpVtbl -> drvNotifyPnpEvent(This,pEventGUID,bstrDeviceID,ulReserved) ) - -#define IWiaMiniDrv_drvUnInitializeWia(This,__MIDL__IWiaMiniDrv0064) \ - ( (This)->lpVtbl -> drvUnInitializeWia(This,__MIDL__IWiaMiniDrv0064) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaMiniDrv_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ -#define __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ - -/* interface IWiaMiniDrvCallBack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaMiniDrvCallBack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("33a57d5a-3de8-11d2-9a36-00c04fa36145") - IWiaMiniDrvCallBack : public IUnknown - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MiniDrvCallback( - /* [in] */ LONG lReason, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT pTranCtx, - /* [in] */ LONG lReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaMiniDrvCallBackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaMiniDrvCallBack * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaMiniDrvCallBack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaMiniDrvCallBack * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *MiniDrvCallback )( - __RPC__in IWiaMiniDrvCallBack * This, - /* [in] */ LONG lReason, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT pTranCtx, - /* [in] */ LONG lReserved); - - END_INTERFACE - } IWiaMiniDrvCallBackVtbl; - - interface IWiaMiniDrvCallBack - { - CONST_VTBL struct IWiaMiniDrvCallBackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaMiniDrvCallBack_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaMiniDrvCallBack_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaMiniDrvCallBack_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaMiniDrvCallBack_MiniDrvCallback(This,lReason,lStatus,lPercentComplete,lOffset,lLength,pTranCtx,lReserved) \ - ( (This)->lpVtbl -> MiniDrvCallback(This,lReason,lStatus,lPercentComplete,lOffset,lLength,pTranCtx,lReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaMiniDrvTransferCallback_INTERFACE_DEFINED__ -#define __IWiaMiniDrvTransferCallback_INTERFACE_DEFINED__ - -/* interface IWiaMiniDrvTransferCallback */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaMiniDrvTransferCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("a9d2ee89-2ce5-4ff0-8adb-c961d1d774ca") - IWiaMiniDrvTransferCallback : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE GetNextStream( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SendMessage( - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in WiaTransferParams *pWiaTransferParams) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaMiniDrvTransferCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaMiniDrvTransferCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaMiniDrvTransferCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaMiniDrvTransferCallback * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *GetNextStream )( - __RPC__in IWiaMiniDrvTransferCallback * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in BSTR bstrItemName, - /* [in] */ __RPC__in BSTR bstrFullItemName, - /* [out] */ __RPC__deref_out_opt IStream **ppIStream); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SendMessage )( - __RPC__in IWiaMiniDrvTransferCallback * This, - /* [in] */ LONG lFlags, - /* [in] */ __RPC__in WiaTransferParams *pWiaTransferParams); - - END_INTERFACE - } IWiaMiniDrvTransferCallbackVtbl; - - interface IWiaMiniDrvTransferCallback - { - CONST_VTBL struct IWiaMiniDrvTransferCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaMiniDrvTransferCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaMiniDrvTransferCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaMiniDrvTransferCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaMiniDrvTransferCallback_GetNextStream(This,lFlags,bstrItemName,bstrFullItemName,ppIStream) \ - ( (This)->lpVtbl -> GetNextStream(This,lFlags,bstrItemName,bstrFullItemName,ppIStream) ) - -#define IWiaMiniDrvTransferCallback_SendMessage(This,lFlags,pWiaTransferParams) \ - ( (This)->lpVtbl -> SendMessage(This,lFlags,pWiaTransferParams) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaMiniDrvTransferCallback_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaDrvItem_INTERFACE_DEFINED__ -#define __IWiaDrvItem_INTERFACE_DEFINED__ - -/* interface IWiaDrvItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDrvItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1f02b5c5-b00c-11d2-a094-00c04f72dc3c") - IWiaDrvItem : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetItemFlags( - /* [out] */ __RPC__out LONG *__MIDL__IWiaDrvItem0000) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDeviceSpecContext( - /* [out] */ __RPC__deref_out_opt BYTE **__MIDL__IWiaDrvItem0001) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFullItemName( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0002) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetItemName( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0003) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddItemToFolder( - /* [in] */ __RPC__in_opt IWiaDrvItem *__MIDL__IWiaDrvItem0004) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnlinkItemTree( - /* [in] */ LONG __MIDL__IWiaDrvItem0005) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveItemFromFolder( - /* [in] */ LONG __MIDL__IWiaDrvItem0006) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindItemByName( - /* [in] */ LONG __MIDL__IWiaDrvItem0007, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0008, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0009) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindChildItemByName( - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0010, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0011) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParentItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0012) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFirstChildItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0013) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextSiblingItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0014) = 0; - - virtual HRESULT STDMETHODCALLTYPE DumpItemData( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0015) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDrvItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDrvItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDrvItem * This); - - HRESULT ( STDMETHODCALLTYPE *GetItemFlags )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__out LONG *__MIDL__IWiaDrvItem0000); - - HRESULT ( STDMETHODCALLTYPE *GetDeviceSpecContext )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BYTE **__MIDL__IWiaDrvItem0001); - - HRESULT ( STDMETHODCALLTYPE *GetFullItemName )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0002); - - HRESULT ( STDMETHODCALLTYPE *GetItemName )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0003); - - HRESULT ( STDMETHODCALLTYPE *AddItemToFolder )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in_opt IWiaDrvItem *__MIDL__IWiaDrvItem0004); - - HRESULT ( STDMETHODCALLTYPE *UnlinkItemTree )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0005); - - HRESULT ( STDMETHODCALLTYPE *RemoveItemFromFolder )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0006); - - HRESULT ( STDMETHODCALLTYPE *FindItemByName )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0007, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0008, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0009); - - HRESULT ( STDMETHODCALLTYPE *FindChildItemByName )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0010, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0011); - - HRESULT ( STDMETHODCALLTYPE *GetParentItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0012); - - HRESULT ( STDMETHODCALLTYPE *GetFirstChildItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0013); - - HRESULT ( STDMETHODCALLTYPE *GetNextSiblingItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0014); - - HRESULT ( STDMETHODCALLTYPE *DumpItemData )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0015); - - END_INTERFACE - } IWiaDrvItemVtbl; - - interface IWiaDrvItem - { - CONST_VTBL struct IWiaDrvItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDrvItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDrvItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDrvItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDrvItem_GetItemFlags(This,__MIDL__IWiaDrvItem0000) \ - ( (This)->lpVtbl -> GetItemFlags(This,__MIDL__IWiaDrvItem0000) ) - -#define IWiaDrvItem_GetDeviceSpecContext(This,__MIDL__IWiaDrvItem0001) \ - ( (This)->lpVtbl -> GetDeviceSpecContext(This,__MIDL__IWiaDrvItem0001) ) - -#define IWiaDrvItem_GetFullItemName(This,__MIDL__IWiaDrvItem0002) \ - ( (This)->lpVtbl -> GetFullItemName(This,__MIDL__IWiaDrvItem0002) ) - -#define IWiaDrvItem_GetItemName(This,__MIDL__IWiaDrvItem0003) \ - ( (This)->lpVtbl -> GetItemName(This,__MIDL__IWiaDrvItem0003) ) - -#define IWiaDrvItem_AddItemToFolder(This,__MIDL__IWiaDrvItem0004) \ - ( (This)->lpVtbl -> AddItemToFolder(This,__MIDL__IWiaDrvItem0004) ) - -#define IWiaDrvItem_UnlinkItemTree(This,__MIDL__IWiaDrvItem0005) \ - ( (This)->lpVtbl -> UnlinkItemTree(This,__MIDL__IWiaDrvItem0005) ) - -#define IWiaDrvItem_RemoveItemFromFolder(This,__MIDL__IWiaDrvItem0006) \ - ( (This)->lpVtbl -> RemoveItemFromFolder(This,__MIDL__IWiaDrvItem0006) ) - -#define IWiaDrvItem_FindItemByName(This,__MIDL__IWiaDrvItem0007,__MIDL__IWiaDrvItem0008,__MIDL__IWiaDrvItem0009) \ - ( (This)->lpVtbl -> FindItemByName(This,__MIDL__IWiaDrvItem0007,__MIDL__IWiaDrvItem0008,__MIDL__IWiaDrvItem0009) ) - -#define IWiaDrvItem_FindChildItemByName(This,__MIDL__IWiaDrvItem0010,__MIDL__IWiaDrvItem0011) \ - ( (This)->lpVtbl -> FindChildItemByName(This,__MIDL__IWiaDrvItem0010,__MIDL__IWiaDrvItem0011) ) - -#define IWiaDrvItem_GetParentItem(This,__MIDL__IWiaDrvItem0012) \ - ( (This)->lpVtbl -> GetParentItem(This,__MIDL__IWiaDrvItem0012) ) - -#define IWiaDrvItem_GetFirstChildItem(This,__MIDL__IWiaDrvItem0013) \ - ( (This)->lpVtbl -> GetFirstChildItem(This,__MIDL__IWiaDrvItem0013) ) - -#define IWiaDrvItem_GetNextSiblingItem(This,__MIDL__IWiaDrvItem0014) \ - ( (This)->lpVtbl -> GetNextSiblingItem(This,__MIDL__IWiaDrvItem0014) ) - -#define IWiaDrvItem_DumpItemData(This,__MIDL__IWiaDrvItem0015) \ - ( (This)->lpVtbl -> DumpItemData(This,__MIDL__IWiaDrvItem0015) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaDrvItem_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wiamindr_lh_0000_0004 */ -/* [local] */ - -typedef struct _WIA_PROPERTY_INFO - { - ULONG lAccessFlags; - VARTYPE vt; - union - { - struct - { - LONG Min; - LONG Nom; - LONG Max; - LONG Inc; - } Range; - struct - { - DOUBLE Min; - DOUBLE Nom; - DOUBLE Max; - DOUBLE Inc; - } RangeFloat; - struct - { - LONG cNumList; - LONG Nom; - BYTE *pList; - } List; - struct - { - LONG cNumList; - DOUBLE Nom; - BYTE *pList; - } ListFloat; - struct - { - LONG cNumList; - GUID Nom; - GUID *pList; - } ListGuid; - struct - { - LONG cNumList; - BSTR Nom; - BSTR *pList; - } ListBStr; - struct - { - LONG Nom; - LONG ValidBits; - } Flag; - struct - { - LONG Dummy; - } None; - } ValidVal; - } WIA_PROPERTY_INFO; - -typedef struct _WIA_PROPERTY_INFO *PWIA_PROPERTY_INFO; - -typedef struct _WIA_PROPERTY_CONTEXT - { - ULONG cProps; - PROPID *pProps; - BOOL *pChanged; - } WIA_PROPERTY_CONTEXT; - -typedef struct _WIA_PROPERTY_CONTEXT *PWIA_PROPERTY_CONTEXT; - -typedef struct _WIAS_CHANGED_VALUE_INFO - { - BOOL bChanged; - LONG vt; - union - { - LONG lVal; - FLOAT fltVal; - BSTR bstrVal; - GUID guidVal; - } Old; - union - { - LONG lVal; - FLOAT fltVal; - BSTR bstrVal; - GUID guidVal; - } Current; - } WIAS_CHANGED_VALUE_INFO; - -typedef struct _WIAS_CHANGED_VALUE_INFO *PWIAS_CHANGED_VALUE_INFO; - -typedef struct _WIAS_DOWN_SAMPLE_INFO - { - ULONG ulOriginalWidth; - ULONG ulOriginalHeight; - ULONG ulBitsPerPixel; - ULONG ulXRes; - ULONG ulYRes; - ULONG ulDownSampledWidth; - ULONG ulDownSampledHeight; - ULONG ulActualSize; - ULONG ulDestBufSize; - ULONG ulSrcBufSize; - BYTE *pSrcBuffer; - BYTE *pDestBuffer; - } WIAS_DOWN_SAMPLE_INFO; - -typedef struct _WIAS_DOWN_SAMPLE_INFO *PWIAS_DOWN_SAMPLE_INFO; - -typedef struct _WIAS_ENDORSER_VALUE - { - LPWSTR wszTokenName; - LPWSTR wszValue; - } WIAS_ENDORSER_VALUE; - -typedef struct _WIAS_ENDORSER_VALUE *PWIAS_ENDORSER_VALUE; - -typedef struct _WIAS_ENDORSER_INFO - { - ULONG ulPageCount; - ULONG ulNumEndorserValues; - WIAS_ENDORSER_VALUE *pEndorserValues; - } WIAS_ENDORSER_INFO; - -typedef struct _WIAS_ENDORSER_INFO *PWIAS_ENDORSER_INFO; - -#include "wiamdef.h" - - -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_lh_0000_0004_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_lh_0000_0004_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/wiamindr_xp.h b/qt-correction-tool/pub/ddk/wiamindr_xp.h deleted file mode 100644 index f84b33c..0000000 --- a/qt-correction-tool/pub/ddk/wiamindr_xp.h +++ /dev/null @@ -1,928 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for wiamindr_xp.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __wiamindr_xp_h__ -#define __wiamindr_xp_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IWiaMiniDrv_FWD_DEFINED__ -#define __IWiaMiniDrv_FWD_DEFINED__ -typedef interface IWiaMiniDrv IWiaMiniDrv; -#endif /* __IWiaMiniDrv_FWD_DEFINED__ */ - - -#ifndef __IWiaMiniDrvCallBack_FWD_DEFINED__ -#define __IWiaMiniDrvCallBack_FWD_DEFINED__ -typedef interface IWiaMiniDrvCallBack IWiaMiniDrvCallBack; -#endif /* __IWiaMiniDrvCallBack_FWD_DEFINED__ */ - - -#ifndef __IWiaDrvItem_FWD_DEFINED__ -#define __IWiaDrvItem_FWD_DEFINED__ -typedef interface IWiaDrvItem IWiaDrvItem; -#endif /* __IWiaDrvItem_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "unknwn.h" -#include "oaidl.h" -#include "propidl.h" -#include "wia_xp.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_wiamindr_xp_0000_0000 */ -/* [local] */ - - - - - - -typedef struct _MINIDRV_TRANSFER_CONTEXT - { - LONG lSize; - LONG lWidthInPixels; - LONG lLines; - LONG lDepth; - LONG lXRes; - LONG lYRes; - LONG lCompression; - GUID guidFormatID; - LONG tymed; - LONG_PTR hFile; - LONG cbOffset; - LONG lBufferSize; - LONG lActiveBuffer; - LONG lNumBuffers; - BYTE *pBaseBuffer; - BYTE *pTransferBuffer; - BOOL bTransferDataCB; - BOOL bClassDrvAllocBuf; - LONG_PTR lClientAddress; - IWiaMiniDrvCallBack *pIWiaMiniDrvCallBack; - LONG lImageSize; - LONG lHeaderSize; - LONG lItemSize; - LONG cbWidthInBytes; - LONG lPage; - LONG lCurIfdOffset; - LONG lPrevIfdOffset; - } MINIDRV_TRANSFER_CONTEXT; - -typedef struct _MINIDRV_TRANSFER_CONTEXT *PMINIDRV_TRANSFER_CONTEXT; - -typedef struct _WIA_DEV_CAP_DRV - { - GUID *guid; - ULONG ulFlags; - LPOLESTR wszName; - LPOLESTR wszDescription; - LPOLESTR wszIcon; - } WIA_DEV_CAP_DRV; - -typedef struct _WIA_DEV_CAP_DRV *PWIA_DEV_CAP_DRV; - - - -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_xp_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_xp_0000_0000_v0_0_s_ifspec; - -#ifndef __IWiaMiniDrv_INTERFACE_DEFINED__ -#define __IWiaMiniDrv_INTERFACE_DEFINED__ - -/* interface IWiaMiniDrv */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaMiniDrv; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("d8cdee14-3c6c-11d2-9a35-00c04fa36145") - IWiaMiniDrv : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvInitializeWia( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0000, - /* [in] */ LONG __MIDL__IWiaMiniDrv0001, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0002, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0003, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0004, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0005, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0006, - /* [out] */ __RPC__deref_out_opt IUnknown **__MIDL__IWiaMiniDrv0007, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0008) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvAcquireItemData( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0009, - /* [in] */ LONG __MIDL__IWiaMiniDrv0010, - /* [out][in] */ __RPC__inout PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0011, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0012) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvInitItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0013, - /* [in] */ LONG __MIDL__IWiaMiniDrv0014, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0015) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvValidateItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0016, - /* [in] */ LONG __MIDL__IWiaMiniDrv0017, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0018, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0019, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0020) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvWriteItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0021, - /* [in] */ LONG __MIDL__IWiaMiniDrv0022, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0023, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0024) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvReadItemProperties( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0025, - /* [in] */ LONG __MIDL__IWiaMiniDrv0026, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0027, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0028, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0029) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvLockWiaDevice( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0030, - /* [in] */ LONG __MIDL__IWiaMiniDrv0031, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0032) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvUnLockWiaDevice( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0033, - /* [in] */ LONG __MIDL__IWiaMiniDrv0034, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0035) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvAnalyzeItem( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0036, - /* [in] */ LONG __MIDL__IWiaMiniDrv0037, - /* [in] */ __RPC__in LONG *__MIDL__IWiaMiniDrv0038) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetDeviceErrorStr( - /* [in] */ LONG __MIDL__IWiaMiniDrv0039, - /* [in] */ LONG __MIDL__IWiaMiniDrv0040, - /* [out] */ __RPC__deref_out_opt LPOLESTR *__MIDL__IWiaMiniDrv0041, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0042) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvDeviceCommand( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0043, - /* [in] */ LONG __MIDL__IWiaMiniDrv0044, - /* [in] */ __RPC__in const GUID *__MIDL__IWiaMiniDrv0045, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0046, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0047) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetCapabilities( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0048, - /* [in] */ LONG __MIDL__IWiaMiniDrv0049, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0050, - /* [out] */ __RPC__deref_out_opt WIA_DEV_CAP_DRV **__MIDL__IWiaMiniDrv0051, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0052) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvDeleteItem( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0053, - /* [in] */ LONG __MIDL__IWiaMiniDrv0054, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0055) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvFreeDrvItemContext( - /* [in] */ LONG __MIDL__IWiaMiniDrv0056, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0057, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0058) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvGetWiaFormatInfo( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0059, - /* [in] */ LONG __MIDL__IWiaMiniDrv0060, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0061, - /* [out] */ __RPC__deref_out_opt WIA_FORMAT_INFO **__MIDL__IWiaMiniDrv0062, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0063) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvNotifyPnpEvent( - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ ULONG ulReserved) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE drvUnInitializeWia( - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0064) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaMiniDrvVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaMiniDrv * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaMiniDrv * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvInitializeWia )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0000, - /* [in] */ LONG __MIDL__IWiaMiniDrv0001, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0002, - /* [in] */ __RPC__in BSTR __MIDL__IWiaMiniDrv0003, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0004, - /* [in] */ __RPC__in_opt IUnknown *__MIDL__IWiaMiniDrv0005, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0006, - /* [out] */ __RPC__deref_out_opt IUnknown **__MIDL__IWiaMiniDrv0007, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0008); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvAcquireItemData )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0009, - /* [in] */ LONG __MIDL__IWiaMiniDrv0010, - /* [out][in] */ __RPC__inout PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0011, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0012); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvInitItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0013, - /* [in] */ LONG __MIDL__IWiaMiniDrv0014, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0015); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvValidateItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0016, - /* [in] */ LONG __MIDL__IWiaMiniDrv0017, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0018, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0019, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0020); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvWriteItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0021, - /* [in] */ LONG __MIDL__IWiaMiniDrv0022, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT __MIDL__IWiaMiniDrv0023, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0024); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvReadItemProperties )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0025, - /* [in] */ LONG __MIDL__IWiaMiniDrv0026, - /* [in] */ ULONG __MIDL__IWiaMiniDrv0027, - /* [in] */ __RPC__in const PROPSPEC *__MIDL__IWiaMiniDrv0028, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0029); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvLockWiaDevice )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0030, - /* [in] */ LONG __MIDL__IWiaMiniDrv0031, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0032); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvUnLockWiaDevice )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0033, - /* [in] */ LONG __MIDL__IWiaMiniDrv0034, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0035); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvAnalyzeItem )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0036, - /* [in] */ LONG __MIDL__IWiaMiniDrv0037, - /* [in] */ __RPC__in LONG *__MIDL__IWiaMiniDrv0038); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetDeviceErrorStr )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ LONG __MIDL__IWiaMiniDrv0039, - /* [in] */ LONG __MIDL__IWiaMiniDrv0040, - /* [out] */ __RPC__deref_out_opt LPOLESTR *__MIDL__IWiaMiniDrv0041, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0042); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvDeviceCommand )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0043, - /* [in] */ LONG __MIDL__IWiaMiniDrv0044, - /* [in] */ __RPC__in const GUID *__MIDL__IWiaMiniDrv0045, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaMiniDrv0046, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0047); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetCapabilities )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0048, - /* [in] */ LONG __MIDL__IWiaMiniDrv0049, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0050, - /* [out] */ __RPC__deref_out_opt WIA_DEV_CAP_DRV **__MIDL__IWiaMiniDrv0051, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0052); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvDeleteItem )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0053, - /* [in] */ LONG __MIDL__IWiaMiniDrv0054, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0055); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvFreeDrvItemContext )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ LONG __MIDL__IWiaMiniDrv0056, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0057, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0058); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvGetWiaFormatInfo )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0059, - /* [in] */ LONG __MIDL__IWiaMiniDrv0060, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0061, - /* [out] */ __RPC__deref_out_opt WIA_FORMAT_INFO **__MIDL__IWiaMiniDrv0062, - /* [out] */ __RPC__out LONG *__MIDL__IWiaMiniDrv0063); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvNotifyPnpEvent )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in const GUID *pEventGUID, - /* [in] */ __RPC__in BSTR bstrDeviceID, - /* [in] */ ULONG ulReserved); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *drvUnInitializeWia )( - __RPC__in IWiaMiniDrv * This, - /* [in] */ __RPC__in BYTE *__MIDL__IWiaMiniDrv0064); - - END_INTERFACE - } IWiaMiniDrvVtbl; - - interface IWiaMiniDrv - { - CONST_VTBL struct IWiaMiniDrvVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaMiniDrv_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaMiniDrv_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaMiniDrv_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaMiniDrv_drvInitializeWia(This,__MIDL__IWiaMiniDrv0000,__MIDL__IWiaMiniDrv0001,__MIDL__IWiaMiniDrv0002,__MIDL__IWiaMiniDrv0003,__MIDL__IWiaMiniDrv0004,__MIDL__IWiaMiniDrv0005,__MIDL__IWiaMiniDrv0006,__MIDL__IWiaMiniDrv0007,__MIDL__IWiaMiniDrv0008) \ - ( (This)->lpVtbl -> drvInitializeWia(This,__MIDL__IWiaMiniDrv0000,__MIDL__IWiaMiniDrv0001,__MIDL__IWiaMiniDrv0002,__MIDL__IWiaMiniDrv0003,__MIDL__IWiaMiniDrv0004,__MIDL__IWiaMiniDrv0005,__MIDL__IWiaMiniDrv0006,__MIDL__IWiaMiniDrv0007,__MIDL__IWiaMiniDrv0008) ) - -#define IWiaMiniDrv_drvAcquireItemData(This,__MIDL__IWiaMiniDrv0009,__MIDL__IWiaMiniDrv0010,__MIDL__IWiaMiniDrv0011,__MIDL__IWiaMiniDrv0012) \ - ( (This)->lpVtbl -> drvAcquireItemData(This,__MIDL__IWiaMiniDrv0009,__MIDL__IWiaMiniDrv0010,__MIDL__IWiaMiniDrv0011,__MIDL__IWiaMiniDrv0012) ) - -#define IWiaMiniDrv_drvInitItemProperties(This,__MIDL__IWiaMiniDrv0013,__MIDL__IWiaMiniDrv0014,__MIDL__IWiaMiniDrv0015) \ - ( (This)->lpVtbl -> drvInitItemProperties(This,__MIDL__IWiaMiniDrv0013,__MIDL__IWiaMiniDrv0014,__MIDL__IWiaMiniDrv0015) ) - -#define IWiaMiniDrv_drvValidateItemProperties(This,__MIDL__IWiaMiniDrv0016,__MIDL__IWiaMiniDrv0017,__MIDL__IWiaMiniDrv0018,__MIDL__IWiaMiniDrv0019,__MIDL__IWiaMiniDrv0020) \ - ( (This)->lpVtbl -> drvValidateItemProperties(This,__MIDL__IWiaMiniDrv0016,__MIDL__IWiaMiniDrv0017,__MIDL__IWiaMiniDrv0018,__MIDL__IWiaMiniDrv0019,__MIDL__IWiaMiniDrv0020) ) - -#define IWiaMiniDrv_drvWriteItemProperties(This,__MIDL__IWiaMiniDrv0021,__MIDL__IWiaMiniDrv0022,__MIDL__IWiaMiniDrv0023,__MIDL__IWiaMiniDrv0024) \ - ( (This)->lpVtbl -> drvWriteItemProperties(This,__MIDL__IWiaMiniDrv0021,__MIDL__IWiaMiniDrv0022,__MIDL__IWiaMiniDrv0023,__MIDL__IWiaMiniDrv0024) ) - -#define IWiaMiniDrv_drvReadItemProperties(This,__MIDL__IWiaMiniDrv0025,__MIDL__IWiaMiniDrv0026,__MIDL__IWiaMiniDrv0027,__MIDL__IWiaMiniDrv0028,__MIDL__IWiaMiniDrv0029) \ - ( (This)->lpVtbl -> drvReadItemProperties(This,__MIDL__IWiaMiniDrv0025,__MIDL__IWiaMiniDrv0026,__MIDL__IWiaMiniDrv0027,__MIDL__IWiaMiniDrv0028,__MIDL__IWiaMiniDrv0029) ) - -#define IWiaMiniDrv_drvLockWiaDevice(This,__MIDL__IWiaMiniDrv0030,__MIDL__IWiaMiniDrv0031,__MIDL__IWiaMiniDrv0032) \ - ( (This)->lpVtbl -> drvLockWiaDevice(This,__MIDL__IWiaMiniDrv0030,__MIDL__IWiaMiniDrv0031,__MIDL__IWiaMiniDrv0032) ) - -#define IWiaMiniDrv_drvUnLockWiaDevice(This,__MIDL__IWiaMiniDrv0033,__MIDL__IWiaMiniDrv0034,__MIDL__IWiaMiniDrv0035) \ - ( (This)->lpVtbl -> drvUnLockWiaDevice(This,__MIDL__IWiaMiniDrv0033,__MIDL__IWiaMiniDrv0034,__MIDL__IWiaMiniDrv0035) ) - -#define IWiaMiniDrv_drvAnalyzeItem(This,__MIDL__IWiaMiniDrv0036,__MIDL__IWiaMiniDrv0037,__MIDL__IWiaMiniDrv0038) \ - ( (This)->lpVtbl -> drvAnalyzeItem(This,__MIDL__IWiaMiniDrv0036,__MIDL__IWiaMiniDrv0037,__MIDL__IWiaMiniDrv0038) ) - -#define IWiaMiniDrv_drvGetDeviceErrorStr(This,__MIDL__IWiaMiniDrv0039,__MIDL__IWiaMiniDrv0040,__MIDL__IWiaMiniDrv0041,__MIDL__IWiaMiniDrv0042) \ - ( (This)->lpVtbl -> drvGetDeviceErrorStr(This,__MIDL__IWiaMiniDrv0039,__MIDL__IWiaMiniDrv0040,__MIDL__IWiaMiniDrv0041,__MIDL__IWiaMiniDrv0042) ) - -#define IWiaMiniDrv_drvDeviceCommand(This,__MIDL__IWiaMiniDrv0043,__MIDL__IWiaMiniDrv0044,__MIDL__IWiaMiniDrv0045,__MIDL__IWiaMiniDrv0046,__MIDL__IWiaMiniDrv0047) \ - ( (This)->lpVtbl -> drvDeviceCommand(This,__MIDL__IWiaMiniDrv0043,__MIDL__IWiaMiniDrv0044,__MIDL__IWiaMiniDrv0045,__MIDL__IWiaMiniDrv0046,__MIDL__IWiaMiniDrv0047) ) - -#define IWiaMiniDrv_drvGetCapabilities(This,__MIDL__IWiaMiniDrv0048,__MIDL__IWiaMiniDrv0049,__MIDL__IWiaMiniDrv0050,__MIDL__IWiaMiniDrv0051,__MIDL__IWiaMiniDrv0052) \ - ( (This)->lpVtbl -> drvGetCapabilities(This,__MIDL__IWiaMiniDrv0048,__MIDL__IWiaMiniDrv0049,__MIDL__IWiaMiniDrv0050,__MIDL__IWiaMiniDrv0051,__MIDL__IWiaMiniDrv0052) ) - -#define IWiaMiniDrv_drvDeleteItem(This,__MIDL__IWiaMiniDrv0053,__MIDL__IWiaMiniDrv0054,__MIDL__IWiaMiniDrv0055) \ - ( (This)->lpVtbl -> drvDeleteItem(This,__MIDL__IWiaMiniDrv0053,__MIDL__IWiaMiniDrv0054,__MIDL__IWiaMiniDrv0055) ) - -#define IWiaMiniDrv_drvFreeDrvItemContext(This,__MIDL__IWiaMiniDrv0056,__MIDL__IWiaMiniDrv0057,__MIDL__IWiaMiniDrv0058) \ - ( (This)->lpVtbl -> drvFreeDrvItemContext(This,__MIDL__IWiaMiniDrv0056,__MIDL__IWiaMiniDrv0057,__MIDL__IWiaMiniDrv0058) ) - -#define IWiaMiniDrv_drvGetWiaFormatInfo(This,__MIDL__IWiaMiniDrv0059,__MIDL__IWiaMiniDrv0060,__MIDL__IWiaMiniDrv0061,__MIDL__IWiaMiniDrv0062,__MIDL__IWiaMiniDrv0063) \ - ( (This)->lpVtbl -> drvGetWiaFormatInfo(This,__MIDL__IWiaMiniDrv0059,__MIDL__IWiaMiniDrv0060,__MIDL__IWiaMiniDrv0061,__MIDL__IWiaMiniDrv0062,__MIDL__IWiaMiniDrv0063) ) - -#define IWiaMiniDrv_drvNotifyPnpEvent(This,pEventGUID,bstrDeviceID,ulReserved) \ - ( (This)->lpVtbl -> drvNotifyPnpEvent(This,pEventGUID,bstrDeviceID,ulReserved) ) - -#define IWiaMiniDrv_drvUnInitializeWia(This,__MIDL__IWiaMiniDrv0064) \ - ( (This)->lpVtbl -> drvUnInitializeWia(This,__MIDL__IWiaMiniDrv0064) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaMiniDrv_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ -#define __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ - -/* interface IWiaMiniDrvCallBack */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaMiniDrvCallBack; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("33a57d5a-3de8-11d2-9a36-00c04fa36145") - IWiaMiniDrvCallBack : public IUnknown - { - public: - virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE MiniDrvCallback( - /* [in] */ LONG lReason, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT pTranCtx, - /* [in] */ LONG lReserved) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaMiniDrvCallBackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaMiniDrvCallBack * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaMiniDrvCallBack * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaMiniDrvCallBack * This); - - /* [helpstring][id] */ HRESULT ( STDMETHODCALLTYPE *MiniDrvCallback )( - __RPC__in IWiaMiniDrvCallBack * This, - /* [in] */ LONG lReason, - /* [in] */ LONG lStatus, - /* [in] */ LONG lPercentComplete, - /* [in] */ LONG lOffset, - /* [in] */ LONG lLength, - /* [in] */ __RPC__in PMINIDRV_TRANSFER_CONTEXT pTranCtx, - /* [in] */ LONG lReserved); - - END_INTERFACE - } IWiaMiniDrvCallBackVtbl; - - interface IWiaMiniDrvCallBack - { - CONST_VTBL struct IWiaMiniDrvCallBackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaMiniDrvCallBack_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaMiniDrvCallBack_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaMiniDrvCallBack_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaMiniDrvCallBack_MiniDrvCallback(This,lReason,lStatus,lPercentComplete,lOffset,lLength,pTranCtx,lReserved) \ - ( (This)->lpVtbl -> MiniDrvCallback(This,lReason,lStatus,lPercentComplete,lOffset,lLength,pTranCtx,lReserved) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaMiniDrvCallBack_INTERFACE_DEFINED__ */ - - -#ifndef __IWiaDrvItem_INTERFACE_DEFINED__ -#define __IWiaDrvItem_INTERFACE_DEFINED__ - -/* interface IWiaDrvItem */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_IWiaDrvItem; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1f02b5c5-b00c-11d2-a094-00c04f72dc3c") - IWiaDrvItem : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE GetItemFlags( - /* [out] */ __RPC__out LONG *__MIDL__IWiaDrvItem0000) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetDeviceSpecContext( - /* [out] */ __RPC__deref_out_opt BYTE **__MIDL__IWiaDrvItem0001) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFullItemName( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0002) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetItemName( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0003) = 0; - - virtual HRESULT STDMETHODCALLTYPE AddItemToFolder( - /* [in] */ __RPC__in_opt IWiaDrvItem *__MIDL__IWiaDrvItem0004) = 0; - - virtual HRESULT STDMETHODCALLTYPE UnlinkItemTree( - /* [in] */ LONG __MIDL__IWiaDrvItem0005) = 0; - - virtual HRESULT STDMETHODCALLTYPE RemoveItemFromFolder( - /* [in] */ LONG __MIDL__IWiaDrvItem0006) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindItemByName( - /* [in] */ LONG __MIDL__IWiaDrvItem0007, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0008, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0009) = 0; - - virtual HRESULT STDMETHODCALLTYPE FindChildItemByName( - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0010, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0011) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetParentItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0012) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetFirstChildItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0013) = 0; - - virtual HRESULT STDMETHODCALLTYPE GetNextSiblingItem( - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0014) = 0; - - virtual HRESULT STDMETHODCALLTYPE DumpItemData( - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0015) = 0; - - }; - -#else /* C style interface */ - - typedef struct IWiaDrvItemVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IWiaDrvItem * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IWiaDrvItem * This); - - HRESULT ( STDMETHODCALLTYPE *GetItemFlags )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__out LONG *__MIDL__IWiaDrvItem0000); - - HRESULT ( STDMETHODCALLTYPE *GetDeviceSpecContext )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BYTE **__MIDL__IWiaDrvItem0001); - - HRESULT ( STDMETHODCALLTYPE *GetFullItemName )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0002); - - HRESULT ( STDMETHODCALLTYPE *GetItemName )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0003); - - HRESULT ( STDMETHODCALLTYPE *AddItemToFolder )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in_opt IWiaDrvItem *__MIDL__IWiaDrvItem0004); - - HRESULT ( STDMETHODCALLTYPE *UnlinkItemTree )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0005); - - HRESULT ( STDMETHODCALLTYPE *RemoveItemFromFolder )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0006); - - HRESULT ( STDMETHODCALLTYPE *FindItemByName )( - __RPC__in IWiaDrvItem * This, - /* [in] */ LONG __MIDL__IWiaDrvItem0007, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0008, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0009); - - HRESULT ( STDMETHODCALLTYPE *FindChildItemByName )( - __RPC__in IWiaDrvItem * This, - /* [in] */ __RPC__in BSTR __MIDL__IWiaDrvItem0010, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0011); - - HRESULT ( STDMETHODCALLTYPE *GetParentItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0012); - - HRESULT ( STDMETHODCALLTYPE *GetFirstChildItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0013); - - HRESULT ( STDMETHODCALLTYPE *GetNextSiblingItem )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt IWiaDrvItem **__MIDL__IWiaDrvItem0014); - - HRESULT ( STDMETHODCALLTYPE *DumpItemData )( - __RPC__in IWiaDrvItem * This, - /* [out] */ __RPC__deref_out_opt BSTR *__MIDL__IWiaDrvItem0015); - - END_INTERFACE - } IWiaDrvItemVtbl; - - interface IWiaDrvItem - { - CONST_VTBL struct IWiaDrvItemVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IWiaDrvItem_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IWiaDrvItem_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IWiaDrvItem_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IWiaDrvItem_GetItemFlags(This,__MIDL__IWiaDrvItem0000) \ - ( (This)->lpVtbl -> GetItemFlags(This,__MIDL__IWiaDrvItem0000) ) - -#define IWiaDrvItem_GetDeviceSpecContext(This,__MIDL__IWiaDrvItem0001) \ - ( (This)->lpVtbl -> GetDeviceSpecContext(This,__MIDL__IWiaDrvItem0001) ) - -#define IWiaDrvItem_GetFullItemName(This,__MIDL__IWiaDrvItem0002) \ - ( (This)->lpVtbl -> GetFullItemName(This,__MIDL__IWiaDrvItem0002) ) - -#define IWiaDrvItem_GetItemName(This,__MIDL__IWiaDrvItem0003) \ - ( (This)->lpVtbl -> GetItemName(This,__MIDL__IWiaDrvItem0003) ) - -#define IWiaDrvItem_AddItemToFolder(This,__MIDL__IWiaDrvItem0004) \ - ( (This)->lpVtbl -> AddItemToFolder(This,__MIDL__IWiaDrvItem0004) ) - -#define IWiaDrvItem_UnlinkItemTree(This,__MIDL__IWiaDrvItem0005) \ - ( (This)->lpVtbl -> UnlinkItemTree(This,__MIDL__IWiaDrvItem0005) ) - -#define IWiaDrvItem_RemoveItemFromFolder(This,__MIDL__IWiaDrvItem0006) \ - ( (This)->lpVtbl -> RemoveItemFromFolder(This,__MIDL__IWiaDrvItem0006) ) - -#define IWiaDrvItem_FindItemByName(This,__MIDL__IWiaDrvItem0007,__MIDL__IWiaDrvItem0008,__MIDL__IWiaDrvItem0009) \ - ( (This)->lpVtbl -> FindItemByName(This,__MIDL__IWiaDrvItem0007,__MIDL__IWiaDrvItem0008,__MIDL__IWiaDrvItem0009) ) - -#define IWiaDrvItem_FindChildItemByName(This,__MIDL__IWiaDrvItem0010,__MIDL__IWiaDrvItem0011) \ - ( (This)->lpVtbl -> FindChildItemByName(This,__MIDL__IWiaDrvItem0010,__MIDL__IWiaDrvItem0011) ) - -#define IWiaDrvItem_GetParentItem(This,__MIDL__IWiaDrvItem0012) \ - ( (This)->lpVtbl -> GetParentItem(This,__MIDL__IWiaDrvItem0012) ) - -#define IWiaDrvItem_GetFirstChildItem(This,__MIDL__IWiaDrvItem0013) \ - ( (This)->lpVtbl -> GetFirstChildItem(This,__MIDL__IWiaDrvItem0013) ) - -#define IWiaDrvItem_GetNextSiblingItem(This,__MIDL__IWiaDrvItem0014) \ - ( (This)->lpVtbl -> GetNextSiblingItem(This,__MIDL__IWiaDrvItem0014) ) - -#define IWiaDrvItem_DumpItemData(This,__MIDL__IWiaDrvItem0015) \ - ( (This)->lpVtbl -> DumpItemData(This,__MIDL__IWiaDrvItem0015) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IWiaDrvItem_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_wiamindr_xp_0000_0003 */ -/* [local] */ - -typedef struct _WIA_PROPERTY_INFO - { - ULONG lAccessFlags; - VARTYPE vt; - union - { - struct - { - LONG Min; - LONG Nom; - LONG Max; - LONG Inc; - } Range; - struct - { - DOUBLE Min; - DOUBLE Nom; - DOUBLE Max; - DOUBLE Inc; - } RangeFloat; - struct - { - LONG cNumList; - LONG Nom; - BYTE *pList; - } List; - struct - { - LONG cNumList; - DOUBLE Nom; - BYTE *pList; - } ListFloat; - struct - { - LONG cNumList; - GUID Nom; - GUID *pList; - } ListGuid; - struct - { - LONG cNumList; - BSTR Nom; - BSTR *pList; - } ListBStr; - struct - { - LONG Nom; - LONG ValidBits; - } Flag; - struct - { - LONG Dummy; - } None; - } ValidVal; - } WIA_PROPERTY_INFO; - -typedef struct _WIA_PROPERTY_INFO *PWIA_PROPERTY_INFO; - -typedef struct _WIA_PROPERTY_CONTEXT - { - ULONG cProps; - PROPID *pProps; - BOOL *pChanged; - } WIA_PROPERTY_CONTEXT; - -typedef struct _WIA_PROPERTY_CONTEXT *PWIA_PROPERTY_CONTEXT; - -typedef struct _WIAS_CHANGED_VALUE_INFO - { - BOOL bChanged; - LONG vt; - union - { - LONG lVal; - FLOAT fltVal; - BSTR bstrVal; - GUID guidVal; - } Old; - union - { - LONG lVal; - FLOAT fltVal; - BSTR bstrVal; - GUID guidVal; - } Current; - } WIAS_CHANGED_VALUE_INFO; - -typedef struct _WIAS_CHANGED_VALUE_INFO *PWIAS_CHANGED_VALUE_INFO; - -typedef struct _WIAS_DOWN_SAMPLE_INFO - { - ULONG ulOriginalWidth; - ULONG ulOriginalHeight; - ULONG ulBitsPerPixel; - ULONG ulXRes; - ULONG ulYRes; - ULONG ulDownSampledWidth; - ULONG ulDownSampledHeight; - ULONG ulActualSize; - ULONG ulDestBufSize; - ULONG ulSrcBufSize; - BYTE *pSrcBuffer; - BYTE *pDestBuffer; - } WIAS_DOWN_SAMPLE_INFO; - -typedef struct _WIAS_DOWN_SAMPLE_INFO *PWIAS_DOWN_SAMPLE_INFO; - -typedef struct _WIAS_ENDORSER_VALUE - { - LPWSTR wszTokenName; - LPWSTR wszValue; - } WIAS_ENDORSER_VALUE; - -typedef struct _WIAS_ENDORSER_VALUE *PWIAS_ENDORSER_VALUE; - -typedef struct _WIAS_ENDORSER_INFO - { - ULONG ulPageCount; - ULONG ulNumEndorserValues; - WIAS_ENDORSER_VALUE *pEndorserValues; - } WIAS_ENDORSER_INFO; - -typedef struct _WIAS_ENDORSER_INFO *PWIAS_ENDORSER_INFO; - -#include "wiamdef.h" - - -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_xp_0000_0003_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_wiamindr_xp_0000_0003_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/wiatwcmp.h b/qt-correction-tool/pub/ddk/wiatwcmp.h deleted file mode 100644 index 349fb2a..0000000 --- a/qt-correction-tool/pub/ddk/wiatwcmp.h +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -* -* (C) COPYRIGHT 1998-2001, MICROSOFT CORP. -* -* FILE: wiatwcmp.h -* -* VERSION: 1.0 -* -* DATE: 6/01/2001 -* -* DESCRIPTION: -* Defines TWAIN Compatibility Layer - Capability pass-through constants. -* To support existing TWAIN applications that have private capabilities, -* WIA drivers can utilize the Pass-through functionality. -* -*****************************************************************************/ - -#if (_WIN32_WINNT >= 0x0501) // Windows XP and later - -#ifndef _WIATWCMP_H_ -#define _WIATWCMP_H_ - -#define WiaItemTypeTwainCapabilityPassThrough 0x00020000 - -//************************************************************************** -// -// TWAIN capability pass-through -// -//************************************************************************** - -// -// Escape code ranges 2001 - 3000 are reserved for future ESC_ commands -// - -#define ESC_TWAIN_CAPABILITY 2001 // private TWAIN capability negotiation -#define ESC_TWAIN_PRIVATE_SUPPORTED_CAPS 2002 // query for supported private capabilities - -typedef struct _TWAIN_CAPABILITY { - LONG lSize; // size of TWAIN_CAPABILITY structure - LONG lMSG; // TWAIN Message, MSG_GET, MSG_GETCURRENT, MSG_SET, etc.. - LONG lCapID; // id of capability to set or get - LONG lConType; // container type of capability - LONG lRC; // TWAIN return code, TWRC_SUCCESS, TWRC_FAILURE, etc.. - LONG lCC; // TWAIN condition code, TWCC_SUCCESS, TWCC_BUMMER, etc.. - LONG lDataSize;// data size - BYTE Data[1]; // first BYTE of data -}TWAIN_CAPABILITY,*PTWAIN_CAPABILITY; - -#endif - -#endif //#if (_WIN32_WINNT >= 0x0501) - diff --git a/qt-correction-tool/pub/ddk/wiautil.h b/qt-correction-tool/pub/ddk/wiautil.h deleted file mode 100644 index 67b2bee..0000000 --- a/qt-correction-tool/pub/ddk/wiautil.h +++ /dev/null @@ -1,1394 +0,0 @@ -/**************************************************************************** -* -* (C) COPYRIGHT 2000, MICROSOFT CORP. -* -* FILE: wiautil.h -* -* VERSION: 1.0 -* -* DATE: 11/17/2000 -* -* DESCRIPTION: -* Definitions for WIA driver helper classes and functions. -* NOTE: This header requires wiamindr.h to be included. -* -*****************************************************************************/ - -#if (_WIN32_WINNT >= 0x0501) // Windows XP and later - -#pragma once - -#define STRSAFE_NO_DEPRECATE -#include - -/**************************************************************************\ -* CWiauFormatConverter -* -* Helper class for converting images to BMP format. -* -\**************************************************************************/ - -typedef struct _BMP_IMAGE_INFO -{ - INT Width; // Width of the image in pixels - INT Height; // Height of the image in lines - INT ByteWidth; // Width of the image in bytes - INT Size; // Total size of the image, including headers -} BMP_IMAGE_INFO, *PBMP_IMAGE_INFO; - -typedef enum -{ - SKIP_OFF, - SKIP_FILEHDR, - SKIP_BOTHHDR - -} SKIP_AMOUNT; - -class CWiauFormatConverter -{ -public: - CWiauFormatConverter(); - ~CWiauFormatConverter(); - - /**************************************************************************\ - * Init - * - * Intializes this class and GDI+ for converting images. This method - * should be called just once. - * - \**************************************************************************/ - - __checkReturn HRESULT Init(); - - - /**************************************************************************\ - * IsFormatSupported - * - * This method will verify that GDI+ supports the image format - * that is to be converted. - * - * Arguments: - * - * pguidFormat - pointer to GUID format from gdiplusimaging.h - * - \**************************************************************************/ - - __checkReturn BOOL IsFormatSupported(__in const GUID *pguidFormat); - - - /**************************************************************************\ - * ConvertToBmp - * - * This method will convert an image to BMP format. The caller can pass - * a result buffer in ppDest and the size in piDestSize. Alternatively - * the caller can set *ppDest to NULL and *piDestSize to zero to - * indicate that this method should allocate the memory. The caller is - * responsible for freeing the memory with "delete []". - * - * Arguments: - * - * pSource - pointer to memory location of source image - * iSourceSize - size of source image - * ppDest - location to receive memory location of result image - * piDestSize - location to receive size of result image - * pBmpImageInfo - location to receive stats about the BMP - * iSkipAmt - Indicates how much of the BMP header to skip: - * SKIP_OFF = skip neither header - * SKIP_FILEHDR = skip the file header - * SKIP_BOTHHDR = skip the file and info headers - * - \**************************************************************************/ - - __checkReturn HRESULT ConvertToBmp(__in BYTE *pSource, INT iSourceSize, - __deref_out_ecount(*piDestSize) BYTE **ppDest, - __inout INT *piDestSize, __out BMP_IMAGE_INFO *pBmpImageInfo, - SKIP_AMOUNT iSkipAmt = SKIP_OFF); - -private: - ULONG_PTR m_Token; - UINT m_EncoderCount; - BYTE *m_pEncoderInfo; - GUID m_guidCodecBmp; -}; - - -/**************************************************************************\ -* CWiauPropertyList -* -* Helper class for definining and initializing WIA properties -* -\**************************************************************************/ - -class CWiauPropertyList -{ -private: - - int m_NumAlloc; // number of slots allocated - int m_NumProps; // number of properties defined - PROPID *m_pId; // property ids - LPOLESTR *m_pNames; // property names - PROPVARIANT *m_pCurrent; // current value - PROPSPEC *m_pPropSpec; // property spec (used for WriteMultiple) - WIA_PROPERTY_INFO *m_pAttrib; // property attributes - -public: - - CWiauPropertyList(); - ~CWiauPropertyList(); - - /**************************************************************************\ - * Init - * - * Initializes the property info object. - * - * Arguments: - * NumProps - number of properties to reserve space for. This number can - * be larger than the actual number used, but cannot be smaller. - * - \**************************************************************************/ - - __checkReturn HRESULT Init(INT NumProps); - - - /**************************************************************************\ - * DefineProperty - * - * Adds a property definition to the object. - * - * Arguments: - * index - pointer to an int that will be set to the property index - * within the object, useful for passing to other property - * info methods - * PropId - property ID constant - * PropName - property name string - * Access - determines access to the property, usually either - * WIA_PROP_READ or WIA_PROP_RW - * SubType - indicates subtype of the property, usually either - * WIA_PROP_NONE, WIA_PROP_FLAG, WIA_PROP_RANGE, or WIA_PROP_LIST - * - \**************************************************************************/ - - __checkReturn HRESULT DefineProperty(__inout int *pIdx, PROPID PropId, - __in LPOLESTR PropName, ULONG Access, - ULONG SubType); - - - /**************************************************************************\ - * SendToWia - * - * Calls the WIA service to define all of the properties currently - * contained in the object. Should be called once after all properties - * are defined and set. - * - * Arguments: - * pWiasContext - pointer to the context passed into drvInitItemProperties - * - \**************************************************************************/ - - __checkReturn HRESULT SendToWia(__in BYTE *pWiasContext); - - - /**************************************************************************\ - * SetAccessSubType - * - * Used to reset the access and subtype of a property. - * - * Arguments: - * index - the property index, from DefineProperty - * Access - determines access to the property, usually either - * WIA_PROP_READ or WIA_PROP_RW - * SubType - indicates subtype of the property, usually either - * WIA_PROP_NONE, WIA_PROP_FLAG, WIA_PROP_RANGE, or WIA_PROP_LIST - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetAccessSubType(INT index, ULONG Access, ULONG SubType); -#else - HRESULT SetAccessSubType(INT index, ULONG Access, ULONG SubType); -#endif - - - /**************************************************************************\ - * SetValidValues (flag) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_I4 and subtype to WIA_PROP_FLAG. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * validFlags - combination of all valid flags - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, LONG defaultValue, LONG currentValue, LONG validFlags); -#else - HRESULT SetValidValues(INT index, LONG defaultValue, LONG currentValue, LONG validFlags); -#endif - - - /**************************************************************************\ - * SetValidValues (signed long, range) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_I4 and subtype to WIA_PROP_RANGE. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * minValue - minimum value for the range - * maxValue - maximum value for the range - * stepValue - step value for the range - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, LONG defaultValue, LONG currentValue, - LONG minValue, LONG maxValue, LONG stepValue); -#else - HRESULT SetValidValues(INT index, LONG defaultValue, LONG currentValue, - LONG minValue, LONG maxValue, LONG stepValue); -#endif - - - /**************************************************************************\ - * SetValidValues (signed long, list) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_I4 and subtype to WIA_PROP_LIST. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * numValues - number of values in the list - * pValues - pointer to the value list (must be valid until SendToWia - * is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, LONG defaultValue, LONG currentValue, - INT numValues, __in_ecount(numValues) PLONG pValues); -#else - HRESULT SetValidValues(INT index, LONG defaultValue, LONG currentValue, - INT numValues, __in_ecount(numValues) PLONG pValues); -#endif - - - /**************************************************************************\ - * SetValidValues (BSTR, list) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_BSTR and subtype to WIA_PROP_LIST. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * numValues - number of values in the list - * pValues - pointer to the value list (must be valid until SendToWia - * is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, __in BSTR defaultValue, __in BSTR currentValue, - INT numValues, __in_ecount(numValues) BSTR *pValues); -#else - HRESULT SetValidValues(INT index, __in BSTR defaultValue, __in BSTR currentValue, - INT numValues, __in_ecount(numValues) BSTR *pValues); -#endif - - - /**************************************************************************\ - * SetValidValues (float, range) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_R4 and subtype to WIA_PROP_RANGE. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * minValue - minimum value for the range - * maxValue - maximum value for the range - * stepValue - step value for the range - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, FLOAT defaultValue, FLOAT currentValue, - FLOAT minValue, FLOAT maxValue, FLOAT stepValue); -#else - HRESULT SetValidValues(INT index, FLOAT defaultValue, FLOAT currentValue, - FLOAT minValue, FLOAT maxValue, FLOAT stepValue); -#endif - - - /**************************************************************************\ - * SetValidValues (float, list) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_R4 and subtype to WIA_PROP_LIST. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * numValues - number of values in the list - * pValues - pointer to the value list (must be valid until SendToWia - * is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, FLOAT defaultValue, FLOAT currentValue, - INT numValues, __in_ecount(numValues) PFLOAT pValues); -#else - HRESULT SetValidValues(INT index, FLOAT defaultValue, FLOAT currentValue, - INT numValues, __in_ecount(numValues) PFLOAT pValues); -#endif - - - /**************************************************************************\ - * SetValidValues (CLSID, list) - * - * Sets the type and current, default, and valid values of a property. - * Also sets property type to VT_CLSID and subtype to WIA_PROP_LIST. - * - * Arguments: - * index - the property index, from DefineProperty - * defaultValue - default setting of this property on the device - * currentValue - current setting of this property on the device - * numValues - number of values in the list - * pValues - pointer to the value list (must be valid until SendToWia - * is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetValidValues(INT index, __in CLSID *defaultValue, __in CLSID *currentValue, - INT numValues, __in_ecount(numValues) CLSID **pValues); -#else - HRESULT SetValidValues(INT index, __in CLSID *defaultValue, __in CLSID *currentValue, - INT numValues, __in_ecount(numValues) CLSID **pValues); -#endif - - - /**************************************************************************\ - * SetCurrentValue (signed long) - * - * Sets the current value for a property. Also sets the type to VT_I4. - * - * Arguments: - * index - the property index, from DefineProperty - * value - current setting of this property on the device - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, LONG value); -#else - HRESULT SetCurrentValue(INT index, LONG value); -#endif - - - /**************************************************************************\ - * SetCurrentValue (BSTR) - * - * Sets the current value for a property. Also sets the type to VT_BSTR. - * - * Arguments: - * index - the property index, from DefineProperty - * value - current setting of this property on the device - * (must be valid until SendToWia is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, __in BSTR value); -#else - HRESULT SetCurrentValue(INT index, __in BSTR value); -#endif - - - /**************************************************************************\ - * SetCurrentValue (float) - * - * Sets the current value for a property. Also sets the type to VT_R4. - * - * Arguments: - * index - the property index, from DefineProperty - * value - current setting of this property on the device - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, FLOAT value); -#else - HRESULT SetCurrentValue(INT index, FLOAT value); -#endif - - - /**************************************************************************\ - * SetCurrentValue (CLSID) - * - * Sets the current value for a property. Also sets the type to VT_CLSID. - * - * Arguments: - * index - the property index, from DefineProperty - * value - current setting of this property on the device - * (must be valid until SendToWia is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, __in CLSID *pValue); -#else - HRESULT SetCurrentValue(INT index, __in CLSID *pValue); -#endif - - - /**************************************************************************\ - * SetCurrentValue (SYSTEMTIME) - * - * Sets the current value for a property. Also sets the type to - * VT_UI2 | VT_VECTOR. - * - * Arguments: - * index - the property index, from DefineProperty - * value - current setting of this property on the device - * (must be valid until SendToWia is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, __in PSYSTEMTIME value); -#else - HRESULT SetCurrentValue(INT index, __in PSYSTEMTIME value); -#endif - - - /**************************************************************************\ - * SetCurrentValue (byte array) - * - * Sets the current value for a property. Also sets the type to - * VT_UI1 | VT_VECTOR. - * - * Arguments: - * index - the property index, from DefineProperty - * value - pointer to current setting of this property on the device - * (must be valid until SendToWia is called) - * - \**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - void SetCurrentValue(INT index, __in BYTE *value, INT size); -#else - HRESULT SetCurrentValue(INT index, __in BYTE *value, INT size); -#endif - - - /**************************************************************************\ - * GetPropId - * - * Returns the property id given a property index. - * - \**************************************************************************/ - - __checkReturn PROPID GetPropId(INT index) { return m_pId[index]; } - - - /**************************************************************************\ - * LookupPropId - * - * Finds the property index given a property ID. - * - \**************************************************************************/ - - __checkReturn INT LookupPropId(PROPID PropId); -}; - - -/**************************************************************************\ -* wiauGetDrvItemContext -* -* This helper function gets the driver item context, and optionally -* return the driver item -* -* Arguments: -* -* pWiasContext - pointer to the item context -* ppItemCtx - location to store pointer to driver item context -* ppDrvItem - location to store pointer to driver item (can be NULL) -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauGetDrvItemContext(__in BYTE *pWiasContext, __inout VOID **ppItemCtx, - __inout_opt IWiaDrvItem **ppDrvItem = NULL); -#else - __checkReturn HRESULT _stdcall wiauGetDrvItemContext(__in BYTE *pWiasContext, __inout VOID **ppItemCtx, - __inout_opt IWiaDrvItem **ppDrvItem = NULL); -#endif - - -/**************************************************************************\ -* wiauSetImageItemSize -* -* Calulates the size and width in bytes for an image based on the current -* WIA_IPA_FORMAT setting, and writes the new values to the appropriate -* properties. If the format is not BMP, this function assumes that the -* value passed in lSize is correct for the current format. -* -* Arguments: -* -* pWiasContext - pointer to item context -* lWidth - width of the image in pixels -* lHeight - height of the image in lines -* lDepth - depth of the image in bits -* lSize - size of the image as stored on the device -* pwszExt - optional pointer to the 3 letter extension for the -* item's native format (if this is NULL, the extension -* property won't be updated) -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauSetImageItemSize(__in BYTE *pWiasContext, LONG lWidth, - LONG lHeight, LONG lDepth, LONG lSize, __in_opt PWSTR pwszExt = NULL); -#else - __checkReturn HRESULT _stdcall wiauSetImageItemSize(__in BYTE *pWiasContext, LONG lWidth, - LONG lHeight, LONG lDepth, LONG lSize, __in_opt PWSTR pwszExt = NULL); -#endif - - -/**************************************************************************\ -* wiauPropsInPropSpec -* -* Returns true if one or more of the property ids in pProps are -* contained in pPropSpecs. -* -* Arguments: -* -* NumPropSpecs - number of property specs in the array -* pPropSpecs - the property specs array -* NumProps - number of property ids to search for -* pProps - pointer to the array of property ids to search for -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn BOOL wiauPropsInPropSpec(LONG NumPropSpecs, - __in_ecount(NumPropSpecs) const PROPSPEC *pPropSpecs, - int NumProps, __in_ecount(NumProps) PROPID *pProps); -#else - __checkReturn BOOL _stdcall wiauPropsInPropSpec(LONG NumPropSpecs, - __in_ecount(NumPropSpecs) const PROPSPEC *pPropSpecs, - int NumProps, __in_ecount(NumProps) PROPID *pProps); -#endif - - -/**************************************************************************\ -* wiauPropInPropSpec -* -* Returns true if the PropId property ID is in the passed pPropSpecs -* array. Optionally will return the index of where the ID was found. -* -* Arguments: -* -* NumPropSpecs - number of property specs in the array -* pPropSpecs - the property specs array -* PropId - property id to search for -* pIdx - optional pointer to the location to store the index -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn BOOL wiauPropInPropSpec(LONG NumPropSpecs, - __in_ecount(NumPropSpecs) const PROPSPEC *pPropSpecs, - PROPID PropId, __out_opt int *pIdx = NULL); -#else - __checkReturn BOOL _stdcall wiauPropInPropSpec(LONG NumPropSpecs, - __in_ecount(NumPropSpecs) const PROPSPEC *pPropSpecs, - PROPID PropId, __out_opt int *pIdx = NULL); -#endif - - -/**************************************************************************\ -* wiauGetValidFormats -* -* Calls drvGetWiaFormatInfo and makes a list of valid formats given -* a tymed value. Caller is responsible for freeing the format array -* with []delete. -* -* Arguments: -* -* pDrv - Pointer to WIA minidriver object (use "this") -* pWiasContext - WIA service context -* TymedValue - tymed value to search for -* pNumFormats - pointer to value to receive number of formats -* ppFormatArray - pointer to a location to receive array address -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauGetValidFormats(__in IWiaMiniDrv *pDrv, __in BYTE *pWiasContext, - LONG TymedValue, __out int *pNumFormats, __out_ecount(*pNumFormats) GUID **ppFormatArray); -#else - __checkReturn HRESULT _stdcall wiauGetValidFormats(__in IWiaMiniDrv *pDrv, __in BYTE *pWiasContext, - LONG TymedValue, __out int *pNumFormats, __out_ecount(*pNumFormats)GUID **ppFormatArray); -#endif - - -/**************************************************************************\ -* wiauGetResourceString -* -* This helper gets a resource string and returns it as a BSTR -* -* Arguments: -* -* hInst - Handle to module instance -* lResourceID - Resource ID of the target BSTR value -* pbstrStr - Location to store the retrieved string (caller must -* free this string with SysFreeString()) -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauGetResourceString(HINSTANCE hInst, LONG lResourceID, __out BSTR *pbstrStr); -#else - __checkReturn HRESULT _stdcall wiauGetResourceString(HINSTANCE hInst, LONG lResourceID, __out BSTR *pbstrStr); -#endif - - -/**************************************************************************\ -* wiauRegOpenDataW -* -* Opens the DeviceData key. Call this function only in the STI Initialize -* function. Call RegCloseKey when finished. -* -* Arguments: -* -* hkeyAncestor - HKey of parent (use hkey passed into Initialize) -* phkeyDeviceData - Location to store opened hkey -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegOpenDataW(__in HKEY hkeyAncestor, __inout HKEY *phkeyDeviceData); -#else - __checkReturn HRESULT _stdcall wiauRegOpenDataW(__in HKEY hkeyAncestor, __inout HKEY *phkeyDeviceData); -#endif - - -/**************************************************************************\ -* wiauRegOpenDataA -* -* Opens the DeviceData key. Call this function only in the STI Initialize -* function. Call RegCloseKey when finished. -* -* Arguments: -* -* hkeyAncestor - HKey of parent (use hkey passed into Initialize) -* phkeyDeviceData - Location to store opened hkey -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegOpenDataA(__in HKEY hkeyAncestor, __inout HKEY *phkeyDeviceData); -#else - __checkReturn HRESULT _stdcall wiauRegOpenDataA(__in HKEY hkeyAncestor, __inout HKEY *phkeyDeviceData); -#endif - - -/**************************************************************************\ -* wiauRegGetStrW -* -* Use to get string value from the DeviceData section of the registry. -* -* Arguments: -* -* hkey - Use hkey returned from wiauRegOpenData -* pwszValueName - Name of registry entry -* pwszValue - Location to store returned string -* pdwLength - Size of location in bytes -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegGetStrW(__in HKEY hkKey, __in PCWSTR pwszValueName, - __out_bcount(*pdwLength) PWSTR pwszValue, __inout WORD *pdwLength); -#else - __checkReturn HRESULT _stdcall wiauRegGetStrW(__in HKEY hkKey, __in PCWSTR pwszValueName, - __out_bcount(*pdwLength) PWSTR pwszValue, __inout DWORD *pdwLength); -#endif - - -/**************************************************************************\ -* wiauRegGetStrA -* -* Use to get string value from the DeviceData section of the registry. -* -* Arguments: -* -* hkey - Use hkey returned from wiauRegOpenData -* pszValueName - Name of registry entry -* pszValue - Location to store returned string -* pdwLength - Size of location in bytes -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegGetStrA(__in HKEY hkKey, __in PCSTR pszValueName, - __out_bcount(*pdwLength) PSTR pszValue, __inout DWORD *pdwLength); -#else - __checkReturn HRESULT _stdcall wiauRegGetStrA(__in HKEY hkKey, __in PCSTR pszValueName, - __out_bcount(*pdwLength) PSTR pszValue, __inout DWORD *pdwLength); -#endif - - -/**************************************************************************\ -* wiauRegGetDwordW -* -* Use to get DWORD value from the DeviceData section of the registry. -* -* Arguments: -* -* hkey - Use hkey returned from wiauRegOpenData -* pwszValueName - Name of registry entry -* pdwValue - Location to store returned DWORD -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegGetDwordW(__in HKEY hkKey, __in PCWSTR pwszValueName, __out DWORD *pdwValue); -#else - __checkReturn HRESULT _stdcall wiauRegGetDwordW(__in HKEY hkKey, __in PCWSTR pwszValueName, __out DWORD *pdwValue); -#endif - - -/**************************************************************************\ -* wiauRegGetDwordA -* -* Use to get DWORD value from the DeviceData section of the registry. -* -* Arguments: -* -* hkey - Use hkey returned from wiauRegOpenData -* pszValueName - Name of registry entry -* pdwValue - Location to store returned DWORD -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauRegGetDwordA(__in HKEY hkKey, __in PCSTR pszValueName, __out DWORD *pdwValue); -#else - __checkReturn HRESULT _stdcall wiauRegGetDwordA(__in HKEY hkKey, __in PCSTR pszValueName, __out DWORD *pdwValue); -#endif - - -/**************************************************************************\ -* WiauStrW2C -* -* Converts a wide character string to an ANSI character string -* -* Arguments: -* pwszSrc - wide character string to be converted -* pszDst - location to store the ANSI conversion -* iSize - size of the buffer pointed to by pszDst, in bytes -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauStrW2C(__in_bcount(iSize) __nullterminated WCHAR *pwszSrc, - __out_ecount(iSize) CHAR *pszDst, INT iSize); -#else - __checkReturn HRESULT _stdcall wiauStrW2C(__in_bcount(iSize) __nullterminated WCHAR *pwszSrc, - __out_ecount(iSize) CHAR *pszDst, INT iSize); -#endif - -/**************************************************************************\ -* WiauStrC2W -* -* Converts an ANSI character string to a wide character string -* -* Arguments: -* pszSrc - ANSI string to convert -* wpszDst - location to store the wide string -* iSize - size of the buffer pointed to by wpszDst, in bytes -* -\**************************************************************************/ -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauStrC2W(__in_bcount(iSize) __nullterminated CHAR *pszSrc, - __out_bcount(iSize) WCHAR *pwszDst, INT iSize); -#else - __checkReturn HRESULT _stdcall wiauStrC2W(__in_bcount(iSize) __nullterminated CHAR *pszSrc, - __out_bcount(iSize) WCHAR *pwszDst, INT iSize); -#endif - - -/**************************************************************************\ -* WiauStrW2W -* -* Copies a wide character string to another wide character string -* -* Arguments: -* pwszSrc - wide character string to be copied -* pwszDst - location to copy to -* iSize - size of the buffer pointed to by pwszDst, in bytes -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauStrW2W(__in_bcount(iSize) __nullterminated WCHAR *pwszSrc, - __out_bcount(iSize) WCHAR *pwszDst, INT iSize); -#else - __checkReturn HRESULT _stdcall wiauStrW2W(__in_bcount(iSize) __nullterminated WCHAR *pwszSrc, - __out_bcount(iSize) WCHAR *pwszDst, INT iSize); -#endif - - -/**************************************************************************\ -* WiauStrC2C -* -* Copies an ANSI character string to another ANSI character string -* -* Arguments: -* pszSrc - ANSI string to be copied -* pszDst - location to copy to -* iSize - size of the buffer pointed to by pszDst, in bytes -* -\**************************************************************************/ - -#if (_WIN32_WINNT == 0x0501) - __checkReturn HRESULT wiauStrC2C(__in_ecount(iSize) __nullterminated CHAR *pszSrc, - __out_bcount(iSize) CHAR *pszDst, INT iSize); -#else - __checkReturn HRESULT _stdcall wiauStrC2C(__in_ecount(iSize) __nullterminated CHAR *pszSrc, - __out_bcount(iSize) CHAR *pszDst, INT iSize); -#endif - - -#ifdef UNICODE - -#define wiauRegOpenData wiauRegOpenDataW -#define wiauRegGetStr wiauRegGetStrW -#define wiauRegGetDword wiauRegGetDwordW - -#define wiauStrT2C wiauStrW2C -#define wiauStrC2T wiauStrC2W -#define wiauStrT2W wiauStrW2W -#define wiauStrW2T wiauStrW2W -#define WIAU_DEBUG_TSTR "S" - -#else - -#define wiauRegOpenData wiauRegOpenDataA -#define wiauRegGetStr wiauRegGetStrA -#define wiauRegGetDword wiauRegGetDwordA - -#define wiauStrT2C wiauStrC2C -#define wiauStrC2T wiauStrC2C -#define wiauStrT2W wiauStrC2W -#define wiauStrW2T wiauStrW2C -#define WIAU_DEBUG_TSTR "s" - -#endif // UNICODE - - -/**************************************************************************\ -* WIA Debugging -* -* Definitions for debug messages. To use WIA debugging: -* 1. Set registry HKLM\System\CurrentControlSet\Control\StillImage\Debug\, -* DWORD value "DebugFlags" to the combination of the WIAUDBG_* flags -* desired. The application and possibly the WIA service will need to be -* restarted to pick up the new settings. The key is auto created the -* first time the module is executed. (Note: above is the -* name of the DLL or EXE, e.g. wiavusd.dll has a registry key of -* "HKLM\System\CurrentControlSet\Control\StillImage\Debug\wiavusd.dll".) -* 2. Or in the debugger, set g_dwDebugFlags to the combination of the -* WIAUDBG_* flags desired. This can be done anytime during the debug -* session. -* 3. From the module, call wiauDbgSetFlags(), where is the -* combination of the WIAUDBG_* flags desired. -* -* Messages will be logged to the debugger and the file -* %systemroot%\\wiadebug.log, unless the WIAUDBG_DONT_LOG_* flags are set. -* Setting both flags will turn off all messages. -* -* All strings should be ASCII. Use %S in the format string to print a -* Unicode string. -* -\**************************************************************************/ - -#define _STIDEBUG_H_ // WIA debugging is incompatible with stidebug.h, so don't include it - -// -// Predefined debug flags -// - -const DWORD WIAUDBG_ERRORS = 0x00000001; -const DWORD WIAUDBG_WARNINGS = 0x00000002; -const DWORD WIAUDBG_TRACES = 0x00000004; -const DWORD WIAUDBG_FNS = 0x00000008; // Function entry and exit -const DWORD WIAUDBG_DUMP = 0x00000010; // Dump data -const DWORD WIAUDBG_PRINT_TIME = 0x08000000; // Prints time for each message -const DWORD WIAUDBG_PRINT_INFO = 0x10000000; // Turns on thread, file, line info -const DWORD WIAUDBG_DONT_LOG_TO_DEBUGGER = 0x20000000; -const DWORD WIAUDBG_DONT_LOG_TO_FILE = 0x40000000; -const DWORD WIAUDBG_BREAK_ON_ERRORS = 0x80000000; // Do DebugBreak on errors - -// -// Don't log at all -// -const DWORD WIAUDBG_DONT_LOG = WIAUDBG_DONT_LOG_TO_FILE | WIAUDBG_DONT_LOG_TO_DEBUGGER; - -// -// Set default flags -// -#ifdef DEBUG -const DWORD WIAUDBG_DEFAULT_FLAGS = WIAUDBG_ERRORS; -#else -const DWORD WIAUDBG_DEFAULT_FLAGS = WIAUDBG_DONT_LOG; -#endif - -// -// FormatMessage flags -// -const DWORD WIAUDBG_MFMT_FLAGS = FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_MAX_WIDTH_MASK; - -#ifdef __cplusplus -extern "C" { -#endif - -// -// WIA Debugging has very little overhead and should be put into retail -// code for drivers. If it's really desired to remove it, define NO_WIA_DEBUG. -// - -#ifdef NO_WIA_DEBUG - -#define g_dwDebugFlags 0 -#define wiauDbgInit(a) -#define wiauDbgHelper(a,b,c,d) -#define wiauDbgHelper2 wiauNull3 -#define wiauDbgFlags wiauNull4 -#define wiauDbgError wiauNull2 -#define wiauDbgErrorHr wiauNull3hr -#define wiauDbgWarning wiauNull2 -#define wiauDbgTrace wiauNull2 -#define wiauDbgDump wiauNull2 -#define wiauDbgSetFlags(a) 0 -#define wiauDbgLegacyError wiauNull1 -#define wiauDbgLegacyWarning wiauNull1 -#define wiauDbgLegacyTrace wiauNull1 -#define wiauDbgLegacyError2 wiauNull2h -#define wiauDbgLegacyTrace2 wiauNull2h -#define wiauDbgLegacyHresult2 wiauNullHHr - -inline void wiauNull1(LPCSTR a, ...) {} -inline void wiauNull2(LPCSTR a, LPCSTR b,...) {} -inline void wiauNull2h(HINSTANCE hInstance, LPCSTR b,...) {} -inline void wiauNull3(LPCSTR a, LPCSTR b, LPCSTR c, ...) {} -inline void wiauNull3hr(HRESULT a, LPCSTR b, LPCSTR c, ...) {} -inline void wiauNull4(DWORD a, LPCSTR b, LPCSTR c, LPCSTR d, ...) {} -inline void wiauNullHHr(HINSTANCE hInstance, HRESULT hr) {} - - -#else // NO_WIA_DEBUG - -extern DWORD g_dwDebugFlags; -extern HANDLE g_hDebugFile; -extern DWORD g_dwDebugFileSizeLimit; -extern BOOL g_bDebugInited; - - -/**************************************************************************\ -* wiauDbgInit -* -* Call to initialize WIA debugging. If it's not called, all DLLs will -* inherit the debug flags of the process that creates them. -* -* Arguments: -* -* hInstance - DLL instance handle -* -\**************************************************************************/ - -void __stdcall wiauDbgInit(__in_opt HINSTANCE hInstance); -void __stdcall wiauDbgHelper(__in LPCSTR prefix, __in LPCSTR fname, __in LPCSTR fmt, va_list marker); -void __stdcall wiauDbgHelper2(__in LPCSTR prefix, __in LPCSTR fname, __in LPCSTR fmt, ...); - -inline void __stdcall wiauDbgFlags(DWORD flags, __in LPCSTR prefix, - __in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and the flag is enabled - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & flags)) { - - va_start(marker, fmt); - wiauDbgHelper(prefix, fname, fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgError(__in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and error messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_ERRORS)) { - - va_start(marker, fmt); - wiauDbgHelper("ERROR ", fname, fmt, marker); - va_end(marker); - } - - if (g_dwDebugFlags & WIAUDBG_BREAK_ON_ERRORS) { - DebugBreak(); - } -} - -inline void __stdcall wiauDbgErrorHr(HRESULT hr, __in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and error messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_ERRORS)) { - - va_start(marker, fmt); - wiauDbgHelper("ERROR ", fname, fmt, marker); - va_end(marker); - - CHAR szError[MAX_PATH]; \ - if(!FormatMessageA(WIAUDBG_MFMT_FLAGS, NULL, hr, 0, szError, MAX_PATH, NULL)) - { - StringCchCopyA(szError, ARRAYSIZE(szError), "Unknown HRESULT"); - } - wiauDbgHelper2("ERROR ", fname, "HRESULT = 0x%08x, %s", hr, szError); - } - - if (g_dwDebugFlags & WIAUDBG_BREAK_ON_ERRORS) { - DebugBreak(); - } -} - -inline void __stdcall wiauDbgWarning(__in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and warning messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_WARNINGS)) { - - va_start(marker, fmt); - wiauDbgHelper("WARN ", fname, fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgTrace(__in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and trace messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_TRACES)) { - - va_start(marker, fmt); - wiauDbgHelper(" ", fname, fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgDump(__in LPCSTR fname, __in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and trace messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_DUMP)) { - - va_start(marker, fmt); - wiauDbgHelper(" ", fname, fmt, marker); - va_end(marker); - } -} - -inline DWORD __stdcall wiauDbgSetFlags(DWORD flags) -{ - DWORD dwOld = g_dwDebugFlags; - g_dwDebugFlags = flags; - return dwOld; -} - - -inline void __stdcall wiauDbgLegacyError(__in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and error messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_ERRORS)) { - - va_start(marker, fmt); - wiauDbgHelper("ERROR ", "", fmt, marker); - va_end(marker); - } - - if (g_dwDebugFlags & WIAUDBG_BREAK_ON_ERRORS) { - DebugBreak(); - } -} - -inline void __stdcall wiauDbgLegacyWarning(__in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and warning messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_WARNINGS)) { - - va_start(marker, fmt); - wiauDbgHelper("WARN ", "", fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgLegacyTrace(__in LPCSTR fmt, ...) -{ - va_list marker; - - // - // See if log messages are enabled and trace messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_TRACES)) { - - va_start(marker, fmt); - wiauDbgHelper(" ", "", fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgLegacyError2(__in HINSTANCE hInstance, __in LPCSTR fmt, ...) -{ - UNREFERENCED_PARAMETER(hInstance); - va_list marker; - - // - // See if log messages are enabled and error messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_ERRORS)) { - - va_start(marker, fmt); - wiauDbgHelper("ERROR ", "", fmt, marker); - va_end(marker); - } - - if (g_dwDebugFlags & WIAUDBG_BREAK_ON_ERRORS) { - DebugBreak(); - } -} - -inline void __stdcall wiauDbgLegacyTrace2(__in HINSTANCE hInstance, __in LPCSTR fmt, ...) -{ - UNREFERENCED_PARAMETER(hInstance); - va_list marker; - - // - // See if log messages are enabled and trace messages are turned on - // - if (((g_dwDebugFlags & WIAUDBG_DONT_LOG) ^ WIAUDBG_DONT_LOG) && - (g_dwDebugFlags & WIAUDBG_TRACES)) { - - va_start(marker, fmt); - wiauDbgHelper(" ", "", fmt, marker); - va_end(marker); - } -} - -inline void __stdcall wiauDbgLegacyHresult2(__in HINSTANCE hInstance, HRESULT hr) -{ - UNREFERENCED_PARAMETER(hInstance); - wiauDbgErrorHr(hr, "", ""); -} - -#endif // NO_WIA_DEBUG - - -// -// Macros for mapping the old WIA logging to the new system -// -#ifdef WIA_MAP_OLD_DEBUG - -#define CWiaLogProc -#define WIAS_LOGPROC(x, y, z, fname) CWiauDbgFn __CWiauDbgFnObject(fname) -#define WIAS_LERROR(x,y,params) wiauDbgLegacyError ## params -#define WIAS_LWARNING(x,y,params) wiauDbgLegacyWarning ## params -#define WIAS_LTRACE(x,y,z,params) wiauDbgLegacyTrace ## params -#define WIAS_LHRESULT(x,y) wiauDbgErrorHr(y, "", "") - -#define WIAS_TRACE(x) wiauDbgLegacyTrace2 ## x -#define WIAS_ERROR(x) wiauDbgLegacyError2 ## x -#define WIAS_HRESULT(x) wiauDbgLegacyHresult2 ## x -#define WIAS_ASSERT(x, y) \ - if (!(y)) { \ - WIAS_ERROR((x, (char*) TEXT("ASSERTION FAILED: %hs(%d): %hs"), __FILE__,__LINE__,#x)); \ - DebugBreak(); \ - } - -#endif // WIA_MAP_OLD_DEBUG - - -// -// Macros for checking return values and common error conditions -// - -#define REQUIRE_SUCCESS(hr, fname, msg) \ - if (FAILED(hr)) { \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgErrorHr(hr, fname, msg); \ - goto Cleanup; \ - } - -#define REQUIRE_OK(hr, fname, msg) \ - if ((hr) != S_OK) { \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgErrorHr(hr, fname, msg); \ - goto Cleanup; \ - } - -#define REQUIRE_ARGS(args, hr, fname) \ - if (args) { \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgError(fname, "Invalid arg"); \ - hr = E_INVALIDARG; \ - goto Cleanup; \ - } - -#define REQUIRE_ALLOC(var, hr, fname) \ - if (!(var)) { \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgError(fname, "Memory allocation failed on " #var); \ - hr = E_OUTOFMEMORY; \ - goto Cleanup; \ - } - -#define REQUIRE_FILEHANDLE(handle, hr, fname, msg) \ - if ((handle) == NULL || (handle) == INVALID_HANDLE_VALUE) { \ - hr = HRESULT_FROM_WIN32(::GetLastError()); \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgErrorHr(hr, fname, msg); \ - goto Cleanup; \ - } - -#define REQUIRE_FILEIO(ret, hr, fname, msg) \ - if (!(ret)) { \ - hr = HRESULT_FROM_WIN32(::GetLastError()); \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgErrorHr(hr, fname, msg); \ - goto Cleanup; \ - } - -#define REQUIRE_WIN32(err, hr, fname, msg) \ - if ((err) != ERROR_SUCCESS) { \ - hr = HRESULT_FROM_WIN32(err); \ - if (g_dwDebugFlags & WIAUDBG_PRINT_INFO) { \ - DWORD threadId = GetCurrentThreadId(); \ - wiauDbgError(fname, "[%s(%d): Thread 0x%X (%d)]", __FILE__, __LINE__, threadId, threadId); \ - } \ - wiauDbgErrorHr(hr, fname, msg); \ - goto Cleanup; \ - } - - -// -// Macro and class for entry/exit point tracing -// - -#ifdef __cplusplus - -#ifdef NO_WIA_DEBUG - -#define DBG_FN(fname) - -#else // NO_WIA_DEBUG - -#define DBG_FN(fname) CWiauDbgFn __CWiauDbgFnObject(fname) - -class CWiauDbgFn { -public: - - CWiauDbgFn(__in LPCSTR fname) - { - m_fname = fname; - m_threadId = GetCurrentThreadId(); - wiauDbgFlags(WIAUDBG_FNS, " ", m_fname, "Entering, thread 0x%x (%d)", - m_threadId, m_threadId); - - } - - ~CWiauDbgFn() - { - wiauDbgFlags(WIAUDBG_FNS, " ", m_fname, "Exiting, thread 0x%x (%d)", - m_threadId, m_threadId); - } - -private: - LPCSTR m_fname; - DWORD m_threadId; -}; -#endif // NO_WIA_DEBUG - -} - -#else // __cplusplus - -#define DBG_FN(fname) wiauDbgFlags(WIAUDBG_FNS, " ", fname, "Entering"); -#endif // __cplusplus - -#endif //#if (_WIN32_WINNT >= 0x0501) - - diff --git a/qt-correction-tool/pub/ddk/windowssideshow.h b/qt-correction-tool/pub/ddk/windowssideshow.h deleted file mode 100644 index d563acb..0000000 --- a/qt-correction-tool/pub/ddk/windowssideshow.h +++ /dev/null @@ -1,151 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2004-2005 Microsoft Corporation. All rights -// reserved. -// -// -// Module: -// WindowsSideShow.h -// -// Description: -// This file defines supporting structures and values used in -// the Windows SideShow platform. -// -//----------------------------------------------------------------------- - -#pragma once -#if (_WIN32_WINNT >= 0x0600) // Windows Vista and later -#include "propkeydef.h" -/**************************************************************************** - * This section defines platform constants - ****************************************************************************/ - -const CONTENT_ID CONTENT_ID_GLANCE = 0; - -// Event IDs for ApplicationEvents fired by the device when the user enters/exits -// an application on the device. -const DWORD SIDESHOW_EVENTID_APPLICATION_ENTER = 0xFFFF0000; -const DWORD SIDESHOW_EVENTID_APPLICATION_EXIT = 0xFFFF0001; - - -/**************************************************************************** - * This section defines well-known device endpoints - ****************************************************************************/ - -// {A9A5353F-2D4B-47ce-93EE-759F3A7DDA4F} -DEFINE_GUID(SIDESHOW_ENDPOINT_SIMPLE_CONTENT_FORMAT, 0xa9a5353f, 0x2d4b, 0x47ce, 0x93, 0xee, 0x75, 0x9f, 0x3a, 0x7d, 0xda, 0x4f); - -// {4DFF36B5-9DDE-4F76-9A2A-96435047063D} -DEFINE_GUID(SIDESHOW_ENDPOINT_ICAL, 0x4dff36b5, 0x9dde, 0x4f76, 0x9a, 0x2a, 0x96, 0x43, 0x50, 0x47, 0x06, 0x3d); - - -/**************************************************************************** - * This section defines well-known device capabilities - ****************************************************************************/ - -// {8ABC88A8-857B-4ad7-A35A-B5942F492B99} -DEFINE_GUID(SIDESHOW_CAPABILITY_DEVICE_PROPERTIES, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99); - -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_DEVICE_ID, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 1); // [ VT_LPWSTR ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SCREEN_TYPE, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 2); // [ VT_I4 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SCREEN_WIDTH, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 3); // [ VT_UI2 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SCREEN_HEIGHT, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 4); // [ VT_UI2 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_COLOR_DEPTH, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 5); // [ VT_UI2 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_COLOR_TYPE, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 6); // [ VT_I4 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_DATA_CACHE, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 7); // [ VT_BOOL ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SUPPORTED_LANGUAGES, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 8); // [ VT_LPWSTR ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_CURRENT_LANGUAGE, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 9); // [ VT_LPWSTR ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SUPPORTED_THEMES, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 10);// [ VT_LPWSTR ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_SUPPORTED_IMAGE_FORMATS, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 14);// [ VT_LPWSTR ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_CLIENT_AREA_WIDTH, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 15);// [ VT_UI2 ] -DEFINE_PROPERTYKEY(SIDESHOW_CAPABILITY_CLIENT_AREA_HEIGHT, 0x8abc88a8, 0x857b, 0x4ad7, 0xa3, 0x5a, 0xb5, 0x94, 0x2f, 0x49, 0x2b, 0x99, 16);// [ VT_UI2 ] - -/**************************************************************************** - * This section defines enumerations used by the device capabilities - ****************************************************************************/ - -// Used with SIDESHOW_CAPABILITY_SCREEN_TYPE -typedef enum tagSIDESHOW_SCREEN_TYPE -{ - SIDESHOW_SCREEN_TYPE_BITMAP = 0, - SIDESHOW_SCREEN_TYPE_TEXT = 1, -} SIDESHOW_SCREEN_TYPE; - -// Used with SIDESHOW_CAPABILITY_COLOR_TYPE -typedef enum tagSIDESHOW_COLOR_TYPE -{ - SIDESHOW_COLOR_TYPE_COLOR = 0, - SIDESHOW_COLOR_TYPE_GREYSCALE = 1, - SIDESHOW_COLOR_TYPE_BLACK_AND_WHITE = 2, -} SIDESHOW_COLOR_TYPE; - - -/**************************************************************************** - * This section defines constants, structures and enumerations relating to - * the Simple Content Format - ****************************************************************************/ - -// The content id of the home page for a Simple Content Format application -const CONTENT_ID CONTENT_ID_HOME = 1; - -// The ApplicationEvent event ids from the Simple Content Format device application -typedef enum tagSCF_EVENT_IDS -{ - SCF_EVENT_NAVIGATION = 1, - SCF_EVENT_MENUACTION = 2, - SCF_EVENT_CONTEXTMENU = 3, -} SCF_EVENT_IDS; - -// The button ids used in the Simple Content Format events -typedef enum tagSCF_BUTTON_IDS -{ - SCF_BUTTON_MENU = 1, - SCF_BUTTON_SELECT = 2, - SCF_BUTTON_UP = 3, - SCF_BUTTON_DOWN = 4, - SCF_BUTTON_LEFT = 5, - SCF_BUTTON_RIGHT = 6, - SCF_BUTTON_PLAY = 7, - SCF_BUTTON_PAUSE = 8, - SCF_BUTTON_FASTFORWARD = 9, - SCF_BUTTON_REWIND = 10, - SCF_BUTTON_STOP = 11, - SCF_BUTTON_BACK = 65280, // 0xFF00 -} SCF_BUTTON_IDS; - -// A header structure that is common amongst all Simple Content Format event structures -typedef struct tagSCF_EVENT_HEADER -{ - CONTENT_ID PreviousPage; - CONTENT_ID TargetPage; -} SCF_EVENT_HEADER, *PSCF_EVENT_HEADER; - -// The data passed with an SCF_EVENT_NAVIGATION ApplicationEvent -typedef struct tagSCF_NAVIGATION_EVENT -{ - CONTENT_ID PreviousPage; - CONTENT_ID TargetPage; - UINT32 Button; -} SCF_NAVIGATION_EVENT, *PSCF_NAVIGATION_EVENT; - -// The data passed with an SCF_EVENT_MENUACTION ApplicationEvent -typedef struct tagSCF_MENUACTION_EVENT -{ - CONTENT_ID PreviousPage; - CONTENT_ID TargetPage; - UINT32 Button; - UINT32 ItemId; -} SCF_MENUACTION_EVENT, *PSCF_MENUACTION_EVENT; - -// The data passed with an SCF_EVENT_CONTEXTMENU ApplicationEvent -typedef struct tagSCF_CONTEXTMENU_EVENT -{ - CONTENT_ID PreviousPage; - CONTENT_ID TargetPage; - UINT32 PreviousItemId; - CONTENT_ID MenuPage; - UINT32 MenuItemId; -} SCF_CONTEXTMENU_EVENT, *PSCF_CONTEXTMENU_EVENT; - -#endif // (_WIN32_WINNT >= 0x0600) - diff --git a/qt-correction-tool/pub/ddk/windowssideshowclassextension.h b/qt-correction-tool/pub/ddk/windowssideshowclassextension.h deleted file mode 100644 index 6064c1c..0000000 --- a/qt-correction-tool/pub/ddk/windowssideshowclassextension.h +++ /dev/null @@ -1,896 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for windowssideshowclassextension.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __windowssideshowclassextension_h__ -#define __windowssideshowclassextension_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __ISideShowDriver_FWD_DEFINED__ -#define __ISideShowDriver_FWD_DEFINED__ -typedef interface ISideShowDriver ISideShowDriver; -#endif /* __ISideShowDriver_FWD_DEFINED__ */ - - -#ifndef __ISideShowClassExtension_FWD_DEFINED__ -#define __ISideShowClassExtension_FWD_DEFINED__ -typedef interface ISideShowClassExtension ISideShowClassExtension; -#endif /* __ISideShowClassExtension_FWD_DEFINED__ */ - - -#ifndef __ISideShowClassExtension2_FWD_DEFINED__ -#define __ISideShowClassExtension2_FWD_DEFINED__ -typedef interface ISideShowClassExtension2 ISideShowClassExtension2; -#endif /* __ISideShowClassExtension2_FWD_DEFINED__ */ - - -#ifndef __SideShowClassExtension_FWD_DEFINED__ -#define __SideShowClassExtension_FWD_DEFINED__ - -#ifdef __cplusplus -typedef class SideShowClassExtension SideShowClassExtension; -#else -typedef struct SideShowClassExtension SideShowClassExtension; -#endif /* __cplusplus */ - -#endif /* __SideShowClassExtension_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "propidl.h" -#include "wudfddi.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_windowssideshowclassextension_0000_0000 */ -/* [local] */ - -#if (_WIN32_WINNT >= 0x0600) // Windows Vista and later -typedef struct _SIDESHOW_TIME_ZONE_INFORMATION - { - LONG Bias; - WCHAR StandardName[ 32 ]; - SYSTEMTIME StandardDate; - LONG StandardBias; - WCHAR DaylightName[ 32 ]; - SYSTEMTIME DaylightDate; - LONG DaylightBias; - } SIDESHOW_TIME_ZONE_INFORMATION; - -typedef -enum tagUSER_STATE - { AVAILABLE = 0, - UNAVAILABLE = 1 - } USER_STATE; - -typedef GUID APPLICATION_ID; - -typedef GUID ENDPOINT_ID; - -typedef LPWSTR DEVICE_ID; - -typedef REFGUID REFAPPLICATION_ID; - -typedef REFGUID REFENDPOINT_ID; - -typedef ENDPOINT_ID *PENDPOINT_ID; - -typedef APPLICATION_ID *PAPPLICATION_ID; - -typedef DEVICE_ID *PDEVICE_ID; - -typedef unsigned long CONTENT_ID; - -typedef CONTENT_ID *PCONTENT_ID; - -typedef unsigned long NOTIFICATION_ID; - -typedef NOTIFICATION_ID *PNOTIFICATION_ID; - - - -extern RPC_IF_HANDLE __MIDL_itf_windowssideshowclassextension_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_windowssideshowclassextension_0000_0000_v0_0_s_ifspec; - -#ifndef __ISideShowDriver_INTERFACE_DEFINED__ -#define __ISideShowDriver_INTERFACE_DEFINED__ - -/* interface ISideShowDriver */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISideShowDriver; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("2082260d-0e28-4c57-b5c2-67fa091daa91") - ISideShowDriver : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE OnGetDeviceName( - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszName) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetDeviceManufacturer( - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszManufacturer) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetDeviceFirmwareVersion( - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszVersion) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetTime( - /* [in] */ const FILETIME FileTime) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetTimeZone( - /* [in] */ __RPC__in const SIDESHOW_TIME_ZONE_INFORMATION *pTimeZoneInformation) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetCurrentUser( - /* [in] */ __RPC__in const SID *pUserSid) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetCurrentUser( - /* [out] */ __RPC__deref_out_opt SID **ppUserSid) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetUserState( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ const USER_STATE state) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetShortDateFormat( - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszDateFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetLongDateFormat( - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszDateFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetShortTimeFormat( - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszTimeFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetLongTimeFormat( - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszTimeFormat) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetLanguage( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in LPCWSTR pwszLanguage) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetDeviceEndpoints( - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcEndpoints) ENDPOINT_ID **rgEndpoints, - /* [out] */ __RPC__out DWORD *pcEndpoints) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetDeviceCapabilities( - /* [in] */ __RPC__in const PROPERTYKEY *pKey, - /* [out] */ __RPC__out PROPVARIANT *pvValue) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetPreEnabledApplications( - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplications) APPLICATION_ID **ppApplicationIds, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplications) ENDPOINT_ID **ppEndpointIds, - /* [out] */ __RPC__out DWORD *pcApplications) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetApplicationOrder( - /* [size_is][in] */ __RPC__in_ecount_full(cApplicationIds) const APPLICATION_ID *pApplicationIds, - /* [in] */ const DWORD cApplicationIds) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnGetApplicationOrder( - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplicationIds) APPLICATION_ID **ppApplicationIds, - /* [out] */ __RPC__out DWORD *pcApplicationIds) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnAddApplication( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndPointId, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszName, - /* [in] */ const DWORD dwCachePolicy, - /* [in] */ const DWORD dwOnlineOnly, - /* [size_is][in] */ __RPC__in_ecount_full(cbLargeIcon) const unsigned char *pbLargeIcon, - /* [in] */ const DWORD cbLargeIcon, - /* [size_is][in] */ __RPC__in_ecount_full(cbMediumIcon) const unsigned char *pbMediumIcon, - /* [in] */ const DWORD cbMediumIcon, - /* [size_is][in] */ __RPC__in_ecount_full(cbSmallIcon) const unsigned char *pbSmallIcon, - /* [in] */ const DWORD cbSmallIcon) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveApplication( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveAllApplications( - /* [in] */ __RPC__in const SID *pUserSid) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnAddContent( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId, - /* [in] */ const CONTENT_ID ContentId, - /* [size_is][in] */ __RPC__in_ecount_full(cbData) const unsigned char *pData, - /* [in] */ const DWORD cbData) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveContent( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId, - /* [in] */ const CONTENT_ID ContentId) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveAllContent( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnAddNotification( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ const NOTIFICATION_ID NotificationId, - /* [in] */ const FILETIME ftExpiration, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszTitle, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszMessage, - /* [size_is][in] */ __RPC__in_ecount_full(cbImage) const unsigned char *pbImage, - /* [in] */ const DWORD cbImage) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveNotification( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ const NOTIFICATION_ID NotificationId) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnRemoveAllNotifications( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnSetNotificationsEnabled( - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ const BOOL fIsEnabled) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnProcessWpdMessage( - /* [in] */ __RPC__in_opt IUnknown *pPortableDeviceValuesParams, - /* [in] */ __RPC__in_opt IUnknown *pPortableDeviceValuesResults) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISideShowDriverVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISideShowDriver * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISideShowDriver * This); - - HRESULT ( STDMETHODCALLTYPE *OnGetDeviceName )( - __RPC__in ISideShowDriver * This, - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszName); - - HRESULT ( STDMETHODCALLTYPE *OnGetDeviceManufacturer )( - __RPC__in ISideShowDriver * This, - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszManufacturer); - - HRESULT ( STDMETHODCALLTYPE *OnGetDeviceFirmwareVersion )( - __RPC__in ISideShowDriver * This, - /* [string][out] */ __RPC__deref_out_opt_string LPWSTR *ppwszVersion); - - HRESULT ( STDMETHODCALLTYPE *OnSetTime )( - __RPC__in ISideShowDriver * This, - /* [in] */ const FILETIME FileTime); - - HRESULT ( STDMETHODCALLTYPE *OnSetTimeZone )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SIDESHOW_TIME_ZONE_INFORMATION *pTimeZoneInformation); - - HRESULT ( STDMETHODCALLTYPE *OnSetCurrentUser )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid); - - HRESULT ( STDMETHODCALLTYPE *OnGetCurrentUser )( - __RPC__in ISideShowDriver * This, - /* [out] */ __RPC__deref_out_opt SID **ppUserSid); - - HRESULT ( STDMETHODCALLTYPE *OnSetUserState )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ const USER_STATE state); - - HRESULT ( STDMETHODCALLTYPE *OnSetShortDateFormat )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszDateFormat); - - HRESULT ( STDMETHODCALLTYPE *OnSetLongDateFormat )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszDateFormat); - - HRESULT ( STDMETHODCALLTYPE *OnSetShortTimeFormat )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszTimeFormat); - - HRESULT ( STDMETHODCALLTYPE *OnSetLongTimeFormat )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [string][in] */ __RPC__in_string LPCWSTR pwszTimeFormat); - - HRESULT ( STDMETHODCALLTYPE *OnSetLanguage )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in LPCWSTR pwszLanguage); - - HRESULT ( STDMETHODCALLTYPE *OnGetDeviceEndpoints )( - __RPC__in ISideShowDriver * This, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcEndpoints) ENDPOINT_ID **rgEndpoints, - /* [out] */ __RPC__out DWORD *pcEndpoints); - - HRESULT ( STDMETHODCALLTYPE *OnGetDeviceCapabilities )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const PROPERTYKEY *pKey, - /* [out] */ __RPC__out PROPVARIANT *pvValue); - - HRESULT ( STDMETHODCALLTYPE *OnGetPreEnabledApplications )( - __RPC__in ISideShowDriver * This, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplications) APPLICATION_ID **ppApplicationIds, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplications) ENDPOINT_ID **ppEndpointIds, - /* [out] */ __RPC__out DWORD *pcApplications); - - HRESULT ( STDMETHODCALLTYPE *OnSetApplicationOrder )( - __RPC__in ISideShowDriver * This, - /* [size_is][in] */ __RPC__in_ecount_full(cApplicationIds) const APPLICATION_ID *pApplicationIds, - /* [in] */ const DWORD cApplicationIds); - - HRESULT ( STDMETHODCALLTYPE *OnGetApplicationOrder )( - __RPC__in ISideShowDriver * This, - /* [size_is][size_is][out] */ __RPC__deref_out_ecount_full_opt(*pcApplicationIds) APPLICATION_ID **ppApplicationIds, - /* [out] */ __RPC__out DWORD *pcApplicationIds); - - HRESULT ( STDMETHODCALLTYPE *OnAddApplication )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndPointId, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszName, - /* [in] */ const DWORD dwCachePolicy, - /* [in] */ const DWORD dwOnlineOnly, - /* [size_is][in] */ __RPC__in_ecount_full(cbLargeIcon) const unsigned char *pbLargeIcon, - /* [in] */ const DWORD cbLargeIcon, - /* [size_is][in] */ __RPC__in_ecount_full(cbMediumIcon) const unsigned char *pbMediumIcon, - /* [in] */ const DWORD cbMediumIcon, - /* [size_is][in] */ __RPC__in_ecount_full(cbSmallIcon) const unsigned char *pbSmallIcon, - /* [in] */ const DWORD cbSmallIcon); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveApplication )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveAllApplications )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid); - - HRESULT ( STDMETHODCALLTYPE *OnAddContent )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId, - /* [in] */ const CONTENT_ID ContentId, - /* [size_is][in] */ __RPC__in_ecount_full(cbData) const unsigned char *pData, - /* [in] */ const DWORD cbData); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveContent )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId, - /* [in] */ const CONTENT_ID ContentId); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveAllContent )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ __RPC__in REFENDPOINT_ID EndpointId); - - HRESULT ( STDMETHODCALLTYPE *OnAddNotification )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ const NOTIFICATION_ID NotificationId, - /* [in] */ const FILETIME ftExpiration, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszTitle, - /* [string][in] */ __RPC__in_string LPCWSTR pcwszMessage, - /* [size_is][in] */ __RPC__in_ecount_full(cbImage) const unsigned char *pbImage, - /* [in] */ const DWORD cbImage); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveNotification )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId, - /* [in] */ const NOTIFICATION_ID NotificationId); - - HRESULT ( STDMETHODCALLTYPE *OnRemoveAllNotifications )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ __RPC__in REFAPPLICATION_ID ApplicationId); - - HRESULT ( STDMETHODCALLTYPE *OnSetNotificationsEnabled )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in const SID *pUserSid, - /* [in] */ const BOOL fIsEnabled); - - HRESULT ( STDMETHODCALLTYPE *OnProcessWpdMessage )( - __RPC__in ISideShowDriver * This, - /* [in] */ __RPC__in_opt IUnknown *pPortableDeviceValuesParams, - /* [in] */ __RPC__in_opt IUnknown *pPortableDeviceValuesResults); - - END_INTERFACE - } ISideShowDriverVtbl; - - interface ISideShowDriver - { - CONST_VTBL struct ISideShowDriverVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISideShowDriver_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISideShowDriver_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISideShowDriver_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISideShowDriver_OnGetDeviceName(This,ppwszName) \ - ( (This)->lpVtbl -> OnGetDeviceName(This,ppwszName) ) - -#define ISideShowDriver_OnGetDeviceManufacturer(This,ppwszManufacturer) \ - ( (This)->lpVtbl -> OnGetDeviceManufacturer(This,ppwszManufacturer) ) - -#define ISideShowDriver_OnGetDeviceFirmwareVersion(This,ppwszVersion) \ - ( (This)->lpVtbl -> OnGetDeviceFirmwareVersion(This,ppwszVersion) ) - -#define ISideShowDriver_OnSetTime(This,FileTime) \ - ( (This)->lpVtbl -> OnSetTime(This,FileTime) ) - -#define ISideShowDriver_OnSetTimeZone(This,pTimeZoneInformation) \ - ( (This)->lpVtbl -> OnSetTimeZone(This,pTimeZoneInformation) ) - -#define ISideShowDriver_OnSetCurrentUser(This,pUserSid) \ - ( (This)->lpVtbl -> OnSetCurrentUser(This,pUserSid) ) - -#define ISideShowDriver_OnGetCurrentUser(This,ppUserSid) \ - ( (This)->lpVtbl -> OnGetCurrentUser(This,ppUserSid) ) - -#define ISideShowDriver_OnSetUserState(This,pUserSid,state) \ - ( (This)->lpVtbl -> OnSetUserState(This,pUserSid,state) ) - -#define ISideShowDriver_OnSetShortDateFormat(This,pUserSid,pwszDateFormat) \ - ( (This)->lpVtbl -> OnSetShortDateFormat(This,pUserSid,pwszDateFormat) ) - -#define ISideShowDriver_OnSetLongDateFormat(This,pUserSid,pwszDateFormat) \ - ( (This)->lpVtbl -> OnSetLongDateFormat(This,pUserSid,pwszDateFormat) ) - -#define ISideShowDriver_OnSetShortTimeFormat(This,pUserSid,pwszTimeFormat) \ - ( (This)->lpVtbl -> OnSetShortTimeFormat(This,pUserSid,pwszTimeFormat) ) - -#define ISideShowDriver_OnSetLongTimeFormat(This,pUserSid,pwszTimeFormat) \ - ( (This)->lpVtbl -> OnSetLongTimeFormat(This,pUserSid,pwszTimeFormat) ) - -#define ISideShowDriver_OnSetLanguage(This,pUserSid,pwszLanguage) \ - ( (This)->lpVtbl -> OnSetLanguage(This,pUserSid,pwszLanguage) ) - -#define ISideShowDriver_OnGetDeviceEndpoints(This,rgEndpoints,pcEndpoints) \ - ( (This)->lpVtbl -> OnGetDeviceEndpoints(This,rgEndpoints,pcEndpoints) ) - -#define ISideShowDriver_OnGetDeviceCapabilities(This,pKey,pvValue) \ - ( (This)->lpVtbl -> OnGetDeviceCapabilities(This,pKey,pvValue) ) - -#define ISideShowDriver_OnGetPreEnabledApplications(This,ppApplicationIds,ppEndpointIds,pcApplications) \ - ( (This)->lpVtbl -> OnGetPreEnabledApplications(This,ppApplicationIds,ppEndpointIds,pcApplications) ) - -#define ISideShowDriver_OnSetApplicationOrder(This,pApplicationIds,cApplicationIds) \ - ( (This)->lpVtbl -> OnSetApplicationOrder(This,pApplicationIds,cApplicationIds) ) - -#define ISideShowDriver_OnGetApplicationOrder(This,ppApplicationIds,pcApplicationIds) \ - ( (This)->lpVtbl -> OnGetApplicationOrder(This,ppApplicationIds,pcApplicationIds) ) - -#define ISideShowDriver_OnAddApplication(This,pUserSid,ApplicationId,EndPointId,pcwszName,dwCachePolicy,dwOnlineOnly,pbLargeIcon,cbLargeIcon,pbMediumIcon,cbMediumIcon,pbSmallIcon,cbSmallIcon) \ - ( (This)->lpVtbl -> OnAddApplication(This,pUserSid,ApplicationId,EndPointId,pcwszName,dwCachePolicy,dwOnlineOnly,pbLargeIcon,cbLargeIcon,pbMediumIcon,cbMediumIcon,pbSmallIcon,cbSmallIcon) ) - -#define ISideShowDriver_OnRemoveApplication(This,pUserSid,ApplicationId) \ - ( (This)->lpVtbl -> OnRemoveApplication(This,pUserSid,ApplicationId) ) - -#define ISideShowDriver_OnRemoveAllApplications(This,pUserSid) \ - ( (This)->lpVtbl -> OnRemoveAllApplications(This,pUserSid) ) - -#define ISideShowDriver_OnAddContent(This,pUserSid,ApplicationId,EndpointId,ContentId,pData,cbData) \ - ( (This)->lpVtbl -> OnAddContent(This,pUserSid,ApplicationId,EndpointId,ContentId,pData,cbData) ) - -#define ISideShowDriver_OnRemoveContent(This,pUserSid,ApplicationId,EndpointId,ContentId) \ - ( (This)->lpVtbl -> OnRemoveContent(This,pUserSid,ApplicationId,EndpointId,ContentId) ) - -#define ISideShowDriver_OnRemoveAllContent(This,pUserSid,ApplicationId,EndpointId) \ - ( (This)->lpVtbl -> OnRemoveAllContent(This,pUserSid,ApplicationId,EndpointId) ) - -#define ISideShowDriver_OnAddNotification(This,pUserSid,ApplicationId,NotificationId,ftExpiration,pcwszTitle,pcwszMessage,pbImage,cbImage) \ - ( (This)->lpVtbl -> OnAddNotification(This,pUserSid,ApplicationId,NotificationId,ftExpiration,pcwszTitle,pcwszMessage,pbImage,cbImage) ) - -#define ISideShowDriver_OnRemoveNotification(This,pUserSid,ApplicationId,NotificationId) \ - ( (This)->lpVtbl -> OnRemoveNotification(This,pUserSid,ApplicationId,NotificationId) ) - -#define ISideShowDriver_OnRemoveAllNotifications(This,pUserSid,ApplicationId) \ - ( (This)->lpVtbl -> OnRemoveAllNotifications(This,pUserSid,ApplicationId) ) - -#define ISideShowDriver_OnSetNotificationsEnabled(This,pUserSid,fIsEnabled) \ - ( (This)->lpVtbl -> OnSetNotificationsEnabled(This,pUserSid,fIsEnabled) ) - -#define ISideShowDriver_OnProcessWpdMessage(This,pPortableDeviceValuesParams,pPortableDeviceValuesResults) \ - ( (This)->lpVtbl -> OnProcessWpdMessage(This,pPortableDeviceValuesParams,pPortableDeviceValuesResults) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISideShowDriver_INTERFACE_DEFINED__ */ - - -#ifndef __ISideShowClassExtension_INTERFACE_DEFINED__ -#define __ISideShowClassExtension_INTERFACE_DEFINED__ - -/* interface ISideShowClassExtension */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISideShowClassExtension; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("27E78451-41C1-47fd-A50D-4D3E97D35B30") - ISideShowClassExtension : public IUnknown - { - public: - virtual HRESULT STDMETHODCALLTYPE Initialize( - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSideShowDriverUnknown) = 0; - - virtual HRESULT STDMETHODCALLTYPE Uninitialize( - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown) = 0; - - virtual HRESULT STDMETHODCALLTYPE OnProcessIoControl( - /* [in] */ __RPC__in_opt IWDFIoQueue *pWdfQueue, - /* [in] */ __RPC__in_opt IWDFIoRequest *pWdfRequest, - /* [in] */ ULONG ControlCode, - /* [in] */ SIZE_T InputBufferSizeInBytes, - /* [in] */ SIZE_T OutputBufferSizeInBytes, - /* [out] */ __RPC__out DWORD *pcbWritten) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISideShowClassExtensionVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISideShowClassExtension * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISideShowClassExtension * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISideShowClassExtension * This); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - __RPC__in ISideShowClassExtension * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSideShowDriverUnknown); - - HRESULT ( STDMETHODCALLTYPE *Uninitialize )( - __RPC__in ISideShowClassExtension * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown); - - HRESULT ( STDMETHODCALLTYPE *OnProcessIoControl )( - __RPC__in ISideShowClassExtension * This, - /* [in] */ __RPC__in_opt IWDFIoQueue *pWdfQueue, - /* [in] */ __RPC__in_opt IWDFIoRequest *pWdfRequest, - /* [in] */ ULONG ControlCode, - /* [in] */ SIZE_T InputBufferSizeInBytes, - /* [in] */ SIZE_T OutputBufferSizeInBytes, - /* [out] */ __RPC__out DWORD *pcbWritten); - - END_INTERFACE - } ISideShowClassExtensionVtbl; - - interface ISideShowClassExtension - { - CONST_VTBL struct ISideShowClassExtensionVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISideShowClassExtension_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISideShowClassExtension_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISideShowClassExtension_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISideShowClassExtension_Initialize(This,pWdfDeviceUnknown,pSideShowDriverUnknown) \ - ( (This)->lpVtbl -> Initialize(This,pWdfDeviceUnknown,pSideShowDriverUnknown) ) - -#define ISideShowClassExtension_Uninitialize(This,pWdfDeviceUnknown) \ - ( (This)->lpVtbl -> Uninitialize(This,pWdfDeviceUnknown) ) - -#define ISideShowClassExtension_OnProcessIoControl(This,pWdfQueue,pWdfRequest,ControlCode,InputBufferSizeInBytes,OutputBufferSizeInBytes,pcbWritten) \ - ( (This)->lpVtbl -> OnProcessIoControl(This,pWdfQueue,pWdfRequest,ControlCode,InputBufferSizeInBytes,OutputBufferSizeInBytes,pcbWritten) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISideShowClassExtension_INTERFACE_DEFINED__ */ - - -#ifndef __ISideShowClassExtension2_INTERFACE_DEFINED__ -#define __ISideShowClassExtension2_INTERFACE_DEFINED__ - -/* interface ISideShowClassExtension2 */ -/* [unique][helpstring][uuid][object] */ - - -EXTERN_C const IID IID_ISideShowClassExtension2; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("1A6C8124-03E3-4A9A-AFD3-CEDD39E426B5") - ISideShowClassExtension2 : public ISideShowClassExtension - { - public: - virtual HRESULT STDMETHODCALLTYPE InitializeAsync( - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSideShowDriverUnknown) = 0; - - virtual HRESULT STDMETHODCALLTYPE PostEvent( - /* [in] */ __RPC__in REFGUID in_EventGuid, - /* [full][in] */ __RPC__in_opt SID *const in_pSid, - /* [full][in] */ __RPC__in_opt BYTE *const in_pbEventData, - /* [in] */ const DWORD in_cbEventData) = 0; - - virtual HRESULT STDMETHODCALLTYPE CleanupFile( - /* [in] */ __RPC__in_opt IWDFFile *pWdfFile) = 0; - - }; - -#else /* C style interface */ - - typedef struct ISideShowClassExtension2Vtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in ISideShowClassExtension2 * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in ISideShowClassExtension2 * This); - - HRESULT ( STDMETHODCALLTYPE *Initialize )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSideShowDriverUnknown); - - HRESULT ( STDMETHODCALLTYPE *Uninitialize )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown); - - HRESULT ( STDMETHODCALLTYPE *OnProcessIoControl )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in_opt IWDFIoQueue *pWdfQueue, - /* [in] */ __RPC__in_opt IWDFIoRequest *pWdfRequest, - /* [in] */ ULONG ControlCode, - /* [in] */ SIZE_T InputBufferSizeInBytes, - /* [in] */ SIZE_T OutputBufferSizeInBytes, - /* [out] */ __RPC__out DWORD *pcbWritten); - - HRESULT ( STDMETHODCALLTYPE *InitializeAsync )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in_opt IUnknown *pWdfDeviceUnknown, - /* [in] */ __RPC__in_opt IUnknown *pSideShowDriverUnknown); - - HRESULT ( STDMETHODCALLTYPE *PostEvent )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in REFGUID in_EventGuid, - /* [full][in] */ __RPC__in_opt SID *const in_pSid, - /* [full][in] */ __RPC__in_opt BYTE *const in_pbEventData, - /* [in] */ const DWORD in_cbEventData); - - HRESULT ( STDMETHODCALLTYPE *CleanupFile )( - __RPC__in ISideShowClassExtension2 * This, - /* [in] */ __RPC__in_opt IWDFFile *pWdfFile); - - END_INTERFACE - } ISideShowClassExtension2Vtbl; - - interface ISideShowClassExtension2 - { - CONST_VTBL struct ISideShowClassExtension2Vtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define ISideShowClassExtension2_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define ISideShowClassExtension2_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define ISideShowClassExtension2_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define ISideShowClassExtension2_Initialize(This,pWdfDeviceUnknown,pSideShowDriverUnknown) \ - ( (This)->lpVtbl -> Initialize(This,pWdfDeviceUnknown,pSideShowDriverUnknown) ) - -#define ISideShowClassExtension2_Uninitialize(This,pWdfDeviceUnknown) \ - ( (This)->lpVtbl -> Uninitialize(This,pWdfDeviceUnknown) ) - -#define ISideShowClassExtension2_OnProcessIoControl(This,pWdfQueue,pWdfRequest,ControlCode,InputBufferSizeInBytes,OutputBufferSizeInBytes,pcbWritten) \ - ( (This)->lpVtbl -> OnProcessIoControl(This,pWdfQueue,pWdfRequest,ControlCode,InputBufferSizeInBytes,OutputBufferSizeInBytes,pcbWritten) ) - - -#define ISideShowClassExtension2_InitializeAsync(This,pWdfDeviceUnknown,pSideShowDriverUnknown) \ - ( (This)->lpVtbl -> InitializeAsync(This,pWdfDeviceUnknown,pSideShowDriverUnknown) ) - -#define ISideShowClassExtension2_PostEvent(This,in_EventGuid,in_pSid,in_pbEventData,in_cbEventData) \ - ( (This)->lpVtbl -> PostEvent(This,in_EventGuid,in_pSid,in_pbEventData,in_cbEventData) ) - -#define ISideShowClassExtension2_CleanupFile(This,pWdfFile) \ - ( (This)->lpVtbl -> CleanupFile(This,pWdfFile) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __ISideShowClassExtension2_INTERFACE_DEFINED__ */ - - - -#ifndef __WindowsSideShowDriverLibrary_LIBRARY_DEFINED__ -#define __WindowsSideShowDriverLibrary_LIBRARY_DEFINED__ - -/* library WindowsSideShowDriverLibrary */ -/* [helpstring][version][uuid] */ - - -EXTERN_C const IID LIBID_WindowsSideShowDriverLibrary; - -EXTERN_C const CLSID CLSID_SideShowClassExtension; - -#ifdef __cplusplus - -class DECLSPEC_UUID("76EFD608-E0CE-4887-98E2-F931363C4BC5") -SideShowClassExtension; -#endif -#endif /* __WindowsSideShowDriverLibrary_LIBRARY_DEFINED__ */ - -/* interface __MIDL_itf_windowssideshowclassextension_0000_0003 */ -/* [local] */ - -#endif // (_WIN32_WINNT >= 0x0600) - - -extern RPC_IF_HANDLE __MIDL_itf_windowssideshowclassextension_0000_0003_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_windowssideshowclassextension_0000_0003_v0_0_s_ifspec; - -/* Additional Prototypes for ALL interfaces */ - -unsigned long __RPC_USER BSTR_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -unsigned long __RPC_USER BSTR_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in BSTR * ); -unsigned char * __RPC_USER BSTR_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out BSTR * ); -void __RPC_USER BSTR_UserFree64( __RPC__in unsigned long *, __RPC__in BSTR * ); - -unsigned long __RPC_USER LPSAFEARRAY_UserSize64( __RPC__in unsigned long *, unsigned long , __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserMarshal64( __RPC__in unsigned long *, __RPC__inout_xcount(0) unsigned char *, __RPC__in LPSAFEARRAY * ); -unsigned char * __RPC_USER LPSAFEARRAY_UserUnmarshal64(__RPC__in unsigned long *, __RPC__in_xcount(0) unsigned char *, __RPC__out LPSAFEARRAY * ); -void __RPC_USER LPSAFEARRAY_UserFree64( __RPC__in unsigned long *, __RPC__in LPSAFEARRAY * ); - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/ddk/windowssideshowdriverevents.h b/qt-correction-tool/pub/ddk/windowssideshowdriverevents.h deleted file mode 100644 index 5f9b9ab..0000000 --- a/qt-correction-tool/pub/ddk/windowssideshowdriverevents.h +++ /dev/null @@ -1,159 +0,0 @@ -//----------------------------------------------------------------------- -// -// Copyright (c) 2005 Microsoft Corporation. All rights -// reserved. -// -// -// Module: -// WindowsSideShowDriverEvents.h -// -// Description: -// This header contains structures and values related to events -// that can be sent by Windows SideShow drivers. -// -// Comments: -// They are currently intended to be used by the UMDF PnP eventing -// mechanism. -// -//----------------------------------------------------------------------- - -#pragma once -#if (_WIN32_WINNT >= 0x0600) // Windows Vista and later - - -// Version number used in new Windows 7 structs -const DWORD VERSION_1_WINDOWS_7 = 0; - - -////////////////////////////////////////////////////////////////////////////// -// -// This section defines the device functional interface GUIDs for -// Windows SideShow-compatible devices. -// -////////////////////////////////////////////////////////////////////////////// - -// {152E5811-FEB9-4B00-90F4-D32947AE1681} -DEFINE_GUID(GUID_DEVINTERFACE_SIDESHOW, 0x152e5811, 0xfeb9, 0x4b00, 0x90, 0xf4, 0xd3, 0x29, 0x47, 0xae, 0x16, 0x81); - -////////////////////////////////////////////////////////////////////////////// -// -// This section defines the GUIDs associated with the various event types. -// -////////////////////////////////////////////////////////////////////////////// - -// {5007FBA8-D313-439f-BEA2-A50201D3E9A8} -DEFINE_GUID(SIDESHOW_CONTENT_MISSING_EVENT, 0x5007fba8, 0xd313, 0x439f, 0xbe, 0xa2, 0xa5, 0x02, 0x01, 0xd3, 0xe9, 0xa8); - -// {4CB572FA-1D3B-49b3-A17A-2E6BFF052854} -DEFINE_GUID(SIDESHOW_APPLICATION_EVENT, 0x4cb572fa, 0x1d3b, 0x49b3, 0xa1, 0x7a, 0x2e, 0x6b, 0xff, 0x05, 0x28, 0x54); - -// {5009673c-3f7d-4c7e-9971-eaa2e91f1575} -DEFINE_GUID(SIDESHOW_USER_CHANGE_REQUEST_EVENT, 0x5009673c, 0x3f7d, 0x4c7e, 0x99, 0x71, 0xea, 0xa2, 0xe9, 0x1f, 0x15, 0x75); - -// {57813854-2FC1-411C-A59F-F24927608804} -DEFINE_GUID(SIDESHOW_NEW_EVENT_DATA_AVAILABLE, 0x57813854, 0x2FC1, 0x411C, 0xA5, 0x9F, 0xF2, 0x49, 0x27, 0x60, 0x88, 0x04); - - -////////////////////////////////////////////////////////////////////////////// -// -// This section defines the data associated with each event. -// -////////////////////////////////////////////////////////////////////////////// - -#pragma pack(push, WindowsSideShowEvents, 1) - -////////////////////////////////////////////////////////////////////////////// -// -// This event is posted in response to Content Missing Event on the device. The -// struct contains the parameters that identify which device the event came -// from, which application/endpoint it is for, and the content id of the -// requested content. -// -//////////////////////////////////////////////////////////////////////////////// -typedef struct _CONTENT_MISSING_EVENT_DATA -{ - DWORD cbContentMissingEventData; - APPLICATION_ID ApplicationId; - ENDPOINT_ID EndpointId; - CONTENT_ID ContentId; -} CONTENT_MISSING_EVENT_DATA, *PCONTENT_MISSING_EVENT_DATA; - -////////////////////////////////////////////////////////////////////////////// -// -// This struct contains an event sent by an application on the device. -// The data is determined by the application and the event id. Since -// the data can be variable size, we store the size of the data and then -// the first byte of it. This struct should always be allocated as -// offsetof(APPLICATION_EVENT_DATA, bEventData) + , and this -// size should be set in cbApplicationEventData. The cbEventData -// member should contain just . -// -////////////////////////////////////////////////////////////////////////////// -typedef struct _APPLICATION_EVENT_DATA -{ - DWORD cbApplicationEventData; - APPLICATION_ID ApplicationId; - ENDPOINT_ID EndpointId; - DWORD dwEventId; - DWORD cbEventData; - BYTE bEventData[1]; -} APPLICATION_EVENT_DATA, *PAPPLICATION_EVENT_DATA; - - -////////////////////////////////////////////////////////////////////////////// -// -// This struct contains an event sent by the driver to the platform. Shared -// devices can use this event in their driver to signal to the platform that a -// a request for a new user to take ownership of the device has been made. The -// platform will set the current user on the device in response to the message, -// and upon success, will notify gadgets as if a device add had taken place. -// When posting this event to request that the active user of the device be -// changed, drivers should set wszUser to the SID of the user that is the new -// requested owner of the device. -// -////////////////////////////////////////////////////////////////////////////// -typedef struct _DEVICE_USER_CHANGE_EVENT_DATA -{ - DWORD cbDeviceUserChangeEventData; - WCHAR wszUser; // First character of user name (sid) string. -} DEVICE_USER_CHANGE_EVENT_DATA, *PDEVICE_USER_CHANGE_EVENT_DATA; - - -////////////////////////////////////////////////////////////////////////////// -// -// This struct contains an event sent by the driver to the platform. It tells the -// API that the device has new event data available to be retrieved -// It does not describe the type of events, nor the quantity of events available -// -////////////////////////////////////////////////////////////////////////////// -typedef struct _NEW_EVENT_DATA_AVAILABLE -{ - DWORD cbNewEventDataAvailable; // Size of this structure - DWORD dwVersion; // Always set to VERSION_1_WINDOWS_7 in Windows 7 -} NEW_EVENT_DATA_AVAILABLE, *PNEW_EVENT_DATA_AVAILABLE; - - -////////////////////////////////////////////////////////////////////////////// -// -// This is the header for all event data sent from a driver to the client API -// via Authorized Eventing -// This will usually be followed by another struct that is specific to the guidEventType. -// For Application Event GUID, the subsequent struct will be of type APPLICATION_EVENT_DATA -// For Content Missing GUID, the subsequent struct will be of type CONTENT_MISSING_EVENT_DATA -// Immediately following this struct is a buffer of cbEventDataSid bytes (can -// be 0). This buffer contains a SID (used for All User devices). -// -////////////////////////////////////////////////////////////////////////////// -typedef struct _EVENT_DATA_HEADER -{ - DWORD cbEventDataHeader; // Size of this structure - GUID guidEventType; // The GUID of the event type. This could be {"Application Event", "Content Missing", "Device Added", "Device Removed"} - DWORD dwVersion; // Always set to VERSION_1_WINDOWS_7 in Windows 7 - DWORD cbEventDataSid; -} EVENT_DATA_HEADER, *PEVENT_DATA_HEADER; - - -#pragma pack(pop, WindowsSideShowEvents) - -#endif // (_WIN32_WINNT >= 0x0600) - diff --git a/qt-correction-tool/pub/ddk/winusb.h b/qt-correction-tool/pub/ddk/winusb.h deleted file mode 100644 index c2ae859..0000000 --- a/qt-correction-tool/pub/ddk/winusb.h +++ /dev/null @@ -1,253 +0,0 @@ -/*++ - -Copyright (c) 2002 Microsoft Corporation - -Module Name: - - wusb.h - -Abstract: - - Public interface to winusb.dll - -Environment: - - Kernel Mode Only - -Notes: - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - - Copyright (c) 2001 Microsoft Corporation. All Rights Reserved. - - -Revision History: - - 11/19/2002 : created - -Authors: - ---*/ - -#ifndef __WUSB_H__ -#define __WUSB_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#if(NTDDI_VERSION >= NTDDI_WINXP) - -#include - - -typedef PVOID WINUSB_INTERFACE_HANDLE, *PWINUSB_INTERFACE_HANDLE; - - -#pragma pack(1) - -typedef struct _WINUSB_SETUP_PACKET { - UCHAR RequestType; - UCHAR Request; - USHORT Value; - USHORT Index; - USHORT Length; -} WINUSB_SETUP_PACKET, *PWINUSB_SETUP_PACKET; - -#pragma pack() - - - -BOOL __stdcall -WinUsb_Initialize( - __in HANDLE DeviceHandle, - __out PWINUSB_INTERFACE_HANDLE InterfaceHandle - ); - - -BOOL __stdcall -WinUsb_Free( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle - ); - - -BOOL __stdcall -WinUsb_GetAssociatedInterface( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR AssociatedInterfaceIndex, - __out PWINUSB_INTERFACE_HANDLE AssociatedInterfaceHandle - ); - - - -BOOL __stdcall -WinUsb_GetDescriptor( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR DescriptorType, - __in UCHAR Index, - __in USHORT LanguageID, - __out_bcount_part_opt(BufferLength, *LengthTransferred) PUCHAR Buffer, - __in ULONG BufferLength, - __out PULONG LengthTransferred - ); - -BOOL __stdcall -WinUsb_QueryInterfaceSettings( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR AlternateInterfaceNumber, - __out PUSB_INTERFACE_DESCRIPTOR UsbAltInterfaceDescriptor - ); - -BOOL __stdcall -WinUsb_QueryDeviceInformation( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in ULONG InformationType, - __inout PULONG BufferLength, - __out_bcount(*BufferLength) PVOID Buffer - ); - -BOOL __stdcall -WinUsb_SetCurrentAlternateSetting( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR SettingNumber - ); - -BOOL __stdcall -WinUsb_GetCurrentAlternateSetting( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __out PUCHAR SettingNumber - ); - - -BOOL __stdcall -WinUsb_QueryPipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR AlternateInterfaceNumber, - __in UCHAR PipeIndex, - __out PWINUSB_PIPE_INFORMATION PipeInformation - ); - - -BOOL __stdcall -WinUsb_SetPipePolicy( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID, - __in ULONG PolicyType, - __in ULONG ValueLength, - __in_bcount(ValueLength) PVOID Value - ); - -BOOL __stdcall -WinUsb_GetPipePolicy( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID, - __in ULONG PolicyType, - __inout PULONG ValueLength, - __out_bcount(*ValueLength) PVOID Value - ); - -BOOL __stdcall -WinUsb_ReadPipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID, - __out_bcount_part_opt(BufferLength,*LengthTransferred) PUCHAR Buffer, - __in ULONG BufferLength, - __out_opt PULONG LengthTransferred, - __in_opt LPOVERLAPPED Overlapped - ); - -BOOL __stdcall -WinUsb_WritePipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID, - __in_bcount(BufferLength) PUCHAR Buffer, - __in ULONG BufferLength, - __out_opt PULONG LengthTransferred, - __in_opt LPOVERLAPPED Overlapped - ); - -BOOL __stdcall -WinUsb_ControlTransfer( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in WINUSB_SETUP_PACKET SetupPacket, - __out_bcount_part_opt(BufferLength, *LengthTransferred) PUCHAR Buffer, - __in ULONG BufferLength, - __out_opt PULONG LengthTransferred, - __in_opt LPOVERLAPPED Overlapped - ); - -BOOL __stdcall -WinUsb_ResetPipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID - ); - -BOOL __stdcall -WinUsb_AbortPipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID - ); - -BOOL __stdcall -WinUsb_FlushPipe( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in UCHAR PipeID - ); - -BOOL __stdcall -WinUsb_SetPowerPolicy( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in ULONG PolicyType, - __in ULONG ValueLength, - __in_bcount(ValueLength) PVOID Value - ); - -BOOL __stdcall -WinUsb_GetPowerPolicy( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in ULONG PolicyType, - __inout PULONG ValueLength, - __out_bcount(*ValueLength) PVOID Value - ); - -BOOL __stdcall -WinUsb_GetOverlappedResult( - __in WINUSB_INTERFACE_HANDLE InterfaceHandle, - __in LPOVERLAPPED lpOverlapped, - __out LPDWORD lpNumberOfBytesTransferred, - __in BOOL bWait - ); - - -PUSB_INTERFACE_DESCRIPTOR __stdcall -WinUsb_ParseConfigurationDescriptor( - __in PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor, - __in PVOID StartPosition, - __in LONG InterfaceNumber, - __in LONG AlternateSetting, - __in LONG InterfaceClass, - __in LONG InterfaceSubClass, - __in LONG InterfaceProtocol - ); - -PUSB_COMMON_DESCRIPTOR __stdcall -WinUsb_ParseDescriptors( - __in_bcount(TotalLength) PVOID DescriptorBuffer, - __in ULONG TotalLength, - __in PVOID StartPosition, - __in LONG DescriptorType - ); - - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -#ifdef __cplusplus -} -#endif - - -#endif //__WUSB_H__ - diff --git a/qt-correction-tool/pub/ddk/winusbio.h b/qt-correction-tool/pub/ddk/winusbio.h deleted file mode 100644 index 7fe771f..0000000 --- a/qt-correction-tool/pub/ddk/winusbio.h +++ /dev/null @@ -1,85 +0,0 @@ -/*************************************************************************** - -Copyright (c) 2002 Microsoft Corporation - -Module Name: - - wusbio.h - -Abstract: - - Public header for WINUSB - -Environment: - - User and Kernel Mode - -Notes: - - THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY - KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR - PURPOSE. - - Copyright (c) 2001 Microsoft Corporation. All Rights Reserved. - - -Revision History: - - 11/12/2002 : created - - -****************************************************************************/ - -#ifndef __WUSBIO_H__ -#define __WUSBIO_H__ - -#if(NTDDI_VERSION >= NTDDI_WINXP) - -#include - -// Pipe policy types -#define SHORT_PACKET_TERMINATE 0x01 -#define AUTO_CLEAR_STALL 0x02 -#define PIPE_TRANSFER_TIMEOUT 0x03 -#define IGNORE_SHORT_PACKETS 0x04 -#define ALLOW_PARTIAL_READS 0x05 -#define AUTO_FLUSH 0x06 -#define RAW_IO 0x07 -#define MAXIMUM_TRANSFER_SIZE 0x08 -#define RESET_PIPE_ON_RESUME 0x09 - -// Power policy types -// -// Add 0x80 for Power policy types in order to prevent overlap with -// Pipe policy types to prevent "accidentally" setting the wrong value for the -// wrong type. -// -#define AUTO_SUSPEND 0x81 -#define SUSPEND_DELAY 0x83 - -// Device Information types -#define DEVICE_SPEED 0x01 - -// Device Speeds -#define LowSpeed 0x01 -#define FullSpeed 0x02 -#define HighSpeed 0x03 - -// {DA812BFF-12C3-46a2-8E2B-DBD3B7834C43} -#include -DEFINE_GUID(WinUSB_TestGuid, 0xda812bff, 0x12c3, 0x46a2, 0x8e, 0x2b, 0xdb, 0xd3, 0xb7, 0x83, 0x4c, 0x43); - - -typedef struct _WINUSB_PIPE_INFORMATION { - USBD_PIPE_TYPE PipeType; - UCHAR PipeId; - USHORT MaximumPacketSize; - UCHAR Interval; -} WINUSB_PIPE_INFORMATION, *PWINUSB_PIPE_INFORMATION; - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) - -#endif // __WUSBIO_H__ - - diff --git a/qt-correction-tool/pub/ddk/wmicore.mof b/qt-correction-tool/pub/ddk/wmicore.mof deleted file mode 100644 index 0437a9b..0000000 --- a/qt-correction-tool/pub/ddk/wmicore.mof +++ /dev/null @@ -1,18173 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wmicore.mof - -Abstract: - - This file defines all of the MOF classes "built in" to WMI. Typically - this will be for all data providers that are shipped by MS. The list - includes: - - WMI specific internal classes - Power Management - Processor Power Management - NDIS - SMBIOS Data - Keyboard - Mouse - Disk - IDE - Serial - Temperature via ACPI - Monitor - -Revision History: - ---*/ - -#pragma namespace("\\\\.\\root\\wmi") -#pragma classflags("forceupdate") -#pragma autorecover - -// -// Wmi internal classes - - -class WMIEvent : __ExtrinsicEvent -{ -}; - - - -[abstract] -class MS_WmiInternal -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This class supplies the binary mof information") : amended, - guid("{05901221-D566-11d1-B2F0-00A0C9062910}") -] -class MSWmi_MofData : MS_WmiInternal -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read - ] uint32 Unused1; - - [WmiDataId(2), - read - ] uint32 Unused2; - - - - [WmiDataId(3), - read - ] uint32 Size; - - [WmiDataId(4), - read - ] uint32 Unused4; - - - [WmiDataId(5), - WmiSizeIs("Size"), - read - ] uint8 BinaryMofData[]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This class supplies additional information about a data provider. Querying this class with an instance name returned from another class query will return additional information about the instance") : amended, - guid("{C7BF35D0-AADB-11d1-BF4A-00A0C9062910}") -] -class MSWmi_ProviderInfo : MS_WmiInternal -{ - [key, read] - string InstanceName; - [read] boolean Active; - - // CM_DRP_FRIENDLY_NAME - [WmiDataId(1), - read, - DisplayName("Friendly Name") : amended - ] string FriendlyName; - - // CM_DRP_DEVICEDESC - [WmiDataId(2), - read, - DisplayName("Description") : amended - ] string Description; - - // CM_DRP_LOCATION_INFORMATION - [WmiDataId(3), - read, - DisplayName("Location") : amended - ] string Location; - - // CM_DRP_MFG - [WmiDataId(4), - read, - DisplayName("Manufacturer") : amended - ] string Manufacturer; - - // CM_DRP_SERVICE - [WmiDataId(5), - read, - DisplayName("Service") : amended - ] string Service; - - // CONSIDER: adding device capabilities -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This class supplies the PnPDeviceId for a specific device") : amended, - guid("{C7BF35D2-AADB-11d1-BF4A-00A0C9062910}"), - GuidName1("DATA_PROVIDER_PNPID_GUID") - ] -class MSWmi_PnPDeviceId : MS_WmiInternal -{ -// -// Note to driver developers: -// -// Support for this guid is required if properties in the wmi namespace -// are to be mapped into another namespace via the view provider. -// -// This guid is automatically supported by WMI if the following conditions -// are met: -// -// 1. The device registers with PDO instance names for all guids -// (ie, WMIREG_FLAG_PDO_INSTANCE_NAMES) -// -// If the driver cannot follow the rules above and WMI cannot support -// the guid automatically, then the driver can support it in its own -// driver code. - - - [key, read] - string InstanceName; - [read] boolean Active; - - // Pnp device id - [WmiDataId(1), - Description("PnP Device Id for the device. This property is useful for mapping from the wmi namespace to the cimv2 namespace classes using the view provider") : amended, - read, - DisplayName("PnP Device Id") : amended - ] string PnPDeviceId; -}; - - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This class supplies the Instance names associated with a PnP Device Instance Id") : amended, - guid("{C7BF35D3-AADB-11d1-BF4A-00A0C9062910}"), - GuidName1("DATA_PROVIDER_PNPID_INSTANCE_NAMES_GUID") - ] -class MSWmi_PnPInstanceNames : MS_WmiInternal -{ -// -// Note to driver developers: -// -// Support for this guid is required if properties in the wmi namespace -// are to be mapped into another namespace via the view provider. -// -// This guid is automatically supported by WMI if the following conditions -// are met: -// -// 1. The device registers with PDO instance names for all guids -// (ie, WMIREG_FLAG_PDO_INSTANCE_NAMES) -// -// If the driver cannot follow the rules above and WMI cannot support -// the guid automatically, then the driver can support it in its own -// driver code. - - - [key, read] - string InstanceName; - [read] boolean Active; - - // Pnp device id - [WmiDataId(1), - Description("Count of instance names associated with this PnPId") : amended, - read, - DisplayName("Count") : amended - ] uint32 Count; - - // Instance names - [WmiDataId(2), - WmiSizeIs("Count"), - Description("Wmi Instance Names for the device. This property is useful for mapping from the wmi namespace to the cimv2 namespace classes using the view provider") : amended, - read, - DisplayName("Instance Name List") : amended - ] string InstanceNameList[]; -}; - -[WMI, - guid("{F8C60AED-EF8D-4f95-9EA8-F04318A00F30}") -] -class MSWmi_Guid -{ - [WmiDataId(1)] - uint8 Guid[16]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - guid("{B48D49A1-E777-11d0-A50C-00A0C9062910}"), - description("This event reports whenever a guid is registered or unregistered") : amended -] -class MSWmi_GuidRegistrationInfo : WMIEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - Description("Type of operation") : amended, - Values{"Registration Add", "Registration Remove", "Registration Update"} : amended, - ValueMap{"1", "2", "4"} - ] - uint32 Operation; - - [WmiDataId(2), - Description("Count of guids being registered, unregistered, or updated") : amended - ] - uint32 GuidCount; - - [WmiDataId(3), - WmiSizeIs("GuidCount"), - Description("List of guids") : amended - ] - MSWmi_Guid GuidList[]; -}; - - -// -// ACPI info classes -// -[Dynamic, Provider("WMIProv"), - WMI, - Description("ACPI Table data") : amended, - guid("{5DAF38AE-F6F8-4d90-8199-EBDE6800EC3B}") -] -class MSAcpiInfo -{ - [key, read] - string InstanceName; - [read] boolean Active; - - - [WmiDataId(1), - Description("Boot Architecture") : amended, - Values{"LEGACY_DEVICES", "I8042" } : amended, - ValueMap{"1", "2"} - ] - uint32 BootArchitecture; - - [WmiDataId(2), - Description("Systems Preferred Power Profile") : amended - ] - uint32 PreferredProfile; - - [WmiDataId(3), - BitValues{"this one bit flag indicates whether or not the WBINVD instruction works properly,if this bit is not set we can not use S2, S3 states, or C3 on MP machines", - "this flag indicates if wbinvd works EXCEPT that it does not invalidate the cache", - "this flag indicates that the C1 state is supported on all processors.", - "this one bit flag indicates whether support for the C2 state is restricted to uniprocessor machines", - "this bit indicates whether the PWR button is treated as a fix feature (0) or a generic feature (1)", - "SLEEP_BUTTON_GENERIC", - "this bit indicates whether the RTC wakeup status is reported in fix register space (0) or not (1)", - "RTC_WAKE_FROM_S4", - "This bit indicates whether the machine implements a 24 or 32 bit timer.", - "This bit indicates whether the machine supports docking", - "This bit indicates whether the machine supports reset", - "This bit indicates whether the machine case can be opened", - "This bit indicates whether the machine has no video" - } : amended, - BitMap{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}, - Description("Capabilities") : amended - ] - uint32 Capabilities; -}; - -// -// WHEA Management Interface Classes -// - -[abstract] -class WHEA -{ -}; - -[WMI, - Dynamic, - Provider("WMIProv"), - Locale("MS\\0x409"), - Description("WHEA Error Injection Interface") : amended, - guid("{e808ff73-2093-472a-a5cc-df24f031b035}") -] -class WHEAErrorInjectionMethods : WHEA -{ - [key, read] - string InstanceName; - - [read] boolean Active; - - [WmiMethodId(1), - Implemented, - DisplayName("Get Error Injection Capabilities") : amended, - HeaderName("GET_INJECTION_CAPABILITIES"), - Description("Returns information describing the platform's hardware error injection capabilities") : amended - ] - void GetErrorInjectionCapabilitiesRtn( - [out] uint32 Status, - [out] uint32 Capabilities - ); - - [WmiMethodId(2), - Implemented, - DisplayName("Inject Hardware Error") : amended, - HeaderName("INJECT_HARDWARE_ERROR"), - Description("Injects hardware Error") : amended - ] - void InjectErrorRtn( - [in] uint32 ErrorType, - [in] uint64 Parameter1, - [in] uint64 Parameter2, - [in] uint64 Parameter3, - [in] uint64 Parameter4, - [out] uint32 Status - ); -}; - -[WMI, - Dynamic, - Provider("WMIProv"), - Locale("MS\\0x409"), - Description("WHEA Error Source Interface") : amended, - guid("{91c3c007-185d-4d78-a751-bfcb31c2c64d}")] -class WHEAErrorSourceMethods : WHEA -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiMethodId(1), - Implemented, - DisplayName("Get Error Sources") : amended, - HeaderName("GET_ALL_ERROR_SOURCES"), - Description("Returns an array of all hardware error sources") : amended - ] - void GetAllErrorSourcesRtn( - [out] uint32 Status, - [out] uint32 Count, - [out] uint32 Length, - [out, WmiSizeIs("Length")] uint8 ErrorSourceArray[] - ); - - [WmiMethodId(2), - Implemented, - DisplayName("Get Error Source Information") : amended, - HeaderName("GET_ERROR_SOURCE_INFO"), - Description("Returns information describing the specified hardware error source") : amended - ] - void GetErrorSourceInfoRtn( - [out] uint32 Status, - [in] uint32 ErrorSourceId, - [out] uint32 Length, - [out, WmiSizeIs("Length")] uint8 ErrorSourceInfo[] - ); - - [WmiMethodId(3), - Implemented, - DisplayName("Set Error Source Info") : amended, - HeaderName("SET_ERROR_SOURCE_INFO"), - Description("Updates the specified error source using the supplied information") : amended - ] - void SetErrorSourceInfoRtn( - [out] uint32 Status, - [in] uint32 Length, - [in, WmiSizeIs("Length")] uint8 ErrorSourceInfo[] - ); - - [WmiMethodId(4), - Implemented, - DisplayName("Enable Error Source") : amended, - HeaderName("ENABLE_ERROR_SOURCE"), - Description("Enables the specified error source") : amended - ] - void EnableErrorSourceRtn( - [out] uint32 Status, - [in] uint32 ErrorSourceId - ); - - [WmiMethodId(5), - Implemented, - DisplayName("Disable Error Source") : amended, - HeaderName("DISABLE_ERROR_SOURCE"), - Description("Disables the specified error source") : amended - ] - void DisableErrorSourceRtn( - [out] uint32 Status, - [in] uint32 ErrorSourceId - ); -}; - -// -// SMBIOS data classes -// -[abstract] -class MS_SmBios -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Raw SMBIOS Tables") : amended, - guid("{8F680850-A584-11d1-BF38-00A0C9062910}") -] -class MSSmBios_RawSMBiosTables : MS_SmBios -{ - [key, read] - string InstanceName; - - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Used 20 Calling Method") : amended - ] boolean Used20CallingMethod; - - [WmiDataId(2), - read, - DisplayName("Smbios Major Version") : amended - ] uint8 SmbiosMajorVersion; - - [WmiDataId(3), - read, - DisplayName("Smbios Minor Version") : amended - ] uint8 SmbiosMinorVersion; - - [WmiDataId(4), - read, - DisplayName("Dmi Revision") : amended - ] uint8 DmiRevision; - - - [WmiDataId(5), - read, - DisplayName("Size") : amended - ] uint32 Size; - - [WmiDataId(6), - WmiSizeIs("Size"), - read, - DisplayName("SMBios Data") : amended - ] uint8 SMBiosData[]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Raw SMBIOS Eventlog") : amended, - guid("{8F680851-A584-11d1-BF38-00A0C9062910}") -] -class MSSmBios_SMBiosEventlog : MS_SmBios -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read - ] uint16 LogTypeDescLength; - - [WmiDataId(2), - read - ] boolean LogHeaderDescExists; - - [WmiDataId(3), - read - ] uint8 Reserved; - - [WmiDataId(4), - read - ] uint16 LogAreaLength; - - [WmiDataId(5), - read - ] uint16 LogHeaderStart; - - [WmiDataId(6), - read - ] uint16 LogDataStart; - - [WmiDataId(7), - read - ] uint8 AccessMethod; - - - [WmiDataId(8), - read - ] uint8 LogStatus; - - - [WmiDataId(9), - read - ] uint32 LogChangeToken; - - [WmiDataId(10), - read - ] uint32 AccessMethodAddress; - - // - // LogHeaderFormat, NumberLogTypeDesc, LengthEachLogTypeDesc and - // ListLogTypeDesc are only valid if LogHeaderDescExists is TRUE. - // This means that SMBIOS is revision 2.1 - // - [WmiDataId(11), - read - ] uint8 LogHeaderFormat; - - [WmiDataId(12), - read - ] uint8 NumberLogTypeDesc; - - [WmiDataId(13), - read - ] uint8 LengthEachLogTypeDesc; - - [WmiDataId(14), - WmiSizeIs("LogTypeDescLength"), - read - ] uint8 ListLogTypeDesc[]; - - [WmiDataId(15), - WmiSizeIs("LogAreaLength"), - read - ] uint8 LogArea[]; - -}; - -[WMI, - guid("{8F680852-A584-11d1-BF38-00A0C9062910}"), - Description("SYSID UUID") : amended, - HeaderName("SYSID_UUID") -] -class MSSmBios_SysidUUID : MS_SmBios -{ - [WmiDataId(1)] - uint8 Uuid[16]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("List of UUID SYSIDS") : amended, - guid("{8F680853-A584-11d1-BF38-00A0C9062910}"), - GuidName1("SYSID_UUID_DATA_GUID") -] -class MSSmBios_SysidUUIDList : MS_SmBios -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read - ] uint32 Count; - - [WmiDataId(2), - WmiSizeIs("Count"), - read - ] MSSmBios_SysidUUID List; - -}; - -[WMI, - guid("{8F680854-A584-11d1-BF38-00A0C9062910}"), - Description("SYSID 1394") : amended, - HeaderName("SYSID_1394") -] -class MSSmBios_Sysid1394 : MS_SmBios -{ - [WmiDataId(1) - ] - uint8 x1394[8]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("List of 1394 SYSIDS") : amended, - guid("{8F680855-A584-11d1-BF38-00A0C9062910}"), - GuidName1("SYSID_1394_DATA_GUID") -] -class MSSmBios_Sysid1394List : MS_SmBios -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read - ] uint32 Count; - - [WmiDataId(2), - WmiSizeIs("Count"), - read - ] MSSmBios_Sysid1394 List; - -}; - -[abstract] -class MSMCAInfo -{ -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{39C14290-F036-4999-B8A1-B6F871FB329E}"), - Description("CMC handling switched from interrupt driver to polling") : amended -] -class MSMCAEvent_SwitchToCMCPolling : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{D5C870CE-4ED0-4fdc-BB54-8B452C18797E}"), - Description("CPE handling switched from interrupt driver to polling") : amended -] -class MSMCAEvent_SwitchToCPEPolling : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; -}; - - -// -// Define the qualifiers used for the Type property of the MSMCAEvent classes -// The value of the property corresponds to the eventlog type as specified -// in iologmsg.h -// -#define EVENTLOG_MESSAGE_QUALIFIERS \ - Values{ \ - "MCA_WARNING_CACHE", \ - "MCA_ERROR_CACHE", \ - "MCA_WARNING_TLB", \ - "MCA_ERROR_TLB", \ - "MCA_WARNING_CPU_BUS", \ - "MCA_ERROR_CPU_BUS", \ - "MCA_WARNING_REGISTER_FILE", \ - "MCA_ERROR_REGISTER_FILE", \ - "MCA_WARNING_MAS", \ - "MCA_ERROR_MAS", \ - "MCA_WARNING_MEM_UNKNOWN", \ - "MCA_ERROR_MEM_UNKNOWN", \ - "MCA_WARNING_MEM_1_2", \ - "MCA_ERROR_MEM_1_2", \ - "MCA_WARNING_MEM_1_2_5", \ - "MCA_ERROR_MEM_1_2_5", \ - "MCA_WARNING_MEM_1_2_5_4", \ - "MCA_ERROR_MEM_1_2_5_4", \ - "MCA_WARNING_SYSTEM_EVENT", \ - "MCA_ERROR_SYSTEM_EVENT", \ - "MCA_WARNING_PCI_BUS_PARITY", \ - "MCA_ERROR_PCI_BUS_PARITY", \ - "MCA_WARNING_PCI_BUS_PARITY_NO_INFO", \ - "MCA_ERROR_PCI_BUS_PARITY_NO_INFO", \ - "MCA_WARNING_PCI_BUS_SERR", \ - "MCA_ERROR_PCI_BUS_SERR", \ - "MCA_WARNING_PCI_BUS_SERR_NO_INFO", \ - "MCA_ERROR_PCI_BUS_SERR_NO_INFO", \ - "MCA_WARNING_PCI_BUS_MASTER_ABORT", \ - "MCA_ERROR_PCI_BUS_MASTER_ABORT", \ - "MCA_WARNING_PCI_BUS_MASTER_ABORT_NO_INFO", \ - "MCA_ERROR_PCI_BUS_MASTER_ABORT_NO_INFO", \ - "MCA_WARNING_PCI_BUS_TIMEOUT", \ - "MCA_ERROR_PCI_BUS_TIMEOUT", \ - "MCA_WARNING_PCI_BUS_TIMEOUT_NO_INFO", \ - "MCA_ERROR_PCI_BUS_TIMEOUT_NO_INFO", \ - "MCA_WARNING_PCI_BUS_UNKNOWN", \ - "MCA_ERROR_PCI_BUS_UNKNOWN", \ - "MCA_WARNING_PCI_DEVICE", \ - "MCA_ERROR_PCI_DEVICE", \ - "MCA_WARNING_SMBIOS", \ - "MCA_ERROR_SMBIOS", \ - "MCA_WARNING_PLATFORM_SPECIFIC", \ - "MCA_ERROR_PLATFORM_SPECIFIC", \ - "MCA_WARNING_UNKNOWN", \ - "MCA_ERROR_UNKNOWN", \ - "MCA_WARNING_UNKNOWN_NO_CPU", \ - "MCA_ERROR_UNKNOWN_NO_CPU", \ - "MCA_WARNING_CMC_THRESHOLD_EXCEEDED", \ - "MCA_WARNING_CPE_THRESHOLD_EXCEEDED", \ - "MCA_WARNING_CPU_THERMAL_THROTTLED", \ - "MCA_INFO_CPU_THERMAL_THROTTLING_REMOVED", \ - "MCA_WARNING_CPU", \ - "MCA_ERROR_CPU", \ - "MCA_MEMORYHIERARCHY_ERROR", \ - "MCA_TLB_ERROR", \ - "MCA_BUS_ERROR", \ - "MCA_BUS_TIMEOUT_ERROR", \ - "MCA_INTERNALTIMER_ERROR", \ - "MCA_MICROCODE_ROM_PARITY_ERROR", \ - "MCA_EXTERNAL_ERROR", \ - "MCA_FRC_ERROR" \ - }, \ - ValueMap{ \ - "0x8005003C", \ - "0xC005003D", \ - "0x8005003E", \ - "0xC005003F", \ - "0x80050040", \ - "0xC0050041", \ - "0x80050042", \ - "0xC0050043", \ - "0x80050044", \ - "0xC0050045", \ - "0x80050046", \ - "0xC0050047", \ - "0x80050048", \ - "0xC0050049", \ - "0x8005004A", \ - "0xC005004B", \ - "0x8005004C", \ - "0xC005004D", \ - "0x8005004E", \ - "0xC005004F", \ - "0x80050050", \ - "0xC0050051", \ - "0x80050052", \ - "0xC0050053", \ - "0x80050054", \ - "0xC0050055", \ - "0x80050056", \ - "0xC0050057", \ - "0x80050058", \ - "0xC0050059", \ - "0x8005005A", \ - "0xC005005B", \ - "0x8005005C", \ - "0xC005005D", \ - "0x8005005E", \ - "0xC005005F", \ - "0x80050060", \ - "0xC0050061", \ - "0x80050062", \ - "0xC0050063", \ - "0x80050064", \ - "0xC0050065", \ - "0x80050066", \ - "0xC0050067", \ - "0x80050068", \ - "0xC0050069", \ - "0x8005006A", \ - "0xC005006B", \ - "0x8005006D", \ - "0x8005006E", \ - "0x8005006F", \ - "0x40050070", \ - "0x80050071", \ - "0xC0050072", \ - "0xC0050078", \ - "0xC0050079", \ - "0xC005007A", \ - "0xC005007B", \ - "0xC005007C", \ - "0xC005007D", \ - "0xC005007E", \ - "0xC005007F" \ - }, \ - Description("Type of eventlog message") : amended - -#define ERROR_SEVERITY_QUALIFIERS \ - Values{"Recoverable", "Fatal", "Correctable"}, \ - ValueMap{ "0", "1", "2" }, \ - Description("Severity of the error record") : amended - -#define TRANSACTION_TYPES \ - ValueMap { "0", "1", "2" }, \ - Values { "Instruction Cache", "Data Cache", "Generic" }, \ - Description("MCA transaction type") : amended - -#define MEMORY_HIERARCHY_LEVELS \ - ValueMap { "0", "1", "2", "3" }, \ - Values { "Level 0", \ - "Level 1", \ - "Level 2", \ - "Generic" }, \ - Description("MCA memory hierarchy level") : amended - -#define REQUEST_TYPES \ - ValueMap { "0", "1", "2", "3", "4", "5", "6", "7", "8" }, \ - Values { "Generic Error", \ - "Generic Read", \ - "Generic Write", \ - "Data Read", \ - "Data Write", \ - "Instruction Fetch", \ - "Prefetch", \ - "Injection", \ - "Snoop" }, \ - Description("MCA request type") : amended - -#define PARTICIPATION_VALUES \ - ValueMap { "0", "1", "2", "3" }, \ - Values { "Local Processor Originated Request", \ - "Local Processor Responded To Request", \ - "Local Processor Observed Error As Third Party", \ - "Generic" }, \ - Description("MCA processor participation description") : amended - -#define MEMORY_OR_IO \ - ValueMap { "0", "1", "2", "3" }, \ - Values { "Memory Access", "Reserved", "I/O", "Other transaction" }, \ - Description("Identifies the type of access that caused the error") : amended - -// -// NOTE: For all MCA events the first data items must be identical and -// match whay is in MSMCAEvent_Header. -// - -[WMI, - guid("{6381C27F-C8FA-4da7-8953-B86833736E15}"), - description("Header for all MSMCA events") : amended -] -class MSMCAEvent_Header -{ - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{1ee17050-0039-40f7-9ead-14ad51612cb2}"), - Description("MCA Bus Error Event") : amended -] -class MSMCAEvent_BusError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - PARTICIPATION_VALUES - ] - uint32 Participation; - - [WmiDataId(8), - MEMORY_HIERARCHY_LEVELS - ] - uint32 MemoryHierarchyLevel; - - [WmiDataId(9), - REQUEST_TYPES - ] - uint32 RequestType; - - [WmiDataId(10), - MEMORY_OR_IO - ] - uint32 MemOrIo; - - [WmiDataId(11), - Description("The address at which the error occurred.") - ] - uint64 Address; - - [WmiDataId(12), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(13), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{b161eeab-ac03-4c2b-ae7a-5a3768f70e85}"), - Description("MCA TLB Error Event") : amended -] -class MSMCAEvent_TLBError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - TRASACTION_TYPES - ] - uint32 TransactionType; - - [WmiDataId(8), - MEMORY_HIERARCHY_LEVELS - ] - uint32 MemoryHierarchyLevel; - - [WmiDataId(9), - Description("The address at which the error occurred.") - ] - uint64 Address; - - [WmiDataId(10), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(11), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{cede75a0-a77f-452b-8f2f-541f926db0f9}"), - Description("MCA Memory Hierarchy Error Event") : amended -] -class MSMCAEvent_MemoryHierarchyError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - TRASACTION_TYPES - ] - uint32 TransactionType; - - [WmiDataId(8), - MEMORY_HIERARCHY_LEVELS - ] - uint32 MemoryHierarchyLevel; - - [WmiDataId(9), - REQUEST_TYPES - ] - uint32 RequestType; - - [WmiDataId(10), - Description("The address at which the error occurred.") - ] - uint64 Address; - - [WmiDataId(11), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(12), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{5CE27CDE-D179-4c68-937F-A07B8CC2EA39}"), - Description("MCA CPU Error Event") : amended -] -class MSMCAEvent_CPUError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Error type of the major error in the section") : amended, - Values {"Cache", "TLB", "Bus", "Register File", "Microarchitecture"}, - ValueMap { "0", "1", "2", "3", "4"}, - DefineValues {"MCACpuCacheError", - "MCACpuTlbError", - "MCACpuBusError", - "MCACpuRegFileError", - "MCACpuMSError" } - ] - uint32 MajorErrorType; - - // - // This is valid for cache, tlb and microarchitectural structure errors - // - [WmiDataId(8), - Description("Level of cache, TLB or microarchitectural structure where error occurred (0 indicates first level)") : amended, - WmiMissingData(-1) - ] - uint32 Level; - - // - // This is valid for cache errors - // - [WmiDataId(9), - Values{ "Unknown or internal error", - "load", - "store", - "instruction fetch or instruction prefetch", - "data prefetch (both hardware and software)", - "snoop (coherency check)", - "cast out (explicit or implicit write-back of a cache line)", - "move in (cache line fill)" - } : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7"}, - Description("Type of cache operation that caused the machine check") : amended, - WmiMissingData(-1) - ] - uint32 CacheOp; - - // - // This is valid for cache errors - // - [WmiDataId(10), - Description("Status of the cache line") : amended, - Values{"cache line is invalid", - "cache line is held shares", - "cache line is held exclusive", - "cache line is modified" - } : amended, - ValueMap{ "0", "1", "2", "3" }, - WmiMissingData(-1) - ] - uint32 CacheMesi; - - // - // This is valid for TLB errors - // - [WmiDataId(11), - Values{ "unknown", - "TLB access due to load instruction", - "TLB access due to store instruction", - "TLB access due to instruction fetch or instruction prefetch", - "TLB access due to data prefetch (both hardware and software)", - "TLB shoot down access", - "TLB probe instruction (probe, tpa)", - "move in (VHPT fill)" - } : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7"}, - Description("Type of cache operation that caused the machine check") : amended, - WmiMissingData(-1) - ] - uint32 TLBOp; - - // - // This is valid for Bus errors - // - [WmiDataId(12), - Values{ "unknown", - "partial read", - "partial write", - "full line read", - "full line write", - "implicit or explicit write-back operation", - "snoop probe", - "incoming ptc.g", - "WC transactions" - } : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7", "8"}, - Description("Type of Bus transaction that caused the machine check abort") : amended, - WmiMissingData(-1) - ] - uint32 BusType; - - // - // This is valid for Bus errors - // - [WmiDataId(13), - Description("Bus error severity. The encodings of error severity are platform specific") : amended, - WmiMissingData(-1) - ] - uint32 BusSev; - - // - // This is valid for RegFile errors - // - [WmiDataId(14), - Values{ "unknown/unclassified", - "General register (bank 1)", - "General register (bank 2)", - "Floating point register", - "Branch register", - "Predicate register", - "Application register", - "Control register", - "Region register", - "Protection key register", - "Data breakpoint register", - "Instruction breakpoint register", - "Performance monitor control register", - "Performance monitor data register" - } : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", - "10", "11", "12", "13"}, - Description("Register file identifier") : amended, - WmiMissingData(-1) - ] - uint32 RegFileId; - - // - // This is valid for RegFile errors - // - [WmiDataId(15), - Values{ "unknown", - "read", - "write" - } : amended, - ValueMap{"0", "1", "2" }, - Description("Identifies the operation that caused the machine check") : amended, - WmiMissingData(-1) - ] - uint32 RegFileOp; - - // - // This is valid for Microarchitectural structure errors - // - [WmiDataId(16), - Description("Structure identification. These bits identify the microarchitectural structure where the error occurred.") : amended, - WmiMissingData(-1) - ] - uint32 MSSid; - - [WmiDataId(17), - Values{ "unknown", - "read or load", - "write or store" - } : amended, - ValueMap{"0", "1", "2"}, - Description("Type of operation that caused the error") : amended, - WmiMissingData(-1) - ] - uint32 MSOp; - - // - // This is valid for Microarchitectural structure errors - // - [WmiDataId(18), - Values{ "unknown/unclassified" - } : amended, - ValueMap{"0"}, - Description("Identification of the array in the micro architectural structure where the error was generated") : amended, - WmiMissingData(-1) - ] - uint32 MSArrayId; - - // - // This is valid for Microarchitectural structure errors - // - [WmiDataId(19), - Description("Index ort set of the micro architectural structure where the error was located.") : amended, - WmiMissingData(-1) - ] - uint32 MSIndex; - - [WmiDataId(20), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(21), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; - -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{433EEA38-C1A7-48f1-884F-B6875F176CC7}"), - Description("MCA Memory Error Event") : amended -] -class MSMCAEvent_MemoryError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", "10", "11", "12", "13", "14", "15", "16"}, - BitValues{"MEM_ERROR_STATUS is valid", - "MEM_PHYSICAL_ADDR is valid", - "MEM_ADDR_MASK is valid", - "MEM_NODE is valid", - "MEM_CARD is valid", - "MEM_MODULE is valid", - "MEM_BANK is valid", - "MEM_DEVICE is valid", - "MEM_ROW is valid", - "MEM_COLUMN is valid", - "MEM_BIT_POSITION is valid", - "MEM_PLATFORM_REQUESTOR_ID is valid", - "MEM_PLATFORM_RESPONDER_ID is valid", - "MEM_PLATFORM_TARGET is valid", - "MEM_PLATFORM_BUS_SPECIFIC_DATA is valid", - "MEM_PLATFORM_OEM_ID is valid", - "MEM_PLATFORM_OEM_DATA_STRUCT is valid"} : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Memory Error Status") : amended - ] - uint64 MEM_ERROR_STATUS; - - [WmiDataId(9), - Description("64bit physical address of the memory error") : amended - ] - uint64 MEM_PHYSICAL_ADDR; - - [WmiDataId(10), - Description("Defines the valid address bits in the 64-Bit physical address of the memory error. The mask specifies the granularity of the physical address which is dependent on the hardware implementation factors such as interleaving.") : amended - ] - uint64 MEM_PHYSICAL_MASK; - - [WmiDataId(11), - Description("Hardware address of the responder to the transaction") : amended - ] - uint64 RESPONDER_ID; - - [WmiDataId(12), - Description("Hardware address of intended target of transaction") : amended - ] - uint64 TARGET_ID; - - [WmiDataId(13), - Description("Hardware address of the device or component initiating transaction") : amended - ] - uint64 REQUESTOR_ID; - - [WmiDataId(14), - Description("OEM specific bus dependent data") : amended - ] - uint64 BUS_SPECIFIC_DATA; - - [WmiDataId(15), - Description("In a multi-node system, this value identifies the node containing the memory in error") : amended - ] - uint16 MEM_NODE; - - [WmiDataId(16), - Description("The Card number of the memory error location") : amended - ] - uint16 MEM_CARD; - - [WmiDataId(17), - Description("The Module or RANK number of the memory error location") : amended - ] - uint16 MEM_BANK; - - [WmiDataId(18), - Description("The Device number of the memory error location") : amended - ] - uint16 xMEM_DEVICE; - - [WmiDataId(19), - Description("The module or rank number of the memory error location") : amended - ] - uint16 MEM_MODULE; - - [WmiDataId(20), - Description("The Row number of the memory error location") : amended - ] - uint16 MEM_ROW; - - [WmiDataId(21), - Description("The Column number of the memory error location") : amended - ] - uint16 MEM_COLUMN; - - [WmiDataId(22), - Description("Bit position specifies the bit within the memory word that is in error") : amended - ] - uint16 MEM_BIT_POSITION; - - [WmiDataId(23), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(24), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{A14A5594-25DE-410e-9B92-80F0801AEC07}"), - Description("MCA PCI Bus Error Event") : amended -] -class MSMCAEvent_PCIBusError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}, - BitValues{"PCI_BUS_ERROR_STATUS is valid", - "PCI_BUS_ERROR_TYPE is valid", - "PCI_BUS_ID is valid", - "PCI_BUS_ADDRESS is valid", - "PCI_BUS_DATA is valid", - "PCI_BUS_CMD is valid", - "PCI_BUS_REQUESTOR_ID is valid", - "PCI_BUS_RESPONDER_ID is valid", - "PCI_BUS_TARGET_ID is valid", - "PCI_BUS_OEM_ID is valid", - "PCI_BUS_OEM_DATA_STRUCT is valid"} : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Bus Error Type") : amended - ] - uint64 PCI_BUS_ERROR_STATUS; - - [WmiDataId(9), - Description("Memory or IO address on the PCI bus at the time of the event") : amended - ] - uint64 PCI_BUS_ADDRESS; - - [WmiDataId(10), - Description("Data on the PCI bus at the time of the event") : amended - ] - uint64 PCI_BUS_DATA; - - [WmiDataId(11), - Description("Bus command or operation at the time of the event") : amended - ] - uint64 PCI_BUS_CMD; - - [WmiDataId(12), - Description("PCI Bus Requestor ID at the time of the event") : amended - ] - uint64 PCI_BUS_REQUESTOR_ID; - - [WmiDataId(13), - Description("PCI Bus Responder ID at the time of the event") : amended - ] - uint64 PCI_BUS_RESPONDER_ID; - - [WmiDataId(14), - Description("PCI Bus Intended Target ID at the time of the event") : amended - ] - uint64 PCI_BUS_TARGET_ID; - - [WmiDataId(15), - Description("PCI Bus Error Types") : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7"}, - Values{"Unknown or OEM System Specific Error", - "Data Parity Error", - "System Error", - "Master Abort", - "Bus Time Out or No Device Present (No DEVSEL#)", - "Master Data Parity Error", - "Address Parity Error", - "Command Parity Error" } : amended - ] - uint16 PCI_BUS_ERROR_TYPE; - - [WmiDataId(16), - Description("Designated PCI Bus Identifier encountering error") : amended - ] - uint8 PCI_BUS_ID_BusNumber; - - [WmiDataId(17), - Description("Designated PCI Bus Identifier encountering error") : amended - ] - uint8 PCI_BUS_ID_SegmentNumber; - - [WmiDataId(18), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(19), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{805CAF4E-336C-4eb2-8C0C-02F351CBF13C}"), - Description("MCA PCI Platform Component Error Event") : amended -] -class MSMCAEvent_PCIComponentError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0", "1", "2", "3", "4"}, - BitValues{"PCI_COMP_ERROR_STATUS is valid", - "PCI_COMP_INFO is valid", - "PCI_COMP_MEM_NUM is valid", - "PCI_COMP_IO_NUM is valid", - "PCI_COMP_REGS_DATA_PAIR is valid"} : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Internal Error Code") : amended - ] - uint64 PCI_COMP_ERROR_STATUS; - - [WmiDataId(9), - Description("PCI Component Information - VendorId") : amended - ] - uint16 PCI_COMP_INFO_VendorId; - - [WmiDataId(10), - Description("PCI Component Information - DeviceId") : amended - ] - uint16 PCI_COMP_INFO_DeviceId; - - [WmiDataId(11), - Description("PCI Component Information - Class Code Interface") : amended - ] - uint8 PCI_COMP_INFO_ClassCodeInterface; - - [WmiDataId(12), - Description("PCI Component Information - Class Code SubClass") : amended - ] - uint8 PCI_COMP_INFO_ClassCodeSubClass; - - [WmiDataId(13), - Description("PCI Component Information - Class Code Base Class") : amended - ] - uint8 PCI_COMP_INFO_ClassCodeBaseClass; - - [WmiDataId(14), - Description("PCI Component Information - Function Number") : amended - ] - uint8 PCI_COMP_INFO_FunctionNumber; - - [WmiDataId(15), - Description("PCI Component Information - Device Number") : amended - ] - uint8 PCI_COMP_INFO_DeviceNumber; - - [WmiDataId(16), - Description("PCI Component Information - Bus Number") : amended - ] - uint8 PCI_COMP_INFO_BusNumber; - - [WmiDataId(17), - Description("PCI Component Information - Segment Number") : amended - ] - uint8 PCI_COMP_INFO_SegmentNumber; - - [WmiDataId(18), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(19), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{BDBA4B12-8D00-4570-B9B2-3FDECF1D5661}"), - Description("MCA Platform IPMI System Eventlog Error Event") : amended -] -class MSMCAEvent_SystemEventError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}, - BitValues{"SEL_RECORD_ID is valid", - "SEL_RECORD_TYPE is valid", - "SEL_GENERATOR_ID is valid", - "SEL_EVM_REV is valid", - "SEL_SENSOR_TYPE is valid", - "SEL_SENSOR_NUM is valid", - "SEL_EVENT_DIR is valid", - "SEL_EVENT_DATA1 is valid", - "SEL_EVENT_DATA2 is valid", - "SEL_EVENT_DATA3 is valid"} : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Timestamp of the event log") : amended - ] - uint64 SEL_TIME_STAMP; - - [WmiDataId(9), - Description("Record ID used for System Event Log access") : amended - ] - uint16 SEL_RECORD_ID; - - [WmiDataId(10), - Description("Software ID if event was generated by software") : amended - ] - uint16 SEL_GENERATOR_ID; - - [WmiDataId(11), - Description("Indicates the record type") : amended - ] - uint8 SEL_RECORD_TYPE; - - [WmiDataId(12), - Description("The error message format version") : amended - ] - uint8 SEL_EVM_REV; - - [WmiDataId(13), - Description("Sensor type code of the sensor that generated the event") : amended - ] - uint8 SEL_SENSOR_TYPE; - - [WmiDataId(14), - Description("Number of the sensor that generated the event") : amended - ] - uint8 SEL_SENSOR_NUM; - - [WmiDataId(15), - Description("Event Dir") : amended - ] - uint8 SEL_EVENT_DIR_TYPE; - - [WmiDataId(16), - Description("Event Data Field 1") : amended - ] - uint8 SEL_DATA1; - - [WmiDataId(17), - Description("Event Data Field 2") : amended - ] - uint8 SEL_DATA2; - - [WmiDataId(18), - Description("Event Data Field 3") : amended - ] - uint8 SEL_DATA3; - - [WmiDataId(19), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(20), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{4184DF1B-EDFE-406b-B172-54C91FBD9BAF}"), - Description("MCA SMBIOS Error Event") : amended -] -class MSMCAEvent_SMBIOSError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0"}, - BitValues{"SMBIOS_EVENT_TYPE is valid"} : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Event Type") : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6", "7", - "8", "9", "10", "11", "12", "13", "14", "15", - "16", "17", "18", "19", "20", "21", "22", "23"}, - Values{"Reserved", - "Single bit ECC memory error", - "Multiple bit ECC memory error", - "Parity Memory error", - "Bus time-out", - "I/O Channel Check", - "Software NMI", - "POST Memory Resize", - "POST Error", - "PCI Parity Error", - "PCI System Error", - "CPU Failure", - "EISA FailSafe Timer timeout", - "Correctable memory log disabled", - "Logging disabled for a specific event type. Too many errors of the same type received in a short amount of time", - "Reserved", - "System limit exceeded (e.g. voltage or temperature threshold exceeded", - "Asynchronous hardware timer expired and issued a system reset", - "System configuration information", - "Hard disk information", - "System reconfigured", - "Uncorrectable CPU-complex error", - "Log Area Reset/Cleared", - "System boot. If implemented this log entry is guaranteed to be the first one written on any system boot" - } : amended - ] - uint8 SMBIOS_EVENT_TYPE; - - [WmiDataId(9), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(10), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{2D2434AA-EF83-4200-BA24-DE366C415F7B}"), - Description("MCA Platform Specific Error Event") : amended -] -class MSMCAEvent_PlatformSpecificError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Validation bits to indicate the validity of the subsequent fields") : amended, - BitMap{"0", "1", "2", "3", "4", "5", "6", "7"}, - BitValues{"PLATFORM_ERROR_STATUS is valid", - "PLATFORM_ERROR_REQUESTOR_ID is valid", - "PLATFORM_ERROR_RESPONDER_ID is valid", - "PLATFORM_ERROR_TARGET_ID is valid", - "PLATFORM_ERROR_SPECIFIC_DATA is valid", - "PLATFORM_ERROR_OEM_ID is valid", - "PLATFORM_ERROR_OEM_DATA_STRUCT is valid", - "PLATFORM_ERROR_OEM_DEVICE_PATH is valid" - } : amended - ] - uint64 VALIDATION_BITS; - - [WmiDataId(8), - Description("Platform generic error status") : amended - ] - uint64 PLATFORM_ERROR_STATUS; - - [WmiDataId(9), - Description("Requestor ID at time of the event") : amended - ] - uint64 PLATFORM_REQUESTOR_ID; - - [WmiDataId(10), - Description("Responder ID at time of the event") : amended - ] - uint64 PLATFORM_RESPONDER_ID; - - [WmiDataId(11), - Description("Target ID at the time of the event") : amended - ] - uint64 PLATFORM_TARGET_ID; - - [WmiDataId(12), - Description("OEM specific bus dependent data") : amended - ] - uint64 PLATFORM_BUS_SPECIFIC_DATA; - - [WmiDataId(13), - Description("A unique ID of the component reporting the error") : amended - ] - uint8 OEM_COMPONENT_ID[16]; - - [WmiDataId(14), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(15), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{477B769B-785C-48dd-A02E-57E051BE7B85}"), - Description("MCA Non Compliant Error Event") : amended -] -class MSMCAEvent_InvalidError : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - Description("Unique Id for the error record containing this error") : amended - ] - uint64 RecordId; - - [WmiDataId(2), - ERROR_SEVERITY_QUALIFIERS - ] - uint8 ErrorSeverity; - - [WmiDataId(3), - EVENTLOG_MESSAGE_QUALIFIERS - ] - uint32 Type; - - [WmiDataId(4), - Description("CPU that reported the error") : amended - ] - uint32 Cpu; - - [WmiDataId(5), - Description("Number of additional errors in the record") : amended - ] - uint32 AdditionalErrors; - - [WmiDataId(6), - Description("If zero then this event is not logged to system eventlog") : amended - ] - uint32 LogToEventlog; - - [WmiDataId(7), - Description("Size of Raw Error Record") : amended - ] - uint32 Size; - - [WmiDataId(8), - WmiSizeIs("Size"), - Description("Raw Error Record") : amended - ] - uint8 RawRecord[]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - guid("{84E9DDB6-E233-4dfc-988C-7412C8754FEC}"), - Description("Memory page has been removed") : amended -] -class MSMCAEvent_MemoryPageRemoved : WMIEvent -{ - [key, read] - string InstanceName; - boolean Active; - - [WmiDataId(1), - description("Physical Address of memory paged removed from use by OS") : amended, - read] - uint64 PhysicalAddress; -}; - -[WMI, - Description("An MCA/CMC/CPE event") : amended, - guid("{9E77A308-6B82-4fc1-AB41-0A55867C35C2}") -] -class MSMCAInfo_Entry : MSMCAInfo -{ - [WmiDataId(1), - description("Number of bytes in error record") : amended, - read] - uint32 Length; - - [WmiDataId(2), - read, - description("Error record contents") : amended, - WmiSizeIs("Length")] - uint8 Data[]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This contains the raw MCA logs") : amended, - guid("{23602A8A-DADD-462f-9AE5-30FA2C37DD5B}") - ] -class MSMCAInfo_RawMCAData : MSMCAInfo -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - description("Number of error records") : amended, - read] - uint32 Count; - - [WmiDataId(2), - read, - description("Error records") : amended, - WmiSizeIs("Count")] - MSMCAInfo_Entry Records[]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This contains a CMC event") : amended, - guid("{2F1A8A9D-7988-457f-A17A-8979E82043C5}") - ] -class MSMCAInfo_RawCMCEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - description("Number of error records") : amended, - read] - uint32 Count; - - [WmiDataId(2), - read, - description("Error records") : amended, - WmiSizeIs("Count")] - MSMCAInfo_Entry Records[]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This contains a MCA event") : amended, - guid("{2F1A8A9F-7988-457f-A17A-8979E82043C5}") - ] -class MSMCAInfo_RawMCAEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - description("Number of error records") : amended, - read] - uint32 Count; - - [WmiDataId(2), - read, - description("Error records") : amended, - WmiSizeIs("Count")] - MSMCAInfo_Entry Records[]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This contains a Corrected Platform event") : amended, - guid("{6B629D5E-E63C-48a3-9EBB-974227075265}") - ] -class MSMCAInfo_RawCorrectedPlatformEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - description("Number of error records") : amended, - read] - uint32 Count; - - [WmiDataId(2), - read, - description("Error records") : amended, - WmiSizeIs("Count")] - MSMCAInfo_Entry Records[]; -}; - -// -// Power management classes - -[abstract] -class MSPower -{ -}; -[Dynamic, Provider("WMIProv"), - WMI, - Description("The control sets whether the device should dynamically power on and off while the system is working.") : amended, - guid("827c0a6f-feb0-11d0-bd26-00aa00b7b32a") - ] -class MSPower_DeviceEnable : MSPower -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - write] boolean Enable; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("This control indicates whether the device should be configured to wake a sleeping system.") : amended, - guid("a9546a82-feb0-11d0-bd26-00aa00b7b32a") - ] -class MSPower_DeviceWakeEnable : MSPower -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - write] boolean Enable; -}; - - -// -// NDIS classes - -[abstract] -class MSNdis -{ -}; - -[WMI, - guid("{B5BD98B7-0201-11d1-A50E-00A0C9062910}")] -class MSNdis_NetworkAddress : MSNdis -{ - [read, WmiDataId(1), - DisplayName("Address") : amended - ] - uint8 Address[6]; -}; - -[WMI, - guid("{B5BD98B8-0201-11d1-A50E-00A0C9062910}")] -class MSNdis_NetworkShortAddress : MSNdis -{ - [read, WmiDataId(1) - ] - uint8 Address[2]; -}; - -[WMI, - guid("{60fc6b57-0f66-11d1-96a7-00c04fc3358c}")] -class MSNdis_NetworkLinkSpeed : MSNdis -{ - [read, WmiDataId(1)] uint32 Outbound; - [ - read, WmiDataId(2)] uint32 Inbound; -}; - -/// -/// GUIDs that do not translate to OIDs -/// -/// - -[WMI, Dynamic, Provider("WMIProv"), - guid("{981f2d7f-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Enumerate Adapter") : amended] -class MSNdis_EnumerateAdapter : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Device name.") : amended, - WmiDataId(1)] string DeviceName; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{981f2d80-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Notify Adapter Removal") : amended] -class MSNdis_NotifyAdapterRemoval : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Device name.") : amended, - WmiDataId(1)] string DeviceName; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{981f2d81-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Notify Adapter Arrival") : amended] -class MSNdis_NotifyAdapterArrival : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Device name.") : amended, - WmiDataId(1)] string DeviceName; -}; - - -[WMI, Dynamic, Provider("WMIProv"), - guid("{981f2d82-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Enumerate VC") : amended] -class MSNdis_NdisEnumerateVc : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{981f2d79-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Notify VC Removal") : amended] -class MSNdis_NotifyVcRemoval : WmiEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{182f9e0c-b1f3-11d0-8dd7-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Notify VC Arrival") : amended] -class MSNdis_NotifyVcArrival : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{1f177cd9-5955-4721-9f6a-78ebdfaef889}"), - WmiExpense(1), - Description("NDIS Notify Filter Removal") : amended] -class MSNdis_NotifyFilterRemoval : WmiEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{0b6d3c89-5917-43ca-b578-d01a7967c41c}"), - WmiExpense(1), - Description("NDIS Notify Filter Arrival") : amended] -class MSNdis_NotifyFilterArrival : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{a14f1c97-8839-4f8a-9996-a28996ebbf1d}"), - WmiExpense(1), - Description("This control decides whether the network device should wake up the system only on receiving a Magic packet") : amended] -class MSNdis_DeviceWakeOnMagicPacketOnly : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [read, write, - WmiDataId(1)] boolean EnableWakeOnMagicPacketOnly; -}; - - -[WMI, Dynamic, Provider("WMIProv"), - guid("{9565cd55-3402-4e32-a5b6-2f143f2f2c30}"), - WmiExpense(1), - Description("RSS Enabled on this adapter") : amended] -class MSNdis_RSSEnabled : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [read, - WmiDataId(1)] boolean RSSEnabled; -}; - - -/// -/// -/// General GUIDs -/// -/// -[WMI, Dynamic, Provider("WMIProv"), - guid("{5ec10354-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Hardware Status") : amended] -class MSNdis_HardwareStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [read, - Description("Current hardware status of the underlying NIC.") : amended, - Values{"NdisHardwareStatusReady", - "NdisHardwareStatusInitializing", - "NdisHardwareStatusReset", - "NdisHardwareStatusClosing", - "NdisHardwarestatusNotReady"} : amended, - ValueMap{"0", - "1", - "2", - "3", - "4"}, - WmiDataId(1)] uint32 NdisHardwareStatus; - -// -// This is of the type: -// typedef enum _NDIS_HARDWARE_STATUS -// { -// NdisHardwareStatusReady, -// NdisHardwareStatusInitializing, -// NdisHardwareStatusReset, -// NdisHardwareStatusClosing, -// NdisHardwarestatusNotReady -// } NDIS_HARDWARE_STATUS, *PNDIS_HARDWARE_STATUS; -// -}; - -[WMI,Dynamic, Provider("WMIProv"), - guid("{5ec10355-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Media Types Supported") : amended] -class MSNdis_MediaSupported : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of media types supported.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("List of media types the NIC supports.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] uint32 NdisMediaSupported[]; -}; - -[WMI,Dynamic, Provider("WMIProv"), - guid("{5ec10356-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Media Types In Use") : amended] -class MSNdis_MediaInUse : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of media types in use.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("List of media types the NIC is currently supporting.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] uint32 NdisMediaInUse[]; -}; - -[WMI, Dynamic, Provider("WMIProv"),guid("{5ec10357-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Maximum Lookahead Supported") : amended] -class MSNdis_MaximumLookahead : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum number of bytes the NIC can always provide as lookahead data.") : amended, - WmiDataId(1)] uint32 NdisMaximumLookahead; -}; - - - -[WMI, Dynamic, Provider("WMIProv"),guid("{5ec10358-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Maximum Frame Size") : amended] -class MSNdis_MaximumFrameSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum network packet size in bytes the NIC supports, not including a header.") : amended, - WmiDataId(1)] uint32 NdisMaximumFrameSize; -}; - -[WMI, Dynamic, Provider("WMIProv"),guid("{5ec10359-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Link Speed") : amended] -class MSNdis_LinkSpeed : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum speed of the NIC (kbps).") : amended, - WmiDataId(1)] uint32 NdisLinkSpeed; -}; - -[WMI, Dynamic, Provider("WMIProv"),guid("{5ec1035a-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Transmit Buffer Space") : amended] - -class MSNdis_TransmitBufferSpace : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The amount of memory, in bytes, on the NIC available for buffering transmit data.") : amended, - WmiDataId(1)] uint32 NdisTransmitBufferSpace; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec1035b-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Receive Buffer Space") : amended] -class MSNdis_ReceiveBufferSpace : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The amount of memory on the NIC available for buffering receive data.") : amended, - WmiDataId(1)] uint32 NdisReceiveBufferSpace; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec1035c-a61a-11d0-8dd4-00c04fc3358c}"), - WmiExpense(1), - Description("NDIS Transmit Block Size") : amended] -class MSNdis_TransmitBlockSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The minimum number of bytes that a single net packet occupies in the transmit buffer space of the NIC.") : amended, - WmiDataId(1)] uint32 NdisTransmitBlockSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec1035d-a61a-11d0-8dd4-00c04fc3358c}"), - Description("NDIS Receive Block Size") : amended] -class MSNdis_ReceiveBlockSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("The amount of storage, in bytes, that a single packet occupies in the receive buffer space of the NIC.") : amended, - WmiDataId(1)] uint32 NdisReceiveBlockSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec1035e-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Vendor ID") : amended] -class MSNdis_VendorID : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("A three-byte IEEE-registered vendor code, followed by a single byte the vendor assigns to identify a particular NIC.") : amended, - WmiDataId(1)] uint32 NdisVendorID; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec1035f-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Vendor Description") : amended - ] -class MSNdis_VendorDescription : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Zero-terminated string describing the NIC.") : amended, - WmiDataId(1)] string NdisVendorDescription; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10360-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Current Packet Filter") : amended] -class MSNdis_CurrentPacketFilter : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Current packet types that will be received and indicated by the NIC.") : amended, - WmiDataId(1)] uint32 NdisCurrentPacketFilter; - -// -// This is an inclusive OR of the following types: -// -// NDIS_PACKET_TYPE_DIRECTED 0x00000001 -// NDIS_PACKET_TYPE_MULTICAST 0x00000002 -// NDIS_PACKET_TYPE_ALL_MULTICAST 0x00000004 -// NDIS_PACKET_TYPE_BROADCAST 0x00000008 -// NDIS_PACKET_TYPE_SOURCE_ROUTING 0x00000010 -// NDIS_PACKET_TYPE_PROMISCUOUS 0x00000020 -// NDIS_PACKET_TYPE_SMT 0x00000040 -// NDIS_PACKET_TYPE_ALL_LOCAL 0x00000080 -// NDIS_PACKET_TYPE_GROUP 0x00001000 -// NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x00002000 -// NDIS_PACKET_TYPE_FUNCTIONAL 0x00004000 -// NDIS_PACKET_TYPE_MAC_FRAME 0x00008000 -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10361-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Current Lookahead") : amended] -class MSNdis_CurrentLookahead : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of bytes of received packet data, excluding the header, that will be indicated to the protocol driver.") : amended, - WmiDataId(1)] uint32 NdisCurrentLookahead; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10362-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Driver Version") : amended] -class MSNdis_DriverVersion : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The NDIS version in use by the NIC driver.") : amended, - WmiDataId(1)] uint16 NdisDriverVersion; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10363-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Maximum Packet Total Size") : amended] - -class MSNdis_MaximumTotalSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum total packet length, in bytes, the NIC supports, including the header.") : amended, - WmiDataId(1)] uint32 NdisMaximumTotalSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10365-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS MAC Options") : amended] -class MSNdis_MacOptions : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("A bitmask that defines optional properties of the underlying driver or its NIC.") : amended, - WmiDataId(1)] uint32 NdisMacOptions; - -// -// This is an inclusive OR of the following types: -// -// NDIS_MAC_OPTION_COPY_LOOKAHEAD_DATA 0x00000001 -// NDIS_MAC_OPTION_RECEIVE_SERIALIZED 0x00000002 -// NDIS_MAC_OPTION_TRANSFERS_NOT_PEND 0x00000004 -// NDIS_MAC_OPTION_NO_LOOPBACK 0x00000008 -// NDIS_MAC_OPTION_FULL_DUPLEX 0x00000010 -// NDIS_MAC_OPTION_EOTX_INDICATION 0x00000020 -// NDIS_MAC_OPTION_RESERVED 0x80000000 -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10366-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Media Connect Status") : amended] -class MSNdis_MediaConnectStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The connection status of the NIC on the network.") : amended, - Values{"NdisMediaStateConnected", - "NdisMediaStateDisconnected"} : amended, - ValueMap{"0", - "1"}, - WmiDataId(1)] uint32 NdisMediaConnectStatus; - -// -// -// -// Defines the state of the LAN media -// -// typedef enum _NDIS_MEDIA_STATE -// { -// NdisMediaStateConnected, -// NdisMediaStateDisconnected -// } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE; -// -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{5ec10367-a61a-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Maximum Send Packets") : amended] -class MSNdis_MaximumSendPackets : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum number of send packets the MiniportSendPackets function can accept.") : amended, - WmiDataId(1)] uint32 NdisMaximumSendPackets; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956f9-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Vendor's Driver Version") : amended] -class MSNdis_VendorDriverVersion : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The vendor-assigned version number of the NIC driver.") : amended, - WmiDataId(1)] uint32 NdisVendorDriverVersion; -}; - -/// -/// OID_GEN_VLAN_ID: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{765dc702-c5e8-4b67-843b-3f5a4ff2648b}"), - - WmiExpense(1), - Description("NDIS VLAN Identifier") : amended] -class MSNdis_VlanIdentifier : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, write, - Description("The IEEE 802.1Q VLAN ID assigned to this NIC.") : amended, - WmiDataId(1)] uint32 NdisVlanId; -}; - - -// -// OID_GEN_PHYSICAL_MEDIUM: -// - -[WMI, Dynamic, Provider("WMIProv"), guid("{418ca16d-3937-4208-940a-ec6196278085}"), - - WmiExpense(1), - Description("NDIS Physical Medium Type") : amended] -class MSNdis_PhysicalMediumType : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The physical medium type of the NIC.") : amended, - WmiDataId(1)] uint32 NdisPhysicalMediumType; -// Defines the physical medium type of the NIC -// -// typedef enum _NDIS_PHYSICAL_MEDIUM -// { -// -// NdisPhysicalMediumUnspecified, -// NdisPhysicalMediumWirelessLan, -// NdisPhysicalMediumCableModem, -// NdisPhysicalMediumPhoneLine, -// NdisPhysicalMediumPowerLine, -// NdisPhysicalMediumDSL, // includes ADSL and UADSL (G.Lite) -// NdisPhysicalMediumFibreChannel, -// NdisPhysicalMedium1394, -// NdisPhysicalMediumWirelessWan, -// NdisPhysicalMediumMax // Not a real physical type, defined as an upper-bound -// } NDIS_PHYSICAL_MEDIUM, *PNDIS_PHYSICAL_MEDIUM; -// -}; - - - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956fa-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Transmits OK") : amended] -class MSNdis_TransmitsOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames transmitted without errors.") : amended, - WmiDataId(1)] uint64 NdisTransmitsOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956fb-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Receives OK") : amended] -class MSNdis_ReceivesOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames the NIC receives without errors and indicates to bound protocols.") : amended, - WmiDataId(1)] uint64 NdisReceivesOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956fc-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Transmit Errors") : amended] -class MSNdis_TransmitsError : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames a NIC fails to transmit.") : amended, - WmiDataId(1)] uint32 NdisTransmitsError; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956fd-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Receive Errors") : amended] -class MSNdis_ReceiveError : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames a NIC receives but does not indicate to the protocols due to errors.") : amended, - WmiDataId(1)] uint32 NdisReceiveError; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956fe-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Receive No Buffer") : amended] -class MSNdis_ReceiveNoBuffer : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("The number of frames the NIC cannot receive due to lack of NIC receive buffer space.") : amended, - WmiDataId(1)] uint32 NdisReceiveNoBuffer; -}; - -/// -/// -/// CoNDIS general GUIDs -/// -/// - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad192-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Hardware Status") : amended] -class MSNdis_CoHardwareStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Current hardware status of the underlying NIC.") : amended, - WmiDataId(1)] uint32 NdisCoHardwareStatus; -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad193-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Media Types Supported") : amended] -class MSNdis_CoMediaSupported : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of media types supported.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("List of media types the NIC supports.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] uint32 NdisCoMediaSupported[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad194-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Media Types In Use") : amended] -class MSNdis_CoMediaInUse : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of media types in use.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("List of media types the NIC is currently supporting.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] uint32 NdisCoMediaInUse[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad195-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Link Speed") : amended] -class MSNdis_CoLinkSpeed : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [DisplayName("NdisCoLinkSpeed") : amended, - read, - Description("The maximum inbound and outbound speeds of the NIC (kbps).") : amended, - WmiDataId(1)] MSNdis_NetworkLinkSpeed NdisCoLinkSpeed; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad196-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Vendor ID") : amended] -class MSNdis_CoVendorId : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("A three-byte IEEE-registered vendor code, followed by a single byte the vendor assigns to identify a particular NIC.") : amended, - WmiDataId(1)] uint32 NdisCoVendorID; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad197-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Vendor Description") : amended] -class MSNdis_CoVendorDescription : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Zero-terminated string describing the NIC.") : amended, - WmiDataId(1)] string NdisCoVendorDescription; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad198-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Driver Version") : amended] -class MSNdis_CoDriverVersion : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The NDIS version in use by the NIC driver.") : amended, - WmiDataId(1)] uint16 NdisCoDriverVersion; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19a-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS MAC Options") : amended] -class MSNdis_CoMacOptions : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("A bitmask that defines optional properties of the underlying driver or its NIC.") : amended, - WmiDataId(1)] uint32 NdisCoMacOptions; -// -// -// NDIS MAC option bits for OID_GEN_CO_MAC_OPTIONS. -// -// #define NDIS_CO_MAC_OPTION_DYNAMIC_LINK_SPEED 0x00000001 -// -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19b-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Media Connect Status") : amended] - -class MSNdis_CoMediaConnectStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The connection status of the NIC on the network.") : amended, - Values{"NdisMediaStateConnected", - "NdisMediaStateDisconnected"} : amended, - ValueMap{"0", - "1"}, - WmiDataId(1)] uint32 NdisCoMediaConnectStatus; -// -// -// -// Defines the state of the LAN media -// -// typedef enum _NDIS_MEDIA_STATE -// { -// NdisMediaStateConnected, -// NdisMediaStateDisconnected -// } NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE; -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19c-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Vendor's Driver Version") : amended] -class MSNdis_CoVendorDriverVersion : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [DisplayName("NdisCoVendorDriverVersion") : amended, - read, - Description("The vendor-assigned version number of the NIC driver.") : amended, - WmiDataId(1)] uint32 NdisCoVendorDriverVersion; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19d-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Minimum Link Speed") : amended] -class MSNdis_CoMinimumLinkSpeed : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum inbound and outbound speeds of the NIC (kbps).") : amended, - WmiDataId(1)] MSNdis_NetworkLinkSpeed NdisCoMinimumLinkSpeed; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a214805-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Transmits PDUs OK") : amended] -class MSNdis_CoTransmitPdusOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of PDUs transmitted without errors") : amended, - WmiDataId(1)] uint64 NdisCoTransmitPdusOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a214806-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Receive PDUs OK") : amended] -class MSNdis_CoReceivePdusOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of PDUs the NIC receives without errors and indicates to bound protocols.") : amended, - WmiDataId(1)] uint64 NdisCoReceivePdusOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a214807-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Transmit PDU Errors") : amended] -class MSNdis_CoTransmitPduErrors : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of PDUs a NIC fails to transmit.") : amended, - WmiDataId(1)] uint32 NdisCoTransmitPduErrors; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a214808-e35f-11d0-9692-00c04fc3358c}"), -WmiExpense(1), - Description("CoNDIS Receive PDU Errors") : amended] -class MSNdis_CoReceivePduErrors : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of PDUs a NIC receives but does not indicate to the protocols due to errors.") : amended, - WmiDataId(1)] uint32 NdisCoReceivePduErrors; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a214809-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("CoNDIS Receive PDUs No Buffer") : amended] -class MSNdis_CoReceivePdusNoBuffer : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of PDUs the NIC cannot receive due to lack of NIC receive buffer space.") : amended, - WmiDataId(1)] uint32 NdisCoReceivePdusNoBuffer; -}; - -/// -/// -/// ATM media specific GUIDs -/// -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19e-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Supported VC Rates") : amended] -class MSNdis_AtmSupportedVcRates : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Minimum cell rate supported.") : amended, - WmiDataId(1)] uint32 MinCellRate; - - [ - read, - Description("Maximum cell rate supported.") : amended, - WmiDataId(2)] uint32 MaxCellRate; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad19f-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Supported Service Category") : amended] -class MSNdis_AtmSupportedServiceCategory : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Bit mask defining the service categories supported by the hardware.") : amended, - WmiDataId(1)] uint32 NdisAtmSupportedServiceCategory; - -// -// This can be a combination of following defines: -// -// #define ATM_SERVICE_CATEGORY_CBR 1 // Constant Bit Rate -// #define ATM_SERVICE_CATEGORY_VBR 2 // Variable Bit Rate -// #define ATM_SERVICE_CATEGORY_UBR 4 // Unspecified Bit Rate -// #define ATM_SERVICE_CATEGORY_ABR 8 // Available Bit Rate -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a0-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Supported AAL Types") : amended] -class MSNdis_AtmSupportedAalTypes : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Bit mask defining the AAL types supported by the hardware.") : amended, - WmiDataId(1)] uint32 NdisAtmSupportedAalTypes; -// -// This can be a combination of the following defines: -// -// #define AAL_TYPE_AAL0 1 -// #define AAL_TYPE_AAL1 2 -// #define AAL_TYPE_AAL34 4 -// #define AAL_TYPE_AAL5 8 -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a1-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Hardware Current Address") : amended] -class MSNdis_AtmHardwareCurrentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The address of the NIC encoded in the hardware.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisAtmHardwareCurrentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a2-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum Active VCs") : amended] -class MSNdis_AtmMaxActiveVcs : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Maximum number of active VCs the adapter can support.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxActiveVcs; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a3-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum Active VCI Bits") : amended] -class MSNdis_AtmMaxActiveVciBits : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of bits controllable in the VCI field of the cell header.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxActiveVciBits; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a4-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum Active VPI Bits") : amended] -class MSNdis_AtmMaxActiveVpiBits : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of bits controllable in the VPI field of the cell header.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxActiveVpiBits; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a5-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum AAL0 Packet Size") : amended] -class MSNdis_AtmMaxAal0PacketSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Maximum supported size for AAL0 packets.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxAal0PacketSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a6-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum AAL1 Packet Size") : amended] -class MSNdis_AtmMaxAal1PacketSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("Maximum supported size for AAL1 packets.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxAal1PacketSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad1a7-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum AAL3/4 Packet Size") : amended] -class MSNdis_AtmMaxAal34PacketSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("Maximum supported size for AAL3/4 packets.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxAal34PacketSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{791ad191-e35c-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Maximum AAL5 Packet Size") : amended] -class MSNdis_AtmMaxAal5PacketSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Maximum supported size for AAL5 packets.") : amended, - WmiDataId(1)] uint32 NdisAtmMaxAal5PacketSize; -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a21480a-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Receive Cells OK") : amended] -class MSNdis_AtmReceiveCellsOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of cells the NIC has received without errors.") : amended, - WmiDataId(1)] uint64 NdisAtmReceiveCellsOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a21480b-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Transmit Cells OK") : amended] -class MSNdis_AtmTransmitCellsOk : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of cells the NIC has transmitted without errors.") : amended, - WmiDataId(1)] uint64 NdisAtmTransmitCellsOk; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{0a21480c-e35f-11d0-9692-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS ATM Receive Cells Dropped") : amended] -class MSNdis_AtmReceiveCellsDropped : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of receive cells the NIC has dropped.") : amended, - WmiDataId(1)] uint64 NdisAtmReceiveCellsDropped; -}; - -/// -/// -/// Ethernet specific GUIDs -/// -/// - -[WMI, Dynamic, Provider("WMIProv"), guid("{447956ff-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet Permanent Address") : amended] -class MSNdis_EthernetPermanentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("The address of the NIC encoded in the hardware.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisPermanentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795700-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet Current Address") : amended] -class MSNdis_EthernetCurrentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("The address the NIC is currently using.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisCurrentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795701-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet Multicast List") : amended] -class MSNdis_EthernetMulticastList : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ read, - Description("Number of multicast addresses enabled on the NIC.") : amended, - WmiDataId(1)] uint32 NumberElements; - - [read, - Description("The multicast address list on the NIC enabled for packet reception.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] MSNdis_NetworkAddress NdisMulticastList[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795702-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("Adapter Ethernet Maximum Multicast List Size") : amended] -class MSNdis_EthernetMaximumMulticastListSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum number of multicast addresses the NIC driver can manage.") : amended, - WmiDataId(1)] uint32 NdisEthernetMaximumMulticastListSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795703-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet MAC Options") : amended] -class MSNdis_EthernetMacOptions : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Features supported by the underlying driver, which could be emulating Ethernet.") : amended, - WmiDataId(1)] uint32 NdisEthernetMacOptions; - -// -// Supported values: -// -// NDIS_802_3_MAC_OPTION_PRIORITY 0x00000001 -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795704-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet Receive Error Alignment") : amended] -class MSNdis_EthernetReceiveErrorAlignment : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames received with alignment errors.") : amended, - WmiDataId(1)] uint32 NdisEthernetReceiveErrorAlignment; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795705-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet One Transmit collision") : amended] -class MSNdis_EthernetOneTransmitCollision : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames successfully transmitted after exactly one collision.") : amended, - WmiDataId(1)] uint32 NdisEthernetOneTransmitCollision; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795706-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Ethernet More Transmit collisions") : amended] -class MSNdis_EthernetMoreTransmitCollisions : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames successfully transmitted after more than one collision.") : amended, - WmiDataId(1)] uint32 NdisEthernetMoreTransmitCollisions; -}; - -/// -/// -/// Token Ring specific GUIDs -/// -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{44795707-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Permanent Address") : amended] -class MSNdis_TokenRingPermanentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The address of the NIC encoded in the hardware.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisPermanentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795708-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Current Address") : amended] -class MSNdis_TokenRingCurrentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The address the NIC is currently using.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisCurrentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{44795709-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Current Functional Address") : amended] -class MSNdis_TokenRingCurrentFunctional : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The functional address enabled on the NIC for packet reception.") : amended, - WmiDataId(1)] uint32 NdisTokenRingCurrentFunctional; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{4479570a-a61b-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Current Group Address") : amended] -class MSNdis_TokenRingCurrentGroup : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The group address enabled on the NIC for packet reception.") : amended, - WmiDataId(1)] uint32 NdisTokenRingCurrentGroup; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{4479570b-a61b-11d0-8dd4-00c04fc3358c}"), -WmiExpense(1), - Description("NDIS Token Ring Last Open Status") : amended] -class MSNdis_TokenRingLastOpenStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The last open error status returned for a protocol's call to NdisOpenAdapter.") : amended, - WmiDataId(1)] uint32 NdisTokenRingLastOpenStatus; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{890a36ec-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Current Ring Status") : amended] -class MSNdis_TokenRingCurrentRingStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The last ring status indicated with an NDIS_RING_XXX status code.") : amended, - WmiDataId(1)] uint32 NdisTokenRingCurrentRingStatus; - -// -// This can be one of the following values: -// -// NDIS_RING_SIGNAL_LOSS 0x00008000 -// NDIS_RING_HARD_ERROR 0x00004000 -// NDIS_RING_SOFT_ERROR 0x00002000 -// NDIS_RING_TRANSMIT_BEACON 0x00001000 -// NDIS_RING_LOBE_WIRE_FAULT 0x00000800 -// NDIS_RING_AUTO_REMOVAL_ERROR 0x00000400 -// NDIS_RING_REMOVE_RECEIVED 0x00000200 -// NDIS_RING_COUNTER_OVERFLOW 0x00000100 -// NDIS_RING_SINGLE_STATION 0x00000080 -// NDIS_RING_RING_RECOVERY 0x00000040 -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14032-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Current Ring State.") : amended] -class MSNdis_TokenRingCurrentRingState : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The state of the NIC driver with respect to entering the ring.") : amended, - Values{"NdisRingStateOpened", - "NdisRingStateClosed", - "NdisRingStateOpening", - "NdisRingStateClosing", - "NdisRingStateOpenFailure", - "NdisRingStateRingFailure"} : amended, - ValueMap{"1", - "2", - "3", - "4", - "5", - "6"}, - WmiDataId(1)] uint32 NdisTokenRingCurrentRingState; - -// -// This is defined as follows: -// -// typedef enum _NDIS_802_5_RING_STATE -// { -// NdisRingStateOpened = 1, -// NdisRingStateClosed, -// NdisRingStateOpening, -// NdisRingStateClosing, -// NdisRingStateOpenFailure, -// NdisRingStateRingFailure -// } NDIS_802_5_RING_STATE, *PNDIS_802_5_RING_STATE; -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14033-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Line Errors") : amended] -class MSNdis_TokenRingLineErrors : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of frames with an invalid FCS or a code violation.") : amended, - WmiDataId(1)] uint32 NdisTokenRingLineErrors; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14034-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Token Ring Lost Frames") : amended] -class MSNdis_TokenRingLostFrames : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames transmitted that have not circled the ring within the maximum ring latency.") : amended, - WmiDataId(1)] uint32 NdisTokenRingLostFrames; -}; - -/// -/// -/// FDDI specific GUIDs -/// -/// - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14035-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Long Permanent Address") : amended] -class MSNdis_FddiLongPermanentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The long address of the NIC encoded in the hardware.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisPermanentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14036-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Long Current Address") : amended] -class MSNdis_FddiLongCurrentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The long address the NIC is currently using.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisCurrentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14037-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Long Multicast List") : amended] -class MSNdis_FddiLongMulticastList : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of multicast addresses enabled on the NIC.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("The multicast long address list on the NIC enabled for packet reception.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] - MSNdis_NetworkAddress NdisMulticastList[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14038-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Long Maximum List Size") : amended] -class MSNdis_FddiLongMaximumListSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum number of multicast long addresses the NIC driver can manage.") : amended, - WmiDataId(1)] uint32 NdisFddiLongMaximumListSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14039-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Short Permanent Address") : amended] -class MSNdis_FddiShortPermanentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The short address of the NIC encoded in the hardware.") : amended, - WmiDataId(1)] MSNdis_NetworkShortAddress NdisPermanentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403a-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Short Current Address") : amended] -class MSNdis_FddiShortCurrentAddress : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The short address the NIC is currently using.") : amended, - WmiDataId(1)] MSNdis_NetworkShortAddress NdisCurrentAddress; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403b-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Short Multicast List") : amended] -class MSNdis_FddiShortMulticastList : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of multicast short addresses enabled on the NIC.") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("The multicast short address list on the NIC enabled for packet reception.") : amended, - WmiDataId(2), - WmiSizeIs("NumberElements")] MSNdis_NetworkShortAddress NdisMulticastList[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403c-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Short Maximum List Size") : amended] -class MSNdis_FddiShortMaximumListSize : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The maximum number of multicast short addresses the NIC driver can manage.") : amended, - WmiDataId(1)] uint32 NdisFddiShortMaximumListSize; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403d-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Attachment Type") : amended] -class MSNdis_FddiAttachmentType : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Defines the attachment of the NIC to the network.") : amended, - Values{"NdisFddiTypeIsolated", - "NdisFddiTypeLocalA", - "NdisFddiTypeLocalB", - "NdisFddiTypeLocalAB", - "NdisFddiTypeLocalS", - "NdisFddiTypeWrapA", - "NdisFddiTypeWrapB", - "NdisFddiTypeWrapAB", - "NdisFddiTypeWrapS", - "NdisFddiTypeCWrapA", - "NdisFddiTypeCWrapB", - "NdisFddiTypeCWrapS", - "NdisFddiTypeThrough"} : amended, - ValueMap{"1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13"}, - WmiDataId(1)] uint32 NdisFddiAttachmentType; - -// -// This can be of the following type: -// -// typedef enum _NDIS_FDDI_ATTACHMENT_TYPE -// { -// NdisFddiTypeIsolated = 1, -// NdisFddiTypeLocalA, -// NdisFddiTypeLocalB, -// NdisFddiTypeLocalAB, -// NdisFddiTypeLocalS, -// NdisFddiTypeWrapA, -// NdisFddiTypeWrapB, -// NdisFddiTypeWrapAB, -// NdisFddiTypeWrapS, -// NdisFddiTypeCWrapA, -// NdisFddiTypeCWrapB, -// NdisFddiTypeCWrapS, -// NdisFddiTypeThrough -// } NDIS_FDDI_ATTACHMENT_TYPE, *PNDIS_FDDI_ATTACHMENT_TYPE; -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403e-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Upstream Node Long") : amended] -class MSNdis_FddiUpstreamNodeLong : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The long address of the station above this NIC on the ring or zero if the address is unknown.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisFddiUpstreamNodeLong; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf1403f-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Downstream Node Long") : amended] -class MSNdis_FddiDownstreamNodeLong : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The long address of the station below this NIC on the ring or zero if the address is unknown.") : amended, - WmiDataId(1)] MSNdis_NetworkAddress NdisFddiDownstreamNodeLong; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14040-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Frame Errors") : amended] -class MSNdis_FddiFrameErrors : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of frames detected in error by this NIC that have not been detected in error by another device on the ring.") : amended, - WmiDataId(1)] uint32 NdisFddiFrameErrors; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14041-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Frames Lost") : amended] -class MSNdis_FddiFramesLost : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of times this NIC detected a format error during frame reception such that the frame was stripped.") : amended, - WmiDataId(1)] uint32 NdisFddiFramesLost; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14042-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI Ring Management State") : amended] -class MSNdis_FddiRingManagmentState : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Defines the current state of the Ring Management state machine.") : amended, - Values{"NdisFddiRingIsolated", - "NdisFddiRingNonOperational", - "NdisFddiRingOperational", - "NdisFddiRingDetect", - "NdisFddiRingNonOperationalDup", - "NdisFddiRingOperationalDup", - "NdisFddiRingDirected", - "NdisFddiRingTrace"} : amended, - ValueMap{"1", - "2", - "3", - "4", - "5", - "6", - "7", - "8"}, - WmiDataId(1)] uint32 NdisFddiRingManagmentState; - -// -// This can be of the following type: -// -// typedef enum _NDIS_FDDI_RING_MGT_STATE -// { -// NdisFddiRingIsolated = 1, -// NdisFddiRingNonOperational, -// NdisFddiRingOperational, -// NdisFddiRingDetect, -// NdisFddiRingNonOperationalDup, -// NdisFddiRingOperationalDup, -// NdisFddiRingDirected, -// NdisFddiRingTrace -// } NDIS_FDDI_RING_MGT_STATE, *PNDIS_FDDI_RING_MGT_STATE; -// -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14043-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI LCT Failures") : amended] -class MSNdis_FddiLctFailures : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The count of the consecutive times the link confidence test (LCT) has failed during connection management.") : amended, - WmiDataId(1)] uint32 NdisFddiLctFailures; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14044-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI LEM Rejects") : amended] -class MSNdis_FddiLemRejects : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The link error monitor (LEM) count of times that a link was rejected.") : amended, - WmiDataId(1)] uint32 NdisFddiLemRejects; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{acf14045-a61c-11d0-8dd4-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS FDDI LConnect State") : amended] -class MSNdis_FddiLConnectionState : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Defines the state of this port's Physical Connection Management (PCM) state machine.") : amended, - Values{"NdisFddiStateOff", - "NdisFddiStateBreak", - "NdisFddiStateTrace", - "NdisFddiStateConnect", - "NdisFddiStateNext", - "NdisFddiStateSignal", - "NdisFddiStateJoin", - "NdisFddiStateVerify", - "NdisFddiStateActive", - "NdisFddiStateMaintenance"} : amended, - ValueMap{"1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10"}, - WmiDataId(1)] uint32 NdisFddiLConnectionState; -// -// This can be of the following type: -// -// typedef enum _NDIS_FDDI_LCONNECTION_STATE -// { -// NdisFddiStateOff = 1, -// NdisFddiStateBreak, -// NdisFddiStateTrace, -// NdisFddiStateConnect, -// NdisFddiStateNext, -// NdisFddiStateSignal, -// NdisFddiStateJoin, -// NdisFddiStateVerify, -// NdisFddiStateActive, -// NdisFddiStateMaintenance -// } NDIS_FDDI_LCONNECTION_STATE, *PNDIS_FDDI_LCONNECTION_STATE; -// - -}; - - -/// -/// NDIS 6 specific GUIDs -/// - -[WMI, - guid("{2b1831b2-2216-4ede-a469-9fe3dd6d5a7e}")] -class MSNdis_ObjectHeader : MSNdis -{ - [read, WmiDataId(1)] uint8 Type; - [ - read, WmiDataId(2)] uint8 Revision; - [ - read, WmiDataId(3)] uint16 Size; -}; - -[WMI, - guid("{e3eac9dd-2fd3-4963-bffd-b4692888c0d4}")] -class MSNdis_WmiMethodHeader : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 PortNumber; - [ - read, WmiDataId(3)] uint64 NetLuid; - [ - read, WmiDataId(4)] uint64 RequestId; - [ - read, WmiDataId(5)] uint32 Timeout; - [ - read, WmiDataId(6)] uint32 Padding; - -}; - -[WMI, - guid("{3b5605d8-1aaf-4ff6-85b9-bc5fb973dc54}")] -class MSNdis_WmiSetHeader : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 PortNumber; - [ - read, WmiDataId(3)] uint64 NetLuid; - [ - read, WmiDataId(4)] uint64 RequestId; - [ - read, WmiDataId(5)] uint32 Timeout; - [ - read, WmiDataId(6)] uint32 Padding; -}; - -[WMI, - guid("{7510bb9d-df70-4f7e-ba07-e29d330b3cc5}")] -class MSNdis_WmiOutputInfo : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint8 SupportedRevision; - [ - read, WmiDataId(4)] uint8 Padding1; - [ - read, WmiDataId(5)] uint16 Padding2; - [ - read, WmiDataId(6)] uint32 DataOffset; -}; - -[WMI, - guid("{e7001b59-c3d6-4537-b40e-a163d516e4a3}")] -class MSNdis_WmiEnumAdapter : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 IfIndex; - [ - read, WmiDataId(3)] uint64 NetLuid; - [ - read, WmiDataId(4)] string DeviceName; -}; - - -[WMI, - guid("{5b26b94f-0272-4d4c-8744-bd84be421f3b}")] -class MSNdis_LinkStateData : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 MediaConnectState; - [ - read, WmiDataId(3)] uint32 MediaDuplexState; - [ - read, WmiDataId(4)] uint64 XmitLinkSpeed; - [ - read, WmiDataId(5)] uint64 RcvLinkSpeed; - [ - read, WmiDataId(6)] uint32 PauseFunctions; - [ - read, WmiDataId(7)] uint32 AutoNegotiationFlags; -}; - -[WMI, - guid("{29380131-a312-4400-be0c-53877a41c465}")] -class MSNdis_LinkParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 MediaDuplexState; - [ - read, WmiDataId(3)] uint64 XmitLinkSpeed; - [ - read, WmiDataId(4)] uint64 RcvLinkSpeed; - [ - read, WmiDataId(5)] uint32 PauseFunctions; - [ - read, WmiDataId(6)] uint32 AutoNegotiationFlags; -}; - - -[WMI, - guid("{09f58643-31fb-45b5-852b-09b4d3ff3765}")] -class MSNdis_InterruptModerationParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 InterruptModeration; - -}; - -[WMI, - guid("{8ecc74e1-ba85-482e-afaf-b4f8b087c06b}")] -class MSNdis_StatisticsInfo : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 SupportedStatistics; - [ - read, WmiDataId(3)] uint64 ifInDiscards; - [ - read, WmiDataId(4)] uint64 ifInErrors; - [ - read, WmiDataId(5)] uint64 ifHCInOctets; - [ - read, WmiDataId(6)] uint64 ifHCInUcastPkts; - [ - read, WmiDataId(7)] uint64 ifHCInMulticastPkts; - [ - read, WmiDataId(8)] uint64 ifHCInBroadcastPkts; - [ - read, WmiDataId(9)] uint64 ifHCOutOctets; - [ - read, WmiDataId(10)] uint64 ifHCOutUcastPkts; - [ - read, WmiDataId(11)] uint64 ifHCOutMulticastPkts; - [ - read, WmiDataId(12)] uint64 ifHCOutBroadcastPkts; - [ - read, WmiDataId(13)] uint64 ifOutErrors; - [ - read, WmiDataId(14)] uint64 ifOutDiscards; - [ - read, WmiDataId(15)] uint64 ifHCInUcastOctets; - [ - read, WmiDataId(16)] uint64 ifHCInMulticastOctets; - [ - read, WmiDataId(17)] uint64 ifHCInBroadcastOctets; - [ - read, WmiDataId(18)] uint64 ifHCOutUcastOctets; - [ - read, WmiDataId(19)] uint64 ifHCOutMulticastOctets; - [ - read, WmiDataId(20)] uint64 ifHCOutBroadcastOctets; -}; - -[WMI, - guid("{8feae2c6-ee28-469f-8b5d-9f743bab21aa}")] -class MSNdis_PortStateData : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 MediaConnectState; - [ - read, WmiDataId(3)] uint64 XmitLinkSpeed; - [ - read, WmiDataId(4)] uint64 RcvLinkSpeed; - [ - read, WmiDataId(5)] uint32 Direction; - [ - read, WmiDataId(6)] uint32 SendControlState; - [ - read, WmiDataId(7)] uint32 RcvControlState; - [ - read, WmiDataId(8)] uint32 SendAuthorizationState; - [ - read, WmiDataId(9)] uint32 RcvAuthorizationState; - [ - read, WmiDataId(10)] uint32 Flags; -}; - - -[WMI, - guid("{5c3bda24-8b64-4829-a587-8ce719152fe2}")] -class MSNdis_PortAuthParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 SendControlState; - [ - read, WmiDataId(3)] uint32 RcvControlState; - [ - read, WmiDataId(4)] uint32 SendAuthorizationState; - [ - read, WmiDataId(5)] uint32 RcvAuthorizationState; -}; - -[WMI, - guid("{f5b7d202-e594-4aa3-be43-4976833c7840}")] -class MSNdis_PortChar : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 PortNumber; - [ - read, WmiDataId(3)] uint32 Flags; - [ - read, WmiDataId(4)] uint32 Type; - [ - read, WmiDataId(5)] uint32 MediaConnectState; - [ - read, WmiDataId(6)] uint64 XmitLinkSpeed; - [ - read, WmiDataId(7)] uint64 RcvLinkSpeed; - [ - read, WmiDataId(8)] uint32 Direction; - [ - read, WmiDataId(9)] uint32 SendControlState; - [ - read, WmiDataId(10)] uint32 RcvControlState; - [ - read, WmiDataId(11)] uint32 SendAuthorizationState; - [ - read, WmiDataId(12)] uint32 RcvAuthorizationState; -}; - -[WMI, - guid("{0fee8708-df65-456e-b4ca-fa623266a12a}")] -class MSNdis_PortArray : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 NumberOfPorts; - [ - read, WmiDataId(3)] uint32 OffsetFirstPort; - [ - read, WmiDataId(4)] uint32 ElementSize; - [ - read, WmiDataId(5), WmiSizeIs("NumberOfPorts")] MSNdis_PortChar Port[]; - -}; - -[WMI, - guid("{0573f70f-ded8-401c-8b56-a62bb528c0e2}")] -class MSNdis_PciDeviceProperty : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 DeviceType; - [ - read, WmiDataId(3)] uint32 CurrentSpeedAndMode; - [ - read, WmiDataId(4)] uint32 CurrentPayloadSize; - [ - read, WmiDataId(5)] uint32 MaxPayloadSize; - [ - read, WmiDataId(6)] uint32 MaxReadRequestSize; - [ - read, WmiDataId(7)] uint32 CurrentLinkSpeed; - [ - read, WmiDataId(8)] uint32 CurrentLinkWidth; - [ - read, WmiDataId(9)] uint32 MaxLinkSpeed; - [ - read, WmiDataId(10)] uint32 MaxLinkWidth; -}; - -[WMI, - guid("{d7673b11-e892-4a9d-8bd8-761ff256edd9}")] -class MSNdis_WmiTcpLargeSendOffloadV1_IPv4 : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 MaxOffLoadSize; - [ - read, WmiDataId(3)] uint32 MinSegmentCount; - [ - read, WmiDataId(4)] uint32 TcpOptions; - [ - read, WmiDataId(5)] uint32 IpOptions; -}; - -[WMI, - guid("{b9e4e2f9-ee89-4756-b057-38f9d9b59a92}")] -class MSNdis_WmiTcpLargeSendOffloadV1 : MSNdis -{ - [read, WmiDataId(1)] MSNdis_WmiTcpLargeSendOffloadV1_IPv4 WmiIPv4; -}; - -[WMI, - guid("{d63d537a-59c1-4fae-8f9b-cd9fbbecb85a}")] -class MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 IpOptionsSupported; - [ - read, WmiDataId(3)] uint32 TcpOptionsSupported; - [ - read, WmiDataId(4)] uint32 TcpChecksum; - [ - read, WmiDataId(5)] uint32 UdpChecksum; - [ - read, WmiDataId(6)] uint32 IpChecksum; -}; - -[WMI, - guid("{b9760e75-6662-49e4-aa6c-f028befec8ee}")] -class MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 IpExtensionHeadersSupported; - [ - read, WmiDataId(3)] uint32 TcpOptionsSupported; - [ - read, WmiDataId(4)] uint32 TcpChecksum; - [ - read, WmiDataId(5)] uint32 UdpChecksum; -}; - -[WMI, - guid("{189d4015-1b25-4d8e-a4a9-f9eba82197c7}")] -class MSNdis_WmiTcpIpChecksumOffload : MSNdis -{ - [read, WmiDataId(1)] MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive IPv4Transmit; - [ - read, WmiDataId(2)] MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive IPv4Receive; - [ - read, WmiDataId(3)] MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive IPv6Transmit; - [ - read, WmiDataId(4)] MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive IPv6Receive; -}; - -[WMI, - guid("{f86676b9-d9fa-4d26-95ce-bfbc77d80596}")] -class MSNdis_WmiIPSecOffloadV1_Supported : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 AhEspCombined; - [ - read, WmiDataId(3)] uint32 TransportTunnelCombined; - [ - read, WmiDataId(4)] uint32 IPv4Options; - [ - read, WmiDataId(5)] uint32 Flags; -}; - -[WMI, - guid("{29bacfdd-f063-48d8-952c-d3dc93300f15}")] -class MSNdis_WmiIPSecOffloadV1_IPv4AH : MSNdis -{ - [read, WmiDataId(1)] uint32 Md5; - [ - read, WmiDataId(2)] uint32 Sha_1; - [ - read, WmiDataId(3)] uint32 Transport; - [ - read, WmiDataId(4)] uint32 Tunnel; - [ - read, WmiDataId(5)] uint32 Send; - [ - read, WmiDataId(6)] uint32 Receive; -}; - -[WMI, - guid("{86522023-4536-4b58-a1f4-2538941ace43}")] -class MSNdis_WmiIPSecOffloadV1_IPv4ESP : MSNdis -{ - [read, WmiDataId(1)] uint32 Des; - [ - read, WmiDataId(2)] uint32 Reserved; - [ - read, WmiDataId(3)] uint32 TripleDes; - [ - read, WmiDataId(4)] uint32 NullEsp; - [ - read, WmiDataId(5)] uint32 Transport; - [ - read, WmiDataId(6)] uint32 Tunnel; - [ - read, WmiDataId(7)] uint32 Send; - [ - read, WmiDataId(8)] uint32 Receive; -}; - - -[WMI, - guid("{4ec63447-2238-43a7-ac33-11c7cc7d8665}")] -class MSNdis_WmiIPSecOffloadV1 : MSNdis -{ - [read, WmiDataId(1)] MSNdis_WmiIPSecOffloadV1_Supported WmiSupported; - [ - read, WmiDataId(2)] MSNdis_WmiIPSecOffloadV1_IPv4AH WmiIPv4AH; - [ - read, WmiDataId(3)] MSNdis_WmiIPSecOffloadV1_IPv4ESP WmiIPv4ESP; -}; - -[WMI, - guid("{8823d030-fa30-4b73-b339-db19207f0d81}")] -class MSNdis_WmiTcpLargeSendOffloadV2_IPv4 : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 MaxOffLoadSize; - [ - read, WmiDataId(3)] uint32 MinSegmentCount; -}; - -[WMI, - guid("{a7a9597c-2f8e-410b-9bb3-5c3a50792bfc}")] -class MSNdis_WmiTcpLargeSendOffloadV2_IPv6 : MSNdis -{ - [read, WmiDataId(1)] uint32 Encapsulation; - [ - read, WmiDataId(2)] uint32 MaxOffLoadSize; - [ - read, WmiDataId(3)] uint32 MinSegmentCount; - [ - read, WmiDataId(4)] uint32 IpExtensionHeadersSupported; - [ - read, WmiDataId(5)] uint32 TcpOptionsSupported; -}; - -[WMI, - guid("{592977c2-cfbe-462c-b5cf-1a7679fe1cba}")] -class MSNdis_WmiTcpLargeSendOffloadV2 : MSNdis -{ - [read, WmiDataId(1)] MSNdis_WmiTcpLargeSendOffloadV2_IPv4 WmiIPv4; - [ - read, WmiDataId(2)] MSNdis_WmiTcpLargeSendOffloadV2_IPv6 WmiIPv6; -}; - -[WMI, - guid("{7a877086-2204-4a8a-92a4-e3e8ab626629}")] -class MSNdis_WmiOffload : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] MSNdis_WmiTcpIpChecksumOffload Checksum; - [ - read, WmiDataId(3)] MSNdis_WmiTcpLargeSendOffloadV1 LsoV1; - [ - read, WmiDataId(4)] MSNdis_WmiIPSecOffloadV1 IPsecV1; - [ - read, WmiDataId(5)] MSNdis_WmiTcpLargeSendOffloadV2 LsoV2; - [ - read, WmiDataId(6)] uint32 Flags; -}; - -[WMI, - guid("{43fe82d8-3468-497e-9dcf-f8ffc0133744}")] -class MSNdis_TcpOffloadParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint8 IPv4Checksum; - [ - read, WmiDataId(3)] uint8 TCPIPv4Checksum; - [ - read, WmiDataId(4)] uint8 UDPIPv4Checksum; - [ - read, WmiDataId(5)] uint8 TCPIPv6Checksum; - [ - read, WmiDataId(6)] uint8 UDPIPv6Checksum; - [ - read, WmiDataId(7)] uint8 LsoV1; - [ - read, WmiDataId(8)] uint8 IPsec; - [ - read, WmiDataId(9)] uint8 LsoV2IPv4; - [ - read, WmiDataId(10)] uint8 LsoV2IPv6; - [ - read, WmiDataId(11)] uint8 TcpConnectionIPv4; - [ - read, WmiDataId(12)] uint8 TcpConnectionIPv6; - [ - read, WmiDataId(13)] uint32 Flags; -}; - -[WMI, - guid("{93cfcd3f-6228-455c-905e-3ab80a2ff090}")] -class MSNdis_WmiTcpConnectionOffload : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Encapsulation; - [ - read, WmiDataId(3)] uint32 SupportIp4; - [ - read, WmiDataId(4)] uint32 SupportIp6; - [ - read, WmiDataId(5)] uint32 SupportIp6ExtensionHeaders; - [ - read, WmiDataId(6)] uint32 SupportSack; - [ - read, WmiDataId(7)] uint32 TcpConnectionOffloadCapacity; - [ - read, WmiDataId(8)] uint32 Flags; -}; - -[WMI, - guid("{34ff16bf-30ca-4a2a-a46d-c7ee74bc3582}")] -class MSNdis_WmiHDSplitCurrentConfig : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 HardwareCapabilities; - [ - read, WmiDataId(3)] uint32 CurrentCapabilities; - [ - read, WmiDataId(4)] uint32 HDSplitFlags; - [ - read, WmiDataId(5)] uint32 HDSplitCombineFlags; - [ - read, WmiDataId(6)] uint32 BackfillSize; - [ - read, WmiDataId(7)] uint32 MaxHeaderSize; -}; - -[WMI, - guid("{1131c56a-0a5a-4d79-8dde-1e6f178005ee}")] -class MSNdis_HDSplitParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 HDSplitCombineFlags; -}; - -[WMI, - guid("{f7a4960a-ace3-44dc-b51e-72e05c5eafa8}")] -class MSNdis_WmiReceiveScaleCapabilities : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 CapabilitiesFlags; - [ - read, WmiDataId(3)] uint32 NumberOfInterruptMessages; - [ - read, WmiDataId(4)] uint32 NumberOfReceiveQueues; -}; - -[WMI, - guid("{146360a3-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterCapabilities : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 EnabledFilterTypes; - [ - read, WmiDataId(4)] uint32 EnabledQueueTypes; - [ - read, WmiDataId(5)] uint32 NumQueues; - [ - read, WmiDataId(6)] uint32 SupportedQueueProperties; - [ - read, WmiDataId(7)] uint32 SupportedFilterTests; - [ - read, WmiDataId(8)] uint32 SupportedHeaders; - [ - read, WmiDataId(9)] uint32 SupportedMacHeaderFields; - [ - read, WmiDataId(10)] uint32 MaxMacHeaderFilters; - [ - read, WmiDataId(11)] uint32 MaxQueueGroups; - [ - read, WmiDataId(12)] uint32 MaxQueuesPerQueueGroup; - [ - read, WmiDataId(13)] uint32 MinLookaheadSplitSize; - [ - read, WmiDataId(14)] uint32 MaxLookaheadSplitSize; -}; - -[WMI, - guid("{146360a4-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterGlobalParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 EnabledFilterTypes; - [ - read, WmiDataId(4)] uint32 EnabledQueueTypes; -}; - -[WMI, - guid("{146360a5-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_CountedString : MSNdis -{ - [read, WmiDataId(1)] uint16 Length; - [ - read, WmiDataId(2)] char16 String[257]; -}; - -[WMI, - guid("{146360a9-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterInfo : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 FilterType; - [ - read, WmiDataId(4)] uint32 FilterId; -}; - -[WMI, Dynamic, Provider("WMIProv"), -guid("{146360aa-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterInfoArray : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, write, WmiDataId(2)] uint32 QueueId; - [ - read, WmiDataId(3)] uint32 FirstElementOffset; - [ - read, WmiDataId(4)] uint32 NumElements; - [ - read, WmiDataId(5)] uint32 ElementSize; - [ - read, WmiDataId(6), WmiSizeIs("NumElements")] MSNdis_ReceiveFilterInfo Filter[]; -}; - -[WMI, - guid("{146360ab-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterFieldParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 FrameHeader; - [ - read, WmiDataId(4)] uint32 ReceiveFilterTest; - [ - read, WmiDataId(5)] uint32 MacHeaderField; - [ - read, WmiDataId(6)] uint8 FieldByteArrayValue[16]; - [ - read, WmiDataId(7)] uint8 ResultByteArrayValue[16]; -}; - -[WMI, Dynamic, Provider("WMIProv"), -guid("{146360ac-88dd-11dd-94b8-001d09162bc3}")] -class MSNdis_ReceiveFilterParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 FilterType; - [ - read, WmiDataId(4)] uint32 QueueId; - [ - read, write, WmiDataId(5)] uint32 FilterId; - [ - read, WmiDataId(6)] uint32 FieldParametersArrayOffset; - [ - read, WmiDataId(7)] uint32 FieldParametersArrayNumElements; - [ - read, WmiDataId(8)] uint32 FieldParametersArrayElementSize; - [ - read, WmiDataId(9)] uint32 RequestedFilterIdBitCount; - [ - read, WmiDataId(10), WmiSizeIs("FieldParametersArrayNumElements")] MSNdis_ReceiveFilterFieldParameters FieldParameters[]; - -}; - -[WMI, - guid("{db80dd1c-59ae-48e7-b7ec-f9be2c4b8cb0}")] -class MSNdis_NicSwitchCapabilities : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 NdisReserved1; - [ - read, WmiDataId(4)] uint32 NumTotalMacAddresses; - [ - read, WmiDataId(5)] uint32 NumMacAddressesPerPort; - [ - read, WmiDataId(6)] uint32 NumVlansPerPort; - [ - read, WmiDataId(7)] uint32 NdisReserved2; - [ - read, WmiDataId(8)] uint32 NdisReserved3; -}; - -[WMI, - guid("{f786fbd5-c049-11dd-b885-001d09162bc3}")] -class MSNdis_GroupAffinity : MSNdis -{ - [read, WmiDataId(1)] uint64 Mask; - [ - read, WmiDataId(2)] uint16 Group; - [ - read, WmiDataId(3)] uint16 Reserved[3]; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{f786fbd6-c049-11dd-b885-001d09162bc3}")] -class MSNdis_ReceiveQueueParameters : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 QueueType; - [ - read, write, WmiDataId(4)] uint32 QueueId; - [ - read, WmiDataId(5)] uint32 QueueGroupId; - [ - read, WmiDataId(6)] MSNdis_GroupAffinity ProcessorAffinity; - [ - read, WmiDataId(7)] uint32 NumSuggestedReceiveBuffers; - [ - read, WmiDataId(8)] uint32 MSIXTableEntry; - [ - read, WmiDataId(9)] uint32 LookaheadSize; - [ - read, WmiDataId(10)] MSNdis_CountedString VmName; - [ - read, WmiDataId(11)] MSNdis_CountedString QueueName; -}; - -[WMI, - guid("{f786fbd7-c049-11dd-b885-001d09162bc3}")] -class MSNdis_ReceiveQueueInfo : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 Flags; - [ - read, WmiDataId(3)] uint32 QueueType; - [ - read, WmiDataId(4)] uint32 QueueId; - [ - read, WmiDataId(5)] uint32 QueueGroupId; - [ - read, WmiDataId(6)] uint32 QueueState; - [ - read, WmiDataId(7)] MSNdis_GroupAffinity ProcessorAffinity; - [ - read, WmiDataId(8)] uint32 NumSuggestedReceiveBuffers; - [ - read, WmiDataId(9)] uint32 MSIXTableEntry; - [ - read, WmiDataId(10)] uint32 LookaheadSize; - [ - read, WmiDataId(11)] MSNdis_CountedString VmName; - [ - read, WmiDataId(12)] MSNdis_CountedString QueueName; -}; - -[WMI, - guid("{f786fbd8-c049-11dd-b885-001d09162bc3}")] -class MSNdis_ReceiveQueueInfoArray : MSNdis -{ - [read, WmiDataId(1)] MSNdis_ObjectHeader Header; - [ - read, WmiDataId(2)] uint32 FirstElementOffset; - [ - read, WmiDataId(3)] uint32 NumElements; - [ - read, WmiDataId(4)] uint32 ElementSize; - [ - read, WmiDataId(5), WmiSizeIs("NumElements")] MSNdis_ReceiveQueueInfo Queue[]; -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{ba1f4c14-a945-4762-b916-0b5515b6f43a}"), - - WmiExpense(1), - Description("NDIS Query Link State") : amended] -class MSNdis_LinkState : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Link State"):amended - ] void WmiQueryLinkState([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Link State of the adapter"):amended - ] MSNdis_LinkStateData LinkState); - -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{d9c8eea5-f16e-467c-84d5-6345a22ce213}"), - - WmiExpense(1), - Description("NDIS Query Interrupt Moderation") : amended] -class MSNdis_QueryInterruptModeration : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Interrupt Moderation"):amended - ] void WmiQueryInterruptModeration([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Interrupt Moderation of the adapter"):amended - ] MSNdis_InterruptModerationParameters InterruptModeration); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{d789adfa-9c56-433b-ad01-7574f3cedbe9}"), - - WmiExpense(1), - Description("NDIS Set Interrupt Moderation") : amended] -class MSNdis_SetInterruptModeration : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Set Interrupt Moderation"):amended - ] void WmiSetInterruptModeration([in, Description("NDIS WMI Common Method Header"):amended - ] MSNdis_WmiMethodHeader MethodHeader, - [in, Description("Interrupt Moderation Parameters to set"):amended - ] MSNdis_InterruptModerationParameters InterruptModeration, - [out, Description("Output from Setting Interrupt Moderation of the adapter"):amended - ] MSNdis_WmiOutputInfo OutputInfo); -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{8c7d3579-252b-4614-82c5-a650daa15049}"), - - WmiExpense(1), - Description("NDIS Set Link Parameters") : amended] -class MSNdis_SetLinkParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Set Link Parameters"):amended - ] void WmiSetLinkParameters([in, Description("NDIS WMI Common Method Header"):amended - ] MSNdis_WmiMethodHeader MethodHeader, - [in, Description("Link Parameters to set"):amended - ] MSNdis_LinkParameters LinkParameters, - [out, Description("Output from Setting Link Parameters of the adapter"):amended - ] MSNdis_WmiOutputInfo OutputInfo); -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{368c45b5-c129-43c1-939e-7edc2d7fe621}"), - - WmiExpense(1), - Description("NDIS Query Statistics Info") : amended] -class MSNdis_QueryStatisticsInfo : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Statistics Info"):amended - ] void WmiQueryStatisticsInfo([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Statistics Info of the adapter"):amended - ] MSNdis_StatisticsInfo StatisticsInfo); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{6fbf2a5f-8b8f-4920-8143-e6c460f52524}"), - - WmiExpense(1), - Description("NDIS Query Port State") : amended] -class MSNdis_QueryPortState : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Port State"):amended - ] void WmiQueryPortState([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Port State of a sub-Interface of the adapter"):amended - ] MSNdis_PortStateData PortState); - -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{f1d6abe8-15e4-4407-81b7-6b830c777cd9}"), - - WmiExpense(1), - Description("NDIS Query Ports on an Adapter") : amended] -class MSNdis_EnumeratePorts : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Ports on an Adapter"):amended - ] void WmiEnumeratePorts([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Ports activated on the adapter"):amended - ] MSNdis_PortArray Ports); - -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{aab6ac31-86fb-48fb-8b48-63db235ace16}"), - - WmiExpense(1), - Description("NDIS Set Port Auth Parameters on a Port") : amended] -class MSNdis_SetPortParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Set Port Auth Parameters on a Port"):amended - ] void WmiSetPortParameters([in, Description("NDIS WMI Common Method Header"):amended - ] MSNdis_WmiMethodHeader MethodHeader, - [in, Description("Set Port Auth Parameters on a Port"):amended - ] MSNdis_PortAuthParameters PortParameters, - [out, Description("Result from Setting Port Auth Parameters"):amended - ] MSNdis_WmiOutputInfo OutputInfo); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{aa39f5ab-e260-4d01-82b0-b737c880ea05}"), - - WmiExpense(1), - Description("NDIS Query PCI Device Custom Property") : amended] -class MSNdis_QueryPciDeviceCustomProperty : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query PCI Device Custom Property"):amended - ] void WmiQueryPciDeviceCustomProperty([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("PCI Device Custom Property of the adapter"):amended - ] MSNdis_PciDeviceProperty PciDeviceProperty); - -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{16716917-4306-4be4-9b5a-3809ae44b125}"), - - WmiExpense(1), - Description("NDIS Enumerate Adapter EX.") : amended] -class MSNdis_EnumerateAdapterEx : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The Information about the Adapter.") : amended, - WmiDataId(1)] MSNdis_WmiEnumAdapter EnumerateAdapter; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{68542fed-5c74-461e-8934-91c6f9c60960}"), - - WmiExpense(1), - Description("NDIS Query TCP Offload Current Config") : amended] -class MSNdis_TcpOffloadCurrentConfig : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Current Offload Configuration"):amended - ] void WmiQueryCurrentOffloadConfig([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Current Offload Configuration of the adapter"):amended - ] MSNdis_WmiOffload Offload); -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{cd5f1102-590f-4ada-ab65-5b31b1dc0172}"), - - WmiExpense(1), - Description("NDIS Query TCP Offload Hardware Config") : amended] -class MSNdis_TcpOffloadHardwareConfig : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Hardware Offload Configuration"):amended - ] void WmiQueryHardwareOffloadConfig([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Headware Offload Configuration of the adapter"):amended - ] MSNdis_WmiOffload Offload); -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{8ead9a22-7f69-4bc6-949a-c8187b074e61}"), - - WmiExpense(1), - Description("NDIS Set TCP Offload Parameters") : amended] -class MSNdis_SetTcpOffloadParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Set TCP Offload Parameters"):amended - ] void WmiSetTcpOffloadParameters([in, Description("NDIS WMI Common Method Header"):amended - ] MSNdis_WmiMethodHeader MethodHeader, - [in, Description("Set TCP Offload Parameters"):amended - ] MSNdis_TcpOffloadParameters TcpOffloadParameters, - [out, Description("Result from Setting TCP Offload Parameters"):amended - ] MSNdis_WmiOutputInfo OutputInfo); - -}; - - -[WMI, Dynamic, Provider("WMIProv"), guid("{2ee6aef1-0851-458b-bf0d-792343d1cde1}"), - - WmiExpense(1), - Description("NDIS Query TCP Connection Offload Current Config") : amended] -class MSNdis_TcpConnectionOffloadCurrentConfig : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query TCP Connection Offload Current Configuration"):amended - ] void WmiQueryTcpConnectionOffloadCurrentConfig( - [in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("TCP Connection Offload Current Configuration of the adapter"):amended - ] MSNdis_WmiTcpConnectionOffload Offload); -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{8ce71f2c-d63a-4390-a487-18fa47262ceb}"), - - WmiExpense(1), - Description("NDIS Query TCP Connection Offload Hardware Config") : amended] -class MSNdis_TcpConnectionOffloadHardwareConfig : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query TCP Connection Offload Hardware Configuration"):amended - ] void WmiQueryTcpConnectionOffloadHardwareConfig( - [in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("TCP Connection Offload Hardware Configuration of the adapter"):amended - ] MSNdis_WmiTcpConnectionOffload Offload); -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{26c28774-4252-48fe-a610-a58a398c0eb1}"), - - WmiExpense(1), - Description("NDIS Query RSS Capabilities") : amended] -class MSNdis_ReceiveScaleCapabilities : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query RSS Capabilities"):amended - ] void WmiQueryReceiveScaleCapabilities( - [in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("RSS capabilities of the adapter"):amended - ] MSNdis_WmiReceiveScaleCapabilities RssCaps); -}; - -// -// GUID_NDIS_HD_SPLIT_CURRENT_CONFIG -// - -[WMI, Dynamic, Provider("WMIProv"), guid("{81d1303c-ab00-4e49-80b1-5e6e0bf9be53}"), - - WmiExpense(1), - Description("NDIS Query Header/Data Split Current Config") : amended] -class MSNdis_HDSplitCurrentConfig : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Header/Data split Current Config"):amended - ] void WmiQueryHDSplitCurrentConfig( - [in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Header/Data split Current Config of the adapter"):amended - ] MSNdis_WmiHDSplitCurrentConfig HdSplitCurrentConfig); -}; - -// -// GUID_NDIS_HD_SPLIT_PARAMETERS -// - -[WMI, Dynamic, Provider("WMIProv"), guid("{8c048bea-2913-4458-b68e-17f6c1e5c60e}"), - - WmiExpense(1), - Description("NDIS Set Header/Data Split Parameters") : amended] -class MSNdis_SetHDSplitParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Set Header/Data split Parameters"):amended - ] void WmiSetHDSplitParameters([in, Description("NDIS WMI Common Method Header"):amended - ] MSNdis_WmiMethodHeader MethodHeader, - [in, Description("Set Header/Data Split Parameters"):amended - ] MSNdis_HDSplitParameters HDSplitParameters, - [out, Description("Result from Setting Header/ Split Parameters"):amended - ] MSNdis_WmiOutputInfo OutputInfo); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{899e7782-035b-43f9-8bb6-2b58971612e5}"), - - WmiExpense(1), - Description("NDIS Query Physical Medium Type Ex") : amended] -class MSNdis_QueryPhysicalMediumTypeEx : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query NDIS Physical Medium Type (Ex) of the NIC"):amended - ] void WmiQueryPhysicalMediumTypeEx([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Physical Medium type (Ex) of the adapter"):amended - ] uint32 NdisPhysicalMediumTypeEx); - -}; - -// -// Guids for NDIS Receive Filters -// -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c1419-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Query Receive Filter Hardware Capabilities") : amended] -class MSNdis_QueryReceiveFilterHardwareCapabilities : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Receive Filter Hardware capabilities"):amended - ] void WmiQueryReceiveFilterHardwareCapabilities([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Receive filter hardware capabilities of the adapter"):amended - ] MSNdis_ReceiveFilterCapabilities ReceiveFilterHardwareCapabilities); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c141a-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Query Receive Filter Global Parameters") : amended] -class MSNdis_QueryReceiveFilterGlobalParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Receive Filter Global Parameters"):amended - ] void WmiQueryReceiveFilterGlobalParameters([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Receive filter global parameters of the adapter"):amended - ] MSNdis_ReceiveFilterGlobalParameters ReceiveFilterGlobalParameters); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c141d-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Enumerate Receive Filters") : amended] -class MSNdis_EnumerateReceiveFilters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Enumerate Receive Filters"):amended - ] void WmiEnumReceiveFilters([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [in, out, Description("Enumeration of Receive Filters on a queue"):amended - ] MSNdis_ReceiveFilterInfoArray ReceiveFilterInfoArray); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c141e-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Receive Filter Parameters") : amended] -class MSNdis_QueryReceiveFilterParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Receive Filter Parameters"):amended - ] void WmiQueryReceiveFilterParameters([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [in, out, Description("Receive Filter Parameters"):amended - ] MSNdis_ReceiveFilterParameters ReceiveFilterParameters); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{4054e80f-2bc1-4ccc-b033-4abc0c4a1e8c}"), - - WmiExpense(1), - Description("NDIS Query Receive Filter Current Capabilities") : amended] -class MSNdis_QueryReceiveFilterCurrentCapabilities : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Receive Filter Current capabilities"):amended - ] void WmiQueryReceiveFilterCurrentCapabilities([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("Receive filter current capabilities of the adapter"):amended - ] MSNdis_ReceiveFilterCapabilities ReceiveFilterCurrentCapabilities); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{37cab40c-d1e8-4301-8c1d-58465e0c4c0f}"), - - WmiExpense(1), - Description("NDIS Query NIC Switch Hardware Capabilities") : amended] -class MSNdis_QueryNicSwitchHardwareCapabilities : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query NIC Switch Hardware Capabilities"):amended - ] void WmiQueryNICSwitchHardwareCapabilities([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("NIC Switch hardware capabilities of the adapter"):amended - ] MSNdis_NicSwitchCapabilities NicSwitchHardwareCapabilities); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{e76fdaf3-0be7-4d95-87e9-5aead4b590e9}"), - - WmiExpense(1), - Description("NDIS Query NIC Switch Current Capabilities") : amended] -class MSNdis_QueryNicSwitchCurrentCapabilities : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query NIC Switch Current Capabilities"):amended - ] void WmiQueryNICSwitchCurrentCapabilities([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [out, Description("NIC Switch Current capabilities of the adapter"):amended - ] MSNdis_NicSwitchCapabilities NicSwitchCurrentCapabilities); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c141c-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Receive Queue Parameters") : amended] -class MSNdis_QueryReceiveQueueParameters : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Query Receive Queue Parameters"):amended - ] void WmiQueryReceiveQueueParameters([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [in, out, Description("Receive Queue Parameters"):amended - ] MSNdis_ReceiveQueueParameters ReceiveQueueParameters); - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3f2c141b-83bc-11dd-94b8-001d09162bc3}"), - - WmiExpense(1), - Description("NDIS Enumerate Receive Queues") : amended] -class MSNdis_EnumerateReceiveQueues : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [WmiMethodId(1), - Implemented, - Description("Enumerate Receive Queues"):amended - ] void WmiEnumReceiveQueues([in, Description("NDIS WMI Method Common Header"):amended - ] MSNdis_WmiMethodHeader Header, - [in, out, Description("Enumeration of Receive queues on a miniport"):amended - ] MSNdis_ReceiveQueueInfoArray ReceiveQueueInfoArray); - -}; - - - -/// -/// -/// Wireless (802.11) specific GUIDs -/// - -/// -/// OID_802_11_BSSID: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{2504b6c2-1fa5-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Base Service Set Identifier: the MAC address of the associated access point. Writing this is useful when doing a site survey.") : amended] -class MSNdis_80211_BaseServiceSetIdentifier : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 access point MAC address.") : amended, - WmiDataId(1)] uint8 Ndis80211MacAddress[6]; -}; - - -/// -/// OID_802_11_SSID: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{7d2a90ea-2041-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Service Set Identifier string that identifies a set of interconnected basic service sets. This is a NULL terminated ANSI string up to 32 characters long.") : amended] -class MSNdis_80211_ServiceSetIdentifier : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("SSID string") : amended, - WmiDataId(1)] uint8 Ndis80211SsId[33]; -}; - - -/// -/// Embedded class definition for _NDIS_802_11_NETWORK_TYPE. -/// -[WMI, guid("{e779ab61-b9ab-11d4-b675-002048570337}")] -class MSNdis_80211_NetworkType : MSNdis -{ - [ - Description("NDIS 802.11 network type") : amended, - Values{"Ndis802_11FH", - "Ndis802_11DS"} : amended, - ValueMap{"0", - "1"}, - WmiDataId(1)] uint32 Ndis80211NetworkType; -}; - -/// -/// OID_802_11_NETWORK_TYPES_SUPPORTED: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{8531d6e6-2041-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 supported network types") : amended] -class MSNdis_80211_NetworkTypesSupported : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of items in list of 802.11 network types") : amended, - WmiDataId(1)] uint32 NumberOfItems; - [ - read, - Description("List of NDIS 802.11 network types") : amended, - WmiDataId(2), - WmiSizeIs("NumberOfItems")] - MSNdis_80211_NetworkType Ndis80211NetworkTypes[]; -}; - - -/// -/// OID_802_11_NETWORK_TYPE_IN_USE: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{857e2326-2041-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 network type in use determines whether the station uses Frequency Hopping Spread Spectrum or Direct Sequence Spread Spectrum.") : amended] -class MSNdis_80211_NetworkTypeInUse : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 network type") : amended, - WmiDataId(1)] - MSNdis_80211_NetworkType Ndis80211NetworkTypeInUse; -}; - - -/// -/// OID_802_11_POWER_MODE: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{85be837c-2041-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Power Mode") : amended] -class MSNdis_80211_PowerMode : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The current 802.11 power mode") : amended, - Values{"Ndis802_11PowerModeCAM", - "Ndis802_11PowerModeMAX_PSP", - "Ndis802_11PowerModeFast_PSP"} : amended, - ValueMap{"0", - "1", - "2"}, - WmiDataId(1)] uint32 Ndis80211PowerMode; -}; - - -/// -/// OID_802_11_TX_POWER_LEVEL: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{11e6ba76-2053-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Transmit power level") : amended] -class MSNdis_80211_TransmitPowerLevel : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 transmit power level in mW") : amended, - WmiDataId(1)] uint32 Ndis80211TransmitPowerLevel; -}; - - -/// -/// OID_802_11_RSSI: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{1507db16-2053-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Received Signal Strength Indication") : amended] -class MSNdis_80211_ReceivedSignalStrength : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 received signal strength in dBm") : amended, - WmiDataId(1)] sint32 Ndis80211ReceivedSignalStrength; -}; - - -/// -/// OID_802_11_RSSI_TRIGGER: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{155689b8-2053-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Received Signal Strength Indication event trigger. An event of class MSNdis_80211_ReceivedSignalStrengthEvent is generated when the current RSSI goes past the trigger value.") : amended] -class MSNdis_80211_ReceivedSignalStrengthEventTrigger : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 RSSI trigger value in dBm") : amended, - WmiDataId(1)] sint32 Ndis80211ReceivedSignalStrengthTrigger; -}; - - -/// -/// Embedded class definition for _NDIS_802_11_NETWORK_INFRASTRUCTURE. -/// -[WMI, guid("{34e1fa48-b9b6-11d4-b675-002048570337}")] -class MSNdis_80211_NetworkInfrastructure : MSNdis -{ - [ - Description("The 802.11 infrastructure mode") : amended, - Values{"Ndis802_11IBSS", - "Ndis802_11Infrastructure", - "Ndis802_11AutoUnknown"}, - ValueMap{"0", - "1", - "2"}, - WmiDataId(1)] uint32 Ndis80211NetworkInfrastructure; -}; - - -/// -/// -/// Embedded class definition for _NDIS_802_11_CONFIGURATION_FH. -/// This is used with MSNdis_80211_Configuration (below). -/// -/// -[WMI, guid("{4a800b8c-2068-11d4-97eb-00c04f79c403}")] -class MSNdis_80211_ConfigurationFH : MSNdis -{ - [ - WmiDataId(1)] uint32 FHLength; - [ - WmiDataId(2)] uint32 HopPattern; - [ - WmiDataId(3)] uint32 HopSet; - [ - WmiDataId(4)] uint32 DwellTime; -}; - - -/// -/// -/// Embedded class definition for _NDIS_802_11_CONFIGURATION. This -/// is used with OID_802_11_CONFIGURATION and OID_802_11_BSSID_LIST. -/// -/// -[WMI, guid("{220c16fc-b9a8-11d4-b675-002048570337}")] -class MSNdis_80211_ConfigurationInfo : MSNdis -{ - [ - Description("Length of configuration structure") : amended, - WmiDataId(1)] uint32 ConfigLength; - [ - Description("Beacon period in Kusec") : amended, - WmiDataId(2)] uint32 BeaconPeriod; - [ - Description("Announcement Traffic Indication Message (ATIM) Window in Kusec") : amended, - WmiDataId(3)] uint32 ATIMWindow; - [ - Description("Frequency in kHz") : amended, - WmiDataId(4)] uint32 DSConfig; - [ - Description("Radio configuration parameters") : amended, - WmiDataId(5)] MSNdis_80211_ConfigurationFH FHConfig; -}; - - -/// -/// -/// Embedded class definition for _NDIS_WLAN_BSSID. This is used in -/// OID_802_11_BSSID_LIST (below). -/// -/// -[WMI, guid("{6929e718-2062-11d4-97eb-00c04f79c403}")] -class MSNdis_80211_WLanBssId : MSNdis -{ - [ - WmiDataId(1)] uint32 Ndis80211WLanBssIdLength; - [ - WmiDataId(2)] uint8 Ndis80211MacAddress[6]; - [ - WmiDataId(3)] uint16 Reserved; - [ - WmiDataId(4)] uint32 Ndis80211SsIdLength; - [ - WmiDataId(5)] uint8 Ndis80211SsId[32]; - [ - WmiDataId(6)] uint32 Ndis80211Privacy; - [ - WmiDataId(7)] uint32 Ndis80211Rssi; - [ - WmiDataId(8)] MSNdis_80211_NetworkType Ndis80211NetworkTypeInUse; - [ - WmiDataId(9)] MSNdis_80211_ConfigurationInfo Ndis80211Configuration; - [ - WmiDataId(10)] MSNdis_80211_NetworkInfrastructure Ndis80211InfrastructureMode; - [ - WmiDataId(11)] uint8 Ndis80211SupportedRate[8]; -}; - - -/// -/// OID_802_11_BSSID_LIST: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{69526f9a-2062-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Base Service Set Identifier list. This is a list of all BSSID in range, their SSID and RSSI.") : amended] -class MSNdis_80211_BSSIList : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of items in list of 802.11 BSSI") : amended, - WmiDataId(1)] uint32 NumberOfItems; - [ - read, - Description("The list of in-range BSSIDs and their properties") : amended, - WmiDataId(2), - WmiSizeIs("NumberOfItems")] - MSNdis_80211_WLanBssId Ndis80211BSSIList[]; -}; - - -/// -/// OID_802_11_INFRASTRUCTURE_MODE: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{697d5a7e-2062-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Infrastructure mode - defines how the device connects to the network.") : amended] -class MSNdis_80211_InfrastructureMode : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - WmiDataId(1)] MSNdis_80211_NetworkInfrastructure Ndis80211InfrastructureMode; -}; - - -/// -/// OID_802_11_FRAGMENTATION_THRESHOLD: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{69aaa7c4-2062-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("The size beyond which the 802.11 device should fragment packets") : amended] -class MSNdis_80211_FragmentationThreshold : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 fragmentation threshold in bytes") : amended, - WmiDataId(1)] uint32 Ndis80211FragmentationThreshold; -}; - - - -/// -/// OID_802_11_RTS_THRESHOLD: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{0134d07e-2064-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("The size beyond which the 802.11 device should invoke the RTS/CTS mechanism") : amended] -class MSNdis_80211_RTSThreshold : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The 802.11 RTS threshold, in bytes") : amended, - WmiDataId(1)] uint32 Ndis80211RTSThreshold; -}; - - -/// -/// OID_802_11_NUMBER_OF_ANTENNAS: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{01779336-2064-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("The number of antennas on the 802.11 radio.") : amended] -class MSNdis_80211_NumberOfAntennas : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The number of antennas") : amended, - WmiDataId(1)] uint32 Ndis80211NumberOfAntennas; -}; - - -/// -/// OID_802_11_RX_ANTENNA_SELECTED: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{01ac07a2-2064-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("The antenna selected for receiving on the radio of the 802.11 device") : amended] -class MSNdis_80211_ReceiveAntennaSelected : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The receive antenna number") : amended, - WmiDataId(1)] uint32 Ndis80211ReceiveAntennaSelected; -}; - - - -/// -/// OID_802_11_TX_ANTENNA_SELECTED: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{01dbb74a-2064-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("The antenna selected for transmitting on the radio of the 802.11 device") : amended] -class MSNdis_80211_TransmitAntennaSelected : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("The transmit antenna number") : amended, - WmiDataId(1)] uint32 Ndis80211TransmitAntennaSelected; -}; - - -/// -/// OID_802_11_SUPPORTED_RATES -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{49db8722-2068-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("A set of supported NDIS 802.11 data rates in the operational rate set that the radio is capable of running at.") : amended] -class MSNdis_80211_DataRates : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - [ - read, - Description("The list of data rates, in units of 0.5 Mbps") : amended, - WmiDataId(1)] uint8 Ndis80211DataRate[8]; -}; - - -/// -/// OID_802_11_DESIRED_RATES: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{452ee08e-2536-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 data rates that are desirable for the radio to operate in.") : amended] -class MSNdis_80211_DesiredDataRates : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - [ - read, - Description("The list of desired data rates, in units of 0.5 Mbps") : amended, - WmiDataId(1)] uint8 Ndis80211DesiredRate[8]; -}; - -/// -/// OID_802_11_CONFIGURATION: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{4a4df982-2068-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 device radio configuration parameters") : amended] -class MSNdis_80211_Configuration : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - WmiDataId(1)] MSNdis_80211_ConfigurationInfo Ndis80211Config; -}; - - -/// -/// OID_802_11_STATISTICS: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{42bb73b0-2129-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 device statistics") : amended] -class MSNdis_80211_Statistics : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Length of the statistics structure") : amended, - WmiDataId(1)] uint32 StatisticsLength; - [ - read, - Description("Number of transmitted fragments") : amended, - WmiDataId(2)] uint64 TransmittedFragmentCount; - [ - read, - Description("Number of transmitted multicast frames") : amended, - WmiDataId(3)] uint64 MulticastTransmittedFrameCount; - [ - read, - Description("Number of failures") : amended, - WmiDataId(4)] uint64 FailedCount; - [ - read, - Description("Number of retries") : amended, - WmiDataId(5)] uint64 RetryCount; - [ - read, - Description("Number of multiple retries") : amended, - WmiDataId(6)] uint64 MultipleRetryCount; - [ - read, - Description("Number of Request To Send success") : amended, - WmiDataId(7)] uint64 RTSSuccessCount; - [ - read, - Description("Number of Request To Send failures") : amended, - WmiDataId(8)] uint64 RTSFailureCount; - [ - read, - Description("Number of Acknowledgement failures") : amended, - WmiDataId(9)] uint64 ACKFailureCount; - [ - read, - Description("Number of duplicate frames") : amended, - WmiDataId(10)] uint64 FrameDuplicateCount; - [ - read, - Description("Number of received fragments") : amended, - WmiDataId(11)] uint64 ReceivedFragmentCount; - [ - read, - Description("Number of received multicast frames") : amended, - WmiDataId(12)] uint64 MulticastReceivedFrameCount; - [ - read, - Description("Number of frame checksum errors") : amended, - WmiDataId(13)] uint64 FCSErrorCount; -}; - - -/// -/// OID_802_11_ADD_WEP: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{4307bff0-2129-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("Set a WEP key to the NDIS 802.11 device") : amended] -class MSNdis_80211_AddWEP : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - write, - Description("Length of 802.11 WEP structure") : amended, - WmiDataId(1)] uint32 Length; - [ - write, - Description("WEP key index") : amended, - WmiDataId(2)] uint32 KeyIndex; - [ - write, - Description("WEP key length in bytes") : amended, - WmiDataId(3)] uint32 KeyLength; - [ - write, - Description("WEP key index") : amended, - WmiDataId(4), WmiSizeIs("KeyLength")] - uint8 KeyMaterial[]; -}; - - -/// -/// OID_802_11_REMOVE_WEP: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{433c345c-2129-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("Remove a WEP key on the NDIS 802.11 device") : amended] -class MSNdis_80211_RemoveWEP : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - write, - Description("The NDIS 802.11 WEP key index") : amended, - WmiDataId(1)] uint32 Ndis80211KeyIndex; -}; - - -/// -/// OID_802_11_DISASSOCIATE: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{43671f40-2129-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("Disassociate the NDIS 802.11 device with the current SSID") : amended] -class MSNdis_80211_Disassociate : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - [ - write, - Description("Unused parameter") : amended, - WmiDataId(1)] uint32 UnusedParameter; -}; - - -/// -/// OID_802_11_BSSID_LIST_SCAN: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{0d9e01e1-ba70-11d4-b675-002048570337}"), - - WmiExpense(1), - Description("Perform a survey to refresh the NDIS 802.11 BSS list") : amended] -class MSNdis_80211_BssIdListScan : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - [ - write, - Description("Unused parameter") : amended, - WmiDataId(1)] uint32 UnusedParameter; -}; - - - -/// -/// OID_802_11_AUTHENTICATION_MODE: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{43920a24-2129-11d4-97eb-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Authentication Mode") : amended] -class MSNdis_80211_AuthenticationMode : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("NDIS 802.11 authentication mode setting") : amended, - Values{"Ndis802_11AuthModeOpen", - "Ndis802_11AuthModeShared", - "Ndis802_11AuthModeAutoSwitch"}, - ValueMap{"0", - "1", - "2"}, - WmiDataId(1)] uint32 Ndis80211AuthenticationMode; -}; - - -/// -/// OID_802_11_PRIVACY_FILTER: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{6733c4e9-4792-11d4-97f1-00c04f79c403}"), - - WmiExpense(1), - Description("NDIS 802.11 Privacy Filter") : amended] -class MSNdis_80211_PrivacyFilter : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("NDIS 802.11 privacy filter setting") : amended, - Values{"Ndis802_11PrivFilterAcceptAll", - "Ndis802_11PrivFilter8021xWEP"}, - ValueMap{"0", - "1"}, - WmiDataId(1)] uint32 Ndis80211PrivacyFilter; -}; - - - -/// -/// OID_802_11_WEP_STATUS: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{b027a21f-3cfa-4125-800b-3f7a18fddcdc}"), - - WmiExpense(1), - Description("NDIS 802.11 WEP Status") : amended] -class MSNdis_80211_WEPStatus : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("NDIS 802.11 WEP Status setting") : amended, - Values{"Ndis802_11WEPEnabled", - "Ndis802_11WEPDisabled", - "Ndis802_11WEPKeyAbsent", - "Ndis802_11WEPNotSupported"}, - ValueMap{"0", - "1", - "2", - "3"}, - WmiDataId(1)] uint32 Ndis80211WEPStatus; -}; - - -/// -/// OID_802_11_RELOAD_DEFAULTS: -/// -[WMI, Dynamic, Provider("WMIProv"), guid("{748b14e8-32ee-4425-b91b-c9848c58b55a}"), - - WmiExpense(1), - Description("NDIS 802.11 Reload Default Settings") : amended] -class MSNdis_80211_ReloadDefaults : MSNdis -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - write, - Description("The parameter(s) to be reloaded to default settings") : amended, - Values{"Ndis802_11ReloadWEPKeys"} : amended, - ValueMap{"0"}, - WmiDataId(1)] uint32 Ndis80211ReloadDefaults; -}; - - -/// -/// Embedded class definition for NDIS_PM_ADMIN_CONFIG_STATE -/// -[WMI, guid("{0cffd0fc-8333-4000-9a3b-200735d698f9}")] -class MSNdis_PMAdminConfigState : MSNdis -{ - [Values{"NdisPMAdminConfigStateUnspecified", - "NdisPMAdminConfigStateDisabled", - "NdisPMAdminConfigStateEnabled"}, - ValueMap{"0", - "1", - "2"}, - WmiDataId(1)] - uint32 NdisPMAdminConfigState; -}; - -/// -/// Embedded class definition for NDIS_WMI_PM_ADMIN_CONFIG -/// -[WMI, guid("{492dc449-13d9-4bd6-89d4-96e3534e6a05}")] -class MSNdis_PMAdminConfigParam : MSNdis -{ - [WmiDataId(1)] - MSNdis_ObjectHeader Header; - [WmiDataId(2)] - MSNdis_PMAdminConfigState WakeOnPattern; - [WmiDataId(3)] - MSNdis_PMAdminConfigState WakeOnMagicPacket; - [WmiDataId(4)] - MSNdis_PMAdminConfigState DeviceSleepOnDisconnect; - [WmiDataId(5)] - MSNdis_PMAdminConfigState PMARPOffload; - [WmiDataId(6)] - MSNdis_PMAdminConfigState PMNDOffload; - [WmiDataId(7)] - MSNdis_PMAdminConfigState PMWiFiRekeyOffload; -}; - -/// -/// GUID_NDIS_PM_ADMIN_CONFIG -/// -[WMI, Dynamic, Provider("WMIProv"), - guid("{1528D111-708A-4ca4-9215-C05771161CDA}"), - Description("Control power management related standardized keywords")] -class MSNdis_PMAdminConfig : MSNdis -{ - [key, read] - string InstanceName; - [read] - boolean Active; - - [read, write, WmiDataId(1)] - MSNdis_PMAdminConfigParam PMAdminConfigParam; -}; - -/// -/// Embedded class definition for NDIS_PM_CAPABILITY_STATE -/// -[WMI, guid("{C1CC6857-1A26-4f6d-AB98-291F0C3BBD4C}")] -class MSNdis_PMCapabilityState : MSNdis -{ - [Values{"NdisPMAdminConfigUnsupported", - "NdisPMAdminConfigInactive", - "NdisPMAdminConfigActive"}, - ValueMap{"0", - "1", - "2"}, - WmiDataId(1)] - uint32 NdisPMCapabilityState; -}; - -/// -/// Embedded class definition for NDIS_WMI_PM_ACTIVE_CAPABILITIES -/// -[WMI, guid("{CCCB122D-D5C4-4ee1-8001-B8AD6D3CE876}")] -class MSNdis_PMCapabilitiesParam : MSNdis -{ - [WmiDataId(1)] - MSNdis_ObjectHeader Header; - [WmiDataId(2)] - MSNdis_PMCapabilityState WakeOnPattern; - [WmiDataId(3)] - MSNdis_PMCapabilityState WakeOnMagicPacket; - [WmiDataId(4)] - MSNdis_PMCapabilityState DeviceSleepOnDisconnect; - [WmiDataId(5)] - MSNdis_PMCapabilityState PMARPOffload; - [WmiDataId(6)] - MSNdis_PMCapabilityState PMNDOffload; - [WmiDataId(7)] - MSNdis_PMCapabilityState PMWiFiRekeyOffload; -}; - -/// -/// GUID_NDIS_PM_ACTIVE_CAPABILITIES -/// -[WMI, Dynamic, Provider("WMIProv"), - guid("{B2CF76E3-B3AE-4394-A01F-338C9870E939}"), - Description("Query power management active capabilities")] -class MSNdis_PMCapabilities : MSNdis -{ - [key, read] - string InstanceName; - [read] - boolean Active; - - [read, WmiDataId(1)] - MSNdis_PMCapabilitiesParam PMCapabilitiesParam; -}; - - -/// -/// -/// NDIS status specific GUIDs -/// -/// - - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d76-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Reset Start") : amended] -class MSNdis_StatusResetStart : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d77-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Reset End") : amended] -class MSNdis_StatusResetEnd : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d7d-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Media Connect") : amended] -class MSNdis_StatusMediaConnect : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d7e-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Media Disconnect") : amended] -class MSNdis_StatusMediaDisconnect : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d84-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Media Specific Indication") : amended] -class MSNdis_StatusMediaSpecificIndication : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for media specific status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Media specific status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusMediaSpecificIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{981f2d85-b1f3-11d0-8dd7-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Status Link Speed Change") : amended] -class MSNdis_StatusLinkSpeedChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("New inbound and outbound link speeds for the adapter.") : amended, - WmiDataId(1)] MSNdis_NetworkLinkSpeed NdisStatusLinkSpeedChange; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{5413531c-b1f3-11d0-d78d-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Protocol Bind Notification") : amended] -class MSNdis_StatusProtocolBind : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of transport bound") : amended, - WmiDataId(1)] string Transport; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{6e3ce1ec-b1f3-11d0-d78d-00c04fc3358c}"), - - WmiExpense(1), - Description("NDIS Protocol Unbind Notification") : amended] -class MSNdis_StatusProtocolUnbind : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of transport unbound") : amended, - WmiDataId(1)] string Transport; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{5f81cfd0-f046-4342-61af-895acedaefd9}"), - - WmiExpense(1), - Description("NDIS Device Power On Notification") : amended] -class MSNdis_StatusDevicePowerOn : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of device powered on") : amended, - WmiDataId(1)] string Device; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{81bc8189-b026-46ab-64b9-f182e342934e}"), - - WmiExpense(1), - Description("NDIS Device Power Off Notification") : amended] -class MSNdis_StatusDevicePowerOff : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of device powered off") : amended, - WmiDataId(1)] string Device; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{2b440188-92ac-4f60-9b2d-20a30cbb6bbe}"), - - WmiExpense(1), - Description("NDIS Device Power On Ex Notification") : amended] -class MSNdis_StatusDevicePowerOnEx : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of device powered on") : amended, - WmiDataId(1)] string Device; -}; - -[WMI, Dynamic, Provider("WMIProv"), - guid("{4159353c-5cd7-42ce-8fe4-a45a2380cc4f}"), - - WmiExpense(1), - Description("NDIS Device Power Off Ex Notification") : amended] -class MSNdis_StatusDevicePowerOffEx : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Name of device powered off") : amended, - WmiDataId(1)] string Device; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{45049fc6-54d8-40c8-9c3d-b011c4e715bc}"), - - WmiExpense(1), - Description("NDIS Status Task Offload Change") : amended] -class MSNdis_StatusTaskOffloadChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for task offload change indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("New Task Offload Capabilities.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 TaskOffloadCapabilities[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{d47c5407-2e75-46dd-8146-1d7ed2d6ab1d}"), - - WmiExpense(1), - Description("NDIS Status Packet Filter Change") : amended] -class MSNdis_StatusPacketFilterChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - - [ - read, - Description("Number of bytes for packet filter status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Packet Filter status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisPacketFilterStatusIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{ca8a56f9-ce81-40e6-a70f-a067a476e9e9}"), - - WmiExpense(1), - Description("NDIS Status Network Change") : amended] -class MSNdis_StatusNetworkChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - [ - read, - Description("Number of bytes for network change status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Network Change status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisNetworkChangeStatusIndication[]; - -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{f917b663-845e-4d3d-b6d4-15eb27af81c5}"), - - WmiExpense(1), - Description("NDIS Status Operational Status") : amended] -class MSNdis_StatusOperationalStatus : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for operational status status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Operational Status status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisOperationalStatusStatusIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{64c6f797-878c-4311-9246-65dba89c3a61}"), - - WmiExpense(1), - Description("NDIS Status Link State Change") : amended] -class MSNdis_StatusLinkState : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for link state status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Link State status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisLinkStateStatusIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{1dac0dfe-43e5-44b7-b759-7bf46de32e81}"), - - WmiExpense(1), - Description("NDIS Status Port State Change") : amended] -class MSNdis_StatusPortState : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for port state status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Port State status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisPortStateStatusIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{aaacfca7-954a-4632-a16e-a8a63793a9e5}"), - - WmiExpense(1), - Description("NDIS 6 Status Media Specific Status Indication") : amended] -class MSNdis_StatusMediaSpecificIndicationEx : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for media specific status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Media Specific status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusMediaSpecificIndication[]; -}; - -// -// GUID_NDIS_STATUS_HD_SPLIT_CURRENT_CONFIG -// - -[WMI, Dynamic, Provider("WMIProv"), guid("{6c744b0e-ee9c-4205-90a2-015f6d65f403}"), - - WmiExpense(1), - Description("NDIS Status Header/Data Split Current Config") : amended] -class MSNdis_StatusHDSplitCurrentConfig : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for header/data split current config change indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("New Header/Data split configuration.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 HDSplitCurrentConfig[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{8500591e-a0c7-4efb-9342-b674b002cbe6}"), - WmiExpense(1), - Description("NDIS Dot11 Scan Confirm Status Indication") : amended] -class MSNdis_StatusDot11ScanConfirm : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 scan confirm status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Scan Confirm status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11ScanConfirmIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{1d6560ec-8e48-4a3e-9fd5-a01b698db6c5}"), - WmiExpense(1), - Description("NDIS Dot11 MPDU Max Length Change Status Indication") : amended] -class MSNdis_StatusDot11MPDUMaxLengthChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 MPDU max length change status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 MPDU Max Length Change status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11MPDUMaxLengthChangeIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3927843b-6980-4b48-b15b-4de50977ac40}"), - WmiExpense(1), - Description("NDIS Dot11 Association Start Status Indication") : amended] -class MSNdis_StatusDot11AssociationStart : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 association start status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Association Start status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11AssociationStartIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{458bbea7-45a4-4ae2-b176-e51f96fc0568}"), - WmiExpense(1), - Description("NDIS Dot11 Association Completion Status Indication") : amended] -class MSNdis_StatusDot11AssociationCompletion : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 association completion status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Association Completion status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11AssociationCompletionIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{7b74299d-998f-4454-ad08-c5af28576d1b}"), - WmiExpense(1), - Description("NDIS Dot11 Connection Start Status Indication") : amended] -class MSNdis_StatusDot11ConnectionStart : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 connection start status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Connection Start status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11ConnectionStartIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{96efd9c9-7f1b-4a89-bc04-3e9e271765f1}"), - WmiExpense(1), - Description("NDIS Dot11 Connection Completion Status Indication") : amended] -class MSNdis_StatusDot11ConnectionCompletion : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 connection completion status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Connection Completion status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11ConnectionCompletionIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{b2412d0d-26c8-4f4e-93df-f7b705a0b433}"), - WmiExpense(1), - Description("NDIS Dot11 Roaming Start Status Indication") : amended] -class MSNdis_StatusDot11RoamingStart : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 roaming start status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Roaming Start status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11RoamingStartIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{dd9d47d1-282b-41e4-b924-66368817fcd3}"), - WmiExpense(1), - Description("NDIS Dot11 Roaming Completion Status Indication") : amended] -class MSNdis_StatusDot11RoamingCompletion : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 roaming completion status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Roaming Completion status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11RoamingCompletionIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{3fbeb6fc-0fe2-43fd-b2ad-bd99b5f93e13}"), - WmiExpense(1), - Description("NDIS Dot11 Disassociation Status Indication") : amended] -class MSNdis_StatusDot11Disassociation : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 disassociation status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Disassociation status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11DisassociationIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{442c2ae4-9bc5-4b90-a889-455ef220f4ee}"), - WmiExpense(1), - Description("NDIS Dot11 TKIPMIC Failure Status Indication") : amended] -class MSNdis_StatusDot11TkipmicFailure : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 TKIPMIC Failure status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 TKIPMIC Failure status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11TkipmicFailureIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{26d8b8f6-db82-49eb-8bf3-4c130ef06950}"), - WmiExpense(1), - Description("NDIS Dot11 PMKID Candidate List Status Indication") : amended] -class MSNdis_StatusDot11PmkidCandidateList : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 PMKID candidate list status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 PMKID Candidate List status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11PmkidCandidateListIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{deb45316-71b5-4736-bdef-0a9e9f4e62dc}"), - WmiExpense(1), - Description("NDIS Dot11 Phy State Change Status Indication") : amended] -class MSNdis_StatusDot11PhyStateChange : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 Phy State change status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Phy State Change status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11PhyStateChangeIndication[]; -}; - -[WMI, Dynamic, Provider("WMIProv"), guid("{a3285184-ea99-48ed-825e-a426b11c2754}"), - WmiExpense(1), - Description("NDIS Dot11 Link Quality Status Indication") : amended] -class MSNdis_StatusDot11LinkQuality : WMIEvent -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [ - read, - Description("Number of bytes for dot11 link quality status indication") : amended, - WmiDataId(1)] uint32 NumberElements; - [read, - Description("Dot11 Link Quality status information.") : amended, - WmiDataId(2), WmiSizeIs("NumberElements")] uint8 NdisStatusDot11LinkQualityIndication[]; -}; - - -// -// Keyboard and Mouse - -[abstract] -class MSKeyboard -{ -}; - -class MSMouse -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Keyboard port driver information") : amended, - guid("{4731F89A-71CB-11d1-A52C-00A0C9062910}"), - GuidName1("KEYBOARD_PORT_WMI_STD_DATA_GUID"), - HeaderName("KEYBOARD_PORT_WMI_STD_DATA"), - DisplayName("Keyboard Port Information") : amended - ] -class MSKeyboard_PortInformation : MSKeyboard -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Connector Type") : amended, - WmiDataId(1), - read, - Values{"I8042 Connector" - "Serial Connector", - "USB Connector" } : amended, - ValueMap{"0", - "1", - "2" }, - DefineValues{"KEYBOARD_PORT_WMI_STD_I8042", - "KEYBOARD_PORT_WMI_STD_SERIAL", - "KEYBOARD_PORT_WMI_STD_USB"}, - Description("How the keyboard is connected to the computer") : amended] - uint32 ConnectorType; - - [DisplayName("Data Queue Size") : amended, - WmiDataId(2), - read, - Description("The DataQueueSize property indicates the size of the data queue.") : amended] - uint32 DataQueueSize; - - [DisplayName("Error Count") : amended, - WmiDataId(3), - read, - Description("Number of errors that occurred on this device") : amended] - uint32 ErrorCount; - - [DisplayName("Number of Function Keys") : amended, - WmiDataId(4), - read, - Description("The NumberOfFunctionKeys property indicates the number of function keys on the keyboard.") : amended] - uint32 FunctionKeys; - - [DisplayName("Number of Indicators") : amended, - WmiDataId(5), - read, - Description("The NumberOfIndicators property indicates the number of indicator leds on the keyboard.") : amended] - uint32 Indicators; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Keyboard port extended ID") : amended, - guid("{6ac4e23d-a950-4518-8b2b-aa4dcd5fe14a}"), - GuidName1("KEYBOARD_PORT_WMI_EXTENDED_ID"), - HeaderName("KEYBOARD_ID_EX"), - DisplayName("Keyboard Extended ID Information") : amended - ] -class MSKeyboard_ExtendedID : MSKeyboard -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Extended Type") : amended, - WmiDataId(1), - read, - Description("The Extended Type property indicates a 32 bit type identifier for the keyboard.") : amended] - uint32 Type; - - [DisplayName("Extended Subtype") : amended, - WmiDataId(2), - read, - Description("The Extended Type property indicates a 32 bit subtype identifier for the keyboard.") : amended] - uint32 Subtype; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Mouse port driver information") : amended, - guid("{4731F89C-71CB-11d1-A52C-00A0C9062910}"), - GuidName1("POINTER_PORT_WMI_STD_DATA_GUID"), - HeaderName("POINTER_PORT_WMI_STD_DATA"), - DisplayName("Mouse Port Information") : amended - ] -class MSMouse_PortInformation : MSMouse -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Connector Type") : amended, - WmiDataId(1), - read, - Values{"I8042 Connector" - "Serial Connector", - "USB Connector" } : amended, - ValueMap{"0", - "1", - "2" }, - DefineValues{"POINTER_PORT_WMI_STD_I8042", - "POINTER_PORT_WMI_STD_SERIAL", - "POINTER_PORT_WMI_STD_USB"}, - Description("How the mouse is connected to the computer") : amended] - uint32 ConnectorType; - - [DisplayName("Data Queue Size") : amended, - WmiDataId(2), - read, - Description("The DataQueueSize property indicates the size of the data queue.") : amended] - uint32 DataQueueSize; - - [DisplayName("Error Count") : amended, - WmiDataId(3), - read, - Description("Number of errors that occurred on this device") : amended] - uint32 ErrorCount; - - [DisplayName("Number of Buttons") : amended, - WmiDataId(4), - read, - Description("The NumberOfButtons property indicates the number of buttons on the pointing device.") : amended] - uint32 Buttons; - - [DisplayName("Hardware Type") : amended, - WmiDataId(5), - read, - Values{"Standard Mouse", - "Standard Pointer", - "Standard Absolute Pointer", - "Tablet", - "Touch Screen", - "Pen", - "Track Ball", - "Other"} : amended, - ValueMap{"0", - "1", - "2", - "3", - "4", - "5", - "6", - "256"}, - DefineValues{"POINTER_PORT_WMI_STD_MOUSE", - "POINTER_PORT_WMI_STD_POINTER", - "POINTER_PORT_WMI_ABSOLUTE_POINTER", - "POINTER_PORT_WMI_TABLET", - "POINTER_PORT_WMI_TOUCH_SCRENE", - "POINTER_PORT_WMI_PEN", - "POINTER_PORT_WMI_TRACK_BALL", - "POINTER_PORT_WMI_OTHER"}, - Description("The HardwareType property indicates the hardware type of the pointing device.") : amended] - uint32 HardwareType; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Mouse class driver information") : amended, - guid("{4731F89B-71CB-11d1-A52C-00A0C9062910}") - ] -class MSMouse_ClassInformation : MSMouse -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [ - WmiDataId(1), - read, - Description("An identification number for the device") : amended] - uint64 DeviceId; -}; - - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Keyboard class driver information") : amended, - guid("{4731F899-71CB-11d1-A52C-00A0C9062910}") - ] -class MSKeyboard_ClassInformation : MSKeyboard -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [ - WmiDataId(1), - read, - Description("An identification number for the device") : amended] - uint64 DeviceId; -}; - -// -// AGP information -// -[abstract] -class MSAgp -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("AGP Information") : amended, - HeaderName("AGP_STD_DATA"), - guid("{8C27FBED-1C7B-47E4-A649-0E389D3ADA4F}"), - GuidName1("AGP_WMI_STD_DATA_GUID") -] -class MSAgp_Information : MSAgp -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [ - WmiDataId(1), - Description("Aperture base") : amended, - read] - uint64 ApertureBase; - - [ - WmiDataId(2), - Description("Aperture length") : amended, - read] - uint32 ApertureLength; - - [ - WmiDataId(3), - BitValues{"AGP_RATE_1X", "AGP_RATE_2X", "AGP_RATE_4X", - "FAST_WRITE", "FOUR_GB", "SBA_ENABLE"} : amended, - BitMap{"0", "1", "2", "4", "5", "9"}, - Description("AGP Status") : amended, - read] - uint32 AgpStatus; - - [ - WmiDataId(4), - BitValues{"AGP_RATE_1X", "AGP_RATE_2X", "AGP_RATE_4X", - "FAST_WRITE", "FOUR_GB", "AGP_ENABLE", "SBA_ENABLE"} : amended, - BitMap{"0", "1", "2", "4", "5", "8", "9"}, - Description("AGP Command") : amended, - read] - uint32 AgpCommand; -}; - -// -// Thermal information via ACPI -[abstract] -class MSAcpi -{ -}; - - -[Dynamic, Provider("WMIProv"), - WMI, - Description("ThermalZone temperature information") : amended, - guid("{A1BC18C0-A7C8-11d1-BF3C-00A0C9062910}"), - DisplayName("Thermal Zone Information") : amended - ] -class MSAcpi_ThermalZoneTemperature : MSAcpi -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Thermal Stamp") : amended, - WmiDataId(1), - Description("Thermal information change stamp") : amended, - read] - uint32 ThermalStamp; - - [DisplayName("Thermal Constant 1") : amended, - WmiDataId(2), - Description("First thermal constant") : amended, - read] - uint32 ThermalConstant1; - - [DisplayName("Thermal Constant 2") : amended, - WmiDataId(3), - Description("Second thermal constant") : amended, - read] - uint32 ThermalConstant2; - - [DisplayName("Reserved") : amended, - WmiDataId(4), - Description("Reserved") : amended, - read] - uint32 Reserved; - - [DisplayName("Sampling Period") : amended, - WmiDataId(5), - Description("Sampling period") : amended, - read] - uint32 SamplingPeriod; - - [DisplayName("Current Temperature") : amended, - WmiDataId(6), - Description("Temperature at thermal zone in tenths of degrees Kelvin") : amended, - read] - uint32 CurrentTemperature; - - [DisplayName("Passive Trippoint") : amended, - WmiDataId(7), - Description("Temperature (in tenths of degrees Kelvin) at which the OS must activate CPU throttling (ie, enable passive cooling)") : amended, - read] - uint32 PassiveTripPoint; - - [DisplayName("Critical Trippoint") : amended, - WmiDataId(8), - Description("Temperature (in tenths of degrees Kelvin) at which the OS must shutdown the system (ie, critical temperature)") : amended, - read] - uint32 CriticalTripPoint; - - [DisplayName("Active Trippoint Count") : amended, - WmiDataId(9), - Description("Count of active trip points") : amended, - read] - uint32 ActiveTripPointCount; - - [WmiDataId(10), - Description("Temperature levels (in tenths of degrees Kelvin) at which the OS must activate active cooling") : amended, - DisplayName("Active Trippoint") : amended, - MissingValue(0), - read] - uint32 ActiveTripPoint[10]; - -}; - -// -// Disk -[abstract] -class MSDiskDriver -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Disk Geometry") : amended, - guid("{25007F51-57C2-11d1-A528-00A0C9062910}"), - HeaderName("WMI_DISK_GEOMETRY"), - DisplayName("Disk Geometry") : amended - ] -class MSDiskDriver_Geometry : MSDiskDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Cylinders") : amended, - WmiDataId(1), - read] - sint64 Cylinders; - - [DisplayName("Media Type") : amended, - WmiDataId(2), - Values{"Format is unknown", - "5.25, 1.2MB, 512 bytes/sector", - "3.5, 1.44MB, 512 bytes/sector", - "3.5, 2.88MB, 512 bytes/sector", - "3.5, 20.8MB, 512 bytes/sector", - "3.5, 720KB, 512 bytes/sector", - "5.25, 360KB, 512 bytes/sector", - "5.25, 320KB, 512 bytes/sector", - "5.25, 320KB, 1024 bytes/sector", - "5.25, 180KB, 512 bytes/sector", - "5.25, 160KB, 512 bytes/sector", - "Removable media other than floppy", - "Fixed hard disk media", - "3.5, 120M Floppy", - "3.5 , 640KB, 512 bytes/sector", - "5.25, 640KB, 512 bytes/sector", - "5.25, 720KB, 512 bytes/sector", - "3.5 , 1.2Mb, 512 bytes/sector", - "3.5 , 1.23Mb, 1024 bytes/sector", - "5.25, 1.23MB, 1024 bytes/sector", - "3.5 MO 128Mb 512 bytes/sector", - "3.5 MO 230Mb 512 bytes/sector", - "8, 256KB, 128 bytes/sector"} : amended, - ValueMap{"0", - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "20", - "21", - "22"}, - read] - uint32 MediaType; - - [DisplayName("Tracks Per Cylinder") : amended, - WmiDataId(3), - read] - uint32 TracksPerCylinder; - - [DisplayName("Sectors Per Track") : amended, - WmiDataId(4), - read] - uint32 SectorsPerTrack; - - [DisplayName("Bytes Per Sector") : amended, - WmiDataId(5), - read] - uint32 BytesPerSector; - -}; - -[ - WMI, - Description("Disk performance statistics") : amended, - guid("BDD865D2-D7C1-11d0-A501-00A0C9062910"), - HeaderName("WMI_DISK_PERFORMANCE"), - DisplayName("Disk Performance Information") : amended - ] -class MSDiskDriver_PerformanceData : MSDiskDriver -{ - [DisplayName("Bytes Read") : amended, - WmiDataId(1), - Description("Number of bytes read on disk") : amended, - read] - sint64 BytesRead; - - [DisplayName("Bytes Written") : amended, - WmiDataId(2), - Description("Number of bytes written on disk") : amended, - read] - sint64 BytesWritten; - - [DisplayName("Read Time") : amended, - WmiDataId(3), - Description("Amount off time spent reading from disk") : amended, - read] - sint64 ReadTime; - - [DisplayName("Write Time") : amended, - WmiDataId(4), - Description("Amount off time spent writing to disk") : amended, - read] - sint64 WriteTime; - - [DisplayName("Idle Time") : amended, - WmiDataId(5), - Description("Amount off disk idle time") : amended, - read] - sint64 IdleTime; - - [DisplayName("Read Count") : amended, - WmiDataId(6), - Description("Number of read operations from disk") : amended, - read] - uint32 ReadCount; - - [DisplayName("Write Count") : amended, - WmiDataId(7), - Description("Number of write operations to disk") : amended, - read] - uint32 WriteCount; - - [DisplayName("Queue Depth") : amended, - WmiDataId(8), - Description("Number of requests waiting in the disk queue") : amended, - read] - uint32 QueueDepth; - - [DisplayName("Split Count") : amended, - WmiDataId(9), - Description("Number of split IO operations") : amended, - read] - uint32 SplitCount; - - [DisplayName("Query Time") : amended, - WmiDataId(10), - Description("") : amended, - read] - sint64 QueryTime; - - [DisplayName("Storage Device Number") : amended, - WmiDataId(11), - Description("") : amended, - read] - uint32 StorageDeviceNumber; - - [WmiDataId(12), - DisplayName("Storage Manager Name") : amended, - Description("") : amended, - read] - uint16 StorageManagerName[8]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Disk performance statistics") : amended, - guid("BDD865D1-D7C1-11d0-A501-00A0C9062910"), - DisplayName("Disk Performance Information") : amended - ] -class MSDiskDriver_Performance : MSDiskDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Performance Data") : amended, - WmiDataId(1), - Description("Performance Data Information") : amended, - read] - MSDiskDriver_PerformanceData PerfData; - - [DisplayName("Device Name") : amended, - WmiDataId(2), - Description("Internal device name") : amended, - read] - string DeviceName; -}; - - - -// -// General storage -[abstract] -class MSStorageDriver -{ -}; - - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Storage Device Failure Prediction Status") : amended, - guid("{78ebc102-4cf9-11d2-ba4a-00a0c9062910}"), - HeaderName("STORAGE_FAILURE_PREDICT_STATUS"), - GuidName1("WMI_STORAGE_FAILURE_PREDICT_STATUS_GUID"), - DisplayName("Failure Predict Status") : amended - ] -class MSStorageDriver_FailurePredictStatus : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Reason") : amended, - WmiDataId(1), - ValueMap{"0", "255"}, - Values{"Unknown", "Test - Not a failure"} : amended, - read] - uint32 Reason; - - [DisplayName("Predict Failure") : amended, - WmiDataId(2), - Description("TRUE if drive is predicting failure. In this case it is critical that the disk is backed up immediately") : amended, - read] - boolean PredictFailure; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Storage Device Failure Prediction Data") : amended, - guid("{78ebc103-4cf9-11d2-ba4a-00a0c9062910}"), - HeaderName("STORAGE_FAILURE_PREDICT_DATA"), - GuidName1("WMI_STORAGE_FAILURE_PREDICT_DATA_GUID"), - DisplayName("Failure Predict Data") : amended - ] -class MSStorageDriver_FailurePredictData : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Length") : amended, - WmiDataId(1), - read] - uint32 Length; - - - [DisplayName("Vendor Specific") : amended, - WmiDataId(2), - Description("Vendor specific failure prediction data") : amended, - read] - uint8 VendorSpecific[512]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("ATAPI SMART Data") : amended, - guid("{78ebc103-4cf9-11d2-ba4a-00a0c9062910}"), - HeaderName("ATAPI_FAILURE_PREDICT_DATA"), - GuidName1("WMI_ATAPI_FAILURE_PREDICT_DATA_GUID"), - read, - DisplayName("ATAPI Failure Predict Data") : amended - ] -class MSStorageDriver_ATAPISmartData : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Length") : amended, - WmiDataId(1), - read] - uint32 Length; - - - [DisplayName("Vendor Specific") : amended, - WmiDataId(2), - Description("Vendor specific failure prediction data") : amended, - read] - uint8 VendorSpecific[362]; - - [WmiDataId(3), - Description("Off-line data collection status") : amended, - read, - Values{"0", "2", "4", "5", "6", "128", "130", "132", "133", "134"}, - ValueMap{"Off-line data collection activity was never started", - "Off-line data collection activity was completed without error", - "Off-line data collection activity was suspended by an interrupting command from host", - "Off-line data collection activity was aborted by an interrupting command from host", - "Off-line data collection activity was aborted by the device with a fatal error", - "Off-line data collection activity was never started", - "Off-line data collection activity was completed without error", - "Off-line data collection activity was suspended by an interrupting command from host", - "Off-line data collection activity was aborted by an interrupting command from host", - "Off-line data collection activity was aborted by the device with a fatal error" - } : amended - ] - uint8 OfflineCollectionStatus; - - [WmiDataId(4), - Description("Self-test execution status byte") : amended, - read, - Values{"0", "1", "2", "3", "4", "5", "6", "7", "15"}, - ValueMap{ - "The previous self-test routine completed without error or no self-test has ever been run" - "The self-test routine was aborted by the host", - "The self-test routine was interrupted by the host with a hardware or software reset", - "A fatal error or unknown test error occurred while the device was executing its self-test routineand the device was unable to complete the self-test routine.", - "The previous self-test completed having a test element that failed and the test element that failed is not known.", - "The previous self-test completed having the electrical element of the test failed.", - "The previous self-test completed having the servo (and/or seek) test element of the test failed.", - "The previous self-test completed having the read element of the test failed.", - "Self-test routine in progress." - } : amended - ] - uint8 SelfTestStatus; - - [WmiDataId(5), - Description("Total time in seconds to complete off-line data collection activity") : amended, - read - ] - uint16 TotalTime; - - [WmiDataId(6), - Description("Vendor Specific") : amended, - read - ] - uint8 VendorSpecific2; - - [WmiDataId(7), - Description("Off-line data collection capability") : amended, - BitMap{"0", "1", "2", "3", "4"}, - BitValues{ - "(EXECUTE OFF-LINE IMMEDIATE implemented bit) - If this bit is set to one, then the SMART EXECUTE OFF-LINE IMMEDIATE command is implemented by this device. If this bit is cleared to zero, then the SMART EXECUTE OFF-LINE IMMEDIATE command is not implemented by this device.", - "(vendor specific)", - "(abort/restart off-line by host bit) - If this bit is set to one, then the device shall abort all off-line data collection activity initiated by an SMART EXECUTE OFF-LINE IMMEDIATE command upon receipt of a new command within 2 seconds of receiving the new command. If this bit is cleared to zero, the device shall suspend off-line data collection activity after an interrupting command and resume off-line data collection activity after some vendor-specified event.", - "(off-line read scanning implemented bit) - If this bit is cleared to zero, the device does not support off-line read scanning. If this bit is set to one, the device supports off-line read scanning.", - "(self-test implemented bit) - If this bit is cleared to zero, the device does not implement the Short and Extended self-test routines. If this bit is set to one, the device implements the Short and Extended self-test routines." - } : amended, - read - ] - uint8 OfflineCollectCapability; - - [WmiDataId(8), - Description("SMART capability") : amended, - read, - BitMap{"0", "1"}, - BitValues{ - "(power mode SMART data saving capability bit) - If this bit is set to one, the device saves SMART data prior to going into a power saving mode (Idle, Standby, or Sleep) or immediately upon return to Active or Idle mode from a Standby mode. If this bit is cleared to zero, the device does not save SMART data prior to going into a power saving mode (Idle, Standby, or Sleep) or immediately upon return to Active or Idle mode from a Standby mode.", - "(SMART data autosave after event capability bit) - This bit is set to one for devices complying with this standard." - } : amended - ] - uint16 SmartCapability; - - [WmiDataId(9), - Description("Error logging capability") : amended, - read, - BitMap{"0"}, - BitValues{"Device error logging supported"} : amended - ] - uint8 ErrorLogCapability; - - [WmiDataId(10), - Description("Vendor Specific") : amended, - read - ] - uint8 VendorSpecific3; - - [WmiDataId(11), - Description("Short self-test routine recommended polling time (in minutes)") : amended, - read - ] - uint8 ShortPollTimeInMinutes; - - [WmiDataId(12), - Description("Extended self-test routine recommended polling time (in minutes)") : amended, - read - ] - uint8 ExtendedPollTimeInMinutes; - - [WmiDataId(13), - Description("Reserved"), - read - ] - uint8 Reserved[12]; - - [WmiDataId(14), - Description("Vendor Specific") : amended, - read - ] - uint8 VendorSpecific4[125]; - - [WmiDataId(15), - Description("Data structure checksum") : amended, - read - ] - uint8 Checksum; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Storage Device Failure Prediction Thresholds") : amended, - guid("{DAE10783-CC31-4d2a-8A0F-861C04077A95}"), - HeaderName("STORAGE_FAILURE_PREDICT_THRESHOLDS"), - GuidName1("WMI_STORAGE_FAILURE_PREDICT_THRESHOLDS_GUID"), - DisplayName("Failure Predict Thresholds") : amended - ] -class MSStorageDriver_FailurePredictThresholds : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Vendor Specific") : amended, - WmiDataId(1), - Description("Vendor specific failure prediction thresholds") : amended, - read] - uint8 VendorSpecific[512]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Storage Device Failure Prediction Event") : amended, - guid("{78ebc104-4cf9-11d2-ba4a-00a0c9062910}"), - HeaderName("STORAGE_FAILURE_PREDICT_EVENT"), - GuidName1("WMI_STORAGE_PREDICT_FAILURE_EVENT_GUID"), - DisplayName("Failure Predict Event") : amended - ] -class MSStorageDriver_FailurePredictEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Length") : amended, - WmiDataId(1), - read] - uint32 Length; - - - [DisplayName("Vendor Specific") : amended, - WmiDataId(2), - Description("Vendor specific failure prediction data") : amended, - WmiSizeIs("Length"), - read] - uint8 VendorSpecific[]; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Storage Device Failure Prediction Functions") : amended, - guid("{78ebc105-4cf9-11d2-ba4a-00a0c9062910}"), - HeaderName("STORAGE_FAILURE_PREDICT_FUNCTION"), - GuidName1("WMI_STORAGE_FAILURE_PREDICT_FUNCTION_GUID"), - DisplayName("Failure Predict Functions") : amended - ] -class MSStorageDriver_FailurePredictFunction : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiMethodId(1), - Implemented, - DisplayName("Allow Performance Degredation") : amended, - HeaderName("ALLOW_PERFORMANCE_HIT"), - Description("Configures setting that specifies if additional failure prediction checking can cause a loss of performance") : amended] - void AllowPerformanceHit([in, DisplayName("Allow") : amended] boolean Allow); - - [WmiMethodId(2), - Implemented, - DisplayName("Enable Or Disable Hardware Failure Prediction") : amended, - HeaderName("ENABLE_DISABLE_FP"), - Description("Enables or disables failure prediction checking at the hardware level") : amended] - void EnableDisableHardwareFailurePrediction([in, DisplayName("Enable") : amended] boolean Enable); - - [WmiMethodId(3), - Implemented, - DisplayName("Enable Or Disable Failure Prediction Polling") : amended, - HeaderName("ENABLE_DISABLE_FP_POLLING"), - Description("Enables or disables polling for failure prediction status") : amended] - void EnableDisableFailurePredictionPolling( - [in, - DisplayName("Period") : amended, - Description("Period in seconds to poll for failure prediction status") : amended] - uint32 Period, - [in] boolean Enable); - [WmiMethodId(4), - Implemented, - DisplayName("Get Failure Prediction Capability") : amended, - HeaderName("GET_FP_CAPABILITY"), - Description("Returns mechanism used to read failure prediction status ") : amended] - void GetFailurePredictionCapability([out, ValueMap{"0", "1", "2", "3"}, - Value{"Not Supported", - "Ioctl Based", - "IDE SMART", - "SCSI SMART"} : amended, - DisplayName("Capability") : amended - ] uint32 Capability); - - [WmiMethodId(5), - HeaderName("ENABLE_OFFLINE_DIAGS"), - Implemented, - DisplayName("Enable Offline Diags") : amended, - Description("Enables execution of offline diagnostics") : amended] - void EnableOfflineDiags([out, DisplayName("Success") : amended] boolean Success); - - - [WmiMethodId(6), - Implemented, - DisplayName("Read Log Sectors") : amended, - HeaderName("READ_LOG_SECTORS"), - Description("Read log sectors") : amended - ] - void ReadLogSectors([in, DisplayName("Log Address") : amended] uint8 LogAddress, - [in, DisplayName("Sector Count") : amended] uint8 SectorCount, - [out, DisplayName("Length") : amended] uint32 Length, - [out, WmiSizeIs("Length"), DisplayName("Log Sectors") : amended] uint8 LogSectors[] - ); - - [WmiMethodId(7), - Implemented, - HeaderName("WRITE_LOG_SECTORS"), - DisplayName("WriteLogSectors") : amended, - Description("Write log sectors") : amended - ] - void WriteLogSectors([in, DisplayName("LogAddress") : amended] uint8 LogAddress, - [in, DisplayName("SectorCount") : amended] uint8 SectorCount, - [in, DisplayName("Length") : amended] uint32 Length, - [in, WmiSizeIs("Length"), DisplayName("LogSectors") : amended] uint8 LogSectors[], - [out, DisplayName("Success") : amended] boolean Success - ); - - [WmiMethodId(8), - Implemented, - HeaderName("EXECUTE_SELF_TEST"), - DisplayName("Execute Self Test") : amended, - Description("Execute Self Test") : amended - ] - void ExecuteSelfTest([in, DisplayName("Sub Command") : amended] uint8 Subcommand, - [out, - DisplayName("Return Code") : amended, - ValueMap{"0", "1", "2"}, - Value{"Successful Completion", - "Captive Mode Required", - "Unsuccessful Completion"} : amended - ] - uint32 ReturnCode); -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Data for Scsi Info Exceptions Mode Page") : amended, - guid("{1101D829-167B-4ebf-ACAE-28CAB7C34802}"), - HeaderName("STORAGE_SCSI_INFO_EXCEPTIONS"), - GuidName1("WMI_STORAGE_SCSI_INFO_EXCEPTIONS_GUID"), - DisplayName("Scsi Info Exceptions") : amended - ] -class MSStorageDriver_ScsiInfoExceptions : MSStorageDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Page Savable") : amended, - WmiDataId(1), - Description("The returned Parameter Savable bit of 1 indicates that page parameter data is savable.") : amended, - read, write] - boolean PageSavable; - - [DisplayName("Flags") : amended, - WmiDataId(2), - Description("Bit flags: " - "Perf set to zero indicates that informational exception operations that are the cause of delays are acceptable. " - "DExcpt set to zero indicates information exception operations shall be enabled. " - "Test of one instructs the drive to create false drive failures. " - "LogErr bit of zero indicates that logging of informational exception conditions are vendor specific.") : amended, - BitValues{"Perf", "DExcpt", "Test", "LogErr"} : amended, - BitMap{"7", "3", "2", "0"}, - read, write] - uint8 Flags; - - [DisplayName("Reporting Method") : amended, - WmiDataId(3), - Description("The Method of Reporting Informational Exceptions (MRIE) indicates the methods that shall be used by the target to report information exception conditions.") : amended, - ValueMap{"0", "1", "2", "3", "4", "5", "6"}, - Values{"No Reporting", "Asynchronous Event Reporting", "Generate Unit Attention", "Conditionally Generate Recovered Error", "Unconditionally Generate Recovered Error", "Generate No Sense", "Report On Request"} : amended, - read, write] - uint8 MRIE; - - [ - WmiDataId(4), - Description("Buffer padding to 32 bits, do not use") : amended, - read] - uint8 Padding; - - [DisplayName("Interval Timer") : amended, - WmiDataId(5), - Description("Period in 100ms increments for reporting that an information exception condition has occurred.") : amended, - read, write] - uint32 IntervalTimer; - - [DisplayName("Report Count") : amended, - WmiDataId(6), - Description("Indicates the number of times to report an informational exception condition to the application client. A value of zero indications there is no limit.") : amended, - read, write] - uint32 ReportCount; -}; - - -[abstract] -class MSIde -{ -}; - -[Dynamic, Provider("WMIProv"), WMI, - Description("Scsi Address") : amended, - guid("{53f5630f-b6bf-11d0-94f2-00a0c91efb8b}"), - DisplayName("Ide Port Information") : amended - ] -class MSIde_PortDeviceInfo : MSIde -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Bus") : amended, - WmiDataId(1), - Description("Scsi Bus Number") : amended, - read] - uint8 Bus; - - [DisplayName("Target") : amended, - WmiDataId(2), - Description("Scsi Target ID") : amended, - read] - uint8 Target; - - [DisplayName("Lun") : amended, - WmiDataId(3), - Description("Scsi Lun") : amended, - read] - uint8 Lun; -}; - - - -// Serial -[abstract] -class MSSerial -{ -}; - - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{A0EC11A8-B16C-11D1-BD98-00A0C906BE2D}"), - GuidName1("SERIAL_PORT_WMI_NAME_GUID"), - Description("Serial Port Name" ) : amended, - DisplayName("Serial Port Name") : amended -] -class MSSerial_PortName : MSSerial -{ - boolean Active; - [key] - string InstanceName; - - [DisplayName("Port Name") : amended, - WmiDataId(1), - Description("Serial Port Name") : amended, - read] - string PortName; -}; - - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{EDB16A62-B16C-11D1-BD98-00A0C906BE2D}"), - GuidName1("SERIAL_PORT_WMI_COMM_GUID"), - HeaderName("SERIAL_WMI_COMM_DATA"), - Description("Serial Communications Information") : amended, - DisplayName("Serial Comm Information") : amended -] -class MSSerial_CommInfo : MSSerial -{ - boolean Active; - [key] - string InstanceName; - - [DisplayName("Baud Rate") : amended, - WmiDataId(1), - Description("The BaudRate property indicates the baud rate for this serial port") : amended, - read] - uint32 BaudRate; - - [WmiDataId(2), - DisplayName("Bits Per Byte") : amended, - Description("The BitsPerByte property indicates the number of bits per byte for the serial port") : amended, - read] - uint32 BitsPerByte; - - [DisplayName("Parity") : amended, - WmiDataId(3), - read, - Description("The Parity property indicates the type of parity used") : amended, - Values{"None", - "Odd", - "Even", - "Space", - "Mark"} : amended, - ValueMap{"0", - "1", - "2", - "3", - "4"}, - DefineValues{"SERIAL_WMI_PARITY_NONE", - "SERIAL_WMI_PARITY_ODD", - "SERIAL_WMI_PARITY_EVEN", - "SERIAL_WMI_PARITY_SPACE", - "SERIAL_WMI_PARITY_MARK"} - ] - uint32 Parity; - - [DisplayName("Parity Check Enable") : amended, - WmiDataId(4), - Description("The ParityCheckEnabled property determines whether parity checking is enabled") : amended, - read] - boolean ParityCheckEnable; - - [DisplayName("Stop Bits") : amended, - WmiDataId(5), - read, - Description("The StopBits property indicates the number of stop bits for the serial port") : amended, - Values{"1", - "1.5", - "2"} : amended, - ValueMap{"0", - "1", - "2"}, - DefineValues{"SERIAL_WMI_STOP_1", - "SERIAL_WMI_STOP_1_5", - "SERIAL_WMI_STOP_2"}] - uint32 StopBits; - - [DisplayName("Xoff Character") : amended, - WmiDataId(6), - Description("The XOffCharacter property indicates the XOff character for the serial port") : amended, - read] - uint32 XoffCharacter; - - [DisplayName("Xoff Xmit Threshold") : amended, - WmiDataId(7), - Description("The XOffXmitThreshold property indicates the XOff transmit threshold for the serial port") : amended, - read] - uint32 XoffXmitThreshold; - - [DisplayName("Xon Character") : amended, - WmiDataId(8), - Description("The XOnCharacter property indicates the XOn character") : amended, - read] - uint32 XonCharacter; - - [DisplayName("Xon Xmit Threshold") : amended, - WmiDataId(9), - Description("The XOnXMitThreshold property indicates the XOn transmit threshold") : amended, - read] - uint32 XonXmitThreshold; - - [DisplayName("Maximum Baud Rate") : amended, - WmiDataId(10), - Description("The MaximumBaudRate property indicates the maximum baud rate of the serial port") : amended, - read] - uint32 MaximumBaudRate; - - [DisplayName("Maximum Output Buffer Size") : amended, - WmiDataId(11), - Description("The MaximumOutputBufferSize property indicates the maximum output buffer size (in bytes)") : amended, - read] - uint32 MaximumOutputBufferSize; - - [DisplayName("Maximum Input Buffer Size") : amended, - WmiDataId(12), - Description("The MaximumInputBufferSize property indicates the maximum input buffer size (in bytes)") : amended, - read] - uint32 MaximumInputBufferSize; - - [DisplayName("Support 16Bit Mode") : amended, - WmiDataId(13), - Description("The Support16BitMode property determines whether 16-bit mode is supported on the Win32 serial port") : amended, - read] - boolean Support16BitMode; - - [DisplayName("Support DTRDSR") : amended, - WmiDataId(14), - Description("The SupportDTRDSR property determines whether Data Terminal Ready (DTR) and Data Set Ready (DSR) signals are supported on the Win32 serial port.") : amended, - read] - boolean SupportDTRDSR; - - [DisplayName("Support Interval Timeouts") : amended, - WmiDataId(15), - Description("The SupportIntervalTimeouts property determines whether interval timeouts are supported on the serial port") : amended, - read] - boolean SupportIntervalTimeouts; - - [DisplayName("Support Parity Check") : amended, - WmiDataId(16), - Description("The SupportParityCheck property determines whether parity checking is supported on the Win32 serial port") : amended, - read] - boolean SupportParityCheck; - - [DisplayName("Support RTSCTS") : amended, - WmiDataId(17), - Description("The SupportRTSCTS property determines whether Ready To Send (RTS) and Clear To Send (CTS) signals are supported on the serial port") : amended, - read] - boolean SupportRTSCTS; - - [DisplayName("Support Xon Xoff") : amended, - WmiDataId(18), - Description("The SupportXOnXOff property determines whether software flow control is supported on the serial port") : amended, - read] - boolean SupportXonXoff; - - [DisplayName("Settable Baud Rate") : amended, - WmiDataId(19), - Description("The SettableBaudRate property determines whether the baud rate can be set on the serial port") : amended, - read] - boolean SettableBaudRate; - - [DisplayName("Settable Data Bits") : amended, - WmiDataId(20), - Description("The SettableDataBits property determines whether the number of data bits can be set on the Win32 serial port") : amended, - read] - boolean SettableDataBits; - - [DisplayName("Settable Flow Control") : amended, - WmiDataId(21), - Description("The SettableFlowControl property determines whether the flow control can be set on the serial port") : amended, - read] - boolean SettableFlowControl; - - [DisplayName("Settable Parity") : amended, - WmiDataId(22), - Description("The SettableParity property determines whether the parity can be set on the serial port") : amended, - read] - boolean SettableParity; - - [DisplayName("Settable Parity Check") : amended, - WmiDataId(23), - Description("The SettableParityCheck property determines whether parity checking can be set on the serial port") : amended, - read] - boolean SettableParityCheck; - - [DisplayName("Settable Stop Bits") : amended, - WmiDataId(24), - Description("The SettableStopBits property determines whether the number of stop bits can be set on the serial port") : amended, - read] - boolean SettableStopBits; - - [DisplayName("Is Busy") : amended, - WmiDataId(25), - Description("The IsBusy property determines whether the serial port is busy") : amended, - read] - boolean IsBusy; -}; - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{270B9B86-B16D-11D1-BD98-00A0C906BE2D}"), - GuidName1("SERIAL_PORT_WMI_HW_GUID"), - HeaderName("SERIAL_WMI_HW_DATA"), - Description("Hardware configuration for serial port") : amended, - DisplayName("Serial Hardware Configuration") : amended -] -class MSSerial_HardwareConfiguration : MSSerial -{ - boolean Active; - [key] - string InstanceName; - - [DisplayName("Irq Number") : amended, - WmiDataId(1), - Description("The IRQNumber property indicates the number of the IRQ resource") : amended, - read] - uint32 IrqNumber; - - [DisplayName("Irq Vector") : amended, - WmiDataId(2), - Description("The Vector property indicates the vector of the IRQ resource") : amended, - read] - uint32 IrqVector; - - [DisplayName("Irq Level") : amended, - WmiDataId(3), - Description("The IRQLevel property indicates the level of the IRQ resource") : amended, - read] - uint32 IrqLevel; - - [DisplayName("Irq Affinity Mask") : amended, - WmiDataId(4), - Description("The AffinityMask property indicates the affinity mask of the IRQ resource") : amended, - read] - uint64 IrqAffinityMask; - - [DisplayName("Interrupt Type") : amended, - WmiDataId(5), - Description("The InterruptType property indicates the interrupt type of the IRQ resource") : amended, - Values{"Latched", - "Level"} : amended, - ValueMap{"0", - "1"}, - DefineValues{"SERIAL_WMI_INTTYPE_LATCHED", - "SERIAL_WMI_INTTYPE_LEVEL"}, - read] - uint32 InterruptType; - - [DisplayName("Base IO Address") : amended, - WmiDataId(6), - Description("The BaseIOAddress is the base IO address for the serial port") : amended, - read] - uint64 BaseIOAddress; -}; - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{56415ACC-B16D-11D1-BD98-00A0C906BE2D}"), - GuidName1("SERIAL_PORT_WMI_PERF_GUID"), - HeaderName("SERIAL_WMI_PERF_DATA"), - Description("Performance information for serial port") : amended, - DisplayName("Serial Performance Data") : amended -] -class MSSerial_PerformanceInformation : MSSerial -{ - boolean Active; - [key] - string InstanceName; - - [DisplayName("Received Count") : amended, - WmiDataId(1), - Description("The ReceivedCount property indicates the number of bytes received in the current session") : amended, - read] - uint32 ReceivedCount; - - [DisplayName("Transmitted Count") : amended, - WmiDataId(2), - Description("The TransmittedCount property indicates the number of bytes transmitted in the current session") : amended, - read] - uint32 TransmittedCount; - - [DisplayName("Frame Error Count") : amended, - WmiDataId(3), - Description("The FrameErrorCount property indicates the number of framing errors that occurred in the current session") : amended, - read] - uint32 FrameErrorCount; - - [DisplayName("Serial Overrun Error Count") : amended, - WmiDataId(4), - Description("The SerialOverrunCount property indicates the number of serial overrun errors that occurred in the current session") : amended, - read] - uint32 SerialOverrunErrorCount; - - [DisplayName("Buffer Overrun Error Count") : amended, - WmiDataId(5), - Description("The BufferOverrunCount property indicates the number of buffer overrun errors that occurred in the current session") : amended, - read] - uint32 BufferOverrunErrorCount; - - [DisplayName("Parity Error Count") : amended, - WmiDataId(6), - Description("The ParityErrorCount property indicates the number of parity errors that occurred in the current session") : amended, - read] - uint32 ParityErrorCount; -}; - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{8209EC2A-2D6B-11d2-BA49-00A0C9062910}"), - GuidName1("SERIAL_PORT_WMI_PROPERTIES_GUID"), - HeaderName("SERIAL_WMI_COMMPROP"), - Description("Communication properties for serial port") : amended -] -class MSSerial_CommProperties : MSSerial -{ - boolean Active; - [key] - string InstanceName; - - [ - read, WmiDataId(1), - Description("Specifies the size, in bytes, of the entire data packet, regardless of the amount of data requested") : amended] - uint16 wPacketLength; // packet size, in bytes - - [ - read, WmiDataId(2), - Description("Specifies the version of the structure") : amended] - uint16 wPacketVersion; // packet version - - [read, WmiDataId(3), - BitValues{"SP_SERIALCOMM"} : amended, - BitMap{"0"}, - Description("Specifies a bitmask indicating which services are implemented by this provider. The SP_SERIALCOMM value is always specified for communications providers, including modem providers.") : amended] - uint32 dwServiceMask; // services implemented - - [read, WmiDataId(4), - Description("Reserved; do not use.") : amended] - uint32 dwReserved1; // reserved - - [read, WmiDataId(5), - Description("Specifies the maximum size, in bytes, of the driver's internal output buffer. A value of zero indicates that no maximum value is imposed by the serial provider") : amended] - uint32 dwMaxTxQueue; // max Tx bufsize, in bytes - - [read, WmiDataId(6), - Description("Specifies the maximum size, in bytes, of the driver's internal input buffer. A value of zero indicates that no maximum value is imposed by the serial provider") : amended] - uint32 dwMaxRxQueue; // max Rx bufsize, in bytes - - [read, WmiDataId(7), - BitValues{"BAUD_075", "BAUD_110", "BAUD_134_5", "BAUD_150", "BAUD_300", - "BAUD_600", "BAUD_1200", "BAUD_1800", "BAUD_2400", "BAUD_4800", - "BAUD_7200", "BAUD_9600", "BAUD_14400", "BAUD_19200", "BAUD_38400", - "BAUD_56K", "BAUD_128K", "BAUD_115200", "BAUD_57600", "BAUD_USER"} : amended, - - BitMap{"0", "1", "2", "3", "4", - "5", "6", "7", "8", "9", - "10", "11", "12", "13", "14", - "15", "16", "17", "18", "28" }, - Description("Specifies the maximum allowable baud rate, in bits per second (bps). This member can be one of the following values: Value Meaning") : amended] - uint32 dwMaxBaud; // max baud rate, in bps - - [read, WmiDataId(8), - ValueMap{"0x00000000", "0x00000001", "0x00000002", - "0x00000003", "0x00000004", "0x00000005", "0x00000006", - "0x00000021", "0x00000022", "0x00000100", - "0x00000101", "0x00000102", "0x00000103"}, - - Values{ "Unspecified", "RS-232 serial port", "Parallel port", - "RS-422 port", "RS-423 port","RS-449 port", "Modem device", - "FAX device", "Scanner device", "Unspecified network bridge", - "LAT protocol", "TCP/IP Telnet protocol", "X.25 standards"} : amended, - - Description("Specifies the specific communications provider type") : amended] - uint32 dwProvSubType; // specific provider type - - [read, WmiDataId(9), - BitValues{ "(data-terminal-ready)/DSR (data-set-ready) supported", - "(request-to-send)/CTS (clear-to-send) supported", - "(receive-line-signal-detect) supported", - "Parity checking supported", - "XON/XOFF flow control supported", - "Settable XON/XOFF supported", - "Total (elapsed) time-outs supported", - "Interval time-outs supported", - "Special character support provided", - "Special 16-bit mode supported"} : amended, - BitMap{"0", "1", "2", "3", "4", - "5", "6", "7", "8", "9"}, - Description("Specifies a bitmask indicating the capabilities offered by the provider. This member can be one of the following values") : amended] - uint32 dwProvCapabilities; // capabilities supported - - [read, WmiDataId(10), - BitValues{"Parity checking", - "Baud rate", - "Data bits", - "Stop bits", - "Handshaking (flow control)", - "Parity checking", - "(receive-line-signal-detect)"} : amended, - BitMap{"0", "1", "2", "3", "4", - "5", "6"}, - Description("Specifies a bitmask indicating the communications parameter that can be changed") : amended] - uint32 dwSettableParams; // changable parameters - - [read, WmiDataId(11), - BitValues{"BAUD_075", "BAUD_110", "BAUD_134_5", "BAUD_150", "BAUD_300", - "BAUD_600", "BAUD_1200", "BAUD_1800", "BAUD_2400", "BAUD_4800", - "BAUD_7200", "BAUD_9600", "BAUD_14400", "BAUD_19200", "BAUD_38400", - "BAUD_56K", "BAUD_128K", "BAUD_115200", "BAUD_57600", "BAUD_USER"} : amended, - - BitMap{"0", "1", "2", "3", "4", - "5", "6", "7", "8", "9", - "10", "11", "12", "13", "14", - "15", "16", "17", "18", "28" }, - Description("Specifies a bitmask indicating the baud rates that can be used") : amended] - uint32 dwSettableBaud; // allowable baud rates - - [read, WmiDataId(12), - BitValues{"5 data bits", - "6 data bits", - "7 data bits", - "8 data bits", - "16 data bits", - "Special wide path through serial hardware lines"} : amended, - - BitMap{"0", "1", "2", "3", "4", "5"}, - Description("Specifies a bitmask indicating the number of data bits that can be set") : amended] - uint16 wSettableData; // allowable byte sizes - - [read, WmiDataId(13), - BitValues{"1 stop bit", - "1.5 stop bits", - "2 stop bits", - "No parity", - "Odd parity", - "Even parity", - "Mark parity", - "Space parity"} : amended, - - BitMap{"0", "1", "2", "8", "9", "10", "11", "12"}, - Description("Specifies a bitmask indicating the stop bit and parity settings that can be selected.") : amended] - uint16 wSettableStopParity; // stop bits/parity allowed - - [read, WmiDataId(14), - Description("Specifies the size, in bytes, of the driver's internal output buffer. A value of zero indicates that the value is unavailable.") : amended] - uint32 dwCurrentTxQueue; // Tx buffer size, in bytes - - [read, WmiDataId(15), - Description("Specifies the size, in bytes, of the driver's internal input buffer. A value of zero indicates that the value is unavailable.") : amended] - uint32 dwCurrentRxQueue; // Rx buffer size, in bytes - - [read, WmiDataId(16), - Description("Specifies provider-specific data.") : amended] - uint32 dwProvSpec1; // provider-specific data - - [read, WmiDataId(17), - Description("Specifies provider-specific data.") : amended] - uint32 dwProvSpec2; // provider-specific data - - [ - read, WmiDataId(18), - Description("Number of bytes of provider specific data") : amended] - uint32 dwProvCharSize; - - [ - read, WmiDataId(19), - WmiSizeIs("dwProvCharSize"), - Description("Specifies provider-specific data. Applications should ignore this member unless they have detailed information about the format of the data required by the provider.") : amended] - uint8 wcProvChar[]; // provider-specific data - - -}; - -[abstract] -class MSParallel -{ -}; - -[Dynamic, Provider("WMIProv"), WMI, - Description("The allocate and free counts track the port sharing of the parallel port. If the allocate count equals the free count then the port is idle. If the allocate count is greater than the free count (free count + 1) then some other driver in the system has acquired exclusive access to that port. If the allocate count stays constant at freecount+1 for an arbitrarily long period of time, then some driver may have illegally locked the port preventing other drivers from accessing the port.") : amended -, - guid("{4BBB69EA-6853-11d2-8ECE-00C04F8EF481}"), - HeaderName("PARPORT_WMI_ALLOC_FREE_COUNTS"), - GuidName1("PARPORT_WMI_ALLOCATE_FREE_COUNTS_GUID"), - DisplayName("Parallel Port Alloc Free Counts") : amended - ] -class MSParallel_AllocFreeCounts : MSParallel -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Port Allocates") : amended, - WmiDataId(1), - Description("Port allocation count") : amended, - read] - uint32 PortAllocates; - - [DisplayName("Port Frees") : amended, - WmiDataId(2), - Description("Port free count") : amended, - read] - uint32 PortFrees; - -}; - -[Dynamic, Provider("WMIProv"), WMI, - Description("Bytes transferred for each mode for the device") : amended, - guid("{89FEF2D6-654B-11d2-9E15-00C04F8EF481}"), - GuidName1("PARALLEL_WMI_BYTES_TRANSFERRED_GUID"), - HeaderName("PARALLEL_WMI_LOG_INFO"), - DisplayName("Parallel Device Bytes Transferred") : amended - ] -class MSParallel_DeviceBytesTransferred : MSParallel -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Flags 1") : amended, - WmiDataId(1), - Description("Reserved") : amended, - read] - uint32 Flags1; - - [DisplayName("Flags 2") : amended, - WmiDataId(2), - Description("Reserved") : amended, - read] - uint32 Flags2; - - [DisplayName("spare") : amended, - WmiDataId(3), - Description("Reserved") : amended, - read] - uint32 spare[2]; - - [DisplayName("Spp Write Count") : amended, - WmiDataId(4), - Description("Bytes written using SPP mode") : amended, - read] - sint64 SppWriteCount; - - [DisplayName("Nibble Read Count") : amended, - WmiDataId(5), - Description("Bytes written using nibble mode") : amended, - read] - sint64 NibbleReadCount; - - [DisplayName("Bounded Ecp Write Count") : amended, - WmiDataId(6), - Description("Bytes written using bounded Ecp mode") : amended, - read] - sint64 BoundedEcpWriteCount; - [DisplayName("BoundedEcpReadCount") : amended, - WmiDataId(7), - Description("Bytes read using bounded Ecp mode") : amended, - read] - sint64 BoundedEcpReadCount; - - [DisplayName("Hw Ecp Write Count") : amended, - WmiDataId(8), - Description("Bytes written using hardware Ecp mode") : amended, - read] - sint64 HwEcpWriteCount; - [DisplayName("Hw Ecp Read Count") : amended, - WmiDataId(9), - Description("Bytes read using hardware Ecp mode") : amended, - read] - sint64 HwEcpReadCount; - - [DisplayName("Sw Ecp Write Count") : amended, - WmiDataId(10), - Description("Bytes written using software Ecp mode") : amended, - read] - sint64 SwEcpWriteCount; - [DisplayName("Sw Ecp Read Count") : amended, - WmiDataId(11), - Description("Bytes read using software Ecp mode") : amended, - read] - sint64 SwEcpReadCount; - - [DisplayName("Hw Epp Write Count") : amended, - WmiDataId(12), - Description("Bytes written using hardware Epp mode") : amended, - read] - sint64 HwEppWriteCount; - [DisplayName("Hw Epp Read Count") : amended, - WmiDataId(13), - Description("Bytes read using hardware Epp mode") : amended, - read] - sint64 HwEppReadCount; - - [DisplayName("Sw Epp Write Count") : amended, - WmiDataId(14), - Description("Bytes written using software Epp mode") : amended, - read] - sint64 SwEppWriteCount; - [DisplayName("Sw Epp Read Count") : amended, - WmiDataId(15), - Description("Bytes read using software Epp mode") : amended, - read] - sint64 SwEppReadCount; - - [DisplayName("Byte Read Count") : amended, - WmiDataId(16), - Description("Bytes read using byte (bidirectional / PS/2) mode") : amended, - read] - sint64 ByteReadCount; - [DisplayName("Channel Nibble Read Count") : amended, - WmiDataId(17), - Description("Bytes read using channelized Nibble mode (IEEE 1284.3)") : amended, - read] - sint64 ChannelNibbleReadCount; - -}; - - -[abstract] -class MSRedbook -{ -}; - - -[Dynamic, - Provider("WMIProv"), - WMI, - Description("Digital Audio Filter Driver Information (redbook)") : amended, - GuidName1("GUID_REDBOOK_WMI_STD_DATA"), - GuidName2("MSRedbook_DriverInformationGuid"), - HeaderName("REDBOOK_WMI_STD_DATA"), - guid("{b90550e7-ae0a-11d1-a571-00c04fa34730}"), - DisplayName("Redbook Driver Information") : amended -] - -class MSRedbook_DriverInformation -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [WmiDataId(1), - DefineDataId("REDBOOK_WMI_NUMBER_OF_BUFFERS"), - read, - write, - Description("NumberOfBuffers*SectorsPerRead*2352 is the amount of memory used to reduce skipping." ) : amended, - DisplayName("Number Of Buffers") : amended - ] - uint32 NumberOfBuffers; - - [WmiDataId(2), - DefineDataId("REDBOOK_WMI_SECTORS_PER_READ"), - read, - write, - Description("Sectors (2352 bytes each) per read.") : amended, - DisplayName("Sectors Per Read") : amended - ] - uint32 SectorsPerRead; - - [WmiDataId(3), - DefineDataId("REDBOOK_WMI_SECTORS_PER_READ_MASK"), - read, - write, - Description("Bitwise mask of supported sectors per read for this drive. The lowest bit is one sector reads. If all bits are set, there are no restrictions.") : amended, - DisplayName("Sectors Per Read Mask") : amended - ] - uint32 SectorsPerReadMask; - - [WmiDataId(4), - DefineDataId("REDBOOK_WMI_MAX_SECTORS_PER_READ"), - read, - write, - Description("Maximum sectors per read (depends on both adapter and drive).") : amended, - DisplayName("Maximum Sectors Per Read") : amended - ] - uint32 MaximumSectorsPerRead; - - [WmiDataId(5), - DefineDataId("REDBOOK_WMI_PLAY_ENABLED"), - read, - write, - Description("PlayEnabled indicates the drive is currently using the RedBook filter.") : amended, - DisplayName("Play Enabled") : amended - ] - boolean PlayEnabled; - - [WmiDataId(6), - DefineDataId("REDBOOK_WMI_CDDA_SUPPORTED"), - read, - write, - Description("CDDASupported indicates the drive supports digital audio for some sector sizes.") : amended, - DisplayName("CDDA Supported") : amended - ] - boolean CDDASupported; - - [WmiDataId(7), - DefineDataId("REDBOOK_WMI_CDDA_ACCURATE"), - read, - write, - Description("CDDAAccurate indicates the drive accurately reads digital audio. This ensures the highest quality audio") : amended, - DisplayName("CDDA Accurate") : amended - ] - boolean CDDAAccurate; - - [WmiDataId(8), - read, - Description("Reserved for future use") : amended, - DisplayName("Reserved 1") : amended - ] - boolean Reserved1; - -}; - - -[Dynamic, - Provider("WMIProv"), - WMI, - Description("Digital Audio Filter Driver Performance Data (redbook)") : amended, - GuidName1("GUID_REDBOOK_WMI_PERF_DATA"), - GuidName2("MSRedbook_PerformanceGuid"), - HeaderName("REDBOOK_WMI_PERF_DATA"), - guid("{b90550e8-ae0a-11d1-a571-00c04fa34730}"), - DisplayName("Redbook Performance Information") : amended -] - -class MSRedbook_Performance -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [WmiDataId(1), - DefineDataId("REDBOOK_WMI_PERF_TIME_READING_DELAY"), - read, - Description("Seconds spent ready to read, but unused. (*1E-7)" ) : amended, - DisplayName("Time Read Delay") : amended - ] - sint64 TimeReadDelay; - - [WmiDataId(2), - DefineDataId("REDBOOK_WMI_PERF_TIME_READING"), - read, - Description("Seconds spent reading data from source. (*1E-7)") : amended, - DisplayName("Time Reading") : amended - ] - sint64 TimeReading; - - [WmiDataId(3), - DefineDataId("REDBOOK_WMI_PERF_TIME_STREAMING_DELAY"), - read, - Description("Seconds spent ready to stream, but unused. (*1E-7)") : amended, - DisplayName("Time Stream Delay") : amended - ] - sint64 TimeStreamDelay; - - [WmiDataId(4), - DefineDataId("REDBOOK_WMI_PERF_TIME_STREAMING"), - read, - Description("Seconds spent streaming data. (*1E-7)") : amended, - DisplayName("Time Streaming") : amended - ] - sint64 TimeStreaming; - - [WmiDataId(5), - DefineDataId("REDBOOK_WMI_PERF_DATA_PROCESSED"), - read, - Description("Number of bytes of data read and streamed.") : amended, - DisplayName("Data Processed") : amended - ] - sint64 DataProcessed; - - [WmiDataId(6), - DefineDataId("REDBOOK_WMI_PERF_STREAM_PAUSED_COUNT"), - read, - Description("Number of times the stream has paused due to insufficient stream buffers.") : amended, - DisplayName("Stream Paused Count") : amended - ] - uint32 StreamPausedCount; - -}; - - -[WMI, Dynamic, Provider("WMIProv"), - guid("{e3dff7bd-3915-11d2-9103-00c04fb998a2}"), - - WmiExpense(1), - Description("Enumerates Guids registered with WMI. The InstanceName is the Guid.") : amended] -class RegisteredGuids -{ - [key, read] - string InstanceName; - - [read] - boolean Active; - - [DisplayName("GuidType") : amended, - read, - Description("Type of guid") : amended, - ValueMap{0, 1, 2, 3}, - Value{"Trace Control Guid", "Trace Guid", "Data Guid", "Event Guid"} : amended, - WmiDataId(1)] uint32 GuidType; - - [DisplayName("LoggerId") : amended, - read, - Description("If Trace guid and enabled, indicates the LoggerId to which this Guid is currently logging data") : amended, - WmiDataId(2)] uint32 LoggerId; - - [DisplayName("EnableLevel") : amended, - read, - Description("If trace guid and If enabled, indicates the level of logging") : amended, - WmiDataId(3)] uint32 EnableLevel; - - [DisplayName("EnableFlags") : amended, - read, - Description("If trace guid and enabled, indicates the flags currently used in logging") : amended, - WmiDataId(4)] uint32 EnableFlags; - - [DisplayName("IsEnabled") : amended, - read, - Description("Indicates whether this Guid is enabled currently. For data guids this means if collection is enabled, For event guids this means if events are enabled. For Trace control guids this means the trace logging is enabled.") : amended, - WmiDataId(5)] boolean IsEnabled; - -}; - - -//************************************************************* -//*** Creates namespace for TRACE under \root\wmi -//*** EventTrace - is the root for all Trace Guids -//*** All Provider Control Guids will derive from EventTrace -//*** All Trace Data Guids will derive from their ControlGuid -//************************************************************* - -[abstract] -class EventTrace -{ -}; - -[Dynamic, - Description("Windows Kernel Trace") : amended, - Guid("{9e814aad-3204-11d2-9a82-006008a86939}") -] -class MSNT_SystemTrace:EventTrace -{ - [Description ("Enable Flags") : amended, - ValueDescriptions{ - "Process creations/deletions", - "Thread creations/deletions", - "Image load", - "Process counters", - "Context switches", - "Deferred procedure calls", - "Interrupts", - "System calls", - "Disk IO", - "File details", - "Disk IO entry", - "Dispatcher operations", - "Page faults", - "Hard page faults", - "Virtual memory allocations", - "Network TCP/IP", - "Registry details", - "ALPC", - "Split IO", - "Driver delays", - "Sample based profiling", - "File IO completion", - "File IO" - } : amended, - DefineValues{ - "EVENT_TRACE_FLAG_PROCESS", - "EVENT_TRACE_FLAG_THREAD", - "EVENT_TRACE_FLAG_IMAGE_LOAD", - "EVENT_TRACE_FLAG_PROCESS_COUNTERS", - "EVENT_TRACE_FLAG_CSWITCH", - "EVENT_TRACE_FLAG_DPC", - "EVENT_TRACE_FLAG_INTERRUPT", - "EVENT_TRACE_FLAG_SYSTEMCALL", - "EVENT_TRACE_FLAG_DISK_IO", - "EVENT_TRACE_FLAG_DISK_FILE_IO", - "EVENT_TRACE_FLAG_DISK_IO_INIT", - "EVENT_TRACE_FLAG_DISPATCHER", - "EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS", - "EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS", - "EVENT_TRACE_FLAG_VIRTUAL_ALLOC", - "EVENT_TRACE_FLAG_NETWORK_TCPIP", - "EVENT_TRACE_FLAG_REGISTRY", - "EVENT_TRACE_FLAG_ALPC", - "EVENT_TRACE_FLAG_SPLIT_IO", - "EVENT_TRACE_FLAG_DRIVER", - "EVENT_TRACE_FLAG_PROFILE", - "EVENT_TRACE_FLAG_FILE_IO", - "EVENT_TRACE_FLAG_FILE_IO_INIT" - }, - Values{ - "process", - "thread", - "img", - "proccntr", - "cswitch", - "dpc", - "isr", - "syscall", - "disk", - "file", - "diskinit", - "dispatcher", - "pf", - "hf", - "virtalloc", - "net", - "registry", - "alpc", - "splitio", - "driver", - "profile", - "fileiocompletion", - "fileio" - }, - ValueMap{ - "0x00000001", - "0x00000002", - "0x00000004", - "0x00000008", - "0x00000010", - "0x00000020", - "0x00000040", - "0x00000080", - "0x00000100", - "0x00000200", - "0x00000400", - "0x00000800", - "0x00001000", - "0x00002000", - "0x00004000", - "0x00010000", - "0x00020000", - "0x00100000", - "0x00200000", - "0x00800000", - "0x01000000", - "0x02000000", - "0x04000000" - - } - ] - uint32 Flags; - -}; - -[Dynamic, - Description("Circular Kernel Session Provider") : amended, - Guid("{54dea73a-ed1f-42a4-af71-3e63d056f174}") -] -class MSNT_CKCLTraceProvider:EventTrace -{ - [Description ("Enable Flags") : amended, - ValueDescriptions{ - "Process creations/deletions", - "Thread creations/deletions", - "Image load", - "Process counters", - "Context switches", - "Deferred procedure calls", - "Interrupts", - "System calls", - "Disk IO", - "File details", - "Disk IO entry", - "Dispatcher operations", - "Page faults", - "Hard page faults", - "Virtual memory allocations", - "Network TCP/IP", - "Registry details", - "ALPC", - "Split IO", - "Driver delays", - "Sample based profiling", - "File IO completion", - "File IO" - } : amended, - DefineValues{ - "EVENT_TRACE_FLAG_PROCESS", - "EVENT_TRACE_FLAG_THREAD", - "EVENT_TRACE_FLAG_IMAGE_LOAD", - "EVENT_TRACE_FLAG_PROCESS_COUNTERS", - "EVENT_TRACE_FLAG_CSWITCH", - "EVENT_TRACE_FLAG_DPC", - "EVENT_TRACE_FLAG_INTERRUPT", - "EVENT_TRACE_FLAG_SYSTEMCALL", - "EVENT_TRACE_FLAG_DISK_IO", - "EVENT_TRACE_FLAG_DISK_FILE_IO", - "EVENT_TRACE_FLAG_DISK_IO_INIT", - "EVENT_TRACE_FLAG_DISPATCHER", - "EVENT_TRACE_FLAG_MEMORY_PAGE_FAULTS", - "EVENT_TRACE_FLAG_MEMORY_HARD_FAULTS", - "EVENT_TRACE_FLAG_VIRTUAL_ALLOC", - "EVENT_TRACE_FLAG_NETWORK_TCPIP", - "EVENT_TRACE_FLAG_REGISTRY", - "EVENT_TRACE_FLAG_ALPC", - "EVENT_TRACE_FLAG_SPLIT_IO", - "EVENT_TRACE_FLAG_DRIVER", - "EVENT_TRACE_FLAG_PROFILE", - "EVENT_TRACE_FLAG_FILE_IO", - "EVENT_TRACE_FLAG_FILE_IO_INIT" - }, - Values{ - "process", - "thread", - "img", - "proccntr", - "cswitch", - "dpc", - "isr", - "syscall", - "disk", - "file", - "diskinit", - "dispatcher", - "pf", - "hf", - "virtalloc", - "net", - "registry", - "alpc", - "splitio", - "driver", - "profile", - "fileiocompletion", - "fileio" - }, - ValueMap{ - "0x00000001", - "0x00000002", - "0x00000004", - "0x00000008", - "0x00000010", - "0x00000020", - "0x00000040", - "0x00000080", - "0x00000100", - "0x00000200", - "0x00000400", - "0x00000800", - "0x00001000", - "0x00002000", - "0x00004000", - "0x00010000", - "0x00020000", - "0x00100000", - "0x00200000", - "0x00800000", - "0x01000000", - "0x02000000", - "0x04000000" - - } - ] - uint32 Flags; -}; - -[Dynamic, - Description("Event Trace Event") : amended, - Guid("{68fdd900-4a3e-11d1-84f4-0000f80464e3}"), - DisplayName("EventTrace") : amended -] -class EventTraceEvent:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Event Trace Event") : amended, - EventType(0), - EventTypeName("Header") :amended -] -class EventTrace_Header:EventTraceEvent -{ - [WmiDataId(1), - Description("Buffer Size in Bytes") : amended, - read] - uint32 BufferSize; - [WmiDataId(2), - Description("Event Trace Version") : amended, - read] - uint32 Version; - [WmiDataId(3), - Description("Windows Build Number") : amended, - read] - uint32 ProviderVersion; - [WmiDataId(4), - Description("Number Of Processors") : amended, - read] - uint32 NumberOfProcessors; - [WmiDataId(5), - Description("Collection End Time") : amended, - read] - uint64 EndTime; - [WmiDataId(6), - Description("Timer Resolution") : amended, - read] - uint32 TimerResolution; - [WmiDataId(7), - Description("Maximum File Size in MBytes") : amended, - read] - uint32 MaxFileSize; - [WmiDataId(8), - Description("LogFileMode") : amended, - format("x"), - read] - uint32 LogFileMode; - [WmiDataId(9), - Description("Number of Buffers Written") : amended, - read] - uint32 BuffersWritten; - [WmiDataId(10), - Description("Buffer Number with earliest TimeStamp for a Circular LogFile") : amended, - read] - uint32 StartBuffers; - [WmiDataId(11), - Description("Pointer Size in Bytes") : amended, - read] - uint32 PointerSize; - [WmiDataId(12), - Description("Number of Events Lost during collection") : amended, - read] - uint32 EventsLost; - [WmiDataId(13), - Description("CPU Speed in MHz") : amended, - read] - uint32 CPUSpeed; - [WmiDataId(14), - Description("Logger Name") : amended, - pointer, - read] - uint32 LoggerName; - [WmiDataId(15), - Description("LogFile Name") : amended, - pointer, - read] - uint32 LogFileName; - [WmiDataId(16), - Description("TimeZoneInformation") : amended, - extension("NoPrint"), - read] - uint8 TimeZoneInformation[176]; - [WmiDataId(17), - Description("BootTime") : amended, - read] - uint64 BootTime; - [WmiDataId(18), - Description("Performance counter frequency in counts per second") : amended, - read] - uint64 PerfFreq; - [WmiDataId(19), - Description("StartTime") : amended, - read] - uint64 StartTime; - [WmiDataId(20), - Description("ReservedFlags") : amended, - format("x"), - read] - uint32 ReservedFlags; - [WmiDataId(21), - Description("Number of Buffers Lost during collection") : amended, - read] - uint32 BuffersLost; - [WmiDataId(22), - Description("SessionNameString") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string SessionNameString; - [WmiDataId(23), - Description("LogFileNameString") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string LogFileNameString; -}; - -[Dynamic, - Description("Event Trace Header Extension") : amended, - EventType{5, 32}, - EventTypeName{"Extension", "EndExtension"} :amended -] -class Header_Extension_TypeGroup:EventTraceEvent -{ - [WmiDataId(1), - Description("GroupMask1") : amended, - format("x"), - read] - uint32 GroupMask1; - [WmiDataId(2), - Description("GroupMask2") : amended, - format("x"), - read] - uint32 GroupMask2; - [WmiDataId(3), - Description("GroupMask3") : amended, - format("x"), - read] - uint32 GroupMask3; - [WmiDataId(4), - Description("GroupMask4") : amended, - format("x"), - read] - uint32 GroupMask4; - [WmiDataId(5), - Description("GroupMask5") : amended, - format("x"), - read] - uint32 GroupMask5; - [WmiDataId(6), - Description("GroupMask6") : amended, - format("x"), - read] - uint32 GroupMask6; - [WmiDataId(7), - Description("GroupMask7") : amended, - format("x"), - read] - uint32 GroupMask7; - [WmiDataId(8), - Description("GroupMask8") : amended, - format("x"), - read] - uint32 GroupMask8; - [WmiDataId(9), - Description("KernelEventVersion") : amended, - format("x"), - read] - uint32 KernelEventVersion; -}; - -[Dynamic, - Description("Event Trace Rundown Complete") : amended, - EventType(8), - EventTypeName("RDComplete") :amended -] -class RDComplete:EventTraceEvent -{ - -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - Guid("{3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(0), - DisplayName("Process") : amended -] -class Process_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - EventType{1, 2, 3, 4}, - EventTypeName{"Start", "End", "DCStart", "DCEnd"} : amended -] -class Process_V0_TypeGroup1:Process_V0 -{ - [WmiDataId(1), - Description("Process ID") : amended, - pointer, - read] - uint32 ProcessId; - [WmiDataId(2), - Description("Parent Process ID") : amended, - pointer, - read] - uint32 ParentId; - [WmiDataId(3), - Description("User SID") : amended, - extension("Sid"), - read] - object UserSID; - [WmiDataId(4), - Description("ImageFileName") : amended, - StringTermination("NullTerminated"), - read] - string ImageFileName; -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - Guid("{3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(1), - DisplayName("Process") : amended -] -class Process_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - EventType{1, 2, 3, 4}, - EventTypeName{"Start", "End", "DCStart", "DCEnd"} : amended -] -class Process_V1_TypeGroup1:Process_V1 -{ - [WmiDataId(1), - Description("PageDirectoryBase") : amended, - pointer, - read] - uint32 PageDirectoryBase; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(3), - Description("ParentId") : amended, - format("x"), - read] - uint32 ParentId; - [WmiDataId(4), - Description("SessionId") : amended, - read] - uint32 SessionId; - [WmiDataId(5), - Description("ExitStatus") : amended, - read] - sint32 ExitStatus; - [WmiDataId(6), - Description("UserSID") : amended, - extension("Sid"), - read] - object UserSID; - [WmiDataId(7), - Description("ImageFileName") : amended, - StringTermination("NullTerminated"), - read] - string ImageFileName; -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - Guid("{3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(2), - DisplayName("Process") : amended -] -class Process_V2:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - EventType{1, 2, 3, 4, 39}, - EventTypeName{"Start", "End", "DCStart", "DCEnd", "Defunct"} : amended -] -class Process_V2_TypeGroup1:Process_V2 -{ - [WmiDataId(1), - Description("UniqueProcessKey") : amended, - pointer, - read] - uint32 UniqueProcessKey; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(3), - Description("ParentId") : amended, - format("x"), - read] - uint32 ParentId; - [WmiDataId(4), - Description("SessionId") : amended, - read] - uint32 SessionId; - [WmiDataId(5), - Description("ExitStatus") : amended, - read] - sint32 ExitStatus; - [WmiDataId(6), - Description("UserSID") : amended, - extension("Sid"), - read] - object UserSID; - [WmiDataId(7), - Description("ImageFileName") : amended, - StringTermination("NullTerminated"), - read] - string ImageFileName; - [WmiDataId(8), - Description("CommandLine") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string CommandLine; -}; - -[Dynamic, - Description("Process Performance Counters") : amended, - EventType{32, 33}, - EventTypeName{"PerfCtr", "PerfCtrRundown"} : amended -] -class Process_V2_TypeGroup2:Process_V2 -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("PageFaultCount") : amended, - read] - uint32 PageFaultCount; - [WmiDataId(3), - Description("HandleCount") : amended, - read] - uint32 HandleCount; - [WmiDataId(4), - Description("Reserved") : amended, - read] - uint32 Reserved; - [WmiDataId(5), - Description("PeakVirtualSize") : amended, - extension("SizeT"), - read] - object PeakVirtualSize; - [WmiDataId(6), - Description("PeakWorkingSetSize") : amended, - extension("SizeT"), - read] - object PeakWorkingSetSize; - [WmiDataId(7), - Description("PeakPagefileUsage") : amended, - extension("SizeT"), - read] - object PeakPagefileUsage; - [WmiDataId(8), - Description("QuotaPeakPagedPoolUsage") : amended, - extension("SizeT"), - read] - object QuotaPeakPagedPoolUsage; - [WmiDataId(9), - Description("QuotaPeakNonPagedPoolUsage") : amended, - extension("SizeT"), - read] - object QuotaPeakNonPagedPoolUsage; - [WmiDataId(10), - Description("VirtualSize") : amended, - extension("SizeT"), - read] - object VirtualSize; - [WmiDataId(11), - Description("WorkingSetSize") : amended, - extension("SizeT"), - read] - object WorkingSetSize; - [WmiDataId(12), - Description("PagefileUsage") : amended, - extension("SizeT"), - read] - object PagefileUsage; - [WmiDataId(13), - Description("QuotaPagedPoolUsage") : amended, - extension("SizeT"), - read] - object QuotaPagedPoolUsage; - [WmiDataId(14), - Description("QuotaNonPagedPoolUsage") : amended, - extension("SizeT"), - read] - object QuotaNonPagedPoolUsage; - [WmiDataId(15), - Description("PrivatePageCount") : amended, - extension("SizeT"), - read] - object PrivatePageCount; -}; - -[Dynamic, - Description("Process In Swap Event") : amended, - EventType(35), - EventTypeName("InSwap") : amended -] -class Process_V2_TypeGroup3:Process_V2 -{ - [WmiDataId(1), - Description("DirectoryTableBase") : amended, - pointer, - read] - uint32 DirectoryTableBase; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - Guid("{3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(3), - DisplayName("Process") : amended -] -class Process:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Process Create/Exit Event") : amended, - EventType{1, 2, 3, 4, 39}, - EventTypeName{"Start", "End", "DCStart", "DCEnd", "Defunct"} : amended -] -class Process_TypeGroup1:Process -{ - [WmiDataId(1), - Description("UniqueProcessKey") : amended, - pointer, - read] - uint32 UniqueProcessKey; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(3), - Description("ParentId") : amended, - format("x"), - read] - uint32 ParentId; - [WmiDataId(4), - Description("SessionId") : amended, - read] - uint32 SessionId; - [WmiDataId(5), - Description("ExitStatus") : amended, - read] - sint32 ExitStatus; - [WmiDataId(6), - Description("DirectoryTableBase") : amended, - pointer, - read] - uint32 DirectoryTableBase; - [WmiDataId(7), - Description("UserSID") : amended, - extension("Sid"), - read] - object UserSID; - [WmiDataId(8), - Description("ImageFileName") : amended, - StringTermination("NullTerminated"), - read] - string ImageFileName; - [WmiDataId(9), - Description("CommandLine") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string CommandLine; -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - Guid("{3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(0), - DisplayName("Thread") : amended -] -class Thread_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - EventType{1, 2, 3, 4}, - EventTypeName{"Start", "End", "DCStart", "DCEnd"} : amended -] -class Thread_V0_TypeGroup1:Thread_V0 -{ - [WmiDataId(1), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - Guid("{3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(1), - DisplayName("Thread") : amended -] -class Thread_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - EventType{1, 3}, - EventTypeName{"Start", "DCStart"} : amended -] -class Thread_V1_TypeGroup1:Thread_V1 -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(3), - Description("StackBase") : amended, - pointer, - read] - uint32 StackBase; - [WmiDataId(4), - Description("StackLimit") : amended, - pointer, - read] - uint32 StackLimit; - [WmiDataId(5), - Description("UserStackBase") : amended, - pointer, - read] - uint32 UserStackBase; - [WmiDataId(6), - Description("UserStackLimit") : amended, - pointer, - read] - uint32 UserStackLimit; - [WmiDataId(7), - Description("StartAddr") : amended, - pointer, - read] - uint32 StartAddr; - [WmiDataId(8), - Description("Win32StartAddr") : amended, - pointer, - read] - uint32 Win32StartAddr; - [WmiDataId(9), - Description("WaitMode") : amended, - read] - sint8 WaitMode; -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - EventType{2, 4}, - EventTypeName{"End", "DCEnd"} : amended -] -class Thread_V1_TypeGroup2:Thread_V1 -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; -}; - - -[Dynamic, - Description("Context Switch Event") : amended, - EventType(36), - EventTypeName("CSwitch") : amended -] -class CSwitch_V1:Thread_V1 -{ - [WmiDataId(1), - Description("NewThreadId") : amended, - format("x"), - read] - uint32 NewThreadId; - [WmiDataId(2), - Description("OldThreadId") : amended, - format("x"), - read] - uint32 OldThreadId; - [WmiDataId(3), - Description("NewThreadPriority") : amended, - read] - sint8 NewThreadPriority; - [WmiDataId(4), - Description("OldThreadPriority") : amended, - read] - sint8 OldThreadPriority; - [WmiDataId(5), - Description("NewThreadQuantum") : amended, - read] - sint8 NewThreadQuantum; - [WmiDataId(6), - Description("OldThreadQuantum") : amended, - read] - sint8 OldThreadQuantum; - [WmiDataId(7), - Description("OldThreadWaitReason") : amended, - read] - sint8 OldThreadWaitReason; - [WmiDataId(8), - Description("OldThreadWaitMode") : amended, - read] - sint8 OldThreadWaitMode; - [WmiDataId(9), - Description("OldThreadState") : amended, - read] - sint8 OldThreadState; - [WmiDataId(10), - Description("OldThreadWaitIdealProcessor") : amended, - read] - sint8 OldThreadWaitIdealProcessor; - [WmiDataId(11), - Description("NewThreadWaitTime") : amended, - format("x"), - read] - uint32 NewThreadWaitTime; -}; - -[Dynamic, - Description("Worker Thread Event") : amended, - EventType(57), - EventTypeName("WorkerThread") : amended -] -class WorkerThread_V1:Thread_V1 -{ - [WmiDataId(1), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(2), - Description("StartTime") : amended, - read] - uint64 StartTime; - [WmiDataId(3), - Description("ThreadRoutine") : amended, - pointer, - read] - uint32 ThreadRoutine; -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - Guid("{3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(2), - DisplayName("Thread") : amended -] -class Thread_V2:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - EventType{1, 2, 3, 4}, - EventTypeName{"Start", "End", "DCStart", "DCEnd"} : amended -] -class Thread_V2_TypeGroup1:Thread_V2 -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(3), - Description("StackBase") : amended, - pointer, - read] - uint32 StackBase; - [WmiDataId(4), - Description("StackLimit") : amended, - pointer, - read] - uint32 StackLimit; - [WmiDataId(5), - Description("UserStackBase") : amended, - pointer, - read] - uint32 UserStackBase; - [WmiDataId(6), - Description("UserStackLimit") : amended, - pointer, - read] - uint32 UserStackLimit; - [WmiDataId(7), - Description("StartAddr") : amended, - pointer, - read] - uint32 StartAddr; - [WmiDataId(8), - Description("Win32StartAddr") : amended, - pointer, - read] - uint32 Win32StartAddr; - [WmiDataId(9), - Description("TebBase") : amended, - pointer, - read] - uint32 TebBase; - [WmiDataId(10), - Description("SubProcessTag") : amended, - format("x"), - read] - uint32 SubProcessTag; -}; - -[Dynamic, - Description("Context Switch Event") : amended, - EventType(36), - EventTypeName("CSwitch") : amended -] -class CSwitch:Thread_V2 -{ - [WmiDataId(1), - Description("NewThreadId") : amended, - format("x"), - read] - uint32 NewThreadId; - [WmiDataId(2), - Description("OldThreadId") : amended, - format("x"), - read] - uint32 OldThreadId; - [WmiDataId(3), - Description("NewThreadPriority") : amended, - read] - sint8 NewThreadPriority; - [WmiDataId(4), - Description("OldThreadPriority") : amended, - read] - sint8 OldThreadPriority; - [WmiDataId(5), - Description("PreviousCState") : amended, - read] - uint8 PreviousCState; - [WmiDataId(6), - Description("SpareByte") : amended, - read] - sint8 SpareByte; - [WmiDataId(7), - Description("OldThreadWaitReason") : amended, - read] - sint8 OldThreadWaitReason; - [WmiDataId(8), - Description("OldThreadWaitMode") : amended, - read] - sint8 OldThreadWaitMode; - [WmiDataId(9), - Description("OldThreadState") : amended, - read] - sint8 OldThreadState; - [WmiDataId(10), - Description("OldThreadWaitIdealProcessor") : amended, - read] - sint8 OldThreadWaitIdealProcessor; - [WmiDataId(11), - Description("NewThreadWaitTime") : amended, - format("x"), - read] - uint32 NewThreadWaitTime; - [WmiDataId(12), - Description("Reserved") : amended, - read] - uint32 Reserved; -}; - -[Dynamic, - Description("Compressed CS Event") : amended, - EventType(37), - EventTypeName("CompCS") : amended -] -class CompCS:Thread_V2 -{ -}; - -[Dynamic, - Description("Worker Thread Event") : amended, - EventType(57), - EventTypeName("WorkerThread") : amended -] -class WorkerThread:Thread_V2 -{ - [WmiDataId(1), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(2), - Description("StartTime") : amended, - read] - uint64 StartTime; - [WmiDataId(3), - Description("ThreadRoutine") : amended, - pointer, - read] - uint32 ThreadRoutine; -}; - -[Dynamic, - Description("Ready Thread Event") : amended, - EventType(50), - EventTypeName("ReadyThread") : amended -] -class ReadyThread:Thread_V2 -{ - [WmiDataId(1), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(2), - Description("AdjustReason") : amended, - read] - sint8 AdjustReason; - [WmiDataId(3), - Description("AdjustIncrement") : amended, - read] - sint8 AdjustIncrement; - [WmiDataId(4), - Description("Flags") : amended, - read] - sint8 Flag; - [WmiDataId(5), - Description("Reserved") : amended, - read] - sint8 Reserved; -}; - - -[Dynamic, - Description("Thread Affinity Event") : amended, - EventType(53), - EventTypeName("ThreadAffinity") : amended -] -class ThreadAffinity:Thread_V2 -{ - [WmiDataId(1), - Description("Affinity") : amended, - pointer, - read] - uint32 Affinity; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 ThreadId; - [WmiDataId(3), - Description("Group") : amended, - read] - uint16 Group; - [WmiDataId(4), - Description("Reserved") : amended, - read] - uint16 Reserved; -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - Guid("{3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(3), - DisplayName("Thread") : amended -] -class Thread:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Thread Create/Exit Event") : amended, - EventType{1, 2, 3, 4}, - EventTypeName{"Start", "End", "DCStart", "DCEnd"} : amended -] -class Thread_TypeGroup1:Thread -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(3), - Description("StackBase") : amended, - pointer, - read] - uint32 StackBase; - [WmiDataId(4), - Description("StackLimit") : amended, - pointer, - read] - uint32 StackLimit; - [WmiDataId(5), - Description("UserStackBase") : amended, - pointer, - read] - uint32 UserStackBase; - [WmiDataId(6), - Description("UserStackLimit") : amended, - pointer, - read] - uint32 UserStackLimit; - [WmiDataId(7), - Description("Affinity") : amended, - pointer, - read] - uint32 Affinity; - [WmiDataId(8), - Description("Win32StartAddr") : amended, - pointer, - read] - uint32 Win32StartAddr; - [WmiDataId(9), - Description("TebBase") : amended, - pointer, - read] - uint32 TebBase; - [WmiDataId(10), - Description("SubProcessTag") : amended, - format("x"), - read] - uint32 SubProcessTag; - [WmiDataId(11), - Description("BasePriority") : amended, - read] - uint8 BasePriority; - [WmiDataId(12), - Description("PagePriority") : amended, - read] - uint8 PagePriority; - [WmiDataId(13), - Description("IoPriority") : amended, - read] - uint8 IoPriority; - [WmiDataId(14), - Description("Flags") : amended, - read] - uint8 ThreadFlags; -}; - -[Dynamic, - Description("Priority Change Event") : amended, - EventType{48, 49, 51, 52}, - EventTypeName{"SetPriority", "SetBasePriority", "SetPagePriority", "SetIoPriority"} : amended -] -class ThreadPriority:Thread -{ - [WmiDataId(1), - Description("ThreadId") : amended, - format("x"), - read] - uint32 ThreadId; - [WmiDataId(2), - Description("OldPriority") : amended, - read] - uint8 OldPriority; - [WmiDataId(3), - Description("NewPriority") : amended, - read] - uint8 NewPriority; - [WmiDataId(4), - Description("Reserved") : amended, - read] - uint16 Reserved; -}; - -[Dynamic, - Description("I/O Read/Write Event") : amended, - Guid("{3d6fa8d4-fe05-11d0-9dda-00c04fd7ba7c}"), - DisplayName("DiskIo") : amended -] -class DiskIo:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("I/O Read/Write Event") : amended, - EventType{10, 11}, - EventTypeName{"Read", "Write"} : amended -] -class DiskIo_TypeGroup1:DiskIo -{ - [WmiDataId(1), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(2), - Description("IrpFlags") : amended, - format("x"), - read] - uint32 IrpFlags; - [WmiDataId(3), - Description("TransferSize") : amended, - read] - uint32 TransferSize; - [WmiDataId(4), - Description("Reserved") : amended, - read] - uint32 Reserved; - [WmiDataId(5), - Description("ByteOffset") : amended, - read] - uint64 ByteOffset; - [WmiDataId(6), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(7), - Description("IORequestPacket") : amended, - pointer, - read] - uint32 Irp; - [WmiDataId(8), - Description("HighResResponseTime") : amended, - read] - uint64 HighResResponseTime; -}; - -[Dynamic, - Description("I/O Read/Write/Flush Start Event") : amended, - EventType{12, 13, 15}, - EventTypeName{"ReadInit", "WriteInit", "FlushInit"} : amended -] -class DiskIo_TypeGroup2:DiskIo -{ - [WmiDataId(1), - Description("IORequestPacket") : amended, - pointer, - read] - uint32 Irp; -}; - -[Dynamic, - Description("I/O Flush Buffers Event") : amended, - EventType(14), - EventTypeName("FlushBuffers") : amended -] -class DiskIo_TypeGroup3:DiskIo -{ - [WmiDataId(1), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(2), - Description("IrpFlags") : amended, - format("x"), - read] - uint32 IrpFlags; - [WmiDataId(3), - Description("HighResResponseTime") : amended, - read] - uint64 HighResResponseTime; - [WmiDataId(4), - Description("IORequestPacket") : amended, - pointer, - read] - uint32 Irp; -}; - -[Dynamic, - Description("Driver Major Function Call") : amended, - EventType(34), - EventTypeName("DrvMjFnCall") : amended -] -class DriverMajorFunctionCall:DiskIo -{ - [WmiDataId(1), - Description("MajorFunction") : amended, - read] - uint32 MajorFunction; - [WmiDataId(2), - Description("MinorFunction") : amended, - read] - uint32 MinorFunction; - [WmiDataId(3), - Description("RoutineAddr") : amended, - pointer, - read] - uint32 RoutineAddr; - [WmiDataId(4), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(5), - Description("Irp") : amended, - pointer, - read] - uint32 Irp; - [WmiDataId(6), - Description("UniqMatchId") : amended, - read] - uint32 UniqMatchId; -}; - -[Dynamic, - Description("Driver Major Function Return") : amended, - EventType(35), - EventTypeName("DrvMjFnRet") : amended -] -class DriverMajorFunctionReturn:DiskIo -{ - [WmiDataId(1), - Description("Irp") : amended, - pointer, - read] - uint32 Irp; - [WmiDataId(2), - Description("UniqMatchId") : amended, - read] - uint32 UniqMatchId; -}; - -[Dynamic, - Description("Driver Completion Routine") : amended, - EventType(37), - EventTypeName("DrvComplRout") : amended -] -class DriverCompletionRoutine:DiskIo -{ - [WmiDataId(1), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; - [WmiDataId(2), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(3), - Description("UniqMatchId") : amended, - read] - uint32 UniqMatchId; -}; - -[Dynamic, - Description("Driver Complete Request") : amended, - EventType(52), - EventTypeName("DrvComplReq") : amended -] -class DriverCompleteRequest:DiskIo -{ - [WmiDataId(1), - Description("RoutineAddr") : amended, - pointer, - read] - uint32 RoutineAddr; - [WmiDataId(2), - Description("Irp") : amended, - pointer, - read] - uint32 Irp; - [WmiDataId(3), - Description("UniqMatchId") : amended, - read] - uint32 UniqMatchId; -}; - -[Dynamic, - Description("Driver Delay Complete Request Return") : amended, - EventType(53), - EventTypeName("DrvComplReqRet") : amended -] -class DriverCompleteRequestReturn:DiskIo -{ - [WmiDataId(1), - Description("Irp") : amended, - pointer, - read] - uint32 Irp; - [WmiDataId(2), - Description("UniqMatchId") : amended, - read] - uint32 UniqMatchId; -}; - -[Dynamic, - Description("Registry") : amended, - Guid("{ae53722e-c863-11d2-8659-00c04fa321a1}"), - EventVersion(0), - DisplayName("Registry") : amended -] -class Registry_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Registry") : amended, - EventType{10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21}, - EventTypeName{"Create", "Open", "Delete", "Query", "SetValue", "DeleteValue", "QueryValue", "EnumerateKey", "EnumerateValueKey", "QueryMultipleValue", "SetInformation", "Flush"} : amended -] -class Registry_V0_TypeGroup1:Registry_V0 -{ - [WmiDataId(1), - Description("Status") : amended, - pointer, - read] - uint32 Status; - [WmiDataId(2), - Description("KeyHandle") : amended, - pointer, - read] - uint32 KeyHandle; - [WmiDataId(3), - Description("ElapsedTime") : amended, - read] - sint64 ElapsedTime; - [WmiDataId(4), - Description("KeyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string KeyName; -}; - -[Dynamic, - Description("Registry") : amended, - Guid("{ae53722e-c863-11d2-8659-00c04fa321a1}"), - EventVersion(1), - DisplayName("Registry") : amended -] -class Registry_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Registry") : amended, - EventType{10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22}, - EventTypeName{"Create", "Open", "Delete", "Query", "SetValue", "DeleteValue", "QueryValue", "EnumerateKey", "EnumerateValueKey", "QueryMultipleValue", "SetInformation", "Flush", "RunDown"} : amended -] -class Registry_V1_TypeGroup1:Registry_V1 -{ - [WmiDataId(1), - Description("Status") : amended, - pointer, - read] - uint32 Status; - [WmiDataId(2), - Description("KeyHandle") : amended, - pointer, - read] - uint32 KeyHandle; - [WmiDataId(3), - Description("ElapsedTime") : amended, - read] - sint64 ElapsedTime; - [WmiDataId(4), - Description("Index") : amended, - read] - uint32 Index; - [WmiDataId(5), - Description("KeyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string KeyName; -}; - -[Dynamic, - Description("Registry") : amended, - Guid("{ae53722e-c863-11d2-8659-00c04fa321a1}"), - EventVersion(2), - DisplayName("Registry") : amended -] -class Registry:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Registry") : amended, - EventType{10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, - EventTypeName{"Create", "Open", "Delete", "Query", "SetValue", "DeleteValue", "QueryValue", "EnumerateKey", "EnumerateValueKey", "QueryMultipleValue", "SetInformation", "Flush", "KCBCreate", "KCBDelete", "KCBRundownBegin", "KCBRundownEnd", "Virtualize", "Close", "SetSecurity", "QuerySecurity"} : amended -] -class Registry_TypeGroup1:Registry -{ - [WmiDataId(1), - Description("Initial Time") : amended, - read] - sint64 InitialTime; - - [WmiDataId(2), - Description("Status") : amended, - read] - uint32 Status; - - [WmiDataId(3), - Description("Index") : amended, - read] - uint32 Index; - - [WmiDataId(4), - Description("KeyHandle") : amended, - pointer, - read] - uint32 KeyHandle; - - [WmiDataId(5), - Description("KeyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string KeyName; -}; - -[Dynamic, - Description("Registry") : amended, - EventType{30, 31,32}, - EventTypeName{"TxRCommit", "TxRPrepare", "TxRRollback"} : amended -] -class Registry_TxR:Registry -{ - - [WmiDataId(1), - Description("TxRGUID") : amended, - extension("GUID"), - read] - uint8 TxrGUID[16]; - - - [WmiDataId(2), - Description("Status") : amended, - read] - uint32 Status; - - [WmiDataId(3), - Description("UOW Count") : amended, - read] - uint32 UowCount; - - [WmiDataId(4), - Description("Operation Time") : amended, - read] - uint64 OperationTime; - - [WmiDataId(5), - Description("Hive") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string Hive; - -}; - -[Dynamic, - Description("Registry") : amended, - EventType(34), - EventTypeName("Counters") : amended -] -class Registry_Counters:Registry -{ - [WmiDataId(1), - Description("Counter") : amended, - read] - uint64 Counter1; - [WmiDataId(2), - Description("Counter") : amended, - read] - uint64 Counter2; - [WmiDataId(3), - Description("Counter") : amended, - read] - uint64 Counter3; - [WmiDataId(4), - Description("Counter") : amended, - read] - uint64 Counter4; - [WmiDataId(5), - Description("Counter") : amended, - read] - uint64 Counter5; - [WmiDataId(6), - Description("Counter") : amended, - read] - uint64 Counter6; - [WmiDataId(7), - Description("Counter") : amended, - read] - uint64 Counter7; - [WmiDataId(8), - Description("Counter") : amended, - read] - uint64 Counter8; - [WmiDataId(9), - Description("Counter") : amended, - read] - uint64 Counter9; - [WmiDataId(10), - Description("Counter") : amended, - read] - uint64 Counter10; - [WmiDataId(11), - Description("Counter") : amended, - read] - uint64 Counter11; -}; - - -[Dynamic, - Description("Registry") : amended, - EventType(35), - EventTypeName("Config") : amended -] -class Registry_Config:Registry -{ - [WmiDataId(1), - Description("Current Control Set") : amended, - read] - uint32 CurrentControlSet; -}; - - -[Dynamic, - Description("Split IO Event") : amended, - Guid("{d837ca92-12b9-44a5-ad6a-3a65b3578aa8}"), - DisplayName("SplitIo") : amended, - locale("MS\\0x409") -] -class SplitIo:MSNT_SystemTrace -{ -}; - -[Dynamic, - Description("Split IO") : amended, - EventType(32), - EventTypeName("VolMgr") : amended, - locale("MS\\0x409") -] -class SplitIo_Info:SplitIo -{ - [WmiDataId(1), - Description("ParentIrp") : amended, - pointer, - read] - uint32 ParentIrp; - [WmiDataId(2), - Description("ChildIrp") : amended, - pointer, - read] - uint32 ChildIrp; -}; - -[Dynamic, - Description("File Name") : amended, - Guid("{90cbdc39-4a3e-11d1-84f4-0000f80464e3}"), - EventVersion(0), - DisplayName("FileIo") : amended -] -class FileIo_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("File Name") : amended, - EventType(0), - EventTypeName("Name") : amended -] -class FileIo_V0_Name:FileIo_V0 -{ - [WmiDataId(1), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(2), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; -}; - -[Dynamic, - Description("File Name") : amended, - Guid("{90cbdc39-4a3e-11d1-84f4-0000f80464e3}"), - EventVersion(1), - DisplayName("FileIo") : amended -] -class FileIo_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("File Name") : amended, - EventType{0, 32}, - EventTypeName{"Name", "FileCreate"} : amended -] -class FileIo_V1_Name:FileIo_V1 -{ - [WmiDataId(1), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(2), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; -}; - -[Dynamic, - Description("File Name") : amended, - Guid("{90cbdc39-4a3e-11d1-84f4-0000f80464e3}"), - EventVersion(2), - DisplayName("FileIo") : amended -] -class FileIo:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("File Name") : amended, - EventType{0, 32, 35, 36}, - EventTypeName{"Name", "FileCreate", "FileDelete", "FileRundown"} : amended -] -class FileIo_Name:FileIo -{ - [WmiDataId(1), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(2), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; -}; - -[Dynamic, - Description("File Create") : amended, - EventType(64), - EventTypeName("Create") : amended -] -class FileIo_Create:FileIo -{ - [WmiDataId(1), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(2), - Description("TTID") : amended, - pointer, - read] - uint32 TTID; - [WmiDataId(3), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(4), - Description("CreateOptions") : amended, - read] - uint32 CreateOptions; - [WmiDataId(5), - Description("FileAttributes") : amended, - read] - uint32 FileAttributes; - [WmiDataId(6), - Description("ShareAccess") : amended, - read] - uint32 ShareAccess; - [WmiDataId(7), - Description("OpenPath") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string OpenPath; -}; - -[Dynamic, - Description("File Simple Operation") : amended, - EventType{65, 66, 73}, - EventTypeName{"Cleanup", "Close", "Flush"} : amended -] -class FileIo_SimpleOp:FileIo -{ - [WmiDataId(1), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(2), - Description("TTID") : amended, - pointer, - read] - uint32 TTID; - [WmiDataId(3), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(4), - Description("FileKey") : amended, - pointer, - read] - uint32 FileKey; -}; - -[Dynamic, - Description("File Read Write") : amended, - EventType{67, 68}, - EventTypeName{"Read", "Write"} : amended -] -class FileIo_ReadWrite:FileIo -{ - [WmiDataId(1), - Description("Offset") : amended, - read] - uint64 Offset; - [WmiDataId(2), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(3), - Description("TTID") : amended, - pointer, - read] - uint32 TTID; - [WmiDataId(4), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(5), - Description("FileKey") : amended, - pointer, - read] - uint32 FileKey; - [WmiDataId(6), - Description("IoSize") : amended, - read] - uint32 IoSize; - [WmiDataId(7), - Description("IoFlags") : amended, - read] - uint32 IoFlags; -}; - - -[Dynamic, - Description("File Information") : amended, - EventType{69, 70, 71, 74, 75}, - EventTypeName{"SetInfo", "Delete", "Rename", "QueryInfo", "FSControl"} : amended -] -class FileIo_Info:FileIo -{ - [WmiDataId(1), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(2), - Description("TTID") : amended, - pointer, - read] - uint32 TTID; - [WmiDataId(3), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(4), - Description("FileKey") : amended, - pointer, - read] - uint32 FileKey; - [WmiDataId(5), - Description("ExtraInfo") : amended, - pointer, - read] - uint32 ExtraInfo; - [WmiDataId(6), - Description("InfoClass") : amended, - read] - uint32 InfoClass; -}; - -[Dynamic, - Description("File Dir Enum") : amended, - EventType{72, 77}, - EventTypeName{"DirEnum", "DirNotify"} : amended -] -class FileIo_DirEnum:FileIo -{ - [WmiDataId(1), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(2), - Description("TTID") : amended, - pointer, - read] - uint32 TTID; - [WmiDataId(3), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(4), - Description("FileKey") : amended, - pointer, - read] - uint32 FileKey; - [WmiDataId(5), - Description("Length") : amended, - read] - uint32 Length; - [WmiDataId(6), - Description("InfoClass") : amended, - read] - uint32 InfoClass; - [WmiDataId(7), - Description("FileIndex") : amended, - read] - uint32 FileIndex; - [WmiDataId(8), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; -}; - - -[Dynamic, - Description("File Operation End") : amended, - EventType(76), - EventTypeName("OperationEnd") : amended -] -class FileIo_OpEnd:FileIo -{ - [WmiDataId(1), - Description("IrpPtr") : amended, - pointer, - read] - uint32 IrpPtr; - [WmiDataId(2), - Description("ExtraInfo") : amended, - pointer, - read] - uint32 ExtraInfo; - [WmiDataId(3), - Description("NtStatus") : amended, - read] - uint32 NtStatus; -}; - -[Dynamic, - Description("TcpIp Send/Receive") : amended, - Guid("{9a280ac0-c8e0-11d1-84e2-00c04fb998a2}"), - EventVersion(0), - DisplayName("TcpIp") : amended -] -class TcpIp_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("TcpIp Send/Receive") : amended, - EventType{10, 11, 12, 13, 14, 15}, - EventTypeName{"Send", "Recv", "Connect", "Disconnect", "Retransmit", "Accept"} : amended -] -class TcpIp_V0_TypeGroup1:TcpIp_V0 -{ - [WmiDataId(1), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(2), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(3), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(4), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(5), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(6), - Description("Process ID") : amended, - read] - uint32 PID; -}; - -[Dynamic, - Description("TcpIp Send/Receive") : amended, - Guid("{9a280ac0-c8e0-11d1-84e2-00c04fb998a2}"), - EventVersion(1), - DisplayName("TcpIp") : amended -] -class TcpIp_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("TcpIp Receive") : amended, - EventType(11), - EventTypeName("Recv") : amended -] -class TcpIp_V1_Receive:TcpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; - [WmiDataId(8), - Description("Sequence Number") : amended, - read] - uint32 seqnum; -}; - -[Dynamic, - Description("TcpIp Disconnect") : amended, - EventType{13, 14, 16}, - EventTypeName{"Disconnect", "Retransmit", "Reconnect"} : amended -] -class TcpIp_V1_TypeGroup1:TcpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; - [WmiDataId(8), - Description("Sequence Number") : amended, - read] - uint32 seqnum; -}; - -[Dynamic, - Description("TcpIp Connect/Accept") : amended, - EventType{12, 15}, - EventTypeName{"Connect", "Accept"} : amended -] -class TcpIp_V1_TypeGroup2:TcpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("MSS") : amended, - read] - uint16 mss; - [WmiDataId(8), - Description("SACK Option") : amended, - read] - uint16 sackopt; - [WmiDataId(9), - Description("TimeStamp Option") : amended, - read] - uint16 tsopt; - [WmiDataId(10), - Description("WindowScale Option") : amended, - read] - uint16 wsopt; - [WmiDataId(11), - Description("TCP Window Size") : amended, - read] - uint32 rcvwin; - [WmiDataId(12), - Description("Receive Window Scale") : amended, - read] - sint16 rcvwinscale; - [WmiDataId(13), - Description("Send Window Scale") : amended, - read] - sint16 sndwinscale; - [WmiDataId(14), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; - [WmiDataId(15), - Description("Sequence Number") : amended, - read] - uint32 seqnum; -}; - -[Dynamic, - Description("TcpIp Fail") : amended, - EventType(17), - EventTypeName("Fail") : amended -] -class TcpIp_V1_Fail:TcpIp_V1 -{ - [WmiDataId(1), - Description("Protocol") : amended, - read] - uint32 Proto; -}; - -[Dynamic, - Description("TcpIp Send") : amended, - EventType(10), - EventTypeName("Send") : amended -] -class TcpIp_V1_Send:TcpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Start SendReq Time") : amended, - read] - uint32 startime; - [WmiDataId(8), - Description("End SendReq Time") : amended, - read] - uint32 endtime; - [WmiDataId(9), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; - [WmiDataId(10), - Description("Sequence Number") : amended, - read] - uint32 seqnum; -}; - -[Dynamic, - Description("TcpIp Copy/ACK") : amended, - EventType{18, 19, 20, 21, 22}, - EventTypeName{"TCPCopy", "ARPCopy", "FullACK", "PartACK", "DupACK"} : amended -] -class TcpIp_V1_TypeGroup3:TcpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; - [WmiDataId(8), - Description("Sequence Number") : amended, - read] - uint32 seqnum; -}; - -[Dynamic, - Description("TcpIp Send/Receive") : amended, - Guid("{9a280ac0-c8e0-11d1-84e2-00c04fb998a2}"), - EventVersion(2), - DisplayName("TcpIp") : amended -] -class TcpIp:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("TcpIp IPV4 Send") : amended, - EventType(10), - EventTypeName("SendIPV4") : amended -] -class TcpIp_SendIPV4:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV4"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV4"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Start SendReq Time") : amended, - read] - uint32 startime; - [WmiDataId(8), - Description("End SendReq Time") : amended, - read] - uint32 endtime; - [WmiDataId(9), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(10), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("TcpIp IPV4 Generic") : amended, - EventType{11, 13, 14, 16, 18}, - EventTypeName{"RecvIPV4", "DisconnectIPV4", "RetransmitIPV4", "ReconnectIPV4", "TCPCopyIPV4"} : amended -] -class TcpIp_TypeGroup1:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV4"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV4"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(8), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("TcpIp IPV4 Connect/Accept") : amended, - EventType{12, 15}, - EventTypeName{"ConnectIPV4", "AcceptIPV4"} : amended -] -class TcpIp_TypeGroup2:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV4"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV4"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("MSS") : amended, - read] - uint16 mss; - [WmiDataId(8), - Description("SACK Option") : amended, - read] - uint16 sackopt; - [WmiDataId(9), - Description("TimeStamp Option") : amended, - read] - uint16 tsopt; - [WmiDataId(10), - Description("WindowScale Option") : amended, - read] - uint16 wsopt; - [WmiDataId(11), - Description("TCP Window Size") : amended, - read] - uint32 rcvwin; - [WmiDataId(12), - Description("Receive Window Scale") : amended, - read] - sint16 rcvwinscale; - [WmiDataId(13), - Description("Send Window Scale") : amended, - read] - sint16 sndwinscale; - [WmiDataId(14), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(15), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("TcpIp Fail") : amended, - EventType(17), - EventTypeName("Fail") : amended -] -class TcpIp_Fail:TcpIp -{ - [WmiDataId(1), - Description("Protocol") : amended, - read] - uint16 Proto; - [WmiDataId(2), - Description("FailureCode") : amended, - read] - uint16 FailureCode; -}; - -[Dynamic, - Description("TcpIp IPV6 Send") : amended, - EventType(26), - EventTypeName("SendIPV6") : amended -] -class TcpIp_SendIPV6:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV6"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV6"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Start SendReq Time") : amended, - read] - uint32 startime; - [WmiDataId(8), - Description("End SendReq Time") : amended, - read] - uint32 endtime; - [WmiDataId(9), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(10), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("TcpIp IPV6 Generic") : amended, - EventType{27, 29, 30, 32, 34}, - EventTypeName{"RecvIPV6", "DisconnectIPV6", "RetransmitIPV6", "ReconnectIPV6", "TCPCopyIPV6"} : amended -] -class TcpIp_TypeGroup3:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV6"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV6"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(8), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("TcpIp IPV6 Connect/Accept") : amended, - EventType{28, 31}, - EventTypeName{"ConnectIPV6", "AcceptIPV6"} : amended -] -class TcpIp_TypeGroup4:TcpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV6"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV6"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("MSS") : amended, - read] - uint16 mss; - [WmiDataId(8), - Description("SACK Option") : amended, - read] - uint16 sackopt; - [WmiDataId(9), - Description("TimeStamp Option") : amended, - read] - uint16 tsopt; - [WmiDataId(10), - Description("WindowScale Option") : amended, - read] - uint16 wsopt; - [WmiDataId(11), - Description("TCP Window Size") : amended, - read] - uint32 rcvwin; - [WmiDataId(12), - Description("Receive Window Scale") : amended, - read] - sint16 rcvwinscale; - [WmiDataId(13), - Description("Send Window Scale") : amended, - read] - sint16 sndwinscale; - [WmiDataId(14), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(15), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("UdpIp Send/Receive") : amended, - Guid("{bf3a50c5-a9c9-4988-a005-2df0b7c80f80}"), - EventVersion(0), - DisplayName("UdpIp") : amended -] -class UdpIp_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("UdpIp Send/Receive") : amended, - EventType{10, 11}, - EventTypeName{"Send", "Recv"} : amended -] -class UdpIp_V0_TypeGroup1:UdpIp_V0 -{ - [WmiDataId(1), - Description("Process ID") : amended, - pointer, - read] - uint32 context; - [WmiDataId(2), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(3), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(4), - Description("Transfer Size in Bytes") : amended, - read] - uint16 size; - [WmiDataId(5), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(6), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(7), - Description("Number of Bytes successfully sent") : amended, - read] - uint16 dsize; -}; - -[Dynamic, - Description("UdpIp Send/Receive") : amended, - Guid("{bf3a50c5-a9c9-4988-a005-2df0b7c80f80}"), - EventVersion(1), - DisplayName("UdpIp") : amended -] -class UdpIp_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("UdpIp Send/Receive") : amended, - EventType{10, 11}, - EventTypeName{"Send", "Recv"} : amended -] -class UdpIp_V1_TypeGroup1:UdpIp_V1 -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddr"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddr"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; -}; - -[Dynamic, - Description("UdpIp Send/Receive") : amended, - Guid("{bf3a50c5-a9c9-4988-a005-2df0b7c80f80}"), - EventVersion(2), - DisplayName("UdpIp") : amended -] -class UdpIp:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("UdpIp IPV4 Send/Receive") : amended, - EventType{10, 11}, - EventTypeName{"SendIPV4", "RecvIPV4"} : amended -] -class UdpIp_TypeGroup1:UdpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV4"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV4"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(8), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("UdpIp Fail") : amended, - EventType(17), - EventTypeName("Fail") : amended -] -class UdpIp_Fail:UdpIp -{ - [WmiDataId(1), - Description("Protocol") : amended, - read] - uint16 Proto; - [WmiDataId(2), - Description("FailureCode") : amended, - read] - uint16 FailureCode; -}; - -[Dynamic, - Description("UdpIp IPV6 Send/Receive") : amended, - EventType{26, 27}, - EventTypeName{"SendIPV6", "RecvIPV6"} : amended -] -class UdpIp_TypeGroup2:UdpIp -{ - [WmiDataId(1), - Description("Process ID") : amended, - read] - uint32 PID; - [WmiDataId(2), - Description("Transfer Size in Bytes") : amended, - read] - uint32 size; - [WmiDataId(3), - Description("Remote IP Address") : amended, - extension("IPAddrV6"), - read] - object daddr; - [WmiDataId(4), - Description("Local IP Address") : amended, - extension("IPAddrV6"), - read] - object saddr; - [WmiDataId(5), - Description("Remote Port") : amended, - extension("Port"), - read] - object dport; - [WmiDataId(6), - Description("Local Port") : amended, - extension("Port"), - read] - object sport; - [WmiDataId(7), - Description("Sequence Number") : amended, - read] - uint32 seqnum; - [WmiDataId(8), - Description("ConnID") : amended, - PointerType, - read] - uint32 connid; -}; - -[Dynamic, - Description("Image Load") : amended, - Guid("{2cb15d1d-5fc1-11d2-abe1-00a0c911f518}"), - EventVersion(0), - DisplayName("Image") : amended -] -class Image_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Image Load") : amended, - EventType(10), - EventTypeName("Load") : amended -] -class Image_V0_Load:Image_V0 -{ - [WmiDataId(1), - Description("BaseAddress") : amended, - pointer, - read] - uint32 BaseAddress; - [WmiDataId(2), - Description("ModuleSize") : amended, - read] - uint32 ModuleSize; - [WmiDataId(3), - Description("ImageFileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string ImageFileName; -}; - -[Dynamic, - Description("Image Load") : amended, - Guid("{2cb15d1d-5fc1-11d2-abe1-00a0c911f518}"), - EventVersion(1), - DisplayName("Image") : amended -] -class Image_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Image Load") : amended, - EventType(10), - EventTypeName("Load") : amended -] -class Image_V1_Load:Image_V1 -{ - [WmiDataId(1), - Description("ImageBase") : amended, - pointer, - read] - uint32 ImageBase; - [WmiDataId(2), - Description("ImageSize") : amended, - pointer, - read] - uint32 ImageSize; - [WmiDataId(3), - Description("ProcessId") : amended, - read] - uint32 ProcessId; - [WmiDataId(4), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; - -}; - -[Dynamic, - Description("Image Load") : amended, - Guid("{2cb15d1d-5fc1-11d2-abe1-00a0c911f518}"), - EventVersion(2), - DisplayName("Image") : amended -] -class Image:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Image Load") : amended, - EventType{10, 2, 3, 4}, - EventTypeName{"Load", "UnLoad", "DCStart", "DCEnd"} : amended -] -class Image_Load:Image -{ - [WmiDataId(1), - Description("ImageBase") : amended, - pointer, - read] - uint32 ImageBase; - [WmiDataId(2), - Description("ImageSize") : amended, - pointer, - read] - uint32 ImageSize; - [WmiDataId(3), - Description("ProcessId") : amended, - read] - uint32 ProcessId; - [WmiDataId(4), - Description("ImageChecksum") : amended, - read] - uint32 ImageChecksum; - [WmiDataId(5), - Description("TimeDateStamp") : amended, - read] - uint32 TimeDateStamp; - [WmiDataId(6), - Description("Reserved0") : amended, - read] - uint32 Reserved0; - [WmiDataId(7), - Description("DefaultBase") : amended, - pointer, - read] - uint32 DefaultBase; - [WmiDataId(8), - Description("Reserved1") : amended, - read] - uint32 Reserved1; - [WmiDataId(9), - Description("Reserved2") : amended, - read] - uint32 Reserved2; - [WmiDataId(10), - Description("Reserved3") : amended, - read] - uint32 Reserved3; - [WmiDataId(11), - Description("Reserved4") : amended, - read] - uint32 Reserved4; - [WmiDataId(12), - Description("FileName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FileName; - -}; - -[Dynamic, - Description("Kernel Image Base") : amended, - EventType(33), - EventTypeName("KernelBase") : amended -] -class KernelImageBase:Image -{ - [WmiDataId(1), - Description("ImageBase") : amended, - pointer, - read] - uint32 ImageBase; -}; - -[Dynamic, - Description("Page Fault Event") : amended, - Guid("{3d6fa8d3-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(2), - DisplayName("PageFault") : amended -] -class PageFault_V2:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Page Fault Event") : amended, - EventType{10, 11, 12, 13, 14, 15}, - EventTypeName{"TransitionFault", "DemandZeroFault", "CopyOnWrite", "GuardPageFault", "HardPageFault", "AccessViolation"} : amended -] -class PageFault_TypeGroup1:PageFault_V2 -{ - [WmiDataId(1), - Description("VirtualAddress") : amended, - pointer, - read] - uint32 VirtualAddress; - [WmiDataId(2), - Description("ProgramCounter") : amended, - pointer, - read] - uint32 ProgramCounter; -}; - -[Dynamic, - Description("Hard Page Fault Event") : amended, - EventType(32), - EventTypeName("HardFault") : amended -] -class PageFault_HardFault:PageFault_V2 -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("ReadOffset") : amended, - format("x"), - read] - uint64 ReadOffset; - [WmiDataId(3), - Description("VirtualAddress") : amended, - pointer, - read] - uint32 VirtualAddress; - [WmiDataId(4), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(5), - Description("ThreadId") : amended, - format("x"), - read] - uint32 TThreadId; - [WmiDataId(6), - Description("ByteCount") : amended, - read] - uint32 ByteCount; -}; - -[Dynamic, - Description("Heap Range Rundown Event") : amended, - EventType(100), - EventTypeName("HRRundown") : amended -] -class PageFault_HeapRangeRundown_V2:PageFault_V2 -{ - [WmiDataId(1), - Description("HeapHandle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("HRFlags") : amended, - format("x"), - read] - uint32 HRFlags; - [WmiDataId(3), - Description("HRPid") : amended, - format("x"), - read] - uint32 HRPid; - [WmiDataId(4), - Description("HRRangeCount") : amended, - read] - uint32 HRRangeCount; -}; - -[Dynamic, - Description("Heap Range Create Event") : amended, - EventType(101), - EventTypeName("HRCreate") : amended -] -class PageFault_HeapRangeCreate:PageFault_V2 -{ - [WmiDataId(1), - Description("HeapHandle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("FirstRangeSize") : amended, - extension("SizeT"), - read] - object FirstRangeSize; - [WmiDataId(3), - Description("HRCreateFlags") : amended, - format("x"), - read] - uint32 HRCreateFlags; -}; - -[Dynamic, - Description("Heap Range Event") : amended, - EventType{102, 103}, - EventTypeName{"HRReserve", "HRRelease"} : amended -] -class PageFault_HeapRangeTypeGroup:PageFault_V2 -{ - [WmiDataId(1), - Description("HeapHandle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("HRAddress") : amended, - pointer, - read] - uint32 HRAddress; - [WmiDataId(3), - Description("HRSize") : amended, - extension("SizeT"), - read] - object HRSize; -}; - -[Dynamic, - Description("Heap Range Destroy Event") : amended, - EventType(104), - EventTypeName("HRDestroy") : amended -] -class PageFault_HeapRangeDestroy:PageFault_V2 -{ - [WmiDataId(1), - Description("HeapHandle") : amended, - pointer, - read] - uint32 HeapHandle; -}; - -[Dynamic, - Description("Image Load in PageFile Event") : amended, - EventType(105), - EventTypeName("ImageLoadBacked") : amended -] -class PageFault_ImageLoadBacked:PageFault_V2 -{ - [WmiDataId(1), - Description("FileObject") : amended, - pointer, - read] - uint32 FileObject; - [WmiDataId(2), - Description("DeviceChar") : amended, - format("x"), - read] - uint32 DeviceChar; - [WmiDataId(3), - Description("FileChar") : amended, - format("x"), - read] - uint16 FileChar; - [WmiDataId(4), - Description("LoadFlags") : amended, - format("x"), - read] - uint16 LoadFlags; -}; - -[Dynamic, - Description("Virtual Allocations") : amended, - EventType{98, 99}, - EventTypeName{"VirtualAlloc", "VirtualFree"} : amended -] -class PageFault_VirtualAlloc:PageFault_V2 -{ - [WmiDataId(1), - Description("BaseAddress") : amended, - pointer, - read] - uint32 BaseAddress; - [WmiDataId(2), - Description("RegionSize") : amended, - extension("SizeT"), - read] - object RegionSize; - [WmiDataId(3), - Description("ProcessId") : amended, - read] - uint32 ProcessId; - [WmiDataId(4), - Description("Flags") : amended, - format("x"), - read] - uint32 Flags; -}; - -[Dynamic, - Description("Page Fault Event") : amended, - Guid("{3d6fa8d3-fe05-11d0-9dda-00c04fd7ba7c}"), - EventVersion(3), - DisplayName("PageFault") : amended -] -class PageFault:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Heap Range Rundown Event") : amended, - EventType(100), - EventTypeName("HRRundown") : amended -] -class PageFault_HeapRangeRundown:PageFault -{ - [WmiDataId(1), - Description("HeapHandle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("HRFlags") : amended, - format("x"), - read] - uint32 HRFlags; - [WmiDataId(3), - Description("HRPid") : amended, - format("x"), - read] - uint32 HRPid; - [WmiDataId(4), - Description("HRRangeCount") : amended, - read] - uint32 HRRangeCount; - [WmiDataId(5), - Description("Reserved") : amended, - read] - uint32 Reserved; -}; - - -[Dynamic, - Description("PerfInfo Event") : amended, - Guid("{ce1dbfb4-137e-4da6-87b0-3f59aa102cbc}"), - EventVersion(1), - DisplayName("PerfInfo") : amended -] -class PerfInfo_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("ISR") : amended, - EventType(67), - EventTypeName("ISR") : amended -] -class ISR_V1:PerfInfo_V1 -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; - [WmiDataId(3), - Description("Return Value") : amended, - read] - uint32 ReturnValue; -}; - - -[Dynamic, - Description("DPC") : amended, - EventType{68, 69}, - EventTypeName{"DPC", "TimerDPC"} : amended -] -class DPC_V1:PerfInfo_V1 -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; -}; - -[Dynamic, - Description("PerfInfo Event") : amended, - Guid("{ce1dbfb4-137e-4da6-87b0-3f59aa102cbc}"), - EventVersion(2), - DisplayName("PerfInfo") : amended -] -class PerfInfo:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Sampled Profile") : amended, - EventType(46), - EventTypeName("SampleProf") : amended -] -class SampledProfile:PerfInfo -{ - [WmiDataId(1), - Description("InstructionPointer") : amended, - pointer, - read] - uint32 InstructionPointer; - [WmiDataId(2), - Description("ThreadId") : amended, - read] - uint32 ThreadId; - [WmiDataId(3), - Description("Count") : amended, - read] - uint16 Count; - [WmiDataId(4), - Description("Reserved") : amended, - read] - uint16 Reserved; -}; - -[Dynamic, - Description("Sampled Profile Interval") : amended, - EventType{72, 73, 74}, - EventTypeName{"SetInterval", "CollectionStart", "CollectionEnd"} : amended -] -class SampledProfileInterval:PerfInfo -{ - [WmiDataId(1), - Description("Profile Source") : amended, - read] - uint32 Source; - [WmiDataId(2), - Description("New Interval") : amended, - read] - uint32 NewInterval; - [WmiDataId(3), - Description("Old Interval") : amended, - read] - uint32 OldInterval; -}; - - - -[Dynamic, - Description("System Call Enter") : amended, - EventType(51), - EventTypeName("SysClEnter") : amended -] -class SysCallEnter:PerfInfo -{ - [WmiDataId(1), - Description("SysCallAddress") : amended, - pointer, - read] - uint32 SysCallAddress; -}; - -[Dynamic, - Description("System Call Exit") : amended, - EventType(52), - EventTypeName("SysClExit") : amended -] -class SysCallExit:PerfInfo -{ - [WmiDataId(1), - Description("SysCallNtStatus") : amended, - format("x"), - read] - uint32 SysCallNtStatus; -}; - -[Dynamic, - Description("ISR") : amended, - EventType(67), - EventTypeName("ISR") : amended -] -class ISR:PerfInfo -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; - [WmiDataId(3), - Description("Return Value") : amended, - read] - uint8 ReturnValue; - [WmiDataId(4), - Description("Interrupt Vector") : amended, - read] - uint8 Vector; - [WmiDataId(5), - Description("Reserved") : amended, - read] - uint16 Reserved; -}; - -[Dynamic, - Description("Message Signaled ISR") : amended, - EventType(50), - EventTypeName("ISR-MSI") : amended -] -class ISR_MSI:PerfInfo -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; - [WmiDataId(3), - Description("Return Value") : amended, - read] - uint8 ReturnValue; - [WmiDataId(4), - Description("Interrupt Vector") : amended, - read] - uint8 Vector; - [WmiDataId(5), - Description("Reserved") : amended, - read] - uint16 Reserved; - [WmiDataId(6), - Description("Message Number") : amended, - read] - uint32 MessageNumber; -}; - - -[Dynamic, - Description("DPC") : amended, - EventType{66, 68, 69}, - EventTypeName{"ThreadedDPC", "DPC", "TimerDPC"} : amended -] -class DPC:PerfInfo -{ - [WmiDataId(1), - Description("Initial Time") : amended, - extension("WmiTime"), - read] - object InitialTime; - [WmiDataId(2), - Description("Routine") : amended, - pointer, - read] - uint32 Routine; -}; - -[Dynamic, - Description("Debugger Enabled") : amended, - EventType{58}, - EventTypeName{"DebuggerEnabled"} : amended -] -class DebuggerEnabled:PerfInfo -{ -}; - -[Dynamic, - Description("StackWalk Event") : amended, - Guid("{def2fe46-7bd6-4b80-bd94-f57fe20d0ce3}"), - DisplayName("StackWalk") : amended -] -class StackWalk:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("StackWalk Event") : amended, - EventType(32), - EventTypeName("Stack") : amended -] -class StackWalk_Event:StackWalk -{ - [WmiDataId(1), - Description("TimeStamp") : amended, - read] - uint64 EventTimeStamp; - [WmiDataId(2), - Description("ProcessId") : amended, - format("x"), - read] - uint32 StackProcess; - [WmiDataId(3), - Description("ThreadId") : amended, - read] - uint32 StackThread; - [WmiDataId(4), - Description("Stack1") : amended, - pointer, - read] - uint32 Stack1; - [WmiDataId(5), - Description("Stack2") : amended, - pointer, - read] - uint32 Stack2; - [WmiDataId(6), - Description("Stack3") : amended, - pointer, - read] - uint32 Stack3; - [WmiDataId(7), - Description("Stack4") : amended, - pointer, - read] - uint32 Stack4; - [WmiDataId(8), - Description("Stack5") : amended, - pointer, - read] - uint32 Stack5; - [WmiDataId(9), - Description("Stack6") : amended, - pointer, - read] - uint32 Stack6; - [WmiDataId(10), - Description("Stack7") : amended, - pointer, - read] - uint32 Stack7; - [WmiDataId(11), - Description("Stack8") : amended, - pointer, - read] - uint32 Stack8; - [WmiDataId(12), - Description("Stack9") : amended, - pointer, - read] - uint32 Stack9; - [WmiDataId(13), - Description("Stack10") : amended, - pointer, - read] - uint32 Stack10; - [WmiDataId(14), - Description("Stack11") : amended, - pointer, - read] - uint32 Stack11; - [WmiDataId(15), - Description("Stack12") : amended, - pointer, - read] - uint32 Stack12; - [WmiDataId(16), - Description("Stack13") : amended, - pointer, - read] - uint32 Stack13; - [WmiDataId(17), - Description("Stack14") : amended, - pointer, - read] - uint32 Stack14; - [WmiDataId(18), - Description("Stack15") : amended, - pointer, - read] - uint32 Stack15; - [WmiDataId(19), - Description("Stack16") : amended, - pointer, - read] - uint32 Stack16; - [WmiDataId(20), - Description("Stack17") : amended, - pointer, - read] - uint32 Stack17; - [WmiDataId(21), - Description("Stack18") : amended, - pointer, - read] - uint32 Stack18; - [WmiDataId(22), - Description("Stack19") : amended, - pointer, - read] - uint32 Stack19; - [WmiDataId(23), - Description("Stack20") : amended, - pointer, - read] - uint32 Stack20; - [WmiDataId(24), - Description("Stack21") : amended, - pointer, - read] - uint32 Stack21; - [WmiDataId(25), - Description("Stack22") : amended, - pointer, - read] - uint32 Stack22; - [WmiDataId(26), - Description("Stack23") : amended, - pointer, - read] - uint32 Stack23; - [WmiDataId(27), - Description("Stack24") : amended, - pointer, - read] - uint32 Stack24; - [WmiDataId(28), - Description("Stack25") : amended, - pointer, - read] - uint32 Stack25; - [WmiDataId(29), - Description("Stack26") : amended, - pointer, - read] - uint32 Stack26; - [WmiDataId(30), - Description("Stack27") : amended, - pointer, - read] - uint32 Stack27; - [WmiDataId(31), - Description("Stack28") : amended, - pointer, - read] - uint32 Stack28; - [WmiDataId(32), - Description("Stack29") : amended, - pointer, - read] - uint32 Stack29; - [WmiDataId(33), - Description("Stack30") : amended, - pointer, - read] - uint32 Stack30; - [WmiDataId(34), - Description("Stack31") : amended, - pointer, - read] - uint32 Stack31; - [WmiDataId(35), - Description("Stack32") : amended, - pointer, - read] - uint32 Stack32; - -}; - - -[Dynamic, - Description("ALPC Event") : amended, - Guid("{45d8cccd-539f-4b72-a8b7-5c683142609a}"), - DisplayName("ALPC") : amended -] -class ALPC:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("ALPC Send Message") : amended, - EventType(33), - EventTypeName("ALPC-Send-Message") : amended -] -class ALPC_Send_Message:ALPC -{ - [WmiDataId(1), - Description("MessageID") : amended, - read] - uint32 MessageID; -}; - -[Dynamic, - Description("ALPC Receive Message") : amended, - EventType(34), - EventTypeName("ALPC-Receive-Message") : amended -] -class ALPC_Receive_Message:ALPC -{ - [WmiDataId(1), - Description("MessageID") : amended, - read] - uint32 MessageID; -}; - -[Dynamic, - Description("ALPC Wait For Reply") : amended, - EventType(35), - EventTypeName("ALPC-Wait-For-Reply") : amended -] -class ALPC_Wait_For_Reply:ALPC -{ - [WmiDataId(1), - Description("MessageID") : amended, - read] - uint32 MessageID; -}; - -[Dynamic, - Description("ALPC Wait For New Message") : amended, - EventType(36), - EventTypeName("ALPC-Wait-For-New-Message") : amended -] -class ALPC_Wait_For_New_Message:ALPC -{ - [WmiDataId(1), - Description("IsServerPort") : amended, - read] - uint32 IsServerPort; - [WmiDataId(2), - Description("PortName") : amended, - read] - string PortName; -}; - -[Dynamic, - Description("ALPC Unwait") : amended, - EventType(37), - EventTypeName("ALPC-Unwait") : amended -] -class ALPC_Unwait:ALPC -{ - [WmiDataId(1), - Description("Status") : amended, - read] - uint32 Status; -}; - -[Dynamic, - Description("Heap Trace Provider"): amended, - Guid("{222962ab-6180-4b88-a825-346b75f2a24a}") -] -class HeapTraceProvider:EventTrace -{ - -}; - -[Dynamic, - Description("Heap Event") : amended, - Guid("{222962ab-6180-4b88-a825-346b75f2a24a}"), - EventVersion(2), - DisplayName("Heap") : amended -] -class HeapTrace_V2:HeapTraceProvider -{ - -}; - -[Dynamic, - Description("Heap Create") : amended, - EventType(32), - EventTypeName("Create") : amended -] -class HeapCreate_V2:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Heap Flags") : amended, - read] - uint32 HeapFlags; -}; - -[Dynamic, - Description("Heap Allocate") : amended, - EventType(33), - EventTypeName("Alloc") : amended -] -class HeapAlloc:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Allocation Size") : amended, - extension("SizeT"), - read] - object AllocSize; - [WmiDataId(3), - Description("Allocation Address") : amended, - pointer, - read] - uint32 AllocAddress; - [WmiDataId(4), - Description("Source ID") : amended, - read] - uint32 SourceId; -}; - -[Dynamic, - Description("Heap ReAllocate") : amended, - EventType(34), - EventTypeName("ReAlloc") : amended -] -class HeapRealloc:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("New Allocation Address") : amended, - pointer, - read] - uint32 NewAllocAddress; - [WmiDataId(3), - Description("Old Allocation Address") : amended, - pointer, - read] - uint32 OldAllocAddress; - [WmiDataId(4), - Description("New Allocation Size") : amended, - extension("SizeT"), - read] - object NewAllocSize; - [WmiDataId(5), - Description("Old Allocation Size") : amended, - extension("SizeT"), - read] - object OldAllocSize; - [WmiDataId(6), - Description("Source ID") : amended, - read] - uint32 SourceId; -}; - -[Dynamic, - Description("Heap Free") : amended, - EventType(36), - EventTypeName("Free") : amended -] -class HeapFree:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Free Address") : amended, - pointer, - read] - uint32 FreeAddress; - [WmiDataId(3), - Description("Source ID") : amended, - read] - uint32 SourceId; -}; - -[Dynamic, - Description("Heap SnapShot") : amended, - EventType(38), - EventTypeName("SnapShot") : amended -] -class HeapSnapShot_V2:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Free Space") : amended, - extension("SizeT"), - read] - object FreeSpace; - [WmiDataId(3), - Description("Committed Space") : amended, - extension("SizeT"), - read] - object CommittedSpace; - [WmiDataId(4), - Description("Reserved Space") : amended, - extension("SizeT"), - read] - object ReservedSpace; - [WmiDataId(5), - Description("Heap Flags") : amended, - read] - uint32 HeapFlags; - [WmiDataId(6), - Description("Process ID") : amended, - read] - uint32 ProcessId; - [WmiDataId(7), - Description("Large UCR Space") : amended, - extension("SizeT"), - read] - object LargeUCRSpace; - [WmiDataId(8), - Description("Free List Length") : amended, - read] - uint32 FreeListLength; - [WmiDataId(9), - Description("UCR Length") : amended, - read] - uint32 UCRLength; -}; - -[Dynamic, - Description("Heap Events") : amended, - EventType{35, 43, 44, 45, 46}, - EventTypeName{"Destroy", "Lock", "Unlock", "Validate", "Walk"} : amended -] -class Heap_TypeGroup1:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; -}; - -[Dynamic, - Description("Heap Subsegment Events") : amended, - EventType{47, 48, 49, 50}, - EventTypeName{"SubsegmentAlloc", "SubsegmentFree", "SubsegmentAllocCached", "SubsegmentFreeCached"} : amended -] -class Heap_SubsegmentGroup:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Subsegment") : amended, - pointer, - read] - uint32 SubSegment; - [WmiDataId(3), - Description("Subsegment Size") : amended, - extension("SizeT"), - read] - object SubSegmentSize; - [WmiDataId(4), - Description("Block Size") : amended, - extension("SizeT"), - read] - object BlockSize; -}; - -[Dynamic, - Description("Heap Commit and Decommit") : amended, - EventType{51, 52}, - EventTypeName{"Commit", "Decommit"} : amended -] -class HeapCommitDecommit:HeapTrace_V2 -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Block Address") : amended, - pointer, - read] - uint32 Block; - [WmiDataId(3), - Description("Block Size") : amended, - extension("SizeT"), - read] - object Size; - [WmiDataId(4), - Description("Caller") : amended, - read] - uint32 Caller; -}; - -[Dynamic, - Description("Heap Event") : amended, - Guid("{222962ab-6180-4b88-a825-346b75f2a24a}"), - EventVersion(3), - DisplayName("Heap") : amended -] -class HeapTrace:HeapTraceProvider -{ - -}; - -[Dynamic, - Description("Heap Create") : amended, - EventType(32), - EventTypeName("Create") : amended -] -class HeapCreate:HeapTrace -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Heap Flags") : amended, - read] - uint32 HeapFlags; - [WmiDataId(3), - Description("Reserved Space") : amended, - extension("SizeT"), - read] - object ReservedSpace; - [WmiDataId(4), - Description("Committed Space") : amended, - extension("SizeT"), - read] - object CommittedSpace; - [WmiDataId(5), - Description("Allocated Size") : amended, - extension("SizeT"), - read] - object AllocatedSpace; -}; - -[Dynamic, - Description("Heap Expand") : amended, - EventType(37), - EventTypeName("Expand") : amended -] -class HeapExpand:HeapTrace -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Committed Size") : amended, - extension("SizeT"), - read] - object CommittedSize; - [WmiDataId(3), - Description("Committed Address") : amended, - pointer, - read] - uint32 CommitAddress; - [WmiDataId(4), - Description("Free Space") : amended, - extension("SizeT"), - read] - object FreeSpace; - [WmiDataId(5), - Description("Committed Space") : amended, - extension("SizeT"), - read] - object CommittedSpace; - [WmiDataId(6), - Description("Reserved Space") : amended, - extension("SizeT"), - read] - object ReservedSpace; - [WmiDataId(7), - Description("Number Of UCRs") : amended, - read] - uint32 NoOfUCRs; - [WmiDataId(8), - Description("Allocated Space") : amended, - extension("SizeT"), - read] - object AllocatedSpace; -}; - -[Dynamic, - Description("Heap SnapShot") : amended, - EventType(38), - EventTypeName("SnapShot") : amended -] -class HeapSnapShot:HeapTrace -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("Free Space") : amended, - extension("SizeT"), - read] - object FreeSpace; - [WmiDataId(3), - Description("Committed Space") : amended, - extension("SizeT"), - read] - object CommittedSpace; - [WmiDataId(4), - Description("Reserved Space") : amended, - extension("SizeT"), - read] - object ReservedSpace; - [WmiDataId(5), - Description("Heap Flags") : amended, - read] - uint32 HeapFlags; - [WmiDataId(6), - Description("ProcessId") : amended, - read] - uint32 ProcessId; - [WmiDataId(7), - Description("Large UCR Space") : amended, - extension("SizeT"), - read] - object LargeUCRSpace; - [WmiDataId(8), - Description("Free List Length") : amended, - read] - uint32 FreeListLength; - [WmiDataId(9), - Description("UCR Length") : amended, - read] - uint32 UCRLength; - [WmiDataId(10), - Description("Allocated Space") : amended, - extension("SizeT"), - read] - object AllocatedSpace; -}; - -[Dynamic, - Description("Heap Contract") : amended, - EventType(42), - EventTypeName("Contract") : amended -] -class HeapContract:HeapTrace -{ - [WmiDataId(1), - Description("Heap Handle") : amended, - pointer, - read] - uint32 HeapHandle; - [WmiDataId(2), - Description("DeCommitted Size") : amended, - extension("SizeT"), - read] - object DeCommittedSize; - [WmiDataId(3), - Description("DeCommitted Address") : amended, - pointer, - read] - uint32 DeCommitAddress; - [WmiDataId(4), - Description("Free Space") : amended, - extension("SizeT"), - read] - object FreeSpace; - [WmiDataId(5), - Description("Committed Space") : amended, - extension("SizeT"), - read] - object CommittedSpace; - [WmiDataId(6), - Description("Reserved Space") : amended, - extension("SizeT"), - read] - object ReservedSpace; - [WmiDataId(7), - Description("Number Of UCRs") : amended, - read] - uint32 NoOfUCRs; - [WmiDataId(8), - Description("Allocated Space") : amended, - extension("SizeT"), - read] - object AllocatedSpace; -}; - - -[Dynamic, - Description("Critical Section Trace Provider") : amended, - Guid("{3AC66736-CC59-4cff-8115-8DF50E39816B}") -] -class CritSecTraceProvider:EventTrace -{ - -}; - -[Dynamic, - Description("Critical Section Event") : amended, - Guid("{3AC66736-CC59-4cff-8115-8DF50E39816B}"), - DisplayName("CritSec") : amended -] -class CritSecTrace:CritSecTraceProvider -{ - -}; - -[Dynamic, - Description("Critical Section Collision") : amended, - EventType(34), - EventTypeName("Collision") : amended -] -class CritSecCollision:CritSecTrace -{ - [WmiDataId(1), - Description("Lock Count") : amended, - read] - uint32 LockCount; - [WmiDataId(2), - Description("Spin Count") : amended, - read] - uint32 SpinCount; - [WmiDataId(3), - Description("Owning Thread") : amended, - pointer, - read] - uint32 OwningThread; - [WmiDataId(4), - Description("Critical Section Address") : amended, - pointer, - read] - uint32 CritSecAddr; -}; - -[Dynamic, - Description("Critical Section Initialize") : amended, - EventType(35), - EventTypeName("Initialize") : amended -] -class CritSecInit:CritSecTrace -{ - [WmiDataId(1), - Description("Spin Count") : amended, - pointer, - read] - uint32 SpinCount; - [WmiDataId(2), - Description("Critical Section Address") : amended, - pointer, - read] - uint32 CritSecAddr; -}; - -[Dynamic, - Description("Lost Event Event") : amended, - Guid("{6a399ae0-4bc6-4de9-870b-3657f8947e7e}"), - DisplayName("LostEvent") : amended -] -class Lost_Event:MSNT_SystemTrace -{ -}; - -[Dynamic, - Description("RT Lost Event") : amended, - EventType{32, 33, 34}, - EventTypeName{"RTLostEvent", "RTLostBuffer", "RTLostFile"} : amended -] -class RT_LostEvent:Lost_Event -{ -}; - - -[Dynamic, - Description("System Configuration") : amended, - Guid("{01853a65-418f-4f36-aefc-dc0f1d2fd235}"), - EventVersion(0), - DisplayName("SystemConfig") : amended -] -class SystemConfig_V0:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(10), - EventTypeName("CPU") : amended -] -class SystemConfig_V0_CPU:SystemConfig_V0 -{ - [WmiDataId(1), - Description("MHz") : amended, - read] - uint32 MHz; - [WmiDataId(2), - Description("NumberOfProcessors") : amended, - read] - uint32 NumberOfProcessors; - [WmiDataId(3), - Description("MemSize") : amended, - read] - uint32 MemSize; - [WmiDataId(4), - Description("PageSize") : amended, - read] - uint32 PageSize; - [WmiDataId(5), - Description("AllocationGranularity") : amended, - read] - uint32 AllocationGranularity; - [WmiDataId(6), - Description("ComputerName") : amended, - read] - char16 ComputerName[256]; - [WmiDataId(7), - Description("DomainName") : amended, - read] - char16 DomainName[132]; - [WmiDataId(8), - Description("HyperThreadingFlag") : amended, - pointer, - read] - uint32 HyperThreadingFlag; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(11), - EventTypeName("PhyDisk") : amended -] -class SystemConfig_V0_PhyDisk:SystemConfig_V0 -{ - [WmiDataId(1), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(2), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(3), - Description("SectorsPerTrack") : amended, - read] - uint32 SectorsPerTrack; - [WmiDataId(4), - Description("TracksPerCylinder") : amended, - read] - uint32 TracksPerCylinder; - [WmiDataId(5), - Description("Cylinders") : amended, - read] - uint64 Cylinders; - [WmiDataId(6), - Description("SCSIPort") : amended, - read] - uint32 SCSIPort; - [WmiDataId(7), - Description("SCSIPath") : amended, - read] - uint32 SCSIPath; - [WmiDataId(8), - Description("SCSITarget") : amended, - read] - uint32 SCSITarget; - [WmiDataId(9), - Description("SCSILun") : amended, - read] - uint32 SCSILun; - [WmiDataId(10), - Description("Manufacturer") : amended, - read] - char16 Manufacturer[256]; - [WmiDataId(11), - Description("PartitionCount") : amended, - read] - uint32 PartitionCount; - [WmiDataId(12), - Description("WriteCacheEnabled") : amended, - read] - uint8 WriteCacheEnabled; - [WmiDataId(13), - Description("Pad: not used") : amended, - read] - uint8 Pad; - [WmiDataId(14), - Description("BootDriveLetter") : amended, - read] - char16 BootDriveLetter[3]; - [WmiDataId(15), - Description("Spare") : amended, - read] - char16 Spare[2]; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(12), - EventTypeName("LogDisk") : amended -] -class SystemConfig_V0_LogDisk:SystemConfig_V0 -{ - [WmiDataId(1), - Description("StartOffset") : amended, - read] - uint64 StartOffset; - [WmiDataId(2), - Description("PartitionSize") : amended, - read] - uint64 PartitionSize; - [WmiDataId(3), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(4), - Description("Size") : amended, - read] - uint32 Size; - [WmiDataId(5), - Description("DriveType") : amended, - read] - uint32 DriveType; - [WmiDataId(6), - Description("DriveLetter") : amended, - read] - char16 DriveLetterString[4]; - [WmiDataId(7), - Description("Pad1") : amended, - read] - uint32 Pad1; - [WmiDataId(8), - Description("PartitionNumber") : amended, - read] - uint32 PartitionNumber; - [WmiDataId(9), - Description("SectorsPerCluster") : amended, - read] - uint32 SectorsPerCluster; - [WmiDataId(10), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(11), - Description("Pad2") : amended, - read] - uint32 Pad2; - [WmiDataId(12), - Description("NumberOfFreeClusters") : amended, - read] - sint64 NumberOfFreeClusters; - [WmiDataId(13), - Description("TotalNumberOfClusters") : amended, - read] - sint64 TotalNumberOfClusters; - [WmiDataId(14), - Description("FileSystem") : amended, - read] - char16 FileSystem[16]; - [WmiDataId(15), - Description("VolumeExtent") : amended, - read] - uint32 VolumeExt; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(13), - EventTypeName("NIC") : amended -] -class SystemConfig_V0_NIC:SystemConfig_V0 -{ - [WmiDataId(1), - Description("NICName") : amended, - read] - char16 NICName[256]; - [WmiDataId(2), - Description("Index") : amended, - read] - uint32 Index; - [WmiDataId(3), - Description("PhysicalAddressLen") : amended, - read] - uint32 PhysicalAddrLen; - [WmiDataId(4), - Description("PhysicalAddress") : amended, - read] - char16 PhysicalAddr[8]; - [WmiDataId(5), - Description("Size") : amended, - read] - uint32 Size; - [WmiDataId(6), - Description("IpAddress") : amended, - read] - sint32 IpAddress; - [WmiDataId(7), - Description("SubnetMask") : amended, - read] - sint32 SubnetMask; - [WmiDataId(8), - Description("DhcpServer") : amended, - read] - sint32 DhcpServer; - [WmiDataId(9), - Description("Gateway") : amended, - read] - sint32 Gateway; - [WmiDataId(10), - Description("PrimaryWinsServer") : amended, - read] - sint32 PrimaryWinsServer; - [WmiDataId(11), - Description("SecondaryWinsServer") : amended, - read] - sint32 SecondaryWinsServer; - [WmiDataId(12), - Description("DnsServer1") : amended, - read] - sint32 DnsServer1; - [WmiDataId(13), - Description("DnsServer2") : amended, - read] - sint32 DnsServer2; - [WmiDataId(14), - Description("DnsServer3") : amended, - read] - sint32 DnsServer3; - [WmiDataId(15), - Description("DnsServer4") : amended, - read] - sint32 DnsServer4; - [WmiDataId(16), - Description("Reserved; do not use.") : amended, - read] - uint32 Data; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(14), - EventTypeName("Video") : amended -] -class SystemConfig_V0_Video:SystemConfig_V0 -{ - [WmiDataId(1), - Description("MemorySize") : amended, - read] - uint32 MemorySize; - [WmiDataId(2), - Description("XResolution") : amended, - read] - uint32 XResolution; - [WmiDataId(3), - Description("YResolution") : amended, - read] - uint32 YResolution; - [WmiDataId(4), - Description("BitsPerPixel") : amended, - read] - uint32 BitsPerPixel; - [WmiDataId(5), - Description("VRefresh") : amended, - read] - uint32 VRefresh; - [WmiDataId(6), - Description("ChipType") : amended, - read] - char16 ChipType[256]; - [WmiDataId(7), - Description("DACType") : amended, - read] - char16 DACType[256]; - [WmiDataId(8), - Description("AdapterString") : amended, - read] - char16 AdapterString[256]; - [WmiDataId(9), - Description("BiosString") : amended, - read] - char16 BiosString[256]; - [WmiDataId(10), - Description("Device Name") : amended, - read] - char16 DeviceId[256]; - [WmiDataId(11), - Description("StateFlags") : amended, - format("x"), - read] - uint32 StateFlags; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(15), - EventTypeName("Services") : amended -] -class SystemConfig_V0_Services:SystemConfig_V0 -{ - [WmiDataId(1), - Description("ServiceName") : amended, - read] - char16 ServiceName[34]; - [WmiDataId(2), - Description("DisplayName") : amended, - read] - char16 DisplayName[256]; - [WmiDataId(3), - Description("ProcessName") : amended, - read] - char16 ProcessName[34]; - [WmiDataId(4), - Description("ProcessId") : amended, - read] - uint32 ProcessId; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(16), - EventTypeName("Power") : amended -] -class SystemConfig_V0_Power:SystemConfig_V0 -{ - [WmiDataId(1), - Description("S1") : amended, - read] - uint8 S1; - [WmiDataId(2), - Description("S2") : amended, - read] - uint8 S2; - [WmiDataId(3), - Description("S3") : amended, - read] - uint8 S3; - [WmiDataId(4), - Description("S4") : amended, - read] - uint8 S4; - [WmiDataId(5), - Description("S5") : amended, - read] - uint8 S5; - [WmiDataId(6), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad1; - [WmiDataId(7), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad2; - [WmiDataId(8), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad3; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(21), - EventTypeName("IRQ") : amended -] -class SystemConfig_V0_IRQ:SystemConfig_V0 -{ - [WmiDataId(1), - Description("IRQAffinity") : amended, - format("x"), - read] - uint64 IRQAffinity; - [WmiDataId(2), - Description("IRQNum") : amended, - read] - uint32 IRQNum; - [WmiDataId(3), - Description("DeviceDescriptionLen") : amended, - read] - uint32 DeviceDescriptionLen; - [WmiDataId(4), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(22), - EventTypeName("PnP") : amended -] -class SystemConfig_V0_PnP:SystemConfig_V0 -{ - [WmiDataId(1), - Description("IDLength") : amended, - read] - uint32 IDLength; - [WmiDataId(2), - Description("DescriptionLength") : amended, - read] - uint32 DescriptionLength; - [WmiDataId(3), - Description("FriendlyNameLength") : amended, - read] - uint32 FriendlyNameLength; - [WmiDataId(4), - Description("DeviceID") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceID; - [WmiDataId(5), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; - [WmiDataId(6), - Description("FriendlyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FriendlyName; -}; - -[Dynamic, - Description("System Configuration") : amended, - Guid("{01853a65-418f-4f36-aefc-dc0f1d2fd235}"), - EventVersion(1), - DisplayName("SystemConfig") : amended -] -class SystemConfig_V1:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(10), - EventTypeName("CPU") : amended -] -class SystemConfig_V1_CPU:SystemConfig_V1 -{ - [WmiDataId(1), - Description("MHz") : amended, - read] - uint32 MHz; - [WmiDataId(2), - Description("NumberOfProcessors") : amended, - read] - uint32 NumberOfProcessors; - [WmiDataId(3), - Description("MemSize") : amended, - read] - uint32 MemSize; - [WmiDataId(4), - Description("PageSize") : amended, - read] - uint32 PageSize; - [WmiDataId(5), - Description("AllocationGranularity") : amended, - read] - uint32 AllocationGranularity; - [WmiDataId(6), - Description("ComputerName") : amended, - read] - char16 ComputerName[256]; - [WmiDataId(7), - Description("DomainName") : amended, - read] - char16 DomainName[132]; - [WmiDataId(8), - Description("HyperThreadingFlag") : amended, - pointer, - read] - uint32 HyperThreadingFlag; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(11), - EventTypeName("PhyDisk") : amended -] -class SystemConfig_V1_PhyDisk:SystemConfig_V1 -{ - [WmiDataId(1), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(2), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(3), - Description("SectorsPerTrack") : amended, - read] - uint32 SectorsPerTrack; - [WmiDataId(4), - Description("TracksPerCylinder") : amended, - read] - uint32 TracksPerCylinder; - [WmiDataId(5), - Description("Cylinders") : amended, - read] - uint64 Cylinders; - [WmiDataId(6), - Description("SCSIPort") : amended, - read] - uint32 SCSIPort; - [WmiDataId(7), - Description("SCSIPath") : amended, - read] - uint32 SCSIPath; - [WmiDataId(8), - Description("SCSITarget") : amended, - read] - uint32 SCSITarget; - [WmiDataId(9), - Description("SCSILun") : amended, - read] - uint32 SCSILun; - [WmiDataId(10), - Description("Manufacturer") : amended, - read] - char16 Manufacturer[256]; - [WmiDataId(11), - Description("PartitionCount") : amended, - read] - uint32 PartitionCount; - [WmiDataId(12), - Description("WriteCacheEnabled") : amended, - read] - uint8 WriteCacheEnabled; - [WmiDataId(13), - Description("Pad: not used") : amended, - read] - uint8 Pad; - [WmiDataId(14), - Description("BootDriveLetter") : amended, - read] - char16 BootDriveLetter[3]; - [WmiDataId(15), - Description("Spare") : amended, - read] - char16 Spare[2]; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(12), - EventTypeName("LogDisk") : amended -] -class SystemConfig_V1_LogDisk:SystemConfig_V1 -{ - [WmiDataId(1), - Description("StartOffset") : amended, - read] - uint64 StartOffset; - [WmiDataId(2), - Description("PartitionSize") : amended, - read] - uint64 PartitionSize; - [WmiDataId(3), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(4), - Description("Size") : amended, - read] - uint32 Size; - [WmiDataId(5), - Description("DriveType") : amended, - read] - uint32 DriveType; - [WmiDataId(6), - Description("DriveLetter") : amended, - read] - char16 DriveLetterString[4]; - [WmiDataId(7), - Description("Pad1") : amended, - read] - uint32 Pad1; - [WmiDataId(8), - Description("PartitionNumber") : amended, - read] - uint32 PartitionNumber; - [WmiDataId(9), - Description("SectorsPerCluster") : amended, - read] - uint32 SectorsPerCluster; - [WmiDataId(10), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(11), - Description("Pad2") : amended, - read] - uint32 Pad2; - [WmiDataId(12), - Description("NumberOfFreeClusters") : amended, - read] - sint64 NumberOfFreeClusters; - [WmiDataId(13), - Description("TotalNumberOfClusters") : amended, - read] - sint64 TotalNumberOfClusters; - [WmiDataId(14), - Description("FileSystem") : amended, - read] - char16 FileSystem[16]; - [WmiDataId(15), - Description("VolumeExtent") : amended, - read] - uint32 VolumeExt; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(13), - EventTypeName("NIC") : amended -] -class SystemConfig_V1_NIC:SystemConfig_V1 -{ - [WmiDataId(1), - Description("NICName") : amended, - read] - char16 NICName[256]; - [WmiDataId(2), - Description("Index") : amended, - read] - uint32 Index; - [WmiDataId(3), - Description("PhysicalAddressLen") : amended, - read] - uint32 PhysicalAddrLen; - [WmiDataId(4), - Description("PhysicalAddress") : amended, - read] - char16 PhysicalAddr[8]; - [WmiDataId(5), - Description("Size") : amended, - read] - uint32 Size; - [WmiDataId(6), - Description("IpAddress") : amended, - read] - sint32 IpAddress; - [WmiDataId(7), - Description("SubnetMask") : amended, - read] - sint32 SubnetMask; - [WmiDataId(8), - Description("DhcpServer") : amended, - read] - sint32 DhcpServer; - [WmiDataId(9), - Description("Gateway") : amended, - read] - sint32 Gateway; - [WmiDataId(10), - Description("PrimaryWinsServer") : amended, - read] - sint32 PrimaryWinsServer; - [WmiDataId(11), - Description("SecondaryWinsServer") : amended, - read] - sint32 SecondaryWinsServer; - [WmiDataId(12), - Description("DnsServer1") : amended, - read] - sint32 DnsServer1; - [WmiDataId(13), - Description("DnsServer2") : amended, - read] - sint32 DnsServer2; - [WmiDataId(14), - Description("DnsServer3") : amended, - read] - sint32 DnsServer3; - [WmiDataId(15), - Description("DnsServer4") : amended, - read] - sint32 DnsServer4; - [WmiDataId(16), - Description("Reserved; do not use.") : amended, - read] - uint32 Data; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(14), - EventTypeName("Video") : amended -] -class SystemConfig_V1_Video:SystemConfig_V1 -{ - [WmiDataId(1), - Description("MemorySize") : amended, - read] - uint32 MemorySize; - [WmiDataId(2), - Description("XResolution") : amended, - read] - uint32 XResolution; - [WmiDataId(3), - Description("YResolution") : amended, - read] - uint32 YResolution; - [WmiDataId(4), - Description("BitsPerPixel") : amended, - read] - uint32 BitsPerPixel; - [WmiDataId(5), - Description("VRefresh") : amended, - read] - uint32 VRefresh; - [WmiDataId(6), - Description("ChipType") : amended, - read] - char16 ChipType[256]; - [WmiDataId(7), - Description("DACType") : amended, - read] - char16 DACType[256]; - [WmiDataId(8), - Description("AdapterString") : amended, - read] - char16 AdapterString[256]; - [WmiDataId(9), - Description("BiosString") : amended, - read] - char16 BiosString[256]; - [WmiDataId(10), - Description("Device Name") : amended, - read] - char16 DeviceId[256]; - [WmiDataId(11), - Description("StateFlags") : amended, - format("x"), - read] - uint32 StateFlags; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(15), - EventTypeName("Services") : amended -] -class SystemConfig_V1_Services:SystemConfig_V1 -{ - [WmiDataId(1), - Description("ServiceName") : amended, - read] - char16 ServiceName[34]; - [WmiDataId(2), - Description("DisplayName") : amended, - read] - char16 DisplayName[256]; - [WmiDataId(3), - Description("ProcessName") : amended, - read] - char16 ProcessName[34]; - [WmiDataId(4), - Description("ProcessId") : amended, - read] - uint32 ProcessId; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(16), - EventTypeName("Power") : amended -] -class SystemConfig_V1_Power:SystemConfig_V1 -{ - [WmiDataId(1), - Description("S1") : amended, - read] - uint8 S1; - [WmiDataId(2), - Description("S2") : amended, - read] - uint8 S2; - [WmiDataId(3), - Description("S3") : amended, - read] - uint8 S3; - [WmiDataId(4), - Description("S4") : amended, - read] - uint8 S4; - [WmiDataId(5), - Description("S5") : amended, - read] - uint8 S5; - [WmiDataId(6), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad1; - [WmiDataId(7), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad2; - [WmiDataId(8), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad3; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(21), - EventTypeName("IRQ") : amended -] -class SystemConfig_V1_IRQ:SystemConfig_V1 -{ - [WmiDataId(1), - Description("IRQAffinity") : amended, - format("x"), - read] - uint64 IRQAffinity; - [WmiDataId(2), - Description("IRQNum") : amended, - read] - uint32 IRQNum; - [WmiDataId(3), - Description("DeviceDescriptionLen") : amended, - read] - uint32 DeviceDescriptionLen; - [WmiDataId(4), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(22), - EventTypeName("PnP") : amended -] -class SystemConfig_V1_PnP:SystemConfig_V1 -{ - [WmiDataId(1), - Description("IDLength") : amended, - read] - uint32 IDLength; - [WmiDataId(2), - Description("DescriptionLength") : amended, - read] - uint32 DescriptionLength; - [WmiDataId(3), - Description("FriendlyNameLength") : amended, - read] - uint32 FriendlyNameLength; - [WmiDataId(4), - Description("DeviceID") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceID; - [WmiDataId(5), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; - [WmiDataId(6), - Description("FriendlyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FriendlyName; -}; - -[Dynamic, - Description("System Configuration") : amended, - Guid("{01853a65-418f-4f36-aefc-dc0f1d2fd235}"), - EventVersion(2), - DisplayName("SystemConfig") : amended -] -class SystemConfig_V2:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(10), - EventTypeName("CPU") : amended -] -class SystemConfig_V2_CPU:SystemConfig_V2 -{ - [WmiDataId(1), - Description("MHz") : amended, - read] - uint32 MHz; - [WmiDataId(2), - Description("NumberOfProcessors") : amended, - read] - uint32 NumberOfProcessors; - [WmiDataId(3), - Description("MemSize") : amended, - read] - uint32 MemSize; - [WmiDataId(4), - Description("PageSize") : amended, - read] - uint32 PageSize; - [WmiDataId(5), - Description("AllocationGranularity") : amended, - read] - uint32 AllocationGranularity; - [WmiDataId(6), - Description("ComputerName") : amended, - format("s"), - read] - char16 ComputerName[256]; - [WmiDataId(7), - Description("DomainName") : amended, - format("s"), - read] - char16 DomainName[134]; - [WmiDataId(8), - Description("HyperThreadingFlag") : amended, - pointer, - read] - uint32 HyperThreadingFlag; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(11), - EventTypeName("PhyDisk") : amended -] -class SystemConfig_V2_PhyDisk:SystemConfig_V2 -{ - [WmiDataId(1), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(2), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(3), - Description("SectorsPerTrack") : amended, - read] - uint32 SectorsPerTrack; - [WmiDataId(4), - Description("TracksPerCylinder") : amended, - read] - uint32 TracksPerCylinder; - [WmiDataId(5), - Description("Cylinders") : amended, - read] - uint64 Cylinders; - [WmiDataId(6), - Description("SCSIPort") : amended, - read] - uint32 SCSIPort; - [WmiDataId(7), - Description("SCSIPath") : amended, - read] - uint32 SCSIPath; - [WmiDataId(8), - Description("SCSITarget") : amended, - read] - uint32 SCSITarget; - [WmiDataId(9), - Description("SCSILun") : amended, - read] - uint32 SCSILun; - [WmiDataId(10), - Description("Manufacturer") : amended, - format("s"), - read] - char16 Manufacturer[256]; - [WmiDataId(11), - Description("PartitionCount") : amended, - read] - uint32 PartitionCount; - [WmiDataId(12), - Description("WriteCacheEnabled") : amended, - read] - uint8 WriteCacheEnabled; - [WmiDataId(13), - Description("Pad: not used") : amended, - read] - uint8 Pad; - [WmiDataId(14), - Description("BootDriveLetter") : amended, - format("s"), - read] - char16 BootDriveLetter[3]; - [WmiDataId(15), - Description("Spare") : amended, - read] - char16 Spare[2]; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(12), - EventTypeName("LogDisk") : amended -] -class SystemConfig_V2_LogDisk:SystemConfig_V2 -{ - [WmiDataId(1), - Description("StartOffset") : amended, - read] - uint64 StartOffset; - [WmiDataId(2), - Description("PartitionSize") : amended, - read] - uint64 PartitionSize; - [WmiDataId(3), - Description("DiskNumber") : amended, - read] - uint32 DiskNumber; - [WmiDataId(4), - Description("Size") : amended, - read] - uint32 Size; - [WmiDataId(5), - Description("DriveType") : amended, - read] - uint32 DriveType; - [WmiDataId(6), - Description("DriveLetter") : amended, - format("s"), - read] - char16 DriveLetterString[4]; - [WmiDataId(7), - Description("Pad1") : amended, - read] - uint32 Pad1; - [WmiDataId(8), - Description("PartitionNumber") : amended, - read] - uint32 PartitionNumber; - [WmiDataId(9), - Description("SectorsPerCluster") : amended, - read] - uint32 SectorsPerCluster; - [WmiDataId(10), - Description("BytesPerSector") : amended, - read] - uint32 BytesPerSector; - [WmiDataId(11), - Description("Pad2") : amended, - read] - uint32 Pad2; - [WmiDataId(12), - Description("NumberOfFreeClusters") : amended, - read] - sint64 NumberOfFreeClusters; - [WmiDataId(13), - Description("TotalNumberOfClusters") : amended, - read] - sint64 TotalNumberOfClusters; - [WmiDataId(14), - Description("FileSystem") : amended, - format("s"), - read] - char16 FileSystem[16]; - [WmiDataId(15), - Description("VolumeExtent") : amended, - read] - uint32 VolumeExt; - [WmiDataId(16), - Description("Pad3") : amended, - read] - uint32 Pad3; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(13), - EventTypeName("NIC") : amended -] -class SystemConfig_V2_NIC:SystemConfig_V2 -{ - [WmiDataId(1), - Description("PhysicalAddress") : amended, - format("x"), - read] - uint64 PhysicalAddr; - [WmiDataId(2), - Description("PhysicalAddressLen") : amended, - read] - uint32 PhysicalAddrLen; - [WmiDataId(3), - Description("Ipv4Index") : amended, - read] - uint32 Ipv4Index; - [WmiDataId(4), - Description("Ipv6Index") : amended, - read] - uint32 Ipv6Index; - [WmiDataId(5), - Description("NIC Description") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string NICDescription; - [WmiDataId(6), - Description("IpAddresses") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string IpAddresses; - [WmiDataId(7), - Description("DnsServerAddresses") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DnsServerAddresses; - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(14), - EventTypeName("Video") : amended -] -class SystemConfig_V2_Video:SystemConfig_V2 -{ - [WmiDataId(1), - Description("MemorySize") : amended, - read] - uint32 MemorySize; - [WmiDataId(2), - Description("XResolution") : amended, - read] - uint32 XResolution; - [WmiDataId(3), - Description("YResolution") : amended, - read] - uint32 YResolution; - [WmiDataId(4), - Description("BitsPerPixel") : amended, - read] - uint32 BitsPerPixel; - [WmiDataId(5), - Description("VRefresh") : amended, - read] - uint32 VRefresh; - [WmiDataId(6), - Description("ChipType") : amended, - format("s"), - read] - char16 ChipType[256]; - [WmiDataId(7), - Description("DACType") : amended, - format("s"), - read] - char16 DACType[256]; - [WmiDataId(8), - Description("AdapterString") : amended, - format("s"), - read] - char16 AdapterString[256]; - [WmiDataId(9), - Description("BiosString") : amended, - format("s"), - read] - char16 BiosString[256]; - [WmiDataId(10), - Description("Device Name") : amended, - format("s"), - read] - char16 DeviceId[256]; - [WmiDataId(11), - Description("StateFlags") : amended, - format("x"), - read] - uint32 StateFlags; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(15), - EventTypeName("Services") : amended -] -class SystemConfig_V2_Services:SystemConfig_V2 -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ServiceState") : amended, - format("x"), - read] - uint32 ServiceState; - [WmiDataId(3), - Description("SubProcessTag") : amended, - format("x"), - read] - uint32 SubProcessTag; - [WmiDataId(4), - Description("ServiceName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string ServiceName; - [WmiDataId(5), - Description("DisplayName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DisplayName; - [WmiDataId(6), - Description("ProcessName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string ProcessName; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(16), - EventTypeName("Power") : amended -] -class SystemConfig_V2_Power:SystemConfig_V2 -{ - [WmiDataId(1), - Description("S1") : amended, - read] - uint8 S1; - [WmiDataId(2), - Description("S2") : amended, - read] - uint8 S2; - [WmiDataId(3), - Description("S3") : amended, - read] - uint8 S3; - [WmiDataId(4), - Description("S4") : amended, - read] - uint8 S4; - [WmiDataId(5), - Description("S5") : amended, - read] - uint8 S5; - [WmiDataId(6), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad1; - [WmiDataId(7), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad2; - [WmiDataId(8), - Description("Reserved; do not use.") : amended, - read] - uint8 Pad3; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(17), - EventTypeName("Network") : amended -] -class SystemConfig_V2_Network:SystemConfig_V2 -{ - [WmiDataId(1), - Description("TcbTablePartitions") : amended, - read] - uint32 TcbTablePartitions; - [WmiDataId(2), - Description("MaxHashTableSize") : amended, - read] - uint32 MaxHashTableSize; - [WmiDataId(3), - Description("MaxUserPort") : amended, - read] - uint32 MaxUserPort; - [WmiDataId(4), - Description("TcpTimedWaitDelay") : amended, - read] - uint32 TcpTimedWaitDelay; - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(21), - EventTypeName("IRQ") : amended -] -class SystemConfig_V2_IRQ:SystemConfig_V2 -{ - [WmiDataId(1), - Description("IRQAffinity") : amended, - format("x"), - read] - uint64 IRQAffinity; - [WmiDataId(2), - Description("IRQNum") : amended, - read] - uint32 IRQNum; - [WmiDataId(3), - Description("DeviceDescriptionLen") : amended, - read] - uint32 DeviceDescriptionLen; - [WmiDataId(4), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(22), - EventTypeName("PnP") : amended -] -class SystemConfig_V2_PnP:SystemConfig_V2 -{ - [WmiDataId(1), - Description("IDLength") : amended, - read] - uint32 IDLength; - [WmiDataId(2), - Description("DescriptionLength") : amended, - read] - uint32 DescriptionLength; - [WmiDataId(3), - Description("FriendlyNameLength") : amended, - read] - uint32 FriendlyNameLength; - [WmiDataId(4), - Description("DeviceID") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceID; - [WmiDataId(5), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; - [WmiDataId(6), - Description("FriendlyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FriendlyName; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(23), - EventTypeName("IDEChannel") : amended -] -class SystemConfig_V2_IDEChannel:SystemConfig_V2 -{ - [WmiDataId(1), - Description("TargetId") : amended, - read] - uint32 TargetId; - [WmiDataId(2), - Description("DeviceType") : amended, - format("x"), - read] - uint32 DeviceType; - [WmiDataId(3), - Description("DeviceTimingMode") : amended, - format("x"), - read] - uint32 DeviceTimingMode; - [WmiDataId(4), - Description("LocationInformationLen") : amended, - read] - uint32 LocationInformationLen; - [WmiDataId(5), - Description("LocationInformation") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string LocationInformation; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(25), - EventTypeName("Platform") : amended -] -class SystemConfig_V2_Platform:SystemConfig_V2 -{ - [WmiDataId(1), - Description("SystemManufacturer") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string SystemManufacturer; - [WmiDataId(2), - Description("SystemProductName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string SystemProductName; - [WmiDataId(3), - Description("BiosDate") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string BiosDate; - [WmiDataId(4), - Description("BiosVersion") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string BiosVersion; -}; - -[Dynamic, - Description("System Configuration") : amended, - Guid("{01853a65-418f-4f36-aefc-dc0f1d2fd235}"), - EventVersion(3), - DisplayName("SystemConfig") : amended -] -class SystemConfig:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(21), - EventTypeName("IRQ") : amended -] -class SystemConfig_IRQ:SystemConfig -{ - [WmiDataId(1), - Description("IRQAffinity") : amended, - format("x"), - read] - uint64 IRQAffinity; - [WmiDataId(2), - Description("IRQGroup") : amended, - read] - uint16 IRQGroup; - [WmiDataId(3), - Description("Reserved") : amended, - read] - uint16 Reserved; - [WmiDataId(4), - Description("IRQNum") : amended, - read] - uint32 IRQNum; - [WmiDataId(5), - Description("DeviceDescriptionLen") : amended, - read] - uint32 DeviceDescriptionLen; - [WmiDataId(6), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(15), - EventTypeName("Services") : amended -] -class SystemConfig_Services:SystemConfig -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ServiceState") : amended, - format("x"), - read] - uint32 ServiceState; - [WmiDataId(3), - Description("SubProcessTag") : amended, - format("x"), - read] - uint32 SubProcessTag; - [WmiDataId(4), - Description("ServiceName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string ServiceName; - [WmiDataId(5), - Description("DisplayName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DisplayName; - [WmiDataId(6), - Description("ProcessName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string ProcessName; - [WmiDataId(7), - Description("LoadOrderGroup") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string LoadOrderGroup; - [WmiDataId(8), - Description("SvchostGroup") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string SvchostGroup; -}; - -[Dynamic, - Description("System Configuration") : amended, - EventType(22), - EventTypeName("PnP") : amended -] -class SystemConfig_PnP:SystemConfig -{ - [WmiDataId(1), - Description("IDLength") : amended, - read] - uint32 IDLength; - [WmiDataId(2), - Description("DescriptionLength") : amended, - read] - uint32 DescriptionLength; - [WmiDataId(3), - Description("FriendlyNameLength") : amended, - read] - uint32 FriendlyNameLength; - [WmiDataId(4), - Description("DeviceID") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceID; - [WmiDataId(5), - Description("DeviceDescription") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string DeviceDescription; - [WmiDataId(6), - Description("FriendlyName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string FriendlyName; - [WmiDataId(7), - Description("PdoName") : amended, - StringTermination("NullTerminated"), - format("w"), - read] - string PdoName; -}; - -[Dynamic, - Description("Pool Event") : amended, - Guid("{0268a8b6-74fd-4302-9dd0-6e8f1795c0cf}"), - EventVersion(2), - DisplayName("Pool") : amended -] -class PoolTrace:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("Pool Allocation/Free Event") : amended, - EventType{32, 34}, - EventTypeName{"PoolAllocation", "PoolFree"} : amended -] -class PoolAllocFree:PoolTrace -{ - [WmiDataId(1), - Description("PoolType"): amended, - read] - uint32 Type; - [WmiDataId(2), - Description("PoolTag"): amended, - format("x"), - read] - uint32 Tag; - [WmiDataId(3), - Description("NumberOfBytes"): amended, - extension("SizeT"), - read] - object NumberOfBytes; - [WmiDataId(4), - Description("Entry"): amended, - pointer, - read] - uint32 Entry; -}; - -[Dynamic, - Description("Session Pool Allocation/Free Event") : amended, - EventType{33, 35}, - EventTypeName{"SessionPoolAllocation", "SessionPoolFree"} : amended -] -class SessionPoolAllocFree:PoolTrace -{ - [WmiDataId(1), - Description("PoolType"): amended, - read] - uint32 Type; - [WmiDataId(2), - Description("PoolTag"): amended, - format("x"), - read] - uint32 Tag; - [WmiDataId(3), - Description("NumberOfBytes"): amended, - extension("SizeT"), - read] - object NumberOfBytes; - [WmiDataId(4), - Description("Entry"): amended, - pointer, - read] - uint32 Entry; - [WmiDataId(5), - Description("SessionId") : amended, - read] - uint32 SessionId; -}; - - -[Dynamic, - Description("Pool Snapshot Event") : amended, - EventType{40, 41, 42, 43, 44, 45}, - EventTypeName{"PoolSnapDCStart", "PoolSnapDCEnd", "BigPoolSnapDCStart", "BigPoolSnapDCEnd", "SessionPoolSnapDCStart", "SessionPoolSnapDCEnd"} : amended -] -class PoolSnapshot:PoolTrace -{ -}; - -[Dynamic, - Description("Thread Pool") : amended, - Guid("{c861d0e2-a2c1-4d36-9f9c-970bab943a12}") -] -class ThreadPool:EventTrace -{ - -}; - -[Dynamic, - Description("Thread Pool Event") : amended, - Guid("{c861d0e2-a2c1-4d36-9f9c-970bab943a12}"), - EventVersion(2), - DisplayName("ThreadPool") : amended -] -class ThreadPoolTrace_V2:ThreadPool -{ - -}; - -[Dynamic, - Description("Thread Pool Callback Enqueue Start") : amended, - EventType{32, 34}, - EventTypeName{"CBEnqueue", "CBStart"} : amended -] -class TP_V2_CBEnqueue:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; - [WmiDataId(2), - Description("TaskId") : amended, - pointer, - read] - uint32 TaskId; - [WmiDataId(3), - Description("CallbackFunction") : amended, - pointer, - read] - uint32 CallbackFunction; - [WmiDataId(4), - Description("CallbackContext") : amended, - pointer, - read] - uint32 CallbackContext; - [WmiDataId(5), - Description("SubProcessTag") : amended, - pointer, - read] - uint32 SubProcessTag; -}; - -[Dynamic, - Description("Thread Pool Callback Dequeue Stop") : amended, - EventType{33, 35}, - EventTypeName{"CBDequeue", "CBStop"} : amended -] -class TP_V2_CBDequeue:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("TaskId") : amended, - pointer, - read] - uint32 TaskId; -}; - -[Dynamic, - Description("Thread Pool Callback Cancel") : amended, - EventType(36), - EventTypeName("CBCancel") : amended -] -class TP_V2_CBCancel:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("TaskId") : amended, - pointer, - read] - uint32 TaskId; - [WmiDataId(2), - Description("CancelCount") : amended, - read] - uint32 CancelCount; -}; - -[Dynamic, - Description("Thread Pool Pool Create Close") : amended, - EventType{37, 38}, - EventTypeName{"PoolCreate", "PoolClose"} : amended -] -class TP_V2_PoolCreateClose:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; -}; - -[Dynamic, - Description("Thread Pool Thread Set") : amended, - EventType{39, 40}, - EventTypeName{"ThreadMinSet", "ThreadMaxSet"} : amended -] -class TP_V2_ThreadSet:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; - [WmiDataId(2), - Description("ThreadNum") : amended, - read] - uint32 ThreadNum; -}; - -[Dynamic, - Description("Thread Pool Worker Thread NUMA Node Switch") : amended, - EventType(41), - EventTypeName("WTNodeSwitch") : amended -] -class TP_V2_WTNodeSwitch:ThreadPoolTrace_V2 -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; - [WmiDataId(2), - Description("CurrentNode") : amended, - read] - uint32 CurrentNode; - [WmiDataId(3), - Description("NextNode") : amended, - read] - uint32 NextNode; - [WmiDataId(4), - Description("CurrentGroup") : amended, - read] - uint16 CurrentGroup; - [WmiDataId(5), - Description("NextGroup") : amended, - read] - uint16 NextGroup; - [WmiDataId(6), - Description("CurrentWorkerCount") : amended, - read] - uint32 CurrentWorkerCount; - [WmiDataId(7), - Description("NextWorkerCount") : amended, - read] - uint32 NextWorkerCount; -}; - -[Dynamic, - Description("Thread Pool Event") : amended, - Guid("{c861d0e2-a2c1-4d36-9f9c-970bab943a12}"), - EventVersion(3), - DisplayName("ThreadPool") : amended -] -class ThreadPoolTrace:ThreadPool -{ - -}; - -[Dynamic, - Description("Thread Pool Callback Dequeue Stop") : amended, - EventType{33, 35}, - EventTypeName{"CBDequeue", "CBStop"} : amended -] -class TPCBDequeue:ThreadPoolTrace -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; - [WmiDataId(2), - Description("TaskId") : amended, - pointer, - read] - uint32 TaskId; - [WmiDataId(3), - Description("CallbackFunction") : amended, - pointer, - read] - uint32 CallbackFunction; - [WmiDataId(4), - Description("CallbackContext") : amended, - pointer, - read] - uint32 CallbackContext; - [WmiDataId(5), - Description("SubProcessTag") : amended, - pointer, - read] - uint32 SubProcessTag; -}; - -[Dynamic, - Description("Thread Pool Callback Cancel") : amended, - EventType(36), - EventTypeName("CBCancel") : amended -] -class TPCBCancel:ThreadPoolTrace -{ - [WmiDataId(1), - Description("PoolId") : amended, - pointer, - read] - uint32 PoolId; - [WmiDataId(2), - Description("TaskId") : amended, - pointer, - read] - uint32 TaskId; - [WmiDataId(3), - Description("CallbackFunction") : amended, - pointer, - read] - uint32 CallbackFunction; - [WmiDataId(4), - Description("CallbackContext") : amended, - pointer, - read] - uint32 CallbackContext; - [WmiDataId(5), - Description("SubProcessTag") : amended, - pointer, - read] - uint32 SubProcessTag; - [WmiDataId(6), - Description("CancelCount") : amended, - read] - uint32 CancelCount; -}; - -[Dynamic, - Description("MMCSS") : amended, - Guid("{f8f10121-b617-4a56-868b-9df1b27fe32c}"), - DisplayName("MMCSS") : amended -] -class MMCSSTrace:MSNT_SystemTrace -{ - -}; - -[Dynamic, - Description("MMCSS Events") : amended, - EventType{32, 33, 36, 37}, - EventTypeName{"Start", "Stop", "Sleep", "SleepResp"} : amended -] -class MMCSS_TypeGroup:MMCSSTrace -{ - -}; - -[Dynamic, - Description("MMCSS Events") : amended, - EventType(34), - EventTypeName("Scheduler") : amended -] -class MMCSSEvent:MMCSSTrace -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ScheduledPID; - [WmiDataId(2), - Description("ThreadId") : amended, - format("x"), - read] - uint32 ScheduledTID; - [WmiDataId(3), - Description("SchedulingPriority") : amended, - read] - uint32 SchedulingPriority; - [WmiDataId(4), - Description("TaskIndex") : amended, - read] - uint32 TaskIndex; -}; - -[Dynamic, - Description("MMCSS Events") : amended, - EventType(35), - EventTypeName("Wakeup") : amended -] -class MMCSSWakeup:MMCSSTrace -{ - [WmiDataId(1), - Description("Reason") : amended, - format("x"), - read] - uint32 Reason; -}; - -// -// MUI load tracing from ntdll.dll -// -[Dynamic, - Description("MUI Resource Trace") : amended, - Guid("{d3de60b2-a663-45d5-9826-a0a5949d2cb0}"), - locale("MS\\0x409") -] -class MuiTrace:EventTrace -{ -}; - -[Dynamic, - Description("MUI Resource Trace") : amended, - Guid("{d3de60b2-a663-45d5-9826-a0a5949d2cb0}"), - DisplayName("MUIResource") : amended, - locale("MS\\0x409") -] -class MuiTraceData:MuiTrace -{ -}; - - -[Dynamic, - Description("MUI Resource Access") : amended, - EventType(0), - EventTypeName("Access") : amended, - locale("MS\\0x409") -] -class MuiTraceData_String:MuiTraceData -{ - [WmiDataId(1), - Description("MuiAccess") : amended, - format("w"), - StringTermination("NullTerminated"), - read] - string MuiLoadString; -}; - -// -// UMS events. -// - -[Dynamic, - Description("UMS Events") : amended, - Guid("{9aec974b-5b8e-4118-9b92-3186d8002ce5}"), - EventVersion(2), - DisplayName("UMS") : amended -] -class UmsEvent:MSNT_SystemTrace -{ -}; - -[Dynamic, - Description("UMS Directed Switch - Start") : amended, - EventType(32), - EventTypeName("DSwitchStart") : amended -] -class UmsDirectedSwitchStart:UmsEvent -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ScheduledThreadId") : amended, - format("x"), - read] - uint32 ScheduledThreadId; - [WmiDataId(3), - Description("PrimaryThreadId") : amended, - format("x"), - read] - uint32 PrimaryThreadId; - [WmiDataId(4), - Description("SwitchFlags") : amended, - format("x"), - read] - uint32 SwitchFlags; -}; - -[Dynamic, - Description("UMS Directed Switch - End") : amended, - EventType(33), - EventTypeName("DSwitchEnd") : amended -] -class UmsDirectedSwitchEnd:UmsEvent -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ScheduledThreadId") : amended, - format("x"), - read] - uint32 ScheduledThreadId; - [WmiDataId(3), - Description("PrimaryThreadId") : amended, - format("x"), - read] - uint32 PrimaryThreadId; - [WmiDataId(4), - Description("SwitchFlags") : amended, - format("x"), - read] - uint32 SwitchFlags; -}; - -[Dynamic, - Description("UMS Scheduled Thread Park") : amended, - EventType(34), - EventTypeName("ScheduledPark") : amended -] -class UmsScheduledPark:UmsEvent -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ScheduledThreadId") : amended, - format("x"), - read] - uint32 ScheduledThreadId; - [WmiDataId(3), - Description("ParkFlags") : amended, - format("x"), - read] - uint32 ParkFlags; -}; - -[Dynamic, - Description("UMS Disassociate From Primary") : amended, - EventType(35), - EventTypeName("Disassociate") : amended -] -class UmsDisassociate:UmsEvent -{ - [WmiDataId(1), - Description("ProcessId") : amended, - format("x"), - read] - uint32 ProcessId; - [WmiDataId(2), - Description("ScheduledThreadId") : amended, - format("x"), - read] - uint32 ScheduledThreadId; - [WmiDataId(3), - Description("PrimaryThreadId") : amended, - format("x"), - read] - uint32 PrimaryThreadId; - [WmiDataId(4), - Description("UmsApcControlFlags") : amended, - format("x"), - read] - uint32 UmsApcControlFlags; - [WmiDataId(5), - Description("Status") : amended, - format("x"), - read] - uint32 Status; -}; - -[Dynamic, - Description("UMS Context Switch") : amended, - EventType(36), - EventTypeName("CSwitch") : amended -] -class UmsContextSwitch:UmsEvent -{ - [WmiDataId(1), - Description("ScheduledThreadId") : amended, - format("x"), - read] - uint32 ScheduledThreadId; - [WmiDataId(2), - Description("SwitchCount") : amended, - read] - uint32 SwitchCount; - [WmiDataId(3), - Description("KernelYieldCount") : amended, - read] - uint32 KernelYieldCount; - [WmiDataId(4), - Description("MixedYieldCount") : amended, - read] - uint32 MixedYieldCount; - [WmiDataId(5), - Description("YieldCount") : amended, - read] - uint32 YieldCount; -}; - -// -// Tape -[abstract] -class MSTapeDriver -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Tape Drive Parameters") : amended, - guid("{B9A8CFD5-8D72-47a4-AC0E-284A3200F4FB}"), - HeaderName("WMI_TAPE_DRIVE_PARAMETERS"), - GuidName1("WMI_TAPE_DRIVE_PARAMETERS_GUID"), - DisplayName("Tape Drive Parameters") : amended - ] -class MSTapeDriveParam : MSTapeDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Maximum Block Size") : amended, - WmiDataId(1), - Description("Maximum block size supported") : amended, - read] - uint32 MaximumBlockSize; - - [DisplayName("Minimum Block Size") : amended, - WmiDataId(2), - Description("Minimum block size supported") : amended, - read] - uint32 MinimumBlockSize; - - [DisplayName("Default Block Size") : amended, - WmiDataId(3), - Description("Default block size supported") : amended, - read] - uint32 DefaultBlockSize; - - [DisplayName("Maximum Partition Count") : amended, - WmiDataId(4), - Description("Maximum number of partitions allowed.") : amended, - read] - uint32 MaximumPartitionCount; - - [DisplayName("Compression Capable") : amended, - WmiDataId(5), - Description("TRUE if drive supports compression.") : amended, - read] - boolean CompressionCapable; - - [WmiDataId(6), - DisplayName("Compression Enabled") : amended, - Description("TRUE if compression is enabled.") : amended, - read] - boolean CompressionEnabled; - - [WmiDataId(7), - DisplayName("Report Setmarks") : amended, - Description("TRUE if drive reports setmarks") : amended, - read] - boolean ReportSetmarks; - - [WmiDataId(8), - DisplayName("Hardware Error Correction") : amended, - Description("TRUE if drive supports hardware error correction") : amended, - read] - boolean HardwareErrorCorrection; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Tape Media Capacity") : amended, - guid("{8C2147A4-FF29-4336-B8A4-227B54CC0966}"), - HeaderName("WMI_TAPE_MEDIA_PARAMETERS"), - GuidName1("WMI_TAPE_MEDIA_PARAMETERS_GUID"), - DisplayName("Tape Media Capacity") : amended - ] -class MSTapeMediaCapacity : MSTapeDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Maximum Capacity") : amended, - WmiDataId(1), - Description("Maximum capacity of the media") : amended, - read] - uint64 MaximumCapacity; - - [DisplayName("Available Capacity") : amended, - WmiDataId(2), - Description("Available capacity of the media") : amended, - read] - uint64 AvailableCapacity; - - [DisplayName("Block Size") : amended, - WmiDataId(3), - Description("Current blocksize") : amended, - read] - uint32 BlockSize; - - [DisplayName("Partition Count") : amended, - WmiDataId(4), - Description("Current number of partitions") : amended, - read] - uint32 PartitionCount; - - [DisplayName("Media Write Protected") : amended, - WmiDataId(5), - Description("TRUE if media is write protected") : amended, - read] - boolean MediaWriteProtected; -}; - - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Tape Symbolic Name") : amended, - guid("{3FB828F7-F119-4066-B1E6-DB407CE9DE91}"), - HeaderName("WMI_TAPE_SYMBOLIC_NAME"), - GuidName1("WMI_TAPE_SYMBOLIC_NAME_GUID"), - DisplayName("Tape Symbolic Name") : amended - ] -class MSTapeSymbolicName : MSTapeDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - - [DisplayName("Tape symbolic name") : amended, - WmiDataId(1), - Description("Symbolic name such as Tape0") : amended, - read] - string TapeSymbolicName; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Tape Drive Problem Warning") : amended, - guid("{BC4DD36C-FA66-4080-87A0-0C5922EB7887}"), - HeaderName("WMI_TAPE_PROBLEM_WARNING"), - GuidName1("WMI_TAPE_PROBLEM_WARNING_GUID"), - DisplayName("Tape Problem Event") : amended - ] -class MSTapeDriveProblemEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Drive Problem Type") : amended, - WmiDataId(1), - Description("Tape drive problem warning event") : amended, - read] - uint32 DriveProblemType; - - [WmiDataId(2), - DisplayName("Tape Data") : amended, - Description("Tape drive problem data") : amended, - read] - uint8 TapeData[512]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("IO Read Write Errors") : amended, - guid("{58FD29F9-B516-40fd-871A-7EE76D5BB53E}"), - HeaderName("WMI_TAPE_PROBLEM_IO_ERROR"), - GuidName1("WMI_TAPE_PROBLEM_IO_ERROR_GUID"), - DisplayName("Tape Io Error") : amended - ] -class MSTapeProblemIoError : MSTapeDriver -{ - - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Read Corrected Without Delay") : amended, - WmiDataId(1), - Description("Read errors corrected without much delay") : amended, - read] - uint32 ReadCorrectedWithoutDelay; - - [DisplayName("Read Corrected With Delay") : amended, - WmiDataId(2), - Description("Read errors corrected with substantial delay") : amended, - read] - uint32 ReadCorrectedWithDelay; - - [DisplayName("Read Total Errors") : amended, - WmiDataId(3), - Description("Total number of Read errors") : amended, - read] - uint32 ReadTotalErrors; - - [DisplayName("Read Total Corrected Errors") : amended, - WmiDataId(4), - Description("Total number of read errors that were corrected") : amended, - read] - uint32 ReadTotalCorrectedErrors; - - [DisplayName("Read Total Uncorrected Errors") : amended, - WmiDataId(5), - Description("Total number of uncorrected read errors") : amended, - read] - uint32 ReadTotalUncorrectedErrors; - - [DisplayName("Read Correction Algorithm Processed") : amended, - WmiDataId(6), - Description("Number of times correction algorithm was processed for read") : amended, - read] - uint32 ReadCorrectionAlgorithmProcessed; - - [DisplayName("Write Corrected Without Delay") : amended, - WmiDataId(7), - Description("Write errors corrected without much delay") : amended, - read] - uint32 WriteCorrectedWithoutDelay; - - [DisplayName("Write Corrected With Delay") : amended, - WmiDataId(8), - Description("Write errors corrected with substantial delay") : amended, - read] - uint32 WriteCorrectedWithDelay; - - [DisplayName("Write Total Errors") : amended, - WmiDataId(9), - Description("Total number of Read errors") : amended, - read] - uint32 WriteTotalErrors; - - [DisplayName("Write Total Corrected Errors") : amended, - WmiDataId(10), - Description("Total number of write errors that were corrected") : amended, - read] - uint32 WriteTotalCorrectedErrors; - - [DisplayName("Write Total Uncorrected Errors") : amended, - WmiDataId(11), - Description("Total number of uncorrected write errors") : amended, - read] - uint32 WriteTotalUncorrectedErrors; - - [DisplayName("Write Correction Algorithm Processed") : amended, - WmiDataId(12), - Description("Number of times correction algorithm was processed for write") : amended, - read] - uint32 WriteCorrectionAlgorithmProcessed; - - [DisplayName("Non Medium Errors") : amended, - WmiDataId(13), - Description("Errors not related to medium") : amended, - read] - uint32 NonMediumErrors; - -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Device Errors") : amended, - guid("{43EC6B13-10BB-4bf6-B716-1C1E2F10BB5F}"), - HeaderName("WMI_TAPE_PROBLEM_DEVICE_ERROR"), - GuidName1("WMI_TAPE_PROBLEM_DEVICE_ERROR_GUID"), - DisplayName("Tape Device Error") : amended - ] -class MSTapeProblemDeviceError : MSTapeDriver -{ - - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Read Warning") : amended, - WmiDataId(1), - Description("WARNING : Drive is experiencing read problem.") : amended, - read] - boolean ReadWarning; - - [DisplayName("Write Warning") : amended, - WmiDataId(2), - Description("WARNING : Drive is experiencing write problem.") : amended, - read] - boolean WriteWarning; - - [DisplayName("Hard Error") : amended, - WmiDataId(3), - Description("Drive hardware problem") : amended, - read] - boolean HardError; - - [DisplayName("Read Failure") : amended, - WmiDataId(4), - Description("Critical Error : Too many read errors.") : amended, - read] - boolean ReadFailure; - - [DisplayName("Write Failure") : amended, - WmiDataId(5), - Description("Critical Error : Too many write errors.") : amended, - read] - boolean WriteFailure; - - [DisplayName("Unsupported Format") : amended, - WmiDataId(6), - Description("Tape format not supported") : amended, - read] - boolean UnsupportedFormat; - - [DisplayName("Tape Snapped") : amended, - WmiDataId(7), - Description("Tape is snapped. Replace media") : amended, - read] - boolean TapeSnapped; - - [DisplayName("Drive Requires Cleaning") : amended, - WmiDataId(8), - Description("Drive Requires Cleaning") : amended, - read] - boolean DriveRequiresCleaning; - - [DisplayName("Time To Clean Drive") : amended, - WmiDataId(9), - Description("It's time to clean the drive") : amended, - read] - boolean TimetoCleanDrive; - - [DisplayName("Drive Hardware Error") : amended, - WmiDataId(10), - Description("Hardware error. Check drive") : amended, - read] - boolean DriveHardwareError; - - [DisplayName("Scsi Interface Error") : amended, - WmiDataId(11), - Description("Some error in cabling, or connection.") : amended, - read] - boolean ScsiInterfaceError; - - [DisplayName("Media Life") : amended, - WmiDataId(12), - Description("Critical error: Media life expired.") : amended, - read] - boolean MediaLife; -}; - -// -// Medium Changer Libraries -[abstract] -class MSChangerDriver -{ -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Changer Parameters") : amended, - guid("{24EB52AC-7C77-438b-AB61-D024DAB0C03A}"), - HeaderName("WMI_CHANGER_PARAMETERS"), - GuidName1("WMI_CHANGER_PARAMETERS_GUID"), - DisplayName("Changer Parameters") : amended - ] -class MSChangerParameters : MSChangerDriver -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Number Of Slots") : amended, - WmiDataId(1), - Description("Number of slots in the changer") : amended, - read] - uint32 NumberOfSlots; - - [DisplayName("Number Of Drives") : amended, - WmiDataId(2), - Description("Number of drives in the changer") : amended, - read] - uint32 NumberOfDrives; - - [DisplayName("Number Of IE Ports") : amended, - WmiDataId(3), - Description("Number of IEPorts in the changer") : amended, - read] - uint32 NumberOfIEPorts; - - [DisplayName("Number Of Transports") : amended, - WmiDataId(4), - Description("Number of transport in the changer") : amended, - read] - uint32 NumberOfTransports; - - [DisplayName("Number Of Doors") : amended, - WmiDataId(5), - Description("Number of doors in the changer") : amended, - read] - uint32 NumberOfDoors; - - [DisplayName("Number Of Cleaner Slots") : amended, - WmiDataId(6), - Description("Number of slots for cleaner cartridge in the changer") : amended, - read] - uint32 NumberOfCleanerSlots; - - [ - DisplayName("Magazine Size") : amended, - WmiDataId(7), - Description("Magazine size if one exists") : amended, - read] - uint32 MagazineSize; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Changer Problem Warning") : amended, - guid("{45DB06A5-20D5-4de3-A36C-3AB974600A4C}"), - HeaderName("WMI_CHANGER_PROBLEM_WARNING"), - GuidName1("WMI_CHANGER_PROBLEM_WARNING_GUID"), - DisplayName("Changer Problem Event") : amended - ] -class MSChangerProblemEvent : WmiEvent -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Changer Problem Type") : amended, - WmiDataId(1), - Description("Changer library problem warning type") : amended, - read] - uint32 ChangerProblemType; - - [DisplayName("Changer Data") : amended, - WmiDataId(2), - Description("Changer problem data") : amended, - read] - uint8 ChangerData[512]; -}; - -[Dynamic, Provider("WMIProv"), - WMI, - Description("Changer Errors") : amended, - guid("{56B396A8-0B95-42fe-BBCE-D36FDA904F8E}"), - HeaderName("WMI_CHANGER_PROBLEM_DEVICE_ERROR"), - GuidName1("WMI_CHANGER_PROBLEM_DEVICE_ERROR_GUID"), - DisplayName("Changer Device Error") : amended - ] -class MSChangerProblemDeviceError : MSChangerDriver -{ - - [key, read] - string InstanceName; - [read] boolean Active; - - [DisplayName("Changer Problem Type") : amended, - WmiDataId(1), - Description("Changer library problem warning type") : amended, - read] - uint32 ChangerProblemType; - -}; - -[abstract] -class MSDeviceUI -{ -}; - -[WMI, Dynamic, Provider ("WMIProv"), - guid("{4504B1D4-C5EE-4df6-951F-16180E3DD815}"), - HeaderName("DEVICE_UI_FIRMWARE_REVISION"), - GuidName1("DEVICE_UI_FIRMWARE_REVISION_GUID"), - Description("Firmware Revision" ) : amended, - DisplayName("Device Firmware Revision") : amended -] -class MSDeviceUI_FirmwareRevision : MSDeviceUI -{ - boolean Active; - [key] - string InstanceName; - - [DisplayName("Firmware Revision") : amended, - WmiDataId(1), - Description("Firmware Revision") : amended, - read] - string FirmwareRevision; -}; - -[WMI, - guid("{45068237-595D-4C7D-BD80-F84ADC0257F8}") -] -class MSVerifierIrpLogEntry -{ - [WmiDataId(1), - read, - DisplayInHex, - Description("Count")] - uint32 Count; - - [WmiDataId(2), - read, - DisplayInHex, - Description("Major Function")] - uint8 Major; - - [WmiDataId(3), - read, - DisplayInHex, - Description("Minor Function")] - uint8 Minor; - - [WmiDataId(4), - read, - DisplayInHex, - Description("Flags")] - uint8 Flags; - - [WmiDataId(5), - read, - DisplayInHex, - Description("Control")] - uint8 Control; - - [WmiDataId(6), - read, - DisplayInHex, - Description("Arg1")] - uint64 Arg1; - - [WmiDataId(7), - read, - DisplayInHex, - Description("Arg2")] - uint64 Arg2; - - [WmiDataId(8), - read, - DisplayInHex, - Description("Arg3")] - uint64 Arg3; - - [WmiDataId(9), - read, - DisplayInHex, - Description("Arg4")] - uint64 Arg4; -}; - -[WMI,Dynamic, Provider("WMIProv"), - Description("Verifier kernel information"), - guid("{1E2C2980-F7DB-46AA-820E-8734FCC21F4C}"), - locale("MS\\0x409") -] -class MSVerifierIrpLogInformation -{ - [key, read] - string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - Description("DeviceType") - ] uint32 DeviceType; - - [WmiDataId(2), - read - ] uint32 EntryCount; - - [WmiDataId(3), - WmiSizeIs("EntryCount"), - read - ] MSVerifierIrpLogEntry Entries[]; -}; - - -[abstract] -class MSMonitorClass -{ -}; - -[WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor brightness parameters"):amended, - localeid("MS\\0x409"), - guid("{d43412ac-67f9-4fbb-a081-1752a2c33e84}")] -class WmiMonitorBrightness : MSMonitorClass -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - Description("Current brightness (in percentage of total)"):amended - ] uint8 CurrentBrightness; - - [WmiDataId(2), - read, - Description("Supported brightness levels"):amended - ] uint32 Levels; - - [WmiDataId(3), - read, - Description("Brightness Level - in terms of percentage"):amended, - WmiSizeIs("Levels") - ] uint8 Level[]; - -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Monitor brightness control API"):amended, - guid("{479b20b4-5559-46fe-be97-7d222154421f}")] -class WmiMonitorBrightnessMethods : MSMonitorClass -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiMethodId(1), - Implemented, - Description("Set current brightness setting"):amended - ] void WmiSetBrightness([in, - Description("Timeout - in seconds"):amended - ] uint32 Timeout, - [in, - Description("Brightness - percentage"):amended - ] uint8 Brightness); - - [WmiMethodId(2), - Implemented, - Description("Sets the brightness back to the policy setting"):amended - ] void WmiRevertToPolicyBrightness(); - - [WmiMethodId(3), - Implemented, - Description("Controls the ambient light sensor brightness state"):amended - ] void WmiSetALSBrightnessState([in, - Description("ALS brightness state"):amended - ] boolean State); - - [WmiMethodId(4), - Implemented, - Description("Sets the ambient light sensor brightness value"):amended - ] void WmiSetALSBrightness([in, - Description("Brightness - percentage"):amended - ] uint8 Brightness); -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Monitor brightness change event"), - guid("{123c80d2-937f-4cfe-80f4-c40d596e48b7}")] -class WmiMonitorBrightnessEvent : WmiEvent -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - Description("Current Monitor Brightness - percentage"):amended - ] uint8 Brightness; - -}; - -/**********************************/ -/* Monitor descriptor data blocks */ -/**********************************/ - - -// Deprecated EDID v.1.x standard 128-byte base data block -[WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's raw EDID v.1.x data block") : amended, - localeid("MS\\0x409"), - guid("{FAEE1471-5149-4a68-AC2C-BF96EC09F004}") -] -class WmiMonitorRawEEdidV1Block : MSMonitorClass -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Block ID") : amended] - uint8 Id; - - [ - WmiDataId(2), read, Description("Block type") : amended, - Values{ - "Uninitialized", - "Other", - "EDID base block", - "EDID map block" - } : amended - ] - uint8 Type; - - [WmiDataId(3), read, Description("Block content") : amended] - uint8 Content[128]; -}; - - -// Exposes the raw content of VESA E-EDID v.1.x standard 128-byte data block. -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Monitor's raw EDID v.1.x data block accessor"):amended, - guid("{5341576e-75c4-4aeb-a82b-873cd3c6b384}")] -class WmiMonitorDescriptorMethods : MSMonitorClass -{ - [key, read] string InstanceName; - [read] boolean Active; - - [WmiMethodId(1), - Implemented, - DisplayName("Read EDID v.1.x descriptor block") : amended, - HeaderName("WmiGetMonitorRawEEdidV1Block"), - Description("Reads specified EDID v.1.x descriptor block") : amended - ] - void WmiGetMonitorRawEEdidV1Block([in, DisplayName("Block ID") : amended] uint8 BlockId, - [out, DisplayName("Block Type") : amended, - Values{ - "Uninitialized", - "Other", - "EDID base block", - "EDID map block" - } : amended - ] - uint8 BlockType, - [out, DisplayName("Block content") : amended] uint8 BlockContent[128] - ); -}; - - -// Corresponds to data in the Vendor/Product Identification block of VESA E-EDID standard (section 3.4 of E-EDID v.1.3). -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor ID") : amended, - localeid("MS\\0x409"), - guid("{671A8285-4EDB-4cae-99FE-69A15C48C0BC}") -] -class WmiMonitorID : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Vendor assigned product code ID") : amended] - // TODO:[mmilirud] Make this variable length. - uint16 ProductCodeID[16]; - - [WmiDataId(2), read, Description("Serial number ID") : amended] - uint16 SerialNumberID[16]; - - [WmiDataId(3), read, Description("Manufacturer name") : amended] - uint16 ManufacturerName[16]; - - [WmiDataId(4), read, Description("Week of manufacture (1..53, 0 = undefined)") : amended] - uint8 WeekOfManufacture; - - // NOTE: EDID contains (YearOfManufacture-1990). Monitor function driver corrects for that returning a proper year. - [WmiDataId(5), read, Description("Year of manufacture") : amended] - uint16 YearOfManufacture; - - [WmiDataId(6), read, Description("Length of user-friendly name") : amended] - uint16 UserFriendlyNameLength; - - [WmiDataId(7), read, Description("User-friendly name") : amended, WmiSizeIs("UserFriendlyNameLength")] - uint16 UserFriendlyName[]; - -}; - - -// Corresponds to data in the Video Input Definition of VESA E-EDID standard (Table 3.11 in section 3.6 of E-EDID v.1.3). -[ - WMI, - Description("Monitor's supported display features") : amended, - localeid("MS\\0x409"), - guid("{9FA9C28B-5E5C-4035-A5F8-67D4554F8D04}") -] -class WmiMonitorSupportedDisplayFeatures -{ - - [WmiDataId(1), read, Description("VESA DPMS Standby support") : amended] - boolean StandbySupported; - - [WmiDataId(2), read, Description("VESA DPMS Suspend support") : amended] - boolean SuspendSupported; - - // The display consumes much less power when it receives a timing signal that is outside its declared active operating range. - // The display will revert to normal operation if the timing signal returns to the normal operating range. - // No sync signals is one example of a timing signal outside normal operating range. No DE signal is another example. - [WmiDataId(3), read, Description("Active Off/Very Low Power Support") : amended] - boolean ActiveOffSupported; - - [ - WmiDataId(4), read, Description("Display type") : amended, - Values{ - "Monochrome/grayscale display", - "RGB color display", - "Non-RGB multicolor display" - } : amended - ] - uint8 DisplayType; - - [WmiDataId(5), read, Description("sRGB support") : amended] - boolean sRGBSupported; - - // If this is set, first detailed timing block contains the preferred timing mode of the monitor - // Note: Use of preferred timing mode is required by EDID v.1.3 and higher. - [WmiDataId(6), read, Description("Has a preferred timing mode") : amended] - boolean HasPreferredTimingMode; - - // If this bit is set to 1, the display supports timings based on the GTF standard using default GTF parameter values. - [WmiDataId(7), read, Description("GTF support") : amended] - boolean GTFSupported; - -}; - - -// Corresponds to data in the Basic Display Parameters/Features block of VESA E-EDID standard (section 3.6 of E-EDID v.1.3). -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's basic display parameters/features") : amended, - localeid("MS\\0x409"), - guid("{9831B7E6-09AC-491f-8D07-3C3D649D8240}") -] -class WmiMonitorBasicDisplayParams : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [ - WmiDataId(1), read, Description("Video input type") : amended, - Values{ - "Analog", - "Digital" - } : amended - ] - uint8 VideoInputType; - - // Maximum image dimensions that can be correctly displayed, as defined by VESA Video Image Area Definition (VIAD) Standard, - // rounded to the nearest centimeter (cm). These values are intended to be the maximum image size that can be properly displayed - // over the entire set of supported timing/format combinations. The host system is expected to use this data to get a rough idea - // of the image size and aspect ratio to allow properly scaled text to be selected. - // Note: If either (or both) of these fields are zero, then the system shall make no assumption regarding the display size - // (e.g. a projection display may be of indeterminate size). - [WmiDataId(2), read, Description("Max horizontal image size (in cm)") : amended] - uint8 MaxHorizontalImageSize; - - [WmiDataId(3), read, Description("Max vertical image size (in cm)") : amended] - uint8 MaxVerticalImageSize; - - // TODO:[mmilirud] See if WmiScale(-2) is legal. If so, report gamma rather than 100*Gamma-100. - [WmiDataId(4), read, WmiScale(-2), Description("Display transfer characteristic (100*Gamma-100)") : amended] - uint8 DisplayTransferCharacteristic; - - [WmiDataId(5), read, Description("Supported display features") : amended] - WmiMonitorSupportedDisplayFeatures SupportedDisplayFeatures; - -}; - -// Returns information regarding how the monitor is connected. -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's basic connection parameters") : amended, - localeid("MS\\0x409"), - guid("{2E2D2463-B537-4da7-8EEE-51306F1F482F}") -] -class WmiMonitorConnectionParams : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Video output technology type") : amended] - uint32 VideoOutputTechnology; -}; - - -// Corresponds to data in the Video Input Definition of VESA E-EDID standard (Table 3.9 in section 3.6 of E-EDID v.1.3) -// Only available when WmiMonitorBasicDisplayParams.VideoInputType == "Analog". -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's analog video input parameters") : amended, - localeid("MS\\0x409"), - guid("{A56DBCF9-C4F0-44a8-9C1B-BB3B3F774B4D}") -] -class WmiMonitorAnalogVideoInputParams : MSMonitorClass -{ - [key, read] string InstanceName; - [read] boolean Active; - - [ - WmiDataId(1), read, Description("EVC signal level standard") : amended, - Values{ - "(0.7,0.3)[V]", - "(0.714,0.286)[V]", - "(1.0,0.4)[V]", - "(0.7,0.0)[V]" - } : amended - ] - uint8 SignalLevelStandard; - - [ - WmiDataId(2), read, - Description("Is setup expected") : amended, - Values{ - "Monitor expects a blank-to-blank setup or pedestal per appropriate Signal Level Standard", - "Monitor does NOT expect a blank-to-blank setup or pedestal per appropriate Signal Level Standard" - } : amended - ] - uint8 SetupExpected; - - [ - WmiDataId(3), read, - Description("Are separate syncs supported") : amended, - Values{ - "Separate syncs are supported", - "Separate syncs are NOT supported" - } : amended - ] - uint8 SeparateSyncsSupported; - - [ - WmiDataId(4), read, Description("Is composite sync supported") : amended, - Values{ - "Composite sync (on Hsync line) is supported", - "Composite sync (on Hsync line) is NOT supported" - } : amended - ] - uint8 CompositeSyncSupported; - - [ - WmiDataId(5), read, Description("Is sync on green supported") : amended, - Values{ - "Sync on green video is supported", - "Sync on green video is NOT supported" - } : amended - ] - uint8 SyncOnGreenVideoSupported; - - [ - WmiDataId(6), read, - Description("Is Vsync pulse serration required") : amended, - Values{ - "Serration of the Vsync pulse is required when composite sync or sync-on-green video is used", - "Serration of the Vsync pulse is NOT required when composite sync or sync-on-green video is used" - } : amended - ] - uint8 SerrationOfVsyncRequired; -}; - - -// Corresponds to data in the Video Input Definition of VESA E-EDID standard (Table 3.9 in section 3.6 of E-EDID v.1.3) -// Only available when WmiMonitorBasicDisplayParams.VideoInputType == "Digital". -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's digital video input parameters") : amended, - localeid("MS\\0x409"), - guid("{51565945-498A-4a77-ACC6-151BECC805CA}") -] -class WmiMonitorDigitalVideoInputParams : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - // If set, interface is signal compatible with VESA DFP 1.x TMDS CRGB, 1 pixel/clock, up to 8 bits/color MSB aligned, DE active high. - [WmiDataId(1), read, Description("VESA DFP 1.x (or compatible)") : amended] - boolean IsDFP1xCompatible; - -}; - - - -// The chromaticity and white point values are expressed as fractional numbers using encoding format, accurate to the thousandth place, -// which is 10 bits in length, with the MSB representing 2^-1 and LSB representing 2^-10 coefficients, respectively. -// Precision of the stored values should in the EDID v1.x should be accurate to +/- 0.005 of the actual value. -[ - WMI, - Description("XYZ CIE coordinates") : amended, - localeid("MS\\0x409"), - guid("{01FAF041-842C-4230-A31E-1335428CD8F0}") -] -class WmiMonitorColorXYZinCIE -{ - - [WmiDataId(1), WmiScale(-3), read, Description("X") : amended] - uint16 X; - - [WmiDataId(2), WmiScale(-3), read, Description("Y") : amended] - uint16 Y; - - // Z can be calculated based on the X and Y values, using the relation ||(X,Y,Z)|| = 1. - -}; - -// Corresponds to data in the Color Characteristics block of VESA E-EDID Standard (see section 3.7 of E-EDID v.1.3) -// Based on CIE publication 15.2 on colorimetry space. -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor color characteristics") : amended, - localeid("MS\\0x409"), - guid("{EA324793-51BB-486a-AA9D-0F5552353413}") -] -class WmiMonitorColorCharacteristics : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Red CIE coordinates") : amended] - WmiMonitorColorXYZinCIE Red; - - [WmiDataId(2), read, Description("Blue CIE coordinates") : amended] - WmiMonitorColorXYZinCIE Blue; - - [WmiDataId(3), read, Description("Green CIE coordinates") : amended] - WmiMonitorColorXYZinCIE Green; - - // The white point value shall be the default white point (i.e the white point set at power on or on a reset of the display to its default setting). - // If available, WmiMonitorColorPoint data block can be used to obtain more detailed color characteristics of the monitor. - [WmiDataId(4), read, Description("Default White CIE coordinates") : amended] - WmiMonitorColorXYZinCIE DefaultWhite; - -}; - - -// Element of the array in WmiMonitorLisetedSupportedSourceModes, used to expose supported video mode's information. -// Contains information that is a superset of the data available from established, standard, and detailed timing blocks. -[ - WMI, - Description("Video mode descriptor") : amended, - localeid("MS\\0x409"), - guid("{4A97ED30-BFAA-491a-9DFD-B43ADEDBF8E3}") -] -class VideoModeDescriptor -{ - - [WmiDataId(1), read, Description("Pixel clock rate (Hz)") : amended] - uint32 PixelClockRate; - - [WmiDataId(2), read, Description("Vertical refresh rate numerator (Hz)") : amended] - uint32 VerticalRefreshRateNumerator; - - [WmiDataId(3), read, Description("Vertical refresh rate denominator") : amended] - uint32 VerticalRefreshRateDenominator; - - [WmiDataId(4), read, Description("Horizontal refresh rate numerator (Hz)") : amended] - uint32 HorizontalRefreshRateNumerator; - - [WmiDataId(5), read, Description("Horizontal refresh rate denominator") : amended] - uint32 HorizontalRefreshRateDenominator; - - [WmiDataId(6), read, Description("Number of horizontally active pixels") : amended] - uint16 HorizontalActivePixels; - - [WmiDataId(7), read, Description("Number of vertically active pixels") : amended] - uint16 VerticalActivePixels; - - [WmiDataId(8), read, Description("Number of horizontally blanking pixels") : amended] - uint16 HorizontalBlankingPixels; - - [WmiDataId(9), read, Description("Number of vertically blanking pixels") : amended] - uint16 VerticalBlankingPixels; - - [WmiDataId(10), read, Description("Horizontal sync offset") : amended] - uint16 HorizontalSyncOffset; - - [WmiDataId(11), read, Description("Vertical sync offset") : amended] - uint16 VerticalSyncOffset; - - [WmiDataId(12), read, Description("Horizontal sync pulse width") : amended] - uint16 HorizontalSyncPulseWidth; - - [WmiDataId(13), read, Description("Vertical sync pulse width") : amended] - uint16 VerticalSyncPulseWidth; - - [WmiDataId(14), read, Description("Horizontal image size (mm)") : amended] - uint16 HorizontalImageSize; - - [WmiDataId(15), read, Description("Vertical image size (mm)") : amended] - uint16 VerticalImageSize; - - [WmiDataId(16), read, Description("Horizontal border") : amended] - uint16 HorizontalBorder; - - [WmiDataId(17), read, Description("Vertical border") : amended] - uint16 VerticalBorder; - - [WmiDataId(18), read, Description("Is interlaced") : amended] - boolean IsInterlaced; - - [ - WmiDataId(19), read, Description("Stereo mode type") : amended, - Values{ - "No stereo", - "Field Sequential Stereo with Right Image on Stereo Sync = 1", - "Field Sequential Stereo with Left Image on Stereo Sync = 1", - "2-way Interleaved Stereo with Right Image on Even Lines", - "2-way Interleaved Stereo with Left Image on Even Lines", - "4-way Interleaved Stereo", - "Side-by-Side Interleaved Stereo" - } : amended - ] - uint8 StereoModeType; - - [ - WmiDataId(20), read, Description("Signal sync type") : amended, - Values{ - "Analog Composite", - "Bipolar Analog Composite", - "Digital Composite", - "Digital Separate" - } : amended - ] - uint8 SyncSignalType; - - [ - WmiDataId(21), read, Description("Is serration required") : amended, - Values{ - "Controller shall supply Hsync during Vsync", - "Controller shall NOT supply Hsync during Vsync", - "Not applicable (signal sync type must be [bipolar] analog composite or digital composite)" - } : amended - ] - uint8 IsSerrationRequired; - - [ - WmiDataId(22), read, Description("Is sync on RGB") : amended, - Values{ - "Sync pulse should appear on all 3 video signal lines", - "Sync pulse should only appear on the green video signal line", - "Not applicable (signal sync type must be [bipolar] analog composite)" - } : amended - ] - uint8 IsSyncOnRGB; - - [ - WmiDataId(23), read, Description("Composite polarity type (this is polarity of Hsync pulses outside of Vsync)") : amended, - Values{ - "Composite polarity is positive", - "Composite polarity is negative", - "Not applicable (signal sync type must be digital composite)" - } : amended - ] - uint8 CompositePolarityType; - - [ - WmiDataId(24), read, Description("Vertical polarity type") : amended, - Values{ - "Vertical polarity is positive", - "Vertical polarity is negative", - "Not applicable (signal sync type must be digital separate)" - } : amended - ] - uint8 VerticalPolarityType; - - [ - WmiDataId(25), read, Description("Horizontal polarity type") : amended, - Values{ - "Horizontal polarity is positive", - "Horizontal polarity is negative", - "Not applicable (signal sync type must be digital separate)" - } : amended - ] - uint8 HorizontalPolarityType; - - [ - WmiDataId(26), read, Description("Video standard type") : amended, - Values{ - "Other", - "VESA DMT", - "VESA GTF", - "VESA CVT", - "IBM", - "APPLE", - "NTSC M", - "NTSC J", - "NTSC 433", - "PAL B", - "PAL B1", - "PAL G", - "PAL H", - "PAL I", - "PAL D", - "PAL N", - "PAL NC", - "SECAM B", - "SECAM D", - "SECAM G", - "SECAM H", - "SECAM K", - "SECAM K1", - "SECAM L", - "SECAM L1", - "EIA861", - "EIA861A", - "EIA861B" - } : amended - ] - uint8 VideoStandardType; - - [ - WmiDataId(27), read, Description("Origin") : amended, - Values{ - "Uninitialized", - "Default monitor profile", - "Monitor's descriptor", - "Registry override of the monitor descriptor", - "Registry override of a specific capability" - } : amended - ] - uint8 Origin; - - [ - WmiDataId(28), read, Description("Timing type") : amended, - Values{ - "Uninitialized", - "Established", - "Standard", - "Extra Standard", - "Detailed" - } : amended - ] - uint8 TimingType; - -}; - - -// Exposes a list of monitor source modes claimed to be supported by the monitor in its monitor descriptor, if any. -// For descriptorless monitors this list of modes is generated based on monitor's type, as specified by the monitor bus driver. -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's listed supported source modes") : amended, - localeid("MS\\0x409"), - guid("{6DC76655-063C-4524-A862-B8410C26281B}") -] -class WmiMonitorListedSupportedSourceModes : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Number of listed supported monitor source modes") : amended] - uint16 NumOfMonitorSourceModes; - - [WmiDataId(2), read, Description("Preferred monitor source mode index") : amended] - uint16 PreferredMonitorSourceModeIndex; - - [ - WmiDataId(3), read, Description("Listed supported monitor source modes") : amended, - WmiSizeIs("NumOfMonitorSourceModes") - ] - VideoModeDescriptor MonitorSourceModes[]; - -}; - -// Element of the array in WmiMonitorListedFrequencyRanges, used to expose supported frequency ranges information. -[ - WMI, - Description("Frequency range descriptor") : amended, - localeid("MS\\0x409"), - guid("{F4546078-F3B2-417E-94CD-47EA306C5751}") -] -class FrequencyRangeDescriptor -{ - [ - WmiDataId(1), read, Description("Origin") : amended, - Values{ - "Uninitialized", - "Default monitor profile", - "Monitor's descriptor", - "Registry override of the monitor descriptor", - "Registry override of a specific capability" - } : amended - ] - uint8 Origin; - - [WmiDataId(2), read, Description("Minimum VSync numerator (in Hz)") : amended] - uint32 MinVSyncNumerator; - - [WmiDataId(3), read, Description("Minimum VSync denominator") : amended] - uint32 MinVSyncDenominator; - - [WmiDataId(4), read, Description("Maximum VSync numerator (in Hz)") : amended] - uint32 MaxVSyncNumerator; - - [WmiDataId(5), read, Description("Maximum VSync denominator") : amended] - uint32 MaxVSyncDenominator; - - [WmiDataId(6), read, Description("Minimum HSync numerator (in Hz)") : amended] - uint32 MinHSyncNumerator; - - [WmiDataId(7), read, Description("Minimum HSync denominator") : amended] - uint32 MinHSyncDenominator; - - [WmiDataId(8), read, Description("Maximum HSync numerator (in Hz)") : amended] - uint32 MaxHSyncNumerator; - - [WmiDataId(9), read, Description("Maximum HSync denominator") : amended] - uint32 MaxHSyncDenominator; - - [WmiDataId(10), read, Description("Constraint type") : amended, - Values{ - "Uninitialized", - "Active size", - "Maximum pixel rate" - } : amended - ] - uint32 ConstraintType; - - [WmiDataId(11), read, Description("Active width (in pixels)") : amended] - uint32 ActiveWidth; - - [WmiDataId(12), read, Description("Active height (in pixels)") : amended] - uint32 ActiveHeight; - - [WmiDataId(13), read, Description("Maximum pixel rate (in Hz)") : amended] - uint32 MaxPixelRate; - -}; - - -// Exposes a list of monitor supported frequency ranges claimed to be supported by the monitor in INF and/or EDID, if any. -[ - WMI, - Dynamic, - Provider("WMIProv"), - Description("Monitor's listed supported frequency ranges") : amended, - localeid("MS\\0x409"), - guid("{E86E9525-65B6-4B85-95C5-00BEACC975ED}") -] -class WmiMonitorListedFrequencyRanges : MSMonitorClass -{ - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), read, Description("Number of listed supported monitor frequency ranges") : amended] - uint16 NumOfMonitorFreqRanges; - - [ - WmiDataId(2), read, Description("Listed monitor frequency ranges") : amended, - WmiSizeIs("NumOfMonitorFreqRanges") - ] - FrequencyRangeDescriptor MonitorFreqRanges[]; -}; - -// -// Definitions for Processor Power Management. -// - -[abstract] -class MSKernelPpmClass { -}; - -// -// Data. -// - -[WMI, - Description("Kernel Processor Performance State"):amended, - localeid("MS\\0x409"), - guid("{8c7980e1-f62b-419e-aa82-276c8d064a1f}")] -class KernelPerfState { - - [WmiDataId(1), - read, - DisplayName("Processor Speed"):amended, - Description("Processor Frequency in Megahertz"):amended - ] uint32 Frequency; - - [WmiDataId(2), - read, - DisplayName("Power"):amended, - Description("Power in milliwatts"):amended - ] uint32 Power; - - [WmiDataId(3), - read, - DisplayName("Performance Percentage"):amended, - Description("Percentage of Highest Frequency"):amended - ] uint8 PercentFrequency; - - [WmiDataId(4), - read, - DisplayName("IncreaseLevel"):amended, - Description("IncreaseLevel"):amended - ] uint8 IncreaseLevel; - - [WmiDataId(5), - read, - DisplayName("DecreaseLevel"):amended, - Description("DecreaseLevel"):amended - ] uint8 DecreaseLevel; - - [WmiDataId(6), - read, - DisplayName("Type"):amended, - Description("State type: 1 = performance, 2 = throttle"):amended - ] uint8 Type; - - [WmiDataId(7), - read, - DisplayName("IncreaseTime"):amended, - Description("IncreaseTime"):amended - ] uint32 IncreaseTime; - - [WmiDataId(8), - read, - DisplayName("DecreaseTime"):amended, - Description("DecreaseTime"):amended - ] uint32 DecreaseTime; - - [WmiDataId(9), - read, - DisplayName("Control"):amended, - Description("Control value"):amended - ] uint64 Control; - - [WmiDataId(10), - read, - DisplayName("Status"):amended, - Description("Status value"):amended - ] uint64 Status; - - [WmiDataId(11), - read, - DisplayName("HitCount"):amended, - Description("Number of times this state has been entered"):amended - ] uint32 HitCount; - - [WmiDataId(12), - read, - DisplayName("Reserved1"):amended, - Description("Reserved"):amended - ] uint32 Reserved1; - - [WmiDataId(13), - read, - DisplayName("Reserved2"):amended, - Description("Reserved"):amended - ] uint64 Reserved2; - - [WmiDataId(14), - read, - DisplayName("Reserved3"):amended, - Description("Reserved"):amended - ] uint64 Reserved3; -}; - - -[WMI, - Dynamic, - Provider("WmiProv"), - Description("Kernel Processor Performance States"):amended, - localeid("MS\\0x409"), - guid("{5708cc20-7d40-4bf4-b4aa-2b01338d0126}")] -class KernelPerfStates:MSKernelPpmClass { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Number of Kernel Performance States"):amended, - Description("Total number of Kernel Performance States"):amended - ] uint32 Count; - - [WmiDataId(2), - read, - DisplayName("MaxFrequency"):amended, - Description("MaxFrequency"):amended - ] uint32 MaxFrequency; - - [WmiDataId(3), - read, - DisplayName("CurrentState"):amended, - Description("CurrentState"):amended - ] uint32 CurrentState; - - [WmiDataId(4), - read, - DisplayName("MaxPerfState"):amended, - Description("Fastest state considering policy restrictions"):amended - ] uint32 MaxPerfState; - - [WmiDataId(5), - read, - DisplayName("MinPerfState"):amended, - Description("Slowest state considering policy restrictions"):amended - ] uint32 MinPerfState; - - [WmiDataId(6), - read, - DisplayName("LowestPerfState"):amended, - Description("Slowest performance state disregarding policy restrictions"):amended - ] uint32 LowestPerfState; - - [WmiDataId(7), - read, - DisplayName("ThermalConstraint"):amended, - Description("Thermal constraint as a percentage"):amended - ] uint32 ThermalConstraint; - - [WmiDataId(8), - read, - DisplayName("BusyAdjThreshold"):amended, - Description("BusyAdjThreshold"):amended - ] uint8 BusyAdjThreshold; - - [WmiDataId(9), - read, - DisplayName("PolicyType"):amended, - Description("Processor domain coordination"):amended - ] uint8 PolicyType; - - [WmiDataId(10), - read, - DisplayName("Type"):amended, - Description("Type"):amended - ] uint8 Type; - - [WmiDataId(11), - read, - DisplayName("Reserved"):amended, - Description("Reserved"):amended - ] uint8 Reserved; - - [WmiDataId(12), - read, - DisplayName("TimerInterval"):amended, - Description("Timer interval in milliseconds"):amended - ] uint32 TimerInterval; - - [WmiDataId(13), - read, - DisplayName("TargetProcessors"):amended, - Description("Processor domain affinity"):amended - ] uint64 TargetProcessors; - - [WmiDataId(14), - read, - DisplayName("PState Handler"):amended, - Description("PState Handler"):amended - ] uint32 PStateHandler; - - [WmiDataId(15), - read, - DisplayName("PState Context"):amended, - Description("PState Context"):amended - ] uint32 PStateContext; - - [WmiDataId(16), - read, - DisplayName("TState Handler"):amended, - Description("TState Handler"):amended - ] uint32 TStateHandler; - - [WmiDataId(17), - read, - DisplayName("TState Context"):amended, - Description("TState Context"):amended - ] uint32 TStateContext; - - [WmiDataId(18), - read, - DisplayName("FeedbackHandler"):amended, - Description("FeedbackHandler"):amended - ] uint32 FeedbackHandler; - - [WmiDataId(19), - read, - DisplayName("Reserved1"):amended, - Description("Reserved"):amended - ] uint32 Reserved1; - - [WmiDataId(20), - read, - DisplayName("Reserved2"):amended, - Description("Reserved"):amended - ] uint64 Reserved2; - - [WmiDataId(21), - read, - DisplayName("Performance States"):amended, - Description("Array of Performance States"):amended, - WmiSizeIs("Count") - ] KernelPerfState State[]; -}; - -[WMI, - Description("Kernel Idle State"):amended, - localeid("MS\\0x409"), - guid("{46bdcf4a-e076-4550-82b2-9f32eded3e7f}")] -class KernelIdleState { - - [WmiDataId(1), - read, - DisplayName("Latency"):amended, - Description("Worst case transition latency to enter and exit the idle state [QueryPerformanceCounter units]"):amended - ] uint32 Latency; - - [WmiDataId(2), - read, - DisplayName("Power"):amended, - Description("Average power consumption in the idle state [milliwatts]"):amended - ] uint32 Power; - - [WmiDataId(3), - read, - DisplayName("TimeCheck"):amended, - Description("TimeCheck policy [QueryPerformanceCounter units]"):amended - ] uint32 TimeCheck; - - [WmiDataId(4), - read, - DisplayName("PromotePercent"):amended, - Description("PromotePercent policy"):amended - ] uint8 PromotePercent; - - [WmiDataId(5), - read, - DisplayName("DemotePercent"):amended, - Description("DemotePercent policy"):amended - ] uint8 DemotePercent; - - [WmiDataId(6), - read, - DisplayName("StateType"):amended, - Description("Idle state type per ACPI {1=C1, 2=C2, 3=C3, 4=C4, ...}"):amended - ] uint8 StateType; - - [WmiDataId(7), - read, - DisplayName("Reserved"):amended, - Description("Reserved"):amended - ] uint8 Reserved; - - [WmiDataId(8), - read, - DisplayName("StateFlags"):amended, - Description("StateFlags"):amended // IDLE_STATE_FLAGS_* - ] uint32 StateFlags; - - [WmiDataId(9), - read, - DisplayName("Context"):amended, - Description("IdleHandler context present"):amended - ] uint32 Context; - - [WmiDataId(10), - read, - DisplayName("IdleHandler"):amended, - Description("IdleHandler present"):amended - ] uint32 IdleHandler; - - [WmiDataId(11), - read, - DisplayName("Reserved1"):amended, - Description("Reserved"):amended - ] uint32 Reserved1; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Description("Kernel Idle States"):amended, - localeid("MS\\0x409"), - guid("{ba138e10-e250-4ad7-8616-cf1a7ad410e7}")] -class KernelIdleStates:MSKernelPpmClass { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Type"):amended, - Description("Type"):amended // IDLE_STATES_LINEAR, etc - ] uint32 Type; - - [WmiDataId(2), - read, - DisplayName("Number of Kernel Idle States"):amended, - Description("Total number of Kernel Idle States"):amended - ] uint32 Count; - - [WmiDataId(3), - read, - DisplayName("TargetState"):amended, - Description("Current target idle state"):amended - ] uint32 TargetState; - - [WmiDataId(4), - read, - DisplayName("TargetState"):amended, - Description("Previous target idle state"):amended - ] uint32 OldState; - - [WmiDataId(5), - read, - DisplayName("TargetProcessors"):amended, - Description("TargetProcessors"):amended - ] uint64 TargetProcessors; - - [WmiDataId(6), - read, - DisplayName("Idle States"):amended, - Description("Array of Idle States"):amended, - WmiSizeIs("Count") - ] KernelIdleState State[]; -}; - -// -// Events. -// - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Perf State Transition Event"), - guid("{A5B32DDD-7F39-4abc-B892-900E43B59EBB}")] -class KernelPerfStateChange:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("State"):amended, - Description("State"):amended - ] uint32 State; - - [WmiDataId(2), - read, - DisplayName("Status"):amended, - Description("Status"):amended - ] uint32 Status; - - [WmiDataId(3), - read, - DisplayName("Latency"):amended, - Description("Latency"):amended - ] uint32 Latency; - - [WmiDataId(4), - read, - DisplayName("Cpu Speed"):amended, - Description("Cpu Speed"):amended - ] uint32 Speed; - - [WmiDataId(5), - read, - DisplayName("Processor"):amended, - Description("Processor"):amended - ] uint32 Processor; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Perf State Domain Transition Event"), - guid("{995e6b7f-d653-497a-b978-36a30c29bf01}")] -class KernelPerfStateDomainChange:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("State"):amended, - Description("State"):amended - ] uint32 State; - - [WmiDataId(2), - read, - DisplayName("Latency"):amended, - Description("Latency"):amended - ] uint32 Latency; - - [WmiDataId(3), - read, - DisplayName("Cpu Speed"):amended, - Description("Cpu Speed"):amended - ] uint32 Speed; - - [WmiDataId(4), - read, - DisplayName("Processors"):amended, - Description("Mask of processors in the same domain"):amended - ] uint64 Processors; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Idle State Change Event"), - guid("{4838fe4f-f71c-4e51-9ecc-8430a7ac4c6c}")] -class KernelIdleStateChange:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("NewState"):amended, - Description("New Target Idle State"):amended - ] uint32 NewState; - - [WmiDataId(2), - read, - DisplayName("OldState"):amended, - Description("Old Target Idle State"):amended - ] uint32 OldState; - - [WmiDataId(3), - read, - DisplayName("TargetProcessors"):amended, - Description("TargetProcessors"):amended - ] uint64 Processors; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Thermal Event"), - guid("{a852c2c8-1a4c-423b-8c2c-f30d82931a88}")] -class KernelThermalConstraintChange:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("ThermalConstraint"):amended, - Description("ThermalConstraint"):amended - ] uint32 ThermalConstraint; - - [WmiDataId(2), - read, - DisplayName("TargetProcessors"):amended, - Description("TargetProcessors"):amended - ] uint64 Processors; -}; - -[WMI, - localeid("MS\\0x409"), - Description("Kernel Idle State Accounting"):amended, - guid("{5280028a-c24f-43ec-b27d-a960a70e319a}")] -class IdleStateAccounting { - - [WmiDataId(1), - read, - DisplayName("IdleTransitions"):amended, - Description("IdleTransitions"):amended - ] uint32 IdleTransitions; - - [WmiDataId(2), - read, - DisplayName("FailedTransitions"):amended, - Description("FailedTransitions"):amended - ] uint32 FailedTransitions; - - [WmiDataId(3), - read, - DisplayName("InvalidBucketIndex"):amended, - Description("InvalidBucketIndex"):amended - ] uint32 InvalidBucketIndex; - - [WmiDataId(4), - read, - DisplayName("TotalTime"):amended, - Description("TotalTime"):amended - ] uint64 TotalTime; - - [WmiDataId(5), - read, - DisplayName("IdleTimeBuckets"):amended, - Description("IdleTimeBuckets"):amended - ] uint32 IdleTimeBuckets[6]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Idle Accounting"):amended, - guid("{e2a26f78-ae07-4ee0-a30f-ce354f5a94cd}")] -class IdleAccounting:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Number of Idle States"):amended, - Description("Total number of Kernel Idle States"):amended - ] uint32 StateCount; - - [WmiDataId(2), - read, - DisplayName("TotalTransitions"):amended, - Description("TotalTransitions"):amended - ] uint32 TotalTransitions; - - [WmiDataId(3), - read, - DisplayName("ResetCount"):amended, - Description("ResetCount"):amended - ] uint32 ResetCount; - - [WmiDataId(4), - read, - DisplayName("StartTime"):amended, - Description("StartTime"):amended - ] uint64 StartTime; - - [WmiDataId(5), - read, - DisplayName("Idle States Accounting"):amended, - Description("Accounting Data for Kernel Idle States"):amended, - WmiSizeIs("StateCount") - ] IdleStateAccounting State[]; -}; - -[WMI, - localeid("MS\\0x409"), - Description("Kernel Idle State Bucket Extended"):amended, - guid("{e53e0a7d-36f0-4a77-879e-9c6b5e4a8554}")] -class IdleStateBucketEx { - - [WmiDataId(1), - read, - DisplayName("TotalTimeUs"):amended, - Description("TotalTimeUs"):amended - ] uint64 TotalTimeUs; - - [WmiDataId(2), - read, - DisplayName("MinTimeUs"):amended, - Description("MinTimeUs"):amended - ] uint32 MinTimeUs; - - [WmiDataId(3), - read, - DisplayName("MaxTimeUs"):amended, - Description("MaxTimeUs"):amended - ] uint32 MaxTimeUs; - - [WmiDataId(4), - read, - DisplayName("Count"):amended, - Description("Count"):amended - ] uint32 Count; -}; - -[WMI, - localeid("MS\\0x409"), - Description("Kernel Idle State Accounting"):amended, - guid("{3e0d7b2c-401b-480f-8303-d0c20ea1a7d8}")] -class IdleStateAccountingEx { - - [WmiDataId(1), - read, - DisplayName("TotalTime"):amended, - Description("TotalTime"):amended - ] uint64 TotalTime; - - [WmiDataId(2), - read, - DisplayName("IdleTransitions"):amended, - Description("IdleTransitions"):amended - ] uint32 IdleTransitions; - - [WmiDataId(3), - read, - DisplayName("FailedTransitions"):amended, - Description("FailedTransitions"):amended - ] uint32 FailedTransitions; - - [WmiDataId(4), - read, - DisplayName("InvalidBucketIndex"):amended, - Description("InvalidBucketIndex"):amended - ] uint32 InvalidBucketIndex; - - [WmiDataId(5), - read, - DisplayName("MinTimeUs"):amended, - Description("MinTimeUs"):amended - ] uint32 MinTimeUs; - - [WmiDataId(6), - read, - DisplayName("MaxTimeUs"):amended, - Description("MaxTimeUs"):amended - ] uint32 MaxTimeUs; - - [WmiDataId(7), - read, - DisplayName("IdleTimeBuckets"):amended, - Description("IdleTimeBuckets"):amended - ] IdleStateBucketEx IdleTimeBuckets[16]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Idle Accounting"):amended, - guid("{d67abd39-81f8-4a5e-8152-72e31ec912ee}")] -class IdleAccountingEx:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Number of Idle States"):amended, - Description("Total number of Kernel Idle States"):amended - ] uint32 StateCount; - - [WmiDataId(2), - read, - DisplayName("TotalTransitions"):amended, - Description("TotalTransitions"):amended - ] uint32 TotalTransitions; - - [WmiDataId(3), - read, - DisplayName("ResetCount"):amended, - Description("ResetCount"):amended - ] uint32 ResetCount; - - [WmiDataId(4), - read, - DisplayName("StartTime"):amended, - Description("StartTime"):amended - ] uint64 StartTime; - - [WmiDataId(5), - read, - DisplayName("Idle States Accounting"):amended, - Description("Accounting Data for Kernel Idle States"):amended, - WmiSizeIs("StateCount") - ] IdleStateAccountingEx State[]; -}; - -[WMI, - Dynamic, - Provider("WmiProv"), - Locale("MS\\0x409"), - Description("Kernel Thermal Policy Event"), - guid("{aca5a8f7-96ca-4397-bade-43be2f577d51}")] -class KernelThermalPolicyChange:WmiEvent { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Cooling Policy"):amended, - Description("Current ACPI Cooling Mode"):amended - ] uint8 CoolingMode; - - [WmiDataId(2), - read, - DisplayName("Processors"):amended, - Description("Processors"):amended - ] uint64 Processors; -}; - -// -// Define schema for performance counters to be displayed by perfmon -// -// All perf counter classes must derived from Win32_PerfRawData and -// have the hiperf qualifier. -// -// Each property within the class must have the following qualifiers: -// -// CounterType - This defines the type of counter. See winperf.h -// for more information on what values to place in this -// qualifier. -// -// PerfDetail - The amount of detail supplied by the counter. -// PERF_DETAIL_NOVICE 100 // The uninformed can understand it -// PERF_DETAIL_ADVANCED 200 // For the advanced user -// PERF_DETAIL_EXPERT 300 // For the expert user -// PERF_DETAIL_WIZARD 400 // For the system designer -// -// DefaultScale - Power if 10 by which to scale chart line if -// vertical axis is 100. 0 ==> 1, 1 ==> 10, -// -1 ==> 1/10. Used for purposes display only. -// -// Also property may have the following optional qualifiers -// -// PerfDefault - Denotes the property that is the default counter -// as displayed by the Sysmon list box. Only one -// property may have this qualifier. -// -// Costly - Indicates that the value for the property may -// be costly to obtain -// -// -// Only int32, uint32, int64 and uint64 properties will be displayed in sysmon -// -// All performance counter classes should be localizable, which means that -// they should include ammended DisplayName and Description class and property -// qualifiers. -// - -[WMI, - Dynamic, - Provider("WMIProv"), - Description("Processor Performance Information"):amended, - DisplayName("Processor Performance"):amended, - localeid("MS\\0x409"), - guid("{7FD18652-0CFE-40d2-B0A1-0B066A87759E}"), - PerfDetail(100), - HiPerf] -class ProcessorPerformance:Win32_PerfRawData { - - [key, read] string InstanceName; - [read] boolean Active; - - [WmiDataId(1), - read, - DisplayName("Processor Frequency"):amended, - Description("Current Processor Frequency in megahertz"):amended, - PerfDefault, - CounterType(0x00010000), - DefaultScale(0), - PerfDetail(100) - ] uint32 frequency; - - [WmiDataId(2), - read, - DisplayName("Processor State Flags"):amended, - Description("Processor State Flags"):amended, - CounterType(0x00000000), - DefaultScale(0), - PerfDetail(100) - ] uint32 power; - - [WmiDataId(3), - read, - DisplayName("% of Maximum Frequency"):amended, - Description("Percentage of maximum processor frequency"):amended, - CounterType(0x00010000), - DefaultScale(0), - PerfDetail(100) - ] uint32 percentage; -}; - - diff --git a/qt-correction-tool/pub/ddk/wmidata.h b/qt-correction-tool/pub/ddk/wmidata.h deleted file mode 100644 index 7e6ff1e..0000000 --- a/qt-correction-tool/pub/ddk/wmidata.h +++ /dev/null @@ -1,12202 +0,0 @@ -#ifndef _wmidata_h_ -#define _wmidata_h_ - -// MSWmi_MofData - MSWmi_MofData -#define MSWmi_MofDataGuid \ - { 0x05901221,0xd566,0x11d1, { 0xb2,0xf0,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_MofData_GUID, \ - 0x05901221,0xd566,0x11d1,0xb2,0xf0,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSWmi_MofData -{ - // - ULONG Unused1; - #define MSWmi_MofData_Unused1_SIZE sizeof(ULONG) - #define MSWmi_MofData_Unused1_ID 1 - - // - ULONG Unused2; - #define MSWmi_MofData_Unused2_SIZE sizeof(ULONG) - #define MSWmi_MofData_Unused2_ID 2 - - // - ULONG Size; - #define MSWmi_MofData_Size_SIZE sizeof(ULONG) - #define MSWmi_MofData_Size_ID 3 - - // - ULONG Unused4; - #define MSWmi_MofData_Unused4_SIZE sizeof(ULONG) - #define MSWmi_MofData_Unused4_ID 4 - - // - UCHAR BinaryMofData[1]; - #define MSWmi_MofData_BinaryMofData_ID 5 - -} MSWmi_MofData, *PMSWmi_MofData; - -// MSWmi_ProviderInfo - MSWmi_ProviderInfo -#define MSWmi_ProviderInfoGuid \ - { 0xc7bf35d0,0xaadb,0x11d1, { 0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_ProviderInfo_GUID, \ - 0xc7bf35d0,0xaadb,0x11d1,0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -// Warning: Header for class MSWmi_ProviderInfo cannot be created -typedef struct _MSWmi_ProviderInfo -{ - char VariableData[1]; - -} MSWmi_ProviderInfo, *PMSWmi_ProviderInfo; - -// MSWmi_PnPDeviceId - MSWmi_PnPDeviceId -#define DATA_PROVIDER_PNPID_GUID \ - { 0xc7bf35d2,0xaadb,0x11d1, { 0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_PnPDeviceId_GUID, \ - 0xc7bf35d2,0xaadb,0x11d1,0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSWmi_PnPDeviceId -{ - // - CHAR VariableData[1]; - #define MSWmi_PnPDeviceId_PnPDeviceId_ID 1 - -} MSWmi_PnPDeviceId, *PMSWmi_PnPDeviceId; - -// MSWmi_PnPInstanceNames - MSWmi_PnPInstanceNames -#define DATA_PROVIDER_PNPID_INSTANCE_NAMES_GUID \ - { 0xc7bf35d3,0xaadb,0x11d1, { 0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_PnPInstanceNames_GUID, \ - 0xc7bf35d3,0xaadb,0x11d1,0xbf,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSWmi_PnPInstanceNames -{ - // - ULONG Count; - #define MSWmi_PnPInstanceNames_Count_SIZE sizeof(ULONG) - #define MSWmi_PnPInstanceNames_Count_ID 1 - - // - WCHAR InstanceNameList[1]; - #define MSWmi_PnPInstanceNames_InstanceNameList_ID 2 - -} MSWmi_PnPInstanceNames, *PMSWmi_PnPInstanceNames; - -// MSWmi_Guid - MSWmi_Guid -#define MSWmi_GuidGuid \ - { 0xf8c60aed,0xef8d,0x4f95, { 0x9e,0xa8,0xf0,0x43,0x18,0xa0,0x0f,0x30 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_Guid_GUID, \ - 0xf8c60aed,0xef8d,0x4f95,0x9e,0xa8,0xf0,0x43,0x18,0xa0,0x0f,0x30); -#endif - - -typedef struct _MSWmi_Guid -{ - // - UCHAR Guid[16]; - #define MSWmi_Guid_Guid_SIZE sizeof(UCHAR[16]) - #define MSWmi_Guid_Guid_ID 1 - -} MSWmi_Guid, *PMSWmi_Guid; - -#define MSWmi_Guid_SIZE (FIELD_OFFSET(MSWmi_Guid, Guid) + MSWmi_Guid_Guid_SIZE) - -// MSWmi_GuidRegistrationInfo - MSWmi_GuidRegistrationInfo -#define MSWmi_GuidRegistrationInfoGuid \ - { 0xb48d49a1,0xe777,0x11d0, { 0xa5,0x0c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSWmi_GuidRegistrationInfo_GUID, \ - 0xb48d49a1,0xe777,0x11d0,0xa5,0x0c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSWmi_GuidRegistrationInfo -{ - // - ULONG Operation; - #define MSWmi_GuidRegistrationInfo_Operation_SIZE sizeof(ULONG) - #define MSWmi_GuidRegistrationInfo_Operation_ID 1 - - // - ULONG GuidCount; - #define MSWmi_GuidRegistrationInfo_GuidCount_SIZE sizeof(ULONG) - #define MSWmi_GuidRegistrationInfo_GuidCount_ID 2 - - // - MSWmi_Guid GuidList[1]; - #define MSWmi_GuidRegistrationInfo_GuidList_ID 3 - -} MSWmi_GuidRegistrationInfo, *PMSWmi_GuidRegistrationInfo; - -// MSAcpiInfo - MSAcpiInfo -#define MSAcpiInfoGuid \ - { 0x5daf38ae,0xf6f8,0x4d90, { 0x81,0x99,0xeb,0xde,0x68,0x00,0xec,0x3b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSAcpiInfo_GUID, \ - 0x5daf38ae,0xf6f8,0x4d90,0x81,0x99,0xeb,0xde,0x68,0x00,0xec,0x3b); -#endif - - -typedef struct _MSAcpiInfo -{ - // - ULONG BootArchitecture; - #define MSAcpiInfo_BootArchitecture_SIZE sizeof(ULONG) - #define MSAcpiInfo_BootArchitecture_ID 1 - - // - ULONG PreferredProfile; - #define MSAcpiInfo_PreferredProfile_SIZE sizeof(ULONG) - #define MSAcpiInfo_PreferredProfile_ID 2 - - // - ULONG Capabilities; - #define MSAcpiInfo_Capabilities_SIZE sizeof(ULONG) - #define MSAcpiInfo_Capabilities_ID 3 - -} MSAcpiInfo, *PMSAcpiInfo; - -#define MSAcpiInfo_SIZE (FIELD_OFFSET(MSAcpiInfo, Capabilities) + MSAcpiInfo_Capabilities_SIZE) - -// WHEAErrorInjectionMethods - WHEAErrorInjectionMethods -#define WHEAErrorInjectionMethodsGuid \ - { 0xe808ff73,0x2093,0x472a, { 0xa5,0xcc,0xdf,0x24,0xf0,0x31,0xb0,0x35 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WHEAErrorInjectionMethods_GUID, \ - 0xe808ff73,0x2093,0x472a,0xa5,0xcc,0xdf,0x24,0xf0,0x31,0xb0,0x35); -#endif - -// -// Method id definitions for WHEAErrorInjectionMethods -#define GetErrorInjectionCapabilitiesRtn 1 -typedef struct _GET_INJECTION_CAPABILITIES_OUT -{ - // - ULONG Status; - #define GET_INJECTION_CAPABILITIES_OUT_Status_SIZE sizeof(ULONG) - #define GET_INJECTION_CAPABILITIES_OUT_Status_ID 1 - - // - ULONG Capabilities; - #define GET_INJECTION_CAPABILITIES_OUT_Capabilities_SIZE sizeof(ULONG) - #define GET_INJECTION_CAPABILITIES_OUT_Capabilities_ID 2 - -} GET_INJECTION_CAPABILITIES_OUT, *PGET_INJECTION_CAPABILITIES_OUT; - -#define GET_INJECTION_CAPABILITIES_OUT_SIZE (FIELD_OFFSET(GET_INJECTION_CAPABILITIES_OUT, Capabilities) + GET_INJECTION_CAPABILITIES_OUT_Capabilities_SIZE) - -#define InjectErrorRtn 2 -typedef struct _INJECT_HARDWARE_ERROR_IN -{ - // - ULONG ErrorType; - #define INJECT_HARDWARE_ERROR_IN_ErrorType_SIZE sizeof(ULONG) - #define INJECT_HARDWARE_ERROR_IN_ErrorType_ID 1 - - // - ULONGLONG Parameter1; - #define INJECT_HARDWARE_ERROR_IN_Parameter1_SIZE sizeof(ULONGLONG) - #define INJECT_HARDWARE_ERROR_IN_Parameter1_ID 2 - - // - ULONGLONG Parameter2; - #define INJECT_HARDWARE_ERROR_IN_Parameter2_SIZE sizeof(ULONGLONG) - #define INJECT_HARDWARE_ERROR_IN_Parameter2_ID 3 - - // - ULONGLONG Parameter3; - #define INJECT_HARDWARE_ERROR_IN_Parameter3_SIZE sizeof(ULONGLONG) - #define INJECT_HARDWARE_ERROR_IN_Parameter3_ID 4 - - // - ULONGLONG Parameter4; - #define INJECT_HARDWARE_ERROR_IN_Parameter4_SIZE sizeof(ULONGLONG) - #define INJECT_HARDWARE_ERROR_IN_Parameter4_ID 5 - -} INJECT_HARDWARE_ERROR_IN, *PINJECT_HARDWARE_ERROR_IN; - -#define INJECT_HARDWARE_ERROR_IN_SIZE (FIELD_OFFSET(INJECT_HARDWARE_ERROR_IN, Parameter4) + INJECT_HARDWARE_ERROR_IN_Parameter4_SIZE) - -typedef struct _INJECT_HARDWARE_ERROR_OUT -{ - // - ULONG Status; - #define INJECT_HARDWARE_ERROR_OUT_Status_SIZE sizeof(ULONG) - #define INJECT_HARDWARE_ERROR_OUT_Status_ID 6 - -} INJECT_HARDWARE_ERROR_OUT, *PINJECT_HARDWARE_ERROR_OUT; - -#define INJECT_HARDWARE_ERROR_OUT_SIZE (FIELD_OFFSET(INJECT_HARDWARE_ERROR_OUT, Status) + INJECT_HARDWARE_ERROR_OUT_Status_SIZE) - - -// WHEAErrorSourceMethods - WHEAErrorSourceMethods -#define WHEAErrorSourceMethodsGuid \ - { 0x91c3c007,0x185d,0x4d78, { 0xa7,0x51,0xbf,0xcb,0x31,0xc2,0xc6,0x4d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WHEAErrorSourceMethods_GUID, \ - 0x91c3c007,0x185d,0x4d78,0xa7,0x51,0xbf,0xcb,0x31,0xc2,0xc6,0x4d); -#endif - -// -// Method id definitions for WHEAErrorSourceMethods -#define GetAllErrorSourcesRtn 1 -typedef struct _GET_ALL_ERROR_SOURCES_OUT -{ - // - ULONG Status; - #define GET_ALL_ERROR_SOURCES_OUT_Status_SIZE sizeof(ULONG) - #define GET_ALL_ERROR_SOURCES_OUT_Status_ID 1 - - // - ULONG Count; - #define GET_ALL_ERROR_SOURCES_OUT_Count_SIZE sizeof(ULONG) - #define GET_ALL_ERROR_SOURCES_OUT_Count_ID 2 - - // - ULONG Length; - #define GET_ALL_ERROR_SOURCES_OUT_Length_SIZE sizeof(ULONG) - #define GET_ALL_ERROR_SOURCES_OUT_Length_ID 3 - - // - UCHAR ErrorSourceArray[1]; - #define GET_ALL_ERROR_SOURCES_OUT_ErrorSourceArray_ID 4 - -} GET_ALL_ERROR_SOURCES_OUT, *PGET_ALL_ERROR_SOURCES_OUT; - -#define GetErrorSourceInfoRtn 2 -typedef struct _GET_ERROR_SOURCE_INFO_IN -{ - // - ULONG ErrorSourceId; - #define GET_ERROR_SOURCE_INFO_IN_ErrorSourceId_SIZE sizeof(ULONG) - #define GET_ERROR_SOURCE_INFO_IN_ErrorSourceId_ID 2 - -} GET_ERROR_SOURCE_INFO_IN, *PGET_ERROR_SOURCE_INFO_IN; - -#define GET_ERROR_SOURCE_INFO_IN_SIZE (FIELD_OFFSET(GET_ERROR_SOURCE_INFO_IN, ErrorSourceId) + GET_ERROR_SOURCE_INFO_IN_ErrorSourceId_SIZE) - -typedef struct _GET_ERROR_SOURCE_INFO_OUT -{ - // - ULONG Status; - #define GET_ERROR_SOURCE_INFO_OUT_Status_SIZE sizeof(ULONG) - #define GET_ERROR_SOURCE_INFO_OUT_Status_ID 1 - - // - ULONG Length; - #define GET_ERROR_SOURCE_INFO_OUT_Length_SIZE sizeof(ULONG) - #define GET_ERROR_SOURCE_INFO_OUT_Length_ID 3 - - // - UCHAR ErrorSourceInfo[1]; - #define GET_ERROR_SOURCE_INFO_OUT_ErrorSourceInfo_ID 4 - -} GET_ERROR_SOURCE_INFO_OUT, *PGET_ERROR_SOURCE_INFO_OUT; - -#define SetErrorSourceInfoRtn 3 -typedef struct _SET_ERROR_SOURCE_INFO_IN -{ - // - ULONG Length; - #define SET_ERROR_SOURCE_INFO_IN_Length_SIZE sizeof(ULONG) - #define SET_ERROR_SOURCE_INFO_IN_Length_ID 2 - - // - UCHAR ErrorSourceInfo[1]; - #define SET_ERROR_SOURCE_INFO_IN_ErrorSourceInfo_ID 3 - -} SET_ERROR_SOURCE_INFO_IN, *PSET_ERROR_SOURCE_INFO_IN; - -typedef struct _SET_ERROR_SOURCE_INFO_OUT -{ - // - ULONG Status; - #define SET_ERROR_SOURCE_INFO_OUT_Status_SIZE sizeof(ULONG) - #define SET_ERROR_SOURCE_INFO_OUT_Status_ID 1 - -} SET_ERROR_SOURCE_INFO_OUT, *PSET_ERROR_SOURCE_INFO_OUT; - -#define SET_ERROR_SOURCE_INFO_OUT_SIZE (FIELD_OFFSET(SET_ERROR_SOURCE_INFO_OUT, Status) + SET_ERROR_SOURCE_INFO_OUT_Status_SIZE) - -#define EnableErrorSourceRtn 4 -typedef struct _ENABLE_ERROR_SOURCE_IN -{ - // - ULONG ErrorSourceId; - #define ENABLE_ERROR_SOURCE_IN_ErrorSourceId_SIZE sizeof(ULONG) - #define ENABLE_ERROR_SOURCE_IN_ErrorSourceId_ID 2 - -} ENABLE_ERROR_SOURCE_IN, *PENABLE_ERROR_SOURCE_IN; - -#define ENABLE_ERROR_SOURCE_IN_SIZE (FIELD_OFFSET(ENABLE_ERROR_SOURCE_IN, ErrorSourceId) + ENABLE_ERROR_SOURCE_IN_ErrorSourceId_SIZE) - -typedef struct _ENABLE_ERROR_SOURCE_OUT -{ - // - ULONG Status; - #define ENABLE_ERROR_SOURCE_OUT_Status_SIZE sizeof(ULONG) - #define ENABLE_ERROR_SOURCE_OUT_Status_ID 1 - -} ENABLE_ERROR_SOURCE_OUT, *PENABLE_ERROR_SOURCE_OUT; - -#define ENABLE_ERROR_SOURCE_OUT_SIZE (FIELD_OFFSET(ENABLE_ERROR_SOURCE_OUT, Status) + ENABLE_ERROR_SOURCE_OUT_Status_SIZE) - -#define DisableErrorSourceRtn 5 -typedef struct _DISABLE_ERROR_SOURCE_IN -{ - // - ULONG ErrorSourceId; - #define DISABLE_ERROR_SOURCE_IN_ErrorSourceId_SIZE sizeof(ULONG) - #define DISABLE_ERROR_SOURCE_IN_ErrorSourceId_ID 2 - -} DISABLE_ERROR_SOURCE_IN, *PDISABLE_ERROR_SOURCE_IN; - -#define DISABLE_ERROR_SOURCE_IN_SIZE (FIELD_OFFSET(DISABLE_ERROR_SOURCE_IN, ErrorSourceId) + DISABLE_ERROR_SOURCE_IN_ErrorSourceId_SIZE) - -typedef struct _DISABLE_ERROR_SOURCE_OUT -{ - // - ULONG Status; - #define DISABLE_ERROR_SOURCE_OUT_Status_SIZE sizeof(ULONG) - #define DISABLE_ERROR_SOURCE_OUT_Status_ID 1 - -} DISABLE_ERROR_SOURCE_OUT, *PDISABLE_ERROR_SOURCE_OUT; - -#define DISABLE_ERROR_SOURCE_OUT_SIZE (FIELD_OFFSET(DISABLE_ERROR_SOURCE_OUT, Status) + DISABLE_ERROR_SOURCE_OUT_Status_SIZE) - - -// MSSmBios_RawSMBiosTables - MSSmBios_RawSMBiosTables -#define MSSmBios_RawSMBiosTablesGuid \ - { 0x8f680850,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_RawSMBiosTables_GUID, \ - 0x8f680850,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSSmBios_RawSMBiosTables -{ - // - BOOLEAN Used20CallingMethod; - #define MSSmBios_RawSMBiosTables_Used20CallingMethod_SIZE sizeof(BOOLEAN) - #define MSSmBios_RawSMBiosTables_Used20CallingMethod_ID 1 - - // - UCHAR SmbiosMajorVersion; - #define MSSmBios_RawSMBiosTables_SmbiosMajorVersion_SIZE sizeof(UCHAR) - #define MSSmBios_RawSMBiosTables_SmbiosMajorVersion_ID 2 - - // - UCHAR SmbiosMinorVersion; - #define MSSmBios_RawSMBiosTables_SmbiosMinorVersion_SIZE sizeof(UCHAR) - #define MSSmBios_RawSMBiosTables_SmbiosMinorVersion_ID 3 - - // - UCHAR DmiRevision; - #define MSSmBios_RawSMBiosTables_DmiRevision_SIZE sizeof(UCHAR) - #define MSSmBios_RawSMBiosTables_DmiRevision_ID 4 - - // - ULONG Size; - #define MSSmBios_RawSMBiosTables_Size_SIZE sizeof(ULONG) - #define MSSmBios_RawSMBiosTables_Size_ID 5 - - // - UCHAR SMBiosData[1]; - #define MSSmBios_RawSMBiosTables_SMBiosData_ID 6 - -} MSSmBios_RawSMBiosTables, *PMSSmBios_RawSMBiosTables; - -// MSSmBios_SMBiosEventlog - MSSmBios_SMBiosEventlog -#define MSSmBios_SMBiosEventlogGuid \ - { 0x8f680851,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_SMBiosEventlog_GUID, \ - 0x8f680851,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -// Warning: Header for class MSSmBios_SMBiosEventlog cannot be created -typedef struct _MSSmBios_SMBiosEventlog -{ - char VariableData[1]; - -} MSSmBios_SMBiosEventlog, *PMSSmBios_SMBiosEventlog; - -// MSSmBios_SysidUUID - SYSID_UUID -#define MSSmBios_SysidUUIDGuid \ - { 0x8f680852,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_SysidUUID_GUID, \ - 0x8f680852,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _SYSID_UUID -{ - // - UCHAR Uuid[16]; - #define SYSID_UUID_Uuid_SIZE sizeof(UCHAR[16]) - #define SYSID_UUID_Uuid_ID 1 - -} SYSID_UUID, *PSYSID_UUID; - -#define SYSID_UUID_SIZE (FIELD_OFFSET(SYSID_UUID, Uuid) + SYSID_UUID_Uuid_SIZE) - -// MSSmBios_SysidUUIDList - MSSmBios_SysidUUIDList -#define SYSID_UUID_DATA_GUID \ - { 0x8f680853,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_SysidUUIDList_GUID, \ - 0x8f680853,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSSmBios_SysidUUIDList -{ - // - ULONG Count; - #define MSSmBios_SysidUUIDList_Count_SIZE sizeof(ULONG) - #define MSSmBios_SysidUUIDList_Count_ID 1 - - // - SYSID_UUID List[1]; - #define MSSmBios_SysidUUIDList_List_ID 2 - -} MSSmBios_SysidUUIDList, *PMSSmBios_SysidUUIDList; - -// MSSmBios_Sysid1394 - SYSID_1394 -#define MSSmBios_Sysid1394Guid \ - { 0x8f680854,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_Sysid1394_GUID, \ - 0x8f680854,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _SYSID_1394 -{ - // - UCHAR x1394[8]; - #define SYSID_1394_x1394_SIZE sizeof(UCHAR[8]) - #define SYSID_1394_x1394_ID 1 - -} SYSID_1394, *PSYSID_1394; - -#define SYSID_1394_SIZE (FIELD_OFFSET(SYSID_1394, x1394) + SYSID_1394_x1394_SIZE) - -// MSSmBios_Sysid1394List - MSSmBios_Sysid1394List -#define SYSID_1394_DATA_GUID \ - { 0x8f680855,0xa584,0x11d1, { 0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSmBios_Sysid1394List_GUID, \ - 0x8f680855,0xa584,0x11d1,0xbf,0x38,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSSmBios_Sysid1394List -{ - // - ULONG Count; - #define MSSmBios_Sysid1394List_Count_SIZE sizeof(ULONG) - #define MSSmBios_Sysid1394List_Count_ID 1 - - // - SYSID_1394 List[1]; - #define MSSmBios_Sysid1394List_List_ID 2 - -} MSSmBios_Sysid1394List, *PMSSmBios_Sysid1394List; - -// MSMCAEvent_SwitchToCMCPolling - MSMCAEvent_SwitchToCMCPolling -#define MSMCAEvent_SwitchToCMCPollingGuid \ - { 0x39c14290,0xf036,0x4999, { 0xb8,0xa1,0xb6,0xf8,0x71,0xfb,0x32,0x9e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_SwitchToCMCPolling_GUID, \ - 0x39c14290,0xf036,0x4999,0xb8,0xa1,0xb6,0xf8,0x71,0xfb,0x32,0x9e); -#endif - - -// MSMCAEvent_SwitchToCPEPolling - MSMCAEvent_SwitchToCPEPolling -#define MSMCAEvent_SwitchToCPEPollingGuid \ - { 0xd5c870ce,0x4ed0,0x4fdc, { 0xbb,0x54,0x8b,0x45,0x2c,0x18,0x79,0x7e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_SwitchToCPEPolling_GUID, \ - 0xd5c870ce,0x4ed0,0x4fdc,0xbb,0x54,0x8b,0x45,0x2c,0x18,0x79,0x7e); -#endif - - -// MSMCAEvent_Header - MSMCAEvent_Header -#define MSMCAEvent_HeaderGuid \ - { 0x6381c27f,0xc8fa,0x4da7, { 0x89,0x53,0xb8,0x68,0x33,0x73,0x6e,0x15 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_Header_GUID, \ - 0x6381c27f,0xc8fa,0x4da7,0x89,0x53,0xb8,0x68,0x33,0x73,0x6e,0x15); -#endif - - -typedef struct _MSMCAEvent_Header -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_Header_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_Header_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_Header_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_Header_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_Header_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_Header_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_Header_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_Header_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_Header_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_Header_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_Header_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_Header_LogToEventlog_ID 6 - -} MSMCAEvent_Header, *PMSMCAEvent_Header; - -#define MSMCAEvent_Header_SIZE (FIELD_OFFSET(MSMCAEvent_Header, LogToEventlog) + MSMCAEvent_Header_LogToEventlog_SIZE) - -// MSMCAEvent_BusError - MSMCAEvent_BusError -#define MSMCAEvent_BusErrorGuid \ - { 0x1ee17050,0x0039,0x40f7, { 0x9e,0xad,0x14,0xad,0x51,0x61,0x2c,0xb2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_BusError_GUID, \ - 0x1ee17050,0x0039,0x40f7,0x9e,0xad,0x14,0xad,0x51,0x61,0x2c,0xb2); -#endif - - -typedef struct _MSMCAEvent_BusError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_BusError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_BusError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_BusError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_BusError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_BusError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_BusError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_BusError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_BusError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_LogToEventlog_ID 6 - - // - ULONG Participation; - #define MSMCAEvent_BusError_Participation_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_Participation_ID 7 - - // - ULONG MemoryHierarchyLevel; - #define MSMCAEvent_BusError_MemoryHierarchyLevel_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_MemoryHierarchyLevel_ID 8 - - // - ULONG RequestType; - #define MSMCAEvent_BusError_RequestType_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_RequestType_ID 9 - - // - ULONG MemOrIo; - #define MSMCAEvent_BusError_MemOrIo_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_MemOrIo_ID 10 - - // The address at which the error occurred. - ULONGLONG Address; - #define MSMCAEvent_BusError_Address_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_BusError_Address_ID 11 - - // - ULONG Size; - #define MSMCAEvent_BusError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_BusError_Size_ID 12 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_BusError_RawRecord_ID 13 - -} MSMCAEvent_BusError, *PMSMCAEvent_BusError; - -// MSMCAEvent_TLBError - MSMCAEvent_TLBError -#define MSMCAEvent_TLBErrorGuid \ - { 0xb161eeab,0xac03,0x4c2b, { 0xae,0x7a,0x5a,0x37,0x68,0xf7,0x0e,0x85 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_TLBError_GUID, \ - 0xb161eeab,0xac03,0x4c2b,0xae,0x7a,0x5a,0x37,0x68,0xf7,0x0e,0x85); -#endif - - -typedef struct _MSMCAEvent_TLBError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_TLBError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_TLBError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_TLBError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_TLBError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_TLBError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_TLBError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_TLBError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_TLBError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_LogToEventlog_ID 6 - - // - ULONG TransactionType; - #define MSMCAEvent_TLBError_TransactionType_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_TransactionType_ID 7 - - // - ULONG MemoryHierarchyLevel; - #define MSMCAEvent_TLBError_MemoryHierarchyLevel_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_MemoryHierarchyLevel_ID 8 - - // The address at which the error occurred. - ULONGLONG Address; - #define MSMCAEvent_TLBError_Address_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_TLBError_Address_ID 9 - - // - ULONG Size; - #define MSMCAEvent_TLBError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_TLBError_Size_ID 10 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_TLBError_RawRecord_ID 11 - -} MSMCAEvent_TLBError, *PMSMCAEvent_TLBError; - -// MSMCAEvent_MemoryHierarchyError - MSMCAEvent_MemoryHierarchyError -#define MSMCAEvent_MemoryHierarchyErrorGuid \ - { 0xcede75a0,0xa77f,0x452b, { 0x8f,0x2f,0x54,0x1f,0x92,0x6d,0xb0,0xf9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_MemoryHierarchyError_GUID, \ - 0xcede75a0,0xa77f,0x452b,0x8f,0x2f,0x54,0x1f,0x92,0x6d,0xb0,0xf9); -#endif - - -typedef struct _MSMCAEvent_MemoryHierarchyError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_MemoryHierarchyError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryHierarchyError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_MemoryHierarchyError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_MemoryHierarchyError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_MemoryHierarchyError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_MemoryHierarchyError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_MemoryHierarchyError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_MemoryHierarchyError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_LogToEventlog_ID 6 - - // - ULONG TransactionType; - #define MSMCAEvent_MemoryHierarchyError_TransactionType_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_TransactionType_ID 7 - - // - ULONG MemoryHierarchyLevel; - #define MSMCAEvent_MemoryHierarchyError_MemoryHierarchyLevel_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_MemoryHierarchyLevel_ID 8 - - // - ULONG RequestType; - #define MSMCAEvent_MemoryHierarchyError_RequestType_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_RequestType_ID 9 - - // The address at which the error occurred. - ULONGLONG Address; - #define MSMCAEvent_MemoryHierarchyError_Address_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryHierarchyError_Address_ID 10 - - // - ULONG Size; - #define MSMCAEvent_MemoryHierarchyError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryHierarchyError_Size_ID 11 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_MemoryHierarchyError_RawRecord_ID 12 - -} MSMCAEvent_MemoryHierarchyError, *PMSMCAEvent_MemoryHierarchyError; - -// MSMCAEvent_CPUError - MSMCAEvent_CPUError -#define MSMCAEvent_CPUErrorGuid \ - { 0x5ce27cde,0xd179,0x4c68, { 0x93,0x7f,0xa0,0x7b,0x8c,0xc2,0xea,0x39 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_CPUError_GUID, \ - 0x5ce27cde,0xd179,0x4c68,0x93,0x7f,0xa0,0x7b,0x8c,0xc2,0xea,0x39); -#endif - - -typedef struct _MSMCAEvent_CPUError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_CPUError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_CPUError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_CPUError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_CPUError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_CPUError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_CPUError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_CPUError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_CPUError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_LogToEventlog_ID 6 - - -// Cache -#define MCACpuCacheError 0 -// TLB -#define MCACpuTlbError 1 -// Bus -#define MCACpuBusError 2 -// Register File -#define MCACpuRegFileError 3 -// Microarchitecture -#define MCACpuMSError 4 - - // - ULONG MajorErrorType; - #define MSMCAEvent_CPUError_MajorErrorType_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_MajorErrorType_ID 7 - - // - ULONG Level; - #define MSMCAEvent_CPUError_Level_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_Level_ID 8 - - // - ULONG CacheOp; - #define MSMCAEvent_CPUError_CacheOp_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_CacheOp_ID 9 - - // - ULONG CacheMesi; - #define MSMCAEvent_CPUError_CacheMesi_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_CacheMesi_ID 10 - - // - ULONG TLBOp; - #define MSMCAEvent_CPUError_TLBOp_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_TLBOp_ID 11 - - // - ULONG BusType; - #define MSMCAEvent_CPUError_BusType_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_BusType_ID 12 - - // - ULONG BusSev; - #define MSMCAEvent_CPUError_BusSev_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_BusSev_ID 13 - - // - ULONG RegFileId; - #define MSMCAEvent_CPUError_RegFileId_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_RegFileId_ID 14 - - // - ULONG RegFileOp; - #define MSMCAEvent_CPUError_RegFileOp_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_RegFileOp_ID 15 - - // - ULONG MSSid; - #define MSMCAEvent_CPUError_MSSid_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_MSSid_ID 16 - - // - ULONG MSOp; - #define MSMCAEvent_CPUError_MSOp_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_MSOp_ID 17 - - // - ULONG MSArrayId; - #define MSMCAEvent_CPUError_MSArrayId_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_MSArrayId_ID 18 - - // - ULONG MSIndex; - #define MSMCAEvent_CPUError_MSIndex_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_MSIndex_ID 19 - - // - ULONG Size; - #define MSMCAEvent_CPUError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_CPUError_Size_ID 20 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_CPUError_RawRecord_ID 21 - -} MSMCAEvent_CPUError, *PMSMCAEvent_CPUError; - -// MSMCAEvent_MemoryError - MSMCAEvent_MemoryError -#define MSMCAEvent_MemoryErrorGuid \ - { 0x433eea38,0xc1a7,0x48f1, { 0x88,0x4f,0xb6,0x87,0x5f,0x17,0x6c,0xc7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_MemoryError_GUID, \ - 0x433eea38,0xc1a7,0x48f1,0x88,0x4f,0xb6,0x87,0x5f,0x17,0x6c,0xc7); -#endif - - -typedef struct _MSMCAEvent_MemoryError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_MemoryError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_MemoryError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_MemoryError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_MemoryError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_MemoryError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_MemoryError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_MemoryError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_MemoryError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_VALIDATION_BITS_ID 7 - - // - ULONGLONG MEM_ERROR_STATUS; - #define MSMCAEvent_MemoryError_MEM_ERROR_STATUS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_MEM_ERROR_STATUS_ID 8 - - // - ULONGLONG MEM_PHYSICAL_ADDR; - #define MSMCAEvent_MemoryError_MEM_PHYSICAL_ADDR_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_MEM_PHYSICAL_ADDR_ID 9 - - // - ULONGLONG MEM_PHYSICAL_MASK; - #define MSMCAEvent_MemoryError_MEM_PHYSICAL_MASK_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_MEM_PHYSICAL_MASK_ID 10 - - // - ULONGLONG RESPONDER_ID; - #define MSMCAEvent_MemoryError_RESPONDER_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_RESPONDER_ID_ID 11 - - // - ULONGLONG TARGET_ID; - #define MSMCAEvent_MemoryError_TARGET_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_TARGET_ID_ID 12 - - // - ULONGLONG REQUESTOR_ID; - #define MSMCAEvent_MemoryError_REQUESTOR_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_REQUESTOR_ID_ID 13 - - // - ULONGLONG BUS_SPECIFIC_DATA; - #define MSMCAEvent_MemoryError_BUS_SPECIFIC_DATA_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryError_BUS_SPECIFIC_DATA_ID 14 - - // - USHORT MEM_NODE; - #define MSMCAEvent_MemoryError_MEM_NODE_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_NODE_ID 15 - - // - USHORT MEM_CARD; - #define MSMCAEvent_MemoryError_MEM_CARD_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_CARD_ID 16 - - // - USHORT MEM_BANK; - #define MSMCAEvent_MemoryError_MEM_BANK_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_BANK_ID 17 - - // - USHORT xMEM_DEVICE; - #define MSMCAEvent_MemoryError_xMEM_DEVICE_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_xMEM_DEVICE_ID 18 - - // - USHORT MEM_MODULE; - #define MSMCAEvent_MemoryError_MEM_MODULE_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_MODULE_ID 19 - - // - USHORT MEM_ROW; - #define MSMCAEvent_MemoryError_MEM_ROW_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_ROW_ID 20 - - // - USHORT MEM_COLUMN; - #define MSMCAEvent_MemoryError_MEM_COLUMN_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_COLUMN_ID 21 - - // - USHORT MEM_BIT_POSITION; - #define MSMCAEvent_MemoryError_MEM_BIT_POSITION_SIZE sizeof(USHORT) - #define MSMCAEvent_MemoryError_MEM_BIT_POSITION_ID 22 - - // - ULONG Size; - #define MSMCAEvent_MemoryError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_MemoryError_Size_ID 23 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_MemoryError_RawRecord_ID 24 - -} MSMCAEvent_MemoryError, *PMSMCAEvent_MemoryError; - -// MSMCAEvent_PCIBusError - MSMCAEvent_PCIBusError -#define MSMCAEvent_PCIBusErrorGuid \ - { 0xa14a5594,0x25de,0x410e, { 0x9b,0x92,0x80,0xf0,0x80,0x1a,0xec,0x07 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_PCIBusError_GUID, \ - 0xa14a5594,0x25de,0x410e,0x9b,0x92,0x80,0xf0,0x80,0x1a,0xec,0x07); -#endif - - -typedef struct _MSMCAEvent_PCIBusError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_PCIBusError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_PCIBusError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIBusError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_PCIBusError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIBusError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_PCIBusError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIBusError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_PCIBusError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIBusError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_PCIBusError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIBusError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_PCIBusError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_VALIDATION_BITS_ID 7 - - // - ULONGLONG PCI_BUS_ERROR_STATUS; - #define MSMCAEvent_PCIBusError_PCI_BUS_ERROR_STATUS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_ERROR_STATUS_ID 8 - - // - ULONGLONG PCI_BUS_ADDRESS; - #define MSMCAEvent_PCIBusError_PCI_BUS_ADDRESS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_ADDRESS_ID 9 - - // - ULONGLONG PCI_BUS_DATA; - #define MSMCAEvent_PCIBusError_PCI_BUS_DATA_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_DATA_ID 10 - - // - ULONGLONG PCI_BUS_CMD; - #define MSMCAEvent_PCIBusError_PCI_BUS_CMD_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_CMD_ID 11 - - // - ULONGLONG PCI_BUS_REQUESTOR_ID; - #define MSMCAEvent_PCIBusError_PCI_BUS_REQUESTOR_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_REQUESTOR_ID_ID 12 - - // - ULONGLONG PCI_BUS_RESPONDER_ID; - #define MSMCAEvent_PCIBusError_PCI_BUS_RESPONDER_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_RESPONDER_ID_ID 13 - - // - ULONGLONG PCI_BUS_TARGET_ID; - #define MSMCAEvent_PCIBusError_PCI_BUS_TARGET_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIBusError_PCI_BUS_TARGET_ID_ID 14 - - // - USHORT PCI_BUS_ERROR_TYPE; - #define MSMCAEvent_PCIBusError_PCI_BUS_ERROR_TYPE_SIZE sizeof(USHORT) - #define MSMCAEvent_PCIBusError_PCI_BUS_ERROR_TYPE_ID 15 - - // - UCHAR PCI_BUS_ID_BusNumber; - #define MSMCAEvent_PCIBusError_PCI_BUS_ID_BusNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIBusError_PCI_BUS_ID_BusNumber_ID 16 - - // - UCHAR PCI_BUS_ID_SegmentNumber; - #define MSMCAEvent_PCIBusError_PCI_BUS_ID_SegmentNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIBusError_PCI_BUS_ID_SegmentNumber_ID 17 - - // - ULONG Size; - #define MSMCAEvent_PCIBusError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIBusError_Size_ID 18 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_PCIBusError_RawRecord_ID 19 - -} MSMCAEvent_PCIBusError, *PMSMCAEvent_PCIBusError; - -// MSMCAEvent_PCIComponentError - MSMCAEvent_PCIComponentError -#define MSMCAEvent_PCIComponentErrorGuid \ - { 0x805caf4e,0x336c,0x4eb2, { 0x8c,0x0c,0x02,0xf3,0x51,0xcb,0xf1,0x3c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_PCIComponentError_GUID, \ - 0x805caf4e,0x336c,0x4eb2,0x8c,0x0c,0x02,0xf3,0x51,0xcb,0xf1,0x3c); -#endif - - -typedef struct _MSMCAEvent_PCIComponentError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_PCIComponentError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIComponentError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_PCIComponentError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_PCIComponentError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIComponentError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_PCIComponentError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIComponentError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_PCIComponentError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIComponentError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_PCIComponentError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIComponentError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_PCIComponentError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIComponentError_VALIDATION_BITS_ID 7 - - // - ULONGLONG PCI_COMP_ERROR_STATUS; - #define MSMCAEvent_PCIComponentError_PCI_COMP_ERROR_STATUS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PCIComponentError_PCI_COMP_ERROR_STATUS_ID 8 - - // - USHORT PCI_COMP_INFO_VendorId; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_VendorId_SIZE sizeof(USHORT) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_VendorId_ID 9 - - // - USHORT PCI_COMP_INFO_DeviceId; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_DeviceId_SIZE sizeof(USHORT) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_DeviceId_ID 10 - - // - UCHAR PCI_COMP_INFO_ClassCodeInterface; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeInterface_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeInterface_ID 11 - - // - UCHAR PCI_COMP_INFO_ClassCodeSubClass; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeSubClass_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeSubClass_ID 12 - - // - UCHAR PCI_COMP_INFO_ClassCodeBaseClass; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeBaseClass_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_ClassCodeBaseClass_ID 13 - - // - UCHAR PCI_COMP_INFO_FunctionNumber; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_FunctionNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_FunctionNumber_ID 14 - - // - UCHAR PCI_COMP_INFO_DeviceNumber; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_DeviceNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_DeviceNumber_ID 15 - - // - UCHAR PCI_COMP_INFO_BusNumber; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_BusNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_BusNumber_ID 16 - - // - UCHAR PCI_COMP_INFO_SegmentNumber; - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_SegmentNumber_SIZE sizeof(UCHAR) - #define MSMCAEvent_PCIComponentError_PCI_COMP_INFO_SegmentNumber_ID 17 - - // - ULONG Size; - #define MSMCAEvent_PCIComponentError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_PCIComponentError_Size_ID 18 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_PCIComponentError_RawRecord_ID 19 - -} MSMCAEvent_PCIComponentError, *PMSMCAEvent_PCIComponentError; - -// MSMCAEvent_SystemEventError - MSMCAEvent_SystemEventError -#define MSMCAEvent_SystemEventErrorGuid \ - { 0xbdba4b12,0x8d00,0x4570, { 0xb9,0xb2,0x3f,0xde,0xcf,0x1d,0x56,0x61 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_SystemEventError_GUID, \ - 0xbdba4b12,0x8d00,0x4570,0xb9,0xb2,0x3f,0xde,0xcf,0x1d,0x56,0x61); -#endif - - -typedef struct _MSMCAEvent_SystemEventError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_SystemEventError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_SystemEventError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_SystemEventError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_SystemEventError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_SystemEventError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_SystemEventError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_SystemEventError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_SystemEventError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_SystemEventError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_SystemEventError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_SystemEventError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_SystemEventError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_SystemEventError_VALIDATION_BITS_ID 7 - - // - ULONGLONG SEL_TIME_STAMP; - #define MSMCAEvent_SystemEventError_SEL_TIME_STAMP_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_SystemEventError_SEL_TIME_STAMP_ID 8 - - // - USHORT SEL_RECORD_ID; - #define MSMCAEvent_SystemEventError_SEL_RECORD_ID_SIZE sizeof(USHORT) - #define MSMCAEvent_SystemEventError_SEL_RECORD_ID_ID 9 - - // - USHORT SEL_GENERATOR_ID; - #define MSMCAEvent_SystemEventError_SEL_GENERATOR_ID_SIZE sizeof(USHORT) - #define MSMCAEvent_SystemEventError_SEL_GENERATOR_ID_ID 10 - - // - UCHAR SEL_RECORD_TYPE; - #define MSMCAEvent_SystemEventError_SEL_RECORD_TYPE_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_RECORD_TYPE_ID 11 - - // - UCHAR SEL_EVM_REV; - #define MSMCAEvent_SystemEventError_SEL_EVM_REV_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_EVM_REV_ID 12 - - // - UCHAR SEL_SENSOR_TYPE; - #define MSMCAEvent_SystemEventError_SEL_SENSOR_TYPE_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_SENSOR_TYPE_ID 13 - - // - UCHAR SEL_SENSOR_NUM; - #define MSMCAEvent_SystemEventError_SEL_SENSOR_NUM_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_SENSOR_NUM_ID 14 - - // - UCHAR SEL_EVENT_DIR_TYPE; - #define MSMCAEvent_SystemEventError_SEL_EVENT_DIR_TYPE_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_EVENT_DIR_TYPE_ID 15 - - // - UCHAR SEL_DATA1; - #define MSMCAEvent_SystemEventError_SEL_DATA1_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_DATA1_ID 16 - - // - UCHAR SEL_DATA2; - #define MSMCAEvent_SystemEventError_SEL_DATA2_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_DATA2_ID 17 - - // - UCHAR SEL_DATA3; - #define MSMCAEvent_SystemEventError_SEL_DATA3_SIZE sizeof(UCHAR) - #define MSMCAEvent_SystemEventError_SEL_DATA3_ID 18 - - // - ULONG Size; - #define MSMCAEvent_SystemEventError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_SystemEventError_Size_ID 19 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_SystemEventError_RawRecord_ID 20 - -} MSMCAEvent_SystemEventError, *PMSMCAEvent_SystemEventError; - -// MSMCAEvent_SMBIOSError - MSMCAEvent_SMBIOSError -#define MSMCAEvent_SMBIOSErrorGuid \ - { 0x4184df1b,0xedfe,0x406b, { 0xb1,0x72,0x54,0xc9,0x1f,0xbd,0x9b,0xaf } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_SMBIOSError_GUID, \ - 0x4184df1b,0xedfe,0x406b,0xb1,0x72,0x54,0xc9,0x1f,0xbd,0x9b,0xaf); -#endif - - -typedef struct _MSMCAEvent_SMBIOSError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_SMBIOSError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_SMBIOSError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_SMBIOSError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_SMBIOSError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_SMBIOSError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_SMBIOSError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_SMBIOSError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_SMBIOSError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_SMBIOSError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_SMBIOSError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_SMBIOSError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_SMBIOSError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_SMBIOSError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_SMBIOSError_VALIDATION_BITS_ID 7 - - // - UCHAR SMBIOS_EVENT_TYPE; - #define MSMCAEvent_SMBIOSError_SMBIOS_EVENT_TYPE_SIZE sizeof(UCHAR) - #define MSMCAEvent_SMBIOSError_SMBIOS_EVENT_TYPE_ID 8 - - // - ULONG Size; - #define MSMCAEvent_SMBIOSError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_SMBIOSError_Size_ID 9 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_SMBIOSError_RawRecord_ID 10 - -} MSMCAEvent_SMBIOSError, *PMSMCAEvent_SMBIOSError; - -// MSMCAEvent_PlatformSpecificError - MSMCAEvent_PlatformSpecificError -#define MSMCAEvent_PlatformSpecificErrorGuid \ - { 0x2d2434aa,0xef83,0x4200, { 0xba,0x24,0xde,0x36,0x6c,0x41,0x5f,0x7b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_PlatformSpecificError_GUID, \ - 0x2d2434aa,0xef83,0x4200,0xba,0x24,0xde,0x36,0x6c,0x41,0x5f,0x7b); -#endif - - -typedef struct _MSMCAEvent_PlatformSpecificError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_PlatformSpecificError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_PlatformSpecificError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_PlatformSpecificError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_PlatformSpecificError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_PlatformSpecificError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_PlatformSpecificError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_PlatformSpecificError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_PlatformSpecificError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_PlatformSpecificError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_PlatformSpecificError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_PlatformSpecificError_LogToEventlog_ID 6 - - // - ULONGLONG VALIDATION_BITS; - #define MSMCAEvent_PlatformSpecificError_VALIDATION_BITS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_VALIDATION_BITS_ID 7 - - // - ULONGLONG PLATFORM_ERROR_STATUS; - #define MSMCAEvent_PlatformSpecificError_PLATFORM_ERROR_STATUS_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_PLATFORM_ERROR_STATUS_ID 8 - - // - ULONGLONG PLATFORM_REQUESTOR_ID; - #define MSMCAEvent_PlatformSpecificError_PLATFORM_REQUESTOR_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_PLATFORM_REQUESTOR_ID_ID 9 - - // - ULONGLONG PLATFORM_RESPONDER_ID; - #define MSMCAEvent_PlatformSpecificError_PLATFORM_RESPONDER_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_PLATFORM_RESPONDER_ID_ID 10 - - // - ULONGLONG PLATFORM_TARGET_ID; - #define MSMCAEvent_PlatformSpecificError_PLATFORM_TARGET_ID_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_PLATFORM_TARGET_ID_ID 11 - - // - ULONGLONG PLATFORM_BUS_SPECIFIC_DATA; - #define MSMCAEvent_PlatformSpecificError_PLATFORM_BUS_SPECIFIC_DATA_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_PlatformSpecificError_PLATFORM_BUS_SPECIFIC_DATA_ID 12 - - // - UCHAR OEM_COMPONENT_ID[16]; - #define MSMCAEvent_PlatformSpecificError_OEM_COMPONENT_ID_SIZE sizeof(UCHAR[16]) - #define MSMCAEvent_PlatformSpecificError_OEM_COMPONENT_ID_ID 13 - - // - ULONG Size; - #define MSMCAEvent_PlatformSpecificError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_PlatformSpecificError_Size_ID 14 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_PlatformSpecificError_RawRecord_ID 15 - -} MSMCAEvent_PlatformSpecificError, *PMSMCAEvent_PlatformSpecificError; - -// MSMCAEvent_InvalidError - MSMCAEvent_InvalidError -#define MSMCAEvent_InvalidErrorGuid \ - { 0x477b769b,0x785c,0x48dd, { 0xa0,0x2e,0x57,0xe0,0x51,0xbe,0x7b,0x85 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_InvalidError_GUID, \ - 0x477b769b,0x785c,0x48dd,0xa0,0x2e,0x57,0xe0,0x51,0xbe,0x7b,0x85); -#endif - - -typedef struct _MSMCAEvent_InvalidError -{ - // - ULONGLONG RecordId; - #define MSMCAEvent_InvalidError_RecordId_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_InvalidError_RecordId_ID 1 - - // - UCHAR ErrorSeverity; - #define MSMCAEvent_InvalidError_ErrorSeverity_SIZE sizeof(UCHAR) - #define MSMCAEvent_InvalidError_ErrorSeverity_ID 2 - - // - ULONG Type; - #define MSMCAEvent_InvalidError_Type_SIZE sizeof(ULONG) - #define MSMCAEvent_InvalidError_Type_ID 3 - - // - ULONG Cpu; - #define MSMCAEvent_InvalidError_Cpu_SIZE sizeof(ULONG) - #define MSMCAEvent_InvalidError_Cpu_ID 4 - - // - ULONG AdditionalErrors; - #define MSMCAEvent_InvalidError_AdditionalErrors_SIZE sizeof(ULONG) - #define MSMCAEvent_InvalidError_AdditionalErrors_ID 5 - - // - ULONG LogToEventlog; - #define MSMCAEvent_InvalidError_LogToEventlog_SIZE sizeof(ULONG) - #define MSMCAEvent_InvalidError_LogToEventlog_ID 6 - - // - ULONG Size; - #define MSMCAEvent_InvalidError_Size_SIZE sizeof(ULONG) - #define MSMCAEvent_InvalidError_Size_ID 7 - - // - UCHAR RawRecord[1]; - #define MSMCAEvent_InvalidError_RawRecord_ID 8 - -} MSMCAEvent_InvalidError, *PMSMCAEvent_InvalidError; - -// MSMCAEvent_MemoryPageRemoved - MSMCAEvent_MemoryPageRemoved -#define MSMCAEvent_MemoryPageRemovedGuid \ - { 0x84e9ddb6,0xe233,0x4dfc, { 0x98,0x8c,0x74,0x12,0xc8,0x75,0x4f,0xec } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAEvent_MemoryPageRemoved_GUID, \ - 0x84e9ddb6,0xe233,0x4dfc,0x98,0x8c,0x74,0x12,0xc8,0x75,0x4f,0xec); -#endif - - -typedef struct _MSMCAEvent_MemoryPageRemoved -{ - // - ULONGLONG PhysicalAddress; - #define MSMCAEvent_MemoryPageRemoved_PhysicalAddress_SIZE sizeof(ULONGLONG) - #define MSMCAEvent_MemoryPageRemoved_PhysicalAddress_ID 1 - -} MSMCAEvent_MemoryPageRemoved, *PMSMCAEvent_MemoryPageRemoved; - -#define MSMCAEvent_MemoryPageRemoved_SIZE (FIELD_OFFSET(MSMCAEvent_MemoryPageRemoved, PhysicalAddress) + MSMCAEvent_MemoryPageRemoved_PhysicalAddress_SIZE) - -// MSMCAInfo_Entry - MSMCAInfo_Entry -#define MSMCAInfo_EntryGuid \ - { 0x9e77a308,0x6b82,0x4fc1, { 0xab,0x41,0x0a,0x55,0x86,0x7c,0x35,0xc2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAInfo_Entry_GUID, \ - 0x9e77a308,0x6b82,0x4fc1,0xab,0x41,0x0a,0x55,0x86,0x7c,0x35,0xc2); -#endif - - -typedef struct _MSMCAInfo_Entry -{ - // - ULONG Length; - #define MSMCAInfo_Entry_Length_SIZE sizeof(ULONG) - #define MSMCAInfo_Entry_Length_ID 1 - - // - UCHAR Data[1]; - #define MSMCAInfo_Entry_Data_ID 2 - -} MSMCAInfo_Entry, *PMSMCAInfo_Entry; - -// MSMCAInfo_RawMCAData - MSMCAInfo_RawMCAData -#define MSMCAInfo_RawMCADataGuid \ - { 0x23602a8a,0xdadd,0x462f, { 0x9a,0xe5,0x30,0xfa,0x2c,0x37,0xdd,0x5b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAInfo_RawMCAData_GUID, \ - 0x23602a8a,0xdadd,0x462f,0x9a,0xe5,0x30,0xfa,0x2c,0x37,0xdd,0x5b); -#endif - - -typedef struct _MSMCAInfo_RawMCAData -{ - // - ULONG Count; - #define MSMCAInfo_RawMCAData_Count_SIZE sizeof(ULONG) - #define MSMCAInfo_RawMCAData_Count_ID 1 - - // - MSMCAInfo_Entry Records[1]; - #define MSMCAInfo_RawMCAData_Records_ID 2 - -} MSMCAInfo_RawMCAData, *PMSMCAInfo_RawMCAData; - -// MSMCAInfo_RawCMCEvent - MSMCAInfo_RawCMCEvent -#define MSMCAInfo_RawCMCEventGuid \ - { 0x2f1a8a9d,0x7988,0x457f, { 0xa1,0x7a,0x89,0x79,0xe8,0x20,0x43,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAInfo_RawCMCEvent_GUID, \ - 0x2f1a8a9d,0x7988,0x457f,0xa1,0x7a,0x89,0x79,0xe8,0x20,0x43,0xc5); -#endif - - -typedef struct _MSMCAInfo_RawCMCEvent -{ - // - ULONG Count; - #define MSMCAInfo_RawCMCEvent_Count_SIZE sizeof(ULONG) - #define MSMCAInfo_RawCMCEvent_Count_ID 1 - - // - MSMCAInfo_Entry Records[1]; - #define MSMCAInfo_RawCMCEvent_Records_ID 2 - -} MSMCAInfo_RawCMCEvent, *PMSMCAInfo_RawCMCEvent; - -// MSMCAInfo_RawMCAEvent - MSMCAInfo_RawMCAEvent -#define MSMCAInfo_RawMCAEventGuid \ - { 0x2f1a8a9f,0x7988,0x457f, { 0xa1,0x7a,0x89,0x79,0xe8,0x20,0x43,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAInfo_RawMCAEvent_GUID, \ - 0x2f1a8a9f,0x7988,0x457f,0xa1,0x7a,0x89,0x79,0xe8,0x20,0x43,0xc5); -#endif - - -typedef struct _MSMCAInfo_RawMCAEvent -{ - // - ULONG Count; - #define MSMCAInfo_RawMCAEvent_Count_SIZE sizeof(ULONG) - #define MSMCAInfo_RawMCAEvent_Count_ID 1 - - // - MSMCAInfo_Entry Records[1]; - #define MSMCAInfo_RawMCAEvent_Records_ID 2 - -} MSMCAInfo_RawMCAEvent, *PMSMCAInfo_RawMCAEvent; - -// MSMCAInfo_RawCorrectedPlatformEvent - MSMCAInfo_RawCorrectedPlatformEvent -#define MSMCAInfo_RawCorrectedPlatformEventGuid \ - { 0x6b629d5e,0xe63c,0x48a3, { 0x9e,0xbb,0x97,0x42,0x27,0x07,0x52,0x65 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMCAInfo_RawCorrectedPlatformEvent_GUID, \ - 0x6b629d5e,0xe63c,0x48a3,0x9e,0xbb,0x97,0x42,0x27,0x07,0x52,0x65); -#endif - - -typedef struct _MSMCAInfo_RawCorrectedPlatformEvent -{ - // - ULONG Count; - #define MSMCAInfo_RawCorrectedPlatformEvent_Count_SIZE sizeof(ULONG) - #define MSMCAInfo_RawCorrectedPlatformEvent_Count_ID 1 - - // - MSMCAInfo_Entry Records[1]; - #define MSMCAInfo_RawCorrectedPlatformEvent_Records_ID 2 - -} MSMCAInfo_RawCorrectedPlatformEvent, *PMSMCAInfo_RawCorrectedPlatformEvent; - -// MSPower_DeviceEnable - MSPower_DeviceEnable -#define MSPower_DeviceEnableGuid \ - { 0x827c0a6f,0xfeb0,0x11d0, { 0xbd,0x26,0x00,0xaa,0x00,0xb7,0xb3,0x2a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSPower_DeviceEnable_GUID, \ - 0x827c0a6f,0xfeb0,0x11d0,0xbd,0x26,0x00,0xaa,0x00,0xb7,0xb3,0x2a); -#endif - - -typedef struct _MSPower_DeviceEnable -{ - // - BOOLEAN Enable; - #define MSPower_DeviceEnable_Enable_SIZE sizeof(BOOLEAN) - #define MSPower_DeviceEnable_Enable_ID 1 - -} MSPower_DeviceEnable, *PMSPower_DeviceEnable; - -#define MSPower_DeviceEnable_SIZE (FIELD_OFFSET(MSPower_DeviceEnable, Enable) + MSPower_DeviceEnable_Enable_SIZE) - -// MSPower_DeviceWakeEnable - MSPower_DeviceWakeEnable -#define MSPower_DeviceWakeEnableGuid \ - { 0xa9546a82,0xfeb0,0x11d0, { 0xbd,0x26,0x00,0xaa,0x00,0xb7,0xb3,0x2a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSPower_DeviceWakeEnable_GUID, \ - 0xa9546a82,0xfeb0,0x11d0,0xbd,0x26,0x00,0xaa,0x00,0xb7,0xb3,0x2a); -#endif - - -typedef struct _MSPower_DeviceWakeEnable -{ - // - BOOLEAN Enable; - #define MSPower_DeviceWakeEnable_Enable_SIZE sizeof(BOOLEAN) - #define MSPower_DeviceWakeEnable_Enable_ID 1 - -} MSPower_DeviceWakeEnable, *PMSPower_DeviceWakeEnable; - -#define MSPower_DeviceWakeEnable_SIZE (FIELD_OFFSET(MSPower_DeviceWakeEnable, Enable) + MSPower_DeviceWakeEnable_Enable_SIZE) - -// MSNdis_NetworkAddress - MSNdis_NetworkAddress -#define MSNdis_NetworkAddressGuid \ - { 0xb5bd98b7,0x0201,0x11d1, { 0xa5,0x0e,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NetworkAddress_GUID, \ - 0xb5bd98b7,0x0201,0x11d1,0xa5,0x0e,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSNdis_NetworkAddress -{ - // - UCHAR Address[6]; - #define MSNdis_NetworkAddress_Address_SIZE sizeof(UCHAR[6]) - #define MSNdis_NetworkAddress_Address_ID 1 - -} MSNdis_NetworkAddress, *PMSNdis_NetworkAddress; - -#define MSNdis_NetworkAddress_SIZE (FIELD_OFFSET(MSNdis_NetworkAddress, Address) + MSNdis_NetworkAddress_Address_SIZE) - -// MSNdis_NetworkShortAddress - MSNdis_NetworkShortAddress -#define MSNdis_NetworkShortAddressGuid \ - { 0xb5bd98b8,0x0201,0x11d1, { 0xa5,0x0e,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NetworkShortAddress_GUID, \ - 0xb5bd98b8,0x0201,0x11d1,0xa5,0x0e,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSNdis_NetworkShortAddress -{ - // - UCHAR Address[2]; - #define MSNdis_NetworkShortAddress_Address_SIZE sizeof(UCHAR[2]) - #define MSNdis_NetworkShortAddress_Address_ID 1 - -} MSNdis_NetworkShortAddress, *PMSNdis_NetworkShortAddress; - -#define MSNdis_NetworkShortAddress_SIZE (FIELD_OFFSET(MSNdis_NetworkShortAddress, Address) + MSNdis_NetworkShortAddress_Address_SIZE) - -// MSNdis_NetworkLinkSpeed - MSNdis_NetworkLinkSpeed -#define MSNdis_NetworkLinkSpeedGuid \ - { 0x60fc6b57,0x0f66,0x11d1, { 0x96,0xa7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NetworkLinkSpeed_GUID, \ - 0x60fc6b57,0x0f66,0x11d1,0x96,0xa7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_NetworkLinkSpeed -{ - // - ULONG Outbound; - #define MSNdis_NetworkLinkSpeed_Outbound_SIZE sizeof(ULONG) - #define MSNdis_NetworkLinkSpeed_Outbound_ID 1 - - // - ULONG Inbound; - #define MSNdis_NetworkLinkSpeed_Inbound_SIZE sizeof(ULONG) - #define MSNdis_NetworkLinkSpeed_Inbound_ID 2 - -} MSNdis_NetworkLinkSpeed, *PMSNdis_NetworkLinkSpeed; - -#define MSNdis_NetworkLinkSpeed_SIZE (FIELD_OFFSET(MSNdis_NetworkLinkSpeed, Inbound) + MSNdis_NetworkLinkSpeed_Inbound_SIZE) - -// MSNdis_EnumerateAdapter - MSNdis_EnumerateAdapter -#define MSNdis_EnumerateAdapterGuid \ - { 0x981f2d7f,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EnumerateAdapter_GUID, \ - 0x981f2d7f,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EnumerateAdapter -{ - // - CHAR VariableData[1]; - #define MSNdis_EnumerateAdapter_DeviceName_ID 1 - -} MSNdis_EnumerateAdapter, *PMSNdis_EnumerateAdapter; - -// MSNdis_NotifyAdapterRemoval - MSNdis_NotifyAdapterRemoval -#define MSNdis_NotifyAdapterRemovalGuid \ - { 0x981f2d80,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyAdapterRemoval_GUID, \ - 0x981f2d80,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_NotifyAdapterRemoval -{ - // - CHAR VariableData[1]; - #define MSNdis_NotifyAdapterRemoval_DeviceName_ID 1 - -} MSNdis_NotifyAdapterRemoval, *PMSNdis_NotifyAdapterRemoval; - -// MSNdis_NotifyAdapterArrival - MSNdis_NotifyAdapterArrival -#define MSNdis_NotifyAdapterArrivalGuid \ - { 0x981f2d81,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyAdapterArrival_GUID, \ - 0x981f2d81,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_NotifyAdapterArrival -{ - // - CHAR VariableData[1]; - #define MSNdis_NotifyAdapterArrival_DeviceName_ID 1 - -} MSNdis_NotifyAdapterArrival, *PMSNdis_NotifyAdapterArrival; - -// MSNdis_NdisEnumerateVc - MSNdis_NdisEnumerateVc -#define MSNdis_NdisEnumerateVcGuid \ - { 0x981f2d82,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NdisEnumerateVc_GUID, \ - 0x981f2d82,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_NotifyVcRemoval - MSNdis_NotifyVcRemoval -#define MSNdis_NotifyVcRemovalGuid \ - { 0x981f2d79,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyVcRemoval_GUID, \ - 0x981f2d79,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_NotifyVcArrival - MSNdis_NotifyVcArrival -#define MSNdis_NotifyVcArrivalGuid \ - { 0x182f9e0c,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyVcArrival_GUID, \ - 0x182f9e0c,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_NotifyFilterRemoval - MSNdis_NotifyFilterRemoval -#define MSNdis_NotifyFilterRemovalGuid \ - { 0x1f177cd9,0x5955,0x4721, { 0x9f,0x6a,0x78,0xeb,0xdf,0xae,0xf8,0x89 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyFilterRemoval_GUID, \ - 0x1f177cd9,0x5955,0x4721,0x9f,0x6a,0x78,0xeb,0xdf,0xae,0xf8,0x89); -#endif - - -// MSNdis_NotifyFilterArrival - MSNdis_NotifyFilterArrival -#define MSNdis_NotifyFilterArrivalGuid \ - { 0x0b6d3c89,0x5917,0x43ca, { 0xb5,0x78,0xd0,0x1a,0x79,0x67,0xc4,0x1c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NotifyFilterArrival_GUID, \ - 0x0b6d3c89,0x5917,0x43ca,0xb5,0x78,0xd0,0x1a,0x79,0x67,0xc4,0x1c); -#endif - - -// MSNdis_DeviceWakeOnMagicPacketOnly - MSNdis_DeviceWakeOnMagicPacketOnly -#define MSNdis_DeviceWakeOnMagicPacketOnlyGuid \ - { 0xa14f1c97,0x8839,0x4f8a, { 0x99,0x96,0xa2,0x89,0x96,0xeb,0xbf,0x1d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_DeviceWakeOnMagicPacketOnly_GUID, \ - 0xa14f1c97,0x8839,0x4f8a,0x99,0x96,0xa2,0x89,0x96,0xeb,0xbf,0x1d); -#endif - - -typedef struct _MSNdis_DeviceWakeOnMagicPacketOnly -{ - // - BOOLEAN EnableWakeOnMagicPacketOnly; - #define MSNdis_DeviceWakeOnMagicPacketOnly_EnableWakeOnMagicPacketOnly_SIZE sizeof(BOOLEAN) - #define MSNdis_DeviceWakeOnMagicPacketOnly_EnableWakeOnMagicPacketOnly_ID 1 - -} MSNdis_DeviceWakeOnMagicPacketOnly, *PMSNdis_DeviceWakeOnMagicPacketOnly; - -#define MSNdis_DeviceWakeOnMagicPacketOnly_SIZE (FIELD_OFFSET(MSNdis_DeviceWakeOnMagicPacketOnly, EnableWakeOnMagicPacketOnly) + MSNdis_DeviceWakeOnMagicPacketOnly_EnableWakeOnMagicPacketOnly_SIZE) - -// MSNdis_RSSEnabled - MSNdis_RSSEnabled -#define MSNdis_RSSEnabledGuid \ - { 0x9565cd55,0x3402,0x4e32, { 0xa5,0xb6,0x2f,0x14,0x3f,0x2f,0x2c,0x30 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_RSSEnabled_GUID, \ - 0x9565cd55,0x3402,0x4e32,0xa5,0xb6,0x2f,0x14,0x3f,0x2f,0x2c,0x30); -#endif - - -typedef struct _MSNdis_RSSEnabled -{ - // - BOOLEAN RSSEnabled; - #define MSNdis_RSSEnabled_RSSEnabled_SIZE sizeof(BOOLEAN) - #define MSNdis_RSSEnabled_RSSEnabled_ID 1 - -} MSNdis_RSSEnabled, *PMSNdis_RSSEnabled; - -#define MSNdis_RSSEnabled_SIZE (FIELD_OFFSET(MSNdis_RSSEnabled, RSSEnabled) + MSNdis_RSSEnabled_RSSEnabled_SIZE) - -// MSNdis_HardwareStatus - MSNdis_HardwareStatus -#define MSNdis_HardwareStatusGuid \ - { 0x5ec10354,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_HardwareStatus_GUID, \ - 0x5ec10354,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_HardwareStatus -{ - // - ULONG NdisHardwareStatus; - #define MSNdis_HardwareStatus_NdisHardwareStatus_SIZE sizeof(ULONG) - #define MSNdis_HardwareStatus_NdisHardwareStatus_ID 1 - -} MSNdis_HardwareStatus, *PMSNdis_HardwareStatus; - -#define MSNdis_HardwareStatus_SIZE (FIELD_OFFSET(MSNdis_HardwareStatus, NdisHardwareStatus) + MSNdis_HardwareStatus_NdisHardwareStatus_SIZE) - -// MSNdis_MediaSupported - MSNdis_MediaSupported -#define MSNdis_MediaSupportedGuid \ - { 0x5ec10355,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MediaSupported_GUID, \ - 0x5ec10355,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MediaSupported -{ - // - ULONG NumberElements; - #define MSNdis_MediaSupported_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_MediaSupported_NumberElements_ID 1 - - // - ULONG NdisMediaSupported[1]; - #define MSNdis_MediaSupported_NdisMediaSupported_ID 2 - -} MSNdis_MediaSupported, *PMSNdis_MediaSupported; - -// MSNdis_MediaInUse - MSNdis_MediaInUse -#define MSNdis_MediaInUseGuid \ - { 0x5ec10356,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MediaInUse_GUID, \ - 0x5ec10356,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MediaInUse -{ - // - ULONG NumberElements; - #define MSNdis_MediaInUse_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_MediaInUse_NumberElements_ID 1 - - // - ULONG NdisMediaInUse[1]; - #define MSNdis_MediaInUse_NdisMediaInUse_ID 2 - -} MSNdis_MediaInUse, *PMSNdis_MediaInUse; - -// MSNdis_MaximumLookahead - MSNdis_MaximumLookahead -#define MSNdis_MaximumLookaheadGuid \ - { 0x5ec10357,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MaximumLookahead_GUID, \ - 0x5ec10357,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MaximumLookahead -{ - // - ULONG NdisMaximumLookahead; - #define MSNdis_MaximumLookahead_NdisMaximumLookahead_SIZE sizeof(ULONG) - #define MSNdis_MaximumLookahead_NdisMaximumLookahead_ID 1 - -} MSNdis_MaximumLookahead, *PMSNdis_MaximumLookahead; - -#define MSNdis_MaximumLookahead_SIZE (FIELD_OFFSET(MSNdis_MaximumLookahead, NdisMaximumLookahead) + MSNdis_MaximumLookahead_NdisMaximumLookahead_SIZE) - -// MSNdis_MaximumFrameSize - MSNdis_MaximumFrameSize -#define MSNdis_MaximumFrameSizeGuid \ - { 0x5ec10358,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MaximumFrameSize_GUID, \ - 0x5ec10358,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MaximumFrameSize -{ - // - ULONG NdisMaximumFrameSize; - #define MSNdis_MaximumFrameSize_NdisMaximumFrameSize_SIZE sizeof(ULONG) - #define MSNdis_MaximumFrameSize_NdisMaximumFrameSize_ID 1 - -} MSNdis_MaximumFrameSize, *PMSNdis_MaximumFrameSize; - -#define MSNdis_MaximumFrameSize_SIZE (FIELD_OFFSET(MSNdis_MaximumFrameSize, NdisMaximumFrameSize) + MSNdis_MaximumFrameSize_NdisMaximumFrameSize_SIZE) - -// MSNdis_LinkSpeed - MSNdis_LinkSpeed -#define MSNdis_LinkSpeedGuid \ - { 0x5ec10359,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_LinkSpeed_GUID, \ - 0x5ec10359,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_LinkSpeed -{ - // - ULONG NdisLinkSpeed; - #define MSNdis_LinkSpeed_NdisLinkSpeed_SIZE sizeof(ULONG) - #define MSNdis_LinkSpeed_NdisLinkSpeed_ID 1 - -} MSNdis_LinkSpeed, *PMSNdis_LinkSpeed; - -#define MSNdis_LinkSpeed_SIZE (FIELD_OFFSET(MSNdis_LinkSpeed, NdisLinkSpeed) + MSNdis_LinkSpeed_NdisLinkSpeed_SIZE) - -// MSNdis_TransmitBufferSpace - MSNdis_TransmitBufferSpace -#define MSNdis_TransmitBufferSpaceGuid \ - { 0x5ec1035a,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TransmitBufferSpace_GUID, \ - 0x5ec1035a,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TransmitBufferSpace -{ - // - ULONG NdisTransmitBufferSpace; - #define MSNdis_TransmitBufferSpace_NdisTransmitBufferSpace_SIZE sizeof(ULONG) - #define MSNdis_TransmitBufferSpace_NdisTransmitBufferSpace_ID 1 - -} MSNdis_TransmitBufferSpace, *PMSNdis_TransmitBufferSpace; - -#define MSNdis_TransmitBufferSpace_SIZE (FIELD_OFFSET(MSNdis_TransmitBufferSpace, NdisTransmitBufferSpace) + MSNdis_TransmitBufferSpace_NdisTransmitBufferSpace_SIZE) - -// MSNdis_ReceiveBufferSpace - MSNdis_ReceiveBufferSpace -#define MSNdis_ReceiveBufferSpaceGuid \ - { 0x5ec1035b,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveBufferSpace_GUID, \ - 0x5ec1035b,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_ReceiveBufferSpace -{ - // - ULONG NdisReceiveBufferSpace; - #define MSNdis_ReceiveBufferSpace_NdisReceiveBufferSpace_SIZE sizeof(ULONG) - #define MSNdis_ReceiveBufferSpace_NdisReceiveBufferSpace_ID 1 - -} MSNdis_ReceiveBufferSpace, *PMSNdis_ReceiveBufferSpace; - -#define MSNdis_ReceiveBufferSpace_SIZE (FIELD_OFFSET(MSNdis_ReceiveBufferSpace, NdisReceiveBufferSpace) + MSNdis_ReceiveBufferSpace_NdisReceiveBufferSpace_SIZE) - -// MSNdis_TransmitBlockSize - MSNdis_TransmitBlockSize -#define MSNdis_TransmitBlockSizeGuid \ - { 0x5ec1035c,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TransmitBlockSize_GUID, \ - 0x5ec1035c,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TransmitBlockSize -{ - // - ULONG NdisTransmitBlockSize; - #define MSNdis_TransmitBlockSize_NdisTransmitBlockSize_SIZE sizeof(ULONG) - #define MSNdis_TransmitBlockSize_NdisTransmitBlockSize_ID 1 - -} MSNdis_TransmitBlockSize, *PMSNdis_TransmitBlockSize; - -#define MSNdis_TransmitBlockSize_SIZE (FIELD_OFFSET(MSNdis_TransmitBlockSize, NdisTransmitBlockSize) + MSNdis_TransmitBlockSize_NdisTransmitBlockSize_SIZE) - -// MSNdis_ReceiveBlockSize - MSNdis_ReceiveBlockSize -#define MSNdis_ReceiveBlockSizeGuid \ - { 0x5ec1035d,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveBlockSize_GUID, \ - 0x5ec1035d,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_ReceiveBlockSize -{ - // - ULONG NdisReceiveBlockSize; - #define MSNdis_ReceiveBlockSize_NdisReceiveBlockSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveBlockSize_NdisReceiveBlockSize_ID 1 - -} MSNdis_ReceiveBlockSize, *PMSNdis_ReceiveBlockSize; - -#define MSNdis_ReceiveBlockSize_SIZE (FIELD_OFFSET(MSNdis_ReceiveBlockSize, NdisReceiveBlockSize) + MSNdis_ReceiveBlockSize_NdisReceiveBlockSize_SIZE) - -// MSNdis_VendorID - MSNdis_VendorID -#define MSNdis_VendorIDGuid \ - { 0x5ec1035e,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_VendorID_GUID, \ - 0x5ec1035e,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_VendorID -{ - // - ULONG NdisVendorID; - #define MSNdis_VendorID_NdisVendorID_SIZE sizeof(ULONG) - #define MSNdis_VendorID_NdisVendorID_ID 1 - -} MSNdis_VendorID, *PMSNdis_VendorID; - -#define MSNdis_VendorID_SIZE (FIELD_OFFSET(MSNdis_VendorID, NdisVendorID) + MSNdis_VendorID_NdisVendorID_SIZE) - -// MSNdis_VendorDescription - MSNdis_VendorDescription -#define MSNdis_VendorDescriptionGuid \ - { 0x5ec1035f,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_VendorDescription_GUID, \ - 0x5ec1035f,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_VendorDescription -{ - // - CHAR VariableData[1]; - #define MSNdis_VendorDescription_NdisVendorDescription_ID 1 - -} MSNdis_VendorDescription, *PMSNdis_VendorDescription; - -// MSNdis_CurrentPacketFilter - MSNdis_CurrentPacketFilter -#define MSNdis_CurrentPacketFilterGuid \ - { 0x5ec10360,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CurrentPacketFilter_GUID, \ - 0x5ec10360,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CurrentPacketFilter -{ - // - ULONG NdisCurrentPacketFilter; - #define MSNdis_CurrentPacketFilter_NdisCurrentPacketFilter_SIZE sizeof(ULONG) - #define MSNdis_CurrentPacketFilter_NdisCurrentPacketFilter_ID 1 - -} MSNdis_CurrentPacketFilter, *PMSNdis_CurrentPacketFilter; - -#define MSNdis_CurrentPacketFilter_SIZE (FIELD_OFFSET(MSNdis_CurrentPacketFilter, NdisCurrentPacketFilter) + MSNdis_CurrentPacketFilter_NdisCurrentPacketFilter_SIZE) - -// MSNdis_CurrentLookahead - MSNdis_CurrentLookahead -#define MSNdis_CurrentLookaheadGuid \ - { 0x5ec10361,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CurrentLookahead_GUID, \ - 0x5ec10361,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CurrentLookahead -{ - // - ULONG NdisCurrentLookahead; - #define MSNdis_CurrentLookahead_NdisCurrentLookahead_SIZE sizeof(ULONG) - #define MSNdis_CurrentLookahead_NdisCurrentLookahead_ID 1 - -} MSNdis_CurrentLookahead, *PMSNdis_CurrentLookahead; - -#define MSNdis_CurrentLookahead_SIZE (FIELD_OFFSET(MSNdis_CurrentLookahead, NdisCurrentLookahead) + MSNdis_CurrentLookahead_NdisCurrentLookahead_SIZE) - -// MSNdis_DriverVersion - MSNdis_DriverVersion -#define MSNdis_DriverVersionGuid \ - { 0x5ec10362,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_DriverVersion_GUID, \ - 0x5ec10362,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_DriverVersion -{ - // - USHORT NdisDriverVersion; - #define MSNdis_DriverVersion_NdisDriverVersion_SIZE sizeof(USHORT) - #define MSNdis_DriverVersion_NdisDriverVersion_ID 1 - -} MSNdis_DriverVersion, *PMSNdis_DriverVersion; - -#define MSNdis_DriverVersion_SIZE (FIELD_OFFSET(MSNdis_DriverVersion, NdisDriverVersion) + MSNdis_DriverVersion_NdisDriverVersion_SIZE) - -// MSNdis_MaximumTotalSize - MSNdis_MaximumTotalSize -#define MSNdis_MaximumTotalSizeGuid \ - { 0x5ec10363,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MaximumTotalSize_GUID, \ - 0x5ec10363,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MaximumTotalSize -{ - // - ULONG NdisMaximumTotalSize; - #define MSNdis_MaximumTotalSize_NdisMaximumTotalSize_SIZE sizeof(ULONG) - #define MSNdis_MaximumTotalSize_NdisMaximumTotalSize_ID 1 - -} MSNdis_MaximumTotalSize, *PMSNdis_MaximumTotalSize; - -#define MSNdis_MaximumTotalSize_SIZE (FIELD_OFFSET(MSNdis_MaximumTotalSize, NdisMaximumTotalSize) + MSNdis_MaximumTotalSize_NdisMaximumTotalSize_SIZE) - -// MSNdis_MacOptions - MSNdis_MacOptions -#define MSNdis_MacOptionsGuid \ - { 0x5ec10365,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MacOptions_GUID, \ - 0x5ec10365,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MacOptions -{ - // - ULONG NdisMacOptions; - #define MSNdis_MacOptions_NdisMacOptions_SIZE sizeof(ULONG) - #define MSNdis_MacOptions_NdisMacOptions_ID 1 - -} MSNdis_MacOptions, *PMSNdis_MacOptions; - -#define MSNdis_MacOptions_SIZE (FIELD_OFFSET(MSNdis_MacOptions, NdisMacOptions) + MSNdis_MacOptions_NdisMacOptions_SIZE) - -// MSNdis_MediaConnectStatus - MSNdis_MediaConnectStatus -#define MSNdis_MediaConnectStatusGuid \ - { 0x5ec10366,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MediaConnectStatus_GUID, \ - 0x5ec10366,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MediaConnectStatus -{ - // - ULONG NdisMediaConnectStatus; - #define MSNdis_MediaConnectStatus_NdisMediaConnectStatus_SIZE sizeof(ULONG) - #define MSNdis_MediaConnectStatus_NdisMediaConnectStatus_ID 1 - -} MSNdis_MediaConnectStatus, *PMSNdis_MediaConnectStatus; - -#define MSNdis_MediaConnectStatus_SIZE (FIELD_OFFSET(MSNdis_MediaConnectStatus, NdisMediaConnectStatus) + MSNdis_MediaConnectStatus_NdisMediaConnectStatus_SIZE) - -// MSNdis_MaximumSendPackets - MSNdis_MaximumSendPackets -#define MSNdis_MaximumSendPacketsGuid \ - { 0x5ec10367,0xa61a,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_MaximumSendPackets_GUID, \ - 0x5ec10367,0xa61a,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_MaximumSendPackets -{ - // - ULONG NdisMaximumSendPackets; - #define MSNdis_MaximumSendPackets_NdisMaximumSendPackets_SIZE sizeof(ULONG) - #define MSNdis_MaximumSendPackets_NdisMaximumSendPackets_ID 1 - -} MSNdis_MaximumSendPackets, *PMSNdis_MaximumSendPackets; - -#define MSNdis_MaximumSendPackets_SIZE (FIELD_OFFSET(MSNdis_MaximumSendPackets, NdisMaximumSendPackets) + MSNdis_MaximumSendPackets_NdisMaximumSendPackets_SIZE) - -// MSNdis_VendorDriverVersion - MSNdis_VendorDriverVersion -#define MSNdis_VendorDriverVersionGuid \ - { 0x447956f9,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_VendorDriverVersion_GUID, \ - 0x447956f9,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_VendorDriverVersion -{ - // - ULONG NdisVendorDriverVersion; - #define MSNdis_VendorDriverVersion_NdisVendorDriverVersion_SIZE sizeof(ULONG) - #define MSNdis_VendorDriverVersion_NdisVendorDriverVersion_ID 1 - -} MSNdis_VendorDriverVersion, *PMSNdis_VendorDriverVersion; - -#define MSNdis_VendorDriverVersion_SIZE (FIELD_OFFSET(MSNdis_VendorDriverVersion, NdisVendorDriverVersion) + MSNdis_VendorDriverVersion_NdisVendorDriverVersion_SIZE) - -// MSNdis_VlanIdentifier - MSNdis_VlanIdentifier -#define MSNdis_VlanIdentifierGuid \ - { 0x765dc702,0xc5e8,0x4b67, { 0x84,0x3b,0x3f,0x5a,0x4f,0xf2,0x64,0x8b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_VlanIdentifier_GUID, \ - 0x765dc702,0xc5e8,0x4b67,0x84,0x3b,0x3f,0x5a,0x4f,0xf2,0x64,0x8b); -#endif - - -typedef struct _MSNdis_VlanIdentifier -{ - // - ULONG NdisVlanId; - #define MSNdis_VlanIdentifier_NdisVlanId_SIZE sizeof(ULONG) - #define MSNdis_VlanIdentifier_NdisVlanId_ID 1 - -} MSNdis_VlanIdentifier, *PMSNdis_VlanIdentifier; - -#define MSNdis_VlanIdentifier_SIZE (FIELD_OFFSET(MSNdis_VlanIdentifier, NdisVlanId) + MSNdis_VlanIdentifier_NdisVlanId_SIZE) - -// MSNdis_PhysicalMediumType - MSNdis_PhysicalMediumType -#define MSNdis_PhysicalMediumTypeGuid \ - { 0x418ca16d,0x3937,0x4208, { 0x94,0x0a,0xec,0x61,0x96,0x27,0x80,0x85 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PhysicalMediumType_GUID, \ - 0x418ca16d,0x3937,0x4208,0x94,0x0a,0xec,0x61,0x96,0x27,0x80,0x85); -#endif - - -typedef struct _MSNdis_PhysicalMediumType -{ - // - ULONG NdisPhysicalMediumType; - #define MSNdis_PhysicalMediumType_NdisPhysicalMediumType_SIZE sizeof(ULONG) - #define MSNdis_PhysicalMediumType_NdisPhysicalMediumType_ID 1 - -} MSNdis_PhysicalMediumType, *PMSNdis_PhysicalMediumType; - -#define MSNdis_PhysicalMediumType_SIZE (FIELD_OFFSET(MSNdis_PhysicalMediumType, NdisPhysicalMediumType) + MSNdis_PhysicalMediumType_NdisPhysicalMediumType_SIZE) - -// MSNdis_TransmitsOk - MSNdis_TransmitsOk -#define MSNdis_TransmitsOkGuid \ - { 0x447956fa,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TransmitsOk_GUID, \ - 0x447956fa,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TransmitsOk -{ - // - ULONGLONG NdisTransmitsOk; - #define MSNdis_TransmitsOk_NdisTransmitsOk_SIZE sizeof(ULONGLONG) - #define MSNdis_TransmitsOk_NdisTransmitsOk_ID 1 - -} MSNdis_TransmitsOk, *PMSNdis_TransmitsOk; - -#define MSNdis_TransmitsOk_SIZE (FIELD_OFFSET(MSNdis_TransmitsOk, NdisTransmitsOk) + MSNdis_TransmitsOk_NdisTransmitsOk_SIZE) - -// MSNdis_ReceivesOk - MSNdis_ReceivesOk -#define MSNdis_ReceivesOkGuid \ - { 0x447956fb,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceivesOk_GUID, \ - 0x447956fb,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_ReceivesOk -{ - // - ULONGLONG NdisReceivesOk; - #define MSNdis_ReceivesOk_NdisReceivesOk_SIZE sizeof(ULONGLONG) - #define MSNdis_ReceivesOk_NdisReceivesOk_ID 1 - -} MSNdis_ReceivesOk, *PMSNdis_ReceivesOk; - -#define MSNdis_ReceivesOk_SIZE (FIELD_OFFSET(MSNdis_ReceivesOk, NdisReceivesOk) + MSNdis_ReceivesOk_NdisReceivesOk_SIZE) - -// MSNdis_TransmitsError - MSNdis_TransmitsError -#define MSNdis_TransmitsErrorGuid \ - { 0x447956fc,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TransmitsError_GUID, \ - 0x447956fc,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TransmitsError -{ - // - ULONG NdisTransmitsError; - #define MSNdis_TransmitsError_NdisTransmitsError_SIZE sizeof(ULONG) - #define MSNdis_TransmitsError_NdisTransmitsError_ID 1 - -} MSNdis_TransmitsError, *PMSNdis_TransmitsError; - -#define MSNdis_TransmitsError_SIZE (FIELD_OFFSET(MSNdis_TransmitsError, NdisTransmitsError) + MSNdis_TransmitsError_NdisTransmitsError_SIZE) - -// MSNdis_ReceiveError - MSNdis_ReceiveError -#define MSNdis_ReceiveErrorGuid \ - { 0x447956fd,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveError_GUID, \ - 0x447956fd,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_ReceiveError -{ - // - ULONG NdisReceiveError; - #define MSNdis_ReceiveError_NdisReceiveError_SIZE sizeof(ULONG) - #define MSNdis_ReceiveError_NdisReceiveError_ID 1 - -} MSNdis_ReceiveError, *PMSNdis_ReceiveError; - -#define MSNdis_ReceiveError_SIZE (FIELD_OFFSET(MSNdis_ReceiveError, NdisReceiveError) + MSNdis_ReceiveError_NdisReceiveError_SIZE) - -// MSNdis_ReceiveNoBuffer - MSNdis_ReceiveNoBuffer -#define MSNdis_ReceiveNoBufferGuid \ - { 0x447956fe,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveNoBuffer_GUID, \ - 0x447956fe,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_ReceiveNoBuffer -{ - // - ULONG NdisReceiveNoBuffer; - #define MSNdis_ReceiveNoBuffer_NdisReceiveNoBuffer_SIZE sizeof(ULONG) - #define MSNdis_ReceiveNoBuffer_NdisReceiveNoBuffer_ID 1 - -} MSNdis_ReceiveNoBuffer, *PMSNdis_ReceiveNoBuffer; - -#define MSNdis_ReceiveNoBuffer_SIZE (FIELD_OFFSET(MSNdis_ReceiveNoBuffer, NdisReceiveNoBuffer) + MSNdis_ReceiveNoBuffer_NdisReceiveNoBuffer_SIZE) - -// MSNdis_CoHardwareStatus - MSNdis_CoHardwareStatus -#define MSNdis_CoHardwareStatusGuid \ - { 0x791ad192,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoHardwareStatus_GUID, \ - 0x791ad192,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoHardwareStatus -{ - // - ULONG NdisCoHardwareStatus; - #define MSNdis_CoHardwareStatus_NdisCoHardwareStatus_SIZE sizeof(ULONG) - #define MSNdis_CoHardwareStatus_NdisCoHardwareStatus_ID 1 - -} MSNdis_CoHardwareStatus, *PMSNdis_CoHardwareStatus; - -#define MSNdis_CoHardwareStatus_SIZE (FIELD_OFFSET(MSNdis_CoHardwareStatus, NdisCoHardwareStatus) + MSNdis_CoHardwareStatus_NdisCoHardwareStatus_SIZE) - -// MSNdis_CoMediaSupported - MSNdis_CoMediaSupported -#define MSNdis_CoMediaSupportedGuid \ - { 0x791ad193,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoMediaSupported_GUID, \ - 0x791ad193,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoMediaSupported -{ - // - ULONG NumberElements; - #define MSNdis_CoMediaSupported_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_CoMediaSupported_NumberElements_ID 1 - - // - ULONG NdisCoMediaSupported[1]; - #define MSNdis_CoMediaSupported_NdisCoMediaSupported_ID 2 - -} MSNdis_CoMediaSupported, *PMSNdis_CoMediaSupported; - -// MSNdis_CoMediaInUse - MSNdis_CoMediaInUse -#define MSNdis_CoMediaInUseGuid \ - { 0x791ad194,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoMediaInUse_GUID, \ - 0x791ad194,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoMediaInUse -{ - // - ULONG NumberElements; - #define MSNdis_CoMediaInUse_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_CoMediaInUse_NumberElements_ID 1 - - // - ULONG NdisCoMediaInUse[1]; - #define MSNdis_CoMediaInUse_NdisCoMediaInUse_ID 2 - -} MSNdis_CoMediaInUse, *PMSNdis_CoMediaInUse; - -// MSNdis_CoLinkSpeed - MSNdis_CoLinkSpeed -#define MSNdis_CoLinkSpeedGuid \ - { 0x791ad195,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoLinkSpeed_GUID, \ - 0x791ad195,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoLinkSpeed -{ - // - MSNdis_NetworkLinkSpeed NdisCoLinkSpeed; - #define MSNdis_CoLinkSpeed_NdisCoLinkSpeed_SIZE sizeof(MSNdis_NetworkLinkSpeed) - #define MSNdis_CoLinkSpeed_NdisCoLinkSpeed_ID 1 - -} MSNdis_CoLinkSpeed, *PMSNdis_CoLinkSpeed; - -#define MSNdis_CoLinkSpeed_SIZE (FIELD_OFFSET(MSNdis_CoLinkSpeed, NdisCoLinkSpeed) + MSNdis_CoLinkSpeed_NdisCoLinkSpeed_SIZE) - -// MSNdis_CoVendorId - MSNdis_CoVendorId -#define MSNdis_CoVendorIdGuid \ - { 0x791ad196,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoVendorId_GUID, \ - 0x791ad196,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoVendorId -{ - // - ULONG NdisCoVendorID; - #define MSNdis_CoVendorId_NdisCoVendorID_SIZE sizeof(ULONG) - #define MSNdis_CoVendorId_NdisCoVendorID_ID 1 - -} MSNdis_CoVendorId, *PMSNdis_CoVendorId; - -#define MSNdis_CoVendorId_SIZE (FIELD_OFFSET(MSNdis_CoVendorId, NdisCoVendorID) + MSNdis_CoVendorId_NdisCoVendorID_SIZE) - -// MSNdis_CoVendorDescription - MSNdis_CoVendorDescription -#define MSNdis_CoVendorDescriptionGuid \ - { 0x791ad197,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoVendorDescription_GUID, \ - 0x791ad197,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoVendorDescription -{ - // - CHAR VariableData[1]; - #define MSNdis_CoVendorDescription_NdisCoVendorDescription_ID 1 - -} MSNdis_CoVendorDescription, *PMSNdis_CoVendorDescription; - -// MSNdis_CoDriverVersion - MSNdis_CoDriverVersion -#define MSNdis_CoDriverVersionGuid \ - { 0x791ad198,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoDriverVersion_GUID, \ - 0x791ad198,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoDriverVersion -{ - // - USHORT NdisCoDriverVersion; - #define MSNdis_CoDriverVersion_NdisCoDriverVersion_SIZE sizeof(USHORT) - #define MSNdis_CoDriverVersion_NdisCoDriverVersion_ID 1 - -} MSNdis_CoDriverVersion, *PMSNdis_CoDriverVersion; - -#define MSNdis_CoDriverVersion_SIZE (FIELD_OFFSET(MSNdis_CoDriverVersion, NdisCoDriverVersion) + MSNdis_CoDriverVersion_NdisCoDriverVersion_SIZE) - -// MSNdis_CoMacOptions - MSNdis_CoMacOptions -#define MSNdis_CoMacOptionsGuid \ - { 0x791ad19a,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoMacOptions_GUID, \ - 0x791ad19a,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoMacOptions -{ - // - ULONG NdisCoMacOptions; - #define MSNdis_CoMacOptions_NdisCoMacOptions_SIZE sizeof(ULONG) - #define MSNdis_CoMacOptions_NdisCoMacOptions_ID 1 - -} MSNdis_CoMacOptions, *PMSNdis_CoMacOptions; - -#define MSNdis_CoMacOptions_SIZE (FIELD_OFFSET(MSNdis_CoMacOptions, NdisCoMacOptions) + MSNdis_CoMacOptions_NdisCoMacOptions_SIZE) - -// MSNdis_CoMediaConnectStatus - MSNdis_CoMediaConnectStatus -#define MSNdis_CoMediaConnectStatusGuid \ - { 0x791ad19b,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoMediaConnectStatus_GUID, \ - 0x791ad19b,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoMediaConnectStatus -{ - // - ULONG NdisCoMediaConnectStatus; - #define MSNdis_CoMediaConnectStatus_NdisCoMediaConnectStatus_SIZE sizeof(ULONG) - #define MSNdis_CoMediaConnectStatus_NdisCoMediaConnectStatus_ID 1 - -} MSNdis_CoMediaConnectStatus, *PMSNdis_CoMediaConnectStatus; - -#define MSNdis_CoMediaConnectStatus_SIZE (FIELD_OFFSET(MSNdis_CoMediaConnectStatus, NdisCoMediaConnectStatus) + MSNdis_CoMediaConnectStatus_NdisCoMediaConnectStatus_SIZE) - -// MSNdis_CoVendorDriverVersion - MSNdis_CoVendorDriverVersion -#define MSNdis_CoVendorDriverVersionGuid \ - { 0x791ad19c,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoVendorDriverVersion_GUID, \ - 0x791ad19c,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoVendorDriverVersion -{ - // - ULONG NdisCoVendorDriverVersion; - #define MSNdis_CoVendorDriverVersion_NdisCoVendorDriverVersion_SIZE sizeof(ULONG) - #define MSNdis_CoVendorDriverVersion_NdisCoVendorDriverVersion_ID 1 - -} MSNdis_CoVendorDriverVersion, *PMSNdis_CoVendorDriverVersion; - -#define MSNdis_CoVendorDriverVersion_SIZE (FIELD_OFFSET(MSNdis_CoVendorDriverVersion, NdisCoVendorDriverVersion) + MSNdis_CoVendorDriverVersion_NdisCoVendorDriverVersion_SIZE) - -// MSNdis_CoMinimumLinkSpeed - MSNdis_CoMinimumLinkSpeed -#define MSNdis_CoMinimumLinkSpeedGuid \ - { 0x791ad19d,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoMinimumLinkSpeed_GUID, \ - 0x791ad19d,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoMinimumLinkSpeed -{ - // - MSNdis_NetworkLinkSpeed NdisCoMinimumLinkSpeed; - #define MSNdis_CoMinimumLinkSpeed_NdisCoMinimumLinkSpeed_SIZE sizeof(MSNdis_NetworkLinkSpeed) - #define MSNdis_CoMinimumLinkSpeed_NdisCoMinimumLinkSpeed_ID 1 - -} MSNdis_CoMinimumLinkSpeed, *PMSNdis_CoMinimumLinkSpeed; - -#define MSNdis_CoMinimumLinkSpeed_SIZE (FIELD_OFFSET(MSNdis_CoMinimumLinkSpeed, NdisCoMinimumLinkSpeed) + MSNdis_CoMinimumLinkSpeed_NdisCoMinimumLinkSpeed_SIZE) - -// MSNdis_CoTransmitPdusOk - MSNdis_CoTransmitPdusOk -#define MSNdis_CoTransmitPdusOkGuid \ - { 0x0a214805,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoTransmitPdusOk_GUID, \ - 0x0a214805,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoTransmitPdusOk -{ - // - ULONGLONG NdisCoTransmitPdusOk; - #define MSNdis_CoTransmitPdusOk_NdisCoTransmitPdusOk_SIZE sizeof(ULONGLONG) - #define MSNdis_CoTransmitPdusOk_NdisCoTransmitPdusOk_ID 1 - -} MSNdis_CoTransmitPdusOk, *PMSNdis_CoTransmitPdusOk; - -#define MSNdis_CoTransmitPdusOk_SIZE (FIELD_OFFSET(MSNdis_CoTransmitPdusOk, NdisCoTransmitPdusOk) + MSNdis_CoTransmitPdusOk_NdisCoTransmitPdusOk_SIZE) - -// MSNdis_CoReceivePdusOk - MSNdis_CoReceivePdusOk -#define MSNdis_CoReceivePdusOkGuid \ - { 0x0a214806,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoReceivePdusOk_GUID, \ - 0x0a214806,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoReceivePdusOk -{ - // - ULONGLONG NdisCoReceivePdusOk; - #define MSNdis_CoReceivePdusOk_NdisCoReceivePdusOk_SIZE sizeof(ULONGLONG) - #define MSNdis_CoReceivePdusOk_NdisCoReceivePdusOk_ID 1 - -} MSNdis_CoReceivePdusOk, *PMSNdis_CoReceivePdusOk; - -#define MSNdis_CoReceivePdusOk_SIZE (FIELD_OFFSET(MSNdis_CoReceivePdusOk, NdisCoReceivePdusOk) + MSNdis_CoReceivePdusOk_NdisCoReceivePdusOk_SIZE) - -// MSNdis_CoTransmitPduErrors - MSNdis_CoTransmitPduErrors -#define MSNdis_CoTransmitPduErrorsGuid \ - { 0x0a214807,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoTransmitPduErrors_GUID, \ - 0x0a214807,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoTransmitPduErrors -{ - // - ULONG NdisCoTransmitPduErrors; - #define MSNdis_CoTransmitPduErrors_NdisCoTransmitPduErrors_SIZE sizeof(ULONG) - #define MSNdis_CoTransmitPduErrors_NdisCoTransmitPduErrors_ID 1 - -} MSNdis_CoTransmitPduErrors, *PMSNdis_CoTransmitPduErrors; - -#define MSNdis_CoTransmitPduErrors_SIZE (FIELD_OFFSET(MSNdis_CoTransmitPduErrors, NdisCoTransmitPduErrors) + MSNdis_CoTransmitPduErrors_NdisCoTransmitPduErrors_SIZE) - -// MSNdis_CoReceivePduErrors - MSNdis_CoReceivePduErrors -#define MSNdis_CoReceivePduErrorsGuid \ - { 0x0a214808,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoReceivePduErrors_GUID, \ - 0x0a214808,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoReceivePduErrors -{ - // - ULONG NdisCoReceivePduErrors; - #define MSNdis_CoReceivePduErrors_NdisCoReceivePduErrors_SIZE sizeof(ULONG) - #define MSNdis_CoReceivePduErrors_NdisCoReceivePduErrors_ID 1 - -} MSNdis_CoReceivePduErrors, *PMSNdis_CoReceivePduErrors; - -#define MSNdis_CoReceivePduErrors_SIZE (FIELD_OFFSET(MSNdis_CoReceivePduErrors, NdisCoReceivePduErrors) + MSNdis_CoReceivePduErrors_NdisCoReceivePduErrors_SIZE) - -// MSNdis_CoReceivePdusNoBuffer - MSNdis_CoReceivePdusNoBuffer -#define MSNdis_CoReceivePdusNoBufferGuid \ - { 0x0a214809,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CoReceivePdusNoBuffer_GUID, \ - 0x0a214809,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_CoReceivePdusNoBuffer -{ - // - ULONG NdisCoReceivePdusNoBuffer; - #define MSNdis_CoReceivePdusNoBuffer_NdisCoReceivePdusNoBuffer_SIZE sizeof(ULONG) - #define MSNdis_CoReceivePdusNoBuffer_NdisCoReceivePdusNoBuffer_ID 1 - -} MSNdis_CoReceivePdusNoBuffer, *PMSNdis_CoReceivePdusNoBuffer; - -#define MSNdis_CoReceivePdusNoBuffer_SIZE (FIELD_OFFSET(MSNdis_CoReceivePdusNoBuffer, NdisCoReceivePdusNoBuffer) + MSNdis_CoReceivePdusNoBuffer_NdisCoReceivePdusNoBuffer_SIZE) - -// MSNdis_AtmSupportedVcRates - MSNdis_AtmSupportedVcRates -#define MSNdis_AtmSupportedVcRatesGuid \ - { 0x791ad19e,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmSupportedVcRates_GUID, \ - 0x791ad19e,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmSupportedVcRates -{ - // - ULONG MinCellRate; - #define MSNdis_AtmSupportedVcRates_MinCellRate_SIZE sizeof(ULONG) - #define MSNdis_AtmSupportedVcRates_MinCellRate_ID 1 - - // - ULONG MaxCellRate; - #define MSNdis_AtmSupportedVcRates_MaxCellRate_SIZE sizeof(ULONG) - #define MSNdis_AtmSupportedVcRates_MaxCellRate_ID 2 - -} MSNdis_AtmSupportedVcRates, *PMSNdis_AtmSupportedVcRates; - -#define MSNdis_AtmSupportedVcRates_SIZE (FIELD_OFFSET(MSNdis_AtmSupportedVcRates, MaxCellRate) + MSNdis_AtmSupportedVcRates_MaxCellRate_SIZE) - -// MSNdis_AtmSupportedServiceCategory - MSNdis_AtmSupportedServiceCategory -#define MSNdis_AtmSupportedServiceCategoryGuid \ - { 0x791ad19f,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmSupportedServiceCategory_GUID, \ - 0x791ad19f,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmSupportedServiceCategory -{ - // - ULONG NdisAtmSupportedServiceCategory; - #define MSNdis_AtmSupportedServiceCategory_NdisAtmSupportedServiceCategory_SIZE sizeof(ULONG) - #define MSNdis_AtmSupportedServiceCategory_NdisAtmSupportedServiceCategory_ID 1 - -} MSNdis_AtmSupportedServiceCategory, *PMSNdis_AtmSupportedServiceCategory; - -#define MSNdis_AtmSupportedServiceCategory_SIZE (FIELD_OFFSET(MSNdis_AtmSupportedServiceCategory, NdisAtmSupportedServiceCategory) + MSNdis_AtmSupportedServiceCategory_NdisAtmSupportedServiceCategory_SIZE) - -// MSNdis_AtmSupportedAalTypes - MSNdis_AtmSupportedAalTypes -#define MSNdis_AtmSupportedAalTypesGuid \ - { 0x791ad1a0,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmSupportedAalTypes_GUID, \ - 0x791ad1a0,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmSupportedAalTypes -{ - // - ULONG NdisAtmSupportedAalTypes; - #define MSNdis_AtmSupportedAalTypes_NdisAtmSupportedAalTypes_SIZE sizeof(ULONG) - #define MSNdis_AtmSupportedAalTypes_NdisAtmSupportedAalTypes_ID 1 - -} MSNdis_AtmSupportedAalTypes, *PMSNdis_AtmSupportedAalTypes; - -#define MSNdis_AtmSupportedAalTypes_SIZE (FIELD_OFFSET(MSNdis_AtmSupportedAalTypes, NdisAtmSupportedAalTypes) + MSNdis_AtmSupportedAalTypes_NdisAtmSupportedAalTypes_SIZE) - -// MSNdis_AtmHardwareCurrentAddress - MSNdis_AtmHardwareCurrentAddress -#define MSNdis_AtmHardwareCurrentAddressGuid \ - { 0x791ad1a1,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmHardwareCurrentAddress_GUID, \ - 0x791ad1a1,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmHardwareCurrentAddress -{ - // - MSNdis_NetworkAddress NdisAtmHardwareCurrentAddress; - #define MSNdis_AtmHardwareCurrentAddress_NdisAtmHardwareCurrentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_AtmHardwareCurrentAddress_NdisAtmHardwareCurrentAddress_ID 1 - -} MSNdis_AtmHardwareCurrentAddress, *PMSNdis_AtmHardwareCurrentAddress; - -#define MSNdis_AtmHardwareCurrentAddress_SIZE (FIELD_OFFSET(MSNdis_AtmHardwareCurrentAddress, NdisAtmHardwareCurrentAddress) + MSNdis_AtmHardwareCurrentAddress_NdisAtmHardwareCurrentAddress_SIZE) - -// MSNdis_AtmMaxActiveVcs - MSNdis_AtmMaxActiveVcs -#define MSNdis_AtmMaxActiveVcsGuid \ - { 0x791ad1a2,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxActiveVcs_GUID, \ - 0x791ad1a2,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxActiveVcs -{ - // - ULONG NdisAtmMaxActiveVcs; - #define MSNdis_AtmMaxActiveVcs_NdisAtmMaxActiveVcs_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxActiveVcs_NdisAtmMaxActiveVcs_ID 1 - -} MSNdis_AtmMaxActiveVcs, *PMSNdis_AtmMaxActiveVcs; - -#define MSNdis_AtmMaxActiveVcs_SIZE (FIELD_OFFSET(MSNdis_AtmMaxActiveVcs, NdisAtmMaxActiveVcs) + MSNdis_AtmMaxActiveVcs_NdisAtmMaxActiveVcs_SIZE) - -// MSNdis_AtmMaxActiveVciBits - MSNdis_AtmMaxActiveVciBits -#define MSNdis_AtmMaxActiveVciBitsGuid \ - { 0x791ad1a3,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxActiveVciBits_GUID, \ - 0x791ad1a3,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxActiveVciBits -{ - // - ULONG NdisAtmMaxActiveVciBits; - #define MSNdis_AtmMaxActiveVciBits_NdisAtmMaxActiveVciBits_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxActiveVciBits_NdisAtmMaxActiveVciBits_ID 1 - -} MSNdis_AtmMaxActiveVciBits, *PMSNdis_AtmMaxActiveVciBits; - -#define MSNdis_AtmMaxActiveVciBits_SIZE (FIELD_OFFSET(MSNdis_AtmMaxActiveVciBits, NdisAtmMaxActiveVciBits) + MSNdis_AtmMaxActiveVciBits_NdisAtmMaxActiveVciBits_SIZE) - -// MSNdis_AtmMaxActiveVpiBits - MSNdis_AtmMaxActiveVpiBits -#define MSNdis_AtmMaxActiveVpiBitsGuid \ - { 0x791ad1a4,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxActiveVpiBits_GUID, \ - 0x791ad1a4,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxActiveVpiBits -{ - // - ULONG NdisAtmMaxActiveVpiBits; - #define MSNdis_AtmMaxActiveVpiBits_NdisAtmMaxActiveVpiBits_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxActiveVpiBits_NdisAtmMaxActiveVpiBits_ID 1 - -} MSNdis_AtmMaxActiveVpiBits, *PMSNdis_AtmMaxActiveVpiBits; - -#define MSNdis_AtmMaxActiveVpiBits_SIZE (FIELD_OFFSET(MSNdis_AtmMaxActiveVpiBits, NdisAtmMaxActiveVpiBits) + MSNdis_AtmMaxActiveVpiBits_NdisAtmMaxActiveVpiBits_SIZE) - -// MSNdis_AtmMaxAal0PacketSize - MSNdis_AtmMaxAal0PacketSize -#define MSNdis_AtmMaxAal0PacketSizeGuid \ - { 0x791ad1a5,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxAal0PacketSize_GUID, \ - 0x791ad1a5,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxAal0PacketSize -{ - // - ULONG NdisAtmMaxAal0PacketSize; - #define MSNdis_AtmMaxAal0PacketSize_NdisAtmMaxAal0PacketSize_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxAal0PacketSize_NdisAtmMaxAal0PacketSize_ID 1 - -} MSNdis_AtmMaxAal0PacketSize, *PMSNdis_AtmMaxAal0PacketSize; - -#define MSNdis_AtmMaxAal0PacketSize_SIZE (FIELD_OFFSET(MSNdis_AtmMaxAal0PacketSize, NdisAtmMaxAal0PacketSize) + MSNdis_AtmMaxAal0PacketSize_NdisAtmMaxAal0PacketSize_SIZE) - -// MSNdis_AtmMaxAal1PacketSize - MSNdis_AtmMaxAal1PacketSize -#define MSNdis_AtmMaxAal1PacketSizeGuid \ - { 0x791ad1a6,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxAal1PacketSize_GUID, \ - 0x791ad1a6,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxAal1PacketSize -{ - // - ULONG NdisAtmMaxAal1PacketSize; - #define MSNdis_AtmMaxAal1PacketSize_NdisAtmMaxAal1PacketSize_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxAal1PacketSize_NdisAtmMaxAal1PacketSize_ID 1 - -} MSNdis_AtmMaxAal1PacketSize, *PMSNdis_AtmMaxAal1PacketSize; - -#define MSNdis_AtmMaxAal1PacketSize_SIZE (FIELD_OFFSET(MSNdis_AtmMaxAal1PacketSize, NdisAtmMaxAal1PacketSize) + MSNdis_AtmMaxAal1PacketSize_NdisAtmMaxAal1PacketSize_SIZE) - -// MSNdis_AtmMaxAal34PacketSize - MSNdis_AtmMaxAal34PacketSize -#define MSNdis_AtmMaxAal34PacketSizeGuid \ - { 0x791ad1a7,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxAal34PacketSize_GUID, \ - 0x791ad1a7,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxAal34PacketSize -{ - // - ULONG NdisAtmMaxAal34PacketSize; - #define MSNdis_AtmMaxAal34PacketSize_NdisAtmMaxAal34PacketSize_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxAal34PacketSize_NdisAtmMaxAal34PacketSize_ID 1 - -} MSNdis_AtmMaxAal34PacketSize, *PMSNdis_AtmMaxAal34PacketSize; - -#define MSNdis_AtmMaxAal34PacketSize_SIZE (FIELD_OFFSET(MSNdis_AtmMaxAal34PacketSize, NdisAtmMaxAal34PacketSize) + MSNdis_AtmMaxAal34PacketSize_NdisAtmMaxAal34PacketSize_SIZE) - -// MSNdis_AtmMaxAal5PacketSize - MSNdis_AtmMaxAal5PacketSize -#define MSNdis_AtmMaxAal5PacketSizeGuid \ - { 0x791ad191,0xe35c,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmMaxAal5PacketSize_GUID, \ - 0x791ad191,0xe35c,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmMaxAal5PacketSize -{ - // - ULONG NdisAtmMaxAal5PacketSize; - #define MSNdis_AtmMaxAal5PacketSize_NdisAtmMaxAal5PacketSize_SIZE sizeof(ULONG) - #define MSNdis_AtmMaxAal5PacketSize_NdisAtmMaxAal5PacketSize_ID 1 - -} MSNdis_AtmMaxAal5PacketSize, *PMSNdis_AtmMaxAal5PacketSize; - -#define MSNdis_AtmMaxAal5PacketSize_SIZE (FIELD_OFFSET(MSNdis_AtmMaxAal5PacketSize, NdisAtmMaxAal5PacketSize) + MSNdis_AtmMaxAal5PacketSize_NdisAtmMaxAal5PacketSize_SIZE) - -// MSNdis_AtmReceiveCellsOk - MSNdis_AtmReceiveCellsOk -#define MSNdis_AtmReceiveCellsOkGuid \ - { 0x0a21480a,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmReceiveCellsOk_GUID, \ - 0x0a21480a,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmReceiveCellsOk -{ - // - ULONGLONG NdisAtmReceiveCellsOk; - #define MSNdis_AtmReceiveCellsOk_NdisAtmReceiveCellsOk_SIZE sizeof(ULONGLONG) - #define MSNdis_AtmReceiveCellsOk_NdisAtmReceiveCellsOk_ID 1 - -} MSNdis_AtmReceiveCellsOk, *PMSNdis_AtmReceiveCellsOk; - -#define MSNdis_AtmReceiveCellsOk_SIZE (FIELD_OFFSET(MSNdis_AtmReceiveCellsOk, NdisAtmReceiveCellsOk) + MSNdis_AtmReceiveCellsOk_NdisAtmReceiveCellsOk_SIZE) - -// MSNdis_AtmTransmitCellsOk - MSNdis_AtmTransmitCellsOk -#define MSNdis_AtmTransmitCellsOkGuid \ - { 0x0a21480b,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmTransmitCellsOk_GUID, \ - 0x0a21480b,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmTransmitCellsOk -{ - // - ULONGLONG NdisAtmTransmitCellsOk; - #define MSNdis_AtmTransmitCellsOk_NdisAtmTransmitCellsOk_SIZE sizeof(ULONGLONG) - #define MSNdis_AtmTransmitCellsOk_NdisAtmTransmitCellsOk_ID 1 - -} MSNdis_AtmTransmitCellsOk, *PMSNdis_AtmTransmitCellsOk; - -#define MSNdis_AtmTransmitCellsOk_SIZE (FIELD_OFFSET(MSNdis_AtmTransmitCellsOk, NdisAtmTransmitCellsOk) + MSNdis_AtmTransmitCellsOk_NdisAtmTransmitCellsOk_SIZE) - -// MSNdis_AtmReceiveCellsDropped - MSNdis_AtmReceiveCellsDropped -#define MSNdis_AtmReceiveCellsDroppedGuid \ - { 0x0a21480c,0xe35f,0x11d0, { 0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_AtmReceiveCellsDropped_GUID, \ - 0x0a21480c,0xe35f,0x11d0,0x96,0x92,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_AtmReceiveCellsDropped -{ - // - ULONGLONG NdisAtmReceiveCellsDropped; - #define MSNdis_AtmReceiveCellsDropped_NdisAtmReceiveCellsDropped_SIZE sizeof(ULONGLONG) - #define MSNdis_AtmReceiveCellsDropped_NdisAtmReceiveCellsDropped_ID 1 - -} MSNdis_AtmReceiveCellsDropped, *PMSNdis_AtmReceiveCellsDropped; - -#define MSNdis_AtmReceiveCellsDropped_SIZE (FIELD_OFFSET(MSNdis_AtmReceiveCellsDropped, NdisAtmReceiveCellsDropped) + MSNdis_AtmReceiveCellsDropped_NdisAtmReceiveCellsDropped_SIZE) - -// MSNdis_EthernetPermanentAddress - MSNdis_EthernetPermanentAddress -#define MSNdis_EthernetPermanentAddressGuid \ - { 0x447956ff,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetPermanentAddress_GUID, \ - 0x447956ff,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetPermanentAddress -{ - // - MSNdis_NetworkAddress NdisPermanentAddress; - #define MSNdis_EthernetPermanentAddress_NdisPermanentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_EthernetPermanentAddress_NdisPermanentAddress_ID 1 - -} MSNdis_EthernetPermanentAddress, *PMSNdis_EthernetPermanentAddress; - -#define MSNdis_EthernetPermanentAddress_SIZE (FIELD_OFFSET(MSNdis_EthernetPermanentAddress, NdisPermanentAddress) + MSNdis_EthernetPermanentAddress_NdisPermanentAddress_SIZE) - -// MSNdis_EthernetCurrentAddress - MSNdis_EthernetCurrentAddress -#define MSNdis_EthernetCurrentAddressGuid \ - { 0x44795700,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetCurrentAddress_GUID, \ - 0x44795700,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetCurrentAddress -{ - // - MSNdis_NetworkAddress NdisCurrentAddress; - #define MSNdis_EthernetCurrentAddress_NdisCurrentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_EthernetCurrentAddress_NdisCurrentAddress_ID 1 - -} MSNdis_EthernetCurrentAddress, *PMSNdis_EthernetCurrentAddress; - -#define MSNdis_EthernetCurrentAddress_SIZE (FIELD_OFFSET(MSNdis_EthernetCurrentAddress, NdisCurrentAddress) + MSNdis_EthernetCurrentAddress_NdisCurrentAddress_SIZE) - -// MSNdis_EthernetMulticastList - MSNdis_EthernetMulticastList -#define MSNdis_EthernetMulticastListGuid \ - { 0x44795701,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetMulticastList_GUID, \ - 0x44795701,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetMulticastList -{ - // - ULONG NumberElements; - #define MSNdis_EthernetMulticastList_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_EthernetMulticastList_NumberElements_ID 1 - - // - MSNdis_NetworkAddress NdisMulticastList[1]; - #define MSNdis_EthernetMulticastList_NdisMulticastList_ID 2 - -} MSNdis_EthernetMulticastList, *PMSNdis_EthernetMulticastList; - -// MSNdis_EthernetMaximumMulticastListSize - MSNdis_EthernetMaximumMulticastListSize -#define MSNdis_EthernetMaximumMulticastListSizeGuid \ - { 0x44795702,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetMaximumMulticastListSize_GUID, \ - 0x44795702,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetMaximumMulticastListSize -{ - // - ULONG NdisEthernetMaximumMulticastListSize; - #define MSNdis_EthernetMaximumMulticastListSize_NdisEthernetMaximumMulticastListSize_SIZE sizeof(ULONG) - #define MSNdis_EthernetMaximumMulticastListSize_NdisEthernetMaximumMulticastListSize_ID 1 - -} MSNdis_EthernetMaximumMulticastListSize, *PMSNdis_EthernetMaximumMulticastListSize; - -#define MSNdis_EthernetMaximumMulticastListSize_SIZE (FIELD_OFFSET(MSNdis_EthernetMaximumMulticastListSize, NdisEthernetMaximumMulticastListSize) + MSNdis_EthernetMaximumMulticastListSize_NdisEthernetMaximumMulticastListSize_SIZE) - -// MSNdis_EthernetMacOptions - MSNdis_EthernetMacOptions -#define MSNdis_EthernetMacOptionsGuid \ - { 0x44795703,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetMacOptions_GUID, \ - 0x44795703,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetMacOptions -{ - // - ULONG NdisEthernetMacOptions; - #define MSNdis_EthernetMacOptions_NdisEthernetMacOptions_SIZE sizeof(ULONG) - #define MSNdis_EthernetMacOptions_NdisEthernetMacOptions_ID 1 - -} MSNdis_EthernetMacOptions, *PMSNdis_EthernetMacOptions; - -#define MSNdis_EthernetMacOptions_SIZE (FIELD_OFFSET(MSNdis_EthernetMacOptions, NdisEthernetMacOptions) + MSNdis_EthernetMacOptions_NdisEthernetMacOptions_SIZE) - -// MSNdis_EthernetReceiveErrorAlignment - MSNdis_EthernetReceiveErrorAlignment -#define MSNdis_EthernetReceiveErrorAlignmentGuid \ - { 0x44795704,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetReceiveErrorAlignment_GUID, \ - 0x44795704,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetReceiveErrorAlignment -{ - // - ULONG NdisEthernetReceiveErrorAlignment; - #define MSNdis_EthernetReceiveErrorAlignment_NdisEthernetReceiveErrorAlignment_SIZE sizeof(ULONG) - #define MSNdis_EthernetReceiveErrorAlignment_NdisEthernetReceiveErrorAlignment_ID 1 - -} MSNdis_EthernetReceiveErrorAlignment, *PMSNdis_EthernetReceiveErrorAlignment; - -#define MSNdis_EthernetReceiveErrorAlignment_SIZE (FIELD_OFFSET(MSNdis_EthernetReceiveErrorAlignment, NdisEthernetReceiveErrorAlignment) + MSNdis_EthernetReceiveErrorAlignment_NdisEthernetReceiveErrorAlignment_SIZE) - -// MSNdis_EthernetOneTransmitCollision - MSNdis_EthernetOneTransmitCollision -#define MSNdis_EthernetOneTransmitCollisionGuid \ - { 0x44795705,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetOneTransmitCollision_GUID, \ - 0x44795705,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetOneTransmitCollision -{ - // - ULONG NdisEthernetOneTransmitCollision; - #define MSNdis_EthernetOneTransmitCollision_NdisEthernetOneTransmitCollision_SIZE sizeof(ULONG) - #define MSNdis_EthernetOneTransmitCollision_NdisEthernetOneTransmitCollision_ID 1 - -} MSNdis_EthernetOneTransmitCollision, *PMSNdis_EthernetOneTransmitCollision; - -#define MSNdis_EthernetOneTransmitCollision_SIZE (FIELD_OFFSET(MSNdis_EthernetOneTransmitCollision, NdisEthernetOneTransmitCollision) + MSNdis_EthernetOneTransmitCollision_NdisEthernetOneTransmitCollision_SIZE) - -// MSNdis_EthernetMoreTransmitCollisions - MSNdis_EthernetMoreTransmitCollisions -#define MSNdis_EthernetMoreTransmitCollisionsGuid \ - { 0x44795706,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EthernetMoreTransmitCollisions_GUID, \ - 0x44795706,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_EthernetMoreTransmitCollisions -{ - // - ULONG NdisEthernetMoreTransmitCollisions; - #define MSNdis_EthernetMoreTransmitCollisions_NdisEthernetMoreTransmitCollisions_SIZE sizeof(ULONG) - #define MSNdis_EthernetMoreTransmitCollisions_NdisEthernetMoreTransmitCollisions_ID 1 - -} MSNdis_EthernetMoreTransmitCollisions, *PMSNdis_EthernetMoreTransmitCollisions; - -#define MSNdis_EthernetMoreTransmitCollisions_SIZE (FIELD_OFFSET(MSNdis_EthernetMoreTransmitCollisions, NdisEthernetMoreTransmitCollisions) + MSNdis_EthernetMoreTransmitCollisions_NdisEthernetMoreTransmitCollisions_SIZE) - -// MSNdis_TokenRingPermanentAddress - MSNdis_TokenRingPermanentAddress -#define MSNdis_TokenRingPermanentAddressGuid \ - { 0x44795707,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingPermanentAddress_GUID, \ - 0x44795707,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingPermanentAddress -{ - // - MSNdis_NetworkAddress NdisPermanentAddress; - #define MSNdis_TokenRingPermanentAddress_NdisPermanentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_TokenRingPermanentAddress_NdisPermanentAddress_ID 1 - -} MSNdis_TokenRingPermanentAddress, *PMSNdis_TokenRingPermanentAddress; - -#define MSNdis_TokenRingPermanentAddress_SIZE (FIELD_OFFSET(MSNdis_TokenRingPermanentAddress, NdisPermanentAddress) + MSNdis_TokenRingPermanentAddress_NdisPermanentAddress_SIZE) - -// MSNdis_TokenRingCurrentAddress - MSNdis_TokenRingCurrentAddress -#define MSNdis_TokenRingCurrentAddressGuid \ - { 0x44795708,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingCurrentAddress_GUID, \ - 0x44795708,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingCurrentAddress -{ - // - MSNdis_NetworkAddress NdisCurrentAddress; - #define MSNdis_TokenRingCurrentAddress_NdisCurrentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_TokenRingCurrentAddress_NdisCurrentAddress_ID 1 - -} MSNdis_TokenRingCurrentAddress, *PMSNdis_TokenRingCurrentAddress; - -#define MSNdis_TokenRingCurrentAddress_SIZE (FIELD_OFFSET(MSNdis_TokenRingCurrentAddress, NdisCurrentAddress) + MSNdis_TokenRingCurrentAddress_NdisCurrentAddress_SIZE) - -// MSNdis_TokenRingCurrentFunctional - MSNdis_TokenRingCurrentFunctional -#define MSNdis_TokenRingCurrentFunctionalGuid \ - { 0x44795709,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingCurrentFunctional_GUID, \ - 0x44795709,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingCurrentFunctional -{ - // - ULONG NdisTokenRingCurrentFunctional; - #define MSNdis_TokenRingCurrentFunctional_NdisTokenRingCurrentFunctional_SIZE sizeof(ULONG) - #define MSNdis_TokenRingCurrentFunctional_NdisTokenRingCurrentFunctional_ID 1 - -} MSNdis_TokenRingCurrentFunctional, *PMSNdis_TokenRingCurrentFunctional; - -#define MSNdis_TokenRingCurrentFunctional_SIZE (FIELD_OFFSET(MSNdis_TokenRingCurrentFunctional, NdisTokenRingCurrentFunctional) + MSNdis_TokenRingCurrentFunctional_NdisTokenRingCurrentFunctional_SIZE) - -// MSNdis_TokenRingCurrentGroup - MSNdis_TokenRingCurrentGroup -#define MSNdis_TokenRingCurrentGroupGuid \ - { 0x4479570a,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingCurrentGroup_GUID, \ - 0x4479570a,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingCurrentGroup -{ - // - ULONG NdisTokenRingCurrentGroup; - #define MSNdis_TokenRingCurrentGroup_NdisTokenRingCurrentGroup_SIZE sizeof(ULONG) - #define MSNdis_TokenRingCurrentGroup_NdisTokenRingCurrentGroup_ID 1 - -} MSNdis_TokenRingCurrentGroup, *PMSNdis_TokenRingCurrentGroup; - -#define MSNdis_TokenRingCurrentGroup_SIZE (FIELD_OFFSET(MSNdis_TokenRingCurrentGroup, NdisTokenRingCurrentGroup) + MSNdis_TokenRingCurrentGroup_NdisTokenRingCurrentGroup_SIZE) - -// MSNdis_TokenRingLastOpenStatus - MSNdis_TokenRingLastOpenStatus -#define MSNdis_TokenRingLastOpenStatusGuid \ - { 0x4479570b,0xa61b,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingLastOpenStatus_GUID, \ - 0x4479570b,0xa61b,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingLastOpenStatus -{ - // - ULONG NdisTokenRingLastOpenStatus; - #define MSNdis_TokenRingLastOpenStatus_NdisTokenRingLastOpenStatus_SIZE sizeof(ULONG) - #define MSNdis_TokenRingLastOpenStatus_NdisTokenRingLastOpenStatus_ID 1 - -} MSNdis_TokenRingLastOpenStatus, *PMSNdis_TokenRingLastOpenStatus; - -#define MSNdis_TokenRingLastOpenStatus_SIZE (FIELD_OFFSET(MSNdis_TokenRingLastOpenStatus, NdisTokenRingLastOpenStatus) + MSNdis_TokenRingLastOpenStatus_NdisTokenRingLastOpenStatus_SIZE) - -// MSNdis_TokenRingCurrentRingStatus - MSNdis_TokenRingCurrentRingStatus -#define MSNdis_TokenRingCurrentRingStatusGuid \ - { 0x890a36ec,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingCurrentRingStatus_GUID, \ - 0x890a36ec,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingCurrentRingStatus -{ - // - ULONG NdisTokenRingCurrentRingStatus; - #define MSNdis_TokenRingCurrentRingStatus_NdisTokenRingCurrentRingStatus_SIZE sizeof(ULONG) - #define MSNdis_TokenRingCurrentRingStatus_NdisTokenRingCurrentRingStatus_ID 1 - -} MSNdis_TokenRingCurrentRingStatus, *PMSNdis_TokenRingCurrentRingStatus; - -#define MSNdis_TokenRingCurrentRingStatus_SIZE (FIELD_OFFSET(MSNdis_TokenRingCurrentRingStatus, NdisTokenRingCurrentRingStatus) + MSNdis_TokenRingCurrentRingStatus_NdisTokenRingCurrentRingStatus_SIZE) - -// MSNdis_TokenRingCurrentRingState - MSNdis_TokenRingCurrentRingState -#define MSNdis_TokenRingCurrentRingStateGuid \ - { 0xacf14032,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingCurrentRingState_GUID, \ - 0xacf14032,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingCurrentRingState -{ - // - ULONG NdisTokenRingCurrentRingState; - #define MSNdis_TokenRingCurrentRingState_NdisTokenRingCurrentRingState_SIZE sizeof(ULONG) - #define MSNdis_TokenRingCurrentRingState_NdisTokenRingCurrentRingState_ID 1 - -} MSNdis_TokenRingCurrentRingState, *PMSNdis_TokenRingCurrentRingState; - -#define MSNdis_TokenRingCurrentRingState_SIZE (FIELD_OFFSET(MSNdis_TokenRingCurrentRingState, NdisTokenRingCurrentRingState) + MSNdis_TokenRingCurrentRingState_NdisTokenRingCurrentRingState_SIZE) - -// MSNdis_TokenRingLineErrors - MSNdis_TokenRingLineErrors -#define MSNdis_TokenRingLineErrorsGuid \ - { 0xacf14033,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingLineErrors_GUID, \ - 0xacf14033,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingLineErrors -{ - // - ULONG NdisTokenRingLineErrors; - #define MSNdis_TokenRingLineErrors_NdisTokenRingLineErrors_SIZE sizeof(ULONG) - #define MSNdis_TokenRingLineErrors_NdisTokenRingLineErrors_ID 1 - -} MSNdis_TokenRingLineErrors, *PMSNdis_TokenRingLineErrors; - -#define MSNdis_TokenRingLineErrors_SIZE (FIELD_OFFSET(MSNdis_TokenRingLineErrors, NdisTokenRingLineErrors) + MSNdis_TokenRingLineErrors_NdisTokenRingLineErrors_SIZE) - -// MSNdis_TokenRingLostFrames - MSNdis_TokenRingLostFrames -#define MSNdis_TokenRingLostFramesGuid \ - { 0xacf14034,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TokenRingLostFrames_GUID, \ - 0xacf14034,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_TokenRingLostFrames -{ - // - ULONG NdisTokenRingLostFrames; - #define MSNdis_TokenRingLostFrames_NdisTokenRingLostFrames_SIZE sizeof(ULONG) - #define MSNdis_TokenRingLostFrames_NdisTokenRingLostFrames_ID 1 - -} MSNdis_TokenRingLostFrames, *PMSNdis_TokenRingLostFrames; - -#define MSNdis_TokenRingLostFrames_SIZE (FIELD_OFFSET(MSNdis_TokenRingLostFrames, NdisTokenRingLostFrames) + MSNdis_TokenRingLostFrames_NdisTokenRingLostFrames_SIZE) - -// MSNdis_FddiLongPermanentAddress - MSNdis_FddiLongPermanentAddress -#define MSNdis_FddiLongPermanentAddressGuid \ - { 0xacf14035,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLongPermanentAddress_GUID, \ - 0xacf14035,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLongPermanentAddress -{ - // - MSNdis_NetworkAddress NdisPermanentAddress; - #define MSNdis_FddiLongPermanentAddress_NdisPermanentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_FddiLongPermanentAddress_NdisPermanentAddress_ID 1 - -} MSNdis_FddiLongPermanentAddress, *PMSNdis_FddiLongPermanentAddress; - -#define MSNdis_FddiLongPermanentAddress_SIZE (FIELD_OFFSET(MSNdis_FddiLongPermanentAddress, NdisPermanentAddress) + MSNdis_FddiLongPermanentAddress_NdisPermanentAddress_SIZE) - -// MSNdis_FddiLongCurrentAddress - MSNdis_FddiLongCurrentAddress -#define MSNdis_FddiLongCurrentAddressGuid \ - { 0xacf14036,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLongCurrentAddress_GUID, \ - 0xacf14036,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLongCurrentAddress -{ - // - MSNdis_NetworkAddress NdisCurrentAddress; - #define MSNdis_FddiLongCurrentAddress_NdisCurrentAddress_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_FddiLongCurrentAddress_NdisCurrentAddress_ID 1 - -} MSNdis_FddiLongCurrentAddress, *PMSNdis_FddiLongCurrentAddress; - -#define MSNdis_FddiLongCurrentAddress_SIZE (FIELD_OFFSET(MSNdis_FddiLongCurrentAddress, NdisCurrentAddress) + MSNdis_FddiLongCurrentAddress_NdisCurrentAddress_SIZE) - -// MSNdis_FddiLongMulticastList - MSNdis_FddiLongMulticastList -#define MSNdis_FddiLongMulticastListGuid \ - { 0xacf14037,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLongMulticastList_GUID, \ - 0xacf14037,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLongMulticastList -{ - // - ULONG NumberElements; - #define MSNdis_FddiLongMulticastList_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_FddiLongMulticastList_NumberElements_ID 1 - - // - MSNdis_NetworkAddress NdisMulticastList[1]; - #define MSNdis_FddiLongMulticastList_NdisMulticastList_ID 2 - -} MSNdis_FddiLongMulticastList, *PMSNdis_FddiLongMulticastList; - -// MSNdis_FddiLongMaximumListSize - MSNdis_FddiLongMaximumListSize -#define MSNdis_FddiLongMaximumListSizeGuid \ - { 0xacf14038,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLongMaximumListSize_GUID, \ - 0xacf14038,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLongMaximumListSize -{ - // - ULONG NdisFddiLongMaximumListSize; - #define MSNdis_FddiLongMaximumListSize_NdisFddiLongMaximumListSize_SIZE sizeof(ULONG) - #define MSNdis_FddiLongMaximumListSize_NdisFddiLongMaximumListSize_ID 1 - -} MSNdis_FddiLongMaximumListSize, *PMSNdis_FddiLongMaximumListSize; - -#define MSNdis_FddiLongMaximumListSize_SIZE (FIELD_OFFSET(MSNdis_FddiLongMaximumListSize, NdisFddiLongMaximumListSize) + MSNdis_FddiLongMaximumListSize_NdisFddiLongMaximumListSize_SIZE) - -// MSNdis_FddiShortPermanentAddress - MSNdis_FddiShortPermanentAddress -#define MSNdis_FddiShortPermanentAddressGuid \ - { 0xacf14039,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiShortPermanentAddress_GUID, \ - 0xacf14039,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiShortPermanentAddress -{ - // - MSNdis_NetworkShortAddress NdisPermanentAddress; - #define MSNdis_FddiShortPermanentAddress_NdisPermanentAddress_SIZE sizeof(MSNdis_NetworkShortAddress) - #define MSNdis_FddiShortPermanentAddress_NdisPermanentAddress_ID 1 - -} MSNdis_FddiShortPermanentAddress, *PMSNdis_FddiShortPermanentAddress; - -#define MSNdis_FddiShortPermanentAddress_SIZE (FIELD_OFFSET(MSNdis_FddiShortPermanentAddress, NdisPermanentAddress) + MSNdis_FddiShortPermanentAddress_NdisPermanentAddress_SIZE) - -// MSNdis_FddiShortCurrentAddress - MSNdis_FddiShortCurrentAddress -#define MSNdis_FddiShortCurrentAddressGuid \ - { 0xacf1403a,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiShortCurrentAddress_GUID, \ - 0xacf1403a,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiShortCurrentAddress -{ - // - MSNdis_NetworkShortAddress NdisCurrentAddress; - #define MSNdis_FddiShortCurrentAddress_NdisCurrentAddress_SIZE sizeof(MSNdis_NetworkShortAddress) - #define MSNdis_FddiShortCurrentAddress_NdisCurrentAddress_ID 1 - -} MSNdis_FddiShortCurrentAddress, *PMSNdis_FddiShortCurrentAddress; - -#define MSNdis_FddiShortCurrentAddress_SIZE (FIELD_OFFSET(MSNdis_FddiShortCurrentAddress, NdisCurrentAddress) + MSNdis_FddiShortCurrentAddress_NdisCurrentAddress_SIZE) - -// MSNdis_FddiShortMulticastList - MSNdis_FddiShortMulticastList -#define MSNdis_FddiShortMulticastListGuid \ - { 0xacf1403b,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiShortMulticastList_GUID, \ - 0xacf1403b,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiShortMulticastList -{ - // - ULONG NumberElements; - #define MSNdis_FddiShortMulticastList_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_FddiShortMulticastList_NumberElements_ID 1 - - // - MSNdis_NetworkShortAddress NdisMulticastList[1]; - #define MSNdis_FddiShortMulticastList_NdisMulticastList_ID 2 - -} MSNdis_FddiShortMulticastList, *PMSNdis_FddiShortMulticastList; - -// MSNdis_FddiShortMaximumListSize - MSNdis_FddiShortMaximumListSize -#define MSNdis_FddiShortMaximumListSizeGuid \ - { 0xacf1403c,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiShortMaximumListSize_GUID, \ - 0xacf1403c,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiShortMaximumListSize -{ - // - ULONG NdisFddiShortMaximumListSize; - #define MSNdis_FddiShortMaximumListSize_NdisFddiShortMaximumListSize_SIZE sizeof(ULONG) - #define MSNdis_FddiShortMaximumListSize_NdisFddiShortMaximumListSize_ID 1 - -} MSNdis_FddiShortMaximumListSize, *PMSNdis_FddiShortMaximumListSize; - -#define MSNdis_FddiShortMaximumListSize_SIZE (FIELD_OFFSET(MSNdis_FddiShortMaximumListSize, NdisFddiShortMaximumListSize) + MSNdis_FddiShortMaximumListSize_NdisFddiShortMaximumListSize_SIZE) - -// MSNdis_FddiAttachmentType - MSNdis_FddiAttachmentType -#define MSNdis_FddiAttachmentTypeGuid \ - { 0xacf1403d,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiAttachmentType_GUID, \ - 0xacf1403d,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiAttachmentType -{ - // - ULONG NdisFddiAttachmentType; - #define MSNdis_FddiAttachmentType_NdisFddiAttachmentType_SIZE sizeof(ULONG) - #define MSNdis_FddiAttachmentType_NdisFddiAttachmentType_ID 1 - -} MSNdis_FddiAttachmentType, *PMSNdis_FddiAttachmentType; - -#define MSNdis_FddiAttachmentType_SIZE (FIELD_OFFSET(MSNdis_FddiAttachmentType, NdisFddiAttachmentType) + MSNdis_FddiAttachmentType_NdisFddiAttachmentType_SIZE) - -// MSNdis_FddiUpstreamNodeLong - MSNdis_FddiUpstreamNodeLong -#define MSNdis_FddiUpstreamNodeLongGuid \ - { 0xacf1403e,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiUpstreamNodeLong_GUID, \ - 0xacf1403e,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiUpstreamNodeLong -{ - // - MSNdis_NetworkAddress NdisFddiUpstreamNodeLong; - #define MSNdis_FddiUpstreamNodeLong_NdisFddiUpstreamNodeLong_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_FddiUpstreamNodeLong_NdisFddiUpstreamNodeLong_ID 1 - -} MSNdis_FddiUpstreamNodeLong, *PMSNdis_FddiUpstreamNodeLong; - -#define MSNdis_FddiUpstreamNodeLong_SIZE (FIELD_OFFSET(MSNdis_FddiUpstreamNodeLong, NdisFddiUpstreamNodeLong) + MSNdis_FddiUpstreamNodeLong_NdisFddiUpstreamNodeLong_SIZE) - -// MSNdis_FddiDownstreamNodeLong - MSNdis_FddiDownstreamNodeLong -#define MSNdis_FddiDownstreamNodeLongGuid \ - { 0xacf1403f,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiDownstreamNodeLong_GUID, \ - 0xacf1403f,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiDownstreamNodeLong -{ - // - MSNdis_NetworkAddress NdisFddiDownstreamNodeLong; - #define MSNdis_FddiDownstreamNodeLong_NdisFddiDownstreamNodeLong_SIZE sizeof(MSNdis_NetworkAddress) - #define MSNdis_FddiDownstreamNodeLong_NdisFddiDownstreamNodeLong_ID 1 - -} MSNdis_FddiDownstreamNodeLong, *PMSNdis_FddiDownstreamNodeLong; - -#define MSNdis_FddiDownstreamNodeLong_SIZE (FIELD_OFFSET(MSNdis_FddiDownstreamNodeLong, NdisFddiDownstreamNodeLong) + MSNdis_FddiDownstreamNodeLong_NdisFddiDownstreamNodeLong_SIZE) - -// MSNdis_FddiFrameErrors - MSNdis_FddiFrameErrors -#define MSNdis_FddiFrameErrorsGuid \ - { 0xacf14040,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiFrameErrors_GUID, \ - 0xacf14040,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiFrameErrors -{ - // - ULONG NdisFddiFrameErrors; - #define MSNdis_FddiFrameErrors_NdisFddiFrameErrors_SIZE sizeof(ULONG) - #define MSNdis_FddiFrameErrors_NdisFddiFrameErrors_ID 1 - -} MSNdis_FddiFrameErrors, *PMSNdis_FddiFrameErrors; - -#define MSNdis_FddiFrameErrors_SIZE (FIELD_OFFSET(MSNdis_FddiFrameErrors, NdisFddiFrameErrors) + MSNdis_FddiFrameErrors_NdisFddiFrameErrors_SIZE) - -// MSNdis_FddiFramesLost - MSNdis_FddiFramesLost -#define MSNdis_FddiFramesLostGuid \ - { 0xacf14041,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiFramesLost_GUID, \ - 0xacf14041,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiFramesLost -{ - // - ULONG NdisFddiFramesLost; - #define MSNdis_FddiFramesLost_NdisFddiFramesLost_SIZE sizeof(ULONG) - #define MSNdis_FddiFramesLost_NdisFddiFramesLost_ID 1 - -} MSNdis_FddiFramesLost, *PMSNdis_FddiFramesLost; - -#define MSNdis_FddiFramesLost_SIZE (FIELD_OFFSET(MSNdis_FddiFramesLost, NdisFddiFramesLost) + MSNdis_FddiFramesLost_NdisFddiFramesLost_SIZE) - -// MSNdis_FddiRingManagmentState - MSNdis_FddiRingManagmentState -#define MSNdis_FddiRingManagmentStateGuid \ - { 0xacf14042,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiRingManagmentState_GUID, \ - 0xacf14042,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiRingManagmentState -{ - // - ULONG NdisFddiRingManagmentState; - #define MSNdis_FddiRingManagmentState_NdisFddiRingManagmentState_SIZE sizeof(ULONG) - #define MSNdis_FddiRingManagmentState_NdisFddiRingManagmentState_ID 1 - -} MSNdis_FddiRingManagmentState, *PMSNdis_FddiRingManagmentState; - -#define MSNdis_FddiRingManagmentState_SIZE (FIELD_OFFSET(MSNdis_FddiRingManagmentState, NdisFddiRingManagmentState) + MSNdis_FddiRingManagmentState_NdisFddiRingManagmentState_SIZE) - -// MSNdis_FddiLctFailures - MSNdis_FddiLctFailures -#define MSNdis_FddiLctFailuresGuid \ - { 0xacf14043,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLctFailures_GUID, \ - 0xacf14043,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLctFailures -{ - // - ULONG NdisFddiLctFailures; - #define MSNdis_FddiLctFailures_NdisFddiLctFailures_SIZE sizeof(ULONG) - #define MSNdis_FddiLctFailures_NdisFddiLctFailures_ID 1 - -} MSNdis_FddiLctFailures, *PMSNdis_FddiLctFailures; - -#define MSNdis_FddiLctFailures_SIZE (FIELD_OFFSET(MSNdis_FddiLctFailures, NdisFddiLctFailures) + MSNdis_FddiLctFailures_NdisFddiLctFailures_SIZE) - -// MSNdis_FddiLemRejects - MSNdis_FddiLemRejects -#define MSNdis_FddiLemRejectsGuid \ - { 0xacf14044,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLemRejects_GUID, \ - 0xacf14044,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLemRejects -{ - // - ULONG NdisFddiLemRejects; - #define MSNdis_FddiLemRejects_NdisFddiLemRejects_SIZE sizeof(ULONG) - #define MSNdis_FddiLemRejects_NdisFddiLemRejects_ID 1 - -} MSNdis_FddiLemRejects, *PMSNdis_FddiLemRejects; - -#define MSNdis_FddiLemRejects_SIZE (FIELD_OFFSET(MSNdis_FddiLemRejects, NdisFddiLemRejects) + MSNdis_FddiLemRejects_NdisFddiLemRejects_SIZE) - -// MSNdis_FddiLConnectionState - MSNdis_FddiLConnectionState -#define MSNdis_FddiLConnectionStateGuid \ - { 0xacf14045,0xa61c,0x11d0, { 0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_FddiLConnectionState_GUID, \ - 0xacf14045,0xa61c,0x11d0,0x8d,0xd4,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_FddiLConnectionState -{ - // - ULONG NdisFddiLConnectionState; - #define MSNdis_FddiLConnectionState_NdisFddiLConnectionState_SIZE sizeof(ULONG) - #define MSNdis_FddiLConnectionState_NdisFddiLConnectionState_ID 1 - -} MSNdis_FddiLConnectionState, *PMSNdis_FddiLConnectionState; - -#define MSNdis_FddiLConnectionState_SIZE (FIELD_OFFSET(MSNdis_FddiLConnectionState, NdisFddiLConnectionState) + MSNdis_FddiLConnectionState_NdisFddiLConnectionState_SIZE) - -// MSNdis_ObjectHeader - MSNdis_ObjectHeader -#define MSNdis_ObjectHeaderGuid \ - { 0x2b1831b2,0x2216,0x4ede, { 0xa4,0x69,0x9f,0xe3,0xdd,0x6d,0x5a,0x7e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ObjectHeader_GUID, \ - 0x2b1831b2,0x2216,0x4ede,0xa4,0x69,0x9f,0xe3,0xdd,0x6d,0x5a,0x7e); -#endif - - -typedef struct _MSNdis_ObjectHeader -{ - // - UCHAR Type; - #define MSNdis_ObjectHeader_Type_SIZE sizeof(UCHAR) - #define MSNdis_ObjectHeader_Type_ID 1 - - // - UCHAR Revision; - #define MSNdis_ObjectHeader_Revision_SIZE sizeof(UCHAR) - #define MSNdis_ObjectHeader_Revision_ID 2 - - // - USHORT Size; - #define MSNdis_ObjectHeader_Size_SIZE sizeof(USHORT) - #define MSNdis_ObjectHeader_Size_ID 3 - -} MSNdis_ObjectHeader, *PMSNdis_ObjectHeader; - -#define MSNdis_ObjectHeader_SIZE (FIELD_OFFSET(MSNdis_ObjectHeader, Size) + MSNdis_ObjectHeader_Size_SIZE) - -// MSNdis_WmiMethodHeader - MSNdis_WmiMethodHeader -#define MSNdis_WmiMethodHeaderGuid \ - { 0xe3eac9dd,0x2fd3,0x4963, { 0xbf,0xfd,0xb4,0x69,0x28,0x88,0xc0,0xd4 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiMethodHeader_GUID, \ - 0xe3eac9dd,0x2fd3,0x4963,0xbf,0xfd,0xb4,0x69,0x28,0x88,0xc0,0xd4); -#endif - - -typedef struct _MSNdis_WmiMethodHeader -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiMethodHeader_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiMethodHeader_Header_ID 1 - - // - ULONG PortNumber; - #define MSNdis_WmiMethodHeader_PortNumber_SIZE sizeof(ULONG) - #define MSNdis_WmiMethodHeader_PortNumber_ID 2 - - // - ULONGLONG NetLuid; - #define MSNdis_WmiMethodHeader_NetLuid_SIZE sizeof(ULONGLONG) - #define MSNdis_WmiMethodHeader_NetLuid_ID 3 - - // - ULONGLONG RequestId; - #define MSNdis_WmiMethodHeader_RequestId_SIZE sizeof(ULONGLONG) - #define MSNdis_WmiMethodHeader_RequestId_ID 4 - - // - ULONG Timeout; - #define MSNdis_WmiMethodHeader_Timeout_SIZE sizeof(ULONG) - #define MSNdis_WmiMethodHeader_Timeout_ID 5 - - // - ULONG Padding; - #define MSNdis_WmiMethodHeader_Padding_SIZE sizeof(ULONG) - #define MSNdis_WmiMethodHeader_Padding_ID 6 - -} MSNdis_WmiMethodHeader, *PMSNdis_WmiMethodHeader; - -#define MSNdis_WmiMethodHeader_SIZE (FIELD_OFFSET(MSNdis_WmiMethodHeader, Padding) + MSNdis_WmiMethodHeader_Padding_SIZE) - -// MSNdis_WmiSetHeader - MSNdis_WmiSetHeader -#define MSNdis_WmiSetHeaderGuid \ - { 0x3b5605d8,0x1aaf,0x4ff6, { 0x85,0xb9,0xbc,0x5f,0xb9,0x73,0xdc,0x54 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiSetHeader_GUID, \ - 0x3b5605d8,0x1aaf,0x4ff6,0x85,0xb9,0xbc,0x5f,0xb9,0x73,0xdc,0x54); -#endif - - -typedef struct _MSNdis_WmiSetHeader -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiSetHeader_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiSetHeader_Header_ID 1 - - // - ULONG PortNumber; - #define MSNdis_WmiSetHeader_PortNumber_SIZE sizeof(ULONG) - #define MSNdis_WmiSetHeader_PortNumber_ID 2 - - // - ULONGLONG NetLuid; - #define MSNdis_WmiSetHeader_NetLuid_SIZE sizeof(ULONGLONG) - #define MSNdis_WmiSetHeader_NetLuid_ID 3 - - // - ULONGLONG RequestId; - #define MSNdis_WmiSetHeader_RequestId_SIZE sizeof(ULONGLONG) - #define MSNdis_WmiSetHeader_RequestId_ID 4 - - // - ULONG Timeout; - #define MSNdis_WmiSetHeader_Timeout_SIZE sizeof(ULONG) - #define MSNdis_WmiSetHeader_Timeout_ID 5 - - // - ULONG Padding; - #define MSNdis_WmiSetHeader_Padding_SIZE sizeof(ULONG) - #define MSNdis_WmiSetHeader_Padding_ID 6 - -} MSNdis_WmiSetHeader, *PMSNdis_WmiSetHeader; - -#define MSNdis_WmiSetHeader_SIZE (FIELD_OFFSET(MSNdis_WmiSetHeader, Padding) + MSNdis_WmiSetHeader_Padding_SIZE) - -// MSNdis_WmiOutputInfo - MSNdis_WmiOutputInfo -#define MSNdis_WmiOutputInfoGuid \ - { 0x7510bb9d,0xdf70,0x4f7e, { 0xba,0x07,0xe2,0x9d,0x33,0x0b,0x3c,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiOutputInfo_GUID, \ - 0x7510bb9d,0xdf70,0x4f7e,0xba,0x07,0xe2,0x9d,0x33,0x0b,0x3c,0xc5); -#endif - - -typedef struct _MSNdis_WmiOutputInfo -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiOutputInfo_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiOutputInfo_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_WmiOutputInfo_Flags_SIZE sizeof(ULONG) - #define MSNdis_WmiOutputInfo_Flags_ID 2 - - // - UCHAR SupportedRevision; - #define MSNdis_WmiOutputInfo_SupportedRevision_SIZE sizeof(UCHAR) - #define MSNdis_WmiOutputInfo_SupportedRevision_ID 3 - - // - UCHAR Padding1; - #define MSNdis_WmiOutputInfo_Padding1_SIZE sizeof(UCHAR) - #define MSNdis_WmiOutputInfo_Padding1_ID 4 - - // - USHORT Padding2; - #define MSNdis_WmiOutputInfo_Padding2_SIZE sizeof(USHORT) - #define MSNdis_WmiOutputInfo_Padding2_ID 5 - - // - ULONG DataOffset; - #define MSNdis_WmiOutputInfo_DataOffset_SIZE sizeof(ULONG) - #define MSNdis_WmiOutputInfo_DataOffset_ID 6 - -} MSNdis_WmiOutputInfo, *PMSNdis_WmiOutputInfo; - -#define MSNdis_WmiOutputInfo_SIZE (FIELD_OFFSET(MSNdis_WmiOutputInfo, DataOffset) + MSNdis_WmiOutputInfo_DataOffset_SIZE) - -// MSNdis_WmiEnumAdapter - MSNdis_WmiEnumAdapter -#define MSNdis_WmiEnumAdapterGuid \ - { 0xe7001b59,0xc3d6,0x4537, { 0xb4,0x0e,0xa1,0x63,0xd5,0x16,0xe4,0xa3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiEnumAdapter_GUID, \ - 0xe7001b59,0xc3d6,0x4537,0xb4,0x0e,0xa1,0x63,0xd5,0x16,0xe4,0xa3); -#endif - - -typedef struct _MSNdis_WmiEnumAdapter -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiEnumAdapter_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiEnumAdapter_Header_ID 1 - - // - ULONG IfIndex; - #define MSNdis_WmiEnumAdapter_IfIndex_SIZE sizeof(ULONG) - #define MSNdis_WmiEnumAdapter_IfIndex_ID 2 - - // - ULONGLONG NetLuid; - #define MSNdis_WmiEnumAdapter_NetLuid_SIZE sizeof(ULONGLONG) - #define MSNdis_WmiEnumAdapter_NetLuid_ID 3 - - // - CHAR VariableData[1]; - #define MSNdis_WmiEnumAdapter_DeviceName_ID 4 - -} MSNdis_WmiEnumAdapter, *PMSNdis_WmiEnumAdapter; - -// MSNdis_LinkStateData - MSNdis_LinkStateData -#define MSNdis_LinkStateDataGuid \ - { 0x5b26b94f,0x0272,0x4d4c, { 0x87,0x44,0xbd,0x84,0xbe,0x42,0x1f,0x3b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_LinkStateData_GUID, \ - 0x5b26b94f,0x0272,0x4d4c,0x87,0x44,0xbd,0x84,0xbe,0x42,0x1f,0x3b); -#endif - - -typedef struct _MSNdis_LinkStateData -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_LinkStateData_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_LinkStateData_Header_ID 1 - - // - ULONG MediaConnectState; - #define MSNdis_LinkStateData_MediaConnectState_SIZE sizeof(ULONG) - #define MSNdis_LinkStateData_MediaConnectState_ID 2 - - // - ULONG MediaDuplexState; - #define MSNdis_LinkStateData_MediaDuplexState_SIZE sizeof(ULONG) - #define MSNdis_LinkStateData_MediaDuplexState_ID 3 - - // - ULONGLONG XmitLinkSpeed; - #define MSNdis_LinkStateData_XmitLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_LinkStateData_XmitLinkSpeed_ID 4 - - // - ULONGLONG RcvLinkSpeed; - #define MSNdis_LinkStateData_RcvLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_LinkStateData_RcvLinkSpeed_ID 5 - - // - ULONG PauseFunctions; - #define MSNdis_LinkStateData_PauseFunctions_SIZE sizeof(ULONG) - #define MSNdis_LinkStateData_PauseFunctions_ID 6 - - // - ULONG AutoNegotiationFlags; - #define MSNdis_LinkStateData_AutoNegotiationFlags_SIZE sizeof(ULONG) - #define MSNdis_LinkStateData_AutoNegotiationFlags_ID 7 - -} MSNdis_LinkStateData, *PMSNdis_LinkStateData; - -#define MSNdis_LinkStateData_SIZE (FIELD_OFFSET(MSNdis_LinkStateData, AutoNegotiationFlags) + MSNdis_LinkStateData_AutoNegotiationFlags_SIZE) - -// MSNdis_LinkParameters - MSNdis_LinkParameters -#define MSNdis_LinkParametersGuid \ - { 0x29380131,0xa312,0x4400, { 0xbe,0x0c,0x53,0x87,0x7a,0x41,0xc4,0x65 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_LinkParameters_GUID, \ - 0x29380131,0xa312,0x4400,0xbe,0x0c,0x53,0x87,0x7a,0x41,0xc4,0x65); -#endif - - -typedef struct _MSNdis_LinkParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_LinkParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_LinkParameters_Header_ID 1 - - // - ULONG MediaDuplexState; - #define MSNdis_LinkParameters_MediaDuplexState_SIZE sizeof(ULONG) - #define MSNdis_LinkParameters_MediaDuplexState_ID 2 - - // - ULONGLONG XmitLinkSpeed; - #define MSNdis_LinkParameters_XmitLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_LinkParameters_XmitLinkSpeed_ID 3 - - // - ULONGLONG RcvLinkSpeed; - #define MSNdis_LinkParameters_RcvLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_LinkParameters_RcvLinkSpeed_ID 4 - - // - ULONG PauseFunctions; - #define MSNdis_LinkParameters_PauseFunctions_SIZE sizeof(ULONG) - #define MSNdis_LinkParameters_PauseFunctions_ID 5 - - // - ULONG AutoNegotiationFlags; - #define MSNdis_LinkParameters_AutoNegotiationFlags_SIZE sizeof(ULONG) - #define MSNdis_LinkParameters_AutoNegotiationFlags_ID 6 - -} MSNdis_LinkParameters, *PMSNdis_LinkParameters; - -#define MSNdis_LinkParameters_SIZE (FIELD_OFFSET(MSNdis_LinkParameters, AutoNegotiationFlags) + MSNdis_LinkParameters_AutoNegotiationFlags_SIZE) - -// MSNdis_InterruptModerationParameters - MSNdis_InterruptModerationParameters -#define MSNdis_InterruptModerationParametersGuid \ - { 0x09f58643,0x31fb,0x45b5, { 0x85,0x2b,0x09,0xb4,0xd3,0xff,0x37,0x65 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_InterruptModerationParameters_GUID, \ - 0x09f58643,0x31fb,0x45b5,0x85,0x2b,0x09,0xb4,0xd3,0xff,0x37,0x65); -#endif - - -typedef struct _MSNdis_InterruptModerationParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_InterruptModerationParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_InterruptModerationParameters_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_InterruptModerationParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_InterruptModerationParameters_Flags_ID 2 - - // - ULONG InterruptModeration; - #define MSNdis_InterruptModerationParameters_InterruptModeration_SIZE sizeof(ULONG) - #define MSNdis_InterruptModerationParameters_InterruptModeration_ID 3 - -} MSNdis_InterruptModerationParameters, *PMSNdis_InterruptModerationParameters; - -#define MSNdis_InterruptModerationParameters_SIZE (FIELD_OFFSET(MSNdis_InterruptModerationParameters, InterruptModeration) + MSNdis_InterruptModerationParameters_InterruptModeration_SIZE) - -// MSNdis_StatisticsInfo - MSNdis_StatisticsInfo -#define MSNdis_StatisticsInfoGuid \ - { 0x8ecc74e1,0xba85,0x482e, { 0xaf,0xaf,0xb4,0xf8,0xb0,0x87,0xc0,0x6b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatisticsInfo_GUID, \ - 0x8ecc74e1,0xba85,0x482e,0xaf,0xaf,0xb4,0xf8,0xb0,0x87,0xc0,0x6b); -#endif - - -typedef struct _MSNdis_StatisticsInfo -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_StatisticsInfo_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_StatisticsInfo_Header_ID 1 - - // - ULONG SupportedStatistics; - #define MSNdis_StatisticsInfo_SupportedStatistics_SIZE sizeof(ULONG) - #define MSNdis_StatisticsInfo_SupportedStatistics_ID 2 - - // - ULONGLONG ifInDiscards; - #define MSNdis_StatisticsInfo_ifInDiscards_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifInDiscards_ID 3 - - // - ULONGLONG ifInErrors; - #define MSNdis_StatisticsInfo_ifInErrors_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifInErrors_ID 4 - - // - ULONGLONG ifHCInOctets; - #define MSNdis_StatisticsInfo_ifHCInOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInOctets_ID 5 - - // - ULONGLONG ifHCInUcastPkts; - #define MSNdis_StatisticsInfo_ifHCInUcastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInUcastPkts_ID 6 - - // - ULONGLONG ifHCInMulticastPkts; - #define MSNdis_StatisticsInfo_ifHCInMulticastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInMulticastPkts_ID 7 - - // - ULONGLONG ifHCInBroadcastPkts; - #define MSNdis_StatisticsInfo_ifHCInBroadcastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInBroadcastPkts_ID 8 - - // - ULONGLONG ifHCOutOctets; - #define MSNdis_StatisticsInfo_ifHCOutOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutOctets_ID 9 - - // - ULONGLONG ifHCOutUcastPkts; - #define MSNdis_StatisticsInfo_ifHCOutUcastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutUcastPkts_ID 10 - - // - ULONGLONG ifHCOutMulticastPkts; - #define MSNdis_StatisticsInfo_ifHCOutMulticastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutMulticastPkts_ID 11 - - // - ULONGLONG ifHCOutBroadcastPkts; - #define MSNdis_StatisticsInfo_ifHCOutBroadcastPkts_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutBroadcastPkts_ID 12 - - // - ULONGLONG ifOutErrors; - #define MSNdis_StatisticsInfo_ifOutErrors_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifOutErrors_ID 13 - - // - ULONGLONG ifOutDiscards; - #define MSNdis_StatisticsInfo_ifOutDiscards_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifOutDiscards_ID 14 - - // - ULONGLONG ifHCInUcastOctets; - #define MSNdis_StatisticsInfo_ifHCInUcastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInUcastOctets_ID 15 - - // - ULONGLONG ifHCInMulticastOctets; - #define MSNdis_StatisticsInfo_ifHCInMulticastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInMulticastOctets_ID 16 - - // - ULONGLONG ifHCInBroadcastOctets; - #define MSNdis_StatisticsInfo_ifHCInBroadcastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCInBroadcastOctets_ID 17 - - // - ULONGLONG ifHCOutUcastOctets; - #define MSNdis_StatisticsInfo_ifHCOutUcastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutUcastOctets_ID 18 - - // - ULONGLONG ifHCOutMulticastOctets; - #define MSNdis_StatisticsInfo_ifHCOutMulticastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutMulticastOctets_ID 19 - - // - ULONGLONG ifHCOutBroadcastOctets; - #define MSNdis_StatisticsInfo_ifHCOutBroadcastOctets_SIZE sizeof(ULONGLONG) - #define MSNdis_StatisticsInfo_ifHCOutBroadcastOctets_ID 20 - -} MSNdis_StatisticsInfo, *PMSNdis_StatisticsInfo; - -#define MSNdis_StatisticsInfo_SIZE (FIELD_OFFSET(MSNdis_StatisticsInfo, ifHCOutBroadcastOctets) + MSNdis_StatisticsInfo_ifHCOutBroadcastOctets_SIZE) - -// MSNdis_PortStateData - MSNdis_PortStateData -#define MSNdis_PortStateDataGuid \ - { 0x8feae2c6,0xee28,0x469f, { 0x8b,0x5d,0x9f,0x74,0x3b,0xab,0x21,0xaa } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PortStateData_GUID, \ - 0x8feae2c6,0xee28,0x469f,0x8b,0x5d,0x9f,0x74,0x3b,0xab,0x21,0xaa); -#endif - - -typedef struct _MSNdis_PortStateData -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PortStateData_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PortStateData_Header_ID 1 - - // - ULONG MediaConnectState; - #define MSNdis_PortStateData_MediaConnectState_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_MediaConnectState_ID 2 - - // - ULONGLONG XmitLinkSpeed; - #define MSNdis_PortStateData_XmitLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_PortStateData_XmitLinkSpeed_ID 3 - - // - ULONGLONG RcvLinkSpeed; - #define MSNdis_PortStateData_RcvLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_PortStateData_RcvLinkSpeed_ID 4 - - // - ULONG Direction; - #define MSNdis_PortStateData_Direction_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_Direction_ID 5 - - // - ULONG SendControlState; - #define MSNdis_PortStateData_SendControlState_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_SendControlState_ID 6 - - // - ULONG RcvControlState; - #define MSNdis_PortStateData_RcvControlState_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_RcvControlState_ID 7 - - // - ULONG SendAuthorizationState; - #define MSNdis_PortStateData_SendAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_SendAuthorizationState_ID 8 - - // - ULONG RcvAuthorizationState; - #define MSNdis_PortStateData_RcvAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_RcvAuthorizationState_ID 9 - - // - ULONG Flags; - #define MSNdis_PortStateData_Flags_SIZE sizeof(ULONG) - #define MSNdis_PortStateData_Flags_ID 10 - -} MSNdis_PortStateData, *PMSNdis_PortStateData; - -#define MSNdis_PortStateData_SIZE (FIELD_OFFSET(MSNdis_PortStateData, Flags) + MSNdis_PortStateData_Flags_SIZE) - -// MSNdis_PortAuthParameters - MSNdis_PortAuthParameters -#define MSNdis_PortAuthParametersGuid \ - { 0x5c3bda24,0x8b64,0x4829, { 0xa5,0x87,0x8c,0xe7,0x19,0x15,0x2f,0xe2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PortAuthParameters_GUID, \ - 0x5c3bda24,0x8b64,0x4829,0xa5,0x87,0x8c,0xe7,0x19,0x15,0x2f,0xe2); -#endif - - -typedef struct _MSNdis_PortAuthParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PortAuthParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PortAuthParameters_Header_ID 1 - - // - ULONG SendControlState; - #define MSNdis_PortAuthParameters_SendControlState_SIZE sizeof(ULONG) - #define MSNdis_PortAuthParameters_SendControlState_ID 2 - - // - ULONG RcvControlState; - #define MSNdis_PortAuthParameters_RcvControlState_SIZE sizeof(ULONG) - #define MSNdis_PortAuthParameters_RcvControlState_ID 3 - - // - ULONG SendAuthorizationState; - #define MSNdis_PortAuthParameters_SendAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortAuthParameters_SendAuthorizationState_ID 4 - - // - ULONG RcvAuthorizationState; - #define MSNdis_PortAuthParameters_RcvAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortAuthParameters_RcvAuthorizationState_ID 5 - -} MSNdis_PortAuthParameters, *PMSNdis_PortAuthParameters; - -#define MSNdis_PortAuthParameters_SIZE (FIELD_OFFSET(MSNdis_PortAuthParameters, RcvAuthorizationState) + MSNdis_PortAuthParameters_RcvAuthorizationState_SIZE) - -// MSNdis_PortChar - MSNdis_PortChar -#define MSNdis_PortCharGuid \ - { 0xf5b7d202,0xe594,0x4aa3, { 0xbe,0x43,0x49,0x76,0x83,0x3c,0x78,0x40 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PortChar_GUID, \ - 0xf5b7d202,0xe594,0x4aa3,0xbe,0x43,0x49,0x76,0x83,0x3c,0x78,0x40); -#endif - - -typedef struct _MSNdis_PortChar -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PortChar_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PortChar_Header_ID 1 - - // - ULONG PortNumber; - #define MSNdis_PortChar_PortNumber_SIZE sizeof(ULONG) - #define MSNdis_PortChar_PortNumber_ID 2 - - // - ULONG Flags; - #define MSNdis_PortChar_Flags_SIZE sizeof(ULONG) - #define MSNdis_PortChar_Flags_ID 3 - - // - ULONG Type; - #define MSNdis_PortChar_Type_SIZE sizeof(ULONG) - #define MSNdis_PortChar_Type_ID 4 - - // - ULONG MediaConnectState; - #define MSNdis_PortChar_MediaConnectState_SIZE sizeof(ULONG) - #define MSNdis_PortChar_MediaConnectState_ID 5 - - // - ULONGLONG XmitLinkSpeed; - #define MSNdis_PortChar_XmitLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_PortChar_XmitLinkSpeed_ID 6 - - // - ULONGLONG RcvLinkSpeed; - #define MSNdis_PortChar_RcvLinkSpeed_SIZE sizeof(ULONGLONG) - #define MSNdis_PortChar_RcvLinkSpeed_ID 7 - - // - ULONG Direction; - #define MSNdis_PortChar_Direction_SIZE sizeof(ULONG) - #define MSNdis_PortChar_Direction_ID 8 - - // - ULONG SendControlState; - #define MSNdis_PortChar_SendControlState_SIZE sizeof(ULONG) - #define MSNdis_PortChar_SendControlState_ID 9 - - // - ULONG RcvControlState; - #define MSNdis_PortChar_RcvControlState_SIZE sizeof(ULONG) - #define MSNdis_PortChar_RcvControlState_ID 10 - - // - ULONG SendAuthorizationState; - #define MSNdis_PortChar_SendAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortChar_SendAuthorizationState_ID 11 - - // - ULONG RcvAuthorizationState; - #define MSNdis_PortChar_RcvAuthorizationState_SIZE sizeof(ULONG) - #define MSNdis_PortChar_RcvAuthorizationState_ID 12 - -} MSNdis_PortChar, *PMSNdis_PortChar; - -#define MSNdis_PortChar_SIZE (FIELD_OFFSET(MSNdis_PortChar, RcvAuthorizationState) + MSNdis_PortChar_RcvAuthorizationState_SIZE) - -// MSNdis_PortArray - MSNdis_PortArray -#define MSNdis_PortArrayGuid \ - { 0x0fee8708,0xdf65,0x456e, { 0xb4,0xca,0xfa,0x62,0x32,0x66,0xa1,0x2a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PortArray_GUID, \ - 0x0fee8708,0xdf65,0x456e,0xb4,0xca,0xfa,0x62,0x32,0x66,0xa1,0x2a); -#endif - - -typedef struct _MSNdis_PortArray -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PortArray_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PortArray_Header_ID 1 - - // - ULONG NumberOfPorts; - #define MSNdis_PortArray_NumberOfPorts_SIZE sizeof(ULONG) - #define MSNdis_PortArray_NumberOfPorts_ID 2 - - // - ULONG OffsetFirstPort; - #define MSNdis_PortArray_OffsetFirstPort_SIZE sizeof(ULONG) - #define MSNdis_PortArray_OffsetFirstPort_ID 3 - - // - ULONG ElementSize; - #define MSNdis_PortArray_ElementSize_SIZE sizeof(ULONG) - #define MSNdis_PortArray_ElementSize_ID 4 - - // - MSNdis_PortChar Port[1]; - #define MSNdis_PortArray_Port_ID 5 - -} MSNdis_PortArray, *PMSNdis_PortArray; - -// MSNdis_PciDeviceProperty - MSNdis_PciDeviceProperty -#define MSNdis_PciDevicePropertyGuid \ - { 0x0573f70f,0xded8,0x401c, { 0x8b,0x56,0xa6,0x2b,0xb5,0x28,0xc0,0xe2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PciDeviceProperty_GUID, \ - 0x0573f70f,0xded8,0x401c,0x8b,0x56,0xa6,0x2b,0xb5,0x28,0xc0,0xe2); -#endif - - -typedef struct _MSNdis_PciDeviceProperty -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PciDeviceProperty_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PciDeviceProperty_Header_ID 1 - - // - ULONG DeviceType; - #define MSNdis_PciDeviceProperty_DeviceType_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_DeviceType_ID 2 - - // - ULONG CurrentSpeedAndMode; - #define MSNdis_PciDeviceProperty_CurrentSpeedAndMode_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_CurrentSpeedAndMode_ID 3 - - // - ULONG CurrentPayloadSize; - #define MSNdis_PciDeviceProperty_CurrentPayloadSize_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_CurrentPayloadSize_ID 4 - - // - ULONG MaxPayloadSize; - #define MSNdis_PciDeviceProperty_MaxPayloadSize_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_MaxPayloadSize_ID 5 - - // - ULONG MaxReadRequestSize; - #define MSNdis_PciDeviceProperty_MaxReadRequestSize_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_MaxReadRequestSize_ID 6 - - // - ULONG CurrentLinkSpeed; - #define MSNdis_PciDeviceProperty_CurrentLinkSpeed_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_CurrentLinkSpeed_ID 7 - - // - ULONG CurrentLinkWidth; - #define MSNdis_PciDeviceProperty_CurrentLinkWidth_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_CurrentLinkWidth_ID 8 - - // - ULONG MaxLinkSpeed; - #define MSNdis_PciDeviceProperty_MaxLinkSpeed_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_MaxLinkSpeed_ID 9 - - // - ULONG MaxLinkWidth; - #define MSNdis_PciDeviceProperty_MaxLinkWidth_SIZE sizeof(ULONG) - #define MSNdis_PciDeviceProperty_MaxLinkWidth_ID 10 - -} MSNdis_PciDeviceProperty, *PMSNdis_PciDeviceProperty; - -#define MSNdis_PciDeviceProperty_SIZE (FIELD_OFFSET(MSNdis_PciDeviceProperty, MaxLinkWidth) + MSNdis_PciDeviceProperty_MaxLinkWidth_SIZE) - -// MSNdis_WmiTcpLargeSendOffloadV1_IPv4 - MSNdis_WmiTcpLargeSendOffloadV1_IPv4 -#define MSNdis_WmiTcpLargeSendOffloadV1_IPv4Guid \ - { 0xd7673b11,0xe892,0x4a9d, { 0x8b,0xd8,0x76,0x1f,0xf2,0x56,0xed,0xd9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpLargeSendOffloadV1_IPv4_GUID, \ - 0xd7673b11,0xe892,0x4a9d,0x8b,0xd8,0x76,0x1f,0xf2,0x56,0xed,0xd9); -#endif - - -typedef struct _MSNdis_WmiTcpLargeSendOffloadV1_IPv4 -{ - // - ULONG Encapsulation; - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_Encapsulation_ID 1 - - // - ULONG MaxOffLoadSize; - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_MaxOffLoadSize_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_MaxOffLoadSize_ID 2 - - // - ULONG MinSegmentCount; - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_MinSegmentCount_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_MinSegmentCount_ID 3 - - // - ULONG TcpOptions; - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_TcpOptions_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_TcpOptions_ID 4 - - // - ULONG IpOptions; - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_IpOptions_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_IpOptions_ID 5 - -} MSNdis_WmiTcpLargeSendOffloadV1_IPv4, *PMSNdis_WmiTcpLargeSendOffloadV1_IPv4; - -#define MSNdis_WmiTcpLargeSendOffloadV1_IPv4_SIZE (FIELD_OFFSET(MSNdis_WmiTcpLargeSendOffloadV1_IPv4, IpOptions) + MSNdis_WmiTcpLargeSendOffloadV1_IPv4_IpOptions_SIZE) - -// MSNdis_WmiTcpLargeSendOffloadV1 - MSNdis_WmiTcpLargeSendOffloadV1 -#define MSNdis_WmiTcpLargeSendOffloadV1Guid \ - { 0xb9e4e2f9,0xee89,0x4756, { 0xb0,0x57,0x38,0xf9,0xd9,0xb5,0x9a,0x92 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpLargeSendOffloadV1_GUID, \ - 0xb9e4e2f9,0xee89,0x4756,0xb0,0x57,0x38,0xf9,0xd9,0xb5,0x9a,0x92); -#endif - - -typedef struct _MSNdis_WmiTcpLargeSendOffloadV1 -{ - // - MSNdis_WmiTcpLargeSendOffloadV1_IPv4 WmiIPv4; - #define MSNdis_WmiTcpLargeSendOffloadV1_WmiIPv4_SIZE sizeof(MSNdis_WmiTcpLargeSendOffloadV1_IPv4) - #define MSNdis_WmiTcpLargeSendOffloadV1_WmiIPv4_ID 1 - -} MSNdis_WmiTcpLargeSendOffloadV1, *PMSNdis_WmiTcpLargeSendOffloadV1; - -#define MSNdis_WmiTcpLargeSendOffloadV1_SIZE (FIELD_OFFSET(MSNdis_WmiTcpLargeSendOffloadV1, WmiIPv4) + MSNdis_WmiTcpLargeSendOffloadV1_WmiIPv4_SIZE) - -// MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive - MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive -#define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceiveGuid \ - { 0xd63d537a,0x59c1,0x4fae, { 0x8f,0x9b,0xcd,0x9f,0xbb,0xec,0xb8,0x5a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_GUID, \ - 0xd63d537a,0x59c1,0x4fae,0x8f,0x9b,0xcd,0x9f,0xbb,0xec,0xb8,0x5a); -#endif - - -typedef struct _MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive -{ - // - ULONG Encapsulation; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_Encapsulation_ID 1 - - // - ULONG IpOptionsSupported; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_IpOptionsSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_IpOptionsSupported_ID 2 - - // - ULONG TcpOptionsSupported; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_TcpOptionsSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_TcpOptionsSupported_ID 3 - - // - ULONG TcpChecksum; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_TcpChecksum_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_TcpChecksum_ID 4 - - // - ULONG UdpChecksum; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_UdpChecksum_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_UdpChecksum_ID 5 - - // - ULONG IpChecksum; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_IpChecksum_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_IpChecksum_ID 6 - -} MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive, *PMSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive; - -#define MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_SIZE (FIELD_OFFSET(MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive, IpChecksum) + MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive_IpChecksum_SIZE) - -// MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive - MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive -#define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceiveGuid \ - { 0xb9760e75,0x6662,0x49e4, { 0xaa,0x6c,0xf0,0x28,0xbe,0xfe,0xc8,0xee } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_GUID, \ - 0xb9760e75,0x6662,0x49e4,0xaa,0x6c,0xf0,0x28,0xbe,0xfe,0xc8,0xee); -#endif - - -typedef struct _MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive -{ - // - ULONG Encapsulation; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_Encapsulation_ID 1 - - // - ULONG IpExtensionHeadersSupported; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_IpExtensionHeadersSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_IpExtensionHeadersSupported_ID 2 - - // - ULONG TcpOptionsSupported; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_TcpOptionsSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_TcpOptionsSupported_ID 3 - - // - ULONG TcpChecksum; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_TcpChecksum_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_TcpChecksum_ID 4 - - // - ULONG UdpChecksum; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_UdpChecksum_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_UdpChecksum_ID 5 - -} MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive, *PMSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive; - -#define MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_SIZE (FIELD_OFFSET(MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive, UdpChecksum) + MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive_UdpChecksum_SIZE) - -// MSNdis_WmiTcpIpChecksumOffload - MSNdis_WmiTcpIpChecksumOffload -#define MSNdis_WmiTcpIpChecksumOffloadGuid \ - { 0x189d4015,0x1b25,0x4d8e, { 0xa4,0xa9,0xf9,0xeb,0xa8,0x21,0x97,0xc7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpIpChecksumOffload_GUID, \ - 0x189d4015,0x1b25,0x4d8e,0xa4,0xa9,0xf9,0xeb,0xa8,0x21,0x97,0xc7); -#endif - - -typedef struct _MSNdis_WmiTcpIpChecksumOffload -{ - // - MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive IPv4Transmit; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4Transmit_SIZE sizeof(MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4Transmit_ID 1 - - // - MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive IPv4Receive; - #define MSNdis_WmiTcpIpChecksumOffload_IPv4Receive_SIZE sizeof(MSNdis_WmiTcpIpChecksumOffload_IPv4TransmitReceive) - #define MSNdis_WmiTcpIpChecksumOffload_IPv4Receive_ID 2 - - // - MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive IPv6Transmit; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6Transmit_SIZE sizeof(MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6Transmit_ID 3 - - // - MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive IPv6Receive; - #define MSNdis_WmiTcpIpChecksumOffload_IPv6Receive_SIZE sizeof(MSNdis_WmiTcpIpChecksumOffload_IPv6TransmitReceive) - #define MSNdis_WmiTcpIpChecksumOffload_IPv6Receive_ID 4 - -} MSNdis_WmiTcpIpChecksumOffload, *PMSNdis_WmiTcpIpChecksumOffload; - -#define MSNdis_WmiTcpIpChecksumOffload_SIZE (FIELD_OFFSET(MSNdis_WmiTcpIpChecksumOffload, IPv6Receive) + MSNdis_WmiTcpIpChecksumOffload_IPv6Receive_SIZE) - -// MSNdis_WmiIPSecOffloadV1_Supported - MSNdis_WmiIPSecOffloadV1_Supported -#define MSNdis_WmiIPSecOffloadV1_SupportedGuid \ - { 0xf86676b9,0xd9fa,0x4d26, { 0x95,0xce,0xbf,0xbc,0x77,0xd8,0x05,0x96 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiIPSecOffloadV1_Supported_GUID, \ - 0xf86676b9,0xd9fa,0x4d26,0x95,0xce,0xbf,0xbc,0x77,0xd8,0x05,0x96); -#endif - - -typedef struct _MSNdis_WmiIPSecOffloadV1_Supported -{ - // - ULONG Encapsulation; - #define MSNdis_WmiIPSecOffloadV1_Supported_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_Supported_Encapsulation_ID 1 - - // - ULONG AhEspCombined; - #define MSNdis_WmiIPSecOffloadV1_Supported_AhEspCombined_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_Supported_AhEspCombined_ID 2 - - // - ULONG TransportTunnelCombined; - #define MSNdis_WmiIPSecOffloadV1_Supported_TransportTunnelCombined_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_Supported_TransportTunnelCombined_ID 3 - - // - ULONG IPv4Options; - #define MSNdis_WmiIPSecOffloadV1_Supported_IPv4Options_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_Supported_IPv4Options_ID 4 - - // - ULONG Flags; - #define MSNdis_WmiIPSecOffloadV1_Supported_Flags_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_Supported_Flags_ID 5 - -} MSNdis_WmiIPSecOffloadV1_Supported, *PMSNdis_WmiIPSecOffloadV1_Supported; - -#define MSNdis_WmiIPSecOffloadV1_Supported_SIZE (FIELD_OFFSET(MSNdis_WmiIPSecOffloadV1_Supported, Flags) + MSNdis_WmiIPSecOffloadV1_Supported_Flags_SIZE) - -// MSNdis_WmiIPSecOffloadV1_IPv4AH - MSNdis_WmiIPSecOffloadV1_IPv4AH -#define MSNdis_WmiIPSecOffloadV1_IPv4AHGuid \ - { 0x29bacfdd,0xf063,0x48d8, { 0x95,0x2c,0xd3,0xdc,0x93,0x30,0x0f,0x15 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiIPSecOffloadV1_IPv4AH_GUID, \ - 0x29bacfdd,0xf063,0x48d8,0x95,0x2c,0xd3,0xdc,0x93,0x30,0x0f,0x15); -#endif - - -typedef struct _MSNdis_WmiIPSecOffloadV1_IPv4AH -{ - // - ULONG Md5; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Md5_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Md5_ID 1 - - // - ULONG Sha_1; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Sha_1_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Sha_1_ID 2 - - // - ULONG Transport; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Transport_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Transport_ID 3 - - // - ULONG Tunnel; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Tunnel_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Tunnel_ID 4 - - // - ULONG Send; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Send_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Send_ID 5 - - // - ULONG Receive; - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Receive_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4AH_Receive_ID 6 - -} MSNdis_WmiIPSecOffloadV1_IPv4AH, *PMSNdis_WmiIPSecOffloadV1_IPv4AH; - -#define MSNdis_WmiIPSecOffloadV1_IPv4AH_SIZE (FIELD_OFFSET(MSNdis_WmiIPSecOffloadV1_IPv4AH, Receive) + MSNdis_WmiIPSecOffloadV1_IPv4AH_Receive_SIZE) - -// MSNdis_WmiIPSecOffloadV1_IPv4ESP - MSNdis_WmiIPSecOffloadV1_IPv4ESP -#define MSNdis_WmiIPSecOffloadV1_IPv4ESPGuid \ - { 0x86522023,0x4536,0x4b58, { 0xa1,0xf4,0x25,0x38,0x94,0x1a,0xce,0x43 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiIPSecOffloadV1_IPv4ESP_GUID, \ - 0x86522023,0x4536,0x4b58,0xa1,0xf4,0x25,0x38,0x94,0x1a,0xce,0x43); -#endif - - -typedef struct _MSNdis_WmiIPSecOffloadV1_IPv4ESP -{ - // - ULONG Des; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Des_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Des_ID 1 - - // - ULONG Reserved; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Reserved_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Reserved_ID 2 - - // - ULONG TripleDes; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_TripleDes_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_TripleDes_ID 3 - - // - ULONG NullEsp; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_NullEsp_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_NullEsp_ID 4 - - // - ULONG Transport; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Transport_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Transport_ID 5 - - // - ULONG Tunnel; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Tunnel_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Tunnel_ID 6 - - // - ULONG Send; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Send_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Send_ID 7 - - // - ULONG Receive; - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Receive_SIZE sizeof(ULONG) - #define MSNdis_WmiIPSecOffloadV1_IPv4ESP_Receive_ID 8 - -} MSNdis_WmiIPSecOffloadV1_IPv4ESP, *PMSNdis_WmiIPSecOffloadV1_IPv4ESP; - -#define MSNdis_WmiIPSecOffloadV1_IPv4ESP_SIZE (FIELD_OFFSET(MSNdis_WmiIPSecOffloadV1_IPv4ESP, Receive) + MSNdis_WmiIPSecOffloadV1_IPv4ESP_Receive_SIZE) - -// MSNdis_WmiIPSecOffloadV1 - MSNdis_WmiIPSecOffloadV1 -#define MSNdis_WmiIPSecOffloadV1Guid \ - { 0x4ec63447,0x2238,0x43a7, { 0xac,0x33,0x11,0xc7,0xcc,0x7d,0x86,0x65 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiIPSecOffloadV1_GUID, \ - 0x4ec63447,0x2238,0x43a7,0xac,0x33,0x11,0xc7,0xcc,0x7d,0x86,0x65); -#endif - - -typedef struct _MSNdis_WmiIPSecOffloadV1 -{ - // - MSNdis_WmiIPSecOffloadV1_Supported WmiSupported; - #define MSNdis_WmiIPSecOffloadV1_WmiSupported_SIZE sizeof(MSNdis_WmiIPSecOffloadV1_Supported) - #define MSNdis_WmiIPSecOffloadV1_WmiSupported_ID 1 - - // - MSNdis_WmiIPSecOffloadV1_IPv4AH WmiIPv4AH; - #define MSNdis_WmiIPSecOffloadV1_WmiIPv4AH_SIZE sizeof(MSNdis_WmiIPSecOffloadV1_IPv4AH) - #define MSNdis_WmiIPSecOffloadV1_WmiIPv4AH_ID 2 - - // - MSNdis_WmiIPSecOffloadV1_IPv4ESP WmiIPv4ESP; - #define MSNdis_WmiIPSecOffloadV1_WmiIPv4ESP_SIZE sizeof(MSNdis_WmiIPSecOffloadV1_IPv4ESP) - #define MSNdis_WmiIPSecOffloadV1_WmiIPv4ESP_ID 3 - -} MSNdis_WmiIPSecOffloadV1, *PMSNdis_WmiIPSecOffloadV1; - -#define MSNdis_WmiIPSecOffloadV1_SIZE (FIELD_OFFSET(MSNdis_WmiIPSecOffloadV1, WmiIPv4ESP) + MSNdis_WmiIPSecOffloadV1_WmiIPv4ESP_SIZE) - -// MSNdis_WmiTcpLargeSendOffloadV2_IPv4 - MSNdis_WmiTcpLargeSendOffloadV2_IPv4 -#define MSNdis_WmiTcpLargeSendOffloadV2_IPv4Guid \ - { 0x8823d030,0xfa30,0x4b73, { 0xb3,0x39,0xdb,0x19,0x20,0x7f,0x0d,0x81 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpLargeSendOffloadV2_IPv4_GUID, \ - 0x8823d030,0xfa30,0x4b73,0xb3,0x39,0xdb,0x19,0x20,0x7f,0x0d,0x81); -#endif - - -typedef struct _MSNdis_WmiTcpLargeSendOffloadV2_IPv4 -{ - // - ULONG Encapsulation; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_Encapsulation_ID 1 - - // - ULONG MaxOffLoadSize; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_MaxOffLoadSize_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_MaxOffLoadSize_ID 2 - - // - ULONG MinSegmentCount; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_MinSegmentCount_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_MinSegmentCount_ID 3 - -} MSNdis_WmiTcpLargeSendOffloadV2_IPv4, *PMSNdis_WmiTcpLargeSendOffloadV2_IPv4; - -#define MSNdis_WmiTcpLargeSendOffloadV2_IPv4_SIZE (FIELD_OFFSET(MSNdis_WmiTcpLargeSendOffloadV2_IPv4, MinSegmentCount) + MSNdis_WmiTcpLargeSendOffloadV2_IPv4_MinSegmentCount_SIZE) - -// MSNdis_WmiTcpLargeSendOffloadV2_IPv6 - MSNdis_WmiTcpLargeSendOffloadV2_IPv6 -#define MSNdis_WmiTcpLargeSendOffloadV2_IPv6Guid \ - { 0xa7a9597c,0x2f8e,0x410b, { 0x9b,0xb3,0x5c,0x3a,0x50,0x79,0x2b,0xfc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpLargeSendOffloadV2_IPv6_GUID, \ - 0xa7a9597c,0x2f8e,0x410b,0x9b,0xb3,0x5c,0x3a,0x50,0x79,0x2b,0xfc); -#endif - - -typedef struct _MSNdis_WmiTcpLargeSendOffloadV2_IPv6 -{ - // - ULONG Encapsulation; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_Encapsulation_ID 1 - - // - ULONG MaxOffLoadSize; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_MaxOffLoadSize_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_MaxOffLoadSize_ID 2 - - // - ULONG MinSegmentCount; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_MinSegmentCount_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_MinSegmentCount_ID 3 - - // - ULONG IpExtensionHeadersSupported; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_IpExtensionHeadersSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_IpExtensionHeadersSupported_ID 4 - - // - ULONG TcpOptionsSupported; - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_TcpOptionsSupported_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_TcpOptionsSupported_ID 5 - -} MSNdis_WmiTcpLargeSendOffloadV2_IPv6, *PMSNdis_WmiTcpLargeSendOffloadV2_IPv6; - -#define MSNdis_WmiTcpLargeSendOffloadV2_IPv6_SIZE (FIELD_OFFSET(MSNdis_WmiTcpLargeSendOffloadV2_IPv6, TcpOptionsSupported) + MSNdis_WmiTcpLargeSendOffloadV2_IPv6_TcpOptionsSupported_SIZE) - -// MSNdis_WmiTcpLargeSendOffloadV2 - MSNdis_WmiTcpLargeSendOffloadV2 -#define MSNdis_WmiTcpLargeSendOffloadV2Guid \ - { 0x592977c2,0xcfbe,0x462c, { 0xb5,0xcf,0x1a,0x76,0x79,0xfe,0x1c,0xba } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpLargeSendOffloadV2_GUID, \ - 0x592977c2,0xcfbe,0x462c,0xb5,0xcf,0x1a,0x76,0x79,0xfe,0x1c,0xba); -#endif - - -typedef struct _MSNdis_WmiTcpLargeSendOffloadV2 -{ - // - MSNdis_WmiTcpLargeSendOffloadV2_IPv4 WmiIPv4; - #define MSNdis_WmiTcpLargeSendOffloadV2_WmiIPv4_SIZE sizeof(MSNdis_WmiTcpLargeSendOffloadV2_IPv4) - #define MSNdis_WmiTcpLargeSendOffloadV2_WmiIPv4_ID 1 - - // - MSNdis_WmiTcpLargeSendOffloadV2_IPv6 WmiIPv6; - #define MSNdis_WmiTcpLargeSendOffloadV2_WmiIPv6_SIZE sizeof(MSNdis_WmiTcpLargeSendOffloadV2_IPv6) - #define MSNdis_WmiTcpLargeSendOffloadV2_WmiIPv6_ID 2 - -} MSNdis_WmiTcpLargeSendOffloadV2, *PMSNdis_WmiTcpLargeSendOffloadV2; - -#define MSNdis_WmiTcpLargeSendOffloadV2_SIZE (FIELD_OFFSET(MSNdis_WmiTcpLargeSendOffloadV2, WmiIPv6) + MSNdis_WmiTcpLargeSendOffloadV2_WmiIPv6_SIZE) - -// MSNdis_WmiOffload - MSNdis_WmiOffload -#define MSNdis_WmiOffloadGuid \ - { 0x7a877086,0x2204,0x4a8a, { 0x92,0xa4,0xe3,0xe8,0xab,0x62,0x66,0x29 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiOffload_GUID, \ - 0x7a877086,0x2204,0x4a8a,0x92,0xa4,0xe3,0xe8,0xab,0x62,0x66,0x29); -#endif - - -typedef struct _MSNdis_WmiOffload -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiOffload_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiOffload_Header_ID 1 - - // - MSNdis_WmiTcpIpChecksumOffload Checksum; - #define MSNdis_WmiOffload_Checksum_SIZE sizeof(MSNdis_WmiTcpIpChecksumOffload) - #define MSNdis_WmiOffload_Checksum_ID 2 - - // - MSNdis_WmiTcpLargeSendOffloadV1 LsoV1; - #define MSNdis_WmiOffload_LsoV1_SIZE sizeof(MSNdis_WmiTcpLargeSendOffloadV1) - #define MSNdis_WmiOffload_LsoV1_ID 3 - - // - MSNdis_WmiIPSecOffloadV1 IPsecV1; - #define MSNdis_WmiOffload_IPsecV1_SIZE sizeof(MSNdis_WmiIPSecOffloadV1) - #define MSNdis_WmiOffload_IPsecV1_ID 4 - - // - MSNdis_WmiTcpLargeSendOffloadV2 LsoV2; - #define MSNdis_WmiOffload_LsoV2_SIZE sizeof(MSNdis_WmiTcpLargeSendOffloadV2) - #define MSNdis_WmiOffload_LsoV2_ID 5 - - // - ULONG Flags; - #define MSNdis_WmiOffload_Flags_SIZE sizeof(ULONG) - #define MSNdis_WmiOffload_Flags_ID 6 - -} MSNdis_WmiOffload, *PMSNdis_WmiOffload; - -#define MSNdis_WmiOffload_SIZE (FIELD_OFFSET(MSNdis_WmiOffload, Flags) + MSNdis_WmiOffload_Flags_SIZE) - -// MSNdis_TcpOffloadParameters - MSNdis_TcpOffloadParameters -#define MSNdis_TcpOffloadParametersGuid \ - { 0x43fe82d8,0x3468,0x497e, { 0x9d,0xcf,0xf8,0xff,0xc0,0x13,0x37,0x44 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TcpOffloadParameters_GUID, \ - 0x43fe82d8,0x3468,0x497e,0x9d,0xcf,0xf8,0xff,0xc0,0x13,0x37,0x44); -#endif - - -typedef struct _MSNdis_TcpOffloadParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_TcpOffloadParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_TcpOffloadParameters_Header_ID 1 - - // - UCHAR IPv4Checksum; - #define MSNdis_TcpOffloadParameters_IPv4Checksum_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_IPv4Checksum_ID 2 - - // - UCHAR TCPIPv4Checksum; - #define MSNdis_TcpOffloadParameters_TCPIPv4Checksum_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_TCPIPv4Checksum_ID 3 - - // - UCHAR UDPIPv4Checksum; - #define MSNdis_TcpOffloadParameters_UDPIPv4Checksum_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_UDPIPv4Checksum_ID 4 - - // - UCHAR TCPIPv6Checksum; - #define MSNdis_TcpOffloadParameters_TCPIPv6Checksum_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_TCPIPv6Checksum_ID 5 - - // - UCHAR UDPIPv6Checksum; - #define MSNdis_TcpOffloadParameters_UDPIPv6Checksum_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_UDPIPv6Checksum_ID 6 - - // - UCHAR LsoV1; - #define MSNdis_TcpOffloadParameters_LsoV1_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_LsoV1_ID 7 - - // - UCHAR IPsec; - #define MSNdis_TcpOffloadParameters_IPsec_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_IPsec_ID 8 - - // - UCHAR LsoV2IPv4; - #define MSNdis_TcpOffloadParameters_LsoV2IPv4_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_LsoV2IPv4_ID 9 - - // - UCHAR LsoV2IPv6; - #define MSNdis_TcpOffloadParameters_LsoV2IPv6_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_LsoV2IPv6_ID 10 - - // - UCHAR TcpConnectionIPv4; - #define MSNdis_TcpOffloadParameters_TcpConnectionIPv4_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_TcpConnectionIPv4_ID 11 - - // - UCHAR TcpConnectionIPv6; - #define MSNdis_TcpOffloadParameters_TcpConnectionIPv6_SIZE sizeof(UCHAR) - #define MSNdis_TcpOffloadParameters_TcpConnectionIPv6_ID 12 - - // - ULONG Flags; - #define MSNdis_TcpOffloadParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_TcpOffloadParameters_Flags_ID 13 - -} MSNdis_TcpOffloadParameters, *PMSNdis_TcpOffloadParameters; - -#define MSNdis_TcpOffloadParameters_SIZE (FIELD_OFFSET(MSNdis_TcpOffloadParameters, Flags) + MSNdis_TcpOffloadParameters_Flags_SIZE) - -// MSNdis_WmiTcpConnectionOffload - MSNdis_WmiTcpConnectionOffload -#define MSNdis_WmiTcpConnectionOffloadGuid \ - { 0x93cfcd3f,0x6228,0x455c, { 0x90,0x5e,0x3a,0xb8,0x0a,0x2f,0xf0,0x90 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiTcpConnectionOffload_GUID, \ - 0x93cfcd3f,0x6228,0x455c,0x90,0x5e,0x3a,0xb8,0x0a,0x2f,0xf0,0x90); -#endif - - -typedef struct _MSNdis_WmiTcpConnectionOffload -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiTcpConnectionOffload_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiTcpConnectionOffload_Header_ID 1 - - // - ULONG Encapsulation; - #define MSNdis_WmiTcpConnectionOffload_Encapsulation_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_Encapsulation_ID 2 - - // - ULONG SupportIp4; - #define MSNdis_WmiTcpConnectionOffload_SupportIp4_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_SupportIp4_ID 3 - - // - ULONG SupportIp6; - #define MSNdis_WmiTcpConnectionOffload_SupportIp6_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_SupportIp6_ID 4 - - // - ULONG SupportIp6ExtensionHeaders; - #define MSNdis_WmiTcpConnectionOffload_SupportIp6ExtensionHeaders_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_SupportIp6ExtensionHeaders_ID 5 - - // - ULONG SupportSack; - #define MSNdis_WmiTcpConnectionOffload_SupportSack_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_SupportSack_ID 6 - - // - ULONG TcpConnectionOffloadCapacity; - #define MSNdis_WmiTcpConnectionOffload_TcpConnectionOffloadCapacity_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_TcpConnectionOffloadCapacity_ID 7 - - // - ULONG Flags; - #define MSNdis_WmiTcpConnectionOffload_Flags_SIZE sizeof(ULONG) - #define MSNdis_WmiTcpConnectionOffload_Flags_ID 8 - -} MSNdis_WmiTcpConnectionOffload, *PMSNdis_WmiTcpConnectionOffload; - -#define MSNdis_WmiTcpConnectionOffload_SIZE (FIELD_OFFSET(MSNdis_WmiTcpConnectionOffload, Flags) + MSNdis_WmiTcpConnectionOffload_Flags_SIZE) - -// MSNdis_WmiHDSplitCurrentConfig - MSNdis_WmiHDSplitCurrentConfig -#define MSNdis_WmiHDSplitCurrentConfigGuid \ - { 0x34ff16bf,0x30ca,0x4a2a, { 0xa4,0x6d,0xc7,0xee,0x74,0xbc,0x35,0x82 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiHDSplitCurrentConfig_GUID, \ - 0x34ff16bf,0x30ca,0x4a2a,0xa4,0x6d,0xc7,0xee,0x74,0xbc,0x35,0x82); -#endif - - -typedef struct _MSNdis_WmiHDSplitCurrentConfig -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiHDSplitCurrentConfig_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiHDSplitCurrentConfig_Header_ID 1 - - // - ULONG HardwareCapabilities; - #define MSNdis_WmiHDSplitCurrentConfig_HardwareCapabilities_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_HardwareCapabilities_ID 2 - - // - ULONG CurrentCapabilities; - #define MSNdis_WmiHDSplitCurrentConfig_CurrentCapabilities_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_CurrentCapabilities_ID 3 - - // - ULONG HDSplitFlags; - #define MSNdis_WmiHDSplitCurrentConfig_HDSplitFlags_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_HDSplitFlags_ID 4 - - // - ULONG HDSplitCombineFlags; - #define MSNdis_WmiHDSplitCurrentConfig_HDSplitCombineFlags_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_HDSplitCombineFlags_ID 5 - - // - ULONG BackfillSize; - #define MSNdis_WmiHDSplitCurrentConfig_BackfillSize_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_BackfillSize_ID 6 - - // - ULONG MaxHeaderSize; - #define MSNdis_WmiHDSplitCurrentConfig_MaxHeaderSize_SIZE sizeof(ULONG) - #define MSNdis_WmiHDSplitCurrentConfig_MaxHeaderSize_ID 7 - -} MSNdis_WmiHDSplitCurrentConfig, *PMSNdis_WmiHDSplitCurrentConfig; - -#define MSNdis_WmiHDSplitCurrentConfig_SIZE (FIELD_OFFSET(MSNdis_WmiHDSplitCurrentConfig, MaxHeaderSize) + MSNdis_WmiHDSplitCurrentConfig_MaxHeaderSize_SIZE) - -// MSNdis_HDSplitParameters - MSNdis_HDSplitParameters -#define MSNdis_HDSplitParametersGuid \ - { 0x1131c56a,0x0a5a,0x4d79, { 0x8d,0xde,0x1e,0x6f,0x17,0x80,0x05,0xee } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_HDSplitParameters_GUID, \ - 0x1131c56a,0x0a5a,0x4d79,0x8d,0xde,0x1e,0x6f,0x17,0x80,0x05,0xee); -#endif - - -typedef struct _MSNdis_HDSplitParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_HDSplitParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_HDSplitParameters_Header_ID 1 - - // - ULONG HDSplitCombineFlags; - #define MSNdis_HDSplitParameters_HDSplitCombineFlags_SIZE sizeof(ULONG) - #define MSNdis_HDSplitParameters_HDSplitCombineFlags_ID 2 - -} MSNdis_HDSplitParameters, *PMSNdis_HDSplitParameters; - -#define MSNdis_HDSplitParameters_SIZE (FIELD_OFFSET(MSNdis_HDSplitParameters, HDSplitCombineFlags) + MSNdis_HDSplitParameters_HDSplitCombineFlags_SIZE) - -// MSNdis_WmiReceiveScaleCapabilities - MSNdis_WmiReceiveScaleCapabilities -#define MSNdis_WmiReceiveScaleCapabilitiesGuid \ - { 0xf7a4960a,0xace3,0x44dc, { 0xb5,0x1e,0x72,0xe0,0x5c,0x5e,0xaf,0xa8 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_WmiReceiveScaleCapabilities_GUID, \ - 0xf7a4960a,0xace3,0x44dc,0xb5,0x1e,0x72,0xe0,0x5c,0x5e,0xaf,0xa8); -#endif - - -typedef struct _MSNdis_WmiReceiveScaleCapabilities -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_WmiReceiveScaleCapabilities_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_WmiReceiveScaleCapabilities_Header_ID 1 - - // - ULONG CapabilitiesFlags; - #define MSNdis_WmiReceiveScaleCapabilities_CapabilitiesFlags_SIZE sizeof(ULONG) - #define MSNdis_WmiReceiveScaleCapabilities_CapabilitiesFlags_ID 2 - - // - ULONG NumberOfInterruptMessages; - #define MSNdis_WmiReceiveScaleCapabilities_NumberOfInterruptMessages_SIZE sizeof(ULONG) - #define MSNdis_WmiReceiveScaleCapabilities_NumberOfInterruptMessages_ID 3 - - // - ULONG NumberOfReceiveQueues; - #define MSNdis_WmiReceiveScaleCapabilities_NumberOfReceiveQueues_SIZE sizeof(ULONG) - #define MSNdis_WmiReceiveScaleCapabilities_NumberOfReceiveQueues_ID 4 - -} MSNdis_WmiReceiveScaleCapabilities, *PMSNdis_WmiReceiveScaleCapabilities; - -#define MSNdis_WmiReceiveScaleCapabilities_SIZE (FIELD_OFFSET(MSNdis_WmiReceiveScaleCapabilities, NumberOfReceiveQueues) + MSNdis_WmiReceiveScaleCapabilities_NumberOfReceiveQueues_SIZE) - -// MSNdis_ReceiveFilterCapabilities - MSNdis_ReceiveFilterCapabilities -#define MSNdis_ReceiveFilterCapabilitiesGuid \ - { 0x146360a3,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterCapabilities_GUID, \ - 0x146360a3,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterCapabilities -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterCapabilities_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterCapabilities_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveFilterCapabilities_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_Flags_ID 2 - - // - ULONG EnabledFilterTypes; - #define MSNdis_ReceiveFilterCapabilities_EnabledFilterTypes_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_EnabledFilterTypes_ID 3 - - // - ULONG EnabledQueueTypes; - #define MSNdis_ReceiveFilterCapabilities_EnabledQueueTypes_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_EnabledQueueTypes_ID 4 - - // - ULONG NumQueues; - #define MSNdis_ReceiveFilterCapabilities_NumQueues_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_NumQueues_ID 5 - - // - ULONG SupportedQueueProperties; - #define MSNdis_ReceiveFilterCapabilities_SupportedQueueProperties_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_SupportedQueueProperties_ID 6 - - // - ULONG SupportedFilterTests; - #define MSNdis_ReceiveFilterCapabilities_SupportedFilterTests_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_SupportedFilterTests_ID 7 - - // - ULONG SupportedHeaders; - #define MSNdis_ReceiveFilterCapabilities_SupportedHeaders_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_SupportedHeaders_ID 8 - - // - ULONG SupportedMacHeaderFields; - #define MSNdis_ReceiveFilterCapabilities_SupportedMacHeaderFields_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_SupportedMacHeaderFields_ID 9 - - // - ULONG MaxMacHeaderFilters; - #define MSNdis_ReceiveFilterCapabilities_MaxMacHeaderFilters_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_MaxMacHeaderFilters_ID 10 - - // - ULONG MaxQueueGroups; - #define MSNdis_ReceiveFilterCapabilities_MaxQueueGroups_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_MaxQueueGroups_ID 11 - - // - ULONG MaxQueuesPerQueueGroup; - #define MSNdis_ReceiveFilterCapabilities_MaxQueuesPerQueueGroup_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_MaxQueuesPerQueueGroup_ID 12 - - // - ULONG MinLookaheadSplitSize; - #define MSNdis_ReceiveFilterCapabilities_MinLookaheadSplitSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_MinLookaheadSplitSize_ID 13 - - // - ULONG MaxLookaheadSplitSize; - #define MSNdis_ReceiveFilterCapabilities_MaxLookaheadSplitSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterCapabilities_MaxLookaheadSplitSize_ID 14 - -} MSNdis_ReceiveFilterCapabilities, *PMSNdis_ReceiveFilterCapabilities; - -#define MSNdis_ReceiveFilterCapabilities_SIZE (FIELD_OFFSET(MSNdis_ReceiveFilterCapabilities, MaxLookaheadSplitSize) + MSNdis_ReceiveFilterCapabilities_MaxLookaheadSplitSize_SIZE) - -// MSNdis_ReceiveFilterGlobalParameters - MSNdis_ReceiveFilterGlobalParameters -#define MSNdis_ReceiveFilterGlobalParametersGuid \ - { 0x146360a4,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterGlobalParameters_GUID, \ - 0x146360a4,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterGlobalParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterGlobalParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterGlobalParameters_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveFilterGlobalParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterGlobalParameters_Flags_ID 2 - - // - ULONG EnabledFilterTypes; - #define MSNdis_ReceiveFilterGlobalParameters_EnabledFilterTypes_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterGlobalParameters_EnabledFilterTypes_ID 3 - - // - ULONG EnabledQueueTypes; - #define MSNdis_ReceiveFilterGlobalParameters_EnabledQueueTypes_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterGlobalParameters_EnabledQueueTypes_ID 4 - -} MSNdis_ReceiveFilterGlobalParameters, *PMSNdis_ReceiveFilterGlobalParameters; - -#define MSNdis_ReceiveFilterGlobalParameters_SIZE (FIELD_OFFSET(MSNdis_ReceiveFilterGlobalParameters, EnabledQueueTypes) + MSNdis_ReceiveFilterGlobalParameters_EnabledQueueTypes_SIZE) - -// MSNdis_CountedString - MSNdis_CountedString -#define MSNdis_CountedStringGuid \ - { 0x146360a5,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_CountedString_GUID, \ - 0x146360a5,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_CountedString -{ - // - USHORT Length; - #define MSNdis_CountedString_Length_SIZE sizeof(USHORT) - #define MSNdis_CountedString_Length_ID 1 - - // - SHORT String[257]; - #define MSNdis_CountedString_String_SIZE sizeof(SHORT[257]) - #define MSNdis_CountedString_String_ID 2 - -} MSNdis_CountedString, *PMSNdis_CountedString; - -#define MSNdis_CountedString_SIZE (FIELD_OFFSET(MSNdis_CountedString, String) + MSNdis_CountedString_String_SIZE) - -// MSNdis_ReceiveFilterInfo - MSNdis_ReceiveFilterInfo -#define MSNdis_ReceiveFilterInfoGuid \ - { 0x146360a9,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterInfo_GUID, \ - 0x146360a9,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterInfo -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterInfo_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterInfo_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveFilterInfo_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfo_Flags_ID 2 - - // - ULONG FilterType; - #define MSNdis_ReceiveFilterInfo_FilterType_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfo_FilterType_ID 3 - - // - ULONG FilterId; - #define MSNdis_ReceiveFilterInfo_FilterId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfo_FilterId_ID 4 - -} MSNdis_ReceiveFilterInfo, *PMSNdis_ReceiveFilterInfo; - -#define MSNdis_ReceiveFilterInfo_SIZE (FIELD_OFFSET(MSNdis_ReceiveFilterInfo, FilterId) + MSNdis_ReceiveFilterInfo_FilterId_SIZE) - -// MSNdis_ReceiveFilterInfoArray - MSNdis_ReceiveFilterInfoArray -#define MSNdis_ReceiveFilterInfoArrayGuid \ - { 0x146360aa,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterInfoArray_GUID, \ - 0x146360aa,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterInfoArray -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterInfoArray_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterInfoArray_Header_ID 1 - - // - ULONG QueueId; - #define MSNdis_ReceiveFilterInfoArray_QueueId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfoArray_QueueId_ID 2 - - // - ULONG FirstElementOffset; - #define MSNdis_ReceiveFilterInfoArray_FirstElementOffset_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfoArray_FirstElementOffset_ID 3 - - // - ULONG NumElements; - #define MSNdis_ReceiveFilterInfoArray_NumElements_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfoArray_NumElements_ID 4 - - // - ULONG ElementSize; - #define MSNdis_ReceiveFilterInfoArray_ElementSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterInfoArray_ElementSize_ID 5 - - // - MSNdis_ReceiveFilterInfo Filter[1]; - #define MSNdis_ReceiveFilterInfoArray_Filter_ID 6 - -} MSNdis_ReceiveFilterInfoArray, *PMSNdis_ReceiveFilterInfoArray; - -// MSNdis_ReceiveFilterFieldParameters - MSNdis_ReceiveFilterFieldParameters -#define MSNdis_ReceiveFilterFieldParametersGuid \ - { 0x146360ab,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterFieldParameters_GUID, \ - 0x146360ab,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterFieldParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterFieldParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterFieldParameters_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveFilterFieldParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterFieldParameters_Flags_ID 2 - - // - ULONG FrameHeader; - #define MSNdis_ReceiveFilterFieldParameters_FrameHeader_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterFieldParameters_FrameHeader_ID 3 - - // - ULONG ReceiveFilterTest; - #define MSNdis_ReceiveFilterFieldParameters_ReceiveFilterTest_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterFieldParameters_ReceiveFilterTest_ID 4 - - // - ULONG MacHeaderField; - #define MSNdis_ReceiveFilterFieldParameters_MacHeaderField_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterFieldParameters_MacHeaderField_ID 5 - - // - UCHAR FieldByteArrayValue[16]; - #define MSNdis_ReceiveFilterFieldParameters_FieldByteArrayValue_SIZE sizeof(UCHAR[16]) - #define MSNdis_ReceiveFilterFieldParameters_FieldByteArrayValue_ID 6 - - // - UCHAR ResultByteArrayValue[16]; - #define MSNdis_ReceiveFilterFieldParameters_ResultByteArrayValue_SIZE sizeof(UCHAR[16]) - #define MSNdis_ReceiveFilterFieldParameters_ResultByteArrayValue_ID 7 - -} MSNdis_ReceiveFilterFieldParameters, *PMSNdis_ReceiveFilterFieldParameters; - -#define MSNdis_ReceiveFilterFieldParameters_SIZE (FIELD_OFFSET(MSNdis_ReceiveFilterFieldParameters, ResultByteArrayValue) + MSNdis_ReceiveFilterFieldParameters_ResultByteArrayValue_SIZE) - -// MSNdis_ReceiveFilterParameters - MSNdis_ReceiveFilterParameters -#define MSNdis_ReceiveFilterParametersGuid \ - { 0x146360ac,0x88dd,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveFilterParameters_GUID, \ - 0x146360ac,0x88dd,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveFilterParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveFilterParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveFilterParameters_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveFilterParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_Flags_ID 2 - - // - ULONG FilterType; - #define MSNdis_ReceiveFilterParameters_FilterType_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_FilterType_ID 3 - - // - ULONG QueueId; - #define MSNdis_ReceiveFilterParameters_QueueId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_QueueId_ID 4 - - // - ULONG FilterId; - #define MSNdis_ReceiveFilterParameters_FilterId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_FilterId_ID 5 - - // - ULONG FieldParametersArrayOffset; - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayOffset_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayOffset_ID 6 - - // - ULONG FieldParametersArrayNumElements; - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayNumElements_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayNumElements_ID 7 - - // - ULONG FieldParametersArrayElementSize; - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayElementSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_FieldParametersArrayElementSize_ID 8 - - // - ULONG RequestedFilterIdBitCount; - #define MSNdis_ReceiveFilterParameters_RequestedFilterIdBitCount_SIZE sizeof(ULONG) - #define MSNdis_ReceiveFilterParameters_RequestedFilterIdBitCount_ID 9 - - // - MSNdis_ReceiveFilterFieldParameters FieldParameters[1]; - #define MSNdis_ReceiveFilterParameters_FieldParameters_ID 10 - -} MSNdis_ReceiveFilterParameters, *PMSNdis_ReceiveFilterParameters; - -// MSNdis_NicSwitchCapabilities - MSNdis_NicSwitchCapabilities -#define MSNdis_NicSwitchCapabilitiesGuid \ - { 0xdb80dd1c,0x59ae,0x48e7, { 0xb7,0xec,0xf9,0xbe,0x2c,0x4b,0x8c,0xb0 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_NicSwitchCapabilities_GUID, \ - 0xdb80dd1c,0x59ae,0x48e7,0xb7,0xec,0xf9,0xbe,0x2c,0x4b,0x8c,0xb0); -#endif - - -typedef struct _MSNdis_NicSwitchCapabilities -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_NicSwitchCapabilities_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_NicSwitchCapabilities_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_NicSwitchCapabilities_Flags_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_Flags_ID 2 - - // - ULONG NdisReserved1; - #define MSNdis_NicSwitchCapabilities_NdisReserved1_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NdisReserved1_ID 3 - - // - ULONG NumTotalMacAddresses; - #define MSNdis_NicSwitchCapabilities_NumTotalMacAddresses_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NumTotalMacAddresses_ID 4 - - // - ULONG NumMacAddressesPerPort; - #define MSNdis_NicSwitchCapabilities_NumMacAddressesPerPort_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NumMacAddressesPerPort_ID 5 - - // - ULONG NumVlansPerPort; - #define MSNdis_NicSwitchCapabilities_NumVlansPerPort_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NumVlansPerPort_ID 6 - - // - ULONG NdisReserved2; - #define MSNdis_NicSwitchCapabilities_NdisReserved2_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NdisReserved2_ID 7 - - // - ULONG NdisReserved3; - #define MSNdis_NicSwitchCapabilities_NdisReserved3_SIZE sizeof(ULONG) - #define MSNdis_NicSwitchCapabilities_NdisReserved3_ID 8 - -} MSNdis_NicSwitchCapabilities, *PMSNdis_NicSwitchCapabilities; - -#define MSNdis_NicSwitchCapabilities_SIZE (FIELD_OFFSET(MSNdis_NicSwitchCapabilities, NdisReserved3) + MSNdis_NicSwitchCapabilities_NdisReserved3_SIZE) - -// MSNdis_GroupAffinity - MSNdis_GroupAffinity -#define MSNdis_GroupAffinityGuid \ - { 0xf786fbd5,0xc049,0x11dd, { 0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_GroupAffinity_GUID, \ - 0xf786fbd5,0xc049,0x11dd,0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_GroupAffinity -{ - // - ULONGLONG Mask; - #define MSNdis_GroupAffinity_Mask_SIZE sizeof(ULONGLONG) - #define MSNdis_GroupAffinity_Mask_ID 1 - - // - USHORT Group; - #define MSNdis_GroupAffinity_Group_SIZE sizeof(USHORT) - #define MSNdis_GroupAffinity_Group_ID 2 - - // - USHORT Reserved[3]; - #define MSNdis_GroupAffinity_Reserved_SIZE sizeof(USHORT[3]) - #define MSNdis_GroupAffinity_Reserved_ID 3 - -} MSNdis_GroupAffinity, *PMSNdis_GroupAffinity; - -#define MSNdis_GroupAffinity_SIZE (FIELD_OFFSET(MSNdis_GroupAffinity, Reserved) + MSNdis_GroupAffinity_Reserved_SIZE) - -// MSNdis_ReceiveQueueParameters - MSNdis_ReceiveQueueParameters -#define MSNdis_ReceiveQueueParametersGuid \ - { 0xf786fbd6,0xc049,0x11dd, { 0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveQueueParameters_GUID, \ - 0xf786fbd6,0xc049,0x11dd,0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveQueueParameters -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveQueueParameters_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveQueueParameters_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveQueueParameters_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_Flags_ID 2 - - // - ULONG QueueType; - #define MSNdis_ReceiveQueueParameters_QueueType_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_QueueType_ID 3 - - // - ULONG QueueId; - #define MSNdis_ReceiveQueueParameters_QueueId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_QueueId_ID 4 - - // - ULONG QueueGroupId; - #define MSNdis_ReceiveQueueParameters_QueueGroupId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_QueueGroupId_ID 5 - - // - MSNdis_GroupAffinity ProcessorAffinity; - #define MSNdis_ReceiveQueueParameters_ProcessorAffinity_SIZE sizeof(MSNdis_GroupAffinity) - #define MSNdis_ReceiveQueueParameters_ProcessorAffinity_ID 6 - - // - ULONG NumSuggestedReceiveBuffers; - #define MSNdis_ReceiveQueueParameters_NumSuggestedReceiveBuffers_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_NumSuggestedReceiveBuffers_ID 7 - - // - ULONG MSIXTableEntry; - #define MSNdis_ReceiveQueueParameters_MSIXTableEntry_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_MSIXTableEntry_ID 8 - - // - ULONG LookaheadSize; - #define MSNdis_ReceiveQueueParameters_LookaheadSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueParameters_LookaheadSize_ID 9 - - // - MSNdis_CountedString VmName; - #define MSNdis_ReceiveQueueParameters_VmName_SIZE sizeof(MSNdis_CountedString) - #define MSNdis_ReceiveQueueParameters_VmName_ID 10 - - // - MSNdis_CountedString QueueName; - #define MSNdis_ReceiveQueueParameters_QueueName_SIZE sizeof(MSNdis_CountedString) - #define MSNdis_ReceiveQueueParameters_QueueName_ID 11 - -} MSNdis_ReceiveQueueParameters, *PMSNdis_ReceiveQueueParameters; - -#define MSNdis_ReceiveQueueParameters_SIZE (FIELD_OFFSET(MSNdis_ReceiveQueueParameters, QueueName) + MSNdis_ReceiveQueueParameters_QueueName_SIZE) - -// MSNdis_ReceiveQueueInfo - MSNdis_ReceiveQueueInfo -#define MSNdis_ReceiveQueueInfoGuid \ - { 0xf786fbd7,0xc049,0x11dd, { 0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveQueueInfo_GUID, \ - 0xf786fbd7,0xc049,0x11dd,0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveQueueInfo -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveQueueInfo_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveQueueInfo_Header_ID 1 - - // - ULONG Flags; - #define MSNdis_ReceiveQueueInfo_Flags_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_Flags_ID 2 - - // - ULONG QueueType; - #define MSNdis_ReceiveQueueInfo_QueueType_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_QueueType_ID 3 - - // - ULONG QueueId; - #define MSNdis_ReceiveQueueInfo_QueueId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_QueueId_ID 4 - - // - ULONG QueueGroupId; - #define MSNdis_ReceiveQueueInfo_QueueGroupId_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_QueueGroupId_ID 5 - - // - ULONG QueueState; - #define MSNdis_ReceiveQueueInfo_QueueState_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_QueueState_ID 6 - - // - MSNdis_GroupAffinity ProcessorAffinity; - #define MSNdis_ReceiveQueueInfo_ProcessorAffinity_SIZE sizeof(MSNdis_GroupAffinity) - #define MSNdis_ReceiveQueueInfo_ProcessorAffinity_ID 7 - - // - ULONG NumSuggestedReceiveBuffers; - #define MSNdis_ReceiveQueueInfo_NumSuggestedReceiveBuffers_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_NumSuggestedReceiveBuffers_ID 8 - - // - ULONG MSIXTableEntry; - #define MSNdis_ReceiveQueueInfo_MSIXTableEntry_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_MSIXTableEntry_ID 9 - - // - ULONG LookaheadSize; - #define MSNdis_ReceiveQueueInfo_LookaheadSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfo_LookaheadSize_ID 10 - - // - MSNdis_CountedString VmName; - #define MSNdis_ReceiveQueueInfo_VmName_SIZE sizeof(MSNdis_CountedString) - #define MSNdis_ReceiveQueueInfo_VmName_ID 11 - - // - MSNdis_CountedString QueueName; - #define MSNdis_ReceiveQueueInfo_QueueName_SIZE sizeof(MSNdis_CountedString) - #define MSNdis_ReceiveQueueInfo_QueueName_ID 12 - -} MSNdis_ReceiveQueueInfo, *PMSNdis_ReceiveQueueInfo; - -#define MSNdis_ReceiveQueueInfo_SIZE (FIELD_OFFSET(MSNdis_ReceiveQueueInfo, QueueName) + MSNdis_ReceiveQueueInfo_QueueName_SIZE) - -// MSNdis_ReceiveQueueInfoArray - MSNdis_ReceiveQueueInfoArray -#define MSNdis_ReceiveQueueInfoArrayGuid \ - { 0xf786fbd8,0xc049,0x11dd, { 0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveQueueInfoArray_GUID, \ - 0xf786fbd8,0xc049,0x11dd,0xb8,0x85,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - - -typedef struct _MSNdis_ReceiveQueueInfoArray -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_ReceiveQueueInfoArray_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_ReceiveQueueInfoArray_Header_ID 1 - - // - ULONG FirstElementOffset; - #define MSNdis_ReceiveQueueInfoArray_FirstElementOffset_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfoArray_FirstElementOffset_ID 2 - - // - ULONG NumElements; - #define MSNdis_ReceiveQueueInfoArray_NumElements_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfoArray_NumElements_ID 3 - - // - ULONG ElementSize; - #define MSNdis_ReceiveQueueInfoArray_ElementSize_SIZE sizeof(ULONG) - #define MSNdis_ReceiveQueueInfoArray_ElementSize_ID 4 - - // - MSNdis_ReceiveQueueInfo Queue[1]; - #define MSNdis_ReceiveQueueInfoArray_Queue_ID 5 - -} MSNdis_ReceiveQueueInfoArray, *PMSNdis_ReceiveQueueInfoArray; - -// MSNdis_LinkState - MSNdis_LinkState -#define MSNdis_LinkStateGuid \ - { 0xba1f4c14,0xa945,0x4762, { 0xb9,0x16,0x0b,0x55,0x15,0xb6,0xf4,0x3a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_LinkState_GUID, \ - 0xba1f4c14,0xa945,0x4762,0xb9,0x16,0x0b,0x55,0x15,0xb6,0xf4,0x3a); -#endif - -// -// Method id definitions for MSNdis_LinkState -#define WmiQueryLinkState 1 -typedef struct _WmiQueryLinkState_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryLinkState_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryLinkState_IN_Header_ID 1 - -} WmiQueryLinkState_IN, *PWmiQueryLinkState_IN; - -#define WmiQueryLinkState_IN_SIZE (FIELD_OFFSET(WmiQueryLinkState_IN, Header) + WmiQueryLinkState_IN_Header_SIZE) - -typedef struct _WmiQueryLinkState_OUT -{ - // - MSNdis_LinkStateData LinkState; - #define WmiQueryLinkState_OUT_LinkState_SIZE sizeof(MSNdis_LinkStateData) - #define WmiQueryLinkState_OUT_LinkState_ID 2 - -} WmiQueryLinkState_OUT, *PWmiQueryLinkState_OUT; - -#define WmiQueryLinkState_OUT_SIZE (FIELD_OFFSET(WmiQueryLinkState_OUT, LinkState) + WmiQueryLinkState_OUT_LinkState_SIZE) - - -// MSNdis_QueryInterruptModeration - MSNdis_QueryInterruptModeration -#define MSNdis_QueryInterruptModerationGuid \ - { 0xd9c8eea5,0xf16e,0x467c, { 0x84,0xd5,0x63,0x45,0xa2,0x2c,0xe2,0x13 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryInterruptModeration_GUID, \ - 0xd9c8eea5,0xf16e,0x467c,0x84,0xd5,0x63,0x45,0xa2,0x2c,0xe2,0x13); -#endif - -// -// Method id definitions for MSNdis_QueryInterruptModeration -#define WmiQueryInterruptModeration 1 -typedef struct _WmiQueryInterruptModeration_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryInterruptModeration_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryInterruptModeration_IN_Header_ID 1 - -} WmiQueryInterruptModeration_IN, *PWmiQueryInterruptModeration_IN; - -#define WmiQueryInterruptModeration_IN_SIZE (FIELD_OFFSET(WmiQueryInterruptModeration_IN, Header) + WmiQueryInterruptModeration_IN_Header_SIZE) - -typedef struct _WmiQueryInterruptModeration_OUT -{ - // - MSNdis_InterruptModerationParameters InterruptModeration; - #define WmiQueryInterruptModeration_OUT_InterruptModeration_SIZE sizeof(MSNdis_InterruptModerationParameters) - #define WmiQueryInterruptModeration_OUT_InterruptModeration_ID 2 - -} WmiQueryInterruptModeration_OUT, *PWmiQueryInterruptModeration_OUT; - -#define WmiQueryInterruptModeration_OUT_SIZE (FIELD_OFFSET(WmiQueryInterruptModeration_OUT, InterruptModeration) + WmiQueryInterruptModeration_OUT_InterruptModeration_SIZE) - - -// MSNdis_SetInterruptModeration - MSNdis_SetInterruptModeration -#define MSNdis_SetInterruptModerationGuid \ - { 0xd789adfa,0x9c56,0x433b, { 0xad,0x01,0x75,0x74,0xf3,0xce,0xdb,0xe9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_SetInterruptModeration_GUID, \ - 0xd789adfa,0x9c56,0x433b,0xad,0x01,0x75,0x74,0xf3,0xce,0xdb,0xe9); -#endif - -// -// Method id definitions for MSNdis_SetInterruptModeration -#define WmiSetInterruptModeration 1 -typedef struct _WmiSetInterruptModeration_IN -{ - // - MSNdis_WmiMethodHeader MethodHeader; - #define WmiSetInterruptModeration_IN_MethodHeader_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiSetInterruptModeration_IN_MethodHeader_ID 1 - - // - MSNdis_InterruptModerationParameters InterruptModeration; - #define WmiSetInterruptModeration_IN_InterruptModeration_SIZE sizeof(MSNdis_InterruptModerationParameters) - #define WmiSetInterruptModeration_IN_InterruptModeration_ID 2 - -} WmiSetInterruptModeration_IN, *PWmiSetInterruptModeration_IN; - -#define WmiSetInterruptModeration_IN_SIZE (FIELD_OFFSET(WmiSetInterruptModeration_IN, InterruptModeration) + WmiSetInterruptModeration_IN_InterruptModeration_SIZE) - -typedef struct _WmiSetInterruptModeration_OUT -{ - // - MSNdis_WmiOutputInfo OutputInfo; - #define WmiSetInterruptModeration_OUT_OutputInfo_SIZE sizeof(MSNdis_WmiOutputInfo) - #define WmiSetInterruptModeration_OUT_OutputInfo_ID 3 - -} WmiSetInterruptModeration_OUT, *PWmiSetInterruptModeration_OUT; - -#define WmiSetInterruptModeration_OUT_SIZE (FIELD_OFFSET(WmiSetInterruptModeration_OUT, OutputInfo) + WmiSetInterruptModeration_OUT_OutputInfo_SIZE) - - -// MSNdis_SetLinkParameters - MSNdis_SetLinkParameters -#define MSNdis_SetLinkParametersGuid \ - { 0x8c7d3579,0x252b,0x4614, { 0x82,0xc5,0xa6,0x50,0xda,0xa1,0x50,0x49 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_SetLinkParameters_GUID, \ - 0x8c7d3579,0x252b,0x4614,0x82,0xc5,0xa6,0x50,0xda,0xa1,0x50,0x49); -#endif - -// -// Method id definitions for MSNdis_SetLinkParameters -#define WmiSetLinkParameters 1 -typedef struct _WmiSetLinkParameters_IN -{ - // - MSNdis_WmiMethodHeader MethodHeader; - #define WmiSetLinkParameters_IN_MethodHeader_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiSetLinkParameters_IN_MethodHeader_ID 1 - - // - MSNdis_LinkParameters LinkParameters; - #define WmiSetLinkParameters_IN_LinkParameters_SIZE sizeof(MSNdis_LinkParameters) - #define WmiSetLinkParameters_IN_LinkParameters_ID 2 - -} WmiSetLinkParameters_IN, *PWmiSetLinkParameters_IN; - -#define WmiSetLinkParameters_IN_SIZE (FIELD_OFFSET(WmiSetLinkParameters_IN, LinkParameters) + WmiSetLinkParameters_IN_LinkParameters_SIZE) - -typedef struct _WmiSetLinkParameters_OUT -{ - // - MSNdis_WmiOutputInfo OutputInfo; - #define WmiSetLinkParameters_OUT_OutputInfo_SIZE sizeof(MSNdis_WmiOutputInfo) - #define WmiSetLinkParameters_OUT_OutputInfo_ID 3 - -} WmiSetLinkParameters_OUT, *PWmiSetLinkParameters_OUT; - -#define WmiSetLinkParameters_OUT_SIZE (FIELD_OFFSET(WmiSetLinkParameters_OUT, OutputInfo) + WmiSetLinkParameters_OUT_OutputInfo_SIZE) - - -// MSNdis_QueryStatisticsInfo - MSNdis_QueryStatisticsInfo -#define MSNdis_QueryStatisticsInfoGuid \ - { 0x368c45b5,0xc129,0x43c1, { 0x93,0x9e,0x7e,0xdc,0x2d,0x7f,0xe6,0x21 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryStatisticsInfo_GUID, \ - 0x368c45b5,0xc129,0x43c1,0x93,0x9e,0x7e,0xdc,0x2d,0x7f,0xe6,0x21); -#endif - -// -// Method id definitions for MSNdis_QueryStatisticsInfo -#define WmiQueryStatisticsInfo 1 -typedef struct _WmiQueryStatisticsInfo_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryStatisticsInfo_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryStatisticsInfo_IN_Header_ID 1 - -} WmiQueryStatisticsInfo_IN, *PWmiQueryStatisticsInfo_IN; - -#define WmiQueryStatisticsInfo_IN_SIZE (FIELD_OFFSET(WmiQueryStatisticsInfo_IN, Header) + WmiQueryStatisticsInfo_IN_Header_SIZE) - -typedef struct _WmiQueryStatisticsInfo_OUT -{ - // - MSNdis_StatisticsInfo StatisticsInfo; - #define WmiQueryStatisticsInfo_OUT_StatisticsInfo_SIZE sizeof(MSNdis_StatisticsInfo) - #define WmiQueryStatisticsInfo_OUT_StatisticsInfo_ID 2 - -} WmiQueryStatisticsInfo_OUT, *PWmiQueryStatisticsInfo_OUT; - -#define WmiQueryStatisticsInfo_OUT_SIZE (FIELD_OFFSET(WmiQueryStatisticsInfo_OUT, StatisticsInfo) + WmiQueryStatisticsInfo_OUT_StatisticsInfo_SIZE) - - -// MSNdis_QueryPortState - MSNdis_QueryPortState -#define MSNdis_QueryPortStateGuid \ - { 0x6fbf2a5f,0x8b8f,0x4920, { 0x81,0x43,0xe6,0xc4,0x60,0xf5,0x25,0x24 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryPortState_GUID, \ - 0x6fbf2a5f,0x8b8f,0x4920,0x81,0x43,0xe6,0xc4,0x60,0xf5,0x25,0x24); -#endif - -// -// Method id definitions for MSNdis_QueryPortState -#define WmiQueryPortState 1 -typedef struct _WmiQueryPortState_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryPortState_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryPortState_IN_Header_ID 1 - -} WmiQueryPortState_IN, *PWmiQueryPortState_IN; - -#define WmiQueryPortState_IN_SIZE (FIELD_OFFSET(WmiQueryPortState_IN, Header) + WmiQueryPortState_IN_Header_SIZE) - -typedef struct _WmiQueryPortState_OUT -{ - // - MSNdis_PortStateData PortState; - #define WmiQueryPortState_OUT_PortState_SIZE sizeof(MSNdis_PortStateData) - #define WmiQueryPortState_OUT_PortState_ID 2 - -} WmiQueryPortState_OUT, *PWmiQueryPortState_OUT; - -#define WmiQueryPortState_OUT_SIZE (FIELD_OFFSET(WmiQueryPortState_OUT, PortState) + WmiQueryPortState_OUT_PortState_SIZE) - - -// MSNdis_EnumeratePorts - MSNdis_EnumeratePorts -#define MSNdis_EnumeratePortsGuid \ - { 0xf1d6abe8,0x15e4,0x4407, { 0x81,0xb7,0x6b,0x83,0x0c,0x77,0x7c,0xd9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EnumeratePorts_GUID, \ - 0xf1d6abe8,0x15e4,0x4407,0x81,0xb7,0x6b,0x83,0x0c,0x77,0x7c,0xd9); -#endif - -// -// Method id definitions for MSNdis_EnumeratePorts -#define WmiEnumeratePorts 1 -typedef struct _WmiEnumeratePorts_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiEnumeratePorts_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiEnumeratePorts_IN_Header_ID 1 - -} WmiEnumeratePorts_IN, *PWmiEnumeratePorts_IN; - -#define WmiEnumeratePorts_IN_SIZE (FIELD_OFFSET(WmiEnumeratePorts_IN, Header) + WmiEnumeratePorts_IN_Header_SIZE) - -typedef struct _WmiEnumeratePorts_OUT -{ - // - MSNdis_PortArray Ports; - #define WmiEnumeratePorts_OUT_Ports_SIZE sizeof(MSNdis_PortArray) - #define WmiEnumeratePorts_OUT_Ports_ID 2 - -} WmiEnumeratePorts_OUT, *PWmiEnumeratePorts_OUT; - -#define WmiEnumeratePorts_OUT_SIZE (FIELD_OFFSET(WmiEnumeratePorts_OUT, Ports) + WmiEnumeratePorts_OUT_Ports_SIZE) - - -// MSNdis_SetPortParameters - MSNdis_SetPortParameters -#define MSNdis_SetPortParametersGuid \ - { 0xaab6ac31,0x86fb,0x48fb, { 0x8b,0x48,0x63,0xdb,0x23,0x5a,0xce,0x16 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_SetPortParameters_GUID, \ - 0xaab6ac31,0x86fb,0x48fb,0x8b,0x48,0x63,0xdb,0x23,0x5a,0xce,0x16); -#endif - -// -// Method id definitions for MSNdis_SetPortParameters -#define WmiSetPortParameters 1 -typedef struct _WmiSetPortParameters_IN -{ - // - MSNdis_WmiMethodHeader MethodHeader; - #define WmiSetPortParameters_IN_MethodHeader_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiSetPortParameters_IN_MethodHeader_ID 1 - - // - MSNdis_PortAuthParameters PortParameters; - #define WmiSetPortParameters_IN_PortParameters_SIZE sizeof(MSNdis_PortAuthParameters) - #define WmiSetPortParameters_IN_PortParameters_ID 2 - -} WmiSetPortParameters_IN, *PWmiSetPortParameters_IN; - -#define WmiSetPortParameters_IN_SIZE (FIELD_OFFSET(WmiSetPortParameters_IN, PortParameters) + WmiSetPortParameters_IN_PortParameters_SIZE) - -typedef struct _WmiSetPortParameters_OUT -{ - // - MSNdis_WmiOutputInfo OutputInfo; - #define WmiSetPortParameters_OUT_OutputInfo_SIZE sizeof(MSNdis_WmiOutputInfo) - #define WmiSetPortParameters_OUT_OutputInfo_ID 3 - -} WmiSetPortParameters_OUT, *PWmiSetPortParameters_OUT; - -#define WmiSetPortParameters_OUT_SIZE (FIELD_OFFSET(WmiSetPortParameters_OUT, OutputInfo) + WmiSetPortParameters_OUT_OutputInfo_SIZE) - - -// MSNdis_QueryPciDeviceCustomProperty - MSNdis_QueryPciDeviceCustomProperty -#define MSNdis_QueryPciDeviceCustomPropertyGuid \ - { 0xaa39f5ab,0xe260,0x4d01, { 0x82,0xb0,0xb7,0x37,0xc8,0x80,0xea,0x05 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryPciDeviceCustomProperty_GUID, \ - 0xaa39f5ab,0xe260,0x4d01,0x82,0xb0,0xb7,0x37,0xc8,0x80,0xea,0x05); -#endif - -// -// Method id definitions for MSNdis_QueryPciDeviceCustomProperty -#define WmiQueryPciDeviceCustomProperty 1 -typedef struct _WmiQueryPciDeviceCustomProperty_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryPciDeviceCustomProperty_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryPciDeviceCustomProperty_IN_Header_ID 1 - -} WmiQueryPciDeviceCustomProperty_IN, *PWmiQueryPciDeviceCustomProperty_IN; - -#define WmiQueryPciDeviceCustomProperty_IN_SIZE (FIELD_OFFSET(WmiQueryPciDeviceCustomProperty_IN, Header) + WmiQueryPciDeviceCustomProperty_IN_Header_SIZE) - -typedef struct _WmiQueryPciDeviceCustomProperty_OUT -{ - // - MSNdis_PciDeviceProperty PciDeviceProperty; - #define WmiQueryPciDeviceCustomProperty_OUT_PciDeviceProperty_SIZE sizeof(MSNdis_PciDeviceProperty) - #define WmiQueryPciDeviceCustomProperty_OUT_PciDeviceProperty_ID 2 - -} WmiQueryPciDeviceCustomProperty_OUT, *PWmiQueryPciDeviceCustomProperty_OUT; - -#define WmiQueryPciDeviceCustomProperty_OUT_SIZE (FIELD_OFFSET(WmiQueryPciDeviceCustomProperty_OUT, PciDeviceProperty) + WmiQueryPciDeviceCustomProperty_OUT_PciDeviceProperty_SIZE) - - -// MSNdis_EnumerateAdapterEx - MSNdis_EnumerateAdapterEx -#define MSNdis_EnumerateAdapterExGuid \ - { 0x16716917,0x4306,0x4be4, { 0x9b,0x5a,0x38,0x09,0xae,0x44,0xb1,0x25 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EnumerateAdapterEx_GUID, \ - 0x16716917,0x4306,0x4be4,0x9b,0x5a,0x38,0x09,0xae,0x44,0xb1,0x25); -#endif - - -typedef struct _MSNdis_EnumerateAdapterEx -{ - // - MSNdis_WmiEnumAdapter EnumerateAdapter; - #define MSNdis_EnumerateAdapterEx_EnumerateAdapter_SIZE sizeof(MSNdis_WmiEnumAdapter) - #define MSNdis_EnumerateAdapterEx_EnumerateAdapter_ID 1 - -} MSNdis_EnumerateAdapterEx, *PMSNdis_EnumerateAdapterEx; - -#define MSNdis_EnumerateAdapterEx_SIZE (FIELD_OFFSET(MSNdis_EnumerateAdapterEx, EnumerateAdapter) + MSNdis_EnumerateAdapterEx_EnumerateAdapter_SIZE) - -// MSNdis_TcpOffloadCurrentConfig - MSNdis_TcpOffloadCurrentConfig -#define MSNdis_TcpOffloadCurrentConfigGuid \ - { 0x68542fed,0x5c74,0x461e, { 0x89,0x34,0x91,0xc6,0xf9,0xc6,0x09,0x60 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TcpOffloadCurrentConfig_GUID, \ - 0x68542fed,0x5c74,0x461e,0x89,0x34,0x91,0xc6,0xf9,0xc6,0x09,0x60); -#endif - -// -// Method id definitions for MSNdis_TcpOffloadCurrentConfig -#define WmiQueryCurrentOffloadConfig 1 -typedef struct _WmiQueryCurrentOffloadConfig_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryCurrentOffloadConfig_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryCurrentOffloadConfig_IN_Header_ID 1 - -} WmiQueryCurrentOffloadConfig_IN, *PWmiQueryCurrentOffloadConfig_IN; - -#define WmiQueryCurrentOffloadConfig_IN_SIZE (FIELD_OFFSET(WmiQueryCurrentOffloadConfig_IN, Header) + WmiQueryCurrentOffloadConfig_IN_Header_SIZE) - -typedef struct _WmiQueryCurrentOffloadConfig_OUT -{ - // - MSNdis_WmiOffload Offload; - #define WmiQueryCurrentOffloadConfig_OUT_Offload_SIZE sizeof(MSNdis_WmiOffload) - #define WmiQueryCurrentOffloadConfig_OUT_Offload_ID 2 - -} WmiQueryCurrentOffloadConfig_OUT, *PWmiQueryCurrentOffloadConfig_OUT; - -#define WmiQueryCurrentOffloadConfig_OUT_SIZE (FIELD_OFFSET(WmiQueryCurrentOffloadConfig_OUT, Offload) + WmiQueryCurrentOffloadConfig_OUT_Offload_SIZE) - - -// MSNdis_TcpOffloadHardwareConfig - MSNdis_TcpOffloadHardwareConfig -#define MSNdis_TcpOffloadHardwareConfigGuid \ - { 0xcd5f1102,0x590f,0x4ada, { 0xab,0x65,0x5b,0x31,0xb1,0xdc,0x01,0x72 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TcpOffloadHardwareConfig_GUID, \ - 0xcd5f1102,0x590f,0x4ada,0xab,0x65,0x5b,0x31,0xb1,0xdc,0x01,0x72); -#endif - -// -// Method id definitions for MSNdis_TcpOffloadHardwareConfig -#define WmiQueryHardwareOffloadConfig 1 -typedef struct _WmiQueryHardwareOffloadConfig_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryHardwareOffloadConfig_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryHardwareOffloadConfig_IN_Header_ID 1 - -} WmiQueryHardwareOffloadConfig_IN, *PWmiQueryHardwareOffloadConfig_IN; - -#define WmiQueryHardwareOffloadConfig_IN_SIZE (FIELD_OFFSET(WmiQueryHardwareOffloadConfig_IN, Header) + WmiQueryHardwareOffloadConfig_IN_Header_SIZE) - -typedef struct _WmiQueryHardwareOffloadConfig_OUT -{ - // - MSNdis_WmiOffload Offload; - #define WmiQueryHardwareOffloadConfig_OUT_Offload_SIZE sizeof(MSNdis_WmiOffload) - #define WmiQueryHardwareOffloadConfig_OUT_Offload_ID 2 - -} WmiQueryHardwareOffloadConfig_OUT, *PWmiQueryHardwareOffloadConfig_OUT; - -#define WmiQueryHardwareOffloadConfig_OUT_SIZE (FIELD_OFFSET(WmiQueryHardwareOffloadConfig_OUT, Offload) + WmiQueryHardwareOffloadConfig_OUT_Offload_SIZE) - - -// MSNdis_SetTcpOffloadParameters - MSNdis_SetTcpOffloadParameters -#define MSNdis_SetTcpOffloadParametersGuid \ - { 0x8ead9a22,0x7f69,0x4bc6, { 0x94,0x9a,0xc8,0x18,0x7b,0x07,0x4e,0x61 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_SetTcpOffloadParameters_GUID, \ - 0x8ead9a22,0x7f69,0x4bc6,0x94,0x9a,0xc8,0x18,0x7b,0x07,0x4e,0x61); -#endif - -// -// Method id definitions for MSNdis_SetTcpOffloadParameters -#define WmiSetTcpOffloadParameters 1 -typedef struct _WmiSetTcpOffloadParameters_IN -{ - // - MSNdis_WmiMethodHeader MethodHeader; - #define WmiSetTcpOffloadParameters_IN_MethodHeader_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiSetTcpOffloadParameters_IN_MethodHeader_ID 1 - - // - MSNdis_TcpOffloadParameters TcpOffloadParameters; - #define WmiSetTcpOffloadParameters_IN_TcpOffloadParameters_SIZE sizeof(MSNdis_TcpOffloadParameters) - #define WmiSetTcpOffloadParameters_IN_TcpOffloadParameters_ID 2 - -} WmiSetTcpOffloadParameters_IN, *PWmiSetTcpOffloadParameters_IN; - -#define WmiSetTcpOffloadParameters_IN_SIZE (FIELD_OFFSET(WmiSetTcpOffloadParameters_IN, TcpOffloadParameters) + WmiSetTcpOffloadParameters_IN_TcpOffloadParameters_SIZE) - -typedef struct _WmiSetTcpOffloadParameters_OUT -{ - // - MSNdis_WmiOutputInfo OutputInfo; - #define WmiSetTcpOffloadParameters_OUT_OutputInfo_SIZE sizeof(MSNdis_WmiOutputInfo) - #define WmiSetTcpOffloadParameters_OUT_OutputInfo_ID 3 - -} WmiSetTcpOffloadParameters_OUT, *PWmiSetTcpOffloadParameters_OUT; - -#define WmiSetTcpOffloadParameters_OUT_SIZE (FIELD_OFFSET(WmiSetTcpOffloadParameters_OUT, OutputInfo) + WmiSetTcpOffloadParameters_OUT_OutputInfo_SIZE) - - -// MSNdis_TcpConnectionOffloadCurrentConfig - MSNdis_TcpConnectionOffloadCurrentConfig -#define MSNdis_TcpConnectionOffloadCurrentConfigGuid \ - { 0x2ee6aef1,0x0851,0x458b, { 0xbf,0x0d,0x79,0x23,0x43,0xd1,0xcd,0xe1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TcpConnectionOffloadCurrentConfig_GUID, \ - 0x2ee6aef1,0x0851,0x458b,0xbf,0x0d,0x79,0x23,0x43,0xd1,0xcd,0xe1); -#endif - -// -// Method id definitions for MSNdis_TcpConnectionOffloadCurrentConfig -#define WmiQueryTcpConnectionOffloadCurrentConfig 1 -typedef struct _WmiQueryTcpConnectionOffloadCurrentConfig_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryTcpConnectionOffloadCurrentConfig_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryTcpConnectionOffloadCurrentConfig_IN_Header_ID 1 - -} WmiQueryTcpConnectionOffloadCurrentConfig_IN, *PWmiQueryTcpConnectionOffloadCurrentConfig_IN; - -#define WmiQueryTcpConnectionOffloadCurrentConfig_IN_SIZE (FIELD_OFFSET(WmiQueryTcpConnectionOffloadCurrentConfig_IN, Header) + WmiQueryTcpConnectionOffloadCurrentConfig_IN_Header_SIZE) - -typedef struct _WmiQueryTcpConnectionOffloadCurrentConfig_OUT -{ - // - MSNdis_WmiTcpConnectionOffload Offload; - #define WmiQueryTcpConnectionOffloadCurrentConfig_OUT_Offload_SIZE sizeof(MSNdis_WmiTcpConnectionOffload) - #define WmiQueryTcpConnectionOffloadCurrentConfig_OUT_Offload_ID 2 - -} WmiQueryTcpConnectionOffloadCurrentConfig_OUT, *PWmiQueryTcpConnectionOffloadCurrentConfig_OUT; - -#define WmiQueryTcpConnectionOffloadCurrentConfig_OUT_SIZE (FIELD_OFFSET(WmiQueryTcpConnectionOffloadCurrentConfig_OUT, Offload) + WmiQueryTcpConnectionOffloadCurrentConfig_OUT_Offload_SIZE) - - -// MSNdis_TcpConnectionOffloadHardwareConfig - MSNdis_TcpConnectionOffloadHardwareConfig -#define MSNdis_TcpConnectionOffloadHardwareConfigGuid \ - { 0x8ce71f2c,0xd63a,0x4390, { 0xa4,0x87,0x18,0xfa,0x47,0x26,0x2c,0xeb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_TcpConnectionOffloadHardwareConfig_GUID, \ - 0x8ce71f2c,0xd63a,0x4390,0xa4,0x87,0x18,0xfa,0x47,0x26,0x2c,0xeb); -#endif - -// -// Method id definitions for MSNdis_TcpConnectionOffloadHardwareConfig -#define WmiQueryTcpConnectionOffloadHardwareConfig 1 -typedef struct _WmiQueryTcpConnectionOffloadHardwareConfig_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryTcpConnectionOffloadHardwareConfig_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryTcpConnectionOffloadHardwareConfig_IN_Header_ID 1 - -} WmiQueryTcpConnectionOffloadHardwareConfig_IN, *PWmiQueryTcpConnectionOffloadHardwareConfig_IN; - -#define WmiQueryTcpConnectionOffloadHardwareConfig_IN_SIZE (FIELD_OFFSET(WmiQueryTcpConnectionOffloadHardwareConfig_IN, Header) + WmiQueryTcpConnectionOffloadHardwareConfig_IN_Header_SIZE) - -typedef struct _WmiQueryTcpConnectionOffloadHardwareConfig_OUT -{ - // - MSNdis_WmiTcpConnectionOffload Offload; - #define WmiQueryTcpConnectionOffloadHardwareConfig_OUT_Offload_SIZE sizeof(MSNdis_WmiTcpConnectionOffload) - #define WmiQueryTcpConnectionOffloadHardwareConfig_OUT_Offload_ID 2 - -} WmiQueryTcpConnectionOffloadHardwareConfig_OUT, *PWmiQueryTcpConnectionOffloadHardwareConfig_OUT; - -#define WmiQueryTcpConnectionOffloadHardwareConfig_OUT_SIZE (FIELD_OFFSET(WmiQueryTcpConnectionOffloadHardwareConfig_OUT, Offload) + WmiQueryTcpConnectionOffloadHardwareConfig_OUT_Offload_SIZE) - - -// MSNdis_ReceiveScaleCapabilities - MSNdis_ReceiveScaleCapabilities -#define MSNdis_ReceiveScaleCapabilitiesGuid \ - { 0x26c28774,0x4252,0x48fe, { 0xa6,0x10,0xa5,0x8a,0x39,0x8c,0x0e,0xb1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_ReceiveScaleCapabilities_GUID, \ - 0x26c28774,0x4252,0x48fe,0xa6,0x10,0xa5,0x8a,0x39,0x8c,0x0e,0xb1); -#endif - -// -// Method id definitions for MSNdis_ReceiveScaleCapabilities -#define WmiQueryReceiveScaleCapabilities 1 -typedef struct _WmiQueryReceiveScaleCapabilities_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveScaleCapabilities_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveScaleCapabilities_IN_Header_ID 1 - -} WmiQueryReceiveScaleCapabilities_IN, *PWmiQueryReceiveScaleCapabilities_IN; - -#define WmiQueryReceiveScaleCapabilities_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveScaleCapabilities_IN, Header) + WmiQueryReceiveScaleCapabilities_IN_Header_SIZE) - -typedef struct _WmiQueryReceiveScaleCapabilities_OUT -{ - // - MSNdis_WmiReceiveScaleCapabilities RssCaps; - #define WmiQueryReceiveScaleCapabilities_OUT_RssCaps_SIZE sizeof(MSNdis_WmiReceiveScaleCapabilities) - #define WmiQueryReceiveScaleCapabilities_OUT_RssCaps_ID 2 - -} WmiQueryReceiveScaleCapabilities_OUT, *PWmiQueryReceiveScaleCapabilities_OUT; - -#define WmiQueryReceiveScaleCapabilities_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveScaleCapabilities_OUT, RssCaps) + WmiQueryReceiveScaleCapabilities_OUT_RssCaps_SIZE) - - -// MSNdis_HDSplitCurrentConfig - MSNdis_HDSplitCurrentConfig -#define MSNdis_HDSplitCurrentConfigGuid \ - { 0x81d1303c,0xab00,0x4e49, { 0x80,0xb1,0x5e,0x6e,0x0b,0xf9,0xbe,0x53 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_HDSplitCurrentConfig_GUID, \ - 0x81d1303c,0xab00,0x4e49,0x80,0xb1,0x5e,0x6e,0x0b,0xf9,0xbe,0x53); -#endif - -// -// Method id definitions for MSNdis_HDSplitCurrentConfig -#define WmiQueryHDSplitCurrentConfig 1 -typedef struct _WmiQueryHDSplitCurrentConfig_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryHDSplitCurrentConfig_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryHDSplitCurrentConfig_IN_Header_ID 1 - -} WmiQueryHDSplitCurrentConfig_IN, *PWmiQueryHDSplitCurrentConfig_IN; - -#define WmiQueryHDSplitCurrentConfig_IN_SIZE (FIELD_OFFSET(WmiQueryHDSplitCurrentConfig_IN, Header) + WmiQueryHDSplitCurrentConfig_IN_Header_SIZE) - -typedef struct _WmiQueryHDSplitCurrentConfig_OUT -{ - // - MSNdis_WmiHDSplitCurrentConfig HdSplitCurrentConfig; - #define WmiQueryHDSplitCurrentConfig_OUT_HdSplitCurrentConfig_SIZE sizeof(MSNdis_WmiHDSplitCurrentConfig) - #define WmiQueryHDSplitCurrentConfig_OUT_HdSplitCurrentConfig_ID 2 - -} WmiQueryHDSplitCurrentConfig_OUT, *PWmiQueryHDSplitCurrentConfig_OUT; - -#define WmiQueryHDSplitCurrentConfig_OUT_SIZE (FIELD_OFFSET(WmiQueryHDSplitCurrentConfig_OUT, HdSplitCurrentConfig) + WmiQueryHDSplitCurrentConfig_OUT_HdSplitCurrentConfig_SIZE) - - -// MSNdis_SetHDSplitParameters - MSNdis_SetHDSplitParameters -#define MSNdis_SetHDSplitParametersGuid \ - { 0x8c048bea,0x2913,0x4458, { 0xb6,0x8e,0x17,0xf6,0xc1,0xe5,0xc6,0x0e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_SetHDSplitParameters_GUID, \ - 0x8c048bea,0x2913,0x4458,0xb6,0x8e,0x17,0xf6,0xc1,0xe5,0xc6,0x0e); -#endif - -// -// Method id definitions for MSNdis_SetHDSplitParameters -#define WmiSetHDSplitParameters 1 -typedef struct _WmiSetHDSplitParameters_IN -{ - // - MSNdis_WmiMethodHeader MethodHeader; - #define WmiSetHDSplitParameters_IN_MethodHeader_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiSetHDSplitParameters_IN_MethodHeader_ID 1 - - // - MSNdis_HDSplitParameters HDSplitParameters; - #define WmiSetHDSplitParameters_IN_HDSplitParameters_SIZE sizeof(MSNdis_HDSplitParameters) - #define WmiSetHDSplitParameters_IN_HDSplitParameters_ID 2 - -} WmiSetHDSplitParameters_IN, *PWmiSetHDSplitParameters_IN; - -#define WmiSetHDSplitParameters_IN_SIZE (FIELD_OFFSET(WmiSetHDSplitParameters_IN, HDSplitParameters) + WmiSetHDSplitParameters_IN_HDSplitParameters_SIZE) - -typedef struct _WmiSetHDSplitParameters_OUT -{ - // - MSNdis_WmiOutputInfo OutputInfo; - #define WmiSetHDSplitParameters_OUT_OutputInfo_SIZE sizeof(MSNdis_WmiOutputInfo) - #define WmiSetHDSplitParameters_OUT_OutputInfo_ID 3 - -} WmiSetHDSplitParameters_OUT, *PWmiSetHDSplitParameters_OUT; - -#define WmiSetHDSplitParameters_OUT_SIZE (FIELD_OFFSET(WmiSetHDSplitParameters_OUT, OutputInfo) + WmiSetHDSplitParameters_OUT_OutputInfo_SIZE) - - -// MSNdis_QueryPhysicalMediumTypeEx - MSNdis_QueryPhysicalMediumTypeEx -#define MSNdis_QueryPhysicalMediumTypeExGuid \ - { 0x899e7782,0x035b,0x43f9, { 0x8b,0xb6,0x2b,0x58,0x97,0x16,0x12,0xe5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryPhysicalMediumTypeEx_GUID, \ - 0x899e7782,0x035b,0x43f9,0x8b,0xb6,0x2b,0x58,0x97,0x16,0x12,0xe5); -#endif - -// -// Method id definitions for MSNdis_QueryPhysicalMediumTypeEx -#define WmiQueryPhysicalMediumTypeEx 1 -typedef struct _WmiQueryPhysicalMediumTypeEx_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryPhysicalMediumTypeEx_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryPhysicalMediumTypeEx_IN_Header_ID 1 - -} WmiQueryPhysicalMediumTypeEx_IN, *PWmiQueryPhysicalMediumTypeEx_IN; - -#define WmiQueryPhysicalMediumTypeEx_IN_SIZE (FIELD_OFFSET(WmiQueryPhysicalMediumTypeEx_IN, Header) + WmiQueryPhysicalMediumTypeEx_IN_Header_SIZE) - -typedef struct _WmiQueryPhysicalMediumTypeEx_OUT -{ - // - ULONG NdisPhysicalMediumTypeEx; - #define WmiQueryPhysicalMediumTypeEx_OUT_NdisPhysicalMediumTypeEx_SIZE sizeof(ULONG) - #define WmiQueryPhysicalMediumTypeEx_OUT_NdisPhysicalMediumTypeEx_ID 2 - -} WmiQueryPhysicalMediumTypeEx_OUT, *PWmiQueryPhysicalMediumTypeEx_OUT; - -#define WmiQueryPhysicalMediumTypeEx_OUT_SIZE (FIELD_OFFSET(WmiQueryPhysicalMediumTypeEx_OUT, NdisPhysicalMediumTypeEx) + WmiQueryPhysicalMediumTypeEx_OUT_NdisPhysicalMediumTypeEx_SIZE) - - -// MSNdis_QueryReceiveFilterHardwareCapabilities - MSNdis_QueryReceiveFilterHardwareCapabilities -#define MSNdis_QueryReceiveFilterHardwareCapabilitiesGuid \ - { 0x3f2c1419,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryReceiveFilterHardwareCapabilities_GUID, \ - 0x3f2c1419,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_QueryReceiveFilterHardwareCapabilities -#define WmiQueryReceiveFilterHardwareCapabilities 1 -typedef struct _WmiQueryReceiveFilterHardwareCapabilities_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveFilterHardwareCapabilities_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveFilterHardwareCapabilities_IN_Header_ID 1 - -} WmiQueryReceiveFilterHardwareCapabilities_IN, *PWmiQueryReceiveFilterHardwareCapabilities_IN; - -#define WmiQueryReceiveFilterHardwareCapabilities_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterHardwareCapabilities_IN, Header) + WmiQueryReceiveFilterHardwareCapabilities_IN_Header_SIZE) - -typedef struct _WmiQueryReceiveFilterHardwareCapabilities_OUT -{ - // - MSNdis_ReceiveFilterCapabilities ReceiveFilterHardwareCapabilities; - #define WmiQueryReceiveFilterHardwareCapabilities_OUT_ReceiveFilterHardwareCapabilities_SIZE sizeof(MSNdis_ReceiveFilterCapabilities) - #define WmiQueryReceiveFilterHardwareCapabilities_OUT_ReceiveFilterHardwareCapabilities_ID 2 - -} WmiQueryReceiveFilterHardwareCapabilities_OUT, *PWmiQueryReceiveFilterHardwareCapabilities_OUT; - -#define WmiQueryReceiveFilterHardwareCapabilities_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterHardwareCapabilities_OUT, ReceiveFilterHardwareCapabilities) + WmiQueryReceiveFilterHardwareCapabilities_OUT_ReceiveFilterHardwareCapabilities_SIZE) - - -// MSNdis_QueryReceiveFilterGlobalParameters - MSNdis_QueryReceiveFilterGlobalParameters -#define MSNdis_QueryReceiveFilterGlobalParametersGuid \ - { 0x3f2c141a,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryReceiveFilterGlobalParameters_GUID, \ - 0x3f2c141a,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_QueryReceiveFilterGlobalParameters -#define WmiQueryReceiveFilterGlobalParameters 1 -typedef struct _WmiQueryReceiveFilterGlobalParameters_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveFilterGlobalParameters_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveFilterGlobalParameters_IN_Header_ID 1 - -} WmiQueryReceiveFilterGlobalParameters_IN, *PWmiQueryReceiveFilterGlobalParameters_IN; - -#define WmiQueryReceiveFilterGlobalParameters_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterGlobalParameters_IN, Header) + WmiQueryReceiveFilterGlobalParameters_IN_Header_SIZE) - -typedef struct _WmiQueryReceiveFilterGlobalParameters_OUT -{ - // - MSNdis_ReceiveFilterGlobalParameters ReceiveFilterGlobalParameters; - #define WmiQueryReceiveFilterGlobalParameters_OUT_ReceiveFilterGlobalParameters_SIZE sizeof(MSNdis_ReceiveFilterGlobalParameters) - #define WmiQueryReceiveFilterGlobalParameters_OUT_ReceiveFilterGlobalParameters_ID 2 - -} WmiQueryReceiveFilterGlobalParameters_OUT, *PWmiQueryReceiveFilterGlobalParameters_OUT; - -#define WmiQueryReceiveFilterGlobalParameters_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterGlobalParameters_OUT, ReceiveFilterGlobalParameters) + WmiQueryReceiveFilterGlobalParameters_OUT_ReceiveFilterGlobalParameters_SIZE) - - -// MSNdis_EnumerateReceiveFilters - MSNdis_EnumerateReceiveFilters -#define MSNdis_EnumerateReceiveFiltersGuid \ - { 0x3f2c141d,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EnumerateReceiveFilters_GUID, \ - 0x3f2c141d,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_EnumerateReceiveFilters -#define WmiEnumReceiveFilters 1 -typedef struct _WmiEnumReceiveFilters_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiEnumReceiveFilters_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiEnumReceiveFilters_IN_Header_ID 1 - - // - MSNdis_ReceiveFilterInfoArray ReceiveFilterInfoArray; - #define WmiEnumReceiveFilters_IN_ReceiveFilterInfoArray_SIZE sizeof(MSNdis_ReceiveFilterInfoArray) - #define WmiEnumReceiveFilters_IN_ReceiveFilterInfoArray_ID 2 - -} WmiEnumReceiveFilters_IN, *PWmiEnumReceiveFilters_IN; - -#define WmiEnumReceiveFilters_IN_SIZE (FIELD_OFFSET(WmiEnumReceiveFilters_IN, ReceiveFilterInfoArray) + WmiEnumReceiveFilters_IN_ReceiveFilterInfoArray_SIZE) - -typedef struct _WmiEnumReceiveFilters_OUT -{ - // - MSNdis_ReceiveFilterInfoArray ReceiveFilterInfoArray; - #define WmiEnumReceiveFilters_OUT_ReceiveFilterInfoArray_SIZE sizeof(MSNdis_ReceiveFilterInfoArray) - #define WmiEnumReceiveFilters_OUT_ReceiveFilterInfoArray_ID 2 - -} WmiEnumReceiveFilters_OUT, *PWmiEnumReceiveFilters_OUT; - -#define WmiEnumReceiveFilters_OUT_SIZE (FIELD_OFFSET(WmiEnumReceiveFilters_OUT, ReceiveFilterInfoArray) + WmiEnumReceiveFilters_OUT_ReceiveFilterInfoArray_SIZE) - - -// MSNdis_QueryReceiveFilterParameters - MSNdis_QueryReceiveFilterParameters -#define MSNdis_QueryReceiveFilterParametersGuid \ - { 0x3f2c141e,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryReceiveFilterParameters_GUID, \ - 0x3f2c141e,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_QueryReceiveFilterParameters -#define WmiQueryReceiveFilterParameters 1 -typedef struct _WmiQueryReceiveFilterParameters_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveFilterParameters_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveFilterParameters_IN_Header_ID 1 - - // - MSNdis_ReceiveFilterParameters ReceiveFilterParameters; - #define WmiQueryReceiveFilterParameters_IN_ReceiveFilterParameters_SIZE sizeof(MSNdis_ReceiveFilterParameters) - #define WmiQueryReceiveFilterParameters_IN_ReceiveFilterParameters_ID 2 - -} WmiQueryReceiveFilterParameters_IN, *PWmiQueryReceiveFilterParameters_IN; - -#define WmiQueryReceiveFilterParameters_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterParameters_IN, ReceiveFilterParameters) + WmiQueryReceiveFilterParameters_IN_ReceiveFilterParameters_SIZE) - -typedef struct _WmiQueryReceiveFilterParameters_OUT -{ - // - MSNdis_ReceiveFilterParameters ReceiveFilterParameters; - #define WmiQueryReceiveFilterParameters_OUT_ReceiveFilterParameters_SIZE sizeof(MSNdis_ReceiveFilterParameters) - #define WmiQueryReceiveFilterParameters_OUT_ReceiveFilterParameters_ID 2 - -} WmiQueryReceiveFilterParameters_OUT, *PWmiQueryReceiveFilterParameters_OUT; - -#define WmiQueryReceiveFilterParameters_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterParameters_OUT, ReceiveFilterParameters) + WmiQueryReceiveFilterParameters_OUT_ReceiveFilterParameters_SIZE) - - -// MSNdis_QueryReceiveFilterCurrentCapabilities - MSNdis_QueryReceiveFilterCurrentCapabilities -#define MSNdis_QueryReceiveFilterCurrentCapabilitiesGuid \ - { 0x4054e80f,0x2bc1,0x4ccc, { 0xb0,0x33,0x4a,0xbc,0x0c,0x4a,0x1e,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryReceiveFilterCurrentCapabilities_GUID, \ - 0x4054e80f,0x2bc1,0x4ccc,0xb0,0x33,0x4a,0xbc,0x0c,0x4a,0x1e,0x8c); -#endif - -// -// Method id definitions for MSNdis_QueryReceiveFilterCurrentCapabilities -#define WmiQueryReceiveFilterCurrentCapabilities 1 -typedef struct _WmiQueryReceiveFilterCurrentCapabilities_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveFilterCurrentCapabilities_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveFilterCurrentCapabilities_IN_Header_ID 1 - -} WmiQueryReceiveFilterCurrentCapabilities_IN, *PWmiQueryReceiveFilterCurrentCapabilities_IN; - -#define WmiQueryReceiveFilterCurrentCapabilities_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterCurrentCapabilities_IN, Header) + WmiQueryReceiveFilterCurrentCapabilities_IN_Header_SIZE) - -typedef struct _WmiQueryReceiveFilterCurrentCapabilities_OUT -{ - // - MSNdis_ReceiveFilterCapabilities ReceiveFilterCurrentCapabilities; - #define WmiQueryReceiveFilterCurrentCapabilities_OUT_ReceiveFilterCurrentCapabilities_SIZE sizeof(MSNdis_ReceiveFilterCapabilities) - #define WmiQueryReceiveFilterCurrentCapabilities_OUT_ReceiveFilterCurrentCapabilities_ID 2 - -} WmiQueryReceiveFilterCurrentCapabilities_OUT, *PWmiQueryReceiveFilterCurrentCapabilities_OUT; - -#define WmiQueryReceiveFilterCurrentCapabilities_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveFilterCurrentCapabilities_OUT, ReceiveFilterCurrentCapabilities) + WmiQueryReceiveFilterCurrentCapabilities_OUT_ReceiveFilterCurrentCapabilities_SIZE) - - -// MSNdis_QueryNicSwitchHardwareCapabilities - MSNdis_QueryNicSwitchHardwareCapabilities -#define MSNdis_QueryNicSwitchHardwareCapabilitiesGuid \ - { 0x37cab40c,0xd1e8,0x4301, { 0x8c,0x1d,0x58,0x46,0x5e,0x0c,0x4c,0x0f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryNicSwitchHardwareCapabilities_GUID, \ - 0x37cab40c,0xd1e8,0x4301,0x8c,0x1d,0x58,0x46,0x5e,0x0c,0x4c,0x0f); -#endif - -// -// Method id definitions for MSNdis_QueryNicSwitchHardwareCapabilities -#define WmiQueryNICSwitchHardwareCapabilities 1 -typedef struct _WmiQueryNICSwitchHardwareCapabilities_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryNICSwitchHardwareCapabilities_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryNICSwitchHardwareCapabilities_IN_Header_ID 1 - -} WmiQueryNICSwitchHardwareCapabilities_IN, *PWmiQueryNICSwitchHardwareCapabilities_IN; - -#define WmiQueryNICSwitchHardwareCapabilities_IN_SIZE (FIELD_OFFSET(WmiQueryNICSwitchHardwareCapabilities_IN, Header) + WmiQueryNICSwitchHardwareCapabilities_IN_Header_SIZE) - -typedef struct _WmiQueryNICSwitchHardwareCapabilities_OUT -{ - // - MSNdis_NicSwitchCapabilities NicSwitchHardwareCapabilities; - #define WmiQueryNICSwitchHardwareCapabilities_OUT_NicSwitchHardwareCapabilities_SIZE sizeof(MSNdis_NicSwitchCapabilities) - #define WmiQueryNICSwitchHardwareCapabilities_OUT_NicSwitchHardwareCapabilities_ID 2 - -} WmiQueryNICSwitchHardwareCapabilities_OUT, *PWmiQueryNICSwitchHardwareCapabilities_OUT; - -#define WmiQueryNICSwitchHardwareCapabilities_OUT_SIZE (FIELD_OFFSET(WmiQueryNICSwitchHardwareCapabilities_OUT, NicSwitchHardwareCapabilities) + WmiQueryNICSwitchHardwareCapabilities_OUT_NicSwitchHardwareCapabilities_SIZE) - - -// MSNdis_QueryNicSwitchCurrentCapabilities - MSNdis_QueryNicSwitchCurrentCapabilities -#define MSNdis_QueryNicSwitchCurrentCapabilitiesGuid \ - { 0xe76fdaf3,0x0be7,0x4d95, { 0x87,0xe9,0x5a,0xea,0xd4,0xb5,0x90,0xe9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryNicSwitchCurrentCapabilities_GUID, \ - 0xe76fdaf3,0x0be7,0x4d95,0x87,0xe9,0x5a,0xea,0xd4,0xb5,0x90,0xe9); -#endif - -// -// Method id definitions for MSNdis_QueryNicSwitchCurrentCapabilities -#define WmiQueryNICSwitchCurrentCapabilities 1 -typedef struct _WmiQueryNICSwitchCurrentCapabilities_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryNICSwitchCurrentCapabilities_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryNICSwitchCurrentCapabilities_IN_Header_ID 1 - -} WmiQueryNICSwitchCurrentCapabilities_IN, *PWmiQueryNICSwitchCurrentCapabilities_IN; - -#define WmiQueryNICSwitchCurrentCapabilities_IN_SIZE (FIELD_OFFSET(WmiQueryNICSwitchCurrentCapabilities_IN, Header) + WmiQueryNICSwitchCurrentCapabilities_IN_Header_SIZE) - -typedef struct _WmiQueryNICSwitchCurrentCapabilities_OUT -{ - // - MSNdis_NicSwitchCapabilities NicSwitchCurrentCapabilities; - #define WmiQueryNICSwitchCurrentCapabilities_OUT_NicSwitchCurrentCapabilities_SIZE sizeof(MSNdis_NicSwitchCapabilities) - #define WmiQueryNICSwitchCurrentCapabilities_OUT_NicSwitchCurrentCapabilities_ID 2 - -} WmiQueryNICSwitchCurrentCapabilities_OUT, *PWmiQueryNICSwitchCurrentCapabilities_OUT; - -#define WmiQueryNICSwitchCurrentCapabilities_OUT_SIZE (FIELD_OFFSET(WmiQueryNICSwitchCurrentCapabilities_OUT, NicSwitchCurrentCapabilities) + WmiQueryNICSwitchCurrentCapabilities_OUT_NicSwitchCurrentCapabilities_SIZE) - - -// MSNdis_QueryReceiveQueueParameters - MSNdis_QueryReceiveQueueParameters -#define MSNdis_QueryReceiveQueueParametersGuid \ - { 0x3f2c141c,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_QueryReceiveQueueParameters_GUID, \ - 0x3f2c141c,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_QueryReceiveQueueParameters -#define WmiQueryReceiveQueueParameters 1 -typedef struct _WmiQueryReceiveQueueParameters_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiQueryReceiveQueueParameters_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiQueryReceiveQueueParameters_IN_Header_ID 1 - - // - MSNdis_ReceiveQueueParameters ReceiveQueueParameters; - #define WmiQueryReceiveQueueParameters_IN_ReceiveQueueParameters_SIZE sizeof(MSNdis_ReceiveQueueParameters) - #define WmiQueryReceiveQueueParameters_IN_ReceiveQueueParameters_ID 2 - -} WmiQueryReceiveQueueParameters_IN, *PWmiQueryReceiveQueueParameters_IN; - -#define WmiQueryReceiveQueueParameters_IN_SIZE (FIELD_OFFSET(WmiQueryReceiveQueueParameters_IN, ReceiveQueueParameters) + WmiQueryReceiveQueueParameters_IN_ReceiveQueueParameters_SIZE) - -typedef struct _WmiQueryReceiveQueueParameters_OUT -{ - // - MSNdis_ReceiveQueueParameters ReceiveQueueParameters; - #define WmiQueryReceiveQueueParameters_OUT_ReceiveQueueParameters_SIZE sizeof(MSNdis_ReceiveQueueParameters) - #define WmiQueryReceiveQueueParameters_OUT_ReceiveQueueParameters_ID 2 - -} WmiQueryReceiveQueueParameters_OUT, *PWmiQueryReceiveQueueParameters_OUT; - -#define WmiQueryReceiveQueueParameters_OUT_SIZE (FIELD_OFFSET(WmiQueryReceiveQueueParameters_OUT, ReceiveQueueParameters) + WmiQueryReceiveQueueParameters_OUT_ReceiveQueueParameters_SIZE) - - -// MSNdis_EnumerateReceiveQueues - MSNdis_EnumerateReceiveQueues -#define MSNdis_EnumerateReceiveQueuesGuid \ - { 0x3f2c141b,0x83bc,0x11dd, { 0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_EnumerateReceiveQueues_GUID, \ - 0x3f2c141b,0x83bc,0x11dd,0x94,0xb8,0x00,0x1d,0x09,0x16,0x2b,0xc3); -#endif - -// -// Method id definitions for MSNdis_EnumerateReceiveQueues -#define WmiEnumReceiveQueues 1 -typedef struct _WmiEnumReceiveQueues_IN -{ - // - MSNdis_WmiMethodHeader Header; - #define WmiEnumReceiveQueues_IN_Header_SIZE sizeof(MSNdis_WmiMethodHeader) - #define WmiEnumReceiveQueues_IN_Header_ID 1 - - // - MSNdis_ReceiveQueueInfoArray ReceiveQueueInfoArray; - #define WmiEnumReceiveQueues_IN_ReceiveQueueInfoArray_SIZE sizeof(MSNdis_ReceiveQueueInfoArray) - #define WmiEnumReceiveQueues_IN_ReceiveQueueInfoArray_ID 2 - -} WmiEnumReceiveQueues_IN, *PWmiEnumReceiveQueues_IN; - -#define WmiEnumReceiveQueues_IN_SIZE (FIELD_OFFSET(WmiEnumReceiveQueues_IN, ReceiveQueueInfoArray) + WmiEnumReceiveQueues_IN_ReceiveQueueInfoArray_SIZE) - -typedef struct _WmiEnumReceiveQueues_OUT -{ - // - MSNdis_ReceiveQueueInfoArray ReceiveQueueInfoArray; - #define WmiEnumReceiveQueues_OUT_ReceiveQueueInfoArray_SIZE sizeof(MSNdis_ReceiveQueueInfoArray) - #define WmiEnumReceiveQueues_OUT_ReceiveQueueInfoArray_ID 2 - -} WmiEnumReceiveQueues_OUT, *PWmiEnumReceiveQueues_OUT; - -#define WmiEnumReceiveQueues_OUT_SIZE (FIELD_OFFSET(WmiEnumReceiveQueues_OUT, ReceiveQueueInfoArray) + WmiEnumReceiveQueues_OUT_ReceiveQueueInfoArray_SIZE) - - -// MSNdis_80211_BaseServiceSetIdentifier - MSNdis_80211_BaseServiceSetIdentifier -#define MSNdis_80211_BaseServiceSetIdentifierGuid \ - { 0x2504b6c2,0x1fa5,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_BaseServiceSetIdentifier_GUID, \ - 0x2504b6c2,0x1fa5,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_BaseServiceSetIdentifier -{ - // - UCHAR Ndis80211MacAddress[6]; - #define MSNdis_80211_BaseServiceSetIdentifier_Ndis80211MacAddress_SIZE sizeof(UCHAR[6]) - #define MSNdis_80211_BaseServiceSetIdentifier_Ndis80211MacAddress_ID 1 - -} MSNdis_80211_BaseServiceSetIdentifier, *PMSNdis_80211_BaseServiceSetIdentifier; - -#define MSNdis_80211_BaseServiceSetIdentifier_SIZE (FIELD_OFFSET(MSNdis_80211_BaseServiceSetIdentifier, Ndis80211MacAddress) + MSNdis_80211_BaseServiceSetIdentifier_Ndis80211MacAddress_SIZE) - -// MSNdis_80211_ServiceSetIdentifier - MSNdis_80211_ServiceSetIdentifier -#define MSNdis_80211_ServiceSetIdentifierGuid \ - { 0x7d2a90ea,0x2041,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ServiceSetIdentifier_GUID, \ - 0x7d2a90ea,0x2041,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_ServiceSetIdentifier -{ - // - UCHAR Ndis80211SsId[33]; - #define MSNdis_80211_ServiceSetIdentifier_Ndis80211SsId_SIZE sizeof(UCHAR[33]) - #define MSNdis_80211_ServiceSetIdentifier_Ndis80211SsId_ID 1 - -} MSNdis_80211_ServiceSetIdentifier, *PMSNdis_80211_ServiceSetIdentifier; - -#define MSNdis_80211_ServiceSetIdentifier_SIZE (FIELD_OFFSET(MSNdis_80211_ServiceSetIdentifier, Ndis80211SsId) + MSNdis_80211_ServiceSetIdentifier_Ndis80211SsId_SIZE) - -// MSNdis_80211_NetworkType - MSNdis_80211_NetworkType -#define MSNdis_80211_NetworkTypeGuid \ - { 0xe779ab61,0xb9ab,0x11d4, { 0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_NetworkType_GUID, \ - 0xe779ab61,0xb9ab,0x11d4,0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37); -#endif - - -typedef struct _MSNdis_80211_NetworkType -{ - // - ULONG Ndis80211NetworkType; - #define MSNdis_80211_NetworkType_Ndis80211NetworkType_SIZE sizeof(ULONG) - #define MSNdis_80211_NetworkType_Ndis80211NetworkType_ID 1 - -} MSNdis_80211_NetworkType, *PMSNdis_80211_NetworkType; - -#define MSNdis_80211_NetworkType_SIZE (FIELD_OFFSET(MSNdis_80211_NetworkType, Ndis80211NetworkType) + MSNdis_80211_NetworkType_Ndis80211NetworkType_SIZE) - -// MSNdis_80211_NetworkTypesSupported - MSNdis_80211_NetworkTypesSupported -#define MSNdis_80211_NetworkTypesSupportedGuid \ - { 0x8531d6e6,0x2041,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_NetworkTypesSupported_GUID, \ - 0x8531d6e6,0x2041,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_NetworkTypesSupported -{ - // - ULONG NumberOfItems; - #define MSNdis_80211_NetworkTypesSupported_NumberOfItems_SIZE sizeof(ULONG) - #define MSNdis_80211_NetworkTypesSupported_NumberOfItems_ID 1 - - // - MSNdis_80211_NetworkType Ndis80211NetworkTypes[1]; - #define MSNdis_80211_NetworkTypesSupported_Ndis80211NetworkTypes_ID 2 - -} MSNdis_80211_NetworkTypesSupported, *PMSNdis_80211_NetworkTypesSupported; - -// MSNdis_80211_NetworkTypeInUse - MSNdis_80211_NetworkTypeInUse -#define MSNdis_80211_NetworkTypeInUseGuid \ - { 0x857e2326,0x2041,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_NetworkTypeInUse_GUID, \ - 0x857e2326,0x2041,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_NetworkTypeInUse -{ - // - MSNdis_80211_NetworkType Ndis80211NetworkTypeInUse; - #define MSNdis_80211_NetworkTypeInUse_Ndis80211NetworkTypeInUse_SIZE sizeof(MSNdis_80211_NetworkType) - #define MSNdis_80211_NetworkTypeInUse_Ndis80211NetworkTypeInUse_ID 1 - -} MSNdis_80211_NetworkTypeInUse, *PMSNdis_80211_NetworkTypeInUse; - -#define MSNdis_80211_NetworkTypeInUse_SIZE (FIELD_OFFSET(MSNdis_80211_NetworkTypeInUse, Ndis80211NetworkTypeInUse) + MSNdis_80211_NetworkTypeInUse_Ndis80211NetworkTypeInUse_SIZE) - -// MSNdis_80211_PowerMode - MSNdis_80211_PowerMode -#define MSNdis_80211_PowerModeGuid \ - { 0x85be837c,0x2041,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_PowerMode_GUID, \ - 0x85be837c,0x2041,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_PowerMode -{ - // - ULONG Ndis80211PowerMode; - #define MSNdis_80211_PowerMode_Ndis80211PowerMode_SIZE sizeof(ULONG) - #define MSNdis_80211_PowerMode_Ndis80211PowerMode_ID 1 - -} MSNdis_80211_PowerMode, *PMSNdis_80211_PowerMode; - -#define MSNdis_80211_PowerMode_SIZE (FIELD_OFFSET(MSNdis_80211_PowerMode, Ndis80211PowerMode) + MSNdis_80211_PowerMode_Ndis80211PowerMode_SIZE) - -// MSNdis_80211_TransmitPowerLevel - MSNdis_80211_TransmitPowerLevel -#define MSNdis_80211_TransmitPowerLevelGuid \ - { 0x11e6ba76,0x2053,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_TransmitPowerLevel_GUID, \ - 0x11e6ba76,0x2053,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_TransmitPowerLevel -{ - // - ULONG Ndis80211TransmitPowerLevel; - #define MSNdis_80211_TransmitPowerLevel_Ndis80211TransmitPowerLevel_SIZE sizeof(ULONG) - #define MSNdis_80211_TransmitPowerLevel_Ndis80211TransmitPowerLevel_ID 1 - -} MSNdis_80211_TransmitPowerLevel, *PMSNdis_80211_TransmitPowerLevel; - -#define MSNdis_80211_TransmitPowerLevel_SIZE (FIELD_OFFSET(MSNdis_80211_TransmitPowerLevel, Ndis80211TransmitPowerLevel) + MSNdis_80211_TransmitPowerLevel_Ndis80211TransmitPowerLevel_SIZE) - -// MSNdis_80211_ReceivedSignalStrength - MSNdis_80211_ReceivedSignalStrength -#define MSNdis_80211_ReceivedSignalStrengthGuid \ - { 0x1507db16,0x2053,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ReceivedSignalStrength_GUID, \ - 0x1507db16,0x2053,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_ReceivedSignalStrength -{ - // - LONG Ndis80211ReceivedSignalStrength; - #define MSNdis_80211_ReceivedSignalStrength_Ndis80211ReceivedSignalStrength_SIZE sizeof(LONG) - #define MSNdis_80211_ReceivedSignalStrength_Ndis80211ReceivedSignalStrength_ID 1 - -} MSNdis_80211_ReceivedSignalStrength, *PMSNdis_80211_ReceivedSignalStrength; - -#define MSNdis_80211_ReceivedSignalStrength_SIZE (FIELD_OFFSET(MSNdis_80211_ReceivedSignalStrength, Ndis80211ReceivedSignalStrength) + MSNdis_80211_ReceivedSignalStrength_Ndis80211ReceivedSignalStrength_SIZE) - -// MSNdis_80211_ReceivedSignalStrengthEventTrigger - MSNdis_80211_ReceivedSignalStrengthEventTrigger -#define MSNdis_80211_ReceivedSignalStrengthEventTriggerGuid \ - { 0x155689b8,0x2053,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ReceivedSignalStrengthEventTrigger_GUID, \ - 0x155689b8,0x2053,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_ReceivedSignalStrengthEventTrigger -{ - // - LONG Ndis80211ReceivedSignalStrengthTrigger; - #define MSNdis_80211_ReceivedSignalStrengthEventTrigger_Ndis80211ReceivedSignalStrengthTrigger_SIZE sizeof(LONG) - #define MSNdis_80211_ReceivedSignalStrengthEventTrigger_Ndis80211ReceivedSignalStrengthTrigger_ID 1 - -} MSNdis_80211_ReceivedSignalStrengthEventTrigger, *PMSNdis_80211_ReceivedSignalStrengthEventTrigger; - -#define MSNdis_80211_ReceivedSignalStrengthEventTrigger_SIZE (FIELD_OFFSET(MSNdis_80211_ReceivedSignalStrengthEventTrigger, Ndis80211ReceivedSignalStrengthTrigger) + MSNdis_80211_ReceivedSignalStrengthEventTrigger_Ndis80211ReceivedSignalStrengthTrigger_SIZE) - -// MSNdis_80211_NetworkInfrastructure - MSNdis_80211_NetworkInfrastructure -#define MSNdis_80211_NetworkInfrastructureGuid \ - { 0x34e1fa48,0xb9b6,0x11d4, { 0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_NetworkInfrastructure_GUID, \ - 0x34e1fa48,0xb9b6,0x11d4,0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37); -#endif - - -typedef struct _MSNdis_80211_NetworkInfrastructure -{ - // - ULONG Ndis80211NetworkInfrastructure; - #define MSNdis_80211_NetworkInfrastructure_Ndis80211NetworkInfrastructure_SIZE sizeof(ULONG) - #define MSNdis_80211_NetworkInfrastructure_Ndis80211NetworkInfrastructure_ID 1 - -} MSNdis_80211_NetworkInfrastructure, *PMSNdis_80211_NetworkInfrastructure; - -#define MSNdis_80211_NetworkInfrastructure_SIZE (FIELD_OFFSET(MSNdis_80211_NetworkInfrastructure, Ndis80211NetworkInfrastructure) + MSNdis_80211_NetworkInfrastructure_Ndis80211NetworkInfrastructure_SIZE) - -// MSNdis_80211_ConfigurationFH - MSNdis_80211_ConfigurationFH -#define MSNdis_80211_ConfigurationFHGuid \ - { 0x4a800b8c,0x2068,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ConfigurationFH_GUID, \ - 0x4a800b8c,0x2068,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_ConfigurationFH -{ - // - ULONG FHLength; - #define MSNdis_80211_ConfigurationFH_FHLength_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationFH_FHLength_ID 1 - - // - ULONG HopPattern; - #define MSNdis_80211_ConfigurationFH_HopPattern_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationFH_HopPattern_ID 2 - - // - ULONG HopSet; - #define MSNdis_80211_ConfigurationFH_HopSet_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationFH_HopSet_ID 3 - - // - ULONG DwellTime; - #define MSNdis_80211_ConfigurationFH_DwellTime_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationFH_DwellTime_ID 4 - -} MSNdis_80211_ConfigurationFH, *PMSNdis_80211_ConfigurationFH; - -#define MSNdis_80211_ConfigurationFH_SIZE (FIELD_OFFSET(MSNdis_80211_ConfigurationFH, DwellTime) + MSNdis_80211_ConfigurationFH_DwellTime_SIZE) - -// MSNdis_80211_ConfigurationInfo - MSNdis_80211_ConfigurationInfo -#define MSNdis_80211_ConfigurationInfoGuid \ - { 0x220c16fc,0xb9a8,0x11d4, { 0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ConfigurationInfo_GUID, \ - 0x220c16fc,0xb9a8,0x11d4,0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37); -#endif - - -typedef struct _MSNdis_80211_ConfigurationInfo -{ - // - ULONG ConfigLength; - #define MSNdis_80211_ConfigurationInfo_ConfigLength_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationInfo_ConfigLength_ID 1 - - // - ULONG BeaconPeriod; - #define MSNdis_80211_ConfigurationInfo_BeaconPeriod_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationInfo_BeaconPeriod_ID 2 - - // - ULONG ATIMWindow; - #define MSNdis_80211_ConfigurationInfo_ATIMWindow_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationInfo_ATIMWindow_ID 3 - - // - ULONG DSConfig; - #define MSNdis_80211_ConfigurationInfo_DSConfig_SIZE sizeof(ULONG) - #define MSNdis_80211_ConfigurationInfo_DSConfig_ID 4 - - // - MSNdis_80211_ConfigurationFH FHConfig; - #define MSNdis_80211_ConfigurationInfo_FHConfig_SIZE sizeof(MSNdis_80211_ConfigurationFH) - #define MSNdis_80211_ConfigurationInfo_FHConfig_ID 5 - -} MSNdis_80211_ConfigurationInfo, *PMSNdis_80211_ConfigurationInfo; - -#define MSNdis_80211_ConfigurationInfo_SIZE (FIELD_OFFSET(MSNdis_80211_ConfigurationInfo, FHConfig) + MSNdis_80211_ConfigurationInfo_FHConfig_SIZE) - -// MSNdis_80211_WLanBssId - MSNdis_80211_WLanBssId -#define MSNdis_80211_WLanBssIdGuid \ - { 0x6929e718,0x2062,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_WLanBssId_GUID, \ - 0x6929e718,0x2062,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_WLanBssId -{ - // - ULONG Ndis80211WLanBssIdLength; - #define MSNdis_80211_WLanBssId_Ndis80211WLanBssIdLength_SIZE sizeof(ULONG) - #define MSNdis_80211_WLanBssId_Ndis80211WLanBssIdLength_ID 1 - - // - UCHAR Ndis80211MacAddress[6]; - #define MSNdis_80211_WLanBssId_Ndis80211MacAddress_SIZE sizeof(UCHAR[6]) - #define MSNdis_80211_WLanBssId_Ndis80211MacAddress_ID 2 - - // - USHORT Reserved; - #define MSNdis_80211_WLanBssId_Reserved_SIZE sizeof(USHORT) - #define MSNdis_80211_WLanBssId_Reserved_ID 3 - - // - ULONG Ndis80211SsIdLength; - #define MSNdis_80211_WLanBssId_Ndis80211SsIdLength_SIZE sizeof(ULONG) - #define MSNdis_80211_WLanBssId_Ndis80211SsIdLength_ID 4 - - // - UCHAR Ndis80211SsId[32]; - #define MSNdis_80211_WLanBssId_Ndis80211SsId_SIZE sizeof(UCHAR[32]) - #define MSNdis_80211_WLanBssId_Ndis80211SsId_ID 5 - - // - ULONG Ndis80211Privacy; - #define MSNdis_80211_WLanBssId_Ndis80211Privacy_SIZE sizeof(ULONG) - #define MSNdis_80211_WLanBssId_Ndis80211Privacy_ID 6 - - // - ULONG Ndis80211Rssi; - #define MSNdis_80211_WLanBssId_Ndis80211Rssi_SIZE sizeof(ULONG) - #define MSNdis_80211_WLanBssId_Ndis80211Rssi_ID 7 - - // - MSNdis_80211_NetworkType Ndis80211NetworkTypeInUse; - #define MSNdis_80211_WLanBssId_Ndis80211NetworkTypeInUse_SIZE sizeof(MSNdis_80211_NetworkType) - #define MSNdis_80211_WLanBssId_Ndis80211NetworkTypeInUse_ID 8 - - // - MSNdis_80211_ConfigurationInfo Ndis80211Configuration; - #define MSNdis_80211_WLanBssId_Ndis80211Configuration_SIZE sizeof(MSNdis_80211_ConfigurationInfo) - #define MSNdis_80211_WLanBssId_Ndis80211Configuration_ID 9 - - // - MSNdis_80211_NetworkInfrastructure Ndis80211InfrastructureMode; - #define MSNdis_80211_WLanBssId_Ndis80211InfrastructureMode_SIZE sizeof(MSNdis_80211_NetworkInfrastructure) - #define MSNdis_80211_WLanBssId_Ndis80211InfrastructureMode_ID 10 - - // - UCHAR Ndis80211SupportedRate[8]; - #define MSNdis_80211_WLanBssId_Ndis80211SupportedRate_SIZE sizeof(UCHAR[8]) - #define MSNdis_80211_WLanBssId_Ndis80211SupportedRate_ID 11 - -} MSNdis_80211_WLanBssId, *PMSNdis_80211_WLanBssId; - -#define MSNdis_80211_WLanBssId_SIZE (FIELD_OFFSET(MSNdis_80211_WLanBssId, Ndis80211SupportedRate) + MSNdis_80211_WLanBssId_Ndis80211SupportedRate_SIZE) - -// MSNdis_80211_BSSIList - MSNdis_80211_BSSIList -#define MSNdis_80211_BSSIListGuid \ - { 0x69526f9a,0x2062,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_BSSIList_GUID, \ - 0x69526f9a,0x2062,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_BSSIList -{ - // - ULONG NumberOfItems; - #define MSNdis_80211_BSSIList_NumberOfItems_SIZE sizeof(ULONG) - #define MSNdis_80211_BSSIList_NumberOfItems_ID 1 - - // - MSNdis_80211_WLanBssId Ndis80211BSSIList[1]; - #define MSNdis_80211_BSSIList_Ndis80211BSSIList_ID 2 - -} MSNdis_80211_BSSIList, *PMSNdis_80211_BSSIList; - -// MSNdis_80211_InfrastructureMode - MSNdis_80211_InfrastructureMode -#define MSNdis_80211_InfrastructureModeGuid \ - { 0x697d5a7e,0x2062,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_InfrastructureMode_GUID, \ - 0x697d5a7e,0x2062,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_InfrastructureMode -{ - // - MSNdis_80211_NetworkInfrastructure Ndis80211InfrastructureMode; - #define MSNdis_80211_InfrastructureMode_Ndis80211InfrastructureMode_SIZE sizeof(MSNdis_80211_NetworkInfrastructure) - #define MSNdis_80211_InfrastructureMode_Ndis80211InfrastructureMode_ID 1 - -} MSNdis_80211_InfrastructureMode, *PMSNdis_80211_InfrastructureMode; - -#define MSNdis_80211_InfrastructureMode_SIZE (FIELD_OFFSET(MSNdis_80211_InfrastructureMode, Ndis80211InfrastructureMode) + MSNdis_80211_InfrastructureMode_Ndis80211InfrastructureMode_SIZE) - -// MSNdis_80211_FragmentationThreshold - MSNdis_80211_FragmentationThreshold -#define MSNdis_80211_FragmentationThresholdGuid \ - { 0x69aaa7c4,0x2062,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_FragmentationThreshold_GUID, \ - 0x69aaa7c4,0x2062,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_FragmentationThreshold -{ - // - ULONG Ndis80211FragmentationThreshold; - #define MSNdis_80211_FragmentationThreshold_Ndis80211FragmentationThreshold_SIZE sizeof(ULONG) - #define MSNdis_80211_FragmentationThreshold_Ndis80211FragmentationThreshold_ID 1 - -} MSNdis_80211_FragmentationThreshold, *PMSNdis_80211_FragmentationThreshold; - -#define MSNdis_80211_FragmentationThreshold_SIZE (FIELD_OFFSET(MSNdis_80211_FragmentationThreshold, Ndis80211FragmentationThreshold) + MSNdis_80211_FragmentationThreshold_Ndis80211FragmentationThreshold_SIZE) - -// MSNdis_80211_RTSThreshold - MSNdis_80211_RTSThreshold -#define MSNdis_80211_RTSThresholdGuid \ - { 0x0134d07e,0x2064,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_RTSThreshold_GUID, \ - 0x0134d07e,0x2064,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_RTSThreshold -{ - // - ULONG Ndis80211RTSThreshold; - #define MSNdis_80211_RTSThreshold_Ndis80211RTSThreshold_SIZE sizeof(ULONG) - #define MSNdis_80211_RTSThreshold_Ndis80211RTSThreshold_ID 1 - -} MSNdis_80211_RTSThreshold, *PMSNdis_80211_RTSThreshold; - -#define MSNdis_80211_RTSThreshold_SIZE (FIELD_OFFSET(MSNdis_80211_RTSThreshold, Ndis80211RTSThreshold) + MSNdis_80211_RTSThreshold_Ndis80211RTSThreshold_SIZE) - -// MSNdis_80211_NumberOfAntennas - MSNdis_80211_NumberOfAntennas -#define MSNdis_80211_NumberOfAntennasGuid \ - { 0x01779336,0x2064,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_NumberOfAntennas_GUID, \ - 0x01779336,0x2064,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_NumberOfAntennas -{ - // - ULONG Ndis80211NumberOfAntennas; - #define MSNdis_80211_NumberOfAntennas_Ndis80211NumberOfAntennas_SIZE sizeof(ULONG) - #define MSNdis_80211_NumberOfAntennas_Ndis80211NumberOfAntennas_ID 1 - -} MSNdis_80211_NumberOfAntennas, *PMSNdis_80211_NumberOfAntennas; - -#define MSNdis_80211_NumberOfAntennas_SIZE (FIELD_OFFSET(MSNdis_80211_NumberOfAntennas, Ndis80211NumberOfAntennas) + MSNdis_80211_NumberOfAntennas_Ndis80211NumberOfAntennas_SIZE) - -// MSNdis_80211_ReceiveAntennaSelected - MSNdis_80211_ReceiveAntennaSelected -#define MSNdis_80211_ReceiveAntennaSelectedGuid \ - { 0x01ac07a2,0x2064,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ReceiveAntennaSelected_GUID, \ - 0x01ac07a2,0x2064,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_ReceiveAntennaSelected -{ - // - ULONG Ndis80211ReceiveAntennaSelected; - #define MSNdis_80211_ReceiveAntennaSelected_Ndis80211ReceiveAntennaSelected_SIZE sizeof(ULONG) - #define MSNdis_80211_ReceiveAntennaSelected_Ndis80211ReceiveAntennaSelected_ID 1 - -} MSNdis_80211_ReceiveAntennaSelected, *PMSNdis_80211_ReceiveAntennaSelected; - -#define MSNdis_80211_ReceiveAntennaSelected_SIZE (FIELD_OFFSET(MSNdis_80211_ReceiveAntennaSelected, Ndis80211ReceiveAntennaSelected) + MSNdis_80211_ReceiveAntennaSelected_Ndis80211ReceiveAntennaSelected_SIZE) - -// MSNdis_80211_TransmitAntennaSelected - MSNdis_80211_TransmitAntennaSelected -#define MSNdis_80211_TransmitAntennaSelectedGuid \ - { 0x01dbb74a,0x2064,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_TransmitAntennaSelected_GUID, \ - 0x01dbb74a,0x2064,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_TransmitAntennaSelected -{ - // - ULONG Ndis80211TransmitAntennaSelected; - #define MSNdis_80211_TransmitAntennaSelected_Ndis80211TransmitAntennaSelected_SIZE sizeof(ULONG) - #define MSNdis_80211_TransmitAntennaSelected_Ndis80211TransmitAntennaSelected_ID 1 - -} MSNdis_80211_TransmitAntennaSelected, *PMSNdis_80211_TransmitAntennaSelected; - -#define MSNdis_80211_TransmitAntennaSelected_SIZE (FIELD_OFFSET(MSNdis_80211_TransmitAntennaSelected, Ndis80211TransmitAntennaSelected) + MSNdis_80211_TransmitAntennaSelected_Ndis80211TransmitAntennaSelected_SIZE) - -// MSNdis_80211_DataRates - MSNdis_80211_DataRates -#define MSNdis_80211_DataRatesGuid \ - { 0x49db8722,0x2068,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_DataRates_GUID, \ - 0x49db8722,0x2068,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_DataRates -{ - // - UCHAR Ndis80211DataRate[8]; - #define MSNdis_80211_DataRates_Ndis80211DataRate_SIZE sizeof(UCHAR[8]) - #define MSNdis_80211_DataRates_Ndis80211DataRate_ID 1 - -} MSNdis_80211_DataRates, *PMSNdis_80211_DataRates; - -#define MSNdis_80211_DataRates_SIZE (FIELD_OFFSET(MSNdis_80211_DataRates, Ndis80211DataRate) + MSNdis_80211_DataRates_Ndis80211DataRate_SIZE) - -// MSNdis_80211_DesiredDataRates - MSNdis_80211_DesiredDataRates -#define MSNdis_80211_DesiredDataRatesGuid \ - { 0x452ee08e,0x2536,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_DesiredDataRates_GUID, \ - 0x452ee08e,0x2536,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_DesiredDataRates -{ - // - UCHAR Ndis80211DesiredRate[8]; - #define MSNdis_80211_DesiredDataRates_Ndis80211DesiredRate_SIZE sizeof(UCHAR[8]) - #define MSNdis_80211_DesiredDataRates_Ndis80211DesiredRate_ID 1 - -} MSNdis_80211_DesiredDataRates, *PMSNdis_80211_DesiredDataRates; - -#define MSNdis_80211_DesiredDataRates_SIZE (FIELD_OFFSET(MSNdis_80211_DesiredDataRates, Ndis80211DesiredRate) + MSNdis_80211_DesiredDataRates_Ndis80211DesiredRate_SIZE) - -// MSNdis_80211_Configuration - MSNdis_80211_Configuration -#define MSNdis_80211_ConfigurationGuid \ - { 0x4a4df982,0x2068,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_Configuration_GUID, \ - 0x4a4df982,0x2068,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_Configuration -{ - // - MSNdis_80211_ConfigurationInfo Ndis80211Config; - #define MSNdis_80211_Configuration_Ndis80211Config_SIZE sizeof(MSNdis_80211_ConfigurationInfo) - #define MSNdis_80211_Configuration_Ndis80211Config_ID 1 - -} MSNdis_80211_Configuration, *PMSNdis_80211_Configuration; - -#define MSNdis_80211_Configuration_SIZE (FIELD_OFFSET(MSNdis_80211_Configuration, Ndis80211Config) + MSNdis_80211_Configuration_Ndis80211Config_SIZE) - -// MSNdis_80211_Statistics - MSNdis_80211_Statistics -#define MSNdis_80211_StatisticsGuid \ - { 0x42bb73b0,0x2129,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_Statistics_GUID, \ - 0x42bb73b0,0x2129,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_Statistics -{ - // - ULONG StatisticsLength; - #define MSNdis_80211_Statistics_StatisticsLength_SIZE sizeof(ULONG) - #define MSNdis_80211_Statistics_StatisticsLength_ID 1 - - // - ULONGLONG TransmittedFragmentCount; - #define MSNdis_80211_Statistics_TransmittedFragmentCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_TransmittedFragmentCount_ID 2 - - // - ULONGLONG MulticastTransmittedFrameCount; - #define MSNdis_80211_Statistics_MulticastTransmittedFrameCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_MulticastTransmittedFrameCount_ID 3 - - // - ULONGLONG FailedCount; - #define MSNdis_80211_Statistics_FailedCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_FailedCount_ID 4 - - // - ULONGLONG RetryCount; - #define MSNdis_80211_Statistics_RetryCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_RetryCount_ID 5 - - // - ULONGLONG MultipleRetryCount; - #define MSNdis_80211_Statistics_MultipleRetryCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_MultipleRetryCount_ID 6 - - // - ULONGLONG RTSSuccessCount; - #define MSNdis_80211_Statistics_RTSSuccessCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_RTSSuccessCount_ID 7 - - // - ULONGLONG RTSFailureCount; - #define MSNdis_80211_Statistics_RTSFailureCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_RTSFailureCount_ID 8 - - // - ULONGLONG ACKFailureCount; - #define MSNdis_80211_Statistics_ACKFailureCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_ACKFailureCount_ID 9 - - // - ULONGLONG FrameDuplicateCount; - #define MSNdis_80211_Statistics_FrameDuplicateCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_FrameDuplicateCount_ID 10 - - // - ULONGLONG ReceivedFragmentCount; - #define MSNdis_80211_Statistics_ReceivedFragmentCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_ReceivedFragmentCount_ID 11 - - // - ULONGLONG MulticastReceivedFrameCount; - #define MSNdis_80211_Statistics_MulticastReceivedFrameCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_MulticastReceivedFrameCount_ID 12 - - // - ULONGLONG FCSErrorCount; - #define MSNdis_80211_Statistics_FCSErrorCount_SIZE sizeof(ULONGLONG) - #define MSNdis_80211_Statistics_FCSErrorCount_ID 13 - -} MSNdis_80211_Statistics, *PMSNdis_80211_Statistics; - -#define MSNdis_80211_Statistics_SIZE (FIELD_OFFSET(MSNdis_80211_Statistics, FCSErrorCount) + MSNdis_80211_Statistics_FCSErrorCount_SIZE) - -// MSNdis_80211_AddWEP - MSNdis_80211_AddWEP -#define MSNdis_80211_AddWEPGuid \ - { 0x4307bff0,0x2129,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_AddWEP_GUID, \ - 0x4307bff0,0x2129,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_AddWEP -{ - // - ULONG Length; - #define MSNdis_80211_AddWEP_Length_SIZE sizeof(ULONG) - #define MSNdis_80211_AddWEP_Length_ID 1 - - // - ULONG KeyIndex; - #define MSNdis_80211_AddWEP_KeyIndex_SIZE sizeof(ULONG) - #define MSNdis_80211_AddWEP_KeyIndex_ID 2 - - // - ULONG KeyLength; - #define MSNdis_80211_AddWEP_KeyLength_SIZE sizeof(ULONG) - #define MSNdis_80211_AddWEP_KeyLength_ID 3 - - // - UCHAR KeyMaterial[1]; - #define MSNdis_80211_AddWEP_KeyMaterial_ID 4 - -} MSNdis_80211_AddWEP, *PMSNdis_80211_AddWEP; - -// MSNdis_80211_RemoveWEP - MSNdis_80211_RemoveWEP -#define MSNdis_80211_RemoveWEPGuid \ - { 0x433c345c,0x2129,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_RemoveWEP_GUID, \ - 0x433c345c,0x2129,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_RemoveWEP -{ - // - ULONG Ndis80211KeyIndex; - #define MSNdis_80211_RemoveWEP_Ndis80211KeyIndex_SIZE sizeof(ULONG) - #define MSNdis_80211_RemoveWEP_Ndis80211KeyIndex_ID 1 - -} MSNdis_80211_RemoveWEP, *PMSNdis_80211_RemoveWEP; - -#define MSNdis_80211_RemoveWEP_SIZE (FIELD_OFFSET(MSNdis_80211_RemoveWEP, Ndis80211KeyIndex) + MSNdis_80211_RemoveWEP_Ndis80211KeyIndex_SIZE) - -// MSNdis_80211_Disassociate - MSNdis_80211_Disassociate -#define MSNdis_80211_DisassociateGuid \ - { 0x43671f40,0x2129,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_Disassociate_GUID, \ - 0x43671f40,0x2129,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_Disassociate -{ - // - ULONG UnusedParameter; - #define MSNdis_80211_Disassociate_UnusedParameter_SIZE sizeof(ULONG) - #define MSNdis_80211_Disassociate_UnusedParameter_ID 1 - -} MSNdis_80211_Disassociate, *PMSNdis_80211_Disassociate; - -#define MSNdis_80211_Disassociate_SIZE (FIELD_OFFSET(MSNdis_80211_Disassociate, UnusedParameter) + MSNdis_80211_Disassociate_UnusedParameter_SIZE) - -// MSNdis_80211_BssIdListScan - MSNdis_80211_BssIdListScan -#define MSNdis_80211_BssIdListScanGuid \ - { 0x0d9e01e1,0xba70,0x11d4, { 0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_BssIdListScan_GUID, \ - 0x0d9e01e1,0xba70,0x11d4,0xb6,0x75,0x00,0x20,0x48,0x57,0x03,0x37); -#endif - - -typedef struct _MSNdis_80211_BssIdListScan -{ - // - ULONG UnusedParameter; - #define MSNdis_80211_BssIdListScan_UnusedParameter_SIZE sizeof(ULONG) - #define MSNdis_80211_BssIdListScan_UnusedParameter_ID 1 - -} MSNdis_80211_BssIdListScan, *PMSNdis_80211_BssIdListScan; - -#define MSNdis_80211_BssIdListScan_SIZE (FIELD_OFFSET(MSNdis_80211_BssIdListScan, UnusedParameter) + MSNdis_80211_BssIdListScan_UnusedParameter_SIZE) - -// MSNdis_80211_AuthenticationMode - MSNdis_80211_AuthenticationMode -#define MSNdis_80211_AuthenticationModeGuid \ - { 0x43920a24,0x2129,0x11d4, { 0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_AuthenticationMode_GUID, \ - 0x43920a24,0x2129,0x11d4,0x97,0xeb,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_AuthenticationMode -{ - // - ULONG Ndis80211AuthenticationMode; - #define MSNdis_80211_AuthenticationMode_Ndis80211AuthenticationMode_SIZE sizeof(ULONG) - #define MSNdis_80211_AuthenticationMode_Ndis80211AuthenticationMode_ID 1 - -} MSNdis_80211_AuthenticationMode, *PMSNdis_80211_AuthenticationMode; - -#define MSNdis_80211_AuthenticationMode_SIZE (FIELD_OFFSET(MSNdis_80211_AuthenticationMode, Ndis80211AuthenticationMode) + MSNdis_80211_AuthenticationMode_Ndis80211AuthenticationMode_SIZE) - -// MSNdis_80211_PrivacyFilter - MSNdis_80211_PrivacyFilter -#define MSNdis_80211_PrivacyFilterGuid \ - { 0x6733c4e9,0x4792,0x11d4, { 0x97,0xf1,0x00,0xc0,0x4f,0x79,0xc4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_PrivacyFilter_GUID, \ - 0x6733c4e9,0x4792,0x11d4,0x97,0xf1,0x00,0xc0,0x4f,0x79,0xc4,0x03); -#endif - - -typedef struct _MSNdis_80211_PrivacyFilter -{ - // - ULONG Ndis80211PrivacyFilter; - #define MSNdis_80211_PrivacyFilter_Ndis80211PrivacyFilter_SIZE sizeof(ULONG) - #define MSNdis_80211_PrivacyFilter_Ndis80211PrivacyFilter_ID 1 - -} MSNdis_80211_PrivacyFilter, *PMSNdis_80211_PrivacyFilter; - -#define MSNdis_80211_PrivacyFilter_SIZE (FIELD_OFFSET(MSNdis_80211_PrivacyFilter, Ndis80211PrivacyFilter) + MSNdis_80211_PrivacyFilter_Ndis80211PrivacyFilter_SIZE) - -// MSNdis_80211_WEPStatus - MSNdis_80211_WEPStatus -#define MSNdis_80211_WEPStatusGuid \ - { 0xb027a21f,0x3cfa,0x4125, { 0x80,0x0b,0x3f,0x7a,0x18,0xfd,0xdc,0xdc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_WEPStatus_GUID, \ - 0xb027a21f,0x3cfa,0x4125,0x80,0x0b,0x3f,0x7a,0x18,0xfd,0xdc,0xdc); -#endif - - -typedef struct _MSNdis_80211_WEPStatus -{ - // - ULONG Ndis80211WEPStatus; - #define MSNdis_80211_WEPStatus_Ndis80211WEPStatus_SIZE sizeof(ULONG) - #define MSNdis_80211_WEPStatus_Ndis80211WEPStatus_ID 1 - -} MSNdis_80211_WEPStatus, *PMSNdis_80211_WEPStatus; - -#define MSNdis_80211_WEPStatus_SIZE (FIELD_OFFSET(MSNdis_80211_WEPStatus, Ndis80211WEPStatus) + MSNdis_80211_WEPStatus_Ndis80211WEPStatus_SIZE) - -// MSNdis_80211_ReloadDefaults - MSNdis_80211_ReloadDefaults -#define MSNdis_80211_ReloadDefaultsGuid \ - { 0x748b14e8,0x32ee,0x4425, { 0xb9,0x1b,0xc9,0x84,0x8c,0x58,0xb5,0x5a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_80211_ReloadDefaults_GUID, \ - 0x748b14e8,0x32ee,0x4425,0xb9,0x1b,0xc9,0x84,0x8c,0x58,0xb5,0x5a); -#endif - - -typedef struct _MSNdis_80211_ReloadDefaults -{ - // - ULONG Ndis80211ReloadDefaults; - #define MSNdis_80211_ReloadDefaults_Ndis80211ReloadDefaults_SIZE sizeof(ULONG) - #define MSNdis_80211_ReloadDefaults_Ndis80211ReloadDefaults_ID 1 - -} MSNdis_80211_ReloadDefaults, *PMSNdis_80211_ReloadDefaults; - -#define MSNdis_80211_ReloadDefaults_SIZE (FIELD_OFFSET(MSNdis_80211_ReloadDefaults, Ndis80211ReloadDefaults) + MSNdis_80211_ReloadDefaults_Ndis80211ReloadDefaults_SIZE) - -// MSNdis_PMAdminConfigState - MSNdis_PMAdminConfigState -#define MSNdis_PMAdminConfigStateGuid \ - { 0x0cffd0fc,0x8333,0x4000, { 0x9a,0x3b,0x20,0x07,0x35,0xd6,0x98,0xf9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMAdminConfigState_GUID, \ - 0x0cffd0fc,0x8333,0x4000,0x9a,0x3b,0x20,0x07,0x35,0xd6,0x98,0xf9); -#endif - - -typedef struct _MSNdis_PMAdminConfigState -{ - // - ULONG NdisPMAdminConfigState; - #define MSNdis_PMAdminConfigState_NdisPMAdminConfigState_SIZE sizeof(ULONG) - #define MSNdis_PMAdminConfigState_NdisPMAdminConfigState_ID 1 - -} MSNdis_PMAdminConfigState, *PMSNdis_PMAdminConfigState; - -#define MSNdis_PMAdminConfigState_SIZE (FIELD_OFFSET(MSNdis_PMAdminConfigState, NdisPMAdminConfigState) + MSNdis_PMAdminConfigState_NdisPMAdminConfigState_SIZE) - -// MSNdis_PMAdminConfigParam - MSNdis_PMAdminConfigParam -#define MSNdis_PMAdminConfigParamGuid \ - { 0x492dc449,0x13d9,0x4bd6, { 0x89,0xd4,0x96,0xe3,0x53,0x4e,0x6a,0x05 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMAdminConfigParam_GUID, \ - 0x492dc449,0x13d9,0x4bd6,0x89,0xd4,0x96,0xe3,0x53,0x4e,0x6a,0x05); -#endif - - -typedef struct _MSNdis_PMAdminConfigParam -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PMAdminConfigParam_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PMAdminConfigParam_Header_ID 1 - - // - MSNdis_PMAdminConfigState WakeOnPattern; - #define MSNdis_PMAdminConfigParam_WakeOnPattern_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_WakeOnPattern_ID 2 - - // - MSNdis_PMAdminConfigState WakeOnMagicPacket; - #define MSNdis_PMAdminConfigParam_WakeOnMagicPacket_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_WakeOnMagicPacket_ID 3 - - // - MSNdis_PMAdminConfigState DeviceSleepOnDisconnect; - #define MSNdis_PMAdminConfigParam_DeviceSleepOnDisconnect_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_DeviceSleepOnDisconnect_ID 4 - - // - MSNdis_PMAdminConfigState PMARPOffload; - #define MSNdis_PMAdminConfigParam_PMARPOffload_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_PMARPOffload_ID 5 - - // - MSNdis_PMAdminConfigState PMNDOffload; - #define MSNdis_PMAdminConfigParam_PMNDOffload_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_PMNDOffload_ID 6 - - // - MSNdis_PMAdminConfigState PMWiFiRekeyOffload; - #define MSNdis_PMAdminConfigParam_PMWiFiRekeyOffload_SIZE sizeof(MSNdis_PMAdminConfigState) - #define MSNdis_PMAdminConfigParam_PMWiFiRekeyOffload_ID 7 - -} MSNdis_PMAdminConfigParam, *PMSNdis_PMAdminConfigParam; - -#define MSNdis_PMAdminConfigParam_SIZE (FIELD_OFFSET(MSNdis_PMAdminConfigParam, PMWiFiRekeyOffload) + MSNdis_PMAdminConfigParam_PMWiFiRekeyOffload_SIZE) - -// MSNdis_PMAdminConfig - MSNdis_PMAdminConfig -// Control power management related standardized keywords -#define MSNdis_PMAdminConfigGuid \ - { 0x1528d111,0x708a,0x4ca4, { 0x92,0x15,0xc0,0x57,0x71,0x16,0x1c,0xda } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMAdminConfig_GUID, \ - 0x1528d111,0x708a,0x4ca4,0x92,0x15,0xc0,0x57,0x71,0x16,0x1c,0xda); -#endif - - -typedef struct _MSNdis_PMAdminConfig -{ - // - MSNdis_PMAdminConfigParam PMAdminConfigParam; - #define MSNdis_PMAdminConfig_PMAdminConfigParam_SIZE sizeof(MSNdis_PMAdminConfigParam) - #define MSNdis_PMAdminConfig_PMAdminConfigParam_ID 1 - -} MSNdis_PMAdminConfig, *PMSNdis_PMAdminConfig; - -#define MSNdis_PMAdminConfig_SIZE (FIELD_OFFSET(MSNdis_PMAdminConfig, PMAdminConfigParam) + MSNdis_PMAdminConfig_PMAdminConfigParam_SIZE) - -// MSNdis_PMCapabilityState - MSNdis_PMCapabilityState -#define MSNdis_PMCapabilityStateGuid \ - { 0xc1cc6857,0x1a26,0x4f6d, { 0xab,0x98,0x29,0x1f,0x0c,0x3b,0xbd,0x4c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMCapabilityState_GUID, \ - 0xc1cc6857,0x1a26,0x4f6d,0xab,0x98,0x29,0x1f,0x0c,0x3b,0xbd,0x4c); -#endif - - -typedef struct _MSNdis_PMCapabilityState -{ - // - ULONG NdisPMCapabilityState; - #define MSNdis_PMCapabilityState_NdisPMCapabilityState_SIZE sizeof(ULONG) - #define MSNdis_PMCapabilityState_NdisPMCapabilityState_ID 1 - -} MSNdis_PMCapabilityState, *PMSNdis_PMCapabilityState; - -#define MSNdis_PMCapabilityState_SIZE (FIELD_OFFSET(MSNdis_PMCapabilityState, NdisPMCapabilityState) + MSNdis_PMCapabilityState_NdisPMCapabilityState_SIZE) - -// MSNdis_PMCapabilitiesParam - MSNdis_PMCapabilitiesParam -#define MSNdis_PMCapabilitiesParamGuid \ - { 0xcccb122d,0xd5c4,0x4ee1, { 0x80,0x01,0xb8,0xad,0x6d,0x3c,0xe8,0x76 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMCapabilitiesParam_GUID, \ - 0xcccb122d,0xd5c4,0x4ee1,0x80,0x01,0xb8,0xad,0x6d,0x3c,0xe8,0x76); -#endif - - -typedef struct _MSNdis_PMCapabilitiesParam -{ - // - MSNdis_ObjectHeader Header; - #define MSNdis_PMCapabilitiesParam_Header_SIZE sizeof(MSNdis_ObjectHeader) - #define MSNdis_PMCapabilitiesParam_Header_ID 1 - - // - MSNdis_PMCapabilityState WakeOnPattern; - #define MSNdis_PMCapabilitiesParam_WakeOnPattern_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_WakeOnPattern_ID 2 - - // - MSNdis_PMCapabilityState WakeOnMagicPacket; - #define MSNdis_PMCapabilitiesParam_WakeOnMagicPacket_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_WakeOnMagicPacket_ID 3 - - // - MSNdis_PMCapabilityState DeviceSleepOnDisconnect; - #define MSNdis_PMCapabilitiesParam_DeviceSleepOnDisconnect_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_DeviceSleepOnDisconnect_ID 4 - - // - MSNdis_PMCapabilityState PMARPOffload; - #define MSNdis_PMCapabilitiesParam_PMARPOffload_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_PMARPOffload_ID 5 - - // - MSNdis_PMCapabilityState PMNDOffload; - #define MSNdis_PMCapabilitiesParam_PMNDOffload_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_PMNDOffload_ID 6 - - // - MSNdis_PMCapabilityState PMWiFiRekeyOffload; - #define MSNdis_PMCapabilitiesParam_PMWiFiRekeyOffload_SIZE sizeof(MSNdis_PMCapabilityState) - #define MSNdis_PMCapabilitiesParam_PMWiFiRekeyOffload_ID 7 - -} MSNdis_PMCapabilitiesParam, *PMSNdis_PMCapabilitiesParam; - -#define MSNdis_PMCapabilitiesParam_SIZE (FIELD_OFFSET(MSNdis_PMCapabilitiesParam, PMWiFiRekeyOffload) + MSNdis_PMCapabilitiesParam_PMWiFiRekeyOffload_SIZE) - -// MSNdis_PMCapabilities - MSNdis_PMCapabilities -// Query power management active capabilities -#define MSNdis_PMCapabilitiesGuid \ - { 0xb2cf76e3,0xb3ae,0x4394, { 0xa0,0x1f,0x33,0x8c,0x98,0x70,0xe9,0x39 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_PMCapabilities_GUID, \ - 0xb2cf76e3,0xb3ae,0x4394,0xa0,0x1f,0x33,0x8c,0x98,0x70,0xe9,0x39); -#endif - - -typedef struct _MSNdis_PMCapabilities -{ - // - MSNdis_PMCapabilitiesParam PMCapabilitiesParam; - #define MSNdis_PMCapabilities_PMCapabilitiesParam_SIZE sizeof(MSNdis_PMCapabilitiesParam) - #define MSNdis_PMCapabilities_PMCapabilitiesParam_ID 1 - -} MSNdis_PMCapabilities, *PMSNdis_PMCapabilities; - -#define MSNdis_PMCapabilities_SIZE (FIELD_OFFSET(MSNdis_PMCapabilities, PMCapabilitiesParam) + MSNdis_PMCapabilities_PMCapabilitiesParam_SIZE) - -// MSNdis_StatusResetStart - MSNdis_StatusResetStart -#define MSNdis_StatusResetStartGuid \ - { 0x981f2d76,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusResetStart_GUID, \ - 0x981f2d76,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_StatusResetEnd - MSNdis_StatusResetEnd -#define MSNdis_StatusResetEndGuid \ - { 0x981f2d77,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusResetEnd_GUID, \ - 0x981f2d77,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_StatusMediaConnect - MSNdis_StatusMediaConnect -#define MSNdis_StatusMediaConnectGuid \ - { 0x981f2d7d,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusMediaConnect_GUID, \ - 0x981f2d7d,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_StatusMediaDisconnect - MSNdis_StatusMediaDisconnect -#define MSNdis_StatusMediaDisconnectGuid \ - { 0x981f2d7e,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusMediaDisconnect_GUID, \ - 0x981f2d7e,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -// MSNdis_StatusMediaSpecificIndication - MSNdis_StatusMediaSpecificIndication -#define MSNdis_StatusMediaSpecificIndicationGuid \ - { 0x981f2d84,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusMediaSpecificIndication_GUID, \ - 0x981f2d84,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_StatusMediaSpecificIndication -{ - // - ULONG NumberElements; - #define MSNdis_StatusMediaSpecificIndication_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusMediaSpecificIndication_NumberElements_ID 1 - - // - UCHAR NdisStatusMediaSpecificIndication[1]; - #define MSNdis_StatusMediaSpecificIndication_NdisStatusMediaSpecificIndication_ID 2 - -} MSNdis_StatusMediaSpecificIndication, *PMSNdis_StatusMediaSpecificIndication; - -// MSNdis_StatusLinkSpeedChange - MSNdis_StatusLinkSpeedChange -#define MSNdis_StatusLinkSpeedChangeGuid \ - { 0x981f2d85,0xb1f3,0x11d0, { 0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusLinkSpeedChange_GUID, \ - 0x981f2d85,0xb1f3,0x11d0,0x8d,0xd7,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_StatusLinkSpeedChange -{ - // - MSNdis_NetworkLinkSpeed NdisStatusLinkSpeedChange; - #define MSNdis_StatusLinkSpeedChange_NdisStatusLinkSpeedChange_SIZE sizeof(MSNdis_NetworkLinkSpeed) - #define MSNdis_StatusLinkSpeedChange_NdisStatusLinkSpeedChange_ID 1 - -} MSNdis_StatusLinkSpeedChange, *PMSNdis_StatusLinkSpeedChange; - -#define MSNdis_StatusLinkSpeedChange_SIZE (FIELD_OFFSET(MSNdis_StatusLinkSpeedChange, NdisStatusLinkSpeedChange) + MSNdis_StatusLinkSpeedChange_NdisStatusLinkSpeedChange_SIZE) - -// MSNdis_StatusProtocolBind - MSNdis_StatusProtocolBind -#define MSNdis_StatusProtocolBindGuid \ - { 0x5413531c,0xb1f3,0x11d0, { 0xd7,0x8d,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusProtocolBind_GUID, \ - 0x5413531c,0xb1f3,0x11d0,0xd7,0x8d,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_StatusProtocolBind -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusProtocolBind_Transport_ID 1 - -} MSNdis_StatusProtocolBind, *PMSNdis_StatusProtocolBind; - -// MSNdis_StatusProtocolUnbind - MSNdis_StatusProtocolUnbind -#define MSNdis_StatusProtocolUnbindGuid \ - { 0x6e3ce1ec,0xb1f3,0x11d0, { 0xd7,0x8d,0x00,0xc0,0x4f,0xc3,0x35,0x8c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusProtocolUnbind_GUID, \ - 0x6e3ce1ec,0xb1f3,0x11d0,0xd7,0x8d,0x00,0xc0,0x4f,0xc3,0x35,0x8c); -#endif - - -typedef struct _MSNdis_StatusProtocolUnbind -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusProtocolUnbind_Transport_ID 1 - -} MSNdis_StatusProtocolUnbind, *PMSNdis_StatusProtocolUnbind; - -// MSNdis_StatusDevicePowerOn - MSNdis_StatusDevicePowerOn -#define MSNdis_StatusDevicePowerOnGuid \ - { 0x5f81cfd0,0xf046,0x4342, { 0x61,0xaf,0x89,0x5a,0xce,0xda,0xef,0xd9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDevicePowerOn_GUID, \ - 0x5f81cfd0,0xf046,0x4342,0x61,0xaf,0x89,0x5a,0xce,0xda,0xef,0xd9); -#endif - - -typedef struct _MSNdis_StatusDevicePowerOn -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusDevicePowerOn_Device_ID 1 - -} MSNdis_StatusDevicePowerOn, *PMSNdis_StatusDevicePowerOn; - -// MSNdis_StatusDevicePowerOff - MSNdis_StatusDevicePowerOff -#define MSNdis_StatusDevicePowerOffGuid \ - { 0x81bc8189,0xb026,0x46ab, { 0x64,0xb9,0xf1,0x82,0xe3,0x42,0x93,0x4e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDevicePowerOff_GUID, \ - 0x81bc8189,0xb026,0x46ab,0x64,0xb9,0xf1,0x82,0xe3,0x42,0x93,0x4e); -#endif - - -typedef struct _MSNdis_StatusDevicePowerOff -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusDevicePowerOff_Device_ID 1 - -} MSNdis_StatusDevicePowerOff, *PMSNdis_StatusDevicePowerOff; - -// MSNdis_StatusDevicePowerOnEx - MSNdis_StatusDevicePowerOnEx -#define MSNdis_StatusDevicePowerOnExGuid \ - { 0x2b440188,0x92ac,0x4f60, { 0x9b,0x2d,0x20,0xa3,0x0c,0xbb,0x6b,0xbe } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDevicePowerOnEx_GUID, \ - 0x2b440188,0x92ac,0x4f60,0x9b,0x2d,0x20,0xa3,0x0c,0xbb,0x6b,0xbe); -#endif - - -typedef struct _MSNdis_StatusDevicePowerOnEx -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusDevicePowerOnEx_Device_ID 1 - -} MSNdis_StatusDevicePowerOnEx, *PMSNdis_StatusDevicePowerOnEx; - -// MSNdis_StatusDevicePowerOffEx - MSNdis_StatusDevicePowerOffEx -#define MSNdis_StatusDevicePowerOffExGuid \ - { 0x4159353c,0x5cd7,0x42ce, { 0x8f,0xe4,0xa4,0x5a,0x23,0x80,0xcc,0x4f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDevicePowerOffEx_GUID, \ - 0x4159353c,0x5cd7,0x42ce,0x8f,0xe4,0xa4,0x5a,0x23,0x80,0xcc,0x4f); -#endif - - -typedef struct _MSNdis_StatusDevicePowerOffEx -{ - // - CHAR VariableData[1]; - #define MSNdis_StatusDevicePowerOffEx_Device_ID 1 - -} MSNdis_StatusDevicePowerOffEx, *PMSNdis_StatusDevicePowerOffEx; - -// MSNdis_StatusTaskOffloadChange - MSNdis_StatusTaskOffloadChange -#define MSNdis_StatusTaskOffloadChangeGuid \ - { 0x45049fc6,0x54d8,0x40c8, { 0x9c,0x3d,0xb0,0x11,0xc4,0xe7,0x15,0xbc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusTaskOffloadChange_GUID, \ - 0x45049fc6,0x54d8,0x40c8,0x9c,0x3d,0xb0,0x11,0xc4,0xe7,0x15,0xbc); -#endif - - -typedef struct _MSNdis_StatusTaskOffloadChange -{ - // - ULONG NumberElements; - #define MSNdis_StatusTaskOffloadChange_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusTaskOffloadChange_NumberElements_ID 1 - - // - UCHAR TaskOffloadCapabilities[1]; - #define MSNdis_StatusTaskOffloadChange_TaskOffloadCapabilities_ID 2 - -} MSNdis_StatusTaskOffloadChange, *PMSNdis_StatusTaskOffloadChange; - -// MSNdis_StatusPacketFilterChange - MSNdis_StatusPacketFilterChange -#define MSNdis_StatusPacketFilterChangeGuid \ - { 0xd47c5407,0x2e75,0x46dd, { 0x81,0x46,0x1d,0x7e,0xd2,0xd6,0xab,0x1d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusPacketFilterChange_GUID, \ - 0xd47c5407,0x2e75,0x46dd,0x81,0x46,0x1d,0x7e,0xd2,0xd6,0xab,0x1d); -#endif - - -typedef struct _MSNdis_StatusPacketFilterChange -{ - // - ULONG NumberElements; - #define MSNdis_StatusPacketFilterChange_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusPacketFilterChange_NumberElements_ID 1 - - // - UCHAR NdisPacketFilterStatusIndication[1]; - #define MSNdis_StatusPacketFilterChange_NdisPacketFilterStatusIndication_ID 2 - -} MSNdis_StatusPacketFilterChange, *PMSNdis_StatusPacketFilterChange; - -// MSNdis_StatusNetworkChange - MSNdis_StatusNetworkChange -#define MSNdis_StatusNetworkChangeGuid \ - { 0xca8a56f9,0xce81,0x40e6, { 0xa7,0x0f,0xa0,0x67,0xa4,0x76,0xe9,0xe9 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusNetworkChange_GUID, \ - 0xca8a56f9,0xce81,0x40e6,0xa7,0x0f,0xa0,0x67,0xa4,0x76,0xe9,0xe9); -#endif - - -typedef struct _MSNdis_StatusNetworkChange -{ - // - ULONG NumberElements; - #define MSNdis_StatusNetworkChange_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusNetworkChange_NumberElements_ID 1 - - // - UCHAR NdisNetworkChangeStatusIndication[1]; - #define MSNdis_StatusNetworkChange_NdisNetworkChangeStatusIndication_ID 2 - -} MSNdis_StatusNetworkChange, *PMSNdis_StatusNetworkChange; - -// MSNdis_StatusOperationalStatus - MSNdis_StatusOperationalStatus -#define MSNdis_StatusOperationalStatusGuid \ - { 0xf917b663,0x845e,0x4d3d, { 0xb6,0xd4,0x15,0xeb,0x27,0xaf,0x81,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusOperationalStatus_GUID, \ - 0xf917b663,0x845e,0x4d3d,0xb6,0xd4,0x15,0xeb,0x27,0xaf,0x81,0xc5); -#endif - - -typedef struct _MSNdis_StatusOperationalStatus -{ - // - ULONG NumberElements; - #define MSNdis_StatusOperationalStatus_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusOperationalStatus_NumberElements_ID 1 - - // - UCHAR NdisOperationalStatusStatusIndication[1]; - #define MSNdis_StatusOperationalStatus_NdisOperationalStatusStatusIndication_ID 2 - -} MSNdis_StatusOperationalStatus, *PMSNdis_StatusOperationalStatus; - -// MSNdis_StatusLinkState - MSNdis_StatusLinkState -#define MSNdis_StatusLinkStateGuid \ - { 0x64c6f797,0x878c,0x4311, { 0x92,0x46,0x65,0xdb,0xa8,0x9c,0x3a,0x61 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusLinkState_GUID, \ - 0x64c6f797,0x878c,0x4311,0x92,0x46,0x65,0xdb,0xa8,0x9c,0x3a,0x61); -#endif - - -typedef struct _MSNdis_StatusLinkState -{ - // - ULONG NumberElements; - #define MSNdis_StatusLinkState_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusLinkState_NumberElements_ID 1 - - // - UCHAR NdisLinkStateStatusIndication[1]; - #define MSNdis_StatusLinkState_NdisLinkStateStatusIndication_ID 2 - -} MSNdis_StatusLinkState, *PMSNdis_StatusLinkState; - -// MSNdis_StatusPortState - MSNdis_StatusPortState -#define MSNdis_StatusPortStateGuid \ - { 0x1dac0dfe,0x43e5,0x44b7, { 0xb7,0x59,0x7b,0xf4,0x6d,0xe3,0x2e,0x81 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusPortState_GUID, \ - 0x1dac0dfe,0x43e5,0x44b7,0xb7,0x59,0x7b,0xf4,0x6d,0xe3,0x2e,0x81); -#endif - - -typedef struct _MSNdis_StatusPortState -{ - // - ULONG NumberElements; - #define MSNdis_StatusPortState_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusPortState_NumberElements_ID 1 - - // - UCHAR NdisPortStateStatusIndication[1]; - #define MSNdis_StatusPortState_NdisPortStateStatusIndication_ID 2 - -} MSNdis_StatusPortState, *PMSNdis_StatusPortState; - -// MSNdis_StatusMediaSpecificIndicationEx - MSNdis_StatusMediaSpecificIndicationEx -#define MSNdis_StatusMediaSpecificIndicationExGuid \ - { 0xaaacfca7,0x954a,0x4632, { 0xa1,0x6e,0xa8,0xa6,0x37,0x93,0xa9,0xe5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusMediaSpecificIndicationEx_GUID, \ - 0xaaacfca7,0x954a,0x4632,0xa1,0x6e,0xa8,0xa6,0x37,0x93,0xa9,0xe5); -#endif - - -typedef struct _MSNdis_StatusMediaSpecificIndicationEx -{ - // - ULONG NumberElements; - #define MSNdis_StatusMediaSpecificIndicationEx_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusMediaSpecificIndicationEx_NumberElements_ID 1 - - // - UCHAR NdisStatusMediaSpecificIndication[1]; - #define MSNdis_StatusMediaSpecificIndicationEx_NdisStatusMediaSpecificIndication_ID 2 - -} MSNdis_StatusMediaSpecificIndicationEx, *PMSNdis_StatusMediaSpecificIndicationEx; - -// MSNdis_StatusHDSplitCurrentConfig - MSNdis_StatusHDSplitCurrentConfig -#define MSNdis_StatusHDSplitCurrentConfigGuid \ - { 0x6c744b0e,0xee9c,0x4205, { 0x90,0xa2,0x01,0x5f,0x6d,0x65,0xf4,0x03 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusHDSplitCurrentConfig_GUID, \ - 0x6c744b0e,0xee9c,0x4205,0x90,0xa2,0x01,0x5f,0x6d,0x65,0xf4,0x03); -#endif - - -typedef struct _MSNdis_StatusHDSplitCurrentConfig -{ - // - ULONG NumberElements; - #define MSNdis_StatusHDSplitCurrentConfig_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusHDSplitCurrentConfig_NumberElements_ID 1 - - // - UCHAR HDSplitCurrentConfig[1]; - #define MSNdis_StatusHDSplitCurrentConfig_HDSplitCurrentConfig_ID 2 - -} MSNdis_StatusHDSplitCurrentConfig, *PMSNdis_StatusHDSplitCurrentConfig; - -// MSNdis_StatusDot11ScanConfirm - MSNdis_StatusDot11ScanConfirm -#define MSNdis_StatusDot11ScanConfirmGuid \ - { 0x8500591e,0xa0c7,0x4efb, { 0x93,0x42,0xb6,0x74,0xb0,0x02,0xcb,0xe6 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11ScanConfirm_GUID, \ - 0x8500591e,0xa0c7,0x4efb,0x93,0x42,0xb6,0x74,0xb0,0x02,0xcb,0xe6); -#endif - - -typedef struct _MSNdis_StatusDot11ScanConfirm -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11ScanConfirm_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11ScanConfirm_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11ScanConfirmIndication[1]; - #define MSNdis_StatusDot11ScanConfirm_NdisStatusDot11ScanConfirmIndication_ID 2 - -} MSNdis_StatusDot11ScanConfirm, *PMSNdis_StatusDot11ScanConfirm; - -// MSNdis_StatusDot11MPDUMaxLengthChange - MSNdis_StatusDot11MPDUMaxLengthChange -#define MSNdis_StatusDot11MPDUMaxLengthChangeGuid \ - { 0x1d6560ec,0x8e48,0x4a3e, { 0x9f,0xd5,0xa0,0x1b,0x69,0x8d,0xb6,0xc5 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11MPDUMaxLengthChange_GUID, \ - 0x1d6560ec,0x8e48,0x4a3e,0x9f,0xd5,0xa0,0x1b,0x69,0x8d,0xb6,0xc5); -#endif - - -typedef struct _MSNdis_StatusDot11MPDUMaxLengthChange -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11MPDUMaxLengthChange_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11MPDUMaxLengthChange_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11MPDUMaxLengthChangeIndication[1]; - #define MSNdis_StatusDot11MPDUMaxLengthChange_NdisStatusDot11MPDUMaxLengthChangeIndication_ID 2 - -} MSNdis_StatusDot11MPDUMaxLengthChange, *PMSNdis_StatusDot11MPDUMaxLengthChange; - -// MSNdis_StatusDot11AssociationStart - MSNdis_StatusDot11AssociationStart -#define MSNdis_StatusDot11AssociationStartGuid \ - { 0x3927843b,0x6980,0x4b48, { 0xb1,0x5b,0x4d,0xe5,0x09,0x77,0xac,0x40 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11AssociationStart_GUID, \ - 0x3927843b,0x6980,0x4b48,0xb1,0x5b,0x4d,0xe5,0x09,0x77,0xac,0x40); -#endif - - -typedef struct _MSNdis_StatusDot11AssociationStart -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11AssociationStart_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11AssociationStart_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11AssociationStartIndication[1]; - #define MSNdis_StatusDot11AssociationStart_NdisStatusDot11AssociationStartIndication_ID 2 - -} MSNdis_StatusDot11AssociationStart, *PMSNdis_StatusDot11AssociationStart; - -// MSNdis_StatusDot11AssociationCompletion - MSNdis_StatusDot11AssociationCompletion -#define MSNdis_StatusDot11AssociationCompletionGuid \ - { 0x458bbea7,0x45a4,0x4ae2, { 0xb1,0x76,0xe5,0x1f,0x96,0xfc,0x05,0x68 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11AssociationCompletion_GUID, \ - 0x458bbea7,0x45a4,0x4ae2,0xb1,0x76,0xe5,0x1f,0x96,0xfc,0x05,0x68); -#endif - - -typedef struct _MSNdis_StatusDot11AssociationCompletion -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11AssociationCompletion_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11AssociationCompletion_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11AssociationCompletionIndication[1]; - #define MSNdis_StatusDot11AssociationCompletion_NdisStatusDot11AssociationCompletionIndication_ID 2 - -} MSNdis_StatusDot11AssociationCompletion, *PMSNdis_StatusDot11AssociationCompletion; - -// MSNdis_StatusDot11ConnectionStart - MSNdis_StatusDot11ConnectionStart -#define MSNdis_StatusDot11ConnectionStartGuid \ - { 0x7b74299d,0x998f,0x4454, { 0xad,0x08,0xc5,0xaf,0x28,0x57,0x6d,0x1b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11ConnectionStart_GUID, \ - 0x7b74299d,0x998f,0x4454,0xad,0x08,0xc5,0xaf,0x28,0x57,0x6d,0x1b); -#endif - - -typedef struct _MSNdis_StatusDot11ConnectionStart -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11ConnectionStart_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11ConnectionStart_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11ConnectionStartIndication[1]; - #define MSNdis_StatusDot11ConnectionStart_NdisStatusDot11ConnectionStartIndication_ID 2 - -} MSNdis_StatusDot11ConnectionStart, *PMSNdis_StatusDot11ConnectionStart; - -// MSNdis_StatusDot11ConnectionCompletion - MSNdis_StatusDot11ConnectionCompletion -#define MSNdis_StatusDot11ConnectionCompletionGuid \ - { 0x96efd9c9,0x7f1b,0x4a89, { 0xbc,0x04,0x3e,0x9e,0x27,0x17,0x65,0xf1 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11ConnectionCompletion_GUID, \ - 0x96efd9c9,0x7f1b,0x4a89,0xbc,0x04,0x3e,0x9e,0x27,0x17,0x65,0xf1); -#endif - - -typedef struct _MSNdis_StatusDot11ConnectionCompletion -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11ConnectionCompletion_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11ConnectionCompletion_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11ConnectionCompletionIndication[1]; - #define MSNdis_StatusDot11ConnectionCompletion_NdisStatusDot11ConnectionCompletionIndication_ID 2 - -} MSNdis_StatusDot11ConnectionCompletion, *PMSNdis_StatusDot11ConnectionCompletion; - -// MSNdis_StatusDot11RoamingStart - MSNdis_StatusDot11RoamingStart -#define MSNdis_StatusDot11RoamingStartGuid \ - { 0xb2412d0d,0x26c8,0x4f4e, { 0x93,0xdf,0xf7,0xb7,0x05,0xa0,0xb4,0x33 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11RoamingStart_GUID, \ - 0xb2412d0d,0x26c8,0x4f4e,0x93,0xdf,0xf7,0xb7,0x05,0xa0,0xb4,0x33); -#endif - - -typedef struct _MSNdis_StatusDot11RoamingStart -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11RoamingStart_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11RoamingStart_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11RoamingStartIndication[1]; - #define MSNdis_StatusDot11RoamingStart_NdisStatusDot11RoamingStartIndication_ID 2 - -} MSNdis_StatusDot11RoamingStart, *PMSNdis_StatusDot11RoamingStart; - -// MSNdis_StatusDot11RoamingCompletion - MSNdis_StatusDot11RoamingCompletion -#define MSNdis_StatusDot11RoamingCompletionGuid \ - { 0xdd9d47d1,0x282b,0x41e4, { 0xb9,0x24,0x66,0x36,0x88,0x17,0xfc,0xd3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11RoamingCompletion_GUID, \ - 0xdd9d47d1,0x282b,0x41e4,0xb9,0x24,0x66,0x36,0x88,0x17,0xfc,0xd3); -#endif - - -typedef struct _MSNdis_StatusDot11RoamingCompletion -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11RoamingCompletion_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11RoamingCompletion_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11RoamingCompletionIndication[1]; - #define MSNdis_StatusDot11RoamingCompletion_NdisStatusDot11RoamingCompletionIndication_ID 2 - -} MSNdis_StatusDot11RoamingCompletion, *PMSNdis_StatusDot11RoamingCompletion; - -// MSNdis_StatusDot11Disassociation - MSNdis_StatusDot11Disassociation -#define MSNdis_StatusDot11DisassociationGuid \ - { 0x3fbeb6fc,0x0fe2,0x43fd, { 0xb2,0xad,0xbd,0x99,0xb5,0xf9,0x3e,0x13 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11Disassociation_GUID, \ - 0x3fbeb6fc,0x0fe2,0x43fd,0xb2,0xad,0xbd,0x99,0xb5,0xf9,0x3e,0x13); -#endif - - -typedef struct _MSNdis_StatusDot11Disassociation -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11Disassociation_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11Disassociation_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11DisassociationIndication[1]; - #define MSNdis_StatusDot11Disassociation_NdisStatusDot11DisassociationIndication_ID 2 - -} MSNdis_StatusDot11Disassociation, *PMSNdis_StatusDot11Disassociation; - -// MSNdis_StatusDot11TkipmicFailure - MSNdis_StatusDot11TkipmicFailure -#define MSNdis_StatusDot11TkipmicFailureGuid \ - { 0x442c2ae4,0x9bc5,0x4b90, { 0xa8,0x89,0x45,0x5e,0xf2,0x20,0xf4,0xee } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11TkipmicFailure_GUID, \ - 0x442c2ae4,0x9bc5,0x4b90,0xa8,0x89,0x45,0x5e,0xf2,0x20,0xf4,0xee); -#endif - - -typedef struct _MSNdis_StatusDot11TkipmicFailure -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11TkipmicFailure_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11TkipmicFailure_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11TkipmicFailureIndication[1]; - #define MSNdis_StatusDot11TkipmicFailure_NdisStatusDot11TkipmicFailureIndication_ID 2 - -} MSNdis_StatusDot11TkipmicFailure, *PMSNdis_StatusDot11TkipmicFailure; - -// MSNdis_StatusDot11PmkidCandidateList - MSNdis_StatusDot11PmkidCandidateList -#define MSNdis_StatusDot11PmkidCandidateListGuid \ - { 0x26d8b8f6,0xdb82,0x49eb, { 0x8b,0xf3,0x4c,0x13,0x0e,0xf0,0x69,0x50 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11PmkidCandidateList_GUID, \ - 0x26d8b8f6,0xdb82,0x49eb,0x8b,0xf3,0x4c,0x13,0x0e,0xf0,0x69,0x50); -#endif - - -typedef struct _MSNdis_StatusDot11PmkidCandidateList -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11PmkidCandidateList_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11PmkidCandidateList_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11PmkidCandidateListIndication[1]; - #define MSNdis_StatusDot11PmkidCandidateList_NdisStatusDot11PmkidCandidateListIndication_ID 2 - -} MSNdis_StatusDot11PmkidCandidateList, *PMSNdis_StatusDot11PmkidCandidateList; - -// MSNdis_StatusDot11PhyStateChange - MSNdis_StatusDot11PhyStateChange -#define MSNdis_StatusDot11PhyStateChangeGuid \ - { 0xdeb45316,0x71b5,0x4736, { 0xbd,0xef,0x0a,0x9e,0x9f,0x4e,0x62,0xdc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11PhyStateChange_GUID, \ - 0xdeb45316,0x71b5,0x4736,0xbd,0xef,0x0a,0x9e,0x9f,0x4e,0x62,0xdc); -#endif - - -typedef struct _MSNdis_StatusDot11PhyStateChange -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11PhyStateChange_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11PhyStateChange_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11PhyStateChangeIndication[1]; - #define MSNdis_StatusDot11PhyStateChange_NdisStatusDot11PhyStateChangeIndication_ID 2 - -} MSNdis_StatusDot11PhyStateChange, *PMSNdis_StatusDot11PhyStateChange; - -// MSNdis_StatusDot11LinkQuality - MSNdis_StatusDot11LinkQuality -#define MSNdis_StatusDot11LinkQualityGuid \ - { 0xa3285184,0xea99,0x48ed, { 0x82,0x5e,0xa4,0x26,0xb1,0x1c,0x27,0x54 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSNdis_StatusDot11LinkQuality_GUID, \ - 0xa3285184,0xea99,0x48ed,0x82,0x5e,0xa4,0x26,0xb1,0x1c,0x27,0x54); -#endif - - -typedef struct _MSNdis_StatusDot11LinkQuality -{ - // - ULONG NumberElements; - #define MSNdis_StatusDot11LinkQuality_NumberElements_SIZE sizeof(ULONG) - #define MSNdis_StatusDot11LinkQuality_NumberElements_ID 1 - - // - UCHAR NdisStatusDot11LinkQualityIndication[1]; - #define MSNdis_StatusDot11LinkQuality_NdisStatusDot11LinkQualityIndication_ID 2 - -} MSNdis_StatusDot11LinkQuality, *PMSNdis_StatusDot11LinkQuality; - -// MSKeyboard_PortInformation - KEYBOARD_PORT_WMI_STD_DATA -#define KEYBOARD_PORT_WMI_STD_DATA_GUID \ - { 0x4731f89a,0x71cb,0x11d1, { 0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSKeyboard_PortInformation_GUID, \ - 0x4731f89a,0x71cb,0x11d1,0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _KEYBOARD_PORT_WMI_STD_DATA -{ - -#define KEYBOARD_PORT_WMI_STD_I8042 0 -#define KEYBOARD_PORT_WMI_STD_SERIAL 1 -#define KEYBOARD_PORT_WMI_STD_USB 2 - - // - ULONG ConnectorType; - #define KEYBOARD_PORT_WMI_STD_DATA_ConnectorType_SIZE sizeof(ULONG) - #define KEYBOARD_PORT_WMI_STD_DATA_ConnectorType_ID 1 - - // - ULONG DataQueueSize; - #define KEYBOARD_PORT_WMI_STD_DATA_DataQueueSize_SIZE sizeof(ULONG) - #define KEYBOARD_PORT_WMI_STD_DATA_DataQueueSize_ID 2 - - // - ULONG ErrorCount; - #define KEYBOARD_PORT_WMI_STD_DATA_ErrorCount_SIZE sizeof(ULONG) - #define KEYBOARD_PORT_WMI_STD_DATA_ErrorCount_ID 3 - - // - ULONG FunctionKeys; - #define KEYBOARD_PORT_WMI_STD_DATA_FunctionKeys_SIZE sizeof(ULONG) - #define KEYBOARD_PORT_WMI_STD_DATA_FunctionKeys_ID 4 - - // - ULONG Indicators; - #define KEYBOARD_PORT_WMI_STD_DATA_Indicators_SIZE sizeof(ULONG) - #define KEYBOARD_PORT_WMI_STD_DATA_Indicators_ID 5 - -} KEYBOARD_PORT_WMI_STD_DATA, *PKEYBOARD_PORT_WMI_STD_DATA; - -#define KEYBOARD_PORT_WMI_STD_DATA_SIZE (FIELD_OFFSET(KEYBOARD_PORT_WMI_STD_DATA, Indicators) + KEYBOARD_PORT_WMI_STD_DATA_Indicators_SIZE) - -// MSKeyboard_ExtendedID - KEYBOARD_ID_EX -#define KEYBOARD_PORT_WMI_EXTENDED_ID \ - { 0x6ac4e23d,0xa950,0x4518, { 0x8b,0x2b,0xaa,0x4d,0xcd,0x5f,0xe1,0x4a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSKeyboard_ExtendedID_GUID, \ - 0x6ac4e23d,0xa950,0x4518,0x8b,0x2b,0xaa,0x4d,0xcd,0x5f,0xe1,0x4a); -#endif - - -typedef struct _KEYBOARD_ID_EX -{ - // - ULONG Type; - #define KEYBOARD_ID_EX_Type_SIZE sizeof(ULONG) - #define KEYBOARD_ID_EX_Type_ID 1 - - // - ULONG Subtype; - #define KEYBOARD_ID_EX_Subtype_SIZE sizeof(ULONG) - #define KEYBOARD_ID_EX_Subtype_ID 2 - -} KEYBOARD_ID_EX, *PKEYBOARD_ID_EX; - -#define KEYBOARD_ID_EX_SIZE (FIELD_OFFSET(KEYBOARD_ID_EX, Subtype) + KEYBOARD_ID_EX_Subtype_SIZE) - -// MSMouse_PortInformation - POINTER_PORT_WMI_STD_DATA -#define POINTER_PORT_WMI_STD_DATA_GUID \ - { 0x4731f89c,0x71cb,0x11d1, { 0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMouse_PortInformation_GUID, \ - 0x4731f89c,0x71cb,0x11d1,0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _POINTER_PORT_WMI_STD_DATA -{ - -#define POINTER_PORT_WMI_STD_I8042 0 -#define POINTER_PORT_WMI_STD_SERIAL 1 -#define POINTER_PORT_WMI_STD_USB 2 - - // - ULONG ConnectorType; - #define POINTER_PORT_WMI_STD_DATA_ConnectorType_SIZE sizeof(ULONG) - #define POINTER_PORT_WMI_STD_DATA_ConnectorType_ID 1 - - // - ULONG DataQueueSize; - #define POINTER_PORT_WMI_STD_DATA_DataQueueSize_SIZE sizeof(ULONG) - #define POINTER_PORT_WMI_STD_DATA_DataQueueSize_ID 2 - - // - ULONG ErrorCount; - #define POINTER_PORT_WMI_STD_DATA_ErrorCount_SIZE sizeof(ULONG) - #define POINTER_PORT_WMI_STD_DATA_ErrorCount_ID 3 - - // - ULONG Buttons; - #define POINTER_PORT_WMI_STD_DATA_Buttons_SIZE sizeof(ULONG) - #define POINTER_PORT_WMI_STD_DATA_Buttons_ID 4 - - -#define POINTER_PORT_WMI_STD_MOUSE 0 -#define POINTER_PORT_WMI_STD_POINTER 1 -#define POINTER_PORT_WMI_ABSOLUTE_POINTER 2 -#define POINTER_PORT_WMI_TABLET 3 -#define POINTER_PORT_WMI_TOUCH_SCRENE 4 -#define POINTER_PORT_WMI_PEN 5 -#define POINTER_PORT_WMI_TRACK_BALL 6 -#define POINTER_PORT_WMI_OTHER 256 - - // - ULONG HardwareType; - #define POINTER_PORT_WMI_STD_DATA_HardwareType_SIZE sizeof(ULONG) - #define POINTER_PORT_WMI_STD_DATA_HardwareType_ID 5 - -} POINTER_PORT_WMI_STD_DATA, *PPOINTER_PORT_WMI_STD_DATA; - -#define POINTER_PORT_WMI_STD_DATA_SIZE (FIELD_OFFSET(POINTER_PORT_WMI_STD_DATA, HardwareType) + POINTER_PORT_WMI_STD_DATA_HardwareType_SIZE) - -// MSMouse_ClassInformation - MSMouse_ClassInformation -#define MSMouse_ClassInformationGuid \ - { 0x4731f89b,0x71cb,0x11d1, { 0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSMouse_ClassInformation_GUID, \ - 0x4731f89b,0x71cb,0x11d1,0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSMouse_ClassInformation -{ - // - ULONGLONG DeviceId; - #define MSMouse_ClassInformation_DeviceId_SIZE sizeof(ULONGLONG) - #define MSMouse_ClassInformation_DeviceId_ID 1 - -} MSMouse_ClassInformation, *PMSMouse_ClassInformation; - -#define MSMouse_ClassInformation_SIZE (FIELD_OFFSET(MSMouse_ClassInformation, DeviceId) + MSMouse_ClassInformation_DeviceId_SIZE) - -// MSKeyboard_ClassInformation - MSKeyboard_ClassInformation -#define MSKeyboard_ClassInformationGuid \ - { 0x4731f899,0x71cb,0x11d1, { 0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSKeyboard_ClassInformation_GUID, \ - 0x4731f899,0x71cb,0x11d1,0xa5,0x2c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSKeyboard_ClassInformation -{ - // - ULONGLONG DeviceId; - #define MSKeyboard_ClassInformation_DeviceId_SIZE sizeof(ULONGLONG) - #define MSKeyboard_ClassInformation_DeviceId_ID 1 - -} MSKeyboard_ClassInformation, *PMSKeyboard_ClassInformation; - -#define MSKeyboard_ClassInformation_SIZE (FIELD_OFFSET(MSKeyboard_ClassInformation, DeviceId) + MSKeyboard_ClassInformation_DeviceId_SIZE) - -// MSAgp_Information - AGP_STD_DATA -#define AGP_WMI_STD_DATA_GUID \ - { 0x8c27fbed,0x1c7b,0x47e4, { 0xa6,0x49,0x0e,0x38,0x9d,0x3a,0xda,0x4f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSAgp_Information_GUID, \ - 0x8c27fbed,0x1c7b,0x47e4,0xa6,0x49,0x0e,0x38,0x9d,0x3a,0xda,0x4f); -#endif - - -typedef struct _AGP_STD_DATA -{ - // - ULONGLONG ApertureBase; - #define AGP_STD_DATA_ApertureBase_SIZE sizeof(ULONGLONG) - #define AGP_STD_DATA_ApertureBase_ID 1 - - // - ULONG ApertureLength; - #define AGP_STD_DATA_ApertureLength_SIZE sizeof(ULONG) - #define AGP_STD_DATA_ApertureLength_ID 2 - - // - ULONG AgpStatus; - #define AGP_STD_DATA_AgpStatus_SIZE sizeof(ULONG) - #define AGP_STD_DATA_AgpStatus_ID 3 - - // - ULONG AgpCommand; - #define AGP_STD_DATA_AgpCommand_SIZE sizeof(ULONG) - #define AGP_STD_DATA_AgpCommand_ID 4 - -} AGP_STD_DATA, *PAGP_STD_DATA; - -#define AGP_STD_DATA_SIZE (FIELD_OFFSET(AGP_STD_DATA, AgpCommand) + AGP_STD_DATA_AgpCommand_SIZE) - -// MSAcpi_ThermalZoneTemperature - MSAcpi_ThermalZoneTemperature -#define MSAcpi_ThermalZoneTemperatureGuid \ - { 0xa1bc18c0,0xa7c8,0x11d1, { 0xbf,0x3c,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSAcpi_ThermalZoneTemperature_GUID, \ - 0xa1bc18c0,0xa7c8,0x11d1,0xbf,0x3c,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSAcpi_ThermalZoneTemperature -{ - // - ULONG ThermalStamp; - #define MSAcpi_ThermalZoneTemperature_ThermalStamp_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_ThermalStamp_ID 1 - - // - ULONG ThermalConstant1; - #define MSAcpi_ThermalZoneTemperature_ThermalConstant1_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_ThermalConstant1_ID 2 - - // - ULONG ThermalConstant2; - #define MSAcpi_ThermalZoneTemperature_ThermalConstant2_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_ThermalConstant2_ID 3 - - // - ULONG Reserved; - #define MSAcpi_ThermalZoneTemperature_Reserved_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_Reserved_ID 4 - - // - ULONG SamplingPeriod; - #define MSAcpi_ThermalZoneTemperature_SamplingPeriod_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_SamplingPeriod_ID 5 - - // - ULONG CurrentTemperature; - #define MSAcpi_ThermalZoneTemperature_CurrentTemperature_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_CurrentTemperature_ID 6 - - // - ULONG PassiveTripPoint; - #define MSAcpi_ThermalZoneTemperature_PassiveTripPoint_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_PassiveTripPoint_ID 7 - - // - ULONG CriticalTripPoint; - #define MSAcpi_ThermalZoneTemperature_CriticalTripPoint_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_CriticalTripPoint_ID 8 - - // - ULONG ActiveTripPointCount; - #define MSAcpi_ThermalZoneTemperature_ActiveTripPointCount_SIZE sizeof(ULONG) - #define MSAcpi_ThermalZoneTemperature_ActiveTripPointCount_ID 9 - - // - ULONG ActiveTripPoint[10]; - #define MSAcpi_ThermalZoneTemperature_ActiveTripPoint_SIZE sizeof(ULONG[10]) - #define MSAcpi_ThermalZoneTemperature_ActiveTripPoint_ID 10 - -} MSAcpi_ThermalZoneTemperature, *PMSAcpi_ThermalZoneTemperature; - -#define MSAcpi_ThermalZoneTemperature_SIZE (FIELD_OFFSET(MSAcpi_ThermalZoneTemperature, ActiveTripPoint) + MSAcpi_ThermalZoneTemperature_ActiveTripPoint_SIZE) - -// MSDiskDriver_Geometry - WMI_DISK_GEOMETRY -#define MSDiskDriver_GeometryGuid \ - { 0x25007f51,0x57c2,0x11d1, { 0xa5,0x28,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSDiskDriver_Geometry_GUID, \ - 0x25007f51,0x57c2,0x11d1,0xa5,0x28,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _WMI_DISK_GEOMETRY -{ - // - LONGLONG Cylinders; - #define WMI_DISK_GEOMETRY_Cylinders_SIZE sizeof(LONGLONG) - #define WMI_DISK_GEOMETRY_Cylinders_ID 1 - - // - ULONG MediaType; - #define WMI_DISK_GEOMETRY_MediaType_SIZE sizeof(ULONG) - #define WMI_DISK_GEOMETRY_MediaType_ID 2 - - // - ULONG TracksPerCylinder; - #define WMI_DISK_GEOMETRY_TracksPerCylinder_SIZE sizeof(ULONG) - #define WMI_DISK_GEOMETRY_TracksPerCylinder_ID 3 - - // - ULONG SectorsPerTrack; - #define WMI_DISK_GEOMETRY_SectorsPerTrack_SIZE sizeof(ULONG) - #define WMI_DISK_GEOMETRY_SectorsPerTrack_ID 4 - - // - ULONG BytesPerSector; - #define WMI_DISK_GEOMETRY_BytesPerSector_SIZE sizeof(ULONG) - #define WMI_DISK_GEOMETRY_BytesPerSector_ID 5 - -} WMI_DISK_GEOMETRY, *PWMI_DISK_GEOMETRY; - -#define WMI_DISK_GEOMETRY_SIZE (FIELD_OFFSET(WMI_DISK_GEOMETRY, BytesPerSector) + WMI_DISK_GEOMETRY_BytesPerSector_SIZE) - -// MSDiskDriver_PerformanceData - WMI_DISK_PERFORMANCE -#define MSDiskDriver_PerformanceDataGuid \ - { 0xbdd865d2,0xd7c1,0x11d0, { 0xa5,0x01,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSDiskDriver_PerformanceData_GUID, \ - 0xbdd865d2,0xd7c1,0x11d0,0xa5,0x01,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _WMI_DISK_PERFORMANCE -{ - // - LONGLONG BytesRead; - #define WMI_DISK_PERFORMANCE_BytesRead_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_BytesRead_ID 1 - - // - LONGLONG BytesWritten; - #define WMI_DISK_PERFORMANCE_BytesWritten_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_BytesWritten_ID 2 - - // - LONGLONG ReadTime; - #define WMI_DISK_PERFORMANCE_ReadTime_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_ReadTime_ID 3 - - // - LONGLONG WriteTime; - #define WMI_DISK_PERFORMANCE_WriteTime_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_WriteTime_ID 4 - - // - LONGLONG IdleTime; - #define WMI_DISK_PERFORMANCE_IdleTime_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_IdleTime_ID 5 - - // - ULONG ReadCount; - #define WMI_DISK_PERFORMANCE_ReadCount_SIZE sizeof(ULONG) - #define WMI_DISK_PERFORMANCE_ReadCount_ID 6 - - // - ULONG WriteCount; - #define WMI_DISK_PERFORMANCE_WriteCount_SIZE sizeof(ULONG) - #define WMI_DISK_PERFORMANCE_WriteCount_ID 7 - - // - ULONG QueueDepth; - #define WMI_DISK_PERFORMANCE_QueueDepth_SIZE sizeof(ULONG) - #define WMI_DISK_PERFORMANCE_QueueDepth_ID 8 - - // - ULONG SplitCount; - #define WMI_DISK_PERFORMANCE_SplitCount_SIZE sizeof(ULONG) - #define WMI_DISK_PERFORMANCE_SplitCount_ID 9 - - // - LONGLONG QueryTime; - #define WMI_DISK_PERFORMANCE_QueryTime_SIZE sizeof(LONGLONG) - #define WMI_DISK_PERFORMANCE_QueryTime_ID 10 - - // - ULONG StorageDeviceNumber; - #define WMI_DISK_PERFORMANCE_StorageDeviceNumber_SIZE sizeof(ULONG) - #define WMI_DISK_PERFORMANCE_StorageDeviceNumber_ID 11 - - // - USHORT StorageManagerName[8]; - #define WMI_DISK_PERFORMANCE_StorageManagerName_SIZE sizeof(USHORT[8]) - #define WMI_DISK_PERFORMANCE_StorageManagerName_ID 12 - -} WMI_DISK_PERFORMANCE, *PWMI_DISK_PERFORMANCE; - -#define WMI_DISK_PERFORMANCE_SIZE (FIELD_OFFSET(WMI_DISK_PERFORMANCE, StorageManagerName) + WMI_DISK_PERFORMANCE_StorageManagerName_SIZE) - -// MSDiskDriver_Performance - MSDiskDriver_Performance -#define MSDiskDriver_PerformanceGuid \ - { 0xbdd865d1,0xd7c1,0x11d0, { 0xa5,0x01,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSDiskDriver_Performance_GUID, \ - 0xbdd865d1,0xd7c1,0x11d0,0xa5,0x01,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _MSDiskDriver_Performance -{ - // - WMI_DISK_PERFORMANCE PerfData; - #define MSDiskDriver_Performance_PerfData_SIZE sizeof(WMI_DISK_PERFORMANCE) - #define MSDiskDriver_Performance_PerfData_ID 1 - - // - CHAR VariableData[1]; - #define MSDiskDriver_Performance_DeviceName_ID 2 - -} MSDiskDriver_Performance, *PMSDiskDriver_Performance; - -// MSStorageDriver_FailurePredictStatus - STORAGE_FAILURE_PREDICT_STATUS -#define WMI_STORAGE_FAILURE_PREDICT_STATUS_GUID \ - { 0x78ebc102,0x4cf9,0x11d2, { 0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_FailurePredictStatus_GUID, \ - 0x78ebc102,0x4cf9,0x11d2,0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _STORAGE_FAILURE_PREDICT_STATUS -{ - // - ULONG Reason; - #define STORAGE_FAILURE_PREDICT_STATUS_Reason_SIZE sizeof(ULONG) - #define STORAGE_FAILURE_PREDICT_STATUS_Reason_ID 1 - - // - BOOLEAN PredictFailure; - #define STORAGE_FAILURE_PREDICT_STATUS_PredictFailure_SIZE sizeof(BOOLEAN) - #define STORAGE_FAILURE_PREDICT_STATUS_PredictFailure_ID 2 - -} STORAGE_FAILURE_PREDICT_STATUS, *PSTORAGE_FAILURE_PREDICT_STATUS; - -#define STORAGE_FAILURE_PREDICT_STATUS_SIZE (FIELD_OFFSET(STORAGE_FAILURE_PREDICT_STATUS, PredictFailure) + STORAGE_FAILURE_PREDICT_STATUS_PredictFailure_SIZE) - -// MSStorageDriver_FailurePredictData - STORAGE_FAILURE_PREDICT_DATA -#define WMI_STORAGE_FAILURE_PREDICT_DATA_GUID \ - { 0x78ebc103,0x4cf9,0x11d2, { 0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_FailurePredictData_GUID, \ - 0x78ebc103,0x4cf9,0x11d2,0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _STORAGE_FAILURE_PREDICT_DATA -{ - // - ULONG Length; - #define STORAGE_FAILURE_PREDICT_DATA_Length_SIZE sizeof(ULONG) - #define STORAGE_FAILURE_PREDICT_DATA_Length_ID 1 - - // - UCHAR VendorSpecific[512]; - #define STORAGE_FAILURE_PREDICT_DATA_VendorSpecific_SIZE sizeof(UCHAR[512]) - #define STORAGE_FAILURE_PREDICT_DATA_VendorSpecific_ID 2 - -} STORAGE_FAILURE_PREDICT_DATA, *PSTORAGE_FAILURE_PREDICT_DATA; - -#define STORAGE_FAILURE_PREDICT_DATA_SIZE (FIELD_OFFSET(STORAGE_FAILURE_PREDICT_DATA, VendorSpecific) + STORAGE_FAILURE_PREDICT_DATA_VendorSpecific_SIZE) - -// MSStorageDriver_ATAPISmartData - ATAPI_FAILURE_PREDICT_DATA -#define WMI_ATAPI_FAILURE_PREDICT_DATA_GUID \ - { 0x78ebc103,0x4cf9,0x11d2, { 0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_ATAPISmartData_GUID, \ - 0x78ebc103,0x4cf9,0x11d2,0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _ATAPI_FAILURE_PREDICT_DATA -{ - // - ULONG Length; - #define ATAPI_FAILURE_PREDICT_DATA_Length_SIZE sizeof(ULONG) - #define ATAPI_FAILURE_PREDICT_DATA_Length_ID 1 - - // - UCHAR VendorSpecific[362]; - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific_SIZE sizeof(UCHAR[362]) - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific_ID 2 - - // - UCHAR OfflineCollectionStatus; - #define ATAPI_FAILURE_PREDICT_DATA_OfflineCollectionStatus_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_OfflineCollectionStatus_ID 3 - - // - UCHAR SelfTestStatus; - #define ATAPI_FAILURE_PREDICT_DATA_SelfTestStatus_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_SelfTestStatus_ID 4 - - // - USHORT TotalTime; - #define ATAPI_FAILURE_PREDICT_DATA_TotalTime_SIZE sizeof(USHORT) - #define ATAPI_FAILURE_PREDICT_DATA_TotalTime_ID 5 - - // - UCHAR VendorSpecific2; - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific2_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific2_ID 6 - - // - UCHAR OfflineCollectCapability; - #define ATAPI_FAILURE_PREDICT_DATA_OfflineCollectCapability_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_OfflineCollectCapability_ID 7 - - // - USHORT SmartCapability; - #define ATAPI_FAILURE_PREDICT_DATA_SmartCapability_SIZE sizeof(USHORT) - #define ATAPI_FAILURE_PREDICT_DATA_SmartCapability_ID 8 - - // - UCHAR ErrorLogCapability; - #define ATAPI_FAILURE_PREDICT_DATA_ErrorLogCapability_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_ErrorLogCapability_ID 9 - - // - UCHAR VendorSpecific3; - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific3_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific3_ID 10 - - // - UCHAR ShortPollTimeInMinutes; - #define ATAPI_FAILURE_PREDICT_DATA_ShortPollTimeInMinutes_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_ShortPollTimeInMinutes_ID 11 - - // - UCHAR ExtendedPollTimeInMinutes; - #define ATAPI_FAILURE_PREDICT_DATA_ExtendedPollTimeInMinutes_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_ExtendedPollTimeInMinutes_ID 12 - - // Reserved - UCHAR Reserved[12]; - #define ATAPI_FAILURE_PREDICT_DATA_Reserved_SIZE sizeof(UCHAR[12]) - #define ATAPI_FAILURE_PREDICT_DATA_Reserved_ID 13 - - // - UCHAR VendorSpecific4[125]; - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific4_SIZE sizeof(UCHAR[125]) - #define ATAPI_FAILURE_PREDICT_DATA_VendorSpecific4_ID 14 - - // - UCHAR Checksum; - #define ATAPI_FAILURE_PREDICT_DATA_Checksum_SIZE sizeof(UCHAR) - #define ATAPI_FAILURE_PREDICT_DATA_Checksum_ID 15 - -} ATAPI_FAILURE_PREDICT_DATA, *PATAPI_FAILURE_PREDICT_DATA; - -#define ATAPI_FAILURE_PREDICT_DATA_SIZE (FIELD_OFFSET(ATAPI_FAILURE_PREDICT_DATA, Checksum) + ATAPI_FAILURE_PREDICT_DATA_Checksum_SIZE) - -// MSStorageDriver_FailurePredictThresholds - STORAGE_FAILURE_PREDICT_THRESHOLDS -#define WMI_STORAGE_FAILURE_PREDICT_THRESHOLDS_GUID \ - { 0xdae10783,0xcc31,0x4d2a, { 0x8a,0x0f,0x86,0x1c,0x04,0x07,0x7a,0x95 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_FailurePredictThresholds_GUID, \ - 0xdae10783,0xcc31,0x4d2a,0x8a,0x0f,0x86,0x1c,0x04,0x07,0x7a,0x95); -#endif - - -typedef struct _STORAGE_FAILURE_PREDICT_THRESHOLDS -{ - // - UCHAR VendorSpecific[512]; - #define STORAGE_FAILURE_PREDICT_THRESHOLDS_VendorSpecific_SIZE sizeof(UCHAR[512]) - #define STORAGE_FAILURE_PREDICT_THRESHOLDS_VendorSpecific_ID 1 - -} STORAGE_FAILURE_PREDICT_THRESHOLDS, *PSTORAGE_FAILURE_PREDICT_THRESHOLDS; - -#define STORAGE_FAILURE_PREDICT_THRESHOLDS_SIZE (FIELD_OFFSET(STORAGE_FAILURE_PREDICT_THRESHOLDS, VendorSpecific) + STORAGE_FAILURE_PREDICT_THRESHOLDS_VendorSpecific_SIZE) - -// MSStorageDriver_FailurePredictEvent - STORAGE_FAILURE_PREDICT_EVENT -#define WMI_STORAGE_PREDICT_FAILURE_EVENT_GUID \ - { 0x78ebc104,0x4cf9,0x11d2, { 0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_FailurePredictEvent_GUID, \ - 0x78ebc104,0x4cf9,0x11d2,0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _STORAGE_FAILURE_PREDICT_EVENT -{ - // - ULONG Length; - #define STORAGE_FAILURE_PREDICT_EVENT_Length_SIZE sizeof(ULONG) - #define STORAGE_FAILURE_PREDICT_EVENT_Length_ID 1 - - // - UCHAR VendorSpecific[1]; - #define STORAGE_FAILURE_PREDICT_EVENT_VendorSpecific_ID 2 - -} STORAGE_FAILURE_PREDICT_EVENT, *PSTORAGE_FAILURE_PREDICT_EVENT; - -// MSStorageDriver_FailurePredictFunction - STORAGE_FAILURE_PREDICT_FUNCTION -#define WMI_STORAGE_FAILURE_PREDICT_FUNCTION_GUID \ - { 0x78ebc105,0x4cf9,0x11d2, { 0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_FailurePredictFunction_GUID, \ - 0x78ebc105,0x4cf9,0x11d2,0xba,0x4a,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - -// -// Method id definitions for MSStorageDriver_FailurePredictFunction -#define AllowPerformanceHit 1 -typedef struct _ALLOW_PERFORMANCE_HIT_IN -{ - // - BOOLEAN Allow; - #define ALLOW_PERFORMANCE_HIT_IN_Allow_SIZE sizeof(BOOLEAN) - #define ALLOW_PERFORMANCE_HIT_IN_Allow_ID 1 - -} ALLOW_PERFORMANCE_HIT_IN, *PALLOW_PERFORMANCE_HIT_IN; - -#define ALLOW_PERFORMANCE_HIT_IN_SIZE (FIELD_OFFSET(ALLOW_PERFORMANCE_HIT_IN, Allow) + ALLOW_PERFORMANCE_HIT_IN_Allow_SIZE) - -#define EnableDisableHardwareFailurePrediction 2 -typedef struct _ENABLE_DISABLE_FP_IN -{ - // - BOOLEAN Enable; - #define ENABLE_DISABLE_FP_IN_Enable_SIZE sizeof(BOOLEAN) - #define ENABLE_DISABLE_FP_IN_Enable_ID 1 - -} ENABLE_DISABLE_FP_IN, *PENABLE_DISABLE_FP_IN; - -#define ENABLE_DISABLE_FP_IN_SIZE (FIELD_OFFSET(ENABLE_DISABLE_FP_IN, Enable) + ENABLE_DISABLE_FP_IN_Enable_SIZE) - -#define EnableDisableFailurePredictionPolling 3 -typedef struct _ENABLE_DISABLE_FP_POLLING_IN -{ - // - ULONG Period; - #define ENABLE_DISABLE_FP_POLLING_IN_Period_SIZE sizeof(ULONG) - #define ENABLE_DISABLE_FP_POLLING_IN_Period_ID 1 - - // - BOOLEAN Enable; - #define ENABLE_DISABLE_FP_POLLING_IN_Enable_SIZE sizeof(BOOLEAN) - #define ENABLE_DISABLE_FP_POLLING_IN_Enable_ID 2 - -} ENABLE_DISABLE_FP_POLLING_IN, *PENABLE_DISABLE_FP_POLLING_IN; - -#define ENABLE_DISABLE_FP_POLLING_IN_SIZE (FIELD_OFFSET(ENABLE_DISABLE_FP_POLLING_IN, Enable) + ENABLE_DISABLE_FP_POLLING_IN_Enable_SIZE) - -#define GetFailurePredictionCapability 4 -typedef struct _GET_FP_CAPABILITY_OUT -{ - // - ULONG Capability; - #define GET_FP_CAPABILITY_OUT_Capability_SIZE sizeof(ULONG) - #define GET_FP_CAPABILITY_OUT_Capability_ID 1 - -} GET_FP_CAPABILITY_OUT, *PGET_FP_CAPABILITY_OUT; - -#define GET_FP_CAPABILITY_OUT_SIZE (FIELD_OFFSET(GET_FP_CAPABILITY_OUT, Capability) + GET_FP_CAPABILITY_OUT_Capability_SIZE) - -#define EnableOfflineDiags 5 -typedef struct _ENABLE_OFFLINE_DIAGS_OUT -{ - // - BOOLEAN Success; - #define ENABLE_OFFLINE_DIAGS_OUT_Success_SIZE sizeof(BOOLEAN) - #define ENABLE_OFFLINE_DIAGS_OUT_Success_ID 1 - -} ENABLE_OFFLINE_DIAGS_OUT, *PENABLE_OFFLINE_DIAGS_OUT; - -#define ENABLE_OFFLINE_DIAGS_OUT_SIZE (FIELD_OFFSET(ENABLE_OFFLINE_DIAGS_OUT, Success) + ENABLE_OFFLINE_DIAGS_OUT_Success_SIZE) - -#define ReadLogSectors 6 -typedef struct _READ_LOG_SECTORS_IN -{ - // - UCHAR LogAddress; - #define READ_LOG_SECTORS_IN_LogAddress_SIZE sizeof(UCHAR) - #define READ_LOG_SECTORS_IN_LogAddress_ID 1 - - // - UCHAR SectorCount; - #define READ_LOG_SECTORS_IN_SectorCount_SIZE sizeof(UCHAR) - #define READ_LOG_SECTORS_IN_SectorCount_ID 2 - -} READ_LOG_SECTORS_IN, *PREAD_LOG_SECTORS_IN; - -#define READ_LOG_SECTORS_IN_SIZE (FIELD_OFFSET(READ_LOG_SECTORS_IN, SectorCount) + READ_LOG_SECTORS_IN_SectorCount_SIZE) - -typedef struct _READ_LOG_SECTORS_OUT -{ - // - ULONG Length; - #define READ_LOG_SECTORS_OUT_Length_SIZE sizeof(ULONG) - #define READ_LOG_SECTORS_OUT_Length_ID 3 - - // - UCHAR LogSectors[1]; - #define READ_LOG_SECTORS_OUT_LogSectors_ID 4 - -} READ_LOG_SECTORS_OUT, *PREAD_LOG_SECTORS_OUT; - -#define WriteLogSectors 7 -typedef struct _WRITE_LOG_SECTORS_IN -{ - // - UCHAR LogAddress; - #define WRITE_LOG_SECTORS_IN_LogAddress_SIZE sizeof(UCHAR) - #define WRITE_LOG_SECTORS_IN_LogAddress_ID 1 - - // - UCHAR SectorCount; - #define WRITE_LOG_SECTORS_IN_SectorCount_SIZE sizeof(UCHAR) - #define WRITE_LOG_SECTORS_IN_SectorCount_ID 2 - - // - ULONG Length; - #define WRITE_LOG_SECTORS_IN_Length_SIZE sizeof(ULONG) - #define WRITE_LOG_SECTORS_IN_Length_ID 3 - - // - UCHAR LogSectors[1]; - #define WRITE_LOG_SECTORS_IN_LogSectors_ID 4 - -} WRITE_LOG_SECTORS_IN, *PWRITE_LOG_SECTORS_IN; - -typedef struct _WRITE_LOG_SECTORS_OUT -{ - // - BOOLEAN Success; - #define WRITE_LOG_SECTORS_OUT_Success_SIZE sizeof(BOOLEAN) - #define WRITE_LOG_SECTORS_OUT_Success_ID 5 - -} WRITE_LOG_SECTORS_OUT, *PWRITE_LOG_SECTORS_OUT; - -#define WRITE_LOG_SECTORS_OUT_SIZE (FIELD_OFFSET(WRITE_LOG_SECTORS_OUT, Success) + WRITE_LOG_SECTORS_OUT_Success_SIZE) - -#define ExecuteSelfTest 8 -typedef struct _EXECUTE_SELF_TEST_IN -{ - // - UCHAR Subcommand; - #define EXECUTE_SELF_TEST_IN_Subcommand_SIZE sizeof(UCHAR) - #define EXECUTE_SELF_TEST_IN_Subcommand_ID 1 - -} EXECUTE_SELF_TEST_IN, *PEXECUTE_SELF_TEST_IN; - -#define EXECUTE_SELF_TEST_IN_SIZE (FIELD_OFFSET(EXECUTE_SELF_TEST_IN, Subcommand) + EXECUTE_SELF_TEST_IN_Subcommand_SIZE) - -typedef struct _EXECUTE_SELF_TEST_OUT -{ - // - ULONG ReturnCode; - #define EXECUTE_SELF_TEST_OUT_ReturnCode_SIZE sizeof(ULONG) - #define EXECUTE_SELF_TEST_OUT_ReturnCode_ID 2 - -} EXECUTE_SELF_TEST_OUT, *PEXECUTE_SELF_TEST_OUT; - -#define EXECUTE_SELF_TEST_OUT_SIZE (FIELD_OFFSET(EXECUTE_SELF_TEST_OUT, ReturnCode) + EXECUTE_SELF_TEST_OUT_ReturnCode_SIZE) - - -// MSStorageDriver_ScsiInfoExceptions - STORAGE_SCSI_INFO_EXCEPTIONS -#define WMI_STORAGE_SCSI_INFO_EXCEPTIONS_GUID \ - { 0x1101d829,0x167b,0x4ebf, { 0xac,0xae,0x28,0xca,0xb7,0xc3,0x48,0x02 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSStorageDriver_ScsiInfoExceptions_GUID, \ - 0x1101d829,0x167b,0x4ebf,0xac,0xae,0x28,0xca,0xb7,0xc3,0x48,0x02); -#endif - - -typedef struct _STORAGE_SCSI_INFO_EXCEPTIONS -{ - // - BOOLEAN PageSavable; - #define STORAGE_SCSI_INFO_EXCEPTIONS_PageSavable_SIZE sizeof(BOOLEAN) - #define STORAGE_SCSI_INFO_EXCEPTIONS_PageSavable_ID 1 - - // - UCHAR Flags; - #define STORAGE_SCSI_INFO_EXCEPTIONS_Flags_SIZE sizeof(UCHAR) - #define STORAGE_SCSI_INFO_EXCEPTIONS_Flags_ID 2 - - // - UCHAR MRIE; - #define STORAGE_SCSI_INFO_EXCEPTIONS_MRIE_SIZE sizeof(UCHAR) - #define STORAGE_SCSI_INFO_EXCEPTIONS_MRIE_ID 3 - - // - UCHAR Padding; - #define STORAGE_SCSI_INFO_EXCEPTIONS_Padding_SIZE sizeof(UCHAR) - #define STORAGE_SCSI_INFO_EXCEPTIONS_Padding_ID 4 - - // - ULONG IntervalTimer; - #define STORAGE_SCSI_INFO_EXCEPTIONS_IntervalTimer_SIZE sizeof(ULONG) - #define STORAGE_SCSI_INFO_EXCEPTIONS_IntervalTimer_ID 5 - - // - ULONG ReportCount; - #define STORAGE_SCSI_INFO_EXCEPTIONS_ReportCount_SIZE sizeof(ULONG) - #define STORAGE_SCSI_INFO_EXCEPTIONS_ReportCount_ID 6 - -} STORAGE_SCSI_INFO_EXCEPTIONS, *PSTORAGE_SCSI_INFO_EXCEPTIONS; - -#define STORAGE_SCSI_INFO_EXCEPTIONS_SIZE (FIELD_OFFSET(STORAGE_SCSI_INFO_EXCEPTIONS, ReportCount) + STORAGE_SCSI_INFO_EXCEPTIONS_ReportCount_SIZE) - -// MSIde_PortDeviceInfo - MSIde_PortDeviceInfo -#define MSIde_PortDeviceInfoGuid \ - { 0x53f5630f,0xb6bf,0x11d0, { 0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSIde_PortDeviceInfo_GUID, \ - 0x53f5630f,0xb6bf,0x11d0,0x94,0xf2,0x00,0xa0,0xc9,0x1e,0xfb,0x8b); -#endif - - -typedef struct _MSIde_PortDeviceInfo -{ - // - UCHAR Bus; - #define MSIde_PortDeviceInfo_Bus_SIZE sizeof(UCHAR) - #define MSIde_PortDeviceInfo_Bus_ID 1 - - // - UCHAR Target; - #define MSIde_PortDeviceInfo_Target_SIZE sizeof(UCHAR) - #define MSIde_PortDeviceInfo_Target_ID 2 - - // - UCHAR Lun; - #define MSIde_PortDeviceInfo_Lun_SIZE sizeof(UCHAR) - #define MSIde_PortDeviceInfo_Lun_ID 3 - -} MSIde_PortDeviceInfo, *PMSIde_PortDeviceInfo; - -#define MSIde_PortDeviceInfo_SIZE (FIELD_OFFSET(MSIde_PortDeviceInfo, Lun) + MSIde_PortDeviceInfo_Lun_SIZE) - -// MSSerial_PortName - MSSerial_PortName -#define SERIAL_PORT_WMI_NAME_GUID \ - { 0xa0ec11a8,0xb16c,0x11d1, { 0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSerial_PortName_GUID, \ - 0xa0ec11a8,0xb16c,0x11d1,0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d); -#endif - - -typedef struct _MSSerial_PortName -{ - // - CHAR VariableData[1]; - #define MSSerial_PortName_PortName_ID 1 - -} MSSerial_PortName, *PMSSerial_PortName; - -// MSSerial_CommInfo - SERIAL_WMI_COMM_DATA -#define SERIAL_PORT_WMI_COMM_GUID \ - { 0xedb16a62,0xb16c,0x11d1, { 0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSerial_CommInfo_GUID, \ - 0xedb16a62,0xb16c,0x11d1,0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d); -#endif - - -typedef struct _SERIAL_WMI_COMM_DATA -{ - // - ULONG BaudRate; - #define SERIAL_WMI_COMM_DATA_BaudRate_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_BaudRate_ID 1 - - // - ULONG BitsPerByte; - #define SERIAL_WMI_COMM_DATA_BitsPerByte_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_BitsPerByte_ID 2 - - -#define SERIAL_WMI_PARITY_NONE 0 -#define SERIAL_WMI_PARITY_ODD 1 -#define SERIAL_WMI_PARITY_EVEN 2 -#define SERIAL_WMI_PARITY_SPACE 3 -#define SERIAL_WMI_PARITY_MARK 4 - - // - ULONG Parity; - #define SERIAL_WMI_COMM_DATA_Parity_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_Parity_ID 3 - - // - BOOLEAN ParityCheckEnable; - #define SERIAL_WMI_COMM_DATA_ParityCheckEnable_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_ParityCheckEnable_ID 4 - - -#define SERIAL_WMI_STOP_1 0 -#define SERIAL_WMI_STOP_1_5 1 -#define SERIAL_WMI_STOP_2 2 - - // - ULONG StopBits; - #define SERIAL_WMI_COMM_DATA_StopBits_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_StopBits_ID 5 - - // - ULONG XoffCharacter; - #define SERIAL_WMI_COMM_DATA_XoffCharacter_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_XoffCharacter_ID 6 - - // - ULONG XoffXmitThreshold; - #define SERIAL_WMI_COMM_DATA_XoffXmitThreshold_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_XoffXmitThreshold_ID 7 - - // - ULONG XonCharacter; - #define SERIAL_WMI_COMM_DATA_XonCharacter_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_XonCharacter_ID 8 - - // - ULONG XonXmitThreshold; - #define SERIAL_WMI_COMM_DATA_XonXmitThreshold_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_XonXmitThreshold_ID 9 - - // - ULONG MaximumBaudRate; - #define SERIAL_WMI_COMM_DATA_MaximumBaudRate_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_MaximumBaudRate_ID 10 - - // - ULONG MaximumOutputBufferSize; - #define SERIAL_WMI_COMM_DATA_MaximumOutputBufferSize_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_MaximumOutputBufferSize_ID 11 - - // - ULONG MaximumInputBufferSize; - #define SERIAL_WMI_COMM_DATA_MaximumInputBufferSize_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMM_DATA_MaximumInputBufferSize_ID 12 - - // - BOOLEAN Support16BitMode; - #define SERIAL_WMI_COMM_DATA_Support16BitMode_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_Support16BitMode_ID 13 - - // - BOOLEAN SupportDTRDSR; - #define SERIAL_WMI_COMM_DATA_SupportDTRDSR_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SupportDTRDSR_ID 14 - - // - BOOLEAN SupportIntervalTimeouts; - #define SERIAL_WMI_COMM_DATA_SupportIntervalTimeouts_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SupportIntervalTimeouts_ID 15 - - // - BOOLEAN SupportParityCheck; - #define SERIAL_WMI_COMM_DATA_SupportParityCheck_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SupportParityCheck_ID 16 - - // - BOOLEAN SupportRTSCTS; - #define SERIAL_WMI_COMM_DATA_SupportRTSCTS_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SupportRTSCTS_ID 17 - - // - BOOLEAN SupportXonXoff; - #define SERIAL_WMI_COMM_DATA_SupportXonXoff_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SupportXonXoff_ID 18 - - // - BOOLEAN SettableBaudRate; - #define SERIAL_WMI_COMM_DATA_SettableBaudRate_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableBaudRate_ID 19 - - // - BOOLEAN SettableDataBits; - #define SERIAL_WMI_COMM_DATA_SettableDataBits_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableDataBits_ID 20 - - // - BOOLEAN SettableFlowControl; - #define SERIAL_WMI_COMM_DATA_SettableFlowControl_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableFlowControl_ID 21 - - // - BOOLEAN SettableParity; - #define SERIAL_WMI_COMM_DATA_SettableParity_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableParity_ID 22 - - // - BOOLEAN SettableParityCheck; - #define SERIAL_WMI_COMM_DATA_SettableParityCheck_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableParityCheck_ID 23 - - // - BOOLEAN SettableStopBits; - #define SERIAL_WMI_COMM_DATA_SettableStopBits_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_SettableStopBits_ID 24 - - // - BOOLEAN IsBusy; - #define SERIAL_WMI_COMM_DATA_IsBusy_SIZE sizeof(BOOLEAN) - #define SERIAL_WMI_COMM_DATA_IsBusy_ID 25 - -} SERIAL_WMI_COMM_DATA, *PSERIAL_WMI_COMM_DATA; - -#define SERIAL_WMI_COMM_DATA_SIZE (FIELD_OFFSET(SERIAL_WMI_COMM_DATA, IsBusy) + SERIAL_WMI_COMM_DATA_IsBusy_SIZE) - -// MSSerial_HardwareConfiguration - SERIAL_WMI_HW_DATA -#define SERIAL_PORT_WMI_HW_GUID \ - { 0x270b9b86,0xb16d,0x11d1, { 0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSerial_HardwareConfiguration_GUID, \ - 0x270b9b86,0xb16d,0x11d1,0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d); -#endif - - -typedef struct _SERIAL_WMI_HW_DATA -{ - // - ULONG IrqNumber; - #define SERIAL_WMI_HW_DATA_IrqNumber_SIZE sizeof(ULONG) - #define SERIAL_WMI_HW_DATA_IrqNumber_ID 1 - - // - ULONG IrqVector; - #define SERIAL_WMI_HW_DATA_IrqVector_SIZE sizeof(ULONG) - #define SERIAL_WMI_HW_DATA_IrqVector_ID 2 - - // - ULONG IrqLevel; - #define SERIAL_WMI_HW_DATA_IrqLevel_SIZE sizeof(ULONG) - #define SERIAL_WMI_HW_DATA_IrqLevel_ID 3 - - // - ULONGLONG IrqAffinityMask; - #define SERIAL_WMI_HW_DATA_IrqAffinityMask_SIZE sizeof(ULONGLONG) - #define SERIAL_WMI_HW_DATA_IrqAffinityMask_ID 4 - - -#define SERIAL_WMI_INTTYPE_LATCHED 0 -#define SERIAL_WMI_INTTYPE_LEVEL 1 - - // - ULONG InterruptType; - #define SERIAL_WMI_HW_DATA_InterruptType_SIZE sizeof(ULONG) - #define SERIAL_WMI_HW_DATA_InterruptType_ID 5 - - // - ULONGLONG BaseIOAddress; - #define SERIAL_WMI_HW_DATA_BaseIOAddress_SIZE sizeof(ULONGLONG) - #define SERIAL_WMI_HW_DATA_BaseIOAddress_ID 6 - -} SERIAL_WMI_HW_DATA, *PSERIAL_WMI_HW_DATA; - -#define SERIAL_WMI_HW_DATA_SIZE (FIELD_OFFSET(SERIAL_WMI_HW_DATA, BaseIOAddress) + SERIAL_WMI_HW_DATA_BaseIOAddress_SIZE) - -// MSSerial_PerformanceInformation - SERIAL_WMI_PERF_DATA -#define SERIAL_PORT_WMI_PERF_GUID \ - { 0x56415acc,0xb16d,0x11d1, { 0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSerial_PerformanceInformation_GUID, \ - 0x56415acc,0xb16d,0x11d1,0xbd,0x98,0x00,0xa0,0xc9,0x06,0xbe,0x2d); -#endif - - -typedef struct _SERIAL_WMI_PERF_DATA -{ - // - ULONG ReceivedCount; - #define SERIAL_WMI_PERF_DATA_ReceivedCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_ReceivedCount_ID 1 - - // - ULONG TransmittedCount; - #define SERIAL_WMI_PERF_DATA_TransmittedCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_TransmittedCount_ID 2 - - // - ULONG FrameErrorCount; - #define SERIAL_WMI_PERF_DATA_FrameErrorCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_FrameErrorCount_ID 3 - - // - ULONG SerialOverrunErrorCount; - #define SERIAL_WMI_PERF_DATA_SerialOverrunErrorCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_SerialOverrunErrorCount_ID 4 - - // - ULONG BufferOverrunErrorCount; - #define SERIAL_WMI_PERF_DATA_BufferOverrunErrorCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_BufferOverrunErrorCount_ID 5 - - // - ULONG ParityErrorCount; - #define SERIAL_WMI_PERF_DATA_ParityErrorCount_SIZE sizeof(ULONG) - #define SERIAL_WMI_PERF_DATA_ParityErrorCount_ID 6 - -} SERIAL_WMI_PERF_DATA, *PSERIAL_WMI_PERF_DATA; - -#define SERIAL_WMI_PERF_DATA_SIZE (FIELD_OFFSET(SERIAL_WMI_PERF_DATA, ParityErrorCount) + SERIAL_WMI_PERF_DATA_ParityErrorCount_SIZE) - -// MSSerial_CommProperties - SERIAL_WMI_COMMPROP -#define SERIAL_PORT_WMI_PROPERTIES_GUID \ - { 0x8209ec2a,0x2d6b,0x11d2, { 0xba,0x49,0x00,0xa0,0xc9,0x06,0x29,0x10 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSSerial_CommProperties_GUID, \ - 0x8209ec2a,0x2d6b,0x11d2,0xba,0x49,0x00,0xa0,0xc9,0x06,0x29,0x10); -#endif - - -typedef struct _SERIAL_WMI_COMMPROP -{ - // - USHORT wPacketLength; - #define SERIAL_WMI_COMMPROP_wPacketLength_SIZE sizeof(USHORT) - #define SERIAL_WMI_COMMPROP_wPacketLength_ID 1 - - // - USHORT wPacketVersion; - #define SERIAL_WMI_COMMPROP_wPacketVersion_SIZE sizeof(USHORT) - #define SERIAL_WMI_COMMPROP_wPacketVersion_ID 2 - - // - ULONG dwServiceMask; - #define SERIAL_WMI_COMMPROP_dwServiceMask_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwServiceMask_ID 3 - - // - ULONG dwReserved1; - #define SERIAL_WMI_COMMPROP_dwReserved1_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwReserved1_ID 4 - - // - ULONG dwMaxTxQueue; - #define SERIAL_WMI_COMMPROP_dwMaxTxQueue_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwMaxTxQueue_ID 5 - - // - ULONG dwMaxRxQueue; - #define SERIAL_WMI_COMMPROP_dwMaxRxQueue_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwMaxRxQueue_ID 6 - - // - ULONG dwMaxBaud; - #define SERIAL_WMI_COMMPROP_dwMaxBaud_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwMaxBaud_ID 7 - - // - ULONG dwProvSubType; - #define SERIAL_WMI_COMMPROP_dwProvSubType_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwProvSubType_ID 8 - - // - ULONG dwProvCapabilities; - #define SERIAL_WMI_COMMPROP_dwProvCapabilities_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwProvCapabilities_ID 9 - - // - ULONG dwSettableParams; - #define SERIAL_WMI_COMMPROP_dwSettableParams_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwSettableParams_ID 10 - - // - ULONG dwSettableBaud; - #define SERIAL_WMI_COMMPROP_dwSettableBaud_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwSettableBaud_ID 11 - - // - USHORT wSettableData; - #define SERIAL_WMI_COMMPROP_wSettableData_SIZE sizeof(USHORT) - #define SERIAL_WMI_COMMPROP_wSettableData_ID 12 - - // - USHORT wSettableStopParity; - #define SERIAL_WMI_COMMPROP_wSettableStopParity_SIZE sizeof(USHORT) - #define SERIAL_WMI_COMMPROP_wSettableStopParity_ID 13 - - // - ULONG dwCurrentTxQueue; - #define SERIAL_WMI_COMMPROP_dwCurrentTxQueue_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwCurrentTxQueue_ID 14 - - // - ULONG dwCurrentRxQueue; - #define SERIAL_WMI_COMMPROP_dwCurrentRxQueue_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwCurrentRxQueue_ID 15 - - // - ULONG dwProvSpec1; - #define SERIAL_WMI_COMMPROP_dwProvSpec1_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwProvSpec1_ID 16 - - // - ULONG dwProvSpec2; - #define SERIAL_WMI_COMMPROP_dwProvSpec2_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwProvSpec2_ID 17 - - // - ULONG dwProvCharSize; - #define SERIAL_WMI_COMMPROP_dwProvCharSize_SIZE sizeof(ULONG) - #define SERIAL_WMI_COMMPROP_dwProvCharSize_ID 18 - - // - UCHAR wcProvChar[1]; - #define SERIAL_WMI_COMMPROP_wcProvChar_ID 19 - -} SERIAL_WMI_COMMPROP, *PSERIAL_WMI_COMMPROP; - -// MSParallel_AllocFreeCounts - PARPORT_WMI_ALLOC_FREE_COUNTS -#define PARPORT_WMI_ALLOCATE_FREE_COUNTS_GUID \ - { 0x4bbb69ea,0x6853,0x11d2, { 0x8e,0xce,0x00,0xc0,0x4f,0x8e,0xf4,0x81 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSParallel_AllocFreeCounts_GUID, \ - 0x4bbb69ea,0x6853,0x11d2,0x8e,0xce,0x00,0xc0,0x4f,0x8e,0xf4,0x81); -#endif - - -typedef struct _PARPORT_WMI_ALLOC_FREE_COUNTS -{ - // - ULONG PortAllocates; - #define PARPORT_WMI_ALLOC_FREE_COUNTS_PortAllocates_SIZE sizeof(ULONG) - #define PARPORT_WMI_ALLOC_FREE_COUNTS_PortAllocates_ID 1 - - // - ULONG PortFrees; - #define PARPORT_WMI_ALLOC_FREE_COUNTS_PortFrees_SIZE sizeof(ULONG) - #define PARPORT_WMI_ALLOC_FREE_COUNTS_PortFrees_ID 2 - -} PARPORT_WMI_ALLOC_FREE_COUNTS, *PPARPORT_WMI_ALLOC_FREE_COUNTS; - -#define PARPORT_WMI_ALLOC_FREE_COUNTS_SIZE (FIELD_OFFSET(PARPORT_WMI_ALLOC_FREE_COUNTS, PortFrees) + PARPORT_WMI_ALLOC_FREE_COUNTS_PortFrees_SIZE) - -// MSParallel_DeviceBytesTransferred - PARALLEL_WMI_LOG_INFO -#define PARALLEL_WMI_BYTES_TRANSFERRED_GUID \ - { 0x89fef2d6,0x654b,0x11d2, { 0x9e,0x15,0x00,0xc0,0x4f,0x8e,0xf4,0x81 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSParallel_DeviceBytesTransferred_GUID, \ - 0x89fef2d6,0x654b,0x11d2,0x9e,0x15,0x00,0xc0,0x4f,0x8e,0xf4,0x81); -#endif - - -typedef struct _PARALLEL_WMI_LOG_INFO -{ - // - ULONG Flags1; - #define PARALLEL_WMI_LOG_INFO_Flags1_SIZE sizeof(ULONG) - #define PARALLEL_WMI_LOG_INFO_Flags1_ID 1 - - // - ULONG Flags2; - #define PARALLEL_WMI_LOG_INFO_Flags2_SIZE sizeof(ULONG) - #define PARALLEL_WMI_LOG_INFO_Flags2_ID 2 - - // - ULONG spare[2]; - #define PARALLEL_WMI_LOG_INFO_spare_SIZE sizeof(ULONG[2]) - #define PARALLEL_WMI_LOG_INFO_spare_ID 3 - - // - LONGLONG SppWriteCount; - #define PARALLEL_WMI_LOG_INFO_SppWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_SppWriteCount_ID 4 - - // - LONGLONG NibbleReadCount; - #define PARALLEL_WMI_LOG_INFO_NibbleReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_NibbleReadCount_ID 5 - - // - LONGLONG BoundedEcpWriteCount; - #define PARALLEL_WMI_LOG_INFO_BoundedEcpWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_BoundedEcpWriteCount_ID 6 - - // - LONGLONG BoundedEcpReadCount; - #define PARALLEL_WMI_LOG_INFO_BoundedEcpReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_BoundedEcpReadCount_ID 7 - - // - LONGLONG HwEcpWriteCount; - #define PARALLEL_WMI_LOG_INFO_HwEcpWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_HwEcpWriteCount_ID 8 - - // - LONGLONG HwEcpReadCount; - #define PARALLEL_WMI_LOG_INFO_HwEcpReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_HwEcpReadCount_ID 9 - - // - LONGLONG SwEcpWriteCount; - #define PARALLEL_WMI_LOG_INFO_SwEcpWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_SwEcpWriteCount_ID 10 - - // - LONGLONG SwEcpReadCount; - #define PARALLEL_WMI_LOG_INFO_SwEcpReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_SwEcpReadCount_ID 11 - - // - LONGLONG HwEppWriteCount; - #define PARALLEL_WMI_LOG_INFO_HwEppWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_HwEppWriteCount_ID 12 - - // - LONGLONG HwEppReadCount; - #define PARALLEL_WMI_LOG_INFO_HwEppReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_HwEppReadCount_ID 13 - - // - LONGLONG SwEppWriteCount; - #define PARALLEL_WMI_LOG_INFO_SwEppWriteCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_SwEppWriteCount_ID 14 - - // - LONGLONG SwEppReadCount; - #define PARALLEL_WMI_LOG_INFO_SwEppReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_SwEppReadCount_ID 15 - - // - LONGLONG ByteReadCount; - #define PARALLEL_WMI_LOG_INFO_ByteReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_ByteReadCount_ID 16 - - // - LONGLONG ChannelNibbleReadCount; - #define PARALLEL_WMI_LOG_INFO_ChannelNibbleReadCount_SIZE sizeof(LONGLONG) - #define PARALLEL_WMI_LOG_INFO_ChannelNibbleReadCount_ID 17 - -} PARALLEL_WMI_LOG_INFO, *PPARALLEL_WMI_LOG_INFO; - -#define PARALLEL_WMI_LOG_INFO_SIZE (FIELD_OFFSET(PARALLEL_WMI_LOG_INFO, ChannelNibbleReadCount) + PARALLEL_WMI_LOG_INFO_ChannelNibbleReadCount_SIZE) - -// MSRedbook_DriverInformation - REDBOOK_WMI_STD_DATA -#define GUID_REDBOOK_WMI_STD_DATA \ - { 0xb90550e7,0xae0a,0x11d1, { 0xa5,0x71,0x00,0xc0,0x4f,0xa3,0x47,0x30 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSRedbook_DriverInformationGuid, \ - 0xb90550e7,0xae0a,0x11d1,0xa5,0x71,0x00,0xc0,0x4f,0xa3,0x47,0x30); -#endif - - -typedef struct _REDBOOK_WMI_STD_DATA -{ - // - ULONG NumberOfBuffers; - #define REDBOOK_WMI_NUMBER_OF_BUFFERS_SIZE sizeof(ULONG) - #define REDBOOK_WMI_NUMBER_OF_BUFFERS_ID 1 - - // - ULONG SectorsPerRead; - #define REDBOOK_WMI_SECTORS_PER_READ_SIZE sizeof(ULONG) - #define REDBOOK_WMI_SECTORS_PER_READ_ID 2 - - // - ULONG SectorsPerReadMask; - #define REDBOOK_WMI_SECTORS_PER_READ_MASK_SIZE sizeof(ULONG) - #define REDBOOK_WMI_SECTORS_PER_READ_MASK_ID 3 - - // - ULONG MaximumSectorsPerRead; - #define REDBOOK_WMI_MAX_SECTORS_PER_READ_SIZE sizeof(ULONG) - #define REDBOOK_WMI_MAX_SECTORS_PER_READ_ID 4 - - // - BOOLEAN PlayEnabled; - #define REDBOOK_WMI_PLAY_ENABLED_SIZE sizeof(BOOLEAN) - #define REDBOOK_WMI_PLAY_ENABLED_ID 5 - - // - BOOLEAN CDDASupported; - #define REDBOOK_WMI_CDDA_SUPPORTED_SIZE sizeof(BOOLEAN) - #define REDBOOK_WMI_CDDA_SUPPORTED_ID 6 - - // - BOOLEAN CDDAAccurate; - #define REDBOOK_WMI_CDDA_ACCURATE_SIZE sizeof(BOOLEAN) - #define REDBOOK_WMI_CDDA_ACCURATE_ID 7 - - // - BOOLEAN Reserved1; - #define REDBOOK_WMI_STD_DATA_Reserved1_SIZE sizeof(BOOLEAN) - #define REDBOOK_WMI_STD_DATA_Reserved1_ID 8 - -} REDBOOK_WMI_STD_DATA, *PREDBOOK_WMI_STD_DATA; - -#define REDBOOK_WMI_STD_DATA_SIZE (FIELD_OFFSET(REDBOOK_WMI_STD_DATA, Reserved1) + REDBOOK_WMI_STD_DATA_Reserved1_SIZE) - -// MSRedbook_Performance - REDBOOK_WMI_PERF_DATA -#define GUID_REDBOOK_WMI_PERF_DATA \ - { 0xb90550e8,0xae0a,0x11d1, { 0xa5,0x71,0x00,0xc0,0x4f,0xa3,0x47,0x30 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSRedbook_PerformanceGuid, \ - 0xb90550e8,0xae0a,0x11d1,0xa5,0x71,0x00,0xc0,0x4f,0xa3,0x47,0x30); -#endif - - -typedef struct _REDBOOK_WMI_PERF_DATA -{ - // - LONGLONG TimeReadDelay; - #define REDBOOK_WMI_PERF_TIME_READING_DELAY_SIZE sizeof(LONGLONG) - #define REDBOOK_WMI_PERF_TIME_READING_DELAY_ID 1 - - // - LONGLONG TimeReading; - #define REDBOOK_WMI_PERF_TIME_READING_SIZE sizeof(LONGLONG) - #define REDBOOK_WMI_PERF_TIME_READING_ID 2 - - // - LONGLONG TimeStreamDelay; - #define REDBOOK_WMI_PERF_TIME_STREAMING_DELAY_SIZE sizeof(LONGLONG) - #define REDBOOK_WMI_PERF_TIME_STREAMING_DELAY_ID 3 - - // - LONGLONG TimeStreaming; - #define REDBOOK_WMI_PERF_TIME_STREAMING_SIZE sizeof(LONGLONG) - #define REDBOOK_WMI_PERF_TIME_STREAMING_ID 4 - - // - LONGLONG DataProcessed; - #define REDBOOK_WMI_PERF_DATA_PROCESSED_SIZE sizeof(LONGLONG) - #define REDBOOK_WMI_PERF_DATA_PROCESSED_ID 5 - - // - ULONG StreamPausedCount; - #define REDBOOK_WMI_PERF_STREAM_PAUSED_COUNT_SIZE sizeof(ULONG) - #define REDBOOK_WMI_PERF_STREAM_PAUSED_COUNT_ID 6 - -} REDBOOK_WMI_PERF_DATA, *PREDBOOK_WMI_PERF_DATA; - -#define REDBOOK_WMI_PERF_DATA_SIZE (FIELD_OFFSET(REDBOOK_WMI_PERF_DATA, StreamPausedCount) + REDBOOK_WMI_PERF_DATA_StreamPausedCount_SIZE) - -// RegisteredGuids - RegisteredGuids -#define RegisteredGuidsGuid \ - { 0xe3dff7bd,0x3915,0x11d2, { 0x91,0x03,0x00,0xc0,0x4f,0xb9,0x98,0xa2 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(RegisteredGuids_GUID, \ - 0xe3dff7bd,0x3915,0x11d2,0x91,0x03,0x00,0xc0,0x4f,0xb9,0x98,0xa2); -#endif - - -typedef struct _RegisteredGuids -{ - // - ULONG GuidType; - #define RegisteredGuids_GuidType_SIZE sizeof(ULONG) - #define RegisteredGuids_GuidType_ID 1 - - // - ULONG LoggerId; - #define RegisteredGuids_LoggerId_SIZE sizeof(ULONG) - #define RegisteredGuids_LoggerId_ID 2 - - // - ULONG EnableLevel; - #define RegisteredGuids_EnableLevel_SIZE sizeof(ULONG) - #define RegisteredGuids_EnableLevel_ID 3 - - // - ULONG EnableFlags; - #define RegisteredGuids_EnableFlags_SIZE sizeof(ULONG) - #define RegisteredGuids_EnableFlags_ID 4 - - // - BOOLEAN IsEnabled; - #define RegisteredGuids_IsEnabled_SIZE sizeof(BOOLEAN) - #define RegisteredGuids_IsEnabled_ID 5 - -} RegisteredGuids, *PRegisteredGuids; - -#define RegisteredGuids_SIZE (FIELD_OFFSET(RegisteredGuids, IsEnabled) + RegisteredGuids_IsEnabled_SIZE) - -// MSTapeDriveParam - WMI_TAPE_DRIVE_PARAMETERS -#define WMI_TAPE_DRIVE_PARAMETERS_GUID \ - { 0xb9a8cfd5,0x8d72,0x47a4, { 0xac,0x0e,0x28,0x4a,0x32,0x00,0xf4,0xfb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeDriveParam_GUID, \ - 0xb9a8cfd5,0x8d72,0x47a4,0xac,0x0e,0x28,0x4a,0x32,0x00,0xf4,0xfb); -#endif - - -typedef struct _WMI_TAPE_DRIVE_PARAMETERS -{ - // - ULONG MaximumBlockSize; - #define WMI_TAPE_DRIVE_PARAMETERS_MaximumBlockSize_SIZE sizeof(ULONG) - #define WMI_TAPE_DRIVE_PARAMETERS_MaximumBlockSize_ID 1 - - // - ULONG MinimumBlockSize; - #define WMI_TAPE_DRIVE_PARAMETERS_MinimumBlockSize_SIZE sizeof(ULONG) - #define WMI_TAPE_DRIVE_PARAMETERS_MinimumBlockSize_ID 2 - - // - ULONG DefaultBlockSize; - #define WMI_TAPE_DRIVE_PARAMETERS_DefaultBlockSize_SIZE sizeof(ULONG) - #define WMI_TAPE_DRIVE_PARAMETERS_DefaultBlockSize_ID 3 - - // - ULONG MaximumPartitionCount; - #define WMI_TAPE_DRIVE_PARAMETERS_MaximumPartitionCount_SIZE sizeof(ULONG) - #define WMI_TAPE_DRIVE_PARAMETERS_MaximumPartitionCount_ID 4 - - // - BOOLEAN CompressionCapable; - #define WMI_TAPE_DRIVE_PARAMETERS_CompressionCapable_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_DRIVE_PARAMETERS_CompressionCapable_ID 5 - - // - BOOLEAN CompressionEnabled; - #define WMI_TAPE_DRIVE_PARAMETERS_CompressionEnabled_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_DRIVE_PARAMETERS_CompressionEnabled_ID 6 - - // - BOOLEAN ReportSetmarks; - #define WMI_TAPE_DRIVE_PARAMETERS_ReportSetmarks_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_DRIVE_PARAMETERS_ReportSetmarks_ID 7 - - // - BOOLEAN HardwareErrorCorrection; - #define WMI_TAPE_DRIVE_PARAMETERS_HardwareErrorCorrection_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_DRIVE_PARAMETERS_HardwareErrorCorrection_ID 8 - -} WMI_TAPE_DRIVE_PARAMETERS, *PWMI_TAPE_DRIVE_PARAMETERS; - -#define WMI_TAPE_DRIVE_PARAMETERS_SIZE (FIELD_OFFSET(WMI_TAPE_DRIVE_PARAMETERS, HardwareErrorCorrection) + WMI_TAPE_DRIVE_PARAMETERS_HardwareErrorCorrection_SIZE) - -// MSTapeMediaCapacity - WMI_TAPE_MEDIA_PARAMETERS -#define WMI_TAPE_MEDIA_PARAMETERS_GUID \ - { 0x8c2147a4,0xff29,0x4336, { 0xb8,0xa4,0x22,0x7b,0x54,0xcc,0x09,0x66 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeMediaCapacity_GUID, \ - 0x8c2147a4,0xff29,0x4336,0xb8,0xa4,0x22,0x7b,0x54,0xcc,0x09,0x66); -#endif - - -typedef struct _WMI_TAPE_MEDIA_PARAMETERS -{ - // - ULONGLONG MaximumCapacity; - #define WMI_TAPE_MEDIA_PARAMETERS_MaximumCapacity_SIZE sizeof(ULONGLONG) - #define WMI_TAPE_MEDIA_PARAMETERS_MaximumCapacity_ID 1 - - // - ULONGLONG AvailableCapacity; - #define WMI_TAPE_MEDIA_PARAMETERS_AvailableCapacity_SIZE sizeof(ULONGLONG) - #define WMI_TAPE_MEDIA_PARAMETERS_AvailableCapacity_ID 2 - - // - ULONG BlockSize; - #define WMI_TAPE_MEDIA_PARAMETERS_BlockSize_SIZE sizeof(ULONG) - #define WMI_TAPE_MEDIA_PARAMETERS_BlockSize_ID 3 - - // - ULONG PartitionCount; - #define WMI_TAPE_MEDIA_PARAMETERS_PartitionCount_SIZE sizeof(ULONG) - #define WMI_TAPE_MEDIA_PARAMETERS_PartitionCount_ID 4 - - // - BOOLEAN MediaWriteProtected; - #define WMI_TAPE_MEDIA_PARAMETERS_MediaWriteProtected_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_MEDIA_PARAMETERS_MediaWriteProtected_ID 5 - -} WMI_TAPE_MEDIA_PARAMETERS, *PWMI_TAPE_MEDIA_PARAMETERS; - -#define WMI_TAPE_MEDIA_PARAMETERS_SIZE (FIELD_OFFSET(WMI_TAPE_MEDIA_PARAMETERS, MediaWriteProtected) + WMI_TAPE_MEDIA_PARAMETERS_MediaWriteProtected_SIZE) - -// MSTapeSymbolicName - WMI_TAPE_SYMBOLIC_NAME -#define WMI_TAPE_SYMBOLIC_NAME_GUID \ - { 0x3fb828f7,0xf119,0x4066, { 0xb1,0xe6,0xdb,0x40,0x7c,0xe9,0xde,0x91 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeSymbolicName_GUID, \ - 0x3fb828f7,0xf119,0x4066,0xb1,0xe6,0xdb,0x40,0x7c,0xe9,0xde,0x91); -#endif - - -typedef struct _WMI_TAPE_SYMBOLIC_NAME -{ - // - CHAR VariableData[1]; - #define WMI_TAPE_SYMBOLIC_NAME_TapeSymbolicName_ID 1 - -} WMI_TAPE_SYMBOLIC_NAME, *PWMI_TAPE_SYMBOLIC_NAME; - -// MSTapeDriveProblemEvent - WMI_TAPE_PROBLEM_WARNING -#define WMI_TAPE_PROBLEM_WARNING_GUID \ - { 0xbc4dd36c,0xfa66,0x4080, { 0x87,0xa0,0x0c,0x59,0x22,0xeb,0x78,0x87 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeDriveProblemEvent_GUID, \ - 0xbc4dd36c,0xfa66,0x4080,0x87,0xa0,0x0c,0x59,0x22,0xeb,0x78,0x87); -#endif - - -typedef struct _WMI_TAPE_PROBLEM_WARNING -{ - // - ULONG DriveProblemType; - #define WMI_TAPE_PROBLEM_WARNING_DriveProblemType_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_WARNING_DriveProblemType_ID 1 - - // - UCHAR TapeData[512]; - #define WMI_TAPE_PROBLEM_WARNING_TapeData_SIZE sizeof(UCHAR[512]) - #define WMI_TAPE_PROBLEM_WARNING_TapeData_ID 2 - -} WMI_TAPE_PROBLEM_WARNING, *PWMI_TAPE_PROBLEM_WARNING; - -#define WMI_TAPE_PROBLEM_WARNING_SIZE (FIELD_OFFSET(WMI_TAPE_PROBLEM_WARNING, TapeData) + WMI_TAPE_PROBLEM_WARNING_TapeData_SIZE) - -// MSTapeProblemIoError - WMI_TAPE_PROBLEM_IO_ERROR -#define WMI_TAPE_PROBLEM_IO_ERROR_GUID \ - { 0x58fd29f9,0xb516,0x40fd, { 0x87,0x1a,0x7e,0xe7,0x6d,0x5b,0xb5,0x3e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeProblemIoError_GUID, \ - 0x58fd29f9,0xb516,0x40fd,0x87,0x1a,0x7e,0xe7,0x6d,0x5b,0xb5,0x3e); -#endif - - -typedef struct _WMI_TAPE_PROBLEM_IO_ERROR -{ - // - ULONG ReadCorrectedWithoutDelay; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectedWithoutDelay_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectedWithoutDelay_ID 1 - - // - ULONG ReadCorrectedWithDelay; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectedWithDelay_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectedWithDelay_ID 2 - - // - ULONG ReadTotalErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalErrors_ID 3 - - // - ULONG ReadTotalCorrectedErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalCorrectedErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalCorrectedErrors_ID 4 - - // - ULONG ReadTotalUncorrectedErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalUncorrectedErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadTotalUncorrectedErrors_ID 5 - - // - ULONG ReadCorrectionAlgorithmProcessed; - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectionAlgorithmProcessed_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_ReadCorrectionAlgorithmProcessed_ID 6 - - // - ULONG WriteCorrectedWithoutDelay; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectedWithoutDelay_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectedWithoutDelay_ID 7 - - // - ULONG WriteCorrectedWithDelay; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectedWithDelay_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectedWithDelay_ID 8 - - // - ULONG WriteTotalErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalErrors_ID 9 - - // - ULONG WriteTotalCorrectedErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalCorrectedErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalCorrectedErrors_ID 10 - - // - ULONG WriteTotalUncorrectedErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalUncorrectedErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteTotalUncorrectedErrors_ID 11 - - // - ULONG WriteCorrectionAlgorithmProcessed; - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectionAlgorithmProcessed_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_WriteCorrectionAlgorithmProcessed_ID 12 - - // - ULONG NonMediumErrors; - #define WMI_TAPE_PROBLEM_IO_ERROR_NonMediumErrors_SIZE sizeof(ULONG) - #define WMI_TAPE_PROBLEM_IO_ERROR_NonMediumErrors_ID 13 - -} WMI_TAPE_PROBLEM_IO_ERROR, *PWMI_TAPE_PROBLEM_IO_ERROR; - -#define WMI_TAPE_PROBLEM_IO_ERROR_SIZE (FIELD_OFFSET(WMI_TAPE_PROBLEM_IO_ERROR, NonMediumErrors) + WMI_TAPE_PROBLEM_IO_ERROR_NonMediumErrors_SIZE) - -// MSTapeProblemDeviceError - WMI_TAPE_PROBLEM_DEVICE_ERROR -#define WMI_TAPE_PROBLEM_DEVICE_ERROR_GUID \ - { 0x43ec6b13,0x10bb,0x4bf6, { 0xb7,0x16,0x1c,0x1e,0x2f,0x10,0xbb,0x5f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSTapeProblemDeviceError_GUID, \ - 0x43ec6b13,0x10bb,0x4bf6,0xb7,0x16,0x1c,0x1e,0x2f,0x10,0xbb,0x5f); -#endif - - -typedef struct _WMI_TAPE_PROBLEM_DEVICE_ERROR -{ - // - BOOLEAN ReadWarning; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ReadWarning_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ReadWarning_ID 1 - - // - BOOLEAN WriteWarning; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_WriteWarning_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_WriteWarning_ID 2 - - // - BOOLEAN HardError; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_HardError_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_HardError_ID 3 - - // - BOOLEAN ReadFailure; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ReadFailure_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ReadFailure_ID 4 - - // - BOOLEAN WriteFailure; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_WriteFailure_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_WriteFailure_ID 5 - - // - BOOLEAN UnsupportedFormat; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_UnsupportedFormat_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_UnsupportedFormat_ID 6 - - // - BOOLEAN TapeSnapped; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_TapeSnapped_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_TapeSnapped_ID 7 - - // - BOOLEAN DriveRequiresCleaning; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_DriveRequiresCleaning_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_DriveRequiresCleaning_ID 8 - - // - BOOLEAN TimetoCleanDrive; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_TimetoCleanDrive_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_TimetoCleanDrive_ID 9 - - // - BOOLEAN DriveHardwareError; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_DriveHardwareError_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_DriveHardwareError_ID 10 - - // - BOOLEAN ScsiInterfaceError; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ScsiInterfaceError_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_ScsiInterfaceError_ID 11 - - // - BOOLEAN MediaLife; - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_MediaLife_SIZE sizeof(BOOLEAN) - #define WMI_TAPE_PROBLEM_DEVICE_ERROR_MediaLife_ID 12 - -} WMI_TAPE_PROBLEM_DEVICE_ERROR, *PWMI_TAPE_PROBLEM_DEVICE_ERROR; - -#define WMI_TAPE_PROBLEM_DEVICE_ERROR_SIZE (FIELD_OFFSET(WMI_TAPE_PROBLEM_DEVICE_ERROR, MediaLife) + WMI_TAPE_PROBLEM_DEVICE_ERROR_MediaLife_SIZE) - -// MSChangerParameters - WMI_CHANGER_PARAMETERS -#define WMI_CHANGER_PARAMETERS_GUID \ - { 0x24eb52ac,0x7c77,0x438b, { 0xab,0x61,0xd0,0x24,0xda,0xb0,0xc0,0x3a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSChangerParameters_GUID, \ - 0x24eb52ac,0x7c77,0x438b,0xab,0x61,0xd0,0x24,0xda,0xb0,0xc0,0x3a); -#endif - - -typedef struct _WMI_CHANGER_PARAMETERS -{ - // - ULONG NumberOfSlots; - #define WMI_CHANGER_PARAMETERS_NumberOfSlots_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfSlots_ID 1 - - // - ULONG NumberOfDrives; - #define WMI_CHANGER_PARAMETERS_NumberOfDrives_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfDrives_ID 2 - - // - ULONG NumberOfIEPorts; - #define WMI_CHANGER_PARAMETERS_NumberOfIEPorts_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfIEPorts_ID 3 - - // - ULONG NumberOfTransports; - #define WMI_CHANGER_PARAMETERS_NumberOfTransports_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfTransports_ID 4 - - // - ULONG NumberOfDoors; - #define WMI_CHANGER_PARAMETERS_NumberOfDoors_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfDoors_ID 5 - - // - ULONG NumberOfCleanerSlots; - #define WMI_CHANGER_PARAMETERS_NumberOfCleanerSlots_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_NumberOfCleanerSlots_ID 6 - - // - ULONG MagazineSize; - #define WMI_CHANGER_PARAMETERS_MagazineSize_SIZE sizeof(ULONG) - #define WMI_CHANGER_PARAMETERS_MagazineSize_ID 7 - -} WMI_CHANGER_PARAMETERS, *PWMI_CHANGER_PARAMETERS; - -#define WMI_CHANGER_PARAMETERS_SIZE (FIELD_OFFSET(WMI_CHANGER_PARAMETERS, MagazineSize) + WMI_CHANGER_PARAMETERS_MagazineSize_SIZE) - -// MSChangerProblemEvent - WMI_CHANGER_PROBLEM_WARNING -#define WMI_CHANGER_PROBLEM_WARNING_GUID \ - { 0x45db06a5,0x20d5,0x4de3, { 0xa3,0x6c,0x3a,0xb9,0x74,0x60,0x0a,0x4c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSChangerProblemEvent_GUID, \ - 0x45db06a5,0x20d5,0x4de3,0xa3,0x6c,0x3a,0xb9,0x74,0x60,0x0a,0x4c); -#endif - - -typedef struct _WMI_CHANGER_PROBLEM_WARNING -{ - // - ULONG ChangerProblemType; - #define WMI_CHANGER_PROBLEM_WARNING_ChangerProblemType_SIZE sizeof(ULONG) - #define WMI_CHANGER_PROBLEM_WARNING_ChangerProblemType_ID 1 - - // - UCHAR ChangerData[512]; - #define WMI_CHANGER_PROBLEM_WARNING_ChangerData_SIZE sizeof(UCHAR[512]) - #define WMI_CHANGER_PROBLEM_WARNING_ChangerData_ID 2 - -} WMI_CHANGER_PROBLEM_WARNING, *PWMI_CHANGER_PROBLEM_WARNING; - -#define WMI_CHANGER_PROBLEM_WARNING_SIZE (FIELD_OFFSET(WMI_CHANGER_PROBLEM_WARNING, ChangerData) + WMI_CHANGER_PROBLEM_WARNING_ChangerData_SIZE) - -// MSChangerProblemDeviceError - WMI_CHANGER_PROBLEM_DEVICE_ERROR -#define WMI_CHANGER_PROBLEM_DEVICE_ERROR_GUID \ - { 0x56b396a8,0x0b95,0x42fe, { 0xbb,0xce,0xd3,0x6f,0xda,0x90,0x4f,0x8e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSChangerProblemDeviceError_GUID, \ - 0x56b396a8,0x0b95,0x42fe,0xbb,0xce,0xd3,0x6f,0xda,0x90,0x4f,0x8e); -#endif - - -typedef struct _WMI_CHANGER_PROBLEM_DEVICE_ERROR -{ - // - ULONG ChangerProblemType; - #define WMI_CHANGER_PROBLEM_DEVICE_ERROR_ChangerProblemType_SIZE sizeof(ULONG) - #define WMI_CHANGER_PROBLEM_DEVICE_ERROR_ChangerProblemType_ID 1 - -} WMI_CHANGER_PROBLEM_DEVICE_ERROR, *PWMI_CHANGER_PROBLEM_DEVICE_ERROR; - -#define WMI_CHANGER_PROBLEM_DEVICE_ERROR_SIZE (FIELD_OFFSET(WMI_CHANGER_PROBLEM_DEVICE_ERROR, ChangerProblemType) + WMI_CHANGER_PROBLEM_DEVICE_ERROR_ChangerProblemType_SIZE) - -// MSDeviceUI_FirmwareRevision - DEVICE_UI_FIRMWARE_REVISION -#define DEVICE_UI_FIRMWARE_REVISION_GUID \ - { 0x4504b1d4,0xc5ee,0x4df6, { 0x95,0x1f,0x16,0x18,0x0e,0x3d,0xd8,0x15 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSDeviceUI_FirmwareRevision_GUID, \ - 0x4504b1d4,0xc5ee,0x4df6,0x95,0x1f,0x16,0x18,0x0e,0x3d,0xd8,0x15); -#endif - - -typedef struct _DEVICE_UI_FIRMWARE_REVISION -{ - // - CHAR VariableData[1]; - #define DEVICE_UI_FIRMWARE_REVISION_FirmwareRevision_ID 1 - -} DEVICE_UI_FIRMWARE_REVISION, *PDEVICE_UI_FIRMWARE_REVISION; - -// MSVerifierIrpLogEntry - MSVerifierIrpLogEntry -#define MSVerifierIrpLogEntryGuid \ - { 0x45068237,0x595d,0x4c7d, { 0xbd,0x80,0xf8,0x4a,0xdc,0x02,0x57,0xf8 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSVerifierIrpLogEntry_GUID, \ - 0x45068237,0x595d,0x4c7d,0xbd,0x80,0xf8,0x4a,0xdc,0x02,0x57,0xf8); -#endif - - -typedef struct _MSVerifierIrpLogEntry -{ - // Count - ULONG Count; - #define MSVerifierIrpLogEntry_Count_SIZE sizeof(ULONG) - #define MSVerifierIrpLogEntry_Count_ID 1 - - // Major Function - UCHAR Major; - #define MSVerifierIrpLogEntry_Major_SIZE sizeof(UCHAR) - #define MSVerifierIrpLogEntry_Major_ID 2 - - // Minor Function - UCHAR Minor; - #define MSVerifierIrpLogEntry_Minor_SIZE sizeof(UCHAR) - #define MSVerifierIrpLogEntry_Minor_ID 3 - - // Flags - UCHAR Flags; - #define MSVerifierIrpLogEntry_Flags_SIZE sizeof(UCHAR) - #define MSVerifierIrpLogEntry_Flags_ID 4 - - // Control - UCHAR Control; - #define MSVerifierIrpLogEntry_Control_SIZE sizeof(UCHAR) - #define MSVerifierIrpLogEntry_Control_ID 5 - - // Arg1 - ULONGLONG Arg1; - #define MSVerifierIrpLogEntry_Arg1_SIZE sizeof(ULONGLONG) - #define MSVerifierIrpLogEntry_Arg1_ID 6 - - // Arg2 - ULONGLONG Arg2; - #define MSVerifierIrpLogEntry_Arg2_SIZE sizeof(ULONGLONG) - #define MSVerifierIrpLogEntry_Arg2_ID 7 - - // Arg3 - ULONGLONG Arg3; - #define MSVerifierIrpLogEntry_Arg3_SIZE sizeof(ULONGLONG) - #define MSVerifierIrpLogEntry_Arg3_ID 8 - - // Arg4 - ULONGLONG Arg4; - #define MSVerifierIrpLogEntry_Arg4_SIZE sizeof(ULONGLONG) - #define MSVerifierIrpLogEntry_Arg4_ID 9 - -} MSVerifierIrpLogEntry, *PMSVerifierIrpLogEntry; - -#define MSVerifierIrpLogEntry_SIZE (FIELD_OFFSET(MSVerifierIrpLogEntry, Arg4) + MSVerifierIrpLogEntry_Arg4_SIZE) - -// MSVerifierIrpLogInformation - MSVerifierIrpLogInformation -// Verifier kernel information -#define MSVerifierIrpLogInformationGuid \ - { 0x1e2c2980,0xf7db,0x46aa, { 0x82,0x0e,0x87,0x34,0xfc,0xc2,0x1f,0x4c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(MSVerifierIrpLogInformation_GUID, \ - 0x1e2c2980,0xf7db,0x46aa,0x82,0x0e,0x87,0x34,0xfc,0xc2,0x1f,0x4c); -#endif - - -typedef struct _MSVerifierIrpLogInformation -{ - // DeviceType - ULONG DeviceType; - #define MSVerifierIrpLogInformation_DeviceType_SIZE sizeof(ULONG) - #define MSVerifierIrpLogInformation_DeviceType_ID 1 - - // - ULONG EntryCount; - #define MSVerifierIrpLogInformation_EntryCount_SIZE sizeof(ULONG) - #define MSVerifierIrpLogInformation_EntryCount_ID 2 - - // - MSVerifierIrpLogEntry Entries[1]; - #define MSVerifierIrpLogInformation_Entries_ID 3 - -} MSVerifierIrpLogInformation, *PMSVerifierIrpLogInformation; - -// WmiMonitorBrightness - WmiMonitorBrightness -#define WmiMonitorBrightnessGuid \ - { 0xd43412ac,0x67f9,0x4fbb, { 0xa0,0x81,0x17,0x52,0xa2,0xc3,0x3e,0x84 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorBrightness_GUID, \ - 0xd43412ac,0x67f9,0x4fbb,0xa0,0x81,0x17,0x52,0xa2,0xc3,0x3e,0x84); -#endif - - -typedef struct _WmiMonitorBrightness -{ - // - UCHAR CurrentBrightness; - #define WmiMonitorBrightness_CurrentBrightness_SIZE sizeof(UCHAR) - #define WmiMonitorBrightness_CurrentBrightness_ID 1 - - // - ULONG Levels; - #define WmiMonitorBrightness_Levels_SIZE sizeof(ULONG) - #define WmiMonitorBrightness_Levels_ID 2 - - // - UCHAR Level[1]; - #define WmiMonitorBrightness_Level_ID 3 - -} WmiMonitorBrightness, *PWmiMonitorBrightness; - -// WmiMonitorBrightnessMethods - WmiMonitorBrightnessMethods -#define WmiMonitorBrightnessMethodsGuid \ - { 0x479b20b4,0x5559,0x46fe, { 0xbe,0x97,0x7d,0x22,0x21,0x54,0x42,0x1f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorBrightnessMethods_GUID, \ - 0x479b20b4,0x5559,0x46fe,0xbe,0x97,0x7d,0x22,0x21,0x54,0x42,0x1f); -#endif - -// -// Method id definitions for WmiMonitorBrightnessMethods -#define WmiSetBrightness 1 -typedef struct _WmiSetBrightness_IN -{ - // - ULONG Timeout; - #define WmiSetBrightness_IN_Timeout_SIZE sizeof(ULONG) - #define WmiSetBrightness_IN_Timeout_ID 1 - - // - UCHAR Brightness; - #define WmiSetBrightness_IN_Brightness_SIZE sizeof(UCHAR) - #define WmiSetBrightness_IN_Brightness_ID 2 - -} WmiSetBrightness_IN, *PWmiSetBrightness_IN; - -#define WmiSetBrightness_IN_SIZE (FIELD_OFFSET(WmiSetBrightness_IN, Brightness) + WmiSetBrightness_IN_Brightness_SIZE) - -#define WmiRevertToPolicyBrightness 2 -#define WmiSetALSBrightnessState 3 -typedef struct _WmiSetALSBrightnessState_IN -{ - // - BOOLEAN State; - #define WmiSetALSBrightnessState_IN_State_SIZE sizeof(BOOLEAN) - #define WmiSetALSBrightnessState_IN_State_ID 1 - -} WmiSetALSBrightnessState_IN, *PWmiSetALSBrightnessState_IN; - -#define WmiSetALSBrightnessState_IN_SIZE (FIELD_OFFSET(WmiSetALSBrightnessState_IN, State) + WmiSetALSBrightnessState_IN_State_SIZE) - -#define WmiSetALSBrightness 4 -typedef struct _WmiSetALSBrightness_IN -{ - // - UCHAR Brightness; - #define WmiSetALSBrightness_IN_Brightness_SIZE sizeof(UCHAR) - #define WmiSetALSBrightness_IN_Brightness_ID 1 - -} WmiSetALSBrightness_IN, *PWmiSetALSBrightness_IN; - -#define WmiSetALSBrightness_IN_SIZE (FIELD_OFFSET(WmiSetALSBrightness_IN, Brightness) + WmiSetALSBrightness_IN_Brightness_SIZE) - - -// WmiMonitorBrightnessEvent - WmiMonitorBrightnessEvent -// Monitor brightness change event -#define WmiMonitorBrightnessEventGuid \ - { 0x123c80d2,0x937f,0x4cfe, { 0x80,0xf4,0xc4,0x0d,0x59,0x6e,0x48,0xb7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorBrightnessEvent_GUID, \ - 0x123c80d2,0x937f,0x4cfe,0x80,0xf4,0xc4,0x0d,0x59,0x6e,0x48,0xb7); -#endif - - -typedef struct _WmiMonitorBrightnessEvent -{ - // - UCHAR Brightness; - #define WmiMonitorBrightnessEvent_Brightness_SIZE sizeof(UCHAR) - #define WmiMonitorBrightnessEvent_Brightness_ID 1 - -} WmiMonitorBrightnessEvent, *PWmiMonitorBrightnessEvent; - -#define WmiMonitorBrightnessEvent_SIZE (FIELD_OFFSET(WmiMonitorBrightnessEvent, Brightness) + WmiMonitorBrightnessEvent_Brightness_SIZE) - -// WmiMonitorRawEEdidV1Block - WmiMonitorRawEEdidV1Block -#define WmiMonitorRawEEdidV1BlockGuid \ - { 0xfaee1471,0x5149,0x4a68, { 0xac,0x2c,0xbf,0x96,0xec,0x09,0xf0,0x04 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorRawEEdidV1Block_GUID, \ - 0xfaee1471,0x5149,0x4a68,0xac,0x2c,0xbf,0x96,0xec,0x09,0xf0,0x04); -#endif - - -typedef struct _WmiMonitorRawEEdidV1Block -{ - // - UCHAR Id; - #define WmiMonitorRawEEdidV1Block_Id_SIZE sizeof(UCHAR) - #define WmiMonitorRawEEdidV1Block_Id_ID 1 - - // - UCHAR Type; - #define WmiMonitorRawEEdidV1Block_Type_SIZE sizeof(UCHAR) - #define WmiMonitorRawEEdidV1Block_Type_ID 2 - - // - UCHAR Content[128]; - #define WmiMonitorRawEEdidV1Block_Content_SIZE sizeof(UCHAR[128]) - #define WmiMonitorRawEEdidV1Block_Content_ID 3 - -} WmiMonitorRawEEdidV1Block, *PWmiMonitorRawEEdidV1Block; - -#define WmiMonitorRawEEdidV1Block_SIZE (FIELD_OFFSET(WmiMonitorRawEEdidV1Block, Content) + WmiMonitorRawEEdidV1Block_Content_SIZE) - -// WmiMonitorDescriptorMethods - WmiMonitorDescriptorMethods -#define WmiMonitorDescriptorMethodsGuid \ - { 0x5341576e,0x75c4,0x4aeb, { 0xa8,0x2b,0x87,0x3c,0xd3,0xc6,0xb3,0x84 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorDescriptorMethods_GUID, \ - 0x5341576e,0x75c4,0x4aeb,0xa8,0x2b,0x87,0x3c,0xd3,0xc6,0xb3,0x84); -#endif - -// -// Method id definitions for WmiMonitorDescriptorMethods -#define WmiGetMonitorRawEEdidV1Block 1 -typedef struct _WmiGetMonitorRawEEdidV1Block_IN -{ - // - UCHAR BlockId; - #define WmiGetMonitorRawEEdidV1Block_IN_BlockId_SIZE sizeof(UCHAR) - #define WmiGetMonitorRawEEdidV1Block_IN_BlockId_ID 1 - -} WmiGetMonitorRawEEdidV1Block_IN, *PWmiGetMonitorRawEEdidV1Block_IN; - -#define WmiGetMonitorRawEEdidV1Block_IN_SIZE (FIELD_OFFSET(WmiGetMonitorRawEEdidV1Block_IN, BlockId) + WmiGetMonitorRawEEdidV1Block_IN_BlockId_SIZE) - -typedef struct _WmiGetMonitorRawEEdidV1Block_OUT -{ - // - UCHAR BlockType; - #define WmiGetMonitorRawEEdidV1Block_OUT_BlockType_SIZE sizeof(UCHAR) - #define WmiGetMonitorRawEEdidV1Block_OUT_BlockType_ID 2 - - // - UCHAR BlockContent[128]; - #define WmiGetMonitorRawEEdidV1Block_OUT_BlockContent_SIZE sizeof(UCHAR[128]) - #define WmiGetMonitorRawEEdidV1Block_OUT_BlockContent_ID 3 - -} WmiGetMonitorRawEEdidV1Block_OUT, *PWmiGetMonitorRawEEdidV1Block_OUT; - -#define WmiGetMonitorRawEEdidV1Block_OUT_SIZE (FIELD_OFFSET(WmiGetMonitorRawEEdidV1Block_OUT, BlockContent) + WmiGetMonitorRawEEdidV1Block_OUT_BlockContent_SIZE) - - -// WmiMonitorID - WmiMonitorID -#define WmiMonitorIDGuid \ - { 0x671a8285,0x4edb,0x4cae, { 0x99,0xfe,0x69,0xa1,0x5c,0x48,0xc0,0xbc } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorID_GUID, \ - 0x671a8285,0x4edb,0x4cae,0x99,0xfe,0x69,0xa1,0x5c,0x48,0xc0,0xbc); -#endif - - -typedef struct _WmiMonitorID -{ - // - USHORT ProductCodeID[16]; - #define WmiMonitorID_ProductCodeID_SIZE sizeof(USHORT[16]) - #define WmiMonitorID_ProductCodeID_ID 1 - - // - USHORT SerialNumberID[16]; - #define WmiMonitorID_SerialNumberID_SIZE sizeof(USHORT[16]) - #define WmiMonitorID_SerialNumberID_ID 2 - - // - USHORT ManufacturerName[16]; - #define WmiMonitorID_ManufacturerName_SIZE sizeof(USHORT[16]) - #define WmiMonitorID_ManufacturerName_ID 3 - - // - UCHAR WeekOfManufacture; - #define WmiMonitorID_WeekOfManufacture_SIZE sizeof(UCHAR) - #define WmiMonitorID_WeekOfManufacture_ID 4 - - // - USHORT YearOfManufacture; - #define WmiMonitorID_YearOfManufacture_SIZE sizeof(USHORT) - #define WmiMonitorID_YearOfManufacture_ID 5 - - // - USHORT UserFriendlyNameLength; - #define WmiMonitorID_UserFriendlyNameLength_SIZE sizeof(USHORT) - #define WmiMonitorID_UserFriendlyNameLength_ID 6 - - // - USHORT UserFriendlyName[1]; - #define WmiMonitorID_UserFriendlyName_ID 7 - -} WmiMonitorID, *PWmiMonitorID; - -// WmiMonitorSupportedDisplayFeatures - WmiMonitorSupportedDisplayFeatures -#define WmiMonitorSupportedDisplayFeaturesGuid \ - { 0x9fa9c28b,0x5e5c,0x4035, { 0xa5,0xf8,0x67,0xd4,0x55,0x4f,0x8d,0x04 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorSupportedDisplayFeatures_GUID, \ - 0x9fa9c28b,0x5e5c,0x4035,0xa5,0xf8,0x67,0xd4,0x55,0x4f,0x8d,0x04); -#endif - - -typedef struct _WmiMonitorSupportedDisplayFeatures -{ - // - BOOLEAN StandbySupported; - #define WmiMonitorSupportedDisplayFeatures_StandbySupported_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_StandbySupported_ID 1 - - // - BOOLEAN SuspendSupported; - #define WmiMonitorSupportedDisplayFeatures_SuspendSupported_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_SuspendSupported_ID 2 - - // - BOOLEAN ActiveOffSupported; - #define WmiMonitorSupportedDisplayFeatures_ActiveOffSupported_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_ActiveOffSupported_ID 3 - - // - UCHAR DisplayType; - #define WmiMonitorSupportedDisplayFeatures_DisplayType_SIZE sizeof(UCHAR) - #define WmiMonitorSupportedDisplayFeatures_DisplayType_ID 4 - - // - BOOLEAN sRGBSupported; - #define WmiMonitorSupportedDisplayFeatures_sRGBSupported_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_sRGBSupported_ID 5 - - // - BOOLEAN HasPreferredTimingMode; - #define WmiMonitorSupportedDisplayFeatures_HasPreferredTimingMode_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_HasPreferredTimingMode_ID 6 - - // - BOOLEAN GTFSupported; - #define WmiMonitorSupportedDisplayFeatures_GTFSupported_SIZE sizeof(BOOLEAN) - #define WmiMonitorSupportedDisplayFeatures_GTFSupported_ID 7 - -} WmiMonitorSupportedDisplayFeatures, *PWmiMonitorSupportedDisplayFeatures; - -#define WmiMonitorSupportedDisplayFeatures_SIZE (FIELD_OFFSET(WmiMonitorSupportedDisplayFeatures, GTFSupported) + WmiMonitorSupportedDisplayFeatures_GTFSupported_SIZE) - -// WmiMonitorBasicDisplayParams - WmiMonitorBasicDisplayParams -#define WmiMonitorBasicDisplayParamsGuid \ - { 0x9831b7e6,0x09ac,0x491f, { 0x8d,0x07,0x3c,0x3d,0x64,0x9d,0x82,0x40 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorBasicDisplayParams_GUID, \ - 0x9831b7e6,0x09ac,0x491f,0x8d,0x07,0x3c,0x3d,0x64,0x9d,0x82,0x40); -#endif - - -typedef struct _WmiMonitorBasicDisplayParams -{ - // - UCHAR VideoInputType; - #define WmiMonitorBasicDisplayParams_VideoInputType_SIZE sizeof(UCHAR) - #define WmiMonitorBasicDisplayParams_VideoInputType_ID 1 - - // - UCHAR MaxHorizontalImageSize; - #define WmiMonitorBasicDisplayParams_MaxHorizontalImageSize_SIZE sizeof(UCHAR) - #define WmiMonitorBasicDisplayParams_MaxHorizontalImageSize_ID 2 - - // - UCHAR MaxVerticalImageSize; - #define WmiMonitorBasicDisplayParams_MaxVerticalImageSize_SIZE sizeof(UCHAR) - #define WmiMonitorBasicDisplayParams_MaxVerticalImageSize_ID 3 - - // - UCHAR DisplayTransferCharacteristic; - #define WmiMonitorBasicDisplayParams_DisplayTransferCharacteristic_SIZE sizeof(UCHAR) - #define WmiMonitorBasicDisplayParams_DisplayTransferCharacteristic_ID 4 - - // - WmiMonitorSupportedDisplayFeatures SupportedDisplayFeatures; - #define WmiMonitorBasicDisplayParams_SupportedDisplayFeatures_SIZE sizeof(WmiMonitorSupportedDisplayFeatures) - #define WmiMonitorBasicDisplayParams_SupportedDisplayFeatures_ID 5 - -} WmiMonitorBasicDisplayParams, *PWmiMonitorBasicDisplayParams; - -#define WmiMonitorBasicDisplayParams_SIZE (FIELD_OFFSET(WmiMonitorBasicDisplayParams, SupportedDisplayFeatures) + WmiMonitorBasicDisplayParams_SupportedDisplayFeatures_SIZE) - -// WmiMonitorConnectionParams - WmiMonitorConnectionParams -#define WmiMonitorConnectionParamsGuid \ - { 0x2e2d2463,0xb537,0x4da7, { 0x8e,0xee,0x51,0x30,0x6f,0x1f,0x48,0x2f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorConnectionParams_GUID, \ - 0x2e2d2463,0xb537,0x4da7,0x8e,0xee,0x51,0x30,0x6f,0x1f,0x48,0x2f); -#endif - - -typedef struct _WmiMonitorConnectionParams -{ - // - ULONG VideoOutputTechnology; - #define WmiMonitorConnectionParams_VideoOutputTechnology_SIZE sizeof(ULONG) - #define WmiMonitorConnectionParams_VideoOutputTechnology_ID 1 - -} WmiMonitorConnectionParams, *PWmiMonitorConnectionParams; - -#define WmiMonitorConnectionParams_SIZE (FIELD_OFFSET(WmiMonitorConnectionParams, VideoOutputTechnology) + WmiMonitorConnectionParams_VideoOutputTechnology_SIZE) - -// WmiMonitorAnalogVideoInputParams - WmiMonitorAnalogVideoInputParams -#define WmiMonitorAnalogVideoInputParamsGuid \ - { 0xa56dbcf9,0xc4f0,0x44a8, { 0x9c,0x1b,0xbb,0x3b,0x3f,0x77,0x4b,0x4d } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorAnalogVideoInputParams_GUID, \ - 0xa56dbcf9,0xc4f0,0x44a8,0x9c,0x1b,0xbb,0x3b,0x3f,0x77,0x4b,0x4d); -#endif - - -typedef struct _WmiMonitorAnalogVideoInputParams -{ - // - UCHAR SignalLevelStandard; - #define WmiMonitorAnalogVideoInputParams_SignalLevelStandard_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_SignalLevelStandard_ID 1 - - // - UCHAR SetupExpected; - #define WmiMonitorAnalogVideoInputParams_SetupExpected_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_SetupExpected_ID 2 - - // - UCHAR SeparateSyncsSupported; - #define WmiMonitorAnalogVideoInputParams_SeparateSyncsSupported_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_SeparateSyncsSupported_ID 3 - - // - UCHAR CompositeSyncSupported; - #define WmiMonitorAnalogVideoInputParams_CompositeSyncSupported_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_CompositeSyncSupported_ID 4 - - // - UCHAR SyncOnGreenVideoSupported; - #define WmiMonitorAnalogVideoInputParams_SyncOnGreenVideoSupported_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_SyncOnGreenVideoSupported_ID 5 - - // - UCHAR SerrationOfVsyncRequired; - #define WmiMonitorAnalogVideoInputParams_SerrationOfVsyncRequired_SIZE sizeof(UCHAR) - #define WmiMonitorAnalogVideoInputParams_SerrationOfVsyncRequired_ID 6 - -} WmiMonitorAnalogVideoInputParams, *PWmiMonitorAnalogVideoInputParams; - -#define WmiMonitorAnalogVideoInputParams_SIZE (FIELD_OFFSET(WmiMonitorAnalogVideoInputParams, SerrationOfVsyncRequired) + WmiMonitorAnalogVideoInputParams_SerrationOfVsyncRequired_SIZE) - -// WmiMonitorDigitalVideoInputParams - WmiMonitorDigitalVideoInputParams -#define WmiMonitorDigitalVideoInputParamsGuid \ - { 0x51565945,0x498a,0x4a77, { 0xac,0xc6,0x15,0x1b,0xec,0xc8,0x05,0xca } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorDigitalVideoInputParams_GUID, \ - 0x51565945,0x498a,0x4a77,0xac,0xc6,0x15,0x1b,0xec,0xc8,0x05,0xca); -#endif - - -typedef struct _WmiMonitorDigitalVideoInputParams -{ - // - BOOLEAN IsDFP1xCompatible; - #define WmiMonitorDigitalVideoInputParams_IsDFP1xCompatible_SIZE sizeof(BOOLEAN) - #define WmiMonitorDigitalVideoInputParams_IsDFP1xCompatible_ID 1 - -} WmiMonitorDigitalVideoInputParams, *PWmiMonitorDigitalVideoInputParams; - -#define WmiMonitorDigitalVideoInputParams_SIZE (FIELD_OFFSET(WmiMonitorDigitalVideoInputParams, IsDFP1xCompatible) + WmiMonitorDigitalVideoInputParams_IsDFP1xCompatible_SIZE) - -// WmiMonitorColorXYZinCIE - WmiMonitorColorXYZinCIE -#define WmiMonitorColorXYZinCIEGuid \ - { 0x01faf041,0x842c,0x4230, { 0xa3,0x1e,0x13,0x35,0x42,0x8c,0xd8,0xf0 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorColorXYZinCIE_GUID, \ - 0x01faf041,0x842c,0x4230,0xa3,0x1e,0x13,0x35,0x42,0x8c,0xd8,0xf0); -#endif - - -typedef struct _WmiMonitorColorXYZinCIE -{ - // - USHORT X; - #define WmiMonitorColorXYZinCIE_X_SIZE sizeof(USHORT) - #define WmiMonitorColorXYZinCIE_X_ID 1 - - // - USHORT Y; - #define WmiMonitorColorXYZinCIE_Y_SIZE sizeof(USHORT) - #define WmiMonitorColorXYZinCIE_Y_ID 2 - -} WmiMonitorColorXYZinCIE, *PWmiMonitorColorXYZinCIE; - -#define WmiMonitorColorXYZinCIE_SIZE (FIELD_OFFSET(WmiMonitorColorXYZinCIE, Y) + WmiMonitorColorXYZinCIE_Y_SIZE) - -// WmiMonitorColorCharacteristics - WmiMonitorColorCharacteristics -#define WmiMonitorColorCharacteristicsGuid \ - { 0xea324793,0x51bb,0x486a, { 0xaa,0x9d,0x0f,0x55,0x52,0x35,0x34,0x13 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorColorCharacteristics_GUID, \ - 0xea324793,0x51bb,0x486a,0xaa,0x9d,0x0f,0x55,0x52,0x35,0x34,0x13); -#endif - - -typedef struct _WmiMonitorColorCharacteristics -{ - // - WmiMonitorColorXYZinCIE Red; - #define WmiMonitorColorCharacteristics_Red_SIZE sizeof(WmiMonitorColorXYZinCIE) - #define WmiMonitorColorCharacteristics_Red_ID 1 - - // - WmiMonitorColorXYZinCIE Blue; - #define WmiMonitorColorCharacteristics_Blue_SIZE sizeof(WmiMonitorColorXYZinCIE) - #define WmiMonitorColorCharacteristics_Blue_ID 2 - - // - WmiMonitorColorXYZinCIE Green; - #define WmiMonitorColorCharacteristics_Green_SIZE sizeof(WmiMonitorColorXYZinCIE) - #define WmiMonitorColorCharacteristics_Green_ID 3 - - // - WmiMonitorColorXYZinCIE DefaultWhite; - #define WmiMonitorColorCharacteristics_DefaultWhite_SIZE sizeof(WmiMonitorColorXYZinCIE) - #define WmiMonitorColorCharacteristics_DefaultWhite_ID 4 - -} WmiMonitorColorCharacteristics, *PWmiMonitorColorCharacteristics; - -#define WmiMonitorColorCharacteristics_SIZE (FIELD_OFFSET(WmiMonitorColorCharacteristics, DefaultWhite) + WmiMonitorColorCharacteristics_DefaultWhite_SIZE) - -// VideoModeDescriptor - VideoModeDescriptor -#define VideoModeDescriptorGuid \ - { 0x4a97ed30,0xbfaa,0x491a, { 0x9d,0xfd,0xb4,0x3a,0xde,0xdb,0xf8,0xe3 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(VideoModeDescriptor_GUID, \ - 0x4a97ed30,0xbfaa,0x491a,0x9d,0xfd,0xb4,0x3a,0xde,0xdb,0xf8,0xe3); -#endif - - -typedef struct _VideoModeDescriptor -{ - // - ULONG PixelClockRate; - #define VideoModeDescriptor_PixelClockRate_SIZE sizeof(ULONG) - #define VideoModeDescriptor_PixelClockRate_ID 1 - - // - ULONG VerticalRefreshRateNumerator; - #define VideoModeDescriptor_VerticalRefreshRateNumerator_SIZE sizeof(ULONG) - #define VideoModeDescriptor_VerticalRefreshRateNumerator_ID 2 - - // - ULONG VerticalRefreshRateDenominator; - #define VideoModeDescriptor_VerticalRefreshRateDenominator_SIZE sizeof(ULONG) - #define VideoModeDescriptor_VerticalRefreshRateDenominator_ID 3 - - // - ULONG HorizontalRefreshRateNumerator; - #define VideoModeDescriptor_HorizontalRefreshRateNumerator_SIZE sizeof(ULONG) - #define VideoModeDescriptor_HorizontalRefreshRateNumerator_ID 4 - - // - ULONG HorizontalRefreshRateDenominator; - #define VideoModeDescriptor_HorizontalRefreshRateDenominator_SIZE sizeof(ULONG) - #define VideoModeDescriptor_HorizontalRefreshRateDenominator_ID 5 - - // - USHORT HorizontalActivePixels; - #define VideoModeDescriptor_HorizontalActivePixels_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalActivePixels_ID 6 - - // - USHORT VerticalActivePixels; - #define VideoModeDescriptor_VerticalActivePixels_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalActivePixels_ID 7 - - // - USHORT HorizontalBlankingPixels; - #define VideoModeDescriptor_HorizontalBlankingPixels_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalBlankingPixels_ID 8 - - // - USHORT VerticalBlankingPixels; - #define VideoModeDescriptor_VerticalBlankingPixels_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalBlankingPixels_ID 9 - - // - USHORT HorizontalSyncOffset; - #define VideoModeDescriptor_HorizontalSyncOffset_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalSyncOffset_ID 10 - - // - USHORT VerticalSyncOffset; - #define VideoModeDescriptor_VerticalSyncOffset_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalSyncOffset_ID 11 - - // - USHORT HorizontalSyncPulseWidth; - #define VideoModeDescriptor_HorizontalSyncPulseWidth_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalSyncPulseWidth_ID 12 - - // - USHORT VerticalSyncPulseWidth; - #define VideoModeDescriptor_VerticalSyncPulseWidth_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalSyncPulseWidth_ID 13 - - // - USHORT HorizontalImageSize; - #define VideoModeDescriptor_HorizontalImageSize_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalImageSize_ID 14 - - // - USHORT VerticalImageSize; - #define VideoModeDescriptor_VerticalImageSize_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalImageSize_ID 15 - - // - USHORT HorizontalBorder; - #define VideoModeDescriptor_HorizontalBorder_SIZE sizeof(USHORT) - #define VideoModeDescriptor_HorizontalBorder_ID 16 - - // - USHORT VerticalBorder; - #define VideoModeDescriptor_VerticalBorder_SIZE sizeof(USHORT) - #define VideoModeDescriptor_VerticalBorder_ID 17 - - // - BOOLEAN IsInterlaced; - #define VideoModeDescriptor_IsInterlaced_SIZE sizeof(BOOLEAN) - #define VideoModeDescriptor_IsInterlaced_ID 18 - - // - UCHAR StereoModeType; - #define VideoModeDescriptor_StereoModeType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_StereoModeType_ID 19 - - // - UCHAR SyncSignalType; - #define VideoModeDescriptor_SyncSignalType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_SyncSignalType_ID 20 - - // - UCHAR IsSerrationRequired; - #define VideoModeDescriptor_IsSerrationRequired_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_IsSerrationRequired_ID 21 - - // - UCHAR IsSyncOnRGB; - #define VideoModeDescriptor_IsSyncOnRGB_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_IsSyncOnRGB_ID 22 - - // - UCHAR CompositePolarityType; - #define VideoModeDescriptor_CompositePolarityType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_CompositePolarityType_ID 23 - - // - UCHAR VerticalPolarityType; - #define VideoModeDescriptor_VerticalPolarityType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_VerticalPolarityType_ID 24 - - // - UCHAR HorizontalPolarityType; - #define VideoModeDescriptor_HorizontalPolarityType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_HorizontalPolarityType_ID 25 - - // - UCHAR VideoStandardType; - #define VideoModeDescriptor_VideoStandardType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_VideoStandardType_ID 26 - - // - UCHAR Origin; - #define VideoModeDescriptor_Origin_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_Origin_ID 27 - - // - UCHAR TimingType; - #define VideoModeDescriptor_TimingType_SIZE sizeof(UCHAR) - #define VideoModeDescriptor_TimingType_ID 28 - -} VideoModeDescriptor, *PVideoModeDescriptor; - -#define VideoModeDescriptor_SIZE (FIELD_OFFSET(VideoModeDescriptor, TimingType) + VideoModeDescriptor_TimingType_SIZE) - -// WmiMonitorListedSupportedSourceModes - WmiMonitorListedSupportedSourceModes -#define WmiMonitorListedSupportedSourceModesGuid \ - { 0x6dc76655,0x063c,0x4524, { 0xa8,0x62,0xb8,0x41,0x0c,0x26,0x28,0x1b } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorListedSupportedSourceModes_GUID, \ - 0x6dc76655,0x063c,0x4524,0xa8,0x62,0xb8,0x41,0x0c,0x26,0x28,0x1b); -#endif - - -typedef struct _WmiMonitorListedSupportedSourceModes -{ - // - USHORT NumOfMonitorSourceModes; - #define WmiMonitorListedSupportedSourceModes_NumOfMonitorSourceModes_SIZE sizeof(USHORT) - #define WmiMonitorListedSupportedSourceModes_NumOfMonitorSourceModes_ID 1 - - // - USHORT PreferredMonitorSourceModeIndex; - #define WmiMonitorListedSupportedSourceModes_PreferredMonitorSourceModeIndex_SIZE sizeof(USHORT) - #define WmiMonitorListedSupportedSourceModes_PreferredMonitorSourceModeIndex_ID 2 - - // - VideoModeDescriptor MonitorSourceModes[1]; - #define WmiMonitorListedSupportedSourceModes_MonitorSourceModes_ID 3 - -} WmiMonitorListedSupportedSourceModes, *PWmiMonitorListedSupportedSourceModes; - -// FrequencyRangeDescriptor - FrequencyRangeDescriptor -#define FrequencyRangeDescriptorGuid \ - { 0xf4546078,0xf3b2,0x417e, { 0x94,0xcd,0x47,0xea,0x30,0x6c,0x57,0x51 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(FrequencyRangeDescriptor_GUID, \ - 0xf4546078,0xf3b2,0x417e,0x94,0xcd,0x47,0xea,0x30,0x6c,0x57,0x51); -#endif - - -typedef struct _FrequencyRangeDescriptor -{ - // - UCHAR Origin; - #define FrequencyRangeDescriptor_Origin_SIZE sizeof(UCHAR) - #define FrequencyRangeDescriptor_Origin_ID 1 - - // - ULONG MinVSyncNumerator; - #define FrequencyRangeDescriptor_MinVSyncNumerator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MinVSyncNumerator_ID 2 - - // - ULONG MinVSyncDenominator; - #define FrequencyRangeDescriptor_MinVSyncDenominator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MinVSyncDenominator_ID 3 - - // - ULONG MaxVSyncNumerator; - #define FrequencyRangeDescriptor_MaxVSyncNumerator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MaxVSyncNumerator_ID 4 - - // - ULONG MaxVSyncDenominator; - #define FrequencyRangeDescriptor_MaxVSyncDenominator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MaxVSyncDenominator_ID 5 - - // - ULONG MinHSyncNumerator; - #define FrequencyRangeDescriptor_MinHSyncNumerator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MinHSyncNumerator_ID 6 - - // - ULONG MinHSyncDenominator; - #define FrequencyRangeDescriptor_MinHSyncDenominator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MinHSyncDenominator_ID 7 - - // - ULONG MaxHSyncNumerator; - #define FrequencyRangeDescriptor_MaxHSyncNumerator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MaxHSyncNumerator_ID 8 - - // - ULONG MaxHSyncDenominator; - #define FrequencyRangeDescriptor_MaxHSyncDenominator_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MaxHSyncDenominator_ID 9 - - // - ULONG ConstraintType; - #define FrequencyRangeDescriptor_ConstraintType_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_ConstraintType_ID 10 - - // - ULONG ActiveWidth; - #define FrequencyRangeDescriptor_ActiveWidth_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_ActiveWidth_ID 11 - - // - ULONG ActiveHeight; - #define FrequencyRangeDescriptor_ActiveHeight_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_ActiveHeight_ID 12 - - // - ULONG MaxPixelRate; - #define FrequencyRangeDescriptor_MaxPixelRate_SIZE sizeof(ULONG) - #define FrequencyRangeDescriptor_MaxPixelRate_ID 13 - -} FrequencyRangeDescriptor, *PFrequencyRangeDescriptor; - -#define FrequencyRangeDescriptor_SIZE (FIELD_OFFSET(FrequencyRangeDescriptor, MaxPixelRate) + FrequencyRangeDescriptor_MaxPixelRate_SIZE) - -// WmiMonitorListedFrequencyRanges - WmiMonitorListedFrequencyRanges -#define WmiMonitorListedFrequencyRangesGuid \ - { 0xe86e9525,0x65b6,0x4b85, { 0x95,0xc5,0x00,0xbe,0xac,0xc9,0x75,0xed } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(WmiMonitorListedFrequencyRanges_GUID, \ - 0xe86e9525,0x65b6,0x4b85,0x95,0xc5,0x00,0xbe,0xac,0xc9,0x75,0xed); -#endif - - -typedef struct _WmiMonitorListedFrequencyRanges -{ - // - USHORT NumOfMonitorFreqRanges; - #define WmiMonitorListedFrequencyRanges_NumOfMonitorFreqRanges_SIZE sizeof(USHORT) - #define WmiMonitorListedFrequencyRanges_NumOfMonitorFreqRanges_ID 1 - - // - FrequencyRangeDescriptor MonitorFreqRanges[1]; - #define WmiMonitorListedFrequencyRanges_MonitorFreqRanges_ID 2 - -} WmiMonitorListedFrequencyRanges, *PWmiMonitorListedFrequencyRanges; - -// KernelPerfState - KernelPerfState -#define KernelPerfStateGuid \ - { 0x8c7980e1,0xf62b,0x419e, { 0xaa,0x82,0x27,0x6c,0x8d,0x06,0x4a,0x1f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelPerfState_GUID, \ - 0x8c7980e1,0xf62b,0x419e,0xaa,0x82,0x27,0x6c,0x8d,0x06,0x4a,0x1f); -#endif - - -typedef struct _KernelPerfState -{ - // - ULONG Frequency; - #define KernelPerfState_Frequency_SIZE sizeof(ULONG) - #define KernelPerfState_Frequency_ID 1 - - // - ULONG Power; - #define KernelPerfState_Power_SIZE sizeof(ULONG) - #define KernelPerfState_Power_ID 2 - - // - UCHAR PercentFrequency; - #define KernelPerfState_PercentFrequency_SIZE sizeof(UCHAR) - #define KernelPerfState_PercentFrequency_ID 3 - - // - UCHAR IncreaseLevel; - #define KernelPerfState_IncreaseLevel_SIZE sizeof(UCHAR) - #define KernelPerfState_IncreaseLevel_ID 4 - - // - UCHAR DecreaseLevel; - #define KernelPerfState_DecreaseLevel_SIZE sizeof(UCHAR) - #define KernelPerfState_DecreaseLevel_ID 5 - - // - UCHAR Type; - #define KernelPerfState_Type_SIZE sizeof(UCHAR) - #define KernelPerfState_Type_ID 6 - - // - ULONG IncreaseTime; - #define KernelPerfState_IncreaseTime_SIZE sizeof(ULONG) - #define KernelPerfState_IncreaseTime_ID 7 - - // - ULONG DecreaseTime; - #define KernelPerfState_DecreaseTime_SIZE sizeof(ULONG) - #define KernelPerfState_DecreaseTime_ID 8 - - // - ULONGLONG Control; - #define KernelPerfState_Control_SIZE sizeof(ULONGLONG) - #define KernelPerfState_Control_ID 9 - - // - ULONGLONG Status; - #define KernelPerfState_Status_SIZE sizeof(ULONGLONG) - #define KernelPerfState_Status_ID 10 - - // - ULONG HitCount; - #define KernelPerfState_HitCount_SIZE sizeof(ULONG) - #define KernelPerfState_HitCount_ID 11 - - // - ULONG Reserved1; - #define KernelPerfState_Reserved1_SIZE sizeof(ULONG) - #define KernelPerfState_Reserved1_ID 12 - - // - ULONGLONG Reserved2; - #define KernelPerfState_Reserved2_SIZE sizeof(ULONGLONG) - #define KernelPerfState_Reserved2_ID 13 - - // - ULONGLONG Reserved3; - #define KernelPerfState_Reserved3_SIZE sizeof(ULONGLONG) - #define KernelPerfState_Reserved3_ID 14 - -} KernelPerfState, *PKernelPerfState; - -#define KernelPerfState_SIZE (FIELD_OFFSET(KernelPerfState, Reserved3) + KernelPerfState_Reserved3_SIZE) - -// KernelPerfStates - KernelPerfStates -#define KernelPerfStatesGuid \ - { 0x5708cc20,0x7d40,0x4bf4, { 0xb4,0xaa,0x2b,0x01,0x33,0x8d,0x01,0x26 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelPerfStates_GUID, \ - 0x5708cc20,0x7d40,0x4bf4,0xb4,0xaa,0x2b,0x01,0x33,0x8d,0x01,0x26); -#endif - - -typedef struct _KernelPerfStates -{ - // - ULONG Count; - #define KernelPerfStates_Count_SIZE sizeof(ULONG) - #define KernelPerfStates_Count_ID 1 - - // - ULONG MaxFrequency; - #define KernelPerfStates_MaxFrequency_SIZE sizeof(ULONG) - #define KernelPerfStates_MaxFrequency_ID 2 - - // - ULONG CurrentState; - #define KernelPerfStates_CurrentState_SIZE sizeof(ULONG) - #define KernelPerfStates_CurrentState_ID 3 - - // - ULONG MaxPerfState; - #define KernelPerfStates_MaxPerfState_SIZE sizeof(ULONG) - #define KernelPerfStates_MaxPerfState_ID 4 - - // - ULONG MinPerfState; - #define KernelPerfStates_MinPerfState_SIZE sizeof(ULONG) - #define KernelPerfStates_MinPerfState_ID 5 - - // - ULONG LowestPerfState; - #define KernelPerfStates_LowestPerfState_SIZE sizeof(ULONG) - #define KernelPerfStates_LowestPerfState_ID 6 - - // - ULONG ThermalConstraint; - #define KernelPerfStates_ThermalConstraint_SIZE sizeof(ULONG) - #define KernelPerfStates_ThermalConstraint_ID 7 - - // - UCHAR BusyAdjThreshold; - #define KernelPerfStates_BusyAdjThreshold_SIZE sizeof(UCHAR) - #define KernelPerfStates_BusyAdjThreshold_ID 8 - - // - UCHAR PolicyType; - #define KernelPerfStates_PolicyType_SIZE sizeof(UCHAR) - #define KernelPerfStates_PolicyType_ID 9 - - // - UCHAR Type; - #define KernelPerfStates_Type_SIZE sizeof(UCHAR) - #define KernelPerfStates_Type_ID 10 - - // - UCHAR Reserved; - #define KernelPerfStates_Reserved_SIZE sizeof(UCHAR) - #define KernelPerfStates_Reserved_ID 11 - - // - ULONG TimerInterval; - #define KernelPerfStates_TimerInterval_SIZE sizeof(ULONG) - #define KernelPerfStates_TimerInterval_ID 12 - - // - ULONGLONG TargetProcessors; - #define KernelPerfStates_TargetProcessors_SIZE sizeof(ULONGLONG) - #define KernelPerfStates_TargetProcessors_ID 13 - - // - ULONG PStateHandler; - #define KernelPerfStates_PStateHandler_SIZE sizeof(ULONG) - #define KernelPerfStates_PStateHandler_ID 14 - - // - ULONG PStateContext; - #define KernelPerfStates_PStateContext_SIZE sizeof(ULONG) - #define KernelPerfStates_PStateContext_ID 15 - - // - ULONG TStateHandler; - #define KernelPerfStates_TStateHandler_SIZE sizeof(ULONG) - #define KernelPerfStates_TStateHandler_ID 16 - - // - ULONG TStateContext; - #define KernelPerfStates_TStateContext_SIZE sizeof(ULONG) - #define KernelPerfStates_TStateContext_ID 17 - - // - ULONG FeedbackHandler; - #define KernelPerfStates_FeedbackHandler_SIZE sizeof(ULONG) - #define KernelPerfStates_FeedbackHandler_ID 18 - - // - ULONG Reserved1; - #define KernelPerfStates_Reserved1_SIZE sizeof(ULONG) - #define KernelPerfStates_Reserved1_ID 19 - - // - ULONGLONG Reserved2; - #define KernelPerfStates_Reserved2_SIZE sizeof(ULONGLONG) - #define KernelPerfStates_Reserved2_ID 20 - - // - KernelPerfState State[1]; - #define KernelPerfStates_State_ID 21 - -} KernelPerfStates, *PKernelPerfStates; - -// KernelIdleState - KernelIdleState -#define KernelIdleStateGuid \ - { 0x46bdcf4a,0xe076,0x4550, { 0x82,0xb2,0x9f,0x32,0xed,0xed,0x3e,0x7f } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelIdleState_GUID, \ - 0x46bdcf4a,0xe076,0x4550,0x82,0xb2,0x9f,0x32,0xed,0xed,0x3e,0x7f); -#endif - - -typedef struct _KernelIdleState -{ - // - ULONG Latency; - #define KernelIdleState_Latency_SIZE sizeof(ULONG) - #define KernelIdleState_Latency_ID 1 - - // - ULONG Power; - #define KernelIdleState_Power_SIZE sizeof(ULONG) - #define KernelIdleState_Power_ID 2 - - // - ULONG TimeCheck; - #define KernelIdleState_TimeCheck_SIZE sizeof(ULONG) - #define KernelIdleState_TimeCheck_ID 3 - - // - UCHAR PromotePercent; - #define KernelIdleState_PromotePercent_SIZE sizeof(UCHAR) - #define KernelIdleState_PromotePercent_ID 4 - - // - UCHAR DemotePercent; - #define KernelIdleState_DemotePercent_SIZE sizeof(UCHAR) - #define KernelIdleState_DemotePercent_ID 5 - - // - UCHAR StateType; - #define KernelIdleState_StateType_SIZE sizeof(UCHAR) - #define KernelIdleState_StateType_ID 6 - - // - UCHAR Reserved; - #define KernelIdleState_Reserved_SIZE sizeof(UCHAR) - #define KernelIdleState_Reserved_ID 7 - - // - ULONG StateFlags; - #define KernelIdleState_StateFlags_SIZE sizeof(ULONG) - #define KernelIdleState_StateFlags_ID 8 - - // - ULONG Context; - #define KernelIdleState_Context_SIZE sizeof(ULONG) - #define KernelIdleState_Context_ID 9 - - // - ULONG IdleHandler; - #define KernelIdleState_IdleHandler_SIZE sizeof(ULONG) - #define KernelIdleState_IdleHandler_ID 10 - - // - ULONG Reserved1; - #define KernelIdleState_Reserved1_SIZE sizeof(ULONG) - #define KernelIdleState_Reserved1_ID 11 - -} KernelIdleState, *PKernelIdleState; - -#define KernelIdleState_SIZE (FIELD_OFFSET(KernelIdleState, Reserved1) + KernelIdleState_Reserved1_SIZE) - -// KernelIdleStates - KernelIdleStates -#define KernelIdleStatesGuid \ - { 0xba138e10,0xe250,0x4ad7, { 0x86,0x16,0xcf,0x1a,0x7a,0xd4,0x10,0xe7 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelIdleStates_GUID, \ - 0xba138e10,0xe250,0x4ad7,0x86,0x16,0xcf,0x1a,0x7a,0xd4,0x10,0xe7); -#endif - - -typedef struct _KernelIdleStates -{ - // - ULONG Type; - #define KernelIdleStates_Type_SIZE sizeof(ULONG) - #define KernelIdleStates_Type_ID 1 - - // - ULONG Count; - #define KernelIdleStates_Count_SIZE sizeof(ULONG) - #define KernelIdleStates_Count_ID 2 - - // - ULONG TargetState; - #define KernelIdleStates_TargetState_SIZE sizeof(ULONG) - #define KernelIdleStates_TargetState_ID 3 - - // - ULONG OldState; - #define KernelIdleStates_OldState_SIZE sizeof(ULONG) - #define KernelIdleStates_OldState_ID 4 - - // - ULONGLONG TargetProcessors; - #define KernelIdleStates_TargetProcessors_SIZE sizeof(ULONGLONG) - #define KernelIdleStates_TargetProcessors_ID 5 - - // - KernelIdleState State[1]; - #define KernelIdleStates_State_ID 6 - -} KernelIdleStates, *PKernelIdleStates; - -// KernelPerfStateChange - KernelPerfStateChange -// Kernel Perf State Transition Event -#define KernelPerfStateChangeGuid \ - { 0xa5b32ddd,0x7f39,0x4abc, { 0xb8,0x92,0x90,0x0e,0x43,0xb5,0x9e,0xbb } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelPerfStateChange_GUID, \ - 0xa5b32ddd,0x7f39,0x4abc,0xb8,0x92,0x90,0x0e,0x43,0xb5,0x9e,0xbb); -#endif - - -typedef struct _KernelPerfStateChange -{ - // - ULONG State; - #define KernelPerfStateChange_State_SIZE sizeof(ULONG) - #define KernelPerfStateChange_State_ID 1 - - // - ULONG Status; - #define KernelPerfStateChange_Status_SIZE sizeof(ULONG) - #define KernelPerfStateChange_Status_ID 2 - - // - ULONG Latency; - #define KernelPerfStateChange_Latency_SIZE sizeof(ULONG) - #define KernelPerfStateChange_Latency_ID 3 - - // - ULONG Speed; - #define KernelPerfStateChange_Speed_SIZE sizeof(ULONG) - #define KernelPerfStateChange_Speed_ID 4 - - // - ULONG Processor; - #define KernelPerfStateChange_Processor_SIZE sizeof(ULONG) - #define KernelPerfStateChange_Processor_ID 5 - -} KernelPerfStateChange, *PKernelPerfStateChange; - -#define KernelPerfStateChange_SIZE (FIELD_OFFSET(KernelPerfStateChange, Processor) + KernelPerfStateChange_Processor_SIZE) - -// KernelPerfStateDomainChange - KernelPerfStateDomainChange -// Kernel Perf State Domain Transition Event -#define KernelPerfStateDomainChangeGuid \ - { 0x995e6b7f,0xd653,0x497a, { 0xb9,0x78,0x36,0xa3,0x0c,0x29,0xbf,0x01 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelPerfStateDomainChange_GUID, \ - 0x995e6b7f,0xd653,0x497a,0xb9,0x78,0x36,0xa3,0x0c,0x29,0xbf,0x01); -#endif - - -typedef struct _KernelPerfStateDomainChange -{ - // - ULONG State; - #define KernelPerfStateDomainChange_State_SIZE sizeof(ULONG) - #define KernelPerfStateDomainChange_State_ID 1 - - // - ULONG Latency; - #define KernelPerfStateDomainChange_Latency_SIZE sizeof(ULONG) - #define KernelPerfStateDomainChange_Latency_ID 2 - - // - ULONG Speed; - #define KernelPerfStateDomainChange_Speed_SIZE sizeof(ULONG) - #define KernelPerfStateDomainChange_Speed_ID 3 - - // - ULONGLONG Processors; - #define KernelPerfStateDomainChange_Processors_SIZE sizeof(ULONGLONG) - #define KernelPerfStateDomainChange_Processors_ID 4 - -} KernelPerfStateDomainChange, *PKernelPerfStateDomainChange; - -#define KernelPerfStateDomainChange_SIZE (FIELD_OFFSET(KernelPerfStateDomainChange, Processors) + KernelPerfStateDomainChange_Processors_SIZE) - -// KernelIdleStateChange - KernelIdleStateChange -// Kernel Idle State Change Event -#define KernelIdleStateChangeGuid \ - { 0x4838fe4f,0xf71c,0x4e51, { 0x9e,0xcc,0x84,0x30,0xa7,0xac,0x4c,0x6c } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelIdleStateChange_GUID, \ - 0x4838fe4f,0xf71c,0x4e51,0x9e,0xcc,0x84,0x30,0xa7,0xac,0x4c,0x6c); -#endif - - -typedef struct _KernelIdleStateChange -{ - // - ULONG NewState; - #define KernelIdleStateChange_NewState_SIZE sizeof(ULONG) - #define KernelIdleStateChange_NewState_ID 1 - - // - ULONG OldState; - #define KernelIdleStateChange_OldState_SIZE sizeof(ULONG) - #define KernelIdleStateChange_OldState_ID 2 - - // - ULONGLONG Processors; - #define KernelIdleStateChange_Processors_SIZE sizeof(ULONGLONG) - #define KernelIdleStateChange_Processors_ID 3 - -} KernelIdleStateChange, *PKernelIdleStateChange; - -#define KernelIdleStateChange_SIZE (FIELD_OFFSET(KernelIdleStateChange, Processors) + KernelIdleStateChange_Processors_SIZE) - -// KernelThermalConstraintChange - KernelThermalConstraintChange -// Kernel Thermal Event -#define KernelThermalConstraintChangeGuid \ - { 0xa852c2c8,0x1a4c,0x423b, { 0x8c,0x2c,0xf3,0x0d,0x82,0x93,0x1a,0x88 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelThermalConstraintChange_GUID, \ - 0xa852c2c8,0x1a4c,0x423b,0x8c,0x2c,0xf3,0x0d,0x82,0x93,0x1a,0x88); -#endif - - -typedef struct _KernelThermalConstraintChange -{ - // - ULONG ThermalConstraint; - #define KernelThermalConstraintChange_ThermalConstraint_SIZE sizeof(ULONG) - #define KernelThermalConstraintChange_ThermalConstraint_ID 1 - - // - ULONGLONG Processors; - #define KernelThermalConstraintChange_Processors_SIZE sizeof(ULONGLONG) - #define KernelThermalConstraintChange_Processors_ID 2 - -} KernelThermalConstraintChange, *PKernelThermalConstraintChange; - -#define KernelThermalConstraintChange_SIZE (FIELD_OFFSET(KernelThermalConstraintChange, Processors) + KernelThermalConstraintChange_Processors_SIZE) - -// IdleStateAccounting - IdleStateAccounting -#define IdleStateAccountingGuid \ - { 0x5280028a,0xc24f,0x43ec, { 0xb2,0x7d,0xa9,0x60,0xa7,0x0e,0x31,0x9a } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(IdleStateAccounting_GUID, \ - 0x5280028a,0xc24f,0x43ec,0xb2,0x7d,0xa9,0x60,0xa7,0x0e,0x31,0x9a); -#endif - - -typedef struct _IdleStateAccounting -{ - // - ULONG IdleTransitions; - #define IdleStateAccounting_IdleTransitions_SIZE sizeof(ULONG) - #define IdleStateAccounting_IdleTransitions_ID 1 - - // - ULONG FailedTransitions; - #define IdleStateAccounting_FailedTransitions_SIZE sizeof(ULONG) - #define IdleStateAccounting_FailedTransitions_ID 2 - - // - ULONG InvalidBucketIndex; - #define IdleStateAccounting_InvalidBucketIndex_SIZE sizeof(ULONG) - #define IdleStateAccounting_InvalidBucketIndex_ID 3 - - // - ULONGLONG TotalTime; - #define IdleStateAccounting_TotalTime_SIZE sizeof(ULONGLONG) - #define IdleStateAccounting_TotalTime_ID 4 - - // - ULONG IdleTimeBuckets[6]; - #define IdleStateAccounting_IdleTimeBuckets_SIZE sizeof(ULONG[6]) - #define IdleStateAccounting_IdleTimeBuckets_ID 5 - -} IdleStateAccounting, *PIdleStateAccounting; - -#define IdleStateAccounting_SIZE (FIELD_OFFSET(IdleStateAccounting, IdleTimeBuckets) + IdleStateAccounting_IdleTimeBuckets_SIZE) - -// IdleAccounting - IdleAccounting -#define IdleAccountingGuid \ - { 0xe2a26f78,0xae07,0x4ee0, { 0xa3,0x0f,0xce,0x35,0x4f,0x5a,0x94,0xcd } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(IdleAccounting_GUID, \ - 0xe2a26f78,0xae07,0x4ee0,0xa3,0x0f,0xce,0x35,0x4f,0x5a,0x94,0xcd); -#endif - - -typedef struct _IdleAccounting -{ - // - ULONG StateCount; - #define IdleAccounting_StateCount_SIZE sizeof(ULONG) - #define IdleAccounting_StateCount_ID 1 - - // - ULONG TotalTransitions; - #define IdleAccounting_TotalTransitions_SIZE sizeof(ULONG) - #define IdleAccounting_TotalTransitions_ID 2 - - // - ULONG ResetCount; - #define IdleAccounting_ResetCount_SIZE sizeof(ULONG) - #define IdleAccounting_ResetCount_ID 3 - - // - ULONGLONG StartTime; - #define IdleAccounting_StartTime_SIZE sizeof(ULONGLONG) - #define IdleAccounting_StartTime_ID 4 - - // - IdleStateAccounting State[1]; - #define IdleAccounting_State_ID 5 - -} IdleAccounting, *PIdleAccounting; - -// IdleStateBucketEx - IdleStateBucketEx -#define IdleStateBucketExGuid \ - { 0xe53e0a7d,0x36f0,0x4a77, { 0x87,0x9e,0x9c,0x6b,0x5e,0x4a,0x85,0x54 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(IdleStateBucketEx_GUID, \ - 0xe53e0a7d,0x36f0,0x4a77,0x87,0x9e,0x9c,0x6b,0x5e,0x4a,0x85,0x54); -#endif - - -typedef struct _IdleStateBucketEx -{ - // - ULONGLONG TotalTimeUs; - #define IdleStateBucketEx_TotalTimeUs_SIZE sizeof(ULONGLONG) - #define IdleStateBucketEx_TotalTimeUs_ID 1 - - // - ULONG MinTimeUs; - #define IdleStateBucketEx_MinTimeUs_SIZE sizeof(ULONG) - #define IdleStateBucketEx_MinTimeUs_ID 2 - - // - ULONG MaxTimeUs; - #define IdleStateBucketEx_MaxTimeUs_SIZE sizeof(ULONG) - #define IdleStateBucketEx_MaxTimeUs_ID 3 - - // - ULONG Count; - #define IdleStateBucketEx_Count_SIZE sizeof(ULONG) - #define IdleStateBucketEx_Count_ID 4 - -} IdleStateBucketEx, *PIdleStateBucketEx; - -#define IdleStateBucketEx_SIZE (FIELD_OFFSET(IdleStateBucketEx, Count) + IdleStateBucketEx_Count_SIZE) - -// IdleStateAccountingEx - IdleStateAccountingEx -#define IdleStateAccountingExGuid \ - { 0x3e0d7b2c,0x401b,0x480f, { 0x83,0x03,0xd0,0xc2,0x0e,0xa1,0xa7,0xd8 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(IdleStateAccountingEx_GUID, \ - 0x3e0d7b2c,0x401b,0x480f,0x83,0x03,0xd0,0xc2,0x0e,0xa1,0xa7,0xd8); -#endif - - -typedef struct _IdleStateAccountingEx -{ - // - ULONGLONG TotalTime; - #define IdleStateAccountingEx_TotalTime_SIZE sizeof(ULONGLONG) - #define IdleStateAccountingEx_TotalTime_ID 1 - - // - ULONG IdleTransitions; - #define IdleStateAccountingEx_IdleTransitions_SIZE sizeof(ULONG) - #define IdleStateAccountingEx_IdleTransitions_ID 2 - - // - ULONG FailedTransitions; - #define IdleStateAccountingEx_FailedTransitions_SIZE sizeof(ULONG) - #define IdleStateAccountingEx_FailedTransitions_ID 3 - - // - ULONG InvalidBucketIndex; - #define IdleStateAccountingEx_InvalidBucketIndex_SIZE sizeof(ULONG) - #define IdleStateAccountingEx_InvalidBucketIndex_ID 4 - - // - ULONG MinTimeUs; - #define IdleStateAccountingEx_MinTimeUs_SIZE sizeof(ULONG) - #define IdleStateAccountingEx_MinTimeUs_ID 5 - - // - ULONG MaxTimeUs; - #define IdleStateAccountingEx_MaxTimeUs_SIZE sizeof(ULONG) - #define IdleStateAccountingEx_MaxTimeUs_ID 6 - - // - IdleStateBucketEx IdleTimeBuckets[16]; - #define IdleStateAccountingEx_IdleTimeBuckets_SIZE sizeof(IdleStateBucketEx[16]) - #define IdleStateAccountingEx_IdleTimeBuckets_ID 7 - -} IdleStateAccountingEx, *PIdleStateAccountingEx; - -#define IdleStateAccountingEx_SIZE (FIELD_OFFSET(IdleStateAccountingEx, IdleTimeBuckets) + IdleStateAccountingEx_IdleTimeBuckets_SIZE) - -// IdleAccountingEx - IdleAccountingEx -#define IdleAccountingExGuid \ - { 0xd67abd39,0x81f8,0x4a5e, { 0x81,0x52,0x72,0xe3,0x1e,0xc9,0x12,0xee } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(IdleAccountingEx_GUID, \ - 0xd67abd39,0x81f8,0x4a5e,0x81,0x52,0x72,0xe3,0x1e,0xc9,0x12,0xee); -#endif - - -typedef struct _IdleAccountingEx -{ - // - ULONG StateCount; - #define IdleAccountingEx_StateCount_SIZE sizeof(ULONG) - #define IdleAccountingEx_StateCount_ID 1 - - // - ULONG TotalTransitions; - #define IdleAccountingEx_TotalTransitions_SIZE sizeof(ULONG) - #define IdleAccountingEx_TotalTransitions_ID 2 - - // - ULONG ResetCount; - #define IdleAccountingEx_ResetCount_SIZE sizeof(ULONG) - #define IdleAccountingEx_ResetCount_ID 3 - - // - ULONGLONG StartTime; - #define IdleAccountingEx_StartTime_SIZE sizeof(ULONGLONG) - #define IdleAccountingEx_StartTime_ID 4 - - // - IdleStateAccountingEx State[1]; - #define IdleAccountingEx_State_ID 5 - -} IdleAccountingEx, *PIdleAccountingEx; - -// KernelThermalPolicyChange - KernelThermalPolicyChange -// Kernel Thermal Policy Event -#define KernelThermalPolicyChangeGuid \ - { 0xaca5a8f7,0x96ca,0x4397, { 0xba,0xde,0x43,0xbe,0x2f,0x57,0x7d,0x51 } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(KernelThermalPolicyChange_GUID, \ - 0xaca5a8f7,0x96ca,0x4397,0xba,0xde,0x43,0xbe,0x2f,0x57,0x7d,0x51); -#endif - - -typedef struct _KernelThermalPolicyChange -{ - // - UCHAR CoolingMode; - #define KernelThermalPolicyChange_CoolingMode_SIZE sizeof(UCHAR) - #define KernelThermalPolicyChange_CoolingMode_ID 1 - - // - ULONGLONG Processors; - #define KernelThermalPolicyChange_Processors_SIZE sizeof(ULONGLONG) - #define KernelThermalPolicyChange_Processors_ID 2 - -} KernelThermalPolicyChange, *PKernelThermalPolicyChange; - -#define KernelThermalPolicyChange_SIZE (FIELD_OFFSET(KernelThermalPolicyChange, Processors) + KernelThermalPolicyChange_Processors_SIZE) - -// ProcessorPerformance - ProcessorPerformance -#define ProcessorPerformanceGuid \ - { 0x7fd18652,0x0cfe,0x40d2, { 0xb0,0xa1,0x0b,0x06,0x6a,0x87,0x75,0x9e } } - -#if ! (defined(MIDL_PASS)) -DEFINE_GUID(ProcessorPerformance_GUID, \ - 0x7fd18652,0x0cfe,0x40d2,0xb0,0xa1,0x0b,0x06,0x6a,0x87,0x75,0x9e); -#endif - - -typedef struct _ProcessorPerformance -{ - // - ULONG frequency; - #define ProcessorPerformance_frequency_SIZE sizeof(ULONG) - #define ProcessorPerformance_frequency_ID 1 - - // - ULONG power; - #define ProcessorPerformance_power_SIZE sizeof(ULONG) - #define ProcessorPerformance_power_ID 2 - - // - ULONG percentage; - #define ProcessorPerformance_percentage_SIZE sizeof(ULONG) - #define ProcessorPerformance_percentage_ID 3 - -} ProcessorPerformance, *PProcessorPerformance; - -#define ProcessorPerformance_SIZE (FIELD_OFFSET(ProcessorPerformance, percentage) + ProcessorPerformance_percentage_SIZE) - -#endif - diff --git a/qt-correction-tool/pub/ddk/wmiguid.h b/qt-correction-tool/pub/ddk/wmiguid.h deleted file mode 100644 index e1da417..0000000 --- a/qt-correction-tool/pub/ddk/wmiguid.h +++ /dev/null @@ -1,312 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wmiguid.h - -Abstract: - - Defines GUIDs that represent data blocks that can be retrieved via WMI - ---*/ - -#include - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// This is WMI guid used to return disk performance information from -// diskperf.sys (see DISK_PERFORMANCE data structure) - -DEFINE_GUID (DiskPerfGuid, 0xBDD865D1,0xD7C1,0x11d0,0xA5,0x01,0x00,0xA0,0xC9,0x06,0x29,0x10); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// This guid will return additional information about a data provider -// {5494DFDC-A98A-11d1-BF43-00A0C9062910} -#define DATA_PROVIDER_INFO_GUID \ - {0x5494dfdc, 0xa98a, 0x11d1, 0xbf, 0x43, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10} - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// This wmi guid is used to return the entire SMBIOS data table -// {8F680850-A584-11d1-BF38-00A0C9062910} -#define SMBIOS_DATA_GUID \ - {0x8f680850, 0xa584, 0x11d1, 0xbf, 0x38, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10} - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// This wmi guid is used to return thermal information -// {A1BC18C0-A7C8-11d1-BF3C-00A0C9062910} -DEFINE_GUID(THERMAL_ZONE_GUID, \ - 0xa1bc18c0, 0xa7c8, 0x11d1, 0xbf, 0x3c, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// This wmi guid is used to return additional information about the provider -// of an instance name. Note that only QuerySingleInstance is supported. -// {C7BF35D0-AADB-11d1-BF4A-00A0C9062910} -#define INSTANCE_INFO_GUID \ - {0xc7bf35d0, 0xaadb, 0x11d1, 0xbf, 0x4a, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0x10} - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define BINARY_MOF_GUID \ - {0x05901221, 0xD566, 0x11d1, 0xB2, 0xF0, 0x00, 0xA0, 0xC9, 0x06, 0x29, 0x10} - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -#define ENUMERATE_GUIDS_GUID \ - {0xe3dff7bd, 0x3915, 0x11d2, 0x91, 0x03, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0xa2} - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// Global WMI Logger GUID -// - -DEFINE_GUID ( /* e8908abc-aa84-11d2-9a93-00805f85d7c6 */ - GlobalLoggerGuid, - 0xe8908abc, - 0xaa84, - 0x11d2, - 0x9a, 0x93, 0x00, 0x80, 0x5f, 0x85, 0xd7, 0xc6 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 8d40301f-ab4a-11d2-9a93-00805f85d7c6 */ - GenericMessageGuid, - 0x8d40301f, - 0xab4a, - 0x11d2, - 0x9a, 0x93, 0x00, 0x80, 0x5f, 0x85, 0xd7, 0xc6 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// Event Trace GUIDs -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 3d6fa8d0-fe05-11d0-9dda-00c04fd7ba7c */ - ProcessGuid, - 0x3d6fa8d0, - 0xfe05, - 0x11d0, - 0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 3d6fa8d1-fe05-11d0-9dda-00c04fd7ba7c */ - ThreadGuid, - 0x3d6fa8d1, - 0xfe05, - 0x11d0, - 0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 3d6fa8d3-fe05-11d0-9dda-00c04fd7ba7c */ - PageFaultGuid, - 0x3d6fa8d3, - 0xfe05, - 0x11d0, - 0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 3d6fa8d4-fe05-11d0-9dda-00c04fd7ba7c */ - DiskIoGuid, - 0x3d6fa8d4, - 0xfe05, - 0x11d0, - 0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 90cbdc39-4a3e-11d1-84f4-0000f80464e3 */ - FileIoGuid, - 0x90cbdc39, - 0x4a3e, - 0x11d1, - 0x84, 0xf4, 0x00, 0x00, 0xf8, 0x04, 0x64, 0xe3 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 9a280ac0-c8e0-11d1-84e2-00c04fb998a2 */ - TcpIpGuid, - 0x9a280ac0, - 0xc8e0, - 0x11d1, - 0x84, 0xe2, 0x00, 0xc0, 0x4f, 0xb9, 0x98, 0xa2 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* bf3a50c5-a9c9-4988-a005-2df0b7c80f80 */ - UdpIpGuid, - 0xbf3a50c5, - 0xa9c9, - 0x4988, - 0xa0, 0x05, 0x2d, 0xf0, 0xb7, 0xc8, 0x0f, 0x80 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 2cb15d1d-5fc1-11d2-abe1-00a0c911f518 */ - ImageLoadGuid, - 0x2cb15d1d, - 0x5fc1, - 0x11d2, - 0xab, 0xe1, 0x00, 0xa0, 0xc9, 0x11, 0xf5, 0x18 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* AE53722E-C863-11d2-8659-00C04FA321A1 */ - RegistryGuid, - 0xae53722e, - 0xc863, - 0x11d2, - 0x86, 0x59, 0x0, 0xc0, 0x4f, 0xa3, 0x21, 0xa1 -); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -// -// Special WMI events -// - -#if (NTDDI_VERSION >= NTDDI_WIN2K) - -DEFINE_GUID ( /* 398191dc-2da7-11d3-8b98-00805f85d7c6 */ - TraceErrorGuid, - 0x398191dc, - 0x2da7, - 0x11d3, - 0x8b, 0x98, 0x00, 0x80, 0x5f, 0x85, 0xd7, 0xc6 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) -#if ((NTDDI_VERSION >= NTDDI_WIN2K) && (NTDDI_VERSION < NTDDI_VISTA)) - -DEFINE_GUID ( /* 3d6fa8d2-fe05-11d0-9dda-00c04fd7ba7c */ /* Not used */ - HardFaultGuid, - 0x3d6fa8d2, - 0xfe05, - 0x11d0, - 0x9d, 0xda, 0x00, 0xc0, 0x4f, 0xd7, 0xba, 0x7c - ); - -#endif // ((NTDDI_VERSION >= NTDDI_WIN2K) && (NTDDI_VERSION < NTDDI_VISTA)) -#if (NTDDI_VERSION >= NTDDI_WINXP) - -DEFINE_GUID ( /* 44608a51-1851-4456-98b2-b300e931ee41 */ - WmiEventLoggerGuid, - 0x44608a51, - 0x1851, - 0x4456, - 0x98, 0xb2, 0xb3, 0x00, 0xe9, 0x31, 0xee, 0x41 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) -#if (NTDDI_VERSION >= NTDDI_WINXP) - -// -// This wmi guid is used to return the SMBIOS Identifer data -// {98A2B9D7-94DD-496a-847E-67A5557A59F2} -// -// MS_SystemInformation - MS_SystemInformation -#define MS_SYSTEM_INFORMATIONGUID \ - { 0x98a2b9d7,0x94dd,0x496a, { 0x84,0x7e,0x67,0xa5,0x55,0x7a,0x59,0xf2 } } - -DEFINE_GUID(MS_SYSTEM_INFORMATION_GUID, \ - 0x98a2b9d7,0x94dd,0x496a,0x84,0x7e,0x67,0xa5,0x55,0x7a,0x59,0xf2); - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) -#if (NTDDI_VERSION >= NTDDI_WINXP) - -DEFINE_GUID( /* 13976D09-A327-438c-950B-7F03192815C7 */ - DbgPrintGuid, - 0x13976d09, - 0xa327, - 0x438c, - 0x95, 0xb, 0x7f, 0x3, 0x19, 0x28, 0x15, 0xc7 - ); - -#endif // (NTDDI_VERSION >= NTDDI_WINXP) -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Event Log Logger GUID -// -DEFINE_GUID( /* b16f9f5e-bcda-4027-9318-adf2b79df73b */ - EventLogGuid, - 0xb16f9f5e, - 0xb3da, - 0x4027, - 0x93, 0x18, 0xad, 0xf2, 0xb7, 0x9d, 0xf7, 0x3b - ); - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Driver Verifier Events -// - -DEFINE_GUID ( /* D56CA431-61BF-4904-A621-00E0381E4DDE */ - DriverVerifierGuid, - 0xd56ca431, - 0x61bf, - 0x4904, - 0xa6, 0x21, 0x0, 0xe0, 0x38, 0x1e, 0x4d, 0xde - ); - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) -#if (NTDDI_VERSION >= NTDDI_VISTA) - -// -// Application Verifier Events -// - -DEFINE_GUID( /* 78d14f17-0105-46d7-bfff-6fbea2f3f358 */ - ApplicationVerifierGuid, - 0x78d14f17, - 0x0105, - 0x46d7, - 0xbf, 0xff, 0x6f, 0xbe, 0xa2, 0xf3, 0xf3, 0x58 - ); - -#endif // (NTDDI_VERSION >= NTDDI_VISTA) - diff --git a/qt-correction-tool/pub/ddk/wmilib.h b/qt-correction-tool/pub/ddk/wmilib.h deleted file mode 100644 index 1c24413..0000000 --- a/qt-correction-tool/pub/ddk/wmilib.h +++ /dev/null @@ -1,543 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation - -Module Name: - - wmilib.h - -Abstract: - - This module contains the internal structure definitions and APIs used by - the WMILIB helper functions - -Revision History: - ---*/ - -#ifndef _WMILIB_ -#define _WMILIB_ - -#if defined (_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -// -// This defines a guid to be registered with WMI. Memory for this structure -// may be Paged. -// - -typedef struct _WMIGUIDREGINFO { - LPCGUID Guid; // Guid to registered - ULONG InstanceCount; // Count of Instances of Datablock - ULONG Flags; // Additional flags (see WMIREGINFO in wmistr.h) -} WMIGUIDREGINFO, *PWMIGUIDREGINFO; - -typedef enum _WMIENABLEDISABLECONTROL { - WmiEventControl, // Enable or disable an event - WmiDataBlockControl // Enable or disable data block collection -} WMIENABLEDISABLECONTROL, *PWMIENABLEDISABLECONTROL; - -typedef enum _SYSCTL_IRP_DISPOSITION { - IrpProcessed, // Irp was processed and possibly completed - IrpNotCompleted, // Irp was process and NOT completed - IrpNotWmi, // Irp is not a WMI irp - IrpForward // Irp is wmi irp, but targeted at another device object -} SYSCTL_IRP_DISPOSITION, *PSYSCTL_IRP_DISPOSITION; - -__drv_functionClass(WMI_QUERY_REGINFO_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_QUERY_REGINFO_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PULONG RegFlags, - __inout PUNICODE_STRING InstanceName, - __deref_out_opt PUNICODE_STRING *RegistryPath, - __inout PUNICODE_STRING MofResourceName, - __deref_out_opt PDEVICE_OBJECT *Pdo - ); - -typedef WMI_QUERY_REGINFO_CALLBACK *PWMI_QUERY_REGINFO; - -/*++ - -Routine Description: - - This routine is a callback into the driver to retrieve information about - the guids being registered. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose registration information is needed - - *RegFlags returns with a set of flags that describe all of the guids being - registered for this device. If the device wants enable and disable - collection callbacks before receiving queries for the registered - guids then it should return the WMIREG_FLAG_EXPENSIVE flag. Also the - returned flags may specify WMIREG_FLAG_INSTANCE_PDO in which case - the instance name is determined from the PDO associated with the - device object. Note that the PDO must have an associated devnode. If - WMIREG_FLAG_INSTANCE_PDO is not set then Name must return a unique - name for the device. These flags are ORed into the flags specified - by the GUIDREGINFO for each guid. - - InstanceName returns with the instance name for the guids if - WMIREG_FLAG_INSTANCE_PDO is not set in the returned *RegFlags. The - caller will call ExFreePool with the buffer returned. - - *RegistryPath returns with the registry path of the driver. This is - required - - MofResourceName returns with the name of the MOF resource attached to - the binary file. If the driver does not have a mof resource attached - then this can be returned unmodified. If a value is returned then - it is NOT freed. - - *Pdo returns with the device object for the PDO associated with this - device if the WMIREG_FLAG_INSTANCE_PDO flag is retured in - *RegFlags. - -Return Value: - - status - ---*/ - -__drv_functionClass(WMI_QUERY_DATABLOCK_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_QUERY_DATABLOCK_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG InstanceCount, - __out_ecount_opt(InstanceCount) PULONG InstanceLengthArray, - __in ULONG BufferAvail, - __out_bcount_opt(BufferAvail) PUCHAR Buffer - ); - -typedef WMI_QUERY_DATABLOCK_CALLBACK *PWMI_QUERY_DATABLOCK; - -/*++ - -Routine Description: - - This routine is a callback into the driver to query for the contents of - one or more instances of a data block. When the driver has finished - filling the - data block it must call WmiCompleteRequest to complete the irp. The - driver can return STATUS_PENDING if the irp cannot be completed - immediately. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - InstanceIndex is the index that denotes which instance of the data block - is being queried. - - InstanceCount is the number of instances expected to be returned for - the data block. - - InstanceLengthArray is a pointer to an array of ULONG that returns the - lengths of each instance of the data block. If this is NULL then - there was not enough space in the output buffer to fufill the request - so the irp should be completed with the buffer needed. - - BufferAvail on entry has the maximum size available to write the data - blocks. - - Buffer on return is filled with the returned data blocks. Note that each - instance of the data block must be aligned on a 8 byte boundry. If - this is NULL then there was not enough space in the output buffer - to fufill the request so the irp should be completed with the buffer - needed. - - -Return Value: - - status - ---*/ - -__drv_functionClass(WMI_SET_DATABLOCK_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_SET_DATABLOCK_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); - -typedef WMI_SET_DATABLOCK_CALLBACK *PWMI_SET_DATABLOCK; - -/*++ - -Routine Description: - - This routine is a callback into the driver to query for the contents of - a data block. When the driver has finished filling the data block it - must call WmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - InstanceIndex is the index that denotes which instance of the data block - is being set. - - BufferSize has the size of the data block passed - - Buffer has the new values for the data block - - -Return Value: - - status - ---*/ - -__drv_functionClass(WMI_SET_DATAITEM_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_SET_DATAITEM_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG DataItemId, - __in ULONG BufferSize, - __in_bcount(BufferSize) PUCHAR Buffer - ); - -typedef WMI_SET_DATAITEM_CALLBACK *PWMI_SET_DATAITEM; - -/*++ - -Routine Description: - - This routine is a callback into the driver to query for the contents of - a data block. When the driver has finished filling the data block it - must call WmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - InstanceIndex is the index that denotes which instance of the data block - is being set. - - DataItemId has the id of the data item being set - - BufferSize has the size of the data item passed - - Buffer has the new values for the data item - - -Return Value: - - status - ---*/ - -__drv_functionClass(WMI_EXECUTE_METHOD_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_EXECUTE_METHOD_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in ULONG GuidIndex, - __in ULONG InstanceIndex, - __in ULONG MethodId, - __in ULONG InBufferSize, - __in ULONG OutBufferSize, - __inout_bcount(OutBufferSize) PUCHAR Buffer - ); - -typedef WMI_EXECUTE_METHOD_CALLBACK *PWMI_EXECUTE_METHOD; - -/*++ - -Routine Description: - - This routine is a callback into the driver to execute a method. When the - driver has finished filling the data block it must call - WmiCompleteRequest to complete the irp. The driver can - return STATUS_PENDING if the irp cannot be completed immediately. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose data block is being queried - - Irp is the Irp that makes this request - - GuidIndex is the index into the list of guids provided when the - device registered - - InstanceIndex is the index that denotes which instance of the data block - is being called. - - MethodId has the id of the method being called - - InBufferSize has the size of the data block passed in as the input to - the method. - - OutBufferSize on entry has the maximum size available to write the - returned data block. - - Buffer on entry has the input data block and on return has the output - output data block. - - -Return Value: - - status - ---*/ - -__drv_functionClass(WMI_FUNCTION_CONTROL_CALLBACK) -__drv_sameIRQL -__checkReturn -typedef -NTSTATUS -WMI_FUNCTION_CONTROL_CALLBACK ( - __inout PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in ULONG GuidIndex, - __in WMIENABLEDISABLECONTROL Function, - __in BOOLEAN Enable - ); - -typedef WMI_FUNCTION_CONTROL_CALLBACK *PWMI_FUNCTION_CONTROL; - -/*++ - -Routine Description: - - This routine is a callback into the driver to enabled or disable event - generation or data block collection. A device should only expect a - single enable when the first event or data consumer enables events or - data collection and a single disable when the last event or data - consumer disables events or data collection. Data blocks will only - receive collection enable/disable if they were registered as requiring - it. - - Implementations of this routine may be in paged memory - -Arguments: - - DeviceObject is the device whose data block is being queried - - GuidIndex is the index into the list of guids provided when the - device registered - - Function specifies which functionality is being enabled or disabled - - Enable is TRUE then the function is being enabled else disabled - -Return Value: - - status - ---*/ - -// -// This structure supplies context information for WMILIB to process the -// WMI irps. Memory for this structure may be paged. -// - -typedef struct _WMILIB_CONTEXT { - - // - // WMI data block guid registration info - // - - ULONG GuidCount; - __field_ecount(GuidCount) PWMIGUIDREGINFO GuidList; - - // - // WMI functionality callbacks - // - - PWMI_QUERY_REGINFO QueryWmiRegInfo; - PWMI_QUERY_DATABLOCK QueryWmiDataBlock; - PWMI_SET_DATABLOCK SetWmiDataBlock; - PWMI_SET_DATAITEM SetWmiDataItem; - PWMI_EXECUTE_METHOD ExecuteWmiMethod; - PWMI_FUNCTION_CONTROL WmiFunctionControl; -} WMILIB_CONTEXT, *PWMILIB_CONTEXT; - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__checkReturn -NTSTATUS -WmiCompleteRequest ( - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __in NTSTATUS Status, - __in ULONG BufferUsed, - __in CCHAR PriorityBoost - ); - -/*++ - -Routine Description: - - - This routine will do the work of completing a WMI irp. Depending upon the - the WMI request this routine will fixup the returned WNODE appropriately. - - This may be called at DPC level -Arguments: - - DeviceObject - Supplies a pointer to the device object for this request. - - Irp - Supplies the Irp making the request. - - Status has the return status code for the IRP - - BufferUsed has the number of bytes needed by the device to return the - data requested in any query. In the case that the buffer passed to - the device is too small this has the number of bytes needed for the - return data. If the buffer passed is large enough then this has the - number of bytes actually used by the device. - - PriorityBoost is the value used for the IoCompleteRequest call. - -Return Value: - - status - ---*/ -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(PASSIVE_LEVEL) -__success(TRUE) -NTSTATUS -WmiSystemControl ( - __in PWMILIB_CONTEXT WmiLibInfo, - __in PDEVICE_OBJECT DeviceObject, - __inout PIRP Irp, - __out __deref __checkReturn PSYSCTL_IRP_DISPOSITION IrpDisposition - ); - -/*++ - -Routine Description: - - Dispatch helper routine for IRP_MJ_SYSTEM_CONTROL. This routine will - determine if the irp passed contains a WMI request and if so process it - by invoking the appropriate callback in the WMILIB structure. - - This routine may only be called at passive level - -Arguments: - - WmiLibInfo has the WMI information control block - - DeviceObject - Supplies a pointer to the device object for this request. - - Irp - Supplies the Irp making the request. - - IrpDisposition - Returns a value that specifies how the irp was handled. - -Return Value: - - status - ---*/ -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -#if (NTDDI_VERSION >= NTDDI_WIN2K) -__drv_maxIRQL(DISPATCH_LEVEL) -__success(TRUE) -NTSTATUS -WmiFireEvent ( - __in PDEVICE_OBJECT DeviceObject, - __in LPCGUID Guid, - __in ULONG InstanceIndex, - __in ULONG EventDataSize, - __in_bcount_opt(EventDataSize) __drv_in(__drv_freesMem(Mem)) PVOID EventData - ); - -/*++ - -Routine Description: - - This routine will fire a WMI event using the data buffer passed. This - routine may be called at or below DPC level - -Arguments: - - DeviceObject - Supplies a pointer to the device object for this event - - Guid is pointer to the GUID that represents the event - - InstanceIndex is the index of the instance of the event - - EventDataSize is the number of bytes of data that is being fired with - with the event - - EventData is the data that is fired with the events. This may be NULL - if there is no data associated with the event - -Return Value: - - status - ---*/ -#endif // (NTDDI_VERSION >= NTDDI_WIN2K) - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/qt-correction-tool/pub/ddk/ws2san.h b/qt-correction-tool/pub/ddk/ws2san.h deleted file mode 100644 index afa0c3a..0000000 --- a/qt-correction-tool/pub/ddk/ws2san.h +++ /dev/null @@ -1,303 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - ws2san.h - -Abstract: - - This module contains the Microsoft-specific extensions to the Windows - Sockets SPI for WinSock Direct (SAN) support. - -Revision History: - ---*/ - -#ifndef _WS2SAN_H_ -#define _WS2SAN_H_ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Option for getting maximum RDMA transfer size supported by provider - */ -#define SO_MAX_RDMA_SIZE 0x700D - -/* - * Option for getting minimum RDMA transfer size feasible (performance-wise) - * for the provider - */ -#define SO_RDMA_THRESHOLD_SIZE 0x700E - -/* - * The upcall table. This structure is passed by value to the service - * provider's WSPStartup() entrypoint. - */ - -typedef struct _WSPUPCALLTABLEEX { - - LPWPUCLOSEEVENT lpWPUCloseEvent; - LPWPUCLOSESOCKETHANDLE lpWPUCloseSocketHandle; - LPWPUCREATEEVENT lpWPUCreateEvent; - LPWPUCREATESOCKETHANDLE lpWPUCreateSocketHandle; - LPWPUFDISSET lpWPUFDIsSet; - LPWPUGETPROVIDERPATH lpWPUGetProviderPath; - LPWPUMODIFYIFSHANDLE lpWPUModifyIFSHandle; - LPWPUPOSTMESSAGE lpWPUPostMessage; - LPWPUQUERYBLOCKINGCALLBACK lpWPUQueryBlockingCallback; - LPWPUQUERYSOCKETHANDLECONTEXT lpWPUQuerySocketHandleContext; - LPWPUQUEUEAPC lpWPUQueueApc; - LPWPURESETEVENT lpWPUResetEvent; - LPWPUSETEVENT lpWPUSetEvent; - LPWPUOPENCURRENTTHREAD lpWPUOpenCurrentThread; - LPWPUCLOSETHREAD lpWPUCloseThread; - LPWPUCOMPLETEOVERLAPPEDREQUEST lpWPUCompleteOverlappedRequest; - -} WSPUPCALLTABLEEX, FAR * LPWSPUPCALLTABLEEX; - -/* - * An extended WSABUF, that includes a registration handle - */ - -typedef struct _WSABUFEX { - u_long len; /* the length of the buffer */ - __field_bcount(len) char FAR * buf; /* the pointer to the buffer */ - HANDLE handle; /* The handle returned by WSPRegisterMemory */ -} WSABUFEX, FAR * LPWSABUFEX; - - -/* - * WinSock 2 SPI socket function prototypes - */ - -__checkReturn -int -WSPAPI -WSPStartupEx( - __in WORD wVersionRequested, - __out LPWSPDATA lpWSPData, - __in LPWSAPROTOCOL_INFOW lpProtocolInfo, - __in LPWSPUPCALLTABLEEX lpUpcallTable, - __out LPWSPPROC_TABLE lpProcTable - ); - -typedef -__checkReturn -int -(WSPAPI * LPWSPSTARTUPEX)( - __in WORD wVersionRequested, - __out LPWSPDATA lpWSPData, - __in LPWSAPROTOCOL_INFOW lpProtocolInfo, - __in LPWSPUPCALLTABLEEX lpUpcallTable, - __out LPWSPPROC_TABLE lpProcTable - ); - -#define WSAID_REGISTERMEMORY \ - {0xC0B422F5,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#define WSAID_DEREGISTERMEMORY \ - {0xC0B422F6,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#define WSAID_REGISTERRDMAMEMORY \ - {0xC0B422F7,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#define WSAID_DEREGISTERRDMAMEMORY \ - {0xC0B422F8,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#define WSAID_RDMAWRITE \ - {0xC0B422F9,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#define WSAID_RDMAREAD \ - {0xC0B422FA,0xF58C,0x11d1,{0xAD,0x6C,0x00,0xC0,0x4F,0xA3,0x4A,0x2D}} - -#if(_WIN32_WINNT >= 0x0501) -#define WSAID_MEMORYREGISTRATIONCACHECALLBACK \ - {0xE5DA4AF8,0xD824,0x48CD,{0xA7,0x99,0x63,0x37,0xA9,0x8E,0xD2,0xAF}} -#endif //(_WIN32_WINNT >= 0x0501) - -#define MEM_READ 1 -#define MEM_WRITE 2 -#define MEM_READWRITE 3 - - -__checkReturn -HANDLE WSPAPI -WSPRegisterMemory( - __in SOCKET s, - __in_bcount(dwBufferLength) PVOID lpBuffer, - __in DWORD dwBufferLength, - __in DWORD dwFlags, - __out LPINT lpErrno - ); - -int WSPAPI -WSPDeregisterMemory( - __in SOCKET s, - __in HANDLE handle, - __out LPINT lpErrno - ); - -__checkReturn -int WSPAPI -WSPRegisterRdmaMemory( - __in SOCKET s, - __in_bcount(dwBufferLength) PVOID lpBuffer, - __in DWORD dwBufferLength, - __in DWORD dwFlags, - __out_bcount(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor, - __inout LPDWORD lpdwDescriptorLength, - __out LPINT lpErrno - ); - -int WSPAPI -WSPDeregisterRdmaMemory( - __in SOCKET s, - __in_bcount(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, - __in DWORD dwDescriptorLength, - __out LPINT lpErrno - ); - -int WSPAPI -WSPRdmaWrite( - __in SOCKET s, - __in_ecount(dwBufferCount) LPWSABUFEX lpBuffers, - __in DWORD dwBufferCount, - __in_bcount(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, - __in DWORD dwTargetDescriptorLength, - __in DWORD dwTargetBufferOffset, - __out LPDWORD lpdwNumberOfBytesWritten, - __in DWORD dwFlags, - __in_opt LPWSAOVERLAPPED lpOverlapped, - __in_opt LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, - __in LPWSATHREADID lpThreadId, - __out LPINT lpErrno - ); - -int WSPAPI -WSPRdmaRead( - __in SOCKET s, - __in_ecount(dwBufferCount) LPWSABUFEX lpBuffers, - __in DWORD dwBufferCount, - __in_bcount(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, - __in DWORD dwTargetDescriptorLength, - __in DWORD dwTargetBufferOffset, - __out LPDWORD lpdwNumberOfBytesRead, - __in DWORD dwFlags, - __in_opt LPWSAOVERLAPPED lpOverlapped, - __in_opt LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, - __in LPWSATHREADID lpThreadId, - __out LPINT lpErrno - ); - -#if(_WIN32_WINNT >= 0x0501) -__checkReturn -int WSPAPI -WSPMemoryRegistrationCacheCallback( - __in_bcount(Size) LPVOID lpvAddress, - __in SIZE_T Size, - __out LPINT lpErrno - ); -#endif //(_WIN32_WINNT >= 0x0501) - -/* - * "QueryInterface" versions of the above APIs. - */ - -typedef -__checkReturn -HANDLE -(WSPAPI * LPFN_WSPREGISTERMEMORY)( - __in SOCKET s, - __in_bcount(dwBufferLength) PVOID lpBuffer, - __in DWORD dwBufferLength, - __in DWORD dwFlags, - __out LPINT lpErrno - ); - -typedef -int -(WSPAPI * LPFN_WSPDEREGISTERMEMORY)( - __in SOCKET s, - __in HANDLE handle, - __out LPINT lpErrno - ); - -typedef -__checkReturn -BOOL -(WSPAPI * LPFN_WSPREGISTERRDMAMEMORY)( - __in SOCKET s, - __in_bcount(dwBufferLength) PVOID lpBuffer, - __in DWORD dwBufferLength, - __in DWORD dwFlags, - __out_bcount(*lpdwDescriptorLength) LPVOID lpRdmaBufferDescriptor, - __inout LPDWORD lpdwDescriptorLength, - __out LPINT lpErrno - ); - -typedef -int -(WSPAPI * LPFN_WSPDEREGISTERRDMAMEMORY)( - __in SOCKET s, - __in_bcount(dwDescriptorLength) LPVOID lpRdmaBufferDescriptor, - __in DWORD dwDescriptorLength, - __out LPINT lpErrno - ); - -typedef -int -(WSPAPI * LPFN_WSPRDMAWRITE)( - __in SOCKET s, - __in_ecount(dwBufferCount) LPWSABUFEX lpBuffers, - __in DWORD dwBufferCount, - __in_bcount(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, - __in DWORD dwTargetDescriptorLength, - __in DWORD dwTargetBufferOffset, - __out LPDWORD lpdwNumberOfBytesWritten, - __in DWORD dwFlags, - __in_opt LPWSAOVERLAPPED lpOverlapped, - __in_opt LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, - __in LPWSATHREADID lpThreadId, - __out LPINT lpErrno - ); - -typedef -int -(WSPAPI * LPFN_WSPRDMAREAD)( - __in SOCKET s, - __in_ecount(dwBufferCount) LPWSABUFEX lpBuffers, - __in DWORD dwBufferCount, - __in_bcount(dwTargetDescriptorLength) LPVOID lpTargetBufferDescriptor, - __in DWORD dwTargetDescriptorLength, - __in DWORD dwTargetBufferOffset, - __out LPDWORD lpdwNumberOfBytesRead, - __in DWORD dwFlags, - __in_opt LPWSAOVERLAPPED lpOverlapped, - __in_opt LPWSAOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine, - __in LPWSATHREADID lpThreadId, - __out LPINT lpErrno - ); - -#if(_WIN32_WINNT >= 0x0501) -typedef -__checkReturn -int -(WSPAPI * LPFN_WSPMEMORYREGISTRATIONCACHECALLBACK)( - __in_bcount(Size) LPVOID lpvAddress, - __in SIZE_T Size, - __out LPINT lpErrno - ); -#endif //(_WIN32_WINNT >= 0x0501) - -#ifdef __cplusplus -} -#endif - -#endif // _WS2SAN_H_ - diff --git a/qt-correction-tool/pub/ddk/wsk.h b/qt-correction-tool/pub/ddk/wsk.h deleted file mode 100644 index d6fd9be..0000000 --- a/qt-correction-tool/pub/ddk/wsk.h +++ /dev/null @@ -1,1589 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - wsk.h - -Abstract: - - This module contains the definitions and structures for - the Windows Sockets Kernel-Mode Interface. - -Environment: - - Kernel-Mode only - ---*/ - -#ifndef _WSK_ -#define _WSK_ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -// -// Socket object. -// -// 'Dispatch' can be one of 4 types depending on the socket type: -// PWSK_PROVIDER_BASIC_DISPATCH, PWSK_PROVIDER_LISTEN_DISPATCH, -// PWSK_PROVIDER_DATAGRAM_DISPATCH, PWSK_PROVIDER_CONNECTION_DISPATCH -// - -typedef struct _WSK_SOCKET { - CONST VOID *Dispatch; -} WSK_SOCKET, *PWSK_SOCKET; - -// -// Client object -// -typedef PVOID PWSK_CLIENT; - -// -// WSK API calling convention -// -#define WSKAPI NTAPI - -// -// WSK Interface ID -// -extern CONST NPIID NPI_WSK_INTERFACE_ID; - -// -// WSK client must use the following macro to initialize the Version field -// in its WSK_CLIENT_DISPATCH structure. -// -#define MAKE_WSK_VERSION(Mj, Mn) ((USHORT)((Mj) << 8) | (USHORT)((Mn) & 0xff)) - -// -// WSK client must use the following macros to extract the Major and Minor -// version numbers from the HighestVersion and LowestVersion fields of the -// WSK_PROVIDER_CHARACTERISTICS structure, and the Version field of the -// WSK_PROVIDER_DISPATCH structure. -// -#define WSK_MAJOR_VERSION(V) ((UCHAR)((V) >> 8)) -#define WSK_MINOR_VERSION(V) ((UCHAR)(V)) - -// -// WSK Provider characteristics determine the range of versions of the WSK -// interface supported by the WSK provider -// - -typedef struct _WSK_PROVIDER_CHARACTERISTICS { - USHORT HighestVersion; - USHORT LowestVersion; -} WSK_PROVIDER_CHARACTERISTICS, *PWSK_PROVIDER_CHARACTERISTICS; - -// -// Transport information structure -// - -typedef struct _WSK_TRANSPORT { - USHORT Version; // Version of the transport - USHORT SocketType; - ULONG Protocol; - ADDRESS_FAMILY AddressFamily; - GUID ProviderId; -} WSK_TRANSPORT, *PWSK_TRANSPORT; - -// -// Buffer structure used for sending/receiving data. -// Mdl points to a chain of memory descriptors (scatter/gather list). -// The data described begin at 'Offset' and extend for 'Length' bytes. -// N.B. 'Offset' is required to lie entirely within the first MDL in -// the chain. -// - -typedef struct _WSK_BUF { - PMDL Mdl; // Locked MDL chain - ULONG Offset; // Offset into the "first" Mdl in the chain - SIZE_T Length; // Length of data starting from Offset -} WSK_BUF, *PWSK_BUF; - -// -// Data Indication structure used for indicating incoming data buffers -// on connection-oriented sockets. -// - -typedef struct _WSK_DATA_INDICATION { - struct _WSK_DATA_INDICATION *Next; - WSK_BUF Buffer; -} WSK_DATA_INDICATION, *PWSK_DATA_INDICATION; - -// -// Datagram Indication structure used for indicating incoming datagrams -// on datagram sockets. -// - -typedef struct _WSK_DATAGRAM_INDICATION { - struct _WSK_DATAGRAM_INDICATION *Next; - WSK_BUF Buffer; - __field_bcount(ControlInfoLength) PCMSGHDR ControlInfo; - ULONG ControlInfoLength; - PSOCKADDR RemoteAddress; -} WSK_DATAGRAM_INDICATION, *PWSK_DATAGRAM_INDICATION; - -// -// Identification structure used for conditional-accept. -// - -typedef struct _WSK_INSPECT_ID { - ULONG_PTR Key; - ULONG SerialNumber; -} WSK_INSPECT_ID, *PWSK_INSPECT_ID; - -// -// Actions that can be taken for connect request inspection -// on a conditional-accept listening socket. -// - -typedef enum { - WskInspectReject, // reject the connection request - WskInspectAccept, // proceed with accept - WskInspectPend, // delay the decision (use WskInspectComplete later) - WskInspectMax -} WSK_INSPECT_ACTION, *PWSK_INSPECT_ACTION; - -// -// Flag used by some callback routines to indicate that the callback was -// invoked at DISPATCH_LEVEL IRQL. -// - -#define WSK_FLAG_AT_DISPATCH_LEVEL 0x00000008 - -// -// Event indication callbacks -// -// Event indications are delivered in arbitrary thread context. -// - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_CLIENT_EVENT) ( - __in_opt PVOID ClientContext, - __in ULONG EventType, - __in_bcount_opt(InformationLength) PVOID Information, - __in SIZE_T InformationLength - ); -/* - * Indicates client-specific control event. - * - * Parameters: - * ClientContext - ClientContext value that was passed to WskRegister - * EventType - No event types are currently defined. - * Information - Optional event specific information. - * InformationLength - Length of information. - * Returns: - * STATUS_SUCCESS unless otherwise is specified by specific EventTypes. - */ - -typedef -__checkReturn -NTSTATUS -(WSKAPI * PFN_WSK_RECEIVE_FROM_EVENT) ( - __in_opt PVOID SocketContext, - __in ULONG Flags, - __in_opt PWSK_DATAGRAM_INDICATION DataIndication - ); -/* - * Indicates that one or more datagrams have arrived on one of the datagram - * socket objects created by the client - * - * Parameters: - * SocketContext - Context value associated with the socket on which - * datagram(s) were received. - * Flags - MSG_BCAST, MSG_MCAST, WSK_FLAG_AT_DISPATCH_LEVEL - * DataIndication - List of one or more datagrams. - * NULL denotes that socket needs to be closed. - * Returns: - * STATUS_SUCCESS - Datagram(s) were consumed and further indication should be - * made when new datagrams arrive. - * STATUS_PENDING - Datagram(s) were retained by the client and the data must - * remain valid until released by the client. Further indication should be - * made when new datagrams arrive. - * STATUS_DATA_NOT_ACCEPTED - Datagram(s) could not be processed and should be - * buffered by the transport if possible or required by the - * protocol. No further indication should be made until - * message indication callbacks are specifically re-enabled. - */ - -// -// Forward declaration for connected socket callback table -// -typedef struct _WSK_CLIENT_CONNECTION_DISPATCH - WSK_CLIENT_CONNECTION_DISPATCH, *PWSK_CLIENT_CONNECTION_DISPATCH; - -typedef -__checkReturn -__drv_arg(AcceptSocket, __drv_aliasesMem) -NTSTATUS -(WSKAPI * PFN_WSK_ACCEPT_EVENT) ( - __in_opt PVOID SocketContext, - __in ULONG Flags, - __in PSOCKADDR LocalAddress, - __in PSOCKADDR RemoteAddress, - __in_opt PWSK_SOCKET AcceptSocket, - __deref_out_opt PVOID *AcceptSocketContext, - __deref_out_opt CONST WSK_CLIENT_CONNECTION_DISPATCH **AcceptSocketDispatch - ); -/* - * Indicates that a connection request has arrived on one of the listening - * sockets created by the client. Note that when this callback is made, - * connection setup handshake with the remote party have already taken place. - * - * Parameters: - * SocketContext - Context value associated with the listening socket - * on which connection request has been received. - * Flags - WSK_FLAG_AT_DISPATCH_LEVEL - * LocalAddress - Local transport address this connection request arrived on. - * Useful if the listening socket is bound to the wildcard address. - * RemoteAddress - Transport address of the remote party. - * AcceptSocket - New connected socket object that represent the connection. - * NULL denotes that listening socket must be closed. - * AcceptSocketContext - OUT parameter through which the client passes the - * SocketContext for the new socket to WSK. WSK client must initialize - * this parameter before enabling event callbacks via - * SO_WSK_EVENT_CALLBACK option. - * AcceptSocketDispatch - OUT parameter through which the client passes the - * callback routines for the new socket to WSK. WSK client must - * initialize this parameter before enabling callbacks via - * SO_WSK_EVENT_CALLBACK option. - * Returns: - * STATUS_SUCCESS - Client accepted the connection. - * STATUS_REQUEST_NOT_ACCEPTED - Client rejected the connection. WSK provider - * will close the socket. Client should not touch the socket any more. - */ - -typedef -__checkReturn -WSK_INSPECT_ACTION -(WSKAPI * PFN_WSK_INSPECT_EVENT) ( - __in_opt PVOID SocketContext, - __in PSOCKADDR LocalAddress, - __in PSOCKADDR RemoteAddress, - __in_opt PWSK_INSPECT_ID InspectID - ); -/* - * Indicates that a connection request has arrived on a conditional-accept - * listening socket. This callback is used only for conditional-accept sockets. - * This indication allows the client to decide if it wants to proceed with - * regular connection acceptance before any actual connection setup handshake - * with the remote party takes place. If the client decides to proceed with - * regular acceptance than the WskAcceptEvent callback will be invoked later - * if/when the connectin setup handshake with the remote party is performed - * successfully. - * - * Parameters: - * SocketContext - Context value associated with the listening socket - * on which connection request has been received. - * LocalAddress - Local transport address this connection request arrived on. - * Useful if the listening socket is bound to the wildcard address. - * RemoteAddress - Transport address of the remote party. - * InspectID - Pointer to the inspect ID structure. The connection request - * is identified via the contents of this structure (NOT via the - * pointer to the structure) until the WskAcceptEvent callback - * happens. If the client wants to preserve the inspect ID then it - * needs to copy this structure to its own memory before returning - * from this callback. - * NULL InspectID denotes that listening socket is to be closed. - * Returns: - * WskInspectReject - Reject the connection request immediately. Neither - * WskAcceptEvent nor WskAbortEvent will be invoked. - * WskInspectAccept - Proceed with regular acceptance. WskAcceptEvent - * or WskAbortEvent may be invoked. - * WskInspectPend - Delay the decision. Client may invoke WskInspectComplete later to - * convey its decision. WskAbortEvent may be invoked in - * the meantime. - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_ABORT_EVENT) ( - __in_opt PVOID SocketContext, - __in PWSK_INSPECT_ID InspectID - ); -/* - * Indicates that a previous connection request indicated by WskInspectEvent - * callback is dropped. This callback is used only for conditional-accept - * sockets. - * - * Parameters: - * SocketContext - Context value associated with the listening socket - * on which connection request was received. - * InspectID - Pointer to the inspect ID structure. The connection request - * is identified via the contents of this structure (NOT via the - * pointer to the structure.) If the client wants to preserve the - * inspect ID then it needs to copy this sturcture to its own - * memory before returning from this callback. - * Returns: - * STATUS_SUCCESS - This is the only allowed return value. - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_SEND_BACKLOG_EVENT) ( - __in_opt PVOID SocketContext, - __in SIZE_T IdealBacklogSize - ); -/* - * Indicates that the ideal send backlog size has changed for the connection. - * The ideal send backlog size denotes the optimal amount of send data that - * needs to be kept outstanding (passed to the WSK provider, but not completed - * by the WSK provider yet) in order to keep the data pipe full at all times. - * - * Parameters: - * SocketContext - Context value associated with the socket object. - * IdealBacklogSize - Ideal send backlog size - * Returns: - * STATUS_SUCCESS - This is the only allowed return value. - */ - -// -// Flag that denotes that the indicated buffers should NOT be -// retained by the client indefinitely. The client should -// avoid retaining such buffers, but if it does retain, then -// it has to release them ASAP. -// - -#define WSK_FLAG_RELEASE_ASAP 0x00000002 - -#define WSK_FLAG_ENTIRE_MESSAGE 0x00000004 - -typedef -__checkReturn -NTSTATUS -(WSKAPI * PFN_WSK_RECEIVE_EVENT) ( - __in_opt PVOID SocketContext, - __in ULONG Flags, - __in_opt PWSK_DATA_INDICATION DataIndication, - __in SIZE_T BytesIndicated, - __inout SIZE_T *BytesAccepted - ); -/* - * Indicates that data has arrived on one of the connected socket objects - * created by the client - * - * Parameters: - * SocketContext - Context value associated with the socket object on which - * data was received. - * Flags - WSK_FLAG_RELEASE_ASAP, WSK_FLAG_ENTIRE_MESSAGE, - * WSK_FLAG_AT_DISPATCH_LEVEL - * DataIndication - List of one or more data buffers - * NULL denotes that socket needs to be closed. - * BytesIndicated - Total number of bytes being indicated. - * BytesAccepted - Number of bytes client accepted. Client needs to set this - * OUT parameter only if it wishes to accept a data indication partially. - * This OUT parameter is ignored if client returns STATUS_DATA_NOT_ACCEPTED - * or STATUS_PENDING. The parameter is meaningful only when client returns - * STATUS_SUCCESS. If the client wants to fully accept the indicated buffers - * then it does NOT have to set this parameter, i.e. returning STATUS_SUCCESS - * without touching this parameter means full acceptance. - * Returns: - * STATUS_SUCCESS - Data buffer(s) were fully or partially consumed. If - * indication was fully consumed, further indication should be made when - * more data arrives. If indication was partially consumed, i.e. client - * sets the BytesAccepted parameter to a number smaller than BytesIndicated, - * then no further indications will be made until the client posts a - * WskReceive request and it gets completed. - * STATUS_PENDING - Data buffer(s) were retained by the client and the data - * must remain valid until released. Further indications should be made - * when more data arrives. - * STATUS_DATA_NOT_ACCEPTED - Data buffer(s) could not be processed and should - * be buffered by the transport if possible or required by the protocol. - * No further indications will be made until the client posts a WskReceive - * request and it gets completed. - */ - -// -// Flags for indicating abortive/graceful connection teardown -// - -#define WSK_FLAG_ABORTIVE 0x00000001 - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_DISCONNECT_EVENT) ( - __in_opt PVOID SocketContext, - __in ULONG Flags - ); -/* - * Indicates that peer of the connection has initiated disconnect sequence. - * - * Parameters: - * SocketContext - Context associated with the connected socket object. - * Flags - indicates whether disconnect is graceful or abortive (if the - * WSK_FLAG_ABORTIVE flag is set, it's abortive, otherwise it's graceful.) - * WSK_FLAG_AT_DISPATCH_LEVEL - * Returns: - * STATUS_SUCCESS - This is the only allowed return value. - */ - -// -// Flags denoting WSK socket types -// - -#define WSK_FLAG_BASIC_SOCKET 0x00000000 -#define WSK_FLAG_LISTEN_SOCKET 0x00000001 -#define WSK_FLAG_CONNECTION_SOCKET 0x00000002 -#define WSK_FLAG_DATAGRAM_SOCKET 0x00000004 - -typedef -__drv_arg(Irp->IoStatus.Information, __drv_allocatesMem(Mem)) -NTSTATUS -(WSKAPI * PFN_WSK_SOCKET) ( - __in PWSK_CLIENT Client, - __in ADDRESS_FAMILY AddressFamily, - __in USHORT SocketType, - __in ULONG Protocol, - __in ULONG Flags, - __in_opt PVOID SocketContext, - __in_opt CONST VOID *Dispatch, - __in_opt PEPROCESS OwningProcess, - __in_opt PETHREAD OwningThread, - __in_opt PSECURITY_DESCRIPTOR SecurityDescriptor, - __inout PIRP Irp - ); -/* - * Creates socket object - * - * Parameters: - * - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * AddressFamily - address family, e.g. AF_INET, AF_INET6 - * SocketType - socket type, e.g. SOCK_STREAM, SOCK_DGRAM - * Protocol - protocol, e.g. IPPROTO_TCP, IPPROTO_UDP - * Flags - WSK_FLAG_LISTEN_SOCKET - This socket will be used for listening for - * incoming connection requests. - * WSK_FLAG_CONNECTION_SOCKET - This socket will be for connecting - * to a remote party. - * WSK_FLAG_DATAGRAM_SOCKET - This socket will be used for sending and - * receiving datagrams. - * WSK_FLAG_BASIC_SOCKET - This socket will be used for basic control - * operations. - * SocketContext - Context value to pass in event callbacks - * Dispatch - pointer to a constant structure that contains pointers to - * callback routines. OPTIONAL if client won't be enabling callbacks. - * Client must provide the right callback table based on socket type: - * WSK_CLIENT_LISTEN_DISPATCH for WSK_FLAG_LISTEN_SOCKET, - * WSK_CLIENT_CONNECTION_DISPATCH for WSK_FLAG_CONNECTION_SOCKET, - * WSK_CLIENT_DATAGRAM_DISPATCH for WSK_FLAG_DATAGRAM_SOCKET, - * NULL for WSK_FLAG_BASIC_SOCKET. - * OwningProcess - The process to retrieve the security context from. If this - * is set to NULL then the current process is assumed. This is - * used for implementing transport address security during bind. - * OwningThread - The thread to retrieve the security context from. This is - * useful only if an impersonation token is in effect and used - * for implementing transport address security during bind. - * SecurityDescriptor - Optional security descriptor to protect the transport - * address that this socket will be bound to. Only the - * security descriptors obtained from the NT object - * manager's security descriptor cache can be specified. - * Irp - IRP for async completion of the request - * - * Returns: - * - * If the request is completed succesfully, the Irp.IoStatus.Information - * field will be holding a pointer to the new socket (PWSK_SOCKET) - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -__drv_arg(Irp->IoStatus.Information, __drv_allocatesMem(Mem)) -NTSTATUS -(WSKAPI * PFN_WSK_SOCKET_CONNECT) ( - __in PWSK_CLIENT Client, - __in USHORT SocketType, - __in ULONG Protocol, - __in PSOCKADDR LocalAddress, - __in PSOCKADDR RemoteAddress, - __reserved ULONG Flags, - __in_opt PVOID SocketContext, - __in_opt CONST WSK_CLIENT_CONNECTION_DISPATCH *Dispatch, - __in_opt PEPROCESS OwningProcess, - __in_opt PETHREAD OwningThread, - __in_opt PSECURITY_DESCRIPTOR SecurityDescriptor, - __inout PIRP Irp - ); -/* - * Creates, binds, and connects a socket object. - * - * Parameters: - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * SocketType - socket type, e.g. SOCK_STREAM - * Protocol - protocol, e.g. IPPROTO_TCP - * LocalAddress - Local address to bind the socket to. - * RemoteAddress - Remote address to connect to. - * Flags - Reserved. (Must be 0) - * SocketContext - Context value to pass in event callbacks - * Dispatch - pointer to a constant structure that contains pointers to - * callback routines. OPTIONAL if client won't be enabling callbacks. - * OwningProcess - The process to retrieve the security context from. If this - * is set to NULL then the current process is assumed. This is - * used for implementing transport address security during bind. - * OwningThread - The thread to retrieve the security context from. This is - * useful only if an impersonation token is in effect and used - * for implementing transport address security during bind. - * SecurityDescriptor - Optional security descriptor to protect the transport - * address that this socket will be bound to. Only the - * security descriptors obtained from the NT object - * manager's security descriptor cache can be specified. - * Irp - IRP for async completion of the request - * - * Returns: - * - * If the request is completed succesfully, the Irp.IoStatus.Information - * field will be holding a pointer to the new socket (PWSK_SOCKET) - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -// -// Client Level Control Codes -// - -#define WSK_TRANSPORT_LIST_QUERY 2 -#define WSK_TRANSPORT_LIST_CHANGE 3 -#define WSK_CACHE_SD 4 -#define WSK_RELEASE_SD 5 -#define WSK_TDI_DEVICENAME_MAPPING 6 -#define WSK_SET_STATIC_EVENT_CALLBACKS 7 -#define WSK_TDI_BEHAVIOR 8 - -// -// Structures used with WSK_TDI_DEVICENAME_MAPPING control request -// - -typedef struct _WSK_TDI_MAP { - USHORT SocketType; - ADDRESS_FAMILY AddressFamily; - ULONG Protocol; - PCWSTR TdiDeviceName; -} WSK_TDI_MAP, *PWSK_TDI_MAP; - -typedef struct _WSK_TDI_MAP_INFO { - CONST ULONG ElementCount; - __field_ecount(ElementCount) CONST WSK_TDI_MAP *Map; -} WSK_TDI_MAP_INFO, *PWSK_TDI_MAP_INFO; - -// -// Flag used with WSK_TDI_BEHAVIOR control request -// -#define WSK_TDI_BEHAVIOR_BYPASS_TDI 0x00000001 - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_CONTROL_CLIENT) ( - __in PWSK_CLIENT Client, - __in ULONG ControlCode, - __in SIZE_T InputSize, - __in_bcount_opt(InputSize) PVOID InputBuffer, - __in SIZE_T OutputSize, - __out_bcount_opt(OutputSize) PVOID OutputBuffer, - __out_opt SIZE_T *OutputSizeReturned, - __inout_opt PIRP Irp - ); -/* - * Issues control request to WSK subsystem, e.g., registration for protocol - * change notifications, etc. - * - * Parameters: - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * ControlCode - request code. currently defined codes are: - * WSK_TRANSPORT_LIST_QUERY - Retrieves the array of transports - * into the OutputBuffer. InputSize and InputBuffer parameters - * are ignored. Irp must be NULL and pOutputSize must be Non-NULL. - * WSK_TRANSPORT_LIST_CHANGE - Notifies the client when a - * transport is added or removed. InputSize/InputBuffer, - * OutputSize/OutputBuffer, and pOutputSize parameters are - * ignored. Irp must be specified. - * InputSize - size of the input data residing in InputBuffer - * InputBuffer - buffer that holds input data - * OutputSize - size of the OutputBuffer - * OutputBuffer - buffer that will hold output data - * OutputSizeReturned - address of a variable that will contain the actual size - * of data copied into the OutputBuffer. This parameter is - * ignored if the Irp parameter is specified. - * Irp - IRP for the asynchronous completion of the request. Upon completion, - * Irp->Iostatus.Information will hold the actual size of data copied - * into the OutputBuffer. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later (Irp was specified.) - * FAILURES - request failed - */ - -#if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef -__drv_arg(*Result, __drv_allocatesMem(Mem)) -NTSTATUS -(WSKAPI * PFN_WSK_GET_ADDRESS_INFO) ( - __in PWSK_CLIENT Client, - __in_opt PUNICODE_STRING NodeName, - __in_opt PUNICODE_STRING ServiceName, - __in_opt ULONG NameSpace, - __in_opt GUID *Provider, - __in_opt PADDRINFOEXW Hints, - __deref_out PADDRINFOEXW *Result, - __in_opt PEPROCESS OwningProcess, - __in_opt PETHREAD OwningThread, - __inout PIRP Irp - ); -/* - * Provides protocol independent translation from host name to address. - * - * Parameters: - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * NodeName - Pointer to a UNICODE_STRING that contains a host (node) name. The - * host name must be a NULL-terminated unicode string. Either NodeName or - * ServiceName must point to a non-emptry string. - * ServiceName - Pointer to a UNICODE_STRING that contains either a service name - * or port number represented as a string. The service name or port number - * must be a NULL-terminated unicode string. Either NodeName or - * ServiceName must point to a non-emptry string. - * NameSpace - a namespace identifier that determines which namespace providers - * are queried. Passing a specific namespace identifier will result in - * only namespace providers that support the specified namepsace being - * queried. - * Provider - Pointer to a GUID of a specific namespace provider to query. Passing - * the GUID of specific namespace provider will result in only the specified - * namespace provider being queried. - * Hints - Pointer to an ADDRINFOEXW structure that provides hints about the type - * of socket the caller supports. - * Result - Pointer to a linked list of one or more ADDRINFOEXW structures that - * contains response information about the host. The caller must call - * WskFreeAddressInfo to free it. - * OwningProcess - The process to retrieve the security context from. If this is - * set to NULL then the current process is assumed. - * OwningThread - The thread to retrieve the security context from. This is - * valid only if an impersonation token is in effect. This can be NULL - * only if the OwningProcess is NULL too. - * Irp - IRP for async completion of the request. Upon completion, - * Irp->Iostatus.Information will hold the returned status code. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later (Irp was specified.) - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_GET_NAME_INFO) ( - __in PWSK_CLIENT Client, - __in PSOCKADDR SockAddr, - __in ULONG SockAddrLength, - __out_opt PUNICODE_STRING NodeName, - __out_opt PUNICODE_STRING ServiceName, - __in ULONG Flags, - __in_opt PEPROCESS OwningProcess, - __in_opt PETHREAD OwningThread, - __inout PIRP Irp - ); -/* - * Provides protocol independent translation from address to host name. - * - * Parameters: - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * SockAddr - Pointer to a socket address structure containing the IP address - * and port number of the socket. - * SockAddrLength - The length, in bytes, of the structure pointed to by the - * SockAddr parameter. The size should not exceed size of - * SOCKADDR_STORAGE. - * NodeName - Pointer to a UNICODE_STRING to hold the host name. On success, - * the Unicode host name is written into the buffer as a Fully Qualified - * Domain Name (FQDN) by default. The caller must provide a buffer large - * enough to hold the Unicode host name, including the terminating NULL - * character. If the NodeBuffer parameter is NULL, this indicates the - * caller does not want to receive a host name string. Either NodeBuffer - * or ServiceBuffer MUST be not NULL. - * ServiceName - Pointer to a UNICODE_STRING to hold the service name. On success, - * a Unicode string representing the service name associated with the port - * number is written into the buffer. The caller must provide a buffer large - * enough to hold the Unicode host name, including the terminating NULL - * character. If the ServiceBuffer parameter is NULL, this indicates the - * caller does not want to receive a service name string. Either NodeBuffer - * or ServiceBuffer MUST be not NULL. - * Flags - A value used to customize processing of the function. - * OwningProcess - The process to retrieve the security context from. If this is - * set to NULL then the current process is assumed. - * OwningThread - The thread to retrieve the security context from. This is - * valid only if an impersonation token is in effect. This can be NULL - * only if the OwningProcess is NULL too. - * Irp - IRP for async completion of the request. Upon completion, - * Irp->Iostatus.Information will hold the returned status code. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later (Irp was specified.) - * FAILURES - request failed - */ - -typedef -__drv_arg(AddrInfo, __drv_freesMem(Mem)) -VOID -(WSKAPI * PFN_WSK_FREE_ADDRESS_INFO) ( - __in PWSK_CLIENT Client, - __in PADDRINFOEXW AddrInfo - ); -/* - * Free ADDRINFOEXW returned by WskGetAddressInfo to WSK subsystem. - * - * Parameters: - * Client - Pointer to the Client object returned by WskCaptureProviderNPI - * AddrInfo - ADDRINFOEXW structure returned by WskGetAddressInfo. - * - * Returns: - * - * None. - * - */ - -#endif // if (NTDDI_VERSION >= NTDDI_WIN7) - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_BIND) ( - __in PWSK_SOCKET Socket, - __in PSOCKADDR LocalAddress, - __reserved ULONG Flags, - __inout PIRP Irp - ); -/* - * Bind local (unicast or multicast) tranport address to a socket - * - * Parameters: - * Socket - socket object to bind address to - * LocalAddress - transport address specification - * Flags - Reserved. (Must be 0) - * Irp - IRP for async completion - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_CONNECT) ( - __in PWSK_SOCKET Socket, - __in PSOCKADDR RemoteAddress, - __reserved ULONG Flags, - __inout PIRP Irp - ); -/* - * Establish comunication with the entity or group specified by the transport - * address by means appropriate for the protocol (e.g. run protocol to - * establish a VC and/or make sure the address is reachable and/or - * cache the routing entry, etc) - * - * Parameters: - * Socket - socket object to establish connection for - * RemoteAddress - transport address specification - * Flags - Reserved. (Must be 0) - * Irp - IRP for async completion - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -// -// Option/IOCTL Levels -// - -// -// Socket Level Options specific to WSK -// (Standard socket level options are defined in ws2def.h) -// - -#define SO_WSK_SECURITY (WSK_SO_BASE+1) -#define SO_WSK_EVENT_CALLBACK (WSK_SO_BASE+2) - -// -// Flags for enabling event callbacks via WskControlSocket call with -// SO_WSK_EVENT_CALLBACK option. -// - -#define WSK_EVENT_RECEIVE_FROM 0x00000100 // Datagram sockets -#define WSK_EVENT_ACCEPT 0x00000200 // Listen sockets -#define WSK_EVENT_SEND_BACKLOG 0x00000010 // Connection and Listen sockets -#define WSK_EVENT_RECEIVE 0x00000040 // Connection and Listen sockets -#define WSK_EVENT_DISCONNECT 0x00000080 // Connection and Listen sockets - -// -// Flag for disabling a given event callback via WskControlSocket call with -// SO_WSK_EVENT_CALLBACK option. -// -#define WSK_EVENT_DISABLE 0x80000000 - -// -// Structure used with SO_WSK_EVENT_CALLBACK to enable/disable event callbacks -// -typedef struct _WSK_EVENT_CALLBACK_CONTROL { - PNPIID NpiId; - ULONG EventMask; -} WSK_EVENT_CALLBACK_CONTROL, *PWSK_EVENT_CALLBACK_CONTROL; - -// -// IOCTL codes specific to WSK -// - -#define SIO_WSK_SET_REMOTE_ADDRESS _WSAIOW(IOC_WSK,0x1) -#define SIO_WSK_REGISTER_EXTENSION _WSAIORW(IOC_WSK,0x2) -#define SIO_WSK_QUERY_IDEAL_SEND_BACKLOG _WSAIOR(IOC_WSK,0x3) -#define SIO_WSK_QUERY_RECEIVE_BACKLOG _WSAIOR(IOC_WSK,0x4) -#define SIO_WSK_QUERY_INSPECT_ID _WSAIOR(IOC_WSK,0x5) -#define SIO_WSK_SET_SENDTO_ADDRESS _WSAIOW(IOC_WSK,0x6) - -// -// Input structure used with SIO_WSK_REGISTER_EXTENSION -// -typedef struct _WSK_EXTENSION_CONTROL_IN { - PNPIID NpiId; - PVOID ClientContext; - CONST VOID* ClientDispatch; -} WSK_EXTENSION_CONTROL_IN, *PWSK_EXTENSION_CONTROL_IN; - -// -// Output structure used with SIO_WSK_REGISTER_EXTENSION -// -typedef struct _WSK_EXTENSION_CONTROL_OUT { - PVOID ProviderContext; - CONST VOID* ProviderDispatch; -} WSK_EXTENSION_CONTROL_OUT, *PWSK_EXTENSION_CONTROL_OUT; - - -typedef enum { - WskSetOption, // set socket option - WskGetOption, // get socket option - WskIoctl, // socket IOCTL - WskControlMax -} WSK_CONTROL_SOCKET_TYPE, *PWSK_CONTROL_SOCKET_TYPE; - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_CONTROL_SOCKET) ( - __in PWSK_SOCKET Socket, - __in WSK_CONTROL_SOCKET_TYPE RequestType, - __in ULONG ControlCode, - __in ULONG Level, - __in SIZE_T InputSize, - __in_bcount_opt(InputSize) PVOID InputBuffer, - __in SIZE_T OutputSize, - __out_bcount_opt(OutputSize) PVOID OutputBuffer, - __out_opt SIZE_T *OutputSizeReturned, - __inout_opt PIRP Irp - ); -/* - * - * Parameters: - * Socket - socket object - * RequestType - WskSetOption, WskGetOption, or WskIoctl - * ControlCode - what kind of the request - * Level - SOL_SOCKET for socket-level options, - * Protocol number for transport/network specific options - * InputSize - size of the input data residing in InputBuffer - * InputBuffer - buffer that holds input data - * OutputSize - size of the OutputBuffer - * OutputBuffer - buffer that will hold output data - * OutputSizeReturned - if Irp is NULL for a ControlCode than this parameter - * must be specified to store the number of bytes written - * into OutputBuffer upon in-line completion of the request. - * Irp - IRP for the asynchronous completion of the request. Upon completion, - * Irp->Iostatus.Information will hold the actual size of data copied - * into the OutputBuffer. This will be either a required parameter or - * ignored (and must be NULL), or optional based on the ControlCode. - * - * Returns: - * - * SUCCESS - request succeeded - * STATUS_REQUEST_NOT_ACCEPTED - Inline completion is not possible. - * PENDING - request will be completed later (Irp was specified.) - * FAILURES - request failed - */ - -typedef -__drv_arg(Socket, __drv_freesMem(Mem)) -NTSTATUS -(WSKAPI * PFN_WSK_CLOSE_SOCKET) ( - __in PWSK_SOCKET Socket, - __inout PIRP Irp - ); -/* - * Invalidates socket object, initiates cancellation of - * all outstanding requests. Once WskCloseSocket is invoked on a socket, - * it is illegal to issue any further calls on that socket. It's also illegal - * to call WskCloseSocket when there are one or more WSK calls on the socket - * that have not yet returned control to the client. - * - * Parameters: - * Socket - Socket to be closed. - * Irp - notification method to trigger when operation completes. - * This is a required parameter. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -__drv_arg(Irp->IoStatus.Information, __drv_allocatesMem(Mem)) -NTSTATUS -(WSKAPI * PFN_WSK_ACCEPT) ( - __in PWSK_SOCKET ListenSocket, - __reserved ULONG Flags, - __in_opt PVOID AcceptSocketContext, - __in_opt CONST WSK_CLIENT_CONNECTION_DISPATCH *AcceptSocketDispatch, - __out_opt PSOCKADDR LocalAddress, - __out_opt PSOCKADDR RemoteAddress, - __inout PIRP Irp - ); -/* - * Dequeue (pend if it is not there) and return incoming connection request - * on the specified listening socket. - * - * Parameters: - * ListenSocket - listening socket to dequeue request from - * Flags - Reserved. (Must be 0) - * AcceptSocketContext - context to be associated with the accepted socket - * object. This is passed as a parameter in event callbacks. - * AcceptSocketDispatch - pointer to a constant structure containining pointers - * to callback routines. OPTIONAL if client won't be enabling callbacks. - * LocalAddress - Optional buffer to return the local address on which - * this connection request arrived. Useful if listening socket is - * bound to the wildcard address. - * RemoteAddress - Optional buffer to return the remote party's address. - * Irp - IRP for async completion of the request - * - * Returns: - * - * If the request is completed succesfully, the Irp.IoStatus.Information - * field will be holding a pointer to the accepted socket (PWSK_SOCKET) - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_INSPECT_COMPLETE) ( - __in PWSK_SOCKET ListenSocket, - __in PWSK_INSPECT_ID InspectID, - __in WSK_INSPECT_ACTION Action, - __inout PIRP Irp - ); -/* - * Resume a previously pended inspect operation. This routine is valid only - * for conditional-accept sockets. - * - * Parameters: - * ListenSocket - listening socket on which the inspect action was pended for - * the connection request identified by the structure pointed - * by pInspectID. - * InspectID - Pointer to the inspect ID structure that identified the pended - * connection request. - * Action - Only one of the following two actions is allowed: - * - * WskInspectReject - Reject the connection request. WskAcceptEvent won't - * be invoked. WskAbortEvent may be invoked if the - * connection request is dropped during WskInspectComplete call. - * - * WskInspectAccept - Proceed with regular acceptance. WskAcceptEvent - * or WskAbortEvent may be invoked. - * - * Irp - IRP for asynchronous completion of this operation. This is a - * required parameter. - * - * Returns: - * - * STATUS_SUCCESS - request succeeded - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_SEND_TO) ( - __in PWSK_SOCKET Socket, - __in PWSK_BUF Buffer, - __reserved ULONG Flags, - __in_opt PSOCKADDR RemoteAddress, - __in ULONG ControlInfoLength, - __in_bcount_opt(ControlInfoLength) PCMSGHDR ControlInfo, - __inout PIRP Irp - ); -/* - * Send to the specified remote entity or group from the specified - * datagram socket. Socket must have been bound to a local address. - * - * Parameters: - * Socket - datagram socket object to send from - * Buffer - data to send - * Flags - Reserved. (Must be 0) - * RemoteAddress - remote transport address - * ControlInfo - additional information to pass to the remote party. - * Might not be supported by all transports. - * ControlInfoLength - length of control info - * Irp - notification method to trigger when operation completes - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_RECEIVE_FROM) ( - __in PWSK_SOCKET Socket, - __in PWSK_BUF Buffer, - __reserved ULONG Flags, - __out_opt PSOCKADDR RemoteAddress, - __inout PULONG ControlLength, - __out_bcount_opt(*ControlLength) PCMSGHDR ControlInfo, - __out_opt PULONG ControlFlags, - __inout PIRP Irp - ); -/* - * Dequeue (pend if it is not there) and return incoming data packet on the - * specified datagram socket. - * - * Parameters: - * Socket - socket to dequeue packet from - * Buffer - place to put incoming data into - * Flags - Reserved. (Must be 0) - * RemoteAddress - OUT parameter to return the transport address of the remote - * party that sent the packet - * ControlLength - Pointer to a ULONG that specifies the length of buffer - * pointed by ControlInfo on input, and the length of actual control data - * copied into ControlInfo buffer on output. If ControlLength is NULL - * then ControlInfo and ControlFlags parameters are ignored. - * If ControlLength is non-NULL then ControlLength should be pointing to - * valid memory until the request completes. - * ControlInfo - Pointer to a buffer into which WSK copies the control data - * received with the datagram. This parameter is ignored if - * ControlLength parameter is NULL. Otherwise, if ControlInfo should - * be pointing to valid memory until the request completes. - * ControlFlags - Pointer to a ULONG through which WSK may pass the following - * flags when the request completes: MSG_MCAST, MSG_BCAST, MSG_TRUNC, - * MSG_CTRUNC. This parameter is ignored if it is NULL. - * Otherwise, ControlFlags should be pointing to valid memory until the - * request completes. - * Irp - notification method to trigger when operation completes - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_GET_LOCAL_ADDRESS) ( - __in PWSK_SOCKET Socket, - __out PSOCKADDR LocalAddress, - __inout PIRP Irp - ); -/* - * Retrieve the transport address associated with this Socket object. This is - * useful for retrieveing the specific transport address chosen by the transport - * when a socket is bound to the wildcard transport address by the client. - * - * Parameters: - * Socket - Socket whose local address is being queried - * LocalAddress - local transport address - * Irp - Irp for async completion. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_GET_REMOTE_ADDRESS) ( - __in PWSK_SOCKET Socket, - __out PSOCKADDR RemoteAddress, - __inout PIRP Irp - ); -/* - * Retrieve the transport address of the peer to which the socket is connected. - * Clients are always informed -- upon connection setup -- of the peer's - * address, so this call is useful if a socket is being shared between multiple - * components of the client application. If one component set up the connection - * and another component wishes to determine the peer address, it can do so via - * this call. - * - * Parameters: - * Socket - Socket whose local address is being queried - * RemoteAddress - remote party's transport address - * Irp - Irp for async completion. - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_RELEASE_DATA_INDICATION_LIST) ( - __in PWSK_SOCKET Socket, - __in PWSK_DATA_INDICATION DataIndication - ); -/* - * Release data indications that were previously retained by returning - * STATUS_PENDING from the receive event callback on connection-oriented - * socket. - * - * Parameters: - * Socket - Socket on which buffers were received - * DataIndication - list of data indication elements - * - * Returns: - * SUCCESS - request succeeded - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_RELEASE_DATAGRAM_INDICATION_LIST) ( - __in PWSK_SOCKET Socket, - __in PWSK_DATAGRAM_INDICATION DatagramIndication - ); -/* - * Release datagram indications that were previously retained by returning - * STATUS_PENDING from the receive-from event callback on datagram socket. - * - * Parameters: - * Socket - Socket on which datagrams was received - * DatagramIndication - list of datagram indication elements - * - * Returns: - * SUCCESS - request succeeded - * FAILURES - request failed - */ - -// -// Flag used for denoting that the send request (along with any previously -// queued send requests, if any) should be sent out without further delay. -// - -#define WSK_FLAG_NODELAY 0x00000002 - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_SEND) ( - __in PWSK_SOCKET Socket, - __in PWSK_BUF Buffer, - __in ULONG Flags, - __inout PIRP Irp - ); -/* - * Send on the specified connected socket - * - * Parameters: - * Socket - Socket to send on. Must have been connected or accepted - * Buffer - data to send - * Flags - WSK_FLAG_NODELAY: Must send without delaying - * Irp - notification method to trigger when operation completes - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -#define WSK_FLAG_WAITALL 0x00000002 -#define WSK_FLAG_DRAIN 0x00000004 - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_RECEIVE) ( - __in PWSK_SOCKET Socket, - __in PWSK_BUF Buffer, - __in ULONG Flags, - __inout PIRP Irp - ); -/* - * Dequeue (wait if it is not there) and return incoming data packet on the - * specified connected socket - * - * Parameters: - * Socket - Socket to dequeue data from. Must have been connected or accepted - * Buffer - place to put incoming data into - * Flags - WSK_FLAG_WAITALL: Wait until the receive buffer is filled up - * WSK_FLAG_DRAIN: Discard any existing and future incoming data - * Irp - notification method to trigger when operation completes - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - -typedef -NTSTATUS -(WSKAPI * PFN_WSK_DISCONNECT) ( - __in PWSK_SOCKET Socket, - __in_opt PWSK_BUF Buffer, - __in ULONG Flags, - __inout PIRP Irp - ); -/* - * Send disconnect notification on specified connected socket - * with optional data. - * - * Parameters: - * Socket - Socket to disconnect. Must have been connected or accepted. - * Buffer - Optional data to send along with graceful disconnect. - * Flags - If WSK_FLAG_ABORTIVE is specified then perform abortive disconnect. - * Otherwise, perform graceful disconnect. - * Irp - notification method to trigger when operation completes. (Required) - * - * Returns: - * - * SUCCESS - request succeeded - * PENDING - request will be completed later - * FAILURES - request failed - */ - - - - -// -// WSK Dispatch tables. -// WSK interface consists of routines implemented by both -// the client and the provider. These routines operate -// at either client/provider level or socket level. -// Client/provider level function pointers are exchanged -// during WSK registration. -// Socket level function pointers are exchanged during -// socket creation. -// - -// -// Client level callback table -// - -typedef struct _WSK_CLIENT_DISPATCH { - USHORT Version; - USHORT Reserved; - PFN_WSK_CLIENT_EVENT WskClientEvent; -} WSK_CLIENT_DISPATCH, *PWSK_CLIENT_DISPATCH; - -// -// Socket level callbacks for listening sockets -// - -typedef struct _WSK_CLIENT_LISTEN_DISPATCH { - PFN_WSK_ACCEPT_EVENT WskAcceptEvent; - PFN_WSK_INSPECT_EVENT WskInspectEvent; - PFN_WSK_ABORT_EVENT WskAbortEvent; -} WSK_CLIENT_LISTEN_DISPATCH, *PWSK_CLIENT_LISTEN_DISPATCH; - -// -// Socket level callbacks for datagram sockets -// - -typedef struct _WSK_CLIENT_DATAGRAM_DISPATCH { - PFN_WSK_RECEIVE_FROM_EVENT WskReceiveFromEvent; -} WSK_CLIENT_DATAGRAM_DISPATCH, *PWSK_CLIENT_DATAGRAM_DISPATCH; - -// -// Socket level callbacks for connected sockets -// - -typedef struct _WSK_CLIENT_CONNECTION_DISPATCH { - PFN_WSK_RECEIVE_EVENT WskReceiveEvent; - PFN_WSK_DISCONNECT_EVENT WskDisconnectEvent; - PFN_WSK_SEND_BACKLOG_EVENT WskSendBacklogEvent; -} WSK_CLIENT_CONNECTION_DISPATCH, *PWSK_CLIENT_CONNECTION_DISPATCH; - - -// -// Provider level downcall table -// - -typedef struct _WSK_PROVIDER_DISPATCH { - USHORT Version; - USHORT Reserved; - PFN_WSK_SOCKET WskSocket; - PFN_WSK_SOCKET_CONNECT WskSocketConnect; - PFN_WSK_CONTROL_CLIENT WskControlClient; -#if (NTDDI_VERSION >= NTDDI_WIN7) - PFN_WSK_GET_ADDRESS_INFO WskGetAddressInfo; - PFN_WSK_FREE_ADDRESS_INFO WskFreeAddressInfo; - PFN_WSK_GET_NAME_INFO WskGetNameInfo; -#endif // if (NTDDI_VERSION >= NTDDI_WIN7) -} WSK_PROVIDER_DISPATCH, *PWSK_PROVIDER_DISPATCH; - -// -// Basic socket downcalls -// These routines are supported for all socket types. -// - -typedef struct _WSK_PROVIDER_BASIC_DISPATCH { - PFN_WSK_CONTROL_SOCKET WskControlSocket; - PFN_WSK_CLOSE_SOCKET WskCloseSocket; -} WSK_PROVIDER_BASIC_DISPATCH, *PWSK_PROVIDER_BASIC_DISPATCH; - -// -// Listening socket downcalls -// - -typedef struct _WSK_PROVIDER_LISTEN_DISPATCH { -#ifdef __cplusplus - WSK_PROVIDER_BASIC_DISPATCH Basic; -#else - WSK_PROVIDER_BASIC_DISPATCH; -#endif - PFN_WSK_BIND WskBind; - PFN_WSK_ACCEPT WskAccept; - PFN_WSK_INSPECT_COMPLETE WskInspectComplete; - PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress; -} WSK_PROVIDER_LISTEN_DISPATCH, *PWSK_PROVIDER_LISTEN_DISPATCH; - -// -// Datagram socket downcalls -// - -typedef struct _WSK_PROVIDER_DATAGRAM_DISPATCH { -#ifdef __cplusplus - WSK_PROVIDER_BASIC_DISPATCH Basic; -#else - WSK_PROVIDER_BASIC_DISPATCH; -#endif - PFN_WSK_BIND WskBind; - PFN_WSK_SEND_TO WskSendTo; - PFN_WSK_RECEIVE_FROM WskReceiveFrom; - PFN_WSK_RELEASE_DATAGRAM_INDICATION_LIST WskRelease; - PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress; -} WSK_PROVIDER_DATAGRAM_DISPATCH, *PWSK_PROVIDER_DATAGRAM_DISPATCH; - - -// -// Connected socket downcalls -// - -typedef struct _WSK_PROVIDER_CONNECTION_DISPATCH { -#ifdef __cplusplus - WSK_PROVIDER_BASIC_DISPATCH Basic; -#else - WSK_PROVIDER_BASIC_DISPATCH; -#endif - PFN_WSK_BIND WskBind; - PFN_WSK_CONNECT WskConnect; - PFN_WSK_GET_LOCAL_ADDRESS WskGetLocalAddress; - PFN_WSK_GET_REMOTE_ADDRESS WskGetRemoteAddress; - PFN_WSK_SEND WskSend; - PFN_WSK_RECEIVE WskReceive; - PFN_WSK_DISCONNECT WskDisconnect; - PFN_WSK_RELEASE_DATA_INDICATION_LIST WskRelease; -} WSK_PROVIDER_CONNECTION_DISPATCH, *PWSK_PROVIDER_CONNECTION_DISPATCH; - - -// -// Structures and routines used for WSK registration and deregistration -// - -// -// WSK Client NPI -// -typedef struct _WSK_CLIENT_NPI { - PVOID ClientContext; - CONST WSK_CLIENT_DISPATCH *Dispatch; -} WSK_CLIENT_NPI, *PWSK_CLIENT_NPI; - -// -// WSK Provider NPI -// -typedef struct _WSK_PROVIDER_NPI { - PWSK_CLIENT Client; - CONST WSK_PROVIDER_DISPATCH *Dispatch; -} WSK_PROVIDER_NPI, *PWSK_PROVIDER_NPI; - -// -// WSK Registration block that needs to be provided by the WSK client and -// initialized by the WSK subsystem via WskRegister. WSK client should not -// manipulate any of the fields of the registration block directly. -// -typedef struct _WSK_REGISTRATION { - ULONGLONG ReservedRegistrationState; - PVOID ReservedRegistrationContext; - KSPIN_LOCK ReservedRegistrationLock; -} WSK_REGISTRATION, *PWSK_REGISTRATION; - -__checkReturn -NTSTATUS -WskRegister( - __in PWSK_CLIENT_NPI WskClientNpi, - __out PWSK_REGISTRATION WskRegistration - ); -/* - * Register as a WSK client. WSK clients may invoke this routine multiple times - * with a seperate WskRegistation block for each call in order to have multiple - * WSK registration instances. For each successful WskRegister call, there must - * be exactly one corresponding WskDeregister call with the same WskRegistration - * block that was passed to WskRegister. - * - * Required IRQL == PASSIVE_LEVEL - * - * Parameters: - * WskClientNpi - Pointer to the client NPI implemented by the WSK client. - * WskRegistration - Registration block used to identify this instance of - * the WSK registration. This block of memory must be kept - * allocated (not freed or gone out of scope) as long as - * there are outstanding calls to the functions below. - * - * Returns: - * - * STATUS_SUCCESS - request succeeded - * FAILURES - request failed - */ - -#define WSK_NO_WAIT 0 -#define WSK_INFINITE_WAIT 0xffffffff - -__checkReturn -NTSTATUS -WskCaptureProviderNPI( - __in PWSK_REGISTRATION WskRegistration, - __in ULONG WaitTimeout, - __out PWSK_PROVIDER_NPI WskProviderNpi - ); -/* - * Capture the provider NPI implemented by the WSK provider when the WSK - * provider becomes available. This routine may be called multiple times. - * For each call to WskCaptureProviderNPI that returns successfully, there must - * be exactly one corresponding call to WskReleaseProviderNPI. - * It's OK to call WskCaptureProviderNPI after WskDeregister is called as long - * as the WskRegistration block is not freed or overwritten. After WskDeregister - * is called, any further calls to WskCaptureProviderNPI will fail with - * STATUS_DEVICE_NOT_READY, and any exisiting WskCaptureProviderNPI calls that - * are blocked in other threads waiting for WSK provider to become available - * will also return immediately with the STATUS_DEVICE_NOT_READY status code. - * - * Required IRQL == PASSIVE_LEVEL if WaitTimeout != WSK_NO_WAIT - * IRQL <= DISPATCH_LEVEL if WaitTimeout == WSK_NO_WAIT - * - * Parameters: - * WskRegistration - Registration block initialized by WskRegister. - * WaitTimeout - Time in milliseconds for how long to wait for the WSK provider - * to become available. - * WSK_NO_WAIT : return immediately if provider not available - * WSK_INFINITE_WAIT : wait until provider becomes available - * WskProviderNpi - Provider NPI returned by the WSK provider. WSK clients can - * invoke functions in WSK_PROVIDER_DISPATCH until the provider - * NPI is released via WskReleaseProviderNPI. - * Returns: - * - * STATUS_SUCCESS - request succeeded - * STATUS_DEVICE_NOT_READY - WSK provider was not available yet. - * STATUS_NOINTERFACE - Client's requested version is not supported. - * FAILURES - request failed - */ - -VOID -WskReleaseProviderNPI( - __in PWSK_REGISTRATION WskRegistration - ); -/* - * Release the provider NPI instance that was captured via WskCaptureProviderNPI. - * There must be exactly one call to WskReleaseProviderNPI for each call to - * WskCaptureProviderNPI that returns successfully. - * - * Required IRQL <= DISPATCH_LEVEL - * - * Parameters: - * WskRegistration - Registration block initialized by WskRegister. - * - * Returns: - * - * None. - */ - -__checkReturn -NTSTATUS -WskQueryProviderCharacteristics( - __in PWSK_REGISTRATION WskRegistration, - __out PWSK_PROVIDER_CHARACTERISTICS WskProviderCharacteristics - ); -/* - * Query the characterisitics of the WSK provider. This routine should be called - * after WskCaptureProviderNPI returns STATUS_NOINTERFACE or STATUS_SUCCESS. - * WSK clients may use this routine to find out the versions supported by the - * WSK provider. - * - * Required IRQL <= DISPATCH_LEVEL - * - * Parameters: - * WskRegistration - Registration block initialized by WskRegister. - * WskProviderCharacteristics - Provider characterisitics returned by the WSK - * provider - * Returns: - * - * STATUS_SUCCESS - request succeeded - * STATUS_DEVICE_NOT_READY - WSK provider was not available yet. - * FAILURES - request failed - */ - -VOID -WskDeregister( - __in PWSK_REGISTRATION WskRegistration - ); -/* - * Deregister as a WSK client. For each successful WskRegister call, there must - * be exactly one corresponding WskDeregister call with the same WskRegistration - * block that was passed to WskRegister. - * WskDeregister will wait until all captured instances of the provider NPI are - * released, any outstanding calls to functions in WSK_PROVIDER_DISPATCH have - * returned, and all sockets are closed. - * - * Required IRQL == PASSIVE_LEVEL - * - * Parameters: - * WskRegistration - Registration block initialized by WskRegister. - * - * Returns: - * - * None. - */ - -#ifdef __cplusplus -} -#endif - -#endif // _WSK_ - - diff --git a/qt-correction-tool/pub/ddk/wwan.h b/qt-correction-tool/pub/ddk/wwan.h deleted file mode 100644 index 30132c7..0000000 --- a/qt-correction-tool/pub/ddk/wwan.h +++ /dev/null @@ -1,718 +0,0 @@ -/*++ -Copyright (c) 2007 Microsoft Corporation - -Module Name: - wwan.h - -Abstract: - Header file for WWAN structures - -Revision History: - DATE DESCRIPTION - ------------ ----------- - 23-FEB-2007 V0.40 Driver Model Compliant - 23-MAY-2007 V0.50 Driver Model Compliant - 01-AUG-2007 V0.60 Driver Model Compliant - 02-APR-2008 V1.00 Driver Model Compliant - ---*/ - -#ifndef __WWAN_DECL__ -#define __WWAN_DECL__ - -#define WWAN_ERROR_UNSUPPORTED_FIRMWARE 0xf0f0f000 -#define WWAN_ERROR_COM_PORT_CONFLICT 0xf0f0f001 -#define WWAN_ERROR_RESOURCE_CONFLICT_OTHER 0xf0f0ffff - -typedef ULONG WWAN_STATUS; - -#define WWAN_STATUS_SUCCESS STATUS_SUCCESS -#define WWAN_STATUS_BUSY 0xC0040002 -#define WWAN_STATUS_FAILURE 0xC0040003 -#define WWAN_STATUS_SIM_NOT_INSERTED 0xC0040004 -#define WWAN_STATUS_BAD_SIM 0xC0040005 -#define WWAN_STATUS_PIN_REQUIRED 0xC0040006 -#define WWAN_STATUS_PIN_DISABLED 0x40040007 -#define WWAN_STATUS_NOT_REGISTERED 0x40040008 -#define WWAN_STATUS_PROVIDERS_NOT_FOUND 0x40040009 -#define WWAN_STATUS_NO_DEVICE_SUPPORT 0xC004000a -#define WWAN_STATUS_PROVIDER_NOT_VISIBLE 0x4004000b -#define WWAN_STATUS_DATA_CLASS_NOT_AVAILABLE 0x4004000c -#define WWAN_STATUS_PACKET_SVC_DETACHED 0xC004000d -#define WWAN_STATUS_MAX_ACTIVATED_CONTEXTS 0xC004000e -#define WWAN_STATUS_NOT_INITIALIZED 0xC004000f -#define WWAN_STATUS_VOICE_CALL_IN_PROGRESS 0x40040010 -#define WWAN_STATUS_CONTEXT_NOT_ACTIVATED 0xC0040011 -#define WWAN_STATUS_SERVICE_NOT_ACTIVATED 0xC0040012 -#define WWAN_STATUS_INVALID_ACCESS_STRING 0xC0040013 -#define WWAN_STATUS_INVALID_USER_NAME_PWD 0xC0040014 -#define WWAN_STATUS_RADIO_POWER_OFF 0xC0040015 -#define WWAN_STATUS_INVALID_PARAMETERS 0xC0040016 -#define WWAN_STATUS_READ_FAILURE 0xC0040017 -#define WWAN_STATUS_WRITE_FAILURE 0xC0040018 - -//SMS specific error codes -#define WWAN_STATUS_SMS_OPERATION_NOT_ALLOWED 0xC0040100 -#define WWAN_STATUS_SMS_MEMORY_FAILURE 0xC0040101 -#define WWAN_STATUS_SMS_INVALID_MEMORY_INDEX 0xC0040102 -#define WWAN_STATUS_SMS_UNKNOWN_SMSC_ADDRESS 0xC0040103 -#define WWAN_STATUS_SMS_NETWORK_TIMEOUT 0xC0040104 -#define WWAN_STATUS_SMS_MEMORY_FULL 0xC0040105 -#define WWAN_STATUS_SMS_UNKNOWN_ERROR 0xC0040106 -#define WWAN_STATUS_SMS_FILTER_NOT_SUPPORTED 0xC0040107 -#define WWAN_STATUS_SMS_MORE_DATA 0x40040108 -#define WWAN_STATUS_SMS_LANG_NOT_SUPPORTED 0xC0040109 -#define WWAN_STATUS_SMS_ENCODING_NOT_SUPPORTED 0xC004010A -#define WWAN_STATUS_SMS_FORMAT_NOT_SUPPORTED 0xC004010B - -typedef enum _WWAN_STRUCT_TYPE { - WwanStructTN = 0, - WwanStructContext, - WwanStructProvider, - WwanStructSmsPdu, - WwanStructReserved0, - WwanStructReserved1, - WwanStructReserved2, - WwanStructSmsCdma, - WwanStructReserved3, - WwanStructMax -} WWAN_STRUCT_TYPE, *PWWAN_STRUCT_TYPE; - -typedef struct _WWAN_LIST_HEADER { - WWAN_STRUCT_TYPE ElementType; - ULONG ElementCount; -} WWAN_LIST_HEADER, *PWWAN_LIST_HEADER; - -#define WWAN_MANUFACTURER_LEN 32 -#define WWAN_MODEL_LEN 32 -#define WWAN_FIRMWARE_LEN 32 -#define WWAN_DEVICEID_LEN 18 -#define WWAN_CUSTOM_DATA_CLASS_LEN 12 -#define WWAN_CUSTOM_BAND_CLASS_LEN 20 -#define WWAN_PIN_LEN 12 -#define WWAN_PROVIDERID_LEN 7 -#define WWAN_PROVIDERNAME_LEN 21 -#define WWAN_ROAMTEXT_LEN 64 -#define WWAN_ACCESSSTRING_LEN 101 -#define WWAN_USERNAME_LEN 256 -#define WWAN_PASSWORD_LEN 256 -#define WWAN_SUBSCRIBERID_LEN 16 -#define WWAN_SIMICCID_LEN 21 -#define WWAN_TN_LEN 16 -#define WWAN_SCA_MAX_LEN 14 -#define WWAN_SMS_ADDRESS_MAX_LEN 16 -#define WWAN_SC_TIME_STAMP_MAX_LEN 20 -#define WWAN_SMS_CDMA_ADDR_MAX_LEN 50 -#define WWAN_SMS_CDMA_TIMESTAMP_MAX_LEN 20 -#define WWAN_SMS_MSG_PDU_LEN 183 -#define WWAN_SMS_RAW_PDU_LEN (WWAN_SMS_MSG_PDU_LEN - 12) -#define WWAN_SMS_PDU_HEX_BUF_LEN (WWAN_SMS_MSG_PDU_LEN * 2) -#define WWAN_CDMA_SHORT_MSG_SIZE_UNKNOWN 0 -#define WWAN_CDMA_SHORT_MSG_SIZE_MAX 160 -#define WWAN_SMS_CDMA_MAX_BUF_LEN 160 -#define WWAN_SMS_CDMA_MAX_MSG_LEN WWAN_CDMA_SHORT_MSG_SIZE_MAX - -#define WWAN_CDMA_DEFAULT_PROVIDER_ID (0) - -typedef enum _WWAN_ASYNC_GETSET_TYPE { - WwanAsyncGetDeviceCaps = 0, - WwanAsyncGetReadyInfo, - WwanAsyncGetRadioState, - WwanAsyncSetRadioState, - WwanAsyncGetPin, - WwanAsyncSetPin, - WwanAsyncGetPinList, - WwanAsyncGetHomeProvider, - WwanAsyncGetPreferredProviders, - WwanAsyncSetPreferredProviders, - WwanAsyncGetVisibleProviders, - WwanAsyncGetRegisterState, - WwanAsyncSetRegisterState, - WwanAsyncGetPacketService, - WwanAsyncSetPacketService, - WwanAsyncGetSignalState, - WwanAsyncSetSignalState, - WwanAsyncGetConnect, - WwanAsyncSetConnect, - WwanAsyncGetProvisionedContexts, - WwanAsyncSetProvisionedContext, - WwanAsyncSetServiceActivation, - WwanAsyncGetSmsConfiguration, - WwanAsyncSetSmsConfiguration, - WwanAsyncSmsRead, - WwanAsyncSmsSend, - WwanAsyncSmsDelete, - WwanAsyncSmsStatus, - WwanAsyncSetVendorSpecific, - WWAN_ASYNC_GETSET_TYPE_MAX -} WWAN_ASYNC_GETSET_TYPE, *PWWAN_ASYNC_GETSET_TYPE; - -#ifndef WWAN_MAJOR_VERSION -#define WWAN_MAJOR_VERSION 1 -#endif - -#ifndef WWAN_MINOR_VERSION -#define WWAN_MINOR_VERSION 0 -#endif - -#ifndef WWAN_CURRENT_VERSION -#define WWAN_CURRENT_VERSION \ - ((WWAN_MAJOR_VERSION << 16) | WWAN_MINOR_VERSION) -#endif - -typedef ULONG WWAN_VERSION; /* A value specifies the version. */ - /* bit[16:31]: major version */ - /* bit[0:15]: minor version */ - -#define WWAN_DRIVER_CAPS_NONE 0x00000000 - -typedef struct _WWAN_DRIVER_CAPS { - ULONG ulMajorVersion; - ULONG ulMinorVersion; - ULONG ulDriverCaps; -} WWAN_DRIVER_CAPS, *PWWAN_DRIVER_CAPS; - -typedef enum _WWAN_DEVICE_TYPE { - WwanDeviceTypeUnknown = 0, - WwanDeviceTypeEmbedded, - WwanDeviceTypeRemovable, - WwanDeviceTypeRemote, - WwanDeviceTypeMax -} WWAN_DEVICE_TYPE, *PWWAN_DEVICE_TYPE; - -typedef enum _WWAN_CELLULAR_CLASS { - WwanCellularClassUnknown = 0, - WwanCellularClassGsm, - WwanCellularClassCdma, - WwanCellularClassMax -} WWAN_CELLULAR_CLASS, *PWWAN_CELLULAR_CLASS; - -typedef enum _WWAN_VOICE_CLASS { - WwanVoiceClassUnknown = 0, - WwanVoiceClassNoVoice, - WwanVoiceClassSeparateVoiceData, - WwanVoiceClassSimultaneousVoiceData, - WwanVoiceClassMax -} WWAN_VOICE_CLASS, *PWWAN_VOICE_CLASS; - -typedef enum _WWAN_SIM_CLASS { - WwanSimClassUnknown = 0, - WwanSimClassSimLogical, - WwanSimClassSimRemovable, - WwanSimClassSimRemote, - WwanSimClassMax -} WWAN_SIM_CLASS, *PWWAN_SIM_CLASS; - -#define WWAN_DATA_CLASS_NONE 0x00000000 -#define WWAN_DATA_CLASS_GPRS 0x00000001 -#define WWAN_DATA_CLASS_EDGE 0x00000002 /* EGPRS */ -#define WWAN_DATA_CLASS_UMTS 0x00000004 -#define WWAN_DATA_CLASS_HSDPA 0x00000008 -#define WWAN_DATA_CLASS_HSUPA 0x00000010 -#define WWAN_DATA_CLASS_LTE 0x00000020 -#define WWAN_DATA_CLASS_1XRTT 0x00010000 -#define WWAN_DATA_CLASS_1XEVDO 0x00020000 -#define WWAN_DATA_CLASS_1XEVDO_REVA 0x00040000 -#define WWAN_DATA_CLASS_1XEVDV 0x00080000 -#define WWAN_DATA_CLASS_3XRTT 0x00100000 -#define WWAN_DATA_CLASS_1XEVDO_REVB 0x00200000 /* for future use */ -#define WWAN_DATA_CLASS_UMB 0x00400000 -#define WWAN_DATA_CLASS_CUSTOM 0x80000000 - -#define WWAN_BAND_CLASS_UNKNOWN 0x00000000 -#define WWAN_BAND_CLASS_0 0x00000001 -#define WWAN_BAND_CLASS_I 0x00000002 -#define WWAN_BAND_CLASS_II 0x00000004 -#define WWAN_BAND_CLASS_III 0x00000008 -#define WWAN_BAND_CLASS_IV 0x00000010 -#define WWAN_BAND_CLASS_V 0x00000020 -#define WWAN_BAND_CLASS_VI 0x00000040 -#define WWAN_BAND_CLASS_VII 0x00000080 -#define WWAN_BAND_CLASS_VIII 0x00000100 -#define WWAN_BAND_CLASS_IX 0x00000200 -#define WWAN_BAND_CLASS_X 0x00000400 -#define WWAN_BAND_CLASS_XI 0x00000800 -#define WWAN_BAND_CLASS_XII 0x00001000 -#define WWAN_BAND_CLASS_XIII 0x00002000 -#define WWAN_BAND_CLASS_XIV 0x00004000 -#define WWAN_BAND_CLASS_XV 0x00008000 -#define WWAN_BAND_CLASS_XVI 0x00010000 -#define WWAN_BAND_CLASS_XVII 0x00020000 -#define WWAN_BAND_CLASS_CUSTOM 0x80000000 - -#define WWAN_CTRL_CAPS_NONE 0x00000000 -#define WWAN_CTRL_CAPS_REG_MANUAL 0x00000001 -#define WWAN_CTRL_CAPS_HW_RADIO_SWITCH 0x00000002 -#define WWAN_CTRL_CAPS_CDMA_MOBILE_IP 0x00000004 -#define WWAN_CTRL_CAPS_CDMA_SIMPLE_IP 0x00000008 -#define WWAN_CTRL_CAPS_PROTECT_UNIQUEID 0x00000010 - -#define WWAN_SMS_CAPS_NONE 0x00000000 -#define WWAN_SMS_CAPS_PDU_RECEIVE 0x00000001 -#define WWAN_SMS_CAPS_PDU_SEND 0x00000002 -#define WWAN_SMS_CAPS_TEXT_RECEIVE 0x00000004 -#define WWAN_SMS_CAPS_TEXT_SEND 0x00000008 - -typedef struct _WWAN_DEVICE_CAPS { - WWAN_DEVICE_TYPE WwanDeviceType; - WWAN_CELLULAR_CLASS WwanCellularClass; - WWAN_VOICE_CLASS WwanVoiceClass; - WWAN_SIM_CLASS WwanSimClass; - ULONG WwanDataClass; - WCHAR CustomDataClass[WWAN_CUSTOM_DATA_CLASS_LEN]; - ULONG WwanGsmBandClass; - ULONG WwanCdmaBandClass; - WCHAR CustomBandClass[WWAN_CUSTOM_BAND_CLASS_LEN]; - ULONG WwanSmsCaps; - ULONG WwanControlCaps; - WCHAR DeviceId [WWAN_DEVICEID_LEN]; - WCHAR Manufacturer [WWAN_MANUFACTURER_LEN]; - WCHAR Model [WWAN_MODEL_LEN]; - WCHAR FirmwareInfo [WWAN_FIRMWARE_LEN]; - ULONG MaxActivatedContexts; -} WWAN_DEVICE_CAPS, *PWWAN_DEVICE_CAPS; - -typedef enum _WWAN_READY_STATE { - WwanReadyStateOff = 0, /* stack is off */ - WwanReadyStateInitialized, /* ready to power up and register */ - WwanReadyStateSimNotInserted, /* SIM not inserted */ - WwanReadyStateBadSim, /* SIM is invalid */ - WwanReadyStateFailure, /* Device failure */ - WwanReadyStateNotActivated, /* Device not activated (CDMA) */ - WwanReadyStateDeviceLocked /* Device is locked */ -} WWAN_READY_STATE, *PWWAN_READY_STATE; - -typedef enum _WWAN_EMERGENCY_MODE -{ - WwanEmergencyModeOff = 0, - WwanEmergencyModeOn, - WwanEmergencyModeMax -}WWAN_EMERGENCY_MODE, *PWWAN_EMERGENCY_MODE; - -typedef struct _WWAN_READY_INFO { - WWAN_READY_STATE ReadyState; - WWAN_EMERGENCY_MODE EmergencyMode; - WCHAR SubscriberId [WWAN_SUBSCRIBERID_LEN]; - WCHAR SimIccId [WWAN_SIMICCID_LEN]; - BYTE CdmaShortMsgSize; - WWAN_LIST_HEADER TNListHeader; -} WWAN_READY_INFO, *PWWAN_READY_INFO; - -typedef struct _WWAN_SERVICE_ACTIVATION { - ULONG uVendorSpecificBufferSize; -} WWAN_SERVICE_ACTIVATION, *PWWAN_SERVICE_ACTIVATION; - -typedef enum _WWAN_RADIO { - WwanRadioOff = 0, - WwanRadioOn -} WWAN_RADIO, *PWWAN_RADIO; - -typedef struct _WWAN_RADIO_STATE { - WWAN_RADIO HwRadioState; - WWAN_RADIO SwRadioState; -} WWAN_RADIO_STATE, *PWWAN_RADIO_STATE; - -typedef enum _WWAN_PIN_TYPE { - WwanPinTypeNone = 0, - WwanPinTypeCustom, - WwanPinTypePin1, - WwanPinTypePin2, - WwanPinTypeDeviceSimPin, - WwanPinTypeDeviceFirstSimPin, - WwanPinTypeNetworkPin, - WwanPinTypeNetworkSubsetPin, - WwanPinTypeSvcProviderPin, - WwanPinTypeCorporatePin, - WwanPinTypeSubsidyLock, - WwanPinTypePuk1, - WwanPinTypePuk2, - WwanPinTypeDeviceFirstSimPuk, - WwanPinTypeNetworkPuk, - WwanPinTypeNetworkSubsetPuk, - WwanPinTypeSvcProviderPuk, - WwanPinTypeCorporatePuk, - WwanPinTypeMax -} WWAN_PIN_TYPE, *PWWAN_PIN_TYPE; - -typedef enum _WWAN_PIN_STATE { - WwanPinStateNone = 0, - WwanPinStateEnter, - WwanPinStateMax -} WWAN_PIN_STATE, *PWWAN_PIN_STATE; - -#define WWAN_ATTEMPTS_REMAINING_UNKNOWN ~0 - -typedef struct _WWAN_PIN_INFO { - WWAN_PIN_TYPE PinType; - WWAN_PIN_STATE PinState; - ULONG AttemptsRemaining; -} WWAN_PIN_INFO, *PWWAN_PIN_INFO; - -typedef enum _WWAN_PIN_OPERATION { - WwanPinOperationEnter = 0, - WwanPinOperationEnable, - WwanPinOperationDisable, - WwanPinOperationChange, - WwanPinOperationMax -} WWAN_PIN_OPERATION, *PWWAN_PIN_OPERATION; - -typedef struct _WWAN_PIN_ACTION { - WWAN_PIN_TYPE PinType; - WWAN_PIN_OPERATION PinOperation; - WCHAR Pin [WWAN_PIN_LEN]; - WCHAR NewPin [WWAN_PIN_LEN]; -} WWAN_PIN_ACTION, *PWWAN_PIN_ACTION; - -typedef enum _WWAN_PIN_FORMAT { - WwanPinFormatUnknown = 0, - WwanPinFormatNumeric, - WwanPinFormatAlphaNumeric, - WwanPinFormatMax -} WWAN_PIN_FORMAT, *PWWAN_PIN_FORMAT; - -typedef enum _WWAN_PIN_MODE { - WwanPinModeNotSupported = 0, - WwanPinModeEnabled, - WwanPinModeDisabled, - WwanPinModeMax -} WWAN_PIN_MODE, *PWWAN_PIN_MODE; - -#define WWAN_PIN_LENGTH_UNKNOWN ~0 - -typedef struct _WWAN_PIN_DESC { - WWAN_PIN_MODE PinMode; - WWAN_PIN_FORMAT PinFormat; - ULONG PinLengthMin; - ULONG PinLengthMax; -} WWAN_PIN_DESC, *PWWAN_PIN_DESC; - -typedef struct _WWAN_PIN_LIST { - WWAN_PIN_DESC WwanPinDescPin1; - WWAN_PIN_DESC WwanPinDescPin2; - WWAN_PIN_DESC WwanPinDescDeviceSimPin; - WWAN_PIN_DESC WwanPinDescDeviceFirstSimPin; - WWAN_PIN_DESC WwanPinDescNetworkPin; - WWAN_PIN_DESC WwanPinDescNetworkSubsetPin; - WWAN_PIN_DESC WwanPinDescSvcProviderPin; - WWAN_PIN_DESC WwanPinDescCorporatePin; - WWAN_PIN_DESC WwanPinDescSubsidyLock; - WWAN_PIN_DESC WwanPinDescCustom; -} WWAN_PIN_LIST, *PWWAN_PIN_LIST; - -#define WWAN_PROVIDER_STATE_UNKNOWN 0x00000000 -#define WWAN_PROVIDER_STATE_HOME 0x00000001 -#define WWAN_PROVIDER_STATE_FORBIDDEN 0x00000002 -#define WWAN_PROVIDER_STATE_PREFERRED 0x00000004 -#define WWAN_PROVIDER_STATE_VISIBLE 0x00000008 -#define WWAN_PROVIDER_STATE_REGISTERED 0x00000010 - -typedef struct _WWAN_PROVIDER { - WCHAR ProviderId [WWAN_PROVIDERID_LEN]; - ULONG ProviderState; - WCHAR ProviderName [WWAN_PROVIDERNAME_LEN]; - ULONG WwanDataClass; -} WWAN_PROVIDER, *PWWAN_PROVIDER; - -typedef enum _WWAN_REGISTER_ACTION { - WwanRegisterActionAutomatic = 0, - WwanRegisterActionManual, - WwanRegisterActionMax -} WWAN_REGISTER_ACTION, *PWWAN_REGISTER_ACTION; - -typedef struct _WWAN_SET_REGISTER_STATE { - WCHAR ProviderId [WWAN_PROVIDERID_LEN]; - WWAN_REGISTER_ACTION RegisterAction; - ULONG WwanDataClass; -} WWAN_SET_REGISTER_STATE, *PWWAN_SET_REGISTER_STATE; - -typedef enum _WWAN_REGISTER_STATE { - WwanRegisterStateUnknown = 0, - WwanRegisterStateDeregistered, - WwanRegisterStateSearching, - WwanRegisterStateHome, - WwanRegisterStateRoaming, - WwanRegisterStatePartner, - WwanRegisterStateDenied, - WwanRegisterStateMax -} WWAN_REGISTER_STATE, *PWWAN_REGISTER_STATE; - -typedef enum _WWAN_REGISTER_MODE { - WwanRegisterModeUnknown = 0, - WwanRegisterModeAutomatic, - WwanRegisterModeManual, - WwanRegisterModeMax -} WWAN_REGISTER_MODE, *PWWAN_REGISTER_MODE; - -typedef struct _WWAN_REGISTRATION_STATE { - ULONG uNwError; - WWAN_REGISTER_STATE RegisterState; - WWAN_REGISTER_MODE RegisterMode; - WCHAR ProviderId [WWAN_PROVIDERID_LEN]; - WCHAR ProviderName [WWAN_PROVIDERNAME_LEN]; - WCHAR RoamingText [WWAN_ROAMTEXT_LEN]; -} WWAN_REGISTRATION_STATE, *PWWAN_REGISTRATION_STATE; - -typedef enum _WWAN_PACKET_SERVICE_ACTION { - WwanPacketServiceActionAttach = 0, - WwanPacketServiceActionDetach -} WWAN_PACKET_SERVICE_ACTION, *PWWAN_PACKET_SERVICE_ACTION; - -typedef enum _WWAN_PACKET_SERVICE_STATE { - WwanPacketServiceStateUnknown = 0, - WwanPacketServiceStateAttaching, - WwanPacketServiceStateAttached, - WwanPacketServiceStateDetaching, - WwanPacketServiceStateDetached -} WWAN_PACKET_SERVICE_STATE, *PWWAN_PACKET_SERVICE_STATE; - -typedef struct _WWAN_PACKET_SERVICE { - ULONG uNwError; - WWAN_PACKET_SERVICE_STATE PacketServiceState; - ULONG AvailableDataClass; - ULONG CurrentDataClass; -} WWAN_PACKET_SERVICE, *PWWAN_PACKET_SERVICE; - -#define WWAN_RSSI_UNKNOWN 99 -#define WWAN_ERROR_RATE_UNKNOWN 99 - -typedef struct _WWAN_SIGNAL_STATE { - ULONG Rssi; - ULONG ErrorRate; - ULONG RssiInterval; - ULONG RssiThreshold; -} WWAN_SIGNAL_STATE, *PWWAN_SIGNAL_STATE; - -#define WWAN_RSSI_DEFAULT 0xffffffff -#define WWAN_RSSI_DISABLE 0 - -typedef struct _WWAN_SET_SIGNAL_INDICATION { - ULONG RssiInterval; - ULONG RssiThreshold; -} WWAN_SET_SIGNAL_INDICATION, *PWWAN_SET_SIGNAL_INDICATION; - -typedef enum _WWAN_ACTIVATION_COMMAND { - WwanActivationCommandDeactivate = 0, - WwanActivationCommandActivate, - WwanActivationCommandMax -} WWAN_ACTIVATION_COMMAND, *PWWAN_ACTIVATION_COMMAND; - -typedef enum _WWAN_COMPRESSION { - WwanCompressionNone = 0, - WwanCompressionEnable, - WwanCompressionMax -} WWAN_COMPRESSION, *PWWAN_COMPRESSION; - -typedef enum _WWAN_AUTH_PROTOCOL { - WwanAuthProtocolNone = 0, - WwanAuthProtocolPap, - WwanAuthProtocolChap, - WwanAuthProtocolMsChapV2, - WwanAuthProtocolMax -} WWAN_AUTH_PROTOCOL, *PWWAN_AUTH_PROTOCOL; - -typedef struct _WWAN_SET_CONTEXT_STATE { - ULONG ConnectionId; - WWAN_ACTIVATION_COMMAND ActivationCommand; - WCHAR AccessString [WWAN_ACCESSSTRING_LEN]; - WCHAR UserName [WWAN_USERNAME_LEN]; - WCHAR Password [WWAN_PASSWORD_LEN]; - WWAN_COMPRESSION Compression; - WWAN_AUTH_PROTOCOL AuthType; -} WWAN_SET_CONTEXT_STATE, *PWWAN_SET_CONTEXT_STATE; - -typedef enum _WWAN_ACTIVATION_STATE { - WwanActivationStateUnknown = 0, - WwanActivationStateActivated, - WwanActivationStateActivating, - WwanActivationStateDeactivated, - WwanActivationStateDeactivating, - WwanActivationStateMax -} WWAN_ACTIVATION_STATE, *PWWAN_ACTIVATION_STATE; - -typedef enum _WWAN_VOICE_CALL_STATE -{ - WwanVoiceCallStateNone = 0, - WwanVoiceCallStateInProgress, - WwanVoiceCallStateHangUp, - WwanVoiceCallStateMaximum -} WWAN_VOICE_CALL_STATE, *PWWAN_VOICE_CALL_STATE; - -typedef struct _WWAN_CONTEXT_STATE { - ULONG uNwError; - ULONG ConnectionId; - WWAN_ACTIVATION_STATE ActivationState; - WWAN_VOICE_CALL_STATE VoiceCallState; -} WWAN_CONTEXT_STATE, *PWWAN_CONTEXT_STATE; - -typedef enum _WWAN_CONTEXT_TYPE { - WwanContextTypeNone = 0, - WwanContextTypeInternet, - WwanContextTypeVpn, - WwanContextTypeVoice, - WwanContextTypeVideoShare, - WwanContextTypeCustom, - WwanContextTypeMax -} WWAN_CONTEXT_TYPE, *PWWAN_CONTEXT_TYPE; - -#define WWAN_CONTEXT_ID_APPEND 0xffffffff - -typedef struct _WWAN_CONTEXT { - ULONG ContextId; - WWAN_CONTEXT_TYPE ContextType; - WCHAR AccessString [WWAN_ACCESSSTRING_LEN]; - WCHAR UserName [WWAN_USERNAME_LEN]; - WCHAR Password [WWAN_PASSWORD_LEN]; - WWAN_COMPRESSION Compression; - WWAN_AUTH_PROTOCOL AuthType; -} WWAN_CONTEXT, *PWWAN_CONTEXT; - -typedef struct _WWAN_SET_CONTEXT -{ - ULONG ContextId; - WWAN_CONTEXT_TYPE ContextType; - WCHAR AccessString[WWAN_ACCESSSTRING_LEN]; - WCHAR UserName[WWAN_USERNAME_LEN]; - WCHAR Password[WWAN_PASSWORD_LEN]; - WWAN_COMPRESSION Compression; - WWAN_AUTH_PROTOCOL AuthType; - WCHAR ProviderId[WWAN_PROVIDERID_LEN]; -} WWAN_SET_CONTEXT, *PWWAN_SET_CONTEXT; - -typedef enum _WWAN_SMS_FORMAT { - WwanSmsFormatPdu = 0, - WwanSmsFormatReserved0, - WwanSmsFormatReserved1, - WwanSmsFormatReserved2, - WwanSmsFormatCdma, - WwanSmsFormatMax -} WWAN_SMS_FORMAT, *PWWAN_SMS_FORMAT; - -typedef struct _WWAN_SET_SMS_CONFIGURATION { - CHAR ScAddress [WWAN_SMS_ADDRESS_MAX_LEN]; - WWAN_SMS_FORMAT SmsFormat; -} WWAN_SET_SMS_CONFIGURATION, *PWWAN_SET_SMS_CONFIGURATION; - -typedef struct _WWAN_SMS_CONFIGURATION { - CHAR ScAddress [WWAN_SMS_ADDRESS_MAX_LEN]; - WWAN_SMS_FORMAT SmsFormat; - ULONG ulMaxMessageIndex; -} WWAN_SMS_CONFIGURATION, *PWWAN_SMS_CONFIGURATION; - -typedef enum _WWAN_SMS_FLAG { - WwanSmsFlagAll = 0, - WwanSmsFlagIndex, - WwanSmsFlagNew, - WwanSmsFlagOld, - WwanSmsFlagSent, - WwanSmsFlagDraft, - WwanSmsFlagMax -} WWAN_SMS_FLAG, *PWWAN_SMS_FLAG; - -#define WWAN_MESSAGE_INDEX_NONE 0 - -typedef struct _WWAN_SMS_FILTER { - WWAN_SMS_FLAG Flag; - ULONG MessageIndex; -} WWAN_SMS_FILTER, *PWWAN_SMS_FILTER; - -typedef struct _WWAN_SMS_READ { - WWAN_SMS_FORMAT SmsFormat; - WWAN_SMS_FILTER ReadFilter; -} WWAN_SMS_READ, *PWWAN_SMS_READ; - -typedef enum _WWAN_MSG_STATUS { - WwanMsgStatusNew = 0, - WwanMsgStatusOld, - WwanMsgStatusDraft, - WwanMsgStatusSent, - WwanMsgStatusMax -} WWAN_MSG_STATUS, *PWWAN_MSG_STATUS; - -typedef enum _WWAN_SMS_CDMA_LANG { - WwanSmsCdmaLangUnknown = 0, - WwanSmsCdmaLangEnglish, - WwanSmsCdmaLangFrench, - WwanSmsCdmaLangSpanish, - WwanSmsCdmaLangJapanese, - WwanSmsCdmaLangKorean, - WwanSmsCdmaLangChinese, - WwanSmsCdmaLangHebrew, - WwanSmsCdmaLangMax -} WWAN_SMS_CDMA_LANG, *PWWAN_SMS_CDMA_LANG; - -typedef enum _WWAN_SMS_CDMA_ENCODING { - WwanSmsCdmaEncodingOctet = 0, - WwanSmsCdmaEncodingEpm, - WwanSmsCdmaEncoding7BitAscii, - WwanSmsCdmaEncodingIa5, - WwanSmsCdmaEncodingUnicode, - WwanSmsCdmaEncodingShiftJis, - WwanSmsCdmaEncodingKorean, - WwanSmsCdmaEncodingLatinHebrew, - WwanSmsCdmaEncodingLatin, - WwanSmsCdmaEncodingGsm7Bit, - WwanSmsCdmaEncodingMax -} WWAN_SMS_CDMA_ENCODING, *PWWAN_SMS_CDMA_ENCODING; - -typedef struct _WWAN_SMS_CDMA_RECORD { - ULONG MessageIndex; - WWAN_MSG_STATUS MsgStatus; - CHAR Address[WWAN_SMS_CDMA_ADDR_MAX_LEN]; - CHAR ScTimeStamp[WWAN_SMS_CDMA_TIMESTAMP_MAX_LEN]; - WWAN_SMS_CDMA_ENCODING EncodingId; - WWAN_SMS_CDMA_LANG LanguageId; - USHORT SizeInBytes; - BYTE SizeInCharacters; - BYTE EncodedMsg [WWAN_SMS_CDMA_MAX_BUF_LEN]; -} WWAN_SMS_CDMA_RECORD, *PWWAN_SMS_CDMA_RECORD; - -typedef struct _WWAN_SMS_PDU_RECORD { - ULONG MessageIndex; - WWAN_MSG_STATUS MsgStatus; - BYTE Size; - CHAR PduData [WWAN_SMS_PDU_HEX_BUF_LEN]; -} WWAN_SMS_PDU_RECORD, *PWWAN_SMS_PDU_RECORD; - -typedef struct _WWAN_SMS_SEND_CDMA { - WWAN_SMS_CDMA_ENCODING EncodingId; - WWAN_SMS_CDMA_LANG LanguageId; - CHAR Address [WWAN_SMS_CDMA_ADDR_MAX_LEN]; - USHORT SizeInBytes; - BYTE SizeInCharacters; - BYTE EncodedMsg [WWAN_SMS_CDMA_MAX_BUF_LEN]; -} WWAN_SMS_SEND_CDMA, *PWWAN_SMS_SEND_CDMA; - -typedef struct _WWAN_SMS_SEND_PDU { - BYTE Size; - CHAR PduData [WWAN_SMS_PDU_HEX_BUF_LEN]; -} WWAN_SMS_SEND_PDU, *PWWAN_SMS_SEND_PDU; - -typedef struct _WWAN_SMS_SEND { - WWAN_SMS_FORMAT SmsFormat; - - union { - WWAN_SMS_SEND_PDU Pdu; - WWAN_SMS_SEND_CDMA Cdma; - } u; -} WWAN_SMS_SEND, *PWWAN_SMS_SEND; - -#define WWAN_SMS_FLAG_NONE 0x00000000 -#define WWAN_SMS_FLAG_MESSAGE_STORE_FULL 0x00000001 -#define WWAN_SMS_FLAG_NEW_MESSAGE 0x00000002 - -typedef struct _WWAN_SMS_STATUS { - ULONG uFlag; - ULONG MessageIndex; -} WWAN_SMS_STATUS, *PWWAN_SMS_STATUS; - -typedef struct _WWAN_SERVICE_ACTIVATION_STATUS { - ULONG uNwError; - ULONG uVendorSpecificBufferSize; -} WWAN_SERVICE_ACTIVATION_STATUS,*PWWAN_SERVICE_ACTIVATION_STATUS; - -typedef struct _WWAN_VENDOR_SPECIFIC { - ULONG uVendorSpecificBufferSize; -} WWAN_VENDOR_SPECIFIC, *PWWAN_VENDOR_SPECIFIC; - -#endif - diff --git a/qt-correction-tool/pub/ddk/xfilter.h b/qt-correction-tool/pub/ddk/xfilter.h deleted file mode 100644 index dc25086..0000000 --- a/qt-correction-tool/pub/ddk/xfilter.h +++ /dev/null @@ -1,269 +0,0 @@ -/*++ - -Copyright (c) Microsoft Corporation. All rights reserved. - -Module Name: - - xfilter.h - -Abstract: - - Header file for the address filtering library for NDIS MAC's. - -Author: - -Environment: - -Notes: - - None. - -Revision History: - ---*/ - -#ifndef _X_FILTER_DEFS_ -#define _X_FILTER_DEFS_ - -#pragma once - -#define ETH_LENGTH_OF_ADDRESS 6 - - -// -// ZZZ This is a little-endian specific check. -// -#define ETH_IS_MULTICAST(Address) \ - (BOOLEAN)(((PUCHAR)(Address))[0] & ((UCHAR)0x01)) - - -// -// Check whether an address is broadcast. -// -#define ETH_IS_BROADCAST(Address) \ - ((((PUCHAR)(Address))[0] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[1] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[2] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[3] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[4] == ((UCHAR)0xff)) && (((PUCHAR)(Address))[5] == ((UCHAR)0xff))) - - -// -// This macro will compare network addresses. -// -// A - Is a network address. -// -// B - Is a network address. -// -// Result - The result of comparing two network address. -// -// Result < 0 Implies the B address is greater. -// Result > 0 Implies the A element is greater. -// Result = 0 Implies equality. -// -// Note that this is an arbitrary ordering. There is not -// defined relation on network addresses. This is ad-hoc! -// -// -#define ETH_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ -{ \ - if (*(ULONG UNALIGNED *)&(_A)[2] > \ - *(ULONG UNALIGNED *)&(_B)[2]) \ - { \ - *(_Result) = 1; \ - } \ - else if (*(ULONG UNALIGNED *)&(_A)[2] < \ - *(ULONG UNALIGNED *)&(_B)[2]) \ - { \ - *(_Result) = (UINT)-1; \ - } \ - else if (*(USHORT UNALIGNED *)(_A) > \ - *(USHORT UNALIGNED *)(_B)) \ - { \ - *(_Result) = 1; \ - } \ - else if (*(USHORT UNALIGNED *)(_A) < \ - *(USHORT UNALIGNED *)(_B)) \ - { \ - *(_Result) = (UINT)-1; \ - } \ - else \ - { \ - *(_Result) = 0; \ - } \ -} - -// -// This macro will compare network addresses. -// -// A - Is a network address. -// -// B - Is a network address. -// -// Result - The result of comparing two network address. -// -// Result != 0 Implies inequality. -// Result == 0 Implies equality. -// -// -#define ETH_COMPARE_NETWORK_ADDRESSES_EQ(_A,_B, _Result) \ -{ \ - if ((*(ULONG UNALIGNED *)&(_A)[2] == \ - *(ULONG UNALIGNED *)&(_B)[2]) && \ - (*(USHORT UNALIGNED *)(_A) == \ - *(USHORT UNALIGNED *)(_B))) \ - { \ - *(_Result) = 0; \ - } \ - else \ - { \ - *(_Result) = 1; \ - } \ -} - - -// -// This macro is used to copy from one network address to -// another. -// -#define ETH_COPY_NETWORK_ADDRESS(_D, _S) \ -{ \ - *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ - *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ -} - -#define TR_LENGTH_OF_FUNCTIONAL 4 -#define TR_LENGTH_OF_ADDRESS 6 - - -// -// Only the low 32 bits of the functional/group address -// are needed since the upper 16 bits is always c0-00. -// -typedef ULONG TR_FUNCTIONAL_ADDRESS; -typedef ULONG TR_GROUP_ADDRESS; - - -#define TR_IS_NOT_DIRECTED(_Address, _Result) \ -{ \ - *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ -} - -#define TR_IS_FUNCTIONAL(_Address, _Result) \ -{ \ - *(_Result) = (BOOLEAN)(((_Address)[0] & 0x80) && \ - !((_Address)[2] & 0x80)); \ -} - -// -// -#define TR_IS_GROUP(_Address, _Result) \ -{ \ - *(_Result) = (BOOLEAN)((_Address)[0] & (_Address)[2] & 0x80); \ -} - -// -// -#define TR_IS_SOURCE_ROUTING(_Address, _Result) \ -{ \ - *(_Result) = (BOOLEAN)((_Address)[0] & 0x80); \ -} - -// -// Check for NDIS_PACKET_TYPE_MAC_FRAME -// -#define TR_IS_MAC_FRAME(_PacketHeader) ((((PUCHAR)_PacketHeader)[1] & 0xFC) == 0) - - -// -// Check whether an address is broadcast. This is a little-endian check. -// -#define TR_IS_BROADCAST(_Address, _Result) \ -{ \ - *(_Result) = (BOOLEAN)(((*(UNALIGNED USHORT *)&(_Address)[0] == 0xFFFF) || \ - (*(UNALIGNED USHORT *)&(_Address)[0] == 0x00C0)) && \ - (*(UNALIGNED ULONG *)&(_Address)[2] == 0xFFFFFFFF));\ -} - - -// -// This macro will compare network addresses. -// -// A - Is a network address. -// -// B - Is a network address. -// -// Result - The result of comparing two network address. -// -// Result < 0 Implies the B address is greater. -// Result > 0 Implies the A element is greater. -// Result = 0 Implies equality. -// -// Note that this is an arbitrary ordering. There is not -// defined relation on network addresses. This is ad-hoc! -// -// -#define TR_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \ -{ \ - if (*(ULONG UNALIGNED *)&(_A)[2] > \ - *(ULONG UNALIGNED *)&(_B)[2]) \ - { \ - *(_Result) = 1; \ - } \ - else if (*(ULONG UNALIGNED *)&(_A)[2] < \ - *(ULONG UNALIGNED *)&(_B)[2]) \ - { \ - *(_Result) = (UINT)-1; \ - } \ - else if (*(USHORT UNALIGNED *)(_A) > \ - *(USHORT UNALIGNED *)(_B)) \ - { \ - *(_Result) = 1; \ - } \ - else if (*(USHORT UNALIGNED *)(_A) < \ - *(USHORT UNALIGNED *)(_B)) \ - { \ - *(_Result) = (UINT)-1; \ - } \ - else \ - { \ - *(_Result) = 0; \ - } \ -} - -// -// This macro will compare network addresses. -// -// A - Is a network address. -// -// B - Is a network address. -// -// Result - The result of comparing two network address. -// -// Result != 0 Implies inequality. -// Result == 0 Implies equality. -// -// -#define TR_COMPARE_NETWORK_ADDRESSES_EQ(_A, _B, _Result) \ -{ \ - if ((*(ULONG UNALIGNED *)&(_A)[2] == *(ULONG UNALIGNED *)&(_B)[2]) && \ - (*(USHORT UNALIGNED *)&(_A)[0] == *(USHORT UNALIGNED *)&(_B)[0])) \ - { \ - *(_Result) = 0; \ - } \ - else \ - { \ - *(_Result) = 1; \ - } \ -} - - -// -// This macro is used to copy from one network address to -// another. -// -#define TR_COPY_NETWORK_ADDRESS(_D, _S) \ -{ \ - *((ULONG UNALIGNED *)(_D)) = *((ULONG UNALIGNED *)(_S)); \ - *((USHORT UNALIGNED *)((UCHAR *)(_D)+4)) = \ - *((USHORT UNALIGNED *)((UCHAR *)(_S)+4)); \ -} - -#endif // _X_FILTER_DEFS_ - diff --git a/qt-correction-tool/pub/ddk/xpsrassvc.h b/qt-correction-tool/pub/ddk/xpsrassvc.h deleted file mode 100644 index 85fabdd..0000000 --- a/qt-correction-tool/pub/ddk/xpsrassvc.h +++ /dev/null @@ -1,379 +0,0 @@ - - -/* this ALWAYS GENERATED file contains the definitions for the interfaces */ - - - /* File created by MIDL compiler version 7.00.0555 */ -/* Compiler settings for xpsrassvc.idl: - Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 7.00.0555 - protocol : dce , ms_ext, c_ext, robust - error checks: allocation ref bounds_check enum stub_data - VC __declspec() decoration level: - __declspec(uuid()), __declspec(selectany), __declspec(novtable) - DECLSPEC_UUID(), MIDL_INTERFACE() -*/ -/* @@MIDL_FILE_HEADING( ) */ - -#pragma warning( disable: 4049 ) /* more than 64k source lines */ - - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCNDR_H_VERSION__ -#define __REQUIRED_RPCNDR_H_VERSION__ 500 -#endif - -/* verify that the version is high enough to compile this file*/ -#ifndef __REQUIRED_RPCSAL_H_VERSION__ -#define __REQUIRED_RPCSAL_H_VERSION__ 100 -#endif - -#include "rpc.h" -#include "rpcndr.h" - -#ifndef __RPCNDR_H_VERSION__ -#error this stub requires an updated version of -#endif // __RPCNDR_H_VERSION__ - -#ifndef COM_NO_WINDOWS_H -#include "windows.h" -#include "ole2.h" -#endif /*COM_NO_WINDOWS_H*/ - -#ifndef __xpsrassvc_h__ -#define __xpsrassvc_h__ - -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -#pragma once -#endif - -/* Forward Declarations */ - -#ifndef __IXpsRasterizerNotificationCallback_FWD_DEFINED__ -#define __IXpsRasterizerNotificationCallback_FWD_DEFINED__ -typedef interface IXpsRasterizerNotificationCallback IXpsRasterizerNotificationCallback; -#endif /* __IXpsRasterizerNotificationCallback_FWD_DEFINED__ */ - - -#ifndef __IXpsRasterizer_FWD_DEFINED__ -#define __IXpsRasterizer_FWD_DEFINED__ -typedef interface IXpsRasterizer IXpsRasterizer; -#endif /* __IXpsRasterizer_FWD_DEFINED__ */ - - -#ifndef __IXpsRasterizationFactory_FWD_DEFINED__ -#define __IXpsRasterizationFactory_FWD_DEFINED__ -typedef interface IXpsRasterizationFactory IXpsRasterizationFactory; -#endif /* __IXpsRasterizationFactory_FWD_DEFINED__ */ - - -/* header files for imported files */ -#include "wincodec.h" -#include "XpsObjectModel.h" - -#ifdef __cplusplus -extern "C"{ -#endif - - -/* interface __MIDL_itf_xpsrassvc_0000_0000 */ -/* [local] */ - -//+-------------------------------------------------------------------------- -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// -//---------------------------------------------------------------------------- - - -extern RPC_IF_HANDLE __MIDL_itf_xpsrassvc_0000_0000_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_xpsrassvc_0000_0000_v0_0_s_ifspec; - -#ifndef __IXpsRasterizerNotificationCallback_INTERFACE_DEFINED__ -#define __IXpsRasterizerNotificationCallback_INTERFACE_DEFINED__ - -/* interface IXpsRasterizerNotificationCallback */ -/* [ref][helpstring][nonextensible][uuid][object] */ - - -EXTERN_C const IID IID_IXpsRasterizerNotificationCallback; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("9AB8FD0D-CB94-49c2-9CB0-97EC1D5469D2") - IXpsRasterizerNotificationCallback : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE Continue( void) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsRasterizerNotificationCallbackVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IXpsRasterizerNotificationCallback * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IXpsRasterizerNotificationCallback * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IXpsRasterizerNotificationCallback * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *Continue )( - __RPC__in IXpsRasterizerNotificationCallback * This); - - END_INTERFACE - } IXpsRasterizerNotificationCallbackVtbl; - - interface IXpsRasterizerNotificationCallback - { - CONST_VTBL struct IXpsRasterizerNotificationCallbackVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsRasterizerNotificationCallback_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsRasterizerNotificationCallback_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsRasterizerNotificationCallback_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsRasterizerNotificationCallback_Continue(This) \ - ( (This)->lpVtbl -> Continue(This) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsRasterizerNotificationCallback_INTERFACE_DEFINED__ */ - - -/* interface __MIDL_itf_xpsrassvc_0000_0001 */ -/* [local] */ - -typedef /* [public][public][public] */ -enum __MIDL___MIDL_itf_xpsrassvc_0000_0001_0001 - { XPSRAS_RENDERING_MODE_ANTIALIASED = 0, - XPSRAS_RENDERING_MODE_ALIASED = 1 - } XPSRAS_RENDERING_MODE; - - - -extern RPC_IF_HANDLE __MIDL_itf_xpsrassvc_0000_0001_v0_0_c_ifspec; -extern RPC_IF_HANDLE __MIDL_itf_xpsrassvc_0000_0001_v0_0_s_ifspec; - -#ifndef __IXpsRasterizer_INTERFACE_DEFINED__ -#define __IXpsRasterizer_INTERFACE_DEFINED__ - -/* interface IXpsRasterizer */ -/* [ref][helpstring][nonextensible][uuid][object] */ - - -EXTERN_C const IID IID_IXpsRasterizer; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("7567CFC8-C156-47a8-9DAC-11A2AE5BDD6B") - IXpsRasterizer : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE RasterizeRect( - /* [in] */ INT x, - /* [in] */ INT y, - /* [in] */ INT width, - /* [in] */ INT height, - /* [in] */ __RPC__in_opt IXpsRasterizerNotificationCallback *notificationCallback, - /* [out] */ __RPC__deref_out_opt IWICBitmap **bitmap) = 0; - - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE SetMinimalLineWidth( - /* [in] */ INT width) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsRasterizerVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IXpsRasterizer * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IXpsRasterizer * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IXpsRasterizer * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *RasterizeRect )( - __RPC__in IXpsRasterizer * This, - /* [in] */ INT x, - /* [in] */ INT y, - /* [in] */ INT width, - /* [in] */ INT height, - /* [in] */ __RPC__in_opt IXpsRasterizerNotificationCallback *notificationCallback, - /* [out] */ __RPC__deref_out_opt IWICBitmap **bitmap); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *SetMinimalLineWidth )( - __RPC__in IXpsRasterizer * This, - /* [in] */ INT width); - - END_INTERFACE - } IXpsRasterizerVtbl; - - interface IXpsRasterizer - { - CONST_VTBL struct IXpsRasterizerVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsRasterizer_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsRasterizer_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsRasterizer_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsRasterizer_RasterizeRect(This,x,y,width,height,notificationCallback,bitmap) \ - ( (This)->lpVtbl -> RasterizeRect(This,x,y,width,height,notificationCallback,bitmap) ) - -#define IXpsRasterizer_SetMinimalLineWidth(This,width) \ - ( (This)->lpVtbl -> SetMinimalLineWidth(This,width) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsRasterizer_INTERFACE_DEFINED__ */ - - -#ifndef __IXpsRasterizationFactory_INTERFACE_DEFINED__ -#define __IXpsRasterizationFactory_INTERFACE_DEFINED__ - -/* interface IXpsRasterizationFactory */ -/* [ref][helpstring][nonextensible][uuid][object] */ - - -EXTERN_C const IID IID_IXpsRasterizationFactory; - -#if defined(__cplusplus) && !defined(CINTERFACE) - - MIDL_INTERFACE("E094808A-24C6-482b-A3A7-C21AC9B55F17") - IXpsRasterizationFactory : public IUnknown - { - public: - virtual /* [helpstring] */ HRESULT STDMETHODCALLTYPE CreateRasterizer( - /* [in] */ __RPC__in_opt IXpsOMPage *xpsPage, - /* [in] */ FLOAT DPI, - /* [in] */ XPSRAS_RENDERING_MODE nonTextRenderingMode, - /* [in] */ XPSRAS_RENDERING_MODE textRenderingMode, - /* [out] */ __RPC__deref_out_opt IXpsRasterizer **ppIXPSRasterizer) = 0; - - }; - -#else /* C style interface */ - - typedef struct IXpsRasterizationFactoryVtbl - { - BEGIN_INTERFACE - - HRESULT ( STDMETHODCALLTYPE *QueryInterface )( - __RPC__in IXpsRasterizationFactory * This, - /* [in] */ __RPC__in REFIID riid, - /* [annotation][iid_is][out] */ - __RPC__deref_out void **ppvObject); - - ULONG ( STDMETHODCALLTYPE *AddRef )( - __RPC__in IXpsRasterizationFactory * This); - - ULONG ( STDMETHODCALLTYPE *Release )( - __RPC__in IXpsRasterizationFactory * This); - - /* [helpstring] */ HRESULT ( STDMETHODCALLTYPE *CreateRasterizer )( - __RPC__in IXpsRasterizationFactory * This, - /* [in] */ __RPC__in_opt IXpsOMPage *xpsPage, - /* [in] */ FLOAT DPI, - /* [in] */ XPSRAS_RENDERING_MODE nonTextRenderingMode, - /* [in] */ XPSRAS_RENDERING_MODE textRenderingMode, - /* [out] */ __RPC__deref_out_opt IXpsRasterizer **ppIXPSRasterizer); - - END_INTERFACE - } IXpsRasterizationFactoryVtbl; - - interface IXpsRasterizationFactory - { - CONST_VTBL struct IXpsRasterizationFactoryVtbl *lpVtbl; - }; - - - -#ifdef COBJMACROS - - -#define IXpsRasterizationFactory_QueryInterface(This,riid,ppvObject) \ - ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) ) - -#define IXpsRasterizationFactory_AddRef(This) \ - ( (This)->lpVtbl -> AddRef(This) ) - -#define IXpsRasterizationFactory_Release(This) \ - ( (This)->lpVtbl -> Release(This) ) - - -#define IXpsRasterizationFactory_CreateRasterizer(This,xpsPage,DPI,nonTextRenderingMode,textRenderingMode,ppIXPSRasterizer) \ - ( (This)->lpVtbl -> CreateRasterizer(This,xpsPage,DPI,nonTextRenderingMode,textRenderingMode,ppIXPSRasterizer) ) - -#endif /* COBJMACROS */ - - -#endif /* C style interface */ - - - - -#endif /* __IXpsRasterizationFactory_INTERFACE_DEFINED__ */ - - -/* Additional Prototypes for ALL interfaces */ - -/* end of Additional Prototypes */ - -#ifdef __cplusplus -} -#endif - -#endif - - - diff --git a/qt-correction-tool/pub/external/include/CJsonObject.hpp b/qt-correction-tool/pub/external/include/CJsonObject.hpp deleted file mode 100644 index 0b53913..0000000 --- a/qt-correction-tool/pub/external/include/CJsonObject.hpp +++ /dev/null @@ -1,159 +0,0 @@ -/******************************************************************************* - * Project: neb - * @file CJsonObject.hpp - * @brief Json - * @author bwarliao - * @date: 2014-7-16 - * @note - * Modify history: - ******************************************************************************/ - -#ifndef CJSONOBJECT_HPP_ -#define CJSONOBJECT_HPP_ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" -{ -#endif -typedef struct cJSON cJSON; - -#ifdef __cplusplus -} -#endif - - -#ifdef JSONOBJECT_EXPORTS -#define DLL_EXPORT_IMPORT __declspec(dllexport) -#else -#define DLL_EXPORT_IMPORT __declspec(dllimport) -#endif - -namespace neb -{ -typedef int int32; -typedef unsigned int uint32; -typedef long long int64; -typedef unsigned long long uint64; - -class DLL_EXPORT_IMPORT CJsonObject -{ -public: // method of ordinary json object or json array - CJsonObject(); - CJsonObject(const std::string& strJson); - CJsonObject(const CJsonObject* pJsonObject); - CJsonObject(const CJsonObject& oJsonObject); - virtual ~CJsonObject(); - - CJsonObject& operator=(const CJsonObject& oJsonObject); - bool operator==(const CJsonObject& oJsonObject) const; - bool Parse(const std::string& strJson); - void Clear(); - bool IsEmpty() const; - bool IsArray() const; - std::string ToString() const; - std::string ToFormattedString() const; - const std::string& GetErrMsg() const - { - return(m_strErrMsg); - } - -public: // method of ordinary json object - bool AddEmptySubObject(const std::string& strKey); - bool AddEmptySubArray(const std::string& strKey); - CJsonObject& operator[](const std::string& strKey); - std::string operator()(const std::string& strKey) const; - bool Get(const std::string& strKey, CJsonObject& oJsonObject) const; - bool Get(const std::string& strKey, std::string& strValue) const; - bool Get(const std::string& strKey, int32& iValue) const; - bool Get(const std::string& strKey, uint32& uiValue) const; - bool Get(const std::string& strKey, int64& llValue) const; - bool Get(const std::string& strKey, uint64& ullValue) const; - bool Get(const std::string& strKey, bool& bValue) const; - bool Get(const std::string& strKey, float& fValue) const; - bool Get(const std::string& strKey, double& dValue) const; - bool Add(const std::string& strKey, const CJsonObject& oJsonObject); - bool Add(const std::string& strKey, const std::string& strValue); - bool Add(const std::string& strKey, int32 iValue); - bool Add(const std::string& strKey, uint32 uiValue); - bool Add(const std::string& strKey, int64 llValue); - bool Add(const std::string& strKey, uint64 ullValue); - bool Add(const std::string& strKey, bool bValue, bool bValueAgain); - bool Add(const std::string& strKey, float fValue); - bool Add(const std::string& strKey, double dValue); - bool Delete(const std::string& strKey); - bool Replace(const std::string& strKey, const CJsonObject& oJsonObject); - bool Replace(const std::string& strKey, const std::string& strValue); - bool Replace(const std::string& strKey, int32 iValue); - bool Replace(const std::string& strKey, uint32 uiValue); - bool Replace(const std::string& strKey, int64 llValue); - bool Replace(const std::string& strKey, uint64 ullValue); - bool Replace(const std::string& strKey, bool bValue, bool bValueAgain); - bool Replace(const std::string& strKey, float fValue); - bool Replace(const std::string& strKey, double dValue); - -public: // method of json array - int GetArraySize(); - CJsonObject& operator[](unsigned int uiWhich); - std::string operator()(unsigned int uiWhich) const; - bool Get(int iWhich, CJsonObject& oJsonObject) const; - bool Get(int iWhich, std::string& strValue) const; - bool Get(int iWhich, int32& iValue) const; - bool Get(int iWhich, uint32& uiValue) const; - bool Get(int iWhich, int64& llValue) const; - bool Get(int iWhich, uint64& ullValue) const; - bool Get(int iWhich, bool& bValue) const; - bool Get(int iWhich, float& fValue) const; - bool Get(int iWhich, double& dValue) const; - bool Add(const CJsonObject& oJsonObject); - bool Add(const std::string& strValue); - bool Add(int32 iValue); - bool Add(uint32 uiValue); - bool Add(int64 llValue); - bool Add(uint64 ullValue); - bool Add(int iAnywhere, bool bValue); - bool Add(float fValue); - bool Add(double dValue); - bool AddAsFirst(const CJsonObject& oJsonObject); - bool AddAsFirst(const std::string& strValue); - bool AddAsFirst(int32 iValue); - bool AddAsFirst(uint32 uiValue); - bool AddAsFirst(int64 llValue); - bool AddAsFirst(uint64 ullValue); - bool AddAsFirst(int iAnywhere, bool bValue); - bool AddAsFirst(float fValue); - bool AddAsFirst(double dValue); - bool Delete(int iWhich); - bool Replace(int iWhich, const CJsonObject& oJsonObject); - bool Replace(int iWhich, const std::string& strValue); - bool Replace(int iWhich, int32 iValue); - bool Replace(int iWhich, uint32 uiValue); - bool Replace(int iWhich, int64 llValue); - bool Replace(int iWhich, uint64 ullValue); - bool Replace(int iWhich, bool bValue, bool bValueAgain); - bool Replace(int iWhich, float fValue); - bool Replace(int iWhich, double dValue); - -private: - CJsonObject(cJSON* pJsonData); - -private: - cJSON* m_pJsonData; - cJSON* m_pExternJsonDataRef; - std::string m_strErrMsg; - std::map m_mapJsonArrayRef; - std::map m_mapJsonObjectRef; -}; - -} - -#endif /* CJSONHELPER_HPP_ */ diff --git a/qt-correction-tool/pub/external/include/FreeImage.h b/qt-correction-tool/pub/external/include/FreeImage.h deleted file mode 100644 index f10aea6..0000000 --- a/qt-correction-tool/pub/external/include/FreeImage.h +++ /dev/null @@ -1,1090 +0,0 @@ -// ========================================================== -// FreeImage 3 -// -// Design and implementation by -// - Floris van den Berg (flvdberg@wxs.nl) -// - Herv?Drolon (drolon@infonie.fr) -// -// Contributors: -// - Adam Gates (radad@xoasis.com) -// - Alex Kwak -// - Alexander Dymerets (sashad@te.net.ua) -// - Detlev Vendt (detlev.vendt@brillit.de) -// - Jan L. Nauta (jln@magentammt.com) -// - Jani Kajala (janik@remedy.fi) -// - Juergen Riecker (j.riecker@gmx.de) -// - Karl-Heinz Bussian (khbussian@moss.de) -// - Laurent Rocher (rocherl@club-internet.fr) -// - Luca Piergentili (l.pierge@terra.es) -// - Machiel ten Brinke (brinkem@uni-one.nl) -// - Markus Loibl (markus.loibl@epost.de) -// - Martin Weber (martweb@gmx.net) -// - Matthias Wandel (mwandel@rim.net) -// - Michal Novotny (michal@etc.cz) -// - Petr Pytelka (pyta@lightcomp.com) -// - Riley McNiff (rmcniff@marexgroup.com) -// - Ryan Rubley (ryan@lostreality.org) -// - Volker Grtner (volkerg@gmx.at) -// -// This file is part of FreeImage 3 -// -// COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY -// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES -// THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE -// OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED -// CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT -// THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY -// SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL -// PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER -// THIS DISCLAIMER. -// -// Use at your own risk! -// ========================================================== - -#ifndef FREEIMAGE_H -#define FREEIMAGE_H - -// Version information ------------------------------------------------------ - -#define FREEIMAGE_MAJOR_VERSION 3 -#define FREEIMAGE_MINOR_VERSION 13 -#define FREEIMAGE_RELEASE_SERIAL 1 - -// Compiler options --------------------------------------------------------- - -#include // needed for UNICODE functions - -#if defined(FREEIMAGE_LIB) - #define DLL_API - #define DLL_CALLCONV -#else - #if defined(_WIN32) || defined(__WIN32__) - #define DLL_CALLCONV __stdcall - // The following ifdef block is the standard way of creating macros which make exporting - // from a DLL simpler. All files within this DLL are compiled with the FREEIMAGE_EXPORTS - // symbol defined on the command line. this symbol should not be defined on any project - // that uses this DLL. This way any other project whose source files include this file see - // DLL_API functions as being imported from a DLL, wheras this DLL sees symbols - // defined with this macro as being exported. - #ifdef FREEIMAGE_EXPORTS - #define DLL_API __declspec(dllexport) - #else - #define DLL_API __declspec(dllimport) - #endif // FREEIMAGE_EXPORTS - #else - // try the gcc visibility support (see http://gcc.gnu.org/wiki/Visibility) - #if defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) - #ifndef GCC_HASCLASSVISIBILITY - #define GCC_HASCLASSVISIBILITY - #endif - #endif // __GNUC__ - #define DLL_CALLCONV - #if defined(GCC_HASCLASSVISIBILITY) - #define DLL_API __attribute__ ((visibility("default"))) - #else - #define DLL_API - #endif - #endif // WIN32 / !WIN32 -#endif // FREEIMAGE_LIB - -// Some versions of gcc may have BYTE_ORDER or __BYTE_ORDER defined -// If your big endian system isn't being detected, add an OS specific check -#if (defined(BYTE_ORDER) && BYTE_ORDER==BIG_ENDIAN) || \ - (defined(__BYTE_ORDER) && __BYTE_ORDER==__BIG_ENDIAN) || \ - defined(__BIG_ENDIAN__) -#define FREEIMAGE_BIGENDIAN -#endif // BYTE_ORDER - -// This really only affects 24 and 32 bit formats, the rest are always RGB order. -#define FREEIMAGE_COLORORDER_BGR 0 -#define FREEIMAGE_COLORORDER_RGB 1 -#if defined(FREEIMAGE_BIGENDIAN) -#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_RGB -#else -#define FREEIMAGE_COLORORDER FREEIMAGE_COLORORDER_BGR -#endif - -// Ensure 4-byte enums if we're using Borland C++ compilers -#if defined(__BORLANDC__) -#pragma option push -b -#endif - -// For C compatibility -------------------------------------------------------- - -#ifdef __cplusplus -#define FI_DEFAULT(x) = x -#define FI_ENUM(x) enum x -#define FI_STRUCT(x) struct x -#else -#define FI_DEFAULT(x) -#define FI_ENUM(x) typedef int x; enum x -#define FI_STRUCT(x) typedef struct x x; struct x -#endif - -// Bitmap types ------------------------------------------------------------- - -FI_STRUCT (FIBITMAP) { void *data; }; -FI_STRUCT (FIMULTIBITMAP) { void *data; }; - -// Types used in the library (directly copied from Windows) ----------------- - -#if defined(__MINGW32__) && defined(_WINDOWS_H) -#define _WINDOWS_ // prevent a bug in MinGW32 -#endif // __MINGW32__ - -#ifndef _WINDOWS_ -#define _WINDOWS_ - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE 1 -#endif -#ifndef NULL -#define NULL 0 -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 -#define SEEK_CUR 1 -#define SEEK_END 2 -#endif - -#ifndef _MSC_VER -// define portable types for 32-bit / 64-bit OS -#include -typedef int32_t BOOL; -typedef uint8_t BYTE; -typedef uint16_t WORD; -typedef uint32_t DWORD; -typedef int32_t LONG; -#else -// MS is not C99 ISO compliant -typedef long BOOL; -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned long DWORD; -typedef long LONG; -#endif // _MSC_VER - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(push, 1) -#else -#pragma pack(1) -#endif // WIN32 - -typedef struct tagRGBQUAD { -#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR - BYTE rgbBlue; - BYTE rgbGreen; - BYTE rgbRed; -#else - BYTE rgbRed; - BYTE rgbGreen; - BYTE rgbBlue; -#endif // FREEIMAGE_COLORORDER - BYTE rgbReserved; -} RGBQUAD; - -typedef struct tagRGBTRIPLE { -#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR - BYTE rgbtBlue; - BYTE rgbtGreen; - BYTE rgbtRed; -#else - BYTE rgbtRed; - BYTE rgbtGreen; - BYTE rgbtBlue; -#endif // FREEIMAGE_COLORORDER -} RGBTRIPLE; - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(pop) -#else -#pragma pack() -#endif // WIN32 - -typedef struct tagBITMAPINFOHEADER{ - DWORD biSize; - LONG biWidth; - LONG biHeight; - WORD biPlanes; - WORD biBitCount; - DWORD biCompression; - DWORD biSizeImage; - LONG biXPelsPerMeter; - LONG biYPelsPerMeter; - DWORD biClrUsed; - DWORD biClrImportant; -} BITMAPINFOHEADER, *PBITMAPINFOHEADER; - -typedef struct tagBITMAPINFO { - BITMAPINFOHEADER bmiHeader; - RGBQUAD bmiColors[1]; -} BITMAPINFO, *PBITMAPINFO; - -#endif // _WINDOWS_ - -// Types used in the library (specific to FreeImage) ------------------------ - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(push, 1) -#else -#pragma pack(1) -#endif // WIN32 - -/** 48-bit RGB -*/ -typedef struct tagFIRGB16 { - WORD red; - WORD green; - WORD blue; -} FIRGB16; - -/** 64-bit RGBA -*/ -typedef struct tagFIRGBA16 { - WORD red; - WORD green; - WORD blue; - WORD alpha; -} FIRGBA16; - -/** 96-bit RGB Float -*/ -typedef struct tagFIRGBF { - float red; - float green; - float blue; -} FIRGBF; - -/** 128-bit RGBA Float -*/ -typedef struct tagFIRGBAF { - float red; - float green; - float blue; - float alpha; -} FIRGBAF; - -/** Data structure for COMPLEX type (complex number) -*/ -typedef struct tagFICOMPLEX { - /// real part - double r; - /// imaginary part - double i; -} FICOMPLEX; - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(pop) -#else -#pragma pack() -#endif // WIN32 - -// Indexes for byte arrays, masks and shifts for treating pixels as words --- -// These coincide with the order of RGBQUAD and RGBTRIPLE ------------------- - -#ifndef FREEIMAGE_BIGENDIAN -#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR -// Little Endian (x86 / MS Windows, Linux) : BGR(A) order -#define FI_RGBA_RED 2 -#define FI_RGBA_GREEN 1 -#define FI_RGBA_BLUE 0 -#define FI_RGBA_ALPHA 3 -#define FI_RGBA_RED_MASK 0x00FF0000 -#define FI_RGBA_GREEN_MASK 0x0000FF00 -#define FI_RGBA_BLUE_MASK 0x000000FF -#define FI_RGBA_ALPHA_MASK 0xFF000000 -#define FI_RGBA_RED_SHIFT 16 -#define FI_RGBA_GREEN_SHIFT 8 -#define FI_RGBA_BLUE_SHIFT 0 -#define FI_RGBA_ALPHA_SHIFT 24 -#else -// Little Endian (x86 / MaxOSX) : RGB(A) order -#define FI_RGBA_RED 0 -#define FI_RGBA_GREEN 1 -#define FI_RGBA_BLUE 2 -#define FI_RGBA_ALPHA 3 -#define FI_RGBA_RED_MASK 0x000000FF -#define FI_RGBA_GREEN_MASK 0x0000FF00 -#define FI_RGBA_BLUE_MASK 0x00FF0000 -#define FI_RGBA_ALPHA_MASK 0xFF000000 -#define FI_RGBA_RED_SHIFT 0 -#define FI_RGBA_GREEN_SHIFT 8 -#define FI_RGBA_BLUE_SHIFT 16 -#define FI_RGBA_ALPHA_SHIFT 24 -#endif // FREEIMAGE_COLORORDER -#else -#if FREEIMAGE_COLORORDER == FREEIMAGE_COLORORDER_BGR -// Big Endian (PPC / none) : BGR(A) order -#define FI_RGBA_RED 2 -#define FI_RGBA_GREEN 1 -#define FI_RGBA_BLUE 0 -#define FI_RGBA_ALPHA 3 -#define FI_RGBA_RED_MASK 0x0000FF00 -#define FI_RGBA_GREEN_MASK 0x00FF0000 -#define FI_RGBA_BLUE_MASK 0xFF000000 -#define FI_RGBA_ALPHA_MASK 0x000000FF -#define FI_RGBA_RED_SHIFT 8 -#define FI_RGBA_GREEN_SHIFT 16 -#define FI_RGBA_BLUE_SHIFT 24 -#define FI_RGBA_ALPHA_SHIFT 0 -#else -// Big Endian (PPC / Linux, MaxOSX) : RGB(A) order -#define FI_RGBA_RED 0 -#define FI_RGBA_GREEN 1 -#define FI_RGBA_BLUE 2 -#define FI_RGBA_ALPHA 3 -#define FI_RGBA_RED_MASK 0xFF000000 -#define FI_RGBA_GREEN_MASK 0x00FF0000 -#define FI_RGBA_BLUE_MASK 0x0000FF00 -#define FI_RGBA_ALPHA_MASK 0x000000FF -#define FI_RGBA_RED_SHIFT 24 -#define FI_RGBA_GREEN_SHIFT 16 -#define FI_RGBA_BLUE_SHIFT 8 -#define FI_RGBA_ALPHA_SHIFT 0 -#endif // FREEIMAGE_COLORORDER -#endif // FREEIMAGE_BIGENDIAN - -#define FI_RGBA_RGB_MASK (FI_RGBA_RED_MASK|FI_RGBA_GREEN_MASK|FI_RGBA_BLUE_MASK) - -// The 16bit macros only include masks and shifts, since each color element is not byte aligned - -#define FI16_555_RED_MASK 0x7C00 -#define FI16_555_GREEN_MASK 0x03E0 -#define FI16_555_BLUE_MASK 0x001F -#define FI16_555_RED_SHIFT 10 -#define FI16_555_GREEN_SHIFT 5 -#define FI16_555_BLUE_SHIFT 0 -#define FI16_565_RED_MASK 0xF800 -#define FI16_565_GREEN_MASK 0x07E0 -#define FI16_565_BLUE_MASK 0x001F -#define FI16_565_RED_SHIFT 11 -#define FI16_565_GREEN_SHIFT 5 -#define FI16_565_BLUE_SHIFT 0 - -// ICC profile support ------------------------------------------------------ - -#define FIICC_DEFAULT 0x00 -#define FIICC_COLOR_IS_CMYK 0x01 - -FI_STRUCT (FIICCPROFILE) { - WORD flags; // info flag - DWORD size; // profile's size measured in bytes - void *data; // points to a block of contiguous memory containing the profile -}; - -// Important enums ---------------------------------------------------------- - -/** I/O image format identifiers. -*/ -FI_ENUM(FREE_IMAGE_FORMAT) { - FIF_UNKNOWN = -1, - FIF_BMP = 0, - FIF_ICO = 1, - FIF_JPEG = 2, - FIF_JNG = 3, - FIF_KOALA = 4, - FIF_LBM = 5, - FIF_IFF = FIF_LBM, - FIF_MNG = 6, - FIF_PBM = 7, - FIF_PBMRAW = 8, - FIF_PCD = 9, - FIF_PCX = 10, - FIF_PGM = 11, - FIF_PGMRAW = 12, - FIF_PNG = 13, - FIF_PPM = 14, - FIF_PPMRAW = 15, - FIF_RAS = 16, - FIF_TARGA = 17, - FIF_TIFF = 18, - FIF_WBMP = 19, - FIF_PSD = 20, - FIF_CUT = 21, - FIF_XBM = 22, - FIF_XPM = 23, - FIF_DDS = 24, - FIF_GIF = 25, - FIF_HDR = 26, - FIF_FAXG3 = 27, - FIF_SGI = 28, - FIF_EXR = 29, - FIF_J2K = 30, - FIF_JP2 = 31, - FIF_PFM = 32, - FIF_PICT = 33, - FIF_RAW = 34 -}; - -/** Image type used in FreeImage. -*/ -FI_ENUM(FREE_IMAGE_TYPE) { - FIT_UNKNOWN = 0, // unknown type - FIT_BITMAP = 1, // standard image : 1-, 4-, 8-, 16-, 24-, 32-bit - FIT_UINT16 = 2, // array of unsigned short : unsigned 16-bit - FIT_INT16 = 3, // array of short : signed 16-bit - FIT_UINT32 = 4, // array of unsigned long : unsigned 32-bit - FIT_INT32 = 5, // array of long : signed 32-bit - FIT_FLOAT = 6, // array of float : 32-bit IEEE floating point - FIT_DOUBLE = 7, // array of double : 64-bit IEEE floating point - FIT_COMPLEX = 8, // array of FICOMPLEX : 2 x 64-bit IEEE floating point - FIT_RGB16 = 9, // 48-bit RGB image : 3 x 16-bit - FIT_RGBA16 = 10, // 64-bit RGBA image : 4 x 16-bit - FIT_RGBF = 11, // 96-bit RGB float image : 3 x 32-bit IEEE floating point - FIT_RGBAF = 12 // 128-bit RGBA float image : 4 x 32-bit IEEE floating point -}; - -/** Image color type used in FreeImage. -*/ -FI_ENUM(FREE_IMAGE_COLOR_TYPE) { - FIC_MINISWHITE = 0, // min value is white - FIC_MINISBLACK = 1, // min value is black - FIC_RGB = 2, // RGB color model - FIC_PALETTE = 3, // color map indexed - FIC_RGBALPHA = 4, // RGB color model with alpha channel - FIC_CMYK = 5 // CMYK color model -}; - -/** Color quantization algorithms. -Constants used in FreeImage_ColorQuantize. -*/ -FI_ENUM(FREE_IMAGE_QUANTIZE) { - FIQ_WUQUANT = 0, // Xiaolin Wu color quantization algorithm - FIQ_NNQUANT = 1 // NeuQuant neural-net quantization algorithm by Anthony Dekker -}; - -/** Dithering algorithms. -Constants used in FreeImage_Dither. -*/ -FI_ENUM(FREE_IMAGE_DITHER) { - FID_FS = 0, // Floyd & Steinberg error diffusion - FID_BAYER4x4 = 1, // Bayer ordered dispersed dot dithering (order 2 dithering matrix) - FID_BAYER8x8 = 2, // Bayer ordered dispersed dot dithering (order 3 dithering matrix) - FID_CLUSTER6x6 = 3, // Ordered clustered dot dithering (order 3 - 6x6 matrix) - FID_CLUSTER8x8 = 4, // Ordered clustered dot dithering (order 4 - 8x8 matrix) - FID_CLUSTER16x16= 5, // Ordered clustered dot dithering (order 8 - 16x16 matrix) - FID_BAYER16x16 = 6 // Bayer ordered dispersed dot dithering (order 4 dithering matrix) -}; - -/** Lossless JPEG transformations -Constants used in FreeImage_JPEGTransform -*/ -FI_ENUM(FREE_IMAGE_JPEG_OPERATION) { - FIJPEG_OP_NONE = 0, // no transformation - FIJPEG_OP_FLIP_H = 1, // horizontal flip - FIJPEG_OP_FLIP_V = 2, // vertical flip - FIJPEG_OP_TRANSPOSE = 3, // transpose across UL-to-LR axis - FIJPEG_OP_TRANSVERSE = 4, // transpose across UR-to-LL axis - FIJPEG_OP_ROTATE_90 = 5, // 90-degree clockwise rotation - FIJPEG_OP_ROTATE_180 = 6, // 180-degree rotation - FIJPEG_OP_ROTATE_270 = 7 // 270-degree clockwise (or 90 ccw) -}; - -/** Tone mapping operators. -Constants used in FreeImage_ToneMapping. -*/ -FI_ENUM(FREE_IMAGE_TMO) { - FITMO_DRAGO03 = 0, // Adaptive logarithmic mapping (F. Drago, 2003) - FITMO_REINHARD05 = 1, // Dynamic range reduction inspired by photoreceptor physiology (E. Reinhard, 2005) - FITMO_FATTAL02 = 2 // Gradient domain high dynamic range compression (R. Fattal, 2002) -}; - -/** Upsampling / downsampling filters. -Constants used in FreeImage_Rescale. -*/ -FI_ENUM(FREE_IMAGE_FILTER) { - FILTER_BOX = 0, // Box, pulse, Fourier window, 1st order (constant) b-spline - FILTER_BICUBIC = 1, // Mitchell & Netravali's two-param cubic filter - FILTER_BILINEAR = 2, // Bilinear filter - FILTER_BSPLINE = 3, // 4th order (cubic) b-spline - FILTER_CATMULLROM = 4, // Catmull-Rom spline, Overhauser spline - FILTER_LANCZOS3 = 5 // Lanczos3 filter -}; - -/** Color channels. -Constants used in color manipulation routines. -*/ -FI_ENUM(FREE_IMAGE_COLOR_CHANNEL) { - FICC_RGB = 0, // Use red, green and blue channels - FICC_RED = 1, // Use red channel - FICC_GREEN = 2, // Use green channel - FICC_BLUE = 3, // Use blue channel - FICC_ALPHA = 4, // Use alpha channel - FICC_BLACK = 5, // Use black channel - FICC_REAL = 6, // Complex images: use real part - FICC_IMAG = 7, // Complex images: use imaginary part - FICC_MAG = 8, // Complex images: use magnitude - FICC_PHASE = 9 // Complex images: use phase -}; - -// Metadata support --------------------------------------------------------- - -/** - Tag data type information (based on TIFF specifications) - - Note: RATIONALs are the ratio of two 32-bit integer values. -*/ -FI_ENUM(FREE_IMAGE_MDTYPE) { - FIDT_NOTYPE = 0, // placeholder - FIDT_BYTE = 1, // 8-bit unsigned integer - FIDT_ASCII = 2, // 8-bit bytes w/ last byte null - FIDT_SHORT = 3, // 16-bit unsigned integer - FIDT_LONG = 4, // 32-bit unsigned integer - FIDT_RATIONAL = 5, // 64-bit unsigned fraction - FIDT_SBYTE = 6, // 8-bit signed integer - FIDT_UNDEFINED = 7, // 8-bit untyped data - FIDT_SSHORT = 8, // 16-bit signed integer - FIDT_SLONG = 9, // 32-bit signed integer - FIDT_SRATIONAL = 10, // 64-bit signed fraction - FIDT_FLOAT = 11, // 32-bit IEEE floating point - FIDT_DOUBLE = 12, // 64-bit IEEE floating point - FIDT_IFD = 13, // 32-bit unsigned integer (offset) - FIDT_PALETTE = 14 // 32-bit RGBQUAD -}; - -/** - Metadata models supported by FreeImage -*/ -FI_ENUM(FREE_IMAGE_MDMODEL) { - FIMD_NODATA = -1, - FIMD_COMMENTS = 0, // single comment or keywords - FIMD_EXIF_MAIN = 1, // Exif-TIFF metadata - FIMD_EXIF_EXIF = 2, // Exif-specific metadata - FIMD_EXIF_GPS = 3, // Exif GPS metadata - FIMD_EXIF_MAKERNOTE = 4, // Exif maker note metadata - FIMD_EXIF_INTEROP = 5, // Exif interoperability metadata - FIMD_IPTC = 6, // IPTC/NAA metadata - FIMD_XMP = 7, // Abobe XMP metadata - FIMD_GEOTIFF = 8, // GeoTIFF metadata - FIMD_ANIMATION = 9, // Animation metadata - FIMD_CUSTOM = 10 // Used to attach other metadata types to a dib -}; - -/** - Handle to a metadata model -*/ -FI_STRUCT (FIMETADATA) { void *data; }; - -/** - Handle to a FreeImage tag -*/ -FI_STRUCT (FITAG) { void *data; }; - -// File IO routines --------------------------------------------------------- - -#ifndef FREEIMAGE_IO -#define FREEIMAGE_IO - -typedef void* fi_handle; -typedef unsigned (DLL_CALLCONV *FI_ReadProc) (void *buffer, unsigned size, unsigned count, fi_handle handle); -typedef unsigned (DLL_CALLCONV *FI_WriteProc) (void *buffer, unsigned size, unsigned count, fi_handle handle); -typedef int (DLL_CALLCONV *FI_SeekProc) (fi_handle handle, long offset, int origin); -typedef long (DLL_CALLCONV *FI_TellProc) (fi_handle handle); - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(push, 1) -#else -#pragma pack(1) -#endif // WIN32 - -FI_STRUCT(FreeImageIO) { - FI_ReadProc read_proc; // pointer to the function used to read data - FI_WriteProc write_proc; // pointer to the function used to write data - FI_SeekProc seek_proc; // pointer to the function used to seek - FI_TellProc tell_proc; // pointer to the function used to aquire the current position -}; - -#if (defined(_WIN32) || defined(__WIN32__)) -#pragma pack(pop) -#else -#pragma pack() -#endif // WIN32 - -/** -Handle to a memory I/O stream -*/ -FI_STRUCT (FIMEMORY) { void *data; }; - -#endif // FREEIMAGE_IO - -// Plugin routines ---------------------------------------------------------- - -#ifndef PLUGINS -#define PLUGINS - -typedef const char *(DLL_CALLCONV *FI_FormatProc)(void); -typedef const char *(DLL_CALLCONV *FI_DescriptionProc)(void); -typedef const char *(DLL_CALLCONV *FI_ExtensionListProc)(void); -typedef const char *(DLL_CALLCONV *FI_RegExprProc)(void); -typedef void *(DLL_CALLCONV *FI_OpenProc)(FreeImageIO *io, fi_handle handle, BOOL read); -typedef void (DLL_CALLCONV *FI_CloseProc)(FreeImageIO *io, fi_handle handle, void *data); -typedef int (DLL_CALLCONV *FI_PageCountProc)(FreeImageIO *io, fi_handle handle, void *data); -typedef int (DLL_CALLCONV *FI_PageCapabilityProc)(FreeImageIO *io, fi_handle handle, void *data); -typedef FIBITMAP *(DLL_CALLCONV *FI_LoadProc)(FreeImageIO *io, fi_handle handle, int page, int flags, void *data); -typedef BOOL (DLL_CALLCONV *FI_SaveProc)(FreeImageIO *io, FIBITMAP *dib, fi_handle handle, int page, int flags, void *data); -typedef BOOL (DLL_CALLCONV *FI_ValidateProc)(FreeImageIO *io, fi_handle handle); -typedef const char *(DLL_CALLCONV *FI_MimeProc)(void); -typedef BOOL (DLL_CALLCONV *FI_SupportsExportBPPProc)(int bpp); -typedef BOOL (DLL_CALLCONV *FI_SupportsExportTypeProc)(FREE_IMAGE_TYPE type); -typedef BOOL (DLL_CALLCONV *FI_SupportsICCProfilesProc)(void); - -FI_STRUCT (Plugin) { - FI_FormatProc format_proc; - FI_DescriptionProc description_proc; - FI_ExtensionListProc extension_proc; - FI_RegExprProc regexpr_proc; - FI_OpenProc open_proc; - FI_CloseProc close_proc; - FI_PageCountProc pagecount_proc; - FI_PageCapabilityProc pagecapability_proc; - FI_LoadProc load_proc; - FI_SaveProc save_proc; - FI_ValidateProc validate_proc; - FI_MimeProc mime_proc; - FI_SupportsExportBPPProc supports_export_bpp_proc; - FI_SupportsExportTypeProc supports_export_type_proc; - FI_SupportsICCProfilesProc supports_icc_profiles_proc; -}; - -typedef void (DLL_CALLCONV *FI_InitProc)(Plugin *plugin, int format_id); - -#endif // PLUGINS - - -// Load / Save flag constants ----------------------------------------------- - -#define BMP_DEFAULT 0 -#define BMP_SAVE_RLE 1 -#define CUT_DEFAULT 0 -#define DDS_DEFAULT 0 -#define EXR_DEFAULT 0 // save data as half with piz-based wavelet compression -#define EXR_FLOAT 0x0001 // save data as float instead of as half (not recommended) -#define EXR_NONE 0x0002 // save with no compression -#define EXR_ZIP 0x0004 // save with zlib compression, in blocks of 16 scan lines -#define EXR_PIZ 0x0008 // save with piz-based wavelet compression -#define EXR_PXR24 0x0010 // save with lossy 24-bit float compression -#define EXR_B44 0x0020 // save with lossy 44% float compression - goes to 22% when combined with EXR_LC -#define EXR_LC 0x0040 // save images with one luminance and two chroma channels, rather than as RGB (lossy compression) -#define FAXG3_DEFAULT 0 -#define GIF_DEFAULT 0 -#define GIF_LOAD256 1 // Load the image as a 256 color image with ununsed palette entries, if it's 16 or 2 color -#define GIF_PLAYBACK 2 // 'Play' the GIF to generate each frame (as 32bpp) instead of returning raw frame data when loading -#define HDR_DEFAULT 0 -#define ICO_DEFAULT 0 -#define ICO_MAKEALPHA 1 // convert to 32bpp and create an alpha channel from the AND-mask when loading -#define IFF_DEFAULT 0 -#define J2K_DEFAULT 0 // save with a 16:1 rate -#define JP2_DEFAULT 0 // save with a 16:1 rate -#define JPEG_DEFAULT 0 // loading (see JPEG_FAST); saving (see JPEG_QUALITYGOOD|JPEG_SUBSAMPLING_420) -#define JPEG_FAST 0x0001 // load the file as fast as possible, sacrificing some quality -#define JPEG_ACCURATE 0x0002 // load the file with the best quality, sacrificing some speed -#define JPEG_CMYK 0x0004 // load separated CMYK "as is" (use | to combine with other load flags) -#define JPEG_EXIFROTATE 0x0008 // load and rotate according to Exif 'Orientation' tag if available -#define JPEG_QUALITYSUPERB 0x80 // save with superb quality (100:1) -#define JPEG_QUALITYGOOD 0x0100 // save with good quality (75:1) -#define JPEG_QUALITYNORMAL 0x0200 // save with normal quality (50:1) -#define JPEG_QUALITYAVERAGE 0x0400 // save with average quality (25:1) -#define JPEG_QUALITYBAD 0x0800 // save with bad quality (10:1) -#define JPEG_PROGRESSIVE 0x2000 // save as a progressive-JPEG (use | to combine with other save flags) -#define JPEG_SUBSAMPLING_411 0x1000 // save with high 4x1 chroma subsampling (4:1:1) -#define JPEG_SUBSAMPLING_420 0x4000 // save with medium 2x2 medium chroma subsampling (4:2:0) - default value -#define JPEG_SUBSAMPLING_422 0x8000 // save with low 2x1 chroma subsampling (4:2:2) -#define JPEG_SUBSAMPLING_444 0x10000 // save with no chroma subsampling (4:4:4) -#define KOALA_DEFAULT 0 -#define LBM_DEFAULT 0 -#define MNG_DEFAULT 0 -#define PCD_DEFAULT 0 -#define PCD_BASE 1 // load the bitmap sized 768 x 512 -#define PCD_BASEDIV4 2 // load the bitmap sized 384 x 256 -#define PCD_BASEDIV16 3 // load the bitmap sized 192 x 128 -#define PCX_DEFAULT 0 -#define PFM_DEFAULT 0 -#define PICT_DEFAULT 0 -#define PNG_DEFAULT 0 -#define PNG_IGNOREGAMMA 1 // loading: avoid gamma correction -#define PNG_Z_BEST_SPEED 0x0001 // save using ZLib level 1 compression flag (default value is 6) -#define PNG_Z_DEFAULT_COMPRESSION 0x0006 // save using ZLib level 6 compression flag (default recommended value) -#define PNG_Z_BEST_COMPRESSION 0x0009 // save using ZLib level 9 compression flag (default value is 6) -#define PNG_Z_NO_COMPRESSION 0x0100 // save without ZLib compression -#define PNG_INTERLACED 0x0200 // save using Adam7 interlacing (use | to combine with other save flags) -#define PNM_DEFAULT 0 -#define PNM_SAVE_RAW 0 // If set the writer saves in RAW format (i.e. P4, P5 or P6) -#define PNM_SAVE_ASCII 1 // If set the writer saves in ASCII format (i.e. P1, P2 or P3) -#define PSD_DEFAULT 0 -#define RAS_DEFAULT 0 -#define RAW_DEFAULT 0 // load the file as linear RGB 48-bit -#define RAW_PREVIEW 1 // try to load the embedded JPEG preview with included Exif Data or default to RGB 24-bit -#define RAW_DISPLAY 2 // load the file as RGB 24-bit -#define SGI_DEFAULT 0 -#define TARGA_DEFAULT 0 -#define TARGA_LOAD_RGB888 1 // If set the loader converts RGB555 and ARGB8888 -> RGB888. -#define TIFF_DEFAULT 0 -#define TIFF_CMYK 0x0001 // reads/stores tags for separated CMYK (use | to combine with compression flags) -#define TIFF_PACKBITS 0x0100 // save using PACKBITS compression -#define TIFF_DEFLATE 0x0200 // save using DEFLATE compression (a.k.a. ZLIB compression) -#define TIFF_ADOBE_DEFLATE 0x0400 // save using ADOBE DEFLATE compression -#define TIFF_NONE 0x0800 // save without any compression -#define TIFF_CCITTFAX3 0x1000 // save using CCITT Group 3 fax encoding -#define TIFF_CCITTFAX4 0x2000 // save using CCITT Group 4 fax encoding -#define TIFF_LZW 0x4000 // save using LZW compression -#define TIFF_JPEG 0x8000 // save using JPEG compression -#define WBMP_DEFAULT 0 -#define XBM_DEFAULT 0 -#define XPM_DEFAULT 0 - -// Background filling options --------------------------------------------------------- -// Constants used in FreeImage_FillBackground and FreeImage_EnlargeCanvas - -#define FI_COLOR_IS_RGB_COLOR 0x00 // RGBQUAD color is a RGB color (contains no valid alpha channel) -#define FI_COLOR_IS_RGBA_COLOR 0x01 // RGBQUAD color is a RGBA color (contains a valid alpha channel) -#define FI_COLOR_FIND_EQUAL_COLOR 0x02 // For palettized images: lookup equal RGB color from palette -#define FI_COLOR_ALPHA_IS_INDEX 0x04 // The color's rgbReserved member (alpha) contains the palette index to be used -#define FI_COLOR_PALETTE_SEARCH_MASK (FI_COLOR_FIND_EQUAL_COLOR | FI_COLOR_ALPHA_IS_INDEX) // No color lookup is performed - - -#ifdef __cplusplus -extern "C" { -#endif - -// Init / Error routines ---------------------------------------------------- - -DLL_API void DLL_CALLCONV FreeImage_Initialise(BOOL load_local_plugins_only FI_DEFAULT(FALSE)); -DLL_API void DLL_CALLCONV FreeImage_DeInitialise(void); - -// Version routines --------------------------------------------------------- - -DLL_API const char *DLL_CALLCONV FreeImage_GetVersion(void); -DLL_API const char *DLL_CALLCONV FreeImage_GetCopyrightMessage(void); - -// Message output functions ------------------------------------------------- - -typedef void (*FreeImage_OutputMessageFunction)(FREE_IMAGE_FORMAT fif, const char *msg); -typedef void (DLL_CALLCONV *FreeImage_OutputMessageFunctionStdCall)(FREE_IMAGE_FORMAT fif, const char *msg); - -DLL_API void DLL_CALLCONV FreeImage_SetOutputMessageStdCall(FreeImage_OutputMessageFunctionStdCall omf); -DLL_API void DLL_CALLCONV FreeImage_SetOutputMessage(FreeImage_OutputMessageFunction omf); -DLL_API void DLL_CALLCONV FreeImage_OutputMessageProc(int fif, const char *fmt, ...); - -// Allocate / Clone / Unload routines --------------------------------------- - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Allocate(int width, int height, int bpp, unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateT(FREE_IMAGE_TYPE type, int width, int height, int bpp FI_DEFAULT(8), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); -DLL_API FIBITMAP * DLL_CALLCONV FreeImage_Clone(FIBITMAP *dib); -DLL_API void DLL_CALLCONV FreeImage_Unload(FIBITMAP *dib); - -// Load / Save routines ----------------------------------------------------- - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Load(FREE_IMAGE_FORMAT fif, const char *filename, int flags FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadU(FREE_IMAGE_FORMAT fif, const wchar_t *filename, int flags FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0)); -DLL_API BOOL DLL_CALLCONV FreeImage_Save(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const char *filename, int flags FI_DEFAULT(0)); -DLL_API BOOL DLL_CALLCONV FreeImage_SaveU(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, const wchar_t *filename, int flags FI_DEFAULT(0)); -DLL_API BOOL DLL_CALLCONV FreeImage_SaveToHandle(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0)); - -// Memory I/O stream routines ----------------------------------------------- - -DLL_API FIMEMORY *DLL_CALLCONV FreeImage_OpenMemory(BYTE *data FI_DEFAULT(0), DWORD size_in_bytes FI_DEFAULT(0)); -DLL_API void DLL_CALLCONV FreeImage_CloseMemory(FIMEMORY *stream); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_LoadFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0)); -DLL_API BOOL DLL_CALLCONV FreeImage_SaveToMemory(FREE_IMAGE_FORMAT fif, FIBITMAP *dib, FIMEMORY *stream, int flags FI_DEFAULT(0)); -DLL_API long DLL_CALLCONV FreeImage_TellMemory(FIMEMORY *stream); -DLL_API BOOL DLL_CALLCONV FreeImage_SeekMemory(FIMEMORY *stream, long offset, int origin); -DLL_API BOOL DLL_CALLCONV FreeImage_AcquireMemory(FIMEMORY *stream, BYTE **data, DWORD *size_in_bytes); -DLL_API unsigned DLL_CALLCONV FreeImage_ReadMemory(void *buffer, unsigned size, unsigned count, FIMEMORY *stream); -DLL_API unsigned DLL_CALLCONV FreeImage_WriteMemory(const void *buffer, unsigned size, unsigned count, FIMEMORY *stream); -DLL_API FIMULTIBITMAP *DLL_CALLCONV FreeImage_LoadMultiBitmapFromMemory(FREE_IMAGE_FORMAT fif, FIMEMORY *stream, int flags FI_DEFAULT(0)); - -// Plugin Interface --------------------------------------------------------- - -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterLocalPlugin(FI_InitProc proc_address, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0)); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_RegisterExternalPlugin(const char *path, const char *format FI_DEFAULT(0), const char *description FI_DEFAULT(0), const char *extension FI_DEFAULT(0), const char *regexpr FI_DEFAULT(0)); -DLL_API int DLL_CALLCONV FreeImage_GetFIFCount(void); -DLL_API int DLL_CALLCONV FreeImage_SetPluginEnabled(FREE_IMAGE_FORMAT fif, BOOL enable); -DLL_API int DLL_CALLCONV FreeImage_IsPluginEnabled(FREE_IMAGE_FORMAT fif); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFormat(const char *format); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromMime(const char *mime); -DLL_API const char *DLL_CALLCONV FreeImage_GetFormatFromFIF(FREE_IMAGE_FORMAT fif); -DLL_API const char *DLL_CALLCONV FreeImage_GetFIFExtensionList(FREE_IMAGE_FORMAT fif); -DLL_API const char *DLL_CALLCONV FreeImage_GetFIFDescription(FREE_IMAGE_FORMAT fif); -DLL_API const char *DLL_CALLCONV FreeImage_GetFIFRegExpr(FREE_IMAGE_FORMAT fif); -DLL_API const char *DLL_CALLCONV FreeImage_GetFIFMimeType(FREE_IMAGE_FORMAT fif); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilename(const char *filename); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFIFFromFilenameU(const wchar_t *filename); -DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsReading(FREE_IMAGE_FORMAT fif); -DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsWriting(FREE_IMAGE_FORMAT fif); -DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportBPP(FREE_IMAGE_FORMAT fif, int bpp); -DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsExportType(FREE_IMAGE_FORMAT fif, FREE_IMAGE_TYPE type); -DLL_API BOOL DLL_CALLCONV FreeImage_FIFSupportsICCProfiles(FREE_IMAGE_FORMAT fif); - -// Multipaging interface ---------------------------------------------------- - -DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmap(FREE_IMAGE_FORMAT fif, const char *filename, BOOL create_new, BOOL read_only, BOOL keep_cache_in_memory FI_DEFAULT(FALSE), int flags FI_DEFAULT(0)); -DLL_API FIMULTIBITMAP * DLL_CALLCONV FreeImage_OpenMultiBitmapFromHandle(FREE_IMAGE_FORMAT fif, FreeImageIO *io, fi_handle handle, int flags FI_DEFAULT(0)); -DLL_API BOOL DLL_CALLCONV FreeImage_CloseMultiBitmap(FIMULTIBITMAP *bitmap, int flags FI_DEFAULT(0)); -DLL_API int DLL_CALLCONV FreeImage_GetPageCount(FIMULTIBITMAP *bitmap); -DLL_API void DLL_CALLCONV FreeImage_AppendPage(FIMULTIBITMAP *bitmap, FIBITMAP *data); -DLL_API void DLL_CALLCONV FreeImage_InsertPage(FIMULTIBITMAP *bitmap, int page, FIBITMAP *data); -DLL_API void DLL_CALLCONV FreeImage_DeletePage(FIMULTIBITMAP *bitmap, int page); -DLL_API FIBITMAP * DLL_CALLCONV FreeImage_LockPage(FIMULTIBITMAP *bitmap, int page); -DLL_API void DLL_CALLCONV FreeImage_UnlockPage(FIMULTIBITMAP *bitmap, FIBITMAP *data, BOOL changed); -DLL_API BOOL DLL_CALLCONV FreeImage_MovePage(FIMULTIBITMAP *bitmap, int target, int source); -DLL_API BOOL DLL_CALLCONV FreeImage_GetLockedPageNumbers(FIMULTIBITMAP *bitmap, int *pages, int *count); - -// Filetype request routines ------------------------------------------------ - -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileType(const char *filename, int size FI_DEFAULT(0)); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeU(const wchar_t *filename, int size FI_DEFAULT(0)); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromHandle(FreeImageIO *io, fi_handle handle, int size FI_DEFAULT(0)); -DLL_API FREE_IMAGE_FORMAT DLL_CALLCONV FreeImage_GetFileTypeFromMemory(FIMEMORY *stream, int size FI_DEFAULT(0)); - -// Image type request routine ----------------------------------------------- - -DLL_API FREE_IMAGE_TYPE DLL_CALLCONV FreeImage_GetImageType(FIBITMAP *dib); - -// FreeImage helper routines ------------------------------------------------ - -DLL_API BOOL DLL_CALLCONV FreeImage_IsLittleEndian(void); -DLL_API BOOL DLL_CALLCONV FreeImage_LookupX11Color(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue); -DLL_API BOOL DLL_CALLCONV FreeImage_LookupSVGColor(const char *szColor, BYTE *nRed, BYTE *nGreen, BYTE *nBlue); - -// Pixel access routines ---------------------------------------------------- - -DLL_API BYTE *DLL_CALLCONV FreeImage_GetBits(FIBITMAP *dib); -DLL_API BYTE *DLL_CALLCONV FreeImage_GetScanLine(FIBITMAP *dib, int scanline); - -DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value); -DLL_API BOOL DLL_CALLCONV FreeImage_GetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value); -DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelIndex(FIBITMAP *dib, unsigned x, unsigned y, BYTE *value); -DLL_API BOOL DLL_CALLCONV FreeImage_SetPixelColor(FIBITMAP *dib, unsigned x, unsigned y, RGBQUAD *value); - -// DIB info routines -------------------------------------------------------- - -DLL_API unsigned DLL_CALLCONV FreeImage_GetColorsUsed(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetBPP(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetWidth(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetHeight(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetLine(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetPitch(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetDIBSize(FIBITMAP *dib); -DLL_API RGBQUAD *DLL_CALLCONV FreeImage_GetPalette(FIBITMAP *dib); - -DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterX(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetDotsPerMeterY(FIBITMAP *dib); -DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterX(FIBITMAP *dib, unsigned res); -DLL_API void DLL_CALLCONV FreeImage_SetDotsPerMeterY(FIBITMAP *dib, unsigned res); - -DLL_API BITMAPINFOHEADER *DLL_CALLCONV FreeImage_GetInfoHeader(FIBITMAP *dib); -DLL_API BITMAPINFO *DLL_CALLCONV FreeImage_GetInfo(FIBITMAP *dib); -DLL_API FREE_IMAGE_COLOR_TYPE DLL_CALLCONV FreeImage_GetColorType(FIBITMAP *dib); - -DLL_API unsigned DLL_CALLCONV FreeImage_GetRedMask(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetGreenMask(FIBITMAP *dib); -DLL_API unsigned DLL_CALLCONV FreeImage_GetBlueMask(FIBITMAP *dib); - -DLL_API unsigned DLL_CALLCONV FreeImage_GetTransparencyCount(FIBITMAP *dib); -DLL_API BYTE * DLL_CALLCONV FreeImage_GetTransparencyTable(FIBITMAP *dib); -DLL_API void DLL_CALLCONV FreeImage_SetTransparent(FIBITMAP *dib, BOOL enabled); -DLL_API void DLL_CALLCONV FreeImage_SetTransparencyTable(FIBITMAP *dib, BYTE *table, int count); -DLL_API BOOL DLL_CALLCONV FreeImage_IsTransparent(FIBITMAP *dib); -DLL_API void DLL_CALLCONV FreeImage_SetTransparentIndex(FIBITMAP *dib, int index); -DLL_API int DLL_CALLCONV FreeImage_GetTransparentIndex(FIBITMAP *dib); - -DLL_API BOOL DLL_CALLCONV FreeImage_HasBackgroundColor(FIBITMAP *dib); -DLL_API BOOL DLL_CALLCONV FreeImage_GetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor); -DLL_API BOOL DLL_CALLCONV FreeImage_SetBackgroundColor(FIBITMAP *dib, RGBQUAD *bkcolor); - - -// ICC profile routines ----------------------------------------------------- - -DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_GetICCProfile(FIBITMAP *dib); -DLL_API FIICCPROFILE *DLL_CALLCONV FreeImage_CreateICCProfile(FIBITMAP *dib, void *data, long size); -DLL_API void DLL_CALLCONV FreeImage_DestroyICCProfile(FIBITMAP *dib); - -// Line conversion routines ------------------------------------------------- - -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To4(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To4(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To4_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To4(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To4(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To8(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To8(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To8_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To8(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To8(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_555(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_565_To16_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To16_565(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16_555_To16_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To16_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To16_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To24(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To24_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine32To24(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine1To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine4To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine8To32(BYTE *target, BYTE *source, int width_in_pixels, RGBQUAD *palette); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_555(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine16To32_565(BYTE *target, BYTE *source, int width_in_pixels); -DLL_API void DLL_CALLCONV FreeImage_ConvertLine24To32(BYTE *target, BYTE *source, int width_in_pixels); - -// Smart conversion routines ------------------------------------------------ - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo4Bits(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo8Bits(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToGreyscale(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits555(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo16Bits565(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo24Bits(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertTo32Bits(FIBITMAP *dib); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantize(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ColorQuantizeEx(FIBITMAP *dib, FREE_IMAGE_QUANTIZE quantize FI_DEFAULT(FIQ_WUQUANT), int PaletteSize FI_DEFAULT(256), int ReserveSize FI_DEFAULT(0), RGBQUAD *ReservePalette FI_DEFAULT(NULL)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Threshold(FIBITMAP *dib, BYTE T); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Dither(FIBITMAP *dib, FREE_IMAGE_DITHER algorithm); - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertFromRawBits(BYTE *bits, int width, int height, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE)); -DLL_API void DLL_CALLCONV FreeImage_ConvertToRawBits(BYTE *bits, FIBITMAP *dib, int pitch, unsigned bpp, unsigned red_mask, unsigned green_mask, unsigned blue_mask, BOOL topdown FI_DEFAULT(FALSE)); - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToRGBF(FIBITMAP *dib); - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToStandardType(FIBITMAP *src, BOOL scale_linear FI_DEFAULT(TRUE)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ConvertToType(FIBITMAP *src, FREE_IMAGE_TYPE dst_type, BOOL scale_linear FI_DEFAULT(TRUE)); - -// tone mapping operators -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_ToneMapping(FIBITMAP *dib, FREE_IMAGE_TMO tmo, double first_param FI_DEFAULT(0), double second_param FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoDrago03(FIBITMAP *src, double gamma FI_DEFAULT(2.2), double exposure FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoReinhard05Ex(FIBITMAP *src, double intensity FI_DEFAULT(0), double contrast FI_DEFAULT(0), double adaptation FI_DEFAULT(1), double color_correction FI_DEFAULT(0)); - -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_TmoFattal02(FIBITMAP *src, double color_saturation FI_DEFAULT(0.5), double attenuation FI_DEFAULT(0.85)); - -// ZLib interface ----------------------------------------------------------- - -DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); -DLL_API DWORD DLL_CALLCONV FreeImage_ZLibUncompress(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); -DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); -DLL_API DWORD DLL_CALLCONV FreeImage_ZLibGUnzip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_size); -DLL_API DWORD DLL_CALLCONV FreeImage_ZLibCRC32(DWORD crc, BYTE *source, DWORD source_size); - -// -------------------------------------------------------------------------- -// Metadata routines -------------------------------------------------------- -// -------------------------------------------------------------------------- - -// tag creation / destruction -DLL_API FITAG *DLL_CALLCONV FreeImage_CreateTag(void); -DLL_API void DLL_CALLCONV FreeImage_DeleteTag(FITAG *tag); -DLL_API FITAG *DLL_CALLCONV FreeImage_CloneTag(FITAG *tag); - -// tag getters and setters -DLL_API const char *DLL_CALLCONV FreeImage_GetTagKey(FITAG *tag); -DLL_API const char *DLL_CALLCONV FreeImage_GetTagDescription(FITAG *tag); -DLL_API WORD DLL_CALLCONV FreeImage_GetTagID(FITAG *tag); -DLL_API FREE_IMAGE_MDTYPE DLL_CALLCONV FreeImage_GetTagType(FITAG *tag); -DLL_API DWORD DLL_CALLCONV FreeImage_GetTagCount(FITAG *tag); -DLL_API DWORD DLL_CALLCONV FreeImage_GetTagLength(FITAG *tag); -DLL_API const void *DLL_CALLCONV FreeImage_GetTagValue(FITAG *tag); - -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagKey(FITAG *tag, const char *key); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagDescription(FITAG *tag, const char *description); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagID(FITAG *tag, WORD id); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagType(FITAG *tag, FREE_IMAGE_MDTYPE type); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagCount(FITAG *tag, DWORD count); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagLength(FITAG *tag, DWORD length); -DLL_API BOOL DLL_CALLCONV FreeImage_SetTagValue(FITAG *tag, const void *value); - -// iterator -DLL_API FIMETADATA *DLL_CALLCONV FreeImage_FindFirstMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, FITAG **tag); -DLL_API BOOL DLL_CALLCONV FreeImage_FindNextMetadata(FIMETADATA *mdhandle, FITAG **tag); -DLL_API void DLL_CALLCONV FreeImage_FindCloseMetadata(FIMETADATA *mdhandle); - -// metadata setter and getter -DLL_API BOOL DLL_CALLCONV FreeImage_SetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG *tag); -DLL_API BOOL DLL_CALLCONV FreeImage_GetMetadata(FREE_IMAGE_MDMODEL model, FIBITMAP *dib, const char *key, FITAG **tag); - -// helpers -DLL_API unsigned DLL_CALLCONV FreeImage_GetMetadataCount(FREE_IMAGE_MDMODEL model, FIBITMAP *dib); -DLL_API BOOL DLL_CALLCONV FreeImage_CloneMetadata(FIBITMAP *dst, FIBITMAP *src); - -// tag to C string conversion -DLL_API const char* DLL_CALLCONV FreeImage_TagToString(FREE_IMAGE_MDMODEL model, FITAG *tag, char *Make FI_DEFAULT(NULL)); - -// -------------------------------------------------------------------------- -// Image manipulation toolkit ----------------------------------------------- -// -------------------------------------------------------------------------- - -// rotation and flipping -/// @deprecated see FreeImage_Rotate -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateClassic(FIBITMAP *dib, double angle); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rotate(FIBITMAP *dib, double angle, const void *bkcolor FI_DEFAULT(NULL)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_RotateEx(FIBITMAP *dib, double angle, double x_shift, double y_shift, double x_origin, double y_origin, BOOL use_mask); -DLL_API BOOL DLL_CALLCONV FreeImage_FlipHorizontal(FIBITMAP *dib); -DLL_API BOOL DLL_CALLCONV FreeImage_FlipVertical(FIBITMAP *dib); -DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransform(const char *src_file, const char *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); -DLL_API BOOL DLL_CALLCONV FreeImage_JPEGTransformU(const wchar_t *src_file, const wchar_t *dst_file, FREE_IMAGE_JPEG_OPERATION operation, BOOL perfect FI_DEFAULT(FALSE)); - -// upsampling / downsampling -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Rescale(FIBITMAP *dib, int dst_width, int dst_height, FREE_IMAGE_FILTER filter); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MakeThumbnail(FIBITMAP *dib, int max_pixel_size, BOOL convert FI_DEFAULT(TRUE)); - -// color manipulation routines (point operations) -DLL_API BOOL DLL_CALLCONV FreeImage_AdjustCurve(FIBITMAP *dib, BYTE *LUT, FREE_IMAGE_COLOR_CHANNEL channel); -DLL_API BOOL DLL_CALLCONV FreeImage_AdjustGamma(FIBITMAP *dib, double gamma); -DLL_API BOOL DLL_CALLCONV FreeImage_AdjustBrightness(FIBITMAP *dib, double percentage); -DLL_API BOOL DLL_CALLCONV FreeImage_AdjustContrast(FIBITMAP *dib, double percentage); -DLL_API BOOL DLL_CALLCONV FreeImage_Invert(FIBITMAP *dib); -DLL_API BOOL DLL_CALLCONV FreeImage_GetHistogram(FIBITMAP *dib, DWORD *histo, FREE_IMAGE_COLOR_CHANNEL channel FI_DEFAULT(FICC_BLACK)); -DLL_API int DLL_CALLCONV FreeImage_GetAdjustColorsLookupTable(BYTE *LUT, double brightness, double contrast, double gamma, BOOL invert); -DLL_API BOOL DLL_CALLCONV FreeImage_AdjustColors(FIBITMAP *dib, double brightness, double contrast, double gamma, BOOL invert FI_DEFAULT(FALSE)); -DLL_API unsigned DLL_CALLCONV FreeImage_ApplyColorMapping(FIBITMAP *dib, RGBQUAD *srccolors, RGBQUAD *dstcolors, unsigned count, BOOL ignore_alpha, BOOL swap); -DLL_API unsigned DLL_CALLCONV FreeImage_SwapColors(FIBITMAP *dib, RGBQUAD *color_a, RGBQUAD *color_b, BOOL ignore_alpha); -DLL_API unsigned DLL_CALLCONV FreeImage_ApplyPaletteIndexMapping(FIBITMAP *dib, BYTE *srcindices, BYTE *dstindices, unsigned count, BOOL swap); -DLL_API unsigned DLL_CALLCONV FreeImage_SwapPaletteIndices(FIBITMAP *dib, BYTE *index_a, BYTE *index_b); - -// channel processing routines -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetChannel(FIBITMAP *dib, FREE_IMAGE_COLOR_CHANNEL channel); -DLL_API BOOL DLL_CALLCONV FreeImage_SetChannel(FIBITMAP *dib, FIBITMAP *dib8, FREE_IMAGE_COLOR_CHANNEL channel); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_GetComplexChannel(FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel); -DLL_API BOOL DLL_CALLCONV FreeImage_SetComplexChannel(FIBITMAP *dst, FIBITMAP *src, FREE_IMAGE_COLOR_CHANNEL channel); - -// copy / paste / composite routines -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Copy(FIBITMAP *dib, int left, int top, int right, int bottom); -DLL_API BOOL DLL_CALLCONV FreeImage_Paste(FIBITMAP *dst, FIBITMAP *src, int left, int top, int alpha); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_Composite(FIBITMAP *fg, BOOL useFileBkg FI_DEFAULT(FALSE), RGBQUAD *appBkColor FI_DEFAULT(NULL), FIBITMAP *bg FI_DEFAULT(NULL)); -DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCrop(const char *src_file, const char *dst_file, int left, int top, int right, int bottom); -DLL_API BOOL DLL_CALLCONV FreeImage_JPEGCropU(const wchar_t *src_file, const wchar_t *dst_file, int left, int top, int right, int bottom); -DLL_API BOOL DLL_CALLCONV FreeImage_PreMultiplyWithAlpha(FIBITMAP *dib); - -// background filling routines -DLL_API BOOL DLL_CALLCONV FreeImage_FillBackground(FIBITMAP *dib, const void *color, int options FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_EnlargeCanvas(FIBITMAP *src, int left, int top, int right, int bottom, const void *color, int options FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateEx(int width, int height, int bpp, const RGBQUAD *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_AllocateExT(FREE_IMAGE_TYPE type, int width, int height, int bpp, const void *color, int options FI_DEFAULT(0), const RGBQUAD *palette FI_DEFAULT(NULL), unsigned red_mask FI_DEFAULT(0), unsigned green_mask FI_DEFAULT(0), unsigned blue_mask FI_DEFAULT(0)); - -// miscellaneous algorithms -DLL_API FIBITMAP *DLL_CALLCONV FreeImage_MultigridPoissonSolver(FIBITMAP *Laplacian, int ncycle FI_DEFAULT(3)); - -// restore the borland-specific enum size option -#if defined(__BORLANDC__) -#pragma option pop -#endif - -#ifdef __cplusplus -} -#endif - -#endif // FREEIMAGE_H diff --git a/qt-correction-tool/pub/external/include/turbojpeg.h b/qt-correction-tool/pub/external/include/turbojpeg.h deleted file mode 100644 index 9c0a371..0000000 --- a/qt-correction-tool/pub/external/include/turbojpeg.h +++ /dev/null @@ -1,1744 +0,0 @@ -/* - * Copyright (C)2009-2015, 2017 D. R. Commander. All Rights Reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * - Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - Neither the name of the libjpeg-turbo Project nor the names of its - * contributors may be used to endorse or promote products derived from this - * software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __TURBOJPEG_H__ -#define __TURBOJPEG_H__ - -#if defined(_WIN32) && defined(DLLDEFINE) -#define DLLEXPORT __declspec(dllexport) -#else -#define DLLEXPORT -#endif -#define DLLCALL - - -/** - * @addtogroup TurboJPEG - * TurboJPEG API. This API provides an interface for generating, decoding, and - * transforming planar YUV and JPEG images in memory. - * - * @anchor YUVnotes - * YUV Image Format Notes - * ---------------------- - * Technically, the JPEG format uses the YCbCr colorspace (which is technically - * not a colorspace but a color transform), but per the convention of the - * digital video community, the TurboJPEG API uses "YUV" to refer to an image - * format consisting of Y, Cb, and Cr image planes. - * - * Each plane is simply a 2D array of bytes, each byte representing the value - * of one of the components (Y, Cb, or Cr) at a particular location in the - * image. The width and height of each plane are determined by the image - * width, height, and level of chrominance subsampling. The luminance plane - * width is the image width padded to the nearest multiple of the horizontal - * subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of - * 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane - * height is the image height padded to the nearest multiple of the vertical - * subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 - * or grayscale.) This is irrespective of any additional padding that may be - * specified as an argument to the various YUV functions. The chrominance - * plane width is equal to the luminance plane width divided by the horizontal - * subsampling factor, and the chrominance plane height is equal to the - * luminance plane height divided by the vertical subsampling factor. - * - * For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is - * used, then the luminance plane would be 36 x 35 bytes, and each of the - * chrominance planes would be 18 x 35 bytes. If you specify a line padding of - * 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and - * each of the chrominance planes would be 20 x 35 bytes. - * - * @{ - */ - - -/** - * The number of chrominance subsampling options - */ -#define TJ_NUMSAMP 6 - -/** - * Chrominance subsampling options. - * When pixels are converted from RGB to YCbCr (see #TJCS_YCbCr) or from CMYK - * to YCCK (see #TJCS_YCCK) as part of the JPEG compression process, some of - * the Cb and Cr (chrominance) components can be discarded or averaged together - * to produce a smaller image with little perceptible loss of image clarity - * (the human eye is more sensitive to small changes in brightness than to - * small changes in color.) This is called "chrominance subsampling". - */ -enum TJSAMP { - /** - * 4:4:4 chrominance subsampling (no chrominance subsampling). The JPEG or - * YUV image will contain one chrominance component for every pixel in the - * source image. - */ - TJSAMP_444 = 0, - /** - * 4:2:2 chrominance subsampling. The JPEG or YUV image will contain one - * chrominance component for every 2x1 block of pixels in the source image. - */ - TJSAMP_422, - /** - * 4:2:0 chrominance subsampling. The JPEG or YUV image will contain one - * chrominance component for every 2x2 block of pixels in the source image. - */ - TJSAMP_420, - /** - * Grayscale. The JPEG or YUV image will contain no chrominance components. - */ - TJSAMP_GRAY, - /** - * 4:4:0 chrominance subsampling. The JPEG or YUV image will contain one - * chrominance component for every 1x2 block of pixels in the source image. - * - * @note 4:4:0 subsampling is not fully accelerated in libjpeg-turbo. - */ - TJSAMP_440, - /** - * 4:1:1 chrominance subsampling. The JPEG or YUV image will contain one - * chrominance component for every 4x1 block of pixels in the source image. - * JPEG images compressed with 4:1:1 subsampling will be almost exactly the - * same size as those compressed with 4:2:0 subsampling, and in the - * aggregate, both subsampling methods produce approximately the same - * perceptual quality. However, 4:1:1 is better able to reproduce sharp - * horizontal features. - * - * @note 4:1:1 subsampling is not fully accelerated in libjpeg-turbo. - */ - TJSAMP_411 -}; - -/** - * MCU block width (in pixels) for a given level of chrominance subsampling. - * MCU block sizes: - * - 8x8 for no subsampling or grayscale - * - 16x8 for 4:2:2 - * - 8x16 for 4:4:0 - * - 16x16 for 4:2:0 - * - 32x8 for 4:1:1 - */ -static const int tjMCUWidth[TJ_NUMSAMP] = { 8, 16, 16, 8, 8, 32 }; - -/** - * MCU block height (in pixels) for a given level of chrominance subsampling. - * MCU block sizes: - * - 8x8 for no subsampling or grayscale - * - 16x8 for 4:2:2 - * - 8x16 for 4:4:0 - * - 16x16 for 4:2:0 - * - 32x8 for 4:1:1 - */ -static const int tjMCUHeight[TJ_NUMSAMP] = { 8, 8, 16, 8, 16, 8 }; - - -/** - * The number of pixel formats - */ -#define TJ_NUMPF 12 - -/** - * Pixel formats - */ -enum TJPF { - /** - * RGB pixel format. The red, green, and blue components in the image are - * stored in 3-byte pixels in the order R, G, B from lowest to highest byte - * address within each pixel. - */ - TJPF_RGB = 0, - /** - * BGR pixel format. The red, green, and blue components in the image are - * stored in 3-byte pixels in the order B, G, R from lowest to highest byte - * address within each pixel. - */ - TJPF_BGR, - /** - * RGBX pixel format. The red, green, and blue components in the image are - * stored in 4-byte pixels in the order R, G, B from lowest to highest byte - * address within each pixel. The X component is ignored when compressing - * and undefined when decompressing. - */ - TJPF_RGBX, - /** - * BGRX pixel format. The red, green, and blue components in the image are - * stored in 4-byte pixels in the order B, G, R from lowest to highest byte - * address within each pixel. The X component is ignored when compressing - * and undefined when decompressing. - */ - TJPF_BGRX, - /** - * XBGR pixel format. The red, green, and blue components in the image are - * stored in 4-byte pixels in the order R, G, B from highest to lowest byte - * address within each pixel. The X component is ignored when compressing - * and undefined when decompressing. - */ - TJPF_XBGR, - /** - * XRGB pixel format. The red, green, and blue components in the image are - * stored in 4-byte pixels in the order B, G, R from highest to lowest byte - * address within each pixel. The X component is ignored when compressing - * and undefined when decompressing. - */ - TJPF_XRGB, - /** - * Grayscale pixel format. Each 1-byte pixel represents a luminance - * (brightness) level from 0 to 255. - */ - TJPF_GRAY, - /** - * RGBA pixel format. This is the same as @ref TJPF_RGBX, except that when - * decompressing, the X component is guaranteed to be 0xFF, which can be - * interpreted as an opaque alpha channel. - */ - TJPF_RGBA, - /** - * BGRA pixel format. This is the same as @ref TJPF_BGRX, except that when - * decompressing, the X component is guaranteed to be 0xFF, which can be - * interpreted as an opaque alpha channel. - */ - TJPF_BGRA, - /** - * ABGR pixel format. This is the same as @ref TJPF_XBGR, except that when - * decompressing, the X component is guaranteed to be 0xFF, which can be - * interpreted as an opaque alpha channel. - */ - TJPF_ABGR, - /** - * ARGB pixel format. This is the same as @ref TJPF_XRGB, except that when - * decompressing, the X component is guaranteed to be 0xFF, which can be - * interpreted as an opaque alpha channel. - */ - TJPF_ARGB, - /** - * CMYK pixel format. Unlike RGB, which is an additive color model used - * primarily for display, CMYK (Cyan/Magenta/Yellow/Key) is a subtractive - * color model used primarily for printing. In the CMYK color model, the - * value of each color component typically corresponds to an amount of cyan, - * magenta, yellow, or black ink that is applied to a white background. In - * order to convert between CMYK and RGB, it is necessary to use a color - * management system (CMS.) A CMS will attempt to map colors within the - * printer's gamut to perceptually similar colors in the display's gamut and - * vice versa, but the mapping is typically not 1:1 or reversible, nor can it - * be defined with a simple formula. Thus, such a conversion is out of scope - * for a codec library. However, the TurboJPEG API allows for compressing - * CMYK pixels into a YCCK JPEG image (see #TJCS_YCCK) and decompressing YCCK - * JPEG images into CMYK pixels. - */ - TJPF_CMYK, - /** - * Unknown pixel format. Currently this is only used by #tjLoadImage(). - */ - TJPF_UNKNOWN = -1 -}; - -/** - * Red offset (in bytes) for a given pixel format. This specifies the number - * of bytes that the red component is offset from the start of the pixel. For - * instance, if a pixel of format TJ_BGRX is stored in char pixel[], - * then the red component will be pixel[tjRedOffset[TJ_BGRX]]. This - * will be -1 if the pixel format does not have a red component. - */ -static const int tjRedOffset[TJ_NUMPF] = { - 0, 2, 0, 2, 3, 1, -1, 0, 2, 3, 1, -1 -}; -/** - * Green offset (in bytes) for a given pixel format. This specifies the number - * of bytes that the green component is offset from the start of the pixel. - * For instance, if a pixel of format TJ_BGRX is stored in - * char pixel[], then the green component will be - * pixel[tjGreenOffset[TJ_BGRX]]. This will be -1 if the pixel format - * does not have a green component. - */ -static const int tjGreenOffset[TJ_NUMPF] = { - 1, 1, 1, 1, 2, 2, -1, 1, 1, 2, 2, -1 -}; -/** - * Blue offset (in bytes) for a given pixel format. This specifies the number - * of bytes that the Blue component is offset from the start of the pixel. For - * instance, if a pixel of format TJ_BGRX is stored in char pixel[], - * then the blue component will be pixel[tjBlueOffset[TJ_BGRX]]. This - * will be -1 if the pixel format does not have a blue component. - */ -static const int tjBlueOffset[TJ_NUMPF] = { - 2, 0, 2, 0, 1, 3, -1, 2, 0, 1, 3, -1 -}; -/** - * Alpha offset (in bytes) for a given pixel format. This specifies the number - * of bytes that the Alpha component is offset from the start of the pixel. - * For instance, if a pixel of format TJ_BGRA is stored in - * char pixel[], then the alpha component will be - * pixel[tjAlphaOffset[TJ_BGRA]]. This will be -1 if the pixel format - * does not have an alpha component. - */ -static const int tjAlphaOffset[TJ_NUMPF] = { - -1, -1, -1, -1, -1, -1, -1, 3, 3, 0, 0, -1 -}; -/** - * Pixel size (in bytes) for a given pixel format - */ -static const int tjPixelSize[TJ_NUMPF] = { - 3, 3, 4, 4, 4, 4, 1, 4, 4, 4, 4, 4 -}; - - -/** - * The number of JPEG colorspaces - */ -#define TJ_NUMCS 5 - -/** - * JPEG colorspaces - */ -enum TJCS { - /** - * RGB colorspace. When compressing the JPEG image, the R, G, and B - * components in the source image are reordered into image planes, but no - * colorspace conversion or subsampling is performed. RGB JPEG images can be - * decompressed to any of the extended RGB pixel formats or grayscale, but - * they cannot be decompressed to YUV images. - */ - TJCS_RGB = 0, - /** - * YCbCr colorspace. YCbCr is not an absolute colorspace but rather a - * mathematical transformation of RGB designed solely for storage and - * transmission. YCbCr images must be converted to RGB before they can - * actually be displayed. In the YCbCr colorspace, the Y (luminance) - * component represents the black & white portion of the original image, and - * the Cb and Cr (chrominance) components represent the color portion of the - * original image. Originally, the analog equivalent of this transformation - * allowed the same signal to drive both black & white and color televisions, - * but JPEG images use YCbCr primarily because it allows the color data to be - * optionally subsampled for the purposes of reducing bandwidth or disk - * space. YCbCr is the most common JPEG colorspace, and YCbCr JPEG images - * can be compressed from and decompressed to any of the extended RGB pixel - * formats or grayscale, or they can be decompressed to YUV planar images. - */ - TJCS_YCbCr, - /** - * Grayscale colorspace. The JPEG image retains only the luminance data (Y - * component), and any color data from the source image is discarded. - * Grayscale JPEG images can be compressed from and decompressed to any of - * the extended RGB pixel formats or grayscale, or they can be decompressed - * to YUV planar images. - */ - TJCS_GRAY, - /** - * CMYK colorspace. When compressing the JPEG image, the C, M, Y, and K - * components in the source image are reordered into image planes, but no - * colorspace conversion or subsampling is performed. CMYK JPEG images can - * only be decompressed to CMYK pixels. - */ - TJCS_CMYK, - /** - * YCCK colorspace. YCCK (AKA "YCbCrK") is not an absolute colorspace but - * rather a mathematical transformation of CMYK designed solely for storage - * and transmission. It is to CMYK as YCbCr is to RGB. CMYK pixels can be - * reversibly transformed into YCCK, and as with YCbCr, the chrominance - * components in the YCCK pixels can be subsampled without incurring major - * perceptual loss. YCCK JPEG images can only be compressed from and - * decompressed to CMYK pixels. - */ - TJCS_YCCK -}; - - -/** - * The uncompressed source/destination image is stored in bottom-up (Windows, - * OpenGL) order, not top-down (X11) order. - */ -#define TJFLAG_BOTTOMUP 2 -/** - * When decompressing an image that was compressed using chrominance - * subsampling, use the fastest chrominance upsampling algorithm available in - * the underlying codec. The default is to use smooth upsampling, which - * creates a smooth transition between neighboring chrominance components in - * order to reduce upsampling artifacts in the decompressed image. - */ -#define TJFLAG_FASTUPSAMPLE 256 -/** - * Disable buffer (re)allocation. If passed to one of the JPEG compression or - * transform functions, this flag will cause those functions to generate an - * error if the JPEG image buffer is invalid or too small rather than - * attempting to allocate or reallocate that buffer. This reproduces the - * behavior of earlier versions of TurboJPEG. - */ -#define TJFLAG_NOREALLOC 1024 -/** - * Use the fastest DCT/IDCT algorithm available in the underlying codec. The - * default if this flag is not specified is implementation-specific. For - * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast - * algorithm by default when compressing, because this has been shown to have - * only a very slight effect on accuracy, but it uses the accurate algorithm - * when decompressing, because this has been shown to have a larger effect. - */ -#define TJFLAG_FASTDCT 2048 -/** - * Use the most accurate DCT/IDCT algorithm available in the underlying codec. - * The default if this flag is not specified is implementation-specific. For - * example, the implementation of TurboJPEG for libjpeg[-turbo] uses the fast - * algorithm by default when compressing, because this has been shown to have - * only a very slight effect on accuracy, but it uses the accurate algorithm - * when decompressing, because this has been shown to have a larger effect. - */ -#define TJFLAG_ACCURATEDCT 4096 -/** - * Immediately discontinue the current compression/decompression/transform - * operation if the underlying codec throws a warning (non-fatal error). The - * default behavior is to allow the operation to complete unless a fatal error - * is encountered. - */ -#define TJFLAG_STOPONWARNING 8192 -/** - * Use progressive entropy coding in JPEG images generated by the compression - * and transform functions. Progressive entropy coding will generally improve - * compression relative to baseline entropy coding (the default), but it will - * reduce compression and decompression performance considerably. - */ -#define TJFLAG_PROGRESSIVE 16384 - - -/** - * The number of error codes - */ -#define TJ_NUMERR 2 - -/** - * Error codes - */ -enum TJERR { - /** - * The error was non-fatal and recoverable, but the image may still be - * corrupt. - */ - TJERR_WARNING = 0, - /** - * The error was fatal and non-recoverable. - */ - TJERR_FATAL -}; - - -/** - * The number of transform operations - */ -#define TJ_NUMXOP 8 - -/** - * Transform operations for #tjTransform() - */ -enum TJXOP { - /** - * Do not transform the position of the image pixels - */ - TJXOP_NONE = 0, - /** - * Flip (mirror) image horizontally. This transform is imperfect if there - * are any partial MCU blocks on the right edge (see #TJXOPT_PERFECT.) - */ - TJXOP_HFLIP, - /** - * Flip (mirror) image vertically. This transform is imperfect if there are - * any partial MCU blocks on the bottom edge (see #TJXOPT_PERFECT.) - */ - TJXOP_VFLIP, - /** - * Transpose image (flip/mirror along upper left to lower right axis.) This - * transform is always perfect. - */ - TJXOP_TRANSPOSE, - /** - * Transverse transpose image (flip/mirror along upper right to lower left - * axis.) This transform is imperfect if there are any partial MCU blocks in - * the image (see #TJXOPT_PERFECT.) - */ - TJXOP_TRANSVERSE, - /** - * Rotate image clockwise by 90 degrees. This transform is imperfect if - * there are any partial MCU blocks on the bottom edge (see - * #TJXOPT_PERFECT.) - */ - TJXOP_ROT90, - /** - * Rotate image 180 degrees. This transform is imperfect if there are any - * partial MCU blocks in the image (see #TJXOPT_PERFECT.) - */ - TJXOP_ROT180, - /** - * Rotate image counter-clockwise by 90 degrees. This transform is imperfect - * if there are any partial MCU blocks on the right edge (see - * #TJXOPT_PERFECT.) - */ - TJXOP_ROT270 -}; - - -/** - * This option will cause #tjTransform() to return an error if the transform is - * not perfect. Lossless transforms operate on MCU blocks, whose size depends - * on the level of chrominance subsampling used (see #tjMCUWidth - * and #tjMCUHeight.) If the image's width or height is not evenly divisible - * by the MCU block size, then there will be partial MCU blocks on the right - * and/or bottom edges. It is not possible to move these partial MCU blocks to - * the top or left of the image, so any transform that would require that is - * "imperfect." If this option is not specified, then any partial MCU blocks - * that cannot be transformed will be left in place, which will create - * odd-looking strips on the right or bottom edge of the image. - */ -#define TJXOPT_PERFECT 1 -/** - * This option will cause #tjTransform() to discard any partial MCU blocks that - * cannot be transformed. - */ -#define TJXOPT_TRIM 2 -/** - * This option will enable lossless cropping. See #tjTransform() for more - * information. - */ -#define TJXOPT_CROP 4 -/** - * This option will discard the color data in the input image and produce - * a grayscale output image. - */ -#define TJXOPT_GRAY 8 -/** - * This option will prevent #tjTransform() from outputting a JPEG image for - * this particular transform (this can be used in conjunction with a custom - * filter to capture the transformed DCT coefficients without transcoding - * them.) - */ -#define TJXOPT_NOOUTPUT 16 -/** - * This option will enable progressive entropy coding in the output image - * generated by this particular transform. Progressive entropy coding will - * generally improve compression relative to baseline entropy coding (the - * default), but it will reduce compression and decompression performance - * considerably. - */ -#define TJXOPT_PROGRESSIVE 32 -/** - * This option will prevent #tjTransform() from copying any extra markers - * (including EXIF and ICC profile data) from the source image to the output - * image. - */ -#define TJXOPT_COPYNONE 64 - - -/** - * Scaling factor - */ -typedef struct { - /** - * Numerator - */ - int num; - /** - * Denominator - */ - int denom; -} tjscalingfactor; - -/** - * Cropping region - */ -typedef struct { - /** - * The left boundary of the cropping region. This must be evenly divisible - * by the MCU block width (see #tjMCUWidth.) - */ - int x; - /** - * The upper boundary of the cropping region. This must be evenly divisible - * by the MCU block height (see #tjMCUHeight.) - */ - int y; - /** - * The width of the cropping region. Setting this to 0 is the equivalent of - * setting it to the width of the source JPEG image - x. - */ - int w; - /** - * The height of the cropping region. Setting this to 0 is the equivalent of - * setting it to the height of the source JPEG image - y. - */ - int h; -} tjregion; - -/** - * Lossless transform - */ -typedef struct tjtransform { - /** - * Cropping region - */ - tjregion r; - /** - * One of the @ref TJXOP "transform operations" - */ - int op; - /** - * The bitwise OR of one of more of the @ref TJXOPT_CROP "transform options" - */ - int options; - /** - * Arbitrary data that can be accessed within the body of the callback - * function - */ - void *data; - /** - * A callback function that can be used to modify the DCT coefficients - * after they are losslessly transformed but before they are transcoded to a - * new JPEG image. This allows for custom filters or other transformations - * to be applied in the frequency domain. - * - * @param coeffs pointer to an array of transformed DCT coefficients. (NOTE: - * this pointer is not guaranteed to be valid once the callback returns, so - * applications wishing to hand off the DCT coefficients to another function - * or library should make a copy of them within the body of the callback.) - * - * @param arrayRegion #tjregion structure containing the width and height of - * the array pointed to by coeffs as well as its offset relative to - * the component plane. TurboJPEG implementations may choose to split each - * component plane into multiple DCT coefficient arrays and call the callback - * function once for each array. - * - * @param planeRegion #tjregion structure containing the width and height of - * the component plane to which coeffs belongs - * - * @param componentID ID number of the component plane to which - * coeffs belongs (Y, Cb, and Cr have, respectively, ID's of 0, 1, - * and 2 in typical JPEG images.) - * - * @param transformID ID number of the transformed image to which - * coeffs belongs. This is the same as the index of the transform - * in the transforms array that was passed to #tjTransform(). - * - * @param transform a pointer to a #tjtransform structure that specifies the - * parameters and/or cropping region for this transform - * - * @return 0 if the callback was successful, or -1 if an error occurred. - */ - int (*customFilter) (short *coeffs, tjregion arrayRegion, - tjregion planeRegion, int componentIndex, - int transformIndex, struct tjtransform *transform); -} tjtransform; - -/** - * TurboJPEG instance handle - */ -typedef void *tjhandle; - - -/** - * Pad the given width to the nearest 32-bit boundary - */ -#define TJPAD(width) (((width) + 3) & (~3)) - -/** - * Compute the scaled value of dimension using the given scaling - * factor. This macro performs the integer equivalent of ceil(dimension * - * scalingFactor). - */ -#define TJSCALED(dimension, scalingFactor) \ - ((dimension * scalingFactor.num + scalingFactor.denom - 1) / \ - scalingFactor.denom) - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * Create a TurboJPEG compressor instance. - * - * @return a handle to the newly-created instance, or NULL if an error - * occurred (see #tjGetErrorStr2().) - */ -DLLEXPORT tjhandle tjInitCompress(void); - - -/** - * Compress an RGB, grayscale, or CMYK image into a JPEG image. - * - * @param handle a handle to a TurboJPEG compressor or transformer instance - * - * @param srcBuf pointer to an image buffer containing RGB, grayscale, or - * CMYK pixels to be compressed - * - * @param width width (in pixels) of the source image - * - * @param pitch bytes per line in the source image. Normally, this should be - * width * #tjPixelSize[pixelFormat] if the image is unpadded, or - * #TJPAD(width * #tjPixelSize[pixelFormat]) if each line of the image - * is padded to the nearest 32-bit boundary, as is the case for Windows - * bitmaps. You can also be clever and use this parameter to skip lines, etc. - * Setting this parameter to 0 is the equivalent of setting it to - * width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the source image - * - * @param pixelFormat pixel format of the source image (see @ref TJPF - * "Pixel formats".) - * - * @param jpegBuf address of a pointer to an image buffer that will receive the - * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer - * to accommodate the size of the JPEG image. Thus, you can choose to: - * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and - * let TurboJPEG grow the buffer as needed, - * -# set *jpegBuf to NULL to tell TurboJPEG to allocate the buffer - * for you, or - * -# pre-allocate the buffer to a "worst case" size determined by calling - * #tjBufSize(). This should ensure that the buffer never has to be - * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.) - * . - * If you choose option 1, *jpegSize should be set to the size of your - * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC, - * you should always check *jpegBuf upon return from this function, as - * it may have changed. - * - * @param jpegSize pointer to an unsigned long variable that holds the size of - * the JPEG image buffer. If *jpegBuf points to a pre-allocated - * buffer, then *jpegSize should be set to the size of the buffer. - * Upon return, *jpegSize will contain the size of the JPEG image (in - * bytes.) If *jpegBuf points to a JPEG image buffer that is being - * reused from a previous call to one of the JPEG compression functions, then - * *jpegSize is ignored. - * - * @param jpegSubsamp the level of chrominance subsampling to be used when - * generating the JPEG image (see @ref TJSAMP - * "Chrominance subsampling options".) - * - * @param jpegQual the image quality of the generated JPEG image (1 = worst, - * 100 = best) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjCompress2(tjhandle handle, const unsigned char *srcBuf, - int width, int pitch, int height, int pixelFormat, - unsigned char **jpegBuf, unsigned long *jpegSize, - int jpegSubsamp, int jpegQual, int flags); - - -/** - * Compress a YUV planar image into a JPEG image. - * - * @param handle a handle to a TurboJPEG compressor or transformer instance - * - * @param srcBuf pointer to an image buffer containing a YUV planar image to be - * compressed. The size of this buffer should match the value returned by - * #tjBufSizeYUV2() for the given image width, height, padding, and level of - * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be - * stored sequentially in the source buffer (refer to @ref YUVnotes - * "YUV Image Format Notes".) - * - * @param width width (in pixels) of the source image. If the width is not an - * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate - * buffer copy will be performed within TurboJPEG. - * - * @param pad the line padding used in the source image. For instance, if each - * line in each plane of the YUV image is padded to the nearest multiple of 4 - * bytes, then pad should be set to 4. - * - * @param height height (in pixels) of the source image. If the height is not - * an even multiple of the MCU block height (see #tjMCUHeight), then an - * intermediate buffer copy will be performed within TurboJPEG. - * - * @param subsamp the level of chrominance subsampling used in the source - * image (see @ref TJSAMP "Chrominance subsampling options".) - * - * @param jpegBuf address of a pointer to an image buffer that will receive the - * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to - * accommodate the size of the JPEG image. Thus, you can choose to: - * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and - * let TurboJPEG grow the buffer as needed, - * -# set *jpegBuf to NULL to tell TurboJPEG to allocate the buffer - * for you, or - * -# pre-allocate the buffer to a "worst case" size determined by calling - * #tjBufSize(). This should ensure that the buffer never has to be - * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.) - * . - * If you choose option 1, *jpegSize should be set to the size of your - * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC, - * you should always check *jpegBuf upon return from this function, as - * it may have changed. - * - * @param jpegSize pointer to an unsigned long variable that holds the size of - * the JPEG image buffer. If *jpegBuf points to a pre-allocated - * buffer, then *jpegSize should be set to the size of the buffer. - * Upon return, *jpegSize will contain the size of the JPEG image (in - * bytes.) If *jpegBuf points to a JPEG image buffer that is being - * reused from a previous call to one of the JPEG compression functions, then - * *jpegSize is ignored. - * - * @param jpegQual the image quality of the generated JPEG image (1 = worst, - * 100 = best) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjCompressFromYUV(tjhandle handle, const unsigned char *srcBuf, - int width, int pad, int height, int subsamp, - unsigned char **jpegBuf, - unsigned long *jpegSize, int jpegQual, - int flags); - - -/** - * Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. - * - * @param handle a handle to a TurboJPEG compressor or transformer instance - * - * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes - * (or just a Y plane, if compressing a grayscale image) that contain a YUV - * image to be compressed. These planes can be contiguous or non-contiguous in - * memory. The size of each plane should match the value returned by - * #tjPlaneSizeYUV() for the given image width, height, strides, and level of - * chrominance subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" - * for more details. - * - * @param width width (in pixels) of the source image. If the width is not an - * even multiple of the MCU block width (see #tjMCUWidth), then an intermediate - * buffer copy will be performed within TurboJPEG. - * - * @param strides an array of integers, each specifying the number of bytes per - * line in the corresponding plane of the YUV source image. Setting the stride - * for any plane to 0 is the same as setting it to the plane width (see - * @ref YUVnotes "YUV Image Format Notes".) If strides is NULL, then - * the strides for all planes will be set to their respective plane widths. - * You can adjust the strides in order to specify an arbitrary amount of line - * padding in each plane or to create a JPEG image from a subregion of a larger - * YUV planar image. - * - * @param height height (in pixels) of the source image. If the height is not - * an even multiple of the MCU block height (see #tjMCUHeight), then an - * intermediate buffer copy will be performed within TurboJPEG. - * - * @param subsamp the level of chrominance subsampling used in the source - * image (see @ref TJSAMP "Chrominance subsampling options".) - * - * @param jpegBuf address of a pointer to an image buffer that will receive the - * JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to - * accommodate the size of the JPEG image. Thus, you can choose to: - * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and - * let TurboJPEG grow the buffer as needed, - * -# set *jpegBuf to NULL to tell TurboJPEG to allocate the buffer - * for you, or - * -# pre-allocate the buffer to a "worst case" size determined by calling - * #tjBufSize(). This should ensure that the buffer never has to be - * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.) - * . - * If you choose option 1, *jpegSize should be set to the size of your - * pre-allocated buffer. In any case, unless you have set #TJFLAG_NOREALLOC, - * you should always check *jpegBuf upon return from this function, as - * it may have changed. - * - * @param jpegSize pointer to an unsigned long variable that holds the size of - * the JPEG image buffer. If *jpegBuf points to a pre-allocated - * buffer, then *jpegSize should be set to the size of the buffer. - * Upon return, *jpegSize will contain the size of the JPEG image (in - * bytes.) If *jpegBuf points to a JPEG image buffer that is being - * reused from a previous call to one of the JPEG compression functions, then - * *jpegSize is ignored. - * - * @param jpegQual the image quality of the generated JPEG image (1 = worst, - * 100 = best) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjCompressFromYUVPlanes(tjhandle handle, - const unsigned char **srcPlanes, - int width, const int *strides, - int height, int subsamp, - unsigned char **jpegBuf, - unsigned long *jpegSize, int jpegQual, - int flags); - - -/** - * The maximum size of the buffer (in bytes) required to hold a JPEG image with - * the given parameters. The number of bytes returned by this function is - * larger than the size of the uncompressed source image. The reason for this - * is that the JPEG format uses 16-bit coefficients, and it is thus possible - * for a very high-quality JPEG image with very high-frequency content to - * expand rather than compress when converted to the JPEG format. Such images - * represent a very rare corner case, but since there is no way to predict the - * size of a JPEG image prior to compression, the corner case has to be - * handled. - * - * @param width width (in pixels) of the image - * - * @param height height (in pixels) of the image - * - * @param jpegSubsamp the level of chrominance subsampling to be used when - * generating the JPEG image (see @ref TJSAMP - * "Chrominance subsampling options".) - * - * @return the maximum size of the buffer (in bytes) required to hold the - * image, or -1 if the arguments are out of bounds. - */ -DLLEXPORT unsigned long tjBufSize(int width, int height, int jpegSubsamp); - - -/** - * The size of the buffer (in bytes) required to hold a YUV planar image with - * the given parameters. - * - * @param width width (in pixels) of the image - * - * @param pad the width of each line in each plane of the image is padded to - * the nearest multiple of this number of bytes (must be a power of 2.) - * - * @param height height (in pixels) of the image - * - * @param subsamp level of chrominance subsampling in the image (see - * @ref TJSAMP "Chrominance subsampling options".) - * - * @return the size of the buffer (in bytes) required to hold the image, or - * -1 if the arguments are out of bounds. - */ -DLLEXPORT unsigned long tjBufSizeYUV2(int width, int pad, int height, - int subsamp); - - -/** - * The size of the buffer (in bytes) required to hold a YUV image plane with - * the given parameters. - * - * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr) - * - * @param width width (in pixels) of the YUV image. NOTE: this is the width of - * the whole image, not the plane width. - * - * @param stride bytes per line in the image plane. Setting this to 0 is the - * equivalent of setting it to the plane width. - * - * @param height height (in pixels) of the YUV image. NOTE: this is the height - * of the whole image, not the plane height. - * - * @param subsamp level of chrominance subsampling in the image (see - * @ref TJSAMP "Chrominance subsampling options".) - * - * @return the size of the buffer (in bytes) required to hold the YUV image - * plane, or -1 if the arguments are out of bounds. - */ -DLLEXPORT unsigned long tjPlaneSizeYUV(int componentID, int width, int stride, - int height, int subsamp); - - -/** - * The plane width of a YUV image plane with the given parameters. Refer to - * @ref YUVnotes "YUV Image Format Notes" for a description of plane width. - * - * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr) - * - * @param width width (in pixels) of the YUV image - * - * @param subsamp level of chrominance subsampling in the image (see - * @ref TJSAMP "Chrominance subsampling options".) - * - * @return the plane width of a YUV image plane with the given parameters, or - * -1 if the arguments are out of bounds. - */ -DLLEXPORT int tjPlaneWidth(int componentID, int width, int subsamp); - - -/** - * The plane height of a YUV image plane with the given parameters. Refer to - * @ref YUVnotes "YUV Image Format Notes" for a description of plane height. - * - * @param componentID ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr) - * - * @param height height (in pixels) of the YUV image - * - * @param subsamp level of chrominance subsampling in the image (see - * @ref TJSAMP "Chrominance subsampling options".) - * - * @return the plane height of a YUV image plane with the given parameters, or - * -1 if the arguments are out of bounds. - */ -DLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp); - - -/** - * Encode an RGB or grayscale image into a YUV planar image. This function - * uses the accelerated color conversion routines in the underlying - * codec but does not execute any of the other steps in the JPEG compression - * process. - * - * @param handle a handle to a TurboJPEG compressor or transformer instance - * - * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels - * to be encoded - * - * @param width width (in pixels) of the source image - * - * @param pitch bytes per line in the source image. Normally, this should be - * width * #tjPixelSize[pixelFormat] if the image is unpadded, or - * #TJPAD(width * #tjPixelSize[pixelFormat]) if each line of the image - * is padded to the nearest 32-bit boundary, as is the case for Windows - * bitmaps. You can also be clever and use this parameter to skip lines, etc. - * Setting this parameter to 0 is the equivalent of setting it to - * width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the source image - * - * @param pixelFormat pixel format of the source image (see @ref TJPF - * "Pixel formats".) - * - * @param dstBuf pointer to an image buffer that will receive the YUV image. - * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based - * on the image width, height, padding, and level of chrominance subsampling. - * The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the - * buffer (refer to @ref YUVnotes "YUV Image Format Notes".) - * - * @param pad the width of each line in each plane of the YUV image will be - * padded to the nearest multiple of this number of bytes (must be a power of - * 2.) To generate images suitable for X Video, pad should be set to - * 4. - * - * @param subsamp the level of chrominance subsampling to be used when - * generating the YUV image (see @ref TJSAMP - * "Chrominance subsampling options".) To generate images suitable for X - * Video, subsamp should be set to @ref TJSAMP_420. This produces an - * image compatible with the I420 (AKA "YUV420P") format. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjEncodeYUV3(tjhandle handle, const unsigned char *srcBuf, - int width, int pitch, int height, int pixelFormat, - unsigned char *dstBuf, int pad, int subsamp, - int flags); - - -/** - * Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image - * planes. This function uses the accelerated color conversion routines in the - * underlying codec but does not execute any of the other steps in the JPEG - * compression process. - * - * @param handle a handle to a TurboJPEG compressor or transformer instance - * - * @param srcBuf pointer to an image buffer containing RGB or grayscale pixels - * to be encoded - * - * @param width width (in pixels) of the source image - * - * @param pitch bytes per line in the source image. Normally, this should be - * width * #tjPixelSize[pixelFormat] if the image is unpadded, or - * #TJPAD(width * #tjPixelSize[pixelFormat]) if each line of the image - * is padded to the nearest 32-bit boundary, as is the case for Windows - * bitmaps. You can also be clever and use this parameter to skip lines, etc. - * Setting this parameter to 0 is the equivalent of setting it to - * width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the source image - * - * @param pixelFormat pixel format of the source image (see @ref TJPF - * "Pixel formats".) - * - * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes - * (or just a Y plane, if generating a grayscale image) that will receive the - * encoded image. These planes can be contiguous or non-contiguous in memory. - * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based - * on the image width, height, strides, and level of chrominance subsampling. - * Refer to @ref YUVnotes "YUV Image Format Notes" for more details. - * - * @param strides an array of integers, each specifying the number of bytes per - * line in the corresponding plane of the output image. Setting the stride for - * any plane to 0 is the same as setting it to the plane width (see - * @ref YUVnotes "YUV Image Format Notes".) If strides is NULL, then - * the strides for all planes will be set to their respective plane widths. - * You can adjust the strides in order to add an arbitrary amount of line - * padding to each plane or to encode an RGB or grayscale image into a - * subregion of a larger YUV planar image. - * - * @param subsamp the level of chrominance subsampling to be used when - * generating the YUV image (see @ref TJSAMP - * "Chrominance subsampling options".) To generate images suitable for X - * Video, subsamp should be set to @ref TJSAMP_420. This produces an - * image compatible with the I420 (AKA "YUV420P") format. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjEncodeYUVPlanes(tjhandle handle, const unsigned char *srcBuf, - int width, int pitch, int height, - int pixelFormat, unsigned char **dstPlanes, - int *strides, int subsamp, int flags); - - -/** - * Create a TurboJPEG decompressor instance. - * - * @return a handle to the newly-created instance, or NULL if an error - * occurred (see #tjGetErrorStr2().) -*/ -DLLEXPORT tjhandle tjInitDecompress(void); - - -/** - * Retrieve information about a JPEG image without decompressing it. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param jpegBuf pointer to a buffer containing a JPEG image - * - * @param jpegSize size of the JPEG image (in bytes) - * - * @param width pointer to an integer variable that will receive the width (in - * pixels) of the JPEG image - * - * @param height pointer to an integer variable that will receive the height - * (in pixels) of the JPEG image - * - * @param jpegSubsamp pointer to an integer variable that will receive the - * level of chrominance subsampling used when the JPEG image was compressed - * (see @ref TJSAMP "Chrominance subsampling options".) - * - * @param jpegColorspace pointer to an integer variable that will receive one - * of the JPEG colorspace constants, indicating the colorspace of the JPEG - * image (see @ref TJCS "JPEG colorspaces".) - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) -*/ -DLLEXPORT int tjDecompressHeader3(tjhandle handle, - const unsigned char *jpegBuf, - unsigned long jpegSize, int *width, - int *height, int *jpegSubsamp, - int *jpegColorspace); - - -/** - * Returns a list of fractional scaling factors that the JPEG decompressor in - * this implementation of TurboJPEG supports. - * - * @param numscalingfactors pointer to an integer variable that will receive - * the number of elements in the list - * - * @return a pointer to a list of fractional scaling factors, or NULL if an - * error is encountered (see #tjGetErrorStr2().) -*/ -DLLEXPORT tjscalingfactor *tjGetScalingFactors(int *numscalingfactors); - - -/** - * Decompress a JPEG image to an RGB, grayscale, or CMYK image. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress - * - * @param jpegSize size of the JPEG image (in bytes) - * - * @param dstBuf pointer to an image buffer that will receive the decompressed - * image. This buffer should normally be pitch * scaledHeight bytes - * in size, where scaledHeight can be determined by calling - * #TJSCALED() with the JPEG image height and one of the scaling factors - * returned by #tjGetScalingFactors(). The dstBuf pointer may also be - * used to decompress into a specific region of a larger buffer. - * - * @param width desired width (in pixels) of the destination image. If this is - * different than the width of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired width. If width is - * set to 0, then only the height will be considered when determining the - * scaled image size. - * - * @param pitch bytes per line in the destination image. Normally, this is - * scaledWidth * #tjPixelSize[pixelFormat] if the decompressed image - * is unpadded, else #TJPAD(scaledWidth * #tjPixelSize[pixelFormat]) - * if each line of the decompressed image is padded to the nearest 32-bit - * boundary, as is the case for Windows bitmaps. (NOTE: scaledWidth - * can be determined by calling #TJSCALED() with the JPEG image width and one - * of the scaling factors returned by #tjGetScalingFactors().) You can also be - * clever and use the pitch parameter to skip lines, etc. Setting this - * parameter to 0 is the equivalent of setting it to - * scaledWidth * #tjPixelSize[pixelFormat]. - * - * @param height desired height (in pixels) of the destination image. If this - * is different than the height of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired height. If height - * is set to 0, then only the width will be considered when determining the - * scaled image size. - * - * @param pixelFormat pixel format of the destination image (see @ref - * TJPF "Pixel formats".) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjDecompress2(tjhandle handle, const unsigned char *jpegBuf, - unsigned long jpegSize, unsigned char *dstBuf, - int width, int pitch, int height, int pixelFormat, - int flags); - - -/** - * Decompress a JPEG image to a YUV planar image. This function performs JPEG - * decompression but leaves out the color conversion step, so a planar YUV - * image is generated instead of an RGB image. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress - * - * @param jpegSize size of the JPEG image (in bytes) - * - * @param dstBuf pointer to an image buffer that will receive the YUV image. - * Use #tjBufSizeYUV2() to determine the appropriate size for this buffer based - * on the image width, height, padding, and level of subsampling. The Y, - * U (Cb), and V (Cr) image planes will be stored sequentially in the buffer - * (refer to @ref YUVnotes "YUV Image Format Notes".) - * - * @param width desired width (in pixels) of the YUV image. If this is - * different than the width of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired width. If width is - * set to 0, then only the height will be considered when determining the - * scaled image size. If the scaled width is not an even multiple of the MCU - * block width (see #tjMCUWidth), then an intermediate buffer copy will be - * performed within TurboJPEG. - * - * @param pad the width of each line in each plane of the YUV image will be - * padded to the nearest multiple of this number of bytes (must be a power of - * 2.) To generate images suitable for X Video, pad should be set to - * 4. - * - * @param height desired height (in pixels) of the YUV image. If this is - * different than the height of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired height. If height - * is set to 0, then only the width will be considered when determining the - * scaled image size. If the scaled height is not an even multiple of the MCU - * block height (see #tjMCUHeight), then an intermediate buffer copy will be - * performed within TurboJPEG. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjDecompressToYUV2(tjhandle handle, const unsigned char *jpegBuf, - unsigned long jpegSize, unsigned char *dstBuf, - int width, int pad, int height, int flags); - - -/** - * Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image - * planes. This function performs JPEG decompression but leaves out the color - * conversion step, so a planar YUV image is generated instead of an RGB image. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param jpegBuf pointer to a buffer containing the JPEG image to decompress - * - * @param jpegSize size of the JPEG image (in bytes) - * - * @param dstPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes - * (or just a Y plane, if decompressing a grayscale image) that will receive - * the YUV image. These planes can be contiguous or non-contiguous in memory. - * Use #tjPlaneSizeYUV() to determine the appropriate size for each plane based - * on the scaled image width, scaled image height, strides, and level of - * chrominance subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" - * for more details. - * - * @param width desired width (in pixels) of the YUV image. If this is - * different than the width of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired width. If width is - * set to 0, then only the height will be considered when determining the - * scaled image size. If the scaled width is not an even multiple of the MCU - * block width (see #tjMCUWidth), then an intermediate buffer copy will be - * performed within TurboJPEG. - * - * @param strides an array of integers, each specifying the number of bytes per - * line in the corresponding plane of the output image. Setting the stride for - * any plane to 0 is the same as setting it to the scaled plane width (see - * @ref YUVnotes "YUV Image Format Notes".) If strides is NULL, then - * the strides for all planes will be set to their respective scaled plane - * widths. You can adjust the strides in order to add an arbitrary amount of - * line padding to each plane or to decompress the JPEG image into a subregion - * of a larger YUV planar image. - * - * @param height desired height (in pixels) of the YUV image. If this is - * different than the height of the JPEG image being decompressed, then - * TurboJPEG will use scaling in the JPEG decompressor to generate the largest - * possible image that will fit within the desired height. If height - * is set to 0, then only the width will be considered when determining the - * scaled image size. If the scaled height is not an even multiple of the MCU - * block height (see #tjMCUHeight), then an intermediate buffer copy will be - * performed within TurboJPEG. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjDecompressToYUVPlanes(tjhandle handle, - const unsigned char *jpegBuf, - unsigned long jpegSize, - unsigned char **dstPlanes, int width, - int *strides, int height, int flags); - - -/** - * Decode a YUV planar image into an RGB or grayscale image. This function - * uses the accelerated color conversion routines in the underlying - * codec but does not execute any of the other steps in the JPEG decompression - * process. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param srcBuf pointer to an image buffer containing a YUV planar image to be - * decoded. The size of this buffer should match the value returned by - * #tjBufSizeYUV2() for the given image width, height, padding, and level of - * chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be - * stored sequentially in the source buffer (refer to @ref YUVnotes - * "YUV Image Format Notes".) - * - * @param pad Use this parameter to specify that the width of each line in each - * plane of the YUV source image is padded to the nearest multiple of this - * number of bytes (must be a power of 2.) - * - * @param subsamp the level of chrominance subsampling used in the YUV source - * image (see @ref TJSAMP "Chrominance subsampling options".) - * - * @param dstBuf pointer to an image buffer that will receive the decoded - * image. This buffer should normally be pitch * height bytes in - * size, but the dstBuf pointer can also be used to decode into a - * specific region of a larger buffer. - * - * @param width width (in pixels) of the source and destination images - * - * @param pitch bytes per line in the destination image. Normally, this should - * be width * #tjPixelSize[pixelFormat] if the destination image is - * unpadded, or #TJPAD(width * #tjPixelSize[pixelFormat]) if each line - * of the destination image should be padded to the nearest 32-bit boundary, as - * is the case for Windows bitmaps. You can also be clever and use the pitch - * parameter to skip lines, etc. Setting this parameter to 0 is the equivalent - * of setting it to width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the source and destination images - * - * @param pixelFormat pixel format of the destination image (see @ref TJPF - * "Pixel formats".) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjDecodeYUV(tjhandle handle, const unsigned char *srcBuf, - int pad, int subsamp, unsigned char *dstBuf, - int width, int pitch, int height, int pixelFormat, - int flags); - - -/** - * Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale - * image. This function uses the accelerated color conversion routines in the - * underlying codec but does not execute any of the other steps in the JPEG - * decompression process. - * - * @param handle a handle to a TurboJPEG decompressor or transformer instance - * - * @param srcPlanes an array of pointers to Y, U (Cb), and V (Cr) image planes - * (or just a Y plane, if decoding a grayscale image) that contain a YUV image - * to be decoded. These planes can be contiguous or non-contiguous in memory. - * The size of each plane should match the value returned by #tjPlaneSizeYUV() - * for the given image width, height, strides, and level of chrominance - * subsampling. Refer to @ref YUVnotes "YUV Image Format Notes" for more - * details. - * - * @param strides an array of integers, each specifying the number of bytes per - * line in the corresponding plane of the YUV source image. Setting the stride - * for any plane to 0 is the same as setting it to the plane width (see - * @ref YUVnotes "YUV Image Format Notes".) If strides is NULL, then - * the strides for all planes will be set to their respective plane widths. - * You can adjust the strides in order to specify an arbitrary amount of line - * padding in each plane or to decode a subregion of a larger YUV planar image. - * - * @param subsamp the level of chrominance subsampling used in the YUV source - * image (see @ref TJSAMP "Chrominance subsampling options".) - * - * @param dstBuf pointer to an image buffer that will receive the decoded - * image. This buffer should normally be pitch * height bytes in - * size, but the dstBuf pointer can also be used to decode into a - * specific region of a larger buffer. - * - * @param width width (in pixels) of the source and destination images - * - * @param pitch bytes per line in the destination image. Normally, this should - * be width * #tjPixelSize[pixelFormat] if the destination image is - * unpadded, or #TJPAD(width * #tjPixelSize[pixelFormat]) if each line - * of the destination image should be padded to the nearest 32-bit boundary, as - * is the case for Windows bitmaps. You can also be clever and use the pitch - * parameter to skip lines, etc. Setting this parameter to 0 is the equivalent - * of setting it to width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the source and destination images - * - * @param pixelFormat pixel format of the destination image (see @ref TJPF - * "Pixel formats".) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjDecodeYUVPlanes(tjhandle handle, - const unsigned char **srcPlanes, - const int *strides, int subsamp, - unsigned char *dstBuf, int width, int pitch, - int height, int pixelFormat, int flags); - - -/** - * Create a new TurboJPEG transformer instance. - * - * @return a handle to the newly-created instance, or NULL if an error - * occurred (see #tjGetErrorStr2().) - */ -DLLEXPORT tjhandle tjInitTransform(void); - - -/** - * Losslessly transform a JPEG image into another JPEG image. Lossless - * transforms work by moving the raw DCT coefficients from one JPEG image - * structure to another without altering the values of the coefficients. While - * this is typically faster than decompressing the image, transforming it, and - * re-compressing it, lossless transforms are not free. Each lossless - * transform requires reading and performing Huffman decoding on all of the - * coefficients in the source image, regardless of the size of the destination - * image. Thus, this function provides a means of generating multiple - * transformed images from the same source or applying multiple - * transformations simultaneously, in order to eliminate the need to read the - * source coefficients multiple times. - * - * @param handle a handle to a TurboJPEG transformer instance - * - * @param jpegBuf pointer to a buffer containing the JPEG source image to - * transform - * - * @param jpegSize size of the JPEG source image (in bytes) - * - * @param n the number of transformed JPEG images to generate - * - * @param dstBufs pointer to an array of n image buffers. dstBufs[i] - * will receive a JPEG image that has been transformed using the parameters in - * transforms[i]. TurboJPEG has the ability to reallocate the JPEG - * buffer to accommodate the size of the JPEG image. Thus, you can choose to: - * -# pre-allocate the JPEG buffer with an arbitrary size using #tjAlloc() and - * let TurboJPEG grow the buffer as needed, - * -# set dstBufs[i] to NULL to tell TurboJPEG to allocate the buffer - * for you, or - * -# pre-allocate the buffer to a "worst case" size determined by calling - * #tjBufSize() with the transformed or cropped width and height. Under normal - * circumstances, this should ensure that the buffer never has to be - * re-allocated (setting #TJFLAG_NOREALLOC guarantees that it won't be.) Note, - * however, that there are some rare cases (such as transforming images with a - * large amount of embedded EXIF or ICC profile data) in which the output image - * will be larger than the worst-case size, and #TJFLAG_NOREALLOC cannot be - * used in those cases. - * . - * If you choose option 1, dstSizes[i] should be set to the size of - * your pre-allocated buffer. In any case, unless you have set - * #TJFLAG_NOREALLOC, you should always check dstBufs[i] upon return - * from this function, as it may have changed. - * - * @param dstSizes pointer to an array of n unsigned long variables that will - * receive the actual sizes (in bytes) of each transformed JPEG image. If - * dstBufs[i] points to a pre-allocated buffer, then - * dstSizes[i] should be set to the size of the buffer. Upon return, - * dstSizes[i] will contain the size of the JPEG image (in bytes.) - * - * @param transforms pointer to an array of n #tjtransform structures, each of - * which specifies the transform parameters and/or cropping region for the - * corresponding transformed output image. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_ACCURATEDCT - * "flags" - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2() - * and #tjGetErrorCode().) - */ -DLLEXPORT int tjTransform(tjhandle handle, const unsigned char *jpegBuf, - unsigned long jpegSize, int n, - unsigned char **dstBufs, unsigned long *dstSizes, - tjtransform *transforms, int flags); - - -/** - * Destroy a TurboJPEG compressor, decompressor, or transformer instance. - * - * @param handle a handle to a TurboJPEG compressor, decompressor or - * transformer instance - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2().) - */ -DLLEXPORT int tjDestroy(tjhandle handle); - - -/** - * Allocate an image buffer for use with TurboJPEG. You should always use - * this function to allocate the JPEG destination buffer(s) for the compression - * and transform functions unless you are disabling automatic buffer - * (re)allocation (by setting #TJFLAG_NOREALLOC.) - * - * @param bytes the number of bytes to allocate - * - * @return a pointer to a newly-allocated buffer with the specified number of - * bytes. - * - * @sa tjFree() - */ -DLLEXPORT unsigned char *tjAlloc(int bytes); - - -/** - * Load an uncompressed image from disk into memory. - * - * @param filename name of a file containing an uncompressed image in Windows - * BMP or PBMPLUS (PPM/PGM) format - * - * @param width pointer to an integer variable that will receive the width (in - * pixels) of the uncompressed image - * - * @param align row alignment of the image buffer to be returned (must be a - * power of 2.) For instance, setting this parameter to 4 will cause all rows - * in the image buffer to be padded to the nearest 32-bit boundary, and setting - * this parameter to 1 will cause all rows in the image buffer to be unpadded. - * - * @param height pointer to an integer variable that will receive the height - * (in pixels) of the uncompressed image - * - * @param pixelFormat pointer to an integer variable that specifies or will - * receive the pixel format of the uncompressed image buffer. The behavior of - * #tjLoadImage() will vary depending on the value of *pixelFormat - * passed to the function: - * - @ref TJPF_UNKNOWN : The uncompressed image buffer returned by the function - * will use the most optimal pixel format for the file type, and - * *pixelFormat will contain the ID of this pixel format upon - * successful return from the function. - * - @ref TJPF_GRAY : Only PGM files and 8-bit BMP files with a grayscale - * colormap can be loaded. - * - @ref TJPF_CMYK : The RGB or grayscale pixels stored in the file will be - * converted using a quick & dirty algorithm that is suitable only for testing - * purposes (proper conversion between CMYK and other formats requires a color - * management system.) - * - Other @ref TJPF "pixel formats" : The uncompressed image buffer will use - * the specified pixel format, and pixel format conversion will be performed if - * necessary. - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP - * "flags". - * - * @return a pointer to a newly-allocated buffer containing the uncompressed - * image, converted to the chosen pixel format and with the chosen row - * alignment, or NULL if an error occurred (see #tjGetErrorStr2().) This - * buffer should be freed using #tjFree(). - */ -DLLEXPORT unsigned char *tjLoadImage(const char *filename, int *width, - int align, int *height, int *pixelFormat, - int flags); - - -/** - * Save an uncompressed image from memory to disk. - * - * @param filename name of a file to which to save the uncompressed image. - * The image will be stored in Windows BMP or PBMPLUS (PPM/PGM) format, - * depending on the file extension. - * - * @param buffer pointer to an image buffer containing RGB, grayscale, or - * CMYK pixels to be saved - * - * @param width width (in pixels) of the uncompressed image - * - * @param pitch bytes per line in the image buffer. Setting this parameter to - * 0 is the equivalent of setting it to - * width * #tjPixelSize[pixelFormat]. - * - * @param height height (in pixels) of the uncompressed image - * - * @param pixelFormat pixel format of the image buffer (see @ref TJPF - * "Pixel formats".) If this parameter is set to @ref TJPF_GRAY, then the - * image will be stored in PGM or 8-bit (indexed color) BMP format. Otherwise, - * the image will be stored in PPM or 24-bit BMP format. If this parameter - * is set to @ref TJPF_CMYK, then the CMYK pixels will be converted to RGB - * using a quick & dirty algorithm that is suitable only for testing (proper - * conversion between CMYK and other formats requires a color management - * system.) - * - * @param flags the bitwise OR of one or more of the @ref TJFLAG_BOTTOMUP - * "flags". - * - * @return 0 if successful, or -1 if an error occurred (see #tjGetErrorStr2().) - */ -DLLEXPORT int tjSaveImage(const char *filename, unsigned char *buffer, - int width, int pitch, int height, int pixelFormat, - int flags); - - -/** - * Free an image buffer previously allocated by TurboJPEG. You should always - * use this function to free JPEG destination buffer(s) that were automatically - * (re)allocated by the compression and transform functions or that were - * manually allocated using #tjAlloc(). - * - * @param buffer address of the buffer to free - * - * @sa tjAlloc() - */ -DLLEXPORT void tjFree(unsigned char *buffer); - - -/** - * Returns a descriptive error message explaining why the last command failed. - * - * @param handle a handle to a TurboJPEG compressor, decompressor, or - * transformer instance, or NULL if the error was generated by a global - * function (but note that retrieving the error message for a global function - * is not thread-safe.) - * - * @return a descriptive error message explaining why the last command failed. - */ -DLLEXPORT char *tjGetErrorStr2(tjhandle handle); - - -/** - * Returns a code indicating the severity of the last error. See - * @ref TJERR "Error codes". - * - * @param handle a handle to a TurboJPEG compressor, decompressor or - * transformer instance - * - * @return a code indicating the severity of the last error. See - * @ref TJERR "Error codes". - */ -DLLEXPORT int tjGetErrorCode(tjhandle handle); - - -/* Deprecated functions and macros */ -#define TJFLAG_FORCEMMX 8 -#define TJFLAG_FORCESSE 16 -#define TJFLAG_FORCESSE2 32 -#define TJFLAG_FORCESSE3 128 - - -/* Backward compatibility functions and macros (nothing to see here) */ -#define NUMSUBOPT TJ_NUMSAMP -#define TJ_444 TJSAMP_444 -#define TJ_422 TJSAMP_422 -#define TJ_420 TJSAMP_420 -#define TJ_411 TJSAMP_420 -#define TJ_GRAYSCALE TJSAMP_GRAY - -#define TJ_BGR 1 -#define TJ_BOTTOMUP TJFLAG_BOTTOMUP -#define TJ_FORCEMMX TJFLAG_FORCEMMX -#define TJ_FORCESSE TJFLAG_FORCESSE -#define TJ_FORCESSE2 TJFLAG_FORCESSE2 -#define TJ_ALPHAFIRST 64 -#define TJ_FORCESSE3 TJFLAG_FORCESSE3 -#define TJ_FASTUPSAMPLE TJFLAG_FASTUPSAMPLE -#define TJ_YUV 512 - -DLLEXPORT unsigned long TJBUFSIZE(int width, int height); - -DLLEXPORT unsigned long TJBUFSIZEYUV(int width, int height, int jpegSubsamp); - -DLLEXPORT unsigned long tjBufSizeYUV(int width, int height, int subsamp); - -DLLEXPORT int tjCompress(tjhandle handle, unsigned char *srcBuf, int width, - int pitch, int height, int pixelSize, - unsigned char *dstBuf, unsigned long *compressedSize, - int jpegSubsamp, int jpegQual, int flags); - -DLLEXPORT int tjEncodeYUV(tjhandle handle, unsigned char *srcBuf, int width, - int pitch, int height, int pixelSize, - unsigned char *dstBuf, int subsamp, int flags); - -DLLEXPORT int tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf, int width, - int pitch, int height, int pixelFormat, - unsigned char *dstBuf, int subsamp, int flags); - -DLLEXPORT int tjDecompressHeader(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, int *width, - int *height); - -DLLEXPORT int tjDecompressHeader2(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, int *width, - int *height, int *jpegSubsamp); - -DLLEXPORT int tjDecompress(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, unsigned char *dstBuf, - int width, int pitch, int height, int pixelSize, - int flags); - -DLLEXPORT int tjDecompressToYUV(tjhandle handle, unsigned char *jpegBuf, - unsigned long jpegSize, unsigned char *dstBuf, - int flags); - -DLLEXPORT char *tjGetErrorStr(void); - - -/** - * @} - */ - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/qt-correction-tool/pub/external/include/twain.h b/qt-correction-tool/pub/external/include/twain.h deleted file mode 100644 index 365c79e..0000000 --- a/qt-correction-tool/pub/external/include/twain.h +++ /dev/null @@ -1,2238 +0,0 @@ -/* ======================================================================== *\ - - Copyright (C) 2007 TWAIN Working Group: Adobe Systems Incorporated, - AnyDoc Software Inc., Eastman Kodak Company, Fujitsu Computer Products - of America, JFL Peripheral Solutions Inc., Ricoh Corporation, and - Xerox Corporation. All rights reserved. - - Copyright (C) 1991, 1992 TWAIN Working Group: Aldus, Caere, Eastman-Kodak, - Hewlett-Packard and Logitech Corporations. All rights reserved. - - Copyright (C) 1997 TWAIN Working Group: Bell+Howell, Canon, DocuMagix, - Fujitsu, Genoa Technology, Hewlett-Packard, Kofax Imaging Products, and - Ricoh Corporation. All rights reserved. - - Copyright (C) 1998 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Eastman Kodak Company, - Fujitsu Computer Products of America, Genoa Technology, - Hewlett-Packard Company, Intel Corporation, Kofax Image Products, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - Copyright (C) 2000 TWAIN Working Group: Adobe Systems Incorporated, - Canon Information Systems, Digimarc Corporation, Eastman Kodak Company, - Fujitsu Computer Products of America, Hewlett-Packard Company, - JFL Peripheral Solutions Inc., Ricoh Corporation, and Xerox Corporation. - All rights reserved. - - - TWAIN.h - This is the definitive include file for applications and - data sources written to the TWAIN specification. - It defines constants, data structures, messages etc. - for the public interface to TWAIN. - - Revision History: - version 1.0, March 6, 1992. TWAIN 1.0. - version 1.1, January 1993. Tech Notes 1.1 - version 1.5, June 1993. Specification Update 1.5 - Change DC to TW - Change filename from DC.H to TWAIN.H - version 1.5, July 1993. Remove spaces from country identifiers - - version 1.7, July 1997 Added Capabilities and data structure for - document imaging and digital cameras. - KHL. - version 1.7, July 1997 Inserted Borland compatibile structure packing - directives provided by Mentor. JMH - version 1.7, Aug 1997 Expanded file tabs to spaces. - NOTE: future authors should be sure to have - their editors set to automatically expand tabs - to spaces (original tab setting was 4 spaces). - version 1.7, Sept 1997 Added job control values - Added return codes - version 1.7, Sept 1997 changed definition of pRGBRESPONSE to - pTW_RGBRESPONSE - version 1.7 Aug 1998 Added missing TWEI_BARCODEROTATION values - TWBCOR_ types JMH - version 1.8 August 1998 Added new types and definitions required - for 1.8 Specification JMH - version 1.8 January 1999 Changed search mode from SRCH_ to TWBD_ as - in 1.8 Specification, added TWBT_MAXICODE JMH - version 1.8 January 1999 Removed undocumented duplicate AUTO JMH - version 1.8 March 1999 Removed undocumented 1.8 caps: - CAP_FILESYSTEM - CAP_PAPERBINDING - CAP_PASSTHRU - CAP_POWERDOWNTIME - ICAP_AUTODISCARDBLANKPAGES - * CAP_PAGEMULTIPLEACQUIRE - is CAP_REACQUIREALLOWED, - requires spec change. JMH - Added Mac structure packing modifications JMH - version 1.9 March 2000 Added new types and definations required - for 1.9 Specification MLM - version 1.9 March 2000 Added ICAP_JPEGQUALITY, TWJQ_ values, - updated TWON_PROTOCOLMINOR for Release v1.9 MN - version 1.91 August 2007 Added new types and definitions required - for 1.91 Specification MLM - version 2.0 Sept 2007 Added new types and definitions required - for 2.0 Specification FHH - version 2.0 Mar 2008 Depreciated ICAP_PIXELTYPEs TWPT_SRGB64, TWPT_BGR, - TWPT_CIELAB, TWPT_CIELUV, and TWPT_YCBCR JMW - version 2.0 Mar 2008 Added missing new 2.0 CAP_ definitions JMW - version 2.0 Dec 2008 Updated TW_INFO structure for 64bit JMW - version 2.1 Mar 2009 Added new types and definitions required - for 2.1 Specification JMW - version 2.2 Nov 2010 Added new types and definitions required - for 2.2 Specification MSM - version 2.3 Feb 2013 Added new types and definitions required - for 2.3 Specification MLM -\* ======================================================================== */ - -#ifndef TWAIN -#define TWAIN - -/**************************************************************************** - * TWAIN Version * - ****************************************************************************/ -#define TWON_PROTOCOLMINOR 3 /* Changed for Version 2.3 */ -#define TWON_PROTOCOLMAJOR 2 - -/**************************************************************************** - * Platform Dependent Definitions and Typedefs * - ****************************************************************************/ - -/* Microsoft C/C++ Compiler */ -#if defined(WIN32) || defined(WIN64) || defined (_WINDOWS) - #define TWH_CMP_MSC - #if defined(_WIN64) || defined(WIN64) - #define TWH_64BIT - #elif defined(WIN32) || defined(_WIN32) - #define TWH_32BIT - #endif - -/* GNU C/C++ Compiler */ -#elif defined(__GNUC__) - #define TWH_CMP_GNU - #if defined(__alpha__)\ - ||defined(__ia64__)\ - ||defined(__ppc64__)\ - ||defined(__s390x__)\ - ||defined(__x86_64__) - #define TWH_64BIT - #else - #define TWH_32BIT - #endif - - -/* Borland C/C++ Compiler */ -#elif defined(__BORLAND__) - #define TWH_CMP_BORLAND - #define TWH_32BIT -/* Unrecognized */ -#else - #error Unrecognized compiler -#endif - -/* Apple Compiler (which is GNU now) */ -#if defined(__APPLE__) - #define TWH_CMP_XCODE - #ifdef __MWERKS__ - #include - #else - #include - #endif -#endif - -/* Win32 and Win64 systems */ -#if defined(TWH_CMP_MSC) | defined(TWH_CMP_BORLAND) - typedef HANDLE TW_HANDLE; - typedef LPVOID TW_MEMREF; - typedef UINT_PTR TW_UINTPTR; - -/* MacOS/X... */ -#elif defined(TWH_CMP_XCODE) - #define PASCAL pascal - #define FAR - typedef Handle TW_HANDLE; - typedef char *TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif - -/* Everything else... */ -#else - #define PASCAL - #define FAR - typedef void* TW_HANDLE; - typedef void* TW_MEMREF; - typedef unsigned char BYTE; - - #ifdef TWH_32BIT - //32 bit GNU - typedef unsigned long TW_UINTPTR; - #else - //64 bit GNU - typedef unsigned long long TW_UINTPTR; - #endif -#endif - - -/* Set the packing: this occurs before any structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (push, before_twain) - #pragma pack (2) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = power - #else - #pragma pack (push, before_twain) - #pragma pack (2) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option -a2 -#endif - - -/**************************************************************************** - * Type Definitions * - ****************************************************************************/ - -/* String types. These include room for the strings and a NULL char, * - * or, on the Mac, a length byte followed by the string. * - * TW_STR255 must hold less than 256 chars so length fits in first byte. */ -#if defined(__APPLE__)/* cf: Mac version of TWAIN.h */ - typedef unsigned char TW_STR32[34], FAR *pTW_STR32; - typedef unsigned char TW_STR64[66], FAR *pTW_STR64; - typedef unsigned char TW_STR128[130], FAR *pTW_STR128; - typedef unsigned char TW_STR255[256], FAR *pTW_STR255; -#else - typedef char TW_STR32[34], FAR *pTW_STR32; - typedef char TW_STR64[66], FAR *pTW_STR64; - typedef char TW_STR128[130], FAR *pTW_STR128; - typedef char TW_STR255[256], FAR *pTW_STR255; -#endif - -/* Numeric types. */ -typedef char TW_INT8, FAR *pTW_INT8; -typedef short TW_INT16, FAR *pTW_INT16; -#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - typedef int TW_INT32, FAR *pTW_INT32; -#else - typedef long TW_INT32, FAR *pTW_INT32; -#endif -typedef unsigned char TW_UINT8, FAR *pTW_UINT8; -typedef unsigned short TW_UINT16, FAR *pTW_UINT16; -#if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - typedef unsigned int TW_UINT32, FAR *pTW_UINT32; -#else - typedef unsigned long TW_UINT32, FAR *pTW_UINT32; -#endif -typedef unsigned short TW_BOOL, FAR *pTW_BOOL; - - -/**************************************************************************** - * Structure Definitions * - ****************************************************************************/ - -/* Fixed point structure type. */ -typedef struct { - TW_INT16 Whole; - TW_UINT16 Frac; -} TW_FIX32, FAR *pTW_FIX32; - -/* Defines a frame rectangle in ICAP_UNITS coordinates. */ -typedef struct { - TW_FIX32 Left; - TW_FIX32 Top; - TW_FIX32 Right; - TW_FIX32 Bottom; -} TW_FRAME, FAR * pTW_FRAME; - -/* Defines the parameters used for channel-specific transformation. */ -typedef struct { - TW_FIX32 StartIn; - TW_FIX32 BreakIn; - TW_FIX32 EndIn; - TW_FIX32 StartOut; - TW_FIX32 BreakOut; - TW_FIX32 EndOut; - TW_FIX32 Gamma; - TW_FIX32 SampleCount; -} TW_DECODEFUNCTION, FAR * pTW_DECODEFUNCTION; - -/* Stores a Fixed point number in two parts, a whole and a fractional part. */ -typedef struct { - TW_DECODEFUNCTION Decode[3]; - TW_FIX32 Mix[3][3]; -} TW_TRANSFORMSTAGE, FAR * pTW_TRANSFORMSTAGE; - -/* Container for array of values */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT8 ItemList[1]; -} TW_ARRAY, FAR * pTW_ARRAY; - -/* Information about audio data */ -typedef struct { - TW_STR255 Name; - TW_UINT32 Reserved; -} TW_AUDIOINFO, FAR * pTW_AUDIOINFO; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF RefCon; - #else - TW_UINT32 RefCon; - #endif - TW_INT16 Message; -} TW_CALLBACK, FAR * pTW_CALLBACK; - -/* Used to register callbacks. */ -typedef struct { - TW_MEMREF CallBackProc; - TW_UINTPTR RefCon; - TW_INT16 Message; -} TW_CALLBACK2, FAR * pTW_CALLBACK2; - -/* Used by application to get/set capability from/in a data source. */ -typedef struct { - TW_UINT16 Cap; - TW_UINT16 ConType; - TW_HANDLE hContainer; -} TW_CAPABILITY, FAR * pTW_CAPABILITY; - -/* Defines a CIE XYZ space tri-stimulus value. */ -typedef struct { - TW_FIX32 X; - TW_FIX32 Y; - TW_FIX32 Z; -} TW_CIEPOINT, FAR * pTW_CIEPOINT; - -/* Defines the mapping from an RGB color space device into CIE 1931 (XYZ) color space. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_INT16 LowEndian; - TW_INT16 DeviceDependent; - TW_INT32 VersionNumber; - TW_TRANSFORMSTAGE StageABC; - TW_TRANSFORMSTAGE StageLMN; - TW_CIEPOINT WhitePoint; - TW_CIEPOINT BlackPoint; - TW_CIEPOINT WhitePaper; - TW_CIEPOINT BlackInk; - TW_FIX32 Samples[1]; -} TW_CIECOLOR, FAR * pTW_CIECOLOR; - -/* Allows for a data source and application to pass custom data to each other. */ -typedef struct { - TW_UINT32 InfoLength; - TW_HANDLE hData; -}TW_CUSTOMDSDATA, FAR *pTW_CUSTOMDSDATA; - -/* Provides information about the Event that was raised by the Source */ -typedef struct { - TW_UINT32 Event; - TW_STR255 DeviceName; - TW_UINT32 BatteryMinutes; - TW_INT16 BatteryPercentage; - TW_INT32 PowerSupply; - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_UINT32 FlashUsed2; - TW_UINT32 AutomaticCapture; - TW_UINT32 TimeBeforeFirstCapture; - TW_UINT32 TimeBetweenCaptures; -} TW_DEVICEEVENT, FAR * pTW_DEVICEEVENT; - -/* This structure holds the tri-stimulus color palette information for TW_PALETTE8 structures.*/ -typedef struct { - TW_UINT8 Index; - TW_UINT8 Channel1; - TW_UINT8 Channel2; - TW_UINT8 Channel3; -} TW_ELEMENT8, FAR * pTW_ELEMENT8; - -/* Stores a group of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 NumItems; - TW_UINT32 CurrentIndex; - TW_UINT32 DefaultIndex; - TW_UINT8 ItemList[1]; -} TW_ENUMERATION, FAR * pTW_ENUMERATION; - -/* Used to pass application events/messages from the application to the Source. */ -typedef struct { - TW_MEMREF pEvent; - TW_UINT16 TWMessage; -} TW_EVENT, FAR * pTW_EVENT; - -/* This structure is used to pass specific information between the data source and the application. */ -typedef struct { - TW_UINT16 InfoID; - TW_UINT16 ItemType; - TW_UINT16 NumItems; - union { - TW_UINT16 ReturnCode; - TW_UINT16 CondCode; // Deprecated, do not use - }; - TW_UINTPTR Item; -}TW_INFO, FAR* pTW_INFO; - -typedef struct { - TW_UINT32 NumInfos; - TW_INFO Info[1]; -}TW_EXTIMAGEINFO, FAR* pTW_EXTIMAGEINFO; - -/* Provides information about the currently selected device */ -typedef struct { - TW_STR255 InputName; - TW_STR255 OutputName; - TW_MEMREF Context; - union { - int Recursive; - TW_BOOL Subdirectories; - }; - union { - TW_INT32 FileType; - TW_UINT32 FileSystemType; - }; - TW_UINT32 Size; - TW_STR32 CreateTimeDate; - TW_STR32 ModifiedTimeDate; - TW_UINT32 FreeSpace; - TW_INT32 NewImageSize; - TW_UINT32 NumberOfFiles; - TW_UINT32 NumberOfSnippets; - TW_UINT32 DeviceGroupMask; - TW_INT8 Reserved[508]; -} TW_FILESYSTEM, FAR * pTW_FILESYSTEM; - -/* This structure is used by the application to specify a set of mapping values to be applied to grayscale data. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_GRAYRESPONSE, FAR * pTW_GRAYRESPONSE; - -/* A general way to describe the version of software that is running. */ -typedef struct { - TW_UINT16 MajorNum; - TW_UINT16 MinorNum; - TW_UINT16 Language; - TW_UINT16 Country; - TW_STR32 Info; -} TW_VERSION, FAR * pTW_VERSION; - -/* Provides identification information about a TWAIN entity.*/ -typedef struct { - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - TW_MEMREF Id; - #else - TW_UINT32 Id; - #endif - TW_VERSION Version; - TW_UINT16 ProtocolMajor; - TW_UINT16 ProtocolMinor; - TW_UINT32 SupportedGroups; - TW_STR32 Manufacturer; - TW_STR32 ProductFamily; - TW_STR32 ProductName; -} TW_IDENTITY, FAR * pTW_IDENTITY; - -/* Describes the "real" image data, that is, the complete image being transferred between the Source and application. */ -typedef struct { - TW_FIX32 XResolution; - TW_FIX32 YResolution; - TW_INT32 ImageWidth; - TW_INT32 ImageLength; - TW_INT16 SamplesPerPixel; - TW_INT16 BitsPerSample[8]; - TW_INT16 BitsPerPixel; - TW_BOOL Planar; - TW_INT16 PixelType; - TW_UINT16 Compression; -} TW_IMAGEINFO, FAR * pTW_IMAGEINFO; - -/* Involves information about the original size of the acquired image. */ -typedef struct { - TW_FRAME Frame; - TW_UINT32 DocumentNumber; - TW_UINT32 PageNumber; - TW_UINT32 FrameNumber; -} TW_IMAGELAYOUT, FAR * pTW_IMAGELAYOUT; - -/* Provides information for managing memory buffers. */ -typedef struct { - TW_UINT32 Flags; - TW_UINT32 Length; - TW_MEMREF TheMem; -} TW_MEMORY, FAR * pTW_MEMORY; - -/* Describes the form of the acquired data being passed from the Source to the application.*/ -typedef struct { - TW_UINT16 Compression; - TW_UINT32 BytesPerRow; - TW_UINT32 Columns; - TW_UINT32 Rows; - TW_UINT32 XOffset; - TW_UINT32 YOffset; - TW_UINT32 BytesWritten; - TW_MEMORY Memory; -} TW_IMAGEMEMXFER, FAR * pTW_IMAGEMEMXFER; - -/* Describes the information necessary to transfer a JPEG-compressed image. */ -typedef struct { - TW_UINT16 ColorSpace; - TW_UINT32 SubSampling; - TW_UINT16 NumComponents; - TW_UINT16 RestartFrequency; - TW_UINT16 QuantMap[4]; - TW_MEMORY QuantTable[4]; - TW_UINT16 HuffmanMap[4]; - TW_MEMORY HuffmanDC[2]; - TW_MEMORY HuffmanAC[2]; -} TW_JPEGCOMPRESSION, FAR * pTW_JPEGCOMPRESSION; - -/* Stores a single value (item) which describes a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 Item; -} TW_ONEVALUE, FAR * pTW_ONEVALUE; - -/* This structure holds the color palette information. */ -typedef struct { - TW_UINT16 NumColors; - TW_UINT16 PaletteType; - TW_ELEMENT8 Colors[256]; -} TW_PALETTE8, FAR * pTW_PALETTE8; - -/* Used to bypass the TWAIN protocol when communicating with a device */ -typedef struct { - TW_MEMREF pCommand; - TW_UINT32 CommandBytes; - TW_INT32 Direction; - TW_MEMREF pData; - TW_UINT32 DataBytes; - TW_UINT32 DataBytesXfered; -} TW_PASSTHRU, FAR * pTW_PASSTHRU; - -/* This structure tells the application how many more complete transfers the Source currently has available. */ -typedef struct { - TW_UINT16 Count; - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - union { - TW_UINT32 EOJ; - TW_UINT32 Reserved; - } TW_JOBCONTROL; - #endif - }; -} TW_PENDINGXFERS, FAR *pTW_PENDINGXFERS; - -/* Stores a range of individual values describing a capability. */ -typedef struct { - TW_UINT16 ItemType; - TW_UINT32 MinValue; - TW_UINT32 MaxValue; - TW_UINT32 StepSize; - TW_UINT32 DefaultValue; - TW_UINT32 CurrentValue; -} TW_RANGE, FAR * pTW_RANGE; - -/* This structure is used by the application to specify a set of mapping values to be applied to RGB color data. */ -typedef struct { - TW_ELEMENT8 Response[1]; -} TW_RGBRESPONSE, FAR * pTW_RGBRESPONSE; - -/* Describes the file format and file specification information for a transfer through a disk file. */ -typedef struct { - TW_STR255 FileName; - TW_UINT16 Format; - TW_INT16 VRefNum; -} TW_SETUPFILEXFER, FAR * pTW_SETUPFILEXFER; - -/* Provides the application information about the Source's requirements and preferences regarding allocation of transfer buffer(s). */ -typedef struct { - TW_UINT32 MinBufSize; - TW_UINT32 MaxBufSize; - TW_UINT32 Preferred; -} TW_SETUPMEMXFER, FAR * pTW_SETUPMEMXFER; - -/* Describes the status of a source. */ -typedef struct { - TW_UINT16 ConditionCode; - union { - TW_UINT16 Data; - TW_UINT16 Reserved; - }; -} TW_STATUS, FAR * pTW_STATUS; - -/* Translates the contents of Status into a localized UTF8string. */ -typedef struct { - TW_STATUS Status; - TW_UINT32 Size; - TW_HANDLE UTF8string; -} TW_STATUSUTF8, FAR * pTW_STATUSUTF8; - -/* This structure is used to handle the user interface coordination between an application and a Source. */ -typedef struct { - TW_BOOL ShowUI; - TW_BOOL ModalUI; - TW_HANDLE hParent; -} TW_USERINTERFACE, FAR * pTW_USERINTERFACE; - - -/**************************************************************************** - * Generic Constants * - ****************************************************************************/ - -#define TWON_ARRAY 3 -#define TWON_ENUMERATION 4 -#define TWON_ONEVALUE 5 -#define TWON_RANGE 6 - -#define TWON_ICONID 962 -#define TWON_DSMID 461 -#define TWON_DSMCODEID 63 - -#define TWON_DONTCARE8 0xff -#define TWON_DONTCARE16 0xffff -#define TWON_DONTCARE32 0xffffffff - -/* Flags used in TW_MEMORY structure. */ -#define TWMF_APPOWNS 0x0001 -#define TWMF_DSMOWNS 0x0002 -#define TWMF_DSOWNS 0x0004 -#define TWMF_POINTER 0x0008 -#define TWMF_HANDLE 0x0010 - -#define TWTY_INT8 0x0000 -#define TWTY_INT16 0x0001 -#define TWTY_INT32 0x0002 - -#define TWTY_UINT8 0x0003 -#define TWTY_UINT16 0x0004 -#define TWTY_UINT32 0x0005 - -#define TWTY_BOOL 0x0006 - -#define TWTY_FIX32 0x0007 - -#define TWTY_FRAME 0x0008 - -#define TWTY_STR32 0x0009 -#define TWTY_STR64 0x000a -#define TWTY_STR128 0x000b -#define TWTY_STR255 0x000c -#define TWTY_HANDLE 0x000f - - -/**************************************************************************** - * Capability Constants * - ****************************************************************************/ - -/* CAP_ALARMS values */ -#define TWAL_ALARM 0 -#define TWAL_FEEDERERROR 1 -#define TWAL_FEEDERWARNING 2 -#define TWAL_BARCODE 3 -#define TWAL_DOUBLEFEED 4 -#define TWAL_JAM 5 -#define TWAL_PATCHCODE 6 -#define TWAL_POWER 7 -#define TWAL_SKEW 8 - -/* ICAP_AUTOSIZE values */ -#define TWAS_NONE 0 -#define TWAS_AUTO 1 -#define TWAS_CURRENT 2 - -/* TWEI_BARCODEROTATION values */ -#define TWBCOR_ROT0 0 -#define TWBCOR_ROT90 1 -#define TWBCOR_ROT180 2 -#define TWBCOR_ROT270 3 -#define TWBCOR_ROTX 4 - -/* ICAP_BARCODESEARCHMODE values */ -#define TWBD_HORZ 0 -#define TWBD_VERT 1 -#define TWBD_HORZVERT 2 -#define TWBD_VERTHORZ 3 - -/* ICAP_BITORDER values */ -#define TWBO_LSBFIRST 0 -#define TWBO_MSBFIRST 1 - -/* ICAP_AUTODISCARDBLANKPAGES values */ -#define TWBP_DISABLE -2 -#define TWBP_AUTO -1 - -/* ICAP_BITDEPTHREDUCTION values */ -#define TWBR_THRESHOLD 0 -#define TWBR_HALFTONE 1 -#define TWBR_CUSTHALFTONE 2 -#define TWBR_DIFFUSION 3 -#define TWBR_DYNAMICTHRESHOLD 4 - -/* ICAP_SUPPORTEDBARCODETYPES and TWEI_BARCODETYPE values*/ -#define TWBT_3OF9 0 -#define TWBT_2OF5INTERLEAVED 1 -#define TWBT_2OF5NONINTERLEAVED 2 -#define TWBT_CODE93 3 -#define TWBT_CODE128 4 -#define TWBT_UCC128 5 -#define TWBT_CODABAR 6 -#define TWBT_UPCA 7 -#define TWBT_UPCE 8 -#define TWBT_EAN8 9 -#define TWBT_EAN13 10 -#define TWBT_POSTNET 11 -#define TWBT_PDF417 12 -#define TWBT_2OF5INDUSTRIAL 13 -#define TWBT_2OF5MATRIX 14 -#define TWBT_2OF5DATALOGIC 15 -#define TWBT_2OF5IATA 16 -#define TWBT_3OF9FULLASCII 17 -#define TWBT_CODABARWITHSTARTSTOP 18 -#define TWBT_MAXICODE 19 -#define TWBT_QRCODE 20 - -/* ICAP_COMPRESSION values*/ -#define TWCP_NONE 0 -#define TWCP_PACKBITS 1 -#define TWCP_GROUP31D 2 -#define TWCP_GROUP31DEOL 3 -#define TWCP_GROUP32D 4 -#define TWCP_GROUP4 5 -#define TWCP_JPEG 6 -#define TWCP_LZW 7 -#define TWCP_JBIG 8 -#define TWCP_PNG 9 -#define TWCP_RLE4 10 -#define TWCP_RLE8 11 -#define TWCP_BITFIELDS 12 -#define TWCP_ZIP 13 -#define TWCP_JPEG2000 14 - -/* CAP_CAMERASIDE and TWEI_PAGESIDE values */ -#define TWCS_BOTH 0 -#define TWCS_TOP 1 -#define TWCS_BOTTOM 2 - -/* CAP_CLEARBUFFERS values */ -#define TWCB_AUTO 0 -#define TWCB_CLEAR 1 -#define TWCB_NOCLEAR 2 - -/* CAP_DEVICEEVENT values */ -#define TWDE_CUSTOMEVENTS 0x8000 -#define TWDE_CHECKAUTOMATICCAPTURE 0 -#define TWDE_CHECKBATTERY 1 -#define TWDE_CHECKDEVICEONLINE 2 -#define TWDE_CHECKFLASH 3 -#define TWDE_CHECKPOWERSUPPLY 4 -#define TWDE_CHECKRESOLUTION 5 -#define TWDE_DEVICEADDED 6 -#define TWDE_DEVICEOFFLINE 7 -#define TWDE_DEVICEREADY 8 -#define TWDE_DEVICEREMOVED 9 -#define TWDE_IMAGECAPTURED 10 -#define TWDE_IMAGEDELETED 11 -#define TWDE_PAPERDOUBLEFEED 12 -#define TWDE_PAPERJAM 13 -#define TWDE_LAMPFAILURE 14 -#define TWDE_POWERSAVE 15 -#define TWDE_POWERSAVENOTIFY 16 - -/* TW_PASSTHRU.Direction values. */ -#define TWDR_GET 1 -#define TWDR_SET 2 - -/* TWEI_DESKEWSTATUS values. */ -#define TWDSK_SUCCESS 0 -#define TWDSK_REPORTONLY 1 -#define TWDSK_FAIL 2 -#define TWDSK_DISABLED 3 - -/* CAP_DUPLEX values */ -#define TWDX_NONE 0 -#define TWDX_1PASSDUPLEX 1 -#define TWDX_2PASSDUPLEX 2 - -/* CAP_FEEDERALIGNMENT values */ -#define TWFA_NONE 0 -#define TWFA_LEFT 1 -#define TWFA_CENTER 2 -#define TWFA_RIGHT 3 - -/* ICAP_FEEDERTYPE values*/ -#define TWFE_GENERAL 0 -#define TWFE_PHOTO 1 - -/* ICAP_IMAGEFILEFORMAT values */ -#define TWFF_TIFF 0 -#define TWFF_PICT 1 -#define TWFF_BMP 2 -#define TWFF_XBM 3 -#define TWFF_JFIF 4 -#define TWFF_FPX 5 -#define TWFF_TIFFMULTI 6 -#define TWFF_PNG 7 -#define TWFF_SPIFF 8 -#define TWFF_EXIF 9 -#define TWFF_PDF 10 -#define TWFF_JP2 11 -#define TWFF_JPX 13 -#define TWFF_DEJAVU 14 -#define TWFF_PDFA 15 -#define TWFF_PDFA2 16 - -/* ICAP_FLASHUSED2 values */ -#define TWFL_NONE 0 -#define TWFL_OFF 1 -#define TWFL_ON 2 -#define TWFL_AUTO 3 -#define TWFL_REDEYE 4 - -/* CAP_FEEDERORDER values */ -#define TWFO_FIRSTPAGEFIRST 0 -#define TWFO_LASTPAGEFIRST 1 - -/* CAP_FEEDERPOCKET values*/ -#define TWFP_POCKETERROR 0 -#define TWFP_POCKET1 1 -#define TWFP_POCKET2 2 -#define TWFP_POCKET3 3 -#define TWFP_POCKET4 4 -#define TWFP_POCKET5 5 -#define TWFP_POCKET6 6 -#define TWFP_POCKET7 7 -#define TWFP_POCKET8 8 -#define TWFP_POCKET9 9 -#define TWFP_POCKET10 10 -#define TWFP_POCKET11 11 -#define TWFP_POCKET12 12 -#define TWFP_POCKET13 13 -#define TWFP_POCKET14 14 -#define TWFP_POCKET15 15 -#define TWFP_POCKET16 16 - -/* ICAP_FLIPROTATION values */ -#define TWFR_BOOK 0 -#define TWFR_FANFOLD 1 - -/* ICAP_FILTER values */ -#define TWFT_RED 0 -#define TWFT_GREEN 1 -#define TWFT_BLUE 2 -#define TWFT_NONE 3 -#define TWFT_WHITE 4 -#define TWFT_CYAN 5 -#define TWFT_MAGENTA 6 -#define TWFT_YELLOW 7 -#define TWFT_BLACK 8 - -/* TW_FILESYSTEM.FileType values */ -#define TWFY_CAMERA 0 -#define TWFY_CAMERATOP 1 -#define TWFY_CAMERABOTTOM 2 -#define TWFY_CAMERAPREVIEW 3 -#define TWFY_DOMAIN 4 -#define TWFY_HOST 5 -#define TWFY_DIRECTORY 6 -#define TWFY_IMAGE 7 -#define TWFY_UNKNOWN 8 - -/* ICAP_ICCPROFILE values */ -#define TWIC_NONE 0 -#define TWIC_LINK 1 -#define TWIC_EMBED 2 - -/* ICAP_IMAGEFILTER values */ -#define TWIF_NONE 0 -#define TWIF_AUTO 1 -#define TWIF_LOWPASS 2 -#define TWIF_BANDPASS 3 -#define TWIF_HIGHPASS 4 -#define TWIF_TEXT TWIF_BANDPASS -#define TWIF_FINELINE TWIF_HIGHPASS - -/* ICAP_IMAGEMERGE values */ -#define TWIM_NONE 0 -#define TWIM_FRONTONTOP 1 -#define TWIM_FRONTONBOTTOM 2 -#define TWIM_FRONTONLEFT 3 -#define TWIM_FRONTONRIGHT 4 - -/* CAP_JOBCONTROL values */ -#define TWJC_NONE 0 -#define TWJC_JSIC 1 -#define TWJC_JSIS 2 -#define TWJC_JSXC 3 -#define TWJC_JSXS 4 - -/* ICAP_JPEGQUALITY values */ -#define TWJQ_UNKNOWN -4 -#define TWJQ_LOW -3 -#define TWJQ_MEDIUM -2 -#define TWJQ_HIGH -1 - -/* ICAP_LIGHTPATH values */ -#define TWLP_REFLECTIVE 0 -#define TWLP_TRANSMISSIVE 1 - -/* ICAP_LIGHTSOURCE values */ -#define TWLS_RED 0 -#define TWLS_GREEN 1 -#define TWLS_BLUE 2 -#define TWLS_NONE 3 -#define TWLS_WHITE 4 -#define TWLS_UV 5 -#define TWLS_IR 6 - -/* TWEI_MAGTYPE values */ -#define TWMD_MICR 0 -#define TWMD_RAW 1 -#define TWMD_INVALID 2 - -/* ICAP_NOISEFILTER values */ -#define TWNF_NONE 0 -#define TWNF_AUTO 1 -#define TWNF_LONEPIXEL 2 -#define TWNF_MAJORITYRULE 3 - -/* ICAP_ORIENTATION values */ -#define TWOR_ROT0 0 -#define TWOR_ROT90 1 -#define TWOR_ROT180 2 -#define TWOR_ROT270 3 -#define TWOR_PORTRAIT TWOR_ROT0 -#define TWOR_LANDSCAPE TWOR_ROT270 -#define TWOR_AUTO 4 -#define TWOR_AUTOTEXT 5 -#define TWOR_AUTOPICTURE 6 - -/* ICAP_OVERSCAN values */ -#define TWOV_NONE 0 -#define TWOV_AUTO 1 -#define TWOV_TOPBOTTOM 2 -#define TWOV_LEFTRIGHT 3 -#define TWOV_ALL 4 - -/* Palette types for TW_PALETTE8 */ -#define TWPA_RGB 0 -#define TWPA_GRAY 1 -#define TWPA_CMY 2 - -/* ICAP_PLANARCHUNKY values */ -#define TWPC_CHUNKY 0 -#define TWPC_PLANAR 1 - -/* TWEI_PATCHCODE values*/ -#define TWPCH_PATCH1 0 -#define TWPCH_PATCH2 1 -#define TWPCH_PATCH3 2 -#define TWPCH_PATCH4 3 -#define TWPCH_PATCH6 4 -#define TWPCH_PATCHT 5 - -/* ICAP_PIXELFLAVOR values */ -#define TWPF_CHOCOLATE 0 -#define TWPF_VANILLA 1 - -/* CAP_PRINTERMODE values */ -#define TWPM_SINGLESTRING 0 -#define TWPM_MULTISTRING 1 -#define TWPM_COMPOUNDSTRING 2 - -/* CAP_PRINTER values */ -#define TWPR_IMPRINTERTOPBEFORE 0 -#define TWPR_IMPRINTERTOPAFTER 1 -#define TWPR_IMPRINTERBOTTOMBEFORE 2 -#define TWPR_IMPRINTERBOTTOMAFTER 3 -#define TWPR_ENDORSERTOPBEFORE 4 -#define TWPR_ENDORSERTOPAFTER 5 -#define TWPR_ENDORSERBOTTOMBEFORE 6 -#define TWPR_ENDORSERBOTTOMAFTER 7 - -/* CAP_PRINTERFONTSTYLE Added 2.3 */ -#define TWPF_NORMAL 0 -#define TWPF_BOLD 1 -#define TWPF_ITALIC 2 -#define TWPF_LARGESIZE 3 -#define TWPF_SMALLSIZE 4 - -/* CAP_PRINTERINDEXTRIGGER Added 2.3 */ -#define TWCT_PAGE 0 -#define TWCT_PATCH1 1 -#define TWCT_PATCH2 2 -#define TWCT_PATCH3 3 -#define TWCT_PATCH4 4 -#define TWCT_PATCHT 5 -#define TWCT_PATCH6 6 - -/* CAP_POWERSUPPLY values */ -#define TWPS_EXTERNAL 0 -#define TWPS_BATTERY 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_BW 0 -#define TWPT_GRAY 1 -#define TWPT_RGB 2 -#define TWPT_PALETTE 3 -#define TWPT_CMY 4 -#define TWPT_CMYK 5 -#define TWPT_YUV 6 -#define TWPT_YUVK 7 -#define TWPT_CIEXYZ 8 -#define TWPT_LAB 9 -#define TWPT_SRGB 10 -#define TWPT_SCRGB 11 -#define TWPT_INFRARED 16 - -/* CAP_SEGMENTED values */ -#define TWSG_NONE 0 -#define TWSG_AUTO 1 -#define TWSG_MANUAL 2 - -/* ICAP_FILMTYPE values */ -#define TWFM_POSITIVE 0 -#define TWFM_NEGATIVE 1 - -/* CAP_DOUBLEFEEDDETECTION */ -#define TWDF_ULTRASONIC 0 -#define TWDF_BYLENGTH 1 -#define TWDF_INFRARED 2 - -/* CAP_DOUBLEFEEDDETECTIONSENSITIVITY */ -#define TWUS_LOW 0 -#define TWUS_MEDIUM 1 -#define TWUS_HIGH 2 - -/* CAP_DOUBLEFEEDDETECTIONRESPONSE */ -#define TWDP_STOP 0 -#define TWDP_STOPANDWAIT 1 -#define TWDP_SOUND 2 -#define TWDP_DONOTIMPRINT 3 - -/* ICAP_MIRROR values */ -#define TWMR_NONE 0 -#define TWMR_VERTICAL 1 -#define TWMR_HORIZONTAL 2 - -/* ICAP_JPEGSUBSAMPLING values */ -#define TWJS_444YCBCR 0 -#define TWJS_444RGB 1 -#define TWJS_422 2 -#define TWJS_421 3 -#define TWJS_411 4 -#define TWJS_420 5 -#define TWJS_410 6 -#define TWJS_311 7 - -/* CAP_PAPERHANDLING values */ -#define TWPH_NORMAL 0 -#define TWPH_FRAGILE 1 -#define TWPH_THICK 2 -#define TWPH_TRIFOLD 3 -#define TWPH_PHOTOGRAPH 4 - -/* CAP_INDICATORSMODE values */ -#define TWCI_INFO 0 -#define TWCI_WARNING 1 -#define TWCI_ERROR 2 -#define TWCI_WARMUP 3 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_NONE 0 -#define TWSS_A4 1 -#define TWSS_JISB5 2 -#define TWSS_USLETTER 3 -#define TWSS_USLEGAL 4 -#define TWSS_A5 5 -#define TWSS_ISOB4 6 -#define TWSS_ISOB6 7 -#define TWSS_USLEDGER 9 -#define TWSS_USEXECUTIVE 10 -#define TWSS_A3 11 -#define TWSS_ISOB3 12 -#define TWSS_A6 13 -#define TWSS_C4 14 -#define TWSS_C5 15 -#define TWSS_C6 16 -#define TWSS_4A0 17 -#define TWSS_2A0 18 -#define TWSS_A0 19 -#define TWSS_A1 20 -#define TWSS_A2 21 -#define TWSS_A7 22 -#define TWSS_A8 23 -#define TWSS_A9 24 -#define TWSS_A10 25 -#define TWSS_ISOB0 26 -#define TWSS_ISOB1 27 -#define TWSS_ISOB2 28 -#define TWSS_ISOB5 29 -#define TWSS_ISOB7 30 -#define TWSS_ISOB8 31 -#define TWSS_ISOB9 32 -#define TWSS_ISOB10 33 -#define TWSS_JISB0 34 -#define TWSS_JISB1 35 -#define TWSS_JISB2 36 -#define TWSS_JISB3 37 -#define TWSS_JISB4 38 -#define TWSS_JISB6 39 -#define TWSS_JISB7 40 -#define TWSS_JISB8 41 -#define TWSS_JISB9 42 -#define TWSS_JISB10 43 -#define TWSS_C0 44 -#define TWSS_C1 45 -#define TWSS_C2 46 -#define TWSS_C3 47 -#define TWSS_C7 48 -#define TWSS_C8 49 -#define TWSS_C9 50 -#define TWSS_C10 51 -#define TWSS_USSTATEMENT 52 -#define TWSS_BUSINESSCARD 53 -#define TWSS_MAXSIZE 54 - -/* ICAP_XFERMECH values (SX_ means Setup XFer) */ -#define TWSX_NATIVE 0 -#define TWSX_FILE 1 -#define TWSX_MEMORY 2 -#define TWSX_MEMFILE 4 - -/* ICAP_UNITS values (UN_ means UNits) */ -#define TWUN_INCHES 0 -#define TWUN_CENTIMETERS 1 -#define TWUN_PICAS 2 -#define TWUN_POINTS 3 -#define TWUN_TWIPS 4 -#define TWUN_PIXELS 5 -#define TWUN_MILLIMETERS 6 - - -/**************************************************************************** - * Country Constants * - ****************************************************************************/ - -#define TWCY_AFGHANISTAN 1001 -#define TWCY_ALGERIA 213 -#define TWCY_AMERICANSAMOA 684 -#define TWCY_ANDORRA 033 -#define TWCY_ANGOLA 1002 -#define TWCY_ANGUILLA 8090 -#define TWCY_ANTIGUA 8091 -#define TWCY_ARGENTINA 54 -#define TWCY_ARUBA 297 -#define TWCY_ASCENSIONI 247 -#define TWCY_AUSTRALIA 61 -#define TWCY_AUSTRIA 43 -#define TWCY_BAHAMAS 8092 -#define TWCY_BAHRAIN 973 -#define TWCY_BANGLADESH 880 -#define TWCY_BARBADOS 8093 -#define TWCY_BELGIUM 32 -#define TWCY_BELIZE 501 -#define TWCY_BENIN 229 -#define TWCY_BERMUDA 8094 -#define TWCY_BHUTAN 1003 -#define TWCY_BOLIVIA 591 -#define TWCY_BOTSWANA 267 -#define TWCY_BRITAIN 6 -#define TWCY_BRITVIRGINIS 8095 -#define TWCY_BRAZIL 55 -#define TWCY_BRUNEI 673 -#define TWCY_BULGARIA 359 -#define TWCY_BURKINAFASO 1004 -#define TWCY_BURMA 1005 -#define TWCY_BURUNDI 1006 -#define TWCY_CAMAROON 237 -#define TWCY_CANADA 2 -#define TWCY_CAPEVERDEIS 238 -#define TWCY_CAYMANIS 8096 -#define TWCY_CENTRALAFREP 1007 -#define TWCY_CHAD 1008 -#define TWCY_CHILE 56 -#define TWCY_CHINA 86 -#define TWCY_CHRISTMASIS 1009 -#define TWCY_COCOSIS 1009 -#define TWCY_COLOMBIA 57 -#define TWCY_COMOROS 1010 -#define TWCY_CONGO 1011 -#define TWCY_COOKIS 1012 -#define TWCY_COSTARICA 506 -#define TWCY_CUBA 005 -#define TWCY_CYPRUS 357 -#define TWCY_CZECHOSLOVAKIA 42 -#define TWCY_DENMARK 45 -#define TWCY_DJIBOUTI 1013 -#define TWCY_DOMINICA 8097 -#define TWCY_DOMINCANREP 8098 -#define TWCY_EASTERIS 1014 -#define TWCY_ECUADOR 593 -#define TWCY_EGYPT 20 -#define TWCY_ELSALVADOR 503 -#define TWCY_EQGUINEA 1015 -#define TWCY_ETHIOPIA 251 -#define TWCY_FALKLANDIS 1016 -#define TWCY_FAEROEIS 298 -#define TWCY_FIJIISLANDS 679 -#define TWCY_FINLAND 358 -#define TWCY_FRANCE 33 -#define TWCY_FRANTILLES 596 -#define TWCY_FRGUIANA 594 -#define TWCY_FRPOLYNEISA 689 -#define TWCY_FUTANAIS 1043 -#define TWCY_GABON 241 -#define TWCY_GAMBIA 220 -#define TWCY_GERMANY 49 -#define TWCY_GHANA 233 -#define TWCY_GIBRALTER 350 -#define TWCY_GREECE 30 -#define TWCY_GREENLAND 299 -#define TWCY_GRENADA 8099 -#define TWCY_GRENEDINES 8015 -#define TWCY_GUADELOUPE 590 -#define TWCY_GUAM 671 -#define TWCY_GUANTANAMOBAY 5399 -#define TWCY_GUATEMALA 502 -#define TWCY_GUINEA 224 -#define TWCY_GUINEABISSAU 1017 -#define TWCY_GUYANA 592 -#define TWCY_HAITI 509 -#define TWCY_HONDURAS 504 -#define TWCY_HONGKONG 852 -#define TWCY_HUNGARY 36 -#define TWCY_ICELAND 354 -#define TWCY_INDIA 91 -#define TWCY_INDONESIA 62 -#define TWCY_IRAN 98 -#define TWCY_IRAQ 964 -#define TWCY_IRELAND 353 -#define TWCY_ISRAEL 972 -#define TWCY_ITALY 39 -#define TWCY_IVORYCOAST 225 -#define TWCY_JAMAICA 8010 -#define TWCY_JAPAN 81 -#define TWCY_JORDAN 962 -#define TWCY_KENYA 254 -#define TWCY_KIRIBATI 1018 -#define TWCY_KOREA 82 -#define TWCY_KUWAIT 965 -#define TWCY_LAOS 1019 -#define TWCY_LEBANON 1020 -#define TWCY_LIBERIA 231 -#define TWCY_LIBYA 218 -#define TWCY_LIECHTENSTEIN 41 -#define TWCY_LUXENBOURG 352 -#define TWCY_MACAO 853 -#define TWCY_MADAGASCAR 1021 -#define TWCY_MALAWI 265 -#define TWCY_MALAYSIA 60 -#define TWCY_MALDIVES 960 -#define TWCY_MALI 1022 -#define TWCY_MALTA 356 -#define TWCY_MARSHALLIS 692 -#define TWCY_MAURITANIA 1023 -#define TWCY_MAURITIUS 230 -#define TWCY_MEXICO 3 -#define TWCY_MICRONESIA 691 -#define TWCY_MIQUELON 508 -#define TWCY_MONACO 33 -#define TWCY_MONGOLIA 1024 -#define TWCY_MONTSERRAT 8011 -#define TWCY_MOROCCO 212 -#define TWCY_MOZAMBIQUE 1025 -#define TWCY_NAMIBIA 264 -#define TWCY_NAURU 1026 -#define TWCY_NEPAL 977 -#define TWCY_NETHERLANDS 31 -#define TWCY_NETHANTILLES 599 -#define TWCY_NEVIS 8012 -#define TWCY_NEWCALEDONIA 687 -#define TWCY_NEWZEALAND 64 -#define TWCY_NICARAGUA 505 -#define TWCY_NIGER 227 -#define TWCY_NIGERIA 234 -#define TWCY_NIUE 1027 -#define TWCY_NORFOLKI 1028 -#define TWCY_NORWAY 47 -#define TWCY_OMAN 968 -#define TWCY_PAKISTAN 92 -#define TWCY_PALAU 1029 -#define TWCY_PANAMA 507 -#define TWCY_PARAGUAY 595 -#define TWCY_PERU 51 -#define TWCY_PHILLIPPINES 63 -#define TWCY_PITCAIRNIS 1030 -#define TWCY_PNEWGUINEA 675 -#define TWCY_POLAND 48 -#define TWCY_PORTUGAL 351 -#define TWCY_QATAR 974 -#define TWCY_REUNIONI 1031 -#define TWCY_ROMANIA 40 -#define TWCY_RWANDA 250 -#define TWCY_SAIPAN 670 -#define TWCY_SANMARINO 39 -#define TWCY_SAOTOME 1033 -#define TWCY_SAUDIARABIA 966 -#define TWCY_SENEGAL 221 -#define TWCY_SEYCHELLESIS 1034 -#define TWCY_SIERRALEONE 1035 -#define TWCY_SINGAPORE 65 -#define TWCY_SOLOMONIS 1036 -#define TWCY_SOMALI 1037 -#define TWCY_SOUTHAFRICA 27 -#define TWCY_SPAIN 34 -#define TWCY_SRILANKA 94 -#define TWCY_STHELENA 1032 -#define TWCY_STKITTS 8013 -#define TWCY_STLUCIA 8014 -#define TWCY_STPIERRE 508 -#define TWCY_STVINCENT 8015 -#define TWCY_SUDAN 1038 -#define TWCY_SURINAME 597 -#define TWCY_SWAZILAND 268 -#define TWCY_SWEDEN 46 -#define TWCY_SWITZERLAND 41 -#define TWCY_SYRIA 1039 -#define TWCY_TAIWAN 886 -#define TWCY_TANZANIA 255 -#define TWCY_THAILAND 66 -#define TWCY_TOBAGO 8016 -#define TWCY_TOGO 228 -#define TWCY_TONGAIS 676 -#define TWCY_TRINIDAD 8016 -#define TWCY_TUNISIA 216 -#define TWCY_TURKEY 90 -#define TWCY_TURKSCAICOS 8017 -#define TWCY_TUVALU 1040 -#define TWCY_UGANDA 256 -#define TWCY_USSR 7 -#define TWCY_UAEMIRATES 971 -#define TWCY_UNITEDKINGDOM 44 -#define TWCY_USA 1 -#define TWCY_URUGUAY 598 -#define TWCY_VANUATU 1041 -#define TWCY_VATICANCITY 39 -#define TWCY_VENEZUELA 58 -#define TWCY_WAKE 1042 -#define TWCY_WALLISIS 1043 -#define TWCY_WESTERNSAHARA 1044 -#define TWCY_WESTERNSAMOA 1045 -#define TWCY_YEMEN 1046 -#define TWCY_YUGOSLAVIA 38 -#define TWCY_ZAIRE 243 -#define TWCY_ZAMBIA 260 -#define TWCY_ZIMBABWE 263 -#define TWCY_ALBANIA 355 -#define TWCY_ARMENIA 374 -#define TWCY_AZERBAIJAN 994 -#define TWCY_BELARUS 375 -#define TWCY_BOSNIAHERZGO 387 -#define TWCY_CAMBODIA 855 -#define TWCY_CROATIA 385 -#define TWCY_CZECHREPUBLIC 420 -#define TWCY_DIEGOGARCIA 246 -#define TWCY_ERITREA 291 -#define TWCY_ESTONIA 372 -#define TWCY_GEORGIA 995 -#define TWCY_LATVIA 371 -#define TWCY_LESOTHO 266 -#define TWCY_LITHUANIA 370 -#define TWCY_MACEDONIA 389 -#define TWCY_MAYOTTEIS 269 -#define TWCY_MOLDOVA 373 -#define TWCY_MYANMAR 95 -#define TWCY_NORTHKOREA 850 -#define TWCY_PUERTORICO 787 -#define TWCY_RUSSIA 7 -#define TWCY_SERBIA 381 -#define TWCY_SLOVAKIA 421 -#define TWCY_SLOVENIA 386 -#define TWCY_SOUTHKOREA 82 -#define TWCY_UKRAINE 380 -#define TWCY_USVIRGINIS 340 -#define TWCY_VIETNAM 84 - -/**************************************************************************** - * Language Constants * - ****************************************************************************/ -#define TWLG_USERLOCALE -1 -#define TWLG_DAN 0 -#define TWLG_DUT 1 -#define TWLG_ENG 2 -#define TWLG_FCF 3 -#define TWLG_FIN 4 -#define TWLG_FRN 5 -#define TWLG_GER 6 -#define TWLG_ICE 7 -#define TWLG_ITN 8 -#define TWLG_NOR 9 -#define TWLG_POR 10 -#define TWLG_SPA 11 -#define TWLG_SWE 12 -#define TWLG_USA 13 -#define TWLG_AFRIKAANS 14 -#define TWLG_ALBANIA 15 -#define TWLG_ARABIC 16 -#define TWLG_ARABIC_ALGERIA 17 -#define TWLG_ARABIC_BAHRAIN 18 -#define TWLG_ARABIC_EGYPT 19 -#define TWLG_ARABIC_IRAQ 20 -#define TWLG_ARABIC_JORDAN 21 -#define TWLG_ARABIC_KUWAIT 22 -#define TWLG_ARABIC_LEBANON 23 -#define TWLG_ARABIC_LIBYA 24 -#define TWLG_ARABIC_MOROCCO 25 -#define TWLG_ARABIC_OMAN 26 -#define TWLG_ARABIC_QATAR 27 -#define TWLG_ARABIC_SAUDIARABIA 28 -#define TWLG_ARABIC_SYRIA 29 -#define TWLG_ARABIC_TUNISIA 30 -#define TWLG_ARABIC_UAE 31 -#define TWLG_ARABIC_YEMEN 32 -#define TWLG_BASQUE 33 -#define TWLG_BYELORUSSIAN 34 -#define TWLG_BULGARIAN 35 -#define TWLG_CATALAN 36 -#define TWLG_CHINESE 37 -#define TWLG_CHINESE_HONGKONG 38 -#define TWLG_CHINESE_PRC 39 -#define TWLG_CHINESE_SINGAPORE 40 -#define TWLG_CHINESE_SIMPLIFIED 41 -#define TWLG_CHINESE_TAIWAN 42 -#define TWLG_CHINESE_TRADITIONAL 43 -#define TWLG_CROATIA 44 -#define TWLG_CZECH 45 -#define TWLG_DANISH TWLG_DAN -#define TWLG_DUTCH TWLG_DUT -#define TWLG_DUTCH_BELGIAN 46 -#define TWLG_ENGLISH TWLG_ENG -#define TWLG_ENGLISH_AUSTRALIAN 47 -#define TWLG_ENGLISH_CANADIAN 48 -#define TWLG_ENGLISH_IRELAND 49 -#define TWLG_ENGLISH_NEWZEALAND 50 -#define TWLG_ENGLISH_SOUTHAFRICA 51 -#define TWLG_ENGLISH_UK 52 -#define TWLG_ENGLISH_USA TWLG_USA -#define TWLG_ESTONIAN 53 -#define TWLG_FAEROESE 54 -#define TWLG_FARSI 55 -#define TWLG_FINNISH TWLG_FIN -#define TWLG_FRENCH TWLG_FRN -#define TWLG_FRENCH_BELGIAN 56 -#define TWLG_FRENCH_CANADIAN TWLG_FCF -#define TWLG_FRENCH_LUXEMBOURG 57 -#define TWLG_FRENCH_SWISS 58 -#define TWLG_GERMAN TWLG_GER -#define TWLG_GERMAN_AUSTRIAN 59 -#define TWLG_GERMAN_LUXEMBOURG 60 -#define TWLG_GERMAN_LIECHTENSTEIN 61 -#define TWLG_GERMAN_SWISS 62 -#define TWLG_GREEK 63 -#define TWLG_HEBREW 64 -#define TWLG_HUNGARIAN 65 -#define TWLG_ICELANDIC TWLG_ICE -#define TWLG_INDONESIAN 66 -#define TWLG_ITALIAN TWLG_ITN -#define TWLG_ITALIAN_SWISS 67 -#define TWLG_JAPANESE 68 -#define TWLG_KOREAN 69 -#define TWLG_KOREAN_JOHAB 70 -#define TWLG_LATVIAN 71 -#define TWLG_LITHUANIAN 72 -#define TWLG_NORWEGIAN TWLG_NOR -#define TWLG_NORWEGIAN_BOKMAL 73 -#define TWLG_NORWEGIAN_NYNORSK 74 -#define TWLG_POLISH 75 -#define TWLG_PORTUGUESE TWLG_POR -#define TWLG_PORTUGUESE_BRAZIL 76 -#define TWLG_ROMANIAN 77 -#define TWLG_RUSSIAN 78 -#define TWLG_SERBIAN_LATIN 79 -#define TWLG_SLOVAK 80 -#define TWLG_SLOVENIAN 81 -#define TWLG_SPANISH TWLG_SPA -#define TWLG_SPANISH_MEXICAN 82 -#define TWLG_SPANISH_MODERN 83 -#define TWLG_SWEDISH TWLG_SWE -#define TWLG_THAI 84 -#define TWLG_TURKISH 85 -#define TWLG_UKRANIAN 86 -#define TWLG_ASSAMESE 87 -#define TWLG_BENGALI 88 -#define TWLG_BIHARI 89 -#define TWLG_BODO 90 -#define TWLG_DOGRI 91 -#define TWLG_GUJARATI 92 -#define TWLG_HARYANVI 93 -#define TWLG_HINDI 94 -#define TWLG_KANNADA 95 -#define TWLG_KASHMIRI 96 -#define TWLG_MALAYALAM 97 -#define TWLG_MARATHI 98 -#define TWLG_MARWARI 99 -#define TWLG_MEGHALAYAN 100 -#define TWLG_MIZO 101 -#define TWLG_NAGA 102 -#define TWLG_ORISSI 103 -#define TWLG_PUNJABI 104 -#define TWLG_PUSHTU 105 -#define TWLG_SERBIAN_CYRILLIC 106 -#define TWLG_SIKKIMI 107 -#define TWLG_SWEDISH_FINLAND 108 -#define TWLG_TAMIL 109 -#define TWLG_TELUGU 110 -#define TWLG_TRIPURI 111 -#define TWLG_URDU 112 -#define TWLG_VIETNAMESE 113 - - -/**************************************************************************** - * Data Groups * - ****************************************************************************/ -#define DG_CONTROL 0x0001L -#define DG_IMAGE 0x0002L -#define DG_AUDIO 0x0004L - -/* More Data Functionality may be added in the future. - * These are for items that need to be determined before DS is opened. - * NOTE: Supported Functionality constants must be powers of 2 as they are - * used as bitflags when Application asks DSM to present a list of DSs. - * to support backward capability the App and DS will not use the fields - */ -#define DF_DSM2 0x10000000L -#define DF_APP2 0x20000000L - -#define DF_DS2 0x40000000L - -#define DG_MASK 0xFFFFL - -/**************************************************************************** - * * - ****************************************************************************/ -#define DAT_NULL 0x0000 -#define DAT_CUSTOMBASE 0x8000 - -/* Data Argument Types for the DG_CONTROL Data Group. */ -#define DAT_CAPABILITY 0x0001 -#define DAT_EVENT 0x0002 -#define DAT_IDENTITY 0x0003 -#define DAT_PARENT 0x0004 -#define DAT_PENDINGXFERS 0x0005 -#define DAT_SETUPMEMXFER 0x0006 -#define DAT_SETUPFILEXFER 0x0007 -#define DAT_STATUS 0x0008 -#define DAT_USERINTERFACE 0x0009 -#define DAT_XFERGROUP 0x000a -#define DAT_CUSTOMDSDATA 0x000c -#define DAT_DEVICEEVENT 0x000d -#define DAT_FILESYSTEM 0x000e -#define DAT_PASSTHRU 0x000f -#define DAT_CALLBACK 0x0010 -#define DAT_STATUSUTF8 0x0011 -#define DAT_CALLBACK2 0x0012 - -/* Data Argument Types for the DG_IMAGE Data Group. */ -#define DAT_IMAGEINFO 0x0101 -#define DAT_IMAGELAYOUT 0x0102 -#define DAT_IMAGEMEMXFER 0x0103 -#define DAT_IMAGENATIVEXFER 0x0104 -#define DAT_IMAGEFILEXFER 0x0105 -#define DAT_CIECOLOR 0x0106 -#define DAT_GRAYRESPONSE 0x0107 -#define DAT_RGBRESPONSE 0x0108 -#define DAT_JPEGCOMPRESSION 0x0109 -#define DAT_PALETTE8 0x010a -#define DAT_EXTIMAGEINFO 0x010b -#define DAT_FILTER 0x010c - -/* Data Argument Types for the DG_AUDIO Data Group. */ -#define DAT_AUDIOFILEXFER 0x0201 -#define DAT_AUDIOINFO 0x0202 -#define DAT_AUDIONATIVEXFER 0x0203 - -/* misplaced */ -#define DAT_ICCPROFILE 0x0401 -#define DAT_IMAGEMEMFILEXFER 0x0402 -#define DAT_ENTRYPOINT 0x0403 - - -/**************************************************************************** - * Messages * - ****************************************************************************/ - -/* All message constants are unique. - * Messages are grouped according to which DATs they are used with.*/ - -#define MSG_NULL 0x0000 -#define MSG_CUSTOMBASE 0x8000 - -/* Generic messages may be used with any of several DATs. */ -#define MSG_GET 0x0001 -#define MSG_GETCURRENT 0x0002 -#define MSG_GETDEFAULT 0x0003 -#define MSG_GETFIRST 0x0004 -#define MSG_GETNEXT 0x0005 -#define MSG_SET 0x0006 -#define MSG_RESET 0x0007 -#define MSG_QUERYSUPPORT 0x0008 -#define MSG_GETHELP 0x0009 -#define MSG_GETLABEL 0x000a -#define MSG_GETLABELENUM 0x000b -#define MSG_SETCONSTRAINT 0x000c - -/* Messages used with DAT_NULL */ -#define MSG_XFERREADY 0x0101 -#define MSG_CLOSEDSREQ 0x0102 -#define MSG_CLOSEDSOK 0x0103 -#define MSG_DEVICEEVENT 0X0104 - -/* Messages used with a pointer to DAT_PARENT data */ -#define MSG_OPENDSM 0x0301 -#define MSG_CLOSEDSM 0x0302 - -/* Messages used with a pointer to a DAT_IDENTITY structure */ -#define MSG_OPENDS 0x0401 -#define MSG_CLOSEDS 0x0402 -#define MSG_USERSELECT 0x0403 - -/* Messages used with a pointer to a DAT_USERINTERFACE structure */ -#define MSG_DISABLEDS 0x0501 -#define MSG_ENABLEDS 0x0502 -#define MSG_ENABLEDSUIONLY 0x0503 - -/* Messages used with a pointer to a DAT_EVENT structure */ -#define MSG_PROCESSEVENT 0x0601 - -/* Messages used with a pointer to a DAT_PENDINGXFERS structure */ -#define MSG_ENDXFER 0x0701 -#define MSG_STOPFEEDER 0x0702 - -/* Messages used with a pointer to a DAT_FILESYSTEM structure */ -#define MSG_CHANGEDIRECTORY 0x0801 -#define MSG_CREATEDIRECTORY 0x0802 -#define MSG_DELETE 0x0803 -#define MSG_FORMATMEDIA 0x0804 -#define MSG_GETCLOSE 0x0805 -#define MSG_GETFIRSTFILE 0x0806 -#define MSG_GETINFO 0x0807 -#define MSG_GETNEXTFILE 0x0808 -#define MSG_RENAME 0x0809 -#define MSG_COPY 0x080A -#define MSG_AUTOMATICCAPTUREDIRECTORY 0x080B - -/* Messages used with a pointer to a DAT_PASSTHRU structure */ -#define MSG_PASSTHRU 0x0901 - -/* used with DAT_CALLBACK */ -#define MSG_REGISTER_CALLBACK 0x0902 - -/* used with DAT_CAPABILITY */ -#define MSG_RESETALL 0x0A01 - -/**************************************************************************** - * Capabilities * - ****************************************************************************/ - -#define CAP_CUSTOMBASE 0x8000 /* Base of custom capabilities */ - -/* all data sources are REQUIRED to support these caps */ -#define CAP_XFERCOUNT 0x0001 - -/* image data sources are REQUIRED to support these caps */ -#define ICAP_COMPRESSION 0x0100 -#define ICAP_PIXELTYPE 0x0101 -#define ICAP_UNITS 0x0102 -#define ICAP_XFERMECH 0x0103 - -/* all data sources MAY support these caps */ -#define CAP_AUTHOR 0x1000 -#define CAP_CAPTION 0x1001 -#define CAP_FEEDERENABLED 0x1002 -#define CAP_FEEDERLOADED 0x1003 -#define CAP_TIMEDATE 0x1004 -#define CAP_SUPPORTEDCAPS 0x1005 -#define CAP_EXTENDEDCAPS 0x1006 -#define CAP_AUTOFEED 0x1007 -#define CAP_CLEARPAGE 0x1008 -#define CAP_FEEDPAGE 0x1009 -#define CAP_REWINDPAGE 0x100a -#define CAP_INDICATORS 0x100b -#define CAP_PAPERDETECTABLE 0x100d -#define CAP_UICONTROLLABLE 0x100e -#define CAP_DEVICEONLINE 0x100f -#define CAP_AUTOSCAN 0x1010 -#define CAP_THUMBNAILSENABLED 0x1011 -#define CAP_DUPLEX 0x1012 -#define CAP_DUPLEXENABLED 0x1013 -#define CAP_ENABLEDSUIONLY 0x1014 -#define CAP_CUSTOMDSDATA 0x1015 -#define CAP_ENDORSER 0x1016 -#define CAP_JOBCONTROL 0x1017 -#define CAP_ALARMS 0x1018 -#define CAP_ALARMVOLUME 0x1019 -#define CAP_AUTOMATICCAPTURE 0x101a -#define CAP_TIMEBEFOREFIRSTCAPTURE 0x101b -#define CAP_TIMEBETWEENCAPTURES 0x101c -#define CAP_CLEARBUFFERS 0x101d -#define CAP_MAXBATCHBUFFERS 0x101e -#define CAP_DEVICETIMEDATE 0x101f -#define CAP_POWERSUPPLY 0x1020 -#define CAP_CAMERAPREVIEWUI 0x1021 -#define CAP_DEVICEEVENT 0x1022 -#define CAP_SERIALNUMBER 0x1024 -#define CAP_PRINTER 0x1026 -#define CAP_PRINTERENABLED 0x1027 -#define CAP_PRINTERINDEX 0x1028 -#define CAP_PRINTERMODE 0x1029 -#define CAP_PRINTERSTRING 0x102a -#define CAP_PRINTERSUFFIX 0x102b -#define CAP_LANGUAGE 0x102c -#define CAP_FEEDERALIGNMENT 0x102d -#define CAP_FEEDERORDER 0x102e -#define CAP_REACQUIREALLOWED 0x1030 -#define CAP_BATTERYMINUTES 0x1032 -#define CAP_BATTERYPERCENTAGE 0x1033 -#define CAP_CAMERASIDE 0x1034 -#define CAP_SEGMENTED 0x1035 -#define CAP_CAMERAENABLED 0x1036 -#define CAP_CAMERAORDER 0x1037 -#define CAP_MICRENABLED 0x1038 -#define CAP_FEEDERPREP 0x1039 -#define CAP_FEEDERPOCKET 0x103a -#define CAP_AUTOMATICSENSEMEDIUM 0x103b -#define CAP_CUSTOMINTERFACEGUID 0x103c -#define CAP_SUPPORTEDCAPSSEGMENTUNIQUE 0x103d -#define CAP_SUPPORTEDDATS 0x103e -#define CAP_DOUBLEFEEDDETECTION 0x103f -#define CAP_DOUBLEFEEDDETECTIONLENGTH 0x1040 -#define CAP_DOUBLEFEEDDETECTIONSENSITIVITY 0x1041 -#define CAP_DOUBLEFEEDDETECTIONRESPONSE 0x1042 -#define CAP_PAPERHANDLING 0x1043 -#define CAP_INDICATORSMODE 0x1044 -#define CAP_PRINTERVERTICALOFFSET 0x1045 -#define CAP_POWERSAVETIME 0x1046 -#define CAP_PRINTERCHARROTATION 0x1047 -#define CAP_PRINTERFONTSTYLE 0x1048 -#define CAP_PRINTERINDEXLEADCHAR 0x1049 -#define CAP_PRINTERINDEXMAXVALUE 0x104A -#define CAP_PRINTERINDEXNUMDIGITS 0x104B -#define CAP_PRINTERINDEXSTEP 0x104C -#define CAP_PRINTERINDEXTRIGGER 0x104D -#define CAP_PRINTERSTRINGPREVIEW 0x104E - - - -/* image data sources MAY support these caps */ -#define ICAP_AUTOBRIGHT 0x1100 -#define ICAP_BRIGHTNESS 0x1101 -#define ICAP_CONTRAST 0x1103 -#define ICAP_CUSTHALFTONE 0x1104 -#define ICAP_EXPOSURETIME 0x1105 -#define ICAP_FILTER 0x1106 -#define ICAP_FLASHUSED 0x1107 -#define ICAP_GAMMA 0x1108 -#define ICAP_HALFTONES 0x1109 -#define ICAP_HIGHLIGHT 0x110a -#define ICAP_IMAGEFILEFORMAT 0x110c -#define ICAP_LAMPSTATE 0x110d -#define ICAP_LIGHTSOURCE 0x110e -#define ICAP_ORIENTATION 0x1110 -#define ICAP_PHYSICALWIDTH 0x1111 -#define ICAP_PHYSICALHEIGHT 0x1112 -#define ICAP_SHADOW 0x1113 -#define ICAP_FRAMES 0x1114 -#define ICAP_XNATIVERESOLUTION 0x1116 -#define ICAP_YNATIVERESOLUTION 0x1117 -#define ICAP_XRESOLUTION 0x1118 -#define ICAP_YRESOLUTION 0x1119 -#define ICAP_MAXFRAMES 0x111a -#define ICAP_TILES 0x111b -#define ICAP_BITORDER 0x111c -#define ICAP_CCITTKFACTOR 0x111d -#define ICAP_LIGHTPATH 0x111e -#define ICAP_PIXELFLAVOR 0x111f -#define ICAP_PLANARCHUNKY 0x1120 -#define ICAP_ROTATION 0x1121 -#define ICAP_SUPPORTEDSIZES 0x1122 -#define ICAP_THRESHOLD 0x1123 -#define ICAP_XSCALING 0x1124 -#define ICAP_YSCALING 0x1125 -#define ICAP_BITORDERCODES 0x1126 -#define ICAP_PIXELFLAVORCODES 0x1127 -#define ICAP_JPEGPIXELTYPE 0x1128 -#define ICAP_TIMEFILL 0x112a -#define ICAP_BITDEPTH 0x112b -#define ICAP_BITDEPTHREDUCTION 0x112c -#define ICAP_UNDEFINEDIMAGESIZE 0x112d -#define ICAP_IMAGEDATASET 0x112e -#define ICAP_EXTIMAGEINFO 0x112f -#define ICAP_MINIMUMHEIGHT 0x1130 -#define ICAP_MINIMUMWIDTH 0x1131 -#define ICAP_AUTODISCARDBLANKPAGES 0x1134 -#define ICAP_FLIPROTATION 0x1136 -#define ICAP_BARCODEDETECTIONENABLED 0x1137 -#define ICAP_SUPPORTEDBARCODETYPES 0x1138 -#define ICAP_BARCODEMAXSEARCHPRIORITIES 0x1139 -#define ICAP_BARCODESEARCHPRIORITIES 0x113a -#define ICAP_BARCODESEARCHMODE 0x113b -#define ICAP_BARCODEMAXRETRIES 0x113c -#define ICAP_BARCODETIMEOUT 0x113d -#define ICAP_ZOOMFACTOR 0x113e -#define ICAP_PATCHCODEDETECTIONENABLED 0x113f -#define ICAP_SUPPORTEDPATCHCODETYPES 0x1140 -#define ICAP_PATCHCODEMAXSEARCHPRIORITIES 0x1141 -#define ICAP_PATCHCODESEARCHPRIORITIES 0x1142 -#define ICAP_PATCHCODESEARCHMODE 0x1143 -#define ICAP_PATCHCODEMAXRETRIES 0x1144 -#define ICAP_PATCHCODETIMEOUT 0x1145 -#define ICAP_FLASHUSED2 0x1146 -#define ICAP_IMAGEFILTER 0x1147 -#define ICAP_NOISEFILTER 0x1148 -#define ICAP_OVERSCAN 0x1149 -#define ICAP_AUTOMATICBORDERDETECTION 0x1150 -#define ICAP_AUTOMATICDESKEW 0x1151 -#define ICAP_AUTOMATICROTATE 0x1152 -#define ICAP_JPEGQUALITY 0x1153 -#define ICAP_FEEDERTYPE 0x1154 -#define ICAP_ICCPROFILE 0x1155 -#define ICAP_AUTOSIZE 0x1156 -#define ICAP_AUTOMATICCROPUSESFRAME 0x1157 -#define ICAP_AUTOMATICLENGTHDETECTION 0x1158 -#define ICAP_AUTOMATICCOLORENABLED 0x1159 -#define ICAP_AUTOMATICCOLORNONCOLORPIXELTYPE 0x115a -#define ICAP_COLORMANAGEMENTENABLED 0x115b -#define ICAP_IMAGEMERGE 0x115c -#define ICAP_IMAGEMERGEHEIGHTTHRESHOLD 0x115d -#define ICAP_SUPPORTEDEXTIMAGEINFO 0x115e -#define ICAP_FILMTYPE 0x115f -#define ICAP_MIRROR 0x1160 -#define ICAP_JPEGSUBSAMPLING 0x1161 - -/* image data sources MAY support these audio caps */ -#define ACAP_XFERMECH 0x1202 - - -/*************************************************************************** - * Extended Image Info Attributes section Added 1.7 * - ***************************************************************************/ - -#define TWEI_BARCODEX 0x1200 -#define TWEI_BARCODEY 0x1201 -#define TWEI_BARCODETEXT 0x1202 -#define TWEI_BARCODETYPE 0x1203 -#define TWEI_DESHADETOP 0x1204 -#define TWEI_DESHADELEFT 0x1205 -#define TWEI_DESHADEHEIGHT 0x1206 -#define TWEI_DESHADEWIDTH 0x1207 -#define TWEI_DESHADESIZE 0x1208 -#define TWEI_SPECKLESREMOVED 0x1209 -#define TWEI_HORZLINEXCOORD 0x120A -#define TWEI_HORZLINEYCOORD 0x120B -#define TWEI_HORZLINELENGTH 0x120C -#define TWEI_HORZLINETHICKNESS 0x120D -#define TWEI_VERTLINEXCOORD 0x120E -#define TWEI_VERTLINEYCOORD 0x120F -#define TWEI_VERTLINELENGTH 0x1210 -#define TWEI_VERTLINETHICKNESS 0x1211 -#define TWEI_PATCHCODE 0x1212 -#define TWEI_ENDORSEDTEXT 0x1213 -#define TWEI_FORMCONFIDENCE 0x1214 -#define TWEI_FORMTEMPLATEMATCH 0x1215 -#define TWEI_FORMTEMPLATEPAGEMATCH 0x1216 -#define TWEI_FORMHORZDOCOFFSET 0x1217 -#define TWEI_FORMVERTDOCOFFSET 0x1218 -#define TWEI_BARCODECOUNT 0x1219 -#define TWEI_BARCODECONFIDENCE 0x121A -#define TWEI_BARCODEROTATION 0x121B -#define TWEI_BARCODETEXTLENGTH 0x121C -#define TWEI_DESHADECOUNT 0x121D -#define TWEI_DESHADEBLACKCOUNTOLD 0x121E -#define TWEI_DESHADEBLACKCOUNTNEW 0x121F -#define TWEI_DESHADEBLACKRLMIN 0x1220 -#define TWEI_DESHADEBLACKRLMAX 0x1221 -#define TWEI_DESHADEWHITECOUNTOLD 0x1222 -#define TWEI_DESHADEWHITECOUNTNEW 0x1223 -#define TWEI_DESHADEWHITERLMIN 0x1224 -#define TWEI_DESHADEWHITERLAVE 0x1225 -#define TWEI_DESHADEWHITERLMAX 0x1226 -#define TWEI_BLACKSPECKLESREMOVED 0x1227 -#define TWEI_WHITESPECKLESREMOVED 0x1228 -#define TWEI_HORZLINECOUNT 0x1229 -#define TWEI_VERTLINECOUNT 0x122A -#define TWEI_DESKEWSTATUS 0x122B -#define TWEI_SKEWORIGINALANGLE 0x122C -#define TWEI_SKEWFINALANGLE 0x122D -#define TWEI_SKEWCONFIDENCE 0x122E -#define TWEI_SKEWWINDOWX1 0x122F -#define TWEI_SKEWWINDOWY1 0x1230 -#define TWEI_SKEWWINDOWX2 0x1231 -#define TWEI_SKEWWINDOWY2 0x1232 -#define TWEI_SKEWWINDOWX3 0x1233 -#define TWEI_SKEWWINDOWY3 0x1234 -#define TWEI_SKEWWINDOWX4 0x1235 -#define TWEI_SKEWWINDOWY4 0x1236 -#define TWEI_BOOKNAME 0x1238 -#define TWEI_CHAPTERNUMBER 0x1239 -#define TWEI_DOCUMENTNUMBER 0x123A -#define TWEI_PAGENUMBER 0x123B -#define TWEI_CAMERA 0x123C -#define TWEI_FRAMENUMBER 0x123D -#define TWEI_FRAME 0x123E -#define TWEI_PIXELFLAVOR 0x123F -#define TWEI_ICCPROFILE 0x1240 -#define TWEI_LASTSEGMENT 0x1241 -#define TWEI_SEGMENTNUMBER 0x1242 -#define TWEI_MAGDATA 0x1243 -#define TWEI_MAGTYPE 0x1244 -#define TWEI_PAGESIDE 0x1245 -#define TWEI_FILESYSTEMSOURCE 0x1246 -#define TWEI_IMAGEMERGED 0x1247 -#define TWEI_MAGDATALENGTH 0x1248 -#define TWEI_PAPERCOUNT 0x1249 -#define TWEI_PRINTERTEXT 0x124A - -#define TWEJ_NONE 0x0000 -#define TWEJ_MIDSEPARATOR 0x0001 -#define TWEJ_PATCH1 0x0002 -#define TWEJ_PATCH2 0x0003 -#define TWEJ_PATCH3 0x0004 -#define TWEJ_PATCH4 0x0005 -#define TWEJ_PATCH6 0x0006 -#define TWEJ_PATCHT 0x0007 - - -/*************************************************************************** - * Return Codes and Condition Codes section * - ***************************************************************************/ - -#define TWRC_CUSTOMBASE 0x8000 - -#define TWRC_SUCCESS 0 -#define TWRC_FAILURE 1 -#define TWRC_CHECKSTATUS 2 -#define TWRC_CANCEL 3 -#define TWRC_DSEVENT 4 -#define TWRC_NOTDSEVENT 5 -#define TWRC_XFERDONE 6 -#define TWRC_ENDOFLIST 7 -#define TWRC_INFONOTSUPPORTED 8 -#define TWRC_DATANOTAVAILABLE 9 -#define TWRC_BUSY 10 -#define TWRC_SCANNERLOCKED 11 - -/* Condition Codes: Application gets these by doing DG_CONTROL DAT_STATUS MSG_GET. */ -#define TWCC_CUSTOMBASE 0x8000 - -#define TWCC_SUCCESS 0 -#define TWCC_BUMMER 1 -#define TWCC_LOWMEMORY 2 -#define TWCC_NODS 3 -#define TWCC_MAXCONNECTIONS 4 -#define TWCC_OPERATIONERROR 5 -#define TWCC_BADCAP 6 -#define TWCC_BADPROTOCOL 9 -#define TWCC_BADVALUE 10 -#define TWCC_SEQERROR 11 -#define TWCC_BADDEST 12 -#define TWCC_CAPUNSUPPORTED 13 -#define TWCC_CAPBADOPERATION 14 -#define TWCC_CAPSEQERROR 15 -#define TWCC_DENIED 16 -#define TWCC_FILEEXISTS 17 -#define TWCC_FILENOTFOUND 18 -#define TWCC_NOTEMPTY 19 -#define TWCC_PAPERJAM 20 -#define TWCC_PAPERDOUBLEFEED 21 -#define TWCC_FILEWRITEERROR 22 -#define TWCC_CHECKDEVICEONLINE 23 -#define TWCC_INTERLOCK 24 -#define TWCC_DAMAGEDCORNER 25 -#define TWCC_FOCUSERROR 26 -#define TWCC_DOCTOOLIGHT 27 -#define TWCC_DOCTOODARK 28 -#define TWCC_NOMEDIA 29 - -/* bit patterns: for query the operation that are supported by the data source on a capability */ -/* Application gets these through DG_CONTROL/DAT_CAPABILITY/MSG_QUERYSUPPORT */ -#define TWQC_GET 0x0001 -#define TWQC_SET 0x0002 -#define TWQC_GETDEFAULT 0x0004 -#define TWQC_GETCURRENT 0x0008 -#define TWQC_RESET 0x0010 -#define TWQC_SETCONSTRAINT 0x0020 -#define TWQC_CONSTRAINABLE 0x0040 -#define TWQC_GETHELP 0x0100 -#define TWQC_GETLABEL 0x0200 -#define TWQC_GETLABELENUM 0x0400 - -/**************************************************************************** - * Depreciated Items * - ****************************************************************************/ -#if defined(WIN32) || defined(WIN64) - #define TW_HUGE -#elif !defined(TWH_CMP_GNU) - #define TW_HUGE huge -#else - #define TW_HUGE -#endif - - -typedef BYTE TW_HUGE * HPBYTE; -typedef void TW_HUGE * HPVOID; - -typedef unsigned char TW_STR1024[1026], FAR *pTW_STR1026, FAR *pTW_STR1024; -typedef wchar_t TW_UNI512[512], FAR *pTW_UNI512; - -#define TWTY_STR1024 0x000d -#define TWTY_UNI512 0x000e - -#define TWFF_JPN 12 - -#define DAT_TWUNKIDENTITY 0x000b -#define DAT_SETUPFILEXFER2 0x0301 - -#define CAP_SUPPORTEDCAPSEXT 0x100c -#define CAP_FILESYSTEM //0x???? -#define CAP_PAGEMULTIPLEACQUIRE 0x1023 -#define CAP_PAPERBINDING 0x102f -#define CAP_PASSTHRU 0x1031 -#define CAP_POWERDOWNTIME 0x1034 -#define ACAP_AUDIOFILEFORMAT 0x1201 - -#define MSG_CHECKSTATUS 0x0201 - -#define MSG_INVOKE_CALLBACK 0x0903 /* Mac Only, deprecated - use DAT_NULL and MSG_xxx instead */ - -#define TWSX_FILE2 3 - -/* CAP_FILESYSTEM values (FS_ means file system) */ -#define TWFS_FILESYSTEM 0 -#define TWFS_RECURSIVEDELETE 1 - -/* ICAP_PIXELTYPE values (PT_ means Pixel Type) */ -#define TWPT_SRGB64 11 -#define TWPT_BGR 12 -#define TWPT_CIELAB 13 -#define TWPT_CIELUV 14 -#define TWPT_YCBCR 15 - -/* ICAP_SUPPORTEDSIZES values (SS_ means Supported Sizes) */ -#define TWSS_B 8 -#define TWSS_A4LETTER TWSS_A4 -#define TWSS_B3 TWSS_ISOB3 -#define TWSS_B4 TWSS_ISOB4 -#define TWSS_B6 TWSS_ISOB6 -#define TWSS_B5LETTER TWSS_JISB5 - - -/* ACAP_AUDIOFILEFORMAT values (AF_ means audio format). Added 1.8 */ -#define TWAF_WAV 0 -#define TWAF_AIFF 1 -#define TWAF_AU 3 -#define TWAF_SND 4 - - -/* DAT_SETUPFILEXFER2. Sets up DS to application data transfer via a file. Added 1.9 */ -typedef struct { - TW_MEMREF FileName; - TW_UINT16 FileNameType; - TW_UINT16 Format; - TW_INT16 VRefNum; - TW_UINT32 parID; -} TW_SETUPFILEXFER2, FAR * pTW_SETUPFILEXFER2; - -/* DAT_TWUNKIDENTITY. Provides DS identity and 'other' information necessary */ -/* across thunk link. */ -typedef struct { - TW_IDENTITY identity; - TW_STR255 dsPath; -} TW_TWUNKIDENTITY, FAR * pTW_TWUNKIDENTITY; - -/* Provides DS_Entry parameters over thunk link. */ -typedef struct -{ - TW_INT8 destFlag; - TW_IDENTITY dest; - TW_INT32 dataGroup; - TW_INT16 dataArgType; - TW_INT16 message; - TW_INT32 pDataSize; - // TW_MEMREF pData; -} TW_TWUNKDSENTRYPARAMS, FAR * pTW_TWUNKDSENTRYPARAMS; - -/* Provides DS_Entry results over thunk link. */ -typedef struct -{ - TW_UINT16 returnCode; - TW_UINT16 conditionCode; - TW_INT32 pDataSize; - // TW_MEMREF pData; - - - -} TW_TWUNKDSENTRYRETURN, FAR * pTW_TWUNKDSENTRYRETURN; - -typedef struct -{ - TW_UINT16 Cap; - TW_UINT16 Properties; -} TW_CAPEXT, FAR * pTW_CAPEXT; - -/* DAT_SETUPAUDIOFILEXFER, information required to setup an audio file transfer */ -typedef struct { - TW_STR255 FileName; /* full path target file */ - TW_UINT16 Format; /* one of TWAF_xxxx */ - TW_INT16 VRefNum; -} TW_SETUPAUDIOFILEXFER, FAR * pTW_SETUPAUDIOFILEXFER; - - -/**************************************************************************** - * Entry Points * - ****************************************************************************/ - -/********************************************************************** - * Function: DSM_Entry, the only entry point into the Data Source Manager. - ********************************************************************/ -#ifdef TWH_CMP_MSC - #define TW_CALLINGSTYLE PASCAL -#else - #define TW_CALLINGSTYLE -#endif - -/* Don't mangle the name "DSM_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -TW_UINT16 TW_CALLINGSTYLE DSM_Entry( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (TW_CALLINGSTYLE *DSMENTRYPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -#ifdef __cplusplus -} -#endif /* cplusplus */ - - -/********************************************************************** - * Function: DS_Entry, the entry point provided by a Data Source. - ********************************************************************/ -/* Don't mangle the name "DS_Entry" if we're compiling in C++! */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - - -TW_UINT16 TW_CALLINGSTYLE DS_Entry(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -typedef TW_UINT16 (FAR PASCAL *DSENTRYPROC)(pTW_IDENTITY pOrigin, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_UINT16 TW_CALLINGSTYLE TWAIN_Callback( pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); -typedef TW_UINT16 (TW_CALLINGSTYLE *TWAINCALLBACKPROC)(pTW_IDENTITY pOrigin, - pTW_IDENTITY pDest, - TW_UINT32 DG, - TW_UINT16 DAT, - TW_UINT16 MSG, - TW_MEMREF pData); - -TW_HANDLE TW_CALLINGSTYLE DSM_MemAllocate (TW_UINT32); -typedef TW_HANDLE (TW_CALLINGSTYLE *DSM_MEMALLOCATE)(TW_UINT32 _size); - -void TW_CALLINGSTYLE DSM_MemFree (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMFREE)(TW_HANDLE _handle); - -TW_MEMREF TW_CALLINGSTYLE DSM_MemLock (TW_HANDLE); -typedef TW_MEMREF (TW_CALLINGSTYLE *DSM_MEMLOCK)(TW_HANDLE _handle); - -void TW_CALLINGSTYLE DSM_MemUnlock (TW_HANDLE); -typedef void (TW_CALLINGSTYLE *DSM_MEMUNLOCK)(TW_HANDLE _handle); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -/* DAT_ENTRYPOINT. returns essential entry points. */ -typedef struct { - TW_UINT32 Size; - DSMENTRYPROC DSM_Entry; - DSM_MEMALLOCATE DSM_MemAllocate; - DSM_MEMFREE DSM_MemFree; - DSM_MEMLOCK DSM_MemLock; - DSM_MEMUNLOCK DSM_MemUnlock; -} TW_ENTRYPOINT, FAR * pTW_ENTRYPOINT; - -/* DAT_FILTER*/ -typedef struct { - TW_UINT32 Size; - TW_UINT32 HueStart; - TW_UINT32 HueEnd; - TW_UINT32 SaturationStart; - TW_UINT32 SaturationEnd; - TW_UINT32 ValueStart; - TW_UINT32 ValueEnd; - TW_UINT32 Replacement; -} TW_FILTER_DESCRIPTOR, *pTW_FILTER_DESCRIPTOR; - -/* DAT_FILTER */ -typedef struct { - TW_UINT32 Size; - TW_UINT32 DescriptorCount; - TW_UINT32 MaxDescriptorCount; - TW_UINT32 Condition; - TW_HANDLE hDescriptors; -} TW_FILTER, *pTW_FILTER; - - -/* Restore the previous packing alignment: this occurs after all structures are defined */ -#ifdef TWH_CMP_MSC - #pragma pack (pop, before_twain) -#elif defined(TWH_CMP_GNU) - #if defined(__APPLE__) /* cf: Mac version of TWAIN.h */ - #pragma options align = reset - #else - #pragma pack (pop, before_twain) - #endif -#elif defined(TWH_CMP_BORLAND) - #pragma option a. -#endif - -#endif /* TWAIN */ diff --git a/qt-correction-tool/pub/hwocr/include/hwadv.h b/qt-correction-tool/pub/hwocr/include/hwadv.h deleted file mode 100644 index edfb52a..0000000 --- a/qt-correction-tool/pub/hwocr/include/hwadv.h +++ /dev/null @@ -1,110 +0,0 @@ -// HWOCRͷļ -// hhoking 2017 -// -#pragma once -#include "hwocr.h" - -#if SDK_TABLE - -typedef struct tagHWCell -{ - int rowStart; // ʼ߼(0ʼ) - int rowEnd; // н߼ - int colStart; // ʼ߼(0ʼ) - int colEnd; // н߼ - RECT rect; // Ԫʶ - HWBlock* block; // ʶϢ -#ifdef HWOCR_LIBSRC - tagHWCell() { memset(this, 0, sizeof(tagHWCell)); } - ~tagHWCell() - { - if (block) - delete block; - } -#endif -} -HWCell; - -typedef struct tagHWTable -{ - int rowCount; // ߼ - int colCount; // ߼ - int cellCount; // Ԫ - HWCell* cells; // Ԫ -#ifdef HWOCR_LIBSRC - tagHWTable() { memset(this, 0, sizeof(tagHWTable)); } - ~tagHWTable() - { - if (cells) - delete [] cells; - } -#endif -} -HWTable; - -typedef struct tagHWRegion -{ - RECT rect; // - BLKTYPE type; // ͣBT_TEXTBT_IMAGEBT_TABLE - void* block; // ָ -#ifdef HWOCR_LIBSRC - tagHWRegion() { memset(this, 0, sizeof(tagHWRegion)); } - ~tagHWRegion() - { - if (block) - { - if (type == BT_TABLE) - delete (HWTable *)block; - else - delete (HWBlock *)block; - } - } -#endif -} -HWRegion; - -typedef struct tagHWResult2 -{ - HWRegion* blocks; // Ϣṹָ - int blockCount; // -#ifdef HWOCR_LIBSRC - tagHWResult2() { memset(this, 0, sizeof(tagHWResult2)); } - ~tagHWResult2() - { - if (blocks) - delete [] blocks; - } -#endif -} -HWResult2; - -HWOCR_ADV_API HWResult2* socrTabRecognize(szpath filename, szpath dbpath = NULL); - -HWOCR_ADV_API HWResult2* socrTabRecognize2(HWIMAGE img, szpath dbpath = NULL); - -HWOCR_ADV_API void socrTabFreeResult(HWResult2* ptr); - -#endif - -#if SDK_DIRECTION - -// ȡ -// thres - ֵ[õͼ30 - 50õͼ] -// ֵ0 - 90 - 90180 - ת180270 - 90 -HWOCR_ADV_API int socrGetDirection(szpath filename, int thres = 40); - -// ȡ· -HWOCR_ADV_API int socrGetDirectionEx(szpath filename); -// scan0 - ͼդݣҪ8λҶȣеֽڶ -HWOCR_ADV_API int socrGetDirectionEx2(puchar scan0, int w, int h); - -#endif - -#if SDK_STAMP - -HWOCR_ADV_API bool socrRemoveSeal(HWIMAGE img); - -// ʶӡµı -HWOCR_API pwchar socrRecognizeWithSeal(szpath filename, szpath dbpath = NULL); - -#endif \ No newline at end of file diff --git a/qt-correction-tool/pub/json/autolink.h b/qt-correction-tool/pub/json/autolink.h deleted file mode 100644 index 37c9258..0000000 --- a/qt-correction-tool/pub/json/autolink.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef JSON_AUTOLINK_H_INCLUDED -# define JSON_AUTOLINK_H_INCLUDED - -# include "config.h" - -# ifdef JSON_IN_CPPTL -# include -# endif - -# if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) -# define CPPTL_AUTOLINK_NAME "json" -# undef CPPTL_AUTOLINK_DLL -# ifdef JSON_DLL -# define CPPTL_AUTOLINK_DLL -# endif -# include "autolink.h" -# endif - -#endif // JSON_AUTOLINK_H_INCLUDED diff --git a/qt-correction-tool/pub/json/config.h b/qt-correction-tool/pub/json/config.h deleted file mode 100644 index 5d334cb..0000000 --- a/qt-correction-tool/pub/json/config.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef JSON_CONFIG_H_INCLUDED -# define JSON_CONFIG_H_INCLUDED - -/// If defined, indicates that json library is embedded in CppTL library. -//# define JSON_IN_CPPTL 1 - -/// If defined, indicates that json may leverage CppTL library -//# define JSON_USE_CPPTL 1 -/// If defined, indicates that cpptl vector based map should be used instead of std::map -/// as Value container. -//# define JSON_USE_CPPTL_SMALLMAP 1 -/// If defined, indicates that Json specific container should be used -/// (hash table & simple deque container with customizable allocator). -/// THIS FEATURE IS STILL EXPERIMENTAL! -//# define JSON_VALUE_USE_INTERNAL_MAP 1 -/// Force usage of standard new/malloc based allocator instead of memory pool based allocator. -/// The memory pools allocator used optimization (initializing Value and ValueInternalLink -/// as if it was a POD) that may cause some validation tool to report errors. -/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined. -//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1 - -/// If defined, indicates that Json use exception to report invalid type manipulation -/// instead of C assert macro. -# define JSON_USE_EXCEPTION 1 - -# ifdef JSON_IN_CPPTL -# include -# ifndef JSON_USE_CPPTL -# define JSON_USE_CPPTL 1 -# endif -# endif - -# ifdef JSON_IN_CPPTL -# define JSON_API CPPTL_API -# elif defined(JSON_DLL_BUILD) -# define JSON_API __declspec(dllexport) -# elif defined(JSON_DLL) -# define JSON_API __declspec(dllimport) -# else -# define JSON_API -# endif - -#endif // JSON_CONFIG_H_INCLUDED diff --git a/qt-correction-tool/pub/json/features.h b/qt-correction-tool/pub/json/features.h deleted file mode 100644 index 5a9adec..0000000 --- a/qt-correction-tool/pub/json/features.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef CPPTL_JSON_FEATURES_H_INCLUDED -# define CPPTL_JSON_FEATURES_H_INCLUDED - -# include "forwards.h" - -namespace Json { - - /** \brief Configuration passed to reader and writer. - * This configuration object can be used to force the Reader or Writer - * to behave in a standard conforming way. - */ - class JSON_API Features - { - public: - /** \brief A configuration that allows all features and assumes all strings are UTF-8. - * - C & C++ comments are allowed - * - Root object can be any JSON value - * - Assumes Value strings are encoded in UTF-8 - */ - static Features all(); - - /** \brief A configuration that is strictly compatible with the JSON specification. - * - Comments are forbidden. - * - Root object must be either an array or an object value. - * - Assumes Value strings are encoded in UTF-8 - */ - static Features strictMode(); - - /** \brief Initialize the configuration like JsonConfig::allFeatures; - */ - Features(); - - /// \c true if comments are allowed. Default: \c true. - bool allowComments_; - - /// \c true if root must be either an array or an object value. Default: \c false. - bool strictRoot_; - }; - -} // namespace Json - -#endif // CPPTL_JSON_FEATURES_H_INCLUDED diff --git a/qt-correction-tool/pub/json/forwards.h b/qt-correction-tool/pub/json/forwards.h deleted file mode 100644 index d0ce830..0000000 --- a/qt-correction-tool/pub/json/forwards.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef JSON_FORWARDS_H_INCLUDED -# define JSON_FORWARDS_H_INCLUDED - -# include "config.h" - -namespace Json { - - // writer.h - class FastWriter; - class StyledWriter; - - // reader.h - class Reader; - - // features.h - class Features; - - // value.h - typedef int Int; - typedef unsigned int UInt; - class StaticString; - class Path; - class PathArgument; - class Value; - class ValueIteratorBase; - class ValueIterator; - class ValueConstIterator; -#ifdef JSON_VALUE_USE_INTERNAL_MAP - class ValueAllocator; - class ValueMapAllocator; - class ValueInternalLink; - class ValueInternalArray; - class ValueInternalMap; -#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP - -} // namespace Json - - -#endif // JSON_FORWARDS_H_INCLUDED diff --git a/qt-correction-tool/pub/json/json.h b/qt-correction-tool/pub/json/json.h deleted file mode 100644 index c71ed65..0000000 --- a/qt-correction-tool/pub/json/json.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef JSON_JSON_H_INCLUDED -# define JSON_JSON_H_INCLUDED - -# include "autolink.h" -# include "value.h" -# include "reader.h" -# include "writer.h" -# include "features.h" - -#endif // JSON_JSON_H_INCLUDED diff --git a/qt-correction-tool/pub/json/reader.h b/qt-correction-tool/pub/json/reader.h deleted file mode 100644 index ee1d6a2..0000000 --- a/qt-correction-tool/pub/json/reader.h +++ /dev/null @@ -1,196 +0,0 @@ -#ifndef CPPTL_JSON_READER_H_INCLUDED -# define CPPTL_JSON_READER_H_INCLUDED - -# include "features.h" -# include "value.h" -# include -# include -# include -# include - -namespace Json { - - /** \brief Unserialize a JSON document into a Value. - * - */ - class JSON_API Reader - { - public: - typedef char Char; - typedef const Char *Location; - - /** \brief Constructs a Reader allowing all features - * for parsing. - */ - Reader(); - - /** \brief Constructs a Reader allowing the specified feature set - * for parsing. - */ - Reader( const Features &features ); - - /** \brief Read a Value from a JSON document. - * \param document UTF-8 encoded string containing the document to read. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const std::string &document, - Value &root, - bool collectComments = true ); - - /** \brief Read a Value from a JSON document. - * \param document UTF-8 encoded string containing the document to read. - * \param root [out] Contains the root value of the document if it was - * successfully parsed. - * \param collectComments \c true to collect comment and allow writing them back during - * serialization, \c false to discard comments. - * This parameter is ignored if Features::allowComments_ - * is \c false. - * \return \c true if the document was successfully parsed, \c false if an error occurred. - */ - bool parse( const char *beginDoc, const char *endDoc, - Value &root, - bool collectComments = true ); - - /// \brief Parse from input stream. - /// \see Json::operator>>(std::istream&, Json::Value&). - bool parse( std::istream &is, - Value &root, - bool collectComments = true ); - - /** \brief Returns a user friendly string that list errors in the parsed document. - * \return Formatted error message with the list of errors with their location in - * the parsed document. An empty string is returned if no error occurred - * during parsing. - */ - std::string getFormatedErrorMessages() const; - - private: - enum TokenType - { - tokenEndOfStream = 0, - tokenObjectBegin, - tokenObjectEnd, - tokenArrayBegin, - tokenArrayEnd, - tokenString, - tokenNumber, - tokenTrue, - tokenFalse, - tokenNull, - tokenArraySeparator, - tokenMemberSeparator, - tokenComment, - tokenError - }; - - class Token - { - public: - TokenType type_; - Location start_; - Location end_; - }; - - class ErrorInfo - { - public: - Token token_; - std::string message_; - Location extra_; - }; - - typedef std::deque Errors; - - bool expectToken( TokenType type, Token &token, const char *message ); - bool readToken( Token &token ); - void skipSpaces(); - bool match( Location pattern, - int patternLength ); - bool readComment(); - bool readCStyleComment(); - bool readCppStyleComment(); - bool readString(); - void readNumber(); - bool readValue(); - bool readObject( Token &token ); - bool readArray( Token &token ); - bool decodeNumber( Token &token ); - bool decodeString( Token &token ); - bool decodeString( Token &token, std::string &decoded ); - bool decodeDouble( Token &token ); - bool decodeUnicodeCodePoint( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool decodeUnicodeEscapeSequence( Token &token, - Location ¤t, - Location end, - unsigned int &unicode ); - bool addError( const std::string &message, - Token &token, - Location extra = 0 ); - bool recoverFromError( TokenType skipUntilToken ); - bool addErrorAndRecover( const std::string &message, - Token &token, - TokenType skipUntilToken ); - void skipUntilSpace(); - Value ¤tValue(); - Char getNextChar(); - void getLocationLineAndColumn( Location location, - int &line, - int &column ) const; - std::string getLocationLineAndColumn( Location location ) const; - void addComment( Location begin, - Location end, - CommentPlacement placement ); - void skipCommentTokens( Token &token ); - - typedef std::stack Nodes; - Nodes nodes_; - Errors errors_; - std::string document_; - Location begin_; - Location end_; - Location current_; - Location lastValueEnd_; - Value *lastValue_; - std::string commentsBefore_; - Features features_; - bool collectComments_; - }; - - /** \brief Read from 'sin' into 'root'. - - Always keep comments from the input JSON. - - This can be used to read a file into a particular sub-object. - For example: - \code - Json::Value root; - cin >> root["dir"]["file"]; - cout << root; - \endcode - Result: - \verbatim - { - "dir": { - "file": { - // The input stream JSON would be nested here. - } - } - } - \endverbatim - \throw std::exception on parse error. - \see Json::operator<<() - */ - std::istream& operator>>( std::istream&, Value& ); - -} // namespace Json - -#endif // CPPTL_JSON_READER_H_INCLUDED diff --git a/qt-correction-tool/pub/json/value.h b/qt-correction-tool/pub/json/value.h deleted file mode 100644 index 58bfd88..0000000 --- a/qt-correction-tool/pub/json/value.h +++ /dev/null @@ -1,1069 +0,0 @@ -#ifndef CPPTL_JSON_H_INCLUDED -# define CPPTL_JSON_H_INCLUDED - -# include "forwards.h" -# include -# include - -# ifndef JSON_USE_CPPTL_SMALLMAP -# include -# else -# include -# endif -# ifdef JSON_USE_CPPTL -# include -# endif - -/** \brief JSON (JavaScript Object Notation). - */ -namespace Json { - - /** \brief Type of the value held by a Value object. - */ - enum ValueType - { - nullValue = 0, ///< 'null' value - intValue, ///< signed integer value - uintValue, ///< unsigned integer value - realValue, ///< double value - stringValue, ///< UTF-8 string value - booleanValue, ///< bool value - arrayValue, ///< array value (ordered list) - objectValue ///< object value (collection of name/value pairs). - }; - - enum CommentPlacement - { - commentBefore = 0, ///< a comment placed on the line before a value - commentAfterOnSameLine, ///< a comment just after a value on the same line - commentAfter, ///< a comment on the line after a value (only make sense for root value) - numberOfCommentPlacement - }; - -//# ifdef JSON_USE_CPPTL -// typedef CppTL::AnyEnumerator EnumMemberNames; -// typedef CppTL::AnyEnumerator EnumValues; -//# endif - - /** \brief Lightweight wrapper to tag static string. - * - * Value constructor and objectValue member assignement takes advantage of the - * StaticString and avoid the cost of string duplication when storing the - * string or the member name. - * - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - class JSON_API StaticString - { - public: - explicit StaticString( const char *czstring ) - : str_( czstring ) - { - } - - operator const char *() const - { - return str_; - } - - const char *c_str() const - { - return str_; - } - - private: - const char *str_; - }; - - /** \brief Represents a JSON value. - * - * This class is a discriminated union wrapper that can represents a: - * - signed integer [range: Value::minInt - Value::maxInt] - * - unsigned integer (range: 0 - Value::maxUInt) - * - double - * - UTF-8 string - * - boolean - * - 'null' - * - an ordered list of Value - * - collection of name/value pairs (javascript object) - * - * The type of the held value is represented by a #ValueType and - * can be obtained using type(). - * - * values of an #objectValue or #arrayValue can be accessed using operator[]() methods. - * Non const methods will automatically create the a #nullValue element - * if it does not exist. - * The sequence of an #arrayValue will be automatically resize and initialized - * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. - * - * The get() methods can be used to obtanis default value in the case the required element - * does not exist. - * - * It is possible to iterate over the list of a #objectValue values using - * the getMemberNames() method. - */ - class JSON_API Value - { - friend class ValueIteratorBase; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - friend class ValueInternalLink; - friend class ValueInternalMap; -# endif - public: - typedef std::vector Members; - typedef ValueIterator iterator; - typedef ValueConstIterator const_iterator; - typedef Json::UInt UInt; - typedef Json::Int Int; - typedef UInt ArrayIndex; - - static const Value null; - static const Int minInt; - static const Int maxInt; - static const UInt maxUInt; - - private: -#ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION -# ifndef JSON_VALUE_USE_INTERNAL_MAP - class CZString - { - public: - enum DuplicationPolicy - { - noDuplication = 0, - duplicate, - duplicateOnCopy - }; - CZString( int index ); - CZString( const char *cstr, DuplicationPolicy allocate ); - CZString( const CZString &other ); - ~CZString(); - CZString &operator =( const CZString &other ); - bool operator<( const CZString &other ) const; - bool operator==( const CZString &other ) const; - int index() const; - const char *c_str() const; - bool isStaticString() const; - private: - void swap( CZString &other ); - const char *cstr_; - int index_; - }; - - public: -# ifndef JSON_USE_CPPTL_SMALLMAP - typedef std::map ObjectValues; -# else - typedef CppTL::SmallMap ObjectValues; -# endif // ifndef JSON_USE_CPPTL_SMALLMAP -# endif // ifndef JSON_VALUE_USE_INTERNAL_MAP -#endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - public: - /** \brief Create a default Value of the given type. - - This is a very useful constructor. - To create an empty array, pass arrayValue. - To create an empty object, pass objectValue. - Another Value can then be set to this one by assignment. - This is useful since clear() and resize() will not alter types. - - Examples: - \code - Json::Value null_value; // null - Json::Value arr_value(Json::arrayValue); // [] - Json::Value obj_value(Json::objectValue); // {} - \endcode - */ - Value( ValueType type = nullValue ); - Value( Int value ); - Value( UInt value ); - Value( double value ); - Value( const char *value ); - Value( const char *beginValue, const char *endValue ); - /** \brief Constructs a value from a static string. - - * Like other value string constructor but do not duplicate the string for - * internal storage. The given string must remain alive after the call to this - * constructor. - * Example of usage: - * \code - * Json::Value aValue( StaticString("some text") ); - * \endcode - */ - Value( const StaticString &value ); - Value( const std::string &value ); -# ifdef JSON_USE_CPPTL - Value( const CppTL::ConstString &value ); -# endif - Value( bool value ); - Value( const Value &other ); - ~Value(); - - Value &operator=( const Value &other ); - /// Swap values. - /// \note Currently, comments are intentionally not swapped, for - /// both logic and efficiency. - void swap( Value &other ); - - ValueType type() const; - - bool operator <( const Value &other ) const; - bool operator <=( const Value &other ) const; - bool operator >=( const Value &other ) const; - bool operator >( const Value &other ) const; - - bool operator ==( const Value &other ) const; - bool operator !=( const Value &other ) const; - - int compare( const Value &other ); - - const char *asCString() const; - std::string asString() const; -# ifdef JSON_USE_CPPTL - CppTL::ConstString asConstString() const; -# endif - Int asInt() const; - UInt asUInt() const; - double asDouble() const; - bool asBool() const; - - bool isNull() const; - bool isBool() const; - bool isInt() const; - bool isUInt() const; - bool isIntegral() const; - bool isDouble() const; - bool isNumeric() const; - bool isString() const; - bool isArray() const; - bool isObject() const; - - bool isConvertibleTo( ValueType other ) const; - - /// Number of values in array or object - UInt size() const; - - /// \brief Return true if empty array, empty object, or null; - /// otherwise, false. - bool empty() const; - - /// Return isNull() - bool operator!() const; - - /// Remove all object members and array elements. - /// \pre type() is arrayValue, objectValue, or nullValue - /// \post type() is unchanged - void clear(); - - /// Resize the array to size elements. - /// New elements are initialized to null. - /// May only be called on nullValue or arrayValue. - /// \pre type() is arrayValue or nullValue - /// \post type() is arrayValue - void resize( UInt size ); - - /// Access an array element (zero based index ). - /// If the array contains less than index element, then null value are inserted - /// in the array so that its size is index+1. - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - Value &operator[]( UInt index ); - /// Access an array element (zero based index ) - /// (You may need to say 'value[0u]' to get your compiler to distinguish - /// this from the operator[] which takes a string.) - const Value &operator[]( UInt index ) const; - /// If the array contains at least index+1 elements, returns the element value, - /// otherwise returns defaultValue. - Value get( UInt index, - const Value &defaultValue ) const; - /// Return true if index < size(). - bool isValidIndex( UInt index ) const; - /// \brief Append value to array at the end. - /// - /// Equivalent to jsonvalue[jsonvalue.size()] = value; - Value &append( const Value &value ); - - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const char *key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const char *key ) const; - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const std::string &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const std::string &key ) const; - /** \brief Access an object value by name, create a null member if it does not exist. - - * If the object as no entry for that name, then the member name used to store - * the new entry is not duplicated. - * Example of use: - * \code - * Json::Value object; - * static const StaticString code("code"); - * object[code] = 1234; - * \endcode - */ - Value &operator[]( const StaticString &key ); -# ifdef JSON_USE_CPPTL - /// Access an object value by name, create a null member if it does not exist. - Value &operator[]( const CppTL::ConstString &key ); - /// Access an object value by name, returns null if there is no member with that name. - const Value &operator[]( const CppTL::ConstString &key ) const; -# endif - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const char *key, - const Value &defaultValue ) const; - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const std::string &key, - const Value &defaultValue ) const; -# ifdef JSON_USE_CPPTL - /// Return the member named key if it exist, defaultValue otherwise. - Value get( const CppTL::ConstString &key, - const Value &defaultValue ) const; -# endif - /// \brief Remove and return the named member. - /// - /// Do nothing if it did not exist. - /// \return the removed Value, or null. - /// \pre type() is objectValue or nullValue - /// \post type() is unchanged - Value removeMember( const char* key ); - /// Same as removeMember(const char*) - Value removeMember( const std::string &key ); - - /// Return true if the object has a member named key. - bool isMember( const char *key ) const; - /// Return true if the object has a member named key. - bool isMember( const std::string &key ) const; -# ifdef JSON_USE_CPPTL - /// Return true if the object has a member named key. - bool isMember( const CppTL::ConstString &key ) const; -# endif - - /// \brief Return a list of the member names. - /// - /// If null, return an empty list. - /// \pre type() is objectValue or nullValue - /// \post if type() was nullValue, it remains nullValue - Members getMemberNames() const; - -//# ifdef JSON_USE_CPPTL -// EnumMemberNames enumMemberNames() const; -// EnumValues enumValues() const; -//# endif - - /// Comments must be //... or /* ... */ - void setComment( const char *comment, - CommentPlacement placement ); - /// Comments must be //... or /* ... */ - void setComment( const std::string &comment, - CommentPlacement placement ); - bool hasComment( CommentPlacement placement ) const; - /// Include delimiters and embedded newlines. - std::string getComment( CommentPlacement placement ) const; - - std::string toStyledString() const; - - const_iterator begin() const; - const_iterator end() const; - - iterator begin(); - iterator end(); - - private: - Value &resolveReference( const char *key, - bool isStatic ); - -# ifdef JSON_VALUE_USE_INTERNAL_MAP - inline bool isItemAvailable() const - { - return itemIsUsed_ == 0; - } - - inline void setItemUsed( bool isUsed = true ) - { - itemIsUsed_ = isUsed ? 1 : 0; - } - - inline bool isMemberNameStatic() const - { - return memberNameIsStatic_ == 0; - } - - inline void setMemberNameIsStatic( bool isStatic ) - { - memberNameIsStatic_ = isStatic ? 1 : 0; - } -# endif // # ifdef JSON_VALUE_USE_INTERNAL_MAP - - private: - struct CommentInfo - { - CommentInfo(); - ~CommentInfo(); - - void setComment( const char *text ); - - char *comment_; - }; - - //struct MemberNamesTransform - //{ - // typedef const char *result_type; - // const char *operator()( const CZString &name ) const - // { - // return name.c_str(); - // } - //}; - - union ValueHolder - { - Int int_; - UInt uint_; - double real_; - bool bool_; - char *string_; -# ifdef JSON_VALUE_USE_INTERNAL_MAP - ValueInternalArray *array_; - ValueInternalMap *map_; -#else - ObjectValues *map_; -# endif - } value_; - ValueType type_ : 8; - int allocated_ : 1; // Notes: if declared as bool, bitfield is useless. -# ifdef JSON_VALUE_USE_INTERNAL_MAP - unsigned int itemIsUsed_ : 1; // used by the ValueInternalMap container. - int memberNameIsStatic_ : 1; // used by the ValueInternalMap container. -# endif - CommentInfo *comments_; - }; - - - /** \brief Experimental and untested: represents an element of the "path" to access a node. - */ - class PathArgument - { - public: - friend class Path; - - PathArgument(); - PathArgument( UInt index ); - PathArgument( const char *key ); - PathArgument( const std::string &key ); - - private: - enum Kind - { - kindNone = 0, - kindIndex, - kindKey - }; - std::string key_; - UInt index_; - Kind kind_; - }; - - /** \brief Experimental and untested: represents a "path" to access a node. - * - * Syntax: - * - "." => root node - * - ".[n]" => elements at index 'n' of root node (an array value) - * - ".name" => member named 'name' of root node (an object value) - * - ".name1.name2.name3" - * - ".[0][1][2].name1[3]" - * - ".%" => member name is provided as parameter - * - ".[%]" => index is provied as parameter - */ - class Path - { - public: - Path( const std::string &path, - const PathArgument &a1 = PathArgument(), - const PathArgument &a2 = PathArgument(), - const PathArgument &a3 = PathArgument(), - const PathArgument &a4 = PathArgument(), - const PathArgument &a5 = PathArgument() ); - - const Value &resolve( const Value &root ) const; - Value resolve( const Value &root, - const Value &defaultValue ) const; - /// Creates the "path" to access the specified node and returns a reference on the node. - Value &make( Value &root ) const; - - private: - typedef std::vector InArgs; - typedef std::vector Args; - - void makePath( const std::string &path, - const InArgs &in ); - void addPathInArg( const std::string &path, - const InArgs &in, - InArgs::const_iterator &itInArg, - PathArgument::Kind kind ); - void invalidPath( const std::string &path, - int location ); - - Args args_; - }; - - /** \brief Experimental do not use: Allocator to customize member name and string value memory management done by Value. - * - * - makeMemberName() and releaseMemberName() are called to respectively duplicate and - * free an Json::objectValue member name. - * - duplicateStringValue() and releaseStringValue() are called similarly to - * duplicate and free a Json::stringValue value. - */ - class ValueAllocator - { - public: - enum { unknown = (unsigned)-1 }; - - virtual ~ValueAllocator(); - - virtual char *makeMemberName( const char *memberName ) = 0; - virtual void releaseMemberName( char *memberName ) = 0; - virtual char *duplicateStringValue( const char *value, - unsigned int length = unknown ) = 0; - virtual void releaseStringValue( char *value ) = 0; - }; - -#ifdef JSON_VALUE_USE_INTERNAL_MAP - /** \brief Allocator to customize Value internal map. - * Below is an example of a simple implementation (default implementation actually - * use memory pool for speed). - * \code - class DefaultValueMapAllocator : public ValueMapAllocator - { - public: // overridden from ValueMapAllocator - virtual ValueInternalMap *newMap() - { - return new ValueInternalMap(); - } - - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) - { - return new ValueInternalMap( other ); - } - - virtual void destructMap( ValueInternalMap *map ) - { - delete map; - } - - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) - { - return new ValueInternalLink[size]; - } - - virtual void releaseMapBuckets( ValueInternalLink *links ) - { - delete [] links; - } - - virtual ValueInternalLink *allocateMapLink() - { - return new ValueInternalLink(); - } - - virtual void releaseMapLink( ValueInternalLink *link ) - { - delete link; - } - }; - * \endcode - */ - class JSON_API ValueMapAllocator - { - public: - virtual ~ValueMapAllocator(); - virtual ValueInternalMap *newMap() = 0; - virtual ValueInternalMap *newMapCopy( const ValueInternalMap &other ) = 0; - virtual void destructMap( ValueInternalMap *map ) = 0; - virtual ValueInternalLink *allocateMapBuckets( unsigned int size ) = 0; - virtual void releaseMapBuckets( ValueInternalLink *links ) = 0; - virtual ValueInternalLink *allocateMapLink() = 0; - virtual void releaseMapLink( ValueInternalLink *link ) = 0; - }; - - /** \brief ValueInternalMap hash-map bucket chain link (for internal use only). - * \internal previous_ & next_ allows for bidirectional traversal. - */ - class JSON_API ValueInternalLink - { - public: - enum { itemPerLink = 6 }; // sizeof(ValueInternalLink) = 128 on 32 bits architecture. - enum InternalFlags { - flagAvailable = 0, - flagUsed = 1 - }; - - ValueInternalLink(); - - ~ValueInternalLink(); - - Value items_[itemPerLink]; - char *keys_[itemPerLink]; - ValueInternalLink *previous_; - ValueInternalLink *next_; - }; - - - /** \brief A linked page based hash-table implementation used internally by Value. - * \internal ValueInternalMap is a tradional bucket based hash-table, with a linked - * list in each bucket to handle collision. There is an addional twist in that - * each node of the collision linked list is a page containing a fixed amount of - * value. This provides a better compromise between memory usage and speed. - * - * Each bucket is made up of a chained list of ValueInternalLink. The last - * link of a given bucket can be found in the 'previous_' field of the following bucket. - * The last link of the last bucket is stored in tailLink_ as it has no following bucket. - * Only the last link of a bucket may contains 'available' item. The last link always - * contains at least one element unless is it the bucket one very first link. - */ - class JSON_API ValueInternalMap - { - friend class ValueIteratorBase; - friend class Value; - public: - typedef unsigned int HashKey; - typedef unsigned int BucketIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState - { - IteratorState() - : map_(0) - , link_(0) - , itemIndex_(0) - , bucketIndex_(0) - { - } - ValueInternalMap *map_; - ValueInternalLink *link_; - BucketIndex itemIndex_; - BucketIndex bucketIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - ValueInternalMap(); - ValueInternalMap( const ValueInternalMap &other ); - ValueInternalMap &operator =( const ValueInternalMap &other ); - ~ValueInternalMap(); - - void swap( ValueInternalMap &other ); - - BucketIndex size() const; - - void clear(); - - bool reserveDelta( BucketIndex growth ); - - bool reserve( BucketIndex newItemCount ); - - const Value *find( const char *key ) const; - - Value *find( const char *key ); - - Value &resolveReference( const char *key, - bool isStatic ); - - void remove( const char *key ); - - void doActualRemove( ValueInternalLink *link, - BucketIndex index, - BucketIndex bucketIndex ); - - ValueInternalLink *&getLastLinkInBucket( BucketIndex bucketIndex ); - - Value &setNewItem( const char *key, - bool isStatic, - ValueInternalLink *link, - BucketIndex index ); - - Value &unsafeAdd( const char *key, - bool isStatic, - HashKey hashedKey ); - - HashKey hash( const char *key ) const; - - int compare( const ValueInternalMap &other ) const; - - private: - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void incrementBucket( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static const char *key( const IteratorState &iterator ); - static const char *key( const IteratorState &iterator, bool &isStatic ); - static Value &value( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); - - private: - ValueInternalLink *buckets_; - ValueInternalLink *tailLink_; - BucketIndex bucketsSize_; - BucketIndex itemCount_; - }; - - /** \brief A simplified deque implementation used internally by Value. - * \internal - * It is based on a list of fixed "page", each page contains a fixed number of items. - * Instead of using a linked-list, a array of pointer is used for fast item look-up. - * Look-up for an element is as follow: - * - compute page index: pageIndex = itemIndex / itemsPerPage - * - look-up item in page: pages_[pageIndex][itemIndex % itemsPerPage] - * - * Insertion is amortized constant time (only the array containing the index of pointers - * need to be reallocated when items are appended). - */ - class JSON_API ValueInternalArray - { - friend class Value; - friend class ValueIteratorBase; - public: - enum { itemsPerPage = 8 }; // should be a power of 2 for fast divide and modulo. - typedef Value::ArrayIndex ArrayIndex; - typedef unsigned int PageIndex; - -# ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - struct IteratorState // Must be a POD - { - IteratorState() - : array_(0) - , currentPageIndex_(0) - , currentItemIndex_(0) - { - } - ValueInternalArray *array_; - Value **currentPageIndex_; - unsigned int currentItemIndex_; - }; -# endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION - - ValueInternalArray(); - ValueInternalArray( const ValueInternalArray &other ); - ValueInternalArray &operator =( const ValueInternalArray &other ); - ~ValueInternalArray(); - void swap( ValueInternalArray &other ); - - void clear(); - void resize( ArrayIndex newSize ); - - Value &resolveReference( ArrayIndex index ); - - Value *find( ArrayIndex index ) const; - - ArrayIndex size() const; - - int compare( const ValueInternalArray &other ) const; - - private: - static bool equals( const IteratorState &x, const IteratorState &other ); - static void increment( IteratorState &iterator ); - static void decrement( IteratorState &iterator ); - static Value &dereference( const IteratorState &iterator ); - static Value &unsafeDereference( const IteratorState &iterator ); - static int distance( const IteratorState &x, const IteratorState &y ); - static ArrayIndex indexOf( const IteratorState &iterator ); - void makeBeginIterator( IteratorState &it ) const; - void makeEndIterator( IteratorState &it ) const; - void makeIterator( IteratorState &it, ArrayIndex index ) const; - - void makeIndexValid( ArrayIndex index ); - - Value **pages_; - ArrayIndex size_; - PageIndex pageCount_; - }; - - /** \brief Experimental: do not use. Allocator to customize Value internal array. - * Below is an example of a simple implementation (actual implementation use - * memory pool). - \code -class DefaultValueArrayAllocator : public ValueArrayAllocator -{ -public: // overridden from ValueArrayAllocator - virtual ~DefaultValueArrayAllocator() - { - } - - virtual ValueInternalArray *newArray() - { - return new ValueInternalArray(); - } - - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) - { - return new ValueInternalArray( other ); - } - - virtual void destruct( ValueInternalArray *array ) - { - delete array; - } - - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) - { - ValueInternalArray::PageIndex newIndexCount = (indexCount*3)/2 + 1; - if ( minNewIndexCount > newIndexCount ) - newIndexCount = minNewIndexCount; - void *newIndexes = realloc( indexes, sizeof(Value*) * newIndexCount ); - if ( !newIndexes ) - throw std::bad_alloc(); - indexCount = newIndexCount; - indexes = static_cast( newIndexes ); - } - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) - { - if ( indexes ) - free( indexes ); - } - - virtual Value *allocateArrayPage() - { - return static_cast( malloc( sizeof(Value) * ValueInternalArray::itemsPerPage ) ); - } - - virtual void releaseArrayPage( Value *value ) - { - if ( value ) - free( value ); - } -}; - \endcode - */ - class JSON_API ValueArrayAllocator - { - public: - virtual ~ValueArrayAllocator(); - virtual ValueInternalArray *newArray() = 0; - virtual ValueInternalArray *newArrayCopy( const ValueInternalArray &other ) = 0; - virtual void destructArray( ValueInternalArray *array ) = 0; - /** \brief Reallocate array page index. - * Reallocates an array of pointer on each page. - * \param indexes [input] pointer on the current index. May be \c NULL. - * [output] pointer on the new index of at least - * \a minNewIndexCount pages. - * \param indexCount [input] current number of pages in the index. - * [output] number of page the reallocated index can handle. - * \b MUST be >= \a minNewIndexCount. - * \param minNewIndexCount Minimum number of page the new index must be able to - * handle. - */ - virtual void reallocateArrayPageIndex( Value **&indexes, - ValueInternalArray::PageIndex &indexCount, - ValueInternalArray::PageIndex minNewIndexCount ) = 0; - virtual void releaseArrayPageIndex( Value **indexes, - ValueInternalArray::PageIndex indexCount ) = 0; - virtual Value *allocateArrayPage() = 0; - virtual void releaseArrayPage( Value *value ) = 0; - }; -#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP - - - /** \brief base class for Value iterators. - * - */ - class ValueIteratorBase - { - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef ValueIteratorBase SelfType; - - ValueIteratorBase(); -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIteratorBase( const Value::ObjectValues::iterator ¤t ); -#else - ValueIteratorBase( const ValueInternalArray::IteratorState &state ); - ValueIteratorBase( const ValueInternalMap::IteratorState &state ); -#endif - - bool operator ==( const SelfType &other ) const - { - return isEqual( other ); - } - - bool operator !=( const SelfType &other ) const - { - return !isEqual( other ); - } - - difference_type operator -( const SelfType &other ) const - { - return computeDistance( other ); - } - - /// Return either the index or the member name of the referenced value as a Value. - Value key() const; - - /// Return the index of the referenced Value. -1 if it is not an arrayValue. - UInt index() const; - - /// Return the member name of the referenced Value. "" if it is not an objectValue. - const char *memberName() const; - - protected: - Value &deref() const; - - void increment(); - - void decrement(); - - difference_type computeDistance( const SelfType &other ) const; - - bool isEqual( const SelfType &other ) const; - - void copy( const SelfType &other ); - - private: -#ifndef JSON_VALUE_USE_INTERNAL_MAP - Value::ObjectValues::iterator current_; - // Indicates that iterator is for a null value. - bool isNull_; -#else - union - { - ValueInternalArray::IteratorState array_; - ValueInternalMap::IteratorState map_; - } iterator_; - bool isArray_; -#endif - }; - - /** \brief const iterator for object and array value. - * - */ - class ValueConstIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef const Value &reference; - typedef const Value *pointer; - typedef ValueConstIterator SelfType; - - ValueConstIterator(); - private: - /*! \internal Use by Value to create an iterator. - */ -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueConstIterator( const Value::ObjectValues::iterator ¤t ); -#else - ValueConstIterator( const ValueInternalArray::IteratorState &state ); - ValueConstIterator( const ValueInternalMap::IteratorState &state ); -#endif - public: - SelfType &operator =( const ValueIteratorBase &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } - - SelfType &operator++() - { - increment(); - return *this; - } - - reference operator *() const - { - return deref(); - } - }; - - - /** \brief Iterator for object and array value. - */ - class ValueIterator : public ValueIteratorBase - { - friend class Value; - public: - typedef unsigned int size_t; - typedef int difference_type; - typedef Value &reference; - typedef Value *pointer; - typedef ValueIterator SelfType; - - ValueIterator(); - ValueIterator( const ValueConstIterator &other ); - ValueIterator( const ValueIterator &other ); - private: - /*! \internal Use by Value to create an iterator. - */ -#ifndef JSON_VALUE_USE_INTERNAL_MAP - explicit ValueIterator( const Value::ObjectValues::iterator ¤t ); -#else - ValueIterator( const ValueInternalArray::IteratorState &state ); - ValueIterator( const ValueInternalMap::IteratorState &state ); -#endif - public: - - SelfType &operator =( const SelfType &other ); - - SelfType operator++( int ) - { - SelfType temp( *this ); - ++*this; - return temp; - } - - SelfType operator--( int ) - { - SelfType temp( *this ); - --*this; - return temp; - } - - SelfType &operator--() - { - decrement(); - return *this; - } - - SelfType &operator++() - { - increment(); - return *this; - } - - reference operator *() const - { - return deref(); - } - }; - - -} // namespace Json - - -#endif // CPPTL_JSON_H_INCLUDED diff --git a/qt-correction-tool/pub/json/writer.h b/qt-correction-tool/pub/json/writer.h deleted file mode 100644 index 5f4b83b..0000000 --- a/qt-correction-tool/pub/json/writer.h +++ /dev/null @@ -1,174 +0,0 @@ -#ifndef JSON_WRITER_H_INCLUDED -# define JSON_WRITER_H_INCLUDED - -# include "value.h" -# include -# include -# include - -namespace Json { - - class Value; - - /** \brief Abstract class for writers. - */ - class JSON_API Writer - { - public: - virtual ~Writer(); - - virtual std::string write( const Value &root ) = 0; - }; - - /** \brief Outputs a Value in JSON format without formatting (not human friendly). - * - * The JSON document is written in a single line. It is not intended for 'human' consumption, - * but may be usefull to support feature such as RPC where bandwith is limited. - * \sa Reader, Value - */ - class JSON_API FastWriter : public Writer - { - public: - FastWriter(); - virtual ~FastWriter(){} - - void enableYAMLCompatibility(); - - public: // overridden from Writer - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - - std::string document_; - bool yamlCompatiblityEnabled_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledWriter: public Writer - { - public: - StyledWriter(); - virtual ~StyledWriter(){} - - public: // overridden from Writer - /** \brief Serialize a Value in JSON format. - * \param root Value to serialize. - * \return String containing the JSON document that represents the root value. - */ - virtual std::string write( const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::string document_; - std::string indentString_; - int rightMargin_; - int indentSize_; - bool addChildValues_; - }; - - /** \brief Writes a Value in JSON format in a human friendly way, - to a stream rather than to a string. - * - * The rules for line break and indent are as follow: - * - Object value: - * - if empty then print {} without indent and line break - * - if not empty the print '{', line break & indent, print one value per line - * and then unindent and line break and print '}'. - * - Array value: - * - if empty then print [] without indent and line break - * - if the array contains no object value, empty array or some other value types, - * and all the values fit on one lines, then print the array on a single line. - * - otherwise, it the values do not fit on one line, or the array contains - * object or non empty array, then print one value per line. - * - * If the Value have comments then they are outputed according to their #CommentPlacement. - * - * \param indentation Each level will be indented by this amount extra. - * \sa Reader, Value, Value::setComment() - */ - class JSON_API StyledStreamWriter - { - public: - StyledStreamWriter( std::string indentation="\t" ); - ~StyledStreamWriter(){} - - public: - /** \brief Serialize a Value in JSON format. - * \param out Stream to write to. (Can be ostringstream, e.g.) - * \param root Value to serialize. - * \note There is no point in deriving from Writer, since write() should not return a value. - */ - void write( std::ostream &out, const Value &root ); - - private: - void writeValue( const Value &value ); - void writeArrayValue( const Value &value ); - bool isMultineArray( const Value &value ); - void pushValue( const std::string &value ); - void writeIndent(); - void writeWithIndent( const std::string &value ); - void indent(); - void unindent(); - void writeCommentBeforeValue( const Value &root ); - void writeCommentAfterValueOnSameLine( const Value &root ); - bool hasCommentForValue( const Value &value ); - static std::string normalizeEOL( const std::string &text ); - - typedef std::vector ChildValues; - - ChildValues childValues_; - std::ostream* document_; - std::string indentString_; - int rightMargin_; - std::string indentation_; - bool addChildValues_; - }; - - std::string JSON_API valueToString( Int value ); - std::string JSON_API valueToString( UInt value ); - std::string JSON_API valueToString( double value ); - std::string JSON_API valueToString( bool value ); - std::string JSON_API valueToQuotedString( const char *value ); - - /// \brief Output using the StyledStreamWriter. - /// \see Json::operator>>() - std::ostream& operator<<( std::ostream&, const Value &root ); - -} // namespace Json - - - -#endif // JSON_WRITER_H_INCLUDED diff --git a/qt-correction-tool/pub/opencv/include/opencv2/calib3d.hpp b/qt-correction-tool/pub/opencv/include/opencv2/calib3d.hpp deleted file mode 100644 index 3808526..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/calib3d.hpp +++ /dev/null @@ -1,2618 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_CALIB3D_HPP -#define OPENCV_CALIB3D_HPP - -#include "opencv2/core.hpp" -#include "opencv2/features2d.hpp" -#include "opencv2/core/affine.hpp" - -/** - @defgroup calib3d Camera Calibration and 3D Reconstruction - -The functions in this section use a so-called pinhole camera model. In this model, a scene view is -formed by projecting 3D points into the image plane using a perspective transformation. - -\f[s \; m' = A [R|t] M'\f] - -or - -\f[s \vecthree{u}{v}{1} = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1} -\begin{bmatrix} -r_{11} & r_{12} & r_{13} & t_1 \\ -r_{21} & r_{22} & r_{23} & t_2 \\ -r_{31} & r_{32} & r_{33} & t_3 -\end{bmatrix} -\begin{bmatrix} -X \\ -Y \\ -Z \\ -1 -\end{bmatrix}\f] - -where: - -- \f$(X, Y, Z)\f$ are the coordinates of a 3D point in the world coordinate space -- \f$(u, v)\f$ are the coordinates of the projection point in pixels -- \f$A\f$ is a camera matrix, or a matrix of intrinsic parameters -- \f$(cx, cy)\f$ is a principal point that is usually at the image center -- \f$fx, fy\f$ are the focal lengths expressed in pixel units. - -Thus, if an image from the camera is scaled by a factor, all of these parameters should be scaled -(multiplied/divided, respectively) by the same factor. The matrix of intrinsic parameters does not -depend on the scene viewed. So, once estimated, it can be re-used as long as the focal length is -fixed (in case of zoom lens). The joint rotation-translation matrix \f$[R|t]\f$ is called a matrix of -extrinsic parameters. It is used to describe the camera motion around a static scene, or vice versa, -rigid motion of an object in front of a still camera. That is, \f$[R|t]\f$ translates coordinates of a -point \f$(X, Y, Z)\f$ to a coordinate system, fixed with respect to the camera. The transformation above -is equivalent to the following (when \f$z \ne 0\f$ ): - -\f[\begin{array}{l} -\vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ -x' = x/z \\ -y' = y/z \\ -u = f_x*x' + c_x \\ -v = f_y*y' + c_y -\end{array}\f] - -The following figure illustrates the pinhole camera model. - -![Pinhole camera model](pics/pinhole_camera_model.png) - -Real lenses usually have some distortion, mostly radial distortion and slight tangential distortion. -So, the above model is extended as: - -\f[\begin{array}{l} -\vecthree{x}{y}{z} = R \vecthree{X}{Y}{Z} + t \\ -x' = x/z \\ -y' = y/z \\ -x'' = x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + 2 p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4 \\ -y'' = y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6} + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\ -\text{where} \quad r^2 = x'^2 + y'^2 \\ -u = f_x*x'' + c_x \\ -v = f_y*y'' + c_y -\end{array}\f] - -\f$k_1\f$, \f$k_2\f$, \f$k_3\f$, \f$k_4\f$, \f$k_5\f$, and \f$k_6\f$ are radial distortion coefficients. \f$p_1\f$ and \f$p_2\f$ are -tangential distortion coefficients. \f$s_1\f$, \f$s_2\f$, \f$s_3\f$, and \f$s_4\f$, are the thin prism distortion -coefficients. Higher-order coefficients are not considered in OpenCV. - -The next figures show two common types of radial distortion: barrel distortion (typically \f$ k_1 < 0 \f$) and pincushion distortion (typically \f$ k_1 > 0 \f$). - -![](pics/distortion_examples.png) -![](pics/distortion_examples2.png) - -In some cases the image sensor may be tilted in order to focus an oblique plane in front of the -camera (Scheimpfug condition). This can be useful for particle image velocimetry (PIV) or -triangulation with a laser fan. The tilt causes a perspective distortion of \f$x''\f$ and -\f$y''\f$. This distortion can be modelled in the following way, see e.g. @cite Louhichi07. - -\f[\begin{array}{l} -s\vecthree{x'''}{y'''}{1} = -\vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}(\tau_x, \tau_y)} -{0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)} -{0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\ -u = f_x*x''' + c_x \\ -v = f_y*y''' + c_y -\end{array}\f] - -where the matrix \f$R(\tau_x, \tau_y)\f$ is defined by two rotations with angular parameter \f$\tau_x\f$ -and \f$\tau_y\f$, respectively, - -\f[ -R(\tau_x, \tau_y) = -\vecthreethree{\cos(\tau_y)}{0}{-\sin(\tau_y)}{0}{1}{0}{\sin(\tau_y)}{0}{\cos(\tau_y)} -\vecthreethree{1}{0}{0}{0}{\cos(\tau_x)}{\sin(\tau_x)}{0}{-\sin(\tau_x)}{\cos(\tau_x)} = -\vecthreethree{\cos(\tau_y)}{\sin(\tau_y)\sin(\tau_x)}{-\sin(\tau_y)\cos(\tau_x)} -{0}{\cos(\tau_x)}{\sin(\tau_x)} -{\sin(\tau_y)}{-\cos(\tau_y)\sin(\tau_x)}{\cos(\tau_y)\cos(\tau_x)}. -\f] - -In the functions below the coefficients are passed or returned as - -\f[(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f] - -vector. That is, if the vector contains four elements, it means that \f$k_3=0\f$ . The distortion -coefficients do not depend on the scene viewed. Thus, they also belong to the intrinsic camera -parameters. And they remain the same regardless of the captured image resolution. If, for example, a -camera has been calibrated on images of 320 x 240 resolution, absolutely the same distortion -coefficients can be used for 640 x 480 images from the same camera while \f$f_x\f$, \f$f_y\f$, \f$c_x\f$, and -\f$c_y\f$ need to be scaled appropriately. - -The functions below use the above model to do the following: - -- Project 3D points to the image plane given intrinsic and extrinsic parameters. -- Compute extrinsic parameters given intrinsic parameters, a few 3D points, and their -projections. -- Estimate intrinsic and extrinsic camera parameters from several views of a known calibration -pattern (every view is described by several 3D-2D point correspondences). -- Estimate the relative position and orientation of the stereo camera "heads" and compute the -*rectification* transformation that makes the camera optical axes parallel. - -@note - - A calibration sample for 3 cameras in horizontal position can be found at - opencv_source_code/samples/cpp/3calibration.cpp - - A calibration sample based on a sequence of images can be found at - opencv_source_code/samples/cpp/calibration.cpp - - A calibration sample in order to do 3D reconstruction can be found at - opencv_source_code/samples/cpp/build3dmodel.cpp - - A calibration example on stereo calibration can be found at - opencv_source_code/samples/cpp/stereo_calib.cpp - - A calibration example on stereo matching can be found at - opencv_source_code/samples/cpp/stereo_match.cpp - - (Python) A camera calibration sample can be found at - opencv_source_code/samples/python/calibrate.py - - @{ - @defgroup calib3d_fisheye Fisheye camera model - - Definitions: Let P be a point in 3D of coordinates X in the world reference frame (stored in the - matrix X) The coordinate vector of P in the camera reference frame is: - - \f[Xc = R X + T\f] - - where R is the rotation matrix corresponding to the rotation vector om: R = rodrigues(om); call x, y - and z the 3 coordinates of Xc: - - \f[x = Xc_1 \\ y = Xc_2 \\ z = Xc_3\f] - - The pinhole projection coordinates of P is [a; b] where - - \f[a = x / z \ and \ b = y / z \\ r^2 = a^2 + b^2 \\ \theta = atan(r)\f] - - Fisheye distortion: - - \f[\theta_d = \theta (1 + k_1 \theta^2 + k_2 \theta^4 + k_3 \theta^6 + k_4 \theta^8)\f] - - The distorted point coordinates are [x'; y'] where - - \f[x' = (\theta_d / r) a \\ y' = (\theta_d / r) b \f] - - Finally, conversion into pixel coordinates: The final pixel coordinates vector [u; v] where: - - \f[u = f_x (x' + \alpha y') + c_x \\ - v = f_y y' + c_y\f] - - @defgroup calib3d_c C API - - @} - */ - -namespace cv -{ - -//! @addtogroup calib3d -//! @{ - -//! type of the robust estimation algorithm -enum { LMEDS = 4, //!< least-median of squares algorithm - RANSAC = 8, //!< RANSAC algorithm - RHO = 16 //!< RHO algorithm - }; - -enum { SOLVEPNP_ITERATIVE = 0, - SOLVEPNP_EPNP = 1, //!< EPnP: Efficient Perspective-n-Point Camera Pose Estimation @cite lepetit2009epnp - SOLVEPNP_P3P = 2, //!< Complete Solution Classification for the Perspective-Three-Point Problem @cite gao2003complete - SOLVEPNP_DLS = 3, //!< A Direct Least-Squares (DLS) Method for PnP @cite hesch2011direct - SOLVEPNP_UPNP = 4, //!< Exhaustive Linearization for Robust Camera Pose and Focal Length Estimation @cite penate2013exhaustive - SOLVEPNP_AP3P = 5, //!< An Efficient Algebraic Solution to the Perspective-Three-Point Problem @cite Ke17 - SOLVEPNP_MAX_COUNT //!< Used for count -}; - -enum { CALIB_CB_ADAPTIVE_THRESH = 1, - CALIB_CB_NORMALIZE_IMAGE = 2, - CALIB_CB_FILTER_QUADS = 4, - CALIB_CB_FAST_CHECK = 8 - }; - -enum { CALIB_CB_SYMMETRIC_GRID = 1, - CALIB_CB_ASYMMETRIC_GRID = 2, - CALIB_CB_CLUSTERING = 4 - }; - -enum { CALIB_USE_INTRINSIC_GUESS = 0x00001, - CALIB_FIX_ASPECT_RATIO = 0x00002, - CALIB_FIX_PRINCIPAL_POINT = 0x00004, - CALIB_ZERO_TANGENT_DIST = 0x00008, - CALIB_FIX_FOCAL_LENGTH = 0x00010, - CALIB_FIX_K1 = 0x00020, - CALIB_FIX_K2 = 0x00040, - CALIB_FIX_K3 = 0x00080, - CALIB_FIX_K4 = 0x00800, - CALIB_FIX_K5 = 0x01000, - CALIB_FIX_K6 = 0x02000, - CALIB_RATIONAL_MODEL = 0x04000, - CALIB_THIN_PRISM_MODEL = 0x08000, - CALIB_FIX_S1_S2_S3_S4 = 0x10000, - CALIB_TILTED_MODEL = 0x40000, - CALIB_FIX_TAUX_TAUY = 0x80000, - CALIB_USE_QR = 0x100000, //!< use QR instead of SVD decomposition for solving. Faster but potentially less precise - CALIB_FIX_TANGENT_DIST = 0x200000, - // only for stereo - CALIB_FIX_INTRINSIC = 0x00100, - CALIB_SAME_FOCAL_LENGTH = 0x00200, - // for stereo rectification - CALIB_ZERO_DISPARITY = 0x00400, - CALIB_USE_LU = (1 << 17), //!< use LU instead of SVD decomposition for solving. much faster but potentially less precise - CALIB_USE_EXTRINSIC_GUESS = (1 << 22) //!< for stereoCalibrate - }; - -//! the algorithm for finding fundamental matrix -enum { FM_7POINT = 1, //!< 7-point algorithm - FM_8POINT = 2, //!< 8-point algorithm - FM_LMEDS = 4, //!< least-median algorithm. 7-point algorithm is used. - FM_RANSAC = 8 //!< RANSAC algorithm. It needs at least 15 points. 7-point algorithm is used. - }; - -enum HandEyeCalibrationMethod -{ - CALIB_HAND_EYE_TSAI = 0, //!< A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/Eye Calibration @cite Tsai89 - CALIB_HAND_EYE_PARK = 1, //!< Robot Sensor Calibration: Solving AX = XB on the Euclidean Group @cite Park94 - CALIB_HAND_EYE_HORAUD = 2, //!< Hand-eye Calibration @cite Horaud95 - CALIB_HAND_EYE_ANDREFF = 3, //!< On-line Hand-Eye Calibration @cite Andreff99 - CALIB_HAND_EYE_DANIILIDIS = 4 //!< Hand-Eye Calibration Using Dual Quaternions @cite Daniilidis98 -}; - - -/** @brief Converts a rotation matrix to a rotation vector or vice versa. - -@param src Input rotation vector (3x1 or 1x3) or rotation matrix (3x3). -@param dst Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively. -@param jacobian Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial -derivatives of the output array components with respect to the input array components. - -\f[\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos{\theta} I + (1- \cos{\theta} ) r r^T + \sin{\theta} \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}\f] - -Inverse transformation can be also done easily, since - -\f[\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}\f] - -A rotation vector is a convenient and most compact representation of a rotation matrix (since any -rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry -optimization procedures like calibrateCamera, stereoCalibrate, or solvePnP . - */ -CV_EXPORTS_W void Rodrigues( InputArray src, OutputArray dst, OutputArray jacobian = noArray() ); - -/** @example samples/cpp/tutorial_code/features2D/Homography/pose_from_homography.cpp -An example program about pose estimation from coplanar points - -Check @ref tutorial_homography "the corresponding tutorial" for more details -*/ - -/** @brief Finds a perspective transformation between two planes. - -@param srcPoints Coordinates of the points in the original plane, a matrix of the type CV_32FC2 -or vector\ . -@param dstPoints Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or -a vector\ . -@param method Method used to compute a homography matrix. The following methods are possible: -- **0** - a regular method using all the points, i.e., the least squares method -- **RANSAC** - RANSAC-based robust method -- **LMEDS** - Least-Median robust method -- **RHO** - PROSAC-based robust method -@param ransacReprojThreshold Maximum allowed reprojection error to treat a point pair as an inlier -(used in the RANSAC and RHO methods only). That is, if -\f[\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} * \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}\f] -then the point \f$i\f$ is considered as an outlier. If srcPoints and dstPoints are measured in pixels, -it usually makes sense to set this parameter somewhere in the range of 1 to 10. -@param mask Optional output mask set by a robust method ( RANSAC or LMEDS ). Note that the input -mask values are ignored. -@param maxIters The maximum number of RANSAC iterations. -@param confidence Confidence level, between 0 and 1. - -The function finds and returns the perspective transformation \f$H\f$ between the source and the -destination planes: - -\f[s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}\f] - -so that the back-projection error - -\f[\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2\f] - -is minimized. If the parameter method is set to the default value 0, the function uses all the point -pairs to compute an initial homography estimate with a simple least-squares scheme. - -However, if not all of the point pairs ( \f$srcPoints_i\f$, \f$dstPoints_i\f$ ) fit the rigid perspective -transformation (that is, there are some outliers), this initial estimate will be poor. In this case, -you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different -random subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix -using this subset and a simple least-squares algorithm, and then compute the quality/goodness of the -computed homography (which is the number of inliers for RANSAC or the least median re-projection error for -LMeDS). The best subset is then used to produce the initial estimate of the homography matrix and -the mask of inliers/outliers. - -Regardless of the method, robust or not, the computed homography matrix is refined further (using -inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the -re-projection error even more. - -The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to -distinguish inliers from outliers. The method LMeDS does not need any threshold but it works -correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the -noise is rather small, use the default method (method=0). - -The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is -determined up to a scale. Thus, it is normalized so that \f$h_{33}=1\f$. Note that whenever an \f$H\f$ matrix -cannot be estimated, an empty one will be returned. - -@sa -getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective, -perspectiveTransform - */ -CV_EXPORTS_W Mat findHomography( InputArray srcPoints, InputArray dstPoints, - int method = 0, double ransacReprojThreshold = 3, - OutputArray mask=noArray(), const int maxIters = 2000, - const double confidence = 0.995); - -/** @overload */ -CV_EXPORTS Mat findHomography( InputArray srcPoints, InputArray dstPoints, - OutputArray mask, int method = 0, double ransacReprojThreshold = 3 ); - -/** @brief Computes an RQ decomposition of 3x3 matrices. - -@param src 3x3 input matrix. -@param mtxR Output 3x3 upper-triangular matrix. -@param mtxQ Output 3x3 orthogonal matrix. -@param Qx Optional output 3x3 rotation matrix around x-axis. -@param Qy Optional output 3x3 rotation matrix around y-axis. -@param Qz Optional output 3x3 rotation matrix around z-axis. - -The function computes a RQ decomposition using the given rotations. This function is used in -decomposeProjectionMatrix to decompose the left 3x3 submatrix of a projection matrix into a camera -and a rotation matrix. - -It optionally returns three rotation matrices, one for each axis, and the three Euler angles in -degrees (as the return value) that could be used in OpenGL. Note, there is always more than one -sequence of rotations about the three principal axes that results in the same orientation of an -object, e.g. see @cite Slabaugh . Returned tree rotation matrices and corresponding three Euler angles -are only one of the possible solutions. - */ -CV_EXPORTS_W Vec3d RQDecomp3x3( InputArray src, OutputArray mtxR, OutputArray mtxQ, - OutputArray Qx = noArray(), - OutputArray Qy = noArray(), - OutputArray Qz = noArray()); - -/** @brief Decomposes a projection matrix into a rotation matrix and a camera matrix. - -@param projMatrix 3x4 input projection matrix P. -@param cameraMatrix Output 3x3 camera matrix K. -@param rotMatrix Output 3x3 external rotation matrix R. -@param transVect Output 4x1 translation vector T. -@param rotMatrixX Optional 3x3 rotation matrix around x-axis. -@param rotMatrixY Optional 3x3 rotation matrix around y-axis. -@param rotMatrixZ Optional 3x3 rotation matrix around z-axis. -@param eulerAngles Optional three-element vector containing three Euler angles of rotation in -degrees. - -The function computes a decomposition of a projection matrix into a calibration and a rotation -matrix and the position of a camera. - -It optionally returns three rotation matrices, one for each axis, and three Euler angles that could -be used in OpenGL. Note, there is always more than one sequence of rotations about the three -principal axes that results in the same orientation of an object, e.g. see @cite Slabaugh . Returned -tree rotation matrices and corresponding three Euler angles are only one of the possible solutions. - -The function is based on RQDecomp3x3 . - */ -CV_EXPORTS_W void decomposeProjectionMatrix( InputArray projMatrix, OutputArray cameraMatrix, - OutputArray rotMatrix, OutputArray transVect, - OutputArray rotMatrixX = noArray(), - OutputArray rotMatrixY = noArray(), - OutputArray rotMatrixZ = noArray(), - OutputArray eulerAngles =noArray() ); - -/** @brief Computes partial derivatives of the matrix product for each multiplied matrix. - -@param A First multiplied matrix. -@param B Second multiplied matrix. -@param dABdA First output derivative matrix d(A\*B)/dA of size -\f$\texttt{A.rows*B.cols} \times {A.rows*A.cols}\f$ . -@param dABdB Second output derivative matrix d(A\*B)/dB of size -\f$\texttt{A.rows*B.cols} \times {B.rows*B.cols}\f$ . - -The function computes partial derivatives of the elements of the matrix product \f$A*B\f$ with regard to -the elements of each of the two input matrices. The function is used to compute the Jacobian -matrices in stereoCalibrate but can also be used in any other similar optimization function. - */ -CV_EXPORTS_W void matMulDeriv( InputArray A, InputArray B, OutputArray dABdA, OutputArray dABdB ); - -/** @brief Combines two rotation-and-shift transformations. - -@param rvec1 First rotation vector. -@param tvec1 First translation vector. -@param rvec2 Second rotation vector. -@param tvec2 Second translation vector. -@param rvec3 Output rotation vector of the superposition. -@param tvec3 Output translation vector of the superposition. -@param dr3dr1 -@param dr3dt1 -@param dr3dr2 -@param dr3dt2 -@param dt3dr1 -@param dt3dt1 -@param dt3dr2 -@param dt3dt2 Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and -tvec2, respectively. - -The functions compute: - -\f[\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,\f] - -where \f$\mathrm{rodrigues}\f$ denotes a rotation vector to a rotation matrix transformation, and -\f$\mathrm{rodrigues}^{-1}\f$ denotes the inverse transformation. See Rodrigues for details. - -Also, the functions can compute the derivatives of the output vectors with regards to the input -vectors (see matMulDeriv ). The functions are used inside stereoCalibrate but can also be used in -your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a -function that contains a matrix multiplication. - */ -CV_EXPORTS_W void composeRT( InputArray rvec1, InputArray tvec1, - InputArray rvec2, InputArray tvec2, - OutputArray rvec3, OutputArray tvec3, - OutputArray dr3dr1 = noArray(), OutputArray dr3dt1 = noArray(), - OutputArray dr3dr2 = noArray(), OutputArray dr3dt2 = noArray(), - OutputArray dt3dr1 = noArray(), OutputArray dt3dt1 = noArray(), - OutputArray dt3dr2 = noArray(), OutputArray dt3dt2 = noArray() ); - -/** @brief Projects 3D points to an image plane. - -@param objectPoints Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or -vector\ ), where N is the number of points in the view. -@param rvec Rotation vector. See Rodrigues for details. -@param tvec Translation vector. -@param cameraMatrix Camera matrix \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$ . -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed. -@param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or -vector\ . -@param jacobian Optional output 2Nx(10+\) jacobian matrix of derivatives of image -points with respect to components of the rotation vector, translation vector, focal lengths, -coordinates of the principal point and the distortion coefficients. In the old interface different -components of the jacobian are returned via different output parameters. -@param aspectRatio Optional "fixed aspect ratio" parameter. If the parameter is not 0, the -function assumes that the aspect ratio (*fx/fy*) is fixed and correspondingly adjusts the jacobian -matrix. - -The function computes projections of 3D points to the image plane given intrinsic and extrinsic -camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of -image points coordinates (as functions of all the input parameters) with respect to the particular -parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in -calibrateCamera, solvePnP, and stereoCalibrate . The function itself can also be used to compute a -re-projection error given the current intrinsic and extrinsic parameters. - -@note By setting rvec=tvec=(0,0,0) or by setting cameraMatrix to a 3x3 identity matrix, or by -passing zero distortion coefficients, you can get various useful partial cases of the function. This -means that you can compute the distorted coordinates for a sparse set of points or apply a -perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup. - */ -CV_EXPORTS_W void projectPoints( InputArray objectPoints, - InputArray rvec, InputArray tvec, - InputArray cameraMatrix, InputArray distCoeffs, - OutputArray imagePoints, - OutputArray jacobian = noArray(), - double aspectRatio = 0 ); - -/** @example samples/cpp/tutorial_code/features2D/Homography/homography_from_camera_displacement.cpp -An example program about homography from the camera displacement - -Check @ref tutorial_homography "the corresponding tutorial" for more details -*/ - -/** @brief Finds an object pose from 3D-2D point correspondences. - -@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or -1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. -@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, -where N is the number of points. vector\ can be also passed here. -@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ . -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are -assumed. -@param rvec Output rotation vector (see @ref Rodrigues ) that, together with tvec , brings points from -the model coordinate system to the camera coordinate system. -@param tvec Output translation vector. -@param useExtrinsicGuess Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses -the provided rvec and tvec values as initial approximations of the rotation and translation -vectors, respectively, and further optimizes them. -@param flags Method for solving a PnP problem: -- **SOLVEPNP_ITERATIVE** Iterative method is based on Levenberg-Marquardt optimization. In -this case the function finds such a pose that minimizes reprojection error, that is the sum -of squared distances between the observed projections imagePoints and the projected (using -projectPoints ) objectPoints . -- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang -"Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete). -In this case the function requires exactly four object and image points. -- **SOLVEPNP_AP3P** Method is based on the paper of T. Ke, S. Roumeliotis -"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17). -In this case the function requires exactly four object and image points. -- **SOLVEPNP_EPNP** Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the -paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" (@cite lepetit2009epnp). -- **SOLVEPNP_DLS** Method is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis. -"A Direct Least-Squares (DLS) Method for PnP" (@cite hesch2011direct). -- **SOLVEPNP_UPNP** Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto, -F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length -Estimation" (@cite penate2013exhaustive). In this case the function also estimates the parameters \f$f_x\f$ and \f$f_y\f$ -assuming that both have the same value. Then the cameraMatrix is updated with the estimated -focal length. -- **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis. -"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17). In this case the -function requires exactly four object and image points. - -The function estimates the object pose given a set of object points, their corresponding image -projections, as well as the camera matrix and the distortion coefficients, see the figure below -(more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward -and the Z-axis forward). - -![](pnp.jpg) - -Points expressed in the world frame \f$ \bf{X}_w \f$ are projected into the image plane \f$ \left[ u, v \right] \f$ -using the perspective projection model \f$ \Pi \f$ and the camera intrinsic parameters matrix \f$ \bf{A} \f$: - -\f[ - \begin{align*} - \begin{bmatrix} - u \\ - v \\ - 1 - \end{bmatrix} &= - \bf{A} \hspace{0.1em} \Pi \hspace{0.2em} ^{c}\bf{M}_w - \begin{bmatrix} - X_{w} \\ - Y_{w} \\ - Z_{w} \\ - 1 - \end{bmatrix} \\ - \begin{bmatrix} - u \\ - v \\ - 1 - \end{bmatrix} &= - \begin{bmatrix} - f_x & 0 & c_x \\ - 0 & f_y & c_y \\ - 0 & 0 & 1 - \end{bmatrix} - \begin{bmatrix} - 1 & 0 & 0 & 0 \\ - 0 & 1 & 0 & 0 \\ - 0 & 0 & 1 & 0 - \end{bmatrix} - \begin{bmatrix} - r_{11} & r_{12} & r_{13} & t_x \\ - r_{21} & r_{22} & r_{23} & t_y \\ - r_{31} & r_{32} & r_{33} & t_z \\ - 0 & 0 & 0 & 1 - \end{bmatrix} - \begin{bmatrix} - X_{w} \\ - Y_{w} \\ - Z_{w} \\ - 1 - \end{bmatrix} - \end{align*} -\f] - -The estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow to transform -a 3D point expressed in the world frame into the camera frame: - -\f[ - \begin{align*} - \begin{bmatrix} - X_c \\ - Y_c \\ - Z_c \\ - 1 - \end{bmatrix} &= - \hspace{0.2em} ^{c}\bf{M}_w - \begin{bmatrix} - X_{w} \\ - Y_{w} \\ - Z_{w} \\ - 1 - \end{bmatrix} \\ - \begin{bmatrix} - X_c \\ - Y_c \\ - Z_c \\ - 1 - \end{bmatrix} &= - \begin{bmatrix} - r_{11} & r_{12} & r_{13} & t_x \\ - r_{21} & r_{22} & r_{23} & t_y \\ - r_{31} & r_{32} & r_{33} & t_z \\ - 0 & 0 & 0 & 1 - \end{bmatrix} - \begin{bmatrix} - X_{w} \\ - Y_{w} \\ - Z_{w} \\ - 1 - \end{bmatrix} - \end{align*} -\f] - -@note - - An example of how to use solvePnP for planar augmented reality can be found at - opencv_source_code/samples/python/plane_ar.py - - If you are using Python: - - Numpy array slices won't work as input because solvePnP requires contiguous - arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of - modules/calib3d/src/solvepnp.cpp version 2.4.9) - - The P3P algorithm requires image points to be in an array of shape (N,1,2) due - to its calling of cv::undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9) - which requires 2-channel information. - - Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of - it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints = - np.ascontiguousarray(D[:,:2]).reshape((N,1,2)) - - The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are - unstable and sometimes give completely wrong results. If you pass one of these two - flags, **SOLVEPNP_EPNP** method will be used instead. - - The minimum number of points is 4 in the general case. In the case of **SOLVEPNP_P3P** and **SOLVEPNP_AP3P** - methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions - of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error). - - With **SOLVEPNP_ITERATIVE** method and `useExtrinsicGuess=true`, the minimum number of points is 3 (3 points - are sufficient to compute a pose but there are up to 4 solutions). The initial solution should be close to the - global solution to converge. - */ -CV_EXPORTS_W bool solvePnP( InputArray objectPoints, InputArray imagePoints, - InputArray cameraMatrix, InputArray distCoeffs, - OutputArray rvec, OutputArray tvec, - bool useExtrinsicGuess = false, int flags = SOLVEPNP_ITERATIVE ); - -/** @brief Finds an object pose from 3D-2D point correspondences using the RANSAC scheme. - -@param objectPoints Array of object points in the object coordinate space, Nx3 1-channel or -1xN/Nx1 3-channel, where N is the number of points. vector\ can be also passed here. -@param imagePoints Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel, -where N is the number of points. vector\ can be also passed here. -@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ . -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are -assumed. -@param rvec Output rotation vector (see Rodrigues ) that, together with tvec , brings points from -the model coordinate system to the camera coordinate system. -@param tvec Output translation vector. -@param useExtrinsicGuess Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses -the provided rvec and tvec values as initial approximations of the rotation and translation -vectors, respectively, and further optimizes them. -@param iterationsCount Number of iterations. -@param reprojectionError Inlier threshold value used by the RANSAC procedure. The parameter value -is the maximum allowed distance between the observed and computed point projections to consider it -an inlier. -@param confidence The probability that the algorithm produces a useful result. -@param inliers Output vector that contains indices of inliers in objectPoints and imagePoints . -@param flags Method for solving a PnP problem (see solvePnP ). - -The function estimates an object pose given a set of object points, their corresponding image -projections, as well as the camera matrix and the distortion coefficients. This function finds such -a pose that minimizes reprojection error, that is, the sum of squared distances between the observed -projections imagePoints and the projected (using projectPoints ) objectPoints. The use of RANSAC -makes the function resistant to outliers. - -@note - - An example of how to use solvePNPRansac for object detection can be found at - opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/ - - The default method used to estimate the camera pose for the Minimal Sample Sets step - is #SOLVEPNP_EPNP. Exceptions are: - - if you choose #SOLVEPNP_P3P or #SOLVEPNP_AP3P, these methods will be used. - - if the number of input points is equal to 4, #SOLVEPNP_P3P is used. - - The method used to estimate the camera pose using all the inliers is defined by the - flags parameters unless it is equal to #SOLVEPNP_P3P or #SOLVEPNP_AP3P. In this case, - the method #SOLVEPNP_EPNP will be used instead. - */ -CV_EXPORTS_W bool solvePnPRansac( InputArray objectPoints, InputArray imagePoints, - InputArray cameraMatrix, InputArray distCoeffs, - OutputArray rvec, OutputArray tvec, - bool useExtrinsicGuess = false, int iterationsCount = 100, - float reprojectionError = 8.0, double confidence = 0.99, - OutputArray inliers = noArray(), int flags = SOLVEPNP_ITERATIVE ); -/** @brief Finds an object pose from 3 3D-2D point correspondences. - -@param objectPoints Array of object points in the object coordinate space, 3x3 1-channel or -1x3/3x1 3-channel. vector\ can be also passed here. -@param imagePoints Array of corresponding image points, 3x2 1-channel or 1x3/3x1 2-channel. - vector\ can be also passed here. -@param cameraMatrix Input camera matrix \f$A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}\f$ . -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are -assumed. -@param rvecs Output rotation vectors (see Rodrigues ) that, together with tvecs , brings points from -the model coordinate system to the camera coordinate system. A P3P problem has up to 4 solutions. -@param tvecs Output translation vectors. -@param flags Method for solving a P3P problem: -- **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang -"Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete). -- **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis. -"An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17). - -The function estimates the object pose given 3 object points, their corresponding image -projections, as well as the camera matrix and the distortion coefficients. - */ -CV_EXPORTS_W int solveP3P( InputArray objectPoints, InputArray imagePoints, - InputArray cameraMatrix, InputArray distCoeffs, - OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, - int flags ); - -/** @brief Finds an initial camera matrix from 3D-2D point correspondences. - -@param objectPoints Vector of vectors of the calibration pattern points in the calibration pattern -coordinate space. In the old interface all the per-view vectors are concatenated. See -calibrateCamera for details. -@param imagePoints Vector of vectors of the projections of the calibration pattern points. In the -old interface all the per-view vectors are concatenated. -@param imageSize Image size in pixels used to initialize the principal point. -@param aspectRatio If it is zero or negative, both \f$f_x\f$ and \f$f_y\f$ are estimated independently. -Otherwise, \f$f_x = f_y * \texttt{aspectRatio}\f$ . - -The function estimates and returns an initial camera matrix for the camera calibration process. -Currently, the function only supports planar calibration patterns, which are patterns where each -object point has z-coordinate =0. - */ -CV_EXPORTS_W Mat initCameraMatrix2D( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints, - Size imageSize, double aspectRatio = 1.0 ); - -/** @brief Finds the positions of internal corners of the chessboard. - -@param image Source chessboard view. It must be an 8-bit grayscale or color image. -@param patternSize Number of inner corners per a chessboard row and column -( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows) ). -@param corners Output array of detected corners. -@param flags Various operation flags that can be zero or a combination of the following values: -- **CALIB_CB_ADAPTIVE_THRESH** Use adaptive thresholding to convert the image to black -and white, rather than a fixed threshold level (computed from the average image brightness). -- **CALIB_CB_NORMALIZE_IMAGE** Normalize the image gamma with equalizeHist before -applying fixed or adaptive thresholding. -- **CALIB_CB_FILTER_QUADS** Use additional criteria (like contour area, perimeter, -square-like shape) to filter out false quads extracted at the contour retrieval stage. -- **CALIB_CB_FAST_CHECK** Run a fast check on the image that looks for chessboard corners, -and shortcut the call if none is found. This can drastically speed up the call in the -degenerate condition when no chessboard is observed. - -The function attempts to determine whether the input image is a view of the chessboard pattern and -locate the internal chessboard corners. The function returns a non-zero value if all of the corners -are found and they are placed in a certain order (row by row, left to right in every row). -Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example, -a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black -squares touch each other. The detected coordinates are approximate, and to determine their positions -more accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with -different parameters if returned coordinates are not accurate enough. - -Sample usage of detecting and drawing chessboard corners: : -@code - Size patternsize(8,6); //interior number of corners - Mat gray = ....; //source image - vector corners; //this will be filled by the detected corners - - //CALIB_CB_FAST_CHECK saves a lot of time on images - //that do not contain any chessboard corners - bool patternfound = findChessboardCorners(gray, patternsize, corners, - CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE - + CALIB_CB_FAST_CHECK); - - if(patternfound) - cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1), - TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1)); - - drawChessboardCorners(img, patternsize, Mat(corners), patternfound); -@endcode -@note The function requires white space (like a square-thick border, the wider the better) around -the board to make the detection more robust in various environments. Otherwise, if there is no -border and the background is dark, the outer black squares cannot be segmented properly and so the -square grouping and ordering algorithm fails. - */ -CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners, - int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE ); - -//! finds subpixel-accurate positions of the chessboard corners -CV_EXPORTS bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size ); - -/** @brief Renders the detected chessboard corners. - -@param image Destination image. It must be an 8-bit color image. -@param patternSize Number of inner corners per a chessboard row and column -(patternSize = cv::Size(points_per_row,points_per_column)). -@param corners Array of detected corners, the output of findChessboardCorners. -@param patternWasFound Parameter indicating whether the complete board was found or not. The -return value of findChessboardCorners should be passed here. - -The function draws individual chessboard corners detected either as red circles if the board was not -found, or as colored corners connected with lines if the board was found. - */ -CV_EXPORTS_W void drawChessboardCorners( InputOutputArray image, Size patternSize, - InputArray corners, bool patternWasFound ); - -/** @brief Draw axes of the world/object coordinate system from pose estimation. @sa solvePnP - -@param image Input/output image. It must have 1 or 3 channels. The number of channels is not altered. -@param cameraMatrix Input 3x3 floating-point matrix of camera intrinsic parameters. -\f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed. -@param rvec Rotation vector (see @ref Rodrigues ) that, together with tvec , brings points from -the model coordinate system to the camera coordinate system. -@param tvec Translation vector. -@param length Length of the painted axes in the same unit than tvec (usually in meters). -@param thickness Line thickness of the painted axes. - -This function draws the axes of the world/object coordinate system w.r.t. to the camera frame. -OX is drawn in red, OY in green and OZ in blue. - */ -CV_EXPORTS_W void drawFrameAxes(InputOutputArray image, InputArray cameraMatrix, InputArray distCoeffs, - InputArray rvec, InputArray tvec, float length, int thickness=3); - -struct CV_EXPORTS_W_SIMPLE CirclesGridFinderParameters -{ - CV_WRAP CirclesGridFinderParameters(); - CV_PROP_RW cv::Size2f densityNeighborhoodSize; - CV_PROP_RW float minDensity; - CV_PROP_RW int kmeansAttempts; - CV_PROP_RW int minDistanceToAddKeypoint; - CV_PROP_RW int keypointScale; - CV_PROP_RW float minGraphConfidence; - CV_PROP_RW float vertexGain; - CV_PROP_RW float vertexPenalty; - CV_PROP_RW float existingVertexGain; - CV_PROP_RW float edgeGain; - CV_PROP_RW float edgePenalty; - CV_PROP_RW float convexHullFactor; - CV_PROP_RW float minRNGEdgeSwitchDist; - - enum GridType - { - SYMMETRIC_GRID, ASYMMETRIC_GRID - }; - GridType gridType; -}; - -struct CV_EXPORTS_W_SIMPLE CirclesGridFinderParameters2 : public CirclesGridFinderParameters -{ - CV_WRAP CirclesGridFinderParameters2(); - - CV_PROP_RW float squareSize; //!< Distance between two adjacent points. Used by CALIB_CB_CLUSTERING. - CV_PROP_RW float maxRectifiedDistance; //!< Max deviation from predicion. Used by CALIB_CB_CLUSTERING. -}; - -/** @brief Finds centers in the grid of circles. - -@param image grid view of input circles; it must be an 8-bit grayscale or color image. -@param patternSize number of circles per row and column -( patternSize = Size(points_per_row, points_per_colum) ). -@param centers output array of detected centers. -@param flags various operation flags that can be one of the following values: -- **CALIB_CB_SYMMETRIC_GRID** uses symmetric pattern of circles. -- **CALIB_CB_ASYMMETRIC_GRID** uses asymmetric pattern of circles. -- **CALIB_CB_CLUSTERING** uses a special algorithm for grid detection. It is more robust to -perspective distortions but much more sensitive to background clutter. -@param blobDetector feature detector that finds blobs like dark circles on light background. -@param parameters struct for finding circles in a grid pattern. - -The function attempts to determine whether the input image contains a grid of circles. If it is, the -function locates centers of the circles. The function returns a non-zero value if all of the centers -have been found and they have been placed in a certain order (row by row, left to right in every -row). Otherwise, if the function fails to find all the corners or reorder them, it returns 0. - -Sample usage of detecting and drawing the centers of circles: : -@code - Size patternsize(7,7); //number of centers - Mat gray = ....; //source image - vector centers; //this will be filled by the detected centers - - bool patternfound = findCirclesGrid(gray, patternsize, centers); - - drawChessboardCorners(img, patternsize, Mat(centers), patternfound); -@endcode -@note The function requires white space (like a square-thick border, the wider the better) around -the board to make the detection more robust in various environments. - */ -CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize, - OutputArray centers, int flags, - const Ptr &blobDetector, - CirclesGridFinderParameters parameters); - -/** @overload */ -CV_EXPORTS_W bool findCirclesGrid2( InputArray image, Size patternSize, - OutputArray centers, int flags, - const Ptr &blobDetector, - CirclesGridFinderParameters2 parameters); - -/** @overload */ -CV_EXPORTS_W bool findCirclesGrid( InputArray image, Size patternSize, - OutputArray centers, int flags = CALIB_CB_SYMMETRIC_GRID, - const Ptr &blobDetector = SimpleBlobDetector::create()); - -/** @brief Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern. - -@param objectPoints In the new interface it is a vector of vectors of calibration pattern points in -the calibration pattern coordinate space (e.g. std::vector>). The outer -vector contains as many elements as the number of the pattern views. If the same calibration pattern -is shown in each view and it is fully visible, all the vectors will be the same. Although, it is -possible to use partially occluded patterns, or even different patterns in different views. Then, -the vectors will be different. The points are 3D, but since they are in a pattern coordinate system, -then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that -Z-coordinate of each input object point is 0. -In the old interface all the vectors of object points from different views are concatenated -together. -@param imagePoints In the new interface it is a vector of vectors of the projections of calibration -pattern points (e.g. std::vector>). imagePoints.size() and -objectPoints.size() and imagePoints[i].size() must be equal to objectPoints[i].size() for each i. -In the old interface all the vectors of object points from different views are concatenated -together. -@param imageSize Size of the image used only to initialize the intrinsic camera matrix. -@param cameraMatrix Output 3x3 floating-point camera matrix -\f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If CV\_CALIB\_USE\_INTRINSIC\_GUESS -and/or CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be -initialized before calling the function. -@param distCoeffs Output vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. -@param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view -(e.g. std::vector>). That is, each k-th rotation vector together with the corresponding -k-th translation vector (see the next output parameter description) brings the calibration pattern -from the model coordinate space (in which object points are specified) to the world coordinate -space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. *M* -1). -@param tvecs Output vector of translation vectors estimated for each pattern view. -@param stdDeviationsIntrinsics Output vector of standard deviations estimated for intrinsic parameters. - Order of deviations values: -\f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3, - s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero. -@param stdDeviationsExtrinsics Output vector of standard deviations estimated for extrinsic parameters. - Order of deviations values: \f$(R_1, T_1, \dotsc , R_M, T_M)\f$ where M is number of pattern views, - \f$R_i, T_i\f$ are concatenated 1x3 vectors. - @param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view. -@param flags Different flags that may be zero or a combination of the following values: -- **CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of -fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image -center ( imageSize is used), and focal distances are computed in a least-squares fashion. -Note, that if intrinsic parameters are known, there is no need to use this function just to -estimate extrinsic parameters. Use solvePnP instead. -- **CALIB_FIX_PRINCIPAL_POINT** The principal point is not changed during the global -optimization. It stays at the center or at a different location specified when -CALIB_USE_INTRINSIC_GUESS is set too. -- **CALIB_FIX_ASPECT_RATIO** The functions considers only fy as a free parameter. The -ratio fx/fy stays the same as in the input cameraMatrix . When -CALIB_USE_INTRINSIC_GUESS is not set, the actual input values of fx and fy are -ignored, only their ratio is computed and used further. -- **CALIB_ZERO_TANGENT_DIST** Tangential distortion coefficients \f$(p_1, p_2)\f$ are set -to zeros and stay zero. -- **CALIB_FIX_K1,...,CALIB_FIX_K6** The corresponding radial distortion -coefficient is not changed during the optimization. If CALIB_USE_INTRINSIC_GUESS is -set, the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0. -- **CALIB_RATIONAL_MODEL** Coefficients k4, k5, and k6 are enabled. To provide the -backward compatibility, this extra flag should be explicitly specified to make the -calibration function use the rational model and return 8 coefficients. If the flag is not -set, the function computes and returns only 5 distortion coefficients. -- **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the -backward compatibility, this extra flag should be explicitly specified to make the -calibration function use the thin prism model and return 12 coefficients. If the flag is not -set, the function computes and returns only 5 distortion coefficients. -- **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during -the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the -supplied distCoeffs matrix is used. Otherwise, it is set to 0. -- **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the -backward compatibility, this extra flag should be explicitly specified to make the -calibration function use the tilted sensor model and return 14 coefficients. If the flag is not -set, the function computes and returns only 5 distortion coefficients. -- **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during -the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the -supplied distCoeffs matrix is used. Otherwise, it is set to 0. -@param criteria Termination criteria for the iterative optimization algorithm. - -@return the overall RMS re-projection error. - -The function estimates the intrinsic camera parameters and extrinsic parameters for each of the -views. The algorithm is based on @cite Zhang2000 and @cite BouguetMCT . The coordinates of 3D object -points and their corresponding 2D projections in each view must be specified. That may be achieved -by using an object with a known geometry and easily detectable feature points. Such an object is -called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as -a calibration rig (see findChessboardCorners ). Currently, initialization of intrinsic parameters -(when CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration -patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also -be used as long as initial cameraMatrix is provided. - -The algorithm performs the following steps: - -- Compute the initial intrinsic parameters (the option only available for planar calibration - patterns) or read them from the input parameters. The distortion coefficients are all set to - zeros initially unless some of CALIB_FIX_K? are specified. - -- Estimate the initial camera pose as if the intrinsic parameters have been already known. This is - done using solvePnP . - -- Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error, - that is, the total sum of squared distances between the observed feature points imagePoints and - the projected (using the current estimates for camera parameters and the poses) object points - objectPoints. See projectPoints for details. - -@note - If you use a non-square (=non-NxN) grid and findChessboardCorners for calibration, and - calibrateCamera returns bad values (zero distortion coefficients, an image center very far from - (w/2-0.5,h/2-0.5), and/or large differences between \f$f_x\f$ and \f$f_y\f$ (ratios of 10:1 or more)), - then you have probably used patternSize=cvSize(rows,cols) instead of using - patternSize=cvSize(cols,rows) in findChessboardCorners . - -@sa - findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort - */ -CV_EXPORTS_AS(calibrateCameraExtended) double calibrateCamera( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints, Size imageSize, - InputOutputArray cameraMatrix, InputOutputArray distCoeffs, - OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, - OutputArray stdDeviationsIntrinsics, - OutputArray stdDeviationsExtrinsics, - OutputArray perViewErrors, - int flags = 0, TermCriteria criteria = TermCriteria( - TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ); - -/** @overload double calibrateCamera( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints, Size imageSize, - InputOutputArray cameraMatrix, InputOutputArray distCoeffs, - OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, - OutputArray stdDeviations, OutputArray perViewErrors, - int flags = 0, TermCriteria criteria = TermCriteria( - TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ) - */ -CV_EXPORTS_W double calibrateCamera( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints, Size imageSize, - InputOutputArray cameraMatrix, InputOutputArray distCoeffs, - OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, - int flags = 0, TermCriteria criteria = TermCriteria( - TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) ); - -/** @brief Computes useful camera characteristics from the camera matrix. - -@param cameraMatrix Input camera matrix that can be estimated by calibrateCamera or -stereoCalibrate . -@param imageSize Input image size in pixels. -@param apertureWidth Physical width in mm of the sensor. -@param apertureHeight Physical height in mm of the sensor. -@param fovx Output field of view in degrees along the horizontal sensor axis. -@param fovy Output field of view in degrees along the vertical sensor axis. -@param focalLength Focal length of the lens in mm. -@param principalPoint Principal point in mm. -@param aspectRatio \f$f_y/f_x\f$ - -The function computes various useful camera characteristics from the previously estimated camera -matrix. - -@note - Do keep in mind that the unity measure 'mm' stands for whatever unit of measure one chooses for - the chessboard pitch (it can thus be any value). - */ -CV_EXPORTS_W void calibrationMatrixValues( InputArray cameraMatrix, Size imageSize, - double apertureWidth, double apertureHeight, - CV_OUT double& fovx, CV_OUT double& fovy, - CV_OUT double& focalLength, CV_OUT Point2d& principalPoint, - CV_OUT double& aspectRatio ); - -/** @brief Calibrates the stereo camera. - -@param objectPoints Vector of vectors of the calibration pattern points. -@param imagePoints1 Vector of vectors of the projections of the calibration pattern points, -observed by the first camera. -@param imagePoints2 Vector of vectors of the projections of the calibration pattern points, -observed by the second camera. -@param cameraMatrix1 Input/output first camera matrix: -\f$\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\f$ , \f$j = 0,\, 1\f$ . If -any of CALIB_USE_INTRINSIC_GUESS , CALIB_FIX_ASPECT_RATIO , -CALIB_FIX_INTRINSIC , or CALIB_FIX_FOCAL_LENGTH are specified, some or all of the -matrix components must be initialized. See the flags description for details. -@param distCoeffs1 Input/output vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. The output vector length depends on the flags. -@param cameraMatrix2 Input/output second camera matrix. The parameter is similar to cameraMatrix1 -@param distCoeffs2 Input/output lens distortion coefficients for the second camera. The parameter -is similar to distCoeffs1 . -@param imageSize Size of the image used only to initialize intrinsic camera matrix. -@param R Output rotation matrix between the 1st and the 2nd camera coordinate systems. -@param T Output translation vector between the coordinate systems of the cameras. -@param E Output essential matrix. -@param F Output fundamental matrix. -@param perViewErrors Output vector of the RMS re-projection error estimated for each pattern view. -@param flags Different flags that may be zero or a combination of the following values: -- **CALIB_FIX_INTRINSIC** Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F -matrices are estimated. -- **CALIB_USE_INTRINSIC_GUESS** Optimize some or all of the intrinsic parameters -according to the specified flags. Initial values are provided by the user. -- **CALIB_USE_EXTRINSIC_GUESS** R, T contain valid initial values that are optimized further. -Otherwise R, T are initialized to the median value of the pattern views (each dimension separately). -- **CALIB_FIX_PRINCIPAL_POINT** Fix the principal points during the optimization. -- **CALIB_FIX_FOCAL_LENGTH** Fix \f$f^{(j)}_x\f$ and \f$f^{(j)}_y\f$ . -- **CALIB_FIX_ASPECT_RATIO** Optimize \f$f^{(j)}_y\f$ . Fix the ratio \f$f^{(j)}_x/f^{(j)}_y\f$ -. -- **CALIB_SAME_FOCAL_LENGTH** Enforce \f$f^{(0)}_x=f^{(1)}_x\f$ and \f$f^{(0)}_y=f^{(1)}_y\f$ . -- **CALIB_ZERO_TANGENT_DIST** Set tangential distortion coefficients for each camera to -zeros and fix there. -- **CALIB_FIX_K1,...,CALIB_FIX_K6** Do not change the corresponding radial -distortion coefficient during the optimization. If CALIB_USE_INTRINSIC_GUESS is set, -the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0. -- **CALIB_RATIONAL_MODEL** Enable coefficients k4, k5, and k6. To provide the backward -compatibility, this extra flag should be explicitly specified to make the calibration -function use the rational model and return 8 coefficients. If the flag is not set, the -function computes and returns only 5 distortion coefficients. -- **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the -backward compatibility, this extra flag should be explicitly specified to make the -calibration function use the thin prism model and return 12 coefficients. If the flag is not -set, the function computes and returns only 5 distortion coefficients. -- **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during -the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the -supplied distCoeffs matrix is used. Otherwise, it is set to 0. -- **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the -backward compatibility, this extra flag should be explicitly specified to make the -calibration function use the tilted sensor model and return 14 coefficients. If the flag is not -set, the function computes and returns only 5 distortion coefficients. -- **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during -the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the -supplied distCoeffs matrix is used. Otherwise, it is set to 0. -@param criteria Termination criteria for the iterative optimization algorithm. - -The function estimates transformation between two cameras making a stereo pair. If you have a stereo -camera where the relative position and orientation of two cameras is fixed, and if you computed -poses of an object relative to the first camera and to the second camera, (R1, T1) and (R2, T2), -respectively (this can be done with solvePnP ), then those poses definitely relate to each other. -This means that, given ( \f$R_1\f$,\f$T_1\f$ ), it should be possible to compute ( \f$R_2\f$,\f$T_2\f$ ). You only -need to know the position and orientation of the second camera relative to the first camera. This is -what the described function does. It computes ( \f$R\f$,\f$T\f$ ) so that: - -\f[R_2=R*R_1\f] -\f[T_2=R*T_1 + T,\f] - -Optionally, it computes the essential matrix E: - -\f[E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} *R\f] - -where \f$T_i\f$ are components of the translation vector \f$T\f$ : \f$T=[T_0, T_1, T_2]^T\f$ . And the function -can also compute the fundamental matrix F: - -\f[F = cameraMatrix2^{-T} E cameraMatrix1^{-1}\f] - -Besides the stereo-related information, the function can also perform a full calibration of each of -two cameras. However, due to the high dimensionality of the parameter space and noise in the input -data, the function can diverge from the correct solution. If the intrinsic parameters can be -estimated with high accuracy for each of the cameras individually (for example, using -calibrateCamera ), you are recommended to do so and then pass CALIB_FIX_INTRINSIC flag to the -function along with the computed intrinsic parameters. Otherwise, if all the parameters are -estimated at once, it makes sense to restrict some parameters, for example, pass -CALIB_SAME_FOCAL_LENGTH and CALIB_ZERO_TANGENT_DIST flags, which is usually a -reasonable assumption. - -Similarly to calibrateCamera , the function minimizes the total re-projection error for all the -points in all the available views from both cameras. The function returns the final value of the -re-projection error. - */ -CV_EXPORTS_AS(stereoCalibrateExtended) double stereoCalibrate( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, - InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1, - InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2, - Size imageSize, InputOutputArray R,InputOutputArray T, OutputArray E, OutputArray F, - OutputArray perViewErrors, int flags = CALIB_FIX_INTRINSIC, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6) ); - -/// @overload -CV_EXPORTS_W double stereoCalibrate( InputArrayOfArrays objectPoints, - InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, - InputOutputArray cameraMatrix1, InputOutputArray distCoeffs1, - InputOutputArray cameraMatrix2, InputOutputArray distCoeffs2, - Size imageSize, OutputArray R,OutputArray T, OutputArray E, OutputArray F, - int flags = CALIB_FIX_INTRINSIC, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6) ); - -/** @brief Computes rectification transforms for each head of a calibrated stereo camera. - -@param cameraMatrix1 First camera matrix. -@param distCoeffs1 First camera distortion parameters. -@param cameraMatrix2 Second camera matrix. -@param distCoeffs2 Second camera distortion parameters. -@param imageSize Size of the image used for stereo calibration. -@param R Rotation matrix between the coordinate systems of the first and the second cameras. -@param T Translation vector between coordinate systems of the cameras. -@param R1 Output 3x3 rectification transform (rotation matrix) for the first camera. -@param R2 Output 3x3 rectification transform (rotation matrix) for the second camera. -@param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first -camera. -@param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second -camera. -@param Q Output \f$4 \times 4\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ). -@param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set, -the function makes the principal points of each camera have the same pixel coordinates in the -rectified views. And if the flag is not set, the function may still shift the images in the -horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the -useful image area. -@param alpha Free scaling parameter. If it is -1 or absent, the function performs the default -scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified -images are zoomed and shifted so that only valid pixels are visible (no black areas after -rectification). alpha=1 means that the rectified image is decimated and shifted so that all the -pixels from the original images from the cameras are retained in the rectified images (no source -image pixels are lost). Obviously, any intermediate value yields an intermediate result between -those two extreme cases. -@param newImageSize New image resolution after rectification. The same size should be passed to -initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) -is passed (default), it is set to the original imageSize . Setting it to larger value can help you -preserve details in the original image, especially when there is a big radial distortion. -@param validPixROI1 Optional output rectangles inside the rectified images where all the pixels -are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller -(see the picture below). -@param validPixROI2 Optional output rectangles inside the rectified images where all the pixels -are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller -(see the picture below). - -The function computes the rotation matrices for each camera that (virtually) make both camera image -planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies -the dense stereo correspondence problem. The function takes the matrices computed by stereoCalibrate -as input. As output, it provides two rotation matrices and also two projection matrices in the new -coordinates. The function distinguishes the following two cases: - -- **Horizontal stereo**: the first and the second camera views are shifted relative to each other - mainly along the x axis (with possible small vertical shift). In the rectified images, the - corresponding epipolar lines in the left and right cameras are horizontal and have the same - y-coordinate. P1 and P2 look like: - - \f[\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f] - - \f[\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x*f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f] - - where \f$T_x\f$ is a horizontal shift between the cameras and \f$cx_1=cx_2\f$ if - CALIB_ZERO_DISPARITY is set. - -- **Vertical stereo**: the first and the second camera views are shifted relative to each other - mainly in vertical direction (and probably a bit in the horizontal direction too). The epipolar - lines in the rectified images are vertical and have the same x-coordinate. P1 and P2 look like: - - \f[\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}\f] - - \f[\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y*f \\ 0 & 0 & 1 & 0 \end{bmatrix} ,\f] - - where \f$T_y\f$ is a vertical shift between the cameras and \f$cy_1=cy_2\f$ if CALIB_ZERO_DISPARITY is - set. - -As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera -matrices. The matrices, together with R1 and R2 , can then be passed to initUndistortRectifyMap to -initialize the rectification map for each camera. - -See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through -the corresponding image regions. This means that the images are well rectified, which is what most -stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that -their interiors are all valid pixels. - -![image](pics/stereo_undistort.jpg) - */ -CV_EXPORTS_W void stereoRectify( InputArray cameraMatrix1, InputArray distCoeffs1, - InputArray cameraMatrix2, InputArray distCoeffs2, - Size imageSize, InputArray R, InputArray T, - OutputArray R1, OutputArray R2, - OutputArray P1, OutputArray P2, - OutputArray Q, int flags = CALIB_ZERO_DISPARITY, - double alpha = -1, Size newImageSize = Size(), - CV_OUT Rect* validPixROI1 = 0, CV_OUT Rect* validPixROI2 = 0 ); - -/** @brief Computes a rectification transform for an uncalibrated stereo camera. - -@param points1 Array of feature points in the first image. -@param points2 The corresponding points in the second image. The same formats as in -findFundamentalMat are supported. -@param F Input fundamental matrix. It can be computed from the same set of point pairs using -findFundamentalMat . -@param imgSize Size of the image. -@param H1 Output rectification homography matrix for the first image. -@param H2 Output rectification homography matrix for the second image. -@param threshold Optional threshold used to filter out the outliers. If the parameter is greater -than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points -for which \f$|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}\f$ ) are -rejected prior to computing the homographies. Otherwise, all the points are considered inliers. - -The function computes the rectification transformations without knowing intrinsic parameters of the -cameras and their relative position in the space, which explains the suffix "uncalibrated". Another -related difference from stereoRectify is that the function outputs not the rectification -transformations in the object (3D) space, but the planar perspective transformations encoded by the -homography matrices H1 and H2 . The function implements the algorithm @cite Hartley99 . - -@note - While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily - depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion, - it would be better to correct it before computing the fundamental matrix and calling this - function. For example, distortion coefficients can be estimated for each head of stereo camera - separately by using calibrateCamera . Then, the images can be corrected using undistort , or - just the point coordinates can be corrected with undistortPoints . - */ -CV_EXPORTS_W bool stereoRectifyUncalibrated( InputArray points1, InputArray points2, - InputArray F, Size imgSize, - OutputArray H1, OutputArray H2, - double threshold = 5 ); - -//! computes the rectification transformations for 3-head camera, where all the heads are on the same line. -CV_EXPORTS_W float rectify3Collinear( InputArray cameraMatrix1, InputArray distCoeffs1, - InputArray cameraMatrix2, InputArray distCoeffs2, - InputArray cameraMatrix3, InputArray distCoeffs3, - InputArrayOfArrays imgpt1, InputArrayOfArrays imgpt3, - Size imageSize, InputArray R12, InputArray T12, - InputArray R13, InputArray T13, - OutputArray R1, OutputArray R2, OutputArray R3, - OutputArray P1, OutputArray P2, OutputArray P3, - OutputArray Q, double alpha, Size newImgSize, - CV_OUT Rect* roi1, CV_OUT Rect* roi2, int flags ); - -/** @brief Returns the new camera matrix based on the free scaling parameter. - -@param cameraMatrix Input camera matrix. -@param distCoeffs Input vector of distortion coefficients -\f$(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])\f$ of -4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are -assumed. -@param imageSize Original image size. -@param alpha Free scaling parameter between 0 (when all the pixels in the undistorted image are -valid) and 1 (when all the source image pixels are retained in the undistorted image). See -stereoRectify for details. -@param newImgSize Image size after rectification. By default, it is set to imageSize . -@param validPixROI Optional output rectangle that outlines all-good-pixels region in the -undistorted image. See roi1, roi2 description in stereoRectify . -@param centerPrincipalPoint Optional flag that indicates whether in the new camera matrix the -principal point should be at the image center or not. By default, the principal point is chosen to -best fit a subset of the source image (determined by alpha) to the corrected image. -@return new_camera_matrix Output new camera matrix. - -The function computes and returns the optimal new camera matrix based on the free scaling parameter. -By varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original -image pixels if there is valuable information in the corners alpha=1 , or get something in between. -When alpha\>0 , the undistorted result is likely to have some black pixels corresponding to -"virtual" pixels outside of the captured distorted image. The original camera matrix, distortion -coefficients, the computed new camera matrix, and newImageSize should be passed to -initUndistortRectifyMap to produce the maps for remap . - */ -CV_EXPORTS_W Mat getOptimalNewCameraMatrix( InputArray cameraMatrix, InputArray distCoeffs, - Size imageSize, double alpha, Size newImgSize = Size(), - CV_OUT Rect* validPixROI = 0, - bool centerPrincipalPoint = false); - -/** @brief Computes Hand-Eye calibration: \f$_{}^{g}\textrm{T}_c\f$ - -@param[in] R_gripper2base Rotation part extracted from the homogeneous matrix that transforms a point -expressed in the gripper frame to the robot base frame (\f$_{}^{b}\textrm{T}_g\f$). -This is a vector (`vector`) that contains the rotation matrices for all the transformations -from gripper frame to robot base frame. -@param[in] t_gripper2base Translation part extracted from the homogeneous matrix that transforms a point -expressed in the gripper frame to the robot base frame (\f$_{}^{b}\textrm{T}_g\f$). -This is a vector (`vector`) that contains the translation vectors for all the transformations -from gripper frame to robot base frame. -@param[in] R_target2cam Rotation part extracted from the homogeneous matrix that transforms a point -expressed in the target frame to the camera frame (\f$_{}^{c}\textrm{T}_t\f$). -This is a vector (`vector`) that contains the rotation matrices for all the transformations -from calibration target frame to camera frame. -@param[in] t_target2cam Rotation part extracted from the homogeneous matrix that transforms a point -expressed in the target frame to the camera frame (\f$_{}^{c}\textrm{T}_t\f$). -This is a vector (`vector`) that contains the translation vectors for all the transformations -from calibration target frame to camera frame. -@param[out] R_cam2gripper Estimated rotation part extracted from the homogeneous matrix that transforms a point -expressed in the camera frame to the gripper frame (\f$_{}^{g}\textrm{T}_c\f$). -@param[out] t_cam2gripper Estimated translation part extracted from the homogeneous matrix that transforms a point -expressed in the camera frame to the gripper frame (\f$_{}^{g}\textrm{T}_c\f$). -@param[in] method One of the implemented Hand-Eye calibration method, see cv::HandEyeCalibrationMethod - -The function performs the Hand-Eye calibration using various methods. One approach consists in estimating the -rotation then the translation (separable solutions) and the following methods are implemented: - - R. Tsai, R. Lenz A New Technique for Fully Autonomous and Efficient 3D Robotics Hand/EyeCalibration \cite Tsai89 - - F. Park, B. Martin Robot Sensor Calibration: Solving AX = XB on the Euclidean Group \cite Park94 - - R. Horaud, F. Dornaika Hand-Eye Calibration \cite Horaud95 - -Another approach consists in estimating simultaneously the rotation and the translation (simultaneous solutions), -with the following implemented method: - - N. Andreff, R. Horaud, B. Espiau On-line Hand-Eye Calibration \cite Andreff99 - - K. Daniilidis Hand-Eye Calibration Using Dual Quaternions \cite Daniilidis98 - -The following picture describes the Hand-Eye calibration problem where the transformation between a camera ("eye") -mounted on a robot gripper ("hand") has to be estimated. - -![](pics/hand-eye_figure.png) - -The calibration procedure is the following: - - a static calibration pattern is used to estimate the transformation between the target frame - and the camera frame - - the robot gripper is moved in order to acquire several poses - - for each pose, the homogeneous transformation between the gripper frame and the robot base frame is recorded using for - instance the robot kinematics -\f[ - \begin{bmatrix} - X_b\\ - Y_b\\ - Z_b\\ - 1 - \end{bmatrix} - = - \begin{bmatrix} - _{}^{b}\textrm{R}_g & _{}^{b}\textrm{t}_g \\ - 0_{1 \times 3} & 1 - \end{bmatrix} - \begin{bmatrix} - X_g\\ - Y_g\\ - Z_g\\ - 1 - \end{bmatrix} -\f] - - for each pose, the homogeneous transformation between the calibration target frame and the camera frame is recorded using - for instance a pose estimation method (PnP) from 2D-3D point correspondences -\f[ - \begin{bmatrix} - X_c\\ - Y_c\\ - Z_c\\ - 1 - \end{bmatrix} - = - \begin{bmatrix} - _{}^{c}\textrm{R}_t & _{}^{c}\textrm{t}_t \\ - 0_{1 \times 3} & 1 - \end{bmatrix} - \begin{bmatrix} - X_t\\ - Y_t\\ - Z_t\\ - 1 - \end{bmatrix} -\f] - -The Hand-Eye calibration procedure returns the following homogeneous transformation -\f[ - \begin{bmatrix} - X_g\\ - Y_g\\ - Z_g\\ - 1 - \end{bmatrix} - = - \begin{bmatrix} - _{}^{g}\textrm{R}_c & _{}^{g}\textrm{t}_c \\ - 0_{1 \times 3} & 1 - \end{bmatrix} - \begin{bmatrix} - X_c\\ - Y_c\\ - Z_c\\ - 1 - \end{bmatrix} -\f] - -This problem is also known as solving the \f$\mathbf{A}\mathbf{X}=\mathbf{X}\mathbf{B}\f$ equation: -\f[ - \begin{align*} - ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(1)} &= - \hspace{0.1em} ^{b}{\textrm{T}_g}^{(2)} \hspace{0.2em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} \\ - - (^{b}{\textrm{T}_g}^{(2)})^{-1} \hspace{0.2em} ^{b}{\textrm{T}_g}^{(1)} \hspace{0.2em} ^{g}\textrm{T}_c &= - \hspace{0.1em} ^{g}\textrm{T}_c \hspace{0.2em} ^{c}{\textrm{T}_t}^{(2)} (^{c}{\textrm{T}_t}^{(1)})^{-1} \\ - - \textrm{A}_i \textrm{X} &= \textrm{X} \textrm{B}_i \\ - \end{align*} -\f] - -\note -Additional information can be found on this [website](http://campar.in.tum.de/Chair/HandEyeCalibration). -\note -A minimum of 2 motions with non parallel rotation axes are necessary to determine the hand-eye transformation. -So at least 3 different poses are required, but it is strongly recommended to use many more poses. - - */ -CV_EXPORTS_W void calibrateHandEye( InputArrayOfArrays R_gripper2base, InputArrayOfArrays t_gripper2base, - InputArrayOfArrays R_target2cam, InputArrayOfArrays t_target2cam, - OutputArray R_cam2gripper, OutputArray t_cam2gripper, - HandEyeCalibrationMethod method=CALIB_HAND_EYE_TSAI ); - -/** @brief Converts points from Euclidean to homogeneous space. - -@param src Input vector of N-dimensional points. -@param dst Output vector of N+1-dimensional points. - -The function converts points from Euclidean to homogeneous space by appending 1's to the tuple of -point coordinates. That is, each point (x1, x2, ..., xn) is converted to (x1, x2, ..., xn, 1). - */ -CV_EXPORTS_W void convertPointsToHomogeneous( InputArray src, OutputArray dst ); - -/** @brief Converts points from homogeneous to Euclidean space. - -@param src Input vector of N-dimensional points. -@param dst Output vector of N-1-dimensional points. - -The function converts points homogeneous to Euclidean space using perspective projection. That is, -each point (x1, x2, ... x(n-1), xn) is converted to (x1/xn, x2/xn, ..., x(n-1)/xn). When xn=0, the -output point coordinates will be (0,0,0,...). - */ -CV_EXPORTS_W void convertPointsFromHomogeneous( InputArray src, OutputArray dst ); - -/** @brief Converts points to/from homogeneous coordinates. - -@param src Input array or vector of 2D, 3D, or 4D points. -@param dst Output vector of 2D, 3D, or 4D points. - -The function converts 2D or 3D points from/to homogeneous coordinates by calling either -convertPointsToHomogeneous or convertPointsFromHomogeneous. - -@note The function is obsolete. Use one of the previous two functions instead. - */ -CV_EXPORTS void convertPointsHomogeneous( InputArray src, OutputArray dst ); - -/** @brief Calculates a fundamental matrix from the corresponding points in two images. - -@param points1 Array of N points from the first image. The point coordinates should be -floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1 . -@param method Method for computing a fundamental matrix. -- **CV_FM_7POINT** for a 7-point algorithm. \f$N = 7\f$ -- **CV_FM_8POINT** for an 8-point algorithm. \f$N \ge 8\f$ -- **CV_FM_RANSAC** for the RANSAC algorithm. \f$N \ge 8\f$ -- **CV_FM_LMEDS** for the LMedS algorithm. \f$N \ge 8\f$ -@param ransacReprojThreshold Parameter used only for RANSAC. It is the maximum distance from a point to an epipolar -line in pixels, beyond which the point is considered an outlier and is not used for computing the -final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the -point localization, image resolution, and the image noise. -@param confidence Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level -of confidence (probability) that the estimated matrix is correct. -@param mask - -The epipolar geometry is described by the following equation: - -\f[[p_2; 1]^T F [p_1; 1] = 0\f] - -where \f$F\f$ is a fundamental matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the -second images, respectively. - -The function calculates the fundamental matrix using one of four methods listed above and returns -the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point -algorithm, the function may return up to 3 solutions ( \f$9 \times 3\f$ matrix that stores all 3 -matrices sequentially). - -The calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the -epipolar lines corresponding to the specified points. It can also be passed to -stereoRectifyUncalibrated to compute the rectification transformation. : -@code - // Example. Estimation of fundamental matrix using the RANSAC algorithm - int point_count = 100; - vector points1(point_count); - vector points2(point_count); - - // initialize the points here ... - for( int i = 0; i < point_count; i++ ) - { - points1[i] = ...; - points2[i] = ...; - } - - Mat fundamental_matrix = - findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99); -@endcode - */ -CV_EXPORTS_W Mat findFundamentalMat( InputArray points1, InputArray points2, - int method = FM_RANSAC, - double ransacReprojThreshold = 3., double confidence = 0.99, - OutputArray mask = noArray() ); - -/** @overload */ -CV_EXPORTS Mat findFundamentalMat( InputArray points1, InputArray points2, - OutputArray mask, int method = FM_RANSAC, - double ransacReprojThreshold = 3., double confidence = 0.99 ); - -/** @brief Calculates an essential matrix from the corresponding points in two images. - -@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should -be floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1 . -@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . -Note that this function assumes that points1 and points2 are feature points from cameras with the -same camera matrix. -@param method Method for computing an essential matrix. -- **RANSAC** for the RANSAC algorithm. -- **LMEDS** for the LMedS algorithm. -@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of -confidence (probability) that the estimated matrix is correct. -@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar -line in pixels, beyond which the point is considered an outlier and is not used for computing the -final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the -point localization, image resolution, and the image noise. -@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 -for the other points. The array is computed only in the RANSAC and LMedS methods. - -This function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 . -@cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation: - -\f[[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0\f] - -where \f$E\f$ is an essential matrix, \f$p_1\f$ and \f$p_2\f$ are corresponding points in the first and the -second images, respectively. The result of this function may be passed further to -decomposeEssentialMat or recoverPose to recover the relative pose between cameras. - */ -CV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2, - InputArray cameraMatrix, int method = RANSAC, - double prob = 0.999, double threshold = 1.0, - OutputArray mask = noArray() ); - -/** @overload -@param points1 Array of N (N \>= 5) 2D points from the first image. The point coordinates should -be floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1 . -@param focal focal length of the camera. Note that this function assumes that points1 and points2 -are feature points from cameras with same focal length and principal point. -@param pp principal point of the camera. -@param method Method for computing a fundamental matrix. -- **RANSAC** for the RANSAC algorithm. -- **LMEDS** for the LMedS algorithm. -@param threshold Parameter used for RANSAC. It is the maximum distance from a point to an epipolar -line in pixels, beyond which the point is considered an outlier and is not used for computing the -final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the -point localization, image resolution, and the image noise. -@param prob Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of -confidence (probability) that the estimated matrix is correct. -@param mask Output array of N elements, every element of which is set to 0 for outliers and to 1 -for the other points. The array is computed only in the RANSAC and LMedS methods. - -This function differs from the one above that it computes camera matrix from focal length and -principal point: - -\f[K = -\begin{bmatrix} -f & 0 & x_{pp} \\ -0 & f & y_{pp} \\ -0 & 0 & 1 -\end{bmatrix}\f] - */ -CV_EXPORTS_W Mat findEssentialMat( InputArray points1, InputArray points2, - double focal = 1.0, Point2d pp = Point2d(0, 0), - int method = RANSAC, double prob = 0.999, - double threshold = 1.0, OutputArray mask = noArray() ); - -/** @brief Decompose an essential matrix to possible rotations and translation. - -@param E The input essential matrix. -@param R1 One possible rotation matrix. -@param R2 Another possible rotation matrix. -@param t One possible translation. - -This function decompose an essential matrix E using svd decomposition @cite HartleyZ00 . Generally 4 -possible poses exists for a given E. They are \f$[R_1, t]\f$, \f$[R_1, -t]\f$, \f$[R_2, t]\f$, \f$[R_2, -t]\f$. By -decomposing E, you can only get the direction of the translation, so the function returns unit t. - */ -CV_EXPORTS_W void decomposeEssentialMat( InputArray E, OutputArray R1, OutputArray R2, OutputArray t ); - -/** @brief Recover relative camera rotation and translation from an estimated essential matrix and the -corresponding points in two images, using cheirality check. Returns the number of inliers which pass -the check. - -@param E The input essential matrix. -@param points1 Array of N 2D points from the first image. The point coordinates should be -floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1 . -@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . -Note that this function assumes that points1 and points2 are feature points from cameras with the -same camera matrix. -@param R Recovered relative rotation. -@param t Recovered relative translation. -@param mask Input/output mask for inliers in points1 and points2. -: If it is not empty, then it marks inliers in points1 and points2 for then given essential -matrix E. Only these inliers will be used to recover pose. In the output mask only inliers -which pass the cheirality check. -This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible -pose hypotheses by doing cheirality check. The cheirality check basically means that the -triangulated 3D points should have positive depth. Some details can be found in @cite Nister03 . - -This function can be used to process output E and mask from findEssentialMat. In this scenario, -points1 and points2 are the same input for findEssentialMat. : -@code - // Example. Estimation of fundamental matrix using the RANSAC algorithm - int point_count = 100; - vector points1(point_count); - vector points2(point_count); - - // initialize the points here ... - for( int i = 0; i < point_count; i++ ) - { - points1[i] = ...; - points2[i] = ...; - } - - // cametra matrix with both focal lengths = 1, and principal point = (0, 0) - Mat cameraMatrix = Mat::eye(3, 3, CV_64F); - - Mat E, R, t, mask; - - E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask); - recoverPose(E, points1, points2, cameraMatrix, R, t, mask); -@endcode - */ -CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2, - InputArray cameraMatrix, OutputArray R, OutputArray t, - InputOutputArray mask = noArray() ); - -/** @overload -@param E The input essential matrix. -@param points1 Array of N 2D points from the first image. The point coordinates should be -floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1 . -@param R Recovered relative rotation. -@param t Recovered relative translation. -@param focal Focal length of the camera. Note that this function assumes that points1 and points2 -are feature points from cameras with same focal length and principal point. -@param pp principal point of the camera. -@param mask Input/output mask for inliers in points1 and points2. -: If it is not empty, then it marks inliers in points1 and points2 for then given essential -matrix E. Only these inliers will be used to recover pose. In the output mask only inliers -which pass the cheirality check. - -This function differs from the one above that it computes camera matrix from focal length and -principal point: - -\f[K = -\begin{bmatrix} -f & 0 & x_{pp} \\ -0 & f & y_{pp} \\ -0 & 0 & 1 -\end{bmatrix}\f] - */ -CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2, - OutputArray R, OutputArray t, - double focal = 1.0, Point2d pp = Point2d(0, 0), - InputOutputArray mask = noArray() ); - -/** @overload -@param E The input essential matrix. -@param points1 Array of N 2D points from the first image. The point coordinates should be -floating-point (single or double precision). -@param points2 Array of the second image points of the same size and format as points1. -@param cameraMatrix Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . -Note that this function assumes that points1 and points2 are feature points from cameras with the -same camera matrix. -@param R Recovered relative rotation. -@param t Recovered relative translation. -@param distanceThresh threshold distance which is used to filter out far away points (i.e. infinite points). -@param mask Input/output mask for inliers in points1 and points2. -: If it is not empty, then it marks inliers in points1 and points2 for then given essential -matrix E. Only these inliers will be used to recover pose. In the output mask only inliers -which pass the cheirality check. -@param triangulatedPoints 3d points which were reconstructed by triangulation. - */ - -CV_EXPORTS_W int recoverPose( InputArray E, InputArray points1, InputArray points2, - InputArray cameraMatrix, OutputArray R, OutputArray t, double distanceThresh, InputOutputArray mask = noArray(), - OutputArray triangulatedPoints = noArray()); - -/** @brief For points in an image of a stereo pair, computes the corresponding epilines in the other image. - -@param points Input points. \f$N \times 1\f$ or \f$1 \times N\f$ matrix of type CV_32FC2 or -vector\ . -@param whichImage Index of the image (1 or 2) that contains the points . -@param F Fundamental matrix that can be estimated using findFundamentalMat or stereoRectify . -@param lines Output vector of the epipolar lines corresponding to the points in the other image. -Each line \f$ax + by + c=0\f$ is encoded by 3 numbers \f$(a, b, c)\f$ . - -For every point in one of the two images of a stereo pair, the function finds the equation of the -corresponding epipolar line in the other image. - -From the fundamental matrix definition (see findFundamentalMat ), line \f$l^{(2)}_i\f$ in the second -image for the point \f$p^{(1)}_i\f$ in the first image (when whichImage=1 ) is computed as: - -\f[l^{(2)}_i = F p^{(1)}_i\f] - -And vice versa, when whichImage=2, \f$l^{(1)}_i\f$ is computed from \f$p^{(2)}_i\f$ as: - -\f[l^{(1)}_i = F^T p^{(2)}_i\f] - -Line coefficients are defined up to a scale. They are normalized so that \f$a_i^2+b_i^2=1\f$ . - */ -CV_EXPORTS_W void computeCorrespondEpilines( InputArray points, int whichImage, - InputArray F, OutputArray lines ); - -/** @brief Reconstructs points by triangulation. - -@param projMatr1 3x4 projection matrix of the first camera. -@param projMatr2 3x4 projection matrix of the second camera. -@param projPoints1 2xN array of feature points in the first image. In case of c++ version it can -be also a vector of feature points or two-channel matrix of size 1xN or Nx1. -@param projPoints2 2xN array of corresponding points in the second image. In case of c++ version -it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1. -@param points4D 4xN array of reconstructed points in homogeneous coordinates. - -The function reconstructs 3-dimensional points (in homogeneous coordinates) by using their -observations with a stereo camera. Projections matrices can be obtained from stereoRectify. - -@note - Keep in mind that all input data should be of float type in order for this function to work. - -@sa - reprojectImageTo3D - */ -CV_EXPORTS_W void triangulatePoints( InputArray projMatr1, InputArray projMatr2, - InputArray projPoints1, InputArray projPoints2, - OutputArray points4D ); - -/** @brief Refines coordinates of corresponding points. - -@param F 3x3 fundamental matrix. -@param points1 1xN array containing the first set of points. -@param points2 1xN array containing the second set of points. -@param newPoints1 The optimized points1. -@param newPoints2 The optimized points2. - -The function implements the Optimal Triangulation Method (see Multiple View Geometry for details). -For each given point correspondence points1[i] \<-\> points2[i], and a fundamental matrix F, it -computes the corrected correspondences newPoints1[i] \<-\> newPoints2[i] that minimize the geometric -error \f$d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2\f$ (where \f$d(a,b)\f$ is the -geometric distance between points \f$a\f$ and \f$b\f$ ) subject to the epipolar constraint -\f$newPoints2^T * F * newPoints1 = 0\f$ . - */ -CV_EXPORTS_W void correctMatches( InputArray F, InputArray points1, InputArray points2, - OutputArray newPoints1, OutputArray newPoints2 ); - -/** @brief Filters off small noise blobs (speckles) in the disparity map - -@param img The input 16-bit signed disparity image -@param newVal The disparity value used to paint-off the speckles -@param maxSpeckleSize The maximum speckle size to consider it a speckle. Larger blobs are not -affected by the algorithm -@param maxDiff Maximum difference between neighbor disparity pixels to put them into the same -blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point -disparity map, where disparity values are multiplied by 16, this scale factor should be taken into -account when specifying this parameter value. -@param buf The optional temporary buffer to avoid memory allocation within the function. - */ -CV_EXPORTS_W void filterSpeckles( InputOutputArray img, double newVal, - int maxSpeckleSize, double maxDiff, - InputOutputArray buf = noArray() ); - -//! computes valid disparity ROI from the valid ROIs of the rectified images (that are returned by cv::stereoRectify()) -CV_EXPORTS_W Rect getValidDisparityROI( Rect roi1, Rect roi2, - int minDisparity, int numberOfDisparities, - int SADWindowSize ); - -//! validates disparity using the left-right check. The matrix "cost" should be computed by the stereo correspondence algorithm -CV_EXPORTS_W void validateDisparity( InputOutputArray disparity, InputArray cost, - int minDisparity, int numberOfDisparities, - int disp12MaxDisp = 1 ); - -/** @brief Reprojects a disparity image to 3D space. - -@param disparity Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit -floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no -fractional bits. -@param _3dImage Output 3-channel floating-point image of the same size as disparity . Each -element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity -map. -@param Q \f$4 \times 4\f$ perspective transformation matrix that can be obtained with stereoRectify. -@param handleMissingValues Indicates, whether the function should handle missing values (i.e. -points where the disparity was not computed). If handleMissingValues=true, then pixels with the -minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed -to 3D points with a very large Z value (currently set to 10000). -@param ddepth The optional output array depth. If it is -1, the output image will have CV_32F -depth. ddepth can also be set to CV_16S, CV_32S or CV_32F. - -The function transforms a single-channel disparity map to a 3-channel image representing a 3D -surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it -computes: - -\f[\begin{array}{l} [X \; Y \; Z \; W]^T = \texttt{Q} *[x \; y \; \texttt{disparity} (x,y) \; 1]^T \\ \texttt{\_3dImage} (x,y) = (X/W, \; Y/W, \; Z/W) \end{array}\f] - -The matrix Q can be an arbitrary \f$4 \times 4\f$ matrix (for example, the one computed by -stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use -perspectiveTransform . - */ -CV_EXPORTS_W void reprojectImageTo3D( InputArray disparity, - OutputArray _3dImage, InputArray Q, - bool handleMissingValues = false, - int ddepth = -1 ); - -/** @brief Calculates the Sampson Distance between two points. - -The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as: -\f[ -sd( \texttt{pt1} , \texttt{pt2} )= -\frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2} -{((\texttt{F} \cdot \texttt{pt1})(0))^2 + -((\texttt{F} \cdot \texttt{pt1})(1))^2 + -((\texttt{F}^t \cdot \texttt{pt2})(0))^2 + -((\texttt{F}^t \cdot \texttt{pt2})(1))^2} -\f] -The fundamental matrix may be calculated using the cv::findFundamentalMat function. See @cite HartleyZ00 11.4.3 for details. -@param pt1 first homogeneous 2d point -@param pt2 second homogeneous 2d point -@param F fundamental matrix -@return The computed Sampson distance. -*/ -CV_EXPORTS_W double sampsonDistance(InputArray pt1, InputArray pt2, InputArray F); - -/** @brief Computes an optimal affine transformation between two 3D point sets. - -It computes -\f[ -\begin{bmatrix} -x\\ -y\\ -z\\ -\end{bmatrix} -= -\begin{bmatrix} -a_{11} & a_{12} & a_{13}\\ -a_{21} & a_{22} & a_{23}\\ -a_{31} & a_{32} & a_{33}\\ -\end{bmatrix} -\begin{bmatrix} -X\\ -Y\\ -Z\\ -\end{bmatrix} -+ -\begin{bmatrix} -b_1\\ -b_2\\ -b_3\\ -\end{bmatrix} -\f] - -@param src First input 3D point set containing \f$(X,Y,Z)\f$. -@param dst Second input 3D point set containing \f$(x,y,z)\f$. -@param out Output 3D affine transformation matrix \f$3 \times 4\f$ of the form -\f[ -\begin{bmatrix} -a_{11} & a_{12} & a_{13} & b_1\\ -a_{21} & a_{22} & a_{23} & b_2\\ -a_{31} & a_{32} & a_{33} & b_3\\ -\end{bmatrix} -\f] -@param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier). -@param ransacThreshold Maximum reprojection error in the RANSAC algorithm to consider a point as -an inlier. -@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything -between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation -significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. - -The function estimates an optimal 3D affine transformation between two 3D point sets using the -RANSAC algorithm. - */ -CV_EXPORTS_W int estimateAffine3D(InputArray src, InputArray dst, - OutputArray out, OutputArray inliers, - double ransacThreshold = 3, double confidence = 0.99); - -/** @brief Computes an optimal affine transformation between two 2D point sets. - -It computes -\f[ -\begin{bmatrix} -x\\ -y\\ -\end{bmatrix} -= -\begin{bmatrix} -a_{11} & a_{12}\\ -a_{21} & a_{22}\\ -\end{bmatrix} -\begin{bmatrix} -X\\ -Y\\ -\end{bmatrix} -+ -\begin{bmatrix} -b_1\\ -b_2\\ -\end{bmatrix} -\f] - -@param from First input 2D point set containing \f$(X,Y)\f$. -@param to Second input 2D point set containing \f$(x,y)\f$. -@param inliers Output vector indicating which points are inliers (1-inlier, 0-outlier). -@param method Robust method used to compute transformation. The following methods are possible: -- cv::RANSAC - RANSAC-based robust method -- cv::LMEDS - Least-Median robust method -RANSAC is the default method. -@param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider -a point as an inlier. Applies only to RANSAC. -@param maxIters The maximum number of robust method iterations. -@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything -between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation -significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. -@param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt). -Passing 0 will disable refining, so the output matrix will be output of robust method. - -@return Output 2D affine transformation matrix \f$2 \times 3\f$ or empty matrix if transformation -could not be estimated. The returned matrix has the following form: -\f[ -\begin{bmatrix} -a_{11} & a_{12} & b_1\\ -a_{21} & a_{22} & b_2\\ -\end{bmatrix} -\f] - -The function estimates an optimal 2D affine transformation between two 2D point sets using the -selected robust algorithm. - -The computed transformation is then refined further (using only inliers) with the -Levenberg-Marquardt method to reduce the re-projection error even more. - -@note -The RANSAC method can handle practically any ratio of outliers but needs a threshold to -distinguish inliers from outliers. The method LMeDS does not need any threshold but it works -correctly only when there are more than 50% of inliers. - -@sa estimateAffinePartial2D, getAffineTransform -*/ -CV_EXPORTS_W cv::Mat estimateAffine2D(InputArray from, InputArray to, OutputArray inliers = noArray(), - int method = RANSAC, double ransacReprojThreshold = 3, - size_t maxIters = 2000, double confidence = 0.99, - size_t refineIters = 10); - -/** @brief Computes an optimal limited affine transformation with 4 degrees of freedom between -two 2D point sets. - -@param from First input 2D point set. -@param to Second input 2D point set. -@param inliers Output vector indicating which points are inliers. -@param method Robust method used to compute transformation. The following methods are possible: -- cv::RANSAC - RANSAC-based robust method -- cv::LMEDS - Least-Median robust method -RANSAC is the default method. -@param ransacReprojThreshold Maximum reprojection error in the RANSAC algorithm to consider -a point as an inlier. Applies only to RANSAC. -@param maxIters The maximum number of robust method iterations. -@param confidence Confidence level, between 0 and 1, for the estimated transformation. Anything -between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation -significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation. -@param refineIters Maximum number of iterations of refining algorithm (Levenberg-Marquardt). -Passing 0 will disable refining, so the output matrix will be output of robust method. - -@return Output 2D affine transformation (4 degrees of freedom) matrix \f$2 \times 3\f$ or -empty matrix if transformation could not be estimated. - -The function estimates an optimal 2D affine transformation with 4 degrees of freedom limited to -combinations of translation, rotation, and uniform scaling. Uses the selected algorithm for robust -estimation. - -The computed transformation is then refined further (using only inliers) with the -Levenberg-Marquardt method to reduce the re-projection error even more. - -Estimated transformation matrix is: -\f[ \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\ - \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y -\end{bmatrix} \f] -Where \f$ \theta \f$ is the rotation angle, \f$ s \f$ the scaling factor and \f$ t_x, t_y \f$ are -translations in \f$ x, y \f$ axes respectively. - -@note -The RANSAC method can handle practically any ratio of outliers but need a threshold to -distinguish inliers from outliers. The method LMeDS does not need any threshold but it works -correctly only when there are more than 50% of inliers. - -@sa estimateAffine2D, getAffineTransform -*/ -CV_EXPORTS_W cv::Mat estimateAffinePartial2D(InputArray from, InputArray to, OutputArray inliers = noArray(), - int method = RANSAC, double ransacReprojThreshold = 3, - size_t maxIters = 2000, double confidence = 0.99, - size_t refineIters = 10); - -/** @example samples/cpp/tutorial_code/features2D/Homography/decompose_homography.cpp -An example program with homography decomposition. - -Check @ref tutorial_homography "the corresponding tutorial" for more details. -*/ - -/** @brief Decompose a homography matrix to rotation(s), translation(s) and plane normal(s). - -@param H The input homography matrix between two images. -@param K The input intrinsic camera calibration matrix. -@param rotations Array of rotation matrices. -@param translations Array of translation matrices. -@param normals Array of plane normal matrices. - -This function extracts relative camera motion between two views observing a planar object from the -homography H induced by the plane. The intrinsic camera matrix K must also be provided. The function -may return up to four mathematical solution sets. At least two of the solutions may further be -invalidated if point correspondences are available by applying positive depth constraint (all points -must be in front of the camera). The decomposition method is described in detail in @cite Malis . - */ -CV_EXPORTS_W int decomposeHomographyMat(InputArray H, - InputArray K, - OutputArrayOfArrays rotations, - OutputArrayOfArrays translations, - OutputArrayOfArrays normals); - -/** @brief Filters homography decompositions based on additional information. - -@param rotations Vector of rotation matrices. -@param normals Vector of plane normal matrices. -@param beforePoints Vector of (rectified) visible reference points before the homography is applied -@param afterPoints Vector of (rectified) visible reference points after the homography is applied -@param possibleSolutions Vector of int indices representing the viable solution set after filtering -@param pointsMask optional Mat/Vector of 8u type representing the mask for the inliers as given by the findHomography function - -This function is intended to filter the output of the decomposeHomographyMat based on additional -information as described in @cite Malis . The summary of the method: the decomposeHomographyMat function -returns 2 unique solutions and their "opposites" for a total of 4 solutions. If we have access to the -sets of points visible in the camera frame before and after the homography transformation is applied, -we can determine which are the true potential solutions and which are the opposites by verifying which -homographies are consistent with all visible reference points being in front of the camera. The inputs -are left unchanged; the filtered solution set is returned as indices into the existing one. - -*/ -CV_EXPORTS_W void filterHomographyDecompByVisibleRefpoints(InputArrayOfArrays rotations, - InputArrayOfArrays normals, - InputArray beforePoints, - InputArray afterPoints, - OutputArray possibleSolutions, - InputArray pointsMask = noArray()); - -/** @brief The base class for stereo correspondence algorithms. - */ -class CV_EXPORTS_W StereoMatcher : public Algorithm -{ -public: - enum { DISP_SHIFT = 4, - DISP_SCALE = (1 << DISP_SHIFT) - }; - - /** @brief Computes disparity map for the specified stereo pair - - @param left Left 8-bit single-channel image. - @param right Right image of the same size and the same type as the left one. - @param disparity Output disparity map. It has the same size as the input images. Some algorithms, - like StereoBM or StereoSGBM compute 16-bit fixed-point disparity map (where each disparity value - has 4 fractional bits), whereas other algorithms output 32-bit floating-point disparity map. - */ - CV_WRAP virtual void compute( InputArray left, InputArray right, - OutputArray disparity ) = 0; - - CV_WRAP virtual int getMinDisparity() const = 0; - CV_WRAP virtual void setMinDisparity(int minDisparity) = 0; - - CV_WRAP virtual int getNumDisparities() const = 0; - CV_WRAP virtual void setNumDisparities(int numDisparities) = 0; - - CV_WRAP virtual int getBlockSize() const = 0; - CV_WRAP virtual void setBlockSize(int blockSize) = 0; - - CV_WRAP virtual int getSpeckleWindowSize() const = 0; - CV_WRAP virtual void setSpeckleWindowSize(int speckleWindowSize) = 0; - - CV_WRAP virtual int getSpeckleRange() const = 0; - CV_WRAP virtual void setSpeckleRange(int speckleRange) = 0; - - CV_WRAP virtual int getDisp12MaxDiff() const = 0; - CV_WRAP virtual void setDisp12MaxDiff(int disp12MaxDiff) = 0; -}; - - -/** @brief Class for computing stereo correspondence using the block matching algorithm, introduced and -contributed to OpenCV by K. Konolige. - */ -class CV_EXPORTS_W StereoBM : public StereoMatcher -{ -public: - enum { PREFILTER_NORMALIZED_RESPONSE = 0, - PREFILTER_XSOBEL = 1 - }; - - CV_WRAP virtual int getPreFilterType() const = 0; - CV_WRAP virtual void setPreFilterType(int preFilterType) = 0; - - CV_WRAP virtual int getPreFilterSize() const = 0; - CV_WRAP virtual void setPreFilterSize(int preFilterSize) = 0; - - CV_WRAP virtual int getPreFilterCap() const = 0; - CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0; - - CV_WRAP virtual int getTextureThreshold() const = 0; - CV_WRAP virtual void setTextureThreshold(int textureThreshold) = 0; - - CV_WRAP virtual int getUniquenessRatio() const = 0; - CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0; - - CV_WRAP virtual int getSmallerBlockSize() const = 0; - CV_WRAP virtual void setSmallerBlockSize(int blockSize) = 0; - - CV_WRAP virtual Rect getROI1() const = 0; - CV_WRAP virtual void setROI1(Rect roi1) = 0; - - CV_WRAP virtual Rect getROI2() const = 0; - CV_WRAP virtual void setROI2(Rect roi2) = 0; - - /** @brief Creates StereoBM object - - @param numDisparities the disparity search range. For each pixel algorithm will find the best - disparity from 0 (default minimum disparity) to numDisparities. The search range can then be - shifted by changing the minimum disparity. - @param blockSize the linear size of the blocks compared by the algorithm. The size should be odd - (as the block is centered at the current pixel). Larger block size implies smoother, though less - accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher - chance for algorithm to find a wrong correspondence. - - The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for - a specific stereo pair. - */ - CV_WRAP static Ptr create(int numDisparities = 0, int blockSize = 21); -}; - -/** @brief The class implements the modified H. Hirschmuller algorithm @cite HH08 that differs from the original -one as follows: - -- By default, the algorithm is single-pass, which means that you consider only 5 directions -instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the -algorithm but beware that it may consume a lot of memory. -- The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the -blocks to single pixels. -- Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi -sub-pixel metric from @cite BT98 is used. Though, the color images are supported as well. -- Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for -example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness -check, quadratic interpolation and speckle filtering). - -@note - - (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found - at opencv_source_code/samples/python/stereo_match.py - */ -class CV_EXPORTS_W StereoSGBM : public StereoMatcher -{ -public: - enum - { - MODE_SGBM = 0, - MODE_HH = 1, - MODE_SGBM_3WAY = 2, - MODE_HH4 = 3 - }; - - CV_WRAP virtual int getPreFilterCap() const = 0; - CV_WRAP virtual void setPreFilterCap(int preFilterCap) = 0; - - CV_WRAP virtual int getUniquenessRatio() const = 0; - CV_WRAP virtual void setUniquenessRatio(int uniquenessRatio) = 0; - - CV_WRAP virtual int getP1() const = 0; - CV_WRAP virtual void setP1(int P1) = 0; - - CV_WRAP virtual int getP2() const = 0; - CV_WRAP virtual void setP2(int P2) = 0; - - CV_WRAP virtual int getMode() const = 0; - CV_WRAP virtual void setMode(int mode) = 0; - - /** @brief Creates StereoSGBM object - - @param minDisparity Minimum possible disparity value. Normally, it is zero but sometimes - rectification algorithms can shift images, so this parameter needs to be adjusted accordingly. - @param numDisparities Maximum disparity minus minimum disparity. The value is always greater than - zero. In the current implementation, this parameter must be divisible by 16. - @param blockSize Matched block size. It must be an odd number \>=1 . Normally, it should be - somewhere in the 3..11 range. - @param P1 The first parameter controlling the disparity smoothness. See below. - @param P2 The second parameter controlling the disparity smoothness. The larger the values are, - the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1 - between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor - pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good - P1 and P2 values are shown (like 8\*number_of_image_channels\*SADWindowSize\*SADWindowSize and - 32\*number_of_image_channels\*SADWindowSize\*SADWindowSize , respectively). - @param disp12MaxDiff Maximum allowed difference (in integer pixel units) in the left-right - disparity check. Set it to a non-positive value to disable the check. - @param preFilterCap Truncation value for the prefiltered image pixels. The algorithm first - computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval. - The result values are passed to the Birchfield-Tomasi pixel cost function. - @param uniquenessRatio Margin in percentage by which the best (minimum) computed cost function - value should "win" the second best value to consider the found match correct. Normally, a value - within the 5-15 range is good enough. - @param speckleWindowSize Maximum size of smooth disparity regions to consider their noise speckles - and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the - 50-200 range. - @param speckleRange Maximum disparity variation within each connected component. If you do speckle - filtering, set the parameter to a positive value, it will be implicitly multiplied by 16. - Normally, 1 or 2 is good enough. - @param mode Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming - algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and - huge for HD-size pictures. By default, it is set to false . - - The first constructor initializes StereoSGBM with all the default parameters. So, you only have to - set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter - to a custom value. - */ - CV_WRAP static Ptr create(int minDisparity = 0, int numDisparities = 16, int blockSize = 3, - int P1 = 0, int P2 = 0, int disp12MaxDiff = 0, - int preFilterCap = 0, int uniquenessRatio = 0, - int speckleWindowSize = 0, int speckleRange = 0, - int mode = StereoSGBM::MODE_SGBM); -}; - -//! @} calib3d - -/** @brief The methods in this namespace use a so-called fisheye camera model. - @ingroup calib3d_fisheye -*/ -namespace fisheye -{ -//! @addtogroup calib3d_fisheye -//! @{ - - enum{ - CALIB_USE_INTRINSIC_GUESS = 1 << 0, - CALIB_RECOMPUTE_EXTRINSIC = 1 << 1, - CALIB_CHECK_COND = 1 << 2, - CALIB_FIX_SKEW = 1 << 3, - CALIB_FIX_K1 = 1 << 4, - CALIB_FIX_K2 = 1 << 5, - CALIB_FIX_K3 = 1 << 6, - CALIB_FIX_K4 = 1 << 7, - CALIB_FIX_INTRINSIC = 1 << 8, - CALIB_FIX_PRINCIPAL_POINT = 1 << 9 - }; - - /** @brief Projects points using fisheye model - - @param objectPoints Array of object points, 1xN/Nx1 3-channel (or vector\ ), where N is - the number of points in the view. - @param imagePoints Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or - vector\. - @param affine - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param alpha The skew coefficient. - @param jacobian Optional output 2Nx15 jacobian matrix of derivatives of image points with respect - to components of the focal lengths, coordinates of the principal point, distortion coefficients, - rotation vector, translation vector, and the skew. In the old interface different components of - the jacobian are returned via different output parameters. - - The function computes projections of 3D points to the image plane given intrinsic and extrinsic - camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of - image points coordinates (as functions of all the input parameters) with respect to the particular - parameters, intrinsic and/or extrinsic. - */ - CV_EXPORTS void projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine, - InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); - - /** @overload */ - CV_EXPORTS_W void projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray rvec, InputArray tvec, - InputArray K, InputArray D, double alpha = 0, OutputArray jacobian = noArray()); - - /** @brief Distorts 2D points using fisheye model. - - @param undistorted Array of object points, 1xN/Nx1 2-channel (or vector\ ), where N is - the number of points in the view. - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param alpha The skew coefficient. - @param distorted Output array of image points, 1xN/Nx1 2-channel, or vector\ . - - Note that the function assumes the camera matrix of the undistorted points to be identity. - This means if you want to transform back points undistorted with undistortPoints() you have to - multiply them with \f$P^{-1}\f$. - */ - CV_EXPORTS_W void distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha = 0); - - /** @brief Undistorts 2D points using fisheye model - - @param distorted Array of object points, 1xN/Nx1 2-channel (or vector\ ), where N is the - number of points in the view. - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 - 1-channel or 1x1 3-channel - @param P New camera matrix (3x3) or new projection matrix (3x4) - @param undistorted Output array of image points, 1xN/Nx1 2-channel, or vector\ . - */ - CV_EXPORTS_W void undistortPoints(InputArray distorted, OutputArray undistorted, - InputArray K, InputArray D, InputArray R = noArray(), InputArray P = noArray()); - - /** @brief Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero - distortion is used, if R or P is empty identity matrixes are used. - - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 - 1-channel or 1x1 3-channel - @param P New camera matrix (3x3) or new projection matrix (3x4) - @param size Undistorted image size. - @param m1type Type of the first output map that can be CV_32FC1 or CV_16SC2 . See convertMaps() - for details. - @param map1 The first output map. - @param map2 The second output map. - */ - CV_EXPORTS_W void initUndistortRectifyMap(InputArray K, InputArray D, InputArray R, InputArray P, - const cv::Size& size, int m1type, OutputArray map1, OutputArray map2); - - /** @brief Transforms an image to compensate for fisheye lens distortion. - - @param distorted image with fisheye lens distortion. - @param undistorted Output image with compensated fisheye lens distortion. - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param Knew Camera matrix of the distorted image. By default, it is the identity matrix but you - may additionally scale and shift the result by using a different matrix. - @param new_size - - The function transforms an image to compensate radial and tangential lens distortion. - - The function is simply a combination of fisheye::initUndistortRectifyMap (with unity R ) and remap - (with bilinear interpolation). See the former function for details of the transformation being - performed. - - See below the results of undistortImage. - - a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3, - k_4, k_5, k_6) of distortion were optimized under calibration) - - b\) result of fisheye::undistortImage of fisheye camera model (all possible coefficients (k_1, k_2, - k_3, k_4) of fisheye distortion were optimized under calibration) - - c\) original image was captured with fisheye lens - - Pictures a) and b) almost the same. But if we consider points of image located far from the center - of image, we can notice that on image a) these points are distorted. - - ![image](pics/fisheye_undistorted.jpg) - */ - CV_EXPORTS_W void undistortImage(InputArray distorted, OutputArray undistorted, - InputArray K, InputArray D, InputArray Knew = cv::noArray(), const Size& new_size = Size()); - - /** @brief Estimates new camera matrix for undistortion or rectification. - - @param K Camera matrix \f$K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}\f$. - @param image_size - @param D Input vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param R Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3 - 1-channel or 1x1 3-channel - @param P New camera matrix (3x3) or new projection matrix (3x4) - @param balance Sets the new focal length in range between the min focal length and the max focal - length. Balance is in range of [0, 1]. - @param new_size - @param fov_scale Divisor for new focal length. - */ - CV_EXPORTS_W void estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R, - OutputArray P, double balance = 0.0, const Size& new_size = Size(), double fov_scale = 1.0); - - /** @brief Performs camera calibaration - - @param objectPoints vector of vectors of calibration pattern points in the calibration pattern - coordinate space. - @param imagePoints vector of vectors of the projections of calibration pattern points. - imagePoints.size() and objectPoints.size() and imagePoints[i].size() must be equal to - objectPoints[i].size() for each i. - @param image_size Size of the image used only to initialize the intrinsic camera matrix. - @param K Output 3x3 floating-point camera matrix - \f$A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}\f$ . If - fisheye::CALIB_USE_INTRINSIC_GUESS/ is specified, some or all of fx, fy, cx, cy must be - initialized before calling the function. - @param D Output vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$. - @param rvecs Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view. - That is, each k-th rotation vector together with the corresponding k-th translation vector (see - the next output parameter description) brings the calibration pattern from the model coordinate - space (in which object points are specified) to the world coordinate space, that is, a real - position of the calibration pattern in the k-th pattern view (k=0.. *M* -1). - @param tvecs Output vector of translation vectors estimated for each pattern view. - @param flags Different flags that may be zero or a combination of the following values: - - **fisheye::CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of - fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image - center ( imageSize is used), and focal distances are computed in a least-squares fashion. - - **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration - of intrinsic optimization. - - **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number. - - **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero. - - **fisheye::CALIB_FIX_K1..fisheye::CALIB_FIX_K4** Selected distortion coefficients - are set to zeros and stay zero. - - **fisheye::CALIB_FIX_PRINCIPAL_POINT** The principal point is not changed during the global -optimization. It stays at the center or at a different location specified when CALIB_USE_INTRINSIC_GUESS is set too. - @param criteria Termination criteria for the iterative optimization algorithm. - */ - CV_EXPORTS_W double calibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints, const Size& image_size, - InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs, int flags = 0, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); - - /** @brief Stereo rectification for fisheye camera model - - @param K1 First camera matrix. - @param D1 First camera distortion parameters. - @param K2 Second camera matrix. - @param D2 Second camera distortion parameters. - @param imageSize Size of the image used for stereo calibration. - @param R Rotation matrix between the coordinate systems of the first and the second - cameras. - @param tvec Translation vector between coordinate systems of the cameras. - @param R1 Output 3x3 rectification transform (rotation matrix) for the first camera. - @param R2 Output 3x3 rectification transform (rotation matrix) for the second camera. - @param P1 Output 3x4 projection matrix in the new (rectified) coordinate systems for the first - camera. - @param P2 Output 3x4 projection matrix in the new (rectified) coordinate systems for the second - camera. - @param Q Output \f$4 \times 4\f$ disparity-to-depth mapping matrix (see reprojectImageTo3D ). - @param flags Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set, - the function makes the principal points of each camera have the same pixel coordinates in the - rectified views. And if the flag is not set, the function may still shift the images in the - horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the - useful image area. - @param newImageSize New image resolution after rectification. The same size should be passed to - initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0) - is passed (default), it is set to the original imageSize . Setting it to larger value can help you - preserve details in the original image, especially when there is a big radial distortion. - @param balance Sets the new focal length in range between the min focal length and the max focal - length. Balance is in range of [0, 1]. - @param fov_scale Divisor for new focal length. - */ - CV_EXPORTS_W void stereoRectify(InputArray K1, InputArray D1, InputArray K2, InputArray D2, const Size &imageSize, InputArray R, InputArray tvec, - OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags, const Size &newImageSize = Size(), - double balance = 0.0, double fov_scale = 1.0); - - /** @brief Performs stereo calibration - - @param objectPoints Vector of vectors of the calibration pattern points. - @param imagePoints1 Vector of vectors of the projections of the calibration pattern points, - observed by the first camera. - @param imagePoints2 Vector of vectors of the projections of the calibration pattern points, - observed by the second camera. - @param K1 Input/output first camera matrix: - \f$\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}\f$ , \f$j = 0,\, 1\f$ . If - any of fisheye::CALIB_USE_INTRINSIC_GUESS , fisheye::CALIB_FIX_INTRINSIC are specified, - some or all of the matrix components must be initialized. - @param D1 Input/output vector of distortion coefficients \f$(k_1, k_2, k_3, k_4)\f$ of 4 elements. - @param K2 Input/output second camera matrix. The parameter is similar to K1 . - @param D2 Input/output lens distortion coefficients for the second camera. The parameter is - similar to D1 . - @param imageSize Size of the image used only to initialize intrinsic camera matrix. - @param R Output rotation matrix between the 1st and the 2nd camera coordinate systems. - @param T Output translation vector between the coordinate systems of the cameras. - @param flags Different flags that may be zero or a combination of the following values: - - **fisheye::CALIB_FIX_INTRINSIC** Fix K1, K2? and D1, D2? so that only R, T matrices - are estimated. - - **fisheye::CALIB_USE_INTRINSIC_GUESS** K1, K2 contains valid initial values of - fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image - center (imageSize is used), and focal distances are computed in a least-squares fashion. - - **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration - of intrinsic optimization. - - **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number. - - **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero. - - **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay - zero. - @param criteria Termination criteria for the iterative optimization algorithm. - */ - CV_EXPORTS_W double stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayOfArrays imagePoints1, InputArrayOfArrays imagePoints2, - InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize, - OutputArray R, OutputArray T, int flags = fisheye::CALIB_FIX_INTRINSIC, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)); - -//! @} calib3d_fisheye -} // end namespace fisheye - -} //end namespace cv - -#ifndef DISABLE_OPENCV_24_COMPATIBILITY -#include "opencv2/calib3d/calib3d_c.h" -#endif - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d.hpp b/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d.hpp deleted file mode 100644 index b3da45e..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/calib3d.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d_c.h b/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d_c.h deleted file mode 100644 index 8ec6390..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/calib3d/calib3d_c.h +++ /dev/null @@ -1,427 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_CALIB3D_C_H -#define OPENCV_CALIB3D_C_H - -#include "opencv2/core/core_c.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup calib3d_c - @{ - */ - -/****************************************************************************************\ -* Camera Calibration, Pose Estimation and Stereo * -\****************************************************************************************/ - -typedef struct CvPOSITObject CvPOSITObject; - -/* Allocates and initializes CvPOSITObject structure before doing cvPOSIT */ -CVAPI(CvPOSITObject*) cvCreatePOSITObject( CvPoint3D32f* points, int point_count ); - - -/* Runs POSIT (POSe from ITeration) algorithm for determining 3d position of - an object given its model and projection in a weak-perspective case */ -CVAPI(void) cvPOSIT( CvPOSITObject* posit_object, CvPoint2D32f* image_points, - double focal_length, CvTermCriteria criteria, - float* rotation_matrix, float* translation_vector); - -/* Releases CvPOSITObject structure */ -CVAPI(void) cvReleasePOSITObject( CvPOSITObject** posit_object ); - -/* updates the number of RANSAC iterations */ -CVAPI(int) cvRANSACUpdateNumIters( double p, double err_prob, - int model_points, int max_iters ); - -CVAPI(void) cvConvertPointsHomogeneous( const CvMat* src, CvMat* dst ); - -/* Calculates fundamental matrix given a set of corresponding points */ -#define CV_FM_7POINT 1 -#define CV_FM_8POINT 2 - -#define CV_LMEDS 4 -#define CV_RANSAC 8 - -#define CV_FM_LMEDS_ONLY CV_LMEDS -#define CV_FM_RANSAC_ONLY CV_RANSAC -#define CV_FM_LMEDS CV_LMEDS -#define CV_FM_RANSAC CV_RANSAC - -enum -{ - CV_ITERATIVE = 0, - CV_EPNP = 1, // F.Moreno-Noguer, V.Lepetit and P.Fua "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" - CV_P3P = 2, // X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang; "Complete Solution Classification for the Perspective-Three-Point Problem" - CV_DLS = 3 // Joel A. Hesch and Stergios I. Roumeliotis. "A Direct Least-Squares (DLS) Method for PnP" -}; - -CVAPI(int) cvFindFundamentalMat( const CvMat* points1, const CvMat* points2, - CvMat* fundamental_matrix, - int method CV_DEFAULT(CV_FM_RANSAC), - double param1 CV_DEFAULT(3.), double param2 CV_DEFAULT(0.99), - CvMat* status CV_DEFAULT(NULL) ); - -/* For each input point on one of images - computes parameters of the corresponding - epipolar line on the other image */ -CVAPI(void) cvComputeCorrespondEpilines( const CvMat* points, - int which_image, - const CvMat* fundamental_matrix, - CvMat* correspondent_lines ); - -/* Triangulation functions */ - -CVAPI(void) cvTriangulatePoints(CvMat* projMatr1, CvMat* projMatr2, - CvMat* projPoints1, CvMat* projPoints2, - CvMat* points4D); - -CVAPI(void) cvCorrectMatches(CvMat* F, CvMat* points1, CvMat* points2, - CvMat* new_points1, CvMat* new_points2); - - -/* Computes the optimal new camera matrix according to the free scaling parameter alpha: - alpha=0 - only valid pixels will be retained in the undistorted image - alpha=1 - all the source image pixels will be retained in the undistorted image -*/ -CVAPI(void) cvGetOptimalNewCameraMatrix( const CvMat* camera_matrix, - const CvMat* dist_coeffs, - CvSize image_size, double alpha, - CvMat* new_camera_matrix, - CvSize new_imag_size CV_DEFAULT(cvSize(0,0)), - CvRect* valid_pixel_ROI CV_DEFAULT(0), - int center_principal_point CV_DEFAULT(0)); - -/* Converts rotation vector to rotation matrix or vice versa */ -CVAPI(int) cvRodrigues2( const CvMat* src, CvMat* dst, - CvMat* jacobian CV_DEFAULT(0) ); - -/* Finds perspective transformation between the object plane and image (view) plane */ -CVAPI(int) cvFindHomography( const CvMat* src_points, - const CvMat* dst_points, - CvMat* homography, - int method CV_DEFAULT(0), - double ransacReprojThreshold CV_DEFAULT(3), - CvMat* mask CV_DEFAULT(0), - int maxIters CV_DEFAULT(2000), - double confidence CV_DEFAULT(0.995)); - -/* Computes RQ decomposition for 3x3 matrices */ -CVAPI(void) cvRQDecomp3x3( const CvMat *matrixM, CvMat *matrixR, CvMat *matrixQ, - CvMat *matrixQx CV_DEFAULT(NULL), - CvMat *matrixQy CV_DEFAULT(NULL), - CvMat *matrixQz CV_DEFAULT(NULL), - CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); - -/* Computes projection matrix decomposition */ -CVAPI(void) cvDecomposeProjectionMatrix( const CvMat *projMatr, CvMat *calibMatr, - CvMat *rotMatr, CvMat *posVect, - CvMat *rotMatrX CV_DEFAULT(NULL), - CvMat *rotMatrY CV_DEFAULT(NULL), - CvMat *rotMatrZ CV_DEFAULT(NULL), - CvPoint3D64f *eulerAngles CV_DEFAULT(NULL)); - -/* Computes d(AB)/dA and d(AB)/dB */ -CVAPI(void) cvCalcMatMulDeriv( const CvMat* A, const CvMat* B, CvMat* dABdA, CvMat* dABdB ); - -/* Computes r3 = rodrigues(rodrigues(r2)*rodrigues(r1)), - t3 = rodrigues(r2)*t1 + t2 and the respective derivatives */ -CVAPI(void) cvComposeRT( const CvMat* _rvec1, const CvMat* _tvec1, - const CvMat* _rvec2, const CvMat* _tvec2, - CvMat* _rvec3, CvMat* _tvec3, - CvMat* dr3dr1 CV_DEFAULT(0), CvMat* dr3dt1 CV_DEFAULT(0), - CvMat* dr3dr2 CV_DEFAULT(0), CvMat* dr3dt2 CV_DEFAULT(0), - CvMat* dt3dr1 CV_DEFAULT(0), CvMat* dt3dt1 CV_DEFAULT(0), - CvMat* dt3dr2 CV_DEFAULT(0), CvMat* dt3dt2 CV_DEFAULT(0) ); - -/* Projects object points to the view plane using - the specified extrinsic and intrinsic camera parameters */ -CVAPI(void) cvProjectPoints2( const CvMat* object_points, const CvMat* rotation_vector, - const CvMat* translation_vector, const CvMat* camera_matrix, - const CvMat* distortion_coeffs, CvMat* image_points, - CvMat* dpdrot CV_DEFAULT(NULL), CvMat* dpdt CV_DEFAULT(NULL), - CvMat* dpdf CV_DEFAULT(NULL), CvMat* dpdc CV_DEFAULT(NULL), - CvMat* dpddist CV_DEFAULT(NULL), - double aspect_ratio CV_DEFAULT(0)); - -/* Finds extrinsic camera parameters from - a few known corresponding point pairs and intrinsic parameters */ -CVAPI(void) cvFindExtrinsicCameraParams2( const CvMat* object_points, - const CvMat* image_points, - const CvMat* camera_matrix, - const CvMat* distortion_coeffs, - CvMat* rotation_vector, - CvMat* translation_vector, - int use_extrinsic_guess CV_DEFAULT(0) ); - -/* Computes initial estimate of the intrinsic camera parameters - in case of planar calibration target (e.g. chessboard) */ -CVAPI(void) cvInitIntrinsicParams2D( const CvMat* object_points, - const CvMat* image_points, - const CvMat* npoints, CvSize image_size, - CvMat* camera_matrix, - double aspect_ratio CV_DEFAULT(1.) ); - -#define CV_CALIB_CB_ADAPTIVE_THRESH 1 -#define CV_CALIB_CB_NORMALIZE_IMAGE 2 -#define CV_CALIB_CB_FILTER_QUADS 4 -#define CV_CALIB_CB_FAST_CHECK 8 - -// Performs a fast check if a chessboard is in the input image. This is a workaround to -// a problem of cvFindChessboardCorners being slow on images with no chessboard -// - src: input image -// - size: chessboard size -// Returns 1 if a chessboard can be in this image and findChessboardCorners should be called, -// 0 if there is no chessboard, -1 in case of error -CVAPI(int) cvCheckChessboard(IplImage* src, CvSize size); - - /* Detects corners on a chessboard calibration pattern */ -CVAPI(int) cvFindChessboardCorners( const void* image, CvSize pattern_size, - CvPoint2D32f* corners, - int* corner_count CV_DEFAULT(NULL), - int flags CV_DEFAULT(CV_CALIB_CB_ADAPTIVE_THRESH+CV_CALIB_CB_NORMALIZE_IMAGE) ); - -/* Draws individual chessboard corners or the whole chessboard detected */ -CVAPI(void) cvDrawChessboardCorners( CvArr* image, CvSize pattern_size, - CvPoint2D32f* corners, - int count, int pattern_was_found ); - -#define CV_CALIB_USE_INTRINSIC_GUESS 1 -#define CV_CALIB_FIX_ASPECT_RATIO 2 -#define CV_CALIB_FIX_PRINCIPAL_POINT 4 -#define CV_CALIB_ZERO_TANGENT_DIST 8 -#define CV_CALIB_FIX_FOCAL_LENGTH 16 -#define CV_CALIB_FIX_K1 32 -#define CV_CALIB_FIX_K2 64 -#define CV_CALIB_FIX_K3 128 -#define CV_CALIB_FIX_K4 2048 -#define CV_CALIB_FIX_K5 4096 -#define CV_CALIB_FIX_K6 8192 -#define CV_CALIB_RATIONAL_MODEL 16384 -#define CV_CALIB_THIN_PRISM_MODEL 32768 -#define CV_CALIB_FIX_S1_S2_S3_S4 65536 -#define CV_CALIB_TILTED_MODEL 262144 -#define CV_CALIB_FIX_TAUX_TAUY 524288 -#define CV_CALIB_FIX_TANGENT_DIST 2097152 - -#define CV_CALIB_NINTRINSIC 18 - -/* Finds intrinsic and extrinsic camera parameters - from a few views of known calibration pattern */ -CVAPI(double) cvCalibrateCamera2( const CvMat* object_points, - const CvMat* image_points, - const CvMat* point_counts, - CvSize image_size, - CvMat* camera_matrix, - CvMat* distortion_coeffs, - CvMat* rotation_vectors CV_DEFAULT(NULL), - CvMat* translation_vectors CV_DEFAULT(NULL), - int flags CV_DEFAULT(0), - CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria( - CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,DBL_EPSILON)) ); - -/* Computes various useful characteristics of the camera from the data computed by - cvCalibrateCamera2 */ -CVAPI(void) cvCalibrationMatrixValues( const CvMat *camera_matrix, - CvSize image_size, - double aperture_width CV_DEFAULT(0), - double aperture_height CV_DEFAULT(0), - double *fovx CV_DEFAULT(NULL), - double *fovy CV_DEFAULT(NULL), - double *focal_length CV_DEFAULT(NULL), - CvPoint2D64f *principal_point CV_DEFAULT(NULL), - double *pixel_aspect_ratio CV_DEFAULT(NULL)); - -#define CV_CALIB_FIX_INTRINSIC 256 -#define CV_CALIB_SAME_FOCAL_LENGTH 512 - -/* Computes the transformation from one camera coordinate system to another one - from a few correspondent views of the same calibration target. Optionally, calibrates - both cameras */ -CVAPI(double) cvStereoCalibrate( const CvMat* object_points, const CvMat* image_points1, - const CvMat* image_points2, const CvMat* npoints, - CvMat* camera_matrix1, CvMat* dist_coeffs1, - CvMat* camera_matrix2, CvMat* dist_coeffs2, - CvSize image_size, CvMat* R, CvMat* T, - CvMat* E CV_DEFAULT(0), CvMat* F CV_DEFAULT(0), - int flags CV_DEFAULT(CV_CALIB_FIX_INTRINSIC), - CvTermCriteria term_crit CV_DEFAULT(cvTermCriteria( - CV_TERMCRIT_ITER+CV_TERMCRIT_EPS,30,1e-6)) ); - -#define CV_CALIB_ZERO_DISPARITY 1024 - -/* Computes 3D rotations (+ optional shift) for each camera coordinate system to make both - views parallel (=> to make all the epipolar lines horizontal or vertical) */ -CVAPI(void) cvStereoRectify( const CvMat* camera_matrix1, const CvMat* camera_matrix2, - const CvMat* dist_coeffs1, const CvMat* dist_coeffs2, - CvSize image_size, const CvMat* R, const CvMat* T, - CvMat* R1, CvMat* R2, CvMat* P1, CvMat* P2, - CvMat* Q CV_DEFAULT(0), - int flags CV_DEFAULT(CV_CALIB_ZERO_DISPARITY), - double alpha CV_DEFAULT(-1), - CvSize new_image_size CV_DEFAULT(cvSize(0,0)), - CvRect* valid_pix_ROI1 CV_DEFAULT(0), - CvRect* valid_pix_ROI2 CV_DEFAULT(0)); - -/* Computes rectification transformations for uncalibrated pair of images using a set - of point correspondences */ -CVAPI(int) cvStereoRectifyUncalibrated( const CvMat* points1, const CvMat* points2, - const CvMat* F, CvSize img_size, - CvMat* H1, CvMat* H2, - double threshold CV_DEFAULT(5)); - - - -/* stereo correspondence parameters and functions */ - -#define CV_STEREO_BM_NORMALIZED_RESPONSE 0 -#define CV_STEREO_BM_XSOBEL 1 - -/* Block matching algorithm structure */ -typedef struct CvStereoBMState -{ - // pre-filtering (normalization of input images) - int preFilterType; // =CV_STEREO_BM_NORMALIZED_RESPONSE now - int preFilterSize; // averaging window size: ~5x5..21x21 - int preFilterCap; // the output of pre-filtering is clipped by [-preFilterCap,preFilterCap] - - // correspondence using Sum of Absolute Difference (SAD) - int SADWindowSize; // ~5x5..21x21 - int minDisparity; // minimum disparity (can be negative) - int numberOfDisparities; // maximum disparity - minimum disparity (> 0) - - // post-filtering - int textureThreshold; // the disparity is only computed for pixels - // with textured enough neighborhood - int uniquenessRatio; // accept the computed disparity d* only if - // SAD(d) >= SAD(d*)*(1 + uniquenessRatio/100.) - // for any d != d*+/-1 within the search range. - int speckleWindowSize; // disparity variation window - int speckleRange; // acceptable range of variation in window - - int trySmallerWindows; // if 1, the results may be more accurate, - // at the expense of slower processing - CvRect roi1, roi2; - int disp12MaxDiff; - - // temporary buffers - CvMat* preFilteredImg0; - CvMat* preFilteredImg1; - CvMat* slidingSumBuf; - CvMat* cost; - CvMat* disp; -} CvStereoBMState; - -#define CV_STEREO_BM_BASIC 0 -#define CV_STEREO_BM_FISH_EYE 1 -#define CV_STEREO_BM_NARROW 2 - -CVAPI(CvStereoBMState*) cvCreateStereoBMState(int preset CV_DEFAULT(CV_STEREO_BM_BASIC), - int numberOfDisparities CV_DEFAULT(0)); - -CVAPI(void) cvReleaseStereoBMState( CvStereoBMState** state ); - -CVAPI(void) cvFindStereoCorrespondenceBM( const CvArr* left, const CvArr* right, - CvArr* disparity, CvStereoBMState* state ); - -CVAPI(CvRect) cvGetValidDisparityROI( CvRect roi1, CvRect roi2, int minDisparity, - int numberOfDisparities, int SADWindowSize ); - -CVAPI(void) cvValidateDisparity( CvArr* disparity, const CvArr* cost, - int minDisparity, int numberOfDisparities, - int disp12MaxDiff CV_DEFAULT(1) ); - -/* Reprojects the computed disparity image to the 3D space using the specified 4x4 matrix */ -CVAPI(void) cvReprojectImageTo3D( const CvArr* disparityImage, - CvArr* _3dImage, const CvMat* Q, - int handleMissingValues CV_DEFAULT(0) ); - -/** @} calib3d_c */ - -#ifdef __cplusplus -} // extern "C" - -////////////////////////////////////////////////////////////////////////////////////////// -class CV_EXPORTS CvLevMarq -{ -public: - CvLevMarq(); - CvLevMarq( int nparams, int nerrs, CvTermCriteria criteria= - cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON), - bool completeSymmFlag=false ); - ~CvLevMarq(); - void init( int nparams, int nerrs, CvTermCriteria criteria= - cvTermCriteria(CV_TERMCRIT_EPS+CV_TERMCRIT_ITER,30,DBL_EPSILON), - bool completeSymmFlag=false ); - bool update( const CvMat*& param, CvMat*& J, CvMat*& err ); - bool updateAlt( const CvMat*& param, CvMat*& JtJ, CvMat*& JtErr, double*& errNorm ); - - void clear(); - void step(); - enum { DONE=0, STARTED=1, CALC_J=2, CHECK_ERR=3 }; - - cv::Ptr mask; - cv::Ptr prevParam; - cv::Ptr param; - cv::Ptr J; - cv::Ptr err; - cv::Ptr JtJ; - cv::Ptr JtJN; - cv::Ptr JtErr; - cv::Ptr JtJV; - cv::Ptr JtJW; - double prevErrNorm, errNorm; - int lambdaLg10; - CvTermCriteria criteria; - int state; - int iters; - bool completeSymmFlag; - int solveMethod; -}; - -#endif - -#endif /* OPENCV_CALIB3D_C_H */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/bindings_utils.hpp b/qt-correction-tool/pub/opencv/include/opencv2/core/bindings_utils.hpp deleted file mode 100644 index c1123f2..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/bindings_utils.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. - -#ifndef OPENCV_CORE_BINDINGS_UTILS_HPP -#define OPENCV_CORE_BINDINGS_UTILS_HPP - -namespace cv { namespace utils { -//! @addtogroup core_utils -//! @{ - -CV_EXPORTS_W String dumpInputArray(InputArray argument); - -CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument); - -CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument); - -CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument); - -//! @} -}} // namespace - -#endif // OPENCV_CORE_BINDINGS_UTILS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin.hpp b/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin.hpp deleted file mode 100644 index 460c5c5..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/hal/intrin.hpp +++ /dev/null @@ -1,429 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Copyright (C) 2015, Itseez Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_HAL_INTRIN_HPP -#define OPENCV_HAL_INTRIN_HPP - -#include -#include -#include -#include "opencv2/core/cvdef.h" - -#define OPENCV_HAL_ADD(a, b) ((a) + (b)) -#define OPENCV_HAL_AND(a, b) ((a) & (b)) -#define OPENCV_HAL_NOP(a) (a) -#define OPENCV_HAL_1ST(a, b) (a) - -// unlike HAL API, which is in cv::hal, -// we put intrinsics into cv namespace to make its -// access from within opencv code more accessible -namespace cv { - -namespace hal { - -enum StoreMode -{ - STORE_UNALIGNED = 0, - STORE_ALIGNED = 1, - STORE_ALIGNED_NOCACHE = 2 -}; - -} - -template struct V_TypeTraits -{ -}; - -#define CV_INTRIN_DEF_TYPE_TRAITS(type, int_type_, uint_type_, abs_type_, w_type_, q_type_, sum_type_, nlanes128_) \ - template<> struct V_TypeTraits \ - { \ - typedef type value_type; \ - typedef int_type_ int_type; \ - typedef abs_type_ abs_type; \ - typedef uint_type_ uint_type; \ - typedef w_type_ w_type; \ - typedef q_type_ q_type; \ - typedef sum_type_ sum_type; \ - enum { nlanes128 = nlanes128_ }; \ - \ - static inline int_type reinterpret_int(type x) \ - { \ - union { type l; int_type i; } v; \ - v.l = x; \ - return v.i; \ - } \ - \ - static inline type reinterpret_from_int(int_type x) \ - { \ - union { type l; int_type i; } v; \ - v.i = x; \ - return v.l; \ - } \ - } - -CV_INTRIN_DEF_TYPE_TRAITS(uchar, schar, uchar, uchar, ushort, unsigned, unsigned, 16); -CV_INTRIN_DEF_TYPE_TRAITS(schar, schar, uchar, uchar, short, int, int, 16); -CV_INTRIN_DEF_TYPE_TRAITS(ushort, short, ushort, ushort, unsigned, uint64, unsigned, 8); -CV_INTRIN_DEF_TYPE_TRAITS(short, short, ushort, ushort, int, int64, int, 8); -CV_INTRIN_DEF_TYPE_TRAITS(unsigned, int, unsigned, unsigned, uint64, void, unsigned, 4); -CV_INTRIN_DEF_TYPE_TRAITS(int, int, unsigned, unsigned, int64, void, int, 4); -CV_INTRIN_DEF_TYPE_TRAITS(float, int, unsigned, float, double, void, float, 4); -CV_INTRIN_DEF_TYPE_TRAITS(uint64, int64, uint64, uint64, void, void, uint64, 2); -CV_INTRIN_DEF_TYPE_TRAITS(int64, int64, uint64, uint64, void, void, int64, 2); -CV_INTRIN_DEF_TYPE_TRAITS(double, int64, uint64, double, void, void, double, 2); - -#ifndef CV_DOXYGEN - -#ifdef CV_CPU_DISPATCH_MODE - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace __CV_CAT(hal_, CV_CPU_DISPATCH_MODE) { - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END } -#else - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE hal_baseline - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN namespace hal_baseline { - #define CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END } -#endif - -CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN -CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END -using namespace CV_CPU_OPTIMIZATION_HAL_NAMESPACE; -#endif -} - -#ifdef CV_DOXYGEN -# undef CV_AVX2 -# undef CV_SSE2 -# undef CV_NEON -# undef CV_VSX -# undef CV_FP16 -#endif - -#if CV_SSE2 || CV_NEON || CV_VSX -#define CV__SIMD_FORWARD 128 -#include "opencv2/core/hal/intrin_forward.hpp" -#endif - -#if CV_SSE2 - -#include "opencv2/core/hal/intrin_sse_em.hpp" -#include "opencv2/core/hal/intrin_sse.hpp" - -#elif CV_NEON - -#include "opencv2/core/hal/intrin_neon.hpp" - -#elif CV_VSX - -#include "opencv2/core/hal/intrin_vsx.hpp" - -#else - -#define CV_SIMD128_CPP 1 -#include "opencv2/core/hal/intrin_cpp.hpp" - -#endif - -// AVX2 can be used together with SSE2, so -// we define those two sets of intrinsics at once. -// Most of the intrinsics do not conflict (the proper overloaded variant is -// resolved by the argument types, e.g. v_float32x4 ~ SSE2, v_float32x8 ~ AVX2), -// but some of AVX2 intrinsics get v256_ prefix instead of v_, e.g. v256_load() vs v_load(). -// Correspondingly, the wide intrinsics (which are mapped to the "widest" -// available instruction set) will get vx_ prefix -// (and will be mapped to v256_ counterparts) (e.g. vx_load() => v256_load()) -#if CV_AVX2 - -#define CV__SIMD_FORWARD 256 -#include "opencv2/core/hal/intrin_forward.hpp" -#include "opencv2/core/hal/intrin_avx.hpp" - -#endif - -//! @cond IGNORED - -namespace cv { - -#ifndef CV_DOXYGEN -CV_CPU_OPTIMIZATION_HAL_NAMESPACE_BEGIN -#endif - -#ifndef CV_SIMD128 -#define CV_SIMD128 0 -#endif - -#ifndef CV_SIMD128_64F -#define CV_SIMD128_64F 0 -#endif - -#ifndef CV_SIMD256 -#define CV_SIMD256 0 -#endif - -#ifndef CV_SIMD256_64F -#define CV_SIMD256_64F 0 -#endif - -#ifndef CV_SIMD512 -#define CV_SIMD512 0 -#endif - -#ifndef CV_SIMD512_64F -#define CV_SIMD512_64F 0 -#endif - -#ifndef CV_SIMD128_FP16 -#define CV_SIMD128_FP16 0 -#endif - -#ifndef CV_SIMD256_FP16 -#define CV_SIMD256_FP16 0 -#endif - -#ifndef CV_SIMD512_FP16 -#define CV_SIMD512_FP16 0 -#endif - -//================================================================================================== - -#define CV_INTRIN_DEFINE_WIDE_INTRIN(typ, vtyp, short_typ, prefix, loadsfx) \ - inline vtyp vx_setall_##short_typ(typ v) { return prefix##_setall_##short_typ(v); } \ - inline vtyp vx_setzero_##short_typ() { return prefix##_setzero_##short_typ(); } \ - inline vtyp vx_##loadsfx(const typ* ptr) { return prefix##_##loadsfx(ptr); } \ - inline vtyp vx_##loadsfx##_aligned(const typ* ptr) { return prefix##_##loadsfx##_aligned(ptr); } \ - inline vtyp vx_##loadsfx##_low(const typ* ptr) { return prefix##_##loadsfx##_low(ptr); } \ - inline vtyp vx_##loadsfx##_halves(const typ* ptr0, const typ* ptr1) { return prefix##_##loadsfx##_halves(ptr0, ptr1); } \ - inline void vx_store(typ* ptr, const vtyp& v) { return v_store(ptr, v); } \ - inline void vx_store_aligned(typ* ptr, const vtyp& v) { return v_store_aligned(ptr, v); } \ - inline vtyp vx_lut(const typ* ptr, const int* idx) { return prefix##_lut(ptr, idx); } \ - inline vtyp vx_lut_pairs(const typ* ptr, const int* idx) { return prefix##_lut_pairs(ptr, idx); } - -#define CV_INTRIN_DEFINE_WIDE_LUT_QUAD(typ, vtyp, prefix) \ - inline vtyp vx_lut_quads(const typ* ptr, const int* idx) { return prefix##_lut_quads(ptr, idx); } - -#define CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(typ, wtyp, prefix) \ - inline wtyp vx_load_expand(const typ* ptr) { return prefix##_load_expand(ptr); } - -#define CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND_Q(typ, qtyp, prefix) \ - inline qtyp vx_load_expand_q(const typ* ptr) { return prefix##_load_expand_q(ptr); } - -#define CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND(typ, vtyp, short_typ, wtyp, qtyp, prefix, loadsfx) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(typ, vtyp, short_typ, prefix, loadsfx) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(typ, vtyp, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(typ, wtyp, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND_Q(typ, qtyp, prefix) - -#define CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND(uchar, v_uint8, u8, v_uint16, v_uint32, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_INTRIN_WITH_EXPAND(schar, v_int8, s8, v_int16, v_int32, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(ushort, v_uint16, u16, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(ushort, v_uint16, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(ushort, v_uint32, prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(short, v_int16, s16, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(short, v_int16, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(short, v_int32, prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(int, v_int32, s32, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(int, v_int32, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(int, v_int64, prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(unsigned, v_uint32, u32, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(unsigned, v_uint32, prefix) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(unsigned, v_uint64, prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(float, v_float32, f32, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LUT_QUAD(float, v_float32, prefix) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(int64, v_int64, s64, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_INTRIN(uint64, v_uint64, u64, prefix, load) \ - CV_INTRIN_DEFINE_WIDE_LOAD_EXPAND(float16_t, v_float32, prefix) - -template struct V_RegTraits -{ -}; - -#define CV_DEF_REG_TRAITS(prefix, _reg, lane_type, suffix, _u_reg, _w_reg, _q_reg, _int_reg, _round_reg) \ - template<> struct V_RegTraits<_reg> \ - { \ - typedef _reg reg; \ - typedef _u_reg u_reg; \ - typedef _w_reg w_reg; \ - typedef _q_reg q_reg; \ - typedef _int_reg int_reg; \ - typedef _round_reg round_reg; \ - } - -#if CV_SIMD128 || CV_SIMD128_CPP - CV_DEF_REG_TRAITS(v, v_uint8x16, uchar, u8, v_uint8x16, v_uint16x8, v_uint32x4, v_int8x16, void); - CV_DEF_REG_TRAITS(v, v_int8x16, schar, s8, v_uint8x16, v_int16x8, v_int32x4, v_int8x16, void); - CV_DEF_REG_TRAITS(v, v_uint16x8, ushort, u16, v_uint16x8, v_uint32x4, v_uint64x2, v_int16x8, void); - CV_DEF_REG_TRAITS(v, v_int16x8, short, s16, v_uint16x8, v_int32x4, v_int64x2, v_int16x8, void); - CV_DEF_REG_TRAITS(v, v_uint32x4, unsigned, u32, v_uint32x4, v_uint64x2, void, v_int32x4, void); - CV_DEF_REG_TRAITS(v, v_int32x4, int, s32, v_uint32x4, v_int64x2, void, v_int32x4, void); -#if CV_SIMD128_64F - CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, v_float64x2, void, v_int32x4, v_int32x4); -#else - CV_DEF_REG_TRAITS(v, v_float32x4, float, f32, v_float32x4, void, void, v_int32x4, v_int32x4); -#endif - CV_DEF_REG_TRAITS(v, v_uint64x2, uint64, u64, v_uint64x2, void, void, v_int64x2, void); - CV_DEF_REG_TRAITS(v, v_int64x2, int64, s64, v_uint64x2, void, void, v_int64x2, void); -#if CV_SIMD128_64F - CV_DEF_REG_TRAITS(v, v_float64x2, double, f64, v_float64x2, void, void, v_int64x2, v_int32x4); -#endif -#endif - -#if CV_SIMD256 - CV_DEF_REG_TRAITS(v256, v_uint8x32, uchar, u8, v_uint8x32, v_uint16x16, v_uint32x8, v_int8x32, void); - CV_DEF_REG_TRAITS(v256, v_int8x32, schar, s8, v_uint8x32, v_int16x16, v_int32x8, v_int8x32, void); - CV_DEF_REG_TRAITS(v256, v_uint16x16, ushort, u16, v_uint16x16, v_uint32x8, v_uint64x4, v_int16x16, void); - CV_DEF_REG_TRAITS(v256, v_int16x16, short, s16, v_uint16x16, v_int32x8, v_int64x4, v_int16x16, void); - CV_DEF_REG_TRAITS(v256, v_uint32x8, unsigned, u32, v_uint32x8, v_uint64x4, void, v_int32x8, void); - CV_DEF_REG_TRAITS(v256, v_int32x8, int, s32, v_uint32x8, v_int64x4, void, v_int32x8, void); - CV_DEF_REG_TRAITS(v256, v_float32x8, float, f32, v_float32x8, v_float64x4, void, v_int32x8, v_int32x8); - CV_DEF_REG_TRAITS(v256, v_uint64x4, uint64, u64, v_uint64x4, void, void, v_int64x4, void); - CV_DEF_REG_TRAITS(v256, v_int64x4, int64, s64, v_uint64x4, void, void, v_int64x4, void); - CV_DEF_REG_TRAITS(v256, v_float64x4, double, f64, v_float64x4, void, void, v_int64x4, v_int32x8); -#endif - -#if CV_SIMD512 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 512) -#define CV__SIMD_NAMESPACE simd512 -namespace CV__SIMD_NAMESPACE { - #define CV_SIMD 1 - #define CV_SIMD_64F CV_SIMD512_64F - #define CV_SIMD_WIDTH 64 - // TODO typedef v_uint8 / v_int32 / etc types here -} // namespace -using namespace CV__SIMD_NAMESPACE; -#elif CV_SIMD256 && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 256) -#define CV__SIMD_NAMESPACE simd256 -namespace CV__SIMD_NAMESPACE { - #define CV_SIMD 1 - #define CV_SIMD_64F CV_SIMD256_64F - #define CV_SIMD_FP16 CV_SIMD256_FP16 - #define CV_SIMD_WIDTH 32 - typedef v_uint8x32 v_uint8; - typedef v_int8x32 v_int8; - typedef v_uint16x16 v_uint16; - typedef v_int16x16 v_int16; - typedef v_uint32x8 v_uint32; - typedef v_int32x8 v_int32; - typedef v_uint64x4 v_uint64; - typedef v_int64x4 v_int64; - typedef v_float32x8 v_float32; - CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(v256) - #if CV_SIMD256_64F - typedef v_float64x4 v_float64; - CV_INTRIN_DEFINE_WIDE_INTRIN(double, v_float64, f64, v256, load) - #endif - inline void vx_cleanup() { v256_cleanup(); } -} // namespace -using namespace CV__SIMD_NAMESPACE; -#elif (CV_SIMD128 || CV_SIMD128_CPP) && (!defined(CV__SIMD_FORCE_WIDTH) || CV__SIMD_FORCE_WIDTH == 128) -#define CV__SIMD_NAMESPACE simd128 -namespace CV__SIMD_NAMESPACE { - #define CV_SIMD CV_SIMD128 - #define CV_SIMD_64F CV_SIMD128_64F - #define CV_SIMD_WIDTH 16 - typedef v_uint8x16 v_uint8; - typedef v_int8x16 v_int8; - typedef v_uint16x8 v_uint16; - typedef v_int16x8 v_int16; - typedef v_uint32x4 v_uint32; - typedef v_int32x4 v_int32; - typedef v_uint64x2 v_uint64; - typedef v_int64x2 v_int64; - typedef v_float32x4 v_float32; - CV_INTRIN_DEFINE_WIDE_INTRIN_ALL_TYPES(v) - #if CV_SIMD128_64F - typedef v_float64x2 v_float64; - CV_INTRIN_DEFINE_WIDE_INTRIN(double, v_float64, f64, v, load) - #endif - inline void vx_cleanup() { v_cleanup(); } -} // namespace -using namespace CV__SIMD_NAMESPACE; -#endif - -inline unsigned int trailingZeros32(unsigned int value) { -#if defined(_MSC_VER) -#if (_MSC_VER < 1700) || defined(_M_ARM) - unsigned long index = 0; - _BitScanForward(&index, value); - return (unsigned int)index; -#elif defined(__clang__) - // clang-cl doesn't export _tzcnt_u32 for non BMI systems - return value ? __builtin_ctz(value) : 32; -#else - return _tzcnt_u32(value); -#endif -#elif defined(__GNUC__) || defined(__GNUG__) - return __builtin_ctz(value); -#elif defined(__ICC) || defined(__INTEL_COMPILER) - return _bit_scan_forward(value); -#elif defined(__clang__) - return llvm.cttz.i32(value, true); -#else - static const int MultiplyDeBruijnBitPosition[32] = { - 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, - 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; - return MultiplyDeBruijnBitPosition[((uint32_t)((value & -value) * 0x077CB531U)) >> 27]; -#endif -} - -#ifndef CV_DOXYGEN -CV_CPU_OPTIMIZATION_HAL_NAMESPACE_END -#endif - -#ifndef CV_SIMD_64F -#define CV_SIMD_64F 0 -#endif - -#ifndef CV_SIMD_FP16 -#define CV_SIMD_FP16 0 //!< Defined to 1 on native support of operations with float16x8_t / float16x16_t (SIMD256) types -#endif - - -#ifndef CV_SIMD -#define CV_SIMD 0 -#endif - -} // cv:: - -//! @endcond - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/logger.hpp b/qt-correction-tool/pub/opencv/include/opencv2/core/utils/logger.hpp deleted file mode 100644 index 47094f9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/core/utils/logger.hpp +++ /dev/null @@ -1,87 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. - -#ifndef OPENCV_LOGGER_HPP -#define OPENCV_LOGGER_HPP - -#include -#include -#include // INT_MAX - -#include "logger.defines.hpp" - -//! @addtogroup core_logging -// This section describes OpenCV logging utilities. -// -//! @{ - -namespace cv { -namespace utils { -namespace logging { - -//! Supported logging levels and their semantic -enum LogLevel { - LOG_LEVEL_SILENT = 0, //!< for using in setLogVevel() call - LOG_LEVEL_FATAL = 1, //!< Fatal (critical) error (unrecoverable internal error) - LOG_LEVEL_ERROR = 2, //!< Error message - LOG_LEVEL_WARNING = 3, //!< Warning message - LOG_LEVEL_INFO = 4, //!< Info message - LOG_LEVEL_DEBUG = 5, //!< Debug message. Disabled in the "Release" build. - LOG_LEVEL_VERBOSE = 6, //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. -#ifndef CV_DOXYGEN - ENUM_LOG_LEVEL_FORCE_INT = INT_MAX -#endif -}; - -/** Set global logging level -@return previous logging level -*/ -CV_EXPORTS LogLevel setLogLevel(LogLevel logLevel); -/** Get global logging level */ -CV_EXPORTS LogLevel getLogLevel(); - -namespace internal { -/** Write log message */ -CV_EXPORTS void writeLogMessage(LogLevel logLevel, const char* message); -} // namespace - -/** - * \def CV_LOG_STRIP_LEVEL - * - * Define CV_LOG_STRIP_LEVEL=CV_LOG_LEVEL_[DEBUG|INFO|WARN|ERROR|FATAL|DISABLED] to compile out anything at that and before that logging level - */ -#ifndef CV_LOG_STRIP_LEVEL -# if defined NDEBUG -# define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG -# else -# define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_VERBOSE -# endif -#endif - - -#define CV_LOG_FATAL(tag, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_FATAL) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_FATAL, ss.str().c_str()); break; } -#define CV_LOG_ERROR(tag, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_ERROR) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_ERROR, ss.str().c_str()); break; } -#define CV_LOG_WARNING(tag, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_WARNING) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_WARNING, ss.str().c_str()); break; } -#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_INFO -#define CV_LOG_INFO(tag, ...) -#else -#define CV_LOG_INFO(tag, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_INFO) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_INFO, ss.str().c_str()); break; } -#endif -#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_DEBUG -#define CV_LOG_DEBUG(tag, ...) -#else -#define CV_LOG_DEBUG(tag, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_DEBUG) break; std::stringstream ss; ss << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_DEBUG, ss.str().c_str()); break; } -#endif -#if CV_LOG_STRIP_LEVEL <= CV_LOG_LEVEL_VERBOSE -#define CV_LOG_VERBOSE(tag, v, ...) -#else -#define CV_LOG_VERBOSE(tag, v, ...) for(;;) { if (cv::utils::logging::getLogLevel() < cv::utils::logging::LOG_LEVEL_VERBOSE) break; std::stringstream ss; ss << "[VERB" << v << ":" << cv::utils::getThreadID() << "] " << __VA_ARGS__; cv::utils::logging::internal::writeLogMessage(cv::utils::logging::LOG_LEVEL_VERBOSE, ss.str().c_str()); break; } -#endif - - -}}} // namespace - -//! @} - -#endif // OPENCV_LOGGER_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn.hpp deleted file mode 100644 index 97f2fe3..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_HPP -#define OPENCV_DNN_HPP - -// This is an umbrella header to include into you project. -// We are free to change headers layout in dnn subfolder, so please include -// this header for future compatibility - - -/** @defgroup dnn Deep Neural Network module - @{ - This module contains: - - API for new layers creation, layers are building bricks of neural networks; - - set of built-in most-useful Layers; - - API to construct and modify comprehensive neural networks from layers; - - functionality for loading serialized networks models from different frameworks. - - Functionality of this module is designed only for forward pass computations (i.e. network testing). - A network training is in principle not supported. - @} -*/ -/** @example samples/dnn/classification.cpp -Check @ref tutorial_dnn_googlenet "the corresponding tutorial" for more details -*/ -/** @example samples/dnn/colorization.cpp -*/ -/** @example samples/dnn/object_detection.cpp -Check @ref tutorial_dnn_yolo "the corresponding tutorial" for more details -*/ -/** @example samples/dnn/openpose.cpp -*/ -/** @example samples/dnn/segmentation.cpp -*/ -/** @example samples/dnn/text_detection.cpp -*/ -#include - -#endif /* OPENCV_DNN_HPP */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/all_layers.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/all_layers.hpp deleted file mode 100644 index c6fe6d0..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/all_layers.hpp +++ /dev/null @@ -1,634 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_DNN_ALL_LAYERS_HPP -#define OPENCV_DNN_DNN_ALL_LAYERS_HPP -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN -//! @addtogroup dnn -//! @{ - -/** @defgroup dnnLayerList Partial List of Implemented Layers - @{ - This subsection of dnn module contains information about built-in layers and their descriptions. - - Classes listed here, in fact, provides C++ API for creating instances of built-in layers. - In addition to this way of layers instantiation, there is a more common factory API (see @ref dnnLayerFactory), it allows to create layers dynamically (by name) and register new ones. - You can use both API, but factory API is less convenient for native C++ programming and basically designed for use inside importers (see @ref readNetFromCaffe(), @ref readNetFromTorch(), @ref readNetFromTensorflow()). - - Built-in layers partially reproduce functionality of corresponding Caffe and Torch7 layers. - In particular, the following layers and Caffe importer were tested to reproduce Caffe functionality: - - Convolution - - Deconvolution - - Pooling - - InnerProduct - - TanH, ReLU, Sigmoid, BNLL, Power, AbsVal - - Softmax - - Reshape, Flatten, Slice, Split - - LRN - - MVN - - Dropout (since it does nothing on forward pass -)) -*/ - - class CV_EXPORTS BlankLayer : public Layer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - /** - * Constant layer produces the same data blob at an every forward pass. - */ - class CV_EXPORTS ConstLayer : public Layer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - //! LSTM recurrent layer - class CV_EXPORTS LSTMLayer : public Layer - { - public: - /** Creates instance of LSTM layer */ - static Ptr create(const LayerParams& params); - - /** @deprecated Use LayerParams::blobs instead. - @brief Set trained weights for LSTM layer. - - LSTM behavior on each step is defined by current input, previous output, previous cell state and learned weights. - - Let @f$x_t@f$ be current input, @f$h_t@f$ be current output, @f$c_t@f$ be current state. - Than current output and current cell state is computed as follows: - @f{eqnarray*}{ - h_t &= o_t \odot tanh(c_t), \\ - c_t &= f_t \odot c_{t-1} + i_t \odot g_t, \\ - @f} - where @f$\odot@f$ is per-element multiply operation and @f$i_t, f_t, o_t, g_t@f$ is internal gates that are computed using learned wights. - - Gates are computed as follows: - @f{eqnarray*}{ - i_t &= sigmoid&(W_{xi} x_t + W_{hi} h_{t-1} + b_i), \\ - f_t &= sigmoid&(W_{xf} x_t + W_{hf} h_{t-1} + b_f), \\ - o_t &= sigmoid&(W_{xo} x_t + W_{ho} h_{t-1} + b_o), \\ - g_t &= tanh &(W_{xg} x_t + W_{hg} h_{t-1} + b_g), \\ - @f} - where @f$W_{x?}@f$, @f$W_{h?}@f$ and @f$b_{?}@f$ are learned weights represented as matrices: - @f$W_{x?} \in R^{N_h \times N_x}@f$, @f$W_{h?} \in R^{N_h \times N_h}@f$, @f$b_? \in R^{N_h}@f$. - - For simplicity and performance purposes we use @f$ W_x = [W_{xi}; W_{xf}; W_{xo}, W_{xg}] @f$ - (i.e. @f$W_x@f$ is vertical concatenation of @f$ W_{x?} @f$), @f$ W_x \in R^{4N_h \times N_x} @f$. - The same for @f$ W_h = [W_{hi}; W_{hf}; W_{ho}, W_{hg}], W_h \in R^{4N_h \times N_h} @f$ - and for @f$ b = [b_i; b_f, b_o, b_g]@f$, @f$b \in R^{4N_h} @f$. - - @param Wh is matrix defining how previous output is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_h @f$) - @param Wx is matrix defining how current input is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_x @f$) - @param b is bias vector (i.e. according to above mentioned notation is @f$ b @f$) - */ - CV_DEPRECATED virtual void setWeights(const Mat &Wh, const Mat &Wx, const Mat &b) = 0; - - /** @brief Specifies shape of output blob which will be [[`T`], `N`] + @p outTailShape. - * @details If this parameter is empty or unset then @p outTailShape = [`Wh`.size(0)] will be used, - * where `Wh` is parameter from setWeights(). - */ - virtual void setOutShape(const MatShape &outTailShape = MatShape()) = 0; - - /** @deprecated Use flag `produce_cell_output` in LayerParams. - * @brief Specifies either interpret first dimension of input blob as timestamp dimenion either as sample. - * - * If flag is set to true then shape of input blob will be interpreted as [`T`, `N`, `[data dims]`] where `T` specifies number of timestamps, `N` is number of independent streams. - * In this case each forward() call will iterate through `T` timestamps and update layer's state `T` times. - * - * If flag is set to false then shape of input blob will be interpreted as [`N`, `[data dims]`]. - * In this case each forward() call will make one iteration and produce one timestamp with shape [`N`, `[out dims]`]. - */ - CV_DEPRECATED virtual void setUseTimstampsDim(bool use = true) = 0; - - /** @deprecated Use flag `use_timestamp_dim` in LayerParams. - * @brief If this flag is set to true then layer will produce @f$ c_t @f$ as second output. - * @details Shape of the second output is the same as first output. - */ - CV_DEPRECATED virtual void setProduceCellOutput(bool produce = false) = 0; - - /* In common case it use single input with @f$x_t@f$ values to compute output(s) @f$h_t@f$ (and @f$c_t@f$). - * @param input should contain packed values @f$x_t@f$ - * @param output contains computed outputs: @f$h_t@f$ (and @f$c_t@f$ if setProduceCellOutput() flag was set to true). - * - * If setUseTimstampsDim() is set to true then @p input[0] should has at least two dimensions with the following shape: [`T`, `N`, `[data dims]`], - * where `T` specifies number of timestamps, `N` is number of independent streams (i.e. @f$ x_{t_0 + t}^{stream} @f$ is stored inside @p input[0][t, stream, ...]). - * - * If setUseTimstampsDim() is set to false then @p input[0] should contain single timestamp, its shape should has form [`N`, `[data dims]`] with at least one dimension. - * (i.e. @f$ x_{t}^{stream} @f$ is stored inside @p input[0][stream, ...]). - */ - - int inputNameToIndex(String inputName) CV_OVERRIDE; - int outputNameToIndex(const String& outputName) CV_OVERRIDE; - }; - - /** @brief Classical recurrent layer - - Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$. - - - input: should contain packed input @f$x_t@f$. - - output: should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true). - - input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively. - - output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix. - - If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix. - */ - class CV_EXPORTS RNNLayer : public Layer - { - public: - /** Creates instance of RNNLayer */ - static Ptr create(const LayerParams& params); - - /** Setups learned weights. - - Recurrent-layer behavior on each step is defined by current input @f$ x_t @f$, previous state @f$ h_t @f$ and learned weights as follows: - @f{eqnarray*}{ - h_t &= tanh&(W_{hh} h_{t-1} + W_{xh} x_t + b_h), \\ - o_t &= tanh&(W_{ho} h_t + b_o), - @f} - - @param Wxh is @f$ W_{xh} @f$ matrix - @param bh is @f$ b_{h} @f$ vector - @param Whh is @f$ W_{hh} @f$ matrix - @param Who is @f$ W_{xo} @f$ matrix - @param bo is @f$ b_{o} @f$ vector - */ - virtual void setWeights(const Mat &Wxh, const Mat &bh, const Mat &Whh, const Mat &Who, const Mat &bo) = 0; - - /** @brief If this flag is set to true then layer will produce @f$ h_t @f$ as second output. - * @details Shape of the second output is the same as first output. - */ - virtual void setProduceHiddenOutput(bool produce = false) = 0; - - }; - - class CV_EXPORTS BaseConvolutionLayer : public Layer - { - public: - Size kernel, stride, pad, dilation, adjustPad; - String padMode; - int numOutput; - }; - - class CV_EXPORTS ConvolutionLayer : public BaseConvolutionLayer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS DeconvolutionLayer : public BaseConvolutionLayer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS LRNLayer : public Layer - { - public: - int type; - - int size; - float alpha, beta, bias; - bool normBySize; - - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS PoolingLayer : public Layer - { - public: - int type; - Size kernel, stride; - int pad_l, pad_t, pad_r, pad_b; - CV_DEPRECATED_EXTERNAL Size pad; - bool globalPooling; - bool computeMaxIdx; - String padMode; - bool ceilMode; - // If true for average pooling with padding, divide an every output region - // by a whole kernel area. Otherwise exclude zero padded values and divide - // by number of real values. - bool avePoolPaddedArea; - // ROIPooling parameters. - Size pooledSize; - float spatialScale; - // PSROIPooling parameters. - int psRoiOutChannels; - - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS SoftmaxLayer : public Layer - { - public: - bool logSoftMax; - - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS InnerProductLayer : public Layer - { - public: - int axis; - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS MVNLayer : public Layer - { - public: - float eps; - bool normVariance, acrossChannels; - - static Ptr create(const LayerParams& params); - }; - - /* Reshaping */ - - class CV_EXPORTS ReshapeLayer : public Layer - { - public: - MatShape newShapeDesc; - Range newShapeRange; - - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS FlattenLayer : public Layer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS ConcatLayer : public Layer - { - public: - int axis; - /** - * @brief Add zero padding in case of concatenation of blobs with different - * spatial sizes. - * - * Details: https://github.com/torch/nn/blob/master/doc/containers.md#depthconcat - */ - bool padding; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS SplitLayer : public Layer - { - public: - int outputsCount; //!< Number of copies that will be produced (is ignored when negative). - - static Ptr create(const LayerParams ¶ms); - }; - - /** - * Slice layer has several modes: - * 1. Caffe mode - * @param[in] axis Axis of split operation - * @param[in] slice_point Array of split points - * - * Number of output blobs equals to number of split points plus one. The - * first blob is a slice on input from 0 to @p slice_point[0] - 1 by @p axis, - * the second output blob is a slice of input from @p slice_point[0] to - * @p slice_point[1] - 1 by @p axis and the last output blob is a slice of - * input from @p slice_point[-1] up to the end of @p axis size. - * - * 2. TensorFlow mode - * @param begin Vector of start indices - * @param size Vector of sizes - * - * More convenient numpy-like slice. One and only output blob - * is a slice `input[begin[0]:begin[0]+size[0], begin[1]:begin[1]+size[1], ...]` - * - * 3. Torch mode - * @param axis Axis of split operation - * - * Split input blob on the equal parts by @p axis. - */ - class CV_EXPORTS SliceLayer : public Layer - { - public: - /** - * @brief Vector of slice ranges. - * - * The first dimension equals number of output blobs. - * Inner vector has slice ranges for the first number of input dimensions. - */ - std::vector > sliceRanges; - int axis; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS PermuteLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - /** - * Permute channels of 4-dimensional input blob. - * @param group Number of groups to split input channels and pick in turns - * into output blob. - * - * \f[ groupSize = \frac{number\ of\ channels}{group} \f] - * \f[ output(n, c, h, w) = input(n, groupSize \times (c \% group) + \lfloor \frac{c}{group} \rfloor, h, w) \f] - * Read more at https://arxiv.org/pdf/1707.01083.pdf - */ - class CV_EXPORTS ShuffleChannelLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - - int group; - }; - - /** - * @brief Adds extra values for specific axes. - * @param paddings Vector of paddings in format - * @code - * [ pad_before, pad_after, // [0]th dimension - * pad_before, pad_after, // [1]st dimension - * ... - * pad_before, pad_after ] // [n]th dimension - * @endcode - * that represents number of padded values at every dimension - * starting from the first one. The rest of dimensions won't - * be padded. - * @param value Value to be padded. Defaults to zero. - * @param type Padding type: 'constant', 'reflect' - * @param input_dims Torch's parameter. If @p input_dims is not equal to the - * actual input dimensionality then the `[0]th` dimension - * is considered as a batch dimension and @p paddings are shifted - * to a one dimension. Defaults to `-1` that means padding - * corresponding to @p paddings. - */ - class CV_EXPORTS PaddingLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - /* Activations */ - class CV_EXPORTS ActivationLayer : public Layer - { - public: - virtual void forwardSlice(const float* src, float* dst, int len, - size_t outPlaneSize, int cn0, int cn1) const = 0; - }; - - class CV_EXPORTS ReLULayer : public ActivationLayer - { - public: - float negativeSlope; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS ReLU6Layer : public ActivationLayer - { - public: - float minValue, maxValue; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS ChannelsPReLULayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS ELULayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS TanHLayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS SigmoidLayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS BNLLLayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS AbsLayer : public ActivationLayer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS PowerLayer : public ActivationLayer - { - public: - float power, scale, shift; - - static Ptr create(const LayerParams ¶ms); - }; - - /* Layers used in semantic segmentation */ - - class CV_EXPORTS CropLayer : public Layer - { - public: - int startAxis; - std::vector offset; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS EltwiseLayer : public Layer - { - public: - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS BatchNormLayer : public ActivationLayer - { - public: - bool hasWeights, hasBias; - float epsilon; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS MaxUnpoolLayer : public Layer - { - public: - Size poolKernel; - Size poolPad; - Size poolStride; - - static Ptr create(const LayerParams ¶ms); - }; - - class CV_EXPORTS ScaleLayer : public Layer - { - public: - bool hasBias; - int axis; - - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS ShiftLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS PriorBoxLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS ReorgLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS RegionLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS DetectionOutputLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - /** - * @brief \f$ L_p \f$ - normalization layer. - * @param p Normalization factor. The most common `p = 1` for \f$ L_1 \f$ - - * normalization or `p = 2` for \f$ L_2 \f$ - normalization or a custom one. - * @param eps Parameter \f$ \epsilon \f$ to prevent a division by zero. - * @param across_spatial If true, normalize an input across all non-batch dimensions. - * Otherwise normalize an every channel separately. - * - * Across spatial: - * @f[ - * norm = \sqrt[p]{\epsilon + \sum_{x, y, c} |src(x, y, c)|^p } \\ - * dst(x, y, c) = \frac{ src(x, y, c) }{norm} - * @f] - * - * Channel wise normalization: - * @f[ - * norm(c) = \sqrt[p]{\epsilon + \sum_{x, y} |src(x, y, c)|^p } \\ - * dst(x, y, c) = \frac{ src(x, y, c) }{norm(c)} - * @f] - * - * Where `x, y` - spatial coordinates, `c` - channel. - * - * An every sample in the batch is normalized separately. Optionally, - * output is scaled by the trained parameters. - */ - class CV_EXPORTS NormalizeBBoxLayer : public Layer - { - public: - float pnorm, epsilon; - CV_DEPRECATED_EXTERNAL bool acrossSpatial; - - static Ptr create(const LayerParams& params); - }; - - /** - * @brief Resize input 4-dimensional blob by nearest neighbor or bilinear strategy. - * - * Layer is used to support TensorFlow's resize_nearest_neighbor and resize_bilinear ops. - */ - class CV_EXPORTS ResizeLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - /** - * @brief Bilinear resize layer from https://github.com/cdmh/deeplab-public - * - * It differs from @ref ResizeLayer in output shape and resize scales computations. - */ - class CV_EXPORTS InterpLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS ProposalLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - - class CV_EXPORTS CropAndResizeLayer : public Layer - { - public: - static Ptr create(const LayerParams& params); - }; - -//! @} -//! @} -CV__DNN_EXPERIMENTAL_NS_END -} -} -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dict.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/dict.hpp deleted file mode 100644 index 60c2aa5..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dict.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#include -#include -#include - -#include - -#ifndef OPENCV_DNN_DNN_DICT_HPP -#define OPENCV_DNN_DNN_DICT_HPP - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN -//! @addtogroup dnn -//! @{ - -/** @brief This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64. - * @todo Maybe int64 is useless because double type exactly stores at least 2^52 integers. - */ -struct CV_EXPORTS_W DictValue -{ - DictValue(const DictValue &r); - DictValue(bool i) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = i ? 1 : 0; } //!< Constructs integer scalar - DictValue(int64 i = 0) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = i; } //!< Constructs integer scalar - CV_WRAP DictValue(int i) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = i; } //!< Constructs integer scalar - DictValue(unsigned p) : type(Param::INT), pi(new AutoBuffer) { (*pi)[0] = p; } //!< Constructs integer scalar - CV_WRAP DictValue(double p) : type(Param::REAL), pd(new AutoBuffer) { (*pd)[0] = p; } //!< Constructs floating point scalar - CV_WRAP DictValue(const String &s) : type(Param::STRING), ps(new AutoBuffer) { (*ps)[0] = s; } //!< Constructs string scalar - DictValue(const char *s) : type(Param::STRING), ps(new AutoBuffer) { (*ps)[0] = s; } //!< @overload - - template - static DictValue arrayInt(TypeIter begin, int size); //!< Constructs integer array - template - static DictValue arrayReal(TypeIter begin, int size); //!< Constructs floating point array - template - static DictValue arrayString(TypeIter begin, int size); //!< Constructs array of strings - - template - T get(int idx = -1) const; //!< Tries to convert array element with specified index to requested type and returns its. - - int size() const; - - CV_WRAP bool isInt() const; - CV_WRAP bool isString() const; - CV_WRAP bool isReal() const; - - CV_WRAP int getIntValue(int idx = -1) const; - CV_WRAP double getRealValue(int idx = -1) const; - CV_WRAP String getStringValue(int idx = -1) const; - - DictValue &operator=(const DictValue &r); - - friend std::ostream &operator<<(std::ostream &stream, const DictValue &dictv); - - ~DictValue(); - -private: - - int type; - - union - { - AutoBuffer *pi; - AutoBuffer *pd; - AutoBuffer *ps; - void *pv; - }; - - DictValue(int _type, void *_p) : type(_type), pv(_p) {} - void release(); -}; - -/** @brief This class implements name-value dictionary, values are instances of DictValue. */ -class CV_EXPORTS Dict -{ - typedef std::map _Dict; - _Dict dict; - -public: - - //! Checks a presence of the @p key in the dictionary. - bool has(const String &key) const; - - //! If the @p key in the dictionary then returns pointer to its value, else returns NULL. - DictValue *ptr(const String &key); - - /** @overload */ - const DictValue *ptr(const String &key) const; - - //! If the @p key in the dictionary then returns its value, else an error will be generated. - const DictValue &get(const String &key) const; - - /** @overload */ - template - T get(const String &key) const; - - //! If the @p key in the dictionary then returns its value, else returns @p defaultValue. - template - T get(const String &key, const T &defaultValue) const; - - //! Sets new @p value for the @p key, or adds new key-value pair into the dictionary. - template - const T &set(const String &key, const T &value); - - //! Erase @p key from the dictionary. - void erase(const String &key); - - friend std::ostream &operator<<(std::ostream &stream, const Dict &dict); - - std::map::const_iterator begin() const; - - std::map::const_iterator end() const; -}; - -//! @} -CV__DNN_EXPERIMENTAL_NS_END -} -} - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.hpp deleted file mode 100644 index 144fc11..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.hpp +++ /dev/null @@ -1,973 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_DNN_HPP -#define OPENCV_DNN_DNN_HPP - -#include -#include - -#if !defined CV_DOXYGEN && !defined CV_DNN_DONT_ADD_EXPERIMENTAL_NS -#define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_34_v11 { -#define CV__DNN_EXPERIMENTAL_NS_END } -namespace cv { namespace dnn { namespace experimental_dnn_34_v11 { } using namespace experimental_dnn_34_v11; }} -#else -#define CV__DNN_EXPERIMENTAL_NS_BEGIN -#define CV__DNN_EXPERIMENTAL_NS_END -#endif - -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN -//! @addtogroup dnn -//! @{ - - typedef std::vector MatShape; - - /** - * @brief Enum of computation backends supported by layers. - * @see Net::setPreferableBackend - */ - enum Backend - { - //! DNN_BACKEND_DEFAULT equals to DNN_BACKEND_INFERENCE_ENGINE if - //! OpenCV is built with Intel's Inference Engine library or - //! DNN_BACKEND_OPENCV otherwise. - DNN_BACKEND_DEFAULT, - DNN_BACKEND_HALIDE, - DNN_BACKEND_INFERENCE_ENGINE, - DNN_BACKEND_OPENCV - }; - - /** - * @brief Enum of target devices for computations. - * @see Net::setPreferableTarget - */ - enum Target - { - DNN_TARGET_CPU, - DNN_TARGET_OPENCL, - DNN_TARGET_OPENCL_FP16, - DNN_TARGET_MYRIAD, - //! FPGA device with CPU fallbacks using Inference Engine's Heterogeneous plugin. - DNN_TARGET_FPGA - }; - - CV_EXPORTS std::vector< std::pair > getAvailableBackends(); - CV_EXPORTS std::vector getAvailableTargets(Backend be); - - /** @brief This class provides all data needed to initialize layer. - * - * It includes dictionary with scalar params (which can be read by using Dict interface), - * blob params #blobs and optional meta information: #name and #type of layer instance. - */ - class CV_EXPORTS LayerParams : public Dict - { - public: - //TODO: Add ability to name blob params - std::vector blobs; //!< List of learned parameters stored as blobs. - - String name; //!< Name of the layer instance (optional, can be used internal purposes). - String type; //!< Type name which was used for creating layer by layer factory (optional). - }; - - /** - * @brief Derivatives of this class encapsulates functions of certain backends. - */ - class BackendNode - { - public: - BackendNode(int backendId); - - virtual ~BackendNode(); //!< Virtual destructor to make polymorphism. - - int backendId; //!< Backend identifier. - }; - - /** - * @brief Derivatives of this class wraps cv::Mat for different backends and targets. - */ - class BackendWrapper - { - public: - BackendWrapper(int backendId, int targetId); - - /** - * @brief Wrap cv::Mat for specific backend and target. - * @param[in] targetId Target identifier. - * @param[in] m cv::Mat for wrapping. - * - * Make CPU->GPU data transfer if it's require for the target. - */ - BackendWrapper(int targetId, const cv::Mat& m); - - /** - * @brief Make wrapper for reused cv::Mat. - * @param[in] base Wrapper of cv::Mat that will be reused. - * @param[in] shape Specific shape. - * - * Initialize wrapper from another one. It'll wrap the same host CPU - * memory and mustn't allocate memory on device(i.e. GPU). It might - * has different shape. Use in case of CPU memory reusing for reuse - * associated memory on device too. - */ - BackendWrapper(const Ptr& base, const MatShape& shape); - - virtual ~BackendWrapper(); //!< Virtual destructor to make polymorphism. - - /** - * @brief Transfer data to CPU host memory. - */ - virtual void copyToHost() = 0; - - /** - * @brief Indicate that an actual data is on CPU. - */ - virtual void setHostDirty() = 0; - - int backendId; //!< Backend identifier. - int targetId; //!< Target identifier. - }; - - class CV_EXPORTS ActivationLayer; - - /** @brief This interface class allows to build new Layers - are building blocks of networks. - * - * Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs. - * Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory "LayerFactory" macros. - */ - class CV_EXPORTS_W Layer : public Algorithm - { - public: - - //! List of learned parameters must be stored here to allow read them by using Net::getParam(). - CV_PROP_RW std::vector blobs; - - /** @brief Computes and sets internal parameters according to inputs, outputs and blobs. - * @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead - * @param[in] input vector of already allocated input blobs - * @param[out] output vector of already allocated output blobs - * - * If this method is called after network has allocated all memory for input and output blobs - * and before inferencing. - */ - CV_DEPRECATED_EXTERNAL - virtual void finalize(const std::vector &input, std::vector &output); - - /** @brief Computes and sets internal parameters according to inputs, outputs and blobs. - * @param[in] inputs vector of already allocated input blobs - * @param[out] outputs vector of already allocated output blobs - * - * If this method is called after network has allocated all memory for input and output blobs - * and before inferencing. - */ - CV_WRAP virtual void finalize(InputArrayOfArrays inputs, OutputArrayOfArrays outputs); - - /** @brief Given the @p input blobs, computes the output @p blobs. - * @deprecated Use Layer::forward(InputArrayOfArrays, OutputArrayOfArrays, OutputArrayOfArrays) instead - * @param[in] input the input blobs. - * @param[out] output allocated output blobs, which will store results of the computation. - * @param[out] internals allocated internal blobs - */ - CV_DEPRECATED_EXTERNAL - virtual void forward(std::vector &input, std::vector &output, std::vector &internals); - - /** @brief Given the @p input blobs, computes the output @p blobs. - * @param[in] inputs the input blobs. - * @param[out] outputs allocated output blobs, which will store results of the computation. - * @param[out] internals allocated internal blobs - */ - virtual void forward(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals); - - /** @brief Given the @p input blobs, computes the output @p blobs. - * @param[in] inputs the input blobs. - * @param[out] outputs allocated output blobs, which will store results of the computation. - * @param[out] internals allocated internal blobs - */ - void forward_fallback(InputArrayOfArrays inputs, OutputArrayOfArrays outputs, OutputArrayOfArrays internals); - - /** @brief - * @overload - * @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead - */ - CV_DEPRECATED_EXTERNAL - void finalize(const std::vector &inputs, CV_OUT std::vector &outputs); - - /** @brief - * @overload - * @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead - */ - CV_DEPRECATED std::vector finalize(const std::vector &inputs); - - /** @brief Allocates layer and computes output. - * @deprecated This method will be removed in the future release. - */ - CV_DEPRECATED CV_WRAP void run(const std::vector &inputs, CV_OUT std::vector &outputs, - CV_IN_OUT std::vector &internals); - - /** @brief Returns index of input blob into the input array. - * @param inputName label of input blob - * - * Each layer input and output can be labeled to easily identify them using "%[.output_name]" notation. - * This method maps label of input blob to its index into input vector. - */ - virtual int inputNameToIndex(String inputName); - /** @brief Returns index of output blob in output array. - * @see inputNameToIndex() - */ - CV_WRAP virtual int outputNameToIndex(const String& outputName); - - /** - * @brief Ask layer if it support specific backend for doing computations. - * @param[in] backendId computation backend identifier. - * @see Backend - */ - virtual bool supportBackend(int backendId); - - /** - * @brief Returns Halide backend node. - * @param[in] inputs Input Halide buffers. - * @see BackendNode, BackendWrapper - * - * Input buffers should be exactly the same that will be used in forward invocations. - * Despite we can use Halide::ImageParam based on input shape only, - * it helps prevent some memory management issues (if something wrong, - * Halide tests will be failed). - */ - virtual Ptr initHalide(const std::vector > &inputs); - - virtual Ptr initInfEngine(const std::vector > &inputs); - - /** - * @brief Automatic Halide scheduling based on layer hyper-parameters. - * @param[in] node Backend node with Halide functions. - * @param[in] inputs Blobs that will be used in forward invocations. - * @param[in] outputs Blobs that will be used in forward invocations. - * @param[in] targetId Target identifier - * @see BackendNode, Target - * - * Layer don't use own Halide::Func members because we can have applied - * layers fusing. In this way the fused function should be scheduled. - */ - virtual void applyHalideScheduler(Ptr& node, - const std::vector &inputs, - const std::vector &outputs, - int targetId) const; - - /** - * @brief Implement layers fusing. - * @param[in] node Backend node of bottom layer. - * @see BackendNode - * - * Actual for graph-based backends. If layer attached successfully, - * returns non-empty cv::Ptr to node of the same backend. - * Fuse only over the last function. - */ - virtual Ptr tryAttach(const Ptr& node); - - /** - * @brief Tries to attach to the layer the subsequent activation layer, i.e. do the layer fusion in a partial case. - * @param[in] layer The subsequent activation layer. - * - * Returns true if the activation layer has been attached successfully. - */ - virtual bool setActivation(const Ptr& layer); - - /** - * @brief Try to fuse current layer with a next one - * @param[in] top Next layer to be fused. - * @returns True if fusion was performed. - */ - virtual bool tryFuse(Ptr& top); - - /** - * @brief Returns parameters of layers with channel-wise multiplication and addition. - * @param[out] scale Channel-wise multipliers. Total number of values should - * be equal to number of channels. - * @param[out] shift Channel-wise offsets. Total number of values should - * be equal to number of channels. - * - * Some layers can fuse their transformations with further layers. - * In example, convolution + batch normalization. This way base layer - * use weights from layer after it. Fused layer is skipped. - * By default, @p scale and @p shift are empty that means layer has no - * element-wise multiplications or additions. - */ - virtual void getScaleShift(Mat& scale, Mat& shift) const; - - /** - * @brief "Deattaches" all the layers, attached to particular layer. - */ - virtual void unsetAttached(); - - virtual bool getMemoryShapes(const std::vector &inputs, - const int requiredOutputs, - std::vector &outputs, - std::vector &internals) const; - virtual int64 getFLOPS(const std::vector &inputs, - const std::vector &outputs) const {CV_UNUSED(inputs); CV_UNUSED(outputs); return 0;} - - CV_PROP String name; //!< Name of the layer instance, can be used for logging or other internal purposes. - CV_PROP String type; //!< Type name which was used for creating layer by layer factory. - CV_PROP int preferableTarget; //!< prefer target for layer forwarding - - Layer(); - explicit Layer(const LayerParams ¶ms); //!< Initializes only #name, #type and #blobs fields. - void setParamsFrom(const LayerParams ¶ms); //!< Initializes only #name, #type and #blobs fields. - virtual ~Layer(); - }; - - /** @brief This class allows to create and manipulate comprehensive artificial neural networks. - * - * Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances, - * and edges specify relationships between layers inputs and outputs. - * - * Each network layer has unique integer id and unique string name inside its network. - * LayerId can store either layer name or layer id. - * - * This class supports reference counting of its instances, i. e. copies point to the same instance. - */ - class CV_EXPORTS_W_SIMPLE Net - { - public: - - CV_WRAP Net(); //!< Default constructor. - CV_WRAP ~Net(); //!< Destructor frees the net only if there aren't references to the net anymore. - - /** @brief Create a network from Intel's Model Optimizer intermediate representation. - * @param[in] xml XML configuration file with network's topology. - * @param[in] bin Binary file with trained weights. - * Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine - * backend. - */ - CV_WRAP static Net readFromModelOptimizer(const String& xml, const String& bin); - - /** Returns true if there are no layers in the network. */ - CV_WRAP bool empty() const; - - /** @brief Adds new layer to the net. - * @param name unique name of the adding layer. - * @param type typename of the adding layer (type must be registered in LayerRegister). - * @param params parameters which will be used to initialize the creating layer. - * @returns unique identifier of created layer, or -1 if a failure will happen. - */ - int addLayer(const String &name, const String &type, LayerParams ¶ms); - /** @brief Adds new layer and connects its first input to the first output of previously added layer. - * @see addLayer() - */ - int addLayerToPrev(const String &name, const String &type, LayerParams ¶ms); - - /** @brief Converts string name of the layer to the integer identifier. - * @returns id of the layer, or -1 if the layer wasn't found. - */ - CV_WRAP int getLayerId(const String &layer); - - CV_WRAP std::vector getLayerNames() const; - - /** @brief Container for strings and integers. */ - typedef DictValue LayerId; - - /** @brief Returns pointer to layer with specified id or name which the network use. */ - CV_WRAP Ptr getLayer(LayerId layerId); - - /** @brief Returns pointers to input layers of specific layer. */ - std::vector > getLayerInputs(LayerId layerId); // FIXIT: CV_WRAP - - /** @brief Connects output of the first layer to input of the second layer. - * @param outPin descriptor of the first layer output. - * @param inpPin descriptor of the second layer input. - * - * Descriptors have the following template <layer_name>[.input_number]: - * - the first part of the template layer_name is sting name of the added layer. - * If this part is empty then the network input pseudo layer will be used; - * - the second optional part of the template input_number - * is either number of the layer input, either label one. - * If this part is omitted then the first layer input will be used. - * - * @see setNetInputs(), Layer::inputNameToIndex(), Layer::outputNameToIndex() - */ - CV_WRAP void connect(String outPin, String inpPin); - - /** @brief Connects #@p outNum output of the first layer to #@p inNum input of the second layer. - * @param outLayerId identifier of the first layer - * @param outNum number of the first layer output - * @param inpLayerId identifier of the second layer - * @param inpNum number of the second layer input - */ - void connect(int outLayerId, int outNum, int inpLayerId, int inpNum); - - /** @brief Sets outputs names of the network input pseudo layer. - * - * Each net always has special own the network input pseudo layer with id=0. - * This layer stores the user blobs only and don't make any computations. - * In fact, this layer provides the only way to pass user data into the network. - * As any other layer, this layer can label its outputs and this function provides an easy way to do this. - */ - CV_WRAP void setInputsNames(const std::vector &inputBlobNames); - - /** @brief Runs forward pass to compute output of layer with name @p outputName. - * @param outputName name for layer which output is needed to get - * @return blob for first output of specified layer. - * @details By default runs forward pass for the whole network. - */ - CV_WRAP Mat forward(const String& outputName = String()); - - /** @brief Runs forward pass to compute output of layer with name @p outputName. - * @param outputBlobs contains all output blobs for specified layer. - * @param outputName name for layer which output is needed to get - * @details If @p outputName is empty, runs forward pass for the whole network. - */ - CV_WRAP void forward(OutputArrayOfArrays outputBlobs, const String& outputName = String()); - - /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames. - * @param outputBlobs contains blobs for first outputs of specified layers. - * @param outBlobNames names for layers which outputs are needed to get - */ - CV_WRAP void forward(OutputArrayOfArrays outputBlobs, - const std::vector& outBlobNames); - - /** @brief Runs forward pass to compute outputs of layers listed in @p outBlobNames. - * @param outputBlobs contains all output blobs for each layer specified in @p outBlobNames. - * @param outBlobNames names for layers which outputs are needed to get - */ - CV_WRAP_AS(forwardAndRetrieve) void forward(CV_OUT std::vector >& outputBlobs, - const std::vector& outBlobNames); - - /** - * @brief Compile Halide layers. - * @param[in] scheduler Path to YAML file with scheduling directives. - * @see setPreferableBackend - * - * Schedule layers that support Halide backend. Then compile them for - * specific target. For layers that not represented in scheduling file - * or if no manual scheduling used at all, automatic scheduling will be applied. - */ - CV_WRAP void setHalideScheduler(const String& scheduler); - - /** - * @brief Ask network to use specific computation backend where it supported. - * @param[in] backendId backend identifier. - * @see Backend - * - * If OpenCV is compiled with Intel's Inference Engine library, DNN_BACKEND_DEFAULT - * means DNN_BACKEND_INFERENCE_ENGINE. Otherwise it equals to DNN_BACKEND_OPENCV. - */ - CV_WRAP void setPreferableBackend(int backendId); - - /** - * @brief Ask network to make computations on specific target device. - * @param[in] targetId target identifier. - * @see Target - * - * List of supported combinations backend / target: - * | | DNN_BACKEND_OPENCV | DNN_BACKEND_INFERENCE_ENGINE | DNN_BACKEND_HALIDE | - * |------------------------|--------------------|------------------------------|--------------------| - * | DNN_TARGET_CPU | + | + | + | - * | DNN_TARGET_OPENCL | + | + | + | - * | DNN_TARGET_OPENCL_FP16 | + | + | | - * | DNN_TARGET_MYRIAD | | + | | - * | DNN_TARGET_FPGA | | + | | - */ - CV_WRAP void setPreferableTarget(int targetId); - - /** @brief Sets the new input value for the network - * @param blob A new blob. Should have CV_32F or CV_8U depth. - * @param name A name of input layer. - * @param scalefactor An optional normalization scale. - * @param mean An optional mean subtraction values. - * @see connect(String, String) to know format of the descriptor. - * - * If scale or mean values are specified, a final input blob is computed - * as: - * \f[input(n,c,h,w) = scalefactor \times (blob(n,c,h,w) - mean_c)\f] - */ - CV_WRAP void setInput(InputArray blob, const String& name = "", - double scalefactor = 1.0, const Scalar& mean = Scalar()); - - /** @brief Sets the new value for the learned param of the layer. - * @param layer name or id of the layer. - * @param numParam index of the layer parameter in the Layer::blobs array. - * @param blob the new value. - * @see Layer::blobs - * @note If shape of the new blob differs from the previous shape, - * then the following forward pass may fail. - */ - CV_WRAP void setParam(LayerId layer, int numParam, const Mat &blob); - - /** @brief Returns parameter blob of the layer. - * @param layer name or id of the layer. - * @param numParam index of the layer parameter in the Layer::blobs array. - * @see Layer::blobs - */ - CV_WRAP Mat getParam(LayerId layer, int numParam = 0); - - /** @brief Returns indexes of layers with unconnected outputs. - */ - CV_WRAP std::vector getUnconnectedOutLayers() const; - - /** @brief Returns names of layers with unconnected outputs. - */ - CV_WRAP std::vector getUnconnectedOutLayersNames() const; - - /** @brief Returns input and output shapes for all layers in loaded model; - * preliminary inferencing isn't necessary. - * @param netInputShapes shapes for all input blobs in net input layer. - * @param layersIds output parameter for layer IDs. - * @param inLayersShapes output parameter for input layers shapes; - * order is the same as in layersIds - * @param outLayersShapes output parameter for output layers shapes; - * order is the same as in layersIds - */ - CV_WRAP void getLayersShapes(const std::vector& netInputShapes, - CV_OUT std::vector& layersIds, - CV_OUT std::vector >& inLayersShapes, - CV_OUT std::vector >& outLayersShapes) const; - - /** @overload */ - CV_WRAP void getLayersShapes(const MatShape& netInputShape, - CV_OUT std::vector& layersIds, - CV_OUT std::vector >& inLayersShapes, - CV_OUT std::vector >& outLayersShapes) const; - - /** @brief Returns input and output shapes for layer with specified - * id in loaded model; preliminary inferencing isn't necessary. - * @param netInputShape shape input blob in net input layer. - * @param layerId id for layer. - * @param inLayerShapes output parameter for input layers shapes; - * order is the same as in layersIds - * @param outLayerShapes output parameter for output layers shapes; - * order is the same as in layersIds - */ - void getLayerShapes(const MatShape& netInputShape, - const int layerId, - CV_OUT std::vector& inLayerShapes, - CV_OUT std::vector& outLayerShapes) const; // FIXIT: CV_WRAP - - /** @overload */ - void getLayerShapes(const std::vector& netInputShapes, - const int layerId, - CV_OUT std::vector& inLayerShapes, - CV_OUT std::vector& outLayerShapes) const; // FIXIT: CV_WRAP - - /** @brief Computes FLOP for whole loaded model with specified input shapes. - * @param netInputShapes vector of shapes for all net inputs. - * @returns computed FLOP. - */ - CV_WRAP int64 getFLOPS(const std::vector& netInputShapes) const; - /** @overload */ - CV_WRAP int64 getFLOPS(const MatShape& netInputShape) const; - /** @overload */ - CV_WRAP int64 getFLOPS(const int layerId, - const std::vector& netInputShapes) const; - /** @overload */ - CV_WRAP int64 getFLOPS(const int layerId, - const MatShape& netInputShape) const; - - /** @brief Returns list of types for layer used in model. - * @param layersTypes output parameter for returning types. - */ - CV_WRAP void getLayerTypes(CV_OUT std::vector& layersTypes) const; - - /** @brief Returns count of layers of specified type. - * @param layerType type. - * @returns count of layers - */ - CV_WRAP int getLayersCount(const String& layerType) const; - - /** @brief Computes bytes number which are required to store - * all weights and intermediate blobs for model. - * @param netInputShapes vector of shapes for all net inputs. - * @param weights output parameter to store resulting bytes for weights. - * @param blobs output parameter to store resulting bytes for intermediate blobs. - */ - void getMemoryConsumption(const std::vector& netInputShapes, - CV_OUT size_t& weights, CV_OUT size_t& blobs) const; // FIXIT: CV_WRAP - /** @overload */ - CV_WRAP void getMemoryConsumption(const MatShape& netInputShape, - CV_OUT size_t& weights, CV_OUT size_t& blobs) const; - /** @overload */ - CV_WRAP void getMemoryConsumption(const int layerId, - const std::vector& netInputShapes, - CV_OUT size_t& weights, CV_OUT size_t& blobs) const; - /** @overload */ - CV_WRAP void getMemoryConsumption(const int layerId, - const MatShape& netInputShape, - CV_OUT size_t& weights, CV_OUT size_t& blobs) const; - - /** @brief Computes bytes number which are required to store - * all weights and intermediate blobs for each layer. - * @param netInputShapes vector of shapes for all net inputs. - * @param layerIds output vector to save layer IDs. - * @param weights output parameter to store resulting bytes for weights. - * @param blobs output parameter to store resulting bytes for intermediate blobs. - */ - void getMemoryConsumption(const std::vector& netInputShapes, - CV_OUT std::vector& layerIds, - CV_OUT std::vector& weights, - CV_OUT std::vector& blobs) const; // FIXIT: CV_WRAP - /** @overload */ - void getMemoryConsumption(const MatShape& netInputShape, - CV_OUT std::vector& layerIds, - CV_OUT std::vector& weights, - CV_OUT std::vector& blobs) const; // FIXIT: CV_WRAP - - /** @brief Enables or disables layer fusion in the network. - * @param fusion true to enable the fusion, false to disable. The fusion is enabled by default. - */ - CV_WRAP void enableFusion(bool fusion); - - /** @brief Returns overall time for inference and timings (in ticks) for layers. - * Indexes in returned vector correspond to layers ids. Some layers can be fused with others, - * in this case zero ticks count will be return for that skipped layers. - * @param timings vector for tick timings for all layers. - * @return overall ticks for model inference. - */ - CV_WRAP int64 getPerfProfile(CV_OUT std::vector& timings); - - private: - struct Impl; - Ptr impl; - }; - - /** @brief Reads a network model stored in Darknet model files. - * @param cfgFile path to the .cfg file with text description of the network architecture. - * @param darknetModel path to the .weights file with learned network. - * @returns Network object that ready to do forward, throw an exception in failure cases. - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromDarknet(const String &cfgFile, const String &darknetModel = String()); - - /** @brief Reads a network model stored in Darknet model files. - * @param bufferCfg A buffer contains a content of .cfg file with text description of the network architecture. - * @param bufferModel A buffer contains a content of .weights file with learned network. - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromDarknet(const std::vector& bufferCfg, - const std::vector& bufferModel = std::vector()); - - /** @brief Reads a network model stored in Darknet model files. - * @param bufferCfg A buffer contains a content of .cfg file with text description of the network architecture. - * @param lenCfg Number of bytes to read from bufferCfg - * @param bufferModel A buffer contains a content of .weights file with learned network. - * @param lenModel Number of bytes to read from bufferModel - * @returns Net object. - */ - CV_EXPORTS Net readNetFromDarknet(const char *bufferCfg, size_t lenCfg, - const char *bufferModel = NULL, size_t lenModel = 0); - - /** @brief Reads a network model stored in Caffe framework's format. - * @param prototxt path to the .prototxt file with text description of the network architecture. - * @param caffeModel path to the .caffemodel file with learned network. - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromCaffe(const String &prototxt, const String &caffeModel = String()); - - /** @brief Reads a network model stored in Caffe model in memory. - * @param bufferProto buffer containing the content of the .prototxt file - * @param bufferModel buffer containing the content of the .caffemodel file - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromCaffe(const std::vector& bufferProto, - const std::vector& bufferModel = std::vector()); - - /** @brief Reads a network model stored in Caffe model in memory. - * @details This is an overloaded member function, provided for convenience. - * It differs from the above function only in what argument(s) it accepts. - * @param bufferProto buffer containing the content of the .prototxt file - * @param lenProto length of bufferProto - * @param bufferModel buffer containing the content of the .caffemodel file - * @param lenModel length of bufferModel - * @returns Net object. - */ - CV_EXPORTS Net readNetFromCaffe(const char *bufferProto, size_t lenProto, - const char *bufferModel = NULL, size_t lenModel = 0); - - /** @brief Reads a network model stored in TensorFlow framework's format. - * @param model path to the .pb file with binary protobuf description of the network architecture - * @param config path to the .pbtxt file that contains text graph definition in protobuf format. - * Resulting Net object is built by text graph using weights from a binary one that - * let us make it more flexible. - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromTensorflow(const String &model, const String &config = String()); - - /** @brief Reads a network model stored in TensorFlow framework's format. - * @param bufferModel buffer containing the content of the pb file - * @param bufferConfig buffer containing the content of the pbtxt file - * @returns Net object. - */ - CV_EXPORTS_W Net readNetFromTensorflow(const std::vector& bufferModel, - const std::vector& bufferConfig = std::vector()); - - /** @brief Reads a network model stored in TensorFlow framework's format. - * @details This is an overloaded member function, provided for convenience. - * It differs from the above function only in what argument(s) it accepts. - * @param bufferModel buffer containing the content of the pb file - * @param lenModel length of bufferModel - * @param bufferConfig buffer containing the content of the pbtxt file - * @param lenConfig length of bufferConfig - */ - CV_EXPORTS Net readNetFromTensorflow(const char *bufferModel, size_t lenModel, - const char *bufferConfig = NULL, size_t lenConfig = 0); - - /** - * @brief Reads a network model stored in Torch7 framework's format. - * @param model path to the file, dumped from Torch by using torch.save() function. - * @param isBinary specifies whether the network was serialized in ascii mode or binary. - * @param evaluate specifies testing phase of network. If true, it's similar to evaluate() method in Torch. - * @returns Net object. - * - * @note Ascii mode of Torch serializer is more preferable, because binary mode extensively use `long` type of C language, - * which has various bit-length on different systems. - * - * The loading file must contain serialized nn.Module object - * with importing network. Try to eliminate a custom objects from serialazing data to avoid importing errors. - * - * List of supported layers (i.e. object instances derived from Torch nn.Module class): - * - nn.Sequential - * - nn.Parallel - * - nn.Concat - * - nn.Linear - * - nn.SpatialConvolution - * - nn.SpatialMaxPooling, nn.SpatialAveragePooling - * - nn.ReLU, nn.TanH, nn.Sigmoid - * - nn.Reshape - * - nn.SoftMax, nn.LogSoftMax - * - * Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported. - */ - CV_EXPORTS_W Net readNetFromTorch(const String &model, bool isBinary = true, bool evaluate = true); - - /** - * @brief Read deep learning network represented in one of the supported formats. - * @param[in] model Binary file contains trained weights. The following file - * extensions are expected for models from different frameworks: - * * `*.caffemodel` (Caffe, http://caffe.berkeleyvision.org/) - * * `*.pb` (TensorFlow, https://www.tensorflow.org/) - * * `*.t7` | `*.net` (Torch, http://torch.ch/) - * * `*.weights` (Darknet, https://pjreddie.com/darknet/) - * * `*.bin` (DLDT, https://software.intel.com/openvino-toolkit) - * @param[in] config Text file contains network configuration. It could be a - * file with the following extensions: - * * `*.prototxt` (Caffe, http://caffe.berkeleyvision.org/) - * * `*.pbtxt` (TensorFlow, https://www.tensorflow.org/) - * * `*.cfg` (Darknet, https://pjreddie.com/darknet/) - * * `*.xml` (DLDT, https://software.intel.com/openvino-toolkit) - * @param[in] framework Explicit framework name tag to determine a format. - * @returns Net object. - * - * This function automatically detects an origin framework of trained model - * and calls an appropriate function such @ref readNetFromCaffe, @ref readNetFromTensorflow, - * @ref readNetFromTorch or @ref readNetFromDarknet. An order of @p model and @p config - * arguments does not matter. - */ - CV_EXPORTS_W Net readNet(const String& model, const String& config = "", const String& framework = ""); - - /** - * @brief Read deep learning network represented in one of the supported formats. - * @details This is an overloaded member function, provided for convenience. - * It differs from the above function only in what argument(s) it accepts. - * @param[in] framework Name of origin framework. - * @param[in] bufferModel A buffer with a content of binary file with weights - * @param[in] bufferConfig A buffer with a content of text file contains network configuration. - * @returns Net object. - */ - CV_EXPORTS_W Net readNet(const String& framework, const std::vector& bufferModel, - const std::vector& bufferConfig = std::vector()); - - /** @brief Loads blob which was serialized as torch.Tensor object of Torch7 framework. - * @warning This function has the same limitations as readNetFromTorch(). - */ - CV_EXPORTS_W Mat readTorchBlob(const String &filename, bool isBinary = true); - - /** @brief Load a network from Intel's Model Optimizer intermediate representation. - * @param[in] xml XML configuration file with network's topology. - * @param[in] bin Binary file with trained weights. - * @returns Net object. - * Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine - * backend. - */ - CV_EXPORTS_W Net readNetFromModelOptimizer(const String &xml, const String &bin); - - /** @brief Reads a network model ONNX. - * @param onnxFile path to the .onnx file with text description of the network architecture. - * @returns Network object that ready to do forward, throw an exception in failure cases. - */ - CV_EXPORTS_W Net readNetFromONNX(const String &onnxFile); - - /** @brief Creates blob from .pb file. - * @param path to the .pb file with input tensor. - * @returns Mat. - */ - CV_EXPORTS_W Mat readTensorFromONNX(const String& path); - - /** @brief Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center, - * subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels. - * @param image input image (with 1-, 3- or 4-channels). - * @param size spatial size for output image - * @param mean scalar with mean values which are subtracted from channels. Values are intended - * to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true. - * @param scalefactor multiplier for @p image values. - * @param swapRB flag which indicates that swap first and last channels - * in 3-channel image is necessary. - * @param crop flag which indicates whether image will be cropped after resize or not - * @param ddepth Depth of output blob. Choose CV_32F or CV_8U. - * @details if @p crop is true, input image is resized so one side after resize is equal to corresponding - * dimension in @p size and another one is equal or larger. Then, crop from the center is performed. - * If @p crop is false, direct resize without cropping and preserving aspect ratio is performed. - * @returns 4-dimensional Mat with NCHW dimensions order. - */ - CV_EXPORTS_W Mat blobFromImage(InputArray image, double scalefactor=1.0, const Size& size = Size(), - const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false, - int ddepth=CV_32F); - - /** @brief Creates 4-dimensional blob from image. - * @details This is an overloaded member function, provided for convenience. - * It differs from the above function only in what argument(s) it accepts. - */ - CV_EXPORTS void blobFromImage(InputArray image, OutputArray blob, double scalefactor=1.0, - const Size& size = Size(), const Scalar& mean = Scalar(), - bool swapRB=false, bool crop=false, int ddepth=CV_32F); - - - /** @brief Creates 4-dimensional blob from series of images. Optionally resizes and - * crops @p images from center, subtract @p mean values, scales values by @p scalefactor, - * swap Blue and Red channels. - * @param images input images (all with 1-, 3- or 4-channels). - * @param size spatial size for output image - * @param mean scalar with mean values which are subtracted from channels. Values are intended - * to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true. - * @param scalefactor multiplier for @p images values. - * @param swapRB flag which indicates that swap first and last channels - * in 3-channel image is necessary. - * @param crop flag which indicates whether image will be cropped after resize or not - * @param ddepth Depth of output blob. Choose CV_32F or CV_8U. - * @details if @p crop is true, input image is resized so one side after resize is equal to corresponding - * dimension in @p size and another one is equal or larger. Then, crop from the center is performed. - * If @p crop is false, direct resize without cropping and preserving aspect ratio is performed. - * @returns 4-dimensional Mat with NCHW dimensions order. - */ - CV_EXPORTS_W Mat blobFromImages(InputArrayOfArrays images, double scalefactor=1.0, - Size size = Size(), const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false, - int ddepth=CV_32F); - - /** @brief Creates 4-dimensional blob from series of images. - * @details This is an overloaded member function, provided for convenience. - * It differs from the above function only in what argument(s) it accepts. - */ - CV_EXPORTS void blobFromImages(InputArrayOfArrays images, OutputArray blob, - double scalefactor=1.0, Size size = Size(), - const Scalar& mean = Scalar(), bool swapRB=false, bool crop=false, - int ddepth=CV_32F); - - /** @brief Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure - * (std::vector). - * @param[in] blob_ 4 dimensional array (images, channels, height, width) in floating point precision (CV_32F) from - * which you would like to extract the images. - * @param[out] images_ array of 2D Mat containing the images extracted from the blob in floating point precision - * (CV_32F). They are non normalized neither mean added. The number of returned images equals the first dimension - * of the blob (batch size). Every image has a number of channels equals to the second dimension of the blob (depth). - */ - CV_EXPORTS_W void imagesFromBlob(const cv::Mat& blob_, OutputArrayOfArrays images_); - - /** @brief Convert all weights of Caffe network to half precision floating point. - * @param src Path to origin model from Caffe framework contains single - * precision floating point weights (usually has `.caffemodel` extension). - * @param dst Path to destination model with updated weights. - * @param layersTypes Set of layers types which parameters will be converted. - * By default, converts only Convolutional and Fully-Connected layers' - * weights. - * - * @note Shrinked model has no origin float32 weights so it can't be used - * in origin Caffe framework anymore. However the structure of data - * is taken from NVidia's Caffe fork: https://github.com/NVIDIA/caffe. - * So the resulting model may be used there. - */ - CV_EXPORTS_W void shrinkCaffeModel(const String& src, const String& dst, - const std::vector& layersTypes = std::vector()); - - /** @brief Create a text representation for a binary network stored in protocol buffer format. - * @param[in] model A path to binary network. - * @param[in] output A path to output text file to be created. - * - * @note To reduce output file size, trained weights are not included. - */ - CV_EXPORTS_W void writeTextGraph(const String& model, const String& output); - - /** @brief Performs non maximum suppression given boxes and corresponding scores. - - * @param bboxes a set of bounding boxes to apply NMS. - * @param scores a set of corresponding confidences. - * @param score_threshold a threshold used to filter boxes by score. - * @param nms_threshold a threshold used in non maximum suppression. - * @param indices the kept indices of bboxes after NMS. - * @param eta a coefficient in adaptive threshold formula: \f$nms\_threshold_{i+1}=eta\cdot nms\_threshold_i\f$. - * @param top_k if `>0`, keep at most @p top_k picked indices. - */ - CV_EXPORTS_W void NMSBoxes(const std::vector& bboxes, const std::vector& scores, - const float score_threshold, const float nms_threshold, - CV_OUT std::vector& indices, - const float eta = 1.f, const int top_k = 0); - - CV_EXPORTS_W void NMSBoxes(const std::vector& bboxes, const std::vector& scores, - const float score_threshold, const float nms_threshold, - CV_OUT std::vector& indices, - const float eta = 1.f, const int top_k = 0); - - CV_EXPORTS_AS(NMSBoxesRotated) void NMSBoxes(const std::vector& bboxes, const std::vector& scores, - const float score_threshold, const float nms_threshold, - CV_OUT std::vector& indices, - const float eta = 1.f, const int top_k = 0); - -//! @} -CV__DNN_EXPERIMENTAL_NS_END -} -} - -#include -#include - -/// @deprecated Include this header directly from application. Automatic inclusion will be removed -#include - -#endif /* OPENCV_DNN_DNN_HPP */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.inl.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.inl.hpp deleted file mode 100644 index 17d4c20..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/dnn.inl.hpp +++ /dev/null @@ -1,395 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_DNN_INL_HPP -#define OPENCV_DNN_DNN_INL_HPP - -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN - -template -DictValue DictValue::arrayInt(TypeIter begin, int size) -{ - DictValue res(Param::INT, new AutoBuffer(size)); - for (int j = 0; j < size; begin++, j++) - (*res.pi)[j] = *begin; - return res; -} - -template -DictValue DictValue::arrayReal(TypeIter begin, int size) -{ - DictValue res(Param::REAL, new AutoBuffer(size)); - for (int j = 0; j < size; begin++, j++) - (*res.pd)[j] = *begin; - return res; -} - -template -DictValue DictValue::arrayString(TypeIter begin, int size) -{ - DictValue res(Param::STRING, new AutoBuffer(size)); - for (int j = 0; j < size; begin++, j++) - (*res.ps)[j] = *begin; - return res; -} - -template<> -inline DictValue DictValue::get(int idx) const -{ - CV_Assert(idx == -1); - return *this; -} - -template<> -inline int64 DictValue::get(int idx) const -{ - CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size())); - idx = (idx == -1) ? 0 : idx; - - if (type == Param::INT) - { - return (*pi)[idx]; - } - else if (type == Param::REAL) - { - double doubleValue = (*pd)[idx]; - - double fracpart, intpart; - fracpart = std::modf(doubleValue, &intpart); - CV_Assert(fracpart == 0.0); - - return (int64)doubleValue; - } - else if (type == Param::STRING) - { - return std::atoi((*ps)[idx].c_str()); - } - else - { - CV_Assert(isInt() || isReal() || isString()); - return 0; - } -} - -template<> -inline int DictValue::get(int idx) const -{ - return (int)get(idx); -} - -inline int DictValue::getIntValue(int idx) const -{ - return (int)get(idx); -} - -template<> -inline unsigned DictValue::get(int idx) const -{ - return (unsigned)get(idx); -} - -template<> -inline bool DictValue::get(int idx) const -{ - return (get(idx) != 0); -} - -template<> -inline double DictValue::get(int idx) const -{ - CV_Assert((idx == -1 && size() == 1) || (idx >= 0 && idx < size())); - idx = (idx == -1) ? 0 : idx; - - if (type == Param::REAL) - { - return (*pd)[idx]; - } - else if (type == Param::INT) - { - return (double)(*pi)[idx]; - } - else if (type == Param::STRING) - { - return std::atof((*ps)[idx].c_str()); - } - else - { - CV_Assert(isReal() || isInt() || isString()); - return 0; - } -} - -inline double DictValue::getRealValue(int idx) const -{ - return get(idx); -} - -template<> -inline float DictValue::get(int idx) const -{ - return (float)get(idx); -} - -template<> -inline String DictValue::get(int idx) const -{ - CV_Assert(isString()); - CV_Assert((idx == -1 && ps->size() == 1) || (idx >= 0 && idx < (int)ps->size())); - return (*ps)[(idx == -1) ? 0 : idx]; -} - - -inline String DictValue::getStringValue(int idx) const -{ - return get(idx); -} - -inline void DictValue::release() -{ - switch (type) - { - case Param::INT: - delete pi; - break; - case Param::STRING: - delete ps; - break; - case Param::REAL: - delete pd; - break; - } -} - -inline DictValue::~DictValue() -{ - release(); -} - -inline DictValue & DictValue::operator=(const DictValue &r) -{ - if (&r == this) - return *this; - - if (r.type == Param::INT) - { - AutoBuffer *tmp = new AutoBuffer(*r.pi); - release(); - pi = tmp; - } - else if (r.type == Param::STRING) - { - AutoBuffer *tmp = new AutoBuffer(*r.ps); - release(); - ps = tmp; - } - else if (r.type == Param::REAL) - { - AutoBuffer *tmp = new AutoBuffer(*r.pd); - release(); - pd = tmp; - } - - type = r.type; - - return *this; -} - -inline DictValue::DictValue(const DictValue &r) -{ - type = r.type; - - if (r.type == Param::INT) - pi = new AutoBuffer(*r.pi); - else if (r.type == Param::STRING) - ps = new AutoBuffer(*r.ps); - else if (r.type == Param::REAL) - pd = new AutoBuffer(*r.pd); -} - -inline bool DictValue::isString() const -{ - return (type == Param::STRING); -} - -inline bool DictValue::isInt() const -{ - return (type == Param::INT); -} - -inline bool DictValue::isReal() const -{ - return (type == Param::REAL || type == Param::INT); -} - -inline int DictValue::size() const -{ - switch (type) - { - case Param::INT: - return (int)pi->size(); - case Param::STRING: - return (int)ps->size(); - case Param::REAL: - return (int)pd->size(); - } -#ifdef __OPENCV_BUILD - CV_Error(Error::StsInternal, ""); -#else - CV_ErrorNoReturn(Error::StsInternal, ""); -#endif -} - -inline std::ostream &operator<<(std::ostream &stream, const DictValue &dictv) -{ - int i; - - if (dictv.isInt()) - { - for (i = 0; i < dictv.size() - 1; i++) - stream << dictv.get(i) << ", "; - stream << dictv.get(i); - } - else if (dictv.isReal()) - { - for (i = 0; i < dictv.size() - 1; i++) - stream << dictv.get(i) << ", "; - stream << dictv.get(i); - } - else if (dictv.isString()) - { - for (i = 0; i < dictv.size() - 1; i++) - stream << "\"" << dictv.get(i) << "\", "; - stream << dictv.get(i); - } - - return stream; -} - -///////////////////////////////////////////////////////////////// - -inline bool Dict::has(const String &key) const -{ - return dict.count(key) != 0; -} - -inline DictValue *Dict::ptr(const String &key) -{ - _Dict::iterator i = dict.find(key); - return (i == dict.end()) ? NULL : &i->second; -} - -inline const DictValue *Dict::ptr(const String &key) const -{ - _Dict::const_iterator i = dict.find(key); - return (i == dict.end()) ? NULL : &i->second; -} - -inline const DictValue &Dict::get(const String &key) const -{ - _Dict::const_iterator i = dict.find(key); - if (i == dict.end()) - CV_Error(Error::StsObjectNotFound, "Required argument \"" + key + "\" not found into dictionary"); - return i->second; -} - -template -inline T Dict::get(const String &key) const -{ - return this->get(key).get(); -} - -template -inline T Dict::get(const String &key, const T &defaultValue) const -{ - _Dict::const_iterator i = dict.find(key); - - if (i != dict.end()) - return i->second.get(); - else - return defaultValue; -} - -template -inline const T &Dict::set(const String &key, const T &value) -{ - _Dict::iterator i = dict.find(key); - - if (i != dict.end()) - i->second = DictValue(value); - else - dict.insert(std::make_pair(key, DictValue(value))); - - return value; -} - -inline void Dict::erase(const String &key) -{ - dict.erase(key); -} - -inline std::ostream &operator<<(std::ostream &stream, const Dict &dict) -{ - Dict::_Dict::const_iterator it; - for (it = dict.dict.begin(); it != dict.dict.end(); it++) - stream << it->first << " : " << it->second << "\n"; - - return stream; -} - -inline std::map::const_iterator Dict::begin() const -{ - return dict.begin(); -} - -inline std::map::const_iterator Dict::end() const -{ - return dict.end(); -} - -CV__DNN_EXPERIMENTAL_NS_END -} -} - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.details.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.details.hpp deleted file mode 100644 index 619514e..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.details.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. -// -#ifndef OPENCV_DNN_LAYER_DETAILS_HPP -#define OPENCV_DNN_LAYER_DETAILS_HPP - -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN - -/** @brief Registers layer constructor in runtime. -* @param type string, containing type name of the layer. -* @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer. -* @details This macros must be placed inside the function code. -*/ -#define CV_DNN_REGISTER_LAYER_FUNC(type, constructorFunc) \ - cv::dnn::LayerFactory::registerLayer(#type, constructorFunc); - -/** @brief Registers layer class in runtime. - * @param type string, containing type name of the layer. - * @param class C++ class, derived from Layer. - * @details This macros must be placed inside the function code. - */ -#define CV_DNN_REGISTER_LAYER_CLASS(type, class) \ - cv::dnn::LayerFactory::registerLayer(#type, cv::dnn::details::_layerDynamicRegisterer); - -/** @brief Registers layer constructor on module load time. -* @param type string, containing type name of the layer. -* @param constructorFunc pointer to the function of type LayerRegister::Constructor, which creates the layer. -* @details This macros must be placed outside the function code. -*/ -#define CV_DNN_REGISTER_LAYER_FUNC_STATIC(type, constructorFunc) \ -static cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, constructorFunc); - -/** @brief Registers layer class on module load time. - * @param type string, containing type name of the layer. - * @param class C++ class, derived from Layer. - * @details This macros must be placed outside the function code. - */ -#define CV_DNN_REGISTER_LAYER_CLASS_STATIC(type, class) \ -Ptr __LayerStaticRegisterer_func_##type(LayerParams ¶ms) \ - { return Ptr(new class(params)); } \ -static cv::dnn::details::_LayerStaticRegisterer __LayerStaticRegisterer_##type(#type, __LayerStaticRegisterer_func_##type); - -namespace details { - -template -Ptr _layerDynamicRegisterer(LayerParams ¶ms) -{ - return Ptr(LayerClass::create(params)); -} - -//allows automatically register created layer on module load time -class _LayerStaticRegisterer -{ - String type; -public: - - _LayerStaticRegisterer(const String &layerType, LayerFactory::Constructor layerConstructor) - { - this->type = layerType; - LayerFactory::registerLayer(layerType, layerConstructor); - } - - ~_LayerStaticRegisterer() - { - LayerFactory::unregisterLayer(type); - } -}; - -} // namespace -CV__DNN_EXPERIMENTAL_NS_END -}} // namespace - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.hpp deleted file mode 100644 index c4712b8..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/layer.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_LAYER_HPP -#define OPENCV_DNN_LAYER_HPP -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN -//! @addtogroup dnn -//! @{ -//! -//! @defgroup dnnLayerFactory Utilities for New Layers Registration -//! @{ - -/** @brief %Layer factory allows to create instances of registered layers. */ -class CV_EXPORTS LayerFactory -{ -public: - - //! Each Layer class must provide this function to the factory - typedef Ptr(*Constructor)(LayerParams ¶ms); - - //! Registers the layer class with typename @p type and specified @p constructor. Thread-safe. - static void registerLayer(const String &type, Constructor constructor); - - //! Unregisters registered layer with specified type name. Thread-safe. - static void unregisterLayer(const String &type); - - /** @brief Creates instance of registered layer. - * @param type type name of creating layer. - * @param params parameters which will be used for layer initialization. - * @note Thread-safe. - */ - static Ptr createLayerInstance(const String &type, LayerParams& params); - -private: - LayerFactory(); -}; - -//! @} -//! @} -CV__DNN_EXPERIMENTAL_NS_END -} -} -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/shape_utils.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/shape_utils.hpp deleted file mode 100644 index b0ed3af..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/shape_utils.hpp +++ /dev/null @@ -1,219 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_DNN_DNN_SHAPE_UTILS_HPP -#define OPENCV_DNN_DNN_SHAPE_UTILS_HPP - -#include -#include // CV_MAX_DIM -#include -#include -#include - -namespace cv { -namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN - -//Slicing - -struct _Range : public cv::Range -{ - _Range(const Range &r) : cv::Range(r) {} - _Range(int start_, int size_ = 1) : cv::Range(start_, start_ + size_) {} -}; - -static inline Mat slice(const Mat &m, const _Range &r0) -{ - Range ranges[CV_MAX_DIM]; - for (int i = 1; i < m.dims; i++) - ranges[i] = Range::all(); - ranges[0] = r0; - return m(&ranges[0]); -} - -static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1) -{ - CV_Assert(m.dims >= 2); - Range ranges[CV_MAX_DIM]; - for (int i = 2; i < m.dims; i++) - ranges[i] = Range::all(); - ranges[0] = r0; - ranges[1] = r1; - return m(&ranges[0]); -} - -static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2) -{ - CV_Assert(m.dims >= 3); - Range ranges[CV_MAX_DIM]; - for (int i = 3; i < m.dims; i++) - ranges[i] = Range::all(); - ranges[0] = r0; - ranges[1] = r1; - ranges[2] = r2; - return m(&ranges[0]); -} - -static inline Mat slice(const Mat &m, const _Range &r0, const _Range &r1, const _Range &r2, const _Range &r3) -{ - CV_Assert(m.dims >= 4); - Range ranges[CV_MAX_DIM]; - for (int i = 4; i < m.dims; i++) - ranges[i] = Range::all(); - ranges[0] = r0; - ranges[1] = r1; - ranges[2] = r2; - ranges[3] = r3; - return m(&ranges[0]); -} - -static inline Mat getPlane(const Mat &m, int n, int cn) -{ - CV_Assert(m.dims > 2); - int sz[CV_MAX_DIM]; - for(int i = 2; i < m.dims; i++) - { - sz[i-2] = m.size.p[i]; - } - return Mat(m.dims - 2, sz, m.type(), (void*)m.ptr(n, cn)); -} - -static inline MatShape shape(const int* dims, const int n) -{ - MatShape shape; - shape.assign(dims, dims + n); - return shape; -} - -static inline MatShape shape(const Mat& mat) -{ - return shape(mat.size.p, mat.dims); -} - -static inline MatShape shape(const MatSize& sz) -{ - return shape(sz.p, sz.dims()); -} - -static inline MatShape shape(const UMat& mat) -{ - return shape(mat.size.p, mat.dims); -} - -namespace {inline bool is_neg(int i) { return i < 0; }} - -static inline MatShape shape(int a0, int a1=-1, int a2=-1, int a3=-1) -{ - int dims[] = {a0, a1, a2, a3}; - MatShape s = shape(dims, 4); - s.erase(std::remove_if(s.begin(), s.end(), is_neg), s.end()); - return s; -} - -static inline int total(const MatShape& shape, int start = -1, int end = -1) -{ - if (start == -1) start = 0; - if (end == -1) end = (int)shape.size(); - - if (shape.empty()) - return 0; - - int elems = 1; - CV_Assert(start <= (int)shape.size() && end <= (int)shape.size() && - start <= end); - for(int i = start; i < end; i++) - { - elems *= shape[i]; - } - return elems; -} - -static inline MatShape concat(const MatShape& a, const MatShape& b) -{ - MatShape c = a; - c.insert(c.end(), b.begin(), b.end()); - - return c; -} - -static inline std::string toString(const MatShape& shape, const String& name = "") -{ - std::ostringstream ss; - if (!name.empty()) - ss << name << ' '; - ss << '['; - for(size_t i = 0, n = shape.size(); i < n; ++i) - ss << ' ' << shape[i]; - ss << " ]"; - return ss.str(); -} -static inline void print(const MatShape& shape, const String& name = "") -{ - std::cout << toString(shape, name) << std::endl; -} -static inline std::ostream& operator<<(std::ostream &out, const MatShape& shape) -{ - out << toString(shape); - return out; -} - -inline int clamp(int ax, int dims) -{ - return ax < 0 ? ax + dims : ax; -} - -inline int clamp(int ax, const MatShape& shape) -{ - return clamp(ax, (int)shape.size()); -} - -inline Range clamp(const Range& r, int axisSize) -{ - Range clamped(std::max(r.start, 0), - r.end > 0 ? std::min(r.end, axisSize) : axisSize + r.end + 1); - CV_Assert_N(clamped.start < clamped.end, clamped.end <= axisSize); - return clamped; -} - -CV__DNN_EXPERIMENTAL_NS_END -} -} -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/dnn/utils/inference_engine.hpp b/qt-correction-tool/pub/opencv/include/opencv2/dnn/utils/inference_engine.hpp deleted file mode 100644 index 0211096..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/dnn/utils/inference_engine.hpp +++ /dev/null @@ -1,43 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. -// -// Copyright (C) 2018-2019, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. - -#ifndef OPENCV_DNN_UTILS_INF_ENGINE_HPP -#define OPENCV_DNN_UTILS_INF_ENGINE_HPP - -#include "../dnn.hpp" - -namespace cv { namespace dnn { -CV__DNN_EXPERIMENTAL_NS_BEGIN - - -/** @brief Release a Myriad device (binded by OpenCV). - * - * Single Myriad device cannot be shared across multiple processes which uses - * Inference Engine's Myriad plugin. - */ -CV_EXPORTS_W void resetMyriadDevice(); - - -/* Values for 'OPENCV_DNN_IE_VPU_TYPE' parameter */ -#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_UNSPECIFIED "" -/// Intel(R) Movidius(TM) Neural Compute Stick, NCS (USB 03e7:2150), Myriad2 (https://software.intel.com/en-us/movidius-ncs) -#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_2 "Myriad2" -/// Intel(R) Neural Compute Stick 2, NCS2 (USB 03e7:2485), MyriadX (https://software.intel.com/ru-ru/neural-compute-stick) -#define CV_DNN_INFERENCE_ENGINE_VPU_TYPE_MYRIAD_X "MyriadX" - - -/** @brief Returns Inference Engine VPU type. - * - * See values of `CV_DNN_INFERENCE_ENGINE_VPU_TYPE_*` macros. - */ -CV_EXPORTS_W cv::String getInferenceEngineVPUType(); - - -CV__DNN_EXPERIMENTAL_NS_END -}} // namespace - -#endif // OPENCV_DNN_UTILS_INF_ENGINE_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/features2d.hpp b/qt-correction-tool/pub/opencv/include/opencv2/features2d.hpp deleted file mode 100644 index ee81ebe..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/features2d.hpp +++ /dev/null @@ -1,1428 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_FEATURES_2D_HPP -#define OPENCV_FEATURES_2D_HPP - -#include "opencv2/opencv_modules.hpp" -#include "opencv2/core.hpp" - -#ifdef HAVE_OPENCV_FLANN -#include "opencv2/flann/miniflann.hpp" -#endif - -/** - @defgroup features2d 2D Features Framework - @{ - @defgroup features2d_main Feature Detection and Description - @defgroup features2d_match Descriptor Matchers - -Matchers of keypoint descriptors in OpenCV have wrappers with a common interface that enables you to -easily switch between different algorithms solving the same problem. This section is devoted to -matching descriptors that are represented as vectors in a multidimensional space. All objects that -implement vector descriptor matchers inherit the DescriptorMatcher interface. - -@note - - An example explaining keypoint matching can be found at - opencv_source_code/samples/cpp/descriptor_extractor_matcher.cpp - - An example on descriptor matching evaluation can be found at - opencv_source_code/samples/cpp/detector_descriptor_matcher_evaluation.cpp - - An example on one to many image matching can be found at - opencv_source_code/samples/cpp/matching_to_many_images.cpp - - @defgroup features2d_draw Drawing Function of Keypoints and Matches - @defgroup features2d_category Object Categorization - -This section describes approaches based on local 2D features and used to categorize objects. - -@note - - A complete Bag-Of-Words sample can be found at - opencv_source_code/samples/cpp/bagofwords_classification.cpp - - (Python) An example using the features2D framework to perform object categorization can be - found at opencv_source_code/samples/python/find_obj.py - - @} - */ - -namespace cv -{ - -//! @addtogroup features2d -//! @{ - -// //! writes vector of keypoints to the file storage -// CV_EXPORTS void write(FileStorage& fs, const String& name, const std::vector& keypoints); -// //! reads vector of keypoints from the specified file storage node -// CV_EXPORTS void read(const FileNode& node, CV_OUT std::vector& keypoints); - -/** @brief A class filters a vector of keypoints. - - Because now it is difficult to provide a convenient interface for all usage scenarios of the - keypoints filter class, it has only several needed by now static methods. - */ -class CV_EXPORTS KeyPointsFilter -{ -public: - KeyPointsFilter(){} - - /* - * Remove keypoints within borderPixels of an image edge. - */ - static void runByImageBorder( std::vector& keypoints, Size imageSize, int borderSize ); - /* - * Remove keypoints of sizes out of range. - */ - static void runByKeypointSize( std::vector& keypoints, float minSize, - float maxSize=FLT_MAX ); - /* - * Remove keypoints from some image by mask for pixels of this image. - */ - static void runByPixelsMask( std::vector& keypoints, const Mat& mask ); - /* - * Remove duplicated keypoints. - */ - static void removeDuplicated( std::vector& keypoints ); - /* - * Remove duplicated keypoints and sort the remaining keypoints - */ - static void removeDuplicatedSorted( std::vector& keypoints ); - - /* - * Retain the specified number of the best keypoints (according to the response) - */ - static void retainBest( std::vector& keypoints, int npoints ); -}; - - -/************************************ Base Classes ************************************/ - -/** @brief Abstract base class for 2D image feature detectors and descriptor extractors -*/ -#ifdef __EMSCRIPTEN__ -class CV_EXPORTS_W Feature2D : public Algorithm -#else -class CV_EXPORTS_W Feature2D : public virtual Algorithm -#endif -{ -public: - virtual ~Feature2D(); - - /** @brief Detects keypoints in an image (first variant) or image set (second variant). - - @param image Image. - @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set - of keypoints detected in images[i] . - @param mask Mask specifying where to look for keypoints (optional). It must be a 8-bit integer - matrix with non-zero values in the region of interest. - */ - CV_WRAP virtual void detect( InputArray image, - CV_OUT std::vector& keypoints, - InputArray mask=noArray() ); - - /** @overload - @param images Image set. - @param keypoints The detected keypoints. In the second variant of the method keypoints[i] is a set - of keypoints detected in images[i] . - @param masks Masks for each input image specifying where to look for keypoints (optional). - masks[i] is a mask for images[i]. - */ - CV_WRAP virtual void detect( InputArrayOfArrays images, - CV_OUT std::vector >& keypoints, - InputArrayOfArrays masks=noArray() ); - - /** @brief Computes the descriptors for a set of keypoints detected in an image (first variant) or image set - (second variant). - - @param image Image. - @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be - computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint - with several dominant orientations (for each orientation). - @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are - descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the - descriptor for keypoint j-th keypoint. - */ - CV_WRAP virtual void compute( InputArray image, - CV_OUT CV_IN_OUT std::vector& keypoints, - OutputArray descriptors ); - - /** @overload - - @param images Image set. - @param keypoints Input collection of keypoints. Keypoints for which a descriptor cannot be - computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint - with several dominant orientations (for each orientation). - @param descriptors Computed descriptors. In the second variant of the method descriptors[i] are - descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the - descriptor for keypoint j-th keypoint. - */ - CV_WRAP virtual void compute( InputArrayOfArrays images, - CV_OUT CV_IN_OUT std::vector >& keypoints, - OutputArrayOfArrays descriptors ); - - /** Detects keypoints and computes the descriptors */ - CV_WRAP virtual void detectAndCompute( InputArray image, InputArray mask, - CV_OUT std::vector& keypoints, - OutputArray descriptors, - bool useProvidedKeypoints=false ); - - CV_WRAP virtual int descriptorSize() const; - CV_WRAP virtual int descriptorType() const; - CV_WRAP virtual int defaultNorm() const; - - CV_WRAP void write( const String& fileName ) const; - - CV_WRAP void read( const String& fileName ); - - virtual void write( FileStorage&) const CV_OVERRIDE; - - // see corresponding cv::Algorithm method - CV_WRAP virtual void read( const FileNode&) CV_OVERRIDE; - - //! Return true if detector object is empty - CV_WRAP virtual bool empty() const CV_OVERRIDE; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; - - // see corresponding cv::Algorithm method - CV_WRAP inline void write(const Ptr& fs, const String& name = String()) const { Algorithm::write(fs, name); } -}; - -/** Feature detectors in OpenCV have wrappers with a common interface that enables you to easily switch -between different algorithms solving the same problem. All objects that implement keypoint detectors -inherit the FeatureDetector interface. */ -typedef Feature2D FeatureDetector; - -/** Extractors of keypoint descriptors in OpenCV have wrappers with a common interface that enables you -to easily switch between different algorithms solving the same problem. This section is devoted to -computing descriptors represented as vectors in a multidimensional space. All objects that implement -the vector descriptor extractors inherit the DescriptorExtractor interface. - */ -typedef Feature2D DescriptorExtractor; - -//! @addtogroup features2d_main -//! @{ - -/** @brief Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 . - */ -class CV_EXPORTS_W BRISK : public Feature2D -{ -public: - /** @brief The BRISK constructor - - @param thresh AGAST detection threshold score. - @param octaves detection octaves. Use 0 to do single scale. - @param patternScale apply this scale to the pattern used for sampling the neighbourhood of a - keypoint. - */ - CV_WRAP static Ptr create(int thresh=30, int octaves=3, float patternScale=1.0f); - - /** @brief The BRISK constructor for a custom pattern - - @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for - keypoint scale 1). - @param numberList defines the number of sampling points on the sampling circle. Must be the same - size as radiusList.. - @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint - scale 1). - @param dMin threshold for the long pairings used for orientation determination (in pixels for - keypoint scale 1). - @param indexChange index remapping of the bits. */ - CV_WRAP static Ptr create(const std::vector &radiusList, const std::vector &numberList, - float dMax=5.85f, float dMin=8.2f, const std::vector& indexChange=std::vector()); - - /** @brief The BRISK constructor for a custom pattern, detection threshold and octaves - - @param thresh AGAST detection threshold score. - @param octaves detection octaves. Use 0 to do single scale. - @param radiusList defines the radii (in pixels) where the samples around a keypoint are taken (for - keypoint scale 1). - @param numberList defines the number of sampling points on the sampling circle. Must be the same - size as radiusList.. - @param dMax threshold for the short pairings used for descriptor formation (in pixels for keypoint - scale 1). - @param dMin threshold for the long pairings used for orientation determination (in pixels for - keypoint scale 1). - @param indexChange index remapping of the bits. */ - CV_WRAP static Ptr create(int thresh, int octaves, const std::vector &radiusList, - const std::vector &numberList, float dMax=5.85f, float dMin=8.2f, - const std::vector& indexChange=std::vector()); - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @brief Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor - -described in @cite RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, selects -the strongest features using FAST or Harris response, finds their orientation using first-order -moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or -k-tuples) are rotated according to the measured orientation). - */ -class CV_EXPORTS_W ORB : public Feature2D -{ -public: - enum { kBytes = 32, HARRIS_SCORE=0, FAST_SCORE=1 }; - - /** @brief The ORB constructor - - @param nfeatures The maximum number of features to retain. - @param scaleFactor Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical - pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor - will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor - will mean that to cover certain scale range you will need more pyramid levels and so the speed - will suffer. - @param nlevels The number of pyramid levels. The smallest level will have linear size equal to - input_image_linear_size/pow(scaleFactor, nlevels - firstLevel). - @param edgeThreshold This is size of the border where the features are not detected. It should - roughly match the patchSize parameter. - @param firstLevel The level of pyramid to put source image to. Previous layers are filled - with upscaled source image. - @param WTA_K The number of points that produce each element of the oriented BRIEF descriptor. The - default value 2 means the BRIEF where we take a random point pair and compare their brightnesses, - so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3 - random points (of course, those point coordinates are random, but they are generated from the - pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel - rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such - output will occupy 2 bits, and therefore it will need a special variant of Hamming distance, - denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each - bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3). - @param scoreType The default HARRIS_SCORE means that Harris algorithm is used to rank features - (the score is written to KeyPoint::score and is used to retain best nfeatures features); - FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints, - but it is a little faster to compute. - @param patchSize size of the patch used by the oriented BRIEF descriptor. Of course, on smaller - pyramid layers the perceived image area covered by a feature will be larger. - @param fastThreshold - */ - CV_WRAP static Ptr create(int nfeatures=500, float scaleFactor=1.2f, int nlevels=8, int edgeThreshold=31, - int firstLevel=0, int WTA_K=2, int scoreType=ORB::HARRIS_SCORE, int patchSize=31, int fastThreshold=20); - - CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0; - CV_WRAP virtual int getMaxFeatures() const = 0; - - CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0; - CV_WRAP virtual double getScaleFactor() const = 0; - - CV_WRAP virtual void setNLevels(int nlevels) = 0; - CV_WRAP virtual int getNLevels() const = 0; - - CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0; - CV_WRAP virtual int getEdgeThreshold() const = 0; - - CV_WRAP virtual void setFirstLevel(int firstLevel) = 0; - CV_WRAP virtual int getFirstLevel() const = 0; - - CV_WRAP virtual void setWTA_K(int wta_k) = 0; - CV_WRAP virtual int getWTA_K() const = 0; - - CV_WRAP virtual void setScoreType(int scoreType) = 0; - CV_WRAP virtual int getScoreType() const = 0; - - CV_WRAP virtual void setPatchSize(int patchSize) = 0; - CV_WRAP virtual int getPatchSize() const = 0; - - CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0; - CV_WRAP virtual int getFastThreshold() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @brief Maximally stable extremal region extractor - -The class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki -article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)). - -- there are two different implementation of %MSER: one for grey image, one for color image - -- the grey image algorithm is taken from: @cite nister2008linear ; the paper claims to be faster -than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop. - -- the color image algorithm is taken from: @cite forssen2007maximally ; it should be much slower -than grey image method ( 3~4 times ); the chi_table.h file is taken directly from paper's source -code which is distributed under GPL. - -- (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py -*/ -class CV_EXPORTS_W MSER : public Feature2D -{ -public: - /** @brief Full consturctor for %MSER detector - - @param _delta it compares \f$(size_{i}-size_{i-delta})/size_{i-delta}\f$ - @param _min_area prune the area which smaller than minArea - @param _max_area prune the area which bigger than maxArea - @param _max_variation prune the area have similar size to its children - @param _min_diversity for color image, trace back to cut off mser with diversity less than min_diversity - @param _max_evolution for color image, the evolution steps - @param _area_threshold for color image, the area threshold to cause re-initialize - @param _min_margin for color image, ignore too small margin - @param _edge_blur_size for color image, the aperture size for edge blur - */ - CV_WRAP static Ptr create( int _delta=5, int _min_area=60, int _max_area=14400, - double _max_variation=0.25, double _min_diversity=.2, - int _max_evolution=200, double _area_threshold=1.01, - double _min_margin=0.003, int _edge_blur_size=5 ); - - /** @brief Detect %MSER regions - - @param image input image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3) - @param msers resulting list of point sets - @param bboxes resulting bounding boxes - */ - CV_WRAP virtual void detectRegions( InputArray image, - CV_OUT std::vector >& msers, - CV_OUT std::vector& bboxes ) = 0; - - CV_WRAP virtual void setDelta(int delta) = 0; - CV_WRAP virtual int getDelta() const = 0; - - CV_WRAP virtual void setMinArea(int minArea) = 0; - CV_WRAP virtual int getMinArea() const = 0; - - CV_WRAP virtual void setMaxArea(int maxArea) = 0; - CV_WRAP virtual int getMaxArea() const = 0; - - CV_WRAP virtual void setPass2Only(bool f) = 0; - CV_WRAP virtual bool getPass2Only() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @overload */ -CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression=true ); - -/** @brief Detects corners using the FAST algorithm - -@param image grayscale image where keypoints (corners) are detected. -@param keypoints keypoints detected on the image. -@param threshold threshold on difference between intensity of the central pixel and pixels of a -circle around this pixel. -@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners -(keypoints). -@param type one of the three neighborhoods as defined in the paper: -FastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12, -FastFeatureDetector::TYPE_5_8 - -Detects corners using the FAST algorithm by @cite Rosten06 . - -@note In Python API, types are given as cv2.FAST_FEATURE_DETECTOR_TYPE_5_8, -cv2.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv2.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner -detection, use cv2.FAST.detect() method. - */ -CV_EXPORTS void FAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression, int type ); - -//! @} features2d_main - -//! @addtogroup features2d_main -//! @{ - -/** @brief Wrapping class for feature detection using the FAST method. : - */ -class CV_EXPORTS_W FastFeatureDetector : public Feature2D -{ -public: - enum - { - TYPE_5_8 = 0, TYPE_7_12 = 1, TYPE_9_16 = 2, - THRESHOLD = 10000, NONMAX_SUPPRESSION=10001, FAST_N=10002, - }; - - CV_WRAP static Ptr create( int threshold=10, - bool nonmaxSuppression=true, - int type=FastFeatureDetector::TYPE_9_16 ); - - CV_WRAP virtual void setThreshold(int threshold) = 0; - CV_WRAP virtual int getThreshold() const = 0; - - CV_WRAP virtual void setNonmaxSuppression(bool f) = 0; - CV_WRAP virtual bool getNonmaxSuppression() const = 0; - - CV_WRAP virtual void setType(int type) = 0; - CV_WRAP virtual int getType() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @overload */ -CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression=true ); - -/** @brief Detects corners using the AGAST algorithm - -@param image grayscale image where keypoints (corners) are detected. -@param keypoints keypoints detected on the image. -@param threshold threshold on difference between intensity of the central pixel and pixels of a -circle around this pixel. -@param nonmaxSuppression if true, non-maximum suppression is applied to detected corners -(keypoints). -@param type one of the four neighborhoods as defined in the paper: -AgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d, -AgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16 - -For non-Intel platforms, there is a tree optimised variant of AGAST with same numerical results. -The 32-bit binary tree tables were generated automatically from original code using perl script. -The perl script and examples of tree generation are placed in features2d/doc folder. -Detects corners using the AGAST algorithm by @cite mair2010_agast . - - */ -CV_EXPORTS void AGAST( InputArray image, CV_OUT std::vector& keypoints, - int threshold, bool nonmaxSuppression, int type ); -//! @} features2d_main - -//! @addtogroup features2d_main -//! @{ - -/** @brief Wrapping class for feature detection using the AGAST method. : - */ -class CV_EXPORTS_W AgastFeatureDetector : public Feature2D -{ -public: - enum - { - AGAST_5_8 = 0, AGAST_7_12d = 1, AGAST_7_12s = 2, OAST_9_16 = 3, - THRESHOLD = 10000, NONMAX_SUPPRESSION = 10001, - }; - - CV_WRAP static Ptr create( int threshold=10, - bool nonmaxSuppression=true, - int type=AgastFeatureDetector::OAST_9_16 ); - - CV_WRAP virtual void setThreshold(int threshold) = 0; - CV_WRAP virtual int getThreshold() const = 0; - - CV_WRAP virtual void setNonmaxSuppression(bool f) = 0; - CV_WRAP virtual bool getNonmaxSuppression() const = 0; - - CV_WRAP virtual void setType(int type) = 0; - CV_WRAP virtual int getType() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @brief Wrapping class for feature detection using the goodFeaturesToTrack function. : - */ -class CV_EXPORTS_W GFTTDetector : public Feature2D -{ -public: - CV_WRAP static Ptr create( int maxCorners=1000, double qualityLevel=0.01, double minDistance=1, - int blockSize=3, bool useHarrisDetector=false, double k=0.04 ); - CV_WRAP static Ptr create( int maxCorners, double qualityLevel, double minDistance, - int blockSize, int gradiantSize, bool useHarrisDetector=false, double k=0.04 ); - CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0; - CV_WRAP virtual int getMaxFeatures() const = 0; - - CV_WRAP virtual void setQualityLevel(double qlevel) = 0; - CV_WRAP virtual double getQualityLevel() const = 0; - - CV_WRAP virtual void setMinDistance(double minDistance) = 0; - CV_WRAP virtual double getMinDistance() const = 0; - - CV_WRAP virtual void setBlockSize(int blockSize) = 0; - CV_WRAP virtual int getBlockSize() const = 0; - - CV_WRAP virtual void setHarrisDetector(bool val) = 0; - CV_WRAP virtual bool getHarrisDetector() const = 0; - - CV_WRAP virtual void setK(double k) = 0; - CV_WRAP virtual double getK() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @brief Class for extracting blobs from an image. : - -The class implements a simple algorithm for extracting blobs from an image: - -1. Convert the source image to binary images by applying thresholding with several thresholds from - minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between - neighboring thresholds. -2. Extract connected components from every binary image by findContours and calculate their - centers. -3. Group centers from several binary images by their coordinates. Close centers form one group that - corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter. -4. From the groups, estimate final centers of blobs and their radiuses and return as locations and - sizes of keypoints. - -This class performs several filtrations of returned blobs. You should set filterBy\* to true/false -to turn on/off corresponding filtration. Available filtrations: - -- **By color**. This filter compares the intensity of a binary image at the center of a blob to -blobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs -and blobColor = 255 to extract light blobs. -- **By area**. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive). -- **By circularity**. Extracted blobs have circularity -(\f$\frac{4*\pi*Area}{perimeter * perimeter}\f$) between minCircularity (inclusive) and -maxCircularity (exclusive). -- **By ratio of the minimum inertia to maximum inertia**. Extracted blobs have this ratio -between minInertiaRatio (inclusive) and maxInertiaRatio (exclusive). -- **By convexity**. Extracted blobs have convexity (area / area of blob convex hull) between -minConvexity (inclusive) and maxConvexity (exclusive). - -Default values of parameters are tuned to extract dark circular blobs. - */ -class CV_EXPORTS_W SimpleBlobDetector : public Feature2D -{ -public: - struct CV_EXPORTS_W_SIMPLE Params - { - CV_WRAP Params(); - CV_PROP_RW float thresholdStep; - CV_PROP_RW float minThreshold; - CV_PROP_RW float maxThreshold; - CV_PROP_RW size_t minRepeatability; - CV_PROP_RW float minDistBetweenBlobs; - - CV_PROP_RW bool filterByColor; - CV_PROP_RW uchar blobColor; - - CV_PROP_RW bool filterByArea; - CV_PROP_RW float minArea, maxArea; - - CV_PROP_RW bool filterByCircularity; - CV_PROP_RW float minCircularity, maxCircularity; - - CV_PROP_RW bool filterByInertia; - CV_PROP_RW float minInertiaRatio, maxInertiaRatio; - - CV_PROP_RW bool filterByConvexity; - CV_PROP_RW float minConvexity, maxConvexity; - - void read( const FileNode& fn ); - void write( FileStorage& fs ) const; - }; - - CV_WRAP static Ptr - create(const SimpleBlobDetector::Params ¶meters = SimpleBlobDetector::Params()); - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -//! @} features2d_main - -//! @addtogroup features2d_main -//! @{ - -/** @brief Class implementing the KAZE keypoint detector and descriptor extractor, described in @cite ABD12 . - -@note AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo -F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision -(ECCV), Fiorenze, Italy, October 2012. -*/ -class CV_EXPORTS_W KAZE : public Feature2D -{ -public: - enum - { - DIFF_PM_G1 = 0, - DIFF_PM_G2 = 1, - DIFF_WEICKERT = 2, - DIFF_CHARBONNIER = 3 - }; - - /** @brief The KAZE constructor - - @param extended Set to enable extraction of extended (128-byte) descriptor. - @param upright Set to enable use of upright descriptors (non rotation-invariant). - @param threshold Detector response threshold to accept point - @param nOctaves Maximum octave evolution of the image - @param nOctaveLayers Default number of sublevels per scale level - @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or - DIFF_CHARBONNIER - */ - CV_WRAP static Ptr create(bool extended=false, bool upright=false, - float threshold = 0.001f, - int nOctaves = 4, int nOctaveLayers = 4, - int diffusivity = KAZE::DIFF_PM_G2); - - CV_WRAP virtual void setExtended(bool extended) = 0; - CV_WRAP virtual bool getExtended() const = 0; - - CV_WRAP virtual void setUpright(bool upright) = 0; - CV_WRAP virtual bool getUpright() const = 0; - - CV_WRAP virtual void setThreshold(double threshold) = 0; - CV_WRAP virtual double getThreshold() const = 0; - - CV_WRAP virtual void setNOctaves(int octaves) = 0; - CV_WRAP virtual int getNOctaves() const = 0; - - CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0; - CV_WRAP virtual int getNOctaveLayers() const = 0; - - CV_WRAP virtual void setDiffusivity(int diff) = 0; - CV_WRAP virtual int getDiffusivity() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -/** @brief Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13. - -@details AKAZE descriptors can only be used with KAZE or AKAZE keypoints. This class is thread-safe. - -@note When you need descriptors use Feature2D::detectAndCompute, which -provides better performance. When using Feature2D::detect followed by -Feature2D::compute scale space pyramid is computed twice. - -@note AKAZE implements T-API. When image is passed as UMat some parts of the algorithm -will use OpenCL. - -@note [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear -Scale Spaces. Pablo F. Alcantarilla, Jesús Nuevo and Adrien Bartoli. In -British Machine Vision Conference (BMVC), Bristol, UK, September 2013. - -*/ -class CV_EXPORTS_W AKAZE : public Feature2D -{ -public: - // AKAZE descriptor type - enum - { - DESCRIPTOR_KAZE_UPRIGHT = 2, ///< Upright descriptors, not invariant to rotation - DESCRIPTOR_KAZE = 3, - DESCRIPTOR_MLDB_UPRIGHT = 4, ///< Upright descriptors, not invariant to rotation - DESCRIPTOR_MLDB = 5 - }; - - /** @brief The AKAZE constructor - - @param descriptor_type Type of the extracted descriptor: DESCRIPTOR_KAZE, - DESCRIPTOR_KAZE_UPRIGHT, DESCRIPTOR_MLDB or DESCRIPTOR_MLDB_UPRIGHT. - @param descriptor_size Size of the descriptor in bits. 0 -\> Full size - @param descriptor_channels Number of channels in the descriptor (1, 2, 3) - @param threshold Detector response threshold to accept point - @param nOctaves Maximum octave evolution of the image - @param nOctaveLayers Default number of sublevels per scale level - @param diffusivity Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or - DIFF_CHARBONNIER - */ - CV_WRAP static Ptr create(int descriptor_type=AKAZE::DESCRIPTOR_MLDB, - int descriptor_size = 0, int descriptor_channels = 3, - float threshold = 0.001f, int nOctaves = 4, - int nOctaveLayers = 4, int diffusivity = KAZE::DIFF_PM_G2); - - CV_WRAP virtual void setDescriptorType(int dtype) = 0; - CV_WRAP virtual int getDescriptorType() const = 0; - - CV_WRAP virtual void setDescriptorSize(int dsize) = 0; - CV_WRAP virtual int getDescriptorSize() const = 0; - - CV_WRAP virtual void setDescriptorChannels(int dch) = 0; - CV_WRAP virtual int getDescriptorChannels() const = 0; - - CV_WRAP virtual void setThreshold(double threshold) = 0; - CV_WRAP virtual double getThreshold() const = 0; - - CV_WRAP virtual void setNOctaves(int octaves) = 0; - CV_WRAP virtual int getNOctaves() const = 0; - - CV_WRAP virtual void setNOctaveLayers(int octaveLayers) = 0; - CV_WRAP virtual int getNOctaveLayers() const = 0; - - CV_WRAP virtual void setDiffusivity(int diff) = 0; - CV_WRAP virtual int getDiffusivity() const = 0; - CV_WRAP virtual String getDefaultName() const CV_OVERRIDE; -}; - -//! @} features2d_main - -/****************************************************************************************\ -* Distance * -\****************************************************************************************/ - -template -struct CV_EXPORTS Accumulator -{ - typedef T Type; -}; - -template<> struct Accumulator { typedef float Type; }; -template<> struct Accumulator { typedef float Type; }; -template<> struct Accumulator { typedef float Type; }; -template<> struct Accumulator { typedef float Type; }; - -/* - * Squared Euclidean distance functor - */ -template -struct CV_EXPORTS SL2 -{ - enum { normType = NORM_L2SQR }; - typedef T ValueType; - typedef typename Accumulator::Type ResultType; - - ResultType operator()( const T* a, const T* b, int size ) const - { - return normL2Sqr(a, b, size); - } -}; - -/* - * Euclidean distance functor - */ -template -struct L2 -{ - enum { normType = NORM_L2 }; - typedef T ValueType; - typedef typename Accumulator::Type ResultType; - - ResultType operator()( const T* a, const T* b, int size ) const - { - return (ResultType)std::sqrt((double)normL2Sqr(a, b, size)); - } -}; - -/* - * Manhattan distance (city block distance) functor - */ -template -struct L1 -{ - enum { normType = NORM_L1 }; - typedef T ValueType; - typedef typename Accumulator::Type ResultType; - - ResultType operator()( const T* a, const T* b, int size ) const - { - return normL1(a, b, size); - } -}; - -/****************************************************************************************\ -* DescriptorMatcher * -\****************************************************************************************/ - -//! @addtogroup features2d_match -//! @{ - -/** @brief Abstract base class for matching keypoint descriptors. - -It has two groups of match methods: for matching descriptors of an image with another image or with -an image set. - */ -class CV_EXPORTS_W DescriptorMatcher : public Algorithm -{ -public: - enum - { - FLANNBASED = 1, - BRUTEFORCE = 2, - BRUTEFORCE_L1 = 3, - BRUTEFORCE_HAMMING = 4, - BRUTEFORCE_HAMMINGLUT = 5, - BRUTEFORCE_SL2 = 6 - }; - virtual ~DescriptorMatcher(); - - /** @brief Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor - collection. - - If the collection is not empty, the new descriptors are added to existing train descriptors. - - @param descriptors Descriptors to add. Each descriptors[i] is a set of descriptors from the same - train image. - */ - CV_WRAP virtual void add( InputArrayOfArrays descriptors ); - - /** @brief Returns a constant link to the train descriptor collection trainDescCollection . - */ - CV_WRAP const std::vector& getTrainDescriptors() const; - - /** @brief Clears the train descriptor collections. - */ - CV_WRAP virtual void clear() CV_OVERRIDE; - - /** @brief Returns true if there are no train descriptors in the both collections. - */ - CV_WRAP virtual bool empty() const CV_OVERRIDE; - - /** @brief Returns true if the descriptor matcher supports masking permissible matches. - */ - CV_WRAP virtual bool isMaskSupported() const = 0; - - /** @brief Trains a descriptor matcher - - Trains a descriptor matcher (for example, the flann index). In all methods to match, the method - train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher) - have an empty implementation of this method. Other matchers really train their inner structures (for - example, FlannBasedMatcher trains flann::Index ). - */ - CV_WRAP virtual void train(); - - /** @brief Finds the best match for each descriptor from a query set. - - @param queryDescriptors Query set of descriptors. - @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors - collection stored in the class object. - @param matches Matches. If a query descriptor is masked out in mask , no match is added for this - descriptor. So, matches size may be smaller than the query descriptors count. - @param mask Mask specifying permissible matches between an input query and train matrices of - descriptors. - - In the first variant of this method, the train descriptors are passed as an input argument. In the - second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is - used. Optional mask (or masks) can be passed to specify which query and training descriptors can be - matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if - mask.at\(i,j) is non-zero. - */ - CV_WRAP void match( InputArray queryDescriptors, InputArray trainDescriptors, - CV_OUT std::vector& matches, InputArray mask=noArray() ) const; - - /** @brief Finds the k best matches for each descriptor from a query set. - - @param queryDescriptors Query set of descriptors. - @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors - collection stored in the class object. - @param mask Mask specifying permissible matches between an input query and train matrices of - descriptors. - @param matches Matches. Each matches[i] is k or less matches for the same query descriptor. - @param k Count of best matches found per each query descriptor or less if a query descriptor has - less than k possible matches in total. - @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is - false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, - the matches vector does not contain matches for fully masked-out query descriptors. - - These extended variants of DescriptorMatcher::match methods find several best matches for each query - descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match - for the details about query and train descriptors. - */ - CV_WRAP void knnMatch( InputArray queryDescriptors, InputArray trainDescriptors, - CV_OUT std::vector >& matches, int k, - InputArray mask=noArray(), bool compactResult=false ) const; - - /** @brief For each query descriptor, finds the training descriptors not farther than the specified distance. - - @param queryDescriptors Query set of descriptors. - @param trainDescriptors Train set of descriptors. This set is not added to the train descriptors - collection stored in the class object. - @param matches Found matches. - @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is - false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, - the matches vector does not contain matches for fully masked-out query descriptors. - @param maxDistance Threshold for the distance between matched descriptors. Distance means here - metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured - in Pixels)! - @param mask Mask specifying permissible matches between an input query and train matrices of - descriptors. - - For each query descriptor, the methods find such training descriptors that the distance between the - query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are - returned in the distance increasing order. - */ - CV_WRAP void radiusMatch( InputArray queryDescriptors, InputArray trainDescriptors, - CV_OUT std::vector >& matches, float maxDistance, - InputArray mask=noArray(), bool compactResult=false ) const; - - /** @overload - @param queryDescriptors Query set of descriptors. - @param matches Matches. If a query descriptor is masked out in mask , no match is added for this - descriptor. So, matches size may be smaller than the query descriptors count. - @param masks Set of masks. Each masks[i] specifies permissible matches between the input query - descriptors and stored train descriptors from the i-th image trainDescCollection[i]. - */ - CV_WRAP void match( InputArray queryDescriptors, CV_OUT std::vector& matches, - InputArrayOfArrays masks=noArray() ); - /** @overload - @param queryDescriptors Query set of descriptors. - @param matches Matches. Each matches[i] is k or less matches for the same query descriptor. - @param k Count of best matches found per each query descriptor or less if a query descriptor has - less than k possible matches in total. - @param masks Set of masks. Each masks[i] specifies permissible matches between the input query - descriptors and stored train descriptors from the i-th image trainDescCollection[i]. - @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is - false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, - the matches vector does not contain matches for fully masked-out query descriptors. - */ - CV_WRAP void knnMatch( InputArray queryDescriptors, CV_OUT std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); - /** @overload - @param queryDescriptors Query set of descriptors. - @param matches Found matches. - @param maxDistance Threshold for the distance between matched descriptors. Distance means here - metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured - in Pixels)! - @param masks Set of masks. Each masks[i] specifies permissible matches between the input query - descriptors and stored train descriptors from the i-th image trainDescCollection[i]. - @param compactResult Parameter used when the mask (or masks) is not empty. If compactResult is - false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, - the matches vector does not contain matches for fully masked-out query descriptors. - */ - CV_WRAP void radiusMatch( InputArray queryDescriptors, CV_OUT std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ); - - - CV_WRAP void write( const String& fileName ) const - { - FileStorage fs(fileName, FileStorage::WRITE); - write(fs); - } - - CV_WRAP void read( const String& fileName ) - { - FileStorage fs(fileName, FileStorage::READ); - read(fs.root()); - } - // Reads matcher object from a file node - // see corresponding cv::Algorithm method - CV_WRAP virtual void read( const FileNode& ) CV_OVERRIDE; - // Writes matcher object to a file storage - virtual void write( FileStorage& ) const CV_OVERRIDE; - - /** @brief Clones the matcher. - - @param emptyTrainData If emptyTrainData is false, the method creates a deep copy of the object, - that is, copies both parameters and train data. If emptyTrainData is true, the method creates an - object copy with the current parameters but with empty train data. - */ - CV_WRAP virtual Ptr clone( bool emptyTrainData=false ) const = 0; - - /** @brief Creates a descriptor matcher of a given type with the default parameters (using default - constructor). - - @param descriptorMatcherType Descriptor matcher type. Now the following matcher types are - supported: - - `BruteForce` (it uses L2 ) - - `BruteForce-L1` - - `BruteForce-Hamming` - - `BruteForce-Hamming(2)` - - `FlannBased` - */ - CV_WRAP static Ptr create( const String& descriptorMatcherType ); - - CV_WRAP static Ptr create( int matcherType ); - - - // see corresponding cv::Algorithm method - CV_WRAP inline void write(const Ptr& fs, const String& name = String()) const { Algorithm::write(fs, name); } - -protected: - /** - * Class to work with descriptors from several images as with one merged matrix. - * It is used e.g. in FlannBasedMatcher. - */ - class CV_EXPORTS DescriptorCollection - { - public: - DescriptorCollection(); - DescriptorCollection( const DescriptorCollection& collection ); - virtual ~DescriptorCollection(); - - // Vector of matrices "descriptors" will be merged to one matrix "mergedDescriptors" here. - void set( const std::vector& descriptors ); - virtual void clear(); - - const Mat& getDescriptors() const; - const Mat getDescriptor( int imgIdx, int localDescIdx ) const; - const Mat getDescriptor( int globalDescIdx ) const; - void getLocalIdx( int globalDescIdx, int& imgIdx, int& localDescIdx ) const; - - int size() const; - - protected: - Mat mergedDescriptors; - std::vector startIdxs; - }; - - //! In fact the matching is implemented only by the following two methods. These methods suppose - //! that the class object has been trained already. Public match methods call these methods - //! after calling train(). - virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0; - virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) = 0; - - static bool isPossibleMatch( InputArray mask, int queryIdx, int trainIdx ); - static bool isMaskedOut( InputArrayOfArrays masks, int queryIdx ); - - static Mat clone_op( Mat m ) { return m.clone(); } - void checkMasks( InputArrayOfArrays masks, int queryDescriptorsCount ) const; - - //! Collection of descriptors from train images. - std::vector trainDescCollection; - std::vector utrainDescCollection; -}; - -/** @brief Brute-force descriptor matcher. - -For each descriptor in the first set, this matcher finds the closest descriptor in the second set -by trying each one. This descriptor matcher supports masking permissible matches of descriptor -sets. - */ -class CV_EXPORTS_W BFMatcher : public DescriptorMatcher -{ -public: - /** @brief Brute-force matcher constructor (obsolete). Please use BFMatcher.create() - * - * - */ - CV_WRAP BFMatcher( int normType=NORM_L2, bool crossCheck=false ); - - virtual ~BFMatcher() {} - - virtual bool isMaskSupported() const CV_OVERRIDE { return true; } - - /** @brief Brute-force matcher create method. - @param normType One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are - preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and - BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor - description). - @param crossCheck If it is false, this is will be default BFMatcher behaviour when it finds the k - nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with - k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the - matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent - pairs. Such technique usually produces best results with minimal number of outliers when there are - enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper. - */ - CV_WRAP static Ptr create( int normType=NORM_L2, bool crossCheck=false ) ; - - virtual Ptr clone( bool emptyTrainData=false ) const CV_OVERRIDE; -protected: - virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; - virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; - - int normType; - bool crossCheck; -}; - -#if defined(HAVE_OPENCV_FLANN) || defined(CV_DOXYGEN) - -/** @brief Flann-based descriptor matcher. - -This matcher trains cv::flann::Index on a train descriptor collection and calls its nearest search -methods to find the best matches. So, this matcher may be faster when matching a large train -collection than the brute force matcher. FlannBasedMatcher does not support masking permissible -matches of descriptor sets because flann::Index does not support this. : - */ -class CV_EXPORTS_W FlannBasedMatcher : public DescriptorMatcher -{ -public: - CV_WRAP FlannBasedMatcher( const Ptr& indexParams=makePtr(), - const Ptr& searchParams=makePtr() ); - - virtual void add( InputArrayOfArrays descriptors ) CV_OVERRIDE; - virtual void clear() CV_OVERRIDE; - - // Reads matcher object from a file node - virtual void read( const FileNode& ) CV_OVERRIDE; - // Writes matcher object to a file storage - virtual void write( FileStorage& ) const CV_OVERRIDE; - - virtual void train() CV_OVERRIDE; - virtual bool isMaskSupported() const CV_OVERRIDE; - - CV_WRAP static Ptr create(); - - virtual Ptr clone( bool emptyTrainData=false ) const CV_OVERRIDE; -protected: - static void convertToDMatches( const DescriptorCollection& descriptors, - const Mat& indices, const Mat& distances, - std::vector >& matches ); - - virtual void knnMatchImpl( InputArray queryDescriptors, std::vector >& matches, int k, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; - virtual void radiusMatchImpl( InputArray queryDescriptors, std::vector >& matches, float maxDistance, - InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE; - - Ptr indexParams; - Ptr searchParams; - Ptr flannIndex; - - DescriptorCollection mergedDescriptors; - int addedDescCount; -}; - -#endif - -//! @} features2d_match - -/****************************************************************************************\ -* Drawing functions * -\****************************************************************************************/ - -//! @addtogroup features2d_draw -//! @{ - -struct CV_EXPORTS DrawMatchesFlags -{ - enum{ DEFAULT = 0, //!< Output image matrix will be created (Mat::create), - //!< i.e. existing memory of output image may be reused. - //!< Two source image, matches and single keypoints will be drawn. - //!< For each keypoint only the center point will be drawn (without - //!< the circle around keypoint with keypoint size and orientation). - DRAW_OVER_OUTIMG = 1, //!< Output image matrix will not be created (Mat::create). - //!< Matches will be drawn on existing content of output image. - NOT_DRAW_SINGLE_POINTS = 2, //!< Single keypoints will not be drawn. - DRAW_RICH_KEYPOINTS = 4 //!< For each keypoint the circle around keypoint with keypoint size and - //!< orientation will be drawn. - }; -}; - -/** @brief Draws keypoints. - -@param image Source image. -@param keypoints Keypoints from the source image. -@param outImage Output image. Its content depends on the flags value defining what is drawn in the -output image. See possible flags bit values below. -@param color Color of keypoints. -@param flags Flags setting drawing features. Possible flags bit values are defined by -DrawMatchesFlags. See details above in drawMatches . - -@note -For Python API, flags are modified as cv2.DRAW_MATCHES_FLAGS_DEFAULT, -cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv2.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG, -cv2.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS - */ -CV_EXPORTS_W void drawKeypoints( InputArray image, const std::vector& keypoints, InputOutputArray outImage, - const Scalar& color=Scalar::all(-1), int flags=DrawMatchesFlags::DEFAULT ); - -/** @brief Draws the found matches of keypoints from two images. - -@param img1 First source image. -@param keypoints1 Keypoints from the first source image. -@param img2 Second source image. -@param keypoints2 Keypoints from the second source image. -@param matches1to2 Matches from the first image to the second one, which means that keypoints1[i] -has a corresponding point in keypoints2[matches[i]] . -@param outImg Output image. Its content depends on the flags value defining what is drawn in the -output image. See possible flags bit values below. -@param matchColor Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1) -, the color is generated randomly. -@param singlePointColor Color of single keypoints (circles), which means that keypoints do not -have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly. -@param matchesMask Mask determining which matches are drawn. If the mask is empty, all matches are -drawn. -@param flags Flags setting drawing features. Possible flags bit values are defined by -DrawMatchesFlags. - -This function draws matches of keypoints from two images in the output image. Match is a line -connecting two keypoints (circles). See cv::DrawMatchesFlags. - */ -CV_EXPORTS_W void drawMatches( InputArray img1, const std::vector& keypoints1, - InputArray img2, const std::vector& keypoints2, - const std::vector& matches1to2, InputOutputArray outImg, - const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), - const std::vector& matchesMask=std::vector(), int flags=DrawMatchesFlags::DEFAULT ); - -/** @overload */ -CV_EXPORTS_AS(drawMatchesKnn) void drawMatches( InputArray img1, const std::vector& keypoints1, - InputArray img2, const std::vector& keypoints2, - const std::vector >& matches1to2, InputOutputArray outImg, - const Scalar& matchColor=Scalar::all(-1), const Scalar& singlePointColor=Scalar::all(-1), - const std::vector >& matchesMask=std::vector >(), int flags=DrawMatchesFlags::DEFAULT ); - -//! @} features2d_draw - -/****************************************************************************************\ -* Functions to evaluate the feature detectors and [generic] descriptor extractors * -\****************************************************************************************/ - -CV_EXPORTS void evaluateFeatureDetector( const Mat& img1, const Mat& img2, const Mat& H1to2, - std::vector* keypoints1, std::vector* keypoints2, - float& repeatability, int& correspCount, - const Ptr& fdetector=Ptr() ); - -CV_EXPORTS void computeRecallPrecisionCurve( const std::vector >& matches1to2, - const std::vector >& correctMatches1to2Mask, - std::vector& recallPrecisionCurve ); - -CV_EXPORTS float getRecall( const std::vector& recallPrecisionCurve, float l_precision ); -CV_EXPORTS int getNearestPoint( const std::vector& recallPrecisionCurve, float l_precision ); - -/****************************************************************************************\ -* Bag of visual words * -\****************************************************************************************/ - -//! @addtogroup features2d_category -//! @{ - -/** @brief Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors. - -For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka, -Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. : - */ -class CV_EXPORTS_W BOWTrainer -{ -public: - BOWTrainer(); - virtual ~BOWTrainer(); - - /** @brief Adds descriptors to a training set. - - @param descriptors Descriptors to add to a training set. Each row of the descriptors matrix is a - descriptor. - - The training set is clustered using clustermethod to construct the vocabulary. - */ - CV_WRAP void add( const Mat& descriptors ); - - /** @brief Returns a training set of descriptors. - */ - CV_WRAP const std::vector& getDescriptors() const; - - /** @brief Returns the count of all descriptors stored in the training set. - */ - CV_WRAP int descriptorsCount() const; - - CV_WRAP virtual void clear(); - - /** @overload */ - CV_WRAP virtual Mat cluster() const = 0; - - /** @brief Clusters train descriptors. - - @param descriptors Descriptors to cluster. Each row of the descriptors matrix is a descriptor. - Descriptors are not added to the inner train descriptor set. - - The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first - variant of the method, train descriptors stored in the object are clustered. In the second variant, - input descriptors are clustered. - */ - CV_WRAP virtual Mat cluster( const Mat& descriptors ) const = 0; - -protected: - std::vector descriptors; - int size; -}; - -/** @brief kmeans -based class to train visual vocabulary using the *bag of visual words* approach. : - */ -class CV_EXPORTS_W BOWKMeansTrainer : public BOWTrainer -{ -public: - /** @brief The constructor. - - @see cv::kmeans - */ - CV_WRAP BOWKMeansTrainer( int clusterCount, const TermCriteria& termcrit=TermCriteria(), - int attempts=3, int flags=KMEANS_PP_CENTERS ); - virtual ~BOWKMeansTrainer(); - - // Returns trained vocabulary (i.e. cluster centers). - CV_WRAP virtual Mat cluster() const CV_OVERRIDE; - CV_WRAP virtual Mat cluster( const Mat& descriptors ) const CV_OVERRIDE; - -protected: - - int clusterCount; - TermCriteria termcrit; - int attempts; - int flags; -}; - -/** @brief Class to compute an image descriptor using the *bag of visual words*. - -Such a computation consists of the following steps: - -1. Compute descriptors for a given image and its keypoints set. -2. Find the nearest visual words from the vocabulary for each keypoint descriptor. -3. Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words -encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the -vocabulary in the given image. - */ -class CV_EXPORTS_W BOWImgDescriptorExtractor -{ -public: - /** @brief The constructor. - - @param dextractor Descriptor extractor that is used to compute descriptors for an input image and - its keypoints. - @param dmatcher Descriptor matcher that is used to find the nearest word of the trained vocabulary - for each keypoint descriptor of the image. - */ - CV_WRAP BOWImgDescriptorExtractor( const Ptr& dextractor, - const Ptr& dmatcher ); - /** @overload */ - BOWImgDescriptorExtractor( const Ptr& dmatcher ); - virtual ~BOWImgDescriptorExtractor(); - - /** @brief Sets a visual vocabulary. - - @param vocabulary Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the - vocabulary is a visual word (cluster center). - */ - CV_WRAP void setVocabulary( const Mat& vocabulary ); - - /** @brief Returns the set vocabulary. - */ - CV_WRAP const Mat& getVocabulary() const; - - /** @brief Computes an image descriptor using the set visual vocabulary. - - @param image Image, for which the descriptor is computed. - @param keypoints Keypoints detected in the input image. - @param imgDescriptor Computed output image descriptor. - @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that - pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) - returned if it is non-zero. - @param descriptors Descriptors of the image keypoints that are returned if they are non-zero. - */ - void compute( InputArray image, std::vector& keypoints, OutputArray imgDescriptor, - std::vector >* pointIdxsOfClusters=0, Mat* descriptors=0 ); - /** @overload - @param keypointDescriptors Computed descriptors to match with vocabulary. - @param imgDescriptor Computed output image descriptor. - @param pointIdxsOfClusters Indices of keypoints that belong to the cluster. This means that - pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary) - returned if it is non-zero. - */ - void compute( InputArray keypointDescriptors, OutputArray imgDescriptor, - std::vector >* pointIdxsOfClusters=0 ); - // compute() is not constant because DescriptorMatcher::match is not constant - - CV_WRAP_AS(compute) void compute2( const Mat& image, std::vector& keypoints, CV_OUT Mat& imgDescriptor ) - { compute(image,keypoints,imgDescriptor); } - - /** @brief Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0. - */ - CV_WRAP int descriptorSize() const; - - /** @brief Returns an image descriptor type. - */ - CV_WRAP int descriptorType() const; - -protected: - Mat vocabulary; - Ptr dextractor; - Ptr dmatcher; -}; - -//! @} features2d_category - -//! @} features2d - -} /* namespace cv */ - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/features2d/features2d.hpp b/qt-correction-tool/pub/opencv/include/opencv2/features2d/features2d.hpp deleted file mode 100644 index e81df0a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/features2d/features2d.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/features2d.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/features2d/hal/interface.h b/qt-correction-tool/pub/opencv/include/opencv2/features2d/hal/interface.h deleted file mode 100644 index bcc6577..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/features2d/hal/interface.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef OPENCV_FEATURE2D_HAL_INTERFACE_H -#define OPENCV_FEATURE2D_HAL_INTERFACE_H - -#include "opencv2/core/cvdef.h" -//! @addtogroup featrure2d_hal_interface -//! @{ - -//! @name Fast feature detector types -//! @sa cv::FastFeatureDetector -//! @{ -#define CV_HAL_TYPE_5_8 0 -#define CV_HAL_TYPE_7_12 1 -#define CV_HAL_TYPE_9_16 2 -//! @} - -//! @name Key point -//! @sa cv::KeyPoint -//! @{ -struct CV_EXPORTS cvhalKeyPoint -{ - float x; - float y; - float size; - float angle; - float response; - int octave; - int class_id; -}; -//! @} - -//! @} - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann.hpp b/qt-correction-tool/pub/opencv/include/opencv2/flann.hpp deleted file mode 100644 index fec3d06..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann.hpp +++ /dev/null @@ -1,594 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_FLANN_HPP -#define OPENCV_FLANN_HPP - -#include "opencv2/core.hpp" -#include "opencv2/flann/miniflann.hpp" -#include "opencv2/flann/flann_base.hpp" - -/** -@defgroup flann Clustering and Search in Multi-Dimensional Spaces - -This section documents OpenCV's interface to the FLANN library. FLANN (Fast Library for Approximate -Nearest Neighbors) is a library that contains a collection of algorithms optimized for fast nearest -neighbor search in large datasets and for high dimensional features. More information about FLANN -can be found in @cite Muja2009 . -*/ - -namespace cvflann -{ - CV_EXPORTS flann_distance_t flann_distance_type(); - CV_DEPRECATED CV_EXPORTS void set_distance_type(flann_distance_t distance_type, int order); -} - - -namespace cv -{ -namespace flann -{ - - -//! @addtogroup flann -//! @{ - -template struct CvType {}; -template <> struct CvType { static int type() { return CV_8U; } }; -template <> struct CvType { static int type() { return CV_8S; } }; -template <> struct CvType { static int type() { return CV_16U; } }; -template <> struct CvType { static int type() { return CV_16S; } }; -template <> struct CvType { static int type() { return CV_32S; } }; -template <> struct CvType { static int type() { return CV_32F; } }; -template <> struct CvType { static int type() { return CV_64F; } }; - - -// bring the flann parameters into this namespace -using ::cvflann::get_param; -using ::cvflann::print_params; - -// bring the flann distances into this namespace -using ::cvflann::L2_Simple; -using ::cvflann::L2; -using ::cvflann::L1; -using ::cvflann::MinkowskiDistance; -using ::cvflann::MaxDistance; -using ::cvflann::HammingLUT; -using ::cvflann::Hamming; -using ::cvflann::Hamming2; -using ::cvflann::HistIntersectionDistance; -using ::cvflann::HellingerDistance; -using ::cvflann::ChiSquareDistance; -using ::cvflann::KL_Divergence; - - -/** @brief The FLANN nearest neighbor index class. This class is templated with the type of elements for which -the index is built. - -`Distance` functor specifies the metric to be used to calculate the distance between two points. -There are several `Distance` functors that are readily available: - -@link cvflann::L2_Simple cv::flann::L2_Simple @endlink- Squared Euclidean distance functor. -This is the simpler, unrolled version. This is preferable for very low dimensionality data (eg 3D points) - -@link cvflann::L2 cv::flann::L2 @endlink- Squared Euclidean distance functor, optimized version. - -@link cvflann::L1 cv::flann::L1 @endlink - Manhattan distance functor, optimized version. - -@link cvflann::MinkowskiDistance cv::flann::MinkowskiDistance @endlink - The Minkowsky distance functor. -This is highly optimised with loop unrolling. -The computation of squared root at the end is omitted for efficiency. - -@link cvflann::MaxDistance cv::flann::MaxDistance @endlink - The max distance functor. It computes the -maximum distance between two vectors. This distance is not a valid kdtree distance, it's not -dimensionwise additive. - -@link cvflann::HammingLUT cv::flann::HammingLUT @endlink - %Hamming distance functor. It counts the bit -differences between two strings using a lookup table implementation. - -@link cvflann::Hamming cv::flann::Hamming @endlink - %Hamming distance functor. Population count is -performed using library calls, if available. Lookup table implementation is used as a fallback. - -@link cvflann::Hamming2 cv::flann::Hamming2 @endlink- %Hamming distance functor. Population count is -implemented in 12 arithmetic operations (one of which is multiplication). - -@link cvflann::HistIntersectionDistance cv::flann::HistIntersectionDistance @endlink - The histogram -intersection distance functor. - -@link cvflann::HellingerDistance cv::flann::HellingerDistance @endlink - The Hellinger distance functor. - -@link cvflann::ChiSquareDistance cv::flann::ChiSquareDistance @endlink - The chi-square distance functor. - -@link cvflann::KL_Divergence cv::flann::KL_Divergence @endlink - The Kullback-Leibler divergence functor. - -Although the provided implementations cover a vast range of cases, it is also possible to use -a custom implementation. The distance functor is a class whose `operator()` computes the distance -between two features. If the distance is also a kd-tree compatible distance, it should also provide an -`accum_dist()` method that computes the distance between individual feature dimensions. - -In addition to `operator()` and `accum_dist()`, a distance functor should also define the -`ElementType` and the `ResultType` as the types of the elements it operates on and the type of the -result it computes. If a distance functor can be used as a kd-tree distance (meaning that the full -distance between a pair of features can be accumulated from the partial distances between the -individual dimensions) a typedef `is_kdtree_distance` should be present inside the distance functor. -If the distance is not a kd-tree distance, but it's a distance in a vector space (the individual -dimensions of the elements it operates on can be accessed independently) a typedef -`is_vector_space_distance` should be defined inside the functor. If neither typedef is defined, the -distance is assumed to be a metric distance and will only be used with indexes operating on -generic metric distances. - */ -template -class GenericIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - /** @brief Constructs a nearest neighbor search index for a given dataset. - - @param features Matrix of containing the features(points) to index. The size of the matrix is - num_features x feature_dimensionality and the data type of the elements in the matrix must - coincide with the type of the index. - @param params Structure containing the index parameters. The type of index that will be - constructed depends on the type of this parameter. See the description. - @param distance - - The method constructs a fast search structure from a set of features using the specified algorithm - with specified parameters, as defined by params. params is a reference to one of the following class - IndexParams descendants: - - - **LinearIndexParams** When passing an object of this type, the index will perform a linear, - brute-force search. : - @code - struct LinearIndexParams : public IndexParams - { - }; - @endcode - - **KDTreeIndexParams** When passing an object of this type the index constructed will consist of - a set of randomized kd-trees which will be searched in parallel. : - @code - struct KDTreeIndexParams : public IndexParams - { - KDTreeIndexParams( int trees = 4 ); - }; - @endcode - - **KMeansIndexParams** When passing an object of this type the index constructed will be a - hierarchical k-means tree. : - @code - struct KMeansIndexParams : public IndexParams - { - KMeansIndexParams( - int branching = 32, - int iterations = 11, - flann_centers_init_t centers_init = CENTERS_RANDOM, - float cb_index = 0.2 ); - }; - @endcode - - **CompositeIndexParams** When using a parameters object of this type the index created - combines the randomized kd-trees and the hierarchical k-means tree. : - @code - struct CompositeIndexParams : public IndexParams - { - CompositeIndexParams( - int trees = 4, - int branching = 32, - int iterations = 11, - flann_centers_init_t centers_init = CENTERS_RANDOM, - float cb_index = 0.2 ); - }; - @endcode - - **LshIndexParams** When using a parameters object of this type the index created uses - multi-probe LSH (by Multi-Probe LSH: Efficient Indexing for High-Dimensional Similarity Search - by Qin Lv, William Josephson, Zhe Wang, Moses Charikar, Kai Li., Proceedings of the 33rd - International Conference on Very Large Data Bases (VLDB). Vienna, Austria. September 2007) : - @code - struct LshIndexParams : public IndexParams - { - LshIndexParams( - unsigned int table_number, - unsigned int key_size, - unsigned int multi_probe_level ); - }; - @endcode - - **AutotunedIndexParams** When passing an object of this type the index created is - automatically tuned to offer the best performance, by choosing the optimal index type - (randomized kd-trees, hierarchical kmeans, linear) and parameters for the dataset provided. : - @code - struct AutotunedIndexParams : public IndexParams - { - AutotunedIndexParams( - float target_precision = 0.9, - float build_weight = 0.01, - float memory_weight = 0, - float sample_fraction = 0.1 ); - }; - @endcode - - **SavedIndexParams** This object type is used for loading a previously saved index from the - disk. : - @code - struct SavedIndexParams : public IndexParams - { - SavedIndexParams( String filename ); - }; - @endcode - */ - GenericIndex(const Mat& features, const ::cvflann::IndexParams& params, Distance distance = Distance()); - - ~GenericIndex(); - - /** @brief Performs a K-nearest neighbor search for a given query point using the index. - - @param query The query point - @param indices Vector that will contain the indices of the K-nearest neighbors found. It must have - at least knn size. - @param dists Vector that will contain the distances to the K-nearest neighbors found. It must have - at least knn size. - @param knn Number of nearest neighbors to search for. - @param params SearchParams - */ - void knnSearch(const std::vector& query, std::vector& indices, - std::vector& dists, int knn, const ::cvflann::SearchParams& params); - void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& params); - - /** @brief Performs a radius nearest neighbor search for a given query point using the index. - - @param query The query point. - @param indices Vector that will contain the indices of the nearest neighbors found. - @param dists Vector that will contain the distances to the nearest neighbors found. It has the same - number of elements as indices. - @param radius The search radius. - @param params SearchParams - - This function returns the number of nearest neighbors found. - */ - int radiusSearch(const std::vector& query, std::vector& indices, - std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& params); - int radiusSearch(const Mat& query, Mat& indices, Mat& dists, - DistanceType radius, const ::cvflann::SearchParams& params); - - void save(String filename) { nnIndex->save(filename); } - - int veclen() const { return nnIndex->veclen(); } - - int size() const { return nnIndex->size(); } - - ::cvflann::IndexParams getParameters() { return nnIndex->getParameters(); } - - CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() { return nnIndex->getIndexParameters(); } - -private: - ::cvflann::Index* nnIndex; -}; - -//! @cond IGNORED - -#define FLANN_DISTANCE_CHECK \ - if ( ::cvflann::flann_distance_type() != cvflann::FLANN_DIST_L2) { \ - printf("[WARNING] You are using cv::flann::Index (or cv::flann::GenericIndex) and have also changed "\ - "the distance using cvflann::set_distance_type. This is no longer working as expected "\ - "(cv::flann::Index always uses L2). You should create the index templated on the distance, "\ - "for example for L1 distance use: GenericIndex< L1 > \n"); \ - } - - -template -GenericIndex::GenericIndex(const Mat& dataset, const ::cvflann::IndexParams& params, Distance distance) -{ - CV_Assert(dataset.type() == CvType::type()); - CV_Assert(dataset.isContinuous()); - ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); - - nnIndex = new ::cvflann::Index(m_dataset, params, distance); - - FLANN_DISTANCE_CHECK - - nnIndex->buildIndex(); -} - -template -GenericIndex::~GenericIndex() -{ - delete nnIndex; -} - -template -void GenericIndex::knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) -{ - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - FLANN_DISTANCE_CHECK - - nnIndex->knnSearch(m_query,m_indices,m_dists,knn,searchParams); -} - - -template -void GenericIndex::knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) -{ - CV_Assert(queries.type() == CvType::type()); - CV_Assert(queries.isContinuous()); - ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - FLANN_DISTANCE_CHECK - - nnIndex->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); -} - -template -int GenericIndex::radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) -{ - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - FLANN_DISTANCE_CHECK - - return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); -} - -template -int GenericIndex::radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) -{ - CV_Assert(query.type() == CvType::type()); - CV_Assert(query.isContinuous()); - ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - FLANN_DISTANCE_CHECK - - return nnIndex->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); -} - -//! @endcond - -/** - * @deprecated Use GenericIndex class instead - */ -template -class Index_ -{ -public: - typedef typename L2::ElementType ElementType; - typedef typename L2::ResultType DistanceType; - - CV_DEPRECATED Index_(const Mat& dataset, const ::cvflann::IndexParams& params) - { - printf("[WARNING] The cv::flann::Index_ class is deperecated, use cv::flann::GenericIndex instead\n"); - - CV_Assert(dataset.type() == CvType::type()); - CV_Assert(dataset.isContinuous()); - ::cvflann::Matrix m_dataset((ElementType*)dataset.ptr(0), dataset.rows, dataset.cols); - - if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { - nnIndex_L1 = NULL; - nnIndex_L2 = new ::cvflann::Index< L2 >(m_dataset, params); - } - else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { - nnIndex_L1 = new ::cvflann::Index< L1 >(m_dataset, params); - nnIndex_L2 = NULL; - } - else { - printf("[ERROR] cv::flann::Index_ only provides backwards compatibility for the L1 and L2 distances. " - "For other distance types you must use cv::flann::GenericIndex\n"); - CV_Assert(0); - } - if (nnIndex_L1) nnIndex_L1->buildIndex(); - if (nnIndex_L2) nnIndex_L2->buildIndex(); - } - CV_DEPRECATED ~Index_() - { - if (nnIndex_L1) delete nnIndex_L1; - if (nnIndex_L2) delete nnIndex_L2; - } - - CV_DEPRECATED void knnSearch(const std::vector& query, std::vector& indices, std::vector& dists, int knn, const ::cvflann::SearchParams& searchParams) - { - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - if (nnIndex_L1) nnIndex_L1->knnSearch(m_query,m_indices,m_dists,knn,searchParams); - if (nnIndex_L2) nnIndex_L2->knnSearch(m_query,m_indices,m_dists,knn,searchParams); - } - CV_DEPRECATED void knnSearch(const Mat& queries, Mat& indices, Mat& dists, int knn, const ::cvflann::SearchParams& searchParams) - { - CV_Assert(queries.type() == CvType::type()); - CV_Assert(queries.isContinuous()); - ::cvflann::Matrix m_queries((ElementType*)queries.ptr(0), queries.rows, queries.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - if (nnIndex_L1) nnIndex_L1->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); - if (nnIndex_L2) nnIndex_L2->knnSearch(m_queries,m_indices,m_dists,knn, searchParams); - } - - CV_DEPRECATED int radiusSearch(const std::vector& query, std::vector& indices, std::vector& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) - { - ::cvflann::Matrix m_query((ElementType*)&query[0], 1, query.size()); - ::cvflann::Matrix m_indices(&indices[0], 1, indices.size()); - ::cvflann::Matrix m_dists(&dists[0], 1, dists.size()); - - if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - } - - CV_DEPRECATED int radiusSearch(const Mat& query, Mat& indices, Mat& dists, DistanceType radius, const ::cvflann::SearchParams& searchParams) - { - CV_Assert(query.type() == CvType::type()); - CV_Assert(query.isContinuous()); - ::cvflann::Matrix m_query((ElementType*)query.ptr(0), query.rows, query.cols); - - CV_Assert(indices.type() == CV_32S); - CV_Assert(indices.isContinuous()); - ::cvflann::Matrix m_indices((int*)indices.ptr(0), indices.rows, indices.cols); - - CV_Assert(dists.type() == CvType::type()); - CV_Assert(dists.isContinuous()); - ::cvflann::Matrix m_dists((DistanceType*)dists.ptr(0), dists.rows, dists.cols); - - if (nnIndex_L1) return nnIndex_L1->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - if (nnIndex_L2) return nnIndex_L2->radiusSearch(m_query,m_indices,m_dists,radius,searchParams); - } - - CV_DEPRECATED void save(String filename) - { - if (nnIndex_L1) nnIndex_L1->save(filename); - if (nnIndex_L2) nnIndex_L2->save(filename); - } - - CV_DEPRECATED int veclen() const - { - if (nnIndex_L1) return nnIndex_L1->veclen(); - if (nnIndex_L2) return nnIndex_L2->veclen(); - } - - CV_DEPRECATED int size() const - { - if (nnIndex_L1) return nnIndex_L1->size(); - if (nnIndex_L2) return nnIndex_L2->size(); - } - - CV_DEPRECATED ::cvflann::IndexParams getParameters() - { - if (nnIndex_L1) return nnIndex_L1->getParameters(); - if (nnIndex_L2) return nnIndex_L2->getParameters(); - - } - - CV_DEPRECATED const ::cvflann::IndexParams* getIndexParameters() - { - if (nnIndex_L1) return nnIndex_L1->getIndexParameters(); - if (nnIndex_L2) return nnIndex_L2->getIndexParameters(); - } - -private: - // providing backwards compatibility for L2 and L1 distances (most common) - ::cvflann::Index< L2 >* nnIndex_L2; - ::cvflann::Index< L1 >* nnIndex_L1; -}; - - -/** @brief Clusters features using hierarchical k-means algorithm. - -@param features The points to be clustered. The matrix must have elements of type -Distance::ElementType. -@param centers The centers of the clusters obtained. The matrix must have type -Distance::ResultType. The number of rows in this matrix represents the number of clusters desired, -however, because of the way the cut in the hierarchical tree is chosen, the number of clusters -computed will be the highest number of the form (branching-1)\*k+1 that's lower than the number of -clusters desired, where branching is the tree's branching factor (see description of the -KMeansIndexParams). -@param params Parameters used in the construction of the hierarchical k-means tree. -@param d Distance to be used for clustering. - -The method clusters the given feature vectors by constructing a hierarchical k-means tree and -choosing a cut in the tree that minimizes the cluster's variance. It returns the number of clusters -found. - */ -template -int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params, - Distance d = Distance()) -{ - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - CV_Assert(features.type() == CvType::type()); - CV_Assert(features.isContinuous()); - ::cvflann::Matrix m_features((ElementType*)features.ptr(0), features.rows, features.cols); - - CV_Assert(centers.type() == CvType::type()); - CV_Assert(centers.isContinuous()); - ::cvflann::Matrix m_centers((DistanceType*)centers.ptr(0), centers.rows, centers.cols); - - return ::cvflann::hierarchicalClustering(m_features, m_centers, params, d); -} - -/** @deprecated -*/ -template -CV_DEPRECATED int hierarchicalClustering(const Mat& features, Mat& centers, const ::cvflann::KMeansIndexParams& params) -{ - printf("[WARNING] cv::flann::hierarchicalClustering is deprecated, use " - "cv::flann::hierarchicalClustering instead\n"); - - if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L2 ) { - return hierarchicalClustering< L2 >(features, centers, params); - } - else if ( ::cvflann::flann_distance_type() == cvflann::FLANN_DIST_L1 ) { - return hierarchicalClustering< L1 >(features, centers, params); - } - else { - printf("[ERROR] cv::flann::hierarchicalClustering only provides backwards " - "compatibility for the L1 and L2 distances. " - "For other distance types you must use cv::flann::hierarchicalClustering\n"); - CV_Assert(0); - } -} - -//! @} flann - -} } // namespace cv::flann - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/all_indices.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/all_indices.h deleted file mode 100644 index ff53fd8..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/all_indices.h +++ /dev/null @@ -1,155 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_ALL_INDICES_H_ -#define OPENCV_FLANN_ALL_INDICES_H_ - -#include "general.h" - -#include "nn_index.h" -#include "kdtree_index.h" -#include "kdtree_single_index.h" -#include "kmeans_index.h" -#include "composite_index.h" -#include "linear_index.h" -#include "hierarchical_clustering_index.h" -#include "lsh_index.h" -#include "autotuned_index.h" - - -namespace cvflann -{ - -template -struct index_creator -{ - static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) - { - flann_algorithm_t index_type = get_param(params, "algorithm"); - - NNIndex* nnIndex; - switch (index_type) { - case FLANN_INDEX_LINEAR: - nnIndex = new LinearIndex(dataset, params, distance); - break; - case FLANN_INDEX_KDTREE_SINGLE: - nnIndex = new KDTreeSingleIndex(dataset, params, distance); - break; - case FLANN_INDEX_KDTREE: - nnIndex = new KDTreeIndex(dataset, params, distance); - break; - case FLANN_INDEX_KMEANS: - nnIndex = new KMeansIndex(dataset, params, distance); - break; - case FLANN_INDEX_COMPOSITE: - nnIndex = new CompositeIndex(dataset, params, distance); - break; - case FLANN_INDEX_AUTOTUNED: - nnIndex = new AutotunedIndex(dataset, params, distance); - break; - case FLANN_INDEX_HIERARCHICAL: - nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); - break; - case FLANN_INDEX_LSH: - nnIndex = new LshIndex(dataset, params, distance); - break; - default: - throw FLANNException("Unknown index type"); - } - - return nnIndex; - } -}; - -template -struct index_creator -{ - static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) - { - flann_algorithm_t index_type = get_param(params, "algorithm"); - - NNIndex* nnIndex; - switch (index_type) { - case FLANN_INDEX_LINEAR: - nnIndex = new LinearIndex(dataset, params, distance); - break; - case FLANN_INDEX_KMEANS: - nnIndex = new KMeansIndex(dataset, params, distance); - break; - case FLANN_INDEX_HIERARCHICAL: - nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); - break; - case FLANN_INDEX_LSH: - nnIndex = new LshIndex(dataset, params, distance); - break; - default: - throw FLANNException("Unknown index type"); - } - - return nnIndex; - } -}; - -template -struct index_creator -{ - static NNIndex* create(const Matrix& dataset, const IndexParams& params, const Distance& distance) - { - flann_algorithm_t index_type = get_param(params, "algorithm"); - - NNIndex* nnIndex; - switch (index_type) { - case FLANN_INDEX_LINEAR: - nnIndex = new LinearIndex(dataset, params, distance); - break; - case FLANN_INDEX_HIERARCHICAL: - nnIndex = new HierarchicalClusteringIndex(dataset, params, distance); - break; - case FLANN_INDEX_LSH: - nnIndex = new LshIndex(dataset, params, distance); - break; - default: - throw FLANNException("Unknown index type"); - } - - return nnIndex; - } -}; - -template -NNIndex* create_index_by_type(const Matrix& dataset, const IndexParams& params, const Distance& distance) -{ - return index_creator::create(dataset, params,distance); -} - -} - -#endif /* OPENCV_FLANN_ALL_INDICES_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/allocator.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/allocator.h deleted file mode 100644 index f347f88..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/allocator.h +++ /dev/null @@ -1,192 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_ALLOCATOR_H_ -#define OPENCV_FLANN_ALLOCATOR_H_ - -#include -#include - - -namespace cvflann -{ - -/** - * Allocates (using C's malloc) a generic type T. - * - * Params: - * count = number of instances to allocate. - * Returns: pointer (of type T*) to memory buffer - */ -template -T* allocate(size_t count = 1) -{ - T* mem = (T*) ::malloc(sizeof(T)*count); - return mem; -} - - -/** - * Pooled storage allocator - * - * The following routines allow for the efficient allocation of storage in - * small chunks from a specified pool. Rather than allowing each structure - * to be freed individually, an entire pool of storage is freed at once. - * This method has two advantages over just using malloc() and free(). First, - * it is far more efficient for allocating small objects, as there is - * no overhead for remembering all the information needed to free each - * object or consolidating fragmented memory. Second, the decision about - * how long to keep an object is made at the time of allocation, and there - * is no need to track down all the objects to free them. - * - */ - -const size_t WORDSIZE=16; -const size_t BLOCKSIZE=8192; - -class PooledAllocator -{ - /* We maintain memory alignment to word boundaries by requiring that all - allocations be in multiples of the machine wordsize. */ - /* Size of machine word in bytes. Must be power of 2. */ - /* Minimum number of bytes requested at a time from the system. Must be multiple of WORDSIZE. */ - - - int remaining; /* Number of bytes left in current block of storage. */ - void* base; /* Pointer to base of current block of storage. */ - void* loc; /* Current location in block to next allocate memory. */ - int blocksize; - - -public: - int usedMemory; - int wastedMemory; - - /** - Default constructor. Initializes a new pool. - */ - PooledAllocator(int blockSize = BLOCKSIZE) - { - blocksize = blockSize; - remaining = 0; - base = NULL; - loc = NULL; - - usedMemory = 0; - wastedMemory = 0; - } - - /** - * Destructor. Frees all the memory allocated in this pool. - */ - ~PooledAllocator() - { - void* prev; - - while (base != NULL) { - prev = *((void**) base); /* Get pointer to prev block. */ - ::free(base); - base = prev; - } - } - - /** - * Returns a pointer to a piece of new memory of the given size in bytes - * allocated from the pool. - */ - void* allocateMemory(int size) - { - int blockSize; - - /* Round size up to a multiple of wordsize. The following expression - only works for WORDSIZE that is a power of 2, by masking last bits of - incremented size to zero. - */ - size = (size + (WORDSIZE - 1)) & ~(WORDSIZE - 1); - - /* Check whether a new block must be allocated. Note that the first word - of a block is reserved for a pointer to the previous block. - */ - if (size > remaining) { - - wastedMemory += remaining; - - /* Allocate new storage. */ - blockSize = (size + sizeof(void*) + (WORDSIZE-1) > BLOCKSIZE) ? - size + sizeof(void*) + (WORDSIZE-1) : BLOCKSIZE; - - // use the standard C malloc to allocate memory - void* m = ::malloc(blockSize); - if (!m) { - fprintf(stderr,"Failed to allocate memory.\n"); - return NULL; - } - - /* Fill first word of new block with pointer to previous block. */ - ((void**) m)[0] = base; - base = m; - - int shift = 0; - //int shift = (WORDSIZE - ( (((size_t)m) + sizeof(void*)) & (WORDSIZE-1))) & (WORDSIZE-1); - - remaining = blockSize - sizeof(void*) - shift; - loc = ((char*)m + sizeof(void*) + shift); - } - void* rloc = loc; - loc = (char*)loc + size; - remaining -= size; - - usedMemory += size; - - return rloc; - } - - /** - * Allocates (using this pool) a generic type T. - * - * Params: - * count = number of instances to allocate. - * Returns: pointer (of type T*) to memory buffer - */ - template - T* allocate(size_t count = 1) - { - T* mem = (T*) this->allocateMemory((int)(sizeof(T)*count)); - return mem; - } - -private: - PooledAllocator(const PooledAllocator &); // copy disabled - PooledAllocator& operator=(const PooledAllocator &); // assign disabled -}; - -} - -#endif //OPENCV_FLANN_ALLOCATOR_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/any.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/any.h deleted file mode 100644 index 5b57aa3..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/any.h +++ /dev/null @@ -1,330 +0,0 @@ -#ifndef OPENCV_FLANN_ANY_H_ -#define OPENCV_FLANN_ANY_H_ -/* - * (C) Copyright Christopher Diggins 2005-2011 - * (C) Copyright Pablo Aguilar 2005 - * (C) Copyright Kevlin Henney 2001 - * - * Distributed under the Boost Software License, Version 1.0. (See - * accompanying file LICENSE_1_0.txt or copy at - * http://www.boost.org/LICENSE_1_0.txt - * - * Adapted for FLANN by Marius Muja - */ - -#include "defines.h" -#include -#include -#include - -namespace cvflann -{ - -namespace anyimpl -{ - -struct bad_any_cast -{ -}; - -struct empty_any -{ -}; - -inline std::ostream& operator <<(std::ostream& out, const empty_any&) -{ - out << "[empty_any]"; - return out; -} - -struct base_any_policy -{ - virtual void static_delete(void** x) = 0; - virtual void copy_from_value(void const* src, void** dest) = 0; - virtual void clone(void* const* src, void** dest) = 0; - virtual void move(void* const* src, void** dest) = 0; - virtual void* get_value(void** src) = 0; - virtual const void* get_value(void* const * src) = 0; - virtual ::size_t get_size() = 0; - virtual const std::type_info& type() = 0; - virtual void print(std::ostream& out, void* const* src) = 0; - virtual ~base_any_policy() {} -}; - -template -struct typed_base_any_policy : base_any_policy -{ - virtual ::size_t get_size() CV_OVERRIDE { return sizeof(T); } - virtual const std::type_info& type() CV_OVERRIDE { return typeid(T); } - -}; - -template -struct small_any_policy CV_FINAL : typed_base_any_policy -{ - virtual void static_delete(void**) CV_OVERRIDE { } - virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE - { - new (dest) T(* reinterpret_cast(src)); - } - virtual void clone(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; } - virtual void move(void* const* src, void** dest) CV_OVERRIDE { *dest = *src; } - virtual void* get_value(void** src) CV_OVERRIDE { return reinterpret_cast(src); } - virtual const void* get_value(void* const * src) CV_OVERRIDE { return reinterpret_cast(src); } - virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast(src); } -}; - -template -struct big_any_policy CV_FINAL : typed_base_any_policy -{ - virtual void static_delete(void** x) CV_OVERRIDE - { - if (* x) delete (* reinterpret_cast(x)); - *x = NULL; - } - virtual void copy_from_value(void const* src, void** dest) CV_OVERRIDE - { - *dest = new T(*reinterpret_cast(src)); - } - virtual void clone(void* const* src, void** dest) CV_OVERRIDE - { - *dest = new T(**reinterpret_cast(src)); - } - virtual void move(void* const* src, void** dest) CV_OVERRIDE - { - (*reinterpret_cast(dest))->~T(); - **reinterpret_cast(dest) = **reinterpret_cast(src); - } - virtual void* get_value(void** src) CV_OVERRIDE { return *src; } - virtual const void* get_value(void* const * src) CV_OVERRIDE { return *src; } - virtual void print(std::ostream& out, void* const* src) CV_OVERRIDE { out << *reinterpret_cast(*src); } -}; - -template<> inline void big_any_policy::print(std::ostream& out, void* const* src) -{ - out << int(*reinterpret_cast(*src)); -} - -template<> inline void big_any_policy::print(std::ostream& out, void* const* src) -{ - out << int(*reinterpret_cast(*src)); -} - -template<> inline void big_any_policy::print(std::ostream& out, void* const* src) -{ - out << (*reinterpret_cast(*src)).c_str(); -} - -template -struct choose_policy -{ - typedef big_any_policy type; -}; - -template -struct choose_policy -{ - typedef small_any_policy type; -}; - -struct any; - -/// Choosing the policy for an any type is illegal, but should never happen. -/// This is designed to throw a compiler error. -template<> -struct choose_policy -{ - typedef void type; -}; - -/// Specializations for small types. -#define SMALL_POLICY(TYPE) \ - template<> \ - struct choose_policy { typedef small_any_policy type; \ - } - -SMALL_POLICY(signed char); -SMALL_POLICY(unsigned char); -SMALL_POLICY(signed short); -SMALL_POLICY(unsigned short); -SMALL_POLICY(signed int); -SMALL_POLICY(unsigned int); -SMALL_POLICY(signed long); -SMALL_POLICY(unsigned long); -SMALL_POLICY(float); -SMALL_POLICY(bool); - -#undef SMALL_POLICY - -template -class SinglePolicy -{ - SinglePolicy(); - SinglePolicy(const SinglePolicy& other); - SinglePolicy& operator=(const SinglePolicy& other); - -public: - static base_any_policy* get_policy(); - -private: - static typename choose_policy::type policy; -}; - -template -typename choose_policy::type SinglePolicy::policy; - -/// This function will return a different policy for each type. -template -inline base_any_policy* SinglePolicy::get_policy() { return &policy; } - -} // namespace anyimpl - -struct any -{ -private: - // fields - anyimpl::base_any_policy* policy; - void* object; - -public: - /// Initializing constructor. - template - any(const T& x) - : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) - { - assign(x); - } - - /// Empty constructor. - any() - : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) - { } - - /// Special initializing constructor for string literals. - any(const char* x) - : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) - { - assign(x); - } - - /// Copy constructor. - any(const any& x) - : policy(anyimpl::SinglePolicy::get_policy()), object(NULL) - { - assign(x); - } - - /// Destructor. - ~any() - { - policy->static_delete(&object); - } - - /// Assignment function from another any. - any& assign(const any& x) - { - reset(); - policy = x.policy; - policy->clone(&x.object, &object); - return *this; - } - - /// Assignment function. - template - any& assign(const T& x) - { - reset(); - policy = anyimpl::SinglePolicy::get_policy(); - policy->copy_from_value(&x, &object); - return *this; - } - - /// Assignment operator. - template - any& operator=(const T& x) - { - return assign(x); - } - - /// Assignment operator. Template-based version above doesn't work as expected. We need regular assignment operator here. - any& operator=(const any& x) - { - return assign(x); - } - - /// Assignment operator, specialed for literal strings. - /// They have types like const char [6] which don't work as expected. - any& operator=(const char* x) - { - return assign(x); - } - - /// Utility functions - any& swap(any& x) - { - std::swap(policy, x.policy); - std::swap(object, x.object); - return *this; - } - - /// Cast operator. You can only cast to the original type. - template - T& cast() - { - if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast(); - T* r = reinterpret_cast(policy->get_value(&object)); - return *r; - } - - /// Cast operator. You can only cast to the original type. - template - const T& cast() const - { - if (policy->type() != typeid(T)) throw anyimpl::bad_any_cast(); - const T* r = reinterpret_cast(policy->get_value(&object)); - return *r; - } - - /// Returns true if the any contains no value. - bool empty() const - { - return policy->type() == typeid(anyimpl::empty_any); - } - - /// Frees any allocated memory, and sets the value to NULL. - void reset() - { - policy->static_delete(&object); - policy = anyimpl::SinglePolicy::get_policy(); - } - - /// Returns true if the two types are the same. - bool compatible(const any& x) const - { - return policy->type() == x.policy->type(); - } - - /// Returns if the type is compatible with the policy - template - bool has_type() - { - return policy->type() == typeid(T); - } - - const std::type_info& type() const - { - return policy->type(); - } - - friend std::ostream& operator <<(std::ostream& out, const any& any_val); -}; - -inline std::ostream& operator <<(std::ostream& out, const any& any_val) -{ - any_val.policy->print(out,&any_val.object); - return out; -} - -} - -#endif // OPENCV_FLANN_ANY_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/autotuned_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/autotuned_index.h deleted file mode 100644 index 2fbc6c9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/autotuned_index.h +++ /dev/null @@ -1,591 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ -#ifndef OPENCV_FLANN_AUTOTUNED_INDEX_H_ -#define OPENCV_FLANN_AUTOTUNED_INDEX_H_ - -#include - -#include "general.h" -#include "nn_index.h" -#include "ground_truth.h" -#include "index_testing.h" -#include "sampling.h" -#include "kdtree_index.h" -#include "kdtree_single_index.h" -#include "kmeans_index.h" -#include "composite_index.h" -#include "linear_index.h" -#include "logger.h" - -namespace cvflann -{ - -template -NNIndex* create_index_by_type(const Matrix& dataset, const IndexParams& params, const Distance& distance); - - -struct AutotunedIndexParams : public IndexParams -{ - AutotunedIndexParams(float target_precision = 0.8, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1) - { - (*this)["algorithm"] = FLANN_INDEX_AUTOTUNED; - // precision desired (used for autotuning, -1 otherwise) - (*this)["target_precision"] = target_precision; - // build tree time weighting factor - (*this)["build_weight"] = build_weight; - // index memory weighting factor - (*this)["memory_weight"] = memory_weight; - // what fraction of the dataset to use for autotuning - (*this)["sample_fraction"] = sample_fraction; - } -}; - - -template -class AutotunedIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - AutotunedIndex(const Matrix& inputData, const IndexParams& params = AutotunedIndexParams(), Distance d = Distance()) : - dataset_(inputData), distance_(d) - { - target_precision_ = get_param(params, "target_precision",0.8f); - build_weight_ = get_param(params,"build_weight", 0.01f); - memory_weight_ = get_param(params, "memory_weight", 0.0f); - sample_fraction_ = get_param(params,"sample_fraction", 0.1f); - bestIndex_ = NULL; - speedup_ = 0; - } - - AutotunedIndex(const AutotunedIndex&); - AutotunedIndex& operator=(const AutotunedIndex&); - - virtual ~AutotunedIndex() - { - if (bestIndex_ != NULL) { - delete bestIndex_; - bestIndex_ = NULL; - } - } - - /** - * Method responsible with building the index. - */ - virtual void buildIndex() CV_OVERRIDE - { - std::ostringstream stream; - bestParams_ = estimateBuildParams(); - print_params(bestParams_, stream); - Logger::info("----------------------------------------------------\n"); - Logger::info("Autotuned parameters:\n"); - Logger::info("%s", stream.str().c_str()); - Logger::info("----------------------------------------------------\n"); - - bestIndex_ = create_index_by_type(dataset_, bestParams_, distance_); - bestIndex_->buildIndex(); - speedup_ = estimateSearchParams(bestSearchParams_); - stream.str(std::string()); - print_params(bestSearchParams_, stream); - Logger::info("----------------------------------------------------\n"); - Logger::info("Search parameters:\n"); - Logger::info("%s", stream.str().c_str()); - Logger::info("----------------------------------------------------\n"); - } - - /** - * Saves the index to a stream - */ - virtual void saveIndex(FILE* stream) CV_OVERRIDE - { - save_value(stream, (int)bestIndex_->getType()); - bestIndex_->saveIndex(stream); - save_value(stream, get_param(bestSearchParams_, "checks")); - } - - /** - * Loads the index from a stream - */ - virtual void loadIndex(FILE* stream) CV_OVERRIDE - { - int index_type; - - load_value(stream, index_type); - IndexParams params; - params["algorithm"] = (flann_algorithm_t)index_type; - bestIndex_ = create_index_by_type(dataset_, params, distance_); - bestIndex_->loadIndex(stream); - int checks; - load_value(stream, checks); - bestSearchParams_["checks"] = checks; - } - - /** - * Method that searches for nearest-neighbors - */ - virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - int checks = get_param(searchParams,"checks",FLANN_CHECKS_AUTOTUNED); - if (checks == FLANN_CHECKS_AUTOTUNED) { - bestIndex_->findNeighbors(result, vec, bestSearchParams_); - } - else { - bestIndex_->findNeighbors(result, vec, searchParams); - } - } - - - IndexParams getParameters() const CV_OVERRIDE - { - return bestIndex_->getParameters(); - } - - SearchParams getSearchParameters() const - { - return bestSearchParams_; - } - - float getSpeedup() const - { - return speedup_; - } - - - /** - * Number of features in this index. - */ - virtual size_t size() const CV_OVERRIDE - { - return bestIndex_->size(); - } - - /** - * The length of each vector in this index. - */ - virtual size_t veclen() const CV_OVERRIDE - { - return bestIndex_->veclen(); - } - - /** - * The amount of memory (in bytes) this index uses. - */ - virtual int usedMemory() const CV_OVERRIDE - { - return bestIndex_->usedMemory(); - } - - /** - * Algorithm name - */ - virtual flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_AUTOTUNED; - } - -private: - - struct CostData - { - float searchTimeCost; - float buildTimeCost; - float memoryCost; - float totalCost; - IndexParams params; - }; - - void evaluate_kmeans(CostData& cost) - { - StartStopTimer t; - int checks; - const int nn = 1; - - Logger::info("KMeansTree using params: max_iterations=%d, branching=%d\n", - get_param(cost.params,"iterations"), - get_param(cost.params,"branching")); - KMeansIndex kmeans(sampledDataset_, cost.params, distance_); - // measure index build time - t.start(); - kmeans.buildIndex(); - t.stop(); - float buildTime = (float)t.value; - - // measure search time - float searchTime = test_index_precision(kmeans, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn); - - float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float)); - cost.memoryCost = (kmeans.usedMemory() + datasetMemory) / datasetMemory; - cost.searchTimeCost = searchTime; - cost.buildTimeCost = buildTime; - Logger::info("KMeansTree buildTime=%g, searchTime=%g, build_weight=%g\n", buildTime, searchTime, build_weight_); - } - - - void evaluate_kdtree(CostData& cost) - { - StartStopTimer t; - int checks; - const int nn = 1; - - Logger::info("KDTree using params: trees=%d\n", get_param(cost.params,"trees")); - KDTreeIndex kdtree(sampledDataset_, cost.params, distance_); - - t.start(); - kdtree.buildIndex(); - t.stop(); - float buildTime = (float)t.value; - - //measure search time - float searchTime = test_index_precision(kdtree, sampledDataset_, testDataset_, gt_matches_, target_precision_, checks, distance_, nn); - - float datasetMemory = float(sampledDataset_.rows * sampledDataset_.cols * sizeof(float)); - cost.memoryCost = (kdtree.usedMemory() + datasetMemory) / datasetMemory; - cost.searchTimeCost = searchTime; - cost.buildTimeCost = buildTime; - Logger::info("KDTree buildTime=%g, searchTime=%g\n", buildTime, searchTime); - } - - - // struct KMeansSimpleDownhillFunctor { - // - // Autotune& autotuner; - // KMeansSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} - // - // float operator()(int* params) { - // - // float maxFloat = numeric_limits::max(); - // - // if (params[0]<2) return maxFloat; - // if (params[1]<0) return maxFloat; - // - // CostData c; - // c.params["algorithm"] = KMEANS; - // c.params["centers-init"] = CENTERS_RANDOM; - // c.params["branching"] = params[0]; - // c.params["max-iterations"] = params[1]; - // - // autotuner.evaluate_kmeans(c); - // - // return c.timeCost; - // - // } - // }; - // - // struct KDTreeSimpleDownhillFunctor { - // - // Autotune& autotuner; - // KDTreeSimpleDownhillFunctor(Autotune& autotuner_) : autotuner(autotuner_) {} - // - // float operator()(int* params) { - // float maxFloat = numeric_limits::max(); - // - // if (params[0]<1) return maxFloat; - // - // CostData c; - // c.params["algorithm"] = KDTREE; - // c.params["trees"] = params[0]; - // - // autotuner.evaluate_kdtree(c); - // - // return c.timeCost; - // - // } - // }; - - - - void optimizeKMeans(std::vector& costs) - { - Logger::info("KMEANS, Step 1: Exploring parameter space\n"); - - // explore kmeans parameters space using combinations of the parameters below - int maxIterations[] = { 1, 5, 10, 15 }; - int branchingFactors[] = { 16, 32, 64, 128, 256 }; - - int kmeansParamSpaceSize = FLANN_ARRAY_LEN(maxIterations) * FLANN_ARRAY_LEN(branchingFactors); - costs.reserve(costs.size() + kmeansParamSpaceSize); - - // evaluate kmeans for all parameter combinations - for (size_t i = 0; i < FLANN_ARRAY_LEN(maxIterations); ++i) { - for (size_t j = 0; j < FLANN_ARRAY_LEN(branchingFactors); ++j) { - CostData cost; - cost.params["algorithm"] = FLANN_INDEX_KMEANS; - cost.params["centers_init"] = FLANN_CENTERS_RANDOM; - cost.params["iterations"] = maxIterations[i]; - cost.params["branching"] = branchingFactors[j]; - - evaluate_kmeans(cost); - costs.push_back(cost); - } - } - - // Logger::info("KMEANS, Step 2: simplex-downhill optimization\n"); - // - // const int n = 2; - // // choose initial simplex points as the best parameters so far - // int kmeansNMPoints[n*(n+1)]; - // float kmeansVals[n+1]; - // for (int i=0;i& costs) - { - Logger::info("KD-TREE, Step 1: Exploring parameter space\n"); - - // explore kd-tree parameters space using the parameters below - int testTrees[] = { 1, 4, 8, 16, 32 }; - - // evaluate kdtree for all parameter combinations - for (size_t i = 0; i < FLANN_ARRAY_LEN(testTrees); ++i) { - CostData cost; - cost.params["algorithm"] = FLANN_INDEX_KDTREE; - cost.params["trees"] = testTrees[i]; - - evaluate_kdtree(cost); - costs.push_back(cost); - } - - // Logger::info("KD-TREE, Step 2: simplex-downhill optimization\n"); - // - // const int n = 1; - // // choose initial simplex points as the best parameters so far - // int kdtreeNMPoints[n*(n+1)]; - // float kdtreeVals[n+1]; - // for (int i=0;i costs; - - int sampleSize = int(sample_fraction_ * dataset_.rows); - int testSampleSize = std::min(sampleSize / 10, 1000); - - Logger::info("Entering autotuning, dataset size: %d, sampleSize: %d, testSampleSize: %d, target precision: %g\n", dataset_.rows, sampleSize, testSampleSize, target_precision_); - - // For a very small dataset, it makes no sense to build any fancy index, just - // use linear search - if (testSampleSize < 10) { - Logger::info("Choosing linear, dataset too small\n"); - return LinearIndexParams(); - } - - // We use a fraction of the original dataset to speedup the autotune algorithm - sampledDataset_ = random_sample(dataset_, sampleSize); - // We use a cross-validation approach, first we sample a testset from the dataset - testDataset_ = random_sample(sampledDataset_, testSampleSize, true); - - // We compute the ground truth using linear search - Logger::info("Computing ground truth... \n"); - gt_matches_ = Matrix(new int[testDataset_.rows], testDataset_.rows, 1); - StartStopTimer t; - t.start(); - compute_ground_truth(sampledDataset_, testDataset_, gt_matches_, 0, distance_); - t.stop(); - - CostData linear_cost; - linear_cost.searchTimeCost = (float)t.value; - linear_cost.buildTimeCost = 0; - linear_cost.memoryCost = 0; - linear_cost.params["algorithm"] = FLANN_INDEX_LINEAR; - - costs.push_back(linear_cost); - - // Start parameter autotune process - Logger::info("Autotuning parameters...\n"); - - optimizeKMeans(costs); - optimizeKDTree(costs); - - float bestTimeCost = costs[0].searchTimeCost; - for (size_t i = 0; i < costs.size(); ++i) { - float timeCost = costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost; - if (timeCost < bestTimeCost) { - bestTimeCost = timeCost; - } - } - - float bestCost = costs[0].searchTimeCost / bestTimeCost; - IndexParams bestParams = costs[0].params; - if (bestTimeCost > 0) { - for (size_t i = 0; i < costs.size(); ++i) { - float crtCost = (costs[i].buildTimeCost * build_weight_ + costs[i].searchTimeCost) / bestTimeCost + - memory_weight_ * costs[i].memoryCost; - if (crtCost < bestCost) { - bestCost = crtCost; - bestParams = costs[i].params; - } - } - } - - delete[] gt_matches_.data; - delete[] testDataset_.data; - delete[] sampledDataset_.data; - - return bestParams; - } - - - - /** - * Estimates the search time parameters needed to get the desired precision. - * Precondition: the index is built - * Postcondition: the searchParams will have the optimum params set, also the speedup obtained over linear search. - */ - float estimateSearchParams(SearchParams& searchParams) - { - const int nn = 1; - const size_t SAMPLE_COUNT = 1000; - - assert(bestIndex_ != NULL); // must have a valid index - - float speedup = 0; - - int samples = (int)std::min(dataset_.rows / 10, SAMPLE_COUNT); - if (samples > 0) { - Matrix testDataset = random_sample(dataset_, samples); - - Logger::info("Computing ground truth\n"); - - // we need to compute the ground truth first - Matrix gt_matches(new int[testDataset.rows], testDataset.rows, 1); - StartStopTimer t; - t.start(); - compute_ground_truth(dataset_, testDataset, gt_matches, 1, distance_); - t.stop(); - float linear = (float)t.value; - - int checks; - Logger::info("Estimating number of checks\n"); - - float searchTime; - float cb_index; - if (bestIndex_->getType() == FLANN_INDEX_KMEANS) { - Logger::info("KMeans algorithm, estimating cluster border factor\n"); - KMeansIndex* kmeans = (KMeansIndex*)bestIndex_; - float bestSearchTime = -1; - float best_cb_index = -1; - int best_checks = -1; - for (cb_index = 0; cb_index < 1.1f; cb_index += 0.2f) { - kmeans->set_cb_index(cb_index); - searchTime = test_index_precision(*kmeans, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1); - if ((searchTime < bestSearchTime) || (bestSearchTime == -1)) { - bestSearchTime = searchTime; - best_cb_index = cb_index; - best_checks = checks; - } - } - searchTime = bestSearchTime; - cb_index = best_cb_index; - checks = best_checks; - - kmeans->set_cb_index(best_cb_index); - Logger::info("Optimum cb_index: %g\n", cb_index); - bestParams_["cb_index"] = cb_index; - } - else { - searchTime = test_index_precision(*bestIndex_, dataset_, testDataset, gt_matches, target_precision_, checks, distance_, nn, 1); - } - - Logger::info("Required number of checks: %d \n", checks); - searchParams["checks"] = checks; - - speedup = linear / searchTime; - - delete[] gt_matches.data; - delete[] testDataset.data; - } - - return speedup; - } - -private: - NNIndex* bestIndex_; - - IndexParams bestParams_; - SearchParams bestSearchParams_; - - Matrix sampledDataset_; - Matrix testDataset_; - Matrix gt_matches_; - - float speedup_; - - /** - * The dataset used by this index - */ - const Matrix dataset_; - - /** - * Index parameters - */ - float target_precision_; - float build_weight_; - float memory_weight_; - float sample_fraction_; - - Distance distance_; - - -}; -} - -#endif /* OPENCV_FLANN_AUTOTUNED_INDEX_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/composite_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/composite_index.h deleted file mode 100644 index 5e12a17..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/composite_index.h +++ /dev/null @@ -1,194 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_COMPOSITE_INDEX_H_ -#define OPENCV_FLANN_COMPOSITE_INDEX_H_ - -#include "general.h" -#include "nn_index.h" -#include "kdtree_index.h" -#include "kmeans_index.h" - -namespace cvflann -{ - -/** - * Index parameters for the CompositeIndex. - */ -struct CompositeIndexParams : public IndexParams -{ - CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, - flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ) - { - (*this)["algorithm"] = FLANN_INDEX_KMEANS; - // number of randomized trees to use (for kdtree) - (*this)["trees"] = trees; - // branching factor - (*this)["branching"] = branching; - // max iterations to perform in one kmeans clustering (kmeans tree) - (*this)["iterations"] = iterations; - // algorithm used for picking the initial cluster centers for kmeans tree - (*this)["centers_init"] = centers_init; - // cluster boundary index. Used when searching the kmeans tree - (*this)["cb_index"] = cb_index; - } -}; - - -/** - * This index builds a kd-tree index and a k-means index and performs nearest - * neighbour search both indexes. This gives a slight boost in search performance - * as some of the neighbours that are missed by one index are found by the other. - */ -template -class CompositeIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - /** - * Index constructor - * @param inputData dataset containing the points to index - * @param params Index parameters - * @param d Distance functor - * @return - */ - CompositeIndex(const Matrix& inputData, const IndexParams& params = CompositeIndexParams(), - Distance d = Distance()) : index_params_(params) - { - kdtree_index_ = new KDTreeIndex(inputData, params, d); - kmeans_index_ = new KMeansIndex(inputData, params, d); - - } - - CompositeIndex(const CompositeIndex&); - CompositeIndex& operator=(const CompositeIndex&); - - virtual ~CompositeIndex() - { - delete kdtree_index_; - delete kmeans_index_; - } - - /** - * @return The index type - */ - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_COMPOSITE; - } - - /** - * @return Size of the index - */ - size_t size() const CV_OVERRIDE - { - return kdtree_index_->size(); - } - - /** - * \returns The dimensionality of the features in this index. - */ - size_t veclen() const CV_OVERRIDE - { - return kdtree_index_->veclen(); - } - - /** - * \returns The amount of memory (in bytes) used by the index. - */ - int usedMemory() const CV_OVERRIDE - { - return kmeans_index_->usedMemory() + kdtree_index_->usedMemory(); - } - - /** - * \brief Builds the index - */ - void buildIndex() CV_OVERRIDE - { - Logger::info("Building kmeans tree...\n"); - kmeans_index_->buildIndex(); - Logger::info("Building kdtree tree...\n"); - kdtree_index_->buildIndex(); - } - - /** - * \brief Saves the index to a stream - * \param stream The stream to save the index to - */ - void saveIndex(FILE* stream) CV_OVERRIDE - { - kmeans_index_->saveIndex(stream); - kdtree_index_->saveIndex(stream); - } - - /** - * \brief Loads the index from a stream - * \param stream The stream from which the index is loaded - */ - void loadIndex(FILE* stream) CV_OVERRIDE - { - kmeans_index_->loadIndex(stream); - kdtree_index_->loadIndex(stream); - } - - /** - * \returns The index parameters - */ - IndexParams getParameters() const CV_OVERRIDE - { - return index_params_; - } - - /** - * \brief Method that searches for nearest-neighbours - */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - kmeans_index_->findNeighbors(result, vec, searchParams); - kdtree_index_->findNeighbors(result, vec, searchParams); - } - -private: - /** The k-means index */ - KMeansIndex* kmeans_index_; - - /** The kd-tree index */ - KDTreeIndex* kdtree_index_; - - /** The index parameters */ - const IndexParams index_params_; -}; - -} - -#endif //OPENCV_FLANN_COMPOSITE_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/config.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/config.h deleted file mode 100644 index 56832fd..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/config.h +++ /dev/null @@ -1,38 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_CONFIG_H_ -#define OPENCV_FLANN_CONFIG_H_ - -#ifdef FLANN_VERSION_ -#undef FLANN_VERSION_ -#endif -#define FLANN_VERSION_ "1.6.10" - -#endif /* OPENCV_FLANN_CONFIG_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/defines.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/defines.h deleted file mode 100644 index 6fd53c2..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/defines.h +++ /dev/null @@ -1,164 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_DEFINES_H_ -#define OPENCV_FLANN_DEFINES_H_ - -#include "config.h" - -#ifdef FLANN_EXPORT -#undef FLANN_EXPORT -#endif -#ifdef _WIN32 -/* win32 dll export/import directives */ - #ifdef FLANN_EXPORTS - #define FLANN_EXPORT __declspec(dllexport) - #elif defined(FLANN_STATIC) - #define FLANN_EXPORT - #else - #define FLANN_EXPORT __declspec(dllimport) - #endif -#else -/* unix needs nothing */ - #define FLANN_EXPORT -#endif - - -#undef FLANN_PLATFORM_32_BIT -#undef FLANN_PLATFORM_64_BIT -#if defined __amd64__ || defined __x86_64__ || defined _WIN64 || defined _M_X64 -#define FLANN_PLATFORM_64_BIT -#else -#define FLANN_PLATFORM_32_BIT -#endif - - -#undef FLANN_ARRAY_LEN -#define FLANN_ARRAY_LEN(a) (sizeof(a)/sizeof(a[0])) - -namespace cvflann { - -/* Nearest neighbour index algorithms */ -enum flann_algorithm_t -{ - FLANN_INDEX_LINEAR = 0, - FLANN_INDEX_KDTREE = 1, - FLANN_INDEX_KMEANS = 2, - FLANN_INDEX_COMPOSITE = 3, - FLANN_INDEX_KDTREE_SINGLE = 4, - FLANN_INDEX_HIERARCHICAL = 5, - FLANN_INDEX_LSH = 6, - FLANN_INDEX_SAVED = 254, - FLANN_INDEX_AUTOTUNED = 255, - - // deprecated constants, should use the FLANN_INDEX_* ones instead - LINEAR = 0, - KDTREE = 1, - KMEANS = 2, - COMPOSITE = 3, - KDTREE_SINGLE = 4, - SAVED = 254, - AUTOTUNED = 255 -}; - - - -enum flann_centers_init_t -{ - FLANN_CENTERS_RANDOM = 0, - FLANN_CENTERS_GONZALES = 1, - FLANN_CENTERS_KMEANSPP = 2, - FLANN_CENTERS_GROUPWISE = 3, - - // deprecated constants, should use the FLANN_CENTERS_* ones instead - CENTERS_RANDOM = 0, - CENTERS_GONZALES = 1, - CENTERS_KMEANSPP = 2 -}; - -enum flann_log_level_t -{ - FLANN_LOG_NONE = 0, - FLANN_LOG_FATAL = 1, - FLANN_LOG_ERROR = 2, - FLANN_LOG_WARN = 3, - FLANN_LOG_INFO = 4 -}; - -enum flann_distance_t -{ - FLANN_DIST_EUCLIDEAN = 1, - FLANN_DIST_L2 = 1, - FLANN_DIST_MANHATTAN = 2, - FLANN_DIST_L1 = 2, - FLANN_DIST_MINKOWSKI = 3, - FLANN_DIST_MAX = 4, - FLANN_DIST_HIST_INTERSECT = 5, - FLANN_DIST_HELLINGER = 6, - FLANN_DIST_CHI_SQUARE = 7, - FLANN_DIST_CS = 7, - FLANN_DIST_KULLBACK_LEIBLER = 8, - FLANN_DIST_KL = 8, - FLANN_DIST_HAMMING = 9, - - // deprecated constants, should use the FLANN_DIST_* ones instead - EUCLIDEAN = 1, - MANHATTAN = 2, - MINKOWSKI = 3, - MAX_DIST = 4, - HIST_INTERSECT = 5, - HELLINGER = 6, - CS = 7, - KL = 8, - KULLBACK_LEIBLER = 8 -}; - -enum flann_datatype_t -{ - FLANN_INT8 = 0, - FLANN_INT16 = 1, - FLANN_INT32 = 2, - FLANN_INT64 = 3, - FLANN_UINT8 = 4, - FLANN_UINT16 = 5, - FLANN_UINT32 = 6, - FLANN_UINT64 = 7, - FLANN_FLOAT32 = 8, - FLANN_FLOAT64 = 9 -}; - -enum -{ - FLANN_CHECKS_UNLIMITED = -1, - FLANN_CHECKS_AUTOTUNED = -2 -}; - -} - -#endif /* OPENCV_FLANN_DEFINES_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/dist.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/dist.h deleted file mode 100644 index 2bb4fc9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/dist.h +++ /dev/null @@ -1,904 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_DIST_H_ -#define OPENCV_FLANN_DIST_H_ - -#include -#include -#include -#ifdef _MSC_VER -typedef unsigned __int32 uint32_t; -typedef unsigned __int64 uint64_t; -#else -#include -#endif - -#include "defines.h" - -#if defined _WIN32 && defined(_M_ARM) -# include -#endif - -#if defined(__ARM_NEON__) && !defined(__CUDACC__) -# include "arm_neon.h" -#endif - -namespace cvflann -{ - -template -inline T abs(T x) { return (x<0) ? -x : x; } - -template<> -inline int abs(int x) { return ::abs(x); } - -template<> -inline float abs(float x) { return fabsf(x); } - -template<> -inline double abs(double x) { return fabs(x); } - -template -struct Accumulator { typedef T Type; }; -template<> -struct Accumulator { typedef float Type; }; -template<> -struct Accumulator { typedef float Type; }; -template<> -struct Accumulator { typedef float Type; }; -template<> -struct Accumulator { typedef float Type; }; -template<> -struct Accumulator { typedef float Type; }; -template<> -struct Accumulator { typedef float Type; }; - -#undef True -#undef False - -class True -{ -}; - -class False -{ -}; - - -/** - * Squared Euclidean distance functor. - * - * This is the simpler, unrolled version. This is preferable for - * very low dimensionality data (eg 3D points) - */ -template -struct L2_Simple -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const - { - ResultType result = ResultType(); - ResultType diff; - for(size_t i = 0; i < size; ++i ) { - diff = *a++ - *b++; - result += diff*diff; - } - return result; - } - - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - return (a-b)*(a-b); - } -}; - - - -/** - * Squared Euclidean distance functor, optimized version - */ -template -struct L2 -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the squared Euclidean distance between two vectors. - * - * This is highly optimised, with loop unrolling, as it is one - * of the most expensive inner loops. - * - * The computation of squared root at the end is omitted for - * efficiency. - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType diff0, diff1, diff2, diff3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - diff0 = (ResultType)(a[0] - b[0]); - diff1 = (ResultType)(a[1] - b[1]); - diff2 = (ResultType)(a[2] - b[2]); - diff3 = (ResultType)(a[3] - b[3]); - result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3; - a += 4; - b += 4; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - /* Process last 0-3 pixels. Not needed for standard vector lengths. */ - while (a < last) { - diff0 = (ResultType)(*a++ - *b++); - result += diff0 * diff0; - } - return result; - } - - /** - * Partial euclidean distance, using just one dimension. This is used by the - * kd-tree when computing partial distances while traversing the tree. - * - * Squared root is omitted for efficiency. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - return (a-b)*(a-b); - } -}; - - -/* - * Manhattan distance functor, optimized version - */ -template -struct L1 -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the Manhattan (L_1) distance between two vectors. - * - * This is highly optimised, with loop unrolling, as it is one - * of the most expensive inner loops. - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType diff0, diff1, diff2, diff3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - diff0 = (ResultType)abs(a[0] - b[0]); - diff1 = (ResultType)abs(a[1] - b[1]); - diff2 = (ResultType)abs(a[2] - b[2]); - diff3 = (ResultType)abs(a[3] - b[3]); - result += diff0 + diff1 + diff2 + diff3; - a += 4; - b += 4; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - /* Process last 0-3 pixels. Not needed for standard vector lengths. */ - while (a < last) { - diff0 = (ResultType)abs(*a++ - *b++); - result += diff0; - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - return abs(a-b); - } -}; - - - -template -struct MinkowskiDistance -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - int order; - - MinkowskiDistance(int order_) : order(order_) {} - - /** - * Compute the Minkowsky (L_p) distance between two vectors. - * - * This is highly optimised, with loop unrolling, as it is one - * of the most expensive inner loops. - * - * The computation of squared root at the end is omitted for - * efficiency. - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType diff0, diff1, diff2, diff3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - diff0 = (ResultType)abs(a[0] - b[0]); - diff1 = (ResultType)abs(a[1] - b[1]); - diff2 = (ResultType)abs(a[2] - b[2]); - diff3 = (ResultType)abs(a[3] - b[3]); - result += pow(diff0,order) + pow(diff1,order) + pow(diff2,order) + pow(diff3,order); - a += 4; - b += 4; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - /* Process last 0-3 pixels. Not needed for standard vector lengths. */ - while (a < last) { - diff0 = (ResultType)abs(*a++ - *b++); - result += pow(diff0,order); - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - return pow(static_cast(abs(a-b)),order); - } -}; - - - -template -struct MaxDistance -{ - typedef False is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the max distance (L_infinity) between two vectors. - * - * This distance is not a valid kdtree distance, it's not dimensionwise additive. - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType diff0, diff1, diff2, diff3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - diff0 = abs(a[0] - b[0]); - diff1 = abs(a[1] - b[1]); - diff2 = abs(a[2] - b[2]); - diff3 = abs(a[3] - b[3]); - if (diff0>result) {result = diff0; } - if (diff1>result) {result = diff1; } - if (diff2>result) {result = diff2; } - if (diff3>result) {result = diff3; } - a += 4; - b += 4; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - /* Process last 0-3 pixels. Not needed for standard vector lengths. */ - while (a < last) { - diff0 = abs(*a++ - *b++); - result = (diff0>result) ? diff0 : result; - } - return result; - } - - /* This distance functor is not dimension-wise additive, which - * makes it an invalid kd-tree distance, not implementing the accum_dist method */ - -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** - * Hamming distance functor - counts the bit differences between two strings - useful for the Brief descriptor - * bit count of A exclusive XOR'ed with B - */ -struct HammingLUT -{ - typedef False is_kdtree_distance; - typedef False is_vector_space_distance; - - typedef unsigned char ElementType; - typedef int ResultType; - - /** this will count the bits in a ^ b - */ - ResultType operator()(const unsigned char* a, const unsigned char* b, size_t size) const - { - static const uchar popCountTable[] = - { - 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, - 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8 - }; - ResultType result = 0; - for (size_t i = 0; i < size; i++) { - result += popCountTable[a[i] ^ b[i]]; - } - return result; - } -}; - -/** - * Hamming distance functor (pop count between two binary vectors, i.e. xor them and count the number of bits set) - * That code was taken from brief.cpp in OpenCV - */ -template -struct Hamming -{ - typedef False is_kdtree_distance; - typedef False is_vector_space_distance; - - - typedef T ElementType; - typedef int ResultType; - - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const - { - ResultType result = 0; -#if defined(__ARM_NEON__) && !defined(__CUDACC__) - { - uint32x4_t bits = vmovq_n_u32(0); - for (size_t i = 0; i < size; i += 16) { - uint8x16_t A_vec = vld1q_u8 (a + i); - uint8x16_t B_vec = vld1q_u8 (b + i); - uint8x16_t AxorB = veorq_u8 (A_vec, B_vec); - uint8x16_t bitsSet = vcntq_u8 (AxorB); - uint16x8_t bitSet8 = vpaddlq_u8 (bitsSet); - uint32x4_t bitSet4 = vpaddlq_u16 (bitSet8); - bits = vaddq_u32(bits, bitSet4); - } - uint64x2_t bitSet2 = vpaddlq_u32 (bits); - result = vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),0); - result += vgetq_lane_s32 (vreinterpretq_s32_u64(bitSet2),2); - } -#elif __GNUC__ - { - //for portability just use unsigned long -- and use the __builtin_popcountll (see docs for __builtin_popcountll) - typedef unsigned long long pop_t; - const size_t modulo = size % sizeof(pop_t); - const pop_t* a2 = reinterpret_cast (a); - const pop_t* b2 = reinterpret_cast (b); - const pop_t* a2_end = a2 + (size / sizeof(pop_t)); - - for (; a2 != a2_end; ++a2, ++b2) result += __builtin_popcountll((*a2) ^ (*b2)); - - if (modulo) { - //in the case where size is not dividable by sizeof(size_t) - //need to mask off the bits at the end - pop_t a_final = 0, b_final = 0; - memcpy(&a_final, a2, modulo); - memcpy(&b_final, b2, modulo); - result += __builtin_popcountll(a_final ^ b_final); - } - } -#else // NO NEON and NOT GNUC - HammingLUT lut; - result = lut(reinterpret_cast (a), - reinterpret_cast (b), size); -#endif - return result; - } -}; - -template -struct Hamming2 -{ - typedef False is_kdtree_distance; - typedef False is_vector_space_distance; - - typedef T ElementType; - typedef int ResultType; - - /** This is popcount_3() from: - * http://en.wikipedia.org/wiki/Hamming_weight */ - unsigned int popcnt32(uint32_t n) const - { - n -= ((n >> 1) & 0x55555555); - n = (n & 0x33333333) + ((n >> 2) & 0x33333333); - return (((n + (n >> 4))& 0xF0F0F0F)* 0x1010101) >> 24; - } - -#ifdef FLANN_PLATFORM_64_BIT - unsigned int popcnt64(uint64_t n) const - { - n -= ((n >> 1) & 0x5555555555555555); - n = (n & 0x3333333333333333) + ((n >> 2) & 0x3333333333333333); - return (((n + (n >> 4))& 0x0f0f0f0f0f0f0f0f)* 0x0101010101010101) >> 56; - } -#endif - - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const - { -#ifdef FLANN_PLATFORM_64_BIT - const uint64_t* pa = reinterpret_cast(a); - const uint64_t* pb = reinterpret_cast(b); - ResultType result = 0; - size /= (sizeof(uint64_t)/sizeof(unsigned char)); - for(size_t i = 0; i < size; ++i ) { - result += popcnt64(*pa ^ *pb); - ++pa; - ++pb; - } -#else - const uint32_t* pa = reinterpret_cast(a); - const uint32_t* pb = reinterpret_cast(b); - ResultType result = 0; - size /= (sizeof(uint32_t)/sizeof(unsigned char)); - for(size_t i = 0; i < size; ++i ) { - result += popcnt32(*pa ^ *pb); - ++pa; - ++pb; - } -#endif - return result; - } -}; - - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -template -struct HistIntersectionDistance -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the histogram intersection distance - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType min0, min1, min2, min3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - min0 = (ResultType)(a[0] < b[0] ? a[0] : b[0]); - min1 = (ResultType)(a[1] < b[1] ? a[1] : b[1]); - min2 = (ResultType)(a[2] < b[2] ? a[2] : b[2]); - min3 = (ResultType)(a[3] < b[3] ? a[3] : b[3]); - result += min0 + min1 + min2 + min3; - a += 4; - b += 4; - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - /* Process last 0-3 pixels. Not needed for standard vector lengths. */ - while (a < last) { - min0 = (ResultType)(*a < *b ? *a : *b); - result += min0; - ++a; - ++b; - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - return a -struct HellingerDistance -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the Hellinger distance - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const - { - ResultType result = ResultType(); - ResultType diff0, diff1, diff2, diff3; - Iterator1 last = a + size; - Iterator1 lastgroup = last - 3; - - /* Process 4 items with each loop for efficiency. */ - while (a < lastgroup) { - diff0 = sqrt(static_cast(a[0])) - sqrt(static_cast(b[0])); - diff1 = sqrt(static_cast(a[1])) - sqrt(static_cast(b[1])); - diff2 = sqrt(static_cast(a[2])) - sqrt(static_cast(b[2])); - diff3 = sqrt(static_cast(a[3])) - sqrt(static_cast(b[3])); - result += diff0 * diff0 + diff1 * diff1 + diff2 * diff2 + diff3 * diff3; - a += 4; - b += 4; - } - while (a < last) { - diff0 = sqrt(static_cast(*a++)) - sqrt(static_cast(*b++)); - result += diff0 * diff0; - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - ResultType diff = sqrt(static_cast(a)) - sqrt(static_cast(b)); - return diff * diff; - } -}; - - -template -struct ChiSquareDistance -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the chi-square distance - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - ResultType sum, diff; - Iterator1 last = a + size; - - while (a < last) { - sum = (ResultType)(*a + *b); - if (sum>0) { - diff = (ResultType)(*a - *b); - result += diff*diff/sum; - } - ++a; - ++b; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - ResultType result = ResultType(); - ResultType sum, diff; - - sum = (ResultType)(a+b); - if (sum>0) { - diff = (ResultType)(a-b); - result = diff*diff/sum; - } - return result; - } -}; - - -template -struct KL_Divergence -{ - typedef True is_kdtree_distance; - typedef True is_vector_space_distance; - - typedef T ElementType; - typedef typename Accumulator::Type ResultType; - - /** - * Compute the Kullback-Leibler divergence - */ - template - ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType worst_dist = -1) const - { - ResultType result = ResultType(); - Iterator1 last = a + size; - - while (a < last) { - if (* b != 0) { - ResultType ratio = (ResultType)(*a / *b); - if (ratio>0) { - result += *a * log(ratio); - } - } - ++a; - ++b; - - if ((worst_dist>0)&&(result>worst_dist)) { - return result; - } - } - return result; - } - - /** - * Partial distance, used by the kd-tree. - */ - template - inline ResultType accum_dist(const U& a, const V& b, int) const - { - ResultType result = ResultType(); - if( *b != 0 ) { - ResultType ratio = (ResultType)(a / b); - if (ratio>0) { - result = a * log(ratio); - } - } - return result; - } -}; - - - -/* - * This is a "zero iterator". It basically behaves like a zero filled - * array to all algorithms that use arrays as iterators (STL style). - * It's useful when there's a need to compute the distance between feature - * and origin it and allows for better compiler optimisation than using a - * zero-filled array. - */ -template -struct ZeroIterator -{ - - T operator*() - { - return 0; - } - - T operator[](int) - { - return 0; - } - - const ZeroIterator& operator ++() - { - return *this; - } - - ZeroIterator operator ++(int) - { - return *this; - } - - ZeroIterator& operator+=(int) - { - return *this; - } - -}; - - -/* - * Depending on processed distances, some of them are already squared (e.g. L2) - * and some are not (e.g.Hamming). In KMeans++ for instance we want to be sure - * we are working on ^2 distances, thus following templates to ensure that. - */ -template -struct squareDistance -{ - typedef typename Distance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist*dist; } -}; - - -template -struct squareDistance, ElementType> -{ - typedef typename L2_Simple::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - -template -struct squareDistance, ElementType> -{ - typedef typename L2::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - - -template -struct squareDistance, ElementType> -{ - typedef typename MinkowskiDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - -template -struct squareDistance, ElementType> -{ - typedef typename HellingerDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - -template -struct squareDistance, ElementType> -{ - typedef typename ChiSquareDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - - -template -typename Distance::ResultType ensureSquareDistance( typename Distance::ResultType dist ) -{ - typedef typename Distance::ElementType ElementType; - - squareDistance dummy; - return dummy( dist ); -} - - -/* - * ...and a template to ensure the user that he will process the normal distance, - * and not squared distance, without losing processing time calling sqrt(ensureSquareDistance) - * that will result in doing actually sqrt(dist*dist) for L1 distance for instance. - */ -template -struct simpleDistance -{ - typedef typename Distance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return dist; } -}; - - -template -struct simpleDistance, ElementType> -{ - typedef typename L2_Simple::ResultType ResultType; - ResultType operator()( ResultType dist ) { return sqrt(dist); } -}; - -template -struct simpleDistance, ElementType> -{ - typedef typename L2::ResultType ResultType; - ResultType operator()( ResultType dist ) { return sqrt(dist); } -}; - - -template -struct simpleDistance, ElementType> -{ - typedef typename MinkowskiDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return sqrt(dist); } -}; - -template -struct simpleDistance, ElementType> -{ - typedef typename HellingerDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return sqrt(dist); } -}; - -template -struct simpleDistance, ElementType> -{ - typedef typename ChiSquareDistance::ResultType ResultType; - ResultType operator()( ResultType dist ) { return sqrt(dist); } -}; - - -template -typename Distance::ResultType ensureSimpleDistance( typename Distance::ResultType dist ) -{ - typedef typename Distance::ElementType ElementType; - - simpleDistance dummy; - return dummy( dist ); -} - -} - -#endif //OPENCV_FLANN_DIST_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/dummy.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/dummy.h deleted file mode 100644 index d6837e5..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/dummy.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifndef OPENCV_FLANN_DUMMY_H_ -#define OPENCV_FLANN_DUMMY_H_ - -namespace cvflann -{ - -CV_DEPRECATED inline void dummyfunc() {} - -} - - -#endif /* OPENCV_FLANN_DUMMY_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/dynamic_bitset.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/dynamic_bitset.h deleted file mode 100644 index 923b658..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/dynamic_bitset.h +++ /dev/null @@ -1,159 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -/*********************************************************************** - * Author: Vincent Rabaud - *************************************************************************/ - -#ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_ -#define OPENCV_FLANN_DYNAMIC_BITSET_H_ - -#ifndef FLANN_USE_BOOST -# define FLANN_USE_BOOST 0 -#endif -//#define FLANN_USE_BOOST 1 -#if FLANN_USE_BOOST -#include -typedef boost::dynamic_bitset<> DynamicBitset; -#else - -#include - -#include "dist.h" - -namespace cvflann { - -/** Class re-implementing the boost version of it - * This helps not depending on boost, it also does not do the bound checks - * and has a way to reset a block for speed - */ -class DynamicBitset -{ -public: - /** default constructor - */ - DynamicBitset() : size_(0) - { - } - - /** only constructor we use in our code - * @param sz the size of the bitset (in bits) - */ - DynamicBitset(size_t sz) - { - resize(sz); - reset(); - } - - /** Sets all the bits to 0 - */ - void clear() - { - std::fill(bitset_.begin(), bitset_.end(), 0); - } - - /** @brief checks if the bitset is empty - * @return true if the bitset is empty - */ - bool empty() const - { - return bitset_.empty(); - } - - /** set all the bits to 0 - */ - void reset() - { - std::fill(bitset_.begin(), bitset_.end(), 0); - } - - /** @brief set one bit to 0 - * @param index - */ - void reset(size_t index) - { - bitset_[index / cell_bit_size_] &= ~(size_t(1) << (index % cell_bit_size_)); - } - - /** @brief sets a specific bit to 0, and more bits too - * This function is useful when resetting a given set of bits so that the - * whole bitset ends up being 0: if that's the case, we don't care about setting - * other bits to 0 - * @param index - */ - void reset_block(size_t index) - { - bitset_[index / cell_bit_size_] = 0; - } - - /** resize the bitset so that it contains at least sz bits - * @param sz - */ - void resize(size_t sz) - { - size_ = sz; - bitset_.resize(sz / cell_bit_size_ + 1); - } - - /** set a bit to true - * @param index the index of the bit to set to 1 - */ - void set(size_t index) - { - bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_); - } - - /** gives the number of contained bits - */ - size_t size() const - { - return size_; - } - - /** check if a bit is set - * @param index the index of the bit to check - * @return true if the bit is set - */ - bool test(size_t index) const - { - return (bitset_[index / cell_bit_size_] & (size_t(1) << (index % cell_bit_size_))) != 0; - } - -private: - std::vector bitset_; - size_t size_; - static const unsigned int cell_bit_size_ = CHAR_BIT * sizeof(size_t); -}; - -} // namespace cvflann - -#endif - -#endif // OPENCV_FLANN_DYNAMIC_BITSET_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/flann.hpp b/qt-correction-tool/pub/opencv/include/opencv2/flann/flann.hpp deleted file mode 100644 index 227683f..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/flann.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/flann.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/flann_base.hpp b/qt-correction-tool/pub/opencv/include/opencv2/flann/flann_base.hpp deleted file mode 100644 index 0ffb857..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/flann_base.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_BASE_HPP_ -#define OPENCV_FLANN_BASE_HPP_ - -#include -#include -#include - -#include "general.h" -#include "matrix.h" -#include "params.h" -#include "saving.h" - -#include "all_indices.h" - -namespace cvflann -{ - -/** - * Sets the log level used for all flann functions - * @param level Verbosity level - */ -inline void log_verbosity(int level) -{ - if (level >= 0) { - Logger::setLevel(level); - } -} - -/** - * (Deprecated) Index parameters for creating a saved index. - */ -struct SavedIndexParams : public IndexParams -{ - SavedIndexParams(cv::String filename) - { - (* this)["algorithm"] = FLANN_INDEX_SAVED; - (*this)["filename"] = filename; - } -}; - - -template -NNIndex* load_saved_index(const Matrix& dataset, const cv::String& filename, Distance distance) -{ - typedef typename Distance::ElementType ElementType; - - FILE* fin = fopen(filename.c_str(), "rb"); - if (fin == NULL) { - return NULL; - } - IndexHeader header = load_header(fin); - if (header.data_type != Datatype::type()) { - fclose(fin); - throw FLANNException("Datatype of saved index is different than of the one to be created."); - } - if ((size_t(header.rows) != dataset.rows)||(size_t(header.cols) != dataset.cols)) { - fclose(fin); - throw FLANNException("The index saved belongs to a different dataset"); - } - - IndexParams params; - params["algorithm"] = header.index_type; - NNIndex* nnIndex = create_index_by_type(dataset, params, distance); - nnIndex->loadIndex(fin); - fclose(fin); - - return nnIndex; -} - - -template -class Index : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - Index(const Matrix& features, const IndexParams& params, Distance distance = Distance() ) - : index_params_(params) - { - flann_algorithm_t index_type = get_param(params,"algorithm"); - loaded_ = false; - - if (index_type == FLANN_INDEX_SAVED) { - nnIndex_ = load_saved_index(features, get_param(params,"filename"), distance); - loaded_ = true; - } - else { - nnIndex_ = create_index_by_type(features, params, distance); - } - } - - ~Index() - { - delete nnIndex_; - } - - /** - * Builds the index. - */ - void buildIndex() CV_OVERRIDE - { - if (!loaded_) { - nnIndex_->buildIndex(); - } - } - - void save(cv::String filename) - { - FILE* fout = fopen(filename.c_str(), "wb"); - if (fout == NULL) { - throw FLANNException("Cannot open file"); - } - save_header(fout, *nnIndex_); - saveIndex(fout); - fclose(fout); - } - - /** - * \brief Saves the index to a stream - * \param stream The stream to save the index to - */ - virtual void saveIndex(FILE* stream) CV_OVERRIDE - { - nnIndex_->saveIndex(stream); - } - - /** - * \brief Loads the index from a stream - * \param stream The stream from which the index is loaded - */ - virtual void loadIndex(FILE* stream) CV_OVERRIDE - { - nnIndex_->loadIndex(stream); - } - - /** - * \returns number of features in this index. - */ - size_t veclen() const CV_OVERRIDE - { - return nnIndex_->veclen(); - } - - /** - * \returns The dimensionality of the features in this index. - */ - size_t size() const CV_OVERRIDE - { - return nnIndex_->size(); - } - - /** - * \returns The index type (kdtree, kmeans,...) - */ - flann_algorithm_t getType() const CV_OVERRIDE - { - return nnIndex_->getType(); - } - - /** - * \returns The amount of memory (in bytes) used by the index. - */ - virtual int usedMemory() const CV_OVERRIDE - { - return nnIndex_->usedMemory(); - } - - - /** - * \returns The index parameters - */ - IndexParams getParameters() const CV_OVERRIDE - { - return nnIndex_->getParameters(); - } - - /** - * \brief Perform k-nearest neighbor search - * \param[in] queries The query points for which to find the nearest neighbors - * \param[out] indices The indices of the nearest neighbors found - * \param[out] dists Distances to the nearest neighbors found - * \param[in] knn Number of nearest neighbors to return - * \param[in] params Search parameters - */ - void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE - { - nnIndex_->knnSearch(queries, indices, dists, knn, params); - } - - /** - * \brief Perform radius search - * \param[in] query The query point - * \param[out] indices The indinces of the neighbors found within the given radius - * \param[out] dists The distances to the nearest neighbors found - * \param[in] radius The radius used for search - * \param[in] params Search parameters - * \returns Number of neighbors found - */ - int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) CV_OVERRIDE - { - return nnIndex_->radiusSearch(query, indices, dists, radius, params); - } - - /** - * \brief Method that searches for nearest-neighbours - */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - nnIndex_->findNeighbors(result, vec, searchParams); - } - - /** - * \brief Returns actual index - */ - CV_DEPRECATED NNIndex* getIndex() - { - return nnIndex_; - } - - /** - * \brief Returns index parameters. - * \deprecated use getParameters() instead. - */ - CV_DEPRECATED const IndexParams* getIndexParameters() - { - return &index_params_; - } - -private: - /** Pointer to actual index class */ - NNIndex* nnIndex_; - /** Indices if the index was loaded from a file */ - bool loaded_; - /** Parameters passed to the index */ - IndexParams index_params_; - - Index(const Index &); // copy disabled - Index& operator=(const Index &); // assign disabled -}; - -/** - * Performs a hierarchical clustering of the points passed as argument and then takes a cut in the - * the clustering tree to return a flat clustering. - * @param[in] points Points to be clustered - * @param centers The computed cluster centres. Matrix should be preallocated and centers.rows is the - * number of clusters requested. - * @param params Clustering parameters (The same as for cvflann::KMeansIndex) - * @param d Distance to be used for clustering (eg: cvflann::L2) - * @return number of clusters computed (can be different than clusters.rows and is the highest number - * of the form (branching-1)*K+1 smaller than clusters.rows). - */ -template -int hierarchicalClustering(const Matrix& points, Matrix& centers, - const KMeansIndexParams& params, Distance d = Distance()) -{ - KMeansIndex kmeans(points, params, d); - kmeans.buildIndex(); - - int clusterNum = kmeans.getClusterCenters(centers); - return clusterNum; -} - -} -#endif /* OPENCV_FLANN_BASE_HPP_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/general.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/general.h deleted file mode 100644 index 9d5402a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/general.h +++ /dev/null @@ -1,50 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_GENERAL_H_ -#define OPENCV_FLANN_GENERAL_H_ - -#include "opencv2/core.hpp" - -namespace cvflann -{ - -class FLANNException : public cv::Exception -{ -public: - FLANNException(const char* message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } - - FLANNException(const cv::String& message) : cv::Exception(0, message, "", __FILE__, __LINE__) { } -}; - -} - - -#endif /* OPENCV_FLANN_GENERAL_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/ground_truth.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/ground_truth.h deleted file mode 100644 index fd8f3ae..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/ground_truth.h +++ /dev/null @@ -1,94 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_GROUND_TRUTH_H_ -#define OPENCV_FLANN_GROUND_TRUTH_H_ - -#include "dist.h" -#include "matrix.h" - - -namespace cvflann -{ - -template -void find_nearest(const Matrix& dataset, typename Distance::ElementType* query, int* matches, int nn, - int skip = 0, Distance distance = Distance()) -{ - typedef typename Distance::ResultType DistanceType; - int n = nn + skip; - - std::vector match(n); - std::vector dists(n); - - dists[0] = distance(dataset[0], query, dataset.cols); - match[0] = 0; - int dcnt = 1; - - for (size_t i=1; i=1 && dists[j] -void compute_ground_truth(const Matrix& dataset, const Matrix& testset, Matrix& matches, - int skip=0, Distance d = Distance()) -{ - for (size_t i=0; i(dataset, testset[i], matches[i], (int)matches.cols, skip, d); - } -} - - -} - -#endif //OPENCV_FLANN_GROUND_TRUTH_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/hdf5.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/hdf5.h deleted file mode 100644 index 80d23b9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/hdf5.h +++ /dev/null @@ -1,231 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_HDF5_H_ -#define OPENCV_FLANN_HDF5_H_ - -#include - -#include "matrix.h" - - -namespace cvflann -{ - -namespace -{ - -template -hid_t get_hdf5_type() -{ - throw FLANNException("Unsupported type for IO operations"); -} - -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_CHAR; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_UCHAR; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_SHORT; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_USHORT; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_INT; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_UINT; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_LONG; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_ULONG; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_FLOAT; } -template<> -hid_t get_hdf5_type() { return H5T_NATIVE_DOUBLE; } -} - - -#define CHECK_ERROR(x,y) if ((x)<0) throw FLANNException((y)); - -template -void save_to_file(const cvflann::Matrix& dataset, const String& filename, const String& name) -{ - -#if H5Eset_auto_vers == 2 - H5Eset_auto( H5E_DEFAULT, NULL, NULL ); -#else - H5Eset_auto( NULL, NULL ); -#endif - - herr_t status; - hid_t file_id; - file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT); - if (file_id < 0) { - file_id = H5Fcreate(filename.c_str(), H5F_ACC_EXCL, H5P_DEFAULT, H5P_DEFAULT); - } - CHECK_ERROR(file_id,"Error creating hdf5 file."); - - hsize_t dimsf[2]; // dataset dimensions - dimsf[0] = dataset.rows; - dimsf[1] = dataset.cols; - - hid_t space_id = H5Screate_simple(2, dimsf, NULL); - hid_t memspace_id = H5Screate_simple(2, dimsf, NULL); - - hid_t dataset_id; -#if H5Dcreate_vers == 2 - dataset_id = H5Dcreate2(file_id, name.c_str(), get_hdf5_type(), space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); -#else - dataset_id = H5Dcreate(file_id, name.c_str(), get_hdf5_type(), space_id, H5P_DEFAULT); -#endif - - if (dataset_id<0) { -#if H5Dopen_vers == 2 - dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); -#else - dataset_id = H5Dopen(file_id, name.c_str()); -#endif - } - CHECK_ERROR(dataset_id,"Error creating or opening dataset in file."); - - status = H5Dwrite(dataset_id, get_hdf5_type(), memspace_id, space_id, H5P_DEFAULT, dataset.data ); - CHECK_ERROR(status, "Error writing to dataset"); - - H5Sclose(memspace_id); - H5Sclose(space_id); - H5Dclose(dataset_id); - H5Fclose(file_id); - -} - - -template -void load_from_file(cvflann::Matrix& dataset, const String& filename, const String& name) -{ - herr_t status; - hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, H5P_DEFAULT); - CHECK_ERROR(file_id,"Error opening hdf5 file."); - - hid_t dataset_id; -#if H5Dopen_vers == 2 - dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); -#else - dataset_id = H5Dopen(file_id, name.c_str()); -#endif - CHECK_ERROR(dataset_id,"Error opening dataset in file."); - - hid_t space_id = H5Dget_space(dataset_id); - - hsize_t dims_out[2]; - H5Sget_simple_extent_dims(space_id, dims_out, NULL); - - dataset = cvflann::Matrix(new T[dims_out[0]*dims_out[1]], dims_out[0], dims_out[1]); - - status = H5Dread(dataset_id, get_hdf5_type(), H5S_ALL, H5S_ALL, H5P_DEFAULT, dataset[0]); - CHECK_ERROR(status, "Error reading dataset"); - - H5Sclose(space_id); - H5Dclose(dataset_id); - H5Fclose(file_id); -} - - -#ifdef HAVE_MPI - -namespace mpi -{ -/** - * Loads a the hyperslice corresponding to this processor from a hdf5 file. - * @param flann_dataset Dataset where the data is loaded - * @param filename HDF5 file name - * @param name Name of dataset inside file - */ -template -void load_from_file(cvflann::Matrix& dataset, const String& filename, const String& name) -{ - MPI_Comm comm = MPI_COMM_WORLD; - MPI_Info info = MPI_INFO_NULL; - - int mpi_size, mpi_rank; - MPI_Comm_size(comm, &mpi_size); - MPI_Comm_rank(comm, &mpi_rank); - - herr_t status; - - hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS); - H5Pset_fapl_mpio(plist_id, comm, info); - hid_t file_id = H5Fopen(filename.c_str(), H5F_ACC_RDWR, plist_id); - CHECK_ERROR(file_id,"Error opening hdf5 file."); - H5Pclose(plist_id); - hid_t dataset_id; -#if H5Dopen_vers == 2 - dataset_id = H5Dopen2(file_id, name.c_str(), H5P_DEFAULT); -#else - dataset_id = H5Dopen(file_id, name.c_str()); -#endif - CHECK_ERROR(dataset_id,"Error opening dataset in file."); - - hid_t space_id = H5Dget_space(dataset_id); - hsize_t dims[2]; - H5Sget_simple_extent_dims(space_id, dims, NULL); - - hsize_t count[2]; - hsize_t offset[2]; - - hsize_t item_cnt = dims[0]/mpi_size+(dims[0]%mpi_size==0 ? 0 : 1); - hsize_t cnt = (mpi_rank(), memspace_id, space_id, plist_id, dataset.data); - CHECK_ERROR(status, "Error reading dataset"); - - H5Pclose(plist_id); - H5Sclose(space_id); - H5Sclose(memspace_id); - H5Dclose(dataset_id); - H5Fclose(file_id); -} -} -#endif // HAVE_MPI -} // namespace cvflann::mpi - -#endif /* OPENCV_FLANN_HDF5_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/heap.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/heap.h deleted file mode 100644 index 92a6ea6..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/heap.h +++ /dev/null @@ -1,165 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_HEAP_H_ -#define OPENCV_FLANN_HEAP_H_ - -#include -#include - -namespace cvflann -{ - -/** - * Priority Queue Implementation - * - * The priority queue is implemented with a heap. A heap is a complete - * (full) binary tree in which each parent is less than both of its - * children, but the order of the children is unspecified. - */ -template -class Heap -{ - - /** - * Storage array for the heap. - * Type T must be comparable. - */ - std::vector heap; - int length; - - /** - * Number of element in the heap - */ - int count; - - - -public: - /** - * Constructor. - * - * Params: - * sz = heap size - */ - - Heap(int sz) - { - length = sz; - heap.reserve(length); - count = 0; - } - - /** - * - * Returns: heap size - */ - int size() - { - return count; - } - - /** - * Tests if the heap is empty - * - * Returns: true is heap empty, false otherwise - */ - bool empty() - { - return size()==0; - } - - /** - * Clears the heap. - */ - void clear() - { - heap.clear(); - count = 0; - } - - struct CompareT - { - bool operator()(const T& t_1, const T& t_2) const - { - return t_2 < t_1; - } - }; - - /** - * Insert a new element in the heap. - * - * We select the next empty leaf node, and then keep moving any larger - * parents down until the right location is found to store this element. - * - * Params: - * value = the new element to be inserted in the heap - */ - void insert(T value) - { - /* If heap is full, then return without adding this element. */ - if (count == length) { - return; - } - - heap.push_back(value); - static CompareT compareT; - std::push_heap(heap.begin(), heap.end(), compareT); - ++count; - } - - - - /** - * Returns the node of minimum value from the heap (top of the heap). - * - * Params: - * value = out parameter used to return the min element - * Returns: false if heap empty - */ - bool popMin(T& value) - { - if (count == 0) { - return false; - } - - value = heap[0]; - static CompareT compareT; - std::pop_heap(heap.begin(), heap.end(), compareT); - heap.pop_back(); - --count; - - return true; /* Return old last node. */ - } -}; - -} - -#endif //OPENCV_FLANN_HEAP_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/hierarchical_clustering_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/hierarchical_clustering_index.h deleted file mode 100644 index 2a947da..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/hierarchical_clustering_index.h +++ /dev/null @@ -1,848 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ -#define OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ - -#include -#include -#include -#include -#include - -#include "general.h" -#include "nn_index.h" -#include "dist.h" -#include "matrix.h" -#include "result_set.h" -#include "heap.h" -#include "allocator.h" -#include "random.h" -#include "saving.h" - - -namespace cvflann -{ - -struct HierarchicalClusteringIndexParams : public IndexParams -{ - HierarchicalClusteringIndexParams(int branching = 32, - flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, - int trees = 4, int leaf_size = 100) - { - (*this)["algorithm"] = FLANN_INDEX_HIERARCHICAL; - // The branching factor used in the hierarchical clustering - (*this)["branching"] = branching; - // Algorithm used for picking the initial cluster centers - (*this)["centers_init"] = centers_init; - // number of parallel trees to build - (*this)["trees"] = trees; - // maximum leaf size - (*this)["leaf_size"] = leaf_size; - } -}; - - -/** - * Hierarchical index - * - * Contains a tree constructed through a hierarchical clustering - * and other information for indexing a set of points for nearest-neighbour matching. - */ -template -class HierarchicalClusteringIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - -private: - - - typedef void (HierarchicalClusteringIndex::* centersAlgFunction)(int, int*, int, int*, int&); - - /** - * The function used for choosing the cluster centers. - */ - centersAlgFunction chooseCenters; - - - - /** - * Chooses the initial centers in the k-means clustering in a random manner. - * - * Params: - * k = number of centers - * vecs = the dataset of points - * indices = indices in the dataset - * indices_length = length of indices vector - * - */ - void chooseCentersRandom(int k, int* dsindices, int indices_length, int* centers, int& centers_length) - { - UniqueRandom r(indices_length); - - int index; - for (index=0; index=0 && rnd < n); - - centers[0] = dsindices[rnd]; - - int index; - for (index=1; indexbest_val) { - best_val = dist; - best_index = j; - } - } - if (best_index!=-1) { - centers[index] = dsindices[best_index]; - } - else { - break; - } - } - centers_length = index; - } - - - /** - * Chooses the initial centers in the k-means using the algorithm - * proposed in the KMeans++ paper: - * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding - * - * Implementation of this function was converted from the one provided in Arthur's code. - * - * Params: - * k = number of centers - * vecs = the dataset of points - * indices = indices in the dataset - * Returns: - */ - void chooseCentersKMeanspp(int k, int* dsindices, int indices_length, int* centers, int& centers_length) - { - int n = indices_length; - - double currentPot = 0; - DistanceType* closestDistSq = new DistanceType[n]; - - // Choose one random center and set the closestDistSq values - int index = rand_int(n); - assert(index >=0 && index < n); - centers[0] = dsindices[index]; - - // Computing distance^2 will have the advantage of even higher probability further to pick new centers - // far from previous centers (and this complies to "k-means++: the advantages of careful seeding" article) - for (int i = 0; i < n; i++) { - closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); - closestDistSq[i] = ensureSquareDistance( closestDistSq[i] ); - currentPot += closestDistSq[i]; - } - - - const int numLocalTries = 1; - - // Choose each center - int centerCount; - for (centerCount = 1; centerCount < k; centerCount++) { - - // Repeat several trials - double bestNewPot = -1; - int bestNewIndex = 0; - for (int localTrial = 0; localTrial < numLocalTries; localTrial++) { - - // Choose our center - have to be slightly careful to return a valid answer even accounting - // for possible rounding errors - double randVal = rand_double(currentPot); - for (index = 0; index < n-1; index++) { - if (randVal <= closestDistSq[index]) break; - else randVal -= closestDistSq[index]; - } - - // Compute the new potential - double newPot = 0; - for (int i = 0; i < n; i++) { - DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); - newPot += std::min( ensureSquareDistance(dist), closestDistSq[i] ); - } - - // Store the best result - if ((bestNewPot < 0)||(newPot < bestNewPot)) { - bestNewPot = newPot; - bestNewIndex = index; - } - } - - // Add the appropriate center - centers[centerCount] = dsindices[bestNewIndex]; - currentPot = bestNewPot; - for (int i = 0; i < n; i++) { - DistanceType dist = distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols); - closestDistSq[i] = std::min( ensureSquareDistance(dist), closestDistSq[i] ); - } - } - - centers_length = centerCount; - - delete[] closestDistSq; - } - - - /** - * Chooses the initial centers in a way inspired by Gonzales (by Pierre-Emmanuel Viel): - * select the first point of the list as a candidate, then parse the points list. If another - * point is further than current candidate from the other centers, test if it is a good center - * of a local aggregation. If it is, replace current candidate by this point. And so on... - * - * Used with KMeansIndex that computes centers coordinates by averaging positions of clusters points, - * this doesn't make a real difference with previous methods. But used with HierarchicalClusteringIndex - * class that pick centers among existing points instead of computing the barycenters, there is a real - * improvement. - * - * Params: - * k = number of centers - * vecs = the dataset of points - * indices = indices in the dataset - * Returns: - */ - void GroupWiseCenterChooser(int k, int* dsindices, int indices_length, int* centers, int& centers_length) - { - const float kSpeedUpFactor = 1.3f; - - int n = indices_length; - - DistanceType* closestDistSq = new DistanceType[n]; - - // Choose one random center and set the closestDistSq values - int index = rand_int(n); - assert(index >=0 && index < n); - centers[0] = dsindices[index]; - - for (int i = 0; i < n; i++) { - closestDistSq[i] = distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols); - } - - - // Choose each center - int centerCount; - for (centerCount = 1; centerCount < k; centerCount++) { - - // Repeat several trials - double bestNewPot = -1; - int bestNewIndex = 0; - DistanceType furthest = 0; - for (index = 0; index < n; index++) { - - // We will test only the potential of the points further than current candidate - if( closestDistSq[index] > kSpeedUpFactor * (float)furthest ) { - - // Compute the new potential - double newPot = 0; - for (int i = 0; i < n; i++) { - newPot += std::min( distance(dataset[dsindices[i]], dataset[dsindices[index]], dataset.cols) - , closestDistSq[i] ); - } - - // Store the best result - if ((bestNewPot < 0)||(newPot <= bestNewPot)) { - bestNewPot = newPot; - bestNewIndex = index; - furthest = closestDistSq[index]; - } - } - } - - // Add the appropriate center - centers[centerCount] = dsindices[bestNewIndex]; - for (int i = 0; i < n; i++) { - closestDistSq[i] = std::min( distance(dataset[dsindices[i]], dataset[dsindices[bestNewIndex]], dataset.cols) - , closestDistSq[i] ); - } - } - - centers_length = centerCount; - - delete[] closestDistSq; - } - - -public: - - - /** - * Index constructor - * - * Params: - * inputData = dataset with the input features - * params = parameters passed to the hierarchical k-means algorithm - */ - HierarchicalClusteringIndex(const Matrix& inputData, const IndexParams& index_params = HierarchicalClusteringIndexParams(), - Distance d = Distance()) - : dataset(inputData), params(index_params), root(NULL), indices(NULL), distance(d) - { - memoryCounter = 0; - - size_ = dataset.rows; - veclen_ = dataset.cols; - - branching_ = get_param(params,"branching",32); - centers_init_ = get_param(params,"centers_init", FLANN_CENTERS_RANDOM); - trees_ = get_param(params,"trees",4); - leaf_size_ = get_param(params,"leaf_size",100); - - if (centers_init_==FLANN_CENTERS_RANDOM) { - chooseCenters = &HierarchicalClusteringIndex::chooseCentersRandom; - } - else if (centers_init_==FLANN_CENTERS_GONZALES) { - chooseCenters = &HierarchicalClusteringIndex::chooseCentersGonzales; - } - else if (centers_init_==FLANN_CENTERS_KMEANSPP) { - chooseCenters = &HierarchicalClusteringIndex::chooseCentersKMeanspp; - } - else if (centers_init_==FLANN_CENTERS_GROUPWISE) { - chooseCenters = &HierarchicalClusteringIndex::GroupWiseCenterChooser; - } - else { - throw FLANNException("Unknown algorithm for choosing initial centers."); - } - - trees_ = get_param(params,"trees",4); - root = new NodePtr[trees_]; - indices = new int*[trees_]; - - for (int i=0; i(); - computeClustering(root[i], indices[i], (int)size_, branching_,0); - } - } - - - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_HIERARCHICAL; - } - - - void saveIndex(FILE* stream) CV_OVERRIDE - { - save_value(stream, branching_); - save_value(stream, trees_); - save_value(stream, centers_init_); - save_value(stream, leaf_size_); - save_value(stream, memoryCounter); - for (int i=0; i& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - - int maxChecks = get_param(searchParams,"checks",32); - - // Priority queue storing intermediate branches in the best-bin-first search - Heap* heap = new Heap((int)size_); - - std::vector checked(size_,false); - int checks = 0; - for (int i=0; ipopMin(branch) && (checks BranchSt; - - - - void save_tree(FILE* stream, NodePtr node, int num) - { - save_value(stream, *node); - if (node->childs==NULL) { - int indices_offset = (int)(node->indices - indices[num]); - save_value(stream, indices_offset); - } - else { - for(int i=0; ichilds[i], num); - } - } - } - - - void load_tree(FILE* stream, NodePtr& node, int num) - { - node = pool.allocate(); - load_value(stream, *node); - if (node->childs==NULL) { - int indices_offset; - load_value(stream, indices_offset); - node->indices = indices[num] + indices_offset; - } - else { - node->childs = pool.allocate(branching_); - for(int i=0; ichilds[i], num); - } - } - } - - - - - void computeLabels(int* dsindices, int indices_length, int* centers, int centers_length, int* labels, DistanceType& cost) - { - cost = 0; - for (int i=0; inew_dist) { - labels[i] = j; - dist = new_dist; - } - } - cost += dist; - } - } - - /** - * The method responsible with actually doing the recursive hierarchical - * clustering - * - * Params: - * node = the node to cluster - * indices = indices of the points belonging to the current node - * branching = the branching factor to use in the clustering - * - * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point) - */ - void computeClustering(NodePtr node, int* dsindices, int indices_length, int branching, int level) - { - node->size = indices_length; - node->level = level; - - if (indices_length < leaf_size_) { // leaf node - node->indices = dsindices; - std::sort(node->indices,node->indices+indices_length); - node->childs = NULL; - return; - } - - std::vector centers(branching); - std::vector labels(indices_length); - - int centers_length; - (this->*chooseCenters)(branching, dsindices, indices_length, ¢ers[0], centers_length); - - if (centers_lengthindices = dsindices; - std::sort(node->indices,node->indices+indices_length); - node->childs = NULL; - return; - } - - - // assign points to clusters - DistanceType cost; - computeLabels(dsindices, indices_length, ¢ers[0], centers_length, &labels[0], cost); - - node->childs = pool.allocate(branching); - int start = 0; - int end = start; - for (int i=0; ichilds[i] = pool.allocate(); - node->childs[i]->pivot = centers[i]; - node->childs[i]->indices = NULL; - computeClustering(node->childs[i],dsindices+start, end-start, branching, level+1); - start=end; - } - } - - - - /** - * Performs one descent in the hierarchical k-means tree. The branches not - * visited are stored in a priority queue. - * - * Params: - * node = node to explore - * result = container for the k-nearest neighbors found - * vec = query points - * checks = how many points in the dataset have been checked so far - * maxChecks = maximum dataset points to checks - */ - - - void findNN(NodePtr node, ResultSet& result, const ElementType* vec, int& checks, int maxChecks, - Heap* heap, std::vector& checked) - { - if (node->childs==NULL) { - if (checks>=maxChecks) { - if (result.full()) return; - } - for (int i=0; isize; ++i) { - int index = node->indices[i]; - if (!checked[index]) { - DistanceType dist = distance(dataset[index], vec, veclen_); - result.addPoint(dist, index); - checked[index] = true; - ++checks; - } - } - } - else { - DistanceType* domain_distances = new DistanceType[branching_]; - int best_index = 0; - domain_distances[best_index] = distance(vec, dataset[node->childs[best_index]->pivot], veclen_); - for (int i=1; ichilds[i]->pivot], veclen_); - if (domain_distances[i]insert(BranchSt(node->childs[i],domain_distances[i])); - } - } - delete[] domain_distances; - findNN(node->childs[best_index],result,vec, checks, maxChecks, heap, checked); - } - } - -private: - - - /** - * The dataset used by this index - */ - const Matrix dataset; - - /** - * Parameters used by this index - */ - IndexParams params; - - - /** - * Number of features in the dataset. - */ - size_t size_; - - /** - * Length of each feature. - */ - size_t veclen_; - - /** - * The root node in the tree. - */ - NodePtr* root; - - /** - * Array of indices to vectors in the dataset. - */ - int** indices; - - - /** - * The distance - */ - Distance distance; - - /** - * Pooled memory allocator. - * - * Using a pooled memory allocator is more efficient - * than allocating memory directly when there is a large - * number small of memory allocations. - */ - PooledAllocator pool; - - /** - * Memory occupied by the index. - */ - int memoryCounter; - - /** index parameters */ - int branching_; - int trees_; - flann_centers_init_t centers_init_; - int leaf_size_; - - -}; - -} - -#endif /* OPENCV_FLANN_HIERARCHICAL_CLUSTERING_INDEX_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/index_testing.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/index_testing.h deleted file mode 100644 index d764004..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/index_testing.h +++ /dev/null @@ -1,318 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_INDEX_TESTING_H_ -#define OPENCV_FLANN_INDEX_TESTING_H_ - -#include -#include -#include - -#include "matrix.h" -#include "nn_index.h" -#include "result_set.h" -#include "logger.h" -#include "timer.h" - - -namespace cvflann -{ - -inline int countCorrectMatches(int* neighbors, int* groundTruth, int n) -{ - int count = 0; - for (int i=0; i -typename Distance::ResultType computeDistanceRaport(const Matrix& inputData, typename Distance::ElementType* target, - int* neighbors, int* groundTruth, int veclen, int n, const Distance& distance) -{ - typedef typename Distance::ResultType DistanceType; - - DistanceType ret = 0; - for (int i=0; i -float search_with_ground_truth(NNIndex& index, const Matrix& inputData, - const Matrix& testData, const Matrix& matches, int nn, int checks, - float& time, typename Distance::ResultType& dist, const Distance& distance, int skipMatches) -{ - typedef typename Distance::ResultType DistanceType; - - if (matches.cols resultSet(nn+skipMatches); - SearchParams searchParams(checks); - - std::vector indices(nn+skipMatches); - std::vector dists(nn+skipMatches); - int* neighbors = &indices[skipMatches]; - - int correct = 0; - DistanceType distR = 0; - StartStopTimer t; - int repeats = 0; - while (t.value<0.2) { - repeats++; - t.start(); - correct = 0; - distR = 0; - for (size_t i = 0; i < testData.rows; i++) { - resultSet.init(&indices[0], &dists[0]); - index.findNeighbors(resultSet, testData[i], searchParams); - - correct += countCorrectMatches(neighbors,matches[i], nn); - distR += computeDistanceRaport(inputData, testData[i], neighbors, matches[i], (int)testData.cols, nn, distance); - } - t.stop(); - } - time = float(t.value/repeats); - - float precicion = (float)correct/(nn*testData.rows); - - dist = distR/(testData.rows*nn); - - Logger::info("%8d %10.4g %10.5g %10.5g %10.5g\n", - checks, precicion, time, 1000.0 * time / testData.rows, dist); - - return precicion; -} - - -template -float test_index_checks(NNIndex& index, const Matrix& inputData, - const Matrix& testData, const Matrix& matches, - int checks, float& precision, const Distance& distance, int nn = 1, int skipMatches = 0) -{ - typedef typename Distance::ResultType DistanceType; - - Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); - Logger::info("---------------------------------------------------------\n"); - - float time = 0; - DistanceType dist = 0; - precision = search_with_ground_truth(index, inputData, testData, matches, nn, checks, time, dist, distance, skipMatches); - - return time; -} - -template -float test_index_precision(NNIndex& index, const Matrix& inputData, - const Matrix& testData, const Matrix& matches, - float precision, int& checks, const Distance& distance, int nn = 1, int skipMatches = 0) -{ - typedef typename Distance::ResultType DistanceType; - const float SEARCH_EPS = 0.001f; - - Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); - Logger::info("---------------------------------------------------------\n"); - - int c2 = 1; - float p2; - int c1 = 1; - //float p1; - float time; - DistanceType dist; - - p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches); - - if (p2>precision) { - Logger::info("Got as close as I can\n"); - checks = c2; - return time; - } - - while (p2SEARCH_EPS) { - Logger::info("Start linear estimation\n"); - // after we got to values in the vecinity of the desired precision - // use linear approximation get a better estimation - - cx = (c1+c2)/2; - realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches); - while (fabs(realPrecision-precision)>SEARCH_EPS) { - - if (realPrecision -void test_index_precisions(NNIndex& index, const Matrix& inputData, - const Matrix& testData, const Matrix& matches, - float* precisions, int precisions_length, const Distance& distance, int nn = 1, int skipMatches = 0, float maxTime = 0) -{ - typedef typename Distance::ResultType DistanceType; - - const float SEARCH_EPS = 0.001; - - // make sure precisions array is sorted - std::sort(precisions, precisions+precisions_length); - - int pindex = 0; - float precision = precisions[pindex]; - - Logger::info(" Nodes Precision(%) Time(s) Time/vec(ms) Mean dist\n"); - Logger::info("---------------------------------------------------------\n"); - - int c2 = 1; - float p2; - - int c1 = 1; - float p1; - - float time; - DistanceType dist; - - p2 = search_with_ground_truth(index, inputData, testData, matches, nn, c2, time, dist, distance, skipMatches); - - // if precision for 1 run down the tree is already - // better then some of the requested precisions, then - // skip those - while (precisions[pindex] 0)&&(time > maxTime)&&(p2SEARCH_EPS) { - Logger::info("Start linear estimation\n"); - // after we got to values in the vecinity of the desired precision - // use linear approximation get a better estimation - - cx = (c1+c2)/2; - realPrecision = search_with_ground_truth(index, inputData, testData, matches, nn, cx, time, dist, distance, skipMatches); - while (fabs(realPrecision-precision)>SEARCH_EPS) { - - if (realPrecision -#include -#include -#include - -#include "general.h" -#include "nn_index.h" -#include "dynamic_bitset.h" -#include "matrix.h" -#include "result_set.h" -#include "heap.h" -#include "allocator.h" -#include "random.h" -#include "saving.h" - - -namespace cvflann -{ - -struct KDTreeIndexParams : public IndexParams -{ - KDTreeIndexParams(int trees = 4) - { - (*this)["algorithm"] = FLANN_INDEX_KDTREE; - (*this)["trees"] = trees; - } -}; - - -/** - * Randomized kd-tree index - * - * Contains the k-d trees and other information for indexing a set of points - * for nearest-neighbor matching. - */ -template -class KDTreeIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - - /** - * KDTree constructor - * - * Params: - * inputData = dataset with the input features - * params = parameters passed to the kdtree algorithm - */ - KDTreeIndex(const Matrix& inputData, const IndexParams& params = KDTreeIndexParams(), - Distance d = Distance() ) : - dataset_(inputData), index_params_(params), distance_(d) - { - size_ = dataset_.rows; - veclen_ = dataset_.cols; - - trees_ = get_param(index_params_,"trees",4); - tree_roots_ = new NodePtr[trees_]; - - // Create a permutable array of indices to the input vectors. - vind_.resize(size_); - for (size_t i = 0; i < size_; ++i) { - vind_[i] = int(i); - } - - mean_ = new DistanceType[veclen_]; - var_ = new DistanceType[veclen_]; - } - - - KDTreeIndex(const KDTreeIndex&); - KDTreeIndex& operator=(const KDTreeIndex&); - - /** - * Standard destructor - */ - ~KDTreeIndex() - { - if (tree_roots_!=NULL) { - delete[] tree_roots_; - } - delete[] mean_; - delete[] var_; - } - - /** - * Builds the index - */ - void buildIndex() CV_OVERRIDE - { - /* Construct the randomized trees. */ - for (int i = 0; i < trees_; i++) { - /* Randomize the order of vectors to allow for unbiased sampling. */ -#ifndef OPENCV_FLANN_USE_STD_RAND - cv::randShuffle(vind_); -#else - std::random_shuffle(vind_.begin(), vind_.end()); -#endif - - tree_roots_[i] = divideTree(&vind_[0], int(size_) ); - } - } - - - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_KDTREE; - } - - - void saveIndex(FILE* stream) CV_OVERRIDE - { - save_value(stream, trees_); - for (int i=0; i& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - int maxChecks = get_param(searchParams,"checks", 32); - float epsError = 1+get_param(searchParams,"eps",0.0f); - - if (maxChecks==FLANN_CHECKS_UNLIMITED) { - getExactNeighbors(result, vec, epsError); - } - else { - getNeighbors(result, vec, maxChecks, epsError); - } - } - - IndexParams getParameters() const CV_OVERRIDE - { - return index_params_; - } - -private: - - - /*--------------------- Internal Data Structures --------------------------*/ - struct Node - { - /** - * Dimension used for subdivision. - */ - int divfeat; - /** - * The values used for subdivision. - */ - DistanceType divval; - /** - * The child nodes. - */ - Node* child1, * child2; - }; - typedef Node* NodePtr; - typedef BranchStruct BranchSt; - typedef BranchSt* Branch; - - - - void save_tree(FILE* stream, NodePtr tree) - { - save_value(stream, *tree); - if (tree->child1!=NULL) { - save_tree(stream, tree->child1); - } - if (tree->child2!=NULL) { - save_tree(stream, tree->child2); - } - } - - - void load_tree(FILE* stream, NodePtr& tree) - { - tree = pool_.allocate(); - load_value(stream, *tree); - if (tree->child1!=NULL) { - load_tree(stream, tree->child1); - } - if (tree->child2!=NULL) { - load_tree(stream, tree->child2); - } - } - - - /** - * Create a tree node that subdivides the list of vecs from vind[first] - * to vind[last]. The routine is called recursively on each sublist. - * Place a pointer to this new tree node in the location pTree. - * - * Params: pTree = the new node to create - * first = index of the first vector - * last = index of the last vector - */ - NodePtr divideTree(int* ind, int count) - { - NodePtr node = pool_.allocate(); // allocate memory - - /* If too few exemplars remain, then make this a leaf node. */ - if ( count == 1) { - node->child1 = node->child2 = NULL; /* Mark as leaf node. */ - node->divfeat = *ind; /* Store index of this vec. */ - } - else { - int idx; - int cutfeat; - DistanceType cutval; - meanSplit(ind, count, idx, cutfeat, cutval); - - node->divfeat = cutfeat; - node->divval = cutval; - node->child1 = divideTree(ind, idx); - node->child2 = divideTree(ind+idx, count-idx); - } - - return node; - } - - - /** - * Choose which feature to use in order to subdivide this set of vectors. - * Make a random choice among those with the highest variance, and use - * its variance as the threshold value. - */ - void meanSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval) - { - memset(mean_,0,veclen_*sizeof(DistanceType)); - memset(var_,0,veclen_*sizeof(DistanceType)); - - /* Compute mean values. Only the first SAMPLE_MEAN values need to be - sampled to get a good estimate. - */ - int cnt = std::min((int)SAMPLE_MEAN+1, count); - for (int j = 0; j < cnt; ++j) { - ElementType* v = dataset_[ind[j]]; - for (size_t k=0; kcount/2) index = lim1; - else if (lim2 v[topind[num-1]])) { - /* Put this element at end of topind. */ - if (num < RAND_DIM) { - topind[num++] = i; /* Add to list. */ - } - else { - topind[num-1] = i; /* Replace last element. */ - } - /* Bubble end value down to right location by repeated swapping. */ - int j = num - 1; - while (j > 0 && v[topind[j]] > v[topind[j-1]]) { - std::swap(topind[j], topind[j-1]); - --j; - } - } - } - /* Select a random integer in range [0,num-1], and return that index. */ - int rnd = rand_int(num); - return (int)topind[rnd]; - } - - - /** - * Subdivide the list of points by a plane perpendicular on axe corresponding - * to the 'cutfeat' dimension at 'cutval' position. - * - * On return: - * dataset[ind[0..lim1-1]][cutfeat]cutval - */ - void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2) - { - /* Move vector indices for left subtree to front of list. */ - int left = 0; - int right = count-1; - for (;; ) { - while (left<=right && dataset_[ind[left]][cutfeat]=cutval) --right; - if (left>right) break; - std::swap(ind[left], ind[right]); ++left; --right; - } - lim1 = left; - right = count-1; - for (;; ) { - while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left; - while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right; - if (left>right) break; - std::swap(ind[left], ind[right]); ++left; --right; - } - lim2 = left; - } - - /** - * Performs an exact nearest neighbor search. The exact search performs a full - * traversal of the tree. - */ - void getExactNeighbors(ResultSet& result, const ElementType* vec, float epsError) - { - // checkID -= 1; /* Set a different unique ID for each search. */ - - if (trees_ > 1) { - fprintf(stderr,"It doesn't make any sense to use more than one tree for exact search"); - } - if (trees_>0) { - searchLevelExact(result, vec, tree_roots_[0], 0.0, epsError); - } - assert(result.full()); - } - - /** - * Performs the approximate nearest-neighbor search. The search is approximate - * because the tree traversal is abandoned after a given number of descends in - * the tree. - */ - void getNeighbors(ResultSet& result, const ElementType* vec, int maxCheck, float epsError) - { - int i; - BranchSt branch; - - int checkCount = 0; - Heap* heap = new Heap((int)size_); - DynamicBitset checked(size_); - - /* Search once through each tree down to root. */ - for (i = 0; i < trees_; ++i) { - searchLevel(result, vec, tree_roots_[i], 0, checkCount, maxCheck, epsError, heap, checked); - } - - /* Keep searching other branches from heap until finished. */ - while ( heap->popMin(branch) && (checkCount < maxCheck || !result.full() )) { - searchLevel(result, vec, branch.node, branch.mindist, checkCount, maxCheck, epsError, heap, checked); - } - - delete heap; - - assert(result.full()); - } - - - /** - * Search starting from a given node of the tree. Based on any mismatches at - * higher levels, all exemplars below this level must have a distance of - * at least "mindistsq". - */ - void searchLevel(ResultSet& result_set, const ElementType* vec, NodePtr node, DistanceType mindist, int& checkCount, int maxCheck, - float epsError, Heap* heap, DynamicBitset& checked) - { - if (result_set.worstDist()child1 == NULL)&&(node->child2 == NULL)) { - /* Do not check same node more than once when searching multiple trees. - Once a vector is checked, we set its location in vind to the - current checkID. - */ - int index = node->divfeat; - if ( checked.test(index) || ((checkCount>=maxCheck)&& result_set.full()) ) return; - checked.set(index); - checkCount++; - - DistanceType dist = distance_(dataset_[index], vec, veclen_); - result_set.addPoint(dist,index); - - return; - } - - /* Which child branch should be taken first? */ - ElementType val = vec[node->divfeat]; - DistanceType diff = val - node->divval; - NodePtr bestChild = (diff < 0) ? node->child1 : node->child2; - NodePtr otherChild = (diff < 0) ? node->child2 : node->child1; - - /* Create a branch record for the branch not taken. Add distance - of this feature boundary (we don't attempt to correct for any - use of this feature in a parent node, which is unlikely to - happen and would have only a small effect). Don't bother - adding more branches to heap after halfway point, as cost of - adding exceeds their value. - */ - - DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat); - // if (2 * checkCount < maxCheck || !result.full()) { - if ((new_distsq*epsError < result_set.worstDist())|| !result_set.full()) { - heap->insert( BranchSt(otherChild, new_distsq) ); - } - - /* Call recursively to search next level down. */ - searchLevel(result_set, vec, bestChild, mindist, checkCount, maxCheck, epsError, heap, checked); - } - - /** - * Performs an exact search in the tree starting from a node. - */ - void searchLevelExact(ResultSet& result_set, const ElementType* vec, const NodePtr node, DistanceType mindist, const float epsError) - { - /* If this is a leaf node, then do check and return. */ - if ((node->child1 == NULL)&&(node->child2 == NULL)) { - int index = node->divfeat; - DistanceType dist = distance_(dataset_[index], vec, veclen_); - result_set.addPoint(dist,index); - return; - } - - /* Which child branch should be taken first? */ - ElementType val = vec[node->divfeat]; - DistanceType diff = val - node->divval; - NodePtr bestChild = (diff < 0) ? node->child1 : node->child2; - NodePtr otherChild = (diff < 0) ? node->child2 : node->child1; - - /* Create a branch record for the branch not taken. Add distance - of this feature boundary (we don't attempt to correct for any - use of this feature in a parent node, which is unlikely to - happen and would have only a small effect). Don't bother - adding more branches to heap after halfway point, as cost of - adding exceeds their value. - */ - - DistanceType new_distsq = mindist + distance_.accum_dist(val, node->divval, node->divfeat); - - /* Call recursively to search next level down. */ - searchLevelExact(result_set, vec, bestChild, mindist, epsError); - - if (new_distsq*epsError<=result_set.worstDist()) { - searchLevelExact(result_set, vec, otherChild, new_distsq, epsError); - } - } - - -private: - - enum - { - /** - * To improve efficiency, only SAMPLE_MEAN random values are used to - * compute the mean and variance at each level when building a tree. - * A value of 100 seems to perform as well as using all values. - */ - SAMPLE_MEAN = 100, - /** - * Top random dimensions to consider - * - * When creating random trees, the dimension on which to subdivide is - * selected at random from among the top RAND_DIM dimensions with the - * highest variance. A value of 5 works well. - */ - RAND_DIM=5 - }; - - - /** - * Number of randomized trees that are used - */ - int trees_; - - /** - * Array of indices to vectors in the dataset. - */ - std::vector vind_; - - /** - * The dataset used by this index - */ - const Matrix dataset_; - - IndexParams index_params_; - - size_t size_; - size_t veclen_; - - - DistanceType* mean_; - DistanceType* var_; - - - /** - * Array of k-d trees used to find neighbours. - */ - NodePtr* tree_roots_; - - /** - * Pooled memory allocator. - * - * Using a pooled memory allocator is more efficient - * than allocating memory directly when there is a large - * number small of memory allocations. - */ - PooledAllocator pool_; - - Distance distance_; - - -}; // class KDTreeForest - -} - -#endif //OPENCV_FLANN_KDTREE_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/kdtree_single_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/kdtree_single_index.h deleted file mode 100644 index 22a28d0..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/kdtree_single_index.h +++ /dev/null @@ -1,635 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_ -#define OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_ - -#include -#include -#include -#include - -#include "general.h" -#include "nn_index.h" -#include "matrix.h" -#include "result_set.h" -#include "heap.h" -#include "allocator.h" -#include "random.h" -#include "saving.h" - -namespace cvflann -{ - -struct KDTreeSingleIndexParams : public IndexParams -{ - KDTreeSingleIndexParams(int leaf_max_size = 10, bool reorder = true, int dim = -1) - { - (*this)["algorithm"] = FLANN_INDEX_KDTREE_SINGLE; - (*this)["leaf_max_size"] = leaf_max_size; - (*this)["reorder"] = reorder; - (*this)["dim"] = dim; - } -}; - - -/** - * Randomized kd-tree index - * - * Contains the k-d trees and other information for indexing a set of points - * for nearest-neighbor matching. - */ -template -class KDTreeSingleIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - - /** - * KDTree constructor - * - * Params: - * inputData = dataset with the input features - * params = parameters passed to the kdtree algorithm - */ - KDTreeSingleIndex(const Matrix& inputData, const IndexParams& params = KDTreeSingleIndexParams(), - Distance d = Distance() ) : - dataset_(inputData), index_params_(params), distance_(d) - { - size_ = dataset_.rows; - dim_ = dataset_.cols; - root_node_ = 0; - int dim_param = get_param(params,"dim",-1); - if (dim_param>0) dim_ = dim_param; - leaf_max_size_ = get_param(params,"leaf_max_size",10); - reorder_ = get_param(params,"reorder",true); - - // Create a permutable array of indices to the input vectors. - vind_.resize(size_); - for (size_t i = 0; i < size_; i++) { - vind_[i] = (int)i; - } - } - - KDTreeSingleIndex(const KDTreeSingleIndex&); - KDTreeSingleIndex& operator=(const KDTreeSingleIndex&); - - /** - * Standard destructor - */ - ~KDTreeSingleIndex() - { - if (reorder_) delete[] data_.data; - } - - /** - * Builds the index - */ - void buildIndex() CV_OVERRIDE - { - computeBoundingBox(root_bbox_); - root_node_ = divideTree(0, (int)size_, root_bbox_ ); // construct the tree - - if (reorder_) { - delete[] data_.data; - data_ = cvflann::Matrix(new ElementType[size_*dim_], size_, dim_); - for (size_t i=0; i& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE - { - assert(queries.cols == veclen()); - assert(indices.rows >= queries.rows); - assert(dists.rows >= queries.rows); - assert(int(indices.cols) >= knn); - assert(int(dists.cols) >= knn); - - KNNSimpleResultSet resultSet(knn); - for (size_t i = 0; i < queries.rows; i++) { - resultSet.init(indices[i], dists[i]); - findNeighbors(resultSet, queries[i], params); - } - } - - IndexParams getParameters() const CV_OVERRIDE - { - return index_params_; - } - - /** - * Find set of nearest neighbors to vec. Their indices are stored inside - * the result object. - * - * Params: - * result = the result object in which the indices of the nearest-neighbors are stored - * vec = the vector for which to search the nearest neighbors - * maxCheck = the maximum number of restarts (in a best-bin-first manner) - */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - float epsError = 1+get_param(searchParams,"eps",0.0f); - - std::vector dists(dim_,0); - DistanceType distsq = computeInitialDistances(vec, dists); - searchLevel(result, vec, root_node_, distsq, dists, epsError); - } - -private: - - - /*--------------------- Internal Data Structures --------------------------*/ - struct Node - { - /** - * Indices of points in leaf node - */ - int left, right; - /** - * Dimension used for subdivision. - */ - int divfeat; - /** - * The values used for subdivision. - */ - DistanceType divlow, divhigh; - /** - * The child nodes. - */ - Node* child1, * child2; - }; - typedef Node* NodePtr; - - - struct Interval - { - DistanceType low, high; - }; - - typedef std::vector BoundingBox; - - typedef BranchStruct BranchSt; - typedef BranchSt* Branch; - - - - - void save_tree(FILE* stream, NodePtr tree) - { - save_value(stream, *tree); - if (tree->child1!=NULL) { - save_tree(stream, tree->child1); - } - if (tree->child2!=NULL) { - save_tree(stream, tree->child2); - } - } - - - void load_tree(FILE* stream, NodePtr& tree) - { - tree = pool_.allocate(); - load_value(stream, *tree); - if (tree->child1!=NULL) { - load_tree(stream, tree->child1); - } - if (tree->child2!=NULL) { - load_tree(stream, tree->child2); - } - } - - - void computeBoundingBox(BoundingBox& bbox) - { - bbox.resize(dim_); - for (size_t i=0; ibbox[i].high) bbox[i].high = (DistanceType)dataset_[k][i]; - } - } - } - - - /** - * Create a tree node that subdivides the list of vecs from vind[first] - * to vind[last]. The routine is called recursively on each sublist. - * Place a pointer to this new tree node in the location pTree. - * - * Params: pTree = the new node to create - * first = index of the first vector - * last = index of the last vector - */ - NodePtr divideTree(int left, int right, BoundingBox& bbox) - { - NodePtr node = pool_.allocate(); // allocate memory - - /* If too few exemplars remain, then make this a leaf node. */ - if ( (right-left) <= leaf_max_size_) { - node->child1 = node->child2 = NULL; /* Mark as leaf node. */ - node->left = left; - node->right = right; - - // compute bounding-box of leaf points - for (size_t i=0; idataset_[vind_[k]][i]) bbox[i].low=(DistanceType)dataset_[vind_[k]][i]; - if (bbox[i].highdivfeat = cutfeat; - - BoundingBox left_bbox(bbox); - left_bbox[cutfeat].high = cutval; - node->child1 = divideTree(left, left+idx, left_bbox); - - BoundingBox right_bbox(bbox); - right_bbox[cutfeat].low = cutval; - node->child2 = divideTree(left+idx, right, right_bbox); - - node->divlow = left_bbox[cutfeat].high; - node->divhigh = right_bbox[cutfeat].low; - - for (size_t i=0; imax_elem) max_elem = val; - } - } - - void middleSplit(int* ind, int count, int& index, int& cutfeat, DistanceType& cutval, const BoundingBox& bbox) - { - // find the largest span from the approximate bounding box - ElementType max_span = bbox[0].high-bbox[0].low; - cutfeat = 0; - cutval = (bbox[0].high+bbox[0].low)/2; - for (size_t i=1; imax_span) { - max_span = span; - cutfeat = i; - cutval = (bbox[i].high+bbox[i].low)/2; - } - } - - // compute exact span on the found dimension - ElementType min_elem, max_elem; - computeMinMax(ind, count, cutfeat, min_elem, max_elem); - cutval = (min_elem+max_elem)/2; - max_span = max_elem - min_elem; - - // check if a dimension of a largest span exists - size_t k = cutfeat; - for (size_t i=0; imax_span) { - computeMinMax(ind, count, i, min_elem, max_elem); - span = max_elem - min_elem; - if (span>max_span) { - max_span = span; - cutfeat = i; - cutval = (min_elem+max_elem)/2; - } - } - } - int lim1, lim2; - planeSplit(ind, count, cutfeat, cutval, lim1, lim2); - - if (lim1>count/2) index = lim1; - else if (lim2max_span) { - max_span = span; - } - } - DistanceType max_spread = -1; - cutfeat = 0; - for (size_t i=0; i(DistanceType)((1-EPS)*max_span)) { - ElementType min_elem, max_elem; - computeMinMax(ind, count, cutfeat, min_elem, max_elem); - DistanceType spread = (DistanceType)(max_elem-min_elem); - if (spread>max_spread) { - cutfeat = (int)i; - max_spread = spread; - } - } - } - // split in the middle - DistanceType split_val = (bbox[cutfeat].low+bbox[cutfeat].high)/2; - ElementType min_elem, max_elem; - computeMinMax(ind, count, cutfeat, min_elem, max_elem); - - if (split_valmax_elem) cutval = (DistanceType)max_elem; - else cutval = split_val; - - int lim1, lim2; - planeSplit(ind, count, cutfeat, cutval, lim1, lim2); - - if (lim1>count/2) index = lim1; - else if (lim2cutval - */ - void planeSplit(int* ind, int count, int cutfeat, DistanceType cutval, int& lim1, int& lim2) - { - /* Move vector indices for left subtree to front of list. */ - int left = 0; - int right = count-1; - for (;; ) { - while (left<=right && dataset_[ind[left]][cutfeat]=cutval) --right; - if (left>right) break; - std::swap(ind[left], ind[right]); ++left; --right; - } - /* If either list is empty, it means that all remaining features - * are identical. Split in the middle to maintain a balanced tree. - */ - lim1 = left; - right = count-1; - for (;; ) { - while (left<=right && dataset_[ind[left]][cutfeat]<=cutval) ++left; - while (left<=right && dataset_[ind[right]][cutfeat]>cutval) --right; - if (left>right) break; - std::swap(ind[left], ind[right]); ++left; --right; - } - lim2 = left; - } - - DistanceType computeInitialDistances(const ElementType* vec, std::vector& dists) - { - DistanceType distsq = 0.0; - - for (size_t i = 0; i < dim_; ++i) { - if (vec[i] < root_bbox_[i].low) { - dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].low, (int)i); - distsq += dists[i]; - } - if (vec[i] > root_bbox_[i].high) { - dists[i] = distance_.accum_dist(vec[i], root_bbox_[i].high, (int)i); - distsq += dists[i]; - } - } - - return distsq; - } - - /** - * Performs an exact search in the tree starting from a node. - */ - void searchLevel(ResultSet& result_set, const ElementType* vec, const NodePtr node, DistanceType mindistsq, - std::vector& dists, const float epsError) - { - /* If this is a leaf node, then do check and return. */ - if ((node->child1 == NULL)&&(node->child2 == NULL)) { - DistanceType worst_dist = result_set.worstDist(); - for (int i=node->left; iright; ++i) { - int index = reorder_ ? i : vind_[i]; - DistanceType dist = distance_(vec, data_[index], dim_, worst_dist); - if (distdivfeat; - ElementType val = vec[idx]; - DistanceType diff1 = val - node->divlow; - DistanceType diff2 = val - node->divhigh; - - NodePtr bestChild; - NodePtr otherChild; - DistanceType cut_dist; - if ((diff1+diff2)<0) { - bestChild = node->child1; - otherChild = node->child2; - cut_dist = distance_.accum_dist(val, node->divhigh, idx); - } - else { - bestChild = node->child2; - otherChild = node->child1; - cut_dist = distance_.accum_dist( val, node->divlow, idx); - } - - /* Call recursively to search next level down. */ - searchLevel(result_set, vec, bestChild, mindistsq, dists, epsError); - - DistanceType dst = dists[idx]; - mindistsq = mindistsq + cut_dist - dst; - dists[idx] = cut_dist; - if (mindistsq*epsError<=result_set.worstDist()) { - searchLevel(result_set, vec, otherChild, mindistsq, dists, epsError); - } - dists[idx] = dst; - } - -private: - - /** - * The dataset used by this index - */ - const Matrix dataset_; - - IndexParams index_params_; - - int leaf_max_size_; - bool reorder_; - - - /** - * Array of indices to vectors in the dataset. - */ - std::vector vind_; - - Matrix data_; - - size_t size_; - size_t dim_; - - /** - * Array of k-d trees used to find neighbours. - */ - NodePtr root_node_; - - BoundingBox root_bbox_; - - /** - * Pooled memory allocator. - * - * Using a pooled memory allocator is more efficient - * than allocating memory directly when there is a large - * number small of memory allocations. - */ - PooledAllocator pool_; - - Distance distance_; -}; // class KDTree - -} - -#endif //OPENCV_FLANN_KDTREE_SINGLE_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/kmeans_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/kmeans_index.h deleted file mode 100644 index fe91ddd..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/kmeans_index.h +++ /dev/null @@ -1,1172 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_KMEANS_INDEX_H_ -#define OPENCV_FLANN_KMEANS_INDEX_H_ - -#include -#include -#include -#include -#include - -#include "general.h" -#include "nn_index.h" -#include "dist.h" -#include "matrix.h" -#include "result_set.h" -#include "heap.h" -#include "allocator.h" -#include "random.h" -#include "saving.h" -#include "logger.h" - - -namespace cvflann -{ - -struct KMeansIndexParams : public IndexParams -{ - KMeansIndexParams(int branching = 32, int iterations = 11, - flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 ) - { - (*this)["algorithm"] = FLANN_INDEX_KMEANS; - // branching factor - (*this)["branching"] = branching; - // max iterations to perform in one kmeans clustering (kmeans tree) - (*this)["iterations"] = iterations; - // algorithm used for picking the initial cluster centers for kmeans tree - (*this)["centers_init"] = centers_init; - // cluster boundary index. Used when searching the kmeans tree - (*this)["cb_index"] = cb_index; - } -}; - - -/** - * Hierarchical kmeans index - * - * Contains a tree constructed through a hierarchical kmeans clustering - * and other information for indexing a set of points for nearest-neighbour matching. - */ -template -class KMeansIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - - - typedef void (KMeansIndex::* centersAlgFunction)(int, int*, int, int*, int&); - - /** - * The function used for choosing the cluster centers. - */ - centersAlgFunction chooseCenters; - - - - /** - * Chooses the initial centers in the k-means clustering in a random manner. - * - * Params: - * k = number of centers - * vecs = the dataset of points - * indices = indices in the dataset - * indices_length = length of indices vector - * - */ - void chooseCentersRandom(int k, int* indices, int indices_length, int* centers, int& centers_length) - { - UniqueRandom r(indices_length); - - int index; - for (index=0; index=0 && rnd < n); - - centers[0] = indices[rnd]; - - int index; - for (index=1; indexbest_val) { - best_val = dist; - best_index = j; - } - } - if (best_index!=-1) { - centers[index] = indices[best_index]; - } - else { - break; - } - } - centers_length = index; - } - - - /** - * Chooses the initial centers in the k-means using the algorithm - * proposed in the KMeans++ paper: - * Arthur, David; Vassilvitskii, Sergei - k-means++: The Advantages of Careful Seeding - * - * Implementation of this function was converted from the one provided in Arthur's code. - * - * Params: - * k = number of centers - * vecs = the dataset of points - * indices = indices in the dataset - * Returns: - */ - void chooseCentersKMeanspp(int k, int* indices, int indices_length, int* centers, int& centers_length) - { - int n = indices_length; - - double currentPot = 0; - DistanceType* closestDistSq = new DistanceType[n]; - - // Choose one random center and set the closestDistSq values - int index = rand_int(n); - assert(index >=0 && index < n); - centers[0] = indices[index]; - - for (int i = 0; i < n; i++) { - closestDistSq[i] = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols); - closestDistSq[i] = ensureSquareDistance( closestDistSq[i] ); - currentPot += closestDistSq[i]; - } - - - const int numLocalTries = 1; - - // Choose each center - int centerCount; - for (centerCount = 1; centerCount < k; centerCount++) { - - // Repeat several trials - double bestNewPot = -1; - int bestNewIndex = -1; - for (int localTrial = 0; localTrial < numLocalTries; localTrial++) { - - // Choose our center - have to be slightly careful to return a valid answer even accounting - // for possible rounding errors - double randVal = rand_double(currentPot); - for (index = 0; index < n-1; index++) { - if (randVal <= closestDistSq[index]) break; - else randVal -= closestDistSq[index]; - } - - // Compute the new potential - double newPot = 0; - for (int i = 0; i < n; i++) { - DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[index]], dataset_.cols); - newPot += std::min( ensureSquareDistance(dist), closestDistSq[i] ); - } - - // Store the best result - if ((bestNewPot < 0)||(newPot < bestNewPot)) { - bestNewPot = newPot; - bestNewIndex = index; - } - } - - // Add the appropriate center - centers[centerCount] = indices[bestNewIndex]; - currentPot = bestNewPot; - for (int i = 0; i < n; i++) { - DistanceType dist = distance_(dataset_[indices[i]], dataset_[indices[bestNewIndex]], dataset_.cols); - closestDistSq[i] = std::min( ensureSquareDistance(dist), closestDistSq[i] ); - } - } - - centers_length = centerCount; - - delete[] closestDistSq; - } - - - -public: - - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_KMEANS; - } - - class KMeansDistanceComputer : public cv::ParallelLoopBody - { - public: - KMeansDistanceComputer(Distance _distance, const Matrix& _dataset, - const int _branching, const int* _indices, const Matrix& _dcenters, const size_t _veclen, - std::vector &_new_centroids, std::vector &_sq_dists) - : distance(_distance) - , dataset(_dataset) - , branching(_branching) - , indices(_indices) - , dcenters(_dcenters) - , veclen(_veclen) - , new_centroids(_new_centroids) - , sq_dists(_sq_dists) - { - } - - void operator()(const cv::Range& range) const CV_OVERRIDE - { - const int begin = range.start; - const int end = range.end; - - for( int i = begin; inew_sq_dist) { - new_centroid = j; - sq_dist = new_sq_dist; - } - } - sq_dists[i] = sq_dist; - new_centroids[i] = new_centroid; - } - } - - private: - Distance distance; - const Matrix& dataset; - const int branching; - const int* indices; - const Matrix& dcenters; - const size_t veclen; - std::vector &new_centroids; - std::vector &sq_dists; - KMeansDistanceComputer& operator=( const KMeansDistanceComputer & ) { return *this; } - }; - - /** - * Index constructor - * - * Params: - * inputData = dataset with the input features - * params = parameters passed to the hierarchical k-means algorithm - */ - KMeansIndex(const Matrix& inputData, const IndexParams& params = KMeansIndexParams(), - Distance d = Distance()) - : dataset_(inputData), index_params_(params), root_(NULL), indices_(NULL), distance_(d) - { - memoryCounter_ = 0; - - size_ = dataset_.rows; - veclen_ = dataset_.cols; - - branching_ = get_param(params,"branching",32); - iterations_ = get_param(params,"iterations",11); - if (iterations_<0) { - iterations_ = (std::numeric_limits::max)(); - } - centers_init_ = get_param(params,"centers_init",FLANN_CENTERS_RANDOM); - - if (centers_init_==FLANN_CENTERS_RANDOM) { - chooseCenters = &KMeansIndex::chooseCentersRandom; - } - else if (centers_init_==FLANN_CENTERS_GONZALES) { - chooseCenters = &KMeansIndex::chooseCentersGonzales; - } - else if (centers_init_==FLANN_CENTERS_KMEANSPP) { - chooseCenters = &KMeansIndex::chooseCentersKMeanspp; - } - else { - throw FLANNException("Unknown algorithm for choosing initial centers."); - } - cb_index_ = 0.4f; - - } - - - KMeansIndex(const KMeansIndex&); - KMeansIndex& operator=(const KMeansIndex&); - - - /** - * Index destructor. - * - * Release the memory used by the index. - */ - virtual ~KMeansIndex() - { - if (root_ != NULL) { - free_centers(root_); - } - if (indices_!=NULL) { - delete[] indices_; - } - } - - /** - * Returns size of index. - */ - size_t size() const CV_OVERRIDE - { - return size_; - } - - /** - * Returns the length of an index feature. - */ - size_t veclen() const CV_OVERRIDE - { - return veclen_; - } - - - void set_cb_index( float index) - { - cb_index_ = index; - } - - /** - * Computes the inde memory usage - * Returns: memory used by the index - */ - int usedMemory() const CV_OVERRIDE - { - return pool_.usedMemory+pool_.wastedMemory+memoryCounter_; - } - - /** - * Builds the index - */ - void buildIndex() CV_OVERRIDE - { - if (branching_<2) { - throw FLANNException("Branching factor must be at least 2"); - } - - indices_ = new int[size_]; - for (size_t i=0; i(); - std::memset(root_, 0, sizeof(KMeansNode)); - - computeNodeStatistics(root_, indices_, (int)size_); - computeClustering(root_, indices_, (int)size_, branching_,0); - } - - - void saveIndex(FILE* stream) CV_OVERRIDE - { - save_value(stream, branching_); - save_value(stream, iterations_); - save_value(stream, memoryCounter_); - save_value(stream, cb_index_); - save_value(stream, *indices_, (int)size_); - - save_tree(stream, root_); - } - - - void loadIndex(FILE* stream) CV_OVERRIDE - { - load_value(stream, branching_); - load_value(stream, iterations_); - load_value(stream, memoryCounter_); - load_value(stream, cb_index_); - if (indices_!=NULL) { - delete[] indices_; - } - indices_ = new int[size_]; - load_value(stream, *indices_, size_); - - if (root_!=NULL) { - free_centers(root_); - } - load_tree(stream, root_); - - index_params_["algorithm"] = getType(); - index_params_["branching"] = branching_; - index_params_["iterations"] = iterations_; - index_params_["centers_init"] = centers_init_; - index_params_["cb_index"] = cb_index_; - - } - - - /** - * Find set of nearest neighbors to vec. Their indices are stored inside - * the result object. - * - * Params: - * result = the result object in which the indices of the nearest-neighbors are stored - * vec = the vector for which to search the nearest neighbors - * searchParams = parameters that influence the search algorithm (checks, cb_index) - */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) CV_OVERRIDE - { - - int maxChecks = get_param(searchParams,"checks",32); - - if (maxChecks==FLANN_CHECKS_UNLIMITED) { - findExactNN(root_, result, vec); - } - else { - // Priority queue storing intermediate branches in the best-bin-first search - Heap* heap = new Heap((int)size_); - - int checks = 0; - findNN(root_, result, vec, checks, maxChecks, heap); - - BranchSt branch; - while (heap->popMin(branch) && (checks& centers) - { - int numClusters = centers.rows; - if (numClusters<1) { - throw FLANNException("Number of clusters must be at least 1"); - } - - DistanceType variance; - KMeansNodePtr* clusters = new KMeansNodePtr[numClusters]; - - int clusterCount = getMinVarianceClusters(root_, clusters, numClusters, variance); - - Logger::info("Clusters requested: %d, returning %d\n",numClusters, clusterCount); - - for (int i=0; ipivot; - for (size_t j=0; j BranchSt; - - - - - void save_tree(FILE* stream, KMeansNodePtr node) - { - save_value(stream, *node); - save_value(stream, *(node->pivot), (int)veclen_); - if (node->childs==NULL) { - int indices_offset = (int)(node->indices - indices_); - save_value(stream, indices_offset); - } - else { - for(int i=0; ichilds[i]); - } - } - } - - - void load_tree(FILE* stream, KMeansNodePtr& node) - { - node = pool_.allocate(); - load_value(stream, *node); - node->pivot = new DistanceType[veclen_]; - load_value(stream, *(node->pivot), (int)veclen_); - if (node->childs==NULL) { - int indices_offset; - load_value(stream, indices_offset); - node->indices = indices_ + indices_offset; - } - else { - node->childs = pool_.allocate(branching_); - for(int i=0; ichilds[i]); - } - } - } - - - /** - * Helper function - */ - void free_centers(KMeansNodePtr node) - { - delete[] node->pivot; - if (node->childs!=NULL) { - for (int k=0; kchilds[k]); - } - } - } - - /** - * Computes the statistics of a node (mean, radius, variance). - * - * Params: - * node = the node to use - * indices = the indices of the points belonging to the node - */ - void computeNodeStatistics(KMeansNodePtr node, int* indices, int indices_length) - { - - DistanceType radius = 0; - DistanceType variance = 0; - DistanceType* mean = new DistanceType[veclen_]; - memoryCounter_ += int(veclen_*sizeof(DistanceType)); - - memset(mean,0,veclen_*sizeof(DistanceType)); - - for (size_t i=0; i(), veclen_); - } - for (size_t j=0; j(), veclen_); - - DistanceType tmp = 0; - for (int i=0; iradius) { - radius = tmp; - } - } - - node->variance = variance; - node->radius = radius; - node->pivot = mean; - } - - - /** - * The method responsible with actually doing the recursive hierarchical - * clustering - * - * Params: - * node = the node to cluster - * indices = indices of the points belonging to the current node - * branching = the branching factor to use in the clustering - * - * TODO: for 1-sized clusters don't store a cluster center (it's the same as the single cluster point) - */ - void computeClustering(KMeansNodePtr node, int* indices, int indices_length, int branching, int level) - { - node->size = indices_length; - node->level = level; - - if (indices_length < branching) { - node->indices = indices; - std::sort(node->indices,node->indices+indices_length); - node->childs = NULL; - return; - } - - cv::AutoBuffer centers_idx_buf(branching); - int* centers_idx = centers_idx_buf.data(); - int centers_length; - (this->*chooseCenters)(branching, indices, indices_length, centers_idx, centers_length); - - if (centers_lengthindices = indices; - std::sort(node->indices,node->indices+indices_length); - node->childs = NULL; - return; - } - - - cv::AutoBuffer dcenters_buf(branching*veclen_); - Matrix dcenters(dcenters_buf.data(), branching, veclen_); - for (int i=0; i radiuses(branching); - cv::AutoBuffer count_buf(branching); - int* count = count_buf.data(); - for (int i=0; i belongs_to_buf(indices_length); - int* belongs_to = belongs_to_buf.data(); - for (int i=0; inew_sq_dist) { - belongs_to[i] = j; - sq_dist = new_sq_dist; - } - } - if (sq_dist>radiuses[belongs_to[i]]) { - radiuses[belongs_to[i]] = sq_dist; - } - count[belongs_to[i]]++; - } - - bool converged = false; - int iteration = 0; - while (!converged && iteration new_centroids(indices_length); - std::vector sq_dists(indices_length); - - // reassign points to clusters - KMeansDistanceComputer invoker(distance_, dataset_, branching, indices, dcenters, veclen_, new_centroids, sq_dists); - parallel_for_(cv::Range(0, (int)indices_length), invoker); - - for (int i=0; i < (int)indices_length; ++i) { - DistanceType sq_dist(sq_dists[i]); - int new_centroid(new_centroids[i]); - if (sq_dist > radiuses[new_centroid]) { - radiuses[new_centroid] = sq_dist; - } - if (new_centroid != belongs_to[i]) { - count[belongs_to[i]]--; - count[new_centroid]++; - belongs_to[i] = new_centroid; - converged = false; - } - } - - for (int i=0; ichilds = pool_.allocate(branching); - int start = 0; - int end = start; - for (int c=0; c(), veclen_); - variance += d; - mean_radius += sqrt(d); - std::swap(indices[i],indices[end]); - std::swap(belongs_to[i],belongs_to[end]); - end++; - } - } - variance /= s; - mean_radius /= s; - variance -= distance_(centers[c], ZeroIterator(), veclen_); - - node->childs[c] = pool_.allocate(); - std::memset(node->childs[c], 0, sizeof(KMeansNode)); - node->childs[c]->radius = radiuses[c]; - node->childs[c]->pivot = centers[c]; - node->childs[c]->variance = variance; - node->childs[c]->mean_radius = mean_radius; - computeClustering(node->childs[c],indices+start, end-start, branching, level+1); - start=end; - } - - delete[] centers; - } - - - - /** - * Performs one descent in the hierarchical k-means tree. The branches not - * visited are stored in a priority queue. - * - * Params: - * node = node to explore - * result = container for the k-nearest neighbors found - * vec = query points - * checks = how many points in the dataset have been checked so far - * maxChecks = maximum dataset points to checks - */ - - - void findNN(KMeansNodePtr node, ResultSet& result, const ElementType* vec, int& checks, int maxChecks, - Heap* heap) - { - // Ignore those clusters that are too far away - { - DistanceType bsq = distance_(vec, node->pivot, veclen_); - DistanceType rsq = node->radius; - DistanceType wsq = result.worstDist(); - - DistanceType val = bsq-rsq-wsq; - DistanceType val2 = val*val-4*rsq*wsq; - - //if (val>0) { - if ((val>0)&&(val2>0)) { - return; - } - } - - if (node->childs==NULL) { - if (checks>=maxChecks) { - if (result.full()) return; - } - checks += node->size; - for (int i=0; isize; ++i) { - int index = node->indices[i]; - DistanceType dist = distance_(dataset_[index], vec, veclen_); - result.addPoint(dist, index); - } - } - else { - DistanceType* domain_distances = new DistanceType[branching_]; - int closest_center = exploreNodeBranches(node, vec, domain_distances, heap); - delete[] domain_distances; - findNN(node->childs[closest_center],result,vec, checks, maxChecks, heap); - } - } - - /** - * Helper function that computes the nearest childs of a node to a given query point. - * Params: - * node = the node - * q = the query point - * distances = array with the distances to each child node. - * Returns: - */ - int exploreNodeBranches(KMeansNodePtr node, const ElementType* q, DistanceType* domain_distances, Heap* heap) - { - - int best_index = 0; - domain_distances[best_index] = distance_(q, node->childs[best_index]->pivot, veclen_); - for (int i=1; ichilds[i]->pivot, veclen_); - if (domain_distances[i]childs[best_index]->pivot; - for (int i=0; ichilds[i]->variance; - - // float dist_to_border = getDistanceToBorder(node.childs[i].pivot,best_center,q); - // if (domain_distances[i]insert(BranchSt(node->childs[i],domain_distances[i])); - } - } - - return best_index; - } - - - /** - * Function the performs exact nearest neighbor search by traversing the entire tree. - */ - void findExactNN(KMeansNodePtr node, ResultSet& result, const ElementType* vec) - { - // Ignore those clusters that are too far away - { - DistanceType bsq = distance_(vec, node->pivot, veclen_); - DistanceType rsq = node->radius; - DistanceType wsq = result.worstDist(); - - DistanceType val = bsq-rsq-wsq; - DistanceType val2 = val*val-4*rsq*wsq; - - // if (val>0) { - if ((val>0)&&(val2>0)) { - return; - } - } - - - if (node->childs==NULL) { - for (int i=0; isize; ++i) { - int index = node->indices[i]; - DistanceType dist = distance_(dataset_[index], vec, veclen_); - result.addPoint(dist, index); - } - } - else { - int* sort_indices = new int[branching_]; - - getCenterOrdering(node, vec, sort_indices); - - for (int i=0; ichilds[sort_indices[i]],result,vec); - } - - delete[] sort_indices; - } - } - - - /** - * Helper function. - * - * I computes the order in which to traverse the child nodes of a particular node. - */ - void getCenterOrdering(KMeansNodePtr node, const ElementType* q, int* sort_indices) - { - DistanceType* domain_distances = new DistanceType[branching_]; - for (int i=0; ichilds[i]->pivot, veclen_); - - int j=0; - while (domain_distances[j]j; --k) { - domain_distances[k] = domain_distances[k-1]; - sort_indices[k] = sort_indices[k-1]; - } - domain_distances[j] = dist; - sort_indices[j] = i; - } - delete[] domain_distances; - } - - /** - * Method that computes the squared distance from the query point q - * from inside region with center c to the border between this - * region and the region with center p - */ - DistanceType getDistanceToBorder(DistanceType* p, DistanceType* c, DistanceType* q) - { - DistanceType sum = 0; - DistanceType sum2 = 0; - - for (int i=0; ivariance*root->size; - - while (clusterCount::max)(); - int splitIndex = -1; - - for (int i=0; ichilds != NULL) { - - DistanceType variance = meanVariance - clusters[i]->variance*clusters[i]->size; - - for (int j=0; jchilds[j]->variance*clusters[i]->childs[j]->size; - } - if (variance clusters_length) break; - - meanVariance = minVariance; - - // split node - KMeansNodePtr toSplit = clusters[splitIndex]; - clusters[splitIndex] = toSplit->childs[0]; - for (int i=1; ichilds[i]; - } - } - - varianceValue = meanVariance/root->size; - return clusterCount; - } - -private: - /** The branching factor used in the hierarchical k-means clustering */ - int branching_; - - /** Maximum number of iterations to use when performing k-means clustering */ - int iterations_; - - /** Algorithm for choosing the cluster centers */ - flann_centers_init_t centers_init_; - - /** - * Cluster border index. This is used in the tree search phase when determining - * the closest cluster to explore next. A zero value takes into account only - * the cluster centres, a value greater then zero also take into account the size - * of the cluster. - */ - float cb_index_; - - /** - * The dataset used by this index - */ - const Matrix dataset_; - - /** Index parameters */ - IndexParams index_params_; - - /** - * Number of features in the dataset. - */ - size_t size_; - - /** - * Length of each feature. - */ - size_t veclen_; - - /** - * The root node in the tree. - */ - KMeansNodePtr root_; - - /** - * Array of indices to vectors in the dataset. - */ - int* indices_; - - /** - * The distance - */ - Distance distance_; - - /** - * Pooled memory allocator. - */ - PooledAllocator pool_; - - /** - * Memory occupied by the index. - */ - int memoryCounter_; -}; - -} - -#endif //OPENCV_FLANN_KMEANS_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/linear_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/linear_index.h deleted file mode 100644 index ca3f44d..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/linear_index.h +++ /dev/null @@ -1,132 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_LINEAR_INDEX_H_ -#define OPENCV_FLANN_LINEAR_INDEX_H_ - -#include "general.h" -#include "nn_index.h" - -namespace cvflann -{ - -struct LinearIndexParams : public IndexParams -{ - LinearIndexParams() - { - (* this)["algorithm"] = FLANN_INDEX_LINEAR; - } -}; - -template -class LinearIndex : public NNIndex -{ -public: - - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - - LinearIndex(const Matrix& inputData, const IndexParams& params = LinearIndexParams(), - Distance d = Distance()) : - dataset_(inputData), index_params_(params), distance_(d) - { - } - - LinearIndex(const LinearIndex&); - LinearIndex& operator=(const LinearIndex&); - - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_LINEAR; - } - - - size_t size() const CV_OVERRIDE - { - return dataset_.rows; - } - - size_t veclen() const CV_OVERRIDE - { - return dataset_.cols; - } - - - int usedMemory() const CV_OVERRIDE - { - return 0; - } - - void buildIndex() CV_OVERRIDE - { - /* nothing to do here for linear search */ - } - - void saveIndex(FILE*) CV_OVERRIDE - { - /* nothing to do here for linear search */ - } - - - void loadIndex(FILE*) CV_OVERRIDE - { - /* nothing to do here for linear search */ - - index_params_["algorithm"] = getType(); - } - - void findNeighbors(ResultSet& resultSet, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE - { - ElementType* data = dataset_.data; - for (size_t i = 0; i < dataset_.rows; ++i, data += dataset_.cols) { - DistanceType dist = distance_(data, vec, dataset_.cols); - resultSet.addPoint(dist, (int)i); - } - } - - IndexParams getParameters() const CV_OVERRIDE - { - return index_params_; - } - -private: - /** The dataset */ - const Matrix dataset_; - /** Index parameters */ - IndexParams index_params_; - /** Index distance */ - Distance distance_; - -}; - -} - -#endif // OPENCV_FLANN_LINEAR_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/logger.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/logger.h deleted file mode 100644 index 32618db..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/logger.h +++ /dev/null @@ -1,135 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_LOGGER_H -#define OPENCV_FLANN_LOGGER_H - -#include -#include - -#include "defines.h" - - -namespace cvflann -{ - -class Logger -{ - Logger() : stream(stdout), logLevel(FLANN_LOG_WARN) {} - - ~Logger() - { - if ((stream!=NULL)&&(stream!=stdout)) { - fclose(stream); - } - } - - static Logger& instance() - { - static Logger logger; - return logger; - } - - void _setDestination(const char* name) - { - if (name==NULL) { - stream = stdout; - } - else { -#ifdef _MSC_VER - if (fopen_s(&stream, name, "w") != 0) - stream = NULL; -#else - stream = fopen(name,"w"); -#endif - if (stream == NULL) { - stream = stdout; - } - } - } - - int _log(int level, const char* fmt, va_list arglist) - { - if (level > logLevel ) return -1; - int ret = vfprintf(stream, fmt, arglist); - return ret; - } - -public: - /** - * Sets the logging level. All messages with lower priority will be ignored. - * @param level Logging level - */ - static void setLevel(int level) { instance().logLevel = level; } - - /** - * Sets the logging destination - * @param name Filename or NULL for console - */ - static void setDestination(const char* name) { instance()._setDestination(name); } - - /** - * Print log message - * @param level Log level - * @param fmt Message format - * @return - */ - static int log(int level, const char* fmt, ...) - { - va_list arglist; - va_start(arglist, fmt); - int ret = instance()._log(level,fmt,arglist); - va_end(arglist); - return ret; - } - -#define LOG_METHOD(NAME,LEVEL) \ - static int NAME(const char* fmt, ...) \ - { \ - va_list ap; \ - va_start(ap, fmt); \ - int ret = instance()._log(LEVEL, fmt, ap); \ - va_end(ap); \ - return ret; \ - } - - LOG_METHOD(fatal, FLANN_LOG_FATAL) - LOG_METHOD(error, FLANN_LOG_ERROR) - LOG_METHOD(warn, FLANN_LOG_WARN) - LOG_METHOD(info, FLANN_LOG_INFO) - -private: - FILE* stream; - int logLevel; -}; - -} - -#endif //OPENCV_FLANN_LOGGER_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_index.h deleted file mode 100644 index 42afe89..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_index.h +++ /dev/null @@ -1,392 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -/*********************************************************************** - * Author: Vincent Rabaud - *************************************************************************/ - -#ifndef OPENCV_FLANN_LSH_INDEX_H_ -#define OPENCV_FLANN_LSH_INDEX_H_ - -#include -#include -#include -#include -#include - -#include "general.h" -#include "nn_index.h" -#include "matrix.h" -#include "result_set.h" -#include "heap.h" -#include "lsh_table.h" -#include "allocator.h" -#include "random.h" -#include "saving.h" - -namespace cvflann -{ - -struct LshIndexParams : public IndexParams -{ - LshIndexParams(unsigned int table_number = 12, unsigned int key_size = 20, unsigned int multi_probe_level = 2) - { - (* this)["algorithm"] = FLANN_INDEX_LSH; - // The number of hash tables to use - (*this)["table_number"] = table_number; - // The length of the key in the hash tables - (*this)["key_size"] = key_size; - // Number of levels to use in multi-probe (0 for standard LSH) - (*this)["multi_probe_level"] = multi_probe_level; - } -}; - -/** - * Randomized kd-tree index - * - * Contains the k-d trees and other information for indexing a set of points - * for nearest-neighbor matching. - */ -template -class LshIndex : public NNIndex -{ -public: - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - - /** Constructor - * @param input_data dataset with the input features - * @param params parameters passed to the LSH algorithm - * @param d the distance used - */ - LshIndex(const Matrix& input_data, const IndexParams& params = LshIndexParams(), - Distance d = Distance()) : - dataset_(input_data), index_params_(params), distance_(d) - { - // cv::flann::IndexParams sets integer params as 'int', so it is used with get_param - // in place of 'unsigned int' - table_number_ = (unsigned int)get_param(index_params_,"table_number",12); - key_size_ = (unsigned int)get_param(index_params_,"key_size",20); - multi_probe_level_ = (unsigned int)get_param(index_params_,"multi_probe_level",2); - - feature_size_ = (unsigned)dataset_.cols; - fill_xor_mask(0, key_size_, multi_probe_level_, xor_masks_); - } - - - LshIndex(const LshIndex&); - LshIndex& operator=(const LshIndex&); - - /** - * Builds the index - */ - void buildIndex() CV_OVERRIDE - { - tables_.resize(table_number_); - for (unsigned int i = 0; i < table_number_; ++i) { - lsh::LshTable& table = tables_[i]; - table = lsh::LshTable(feature_size_, key_size_); - - // Add the features to the table - table.add(dataset_); - } - } - - flann_algorithm_t getType() const CV_OVERRIDE - { - return FLANN_INDEX_LSH; - } - - - void saveIndex(FILE* stream) CV_OVERRIDE - { - save_value(stream,table_number_); - save_value(stream,key_size_); - save_value(stream,multi_probe_level_); - save_value(stream, dataset_); - } - - void loadIndex(FILE* stream) CV_OVERRIDE - { - load_value(stream, table_number_); - load_value(stream, key_size_); - load_value(stream, multi_probe_level_); - load_value(stream, dataset_); - // Building the index is so fast we can afford not storing it - buildIndex(); - - index_params_["algorithm"] = getType(); - index_params_["table_number"] = table_number_; - index_params_["key_size"] = key_size_; - index_params_["multi_probe_level"] = multi_probe_level_; - } - - /** - * Returns size of index. - */ - size_t size() const CV_OVERRIDE - { - return dataset_.rows; - } - - /** - * Returns the length of an index feature. - */ - size_t veclen() const CV_OVERRIDE - { - return feature_size_; - } - - /** - * Computes the index memory usage - * Returns: memory used by the index - */ - int usedMemory() const CV_OVERRIDE - { - return (int)(dataset_.rows * sizeof(int)); - } - - - IndexParams getParameters() const CV_OVERRIDE - { - return index_params_; - } - - /** - * \brief Perform k-nearest neighbor search - * \param[in] queries The query points for which to find the nearest neighbors - * \param[out] indices The indices of the nearest neighbors found - * \param[out] dists Distances to the nearest neighbors found - * \param[in] knn Number of nearest neighbors to return - * \param[in] params Search parameters - */ - virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) CV_OVERRIDE - { - assert(queries.cols == veclen()); - assert(indices.rows >= queries.rows); - assert(dists.rows >= queries.rows); - assert(int(indices.cols) >= knn); - assert(int(dists.cols) >= knn); - - - KNNUniqueResultSet resultSet(knn); - for (size_t i = 0; i < queries.rows; i++) { - resultSet.clear(); - std::fill_n(indices[i], knn, -1); - std::fill_n(dists[i], knn, std::numeric_limits::max()); - findNeighbors(resultSet, queries[i], params); - if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices[i], dists[i], knn); - else resultSet.copy(indices[i], dists[i], knn); - } - } - - - /** - * Find set of nearest neighbors to vec. Their indices are stored inside - * the result object. - * - * Params: - * result = the result object in which the indices of the nearest-neighbors are stored - * vec = the vector for which to search the nearest neighbors - * maxCheck = the maximum number of restarts (in a best-bin-first manner) - */ - void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& /*searchParams*/) CV_OVERRIDE - { - getNeighbors(vec, result); - } - -private: - /** Defines the comparator on score and index - */ - typedef std::pair ScoreIndexPair; - struct SortScoreIndexPairOnSecond - { - bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const - { - return left.second < right.second; - } - }; - - /** Fills the different xor masks to use when getting the neighbors in multi-probe LSH - * @param key the key we build neighbors from - * @param lowest_index the lowest index of the bit set - * @param level the multi-probe level we are at - * @param xor_masks all the xor mask - */ - void fill_xor_mask(lsh::BucketKey key, int lowest_index, unsigned int level, - std::vector& xor_masks) - { - xor_masks.push_back(key); - if (level == 0) return; - for (int index = lowest_index - 1; index >= 0; --index) { - // Create a new key - lsh::BucketKey new_key = key | (1 << index); - fill_xor_mask(new_key, index, level - 1, xor_masks); - } - } - - /** Performs the approximate nearest-neighbor search. - * @param vec the feature to analyze - * @param do_radius flag indicating if we check the radius too - * @param radius the radius if it is a radius search - * @param do_k flag indicating if we limit the number of nn - * @param k_nn the number of nearest neighbors - * @param checked_average used for debugging - */ - void getNeighbors(const ElementType* vec, bool /*do_radius*/, float radius, bool do_k, unsigned int k_nn, - float& /*checked_average*/) - { - static std::vector score_index_heap; - - if (do_k) { - unsigned int worst_score = std::numeric_limits::max(); - typename std::vector >::const_iterator table = tables_.begin(); - typename std::vector >::const_iterator table_end = tables_.end(); - for (; table != table_end; ++table) { - size_t key = table->getKey(vec); - std::vector::const_iterator xor_mask = xor_masks_.begin(); - std::vector::const_iterator xor_mask_end = xor_masks_.end(); - for (; xor_mask != xor_mask_end; ++xor_mask) { - size_t sub_key = key ^ (*xor_mask); - const lsh::Bucket* bucket = table->getBucketFromKey(sub_key); - if (bucket == 0) continue; - - // Go over each descriptor index - std::vector::const_iterator training_index = bucket->begin(); - std::vector::const_iterator last_training_index = bucket->end(); - DistanceType hamming_distance; - - // Process the rest of the candidates - for (; training_index < last_training_index; ++training_index) { - hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols); - - if (hamming_distance < worst_score) { - // Insert the new element - score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index)); - std::push_heap(score_index_heap.begin(), score_index_heap.end()); - - if (score_index_heap.size() > (unsigned int)k_nn) { - // Remove the highest distance value as we have too many elements - std::pop_heap(score_index_heap.begin(), score_index_heap.end()); - score_index_heap.pop_back(); - // Keep track of the worst score - worst_score = score_index_heap.front().first; - } - } - } - } - } - } - else { - typename std::vector >::const_iterator table = tables_.begin(); - typename std::vector >::const_iterator table_end = tables_.end(); - for (; table != table_end; ++table) { - size_t key = table->getKey(vec); - std::vector::const_iterator xor_mask = xor_masks_.begin(); - std::vector::const_iterator xor_mask_end = xor_masks_.end(); - for (; xor_mask != xor_mask_end; ++xor_mask) { - size_t sub_key = key ^ (*xor_mask); - const lsh::Bucket* bucket = table->getBucketFromKey(sub_key); - if (bucket == 0) continue; - - // Go over each descriptor index - std::vector::const_iterator training_index = bucket->begin(); - std::vector::const_iterator last_training_index = bucket->end(); - DistanceType hamming_distance; - - // Process the rest of the candidates - for (; training_index < last_training_index; ++training_index) { - // Compute the Hamming distance - hamming_distance = distance_(vec, dataset_[*training_index], dataset_.cols); - if (hamming_distance < radius) score_index_heap.push_back(ScoreIndexPair(hamming_distance, training_index)); - } - } - } - } - } - - /** Performs the approximate nearest-neighbor search. - * This is a slower version than the above as it uses the ResultSet - * @param vec the feature to analyze - */ - void getNeighbors(const ElementType* vec, ResultSet& result) - { - typename std::vector >::const_iterator table = tables_.begin(); - typename std::vector >::const_iterator table_end = tables_.end(); - for (; table != table_end; ++table) { - size_t key = table->getKey(vec); - std::vector::const_iterator xor_mask = xor_masks_.begin(); - std::vector::const_iterator xor_mask_end = xor_masks_.end(); - for (; xor_mask != xor_mask_end; ++xor_mask) { - size_t sub_key = key ^ (*xor_mask); - const lsh::Bucket* bucket = table->getBucketFromKey((lsh::BucketKey)sub_key); - if (bucket == 0) continue; - - // Go over each descriptor index - std::vector::const_iterator training_index = bucket->begin(); - std::vector::const_iterator last_training_index = bucket->end(); - DistanceType hamming_distance; - - // Process the rest of the candidates - for (; training_index < last_training_index; ++training_index) { - // Compute the Hamming distance - hamming_distance = distance_(vec, dataset_[*training_index], (int)dataset_.cols); - result.addPoint(hamming_distance, *training_index); - } - } - } - } - - /** The different hash tables */ - std::vector > tables_; - - /** The data the LSH tables where built from */ - Matrix dataset_; - - /** The size of the features (as ElementType[]) */ - unsigned int feature_size_; - - IndexParams index_params_; - - /** table number */ - unsigned int table_number_; - /** key size */ - unsigned int key_size_; - /** How far should we look for neighbors in multi-probe LSH */ - unsigned int multi_probe_level_; - - /** The XOR masks to apply to a key to get the neighboring buckets */ - std::vector xor_masks_; - - Distance distance_; -}; -} - -#endif //OPENCV_FLANN_LSH_INDEX_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_table.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_table.h deleted file mode 100644 index b07a9d5..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/lsh_table.h +++ /dev/null @@ -1,513 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -/*********************************************************************** - * Author: Vincent Rabaud - *************************************************************************/ - -#ifndef OPENCV_FLANN_LSH_TABLE_H_ -#define OPENCV_FLANN_LSH_TABLE_H_ - -#include -#include -#include -#include -// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -# define USE_UNORDERED_MAP 1 -#else -# define USE_UNORDERED_MAP 0 -#endif -#if USE_UNORDERED_MAP -#include -#else -#include -#endif -#include -#include - -#include "dynamic_bitset.h" -#include "matrix.h" - -namespace cvflann -{ - -namespace lsh -{ - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** What is stored in an LSH bucket - */ -typedef uint32_t FeatureIndex; -/** The id from which we can get a bucket back in an LSH table - */ -typedef unsigned int BucketKey; - -/** A bucket in an LSH table - */ -typedef std::vector Bucket; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** POD for stats about an LSH table - */ -struct LshStats -{ - std::vector bucket_sizes_; - size_t n_buckets_; - size_t bucket_size_mean_; - size_t bucket_size_median_; - size_t bucket_size_min_; - size_t bucket_size_max_; - size_t bucket_size_std_dev; - /** Each contained vector contains three value: beginning/end for interval, number of elements in the bin - */ - std::vector > size_histogram_; -}; - -/** Overload the << operator for LshStats - * @param out the streams - * @param stats the stats to display - * @return the streams - */ -inline std::ostream& operator <<(std::ostream& out, const LshStats& stats) -{ - int w = 20; - out << "Lsh Table Stats:\n" << std::setw(w) << std::setiosflags(std::ios::right) << "N buckets : " - << stats.n_buckets_ << "\n" << std::setw(w) << std::setiosflags(std::ios::right) << "mean size : " - << std::setiosflags(std::ios::left) << stats.bucket_size_mean_ << "\n" << std::setw(w) - << std::setiosflags(std::ios::right) << "median size : " << stats.bucket_size_median_ << "\n" << std::setw(w) - << std::setiosflags(std::ios::right) << "min size : " << std::setiosflags(std::ios::left) - << stats.bucket_size_min_ << "\n" << std::setw(w) << std::setiosflags(std::ios::right) << "max size : " - << std::setiosflags(std::ios::left) << stats.bucket_size_max_; - - // Display the histogram - out << std::endl << std::setw(w) << std::setiosflags(std::ios::right) << "histogram : " - << std::setiosflags(std::ios::left); - for (std::vector >::const_iterator iterator = stats.size_histogram_.begin(), end = - stats.size_histogram_.end(); iterator != end; ++iterator) out << (*iterator)[0] << "-" << (*iterator)[1] << ": " << (*iterator)[2] << ", "; - - return out; -} - - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** Lsh hash table. As its key is a sub-feature, and as usually - * the size of it is pretty small, we keep it as a continuous memory array. - * The value is an index in the corpus of features (we keep it as an unsigned - * int for pure memory reasons, it could be a size_t) - */ -template -class LshTable -{ -public: - /** A container of all the feature indices. Optimized for space - */ -#if USE_UNORDERED_MAP - typedef std::unordered_map BucketsSpace; -#else - typedef std::map BucketsSpace; -#endif - - /** A container of all the feature indices. Optimized for speed - */ - typedef std::vector BucketsSpeed; - - /** Default constructor - */ - LshTable() - { - key_size_ = 0; - feature_size_ = 0; - speed_level_ = kArray; - } - - /** Default constructor - * Create the mask and allocate the memory - * @param feature_size is the size of the feature (considered as a ElementType[]) - * @param key_size is the number of bits that are turned on in the feature - */ - LshTable(unsigned int feature_size, unsigned int key_size) - { - feature_size_ = feature_size; - CV_UNUSED(key_size); - std::cerr << "LSH is not implemented for that type" << std::endl; - assert(0); - } - - /** Add a feature to the table - * @param value the value to store for that feature - * @param feature the feature itself - */ - void add(unsigned int value, const ElementType* feature) - { - // Add the value to the corresponding bucket - BucketKey key = (lsh::BucketKey)getKey(feature); - - switch (speed_level_) { - case kArray: - // That means we get the buckets from an array - buckets_speed_[key].push_back(value); - break; - case kBitsetHash: - // That means we can check the bitset for the presence of a key - key_bitset_.set(key); - buckets_space_[key].push_back(value); - break; - case kHash: - { - // That means we have to check for the hash table for the presence of a key - buckets_space_[key].push_back(value); - break; - } - } - } - - /** Add a set of features to the table - * @param dataset the values to store - */ - void add(Matrix dataset) - { -#if USE_UNORDERED_MAP - buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2); -#endif - // Add the features to the table - for (unsigned int i = 0; i < dataset.rows; ++i) add(i, dataset[i]); - // Now that the table is full, optimize it for speed/space - optimize(); - } - - /** Get a bucket given the key - * @param key - * @return - */ - inline const Bucket* getBucketFromKey(BucketKey key) const - { - // Generate other buckets - switch (speed_level_) { - case kArray: - // That means we get the buckets from an array - return &buckets_speed_[key]; - break; - case kBitsetHash: - // That means we can check the bitset for the presence of a key - if (key_bitset_.test(key)) return &buckets_space_.find(key)->second; - else return 0; - break; - case kHash: - { - // That means we have to check for the hash table for the presence of a key - BucketsSpace::const_iterator bucket_it, bucket_end = buckets_space_.end(); - bucket_it = buckets_space_.find(key); - // Stop here if that bucket does not exist - if (bucket_it == bucket_end) return 0; - else return &bucket_it->second; - break; - } - } - return 0; - } - - /** Compute the sub-signature of a feature - */ - size_t getKey(const ElementType* /*feature*/) const - { - std::cerr << "LSH is not implemented for that type" << std::endl; - assert(0); - return 1; - } - - /** Get statistics about the table - * @return - */ - LshStats getStats() const; - -private: - /** defines the speed fo the implementation - * kArray uses a vector for storing data - * kBitsetHash uses a hash map but checks for the validity of a key with a bitset - * kHash uses a hash map only - */ - enum SpeedLevel - { - kArray, kBitsetHash, kHash - }; - - /** Initialize some variables - */ - void initialize(size_t key_size) - { - const size_t key_size_lower_bound = 1; - //a value (size_t(1) << key_size) must fit the size_t type so key_size has to be strictly less than size of size_t - const size_t key_size_upper_bound = (std::min)(sizeof(BucketKey) * CHAR_BIT + 1, sizeof(size_t) * CHAR_BIT); - if (key_size < key_size_lower_bound || key_size >= key_size_upper_bound) - { - CV_Error(cv::Error::StsBadArg, cv::format("Invalid key_size (=%d). Valid values for your system are %d <= key_size < %d.", (int)key_size, (int)key_size_lower_bound, (int)key_size_upper_bound)); - } - - speed_level_ = kHash; - key_size_ = (unsigned)key_size; - } - - /** Optimize the table for speed/space - */ - void optimize() - { - // If we are already using the fast storage, no need to do anything - if (speed_level_ == kArray) return; - - // Use an array if it will be more than half full - if (buckets_space_.size() > ((size_t(1) << key_size_) / 2)) { - speed_level_ = kArray; - // Fill the array version of it - buckets_speed_.resize(size_t(1) << key_size_); - for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) buckets_speed_[key_bucket->first] = key_bucket->second; - - // Empty the hash table - buckets_space_.clear(); - return; - } - - // If the bitset is going to use less than 10% of the RAM of the hash map (at least 1 size_t for the key and two - // for the vector) or less than 512MB (key_size_ <= 30) - if (((std::max(buckets_space_.size(), buckets_speed_.size()) * CHAR_BIT * 3 * sizeof(BucketKey)) / 10 - >= (size_t(1) << key_size_)) || (key_size_ <= 32)) { - speed_level_ = kBitsetHash; - key_bitset_.resize(size_t(1) << key_size_); - key_bitset_.reset(); - // Try with the BucketsSpace - for (BucketsSpace::const_iterator key_bucket = buckets_space_.begin(); key_bucket != buckets_space_.end(); ++key_bucket) key_bitset_.set(key_bucket->first); - } - else { - speed_level_ = kHash; - key_bitset_.clear(); - } - } - - /** The vector of all the buckets if they are held for speed - */ - BucketsSpeed buckets_speed_; - - /** The hash table of all the buckets in case we cannot use the speed version - */ - BucketsSpace buckets_space_; - - /** What is used to store the data */ - SpeedLevel speed_level_; - - /** If the subkey is small enough, it will keep track of which subkeys are set through that bitset - * That is just a speedup so that we don't look in the hash table (which can be mush slower that checking a bitset) - */ - DynamicBitset key_bitset_; - - /** The size of the sub-signature in bits - */ - unsigned int key_size_; - - unsigned int feature_size_; - - // Members only used for the unsigned char specialization - /** The mask to apply to a feature to get the hash key - * Only used in the unsigned char case - */ - std::vector mask_; -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Specialization for unsigned char - -template<> -inline LshTable::LshTable(unsigned int feature_size, unsigned int subsignature_size) -{ - feature_size_ = feature_size; - initialize(subsignature_size); - // Allocate the mask - mask_ = std::vector((feature_size * sizeof(char) + sizeof(size_t) - 1) / sizeof(size_t), 0); - - // A bit brutal but fast to code - std::vector indices(feature_size * CHAR_BIT); - for (size_t i = 0; i < feature_size * CHAR_BIT; ++i) indices[i] = (int)i; -#ifndef OPENCV_FLANN_USE_STD_RAND - cv::randShuffle(indices); -#else - std::random_shuffle(indices.begin(), indices.end()); -#endif - - // Generate a random set of order of subsignature_size_ bits - for (unsigned int i = 0; i < key_size_; ++i) { - size_t index = indices[i]; - - // Set that bit in the mask - size_t divisor = CHAR_BIT * sizeof(size_t); - size_t idx = index / divisor; //pick the right size_t index - mask_[idx] |= size_t(1) << (index % divisor); //use modulo to find the bit offset - } - - // Set to 1 if you want to display the mask for debug -#if 0 - { - size_t bcount = 0; - BOOST_FOREACH(size_t mask_block, mask_){ - out << std::setw(sizeof(size_t) * CHAR_BIT / 4) << std::setfill('0') << std::hex << mask_block - << std::endl; - bcount += __builtin_popcountll(mask_block); - } - out << "bit count : " << std::dec << bcount << std::endl; - out << "mask size : " << mask_.size() << std::endl; - return out; - } -#endif -} - -/** Return the Subsignature of a feature - * @param feature the feature to analyze - */ -template<> -inline size_t LshTable::getKey(const unsigned char* feature) const -{ - // no need to check if T is dividable by sizeof(size_t) like in the Hamming - // distance computation as we have a mask - // FIXIT: This is bad assumption, because we reading tail bytes after of the allocated features buffer - const size_t* feature_block_ptr = reinterpret_cast ((const void*)feature); - - // Figure out the subsignature of the feature - // Given the feature ABCDEF, and the mask 001011, the output will be - // 000CEF - size_t subsignature = 0; - size_t bit_index = 1; - - for (unsigned i = 0; i < feature_size_; i += sizeof(size_t)) { - // get the mask and signature blocks - size_t feature_block; - if (i <= feature_size_ - sizeof(size_t)) - { - feature_block = *feature_block_ptr; - } - else - { - size_t tmp = 0; - memcpy(&tmp, feature_block_ptr, feature_size_ - i); // preserve bytes order - feature_block = tmp; - } - size_t mask_block = mask_[i / sizeof(size_t)]; - while (mask_block) { - // Get the lowest set bit in the mask block - size_t lowest_bit = mask_block & (-(ptrdiff_t)mask_block); - // Add it to the current subsignature if necessary - subsignature += (feature_block & lowest_bit) ? bit_index : 0; - // Reset the bit in the mask block - mask_block ^= lowest_bit; - // increment the bit index for the subsignature - bit_index <<= 1; - } - // Check the next feature block - ++feature_block_ptr; - } - return subsignature; -} - -template<> -inline LshStats LshTable::getStats() const -{ - LshStats stats; - stats.bucket_size_mean_ = 0; - if ((buckets_speed_.empty()) && (buckets_space_.empty())) { - stats.n_buckets_ = 0; - stats.bucket_size_median_ = 0; - stats.bucket_size_min_ = 0; - stats.bucket_size_max_ = 0; - return stats; - } - - if (!buckets_speed_.empty()) { - for (BucketsSpeed::const_iterator pbucket = buckets_speed_.begin(); pbucket != buckets_speed_.end(); ++pbucket) { - stats.bucket_sizes_.push_back((lsh::FeatureIndex)pbucket->size()); - stats.bucket_size_mean_ += pbucket->size(); - } - stats.bucket_size_mean_ /= buckets_speed_.size(); - stats.n_buckets_ = buckets_speed_.size(); - } - else { - for (BucketsSpace::const_iterator x = buckets_space_.begin(); x != buckets_space_.end(); ++x) { - stats.bucket_sizes_.push_back((lsh::FeatureIndex)x->second.size()); - stats.bucket_size_mean_ += x->second.size(); - } - stats.bucket_size_mean_ /= buckets_space_.size(); - stats.n_buckets_ = buckets_space_.size(); - } - - std::sort(stats.bucket_sizes_.begin(), stats.bucket_sizes_.end()); - - // BOOST_FOREACH(int size, stats.bucket_sizes_) - // std::cout << size << " "; - // std::cout << std::endl; - stats.bucket_size_median_ = stats.bucket_sizes_[stats.bucket_sizes_.size() / 2]; - stats.bucket_size_min_ = stats.bucket_sizes_.front(); - stats.bucket_size_max_ = stats.bucket_sizes_.back(); - - // TODO compute mean and std - /*float mean, stddev; - stats.bucket_size_mean_ = mean; - stats.bucket_size_std_dev = stddev;*/ - - // Include a histogram of the buckets - unsigned int bin_start = 0; - unsigned int bin_end = 20; - bool is_new_bin = true; - for (std::vector::iterator iterator = stats.bucket_sizes_.begin(), end = stats.bucket_sizes_.end(); iterator - != end; ) - if (*iterator < bin_end) { - if (is_new_bin) { - stats.size_histogram_.push_back(std::vector(3, 0)); - stats.size_histogram_.back()[0] = bin_start; - stats.size_histogram_.back()[1] = bin_end - 1; - is_new_bin = false; - } - ++stats.size_histogram_.back()[2]; - ++iterator; - } - else { - bin_start += 20; - bin_end += 20; - is_new_bin = true; - } - - return stats; -} - -// End the two namespaces -} -} - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -#endif /* OPENCV_FLANN_LSH_TABLE_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/matrix.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/matrix.h deleted file mode 100644 index f6092d1..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/matrix.h +++ /dev/null @@ -1,116 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_DATASET_H_ -#define OPENCV_FLANN_DATASET_H_ - -#include - -#include "general.h" - -namespace cvflann -{ - -/** - * Class that implements a simple rectangular matrix stored in a memory buffer and - * provides convenient matrix-like access using the [] operators. - */ -template -class Matrix -{ -public: - typedef T type; - - size_t rows; - size_t cols; - size_t stride; - T* data; - - Matrix() : rows(0), cols(0), stride(0), data(NULL) - { - } - - Matrix(T* data_, size_t rows_, size_t cols_, size_t stride_ = 0) : - rows(rows_), cols(cols_), stride(stride_), data(data_) - { - if (stride==0) stride = cols; - } - - /** - * Convenience function for deallocating the storage data. - */ - CV_DEPRECATED void free() - { - fprintf(stderr, "The cvflann::Matrix::free() method is deprecated " - "and it does not do any memory deallocation any more. You are" - "responsible for deallocating the matrix memory (by doing" - "'delete[] matrix.data' for example)"); - } - - /** - * Operator that return a (pointer to a) row of the data. - */ - T* operator[](size_t index) const - { - return data+index*stride; - } -}; - - -class UntypedMatrix -{ -public: - size_t rows; - size_t cols; - void* data; - flann_datatype_t type; - - UntypedMatrix(void* data_, long rows_, long cols_) : - rows(rows_), cols(cols_), data(data_) - { - } - - ~UntypedMatrix() - { - } - - - template - Matrix as() - { - return Matrix((T*)data, rows, cols); - } -}; - - - -} - -#endif //OPENCV_FLANN_DATASET_H_ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/miniflann.hpp b/qt-correction-tool/pub/opencv/include/opencv2/flann/miniflann.hpp deleted file mode 100644 index bda2ed4..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/miniflann.hpp +++ /dev/null @@ -1,162 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_MINIFLANN_HPP -#define OPENCV_MINIFLANN_HPP - -#include "opencv2/core.hpp" -#include "opencv2/flann/defines.h" - -namespace cv -{ - -namespace flann -{ - -struct CV_EXPORTS IndexParams -{ - IndexParams(); - ~IndexParams(); - - String getString(const String& key, const String& defaultVal=String()) const; - int getInt(const String& key, int defaultVal=-1) const; - double getDouble(const String& key, double defaultVal=-1) const; - - void setString(const String& key, const String& value); - void setInt(const String& key, int value); - void setDouble(const String& key, double value); - void setFloat(const String& key, float value); - void setBool(const String& key, bool value); - void setAlgorithm(int value); - - void getAll(std::vector& names, - std::vector& types, - std::vector& strValues, - std::vector& numValues) const; - - void* params; - -private: - IndexParams(const IndexParams &); // copy disabled - IndexParams& operator=(const IndexParams &); // assign disabled -}; - -struct CV_EXPORTS KDTreeIndexParams : public IndexParams -{ - KDTreeIndexParams(int trees=4); -}; - -struct CV_EXPORTS LinearIndexParams : public IndexParams -{ - LinearIndexParams(); -}; - -struct CV_EXPORTS CompositeIndexParams : public IndexParams -{ - CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11, - cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f ); -}; - -struct CV_EXPORTS AutotunedIndexParams : public IndexParams -{ - AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f, - float memory_weight = 0, float sample_fraction = 0.1f); -}; - -struct CV_EXPORTS HierarchicalClusteringIndexParams : public IndexParams -{ - HierarchicalClusteringIndexParams(int branching = 32, - cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, int trees = 4, int leaf_size = 100 ); -}; - -struct CV_EXPORTS KMeansIndexParams : public IndexParams -{ - KMeansIndexParams(int branching = 32, int iterations = 11, - cvflann::flann_centers_init_t centers_init = cvflann::FLANN_CENTERS_RANDOM, float cb_index = 0.2f ); -}; - -struct CV_EXPORTS LshIndexParams : public IndexParams -{ - LshIndexParams(int table_number, int key_size, int multi_probe_level); -}; - -struct CV_EXPORTS SavedIndexParams : public IndexParams -{ - SavedIndexParams(const String& filename); -}; - -struct CV_EXPORTS SearchParams : public IndexParams -{ - SearchParams( int checks = 32, float eps = 0, bool sorted = true ); -}; - -class CV_EXPORTS_W Index -{ -public: - CV_WRAP Index(); - CV_WRAP Index(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2); - virtual ~Index(); - - CV_WRAP virtual void build(InputArray features, const IndexParams& params, cvflann::flann_distance_t distType=cvflann::FLANN_DIST_L2); - CV_WRAP virtual void knnSearch(InputArray query, OutputArray indices, - OutputArray dists, int knn, const SearchParams& params=SearchParams()); - - CV_WRAP virtual int radiusSearch(InputArray query, OutputArray indices, - OutputArray dists, double radius, int maxResults, - const SearchParams& params=SearchParams()); - - CV_WRAP virtual void save(const String& filename) const; - CV_WRAP virtual bool load(InputArray features, const String& filename); - CV_WRAP virtual void release(); - CV_WRAP cvflann::flann_distance_t getDistance() const; - CV_WRAP cvflann::flann_algorithm_t getAlgorithm() const; - -protected: - cvflann::flann_distance_t distType; - cvflann::flann_algorithm_t algo; - int featureType; - void* index; -}; - -} } // namespace cv::flann - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/nn_index.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/nn_index.h deleted file mode 100644 index 381d4bc..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/nn_index.h +++ /dev/null @@ -1,177 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_NNINDEX_H -#define OPENCV_FLANN_NNINDEX_H - -#include "general.h" -#include "matrix.h" -#include "result_set.h" -#include "params.h" - -namespace cvflann -{ - -/** - * Nearest-neighbour index base class - */ -template -class NNIndex -{ - typedef typename Distance::ElementType ElementType; - typedef typename Distance::ResultType DistanceType; - -public: - - virtual ~NNIndex() {} - - /** - * \brief Builds the index - */ - virtual void buildIndex() = 0; - - /** - * \brief Perform k-nearest neighbor search - * \param[in] queries The query points for which to find the nearest neighbors - * \param[out] indices The indices of the nearest neighbors found - * \param[out] dists Distances to the nearest neighbors found - * \param[in] knn Number of nearest neighbors to return - * \param[in] params Search parameters - */ - virtual void knnSearch(const Matrix& queries, Matrix& indices, Matrix& dists, int knn, const SearchParams& params) - { - assert(queries.cols == veclen()); - assert(indices.rows >= queries.rows); - assert(dists.rows >= queries.rows); - assert(int(indices.cols) >= knn); - assert(int(dists.cols) >= knn); - -#if 0 - KNNResultSet resultSet(knn); - for (size_t i = 0; i < queries.rows; i++) { - resultSet.init(indices[i], dists[i]); - findNeighbors(resultSet, queries[i], params); - } -#else - KNNUniqueResultSet resultSet(knn); - for (size_t i = 0; i < queries.rows; i++) { - resultSet.clear(); - findNeighbors(resultSet, queries[i], params); - if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices[i], dists[i], knn); - else resultSet.copy(indices[i], dists[i], knn); - } -#endif - } - - /** - * \brief Perform radius search - * \param[in] query The query point - * \param[out] indices The indinces of the neighbors found within the given radius - * \param[out] dists The distances to the nearest neighbors found - * \param[in] radius The radius used for search - * \param[in] params Search parameters - * \returns Number of neighbors found - */ - virtual int radiusSearch(const Matrix& query, Matrix& indices, Matrix& dists, float radius, const SearchParams& params) - { - if (query.rows != 1) { - fprintf(stderr, "I can only search one feature at a time for range search\n"); - return -1; - } - assert(query.cols == veclen()); - assert(indices.cols == dists.cols); - - int n = 0; - int* indices_ptr = NULL; - DistanceType* dists_ptr = NULL; - if (indices.cols > 0) { - n = (int)indices.cols; - indices_ptr = indices[0]; - dists_ptr = dists[0]; - } - - RadiusUniqueResultSet resultSet((DistanceType)radius); - resultSet.clear(); - findNeighbors(resultSet, query[0], params); - if (n>0) { - if (get_param(params,"sorted",true)) resultSet.sortAndCopy(indices_ptr, dists_ptr, n); - else resultSet.copy(indices_ptr, dists_ptr, n); - } - - return (int)resultSet.size(); - } - - /** - * \brief Saves the index to a stream - * \param stream The stream to save the index to - */ - virtual void saveIndex(FILE* stream) = 0; - - /** - * \brief Loads the index from a stream - * \param stream The stream from which the index is loaded - */ - virtual void loadIndex(FILE* stream) = 0; - - /** - * \returns number of features in this index. - */ - virtual size_t size() const = 0; - - /** - * \returns The dimensionality of the features in this index. - */ - virtual size_t veclen() const = 0; - - /** - * \returns The amount of memory (in bytes) used by the index. - */ - virtual int usedMemory() const = 0; - - /** - * \returns The index type (kdtree, kmeans,...) - */ - virtual flann_algorithm_t getType() const = 0; - - /** - * \returns The index parameters - */ - virtual IndexParams getParameters() const = 0; - - - /** - * \brief Method that searches for nearest-neighbours - */ - virtual void findNeighbors(ResultSet& result, const ElementType* vec, const SearchParams& searchParams) = 0; -}; - -} - -#endif //OPENCV_FLANN_NNINDEX_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/object_factory.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/object_factory.h deleted file mode 100644 index 7f971c5..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/object_factory.h +++ /dev/null @@ -1,91 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_OBJECT_FACTORY_H_ -#define OPENCV_FLANN_OBJECT_FACTORY_H_ - -#include - -namespace cvflann -{ - -class CreatorNotFound -{ -}; - -template -class ObjectFactory -{ - typedef ObjectFactory ThisClass; - typedef std::map ObjectRegistry; - - // singleton class, private constructor - ObjectFactory() {} - -public: - - bool subscribe(UniqueIdType id, ObjectCreator creator) - { - if (object_registry.find(id) != object_registry.end()) return false; - - object_registry[id] = creator; - return true; - } - - bool unregister(UniqueIdType id) - { - return object_registry.erase(id) == 1; - } - - ObjectCreator create(UniqueIdType id) - { - typename ObjectRegistry::const_iterator iter = object_registry.find(id); - - if (iter == object_registry.end()) { - throw CreatorNotFound(); - } - - return iter->second; - } - - static ThisClass& instance() - { - static ThisClass the_factory; - return the_factory; - } -private: - ObjectRegistry object_registry; -}; - -} - -#endif /* OPENCV_FLANN_OBJECT_FACTORY_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/params.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/params.h deleted file mode 100644 index 95ef4cd..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/params.h +++ /dev/null @@ -1,99 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_PARAMS_H_ -#define OPENCV_FLANN_PARAMS_H_ - -#include "any.h" -#include "general.h" -#include -#include - - -namespace cvflann -{ - -typedef std::map IndexParams; - -struct SearchParams : public IndexParams -{ - SearchParams(int checks = 32, float eps = 0, bool sorted = true ) - { - // how many leafs to visit when searching for neighbours (-1 for unlimited) - (*this)["checks"] = checks; - // search for eps-approximate neighbours (default: 0) - (*this)["eps"] = eps; - // only for radius search, require neighbours sorted by distance (default: true) - (*this)["sorted"] = sorted; - } -}; - - -template -T get_param(const IndexParams& params, cv::String name, const T& default_value) -{ - IndexParams::const_iterator it = params.find(name); - if (it != params.end()) { - return it->second.cast(); - } - else { - return default_value; - } -} - -template -T get_param(const IndexParams& params, cv::String name) -{ - IndexParams::const_iterator it = params.find(name); - if (it != params.end()) { - return it->second.cast(); - } - else { - throw FLANNException(cv::String("Missing parameter '")+name+cv::String("' in the parameters given")); - } -} - -inline void print_params(const IndexParams& params, std::ostream& stream) -{ - IndexParams::const_iterator it; - - for(it=params.begin(); it!=params.end(); ++it) { - stream << it->first << " : " << it->second << std::endl; - } -} - -inline void print_params(const IndexParams& params) -{ - print_params(params, std::cout); -} - -} - - -#endif /* OPENCV_FLANN_PARAMS_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/random.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/random.h deleted file mode 100644 index d678474..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/random.h +++ /dev/null @@ -1,155 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_RANDOM_H -#define OPENCV_FLANN_RANDOM_H - -#include -#include -#include - -#include "general.h" - -namespace cvflann -{ - -inline int rand() -{ -#ifndef OPENCV_FLANN_USE_STD_RAND -# if INT_MAX == RAND_MAX - int v = cv::theRNG().next() & INT_MAX; -# else - int v = cv::theRNG().uniform(0, RAND_MAX + 1); -# endif -#else - int v = std::rand(); -#endif // OPENCV_FLANN_USE_STD_RAND - return v; -} - -/** - * Seeds the random number generator - * @param seed Random seed - */ -inline void seed_random(unsigned int seed) -{ -#ifndef OPENCV_FLANN_USE_STD_RAND - cv::theRNG() = cv::RNG(seed); -#else - std::srand(seed); -#endif -} - -/* - * Generates a random double value. - */ -/** - * Generates a random double value. - * @param high Upper limit - * @param low Lower limit - * @return Random double value - */ -inline double rand_double(double high = 1.0, double low = 0) -{ - return low + ((high-low) * (rand() / (RAND_MAX + 1.0))); -} - -/** - * Generates a random integer value. - * @param high Upper limit - * @param low Lower limit - * @return Random integer value - */ -inline int rand_int(int high = RAND_MAX, int low = 0) -{ - return low + (int) ( double(high-low) * (rand() / (RAND_MAX + 1.0))); -} - -/** - * Random number generator that returns a distinct number from - * the [0,n) interval each time. - */ -class UniqueRandom -{ - std::vector vals_; - int size_; - int counter_; - -public: - /** - * Constructor. - * @param n Size of the interval from which to generate - * @return - */ - UniqueRandom(int n) - { - init(n); - } - - /** - * Initializes the number generator. - * @param n the size of the interval from which to generate random numbers. - */ - void init(int n) - { - // create and initialize an array of size n - vals_.resize(n); - size_ = n; - for (int i = 0; i < size_; ++i) vals_[i] = i; - - // shuffle the elements in the array -#ifndef OPENCV_FLANN_USE_STD_RAND - cv::randShuffle(vals_); -#else - std::random_shuffle(vals_.begin(), vals_.end()); -#endif - - counter_ = 0; - } - - /** - * Return a distinct random integer in greater or equal to 0 and less - * than 'n' on each call. It should be called maximum 'n' times. - * Returns: a random integer - */ - int next() - { - if (counter_ == size_) { - return -1; - } - else { - return vals_[counter_++]; - } - } -}; - -} - -#endif //OPENCV_FLANN_RANDOM_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/result_set.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/result_set.h deleted file mode 100644 index 5c69ac2..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/result_set.h +++ /dev/null @@ -1,543 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_RESULTSET_H -#define OPENCV_FLANN_RESULTSET_H - -#include -#include -#include -#include -#include -#include - -namespace cvflann -{ - -/* This record represents a branch point when finding neighbors in - the tree. It contains a record of the minimum distance to the query - point, as well as the node at which the search resumes. - */ - -template -struct BranchStruct -{ - T node; /* Tree node at which search resumes */ - DistanceType mindist; /* Minimum distance to query for all nodes below. */ - - BranchStruct() {} - BranchStruct(const T& aNode, DistanceType dist) : node(aNode), mindist(dist) {} - - bool operator<(const BranchStruct& rhs) const - { - return mindist -class ResultSet -{ -public: - virtual ~ResultSet() {} - - virtual bool full() const = 0; - - virtual void addPoint(DistanceType dist, int index) = 0; - - virtual DistanceType worstDist() const = 0; - -}; - -/** - * KNNSimpleResultSet does not ensure that the element it holds are unique. - * Is used in those cases where the nearest neighbour algorithm used does not - * attempt to insert the same element multiple times. - */ -template -class KNNSimpleResultSet : public ResultSet -{ - int* indices; - DistanceType* dists; - int capacity; - int count; - DistanceType worst_distance_; - -public: - KNNSimpleResultSet(int capacity_) : capacity(capacity_), count(0) - { - } - - void init(int* indices_, DistanceType* dists_) - { - indices = indices_; - dists = dists_; - count = 0; - worst_distance_ = (std::numeric_limits::max)(); - dists[capacity-1] = worst_distance_; - } - - size_t size() const - { - return count; - } - - bool full() const CV_OVERRIDE - { - return count == capacity; - } - - - void addPoint(DistanceType dist, int index) CV_OVERRIDE - { - if (dist >= worst_distance_) return; - int i; - for (i=count; i>0; --i) { -#ifdef FLANN_FIRST_MATCH - if ( (dists[i-1]>dist) || ((dist==dists[i-1])&&(indices[i-1]>index)) ) -#else - if (dists[i-1]>dist) -#endif - { - if (i -class KNNResultSet : public ResultSet -{ - int* indices; - DistanceType* dists; - int capacity; - int count; - DistanceType worst_distance_; - -public: - KNNResultSet(int capacity_) : capacity(capacity_), count(0) - { - } - - void init(int* indices_, DistanceType* dists_) - { - indices = indices_; - dists = dists_; - count = 0; - worst_distance_ = (std::numeric_limits::max)(); - dists[capacity-1] = worst_distance_; - } - - size_t size() const - { - return count; - } - - bool full() const CV_OVERRIDE - { - return count == capacity; - } - - - void addPoint(DistanceType dist, int index) CV_OVERRIDE - { - if (dist >= worst_distance_) return; - int i; - for (i = count; i > 0; --i) { -#ifdef FLANN_FIRST_MATCH - if ( (dists[i-1]<=dist) && ((dist!=dists[i-1])||(indices[i-1]<=index)) ) -#else - if (dists[i-1]<=dist) -#endif - { - // Check for duplicate indices - int j = i - 1; - while ((j >= 0) && (dists[j] == dist)) { - if (indices[j] == index) { - return; - } - --j; - } - break; - } - } - - if (count < capacity) ++count; - for (int j = count-1; j > i; --j) { - dists[j] = dists[j-1]; - indices[j] = indices[j-1]; - } - dists[i] = dist; - indices[i] = index; - worst_distance_ = dists[capacity-1]; - } - - DistanceType worstDist() const CV_OVERRIDE - { - return worst_distance_; - } -}; - - -/** - * A result-set class used when performing a radius based search. - */ -template -class RadiusResultSet : public ResultSet -{ - DistanceType radius; - int* indices; - DistanceType* dists; - size_t capacity; - size_t count; - -public: - RadiusResultSet(DistanceType radius_, int* indices_, DistanceType* dists_, int capacity_) : - radius(radius_), indices(indices_), dists(dists_), capacity(capacity_) - { - init(); - } - - ~RadiusResultSet() - { - } - - void init() - { - count = 0; - } - - size_t size() const - { - return count; - } - - bool full() const - { - return true; - } - - void addPoint(DistanceType dist, int index) - { - if (dist0)&&(count < capacity)) { - dists[count] = dist; - indices[count] = index; - } - count++; - } - } - - DistanceType worstDist() const - { - return radius; - } - -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** Class that holds the k NN neighbors - * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays - */ -template -class UniqueResultSet : public ResultSet -{ -public: - struct DistIndex - { - DistIndex(DistanceType dist, unsigned int index) : - dist_(dist), index_(index) - { - } - bool operator<(const DistIndex dist_index) const - { - return (dist_ < dist_index.dist_) || ((dist_ == dist_index.dist_) && index_ < dist_index.index_); - } - DistanceType dist_; - unsigned int index_; - }; - - /** Default cosntructor */ - UniqueResultSet() : - is_full_(false), worst_distance_(std::numeric_limits::max()) - { - } - - /** Check the status of the set - * @return true if we have k NN - */ - inline bool full() const CV_OVERRIDE - { - return is_full_; - } - - /** Remove all elements in the set - */ - virtual void clear() = 0; - - /** Copy the set to two C arrays - * @param indices pointer to a C array of indices - * @param dist pointer to a C array of distances - * @param n_neighbors the number of neighbors to copy - */ - virtual void copy(int* indices, DistanceType* dist, int n_neighbors = -1) const - { - if (n_neighbors < 0) { - for (typename std::set::const_iterator dist_index = dist_indices_.begin(), dist_index_end = - dist_indices_.end(); dist_index != dist_index_end; ++dist_index, ++indices, ++dist) { - *indices = dist_index->index_; - *dist = dist_index->dist_; - } - } - else { - int i = 0; - for (typename std::set::const_iterator dist_index = dist_indices_.begin(), dist_index_end = - dist_indices_.end(); (dist_index != dist_index_end) && (i < n_neighbors); ++dist_index, ++indices, ++dist, ++i) { - *indices = dist_index->index_; - *dist = dist_index->dist_; - } - } - } - - /** Copy the set to two C arrays but sort it according to the distance first - * @param indices pointer to a C array of indices - * @param dist pointer to a C array of distances - * @param n_neighbors the number of neighbors to copy - */ - virtual void sortAndCopy(int* indices, DistanceType* dist, int n_neighbors = -1) const - { - copy(indices, dist, n_neighbors); - } - - /** The number of neighbors in the set - * @return - */ - size_t size() const - { - return dist_indices_.size(); - } - - /** The distance of the furthest neighbor - * If we don't have enough neighbors, it returns the max possible value - * @return - */ - inline DistanceType worstDist() const CV_OVERRIDE - { - return worst_distance_; - } -protected: - /** Flag to say if the set is full */ - bool is_full_; - - /** The worst distance found so far */ - DistanceType worst_distance_; - - /** The best candidates so far */ - std::set dist_indices_; -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** Class that holds the k NN neighbors - * Faster than KNNResultSet as it uses a binary heap and does not maintain two arrays - */ -template -class KNNUniqueResultSet : public UniqueResultSet -{ -public: - /** Constructor - * @param capacity the number of neighbors to store at max - */ - KNNUniqueResultSet(unsigned int capacity) : capacity_(capacity) - { - this->is_full_ = false; - this->clear(); - } - - /** Add a possible candidate to the best neighbors - * @param dist distance for that neighbor - * @param index index of that neighbor - */ - inline void addPoint(DistanceType dist, int index) CV_OVERRIDE - { - // Don't do anything if we are worse than the worst - if (dist >= worst_distance_) return; - dist_indices_.insert(DistIndex(dist, index)); - - if (is_full_) { - if (dist_indices_.size() > capacity_) { - dist_indices_.erase(*dist_indices_.rbegin()); - worst_distance_ = dist_indices_.rbegin()->dist_; - } - } - else if (dist_indices_.size() == capacity_) { - is_full_ = true; - worst_distance_ = dist_indices_.rbegin()->dist_; - } - } - - /** Remove all elements in the set - */ - void clear() CV_OVERRIDE - { - dist_indices_.clear(); - worst_distance_ = std::numeric_limits::max(); - is_full_ = false; - } - -protected: - typedef typename UniqueResultSet::DistIndex DistIndex; - using UniqueResultSet::is_full_; - using UniqueResultSet::worst_distance_; - using UniqueResultSet::dist_indices_; - - /** The number of neighbors to keep */ - unsigned int capacity_; -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** Class that holds the radius nearest neighbors - * It is more accurate than RadiusResult as it is not limited in the number of neighbors - */ -template -class RadiusUniqueResultSet : public UniqueResultSet -{ -public: - /** Constructor - * @param radius the maximum distance of a neighbor - */ - RadiusUniqueResultSet(DistanceType radius) : - radius_(radius) - { - is_full_ = true; - } - - /** Add a possible candidate to the best neighbors - * @param dist distance for that neighbor - * @param index index of that neighbor - */ - void addPoint(DistanceType dist, int index) CV_OVERRIDE - { - if (dist <= radius_) dist_indices_.insert(DistIndex(dist, index)); - } - - /** Remove all elements in the set - */ - inline void clear() CV_OVERRIDE - { - dist_indices_.clear(); - } - - - /** Check the status of the set - * @return alwys false - */ - inline bool full() const CV_OVERRIDE - { - return true; - } - - /** The distance of the furthest neighbor - * If we don't have enough neighbors, it returns the max possible value - * @return - */ - inline DistanceType worstDist() const CV_OVERRIDE - { - return radius_; - } -private: - typedef typename UniqueResultSet::DistIndex DistIndex; - using UniqueResultSet::dist_indices_; - using UniqueResultSet::is_full_; - - /** The furthest distance a neighbor can be */ - DistanceType radius_; -}; - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/** Class that holds the k NN neighbors within a radius distance - */ -template -class KNNRadiusUniqueResultSet : public KNNUniqueResultSet -{ -public: - /** Constructor - * @param capacity the number of neighbors to store at max - * @param radius the maximum distance of a neighbor - */ - KNNRadiusUniqueResultSet(unsigned int capacity, DistanceType radius) - { - this->capacity_ = capacity; - this->radius_ = radius; - this->dist_indices_.reserve(capacity_); - this->clear(); - } - - /** Remove all elements in the set - */ - void clear() - { - dist_indices_.clear(); - worst_distance_ = radius_; - is_full_ = false; - } -private: - using KNNUniqueResultSet::dist_indices_; - using KNNUniqueResultSet::is_full_; - using KNNUniqueResultSet::worst_distance_; - - /** The maximum number of neighbors to consider */ - unsigned int capacity_; - - /** The maximum distance of a neighbor */ - DistanceType radius_; -}; -} - -#endif //OPENCV_FLANN_RESULTSET_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/sampling.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/sampling.h deleted file mode 100644 index 396f177..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/sampling.h +++ /dev/null @@ -1,81 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - - -#ifndef OPENCV_FLANN_SAMPLING_H_ -#define OPENCV_FLANN_SAMPLING_H_ - -#include "matrix.h" -#include "random.h" - -namespace cvflann -{ - -template -Matrix random_sample(Matrix& srcMatrix, long size, bool remove = false) -{ - Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); - - T* src,* dest; - for (long i=0; i -Matrix random_sample(const Matrix& srcMatrix, size_t size) -{ - UniqueRandom rand((int)srcMatrix.rows); - Matrix newSet(new T[size * srcMatrix.cols], size,srcMatrix.cols); - - T* src,* dest; - for (size_t i=0; i -#include - -#include "general.h" -#include "nn_index.h" - -#ifdef FLANN_SIGNATURE_ -#undef FLANN_SIGNATURE_ -#endif -#define FLANN_SIGNATURE_ "FLANN_INDEX" - -namespace cvflann -{ - -template -struct Datatype {}; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_INT8; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_INT16; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_INT32; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_UINT8; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_UINT16; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_UINT32; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_FLOAT32; } }; -template<> -struct Datatype { static flann_datatype_t type() { return FLANN_FLOAT64; } }; - - -/** - * Structure representing the index header. - */ -struct IndexHeader -{ - char signature[16]; - char version[16]; - flann_datatype_t data_type; - flann_algorithm_t index_type; - size_t rows; - size_t cols; -}; - -/** - * Saves index header to stream - * - * @param stream - Stream to save to - * @param index - The index to save - */ -template -void save_header(FILE* stream, const NNIndex& index) -{ - IndexHeader header; - memset(header.signature, 0, sizeof(header.signature)); - strcpy(header.signature, FLANN_SIGNATURE_); - memset(header.version, 0, sizeof(header.version)); - strcpy(header.version, FLANN_VERSION_); - header.data_type = Datatype::type(); - header.index_type = index.getType(); - header.rows = index.size(); - header.cols = index.veclen(); - - std::fwrite(&header, sizeof(header),1,stream); -} - - -/** - * - * @param stream - Stream to load from - * @return Index header - */ -inline IndexHeader load_header(FILE* stream) -{ - IndexHeader header; - size_t read_size = fread(&header,sizeof(header),1,stream); - - if (read_size!=(size_t)1) { - throw FLANNException("Invalid index file, cannot read"); - } - - if (strcmp(header.signature,FLANN_SIGNATURE_)!=0) { - throw FLANNException("Invalid index file, wrong signature"); - } - - return header; - -} - - -template -void save_value(FILE* stream, const T& value, size_t count = 1) -{ - fwrite(&value, sizeof(value),count, stream); -} - -template -void save_value(FILE* stream, const cvflann::Matrix& value) -{ - fwrite(&value, sizeof(value),1, stream); - fwrite(value.data, sizeof(T),value.rows*value.cols, stream); -} - -template -void save_value(FILE* stream, const std::vector& value) -{ - size_t size = value.size(); - fwrite(&size, sizeof(size_t), 1, stream); - fwrite(&value[0], sizeof(T), size, stream); -} - -template -void load_value(FILE* stream, T& value, size_t count = 1) -{ - size_t read_cnt = fread(&value, sizeof(value), count, stream); - if (read_cnt != count) { - throw FLANNException("Cannot read from file"); - } -} - -template -void load_value(FILE* stream, cvflann::Matrix& value) -{ - size_t read_cnt = fread(&value, sizeof(value), 1, stream); - if (read_cnt != 1) { - throw FLANNException("Cannot read from file"); - } - value.data = new T[value.rows*value.cols]; - read_cnt = fread(value.data, sizeof(T), value.rows*value.cols, stream); - if (read_cnt != (size_t)(value.rows*value.cols)) { - throw FLANNException("Cannot read from file"); - } -} - - -template -void load_value(FILE* stream, std::vector& value) -{ - size_t size; - size_t read_cnt = fread(&size, sizeof(size_t), 1, stream); - if (read_cnt!=1) { - throw FLANNException("Cannot read from file"); - } - value.resize(size); - read_cnt = fread(&value[0], sizeof(T), size, stream); - if (read_cnt != size) { - throw FLANNException("Cannot read from file"); - } -} - -} - -#endif /* OPENCV_FLANN_SAVING_H_ */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/flann/simplex_downhill.h b/qt-correction-tool/pub/opencv/include/opencv2/flann/simplex_downhill.h deleted file mode 100644 index 145901a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/flann/simplex_downhill.h +++ /dev/null @@ -1,186 +0,0 @@ -/*********************************************************************** - * Software License Agreement (BSD License) - * - * Copyright 2008-2009 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. - * Copyright 2008-2009 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. - * - * THE BSD LICENSE - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - *************************************************************************/ - -#ifndef OPENCV_FLANN_SIMPLEX_DOWNHILL_H_ -#define OPENCV_FLANN_SIMPLEX_DOWNHILL_H_ - -namespace cvflann -{ - -/** - Adds val to array vals (and point to array points) and keeping the arrays sorted by vals. - */ -template -void addValue(int pos, float val, float* vals, T* point, T* points, int n) -{ - vals[pos] = val; - for (int i=0; i0 && vals[j] -float optimizeSimplexDownhill(T* points, int n, F func, float* vals = NULL ) -{ - const int MAX_ITERATIONS = 10; - - assert(n>0); - - T* p_o = new T[n]; - T* p_r = new T[n]; - T* p_e = new T[n]; - - int alpha = 1; - - int iterations = 0; - - bool ownVals = false; - if (vals == NULL) { - ownVals = true; - vals = new float[n+1]; - for (int i=0; i MAX_ITERATIONS) break; - - // compute average of simplex points (except the highest point) - for (int j=0; j=vals[0])&&(val_r=vals[n]) { - for (int i=0; i -#include "opencv2/core.hpp" -#include "opencv2/core/utility.hpp" - -namespace cvflann -{ - -/** - * A start-stop timer class. - * - * Can be used to time portions of code. - */ -class StartStopTimer -{ - int64 startTime; - -public: - /** - * Value of the timer. - */ - double value; - - - /** - * Constructor. - */ - StartStopTimer() - { - reset(); - } - - /** - * Starts the timer. - */ - void start() - { - startTime = cv::getTickCount(); - } - - /** - * Stops the timer and updates timer value. - */ - void stop() - { - int64 stopTime = cv::getTickCount(); - value += ( (double)stopTime - startTime) / cv::getTickFrequency(); - } - - /** - * Resets the timer value to 0. - */ - void reset() - { - value = 0; - } - -}; - -} - -#endif // FLANN_TIMER_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/ml.hpp b/qt-correction-tool/pub/opencv/include/opencv2/ml.hpp deleted file mode 100644 index 5348206..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/ml.hpp +++ /dev/null @@ -1,1972 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Copyright (C) 2014, Itseez Inc, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_ML_HPP -#define OPENCV_ML_HPP - -#ifdef __cplusplus -# include "opencv2/core.hpp" -#endif - -#ifdef __cplusplus - -#include -#include -#include - -/** - @defgroup ml Machine Learning - - The Machine Learning Library (MLL) is a set of classes and functions for statistical - classification, regression, and clustering of data. - - Most of the classification and regression algorithms are implemented as C++ classes. As the - algorithms have different sets of features (like an ability to handle missing measurements or - categorical input variables), there is a little common ground between the classes. This common - ground is defined by the class cv::ml::StatModel that all the other ML classes are derived from. - - See detailed overview here: @ref ml_intro. - */ - -namespace cv -{ - -namespace ml -{ - -//! @addtogroup ml -//! @{ - -/** @brief Variable types */ -enum VariableTypes -{ - VAR_NUMERICAL =0, //!< same as VAR_ORDERED - VAR_ORDERED =0, //!< ordered variables - VAR_CATEGORICAL =1 //!< categorical variables -}; - -/** @brief %Error types */ -enum ErrorTypes -{ - TEST_ERROR = 0, - TRAIN_ERROR = 1 -}; - -/** @brief Sample types */ -enum SampleTypes -{ - ROW_SAMPLE = 0, //!< each training sample is a row of samples - COL_SAMPLE = 1 //!< each training sample occupies a column of samples -}; - -/** @brief The structure represents the logarithmic grid range of statmodel parameters. - -It is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate -being computed by cross-validation. - */ -class CV_EXPORTS_W ParamGrid -{ -public: - /** @brief Default constructor */ - ParamGrid(); - /** @brief Constructor with parameters */ - ParamGrid(double _minVal, double _maxVal, double _logStep); - - CV_PROP_RW double minVal; //!< Minimum value of the statmodel parameter. Default value is 0. - CV_PROP_RW double maxVal; //!< Maximum value of the statmodel parameter. Default value is 0. - /** @brief Logarithmic step for iterating the statmodel parameter. - - The grid determines the following iteration sequence of the statmodel parameter values: - \f[(minVal, minVal*step, minVal*{step}^2, \dots, minVal*{logStep}^n),\f] - where \f$n\f$ is the maximal index satisfying - \f[\texttt{minVal} * \texttt{logStep} ^n < \texttt{maxVal}\f] - The grid is logarithmic, so logStep must always be greater than 1. Default value is 1. - */ - CV_PROP_RW double logStep; - - /** @brief Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method - - @param minVal minimum value of the parameter grid - @param maxVal maximum value of the parameter grid - @param logstep Logarithmic step for iterating the statmodel parameter - */ - CV_WRAP static Ptr create(double minVal=0., double maxVal=0., double logstep=1.); -}; - -/** @brief Class encapsulating training data. - -Please note that the class only specifies the interface of training data, but not implementation. -All the statistical model classes in _ml_ module accepts Ptr\ as parameter. In other -words, you can create your own class derived from TrainData and pass smart pointer to the instance -of this class into StatModel::train. - -@sa @ref ml_intro_data - */ -class CV_EXPORTS_W TrainData -{ -public: - static inline float missingValue() { return FLT_MAX; } - virtual ~TrainData(); - - CV_WRAP virtual int getLayout() const = 0; - CV_WRAP virtual int getNTrainSamples() const = 0; - CV_WRAP virtual int getNTestSamples() const = 0; - CV_WRAP virtual int getNSamples() const = 0; - CV_WRAP virtual int getNVars() const = 0; - CV_WRAP virtual int getNAllVars() const = 0; - - CV_WRAP virtual void getSample(InputArray varIdx, int sidx, float* buf) const = 0; - CV_WRAP virtual Mat getSamples() const = 0; - CV_WRAP virtual Mat getMissing() const = 0; - - /** @brief Returns matrix of train samples - - @param layout The requested layout. If it's different from the initial one, the matrix is - transposed. See ml::SampleTypes. - @param compressSamples if true, the function returns only the training samples (specified by - sampleIdx) - @param compressVars if true, the function returns the shorter training samples, containing only - the active variables. - - In current implementation the function tries to avoid physical data copying and returns the - matrix stored inside TrainData (unless the transposition or compression is needed). - */ - CV_WRAP virtual Mat getTrainSamples(int layout=ROW_SAMPLE, - bool compressSamples=true, - bool compressVars=true) const = 0; - - /** @brief Returns the vector of responses - - The function returns ordered or the original categorical responses. Usually it's used in - regression algorithms. - */ - CV_WRAP virtual Mat getTrainResponses() const = 0; - - /** @brief Returns the vector of normalized categorical responses - - The function returns vector of responses. Each response is integer from `0` to `-1`. The actual label value can be retrieved then from the class label vector, see - TrainData::getClassLabels. - */ - CV_WRAP virtual Mat getTrainNormCatResponses() const = 0; - CV_WRAP virtual Mat getTestResponses() const = 0; - CV_WRAP virtual Mat getTestNormCatResponses() const = 0; - CV_WRAP virtual Mat getResponses() const = 0; - CV_WRAP virtual Mat getNormCatResponses() const = 0; - CV_WRAP virtual Mat getSampleWeights() const = 0; - CV_WRAP virtual Mat getTrainSampleWeights() const = 0; - CV_WRAP virtual Mat getTestSampleWeights() const = 0; - CV_WRAP virtual Mat getVarIdx() const = 0; - CV_WRAP virtual Mat getVarType() const = 0; - CV_WRAP Mat getVarSymbolFlags() const; - CV_WRAP virtual int getResponseType() const = 0; - CV_WRAP virtual Mat getTrainSampleIdx() const = 0; - CV_WRAP virtual Mat getTestSampleIdx() const = 0; - CV_WRAP virtual void getValues(int vi, InputArray sidx, float* values) const = 0; - virtual void getNormCatValues(int vi, InputArray sidx, int* values) const = 0; - CV_WRAP virtual Mat getDefaultSubstValues() const = 0; - - CV_WRAP virtual int getCatCount(int vi) const = 0; - - /** @brief Returns the vector of class labels - - The function returns vector of unique labels occurred in the responses. - */ - CV_WRAP virtual Mat getClassLabels() const = 0; - - CV_WRAP virtual Mat getCatOfs() const = 0; - CV_WRAP virtual Mat getCatMap() const = 0; - - /** @brief Splits the training data into the training and test parts - @sa TrainData::setTrainTestSplitRatio - */ - CV_WRAP virtual void setTrainTestSplit(int count, bool shuffle=true) = 0; - - /** @brief Splits the training data into the training and test parts - - The function selects a subset of specified relative size and then returns it as the training - set. If the function is not called, all the data is used for training. Please, note that for - each of TrainData::getTrain\* there is corresponding TrainData::getTest\*, so that the test - subset can be retrieved and processed as well. - @sa TrainData::setTrainTestSplit - */ - CV_WRAP virtual void setTrainTestSplitRatio(double ratio, bool shuffle=true) = 0; - CV_WRAP virtual void shuffleTrainTest() = 0; - - /** @brief Returns matrix of test samples */ - CV_WRAP Mat getTestSamples() const; - - /** @brief Returns vector of symbolic names captured in loadFromCSV() */ - CV_WRAP void getNames(std::vector& names) const; - - /** @brief Extract from 1D vector elements specified by passed indexes. - @param vec input vector (supported types: CV_32S, CV_32F, CV_64F) - @param idx 1D index vector - */ - static CV_WRAP Mat getSubVector(const Mat& vec, const Mat& idx); - - /** @brief Extract from matrix rows/cols specified by passed indexes. - @param matrix input matrix (supported types: CV_32S, CV_32F, CV_64F) - @param idx 1D index vector - @param layout specifies to extract rows (cv::ml::ROW_SAMPLES) or to extract columns (cv::ml::COL_SAMPLES) - */ - static CV_WRAP Mat getSubMatrix(const Mat& matrix, const Mat& idx, int layout); - - /** @brief Reads the dataset from a .csv file and returns the ready-to-use training data. - - @param filename The input file name - @param headerLineCount The number of lines in the beginning to skip; besides the header, the - function also skips empty lines and lines staring with `#` - @param responseStartIdx Index of the first output variable. If -1, the function considers the - last variable as the response - @param responseEndIdx Index of the last output variable + 1. If -1, then there is single - response variable at responseStartIdx. - @param varTypeSpec The optional text string that specifies the variables' types. It has the - format `ord[n1-n2,n3,n4-n5,...]cat[n6,n7-n8,...]`. That is, variables from `n1 to n2` - (inclusive range), `n3`, `n4 to n5` ... are considered ordered and `n6`, `n7 to n8` ... are - considered as categorical. The range `[n1..n2] + [n3] + [n4..n5] + ... + [n6] + [n7..n8]` - should cover all the variables. If varTypeSpec is not specified, then algorithm uses the - following rules: - - all input variables are considered ordered by default. If some column contains has non- - numerical values, e.g. 'apple', 'pear', 'apple', 'apple', 'mango', the corresponding - variable is considered categorical. - - if there are several output variables, they are all considered as ordered. Error is - reported when non-numerical values are used. - - if there is a single output variable, then if its values are non-numerical or are all - integers, then it's considered categorical. Otherwise, it's considered ordered. - @param delimiter The character used to separate values in each line. - @param missch The character used to specify missing measurements. It should not be a digit. - Although it's a non-numerical value, it surely does not affect the decision of whether the - variable ordered or categorical. - @note If the dataset only contains input variables and no responses, use responseStartIdx = -2 - and responseEndIdx = 0. The output variables vector will just contain zeros. - */ - static Ptr loadFromCSV(const String& filename, - int headerLineCount, - int responseStartIdx=-1, - int responseEndIdx=-1, - const String& varTypeSpec=String(), - char delimiter=',', - char missch='?'); - - /** @brief Creates training data from in-memory arrays. - - @param samples matrix of samples. It should have CV_32F type. - @param layout see ml::SampleTypes. - @param responses matrix of responses. If the responses are scalar, they should be stored as a - single row or as a single column. The matrix should have type CV_32F or CV_32S (in the - former case the responses are considered as ordered by default; in the latter case - as - categorical) - @param varIdx vector specifying which variables to use for training. It can be an integer vector - (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of - active variables. - @param sampleIdx vector specifying which samples to use for training. It can be an integer - vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask - of training samples. - @param sampleWeights optional vector with weights for each sample. It should have CV_32F type. - @param varType optional vector of type CV_8U and size ` + - `, containing types of each input and output variable. See - ml::VariableTypes. - */ - CV_WRAP static Ptr create(InputArray samples, int layout, InputArray responses, - InputArray varIdx=noArray(), InputArray sampleIdx=noArray(), - InputArray sampleWeights=noArray(), InputArray varType=noArray()); -}; - -/** @brief Base class for statistical models in OpenCV ML. - */ -class CV_EXPORTS_W StatModel : public Algorithm -{ -public: - /** Predict options */ - enum Flags { - UPDATE_MODEL = 1, - RAW_OUTPUT=1, //!< makes the method return the raw results (the sum), not the class label - COMPRESSED_INPUT=2, - PREPROCESSED_INPUT=4 - }; - - /** @brief Returns the number of variables in training samples */ - CV_WRAP virtual int getVarCount() const = 0; - - CV_WRAP virtual bool empty() const CV_OVERRIDE; - - /** @brief Returns true if the model is trained */ - CV_WRAP virtual bool isTrained() const = 0; - /** @brief Returns true if the model is classifier */ - CV_WRAP virtual bool isClassifier() const = 0; - - /** @brief Trains the statistical model - - @param trainData training data that can be loaded from file using TrainData::loadFromCSV or - created with TrainData::create. - @param flags optional flags, depending on the model. Some of the models can be updated with the - new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP). - */ - CV_WRAP virtual bool train( const Ptr& trainData, int flags=0 ); - - /** @brief Trains the statistical model - - @param samples training samples - @param layout See ml::SampleTypes. - @param responses vector of responses associated with the training samples. - */ - CV_WRAP virtual bool train( InputArray samples, int layout, InputArray responses ); - - /** @brief Computes error on the training or test dataset - - @param data the training data - @param test if true, the error is computed over the test subset of the data, otherwise it's - computed over the training subset of the data. Please note that if you loaded a completely - different dataset to evaluate already trained classifier, you will probably want not to set - the test subset at all with TrainData::setTrainTestSplitRatio and specify test=false, so - that the error is computed for the whole new set. Yes, this sounds a bit confusing. - @param resp the optional output responses. - - The method uses StatModel::predict to compute the error. For regression models the error is - computed as RMS, for classifiers - as a percent of missclassified samples (0%-100%). - */ - CV_WRAP virtual float calcError( const Ptr& data, bool test, OutputArray resp ) const; - - /** @brief Predicts response(s) for the provided sample(s) - - @param samples The input samples, floating-point matrix - @param results The optional output matrix of results. - @param flags The optional flags, model-dependent. See cv::ml::StatModel::Flags. - */ - CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const = 0; - - /** @brief Create and train model with default parameters - - The class must implement static `create()` method with no parameters or with all default parameter values - */ - template static Ptr<_Tp> train(const Ptr& data, int flags=0) - { - Ptr<_Tp> model = _Tp::create(); - return !model.empty() && model->train(data, flags) ? model : Ptr<_Tp>(); - } -}; - -/****************************************************************************************\ -* Normal Bayes Classifier * -\****************************************************************************************/ - -/** @brief Bayes classifier for normally distributed data. - -@sa @ref ml_intro_bayes - */ -class CV_EXPORTS_W NormalBayesClassifier : public StatModel -{ -public: - /** @brief Predicts the response for sample(s). - - The method estimates the most probable classes for input vectors. Input vectors (one or more) - are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one - output vector outputs. The predicted class for a single input vector is returned by the method. - The vector outputProbs contains the output probabilities corresponding to each element of - result. - */ - CV_WRAP virtual float predictProb( InputArray inputs, OutputArray outputs, - OutputArray outputProbs, int flags=0 ) const = 0; - - /** Creates empty model - Use StatModel::train to train the model after creation. */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized NormalBayesClassifier from a file - * - * Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk. - * Load the NormalBayesClassifier from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized NormalBayesClassifier - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - -/****************************************************************************************\ -* K-Nearest Neighbour Classifier * -\****************************************************************************************/ - -/** @brief The class implements K-Nearest Neighbors model - -@sa @ref ml_intro_knn - */ -class CV_EXPORTS_W KNearest : public StatModel -{ -public: - - /** Default number of neighbors to use in predict method. */ - /** @see setDefaultK */ - CV_WRAP virtual int getDefaultK() const = 0; - /** @copybrief getDefaultK @see getDefaultK */ - CV_WRAP virtual void setDefaultK(int val) = 0; - - /** Whether classification or regression model should be trained. */ - /** @see setIsClassifier */ - CV_WRAP virtual bool getIsClassifier() const = 0; - /** @copybrief getIsClassifier @see getIsClassifier */ - CV_WRAP virtual void setIsClassifier(bool val) = 0; - - /** Parameter for KDTree implementation. */ - /** @see setEmax */ - CV_WRAP virtual int getEmax() const = 0; - /** @copybrief getEmax @see getEmax */ - CV_WRAP virtual void setEmax(int val) = 0; - - /** %Algorithm type, one of KNearest::Types. */ - /** @see setAlgorithmType */ - CV_WRAP virtual int getAlgorithmType() const = 0; - /** @copybrief getAlgorithmType @see getAlgorithmType */ - CV_WRAP virtual void setAlgorithmType(int val) = 0; - - /** @brief Finds the neighbors and predicts responses for input vectors. - - @param samples Input samples stored by rows. It is a single-precision floating-point matrix of - ` * k` size. - @param k Number of used nearest neighbors. Should be greater than 1. - @param results Vector with results of prediction (regression or classification) for each input - sample. It is a single-precision floating-point vector with `` elements. - @param neighborResponses Optional output values for corresponding neighbors. It is a single- - precision floating-point matrix of ` * k` size. - @param dist Optional output distances from the input vectors to the corresponding neighbors. It - is a single-precision floating-point matrix of ` * k` size. - - For each input vector (a row of the matrix samples), the method finds the k nearest neighbors. - In case of regression, the predicted result is a mean value of the particular vector's neighbor - responses. In case of classification, the class is determined by voting. - - For each input vector, the neighbors are sorted by their distances to the vector. - - In case of C++ interface you can use output pointers to empty matrices and the function will - allocate memory itself. - - If only a single input vector is passed, all output matrices are optional and the predicted - value is returned by the method. - - The function is parallelized with the TBB library. - */ - CV_WRAP virtual float findNearest( InputArray samples, int k, - OutputArray results, - OutputArray neighborResponses=noArray(), - OutputArray dist=noArray() ) const = 0; - - /** @brief Implementations of KNearest algorithm - */ - enum Types - { - BRUTE_FORCE=1, - KDTREE=2 - }; - - /** @brief Creates the empty model - - The static method creates empty %KNearest classifier. It should be then trained using StatModel::train method. - */ - CV_WRAP static Ptr create(); -}; - -/****************************************************************************************\ -* Support Vector Machines * -\****************************************************************************************/ - -/** @brief Support Vector Machines. - -@sa @ref ml_intro_svm - */ -class CV_EXPORTS_W SVM : public StatModel -{ -public: - - class CV_EXPORTS Kernel : public Algorithm - { - public: - virtual int getType() const = 0; - virtual void calc( int vcount, int n, const float* vecs, const float* another, float* results ) = 0; - }; - - /** Type of a %SVM formulation. - See SVM::Types. Default value is SVM::C_SVC. */ - /** @see setType */ - CV_WRAP virtual int getType() const = 0; - /** @copybrief getType @see getType */ - CV_WRAP virtual void setType(int val) = 0; - - /** Parameter \f$\gamma\f$ of a kernel function. - For SVM::POLY, SVM::RBF, SVM::SIGMOID or SVM::CHI2. Default value is 1. */ - /** @see setGamma */ - CV_WRAP virtual double getGamma() const = 0; - /** @copybrief getGamma @see getGamma */ - CV_WRAP virtual void setGamma(double val) = 0; - - /** Parameter _coef0_ of a kernel function. - For SVM::POLY or SVM::SIGMOID. Default value is 0.*/ - /** @see setCoef0 */ - CV_WRAP virtual double getCoef0() const = 0; - /** @copybrief getCoef0 @see getCoef0 */ - CV_WRAP virtual void setCoef0(double val) = 0; - - /** Parameter _degree_ of a kernel function. - For SVM::POLY. Default value is 0. */ - /** @see setDegree */ - CV_WRAP virtual double getDegree() const = 0; - /** @copybrief getDegree @see getDegree */ - CV_WRAP virtual void setDegree(double val) = 0; - - /** Parameter _C_ of a %SVM optimization problem. - For SVM::C_SVC, SVM::EPS_SVR or SVM::NU_SVR. Default value is 0. */ - /** @see setC */ - CV_WRAP virtual double getC() const = 0; - /** @copybrief getC @see getC */ - CV_WRAP virtual void setC(double val) = 0; - - /** Parameter \f$\nu\f$ of a %SVM optimization problem. - For SVM::NU_SVC, SVM::ONE_CLASS or SVM::NU_SVR. Default value is 0. */ - /** @see setNu */ - CV_WRAP virtual double getNu() const = 0; - /** @copybrief getNu @see getNu */ - CV_WRAP virtual void setNu(double val) = 0; - - /** Parameter \f$\epsilon\f$ of a %SVM optimization problem. - For SVM::EPS_SVR. Default value is 0. */ - /** @see setP */ - CV_WRAP virtual double getP() const = 0; - /** @copybrief getP @see getP */ - CV_WRAP virtual void setP(double val) = 0; - - /** Optional weights in the SVM::C_SVC problem, assigned to particular classes. - They are multiplied by _C_ so the parameter _C_ of class _i_ becomes `classWeights(i) * C`. Thus - these weights affect the misclassification penalty for different classes. The larger weight, - the larger penalty on misclassification of data from the corresponding class. Default value is - empty Mat. */ - /** @see setClassWeights */ - CV_WRAP virtual cv::Mat getClassWeights() const = 0; - /** @copybrief getClassWeights @see getClassWeights */ - CV_WRAP virtual void setClassWeights(const cv::Mat &val) = 0; - - /** Termination criteria of the iterative %SVM training procedure which solves a partial - case of constrained quadratic optimization problem. - You can specify tolerance and/or the maximum number of iterations. Default value is - `TermCriteria( TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, FLT_EPSILON )`; */ - /** @see setTermCriteria */ - CV_WRAP virtual cv::TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(const cv::TermCriteria &val) = 0; - - /** Type of a %SVM kernel. - See SVM::KernelTypes. Default value is SVM::RBF. */ - CV_WRAP virtual int getKernelType() const = 0; - - /** Initialize with one of predefined kernels. - See SVM::KernelTypes. */ - CV_WRAP virtual void setKernel(int kernelType) = 0; - - /** Initialize with custom kernel. - See SVM::Kernel class for implementation details */ - virtual void setCustomKernel(const Ptr &_kernel) = 0; - - //! %SVM type - enum Types { - /** C-Support Vector Classification. n-class classification (n \f$\geq\f$ 2), allows - imperfect separation of classes with penalty multiplier C for outliers. */ - C_SVC=100, - /** \f$\nu\f$-Support Vector Classification. n-class classification with possible - imperfect separation. Parameter \f$\nu\f$ (in the range 0..1, the larger the value, the smoother - the decision boundary) is used instead of C. */ - NU_SVC=101, - /** Distribution Estimation (One-class %SVM). All the training data are from - the same class, %SVM builds a boundary that separates the class from the rest of the feature - space. */ - ONE_CLASS=102, - /** \f$\epsilon\f$-Support Vector Regression. The distance between feature vectors - from the training set and the fitting hyper-plane must be less than p. For outliers the - penalty multiplier C is used. */ - EPS_SVR=103, - /** \f$\nu\f$-Support Vector Regression. \f$\nu\f$ is used instead of p. - See @cite LibSVM for details. */ - NU_SVR=104 - }; - - /** @brief %SVM kernel type - - A comparison of different kernels on the following 2D test case with four classes. Four - SVM::C_SVC SVMs have been trained (one against rest) with auto_train. Evaluation on three - different kernels (SVM::CHI2, SVM::INTER, SVM::RBF). The color depicts the class with max score. - Bright means max-score \> 0, dark means max-score \< 0. - ![image](pics/SVM_Comparison.png) - */ - enum KernelTypes { - /** Returned by SVM::getKernelType in case when custom kernel has been set */ - CUSTOM=-1, - /** Linear kernel. No mapping is done, linear discrimination (or regression) is - done in the original feature space. It is the fastest option. \f$K(x_i, x_j) = x_i^T x_j\f$. */ - LINEAR=0, - /** Polynomial kernel: - \f$K(x_i, x_j) = (\gamma x_i^T x_j + coef0)^{degree}, \gamma > 0\f$. */ - POLY=1, - /** Radial basis function (RBF), a good choice in most cases. - \f$K(x_i, x_j) = e^{-\gamma ||x_i - x_j||^2}, \gamma > 0\f$. */ - RBF=2, - /** Sigmoid kernel: \f$K(x_i, x_j) = \tanh(\gamma x_i^T x_j + coef0)\f$. */ - SIGMOID=3, - /** Exponential Chi2 kernel, similar to the RBF kernel: - \f$K(x_i, x_j) = e^{-\gamma \chi^2(x_i,x_j)}, \chi^2(x_i,x_j) = (x_i-x_j)^2/(x_i+x_j), \gamma > 0\f$. */ - CHI2=4, - /** Histogram intersection kernel. A fast kernel. \f$K(x_i, x_j) = min(x_i,x_j)\f$. */ - INTER=5 - }; - - //! %SVM params type - enum ParamTypes { - C=0, - GAMMA=1, - P=2, - NU=3, - COEF=4, - DEGREE=5 - }; - - /** @brief Trains an %SVM with optimal parameters. - - @param data the training data that can be constructed using TrainData::create or - TrainData::loadFromCSV. - @param kFold Cross-validation parameter. The training set is divided into kFold subsets. One - subset is used to test the model, the others form the train set. So, the %SVM algorithm is - executed kFold times. - @param Cgrid grid for C - @param gammaGrid grid for gamma - @param pGrid grid for p - @param nuGrid grid for nu - @param coeffGrid grid for coeff - @param degreeGrid grid for degree - @param balanced If true and the problem is 2-class classification then the method creates more - balanced cross-validation subsets that is proportions between classes in subsets are close - to such proportion in the whole train dataset. - - The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p, - nu, coef0, degree. Parameters are considered optimal when the cross-validation - estimate of the test set error is minimal. - - If there is no need to optimize a parameter, the corresponding grid step should be set to any - value less than or equal to 1. For example, to avoid optimization in gamma, set `gammaGrid.step - = 0`, `gammaGrid.minVal`, `gamma_grid.maxVal` as arbitrary numbers. In this case, the value - `Gamma` is taken for gamma. - - And, finally, if the optimization in a parameter is required but the corresponding grid is - unknown, you may call the function SVM::getDefaultGrid. To generate a grid, for example, for - gamma, call `SVM::getDefaultGrid(SVM::GAMMA)`. - - This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the - regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and - the usual %SVM with parameters specified in params is executed. - */ - virtual bool trainAuto( const Ptr& data, int kFold = 10, - ParamGrid Cgrid = getDefaultGrid(C), - ParamGrid gammaGrid = getDefaultGrid(GAMMA), - ParamGrid pGrid = getDefaultGrid(P), - ParamGrid nuGrid = getDefaultGrid(NU), - ParamGrid coeffGrid = getDefaultGrid(COEF), - ParamGrid degreeGrid = getDefaultGrid(DEGREE), - bool balanced=false) = 0; - - /** @brief Trains an %SVM with optimal parameters - - @param samples training samples - @param layout See ml::SampleTypes. - @param responses vector of responses associated with the training samples. - @param kFold Cross-validation parameter. The training set is divided into kFold subsets. One - subset is used to test the model, the others form the train set. So, the %SVM algorithm is - @param Cgrid grid for C - @param gammaGrid grid for gamma - @param pGrid grid for p - @param nuGrid grid for nu - @param coeffGrid grid for coeff - @param degreeGrid grid for degree - @param balanced If true and the problem is 2-class classification then the method creates more - balanced cross-validation subsets that is proportions between classes in subsets are close - to such proportion in the whole train dataset. - - The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p, - nu, coef0, degree. Parameters are considered optimal when the cross-validation - estimate of the test set error is minimal. - - This function only makes use of SVM::getDefaultGrid for parameter optimization and thus only - offers rudimentary parameter options. - - This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the - regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and - the usual %SVM with parameters specified in params is executed. - */ - CV_WRAP bool trainAuto(InputArray samples, - int layout, - InputArray responses, - int kFold = 10, - Ptr Cgrid = SVM::getDefaultGridPtr(SVM::C), - Ptr gammaGrid = SVM::getDefaultGridPtr(SVM::GAMMA), - Ptr pGrid = SVM::getDefaultGridPtr(SVM::P), - Ptr nuGrid = SVM::getDefaultGridPtr(SVM::NU), - Ptr coeffGrid = SVM::getDefaultGridPtr(SVM::COEF), - Ptr degreeGrid = SVM::getDefaultGridPtr(SVM::DEGREE), - bool balanced=false); - - /** @brief Retrieves all the support vectors - - The method returns all the support vectors as a floating-point matrix, where support vectors are - stored as matrix rows. - */ - CV_WRAP virtual Mat getSupportVectors() const = 0; - - /** @brief Retrieves all the uncompressed support vectors of a linear %SVM - - The method returns all the uncompressed support vectors of a linear %SVM that the compressed - support vector, used for prediction, was derived from. They are returned in a floating-point - matrix, where the support vectors are stored as matrix rows. - */ - CV_WRAP Mat getUncompressedSupportVectors() const; - - /** @brief Retrieves the decision function - - @param i the index of the decision function. If the problem solved is regression, 1-class or - 2-class classification, then there will be just one decision function and the index should - always be 0. Otherwise, in the case of N-class classification, there will be \f$N(N-1)/2\f$ - decision functions. - @param alpha the optional output vector for weights, corresponding to different support vectors. - In the case of linear %SVM all the alpha's will be 1's. - @param svidx the optional output vector of indices of support vectors within the matrix of - support vectors (which can be retrieved by SVM::getSupportVectors). In the case of linear - %SVM each decision function consists of a single "compressed" support vector. - - The method returns rho parameter of the decision function, a scalar subtracted from the weighted - sum of kernel responses. - */ - CV_WRAP virtual double getDecisionFunction(int i, OutputArray alpha, OutputArray svidx) const = 0; - - /** @brief Generates a grid for %SVM parameters. - - @param param_id %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is - generated for the parameter with this ID. - - The function generates a grid for the specified parameter of the %SVM algorithm. The grid may be - passed to the function SVM::trainAuto. - */ - static ParamGrid getDefaultGrid( int param_id ); - - /** @brief Generates a grid for %SVM parameters. - - @param param_id %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is - generated for the parameter with this ID. - - The function generates a grid pointer for the specified parameter of the %SVM algorithm. - The grid may be passed to the function SVM::trainAuto. - */ - CV_WRAP static Ptr getDefaultGridPtr( int param_id ); - - /** Creates empty model. - Use StatModel::train to train the model. Since %SVM has several parameters, you may want to - find the best parameters for your problem, it can be done with SVM::trainAuto. */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized svm from a file - * - * Use SVM::save to serialize and store an SVM to disk. - * Load the SVM from this file again, by calling this function with the path to the file. - * - * @param filepath path to serialized svm - */ - CV_WRAP static Ptr load(const String& filepath); -}; - -/****************************************************************************************\ -* Expectation - Maximization * -\****************************************************************************************/ - -/** @brief The class implements the Expectation Maximization algorithm. - -@sa @ref ml_intro_em - */ -class CV_EXPORTS_W EM : public StatModel -{ -public: - //! Type of covariation matrices - enum Types { - /** A scaled identity matrix \f$\mu_k * I\f$. There is the only - parameter \f$\mu_k\f$ to be estimated for each matrix. The option may be used in special cases, - when the constraint is relevant, or as a first step in the optimization (for example in case - when the data is preprocessed with PCA). The results of such preliminary estimation may be - passed again to the optimization procedure, this time with - covMatType=EM::COV_MAT_DIAGONAL. */ - COV_MAT_SPHERICAL=0, - /** A diagonal matrix with positive diagonal elements. The number of - free parameters is d for each matrix. This is most commonly used option yielding good - estimation results. */ - COV_MAT_DIAGONAL=1, - /** A symmetric positively defined matrix. The number of free - parameters in each matrix is about \f$d^2/2\f$. It is not recommended to use this option, unless - there is pretty accurate initial estimation of the parameters and/or a huge number of - training samples. */ - COV_MAT_GENERIC=2, - COV_MAT_DEFAULT=COV_MAT_DIAGONAL - }; - - //! Default parameters - enum {DEFAULT_NCLUSTERS=5, DEFAULT_MAX_ITERS=100}; - - //! The initial step - enum {START_E_STEP=1, START_M_STEP=2, START_AUTO_STEP=0}; - - /** The number of mixture components in the Gaussian mixture model. - Default value of the parameter is EM::DEFAULT_NCLUSTERS=5. Some of %EM implementation could - determine the optimal number of mixtures within a specified value range, but that is not the - case in ML yet. */ - /** @see setClustersNumber */ - CV_WRAP virtual int getClustersNumber() const = 0; - /** @copybrief getClustersNumber @see getClustersNumber */ - CV_WRAP virtual void setClustersNumber(int val) = 0; - - /** Constraint on covariance matrices which defines type of matrices. - See EM::Types. */ - /** @see setCovarianceMatrixType */ - CV_WRAP virtual int getCovarianceMatrixType() const = 0; - /** @copybrief getCovarianceMatrixType @see getCovarianceMatrixType */ - CV_WRAP virtual void setCovarianceMatrixType(int val) = 0; - - /** The termination criteria of the %EM algorithm. - The %EM algorithm can be terminated by the number of iterations termCrit.maxCount (number of - M-steps) or when relative change of likelihood logarithm is less than termCrit.epsilon. Default - maximum number of iterations is EM::DEFAULT_MAX_ITERS=100. */ - /** @see setTermCriteria */ - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0; - - /** @brief Returns weights of the mixtures - - Returns vector with the number of elements equal to the number of mixtures. - */ - CV_WRAP virtual Mat getWeights() const = 0; - /** @brief Returns the cluster centers (means of the Gaussian mixture) - - Returns matrix with the number of rows equal to the number of mixtures and number of columns - equal to the space dimensionality. - */ - CV_WRAP virtual Mat getMeans() const = 0; - /** @brief Returns covariation matrices - - Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures, - each matrix is a square floating-point matrix NxN, where N is the space dimensionality. - */ - CV_WRAP virtual void getCovs(CV_OUT std::vector& covs) const = 0; - - /** @brief Returns posterior probabilities for the provided samples - - @param samples The input samples, floating-point matrix - @param results The optional output \f$ nSamples \times nClusters\f$ matrix of results. It contains - posterior probabilities for each sample from the input - @param flags This parameter will be ignored - */ - CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0; - - /** @brief Returns a likelihood logarithm value and an index of the most probable mixture component - for the given sample. - - @param sample A sample for classification. It should be a one-channel matrix of - \f$1 \times dims\f$ or \f$dims \times 1\f$ size. - @param probs Optional output matrix that contains posterior probabilities of each component - given the sample. It has \f$1 \times nclusters\f$ size and CV_64FC1 type. - - The method returns a two-element double vector. Zero element is a likelihood logarithm value for - the sample. First element is an index of the most probable mixture component for the given - sample. - */ - CV_WRAP virtual Vec2d predict2(InputArray sample, OutputArray probs) const = 0; - - /** @brief Estimate the Gaussian mixture parameters from a samples set. - - This variation starts with Expectation step. Initial values of the model parameters will be - estimated by the k-means algorithm. - - Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take - responses (class labels or function values) as input. Instead, it computes the *Maximum - Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the - parameters inside the structure: \f$p_{i,k}\f$ in probs, \f$a_k\f$ in means , \f$S_k\f$ in - covs[k], \f$\pi_k\f$ in weights , and optionally computes the output "class label" for each - sample: \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most - probable mixture component for each sample). - - The trained model can be used further for prediction, just like any other classifier. The - trained model is similar to the NormalBayesClassifier. - - @param samples Samples from which the Gaussian mixture model will be estimated. It should be a - one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type - it will be converted to the inner matrix of such type for the further computing. - @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for - each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. - @param labels The optional output "class label" for each sample: - \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable - mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. - @param probs The optional output matrix that contains posterior probabilities of each Gaussian - mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and - CV_64FC1 type. - */ - CV_WRAP virtual bool trainEM(InputArray samples, - OutputArray logLikelihoods=noArray(), - OutputArray labels=noArray(), - OutputArray probs=noArray()) = 0; - - /** @brief Estimate the Gaussian mixture parameters from a samples set. - - This variation starts with Expectation step. You need to provide initial means \f$a_k\f$ of - mixture components. Optionally you can pass initial weights \f$\pi_k\f$ and covariance matrices - \f$S_k\f$ of mixture components. - - @param samples Samples from which the Gaussian mixture model will be estimated. It should be a - one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type - it will be converted to the inner matrix of such type for the further computing. - @param means0 Initial means \f$a_k\f$ of mixture components. It is a one-channel matrix of - \f$nclusters \times dims\f$ size. If the matrix does not have CV_64F type it will be - converted to the inner matrix of such type for the further computing. - @param covs0 The vector of initial covariance matrices \f$S_k\f$ of mixture components. Each of - covariance matrices is a one-channel matrix of \f$dims \times dims\f$ size. If the matrices - do not have CV_64F type they will be converted to the inner matrices of such type for the - further computing. - @param weights0 Initial weights \f$\pi_k\f$ of mixture components. It should be a one-channel - floating-point matrix with \f$1 \times nclusters\f$ or \f$nclusters \times 1\f$ size. - @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for - each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. - @param labels The optional output "class label" for each sample: - \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable - mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. - @param probs The optional output matrix that contains posterior probabilities of each Gaussian - mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and - CV_64FC1 type. - */ - CV_WRAP virtual bool trainE(InputArray samples, InputArray means0, - InputArray covs0=noArray(), - InputArray weights0=noArray(), - OutputArray logLikelihoods=noArray(), - OutputArray labels=noArray(), - OutputArray probs=noArray()) = 0; - - /** @brief Estimate the Gaussian mixture parameters from a samples set. - - This variation starts with Maximization step. You need to provide initial probabilities - \f$p_{i,k}\f$ to use this option. - - @param samples Samples from which the Gaussian mixture model will be estimated. It should be a - one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type - it will be converted to the inner matrix of such type for the further computing. - @param probs0 - @param logLikelihoods The optional output matrix that contains a likelihood logarithm value for - each sample. It has \f$nsamples \times 1\f$ size and CV_64FC1 type. - @param labels The optional output "class label" for each sample: - \f$\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N\f$ (indices of the most probable - mixture component for each sample). It has \f$nsamples \times 1\f$ size and CV_32SC1 type. - @param probs The optional output matrix that contains posterior probabilities of each Gaussian - mixture component given the each sample. It has \f$nsamples \times nclusters\f$ size and - CV_64FC1 type. - */ - CV_WRAP virtual bool trainM(InputArray samples, InputArray probs0, - OutputArray logLikelihoods=noArray(), - OutputArray labels=noArray(), - OutputArray probs=noArray()) = 0; - - /** Creates empty %EM model. - The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you - can use one of the EM::train\* methods or load it from file using Algorithm::load\(filename). - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized EM from a file - * - * Use EM::save to serialize and store an EM to disk. - * Load the EM from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized EM - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - -/****************************************************************************************\ -* Decision Tree * -\****************************************************************************************/ - -/** @brief The class represents a single decision tree or a collection of decision trees. - -The current public interface of the class allows user to train only a single decision tree, however -the class is capable of storing multiple decision trees and using them for prediction (by summing -responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost) -use this capability to implement decision tree ensembles. - -@sa @ref ml_intro_trees -*/ -class CV_EXPORTS_W DTrees : public StatModel -{ -public: - /** Predict options */ - enum Flags { PREDICT_AUTO=0, PREDICT_SUM=(1<<8), PREDICT_MAX_VOTE=(2<<8), PREDICT_MASK=(3<<8) }; - - /** Cluster possible values of a categorical variable into K\<=maxCategories clusters to - find a suboptimal split. - If a discrete variable, on which the training procedure tries to make a split, takes more than - maxCategories values, the precise best subset estimation may take a very long time because the - algorithm is exponential. Instead, many decision trees engines (including our implementation) - try to find sub-optimal split in this case by clustering all the samples into maxCategories - clusters that is some categories are merged together. The clustering is applied only in n \> - 2-class classification problems for categorical variables with N \> max_categories possible - values. In case of regression and 2-class classification the optimal split can be found - efficiently without employing clustering, thus the parameter is not used in these cases. - Default value is 10.*/ - /** @see setMaxCategories */ - CV_WRAP virtual int getMaxCategories() const = 0; - /** @copybrief getMaxCategories @see getMaxCategories */ - CV_WRAP virtual void setMaxCategories(int val) = 0; - - /** The maximum possible depth of the tree. - That is the training algorithms attempts to split a node while its depth is less than maxDepth. - The root node has zero depth. The actual depth may be smaller if the other termination criteria - are met (see the outline of the training procedure @ref ml_intro_trees "here"), and/or if the - tree is pruned. Default value is INT_MAX.*/ - /** @see setMaxDepth */ - CV_WRAP virtual int getMaxDepth() const = 0; - /** @copybrief getMaxDepth @see getMaxDepth */ - CV_WRAP virtual void setMaxDepth(int val) = 0; - - /** If the number of samples in a node is less than this parameter then the node will not be split. - - Default value is 10.*/ - /** @see setMinSampleCount */ - CV_WRAP virtual int getMinSampleCount() const = 0; - /** @copybrief getMinSampleCount @see getMinSampleCount */ - CV_WRAP virtual void setMinSampleCount(int val) = 0; - - /** If CVFolds \> 1 then algorithms prunes the built decision tree using K-fold - cross-validation procedure where K is equal to CVFolds. - Default value is 10.*/ - /** @see setCVFolds */ - CV_WRAP virtual int getCVFolds() const = 0; - /** @copybrief getCVFolds @see getCVFolds */ - CV_WRAP virtual void setCVFolds(int val) = 0; - - /** If true then surrogate splits will be built. - These splits allow to work with missing data and compute variable importance correctly. - Default value is false. - @note currently it's not implemented.*/ - /** @see setUseSurrogates */ - CV_WRAP virtual bool getUseSurrogates() const = 0; - /** @copybrief getUseSurrogates @see getUseSurrogates */ - CV_WRAP virtual void setUseSurrogates(bool val) = 0; - - /** If true then a pruning will be harsher. - This will make a tree more compact and more resistant to the training data noise but a bit less - accurate. Default value is true.*/ - /** @see setUse1SERule */ - CV_WRAP virtual bool getUse1SERule() const = 0; - /** @copybrief getUse1SERule @see getUse1SERule */ - CV_WRAP virtual void setUse1SERule(bool val) = 0; - - /** If true then pruned branches are physically removed from the tree. - Otherwise they are retained and it is possible to get results from the original unpruned (or - pruned less aggressively) tree. Default value is true.*/ - /** @see setTruncatePrunedTree */ - CV_WRAP virtual bool getTruncatePrunedTree() const = 0; - /** @copybrief getTruncatePrunedTree @see getTruncatePrunedTree */ - CV_WRAP virtual void setTruncatePrunedTree(bool val) = 0; - - /** Termination criteria for regression trees. - If all absolute differences between an estimated value in a node and values of train samples - in this node are less than this parameter then the node will not be split further. Default - value is 0.01f*/ - /** @see setRegressionAccuracy */ - CV_WRAP virtual float getRegressionAccuracy() const = 0; - /** @copybrief getRegressionAccuracy @see getRegressionAccuracy */ - CV_WRAP virtual void setRegressionAccuracy(float val) = 0; - - /** @brief The array of a priori class probabilities, sorted by the class label value. - - The parameter can be used to tune the decision tree preferences toward a certain class. For - example, if you want to detect some rare anomaly occurrence, the training base will likely - contain much more normal cases than anomalies, so a very good classification performance - will be achieved just by considering every case as normal. To avoid this, the priors can be - specified, where the anomaly probability is artificially increased (up to 0.5 or even - greater), so the weight of the misclassified anomalies becomes much bigger, and the tree is - adjusted properly. - - You can also think about this parameter as weights of prediction categories which determine - relative weights that you give to misclassification. That is, if the weight of the first - category is 1 and the weight of the second category is 10, then each mistake in predicting - the second category is equivalent to making 10 mistakes in predicting the first category. - Default value is empty Mat.*/ - /** @see setPriors */ - CV_WRAP virtual cv::Mat getPriors() const = 0; - /** @copybrief getPriors @see getPriors */ - CV_WRAP virtual void setPriors(const cv::Mat &val) = 0; - - /** @brief The class represents a decision tree node. - */ - class CV_EXPORTS Node - { - public: - Node(); - double value; //!< Value at the node: a class label in case of classification or estimated - //!< function value in case of regression. - int classIdx; //!< Class index normalized to 0..class_count-1 range and assigned to the - //!< node. It is used internally in classification trees and tree ensembles. - int parent; //!< Index of the parent node - int left; //!< Index of the left child node - int right; //!< Index of right child node - int defaultDir; //!< Default direction where to go (-1: left or +1: right). It helps in the - //!< case of missing values. - int split; //!< Index of the first split - }; - - /** @brief The class represents split in a decision tree. - */ - class CV_EXPORTS Split - { - public: - Split(); - int varIdx; //!< Index of variable on which the split is created. - bool inversed; //!< If true, then the inverse split rule is used (i.e. left and right - //!< branches are exchanged in the rule expressions below). - float quality; //!< The split quality, a positive number. It is used to choose the best split. - int next; //!< Index of the next split in the list of splits for the node - float c; /**< The threshold value in case of split on an ordered variable. - The rule is: - @code{.none} - if var_value < c - then next_node <- left - else next_node <- right - @endcode */ - int subsetOfs; /**< Offset of the bitset used by the split on a categorical variable. - The rule is: - @code{.none} - if bitset[var_value] == 1 - then next_node <- left - else next_node <- right - @endcode */ - }; - - /** @brief Returns indices of root nodes - */ - virtual const std::vector& getRoots() const = 0; - /** @brief Returns all the nodes - - all the node indices are indices in the returned vector - */ - virtual const std::vector& getNodes() const = 0; - /** @brief Returns all the splits - - all the split indices are indices in the returned vector - */ - virtual const std::vector& getSplits() const = 0; - /** @brief Returns all the bitsets for categorical splits - - Split::subsetOfs is an offset in the returned vector - */ - virtual const std::vector& getSubsets() const = 0; - - /** @brief Creates the empty model - - The static method creates empty decision tree with the specified parameters. It should be then - trained using train method (see StatModel::train). Alternatively, you can load the model from - file using Algorithm::load\(filename). - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized DTrees from a file - * - * Use DTree::save to serialize and store an DTree to disk. - * Load the DTree from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized DTree - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - -/****************************************************************************************\ -* Random Trees Classifier * -\****************************************************************************************/ - -/** @brief The class implements the random forest predictor. - -@sa @ref ml_intro_rtrees - */ -class CV_EXPORTS_W RTrees : public DTrees -{ -public: - - /** If true then variable importance will be calculated and then it can be retrieved by RTrees::getVarImportance. - Default value is false.*/ - /** @see setCalculateVarImportance */ - CV_WRAP virtual bool getCalculateVarImportance() const = 0; - /** @copybrief getCalculateVarImportance @see getCalculateVarImportance */ - CV_WRAP virtual void setCalculateVarImportance(bool val) = 0; - - /** The size of the randomly selected subset of features at each tree node and that are used - to find the best split(s). - If you set it to 0 then the size will be set to the square root of the total number of - features. Default value is 0.*/ - /** @see setActiveVarCount */ - CV_WRAP virtual int getActiveVarCount() const = 0; - /** @copybrief getActiveVarCount @see getActiveVarCount */ - CV_WRAP virtual void setActiveVarCount(int val) = 0; - - /** The termination criteria that specifies when the training algorithm stops. - Either when the specified number of trees is trained and added to the ensemble or when - sufficient accuracy (measured as OOB error) is achieved. Typically the more trees you have the - better the accuracy. However, the improvement in accuracy generally diminishes and asymptotes - pass a certain number of trees. Also to keep in mind, the number of tree increases the - prediction time linearly. Default value is TermCriteria(TermCriteria::MAX_ITERS + - TermCriteria::EPS, 50, 0.1)*/ - /** @see setTermCriteria */ - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(const TermCriteria &val) = 0; - - /** Returns the variable importance array. - The method returns the variable importance vector, computed at the training stage when - CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is - returned. - */ - CV_WRAP virtual Mat getVarImportance() const = 0; - - /** Returns the result of each individual tree in the forest. - In case the model is a regression problem, the method will return each of the trees' - results for each of the sample cases. If the model is a classifier, it will return - a Mat with samples + 1 rows, where the first row gives the class number and the - following rows return the votes each class had for each sample. - @param samples Array containing the samples for which votes will be calculated. - @param results Array where the result of the calculation will be written. - @param flags Flags for defining the type of RTrees. - */ - CV_WRAP void getVotes(InputArray samples, OutputArray results, int flags) const; - - /** Creates the empty model. - Use StatModel::train to train the model, StatModel::train to create and train the model, - Algorithm::load to load the pre-trained model. - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized RTree from a file - * - * Use RTree::save to serialize and store an RTree to disk. - * Load the RTree from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized RTree - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - -/****************************************************************************************\ -* Boosted tree classifier * -\****************************************************************************************/ - -/** @brief Boosted tree classifier derived from DTrees - -@sa @ref ml_intro_boost - */ -class CV_EXPORTS_W Boost : public DTrees -{ -public: - /** Type of the boosting algorithm. - See Boost::Types. Default value is Boost::REAL. */ - /** @see setBoostType */ - CV_WRAP virtual int getBoostType() const = 0; - /** @copybrief getBoostType @see getBoostType */ - CV_WRAP virtual void setBoostType(int val) = 0; - - /** The number of weak classifiers. - Default value is 100. */ - /** @see setWeakCount */ - CV_WRAP virtual int getWeakCount() const = 0; - /** @copybrief getWeakCount @see getWeakCount */ - CV_WRAP virtual void setWeakCount(int val) = 0; - - /** A threshold between 0 and 1 used to save computational time. - Samples with summary weight \f$\leq 1 - weight_trim_rate\f$ do not participate in the *next* - iteration of training. Set this parameter to 0 to turn off this functionality. Default value is 0.95.*/ - /** @see setWeightTrimRate */ - CV_WRAP virtual double getWeightTrimRate() const = 0; - /** @copybrief getWeightTrimRate @see getWeightTrimRate */ - CV_WRAP virtual void setWeightTrimRate(double val) = 0; - - /** Boosting type. - Gentle AdaBoost and Real AdaBoost are often the preferable choices. */ - enum Types { - DISCRETE=0, //!< Discrete AdaBoost. - REAL=1, //!< Real AdaBoost. It is a technique that utilizes confidence-rated predictions - //!< and works well with categorical data. - LOGIT=2, //!< LogitBoost. It can produce good regression fits. - GENTLE=3 //!< Gentle AdaBoost. It puts less weight on outlier data points and for that - //!(filename) to load the pre-trained model. */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized Boost from a file - * - * Use Boost::save to serialize and store an RTree to disk. - * Load the Boost from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized Boost - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - -/****************************************************************************************\ -* Gradient Boosted Trees * -\****************************************************************************************/ - -/*class CV_EXPORTS_W GBTrees : public DTrees -{ -public: - struct CV_EXPORTS_W_MAP Params : public DTrees::Params - { - CV_PROP_RW int weakCount; - CV_PROP_RW int lossFunctionType; - CV_PROP_RW float subsamplePortion; - CV_PROP_RW float shrinkage; - - Params(); - Params( int lossFunctionType, int weakCount, float shrinkage, - float subsamplePortion, int maxDepth, bool useSurrogates ); - }; - - enum {SQUARED_LOSS=0, ABSOLUTE_LOSS, HUBER_LOSS=3, DEVIANCE_LOSS}; - - virtual void setK(int k) = 0; - - virtual float predictSerial( InputArray samples, - OutputArray weakResponses, int flags) const = 0; - - static Ptr create(const Params& p); -};*/ - -/****************************************************************************************\ -* Artificial Neural Networks (ANN) * -\****************************************************************************************/ - -/////////////////////////////////// Multi-Layer Perceptrons ////////////////////////////// - -/** @brief Artificial Neural Networks - Multi-Layer Perceptrons. - -Unlike many other models in ML that are constructed and trained at once, in the MLP model these -steps are separated. First, a network with the specified topology is created using the non-default -constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is -trained using a set of input and output vectors. The training procedure can be repeated more than -once, that is, the weights can be adjusted based on the new training data. - -Additional flags for StatModel::train are available: ANN_MLP::TrainFlags. - -@sa @ref ml_intro_ann - */ -class CV_EXPORTS_W ANN_MLP : public StatModel -{ -public: - /** Available training methods */ - enum TrainingMethods { - BACKPROP=0, //!< The back-propagation algorithm. - RPROP = 1, //!< The RPROP algorithm. See @cite RPROP93 for details. - ANNEAL = 2 //!< The simulated annealing algorithm. See @cite Kirkpatrick83 for details. - }; - - /** Sets training method and common parameters. - @param method Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods. - @param param1 passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROP and to initialT for ANN_MLP::ANNEAL. - @param param2 passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP and to finalT for ANN_MLP::ANNEAL. - */ - CV_WRAP virtual void setTrainMethod(int method, double param1 = 0, double param2 = 0) = 0; - - /** Returns current training method */ - CV_WRAP virtual int getTrainMethod() const = 0; - - /** Initialize the activation function for each neuron. - Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM. - @param type The type of activation function. See ANN_MLP::ActivationFunctions. - @param param1 The first parameter of the activation function, \f$\alpha\f$. Default value is 0. - @param param2 The second parameter of the activation function, \f$\beta\f$. Default value is 0. - */ - CV_WRAP virtual void setActivationFunction(int type, double param1 = 0, double param2 = 0) = 0; - - /** Integer vector specifying the number of neurons in each layer including the input and output layers. - The very first element specifies the number of elements in the input layer. - The last element - number of elements in the output layer. Default value is empty Mat. - @sa getLayerSizes */ - CV_WRAP virtual void setLayerSizes(InputArray _layer_sizes) = 0; - - /** Integer vector specifying the number of neurons in each layer including the input and output layers. - The very first element specifies the number of elements in the input layer. - The last element - number of elements in the output layer. - @sa setLayerSizes */ - CV_WRAP virtual cv::Mat getLayerSizes() const = 0; - - /** Termination criteria of the training algorithm. - You can specify the maximum number of iterations (maxCount) and/or how much the error could - change between the iterations to make the algorithm continue (epsilon). Default value is - TermCriteria(TermCriteria::MAX_ITER + TermCriteria::EPS, 1000, 0.01).*/ - /** @see setTermCriteria */ - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0; - - /** BPROP: Strength of the weight gradient term. - The recommended value is about 0.1. Default value is 0.1.*/ - /** @see setBackpropWeightScale */ - CV_WRAP virtual double getBackpropWeightScale() const = 0; - /** @copybrief getBackpropWeightScale @see getBackpropWeightScale */ - CV_WRAP virtual void setBackpropWeightScale(double val) = 0; - - /** BPROP: Strength of the momentum term (the difference between weights on the 2 previous iterations). - This parameter provides some inertia to smooth the random fluctuations of the weights. It can - vary from 0 (the feature is disabled) to 1 and beyond. The value 0.1 or so is good enough. - Default value is 0.1.*/ - /** @see setBackpropMomentumScale */ - CV_WRAP virtual double getBackpropMomentumScale() const = 0; - /** @copybrief getBackpropMomentumScale @see getBackpropMomentumScale */ - CV_WRAP virtual void setBackpropMomentumScale(double val) = 0; - - /** RPROP: Initial value \f$\Delta_0\f$ of update-values \f$\Delta_{ij}\f$. - Default value is 0.1.*/ - /** @see setRpropDW0 */ - CV_WRAP virtual double getRpropDW0() const = 0; - /** @copybrief getRpropDW0 @see getRpropDW0 */ - CV_WRAP virtual void setRpropDW0(double val) = 0; - - /** RPROP: Increase factor \f$\eta^+\f$. - It must be \>1. Default value is 1.2.*/ - /** @see setRpropDWPlus */ - CV_WRAP virtual double getRpropDWPlus() const = 0; - /** @copybrief getRpropDWPlus @see getRpropDWPlus */ - CV_WRAP virtual void setRpropDWPlus(double val) = 0; - - /** RPROP: Decrease factor \f$\eta^-\f$. - It must be \<1. Default value is 0.5.*/ - /** @see setRpropDWMinus */ - CV_WRAP virtual double getRpropDWMinus() const = 0; - /** @copybrief getRpropDWMinus @see getRpropDWMinus */ - CV_WRAP virtual void setRpropDWMinus(double val) = 0; - - /** RPROP: Update-values lower limit \f$\Delta_{min}\f$. - It must be positive. Default value is FLT_EPSILON.*/ - /** @see setRpropDWMin */ - CV_WRAP virtual double getRpropDWMin() const = 0; - /** @copybrief getRpropDWMin @see getRpropDWMin */ - CV_WRAP virtual void setRpropDWMin(double val) = 0; - - /** RPROP: Update-values upper limit \f$\Delta_{max}\f$. - It must be \>1. Default value is 50.*/ - /** @see setRpropDWMax */ - CV_WRAP virtual double getRpropDWMax() const = 0; - /** @copybrief getRpropDWMax @see getRpropDWMax */ - CV_WRAP virtual void setRpropDWMax(double val) = 0; - - /** ANNEAL: Update initial temperature. - It must be \>=0. Default value is 10.*/ - /** @see setAnnealInitialT */ - CV_WRAP double getAnnealInitialT() const; - /** @copybrief getAnnealInitialT @see getAnnealInitialT */ - CV_WRAP void setAnnealInitialT(double val); - - /** ANNEAL: Update final temperature. - It must be \>=0 and less than initialT. Default value is 0.1.*/ - /** @see setAnnealFinalT */ - CV_WRAP double getAnnealFinalT() const; - /** @copybrief getAnnealFinalT @see getAnnealFinalT */ - CV_WRAP void setAnnealFinalT(double val); - - /** ANNEAL: Update cooling ratio. - It must be \>0 and less than 1. Default value is 0.95.*/ - /** @see setAnnealCoolingRatio */ - CV_WRAP double getAnnealCoolingRatio() const; - /** @copybrief getAnnealCoolingRatio @see getAnnealCoolingRatio */ - CV_WRAP void setAnnealCoolingRatio(double val); - - /** ANNEAL: Update iteration per step. - It must be \>0 . Default value is 10.*/ - /** @see setAnnealItePerStep */ - CV_WRAP int getAnnealItePerStep() const; - /** @copybrief getAnnealItePerStep @see getAnnealItePerStep */ - CV_WRAP void setAnnealItePerStep(int val); - - /** @brief Set/initialize anneal RNG */ - void setAnnealEnergyRNG(const RNG& rng); - - /** possible activation functions */ - enum ActivationFunctions { - /** Identity function: \f$f(x)=x\f$ */ - IDENTITY = 0, - /** Symmetrical sigmoid: \f$f(x)=\beta*(1-e^{-\alpha x})/(1+e^{-\alpha x})\f$ - @note - If you are using the default sigmoid activation function with the default parameter values - fparam1=0 and fparam2=0 then the function used is y = 1.7159\*tanh(2/3 \* x), so the output - will range from [-1.7159, 1.7159], instead of [0,1].*/ - SIGMOID_SYM = 1, - /** Gaussian function: \f$f(x)=\beta e^{-\alpha x*x}\f$ */ - GAUSSIAN = 2, - /** ReLU function: \f$f(x)=max(0,x)\f$ */ - RELU = 3, - /** Leaky ReLU function: for x>0 \f$f(x)=x \f$ and x<=0 \f$f(x)=\alpha x \f$*/ - LEAKYRELU= 4 - }; - - /** Train options */ - enum TrainFlags { - /** Update the network weights, rather than compute them from scratch. In the latter case - the weights are initialized using the Nguyen-Widrow algorithm. */ - UPDATE_WEIGHTS = 1, - /** Do not normalize the input vectors. If this flag is not set, the training algorithm - normalizes each input feature independently, shifting its mean value to 0 and making the - standard deviation equal to 1. If the network is assumed to be updated frequently, the new - training data could be much different from original one. In this case, you should take care - of proper normalization. */ - NO_INPUT_SCALE = 2, - /** Do not normalize the output vectors. If the flag is not set, the training algorithm - normalizes each output feature independently, by transforming it to the certain range - depending on the used activation function. */ - NO_OUTPUT_SCALE = 4 - }; - - CV_WRAP virtual Mat getWeights(int layerIdx) const = 0; - - /** @brief Creates empty model - - Use StatModel::train to train the model, Algorithm::load\(filename) to load the pre-trained model. - Note that the train method has optional flags: ANN_MLP::TrainFlags. - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized ANN from a file - * - * Use ANN::save to serialize and store an ANN to disk. - * Load the ANN from this file again, by calling this function with the path to the file. - * - * @param filepath path to serialized ANN - */ - CV_WRAP static Ptr load(const String& filepath); - -}; - -/****************************************************************************************\ -* Logistic Regression * -\****************************************************************************************/ - -/** @brief Implements Logistic Regression classifier. - -@sa @ref ml_intro_lr - */ -class CV_EXPORTS_W LogisticRegression : public StatModel -{ -public: - - /** Learning rate. */ - /** @see setLearningRate */ - CV_WRAP virtual double getLearningRate() const = 0; - /** @copybrief getLearningRate @see getLearningRate */ - CV_WRAP virtual void setLearningRate(double val) = 0; - - /** Number of iterations. */ - /** @see setIterations */ - CV_WRAP virtual int getIterations() const = 0; - /** @copybrief getIterations @see getIterations */ - CV_WRAP virtual void setIterations(int val) = 0; - - /** Kind of regularization to be applied. See LogisticRegression::RegKinds. */ - /** @see setRegularization */ - CV_WRAP virtual int getRegularization() const = 0; - /** @copybrief getRegularization @see getRegularization */ - CV_WRAP virtual void setRegularization(int val) = 0; - - /** Kind of training method used. See LogisticRegression::Methods. */ - /** @see setTrainMethod */ - CV_WRAP virtual int getTrainMethod() const = 0; - /** @copybrief getTrainMethod @see getTrainMethod */ - CV_WRAP virtual void setTrainMethod(int val) = 0; - - /** Specifies the number of training samples taken in each step of Mini-Batch Gradient - Descent. Will only be used if using LogisticRegression::MINI_BATCH training algorithm. It - has to take values less than the total number of training samples. */ - /** @see setMiniBatchSize */ - CV_WRAP virtual int getMiniBatchSize() const = 0; - /** @copybrief getMiniBatchSize @see getMiniBatchSize */ - CV_WRAP virtual void setMiniBatchSize(int val) = 0; - - /** Termination criteria of the algorithm. */ - /** @see setTermCriteria */ - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(TermCriteria val) = 0; - - //! Regularization kinds - enum RegKinds { - REG_DISABLE = -1, //!< Regularization disabled - REG_L1 = 0, //!< %L1 norm - REG_L2 = 1 //!< %L2 norm - }; - - //! Training methods - enum Methods { - BATCH = 0, - MINI_BATCH = 1 //!< Set MiniBatchSize to a positive integer when using this method. - }; - - /** @brief Predicts responses for input samples and returns a float type. - - @param samples The input data for the prediction algorithm. Matrix [m x n], where each row - contains variables (features) of one object being classified. Should have data type CV_32F. - @param results Predicted labels as a column matrix of type CV_32S. - @param flags Not used. - */ - CV_WRAP virtual float predict( InputArray samples, OutputArray results=noArray(), int flags=0 ) const CV_OVERRIDE = 0; - - /** @brief This function returns the trained parameters arranged across rows. - - For a two class classifcation problem, it returns a row matrix. It returns learnt parameters of - the Logistic Regression as a matrix of type CV_32F. - */ - CV_WRAP virtual Mat get_learnt_thetas() const = 0; - - /** @brief Creates empty model. - - Creates Logistic Regression model with parameters given. - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized LogisticRegression from a file - * - * Use LogisticRegression::save to serialize and store an LogisticRegression to disk. - * Load the LogisticRegression from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized LogisticRegression - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); -}; - - -/****************************************************************************************\ -* Stochastic Gradient Descent SVM Classifier * -\****************************************************************************************/ - -/*! -@brief Stochastic Gradient Descent SVM classifier - -SVMSGD provides a fast and easy-to-use implementation of the SVM classifier using the Stochastic Gradient Descent approach, -as presented in @cite bottou2010large. - -The classifier has following parameters: -- model type, -- margin type, -- margin regularization (\f$\lambda\f$), -- initial step size (\f$\gamma_0\f$), -- step decreasing power (\f$c\f$), -- and termination criteria. - -The model type may have one of the following values: \ref SGD and \ref ASGD. - -- \ref SGD is the classic version of SVMSGD classifier: every next step is calculated by the formula - \f[w_{t+1} = w_t - \gamma(t) \frac{dQ_i}{dw} |_{w = w_t}\f] - where - - \f$w_t\f$ is the weights vector for decision function at step \f$t\f$, - - \f$\gamma(t)\f$ is the step size of model parameters at the iteration \f$t\f$, it is decreased on each step by the formula - \f$\gamma(t) = \gamma_0 (1 + \lambda \gamma_0 t) ^ {-c}\f$ - - \f$Q_i\f$ is the target functional from SVM task for sample with number \f$i\f$, this sample is chosen stochastically on each step of the algorithm. - -- \ref ASGD is Average Stochastic Gradient Descent SVM Classifier. ASGD classifier averages weights vector on each step of algorithm by the formula -\f$\widehat{w}_{t+1} = \frac{t}{1+t}\widehat{w}_{t} + \frac{1}{1+t}w_{t+1}\f$ - -The recommended model type is ASGD (following @cite bottou2010large). - -The margin type may have one of the following values: \ref SOFT_MARGIN or \ref HARD_MARGIN. - -- You should use \ref HARD_MARGIN type, if you have linearly separable sets. -- You should use \ref SOFT_MARGIN type, if you have non-linearly separable sets or sets with outliers. -- In the general case (if you know nothing about linear separability of your sets), use SOFT_MARGIN. - -The other parameters may be described as follows: -- Margin regularization parameter is responsible for weights decreasing at each step and for the strength of restrictions on outliers - (the less the parameter, the less probability that an outlier will be ignored). - Recommended value for SGD model is 0.0001, for ASGD model is 0.00001. - -- Initial step size parameter is the initial value for the step size \f$\gamma(t)\f$. - You will have to find the best initial step for your problem. - -- Step decreasing power is the power parameter for \f$\gamma(t)\f$ decreasing by the formula, mentioned above. - Recommended value for SGD model is 1, for ASGD model is 0.75. - -- Termination criteria can be TermCriteria::COUNT, TermCriteria::EPS or TermCriteria::COUNT + TermCriteria::EPS. - You will have to find the best termination criteria for your problem. - -Note that the parameters margin regularization, initial step size, and step decreasing power should be positive. - -To use SVMSGD algorithm do as follows: - -- first, create the SVMSGD object. The algoorithm will set optimal parameters by default, but you can set your own parameters via functions setSvmsgdType(), - setMarginType(), setMarginRegularization(), setInitialStepSize(), and setStepDecreasingPower(). - -- then the SVM model can be trained using the train features and the correspondent labels by the method train(). - -- after that, the label of a new feature vector can be predicted using the method predict(). - -@code -// Create empty object -cv::Ptr svmsgd = SVMSGD::create(); - -// Train the Stochastic Gradient Descent SVM -svmsgd->train(trainData); - -// Predict labels for the new samples -svmsgd->predict(samples, responses); -@endcode - -*/ - -class CV_EXPORTS_W SVMSGD : public cv::ml::StatModel -{ -public: - - /** SVMSGD type. - ASGD is often the preferable choice. */ - enum SvmsgdType - { - SGD, //!< Stochastic Gradient Descent - ASGD //!< Average Stochastic Gradient Descent - }; - - /** Margin type.*/ - enum MarginType - { - SOFT_MARGIN, //!< General case, suits to the case of non-linearly separable sets, allows outliers. - HARD_MARGIN //!< More accurate for the case of linearly separable sets. - }; - - /** - * @return the weights of the trained model (decision function f(x) = weights * x + shift). - */ - CV_WRAP virtual Mat getWeights() = 0; - - /** - * @return the shift of the trained model (decision function f(x) = weights * x + shift). - */ - CV_WRAP virtual float getShift() = 0; - - /** @brief Creates empty model. - * Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to - * find the best parameters for your problem or use setOptimalParameters() to set some default parameters. - */ - CV_WRAP static Ptr create(); - - /** @brief Loads and creates a serialized SVMSGD from a file - * - * Use SVMSGD::save to serialize and store an SVMSGD to disk. - * Load the SVMSGD from this file again, by calling this function with the path to the file. - * Optionally specify the node for the file containing the classifier - * - * @param filepath path to serialized SVMSGD - * @param nodeName name of node containing the classifier - */ - CV_WRAP static Ptr load(const String& filepath , const String& nodeName = String()); - - /** @brief Function sets optimal parameters values for chosen SVM SGD model. - * @param svmsgdType is the type of SVMSGD classifier. - * @param marginType is the type of margin constraint. - */ - CV_WRAP virtual void setOptimalParameters(int svmsgdType = SVMSGD::ASGD, int marginType = SVMSGD::SOFT_MARGIN) = 0; - - /** @brief %Algorithm type, one of SVMSGD::SvmsgdType. */ - /** @see setSvmsgdType */ - CV_WRAP virtual int getSvmsgdType() const = 0; - /** @copybrief getSvmsgdType @see getSvmsgdType */ - CV_WRAP virtual void setSvmsgdType(int svmsgdType) = 0; - - /** @brief %Margin type, one of SVMSGD::MarginType. */ - /** @see setMarginType */ - CV_WRAP virtual int getMarginType() const = 0; - /** @copybrief getMarginType @see getMarginType */ - CV_WRAP virtual void setMarginType(int marginType) = 0; - - /** @brief Parameter marginRegularization of a %SVMSGD optimization problem. */ - /** @see setMarginRegularization */ - CV_WRAP virtual float getMarginRegularization() const = 0; - /** @copybrief getMarginRegularization @see getMarginRegularization */ - CV_WRAP virtual void setMarginRegularization(float marginRegularization) = 0; - - /** @brief Parameter initialStepSize of a %SVMSGD optimization problem. */ - /** @see setInitialStepSize */ - CV_WRAP virtual float getInitialStepSize() const = 0; - /** @copybrief getInitialStepSize @see getInitialStepSize */ - CV_WRAP virtual void setInitialStepSize(float InitialStepSize) = 0; - - /** @brief Parameter stepDecreasingPower of a %SVMSGD optimization problem. */ - /** @see setStepDecreasingPower */ - CV_WRAP virtual float getStepDecreasingPower() const = 0; - /** @copybrief getStepDecreasingPower @see getStepDecreasingPower */ - CV_WRAP virtual void setStepDecreasingPower(float stepDecreasingPower) = 0; - - /** @brief Termination criteria of the training algorithm. - You can specify the maximum number of iterations (maxCount) and/or how much the error could - change between the iterations to make the algorithm continue (epsilon).*/ - /** @see setTermCriteria */ - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - /** @copybrief getTermCriteria @see getTermCriteria */ - CV_WRAP virtual void setTermCriteria(const cv::TermCriteria &val) = 0; -}; - - -/****************************************************************************************\ -* Auxiliary functions declarations * -\****************************************************************************************/ - -/** @brief Generates _sample_ from multivariate normal distribution - -@param mean an average row vector -@param cov symmetric covariation matrix -@param nsamples returned samples count -@param samples returned samples array -*/ -CV_EXPORTS void randMVNormal( InputArray mean, InputArray cov, int nsamples, OutputArray samples); - -/** @brief Creates test set */ -CV_EXPORTS void createConcentricSpheresTestSet( int nsamples, int nfeatures, int nclasses, - OutputArray samples, OutputArray responses); - -/** @brief Artificial Neural Networks - Multi-Layer Perceptrons. - -@sa @ref ml_intro_ann -*/ -class CV_EXPORTS_W ANN_MLP_ANNEAL : public ANN_MLP -{ -public: - /** @see setAnnealInitialT */ - CV_WRAP virtual double getAnnealInitialT() const = 0; - /** @copybrief getAnnealInitialT @see getAnnealInitialT */ - CV_WRAP virtual void setAnnealInitialT(double val) = 0; - - /** ANNEAL: Update final temperature. - It must be \>=0 and less than initialT. Default value is 0.1.*/ - /** @see setAnnealFinalT */ - CV_WRAP virtual double getAnnealFinalT() const = 0; - /** @copybrief getAnnealFinalT @see getAnnealFinalT */ - CV_WRAP virtual void setAnnealFinalT(double val) = 0; - - /** ANNEAL: Update cooling ratio. - It must be \>0 and less than 1. Default value is 0.95.*/ - /** @see setAnnealCoolingRatio */ - CV_WRAP virtual double getAnnealCoolingRatio() const = 0; - /** @copybrief getAnnealCoolingRatio @see getAnnealCoolingRatio */ - CV_WRAP virtual void setAnnealCoolingRatio(double val) = 0; - - /** ANNEAL: Update iteration per step. - It must be \>0 . Default value is 10.*/ - /** @see setAnnealItePerStep */ - CV_WRAP virtual int getAnnealItePerStep() const = 0; - /** @copybrief getAnnealItePerStep @see getAnnealItePerStep */ - CV_WRAP virtual void setAnnealItePerStep(int val) = 0; - - /** @brief Set/initialize anneal RNG */ - virtual void setAnnealEnergyRNG(const RNG& rng) = 0; -}; - - -/****************************************************************************************\ -* Simulated annealing solver * -\****************************************************************************************/ - -#ifdef CV_DOXYGEN -/** @brief This class declares example interface for system state used in simulated annealing optimization algorithm. - -@note This class is not defined in C++ code and can't be use directly - you need your own implementation with the same methods. -*/ -struct SimulatedAnnealingSolverSystem -{ - /** Give energy value for a state of system.*/ - double energy() const; - /** Function which change the state of system (random perturbation).*/ - void changeState(); - /** Function to reverse to the previous state. Can be called once only after changeState(). */ - void reverseState(); -}; -#endif // CV_DOXYGEN - -/** @brief The class implements simulated annealing for optimization. - -@cite Kirkpatrick83 for details - -@param solverSystem optimization system (see SimulatedAnnealingSolverSystem) -@param initialTemperature initial temperature -@param finalTemperature final temperature -@param coolingRatio temperature step multiplies -@param iterationsPerStep number of iterations per temperature changing step -@param lastTemperature optional output for last used temperature -@param rngEnergy specify custom random numbers generator (cv::theRNG() by default) -*/ -template -int simulatedAnnealingSolver(SimulatedAnnealingSolverSystem& solverSystem, - double initialTemperature, double finalTemperature, double coolingRatio, - size_t iterationsPerStep, - CV_OUT double* lastTemperature = NULL, - cv::RNG& rngEnergy = cv::theRNG() -); - -//! @} ml - -} -} - -#include - -#endif // __cplusplus -#endif // OPENCV_ML_HPP - -/* End of file. */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/ml/ml.inl.hpp b/qt-correction-tool/pub/opencv/include/opencv2/ml/ml.inl.hpp deleted file mode 100644 index dc9c783..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/ml/ml.inl.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. - -#ifndef OPENCV_ML_INL_HPP -#define OPENCV_ML_INL_HPP - -namespace cv { namespace ml { - -// declared in ml.hpp -template -int simulatedAnnealingSolver(SimulatedAnnealingSolverSystem& solverSystem, - double initialTemperature, double finalTemperature, double coolingRatio, - size_t iterationsPerStep, - CV_OUT double* lastTemperature, - cv::RNG& rngEnergy -) -{ - CV_Assert(finalTemperature > 0); - CV_Assert(initialTemperature > finalTemperature); - CV_Assert(iterationsPerStep > 0); - CV_Assert(coolingRatio < 1.0f); - double Ti = initialTemperature; - double previousEnergy = solverSystem.energy(); - int exchange = 0; - while (Ti > finalTemperature) - { - for (size_t i = 0; i < iterationsPerStep; i++) - { - solverSystem.changeState(); - double newEnergy = solverSystem.energy(); - if (newEnergy < previousEnergy) - { - previousEnergy = newEnergy; - exchange++; - } - else - { - double r = rngEnergy.uniform(0.0, 1.0); - if (r < std::exp(-(newEnergy - previousEnergy) / Ti)) - { - previousEnergy = newEnergy; - exchange++; - } - else - { - solverSystem.reverseState(); - } - } - } - Ti *= coolingRatio; - } - if (lastTemperature) - *lastTemperature = Ti; - return exchange; -} - -}} //namespace - -#endif // OPENCV_ML_INL_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/objdetect.hpp b/qt-correction-tool/pub/opencv/include/opencv2/objdetect.hpp deleted file mode 100644 index cc9c4e1..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/objdetect.hpp +++ /dev/null @@ -1,743 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OBJDETECT_HPP -#define OPENCV_OBJDETECT_HPP - -#include "opencv2/core.hpp" - -/** -@defgroup objdetect Object Detection - -Haar Feature-based Cascade Classifier for Object Detection ----------------------------------------------------------- - -The object detector described below has been initially proposed by Paul Viola @cite Viola01 and -improved by Rainer Lienhart @cite Lienhart02 . - -First, a classifier (namely a *cascade of boosted classifiers working with haar-like features*) is -trained with a few hundred sample views of a particular object (i.e., a face or a car), called -positive examples, that are scaled to the same size (say, 20x20), and negative examples - arbitrary -images of the same size. - -After a classifier is trained, it can be applied to a region of interest (of the same size as used -during the training) in an input image. The classifier outputs a "1" if the region is likely to show -the object (i.e., face/car), and "0" otherwise. To search for the object in the whole image one can -move the search window across the image and check every location using the classifier. The -classifier is designed so that it can be easily "resized" in order to be able to find the objects of -interest at different sizes, which is more efficient than resizing the image itself. So, to find an -object of an unknown size in the image the scan procedure should be done several times at different -scales. - -The word "cascade" in the classifier name means that the resultant classifier consists of several -simpler classifiers (*stages*) that are applied subsequently to a region of interest until at some -stage the candidate is rejected or all the stages are passed. The word "boosted" means that the -classifiers at every stage of the cascade are complex themselves and they are built out of basic -classifiers using one of four different boosting techniques (weighted voting). Currently Discrete -Adaboost, Real Adaboost, Gentle Adaboost and Logitboost are supported. The basic classifiers are -decision-tree classifiers with at least 2 leaves. Haar-like features are the input to the basic -classifiers, and are calculated as described below. The current algorithm uses the following -Haar-like features: - -![image](pics/haarfeatures.png) - -The feature used in a particular classifier is specified by its shape (1a, 2b etc.), position within -the region of interest and the scale (this scale is not the same as the scale used at the detection -stage, though these two scales are multiplied). For example, in the case of the third line feature -(2c) the response is calculated as the difference between the sum of image pixels under the -rectangle covering the whole feature (including the two white stripes and the black stripe in the -middle) and the sum of the image pixels under the black stripe multiplied by 3 in order to -compensate for the differences in the size of areas. The sums of pixel values over a rectangular -regions are calculated rapidly using integral images (see below and the integral description). - -To see the object detector at work, have a look at the facedetect demo: - - -The following reference is for the detection part only. There is a separate application called -opencv_traincascade that can train a cascade of boosted classifiers from a set of samples. - -@note In the new C++ interface it is also possible to use LBP (local binary pattern) features in -addition to Haar-like features. .. [Viola01] Paul Viola and Michael J. Jones. Rapid Object Detection -using a Boosted Cascade of Simple Features. IEEE CVPR, 2001. The paper is available online at - - -@{ - @defgroup objdetect_c C API -@} - */ - -typedef struct CvHaarClassifierCascade CvHaarClassifierCascade; - -namespace cv -{ - -//! @addtogroup objdetect -//! @{ - -///////////////////////////// Object Detection //////////////////////////// - -//! class for grouping object candidates, detected by Cascade Classifier, HOG etc. -//! instance of the class is to be passed to cv::partition (see cxoperations.hpp) -class CV_EXPORTS SimilarRects -{ -public: - SimilarRects(double _eps) : eps(_eps) {} - inline bool operator()(const Rect& r1, const Rect& r2) const - { - double delta = eps * ((std::min)(r1.width, r2.width) + (std::min)(r1.height, r2.height)) * 0.5; - return std::abs(r1.x - r2.x) <= delta && - std::abs(r1.y - r2.y) <= delta && - std::abs(r1.x + r1.width - r2.x - r2.width) <= delta && - std::abs(r1.y + r1.height - r2.y - r2.height) <= delta; - } - double eps; -}; - -/** @brief Groups the object candidate rectangles. - -@param rectList Input/output vector of rectangles. Output vector includes retained and grouped -rectangles. (The Python list is not modified in place.) -@param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a -group of rectangles to retain it. -@param eps Relative difference between sides of the rectangles to merge them into a group. - -The function is a wrapper for the generic function partition . It clusters all the input rectangles -using the rectangle equivalence criteria that combines rectangles with similar sizes and similar -locations. The similarity is defined by eps. When eps=0 , no clustering is done at all. If -\f$\texttt{eps}\rightarrow +\inf\f$ , all the rectangles are put in one cluster. Then, the small -clusters containing less than or equal to groupThreshold rectangles are rejected. In each other -cluster, the average rectangle is computed and put into the output rectangle list. - */ -CV_EXPORTS void groupRectangles(std::vector& rectList, int groupThreshold, double eps = 0.2); -/** @overload */ -CV_EXPORTS_W void groupRectangles(CV_IN_OUT std::vector& rectList, CV_OUT std::vector& weights, - int groupThreshold, double eps = 0.2); -/** @overload */ -CV_EXPORTS void groupRectangles(std::vector& rectList, int groupThreshold, - double eps, std::vector* weights, std::vector* levelWeights ); -/** @overload */ -CV_EXPORTS void groupRectangles(std::vector& rectList, std::vector& rejectLevels, - std::vector& levelWeights, int groupThreshold, double eps = 0.2); -/** @overload */ -CV_EXPORTS void groupRectangles_meanshift(std::vector& rectList, std::vector& foundWeights, - std::vector& foundScales, - double detectThreshold = 0.0, Size winDetSize = Size(64, 128)); - -template<> CV_EXPORTS void DefaultDeleter::operator ()(CvHaarClassifierCascade* obj) const; - -enum { CASCADE_DO_CANNY_PRUNING = 1, - CASCADE_SCALE_IMAGE = 2, - CASCADE_FIND_BIGGEST_OBJECT = 4, - CASCADE_DO_ROUGH_SEARCH = 8 - }; - -class CV_EXPORTS_W BaseCascadeClassifier : public Algorithm -{ -public: - virtual ~BaseCascadeClassifier(); - virtual bool empty() const CV_OVERRIDE = 0; - virtual bool load( const String& filename ) = 0; - virtual void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - double scaleFactor, - int minNeighbors, int flags, - Size minSize, Size maxSize ) = 0; - - virtual void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - CV_OUT std::vector& numDetections, - double scaleFactor, - int minNeighbors, int flags, - Size minSize, Size maxSize ) = 0; - - virtual void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - CV_OUT std::vector& rejectLevels, - CV_OUT std::vector& levelWeights, - double scaleFactor, - int minNeighbors, int flags, - Size minSize, Size maxSize, - bool outputRejectLevels ) = 0; - - virtual bool isOldFormatCascade() const = 0; - virtual Size getOriginalWindowSize() const = 0; - virtual int getFeatureType() const = 0; - virtual void* getOldCascade() = 0; - - class CV_EXPORTS MaskGenerator - { - public: - virtual ~MaskGenerator() {} - virtual Mat generateMask(const Mat& src)=0; - virtual void initializeMask(const Mat& /*src*/) { } - }; - virtual void setMaskGenerator(const Ptr& maskGenerator) = 0; - virtual Ptr getMaskGenerator() = 0; -}; - -/** @example samples/cpp/facedetect.cpp -This program demonstrates usage of the Cascade classifier class -\image html Cascade_Classifier_Tutorial_Result_Haar.jpg "Sample screenshot" width=321 height=254 -*/ -/** @brief Cascade classifier class for object detection. - */ -class CV_EXPORTS_W CascadeClassifier -{ -public: - CV_WRAP CascadeClassifier(); - /** @brief Loads a classifier from a file. - - @param filename Name of the file from which the classifier is loaded. - */ - CV_WRAP CascadeClassifier(const String& filename); - ~CascadeClassifier(); - /** @brief Checks whether the classifier has been loaded. - */ - CV_WRAP bool empty() const; - /** @brief Loads a classifier from a file. - - @param filename Name of the file from which the classifier is loaded. The file may contain an old - HAAR classifier trained by the haartraining application or a new cascade classifier trained by the - traincascade application. - */ - CV_WRAP bool load( const String& filename ); - /** @brief Reads a classifier from a FileStorage node. - - @note The file may contain a new cascade classifier (trained traincascade application) only. - */ - CV_WRAP bool read( const FileNode& node ); - - /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list - of rectangles. - - @param image Matrix of the type CV_8U containing an image where objects are detected. - @param objects Vector of rectangles where each rectangle contains the detected object, the - rectangles may be partially outside the original image. - @param scaleFactor Parameter specifying how much the image size is reduced at each image scale. - @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have - to retain it. - @param flags Parameter with the same meaning for an old cascade as in the function - cvHaarDetectObjects. It is not used for a new cascade. - @param minSize Minimum possible object size. Objects smaller than that are ignored. - @param maxSize Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale. - - The function is parallelized with the TBB library. - - @note - - (Python) A face detection example using cascade classifiers can be found at - opencv_source_code/samples/python/facedetect.py - */ - CV_WRAP void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - double scaleFactor = 1.1, - int minNeighbors = 3, int flags = 0, - Size minSize = Size(), - Size maxSize = Size() ); - - /** @overload - @param image Matrix of the type CV_8U containing an image where objects are detected. - @param objects Vector of rectangles where each rectangle contains the detected object, the - rectangles may be partially outside the original image. - @param numDetections Vector of detection numbers for the corresponding objects. An object's number - of detections is the number of neighboring positively classified rectangles that were joined - together to form the object. - @param scaleFactor Parameter specifying how much the image size is reduced at each image scale. - @param minNeighbors Parameter specifying how many neighbors each candidate rectangle should have - to retain it. - @param flags Parameter with the same meaning for an old cascade as in the function - cvHaarDetectObjects. It is not used for a new cascade. - @param minSize Minimum possible object size. Objects smaller than that are ignored. - @param maxSize Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale. - */ - CV_WRAP_AS(detectMultiScale2) void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - CV_OUT std::vector& numDetections, - double scaleFactor=1.1, - int minNeighbors=3, int flags=0, - Size minSize=Size(), - Size maxSize=Size() ); - - /** @overload - This function allows you to retrieve the final stage decision certainty of classification. - For this, one needs to set `outputRejectLevels` on true and provide the `rejectLevels` and `levelWeights` parameter. - For each resulting detection, `levelWeights` will then contain the certainty of classification at the final stage. - This value can then be used to separate strong from weaker classifications. - - A code sample on how to use it efficiently can be found below: - @code - Mat img; - vector weights; - vector levels; - vector detections; - CascadeClassifier model("/path/to/your/model.xml"); - model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true); - cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl; - @endcode - */ - CV_WRAP_AS(detectMultiScale3) void detectMultiScale( InputArray image, - CV_OUT std::vector& objects, - CV_OUT std::vector& rejectLevels, - CV_OUT std::vector& levelWeights, - double scaleFactor = 1.1, - int minNeighbors = 3, int flags = 0, - Size minSize = Size(), - Size maxSize = Size(), - bool outputRejectLevels = false ); - - CV_WRAP bool isOldFormatCascade() const; - CV_WRAP Size getOriginalWindowSize() const; - CV_WRAP int getFeatureType() const; - void* getOldCascade(); - - CV_WRAP static bool convert(const String& oldcascade, const String& newcascade); - - void setMaskGenerator(const Ptr& maskGenerator); - Ptr getMaskGenerator(); - - Ptr cc; -}; - -CV_EXPORTS Ptr createFaceDetectionMaskGenerator(); - -//////////////// HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector ////////////// - -//! struct for detection region of interest (ROI) -struct DetectionROI -{ - //! scale(size) of the bounding box - double scale; - //! set of requested locations to be evaluated - std::vector locations; - //! vector that will contain confidence values for each location - std::vector confidences; -}; - -/**@brief Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector. - -the HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs @cite Dalal2005 . - -useful links: - -https://hal.inria.fr/inria-00548512/document/ - -https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients - -https://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor - -http://www.learnopencv.com/histogram-of-oriented-gradients - -http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial - - */ -struct CV_EXPORTS_W HOGDescriptor -{ -public: - enum { L2Hys = 0 //!< Default histogramNormType - }; - enum { DEFAULT_NLEVELS = 64 //!< Default nlevels value. - }; - /**@brief Creates the HOG descriptor and detector with default params. - - aqual to HOGDescriptor(Size(64,128), Size(16,16), Size(8,8), Size(8,8), 9, 1 ) - */ - CV_WRAP HOGDescriptor() : winSize(64,128), blockSize(16,16), blockStride(8,8), - cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1), - histogramNormType(HOGDescriptor::L2Hys), L2HysThreshold(0.2), gammaCorrection(true), - free_coef(-1.f), nlevels(HOGDescriptor::DEFAULT_NLEVELS), signedGradient(false) - {} - - /** @overload - @param _winSize sets winSize with given value. - @param _blockSize sets blockSize with given value. - @param _blockStride sets blockStride with given value. - @param _cellSize sets cellSize with given value. - @param _nbins sets nbins with given value. - @param _derivAperture sets derivAperture with given value. - @param _winSigma sets winSigma with given value. - @param _histogramNormType sets histogramNormType with given value. - @param _L2HysThreshold sets L2HysThreshold with given value. - @param _gammaCorrection sets gammaCorrection with given value. - @param _nlevels sets nlevels with given value. - @param _signedGradient sets signedGradient with given value. - */ - CV_WRAP HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride, - Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1, - int _histogramNormType=HOGDescriptor::L2Hys, - double _L2HysThreshold=0.2, bool _gammaCorrection=false, - int _nlevels=HOGDescriptor::DEFAULT_NLEVELS, bool _signedGradient=false) - : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize), - nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma), - histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold), - gammaCorrection(_gammaCorrection), free_coef(-1.f), nlevels(_nlevels), signedGradient(_signedGradient) - {} - - /** @overload - @param filename the file name containing HOGDescriptor properties and coefficients of the trained classifier - */ - CV_WRAP HOGDescriptor(const String& filename) - { - load(filename); - } - - /** @overload - @param d the HOGDescriptor which cloned to create a new one. - */ - HOGDescriptor(const HOGDescriptor& d) - { - d.copyTo(*this); - } - - /**@brief Default destructor. - */ - virtual ~HOGDescriptor() {} - - /**@brief Returns the number of coefficients required for the classification. - */ - CV_WRAP size_t getDescriptorSize() const; - - /** @brief Checks if detector size equal to descriptor size. - */ - CV_WRAP bool checkDetectorSize() const; - - /** @brief Returns winSigma value - */ - CV_WRAP double getWinSigma() const; - - /**@example samples/cpp/peopledetect.cpp - */ - /**@brief Sets coefficients for the linear SVM classifier. - @param _svmdetector coefficients for the linear SVM classifier. - */ - CV_WRAP virtual void setSVMDetector(InputArray _svmdetector); - - /** @brief Reads HOGDescriptor parameters from a file node. - @param fn File node - */ - virtual bool read(FileNode& fn); - - /** @brief Stores HOGDescriptor parameters in a file storage. - @param fs File storage - @param objname Object name - */ - virtual void write(FileStorage& fs, const String& objname) const; - - /** @brief loads coefficients for the linear SVM classifier from a file - @param filename Name of the file to read. - @param objname The optional name of the node to read (if empty, the first top-level node will be used). - */ - CV_WRAP virtual bool load(const String& filename, const String& objname = String()); - - /** @brief saves coefficients for the linear SVM classifier to a file - @param filename File name - @param objname Object name - */ - CV_WRAP virtual void save(const String& filename, const String& objname = String()) const; - - /** @brief clones the HOGDescriptor - @param c cloned HOGDescriptor - */ - virtual void copyTo(HOGDescriptor& c) const; - - /**@example samples/cpp/train_HOG.cpp - */ - /** @brief Computes HOG descriptors of given image. - @param img Matrix of the type CV_8U containing an image where HOG features will be calculated. - @param descriptors Matrix of the type CV_32F - @param winStride Window stride. It must be a multiple of block stride. - @param padding Padding - @param locations Vector of Point - */ - CV_WRAP virtual void compute(InputArray img, - CV_OUT std::vector& descriptors, - Size winStride = Size(), Size padding = Size(), - const std::vector& locations = std::vector()) const; - - /** @brief Performs object detection without a multi-scale window. - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries. - @param weights Vector that will contain confidence values for each detected object. - @param hitThreshold Threshold for the distance between features and SVM classifying plane. - Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). - But if the free coefficient is omitted (which is allowed), you can specify it manually here. - @param winStride Window stride. It must be a multiple of block stride. - @param padding Padding - @param searchLocations Vector of Point includes set of requested locations to be evaluated. - */ - CV_WRAP virtual void detect(const Mat& img, CV_OUT std::vector& foundLocations, - CV_OUT std::vector& weights, - double hitThreshold = 0, Size winStride = Size(), - Size padding = Size(), - const std::vector& searchLocations = std::vector()) const; - - /** @brief Performs object detection without a multi-scale window. - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param foundLocations Vector of point where each point contains left-top corner point of detected object boundaries. - @param hitThreshold Threshold for the distance between features and SVM classifying plane. - Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). - But if the free coefficient is omitted (which is allowed), you can specify it manually here. - @param winStride Window stride. It must be a multiple of block stride. - @param padding Padding - @param searchLocations Vector of Point includes locations to search. - */ - virtual void detect(const Mat& img, CV_OUT std::vector& foundLocations, - double hitThreshold = 0, Size winStride = Size(), - Size padding = Size(), - const std::vector& searchLocations=std::vector()) const; - - /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list - of rectangles. - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param foundLocations Vector of rectangles where each rectangle contains the detected object. - @param foundWeights Vector that will contain confidence values for each detected object. - @param hitThreshold Threshold for the distance between features and SVM classifying plane. - Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). - But if the free coefficient is omitted (which is allowed), you can specify it manually here. - @param winStride Window stride. It must be a multiple of block stride. - @param padding Padding - @param scale Coefficient of the detection window increase. - @param finalThreshold Final threshold - @param useMeanshiftGrouping indicates grouping algorithm - */ - CV_WRAP virtual void detectMultiScale(InputArray img, CV_OUT std::vector& foundLocations, - CV_OUT std::vector& foundWeights, double hitThreshold = 0, - Size winStride = Size(), Size padding = Size(), double scale = 1.05, - double finalThreshold = 2.0,bool useMeanshiftGrouping = false) const; - - /** @brief Detects objects of different sizes in the input image. The detected objects are returned as a list - of rectangles. - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param foundLocations Vector of rectangles where each rectangle contains the detected object. - @param hitThreshold Threshold for the distance between features and SVM classifying plane. - Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient). - But if the free coefficient is omitted (which is allowed), you can specify it manually here. - @param winStride Window stride. It must be a multiple of block stride. - @param padding Padding - @param scale Coefficient of the detection window increase. - @param finalThreshold Final threshold - @param useMeanshiftGrouping indicates grouping algorithm - */ - virtual void detectMultiScale(InputArray img, CV_OUT std::vector& foundLocations, - double hitThreshold = 0, Size winStride = Size(), - Size padding = Size(), double scale = 1.05, - double finalThreshold = 2.0, bool useMeanshiftGrouping = false) const; - - /** @brief Computes gradients and quantized gradient orientations. - @param img Matrix contains the image to be computed - @param grad Matrix of type CV_32FC2 contains computed gradients - @param angleOfs Matrix of type CV_8UC2 contains quantized gradient orientations - @param paddingTL Padding from top-left - @param paddingBR Padding from bottom-right - */ - CV_WRAP virtual void computeGradient(const Mat& img, CV_OUT Mat& grad, CV_OUT Mat& angleOfs, - Size paddingTL = Size(), Size paddingBR = Size()) const; - - /** @brief Returns coefficients of the classifier trained for people detection (for 64x128 windows). - */ - CV_WRAP static std::vector getDefaultPeopleDetector(); - - /**@example samples/tapi/hog.cpp - */ - /** @brief Returns coefficients of the classifier trained for people detection (for 48x96 windows). - */ - CV_WRAP static std::vector getDaimlerPeopleDetector(); - - //! Detection window size. Align to block size and block stride. Default value is Size(64,128). - CV_PROP Size winSize; - - //! Block size in pixels. Align to cell size. Default value is Size(16,16). - CV_PROP Size blockSize; - - //! Block stride. It must be a multiple of cell size. Default value is Size(8,8). - CV_PROP Size blockStride; - - //! Cell size. Default value is Size(8,8). - CV_PROP Size cellSize; - - //! Number of bins used in the calculation of histogram of gradients. Default value is 9. - CV_PROP int nbins; - - //! not documented - CV_PROP int derivAperture; - - //! Gaussian smoothing window parameter. - CV_PROP double winSigma; - - //! histogramNormType - CV_PROP int histogramNormType; - - //! L2-Hys normalization method shrinkage. - CV_PROP double L2HysThreshold; - - //! Flag to specify whether the gamma correction preprocessing is required or not. - CV_PROP bool gammaCorrection; - - //! coefficients for the linear SVM classifier. - CV_PROP std::vector svmDetector; - - //! coefficients for the linear SVM classifier used when OpenCL is enabled - UMat oclSvmDetector; - - //! not documented - float free_coef; - - //! Maximum number of detection window increases. Default value is 64 - CV_PROP int nlevels; - - //! Indicates signed gradient will be used or not - CV_PROP bool signedGradient; - - /** @brief evaluate specified ROI and return confidence value for each location - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param locations Vector of Point - @param foundLocations Vector of Point where each Point is detected object's top-left point. - @param confidences confidences - @param hitThreshold Threshold for the distance between features and SVM classifying plane. Usually - it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if - the free coefficient is omitted (which is allowed), you can specify it manually here - @param winStride winStride - @param padding padding - */ - virtual void detectROI(const cv::Mat& img, const std::vector &locations, - CV_OUT std::vector& foundLocations, CV_OUT std::vector& confidences, - double hitThreshold = 0, cv::Size winStride = Size(), - cv::Size padding = Size()) const; - - /** @brief evaluate specified ROI and return confidence value for each location in multiple scales - @param img Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected. - @param foundLocations Vector of rectangles where each rectangle contains the detected object. - @param locations Vector of DetectionROI - @param hitThreshold Threshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified - in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here. - @param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. - */ - virtual void detectMultiScaleROI(const cv::Mat& img, - CV_OUT std::vector& foundLocations, - std::vector& locations, - double hitThreshold = 0, - int groupThreshold = 0) const; - - /** @brief read/parse Dalal's alt model file - @param modelfile Path of Dalal's alt model file. - */ - void readALTModel(String modelfile); - - /** @brief Groups the object candidate rectangles. - @param rectList Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.) - @param weights Input/output vector of weights of rectangles. Output vector includes weights of retained and grouped rectangles. (The Python list is not modified in place.) - @param groupThreshold Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it. - @param eps Relative difference between sides of the rectangles to merge them into a group. - */ - void groupRectangles(std::vector& rectList, std::vector& weights, int groupThreshold, double eps) const; -}; - -class CV_EXPORTS_W QRCodeDetector -{ -public: - CV_WRAP QRCodeDetector(); - ~QRCodeDetector(); - - /** @brief sets the epsilon used during the horizontal scan of QR code stop marker detection. - @param epsX Epsilon neighborhood, which allows you to determine the horizontal pattern - of the scheme 1:1:3:1:1 according to QR code standard. - */ - CV_WRAP void setEpsX(double epsX); - /** @brief sets the epsilon used during the vertical scan of QR code stop marker detection. - @param epsY Epsilon neighborhood, which allows you to determine the vertical pattern - of the scheme 1:1:3:1:1 according to QR code standard. - */ - CV_WRAP void setEpsY(double epsY); - - /** @brief Detects QR code in image and returns the quadrangle containing the code. - @param img grayscale or color (BGR) image containing (or not) QR code. - @param points Output vector of vertices of the minimum-area quadrangle containing the code. - */ - CV_WRAP bool detect(InputArray img, OutputArray points) const; - - /** @brief Decodes QR code in image once it's found by the detect() method. - Returns UTF8-encoded output string or empty string if the code cannot be decoded. - - @param img grayscale or color (BGR) image containing QR code. - @param points Quadrangle vertices found by detect() method (or some other algorithm). - @param straight_qrcode The optional output image containing rectified and binarized QR code - */ - CV_WRAP cv::String decode(InputArray img, InputArray points, OutputArray straight_qrcode = noArray()); - - /** @brief Both detects and decodes QR code - - @param img grayscale or color (BGR) image containing QR code. - @param points opiotnal output array of vertices of the found QR code quadrangle. Will be empty if not found. - @param straight_qrcode The optional output image containing rectified and binarized QR code - */ - CV_WRAP cv::String detectAndDecode(InputArray img, OutputArray points=noArray(), - OutputArray straight_qrcode = noArray()); -protected: - struct Impl; - Ptr p; -}; - -/** @brief Detect QR code in image and return minimum area of quadrangle that describes QR code. - @param in Matrix of the type CV_8UC1 containing an image where QR code are detected. - @param points Output vector of vertices of a quadrangle of minimal area that describes QR code. - @param eps_x Epsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard. - @param eps_y Epsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard. - */ -CV_EXPORTS bool detectQRCode(InputArray in, std::vector &points, double eps_x = 0.2, double eps_y = 0.1); - -/** @brief Decode QR code in image and return text that is encrypted in QR code. - @param in Matrix of the type CV_8UC1 containing an image where QR code are detected. - @param points Input vector of vertices of a quadrangle of minimal area that describes QR code. - @param decoded_info String information that is encrypted in QR code. - @param straight_qrcode Matrix of the type CV_8UC1 containing an binary straight QR code. - */ -CV_EXPORTS bool decodeQRCode(InputArray in, InputArray points, std::string &decoded_info, OutputArray straight_qrcode = noArray()); - -//! @} objdetect -} - -#include "opencv2/objdetect/detection_based_tracker.hpp" - -#ifndef DISABLE_OPENCV_24_COMPATIBILITY -#include "opencv2/objdetect/objdetect_c.h" -#endif - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/detection_based_tracker.hpp b/qt-correction-tool/pub/opencv/include/opencv2/objdetect/detection_based_tracker.hpp deleted file mode 100644 index 07dd587..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/detection_based_tracker.hpp +++ /dev/null @@ -1,227 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OBJDETECT_DBT_HPP -#define OPENCV_OBJDETECT_DBT_HPP - -#include - -// After this condition removal update blacklist for bindings: modules/python/common.cmake -#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(__ANDROID__) || \ - defined(CV_CXX11) - -#include - -namespace cv -{ - -//! @addtogroup objdetect -//! @{ - -class CV_EXPORTS DetectionBasedTracker -{ - public: - struct CV_EXPORTS Parameters - { - int maxTrackLifetime; - int minDetectionPeriod; //the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0 - - Parameters(); - }; - - class IDetector - { - public: - IDetector(): - minObjSize(96, 96), - maxObjSize(INT_MAX, INT_MAX), - minNeighbours(2), - scaleFactor(1.1f) - {} - - virtual void detect(const cv::Mat& image, std::vector& objects) = 0; - - void setMinObjectSize(const cv::Size& min) - { - minObjSize = min; - } - void setMaxObjectSize(const cv::Size& max) - { - maxObjSize = max; - } - cv::Size getMinObjectSize() const - { - return minObjSize; - } - cv::Size getMaxObjectSize() const - { - return maxObjSize; - } - float getScaleFactor() - { - return scaleFactor; - } - void setScaleFactor(float value) - { - scaleFactor = value; - } - int getMinNeighbours() - { - return minNeighbours; - } - void setMinNeighbours(int value) - { - minNeighbours = value; - } - virtual ~IDetector() {} - - protected: - cv::Size minObjSize; - cv::Size maxObjSize; - int minNeighbours; - float scaleFactor; - }; - - DetectionBasedTracker(cv::Ptr mainDetector, cv::Ptr trackingDetector, const Parameters& params); - virtual ~DetectionBasedTracker(); - - virtual bool run(); - virtual void stop(); - virtual void resetTracking(); - - virtual void process(const cv::Mat& imageGray); - - bool setParameters(const Parameters& params); - const Parameters& getParameters() const; - - - typedef std::pair Object; - virtual void getObjects(std::vector& result) const; - virtual void getObjects(std::vector& result) const; - - enum ObjectStatus - { - DETECTED_NOT_SHOWN_YET, - DETECTED, - DETECTED_TEMPORARY_LOST, - WRONG_OBJECT - }; - struct ExtObject - { - int id; - cv::Rect location; - ObjectStatus status; - ExtObject(int _id, cv::Rect _location, ObjectStatus _status) - :id(_id), location(_location), status(_status) - { - } - }; - virtual void getObjects(std::vector& result) const; - - - virtual int addObject(const cv::Rect& location); //returns id of the new object - - protected: - class SeparateDetectionWork; - cv::Ptr separateDetectionWork; - friend void* workcycleObjectDetectorFunction(void* p); - - struct InnerParameters - { - int numLastPositionsToTrack; - int numStepsToWaitBeforeFirstShow; - int numStepsToTrackWithoutDetectingIfObjectHasNotBeenShown; - int numStepsToShowWithoutDetecting; - - float coeffTrackingWindowSize; - float coeffObjectSizeToTrack; - float coeffObjectSpeedUsingInPrediction; - - InnerParameters(); - }; - Parameters parameters; - InnerParameters innerParameters; - - struct TrackedObject - { - typedef std::vector PositionsVector; - - PositionsVector lastPositions; - - int numDetectedFrames; - int numFramesNotDetected; - int id; - - TrackedObject(const cv::Rect& rect):numDetectedFrames(1), numFramesNotDetected(0) - { - lastPositions.push_back(rect); - id=getNextId(); - }; - - static int getNextId() - { - static int _id=0; - return _id++; - } - }; - - int numTrackedSteps; - std::vector trackedObjects; - - std::vector weightsPositionsSmoothing; - std::vector weightsSizesSmoothing; - - cv::Ptr cascadeForTracking; - - void updateTrackedObjects(const std::vector& detectedObjects); - cv::Rect calcTrackedObjectPositionToShow(int i) const; - cv::Rect calcTrackedObjectPositionToShow(int i, ObjectStatus& status) const; - void detectInRegion(const cv::Mat& img, const cv::Rect& r, std::vector& detectedObjectsInRegions); -}; - -//! @} objdetect - -} //end of cv namespace -#endif - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect.hpp b/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect.hpp deleted file mode 100644 index 3ee284f..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/objdetect.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect_c.h b/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect_c.h deleted file mode 100644 index 67dc2f4..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/objdetect/objdetect_c.h +++ /dev/null @@ -1,166 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_OBJDETECT_C_H -#define OPENCV_OBJDETECT_C_H - -#include "opencv2/core/core_c.h" - -#ifdef __cplusplus -#include -#include - -extern "C" { -#endif - -/** @addtogroup objdetect_c - @{ - */ - -/****************************************************************************************\ -* Haar-like Object Detection functions * -\****************************************************************************************/ - -#define CV_HAAR_MAGIC_VAL 0x42500000 -#define CV_TYPE_NAME_HAAR "opencv-haar-classifier" - -#define CV_IS_HAAR_CLASSIFIER( haar ) \ - ((haar) != NULL && \ - (((const CvHaarClassifierCascade*)(haar))->flags & CV_MAGIC_MASK)==CV_HAAR_MAGIC_VAL) - -#define CV_HAAR_FEATURE_MAX 3 -#define CV_HAAR_STAGE_MAX 1000 - -typedef struct CvHaarFeature -{ - int tilted; - struct - { - CvRect r; - float weight; - } rect[CV_HAAR_FEATURE_MAX]; -} CvHaarFeature; - -typedef struct CvHaarClassifier -{ - int count; - CvHaarFeature* haar_feature; - float* threshold; - int* left; - int* right; - float* alpha; -} CvHaarClassifier; - -typedef struct CvHaarStageClassifier -{ - int count; - float threshold; - CvHaarClassifier* classifier; - - int next; - int child; - int parent; -} CvHaarStageClassifier; - -typedef struct CvHidHaarClassifierCascade CvHidHaarClassifierCascade; - -typedef struct CvHaarClassifierCascade -{ - int flags; - int count; - CvSize orig_window_size; - CvSize real_window_size; - double scale; - CvHaarStageClassifier* stage_classifier; - CvHidHaarClassifierCascade* hid_cascade; -} CvHaarClassifierCascade; - -typedef struct CvAvgComp -{ - CvRect rect; - int neighbors; -} CvAvgComp; - -/* Loads haar classifier cascade from a directory. - It is obsolete: convert your cascade to xml and use cvLoad instead */ -CVAPI(CvHaarClassifierCascade*) cvLoadHaarClassifierCascade( - const char* directory, CvSize orig_window_size); - -CVAPI(void) cvReleaseHaarClassifierCascade( CvHaarClassifierCascade** cascade ); - -#define CV_HAAR_DO_CANNY_PRUNING 1 -#define CV_HAAR_SCALE_IMAGE 2 -#define CV_HAAR_FIND_BIGGEST_OBJECT 4 -#define CV_HAAR_DO_ROUGH_SEARCH 8 - -CVAPI(CvSeq*) cvHaarDetectObjects( const CvArr* image, - CvHaarClassifierCascade* cascade, CvMemStorage* storage, - double scale_factor CV_DEFAULT(1.1), - int min_neighbors CV_DEFAULT(3), int flags CV_DEFAULT(0), - CvSize min_size CV_DEFAULT(cvSize(0,0)), CvSize max_size CV_DEFAULT(cvSize(0,0))); - -/* sets images for haar classifier cascade */ -CVAPI(void) cvSetImagesForHaarClassifierCascade( CvHaarClassifierCascade* cascade, - const CvArr* sum, const CvArr* sqsum, - const CvArr* tilted_sum, double scale ); - -/* runs the cascade on the specified window */ -CVAPI(int) cvRunHaarClassifierCascade( const CvHaarClassifierCascade* cascade, - CvPoint pt, int start_stage CV_DEFAULT(0)); - -/** @} objdetect_c */ - -#ifdef __cplusplus -} - -CV_EXPORTS CvSeq* cvHaarDetectObjectsForROC( const CvArr* image, - CvHaarClassifierCascade* cascade, CvMemStorage* storage, - std::vector& rejectLevels, std::vector& levelWeightds, - double scale_factor = 1.1, - int min_neighbors = 3, int flags = 0, - CvSize min_size = cvSize(0, 0), CvSize max_size = cvSize(0, 0), - bool outputRejectLevels = false ); - -#endif - -#endif /* OPENCV_OBJDETECT_C_H */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/photo.hpp b/qt-correction-tool/pub/opencv/include/opencv2/photo.hpp deleted file mode 100644 index 8b0652a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/photo.hpp +++ /dev/null @@ -1,860 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_PHOTO_HPP -#define OPENCV_PHOTO_HPP - -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" - -/** -@defgroup photo Computational Photography - -This module includes photo processing algorithms -@{ - @defgroup photo_inpaint Inpainting - @defgroup photo_denoise Denoising - @defgroup photo_hdr HDR imaging - -This section describes high dynamic range imaging algorithms namely tonemapping, exposure alignment, -camera calibration with multiple exposures and exposure fusion. - - @defgroup photo_decolor Contrast Preserving Decolorization - -Useful links: - -http://www.cse.cuhk.edu.hk/leojia/projects/color2gray/index.html - - @defgroup photo_clone Seamless Cloning - -Useful links: - -https://www.learnopencv.com/seamless-cloning-using-opencv-python-cpp - - @defgroup photo_render Non-Photorealistic Rendering - -Useful links: - -http://www.inf.ufrgs.br/~eslgastal/DomainTransform - -https://www.learnopencv.com/non-photorealistic-rendering-using-opencv-python-c/ -@} - */ - -namespace cv -{ - -//! @addtogroup photo -//! @{ - -//! @addtogroup photo_inpaint -//! @{ -//! the inpainting algorithm -enum -{ - INPAINT_NS = 0, //!< Use Navier-Stokes based method - INPAINT_TELEA = 1 //!< Use the algorithm proposed by Alexandru Telea @cite Telea04 -}; - -/** @brief Restores the selected region in an image using the region neighborhood. - -@param src Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image. -@param inpaintMask Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that -needs to be inpainted. -@param dst Output image with the same size and type as src . -@param inpaintRadius Radius of a circular neighborhood of each point inpainted that is considered -by the algorithm. -@param flags Inpainting method that could be cv::INPAINT_NS or cv::INPAINT_TELEA - -The function reconstructs the selected image area from the pixel near the area boundary. The -function may be used to remove dust and scratches from a scanned photo, or to remove undesirable -objects from still images or video. See for more details. - -@note - - An example using the inpainting technique can be found at - opencv_source_code/samples/cpp/inpaint.cpp - - (Python) An example using the inpainting technique can be found at - opencv_source_code/samples/python/inpaint.py - */ -CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, - OutputArray dst, double inpaintRadius, int flags ); - -//! @} photo_inpaint - -//! @addtogroup photo_denoise -//! @{ - -/** @brief Perform image denoising using Non-local Means Denoising algorithm - with several computational -optimizations. Noise expected to be a gaussian white noise - -@param src Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image. -@param dst Output image with the same size and type as src . -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Parameter regulating filter strength. Big h value perfectly removes noise but also -removes image details, smaller h value preserves details but also preserves some noise - -This function expected to be applied to grayscale images. For colored images look at -fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored -image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting -image to CIELAB colorspace and then separately denoise L and AB components with different h -parameter. - */ -CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, float h = 3, - int templateWindowSize = 7, int searchWindowSize = 21); - -/** @brief Perform image denoising using Non-local Means Denoising algorithm - with several computational -optimizations. Noise expected to be a gaussian white noise - -@param src Input 8-bit or 16-bit (only with NORM_L1) 1-channel, -2-channel, 3-channel or 4-channel image. -@param dst Output image with the same size and type as src . -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Array of parameters regulating filter strength, either one -parameter applied to all channels or one per channel in dst. Big h value -perfectly removes noise but also removes image details, smaller h -value preserves details but also preserves some noise -@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1 - -This function expected to be applied to grayscale images. For colored images look at -fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored -image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting -image to CIELAB colorspace and then separately denoise L and AB components with different h -parameter. - */ -CV_EXPORTS_W void fastNlMeansDenoising( InputArray src, OutputArray dst, - const std::vector& h, - int templateWindowSize = 7, int searchWindowSize = 21, - int normType = NORM_L2); - -/** @brief Modification of fastNlMeansDenoising function for colored images - -@param src Input 8-bit 3-channel image. -@param dst Output image with the same size and type as src . -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly -removes noise but also removes image details, smaller h value preserves details but also preserves -some noise -@param hColor The same as h but for color components. For most images value equals 10 -will be enough to remove colored noise and do not distort colors - -The function converts image to CIELAB colorspace and then separately denoise L and AB components -with given h parameters using fastNlMeansDenoising function. - */ -CV_EXPORTS_W void fastNlMeansDenoisingColored( InputArray src, OutputArray dst, - float h = 3, float hColor = 3, - int templateWindowSize = 7, int searchWindowSize = 21); - -/** @brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been -captured in small period of time. For example video. This version of the function is for grayscale -images or for manual manipulation with colorspaces. For more details see - - -@param srcImgs Input 8-bit 1-channel, 2-channel, 3-channel or -4-channel images sequence. All images should have the same type and -size. -@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence -@param temporalWindowSize Number of surrounding images to use for target image denoising. Should -be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to -imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise -srcImgs[imgToDenoiseIndex] image. -@param dst Output image with the same size and type as srcImgs images. -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Parameter regulating filter strength. Bigger h value -perfectly removes noise but also removes image details, smaller h -value preserves details but also preserves some noise - */ -CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, - int imgToDenoiseIndex, int temporalWindowSize, - float h = 3, int templateWindowSize = 7, int searchWindowSize = 21); - -/** @brief Modification of fastNlMeansDenoising function for images sequence where consecutive images have been -captured in small period of time. For example video. This version of the function is for grayscale -images or for manual manipulation with colorspaces. For more details see - - -@param srcImgs Input 8-bit or 16-bit (only with NORM_L1) 1-channel, -2-channel, 3-channel or 4-channel images sequence. All images should -have the same type and size. -@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence -@param temporalWindowSize Number of surrounding images to use for target image denoising. Should -be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to -imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise -srcImgs[imgToDenoiseIndex] image. -@param dst Output image with the same size and type as srcImgs images. -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Array of parameters regulating filter strength, either one -parameter applied to all channels or one per channel in dst. Big h value -perfectly removes noise but also removes image details, smaller h -value preserves details but also preserves some noise -@param normType Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1 - */ -CV_EXPORTS_W void fastNlMeansDenoisingMulti( InputArrayOfArrays srcImgs, OutputArray dst, - int imgToDenoiseIndex, int temporalWindowSize, - const std::vector& h, - int templateWindowSize = 7, int searchWindowSize = 21, - int normType = NORM_L2); - -/** @brief Modification of fastNlMeansDenoisingMulti function for colored images sequences - -@param srcImgs Input 8-bit 3-channel images sequence. All images should have the same type and -size. -@param imgToDenoiseIndex Target image to denoise index in srcImgs sequence -@param temporalWindowSize Number of surrounding images to use for target image denoising. Should -be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to -imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise -srcImgs[imgToDenoiseIndex] image. -@param dst Output image with the same size and type as srcImgs images. -@param templateWindowSize Size in pixels of the template patch that is used to compute weights. -Should be odd. Recommended value 7 pixels -@param searchWindowSize Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater -denoising time. Recommended value 21 pixels -@param h Parameter regulating filter strength for luminance component. Bigger h value perfectly -removes noise but also removes image details, smaller h value preserves details but also preserves -some noise. -@param hColor The same as h but for color components. - -The function converts images to CIELAB colorspace and then separately denoise L and AB components -with given h parameters using fastNlMeansDenoisingMulti function. - */ -CV_EXPORTS_W void fastNlMeansDenoisingColoredMulti( InputArrayOfArrays srcImgs, OutputArray dst, - int imgToDenoiseIndex, int temporalWindowSize, - float h = 3, float hColor = 3, - int templateWindowSize = 7, int searchWindowSize = 21); - -/** @brief Primal-dual algorithm is an algorithm for solving special types of variational problems (that is, -finding a function to minimize some functional). As the image denoising, in particular, may be seen -as the variational problem, primal-dual algorithm then can be used to perform denoising and this is -exactly what is implemented. - -It should be noted, that this implementation was taken from the July 2013 blog entry -@cite MA13 , which also contained (slightly more general) ready-to-use source code on Python. -Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end -of July 2013 and finally it was slightly adapted by later authors. - -Although the thorough discussion and justification of the algorithm involved may be found in -@cite ChambolleEtAl, it might make sense to skim over it here, following @cite MA13 . To begin -with, we consider the 1-byte gray-level images as the functions from the rectangular domain of -pixels (it may be seen as set -\f$\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}\f$ for some -\f$m,\;n\in\mathbb{N}\f$) into \f$\{0,1,\dots,255\}\f$. We shall denote the noised images as \f$f_i\f$ and with -this view, given some image \f$x\f$ of the same size, we may measure how bad it is by the formula - -\f[\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|\f] - -\f$\|\|\cdot\|\|\f$ here denotes \f$L_2\f$-norm and as you see, the first addend states that we want our -image to be smooth (ideally, having zero gradient, thus being constant) and the second states that -we want our result to be close to the observations we've got. If we treat \f$x\f$ as a function, this is -exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play. - -@param observations This array should contain one or more noised versions of the image that is to -be restored. -@param result Here the denoised image will be stored. There is no need to do pre-allocation of -storage space, as it will be automatically allocated, if necessary. -@param lambda Corresponds to \f$\lambda\f$ in the formulas above. As it is enlarged, the smooth -(blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly -speaking, as it becomes smaller, the result will be more blur but more sever outliers will be -removed. -@param niters Number of iterations that the algorithm will run. Of course, as more iterations as -better, but it is hard to quantitatively refine this statement, so just use the default and -increase it if the results are poor. - */ -CV_EXPORTS_W void denoise_TVL1(const std::vector& observations,Mat& result, double lambda=1.0, int niters=30); - -//! @} photo_denoise - -//! @addtogroup photo_hdr -//! @{ - -enum { LDR_SIZE = 256 }; - -/** @brief Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range. - */ -class CV_EXPORTS_W Tonemap : public Algorithm -{ -public: - /** @brief Tonemaps image - - @param src source image - CV_32FC3 Mat (float 32 bits 3 channels) - @param dst destination image - CV_32FC3 Mat with values in [0, 1] range - */ - CV_WRAP virtual void process(InputArray src, OutputArray dst) = 0; - - CV_WRAP virtual float getGamma() const = 0; - CV_WRAP virtual void setGamma(float gamma) = 0; -}; - -/** @brief Creates simple linear mapper with gamma correction - -@param gamma positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma -equal to 2.2f is suitable for most displays. -Generally gamma \> 1 brightens the image and gamma \< 1 darkens it. - */ -CV_EXPORTS_W Ptr createTonemap(float gamma = 1.0f); - -/** @brief Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in -logarithmic domain. - -Since it's a global operator the same function is applied to all the pixels, it is controlled by the -bias parameter. - -Optional saturation enhancement is possible as described in @cite FL02 . - -For more information see @cite DM03 . - */ -class CV_EXPORTS_W TonemapDrago : public Tonemap -{ -public: - - CV_WRAP virtual float getSaturation() const = 0; - CV_WRAP virtual void setSaturation(float saturation) = 0; - - CV_WRAP virtual float getBias() const = 0; - CV_WRAP virtual void setBias(float bias) = 0; -}; - -/** @brief Creates TonemapDrago object - -@param gamma gamma value for gamma correction. See createTonemap -@param saturation positive saturation enhancement value. 1.0 preserves saturation, values greater -than 1 increase saturation and values less than 1 decrease it. -@param bias value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best -results, default value is 0.85. - */ -CV_EXPORTS_W Ptr createTonemapDrago(float gamma = 1.0f, float saturation = 1.0f, float bias = 0.85f); - - -/** @brief This is a global tonemapping operator that models human visual system. - -Mapping function is controlled by adaptation parameter, that is computed using light adaptation and -color adaptation. - -For more information see @cite RD05 . - */ -class CV_EXPORTS_W TonemapReinhard : public Tonemap -{ -public: - CV_WRAP virtual float getIntensity() const = 0; - CV_WRAP virtual void setIntensity(float intensity) = 0; - - CV_WRAP virtual float getLightAdaptation() const = 0; - CV_WRAP virtual void setLightAdaptation(float light_adapt) = 0; - - CV_WRAP virtual float getColorAdaptation() const = 0; - CV_WRAP virtual void setColorAdaptation(float color_adapt) = 0; -}; - -/** @brief Creates TonemapReinhard object - -@param gamma gamma value for gamma correction. See createTonemap -@param intensity result intensity in [-8, 8] range. Greater intensity produces brighter results. -@param light_adapt light adaptation in [0, 1] range. If 1 adaptation is based only on pixel -value, if 0 it's global, otherwise it's a weighted mean of this two cases. -@param color_adapt chromatic adaptation in [0, 1] range. If 1 channels are treated independently, -if 0 adaptation level is the same for each channel. - */ -CV_EXPORTS_W Ptr -createTonemapReinhard(float gamma = 1.0f, float intensity = 0.0f, float light_adapt = 1.0f, float color_adapt = 0.0f); - -/** @brief This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid, -transforms contrast values to HVS response and scales the response. After this the image is -reconstructed from new contrast values. - -For more information see @cite MM06 . - */ -class CV_EXPORTS_W TonemapMantiuk : public Tonemap -{ -public: - CV_WRAP virtual float getScale() const = 0; - CV_WRAP virtual void setScale(float scale) = 0; - - CV_WRAP virtual float getSaturation() const = 0; - CV_WRAP virtual void setSaturation(float saturation) = 0; -}; - -/** @brief Creates TonemapMantiuk object - -@param gamma gamma value for gamma correction. See createTonemap -@param scale contrast scale factor. HVS response is multiplied by this parameter, thus compressing -dynamic range. Values from 0.6 to 0.9 produce best results. -@param saturation saturation enhancement value. See createTonemapDrago - */ -CV_EXPORTS_W Ptr -createTonemapMantiuk(float gamma = 1.0f, float scale = 0.7f, float saturation = 1.0f); - -/** @brief The base class for algorithms that align images of the same scene with different exposures - */ -class CV_EXPORTS_W AlignExposures : public Algorithm -{ -public: - /** @brief Aligns images - - @param src vector of input images - @param dst vector of aligned images - @param times vector of exposure time values for each image - @param response 256x1 matrix with inverse camera response function for each pixel value, it should - have the same number of channels as images. - */ - CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst, - InputArray times, InputArray response) = 0; -}; - -/** @brief This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median -luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations. - -It is invariant to exposure, so exposure values and camera response are not necessary. - -In this implementation new image regions are filled with zeros. - -For more information see @cite GW03 . - */ -class CV_EXPORTS_W AlignMTB : public AlignExposures -{ -public: - CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst, - InputArray times, InputArray response) CV_OVERRIDE = 0; - - /** @brief Short version of process, that doesn't take extra arguments. - - @param src vector of input images - @param dst vector of aligned images - */ - CV_WRAP virtual void process(InputArrayOfArrays src, std::vector& dst) = 0; - - /** @brief Calculates shift between two images, i. e. how to shift the second image to correspond it with the - first. - - @param img0 first image - @param img1 second image - */ - CV_WRAP virtual Point calculateShift(InputArray img0, InputArray img1) = 0; - /** @brief Helper function, that shift Mat filling new regions with zeros. - - @param src input image - @param dst result image - @param shift shift value - */ - CV_WRAP virtual void shiftMat(InputArray src, OutputArray dst, const Point shift) = 0; - /** @brief Computes median threshold and exclude bitmaps of given image. - - @param img input image - @param tb median threshold bitmap - @param eb exclude bitmap - */ - CV_WRAP virtual void computeBitmaps(InputArray img, OutputArray tb, OutputArray eb) = 0; - - CV_WRAP virtual int getMaxBits() const = 0; - CV_WRAP virtual void setMaxBits(int max_bits) = 0; - - CV_WRAP virtual int getExcludeRange() const = 0; - CV_WRAP virtual void setExcludeRange(int exclude_range) = 0; - - CV_WRAP virtual bool getCut() const = 0; - CV_WRAP virtual void setCut(bool value) = 0; -}; - -/** @brief Creates AlignMTB object - -@param max_bits logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are -usually good enough (31 and 63 pixels shift respectively). -@param exclude_range range for exclusion bitmap that is constructed to suppress noise around the -median value. -@param cut if true cuts images, otherwise fills the new regions with zeros. - */ -CV_EXPORTS_W Ptr createAlignMTB(int max_bits = 6, int exclude_range = 4, bool cut = true); - -/** @brief The base class for camera response calibration algorithms. - */ -class CV_EXPORTS_W CalibrateCRF : public Algorithm -{ -public: - /** @brief Recovers inverse camera response. - - @param src vector of input images - @param dst 256x1 matrix with inverse camera response function - @param times vector of exposure time values for each image - */ - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; -}; - -/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective -function as linear system. Objective function is constructed using pixel values on the same position -in all images, extra term is added to make the result smoother. - -For more information see @cite DM97 . - */ -class CV_EXPORTS_W CalibrateDebevec : public CalibrateCRF -{ -public: - CV_WRAP virtual float getLambda() const = 0; - CV_WRAP virtual void setLambda(float lambda) = 0; - - CV_WRAP virtual int getSamples() const = 0; - CV_WRAP virtual void setSamples(int samples) = 0; - - CV_WRAP virtual bool getRandom() const = 0; - CV_WRAP virtual void setRandom(bool random) = 0; -}; - -/** @brief Creates CalibrateDebevec object - -@param samples number of pixel locations to use -@param lambda smoothness term weight. Greater values produce smoother results, but can alter the -response. -@param random if true sample pixel locations are chosen at random, otherwise they form a -rectangular grid. - */ -CV_EXPORTS_W Ptr createCalibrateDebevec(int samples = 70, float lambda = 10.0f, bool random = false); - -/** @brief Inverse camera response function is extracted for each brightness value by minimizing an objective -function as linear system. This algorithm uses all image pixels. - -For more information see @cite RB99 . - */ -class CV_EXPORTS_W CalibrateRobertson : public CalibrateCRF -{ -public: - CV_WRAP virtual int getMaxIter() const = 0; - CV_WRAP virtual void setMaxIter(int max_iter) = 0; - - CV_WRAP virtual float getThreshold() const = 0; - CV_WRAP virtual void setThreshold(float threshold) = 0; - - CV_WRAP virtual Mat getRadiance() const = 0; -}; - -/** @brief Creates CalibrateRobertson object - -@param max_iter maximal number of Gauss-Seidel solver iterations. -@param threshold target difference between results of two successive steps of the minimization. - */ -CV_EXPORTS_W Ptr createCalibrateRobertson(int max_iter = 30, float threshold = 0.01f); - -/** @brief The base class algorithms that can merge exposure sequence to a single image. - */ -class CV_EXPORTS_W MergeExposures : public Algorithm -{ -public: - /** @brief Merges images. - - @param src vector of input images - @param dst result image - @param times vector of exposure time values for each image - @param response 256x1 matrix with inverse camera response function for each pixel value, it should - have the same number of channels as images. - */ - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) = 0; -}; - -/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure -values and camera response. - -For more information see @cite DM97 . - */ -class CV_EXPORTS_W MergeDebevec : public MergeExposures -{ -public: - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) CV_OVERRIDE = 0; - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; -}; - -/** @brief Creates MergeDebevec object - */ -CV_EXPORTS_W Ptr createMergeDebevec(); - -/** @brief Pixels are weighted using contrast, saturation and well-exposedness measures, than images are -combined using laplacian pyramids. - -The resulting image weight is constructed as weighted average of contrast, saturation and -well-exposedness measures. - -The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying -by 255, but it's recommended to apply gamma correction and/or linear tonemapping. - -For more information see @cite MK07 . - */ -class CV_EXPORTS_W MergeMertens : public MergeExposures -{ -public: - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) CV_OVERRIDE = 0; - /** @brief Short version of process, that doesn't take extra arguments. - - @param src vector of input images - @param dst result image - */ - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst) = 0; - - CV_WRAP virtual float getContrastWeight() const = 0; - CV_WRAP virtual void setContrastWeight(float contrast_weiht) = 0; - - CV_WRAP virtual float getSaturationWeight() const = 0; - CV_WRAP virtual void setSaturationWeight(float saturation_weight) = 0; - - CV_WRAP virtual float getExposureWeight() const = 0; - CV_WRAP virtual void setExposureWeight(float exposure_weight) = 0; -}; - -/** @brief Creates MergeMertens object - -@param contrast_weight contrast measure weight. See MergeMertens. -@param saturation_weight saturation measure weight -@param exposure_weight well-exposedness measure weight - */ -CV_EXPORTS_W Ptr -createMergeMertens(float contrast_weight = 1.0f, float saturation_weight = 1.0f, float exposure_weight = 0.0f); - -/** @brief The resulting HDR image is calculated as weighted average of the exposures considering exposure -values and camera response. - -For more information see @cite RB99 . - */ -class CV_EXPORTS_W MergeRobertson : public MergeExposures -{ -public: - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, - InputArray times, InputArray response) CV_OVERRIDE = 0; - CV_WRAP virtual void process(InputArrayOfArrays src, OutputArray dst, InputArray times) = 0; -}; - -/** @brief Creates MergeRobertson object - */ -CV_EXPORTS_W Ptr createMergeRobertson(); - -//! @} photo_hdr - -//! @addtogroup photo_decolor -//! @{ - -/** @brief Transforms a color image to a grayscale image. It is a basic tool in digital printing, stylized -black-and-white photograph rendering, and in many single channel image processing applications -@cite CL12 . - -@param src Input 8-bit 3-channel image. -@param grayscale Output 8-bit 1-channel image. -@param color_boost Output 8-bit 3-channel image. - -This function is to be applied on color images. - */ -CV_EXPORTS_W void decolor( InputArray src, OutputArray grayscale, OutputArray color_boost); - -//! @} photo_decolor - -//! @addtogroup photo_clone -//! @{ - - -//! seamlessClone algorithm flags -enum -{ - /** The power of the method is fully expressed when inserting objects with complex outlines into a new background*/ - NORMAL_CLONE = 1, - /** The classic method, color-based selection and alpha masking might be time consuming and often leaves an undesirable - halo. Seamless cloning, even averaged with the original image, is not effective. Mixed seamless cloning based on a loose selection proves effective.*/ - MIXED_CLONE = 2, - /** Monochrome transfer allows the user to easily replace certain features of one object by alternative features.*/ - MONOCHROME_TRANSFER = 3}; - - -/** @example samples/cpp/tutorial_code/photo/seamless_cloning/cloning_demo.cpp -An example using seamlessClone function -*/ -/** @brief Image editing tasks concern either global changes (color/intensity corrections, filters, -deformations) or local changes concerned to a selection. Here we are interested in achieving local -changes, ones that are restricted to a region manually selected (ROI), in a seamless and effortless -manner. The extent of the changes ranges from slight distortions to complete replacement by novel -content @cite PM03 . - -@param src Input 8-bit 3-channel image. -@param dst Input 8-bit 3-channel image. -@param mask Input 8-bit 1 or 3-channel image. -@param p Point in dst image where object is placed. -@param blend Output image with the same size and type as dst. -@param flags Cloning method that could be cv::NORMAL_CLONE, cv::MIXED_CLONE or cv::MONOCHROME_TRANSFER - */ -CV_EXPORTS_W void seamlessClone( InputArray src, InputArray dst, InputArray mask, Point p, - OutputArray blend, int flags); - -/** @brief Given an original color image, two differently colored versions of this image can be mixed -seamlessly. - -@param src Input 8-bit 3-channel image. -@param mask Input 8-bit 1 or 3-channel image. -@param dst Output image with the same size and type as src . -@param red_mul R-channel multiply factor. -@param green_mul G-channel multiply factor. -@param blue_mul B-channel multiply factor. - -Multiplication factor is between .5 to 2.5. - */ -CV_EXPORTS_W void colorChange(InputArray src, InputArray mask, OutputArray dst, float red_mul = 1.0f, - float green_mul = 1.0f, float blue_mul = 1.0f); - -/** @brief Applying an appropriate non-linear transformation to the gradient field inside the selection and -then integrating back with a Poisson solver, modifies locally the apparent illumination of an image. - -@param src Input 8-bit 3-channel image. -@param mask Input 8-bit 1 or 3-channel image. -@param dst Output image with the same size and type as src. -@param alpha Value ranges between 0-2. -@param beta Value ranges between 0-2. - -This is useful to highlight under-exposed foreground objects or to reduce specular reflections. - */ -CV_EXPORTS_W void illuminationChange(InputArray src, InputArray mask, OutputArray dst, - float alpha = 0.2f, float beta = 0.4f); - -/** @brief By retaining only the gradients at edge locations, before integrating with the Poisson solver, one -washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge %Detector is used. - -@param src Input 8-bit 3-channel image. -@param mask Input 8-bit 1 or 3-channel image. -@param dst Output image with the same size and type as src. -@param low_threshold %Range from 0 to 100. -@param high_threshold Value \> 100. -@param kernel_size The size of the Sobel kernel to be used. - -@note -The algorithm assumes that the color of the source image is close to that of the destination. This -assumption means that when the colors don't match, the source image color gets tinted toward the -color of the destination image. - */ -CV_EXPORTS_W void textureFlattening(InputArray src, InputArray mask, OutputArray dst, - float low_threshold = 30, float high_threshold = 45, - int kernel_size = 3); - -//! @} photo_clone - -//! @addtogroup photo_render -//! @{ - -//! Edge preserving filters -enum -{ - RECURS_FILTER = 1, //!< Recursive Filtering - NORMCONV_FILTER = 2 //!< Normalized Convolution Filtering -}; - -/** @brief Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing -filters are used in many different applications @cite EM11 . - -@param src Input 8-bit 3-channel image. -@param dst Output 8-bit 3-channel image. -@param flags Edge preserving filters: cv::RECURS_FILTER or cv::NORMCONV_FILTER -@param sigma_s %Range between 0 to 200. -@param sigma_r %Range between 0 to 1. - */ -CV_EXPORTS_W void edgePreservingFilter(InputArray src, OutputArray dst, int flags = 1, - float sigma_s = 60, float sigma_r = 0.4f); - -/** @brief This filter enhances the details of a particular image. - -@param src Input 8-bit 3-channel image. -@param dst Output image with the same size and type as src. -@param sigma_s %Range between 0 to 200. -@param sigma_r %Range between 0 to 1. - */ -CV_EXPORTS_W void detailEnhance(InputArray src, OutputArray dst, float sigma_s = 10, - float sigma_r = 0.15f); - -/** @example samples/cpp/tutorial_code/photo/non_photorealistic_rendering/npr_demo.cpp -An example using non-photorealistic line drawing functions -*/ -/** @brief Pencil-like non-photorealistic line drawing - -@param src Input 8-bit 3-channel image. -@param dst1 Output 8-bit 1-channel image. -@param dst2 Output image with the same size and type as src. -@param sigma_s %Range between 0 to 200. -@param sigma_r %Range between 0 to 1. -@param shade_factor %Range between 0 to 0.1. - */ -CV_EXPORTS_W void pencilSketch(InputArray src, OutputArray dst1, OutputArray dst2, - float sigma_s = 60, float sigma_r = 0.07f, float shade_factor = 0.02f); - -/** @brief Stylization aims to produce digital imagery with a wide variety of effects not focused on -photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low -contrast while preserving, or enhancing, high-contrast features. - -@param src Input 8-bit 3-channel image. -@param dst Output image with the same size and type as src. -@param sigma_s %Range between 0 to 200. -@param sigma_r %Range between 0 to 1. - */ -CV_EXPORTS_W void stylization(InputArray src, OutputArray dst, float sigma_s = 60, - float sigma_r = 0.45f); - -//! @} photo_render - -//! @} photo - -} // cv - -#ifndef DISABLE_OPENCV_24_COMPATIBILITY -#include "opencv2/photo/photo_c.h" -#endif - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/photo/cuda.hpp b/qt-correction-tool/pub/opencv/include/opencv2/photo/cuda.hpp deleted file mode 100644 index a2f3816..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/photo/cuda.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_PHOTO_CUDA_HPP -#define OPENCV_PHOTO_CUDA_HPP - -#include "opencv2/core/cuda.hpp" - -namespace cv { namespace cuda { - -//! @addtogroup photo_denoise -//! @{ - -/** @brief Performs pure non local means denoising without any simplification, and thus it is not fast. - -@param src Source image. Supports only CV_8UC1, CV_8UC2 and CV_8UC3. -@param dst Destination image. -@param h Filter sigma regulating filter strength for color. -@param search_window Size of search window. -@param block_size Size of block used for computing weights. -@param borderMode Border type. See borderInterpolate for details. BORDER_REFLECT101 , -BORDER_REPLICATE , BORDER_CONSTANT , BORDER_REFLECT and BORDER_WRAP are supported for now. -@param stream Stream for the asynchronous version. - -@sa - fastNlMeansDenoising - */ -CV_EXPORTS void nonLocalMeans(InputArray src, OutputArray dst, - float h, - int search_window = 21, - int block_size = 7, - int borderMode = BORDER_DEFAULT, - Stream& stream = Stream::Null()); - -/** @brief Perform image denoising using Non-local Means Denoising algorithm - with several computational -optimizations. Noise expected to be a gaussian white noise - -@param src Input 8-bit 1-channel, 2-channel or 3-channel image. -@param dst Output image with the same size and type as src . -@param h Parameter regulating filter strength. Big h value perfectly removes noise but also -removes image details, smaller h value preserves details but also preserves some noise -@param search_window Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater search_window - greater -denoising time. Recommended value 21 pixels -@param block_size Size in pixels of the template patch that is used to compute weights. Should be -odd. Recommended value 7 pixels -@param stream Stream for the asynchronous invocations. - -This function expected to be applied to grayscale images. For colored images look at -FastNonLocalMeansDenoising::labMethod. - -@sa - fastNlMeansDenoising - */ -CV_EXPORTS void fastNlMeansDenoising(InputArray src, OutputArray dst, - float h, - int search_window = 21, - int block_size = 7, - Stream& stream = Stream::Null()); - -/** @brief Modification of fastNlMeansDenoising function for colored images - -@param src Input 8-bit 3-channel image. -@param dst Output image with the same size and type as src . -@param h_luminance Parameter regulating filter strength. Big h value perfectly removes noise but -also removes image details, smaller h value preserves details but also preserves some noise -@param photo_render float The same as h but for color components. For most images value equals 10 will be -enough to remove colored noise and do not distort colors -@param search_window Size in pixels of the window that is used to compute weighted average for -given pixel. Should be odd. Affect performance linearly: greater search_window - greater -denoising time. Recommended value 21 pixels -@param block_size Size in pixels of the template patch that is used to compute weights. Should be -odd. Recommended value 7 pixels -@param stream Stream for the asynchronous invocations. - -The function converts image to CIELAB colorspace and then separately denoise L and AB components -with given h parameters using FastNonLocalMeansDenoising::simpleMethod function. - -@sa - fastNlMeansDenoisingColored - */ -CV_EXPORTS void fastNlMeansDenoisingColored(InputArray src, OutputArray dst, - float h_luminance, float photo_render, - int search_window = 21, - int block_size = 7, - Stream& stream = Stream::Null()); - -//! @} photo - -}} // namespace cv { namespace cuda { - -#endif /* OPENCV_PHOTO_CUDA_HPP */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/photo/photo.hpp b/qt-correction-tool/pub/opencv/include/opencv2/photo/photo.hpp deleted file mode 100644 index 8af5e9f..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/photo/photo.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/photo.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/photo/photo_c.h b/qt-correction-tool/pub/opencv/include/opencv2/photo/photo_c.h deleted file mode 100644 index cd623c1..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/photo/photo_c.h +++ /dev/null @@ -1,74 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2008-2012, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_PHOTO_C_H -#define OPENCV_PHOTO_C_H - -#include "opencv2/core/core_c.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup photo_c - @{ - */ - -/* Inpainting algorithms */ -enum InpaintingModes -{ - CV_INPAINT_NS =0, - CV_INPAINT_TELEA =1 -}; - - -/* Inpaints the selected region in the image */ -CVAPI(void) cvInpaint( const CvArr* src, const CvArr* inpaint_mask, - CvArr* dst, double inpaintRange, int flags ); - -/** @} */ - -#ifdef __cplusplus -} //extern "C" -#endif - -#endif //OPENCV_PHOTO_C_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape.hpp deleted file mode 100644 index f302b6b..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_SHAPE_HPP -#define OPENCV_SHAPE_HPP - -#include "opencv2/shape/emdL1.hpp" -#include "opencv2/shape/shape_transformer.hpp" -#include "opencv2/shape/hist_cost.hpp" -#include "opencv2/shape/shape_distance.hpp" - -/** - @defgroup shape Shape Distance and Matching - */ - -#endif - -/* End of file. */ diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape/emdL1.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape/emdL1.hpp deleted file mode 100644 index a15d68c..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape/emdL1.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2012, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_EMD_L1_HPP -#define OPENCV_EMD_L1_HPP - -#include "opencv2/core.hpp" - -namespace cv -{ -/****************************************************************************************\ -* EMDL1 Function * -\****************************************************************************************/ - -//! @addtogroup shape -//! @{ - -/** @brief Computes the "minimal work" distance between two weighted point configurations base on the papers -"EMD-L1: An efficient and Robust Algorithm for comparing histogram-based descriptors", by Haibin -Ling and Kazunori Okuda; and "The Earth Mover's Distance is the Mallows Distance: Some Insights from -Statistics", by Elizaveta Levina and Peter Bickel. - -@param signature1 First signature, a single column floating-point matrix. Each row is the value of -the histogram in each bin. -@param signature2 Second signature of the same format and size as signature1. - */ -CV_EXPORTS float EMDL1(InputArray signature1, InputArray signature2); - -//! @} - -}//namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape/hist_cost.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape/hist_cost.hpp deleted file mode 100644 index 21d0d68..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape/hist_cost.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_HIST_COST_HPP -#define OPENCV_HIST_COST_HPP - -#include "opencv2/imgproc.hpp" - -namespace cv -{ - -//! @addtogroup shape -//! @{ - -/** @brief Abstract base class for histogram cost algorithms. - */ -class CV_EXPORTS_W HistogramCostExtractor : public Algorithm -{ -public: - CV_WRAP virtual void buildCostMatrix(InputArray descriptors1, InputArray descriptors2, OutputArray costMatrix) = 0; - - CV_WRAP virtual void setNDummies(int nDummies) = 0; - CV_WRAP virtual int getNDummies() const = 0; - - CV_WRAP virtual void setDefaultCost(float defaultCost) = 0; - CV_WRAP virtual float getDefaultCost() const = 0; -}; - -/** @brief A norm based cost extraction. : - */ -class CV_EXPORTS_W NormHistogramCostExtractor : public HistogramCostExtractor -{ -public: - CV_WRAP virtual void setNormFlag(int flag) = 0; - CV_WRAP virtual int getNormFlag() const = 0; -}; - -CV_EXPORTS_W Ptr - createNormHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2f); - -/** @brief An EMD based cost extraction. : - */ -class CV_EXPORTS_W EMDHistogramCostExtractor : public HistogramCostExtractor -{ -public: - CV_WRAP virtual void setNormFlag(int flag) = 0; - CV_WRAP virtual int getNormFlag() const = 0; -}; - -CV_EXPORTS_W Ptr - createEMDHistogramCostExtractor(int flag=DIST_L2, int nDummies=25, float defaultCost=0.2f); - -/** @brief An Chi based cost extraction. : - */ -class CV_EXPORTS_W ChiHistogramCostExtractor : public HistogramCostExtractor -{}; - -CV_EXPORTS_W Ptr createChiHistogramCostExtractor(int nDummies=25, float defaultCost=0.2f); - -/** @brief An EMD-L1 based cost extraction. : - */ -class CV_EXPORTS_W EMDL1HistogramCostExtractor : public HistogramCostExtractor -{}; - -CV_EXPORTS_W Ptr - createEMDL1HistogramCostExtractor(int nDummies=25, float defaultCost=0.2f); - -//! @} - -} // cv -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape/shape.hpp deleted file mode 100644 index 5c4da3c..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/shape.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_distance.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_distance.hpp deleted file mode 100644 index 725b56a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_distance.hpp +++ /dev/null @@ -1,227 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_SHAPE_SHAPE_DISTANCE_HPP -#define OPENCV_SHAPE_SHAPE_DISTANCE_HPP -#include "opencv2/core.hpp" -#include "opencv2/shape/hist_cost.hpp" -#include "opencv2/shape/shape_transformer.hpp" - -namespace cv -{ - -//! @addtogroup shape -//! @{ - -/** @example samples/cpp/shape_example.cpp -An example using shape distance algorithm -*/ -/** @brief Abstract base class for shape distance algorithms. - */ -class CV_EXPORTS_W ShapeDistanceExtractor : public Algorithm -{ -public: - /** @brief Compute the shape distance between two shapes defined by its contours. - - @param contour1 Contour defining first shape. - @param contour2 Contour defining second shape. - */ - CV_WRAP virtual float computeDistance(InputArray contour1, InputArray contour2) = 0; -}; - -/***********************************************************************************/ -/***********************************************************************************/ -/***********************************************************************************/ -/** @brief Implementation of the Shape Context descriptor and matching algorithm - -proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI -2002). This implementation is packaged in a generic scheme, in order to allow you the -implementation of the common variations of the original pipeline. -*/ -class CV_EXPORTS_W ShapeContextDistanceExtractor : public ShapeDistanceExtractor -{ -public: - /** @brief Establish the number of angular bins for the Shape Context Descriptor used in the shape matching - pipeline. - - @param nAngularBins The number of angular bins in the shape context descriptor. - */ - CV_WRAP virtual void setAngularBins(int nAngularBins) = 0; - CV_WRAP virtual int getAngularBins() const = 0; - - /** @brief Establish the number of radial bins for the Shape Context Descriptor used in the shape matching - pipeline. - - @param nRadialBins The number of radial bins in the shape context descriptor. - */ - CV_WRAP virtual void setRadialBins(int nRadialBins) = 0; - CV_WRAP virtual int getRadialBins() const = 0; - - /** @brief Set the inner radius of the shape context descriptor. - - @param innerRadius The value of the inner radius. - */ - CV_WRAP virtual void setInnerRadius(float innerRadius) = 0; - CV_WRAP virtual float getInnerRadius() const = 0; - - /** @brief Set the outer radius of the shape context descriptor. - - @param outerRadius The value of the outer radius. - */ - CV_WRAP virtual void setOuterRadius(float outerRadius) = 0; - CV_WRAP virtual float getOuterRadius() const = 0; - - CV_WRAP virtual void setRotationInvariant(bool rotationInvariant) = 0; - CV_WRAP virtual bool getRotationInvariant() const = 0; - - /** @brief Set the weight of the shape context distance in the final value of the shape distance. The shape - context distance between two shapes is defined as the symmetric sum of shape context matching costs - over best matching points. The final value of the shape distance is a user-defined linear - combination of the shape context distance, an image appearance distance, and a bending energy. - - @param shapeContextWeight The weight of the shape context distance in the final distance value. - */ - CV_WRAP virtual void setShapeContextWeight(float shapeContextWeight) = 0; - CV_WRAP virtual float getShapeContextWeight() const = 0; - - /** @brief Set the weight of the Image Appearance cost in the final value of the shape distance. The image - appearance cost is defined as the sum of squared brightness differences in Gaussian windows around - corresponding image points. The final value of the shape distance is a user-defined linear - combination of the shape context distance, an image appearance distance, and a bending energy. If - this value is set to a number different from 0, is mandatory to set the images that correspond to - each shape. - - @param imageAppearanceWeight The weight of the appearance cost in the final distance value. - */ - CV_WRAP virtual void setImageAppearanceWeight(float imageAppearanceWeight) = 0; - CV_WRAP virtual float getImageAppearanceWeight() const = 0; - - /** @brief Set the weight of the Bending Energy in the final value of the shape distance. The bending energy - definition depends on what transformation is being used to align the shapes. The final value of the - shape distance is a user-defined linear combination of the shape context distance, an image - appearance distance, and a bending energy. - - @param bendingEnergyWeight The weight of the Bending Energy in the final distance value. - */ - CV_WRAP virtual void setBendingEnergyWeight(float bendingEnergyWeight) = 0; - CV_WRAP virtual float getBendingEnergyWeight() const = 0; - - /** @brief Set the images that correspond to each shape. This images are used in the calculation of the Image - Appearance cost. - - @param image1 Image corresponding to the shape defined by contours1. - @param image2 Image corresponding to the shape defined by contours2. - */ - CV_WRAP virtual void setImages(InputArray image1, InputArray image2) = 0; - CV_WRAP virtual void getImages(OutputArray image1, OutputArray image2) const = 0; - - CV_WRAP virtual void setIterations(int iterations) = 0; - CV_WRAP virtual int getIterations() const = 0; - - /** @brief Set the algorithm used for building the shape context descriptor cost matrix. - - @param comparer Smart pointer to a HistogramCostExtractor, an algorithm that defines the cost - matrix between descriptors. - */ - CV_WRAP virtual void setCostExtractor(Ptr comparer) = 0; - CV_WRAP virtual Ptr getCostExtractor() const = 0; - - /** @brief Set the value of the standard deviation for the Gaussian window for the image appearance cost. - - @param sigma Standard Deviation. - */ - CV_WRAP virtual void setStdDev(float sigma) = 0; - CV_WRAP virtual float getStdDev() const = 0; - - /** @brief Set the algorithm used for aligning the shapes. - - @param transformer Smart pointer to a ShapeTransformer, an algorithm that defines the aligning - transformation. - */ - CV_WRAP virtual void setTransformAlgorithm(Ptr transformer) = 0; - CV_WRAP virtual Ptr getTransformAlgorithm() const = 0; -}; - -/* Complete constructor */ -CV_EXPORTS_W Ptr - createShapeContextDistanceExtractor(int nAngularBins=12, int nRadialBins=4, - float innerRadius=0.2f, float outerRadius=2, int iterations=3, - const Ptr &comparer = createChiHistogramCostExtractor(), - const Ptr &transformer = createThinPlateSplineShapeTransformer()); - -/***********************************************************************************/ -/***********************************************************************************/ -/***********************************************************************************/ -/** @brief A simple Hausdorff distance measure between shapes defined by contours - -according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A. -Klanderman, and W.J. Rucklidge. (PAMI 1993). : - */ -class CV_EXPORTS_W HausdorffDistanceExtractor : public ShapeDistanceExtractor -{ -public: - /** @brief Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm. - - @param distanceFlag Flag indicating which norm is used to compute the Hausdorff distance - (NORM_L1, NORM_L2). - */ - CV_WRAP virtual void setDistanceFlag(int distanceFlag) = 0; - CV_WRAP virtual int getDistanceFlag() const = 0; - - /** @brief This method sets the rank proportion (or fractional value) that establish the Kth ranked value of - the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare - shapes. - - @param rankProportion fractional value (between 0 and 1). - */ - CV_WRAP virtual void setRankProportion(float rankProportion) = 0; - CV_WRAP virtual float getRankProportion() const = 0; -}; - -/* Constructor */ -CV_EXPORTS_W Ptr createHausdorffDistanceExtractor(int distanceFlag=cv::NORM_L2, float rankProp=0.6f); - -//! @} - -} // cv -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_transformer.hpp b/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_transformer.hpp deleted file mode 100644 index 3c3ce20..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/shape/shape_transformer.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_SHAPE_SHAPE_TRANSFORM_HPP -#define OPENCV_SHAPE_SHAPE_TRANSFORM_HPP -#include -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" - -namespace cv -{ - -//! @addtogroup shape -//! @{ - -/** @brief Abstract base class for shape transformation algorithms. - */ -class CV_EXPORTS_W ShapeTransformer : public Algorithm -{ -public: - /** @brief Estimate the transformation parameters of the current transformer algorithm, based on point matches. - - @param transformingShape Contour defining first shape. - @param targetShape Contour defining second shape (Target). - @param matches Standard vector of Matches between points. - */ - CV_WRAP virtual void estimateTransformation(InputArray transformingShape, InputArray targetShape, - std::vector& matches) = 0; - - /** @brief Apply a transformation, given a pre-estimated transformation parameters. - - @param input Contour (set of points) to apply the transformation. - @param output Output contour. - */ - CV_WRAP virtual float applyTransformation(InputArray input, OutputArray output=noArray()) = 0; - - /** @brief Apply a transformation, given a pre-estimated transformation parameters, to an Image. - - @param transformingImage Input image. - @param output Output image. - @param flags Image interpolation method. - @param borderMode border style. - @param borderValue border value. - */ - CV_WRAP virtual void warpImage(InputArray transformingImage, OutputArray output, - int flags=INTER_LINEAR, int borderMode=BORDER_CONSTANT, - const Scalar& borderValue=Scalar()) const = 0; -}; - -/***********************************************************************************/ -/***********************************************************************************/ - -/** @brief Definition of the transformation - -occupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition of Deformations", by -F.L. Bookstein (PAMI 1989). : - */ -class CV_EXPORTS_W ThinPlateSplineShapeTransformer : public ShapeTransformer -{ -public: - /** @brief Set the regularization parameter for relaxing the exact interpolation requirements of the TPS - algorithm. - - @param beta value of the regularization parameter. - */ - CV_WRAP virtual void setRegularizationParameter(double beta) = 0; - CV_WRAP virtual double getRegularizationParameter() const = 0; -}; - -/** Complete constructor */ -CV_EXPORTS_W Ptr - createThinPlateSplineShapeTransformer(double regularizationParameter=0); - -/***********************************************************************************/ -/***********************************************************************************/ - -/** @brief Wrapper class for the OpenCV Affine Transformation algorithm. : - */ -class CV_EXPORTS_W AffineTransformer : public ShapeTransformer -{ -public: - CV_WRAP virtual void setFullAffine(bool fullAffine) = 0; - CV_WRAP virtual bool getFullAffine() const = 0; -}; - -/** Complete constructor */ -CV_EXPORTS_W Ptr createAffineTransformer(bool fullAffine); - -//! @} - -} // cv -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching.hpp deleted file mode 100644 index 07e1b5f..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching.hpp +++ /dev/null @@ -1,329 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_STITCHER_HPP -#define OPENCV_STITCHING_STITCHER_HPP - -#include "opencv2/core.hpp" -#include "opencv2/features2d.hpp" -#include "opencv2/stitching/warpers.hpp" -#include "opencv2/stitching/detail/matchers.hpp" -#include "opencv2/stitching/detail/motion_estimators.hpp" -#include "opencv2/stitching/detail/exposure_compensate.hpp" -#include "opencv2/stitching/detail/seam_finders.hpp" -#include "opencv2/stitching/detail/blenders.hpp" -#include "opencv2/stitching/detail/camera.hpp" - - -#if defined(Status) -# warning Detected X11 'Status' macro definition, it can cause build conflicts. Please, include this header before any X11 headers. -#endif - - -/** -@defgroup stitching Images stitching - -This figure illustrates the stitching module pipeline implemented in the Stitcher class. Using that -class it's possible to configure/remove some steps, i.e. adjust the stitching pipeline according to -the particular needs. All building blocks from the pipeline are available in the detail namespace, -one can combine and use them separately. - -The implemented stitching pipeline is very similar to the one proposed in @cite BL07 . - -![stitching pipeline](StitchingPipeline.jpg) - -Camera models -------------- - -There are currently 2 camera models implemented in stitching pipeline. - -- _Homography model_ expecting perspective transformations between images - implemented in @ref cv::detail::BestOf2NearestMatcher cv::detail::HomographyBasedEstimator - cv::detail::BundleAdjusterReproj cv::detail::BundleAdjusterRay -- _Affine model_ expecting affine transformation with 6 DOF or 4 DOF implemented in - @ref cv::detail::AffineBestOf2NearestMatcher cv::detail::AffineBasedEstimator - cv::detail::BundleAdjusterAffine cv::detail::BundleAdjusterAffinePartial cv::AffineWarper - -Homography model is useful for creating photo panoramas captured by camera, -while affine-based model can be used to stitch scans and object captured by -specialized devices. Use @ref cv::Stitcher::create to get preconfigured pipeline for one -of those models. - -@note -Certain detailed settings of @ref cv::Stitcher might not make sense. Especially -you should not mix classes implementing affine model and classes implementing -Homography model, as they work with different transformations. - -@{ - @defgroup stitching_match Features Finding and Images Matching - @defgroup stitching_rotation Rotation Estimation - @defgroup stitching_autocalib Autocalibration - @defgroup stitching_warp Images Warping - @defgroup stitching_seam Seam Estimation - @defgroup stitching_exposure Exposure Compensation - @defgroup stitching_blend Image Blenders -@} - */ - -namespace cv { - -//! @addtogroup stitching -//! @{ - -/** @example samples/cpp/stitching.cpp -A basic example on image stitching -*/ - -/** @example samples/cpp/stitching_detailed.cpp -A detailed example on image stitching -*/ - -/** @brief High level image stitcher. - -It's possible to use this class without being aware of the entire stitching pipeline. However, to -be able to achieve higher stitching stability and quality of the final images at least being -familiar with the theory is recommended. - -@note - - A basic example on image stitching can be found at - opencv_source_code/samples/cpp/stitching.cpp - - A detailed example on image stitching can be found at - opencv_source_code/samples/cpp/stitching_detailed.cpp - */ -class CV_EXPORTS_W Stitcher -{ -public: - enum { ORIG_RESOL = -1 }; - enum Status - { - OK = 0, - ERR_NEED_MORE_IMGS = 1, - ERR_HOMOGRAPHY_EST_FAIL = 2, - ERR_CAMERA_PARAMS_ADJUST_FAIL = 3 - }; - enum Mode - { - /** Mode for creating photo panoramas. Expects images under perspective - transformation and projects resulting pano to sphere. - - @sa detail::BestOf2NearestMatcher SphericalWarper - */ - PANORAMA = 0, - /** Mode for composing scans. Expects images under affine transformation does - not compensate exposure by default. - - @sa detail::AffineBestOf2NearestMatcher AffineWarper - */ - SCANS = 1, - - }; - - // Stitcher() {} - /** @brief Creates a stitcher with the default parameters. - - @param try_use_gpu Flag indicating whether GPU should be used whenever it's possible. - @return Stitcher class instance. - */ - static Stitcher createDefault(bool try_use_gpu = false); - /** @brief Creates a Stitcher configured in one of the stitching modes. - - @param mode Scenario for stitcher operation. This is usually determined by source of images - to stitch and their transformation. Default parameters will be chosen for operation in given - scenario. - @param try_use_gpu Flag indicating whether GPU should be used whenever it's possible. - @return Stitcher class instance. - */ - static Ptr create(Mode mode = PANORAMA, bool try_use_gpu = false); - - CV_WRAP double registrationResol() const { return registr_resol_; } - CV_WRAP void setRegistrationResol(double resol_mpx) { registr_resol_ = resol_mpx; } - - CV_WRAP double seamEstimationResol() const { return seam_est_resol_; } - CV_WRAP void setSeamEstimationResol(double resol_mpx) { seam_est_resol_ = resol_mpx; } - - CV_WRAP double compositingResol() const { return compose_resol_; } - CV_WRAP void setCompositingResol(double resol_mpx) { compose_resol_ = resol_mpx; } - - CV_WRAP double panoConfidenceThresh() const { return conf_thresh_; } - CV_WRAP void setPanoConfidenceThresh(double conf_thresh) { conf_thresh_ = conf_thresh; } - - CV_WRAP bool waveCorrection() const { return do_wave_correct_; } - CV_WRAP void setWaveCorrection(bool flag) { do_wave_correct_ = flag; } - - detail::WaveCorrectKind waveCorrectKind() const { return wave_correct_kind_; } - void setWaveCorrectKind(detail::WaveCorrectKind kind) { wave_correct_kind_ = kind; } - - Ptr featuresFinder() { return features_finder_; } - const Ptr featuresFinder() const { return features_finder_; } - void setFeaturesFinder(Ptr features_finder) - { features_finder_ = features_finder; } - - Ptr featuresMatcher() { return features_matcher_; } - const Ptr featuresMatcher() const { return features_matcher_; } - void setFeaturesMatcher(Ptr features_matcher) - { features_matcher_ = features_matcher; } - - const cv::UMat& matchingMask() const { return matching_mask_; } - void setMatchingMask(const cv::UMat &mask) - { - CV_Assert(mask.type() == CV_8U && mask.cols == mask.rows); - matching_mask_ = mask.clone(); - } - - Ptr bundleAdjuster() { return bundle_adjuster_; } - const Ptr bundleAdjuster() const { return bundle_adjuster_; } - void setBundleAdjuster(Ptr bundle_adjuster) - { bundle_adjuster_ = bundle_adjuster; } - - /* TODO OpenCV ABI 4.x - Ptr estimator() { return estimator_; } - const Ptr estimator() const { return estimator_; } - void setEstimator(Ptr estimator) - { estimator_ = estimator; } - */ - - Ptr warper() { return warper_; } - const Ptr warper() const { return warper_; } - void setWarper(Ptr creator) { warper_ = creator; } - - Ptr exposureCompensator() { return exposure_comp_; } - const Ptr exposureCompensator() const { return exposure_comp_; } - void setExposureCompensator(Ptr exposure_comp) - { exposure_comp_ = exposure_comp; } - - Ptr seamFinder() { return seam_finder_; } - const Ptr seamFinder() const { return seam_finder_; } - void setSeamFinder(Ptr seam_finder) { seam_finder_ = seam_finder; } - - Ptr blender() { return blender_; } - const Ptr blender() const { return blender_; } - void setBlender(Ptr b) { blender_ = b; } - - /** @overload */ - CV_WRAP Status estimateTransform(InputArrayOfArrays images); - /** @brief These functions try to match the given images and to estimate rotations of each camera. - - @note Use the functions only if you're aware of the stitching pipeline, otherwise use - Stitcher::stitch. - - @param images Input images. - @param rois Region of interest rectangles. - @return Status code. - */ - Status estimateTransform(InputArrayOfArrays images, const std::vector > &rois); - - /** @overload */ - CV_WRAP Status composePanorama(OutputArray pano); - /** @brief These functions try to compose the given images (or images stored internally from the other function - calls) into the final pano under the assumption that the image transformations were estimated - before. - - @note Use the functions only if you're aware of the stitching pipeline, otherwise use - Stitcher::stitch. - - @param images Input images. - @param pano Final pano. - @return Status code. - */ - Status composePanorama(InputArrayOfArrays images, OutputArray pano); - - /** @overload */ - CV_WRAP Status stitch(InputArrayOfArrays images, OutputArray pano); - /** @brief These functions try to stitch the given images. - - @param images Input images. - @param rois Region of interest rectangles. - @param pano Final pano. - @return Status code. - */ - Status stitch(InputArrayOfArrays images, const std::vector > &rois, OutputArray pano); - - std::vector component() const { return indices_; } - std::vector cameras() const { return cameras_; } - CV_WRAP double workScale() const { return work_scale_; } - -private: - //Stitcher() {} - - Status matchImages(); - Status estimateCameraParams(); - - double registr_resol_; - double seam_est_resol_; - double compose_resol_; - double conf_thresh_; - Ptr features_finder_; - Ptr features_matcher_; - cv::UMat matching_mask_; - Ptr bundle_adjuster_; - /* TODO OpenCV ABI 4.x - Ptr estimator_; - */ - bool do_wave_correct_; - detail::WaveCorrectKind wave_correct_kind_; - Ptr warper_; - Ptr exposure_comp_; - Ptr seam_finder_; - Ptr blender_; - - std::vector imgs_; - std::vector > rois_; - std::vector full_img_sizes_; - std::vector features_; - std::vector pairwise_matches_; - std::vector seam_est_imgs_; - std::vector indices_; - std::vector cameras_; - double work_scale_; - double seam_scale_; - double seam_work_aspect_; - double warped_image_scale_; -}; - -CV_EXPORTS_W Ptr createStitcher(bool try_use_gpu = false); -CV_EXPORTS_W Ptr createStitcherScans(bool try_use_gpu = false); - -//! @} stitching - -} // namespace cv - -#endif // OPENCV_STITCHING_STITCHER_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/autocalib.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/autocalib.hpp deleted file mode 100644 index 19705e2..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/autocalib.hpp +++ /dev/null @@ -1,86 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_AUTOCALIB_HPP -#define OPENCV_STITCHING_AUTOCALIB_HPP - -#include "opencv2/core.hpp" -#include "matchers.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_autocalib -//! @{ - -/** @brief Tries to estimate focal lengths from the given homography under the assumption that the camera -undergoes rotations around its centre only. - -@param H Homography. -@param f0 Estimated focal length along X axis. -@param f1 Estimated focal length along Y axis. -@param f0_ok True, if f0 was estimated successfully, false otherwise. -@param f1_ok True, if f1 was estimated successfully, false otherwise. - -See "Construction of Panoramic Image Mosaics with Global and Local Alignment" -by Heung-Yeung Shum and Richard Szeliski. - */ -void CV_EXPORTS focalsFromHomography(const Mat &H, double &f0, double &f1, bool &f0_ok, bool &f1_ok); - -/** @brief Estimates focal lengths for each given camera. - -@param features Features of images. -@param pairwise_matches Matches between all image pairs. -@param focals Estimated focal lengths for each camera. - */ -void CV_EXPORTS estimateFocal(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &focals); - -bool CV_EXPORTS calibrateRotatingCamera(const std::vector &Hs, Mat &K); - -//! @} stitching_autocalib - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_AUTOCALIB_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/blenders.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/blenders.hpp deleted file mode 100644 index 542f1e4..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/blenders.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_BLENDERS_HPP -#define OPENCV_STITCHING_BLENDERS_HPP - -#if defined(NO) -# warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers. -#endif - -#include "opencv2/core.hpp" -#include "opencv2/core/cuda.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_blend -//! @{ - -/** @brief Base class for all blenders. - -Simple blender which puts one image over another -*/ -class CV_EXPORTS Blender -{ -public: - virtual ~Blender() {} - - enum { NO, FEATHER, MULTI_BAND }; - static Ptr createDefault(int type, bool try_gpu = false); - - /** @brief Prepares the blender for blending. - - @param corners Source images top-left corners - @param sizes Source image sizes - */ - void prepare(const std::vector &corners, const std::vector &sizes); - /** @overload */ - virtual void prepare(Rect dst_roi); - /** @brief Processes the image. - - @param img Source image - @param mask Source image mask - @param tl Source image top-left corners - */ - virtual void feed(InputArray img, InputArray mask, Point tl); - /** @brief Blends and returns the final pano. - - @param dst Final pano - @param dst_mask Final pano mask - */ - virtual void blend(InputOutputArray dst, InputOutputArray dst_mask); - -protected: - UMat dst_, dst_mask_; - Rect dst_roi_; -}; - -/** @brief Simple blender which mixes images at its borders. - */ -class CV_EXPORTS FeatherBlender : public Blender -{ -public: - FeatherBlender(float sharpness = 0.02f); - - float sharpness() const { return sharpness_; } - void setSharpness(float val) { sharpness_ = val; } - - void prepare(Rect dst_roi) CV_OVERRIDE; - void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE; - void blend(InputOutputArray dst, InputOutputArray dst_mask) CV_OVERRIDE; - - //! Creates weight maps for fixed set of source images by their masks and top-left corners. - //! Final image can be obtained by simple weighting of the source images. - Rect createWeightMaps(const std::vector &masks, const std::vector &corners, - std::vector &weight_maps); - -private: - float sharpness_; - UMat weight_map_; - UMat dst_weight_map_; -}; - -inline FeatherBlender::FeatherBlender(float _sharpness) { setSharpness(_sharpness); } - -/** @brief Blender which uses multi-band blending algorithm (see @cite BA83). - */ -class CV_EXPORTS MultiBandBlender : public Blender -{ -public: - MultiBandBlender(int try_gpu = false, int num_bands = 5, int weight_type = CV_32F); - - int numBands() const { return actual_num_bands_; } - void setNumBands(int val) { actual_num_bands_ = val; } - - void prepare(Rect dst_roi) CV_OVERRIDE; - void feed(InputArray img, InputArray mask, Point tl) CV_OVERRIDE; - void blend(InputOutputArray dst, InputOutputArray dst_mask) CV_OVERRIDE; - -private: - int actual_num_bands_, num_bands_; - std::vector dst_pyr_laplace_; - std::vector dst_band_weights_; - Rect dst_roi_final_; - bool can_use_gpu_; - int weight_type_; //CV_32F or CV_16S -#if defined(HAVE_OPENCV_CUDAARITHM) && defined(HAVE_OPENCV_CUDAWARPING) - std::vector gpu_dst_pyr_laplace_; - std::vector gpu_dst_band_weights_; - std::vector gpu_tl_points_; - std::vector gpu_imgs_with_border_; - std::vector > gpu_weight_pyr_gauss_vec_; - std::vector > gpu_src_pyr_laplace_vec_; - std::vector > gpu_ups_; - cuda::GpuMat gpu_dst_mask_; - cuda::GpuMat gpu_mask_; - cuda::GpuMat gpu_img_; - cuda::GpuMat gpu_weight_map_; - cuda::GpuMat gpu_add_mask_; - int gpu_feed_idx_; - bool gpu_initialized_; -#endif -}; - - -////////////////////////////////////////////////////////////////////////////// -// Auxiliary functions - -void CV_EXPORTS normalizeUsingWeightMap(InputArray weight, InputOutputArray src); - -void CV_EXPORTS createWeightMap(InputArray mask, float sharpness, InputOutputArray weight); - -void CV_EXPORTS createLaplacePyr(InputArray img, int num_levels, std::vector& pyr); -void CV_EXPORTS createLaplacePyrGpu(InputArray img, int num_levels, std::vector& pyr); - -// Restores source image -void CV_EXPORTS restoreImageFromLaplacePyr(std::vector& pyr); -void CV_EXPORTS restoreImageFromLaplacePyrGpu(std::vector& pyr); - -//! @} - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_BLENDERS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/camera.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/camera.hpp deleted file mode 100644 index 07c6b5b..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/camera.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_CAMERA_HPP -#define OPENCV_STITCHING_CAMERA_HPP - -#include "opencv2/core.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching -//! @{ - -/** @brief Describes camera parameters. - -@note Translation is assumed to be zero during the whole stitching pipeline. : - */ -struct CV_EXPORTS CameraParams -{ - CameraParams(); - CameraParams(const CameraParams& other); - CameraParams& operator =(const CameraParams& other); - Mat K() const; - - double focal; // Focal length - double aspect; // Aspect ratio - double ppx; // Principal point X - double ppy; // Principal point Y - Mat R; // Rotation - Mat t; // Translation -}; - -//! @} - -} // namespace detail -} // namespace cv - -#endif // #ifndef OPENCV_STITCHING_CAMERA_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp deleted file mode 100644 index 6c99407..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/exposure_compensate.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP -#define OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP - -#if defined(NO) -# warning Detected Apple 'NO' macro definition, it can cause build conflicts. Please, include this header before any Apple headers. -#endif - -#include "opencv2/core.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_exposure -//! @{ - -/** @brief Base class for all exposure compensators. - */ -class CV_EXPORTS ExposureCompensator -{ -public: - virtual ~ExposureCompensator() {} - - enum { NO, GAIN, GAIN_BLOCKS }; - static Ptr createDefault(int type); - - /** - @param corners Source image top-left corners - @param images Source images - @param masks Image masks to update (second value in pair specifies the value which should be used - to detect where image is) - */ - void feed(const std::vector &corners, const std::vector &images, - const std::vector &masks); - /** @overload */ - virtual void feed(const std::vector &corners, const std::vector &images, - const std::vector > &masks) = 0; - /** @brief Compensate exposure in the specified image. - - @param index Image index - @param corner Image top-left corner - @param image Image to process - @param mask Image mask - */ - virtual void apply(int index, Point corner, InputOutputArray image, InputArray mask) = 0; -}; - -/** @brief Stub exposure compensator which does nothing. - */ -class CV_EXPORTS NoExposureCompensator : public ExposureCompensator -{ -public: - void feed(const std::vector &/*corners*/, const std::vector &/*images*/, - const std::vector > &/*masks*/) CV_OVERRIDE { } - void apply(int /*index*/, Point /*corner*/, InputOutputArray /*image*/, InputArray /*mask*/) CV_OVERRIDE { } -}; - -/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image -intensities, see @cite BL07 and @cite WJ10 for details. - */ -class CV_EXPORTS GainCompensator : public ExposureCompensator -{ -public: - void feed(const std::vector &corners, const std::vector &images, - const std::vector > &masks) CV_OVERRIDE; - void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE; - std::vector gains() const; - -private: - Mat_ gains_; -}; - -/** @brief Exposure compensator which tries to remove exposure related artifacts by adjusting image block -intensities, see @cite UES01 for details. - */ -class CV_EXPORTS BlocksGainCompensator : public ExposureCompensator -{ -public: - BlocksGainCompensator(int bl_width = 32, int bl_height = 32) - : bl_width_(bl_width), bl_height_(bl_height) {} - void feed(const std::vector &corners, const std::vector &images, - const std::vector > &masks) CV_OVERRIDE; - void apply(int index, Point corner, InputOutputArray image, InputArray mask) CV_OVERRIDE; - -private: - int bl_width_, bl_height_; - std::vector gain_maps_; -}; - -//! @} - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_EXPOSURE_COMPENSATE_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/matchers.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/matchers.hpp deleted file mode 100644 index 25c0f2a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/matchers.hpp +++ /dev/null @@ -1,370 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_MATCHERS_HPP -#define OPENCV_STITCHING_MATCHERS_HPP - -#include "opencv2/core.hpp" -#include "opencv2/features2d.hpp" - -#include "opencv2/opencv_modules.hpp" - -#ifdef HAVE_OPENCV_XFEATURES2D -# include "opencv2/xfeatures2d/cuda.hpp" -#endif - -namespace cv { -namespace detail { - -//! @addtogroup stitching_match -//! @{ - -/** @brief Structure containing image keypoints and descriptors. */ -struct CV_EXPORTS ImageFeatures -{ - int img_idx; - Size img_size; - std::vector keypoints; - UMat descriptors; -}; - -/** @brief Feature finders base class */ -class CV_EXPORTS FeaturesFinder -{ -public: - virtual ~FeaturesFinder() {} - /** @overload */ - void operator ()(InputArray image, ImageFeatures &features); - /** @brief Finds features in the given image. - - @param image Source image - @param features Found features - @param rois Regions of interest - - @sa detail::ImageFeatures, Rect_ - */ - void operator ()(InputArray image, ImageFeatures &features, const std::vector &rois); - /** @brief Finds features in the given images in parallel. - - @param images Source images - @param features Found features for each image - @param rois Regions of interest for each image - - @sa detail::ImageFeatures, Rect_ - */ - void operator ()(InputArrayOfArrays images, std::vector &features, - const std::vector > &rois); - /** @overload */ - void operator ()(InputArrayOfArrays images, std::vector &features); - /** @brief Frees unused memory allocated before if there is any. */ - virtual void collectGarbage() {} - - /* TODO OpenCV ABI 4.x - reimplement this as public method similar to FeaturesMatcher and remove private function hack - @return True, if it's possible to use the same finder instance in parallel, false otherwise - bool isThreadSafe() const { return is_thread_safe_; } - */ - -protected: - /** @brief This method must implement features finding logic in order to make the wrappers - detail::FeaturesFinder::operator()_ work. - - @param image Source image - @param features Found features - - @sa detail::ImageFeatures */ - virtual void find(InputArray image, ImageFeatures &features) = 0; - /** @brief uses dynamic_cast to determine thread-safety - @return True, if it's possible to use the same finder instance in parallel, false otherwise - */ - bool isThreadSafe() const; -}; - -/** @brief SURF features finder. - -@sa detail::FeaturesFinder, SURF -*/ -class CV_EXPORTS SurfFeaturesFinder : public FeaturesFinder -{ -public: - SurfFeaturesFinder(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4, - int num_octaves_descr = /*4*/3, int num_layers_descr = /*2*/4); - -private: - void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; - - Ptr detector_; - Ptr extractor_; - Ptr surf; -}; - - -/** @brief SIFT features finder. - -@sa detail::FeaturesFinder, SIFT -*/ -class CV_EXPORTS SiftFeaturesFinder : public FeaturesFinder -{ -public: - SiftFeaturesFinder(); - -private: - void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; - Ptr sift; -}; - -/** @brief ORB features finder. : - -@sa detail::FeaturesFinder, ORB -*/ -class CV_EXPORTS OrbFeaturesFinder : public FeaturesFinder -{ -public: - OrbFeaturesFinder(Size _grid_size = Size(3,1), int nfeatures=1500, float scaleFactor=1.3f, int nlevels=5); - -private: - void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; - - Ptr orb; - Size grid_size; -}; - -/** @brief AKAZE features finder. : - -@sa detail::FeaturesFinder, AKAZE -*/ -class CV_EXPORTS AKAZEFeaturesFinder : public detail::FeaturesFinder -{ -public: - AKAZEFeaturesFinder(int descriptor_type = AKAZE::DESCRIPTOR_MLDB, - int descriptor_size = 0, - int descriptor_channels = 3, - float threshold = 0.001f, - int nOctaves = 4, - int nOctaveLayers = 4, - int diffusivity = KAZE::DIFF_PM_G2); - -private: - void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; - - Ptr akaze; -}; - -#ifdef HAVE_OPENCV_XFEATURES2D -class CV_EXPORTS SurfFeaturesFinderGpu : public FeaturesFinder -{ -public: - SurfFeaturesFinderGpu(double hess_thresh = 300., int num_octaves = 3, int num_layers = 4, - int num_octaves_descr = 4, int num_layers_descr = 2); - - void collectGarbage() CV_OVERRIDE; - -private: - void find(InputArray image, ImageFeatures &features) CV_OVERRIDE; - - cuda::GpuMat image_; - cuda::GpuMat gray_image_; - cuda::SURF_CUDA surf_; - cuda::GpuMat keypoints_; - cuda::GpuMat descriptors_; - int num_octaves_, num_layers_; - int num_octaves_descr_, num_layers_descr_; -}; -#endif - -/** @brief Structure containing information about matches between two images. - -It's assumed that there is a transformation between those images. Transformation may be -homography or affine transformation based on selected matcher. - -@sa detail::FeaturesMatcher -*/ -struct CV_EXPORTS MatchesInfo -{ - MatchesInfo(); - MatchesInfo(const MatchesInfo &other); - MatchesInfo& operator =(const MatchesInfo &other); - - int src_img_idx, dst_img_idx; //!< Images indices (optional) - std::vector matches; - std::vector inliers_mask; //!< Geometrically consistent matches mask - int num_inliers; //!< Number of geometrically consistent matches - Mat H; //!< Estimated transformation - double confidence; //!< Confidence two images are from the same panorama -}; - -/** @brief Feature matchers base class. */ -class CV_EXPORTS FeaturesMatcher -{ -public: - virtual ~FeaturesMatcher() {} - - /** @overload - @param features1 First image features - @param features2 Second image features - @param matches_info Found matches - */ - void operator ()(const ImageFeatures &features1, const ImageFeatures &features2, - MatchesInfo& matches_info) { match(features1, features2, matches_info); } - - /** @brief Performs images matching. - - @param features Features of the source images - @param pairwise_matches Found pairwise matches - @param mask Mask indicating which image pairs must be matched - - The function is parallelized with the TBB library. - - @sa detail::MatchesInfo - */ - void operator ()(const std::vector &features, std::vector &pairwise_matches, - const cv::UMat &mask = cv::UMat()); - - /** @return True, if it's possible to use the same matcher instance in parallel, false otherwise - */ - bool isThreadSafe() const { return is_thread_safe_; } - - /** @brief Frees unused memory allocated before if there is any. - */ - virtual void collectGarbage() {} - -protected: - FeaturesMatcher(bool is_thread_safe = false) : is_thread_safe_(is_thread_safe) {} - - /** @brief This method must implement matching logic in order to make the wrappers - detail::FeaturesMatcher::operator()_ work. - - @param features1 first image features - @param features2 second image features - @param matches_info found matches - */ - virtual void match(const ImageFeatures &features1, const ImageFeatures &features2, - MatchesInfo& matches_info) = 0; - - bool is_thread_safe_; -}; - -/** @brief Features matcher which finds two best matches for each feature and leaves the best one only if the -ratio between descriptor distances is greater than the threshold match_conf - -@sa detail::FeaturesMatcher - */ -class CV_EXPORTS BestOf2NearestMatcher : public FeaturesMatcher -{ -public: - /** @brief Constructs a "best of 2 nearest" matcher. - - @param try_use_gpu Should try to use GPU or not - @param match_conf Match distances ration threshold - @param num_matches_thresh1 Minimum number of matches required for the 2D projective transform - estimation used in the inliers classification step - @param num_matches_thresh2 Minimum number of matches required for the 2D projective transform - re-estimation on inliers - */ - BestOf2NearestMatcher(bool try_use_gpu = false, float match_conf = 0.3f, int num_matches_thresh1 = 6, - int num_matches_thresh2 = 6); - - void collectGarbage() CV_OVERRIDE; - -protected: - void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE; - - int num_matches_thresh1_; - int num_matches_thresh2_; - Ptr impl_; -}; - -class CV_EXPORTS BestOf2NearestRangeMatcher : public BestOf2NearestMatcher -{ -public: - BestOf2NearestRangeMatcher(int range_width = 5, bool try_use_gpu = false, float match_conf = 0.3f, - int num_matches_thresh1 = 6, int num_matches_thresh2 = 6); - - void operator ()(const std::vector &features, std::vector &pairwise_matches, - const cv::UMat &mask = cv::UMat()); - - -protected: - int range_width_; -}; - -/** @brief Features matcher similar to cv::detail::BestOf2NearestMatcher which -finds two best matches for each feature and leaves the best one only if the -ratio between descriptor distances is greater than the threshold match_conf. - -Unlike cv::detail::BestOf2NearestMatcher this matcher uses affine -transformation (affine trasformation estimate will be placed in matches_info). - -@sa cv::detail::FeaturesMatcher cv::detail::BestOf2NearestMatcher - */ -class CV_EXPORTS AffineBestOf2NearestMatcher : public BestOf2NearestMatcher -{ -public: - /** @brief Constructs a "best of 2 nearest" matcher that expects affine trasformation - between images - - @param full_affine whether to use full affine transformation with 6 degress of freedom or reduced - transformation with 4 degrees of freedom using only rotation, translation and uniform scaling - @param try_use_gpu Should try to use GPU or not - @param match_conf Match distances ration threshold - @param num_matches_thresh1 Minimum number of matches required for the 2D affine transform - estimation used in the inliers classification step - - @sa cv::estimateAffine2D cv::estimateAffinePartial2D - */ - AffineBestOf2NearestMatcher(bool full_affine = false, bool try_use_gpu = false, - float match_conf = 0.3f, int num_matches_thresh1 = 6) : - BestOf2NearestMatcher(try_use_gpu, match_conf, num_matches_thresh1, num_matches_thresh1), - full_affine_(full_affine) {} - -protected: - void match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo &matches_info) CV_OVERRIDE; - - bool full_affine_; -}; - -//! @} stitching_match - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_MATCHERS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/motion_estimators.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/motion_estimators.hpp deleted file mode 100644 index 40f12c3..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/motion_estimators.hpp +++ /dev/null @@ -1,359 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_MOTION_ESTIMATORS_HPP -#define OPENCV_STITCHING_MOTION_ESTIMATORS_HPP - -#include "opencv2/core.hpp" -#include "matchers.hpp" -#include "util.hpp" -#include "camera.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_rotation -//! @{ - -/** @brief Rotation estimator base class. - -It takes features of all images, pairwise matches between all images and estimates rotations of all -cameras. - -@note The coordinate system origin is implementation-dependent, but you can always normalize the -rotations in respect to the first camera, for instance. : - */ -class CV_EXPORTS Estimator -{ -public: - virtual ~Estimator() {} - - /** @brief Estimates camera parameters. - - @param features Features of images - @param pairwise_matches Pairwise matches of images - @param cameras Estimated camera parameters - @return True in case of success, false otherwise - */ - bool operator ()(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &cameras) - { return estimate(features, pairwise_matches, cameras); } - -protected: - /** @brief This method must implement camera parameters estimation logic in order to make the wrapper - detail::Estimator::operator()_ work. - - @param features Features of images - @param pairwise_matches Pairwise matches of images - @param cameras Estimated camera parameters - @return True in case of success, false otherwise - */ - virtual bool estimate(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &cameras) = 0; -}; - -/** @brief Homography based rotation estimator. - */ -class CV_EXPORTS HomographyBasedEstimator : public Estimator -{ -public: - HomographyBasedEstimator(bool is_focals_estimated = false) - : is_focals_estimated_(is_focals_estimated) {} - -private: - virtual bool estimate(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &cameras) CV_OVERRIDE; - - bool is_focals_estimated_; -}; - -/** @brief Affine transformation based estimator. - -This estimator uses pairwise transformations estimated by matcher to estimate -final transformation for each camera. - -@sa cv::detail::HomographyBasedEstimator - */ -class CV_EXPORTS AffineBasedEstimator : public Estimator -{ -private: - virtual bool estimate(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &cameras) CV_OVERRIDE; -}; - -/** @brief Base class for all camera parameters refinement methods. - */ -class CV_EXPORTS BundleAdjusterBase : public Estimator -{ -public: - const Mat refinementMask() const { return refinement_mask_.clone(); } - void setRefinementMask(const Mat &mask) - { - CV_Assert(mask.type() == CV_8U && mask.size() == Size(3, 3)); - refinement_mask_ = mask.clone(); - } - - double confThresh() const { return conf_thresh_; } - void setConfThresh(double conf_thresh) { conf_thresh_ = conf_thresh; } - - TermCriteria termCriteria() { return term_criteria_; } - void setTermCriteria(const TermCriteria& term_criteria) { term_criteria_ = term_criteria; } - -protected: - /** @brief Construct a bundle adjuster base instance. - - @param num_params_per_cam Number of parameters per camera - @param num_errs_per_measurement Number of error terms (components) per match - */ - BundleAdjusterBase(int num_params_per_cam, int num_errs_per_measurement) - : num_images_(0), total_num_matches_(0), - num_params_per_cam_(num_params_per_cam), - num_errs_per_measurement_(num_errs_per_measurement), - features_(0), pairwise_matches_(0), conf_thresh_(0) - { - setRefinementMask(Mat::ones(3, 3, CV_8U)); - setConfThresh(1.); - setTermCriteria(TermCriteria(TermCriteria::EPS + TermCriteria::COUNT, 1000, DBL_EPSILON)); - } - - // Runs bundle adjustment - virtual bool estimate(const std::vector &features, - const std::vector &pairwise_matches, - std::vector &cameras) CV_OVERRIDE; - - /** @brief Sets initial camera parameter to refine. - - @param cameras Camera parameters - */ - virtual void setUpInitialCameraParams(const std::vector &cameras) = 0; - /** @brief Gets the refined camera parameters. - - @param cameras Refined camera parameters - */ - virtual void obtainRefinedCameraParams(std::vector &cameras) const = 0; - /** @brief Calculates error vector. - - @param err Error column-vector of length total_num_matches \* num_errs_per_measurement - */ - virtual void calcError(Mat &err) = 0; - /** @brief Calculates the cost function jacobian. - - @param jac Jacobian matrix of dimensions - (total_num_matches \* num_errs_per_measurement) x (num_images \* num_params_per_cam) - */ - virtual void calcJacobian(Mat &jac) = 0; - - // 3x3 8U mask, where 0 means don't refine respective parameter, != 0 means refine - Mat refinement_mask_; - - int num_images_; - int total_num_matches_; - - int num_params_per_cam_; - int num_errs_per_measurement_; - - const ImageFeatures *features_; - const MatchesInfo *pairwise_matches_; - - // Threshold to filter out poorly matched image pairs - double conf_thresh_; - - //Levenberg-Marquardt algorithm termination criteria - TermCriteria term_criteria_; - - // Camera parameters matrix (CV_64F) - Mat cam_params_; - - // Connected images pairs - std::vector > edges_; -}; - - -/** @brief Stub bundle adjuster that does nothing. - */ -class CV_EXPORTS NoBundleAdjuster : public BundleAdjusterBase -{ -public: - NoBundleAdjuster() : BundleAdjusterBase(0, 0) {} - -private: - bool estimate(const std::vector &, const std::vector &, - std::vector &) CV_OVERRIDE - { - return true; - } - void setUpInitialCameraParams(const std::vector &) CV_OVERRIDE {} - void obtainRefinedCameraParams(std::vector &) const CV_OVERRIDE {} - void calcError(Mat &) CV_OVERRIDE {} - void calcJacobian(Mat &) CV_OVERRIDE {} -}; - - -/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the reprojection -error squares - -It can estimate focal length, aspect ratio, principal point. -You can affect only on them via the refinement mask. - */ -class CV_EXPORTS BundleAdjusterReproj : public BundleAdjusterBase -{ -public: - BundleAdjusterReproj() : BundleAdjusterBase(7, 2) {} - -private: - void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; - void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; - void calcError(Mat &err) CV_OVERRIDE; - void calcJacobian(Mat &jac) CV_OVERRIDE; - - Mat err1_, err2_; -}; - - -/** @brief Implementation of the camera parameters refinement algorithm which minimizes sum of the distances -between the rays passing through the camera center and a feature. : - -It can estimate focal length. It ignores the refinement mask for now. - */ -class CV_EXPORTS BundleAdjusterRay : public BundleAdjusterBase -{ -public: - BundleAdjusterRay() : BundleAdjusterBase(4, 3) {} - -private: - void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; - void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; - void calcError(Mat &err) CV_OVERRIDE; - void calcJacobian(Mat &jac) CV_OVERRIDE; - - Mat err1_, err2_; -}; - - -/** @brief Bundle adjuster that expects affine transformation -represented in homogeneous coordinates in R for each camera param. Implements -camera parameters refinement algorithm which minimizes sum of the reprojection -error squares - -It estimates all transformation parameters. Refinement mask is ignored. - -@sa AffineBasedEstimator AffineBestOf2NearestMatcher BundleAdjusterAffinePartial - */ -class CV_EXPORTS BundleAdjusterAffine : public BundleAdjusterBase -{ -public: - BundleAdjusterAffine() : BundleAdjusterBase(6, 2) {} - -private: - void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; - void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; - void calcError(Mat &err) CV_OVERRIDE; - void calcJacobian(Mat &jac) CV_OVERRIDE; - - Mat err1_, err2_; -}; - - -/** @brief Bundle adjuster that expects affine transformation with 4 DOF -represented in homogeneous coordinates in R for each camera param. Implements -camera parameters refinement algorithm which minimizes sum of the reprojection -error squares - -It estimates all transformation parameters. Refinement mask is ignored. - -@sa AffineBasedEstimator AffineBestOf2NearestMatcher BundleAdjusterAffine - */ -class CV_EXPORTS BundleAdjusterAffinePartial : public BundleAdjusterBase -{ -public: - BundleAdjusterAffinePartial() : BundleAdjusterBase(4, 2) {} - -private: - void setUpInitialCameraParams(const std::vector &cameras) CV_OVERRIDE; - void obtainRefinedCameraParams(std::vector &cameras) const CV_OVERRIDE; - void calcError(Mat &err) CV_OVERRIDE; - void calcJacobian(Mat &jac) CV_OVERRIDE; - - Mat err1_, err2_; -}; - - -enum WaveCorrectKind -{ - WAVE_CORRECT_HORIZ, - WAVE_CORRECT_VERT -}; - -/** @brief Tries to make panorama more horizontal (or vertical). - -@param rmats Camera rotation matrices. -@param kind Correction kind, see detail::WaveCorrectKind. - */ -void CV_EXPORTS waveCorrect(std::vector &rmats, WaveCorrectKind kind); - - -////////////////////////////////////////////////////////////////////////////// -// Auxiliary functions - -// Returns matches graph representation in DOT language -String CV_EXPORTS matchesGraphAsString(std::vector &pathes, std::vector &pairwise_matches, - float conf_threshold); - -std::vector CV_EXPORTS leaveBiggestComponent( - std::vector &features, - std::vector &pairwise_matches, - float conf_threshold); - -void CV_EXPORTS findMaxSpanningTree( - int num_images, const std::vector &pairwise_matches, - Graph &span_tree, std::vector ¢ers); - -//! @} stitching_rotation - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_MOTION_ESTIMATORS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/seam_finders.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/seam_finders.hpp deleted file mode 100644 index 904f0ec..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/seam_finders.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_SEAM_FINDERS_HPP -#define OPENCV_STITCHING_SEAM_FINDERS_HPP - -#include -#include "opencv2/core.hpp" -#include "opencv2/opencv_modules.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_seam -//! @{ - -/** @brief Base class for a seam estimator. - */ -class CV_EXPORTS SeamFinder -{ -public: - virtual ~SeamFinder() {} - /** @brief Estimates seams. - - @param src Source images - @param corners Source image top-left corners - @param masks Source image masks to update - */ - virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks) = 0; -}; - -/** @brief Stub seam estimator which does nothing. - */ -class CV_EXPORTS NoSeamFinder : public SeamFinder -{ -public: - void find(const std::vector&, const std::vector&, std::vector&) CV_OVERRIDE {} -}; - -/** @brief Base class for all pairwise seam estimators. - */ -class CV_EXPORTS PairwiseSeamFinder : public SeamFinder -{ -public: - virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks) CV_OVERRIDE; - -protected: - void run(); - /** @brief Resolves masks intersection of two specified images in the given ROI. - - @param first First image index - @param second Second image index - @param roi Region of interest - */ - virtual void findInPair(size_t first, size_t second, Rect roi) = 0; - - std::vector images_; - std::vector sizes_; - std::vector corners_; - std::vector masks_; -}; - -/** @brief Voronoi diagram-based seam estimator. - */ -class CV_EXPORTS VoronoiSeamFinder : public PairwiseSeamFinder -{ -public: - virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks) CV_OVERRIDE; - virtual void find(const std::vector &size, const std::vector &corners, - std::vector &masks); -private: - void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE; -}; - - -class CV_EXPORTS DpSeamFinder : public SeamFinder -{ -public: - enum CostFunction { COLOR, COLOR_GRAD }; - - DpSeamFinder(CostFunction costFunc = COLOR); - - CostFunction costFunction() const { return costFunc_; } - void setCostFunction(CostFunction val) { costFunc_ = val; } - - virtual void find(const std::vector &src, const std::vector &corners, - std::vector &masks) CV_OVERRIDE; - -private: - enum ComponentState - { - FIRST = 1, SECOND = 2, INTERS = 4, - INTERS_FIRST = INTERS | FIRST, - INTERS_SECOND = INTERS | SECOND - }; - - class ImagePairLess - { - public: - ImagePairLess(const std::vector &images, const std::vector &corners) - : src_(&images[0]), corners_(&corners[0]) {} - - bool operator() (const std::pair &l, const std::pair &r) const - { - Point c1 = corners_[l.first] + Point(src_[l.first].cols / 2, src_[l.first].rows / 2); - Point c2 = corners_[l.second] + Point(src_[l.second].cols / 2, src_[l.second].rows / 2); - int d1 = (c1 - c2).dot(c1 - c2); - - c1 = corners_[r.first] + Point(src_[r.first].cols / 2, src_[r.first].rows / 2); - c2 = corners_[r.second] + Point(src_[r.second].cols / 2, src_[r.second].rows / 2); - int d2 = (c1 - c2).dot(c1 - c2); - - return d1 < d2; - } - - private: - const Mat *src_; - const Point *corners_; - }; - - class ClosePoints - { - public: - ClosePoints(int minDist) : minDist_(minDist) {} - - bool operator() (const Point &p1, const Point &p2) const - { - int dist2 = (p1.x-p2.x) * (p1.x-p2.x) + (p1.y-p2.y) * (p1.y-p2.y); - return dist2 < minDist_ * minDist_; - } - - private: - int minDist_; - }; - - void process( - const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2); - - void findComponents(); - - void findEdges(); - - void resolveConflicts( - const Mat &image1, const Mat &image2, Point tl1, Point tl2, Mat &mask1, Mat &mask2); - - void computeGradients(const Mat &image1, const Mat &image2); - - bool hasOnlyOneNeighbor(int comp); - - bool closeToContour(int y, int x, const Mat_ &contourMask); - - bool getSeamTips(int comp1, int comp2, Point &p1, Point &p2); - - void computeCosts( - const Mat &image1, const Mat &image2, Point tl1, Point tl2, - int comp, Mat_ &costV, Mat_ &costH); - - bool estimateSeam( - const Mat &image1, const Mat &image2, Point tl1, Point tl2, int comp, - Point p1, Point p2, std::vector &seam, bool &isHorizontal); - - void updateLabelsUsingSeam( - int comp1, int comp2, const std::vector &seam, bool isHorizontalSeam); - - CostFunction costFunc_; - - // processing images pair data - Point unionTl_, unionBr_; - Size unionSize_; - Mat_ mask1_, mask2_; - Mat_ contour1mask_, contour2mask_; - Mat_ gradx1_, grady1_; - Mat_ gradx2_, grady2_; - - // components data - int ncomps_; - Mat_ labels_; - std::vector states_; - std::vector tls_, brs_; - std::vector > contours_; - std::set > edges_; -}; - -/** @brief Base class for all minimum graph-cut-based seam estimators. - */ -class CV_EXPORTS GraphCutSeamFinderBase -{ -public: - enum CostType { COST_COLOR, COST_COLOR_GRAD }; -}; - -/** @brief Minimum graph cut-based seam estimator. See details in @cite V03 . - */ -class CV_EXPORTS GraphCutSeamFinder : public GraphCutSeamFinderBase, public SeamFinder -{ -public: - GraphCutSeamFinder(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f, - float bad_region_penalty = 1000.f); - - ~GraphCutSeamFinder(); - - void find(const std::vector &src, const std::vector &corners, - std::vector &masks) CV_OVERRIDE; - -private: - // To avoid GCGraph dependency - class Impl; - Ptr impl_; -}; - - -#ifdef HAVE_OPENCV_CUDALEGACY -class CV_EXPORTS GraphCutSeamFinderGpu : public GraphCutSeamFinderBase, public PairwiseSeamFinder -{ -public: - GraphCutSeamFinderGpu(int cost_type = COST_COLOR_GRAD, float terminal_cost = 10000.f, - float bad_region_penalty = 1000.f) - : cost_type_(cost_type), terminal_cost_(terminal_cost), - bad_region_penalty_(bad_region_penalty) {} - - void find(const std::vector &src, const std::vector &corners, - std::vector &masks) CV_OVERRIDE; - void findInPair(size_t first, size_t second, Rect roi) CV_OVERRIDE; - -private: - void setGraphWeightsColor(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &mask1, const cv::Mat &mask2, - cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom); - void setGraphWeightsColorGrad(const cv::Mat &img1, const cv::Mat &img2, const cv::Mat &dx1, const cv::Mat &dx2, - const cv::Mat &dy1, const cv::Mat &dy2, const cv::Mat &mask1, const cv::Mat &mask2, - cv::Mat &terminals, cv::Mat &leftT, cv::Mat &rightT, cv::Mat &top, cv::Mat &bottom); - std::vector dx_, dy_; - int cost_type_; - float terminal_cost_; - float bad_region_penalty_; -}; -#endif - -//! @} - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_SEAM_FINDERS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/timelapsers.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/timelapsers.hpp deleted file mode 100644 index 74d797e..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/timelapsers.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - - -#ifndef OPENCV_STITCHING_TIMELAPSERS_HPP -#define OPENCV_STITCHING_TIMELAPSERS_HPP - -#include "opencv2/core.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching -//! @{ - -// Base Timelapser class, takes a sequence of images, applies appropriate shift, stores result in dst_. - -class CV_EXPORTS Timelapser -{ -public: - - enum {AS_IS, CROP}; - - virtual ~Timelapser() {} - - static Ptr createDefault(int type); - - virtual void initialize(const std::vector &corners, const std::vector &sizes); - virtual void process(InputArray img, InputArray mask, Point tl); - virtual const UMat& getDst() {return dst_;} - -protected: - - virtual bool test_point(Point pt); - - UMat dst_; - Rect dst_roi_; -}; - - -class CV_EXPORTS TimelapserCrop : public Timelapser -{ -public: - virtual void initialize(const std::vector &corners, const std::vector &sizes) CV_OVERRIDE; -}; - -//! @} - -} // namespace detail -} // namespace cv - -#endif // OPENCV_STITCHING_TIMELAPSERS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util.hpp deleted file mode 100644 index 78301b8..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_UTIL_HPP -#define OPENCV_STITCHING_UTIL_HPP - -#include -#include "opencv2/core.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching -//! @{ - -class CV_EXPORTS DisjointSets -{ -public: - DisjointSets(int elem_count = 0) { createOneElemSets(elem_count); } - - void createOneElemSets(int elem_count); - int findSetByElem(int elem); - int mergeSets(int set1, int set2); - - std::vector parent; - std::vector size; - -private: - std::vector rank_; -}; - - -struct CV_EXPORTS GraphEdge -{ - GraphEdge(int from, int to, float weight); - bool operator <(const GraphEdge& other) const { return weight < other.weight; } - bool operator >(const GraphEdge& other) const { return weight > other.weight; } - - int from, to; - float weight; -}; - -inline GraphEdge::GraphEdge(int _from, int _to, float _weight) : from(_from), to(_to), weight(_weight) {} - - -class CV_EXPORTS Graph -{ -public: - Graph(int num_vertices = 0) { create(num_vertices); } - void create(int num_vertices) { edges_.assign(num_vertices, std::list()); } - int numVertices() const { return static_cast(edges_.size()); } - void addEdge(int from, int to, float weight); - template B forEach(B body) const; - template B walkBreadthFirst(int from, B body) const; - -private: - std::vector< std::list > edges_; -}; - - -////////////////////////////////////////////////////////////////////////////// -// Auxiliary functions - -CV_EXPORTS bool overlapRoi(Point tl1, Point tl2, Size sz1, Size sz2, Rect &roi); -CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &images); -CV_EXPORTS Rect resultRoi(const std::vector &corners, const std::vector &sizes); -CV_EXPORTS Rect resultRoiIntersection(const std::vector &corners, const std::vector &sizes); -CV_EXPORTS Point resultTl(const std::vector &corners); - -// Returns random 'count' element subset of the {0,1,...,size-1} set -CV_EXPORTS void selectRandomSubset(int count, int size, std::vector &subset); - -CV_EXPORTS int& stitchingLogLevel(); - -//! @} - -} // namespace detail -} // namespace cv - -#include "util_inl.hpp" - -#endif // OPENCV_STITCHING_UTIL_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util_inl.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util_inl.hpp deleted file mode 100644 index dafab8b..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/util_inl.hpp +++ /dev/null @@ -1,131 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_UTIL_INL_HPP -#define OPENCV_STITCHING_UTIL_INL_HPP - -#include -#include "opencv2/core.hpp" -#include "util.hpp" // Make your IDE see declarations - -//! @cond IGNORED - -namespace cv { -namespace detail { - -template -B Graph::forEach(B body) const -{ - for (int i = 0; i < numVertices(); ++i) - { - std::list::const_iterator edge = edges_[i].begin(); - for (; edge != edges_[i].end(); ++edge) - body(*edge); - } - return body; -} - - -template -B Graph::walkBreadthFirst(int from, B body) const -{ - std::vector was(numVertices(), false); - std::queue vertices; - - was[from] = true; - vertices.push(from); - - while (!vertices.empty()) - { - int vertex = vertices.front(); - vertices.pop(); - - std::list::const_iterator edge = edges_[vertex].begin(); - for (; edge != edges_[vertex].end(); ++edge) - { - if (!was[edge->to]) - { - body(*edge); - was[edge->to] = true; - vertices.push(edge->to); - } - } - } - - return body; -} - - -////////////////////////////////////////////////////////////////////////////// -// Some auxiliary math functions - -static inline -float normL2(const Point3f& a) -{ - return a.x * a.x + a.y * a.y + a.z * a.z; -} - - -static inline -float normL2(const Point3f& a, const Point3f& b) -{ - return normL2(a - b); -} - - -static inline -double normL2sq(const Mat &r) -{ - return r.dot(r); -} - - -static inline int sqr(int x) { return x * x; } -static inline float sqr(float x) { return x * x; } -static inline double sqr(double x) { return x * x; } - -} // namespace detail -} // namespace cv - -//! @endcond - -#endif // OPENCV_STITCHING_UTIL_INL_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers.hpp deleted file mode 100644 index 1b05651..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers.hpp +++ /dev/null @@ -1,616 +0,0 @@ - /*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_WARPERS_HPP -#define OPENCV_STITCHING_WARPERS_HPP - -#include "opencv2/core.hpp" -#include "opencv2/core/cuda.hpp" -#include "opencv2/imgproc.hpp" -#include "opencv2/opencv_modules.hpp" - -namespace cv { -namespace detail { - -//! @addtogroup stitching_warp -//! @{ - -/** @brief Rotation-only model image warper interface. - */ -class CV_EXPORTS RotationWarper -{ -public: - virtual ~RotationWarper() {} - - /** @brief Projects the image point. - - @param pt Source point - @param K Camera intrinsic parameters - @param R Camera rotation matrix - @return Projected point - */ - virtual Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) = 0; - - /** @brief Builds the projection maps according to the given camera data. - - @param src_size Source image size - @param K Camera intrinsic parameters - @param R Camera rotation matrix - @param xmap Projection map for the x axis - @param ymap Projection map for the y axis - @return Projected image minimum bounding box - */ - virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) = 0; - - /** @brief Projects the image. - - @param src Source image - @param K Camera intrinsic parameters - @param R Camera rotation matrix - @param interp_mode Interpolation mode - @param border_mode Border extrapolation mode - @param dst Projected image - @return Project image top-left corner - */ - virtual Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) = 0; - - /** @brief Projects the image backward. - - @param src Projected image - @param K Camera intrinsic parameters - @param R Camera rotation matrix - @param interp_mode Interpolation mode - @param border_mode Border extrapolation mode - @param dst_size Backward-projected image size - @param dst Backward-projected image - */ - virtual void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - Size dst_size, OutputArray dst) = 0; - - /** - @param src_size Source image bounding box - @param K Camera intrinsic parameters - @param R Camera rotation matrix - @return Projected image minimum bounding box - */ - virtual Rect warpRoi(Size src_size, InputArray K, InputArray R) = 0; - - virtual float getScale() const { return 1.f; } - virtual void setScale(float) {} -}; - -/** @brief Base class for warping logic implementation. - */ -struct CV_EXPORTS ProjectorBase -{ - void setCameraParams(InputArray K = Mat::eye(3, 3, CV_32F), - InputArray R = Mat::eye(3, 3, CV_32F), - InputArray T = Mat::zeros(3, 1, CV_32F)); - - float scale; - float k[9]; - float rinv[9]; - float r_kinv[9]; - float k_rinv[9]; - float t[3]; -}; - -/** @brief Base class for rotation-based warper using a detail::ProjectorBase_ derived class. - */ -template -class CV_EXPORTS_TEMPLATE RotationWarperBase : public RotationWarper -{ -public: - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; - - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) CV_OVERRIDE; - - void warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - Size dst_size, OutputArray dst) CV_OVERRIDE; - - Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; - - float getScale() const CV_OVERRIDE{ return projector_.scale; } - void setScale(float val) CV_OVERRIDE { projector_.scale = val; } - -protected: - - // Detects ROI of the destination image. It's correct for any projection. - virtual void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br); - - // Detects ROI of the destination image by walking over image border. - // Correctness for any projection isn't guaranteed. - void detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br); - - P projector_; -}; - - -struct CV_EXPORTS PlaneProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - -/** @brief Warper that maps an image onto the z = 1 plane. - */ -class CV_EXPORTS PlaneWarper : public RotationWarperBase -{ -public: - /** @brief Construct an instance of the plane warper class. - - @param scale Projected image scale multiplier - */ - PlaneWarper(float scale = 1.f) { projector_.scale = scale; } - - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R, InputArray T); - - virtual Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap); - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; - - Point warp(InputArray src, InputArray K, InputArray R, - int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; - virtual Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, - OutputArray dst); - - Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; - Rect warpRoi(Size src_size, InputArray K, InputArray R, InputArray T); - -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; -}; - - -/** @brief Affine warper that uses rotations and translations - - Uses affine transformation in homogeneous coordinates to represent both rotation and - translation in camera rotation matrix. - */ -class CV_EXPORTS AffineWarper : public PlaneWarper -{ -public: - /** @brief Construct an instance of the affine warper class. - - @param scale Projected image scale multiplier - */ - AffineWarper(float scale = 1.f) : PlaneWarper(scale) {} - - Point2f warpPoint(const Point2f &pt, InputArray K, InputArray R) CV_OVERRIDE; - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; - Point warp(InputArray src, InputArray K, InputArray R, - int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; - Rect warpRoi(Size src_size, InputArray K, InputArray R) CV_OVERRIDE; - -protected: - /** @brief Extracts rotation and translation matrices from matrix H representing - affine transformation in homogeneous coordinates - */ - void getRTfromHomogeneous(InputArray H, Mat &R, Mat &T); -}; - - -struct CV_EXPORTS SphericalProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -/** @brief Warper that maps an image onto the unit sphere located at the origin. - - Projects image onto unit sphere with origin at (0, 0, 0) and radius scale, measured in pixels. - A 360 panorama would therefore have a resulting width of 2 * scale * PI pixels. - Poles are located at (0, -1, 0) and (0, 1, 0) points. -*/ -class CV_EXPORTS SphericalWarper : public RotationWarperBase -{ -public: - /** @brief Construct an instance of the spherical warper class. - - @param scale Radius of the projected sphere, in pixels. An image spanning the - whole sphere will have a width of 2 * scale * PI pixels. - */ - SphericalWarper(float scale) { projector_.scale = scale; } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; -}; - - -struct CV_EXPORTS CylindricalProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -/** @brief Warper that maps an image onto the x\*x + z\*z = 1 cylinder. - */ -class CV_EXPORTS CylindricalWarper : public RotationWarperBase -{ -public: - /** @brief Construct an instance of the cylindrical warper class. - - @param scale Projected image scale multiplier - */ - CylindricalWarper(float scale) { projector_.scale = scale; } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE; - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, OutputArray dst) CV_OVERRIDE; -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE - { - RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); - } -}; - - -struct CV_EXPORTS FisheyeProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS FisheyeWarper : public RotationWarperBase -{ -public: - FisheyeWarper(float scale) { projector_.scale = scale; } -}; - - -struct CV_EXPORTS StereographicProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS StereographicWarper : public RotationWarperBase -{ -public: - StereographicWarper(float scale) { projector_.scale = scale; } -}; - - -struct CV_EXPORTS CompressedRectilinearProjector : ProjectorBase -{ - float a, b; - - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS CompressedRectilinearWarper : public RotationWarperBase -{ -public: - CompressedRectilinearWarper(float scale, float A = 1, float B = 1) - { - projector_.a = A; - projector_.b = B; - projector_.scale = scale; - } -}; - - -struct CV_EXPORTS CompressedRectilinearPortraitProjector : ProjectorBase -{ - float a, b; - - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS CompressedRectilinearPortraitWarper : public RotationWarperBase -{ -public: - CompressedRectilinearPortraitWarper(float scale, float A = 1, float B = 1) - { - projector_.a = A; - projector_.b = B; - projector_.scale = scale; - } -}; - - -struct CV_EXPORTS PaniniProjector : ProjectorBase -{ - float a, b; - - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS PaniniWarper : public RotationWarperBase -{ -public: - PaniniWarper(float scale, float A = 1, float B = 1) - { - projector_.a = A; - projector_.b = B; - projector_.scale = scale; - } -}; - - -struct CV_EXPORTS PaniniPortraitProjector : ProjectorBase -{ - float a, b; - - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS PaniniPortraitWarper : public RotationWarperBase -{ -public: - PaniniPortraitWarper(float scale, float A = 1, float B = 1) - { - projector_.a = A; - projector_.b = B; - projector_.scale = scale; - } - -}; - - -struct CV_EXPORTS MercatorProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS MercatorWarper : public RotationWarperBase -{ -public: - MercatorWarper(float scale) { projector_.scale = scale; } -}; - - -struct CV_EXPORTS TransverseMercatorProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS TransverseMercatorWarper : public RotationWarperBase -{ -public: - TransverseMercatorWarper(float scale) { projector_.scale = scale; } -}; - - -class CV_EXPORTS PlaneWarperGpu : public PlaneWarper -{ -public: - PlaneWarperGpu(float scale = 1.f) : PlaneWarper(scale) {} - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE - { - Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); - d_xmap_.download(xmap); - d_ymap_.download(ymap); - return result; - } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, OutputArray xmap, OutputArray ymap) CV_OVERRIDE - { - Rect result = buildMaps(src_size, K, R, T, d_xmap_, d_ymap_); - d_xmap_.download(xmap); - d_ymap_.download(ymap); - return result; - } - - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) CV_OVERRIDE - { - d_src_.upload(src); - Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); - d_dst_.download(dst); - return result; - } - - Point warp(InputArray src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, - OutputArray dst) CV_OVERRIDE - { - d_src_.upload(src); - Point result = warp(d_src_, K, R, T, interp_mode, border_mode, d_dst_); - d_dst_.download(dst); - return result; - } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); - - Rect buildMaps(Size src_size, InputArray K, InputArray R, InputArray T, cuda::GpuMat & xmap, cuda::GpuMat & ymap); - - Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, - cuda::GpuMat & dst); - - Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, InputArray T, int interp_mode, int border_mode, - cuda::GpuMat & dst); - -private: - cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; -}; - - -class CV_EXPORTS SphericalWarperGpu : public SphericalWarper -{ -public: - SphericalWarperGpu(float scale) : SphericalWarper(scale) {} - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE - { - Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); - d_xmap_.download(xmap); - d_ymap_.download(ymap); - return result; - } - - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) CV_OVERRIDE - { - d_src_.upload(src); - Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); - d_dst_.download(dst); - return result; - } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); - - Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, - cuda::GpuMat & dst); - -private: - cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; -}; - - -class CV_EXPORTS CylindricalWarperGpu : public CylindricalWarper -{ -public: - CylindricalWarperGpu(float scale) : CylindricalWarper(scale) {} - - Rect buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) CV_OVERRIDE - { - Rect result = buildMaps(src_size, K, R, d_xmap_, d_ymap_); - d_xmap_.download(xmap); - d_ymap_.download(ymap); - return result; - } - - Point warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) CV_OVERRIDE - { - d_src_.upload(src); - Point result = warp(d_src_, K, R, interp_mode, border_mode, d_dst_); - d_dst_.download(dst); - return result; - } - - Rect buildMaps(Size src_size, InputArray K, InputArray R, cuda::GpuMat & xmap, cuda::GpuMat & ymap); - - Point warp(const cuda::GpuMat & src, InputArray K, InputArray R, int interp_mode, int border_mode, - cuda::GpuMat & dst); - -private: - cuda::GpuMat d_xmap_, d_ymap_, d_src_, d_dst_; -}; - - -struct CV_EXPORTS SphericalPortraitProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -// Projects image onto unit sphere with origin at (0, 0, 0). -// Poles are located NOT at (0, -1, 0) and (0, 1, 0) points, BUT at (1, 0, 0) and (-1, 0, 0) points. -class CV_EXPORTS SphericalPortraitWarper : public RotationWarperBase -{ -public: - SphericalPortraitWarper(float scale) { projector_.scale = scale; } - -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE; -}; - -struct CV_EXPORTS CylindricalPortraitProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS CylindricalPortraitWarper : public RotationWarperBase -{ -public: - CylindricalPortraitWarper(float scale) { projector_.scale = scale; } - -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE - { - RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); - } -}; - -struct CV_EXPORTS PlanePortraitProjector : ProjectorBase -{ - void mapForward(float x, float y, float &u, float &v); - void mapBackward(float u, float v, float &x, float &y); -}; - - -class CV_EXPORTS PlanePortraitWarper : public RotationWarperBase -{ -public: - PlanePortraitWarper(float scale) { projector_.scale = scale; } - -protected: - void detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) CV_OVERRIDE - { - RotationWarperBase::detectResultRoiByBorder(src_size, dst_tl, dst_br); - } -}; - -//! @} stitching_warp - -} // namespace detail -} // namespace cv - -#include "warpers_inl.hpp" - -#endif // OPENCV_STITCHING_WARPERS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers_inl.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers_inl.hpp deleted file mode 100644 index f4a19d9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/detail/warpers_inl.hpp +++ /dev/null @@ -1,774 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_WARPERS_INL_HPP -#define OPENCV_STITCHING_WARPERS_INL_HPP - -#include "opencv2/core.hpp" -#include "warpers.hpp" // Make your IDE see declarations -#include - -//! @cond IGNORED - -namespace cv { -namespace detail { - -template -Point2f RotationWarperBase

::warpPoint(const Point2f &pt, InputArray K, InputArray R) -{ - projector_.setCameraParams(K, R); - Point2f uv; - projector_.mapForward(pt.x, pt.y, uv.x, uv.y); - return uv; -} - - -template -Rect RotationWarperBase

::buildMaps(Size src_size, InputArray K, InputArray R, OutputArray _xmap, OutputArray _ymap) -{ - projector_.setCameraParams(K, R); - - Point dst_tl, dst_br; - detectResultRoi(src_size, dst_tl, dst_br); - - _xmap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F); - _ymap.create(dst_br.y - dst_tl.y + 1, dst_br.x - dst_tl.x + 1, CV_32F); - - Mat xmap = _xmap.getMat(), ymap = _ymap.getMat(); - - float x, y; - for (int v = dst_tl.y; v <= dst_br.y; ++v) - { - for (int u = dst_tl.x; u <= dst_br.x; ++u) - { - projector_.mapBackward(static_cast(u), static_cast(v), x, y); - xmap.at(v - dst_tl.y, u - dst_tl.x) = x; - ymap.at(v - dst_tl.y, u - dst_tl.x) = y; - } - } - - return Rect(dst_tl, dst_br); -} - - -template -Point RotationWarperBase

::warp(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - OutputArray dst) -{ - UMat xmap, ymap; - Rect dst_roi = buildMaps(src.size(), K, R, xmap, ymap); - - dst.create(dst_roi.height + 1, dst_roi.width + 1, src.type()); - remap(src, dst, xmap, ymap, interp_mode, border_mode); - - return dst_roi.tl(); -} - - -template -void RotationWarperBase

::warpBackward(InputArray src, InputArray K, InputArray R, int interp_mode, int border_mode, - Size dst_size, OutputArray dst) -{ - projector_.setCameraParams(K, R); - - Point src_tl, src_br; - detectResultRoi(dst_size, src_tl, src_br); - - Size size = src.size(); - CV_Assert(src_br.x - src_tl.x + 1 == size.width && src_br.y - src_tl.y + 1 == size.height); - - Mat xmap(dst_size, CV_32F); - Mat ymap(dst_size, CV_32F); - - float u, v; - for (int y = 0; y < dst_size.height; ++y) - { - for (int x = 0; x < dst_size.width; ++x) - { - projector_.mapForward(static_cast(x), static_cast(y), u, v); - xmap.at(y, x) = u - src_tl.x; - ymap.at(y, x) = v - src_tl.y; - } - } - - dst.create(dst_size, src.type()); - remap(src, dst, xmap, ymap, interp_mode, border_mode); -} - - -template -Rect RotationWarperBase

::warpRoi(Size src_size, InputArray K, InputArray R) -{ - projector_.setCameraParams(K, R); - - Point dst_tl, dst_br; - detectResultRoi(src_size, dst_tl, dst_br); - - return Rect(dst_tl, Point(dst_br.x + 1, dst_br.y + 1)); -} - - -template -void RotationWarperBase

::detectResultRoi(Size src_size, Point &dst_tl, Point &dst_br) -{ - float tl_uf = (std::numeric_limits::max)(); - float tl_vf = (std::numeric_limits::max)(); - float br_uf = -(std::numeric_limits::max)(); - float br_vf = -(std::numeric_limits::max)(); - - float u, v; - for (int y = 0; y < src_size.height; ++y) - { - for (int x = 0; x < src_size.width; ++x) - { - projector_.mapForward(static_cast(x), static_cast(y), u, v); - tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); - br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); - } - } - - dst_tl.x = static_cast(tl_uf); - dst_tl.y = static_cast(tl_vf); - dst_br.x = static_cast(br_uf); - dst_br.y = static_cast(br_vf); -} - - -template -void RotationWarperBase

::detectResultRoiByBorder(Size src_size, Point &dst_tl, Point &dst_br) -{ - float tl_uf = (std::numeric_limits::max)(); - float tl_vf = (std::numeric_limits::max)(); - float br_uf = -(std::numeric_limits::max)(); - float br_vf = -(std::numeric_limits::max)(); - - float u, v; - for (float x = 0; x < src_size.width; ++x) - { - projector_.mapForward(static_cast(x), 0, u, v); - tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); - br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); - - projector_.mapForward(static_cast(x), static_cast(src_size.height - 1), u, v); - tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); - br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); - } - for (int y = 0; y < src_size.height; ++y) - { - projector_.mapForward(0, static_cast(y), u, v); - tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); - br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); - - projector_.mapForward(static_cast(src_size.width - 1), static_cast(y), u, v); - tl_uf = (std::min)(tl_uf, u); tl_vf = (std::min)(tl_vf, v); - br_uf = (std::max)(br_uf, u); br_vf = (std::max)(br_vf, v); - } - - dst_tl.x = static_cast(tl_uf); - dst_tl.y = static_cast(tl_vf); - dst_br.x = static_cast(br_uf); - dst_br.y = static_cast(br_vf); -} - - -inline -void PlaneProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - x_ = t[0] + x_ / z_ * (1 - t[2]); - y_ = t[1] + y_ / z_ * (1 - t[2]); - - u = scale * x_; - v = scale * y_; -} - - -inline -void PlaneProjector::mapBackward(float u, float v, float &x, float &y) -{ - u = u / scale - t[0]; - v = v / scale - t[1]; - - float z; - x = k_rinv[0] * u + k_rinv[1] * v + k_rinv[2] * (1 - t[2]); - y = k_rinv[3] * u + k_rinv[4] * v + k_rinv[5] * (1 - t[2]); - z = k_rinv[6] * u + k_rinv[7] * v + k_rinv[8] * (1 - t[2]); - - x /= z; - y /= z; -} - - -inline -void SphericalProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - u = scale * atan2f(x_, z_); - float w = y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_); - v = scale * (static_cast(CV_PI) - acosf(w == w ? w : 0)); -} - - -inline -void SphericalProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float sinv = sinf(static_cast(CV_PI) - v); - float x_ = sinv * sinf(u); - float y_ = cosf(static_cast(CV_PI) - v); - float z_ = sinv * cosf(u); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - - -inline -void CylindricalProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - u = scale * atan2f(x_, z_); - v = scale * y_ / sqrtf(x_ * x_ + z_ * z_); -} - - -inline -void CylindricalProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float x_ = sinf(u); - float y_ = v; - float z_ = cosf(u); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void FisheyeProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - u = scale * v_ * cosf(u_); - v = scale * v_ * sinf(u_); -} - -inline -void FisheyeProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float u_ = atan2f(v, u); - float v_ = sqrtf(u*u + v*v); - - float sinv = sinf((float)CV_PI - v_); - float x_ = sinv * sinf(u_); - float y_ = cosf((float)CV_PI - v_); - float z_ = sinv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void StereographicProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = (float)CV_PI - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - float r = sinf(v_) / (1 - cosf(v_)); - - u = scale * r * cos(u_); - v = scale * r * sin(u_); -} - -inline -void StereographicProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float u_ = atan2f(v, u); - float r = sqrtf(u*u + v*v); - float v_ = 2 * atanf(1.f / r); - - float sinv = sinf((float)CV_PI - v_); - float x_ = sinv * sinf(u_); - float y_ = cosf((float)CV_PI - v_); - float z_ = sinv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void CompressedRectilinearProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - u = scale * a * tanf(u_ / a); - v = scale * b * tanf(v_) / cosf(u_); -} - -inline -void CompressedRectilinearProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float aatg = a * atanf(u / a); - float u_ = aatg; - float v_ = atanf(v * cosf(aatg) / b); - - float cosv = cosf(v_); - float x_ = cosv * sinf(u_); - float y_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void CompressedRectilinearPortraitProjector::mapForward(float x, float y, float &u, float &v) -{ - float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - u = - scale * a * tanf(u_ / a); - v = scale * b * tanf(v_) / cosf(u_); -} - -inline -void CompressedRectilinearPortraitProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= - scale; - v /= scale; - - float aatg = a * atanf(u / a); - float u_ = aatg; - float v_ = atanf(v * cosf( aatg ) / b); - - float cosv = cosf(v_); - float y_ = cosv * sinf(u_); - float x_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void PaniniProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - float tg = a * tanf(u_ / a); - u = scale * tg; - - float sinu = sinf(u_); - if ( fabs(sinu) < 1E-7 ) - v = scale * b * tanf(v_); - else - v = scale * b * tg * tanf(v_) / sinu; -} - -inline -void PaniniProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float lamda = a * atanf(u / a); - float u_ = lamda; - - float v_; - if ( fabs(lamda) > 1E-7) - v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda / a))); - else - v_ = atanf(v / b); - - float cosv = cosf(v_); - float x_ = cosv * sinf(u_); - float y_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void PaniniPortraitProjector::mapForward(float x, float y, float &u, float &v) -{ - float y_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float x_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - float tg = a * tanf(u_ / a); - u = - scale * tg; - - float sinu = sinf( u_ ); - if ( fabs(sinu) < 1E-7 ) - v = scale * b * tanf(v_); - else - v = scale * b * tg * tanf(v_) / sinu; -} - -inline -void PaniniPortraitProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= - scale; - v /= scale; - - float lamda = a * atanf(u / a); - float u_ = lamda; - - float v_; - if ( fabs(lamda) > 1E-7) - v_ = atanf(v * sinf(lamda) / (b * a * tanf(lamda/a))); - else - v_ = atanf(v / b); - - float cosv = cosf(v_); - float y_ = cosv * sinf(u_); - float x_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void MercatorProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - u = scale * u_; - v = scale * logf( tanf( (float)(CV_PI/4) + v_/2 ) ); -} - -inline -void MercatorProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float v_ = atanf( sinhf(v) ); - float u_ = u; - - float cosv = cosf(v_); - float x_ = cosv * sinf(u_); - float y_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void TransverseMercatorProjector::mapForward(float x, float y, float &u, float &v) -{ - float x_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float u_ = atan2f(x_, z_); - float v_ = asinf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_)); - - float B = cosf(v_) * sinf(u_); - - u = scale / 2 * logf( (1+B) / (1-B) ); - v = scale * atan2f(tanf(v_), cosf(u_)); -} - -inline -void TransverseMercatorProjector::mapBackward(float u, float v, float &x, float &y) -{ - u /= scale; - v /= scale; - - float v_ = asinf( sinf(v) / coshf(u) ); - float u_ = atan2f( sinhf(u), cos(v) ); - - float cosv = cosf(v_); - float x_ = cosv * sinf(u_); - float y_ = sinf(v_); - float z_ = cosv * cosf(u_); - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void SphericalPortraitProjector::mapForward(float x, float y, float &u0, float &v0) -{ - float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float x_ = y0_; - float y_ = x0_; - float u, v; - - u = scale * atan2f(x_, z_); - v = scale * (static_cast(CV_PI) - acosf(y_ / sqrtf(x_ * x_ + y_ * y_ + z_ * z_))); - - u0 = -u;//v; - v0 = v;//u; -} - - -inline -void SphericalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y) -{ - float u, v; - u = -u0;//v0; - v = v0;//u0; - - u /= scale; - v /= scale; - - float sinv = sinf(static_cast(CV_PI) - v); - float x0_ = sinv * sinf(u); - float y0_ = cosf(static_cast(CV_PI) - v); - float z_ = sinv * cosf(u); - - float x_ = y0_; - float y_ = x0_; - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void CylindricalPortraitProjector::mapForward(float x, float y, float &u0, float &v0) -{ - float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float x_ = y0_; - float y_ = x0_; - float u, v; - - u = scale * atan2f(x_, z_); - v = scale * y_ / sqrtf(x_ * x_ + z_ * z_); - - u0 = -u;//v; - v0 = v;//u; -} - - -inline -void CylindricalPortraitProjector::mapBackward(float u0, float v0, float &x, float &y) -{ - float u, v; - u = -u0;//v0; - v = v0;//u0; - - u /= scale; - v /= scale; - - float x0_ = sinf(u); - float y0_ = v; - float z_ = cosf(u); - - float x_ = y0_; - float y_ = x0_; - - float z; - x = k_rinv[0] * x_ + k_rinv[1] * y_ + k_rinv[2] * z_; - y = k_rinv[3] * x_ + k_rinv[4] * y_ + k_rinv[5] * z_; - z = k_rinv[6] * x_ + k_rinv[7] * y_ + k_rinv[8] * z_; - - if (z > 0) { x /= z; y /= z; } - else x = y = -1; -} - -inline -void PlanePortraitProjector::mapForward(float x, float y, float &u0, float &v0) -{ - float x0_ = r_kinv[0] * x + r_kinv[1] * y + r_kinv[2]; - float y0_ = r_kinv[3] * x + r_kinv[4] * y + r_kinv[5]; - float z_ = r_kinv[6] * x + r_kinv[7] * y + r_kinv[8]; - - float x_ = y0_; - float y_ = x0_; - - x_ = t[0] + x_ / z_ * (1 - t[2]); - y_ = t[1] + y_ / z_ * (1 - t[2]); - - float u,v; - u = scale * x_; - v = scale * y_; - - u0 = -u; - v0 = v; -} - - -inline -void PlanePortraitProjector::mapBackward(float u0, float v0, float &x, float &y) -{ - float u, v; - u = -u0; - v = v0; - - u = u / scale - t[0]; - v = v / scale - t[1]; - - float z; - x = k_rinv[0] * v + k_rinv[1] * u + k_rinv[2] * (1 - t[2]); - y = k_rinv[3] * v + k_rinv[4] * u + k_rinv[5] * (1 - t[2]); - z = k_rinv[6] * v + k_rinv[7] * u + k_rinv[8] * (1 - t[2]); - - x /= z; - y /= z; -} - - -} // namespace detail -} // namespace cv - -//! @endcond - -#endif // OPENCV_STITCHING_WARPERS_INL_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/stitching/warpers.hpp b/qt-correction-tool/pub/opencv/include/opencv2/stitching/warpers.hpp deleted file mode 100644 index cf7699c..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/stitching/warpers.hpp +++ /dev/null @@ -1,192 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_STITCHING_WARPER_CREATORS_HPP -#define OPENCV_STITCHING_WARPER_CREATORS_HPP - -#include "opencv2/stitching/detail/warpers.hpp" - -namespace cv { - -//! @addtogroup stitching_warp -//! @{ - -/** @brief Image warper factories base class. - */ -class WarperCreator -{ -public: - virtual ~WarperCreator() {} - virtual Ptr create(float scale) const = 0; -}; - -/** @brief Plane warper factory class. - @sa detail::PlaneWarper - */ -class PlaneWarper : public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -/** @brief Affine warper factory class. - @sa detail::AffineWarper - */ -class AffineWarper : public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -/** @brief Cylindrical warper factory class. -@sa detail::CylindricalWarper -*/ -class CylindricalWarper: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -/** @brief Spherical warper factory class */ -class SphericalWarper: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -class FisheyeWarper : public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -class StereographicWarper: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -class CompressedRectilinearWarper: public WarperCreator -{ - float a, b; -public: - CompressedRectilinearWarper(float A = 1, float B = 1) - { - a = A; b = B; - } - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } -}; - -class CompressedRectilinearPortraitWarper: public WarperCreator -{ - float a, b; -public: - CompressedRectilinearPortraitWarper(float A = 1, float B = 1) - { - a = A; b = B; - } - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } -}; - -class PaniniWarper: public WarperCreator -{ - float a, b; -public: - PaniniWarper(float A = 1, float B = 1) - { - a = A; b = B; - } - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } -}; - -class PaniniPortraitWarper: public WarperCreator -{ - float a, b; -public: - PaniniPortraitWarper(float A = 1, float B = 1) - { - a = A; b = B; - } - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale, a, b); } -}; - -class MercatorWarper: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - -class TransverseMercatorWarper: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - - - -#ifdef HAVE_OPENCV_CUDAWARPING -class PlaneWarperGpu: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - - -class CylindricalWarperGpu: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; - - -class SphericalWarperGpu: public WarperCreator -{ -public: - Ptr create(float scale) const CV_OVERRIDE { return makePtr(scale); } -}; -#endif - -//! @} stitching_warp - -} // namespace cv - -#endif // OPENCV_STITCHING_WARPER_CREATORS_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/superres.hpp b/qt-correction-tool/pub/opencv/include/opencv2/superres.hpp deleted file mode 100644 index 16c11ac..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/superres.hpp +++ /dev/null @@ -1,207 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_SUPERRES_HPP -#define OPENCV_SUPERRES_HPP - -#include "opencv2/core.hpp" -#include "opencv2/superres/optical_flow.hpp" - -/** - @defgroup superres Super Resolution - -The Super Resolution module contains a set of functions and classes that can be used to solve the -problem of resolution enhancement. There are a few methods implemented, most of them are described in -the papers @cite Farsiu03 and @cite Mitzel09 . - - */ - -namespace cv -{ - namespace superres - { - -//! @addtogroup superres -//! @{ - - class CV_EXPORTS FrameSource - { - public: - virtual ~FrameSource(); - - virtual void nextFrame(OutputArray frame) = 0; - virtual void reset() = 0; - }; - - CV_EXPORTS Ptr createFrameSource_Empty(); - - CV_EXPORTS Ptr createFrameSource_Video(const String& fileName); - CV_EXPORTS Ptr createFrameSource_Video_CUDA(const String& fileName); - - CV_EXPORTS Ptr createFrameSource_Camera(int deviceId = 0); - - /** @brief Base class for Super Resolution algorithms. - - The class is only used to define the common interface for the whole family of Super Resolution - algorithms. - */ - class CV_EXPORTS SuperResolution : public cv::Algorithm, public FrameSource - { - public: - /** @brief Set input frame source for Super Resolution algorithm. - - @param frameSource Input frame source - */ - void setInput(const Ptr& frameSource); - - /** @brief Process next frame from input and return output result. - - @param frame Output result - */ - void nextFrame(OutputArray frame) CV_OVERRIDE; - void reset() CV_OVERRIDE; - - /** @brief Clear all inner buffers. - */ - virtual void collectGarbage(); - - //! @brief Scale factor - /** @see setScale */ - virtual int getScale() const = 0; - /** @copybrief getScale @see getScale */ - virtual void setScale(int val) = 0; - - //! @brief Iterations count - /** @see setIterations */ - virtual int getIterations() const = 0; - /** @copybrief getIterations @see getIterations */ - virtual void setIterations(int val) = 0; - - //! @brief Asymptotic value of steepest descent method - /** @see setTau */ - virtual double getTau() const = 0; - /** @copybrief getTau @see getTau */ - virtual void setTau(double val) = 0; - - //! @brief Weight parameter to balance data term and smoothness term - /** @see setLabmda */ - virtual double getLabmda() const = 0; - /** @copybrief getLabmda @see getLabmda */ - virtual void setLabmda(double val) = 0; - - //! @brief Parameter of spacial distribution in Bilateral-TV - /** @see setAlpha */ - virtual double getAlpha() const = 0; - /** @copybrief getAlpha @see getAlpha */ - virtual void setAlpha(double val) = 0; - - //! @brief Kernel size of Bilateral-TV filter - /** @see setKernelSize */ - virtual int getKernelSize() const = 0; - /** @copybrief getKernelSize @see getKernelSize */ - virtual void setKernelSize(int val) = 0; - - //! @brief Gaussian blur kernel size - /** @see setBlurKernelSize */ - virtual int getBlurKernelSize() const = 0; - /** @copybrief getBlurKernelSize @see getBlurKernelSize */ - virtual void setBlurKernelSize(int val) = 0; - - //! @brief Gaussian blur sigma - /** @see setBlurSigma */ - virtual double getBlurSigma() const = 0; - /** @copybrief getBlurSigma @see getBlurSigma */ - virtual void setBlurSigma(double val) = 0; - - //! @brief Radius of the temporal search area - /** @see setTemporalAreaRadius */ - virtual int getTemporalAreaRadius() const = 0; - /** @copybrief getTemporalAreaRadius @see getTemporalAreaRadius */ - virtual void setTemporalAreaRadius(int val) = 0; - - //! @brief Dense optical flow algorithm - /** @see setOpticalFlow */ - virtual Ptr getOpticalFlow() const = 0; - /** @copybrief getOpticalFlow @see getOpticalFlow */ - virtual void setOpticalFlow(const Ptr &val) = 0; - - protected: - SuperResolution(); - - virtual void initImpl(Ptr& frameSource) = 0; - virtual void processImpl(Ptr& frameSource, OutputArray output) = 0; - - bool isUmat_; - - private: - Ptr frameSource_; - bool firstCall_; - }; - - /** @brief Create Bilateral TV-L1 Super Resolution. - - This class implements Super Resolution algorithm described in the papers @cite Farsiu03 and - @cite Mitzel09 . - - Here are important members of the class that control the algorithm, which you can set after - constructing the class instance: - - - **int scale** Scale factor. - - **int iterations** Iteration count. - - **double tau** Asymptotic value of steepest descent method. - - **double lambda** Weight parameter to balance data term and smoothness term. - - **double alpha** Parameter of spacial distribution in Bilateral-TV. - - **int btvKernelSize** Kernel size of Bilateral-TV filter. - - **int blurKernelSize** Gaussian blur kernel size. - - **double blurSigma** Gaussian blur sigma. - - **int temporalAreaRadius** Radius of the temporal search area. - - **Ptr\ opticalFlow** Dense optical flow algorithm. - */ - CV_EXPORTS Ptr createSuperResolution_BTVL1(); - CV_EXPORTS Ptr createSuperResolution_BTVL1_CUDA(); - -//! @} superres - - } -} - -#endif // OPENCV_SUPERRES_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/superres/optical_flow.hpp b/qt-correction-tool/pub/opencv/include/opencv2/superres/optical_flow.hpp deleted file mode 100644 index 07e7ca9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/superres/optical_flow.hpp +++ /dev/null @@ -1,203 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_SUPERRES_OPTICAL_FLOW_HPP -#define OPENCV_SUPERRES_OPTICAL_FLOW_HPP - -#include "opencv2/core.hpp" - -namespace cv -{ - namespace superres - { - -//! @addtogroup superres -//! @{ - - class CV_EXPORTS DenseOpticalFlowExt : public cv::Algorithm - { - public: - virtual void calc(InputArray frame0, InputArray frame1, OutputArray flow1, OutputArray flow2 = noArray()) = 0; - virtual void collectGarbage() = 0; - }; - - - class CV_EXPORTS FarnebackOpticalFlow : public virtual DenseOpticalFlowExt - { - public: - /** @see setPyrScale */ - virtual double getPyrScale() const = 0; - /** @copybrief getPyrScale @see getPyrScale */ - virtual void setPyrScale(double val) = 0; - /** @see setLevelsNumber */ - virtual int getLevelsNumber() const = 0; - /** @copybrief getLevelsNumber @see getLevelsNumber */ - virtual void setLevelsNumber(int val) = 0; - /** @see setWindowSize */ - virtual int getWindowSize() const = 0; - /** @copybrief getWindowSize @see getWindowSize */ - virtual void setWindowSize(int val) = 0; - /** @see setIterations */ - virtual int getIterations() const = 0; - /** @copybrief getIterations @see getIterations */ - virtual void setIterations(int val) = 0; - /** @see setPolyN */ - virtual int getPolyN() const = 0; - /** @copybrief getPolyN @see getPolyN */ - virtual void setPolyN(int val) = 0; - /** @see setPolySigma */ - virtual double getPolySigma() const = 0; - /** @copybrief getPolySigma @see getPolySigma */ - virtual void setPolySigma(double val) = 0; - /** @see setFlags */ - virtual int getFlags() const = 0; - /** @copybrief getFlags @see getFlags */ - virtual void setFlags(int val) = 0; - }; - CV_EXPORTS Ptr createOptFlow_Farneback(); - CV_EXPORTS Ptr createOptFlow_Farneback_CUDA(); - - -// CV_EXPORTS Ptr createOptFlow_Simple(); - - - class CV_EXPORTS DualTVL1OpticalFlow : public virtual DenseOpticalFlowExt - { - public: - /** @see setTau */ - virtual double getTau() const = 0; - /** @copybrief getTau @see getTau */ - virtual void setTau(double val) = 0; - /** @see setLambda */ - virtual double getLambda() const = 0; - /** @copybrief getLambda @see getLambda */ - virtual void setLambda(double val) = 0; - /** @see setTheta */ - virtual double getTheta() const = 0; - /** @copybrief getTheta @see getTheta */ - virtual void setTheta(double val) = 0; - /** @see setScalesNumber */ - virtual int getScalesNumber() const = 0; - /** @copybrief getScalesNumber @see getScalesNumber */ - virtual void setScalesNumber(int val) = 0; - /** @see setWarpingsNumber */ - virtual int getWarpingsNumber() const = 0; - /** @copybrief getWarpingsNumber @see getWarpingsNumber */ - virtual void setWarpingsNumber(int val) = 0; - /** @see setEpsilon */ - virtual double getEpsilon() const = 0; - /** @copybrief getEpsilon @see getEpsilon */ - virtual void setEpsilon(double val) = 0; - /** @see setIterations */ - virtual int getIterations() const = 0; - /** @copybrief getIterations @see getIterations */ - virtual void setIterations(int val) = 0; - /** @see setUseInitialFlow */ - virtual bool getUseInitialFlow() const = 0; - /** @copybrief getUseInitialFlow @see getUseInitialFlow */ - virtual void setUseInitialFlow(bool val) = 0; - }; - CV_EXPORTS Ptr createOptFlow_DualTVL1(); - CV_EXPORTS Ptr createOptFlow_DualTVL1_CUDA(); - - - class CV_EXPORTS BroxOpticalFlow : public virtual DenseOpticalFlowExt - { - public: - //! @brief Flow smoothness - /** @see setAlpha */ - virtual double getAlpha() const = 0; - /** @copybrief getAlpha @see getAlpha */ - virtual void setAlpha(double val) = 0; - //! @brief Gradient constancy importance - /** @see setGamma */ - virtual double getGamma() const = 0; - /** @copybrief getGamma @see getGamma */ - virtual void setGamma(double val) = 0; - //! @brief Pyramid scale factor - /** @see setScaleFactor */ - virtual double getScaleFactor() const = 0; - /** @copybrief getScaleFactor @see getScaleFactor */ - virtual void setScaleFactor(double val) = 0; - //! @brief Number of lagged non-linearity iterations (inner loop) - /** @see setInnerIterations */ - virtual int getInnerIterations() const = 0; - /** @copybrief getInnerIterations @see getInnerIterations */ - virtual void setInnerIterations(int val) = 0; - //! @brief Number of warping iterations (number of pyramid levels) - /** @see setOuterIterations */ - virtual int getOuterIterations() const = 0; - /** @copybrief getOuterIterations @see getOuterIterations */ - virtual void setOuterIterations(int val) = 0; - //! @brief Number of linear system solver iterations - /** @see setSolverIterations */ - virtual int getSolverIterations() const = 0; - /** @copybrief getSolverIterations @see getSolverIterations */ - virtual void setSolverIterations(int val) = 0; - }; - CV_EXPORTS Ptr createOptFlow_Brox_CUDA(); - - - class PyrLKOpticalFlow : public virtual DenseOpticalFlowExt - { - public: - /** @see setWindowSize */ - virtual int getWindowSize() const = 0; - /** @copybrief getWindowSize @see getWindowSize */ - virtual void setWindowSize(int val) = 0; - /** @see setMaxLevel */ - virtual int getMaxLevel() const = 0; - /** @copybrief getMaxLevel @see getMaxLevel */ - virtual void setMaxLevel(int val) = 0; - /** @see setIterations */ - virtual int getIterations() const = 0; - /** @copybrief getIterations @see getIterations */ - virtual void setIterations(int val) = 0; - }; - CV_EXPORTS Ptr createOptFlow_PyrLK_CUDA(); - -//! @} - - } -} - -#endif // OPENCV_SUPERRES_OPTICAL_FLOW_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/video.hpp b/qt-correction-tool/pub/opencv/include/opencv2/video.hpp deleted file mode 100644 index aa644a9..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/video.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEO_HPP -#define OPENCV_VIDEO_HPP - -/** - @defgroup video Video Analysis - @{ - @defgroup video_motion Motion Analysis - @defgroup video_track Object Tracking - @defgroup video_c C API - @} -*/ - -#include "opencv2/video/tracking.hpp" -#include "opencv2/video/background_segm.hpp" - -#ifndef DISABLE_OPENCV_24_COMPATIBILITY -#include "opencv2/video/tracking_c.h" -#endif - -#endif //OPENCV_VIDEO_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/video/background_segm.hpp b/qt-correction-tool/pub/opencv/include/opencv2/video/background_segm.hpp deleted file mode 100644 index e1dfa15..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/video/background_segm.hpp +++ /dev/null @@ -1,317 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_BACKGROUND_SEGM_HPP -#define OPENCV_BACKGROUND_SEGM_HPP - -#include "opencv2/core.hpp" - -namespace cv -{ - -//! @addtogroup video_motion -//! @{ - -/** @brief Base class for background/foreground segmentation. : - -The class is only used to define the common interface for the whole family of background/foreground -segmentation algorithms. - */ -class CV_EXPORTS_W BackgroundSubtractor : public Algorithm -{ -public: - /** @brief Computes a foreground mask. - - @param image Next video frame. - @param fgmask The output foreground mask as an 8-bit binary image. - @param learningRate The value between 0 and 1 that indicates how fast the background model is - learnt. Negative parameter value makes the algorithm to use some automatically chosen learning - rate. 0 means that the background model is not updated at all, 1 means that the background model - is completely reinitialized from the last frame. - */ - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) = 0; - - /** @brief Computes a background image. - - @param backgroundImage The output background image. - - @note Sometimes the background image can be very blurry, as it contain the average background - statistics. - */ - CV_WRAP virtual void getBackgroundImage(OutputArray backgroundImage) const = 0; -}; - - -/** @brief Gaussian Mixture-based Background/Foreground Segmentation Algorithm. - -The class implements the Gaussian mixture model background subtraction described in @cite Zivkovic2004 -and @cite Zivkovic2006 . - */ -class CV_EXPORTS_W BackgroundSubtractorMOG2 : public BackgroundSubtractor -{ -public: - /** @brief Returns the number of last frames that affect the background model - */ - CV_WRAP virtual int getHistory() const = 0; - /** @brief Sets the number of last frames that affect the background model - */ - CV_WRAP virtual void setHistory(int history) = 0; - - /** @brief Returns the number of gaussian components in the background model - */ - CV_WRAP virtual int getNMixtures() const = 0; - /** @brief Sets the number of gaussian components in the background model. - - The model needs to be reinitalized to reserve memory. - */ - CV_WRAP virtual void setNMixtures(int nmixtures) = 0;//needs reinitialization! - - /** @brief Returns the "background ratio" parameter of the algorithm - - If a foreground pixel keeps semi-constant value for about backgroundRatio\*history frames, it's - considered background and added to the model as a center of a new component. It corresponds to TB - parameter in the paper. - */ - CV_WRAP virtual double getBackgroundRatio() const = 0; - /** @brief Sets the "background ratio" parameter of the algorithm - */ - CV_WRAP virtual void setBackgroundRatio(double ratio) = 0; - - /** @brief Returns the variance threshold for the pixel-model match - - The main threshold on the squared Mahalanobis distance to decide if the sample is well described by - the background model or not. Related to Cthr from the paper. - */ - CV_WRAP virtual double getVarThreshold() const = 0; - /** @brief Sets the variance threshold for the pixel-model match - */ - CV_WRAP virtual void setVarThreshold(double varThreshold) = 0; - - /** @brief Returns the variance threshold for the pixel-model match used for new mixture component generation - - Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the - existing components (corresponds to Tg in the paper). If a pixel is not close to any component, it - is considered foreground or added as a new component. 3 sigma =\> Tg=3\*3=9 is default. A smaller Tg - value generates more components. A higher Tg value may result in a small number of components but - they can grow too large. - */ - CV_WRAP virtual double getVarThresholdGen() const = 0; - /** @brief Sets the variance threshold for the pixel-model match used for new mixture component generation - */ - CV_WRAP virtual void setVarThresholdGen(double varThresholdGen) = 0; - - /** @brief Returns the initial variance of each gaussian component - */ - CV_WRAP virtual double getVarInit() const = 0; - /** @brief Sets the initial variance of each gaussian component - */ - CV_WRAP virtual void setVarInit(double varInit) = 0; - - CV_WRAP virtual double getVarMin() const = 0; - CV_WRAP virtual void setVarMin(double varMin) = 0; - - CV_WRAP virtual double getVarMax() const = 0; - CV_WRAP virtual void setVarMax(double varMax) = 0; - - /** @brief Returns the complexity reduction threshold - - This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05 - is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the - standard Stauffer&Grimson algorithm. - */ - CV_WRAP virtual double getComplexityReductionThreshold() const = 0; - /** @brief Sets the complexity reduction threshold - */ - CV_WRAP virtual void setComplexityReductionThreshold(double ct) = 0; - - /** @brief Returns the shadow detection flag - - If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorMOG2 for - details. - */ - CV_WRAP virtual bool getDetectShadows() const = 0; - /** @brief Enables or disables shadow detection - */ - CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; - - /** @brief Returns the shadow value - - Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 - in the mask always means background, 255 means foreground. - */ - CV_WRAP virtual int getShadowValue() const = 0; - /** @brief Sets the shadow value - */ - CV_WRAP virtual void setShadowValue(int value) = 0; - - /** @brief Returns the shadow threshold - - A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in - the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel - is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, - *Detecting Moving Shadows...*, IEEE PAMI,2003. - */ - CV_WRAP virtual double getShadowThreshold() const = 0; - /** @brief Sets the shadow threshold - */ - CV_WRAP virtual void setShadowThreshold(double threshold) = 0; - - /** @brief Computes a foreground mask. - - @param image Next video frame. Floating point frame will be used without scaling and should be in range \f$[0,255]\f$. - @param fgmask The output foreground mask as an 8-bit binary image. - @param learningRate The value between 0 and 1 that indicates how fast the background model is - learnt. Negative parameter value makes the algorithm to use some automatically chosen learning - rate. 0 means that the background model is not updated at all, 1 means that the background model - is completely reinitialized from the last frame. - */ - CV_WRAP virtual void apply(InputArray image, OutputArray fgmask, double learningRate=-1) CV_OVERRIDE = 0; -}; - -/** @brief Creates MOG2 Background Subtractor - -@param history Length of the history. -@param varThreshold Threshold on the squared Mahalanobis distance between the pixel and the model -to decide whether a pixel is well described by the background model. This parameter does not -affect the background update. -@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the -speed a bit, so if you do not need this feature, set the parameter to false. - */ -CV_EXPORTS_W Ptr - createBackgroundSubtractorMOG2(int history=500, double varThreshold=16, - bool detectShadows=true); - -/** @brief K-nearest neighbours - based Background/Foreground Segmentation Algorithm. - -The class implements the K-nearest neighbours background subtraction described in @cite Zivkovic2006 . -Very efficient if number of foreground pixels is low. - */ -class CV_EXPORTS_W BackgroundSubtractorKNN : public BackgroundSubtractor -{ -public: - /** @brief Returns the number of last frames that affect the background model - */ - CV_WRAP virtual int getHistory() const = 0; - /** @brief Sets the number of last frames that affect the background model - */ - CV_WRAP virtual void setHistory(int history) = 0; - - /** @brief Returns the number of data samples in the background model - */ - CV_WRAP virtual int getNSamples() const = 0; - /** @brief Sets the number of data samples in the background model. - - The model needs to be reinitalized to reserve memory. - */ - CV_WRAP virtual void setNSamples(int _nN) = 0;//needs reinitialization! - - /** @brief Returns the threshold on the squared distance between the pixel and the sample - - The threshold on the squared distance between the pixel and the sample to decide whether a pixel is - close to a data sample. - */ - CV_WRAP virtual double getDist2Threshold() const = 0; - /** @brief Sets the threshold on the squared distance - */ - CV_WRAP virtual void setDist2Threshold(double _dist2Threshold) = 0; - - /** @brief Returns the number of neighbours, the k in the kNN. - - K is the number of samples that need to be within dist2Threshold in order to decide that that - pixel is matching the kNN background model. - */ - CV_WRAP virtual int getkNNSamples() const = 0; - /** @brief Sets the k in the kNN. How many nearest neighbours need to match. - */ - CV_WRAP virtual void setkNNSamples(int _nkNN) = 0; - - /** @brief Returns the shadow detection flag - - If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for - details. - */ - CV_WRAP virtual bool getDetectShadows() const = 0; - /** @brief Enables or disables shadow detection - */ - CV_WRAP virtual void setDetectShadows(bool detectShadows) = 0; - - /** @brief Returns the shadow value - - Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0 - in the mask always means background, 255 means foreground. - */ - CV_WRAP virtual int getShadowValue() const = 0; - /** @brief Sets the shadow value - */ - CV_WRAP virtual void setShadowValue(int value) = 0; - - /** @brief Returns the shadow threshold - - A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in - the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel - is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara, - *Detecting Moving Shadows...*, IEEE PAMI,2003. - */ - CV_WRAP virtual double getShadowThreshold() const = 0; - /** @brief Sets the shadow threshold - */ - CV_WRAP virtual void setShadowThreshold(double threshold) = 0; -}; - -/** @brief Creates KNN Background Subtractor - -@param history Length of the history. -@param dist2Threshold Threshold on the squared distance between the pixel and the sample to decide -whether a pixel is close to that sample. This parameter does not affect the background update. -@param detectShadows If true, the algorithm will detect shadows and mark them. It decreases the -speed a bit, so if you do not need this feature, set the parameter to false. - */ -CV_EXPORTS_W Ptr - createBackgroundSubtractorKNN(int history=500, double dist2Threshold=400.0, - bool detectShadows=true); - -//! @} video_motion - -} // cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/video/tracking.hpp b/qt-correction-tool/pub/opencv/include/opencv2/video/tracking.hpp deleted file mode 100644 index e8566fa..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/video/tracking.hpp +++ /dev/null @@ -1,654 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_TRACKING_HPP -#define OPENCV_TRACKING_HPP - -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" - -namespace cv -{ - -//! @addtogroup video_track -//! @{ - -enum { OPTFLOW_USE_INITIAL_FLOW = 4, - OPTFLOW_LK_GET_MIN_EIGENVALS = 8, - OPTFLOW_FARNEBACK_GAUSSIAN = 256 - }; - -/** @brief Finds an object center, size, and orientation. - -@param probImage Back projection of the object histogram. See calcBackProject. -@param window Initial search window. -@param criteria Stop criteria for the underlying meanShift. -returns -(in old interfaces) Number of iterations CAMSHIFT took to converge -The function implements the CAMSHIFT object tracking algorithm @cite Bradski98 . First, it finds an -object center using meanShift and then adjusts the window size and finds the optimal rotation. The -function returns the rotated rectangle structure that includes the object position, size, and -orientation. The next position of the search window can be obtained with RotatedRect::boundingRect() - -See the OpenCV sample camshiftdemo.c that tracks colored objects. - -@note -- (Python) A sample explaining the camshift tracking algorithm can be found at - opencv_source_code/samples/python/camshift.py - */ -CV_EXPORTS_W RotatedRect CamShift( InputArray probImage, CV_IN_OUT Rect& window, - TermCriteria criteria ); -/** @example samples/cpp/camshiftdemo.cpp -An example using the mean-shift tracking algorithm -*/ - -/** @brief Finds an object on a back projection image. - -@param probImage Back projection of the object histogram. See calcBackProject for details. -@param window Initial search window. -@param criteria Stop criteria for the iterative search algorithm. -returns -: Number of iterations CAMSHIFT took to converge. -The function implements the iterative object search algorithm. It takes the input back projection of -an object and the initial position. The mass center in window of the back projection image is -computed and the search window center shifts to the mass center. The procedure is repeated until the -specified number of iterations criteria.maxCount is done or until the window center shifts by less -than criteria.epsilon. The algorithm is used inside CamShift and, unlike CamShift , the search -window size or orientation do not change during the search. You can simply pass the output of -calcBackProject to this function. But better results can be obtained if you pre-filter the back -projection and remove the noise. For example, you can do this by retrieving connected components -with findContours , throwing away contours with small area ( contourArea ), and rendering the -remaining contours with drawContours. - - */ -CV_EXPORTS_W int meanShift( InputArray probImage, CV_IN_OUT Rect& window, TermCriteria criteria ); - -/** @brief Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK. - -@param img 8-bit input image. -@param pyramid output pyramid. -@param winSize window size of optical flow algorithm. Must be not less than winSize argument of -calcOpticalFlowPyrLK. It is needed to calculate required padding for pyramid levels. -@param maxLevel 0-based maximal pyramid level number. -@param withDerivatives set to precompute gradients for the every pyramid level. If pyramid is -constructed without the gradients then calcOpticalFlowPyrLK will calculate them internally. -@param pyrBorder the border mode for pyramid layers. -@param derivBorder the border mode for gradients. -@param tryReuseInputImage put ROI of input image into the pyramid if possible. You can pass false -to force data copying. -@return number of levels in constructed pyramid. Can be less than maxLevel. - */ -CV_EXPORTS_W int buildOpticalFlowPyramid( InputArray img, OutputArrayOfArrays pyramid, - Size winSize, int maxLevel, bool withDerivatives = true, - int pyrBorder = BORDER_REFLECT_101, - int derivBorder = BORDER_CONSTANT, - bool tryReuseInputImage = true ); - -/** @example samples/cpp/lkdemo.cpp -An example using the Lucas-Kanade optical flow algorithm -*/ - -/** @brief Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with -pyramids. - -@param prevImg first 8-bit input image or pyramid constructed by buildOpticalFlowPyramid. -@param nextImg second input image or pyramid of the same size and the same type as prevImg. -@param prevPts vector of 2D points for which the flow needs to be found; point coordinates must be -single-precision floating-point numbers. -@param nextPts output vector of 2D points (with single-precision floating-point coordinates) -containing the calculated new positions of input features in the second image; when -OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input. -@param status output status vector (of unsigned chars); each element of the vector is set to 1 if -the flow for the corresponding features has been found, otherwise, it is set to 0. -@param err output vector of errors; each element of the vector is set to an error for the -corresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't -found then the error is not defined (use the status parameter to find such cases). -@param winSize size of the search window at each pyramid level. -@param maxLevel 0-based maximal pyramid level number; if set to 0, pyramids are not used (single -level), if set to 1, two levels are used, and so on; if pyramids are passed to input then -algorithm will use as many levels as pyramids have but no more than maxLevel. -@param criteria parameter, specifying the termination criteria of the iterative search algorithm -(after the specified maximum number of iterations criteria.maxCount or when the search window -moves by less than criteria.epsilon. -@param flags operation flags: - - **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in nextPts; if the flag is - not set, then prevPts is copied to nextPts and is considered the initial estimate. - - **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see - minEigThreshold description); if the flag is not set, then L1 distance between patches - around the original and a moved point, divided by number of pixels in a window, is used as a - error measure. -@param minEigThreshold the algorithm calculates the minimum eigen value of a 2x2 normal matrix of -optical flow equations (this matrix is called a spatial gradient matrix in @cite Bouguet00), divided -by number of pixels in a window; if this value is less than minEigThreshold, then a corresponding -feature is filtered out and its flow is not processed, so it allows to remove bad points and get a -performance boost. - -The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See -@cite Bouguet00 . The function is parallelized with the TBB library. - -@note - -- An example using the Lucas-Kanade optical flow algorithm can be found at - opencv_source_code/samples/cpp/lkdemo.cpp -- (Python) An example using the Lucas-Kanade optical flow algorithm can be found at - opencv_source_code/samples/python/lk_track.py -- (Python) An example using the Lucas-Kanade tracker for homography matching can be found at - opencv_source_code/samples/python/lk_homography.py - */ -CV_EXPORTS_W void calcOpticalFlowPyrLK( InputArray prevImg, InputArray nextImg, - InputArray prevPts, InputOutputArray nextPts, - OutputArray status, OutputArray err, - Size winSize = Size(21,21), int maxLevel = 3, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), - int flags = 0, double minEigThreshold = 1e-4 ); - -/** @brief Computes a dense optical flow using the Gunnar Farneback's algorithm. - -@param prev first 8-bit single-channel input image. -@param next second input image of the same size and the same type as prev. -@param flow computed flow image that has the same size as prev and type CV_32FC2. -@param pyr_scale parameter, specifying the image scale (\<1) to build pyramids for each image; -pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous -one. -@param levels number of pyramid layers including the initial image; levels=1 means that no extra -layers are created and only the original images are used. -@param winsize averaging window size; larger values increase the algorithm robustness to image -noise and give more chances for fast motion detection, but yield more blurred motion field. -@param iterations number of iterations the algorithm does at each pyramid level. -@param poly_n size of the pixel neighborhood used to find polynomial expansion in each pixel; -larger values mean that the image will be approximated with smoother surfaces, yielding more -robust algorithm and more blurred motion field, typically poly_n =5 or 7. -@param poly_sigma standard deviation of the Gaussian that is used to smooth derivatives used as a -basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a -good value would be poly_sigma=1.5. -@param flags operation flags that can be a combination of the following: - - **OPTFLOW_USE_INITIAL_FLOW** uses the input flow as an initial flow approximation. - - **OPTFLOW_FARNEBACK_GAUSSIAN** uses the Gaussian \f$\texttt{winsize}\times\texttt{winsize}\f$ - filter instead of a box filter of the same size for optical flow estimation; usually, this - option gives z more accurate flow than with a box filter, at the cost of lower speed; - normally, winsize for a Gaussian window should be set to a larger value to achieve the same - level of robustness. - -The function finds an optical flow for each prev pixel using the @cite Farneback2003 algorithm so that - -\f[\texttt{prev} (y,x) \sim \texttt{next} ( y + \texttt{flow} (y,x)[1], x + \texttt{flow} (y,x)[0])\f] - -@note - -- An example using the optical flow algorithm described by Gunnar Farneback can be found at - opencv_source_code/samples/cpp/fback.cpp -- (Python) An example using the optical flow algorithm described by Gunnar Farneback can be - found at opencv_source_code/samples/python/opt_flow.py - */ -CV_EXPORTS_W void calcOpticalFlowFarneback( InputArray prev, InputArray next, InputOutputArray flow, - double pyr_scale, int levels, int winsize, - int iterations, int poly_n, double poly_sigma, - int flags ); - -/** @brief Computes an optimal affine transformation between two 2D point sets. - -@param src First input 2D point set stored in std::vector or Mat, or an image stored in Mat. -@param dst Second input 2D point set of the same size and the same type as A, or another image. -@param fullAffine If true, the function finds an optimal affine transformation with no additional -restrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is -limited to combinations of translation, rotation, and uniform scaling (4 degrees of freedom). - -The function finds an optimal affine transform *[A|b]* (a 2 x 3 floating-point matrix) that -approximates best the affine transformation between: - -* Two point sets -* Two raster images. In this case, the function first finds some features in the src image and - finds the corresponding features in dst image. After that, the problem is reduced to the first - case. -In case of point sets, the problem is formulated as follows: you need to find a 2x2 matrix *A* and -2x1 vector *b* so that: - -\f[[A^*|b^*] = arg \min _{[A|b]} \sum _i \| \texttt{dst}[i] - A { \texttt{src}[i]}^T - b \| ^2\f] -where src[i] and dst[i] are the i-th points in src and dst, respectively -\f$[A|b]\f$ can be either arbitrary (when fullAffine=true ) or have a form of -\f[\begin{bmatrix} a_{11} & a_{12} & b_1 \\ -a_{12} & a_{11} & b_2 \end{bmatrix}\f] -when fullAffine=false. - -@sa -estimateAffine2D, estimateAffinePartial2D, getAffineTransform, getPerspectiveTransform, findHomography - */ -CV_EXPORTS_W Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine); -CV_EXPORTS_W Mat estimateRigidTransform( InputArray src, InputArray dst, bool fullAffine, int ransacMaxIters, double ransacGoodRatio, - int ransacSize0); - - -enum -{ - MOTION_TRANSLATION = 0, - MOTION_EUCLIDEAN = 1, - MOTION_AFFINE = 2, - MOTION_HOMOGRAPHY = 3 -}; - -/** @brief Computes the Enhanced Correlation Coefficient value between two images @cite EP08 . - -@param templateImage single-channel template image; CV_8U or CV_32F array. -@param inputImage single-channel input image to be warped to provide an image similar to - templateImage, same type as templateImage. -@param inputMask An optional mask to indicate valid values of inputImage. - -@sa -findTransformECC - */ - -CV_EXPORTS_W double computeECC(InputArray templateImage, InputArray inputImage, InputArray inputMask = noArray()); - -/** @example samples/cpp/image_alignment.cpp -An example using the image alignment ECC algorithm -*/ - -/** @brief Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 . - -@param templateImage single-channel template image; CV_8U or CV_32F array. -@param inputImage single-channel input image which should be warped with the final warpMatrix in -order to provide an image similar to templateImage, same type as templateImage. -@param warpMatrix floating-point \f$2\times 3\f$ or \f$3\times 3\f$ mapping matrix (warp). -@param motionType parameter, specifying the type of motion: - - **MOTION_TRANSLATION** sets a translational motion model; warpMatrix is \f$2\times 3\f$ with - the first \f$2\times 2\f$ part being the unity matrix and the rest two parameters being - estimated. - - **MOTION_EUCLIDEAN** sets a Euclidean (rigid) transformation as motion model; three - parameters are estimated; warpMatrix is \f$2\times 3\f$. - - **MOTION_AFFINE** sets an affine motion model (DEFAULT); six parameters are estimated; - warpMatrix is \f$2\times 3\f$. - - **MOTION_HOMOGRAPHY** sets a homography as a motion model; eight parameters are - estimated;\`warpMatrix\` is \f$3\times 3\f$. -@param criteria parameter, specifying the termination criteria of the ECC algorithm; -criteria.epsilon defines the threshold of the increment in the correlation coefficient between two -iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion). -Default values are shown in the declaration above. -@param inputMask An optional mask to indicate valid values of inputImage. -@param gaussFiltSize An optional value indicating size of gaussian blur filter; (DEFAULT: 5) - -The function estimates the optimum transformation (warpMatrix) with respect to ECC criterion -(@cite EP08), that is - -\f[\texttt{warpMatrix} = \texttt{warpMatrix} = \arg\max_{W} \texttt{ECC}(\texttt{templateImage}(x,y),\texttt{inputImage}(x',y'))\f] - -where - -\f[\begin{bmatrix} x' \\ y' \end{bmatrix} = W \cdot \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}\f] - -(the equation holds with homogeneous coordinates for homography). It returns the final enhanced -correlation coefficient, that is the correlation coefficient between the template image and the -final warped input image. When a \f$3\times 3\f$ matrix is given with motionType =0, 1 or 2, the third -row is ignored. - -Unlike findHomography and estimateRigidTransform, the function findTransformECC implements an -area-based alignment that builds on intensity similarities. In essence, the function updates the -initial transformation that roughly aligns the images. If this information is missing, the identity -warp (unity matrix) is used as an initialization. Note that if images undergo strong -displacements/rotations, an initial transformation that roughly aligns the images is necessary -(e.g., a simple euclidean/similarity transform that allows for the images showing the same image -content approximately). Use inverse warping in the second image to take an image close to the first -one, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV -sample image_alignment.cpp that demonstrates the use of the function. Note that the function throws -an exception if algorithm does not converges. - -@sa -computeECC, estimateAffine2D, estimateAffinePartial2D, findHomography - */ -CV_EXPORTS_W double findTransformECC( InputArray templateImage, InputArray inputImage, - InputOutputArray warpMatrix, int motionType, - TermCriteria criteria, - InputArray inputMask, int gaussFiltSize); - -/** @overload */ -CV_EXPORTS -double findTransformECC(InputArray templateImage, InputArray inputImage, - InputOutputArray warpMatrix, int motionType = MOTION_AFFINE, - TermCriteria criteria = TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001), - InputArray inputMask = noArray()); - -/** @example samples/cpp/kalman.cpp -An example using the standard Kalman filter -*/ - -/** @brief Kalman filter class. - -The class implements a standard Kalman filter , -@cite Welch95 . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get -an extended Kalman filter functionality. -@note In C API when CvKalman\* kalmanFilter structure is not needed anymore, it should be released -with cvReleaseKalman(&kalmanFilter) - */ -class CV_EXPORTS_W KalmanFilter -{ -public: - CV_WRAP KalmanFilter(); - /** @overload - @param dynamParams Dimensionality of the state. - @param measureParams Dimensionality of the measurement. - @param controlParams Dimensionality of the control vector. - @param type Type of the created matrices that should be CV_32F or CV_64F. - */ - CV_WRAP KalmanFilter( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F ); - - /** @brief Re-initializes Kalman filter. The previous content is destroyed. - - @param dynamParams Dimensionality of the state. - @param measureParams Dimensionality of the measurement. - @param controlParams Dimensionality of the control vector. - @param type Type of the created matrices that should be CV_32F or CV_64F. - */ - void init( int dynamParams, int measureParams, int controlParams = 0, int type = CV_32F ); - - /** @brief Computes a predicted state. - - @param control The optional input control - */ - CV_WRAP const Mat& predict( const Mat& control = Mat() ); - - /** @brief Updates the predicted state from the measurement. - - @param measurement The measured system parameters - */ - CV_WRAP const Mat& correct( const Mat& measurement ); - - CV_PROP_RW Mat statePre; //!< predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k) - CV_PROP_RW Mat statePost; //!< corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) - CV_PROP_RW Mat transitionMatrix; //!< state transition matrix (A) - CV_PROP_RW Mat controlMatrix; //!< control matrix (B) (not used if there is no control) - CV_PROP_RW Mat measurementMatrix; //!< measurement matrix (H) - CV_PROP_RW Mat processNoiseCov; //!< process noise covariance matrix (Q) - CV_PROP_RW Mat measurementNoiseCov;//!< measurement noise covariance matrix (R) - CV_PROP_RW Mat errorCovPre; //!< priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/ - CV_PROP_RW Mat gain; //!< Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R) - CV_PROP_RW Mat errorCovPost; //!< posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k) - - // temporary matrices - Mat temp1; - Mat temp2; - Mat temp3; - Mat temp4; - Mat temp5; -}; - - -class CV_EXPORTS_W DenseOpticalFlow : public Algorithm -{ -public: - /** @brief Calculates an optical flow. - - @param I0 first 8-bit single-channel input image. - @param I1 second input image of the same size and the same type as prev. - @param flow computed flow image that has the same size as prev and type CV_32FC2. - */ - CV_WRAP virtual void calc( InputArray I0, InputArray I1, InputOutputArray flow ) = 0; - /** @brief Releases all inner buffers. - */ - CV_WRAP virtual void collectGarbage() = 0; -}; - -/** @brief Base interface for sparse optical flow algorithms. - */ -class CV_EXPORTS_W SparseOpticalFlow : public Algorithm -{ -public: - /** @brief Calculates a sparse optical flow. - - @param prevImg First input image. - @param nextImg Second input image of the same size and the same type as prevImg. - @param prevPts Vector of 2D points for which the flow needs to be found. - @param nextPts Output vector of 2D points containing the calculated new positions of input features in the second image. - @param status Output status vector. Each element of the vector is set to 1 if the - flow for the corresponding features has been found. Otherwise, it is set to 0. - @param err Optional output vector that contains error response for each point (inverse confidence). - */ - CV_WRAP virtual void calc(InputArray prevImg, InputArray nextImg, - InputArray prevPts, InputOutputArray nextPts, - OutputArray status, - OutputArray err = cv::noArray()) = 0; -}; - -/** @brief "Dual TV L1" Optical Flow Algorithm. - -The class implements the "Dual TV L1" optical flow algorithm described in @cite Zach2007 and -@cite Javier2012 . -Here are important members of the class that control the algorithm, which you can set after -constructing the class instance: - -- member double tau - Time step of the numerical scheme. - -- member double lambda - Weight parameter for the data term, attachment parameter. This is the most relevant - parameter, which determines the smoothness of the output. The smaller this parameter is, - the smoother the solutions we obtain. It depends on the range of motions of the images, so - its value should be adapted to each image sequence. - -- member double theta - Weight parameter for (u - v)\^2, tightness parameter. It serves as a link between the - attachment and the regularization terms. In theory, it should have a small value in order - to maintain both parts in correspondence. The method is stable for a large range of values - of this parameter. - -- member int nscales - Number of scales used to create the pyramid of images. - -- member int warps - Number of warpings per scale. Represents the number of times that I1(x+u0) and grad( - I1(x+u0) ) are computed per scale. This is a parameter that assures the stability of the - method. It also affects the running time, so it is a compromise between speed and - accuracy. - -- member double epsilon - Stopping criterion threshold used in the numerical scheme, which is a trade-off between - precision and running time. A small value will yield more accurate solutions at the - expense of a slower convergence. - -- member int iterations - Stopping criterion iterations number used in the numerical scheme. - -C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow". -Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation". -*/ -class CV_EXPORTS_W DualTVL1OpticalFlow : public DenseOpticalFlow -{ -public: - //! @brief Time step of the numerical scheme - /** @see setTau */ - CV_WRAP virtual double getTau() const = 0; - /** @copybrief getTau @see getTau */ - CV_WRAP virtual void setTau(double val) = 0; - //! @brief Weight parameter for the data term, attachment parameter - /** @see setLambda */ - CV_WRAP virtual double getLambda() const = 0; - /** @copybrief getLambda @see getLambda */ - CV_WRAP virtual void setLambda(double val) = 0; - //! @brief Weight parameter for (u - v)^2, tightness parameter - /** @see setTheta */ - CV_WRAP virtual double getTheta() const = 0; - /** @copybrief getTheta @see getTheta */ - CV_WRAP virtual void setTheta(double val) = 0; - //! @brief coefficient for additional illumination variation term - /** @see setGamma */ - CV_WRAP virtual double getGamma() const = 0; - /** @copybrief getGamma @see getGamma */ - CV_WRAP virtual void setGamma(double val) = 0; - //! @brief Number of scales used to create the pyramid of images - /** @see setScalesNumber */ - CV_WRAP virtual int getScalesNumber() const = 0; - /** @copybrief getScalesNumber @see getScalesNumber */ - CV_WRAP virtual void setScalesNumber(int val) = 0; - //! @brief Number of warpings per scale - /** @see setWarpingsNumber */ - CV_WRAP virtual int getWarpingsNumber() const = 0; - /** @copybrief getWarpingsNumber @see getWarpingsNumber */ - CV_WRAP virtual void setWarpingsNumber(int val) = 0; - //! @brief Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time - /** @see setEpsilon */ - CV_WRAP virtual double getEpsilon() const = 0; - /** @copybrief getEpsilon @see getEpsilon */ - CV_WRAP virtual void setEpsilon(double val) = 0; - //! @brief Inner iterations (between outlier filtering) used in the numerical scheme - /** @see setInnerIterations */ - CV_WRAP virtual int getInnerIterations() const = 0; - /** @copybrief getInnerIterations @see getInnerIterations */ - CV_WRAP virtual void setInnerIterations(int val) = 0; - //! @brief Outer iterations (number of inner loops) used in the numerical scheme - /** @see setOuterIterations */ - CV_WRAP virtual int getOuterIterations() const = 0; - /** @copybrief getOuterIterations @see getOuterIterations */ - CV_WRAP virtual void setOuterIterations(int val) = 0; - //! @brief Use initial flow - /** @see setUseInitialFlow */ - CV_WRAP virtual bool getUseInitialFlow() const = 0; - /** @copybrief getUseInitialFlow @see getUseInitialFlow */ - CV_WRAP virtual void setUseInitialFlow(bool val) = 0; - //! @brief Step between scales (<1) - /** @see setScaleStep */ - CV_WRAP virtual double getScaleStep() const = 0; - /** @copybrief getScaleStep @see getScaleStep */ - CV_WRAP virtual void setScaleStep(double val) = 0; - //! @brief Median filter kernel size (1 = no filter) (3 or 5) - /** @see setMedianFiltering */ - CV_WRAP virtual int getMedianFiltering() const = 0; - /** @copybrief getMedianFiltering @see getMedianFiltering */ - CV_WRAP virtual void setMedianFiltering(int val) = 0; - - /** @brief Creates instance of cv::DualTVL1OpticalFlow*/ - CV_WRAP static Ptr create( - double tau = 0.25, - double lambda = 0.15, - double theta = 0.3, - int nscales = 5, - int warps = 5, - double epsilon = 0.01, - int innnerIterations = 30, - int outerIterations = 10, - double scaleStep = 0.8, - double gamma = 0.0, - int medianFiltering = 5, - bool useInitialFlow = false); -}; - -/** @brief Creates instance of cv::DenseOpticalFlow -*/ -CV_EXPORTS_W Ptr createOptFlow_DualTVL1(); - -/** @brief Class computing a dense optical flow using the Gunnar Farneback's algorithm. - */ -class CV_EXPORTS_W FarnebackOpticalFlow : public DenseOpticalFlow -{ -public: - CV_WRAP virtual int getNumLevels() const = 0; - CV_WRAP virtual void setNumLevels(int numLevels) = 0; - - CV_WRAP virtual double getPyrScale() const = 0; - CV_WRAP virtual void setPyrScale(double pyrScale) = 0; - - CV_WRAP virtual bool getFastPyramids() const = 0; - CV_WRAP virtual void setFastPyramids(bool fastPyramids) = 0; - - CV_WRAP virtual int getWinSize() const = 0; - CV_WRAP virtual void setWinSize(int winSize) = 0; - - CV_WRAP virtual int getNumIters() const = 0; - CV_WRAP virtual void setNumIters(int numIters) = 0; - - CV_WRAP virtual int getPolyN() const = 0; - CV_WRAP virtual void setPolyN(int polyN) = 0; - - CV_WRAP virtual double getPolySigma() const = 0; - CV_WRAP virtual void setPolySigma(double polySigma) = 0; - - CV_WRAP virtual int getFlags() const = 0; - CV_WRAP virtual void setFlags(int flags) = 0; - - CV_WRAP static Ptr create( - int numLevels = 5, - double pyrScale = 0.5, - bool fastPyramids = false, - int winSize = 13, - int numIters = 10, - int polyN = 5, - double polySigma = 1.1, - int flags = 0); -}; - - -/** @brief Class used for calculating a sparse optical flow. - -The class can calculate an optical flow for a sparse feature set using the -iterative Lucas-Kanade method with pyramids. - -@sa calcOpticalFlowPyrLK - -*/ -class CV_EXPORTS_W SparsePyrLKOpticalFlow : public SparseOpticalFlow -{ -public: - CV_WRAP virtual Size getWinSize() const = 0; - CV_WRAP virtual void setWinSize(Size winSize) = 0; - - CV_WRAP virtual int getMaxLevel() const = 0; - CV_WRAP virtual void setMaxLevel(int maxLevel) = 0; - - CV_WRAP virtual TermCriteria getTermCriteria() const = 0; - CV_WRAP virtual void setTermCriteria(TermCriteria& crit) = 0; - - CV_WRAP virtual int getFlags() const = 0; - CV_WRAP virtual void setFlags(int flags) = 0; - - CV_WRAP virtual double getMinEigThreshold() const = 0; - CV_WRAP virtual void setMinEigThreshold(double minEigThreshold) = 0; - - CV_WRAP static Ptr create( - Size winSize = Size(21, 21), - int maxLevel = 3, TermCriteria crit = - TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01), - int flags = 0, - double minEigThreshold = 1e-4); -}; - -//! @} video_track - -} // cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/video/tracking_c.h b/qt-correction-tool/pub/opencv/include/opencv2/video/tracking_c.h deleted file mode 100644 index 3e32fbd..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/video/tracking_c.h +++ /dev/null @@ -1,232 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_TRACKING_C_H -#define OPENCV_TRACKING_C_H - -#include "opencv2/imgproc/types_c.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** @addtogroup video_c - @{ -*/ - -/****************************************************************************************\ -* Motion Analysis * -\****************************************************************************************/ - -/************************************ optical flow ***************************************/ - -#define CV_LKFLOW_PYR_A_READY 1 -#define CV_LKFLOW_PYR_B_READY 2 -#define CV_LKFLOW_INITIAL_GUESSES 4 -#define CV_LKFLOW_GET_MIN_EIGENVALS 8 - -/* It is Lucas & Kanade method, modified to use pyramids. - Also it does several iterations to get optical flow for - every point at every pyramid level. - Calculates optical flow between two images for certain set of points (i.e. - it is a "sparse" optical flow, which is opposite to the previous 3 methods) */ -CVAPI(void) cvCalcOpticalFlowPyrLK( const CvArr* prev, const CvArr* curr, - CvArr* prev_pyr, CvArr* curr_pyr, - const CvPoint2D32f* prev_features, - CvPoint2D32f* curr_features, - int count, - CvSize win_size, - int level, - char* status, - float* track_error, - CvTermCriteria criteria, - int flags ); - - -/* Modification of a previous sparse optical flow algorithm to calculate - affine flow */ -CVAPI(void) cvCalcAffineFlowPyrLK( const CvArr* prev, const CvArr* curr, - CvArr* prev_pyr, CvArr* curr_pyr, - const CvPoint2D32f* prev_features, - CvPoint2D32f* curr_features, - float* matrices, int count, - CvSize win_size, int level, - char* status, float* track_error, - CvTermCriteria criteria, int flags ); - -/* Estimate rigid transformation between 2 images or 2 point sets */ -CVAPI(int) cvEstimateRigidTransform( const CvArr* A, const CvArr* B, - CvMat* M, int full_affine ); - -/* Estimate optical flow for each pixel using the two-frame G. Farneback algorithm */ -CVAPI(void) cvCalcOpticalFlowFarneback( const CvArr* prev, const CvArr* next, - CvArr* flow, double pyr_scale, int levels, - int winsize, int iterations, int poly_n, - double poly_sigma, int flags ); - -/********************************* motion templates *************************************/ - -/****************************************************************************************\ -* All the motion template functions work only with single channel images. * -* Silhouette image must have depth IPL_DEPTH_8U or IPL_DEPTH_8S * -* Motion history image must have depth IPL_DEPTH_32F, * -* Gradient mask - IPL_DEPTH_8U or IPL_DEPTH_8S, * -* Motion orientation image - IPL_DEPTH_32F * -* Segmentation mask - IPL_DEPTH_32F * -* All the angles are in degrees, all the times are in milliseconds * -\****************************************************************************************/ - -/* Updates motion history image given motion silhouette */ -CVAPI(void) cvUpdateMotionHistory( const CvArr* silhouette, CvArr* mhi, - double timestamp, double duration ); - -/* Calculates gradient of the motion history image and fills - a mask indicating where the gradient is valid */ -CVAPI(void) cvCalcMotionGradient( const CvArr* mhi, CvArr* mask, CvArr* orientation, - double delta1, double delta2, - int aperture_size CV_DEFAULT(3)); - -/* Calculates average motion direction within a selected motion region - (region can be selected by setting ROIs and/or by composing a valid gradient mask - with the region mask) */ -CVAPI(double) cvCalcGlobalOrientation( const CvArr* orientation, const CvArr* mask, - const CvArr* mhi, double timestamp, - double duration ); - -/* Splits a motion history image into a few parts corresponding to separate independent motions - (e.g. left hand, right hand) */ -CVAPI(CvSeq*) cvSegmentMotion( const CvArr* mhi, CvArr* seg_mask, - CvMemStorage* storage, - double timestamp, double seg_thresh ); - -/****************************************************************************************\ -* Tracking * -\****************************************************************************************/ - -/* Implements CAMSHIFT algorithm - determines object position, size and orientation - from the object histogram back project (extension of meanshift) */ -CVAPI(int) cvCamShift( const CvArr* prob_image, CvRect window, - CvTermCriteria criteria, CvConnectedComp* comp, - CvBox2D* box CV_DEFAULT(NULL) ); - -/* Implements MeanShift algorithm - determines object position - from the object histogram back project */ -CVAPI(int) cvMeanShift( const CvArr* prob_image, CvRect window, - CvTermCriteria criteria, CvConnectedComp* comp ); - -/* -standard Kalman filter (in G. Welch' and G. Bishop's notation): - - x(k)=A*x(k-1)+B*u(k)+w(k) p(w)~N(0,Q) - z(k)=H*x(k)+v(k), p(v)~N(0,R) -*/ -typedef struct CvKalman -{ - int MP; /* number of measurement vector dimensions */ - int DP; /* number of state vector dimensions */ - int CP; /* number of control vector dimensions */ - - /* backward compatibility fields */ -#if 1 - float* PosterState; /* =state_pre->data.fl */ - float* PriorState; /* =state_post->data.fl */ - float* DynamMatr; /* =transition_matrix->data.fl */ - float* MeasurementMatr; /* =measurement_matrix->data.fl */ - float* MNCovariance; /* =measurement_noise_cov->data.fl */ - float* PNCovariance; /* =process_noise_cov->data.fl */ - float* KalmGainMatr; /* =gain->data.fl */ - float* PriorErrorCovariance;/* =error_cov_pre->data.fl */ - float* PosterErrorCovariance;/* =error_cov_post->data.fl */ - float* Temp1; /* temp1->data.fl */ - float* Temp2; /* temp2->data.fl */ -#endif - - CvMat* state_pre; /* predicted state (x'(k)): - x(k)=A*x(k-1)+B*u(k) */ - CvMat* state_post; /* corrected state (x(k)): - x(k)=x'(k)+K(k)*(z(k)-H*x'(k)) */ - CvMat* transition_matrix; /* state transition matrix (A) */ - CvMat* control_matrix; /* control matrix (B) - (it is not used if there is no control)*/ - CvMat* measurement_matrix; /* measurement matrix (H) */ - CvMat* process_noise_cov; /* process noise covariance matrix (Q) */ - CvMat* measurement_noise_cov; /* measurement noise covariance matrix (R) */ - CvMat* error_cov_pre; /* priori error estimate covariance matrix (P'(k)): - P'(k)=A*P(k-1)*At + Q)*/ - CvMat* gain; /* Kalman gain matrix (K(k)): - K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)*/ - CvMat* error_cov_post; /* posteriori error estimate covariance matrix (P(k)): - P(k)=(I-K(k)*H)*P'(k) */ - CvMat* temp1; /* temporary matrices */ - CvMat* temp2; - CvMat* temp3; - CvMat* temp4; - CvMat* temp5; -} CvKalman; - -/* Creates Kalman filter and sets A, B, Q, R and state to some initial values */ -CVAPI(CvKalman*) cvCreateKalman( int dynam_params, int measure_params, - int control_params CV_DEFAULT(0)); - -/* Releases Kalman filter state */ -CVAPI(void) cvReleaseKalman( CvKalman** kalman); - -/* Updates Kalman filter by time (predicts future state of the system) */ -CVAPI(const CvMat*) cvKalmanPredict( CvKalman* kalman, - const CvMat* control CV_DEFAULT(NULL)); - -/* Updates Kalman filter by measurement - (corrects state of the system and internal matrices) */ -CVAPI(const CvMat*) cvKalmanCorrect( CvKalman* kalman, const CvMat* measurement ); - -#define cvKalmanUpdateByTime cvKalmanPredict -#define cvKalmanUpdateByMeasurement cvKalmanCorrect - -/** @} video_c */ - -#ifdef __cplusplus -} // extern "C" -#endif - - -#endif // OPENCV_TRACKING_C_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/video/video.hpp b/qt-correction-tool/pub/opencv/include/opencv2/video/video.hpp deleted file mode 100644 index 8267b85..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/video/video.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/video.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videoio.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videoio.hpp deleted file mode 100644 index cc639d6..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videoio.hpp +++ /dev/null @@ -1,992 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOIO_HPP -#define OPENCV_VIDEOIO_HPP - -#include "opencv2/core.hpp" - -/** - @defgroup videoio Video I/O - - @brief Read and write video or images sequence with OpenCV - - ### See also: - - @ref videoio_overview - - Tutorials: @ref tutorial_table_of_content_videoio - @{ - @defgroup videoio_flags_base Flags for video I/O - @defgroup videoio_flags_others Additional flags for video I/O API backends - @defgroup videoio_c C API for video I/O - @defgroup videoio_ios iOS glue for video I/O - @defgroup videoio_winrt WinRT glue for video I/O - @defgroup videoio_registry Query I/O API backends registry - @} -*/ - -////////////////////////////////// video io ///////////////////////////////// - -typedef struct CvCapture CvCapture; -typedef struct CvVideoWriter CvVideoWriter; - -namespace cv -{ - -//! @addtogroup videoio -//! @{ - -//! @addtogroup videoio_flags_base -//! @{ - - -/** @brief %VideoCapture API backends identifier. - -Select preferred API for a capture object. -To be used in the VideoCapture::VideoCapture() constructor or VideoCapture::open() - -@note Backends are available only if they have been built with your OpenCV binaries. -See @ref videoio_overview for more information. -*/ -enum VideoCaptureAPIs { - CAP_ANY = 0, //!< Auto detect == 0 - CAP_VFW = 200, //!< Video For Windows (platform native) - CAP_V4L = 200, //!< V4L/V4L2 capturing support via libv4l - CAP_V4L2 = CAP_V4L, //!< Same as CAP_V4L - CAP_FIREWIRE = 300, //!< IEEE 1394 drivers - CAP_FIREWARE = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE - CAP_IEEE1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE - CAP_DC1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE - CAP_CMU1394 = CAP_FIREWIRE, //!< Same as CAP_FIREWIRE - CAP_QT = 500, //!< QuickTime - CAP_UNICAP = 600, //!< Unicap drivers - CAP_DSHOW = 700, //!< DirectShow (via videoInput) - CAP_PVAPI = 800, //!< PvAPI, Prosilica GigE SDK - CAP_OPENNI = 900, //!< OpenNI (for Kinect) - CAP_OPENNI_ASUS = 910, //!< OpenNI (for Asus Xtion) - CAP_ANDROID = 1000, //!< Android - not used - CAP_XIAPI = 1100, //!< XIMEA Camera API - CAP_AVFOUNDATION = 1200, //!< AVFoundation framework for iOS (OS X Lion will have the same API) - CAP_GIGANETIX = 1300, //!< Smartek Giganetix GigEVisionSDK - CAP_MSMF = 1400, //!< Microsoft Media Foundation (via videoInput) - CAP_WINRT = 1410, //!< Microsoft Windows Runtime using Media Foundation - CAP_INTELPERC = 1500, //!< Intel Perceptual Computing SDK - CAP_OPENNI2 = 1600, //!< OpenNI2 (for Kinect) - CAP_OPENNI2_ASUS = 1610, //!< OpenNI2 (for Asus Xtion and Occipital Structure sensors) - CAP_GPHOTO2 = 1700, //!< gPhoto2 connection - CAP_GSTREAMER = 1800, //!< GStreamer - CAP_FFMPEG = 1900, //!< Open and record video file or stream using the FFMPEG library - CAP_IMAGES = 2000, //!< OpenCV Image Sequence (e.g. img_%02d.jpg) - CAP_ARAVIS = 2100, //!< Aravis SDK - CAP_OPENCV_MJPEG = 2200, //!< Built-in OpenCV MotionJPEG codec - CAP_INTEL_MFX = 2300, //!< Intel MediaSDK - CAP_XINE = 2400, //!< XINE engine (Linux) - }; - -/** @brief %VideoCapture generic properties identifier. - - Reading / writing properties involves many layers. Some unexpected result might happens along this chain. - Effective behaviour depends from device hardware, driver and API Backend. - @sa videoio_flags_others, VideoCapture::get(), VideoCapture::set() -*/ -enum VideoCaptureProperties { - CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds. - CAP_PROP_POS_FRAMES =1, //!< 0-based index of the frame to be decoded/captured next. - CAP_PROP_POS_AVI_RATIO =2, //!< Relative position of the video file: 0=start of the film, 1=end of the film. - CAP_PROP_FRAME_WIDTH =3, //!< Width of the frames in the video stream. - CAP_PROP_FRAME_HEIGHT =4, //!< Height of the frames in the video stream. - CAP_PROP_FPS =5, //!< Frame rate. - CAP_PROP_FOURCC =6, //!< 4-character code of codec. see VideoWriter::fourcc . - CAP_PROP_FRAME_COUNT =7, //!< Number of frames in the video file. - CAP_PROP_FORMAT =8, //!< Format of the %Mat objects returned by VideoCapture::retrieve(). - CAP_PROP_MODE =9, //!< Backend-specific value indicating the current capture mode. - CAP_PROP_BRIGHTNESS =10, //!< Brightness of the image (only for those cameras that support). - CAP_PROP_CONTRAST =11, //!< Contrast of the image (only for cameras). - CAP_PROP_SATURATION =12, //!< Saturation of the image (only for cameras). - CAP_PROP_HUE =13, //!< Hue of the image (only for cameras). - CAP_PROP_GAIN =14, //!< Gain of the image (only for those cameras that support). - CAP_PROP_EXPOSURE =15, //!< Exposure (only for those cameras that support). - CAP_PROP_CONVERT_RGB =16, //!< Boolean flags indicating whether images should be converted to RGB. - CAP_PROP_WHITE_BALANCE_BLUE_U =17, //!< Currently unsupported. - CAP_PROP_RECTIFICATION =18, //!< Rectification flag for stereo cameras (note: only supported by DC1394 v 2.x backend currently). - CAP_PROP_MONOCHROME =19, - CAP_PROP_SHARPNESS =20, - CAP_PROP_AUTO_EXPOSURE =21, //!< DC1394: exposure control done by camera, user can adjust reference level using this feature. - CAP_PROP_GAMMA =22, - CAP_PROP_TEMPERATURE =23, - CAP_PROP_TRIGGER =24, - CAP_PROP_TRIGGER_DELAY =25, - CAP_PROP_WHITE_BALANCE_RED_V =26, - CAP_PROP_ZOOM =27, - CAP_PROP_FOCUS =28, - CAP_PROP_GUID =29, - CAP_PROP_ISO_SPEED =30, - CAP_PROP_BACKLIGHT =32, - CAP_PROP_PAN =33, - CAP_PROP_TILT =34, - CAP_PROP_ROLL =35, - CAP_PROP_IRIS =36, - CAP_PROP_SETTINGS =37, //!< Pop up video/camera filter dialog (note: only supported by DSHOW backend currently. The property value is ignored) - CAP_PROP_BUFFERSIZE =38, - CAP_PROP_AUTOFOCUS =39, - CAP_PROP_SAR_NUM =40, //!< Sample aspect ratio: num/den (num) - CAP_PROP_SAR_DEN =41, //!< Sample aspect ratio: num/den (den) - CAP_PROP_BACKEND =42, //!< Current backend (enum VideoCaptureAPIs). Read-only property - CAP_PROP_CHANNEL =43, //!< Video input or Channel Number (only for those cameras that support) - CAP_PROP_AUTO_WB =44, //!< enable/ disable auto white-balance - CAP_PROP_WB_TEMPERATURE=45, //!< white-balance color temperature -#ifndef CV_DOXYGEN - CV__CAP_PROP_LATEST -#endif - }; - - -/** @brief Generic camera output modes identifier. -@note Currently, these are supported through the libv4l backend only. -*/ -enum VideoCaptureModes { - CAP_MODE_BGR = 0, //!< BGR24 (default) - CAP_MODE_RGB = 1, //!< RGB24 - CAP_MODE_GRAY = 2, //!< Y8 - CAP_MODE_YUYV = 3 //!< YUYV - }; - -/** @brief %VideoWriter generic properties identifier. - @sa VideoWriter::get(), VideoWriter::set() -*/ -enum VideoWriterProperties { - VIDEOWRITER_PROP_QUALITY = 1, //!< Current quality (0..100%) of the encoded videostream. Can be adjusted dynamically in some codecs. - VIDEOWRITER_PROP_FRAMEBYTES = 2, //!< (Read-only): Size of just encoded video frame. Note that the encoding order may be different from representation order. - VIDEOWRITER_PROP_NSTRIPES = 3 //!< Number of stripes for parallel encoding. -1 for auto detection. -}; - -//! @} videoio_flags_base - -//! @addtogroup videoio_flags_others -//! @{ - -/** @name IEEE 1394 drivers - @{ -*/ - -/** @brief Modes of the IEEE 1394 controlling registers -(can be: auto, manual, auto single push, absolute Latter allowed with any other mode) -every feature can have only one mode turned on at a time -*/ -enum { CAP_PROP_DC1394_OFF = -4, //!< turn the feature off (not controlled manually nor automatically). - CAP_PROP_DC1394_MODE_MANUAL = -3, //!< set automatically when a value of the feature is set by the user. - CAP_PROP_DC1394_MODE_AUTO = -2, - CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1, - CAP_PROP_DC1394_MAX = 31 - }; - -//! @} IEEE 1394 drivers - -/** @name OpenNI (for Kinect) - @{ -*/ - -//! OpenNI map generators -enum { CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, - CAP_OPENNI_IMAGE_GENERATOR = 1 << 30, - CAP_OPENNI_IR_GENERATOR = 1 << 29, - CAP_OPENNI_GENERATORS_MASK = CAP_OPENNI_DEPTH_GENERATOR + CAP_OPENNI_IMAGE_GENERATOR + CAP_OPENNI_IR_GENERATOR - }; - -//! Properties of cameras available through OpenNI backend -enum { CAP_PROP_OPENNI_OUTPUT_MODE = 100, - CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, //!< In mm - CAP_PROP_OPENNI_BASELINE = 102, //!< In mm - CAP_PROP_OPENNI_FOCAL_LENGTH = 103, //!< In pixels - CAP_PROP_OPENNI_REGISTRATION = 104, //!< Flag that synchronizes the remapping depth map to image map - //!< by changing depth generator's view point (if the flag is "on") or - //!< sets this view point to its normal one (if the flag is "off"). - CAP_PROP_OPENNI_REGISTRATION_ON = CAP_PROP_OPENNI_REGISTRATION, - CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105, - CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106, - CAP_PROP_OPENNI_CIRCLE_BUFFER = 107, - CAP_PROP_OPENNI_MAX_TIME_DURATION = 108, - CAP_PROP_OPENNI_GENERATOR_PRESENT = 109, - CAP_PROP_OPENNI2_SYNC = 110, - CAP_PROP_OPENNI2_MIRROR = 111 - }; - -//! OpenNI shortcuts -enum { CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT, - CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CAP_OPENNI_IMAGE_GENERATOR + CAP_PROP_OPENNI_OUTPUT_MODE, - CAP_OPENNI_DEPTH_GENERATOR_PRESENT = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT, - CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_BASELINE, - CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_FOCAL_LENGTH, - CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CAP_OPENNI_DEPTH_GENERATOR + CAP_PROP_OPENNI_REGISTRATION, - CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION, - CAP_OPENNI_IR_GENERATOR_PRESENT = CAP_OPENNI_IR_GENERATOR + CAP_PROP_OPENNI_GENERATOR_PRESENT, - }; - -//! OpenNI data given from depth generator -enum { CAP_OPENNI_DEPTH_MAP = 0, //!< Depth values in mm (CV_16UC1) - CAP_OPENNI_POINT_CLOUD_MAP = 1, //!< XYZ in meters (CV_32FC3) - CAP_OPENNI_DISPARITY_MAP = 2, //!< Disparity in pixels (CV_8UC1) - CAP_OPENNI_DISPARITY_MAP_32F = 3, //!< Disparity in pixels (CV_32FC1) - CAP_OPENNI_VALID_DEPTH_MASK = 4, //!< CV_8UC1 - - CAP_OPENNI_BGR_IMAGE = 5, //!< Data given from RGB image generator - CAP_OPENNI_GRAY_IMAGE = 6, //!< Data given from RGB image generator - - CAP_OPENNI_IR_IMAGE = 7 //!< Data given from IR image generator - }; - -//! Supported output modes of OpenNI image generator -enum { CAP_OPENNI_VGA_30HZ = 0, - CAP_OPENNI_SXGA_15HZ = 1, - CAP_OPENNI_SXGA_30HZ = 2, - CAP_OPENNI_QVGA_30HZ = 3, - CAP_OPENNI_QVGA_60HZ = 4 - }; - -//! @} OpenNI - -/** @name GStreamer - @{ -*/ - -enum { CAP_PROP_GSTREAMER_QUEUE_LENGTH = 200 //!< Default is 1 - }; - -//! @} GStreamer - -/** @name PvAPI, Prosilica GigE SDK - @{ -*/ - -//! PVAPI -enum { CAP_PROP_PVAPI_MULTICASTIP = 300, //!< IP for enable multicast master mode. 0 for disable multicast. - CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, //!< FrameStartTriggerMode: Determines how a frame is initiated. - CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, //!< Horizontal sub-sampling of the image. - CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, //!< Vertical sub-sampling of the image. - CAP_PROP_PVAPI_BINNINGX = 304, //!< Horizontal binning factor. - CAP_PROP_PVAPI_BINNINGY = 305, //!< Vertical binning factor. - CAP_PROP_PVAPI_PIXELFORMAT = 306 //!< Pixel format. - }; - -//! PVAPI: FrameStartTriggerMode -enum { CAP_PVAPI_FSTRIGMODE_FREERUN = 0, //!< Freerun - CAP_PVAPI_FSTRIGMODE_SYNCIN1 = 1, //!< SyncIn1 - CAP_PVAPI_FSTRIGMODE_SYNCIN2 = 2, //!< SyncIn2 - CAP_PVAPI_FSTRIGMODE_FIXEDRATE = 3, //!< FixedRate - CAP_PVAPI_FSTRIGMODE_SOFTWARE = 4 //!< Software - }; - -//! PVAPI: DecimationHorizontal, DecimationVertical -enum { CAP_PVAPI_DECIMATION_OFF = 1, //!< Off - CAP_PVAPI_DECIMATION_2OUTOF4 = 2, //!< 2 out of 4 decimation - CAP_PVAPI_DECIMATION_2OUTOF8 = 4, //!< 2 out of 8 decimation - CAP_PVAPI_DECIMATION_2OUTOF16 = 8 //!< 2 out of 16 decimation - }; - -//! PVAPI: PixelFormat -enum { CAP_PVAPI_PIXELFORMAT_MONO8 = 1, //!< Mono8 - CAP_PVAPI_PIXELFORMAT_MONO16 = 2, //!< Mono16 - CAP_PVAPI_PIXELFORMAT_BAYER8 = 3, //!< Bayer8 - CAP_PVAPI_PIXELFORMAT_BAYER16 = 4, //!< Bayer16 - CAP_PVAPI_PIXELFORMAT_RGB24 = 5, //!< Rgb24 - CAP_PVAPI_PIXELFORMAT_BGR24 = 6, //!< Bgr24 - CAP_PVAPI_PIXELFORMAT_RGBA32 = 7, //!< Rgba32 - CAP_PVAPI_PIXELFORMAT_BGRA32 = 8, //!< Bgra32 - }; - -//! @} PvAPI - -/** @name XIMEA Camera API - @{ -*/ - -//! Properties of cameras available through XIMEA SDK backend -enum { CAP_PROP_XI_DOWNSAMPLING = 400, //!< Change image resolution by binning or skipping. - CAP_PROP_XI_DATA_FORMAT = 401, //!< Output data format. - CAP_PROP_XI_OFFSET_X = 402, //!< Horizontal offset from the origin to the area of interest (in pixels). - CAP_PROP_XI_OFFSET_Y = 403, //!< Vertical offset from the origin to the area of interest (in pixels). - CAP_PROP_XI_TRG_SOURCE = 404, //!< Defines source of trigger. - CAP_PROP_XI_TRG_SOFTWARE = 405, //!< Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. - CAP_PROP_XI_GPI_SELECTOR = 406, //!< Selects general purpose input. - CAP_PROP_XI_GPI_MODE = 407, //!< Set general purpose input mode. - CAP_PROP_XI_GPI_LEVEL = 408, //!< Get general purpose level. - CAP_PROP_XI_GPO_SELECTOR = 409, //!< Selects general purpose output. - CAP_PROP_XI_GPO_MODE = 410, //!< Set general purpose output mode. - CAP_PROP_XI_LED_SELECTOR = 411, //!< Selects camera signalling LED. - CAP_PROP_XI_LED_MODE = 412, //!< Define camera signalling LED functionality. - CAP_PROP_XI_MANUAL_WB = 413, //!< Calculates White Balance(must be called during acquisition). - CAP_PROP_XI_AUTO_WB = 414, //!< Automatic white balance. - CAP_PROP_XI_AEAG = 415, //!< Automatic exposure/gain. - CAP_PROP_XI_EXP_PRIORITY = 416, //!< Exposure priority (0.5 - exposure 50%, gain 50%). - CAP_PROP_XI_AE_MAX_LIMIT = 417, //!< Maximum limit of exposure in AEAG procedure. - CAP_PROP_XI_AG_MAX_LIMIT = 418, //!< Maximum limit of gain in AEAG procedure. - CAP_PROP_XI_AEAG_LEVEL = 419, //!< Average intensity of output signal AEAG should achieve(in %). - CAP_PROP_XI_TIMEOUT = 420, //!< Image capture timeout in milliseconds. - CAP_PROP_XI_EXPOSURE = 421, //!< Exposure time in microseconds. - CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, //!< Sets the number of times of exposure in one frame. - CAP_PROP_XI_GAIN_SELECTOR = 423, //!< Gain selector for parameter Gain allows to select different type of gains. - CAP_PROP_XI_GAIN = 424, //!< Gain in dB. - CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, //!< Change image downsampling type. - CAP_PROP_XI_BINNING_SELECTOR = 427, //!< Binning engine selector. - CAP_PROP_XI_BINNING_VERTICAL = 428, //!< Vertical Binning - number of vertical photo-sensitive cells to combine together. - CAP_PROP_XI_BINNING_HORIZONTAL = 429, //!< Horizontal Binning - number of horizontal photo-sensitive cells to combine together. - CAP_PROP_XI_BINNING_PATTERN = 430, //!< Binning pattern type. - CAP_PROP_XI_DECIMATION_SELECTOR = 431, //!< Decimation engine selector. - CAP_PROP_XI_DECIMATION_VERTICAL = 432, //!< Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor. - CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, //!< Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor. - CAP_PROP_XI_DECIMATION_PATTERN = 434, //!< Decimation pattern type. - CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587, //!< Selects which test pattern generator is controlled by the TestPattern feature. - CAP_PROP_XI_TEST_PATTERN = 588, //!< Selects which test pattern type is generated by the selected generator. - CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, //!< Output data format. - CAP_PROP_XI_SHUTTER_TYPE = 436, //!< Change sensor shutter type(CMOS sensor). - CAP_PROP_XI_SENSOR_TAPS = 437, //!< Number of taps. - CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, //!< Automatic exposure/gain ROI offset X. - CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, //!< Automatic exposure/gain ROI offset Y. - CAP_PROP_XI_AEAG_ROI_WIDTH = 441, //!< Automatic exposure/gain ROI Width. - CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, //!< Automatic exposure/gain ROI Height. - CAP_PROP_XI_BPC = 445, //!< Correction of bad pixels. - CAP_PROP_XI_WB_KR = 448, //!< White balance red coefficient. - CAP_PROP_XI_WB_KG = 449, //!< White balance green coefficient. - CAP_PROP_XI_WB_KB = 450, //!< White balance blue coefficient. - CAP_PROP_XI_WIDTH = 451, //!< Width of the Image provided by the device (in pixels). - CAP_PROP_XI_HEIGHT = 452, //!< Height of the Image provided by the device (in pixels). - CAP_PROP_XI_REGION_SELECTOR = 589, //!< Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode. - CAP_PROP_XI_REGION_MODE = 595, //!< Activates/deactivates Region selected by Region Selector. - CAP_PROP_XI_LIMIT_BANDWIDTH = 459, //!< Set/get bandwidth(datarate)(in Megabits). - CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, //!< Sensor output data bit depth. - CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, //!< Device output data bit depth. - CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, //!< bitdepth of data returned by function xiGetImage. - CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, //!< Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available. - CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, //!< Data packing type. Some cameras supports only specific packing type. - CAP_PROP_XI_IS_COOLED = 465, //!< Returns 1 for cameras that support cooling. - CAP_PROP_XI_COOLING = 466, //!< Start camera cooling. - CAP_PROP_XI_TARGET_TEMP = 467, //!< Set sensor target temperature for cooling. - CAP_PROP_XI_CHIP_TEMP = 468, //!< Camera sensor temperature. - CAP_PROP_XI_HOUS_TEMP = 469, //!< Camera housing temperature. - CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590, //!< Camera housing back side temperature. - CAP_PROP_XI_SENSOR_BOARD_TEMP = 596, //!< Camera sensor board temperature. - CAP_PROP_XI_CMS = 470, //!< Mode of color management system. - CAP_PROP_XI_APPLY_CMS = 471, //!< Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE). - CAP_PROP_XI_IMAGE_IS_COLOR = 474, //!< Returns 1 for color cameras. - CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, //!< Returns color filter array type of RAW data. - CAP_PROP_XI_GAMMAY = 476, //!< Luminosity gamma. - CAP_PROP_XI_GAMMAC = 477, //!< Chromaticity gamma. - CAP_PROP_XI_SHARPNESS = 478, //!< Sharpness Strength. - CAP_PROP_XI_CC_MATRIX_00 = 479, //!< Color Correction Matrix element [0][0]. - CAP_PROP_XI_CC_MATRIX_01 = 480, //!< Color Correction Matrix element [0][1]. - CAP_PROP_XI_CC_MATRIX_02 = 481, //!< Color Correction Matrix element [0][2]. - CAP_PROP_XI_CC_MATRIX_03 = 482, //!< Color Correction Matrix element [0][3]. - CAP_PROP_XI_CC_MATRIX_10 = 483, //!< Color Correction Matrix element [1][0]. - CAP_PROP_XI_CC_MATRIX_11 = 484, //!< Color Correction Matrix element [1][1]. - CAP_PROP_XI_CC_MATRIX_12 = 485, //!< Color Correction Matrix element [1][2]. - CAP_PROP_XI_CC_MATRIX_13 = 486, //!< Color Correction Matrix element [1][3]. - CAP_PROP_XI_CC_MATRIX_20 = 487, //!< Color Correction Matrix element [2][0]. - CAP_PROP_XI_CC_MATRIX_21 = 488, //!< Color Correction Matrix element [2][1]. - CAP_PROP_XI_CC_MATRIX_22 = 489, //!< Color Correction Matrix element [2][2]. - CAP_PROP_XI_CC_MATRIX_23 = 490, //!< Color Correction Matrix element [2][3]. - CAP_PROP_XI_CC_MATRIX_30 = 491, //!< Color Correction Matrix element [3][0]. - CAP_PROP_XI_CC_MATRIX_31 = 492, //!< Color Correction Matrix element [3][1]. - CAP_PROP_XI_CC_MATRIX_32 = 493, //!< Color Correction Matrix element [3][2]. - CAP_PROP_XI_CC_MATRIX_33 = 494, //!< Color Correction Matrix element [3][3]. - CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, //!< Set default Color Correction Matrix. - CAP_PROP_XI_TRG_SELECTOR = 498, //!< Selects the type of trigger. - CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, //!< Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart. - CAP_PROP_XI_DEBOUNCE_EN = 507, //!< Enable/Disable debounce to selected GPI. - CAP_PROP_XI_DEBOUNCE_T0 = 508, //!< Debounce time (x * 10us). - CAP_PROP_XI_DEBOUNCE_T1 = 509, //!< Debounce time (x * 10us). - CAP_PROP_XI_DEBOUNCE_POL = 510, //!< Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge). - CAP_PROP_XI_LENS_MODE = 511, //!< Status of lens control interface. This shall be set to XI_ON before any Lens operations. - CAP_PROP_XI_LENS_APERTURE_VALUE = 512, //!< Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11. - CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, //!< Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps. - CAP_PROP_XI_LENS_FOCUS_MOVE = 514, //!< Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE. - CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, //!< Lens focus distance in cm. - CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, //!< Lens focal distance in mm. - CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, //!< Selects the current feature which is accessible by XI_PRM_LENS_FEATURE. - CAP_PROP_XI_LENS_FEATURE = 518, //!< Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR. - CAP_PROP_XI_DEVICE_MODEL_ID = 521, //!< Returns device model id. - CAP_PROP_XI_DEVICE_SN = 522, //!< Returns device serial number. - CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, //!< The alpha channel of RGB32 output image format. - CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, //!< Buffer size in bytes sufficient for output image returned by xiGetImage. - CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, //!< Current format of pixels on transport layer. - CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, //!< Sensor clock frequency in Hz. - CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, //!< Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index. - CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, //!< Number of output channels from sensor used for data transfer. - CAP_PROP_XI_FRAMERATE = 535, //!< Define framerate in Hz. - CAP_PROP_XI_COUNTER_SELECTOR = 536, //!< Select counter. - CAP_PROP_XI_COUNTER_VALUE = 537, //!< Counter status. - CAP_PROP_XI_ACQ_TIMING_MODE = 538, //!< Type of sensor frames timing. - CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, //!< Calculate and returns available interface bandwidth(int Megabits). - CAP_PROP_XI_BUFFER_POLICY = 540, //!< Data move policy. - CAP_PROP_XI_LUT_EN = 541, //!< Activates LUT. - CAP_PROP_XI_LUT_INDEX = 542, //!< Control the index (offset) of the coefficient to access in the LUT. - CAP_PROP_XI_LUT_VALUE = 543, //!< Value at entry LUTIndex of the LUT. - CAP_PROP_XI_TRG_DELAY = 544, //!< Specifies the delay in microseconds (us) to apply after the trigger reception before activating it. - CAP_PROP_XI_TS_RST_MODE = 545, //!< Defines how time stamp reset engine will be armed. - CAP_PROP_XI_TS_RST_SOURCE = 546, //!< Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming). - CAP_PROP_XI_IS_DEVICE_EXIST = 547, //!< Returns 1 if camera connected and works properly. - CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, //!< Acquisition buffer size in buffer_size_unit. Default bytes. - CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, //!< Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes. - CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, //!< Acquisition transport buffer size in bytes. - CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, //!< Queue of field/frame buffers. - CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, //!< Number of buffers to commit to low level. - CAP_PROP_XI_RECENT_FRAME = 553, //!< GetImage returns most recent frame. - CAP_PROP_XI_DEVICE_RESET = 554, //!< Resets the camera to default state. - CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, //!< Correction of column FPN. - CAP_PROP_XI_ROW_FPN_CORRECTION = 591, //!< Correction of row FPN. - CAP_PROP_XI_SENSOR_MODE = 558, //!< Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling. - CAP_PROP_XI_HDR = 559, //!< Enable High Dynamic Range feature. - CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, //!< The number of kneepoints in the PWLR. - CAP_PROP_XI_HDR_T1 = 561, //!< Position of first kneepoint(in % of XI_PRM_EXPOSURE). - CAP_PROP_XI_HDR_T2 = 562, //!< Position of second kneepoint (in % of XI_PRM_EXPOSURE). - CAP_PROP_XI_KNEEPOINT1 = 563, //!< Value of first kneepoint (% of sensor saturation). - CAP_PROP_XI_KNEEPOINT2 = 564, //!< Value of second kneepoint (% of sensor saturation). - CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, //!< Last image black level counts. Can be used for Offline processing to recall it. - CAP_PROP_XI_HW_REVISION = 571, //!< Returns hardware revision number. - CAP_PROP_XI_DEBUG_LEVEL = 572, //!< Set debug level. - CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, //!< Automatic bandwidth calculation. - CAP_PROP_XI_FFS_FILE_ID = 594, //!< File number. - CAP_PROP_XI_FFS_FILE_SIZE = 580, //!< Size of file. - CAP_PROP_XI_FREE_FFS_SIZE = 581, //!< Size of free camera FFS. - CAP_PROP_XI_USED_FFS_SIZE = 582, //!< Size of used camera FFS. - CAP_PROP_XI_FFS_ACCESS_KEY = 583, //!< Setting of key enables file operations on some cameras. - CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, //!< Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE. - CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, //!< Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR. - }; - -//! @} XIMEA - -/** @name AVFoundation framework for iOS - OS X Lion will have the same API - @{ -*/ - -//! Properties of cameras available through AVFOUNDATION backend -enum { CAP_PROP_IOS_DEVICE_FOCUS = 9001, - CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, - CAP_PROP_IOS_DEVICE_FLASH = 9003, - CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, - CAP_PROP_IOS_DEVICE_TORCH = 9005 - }; - -/** @name Smartek Giganetix GigEVisionSDK - @{ -*/ - -//! Properties of cameras available through Smartek Giganetix Ethernet Vision backend -/* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */ -enum { CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, - CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, - CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, - CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, - CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, - CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006 - }; - -//! @} Smartek - -/** @name Intel Perceptual Computing SDK - @{ -*/ -enum { CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, - CAP_PROP_INTELPERC_PROFILE_IDX = 11002, - CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, - CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, - CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, - CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, - CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007 - }; - -//! Intel Perceptual Streams -enum { CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, - CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, - CAP_INTELPERC_GENERATORS_MASK = CAP_INTELPERC_DEPTH_GENERATOR + CAP_INTELPERC_IMAGE_GENERATOR - }; - -enum { CAP_INTELPERC_DEPTH_MAP = 0, //!< Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth. - CAP_INTELPERC_UVDEPTH_MAP = 1, //!< Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates. - CAP_INTELPERC_IR_MAP = 2, //!< Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam. - CAP_INTELPERC_IMAGE = 3 - }; - -//! @} Intel Perceptual - -/** @name gPhoto2 connection - @{ -*/ - -/** @brief gPhoto2 properties - -If `propertyId` is less than 0 then work on widget with that __additive inversed__ camera setting ID -Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE. -@see CvCaptureCAM_GPHOTO2 for more info -*/ -enum { CAP_PROP_GPHOTO2_PREVIEW = 17001, //!< Capture only preview from liveview mode. - CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, //!< Readonly, returns (const char *). - CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, //!< Trigger, only by set. Reload camera settings. - CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, //!< Reload all settings on set. - CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, //!< Collect messages with details. - CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, //!< Readonly, returns (const char *). - CAP_PROP_SPEED = 17007, //!< Exposure speed. Can be readonly, depends on camera program. - CAP_PROP_APERTURE = 17008, //!< Aperture. Can be readonly, depends on camera program. - CAP_PROP_EXPOSUREPROGRAM = 17009, //!< Camera exposure program. - CAP_PROP_VIEWFINDER = 17010 //!< Enter liveview mode. - }; - -//! @} gPhoto2 - - -/** @name Images backend - @{ -*/ - -/** @brief Images backend properties - -*/ -enum { CAP_PROP_IMAGES_BASE = 18000, - CAP_PROP_IMAGES_LAST = 19000 // excluding - }; - -//! @} Images - -//! @} videoio_flags_others - - -class IVideoCapture; - -/** @brief Class for video capturing from video files, image sequences or cameras. - -The class provides C++ API for capturing video from cameras or for reading video files and image sequences. - -Here is how the class can be used: -@include samples/cpp/videocapture_basic.cpp - -@note In @ref videoio_c "C API" the black-box structure `CvCapture` is used instead of %VideoCapture. -@note -- (C++) A basic sample on using the %VideoCapture interface can be found at - `OPENCV_SOURCE_CODE/samples/cpp/videocapture_starter.cpp` -- (Python) A basic sample on using the %VideoCapture interface can be found at - `OPENCV_SOURCE_CODE/samples/python/video.py` -- (Python) A multi threaded video processing sample can be found at - `OPENCV_SOURCE_CODE/samples/python/video_threaded.py` -- (Python) %VideoCapture sample showcasing some features of the Video4Linux2 backend - `OPENCV_SOURCE_CODE/samples/python/video_v4l2.py` - */ -class CV_EXPORTS_W VideoCapture -{ -public: - /** @brief Default constructor - @note In @ref videoio_c "C API", when you finished working with video, release CvCapture structure with - cvReleaseCapture(), or use Ptr\ that calls cvReleaseCapture() automatically in the - destructor. - */ - CV_WRAP VideoCapture(); - - /** @overload - @brief Open video file or a capturing device or a IP video stream for video capturing - - Same as VideoCapture(const String& filename, int apiPreference) but using default Capture API backends - */ - CV_WRAP VideoCapture(const String& filename); - - /** @overload - @brief Open video file or a capturing device or a IP video stream for video capturing with API Preference - - @param filename it can be: - - name of video file (eg. `video.avi`) - - or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_00.jpg, img_01.jpg, img_02.jpg, ...`) - - or URL of video stream (eg. `protocol://host:port/script_name?script_params|auth`). - Note that each video stream or IP camera feed has its own URL scheme. Please refer to the - documentation of source stream to know the right URL. - @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader - implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW. - @sa The list of supported API backends cv::VideoCaptureAPIs - */ - CV_WRAP VideoCapture(const String& filename, int apiPreference); - - /** @overload - @brief Open a camera for video capturing - - @param index camera_id + domain_offset (CAP_*) id of the video capturing device to open. To open default camera using default backend just pass 0. - Use a `domain_offset` to enforce a specific reader implementation if multiple are available like cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW. - e.g. to open Camera 1 using the MS Media Foundation API use `index = 1 + cv::CAP_MSMF` - - @sa The list of supported API backends cv::VideoCaptureAPIs - */ - CV_WRAP VideoCapture(int index); - - /** @overload - @brief Opens a camera for video capturing - - @param index id of the video capturing device to open. To open default camera using default backend just pass 0. - (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY) - @param apiPreference preferred Capture API backends to use. Can be used to enforce a specific reader - implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L2. - - @sa The list of supported API backends cv::VideoCaptureAPIs - */ - CV_WRAP VideoCapture(int index, int apiPreference); - - /** @brief Default destructor - - The method first calls VideoCapture::release to close the already opened file or camera. - */ - virtual ~VideoCapture(); - - /** @brief Open video file or a capturing device or a IP video stream for video capturing - - @overload - - Parameters are same as the constructor VideoCapture(const String& filename) - @return `true` if the file has been successfully opened - - The method first calls VideoCapture::release to close the already opened file or camera. - */ - CV_WRAP virtual bool open(const String& filename); - - /** @brief Open a camera for video capturing - - @overload - - Parameters are same as the constructor VideoCapture(int index) - @return `true` if the camera has been successfully opened. - - The method first calls VideoCapture::release to close the already opened file or camera. - */ - CV_WRAP virtual bool open(int index); - - /** @brief Open a camera for video capturing - - @overload - - Parameters are similar as the constructor VideoCapture(int index),except it takes an additional argument apiPreference. - Definitely, is same as open(int index) where `index=cameraNum + apiPreference` - @return `true` if the camera has been successfully opened. - */ - CV_WRAP bool open(int cameraNum, int apiPreference); - - /** @brief Returns true if video capturing has been initialized already. - - If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns - true. - */ - CV_WRAP virtual bool isOpened() const; - - /** @brief Closes video file or capturing device. - - The method is automatically called by subsequent VideoCapture::open and by VideoCapture - destructor. - - The C function also deallocates memory and clears \*capture pointer. - */ - CV_WRAP virtual void release(); - - /** @brief Grabs the next frame from video file or capturing device. - - @return `true` (non-zero) in the case of success. - - The method/function grabs the next frame from video file or camera and returns true (non-zero) in - the case of success. - - The primary use of the function is in multi-camera environments, especially when the cameras do not - have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that - call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way - the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames - from different cameras will be closer in time. - - Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the - correct way of retrieving data from it is to call VideoCapture::grab() first and then call - VideoCapture::retrieve() one or more times with different values of the channel parameter. - - @ref tutorial_kinect_openni - */ - CV_WRAP virtual bool grab(); - - /** @brief Decodes and returns the grabbed video frame. - - @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty. - @param flag it could be a frame index or a driver specific flag - @return `false` if no frames has been grabbed - - The method decodes and returns the just grabbed frame. If no frames has been grabbed - (camera has been disconnected, or there are no more frames in video file), the method returns false - and the function returns an empty image (with %cv::Mat, test it with Mat::empty()). - - @sa read() - - @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video - capturing structure. It is not allowed to modify or release the image! You can copy the frame using - cvCloneImage and then do whatever you want with the copy. - */ - CV_WRAP virtual bool retrieve(OutputArray image, int flag = 0); - - /** @brief Stream operator to read the next video frame. - @sa read() - */ - virtual VideoCapture& operator >> (CV_OUT Mat& image); - - /** @overload - @sa read() - */ - virtual VideoCapture& operator >> (CV_OUT UMat& image); - - /** @brief Grabs, decodes and returns the next video frame. - - @param [out] image the video frame is returned here. If no frames has been grabbed the image will be empty. - @return `false` if no frames has been grabbed - - The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the - most convenient method for reading video files or capturing data from decode and returns the just - grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more - frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()). - - @note In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video - capturing structure. It is not allowed to modify or release the image! You can copy the frame using - cvCloneImage and then do whatever you want with the copy. - */ - CV_WRAP virtual bool read(OutputArray image); - - /** @brief Sets a property in the VideoCapture. - - @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...) - or one from @ref videoio_flags_others - @param value Value of the property. - @return `true` if the property is supported by backend used by the VideoCapture instance. - @note Even if it returns `true` this doesn't ensure that the property - value has been accepted by the capture device. See note in VideoCapture::get() - */ - CV_WRAP virtual bool set(int propId, double value); - - /** @brief Returns the specified VideoCapture property - - @param propId Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...) - or one from @ref videoio_flags_others - @return Value for the specified property. Value 0 is returned when querying a property that is - not supported by the backend used by the VideoCapture instance. - - @note Reading / writing properties involves many layers. Some unexpected result might happens - along this chain. - @code {.txt} - `VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware` - @endcode - The returned value might be different from what really used by the device or it could be encoded - using device dependent rules (eg. steps or percentage). Effective behaviour depends from device - driver and API Backend - - */ - CV_WRAP virtual double get(int propId) const; - - /** @brief Open video file or a capturing device or a IP video stream for video capturing with API Preference - - @overload - - Parameters are same as the constructor VideoCapture(const String& filename, int apiPreference) - @return `true` if the file has been successfully opened - - The method first calls VideoCapture::release to close the already opened file or camera. - */ - CV_WRAP virtual bool open(const String& filename, int apiPreference); - - /** @brief Returns used backend API name - - @note Stream should be opened. - */ - CV_WRAP String getBackendName() const; - -protected: - Ptr cap; - Ptr icap; -}; - -class IVideoWriter; - -/** @example samples/cpp/tutorial_code/videoio/video-write/video-write.cpp -Check @ref tutorial_video_write "the corresponding tutorial" for more details -*/ - -/** @example samples/cpp/videowriter_basic.cpp -An example using VideoCapture and VideoWriter class -*/ - -/** @brief Video writer class. - -The class provides C++ API for writing video files or image sequences. -*/ -class CV_EXPORTS_W VideoWriter -{ -public: - /** @brief Default constructors - - The constructors/functions initialize video writers. - - On Linux FFMPEG is used to write videos; - - On Windows FFMPEG or VFW is used; - - On MacOSX QTKit is used. - */ - CV_WRAP VideoWriter(); - - /** @overload - @param filename Name of the output video file. - @param fourcc 4-character code of codec used to compress the frames. For example, - VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a - motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by - FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses - other values as fourcc code: see [ObjectType](http://www.mp4ra.org/codecs.html), - so you may receive a warning message from OpenCV about fourcc code conversion. - @param fps Framerate of the created video stream. - @param frameSize Size of the video frames. - @param isColor If it is not zero, the encoder will expect and encode color frames, otherwise it - will work with grayscale frames (the flag is currently supported on Windows only). - - @b Tips: - - With some backends `fourcc=-1` pops up the codec selection dialog from the system. - - To save image sequence use a proper filename (eg. `img_%02d.jpg`) and `fourcc=0` - OR `fps=0`. Use uncompressed image format (eg. `img_%02d.BMP`) to save raw frames. - - Most codecs are lossy. If you want lossless video file you need to use a lossless codecs - (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...) - - If FFMPEG is enabled, using `codec=0; fps=0;` you can create an uncompressed (raw) video file. - */ - CV_WRAP VideoWriter(const String& filename, int fourcc, double fps, - Size frameSize, bool isColor = true); - - /** @overload - The `apiPreference` parameter allows to specify API backends to use. Can be used to enforce a specific reader implementation - if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER. - */ - CV_WRAP VideoWriter(const String& filename, int apiPreference, int fourcc, double fps, - Size frameSize, bool isColor = true); - - /** @brief Default destructor - - The method first calls VideoWriter::release to close the already opened file. - */ - virtual ~VideoWriter(); - - /** @brief Initializes or reinitializes video writer. - - The method opens video writer. Parameters are the same as in the constructor - VideoWriter::VideoWriter. - @return `true` if video writer has been successfully initialized - - The method first calls VideoWriter::release to close the already opened file. - */ - CV_WRAP virtual bool open(const String& filename, int fourcc, double fps, - Size frameSize, bool isColor = true); - - /** @overload - */ - CV_WRAP bool open(const String& filename, int apiPreference, int fourcc, double fps, - Size frameSize, bool isColor = true); - - /** @brief Returns true if video writer has been successfully initialized. - */ - CV_WRAP virtual bool isOpened() const; - - /** @brief Closes the video writer. - - The method is automatically called by subsequent VideoWriter::open and by the VideoWriter - destructor. - */ - CV_WRAP virtual void release(); - - /** @brief Stream operator to write the next video frame. - @sa write - */ - virtual VideoWriter& operator << (const Mat& image); - - /** @brief Writes the next video frame - - @param image The written frame. In general, color images are expected in BGR format. - - The function/method writes the specified image to video file. It must have the same size as has - been specified when opening the video writer. - */ - CV_WRAP virtual void write(const Mat& image); - - /** @brief Sets a property in the VideoWriter. - - @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) - or one of @ref videoio_flags_others - - @param value Value of the property. - @return `true` if the property is supported by the backend used by the VideoWriter instance. - */ - CV_WRAP virtual bool set(int propId, double value); - - /** @brief Returns the specified VideoWriter property - - @param propId Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) - or one of @ref videoio_flags_others - - @return Value for the specified property. Value 0 is returned when querying a property that is - not supported by the backend used by the VideoWriter instance. - */ - CV_WRAP virtual double get(int propId) const; - - /** @brief Concatenates 4 chars to a fourcc code - - @return a fourcc code - - This static method constructs the fourcc code of the codec to be used in the constructor - VideoWriter::VideoWriter or VideoWriter::open. - */ - CV_WRAP static int fourcc(char c1, char c2, char c3, char c4); - - /** @brief Returns used backend API name - - @note Stream should be opened. - */ - CV_WRAP String getBackendName() const; - -protected: - Ptr writer; - Ptr iwriter; - - static Ptr create(const String& filename, int fourcc, double fps, - Size frameSize, bool isColor = true); -}; - -template<> CV_EXPORTS void DefaultDeleter::operator ()(CvCapture* obj) const; -template<> CV_EXPORTS void DefaultDeleter::operator ()(CvVideoWriter* obj) const; - -//! @} videoio - -} // cv - -#endif //OPENCV_VIDEOIO_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videoio/cap_ios.h b/qt-correction-tool/pub/opencv/include/opencv2/videoio/cap_ios.h deleted file mode 100644 index 207ad46..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videoio/cap_ios.h +++ /dev/null @@ -1,150 +0,0 @@ -/* For iOS video I/O - * by Eduard Feicho on 29/07/12 - * Copyright 2012. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; - * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -#import -#import -#import -#import -#include "opencv2/core.hpp" - -//! @addtogroup videoio_ios -//! @{ - -/////////////////////////////////////// CvAbstractCamera ///////////////////////////////////// - -@class CvAbstractCamera; - -CV_EXPORTS @interface CvAbstractCamera : NSObject -{ - UIDeviceOrientation currentDeviceOrientation; - - BOOL cameraAvailable; -} - -@property (nonatomic, strong) AVCaptureSession* captureSession; -@property (nonatomic, strong) AVCaptureConnection* videoCaptureConnection; - -@property (nonatomic, readonly) BOOL running; -@property (nonatomic, readonly) BOOL captureSessionLoaded; - -@property (nonatomic, assign) int defaultFPS; -@property (nonatomic, readonly) AVCaptureVideoPreviewLayer *captureVideoPreviewLayer; -@property (nonatomic, assign) AVCaptureDevicePosition defaultAVCaptureDevicePosition; -@property (nonatomic, assign) AVCaptureVideoOrientation defaultAVCaptureVideoOrientation; -@property (nonatomic, assign) BOOL useAVCaptureVideoPreviewLayer; -@property (nonatomic, strong) NSString *const defaultAVCaptureSessionPreset; - -@property (nonatomic, assign) int imageWidth; -@property (nonatomic, assign) int imageHeight; - -@property (nonatomic, strong) UIView* parentView; - -- CV_UNUSED(start); -- CV_UNUSED(stop); -- CV_UNUSED(switchCameras); - -- (id)initWithParentView:(UIView*)parent; - -- CV_UNUSED(createCaptureOutput); -- CV_UNUSED(createVideoPreviewLayer); -- CV_UNUSED(updateOrientation); - -- CV_UNUSED(lockFocus); -- CV_UNUSED(unlockFocus); -- CV_UNUSED(lockExposure); -- CV_UNUSED(unlockExposure); -- CV_UNUSED(lockBalance); -- CV_UNUSED(unlockBalance); - -@end - -///////////////////////////////// CvVideoCamera /////////////////////////////////////////// - -@class CvVideoCamera; - -CV_EXPORTS @protocol CvVideoCameraDelegate - -#ifdef __cplusplus -// delegate method for processing image frames -- (void)processImage:(cv::Mat&)image; -#endif - -@end - -CV_EXPORTS @interface CvVideoCamera : CvAbstractCamera -{ - AVCaptureVideoDataOutput *videoDataOutput; - - dispatch_queue_t videoDataOutputQueue; - CALayer *customPreviewLayer; - - CMTime lastSampleTime; - -} - -@property (nonatomic, weak) id delegate; -@property (nonatomic, assign) BOOL grayscaleMode; - -@property (nonatomic, assign) BOOL recordVideo; -@property (nonatomic, assign) BOOL rotateVideo; -@property (nonatomic, strong) AVAssetWriterInput* recordAssetWriterInput; -@property (nonatomic, strong) AVAssetWriterInputPixelBufferAdaptor* recordPixelBufferAdaptor; -@property (nonatomic, strong) AVAssetWriter* recordAssetWriter; - -- (void)adjustLayoutToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation; -- CV_UNUSED(layoutPreviewLayer); -- CV_UNUSED(saveVideo); -- (NSURL *)videoFileURL; -- (NSString *)videoFileString; - - -@end - -///////////////////////////////// CvPhotoCamera /////////////////////////////////////////// - -@class CvPhotoCamera; - -CV_EXPORTS @protocol CvPhotoCameraDelegate - -- (void)photoCamera:(CvPhotoCamera*)photoCamera capturedImage:(UIImage *)image; -- (void)photoCameraCancel:(CvPhotoCamera*)photoCamera; - -@end - -CV_EXPORTS @interface CvPhotoCamera : CvAbstractCamera -{ - AVCaptureStillImageOutput *stillImageOutput; -} - -@property (nonatomic, weak) id delegate; - -- CV_UNUSED(takePicture); - -@end - -//! @} videoio_ios diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videoio/registry.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videoio/registry.hpp deleted file mode 100644 index 7404c68..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videoio/registry.hpp +++ /dev/null @@ -1,44 +0,0 @@ -// This file is part of OpenCV project. -// It is subject to the license terms in the LICENSE file found in the top-level directory -// of this distribution and at http://opencv.org/license.html. - -#ifndef OPENCV_VIDEOIO_REGISTRY_HPP -#define OPENCV_VIDEOIO_REGISTRY_HPP - -#include - -namespace cv { namespace videoio_registry { -/** @addtogroup videoio_registry -This section contains API description how to query/configure available Video I/O backends. - -Runtime configuration options: -- enable debug mode: `OPENCV_VIDEOIO_DEBUG=1` -- change backend priority: `OPENCV_VIDEOIO_PRIORITY_=9999` -- disable backend: `OPENCV_VIDEOIO_PRIORITY_=0` -- specify list of backends with high priority (>100000): `OPENCV_VIDEOIO_PRIORITY_LIST=FFMPEG,GSTREAMER` - -@{ - */ - - -/** @brief Returns backend API name or "unknown" -@param api backend ID (#VideoCaptureAPIs) -*/ -CV_EXPORTS_W cv::String getBackendName(VideoCaptureAPIs api); - -/** @brief Returns list of all builtin backends */ -CV_EXPORTS_W std::vector getBackends(); - -/** @brief Returns list of available backends which works via `cv::VideoCapture(int index)` */ -CV_EXPORTS_W std::vector getCameraBackends(); - -/** @brief Returns list of available backends which works via `cv::VideoCapture(filename)` */ -CV_EXPORTS_W std::vector getStreamBackends(); - -/** @brief Returns list of available backends which works via `cv::VideoWriter()` */ -CV_EXPORTS_W std::vector getWriterBackends(); - -//! @} -}} // namespace - -#endif // OPENCV_VIDEOIO_REGISTRY_HPP diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio.hpp deleted file mode 100644 index ec84cf7..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009, Willow Garage Inc., all rights reserved. -// Copyright (C) 2013, OpenCV Foundation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifdef __OPENCV_BUILD -#error this is a compatibility header which should not be used inside the OpenCV library -#endif - -#include "opencv2/videoio.hpp" diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio_c.h b/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio_c.h deleted file mode 100644 index 32f6ec7..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videoio/videoio_c.h +++ /dev/null @@ -1,587 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// Intel License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000, Intel Corporation, all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of Intel Corporation may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOIO_H -#define OPENCV_VIDEOIO_H - -#include "opencv2/core/core_c.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/** - @addtogroup videoio_c - @{ -*/ - -/****************************************************************************************\ -* Working with Video Files and Cameras * -\****************************************************************************************/ - -/** @brief "black box" capture structure - -In C++ use cv::VideoCapture -*/ -typedef struct CvCapture CvCapture; - -/** @brief start capturing frames from video file -*/ -CVAPI(CvCapture*) cvCreateFileCapture( const char* filename ); - -/** @brief start capturing frames from video file. allows specifying a preferred API to use -*/ -CVAPI(CvCapture*) cvCreateFileCaptureWithPreference( const char* filename , int apiPreference); - -enum -{ - CV_CAP_ANY =0, // autodetect - - CV_CAP_MIL =100, // MIL proprietary drivers - - CV_CAP_VFW =200, // platform native - CV_CAP_V4L =200, - CV_CAP_V4L2 =200, - - CV_CAP_FIREWARE =300, // IEEE 1394 drivers - CV_CAP_FIREWIRE =300, - CV_CAP_IEEE1394 =300, - CV_CAP_DC1394 =300, - CV_CAP_CMU1394 =300, - - CV_CAP_STEREO =400, // TYZX proprietary drivers - CV_CAP_TYZX =400, - CV_TYZX_LEFT =400, - CV_TYZX_RIGHT =401, - CV_TYZX_COLOR =402, - CV_TYZX_Z =403, - - CV_CAP_QT =500, // QuickTime - - CV_CAP_UNICAP =600, // Unicap drivers - - CV_CAP_DSHOW =700, // DirectShow (via videoInput) - CV_CAP_MSMF =1400, // Microsoft Media Foundation (via videoInput) - - CV_CAP_PVAPI =800, // PvAPI, Prosilica GigE SDK - - CV_CAP_OPENNI =900, // OpenNI (for Kinect) - CV_CAP_OPENNI_ASUS =910, // OpenNI (for Asus Xtion) - - CV_CAP_ANDROID =1000, // Android - not used - CV_CAP_ANDROID_BACK =CV_CAP_ANDROID+99, // Android back camera - not used - CV_CAP_ANDROID_FRONT =CV_CAP_ANDROID+98, // Android front camera - not used - - CV_CAP_XIAPI =1100, // XIMEA Camera API - - CV_CAP_AVFOUNDATION = 1200, // AVFoundation framework for iOS (OS X Lion will have the same API) - - CV_CAP_GIGANETIX = 1300, // Smartek Giganetix GigEVisionSDK - - CV_CAP_INTELPERC = 1500, // Intel Perceptual Computing - - CV_CAP_OPENNI2 = 1600, // OpenNI2 (for Kinect) - CV_CAP_GPHOTO2 = 1700, - CV_CAP_GSTREAMER = 1800, // GStreamer - CV_CAP_FFMPEG = 1900, // FFMPEG - CV_CAP_IMAGES = 2000, // OpenCV Image Sequence (e.g. img_%02d.jpg) - - CV_CAP_ARAVIS = 2100 // Aravis GigE SDK -}; - -/** @brief start capturing frames from camera: index = camera_index + domain_offset (CV_CAP_*) -*/ -CVAPI(CvCapture*) cvCreateCameraCapture( int index ); - -/** @brief grab a frame, return 1 on success, 0 on fail. - - this function is thought to be fast -*/ -CVAPI(int) cvGrabFrame( CvCapture* capture ); - -/** @brief get the frame grabbed with cvGrabFrame(..) - - This function may apply some frame processing like - frame decompression, flipping etc. - @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!! -*/ -CVAPI(IplImage*) cvRetrieveFrame( CvCapture* capture, int streamIdx CV_DEFAULT(0) ); - -/** @brief Just a combination of cvGrabFrame and cvRetrieveFrame - - @warning !!!DO NOT RELEASE or MODIFY the retrieved frame!!! -*/ -CVAPI(IplImage*) cvQueryFrame( CvCapture* capture ); - -/** @brief stop capturing/reading and free resources -*/ -CVAPI(void) cvReleaseCapture( CvCapture** capture ); - -enum -{ - // modes of the controlling registers (can be: auto, manual, auto single push, absolute Latter allowed with any other mode) - // every feature can have only one mode turned on at a time - CV_CAP_PROP_DC1394_OFF = -4, //turn the feature off (not controlled manually nor automatically) - CV_CAP_PROP_DC1394_MODE_MANUAL = -3, //set automatically when a value of the feature is set by the user - CV_CAP_PROP_DC1394_MODE_AUTO = -2, - CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO = -1, - CV_CAP_PROP_POS_MSEC =0, - CV_CAP_PROP_POS_FRAMES =1, - CV_CAP_PROP_POS_AVI_RATIO =2, - CV_CAP_PROP_FRAME_WIDTH =3, - CV_CAP_PROP_FRAME_HEIGHT =4, - CV_CAP_PROP_FPS =5, - CV_CAP_PROP_FOURCC =6, - CV_CAP_PROP_FRAME_COUNT =7, - CV_CAP_PROP_FORMAT =8, - CV_CAP_PROP_MODE =9, - CV_CAP_PROP_BRIGHTNESS =10, - CV_CAP_PROP_CONTRAST =11, - CV_CAP_PROP_SATURATION =12, - CV_CAP_PROP_HUE =13, - CV_CAP_PROP_GAIN =14, - CV_CAP_PROP_EXPOSURE =15, - CV_CAP_PROP_CONVERT_RGB =16, - CV_CAP_PROP_WHITE_BALANCE_BLUE_U =17, - CV_CAP_PROP_RECTIFICATION =18, - CV_CAP_PROP_MONOCHROME =19, - CV_CAP_PROP_SHARPNESS =20, - CV_CAP_PROP_AUTO_EXPOSURE =21, // exposure control done by camera, - // user can adjust reference level - // using this feature - CV_CAP_PROP_GAMMA =22, - CV_CAP_PROP_TEMPERATURE =23, - CV_CAP_PROP_TRIGGER =24, - CV_CAP_PROP_TRIGGER_DELAY =25, - CV_CAP_PROP_WHITE_BALANCE_RED_V =26, - CV_CAP_PROP_ZOOM =27, - CV_CAP_PROP_FOCUS =28, - CV_CAP_PROP_GUID =29, - CV_CAP_PROP_ISO_SPEED =30, - CV_CAP_PROP_MAX_DC1394 =31, - CV_CAP_PROP_BACKLIGHT =32, - CV_CAP_PROP_PAN =33, - CV_CAP_PROP_TILT =34, - CV_CAP_PROP_ROLL =35, - CV_CAP_PROP_IRIS =36, - CV_CAP_PROP_SETTINGS =37, - CV_CAP_PROP_BUFFERSIZE =38, - CV_CAP_PROP_AUTOFOCUS =39, - CV_CAP_PROP_SAR_NUM =40, - CV_CAP_PROP_SAR_DEN =41, - - CV_CAP_PROP_AUTOGRAB =1024, // property for videoio class CvCapture_Android only - CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING=1025, // readonly, tricky property, returns cpnst char* indeed - CV_CAP_PROP_PREVIEW_FORMAT=1026, // readonly, tricky property, returns cpnst char* indeed - - // OpenNI map generators - CV_CAP_OPENNI_DEPTH_GENERATOR = 1 << 31, - CV_CAP_OPENNI_IMAGE_GENERATOR = 1 << 30, - CV_CAP_OPENNI_IR_GENERATOR = 1 << 29, - CV_CAP_OPENNI_GENERATORS_MASK = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_OPENNI_IR_GENERATOR, - - // Properties of cameras available through OpenNI interfaces - CV_CAP_PROP_OPENNI_OUTPUT_MODE = 100, - CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH = 101, // in mm - CV_CAP_PROP_OPENNI_BASELINE = 102, // in mm - CV_CAP_PROP_OPENNI_FOCAL_LENGTH = 103, // in pixels - CV_CAP_PROP_OPENNI_REGISTRATION = 104, // flag - CV_CAP_PROP_OPENNI_REGISTRATION_ON = CV_CAP_PROP_OPENNI_REGISTRATION, // flag that synchronizes the remapping depth map to image map - // by changing depth generator's view point (if the flag is "on") or - // sets this view point to its normal one (if the flag is "off"). - CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC = 105, - CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE = 106, - CV_CAP_PROP_OPENNI_CIRCLE_BUFFER = 107, - CV_CAP_PROP_OPENNI_MAX_TIME_DURATION = 108, - - CV_CAP_PROP_OPENNI_GENERATOR_PRESENT = 109, - CV_CAP_PROP_OPENNI2_SYNC = 110, - CV_CAP_PROP_OPENNI2_MIRROR = 111, - - CV_CAP_OPENNI_IMAGE_GENERATOR_PRESENT = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT, - CV_CAP_OPENNI_IMAGE_GENERATOR_OUTPUT_MODE = CV_CAP_OPENNI_IMAGE_GENERATOR + CV_CAP_PROP_OPENNI_OUTPUT_MODE, - CV_CAP_OPENNI_DEPTH_GENERATOR_PRESENT = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT, - CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_BASELINE, - CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_FOCAL_LENGTH, - CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION = CV_CAP_OPENNI_DEPTH_GENERATOR + CV_CAP_PROP_OPENNI_REGISTRATION, - CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION_ON = CV_CAP_OPENNI_DEPTH_GENERATOR_REGISTRATION, - CV_CAP_OPENNI_IR_GENERATOR_PRESENT = CV_CAP_OPENNI_IR_GENERATOR + CV_CAP_PROP_OPENNI_GENERATOR_PRESENT, - - // Properties of cameras available through GStreamer interface - CV_CAP_GSTREAMER_QUEUE_LENGTH = 200, // default is 1 - - // PVAPI - CV_CAP_PROP_PVAPI_MULTICASTIP = 300, // ip for anable multicast master mode. 0 for disable multicast - CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE = 301, // FrameStartTriggerMode: Determines how a frame is initiated - CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL = 302, // Horizontal sub-sampling of the image - CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL = 303, // Vertical sub-sampling of the image - CV_CAP_PROP_PVAPI_BINNINGX = 304, // Horizontal binning factor - CV_CAP_PROP_PVAPI_BINNINGY = 305, // Vertical binning factor - CV_CAP_PROP_PVAPI_PIXELFORMAT = 306, // Pixel format - - // Properties of cameras available through XIMEA SDK interface - CV_CAP_PROP_XI_DOWNSAMPLING = 400, // Change image resolution by binning or skipping. - CV_CAP_PROP_XI_DATA_FORMAT = 401, // Output data format. - CV_CAP_PROP_XI_OFFSET_X = 402, // Horizontal offset from the origin to the area of interest (in pixels). - CV_CAP_PROP_XI_OFFSET_Y = 403, // Vertical offset from the origin to the area of interest (in pixels). - CV_CAP_PROP_XI_TRG_SOURCE = 404, // Defines source of trigger. - CV_CAP_PROP_XI_TRG_SOFTWARE = 405, // Generates an internal trigger. PRM_TRG_SOURCE must be set to TRG_SOFTWARE. - CV_CAP_PROP_XI_GPI_SELECTOR = 406, // Selects general purpose input - CV_CAP_PROP_XI_GPI_MODE = 407, // Set general purpose input mode - CV_CAP_PROP_XI_GPI_LEVEL = 408, // Get general purpose level - CV_CAP_PROP_XI_GPO_SELECTOR = 409, // Selects general purpose output - CV_CAP_PROP_XI_GPO_MODE = 410, // Set general purpose output mode - CV_CAP_PROP_XI_LED_SELECTOR = 411, // Selects camera signalling LED - CV_CAP_PROP_XI_LED_MODE = 412, // Define camera signalling LED functionality - CV_CAP_PROP_XI_MANUAL_WB = 413, // Calculates White Balance(must be called during acquisition) - CV_CAP_PROP_XI_AUTO_WB = 414, // Automatic white balance - CV_CAP_PROP_XI_AEAG = 415, // Automatic exposure/gain - CV_CAP_PROP_XI_EXP_PRIORITY = 416, // Exposure priority (0.5 - exposure 50%, gain 50%). - CV_CAP_PROP_XI_AE_MAX_LIMIT = 417, // Maximum limit of exposure in AEAG procedure - CV_CAP_PROP_XI_AG_MAX_LIMIT = 418, // Maximum limit of gain in AEAG procedure - CV_CAP_PROP_XI_AEAG_LEVEL = 419, // Average intensity of output signal AEAG should achieve(in %) - CV_CAP_PROP_XI_TIMEOUT = 420, // Image capture timeout in milliseconds - CV_CAP_PROP_XI_EXPOSURE = 421, // Exposure time in microseconds - CV_CAP_PROP_XI_EXPOSURE_BURST_COUNT = 422, // Sets the number of times of exposure in one frame. - CV_CAP_PROP_XI_GAIN_SELECTOR = 423, // Gain selector for parameter Gain allows to select different type of gains. - CV_CAP_PROP_XI_GAIN = 424, // Gain in dB - CV_CAP_PROP_XI_DOWNSAMPLING_TYPE = 426, // Change image downsampling type. - CV_CAP_PROP_XI_BINNING_SELECTOR = 427, // Binning engine selector. - CV_CAP_PROP_XI_BINNING_VERTICAL = 428, // Vertical Binning - number of vertical photo-sensitive cells to combine together. - CV_CAP_PROP_XI_BINNING_HORIZONTAL = 429, // Horizontal Binning - number of horizontal photo-sensitive cells to combine together. - CV_CAP_PROP_XI_BINNING_PATTERN = 430, // Binning pattern type. - CV_CAP_PROP_XI_DECIMATION_SELECTOR = 431, // Decimation engine selector. - CV_CAP_PROP_XI_DECIMATION_VERTICAL = 432, // Vertical Decimation - vertical sub-sampling of the image - reduces the vertical resolution of the image by the specified vertical decimation factor. - CV_CAP_PROP_XI_DECIMATION_HORIZONTAL = 433, // Horizontal Decimation - horizontal sub-sampling of the image - reduces the horizontal resolution of the image by the specified vertical decimation factor. - CV_CAP_PROP_XI_DECIMATION_PATTERN = 434, // Decimation pattern type. - CV_CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR = 587, // Selects which test pattern generator is controlled by the TestPattern feature. - CV_CAP_PROP_XI_TEST_PATTERN = 588, // Selects which test pattern type is generated by the selected generator. - CV_CAP_PROP_XI_IMAGE_DATA_FORMAT = 435, // Output data format. - CV_CAP_PROP_XI_SHUTTER_TYPE = 436, // Change sensor shutter type(CMOS sensor). - CV_CAP_PROP_XI_SENSOR_TAPS = 437, // Number of taps - CV_CAP_PROP_XI_AEAG_ROI_OFFSET_X = 439, // Automatic exposure/gain ROI offset X - CV_CAP_PROP_XI_AEAG_ROI_OFFSET_Y = 440, // Automatic exposure/gain ROI offset Y - CV_CAP_PROP_XI_AEAG_ROI_WIDTH = 441, // Automatic exposure/gain ROI Width - CV_CAP_PROP_XI_AEAG_ROI_HEIGHT = 442, // Automatic exposure/gain ROI Height - CV_CAP_PROP_XI_BPC = 445, // Correction of bad pixels - CV_CAP_PROP_XI_WB_KR = 448, // White balance red coefficient - CV_CAP_PROP_XI_WB_KG = 449, // White balance green coefficient - CV_CAP_PROP_XI_WB_KB = 450, // White balance blue coefficient - CV_CAP_PROP_XI_WIDTH = 451, // Width of the Image provided by the device (in pixels). - CV_CAP_PROP_XI_HEIGHT = 452, // Height of the Image provided by the device (in pixels). - CV_CAP_PROP_XI_REGION_SELECTOR = 589, // Selects Region in Multiple ROI which parameters are set by width, height, ... ,region mode - CV_CAP_PROP_XI_REGION_MODE = 595, // Activates/deactivates Region selected by Region Selector - CV_CAP_PROP_XI_LIMIT_BANDWIDTH = 459, // Set/get bandwidth(datarate)(in Megabits) - CV_CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH = 460, // Sensor output data bit depth. - CV_CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH = 461, // Device output data bit depth. - CV_CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH = 462, // bitdepth of data returned by function xiGetImage - CV_CAP_PROP_XI_OUTPUT_DATA_PACKING = 463, // Device output data packing (or grouping) enabled. Packing could be enabled if output_data_bit_depth > 8 and packing capability is available. - CV_CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE = 464, // Data packing type. Some cameras supports only specific packing type. - CV_CAP_PROP_XI_IS_COOLED = 465, // Returns 1 for cameras that support cooling. - CV_CAP_PROP_XI_COOLING = 466, // Start camera cooling. - CV_CAP_PROP_XI_TARGET_TEMP = 467, // Set sensor target temperature for cooling. - CV_CAP_PROP_XI_CHIP_TEMP = 468, // Camera sensor temperature - CV_CAP_PROP_XI_HOUS_TEMP = 469, // Camera housing tepmerature - CV_CAP_PROP_XI_HOUS_BACK_SIDE_TEMP = 590, // Camera housing back side tepmerature - CV_CAP_PROP_XI_SENSOR_BOARD_TEMP = 596, // Camera sensor board temperature - CV_CAP_PROP_XI_CMS = 470, // Mode of color management system. - CV_CAP_PROP_XI_APPLY_CMS = 471, // Enable applying of CMS profiles to xiGetImage (see XI_PRM_INPUT_CMS_PROFILE, XI_PRM_OUTPUT_CMS_PROFILE). - CV_CAP_PROP_XI_IMAGE_IS_COLOR = 474, // Returns 1 for color cameras. - CV_CAP_PROP_XI_COLOR_FILTER_ARRAY = 475, // Returns color filter array type of RAW data. - CV_CAP_PROP_XI_GAMMAY = 476, // Luminosity gamma - CV_CAP_PROP_XI_GAMMAC = 477, // Chromaticity gamma - CV_CAP_PROP_XI_SHARPNESS = 478, // Sharpness Strength - CV_CAP_PROP_XI_CC_MATRIX_00 = 479, // Color Correction Matrix element [0][0] - CV_CAP_PROP_XI_CC_MATRIX_01 = 480, // Color Correction Matrix element [0][1] - CV_CAP_PROP_XI_CC_MATRIX_02 = 481, // Color Correction Matrix element [0][2] - CV_CAP_PROP_XI_CC_MATRIX_03 = 482, // Color Correction Matrix element [0][3] - CV_CAP_PROP_XI_CC_MATRIX_10 = 483, // Color Correction Matrix element [1][0] - CV_CAP_PROP_XI_CC_MATRIX_11 = 484, // Color Correction Matrix element [1][1] - CV_CAP_PROP_XI_CC_MATRIX_12 = 485, // Color Correction Matrix element [1][2] - CV_CAP_PROP_XI_CC_MATRIX_13 = 486, // Color Correction Matrix element [1][3] - CV_CAP_PROP_XI_CC_MATRIX_20 = 487, // Color Correction Matrix element [2][0] - CV_CAP_PROP_XI_CC_MATRIX_21 = 488, // Color Correction Matrix element [2][1] - CV_CAP_PROP_XI_CC_MATRIX_22 = 489, // Color Correction Matrix element [2][2] - CV_CAP_PROP_XI_CC_MATRIX_23 = 490, // Color Correction Matrix element [2][3] - CV_CAP_PROP_XI_CC_MATRIX_30 = 491, // Color Correction Matrix element [3][0] - CV_CAP_PROP_XI_CC_MATRIX_31 = 492, // Color Correction Matrix element [3][1] - CV_CAP_PROP_XI_CC_MATRIX_32 = 493, // Color Correction Matrix element [3][2] - CV_CAP_PROP_XI_CC_MATRIX_33 = 494, // Color Correction Matrix element [3][3] - CV_CAP_PROP_XI_DEFAULT_CC_MATRIX = 495, // Set default Color Correction Matrix - CV_CAP_PROP_XI_TRG_SELECTOR = 498, // Selects the type of trigger. - CV_CAP_PROP_XI_ACQ_FRAME_BURST_COUNT = 499, // Sets number of frames acquired by burst. This burst is used only if trigger is set to FrameBurstStart - CV_CAP_PROP_XI_DEBOUNCE_EN = 507, // Enable/Disable debounce to selected GPI - CV_CAP_PROP_XI_DEBOUNCE_T0 = 508, // Debounce time (x * 10us) - CV_CAP_PROP_XI_DEBOUNCE_T1 = 509, // Debounce time (x * 10us) - CV_CAP_PROP_XI_DEBOUNCE_POL = 510, // Debounce polarity (pol = 1 t0 - falling edge, t1 - rising edge) - CV_CAP_PROP_XI_LENS_MODE = 511, // Status of lens control interface. This shall be set to XI_ON before any Lens operations. - CV_CAP_PROP_XI_LENS_APERTURE_VALUE = 512, // Current lens aperture value in stops. Examples: 2.8, 4, 5.6, 8, 11 - CV_CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE = 513, // Lens current focus movement value to be used by XI_PRM_LENS_FOCUS_MOVE in motor steps. - CV_CAP_PROP_XI_LENS_FOCUS_MOVE = 514, // Moves lens focus motor by steps set in XI_PRM_LENS_FOCUS_MOVEMENT_VALUE. - CV_CAP_PROP_XI_LENS_FOCUS_DISTANCE = 515, // Lens focus distance in cm. - CV_CAP_PROP_XI_LENS_FOCAL_LENGTH = 516, // Lens focal distance in mm. - CV_CAP_PROP_XI_LENS_FEATURE_SELECTOR = 517, // Selects the current feature which is accessible by XI_PRM_LENS_FEATURE. - CV_CAP_PROP_XI_LENS_FEATURE = 518, // Allows access to lens feature value currently selected by XI_PRM_LENS_FEATURE_SELECTOR. - CV_CAP_PROP_XI_DEVICE_MODEL_ID = 521, // Return device model id - CV_CAP_PROP_XI_DEVICE_SN = 522, // Return device serial number - CV_CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA = 529, // The alpha channel of RGB32 output image format. - CV_CAP_PROP_XI_IMAGE_PAYLOAD_SIZE = 530, // Buffer size in bytes sufficient for output image returned by xiGetImage - CV_CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT = 531, // Current format of pixels on transport layer. - CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ = 532, // Sensor clock frequency in Hz. - CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX = 533, // Sensor clock frequency index. Sensor with selected frequencies have possibility to set the frequency only by this index. - CV_CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT = 534, // Number of output channels from sensor used for data transfer. - CV_CAP_PROP_XI_FRAMERATE = 535, // Define framerate in Hz - CV_CAP_PROP_XI_COUNTER_SELECTOR = 536, // Select counter - CV_CAP_PROP_XI_COUNTER_VALUE = 537, // Counter status - CV_CAP_PROP_XI_ACQ_TIMING_MODE = 538, // Type of sensor frames timing. - CV_CAP_PROP_XI_AVAILABLE_BANDWIDTH = 539, // Calculate and return available interface bandwidth(int Megabits) - CV_CAP_PROP_XI_BUFFER_POLICY = 540, // Data move policy - CV_CAP_PROP_XI_LUT_EN = 541, // Activates LUT. - CV_CAP_PROP_XI_LUT_INDEX = 542, // Control the index (offset) of the coefficient to access in the LUT. - CV_CAP_PROP_XI_LUT_VALUE = 543, // Value at entry LUTIndex of the LUT - CV_CAP_PROP_XI_TRG_DELAY = 544, // Specifies the delay in microseconds (us) to apply after the trigger reception before activating it. - CV_CAP_PROP_XI_TS_RST_MODE = 545, // Defines how time stamp reset engine will be armed - CV_CAP_PROP_XI_TS_RST_SOURCE = 546, // Defines which source will be used for timestamp reset. Writing this parameter will trigger settings of engine (arming) - CV_CAP_PROP_XI_IS_DEVICE_EXIST = 547, // Returns 1 if camera connected and works properly. - CV_CAP_PROP_XI_ACQ_BUFFER_SIZE = 548, // Acquisition buffer size in buffer_size_unit. Default bytes. - CV_CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT = 549, // Acquisition buffer size unit in bytes. Default 1. E.g. Value 1024 means that buffer_size is in KiBytes - CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE = 550, // Acquisition transport buffer size in bytes - CV_CAP_PROP_XI_BUFFERS_QUEUE_SIZE = 551, // Queue of field/frame buffers - CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT = 552, // Number of buffers to commit to low level - CV_CAP_PROP_XI_RECENT_FRAME = 553, // GetImage returns most recent frame - CV_CAP_PROP_XI_DEVICE_RESET = 554, // Resets the camera to default state. - CV_CAP_PROP_XI_COLUMN_FPN_CORRECTION = 555, // Correction of column FPN - CV_CAP_PROP_XI_ROW_FPN_CORRECTION = 591, // Correction of row FPN - CV_CAP_PROP_XI_SENSOR_MODE = 558, // Current sensor mode. Allows to select sensor mode by one integer. Setting of this parameter affects: image dimensions and downsampling. - CV_CAP_PROP_XI_HDR = 559, // Enable High Dynamic Range feature. - CV_CAP_PROP_XI_HDR_KNEEPOINT_COUNT = 560, // The number of kneepoints in the PWLR. - CV_CAP_PROP_XI_HDR_T1 = 561, // position of first kneepoint(in % of XI_PRM_EXPOSURE) - CV_CAP_PROP_XI_HDR_T2 = 562, // position of second kneepoint (in % of XI_PRM_EXPOSURE) - CV_CAP_PROP_XI_KNEEPOINT1 = 563, // value of first kneepoint (% of sensor saturation) - CV_CAP_PROP_XI_KNEEPOINT2 = 564, // value of second kneepoint (% of sensor saturation) - CV_CAP_PROP_XI_IMAGE_BLACK_LEVEL = 565, // Last image black level counts. Can be used for Offline processing to recall it. - CV_CAP_PROP_XI_HW_REVISION = 571, // Returns hardware revision number. - CV_CAP_PROP_XI_DEBUG_LEVEL = 572, // Set debug level - CV_CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION = 573, // Automatic bandwidth calculation, - CV_CAP_PROP_XI_FFS_FILE_ID = 594, // File number. - CV_CAP_PROP_XI_FFS_FILE_SIZE = 580, // Size of file. - CV_CAP_PROP_XI_FREE_FFS_SIZE = 581, // Size of free camera FFS. - CV_CAP_PROP_XI_USED_FFS_SIZE = 582, // Size of used camera FFS. - CV_CAP_PROP_XI_FFS_ACCESS_KEY = 583, // Setting of key enables file operations on some cameras. - CV_CAP_PROP_XI_SENSOR_FEATURE_SELECTOR = 585, // Selects the current feature which is accessible by XI_PRM_SENSOR_FEATURE_VALUE. - CV_CAP_PROP_XI_SENSOR_FEATURE_VALUE = 586, // Allows access to sensor feature value currently selected by XI_PRM_SENSOR_FEATURE_SELECTOR. - - - // Properties for Android cameras - CV_CAP_PROP_ANDROID_FLASH_MODE = 8001, - CV_CAP_PROP_ANDROID_FOCUS_MODE = 8002, - CV_CAP_PROP_ANDROID_WHITE_BALANCE = 8003, - CV_CAP_PROP_ANDROID_ANTIBANDING = 8004, - CV_CAP_PROP_ANDROID_FOCAL_LENGTH = 8005, - CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR = 8006, - CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL = 8007, - CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR = 8008, - CV_CAP_PROP_ANDROID_EXPOSE_LOCK = 8009, - CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK = 8010, - - // Properties of cameras available through AVFOUNDATION interface - CV_CAP_PROP_IOS_DEVICE_FOCUS = 9001, - CV_CAP_PROP_IOS_DEVICE_EXPOSURE = 9002, - CV_CAP_PROP_IOS_DEVICE_FLASH = 9003, - CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE = 9004, - CV_CAP_PROP_IOS_DEVICE_TORCH = 9005, - - // Properties of cameras available through Smartek Giganetix Ethernet Vision interface - /* --- Vladimir Litvinenko (litvinenko.vladimir@gmail.com) --- */ - CV_CAP_PROP_GIGA_FRAME_OFFSET_X = 10001, - CV_CAP_PROP_GIGA_FRAME_OFFSET_Y = 10002, - CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX = 10003, - CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX = 10004, - CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH = 10005, - CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH = 10006, - - CV_CAP_PROP_INTELPERC_PROFILE_COUNT = 11001, - CV_CAP_PROP_INTELPERC_PROFILE_IDX = 11002, - CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE = 11003, - CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE = 11004, - CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD = 11005, - CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ = 11006, - CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT = 11007, - - // Intel PerC streams - CV_CAP_INTELPERC_DEPTH_GENERATOR = 1 << 29, - CV_CAP_INTELPERC_IMAGE_GENERATOR = 1 << 28, - CV_CAP_INTELPERC_GENERATORS_MASK = CV_CAP_INTELPERC_DEPTH_GENERATOR + CV_CAP_INTELPERC_IMAGE_GENERATOR -}; - -// Generic camera output modes. -// Currently, these are supported through the libv4l interface only. -enum -{ - CV_CAP_MODE_BGR = 0, // BGR24 (default) - CV_CAP_MODE_RGB = 1, // RGB24 - CV_CAP_MODE_GRAY = 2, // Y8 - CV_CAP_MODE_YUYV = 3 // YUYV -}; - -enum -{ - // Data given from depth generator. - CV_CAP_OPENNI_DEPTH_MAP = 0, // Depth values in mm (CV_16UC1) - CV_CAP_OPENNI_POINT_CLOUD_MAP = 1, // XYZ in meters (CV_32FC3) - CV_CAP_OPENNI_DISPARITY_MAP = 2, // Disparity in pixels (CV_8UC1) - CV_CAP_OPENNI_DISPARITY_MAP_32F = 3, // Disparity in pixels (CV_32FC1) - CV_CAP_OPENNI_VALID_DEPTH_MASK = 4, // CV_8UC1 - - // Data given from RGB image generator. - CV_CAP_OPENNI_BGR_IMAGE = 5, - CV_CAP_OPENNI_GRAY_IMAGE = 6, - - // Data given from IR image generator. - CV_CAP_OPENNI_IR_IMAGE = 7 -}; - -// Supported output modes of OpenNI image generator -enum -{ - CV_CAP_OPENNI_VGA_30HZ = 0, - CV_CAP_OPENNI_SXGA_15HZ = 1, - CV_CAP_OPENNI_SXGA_30HZ = 2, - CV_CAP_OPENNI_QVGA_30HZ = 3, - CV_CAP_OPENNI_QVGA_60HZ = 4 -}; - -enum -{ - CV_CAP_INTELPERC_DEPTH_MAP = 0, // Each pixel is a 16-bit integer. The value indicates the distance from an object to the camera's XY plane or the Cartesian depth. - CV_CAP_INTELPERC_UVDEPTH_MAP = 1, // Each pixel contains two 32-bit floating point values in the range of 0-1, representing the mapping of depth coordinates to the color coordinates. - CV_CAP_INTELPERC_IR_MAP = 2, // Each pixel is a 16-bit integer. The value indicates the intensity of the reflected laser beam. - CV_CAP_INTELPERC_IMAGE = 3 -}; - -// gPhoto2 properties, if propertyId is less than 0 then work on widget with that __additive inversed__ camera setting ID -// Get IDs by using CAP_PROP_GPHOTO2_WIDGET_ENUMERATE. -// @see CvCaptureCAM_GPHOTO2 for more info -enum -{ - CV_CAP_PROP_GPHOTO2_PREVIEW = 17001, // Capture only preview from liveview mode. - CV_CAP_PROP_GPHOTO2_WIDGET_ENUMERATE = 17002, // Readonly, returns (const char *). - CV_CAP_PROP_GPHOTO2_RELOAD_CONFIG = 17003, // Trigger, only by set. Reload camera settings. - CV_CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE = 17004, // Reload all settings on set. - CV_CAP_PROP_GPHOTO2_COLLECT_MSGS = 17005, // Collect messages with details. - CV_CAP_PROP_GPHOTO2_FLUSH_MSGS = 17006, // Readonly, returns (const char *). - CV_CAP_PROP_SPEED = 17007, // Exposure speed. Can be readonly, depends on camera program. - CV_CAP_PROP_APERTURE = 17008, // Aperture. Can be readonly, depends on camera program. - CV_CAP_PROP_EXPOSUREPROGRAM = 17009, // Camera exposure program. - CV_CAP_PROP_VIEWFINDER = 17010 // Enter liveview mode. -}; - -/** @brief retrieve capture properties -*/ -CVAPI(double) cvGetCaptureProperty( CvCapture* capture, int property_id ); -/** @brief set capture properties -*/ -CVAPI(int) cvSetCaptureProperty( CvCapture* capture, int property_id, double value ); - -/** @brief Return the type of the capturer (eg, ::CV_CAP_VFW, ::CV_CAP_UNICAP) - -It is unknown if created with ::CV_CAP_ANY -*/ -CVAPI(int) cvGetCaptureDomain( CvCapture* capture); - -/** @brief "black box" video file writer structure - -In C++ use cv::VideoWriter -*/ -typedef struct CvVideoWriter CvVideoWriter; - -//! Macro to construct the fourcc code of the codec. Same as CV_FOURCC() -#define CV_FOURCC_MACRO(c1, c2, c3, c4) (((c1) & 255) + (((c2) & 255) << 8) + (((c3) & 255) << 16) + (((c4) & 255) << 24)) - -/** @brief Constructs the fourcc code of the codec function - -Simply call it with 4 chars fourcc code like `CV_FOURCC('I', 'Y', 'U', 'V')` - -List of codes can be obtained at [Video Codecs by FOURCC](http://www.fourcc.org/codecs.php) page. -FFMPEG backend with MP4 container natively uses other values as fourcc code: -see [ObjectType](http://www.mp4ra.org/codecs.html). -*/ -CV_INLINE int CV_FOURCC(char c1, char c2, char c3, char c4) -{ - return CV_FOURCC_MACRO(c1, c2, c3, c4); -} - -//! (Windows only) Open Codec Selection Dialog -#define CV_FOURCC_PROMPT -1 -//! (Linux only) Use default codec for specified filename -#define CV_FOURCC_DEFAULT CV_FOURCC('I', 'Y', 'U', 'V') - -/** @brief initialize video file writer -*/ -CVAPI(CvVideoWriter*) cvCreateVideoWriter( const char* filename, int fourcc, - double fps, CvSize frame_size, - int is_color CV_DEFAULT(1)); - -/** @brief write frame to video file -*/ -CVAPI(int) cvWriteFrame( CvVideoWriter* writer, const IplImage* image ); - -/** @brief close video file writer -*/ -CVAPI(void) cvReleaseVideoWriter( CvVideoWriter** writer ); - -// *************************************************************************************** -//! @name Obsolete functions/synonyms -//! @{ -#define cvCaptureFromCAM cvCreateCameraCapture //!< @deprecated use cvCreateCameraCapture() instead -#define cvCaptureFromFile cvCreateFileCapture //!< @deprecated use cvCreateFileCapture() instead -#define cvCaptureFromAVI cvCaptureFromFile //!< @deprecated use cvCreateFileCapture() instead -#define cvCreateAVIWriter cvCreateVideoWriter //!< @deprecated use cvCreateVideoWriter() instead -#define cvWriteToAVI cvWriteFrame //!< @deprecated use cvWriteFrame() instead -//! @} Obsolete... - -//! @} videoio_c - -#ifdef __cplusplus -} -#endif - -#endif //OPENCV_VIDEOIO_H diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab.hpp deleted file mode 100644 index ca3f5ad..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab.hpp +++ /dev/null @@ -1,81 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_HPP -#define OPENCV_VIDEOSTAB_HPP - -/** - @defgroup videostab Video Stabilization - -The video stabilization module contains a set of functions and classes that can be used to solve the -problem of video stabilization. There are a few methods implemented, most of them are described in -the papers @cite OF06 and @cite G11 . However, there are some extensions and deviations from the original -paper methods. - -### References - - 1. "Full-Frame Video Stabilization with Motion Inpainting" - Yasuyuki Matsushita, Eyal Ofek, Weina Ge, Xiaoou Tang, Senior Member, and Heung-Yeung Shum - 2. "Auto-Directed Video Stabilization with Robust L1 Optimal Camera Paths" - Matthias Grundmann, Vivek Kwatra, Irfan Essa - - @{ - @defgroup videostab_motion Global Motion Estimation - -The video stabilization module contains a set of functions and classes for global motion estimation -between point clouds or between images. In the last case features are extracted and matched -internally. For the sake of convenience the motion estimation functions are wrapped into classes. -Both the functions and the classes are available. - - @defgroup videostab_marching Fast Marching Method - -The Fast Marching Method @cite Telea04 is used in of the video stabilization routines to do motion and -color inpainting. The method is implemented is a flexible way and it's made public for other users. - - @} - -*/ - -#include "opencv2/videostab/stabilizer.hpp" -#include "opencv2/videostab/ring_buffer.hpp" - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/deblurring.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/deblurring.hpp deleted file mode 100644 index c665640..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/deblurring.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_DEBLURRING_HPP -#define OPENCV_VIDEOSTAB_DEBLURRING_HPP - -#include -#include "opencv2/core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -CV_EXPORTS float calcBlurriness(const Mat &frame); - -class CV_EXPORTS DeblurerBase -{ -public: - DeblurerBase() : radius_(0), frames_(0), motions_(0), blurrinessRates_(0) {} - - virtual ~DeblurerBase() {} - - virtual void setRadius(int val) { radius_ = val; } - virtual int radius() const { return radius_; } - - virtual void deblur(int idx, Mat &frame) = 0; - - - // data from stabilizer - - virtual void setFrames(const std::vector &val) { frames_ = &val; } - virtual const std::vector& frames() const { return *frames_; } - - virtual void setMotions(const std::vector &val) { motions_ = &val; } - virtual const std::vector& motions() const { return *motions_; } - - virtual void setBlurrinessRates(const std::vector &val) { blurrinessRates_ = &val; } - virtual const std::vector& blurrinessRates() const { return *blurrinessRates_; } - -protected: - int radius_; - const std::vector *frames_; - const std::vector *motions_; - const std::vector *blurrinessRates_; -}; - -class CV_EXPORTS NullDeblurer : public DeblurerBase -{ -public: - virtual void deblur(int /*idx*/, Mat &/*frame*/) CV_OVERRIDE {} -}; - -class CV_EXPORTS WeightingDeblurer : public DeblurerBase -{ -public: - WeightingDeblurer(); - - void setSensitivity(float val) { sensitivity_ = val; } - float sensitivity() const { return sensitivity_; } - - virtual void deblur(int idx, Mat &frame) CV_OVERRIDE; - -private: - float sensitivity_; - Mat_ bSum_, gSum_, rSum_, wSum_; -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching.hpp deleted file mode 100644 index 43f8e4a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_FAST_MARCHING_HPP -#define OPENCV_VIDEOSTAB_FAST_MARCHING_HPP - -#include -#include -#include -#include "opencv2/core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab_marching -//! @{ - -/** @brief Describes the Fast Marching Method implementation. - - See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf - */ -class CV_EXPORTS FastMarchingMethod -{ -public: - FastMarchingMethod() : inf_(1e6f), size_(0) {} - - /** @brief Template method that runs the Fast Marching Method. - - @param mask Image mask. 0 value indicates that the pixel value must be inpainted, 255 indicates - that the pixel value is known, other values aren't acceptable. - @param inpaint Inpainting functor that overloads void operator ()(int x, int y). - @return Inpainting functor. - */ - template - Inpaint run(const Mat &mask, Inpaint inpaint); - - /** - @return Distance map that's created during working of the method. - */ - Mat distanceMap() const { return dist_; } - -private: - enum { INSIDE = 0, BAND = 1, KNOWN = 255 }; - - struct DXY - { - float dist; - int x, y; - - DXY() : dist(0), x(0), y(0) {} - DXY(float _dist, int _x, int _y) : dist(_dist), x(_x), y(_y) {} - bool operator <(const DXY &dxy) const { return dist < dxy.dist; } - }; - - float solve(int x1, int y1, int x2, int y2) const; - int& indexOf(const DXY &dxy) { return index_(dxy.y, dxy.x); } - - void heapUp(int idx); - void heapDown(int idx); - void heapAdd(const DXY &dxy); - void heapRemoveMin(); - - float inf_; - - cv::Mat_ flag_; // flag map - cv::Mat_ dist_; // distance map - - cv::Mat_ index_; // index of point in the narrow band - std::vector narrowBand_; // narrow band heap - int size_; // narrow band size -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#include "fast_marching_inl.hpp" - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching_inl.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching_inl.hpp deleted file mode 100644 index fdd488a..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/fast_marching_inl.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP -#define OPENCV_VIDEOSTAB_FAST_MARCHING_INL_HPP - -#include "opencv2/videostab/fast_marching.hpp" - -namespace cv -{ -namespace videostab -{ - -template -Inpaint FastMarchingMethod::run(const cv::Mat &mask, Inpaint inpaint) -{ - using namespace cv; - - CV_Assert(mask.type() == CV_8U); - - static const int lut[4][2] = {{-1,0}, {0,-1}, {1,0}, {0,1}}; - - mask.copyTo(flag_); - flag_.create(mask.size()); - dist_.create(mask.size()); - index_.create(mask.size()); - narrowBand_.clear(); - size_ = 0; - - // init - for (int y = 0; y < flag_.rows; ++y) - { - for (int x = 0; x < flag_.cols; ++x) - { - if (flag_(y,x) == KNOWN) - dist_(y,x) = 0.f; - else - { - int n = 0; - int nunknown = 0; - - for (int i = 0; i < 4; ++i) - { - int xn = x + lut[i][0]; - int yn = y + lut[i][1]; - - if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows) - { - n++; - if (flag_(yn,xn) != KNOWN) - nunknown++; - } - } - - if (n>0 && nunknown == n) - { - dist_(y,x) = inf_; - flag_(y,x) = INSIDE; - } - else - { - dist_(y,x) = 0.f; - flag_(y,x) = BAND; - inpaint(x, y); - - narrowBand_.push_back(DXY(0.f,x,y)); - index_(y,x) = size_++; - } - } - } - } - - // make heap - for (int i = size_/2-1; i >= 0; --i) - heapDown(i); - - // main cycle - while (size_ > 0) - { - int x = narrowBand_[0].x; - int y = narrowBand_[0].y; - heapRemoveMin(); - - flag_(y,x) = KNOWN; - for (int n = 0; n < 4; ++n) - { - int xn = x + lut[n][0]; - int yn = y + lut[n][1]; - - if (xn >= 0 && xn < flag_.cols && yn >= 0 && yn < flag_.rows && flag_(yn,xn) != KNOWN) - { - dist_(yn,xn) = std::min(std::min(solve(xn-1, yn, xn, yn-1), solve(xn+1, yn, xn, yn-1)), - std::min(solve(xn-1, yn, xn, yn+1), solve(xn+1, yn, xn, yn+1))); - - if (flag_(yn,xn) == INSIDE) - { - flag_(yn,xn) = BAND; - inpaint(xn, yn); - heapAdd(DXY(dist_(yn,xn),xn,yn)); - } - else - { - int i = index_(yn,xn); - if (dist_(yn,xn) < narrowBand_[i].dist) - { - narrowBand_[i].dist = dist_(yn,xn); - heapUp(i); - } - // works better if it's commented out - /*else if (dist(yn,xn) > narrowBand[i].dist) - { - narrowBand[i].dist = dist(yn,xn); - heapDown(i); - }*/ - } - } - } - } - - return inpaint; -} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/frame_source.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/frame_source.hpp deleted file mode 100644 index 171c637..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/frame_source.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP -#define OPENCV_VIDEOSTAB_FRAME_SOURCE_HPP - -#include -#include "opencv2/core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS IFrameSource -{ -public: - virtual ~IFrameSource() {} - virtual void reset() = 0; - virtual Mat nextFrame() = 0; -}; - -class CV_EXPORTS NullFrameSource : public IFrameSource -{ -public: - virtual void reset() CV_OVERRIDE {} - virtual Mat nextFrame() CV_OVERRIDE { return Mat(); } -}; - -class CV_EXPORTS VideoFileSource : public IFrameSource -{ -public: - VideoFileSource(const String &path, bool volatileFrame = false); - - virtual void reset() CV_OVERRIDE; - virtual Mat nextFrame() CV_OVERRIDE; - - int width(); - int height(); - int count(); - double fps(); - -private: - Ptr impl; -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/global_motion.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/global_motion.hpp deleted file mode 100644 index fedca2c..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/global_motion.hpp +++ /dev/null @@ -1,300 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP -#define OPENCV_VIDEOSTAB_GLOBAL_MOTION_HPP - -#include -#include -#include "opencv2/core.hpp" -#include "opencv2/features2d.hpp" -#include "opencv2/opencv_modules.hpp" -#include "opencv2/videostab/optical_flow.hpp" -#include "opencv2/videostab/motion_core.hpp" -#include "opencv2/videostab/outlier_rejection.hpp" - -#ifdef HAVE_OPENCV_CUDAIMGPROC -# include "opencv2/cudaimgproc.hpp" -#endif - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab_motion -//! @{ - -/** @brief Estimates best global motion between two 2D point clouds in the least-squares sense. - -@note Works in-place and changes input point arrays. - -@param points0 Source set of 2D points (32F). -@param points1 Destination set of 2D points (32F). -@param model Motion model (up to MM_AFFINE). -@param rmse Final root-mean-square error. -@return 3x3 2D transformation matrix (32F). - */ -CV_EXPORTS Mat estimateGlobalMotionLeastSquares( - InputOutputArray points0, InputOutputArray points1, int model = MM_AFFINE, - float *rmse = 0); - -/** @brief Estimates best global motion between two 2D point clouds robustly (using RANSAC method). - -@param points0 Source set of 2D points (32F). -@param points1 Destination set of 2D points (32F). -@param model Motion model. See cv::videostab::MotionModel. -@param params RANSAC method parameters. See videostab::RansacParams. -@param rmse Final root-mean-square error. -@param ninliers Final number of inliers. - */ -CV_EXPORTS Mat estimateGlobalMotionRansac( - InputArray points0, InputArray points1, int model = MM_AFFINE, - const RansacParams ¶ms = RansacParams::default2dMotion(MM_AFFINE), - float *rmse = 0, int *ninliers = 0); - -/** @brief Base class for all global motion estimation methods. - */ -class CV_EXPORTS MotionEstimatorBase -{ -public: - virtual ~MotionEstimatorBase() {} - - /** @brief Sets motion model. - - @param val Motion model. See cv::videostab::MotionModel. - */ - virtual void setMotionModel(MotionModel val) { motionModel_ = val; } - - /** - @return Motion model. See cv::videostab::MotionModel. - */ - virtual MotionModel motionModel() const { return motionModel_; } - - /** @brief Estimates global motion between two 2D point clouds. - - @param points0 Source set of 2D points (32F). - @param points1 Destination set of 2D points (32F). - @param ok Indicates whether motion was estimated successfully. - @return 3x3 2D transformation matrix (32F). - */ - virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) = 0; - -protected: - MotionEstimatorBase(MotionModel model) { setMotionModel(model); } - -private: - MotionModel motionModel_; -}; - -/** @brief Describes a robust RANSAC-based global 2D motion estimation method which minimizes L2 error. - */ -class CV_EXPORTS MotionEstimatorRansacL2 : public MotionEstimatorBase -{ -public: - MotionEstimatorRansacL2(MotionModel model = MM_AFFINE); - - void setRansacParams(const RansacParams &val) { ransacParams_ = val; } - RansacParams ransacParams() const { return ransacParams_; } - - void setMinInlierRatio(float val) { minInlierRatio_ = val; } - float minInlierRatio() const { return minInlierRatio_; } - - virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) CV_OVERRIDE; - -private: - RansacParams ransacParams_; - float minInlierRatio_; -}; - -/** @brief Describes a global 2D motion estimation method which minimizes L1 error. - -@note To be able to use this method you must build OpenCV with CLP library support. : - */ -class CV_EXPORTS MotionEstimatorL1 : public MotionEstimatorBase -{ -public: - MotionEstimatorL1(MotionModel model = MM_AFFINE); - - virtual Mat estimate(InputArray points0, InputArray points1, bool *ok = 0) CV_OVERRIDE; - -private: - std::vector obj_, collb_, colub_; - std::vector elems_, rowlb_, rowub_; - std::vector rows_, cols_; - - void set(int row, int col, double coef) - { - rows_.push_back(row); - cols_.push_back(col); - elems_.push_back(coef); - } -}; - -/** @brief Base class for global 2D motion estimation methods which take frames as input. - */ -class CV_EXPORTS ImageMotionEstimatorBase -{ -public: - virtual ~ImageMotionEstimatorBase() {} - - virtual void setMotionModel(MotionModel val) { motionModel_ = val; } - virtual MotionModel motionModel() const { return motionModel_; } - - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) = 0; - -protected: - ImageMotionEstimatorBase(MotionModel model) { setMotionModel(model); } - -private: - MotionModel motionModel_; -}; - -class CV_EXPORTS FromFileMotionReader : public ImageMotionEstimatorBase -{ -public: - FromFileMotionReader(const String &path); - - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; - -private: - std::ifstream file_; -}; - -class CV_EXPORTS ToFileMotionWriter : public ImageMotionEstimatorBase -{ -public: - ToFileMotionWriter(const String &path, Ptr estimator); - - virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } - - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; - -private: - std::ofstream file_; - Ptr motionEstimator_; -}; - -/** @brief Describes a global 2D motion estimation method which uses keypoints detection and optical flow for -matching. - */ -class CV_EXPORTS KeypointBasedMotionEstimator : public ImageMotionEstimatorBase -{ -public: - KeypointBasedMotionEstimator(Ptr estimator); - - virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } - - void setDetector(Ptr val) { detector_ = val; } - Ptr detector() const { return detector_; } - - void setOpticalFlowEstimator(Ptr val) { optFlowEstimator_ = val; } - Ptr opticalFlowEstimator() const { return optFlowEstimator_; } - - void setOutlierRejector(Ptr val) { outlierRejector_ = val; } - Ptr outlierRejector() const { return outlierRejector_; } - - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; - Mat estimate(InputArray frame0, InputArray frame1, bool *ok = 0); - -private: - Ptr motionEstimator_; - Ptr detector_; - Ptr optFlowEstimator_; - Ptr outlierRejector_; - - std::vector status_; - std::vector keypointsPrev_; - std::vector pointsPrev_, points_; - std::vector pointsPrevGood_, pointsGood_; -}; - -#if defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW) - -class CV_EXPORTS KeypointBasedMotionEstimatorGpu : public ImageMotionEstimatorBase -{ -public: - KeypointBasedMotionEstimatorGpu(Ptr estimator); - - virtual void setMotionModel(MotionModel val) CV_OVERRIDE { motionEstimator_->setMotionModel(val); } - virtual MotionModel motionModel() const CV_OVERRIDE { return motionEstimator_->motionModel(); } - - void setOutlierRejector(Ptr val) { outlierRejector_ = val; } - Ptr outlierRejector() const { return outlierRejector_; } - - virtual Mat estimate(const Mat &frame0, const Mat &frame1, bool *ok = 0) CV_OVERRIDE; - Mat estimate(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, bool *ok = 0); - -private: - Ptr motionEstimator_; - Ptr detector_; - SparsePyrLkOptFlowEstimatorGpu optFlowEstimator_; - Ptr outlierRejector_; - - cuda::GpuMat frame0_, grayFrame0_, frame1_; - cuda::GpuMat pointsPrev_, points_; - cuda::GpuMat status_; - - Mat hostPointsPrev_, hostPoints_; - std::vector hostPointsPrevTmp_, hostPointsTmp_; - std::vector rejectionStatus_; -}; - -#endif // defined(HAVE_OPENCV_CUDAIMGPROC) && defined(HAVE_OPENCV_CUDAOPTFLOW) - -/** @brief Computes motion between two frames assuming that all the intermediate motions are known. - -@param from Source frame index. -@param to Destination frame index. -@param motions Pair-wise motions. motions[i] denotes motion from the frame i to the frame i+1 -@return Motion from the Source frame to the Destination frame. - */ -CV_EXPORTS Mat getMotion(int from, int to, const std::vector &motions); - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/inpainting.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/inpainting.hpp deleted file mode 100644 index 9c123f0..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/inpainting.hpp +++ /dev/null @@ -1,212 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_INPAINTINT_HPP -#define OPENCV_VIDEOSTAB_INPAINTINT_HPP - -#include -#include "opencv2/core.hpp" -#include "opencv2/videostab/optical_flow.hpp" -#include "opencv2/videostab/fast_marching.hpp" -#include "opencv2/videostab/global_motion.hpp" -#include "opencv2/photo.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS InpainterBase -{ -public: - InpainterBase() - : radius_(0), motionModel_(MM_UNKNOWN), frames_(0), motions_(0), - stabilizedFrames_(0), stabilizationMotions_(0) {} - - virtual ~InpainterBase() {} - - virtual void setRadius(int val) { radius_ = val; } - virtual int radius() const { return radius_; } - - virtual void setMotionModel(MotionModel val) { motionModel_ = val; } - virtual MotionModel motionModel() const { return motionModel_; } - - virtual void inpaint(int idx, Mat &frame, Mat &mask) = 0; - - - // data from stabilizer - - virtual void setFrames(const std::vector &val) { frames_ = &val; } - virtual const std::vector& frames() const { return *frames_; } - - virtual void setMotions(const std::vector &val) { motions_ = &val; } - virtual const std::vector& motions() const { return *motions_; } - - virtual void setStabilizedFrames(const std::vector &val) { stabilizedFrames_ = &val; } - virtual const std::vector& stabilizedFrames() const { return *stabilizedFrames_; } - - virtual void setStabilizationMotions(const std::vector &val) { stabilizationMotions_ = &val; } - virtual const std::vector& stabilizationMotions() const { return *stabilizationMotions_; } - -protected: - int radius_; - MotionModel motionModel_; - const std::vector *frames_; - const std::vector *motions_; - const std::vector *stabilizedFrames_; - const std::vector *stabilizationMotions_; -}; - -class CV_EXPORTS NullInpainter : public InpainterBase -{ -public: - virtual void inpaint(int /*idx*/, Mat &/*frame*/, Mat &/*mask*/) CV_OVERRIDE {} -}; - -class CV_EXPORTS InpaintingPipeline : public InpainterBase -{ -public: - void pushBack(Ptr inpainter) { inpainters_.push_back(inpainter); } - bool empty() const { return inpainters_.empty(); } - - virtual void setRadius(int val) CV_OVERRIDE; - virtual void setMotionModel(MotionModel val) CV_OVERRIDE; - virtual void setFrames(const std::vector &val) CV_OVERRIDE; - virtual void setMotions(const std::vector &val) CV_OVERRIDE; - virtual void setStabilizedFrames(const std::vector &val) CV_OVERRIDE; - virtual void setStabilizationMotions(const std::vector &val) CV_OVERRIDE; - - virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; - -private: - std::vector > inpainters_; -}; - -class CV_EXPORTS ConsistentMosaicInpainter : public InpainterBase -{ -public: - ConsistentMosaicInpainter(); - - void setStdevThresh(float val) { stdevThresh_ = val; } - float stdevThresh() const { return stdevThresh_; } - - virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; - -private: - float stdevThresh_; -}; - -class CV_EXPORTS MotionInpainter : public InpainterBase -{ -public: - MotionInpainter(); - - void setOptFlowEstimator(Ptr val) { optFlowEstimator_ = val; } - Ptr optFlowEstimator() const { return optFlowEstimator_; } - - void setFlowErrorThreshold(float val) { flowErrorThreshold_ = val; } - float flowErrorThreshold() const { return flowErrorThreshold_; } - - void setDistThreshold(float val) { distThresh_ = val; } - float distThresh() const { return distThresh_; } - - void setBorderMode(int val) { borderMode_ = val; } - int borderMode() const { return borderMode_; } - - virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; - -private: - FastMarchingMethod fmm_; - Ptr optFlowEstimator_; - float flowErrorThreshold_; - float distThresh_; - int borderMode_; - - Mat frame1_, transformedFrame1_; - Mat_ grayFrame_, transformedGrayFrame1_; - Mat_ mask1_, transformedMask1_; - Mat_ flowX_, flowY_, flowErrors_; - Mat_ flowMask_; -}; - -class CV_EXPORTS ColorAverageInpainter : public InpainterBase -{ -public: - virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; - -private: - FastMarchingMethod fmm_; -}; - -class CV_EXPORTS ColorInpainter : public InpainterBase -{ -public: - ColorInpainter(int method = INPAINT_TELEA, double radius = 2.); - - virtual void inpaint(int idx, Mat &frame, Mat &mask) CV_OVERRIDE; - -private: - int method_; - double radius_; - Mat invMask_; -}; - -inline ColorInpainter::ColorInpainter(int _method, double _radius) - : method_(_method), radius_(_radius) {} - -CV_EXPORTS void calcFlowMask( - const Mat &flowX, const Mat &flowY, const Mat &errors, float maxError, - const Mat &mask0, const Mat &mask1, Mat &flowMask); - -CV_EXPORTS void completeFrameAccordingToFlow( - const Mat &flowMask, const Mat &flowX, const Mat &flowY, const Mat &frame1, const Mat &mask1, - float distThresh, Mat& frame0, Mat &mask0); - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/log.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/log.hpp deleted file mode 100644 index 73e7049..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/log.hpp +++ /dev/null @@ -1,80 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_LOG_HPP -#define OPENCV_VIDEOSTAB_LOG_HPP - -#include "opencv2/core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS ILog -{ -public: - virtual ~ILog() {} - virtual void print(const char *format, ...) = 0; -}; - -class CV_EXPORTS NullLog : public ILog -{ -public: - virtual void print(const char * /*format*/, ...) CV_OVERRIDE {} -}; - -class CV_EXPORTS LogToStdout : public ILog -{ -public: - virtual void print(const char *format, ...) CV_OVERRIDE; -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_core.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_core.hpp deleted file mode 100644 index 4525cc7..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_core.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_MOTION_CORE_HPP -#define OPENCV_VIDEOSTAB_MOTION_CORE_HPP - -#include -#include "opencv2/core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab_motion -//! @{ - -/** @brief Describes motion model between two point clouds. - */ -enum MotionModel -{ - MM_TRANSLATION = 0, - MM_TRANSLATION_AND_SCALE = 1, - MM_ROTATION = 2, - MM_RIGID = 3, - MM_SIMILARITY = 4, - MM_AFFINE = 5, - MM_HOMOGRAPHY = 6, - MM_UNKNOWN = 7 -}; - -/** @brief Describes RANSAC method parameters. - */ -struct CV_EXPORTS RansacParams -{ - int size; //!< subset size - float thresh; //!< max error to classify as inlier - float eps; //!< max outliers ratio - float prob; //!< probability of success - - RansacParams() : size(0), thresh(0), eps(0), prob(0) {} - /** @brief Constructor - @param size Subset size. - @param thresh Maximum re-projection error value to classify as inlier. - @param eps Maximum ratio of incorrect correspondences. - @param prob Required success probability. - */ - RansacParams(int size, float thresh, float eps, float prob); - - /** - @return Number of iterations that'll be performed by RANSAC method. - */ - int niters() const - { - return static_cast( - std::ceil(std::log(1 - prob) / std::log(1 - std::pow(1 - eps, size)))); - } - - /** - @param model Motion model. See cv::videostab::MotionModel. - @return Default RANSAC method parameters for the given motion model. - */ - static RansacParams default2dMotion(MotionModel model) - { - CV_Assert(model < MM_UNKNOWN); - if (model == MM_TRANSLATION) - return RansacParams(1, 0.5f, 0.5f, 0.99f); - if (model == MM_TRANSLATION_AND_SCALE) - return RansacParams(2, 0.5f, 0.5f, 0.99f); - if (model == MM_ROTATION) - return RansacParams(1, 0.5f, 0.5f, 0.99f); - if (model == MM_RIGID) - return RansacParams(2, 0.5f, 0.5f, 0.99f); - if (model == MM_SIMILARITY) - return RansacParams(2, 0.5f, 0.5f, 0.99f); - if (model == MM_AFFINE) - return RansacParams(3, 0.5f, 0.5f, 0.99f); - return RansacParams(4, 0.5f, 0.5f, 0.99f); - } -}; - -inline RansacParams::RansacParams(int _size, float _thresh, float _eps, float _prob) - : size(_size), thresh(_thresh), eps(_eps), prob(_prob) {} - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_stabilizing.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_stabilizing.hpp deleted file mode 100644 index c50095b..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/motion_stabilizing.hpp +++ /dev/null @@ -1,174 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP -#define OPENCV_VIDEOSTAB_MOTION_STABILIZING_HPP - -#include -#include -#include "opencv2/core.hpp" -#include "opencv2/videostab/global_motion.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab_motion -//! @{ - -class CV_EXPORTS IMotionStabilizer -{ -public: - virtual ~IMotionStabilizer() {} - - //! assumes that [0, size-1) is in or equals to [range.first, range.second) - virtual void stabilize( - int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions) = 0; -}; - -class CV_EXPORTS MotionStabilizationPipeline : public IMotionStabilizer -{ -public: - void pushBack(Ptr stabilizer) { stabilizers_.push_back(stabilizer); } - bool empty() const { return stabilizers_.empty(); } - - virtual void stabilize( - int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions) CV_OVERRIDE; - -private: - std::vector > stabilizers_; -}; - -class CV_EXPORTS MotionFilterBase : public IMotionStabilizer -{ -public: - virtual ~MotionFilterBase() {} - - virtual Mat stabilize( - int idx, const std::vector &motions, std::pair range) = 0; - - virtual void stabilize( - int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions) CV_OVERRIDE; -}; - -class CV_EXPORTS GaussianMotionFilter : public MotionFilterBase -{ -public: - GaussianMotionFilter(int radius = 15, float stdev = -1.f); - - void setParams(int radius, float stdev = -1.f); - int radius() const { return radius_; } - float stdev() const { return stdev_; } - - virtual Mat stabilize( - int idx, const std::vector &motions, std::pair range) CV_OVERRIDE; - -private: - int radius_; - float stdev_; - std::vector weight_; -}; - -inline GaussianMotionFilter::GaussianMotionFilter(int _radius, float _stdev) { setParams(_radius, _stdev); } - -class CV_EXPORTS LpMotionStabilizer : public IMotionStabilizer -{ -public: - LpMotionStabilizer(MotionModel model = MM_SIMILARITY); - - void setMotionModel(MotionModel val) { model_ = val; } - MotionModel motionModel() const { return model_; } - - void setFrameSize(Size val) { frameSize_ = val; } - Size frameSize() const { return frameSize_; } - - void setTrimRatio(float val) { trimRatio_ = val; } - float trimRatio() const { return trimRatio_; } - - void setWeight1(float val) { w1_ = val; } - float weight1() const { return w1_; } - - void setWeight2(float val) { w2_ = val; } - float weight2() const { return w2_; } - - void setWeight3(float val) { w3_ = val; } - float weight3() const { return w3_; } - - void setWeight4(float val) { w4_ = val; } - float weight4() const { return w4_; } - - virtual void stabilize( - int size, const std::vector &motions, std::pair range, - Mat *stabilizationMotions) CV_OVERRIDE; - -private: - MotionModel model_; - Size frameSize_; - float trimRatio_; - float w1_, w2_, w3_, w4_; - - std::vector obj_, collb_, colub_; - std::vector rows_, cols_; - std::vector elems_, rowlb_, rowub_; - - void set(int row, int col, double coef) - { - rows_.push_back(row); - cols_.push_back(col); - elems_.push_back(coef); - } -}; - -CV_EXPORTS Mat ensureInclusionConstraint(const Mat &M, Size size, float trimRatio); - -CV_EXPORTS float estimateOptimalTrimRatio(const Mat &M, Size size); - -//! @} - -} // namespace videostab -} // namespace - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/optical_flow.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/optical_flow.hpp deleted file mode 100644 index 5e06941..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/optical_flow.hpp +++ /dev/null @@ -1,150 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP -#define OPENCV_VIDEOSTAB_OPTICAL_FLOW_HPP - -#include "opencv2/core.hpp" -#include "opencv2/opencv_modules.hpp" - -#ifdef HAVE_OPENCV_CUDAOPTFLOW - #include "opencv2/cudaoptflow.hpp" -#endif - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS ISparseOptFlowEstimator -{ -public: - virtual ~ISparseOptFlowEstimator() {} - virtual void run( - InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, - OutputArray status, OutputArray errors) = 0; -}; - -class CV_EXPORTS IDenseOptFlowEstimator -{ -public: - virtual ~IDenseOptFlowEstimator() {} - virtual void run( - InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, - OutputArray errors) = 0; -}; - -class CV_EXPORTS PyrLkOptFlowEstimatorBase -{ -public: - PyrLkOptFlowEstimatorBase() { setWinSize(Size(21, 21)); setMaxLevel(3); } - - virtual void setWinSize(Size val) { winSize_ = val; } - virtual Size winSize() const { return winSize_; } - - virtual void setMaxLevel(int val) { maxLevel_ = val; } - virtual int maxLevel() const { return maxLevel_; } - virtual ~PyrLkOptFlowEstimatorBase() {} - -protected: - Size winSize_; - int maxLevel_; -}; - -class CV_EXPORTS SparsePyrLkOptFlowEstimator - : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator -{ -public: - virtual void run( - InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, - OutputArray status, OutputArray errors) CV_OVERRIDE; -}; - -#ifdef HAVE_OPENCV_CUDAOPTFLOW - -class CV_EXPORTS SparsePyrLkOptFlowEstimatorGpu - : public PyrLkOptFlowEstimatorBase, public ISparseOptFlowEstimator -{ -public: - SparsePyrLkOptFlowEstimatorGpu(); - - virtual void run( - InputArray frame0, InputArray frame1, InputArray points0, InputOutputArray points1, - OutputArray status, OutputArray errors) CV_OVERRIDE; - - void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, - cuda::GpuMat &status, cuda::GpuMat &errors); - - void run(const cuda::GpuMat &frame0, const cuda::GpuMat &frame1, const cuda::GpuMat &points0, cuda::GpuMat &points1, - cuda::GpuMat &status); - -private: - Ptr optFlowEstimator_; - cuda::GpuMat frame0_, frame1_, points0_, points1_, status_, errors_; -}; - -class CV_EXPORTS DensePyrLkOptFlowEstimatorGpu - : public PyrLkOptFlowEstimatorBase, public IDenseOptFlowEstimator -{ -public: - DensePyrLkOptFlowEstimatorGpu(); - - virtual void run( - InputArray frame0, InputArray frame1, InputOutputArray flowX, InputOutputArray flowY, - OutputArray errors) CV_OVERRIDE; - -private: - Ptr optFlowEstimator_; - cuda::GpuMat frame0_, frame1_, flowX_, flowY_, errors_; -}; - -#endif - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/outlier_rejection.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/outlier_rejection.hpp deleted file mode 100644 index 1d29896..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/outlier_rejection.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_OUTLIER_REJECTION_HPP -#define OPENCV_VIDEOSTAB_OUTLIER_REJECTION_HPP - -#include -#include "opencv2/core.hpp" -#include "opencv2/videostab/motion_core.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS IOutlierRejector -{ -public: - virtual ~IOutlierRejector() {} - - virtual void process( - Size frameSize, InputArray points0, InputArray points1, OutputArray mask) = 0; -}; - -class CV_EXPORTS NullOutlierRejector : public IOutlierRejector -{ -public: - virtual void process( - Size frameSize, InputArray points0, InputArray points1, OutputArray mask) CV_OVERRIDE; -}; - -class CV_EXPORTS TranslationBasedLocalOutlierRejector : public IOutlierRejector -{ -public: - TranslationBasedLocalOutlierRejector(); - - void setCellSize(Size val) { cellSize_ = val; } - Size cellSize() const { return cellSize_; } - - void setRansacParams(RansacParams val) { ransacParams_ = val; } - RansacParams ransacParams() const { return ransacParams_; } - - virtual void process( - Size frameSize, InputArray points0, InputArray points1, OutputArray mask) CV_OVERRIDE; - -private: - Size cellSize_; - RansacParams ransacParams_; - - typedef std::vector Cell; - std::vector grid_; -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/ring_buffer.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/ring_buffer.hpp deleted file mode 100644 index 55d5244..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/ring_buffer.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_RING_BUFFER_HPP -#define OPENCV_VIDEOSTAB_RING_BUFFER_HPP - -#include -#include "opencv2/imgproc.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -template inline T& at(int idx, std::vector &items) -{ - return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; -} - -template inline const T& at(int idx, const std::vector &items) -{ - return items[cv::borderInterpolate(idx, static_cast(items.size()), cv::BORDER_WRAP)]; -} - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/stabilizer.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/stabilizer.hpp deleted file mode 100644 index 634a0aa..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/stabilizer.hpp +++ /dev/null @@ -1,200 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_STABILIZER_HPP -#define OPENCV_VIDEOSTAB_STABILIZER_HPP - -#include -#include -#include "opencv2/core.hpp" -#include "opencv2/imgproc.hpp" -#include "opencv2/videostab/global_motion.hpp" -#include "opencv2/videostab/motion_stabilizing.hpp" -#include "opencv2/videostab/frame_source.hpp" -#include "opencv2/videostab/log.hpp" -#include "opencv2/videostab/inpainting.hpp" -#include "opencv2/videostab/deblurring.hpp" -#include "opencv2/videostab/wobble_suppression.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS StabilizerBase -{ -public: - virtual ~StabilizerBase() {} - - void setLog(Ptr ilog) { log_ = ilog; } - Ptr log() const { return log_; } - - void setRadius(int val) { radius_ = val; } - int radius() const { return radius_; } - - void setFrameSource(Ptr val) { frameSource_ = val; } - Ptr frameSource() const { return frameSource_; } - - void setMotionEstimator(Ptr val) { motionEstimator_ = val; } - Ptr motionEstimator() const { return motionEstimator_; } - - void setDeblurer(Ptr val) { deblurer_ = val; } - Ptr deblurrer() const { return deblurer_; } - - void setTrimRatio(float val) { trimRatio_ = val; } - float trimRatio() const { return trimRatio_; } - - void setCorrectionForInclusion(bool val) { doCorrectionForInclusion_ = val; } - bool doCorrectionForInclusion() const { return doCorrectionForInclusion_; } - - void setBorderMode(int val) { borderMode_ = val; } - int borderMode() const { return borderMode_; } - - void setInpainter(Ptr val) { inpainter_ = val; } - Ptr inpainter() const { return inpainter_; } - -protected: - StabilizerBase(); - - void reset(); - Mat nextStabilizedFrame(); - bool doOneIteration(); - virtual void setUp(const Mat &firstFrame); - virtual Mat estimateMotion() = 0; - virtual Mat estimateStabilizationMotion() = 0; - void stabilizeFrame(); - virtual Mat postProcessFrame(const Mat &frame); - void logProcessingTime(); - - Ptr log_; - Ptr frameSource_; - Ptr motionEstimator_; - Ptr deblurer_; - Ptr inpainter_; - int radius_; - float trimRatio_; - bool doCorrectionForInclusion_; - int borderMode_; - - Size frameSize_; - Mat frameMask_; - int curPos_; - int curStabilizedPos_; - bool doDeblurring_; - Mat preProcessedFrame_; - bool doInpainting_; - Mat inpaintingMask_; - Mat finalFrame_; - std::vector frames_; - std::vector motions_; // motions_[i] is the motion from i-th to i+1-th frame - std::vector blurrinessRates_; - std::vector stabilizedFrames_; - std::vector stabilizedMasks_; - std::vector stabilizationMotions_; - clock_t processingStartTime_; -}; - -class CV_EXPORTS OnePassStabilizer : public StabilizerBase, public IFrameSource -{ -public: - OnePassStabilizer(); - - void setMotionFilter(Ptr val) { motionFilter_ = val; } - Ptr motionFilter() const { return motionFilter_; } - - virtual void reset() CV_OVERRIDE; - virtual Mat nextFrame() CV_OVERRIDE { return nextStabilizedFrame(); } - -protected: - virtual void setUp(const Mat &firstFrame) CV_OVERRIDE; - virtual Mat estimateMotion() CV_OVERRIDE; - virtual Mat estimateStabilizationMotion() CV_OVERRIDE; - virtual Mat postProcessFrame(const Mat &frame) CV_OVERRIDE; - - Ptr motionFilter_; -}; - -class CV_EXPORTS TwoPassStabilizer : public StabilizerBase, public IFrameSource -{ -public: - TwoPassStabilizer(); - - void setMotionStabilizer(Ptr val) { motionStabilizer_ = val; } - Ptr motionStabilizer() const { return motionStabilizer_; } - - void setWobbleSuppressor(Ptr val) { wobbleSuppressor_ = val; } - Ptr wobbleSuppressor() const { return wobbleSuppressor_; } - - void setEstimateTrimRatio(bool val) { mustEstTrimRatio_ = val; } - bool mustEstimateTrimaRatio() const { return mustEstTrimRatio_; } - - virtual void reset() CV_OVERRIDE; - virtual Mat nextFrame() CV_OVERRIDE; - -protected: - void runPrePassIfNecessary(); - - virtual void setUp(const Mat &firstFrame) CV_OVERRIDE; - virtual Mat estimateMotion() CV_OVERRIDE; - virtual Mat estimateStabilizationMotion() CV_OVERRIDE; - virtual Mat postProcessFrame(const Mat &frame) CV_OVERRIDE; - - Ptr motionStabilizer_; - Ptr wobbleSuppressor_; - bool mustEstTrimRatio_; - - int frameCount_; - bool isPrePassDone_; - bool doWobbleSuppression_; - std::vector motions2_; - Mat suppressedFrame_; -}; - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/pub/opencv/include/opencv2/videostab/wobble_suppression.hpp b/qt-correction-tool/pub/opencv/include/opencv2/videostab/wobble_suppression.hpp deleted file mode 100644 index d60ae6d..0000000 --- a/qt-correction-tool/pub/opencv/include/opencv2/videostab/wobble_suppression.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/*M/////////////////////////////////////////////////////////////////////////////////////// -// -// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. -// -// By downloading, copying, installing or using the software you agree to this license. -// If you do not agree to this license, do not download, install, -// copy or use the software. -// -// -// License Agreement -// For Open Source Computer Vision Library -// -// Copyright (C) 2000-2008, Intel Corporation, all rights reserved. -// Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -// Third party copyrights are property of their respective owners. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// * Redistribution's of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistribution's in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * The name of the copyright holders may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// This software is provided by the copyright holders and contributors "as is" and -// any express or implied warranties, including, but not limited to, the implied -// warranties of merchantability and fitness for a particular purpose are disclaimed. -// In no event shall the Intel Corporation or contributors be liable for any direct, -// indirect, incidental, special, exemplary, or consequential damages -// (including, but not limited to, procurement of substitute goods or services; -// loss of use, data, or profits; or business interruption) however caused -// and on any theory of liability, whether in contract, strict liability, -// or tort (including negligence or otherwise) arising in any way out of -// the use of this software, even if advised of the possibility of such damage. -// -//M*/ - -#ifndef OPENCV_VIDEOSTAB_WOBBLE_SUPPRESSION_HPP -#define OPENCV_VIDEOSTAB_WOBBLE_SUPPRESSION_HPP - -#include -#include "opencv2/core.hpp" -#include "opencv2/core/cuda.hpp" -#include "opencv2/videostab/global_motion.hpp" -#include "opencv2/videostab/log.hpp" - -namespace cv -{ -namespace videostab -{ - -//! @addtogroup videostab -//! @{ - -class CV_EXPORTS WobbleSuppressorBase -{ -public: - WobbleSuppressorBase(); - - virtual ~WobbleSuppressorBase() {} - - void setMotionEstimator(Ptr val) { motionEstimator_ = val; } - Ptr motionEstimator() const { return motionEstimator_; } - - virtual void suppress(int idx, const Mat &frame, Mat &result) = 0; - - - // data from stabilizer - - virtual void setFrameCount(int val) { frameCount_ = val; } - virtual int frameCount() const { return frameCount_; } - - virtual void setMotions(const std::vector &val) { motions_ = &val; } - virtual const std::vector& motions() const { return *motions_; } - - virtual void setMotions2(const std::vector &val) { motions2_ = &val; } - virtual const std::vector& motions2() const { return *motions2_; } - - virtual void setStabilizationMotions(const std::vector &val) { stabilizationMotions_ = &val; } - virtual const std::vector& stabilizationMotions() const { return *stabilizationMotions_; } - -protected: - Ptr motionEstimator_; - int frameCount_; - const std::vector *motions_; - const std::vector *motions2_; - const std::vector *stabilizationMotions_; -}; - -class CV_EXPORTS NullWobbleSuppressor : public WobbleSuppressorBase -{ -public: - virtual void suppress(int idx, const Mat &frame, Mat &result) CV_OVERRIDE; -}; - -class CV_EXPORTS MoreAccurateMotionWobbleSuppressorBase : public WobbleSuppressorBase -{ -public: - virtual void setPeriod(int val) { period_ = val; } - virtual int period() const { return period_; } - -protected: - MoreAccurateMotionWobbleSuppressorBase() { setPeriod(30); } - - int period_; -}; - -class CV_EXPORTS MoreAccurateMotionWobbleSuppressor : public MoreAccurateMotionWobbleSuppressorBase -{ -public: - virtual void suppress(int idx, const Mat &frame, Mat &result) CV_OVERRIDE; - -private: - Mat_ mapx_, mapy_; -}; - -#if defined(HAVE_OPENCV_CUDAWARPING) -class CV_EXPORTS MoreAccurateMotionWobbleSuppressorGpu : public MoreAccurateMotionWobbleSuppressorBase -{ -public: - void suppress(int idx, const cuda::GpuMat &frame, cuda::GpuMat &result); - virtual void suppress(int idx, const Mat &frame, Mat &result) CV_OVERRIDE; - -private: - cuda::GpuMat frameDevice_, resultDevice_; - cuda::GpuMat mapx_, mapy_; -}; -#endif - -//! @} - -} // namespace videostab -} // namespace cv - -#endif diff --git a/qt-correction-tool/resource.h b/qt-correction-tool/resource.h deleted file mode 100644 index 875a8a4..0000000 Binary files a/qt-correction-tool/resource.h and /dev/null differ diff --git a/qt-correction-tool/scn_config.cpp b/qt-correction-tool/scn_config.cpp deleted file mode 100644 index 9fb5e63..0000000 --- a/qt-correction-tool/scn_config.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#include "stdafx.h" -#include "scn_config.h" -#include "math.h" - -typedef unsigned short uint16_t; - - -hgConfigClass::hgConfigClass() -{ - initpaperTypes(); - initPixType(); - initResolution(); -} - - -hgConfigClass::~hgConfigClass() -{ -} - -void hgConfigClass::settwSS(UINT32 value) -{ - UINT32 uval; - if (ContainspaperTypesKey(value)) - { - uval = paperTypes[value]; - } - else - { - uval = 2; - } - - for (size_t i = 1; i < 6; i++) - { - setBit(i, ((uval >> i - 1) & 0x1) == 0x01); - } - //printf("settwSS: %d\n", Data); -} - -void hgConfigClass::setTwPixelType(UINT32 value) -{ - UINT32 uval; - if (ContainsPixTypeKey(value)) - uval = pixType[value]; - else - uval = 2; - setBit(6, uval == 0x01); -} - -void hgConfigClass::setResolution(UINT32 value) -{ - UINT32 uval; - if (ContainsResolutionKey(value)) - uval = resolutions[value]; - else - uval = 1; - - for (size_t i = 7; i < 9; i++) - { - setBit(i, ((uval >> (i - 7)) & 0x1) == 0x01); - } -} - -void hgConfigClass::setDoubleFeedEnable(bool value) -{ - setBit(9, value); -} - -void hgConfigClass::setStapleEnable(bool value) -{ - setBit(10, value); -} - -void hgConfigClass::setSkewDelection(bool value) -{ - setBit(11, value); -} - -void hgConfigClass::setSkewLevel0bit(bool value) -{ - setBit(12, value); -} - -void hgConfigClass::setSkewLevel1bit(bool value) -{ - setBit(13, value); -} - -void hgConfigClass::setSkewLevel2bit(bool value) -{ - setBit(14, value); -} - -void hgConfigClass::setIsConrrect(bool value) -{ - setBit(18, value); -} - -UINT32 hgConfigClass::GetData() -{ - return m_data.to_ulong(); -} - -void hgConfigClass::initpaperTypes() -{ - paperTypes.insert(std::pair(11, 0));//A3 - paperTypes.insert(std::pair(1, 1));//A4 - paperTypes.insert(std::pair(60, 2));//A4R - paperTypes.insert(std::pair(5, 2));//A5 - paperTypes.insert(std::pair(61, 2));//A5R - paperTypes.insert(std::pair(13, 2));//A6 - paperTypes.insert(std::pair(62, 2));//A6R - paperTypes.insert(std::pair(6, 0));//B4 - paperTypes.insert(std::pair(2, 0));//B5 - paperTypes.insert(std::pair(70, 1));//B5R - paperTypes.insert(std::pair(7, 2));//B6 - paperTypes.insert(std::pair(71, 2));//B6R - paperTypes.insert(std::pair(3, 1));//LETTER - paperTypes.insert(std::pair(80, 2));//LETTERR - paperTypes.insert(std::pair(81, 0));//DOUBLE LETTER - paperTypes.insert(std::pair(4, 0));//LEGAL - paperTypes.insert(std::pair(90, 0));//Auto A3ɨ - paperTypes.insert(std::pair(91, 16));//ĸ -} - -void hgConfigClass::initPixType() -{ - pixType.insert(std::pair(0, 0));//BW - pixType.insert(std::pair(1, 0));//Gray - pixType.insert(std::pair(2,1));//RGB -} - -void hgConfigClass::initResolution() -{ - resolutions.insert(std::pair(300, 2));//300 - resolutions.insert(std::pair(200, 1));//200 - resolutions.insert(std::pair(600, 3));//600 -} - -bool hgConfigClass::ContainspaperTypesKey(uint16_t key) -{ - if (paperTypes.count(key) > 0) - { - return true; - } - return false; -} - -bool hgConfigClass::ContainsPixTypeKey(uint16_t key) -{ - if (pixType.count(key)>0) - { - return true; - } - return false; -} - -bool hgConfigClass::ContainsResolutionKey(float key) -{ - if (resolutions.count(key)>0) - { - return true; - } - return false; -} - -void hgConfigClass::setBit(int i, bool flag) -{ - m_data.set(i -1, flag); -} diff --git a/qt-correction-tool/scn_config.h b/qt-correction-tool/scn_config.h deleted file mode 100644 index 5d5d65b..0000000 --- a/qt-correction-tool/scn_config.h +++ /dev/null @@ -1,49 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include "PublicFunc.h" -class hgConfigClass -{ -public: - hgConfigClass(); - - ~hgConfigClass(); - - void settwSS(UINT32 value); - void setTwPixelType(UINT32 value); - void setResolution(UINT32 value); - void setDoubleFeedEnable(bool value); - void setStapleEnable(bool value); - void setSkewDelection(bool value); - void setSkewLevel0bit(bool value); - void setSkewLevel1bit(bool value); - void setSkewLevel2bit(bool value); - void setIsConrrect(bool value); - UINT32 GetData(); -private: - enum Config_Scanner - { - cfStaple, - cfSkewDelection, - SkewLevel0, - SkewLevel1, - SkewLevel2 - }; - std::map paperTypes; - std::map pixType; - std::map resolutions; - void initpaperTypes(); - void initPixType(); - void initResolution(); - bool ContainspaperTypesKey(unsigned short key); - bool ContainsPixTypeKey(unsigned short key); - bool ContainsResolutionKey(float key); - void setBit(int i, bool flag); - - - std::bitset<32> m_data; -}; - diff --git a/qt-correction-tool/scn_usb.h b/qt-correction-tool/scn_usb.h deleted file mode 100644 index 23af483..0000000 --- a/qt-correction-tool/scn_usb.h +++ /dev/null @@ -1,81 +0,0 @@ -#pragma once -#ifdef WIN32 -#include -#include -#endif // WINDOWS - -#include -#include -#include "IUsb.h" - -#pragma pack(1) -struct tag_usb_pipe -{ - HANDLE h_pipe; - USBSCAN_PIPE_INFORMATION pipe_info; - OVERLAPPED overlap; -}; -typedef struct tag_usb_pipe usb_pipe_t, * pusb_pipe_t; -#pragma pack() - -typedef struct tag_usb_scan_dev_info -{ - WORD vid; - WORD pid; - WORD index; -}usb_scan_dev_info, * pusb_scan_dev_info; - -typedef struct tag_usb_scan_dev -{ - USHORT _NumberOfDevs; - tag_usb_scan_dev_info dev_infos[1024]; -}usb_scan_dev, * pusb_scan_dev; - -class UsbScanEx : public IUsb -{ -public: - UsbScanEx(int index); - virtual ~UsbScanEx(); - // ͨ IUsb ̳ - virtual bool open() override; - virtual void set_usbhotplug_callback(usbhotplug_callback callback, void* userdata) override; - virtual bool close() override; - virtual void set_timeout(int timeout) override; - virtual int read_bulk(void* data, int len) override; - virtual int write_bulk(void* data, int len) override; - virtual int control_msg(int rtype, int req, int value, int index, int len, void* data) override; - virtual bool is_open() override; - virtual bool is_connected() override; - virtual int read_int(void* data, int len) override; - -private: - - int BULK_OUT; - int BULK_IN; - int INT_IN; - int CTRL_IN_OUT; - USBSCAN_PIPE_CONFIGURATION m_usbscan_config; - usb_pipe_t m_usb_pipes[MAX_NUM_PIPES]; - HANDLE m_h_dev; - bool m_b_is_connected; - int m_h_index; - int timeout; - OVERLAPPED ov[4]; - usbhotplug_callback hotplug_call; - void* usrdata; -}; - - -class UsbScan_List -{ -public: - ~UsbScan_List(); - - static std::list> find_all(); - static std::list> find_vid_pid(int vid, int pid); - static std::list find_all_usb(); -private: - - UsbScan_List(); - UsbScan_List(uint16_t vendor_id, uint16_t product_id); -}; diff --git a/qt-correction-tool/stdafx.cpp b/qt-correction-tool/stdafx.cpp deleted file mode 100644 index d0464d6..0000000 --- a/qt-correction-tool/stdafx.cpp +++ /dev/null @@ -1,8 +0,0 @@ - -// stdafx.cpp : ֻ׼ļԴļ -// HuaGoCorrect.pch ΪԤͷ -// stdafx.obj ԤϢ - -#include "stdafx.h" - - diff --git a/qt-correction-tool/stdafx.h b/qt-correction-tool/stdafx.h deleted file mode 100644 index f6871b1..0000000 --- a/qt-correction-tool/stdafx.h +++ /dev/null @@ -1,31 +0,0 @@ - -// stdafx.h : ׼ϵͳļİļ -// Ǿʹõĵ -// ضĿİļ - -#pragma once - -#ifndef _SECURE_ATL -#define _SECURE_ATL 1 -#endif - -#ifndef VC_EXTRALEAN -#define VC_EXTRALEAN // Windows ͷųʹõ -#endif - -#include "targetver.h" - - - - -#ifdef _UNICODE -#if defined _M_IX86 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"") -#elif defined _M_X64 -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='amd64' publicKeyToken='6595b64144ccf1df' language='*'\"") -#else -#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") -#endif -#endif - - diff --git a/qt-correction-tool/targetver.h b/qt-correction-tool/targetver.h deleted file mode 100644 index 46d463a..0000000 --- a/qt-correction-tool/targetver.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -// SDKDDKVer.h ߰汾Ŀ Windows ƽ̨ - -// ҪΪǰ Windows ƽ̨Ӧó WinSDKVer.h -// WIN32_WINNT ΪҪֵ֧ƽ̨Ȼٰ SDKDDKVer.h -#ifdef WIN32 -#include -#endif diff --git a/qt-correction-tool/test.pro b/qt-correction-tool/test.pro deleted file mode 100644 index 1e5681b..0000000 --- a/qt-correction-tool/test.pro +++ /dev/null @@ -1,117 +0,0 @@ -QT += core gui - -greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - -CONFIG += c++11 - -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Please consult the documentation of the -# deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. -# In order to do so, uncomment the following line. -# You can also select to disable deprecated APIs only up to a certain version of Qt. -#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 - -SOURCES += \ - widget.cpp\ - PublicFunc.cpp \ - ImageMatQueue.cpp \ - JpegBuffer.cpp \ - gscn_drv.cpp \ - imageprocess.cpp \ - jpeglib.cpp \ - main.cpp \ - scn_config.cpp \ - stdafx.cpp \ - -HEADERS += \ - widget.h \ - PublicFunc.h \ - BlockingQueue.h \ - IUsb.h \ - ImageMatQueue.h \ - JpegBuffer.h \ - gscn_drv.h \ - imageprocess.h \ - jpeglib.h \ - resource.h \ - scn_config.h \ - stdafx.h \ - targetver.h \ - - -win32{ -SOURCES += \ -scn_usb.cpp - -HEADERS += \ -scn_usb.h \ -filetools.h -} - - -FORMS += \ - widget.ui - -TRANSLATIONS += \ - HgScan_zh_CN.ts - -# Default rules for deployment. -qnx: target.path = /tmp/$${TARGET}/bin -else: unix:!android: target.path = /opt/$${TARGET}/bin -!isEmpty(target.path): INSTALLS += target - - - - - - -unix { - #target.path = /usr/lib - #INSTALLS += target - INCLUDEPATH += $$PWD/Tirdparty/3rdparty/nick - INCLUDEPATH += $$PWD/Tirdparty/3rdparty/opencv/include - INCLUDEPATH += $$PWD/Tirdparty/3rdparty/jpeg-turbo/include - INCLUDEPATH +=/home/moshaokang/Win/code-代码/test/Tirdparty/3rdparty/jpeg-turbo/include - - LIBS +=-lusb-1.0 - LIBS += -L$$PWD/irdparty/3rdparty/opencv/lib/x86_64/uos -lopencv_world -llibtiff -llibjpeg-turbo -lIlmImf -littnotify -llibjasper \ - -llibprotobuf -llibpng -lquirc -lzlib #-ltegra_hal - - -LIBS+=-L$$PWD/Tirdparty/3rdparty/jpeg-turbo/lib -llibturbojpeg -libjpeg - - -} - - - -win32{ - - win32:CONFIG(release, debug|release): LIBS += -L$$PWD/pub/opencv/lib/ * - else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/pub/opencv/lib/ * - - INCLUDEPATH += $$PWD/pub/opencv/lib - DEPENDPATH += $$PWD/pub/opencv/lib - - INCLUDEPATH += $$PWD/pub/opencv/include - DEPENDPATH += $$PWD/pub/opencv/include - - INCLUDEPATH += $$PWD/pub/opencv2/include - DEPENDPATH += $$PWD/pub/opencv2/include - - - win32:CONFIG(release, debug|release): LIBS += -L$$PWD/pub/external/lib/ * - else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/pub/external/lib/ * - - INCLUDEPATH += $$PWD/pub/external/lib - DEPENDPATH += $$PWD/pub/external/lib - INCLUDEPATH += $$PWD/pub/external/include - DEPENDPATH += $$PWD/pub/external/include - - -} - diff --git a/qt-correction-tool/test.pro.user b/qt-correction-tool/test.pro.user deleted file mode 100644 index d608fa2..0000000 --- a/qt-correction-tool/test.pro.user +++ /dev/null @@ -1,317 +0,0 @@ - - - - - - EnvironmentId - {8916dcb2-05d5-4adb-af20-4c6d1d204c78} - - - ProjectExplorer.Project.ActiveTarget - 0 - - - ProjectExplorer.Project.EditorSettings - - true - false - true - - Cpp - - CppGlobal - - - - QmlJS - - QmlJSGlobal - - - 2 - UTF-8 - false - 4 - false - 80 - true - true - 1 - true - false - 0 - true - true - 0 - 8 - true - 1 - true - true - true - false - - - - ProjectExplorer.Project.PluginSettings - - - true - - - - ProjectExplorer.Project.Target.0 - - Desktop Qt 5.14.0 GCC 64bit - Desktop Qt 5.14.0 GCC 64bit - qt.qt5.5140.gcc_64_kit - 0 - 0 - 0 - - /home/moshaokang/Win/code-代码/build-test-Desktop_Qt_5_14_0_GCC_64bit-Debug - - - true - QtProjectManager.QMakeBuildStep - true - - false - false - false - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Debug - Qt4ProjectManager.Qt4BuildConfiguration - 2 - - - /home/moshaokang/Win/code-代码/build-test-Desktop_Qt_5_14_0_GCC_64bit-Release - - - true - QtProjectManager.QMakeBuildStep - false - - false - false - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Release - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - - /home/moshaokang/Win/code-代码/build-test-Desktop_Qt_5_14_0_GCC_64bit-Profile - - - true - QtProjectManager.QMakeBuildStep - true - - false - true - true - - - true - Qt4ProjectManager.MakeStep - - false - - - false - - 2 - Build - Build - ProjectExplorer.BuildSteps.Build - - - - true - Qt4ProjectManager.MakeStep - - true - clean - - false - - 1 - Clean - Clean - ProjectExplorer.BuildSteps.Clean - - 2 - false - - Profile - Qt4ProjectManager.Qt4BuildConfiguration - 0 - - 3 - - - 0 - Deploy - Deploy - ProjectExplorer.BuildSteps.Deploy - - 1 - ProjectExplorer.DefaultDeployConfiguration - - 1 - - - dwarf - - cpu-cycles - - - 250 - - -e - cpu-cycles - --call-graph - dwarf,4096 - -F - 250 - - -F - true - 4096 - false - false - 1000 - - true - - false - false - false - false - true - 0.01 - 10 - true - kcachegrind - 1 - 25 - - 1 - true - false - true - valgrind - - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - - 2 - - Qt4ProjectManager.Qt4RunConfiguration:/home/moshaokang/Win/code-代码/test/test.pro - /home/moshaokang/Win/code-代码/test/test.pro - - false - - false - true - true - false - false - true - - /home/moshaokang/Win/code-代码/build-test-Desktop_Qt_5_14_0_GCC_64bit-Debug - - 1 - - - - ProjectExplorer.Project.TargetCount - 1 - - - ProjectExplorer.Project.Updater.FileVersion - 22 - - - Version - 22 - - diff --git a/qt-correction-tool/test.sln b/qt-correction-tool/test.sln deleted file mode 100644 index 8a75455..0000000 --- a/qt-correction-tool/test.sln +++ /dev/null @@ -1,25 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31410.357 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcxproj", "{BD00077E-2208-3360-B61F-4EE0A644E6B0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BD00077E-2208-3360-B61F-4EE0A644E6B0}.Debug|x86.ActiveCfg = Debug|Win32 - {BD00077E-2208-3360-B61F-4EE0A644E6B0}.Debug|x86.Build.0 = Debug|Win32 - {BD00077E-2208-3360-B61F-4EE0A644E6B0}.Release|x86.ActiveCfg = Release|Win32 - {BD00077E-2208-3360-B61F-4EE0A644E6B0}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D1332225-3D02-40F7-BD09-30669BB786CB} - EndGlobalSection -EndGlobal diff --git a/qt-correction-tool/test.vcxproj b/qt-correction-tool/test.vcxproj deleted file mode 100644 index 6851102..0000000 --- a/qt-correction-tool/test.vcxproj +++ /dev/null @@ -1,251 +0,0 @@ - - - - - Release - Win32 - - - Debug - Win32 - - - - {BD00077E-2208-3360-B61F-4EE0A644E6B0} - test - QtVS_v304 - 10.0 - 10.0.19041.0 - $(MSBuildProjectDirectory)\QtMsBuild - - - - v142 - release\ - false - NotSet - Application - release\ - test - - - v142 - debug\ - false - NotSet - Application - debug\ - test - - - - - - - - - - - - - - - - - - debug\ - debug\ - test - true - - - release\ - release\ - test - true - false - - - 5.14.0_msvc2017 - core;gui;widgets - - - 5.14.0_msvc2017 - core;gui;widgets - - - - - - - E:\test\pub\opencv\include;E:\test\pub\external\include;%(AdditionalIncludeDirectories) - -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) - release\ - false - None - 4577;4467;%(DisableSpecificWarnings) - Sync - release\ - MaxSpeed - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;NDEBUG;QT_DEPRECATED_WARNINGS;QT_NO_DEBUG;%(PreprocessorDefinitions) - false - - - MultiThreadedDLL - true - true - Level3 - true - - - turbojpeg.lib;opencv_world346.lib;%(AdditionalDependencies) - .\pub\external\lib;.\pub\opencv\lib;%(AdditionalLibraryDirectories) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - false - true - false - true - .\release\test.exe - true - Windows - true - - - Unsigned - None - 0 - - - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;NDEBUG;QT_DEPRECATED_WARNINGS;QT_NO_DEBUG;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;%(PreprocessorDefinitions) - - - msvc - ./$(Configuration)/moc_predefs.h - Moc'ing %(Identity)... - output - $(Configuration) - moc_%(Filename).cpp - - - Uic'ing %(Identity)... - $(ProjectDir) - ui_%(Filename).h - - - - - .;.\pub\opencv\include;.\pub\external\include;%(AdditionalIncludeDirectories) - -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 %(AdditionalOptions) - debug\ - false - ProgramDatabase - 4577;4467;%(DisableSpecificWarnings) - Sync - debug\ - Disabled - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;%(PreprocessorDefinitions) - false - MultiThreadedDebugDLL - true - true - Level3 - true - - - turbojpeg.lib;opencv_world346d.lib;%(AdditionalDependencies) - .;.\pub\opencv\lib;.\pub\external\lib;%(AdditionalLibraryDirectories) - "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions) - true - true - true - .\debug\test.exe - true - Windows - true - - - Unsigned - None - 0 - - - _WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;QT_DEPRECATED_WARNINGS;QT_WIDGETS_LIB;QT_GUI_LIB;QT_CORE_LIB;_DEBUG;%(PreprocessorDefinitions) - - - msvc - ./$(Configuration)/moc_predefs.h - moc %(Identity) - output - $(Configuration) - moc_%(Filename).cpp - - - uic %(Identity) - $(ProjectDir) - ui_%(Filename).h - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Document - true - $(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs) - cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -Zi -MDd -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >debug\moc_predefs.h - Generate moc_predefs.h - debug\moc_predefs.h;%(Outputs) - - - Document - $(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs) - cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -Zc:referenceBinding -Zc:__cplusplus -O2 -MD -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2>NUL >release\moc_predefs.h - Generate moc_predefs.h - release\moc_predefs.h;%(Outputs) - true - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/qt-correction-tool/test_zh_CN.ts b/qt-correction-tool/test_zh_CN.ts deleted file mode 100644 index 2232b9b..0000000 --- a/qt-correction-tool/test_zh_CN.ts +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/qt-correction-tool/ui_widget.h b/qt-correction-tool/ui_widget.h deleted file mode 100644 index 62b75e5..0000000 --- a/qt-correction-tool/ui_widget.h +++ /dev/null @@ -1,1022 +0,0 @@ -/******************************************************************************** -** Form generated from reading UI file 'widget.ui' -** -** Created by: Qt User Interface Compiler version 5.14.0 -** -** WARNING! All changes made in this file will be lost when recompiling UI file! -********************************************************************************/ - -#ifndef UI_WIDGET_H -#define UI_WIDGET_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class Ui_Widget -{ -public: - QGroupBox *groupBox_4; - QLabel *label_35; - QLineEdit *lineEdit_65; - QProgressBar *progressBar; - QPushButton *pushButton_32; - QToolButton *toolButton; - QTabWidget *tabWidget; - QWidget *tabWidgetPage1; - QLineEdit *lineEdit_7; - QLineEdit *lineEdit_25; - QLineEdit *lineEdit_19; - QLineEdit *lineEdit_15; - QLineEdit *lineEdit_31; - QLineEdit *lineEdit_30; - QLabel *label_12; - QPushButton *pushButton_8; - QLineEdit *lineEdit_32; - QLabel *label_13; - QPushButton *pushButton_10; - QLineEdit *lineEdit_37; - QPushButton *pushButton_15; - QLineEdit *lineEdit_41; - QPushButton *pushButton_12; - QLineEdit *lineEdit_34; - QLineEdit *lineEdit_6; - QLabel *label_6; - QLineEdit *lineEdit_22; - QPushButton *pushButton_2; - QLabel *label_32; - QLabel *label_23; - QLineEdit *lineEdit_29; - QLabel *label_28; - QLabel *label_22; - QLineEdit *lineEdit_9; - QLineEdit *lineEdit_35; - QLineEdit *lineEdit_28; - QLineEdit *lineEdit_33; - QLabel *label_19; - QPushButton *pushButton_16; - QPushButton *pushButton_3; - QLineEdit *lineEdit_14; - QLabel *label_16; - QLineEdit *lineEdit_10; - QPushButton *pushButton_6; - QLabel *label_5; - QLineEdit *lineEdit_5; - QLabel *label_24; - QLineEdit *lineEdit_26; - QLineEdit *lineEdit_23; - QLineEdit *lineEdit_21; - QLabel *label_29; - QLineEdit *lineEdit_18; - QLineEdit *lineEdit_16; - QLabel *label_25; - QLineEdit *lineEdit_12; - QPushButton *pushButton_18; - QLineEdit *lineEdit_39; - QLineEdit *lineEdit_17; - QLabel *label_31; - QLabel *label_34; - QLabel *label_21; - QPushButton *pushButton_9; - QLabel *label_15; - QLineEdit *lineEdit_3; - QLabel *label_26; - QPushButton *pushButton_4; - QLineEdit *lineEdit_20; - QLineEdit *lineEdit_4; - QLineEdit *lineEdit_38; - QLabel *label_30; - QLabel *label_3; - QPushButton *pushButton; - QPushButton *pushButton_5; - QLabel *label_4; - QWidget *horizontalLayoutWidget; - QHBoxLayout *horizontalLayout; - QLabel *label; - QComboBox *comboBox; - QLabel *label_11; - QLabel *label_27; - QPushButton *pushButton_11; - QPushButton *pushButton_17; - QLabel *label_10; - QLineEdit *lineEdit_11; - QLabel *label_18; - QLineEdit *lineEdit_27; - QLineEdit *lineEdit_8; - QLabel *label_17; - QLabel *label_8; - QLabel *label_9; - QPushButton *pushButton_7; - QLabel *label_20; - QLineEdit *lineEdit_36; - QLineEdit *lineEdit_13; - QLabel *label_7; - QLabel *label_14; - QLabel *label_2; - QLineEdit *lineEdit_24; - QPushButton *pushButton_13; - QCheckBox *checkBox_4; - QCheckBox *checkBox_5; - QCheckBox *checkBox_6; - QCheckBox *checkBox_7; - QLabel *label_43; - QLineEdit *lineEdit_40; - QWidget *tabWidgetPage2; - QPushButton *pushButton_38; - QPushButton *pushButton_37; - QLabel *label_39; - QLabel *label_41; - QLineEdit *lineEdit_70; - QToolButton *toolButton_2; - QPushButton *pushButton_33; - QLabel *label_42; - QComboBox *comboBox_6; - QWidget *tabWidgetPage3; - QLabel *label_61; - QLabel *label_62; - QLabel *label_63; - QLabel *label_64; - QLineEdit *lineEdit_66; - QLineEdit *lineEdit_67; - QLineEdit *lineEdit_68; - QPushButton *pushButton_39; - QPushButton *pushButton_40; - QPushButton *pushButton_41; - QPushButton *pushButton_42; - QPushButton *pushButton_43; - QPushButton *pushButton_44; - QLabel *label_65; - QLabel *label_66; - QLineEdit *lineEdit_69; - QPushButton *pushButton_70; - QPushButton *pushButton_71; - QLabel *label_106; - QLineEdit *lineEdit_111; - QPushButton *pushButton_72; - QPushButton *pushButton_73; - QGroupBox *groupBox_2; - QLabel *label_36; - QComboBox *comboBox_4; - QLabel *label_38; - QCheckBox *checkBox; - QLabel *label_37; - QComboBox *comboBox_3; - QLabel *label_44; - QLineEdit *lineEdit_48; - QCheckBox *checkBox_3; - QPushButton *pushButton_22; - QPushButton *pushButton_21; - QLCDNumber *lcdNumber; - QGroupBox *groupBox_3; - QPushButton *pushButton_31; - QPushButton *pushButton_29; - QPushButton *pushButton_30; - QGroupBox *groupBox; - QLabel *label_33; - QComboBox *comboBox_2; - QComboBox *comboBox_5; - QPushButton *pushButton_14; - QLabel *label_40; - - void setupUi(QWidget *Widget) - { - if (Widget->objectName().isEmpty()) - Widget->setObjectName(QString::fromUtf8("Widget")); - Widget->resize(1293, 1002); - Widget->setStyleSheet(QString::fromUtf8("QPushButton{\n" -" background:#e6f0fa;\n" -" border:2px groove gray;\n" -" border-radius:10px;\n" -" padding:2px 4px\n" -"}\n" -"\n" -"QPushButton:pressed { /*\346\214\211\351\222\256\350\242\253\346\214\211\344\270\213\346\227\266*/\n" -" background-color:rgba(100,255,100, 200);\n" -" border-color: rgba(255, 225, 255, 30);\n" -" border-style: inset;\n" -" color:rgba(0, 0, 0, 100);\n" -"}\n" -"QPushButton:hover{ /*\351\274\240\346\240\207\346\202\254\345\201\234\345\234\250\346\214\211\351\222\256\344\270\212\346\227\266*/\n" -" background-color:rgba(100,255,100, 100);\n" -" border-color: rgba(255, 225, 255, 200);\n" -" color:rgba(0, 0, 0, 200);\n" -"}\n" -"\n" -"QWidget{\n" -" border:2px groove gray;\n" -" border-radius:10px;\n" -" padding:2px 4px;\n" -"}\n" -"QLabel{\n" -" background-color: rgb(192, 188, 200);\n" -"}\n" -"QToolButton:pressed { /*\346\214\211\351\222\256\350\242\253\346\214\211\344\270\213\346\227\266*/\n" -" background-color:rgba(100,255,100, 200);\n" -" border-color:" - " rgba(255, 225, 255, 30);\n" -" border-style: inset;\n" -" color:rgba(0, 0, 0, 100);\n" -"}\n" -"QToolButton:hover{ /*\351\274\240\346\240\207\346\202\254\345\201\234\345\234\250\346\214\211\351\222\256\344\270\212\346\227\266*/\n" -" background-color:rgba(100,255,100, 100);\n" -" border-color: rgba(255, 225, 255, 200);\n" -" color:rgba(0, 0, 0, 200);\n" -"}")); - groupBox_4 = new QGroupBox(Widget); - groupBox_4->setObjectName(QString::fromUtf8("groupBox_4")); - groupBox_4->setGeometry(QRect(820, 630, 331, 191)); - label_35 = new QLabel(groupBox_4); - label_35->setObjectName(QString::fromUtf8("label_35")); - label_35->setGeometry(QRect(10, 20, 101, 21)); - lineEdit_65 = new QLineEdit(groupBox_4); - lineEdit_65->setObjectName(QString::fromUtf8("lineEdit_65")); - lineEdit_65->setGeometry(QRect(10, 40, 301, 21)); - progressBar = new QProgressBar(groupBox_4); - progressBar->setObjectName(QString::fromUtf8("progressBar")); - progressBar->setGeometry(QRect(10, 70, 301, 41)); - progressBar->setValue(0); - pushButton_32 = new QPushButton(groupBox_4); - pushButton_32->setObjectName(QString::fromUtf8("pushButton_32")); - pushButton_32->setGeometry(QRect(230, 120, 71, 41)); - pushButton_32->setAutoRepeat(false); - toolButton = new QToolButton(groupBox_4); - toolButton->setObjectName(QString::fromUtf8("toolButton")); - toolButton->setGeometry(QRect(100, 119, 71, 41)); - tabWidget = new QTabWidget(Widget); - tabWidget->setObjectName(QString::fromUtf8("tabWidget")); - tabWidget->setGeometry(QRect(0, 10, 811, 831)); - tabWidget->setStyleSheet(QString::fromUtf8("QPushButton:hover{ /*\351\274\240\346\240\207\346\202\254\345\201\234\345\234\250\346\214\211\351\222\256\344\270\212\346\227\266*/\n" -" background-color:rgba(100,255,100, 100);\n" -" border-color: rgba(255, 225, 255, 200);\n" -" color:rgba(0, 0, 0, 200);\n" -"}\n" -"\n" -"QPushButton:pressed { /*\346\214\211\351\222\256\350\242\253\346\214\211\344\270\213\346\227\266*/\n" -" background-color:rgba(100,255,100, 200);\n" -" border-color: rgba(255, 225, 255, 30);\n" -" border-style: inset;\n" -" color:rgba(0, 0, 0, 100);\n" -"}\n" -"\n" -"")); - tabWidgetPage1 = new QWidget(); - tabWidgetPage1->setObjectName(QString::fromUtf8("tabWidgetPage1")); - lineEdit_7 = new QLineEdit(tabWidgetPage1); - lineEdit_7->setObjectName(QString::fromUtf8("lineEdit_7")); - lineEdit_7->setGeometry(QRect(140, 150, 51, 31)); - lineEdit_25 = new QLineEdit(tabWidgetPage1); - lineEdit_25->setObjectName(QString::fromUtf8("lineEdit_25")); - lineEdit_25->setGeometry(QRect(500, 300, 51, 31)); - lineEdit_19 = new QLineEdit(tabWidgetPage1); - lineEdit_19->setObjectName(QString::fromUtf8("lineEdit_19")); - lineEdit_19->setGeometry(QRect(370, 250, 51, 20)); - lineEdit_15 = new QLineEdit(tabWidgetPage1); - lineEdit_15->setObjectName(QString::fromUtf8("lineEdit_15")); - lineEdit_15->setGeometry(QRect(500, 180, 51, 31)); - lineEdit_31 = new QLineEdit(tabWidgetPage1); - lineEdit_31->setObjectName(QString::fromUtf8("lineEdit_31")); - lineEdit_31->setGeometry(QRect(230, 300, 51, 31)); - lineEdit_30 = new QLineEdit(tabWidgetPage1); - lineEdit_30->setObjectName(QString::fromUtf8("lineEdit_30")); - lineEdit_30->setGeometry(QRect(60, 330, 51, 31)); - label_12 = new QLabel(tabWidgetPage1); - label_12->setObjectName(QString::fromUtf8("label_12")); - label_12->setGeometry(QRect(420, 130, 21, 20)); - pushButton_8 = new QPushButton(tabWidgetPage1); - pushButton_8->setObjectName(QString::fromUtf8("pushButton_8")); - pushButton_8->setGeometry(QRect(560, 450, 41, 31)); - lineEdit_32 = new QLineEdit(tabWidgetPage1); - lineEdit_32->setObjectName(QString::fromUtf8("lineEdit_32")); - lineEdit_32->setGeometry(QRect(320, 330, 51, 31)); - label_13 = new QLabel(tabWidgetPage1); - label_13->setObjectName(QString::fromUtf8("label_13")); - label_13->setGeometry(QRect(510, 130, 21, 20)); - pushButton_10 = new QPushButton(tabWidgetPage1); - pushButton_10->setObjectName(QString::fromUtf8("pushButton_10")); - pushButton_10->setGeometry(QRect(230, 510, 41, 21)); - lineEdit_37 = new QLineEdit(tabWidgetPage1); - lineEdit_37->setObjectName(QString::fromUtf8("lineEdit_37")); - lineEdit_37->setGeometry(QRect(430, 459, 61, 31)); - pushButton_15 = new QPushButton(tabWidgetPage1); - pushButton_15->setObjectName(QString::fromUtf8("pushButton_15")); - pushButton_15->setGeometry(QRect(620, 150, 41, 31)); - lineEdit_41 = new QLineEdit(tabWidgetPage1); - lineEdit_41->setObjectName(QString::fromUtf8("lineEdit_41")); - lineEdit_41->setGeometry(QRect(70, 570, 101, 20)); - pushButton_12 = new QPushButton(tabWidgetPage1); - pushButton_12->setObjectName(QString::fromUtf8("pushButton_12")); - pushButton_12->setGeometry(QRect(310, 560, 91, 31)); - lineEdit_34 = new QLineEdit(tabWidgetPage1); - lineEdit_34->setObjectName(QString::fromUtf8("lineEdit_34")); - lineEdit_34->setGeometry(QRect(60, 429, 61, 31)); - lineEdit_6 = new QLineEdit(tabWidgetPage1); - lineEdit_6->setObjectName(QString::fromUtf8("lineEdit_6")); - lineEdit_6->setGeometry(QRect(60, 150, 51, 31)); - label_6 = new QLabel(tabWidgetPage1); - label_6->setObjectName(QString::fromUtf8("label_6")); - label_6->setGeometry(QRect(20, 150, 42, 20)); - lineEdit_22 = new QLineEdit(tabWidgetPage1); - lineEdit_22->setObjectName(QString::fromUtf8("lineEdit_22")); - lineEdit_22->setGeometry(QRect(140, 300, 51, 31)); - pushButton_2 = new QPushButton(tabWidgetPage1); - pushButton_2->setObjectName(QString::fromUtf8("pushButton_2")); - pushButton_2->setGeometry(QRect(320, 392, 101, 21)); - label_32 = new QLabel(tabWidgetPage1); - label_32->setObjectName(QString::fromUtf8("label_32")); - label_32->setGeometry(QRect(20, 550, 41, 21)); - label_23 = new QLabel(tabWidgetPage1); - label_23->setObjectName(QString::fromUtf8("label_23")); - label_23->setGeometry(QRect(70, 280, 21, 20)); - lineEdit_29 = new QLineEdit(tabWidgetPage1); - lineEdit_29->setObjectName(QString::fromUtf8("lineEdit_29")); - lineEdit_29->setGeometry(QRect(230, 330, 51, 31)); - label_28 = new QLabel(tabWidgetPage1); - label_28->setObjectName(QString::fromUtf8("label_28")); - label_28->setGeometry(QRect(20, 461, 42, 31)); - label_22 = new QLabel(tabWidgetPage1); - label_22->setObjectName(QString::fromUtf8("label_22")); - label_22->setGeometry(QRect(150, 280, 21, 20)); - lineEdit_9 = new QLineEdit(tabWidgetPage1); - lineEdit_9->setObjectName(QString::fromUtf8("lineEdit_9")); - lineEdit_9->setGeometry(QRect(320, 150, 51, 31)); - lineEdit_35 = new QLineEdit(tabWidgetPage1); - lineEdit_35->setObjectName(QString::fromUtf8("lineEdit_35")); - lineEdit_35->setGeometry(QRect(60, 459, 61, 31)); - lineEdit_28 = new QLineEdit(tabWidgetPage1); - lineEdit_28->setObjectName(QString::fromUtf8("lineEdit_28")); - lineEdit_28->setGeometry(QRect(410, 330, 51, 31)); - lineEdit_33 = new QLineEdit(tabWidgetPage1); - lineEdit_33->setObjectName(QString::fromUtf8("lineEdit_33")); - lineEdit_33->setGeometry(QRect(70, 390, 121, 21)); - label_19 = new QLabel(tabWidgetPage1); - label_19->setObjectName(QString::fromUtf8("label_19")); - label_19->setGeometry(QRect(20, 300, 41, 21)); - pushButton_16 = new QPushButton(tabWidgetPage1); - pushButton_16->setObjectName(QString::fromUtf8("pushButton_16")); - pushButton_16->setGeometry(QRect(570, 150, 41, 31)); - pushButton_3 = new QPushButton(tabWidgetPage1); - pushButton_3->setObjectName(QString::fromUtf8("pushButton_3")); - pushButton_3->setGeometry(QRect(430, 390, 101, 21)); - lineEdit_14 = new QLineEdit(tabWidgetPage1); - lineEdit_14->setObjectName(QString::fromUtf8("lineEdit_14")); - lineEdit_14->setGeometry(QRect(320, 180, 51, 31)); - label_16 = new QLabel(tabWidgetPage1); - label_16->setObjectName(QString::fromUtf8("label_16")); - label_16->setGeometry(QRect(160, 250, 51, 21)); - lineEdit_10 = new QLineEdit(tabWidgetPage1); - lineEdit_10->setObjectName(QString::fromUtf8("lineEdit_10")); - lineEdit_10->setGeometry(QRect(500, 150, 51, 31)); - pushButton_6 = new QPushButton(tabWidgetPage1); - pushButton_6->setObjectName(QString::fromUtf8("pushButton_6")); - pushButton_6->setGeometry(QRect(200, 460, 41, 31)); - label_5 = new QLabel(tabWidgetPage1); - label_5->setObjectName(QString::fromUtf8("label_5")); - label_5->setGeometry(QRect(1, 101, 51, 21)); - lineEdit_5 = new QLineEdit(tabWidgetPage1); - lineEdit_5->setObjectName(QString::fromUtf8("lineEdit_5")); - lineEdit_5->setGeometry(QRect(370, 100, 51, 20)); - label_24 = new QLabel(tabWidgetPage1); - label_24->setObjectName(QString::fromUtf8("label_24")); - label_24->setGeometry(QRect(240, 280, 21, 20)); - lineEdit_26 = new QLineEdit(tabWidgetPage1); - lineEdit_26->setObjectName(QString::fromUtf8("lineEdit_26")); - lineEdit_26->setGeometry(QRect(500, 330, 51, 31)); - lineEdit_23 = new QLineEdit(tabWidgetPage1); - lineEdit_23->setObjectName(QString::fromUtf8("lineEdit_23")); - lineEdit_23->setGeometry(QRect(320, 300, 51, 31)); - lineEdit_21 = new QLineEdit(tabWidgetPage1); - lineEdit_21->setObjectName(QString::fromUtf8("lineEdit_21")); - lineEdit_21->setGeometry(QRect(410, 300, 51, 31)); - label_29 = new QLabel(tabWidgetPage1); - label_29->setObjectName(QString::fromUtf8("label_29")); - label_29->setGeometry(QRect(351, 430, 81, 31)); - lineEdit_18 = new QLineEdit(tabWidgetPage1); - lineEdit_18->setObjectName(QString::fromUtf8("lineEdit_18")); - lineEdit_18->setGeometry(QRect(210, 250, 51, 20)); - lineEdit_16 = new QLineEdit(tabWidgetPage1); - lineEdit_16->setObjectName(QString::fromUtf8("lineEdit_16")); - lineEdit_16->setGeometry(QRect(60, 180, 51, 31)); - label_25 = new QLabel(tabWidgetPage1); - label_25->setObjectName(QString::fromUtf8("label_25")); - label_25->setGeometry(QRect(510, 280, 21, 20)); - lineEdit_12 = new QLineEdit(tabWidgetPage1); - lineEdit_12->setObjectName(QString::fromUtf8("lineEdit_12")); - lineEdit_12->setGeometry(QRect(410, 180, 51, 31)); - pushButton_18 = new QPushButton(tabWidgetPage1); - pushButton_18->setObjectName(QString::fromUtf8("pushButton_18")); - pushButton_18->setGeometry(QRect(620, 300, 41, 31)); - lineEdit_39 = new QLineEdit(tabWidgetPage1); - lineEdit_39->setObjectName(QString::fromUtf8("lineEdit_39")); - lineEdit_39->setGeometry(QRect(70, 550, 101, 20)); - lineEdit_17 = new QLineEdit(tabWidgetPage1); - lineEdit_17->setObjectName(QString::fromUtf8("lineEdit_17")); - lineEdit_17->setGeometry(QRect(230, 180, 51, 31)); - label_31 = new QLabel(tabWidgetPage1); - label_31->setObjectName(QString::fromUtf8("label_31")); - label_31->setGeometry(QRect(20, 511, 81, 21)); - label_34 = new QLabel(tabWidgetPage1); - label_34->setObjectName(QString::fromUtf8("label_34")); - label_34->setGeometry(QRect(20, 570, 41, 20)); - label_21 = new QLabel(tabWidgetPage1); - label_21->setObjectName(QString::fromUtf8("label_21")); - label_21->setGeometry(QRect(420, 280, 21, 21)); - pushButton_9 = new QPushButton(tabWidgetPage1); - pushButton_9->setObjectName(QString::fromUtf8("pushButton_9")); - pushButton_9->setGeometry(QRect(510, 450, 41, 31)); - label_15 = new QLabel(tabWidgetPage1); - label_15->setObjectName(QString::fromUtf8("label_15")); - label_15->setGeometry(QRect(320, 250, 51, 21)); - lineEdit_3 = new QLineEdit(tabWidgetPage1); - lineEdit_3->setObjectName(QString::fromUtf8("lineEdit_3")); - lineEdit_3->setGeometry(QRect(60, 100, 51, 20)); - label_26 = new QLabel(tabWidgetPage1); - label_26->setObjectName(QString::fromUtf8("label_26")); - label_26->setGeometry(QRect(20, 390, 51, 21)); - pushButton_4 = new QPushButton(tabWidgetPage1); - pushButton_4->setObjectName(QString::fromUtf8("pushButton_4")); - pushButton_4->setGeometry(QRect(200, 430, 41, 31)); - lineEdit_20 = new QLineEdit(tabWidgetPage1); - lineEdit_20->setObjectName(QString::fromUtf8("lineEdit_20")); - lineEdit_20->setGeometry(QRect(50, 250, 51, 20)); - lineEdit_4 = new QLineEdit(tabWidgetPage1); - lineEdit_4->setObjectName(QString::fromUtf8("lineEdit_4")); - lineEdit_4->setGeometry(QRect(210, 100, 51, 20)); - lineEdit_38 = new QLineEdit(tabWidgetPage1); - lineEdit_38->setObjectName(QString::fromUtf8("lineEdit_38")); - lineEdit_38->setGeometry(QRect(100, 510, 131, 21)); - label_30 = new QLabel(tabWidgetPage1); - label_30->setObjectName(QString::fromUtf8("label_30")); - label_30->setGeometry(QRect(350, 459, 81, 31)); - label_3 = new QLabel(tabWidgetPage1); - label_3->setObjectName(QString::fromUtf8("label_3")); - label_3->setGeometry(QRect(321, 100, 51, 21)); - pushButton = new QPushButton(tabWidgetPage1); - pushButton->setObjectName(QString::fromUtf8("pushButton")); - pushButton->setGeometry(QRect(210, 392, 101, 21)); - pushButton_5 = new QPushButton(tabWidgetPage1); - pushButton_5->setObjectName(QString::fromUtf8("pushButton_5")); - pushButton_5->setGeometry(QRect(150, 430, 41, 31)); - label_4 = new QLabel(tabWidgetPage1); - label_4->setObjectName(QString::fromUtf8("label_4")); - label_4->setGeometry(QRect(161, 100, 51, 21)); - horizontalLayoutWidget = new QWidget(tabWidgetPage1); - horizontalLayoutWidget->setObjectName(QString::fromUtf8("horizontalLayoutWidget")); - horizontalLayoutWidget->setGeometry(QRect(10, 10, 191, 41)); - horizontalLayout = new QHBoxLayout(horizontalLayoutWidget); - horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout")); - horizontalLayout->setContentsMargins(0, 0, 0, 0); - label = new QLabel(horizontalLayoutWidget); - label->setObjectName(QString::fromUtf8("label")); - - horizontalLayout->addWidget(label); - - comboBox = new QComboBox(horizontalLayoutWidget); - comboBox->addItem(QString()); - comboBox->addItem(QString()); - comboBox->addItem(QString()); - comboBox->addItem(QString()); - comboBox->setObjectName(QString::fromUtf8("comboBox")); - - horizontalLayout->addWidget(comboBox); - - label_11 = new QLabel(tabWidgetPage1); - label_11->setObjectName(QString::fromUtf8("label_11")); - label_11->setGeometry(QRect(330, 130, 21, 20)); - label_27 = new QLabel(tabWidgetPage1); - label_27->setObjectName(QString::fromUtf8("label_27")); - label_27->setGeometry(QRect(20, 431, 42, 31)); - pushButton_11 = new QPushButton(tabWidgetPage1); - pushButton_11->setObjectName(QString::fromUtf8("pushButton_11")); - pushButton_11->setGeometry(QRect(200, 560, 91, 31)); - pushButton_17 = new QPushButton(tabWidgetPage1); - pushButton_17->setObjectName(QString::fromUtf8("pushButton_17")); - pushButton_17->setGeometry(QRect(570, 300, 41, 31)); - label_10 = new QLabel(tabWidgetPage1); - label_10->setObjectName(QString::fromUtf8("label_10")); - label_10->setGeometry(QRect(240, 130, 21, 20)); - lineEdit_11 = new QLineEdit(tabWidgetPage1); - lineEdit_11->setObjectName(QString::fromUtf8("lineEdit_11")); - lineEdit_11->setGeometry(QRect(410, 150, 51, 31)); - label_18 = new QLabel(tabWidgetPage1); - label_18->setObjectName(QString::fromUtf8("label_18")); - label_18->setGeometry(QRect(20, 330, 41, 21)); - lineEdit_27 = new QLineEdit(tabWidgetPage1); - lineEdit_27->setObjectName(QString::fromUtf8("lineEdit_27")); - lineEdit_27->setGeometry(QRect(60, 300, 51, 31)); - lineEdit_8 = new QLineEdit(tabWidgetPage1); - lineEdit_8->setObjectName(QString::fromUtf8("lineEdit_8")); - lineEdit_8->setGeometry(QRect(230, 150, 51, 31)); - label_17 = new QLabel(tabWidgetPage1); - label_17->setObjectName(QString::fromUtf8("label_17")); - label_17->setGeometry(QRect(0, 250, 51, 21)); - label_8 = new QLabel(tabWidgetPage1); - label_8->setObjectName(QString::fromUtf8("label_8")); - label_8->setGeometry(QRect(70, 130, 21, 20)); - label_9 = new QLabel(tabWidgetPage1); - label_9->setObjectName(QString::fromUtf8("label_9")); - label_9->setGeometry(QRect(150, 130, 21, 20)); - pushButton_7 = new QPushButton(tabWidgetPage1); - pushButton_7->setObjectName(QString::fromUtf8("pushButton_7")); - pushButton_7->setGeometry(QRect(150, 460, 41, 31)); - label_20 = new QLabel(tabWidgetPage1); - label_20->setObjectName(QString::fromUtf8("label_20")); - label_20->setGeometry(QRect(330, 280, 21, 20)); - lineEdit_36 = new QLineEdit(tabWidgetPage1); - lineEdit_36->setObjectName(QString::fromUtf8("lineEdit_36")); - lineEdit_36->setGeometry(QRect(430, 429, 61, 31)); - lineEdit_13 = new QLineEdit(tabWidgetPage1); - lineEdit_13->setObjectName(QString::fromUtf8("lineEdit_13")); - lineEdit_13->setGeometry(QRect(140, 180, 51, 31)); - label_7 = new QLabel(tabWidgetPage1); - label_7->setObjectName(QString::fromUtf8("label_7")); - label_7->setGeometry(QRect(20, 180, 41, 21)); - label_14 = new QLabel(tabWidgetPage1); - label_14->setObjectName(QString::fromUtf8("label_14")); - label_14->setGeometry(QRect(0, 220, 41, 21)); - label_14->setStyleSheet(QString::fromUtf8("QLabel{\n" -" \n" -" background-color: rgb(255, 255, 255);\n" -"}")); - label_2 = new QLabel(tabWidgetPage1); - label_2->setObjectName(QString::fromUtf8("label_2")); - label_2->setGeometry(QRect(0, 70, 41, 21)); - label_2->setStyleSheet(QString::fromUtf8("QLabel{\n" -" \n" -" background-color: rgb(255, 255, 255);\n" -"}")); - lineEdit_24 = new QLineEdit(tabWidgetPage1); - lineEdit_24->setObjectName(QString::fromUtf8("lineEdit_24")); - lineEdit_24->setGeometry(QRect(140, 330, 51, 31)); - pushButton_13 = new QPushButton(tabWidgetPage1); - pushButton_13->setObjectName(QString::fromUtf8("pushButton_13")); - pushButton_13->setGeometry(QRect(510, 630, 81, 71)); - QFont font; - font.setFamily(QString::fromUtf8("Arial Black")); - font.setPointSize(10); - font.setBold(true); - font.setWeight(75); - pushButton_13->setFont(font); - checkBox_4 = new QCheckBox(tabWidgetPage1); - checkBox_4->setObjectName(QString::fromUtf8("checkBox_4")); - checkBox_4->setGeometry(QRect(50, 650, 91, 31)); - checkBox_5 = new QCheckBox(tabWidgetPage1); - checkBox_5->setObjectName(QString::fromUtf8("checkBox_5")); - checkBox_5->setGeometry(QRect(160, 650, 101, 31)); - checkBox_6 = new QCheckBox(tabWidgetPage1); - checkBox_6->setObjectName(QString::fromUtf8("checkBox_6")); - checkBox_6->setGeometry(QRect(50, 690, 91, 31)); - checkBox_7 = new QCheckBox(tabWidgetPage1); - checkBox_7->setObjectName(QString::fromUtf8("checkBox_7")); - checkBox_7->setGeometry(QRect(160, 690, 101, 31)); - label_43 = new QLabel(tabWidgetPage1); - label_43->setObjectName(QString::fromUtf8("label_43")); - label_43->setGeometry(QRect(460, 100, 71, 21)); - lineEdit_40 = new QLineEdit(tabWidgetPage1); - lineEdit_40->setObjectName(QString::fromUtf8("lineEdit_40")); - lineEdit_40->setGeometry(QRect(550, 100, 51, 20)); - tabWidget->addTab(tabWidgetPage1, QString()); - tabWidgetPage2 = new QWidget(); - tabWidgetPage2->setObjectName(QString::fromUtf8("tabWidgetPage2")); - pushButton_38 = new QPushButton(tabWidgetPage2); - pushButton_38->setObjectName(QString::fromUtf8("pushButton_38")); - pushButton_38->setGeometry(QRect(490, 690, 176, 31)); - pushButton_37 = new QPushButton(tabWidgetPage2); - pushButton_37->setObjectName(QString::fromUtf8("pushButton_37")); - pushButton_37->setGeometry(QRect(490, 740, 176, 31)); - label_39 = new QLabel(tabWidgetPage2); - label_39->setObjectName(QString::fromUtf8("label_39")); - label_39->setGeometry(QRect(0, 0, 791, 671)); - label_41 = new QLabel(tabWidgetPage2); - label_41->setObjectName(QString::fromUtf8("label_41")); - label_41->setGeometry(QRect(30, 740, 101, 21)); - lineEdit_70 = new QLineEdit(tabWidgetPage2); - lineEdit_70->setObjectName(QString::fromUtf8("lineEdit_70")); - lineEdit_70->setGeometry(QRect(140, 740, 211, 21)); - toolButton_2 = new QToolButton(tabWidgetPage2); - toolButton_2->setObjectName(QString::fromUtf8("toolButton_2")); - toolButton_2->setGeometry(QRect(350, 740, 31, 20)); - toolButton_2->setFont(font); - pushButton_33 = new QPushButton(tabWidgetPage2); - pushButton_33->setObjectName(QString::fromUtf8("pushButton_33")); - pushButton_33->setGeometry(QRect(380, 740, 21, 21)); - pushButton_33->setAutoRepeat(false); - label_42 = new QLabel(tabWidgetPage2); - label_42->setObjectName(QString::fromUtf8("label_42")); - label_42->setGeometry(QRect(30, 690, 101, 31)); - comboBox_6 = new QComboBox(tabWidgetPage2); - comboBox_6->addItem(QString()); - comboBox_6->addItem(QString()); - comboBox_6->setObjectName(QString::fromUtf8("comboBox_6")); - comboBox_6->setGeometry(QRect(140, 690, 61, 31)); - comboBox_6->setFont(font); - tabWidget->addTab(tabWidgetPage2, QString()); - tabWidgetPage3 = new QWidget(); - tabWidgetPage3->setObjectName(QString::fromUtf8("tabWidgetPage3")); - label_61 = new QLabel(tabWidgetPage3); - label_61->setObjectName(QString::fromUtf8("label_61")); - label_61->setGeometry(QRect(20, 20, 61, 20)); - label_62 = new QLabel(tabWidgetPage3); - label_62->setObjectName(QString::fromUtf8("label_62")); - label_62->setGeometry(QRect(20, 59, 81, 31)); - label_63 = new QLabel(tabWidgetPage3); - label_63->setObjectName(QString::fromUtf8("label_63")); - label_63->setGeometry(QRect(20, 89, 81, 31)); - label_64 = new QLabel(tabWidgetPage3); - label_64->setObjectName(QString::fromUtf8("label_64")); - label_64->setGeometry(QRect(20, 119, 81, 31)); - lineEdit_66 = new QLineEdit(tabWidgetPage3); - lineEdit_66->setObjectName(QString::fromUtf8("lineEdit_66")); - lineEdit_66->setGeometry(QRect(110, 60, 51, 31)); - lineEdit_67 = new QLineEdit(tabWidgetPage3); - lineEdit_67->setObjectName(QString::fromUtf8("lineEdit_67")); - lineEdit_67->setGeometry(QRect(110, 89, 51, 31)); - lineEdit_68 = new QLineEdit(tabWidgetPage3); - lineEdit_68->setObjectName(QString::fromUtf8("lineEdit_68")); - lineEdit_68->setGeometry(QRect(110, 120, 51, 31)); - pushButton_39 = new QPushButton(tabWidgetPage3); - pushButton_39->setObjectName(QString::fromUtf8("pushButton_39")); - pushButton_39->setGeometry(QRect(180, 60, 51, 31)); - pushButton_40 = new QPushButton(tabWidgetPage3); - pushButton_40->setObjectName(QString::fromUtf8("pushButton_40")); - pushButton_40->setGeometry(QRect(180, 90, 51, 31)); - pushButton_41 = new QPushButton(tabWidgetPage3); - pushButton_41->setObjectName(QString::fromUtf8("pushButton_41")); - pushButton_41->setGeometry(QRect(180, 120, 51, 31)); - pushButton_42 = new QPushButton(tabWidgetPage3); - pushButton_42->setObjectName(QString::fromUtf8("pushButton_42")); - pushButton_42->setGeometry(QRect(240, 60, 51, 31)); - pushButton_43 = new QPushButton(tabWidgetPage3); - pushButton_43->setObjectName(QString::fromUtf8("pushButton_43")); - pushButton_43->setGeometry(QRect(240, 90, 51, 31)); - pushButton_44 = new QPushButton(tabWidgetPage3); - pushButton_44->setObjectName(QString::fromUtf8("pushButton_44")); - pushButton_44->setGeometry(QRect(240, 120, 51, 31)); - label_65 = new QLabel(tabWidgetPage3); - label_65->setObjectName(QString::fromUtf8("label_65")); - label_65->setGeometry(QRect(20, 190, 71, 20)); - label_66 = new QLabel(tabWidgetPage3); - label_66->setObjectName(QString::fromUtf8("label_66")); - label_66->setGeometry(QRect(20, 240, 111, 31)); - lineEdit_69 = new QLineEdit(tabWidgetPage3); - lineEdit_69->setObjectName(QString::fromUtf8("lineEdit_69")); - lineEdit_69->setGeometry(QRect(130, 240, 71, 31)); - pushButton_70 = new QPushButton(tabWidgetPage3); - pushButton_70->setObjectName(QString::fromUtf8("pushButton_70")); - pushButton_70->setGeometry(QRect(210, 240, 121, 31)); - pushButton_71 = new QPushButton(tabWidgetPage3); - pushButton_71->setObjectName(QString::fromUtf8("pushButton_71")); - pushButton_71->setGeometry(QRect(350, 240, 121, 31)); - label_106 = new QLabel(tabWidgetPage3); - label_106->setObjectName(QString::fromUtf8("label_106")); - label_106->setGeometry(QRect(20, 290, 111, 31)); - lineEdit_111 = new QLineEdit(tabWidgetPage3); - lineEdit_111->setObjectName(QString::fromUtf8("lineEdit_111")); - lineEdit_111->setGeometry(QRect(130, 290, 71, 31)); - pushButton_72 = new QPushButton(tabWidgetPage3); - pushButton_72->setObjectName(QString::fromUtf8("pushButton_72")); - pushButton_72->setGeometry(QRect(210, 290, 121, 31)); - pushButton_73 = new QPushButton(tabWidgetPage3); - pushButton_73->setObjectName(QString::fromUtf8("pushButton_73")); - pushButton_73->setGeometry(QRect(350, 290, 121, 31)); - tabWidget->addTab(tabWidgetPage3, QString()); - groupBox_2 = new QGroupBox(Widget); - groupBox_2->setObjectName(QString::fromUtf8("groupBox_2")); - groupBox_2->setGeometry(QRect(820, 200, 331, 261)); - label_36 = new QLabel(groupBox_2); - label_36->setObjectName(QString::fromUtf8("label_36")); - label_36->setGeometry(QRect(40, 40, 51, 21)); - comboBox_4 = new QComboBox(groupBox_2); - comboBox_4->addItem(QString()); - comboBox_4->addItem(QString()); - comboBox_4->setObjectName(QString::fromUtf8("comboBox_4")); - comboBox_4->setGeometry(QRect(110, 70, 71, 20)); - QFont font1; - font1.setFamily(QString::fromUtf8("Arial Black")); - font1.setPointSize(8); - font1.setBold(true); - font1.setWeight(75); - comboBox_4->setFont(font1); - label_38 = new QLabel(groupBox_2); - label_38->setObjectName(QString::fromUtf8("label_38")); - label_38->setGeometry(QRect(40, 120, 71, 31)); - checkBox = new QCheckBox(groupBox_2); - checkBox->setObjectName(QString::fromUtf8("checkBox")); - checkBox->setGeometry(QRect(110, 190, 71, 31)); - label_37 = new QLabel(groupBox_2); - label_37->setObjectName(QString::fromUtf8("label_37")); - label_37->setGeometry(QRect(40, 70, 51, 21)); - comboBox_3 = new QComboBox(groupBox_2); - comboBox_3->addItem(QString()); - comboBox_3->addItem(QString()); - comboBox_3->addItem(QString()); - comboBox_3->setObjectName(QString::fromUtf8("comboBox_3")); - comboBox_3->setGeometry(QRect(110, 40, 71, 20)); - comboBox_3->setFont(font1); - label_44 = new QLabel(groupBox_2); - label_44->setObjectName(QString::fromUtf8("label_44")); - label_44->setGeometry(QRect(40, 150, 71, 31)); - lineEdit_48 = new QLineEdit(groupBox_2); - lineEdit_48->setObjectName(QString::fromUtf8("lineEdit_48")); - lineEdit_48->setGeometry(QRect(110, 150, 71, 31)); - QFont font2; - font2.setFamily(QString::fromUtf8("Arial Black")); - font2.setPointSize(14); - font2.setBold(true); - font2.setWeight(75); - lineEdit_48->setFont(font2); - lineEdit_48->setDragEnabled(true); - checkBox_3 = new QCheckBox(groupBox_2); - checkBox_3->setObjectName(QString::fromUtf8("checkBox_3")); - checkBox_3->setGeometry(QRect(40, 190, 71, 31)); - pushButton_22 = new QPushButton(groupBox_2); - pushButton_22->setObjectName(QString::fromUtf8("pushButton_22")); - pushButton_22->setGeometry(QRect(230, 120, 77, 51)); - pushButton_22->setFont(font); - pushButton_22->setStyleSheet(QString::fromUtf8("")); - pushButton_22->setCheckable(false); - pushButton_22->setChecked(false); - pushButton_22->setAutoRepeat(false); - pushButton_21 = new QPushButton(groupBox_2); - pushButton_21->setObjectName(QString::fromUtf8("pushButton_21")); - pushButton_21->setGeometry(QRect(230, 170, 77, 51)); - pushButton_21->setFont(font); - lcdNumber = new QLCDNumber(groupBox_2); - lcdNumber->setObjectName(QString::fromUtf8("lcdNumber")); - lcdNumber->setGeometry(QRect(110, 120, 71, 31)); - lcdNumber->setSegmentStyle(QLCDNumber::Flat); - groupBox_3 = new QGroupBox(Widget); - groupBox_3->setObjectName(QString::fromUtf8("groupBox_3")); - groupBox_3->setGeometry(QRect(820, 480, 331, 111)); - pushButton_31 = new QPushButton(groupBox_3); - pushButton_31->setObjectName(QString::fromUtf8("pushButton_31")); - pushButton_31->setGeometry(QRect(40, 60, 101, 31)); - pushButton_29 = new QPushButton(groupBox_3); - pushButton_29->setObjectName(QString::fromUtf8("pushButton_29")); - pushButton_29->setGeometry(QRect(180, 30, 121, 61)); - pushButton_30 = new QPushButton(groupBox_3); - pushButton_30->setObjectName(QString::fromUtf8("pushButton_30")); - pushButton_30->setGeometry(QRect(40, 20, 101, 31)); - groupBox = new QGroupBox(Widget); - groupBox->setObjectName(QString::fromUtf8("groupBox")); - groupBox->setGeometry(QRect(820, 40, 331, 131)); - label_33 = new QLabel(groupBox); - label_33->setObjectName(QString::fromUtf8("label_33")); - label_33->setGeometry(QRect(31, 31, 101, 20)); - comboBox_2 = new QComboBox(groupBox); - comboBox_2->setObjectName(QString::fromUtf8("comboBox_2")); - comboBox_2->setGeometry(QRect(130, 30, 151, 20)); - QFont font3; - font3.setFamily(QString::fromUtf8("Arial Black")); - font3.setBold(true); - font3.setWeight(75); - comboBox_2->setFont(font3); - comboBox_5 = new QComboBox(groupBox); - comboBox_5->addItem(QString()); - comboBox_5->addItem(QString()); - comboBox_5->addItem(QString()); - comboBox_5->addItem(QString()); - comboBox_5->setObjectName(QString::fromUtf8("comboBox_5")); - comboBox_5->setGeometry(QRect(130, 70, 151, 21)); - comboBox_5->setFont(font3); - pushButton_14 = new QPushButton(groupBox); - pushButton_14->setObjectName(QString::fromUtf8("pushButton_14")); - pushButton_14->setGeometry(QRect(190, 100, 91, 22)); - label_40 = new QLabel(groupBox); - label_40->setObjectName(QString::fromUtf8("label_40")); - label_40->setGeometry(QRect(30, 70, 101, 20)); - - retranslateUi(Widget); - QObject::connect(comboBox_4, SIGNAL(currentIndexChanged(QString)), Widget, SLOT(OnCbnSelChangeColor())); - QObject::connect(pushButton_22, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnstart())); - QObject::connect(pushButton_14, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnRefresh())); - QObject::connect(pushButton_21, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnstop())); - QObject::connect(toolButton, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSelectfile())); - QObject::connect(pushButton_32, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnUpdate())); - QObject::connect(pushButton_31, SIGNAL(clicked()), Widget, SLOT(OnBnClickedCheckparamset())); - QObject::connect(pushButton_29, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnFlat())); - QObject::connect(pushButton_30, SIGNAL(clicked()), Widget, SLOT(OnBnClickedCheckparamread())); - QObject::connect(pushButton_70, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetsleeptime())); - QObject::connect(pushButton_72, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetspeedmode())); - QObject::connect(pushButton_13, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnReboot())); - QObject::connect(pushButton_37, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnNextpage())); - QObject::connect(pushButton_4, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSethor())); - QObject::connect(pushButton_16, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnaup())); - QObject::connect(pushButton_6, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSetver())); - QObject::connect(pushButton_9, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnGetexpos())); - QObject::connect(pushButton_5, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnGethor())); - QObject::connect(pushButton_42, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnsetcolorsp())); - QObject::connect(pushButton_71, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnsetsleeptime())); - QObject::connect(toolButton_2, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSetPicSavePath())); - QObject::connect(pushButton_15, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnadown())); - QObject::connect(pushButton_43, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnsetgraysp())); - QObject::connect(pushButton, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetSerial())); - QObject::connect(pushButton_33, SIGNAL(clicked()), Widget, SLOT(OnBnCkickBtnRemind())); - QObject::connect(pushButton_3, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSetSerial())); - QObject::connect(pushButton_17, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnbup())); - QObject::connect(pushButton_8, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnSetexpos())); - QObject::connect(pushButton_38, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnPrepage())); - QObject::connect(pushButton_39, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetcolorsp())); - QObject::connect(pushButton_40, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetgraysp())); - QObject::connect(pushButton_10, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetVersion())); - QObject::connect(pushButton_73, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnsetspeedmode())); - QObject::connect(pushButton_18, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnbdown())); - QObject::connect(comboBox, SIGNAL(currentIndexChanged(QString)), Widget, SLOT(OnCbnSelChangeA4FlatModel())); - QObject::connect(pushButton_44, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnsetuvsp())); - QObject::connect(pushButton_41, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtngetuvsp())); - QObject::connect(pushButton_7, SIGNAL(clicked()), Widget, SLOT(OnBnClickedBtnGetver())); - QObject::connect(comboBox_2, SIGNAL(activated(int)), Widget, SLOT(OnCbnSelchangeCmbUsbs())); - - tabWidget->setCurrentIndex(0); - comboBox_4->setCurrentIndex(1); - - - QMetaObject::connectSlotsByName(Widget); - } // setupUi - - void retranslateUi(QWidget *Widget) - { - Widget->setWindowTitle(QCoreApplication::translate("Widget", "\345\215\216\351\253\230", nullptr)); - groupBox_4->setTitle(QCoreApplication::translate("Widget", "\345\215\207\347\272\247\357\274\232", nullptr)); - label_35->setText(QCoreApplication::translate("Widget", "\351\200\211\346\213\251\345\215\207\347\272\247\346\226\207\344\273\266\357\274\232", nullptr)); - pushButton_32->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213\345\215\207\347\272\247", nullptr)); - toolButton->setText(QCoreApplication::translate("Widget", "\346\211\223\345\274\200\346\226\207\344\273\266\345\244\271", nullptr)); - lineEdit_7->setText(QString()); - lineEdit_25->setText(QString()); - lineEdit_19->setText(QCoreApplication::translate("Widget", "238", nullptr)); - lineEdit_15->setText(QString()); - lineEdit_31->setText(QString()); - lineEdit_30->setText(QString()); - label_12->setText(QCoreApplication::translate("Widget", "5", nullptr)); - pushButton_8->setText(QCoreApplication::translate("Widget", "SET", nullptr)); - lineEdit_32->setText(QString()); - label_13->setText(QCoreApplication::translate("Widget", "6", nullptr)); - pushButton_10->setText(QCoreApplication::translate("Widget", "GET", nullptr)); - pushButton_15->setText(QCoreApplication::translate("Widget", "\345\207\217", nullptr)); - lineEdit_41->setText(QString()); - pushButton_12->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256VID/PID", nullptr)); - lineEdit_6->setText(QString()); - label_6->setText(QCoreApplication::translate("Widget", "\345\242\236\347\233\212\357\274\232", nullptr)); - lineEdit_22->setText(QString()); - pushButton_2->setText(QCoreApplication::translate("Widget", "\350\207\252\345\212\250\347\224\237\346\210\220\345\272\217\345\210\227\345\217\267", nullptr)); - label_32->setText(QCoreApplication::translate("Widget", "VID", nullptr)); - label_23->setText(QCoreApplication::translate("Widget", "1", nullptr)); - lineEdit_29->setText(QString()); - label_28->setText(QCoreApplication::translate("Widget", "\347\272\265\345\220\221\357\274\232", nullptr)); - label_22->setText(QCoreApplication::translate("Widget", "2", nullptr)); - lineEdit_9->setText(QString()); - lineEdit_28->setText(QString()); - label_19->setText(QCoreApplication::translate("Widget", "\345\242\236\347\233\212\357\274\232", nullptr)); - pushButton_16->setText(QCoreApplication::translate("Widget", "\345\212\240", nullptr)); - pushButton_3->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256\345\272\217\345\210\227\345\217\267", nullptr)); - lineEdit_14->setText(QString()); - label_16->setText(QCoreApplication::translate("Widget", "G\346\233\235\345\205\211\357\274\232", nullptr)); - lineEdit_10->setText(QString()); - pushButton_6->setText(QCoreApplication::translate("Widget", "SET", nullptr)); - label_5->setText(QCoreApplication::translate("Widget", "R\346\233\235\345\205\211\357\274\232", nullptr)); - lineEdit_5->setText(QCoreApplication::translate("Widget", "238", nullptr)); - label_24->setText(QCoreApplication::translate("Widget", "3", nullptr)); - lineEdit_26->setText(QString()); - lineEdit_23->setText(QString()); - lineEdit_21->setText(QString()); - label_29->setText(QCoreApplication::translate("Widget", "UV\346\255\243\351\235\242\346\233\235\345\205\211\357\274\232", nullptr)); - lineEdit_18->setText(QCoreApplication::translate("Widget", "238", nullptr)); - lineEdit_16->setText(QString()); - label_25->setText(QCoreApplication::translate("Widget", "6", nullptr)); - lineEdit_12->setText(QString()); - pushButton_18->setText(QCoreApplication::translate("Widget", "\345\207\217", nullptr)); - lineEdit_39->setText(QString()); - lineEdit_17->setText(QString()); - label_31->setText(QCoreApplication::translate("Widget", "\345\233\272\344\273\266\347\211\210\346\234\254\345\217\267\357\274\232", nullptr)); - label_34->setText(QCoreApplication::translate("Widget", "PID", nullptr)); - label_21->setText(QCoreApplication::translate("Widget", "5", nullptr)); - pushButton_9->setText(QCoreApplication::translate("Widget", "GET", nullptr)); - label_15->setText(QCoreApplication::translate("Widget", "B\346\233\235\345\205\211\357\274\232", nullptr)); - lineEdit_3->setText(QCoreApplication::translate("Widget", "238", nullptr)); - label_26->setText(QCoreApplication::translate("Widget", "\345\272\217\345\210\227\345\217\267\357\274\232", nullptr)); - pushButton_4->setText(QCoreApplication::translate("Widget", "SET", nullptr)); - lineEdit_20->setText(QCoreApplication::translate("Widget", "238", nullptr)); - lineEdit_4->setText(QCoreApplication::translate("Widget", "238", nullptr)); - label_30->setText(QCoreApplication::translate("Widget", "UV\350\203\214\351\235\242\346\233\235\345\205\211\357\274\232", nullptr)); - label_3->setText(QCoreApplication::translate("Widget", "B\346\233\235\345\205\211\357\274\232", nullptr)); - pushButton->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226\345\272\217\345\210\227\345\217\267", nullptr)); - pushButton_5->setText(QCoreApplication::translate("Widget", "GET", nullptr)); - label_4->setText(QCoreApplication::translate("Widget", "G\346\233\235\345\205\211\357\274\232", nullptr)); - label->setText(QCoreApplication::translate("Widget", "\346\240\241\345\207\206\346\250\241\345\274\217\357\274\232", nullptr)); - comboBox->setItemText(0, QCoreApplication::translate("Widget", "\345\275\251\350\211\262\346\240\241\346\255\243\346\250\241\345\274\217", nullptr)); - comboBox->setItemText(1, QCoreApplication::translate("Widget", "\345\275\251\350\211\262", nullptr)); - comboBox->setItemText(2, QCoreApplication::translate("Widget", "\347\201\260\345\272\246\346\240\241\346\255\243\346\250\241\345\274\217", nullptr)); - comboBox->setItemText(3, QCoreApplication::translate("Widget", "\347\201\260\345\272\246", nullptr)); - - label_11->setText(QCoreApplication::translate("Widget", "4", nullptr)); - label_27->setText(QCoreApplication::translate("Widget", "\346\250\252\345\220\221\357\274\232", nullptr)); - pushButton_11->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226VID/PID", nullptr)); - pushButton_17->setText(QCoreApplication::translate("Widget", "\345\212\240", nullptr)); - label_10->setText(QCoreApplication::translate("Widget", "3", nullptr)); - lineEdit_11->setText(QString()); - label_18->setText(QCoreApplication::translate("Widget", "\345\201\217\347\247\273\357\274\232", nullptr)); - lineEdit_27->setText(QString()); - lineEdit_8->setText(QString()); - label_17->setText(QCoreApplication::translate("Widget", "R\346\233\235\345\205\211\357\274\232", nullptr)); - label_8->setText(QCoreApplication::translate("Widget", "1", nullptr)); - label_9->setText(QCoreApplication::translate("Widget", "2", nullptr)); - pushButton_7->setText(QCoreApplication::translate("Widget", "GET", nullptr)); - label_20->setText(QCoreApplication::translate("Widget", "4", nullptr)); - lineEdit_13->setText(QString()); - label_7->setText(QCoreApplication::translate("Widget", "\345\201\217\347\247\273\357\274\232", nullptr)); - label_14->setText(QCoreApplication::translate("Widget", "\350\203\214\351\235\242\357\274\232", nullptr)); - label_2->setText(QCoreApplication::translate("Widget", "\346\255\243\351\235\242\357\274\232", nullptr)); - lineEdit_24->setText(QString()); - pushButton_13->setText(QCoreApplication::translate("Widget", "\351\207\215\345\220\257\346\211\253\346\217\217\344\273\252", nullptr)); - checkBox_4->setText(QCoreApplication::translate("Widget", "200DPI_G", nullptr)); - checkBox_5->setText(QCoreApplication::translate("Widget", "200DPI_C", nullptr)); - checkBox_6->setText(QCoreApplication::translate("Widget", "300DPI_G", nullptr)); - checkBox_7->setText(QCoreApplication::translate("Widget", "300DPI_C", nullptr)); - label_43->setText(QCoreApplication::translate("Widget", "\347\201\260\346\233\235\345\205\211\357\274\232", nullptr)); - lineEdit_40->setText(QCoreApplication::translate("Widget", "238", nullptr)); - tabWidget->setTabText(tabWidget->indexOf(tabWidgetPage1), QCoreApplication::translate("Widget", "\345\217\202\346\225\260\350\256\276\347\275\256", nullptr)); - pushButton_38->setText(QCoreApplication::translate("Widget", "\344\270\212\344\270\200\351\241\265", nullptr)); - pushButton_37->setText(QCoreApplication::translate("Widget", "\344\270\213\344\270\200\351\241\265", nullptr)); - label_39->setText(QCoreApplication::translate("Widget", "\346\255\243\345\217\215\351\235\242\345\233\276\345\203\217", nullptr)); - label_41->setText(QCoreApplication::translate("Widget", "\351\200\211\346\213\251\345\255\230\345\233\276\350\267\257\345\276\204\357\274\232", nullptr)); - toolButton_2->setText(QCoreApplication::translate("Widget", "...", nullptr)); - pushButton_33->setText(QCoreApplication::translate("Widget", "\357\274\237", nullptr)); - label_42->setText(QCoreApplication::translate("Widget", "\345\233\276\347\211\207\346\240\274\345\274\217\351\200\211\346\213\251\357\274\232", nullptr)); - comboBox_6->setItemText(0, QCoreApplication::translate("Widget", "bmp", nullptr)); - comboBox_6->setItemText(1, QCoreApplication::translate("Widget", "jpg", nullptr)); - - comboBox_6->setCurrentText(QCoreApplication::translate("Widget", "bmp", nullptr)); - tabWidget->setTabText(tabWidget->indexOf(tabWidgetPage2), QCoreApplication::translate("Widget", "\346\230\276\347\244\272\345\233\276\345\203\217", nullptr)); - label_61->setText(QCoreApplication::translate("Widget", "SP\350\256\276\347\275\256", nullptr)); - label_62->setText(QCoreApplication::translate("Widget", "\345\275\251\350\211\262SP(Dec)", nullptr)); - label_63->setText(QCoreApplication::translate("Widget", "\347\201\260\345\272\246SP(Dec)", nullptr)); - label_64->setText(QCoreApplication::translate("Widget", "UVSP(Dec)", nullptr)); - pushButton_39->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226SP", nullptr)); - pushButton_40->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226SP", nullptr)); - pushButton_41->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226SP", nullptr)); - pushButton_42->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256SP", nullptr)); - pushButton_43->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256SP", nullptr)); - pushButton_44->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256SP", nullptr)); - label_65->setText(QCoreApplication::translate("Widget", "\344\274\221\347\234\240\350\256\276\347\275\256", nullptr)); - label_66->setText(QCoreApplication::translate("Widget", "\350\277\233\345\205\245\344\274\221\347\234\240\346\227\266\351\227\264\357\274\210s\357\274\211", nullptr)); - pushButton_70->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226\350\277\233\345\205\245\344\274\221\347\234\240\346\227\266\351\227\264", nullptr)); - pushButton_71->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256\350\277\233\345\205\245\344\274\221\347\234\240\346\227\266\351\227\264", nullptr)); - label_106->setText(QCoreApplication::translate("Widget", "\351\200\237\347\216\207\350\216\267\345\217\226\345\222\214\350\256\276\347\275\256", nullptr)); - pushButton_72->setText(QCoreApplication::translate("Widget", "\350\216\267\345\217\226\351\200\237\345\272\246\346\250\241\345\274\217", nullptr)); - pushButton_73->setText(QCoreApplication::translate("Widget", "\350\256\276\347\275\256\351\200\237\345\272\246\346\250\241\345\274\217", nullptr)); - tabWidget->setTabText(tabWidget->indexOf(tabWidgetPage3), QCoreApplication::translate("Widget", "CIS\350\256\276\347\275\256", nullptr)); - groupBox_2->setTitle(QCoreApplication::translate("Widget", "\346\211\253\346\217\217", nullptr)); - label_36->setText(QCoreApplication::translate("Widget", "\345\210\206\350\276\250\347\216\207\357\274\232", nullptr)); - comboBox_4->setItemText(0, QCoreApplication::translate("Widget", "gray", nullptr)); - comboBox_4->setItemText(1, QCoreApplication::translate("Widget", "color", nullptr)); - - comboBox_4->setCurrentText(QCoreApplication::translate("Widget", "color", nullptr)); - label_38->setText(QCoreApplication::translate("Widget", "\350\256\241 \346\227\266\357\274\232", nullptr)); - checkBox->setText(QCoreApplication::translate("Widget", "UV\346\250\241\345\274\217", nullptr)); - label_37->setText(QCoreApplication::translate("Widget", "\351\242\234\350\211\262\357\274\232", nullptr)); - comboBox_3->setItemText(0, QCoreApplication::translate("Widget", "150", nullptr)); - comboBox_3->setItemText(1, QCoreApplication::translate("Widget", "200", nullptr)); - comboBox_3->setItemText(2, QCoreApplication::translate("Widget", "300", nullptr)); - - comboBox_3->setCurrentText(QCoreApplication::translate("Widget", "150", nullptr)); - label_44->setText(QCoreApplication::translate("Widget", "\346\211\253\346\217\217\345\274\240\346\225\260\357\274\232", nullptr)); - checkBox_3->setText(QCoreApplication::translate("Widget", "\345\216\237\345\233\276", nullptr)); - pushButton_22->setText(QCoreApplication::translate("Widget", "\345\274\200\345\247\213\346\211\253\346\217\217", nullptr)); - pushButton_21->setText(QCoreApplication::translate("Widget", "\345\201\234\346\255\242\346\211\253\346\217\217", nullptr)); - groupBox_3->setTitle(QCoreApplication::translate("Widget", "\346\240\241\346\255\243", nullptr)); - pushButton_31->setText(QCoreApplication::translate("Widget", "\346\240\241\345\207\206\345\217\202\346\225\260\350\256\276\347\275\256", nullptr)); - pushButton_29->setText(QCoreApplication::translate("Widget", "\350\207\252\345\212\250\346\240\241\346\255\243", nullptr)); - pushButton_30->setText(QCoreApplication::translate("Widget", "\346\240\241\345\207\206\345\217\202\346\225\260\350\257\273\345\217\226", nullptr)); - groupBox->setTitle(QCoreApplication::translate("Widget", "\346\211\253\346\217\217\344\273\252\351\200\211\346\213\251", nullptr)); - label_33->setText(QCoreApplication::translate("Widget", "\345\236\213\345\217\267(VID/PID):", nullptr)); - comboBox_5->setItemText(0, QCoreApplication::translate("Widget", "G100", nullptr)); - comboBox_5->setItemText(1, QCoreApplication::translate("Widget", "G200", nullptr)); - comboBox_5->setItemText(2, QCoreApplication::translate("Widget", "G300", nullptr)); - comboBox_5->setItemText(3, QCoreApplication::translate("Widget", "G400", nullptr)); - - comboBox_5->setCurrentText(QCoreApplication::translate("Widget", "G100", nullptr)); - pushButton_14->setText(QCoreApplication::translate("Widget", "\351\207\215\346\226\260\346\211\253\346\217\217USB", nullptr)); - label_40->setText(QCoreApplication::translate("Widget", "\350\256\276\345\244\207\351\200\211\346\213\251:", nullptr)); - } // retranslateUi - -}; - -namespace Ui { - class Widget: public Ui_Widget {}; -} // namespace Ui - -QT_END_NAMESPACE - -#endif // UI_WIDGET_H diff --git a/qt-correction-tool/widget.cpp b/qt-correction-tool/widget.cpp deleted file mode 100644 index 55d5bb6..0000000 --- a/qt-correction-tool/widget.cpp +++ /dev/null @@ -1,1077 +0,0 @@ -#include "widget.h" -#include "ui_widget.h" - - -#pragma execution_character_set("utf-8") -Widget::Widget(QWidget* parent) - : QWidget(parent) - , ui(new Ui::Widget) - , m_iColorIndex(1), m_iDpiIndex(0) - , jsonparams{ 0 }, params{ 0 } - , m_run(true), m_auireable(false) -{ - ui->setupUi(this); - m_drv.reset(new GScn_Drv()); - OnInit(); - m_drv->Setformat(ui->comboBox_6->currentText()); - - -} - -Widget::~Widget() -{ - m_drv.reset(); - if (m_updateimgshow.joinable()) - { - m_auireable = false; - m_run = false; - m_updateimgshow.join(); - } - delete this->pTimer; - delete ui; -} - -void Widget::OnCbnSelchangeCmbUsbs() -{ - int vid_pid_type = ui->comboBox_2->currentIndex(); - int scannerType = ui->comboBox_5->currentIndex(); - if (m_drv->IsConnected()) - m_drv->close(); - - auto usbs = UsbScan_List::find_all_usb(); - if (usbs.size() > 0) - { - int j = 0; - for (auto i = usbs.begin(); i != usbs.end(); i++, j++) - { - if (j == vid_pid_type) - m_drv->open(i->vid, i->pid, vid_pid_type, scannerType); - } - } -} - - - -void Widget::OnBnClickedBtnstart() -{ - ui->lcdNumber->display("00:00:00"); - this->baseTime = this->baseTime.currentTime(); - auto ret = UsbScan_List::find_all_usb(); - if (!m_drv->IsConnected() || ret.size() <= 0) - { - QMessageBox::warning(nullptr, "error", "ɨδӣ"); - ui->comboBox_2->clear(); - return; - } - SetPic_format(); - m_drv->DevStateChange(); - m_drv->reset(); - Scan(); - SetEnableShow(true); - this->pTimer->start(1); -} - -void Widget::OnBnClickedBtnstop() -{ - this->pTimer->stop(); - m_drv->Stop_scan(); -} - -void Widget::OnCbnSelChangeColor() -{ - m_iColorIndex = ui->comboBox_4->currentIndex(); - m_drv->set_decompress_pix_type(0 == m_iColorIndex ? TWPT_GRAY : TWPT_RGB); -} - -void Widget::OnBnClickedBtnRefresh() -{ - RefreshUSBList(); -} - -void Widget::OnCbnSelChangeA4FlatModel() -{ - if (m_drv->IsConnected()) - { - auto correctdata = m_drv->GetFlatData(); - updateA4Config(correctdata); - } -} - -void Widget::OnBnClickedBtnaup() -{ - int a = 1; - UpdateGains(a, true); - UpdateToFace(); -} - -void Widget::OnBnClickedBtnadown() -{ - int a = 2; - UpdateGains(a, false); - UpdateToFace(); -} - -void Widget::OnBnClickedBtnbup() -{ - int a = 3; - UpdateGains(a, true); - UpdateToFace(); -} - -void Widget::OnBnClickedBtnbdown() -{ - int a = 4; - UpdateGains(a, false); - UpdateToFace(); -} - -void Widget::showEvent(QShowEvent* event) -{ - //emit timer->start(1); -} - -bool Widget::RefreshUSBList() -{ - ui->comboBox_2->clear(); - auto ret = UsbScan_List::find_all_usb(); - if (ret.size() <= 0) - { - QMessageBox::warning(nullptr, "error", "USBδ"); - return false; - } - else - { - auto info = ret.begin(); - int i = 0; - while (info != ret.end()) - { - QString strinfo; - strinfo.sprintf("0x%04x 0x%04x", info->vid, info->pid); - ui->comboBox_2->addItem(strinfo, i); - info++; - i++; - } - return true; - } -} - -void Widget::OnInit() -{ - setFixedSize(1200, 850);//ÿС - m_drv->set_decompress_pix_type(TWPT_RGB); //Ĭϲɫ - ui->pushButton_33->setToolTip("粻ѡ򱣴ڳĿ¼ScanPictureĿ¼"); - ui->lineEdit_48->setReadOnly(true); - ui->lineEdit_48->setAlignment(Qt::AlignHCenter); - ui->lcdNumber->display("00:00:00"); - this->pTimer = new QTimer; - connect(this->pTimer, SIGNAL(timeout()), this, SLOT(updateDisplay()));//󶨶ʱź - CreateScanFile(); - bool b_list = RefreshUSBList(); - calldevs.clear(); - if (b_list) - { - OnCbnSelchangeCmbUsbs(); - } - Exposures1 = { - ui->lineEdit_3, ui->lineEdit_4, - ui->lineEdit_5, ui->lineEdit_20, - ui->lineEdit_18,ui->lineEdit_19 }; - Gains1 = { - ui->lineEdit_6, ui->lineEdit_7, - ui->lineEdit_8, ui->lineEdit_9, - ui->lineEdit_11,ui->lineEdit_10, - ui->lineEdit_27,ui->lineEdit_22, - ui->lineEdit_31,ui->lineEdit_23, - ui->lineEdit_21,ui->lineEdit_25 }; - Offsets1 = { - ui->lineEdit_16,ui->lineEdit_13, - ui->lineEdit_17,ui->lineEdit_14, - ui->lineEdit_12,ui->lineEdit_15, - ui->lineEdit_30,ui->lineEdit_24, - ui->lineEdit_29,ui->lineEdit_32, - ui->lineEdit_28,ui->lineEdit_26 }; - - - auto callback = [this](bool stoped, int num) { - if (!stoped) - { - QString str; - str.sprintf("%d", num); - ui->lineEdit_48->setText(str); - } - }; - SetCallBack(callback); - auto callbackstopTime = [this]() //ɨֹͣʱֹͣʱ - { - this->pTimer->stop(); - }; - m_drv->stopTime(callbackstopTime); - - m_updateimgshow = std::thread(&Widget::showfun, this); - LoadCfg(); - auto callbackdevMessges = [this](const char *ptr) - { - calldevs = ptr; - retdevMessageout(ptr); - }; - m_drv->retdevMessges(callbackdevMessges); - connect(this, &Widget::retdevMessageout, this, &Widget::retDevStr); -} - -void Widget::Scan() -{ - HG_ScanConfiguration cfg = { 0 }; - cfg.params.dpi = 1; - cfg.params.pageSize = 0; - cfg.params.isColor = m_iColorIndex == 1 ? 1 : 0; - cfg.params.enableUV = ui->checkBox->isChecked(); - cfg.params.doubleFeeded = TRUE; - cfg.params.reversed1 = cfg.params.reversed2 = 0; - cfg.params.isCorrect = ui->checkBox_3->isChecked(); - - USBCB usbcb = { CONFIGURED_DATA , cfg.value,0 }; - m_drv->Config_Scanner(&usbcb); - this_thread::sleep_for(std::chrono::milliseconds(1000)); - - m_drv->Scanner_StartScan(-1); - m_drv->run(); - - -} - -void Widget::updateA4Config(CaptureParams& pValues) -{ - switch (ui->comboBox->currentIndex()) - { - case 0: - memcpy(params.Exposures, pValues.correctColorExposure, sizeof(pValues.correctColorExposure)); - memcpy(params.Gain, pValues.correctColorGain, sizeof(pValues.correctColorGain)); - memcpy(params.Offset, pValues.correctColorOffset, sizeof(pValues.correctColorOffset)); - break; - case 1: - memcpy(params.Exposures, pValues.colorExposure, sizeof(pValues.colorExposure)); - memcpy(params.Gain, pValues.colorGain, sizeof(pValues.colorGain)); - memcpy(params.Offset, pValues.colorOffset, sizeof(pValues.colorOffset)); - break; - case 2: - memcpy(params.Exposures, pValues.correctGrayExposure, sizeof(pValues.correctGrayExposure)); - memcpy(params.Gain, pValues.correctGrayGain, sizeof(pValues.correctGrayGain)); - memcpy(params.Offset, pValues.correctGrayOffset, sizeof(pValues.correctGrayOffset)); - break; - case 3: - memcpy(params.Exposures, pValues.grayExposure, sizeof(pValues.grayExposure)); - memcpy(params.Gain, pValues.grayGain, sizeof(pValues.grayGain)); - memcpy(params.Offset, pValues.grayOffset, sizeof(pValues.grayOffset)); - break; - - default: - break; - } -} - -void Widget::LoadCfg() -{ - jsonConfig.ReadParam(jsonparams); - memcpy(params.Exposures, jsonparams.correctColorExposure, sizeof(jsonparams.correctColorExposure)); - memcpy(params.Gain, jsonparams.correctColorGain, sizeof(jsonparams.correctColorGain)); - memcpy(params.Offset, jsonparams.correctColorOffset, sizeof(jsonparams.correctColorOffset)); - UpdateToFace(); -} - -void Widget::UpdateGains(int id, bool increase) -{ - if ((id == 1 || id == 3) && increase) - { - int startindex = id == 1 ? 0 : 6; - for (size_t i = startindex; i < (6 + startindex); i++) - { - params.Gain[i] = params.Gain[i]++; - } - } - else if ((id == 2 || id == 4) && !increase) - { - int startindex = id == 2 ? 0 : 6; - for (size_t i = startindex; i < (6 + startindex); i++) - { - params.Gain[i] = params.Gain[i]--; - } - } -} - -void Widget::updatefunc() -{ - std::ifstream updatefile; - updatefile.open(updateFilePath, std::ios_base::in | std::ios_base::binary); - if (!updatefile.is_open()) - { - QMessageBox::warning(nullptr, "", "ļʧ"); //ʾ - } - updatefile.seekg(0, std::ios::end); - size_t length = updatefile.tellg(); - ui->progressBar->setRange(0, length); - updatefile.seekg(0, std::ios::beg); - USBCB pre_update = { PRE_UPGRADE,0,length }; - m_drv->m_usb->write_bulk(&pre_update, sizeof(pre_update)); - size_t nreaded = 0; - size_t nleft = length; - int buffersize = 1024 * 1024; - if (length <= buffersize)//С1MB - { - char* uotstream = new char[length]; - USBCB update = { START_UPGRADE,0,(UINT32)length }; - m_drv->m_usb->write_bulk(&update, sizeof(update)); - updatefile.read(uotstream, length); - m_drv->m_usb->write_bulk(uotstream, length); - m_drv->m_usb->read_bulk(&update, sizeof(update)); - if (update.u32_Count != length) - QMessageBox::warning(nullptr, "", "ʧ"); //ʾ - delete[] uotstream; - } - else - { - while (true) - { - int ntotransfer; - if (nleft < buffersize) - ntotransfer = nleft; - else - ntotransfer = buffersize; - USBCB update = { START_UPGRADE,0,ntotransfer }; - m_drv->m_usb->write_bulk(&update, sizeof(update)); - std::vector data; - data.resize(ntotransfer); - updatefile.read(data.data(), ntotransfer); - m_drv->m_usb->write_bulk(data.data(), ntotransfer); - m_drv->m_usb->read_bulk(&update, sizeof(update)); - nreaded += ntotransfer; - nleft -= ntotransfer; - ui->progressBar->setValue(nreaded); - if (nreaded >= length) - break; - this_thread::sleep_for(std::chrono::milliseconds(10)); - } - } - - USBCB updatefinished = { UPDATE_FINISHED,0,0 }; - m_drv->m_usb->write_bulk(&updatefinished, sizeof(updatefinished)); - QMessageBox::warning(nullptr, "ʾ", ""); //ʾ - -} - -void Widget::UpdateToFace() -{ - if (!Exposures1.empty() && !Gains1.empty() && !Offsets1.empty()) - { - for (size_t i = 0; i < Exposures1.size(); i++) - { - Exposures1[i]->setText(QString::number(params.Exposures[i])); - } - for (size_t i = 0; i < Gains1.size(); i++) - { - Gains1[i]->setText(QString::number(params.Gain[i])); - } - for (size_t i = 0; i < Offsets1.size(); i++) - { - Offsets1[i]->setText(QString::number(params.Offset[i])); - } - } -} - -///flag = TURE type = 0 ȡɫ -///flag = FLASE type = 0 ûɫ -///flag = TURE type = 1 ȡɫ -///flag = flase type = 1 òɫ -///flag = TURE type = 2 ȡUVSP -///flag = flase type = 2 UVSP -void Widget::OnGetOrSetSp(bool flag, int type) -{ - UINT32 sp = 0; - QString str_sp = ""; - - if (flag) - { - m_drv->GetSptime(type, sp); - str_sp.sprintf("%d", sp); - switch (type) - { - case 0: - ui->lineEdit_67->setText(str_sp); - break; - case 1: - ui->lineEdit_66->setText(str_sp); - break; - case 2: - ui->lineEdit_68->setText(str_sp); - break; - } - } - else - { - switch (type) - { - case 0: - str_sp = ui->lineEdit_67->text(); - break; - case 1: - str_sp = ui->lineEdit_66->text(); - break; - case 2: - str_sp = ui->lineEdit_68->text(); - break; - - if (!str_sp.isEmpty()) - { - int value = str_sp.toInt(); - m_drv->SetSptime(type, value); - } - } - } -} - -void Widget::UpdateSleepTime(bool flag) -{ - UINT32 sp = 0; - QString str_sp; - if (flag) - { - m_drv->GetSleepTime(sp); - str_sp.sprintf("%d", sp); - if (str_sp.isEmpty()) - { - QMessageBox::warning(nullptr, "", "ȡSPʱʧ"); - return; - } - else - ui->lineEdit_69->setText(str_sp); - } - else - { - str_sp = ui->lineEdit_69->text(); - if (str_sp.isEmpty()) - { - QMessageBox::warning(nullptr, "", "SPʱ"); - return; - } - int val = str_sp.toInt(); - if (val <= 0) val = 60; - m_drv->SetSleepTime(val); - } -} - -void Widget::OnGetOrSetSpeedMode(bool flag) -{ - UINT32 sp = 0; - QString str_sp; - if (flag) - { - m_drv->GetSpeedMode(sp); - str_sp.sprintf("%d", sp); - if (str_sp.isEmpty()) - { - QMessageBox::warning(nullptr, "", "ȡSPʧ"); - return; - } - else - ui->lineEdit_111->setText(str_sp); - } - else - { - str_sp = ui->lineEdit_111->text(); - if (str_sp.isEmpty()) - { - QMessageBox::warning(nullptr, "", "SP"); - return; - } - int val = str_sp.toInt(); - if (val <= 0) val = 60; - m_drv->SetSpeedMode(val); - } -} - -void Widget::CreateScanFile() -{ - QString path = "/ScanPicture/"; - QDateTime current_date_time = QDateTime::currentDateTime(); - QString current_date = current_date_time.toString("yyyy.MM.dd"); - QDir dir; - path = QCoreApplication::applicationDirPath() + path; - if (!dir.exists(path)) - dir.mkpath(path); - - path += current_date; - - if (!dir.exists(path)) - dir.mkpath(path); - - m_drv->SetPath(path); -} - -void Widget::DrawPicture(QString path1) -{ - QImage img(path1); - QPixmap pixmap; - - if (!(img.load(path1))) //ͼ - { - QMessageBox::warning(nullptr, "", "ͼƬʧ"); - return; - } - pixmap.convertFromImage(img); - if (img.width() == 0 && img.height() == 0) - return; - - ui->label_39->setPixmap(pixmap.scaled( - ui->label_39->width() - 20, - ui->label_39->height(), - Qt::KeepAspectRatio, - Qt::SmoothTransformation));//Ӧ -} - - -void Widget::showfun() -{ - while (m_run) - { - if (m_auireable) - { - QString path1; - auto ret = m_drv->aquire_image(path1, 0); - if (ret != -1) - { - imageindex++; - aquiredimgindx++; - m_path.push_back(path1); - m_onStop(false, aquiredimgindx); - DrawPicture(path1); - } - else - { - m_auireable = false; - m_onStop(true, 0); - } - } - else - std::this_thread::sleep_for(std::chrono::milliseconds(100)); - } -} - -void Widget::SetEnableShow(bool show) -{ - m_auireable = show; - aquiredimgindx = 0; -} - -void Widget::SetCallBack(std::function onstop) -{ - m_onStop = onstop; -} - -void Widget::SetPic_format() -{ - m_drv->Setformat(ui->comboBox_6->currentText()); -} - -void Widget::SetG100G200CorrecParam() -{ - vectorCorrecParam; - if (!CorrecParam.empty()) - { - CorrecParam.clear(); - } - - - - if (ui->lineEdit_3->text().isEmpty() || ui->lineEdit_4->text().isEmpty() || ui->lineEdit_5->text().isEmpty() || ui->lineEdit_6->text().isEmpty() || ui->lineEdit_40->text().isEmpty() || ui->lineEdit_27->text().isEmpty() || ui->lineEdit_16->text().isEmpty() || ui->lineEdit_30->text().isEmpty() || ui->lineEdit_7->text().isEmpty() || ui->lineEdit_22->text().isEmpty() || ui->lineEdit_13->text().isEmpty() || ui->lineEdit_24->text().isEmpty()) - // if (redtime != 0 || greentime != 0 && bluetime != 0 && graytime != 0 && rgb_gain_f_value != 0 && rgb_gain_b_value != 0 && rgb_offset_f_value != 0 && rgb_offset_b_value != 0 && gray_gain_f_value != 0 && gray_gain_b_value != 0 && gray_offset_f_value != 0 && gray_offset_b_value != 0) - { - QMessageBox::warning(nullptr, "", "Уδȫд"); - return; - } - //std::vector - - UINT32 redtime = ui->lineEdit_3->text().toInt(); - UINT32 greentime = ui->lineEdit_4->text().toInt(); - UINT32 bluetime = ui->lineEdit_5->text().toInt(); - UINT32 graytime = ui->lineEdit_40->text().toInt(); - UINT32 rgb_gain_f_value = ui->lineEdit_6->text().toInt(); - UINT32 rgb_gain_b_value = ui->lineEdit_27->text().toInt(); - UINT32 rgb_offset_f_value = ui->lineEdit_16->text().toInt(); - UINT32 rgb_offset_b_value = ui->lineEdit_30->text().toInt(); - UINT32 gray_gain_f_value = ui->lineEdit_7->text().toInt(); - UINT32 gray_gain_b_value = ui->lineEdit_22->text().toInt(); - UINT32 gray_offset_f_value = ui->lineEdit_13->text().toInt(); - UINT32 gray_offset_b_value = ui->lineEdit_24->text().toInt(); - - - UINT32 GRtimepara = redtime << 16 | graytime; - CorrecParam.push_back(GRtimepara); - - UINT32 GBtimepara = bluetime << 16 | greentime; - CorrecParam.push_back(GBtimepara); - - - UINT32 Rgbadpara = rgb_gain_f_value; - Rgbadpara = (Rgbadpara | (rgb_gain_b_value << 8)); - Rgbadpara = (Rgbadpara | (rgb_offset_f_value << 16)); - Rgbadpara = (Rgbadpara | (rgb_offset_b_value << 24)); - CorrecParam.push_back(Rgbadpara); - - UINT32 adpara = gray_gain_f_value; - adpara = (adpara | (gray_gain_b_value << 8)); - adpara = (adpara | (gray_offset_f_value << 16)); - adpara = (adpara | (gray_offset_b_value << 24)); - CorrecParam.push_back(adpara); - - for (int i = 0; i < CorrecParam.size(); i++) - { - m_drv->SetG100G200CorrecPara(CorrecParam[i], i); - } -} - -void Widget::retDevStr() -{ - if (calldevs.empty()) - { - QMessageBox::information(this, "ȷ", "ϸ豸"); - return; - } - - QString s= QString::fromLocal8Bit(calldevs.data());//strתQString - QMessageBox::information(this, "ȷ", s); - calldevs.clear(); -} - -void Widget::OnBnClickedBtnPrepage() -{ - imageindex--; - if (imageindex < 0) - imageindex = 0; - - if (m_path.size() > 0) - { - DrawPicture(m_path[imageindex]); - } -} - -void Widget::OnBnClickedBtnNextpage() -{ - imageindex++; - if (imageindex >= m_path.size()) - imageindex = m_path.size() - 1; - if (m_path.size() > 0) - { - DrawPicture(m_path[imageindex]); - } -} - -void Widget::pushbut() -{ - -} - -void Widget::updateDisplay() -{ - QTime currTime = QTime::currentTime(); - int t = this->baseTime.msecsTo(currTime); - QTime showTime(0, 0, 0); - showTime = showTime.addMSecs(t); - this->timeStr = showTime.toString("hh:mm:ss"); - this->ui->lcdNumber->display(timeStr); -} - -void Widget::OnBnClickedBtnSetPicSavePath() -{ - //ѡļ - QString srcDirPath = QFileDialog::getExistingDirectory(this, "choose src Directory", "/"); - if (srcDirPath.isEmpty()) - { - return; - } - qDebug() << "srcDirPath=" << srcDirPath; - srcDirPath += "/"; - ui->lineEdit_70->setText(srcDirPath); - m_drv->SetPath(srcDirPath); -} - -void Widget::OnBnClickedBtnSelectfile() -{ - QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), NULL, tr("*.zip")); //ѡļ - if (!fileName.isEmpty()) - { - ui->lineEdit_65->setText(fileName); - updateFilePath = fileName.toStdString(); - } -} - -void Widget::OnBnClickedBtnUpdate() -{ - if (m_updateThread.joinable()) - { - m_updateThread.join(); - } - - QMessageBox messageBox(QMessageBox::NoIcon, "", "ȷʼ", QMessageBox::Yes | QMessageBox::No, NULL); - int result = messageBox.exec(); - switch (result) - { - case QMessageBox::Yes: - qDebug() << "Yes"; - m_updateThread = std::thread(&Widget::updatefunc, this); - break; - case QMessageBox::No: - qDebug() << "NO"; - break; - default: - break; - } -} - -void Widget::OnBnClickedCheckparamset() -{ - if (!m_drv->IsConnected()) - { - QMessageBox::warning(nullptr, "", "ɨδ"); - return; - } - int correcType = ui->comboBox->currentIndex(); - - QMessageBox messageBox(QMessageBox::NoIcon, "У׼", "ȷҪУ?", QMessageBox::Yes | QMessageBox::No, NULL); ; - int result = messageBox.exec(); - switch (result) - { - case QMessageBox::Yes: - qDebug() << "Yes"; - if ((ui->comboBox_5->currentIndex() == G100) || (ui->comboBox_5->currentIndex() == G200)) - { - - SetG100G200CorrecParam(); //G100/G200ò - - } - else - { - m_drv->SendFlatData(params, correcType); //G300/G400ò - } - - - break; - case QMessageBox::No: - qDebug() << "NO"; - break; - default: - break; - } -} - -void Widget::OnBnClickedCheckparamread() -{ - if (!m_drv->IsConnected()) - { - QMessageBox::warning(nullptr, "", "ɨδ"); - return; - } - - if ((ui->comboBox_5->currentIndex() == G100) || (ui->comboBox_5->currentIndex() == G200)) - { - unsigned char Para[16]="0"; int a = 0; - - m_drv->GetG100G200CorrecPara(Para,0); - Para[0]; - - QString QSdata; - - int data = 256 * Para[1] + Para[0]; - QSdata = QString::number(data);; - ui->lineEdit_40->setText(QSdata); - - data = 256 * Para[3] + Para[2]; - QSdata = QString::number(data);; - ui->lineEdit_3->setText(QSdata); - - data = 256 * Para[5] + Para[4]; - QSdata = QString::number(data);; - ui->lineEdit_4->setText(QSdata); - - data = 256 * Para[7] + Para[6]; - QSdata = QString::number(data);; - ui->lineEdit_5->setText(QSdata); - - data = Para[8]; - QSdata = QString::number(data);; - ui->lineEdit_6->setText(QSdata); - - - data = Para[9]; - QSdata = QString::number(data);; - ui->lineEdit_27->setText(QSdata); - - data = Para[10]; - QSdata = QString::number(data);; - ui->lineEdit_16->setText(QSdata); - - data = Para[11]; - QSdata = QString::number(data);; - ui->lineEdit_30->setText(QSdata); - - data = Para[12]; - QSdata = QString::number(data);; - ui->lineEdit_7->setText(QSdata); - - data = Para[13]; - QSdata = QString::number(data);; - ui->lineEdit_22->setText(QSdata); - - data = Para[14]; - QSdata = QString::number(data);; - ui->lineEdit_13->setText(QSdata); - - data = Para[15]; - QSdata = QString::number(data);; - ui->lineEdit_24->setText(QSdata); - - return; - } - - auto read = m_drv->GetFlatData(); - updateA4Config(read); - UpdateToFace(); -} - -void Widget::OnBnClickedBtnFlat() -{ - if (!m_drv->IsConnected()) - { - QMessageBox::warning(nullptr, "error", "ɨδ"); - return; - } - - QMessageBox messageBox(QMessageBox::NoIcon, "׼", "ȷʼԶУ׼?", QMessageBox::Yes | QMessageBox::No, NULL); - int result = messageBox.exec(); - switch (result) - { - case QMessageBox::Yes: - qDebug() << "Yes"; - - if (ui->comboBox_5->currentIndex() == G100 || ui->comboBox_5->currentIndex() == G200)// //G100/G200У - { - if (!dpi300GC_dpi200GC.empty()) { - dpi300GC_dpi200GC.clear(); - } - //200dpi gray - if (ui->checkBox_4->isChecked()) { - dpi300GC_dpi200GC.push_back(0x40); - } - //200dpi color - if (ui->checkBox_5->isChecked()) { - dpi300GC_dpi200GC.push_back(0x60); - } - //300dpi gray - if (ui->checkBox_6->isChecked()) { - dpi300GC_dpi200GC.push_back(0x00); - } - //300dpi color - if (ui->checkBox_7->isChecked()) { - dpi300GC_dpi200GC.push_back(0x20); - } - if (dpi300GC_dpi200GC.empty()) { - QMessageBox::warning(nullptr, "", "δѡУģʽ"); - return; - } - if (m_auireable) { - m_auireable = false; - } - m_drv->reset(); - SetEnableShow(true); - m_drv->DevStateChange(); - - int ret = m_drv->ModeSelection(dpi300GC_dpi200GC); - if (ret == -1) - { - return; - } - m_drv->run(); - } - else //G300/G400У - { - m_drv->StartFlat(); - } - break; - - case QMessageBox::No: - qDebug() << "NO"; - break; - default: - break; - } - -} - -void Widget::OnCbnSelChangeDpi() -{ - m_iDpiIndex = ui->comboBox_3->currentIndex(); -} - -void Widget::OnBnClickedBtngetSerial() -{ - auto serial = m_drv->GetSerialNum(); - ui->lineEdit_33->setText(serial.c_str()); -} - -void Widget::OnBnClickedBtnSetSerial() -{ - QString cserial = ui->lineEdit_33->text();; - if (!cserial.isEmpty()) - { - m_drv->SetSerialNum(cserial.toStdString()); - } - else - QMessageBox::warning(nullptr, "", "к"); -} - -void Widget::OnBnClickedBtnGethor() -{ - UINT32 ratio = 0; - m_drv->GetRatio(0, ratio); - float f_ratio = *(float*)∶ - QString str; - str.sprintf("%.4f", f_ratio); - ui->lineEdit_34->setText(str); -} - -void Widget::OnBnClickedBtnSethor() -{ - QString str = ui->lineEdit_34->text(); - if (!str.isEmpty()) - { - float f_value = str.toFloat(); - int value = *(int*)&f_value; - m_drv->SetRatio(0, value); - } - else - QMessageBox::warning(nullptr, "", ""); -} - -void Widget::OnBnClickedBtnGetver() -{ - UINT32 ratio = 0; - m_drv->GetRatio(1, ratio); - float f_ratio = *(float*)∶ - QString str; - str.sprintf("%.4f", f_ratio); - ui->lineEdit_35->setText(str); -} - -void Widget::OnBnClickedBtnSetver() -{ - QString str = ui->lineEdit_35->text(); - if (!str.isEmpty()) - { - float f_value = str.toFloat(); - int value = *(int*)&f_value; - m_drv->SetRatio(1, value); - } - else - QMessageBox::warning(nullptr, "", ""); -} - -void Widget::OnBnClickedBtnGetexpos() -{ - UINT32 esposeA, exposeB; - m_drv->GetExpose(esposeA, exposeB); - QString expA, expB; - expA.sprintf("%d", esposeA); - expB.sprintf("%d", exposeB); - ui->lineEdit_36->setText(expA); - ui->lineEdit_37->setText(expB); -} - -void Widget::OnBnClickedBtnSetexpos() -{ - QString expA = ui->lineEdit_36->text(); - QString expB = ui->lineEdit_37->text(); - UINT32 esposeA, exposeB; - if (!expA.isEmpty() && !expB.isEmpty()) - { - esposeA = expA.toInt(); - exposeB = expB.toInt(); - m_drv->SetExpose(esposeA, exposeB); - } - else - QMessageBox::warning(nullptr, "", "UV"); -} - -void Widget::OnBnClickedBtngetVersion() -{ - std::string ver = m_drv->GetFWVersion(); - if (!ver.empty()) - ui->lineEdit_38->setText(ver.c_str()); -} - -void Widget::OnBnClickedBtnReboot() -{ - QMessageBox messageBox(QMessageBox::NoIcon, "", "ȷҪɨ?", QMessageBox::Yes | QMessageBox::No, NULL); ; - int result = messageBox.exec(); - switch (result) - { - case QMessageBox::Yes: - qDebug() << "Yes"; - m_drv->Reboot(); - break; - case QMessageBox::No: - qDebug() << "NO"; - break; - default: - break; - } -} - -void Widget::OnBnClickedBtngetgraysp() -{ - OnGetOrSetSp(true, 0); -} - -void Widget::OnBnClickedBtnsetgraysp() -{ - OnGetOrSetSp(false, 0); -} - -void Widget::OnBnClickedBtngetcolorsp() -{ - OnGetOrSetSp(true, 1); -} - -void Widget::OnBnClickedBtnsetcolorsp() -{ - OnGetOrSetSp(false, 1); -} - -void Widget::OnBnClickedBtngetuvsp() -{ - OnGetOrSetSp(true, 2); -} - -void Widget::OnBnClickedBtnsetuvsp() -{ - OnGetOrSetSp(false, 2); -} - -void Widget::OnBnClickedBtngetsleeptime() -{ - UpdateSleepTime(true); -} - -void Widget::OnBnClickedBtnsetsleeptime() -{ - UpdateSleepTime(false); -} - -void Widget::OnBnClickedBtngetspeedmode() -{ - OnGetOrSetSpeedMode(true); -} - -void Widget::OnBnClickedBtnsetspeedmode() -{ - OnGetOrSetSpeedMode(false); -} - - diff --git a/qt-correction-tool/widget.h b/qt-correction-tool/widget.h deleted file mode 100644 index 6b601a5..0000000 --- a/qt-correction-tool/widget.h +++ /dev/null @@ -1,235 +0,0 @@ -#ifndef WIDGET_H -#define WIDGET_H - -#include -#include -#include ; -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -#include -#include "scn_usb.h" -#include "gscn_drv.h" -#include "JsonConfig.h" -#include "qfiledialog.h" -#include "twain.h" - - - - - -QT_BEGIN_NAMESPACE -namespace Ui { class Widget; } -QT_END_NAMESPACE - -#define COLOR "color" -#define GRAY "gray" - -union HG_ScanConfiguration -{ - struct - { - unsigned int pageSize : 5; - unsigned int isColor : 1; - unsigned int dpi : 2; - unsigned int doubleFeeded : 1; - unsigned int enableUV : 1; - unsigned int enableLed : 1; - unsigned int reversed1 : 6; - unsigned int isCorrect : 1; - unsigned int dstHeight : 8; - unsigned int reversed2 : 6; - } params; - unsigned int value; -}; - - - -class Widget : public QWidget -{ - Q_OBJECT - -public: - Widget(QWidget* parent = nullptr); - ~Widget(); - - -private: - Ui::Widget* ui; - - - -public slots: - - void pushbut(); - /// ѡUSB - void OnCbnSelchangeCmbUsbs(); - /// ʼɨ - void OnBnClickedBtnstart(); - ///ֹͣɨ - void OnBnClickedBtnstop(); - /// ɫ - void OnCbnSelChangeColor(); - /// ɨUSB - void OnBnClickedBtnRefresh(); - //У׼ģʽ - void OnCbnSelChangeA4FlatModel(); - /// 桪ƫ" + " - void OnBnClickedBtnaup(); - /// 桪ƫ" - " - void OnBnClickedBtnadown(); - /// 桪ƫ" + " - void OnBnClickedBtnbup(); - /// 桪ƫ" - " - void OnBnClickedBtnbdown(); - //ѡļ - void OnBnClickedBtnSelectfile(); - ///ʼ - void OnBnClickedBtnUpdate(); - ///У - void OnBnClickedCheckparamset(); - ///Уȡ - void OnBnClickedCheckparamread(); - ///ԶУ - void OnBnClickedBtnFlat(); - ///DPI - void OnCbnSelChangeDpi(); - /// ȡк - void OnBnClickedBtngetSerial(); - /// к - void OnBnClickedBtnSetSerial(); - ///ȡ - void OnBnClickedBtnGethor(); - ///ú - void OnBnClickedBtnSethor(); - ///ȡ - void OnBnClickedBtnGetver(); - /// - void OnBnClickedBtnSetver(); - ///UVȡع - void OnBnClickedBtnGetexpos(); - ///UVع - void OnBnClickedBtnSetexpos(); - ///ȡ̼Ű汾 - void OnBnClickedBtngetVersion(); - /// ɨ - void OnBnClickedBtnReboot(); - ///flag = TURE type = 0 ȡɫSP - void OnBnClickedBtngetgraysp(); - ///flag = FLASE type = 0 ûɫSP - void OnBnClickedBtnsetgraysp(); - ///flag = TURE type = 1 ȡɫSP - void OnBnClickedBtngetcolorsp(); - ///flag = flase type = 1 òɫSP - void OnBnClickedBtnsetcolorsp(); - ///flag = TURE type = 2 ȡUVSP - void OnBnClickedBtngetuvsp(); - ///flag = flase type = 2 UVSP - void OnBnClickedBtnsetuvsp(); - ///ȡSPʱ - void OnBnClickedBtngetsleeptime(); - ///SPʱ - void OnBnClickedBtnsetsleeptime(); - ///ȡSP - void OnBnClickedBtngetspeedmode(); - ///SP - void OnBnClickedBtnsetspeedmode(); - ///ʱ ʱ - void updateDisplay(); - //ͼ·ѡ - void OnBnClickedBtnSetPicSavePath(); - //һҳ - void OnBnClickedBtnPrepage(); - //һҳ - void OnBnClickedBtnNextpage(); - - ///豸״̬ - void retDevStr(); - -signals: - ///豸Ϣʾ - void retdevMessageout(const char* ptr); - -public: - std::vector Exposures1, Gains1, Offsets1; - std::list dpi300GC_dpi200GC; - int m_iColorIndex;//ɫѡ - int m_iDpiIndex;//DPIѡ - - QTime baseTime; - QTimer* pTimer; - QString timeStr;//ʾʱ - std::shared_ptr m_drv; - JsonConfig jsonConfig; - CorrectParam params; - CaptureParams jsonparams; - -public: - ///ʼ - void OnInit(); - ///ɨusb - bool RefreshUSBList(); - ///ɨ - void Scan(); - /// ļ - void updateA4Config(CaptureParams& pValue); - ///ʼʱȡļ - void LoadCfg(); - ///дļ + - - void UpdateGains(int id, bool increase); - ///ϵͳ - void updatefunc(); - ///豸ļ - void UpdateToFace(); - ///ȡSP - void OnGetOrSetSp(bool get, int type); - ///ȡʱ - void UpdateSleepTime(bool flag); - ///ȡSP - void OnGetOrSetSpeedMode(bool flag); - ///ļA - void CreateScanFile(); - //ͼʾڽ - void DrawPicture(QString path); - ///ͼ - void showfun(); - //ʼɨ迪ʼʱIJ - void SetEnableShow(bool show); - //ص - void SetCallBack(std::function onstop); - //ͼƬʽ - void SetPic_format(); - //G100 G200 У - void SetG100G200CorrecParam(); - - - char buff[128]; - string calldevs; - -private: - std::string updateFilePath; - std::thread m_updateThread; - std::thread m_updateimgshow; - - volatile bool m_run; - volatile bool m_auireable; - void* parent1; - volatile int imageindex = 0; - volatile int aquiredimgindx = 0; - std::vector m_path; - std::function m_onStop; - - -protected: - void showEvent(QShowEvent* event) override; //ʱûʹ2021 06 28 -}; -#endif // WIDGET_H diff --git a/qt-correction-tool/JsonConfig.cpp b/tool_ui/JsonConfig.cpp similarity index 98% rename from qt-correction-tool/JsonConfig.cpp rename to tool_ui/JsonConfig.cpp index 9f115fd..91fff5b 100644 --- a/qt-correction-tool/JsonConfig.cpp +++ b/tool_ui/JsonConfig.cpp @@ -1,4 +1,3 @@ -#include "stdafx.h" #include "JsonConfig.h" #include #include @@ -39,7 +38,11 @@ JsonConfig::~JsonConfig() bool JsonConfig::ReadParam(CaptureParams& param) { +#ifdef _WIN32 if(_access(JSON_FILE,0)!=0) +#else + if(access(JSON_FILE,0)!=0) +#endif { CaptureParams t_param = { 0 }; CreateDefault(t_param); @@ -104,4 +107,4 @@ void JsonConfig::CreateDefault(CaptureParams& param) param.correctColorOffset[i] = param.correctGrayOffset[i] = 119; param.colorOffset[i] = param.grayOffset[i] = 119; } -} \ No newline at end of file +} diff --git a/qt-correction-tool/JsonConfig.h b/tool_ui/JsonConfig.h similarity index 98% rename from qt-correction-tool/JsonConfig.h rename to tool_ui/JsonConfig.h index 077bdac..e78ca08 100644 --- a/qt-correction-tool/JsonConfig.h +++ b/tool_ui/JsonConfig.h @@ -1,8 +1,8 @@ #pragma once #include "json.hpp" +#include "predefine.h" #include #include -#include "PublicFunc.h" #define SCANNER_SCAN_INFO_PATH "/usr/local/huago/jsonconfig.json" using namespace std; diff --git a/tool_ui/correction_tool.cpp b/tool_ui/correction_tool.cpp new file mode 100644 index 0000000..c47a30d --- /dev/null +++ b/tool_ui/correction_tool.cpp @@ -0,0 +1,367 @@ +#include "correction_tool.h" + +Correction_Tool::Correction_Tool() +{ +#ifdef _WIN32 + m_scanmanager.reset(new IGScanManager()); +#else + m_scanmanager.reset(new IGScanManager()); + m_scanmanager->registehotplug(); +#endif +} + +void Correction_Tool::Stop_scan() +{ + if(!is_connect()) + return; + m_scanner->Stop_scan(); +} + +std::vector Correction_Tool::getonlinedevice() +{ + return m_scanmanager->getonlinedevices(); +} + +CaptureParams Correction_Tool::GetFlatData(){ + if(!is_connect()) + return {0}; + return m_scanner->GetFlatData(); +} + +void Correction_Tool::GetSptime(int type, int &time) +{ + if(is_connect()) + m_scanner->GetSptime(type,time); +} + +void Correction_Tool::GetSpeedMode(int &speedmode, bool getorset) +{ + if(is_connect()) + m_scanner->GetSpeedMode(speedmode,getorset); +} +void Correction_Tool::SetSptime(int type, int time) +{ + if(is_connect()) + m_scanner->SetSptime(type,time); +} + +void Correction_Tool::GetSleepTime(int &sleeptime) +{ + if(is_connect()) + m_scanner->GetSleepTime(sleeptime); +} +void Correction_Tool::SetSleepTime(int sleeptime) +{ + if(is_connect()) + m_scanner->SetSleepTime(sleeptime); +} +void Correction_Tool::Reboot() +{ + if(is_connect()) + m_scanner->Reboot(); +} + +void Correction_Tool::GetExpose(int &Aside, int &Bside) +{ + if(is_connect()) + m_scanner->GetExpose(Aside,Bside); +} + +void Correction_Tool::SetExpose(int aside, int bside) +{ + if(is_connect()) + m_scanner->SetExpose(aside,bside); +} +void Correction_Tool::GetRatio(int type, int &ratio) +{ + if(!is_connect()) + return; + m_scanner->GetRatio(type,ratio); +} + +void Correction_Tool::SetRatio(int tyepe, int ration) +{ + if(!is_connect()) + return ; + m_scanner->SetRatio(tyepe,ration); +} + +bool Correction_Tool::open(std::string scannername) +{ + auto tmpdevices= m_scanmanager->getonlinedevices(); + std::cout<setserial(ScannerSerial::G100Serial); + else if(tmpdevices[i].pid == 0x200) + m_scanner->setserial(ScannerSerial::G200Serial); + else if(tmpdevices[i].pid == 0x300) + m_scanner->setserial(ScannerSerial::G300Serial); + else if(tmpdevices[i].pid == 0x400) + m_scanner->setserial(ScannerSerial::G400Serial); + else if(tmpdevices[i].pid == 0x239) + m_scanner->setserial(ScannerSerial::G20039Serial); + else if(tmpdevices[i].pid == 0x139) + m_scanner->setserial(ScannerSerial::G10039Serial); + m_scanner->open(tmpdevices[i].vid,tmpdevices[i].pid); + } + break; + } + } + return m_scanner.get() && m_scanner->IsConnected(); +} + +void Correction_Tool::reset() +{ + if(is_connect()) + m_scanner->reset(); +} +void Correction_Tool::close() +{ + if(is_connect()) + m_scanner->close(); +} +bool Correction_Tool::open(int vid,int pid) +{ + auto tmpdevices= m_scanmanager->getonlinedevices(); + for(int i=0;iScanner_StartScan(count); +} + +bool Correction_Tool::is_connect() +{ + return m_scanner.get() && m_scanner->IsConnected(); +} + + +std::string Correction_Tool::GetFWVersion() +{ + if(!is_connect()) + return ""; + return m_scanner->GetFWVersion(); +} + +std::string Correction_Tool::GetSerialNum() +{ + if(!is_connect()) + return ""; + return m_scanner->GetSerialNum(); +} + +void Correction_Tool::SetFWVersion() +{ + return ; +} + +void Correction_Tool::SetSerialNum(std::string serial) +{ + if(!is_connect()) + return ; + m_scanner->SetSerialNum(serial); +} + +std::string Correction_Tool::GetMBVersion() +{ + if(!is_connect()) + return ""; + return m_scanner->GetMbVersion(); +} + +void Correction_Tool::config_params(GScanCap ¶ms) +{ + m_cap = params; + if(is_connect()) + { + IGScan * ptr=m_scanner.get(); + if(typeid (*ptr)==typeid(GScanO1003399)) + { + params.imageProcess.brightness=params.imageProcess.contrast=0; + } + m_scanner->config_params(params); + } +} + +bool Correction_Tool::Updata(std::string filename, std::function func) +{ + + if(is_connect()) + return m_scanner->Updata(filename,func); + return false; +} + +void Correction_Tool::StartFlat(bool iscolor) +{ + if(is_connect()) + m_scanner->StartFlat(iscolor); +} + +std::string Correction_Tool::GetOrSetbright(bool is_get, bool is_color, uint value) +{ + if(!is_connect()) + return ""; + if(is_get) + m_scanner->GetFlatMaxBright(is_color,value); + else + m_scanner->SetFlatMaxBright(is_color,value); + return std::to_string(value); +} + +std::string Correction_Tool::GetSysInfo() +{ + return m_scanner->GetSysInfo(); +} +void Correction_Tool::SetPath(std::string path) +{ + imgpath = path; +} +void Correction_Tool::Setformat(std::string format) +{ + imgformat =format; +} +void Correction_Tool::SendFlatData(CorrectParam param, int type) +{ + if(is_connect()) + m_scanner->SendFlatData(param,type); +} + +int Correction_Tool::GetImg(std::string & path, int index) +{ + if(is_connect()) + { + std::vector data; + int bbp; + int width; + int height; + int ret=m_scanner->aquire_image(data,bbp,width,height); + if(data.empty()) + return -1; + auto img = creatqimage(data,width,height,bbp); + path = imgpath+std::string(QDateTime::currentDateTime().toString("hhmmsszzz").toLocal8Bit()) +"."+imgformat; + //cv::imwrite(path,tmp); + img.save(path.c_str()); + return 0; + } + return -1; +} + +QImage Correction_Tool::creatqimage(std::vector &data, int width, int height, int bpp) +{ + QImage::Format format; + if (bpp == 1) + format = QImage::Format_Mono; + else if (bpp == 8) + format = QImage::Format_Grayscale8; + else + format = QImage::Format_RGB888; + + QImage image(width, height, format); + if (format == QImage::Format_Mono) + image.setColorTable(QVector() << qRgb(255, 255, 255) << qRgb(0, 0, 0)); + int step= (int)((width* bpp/8 + 3) / 4) * 4; + int src_step = width*(bpp==24?3:1); + int dst_step = width*(bpp==24?3:1); + int m_height = height; + int m_width = width; + uchar* pdata=image.bits(); + if (bpp == 1)/*要转位深*/ + { + int n_lineByte = (m_width + 7) >> 3;/*确保每行能够整除*/ + n_lineByte = (n_lineByte + 3) / 4 * 4; + //int m_lineByte = ((n_lineByte * 8 + 31) >> 5) << 2;/**/ + unsigned char temp; + for (int row = 0; row < m_height; row++) + { + for (int col = 0; col < m_width; col++) + { + int pos = col % 8; + int pix = *(data.data() + row * (bpp==24?3:1) + col); + temp = 1 << (7 - pos); + if (pix == 255) + { + *(pdata + row * n_lineByte + col / 8) &= (~temp); + } + else + { + + *(pdata + row * n_lineByte + col / 8) |= temp; + } + } + } + } + else + { +// if(bbp==24) +// cv::cvtColor(src,src,cv::COLOR_BGR2RGB); + + int bytesPerLine_dst = image.bytesPerLine(); + int bytesPerLine_src = m_width*(bpp==24?3:1); + uchar* image_ptr = image.bits(); + uchar* buffer_ptr = data.data(); + for (int i = 0; i < m_height; i++) + { + memcpy(image_ptr, buffer_ptr, bytesPerLine_src); + image_ptr += bytesPerLine_dst; + buffer_ptr += bytesPerLine_src; + } + } + image.setDotsPerMeterX(m_cap.resolution/0.0254); + image.setDotsPerMeterY(m_cap.resolution/0.0254); + return image; +} + +void Correction_Tool::usbvidpid(int &value, bool is_get) +{ + if(is_connect()) + { + m_scanner->GetOrSetVIDPID(value,is_get); + } +} +std::string Correction_Tool::getip() +{ + if(is_connect()) + return m_scanner->GetIpAddr(); + return "δ֪"; +} + +std::string Correction_Tool::getkernelversion() +{ + if(is_connect()) + return m_scanner->GetKernelVersion(); + return "δ֪"; +} + +void Correction_Tool::GetOrSetRoller(int &value, int type) +{ + if(!is_connect()) + { + value=-1; + return; + } + if(type) + m_scanner->clr_roller_num(); + this_thread::sleep_for(chrono::milliseconds(1000)); + value = m_scanner->get_roller_num(); +} diff --git a/tool_ui/correction_tool.h b/tool_ui/correction_tool.h new file mode 100644 index 0000000..f6b72b1 --- /dev/null +++ b/tool_ui/correction_tool.h @@ -0,0 +1,121 @@ +#ifndef CORRECTION_TOOL_H +#define CORRECTION_TOOL_H +#include +#include +#include "qfiledialog.h" +#include "GScan.h" +#include "GScanO1003399.h" +#include "GScanO200.h" +#include "GScanO400.h" +#include "IGScanManager.h" +#include "JsonConfig.h" + +struct SpeedModeinfo +{ + std::string modename; + int speedmode; + int comboxindex; + ScannerSerial m_mode; +}; +struct SP_TYPE{ + std::string name; + int colorsp; + int graysp; +}; + +static std::vector SP_139{ + {"G139_70ppm",0x42d,0xc88}, + {"G139_80ppm",0x37f,0xa7f}, + {"G139_90ppm",0x2b6,0x822}, + {"G139_110ppm",0x24e,0x706}, +}; + +static std::vector SpeedModeMap{ + {"G139_70ppm",70,0,G10039Serial}, + {"G139_80ppm",80,1,G10039Serial}, + {"G139_90ppm",90,2,G10039Serial}, + {"G139_110ppm",110,3,G10039Serial}, + {"G239_100ppm",100,0,G20039Serial}, + {"G239_110ppm",110,1,G20039Serial}, + {"G239_120ppm",120,2,G20039Serial}, + {"G239_130ppm",130,3,G20039Serial}, + {"G300_40ppm",1,0,G300Serial}, + {"G300_50ppm",2,1,G300Serial}, + {"G300_60ppm",3,2,G300Serial}, + {"G300_70ppm",4,3,G300Serial}, + {"G400_40ppm",1,0,G400Serial}, + {"G400_50ppm",2,1,G400Serial}, + {"G400_60ppm",3,2,G400Serial}, + {"G400_70ppm",4,3,G400Serial}, + {"G400_80ppm",5,4,G400Serial}, + {"G100_70ppm",0,0,G100Serial}, + {"G100_80ppm",1,1,G100Serial}, + {"G100_90ppm",2,2,G100Serial}, + {"G200_100ppm",0,0,G200Serial}, + {"G200_120ppm",1,1,G200Serial}, + {"G200_130ppm",2,2,G200Serial}, +}; + +class Correction_Tool +{ +public: + Correction_Tool(); + std::vector getonlinedevice(); + bool open(std::string scannername); + bool open(int vid,int pid); + void close(); + bool is_connect(); + std::string GetFWVersion(); + void SetFWVersion(); + std::string GetSerialNum(); + void SetSerialNum(std::string serial); + std::string GetMBVersion(); + CaptureParams GetFlatData(); + void reset(); + void Stop_scan(); + void SetRatio(int tyepe, int ration); + void GetRatio(int type, int& ratio); + void GetOrSetRoller(int& value,int type); + void GetExpose(int& Aside, int& Bside); + void SetExpose(int aside, int bside); + void Reboot(); + void config_params(GScanCap& params); + void GetSptime(int type, int& time); + void SetSptime(int type, int time); + + void GetSleepTime(int& sleeptime); + void SetSleepTime(int sleeptime); + + void GetSpeedMode(int& speedmode,bool getorset=false); + void Scanner_StartScan(int count); + void SetPath(std::string path); + bool Updata(std::string filename, std::function func); + void SendFlatData(CorrectParam param,int type); + int GetImg(std::string & path,int index); + void Setformat(std::string format); + void StartFlat(bool iscolor); + std::string GetOrSetbright(bool is_get,bool is_color,uint value); + std::string GetSysInfo(); + std::string getip(); + std::string getkernelversion(); + QImage creatqimage(std::vector& data,int width,int height,int bpp); + void usbvidpid(int & value,bool is_get); + void setcap(GScanCap cap){m_cap =cap;} + void setflatcallback(std::function func){ + if(is_connect()) + m_scanner->SetFlatCallback(func); + } + ScannerSerial getscannerserial(){ + if(m_scanner.get()) + return m_scanner->getserial(); + return ScannerSerial::G100Serial; + } +private: + std::shared_ptr m_scanner; + std::shared_ptr m_scanmanager; + GScanCap m_cap; + std::string imgpath; + std::string imgformat; +}; + +#endif // CORRECTION_TOOL_H diff --git a/tool_ui/imageview.cpp b/tool_ui/imageview.cpp new file mode 100644 index 0000000..f99334e --- /dev/null +++ b/tool_ui/imageview.cpp @@ -0,0 +1,79 @@ +#include "imageview.h" +#include +#include +#include +#include +Imageview::Imageview(QWidget *parent) : QWidget(parent) +{ + +} + +void Imageview::setimg(QImage &img) +{ + if(img.isNull()) + return; + m_image = std::move(img); + this->update(); +} + +void Imageview::paintEvent(QPaintEvent *event) +{ + QPainter painter(this); + if(m_image.isNull()) + return QWidget::paintEvent(event); + int width = std::min(m_image.width(),this->width()); + int height = std::min(m_image.height(),this->height()); + + painter.translate(this->width()/2+m_XPtInterval,this->height()/2+m_YPtInterval); + + painter.scale(m_ZoomValue,m_ZoomValue); + + QRect picrect(-width/2,-height/2,width,height); + painter.drawImage(picrect,m_image); +} + +void Imageview::wheelEvent(QWheelEvent *event) +{ + qDebug()<pos(); + if(event->delta() > 0){ //Ŵ + m_ZoomValue +=0.3; + this->update(); + } + else { + m_ZoomValue -= 0.3; + if(m_ZoomValue <= 0) + { + m_ZoomValue += 0.3; + return; + } + this->update(); + } + +} + +void Imageview::mouseMoveEvent(QMouseEvent *event) +{ + if(!m_Pressed) + return QWidget::mouseMoveEvent(event); + this->setCursor(Qt::SizeAllCursor); + QPoint pos = event->pos(); + int x = pos.x() - m_OldPos.x(); + int y = pos.y() - m_OldPos.y(); + m_XPtInterval += x; + m_YPtInterval += y; + m_OldPos = pos; + this->update(); +} + +void Imageview::mousePressEvent(QMouseEvent *event) +{ + m_OldPos = event->pos(); + m_Pressed = true; +} + +void Imageview::mouseReleaseEvent(QMouseEvent *event) +{ + m_Pressed = false; + this->update(); +} + diff --git a/tool_ui/imageview.h b/tool_ui/imageview.h new file mode 100644 index 0000000..723a134 --- /dev/null +++ b/tool_ui/imageview.h @@ -0,0 +1,28 @@ +#ifndef IMAGEVIEW_H +#define IMAGEVIEW_H + +#include + +class Imageview : public QWidget +{ + Q_OBJECT +public: + explicit Imageview(QWidget *parent = nullptr); + void setimg(QImage& img); + +protected: + void paintEvent(QPaintEvent *event) override; + void wheelEvent(QWheelEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; +private: + QImage m_image; + qreal m_ZoomValue = 1.0; + int m_XPtInterval = 0; + int m_YPtInterval = 0; + QPoint m_OldPos; + bool m_Pressed = false; +}; + +#endif // IMAGEVIEW_H diff --git a/tool_ui/main.cpp b/tool_ui/main.cpp new file mode 100644 index 0000000..da71cad --- /dev/null +++ b/tool_ui/main.cpp @@ -0,0 +1,16 @@ +#include "widget.h" + +#include +#include +#include +#include +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + auto keys = QStyleFactory::keys(); + a.setStyle(QStyleFactory::create("Fusion")); + Widget w; + + w.show(); + return a.exec(); +} diff --git a/tool_ui/tool_ui.pro b/tool_ui/tool_ui.pro new file mode 100644 index 0000000..9321e1d --- /dev/null +++ b/tool_ui/tool_ui.pro @@ -0,0 +1,70 @@ +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +CONFIG += c++11 + +# The following define makes your compiler emit warnings if you use +# any Qt feature that has been marked deprecated (the exact warnings +# depend on your compiler). Please consult the documentation of the +# deprecated API in order to know how to port your code away from it. +DEFINES += QT_DEPRECATED_WARNINGS + +# You can also make your code fail to compile if it uses deprecated APIs. +# In order to do so, uncomment the following line. +# You can also select to disable deprecated APIs only up to a certain version of Qt. +#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 + +INCLUDEPATH += $$PWD/../imageprocess +INCLUDEPATH += $$PWD/../hgdev +INCLUDEPATH += $$PWD/../3rdparty/nick +INCLUDEPATH += $$PWD/../3rdparty/opencv/include +CONFIG(debug,debug|release){ +win32{ + QMAKE_CXXFLAGS_DEBUG += -MTd + QMAKE_CFLAGS_DEBUG += -MTd + QMAKE_CXXFLAGS += /MP6 + LIBS += -L$$PWD/../3rdparty/opencv/win/debug -lopencv_world3414d -lIlmImfd -littnotifyd -llibjasperd -llibjpeg-turbod -llibpngd -llibprotobufd \ + -llibtiffd -llibwebpd -lquircd -lzlibd +} + + DESTDIR += $$PWD/../bin/debug + LIBS += -L$$PWD/../bin/debug -lhgdev -lhgimgproc +} +CONFIG(release,debug|release){ +win32{ + QMAKE_CXXFLAGS_RELEASE += -MT + QMAKE_CFLAGS_RELEASE += -MT + LIBS += -L$$PWD/../3rdparty/opencv/win/release -lopencv_world3414 -lIlmImf -littnotify -llibjasper -llibjpeg-turbo -llibpng -llibprotobuf \ + -llibtiff -llibwebp -lquirc -lzlib +} + LIBS += -L$$PWD/../bin/release -lhgdev -lhgimgproc + DESTDIR += $$PWD/../bin/release +} + +win32{ + DEFINES += _WIN32 +} + +SOURCES += \ + JsonConfig.cpp \ + correction_tool.cpp \ + imageview.cpp \ + main.cpp \ + widget.cpp + +HEADERS += \ + JsonConfig.h \ + correction_tool.h \ + imageview.h \ + widget.h + +FORMS += \ + widget.ui + +# Default rules for deployment. +qnx: target.path = /tmp/$${TARGET}/bin +else: unix:!android: target.path = /opt/$${TARGET}/bin +!isEmpty(target.path): INSTALLS += target + + diff --git a/tool_ui/widget.cpp b/tool_ui/widget.cpp new file mode 100644 index 0000000..c29bd24 --- /dev/null +++ b/tool_ui/widget.cpp @@ -0,0 +1,982 @@ +#include "widget.h" +#include "ui_widget.h" + + +#pragma execution_character_set("utf-8") +Widget::Widget(QWidget* parent) + : QWidget(parent) + , ui(new Ui::Widget) + , m_iColorIndex(1), m_iDpiIndex(0) + , jsonparams{ 0 }, params{ 0 } + , m_run(true), m_auireable(false) +{ + ui->setupUi(this); + m_drv.reset(new Correction_Tool()); + OnInit(); + ui->le_ex_number->setValidator(new QIntValidator(1,100)); + +} + +Widget::~Widget() +{ + m_drv.reset(); + if (m_updateimgshow.joinable()) + { + m_auireable = false; + m_run = false; + m_updateimgshow.join(); + } + delete ui; +} + +void Widget::OnCbnSelchangeCmbUsbs() +{ + auto list =ui->comboBox_2->currentText().split(" "); + if(list.size()<2) + return; + int vid,pid; + vid = list[0].toInt(nullptr,16); + pid = list[1].toInt(nullptr,16); + m_drv->open(vid,pid); + emit usbchange(m_drv->getscannerserial()); +} + + + +void Widget::OnBnClickedBtnstart() +{ + if(!m_drv->is_connect()) + { + QMessageBox::warning(this,"","ɨδӣ"); + return ; + } + ui->tabWidget->setCurrentIndex(1); + SetPic_format(); + m_drv->reset(); + Scan(); + SetEnableShow(true); + +} + +void Widget::OnBnClickedBtnstop() +{ + m_drv->Stop_scan(); +} + +void Widget::OnCbnSelChangeColor() +{ + m_iColorIndex = ui->comboBox_4->currentIndex(); +} + +void Widget::OnBnClickedBtnRefresh() +{ + RefreshUSBList(); + OnCbnSelchangeCmbUsbs(); +} + +void Widget::OnCbnSelChangeA4FlatModel() +{ + //auto correctdata = m_drv->GetFlatData(); + updateA4Config(jsonparams); + UpdateToFace(); +} + +void Widget::OnBnClickedBtnaup() +{ + UpdateGains(1, true); + UpdateToFace(); +} + +void Widget::OnBnClickedBtnadown() +{ + UpdateGains(2, false); + UpdateToFace(); +} + +void Widget::OnBnClickedBtnbup() +{ + UpdateGains(3, true); + UpdateToFace(); +} + +void Widget::OnBnClickedBtnbdown() +{ + UpdateGains(4, false); + UpdateToFace(); +} + + +bool Widget::RefreshUSBList() +{ + ui->comboBox_2->clear(); + auto ret = m_drv->getonlinedevice(); + auto info = ret.begin(); + int i = 0; + while (info != ret.end()) + { + QString strinfo; + strinfo.sprintf("%04x %04x", info->vid, info->pid); + ui->comboBox_2->addItem(strinfo, i); + info++; + i++; + } + emit usbchange(m_drv->getscannerserial()); + return true; +} + +void Widget::OnInit() +{ + connect(this, &Widget::retdevMessageout, this, &Widget::retDevStr); + connect(this,&Widget::usbchange,this,&Widget::changespeedmode,Qt::UniqueConnection); + setFixedSize(1200, 850);//ÿС + ui->lineEdit_48->setReadOnly(true); + ui->lineEdit_48->setAlignment(Qt::AlignHCenter); + CreateScanFile(); + bool b_list = RefreshUSBList(); + calldevs.clear(); + if (b_list) + { + OnCbnSelchangeCmbUsbs(); + } + Exposures1 = { + ui->lineEdit_3, ui->lineEdit_4, + ui->lineEdit_5, ui->lineEdit_20, + ui->lineEdit_18,ui->lineEdit_19 }; + Gains1 = { + ui->lineEdit_6, ui->lineEdit_7, + ui->lineEdit_8, ui->lineEdit_9, + ui->lineEdit_11,ui->lineEdit_10, + ui->lineEdit_27,ui->lineEdit_22, + ui->lineEdit_31,ui->lineEdit_23, + ui->lineEdit_21,ui->lineEdit_25 }; + Offsets1 = { + ui->lineEdit_16,ui->lineEdit_13, + ui->lineEdit_17,ui->lineEdit_14, + ui->lineEdit_12,ui->lineEdit_15, + ui->lineEdit_30,ui->lineEdit_24, + ui->lineEdit_29,ui->lineEdit_32, + ui->lineEdit_28,ui->lineEdit_26 }; + + + auto callback = [this](bool stoped, int num) { + if (!stoped) + { + QString str; + str.sprintf("%d", num); + ui->lineEdit_48->setText(str); + } + }; + SetCallBack(callback); + + m_updateimgshow = std::thread(&Widget::showfun, this); + LoadCfg(); + ui->tabWidget->setCurrentIndex(0); + auto callbackdevMessges = [this](const char *ptr) + { + calldevs = ptr; + retdevMessageout(ptr); + }; +} + +void Widget::Scan() +{ + GScanCap cap; + memset(&cap,0,sizeof(GScanCap)); + if(ui->checkBox_3->isChecked()) + cap.is_correct =true; + else + cap.is_correct =false; +// if(m_drv->getscannerserial()==ScannerSerial::G300Serial) +// cap.paperSize =TwSS::A4; +// else +// cap.paperSize=TwSS::A3; + cap.paperSize = TwSS::None; + cap.imageProcess.autoCrop=false; + cap.imageProcess.autoDescrew=false; + cap.imageProcess.fillBlackRect=false; + cap.pixelType=ui->comboBox_4->currentIndex()?ColorMode::RGB:ColorMode::Gray; + cap.scanCount=65535; + cap.imageProcess.gamma=1.0; + cap.scanSide.duplex=1; + cap.imageProcess.contrast=0; + cap.imageProcess.brightness=0; + cap.imageProcess.AutoCrop_threshold=40; + cap.imageProcess.noise=8; + cap.imageProcess.indent=5; + cap.imageProcess.is_convex=true; + cap.imageProcess.filter=FILTER_NONE; + cap.resolution=ui->comboBox_3->currentText().toInt(); + cap.resolution_native=200; + cap.hardwareParam.doubleFeedDetection=true; + cap.multiOutput=MultiOutput::Unused; + cap.hardwareParam.bindingDetection = false; + cap.hardwareParam.skewDetection.enable = false; + m_drv->config_params(cap); + this_thread::sleep_for(std::chrono::milliseconds(1000)); + m_drv->Scanner_StartScan(-1); +} + +void Widget::updateA4Config(CaptureParams& pValues) +{ + switch (ui->comboBox->currentIndex()) + { + case 0: + memcpy(params.Exposures, pValues.correctColorExposure, sizeof(pValues.correctColorExposure)); + memcpy(params.Gain, pValues.correctColorGain, sizeof(pValues.correctColorGain)); + memcpy(params.Offset, pValues.correctColorOffset, sizeof(pValues.correctColorOffset)); + break; + case 1: + memcpy(params.Exposures, pValues.colorExposure, sizeof(pValues.colorExposure)); + memcpy(params.Gain, pValues.colorGain, sizeof(pValues.colorGain)); + memcpy(params.Offset, pValues.colorOffset, sizeof(pValues.colorOffset)); + break; + case 2: + memcpy(params.Exposures, pValues.correctGrayExposure, sizeof(pValues.correctGrayExposure)); + memcpy(params.Gain, pValues.correctGrayGain, sizeof(pValues.correctGrayGain)); + memcpy(params.Offset, pValues.correctGrayOffset, sizeof(pValues.correctGrayOffset)); + break; + case 3: + memcpy(params.Exposures, pValues.grayExposure, sizeof(pValues.grayExposure)); + memcpy(params.Gain, pValues.grayGain, sizeof(pValues.grayGain)); + memcpy(params.Offset, pValues.grayOffset, sizeof(pValues.grayOffset)); + break; + + default: + break; + } +} + +void Widget::LoadCfg() +{ + jsonConfig.ReadParam(jsonparams); + memcpy(params.Exposures, jsonparams.correctColorExposure, sizeof(jsonparams.correctColorExposure)); + memcpy(params.Gain, jsonparams.correctColorGain, sizeof(jsonparams.correctColorGain)); + memcpy(params.Offset, jsonparams.correctColorOffset, sizeof(jsonparams.correctColorOffset)); + UpdateToFace(); +} + +void Widget::UpdateGains(int id, bool increase) +{ + int number = 1; + if(ui->le_ex_number->text().toInt()>0) + number = ui->le_ex_number->text().toInt(); + if ((id == 1 || id == 3) && increase) + { + int startindex = id == 1 ? 0 : 6; + for (size_t i = startindex; i < (6 + startindex); i++) + { + params.Gain[i] = params.Gain[i]+number; + } + } + else if ((id == 2 || id == 4) && !increase) + { + int startindex = id == 2 ? 0 : 6; + for (size_t i = startindex; i < (6 + startindex); i++) + { + params.Gain[i] = params.Gain[i]-number; + } + } +} + +void Widget::updatefunc() +{ + + if(m_drv->Updata(updateFilePath,[&](long downloadsize,long filesize)->void{ + ui->progressBar->setRange(0, filesize); + ui->progressBar->setValue(downloadsize); + })) + QMessageBox::warning(this, "ʾ", ""); //ʾ + else + QMessageBox::warning(this,"ʾ","ʧ"); +} + +void Widget::UpdateToFace() +{ + if (!Exposures1.empty() && !Gains1.empty() && !Offsets1.empty()) + { + for (size_t i = 0; i < Exposures1.size(); i++) + { + Exposures1[i]->setText(QString::number(params.Exposures[i])); + } + for (size_t i = 0; i < Gains1.size(); i++) + { + Gains1[i]->setText(QString::number(params.Gain[i])); + } + for (size_t i = 0; i < Offsets1.size(); i++) + { + Offsets1[i]->setText(QString::number(params.Offset[i])); + } + } +} + +void Widget::UItoParam(int type) +{ + for (size_t i = 0; i < Exposures1.size(); i++) + { + params.Exposures[i]=Exposures1[i]->text().toInt(); + } + for (size_t i = 0; i < Gains1.size(); i++) + { + params.Gain[i]=Gains1[i]->text().toInt(); + } + for (size_t i = 0; i < Offsets1.size(); i++) + { + params.Offset[i]=Offsets1[i]->text().toInt(); + } + switch (type) { + case 0: + memcpy(jsonparams.correctColorGain,params.Gain,sizeof(params.Gain)); + memcpy(jsonparams.correctColorOffset,params.Offset,sizeof(params.Offset)); + memcpy(jsonparams.correctColorExposure,params.Exposures,sizeof(params.Exposures)); + break; + case 1: + memcpy(jsonparams.colorGain,params.Gain,sizeof(params.Gain)); + memcpy(jsonparams.colorOffset,params.Offset,sizeof(params.Offset)); + memcpy(jsonparams.colorExposure,params.Exposures,sizeof(params.Exposures)); + break; + case 2: + memcpy(jsonparams.correctGrayGain,params.Gain,sizeof(params.Gain)); + memcpy(jsonparams.correctGrayOffset,params.Offset,sizeof(params.Offset)); + memcpy(jsonparams.correctGrayExposure,params.Exposures,sizeof(params.Exposures)); + break; + case 3: + memcpy(jsonparams.grayGain,params.Gain,sizeof(params.Gain)); + memcpy(jsonparams.grayOffset,params.Offset,sizeof(params.Offset)); + memcpy(jsonparams.grayExposure,params.Exposures,sizeof(params.Exposures)); + break; + } +} + +///flag = TURE type = 0 ȡɫ +///flag = FLASE type = 0 ûɫ +///flag = TURE type = 1 ȡɫ +///flag = flase type = 1 òɫ +///flag = TURE type = 2 ȡUVSP +///flag = flase type = 2 UVSP +void Widget::OnGetOrSetSp(bool flag, int type) +{ + int sp = 0; + QString str_sp = ""; + + if (flag) + { + m_drv->GetSptime(type, sp); + str_sp.sprintf("%d", sp); + switch (type) + { + case 0: + ui->lineEdit_67->setText(str_sp); + break; + case 1: + ui->lineEdit_66->setText(str_sp); + break; + case 2: + ui->lineEdit_68->setText(str_sp); + break; + } + } + else + { + switch (type) + { + case 0: + str_sp = ui->lineEdit_67->text(); + break; + case 1: + str_sp = ui->lineEdit_66->text(); + break; + case 2: + str_sp = ui->lineEdit_68->text(); + break; + } + if (!str_sp.isEmpty()) + { + int value = str_sp.toInt(); + m_drv->SetSptime(type, value); + } + } +} + +void Widget::UpdateSleepTime(bool flag) +{ + int sp = 0; + QString str_sp; + if (flag) + { + m_drv->GetSleepTime(sp); + str_sp.sprintf("%d", sp); + if (str_sp.isEmpty()) + { + QMessageBox::warning(nullptr, "", "ȡSPʱʧ"); + return; + } + else + ui->lineEdit_69->setText(str_sp); + } + else + { + str_sp = ui->lineEdit_69->text(); + if (str_sp.isEmpty()) + { + QMessageBox::warning(nullptr, "", "SPʱ"); + return; + } + int val = str_sp.toInt(); + m_drv->SetSleepTime(val); + } +} + +void Widget::OnGetOrSetSpeedMode(bool flag) +{ + int sp = -1; + int index = -1; + if (flag) + { + m_drv->GetSpeedMode(sp,flag); + for(int x=0;xgetscannerserial()) + { + index=SpeedModeMap[x].comboxindex; + break; + } + } + if (index == -1) + { + QMessageBox::warning(nullptr, "", "ȡSPʧ"); + return; + } + ui->cbx_speed_mode->setCurrentIndex(index); + } + else + { + for(int x=0;xcbx_speed_mode->currentText().toUtf8())) + { + sp=SpeedModeMap[x].speedmode; + break; + } + if (sp==-1) + { + QMessageBox::warning(nullptr, "", "SP"); + return; + } + if(m_drv->getscannerserial()== ScannerSerial::G10039Serial) + { + m_drv->SetSptime(1,SP_139[ui->cbx_speed_mode->currentIndex()].colorsp); + m_drv->SetSptime(0,SP_139[ui->cbx_speed_mode->currentIndex()].graysp); + } + if(m_drv->getscannerserial()== ScannerSerial::G20039Serial) + { + m_drv->SetSptime(1,0x27c); + m_drv->SetSptime(1,0x774); + } + m_drv->GetSpeedMode(sp,flag); + } +} + +void Widget::changespeedmode(int type) +{ + ui->cbx_speed_mode->clear(); + switch (type) { + case ScannerSerial::G100Serial: + ui->cbx_speed_mode->addItems({"G100_70ppm","G100_80ppm","G100_90ppm"}); + break; + case ScannerSerial::G200Serial: + ui->cbx_speed_mode->addItems({"G200_100ppm","G200_120ppm","G200_130ppm"}); + break; + case ScannerSerial::G300Serial: + ui->cbx_speed_mode->addItems({"G300_40ppm","G300_50ppm","G300_60ppm","G300_70ppm"}); + break; + case ScannerSerial::G400Serial: + ui->cbx_speed_mode->addItems({"G400_40ppm","G400_50ppm","G400_60ppm","G400_70ppm","G400_80ppm"}); + break; + case ScannerSerial::G10039Serial: + ui->cbx_speed_mode->addItems({"G139_70ppm","G139_80ppm","G139_90ppm","G139_110ppm"}); + break; + case ScannerSerial::G20039Serial: + ui->cbx_speed_mode->addItems({"G239_100ppm","G239_110ppm","G239_120ppm","G239_130ppm"}); + break; + } +} + +void Widget::CreateScanFile() +{ + QString path = "/ScanPicture/"; + QDir dir; + path = QCoreApplication::applicationDirPath() + path; + if (!dir.exists(path)) + dir.mkpath(path); + + m_drv->SetPath(std::string(path.toUtf8())); +} + +void Widget::DrawPicture(QString path1) +{ + QImage img(path1); + QPixmap pixmap; + + if (!(img.load(path1))) //ͼ + { + return; + } + ui->imageview->setimg(img); +} + + +void Widget::showfun() +{ + while (m_run) + { + if (m_auireable) + { + std::string imgtmppath; + auto ret = m_drv->GetImg(imgtmppath, 0); + if (ret != -1) + { + imageindex++; + aquiredimgindx++; + m_path.push_back(imgtmppath.c_str()); + m_onStop(false, aquiredimgindx); + DrawPicture(imgtmppath.c_str()); + } + else + { + m_auireable = false; + m_onStop(true, 0); + } + } + else + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + } +} + +void Widget::SetEnableShow(bool show) +{ + m_auireable = show; + aquiredimgindx = 0; +} + +void Widget::SetCallBack(std::function onstop) +{ + m_onStop = onstop; +} + +void Widget::SetPic_format() +{ + m_drv->Setformat(std::string(ui->comboBox_6->currentText().toUtf8())); +} + +void Widget::retDevStr() +{ + if (calldevs.empty()) + { + QMessageBox::information(this, "ȷ", "ϸ豸"); + return; + } + + QString s= QString::fromLocal8Bit(calldevs.data());//strתQString + QMessageBox::information(this, "ȷ", s); + calldevs.clear(); +} + +void Widget::OnBnClickedBtnPrepage() +{ + imageindex--; + if (imageindex < 0) + imageindex = 0; + + if (m_path.size() > 0) + { + DrawPicture(m_path[imageindex]); + } +} + +void Widget::OnBnClickedBtnNextpage() +{ + imageindex++; + if (imageindex >= m_path.size()) + imageindex = m_path.size() - 1; + if (m_path.size() > 0) + { + DrawPicture(m_path[imageindex]); + } +} + +void Widget::pushbut() +{ + +} + + +void Widget::OnBnClickedBtnSetPicSavePath() +{ + //ѡļ + QString srcDirPath = QFileDialog::getExistingDirectory(this, "choose src Directory", "/"); + if (srcDirPath.isEmpty()) + { + return; + } + qDebug() << "srcDirPath=" << srcDirPath; + srcDirPath += "/"; + ui->lineEdit_70->setText(srcDirPath); + m_drv->SetPath(std::string(srcDirPath.toUtf8())); +} + +void Widget::OnBnClickedBtnSelectfile() +{ + QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), NULL, tr("*.zip;;*.ldr")); //ѡļ + if (!fileName.isEmpty()) + { + ui->lineEdit_65->setText(fileName); + updateFilePath = std::string(fileName.toUtf8()); + } +} + +void Widget::OnBnClickedBtnUpdate() +{ + + QMessageBox messageBox(QMessageBox::NoIcon, "", "ȷʼ", QMessageBox::Yes | QMessageBox::No, NULL); + int result = messageBox.exec(); + switch (result) + { + case QMessageBox::Yes: + qDebug() << "Yes"; + Widget::updatefunc(); + break; + case QMessageBox::No: + qDebug() << "NO"; + break; + default: + break; + } +} + +void Widget::OnBnClickedCheckparamset() +{ + if (!m_drv->is_connect()) + { + QMessageBox::warning(nullptr, "", "ɨδ"); + return; + } + int correcType = ui->comboBox->currentIndex(); + UItoParam(correcType); + m_drv->SendFlatData(params, correcType); +} + +void Widget::OnBnClickedCheckparamread() +{ + if (!m_drv->is_connect()) + { + QMessageBox::warning(nullptr, "", "ɨδ"); + return; + } + auto read = m_drv->GetFlatData(); + jsonparams =read; + updateA4Config(read); + UpdateToFace(); +} + +void Widget::OnBnClickedBtnFlat() +{ + if (!m_drv->is_connect()) + { + QMessageBox::warning(this, "error", "ɨδ"); + return; + } + + QMessageBox messageBox(QMessageBox::NoIcon, "׼", "ȷʼԶУ׼?", QMessageBox::Yes | QMessageBox::No, NULL); + int result = messageBox.exec(); + switch (result) + { + case QMessageBox::Yes: + ui->tabWidget->setCurrentIndex(2); + qDebug() << "Yes"; + m_drv->setflatcallback([&](std::string str,bool flag)->void{ + if(str.empty()) + return; + ui->te_flat_log->append(str.c_str()); + if(flag) + ui->te_flat_log->append("Уɣ"); + }); + m_drv->StartFlat(ui->cb_flat_mode->isChecked()); + break; + + case QMessageBox::No: + qDebug() << "NO"; + break; + default: + break; + } + +} + +void Widget::OnCbnSelChangeDpi() +{ + m_iDpiIndex = ui->comboBox_3->currentIndex(); +} + +void Widget::OnBnClickedBtngetSerial() +{ + auto serial = m_drv->GetSerialNum(); + ui->lineEdit_33->setText(serial.c_str()); +} + +void Widget::OnBnClickedBtnSetSerial() +{ + QString cserial = ui->lineEdit_33->text();; + if (!cserial.isEmpty()) + { + m_drv->SetSerialNum(std::string(cserial.toUtf8())); + } + else + QMessageBox::warning(nullptr, "", "к"); +} + +void Widget::OnBnClickedBtnGethor() +{ + int ratio = 0; + m_drv->GetRatio(0, ratio); + float f_ratio = *(float*)∶ + QString str; + str.sprintf("%.4f", f_ratio); + ui->lineEdit_34->setText(str); +} + +void Widget::OnBnClickedBtnSethor() +{ + QString str = ui->lineEdit_34->text(); + if (!str.isEmpty()) + { + float f_value = str.toFloat(); + int value = *(int*)&f_value; + m_drv->SetRatio(0, value); + } + else + QMessageBox::warning(nullptr, "", ""); +} + +void Widget::OnBnClickedBtnGetver() +{ + int ratio = 0; + m_drv->GetRatio(1, ratio); + float f_ratio = *(float*)∶ + QString str; + str.sprintf("%.4f", f_ratio); + ui->lineEdit_35->setText(str); +} + +void Widget::OnBnClickedBtnSetver() +{ + QString str = ui->lineEdit_35->text(); + if (!str.isEmpty()) + { + float f_value = str.toFloat(); + int value = *(int*)&f_value; + m_drv->SetRatio(1, value); + } + else + QMessageBox::warning(nullptr, "", ""); +} + +void Widget::OnBnClickedBtnGetexpos() +{ + int esposeA, exposeB; + m_drv->GetExpose(esposeA, exposeB); + QString expA, expB; + expA.sprintf("%d", esposeA); + expB.sprintf("%d", exposeB); + ui->lineEdit_36->setText(expA); + ui->lineEdit_37->setText(expB); +} + +void Widget::OnBnClickedBtnSetexpos() +{ + QString expA = ui->lineEdit_36->text(); + QString expB = ui->lineEdit_37->text(); + UINT32 esposeA, exposeB; + if (!expA.isEmpty() && !expB.isEmpty()) + { + esposeA = expA.toInt(); + exposeB = expB.toInt(); + m_drv->SetExpose(esposeA, exposeB); + } + else + QMessageBox::warning(nullptr, "", "UV"); +} + +void Widget::OnBnClickedBtngetVersion() +{ + std::string ver = m_drv->GetFWVersion(); + if (!ver.empty()) + ui->lineEdit_38->setText(ver.c_str()); +} + +void Widget::OnBnClickedBtnReboot() +{ + QMessageBox messageBox(QMessageBox::NoIcon, "", "ȷҪɨ?", QMessageBox::Yes | QMessageBox::No, NULL); ; + int result = messageBox.exec(); + switch (result) + { + case QMessageBox::Yes: + qDebug() << "Yes"; + m_drv->Reboot(); + break; + case QMessageBox::No: + qDebug() << "NO"; + break; + default: + break; + } +} + +void Widget::OnBnClickedBtngetgraysp() +{ + OnGetOrSetSp(true, 0); +} + +void Widget::OnBnClickedBtnsetgraysp() +{ + OnGetOrSetSp(false, 0); +} + +void Widget::OnBnClickedBtngetcolorsp() +{ + OnGetOrSetSp(true, 1); +} + +void Widget::OnBnClickedBtnsetcolorsp() +{ + OnGetOrSetSp(false, 1); +} + +void Widget::OnBnClickedBtngetuvsp() +{ + OnGetOrSetSp(true, 2); +} + +void Widget::OnBnClickedBtnsetuvsp() +{ + OnGetOrSetSp(false, 2); +} + +void Widget::OnBnClickedBtngetsleeptime() +{ + UpdateSleepTime(true); +} + +void Widget::OnBnClickedBtnsetsleeptime() +{ + UpdateSleepTime(false); +} + +void Widget::OnBnClickedBtngetspeedmode() +{ + OnGetOrSetSpeedMode(true); +} + +void Widget::OnBnClickedBtnsetspeedmode() +{ + OnGetOrSetSpeedMode(false); +} + + + +void Widget::on_pb_log_clear_clicked() +{ + ui->te_flat_log->clear(); +} + +void Widget::on_bt_IP_clicked() +{ + ui->le_IP->setText(m_drv->getip().c_str()); +} + + +void Widget::on_bt_kernel_clicked() +{ + ui->le_kernel->setText(m_drv->getkernelversion().c_str()); +} + +void Widget::on_bt_getvid_clicked() +{ + int id=0; + m_drv->usbvidpid(id,true); + ui->lineEdit_39->setText(QString::number(id&0xffff,16)); + ui->lineEdit_41->setText(QString::number((id>>16)&0xffff,16)); +} + +void Widget::on_bt_setvid_clicked() +{ + int id=0; + id = ui->lineEdit_39->text().toInt(NULL,16); + id += (ui->lineEdit_41->text().toInt(NULL,16)<<16); + m_drv->usbvidpid(id,false); +} + +void Widget::on_btn_logsave_clicked() +{ + QString path=QFileDialog::getSaveFileName(this,"ѡ񱣴·",nullptr,"*.log"); + if(path.isNull()) + return; + ofstream f(std::string(path.toUtf8())); + if(f.is_open()) + { + std::string data= std::string(ui->te_flat_log->toPlainText().toUtf8()); + f.write(data.data(),data.length()); + f.close(); + } + else{ + QMessageBox::warning(this,"","δɹļ"); + } +} + +void Widget::on_btn_getrollernum_clicked() +{ + int value = 0; + m_drv->GetOrSetRoller(value,false); + ui->le_rollernum->setText(QString::number(value)); +} + +void Widget::on_btn_clearroller_clicked() +{ + int value = 0; + m_drv->GetOrSetRoller(value,true); + ui->le_rollernum->setText(QString::number(value)); +} + + + +void Widget::on_bt_getmotorversion_clicked() +{ + ui->le_motorversion->setText(m_drv->GetMBVersion().c_str()); +} + +void Widget::on_bt_getsysinfo_clicked() +{ + QMessageBox::information(this,"SystemInfo",m_drv->GetSysInfo().c_str(),QMessageBox::Ok); +} + +void Widget::on_bt_getgraybright_clicked() +{ + ui->le_garybright->setText(m_drv->GetOrSetbright(true,false,0).c_str()); +} + +void Widget::on_bt_getcolorbright_clicked() +{ + ui->le_colorbright->setText(m_drv->GetOrSetbright(true,true,0).c_str()); +} + +void Widget::on_bt_setgarybright_clicked() +{ + uint value = ui->le_garybright->text().toUInt(); + if(value > 100) + m_drv->GetOrSetbright(false,false,value).c_str(); +} + +void Widget::on_bt_setcolorbright_clicked() +{ + uint value = ui->le_colorbright->text().toUInt(); + if(value > 100) + m_drv->GetOrSetbright(false,true,value).c_str(); +} diff --git a/tool_ui/widget.h b/tool_ui/widget.h new file mode 100644 index 0000000..4aad666 --- /dev/null +++ b/tool_ui/widget.h @@ -0,0 +1,241 @@ +#ifndef WIDGET_H +#define WIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include "correction_tool.h" + + + + + +QT_BEGIN_NAMESPACE +namespace Ui { class Widget; } +QT_END_NAMESPACE + +#define COLOR "color" +#define GRAY "gray" + +union HG_ScanConfiguration +{ + struct + { + unsigned int pageSize : 5; + unsigned int isColor : 1; + unsigned int dpi : 2; + unsigned int doubleFeeded : 1; + unsigned int enableUV : 1; + unsigned int enableLed : 1; + unsigned int reversed1 : 6; + unsigned int isCorrect : 1; + unsigned int dstHeight : 8; + unsigned int reversed2 : 6; + } params; + unsigned int value; +}; + + + +class Widget : public QWidget +{ + Q_OBJECT + +public: + Widget(QWidget* parent = nullptr); + ~Widget(); + + +private: + Ui::Widget* ui; + + + +public slots: + + void pushbut(); + /// ѡUSB + void OnCbnSelchangeCmbUsbs(); + /// ʼɨ + void OnBnClickedBtnstart(); + ///ֹͣɨ + void OnBnClickedBtnstop(); + /// ɫ + void OnCbnSelChangeColor(); + /// ɨUSB + void OnBnClickedBtnRefresh(); + //У׼ģʽ + void OnCbnSelChangeA4FlatModel(); + /// 桪ƫ" + " + void OnBnClickedBtnaup(); + /// 桪ƫ" - " + void OnBnClickedBtnadown(); + /// 桪ƫ" + " + void OnBnClickedBtnbup(); + /// 桪ƫ" - " + void OnBnClickedBtnbdown(); + //ѡļ + void OnBnClickedBtnSelectfile(); + ///ʼ + void OnBnClickedBtnUpdate(); + ///У + void OnBnClickedCheckparamset(); + ///Уȡ + void OnBnClickedCheckparamread(); + ///ԶУ + void OnBnClickedBtnFlat(); + ///DPI + void OnCbnSelChangeDpi(); + /// ȡк + void OnBnClickedBtngetSerial(); + /// к + void OnBnClickedBtnSetSerial(); + ///ȡ + void OnBnClickedBtnGethor(); + ///ú + void OnBnClickedBtnSethor(); + ///ȡ + void OnBnClickedBtnGetver(); + /// + void OnBnClickedBtnSetver(); + ///UVȡع + void OnBnClickedBtnGetexpos(); + ///UVع + void OnBnClickedBtnSetexpos(); + ///ȡ̼Ű汾 + void OnBnClickedBtngetVersion(); + /// ɨ + void OnBnClickedBtnReboot(); + ///flag = TURE type = 0 ȡɫSP + void OnBnClickedBtngetgraysp(); + ///flag = FLASE type = 0 ûɫSP + void OnBnClickedBtnsetgraysp(); + ///flag = TURE type = 1 ȡɫSP + void OnBnClickedBtngetcolorsp(); + ///flag = flase type = 1 òɫSP + void OnBnClickedBtnsetcolorsp(); + ///flag = TURE type = 2 ȡUVSP + void OnBnClickedBtngetuvsp(); + ///flag = flase type = 2 UVSP + void OnBnClickedBtnsetuvsp(); + ///ȡSPʱ + void OnBnClickedBtngetsleeptime(); + ///SPʱ + void OnBnClickedBtnsetsleeptime(); + ///ȡSP + void OnBnClickedBtngetspeedmode(); + ///SP + void OnBnClickedBtnsetspeedmode(); + //ͼ·ѡ + void OnBnClickedBtnSetPicSavePath(); + //һҳ + void OnBnClickedBtnPrepage(); + //һҳ + void OnBnClickedBtnNextpage(); + //UIȡУ + void UItoParam(int type); + + ///豸״̬ + void retDevStr(); + void changespeedmode(int type); + +signals: + ///豸Ϣʾ + void retdevMessageout(const char* ptr); + void usbchange(int type); + +public: + std::vector Exposures1, Gains1, Offsets1; + std::list dpi300GC_dpi200GC; + int m_iColorIndex;//ɫѡ + int m_iDpiIndex;//DPIѡ + + QString timeStr;//ʾʱ + std::shared_ptr m_drv; + JsonConfig jsonConfig; + CorrectParam params; + CaptureParams jsonparams; + +public: + ///ʼ + void OnInit(); + ///ɨusb + bool RefreshUSBList(); + ///ɨ + void Scan(); + /// ļ + void updateA4Config(CaptureParams& pValue); + ///ʼʱȡļ + void LoadCfg(); + ///дļ + - + void UpdateGains(int id, bool increase); + ///ϵͳ + void updatefunc(); + ///豸ļ + void UpdateToFace(); + ///ȡSP + void OnGetOrSetSp(bool get, int type); + ///ȡʱ + void UpdateSleepTime(bool flag); + ///ȡSP + void OnGetOrSetSpeedMode(bool flag); + ///ļA + void CreateScanFile(); + //ͼʾڽ + void DrawPicture(QString path); + ///ͼ + void showfun(); + //ʼɨ迪ʼʱIJ + void SetEnableShow(bool show); + //ص + void SetCallBack(std::function onstop); + //ͼƬʽ + void SetPic_format(); + + + char buff[128]; + string calldevs; + +private: + std::string updateFilePath; + std::thread m_updateimgshow; + + volatile bool m_run; + volatile bool m_auireable; + void* parent1; + volatile int imageindex = 0; + volatile int aquiredimgindx = 0; + std::vector m_path; + std::function m_onStop; + + +private slots: + void on_pb_log_clear_clicked(); + void on_bt_IP_clicked(); + void on_bt_kernel_clicked(); + void on_bt_getvid_clicked(); + void on_bt_setvid_clicked(); + void on_btn_logsave_clicked(); + void on_btn_getrollernum_clicked(); + void on_btn_clearroller_clicked(); + void on_bt_getmotorversion_clicked(); + void on_bt_getsysinfo_clicked(); + void on_bt_getgraybright_clicked(); + void on_bt_getcolorbright_clicked(); + void on_bt_setgarybright_clicked(); + void on_bt_setcolorbright_clicked(); +}; +#endif // WIDGET_H diff --git a/qt-correction-tool/widget.ui b/tool_ui/widget.ui similarity index 87% rename from qt-correction-tool/widget.ui rename to tool_ui/widget.ui index 4bf0336..f251c07 100644 --- a/qt-correction-tool/widget.ui +++ b/tool_ui/widget.ui @@ -11,46 +11,14 @@ - 华高 + 校正工具 - QPushButton{ - background:#e6f0fa; - border:2px groove gray; - border-radius:10px; - padding:2px 4px + QWidget{ + background-color:rgb(255,255,255); } - -QPushButton:pressed { /*按钮被按下时*/ - background-color:rgba(100,255,100, 200); - border-color: rgba(255, 225, 255, 30); - border-style: inset; - color:rgba(0, 0, 0, 100); -} -QPushButton:hover{ /*鼠标悬停在按钮上时*/ - background-color:rgba(100,255,100, 100); - border-color: rgba(255, 225, 255, 200); - color:rgba(0, 0, 0, 200); -} - -QWidget{ - border:2px groove gray; - border-radius:10px; - padding:2px 4px; -} -QLabel{ - background-color: rgb(192, 188, 200); -} -QToolButton:pressed { /*按钮被按下时*/ - background-color:rgba(100,255,100, 200); - border-color: rgba(255, 225, 255, 30); - border-style: inset; - color:rgba(0, 0, 0, 100); -} -QToolButton:hover{ /*鼠标悬停在按钮上时*/ - background-color:rgba(100,255,100, 100); - border-color: rgba(255, 225, 255, 200); - color:rgba(0, 0, 0, 200); +QLineEdit{ + qproperty-alignment:AlignHCenter; } @@ -84,7 +52,7 @@ QToolButton:hover{ /*鼠标悬停在按钮上时*/ 10 40 301 - 21 + 31 @@ -92,11 +60,21 @@ QToolButton:hover{ /*鼠标悬停在按钮上时*/ 10 - 70 + 90 301 - 41 + 21 + + QProgressBar { + border: 2px solid grey; + background-color: #FFFFFF;} +QProgressBar::chunk { +background-color: #05B8CC; +} +QProgressBar { + text-align: center;} + 0 @@ -120,7 +98,7 @@ QToolButton:hover{ /*鼠标悬停在按钮上时*/ - 100 + 30 119 71 41 @@ -141,23 +119,10 @@ QToolButton:hover{ /*鼠标悬停在按钮上时*/ - QPushButton:hover{ /*鼠标悬停在按钮上时*/ - background-color:rgba(100,255,100, 100); - border-color: rgba(255, 225, 255, 200); - color:rgba(0, 0, 0, 200); -} - -QPushButton:pressed { /*按钮被按下时*/ - background-color:rgba(100,255,100, 200); - border-color: rgba(255, 225, 255, 30); - border-style: inset; - color:rgba(0, 0, 0, 100); -} - - + - 0 + 2 @@ -166,7 +131,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 140 + 150 150 51 31 @@ -179,7 +144,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 500 + 510 300 51 31 @@ -192,7 +157,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 370 + 400 250 51 20 @@ -205,7 +170,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 500 + 510 180 51 31 @@ -218,7 +183,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 230 + 240 300 51 31 @@ -231,7 +196,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 + 70 330 51 31 @@ -241,23 +206,10 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 420 - 130 - 21 - 20 - - - - 5 - - - 560 + 570 450 41 31 @@ -270,7 +222,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 320 + 330 330 51 31 @@ -280,19 +232,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 510 - 130 - 21 - 20 - - - - 6 - - @@ -309,7 +248,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 430 + 440 459 61 31 @@ -319,7 +258,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 620 + 630 150 41 31 @@ -342,7 +281,7 @@ QPushButton:pressed { /*按钮被按下时*/ - + 310 @@ -358,8 +297,8 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 - 429 + 70 + 430 61 31 @@ -368,12 +307,15 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 + 70 150 51 31 + + + @@ -394,7 +336,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 140 + 150 300 51 31 @@ -404,19 +346,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 320 - 392 - 101 - 21 - - - - 自动生成序列号 - - @@ -427,26 +356,13 @@ QPushButton:pressed { /*按钮被按下时*/ - VID - - - - - - 70 - 280 - 21 - 20 - - - - 1 + VID: - 230 + 240 330 51 31 @@ -469,23 +385,10 @@ QPushButton:pressed { /*按钮被按下时*/ 纵向: - - - - 150 - 280 - 21 - 20 - - - - 2 - - - 320 + 330 150 51 31 @@ -498,8 +401,8 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 - 459 + 70 + 460 61 31 @@ -508,7 +411,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 410 + 420 330 51 31 @@ -521,7 +424,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 70 + 80 390 121 21 @@ -544,7 +447,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 570 + 580 150 41 31 @@ -557,8 +460,8 @@ QPushButton:pressed { /*按钮被按下时*/ - 430 - 390 + 330 + 392 101 21 @@ -570,7 +473,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 320 + 330 180 51 31 @@ -583,7 +486,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 160 + 180 250 51 21 @@ -596,7 +499,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 500 + 510 150 51 31 @@ -609,7 +512,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 200 + 210 460 41 31 @@ -622,7 +525,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 1 + 21 101 51 21 @@ -635,7 +538,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 370 + 400 100 51 20 @@ -645,23 +548,10 @@ QPushButton:pressed { /*按钮被按下时*/ 238 - - - - 240 - 280 - 21 - 20 - - - - 3 - - - 500 + 510 330 51 31 @@ -674,7 +564,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 320 + 330 300 51 31 @@ -687,7 +577,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 410 + 420 300 51 31 @@ -713,7 +603,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 210 + 240 250 51 20 @@ -726,7 +616,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 + 70 180 51 31 @@ -736,23 +626,10 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 510 - 280 - 21 - 20 - - - - 6 - - - 410 + 420 180 51 31 @@ -765,7 +642,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 620 + 630 300 41 31 @@ -791,7 +668,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 230 + 240 180 51 31 @@ -824,26 +701,13 @@ QPushButton:pressed { /*按钮被按下时*/ - PID - - - - - - 420 - 280 - 21 - 21 - - - - 5 + PID: - 510 + 520 450 41 31 @@ -856,7 +720,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 320 + 340 250 51 21 @@ -869,7 +733,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 + 80 100 51 20 @@ -895,7 +759,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 200 + 210 430 41 31 @@ -908,7 +772,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 50 + 80 250 51 20 @@ -917,11 +781,14 @@ QPushButton:pressed { /*按钮被按下时*/ 238 + + Qt::AlignHCenter + - 210 + 240 100 51 20 @@ -940,6 +807,9 @@ QPushButton:pressed { /*按钮被按下时*/ 21 + + true + @@ -957,7 +827,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 321 + 341 100 51 21 @@ -970,7 +840,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 210 + 220 392 101 21 @@ -983,7 +853,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 150 + 160 430 41 31 @@ -996,7 +866,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 161 + 181 100 51 21 @@ -1019,7 +889,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 校准模式: + 模式: @@ -1049,19 +919,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 330 - 130 - 21 - 20 - - - - 4 - - @@ -1075,7 +932,7 @@ QPushButton:pressed { /*按钮被按下时*/ 横向: - + 200 @@ -1091,7 +948,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 570 + 580 300 41 31 @@ -1101,23 +958,10 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 240 - 130 - 21 - 20 - - - - 3 - - - 410 + 420 150 51 31 @@ -1143,7 +987,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 60 + 70 300 51 31 @@ -1156,7 +1000,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 230 + 240 150 51 31 @@ -1169,7 +1013,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 0 + 20 250 51 21 @@ -1179,36 +1023,10 @@ QPushButton:pressed { /*按钮被按下时*/ R曝光: - - - - 70 - 130 - 21 - 20 - - - - 1 - - - - - - 150 - 130 - 21 - 20 - - - - 2 - - - 150 + 160 460 41 31 @@ -1218,23 +1036,10 @@ QPushButton:pressed { /*按钮被按下时*/ GET - - - - 330 - 280 - 21 - 20 - - - - 4 - - - 430 + 440 429 61 31 @@ -1244,7 +1049,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 140 + 150 180 51 31 @@ -1277,10 +1082,7 @@ QPushButton:pressed { /*按钮被按下时*/ - QLabel{ - - background-color: rgb(255, 255, 255); -} + 背面: @@ -1296,10 +1098,7 @@ QPushButton:pressed { /*按钮被按下时*/ - QLabel{ - - background-color: rgb(255, 255, 255); -} + 正面: @@ -1308,7 +1107,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 140 + 150 330 51 31 @@ -1329,92 +1128,112 @@ QPushButton:pressed { /*按钮被按下时*/ - Arial Black + 宋体 10 - 75 - true + 50 + false 重启扫描仪 - + - 50 - 650 - 91 + 20 + 601 + 42 31 - 200DPI_G + 滚轴: - + 160 - 650 - 101 + 600 + 41 31 - 200DPI_C + 获取 - + - 50 - 690 - 91 + 70 + 600 + 61 + 31 + + + + true + + + + + + 210 + 600 + 41 31 - 300DPI_G + 清零 - + - 160 - 690 - 101 + 680 + 149 + 31 31 - - 300DPI_C - - + - 460 - 100 - 71 + 350 + 511 + 81 21 - 灰曝光: + 电机板版本号: - + - 550 - 100 - 51 + 440 + 510 + 161 20 + + + + + 600 + 510 + 41 + 21 + + - 238 + GET @@ -1448,19 +1267,6 @@ QPushButton:pressed { /*按钮被按下时*/ 下一页 - - - - 0 - 0 - 791 - 671 - - - - 正反面图像 - - @@ -1505,22 +1311,6 @@ QPushButton:pressed { /*按钮被按下时*/ ... - - - - 380 - 740 - 21 - 21 - - - - - - - false - - @@ -1565,24 +1355,21 @@ QPushButton:pressed { /*按钮被按下时*/ + + + + 0 + 20 + 801 + 651 + + + CIS设置 - - - - 20 - 20 - 61 - 20 - - - - SP设置 - - @@ -1625,122 +1412,109 @@ QPushButton:pressed { /*按钮被按下时*/ - 110 - 60 + 90 + 65 51 - 31 + 21 - 110 - 89 + 90 + 95 51 - 31 + 21 - 110 - 120 + 90 + 125 51 - 31 + 21 - 180 + 140 60 - 51 + 41 31 - 获取SP + 获取 - 180 + 140 90 - 51 + 41 31 - 获取SP + 获取 - 180 + 140 120 - 51 + 41 31 - 获取SP + 获取 - 240 + 190 60 - 51 + 41 31 - 设置SP + 设置 - 240 + 190 90 - 51 + 41 31 - 设置SP + 设置 - 240 + 190 120 - 51 + 41 31 - 设置SP - - - - - - 20 - 190 - 71 - 20 - - - - 休眠设置 + 设置 @@ -1759,9 +1533,9 @@ QPushButton:pressed { /*按钮被按下时*/ - 130 + 150 240 - 71 + 131 31 @@ -1769,7 +1543,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 210 + 330 240 121 31 @@ -1782,7 +1556,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 350 + 470 240 121 31 @@ -1805,20 +1579,10 @@ QPushButton:pressed { /*按钮被按下时*/ 速率获取和设置 - - - - 130 - 290 - 71 - 31 - - - - 210 + 330 290 121 31 @@ -1831,7 +1595,7 @@ QPushButton:pressed { /*按钮被按下时*/ - 350 + 470 290 121 31 @@ -1841,6 +1605,235 @@ QPushButton:pressed { /*按钮被按下时*/ 设置速度模式 + + + + 20 + 380 + 581 + 401 + + + + + + + 620 + 740 + 75 + 23 + + + + 清空log + + + + + + 150 + 290 + 131 + 31 + + + + + + + 20 + 161 + 81 + 31 + + + + IP 地址 + + + + + + 110 + 160 + 411 + 31 + + + + + + + 20 + 200 + 81 + 31 + + + + kernel版本信息 + + + + + + 110 + 200 + 411 + 31 + + + + + + + 530 + 200 + 51 + 31 + + + + 获取 + + + + + + 530 + 160 + 51 + 31 + + + + 获取 + + + + + + 620 + 700 + 75 + 23 + + + + 导出log + + + + + + 270 + 65 + 101 + 21 + + + + 彩色明场最大值: + + + + + + 270 + 95 + 101 + 21 + + + + 灰度明场最大值: + + + + + + 370 + 65 + 61 + 20 + + + + + + + 370 + 95 + 61 + 20 + + + + + + + 440 + 65 + 40 + 23 + + + + 获取 + + + + + + 500 + 65 + 40 + 23 + + + + 设置 + + + + + + 440 + 95 + 40 + 23 + + + + 获取 + + + + + + 500 + 95 + 40 + 23 + + + + 设置 + + + + + + 270 + 125 + 75 + 23 + + + + 系统信息 + + @@ -1879,10 +1872,10 @@ QPushButton:pressed { /*按钮被按下时*/ - Arial Black + 宋体 8 - 75 - true + 50 + false @@ -1902,19 +1895,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 40 - 120 - 71 - 31 - - - - 计 时: - - @@ -1952,20 +1932,15 @@ QPushButton:pressed { /*按钮被按下时*/ - Arial Black + 宋体 8 - 75 - true + 50 + false - 150 + 200 - - - 150 - - 200 @@ -1976,12 +1951,17 @@ QPushButton:pressed { /*按钮被按下时*/ 300 + + + 600 + + 40 - 150 + 130 71 31 @@ -1994,7 +1974,7 @@ QPushButton:pressed { /*按钮被按下时*/ 110 - 150 + 130 71 31 @@ -2016,7 +1996,7 @@ QPushButton:pressed { /*按钮被按下时*/ 40 190 - 71 + 51 31 @@ -2035,10 +2015,10 @@ QPushButton:pressed { /*按钮被按下时*/ - Arial Black + 宋体 10 - 75 - true + 50 + false @@ -2061,36 +2041,23 @@ QPushButton:pressed { /*按钮被按下时*/ 230 - 170 + 180 77 51 - Arial Black + 宋体 10 - 75 - true + 50 + false 停止扫描 - - - - 110 - 120 - 71 - 31 - - - - QLCDNumber::Flat - - @@ -2120,10 +2087,10 @@ QPushButton:pressed { /*按钮被按下时*/ - 180 - 30 - 121 - 61 + 170 + 50 + 131 + 41 @@ -2143,6 +2110,19 @@ QPushButton:pressed { /*按钮被按下时*/ 校准参数读取 + + + + 180 + 20 + 101 + 21 + + + + 彩色 校正 + + @@ -2161,7 +2141,7 @@ QPushButton:pressed { /*按钮被按下时*/ 31 31 - 101 + 91 20 @@ -2186,46 +2166,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - - - 130 - 70 - 151 - 21 - - - - - Arial Black - 75 - true - - - - G100 - - - - G100 - - - - - G200 - - - - - G300 - - - - - G400 - - - @@ -2239,21 +2179,16 @@ QPushButton:pressed { /*按钮被按下时*/ 重新扫描USB - - - - 30 - 70 - 101 - 20 - - - - 设备选择: - - + + + Imageview + QWidget +

imageview.h
+ 1 + + @@ -2640,22 +2575,6 @@ QPushButton:pressed { /*按钮被按下时*/ - - pushButton_33 - clicked() - Widget - OnBnCkickBtnRemind() - - - 402 - 781 - - - 760 - 600 - - - pushButton_3 clicked()